From ae7da04787edb6c11bc1e6acca3b661114d6abcf Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Fri, 19 Oct 2007 23:21:45 +0000 Subject: [PATCH] Delete all Trailing spaces in code. svn path=/trunk/; revision=29690 --- reactos/base/applications/cacls/lang/uk-UA.rc | 2 +- reactos/base/applications/cacls/lang/zh-TW.rc | 2 +- reactos/base/applications/calc/lang/fr-FR.rc | 2 +- reactos/base/applications/calc/lang/ja-JP.rc | 14 +- reactos/base/applications/calc/lang/zh-CN.rc | 2 +- reactos/base/applications/calc/resource.h | 2 +- reactos/base/applications/calc/winecalc.c | 40 +- .../base/applications/charmap/lang/el-GR.rc | 4 +- .../base/applications/charmap/lang/pl-PL.rc | 8 +- reactos/base/applications/charmap/lrgcell.c | 8 +- .../applications/cmdutils/find/lang/bg-BG.rc | 2 +- .../applications/cmdutils/find/lang/ca-ES.rc | 2 +- .../applications/cmdutils/find/lang/de-DE.rc | 2 +- .../applications/cmdutils/find/lang/en-US.rc | 2 +- .../applications/cmdutils/find/lang/it-IT.rc | 2 +- .../applications/cmdutils/find/lang/lt-LT.rc | 2 +- .../applications/cmdutils/find/lang/ru-RU.rc | 2 +- .../applications/cmdutils/find/lang/uk-UA.rc | 2 +- reactos/base/applications/control/control.c | 2 +- .../base/applications/control/lang/bg-BG.rc | 2 +- .../base/applications/control/lang/cs-CZ.rc | 2 +- .../base/applications/control/lang/da-DK.rc | 2 +- .../base/applications/control/lang/de-DE.rc | 2 +- .../base/applications/control/lang/el-GR.rc | 2 +- .../base/applications/control/lang/en-US.rc | 2 +- .../base/applications/control/lang/es-ES.rc | 2 +- .../base/applications/control/lang/fi-FI.rc | 2 +- .../base/applications/control/lang/fr-FR.rc | 2 +- .../base/applications/control/lang/hu-HU.rc | 2 +- .../base/applications/control/lang/id-ID.rc | 2 +- .../base/applications/control/lang/it-IT.rc | 2 +- .../base/applications/control/lang/ja-JP.rc | 2 +- .../base/applications/control/lang/lt-LT.rc | 2 +- .../base/applications/control/lang/nl-NL.rc | 2 +- .../base/applications/control/lang/pl-PL.rc | 2 +- .../base/applications/control/lang/pt-BR.rc | 2 +- .../base/applications/control/lang/ru-RU.rc | 2 +- .../base/applications/control/lang/sk-SK.rc | 2 +- .../base/applications/control/lang/sv-SE.rc | 2 +- .../base/applications/control/lang/th-TH.rc | 2 +- .../base/applications/control/lang/uk-UA.rc | 2 +- .../base/applications/control/lang/zh-CN.rc | 2 +- reactos/base/applications/control/resource.h | 2 +- .../games/solitaire/cardlib/cardbitmaps.cpp | 50 +- .../games/solitaire/cardlib/cardbutton.cpp | 64 +- .../games/solitaire/cardlib/cardcolor.cpp | 44 +- .../games/solitaire/cardlib/cardcolor.h | 8 +- .../games/solitaire/cardlib/cardcount.cpp | 12 +- .../games/solitaire/cardlib/cardcount.h | 2 +- .../games/solitaire/cardlib/cardlib.cpp | 2 +- .../games/solitaire/cardlib/cardregion.cpp | 68 +- .../games/solitaire/cardlib/cardregion.h | 30 +- .../games/solitaire/cardlib/cardrgndraw.cpp | 64 +- .../games/solitaire/cardlib/cardrgnmouse.cpp | 94 +- .../games/solitaire/cardlib/cardstack.cpp | 6 +- .../games/solitaire/cardlib/cardstack.h | 6 +- .../games/solitaire/cardlib/cardwindow.cpp | 72 +- .../games/solitaire/cardlib/cardwindow.h | 6 +- .../games/solitaire/cardlib/dropzone.cpp | 8 +- .../games/solitaire/cardlib/dropzone.h | 4 +- .../games/solitaire/lang/lt-LT.rc | 2 +- .../games/solitaire/lang/sk-SK.rc | 2 +- .../games/solitaire/lang/th-TH.rc | 2 +- .../games/solitaire/solcreate.cpp | 4 +- .../applications/games/solitaire/solgame.cpp | 12 +- .../games/solitaire/solitaire.cpp | 6 +- .../games/solitaire/solitaire.rbuild | 6 +- .../applications/games/winemine/lang/fr-FR.rc | 2 +- .../applications/games/winemine/lang/pl-PL.rc | 2 +- reactos/base/applications/hh/hh.rbuild | 2 +- reactos/base/applications/hh/main.c | 46 +- reactos/base/applications/hostname/hostname.c | 2 +- reactos/base/applications/logoff/logoff.c | 40 +- reactos/base/applications/mmc/lang/pl-PL.rc | 8 +- reactos/base/applications/mmc/mmc.rbuild | 2 +- .../base/applications/msconfig/lang/bg-BG.rc | 10 +- .../base/applications/msconfig/lang/ca-ES.rc | 10 +- .../base/applications/msconfig/lang/cs-CZ.rc | 10 +- .../base/applications/msconfig/lang/de-DE.rc | 12 +- .../base/applications/msconfig/lang/en-US.rc | 10 +- .../base/applications/msconfig/lang/fr-FR.rc | 10 +- .../base/applications/msconfig/lang/hu-HU.rc | 6 +- .../base/applications/msconfig/lang/id-ID.rc | 10 +- .../base/applications/msconfig/lang/it-IT.rc | 10 +- .../base/applications/msconfig/lang/nl-NL.rc | 10 +- .../base/applications/msconfig/lang/pl-PL.rc | 12 +- .../base/applications/msconfig/lang/ru-RU.rc | 10 +- .../base/applications/msconfig/lang/th-TH.rc | 10 +- .../base/applications/msconfig/lang/uk-UA.rc | 10 +- .../base/applications/msconfig/lang/zh-CN.rc | 10 +- .../base/applications/msconfig/systempage.c | 2 +- .../base/applications/msconfig/toolspage.c | 8 +- .../mscutils/devmgmt/lang/pl-PL.rc | 8 +- .../applications/mscutils/eventvwr/eventvwr.c | 188 +- .../mscutils/eventvwr/lang/de-DE.rc | 8 +- .../mscutils/eventvwr/lang/en-US.rc | 8 +- .../mscutils/eventvwr/lang/fr-FR.rc | 8 +- .../mscutils/eventvwr/lang/ru-RU.rc | 8 +- .../applications/mscutils/eventvwr/resource.h | 2 +- .../applications/mscutils/servman/control.c | 2 +- .../applications/mscutils/servman/mainwnd.c | 2 +- .../applications/mscutils/servman/start.c | 2 +- .../base/applications/mscutils/servman/stop.c | 2 +- reactos/base/applications/network/arp/arp.c | 6 +- .../network/ipconfig/lang/bg-BG.rc | 2 +- .../network/ipconfig/lang/en-US.rc | 2 +- .../network/ipconfig/lang/fr-FR.rc | 2 +- .../network/ipconfig/lang/id-ID.rc | 2 +- .../network/ipconfig/lang/it-IT.rc | 2 +- .../network/ipconfig/lang/ru-RU.rc | 2 +- .../network/ipconfig/lang/uk-UA.rc | 2 +- .../base/applications/network/net/cmdStop.c | 40 +- .../base/applications/network/net/cmdstart.c | 40 +- reactos/base/applications/network/net/help.c | 8 +- reactos/base/applications/network/net/main.c | 14 +- .../base/applications/network/net/process.c | 140 +- .../base/applications/network/route/route.c | 6 +- .../network/telnet/resource/tnmsg.rc | 2 +- .../network/telnet/src/ansiprsr.cpp | 126 +- .../network/telnet/src/keytrans.cpp | 20 +- .../network/telnet/src/tcharmap.cpp | 2 +- .../network/telnet/src/tconsole.cpp | 92 +- .../network/telnet/src/tmapldr.cpp | 114 +- .../network/telnet/src/tmouse.cpp | 18 +- .../network/telnet/src/tnclass.cpp | 6 +- .../network/telnet/src/tnclip.cpp | 4 +- .../applications/network/telnet/src/tncon.cpp | 14 +- .../network/telnet/src/tnconfig.cpp | 8 +- .../network/telnet/src/tnmain.cpp | 76 +- .../network/telnet/src/tnmisc.cpp | 16 +- .../network/telnet/src/tscroll.cpp | 14 +- .../network/telnet/src/ttelhndl.cpp | 44 +- .../base/applications/network/whois/whois.c | 2 +- .../base/applications/notepad/lang/bg-BG.rc | 4 +- .../base/applications/notepad/lang/cs-CZ.rc | 4 +- .../base/applications/notepad/lang/da-DK.rc | 2 +- .../base/applications/notepad/lang/de-DE.rc | 8 +- .../base/applications/notepad/lang/el-GR.rc | 14 +- .../base/applications/notepad/lang/en-US.rc | 4 +- .../base/applications/notepad/lang/es-ES.rc | 6 +- .../base/applications/notepad/lang/fi-FI.rc | 8 +- .../base/applications/notepad/lang/fr-FR.rc | 10 +- .../base/applications/notepad/lang/hu-HU.rc | 12 +- .../base/applications/notepad/lang/id-ID.rc | 4 +- .../base/applications/notepad/lang/it-IT.rc | 10 +- .../base/applications/notepad/lang/ja-JP.rc | 4 +- .../base/applications/notepad/lang/lt-LT.rc | 8 +- .../base/applications/notepad/lang/nl-NL.rc | 2 +- .../base/applications/notepad/lang/pl-PL.rc | 8 +- .../base/applications/notepad/lang/pt-PT.rc | 4 +- .../base/applications/notepad/lang/ru-RU.rc | 12 +- .../base/applications/notepad/lang/sk-SK.rc | 4 +- .../base/applications/notepad/lang/sl-SI.rc | 4 +- .../base/applications/notepad/lang/sv-SE.rc | 4 +- .../base/applications/notepad/lang/th-TH.rc | 4 +- .../base/applications/notepad/lang/uk-UA.rc | 4 +- .../base/applications/notepad/lang/zh-CN.rc | 4 +- reactos/base/applications/regedit/childwnd.c | 12 +- .../applications/regedit/clb/lang/it-IT.rc | 2 +- reactos/base/applications/regedit/edit.c | 8 +- reactos/base/applications/regedit/framewnd.c | 12 +- .../base/applications/regedit/lang/bg-BG.rc | 20 +- .../base/applications/regedit/lang/cs-CZ.rc | 8 +- .../base/applications/regedit/lang/de-DE.rc | 18 +- .../base/applications/regedit/lang/en-US.rc | 20 +- .../base/applications/regedit/lang/es-ES.rc | 26 +- .../base/applications/regedit/lang/fr-FR.rc | 22 +- .../base/applications/regedit/lang/hu-HU.rc | 8 +- .../base/applications/regedit/lang/id-ID.rc | 20 +- .../base/applications/regedit/lang/it-IT.rc | 34 +- .../base/applications/regedit/lang/ja-JP.rc | 8 +- .../base/applications/regedit/lang/nl-NL.rc | 2 +- .../base/applications/regedit/lang/pl-PL.rc | 8 +- .../base/applications/regedit/lang/pt-BR.rc | 20 +- .../base/applications/regedit/lang/ru-RU.rc | 20 +- .../base/applications/regedit/lang/sv-SE.rc | 8 +- .../base/applications/regedit/lang/th-TH.rc | 20 +- .../base/applications/regedit/lang/uk-UA.rc | 20 +- .../base/applications/regedit/lang/zh-CN.rc | 20 +- reactos/base/applications/regedit/listview.c | 4 +- reactos/base/applications/regedit/main.c | 6 +- reactos/base/applications/regedit/regproc.c | 6 +- reactos/base/applications/regedit/regproc.h | 2 +- reactos/base/applications/regedit/resource.h | 2 +- reactos/base/applications/regedit/security.c | 2 +- reactos/base/applications/regedit/treeview.c | 6 +- reactos/base/applications/sc/sc.rbuild | 2 +- .../screensavers/cylfrac/cylfrac.c | 2 +- .../applications/screensavers/logon/logon.c | 56 +- .../applications/screensavers/matrix/config.c | 34 +- .../screensavers/matrix/lang/bg-BG.rc | 20 +- .../screensavers/matrix/lang/de-DE.rc | 22 +- .../screensavers/matrix/lang/en-US.rc | 20 +- .../screensavers/matrix/lang/fr-FR.rc | 20 +- .../screensavers/matrix/lang/lt-LT.rc | 20 +- .../screensavers/matrix/lang/nl-NL.rc | 20 +- .../screensavers/matrix/lang/sk-SK.rc | 20 +- .../screensavers/matrix/lang/th-TH.rc | 20 +- .../screensavers/matrix/lang/uk-UA.rc | 20 +- .../applications/screensavers/matrix/matrix.c | 40 +- .../applications/screensavers/matrix/matrix.h | 2 +- .../screensavers/matrix/message.c | 26 +- .../screensavers/matrix/message.h | 2 +- .../screensavers/matrix/password.c | 22 +- .../screensavers/matrix/screensave.c | 20 +- .../screensavers/matrix/settings.c | 2 +- .../screensavers/scrnsave/scrnsave.c | 10 +- .../screensavers/starfield/screensaver.c | 48 +- reactos/base/applications/shutdown/shutdown.c | 34 +- .../base/applications/sndvol32/lang/bg-BG.rc | 2 +- .../base/applications/sndvol32/lang/en-US.rc | 2 +- .../base/applications/sndvol32/lang/es-ES.rc | 2 +- .../base/applications/sndvol32/lang/fr-FR.rc | 2 +- .../base/applications/sndvol32/lang/hu-HU.rc | 2 +- .../base/applications/sndvol32/lang/id-ID.rc | 2 +- .../base/applications/sndvol32/lang/it-IT.rc | 2 +- .../base/applications/sndvol32/lang/ja-JP.rc | 2 +- .../base/applications/sndvol32/lang/lt-LT.rc | 2 +- .../base/applications/sndvol32/lang/nl-NL.rc | 2 +- .../base/applications/sndvol32/lang/ru-RU.rc | 2 +- .../base/applications/sndvol32/lang/sv-SE.rc | 4 +- .../base/applications/sndvol32/lang/th-TH.rc | 2 +- .../base/applications/sndvol32/lang/uk-UA.rc | 2 +- reactos/base/applications/sndvol32/misc.c | 6 +- reactos/base/applications/sndvol32/sndvol32.c | 50 +- reactos/base/applications/taskmgr/graph.c | 14 +- .../base/applications/taskmgr/lang/bg-BG.rc | 2 +- .../base/applications/taskmgr/lang/de-DE.rc | 4 +- .../base/applications/taskmgr/lang/en-US.rc | 2 +- .../base/applications/taskmgr/lang/es-ES.rc | 48 +- .../base/applications/taskmgr/lang/hu-HU.rc | 2 +- .../base/applications/taskmgr/lang/id-ID.rc | 4 +- .../base/applications/taskmgr/lang/it-IT.rc | 2 +- .../base/applications/taskmgr/lang/ja-JP.rc | 2 +- .../base/applications/taskmgr/lang/nl-NL.rc | 2 +- .../base/applications/taskmgr/lang/pl-PL.rc | 14 +- .../base/applications/taskmgr/lang/pt-BR.rc | 4 +- .../base/applications/taskmgr/lang/ru-RU.rc | 2 +- .../base/applications/taskmgr/lang/sv-SE.rc | 2 +- .../base/applications/taskmgr/lang/uk-UA.rc | 2 +- reactos/base/applications/taskmgr/perfdata.c | 2 +- reactos/base/applications/taskmgr/perfpage.c | 14 +- reactos/base/applications/taskmgr/procpage.c | 2 +- reactos/base/applications/taskmgr/taskmgr.rc | 2 +- reactos/base/applications/taskmgr/trayicon.c | 2 +- .../porting-tools/mstscax/mstscax.cpp | 36 +- .../porting-tools/mstscax/mstscax.def | 4 +- .../rdesktop-core-tester/activex.cpp | 36 +- .../rdesktop-core-tester/mstsclib_h.h | 6862 +++---- .../rdesktop-core-tester/mstsclib_i.c | 6 +- .../rdesktop-core-tester/mstsclib_redist_h.h | 6862 +++---- .../rdesktop-core-tester/mstsclib_redist_i.c | 6 +- .../applications/tsclient/rdesktop/bitmap.c | 2 +- .../applications/tsclient/rdesktop/disk.h | 6 +- .../applications/tsclient/rdesktop/ewmhints.c | 22 +- .../base/applications/tsclient/rdesktop/iso.c | 6 +- .../applications/tsclient/rdesktop/lspci.c | 2 +- .../applications/tsclient/rdesktop/orders.h | 6 +- .../applications/tsclient/rdesktop/parse.h | 6 +- .../tsclient/rdesktop/rdpsnd_oss.c | 6 +- .../tsclient/rdesktop/scancodes.h | 18 +- .../applications/tsclient/rdesktop/seamless.c | 6 +- .../applications/tsclient/rdesktop/seamless.h | 6 +- .../applications/tsclient/rdesktop/types.h | 2 +- .../tsclient/rdesktop/uiports/svgawin.c | 8 +- .../applications/tsclient/rdesktop/vnc/vnc.c | 8 +- .../applications/tsclient/rdesktop/xkeymap.c | 8 +- reactos/base/applications/winhelp/callback.c | 360 +- reactos/base/applications/winhelp/hlpfile.c | 4130 ++-- reactos/base/applications/winhelp/hlpfile.h | 326 +- .../base/applications/winhelp/lang/sk-SK.rc | 2 +- reactos/base/applications/winhelp/lex.yy.c | 14 +- reactos/base/applications/winhelp/macro.c | 1856 +- reactos/base/applications/winhelp/macro.h | 280 +- reactos/base/applications/winhelp/string.c | 70 +- reactos/base/applications/winhelp/winhelp.c | 3860 ++-- reactos/base/applications/winhelp/winhelp.h | 396 +- .../base/applications/winhelp/winhelp_res.h | 64 +- reactos/base/applications/wordpad/De.rc | 2 +- reactos/base/applications/wordpad/En.rc | 2 +- reactos/base/applications/wordpad/Fr.rc | 2 +- reactos/base/applications/wordpad/Hu.rc | 2 +- reactos/base/applications/wordpad/Ko.rc | 2 +- reactos/base/applications/wordpad/Nl.rc | 2 +- reactos/base/applications/wordpad/No.rc | 2 +- reactos/base/applications/wordpad/Ru.rc | 2 +- reactos/base/applications/wordpad/Tr.rc | 2 +- reactos/base/applications/wordpad/rsrc.rc | 26 +- reactos/base/services/audiosrv/pnp.c | 2 +- reactos/base/services/dhcp/pipe.c | 2 +- reactos/base/services/dhcp/util.c | 6 +- reactos/base/services/eventlog/eventlog.h | 2 +- reactos/base/services/eventlog/logport.c | 2 +- reactos/base/services/eventlog/rpc.c | 2 +- reactos/base/services/rpcss/endpoint.c | 2 +- reactos/base/services/rpcss/rpcss.c | 2 +- reactos/base/services/tcpsvcs/tcpsvcs.c | 2 +- reactos/base/setup/reactos/lang/bg-BG.rc | 2 +- reactos/base/setup/reactos/lang/de-DE.rc | 2 +- reactos/base/setup/reactos/lang/en-US.rc | 2 +- reactos/base/setup/reactos/lang/es-ES.rc | 2 +- reactos/base/setup/reactos/lang/fi-FI.rc | 2 +- reactos/base/setup/reactos/lang/fr-FR.rc | 2 +- reactos/base/setup/reactos/lang/hu-HU.rc | 2 +- reactos/base/setup/reactos/lang/id-ID.rc | 2 +- reactos/base/setup/reactos/lang/it-IT.rc | 2 +- reactos/base/setup/reactos/lang/ja-JP.rc | 2 +- reactos/base/setup/reactos/lang/lt-LT.rc | 2 +- reactos/base/setup/reactos/lang/pl-PL.rc | 8 +- reactos/base/setup/reactos/lang/pt-BR.rc | 2 +- reactos/base/setup/reactos/lang/ru-RU.rc | 2 +- reactos/base/setup/reactos/lang/sv-SE.rc | 4 +- reactos/base/setup/reactos/lang/th-TH.rc | 2 +- reactos/base/setup/reactos/lang/uk-UA.rc | 2 +- reactos/base/setup/reactos/lang/zh-CN.rc | 2 +- reactos/base/setup/usetup/cabinet.c | 72 +- reactos/base/setup/usetup/interface/usetup.c | 22 +- .../base/setup/usetup/native/utils/keytrans.c | 6 +- reactos/base/setup/usetup/partlist.h | 2 +- reactos/base/setup/usetup/progress.c | 4 +- reactos/base/setup/usetup/progress.h | 2 +- reactos/base/setup/vmwinst/lang/es-ES.rc | 2 +- reactos/base/setup/welcome/lang/bg-BG.rc | 2 +- reactos/base/setup/welcome/lang/cs-CZ.rc | 2 +- reactos/base/setup/welcome/lang/da-DK.rc | 2 +- reactos/base/setup/welcome/lang/de-DE.rc | 2 +- reactos/base/setup/welcome/lang/el-GR.rc | 2 +- reactos/base/setup/welcome/lang/en-US.rc | 2 +- reactos/base/setup/welcome/lang/es-ES.rc | 2 +- reactos/base/setup/welcome/lang/fr-FR.rc | 2 +- reactos/base/setup/welcome/lang/hu-HU.rc | 2 +- reactos/base/setup/welcome/lang/id-ID.rc | 2 +- reactos/base/setup/welcome/lang/it-IT.rc | 2 +- reactos/base/setup/welcome/lang/ja-JP.rc | 2 +- reactos/base/setup/welcome/lang/lt-LT.rc | 2 +- reactos/base/setup/welcome/lang/nl-NL.rc | 2 +- reactos/base/setup/welcome/lang/pl-PL.rc | 2 +- reactos/base/setup/welcome/lang/pt-BR.rc | 2 +- reactos/base/setup/welcome/lang/ru-RU.rc | 2 +- reactos/base/setup/welcome/lang/sk-SK.rc | 2 +- reactos/base/setup/welcome/lang/sv-SE.rc | 2 +- reactos/base/setup/welcome/lang/th-TH.rc | 2 +- reactos/base/setup/welcome/lang/uk-UA.rc | 2 +- reactos/base/setup/welcome/lang/zh-CN.rc | 2 +- reactos/base/shell/cmd/alias.c | 2 +- reactos/base/shell/cmd/call.c | 2 +- reactos/base/shell/cmd/chcp.c | 4 +- reactos/base/shell/cmd/choice.c | 4 +- reactos/base/shell/cmd/cmd.c | 18 +- reactos/base/shell/cmd/color.c | 14 +- reactos/base/shell/cmd/console.c | 14 +- reactos/base/shell/cmd/copy.c | 220 +- reactos/base/shell/cmd/date.c | 14 +- reactos/base/shell/cmd/del.c | 18 +- reactos/base/shell/cmd/dir.c | 20 +- reactos/base/shell/cmd/filecomp.c | 46 +- reactos/base/shell/cmd/for.c | 2 +- reactos/base/shell/cmd/goto.c | 32 +- reactos/base/shell/cmd/if.c | 8 +- reactos/base/shell/cmd/internal.c | 144 +- reactos/base/shell/cmd/lang/ja-JP.rc | 6 +- reactos/base/shell/cmd/lang/pl-PL.rc | 2 +- reactos/base/shell/cmd/locale.c | 8 +- reactos/base/shell/cmd/misc.c | 8 +- reactos/base/shell/cmd/prompt.c | 20 +- reactos/base/shell/cmd/redir.c | 6 +- reactos/base/shell/cmd/replace.c | 14 +- reactos/base/shell/cmd/resource.h | 2 +- reactos/base/shell/cmd/screen.c | 2 +- reactos/base/shell/cmd/start.c | 80 +- reactos/base/shell/cmd/timer.c | 4 +- reactos/base/shell/cmd/type.c | 6 +- reactos/base/shell/cmd/ver.c | 2 +- reactos/base/shell/cmd/vol.c | 8 +- .../base/shell/explorer/dialogs/settings.cpp | 2 +- reactos/base/shell/explorer/explorer-bg.rc | 68 +- reactos/base/shell/explorer/explorer-bn.rc | 68 +- .../base/shell/explorer/explorer-cn-msvc.rc | Bin 24342 -> 4643 bytes reactos/base/shell/explorer/explorer-cn.rc | 68 +- reactos/base/shell/explorer/explorer-cz.rc | 68 +- reactos/base/shell/explorer/explorer-de.rc | 68 +- reactos/base/shell/explorer/explorer-en.rc | 68 +- reactos/base/shell/explorer/explorer-es.rc | 56 +- reactos/base/shell/explorer/explorer-fr.rc | 52 +- reactos/base/shell/explorer/explorer-hu.rc | 68 +- reactos/base/shell/explorer/explorer-id.rc | 68 +- reactos/base/shell/explorer/explorer-it.rc | 24 +- reactos/base/shell/explorer/explorer-jp.rc | 68 +- reactos/base/shell/explorer/explorer-nl.rc | 70 +- reactos/base/shell/explorer/explorer-no.rc | 68 +- reactos/base/shell/explorer/explorer-pl.rc | 68 +- reactos/base/shell/explorer/explorer-pt.rc | 16 +- reactos/base/shell/explorer/explorer-ro.rc | 18 +- reactos/base/shell/explorer/explorer-ru.rc | 68 +- reactos/base/shell/explorer/explorer-sk.rc | 68 +- reactos/base/shell/explorer/explorer-sv.rc | 66 +- reactos/base/shell/explorer/explorer-uk.rc | 68 +- reactos/base/shell/explorer/explorer.rc | 2 +- .../base/shell/explorer/explorer_intres.rc | 16 +- reactos/base/shell/explorer/resource.h | 2 +- .../base/shell/explorer/shell/mainframe.cpp | 6 +- .../shell/explorer/shell/shellbrowser.cpp | 6 +- .../shell/explorer/taskbar/desktopbar.cpp | 6 +- .../base/shell/explorer/taskbar/desktopbar.h | 2 +- .../shell/explorer/taskbar/quicklaunch.cpp | 2 +- .../base/shell/explorer/taskbar/startmenu.cpp | 2 +- .../shell/explorer/utility/dragdropimpl.cpp | 14 +- .../explorer/utility/shellbrowserimpl.cpp | 2 +- .../shell/explorer/utility/shellclasses.cpp | 2 +- .../shell/explorer/utility/shelltests.cpp | 2 +- .../base/shell/explorer/utility/utility.cpp | 2 +- reactos/base/system/expand/expand.c | 8 +- reactos/base/system/expand/expand.rbuild | 4 +- reactos/base/system/expand/lang/el-GR.rc | 2 +- reactos/base/system/expand/lang/pl-PL.rc | 8 +- reactos/base/system/format/resource.h | 4 +- reactos/base/system/regsvr32/lang/pl-PL.rc | 8 +- reactos/base/system/regsvr32/regsvr32.c | 2 +- reactos/base/system/rundll32/lang/pl-PL.rc | 8 +- reactos/base/system/rundll32/rundll32.c | 2 +- reactos/base/system/smss/client.c | 36 +- reactos/base/system/smss/debug.c | 10 +- reactos/base/system/smss/initdosdev.c | 6 +- reactos/base/system/smss/initenv.c | 8 +- reactos/base/system/smss/initheap.c | 6 +- reactos/base/system/smss/initmv.c | 26 +- reactos/base/system/smss/initobdir.c | 6 +- reactos/base/system/smss/initpage.c | 24 +- reactos/base/system/smss/initreg.c | 6 +- reactos/base/system/smss/initrun.c | 10 +- reactos/base/system/smss/initss.c | 22 +- reactos/base/system/smss/initwkdll.c | 6 +- reactos/base/system/smss/print.c | 12 +- reactos/base/system/smss/smapicomp.c | 2 +- reactos/base/system/smss/smapiexec.c | 12 +- reactos/base/system/smss/smapiquery.c | 2 +- reactos/base/system/userinit/lang/bg-BG.rc | 2 +- reactos/base/system/userinit/lang/el-GR.rc | 2 +- reactos/base/system/userinit/lang/en-US.rc | 2 +- reactos/base/system/userinit/lang/es-ES.rc | 2 +- reactos/base/system/userinit/lang/fr-FR.rc | 2 +- reactos/base/system/userinit/lang/hu-HU.rc | 2 +- reactos/base/system/userinit/lang/it-IT.rc | 2 +- reactos/base/system/userinit/lang/ja-JP.rc | 2 +- reactos/base/system/userinit/lang/pl-PL.rc | 8 +- reactos/base/system/userinit/lang/pt-BR.rc | 2 +- reactos/base/system/userinit/lang/ru-RU.rc | 2 +- reactos/base/system/userinit/resource.h | 2 +- reactos/base/system/winlogon/lang/bg-BG.rc | 4 +- reactos/base/system/winlogon/lang/cs-CZ.rc | 4 +- reactos/base/system/winlogon/lang/en-US.rc | 4 +- reactos/base/system/winlogon/lang/es-ES.rc | 4 +- reactos/base/system/winlogon/lang/fr-FR.rc | 4 +- reactos/base/system/winlogon/lang/hu-HU.rc | 4 +- reactos/base/system/winlogon/lang/id-ID.rc | 4 +- reactos/base/system/winlogon/lang/it-IT.rc | 4 +- reactos/base/system/winlogon/lang/ja-JP.rc | 4 +- reactos/base/system/winlogon/lang/lt-LT.rc | 4 +- reactos/base/system/winlogon/lang/nl-NL.rc | 4 +- reactos/base/system/winlogon/lang/pl-PL.rc | 4 +- reactos/base/system/winlogon/lang/ru-RU.rc | 4 +- reactos/base/system/winlogon/lang/sv-SE.rc | 4 +- reactos/base/system/winlogon/lang/uk-UA.rc | 4 +- reactos/base/system/winlogon/lang/zh-CN.rc | 4 +- reactos/base/system/winlogon/sas.c | 10 +- reactos/base/system/winlogon/screensaver.c | 2 +- reactos/boot/freeldr/FREELDR.INI | 2 +- reactos/boot/freeldr/bootsect/fat.h | 62 +- reactos/boot/freeldr/bootsect/fat32.h | 126 +- reactos/boot/freeldr/fdebug/lang/de-DE.rc | 18 +- reactos/boot/freeldr/fdebug/lang/en-US.rc | 18 +- reactos/boot/freeldr/fdebug/lang/fr-FR.rc | 18 +- reactos/boot/freeldr/fdebug/lang/hu-HU.rc | 20 +- reactos/boot/freeldr/fdebug/lang/id-ID.rc | 18 +- reactos/boot/freeldr/fdebug/lang/it-IT.rc | 20 +- reactos/boot/freeldr/fdebug/lang/ja-JP.rc | 18 +- reactos/boot/freeldr/fdebug/lang/pl-PL.rc | 20 +- reactos/boot/freeldr/fdebug/lang/ru-RU.rc | 18 +- reactos/boot/freeldr/fdebug/lang/tr-TR.rc | 18 +- reactos/boot/freeldr/fdebug/lang/uk-UA.rc | 18 +- .../boot/freeldr/freeldr/arch/i386/loader.c | 2 +- .../boot/freeldr/freeldr/arch/i386/xboxi2c.c | 4 +- .../freeldr/freeldr/arch/powerpc/loader.c | 2 +- .../boot/freeldr/freeldr/arch/powerpc/mach.c | 54 +- .../boot/freeldr/freeldr/arch/powerpc/mboot.c | 48 +- .../boot/freeldr/freeldr/arch/powerpc/mmu.c | 8 +- .../boot/freeldr/freeldr/arch/powerpc/prep.c | 4 +- .../boot/freeldr/freeldr/arch/powerpc/prep.h | 2 +- .../freeldr/freeldr/arch/powerpc/prep_ide.c | 12 +- .../freeldr/freeldr/arch/powerpc/prep_pci.c | 8 +- .../freeldr/freeldr/arch/powerpc/prep_vga.c | 2 +- reactos/boot/freeldr/freeldr/fs/ntfs.c | 48 +- reactos/boot/freeldr/freeldr/mm/mm.c | 2 +- .../boot/freeldr/freeldr/reactos/binhive.c | 4 +- .../boot/freeldr/freeldr/reactos/registry.c | 4 +- .../boot/freeldr/freeldr/reactos/setupldr.c | 4 +- reactos/boot/freeldr/freeldr/ui/ui.c | 6 +- reactos/boot/freeldr/freeldr/windows/winldr.c | 2 +- .../boot/freeldr/freeldr/windows/wlmemory.c | 6 +- reactos/boot/freeldr/tools/rcopy.c | 22 +- reactos/boot/freeldr/tools/rdel.c | 8 +- reactos/boot/freeldr/tools/rmkdir.c | 4 +- reactos/boot/freeldr/tools/rrmdir.c | 8 +- reactos/config-ppc.template.rbuild | 2 +- reactos/config.template.rbuild | 6 +- reactos/dll/3rdparty/3rdparty.rbuild | 1 - .../dll/3rdparty/freetype/devel/ft2build.h | 82 +- .../dll/3rdparty/freetype/devel/ftoption.h | 1340 +- reactos/dll/3rdparty/freetype/freetype.def | 4 +- .../include/freetype/config/ftconfig.h | 726 +- .../include/freetype/config/ftheader.h | 1458 +- .../include/freetype/config/ftmodule.h | 64 +- .../include/freetype/config/ftoption.h | 1338 +- .../include/freetype/config/ftstdlib.h | 360 +- .../freetype/include/freetype/freetype.h | 6868 +++---- .../freetype/include/freetype/ftbbox.h | 188 +- .../freetype/include/freetype/ftbdf.h | 400 +- .../freetype/include/freetype/ftbitmap.h | 412 +- .../freetype/include/freetype/ftcache.h | 2220 +-- .../freetype/include/freetype/ftchapters.h | 200 +- .../freetype/include/freetype/fterrdef.h | 478 +- .../freetype/include/freetype/fterrors.h | 412 +- .../freetype/include/freetype/ftgasp.h | 226 +- .../freetype/include/freetype/ftglyph.h | 1150 +- .../freetype/include/freetype/ftgxval.h | 716 +- .../freetype/include/freetype/ftgzip.h | 204 +- .../freetype/include/freetype/ftimage.h | 2474 +-- .../freetype/include/freetype/ftincrem.h | 662 +- .../freetype/include/freetype/ftlcdfil.h | 332 +- .../freetype/include/freetype/ftlist.h | 546 +- .../freetype/include/freetype/ftlzw.h | 198 +- .../freetype/include/freetype/ftmac.h | 544 +- .../3rdparty/freetype/include/freetype/ftmm.h | 756 +- .../freetype/include/freetype/ftmodapi.h | 812 +- .../freetype/include/freetype/ftmoderr.h | 310 +- .../freetype/include/freetype/ftotval.h | 396 +- .../freetype/include/freetype/ftoutln.h | 1052 +- .../freetype/include/freetype/ftpfr.h | 344 +- .../freetype/include/freetype/ftrender.h | 458 +- .../freetype/include/freetype/ftsizes.h | 318 +- .../freetype/include/freetype/ftsnames.h | 340 +- .../freetype/include/freetype/ftstroke.h | 1432 +- .../freetype/include/freetype/ftsynth.h | 146 +- .../freetype/include/freetype/ftsystem.h | 692 +- .../freetype/include/freetype/fttrigon.h | 700 +- .../freetype/include/freetype/fttypes.h | 1166 +- .../freetype/include/freetype/ftwinfnt.h | 526 +- .../freetype/include/freetype/ftxf86.h | 160 +- .../include/freetype/internal/autohint.h | 410 +- .../include/freetype/internal/ftcalc.h | 306 +- .../include/freetype/internal/ftdebug.h | 488 +- .../include/freetype/internal/ftdriver.h | 504 +- .../include/freetype/internal/ftgloadr.h | 336 +- .../include/freetype/internal/ftmemory.h | 736 +- .../include/freetype/internal/ftobjs.h | 1640 +- .../include/freetype/internal/ftrfork.h | 368 +- .../include/freetype/internal/ftserv.h | 654 +- .../include/freetype/internal/ftstream.h | 1078 +- .../include/freetype/internal/fttrace.h | 266 +- .../include/freetype/internal/ftvalid.h | 300 +- .../include/freetype/internal/internal.h | 100 +- .../include/freetype/internal/pcftypes.h | 112 +- .../include/freetype/internal/psaux.h | 1758 +- .../include/freetype/internal/pshints.h | 1374 +- .../freetype/internal/services/svbdf.h | 114 +- .../freetype/internal/services/svgldict.h | 120 +- .../freetype/internal/services/svgxval.h | 144 +- .../freetype/internal/services/svkern.h | 102 +- .../include/freetype/internal/services/svmm.h | 158 +- .../freetype/internal/services/svotval.h | 110 +- .../freetype/internal/services/svpfr.h | 132 +- .../freetype/internal/services/svpostnm.h | 116 +- .../freetype/internal/services/svpscmap.h | 258 +- .../freetype/internal/services/svpsinfo.h | 120 +- .../freetype/internal/services/svsfnt.h | 160 +- .../freetype/internal/services/svttcmap.h | 156 +- .../freetype/internal/services/svtteng.h | 106 +- .../freetype/internal/services/svwinfnt.h | 100 +- .../freetype/internal/services/svxf86nm.h | 110 +- .../freetype/include/freetype/internal/sfnt.h | 1524 +- .../include/freetype/internal/t1types.h | 504 +- .../include/freetype/internal/tttypes.h | 3086 +-- .../freetype/include/freetype/t1tables.h | 900 +- .../freetype/include/freetype/ttnameid.h | 2264 +-- .../freetype/include/freetype/tttables.h | 1512 +- .../freetype/include/freetype/tttags.h | 198 +- .../freetype/include/freetype/ttunpat.h | 118 +- .../dll/3rdparty/freetype/include/ft2build.h | 78 +- reactos/dll/3rdparty/freetype/rosglue.c | 2 +- .../3rdparty/freetype/src/autofit/afangles.c | 584 +- .../3rdparty/freetype/src/autofit/afangles.h | 14 +- .../dll/3rdparty/freetype/src/autofit/afcjk.c | 3012 +-- .../dll/3rdparty/freetype/src/autofit/afcjk.h | 82 +- .../3rdparty/freetype/src/autofit/afdummy.c | 124 +- .../3rdparty/freetype/src/autofit/afdummy.h | 86 +- .../3rdparty/freetype/src/autofit/aferrors.h | 80 +- .../3rdparty/freetype/src/autofit/afglobal.c | 578 +- .../3rdparty/freetype/src/autofit/afglobal.h | 134 +- .../3rdparty/freetype/src/autofit/afhints.c | 2528 +-- .../3rdparty/freetype/src/autofit/afhints.h | 666 +- .../3rdparty/freetype/src/autofit/aflatin.c | 4332 ++--- .../3rdparty/freetype/src/autofit/aflatin.h | 418 +- .../3rdparty/freetype/src/autofit/afloader.c | 1060 +- .../3rdparty/freetype/src/autofit/afloader.h | 146 +- .../3rdparty/freetype/src/autofit/afmodule.c | 194 +- .../3rdparty/freetype/src/autofit/afmodule.h | 74 +- .../3rdparty/freetype/src/autofit/aftypes.h | 698 +- .../3rdparty/freetype/src/autofit/afwarp.c | 676 +- .../3rdparty/freetype/src/autofit/afwarp.h | 128 +- .../3rdparty/freetype/src/autofit/autofit.c | 80 +- .../dll/3rdparty/freetype/src/base/ftapi.c | 242 +- .../dll/3rdparty/freetype/src/base/ftbase.c | 76 +- .../dll/3rdparty/freetype/src/base/ftbbox.c | 1318 +- .../dll/3rdparty/freetype/src/base/ftbdf.c | 176 +- .../dll/3rdparty/freetype/src/base/ftbitmap.c | 1260 +- .../dll/3rdparty/freetype/src/base/ftcalc.c | 1644 +- .../dll/3rdparty/freetype/src/base/ftdbgmem.c | 1996 +- .../dll/3rdparty/freetype/src/base/ftdebug.c | 492 +- .../dll/3rdparty/freetype/src/base/ftgasp.c | 122 +- .../dll/3rdparty/freetype/src/base/ftgloadr.c | 788 +- .../dll/3rdparty/freetype/src/base/ftglyph.c | 1364 +- .../dll/3rdparty/freetype/src/base/ftgxval.c | 258 +- .../dll/3rdparty/freetype/src/base/ftinit.c | 326 +- .../dll/3rdparty/freetype/src/base/ftlcdfil.c | 702 +- .../dll/3rdparty/freetype/src/base/ftmac.c | 2192 +-- reactos/dll/3rdparty/freetype/src/base/ftmm.c | 404 +- .../dll/3rdparty/freetype/src/base/ftnames.c | 188 +- .../dll/3rdparty/freetype/src/base/ftobjs.c | 7986 ++++---- .../dll/3rdparty/freetype/src/base/ftotval.c | 166 +- .../dll/3rdparty/freetype/src/base/ftoutln.c | 2176 +-- .../dll/3rdparty/freetype/src/base/ftpfr.c | 264 +- .../dll/3rdparty/freetype/src/base/ftrfork.c | 1456 +- .../dll/3rdparty/freetype/src/base/ftstream.c | 1684 +- .../dll/3rdparty/freetype/src/base/ftstroke.c | 4020 ++-- .../dll/3rdparty/freetype/src/base/ftsynth.c | 318 +- .../dll/3rdparty/freetype/src/base/ftsystem.c | 602 +- .../dll/3rdparty/freetype/src/base/fttrigon.c | 1092 +- .../dll/3rdparty/freetype/src/base/fttype1.c | 188 +- .../dll/3rdparty/freetype/src/base/ftutil.c | 1002 +- .../dll/3rdparty/freetype/src/base/ftwinfnt.c | 102 +- .../dll/3rdparty/freetype/src/base/ftxf86.c | 80 +- reactos/dll/3rdparty/freetype/src/bdf/bdf.c | 68 +- reactos/dll/3rdparty/freetype/src/bdf/bdf.h | 590 +- .../dll/3rdparty/freetype/src/bdf/bdfdrivr.c | 1696 +- .../dll/3rdparty/freetype/src/bdf/bdfdrivr.h | 152 +- .../dll/3rdparty/freetype/src/bdf/bdferror.h | 88 +- .../dll/3rdparty/freetype/src/bdf/bdflib.c | 4944 ++--- .../dll/3rdparty/freetype/src/cache/ftcache.c | 62 +- .../3rdparty/freetype/src/cache/ftcbasic.c | 1622 +- .../3rdparty/freetype/src/cache/ftccache.c | 1184 +- .../3rdparty/freetype/src/cache/ftccache.h | 634 +- .../3rdparty/freetype/src/cache/ftccback.h | 180 +- .../dll/3rdparty/freetype/src/cache/ftccmap.c | 826 +- .../3rdparty/freetype/src/cache/ftcerror.h | 80 +- .../3rdparty/freetype/src/cache/ftcglyph.c | 422 +- .../3rdparty/freetype/src/cache/ftcglyph.h | 644 +- .../3rdparty/freetype/src/cache/ftcimage.c | 326 +- .../3rdparty/freetype/src/cache/ftcimage.h | 214 +- .../3rdparty/freetype/src/cache/ftcmanag.c | 1464 +- .../3rdparty/freetype/src/cache/ftcmanag.h | 350 +- .../dll/3rdparty/freetype/src/cache/ftcmru.c | 714 +- .../dll/3rdparty/freetype/src/cache/ftcmru.h | 494 +- .../3rdparty/freetype/src/cache/ftcsbits.c | 802 +- .../3rdparty/freetype/src/cache/ftcsbits.h | 196 +- reactos/dll/3rdparty/freetype/src/cff/cff.c | 58 +- .../dll/3rdparty/freetype/src/cff/cffcmap.c | 440 +- .../dll/3rdparty/freetype/src/cff/cffcmap.h | 138 +- .../dll/3rdparty/freetype/src/cff/cffdrivr.c | 998 +- .../dll/3rdparty/freetype/src/cff/cffdrivr.h | 78 +- .../dll/3rdparty/freetype/src/cff/cfferrs.h | 82 +- .../dll/3rdparty/freetype/src/cff/cffgload.c | 5268 +++--- .../dll/3rdparty/freetype/src/cff/cffgload.h | 416 +- .../dll/3rdparty/freetype/src/cff/cffload.c | 3196 ++-- .../dll/3rdparty/freetype/src/cff/cffload.h | 158 +- .../dll/3rdparty/freetype/src/cff/cffobjs.c | 1564 +- .../dll/3rdparty/freetype/src/cff/cffobjs.h | 330 +- .../dll/3rdparty/freetype/src/cff/cffparse.c | 1376 +- .../dll/3rdparty/freetype/src/cff/cffparse.h | 138 +- .../dll/3rdparty/freetype/src/cff/cfftoken.h | 194 +- .../dll/3rdparty/freetype/src/cff/cfftypes.h | 540 +- .../dll/3rdparty/freetype/src/cid/ciderrs.h | 80 +- .../dll/3rdparty/freetype/src/cid/cidgload.c | 866 +- .../dll/3rdparty/freetype/src/cid/cidgload.h | 102 +- .../dll/3rdparty/freetype/src/cid/cidload.c | 1288 +- .../dll/3rdparty/freetype/src/cid/cidload.h | 106 +- .../dll/3rdparty/freetype/src/cid/cidobjs.c | 960 +- .../dll/3rdparty/freetype/src/cid/cidobjs.h | 308 +- .../dll/3rdparty/freetype/src/cid/cidparse.c | 452 +- .../dll/3rdparty/freetype/src/cid/cidparse.h | 246 +- .../dll/3rdparty/freetype/src/cid/cidriver.c | 326 +- .../dll/3rdparty/freetype/src/cid/cidriver.h | 78 +- .../dll/3rdparty/freetype/src/cid/cidtoken.h | 206 +- .../dll/3rdparty/freetype/src/cid/type1cid.c | 58 +- .../3rdparty/freetype/src/gxvalid/gxvalid.c | 92 +- .../3rdparty/freetype/src/gxvalid/gxvalid.h | 214 +- .../3rdparty/freetype/src/gxvalid/gxvbsln.c | 666 +- .../3rdparty/freetype/src/gxvalid/gxvcommn.c | 3516 ++-- .../3rdparty/freetype/src/gxvalid/gxvcommn.h | 1120 +- .../3rdparty/freetype/src/gxvalid/gxverror.h | 102 +- .../3rdparty/freetype/src/gxvalid/gxvfeat.c | 686 +- .../3rdparty/freetype/src/gxvalid/gxvfeat.h | 344 +- .../3rdparty/freetype/src/gxvalid/gxvfgen.c | 964 +- .../3rdparty/freetype/src/gxvalid/gxvjust.c | 1260 +- .../3rdparty/freetype/src/gxvalid/gxvkern.c | 1752 +- .../3rdparty/freetype/src/gxvalid/gxvlcar.c | 446 +- .../3rdparty/freetype/src/gxvalid/gxvmod.c | 570 +- .../3rdparty/freetype/src/gxvalid/gxvmod.h | 92 +- .../3rdparty/freetype/src/gxvalid/gxvmort.c | 570 +- .../3rdparty/freetype/src/gxvalid/gxvmort.h | 186 +- .../3rdparty/freetype/src/gxvalid/gxvmort0.c | 274 +- .../3rdparty/freetype/src/gxvalid/gxvmort1.c | 516 +- .../3rdparty/freetype/src/gxvalid/gxvmort2.c | 564 +- .../3rdparty/freetype/src/gxvalid/gxvmort4.c | 250 +- .../3rdparty/freetype/src/gxvalid/gxvmort5.c | 452 +- .../3rdparty/freetype/src/gxvalid/gxvmorx.c | 366 +- .../3rdparty/freetype/src/gxvalid/gxvmorx.h | 134 +- .../3rdparty/freetype/src/gxvalid/gxvmorx0.c | 206 +- .../3rdparty/freetype/src/gxvalid/gxvmorx1.c | 548 +- .../3rdparty/freetype/src/gxvalid/gxvmorx2.c | 570 +- .../3rdparty/freetype/src/gxvalid/gxvmorx4.c | 110 +- .../3rdparty/freetype/src/gxvalid/gxvmorx5.c | 434 +- .../3rdparty/freetype/src/gxvalid/gxvopbd.c | 434 +- .../3rdparty/freetype/src/gxvalid/gxvprop.c | 602 +- .../3rdparty/freetype/src/gxvalid/gxvtrak.c | 554 +- .../dll/3rdparty/freetype/src/gzip/adler32.c | 96 +- .../dll/3rdparty/freetype/src/gzip/ftgzip.c | 1364 +- .../dll/3rdparty/freetype/src/gzip/infblock.c | 774 +- .../dll/3rdparty/freetype/src/gzip/infblock.h | 72 +- .../dll/3rdparty/freetype/src/gzip/infcodes.c | 500 +- .../dll/3rdparty/freetype/src/gzip/infcodes.h | 62 +- .../dll/3rdparty/freetype/src/gzip/inffixed.h | 302 +- .../dll/3rdparty/freetype/src/gzip/inflate.c | 546 +- .../dll/3rdparty/freetype/src/gzip/inftrees.c | 930 +- .../dll/3rdparty/freetype/src/gzip/inftrees.h | 126 +- .../dll/3rdparty/freetype/src/gzip/infutil.c | 172 +- .../dll/3rdparty/freetype/src/gzip/infutil.h | 196 +- .../dll/3rdparty/freetype/src/gzip/zconf.h | 556 +- reactos/dll/3rdparty/freetype/src/gzip/zlib.h | 1660 +- .../dll/3rdparty/freetype/src/gzip/zutil.c | 362 +- .../dll/3rdparty/freetype/src/gzip/zutil.h | 430 +- reactos/dll/3rdparty/freetype/src/lzw/ftlzw.c | 826 +- .../dll/3rdparty/freetype/src/lzw/ftzopen.c | 796 +- .../dll/3rdparty/freetype/src/lzw/ftzopen.h | 342 +- .../3rdparty/freetype/src/otvalid/otvalid.c | 60 +- .../3rdparty/freetype/src/otvalid/otvalid.h | 144 +- .../3rdparty/freetype/src/otvalid/otvbase.c | 636 +- .../3rdparty/freetype/src/otvalid/otvcommn.c | 2110 +-- .../3rdparty/freetype/src/otvalid/otvcommn.h | 872 +- .../3rdparty/freetype/src/otvalid/otverror.h | 86 +- .../3rdparty/freetype/src/otvalid/otvgdef.c | 438 +- .../3rdparty/freetype/src/otvalid/otvgpos.c | 2026 +- .../3rdparty/freetype/src/otvalid/otvgpos.h | 72 +- .../3rdparty/freetype/src/otvalid/otvgsub.c | 1168 +- .../3rdparty/freetype/src/otvalid/otvjstf.c | 516 +- .../3rdparty/freetype/src/otvalid/otvmod.c | 484 +- .../3rdparty/freetype/src/otvalid/otvmod.h | 78 +- reactos/dll/3rdparty/freetype/src/pcf/pcf.c | 72 +- reactos/dll/3rdparty/freetype/src/pcf/pcf.h | 474 +- .../dll/3rdparty/freetype/src/pcf/pcfdrivr.c | 1336 +- .../dll/3rdparty/freetype/src/pcf/pcfdrivr.h | 88 +- .../dll/3rdparty/freetype/src/pcf/pcferror.h | 80 +- .../dll/3rdparty/freetype/src/pcf/pcfread.c | 2534 +-- .../dll/3rdparty/freetype/src/pcf/pcfread.h | 90 +- .../dll/3rdparty/freetype/src/pcf/pcfutil.c | 208 +- .../dll/3rdparty/freetype/src/pcf/pcfutil.h | 110 +- reactos/dll/3rdparty/freetype/src/pfr/pfr.c | 58 +- .../dll/3rdparty/freetype/src/pfr/pfrcmap.c | 326 +- .../dll/3rdparty/freetype/src/pfr/pfrcmap.h | 92 +- .../dll/3rdparty/freetype/src/pfr/pfrdrivr.c | 414 +- .../dll/3rdparty/freetype/src/pfr/pfrdrivr.h | 78 +- .../dll/3rdparty/freetype/src/pfr/pfrerror.h | 80 +- .../dll/3rdparty/freetype/src/pfr/pfrgload.c | 1656 +- .../dll/3rdparty/freetype/src/pfr/pfrgload.h | 98 +- .../dll/3rdparty/freetype/src/pfr/pfrload.c | 1876 +- .../dll/3rdparty/freetype/src/pfr/pfrload.h | 236 +- .../dll/3rdparty/freetype/src/pfr/pfrobjs.c | 1152 +- .../dll/3rdparty/freetype/src/pfr/pfrobjs.h | 192 +- .../dll/3rdparty/freetype/src/pfr/pfrsbit.c | 1360 +- .../dll/3rdparty/freetype/src/pfr/pfrsbit.h | 72 +- .../dll/3rdparty/freetype/src/pfr/pfrtypes.h | 724 +- .../3rdparty/freetype/src/psaux/afmparse.c | 1920 +- .../3rdparty/freetype/src/psaux/afmparse.h | 174 +- .../dll/3rdparty/freetype/src/psaux/psaux.c | 68 +- .../3rdparty/freetype/src/psaux/psauxerr.h | 82 +- .../3rdparty/freetype/src/psaux/psauxmod.c | 278 +- .../3rdparty/freetype/src/psaux/psauxmod.h | 76 +- .../dll/3rdparty/freetype/src/psaux/psconv.c | 932 +- .../dll/3rdparty/freetype/src/psaux/psconv.h | 142 +- .../dll/3rdparty/freetype/src/psaux/psobjs.c | 3396 ++-- .../dll/3rdparty/freetype/src/psaux/psobjs.h | 424 +- .../dll/3rdparty/freetype/src/psaux/t1cmap.c | 666 +- .../dll/3rdparty/freetype/src/psaux/t1cmap.h | 210 +- .../3rdparty/freetype/src/psaux/t1decode.c | 2948 +-- .../3rdparty/freetype/src/psaux/t1decode.h | 128 +- .../3rdparty/freetype/src/pshinter/pshalgo.c | 4582 ++--- .../3rdparty/freetype/src/pshinter/pshalgo.h | 510 +- .../3rdparty/freetype/src/pshinter/pshglob.c | 1500 +- .../3rdparty/freetype/src/pshinter/pshglob.h | 392 +- .../3rdparty/freetype/src/pshinter/pshinter.c | 56 +- .../3rdparty/freetype/src/pshinter/pshmod.c | 242 +- .../3rdparty/freetype/src/pshinter/pshmod.h | 78 +- .../3rdparty/freetype/src/pshinter/pshnterr.h | 80 +- .../3rdparty/freetype/src/pshinter/pshrec.c | 2430 +-- .../3rdparty/freetype/src/pshinter/pshrec.h | 352 +- .../3rdparty/freetype/src/psnames/psmodule.c | 916 +- .../3rdparty/freetype/src/psnames/psmodule.h | 76 +- .../3rdparty/freetype/src/psnames/psnamerr.h | 82 +- .../3rdparty/freetype/src/psnames/psnames.c | 50 +- .../3rdparty/freetype/src/psnames/pstables.h | 8180 ++++---- .../dll/3rdparty/freetype/src/raster/ftmisc.h | 166 +- .../3rdparty/freetype/src/raster/ftraster.c | 6738 +++---- .../3rdparty/freetype/src/raster/ftraster.h | 92 +- .../3rdparty/freetype/src/raster/ftrend1.c | 546 +- .../3rdparty/freetype/src/raster/ftrend1.h | 88 +- .../dll/3rdparty/freetype/src/raster/raster.c | 52 +- .../3rdparty/freetype/src/raster/rasterrs.h | 82 +- .../dll/3rdparty/freetype/src/sfnt/sfdriver.c | 1236 +- .../dll/3rdparty/freetype/src/sfnt/sfdriver.h | 76 +- .../dll/3rdparty/freetype/src/sfnt/sferrors.h | 82 +- reactos/dll/3rdparty/freetype/src/sfnt/sfnt.c | 82 +- .../dll/3rdparty/freetype/src/sfnt/sfobjs.c | 2140 +-- .../dll/3rdparty/freetype/src/sfnt/sfobjs.h | 108 +- .../dll/3rdparty/freetype/src/sfnt/ttbdf.c | 500 +- .../dll/3rdparty/freetype/src/sfnt/ttbdf.h | 92 +- .../dll/3rdparty/freetype/src/sfnt/ttcmap.c | 4712 ++--- .../dll/3rdparty/freetype/src/sfnt/ttcmap.h | 170 +- .../dll/3rdparty/freetype/src/sfnt/ttkern.c | 584 +- .../dll/3rdparty/freetype/src/sfnt/ttkern.h | 104 +- .../dll/3rdparty/freetype/src/sfnt/ttload.c | 2352 +-- .../dll/3rdparty/freetype/src/sfnt/ttload.h | 224 +- .../dll/3rdparty/freetype/src/sfnt/ttmtx.c | 930 +- .../dll/3rdparty/freetype/src/sfnt/ttmtx.h | 110 +- .../dll/3rdparty/freetype/src/sfnt/ttpost.c | 1042 +- .../dll/3rdparty/freetype/src/sfnt/ttpost.h | 92 +- .../dll/3rdparty/freetype/src/sfnt/ttsbit.c | 3002 +-- .../dll/3rdparty/freetype/src/sfnt/ttsbit.h | 158 +- .../dll/3rdparty/freetype/src/sfnt/ttsbit0.c | 1992 +- .../3rdparty/freetype/src/smooth/ftgrays.c | 3966 ++-- .../3rdparty/freetype/src/smooth/ftgrays.h | 114 +- .../3rdparty/freetype/src/smooth/ftsmerrs.h | 82 +- .../3rdparty/freetype/src/smooth/ftsmooth.c | 934 +- .../3rdparty/freetype/src/smooth/ftsmooth.h | 98 +- .../dll/3rdparty/freetype/src/smooth/smooth.c | 52 +- .../3rdparty/freetype/src/tools/apinames.c | 886 +- .../3rdparty/freetype/src/tools/test_afm.c | 314 +- .../3rdparty/freetype/src/tools/test_bbox.c | 320 +- .../3rdparty/freetype/src/tools/test_trig.c | 472 +- .../3rdparty/freetype/src/truetype/truetype.c | 72 +- .../3rdparty/freetype/src/truetype/ttdriver.c | 836 +- .../3rdparty/freetype/src/truetype/ttdriver.h | 76 +- .../3rdparty/freetype/src/truetype/tterrors.h | 80 +- .../3rdparty/freetype/src/truetype/ttgload.c | 3914 ++-- .../3rdparty/freetype/src/truetype/ttgload.h | 98 +- .../3rdparty/freetype/src/truetype/ttgxvar.c | 3072 +-- .../3rdparty/freetype/src/truetype/ttgxvar.h | 364 +- .../3rdparty/freetype/src/truetype/ttinterp.c | 15618 ++++++++-------- .../3rdparty/freetype/src/truetype/ttinterp.h | 622 +- .../3rdparty/freetype/src/truetype/ttobjs.c | 1874 +- .../3rdparty/freetype/src/truetype/ttobjs.h | 918 +- .../3rdparty/freetype/src/truetype/ttpload.c | 1046 +- .../3rdparty/freetype/src/truetype/ttpload.h | 150 +- .../dll/3rdparty/freetype/src/type1/t1afm.c | 770 +- .../dll/3rdparty/freetype/src/type1/t1afm.h | 108 +- .../3rdparty/freetype/src/type1/t1driver.c | 626 +- .../3rdparty/freetype/src/type1/t1driver.h | 76 +- .../3rdparty/freetype/src/type1/t1errors.h | 80 +- .../dll/3rdparty/freetype/src/type1/t1gload.c | 844 +- .../dll/3rdparty/freetype/src/type1/t1gload.h | 92 +- .../dll/3rdparty/freetype/src/type1/t1load.c | 4442 ++--- .../dll/3rdparty/freetype/src/type1/t1load.h | 204 +- .../dll/3rdparty/freetype/src/type1/t1objs.c | 1132 +- .../dll/3rdparty/freetype/src/type1/t1objs.h | 342 +- .../dll/3rdparty/freetype/src/type1/t1parse.c | 958 +- .../dll/3rdparty/freetype/src/type1/t1parse.h | 270 +- .../3rdparty/freetype/src/type1/t1tokens.h | 268 +- .../dll/3rdparty/freetype/src/type1/type1.c | 66 +- .../3rdparty/freetype/src/type42/t42drivr.c | 464 +- .../3rdparty/freetype/src/type42/t42drivr.h | 76 +- .../3rdparty/freetype/src/type42/t42error.h | 80 +- .../3rdparty/freetype/src/type42/t42objs.c | 1294 +- .../3rdparty/freetype/src/type42/t42objs.h | 248 +- .../3rdparty/freetype/src/type42/t42parse.c | 2334 +-- .../3rdparty/freetype/src/type42/t42parse.h | 180 +- .../3rdparty/freetype/src/type42/t42types.h | 108 +- .../dll/3rdparty/freetype/src/type42/type42.c | 50 +- .../3rdparty/freetype/src/winfonts/fnterrs.h | 82 +- .../3rdparty/freetype/src/winfonts/winfnt.c | 2244 +-- .../3rdparty/freetype/src/winfonts/winfnt.h | 334 +- .../dll/3rdparty/mesa32/include/GL/amesa.h | 8 +- .../3rdparty/mesa32/include/GL/directfbgl.h | 2 +- .../dll/3rdparty/mesa32/include/GL/dmesa.h | 8 +- .../dll/3rdparty/mesa32/include/GL/ggimesa.h | 2 +- reactos/dll/3rdparty/mesa32/include/GL/gl.h | 2 +- .../dll/3rdparty/mesa32/include/GL/glext.h | 8 +- reactos/dll/3rdparty/mesa32/include/GL/glu.h | 8 +- reactos/dll/3rdparty/mesa32/include/GL/glx.h | 12 +- .../dll/3rdparty/mesa32/include/GL/glxext.h | 10 +- .../include/GL/internal/dri_interface.h | 28 +- .../mesa32/include/GL/internal/glcore.h | 24 +- .../mesa32/include/GL/internal/sarea.h | 10 +- .../dll/3rdparty/mesa32/include/GL/osmesa.h | 8 +- .../mesa32/include/GL/uglglutshapes.h | 2 +- .../dll/3rdparty/mesa32/include/GL/uglmesa.h | 18 +- .../3rdparty/mesa32/include/GL/vms_x_fix.h | 2 +- .../dll/3rdparty/mesa32/include/GL/wmesa.h | 4 +- .../dll/3rdparty/mesa32/include/GL/xmesa.h | 8 +- reactos/dll/3rdparty/mesa32/include/GLView.h | 32 +- .../mesa32/src/array_cache/ac_import.c | 8 +- .../mesa32/src/drivers/common/driverfuncs.c | 6 +- .../mesa32/src/drivers/windows/gdi/mesa.def | 2 +- .../mesa32/src/drivers/windows/gdi/wgl.c | 200 +- .../mesa32/src/drivers/windows/gdi/wmesa.c | 364 +- .../mesa32/src/drivers/windows/gdi/wmesadef.h | 2 +- .../src/drivers/windows/gldirect/dglcontext.c | 6 +- .../src/drivers/windows/gldirect/dglglobals.h | 2 +- .../src/drivers/windows/gldirect/dglpf.c | 30 +- .../src/drivers/windows/gldirect/dglwgl.c | 130 +- .../src/drivers/windows/gldirect/dll_main.c | 2 +- .../drivers/windows/gldirect/gld_dispatch.c | 2 +- .../src/drivers/windows/gldirect/gld_driver.c | 2 +- .../mesa32/src/drivers/windows/icd/icd.c | 2 +- .../dll/3rdparty/mesa32/src/glapi/dispatch.h | 6 +- reactos/dll/3rdparty/mesa32/src/glapi/glapi.c | 40 +- .../3rdparty/mesa32/src/glapi/glapioffsets.h | 6 +- .../3rdparty/mesa32/src/glapi/glapitable.h | 6 +- .../dll/3rdparty/mesa32/src/glapi/glapitemp.h | 6 +- .../dll/3rdparty/mesa32/src/glapi/glprocs.h | 6 +- reactos/dll/3rdparty/mesa32/src/main/accum.c | 2 +- reactos/dll/3rdparty/mesa32/src/main/accum.h | 4 +- .../3rdparty/mesa32/src/main/api_arrayelt.c | 2 +- .../3rdparty/mesa32/src/main/api_loopback.c | 10 +- .../dll/3rdparty/mesa32/src/main/api_noop.c | 10 +- .../dll/3rdparty/mesa32/src/main/api_noop.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/attrib.c | 8 +- reactos/dll/3rdparty/mesa32/src/main/attrib.h | 4 +- reactos/dll/3rdparty/mesa32/src/main/blend.c | 2 +- reactos/dll/3rdparty/mesa32/src/main/blend.h | 2 +- .../dll/3rdparty/mesa32/src/main/bufferobj.c | 20 +- .../dll/3rdparty/mesa32/src/main/buffers.c | 6 +- .../dll/3rdparty/mesa32/src/main/buffers.h | 4 +- reactos/dll/3rdparty/mesa32/src/main/clip.c | 12 +- reactos/dll/3rdparty/mesa32/src/main/clip.h | 8 +- .../dll/3rdparty/mesa32/src/main/colortab.h | 6 +- reactos/dll/3rdparty/mesa32/src/main/config.h | 10 +- .../dll/3rdparty/mesa32/src/main/context.c | 58 +- .../dll/3rdparty/mesa32/src/main/context.h | 10 +- .../dll/3rdparty/mesa32/src/main/convolve.c | 24 +- reactos/dll/3rdparty/mesa32/src/main/dd.h | 82 +- reactos/dll/3rdparty/mesa32/src/main/debug.c | 26 +- reactos/dll/3rdparty/mesa32/src/main/debug.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/depth.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/dlist.c | 52 +- .../dll/3rdparty/mesa32/src/main/drawpix.c | 4 +- reactos/dll/3rdparty/mesa32/src/main/enable.c | 8 +- reactos/dll/3rdparty/mesa32/src/main/enums.c | 8 +- reactos/dll/3rdparty/mesa32/src/main/enums.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/eval.c | 6 +- reactos/dll/3rdparty/mesa32/src/main/eval.h | 2 +- .../dll/3rdparty/mesa32/src/main/execmem.c | 18 +- .../dll/3rdparty/mesa32/src/main/extensions.h | 2 +- .../dll/3rdparty/mesa32/src/main/feedback.c | 14 +- reactos/dll/3rdparty/mesa32/src/main/fog.h | 2 +- .../3rdparty/mesa32/src/main/framebuffer.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/get.c | 6 +- .../dll/3rdparty/mesa32/src/main/glheader.h | 8 +- reactos/dll/3rdparty/mesa32/src/main/hash.c | 32 +- reactos/dll/3rdparty/mesa32/src/main/hash.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/hint.h | 4 +- .../dll/3rdparty/mesa32/src/main/histogram.h | 22 +- reactos/dll/3rdparty/mesa32/src/main/image.c | 6 +- .../dll/3rdparty/mesa32/src/main/imports.c | 42 +- .../dll/3rdparty/mesa32/src/main/imports.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/light.c | 34 +- reactos/dll/3rdparty/mesa32/src/main/lines.c | 2 +- reactos/dll/3rdparty/mesa32/src/main/lines.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/matrix.c | 44 +- reactos/dll/3rdparty/mesa32/src/main/matrix.h | 12 +- reactos/dll/3rdparty/mesa32/src/main/mm.c | 14 +- reactos/dll/3rdparty/mesa32/src/main/mm.h | 10 +- reactos/dll/3rdparty/mesa32/src/main/mtypes.h | 94 +- reactos/dll/3rdparty/mesa32/src/main/pixel.h | 4 +- reactos/dll/3rdparty/mesa32/src/main/points.h | 2 +- .../dll/3rdparty/mesa32/src/main/polygon.c | 6 +- .../dll/3rdparty/mesa32/src/main/polygon.h | 4 +- .../dll/3rdparty/mesa32/src/main/rastpos.c | 22 +- .../dll/3rdparty/mesa32/src/main/rastpos.h | 2 +- .../3rdparty/mesa32/src/main/renderbuffer.c | 4 +- .../3rdparty/mesa32/src/main/simple_list.h | 12 +- reactos/dll/3rdparty/mesa32/src/main/state.c | 10 +- .../dll/3rdparty/mesa32/src/main/stencil.c | 4 +- .../dll/3rdparty/mesa32/src/main/stencil.h | 2 +- .../mesa32/src/main/texcompress_fxt1.c | 4 +- .../3rdparty/mesa32/src/main/texenvprogram.c | 168 +- .../dll/3rdparty/mesa32/src/main/texformat.c | 2 +- .../dll/3rdparty/mesa32/src/main/texformat.h | 4 +- .../3rdparty/mesa32/src/main/texformat_tmp.h | 48 +- .../dll/3rdparty/mesa32/src/main/teximage.c | 58 +- .../dll/3rdparty/mesa32/src/main/teximage.h | 2 +- reactos/dll/3rdparty/mesa32/src/main/texobj.c | 28 +- .../dll/3rdparty/mesa32/src/main/texstate.c | 22 +- .../dll/3rdparty/mesa32/src/main/texstate.h | 4 +- .../dll/3rdparty/mesa32/src/main/texstore.c | 34 +- reactos/dll/3rdparty/mesa32/src/main/varray.c | 2 +- reactos/dll/3rdparty/mesa32/src/main/vtxfmt.h | 2 +- .../3rdparty/mesa32/src/math/m_debug_util.h | 6 +- .../dll/3rdparty/mesa32/src/math/m_matrix.c | 60 +- .../dll/3rdparty/mesa32/src/ppc/common_ppc.c | 4 +- .../3rdparty/mesa32/src/shader/arbprogparse.c | 16 +- .../3rdparty/mesa32/src/shader/arbprogparse.h | 14 +- .../3rdparty/mesa32/src/shader/arbprogram.c | 14 +- .../3rdparty/mesa32/src/shader/arbprogram.h | 4 +- .../3rdparty/mesa32/src/shader/arbvertparse.c | 6 +- .../3rdparty/mesa32/src/shader/arbvertparse.h | 2 +- .../mesa32/src/shader/atifragshader.c | 12 +- .../mesa32/src/shader/grammar/grammar.c | 2 +- .../3rdparty/mesa32/src/shader/nvfragparse.c | 10 +- .../3rdparty/mesa32/src/shader/nvfragprog.h | 2 +- .../3rdparty/mesa32/src/shader/nvprogram.c | 8 +- .../3rdparty/mesa32/src/shader/nvprogram.h | 2 +- .../3rdparty/mesa32/src/shader/nvvertexec.c | 6 +- .../dll/3rdparty/mesa32/src/shader/program.c | 30 +- .../dll/3rdparty/mesa32/src/shader/program.h | 16 +- .../mesa32/src/shader/shaderobjects.c | 2 +- .../mesa32/src/shader/shaderobjects.h | 330 +- .../mesa32/src/shader/shaderobjects_3dlabs.c | 2 +- .../mesa32/src/shader/slang/slang_compile.h | 2 +- .../mesa32/src/shader/slang/slang_execute.c | 2 +- reactos/dll/3rdparty/mesa32/src/sparc/sparc.c | 8 +- reactos/dll/3rdparty/mesa32/src/sparc/sparc.h | 8 +- .../dll/3rdparty/mesa32/src/swrast/s_aaline.c | 4 +- .../3rdparty/mesa32/src/swrast/s_aatritemp.h | 18 +- .../dll/3rdparty/mesa32/src/swrast/s_blend.c | 2 +- .../3rdparty/mesa32/src/swrast/s_buffers.c | 8 +- .../3rdparty/mesa32/src/swrast/s_context.c | 2 +- .../3rdparty/mesa32/src/swrast/s_context.h | 10 +- .../3rdparty/mesa32/src/swrast/s_copypix.c | 6 +- .../dll/3rdparty/mesa32/src/swrast/s_depth.c | 2 +- .../3rdparty/mesa32/src/swrast/s_drawpix.c | 6 +- .../dll/3rdparty/mesa32/src/swrast/s_fog.c | 2 +- .../mesa32/src/swrast/s_fragprog_to_c.c | 118 +- .../3rdparty/mesa32/src/swrast/s_imaging.c | 18 +- .../3rdparty/mesa32/src/swrast/s_linetemp.h | 4 +- .../3rdparty/mesa32/src/swrast/s_nvfragprog.c | 18 +- .../dll/3rdparty/mesa32/src/swrast/s_span.c | 4 +- .../3rdparty/mesa32/src/swrast/s_stencil.c | 6 +- .../dll/3rdparty/mesa32/src/swrast/s_tcc.c | 22 +- .../3rdparty/mesa32/src/swrast/s_texture.c | 8 +- .../3rdparty/mesa32/src/swrast/s_triangle.c | 4 +- .../dll/3rdparty/mesa32/src/swrast/swrast.h | 18 +- .../mesa32/src/swrast_setup/ss_context.c | 24 +- .../mesa32/src/swrast_setup/ss_tritmp.h | 2 +- .../mesa32/src/swrast_setup/swrast_setup.h | 4 +- .../dll/3rdparty/mesa32/src/tnl/t_array_api.c | 28 +- .../3rdparty/mesa32/src/tnl/t_array_import.c | 4 +- .../dll/3rdparty/mesa32/src/tnl/t_context.c | 10 +- .../dll/3rdparty/mesa32/src/tnl/t_context.h | 50 +- .../dll/3rdparty/mesa32/src/tnl/t_pipeline.c | 16 +- .../dll/3rdparty/mesa32/src/tnl/t_pipeline.h | 2 +- .../dll/3rdparty/mesa32/src/tnl/t_save_api.c | 148 +- .../3rdparty/mesa32/src/tnl/t_save_loopback.c | 18 +- .../3rdparty/mesa32/src/tnl/t_save_playback.c | 12 +- .../3rdparty/mesa32/src/tnl/t_vb_arbprogram.c | 124 +- .../3rdparty/mesa32/src/tnl/t_vb_arbprogram.h | 2 +- .../mesa32/src/tnl/t_vb_arbprogram_sse.c | 228 +- .../dll/3rdparty/mesa32/src/tnl/t_vb_cull.c | 4 +- .../dll/3rdparty/mesa32/src/tnl/t_vb_light.c | 12 +- .../3rdparty/mesa32/src/tnl/t_vb_program.c | 2 +- .../dll/3rdparty/mesa32/src/tnl/t_vb_render.c | 10 +- .../dll/3rdparty/mesa32/src/tnl/t_vb_texgen.c | 10 +- .../dll/3rdparty/mesa32/src/tnl/t_vb_texmat.c | 4 +- .../dll/3rdparty/mesa32/src/tnl/t_vb_vertex.c | 4 +- .../dll/3rdparty/mesa32/src/tnl/t_vertex.c | 56 +- .../dll/3rdparty/mesa32/src/tnl/t_vertex.h | 8 +- .../mesa32/src/tnl/t_vertex_generic.c | 186 +- .../3rdparty/mesa32/src/tnl/t_vertex_sse.c | 102 +- .../dll/3rdparty/mesa32/src/tnl/t_vp_build.c | 268 +- .../dll/3rdparty/mesa32/src/tnl/t_vtx_api.c | 160 +- .../dll/3rdparty/mesa32/src/tnl/t_vtx_api.h | 4 +- .../dll/3rdparty/mesa32/src/tnl/t_vtx_eval.c | 82 +- .../dll/3rdparty/mesa32/src/tnl/t_vtx_exec.c | 28 +- .../3rdparty/mesa32/src/tnl/t_vtx_generic.c | 34 +- .../dll/3rdparty/mesa32/src/tnl/t_vtx_x86.c | 16 +- .../mesa32/src/tnl_dd/imm/t_dd_imm_primtmp.h | 32 +- .../mesa32/src/tnl_dd/imm/t_dd_imm_vapi.h | 2 +- .../mesa32/src/tnl_dd/imm/t_dd_imm_vb.c | 2 +- .../mesa32/src/tnl_dd/imm/t_dd_imm_vbtmp.h | 20 +- .../3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp.h | 24 +- .../3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp2.h | 52 +- .../3rdparty/mesa32/src/tnl_dd/t_dd_triemit.h | 8 +- .../3rdparty/mesa32/src/tnl_dd/t_dd_tritmp.h | 4 +- .../dll/3rdparty/mesa32/src/tnl_dd/t_dd_vb.c | 14 +- .../3rdparty/mesa32/src/tnl_dd/t_dd_vbtmp.h | 46 +- .../dll/3rdparty/mesa32/src/x86-64/x86-64.c | 2 +- .../dll/3rdparty/mesa32/src/x86/common_x86.c | 6 +- .../3rdparty/mesa32/src/x86/mmx_blendtmp.h | 14 +- .../mesa32/src/x86/read_rgba_span_x86.h | 2 +- .../3rdparty/mesa32/src/x86/rtasm/x86sse.c | 66 +- reactos/dll/cpl/access/lang/cs-CZ.rc | 2 +- reactos/dll/cpl/access/lang/de-DE.rc | 2 +- reactos/dll/cpl/access/lang/en-US.rc | 2 +- reactos/dll/cpl/access/lang/es-ES.rc | 2 +- reactos/dll/cpl/access/lang/fr-FR.rc | 2 +- reactos/dll/cpl/access/lang/hu-HU.rc | 2 +- reactos/dll/cpl/access/lang/id-ID.rc | 2 +- reactos/dll/cpl/access/lang/it-IT.rc | 2 +- reactos/dll/cpl/access/lang/ja-JP.rc | 2 +- reactos/dll/cpl/access/lang/nl-NL.rc | 2 +- reactos/dll/cpl/access/lang/pl-PL.rc | 2 +- reactos/dll/cpl/access/lang/ru-RU.rc | 2 +- reactos/dll/cpl/access/lang/uk-UA.rc | 2 +- reactos/dll/cpl/appwiz/add.c | 6 +- reactos/dll/cpl/appwiz/appwiz.c | 2 +- reactos/dll/cpl/appwiz/createlink.c | 8 +- reactos/dll/cpl/appwiz/lang/en-US.rc | 4 +- reactos/dll/cpl/appwiz/remove.c | 46 +- reactos/dll/cpl/appwiz/rossetup.c | 2 +- reactos/dll/cpl/appwiz/updates.c | 2 +- reactos/dll/cpl/desk/advappdlg.c | 8 +- reactos/dll/cpl/desk/advmon.c | 2 +- reactos/dll/cpl/desk/appearance.c | 14 +- reactos/dll/cpl/desk/background.c | 2 +- reactos/dll/cpl/desk/classinst.c | 2 +- reactos/dll/cpl/desk/desk.c | 4 +- reactos/dll/cpl/desk/dibitmap.c | 2 +- reactos/dll/cpl/desk/lang/cs-CZ.rc | 6 +- reactos/dll/cpl/desk/lang/de-DE.rc | 4 +- reactos/dll/cpl/desk/lang/el-GR.rc | 6 +- reactos/dll/cpl/desk/lang/fr-FR.rc | 6 +- reactos/dll/cpl/desk/lang/hu-HU.rc | 2 +- reactos/dll/cpl/desk/lang/it-IT.rc | 4 +- reactos/dll/cpl/desk/lang/ja-JP.rc | 6 +- reactos/dll/cpl/desk/lang/nl-NL.rc | 8 +- reactos/dll/cpl/desk/lang/pl-PL.rc | 6 +- reactos/dll/cpl/desk/lang/ru-RU.rc | 4 +- reactos/dll/cpl/desk/lang/sv-SE.rc | 14 +- reactos/dll/cpl/desk/lang/uk-UA.rc | 4 +- reactos/dll/cpl/desk/screensaver.c | 56 +- reactos/dll/cpl/hdwwiz/hdwwiz.c | 2 +- reactos/dll/cpl/hdwwiz/lang/nl-NL.rc | 2 +- reactos/dll/cpl/input/add.c | 8 +- reactos/dll/cpl/input/advanced.c | 2 +- reactos/dll/cpl/input/changekeyseq.c | 4 +- reactos/dll/cpl/input/input.c | 2 +- reactos/dll/cpl/input/inputlangprop.c | 4 +- reactos/dll/cpl/input/keysettings.c | 4 +- reactos/dll/cpl/input/lang/de-DE.rc | 2 +- reactos/dll/cpl/input/lang/en-US.rc | 4 +- reactos/dll/cpl/input/lang/fr-FR.rc | 2 +- reactos/dll/cpl/input/lang/uk-UA.rc | 2 +- reactos/dll/cpl/input/langbar.c | 4 +- reactos/dll/cpl/input/misc.c | 6 +- reactos/dll/cpl/input/settings.c | 18 +- reactos/dll/cpl/intl/date.c | 4 +- reactos/dll/cpl/intl/intl.c | 8 +- reactos/dll/cpl/intl/intl.h | 2 +- reactos/dll/cpl/intl/lang/bg-BG.rc | 2 +- reactos/dll/cpl/intl/lang/de-DE.rc | 2 +- reactos/dll/cpl/intl/lang/en-US.rc | 2 +- reactos/dll/cpl/intl/lang/es-ES.rc | 2 +- reactos/dll/cpl/intl/lang/fr-FR.rc | 2 +- reactos/dll/cpl/intl/lang/it-IT.rc | 2 +- reactos/dll/cpl/intl/lang/ru-RU.rc | 4 +- reactos/dll/cpl/intl/lang/sv-SE.rc | 2 +- reactos/dll/cpl/intl/lang/uk-UA.rc | 4 +- reactos/dll/cpl/liccpa/lang/de-DE.rc | 2 +- reactos/dll/cpl/liccpa/lang/en-US.rc | 2 +- reactos/dll/cpl/liccpa/lang/es-ES.rc | 2 +- reactos/dll/cpl/liccpa/lang/id-ID.rc | 2 +- reactos/dll/cpl/liccpa/lang/it-IT.rc | 2 +- reactos/dll/cpl/liccpa/lang/ja-JP.rc | 2 +- reactos/dll/cpl/liccpa/lang/pl-PL.rc | 10 +- reactos/dll/cpl/liccpa/lang/ru-RU.rc | 2 +- reactos/dll/cpl/liccpa/lang/uk-UA.rc | 2 +- reactos/dll/cpl/liccpa/liccpa.c | 2 +- reactos/dll/cpl/main/lang/cs-CZ.rc | 2 +- reactos/dll/cpl/main/lang/es-ES.rc | 2 +- reactos/dll/cpl/main/lang/fr-FR.rc | 2 +- reactos/dll/cpl/main/lang/hu-HU.rc | 2 +- reactos/dll/cpl/main/lang/id-ID.rc | 2 +- reactos/dll/cpl/main/lang/it-IT.rc | 2 +- reactos/dll/cpl/main/lang/ja-JP.rc | 2 +- reactos/dll/cpl/main/lang/nl-NL.rc | 2 +- reactos/dll/cpl/main/lang/pl-PL.rc | 10 +- reactos/dll/cpl/main/lang/ru-RU.rc | 2 +- reactos/dll/cpl/main/lang/uk-UA.rc | 2 +- reactos/dll/cpl/main/main.c | 2 +- reactos/dll/cpl/mmsys/lang/cs-CZ.rc | 2 +- reactos/dll/cpl/mmsys/lang/de-DE.rc | 2 +- reactos/dll/cpl/mmsys/lang/el-GR.rc | 2 +- reactos/dll/cpl/mmsys/lang/en-US.rc | 2 +- reactos/dll/cpl/mmsys/lang/es-ES.rc | 2 +- reactos/dll/cpl/mmsys/lang/fr-FR.rc | 2 +- reactos/dll/cpl/mmsys/lang/it-IT.rc | 2 +- reactos/dll/cpl/mmsys/lang/nl-NL.rc | 2 +- reactos/dll/cpl/mmsys/lang/pl-PL.rc | 10 +- reactos/dll/cpl/mmsys/lang/pt-BR.rc | 2 +- reactos/dll/cpl/mmsys/lang/ru-RU.rc | 2 +- reactos/dll/cpl/mmsys/lang/uk-UA.rc | 2 +- reactos/dll/cpl/mmsys/mmsys.c | 2 +- reactos/dll/cpl/mmsys/mmsys.h | 4 +- reactos/dll/cpl/mmsys/sounds.c | 24 +- reactos/dll/cpl/mmsys/volume.c | 2 +- reactos/dll/cpl/ncpa/lang/bg-BG.rc | 8 +- reactos/dll/cpl/ncpa/lang/cs-CZ.rc | 8 +- reactos/dll/cpl/ncpa/lang/da-DK.rc | 8 +- reactos/dll/cpl/ncpa/lang/de-DE.rc | 6 +- reactos/dll/cpl/ncpa/lang/el-GR.rc | 8 +- reactos/dll/cpl/ncpa/lang/en-US.rc | 8 +- reactos/dll/cpl/ncpa/lang/es-ES.rc | 8 +- reactos/dll/cpl/ncpa/lang/fr-FR.rc | 8 +- reactos/dll/cpl/ncpa/lang/hu-HU.rc | 8 +- reactos/dll/cpl/ncpa/lang/id-ID.rc | 8 +- reactos/dll/cpl/ncpa/lang/it-IT.rc | 8 +- reactos/dll/cpl/ncpa/lang/ja-JP.rc | 8 +- reactos/dll/cpl/ncpa/lang/nl-NL.rc | 8 +- reactos/dll/cpl/ncpa/lang/pl-PL.rc | 8 +- reactos/dll/cpl/ncpa/lang/ru-RU.rc | 8 +- reactos/dll/cpl/ncpa/lang/sv-SE.rc | 8 +- reactos/dll/cpl/ncpa/lang/uk-UA.rc | 8 +- reactos/dll/cpl/ncpa/tcpip_properties.c | 16 +- reactos/dll/cpl/powercfg/alarms.c | 14 +- reactos/dll/cpl/powercfg/hibernate.c | 4 +- reactos/dll/cpl/powercfg/lang/bg-BG.rc | 18 +- reactos/dll/cpl/powercfg/lang/cs-CZ.rc | 18 +- reactos/dll/cpl/powercfg/lang/de-DE.rc | 18 +- reactos/dll/cpl/powercfg/lang/en-US.rc | 18 +- reactos/dll/cpl/powercfg/lang/fr-FR.rc | 16 +- reactos/dll/cpl/powercfg/lang/id-ID.rc | 18 +- reactos/dll/cpl/powercfg/lang/it-IT.rc | 28 +- reactos/dll/cpl/powercfg/lang/nl-NL.rc | 18 +- reactos/dll/cpl/powercfg/lang/pl-PL.rc | 20 +- reactos/dll/cpl/powercfg/lang/ru-RU.rc | 18 +- reactos/dll/cpl/powercfg/lang/th-TH.rc | 18 +- reactos/dll/cpl/powercfg/lang/uk-UA.rc | 18 +- reactos/dll/cpl/powercfg/powercfg.c | 14 +- reactos/dll/cpl/powercfg/powershemes.c | 8 +- reactos/dll/cpl/sysdm/environment.c | 14 +- reactos/dll/cpl/sysdm/general.c | 8 +- reactos/dll/cpl/sysdm/lang/cs-CZ.rc | 14 +- reactos/dll/cpl/sysdm/lang/da-DK.rc | 14 +- reactos/dll/cpl/sysdm/lang/es-ES.rc | 16 +- reactos/dll/cpl/sysdm/lang/hu-HU.rc | 14 +- reactos/dll/cpl/sysdm/lang/ja-JP.rc | 14 +- reactos/dll/cpl/sysdm/lang/nl-NL.rc | 14 +- reactos/dll/cpl/sysdm/lang/pl-PL.rc | 10 +- reactos/dll/cpl/sysdm/lang/sv-SE.rc | 14 +- reactos/dll/cpl/sysdm/startrec.c | 38 +- reactos/dll/cpl/timedate/lang/cs-CZ.rc | 4 +- reactos/dll/cpl/timedate/lang/el-GR.rc | 4 +- reactos/dll/cpl/timedate/lang/es-ES.rc | 2 +- reactos/dll/cpl/timedate/lang/hu-HU.rc | 2 +- reactos/dll/cpl/timedate/lang/ja-JP.rc | 2 +- reactos/dll/cpl/timedate/lang/nl-NL.rc | 2 +- reactos/dll/cpl/timedate/lang/sk-SK.rc | 4 +- reactos/dll/cpl/timedate/ntpclient.c | 4 +- reactos/dll/cpl/timedate/timedate.c | 2 +- reactos/dll/cpl/usrmgr/usrmgr.c | 2 +- reactos/dll/directx/d3d8/d3d8.c | 4 +- reactos/dll/directx/d3d8thk/d3d8thk.rbuild | 2 +- reactos/dll/directx/d3d9/d3d9.c | 4 +- .../dll/directx/ddraw/Clipper/clipper_main.c | 28 +- .../dll/directx/ddraw/Clipper/clipper_stubs.c | 24 +- reactos/dll/directx/ddraw/Color/color_stubs.c | 24 +- reactos/dll/directx/ddraw/Ddraw/GetCaps.c | 10 +- .../directx/ddraw/Ddraw/GetDeviceIdentifier.c | 8 +- .../directx/ddraw/Ddraw/callbacks_dd_hel.c | 10 +- reactos/dll/directx/ddraw/Ddraw/ddraw.h | 12 +- .../directx/ddraw/Ddraw/ddraw_displaymode.c | 32 +- reactos/dll/directx/ddraw/Ddraw/ddraw_main.c | 34 +- .../ddraw/Ddraw/ddraw_setcooperativelevel.c | 8 +- reactos/dll/directx/ddraw/Gamma/gamma_stubs.c | 26 +- .../dll/directx/ddraw/Kernel/kernel_stubs.c | 72 +- .../dll/directx/ddraw/Palette/palette_stubs.c | 26 +- .../ddraw/Surface/callbacks_surf_hel.c | 4 +- .../dll/directx/ddraw/Surface/createsurface.c | 20 +- .../dll/directx/ddraw/Surface/surface_main.c | 258 +- .../dll/directx/ddraw/Surface/surface_stubs.c | 16 +- .../directx/ddraw/Videoport/videoport_stubs.c | 152 +- .../directx/ddraw/Vtable/DirectDraw2_Vtable.c | 4 +- .../directx/ddraw/Vtable/DirectDraw4_Vtable.c | 10 +- .../directx/ddraw/Vtable/DirectDraw7_Vtable.c | 12 +- .../directx/ddraw/Vtable/DirectDraw_Vtable.c | 4 +- reactos/dll/directx/ddraw/cleanup.c | 8 +- reactos/dll/directx/ddraw/main.c | 128 +- reactos/dll/directx/ddraw/rosdraw.h | 22 +- reactos/dll/directx/ddraw/startup.c | 16 +- .../dll/directx/ddraw/thunks/ddraw_thunk.c | 152 +- .../dll/directx/ddraw/thunks/surface_thunk.c | 68 +- reactos/dll/directx/devenum/devenum_main.c | 2 +- reactos/dll/directx/dinput/device.c | 116 +- reactos/dll/directx/dinput/device_private.h | 4 +- reactos/dll/directx/dinput/dinput_main.c | 28 +- .../dll/directx/dinput/effect_linuxinput.c | 98 +- .../dll/directx/dinput/joystick_linuxinput.c | 54 +- reactos/dll/directx/dinput/keyboard.c | 66 +- reactos/dll/directx/directx.rbuild | 2 +- reactos/dll/directx/dplay/dplay.rbuild | 2 +- reactos/dll/directx/dplayx/dplay.c | 30 +- reactos/dll/directx/dplayx/dplayx_global.c | 2 +- reactos/dll/directx/dplayx/dplayx_main.c | 14 +- reactos/dll/directx/dsound/buffer.c | 6 +- reactos/dll/directx/dsound/capture.c | 2 +- reactos/dll/directx/dsound/dsound.c | 2 +- reactos/dll/directx/dsound/dsound.rbuild | 4 +- reactos/dll/directx/dsound/dsound_main.c | 4 +- reactos/dll/directx/dsound/duplex.c | 2 +- .../directx/dsound/dxroslayer/dxros_layer.h | 8 +- .../dxroslayer/dxrosdrv_querydsounddesc.c | 46 +- .../dxroslayer/dxrosdrv_querydsoundiface.c | 8 +- .../directx/dsound/dxroslayer/dxroslayer.c | 36 +- .../dsound/dxroslayer/getguidfromstring.c | 42 +- reactos/dll/directx/dsound/mixer.c | 10 +- reactos/dll/directx/dsound/primary.c | 2 +- reactos/dll/directx/dsound/sound3d.c | 30 +- reactos/dll/directx/dxdiagn/container.c | 28 +- reactos/dll/directx/dxdiagn/dxdiag_main.c | 12 +- reactos/dll/directx/dxdiagn/dxdiag_private.h | 2 +- reactos/dll/directx/dxdiagn/provider.c | 6 +- reactos/dll/directx/wine/d3d8/d3d8.rbuild | 2 +- reactos/dll/directx/wine/d3d8/d3d8_main.c | 10 +- reactos/dll/directx/wine/d3d8/d3d8_private.h | 2 +- reactos/dll/directx/wine/d3d8/device.c | 14 +- reactos/dll/directx/wine/d3d8/directx.c | 12 +- reactos/dll/directx/wine/d3d8/stateblock.c | 6 +- reactos/dll/directx/wine/d3d8/volume.c | 4 +- .../directx/wine/wined3d/arb_program_shader.c | 16 +- reactos/dll/directx/wine/wined3d/baseshader.c | 46 +- .../dll/directx/wine/wined3d/basetexture.c | 2 +- .../dll/directx/wine/wined3d/cubetexture.c | 4 +- reactos/dll/directx/wine/wined3d/device.c | 50 +- reactos/dll/directx/wine/wined3d/directx.c | 28 +- reactos/dll/directx/wine/wined3d/drawprim.c | 10 +- .../dll/directx/wine/wined3d/glsl_shader.c | 104 +- .../dll/directx/wine/wined3d/pixelshader.c | 14 +- reactos/dll/directx/wine/wined3d/resource.c | 2 +- reactos/dll/directx/wine/wined3d/state.c | 2 +- reactos/dll/directx/wine/wined3d/stateblock.c | 10 +- reactos/dll/directx/wine/wined3d/surface.c | 6 +- .../dll/directx/wine/wined3d/surface_gdi.c | 2 +- .../dll/directx/wine/wined3d/vertexshader.c | 16 +- .../dll/directx/wine/wined3d/wined3d.rbuild | 2 +- .../dll/directx/wine/wined3d/wined3d_main.c | 2 +- .../directx/wine/wined3d/wined3d_private.h | 48 +- .../wine/wined3d/wined3d_private_types.h | 2 +- reactos/dll/keyboard/kbdbe/kbdbe.c | 40 +- reactos/dll/keyboard/kbdbur/kbdbur.c | 22 +- reactos/dll/keyboard/kbdcz1/kbdcz1.c | 28 +- reactos/dll/keyboard/kbdda/kbdda.c | 28 +- reactos/dll/keyboard/kbddv/kbddv.c | 26 +- reactos/dll/keyboard/kbdes/kbdes.c | 250 +- reactos/dll/keyboard/kbdfi/kbdfi.c | 26 +- reactos/dll/keyboard/kbdfr/kbdfr.c | 32 +- reactos/dll/keyboard/kbdgr/kbdgr.c | 30 +- reactos/dll/keyboard/kbdhe/kbdhe.c | 10 +- reactos/dll/keyboard/kbdheb/kbdheb.c | 12 +- reactos/dll/keyboard/kbdhu/kbdhu.c | 26 +- reactos/dll/keyboard/kbdit/kbdit.c | 216 +- reactos/dll/keyboard/kbdja/kbdja.c | 26 +- reactos/dll/keyboard/kbdno/kbdno.c | 30 +- reactos/dll/keyboard/kbdpl1/kbdpl1.c | 26 +- reactos/dll/keyboard/kbdpo/kbdpo.c | 290 +- reactos/dll/keyboard/kbdru/kbdru.c | 28 +- reactos/dll/keyboard/kbdsg/kbdsg.c | 36 +- reactos/dll/keyboard/kbdsk/kbdsk.c | 26 +- reactos/dll/keyboard/kbdsw/kbdsw.c | 40 +- reactos/dll/keyboard/kbdth/kbdth.c | 22 +- reactos/dll/keyboard/kbduk/kbduk.c | 32 +- reactos/dll/keyboard/kbdur/kbdur.c | 28 +- reactos/dll/keyboard/kbdus/kbdus.c | 26 +- reactos/dll/ntdll/inc/ntdllp.h | 2 +- reactos/dll/ntdll/rtl/libsupp.c | 14 +- reactos/dll/win32/acledit/acleditint.h | 6 +- reactos/dll/win32/acledit/stubs.c | 2 +- reactos/dll/win32/aclui/aclui.c | 64 +- reactos/dll/win32/aclui/checklist.c | 390 +- reactos/dll/win32/aclui/misc.c | 4 +- reactos/dll/win32/advapi32/misc/shutdown.c | 2 +- reactos/dll/win32/advapi32/reg/reg.c | 180 +- reactos/dll/win32/advapi32/sec/misc.c | 22 +- reactos/dll/win32/advapi32/sec/sec.c | 12 +- reactos/dll/win32/advapi32/sec/sid.c | 2 +- reactos/dll/win32/advapi32/token/token.c | 16 +- reactos/dll/win32/advpack/advpack.c | 8 +- reactos/dll/win32/advpack/files.c | 26 +- reactos/dll/win32/advpack/install.c | 12 +- reactos/dll/win32/advpack/reg.c | 20 +- reactos/dll/win32/authz/clictx.c | 6 +- reactos/dll/win32/authz/precomp.h | 2 +- reactos/dll/win32/authz/resman.c | 30 +- reactos/dll/win32/avifil32/api.c | 4 +- reactos/dll/win32/avifil32/avifile.c | 2 +- reactos/dll/win32/avifil32/avifile_Cs.rc | 2 +- reactos/dll/win32/avifil32/avifile_De.rc | 2 +- reactos/dll/win32/avifil32/avifile_En.rc | 2 +- reactos/dll/win32/avifil32/avifile_Es.rc | 2 +- reactos/dll/win32/avifil32/avifile_Fr.rc | 2 +- reactos/dll/win32/avifil32/avifile_Hu.rc | 2 +- reactos/dll/win32/avifil32/avifile_Ja.rc | 2 +- reactos/dll/win32/avifil32/avifile_Ko.rc | 2 +- reactos/dll/win32/avifil32/avifile_Nl.rc | 2 +- reactos/dll/win32/avifil32/avifile_No.rc | 2 +- reactos/dll/win32/avifil32/avifile_Pl.rc | 2 +- reactos/dll/win32/avifil32/avifile_Pt.rc | 2 +- reactos/dll/win32/avifil32/avifile_Ru.rc | 2 +- reactos/dll/win32/avifil32/avifile_Si.rc | 2 +- reactos/dll/win32/avifil32/avifile_Tr.rc | 2 +- reactos/dll/win32/avifil32/avifile_Uk.rc | 2 +- reactos/dll/win32/avifil32/editstream.c | 4 +- reactos/dll/win32/avifil32/getframe.c | 2 +- reactos/dll/win32/avifil32/icmstream.c | 2 +- reactos/dll/win32/avifil32/wavfile.c | 2 +- reactos/dll/win32/beepmidi/beepmidi.c | 4 +- reactos/dll/win32/cabinet/cabinet.h | 4 +- reactos/dll/win32/cabinet/cabinet_main.c | 2 +- reactos/dll/win32/cabinet/fdi.c | 132 +- reactos/dll/win32/cards/cards.c | 2 +- reactos/dll/win32/cards/cards.rbuild | 4 +- reactos/dll/win32/comcat/information.c | 6 +- reactos/dll/win32/comctl32/animate.c | 44 +- reactos/dll/win32/comctl32/comboex.c | 8 +- reactos/dll/win32/comctl32/comctl32undoc.c | 2 +- reactos/dll/win32/comctl32/commctrl.c | 40 +- reactos/dll/win32/comctl32/datetime.c | 40 +- reactos/dll/win32/comctl32/dpa.c | 18 +- reactos/dll/win32/comctl32/draglist.c | 4 +- reactos/dll/win32/comctl32/dsa.c | 6 +- reactos/dll/win32/comctl32/header.c | 108 +- reactos/dll/win32/comctl32/hotkey.c | 22 +- reactos/dll/win32/comctl32/imagelist.c | 10 +- reactos/dll/win32/comctl32/ipaddress.c | 12 +- reactos/dll/win32/comctl32/listview.c | 626 +- reactos/dll/win32/comctl32/pager.c | 16 +- reactos/dll/win32/comctl32/progress.c | 26 +- reactos/dll/win32/comctl32/propsheet.c | 62 +- reactos/dll/win32/comctl32/rebar.c | 18 +- reactos/dll/win32/comctl32/status.c | 20 +- reactos/dll/win32/comctl32/string.c | 4 +- reactos/dll/win32/comctl32/syslink.c | 132 +- reactos/dll/win32/comctl32/tab.c | 52 +- reactos/dll/win32/comctl32/theme_combo.c | 46 +- reactos/dll/win32/comctl32/theme_dialog.c | 30 +- reactos/dll/win32/comctl32/theme_edit.c | 28 +- reactos/dll/win32/comctl32/theme_listbox.c | 22 +- reactos/dll/win32/comctl32/theming.c | 12 +- reactos/dll/win32/comctl32/toolbar.c | 132 +- reactos/dll/win32/comctl32/tooltips.c | 12 +- reactos/dll/win32/comctl32/trackbar.c | 56 +- reactos/dll/win32/comctl32/treeview.c | 20 +- reactos/dll/win32/comctl32/updown.c | 16 +- reactos/dll/win32/comdlg32/cdlg.h | 2 +- reactos/dll/win32/comdlg32/cdlg_Bg.rc | 2 +- reactos/dll/win32/comdlg32/cdlg_Cs.rc | 2 +- reactos/dll/win32/comdlg32/cdlg_Eo.rc | 14 +- reactos/dll/win32/comdlg32/cdlg_Ko.rc | 4 +- reactos/dll/win32/comdlg32/cdlg_Ru.rc | 2 +- reactos/dll/win32/comdlg32/cdlg_xx.rc | 2 +- reactos/dll/win32/comdlg32/filedlg.c | 48 +- reactos/dll/win32/comdlg32/filedlgbrowser.c | 6 +- reactos/dll/win32/comdlg32/printdlg.c | 100 +- reactos/dll/win32/console/colors.c | 14 +- reactos/dll/win32/console/console.c | 26 +- reactos/dll/win32/console/font.c | 2 +- reactos/dll/win32/console/lang/de-DE.rc | 12 +- reactos/dll/win32/console/lang/en-US.rc | 12 +- reactos/dll/win32/console/lang/id-ID.rc | 12 +- reactos/dll/win32/console/lang/ru-RU.rc | 12 +- reactos/dll/win32/console/lang/uk-UA.rc | 12 +- reactos/dll/win32/console/layout.c | 10 +- reactos/dll/win32/console/options.c | 12 +- reactos/dll/win32/console/resource.h | 2 +- reactos/dll/win32/crtdll/dllmain.c | 2 +- reactos/dll/win32/crypt32/cert.c | 2 +- reactos/dll/win32/crypt32/decode.c | 12 +- reactos/dll/win32/crypt32/encode.c | 6 +- reactos/dll/win32/crypt32/main.c | 2 +- reactos/dll/win32/crypt32/oid.c | 2 +- reactos/dll/win32/crypt32/protectdata.c | 24 +- reactos/dll/win32/crypt32/sip.c | 4 +- reactos/dll/win32/crypt32/store.c | 2 +- reactos/dll/win32/crypt32/str.c | 4 +- reactos/dll/win32/cryptui/cryptui.c | 2 +- reactos/dll/win32/dbghelp/coff.c | 30 +- reactos/dll/win32/dbghelp/dbghelp.c | 22 +- reactos/dll/win32/dbghelp/dbghelp_private.h | 76 +- reactos/dll/win32/dbghelp/elf_module.c | 72 +- reactos/dll/win32/dbghelp/memory.c | 4 +- reactos/dll/win32/dbghelp/minidump.c | 20 +- reactos/dll/win32/dbghelp/path.c | 14 +- reactos/dll/win32/dbghelp/pe_module.c | 54 +- reactos/dll/win32/dbghelp/source.c | 4 +- reactos/dll/win32/dbghelp/stabs.c | 90 +- reactos/dll/win32/dbghelp/stack.c | 42 +- reactos/dll/win32/dbghelp/storage.c | 14 +- reactos/dll/win32/dbghelp/symbol.c | 108 +- reactos/dll/win32/dbghelp/type.c | 54 +- reactos/dll/win32/devmgr/hwpage.c | 12 +- reactos/dll/win32/devmgr/lang/de-DE.rc | 4 +- reactos/dll/win32/devmgr/lang/en-US.rc | 4 +- reactos/dll/win32/devmgr/lang/es-ES.rc | 50 +- reactos/dll/win32/devmgr/lang/hu-HU.rc | 4 +- reactos/dll/win32/devmgr/lang/id-ID.rc | 4 +- reactos/dll/win32/devmgr/lang/it-IT.rc | 4 +- reactos/dll/win32/devmgr/lang/pl-PL.rc | 4 +- reactos/dll/win32/devmgr/lang/pt-BR.rc | 4 +- reactos/dll/win32/devmgr/lang/ru-RU.rc | 4 +- reactos/dll/win32/devmgr/lang/uk-UA.rc | 4 +- reactos/dll/win32/devmgr/stubs.c | 2 +- reactos/dll/win32/dhcpcsvc/dhcpcsvc.c | 10 +- reactos/dll/win32/dnsapi/dnsapi/context.c | 16 +- reactos/dll/win32/dnsapi/dnsapi/query.c | 84 +- reactos/dll/win32/fmifs/init.c | 2 +- reactos/dll/win32/gdi32/gdi32.rbuild | 2 +- reactos/dll/win32/gdi32/include/gdi32p.h | 4 +- reactos/dll/win32/gdi32/misc/gdientry.c | 74 +- reactos/dll/win32/gdi32/misc/hacks.c | 30 +- reactos/dll/win32/gdi32/misc/heap.c | 8 +- reactos/dll/win32/gdi32/misc/historic.c | 18 +- reactos/dll/win32/gdi32/misc/misc.c | 10 +- reactos/dll/win32/gdi32/misc/stubs.c | 152 +- reactos/dll/win32/gdi32/misc/stubsa.c | 8 +- reactos/dll/win32/gdi32/misc/stubsw.c | 2 +- reactos/dll/win32/gdi32/misc/wingl.c | 2 +- reactos/dll/win32/gdi32/objects/arc.c | 388 +- reactos/dll/win32/gdi32/objects/bitmap.c | 14 +- reactos/dll/win32/gdi32/objects/brush.c | 18 +- reactos/dll/win32/gdi32/objects/coord.c | 18 +- reactos/dll/win32/gdi32/objects/dc.c | 94 +- reactos/dll/win32/gdi32/objects/eng.c | 12 +- reactos/dll/win32/gdi32/objects/enhmfile.c | 32 +- reactos/dll/win32/gdi32/objects/font.c | 12 +- reactos/dll/win32/gdi32/objects/linedda.c | 8 +- reactos/dll/win32/gdi32/objects/metafile.c | 12 +- reactos/dll/win32/gdi32/objects/painting.c | 26 +- reactos/dll/win32/gdi32/objects/palette.c | 36 +- reactos/dll/win32/gdi32/objects/region.c | 6 +- reactos/dll/win32/gdi32/objects/text.c | 54 +- reactos/dll/win32/gdi32/objects/utils.c | 10 +- reactos/dll/win32/gdiplus/gdiplus/graphics.c | 2 +- reactos/dll/win32/gdiplus/gdiplus/path.c | 2 +- .../glu32/libnurbs/interface/bezierEval.h | 8 +- .../glu32/libnurbs/interface/bezierPatch.h | 18 +- .../libnurbs/interface/bezierPatchMesh.h | 16 +- .../glu32/libnurbs/interface/glcurveval.h | 6 +- .../glu32/libnurbs/interface/glrenderer.h | 22 +- .../glu32/libnurbs/interface/glsurfeval.h | 46 +- .../dll/win32/glu32/libnurbs/internals/arc.h | 4 +- .../glu32/libnurbs/internals/arcsorter.h | 4 +- .../win32/glu32/libnurbs/internals/backend.h | 12 +- .../glu32/libnurbs/internals/basicsurfeval.h | 6 +- .../dll/win32/glu32/libnurbs/internals/bin.h | 2 +- .../win32/glu32/libnurbs/internals/bufpool.h | 8 +- .../glu32/libnurbs/internals/cachingeval.h | 2 +- .../glu32/libnurbs/internals/curvelist.h | 2 +- .../glu32/libnurbs/internals/dataTransform.h | 8 +- .../win32/glu32/libnurbs/internals/defines.h | 2 +- .../glu32/libnurbs/internals/displaylist.h | 2 +- .../glu32/libnurbs/internals/displaymode.h | 8 +- .../glu32/libnurbs/internals/flistsorter.h | 6 +- .../glu32/libnurbs/internals/gridtrimvertex.h | 2 +- .../dll/win32/glu32/libnurbs/internals/hull.h | 2 +- .../win32/glu32/libnurbs/internals/jarcloc.h | 2 +- .../glu32/libnurbs/internals/knotvector.h | 2 +- .../win32/glu32/libnurbs/internals/mapdesc.h | 58 +- .../win32/glu32/libnurbs/internals/maplist.h | 2 +- .../glu32/libnurbs/internals/monotonizer.h | 2 +- .../win32/glu32/libnurbs/internals/mymath.h | 2 +- .../win32/glu32/libnurbs/internals/mysetjmp.h | 2 +- .../glu32/libnurbs/internals/nurbsconsts.h | 10 +- .../glu32/libnurbs/internals/nurbstess.h | 2 +- .../win32/glu32/libnurbs/internals/patch.h | 6 +- .../glu32/libnurbs/internals/patchlist.h | 6 +- .../win32/glu32/libnurbs/internals/quilt.h | 6 +- .../win32/glu32/libnurbs/internals/reader.h | 10 +- .../glu32/libnurbs/internals/simplemath.h | 6 +- .../win32/glu32/libnurbs/internals/sorter.h | 14 +- .../glu32/libnurbs/internals/subdivider.h | 4 +- .../win32/glu32/libnurbs/internals/trimline.h | 38 +- .../glu32/libnurbs/internals/trimregion.h | 2 +- .../glu32/libnurbs/internals/trimvertex.h | 10 +- .../win32/glu32/libnurbs/internals/uarray.h | 2 +- .../win32/glu32/libnurbs/internals/varray.h | 4 +- .../glu32/libnurbs/nurbtess/definitions.h | 8 +- .../glu32/libnurbs/nurbtess/directedLine.h | 32 +- .../win32/glu32/libnurbs/nurbtess/gridWrap.h | 22 +- .../win32/glu32/libnurbs/nurbtess/monoChain.h | 24 +- .../glu32/libnurbs/nurbtess/monoPolyPart.h | 10 +- .../libnurbs/nurbtess/monoTriangulation.h | 52 +- .../glu32/libnurbs/nurbtess/partitionX.h | 8 +- .../glu32/libnurbs/nurbtess/partitionY.h | 24 +- .../win32/glu32/libnurbs/nurbtess/polyDBG.h | 10 +- .../win32/glu32/libnurbs/nurbtess/polyUtil.h | 8 +- .../glu32/libnurbs/nurbtess/primitiveStream.h | 24 +- .../win32/glu32/libnurbs/nurbtess/quicksort.h | 8 +- .../win32/glu32/libnurbs/nurbtess/rectBlock.h | 12 +- .../glu32/libnurbs/nurbtess/sampleComp.h | 12 +- .../glu32/libnurbs/nurbtess/sampleCompBot.h | 16 +- .../glu32/libnurbs/nurbtess/sampleCompRight.h | 14 +- .../glu32/libnurbs/nurbtess/sampleCompTop.h | 8 +- .../glu32/libnurbs/nurbtess/sampleMonoPoly.h | 42 +- .../glu32/libnurbs/nurbtess/sampledLine.h | 10 +- .../glu32/libnurbs/nurbtess/searchTree.h | 12 +- .../win32/glu32/libnurbs/nurbtess/zlassert.h | 8 +- reactos/dll/win32/glu32/libtess/dict-list.h | 10 +- reactos/dll/win32/glu32/libtess/dict.c | 8 +- reactos/dll/win32/glu32/libtess/dict.h | 10 +- reactos/dll/win32/glu32/libtess/geom.c | 16 +- reactos/dll/win32/glu32/libtess/memalloc.c | 8 +- reactos/dll/win32/glu32/libtess/memalloc.h | 8 +- reactos/dll/win32/glu32/libtess/mesh.c | 26 +- reactos/dll/win32/glu32/libtess/mesh.h | 10 +- reactos/dll/win32/glu32/libtess/normal.h | 8 +- .../dll/win32/glu32/libtess/priorityq-heap.c | 14 +- .../dll/win32/glu32/libtess/priorityq-heap.h | 10 +- .../dll/win32/glu32/libtess/priorityq-sort.h | 10 +- reactos/dll/win32/glu32/libtess/priorityq.c | 18 +- reactos/dll/win32/glu32/libtess/priorityq.h | 10 +- reactos/dll/win32/glu32/libtess/render.c | 32 +- reactos/dll/win32/glu32/libtess/render.h | 8 +- reactos/dll/win32/glu32/libtess/sweep.h | 8 +- reactos/dll/win32/glu32/libtess/tess.c | 2 +- reactos/dll/win32/glu32/libtess/tess.h | 12 +- reactos/dll/win32/glu32/libtess/tessmono.c | 10 +- reactos/dll/win32/glu32/libtess/tessmono.h | 10 +- reactos/dll/win32/glu32/libutil/error.c | 8 +- reactos/dll/win32/glu32/libutil/glue.c | 8 +- reactos/dll/win32/glu32/libutil/gluint.h | 8 +- reactos/dll/win32/glu32/libutil/mipmap.c | 92 +- reactos/dll/win32/glu32/libutil/project.c | 24 +- reactos/dll/win32/glu32/libutil/registry.c | 14 +- reactos/dll/win32/hhctrl.ocx/Ko.rc | 2 +- reactos/dll/win32/hhctrl.ocx/chm.c | 2 +- reactos/dll/win32/hhctrl.ocx/help.c | 4 +- reactos/dll/win32/hid/hid.c | 24 +- reactos/dll/win32/hid/stubs.c | 2 +- reactos/dll/win32/imagehlp/access.c | 42 +- reactos/dll/win32/imagehlp/integrity.c | 6 +- reactos/dll/win32/imm32/imm.c | 2 +- reactos/dll/win32/iphlpapi/ifenum.h | 2 +- reactos/dll/win32/iphlpapi/ifenum_reactos.c | 148 +- reactos/dll/win32/iphlpapi/iphlpapi_main.c | 12 +- reactos/dll/win32/iphlpapi/iphlpapi_private.h | 14 +- reactos/dll/win32/iphlpapi/ipstats_reactos.c | 38 +- reactos/dll/win32/iphlpapi/registry.c | 40 +- reactos/dll/win32/iphlpapi/resinfo.c | 2 +- reactos/dll/win32/iphlpapi/resinfo.h | 2 +- reactos/dll/win32/iphlpapi/resinfo_reactos.c | 36 +- reactos/dll/win32/iphlpapi/route.c | 4 +- reactos/dll/win32/iphlpapi/route_reactos.c | 14 +- reactos/dll/win32/kernel32/debug/debugger.c | 2 +- reactos/dll/win32/kernel32/file/dir.c | 14 +- reactos/dll/win32/kernel32/file/file.c | 16 +- reactos/dll/win32/kernel32/file/npipe.c | 8 +- reactos/dll/win32/kernel32/misc/actctx.c | 8 +- reactos/dll/win32/kernel32/misc/errormsg.c | 2 +- reactos/dll/win32/kernel32/misc/lcformat.c | 2 +- reactos/dll/win32/kernel32/misc/nls.c | 6 +- reactos/dll/win32/mapi32/sendmail.c | 4 +- reactos/dll/win32/mapi32/util.c | 2 +- reactos/dll/win32/mlang/mlang.c | 16 +- reactos/dll/win32/mmdrv/common.c | 516 +- reactos/dll/win32/mmdrv/kernel.c | 412 +- reactos/dll/win32/mmdrv/mme.c | 286 +- reactos/dll/win32/mmdrv/mmioctl.h | 294 +- reactos/dll/win32/mmdrv/session.c | 490 +- reactos/dll/win32/mmdrv/wave_io.c | 80 +- reactos/dll/win32/mpr/nps.c | 4 +- reactos/dll/win32/mpr/pwcache.c | 8 +- reactos/dll/win32/mpr/wnet.c | 4 +- reactos/dll/win32/msacm32/format.c | 6 +- reactos/dll/win32/msacm32/internal.c | 2 +- reactos/dll/win32/msi/action.c | 298 +- reactos/dll/win32/msi/classes.c | 86 +- reactos/dll/win32/msi/cond.tab.c | 26 +- reactos/dll/win32/msi/create.c | 2 +- reactos/dll/win32/msi/custom.c | 40 +- reactos/dll/win32/msi/database.c | 8 +- reactos/dll/win32/msi/delete.c | 2 +- reactos/dll/win32/msi/dialog.c | 26 +- reactos/dll/win32/msi/distinct.c | 2 +- reactos/dll/win32/msi/events.c | 22 +- reactos/dll/win32/msi/files.c | 14 +- reactos/dll/win32/msi/format.c | 54 +- reactos/dll/win32/msi/handle.c | 4 +- reactos/dll/win32/msi/helpers.c | 48 +- reactos/dll/win32/msi/install.c | 38 +- reactos/dll/win32/msi/order.c | 4 +- reactos/dll/win32/msi/package.c | 58 +- reactos/dll/win32/msi/record.c | 8 +- reactos/dll/win32/msi/registry.c | 10 +- reactos/dll/win32/msi/regsvr.c | 36 +- reactos/dll/win32/msi/select.c | 4 +- reactos/dll/win32/msi/source.c | 48 +- reactos/dll/win32/msi/string.c | 10 +- reactos/dll/win32/msi/suminfo.c | 24 +- reactos/dll/win32/msi/table.c | 30 +- reactos/dll/win32/msi/tokenize.c | 2 +- reactos/dll/win32/msi/upgrade.c | 18 +- reactos/dll/win32/msi/where.c | 6 +- reactos/dll/win32/msvcrt/dllmain.c | 2 +- reactos/dll/win32/msvfw32/drawdib.c | 66 +- reactos/dll/win32/netapi32/access.c | 14 +- reactos/dll/win32/netapi32/apibuf.c | 6 +- reactos/dll/win32/netapi32/ds.c | 2 +- reactos/dll/win32/netapi32/wksta.c | 8 +- reactos/dll/win32/netid/lang/pl-PL.rc | 8 +- reactos/dll/win32/newdev/lang/bg-BG.rc | 14 +- reactos/dll/win32/newdev/lang/de-DE.rc | 14 +- reactos/dll/win32/newdev/lang/en-US.rc | 14 +- reactos/dll/win32/newdev/lang/es-ES.rc | 14 +- reactos/dll/win32/newdev/lang/fr-FR.rc | 14 +- reactos/dll/win32/newdev/lang/hu-HU.rc | 12 +- reactos/dll/win32/newdev/lang/id-ID.rc | 14 +- reactos/dll/win32/newdev/lang/it-IT.rc | 16 +- reactos/dll/win32/newdev/lang/ru-RU.rc | 14 +- reactos/dll/win32/newdev/lang/th-TH.rc | 14 +- reactos/dll/win32/newdev/lang/uk-UA.rc | 14 +- reactos/dll/win32/objsel/factory.c | 12 +- reactos/dll/win32/objsel/objsel.c | 2 +- reactos/dll/win32/objsel/regsvr.c | 4 +- reactos/dll/win32/odbc32/proxyodbc.c | 4 +- reactos/dll/win32/odbccp32/odbccp32.c | 2 +- reactos/dll/win32/ole32/bindctx.c | 6 +- reactos/dll/win32/ole32/classmoniker.c | 2 +- reactos/dll/win32/ole32/compobj.c | 12 +- reactos/dll/win32/ole32/compobj_private.h | 4 +- reactos/dll/win32/ole32/compositemoniker.c | 4 +- reactos/dll/win32/ole32/dcom.idl | 4 +- reactos/dll/win32/ole32/defaulthandler.c | 2 +- reactos/dll/win32/ole32/errorinfo.c | 8 +- reactos/dll/win32/ole32/filemoniker.c | 24 +- reactos/dll/win32/ole32/git.c | 22 +- reactos/dll/win32/ole32/ifs.c | 4 +- reactos/dll/win32/ole32/itemmoniker.c | 2 +- reactos/dll/win32/ole32/marshal.c | 22 +- reactos/dll/win32/ole32/memlockbytes.c | 4 +- reactos/dll/win32/ole32/memlockbytes16.c | 2 +- reactos/dll/win32/ole32/ole16.c | 4 +- reactos/dll/win32/ole32/ole2.c | 6 +- reactos/dll/win32/ole32/ole2_16.c | 2 +- reactos/dll/win32/ole32/oleobj.c | 8 +- reactos/dll/win32/ole32/oleproxy.c | 2 +- reactos/dll/win32/ole32/rpc.c | 24 +- reactos/dll/win32/ole32/stg_prop.c | 2 +- reactos/dll/win32/ole32/stg_stream.c | 2 +- reactos/dll/win32/ole32/storage.c | 88 +- reactos/dll/win32/ole32/storage32.c | 32 +- reactos/dll/win32/ole32/stubmanager.c | 22 +- reactos/dll/win32/ole32/usrmarshal.c | 10 +- reactos/dll/win32/oleaut32/oaidl_p.c | 4678 ++--- reactos/dll/win32/oleaut32/oleaut32_Ko.rc | 2 +- reactos/dll/win32/oleaut32/oleaut32_Pl.rc | 2 +- reactos/dll/win32/oleaut32/olefont.c | 6 +- reactos/dll/win32/oleaut32/olepicture.c | 46 +- reactos/dll/win32/oleaut32/recinfo.c | 22 +- reactos/dll/win32/oleaut32/safearray.c | 42 +- reactos/dll/win32/oleaut32/tmarshal.c | 40 +- reactos/dll/win32/oleaut32/typelib.c | 22 +- reactos/dll/win32/oleaut32/typelib2.c | 14 +- reactos/dll/win32/oleaut32/usrmarshal.c | 40 +- reactos/dll/win32/oleaut32/varformat.c | 2 +- reactos/dll/win32/oleaut32/variant.c | 8 +- reactos/dll/win32/oleaut32/vartype.c | 54 +- reactos/dll/win32/oledlg/insobjdlg.c | 8 +- reactos/dll/win32/oledlg/oledlg_Cs.rc | 4 +- reactos/dll/win32/oledlg/oledlg_De.rc | 4 +- reactos/dll/win32/oledlg/oledlg_En.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Es.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Fr.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Hu.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Ja.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Ko.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Nl.rc | 4 +- reactos/dll/win32/oledlg/oledlg_No.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Pl.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Pt.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Tr.rc | 4 +- reactos/dll/win32/oledlg/oledlg_Uk.rc | 4 +- reactos/dll/win32/opengl32/gl.c | 2 +- reactos/dll/win32/opengl32/opengl32.c | 6 +- reactos/dll/win32/packet/Packet32.c | 522 +- reactos/dll/win32/packet/include/packet32.h | 64 +- reactos/dll/win32/packet/resource.h | 2 +- reactos/dll/win32/packet/trace.c | 2 +- reactos/dll/win32/psapi/malloc.c | 4 +- reactos/dll/win32/psapi/psapi.c | 22 +- reactos/dll/win32/riched20/caret.c | 156 +- reactos/dll/win32/riched20/context.c | 2 +- reactos/dll/win32/riched20/editor.c | 234 +- reactos/dll/win32/riched20/editor.h | 6 +- reactos/dll/win32/riched20/editstr.h | 12 +- reactos/dll/win32/riched20/list.c | 8 +- reactos/dll/win32/riched20/paint.c | 106 +- reactos/dll/win32/riched20/para.c | 100 +- reactos/dll/win32/riched20/reader.c | 8 +- reactos/dll/win32/riched20/richole.c | 4 +- reactos/dll/win32/riched20/row.c | 14 +- reactos/dll/win32/riched20/rtf.h | 2 +- reactos/dll/win32/riched20/run.c | 188 +- reactos/dll/win32/riched20/string.c | 36 +- reactos/dll/win32/riched20/style.c | 30 +- reactos/dll/win32/riched20/undo.c | 38 +- reactos/dll/win32/riched20/wrap.c | 12 +- reactos/dll/win32/riched20/writer.c | 74 +- reactos/dll/win32/rpcrt4/cproxy.c | 4 +- reactos/dll/win32/rpcrt4/rpc_binding.c | 46 +- reactos/dll/win32/rpcrt4/rpc_defs.h | 2 +- reactos/dll/win32/rpcrt4/rpc_epmap.c | 4 +- reactos/dll/win32/rpcrt4/rpc_message.c | 8 +- reactos/dll/win32/rpcrt4/rpc_server.c | 24 +- reactos/dll/win32/rpcrt4/rpcrt4_main.c | 36 +- reactos/dll/win32/rpcrt4/rpcss_np_client.c | 16 +- reactos/dll/win32/rpcrt4_new/cproxy.c | 900 +- reactos/dll/win32/rpcrt4_new/cpsf.c | 614 +- reactos/dll/win32/rpcrt4_new/cpsf.h | 112 +- reactos/dll/win32/rpcrt4_new/cstub.c | 1174 +- reactos/dll/win32/rpcrt4_new/epm_towers.h | 176 +- reactos/dll/win32/rpcrt4_new/rpc_binding.c | 3172 ++-- reactos/dll/win32/rpcrt4_new/rpc_binding.h | 404 +- reactos/dll/win32/rpcrt4_new/rpc_defs.h | 424 +- reactos/dll/win32/rpcrt4_new/rpc_epmap.c | 768 +- reactos/dll/win32/rpcrt4_new/rpc_message.c | 2292 +-- reactos/dll/win32/rpcrt4_new/rpc_message.h | 80 +- reactos/dll/win32/rpcrt4_new/rpc_misc.h | 56 +- reactos/dll/win32/rpcrt4_new/rpc_server.c | 2232 +-- reactos/dll/win32/rpcrt4_new/rpc_server.h | 162 +- reactos/dll/win32/rpcrt4_new/rpc_transport.c | 3674 ++-- reactos/dll/win32/rpcrt4_new/rpcrt4_main.c | 1660 +- .../dll/win32/rpcrt4_new/rpcss_np_client.c | 304 +- .../dll/win32/rpcrt4_new/rpcss_np_client.h | 52 +- reactos/dll/win32/rpcrt4_new/unix_func.c | 2 +- reactos/dll/win32/rpcrt4_new/unix_func.h | 24 +- reactos/dll/win32/secur32/dllmain.c | 2 +- reactos/dll/win32/secur32/lsa.c | 76 +- reactos/dll/win32/secur32/sspi.c | 6 +- reactos/dll/win32/serialui/lang/pl-PL.rc | 2 +- reactos/dll/win32/serialui/serialui.c | 2 +- reactos/dll/win32/serialui/serialui.def | 2 +- reactos/dll/win32/setupapi/dirid.c | 2 +- reactos/dll/win32/setupapi/diskspace.c | 16 +- reactos/dll/win32/setupapi/driver.c | 12 +- reactos/dll/win32/setupapi/query.c | 4 +- reactos/dll/win32/setupapi/queue.c | 8 +- reactos/dll/win32/setupapi/res/lang/Cs.rc | 2 +- reactos/dll/win32/setupapi/setupapi_private.h | 2 +- reactos/dll/win32/shdocvw/factory.c | 2 +- reactos/dll/win32/shdocvw/shdocvw.h | 2 +- reactos/dll/win32/shdocvw/shdocvw_main.c | 10 +- reactos/dll/win32/shdocvw/shlinstobj.c | 52 +- reactos/dll/win32/shdocvw/webbrowser.c | 4 +- reactos/dll/win32/shell32/autocomplete.c | 92 +- reactos/dll/win32/shell32/brsfolder.c | 52 +- reactos/dll/win32/shell32/changenotify.c | 12 +- reactos/dll/win32/shell32/classes.c | 34 +- reactos/dll/win32/shell32/dde.c | 2 +- reactos/dll/win32/shell32/dialogs.c | 18 +- reactos/dll/win32/shell32/drive.c | 26 +- reactos/dll/win32/shell32/enumidlist.c | 2 +- reactos/dll/win32/shell32/folders.c | 6 +- reactos/dll/win32/shell32/fprop.c | 70 +- reactos/dll/win32/shell32/iconcache.c | 20 +- reactos/dll/win32/shell32/pidl.c | 10 +- reactos/dll/win32/shell32/pidl.h | 10 +- reactos/dll/win32/shell32/recyclebin.c | 28 +- reactos/dll/win32/shell32/regsvr.c | 26 +- reactos/dll/win32/shell32/shell32_De.rc | 2 +- reactos/dll/win32/shell32/shell32_En.rc | 2 +- reactos/dll/win32/shell32/shell32_main.c | 18 +- reactos/dll/win32/shell32/shelllink.c | 32 +- reactos/dll/win32/shell32/shellole.c | 8 +- reactos/dll/win32/shell32/shellord.c | 12 +- reactos/dll/win32/shell32/shellpath.c | 34 +- reactos/dll/win32/shell32/shellstring.c | 2 +- reactos/dll/win32/shell32/shfldr_desktop.c | 12 +- reactos/dll/win32/shell32/shfldr_fs.c | 24 +- reactos/dll/win32/shell32/shfldr_mycomp.c | 14 +- reactos/dll/win32/shell32/shfldr_printers.c | 6 +- reactos/dll/win32/shell32/shlexec.c | 6 +- reactos/dll/win32/shell32/shlfileop.c | 10 +- reactos/dll/win32/shell32/shlfolder.c | 14 +- reactos/dll/win32/shell32/shlfsbind.c | 4 +- reactos/dll/win32/shell32/shlview.c | 20 +- reactos/dll/win32/shell32/shres.rc | 2 +- reactos/dll/win32/shell32/shresdef.h | 4 +- reactos/dll/win32/shell32/shv_item_cmenu.c | 2 +- reactos/dll/win32/shell32/systray.c | 2 +- .../dll/win32/shellext/devcpux/processor.c | 4 +- .../dll/win32/shellext/slayer/lang/de-DE.rc | 2 +- .../dll/win32/shellext/slayer/lang/en-US.rc | 2 +- .../dll/win32/shellext/slayer/lang/es-ES.rc | 2 +- .../dll/win32/shellext/slayer/lang/fr-FR.rc | 2 +- .../dll/win32/shellext/slayer/lang/hu-HU.rc | 2 +- .../dll/win32/shellext/slayer/lang/id-ID.rc | 2 +- .../dll/win32/shellext/slayer/lang/it-IT.rc | 2 +- .../dll/win32/shellext/slayer/lang/nl-NL.rc | 2 +- .../dll/win32/shellext/slayer/lang/pl-PL.rc | 2 +- .../dll/win32/shellext/slayer/lang/ru-RU.rc | 2 +- .../dll/win32/shellext/slayer/lang/sk-SK.rc | 2 +- .../dll/win32/shellext/slayer/lang/sv-SE.rc | 2 +- .../dll/win32/shellext/slayer/lang/uk-UA.rc | 2 +- reactos/dll/win32/shellext/slayer/slayer.c | 12 +- reactos/dll/win32/shlwapi/assoc.c | 6 +- reactos/dll/win32/shlwapi/istream.c | 8 +- reactos/dll/win32/shlwapi/ordinal.c | 14 +- reactos/dll/win32/shlwapi/path.c | 2 +- reactos/dll/win32/shlwapi/reg.c | 6 +- reactos/dll/win32/shlwapi/regstream.c | 2 +- reactos/dll/win32/shlwapi/string.c | 12 +- reactos/dll/win32/shlwapi/url.c | 8 +- reactos/dll/win32/smdll/query.c | 4 +- reactos/dll/win32/snmpapi/snmpapi.c | 2 +- reactos/dll/win32/syssetup/lang/cs-CZ.rc | 6 +- reactos/dll/win32/syssetup/lang/de-DE.rc | 4 +- reactos/dll/win32/syssetup/lang/el-GR.rc | 4 +- reactos/dll/win32/syssetup/lang/en-US.rc | 4 +- reactos/dll/win32/syssetup/lang/es-ES.rc | 6 +- reactos/dll/win32/syssetup/lang/fr-FR.rc | 4 +- reactos/dll/win32/syssetup/lang/hu-HU.rc | 6 +- reactos/dll/win32/syssetup/lang/id-ID.rc | 4 +- reactos/dll/win32/syssetup/lang/it-IT.rc | 4 +- reactos/dll/win32/syssetup/lang/ja-JP.rc | 4 +- reactos/dll/win32/syssetup/lang/nl-NL.rc | 4 +- reactos/dll/win32/syssetup/lang/pl-PL.rc | 4 +- reactos/dll/win32/syssetup/lang/ru-RU.rc | 4 +- reactos/dll/win32/syssetup/lang/uk-UA.rc | 4 +- reactos/dll/win32/syssetup/lang/zh-CN.rc | 4 +- reactos/dll/win32/syssetup/wizard.c | 48 +- reactos/dll/win32/urlmon/binding.c | 2 +- reactos/dll/win32/urlmon/file.c | 4 +- reactos/dll/win32/urlmon/ftp.c | 2 +- reactos/dll/win32/urlmon/http.c | 2 +- reactos/dll/win32/urlmon/internet.c | 4 +- reactos/dll/win32/urlmon/sec_mgr.c | 6 +- reactos/dll/win32/urlmon/session.c | 4 +- reactos/dll/win32/urlmon/umon.c | 62 +- reactos/dll/win32/urlmon/umstream.c | 2 +- reactos/dll/win32/urlmon/urlmon_main.c | 14 +- reactos/dll/win32/urlmon/urlmon_main.h | 2 +- reactos/dll/win32/user32/De.rc | 2 +- reactos/dll/win32/user32/Fr.rc | 2 +- reactos/dll/win32/user32/Sv.rc | 2 +- reactos/dll/win32/user32/controls/button.c | 14 +- reactos/dll/win32/user32/controls/combo.c | 6 +- reactos/dll/win32/user32/controls/edit.c | 62 +- reactos/dll/win32/user32/controls/listbox.c | 2 +- reactos/dll/win32/user32/controls/scrollbar.c | 2 +- reactos/dll/win32/user32/controls/static.c | 14 +- reactos/dll/win32/user32/include/user32p.h | 2 +- reactos/dll/win32/user32/misc/desktop.c | 8 +- reactos/dll/win32/user32/misc/display.c | 4 +- reactos/dll/win32/user32/misc/dllmain.c | 2 +- reactos/dll/win32/user32/misc/misc.c | 2 +- reactos/dll/win32/user32/misc/resources.c | 8 +- reactos/dll/win32/user32/windows/class.c | 2 +- reactos/dll/win32/user32/windows/clipboard.c | 58 +- reactos/dll/win32/user32/windows/dc.c | 2 +- reactos/dll/win32/user32/windows/defwnd.c | 52 +- reactos/dll/win32/user32/windows/dialog.c | 10 +- reactos/dll/win32/user32/windows/draw.c | 4 +- reactos/dll/win32/user32/windows/font.c | 6 +- reactos/dll/win32/user32/windows/hook.c | 8 +- reactos/dll/win32/user32/windows/input.c | 8 +- reactos/dll/win32/user32/windows/mdi.c | 6 +- reactos/dll/win32/user32/windows/menu.c | 86 +- reactos/dll/win32/user32/windows/window.c | 8 +- reactos/dll/win32/usp10/usp10.c | 32 +- reactos/dll/win32/uxtheme/draw.c | 164 +- reactos/dll/win32/uxtheme/system.c | 96 +- reactos/dll/win32/vdmdbg/vdmdbg.c | 22 +- reactos/dll/win32/vdmdbg/vdmdbg.def | 8 +- reactos/dll/win32/vdmdbg/vdmdbg.h | 4 +- reactos/dll/win32/version/info.c | 4 +- reactos/dll/win32/wininet/cookie.c | 10 +- reactos/dll/win32/wininet/dialogs.c | 18 +- reactos/dll/win32/wininet/ftp.c | 64 +- reactos/dll/win32/wininet/gopher.c | 4 +- reactos/dll/win32/wininet/http.c | 66 +- reactos/dll/win32/wininet/internet.c | 66 +- reactos/dll/win32/wininet/internet.h | 4 +- reactos/dll/win32/wininet/urlcache.c | 66 +- reactos/dll/win32/wininet/utility.c | 10 +- reactos/dll/win32/wininet/wininet_Bg.rc | 2 +- reactos/dll/win32/winmm/driver.c | 10 +- reactos/dll/win32/winmm/lolvldrv.c | 14 +- reactos/dll/win32/winmm/mci.c | 28 +- reactos/dll/win32/winmm/message16.c | 8 +- reactos/dll/win32/winmm/midimap/midimap.c | 2 +- reactos/dll/win32/winmm/mmio.c | 34 +- reactos/dll/win32/winmm/mmsystem.c | 32 +- reactos/dll/win32/winmm/registry.c | 268 +- reactos/dll/win32/winmm/time.c | 16 +- reactos/dll/win32/winmm/winemm.h | 4 +- reactos/dll/win32/winmm/winmm.c | 14 +- reactos/dll/win32/winmm/winmm.rbuild | 2 +- reactos/dll/win32/winmm/winmm_Cs.rc | 2 +- reactos/dll/win32/wintrust/crypt.c | 10 +- reactos/dll/win32/wintrust/register.c | 10 +- reactos/dll/win32/wintrust/wintrust_main.c | 4 +- reactos/dll/win32/wldap32/add.c | 2 +- reactos/dll/win32/wldap32/ber.c | 4 +- reactos/dll/win32/wldap32/bind.c | 6 +- reactos/dll/win32/wldap32/control.c | 2 +- reactos/dll/win32/wldap32/delete.c | 2 +- reactos/dll/win32/wldap32/dn.c | 6 +- reactos/dll/win32/wldap32/init.c | 24 +- reactos/dll/win32/wldap32/misc.c | 8 +- reactos/dll/win32/wldap32/option.c | 2 +- reactos/dll/win32/wldap32/page.c | 8 +- reactos/dll/win32/wldap32/parse.c | 10 +- reactos/dll/win32/wldap32/rename.c | 2 +- reactos/dll/win32/wldap32/value.c | 4 +- reactos/dll/win32/wldap32/wldap32.h | 16 +- reactos/dll/win32/wldap32/wldap32_Ko.rc | 2 +- reactos/dll/win32/ws2_32/misc/async.c | 1412 +- reactos/dll/win32/ws2_32/misc/dllmain.c | 4 +- reactos/dll/win32/ws2_32/misc/ns.c | 4 +- .../win32/ws2_32/tests/tests/WinsockEvent.c | 4 +- reactos/drivers/base/kdcom/kdcom.rbuild | 22 +- reactos/drivers/bus/acpi/ospm/osl.c | 14 +- reactos/drivers/bus/isapnp/isapnp.h | 2 +- reactos/drivers/bus/pci/pci.c | 6 +- reactos/drivers/bus/pci/pci.h | 2 +- reactos/drivers/filesystems/cdfs/cleanup.c | 2 +- reactos/drivers/filesystems/npfs_new/create.c | 2 +- reactos/drivers/filesystems/npfs_new/finfo.c | 2 +- reactos/drivers/filesystems/npfs_new/fsctrl.c | 2 +- reactos/drivers/filesystems/npfs_new/npfs.c | 2 +- reactos/drivers/filesystems/npfs_new/rw.c | 2 +- reactos/drivers/filesystems/npfs_new/volume.c | 2 +- reactos/drivers/filesystems/ntfs/mft.c | 2 +- reactos/drivers/filesystems/vfat/create.c | 6 +- reactos/drivers/filesystems/vfat/fastio.c | 24 +- reactos/drivers/filesystems/vfat/fcb.c | 124 +- reactos/drivers/filesystems/vfat/flush.c | 2 +- reactos/drivers/filesystems/vfat/misc.c | 2 +- reactos/drivers/input/kbdclass/kbdclass.c | 4 +- reactos/drivers/input/kbdclass/misc.c | 20 +- reactos/drivers/input/mouclass/misc.c | 20 +- reactos/drivers/ksfilter/ks/kcom.c | 102 +- .../drivers/multimedia/audio/sb16_nt4/main.c | 2 +- reactos/drivers/network/afd/afd/lock.c | 2 +- reactos/drivers/network/afd/afd/select.c | 22 +- reactos/drivers/network/ndis/ndis/buffer.c | 10 +- reactos/drivers/network/ndis/ndis/config.c | 22 +- reactos/drivers/network/ndis/ndis/control.c | 2 +- reactos/drivers/network/ndis/ndis/miniport.c | 46 +- reactos/drivers/network/ndis/ndis/protocol.c | 4 +- reactos/drivers/network/tcpip/datalink/lan.c | 18 +- reactos/drivers/network/tcpip/include/tcpip.h | 6 +- .../drivers/network/tcpip/recmutex/recmutex.c | 8 +- .../drivers/network/tcpip/recmutex/recmutex.h | 2 +- .../drivers/network/tcpip/tcpip/dispatch.c | 8 +- reactos/drivers/network/tcpip/tcpip/iinfo.c | 4 +- reactos/drivers/network/tcpip/tcpip/info.c | 2 +- reactos/drivers/network/wshtcpip/wshtcpip.c | 34 +- reactos/drivers/serial/serenum/misc.c | 2 +- reactos/drivers/serial/serial/devctrl.c | 4 +- reactos/drivers/setup/blue/blue.c | 2 +- .../drivers/storage/class/include/class2.h | 14 +- .../drivers/storage/ide/pciidex/miniport.c | 2 +- reactos/drivers/storage/ide/pciidex/misc.c | 2 +- reactos/drivers/storage/ide/uniata/atapi.h | 42 +- reactos/drivers/storage/ide/uniata/bm_devs.h | 36 +- reactos/drivers/storage/ide/uniata/bsmaster.h | 4 +- reactos/drivers/storage/ide/uniata/id_ata.cpp | 260 +- .../storage/ide/uniata/id_badblock.cpp | 10 +- reactos/drivers/storage/ide/uniata/id_dma.cpp | 94 +- .../drivers/storage/ide/uniata/id_init.cpp | 80 +- .../drivers/storage/ide/uniata/id_probe.cpp | 116 +- .../drivers/storage/ide/uniata/id_sata.cpp | 2 +- .../drivers/storage/ide/uniata/inc/CrossNt.h | 2 +- reactos/drivers/storage/ide/uniata/scsi.h | 50 +- reactos/drivers/storage/ide/uniata/srb.h | 22 +- .../drivers/storage/ide/uniata/uniata.rbuild | 6 +- .../drivers/storage/port/buslogic/BT958dt.h | 30 +- .../storage/port/buslogic/BusLogic958.c | 816 +- .../storage/port/buslogic/BusLogic958.h | 222 +- reactos/drivers/storage/port/buslogic/Log.c | 16 +- .../drivers/storage/port/buslogic/resource.h | 2 +- reactos/drivers/storage/port/buslogic/wmi.c | 106 +- .../drivers/storage/port/diskdump/diskdump.c | 2 +- reactos/drivers/storage/scsiport/scsiport.c | 12 +- .../drivers/storage/scsiport/scsiport.rbuild | 26 +- .../drivers/usb/nt4compat/usbdriver/debug.h | 14 +- .../drivers/usb/nt4compat/usbdriver/devmgr.h | 16 +- .../usb/nt4compat/usbdriver/dmgrdisp.c | 16 +- .../drivers/usb/nt4compat/usbdriver/ehci.c | 46 +- .../drivers/usb/nt4compat/usbdriver/ehci.h | 22 +- .../drivers/usb/nt4compat/usbdriver/events.h | 6 +- .../drivers/usb/nt4compat/usbdriver/gendrv.c | 18 +- reactos/drivers/usb/nt4compat/usbdriver/hcd.h | 8 +- reactos/drivers/usb/nt4compat/usbdriver/hub.c | 4 +- reactos/drivers/usb/nt4compat/usbdriver/hub.h | 8 +- .../drivers/usb/nt4compat/usbdriver/irplist.h | 2 +- .../drivers/usb/nt4compat/usbdriver/ohci.c | 4 +- .../drivers/usb/nt4compat/usbdriver/ohci.h | 2 +- reactos/drivers/usb/nt4compat/usbdriver/td.c | 4 +- reactos/drivers/usb/nt4compat/usbdriver/td.h | 28 +- .../drivers/usb/nt4compat/usbdriver/uhci.c | 24 +- .../drivers/usb/nt4compat/usbdriver/umss.c | 2 +- .../drivers/usb/nt4compat/usbdriver/umss.h | 8 +- reactos/drivers/usb/nt4compat/usbdriver/usb.h | 60 +- reactos/drivers/usb/usbd/test.c | 6 +- reactos/drivers/usb/usbd/usbd.c | 14 +- reactos/drivers/usb/usbhub/createclose.c | 6 +- reactos/drivers/usb/usbhub/fdo.c | 36 +- reactos/drivers/usb/usbhub/pdo.c | 30 +- reactos/drivers/usb/usbhub/usbhub.c | 32 +- reactos/drivers/usb/usbhub/usbhub.h | 2 +- reactos/drivers/usb/usbstor/usbstor.h | 2 +- reactos/drivers/video/displays/framebuf/dd.c | 48 +- .../video/displays/framebuf/ddenable.c | 104 +- .../drivers/video/displays/framebuf/enable.c | 2 +- .../video/displays/framebuf/framebuf.h | 10 +- reactos/drivers/video/miniport/vbe/vbemp.c | 6 +- reactos/drivers/video/videoprt/agp.c | 14 +- reactos/drivers/video/videoprt/dma.c | 2 +- reactos/drivers/video/videoprt/resource.c | 8 +- reactos/drivers/video/videoprt/videoprt.c | 2 +- .../audio/backpln/portcls/MiniportDMus.cpp | 2 +- .../backpln/portcls/MiniportTopology.cpp | 2 +- .../backpln/portcls/MiniportWaveCyclic.cpp | 2 +- .../audio/backpln/portcls/MiniportWavePci.cpp | 2 +- .../wdm/audio/backpln/portcls/PortDMus.cpp | 2 +- .../backpln/portcls/miniport_factory.cpp | 2 +- .../wdm/audio/drivers/sb16/adapter.cpp | 20 +- .../drivers/wdm/audio/legacy/wdmaud/entry.c | 2 +- reactos/hal/hal/hal.c | 6 +- reactos/hal/halppc/generic/display.c | 32 +- reactos/hal/halppc/generic/dma.c | 42 +- reactos/hal/halppc/generic/irql.c | 42 +- reactos/hal/halppc/generic/isa.c | 2 +- reactos/hal/halppc/generic/processor.c | 2 +- reactos/hal/halppc/generic/profil.c | 2 +- reactos/hal/halppc/generic/pwroff.c | 8 +- reactos/hal/halppc/include/apic.h | 2 +- reactos/hal/halppc/include/haldma.h | 50 +- reactos/hal/halppc/include/halirq.h | 6 +- reactos/hal/halppc/include/halp.h | 4 +- reactos/hal/halppc/include/ioapic.h | 6 +- reactos/hal/halx86/generic/dma.c | 42 +- reactos/hal/halx86/generic/irql.c | 42 +- reactos/hal/halx86/include/apic.h | 2 +- reactos/hal/halx86/include/haldma.h | 50 +- reactos/hal/halx86/include/halirq.h | 6 +- reactos/hal/halx86/include/halp.h | 4 +- reactos/hal/halx86/include/ioapic.h | 6 +- reactos/hal/halx86/mp/spinlock.c | 2 +- reactos/hal/halx86/xbox/display_xbox.c | 8 +- reactos/include/GL/gl.h | 2 +- reactos/include/GL/glext.h | 8 +- reactos/include/GL/glu.h | 8 +- reactos/include/crt/assert.h | 4 +- reactos/include/crt/ctype.h | 16 +- reactos/include/crt/direct.h | 4 +- reactos/include/crt/dos.h | 2 +- reactos/include/crt/errno.h | 2 +- reactos/include/crt/excpt.h | 2 +- reactos/include/crt/float.h | 6 +- reactos/include/crt/inttypes.h | 4 +- reactos/include/crt/io.h | 20 +- reactos/include/crt/limits.h | 4 +- reactos/include/crt/locale.h | 2 +- reactos/include/crt/malloc.h | 8 +- reactos/include/crt/math.h | 50 +- reactos/include/crt/mbctype.h | 8 +- reactos/include/crt/mbstring.h | 4 +- reactos/include/crt/mingw32/stdarg.h | 2 +- reactos/include/crt/mingw32/stddef.h | 2 +- reactos/include/crt/process.h | 4 +- reactos/include/crt/search.h | 4 +- reactos/include/crt/setjmp.h | 2 +- reactos/include/crt/signal.h | 2 +- reactos/include/crt/stdint.h | 10 +- reactos/include/crt/stdio.h | 4 +- reactos/include/crt/stdlib.h | 16 +- reactos/include/crt/strings.h | 2 +- reactos/include/crt/sys/stat.h | 2 +- reactos/include/crt/sys/time.h | 2 +- reactos/include/crt/sys/timeb.h | 2 +- reactos/include/crt/sys/types.h | 2 +- reactos/include/crt/sys/utime.h | 2 +- reactos/include/crt/time.h | 8 +- reactos/include/crt/wchar.h | 14 +- reactos/include/crt/wctype.h | 4 +- reactos/include/ddk/atsmedia.h | 2 +- reactos/include/ddk/csq.h | 6 +- reactos/include/ddk/d3dhal.h | 2 +- reactos/include/ddk/d3dnthal.h | 26 +- reactos/include/ddk/dderror.h | 28 +- reactos/include/ddk/ddkernel.h | 2 +- reactos/include/ddk/ddrawi.h | 4 +- reactos/include/ddk/ddrawint.h | 88 +- reactos/include/ddk/diskguid.h | 2 +- reactos/include/ddk/dmemmgr.h | 12 +- reactos/include/ddk/drmk.h | 166 +- reactos/include/ddk/dvp.h | 58 +- reactos/include/ddk/dxapi.h | 2 +- reactos/include/ddk/ide.h | 2 +- reactos/include/ddk/ieverp.h | 2 +- reactos/include/ddk/kcom.h | 6 +- reactos/include/ddk/ksdebug.h | 2 +- reactos/include/ddk/lmon.h | 4 +- reactos/include/ddk/ntddbeep.h | 4 +- reactos/include/ddk/ntddft.h | 2 +- reactos/include/ddk/ntddtdi.h | 2 +- reactos/include/ddk/ntnls.h | 6 +- reactos/include/ddk/objerror.h | 2 +- reactos/include/ddk/polarity.h | 6 +- reactos/include/ddk/portcls.h | 94 +- reactos/include/ddk/punknown.h | 160 +- reactos/include/ddk/stdunk.h | 436 +- reactos/include/ddk/usb.h | 6 +- reactos/include/ddk/usb200.h | 2 +- reactos/include/ddk/usbprint.h | 12 +- reactos/include/ddk/wdm.h | 48 +- reactos/include/ddk/winddi.h | 50 +- reactos/include/ddk/winddk.h | 2 +- reactos/include/dxsdk/DShow.h | 2 +- reactos/include/dxsdk/PIXPlugin.h | 2 +- reactos/include/dxsdk/amparse.h | 2 +- reactos/include/dxsdk/amvideo.h | 68 +- reactos/include/dxsdk/aviriff.h | 4 +- reactos/include/dxsdk/bdatypes.h | 4 +- reactos/include/dxsdk/d3dx9shape.h | 12 +- reactos/include/dxsdk/d3dx9xof.h | 2 +- reactos/include/dxsdk/ddraw.h | 98 +- reactos/include/dxsdk/dmdls.h | 2 +- reactos/include/dxsdk/dmusics.h | 8 +- reactos/include/dxsdk/dsetup.h | 2 +- reactos/include/dxsdk/dv.h | 2 +- reactos/include/dxsdk/dxdiag.h | 4 +- reactos/include/dxsdk/dxerr9.h | 4 +- reactos/include/dxsdk/dxsdkver.h | 2 +- reactos/include/dxsdk/mmstream.idl | 2 +- reactos/include/dxsdk/regbag.idl | 2 +- reactos/include/dxsdk/tvratings.idl | 20 +- reactos/include/dxsdk/vpconfig.h | 4 +- reactos/include/host/typedefs.h | 2 +- reactos/include/ndk/extypes.h | 6 +- reactos/include/ndk/i386/ketypes.h | 2 +- reactos/include/ndk/ldrfuncs.h | 2 +- reactos/include/ndk/psfuncs.h | 4 +- reactos/include/ndk/pstypes.h | 2 +- reactos/include/psdk/activscp.idl | 20 +- reactos/include/psdk/af_irda.h | 2 +- reactos/include/psdk/cryptuiapi.h | 2 +- reactos/include/psdk/cvconst.h | 16 +- reactos/include/psdk/d3d8types.h | 4 +- reactos/include/psdk/d3d9types.h | 52 +- reactos/include/psdk/d3dx8core.h | 6 +- reactos/include/psdk/dbghelp.h | 52 +- reactos/include/psdk/ddrawgdi.h | 96 +- reactos/include/psdk/dinput.h | 8 +- reactos/include/psdk/dispex.idl | 2 +- reactos/include/psdk/dplay.h | 2 +- reactos/include/psdk/dvdevcod.h | 26 +- reactos/include/psdk/edevdefs.h | 70 +- reactos/include/psdk/hlink.idl | 30 +- reactos/include/psdk/intrin_ppc.h | 18 +- reactos/include/psdk/ks.h | 216 +- reactos/include/psdk/mapidefs.h | 22 +- reactos/include/psdk/mapiutil.h | 32 +- reactos/include/psdk/mlang.idl | 116 +- reactos/include/psdk/mshtmhst.idl | 10 +- reactos/include/psdk/mshtml.idl | 4 +- reactos/include/psdk/msxml.idl | 12 +- reactos/include/psdk/msxml2.idl | 94 +- reactos/include/psdk/ntgdi.h | 80 +- reactos/include/psdk/oaidl.idl | 32 +- reactos/include/psdk/objidl.idl | 2 +- reactos/include/psdk/ocidl.idl | 8 +- reactos/include/psdk/pstore.idl | 6 +- reactos/include/psdk/richedit.h | 2 +- reactos/include/psdk/rpc.h | 10 +- reactos/include/psdk/rpcdce.h | 4 +- reactos/include/psdk/shldisp.idl | 2 +- reactos/include/psdk/shlobj.h | 2 +- reactos/include/psdk/shlwapi.h | 2 +- reactos/include/psdk/shobjidl.idl | 6 +- reactos/include/psdk/stdole2.idl | 12 +- reactos/include/psdk/tchar.h | 552 +- reactos/include/psdk/tcpioctl.h | 2 +- reactos/include/psdk/urlhist.idl | 8 +- reactos/include/psdk/usp10.h | 22 +- reactos/include/psdk/wincrypt.h | 10 +- reactos/include/psdk/wingdi.h | 10 +- reactos/include/psdk/winsock2.h | 2 +- reactos/include/psdk/winternl.h | 52 +- reactos/include/psdk/winuser.h | 4 +- reactos/include/psdk/wtsapi32.h | 2 +- reactos/include/psdk/wtypes.idl | 2 +- reactos/include/psdk/xmldso.idl | 10 +- reactos/include/psdk/xprtdefs.h | 12 +- reactos/include/reactos/config.h | 2 +- reactos/include/reactos/debug.h | 8 +- reactos/include/reactos/dll/directx/d3d8thk.h | 100 +- .../include/reactos/drivers/bootvid/bootvid.h | 2 +- reactos/include/reactos/elf/common.h | 6 +- reactos/include/reactos/elf/reactos.h | 14 +- reactos/include/reactos/helper.h | 8 +- reactos/include/reactos/idl/eventlogrpc.idl | 24 +- .../include/reactos/libs/audiosrv/audiosrv.h | 120 +- reactos/include/reactos/libs/expat/expat.h | 16 +- .../reactos/libs/expat/expat_external.h | 2 +- reactos/include/reactos/resource.h | 2 +- reactos/include/reactos/rossym.h | 2 +- reactos/include/reactos/subsys/csr/server.h | 6 +- reactos/include/reactos/subsys/csrss/csrss.h | 2 +- reactos/include/reactos/subsys/lsass/lsass.h | 4 +- reactos/include/reactos/win32k/ntgdibad.h | 20 +- reactos/include/reactos/win32k/ntgdihdl.h | 142 +- reactos/include/reactos/win32k/ntgdityp.h | 12 +- reactos/include/reactos/win32k/ntuser.h | 36 +- reactos/include/reactos/wine/itss.idl | 190 +- reactos/include/reactos/wine/list.h | 2 +- reactos/include/reactos/wine/rpcss_shared.h | 8 +- reactos/include/reactos/wine/wined3d_gl.h | 16 +- .../include/reactos/wine/wined3d_interface.h | 82 +- reactos/include/reactos/wine/wined3d_types.h | 24 +- reactos/include/reactos/wine/winsock16.h | 220 +- reactos/lib/3rdparty/adns/acconfig.h | 8 +- .../adns/adns_win32/adns_unix_calls.c | 30 +- .../lib/3rdparty/adns/adns_win32/adns_win32.h | 28 +- reactos/lib/3rdparty/adns/adns_win32/getopt.c | 12 +- reactos/lib/3rdparty/adns/client/adh-main.c | 20 +- reactos/lib/3rdparty/adns/client/adh-opts.c | 26 +- reactos/lib/3rdparty/adns/client/adh-query.c | 24 +- reactos/lib/3rdparty/adns/client/adnshost.h | 8 +- reactos/lib/3rdparty/adns/client/adnslogres.c | 8 +- .../lib/3rdparty/adns/client/adnsresfilter.c | 20 +- reactos/lib/3rdparty/adns/client/adnstest.c | 30 +- reactos/lib/3rdparty/adns/client/client.h | 8 +- reactos/lib/3rdparty/adns/client/fanftest.c | 6 +- reactos/lib/3rdparty/adns/src/adns.h | 58 +- reactos/lib/3rdparty/adns/src/check.c | 20 +- reactos/lib/3rdparty/adns/src/dlist.h | 8 +- reactos/lib/3rdparty/adns/src/event.c | 38 +- reactos/lib/3rdparty/adns/src/general.c | 24 +- reactos/lib/3rdparty/adns/src/parse.c | 24 +- reactos/lib/3rdparty/adns/src/poll.c | 12 +- reactos/lib/3rdparty/adns/src/query.c | 42 +- reactos/lib/3rdparty/adns/src/reply.c | 34 +- reactos/lib/3rdparty/adns/src/setup.c | 54 +- reactos/lib/3rdparty/adns/src/transmit.c | 30 +- reactos/lib/3rdparty/adns/src/types.c | 64 +- reactos/lib/3rdparty/expat/lib/xmlparse.c | 84 +- reactos/lib/3rdparty/expat/lib/xmltok.c | 4 +- reactos/lib/3rdparty/libxml2/DOCBparser.c | 12 +- reactos/lib/3rdparty/libxml2/HTMLparser.c | 218 +- reactos/lib/3rdparty/libxml2/HTMLtree.c | 36 +- reactos/lib/3rdparty/libxml2/SAX.c | 2 +- reactos/lib/3rdparty/libxml2/SAX2.c | 94 +- reactos/lib/3rdparty/libxml2/c14n.c | 410 +- reactos/lib/3rdparty/libxml2/catalog.c | 80 +- reactos/lib/3rdparty/libxml2/chvalid.c | 158 +- reactos/lib/3rdparty/libxml2/config.h | 4 +- reactos/lib/3rdparty/libxml2/debugXML.c | 26 +- reactos/lib/3rdparty/libxml2/dict.c | 28 +- reactos/lib/3rdparty/libxml2/encoding.c | 576 +- reactos/lib/3rdparty/libxml2/entities.c | 24 +- reactos/lib/3rdparty/libxml2/error.c | 32 +- reactos/lib/3rdparty/libxml2/globals.c | 20 +- reactos/lib/3rdparty/libxml2/hash.c | 36 +- .../libxml2/include/libxml/DOCBparser.h | 18 +- .../libxml2/include/libxml/HTMLparser.h | 42 +- .../libxml2/include/libxml/HTMLtree.h | 36 +- .../lib/3rdparty/libxml2/include/libxml/SAX.h | 74 +- .../3rdparty/libxml2/include/libxml/SAX2.h | 68 +- .../3rdparty/libxml2/include/libxml/c14n.h | 36 +- .../3rdparty/libxml2/include/libxml/catalog.h | 70 +- .../libxml2/include/libxml/debugXML.h | 48 +- .../3rdparty/libxml2/include/libxml/dict.h | 10 +- .../libxml2/include/libxml/encoding.h | 24 +- .../libxml2/include/libxml/entities.h | 30 +- .../3rdparty/libxml2/include/libxml/globals.h | 6 +- .../3rdparty/libxml2/include/libxml/hash.h | 46 +- .../3rdparty/libxml2/include/libxml/list.h | 52 +- .../3rdparty/libxml2/include/libxml/nanoftp.h | 48 +- .../libxml2/include/libxml/nanohttp.h | 26 +- .../3rdparty/libxml2/include/libxml/parser.h | 132 +- .../libxml2/include/libxml/parserInternals.h | 142 +- .../3rdparty/libxml2/include/libxml/relaxng.h | 36 +- .../libxml2/include/libxml/schemasInternals.h | 4 +- .../3rdparty/libxml2/include/libxml/threads.h | 30 +- .../3rdparty/libxml2/include/libxml/tree.h | 292 +- .../lib/3rdparty/libxml2/include/libxml/uri.h | 26 +- .../3rdparty/libxml2/include/libxml/valid.h | 144 +- .../libxml2/include/libxml/xinclude.h | 8 +- .../3rdparty/libxml2/include/libxml/xlink.h | 14 +- .../3rdparty/libxml2/include/libxml/xmlIO.h | 104 +- .../libxml2/include/libxml/xmlautomata.h | 44 +- .../libxml2/include/libxml/xmlerror.h | 38 +- .../libxml2/include/libxml/xmlmemory.h | 42 +- .../libxml2/include/libxml/xmlmodule.h | 2 +- .../libxml2/include/libxml/xmlreader.h | 132 +- .../libxml2/include/libxml/xmlregexp.h | 18 +- .../libxml2/include/libxml/xmlschemas.h | 24 +- .../libxml2/include/libxml/xmlschemastypes.h | 38 +- .../libxml2/include/libxml/xmlstring.h | 6 +- .../libxml2/include/libxml/xmlversion.h | 2 +- .../3rdparty/libxml2/include/libxml/xpath.h | 80 +- .../libxml2/include/libxml/xpathInternals.h | 144 +- .../libxml2/include/libxml/xpointer.h | 44 +- .../3rdparty/libxml2/include/win32config.h | 4 +- .../3rdparty/libxml2/include/wsockcompat.h | 4 +- reactos/lib/3rdparty/libxml2/legacy.c | 28 +- reactos/lib/3rdparty/libxml2/list.c | 76 +- reactos/lib/3rdparty/libxml2/parser.c | 492 +- .../lib/3rdparty/libxml2/parserInternals.c | 52 +- reactos/lib/3rdparty/libxml2/pattern.c | 68 +- .../lib/3rdparty/libxml2/regressions.rbuild | 4 +- reactos/lib/3rdparty/libxml2/relaxng.c | 2 +- reactos/lib/3rdparty/libxml2/runsuite.c | 32 +- reactos/lib/3rdparty/libxml2/runtest.c | 152 +- reactos/lib/3rdparty/libxml2/testAutomata.c | 4 +- reactos/lib/3rdparty/libxml2/testC14N.c | 100 +- reactos/lib/3rdparty/libxml2/testHTML.c | 30 +- reactos/lib/3rdparty/libxml2/testModule.c | 4 +- reactos/lib/3rdparty/libxml2/testRegexp.c | 4 +- reactos/lib/3rdparty/libxml2/testRelax.c | 2 +- reactos/lib/3rdparty/libxml2/testSAX.c | 22 +- reactos/lib/3rdparty/libxml2/testSchemas.c | 2 +- .../lib/3rdparty/libxml2/testThreadsWin32.c | 6 +- reactos/lib/3rdparty/libxml2/testXPath.c | 14 +- reactos/lib/3rdparty/libxml2/testapi.c | 16 +- reactos/lib/3rdparty/libxml2/threads.c | 22 +- reactos/lib/3rdparty/libxml2/tree.c | 334 +- reactos/lib/3rdparty/libxml2/trio.c | 296 +- reactos/lib/3rdparty/libxml2/trionan.c | 74 +- reactos/lib/3rdparty/libxml2/trionan.h | 2 +- reactos/lib/3rdparty/libxml2/triostr.c | 146 +- reactos/lib/3rdparty/libxml2/uri.c | 84 +- reactos/lib/3rdparty/libxml2/valid.c | 216 +- reactos/lib/3rdparty/libxml2/xinclude.c | 72 +- reactos/lib/3rdparty/libxml2/xlink.c | 10 +- reactos/lib/3rdparty/libxml2/xmlIO.c | 74 +- reactos/lib/3rdparty/libxml2/xmlcatalog.c | 14 +- reactos/lib/3rdparty/libxml2/xmllint.c | 110 +- reactos/lib/3rdparty/libxml2/xmlmemory.c | 70 +- reactos/lib/3rdparty/libxml2/xmlmodule.c | 2 +- reactos/lib/3rdparty/libxml2/xmlreader.c | 142 +- reactos/lib/3rdparty/libxml2/xmlregexp.c | 110 +- reactos/lib/3rdparty/libxml2/xmlsave.c | 26 +- reactos/lib/3rdparty/libxml2/xmlschemas.c | 832 +- .../lib/3rdparty/libxml2/xmlschemastypes.c | 282 +- reactos/lib/3rdparty/libxml2/xmlstring.c | 34 +- reactos/lib/3rdparty/libxml2/xmlunicode.c | 1262 +- reactos/lib/3rdparty/libxml2/xmlwriter.c | 4 +- reactos/lib/3rdparty/libxml2/xpath.c | 352 +- reactos/lib/3rdparty/libxml2/xpointer.c | 68 +- reactos/lib/3rdparty/mingw/CRTfmode.c | 4 +- reactos/lib/3rdparty/mingw/CRTinit.c | 2 +- reactos/lib/3rdparty/mingw/binmode.c | 2 +- reactos/lib/3rdparty/mingw/cpu_features.c | 10 +- reactos/lib/3rdparty/mingw/crt1.c | 14 +- reactos/lib/3rdparty/mingw/dllcrt1.c | 14 +- reactos/lib/3rdparty/mingw/gccmain.c | 2 +- reactos/lib/3rdparty/mingw/getopt.c | 2 +- reactos/lib/3rdparty/mingw/init.c | 2 +- reactos/lib/3rdparty/mingw/main.c | 2 +- reactos/lib/3rdparty/mingw/tgetopt.h | 2 +- reactos/lib/3rdparty/mingw/wbinmode.c | 2 +- reactos/lib/3rdparty/mingw/wcrt1.c | 14 +- reactos/lib/3rdparty/mingw/winit.c | 2 +- reactos/lib/3rdparty/mingw/wmain.c | 2 +- reactos/lib/3rdparty/zlib/crc32.h | 882 +- reactos/lib/3rdparty/zlib/infback.c | 1246 +- reactos/lib/3rdparty/zlib/inflate.h | 230 +- reactos/lib/3rdparty/zlib/zconf.in.h | 664 +- reactos/lib/cmlib/cminit.c | 4 +- reactos/lib/cmlib/cmlib.h | 2 +- reactos/lib/cmlib/hivebin.c | 2 +- reactos/lib/cmlib/hivecell.c | 8 +- reactos/lib/cmlib/hivedata.h | 2 +- reactos/lib/cmlib/hiveinit.c | 8 +- reactos/lib/cmlib/hivewrt.c | 2 +- reactos/lib/drivers/ip/network/memtrack.c | 2 +- reactos/lib/drivers/ip/transport/tcp/tcp.c | 2 +- .../drivers/oskittcp/include/oskitfreebsd.h | 2 +- .../drivers/oskittcp/oskittcp/uipc_socket.c | 2 +- reactos/lib/epsapi/enum/drivers.c | 10 +- reactos/lib/epsapi/enum/processes.c | 18 +- reactos/lib/ppcmmu/gdblib.c | 20 +- reactos/lib/ppcmmu/ppcmmu.rbuild | 20 +- reactos/lib/rossym/delete.c | 2 +- reactos/lib/rossym/find.c | 2 +- reactos/lib/rossym/fromfile.c | 2 +- reactos/lib/rossym/frommem.c | 2 +- reactos/lib/rossym/fromraw.c | 2 +- reactos/lib/rossym/getraw.c | 2 +- reactos/lib/rossym/init.c | 2 +- reactos/lib/rossym/initkm.c | 2 +- reactos/lib/rossym/initum.c | 2 +- reactos/lib/rossym/rossympriv.h | 2 +- reactos/lib/rossym/zwfile.c | 2 +- reactos/lib/rtl/acl.c | 4 +- reactos/lib/rtl/atom.c | 18 +- reactos/lib/rtl/austin/avl.c | 10 +- reactos/lib/rtl/austin/avl.h | 6 +- reactos/lib/rtl/austin/tree.c | 12 +- reactos/lib/rtl/austin/udict.h | 6 +- reactos/lib/rtl/bootdata.c | 4 +- reactos/lib/rtl/generictable.c | 18 +- reactos/lib/rtl/handle.c | 2 +- reactos/lib/rtl/largeint.c | 2 +- reactos/lib/rtl/path.c | 2 +- reactos/lib/rtl/powerpc/debug.c | 84 +- reactos/lib/rtl/powerpc/interlocked.c | 10 +- reactos/lib/rtl/process.c | 8 +- reactos/lib/rtl/propvar.c | 2 +- reactos/lib/rtl/qsort.c | 10 +- reactos/lib/rtl/random.c | 2 +- reactos/lib/rtl/res.c | 2 +- reactos/lib/rtl/sd.c | 2 +- reactos/lib/rtl/sid.c | 4 +- reactos/lib/rtl/splaytree.c | 12 +- reactos/lib/rtl/sprintf.c | 60 +- reactos/lib/rtl/srw.c | 4 +- reactos/lib/rtl/swprintf.c | 52 +- reactos/lib/rtl/timerqueue.c | 2 +- reactos/lib/rtl/unicode.c | 4 +- reactos/lib/rtl/unicodeprefix.c | 10 +- reactos/lib/rtl/workitem.c | 2 +- reactos/lib/sdk/crt/conio/cprintf.c | 8 +- reactos/lib/sdk/crt/math/s_modf.c | 16 +- reactos/lib/sdk/crt/stdio/fread.c | 4 +- reactos/lib/sdk/crt/stdio/ungetc.c | 10 +- reactos/lib/sdk/crt/stdlib/fcvtbuf.c | 36 +- reactos/lib/sdk/crt/stdlib/itoa.c | 6 +- reactos/lib/sdk/crt/stdlib/malloc.c | 32 +- reactos/lib/sdk/crt/stdlib/strtod.c | 4 +- reactos/lib/sdk/crt/stdlib/swab.c | 6 +- reactos/lib/sdk/crt/string/i386/tcscat.h | 2 +- reactos/lib/sdk/crt/string/i386/tcscmp.h | 2 +- reactos/lib/sdk/crt/string/i386/tcscpy.h | 2 +- reactos/lib/sdk/crt/string/i386/tcsncat.h | 4 +- reactos/lib/sdk/crt/string/i386/tcsncmp.h | 4 +- reactos/lib/sdk/crt/string/i386/tcsncpy.h | 2 +- reactos/lib/sdk/crt/string/i386/tcsrchr.h | 4 +- reactos/lib/sdk/crt/sys_stat/systime.c | 30 +- reactos/lib/sdk/crt/wine/scanf.c | 2 +- reactos/lib/sdk/crt/wine/scanf.h | 6 +- reactos/lib/sdk/crt/wine/undname.c | 78 +- reactos/lib/sdk/dxguid/dxguid-mingw.c | 2 +- reactos/lib/sdk/libcntpr/string/i386/tcscat.h | 2 +- reactos/lib/sdk/libcntpr/string/i386/tcscmp.h | 2 +- reactos/lib/sdk/libcntpr/string/i386/tcscpy.h | 2 +- .../lib/sdk/libcntpr/string/i386/tcsncat.h | 4 +- .../lib/sdk/libcntpr/string/i386/tcsncmp.h | 4 +- .../lib/sdk/libcntpr/string/i386/tcsncpy.h | 2 +- .../lib/sdk/libcntpr/string/i386/tcsrchr.h | 4 +- reactos/lib/sdk/libcntpr/string/itoa.c | 10 +- reactos/lib/sdk/libcntpr/string/scanf.h | 6 +- reactos/lib/smlib/compses.c | 2 +- reactos/lib/smlib/connect.c | 2 +- reactos/lib/smlib/execpgm.c | 4 +- reactos/lib/smlib/lookupss.c | 4 +- reactos/ntoskrnl/cc/copy.c | 2 +- reactos/ntoskrnl/cc/pin.c | 2 +- reactos/ntoskrnl/cc/view.c | 2 +- reactos/ntoskrnl/cm/ntfunc.c | 2 +- reactos/ntoskrnl/cm/registry.c | 2 +- reactos/ntoskrnl/config/cmse.c | 2 +- reactos/ntoskrnl/config/i386/cmhardwr.c | 14 +- reactos/ntoskrnl/config/powerpc/cmhardwr.c | 14 +- reactos/ntoskrnl/ex/atom.c | 2 +- reactos/ntoskrnl/ex/harderr.c | 2 +- reactos/ntoskrnl/ex/lookas.c | 6 +- reactos/ntoskrnl/ex/powerpc/fastinterlck.c | 524 +- reactos/ntoskrnl/ex/win32k.c | 2 +- reactos/ntoskrnl/ex/zone.c | 4 +- reactos/ntoskrnl/fsrtl/fastio.c | 180 +- reactos/ntoskrnl/fstub/disksup.c | 18 +- reactos/ntoskrnl/include/config.h | 6 +- reactos/ntoskrnl/include/internal/ex.h | 10 +- reactos/ntoskrnl/include/internal/io.h | 6 +- reactos/ntoskrnl/include/internal/ke.h | 2 +- reactos/ntoskrnl/include/internal/ke_x.h | 2 +- reactos/ntoskrnl/include/internal/mm.h | 16 +- reactos/ntoskrnl/include/internal/ntoskrnl.h | 4 +- .../ntoskrnl/include/internal/powerpc/ke.h | 8 +- reactos/ntoskrnl/include/internal/se.h | 2 +- reactos/ntoskrnl/io/iomgr/arcname.c | 4 +- reactos/ntoskrnl/io/iomgr/drvrlist.c | 2 +- reactos/ntoskrnl/io/iomgr/file.c | 8 +- reactos/ntoskrnl/io/iomgr/iofunc.c | 4 +- reactos/ntoskrnl/io/iomgr/irp.c | 2 +- reactos/ntoskrnl/io/iomgr/irq.c | 2 +- reactos/ntoskrnl/io/iomgr/util.c | 4 +- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 6 +- reactos/ntoskrnl/io/pnpmgr/pnpreport.c | 2 +- reactos/ntoskrnl/kd/kdinit.c | 2 +- reactos/ntoskrnl/kd/kdio.c | 4 +- reactos/ntoskrnl/kd/wrappers/gdbstub.c | 10 +- .../ntoskrnl/kd/wrappers/gdbstub_powerpc.c | 3428 ++-- reactos/ntoskrnl/kdbg/kdb.c | 8 +- reactos/ntoskrnl/ke/bug.c | 38 +- reactos/ntoskrnl/ke/freeldr.c | 2 +- reactos/ntoskrnl/ke/i386/exp.c | 12 +- reactos/ntoskrnl/ke/i386/ldt.c | 2 +- reactos/ntoskrnl/ke/powerpc/exp.c | 228 +- reactos/ntoskrnl/ke/powerpc/kiinit.c | 646 +- reactos/ntoskrnl/ke/powerpc/ppc_irq.c | 22 +- reactos/ntoskrnl/ke/powerpc/stubs.c | 468 +- reactos/ntoskrnl/ke/powerpc/systimer.c | 42 +- reactos/ntoskrnl/ke/profobj.c | 6 +- reactos/ntoskrnl/mm/anonmem.c | 12 +- reactos/ntoskrnl/mm/cont.c | 2 +- reactos/ntoskrnl/mm/freelist.c | 6 +- reactos/ntoskrnl/mm/marea.c | 2 +- reactos/ntoskrnl/mm/mdlsup.c | 2 +- reactos/ntoskrnl/mm/mminit.c | 2 +- reactos/ntoskrnl/mm/npool.c | 12 +- reactos/ntoskrnl/mm/pageop.c | 2 +- reactos/ntoskrnl/mm/pe.c | 6 +- reactos/ntoskrnl/mm/powerpc/page.c | 1260 +- reactos/ntoskrnl/mm/powerpc/pfault.c | 192 +- reactos/ntoskrnl/mm/procsup.c | 8 +- reactos/ntoskrnl/mm/rmap.c | 8 +- reactos/ntoskrnl/mm/section.c | 22 +- reactos/ntoskrnl/mm/verifier.c | 2 +- reactos/ntoskrnl/mm/virtual.c | 14 +- reactos/ntoskrnl/ob/obhandle.c | 34 +- reactos/ntoskrnl/ob/oblife.c | 2 +- reactos/ntoskrnl/ob/oblink.c | 2 +- reactos/ntoskrnl/ob/obref.c | 22 +- reactos/ntoskrnl/ps/process.c | 14 +- reactos/ntoskrnl/ps/state.c | 2 +- reactos/ntoskrnl/rtl/libsupp.c | 62 +- reactos/ntoskrnl/rtl/misc.c | 2 +- reactos/ntoskrnl/tests/TestTimer.c | 2 +- reactos/ntoskrnl/tests/fsrtl.c | 150 +- reactos/subsystems/ntvdm/lang/pl-PL.rc | 8 +- reactos/subsystems/ntvdm/resource.h | 2 +- reactos/subsystems/win/basesrv/init.c | 6 +- reactos/subsystems/win/basesrv/main.c | 6 +- reactos/subsystems/win/basesrv/server.c | 6 +- reactos/subsystems/win/winsrv/dllmain.c | 6 +- reactos/subsystems/win/winsrv/server.c | 6 +- reactos/subsystems/win32/csrss/api/handle.c | 4 +- reactos/subsystems/win32/csrss/api/wapi.c | 10 +- reactos/subsystems/win32/csrss/csrss.c | 2 +- reactos/subsystems/win32/csrss/init.c | 16 +- .../subsystems/win32/csrss/win32csr/conio.c | 6 +- .../win32/csrss/win32csr/guiconsole.c | 74 +- .../win32/csrss/win32csr/lang/it-IT.rc | 2 +- .../win32/csrss/win32csr/lang/pl-PL.rc | 8 +- .../win32/csrss/win32csr/tuiconsole.c | 4 +- reactos/subsystems/win32/win32k/dib/dib.h | 28 +- .../subsystems/win32/win32k/dib/dib16bpp.c | 66 +- reactos/subsystems/win32/win32k/dib/dib1bpp.c | 100 +- .../subsystems/win32/win32k/dib/dib24bpp.c | 110 +- .../subsystems/win32/win32k/dib/dib32bpp.c | 38 +- .../subsystems/win32/win32k/dib/dib32bppc.c | 6 +- reactos/subsystems/win32/win32k/dib/dib4bpp.c | 102 +- reactos/subsystems/win32/win32k/dib/dib8bpp.c | 22 +- reactos/subsystems/win32/win32k/eng/bitblt.c | 2 +- .../subsystems/win32/win32k/eng/driverobj.c | 10 +- reactos/subsystems/win32/win32k/eng/engmisc.c | 4 +- .../subsystems/win32/win32k/eng/engwindow.c | 28 +- reactos/subsystems/win32/win32k/eng/float.c | 34 +- reactos/subsystems/win32/win32k/eng/mouse.c | 28 +- reactos/subsystems/win32/win32k/eng/surface.c | 4 +- reactos/subsystems/win32/win32k/eng/xlate.c | 8 +- .../subsystems/win32/win32k/include/brush.h | 4 +- .../win32/win32k/include/clipboard.h | 12 +- .../win32/win32k/include/cursoricon.h | 6 +- reactos/subsystems/win32/win32k/include/dc.h | 6 +- reactos/subsystems/win32/win32k/include/dce.h | 2 +- .../subsystems/win32/win32k/include/desktop.h | 4 +- .../subsystems/win32/win32k/include/driver.h | 44 +- .../subsystems/win32/win32k/include/gdiobj.h | 2 +- .../subsystems/win32/win32k/include/input.h | 2 +- .../win32/win32k/include/intddraw.h | 24 +- .../subsystems/win32/win32k/include/intgdi.h | 6 +- .../subsystems/win32/win32k/include/object.h | 2 +- .../subsystems/win32/win32k/include/tags.h | 2 +- .../win32/win32k/include/userfuncs.h | 16 +- .../subsystems/win32/win32k/include/winsta.h | 4 +- reactos/subsystems/win32/win32k/ldr/loader.c | 12 +- .../subsystems/win32/win32k/main/dllmain.c | 32 +- reactos/subsystems/win32/win32k/misc/copy.c | 4 +- reactos/subsystems/win32/win32k/misc/driver.c | 4 +- reactos/subsystems/win32/win32k/ntddraw/dd.c | 16 +- .../subsystems/win32/win32k/ntddraw/ddraw.c | 98 +- .../subsystems/win32/win32k/ntddraw/ddsurf.c | 74 +- .../subsystems/win32/win32k/ntddraw/stubs.c | 8 +- .../win32/win32k/ntuser/accelerator.c | 6 +- .../subsystems/win32/win32k/ntuser/class.c | 2 +- .../win32/win32k/ntuser/clipboard.c | 4 +- .../win32/win32k/ntuser/cursoricon.c | 48 +- .../subsystems/win32/win32k/ntuser/desktop.c | 98 +- .../subsystems/win32/win32k/ntuser/focus.c | 16 +- reactos/subsystems/win32/win32k/ntuser/hook.c | 4 +- .../subsystems/win32/win32k/ntuser/hotkey.c | 6 +- .../subsystems/win32/win32k/ntuser/input.c | 16 +- .../win32/win32k/ntuser/kbdlayout.c | 182 +- .../subsystems/win32/win32k/ntuser/keyboard.c | 32 +- reactos/subsystems/win32/win32k/ntuser/menu.c | 28 +- .../subsystems/win32/win32k/ntuser/message.c | 32 +- reactos/subsystems/win32/win32k/ntuser/misc.c | 138 +- .../subsystems/win32/win32k/ntuser/monitor.c | 22 +- .../subsystems/win32/win32k/ntuser/msgqueue.c | 24 +- .../subsystems/win32/win32k/ntuser/ntstubs.c | 10 +- .../subsystems/win32/win32k/ntuser/ntuser.c | 2 +- .../subsystems/win32/win32k/ntuser/painting.c | 144 +- .../subsystems/win32/win32k/ntuser/timer.c | 6 +- .../subsystems/win32/win32k/ntuser/useratom.c | 2 +- .../subsystems/win32/win32k/ntuser/windc.c | 36 +- .../subsystems/win32/win32k/ntuser/winpos.c | 42 +- .../subsystems/win32/win32k/ntuser/winsta.c | 10 +- reactos/subsystems/win32/win32k/objects/arc.c | 264 +- .../subsystems/win32/win32k/objects/bitmaps.c | 4 +- .../subsystems/win32/win32k/objects/brush.c | 6 +- .../subsystems/win32/win32k/objects/cliprgn.c | 6 +- .../subsystems/win32/win32k/objects/color.c | 58 +- .../subsystems/win32/win32k/objects/coord.c | 12 +- reactos/subsystems/win32/win32k/objects/dc.c | 38 +- .../subsystems/win32/win32k/objects/dcutil.c | 2 +- .../subsystems/win32/win32k/objects/dibobj.c | 54 +- .../win32/win32k/objects/fillshap.c | 16 +- .../subsystems/win32/win32k/objects/gdiobj.c | 16 +- .../subsystems/win32/win32k/objects/line.c | 14 +- .../win32/win32k/objects/metafile.c | 170 +- .../subsystems/win32/win32k/objects/palobj.c | 2 +- .../subsystems/win32/win32k/objects/path.c | 110 +- .../win32/win32k/objects/polyfill.c | 6 +- .../subsystems/win32/win32k/objects/print.c | 8 +- .../subsystems/win32/win32k/objects/region.c | 16 +- .../win32/win32k/objects/stockobj.c | 2 +- .../subsystems/win32/win32k/objects/text.c | 100 +- reactos/subsystems/win32/win32k/stubs/stubs.c | 40 +- reactos/tools/bin2res/bin2res.c | 8 +- reactos/tools/buildno/buildno.cpp | 22 +- reactos/tools/buildno/pch.h | 2 +- reactos/tools/cdmake/cdmake.c | 40 +- reactos/tools/create_nls/create_nls.c | 6 +- reactos/tools/depends.c | 6 +- reactos/tools/gendib/gendib.c | 6 +- reactos/tools/mkflpimg.c | 6 +- reactos/tools/mkhive/cmi.c | 4 +- reactos/tools/mkhive/registry.h | 2 +- reactos/tools/ofw_interface/ofw_interface.cpp | 24 +- reactos/tools/pefixup.c | 2 +- reactos/tools/pipetools/pipespy.cpp | 4 +- reactos/tools/pipetools/pipetunnel.cpp | 2 +- reactos/tools/rbuild/automaticdependency.cpp | 6 +- .../rbuild/backend/codeblocks/codeblocks.cpp | 34 +- .../rbuild/backend/codeblocks/codeblocks.h | 2 +- .../backend/dependencymap/dependencymap.cpp | 18 +- .../backend/dependencymap/dependencymap.h | 2 +- .../tools/rbuild/backend/devcpp/devcpp.cpp | 30 +- reactos/tools/rbuild/backend/devcpp/devcpp.h | 4 +- reactos/tools/rbuild/backend/mingw/mingw.cpp | 22 +- .../rbuild/backend/mingw/modulehandler.cpp | 6 +- .../tools/rbuild/backend/msbuild/msbuild.cpp | 14 +- .../tools/rbuild/backend/msbuild/msbuild.h | 2 +- reactos/tools/rbuild/backend/msvc/genguid.cpp | 4 +- reactos/tools/rbuild/backend/msvc/msvc.cpp | 22 +- reactos/tools/rbuild/backend/msvc/msvc.h | 2 +- .../tools/rbuild/backend/msvc/msvcmaker.cpp | 2 +- .../tools/rbuild/backend/msvc/vcprojmaker.cpp | 30 +- .../backend/versionreport/versionreport.cpp | 6 +- .../backend/versionreport/versionreport.h | 4 +- .../rbuild/compilationunitsupportcode.cpp | 2 +- reactos/tools/rbuild/exception.cpp | 2 +- reactos/tools/rbuild/filesupportcode.cpp | 10 +- reactos/tools/rbuild/pch.h | 4 +- reactos/tools/rbuild/project.cpp | 12 +- reactos/tools/rbuild/rbuild.cpp | 6 +- reactos/tools/rbuild/test.h | 2 +- reactos/tools/rbuild/tests/alltests.cpp | 2 +- .../rbuild/tests/compilationunittest.cpp | 2 +- reactos/tools/rbuild/tests/sourcefiletest.cpp | 2 +- reactos/tools/rbuild/tests/symboltest.cpp | 8 +- reactos/tools/rbuild/testsupportcode.cpp | 6 +- reactos/tools/rcopy.c | 22 +- reactos/tools/rdel.c | 8 +- reactos/tools/regtests.c | 34 +- reactos/tools/regtests2xml/regtests2xml.c | 8 +- reactos/tools/rgenstat/rgenstat.c | 12 +- reactos/tools/rline.c | 14 +- reactos/tools/rrmdir.c | 8 +- reactos/tools/rtouch.c | 8 +- reactos/tools/stubgen.c | 6 +- reactos/tools/sysreg/comp_factory.h | 34 +- reactos/tools/sysreg/conf_parser.cpp | 2 +- reactos/tools/sysreg/conf_parser.h | 10 +- reactos/tools/sysreg/data_source.h | 2 +- reactos/tools/sysreg/env_var.cpp | 8 +- reactos/tools/sysreg/file_reader.cpp | 6 +- reactos/tools/sysreg/os_support.cpp | 6 +- reactos/tools/sysreg/pipe_reader.cpp | 4 +- reactos/tools/sysreg/pipe_reader.h | 2 +- reactos/tools/sysreg/reg_test.h | 14 +- reactos/tools/sysreg/rosboot_test.cpp | 62 +- reactos/tools/sysreg/rosboot_test.h | 2 +- reactos/tools/sysreg/sym_file.cpp | 10 +- reactos/tools/sysreg/sym_file.h | 4 +- reactos/tools/sysreg/sysreg.cpp | 6 +- reactos/tools/sysreg/user_types.h | 2 +- reactos/tools/unicode/string.c | 2 +- reactos/tools/widl/client.c | 6 +- reactos/tools/widl/header.c | 2 +- reactos/tools/widl/parser.tab.c | 82 +- reactos/tools/widl/proxy.c | 18 +- reactos/tools/widl/server.c | 4 +- reactos/tools/widl/widltypes.h | 2 +- reactos/tools/widl/write_msft.c | 30 +- reactos/tools/widl_new/client.c | 4 +- reactos/tools/widl_new/header.c | 2 +- reactos/tools/widl_new/parser.tab.c | 2 +- reactos/tools/widl_new/server.c | 4 +- reactos/tools/widl_new/write_msft.c | 20 +- reactos/tools/winebuild/relay.c | 2 +- reactos/tools/wmc/mcy.tab.c | 2 +- reactos/tools/wpp/ppy.tab.c | 2 +- reactos/tools/wrc/newstruc.c | 2 +- reactos/tools/wrc/parser.tab.c | 2 +- reactos/tools/wrc/translation.c | 2 +- reactos/tools/wrc/wrc.c | 4 +- 2821 files changed, 211074 insertions(+), 211075 deletions(-) diff --git a/reactos/base/applications/cacls/lang/uk-UA.rc b/reactos/base/applications/cacls/lang/uk-UA.rc index 083795d2dd3..803b5245b4d 100644 --- a/reactos/base/applications/cacls/lang/uk-UA.rc +++ b/reactos/base/applications/cacls/lang/uk-UA.rc @@ -1,5 +1,5 @@ /* - * PROJECT: ReactOS CACLS + * PROJECT: ReactOS CACLS * LICENSE: GPL - See COPYING in the top level directory * FILE: applications/cacls/lang/uk-UA.rc * PURPOSE: Ukraianian Language File for PROJECT diff --git a/reactos/base/applications/cacls/lang/zh-TW.rc b/reactos/base/applications/cacls/lang/zh-TW.rc index e3d08070743..c7024459fa4 100644 --- a/reactos/base/applications/cacls/lang/zh-TW.rc +++ b/reactos/base/applications/cacls/lang/zh-TW.rc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL STRINGTABLE DISCARDABLE diff --git a/reactos/base/applications/calc/lang/fr-FR.rc b/reactos/base/applications/calc/lang/fr-FR.rc index 90cc0af3d82..eb37f09e652 100644 --- a/reactos/base/applications/calc/lang/fr-FR.rc +++ b/reactos/base/applications/calc/lang/fr-FR.rc @@ -19,7 +19,7 @@ */ /* * Translation made by Jerome Signouret, 2005. - * Updated by Pierre Schweitzer, 2007. + * Updated by Pierre Schweitzer, 2007. */ #include "windows.h" #include "resource.h" diff --git a/reactos/base/applications/calc/lang/ja-JP.rc b/reactos/base/applications/calc/lang/ja-JP.rc index e697da56110..e112a584082 100644 --- a/reactos/base/applications/calc/lang/ja-JP.rc +++ b/reactos/base/applications/calc/lang/ja-JP.rc @@ -39,7 +39,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT // Menu // -MAIN_MENU MENU +MAIN_MENU MENU BEGIN POPUP "•ÒW(&E)" BEGIN @@ -61,7 +61,7 @@ BEGIN END END -SCIMS_MENU MENU +SCIMS_MENU MENU BEGIN POPUP "•ÒW(&E)" BEGIN @@ -92,7 +92,7 @@ BEGIN END END -SCIWS_MENU MENU +SCIWS_MENU MENU BEGIN POPUP "•ÒW(&E)" BEGIN @@ -124,7 +124,7 @@ BEGIN END END -WHATS_THIS_MENU MENU +WHATS_THIS_MENU MENU BEGIN POPUP "" BEGIN @@ -138,9 +138,9 @@ END // Accelerator // -MAIN_MENU ACCELERATORS +MAIN_MENU ACCELERATORS BEGIN - VK_F1, IDV_HELP, VIRTKEY + VK_F1, IDV_HELP, VIRTKEY END @@ -173,7 +173,7 @@ END // String Table // -STRINGTABLE +STRINGTABLE BEGIN IDS_APPNAME "“d‘ì" IDS_BTN_BACKSPACE "Back" diff --git a/reactos/base/applications/calc/lang/zh-CN.rc b/reactos/base/applications/calc/lang/zh-CN.rc index a335ea3f505..aa5fb7af2dd 100644 --- a/reactos/base/applications/calc/lang/zh-CN.rc +++ b/reactos/base/applications/calc/lang/zh-CN.rc @@ -140,7 +140,7 @@ END DLG_ABOUT DIALOGEX 12, 0, 140, 95 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "¹ØÓÚ GNU winecalc" FONT 9, "MS Shell Dlg", 0, 0, 0x0 diff --git a/reactos/base/applications/calc/resource.h b/reactos/base/applications/calc/resource.h index de31229f903..20ee7c1d7a6 100644 --- a/reactos/base/applications/calc/resource.h +++ b/reactos/base/applications/calc/resource.h @@ -32,7 +32,7 @@ #define IDM_SEPARATOR3 1010 #define IDM_WHATS_THIS 1011 -#define IDI_CALCICON 1050 +#define IDI_CALCICON 1050 /* strings */ diff --git a/reactos/base/applications/calc/winecalc.c b/reactos/base/applications/calc/winecalc.c index 60b0c8cc62f..a069b8c3844 100644 --- a/reactos/base/applications/calc/winecalc.c +++ b/reactos/base/applications/calc/winecalc.c @@ -2948,16 +2948,16 @@ void calc_buffer_display(CALC *calc) { calcfloat real; static int old_base = NBASE_DECIMAL; - + switch (calc->numBase) { - case NBASE_HEX: + case NBASE_HEX: real = calc_atof(calc->buffer, old_base); - _stprintf(calc->display, _T("%lx"), (long)real); - _stprintf(calc->buffer, _T("%lx"), (long)real); - old_base = NBASE_HEX; + _stprintf(calc->display, _T("%lx"), (long)real); + _stprintf(calc->buffer, _T("%lx"), (long)real); + old_base = NBASE_HEX; break; - case NBASE_OCTAL: + case NBASE_OCTAL: real = calc_atof(calc->buffer, old_base); _stprintf(calc->display, TEXT("%lo"), (long)real); _stprintf(calc->buffer, TEXT("%lo"), (long)real); @@ -2966,7 +2966,7 @@ void calc_buffer_display(CALC *calc) { case NBASE_BINARY: { - int buf=0; + int buf=0; int t; if (calc->buffer[0]==_T('\0')) @@ -2977,11 +2977,11 @@ void calc_buffer_display(CALC *calc) { { real = calc_atof(calc->buffer, old_base); } - + calc->display[buf]=_T('0'); calc->buffer[buf]=_T('0'); for (t=31;t>=0;t--) - { + { if (((((long)real)>>t) & ~0xFFFFFFFE)==0) { calc->display[buf]=_T('0'); @@ -2994,16 +2994,16 @@ void calc_buffer_display(CALC *calc) { calc->buffer[buf]=_T('1'); buf++; } - + } - - if (buf==0) + + if (buf==0) { buf++; } - + calc->buffer[buf]=_T('\0'); - calc->display[buf]=_T('\0'); + calc->display[buf]=_T('\0'); old_base = NBASE_BINARY; } break; @@ -3021,7 +3021,7 @@ void calc_buffer_display(CALC *calc) { int lz = 0; int exp = 0; - + real = calc_atof(calc->buffer,old_base); _stprintf(s, FMT_DESC_EXP, real); @@ -3072,10 +3072,10 @@ void calc_buffer_display(CALC *calc) { else { real = calc_atof(calc->buffer, old_base); - } - _stprintf(calc->display, _T("%.f"), real); - _stprintf(calc->buffer, _T("%.f"), real); - } + } + _stprintf(calc->display, _T("%.f"), real); + _stprintf(calc->buffer, _T("%.f"), real); + } _tcscpy(s,calc->buffer); p = s; @@ -3102,7 +3102,7 @@ void calc_buffer_display(CALC *calc) { } old_base = NBASE_DECIMAL; } - + InvalidateRect(calc->hWnd, NULL, FALSE); UpdateWindow(calc->hWnd); } diff --git a/reactos/base/applications/charmap/lang/el-GR.rc b/reactos/base/applications/charmap/lang/el-GR.rc index 14cca99980c..aeda9410eb3 100644 --- a/reactos/base/applications/charmap/lang/el-GR.rc +++ b/reactos/base/applications/charmap/lang/el-GR.rc @@ -6,7 +6,7 @@ CAPTION " FONT 8, "MS Sans Serif" BEGIN LTEXT "ÃñáììáôïóåéñÜ :",IDC_STATIC,6,7,60,9 - COMBOBOX IDC_FONTCOMBO,65,5,181,210,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_FONTCOMBO,65,5,181,210,CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL PUSHBUTTON "ÂïÞèåéá",IDC_CMHELP,249,5,35,13 CONTROL "",IDC_FONTMAP,"FontMapWnd",WS_VSCROLL | WS_TABSTOP,20, @@ -26,7 +26,7 @@ BEGIN IDC_STATIC,48,7,150,36 PUSHBUTTON "Êëåßóçìï",IDOK,75,162,44,15 ICON 100,IDC_STATIC,10,10,7,30 - EDITTEXT IDC_LICENSE_EDIT,8,44,194,107,ES_MULTILINE | ES_READONLY | + EDITTEXT IDC_LICENSE_EDIT,8,44,194,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END diff --git a/reactos/base/applications/charmap/lang/pl-PL.rc b/reactos/base/applications/charmap/lang/pl-PL.rc index 64fe78947ef..68773073976 100644 --- a/reactos/base/applications/charmap/lang/pl-PL.rc +++ b/reactos/base/applications/charmap/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translated by xrogers -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_CHARMAP DIALOGEX 6, 6, 293, 205 //233 diff --git a/reactos/base/applications/charmap/lrgcell.c b/reactos/base/applications/charmap/lrgcell.c index 6564c882ce4..c68f5b5f171 100644 --- a/reactos/base/applications/charmap/lrgcell.c +++ b/reactos/base/applications/charmap/lrgcell.c @@ -20,7 +20,7 @@ SetLrgFont(PMAP infoPtr) LPTSTR lpFontName; INT Len; - hCombo = GetDlgItem(infoPtr->hParent, + hCombo = GetDlgItem(infoPtr->hParent, IDC_FONTCOMBO); Len = GetWindowTextLength(hCombo); @@ -37,14 +37,14 @@ SetLrgFont(PMAP infoPtr) WM_GETTEXT, 31, (LPARAM)lpFontName); - - ZeroMemory(&lf, + + ZeroMemory(&lf, sizeof(lf)); hdc = GetDC(infoPtr->hLrgWnd); lf.lfHeight = GetDeviceCaps(hdc, LOGPIXELSY) / 2; - ReleaseDC(infoPtr->hLrgWnd, + ReleaseDC(infoPtr->hLrgWnd, hdc); lf.lfCharSet = DEFAULT_CHARSET; diff --git a/reactos/base/applications/cmdutils/find/lang/bg-BG.rc b/reactos/base/applications/cmdutils/find/lang/bg-BG.rc index db22f9ada7c..e847785e846 100644 --- a/reactos/base/applications/cmdutils/find/lang/bg-BG.rc +++ b/reactos/base/applications/cmdutils/find/lang/bg-BG.rc @@ -9,7 +9,7 @@ IDS_USAGE, "FIND: /I Ïðåíåáðåãâà ÃëÀâÍÎñÒòà\n\ /N Áðîé ïîêàçàíè ðåäîâå, êàòî ñå çàïî÷âà îò 1\n\ /V Èçâåæäàíå íà ðåäîâåòå, ÍÅñúäúðæàùè íèçà." - + IDS_NO_SUCH_FILE, "FIND: %s: Íÿìà òàêúâ ôàéë\n" IDS_CANNOT_OPEN, "FIND: %s: Îòâàðÿíåòî íà ôàéëà å íåâúçìîæíî\n" diff --git a/reactos/base/applications/cmdutils/find/lang/ca-ES.rc b/reactos/base/applications/cmdutils/find/lang/ca-ES.rc index dba721804cc..e457045b522 100644 --- a/reactos/base/applications/cmdutils/find/lang/ca-ES.rc +++ b/reactos/base/applications/cmdutils/find/lang/ca-ES.rc @@ -9,7 +9,7 @@ IDS_USAGE, "FIND: Mostra totes les linies que continguin una determinada cadena /I Ignore case\n\ /N Numero de linies mostrades, començant per la primera\n\ /V Mostra les linies que no contenen la cadena de caràcters" - + IDS_NO_SUCH_FILE, "FIND: %s: No he trobat el fitxer\n" IDS_CANNOT_OPEN, "FIND: %s: No puc obrir el fitxer\n" diff --git a/reactos/base/applications/cmdutils/find/lang/de-DE.rc b/reactos/base/applications/cmdutils/find/lang/de-DE.rc index a45f29730ce..d27f245a340 100644 --- a/reactos/base/applications/cmdutils/find/lang/de-DE.rc +++ b/reactos/base/applications/cmdutils/find/lang/de-DE.rc @@ -9,7 +9,7 @@ IDS_USAGE, "Sucht in einer Datei nach einer Zeichenfolge.\n\n\ /I Ignoriert Groß-/Kleinbuchstaben bei der Suche.\n\ /N Zeigt die Zeilen mit ihren Zeilennummern an.\n\ /V Zeigt alle Zeilen an, die die Zeichenfolge NICHT enhalten." - + IDS_NO_SUCH_FILE, "Datei %s nicht gefunden\n" IDS_CANNOT_OPEN, "Datei %s kann nicht geöffnet werden.\n" diff --git a/reactos/base/applications/cmdutils/find/lang/en-US.rc b/reactos/base/applications/cmdutils/find/lang/en-US.rc index 4bd097f988c..71b1abb9fbc 100644 --- a/reactos/base/applications/cmdutils/find/lang/en-US.rc +++ b/reactos/base/applications/cmdutils/find/lang/en-US.rc @@ -9,7 +9,7 @@ IDS_USAGE, "FIND: Prints all lines of a file that contain a string.\n\n\ /I Ignore case\n\ /N Number the displayed lines, starting at 1\n\ /V Print lines that do not contain the string" - + IDS_NO_SUCH_FILE, "FIND: %s: No such file\n" IDS_CANNOT_OPEN, "FIND: %s: Cannot open file\n" diff --git a/reactos/base/applications/cmdutils/find/lang/it-IT.rc b/reactos/base/applications/cmdutils/find/lang/it-IT.rc index 93dbf1117cd..eea35363052 100644 --- a/reactos/base/applications/cmdutils/find/lang/it-IT.rc +++ b/reactos/base/applications/cmdutils/find/lang/it-IT.rc @@ -9,7 +9,7 @@ IDS_USAGE, "FIND: Visualizza le linee di un file che contengono un stringa.\n\n\ /I Ignora maiuscole/minuscole\n\ /N Numera le linee visualizzate a partire da 1\n\ /V Visualizza le linee che non contengono la stringa" - + IDS_NO_SUCH_FILE, "FIND: %s: File non trovato\n" IDS_CANNOT_OPEN, "FIND: %s: Impossibile aprire il file\n" diff --git a/reactos/base/applications/cmdutils/find/lang/lt-LT.rc b/reactos/base/applications/cmdutils/find/lang/lt-LT.rc index 09df88fdc36..f53a32d8ec7 100644 --- a/reactos/base/applications/cmdutils/find/lang/lt-LT.rc +++ b/reactos/base/applications/cmdutils/find/lang/lt-LT.rc @@ -18,7 +18,7 @@ IDS_USAGE, "FIND: Spausdina visas bylos eilutes, kuriose yra ie /I Ignoruoti raidþiø dydá\n\ /N Numeruoti vaizduojamas eilutes, pradedant nuo 1\n\ /V Spausdinti eilutes, kuriose nëra ieðkomo teksto" - + IDS_NO_SUCH_FILE, "FIND: %s: Tokios bylos nëra\n" IDS_CANNOT_OPEN, "FIND: %s: Nepavyko atverti bylos\n" diff --git a/reactos/base/applications/cmdutils/find/lang/ru-RU.rc b/reactos/base/applications/cmdutils/find/lang/ru-RU.rc index 54c1143087f..5bc0a0d8d59 100644 --- a/reactos/base/applications/cmdutils/find/lang/ru-RU.rc +++ b/reactos/base/applications/cmdutils/find/lang/ru-RU.rc @@ -9,7 +9,7 @@ IDS_USAGE, "FIND: /I Ïîèñê áåç ó÷åòà ðåãèñòðà ñèìâîëîâ.\n\ /N Âûâîä íîìåðîâ îòîáðàæàåìûõ ñòðîê (íà÷èíàÿ ñ 1).\n\ /V Âûâîä âñåõ ñòðîê, ÍÅ ñîäåðæàùèõ çàäàííóþ ñòðîêó." - + IDS_NO_SUCH_FILE, "FIND: %s: Ôàéë íå ñóùåñòâóåò.\n" IDS_CANNOT_OPEN, "FIND: %s: Íåâîçìîæíî îòêðûòü ôàéë.\n" diff --git a/reactos/base/applications/cmdutils/find/lang/uk-UA.rc b/reactos/base/applications/cmdutils/find/lang/uk-UA.rc index 2929df69924..4e371022b7a 100644 --- a/reactos/base/applications/cmdutils/find/lang/uk-UA.rc +++ b/reactos/base/applications/cmdutils/find/lang/uk-UA.rc @@ -17,7 +17,7 @@ IDS_USAGE, "FIND: /I Íå âðàõîâóâàòè ðåã³ñòð ñèìâîë³â\n\ /N Íóìåðóâàòè ðÿäêè, ÿê³ â³äîáðàæàþòüñÿ (ïî÷èíàþ÷è ç 1)\n\ /V Âèâåäåííÿ ðÿäê³â, ÿê³ íå ì³ñòÿòü çàäàíèé ðÿäîê" - + IDS_NO_SUCH_FILE, "FIND: %s: Ôàéë íå ³ñíóº\n" IDS_CANNOT_OPEN, "FIND: %s: Íåìîæëèâî â³äêðèòè ôàéë\n" diff --git a/reactos/base/applications/control/control.c b/reactos/base/applications/control/control.c index bf1488303e8..e3d06862343 100644 --- a/reactos/base/applications/control/control.c +++ b/reactos/base/applications/control/control.c @@ -40,7 +40,7 @@ //#define CONTROL_DEBUG_ENABLE #ifdef CONTROL_DEBUG_ENABLE -#define CTL_DEBUG(x) dbgprint x +#define CTL_DEBUG(x) dbgprint x #else #define CTL_DEBUG(x) #endif diff --git a/reactos/base/applications/control/lang/bg-BG.rc b/reactos/base/applications/control/lang/bg-BG.rc index 15dd6de7a67..3204989030a 100644 --- a/reactos/base/applications/control/lang/bg-BG.rc +++ b/reactos/base/applications/control/lang/bg-BG.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN diff --git a/reactos/base/applications/control/lang/cs-CZ.rc b/reactos/base/applications/control/lang/cs-CZ.rc index 912a2053d16..fd706799486 100644 --- a/reactos/base/applications/control/lang/cs-CZ.rc +++ b/reactos/base/applications/control/lang/cs-CZ.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Soubor" BEGIN diff --git a/reactos/base/applications/control/lang/da-DK.rc b/reactos/base/applications/control/lang/da-DK.rc index 808c955e36e..65dc570319c 100644 --- a/reactos/base/applications/control/lang/da-DK.rc +++ b/reactos/base/applications/control/lang/da-DK.rc @@ -6,7 +6,7 @@ LANGUAGE LANG_DANISH, SUBLANG_DEFAULT // // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Fil" BEGIN diff --git a/reactos/base/applications/control/lang/de-DE.rc b/reactos/base/applications/control/lang/de-DE.rc index 8d02ff96327..042f0b71415 100644 --- a/reactos/base/applications/control/lang/de-DE.rc +++ b/reactos/base/applications/control/lang/de-DE.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Datei" BEGIN diff --git a/reactos/base/applications/control/lang/el-GR.rc b/reactos/base/applications/control/lang/el-GR.rc index b620d0c8dea..2773b84f04b 100644 --- a/reactos/base/applications/control/lang/el-GR.rc +++ b/reactos/base/applications/control/lang/el-GR.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Áñ÷åßï" BEGIN diff --git a/reactos/base/applications/control/lang/en-US.rc b/reactos/base/applications/control/lang/en-US.rc index 83db671db6f..e5861053344 100644 --- a/reactos/base/applications/control/lang/en-US.rc +++ b/reactos/base/applications/control/lang/en-US.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&File" BEGIN diff --git a/reactos/base/applications/control/lang/es-ES.rc b/reactos/base/applications/control/lang/es-ES.rc index b25171d3fc4..0373b0353a7 100644 --- a/reactos/base/applications/control/lang/es-ES.rc +++ b/reactos/base/applications/control/lang/es-ES.rc @@ -11,7 +11,7 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Archivo" BEGIN diff --git a/reactos/base/applications/control/lang/fi-FI.rc b/reactos/base/applications/control/lang/fi-FI.rc index 623086d6187..7d493573b20 100644 --- a/reactos/base/applications/control/lang/fi-FI.rc +++ b/reactos/base/applications/control/lang/fi-FI.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Tiedosto" BEGIN diff --git a/reactos/base/applications/control/lang/fr-FR.rc b/reactos/base/applications/control/lang/fr-FR.rc index c49d5bb697a..4d41141b8f2 100644 --- a/reactos/base/applications/control/lang/fr-FR.rc +++ b/reactos/base/applications/control/lang/fr-FR.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Fichier" BEGIN diff --git a/reactos/base/applications/control/lang/hu-HU.rc b/reactos/base/applications/control/lang/hu-HU.rc index 3c9d388e2e0..48f9c609a64 100644 --- a/reactos/base/applications/control/lang/hu-HU.rc +++ b/reactos/base/applications/control/lang/hu-HU.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Fájl" BEGIN diff --git a/reactos/base/applications/control/lang/id-ID.rc b/reactos/base/applications/control/lang/id-ID.rc index 865093296cb..f5ff1fa2ca9 100644 --- a/reactos/base/applications/control/lang/id-ID.rc +++ b/reactos/base/applications/control/lang/id-ID.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&File" BEGIN diff --git a/reactos/base/applications/control/lang/it-IT.rc b/reactos/base/applications/control/lang/it-IT.rc index 52fbcdec131..28b0e7270e4 100644 --- a/reactos/base/applications/control/lang/it-IT.rc +++ b/reactos/base/applications/control/lang/it-IT.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&File" BEGIN diff --git a/reactos/base/applications/control/lang/ja-JP.rc b/reactos/base/applications/control/lang/ja-JP.rc index fe6145d8718..cdf2deb9fd3 100644 --- a/reactos/base/applications/control/lang/ja-JP.rc +++ b/reactos/base/applications/control/lang/ja-JP.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "ƒtƒ@ƒCƒ‹(&F)" BEGIN diff --git a/reactos/base/applications/control/lang/lt-LT.rc b/reactos/base/applications/control/lang/lt-LT.rc index 2feb8cef466..69b8625f0fb 100644 --- a/reactos/base/applications/control/lang/lt-LT.rc +++ b/reactos/base/applications/control/lang/lt-LT.rc @@ -9,7 +9,7 @@ LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Byla" BEGIN diff --git a/reactos/base/applications/control/lang/nl-NL.rc b/reactos/base/applications/control/lang/nl-NL.rc index 0b7771b01a9..f4066879c9e 100644 --- a/reactos/base/applications/control/lang/nl-NL.rc +++ b/reactos/base/applications/control/lang/nl-NL.rc @@ -8,7 +8,7 @@ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL //vertaald door Lionel Lowie // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Bestand" BEGIN diff --git a/reactos/base/applications/control/lang/pl-PL.rc b/reactos/base/applications/control/lang/pl-PL.rc index 181e9f0ad0e..3b50e87b6dc 100644 --- a/reactos/base/applications/control/lang/pl-PL.rc +++ b/reactos/base/applications/control/lang/pl-PL.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Plik" BEGIN diff --git a/reactos/base/applications/control/lang/pt-BR.rc b/reactos/base/applications/control/lang/pt-BR.rc index 404d3a20e5b..ceae3a77803 100644 --- a/reactos/base/applications/control/lang/pt-BR.rc +++ b/reactos/base/applications/control/lang/pt-BR.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Arquivo" BEGIN diff --git a/reactos/base/applications/control/lang/ru-RU.rc b/reactos/base/applications/control/lang/ru-RU.rc index 78c5690215b..a5f08a9551f 100644 --- a/reactos/base/applications/control/lang/ru-RU.rc +++ b/reactos/base/applications/control/lang/ru-RU.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN diff --git a/reactos/base/applications/control/lang/sk-SK.rc b/reactos/base/applications/control/lang/sk-SK.rc index ef805f65949..1a0575e061b 100644 --- a/reactos/base/applications/control/lang/sk-SK.rc +++ b/reactos/base/applications/control/lang/sk-SK.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Súbor" BEGIN diff --git a/reactos/base/applications/control/lang/sv-SE.rc b/reactos/base/applications/control/lang/sv-SE.rc index 69cf94971d4..4ac81b65535 100644 --- a/reactos/base/applications/control/lang/sv-SE.rc +++ b/reactos/base/applications/control/lang/sv-SE.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Arkiv" BEGIN diff --git a/reactos/base/applications/control/lang/th-TH.rc b/reactos/base/applications/control/lang/th-TH.rc index 8ee4c97d402..1de7068a12b 100644 --- a/reactos/base/applications/control/lang/th-TH.rc +++ b/reactos/base/applications/control/lang/th-TH.rc @@ -14,7 +14,7 @@ LANGUAGE LANG_THAI, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "á&¿éÁ" BEGIN diff --git a/reactos/base/applications/control/lang/uk-UA.rc b/reactos/base/applications/control/lang/uk-UA.rc index ec93e0dc312..6274df214ff 100644 --- a/reactos/base/applications/control/lang/uk-UA.rc +++ b/reactos/base/applications/control/lang/uk-UA.rc @@ -13,7 +13,7 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN diff --git a/reactos/base/applications/control/lang/zh-CN.rc b/reactos/base/applications/control/lang/zh-CN.rc index 27232d7d7c4..f265d00047d 100644 --- a/reactos/base/applications/control/lang/zh-CN.rc +++ b/reactos/base/applications/control/lang/zh-CN.rc @@ -25,7 +25,7 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED // Menu // -IDM_MAINMENU MENU DISCARDABLE +IDM_MAINMENU MENU DISCARDABLE BEGIN POPUP "Îļþ(&F)" BEGIN diff --git a/reactos/base/applications/control/resource.h b/reactos/base/applications/control/resource.h index 8cce795056c..e602373c914 100644 --- a/reactos/base/applications/control/resource.h +++ b/reactos/base/applications/control/resource.h @@ -12,7 +12,7 @@ #define IDM_CLOSE 40005 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 diff --git a/reactos/base/applications/games/solitaire/cardlib/cardbitmaps.cpp b/reactos/base/applications/games/solitaire/cardlib/cardbitmaps.cpp index 3b08853a678..d77e4e6ba81 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardbitmaps.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardbitmaps.cpp @@ -32,13 +32,13 @@ void LoadCardBitmapsFromLibrary(HINSTANCE hCardDll, int *pwidth, int *pheight) { //convert into the range used by the cdt_xxx functions int val; - + if(i < 52) val = (i % 4) * 13 + (i/4); else val = i; - + hBitmap = LoadBitmap(hCardDll, MAKEINTRESOURCE(val + 1)); GetObject(hBitmap, sizeof(bmp), &bmp); - + width = bmp.bmWidth; height = bmp.bmHeight; @@ -53,11 +53,11 @@ void LoadCardBitmapsFromLibrary(HINSTANCE hCardDll, int *pwidth, int *pheight) ReleaseDC(0, hdc); } - + hOld = SelectObject(hdcCard, hBitmap); BitBlt(__hdcCardBitmaps, i*width, 0, width, height, hdcCard, 0, 0, SRCCOPY); SelectObject(hdcCard, hOld); - + //Now draw a black border around each card... xpos = i*width; MoveToEx(__hdcCardBitmaps, xpos+2, 0, 0); @@ -69,21 +69,21 @@ void LoadCardBitmapsFromLibrary(HINSTANCE hCardDll, int *pwidth, int *pheight) LineTo(__hdcCardBitmaps, xpos+0, height - 3); LineTo(__hdcCardBitmaps, xpos+0, 2); LineTo(__hdcCardBitmaps, xpos+2, 0); - + DeleteObject(hBitmap); } - + DeleteDC(hdcCard); *pwidth = width; *pheight = height; - + } void LoadCardBitmaps(void) { HINSTANCE hCardDll; - + //If Windows NT/2000/XP if(GetVersion() < 0x80000000) @@ -96,9 +96,9 @@ void LoadCardBitmaps(void) PostQuitMessage(0); return; } - + LoadCardBitmapsFromLibrary(hCardDll, &__cardwidth, &__cardheight); - + FreeLibrary(hCardDll); } #ifndef __REACTOS__ @@ -132,9 +132,9 @@ void FreeCardBitmaps() // static void DrawCheckedRect(HDC hdc, RECT *rect, COLORREF fg, COLORREF bg) { - static WORD wCheckPat[8] = - { - 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555 + static WORD wCheckPat[8] = + { + 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555 }; HBITMAP hbmp; @@ -152,15 +152,15 @@ static void DrawCheckedRect(HDC hdc, RECT *rect, COLORREF fg, COLORREF bg) fgold = SetTextColor(hdc, fg); bgold = SetBkColor(hdc, bg); - - PatBlt(hdc, rect->left, rect->top, - rect->right - rect->left, - rect->bottom - rect->top, + + PatBlt(hdc, rect->left, rect->top, + rect->right - rect->left, + rect->bottom - rect->top, PATCOPY); - + SetBkColor(hdc, bgold); SetTextColor(hdc, fgold); - + SelectObject(hdc, hbrold); DeleteObject(hbr); DeleteObject(hbmp); @@ -196,13 +196,13 @@ HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, COLORREF col, int width, int heigh hpfg = CreatePen(PS_SOLID, 0, MAKE_PALETTERGB(fg)); hpbg = CreatePen(PS_SOLID, 0, MAKE_PALETTERGB(bg)); hpsh = CreatePen(PS_SOLID, 0, MAKE_PALETTERGB(shadow)); - hpsh2= CreatePen(PS_SOLID, 0, MAKE_PALETTERGB(shadow2)); + hpsh2= CreatePen(PS_SOLID, 0, MAKE_PALETTERGB(shadow2)); hpold = SelectObject(hdc, hpsh); MoveToEx(hdc, 2, 0, NULL); LineTo (hdc, width-3,0); LineTo (hdc, width-1, 2); - + SelectObject(hdc, hpold); hpold = SelectObject(hdc, hpsh2); LineTo (hdc, width-1, height-3); //vertical @@ -222,12 +222,12 @@ HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, COLORREF col, int width, int heigh hpold = SelectObject(hdc, hpfg); MoveToEx(hdc, width - 2, 3, NULL); LineTo (hdc, width - 2, height - 2); - + //(horz) MoveToEx(hdc, width - 3, height-2, NULL); LineTo (hdc, 3, height-2); SelectObject(hdc, hpold); - + //draw the background InflateRect(&rect, -2, -2); DrawCheckedRect(hdc, &rect, MAKE_PALETTERGB(bg), MAKE_PALETTERGB(fg)); @@ -240,7 +240,7 @@ HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, COLORREF col, int width, int heigh DeleteObject(hpfg); DeleteObject(hpbg); - + return hbm; } diff --git a/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp b/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp index dab2a23f803..66e7e77a18d 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardbutton.cpp @@ -24,7 +24,7 @@ CardButton::CardButton(CardWindow &parent, int Id, TCHAR *szText, UINT Style, bo { crText = RGB(255,255,255); crBack = RGB(0, 128, 0); - + xadjust = 0; yadjust = 0; xjustify = 0; @@ -57,16 +57,16 @@ void CardButton::DrawRect(HDC hdc, RECT *rect, bool fNormal) HPEN hhi = CreatePen(0, 0, MAKE_PALETTERGB(crHighlight)); HPEN hsh = CreatePen(0, 0, MAKE_PALETTERGB(crShadow)); HPEN hbl = (HPEN)GetStockObject(BLACK_PEN); - + int x = rect->left; int y = rect->top; int width = rect->right-rect->left - 1; int height = rect->bottom-rect->top - 1; - + SetRect(&fill, x+1, y+1, x+width-1, y+height-1); int one = 1; - + if(!fNormal) { x += width; @@ -76,7 +76,7 @@ void CardButton::DrawRect(HDC hdc, RECT *rect, bool fNormal) one = -1; OffsetRect(&fill, 1, 1); } - + if(fNormal) hOld = SelectObject(hdc, hhi); else @@ -107,7 +107,7 @@ void CardButton::DrawRect(HDC hdc, RECT *rect, bool fNormal) void CardButton::Clip(HDC hdc) { if(fVisible == false) return; - + ExcludeClipRect(hdc, rect.left, rect.top, rect.right, rect.bottom); } @@ -123,12 +123,12 @@ void CardButton::Draw(HDC hdc, bool fNormal) if(fVisible == 0) return; if(hFont == 0) - SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT)); + SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT)); else - SelectObject(hdc, hFont); - + SelectObject(hdc, hFont); + GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textsize); - + if(hIcon) { x = rect.left + 32 + 8; @@ -150,11 +150,11 @@ void CardButton::Draw(HDC hdc, bool fNormal) x += rect.left + iconwidth; } } - + y = rect.bottom - rect.top; y = (y - textsize.cy) / 2; y += rect.top; - + //calc icon position.. ix = rect.left + 4; iy = rect.top + (rect.bottom-rect.top-32) / 2; @@ -174,20 +174,20 @@ void CardButton::Draw(HDC hdc, bool fNormal) // // Calc icon pos // - + if(hIcon) { ExcludeClipRect(hdc, ix, iy, ix + 32, iy + 32); } - + if(uStyle & CB_PUSHBUTTON) { DrawRect(hdc, &rect, fNormal); SetBkColor(hdc, MAKE_PALETTERGB(crBack)); SetTextColor(hdc, crText);//MAKE_PALETTERGB(crText)); - - SelectClipRgn(hdc, 0); + + SelectClipRgn(hdc, 0); ExtTextOut(hdc, x, y, ETO_OPAQUE, &cliprect, szText, lstrlen(szText), 0); } @@ -257,7 +257,7 @@ void CardButton::AdjustPosition(int winwidth, int winheight) int CardButton::OnLButtonDown(HWND hwnd, int x, int y) { - if((uStyle & CB_PUSHBUTTON) == 0) + if((uStyle & CB_PUSHBUTTON) == 0) return 0; //make sure that the user is allowed to do something @@ -269,7 +269,7 @@ int CardButton::OnLButtonDown(HWND hwnd, int x, int y) { ReleaseMutex(mxlock); } - + fMouseDown = true; fButtonDown = true; @@ -287,19 +287,19 @@ int CardButton::OnMouseMove(HWND hwnd, int x, int y) bool fOldButtonDown = fButtonDown; POINT pt; - + pt.x = x; pt.y = y; - + if(PtInRect(&rect, pt)) fButtonDown = true; else fButtonDown = false; - + if(fButtonDown != fOldButtonDown) Redraw(); } - + return 0; } @@ -309,19 +309,19 @@ int CardButton::OnLButtonUp(HWND hwnd, int x, int y) { fMouseDown = false; fButtonDown = false; - + if(uStyle & CB_PUSHBUTTON) { Redraw(); ReleaseCapture(); } - + //if have clicked the button if(parentWnd.CardButtonFromPoint(x, y) == this) { if(ButtonCallback) { - ButtonCallback(*this); + ButtonCallback(*this); } else { @@ -340,7 +340,7 @@ CardButton *CardWindow::CreateButton(int id, TCHAR *szText, UINT uStyle, bool fV { CardButton *cb; - if(nNumButtons == MAXBUTTONS) + if(nNumButtons == MAXBUTTONS) return 0; cb = new CardButton(*this, id, szText, uStyle, fVisible, x, y, width, height); @@ -357,7 +357,7 @@ CardButton *CardWindow::CreateButton(int id, TCHAR *szText, UINT uStyle, bool fV cb->SetBackColor(crBackgnd); cb->SetForeColor(RGB(255,255,255)); } - + return cb; } @@ -394,9 +394,9 @@ void CardButton::Redraw() HPALETTE hOldPal = UseNicePalette(hdc, __hPalette); Draw(hdc, !fButtonDown); - + RestorePalette(hdc, hOldPal); - + ReleaseDC((HWND)parentWnd, hdc); } @@ -411,7 +411,7 @@ void CardButton::SetBackColor(COLORREF cr) crHighlight = GetHighlight(cr); crShadow = GetShadow(cr); - + //crHighlight = ScaleLumRGB(cr, +0.25); //crShadow = ScaleLumRGB(cr, -0.25); } @@ -444,7 +444,7 @@ void CardButton::SetPlacement(UINT xJustify, UINT yJustify, int xAdjust, int yAd void CardButton::SetIcon(HICON hicon, bool fRedraw) { hIcon = hicon; - + if(fRedraw) Redraw(); } @@ -465,7 +465,7 @@ bool CardButton::Lock() DWORD dw = WaitForSingleObject(mxlock, 0); if(dw == WAIT_OBJECT_0) - return true; + return true; else return false; } diff --git a/reactos/base/applications/games/solitaire/cardlib/cardcolor.cpp b/reactos/base/applications/games/solitaire/cardlib/cardcolor.cpp index 64e79605137..86006c56011 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardcolor.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardcolor.cpp @@ -25,7 +25,7 @@ inline double fMin(double a, double b) COPYRIGHT:1995-1997 Robert Mashlan Modified for LabWindows/CVI, 1999 Guillaume Dargaud ******************************************************************************/ -void RGBtoHLS(const COLORREF rgb, double *H, double *L, double *S ) +void RGBtoHLS(const COLORREF rgb, double *H, double *L, double *S ) { double delta; double r = (double)((rgb )&0xFF)/255; @@ -34,19 +34,19 @@ void RGBtoHLS(const COLORREF rgb, double *H, double *L, double *S ) double cmax = MAX3(r,g,b); double cmin = MIN3(r,g,b); *L=(cmax+cmin)/2.0; - - if(cmax == cmin) + + if(cmax == cmin) { *S = *H = 0; // it's really undefined } - else + else { if(*L < 0.5) *S = (cmax-cmin)/(cmax+cmin); else *S = (cmax-cmin)/(2.0-cmax-cmin); - + delta = cmax - cmin; - - if(r == cmax) + + if(r == cmax) { *H = (g - b) / delta; } @@ -66,7 +66,7 @@ void RGBtoHLS(const COLORREF rgb, double *H, double *L, double *S ) COPYRIGHT:1995-1997 Robert Mashlan Modified for LabWindows/CVI, 1999 Guillaume Dargaud ******************************************************************************/ -double HueToRGB(const double m1, const double m2, double h ) +double HueToRGB(const double m1, const double m2, double h ) { if (h<0) h+=1.0; if (h>1) h-=1.0; @@ -86,20 +86,20 @@ double HueToRGB(const double m1, const double m2, double h ) Modified for LabWindows/CVI, 1999 Guillaume Dargaud ******************************************************************************/ -COLORREF HLStoRGB(const double H, const double L, const double S ) +COLORREF HLStoRGB(const double H, const double L, const double S ) { double r,g,b; double m1, m2; - if(S == 0) + if(S == 0) { r = g = b = L; } - else + else { - if (L <= 0.5) + if (L <= 0.5) m2 = L * (1.0 + S); - else + else m2 = L + S - L * S; m1 = 2.0 * L - m2; @@ -108,7 +108,7 @@ COLORREF HLStoRGB(const double H, const double L, const double S ) g = HueToRGB(m1,m2,H); b = HueToRGB(m1,m2,H-1.0/3.0); } - + return RGB(r*255, g*255, b*255); } @@ -118,7 +118,7 @@ COLORREF HLStoRGB(const double H, const double L, const double S ) FUNCTION: ColorScaleHSL PURPOSE: Returns the HSL linear interpolated color between 2 colors (more natural looking than RGB interpolation) - For instance if the luminance is the same in Col1 and Col2, + For instance if the luminance is the same in Col1 and Col2, then the luminance of the result will be the same If Ratio=0, you get Col1, If Ratio=1, you get Col2 @@ -127,10 +127,10 @@ COLORREF HLStoRGB(const double H, const double L, const double S ) Ratio: 0 for low color, 1 for high color, or in between EXAMPLE: Col1=0, Col2=0xFF00FF, Ratio=0.5 returns 0x1F5F3F ******************************************************************************/ -COLORREF ColorScaleHSL( const COLORREF Col1, const COLORREF Col2, const double Ratio) +COLORREF ColorScaleHSL( const COLORREF Col1, const COLORREF Col2, const double Ratio) { static double H1, H2, S1, S2, L1, L2; - + if (Ratio<=0) return Col1; // Ratio parameter must be between 0 and 1 else if (Ratio>=1) return Col2; @@ -150,8 +150,8 @@ COLORREF ColorScaleHSL( const COLORREF Col1, const COLORREF Col2, const doubl Ratio: 0 for low color, 1 for high color, or in between EXAMPLE: Col1=0, Col2=0xFF00FF, Ratio=0.5 returns 0x800080 ******************************************************************************/ -COLORREF ColorScaleRGB( const COLORREF Col1, - const COLORREF Col2, +COLORREF ColorScaleRGB( const COLORREF Col1, + const COLORREF Col2, const double Ratio) { int R1=(Col1)&0xFF, G1=(Col1>>8)&0xFF, B1=(Col1>>16)&0xFF; int R2=(Col2)&0xFF, G2=(Col2>>8)&0xFF, B2=(Col2>>16)&0xFF; @@ -285,7 +285,7 @@ COLORREF HLStoRGB(const double Hue, const double Lum, const double Sat) if(Sat == 0) { - red = green = blue = (BYTE)(Lum * 255); + red = green = blue = (BYTE)(Lum * 255); } else { @@ -317,10 +317,10 @@ COLORREF ScaleLumRGB(COLORREF col1, double ratio) return HLStoRGB(H1, L1, S1); } -COLORREF ColorScaleHSL(const COLORREF Col1, const COLORREF Col2, const double Ratio) +COLORREF ColorScaleHSL(const COLORREF Col1, const COLORREF Col2, const double Ratio) { static double H1, H2, S1, S2, L1, L2; - + if(Ratio <= 0) return Col1; // Ratio parameter must be between 0 and 1 else if(Ratio >= 1) return Col2; diff --git a/reactos/base/applications/games/solitaire/cardlib/cardcolor.h b/reactos/base/applications/games/solitaire/cardlib/cardcolor.h index e8a9ff21ff9..a8a633f27cf 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardcolor.h +++ b/reactos/base/applications/games/solitaire/cardlib/cardcolor.h @@ -1,10 +1,10 @@ -COLORREF ColorScaleRGB( const COLORREF Col1, - const COLORREF Col2, +COLORREF ColorScaleRGB( const COLORREF Col1, + const COLORREF Col2, const double Ratio); -COLORREF ColorScaleHSL( const COLORREF Col1, - const COLORREF Col2, +COLORREF ColorScaleHSL( const COLORREF Col1, + const COLORREF Col2, const double Ratio); diff --git a/reactos/base/applications/games/solitaire/cardlib/cardcount.cpp b/reactos/base/applications/games/solitaire/cardlib/cardcount.cpp index 5cafdd22c61..df86a886754 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardcount.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardcount.cpp @@ -1,16 +1,16 @@ // // CardCount is a helper library for CardStacks. -// -// When you initialize a CardCount object with a +// +// When you initialize a CardCount object with a // cardstack, it keeps track of the number of cards // the stack contains. // // e.g. CardCount count(cardstack); // // Then you can do: -// +// // int num_fives = count[5] -// +// // count.Add(cardstack2); - combine with another stack // // int num_aces = count[1] - aces low @@ -53,7 +53,7 @@ void CardCount::Sub(const CardStack &cs) { Card card = cs[i]; int val = card.LoVal(); - + if(count[val - 1] > 0) count[val - 1]--; } @@ -85,6 +85,6 @@ void CardCount::Dec(size_t index) index -= 1; - if(count[index] > 0) + if(count[index] > 0) count[index]--; } diff --git a/reactos/base/applications/games/solitaire/cardlib/cardcount.h b/reactos/base/applications/games/solitaire/cardlib/cardcount.h index 6e0a632c522..c16fa1ce5ce 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardcount.h +++ b/reactos/base/applications/games/solitaire/cardlib/cardcount.h @@ -24,7 +24,7 @@ public: CardCount &operator += (const CardStack &cs); private: - int count[13]; //13 different card values + int count[13]; //13 different card values //(ace,2,3,4,5,6,7,8,9,10,J,Q,K) }; diff --git a/reactos/base/applications/games/solitaire/cardlib/cardlib.cpp b/reactos/base/applications/games/solitaire/cardlib/cardlib.cpp index e739ce0390a..4c6ef1c0a4f 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardlib.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardlib.cpp @@ -48,7 +48,7 @@ void CardLib_SetZoomSpeed(int speed) It uses the Card(int uval) constructor, which results in a 2 of clubs... not what was expected -*/ +*/ /* void CardLib_SetAcesHigh(bool fHigh); bool operator != (const Card &lhs, const Card &rhs); diff --git a/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp b/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp index 8ed739f2273..4ce0ed417f6 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp @@ -15,7 +15,7 @@ HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, int width, int height); void PaintRect(HDC hdc, RECT *rect, COLORREF colour); -CardRegion::CardRegion(CardWindow &parent, int Id, bool visible, int x, int y, int xOffset, int yOffset) +CardRegion::CardRegion(CardWindow &parent, int Id, bool visible, int x, int y, int xOffset, int yOffset) : id(Id), parentWnd(parent), xpos(x), ypos(y), xoffset(xOffset), yoffset(yOffset), fVisible(visible) { width = __cardwidth; @@ -40,7 +40,7 @@ CardRegion::CardRegion(CardWindow &parent, int Id, bool visible, int x, int y, i nDragCardWidth = 0; nDragCardHeight = 0; - + CanDragCallback = 0; CanDropCallback = 0; AddCallback = 0; @@ -116,7 +116,7 @@ CardRegion *CardWindow::CreateRegion(int id, bool fVisible, int x, int y, int xo cr->SetBackCardIdx(nBackCardIdx); Regions[nNumCardRegions++] = cr; - + return cr; } @@ -147,7 +147,7 @@ int CardRegion::GetOverlapRatio(int x, int y, int w, int h) } bool CardRegion::SetDragRule(UINT uDragType, pCanDragProc proc) -{ +{ switch(uDragType) { case CS_DRAG_NONE: case CS_DRAG_ALL: case CS_DRAG_TOP: @@ -165,10 +165,10 @@ bool CardRegion::SetDragRule(UINT uDragType, pCanDragProc proc) } bool CardRegion::SetDropRule(UINT uDropType, pCanDropProc proc) -{ +{ switch(uDropType) { - case CS_DROP_NONE: case CS_DROP_ALL: + case CS_DROP_NONE: case CS_DROP_ALL: uDropRule = uDropType; return true; @@ -205,14 +205,14 @@ void CardRegion::SetRemoveCardProc(pRemoveProc proc) void CardRegion::Update() { CalcApparentCards(); - UpdateSize(); + UpdateSize(); UpdateFaceDir(cardstack); } bool CardRegion::SetThreedCount(int count) { - if(count < 1) + if(count < 1) { return false; } @@ -241,7 +241,7 @@ void CardRegion::Show(bool fShow) } bool CardRegion::IsVisible() -{ +{ return fVisible; } @@ -283,13 +283,13 @@ void CardRegion::AdjustPosition(int winwidth, int winheight) switch(xjustify) { default: case CS_XJUST_NONE: break; - + case CS_XJUST_CENTER: //centered xpos = (winwidth - (width & ~0x1)) / 2; xpos += xadjust; if(xoffset < 0) xpos += (width - __cardwidth); - + break; case CS_XJUST_RIGHT: //right-aligned @@ -301,7 +301,7 @@ void CardRegion::AdjustPosition(int winwidth, int winheight) switch(yjustify) { default: case CS_YJUST_NONE: break; - + case CS_YJUST_CENTER: //centered ypos = (winheight - height) / 2; ypos += yadjust; @@ -324,7 +324,7 @@ void CardRegion::Flash(int count, int milliseconds) nFlashCount = count; fFlashVisible = false; uFlashTimer = SetTimer((HWND)parentWnd, (WPARAM)this, milliseconds, 0); - + parentWnd.Redraw(); } @@ -351,7 +351,7 @@ void CardRegion::DoFlash() uFlashTimer = (UINT)-1; fFlashVisible = true; } - + parentWnd.Redraw(); } } @@ -376,7 +376,7 @@ void CardRegion::SetEmptyImage(UINT uImage) uEmptyImage = CS_EI_NONE; break; } - + } void CardRegion::SetBackCardIdx(UINT uBackIdx) @@ -386,18 +386,18 @@ void CardRegion::SetBackCardIdx(UINT uBackIdx) } void CardRegion::SetCardStack(const CardStack &cs) -{ +{ //make a complete copy of the specified stack.. - cardstack = cs; + cardstack = cs; // Update the face-direction and stack-size Update(); } const CardStack & CardRegion::GetCardStack() -{ +{ //return reference to our internal stack - return cardstack; + return cardstack; } // @@ -488,7 +488,7 @@ bool CardRegion::MoveCard(CardRegion *pDestStack, int nNumCards, bool fAnimate) oldx = x; oldy = y; - + dragstack = cardstack.Pop(nNumCards); //Alter the drag-stack so that it's cards are the same way up @@ -515,7 +515,7 @@ bool CardRegion::MoveCard(CardRegion *pDestStack, int nNumCards, bool fAnimate) hdc = GetDC((HWND)parentWnd); ZoomCard(hdc, x, y, pDestStack); - + ReleaseDC((HWND)parentWnd, hdc); ReleaseDragBitmaps(); } @@ -523,9 +523,9 @@ bool CardRegion::MoveCard(CardRegion *pDestStack, int nNumCards, bool fAnimate) // Get a copy of the cardstack CardStack cs = pDestStack->GetCardStack(); cs.Push(dragstack); - + pDestStack->SetCardStack(cs); - + //cs = pDestStack->GetCardStack(); //pDestStack->Update(); //pDestStack->UpdateFaceDir(cs); @@ -544,7 +544,7 @@ int CardRegion::NumCards() const if(fMouseDragging) return cardstack.NumCards() + dragstack.NumCards(); else - return cardstack.NumCards(); + return cardstack.NumCards(); } bool CardRegion::Lock() @@ -554,7 +554,7 @@ bool CardRegion::Lock() if(dw == WAIT_OBJECT_0) { //TRACE("LockStack succeeded\n"); - return true; + return true; } else { @@ -573,7 +573,7 @@ bool CardRegion::UnLock() } else { - //TRACE("Unlocking stack failed\n"); + //TRACE("Unlocking stack failed\n"); return false; } } @@ -611,8 +611,8 @@ void CardRegion::RedrawIfNotDim(CardRegion *pCompare, bool fFullRedraw) // // // - if( pCompare->xoffset != xoffset || - pCompare->yoffset != yoffset || + if( pCompare->xoffset != xoffset || + pCompare->yoffset != yoffset || pCompare->nThreedCount != nThreedCount || pCompare->uFaceDirType != uFaceDirType || pCompare->uFaceDirType != CS_FACE_ANY @@ -623,7 +623,7 @@ void CardRegion::RedrawIfNotDim(CardRegion *pCompare, bool fFullRedraw) else pCompare->Redraw(); } - + } // @@ -641,18 +641,18 @@ bool CardRegion::SimulateDrag(CardRegion *pDestStack, int iNumDragCards, bool fA //make a list of the cards that would be in the drag list CardStack tempstack = cardstack.Top(iNumDragCards); - if(pDestStack->CanDropCards(tempstack)) + if(pDestStack->CanDropCards(tempstack)) { - MoveCard(pDestStack, iNumDragCards, fAnimate); - + MoveCard(pDestStack, iNumDragCards, fAnimate); + if(RemoveCallback) RemoveCallback(*this, iNumDragCards); if(pDestStack->AddCallback) pDestStack->AddCallback(*pDestStack, pDestStack->cardstack); - + RedrawIfNotDim(pDestStack, true); - } + } } diff --git a/reactos/base/applications/games/solitaire/cardlib/cardregion.h b/reactos/base/applications/games/solitaire/cardlib/cardregion.h index d3b4179c9f0..a6058f5b479 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardregion.h +++ b/reactos/base/applications/games/solitaire/cardlib/cardregion.h @@ -21,7 +21,7 @@ class CardRegion // Constructor is PRIVATE - only // a CardWindow can create cardstacks! // - CardRegion(CardWindow &parent, int id, bool fVisible, + CardRegion(CardWindow &parent, int id, bool fVisible, int x, int y, int xOffset, int yOffset); ~CardRegion(); @@ -29,7 +29,7 @@ class CardRegion public: void SetBackColor(COLORREF cr); - + void SetCardStack(const CardStack &cs); const CardStack & GetCardStack(); @@ -38,7 +38,7 @@ public: // bool SetDragRule(UINT uDragType, pCanDragProc proc = 0); bool SetDropRule(UINT uDropType, pCanDropProc proc = 0); - + void SetClickProc (pClickProc proc); void SetDblClickProc (pClickProc proc); @@ -87,7 +87,7 @@ public: void Clear() { cardstack.Clear(); } void Reverse() { cardstack.Reverse(); } - + void Push(const Card card) { cardstack.Push(card); } void Push(const CardStack &cs) { cardstack.Push(cs); } @@ -118,7 +118,7 @@ private: bool CanDragCards(int iNumCards); bool CanDropCards(CardStack &cards); - + void CalcApparentCards(); int CalcApparentCards(int realnum); @@ -133,15 +133,15 @@ private: bool OnMouseMove(int x, int y); bool OnLButtonUp(int x, int y); - + // // Private data members // int id; - + CardWindow &parentWnd; - + CardStack cardstack; //cards in this stack CardStack dragstack; //cards which we might be dragging @@ -167,14 +167,14 @@ private: // Used for mouse-dragging / moving cards // int iNumDragCards; - int mousexoffset; + int mousexoffset; int mouseyoffset; int oldx; int oldy; - + int nDragCardWidth; int nDragCardHeight; - + HDC hdcBackGnd; HBITMAP hbmBackGnd; HDC hdcDragCard; @@ -183,7 +183,7 @@ private: int nNumApparentCards; int nThreedCount; bool fVisible; - + int nFlashCount; bool fFlashVisible; UINT uFlashTimer; @@ -197,10 +197,10 @@ private: UINT uDragRule; UINT uDropRule; - + // // Stack callback support - // + // pCanDragProc CanDragCallback; pCanDropProc CanDropCallback; pClickProc ClickCallback; @@ -209,7 +209,7 @@ private: pRemoveProc RemoveCallback; //locking mechanism to prevent user dragging etc - HANDLE mxlock; + HANDLE mxlock; }; #endif diff --git a/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp b/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp index 00c5dafc233..4c95613b338 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp @@ -80,7 +80,7 @@ void DrawHorzCardStrip(HDC hdc, int x, int y, int nCardNum, int height, BOOL fDr // draw the outer-most lips BitBlt(hdc, x, y+two, 1, height-two*tips, __hdcCardBitmaps, sx, sy+two, SRCCOPY); - BitBlt(hdc, x+__cardwidth-1, y+two, 1, height-two*tips, __hdcCardBitmaps, sx+__cardwidth-1, sy+two, SRCCOPY); + BitBlt(hdc, x+__cardwidth-1, y+two, 1, height-two*tips, __hdcCardBitmaps, sx+__cardwidth-1, sy+two, SRCCOPY); } // @@ -107,7 +107,7 @@ void DrawVertCardStrip(HDC hdc, int x, int y, int nCardNum, int width, BOOL fDra BOOL tips = fDrawTips ? FALSE : TRUE; if(width == 0) return; - + if(width < 0) { @@ -145,7 +145,7 @@ void DrawCardCorner(HDC hdc, int x, int y, int cardval, int xdir, int ydir) HDC hdcSource = __hdcCardBitmaps; - if(xdir < 0) + if(xdir < 0) { x += __cardwidth + xdir - 1; sx += __cardwidth + xdir - 1; @@ -156,7 +156,7 @@ void DrawCardCorner(HDC hdc, int x, int y, int cardval, int xdir, int ydir) sx += xdir; } - if(ydir < 0) + if(ydir < 0) { y += __cardheight + ydir - 1; sy += __cardheight + ydir - 1; @@ -212,13 +212,13 @@ void CardRegion::Clip(HDC hdc) { int numtoclip; - if(fVisible == false) + if(fVisible == false) return; Update(); //Update this stack's size+card count numtoclip = nNumApparentCards; - //if we are making this stack flash on/off, then only + //if we are making this stack flash on/off, then only //clip the stack for drawing if the flash is in its ON state if(nFlashCount != 0) { @@ -230,9 +230,9 @@ void CardRegion::Clip(HDC hdc) if(xoffset != 0 && yoffset != 0 && cardstack.NumCards() != 0) { for(int j = 0; j < numtoclip; j ++) - { + { ClipCard(hdc, xpos + xoffset * j, ypos + yoffset * j, __cardwidth, __cardheight); - } + } } //otherwise if just offset along a horizontal/vertical axis else @@ -258,7 +258,7 @@ void CardRegion::Render(HDC hdc) int cardnum = 0; int numtodraw; BOOL fDrawTips; - + Update(); //Update this stack's card count + size numtodraw = nNumApparentCards; @@ -270,26 +270,26 @@ void CardRegion::Render(HDC hdc) } if(fVisible == 0) return; - + cardnum = cardstack.NumCards() - numtodraw; int counter; for(counter = 0; counter < numtodraw; counter++) { int cardval; - + int x = xoffset * counter + xpos; int y = yoffset * counter + ypos; //if about to draw last card, then actually draw the top card if(counter == numtodraw - 1) cardnum = cardstack.NumCards() - 1; - + Card card = cardstack.cardlist[cardnum]; cardval = card.Idx(); - + if(card.FaceDown()) cardval = nBackCardIdx; //card-back - + //only draw the visible part of the card if(counter < numtodraw - 1) { @@ -302,7 +302,7 @@ void CardRegion::Render(HDC hdc) fDrawTips = TRUE; //draw horizontal strips - if(yoffset > 0) + if(yoffset > 0) { DrawHorzCardStrip(hdc, x, y, cardval, yoffset, fDrawTips); } @@ -339,12 +339,12 @@ void CardRegion::Render(HDC hdc) cardnum ++; } //end of index - + if(counter == 0) //if the cardstack is empty, then draw it that way { int x = xpos; int y = ypos; - + switch(uEmptyImage) { default: @@ -354,7 +354,7 @@ void CardRegion::Render(HDC hdc) //PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd)); parentWnd.PaintCardRgn(hdc, x, y, __cardwidth, __cardheight, x, y); break; - + case CS_EI_SUNK: DrawCard(hdc, x, y, __hdcPlaceHolder, __cardwidth, __cardheight); break; @@ -364,7 +364,7 @@ void CardRegion::Render(HDC hdc) CardBlt(hdc, x, y, uEmptyImage); break; } - + } return; @@ -375,7 +375,7 @@ int calc_offset(int offset, int numcards, int numtodrag, int realvisible) if(offset >= 0) return -offset * numcards; else - return -offset * (numtodrag) + + return -offset * (numtodrag) + -offset * (realvisible - 1); } @@ -423,10 +423,10 @@ void CardRegion::PrepareDragBitmaps(int numtodrag) //background buffer, so it appears if we have lifted the card from the stack //PaintRect(hdcBackGnd, &rect, crBackgnd); SetRect(&rect, 0, 0, nDragCardWidth, nDragCardHeight); - + xoff = calc_offset(xoffset, numcards, numtodrag, realvisible); yoff = calc_offset(yoffset, numcards, numtodrag, realvisible); - + parentWnd.PaintCardRgn(hdcBackGnd, 0, 0, nDragCardWidth, nDragCardHeight, xpos - xoff, ypos - yoff); // @@ -438,7 +438,7 @@ void CardRegion::PrepareDragBitmaps(int numtodrag) { Card card = cardstack.cardlist[iwhichcard]; int nCardVal; - + nCardVal = card.FaceUp() ? card.Idx() : nBackCardIdx; xoff = xoffset * icard + calc_offset(xoffset, numcards, numtodrag, realvisible);//- xoffset * ((numcards+numtodrag) / nThreedCount - numtodrag); @@ -447,11 +447,11 @@ void CardRegion::PrepareDragBitmaps(int numtodrag) CardBlt(hdcBackGnd, xoff, yoff, nCardVal); iwhichcard++; } - + // // If there are no cards under this one, just draw the place holder // - if(numcards == 0) + if(numcards == 0) { int xoff = 0, yoff = 0; @@ -491,12 +491,12 @@ void CardRegion::PrepareDragBitmaps(int numtodrag) if(xoffset >= 0) xoff = xoffset * icard; else xoff = -xoffset * (numtodrag - icard - 1); - + if(yoffset >= 0) yoff = yoffset * icard; else yoff = -yoffset * (numtodrag - icard - 1); Card card = dragstack.cardlist[icard]; - + nCardVal = card.FaceUp() ? card.Idx() : nBackCardIdx; CardBlt(hdcDragCard, xoff, yoff, nCardVal); @@ -539,11 +539,11 @@ void CardRegion::PrepareDragBitmapsThreed(int numtodrag) //--PaintRect(hdcBackGnd, &rect, crBackgnd); int threedadjust = numcards % nThreedCount == 0; - + numunder = CalcApparentCards(numcards); iwhichcard = (numcards+numtodrag) - numunder - 1; if(nThreedCount == 1) iwhichcard = 0; - + int xoff = calc_offset(xoffset, numunder, numtodrag, numunder); int yoff = calc_offset(yoffset, numunder, numtodrag, numunder); @@ -559,14 +559,14 @@ void CardRegion::PrepareDragBitmapsThreed(int numtodrag) Card card = cardstack.cardlist[iwhichcard]; int nCardVal = card.FaceUp() ? card.Idx() : nBackCardIdx; - CardBlt(hdcBackGnd, + CardBlt(hdcBackGnd, xoffset * icard - xoffset*(numunder-numtodrag+threedadjust), yoffset * icard - yoffset*(numunder-numtodrag+threedadjust), nCardVal); iwhichcard++; } - + // // If there are no cards under this one, just draw the place holder // @@ -596,7 +596,7 @@ void CardRegion::PrepareDragBitmapsThreed(int numtodrag) // now render the drag-cards into the dragcard image // PaintRect(hdcDragCard, &rect, crBackgnd); - + for(icard = 0; icard < numtodrag; icard++) { Card card = dragstack.cardlist[icard]; diff --git a/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp b/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp index a64bef2a1cd..52c269f2363 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardrgnmouse.cpp @@ -53,7 +53,7 @@ CardRegion *CardWindow::GetBestStack(int x, int y, int w, int h) maxoverlapidx = i; } } - + //if we found a stack to drop onto if(maxoverlapidx != -1) { @@ -69,7 +69,7 @@ bool CardRegion::IsPointInStack(int x, int y) { int axpos = xoffset < 0 ? xpos + (nNumApparentCards-1)*xoffset : xpos; int aypos = yoffset < 0 ? ypos + (nNumApparentCards-1)*yoffset : ypos; - + if(x >= axpos && x < axpos + width && y >= aypos && y < aypos + height && fVisible) return true; else @@ -84,7 +84,7 @@ int CardRegion::GetNumDragCards(int x, int y) //make x,y relative to the stack's upper left corner x -= xpos + (xoffset < 0 ? (nNumApparentCards/*cardstack.NumCards()*/ - 1) * xoffset : 0); y -= ypos + (yoffset < 0 ? (nNumApparentCards/*cardstack.NumCards()*/ - 1) * yoffset : 0); - + //if stack is empty, cannot drag any cards from it if(cardstack.NumCards() <= 0) return 0; @@ -158,19 +158,19 @@ bool CardRegion::CanDragCards(int iNumCards) { case CS_DRAG_ALL: return true; - + case CS_DRAG_TOP: if(iNumCards == 1) return true; else return false; - + case CS_DRAG_NONE: return false; - + case CS_DRAG_CALLBACK: - + if(CanDragCallback) { return CanDragCallback(*this, iNumCards); @@ -179,7 +179,7 @@ bool CardRegion::CanDragCards(int iNumCards) { return false; } - + default: return false; } @@ -203,7 +203,7 @@ bool CardRegion::CanDropCards(CardStack &cards) return false; case CS_DROP_CALLBACK: - + if(CanDropCallback) { return CanDropCallback(*this, cards); @@ -220,7 +220,7 @@ bool CardRegion::CanDropCards(CardStack &cards) bool CardRegion::OnLButtonDblClk(int x, int y) { - iNumDragCards = GetNumDragCards(x, y); + iNumDragCards = GetNumDragCards(x, y); if(DblClickCallback) DblClickCallback(*this, iNumDragCards); @@ -230,7 +230,7 @@ bool CardRegion::OnLButtonDblClk(int x, int y) bool CardRegion::OnLButtonDown(int x, int y) { - iNumDragCards = GetNumDragCards(x, y); + iNumDragCards = GetNumDragCards(x, y); #ifdef _DEBUG if(DebugStackClickProc) @@ -250,13 +250,13 @@ bool CardRegion::OnLButtonDown(int x, int y) //of the cards that are being dragged mousexoffset = x - xpos - xoffset * (nNumApparentCards - iNumDragCards); mouseyoffset = y - ypos - yoffset * (nNumApparentCards - iNumDragCards); - + if(xoffset < 0) mousexoffset += -xoffset * (iNumDragCards - 1); if(yoffset < 0) mouseyoffset += -yoffset * (iNumDragCards - 1); - + //remove the cards from the source stack dragstack = cardstack.Pop(iNumDragCards); @@ -265,7 +265,7 @@ bool CardRegion::OnLButtonDown(int x, int y) oldx = x - mousexoffset; oldy = y - mouseyoffset; - + Update(); //Update this stack's card count + size SetCapture((HWND)parentWnd); @@ -284,7 +284,7 @@ bool CardRegion::OnLButtonUp(int x, int y) CardRegion *pDestStack = 0; HDC hdc; int dropstackid = CS_DROPZONE_NODROP; - + RECT dragrect; DropZone *dropzone; @@ -298,7 +298,7 @@ bool CardRegion::OnLButtonUp(int x, int y) if(dropzone) { dropstackid = dropzone->DropCards(dragstack); - + if(dropstackid != CS_DROPZONE_NODROP) pDestStack = parentWnd.CardRegionFromId(dropstackid); else @@ -308,28 +308,28 @@ bool CardRegion::OnLButtonUp(int x, int y) { pDestStack = parentWnd.GetBestStack(x - mousexoffset, y - mouseyoffset, nDragCardWidth, nDragCardHeight); } - + // If have found a stack to drop onto // TRACE ( "can I drop card?\n" ); - if(pDestStack && pDestStack->CanDropCards(dragstack)) + if(pDestStack && pDestStack->CanDropCards(dragstack)) { TRACE ( "yes, dropping card\n" ); hdc = GetDC((HWND)parentWnd); // UseNicePalette(hdc); ZoomCard(hdc, x - mousexoffset, y - mouseyoffset, pDestStack); ReleaseDC((HWND)parentWnd, hdc); - + // //add the cards to the destination stack // CardStack temp = pDestStack->GetCardStack(); temp.Push(dragstack); - + pDestStack->SetCardStack(temp); // pDestStack->Update(); //Update this stack's card count + size // pDestStack->UpdateFaceDir(temp); - + // Call the remove callback on THIS stack, if one is specified // if(RemoveCallback) @@ -339,7 +339,7 @@ bool CardRegion::OnLButtonUp(int x, int y) // if(pDestStack->AddCallback) pDestStack->AddCallback(*pDestStack, pDestStack->cardstack);//index, deststack->numcards); - + RedrawIfNotDim(pDestStack, true); TRACE ( "done dropping card\n" ); } @@ -362,10 +362,10 @@ bool CardRegion::OnLButtonUp(int x, int y) Update(); //Update this stack's card count + size TRACE ( "done putting card back\n" ); } - + ReleaseDragBitmaps(); ReleaseCapture(); - + TRACE ( "OnLButtonUp() done\n" ); return true; } @@ -375,20 +375,20 @@ bool CardRegion::OnMouseMove(int x, int y) HDC hdc; hdc = GetDC((HWND)parentWnd); - + x -= mousexoffset; y -= mouseyoffset; - + MoveDragCardTo(hdc, x, y); //BitBlt(hdc, nDragCardWidth+10, 0, nDragCardWidth, nDragCardHeight, hdcBackGnd, 0, 0, SRCCOPY); //BitBlt(hdc, 0, 0, nDragCardWidth, nDragCardHeight, hdcDragCard, 0, 0, SRCCOPY); - + ReleaseDC((HWND)parentWnd, hdc); - + oldx = x; oldy = y; - + return true; } @@ -423,48 +423,48 @@ void CardRegion::MoveDragCardTo(HDC hdc, int x, int y) //mask off the new position of the drag-card, so //that it will not be painted over ClipCard(hdc, x, y, nDragCardWidth, nDragCardHeight); - + //restore the area covered by the card at its previous position BitBlt(hdc, oldx, oldy, nDragCardWidth, nDragCardHeight, hdcBackGnd, 0, 0, SRCCOPY); //remove clipping so we can draw the card at its new place SelectClipRgn(hdc, NULL); - + //if the card's old and new positions overlap, then we //need some funky code to update the "saved background" image, SetRect(&rect1, oldx, oldy, oldx+nDragCardWidth, oldy+nDragCardHeight); SetRect(&rect2, x, y, x+nDragCardWidth, y+nDragCardHeight); - + if(IntersectRect(&inter, &rect1, &rect2)) { int interwidth = inter.right-inter.left; int interheight = inter.bottom-inter.top; int destx, desty, srcx, srcy; - - if(rect2.left > rect1.left) - { - destx = 0; srcx = nDragCardWidth - interwidth; + + if(rect2.left > rect1.left) + { + destx = 0; srcx = nDragCardWidth - interwidth; } else { destx = nDragCardWidth - interwidth; srcx = 0; } - - if(rect2.top > rect1.top) + + if(rect2.top > rect1.top) { desty = 0; srcy = nDragCardHeight - interheight; } - else + else { desty = nDragCardHeight - interheight; srcy = 0; } - + //shift the bit we didn't use for the restore (due to the clipping) //into the opposite corner BitBlt(hdcBackGnd, destx,desty, interwidth, interheight, hdcBackGnd, srcx, srcy, SRCCOPY); - + ExcludeClipRect(hdcBackGnd, destx, desty, destx+interwidth, desty+interheight); - + //this bit requires us to clip the BitBlt (from screen to background) //as BitBlt is a bit buggy it seems ClippedBitBlt(hdcBackGnd, 0,0, nDragCardWidth, nDragCardHeight, hdc, x, y, SRCCOPY); @@ -474,7 +474,7 @@ void CardRegion::MoveDragCardTo(HDC hdc, int x, int y) { BitBlt(hdcBackGnd, 0,0, nDragCardWidth, nDragCardHeight, hdc, x, y, SRCCOPY); } - + //finally draw the card to the screen DrawCard(hdc, x, y, hdcDragCard, nDragCardWidth, nDragCardHeight); } @@ -494,7 +494,7 @@ void ZoomCard(HDC hdc, int xpos, int ypos, CARDSTACK *dest) { long dx, dy, x , y; - + int apparentcards; x = xpos << PRECISION; y = ypos << PRECISION; @@ -503,7 +503,7 @@ void ZoomCard(HDC hdc, int xpos, int ypos, CARDSTACK *dest) apparentcards=dest->numcards/dest->threedcount; - int idestx = dest->xpos + dest->xoffset * (apparentcards);// - iNumDragCards); + int idestx = dest->xpos + dest->xoffset * (apparentcards);// - iNumDragCards); int idesty = dest->ypos + dest->yoffset * (apparentcards);// - iNumDragCards); //normalise the motion vector @@ -511,7 +511,7 @@ void ZoomCard(HDC hdc, int xpos, int ypos, CARDSTACK *dest) dy = (idesty<xoffset < 0) xdraw = -pDestStack->xoffset * (iNumDragCards-i-1); - if(pDestStack->facedirection == CS_FACEUP && + if(pDestStack->facedirection == CS_FACEUP && pDestStack->numcards+i >= dest->numfacedown) { //cdtDraw(hdcDragCard, xdraw, ydraw, iDragCards[i], ectFACES, 0); diff --git a/reactos/base/applications/games/solitaire/cardlib/cardstack.cpp b/reactos/base/applications/games/solitaire/cardlib/cardstack.cpp index 8273b232401..b3971e267dc 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardstack.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardstack.cpp @@ -61,10 +61,10 @@ void CardStack::Shuffle() //want to do this: // bad: src = rand() % (dest + 1) // good: src = rand() / (RAND_MAX / (dest+1) + 1) - + //positions from 0 to dest src = rand() / (RAND_MAX / (dest+1) + 1); - + //swap the cards temp = cardlist[src]; cardlist[src] = cardlist[dest]; @@ -93,7 +93,7 @@ void CardStack::Push(const CardStack &cardstack) if(nNumCards + cardstack.nNumCards < MAX_CARDSTACK_SIZE) { int num = cardstack.NumCards(); - + for(int i = 0; i < num; i++) cardlist[nNumCards++] = cardstack.cardlist[i]; } diff --git a/reactos/base/applications/games/solitaire/cardlib/cardstack.h b/reactos/base/applications/games/solitaire/cardlib/cardstack.h index 03d98f1415f..a7898d79551 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardstack.h +++ b/reactos/base/applications/games/solitaire/cardlib/cardstack.h @@ -17,7 +17,7 @@ public: void Shuffle(); void Clear(); void Reverse(); - + void Push(const Card card); void Push(const CardStack &cardstack); @@ -41,8 +41,8 @@ public: CardStack operator + (Card card); CardStack operator + (CardStack &cs); - -private: + +private: CardStack(CardStack ©this, size_t fromindex); diff --git a/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp b/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp index 7f7c0228f10..400985e1215 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardwindow.cpp @@ -94,7 +94,7 @@ CardWindow::CardWindow() : m_hWnd(0) __hPalette = CreateCardPalette(); __hdcPlaceHolder = CreateCompatibleDC(hdc); - + __holdplacepal = UseNicePalette(__hdcPlaceHolder, __hPalette); __hbmPlaceHolder = CreateSinkBmp(hdc, __hdcPlaceHolder, crBackgnd, __cardwidth, __cardheight); @@ -118,9 +118,9 @@ BOOL CardWindow::Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, return FALSE; //Create the window associated with this object - m_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, szCardName, 0, + m_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, szCardName, 0, WS_CHILD | WS_VISIBLE, - 0,0,100,100, + 0,0,100,100, hwndParent, 0, GetModuleHandle(0), this); return TRUE; @@ -183,7 +183,7 @@ void CardWindow::SetBackColor(COLORREF cr) { crBackgnd = cr; int i; - + // // Create the exact palette we need to render the buttons/stacks // @@ -249,7 +249,7 @@ CardButton* CardWindow::CardButtonFromPoint(int x, int y) return bptr; } - return 0; + return 0; } CardRegion* CardWindow::CardRegionFromPoint(int x, int y) @@ -266,7 +266,7 @@ CardRegion* CardWindow::CardRegionFromPoint(int x, int y) return Regions[i]; } - return 0; + return 0; } // @@ -297,7 +297,7 @@ void CardWindow::Paint(HDC hdc) } // - // Clip the buttons + // Clip the buttons // for(i = 0; i < nNumButtons; i++) { @@ -305,10 +305,10 @@ void CardWindow::Paint(HDC hdc) } - // Now paint the whole screen with background colour, + // Now paint the whole screen with background colour, // GetClientRect(m_hWnd, &rect); - + //PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd)); PaintCardRgn(hdc, 0, 0, rect.right, rect.bottom, 0, 0); SelectClipRgn(hdc, NULL); @@ -326,7 +326,7 @@ void CardWindow::Paint(HDC hdc) { Regions[i]->Render(hdc); } - + // Paint each button now // SelectClipRgn(hdc, NULL); @@ -377,7 +377,7 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM case WM_SIZE: nWidth = LOWORD(lParam); nHeight = HIWORD(lParam); - + // // reposition all the stacks and buttons // in case any of them are centered, right-justified etc @@ -386,17 +386,17 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM { Regions[i]->AdjustPosition(nWidth, nHeight); } - + for(i = 0; i < nNumButtons; i++) { Buttons[i]->AdjustPosition(nWidth, nHeight); } - // + // // Call the user-defined resize proc AFTER all the stacks // have been positioned // - if(ResizeWndCallback) + if(ResizeWndCallback) ResizeWndCallback(nWidth, nHeight); return 0; @@ -411,7 +411,7 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM return 0; case WM_TIMER: - + //find the timer object in the registered funcs /*if(wParam >= 0x10000) { @@ -420,10 +420,10 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM if(RegFuncs[i].id == wParam) { KillTimer(hwnd, wParam); - + //call the registered function!! RegFuncs[i].func(RegFuncs[i].dwParam); - + RegFuncs[i] = RegFuncs[nRegFuncs-1]; nRegFuncs--; } @@ -476,11 +476,11 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM if(!stackptr->OnLButtonDown(x, y)) stackptr = 0; } - + return 0; case WM_LBUTTONUP: - + x = (short)LOWORD(lParam); y = (short)HIWORD(lParam); @@ -493,7 +493,7 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM buttonptr = 0; return 0; } - + if(stackptr != 0) { stackptr->OnLButtonUp(x, y); @@ -504,7 +504,7 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM return 0; case WM_MOUSEMOVE: - + x = (short)LOWORD(lParam); y = (short)HIWORD(lParam); @@ -519,7 +519,7 @@ LRESULT CALLBACK CardWindow::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM { return stackptr->OnMouseMove(x, y); } - + return 0; } @@ -563,7 +563,7 @@ bool CardWindow::DeleteButton(CardButton *pButton) if(Buttons[i] == pButton) { CardButton *cb = Buttons[i]; - + //shift any after this one backwards for(int j = i; j < nNumButtons - 1; j++) { @@ -572,7 +572,7 @@ bool CardWindow::DeleteButton(CardButton *pButton) delete cb; nNumButtons--; - + return true; } } @@ -587,7 +587,7 @@ bool CardWindow::DeleteRegion(CardRegion *pRegion) if(Regions[i] == pRegion) { CardRegion *cr = Regions[i]; - + //shift any after this one backwards for(int j = i; j < nNumCardRegions - 1; j++) { @@ -641,7 +641,7 @@ bool CardWindow::DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, in if(Regions[i]->IsVisible()) numvisiblestacks++; } - + if(xJustify == CS_XJUST_CENTER) { //startx -= ((numvisiblestacks + spacing) * cardwidth - spacing) / 2; @@ -658,7 +658,7 @@ bool CardWindow::DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, in Regions[i]->xjustify = CS_XJUST_CENTER; curx += Regions[i]->width + xSpacing; } - + } } @@ -666,7 +666,7 @@ bool CardWindow::DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, in { nStartX -= ((numvisiblestacks + xSpacing) * __cardwidth - xSpacing); } - + if(xJustify == CS_XJUST_NONE) { for(i = startindex; i < startindex + nNumStacks; i++) @@ -677,7 +677,7 @@ bool CardWindow::DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, in curx += Regions[i]->width + xSpacing; Regions[i]->UpdateSize(); } - + } } @@ -748,7 +748,7 @@ void CardWindow::PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, in if(hbmBackImage == 0) { SetRect(&rect, dx, dy, dx+width, dy+height); - + /*if(GetVersion() < 0x80000000) { PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd)); @@ -763,7 +763,7 @@ void CardWindow::PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, in //otherwise, paint using the bitmap else { - // Draw whatever part of background we can + // Draw whatever part of background we can BitBlt(hdc, dx, dy, width, height, hdcBackImage, sx, sy, SRCCOPY); // Now we need to paint any area outside the bitmap, @@ -778,14 +778,14 @@ void CardWindow::PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, in HRGN hr2 = CreateRectRgn(0, 0, bm.bmWidth, bm.bmHeight); HRGN hr3 = CreateRectRgn(0,0, 1, 1); HRGN hr4 = CreateRectRgn(0,0, 1, 1); - + CombineRgn(hr3, hr1, hr2, RGN_DIFF); - + GetClipRgn(hdc, hr4); - + CombineRgn(hr3, hr4, hr3, RGN_AND); SelectClipRgn(hdc, hr3); - + // Fill remaining space not filled with bitmap HBRUSH hbr = CreateSolidBrush(crBackgnd); FillRgn(hdc, hr3, hbr); @@ -793,7 +793,7 @@ void CardWindow::PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, in // Clean up SelectClipRgn(hdc, hr4); - + DeleteObject(hr1); DeleteObject(hr2); DeleteObject(hr3); diff --git a/reactos/base/applications/games/solitaire/cardlib/cardwindow.h b/reactos/base/applications/games/solitaire/cardlib/cardwindow.h index fdfc1decdcc..ed3fccb2f4c 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardwindow.h +++ b/reactos/base/applications/games/solitaire/cardlib/cardwindow.h @@ -17,7 +17,7 @@ class CardWindow { friend class CardRegion; friend class CardButton; - + friend void RegisterCardWindow(); public: @@ -57,7 +57,7 @@ public: void SetResizeProc(pResizeWndProc proc); int GetWidth() { return nWidth; } int GetHeight() { return nHeight; } - + // // Dropzone support // @@ -93,7 +93,7 @@ static LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM HWND m_hWnd; //window handle! int nWidth, nHeight; - + UINT nBackCardIdx; //all stacks share this card index by default HBITMAP hbmBackImage; diff --git a/reactos/base/applications/games/solitaire/cardlib/dropzone.cpp b/reactos/base/applications/games/solitaire/cardlib/dropzone.cpp index d3ec111b460..0db5d3f85b0 100644 --- a/reactos/base/applications/games/solitaire/cardlib/dropzone.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/dropzone.cpp @@ -16,7 +16,7 @@ bool CardWindow::RegisterDropZone(int id, RECT *rect, pDropZoneProc proc) return false; DropZone *dz = new DropZone(id, rect, proc); - + dropzone[nNumDropZones++] = dz; return false; @@ -28,7 +28,7 @@ DropZone *CardWindow::GetDropZoneFromRect(RECT *rect) { RECT inter; RECT zone; - + //if any part of the drag rectangle falls within a drop zone, //let that take priority over any other card stack. dropzone[i]->GetZone(&zone); @@ -51,7 +51,7 @@ bool CardWindow::DeleteDropZone(int id) if(dropzone[i]->id == id) { DropZone *dz = dropzone[i]; - + //shift any after this one backwards for(int j = i; j < nNumDropZones - 1; j++) { @@ -61,7 +61,7 @@ bool CardWindow::DeleteDropZone(int id) delete dz; nNumDropZones--; return true; - } + } } return false; diff --git a/reactos/base/applications/games/solitaire/cardlib/dropzone.h b/reactos/base/applications/games/solitaire/cardlib/dropzone.h index 65224eb5695..1c7e0e538d5 100644 --- a/reactos/base/applications/games/solitaire/cardlib/dropzone.h +++ b/reactos/base/applications/games/solitaire/cardlib/dropzone.h @@ -12,7 +12,7 @@ class DropZone { friend class CardWindow; - DropZone(int Id, RECT *rect, pDropZoneProc proc) : + DropZone(int Id, RECT *rect, pDropZoneProc proc) : id(Id), DropZoneCallback(proc) { CopyRect(&zone, rect); } public: @@ -21,7 +21,7 @@ public: void GetZone(RECT *rect) { CopyRect(rect, &zone); } void SetCallback(pDropZoneProc callback) { DropZoneCallback = callback; } - int DropCards(CardStack &cardstack) + int DropCards(CardStack &cardstack) { if(DropZoneCallback) return DropZoneCallback(id, cardstack); diff --git a/reactos/base/applications/games/solitaire/lang/lt-LT.rc b/reactos/base/applications/games/solitaire/lang/lt-LT.rc index fdba11ad509..c820d9316d2 100644 --- a/reactos/base/applications/games/solitaire/lang/lt-LT.rc +++ b/reactos/base/applications/games/solitaire/lang/lt-LT.rc @@ -4,7 +4,7 @@ * FILE: base/applications/games/solitaire/lang/lt-LT.rc * PURPOSE: Lithuanian Language File for Solitaire * PROGRAMMERS: Daniel "EmuandCo" Reimer (reimer.daniel@freenet.de) - * TRANSLATORS: Vytis "CMan" Girdþijauskas (cman@cman.us) + * TRANSLATORS: Vytis "CMan" Girdþijauskas (cman@cman.us) */ #include "resource.h" diff --git a/reactos/base/applications/games/solitaire/lang/sk-SK.rc b/reactos/base/applications/games/solitaire/lang/sk-SK.rc index e5acfb1c132..2ad078f6e83 100644 --- a/reactos/base/applications/games/solitaire/lang/sk-SK.rc +++ b/reactos/base/applications/games/solitaire/lang/sk-SK.rc @@ -57,7 +57,7 @@ END /* Menus */ -IDR_MENU1 MENU DISCARDABLE +IDR_MENU1 MENU DISCARDABLE BEGIN POPUP "&Hra" BEGIN diff --git a/reactos/base/applications/games/solitaire/lang/th-TH.rc b/reactos/base/applications/games/solitaire/lang/th-TH.rc index b97d4b8a896..965e496aa6b 100644 --- a/reactos/base/applications/games/solitaire/lang/th-TH.rc +++ b/reactos/base/applications/games/solitaire/lang/th-TH.rc @@ -56,7 +56,7 @@ END /* Menus */ -IDR_MENU1 MENU DISCARDABLE +IDR_MENU1 MENU DISCARDABLE BEGIN POPUP "à&¡Á" BEGIN diff --git a/reactos/base/applications/games/solitaire/solcreate.cpp b/reactos/base/applications/games/solitaire/solcreate.cpp index 76d2c0e98ec..6d2b3c561bb 100644 --- a/reactos/base/applications/games/solitaire/solcreate.cpp +++ b/reactos/base/applications/games/solitaire/solcreate.cpp @@ -68,8 +68,8 @@ void CreateSol() pRowStack[i] = SolWnd.CreateRegion(ROW_ID+i, true, 0, Y_BORDER + __cardheight + Y_ROWSTACK_BORDER, 0, yRowStackCardOffset); pRowStack[i]->SetEmptyImage(CS_EI_SUNK); pRowStack[i]->SetFaceDirection(CS_FACE_DOWNUP, i); - - pRowStack[i]->SetPlacement(CS_XJUST_CENTER, 0, + + pRowStack[i]->SetPlacement(CS_XJUST_CENTER, 0, (i - NUM_ROW_STACKS/2) * (__cardwidth + X_ROWSTACK_BORDER), 0); pRowStack[i]->SetEmptyImage(CS_EI_NONE); diff --git a/reactos/base/applications/games/solitaire/solgame.cpp b/reactos/base/applications/games/solitaire/solgame.cpp index 00b5e84e1fb..6b61783d6c0 100644 --- a/reactos/base/applications/games/solitaire/solgame.cpp +++ b/reactos/base/applications/games/solitaire/solgame.cpp @@ -24,7 +24,7 @@ void NewGame(void) int i, j; SolWnd.EmptyStacks(); - + //create a new card-stack CardStack deck; deck.NewDeck(); @@ -88,7 +88,7 @@ bool CARDLIBPROC RowStackDragProc(CardRegion &stackobj, int iNumDragCards) } // -// Row a row-stack, we can only drop cards +// Row a row-stack, we can only drop cards // that are lower / different colour // bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, const CardStack &dragcards) @@ -108,7 +108,7 @@ bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, const CardStack &dragca else { const CardStack &mystack = stackobj.GetCardStack(); - + //can only drop if card is 1 less if(mystack[0].LoVal() != dragcard.LoVal() + 1) { @@ -194,7 +194,7 @@ void CARDLIBPROC RowStackClickProc(CardRegion &stackobj, int iNumClicked) { TRACE("ENTER RowStackClickProc()\n"); int numfacedown; - + stackobj.GetFaceDirection(&numfacedown); //if all face-down, then make top card face-up @@ -249,7 +249,7 @@ void CARDLIBPROC SuitStackAddProc(CardRegion &stackobj, const CardStack &added) if(fGameOver) { MessageBox(SolWnd, MsgWin, szAppName, MB_OK | MB_ICONINFORMATION); - + for(int i = 0; i < 4; i++) { pSuitStack[i]->Flash(11, 100); @@ -277,7 +277,7 @@ void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked) //find a suit-stack to move the card to... const CardStack &cardstack = stackobj.GetCardStack(); CardRegion *pDest = FindSuitStackFromCard(cardstack[0]); - + if(pDest != 0) { fGameStarted = true; diff --git a/reactos/base/applications/games/solitaire/solitaire.cpp b/reactos/base/applications/games/solitaire/solitaire.cpp index 447c0abd9a5..260d5a49fdf 100644 --- a/reactos/base/applications/games/solitaire/solitaire.cpp +++ b/reactos/base/applications/games/solitaire/solitaire.cpp @@ -277,7 +277,7 @@ VOID ShowGameOptionsDlg(HWND hwnd) } -LRESULT CALLBACK +LRESULT CALLBACK CardImageWndProc(HWND hwnd, UINT msg, WPARAM wParam, @@ -464,7 +464,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) //SendMessage(hwndStatus, SB_SIMPLE, (WPARAM)TRUE, 0); - SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts); + SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts); SendMessage(hwndStatus, SB_SETTEXT, 0 | SBT_NOBORDERS, (LPARAM)""); SolWnd.Create(hwnd, WS_EX_CLIENTEDGE, WS_CHILD|WS_VISIBLE, 0, 0, 0, 0); @@ -502,7 +502,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) MoveWindow(SolWnd, 0, 0, nWidth, nHeight, TRUE); } //parts[0] = nWidth - 256; - //SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts); + //SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts); return 0; case WM_GETMINMAXINFO: diff --git a/reactos/base/applications/games/solitaire/solitaire.rbuild b/reactos/base/applications/games/solitaire/solitaire.rbuild index d1e45d2739c..c9d1b8920a3 100644 --- a/reactos/base/applications/games/solitaire/solitaire.rbuild +++ b/reactos/base/applications/games/solitaire/solitaire.rbuild @@ -8,9 +8,9 @@ 0x0501 0x0501 kernel32 - user32 - gdi32 - comctl32 + user32 + gdi32 + comctl32 solcreate.cpp solgame.cpp solitaire.cpp diff --git a/reactos/base/applications/games/winemine/lang/fr-FR.rc b/reactos/base/applications/games/winemine/lang/fr-FR.rc index 265f5f034b3..f81156bb819 100644 --- a/reactos/base/applications/games/winemine/lang/fr-FR.rc +++ b/reactos/base/applications/games/winemine/lang/fr-FR.rc @@ -5,7 +5,7 @@ * Initial file : http://svn.reactos.org/viewcvs/trunk/reactos/base/applications/games/winemine/En.rc * Revision : 85 */ - + LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL STRINGTABLE { diff --git a/reactos/base/applications/games/winemine/lang/pl-PL.rc b/reactos/base/applications/games/winemine/lang/pl-PL.rc index baf0f9e2c22..75faf8ab452 100644 --- a/reactos/base/applications/games/winemine/lang/pl-PL.rc +++ b/reactos/base/applications/games/winemine/lang/pl-PL.rc @@ -1,6 +1,6 @@ //Polish translation Emil Kaczmarek 2006 /* - * small changes by TestamenT + * small changes by TestamenT * testament@users.sourceforge.net * https://sourceforge.net/projects/reactospl */ diff --git a/reactos/base/applications/hh/hh.rbuild b/reactos/base/applications/hh/hh.rbuild index 38d3f10c67e..3462848c999 100644 --- a/reactos/base/applications/hh/hh.rbuild +++ b/reactos/base/applications/hh/hh.rbuild @@ -1,7 +1,7 @@ - . + . 0x0600 0x0501 diff --git a/reactos/base/applications/hh/main.c b/reactos/base/applications/hh/main.c index ee3a8e0bebd..4985103732f 100644 --- a/reactos/base/applications/hh/main.c +++ b/reactos/base/applications/hh/main.c @@ -1,23 +1,23 @@ -#include - -typedef int WINAPI DOWINMAIN(HMODULE hMod, LPSTR cmdline); - -int WINAPI -WinMain(HINSTANCE hInst, - HINSTANCE hPrevInst, - LPSTR cmdline, - int cmdshow) -{ - HMODULE hModule; - DOWINMAIN *doWinMain; - int ret = -1; - - hModule = LoadLibraryA("hhctrl.ocx"); - doWinMain = (DOWINMAIN*) GetProcAddress(hModule, "doWinMain"); - - ret = doWinMain(hInst, cmdline); - - FreeLibrary(hModule); - - return ret; -} +#include + +typedef int WINAPI DOWINMAIN(HMODULE hMod, LPSTR cmdline); + +int WINAPI +WinMain(HINSTANCE hInst, + HINSTANCE hPrevInst, + LPSTR cmdline, + int cmdshow) +{ + HMODULE hModule; + DOWINMAIN *doWinMain; + int ret = -1; + + hModule = LoadLibraryA("hhctrl.ocx"); + doWinMain = (DOWINMAIN*) GetProcAddress(hModule, "doWinMain"); + + ret = doWinMain(hInst, cmdline); + + FreeLibrary(hModule); + + return ret; +} diff --git a/reactos/base/applications/hostname/hostname.c b/reactos/base/applications/hostname/hostname.c index 42f0c044404..4c090c30f42 100644 --- a/reactos/base/applications/hostname/hostname.c +++ b/reactos/base/applications/hostname/hostname.c @@ -19,7 +19,7 @@ /* $Id$ * * COPYRIGHT : See COPYING in the top level directory - * PROJECT : ReactOS/Win32 get host name + * PROJECT : ReactOS/Win32 get host name * FILE : subsys/system/hostname/hostname.c * PROGRAMMER: Emanuele Aliberti (ea@reactos.com) */ diff --git a/reactos/base/applications/logoff/logoff.c b/reactos/base/applications/logoff/logoff.c index d333fc97815..023386b5b9d 100644 --- a/reactos/base/applications/logoff/logoff.c +++ b/reactos/base/applications/logoff/logoff.c @@ -5,12 +5,12 @@ * PURPOSE: Logoff current session, or another session, potentially on another machine * AUTHOR: 30.07.2007 - Frode Lillerud */ - + /* Note * This application is a lightweight version of shutdown.exe. It is intended to be function-compatible * with Windows' system32\logoff.exe commandline application. */ - + #define NDEBUG #include "precomp.h" @@ -18,18 +18,18 @@ LPTSTR szRemoteServerName = NULL; BOOL bVerbose; -//---------------------------------------------------------------------- +//---------------------------------------------------------------------- // //Retrieve resource string and output the Usage to the console // //---------------------------------------------------------------------- static void PrintUsage() { LPTSTR lpUsage = NULL; - + if (AllocAndLoadString(&lpUsage, GetModuleHandle(NULL), IDS_USAGE)) { _putts(lpUsage); } - + } //---------------------------------------------------------------------- @@ -41,7 +41,7 @@ void DisplayLastError() { int errorCode = GetLastError(); LPTSTR lpMsgBuf; - + // Display the error message to the user FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, @@ -51,10 +51,10 @@ void DisplayLastError() (LPTSTR) &lpMsgBuf, 0, NULL); - + _ftprintf(stderr, lpMsgBuf); _ftprintf(stderr, _T("Error code: %d\n"), errorCode); - + LocalFree(lpMsgBuf); } @@ -67,10 +67,10 @@ BOOL ParseCommandLine(int argc, TCHAR *argv[]) { int i; LPTSTR lpIllegalMsg; - + //FIXME: Add handling of commandline arguments to select the session number and name, and also name of remote machine //Example: logoff.exe 4 /SERVER:Master should logoff session number 4 on remote machine called Master. - + for (i = 1; i < argc; i++) { switch(argv[i][0]){ case '-': @@ -83,11 +83,11 @@ BOOL ParseCommandLine(int argc, TCHAR *argv[]) // -? (usage) else if(argv[i][1] == '?') { return FALSE; //display the Usage - } + } default: //Invalid parameter detected if (AllocAndLoadString(&lpIllegalMsg, GetModuleHandle(NULL), IDS_ILLEGAL_PARAM)) - _putts(lpIllegalMsg); + _putts(lpIllegalMsg); return FALSE; } } @@ -107,20 +107,20 @@ int _tmain(int argc, TCHAR *argv[]) // // Parse command line // - if (!ParseCommandLine(argc, argv)) { + if (!ParseCommandLine(argc, argv)) { PrintUsage(); return 1; } - + // //Should we log off session on remote server? // if (szRemoteServerName) { - if (bVerbose) { + if (bVerbose) { if (AllocAndLoadString(&lpLogoffRemote, GetModuleHandle(NULL), IDS_LOGOFF_REMOTE)) - _putts(lpLogoffRemote); + _putts(lpLogoffRemote); } - + //FIXME: Add Remote Procedure Call to logoff user on a remote machine _ftprintf(stderr, "Remote Procedure Call in logoff.exe has not been implemented"); } @@ -131,16 +131,16 @@ int _tmain(int argc, TCHAR *argv[]) if (bVerbose) { //Get resource string, and print it. if (AllocAndLoadString(&lpLogoffLocal, GetModuleHandle(NULL), IDS_LOGOFF_LOCAL)) - _putts(lpLogoffLocal); + _putts(lpLogoffLocal); } - + //Actual logoff if (!ExitWindows(NULL, NULL)) { DisplayLastError(); return 1; } } - + return 0; } /* EOF */ diff --git a/reactos/base/applications/mmc/lang/pl-PL.rc b/reactos/base/applications/mmc/lang/pl-PL.rc index 505c3df0fa5..e6a90d8d6bf 100644 --- a/reactos/base/applications/mmc/lang/pl-PL.rc +++ b/reactos/base/applications/mmc/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translated by xrogers -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT diff --git a/reactos/base/applications/mmc/mmc.rbuild b/reactos/base/applications/mmc/mmc.rbuild index b1127ade988..9b42d93ef68 100644 --- a/reactos/base/applications/mmc/mmc.rbuild +++ b/reactos/base/applications/mmc/mmc.rbuild @@ -1,7 +1,7 @@ - . + . 0x0600 0x0501 diff --git a/reactos/base/applications/msconfig/lang/bg-BG.rc b/reactos/base/applications/msconfig/lang/bg-BG.rc index 2bd67cb3ce2..48b4d2ebfd4 100644 --- a/reactos/base/applications/msconfig/lang/bg-BG.rc +++ b/reactos/base/applications/msconfig/lang/bg-BG.rc @@ -89,7 +89,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "Ðàç&øèðåíè íàñòðîéêè...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 90, 12 + PUSHBUTTON "Ðàç&øèðåíè íàñòðîéêè...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 90, 12 LTEXT "&Èç÷àêâàíå:", -1, 265, 91, 40, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "ñåê.", -1, 340, 91, 15, 10 @@ -125,9 +125,9 @@ BEGIN IDS_MSCONFIG "Ïðèëîæåíèå çà íàñòðîéêà íà ñèñòåìàòà" IDS_TAB_GENERAL "Îáùè" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Óñëóãè" - IDS_TAB_STARTUP "Çàïóñê" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Óñëóãè" + IDS_TAB_STARTUP "Çàïóñê" IDS_TAB_TOOLS "Ñðåäñòâà" END @@ -171,6 +171,6 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Çàïóñíàò" IDS_SERVICES_STATUS_STOPPED "Ñïðÿí" IDS_SERVICES_YES "Äà" - IDS_SERVICES_UNKNOWN "Íåèçâåñòåí" + IDS_SERVICES_UNKNOWN "Íåèçâåñòåí" END diff --git a/reactos/base/applications/msconfig/lang/ca-ES.rc b/reactos/base/applications/msconfig/lang/ca-ES.rc index d6e65113d48..121e043ae10 100644 --- a/reactos/base/applications/msconfig/lang/ca-ES.rc +++ b/reactos/base/applications/msconfig/lang/ca-ES.rc @@ -88,7 +88,7 @@ BEGIN CHECKBOX "/BOO&TLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "Op&cions Avançades...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "Op&cions Avançades...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "Temps:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "sec.", -1, 340, 91, 15, 10 @@ -124,9 +124,9 @@ BEGIN IDS_MSCONFIG "Programa de configuracio de sistema" IDS_TAB_GENERAL "General" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Serveis" - IDS_TAB_STARTUP "Arrencada" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Serveis" + IDS_TAB_STARTUP "Arrencada" IDS_TAB_TOOLS "Eines" END @@ -170,5 +170,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "En marxa" IDS_SERVICES_STATUS_STOPPED "Parat" IDS_SERVICES_YES "Si" - IDS_SERVICES_UNKNOWN "Indeterminat" + IDS_SERVICES_UNKNOWN "Indeterminat" END diff --git a/reactos/base/applications/msconfig/lang/cs-CZ.rc b/reactos/base/applications/msconfig/lang/cs-CZ.rc index 4e5bc643823..82703b13a6d 100644 --- a/reactos/base/applications/msconfig/lang/cs-CZ.rc +++ b/reactos/base/applications/msconfig/lang/cs-CZ.rc @@ -88,7 +88,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 56, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "&Upøesnit možnosti...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "&Upøesnit možnosti...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Limit:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "sek.", -1, 340, 91, 15, 10 @@ -124,9 +124,9 @@ BEGIN IDS_MSCONFIG "Nástroj pro konfiguraci systému" IDS_TAB_GENERAL "Obecné" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Služby" - IDS_TAB_STARTUP "Po spuštìní" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Služby" + IDS_TAB_STARTUP "Po spuštìní" IDS_TAB_TOOLS "Nástroje" END @@ -170,5 +170,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Spuštìno" IDS_SERVICES_STATUS_STOPPED "Zastaveno" IDS_SERVICES_YES "Ano" - IDS_SERVICES_UNKNOWN "Neznámý" + IDS_SERVICES_UNKNOWN "Neznámý" END diff --git a/reactos/base/applications/msconfig/lang/de-DE.rc b/reactos/base/applications/msconfig/lang/de-DE.rc index 7dd05031004..42aba31b71b 100644 --- a/reactos/base/applications/msconfig/lang/de-DE.rc +++ b/reactos/base/applications/msconfig/lang/de-DE.rc @@ -89,7 +89,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "E&rweiterte Optionen...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 90, 12 + PUSHBUTTON "E&rweiterte Optionen...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 90, 12 LTEXT "&Zeitlimit:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "Sek.", -1, 340, 91, 15, 10 @@ -125,9 +125,9 @@ BEGIN IDS_MSCONFIG "Systemkonfigurationsprogramm" IDS_TAB_GENERAL "Allgemein" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Dienste" - IDS_TAB_STARTUP "Systemstart" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Dienste" + IDS_TAB_STARTUP "Systemstart" IDS_TAB_TOOLS "Tools" END @@ -145,7 +145,7 @@ BEGIN IDS_TOOLS_COLUMN_DESCR "Beschreibung" IDS_TOOLS_CMD_NAME "Konsole" - IDS_TOOLS_CMD_DESCR "" + IDS_TOOLS_CMD_DESCR "" IDS_TOOLS_CMD_CMD "cmd.exe" IDS_TOOLS_INFO_NAME "Version" @@ -171,5 +171,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Gestartet" IDS_SERVICES_STATUS_STOPPED "Beendet" IDS_SERVICES_YES "Ja" - IDS_SERVICES_UNKNOWN "Unbekannt" + IDS_SERVICES_UNKNOWN "Unbekannt" END diff --git a/reactos/base/applications/msconfig/lang/en-US.rc b/reactos/base/applications/msconfig/lang/en-US.rc index 97bcc30a8e7..28722dea2cc 100644 --- a/reactos/base/applications/msconfig/lang/en-US.rc +++ b/reactos/base/applications/msconfig/lang/en-US.rc @@ -88,7 +88,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "Ad&vanced Options...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "Ad&vanced Options...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Timeout:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "sec.", -1, 340, 91, 15, 10 @@ -124,9 +124,9 @@ BEGIN IDS_MSCONFIG "System configuration program" IDS_TAB_GENERAL "General" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Services" - IDS_TAB_STARTUP "Startup" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Services" + IDS_TAB_STARTUP "Startup" IDS_TAB_TOOLS "Tools" END @@ -170,5 +170,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Running" IDS_SERVICES_STATUS_STOPPED "Stopped" IDS_SERVICES_YES "Yes" - IDS_SERVICES_UNKNOWN "Unknown" + IDS_SERVICES_UNKNOWN "Unknown" END diff --git a/reactos/base/applications/msconfig/lang/fr-FR.rc b/reactos/base/applications/msconfig/lang/fr-FR.rc index 0eeb95f8f3b..cc42e7debd8 100644 --- a/reactos/base/applications/msconfig/lang/fr-FR.rc +++ b/reactos/base/applications/msconfig/lang/fr-FR.rc @@ -88,7 +88,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "Options A&vancées...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "Options A&vancées...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Délai:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "sec.", -1, 340, 91, 15, 10 @@ -124,9 +124,9 @@ BEGIN IDS_MSCONFIG "Utilitaire de configuration système" IDS_TAB_GENERAL "Général" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Services" - IDS_TAB_STARTUP "Démarrage" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Services" + IDS_TAB_STARTUP "Démarrage" IDS_TAB_TOOLS "Outils" END @@ -170,5 +170,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "En cours" IDS_SERVICES_STATUS_STOPPED "Arrêté" IDS_SERVICES_YES "Oui" - IDS_SERVICES_UNKNOWN "Inconnu" + IDS_SERVICES_UNKNOWN "Inconnu" END diff --git a/reactos/base/applications/msconfig/lang/hu-HU.rc b/reactos/base/applications/msconfig/lang/hu-HU.rc index aa8c1ebc7ef..527536e8d3f 100644 --- a/reactos/base/applications/msconfig/lang/hu-HU.rc +++ b/reactos/base/applications/msconfig/lang/hu-HU.rc @@ -67,9 +67,9 @@ BEGIN IDS_MSCONFIG "Rendszerkonfiguráciüs segédprogram" IDS_TAB_GENERAL "Általános" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Szolgáltatások" - IDS_TAB_STARTUP "Automatikus indítás" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Szolgáltatások" + IDS_TAB_STARTUP "Automatikus indítás" IDS_TAB_TOOLS "Segédprogramok" END diff --git a/reactos/base/applications/msconfig/lang/id-ID.rc b/reactos/base/applications/msconfig/lang/id-ID.rc index 193e0dfbbf6..4d91d5383f8 100644 --- a/reactos/base/applications/msconfig/lang/id-ID.rc +++ b/reactos/base/applications/msconfig/lang/id-ID.rc @@ -88,7 +88,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "Opsi &Lanjutan...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "Opsi &Lanjutan...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Berakhir:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "detik", -1, 340, 91, 15, 10 @@ -124,9 +124,9 @@ BEGIN IDS_MSCONFIG "Program konfigurasi sistem" IDS_TAB_GENERAL "Umum" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Layanan" - IDS_TAB_STARTUP "Startup" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Layanan" + IDS_TAB_STARTUP "Startup" IDS_TAB_TOOLS "Piranti" END @@ -170,5 +170,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Berjalan" IDS_SERVICES_STATUS_STOPPED "Dihentikan" IDS_SERVICES_YES "Ya" - IDS_SERVICES_UNKNOWN "Tidak Dikenal" + IDS_SERVICES_UNKNOWN "Tidak Dikenal" END diff --git a/reactos/base/applications/msconfig/lang/it-IT.rc b/reactos/base/applications/msconfig/lang/it-IT.rc index 5b27e4ad903..35500dba12b 100644 --- a/reactos/base/applications/msconfig/lang/it-IT.rc +++ b/reactos/base/applications/msconfig/lang/it-IT.rc @@ -88,7 +88,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 122, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 137, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 152, 50, 10 - PUSHBUTTON "Op&zioni avanzate...", IDC_BTN_ADVANCED_OPTIONS, 100, 148, 70, 16 + PUSHBUTTON "Op&zioni avanzate...", IDC_BTN_ADVANCED_OPTIONS, 100, 148, 70, 16 LTEXT "&Timeout:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "sec.", -1, 340, 91, 15, 10 @@ -124,9 +124,9 @@ BEGIN IDS_MSCONFIG "Utilità di configurazione del sistema" IDS_TAB_GENERAL "Generale" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Servizi" - IDS_TAB_STARTUP "Avvio" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Servizi" + IDS_TAB_STARTUP "Avvio" IDS_TAB_TOOLS "Strumenti" END @@ -170,5 +170,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Esecuzione" IDS_SERVICES_STATUS_STOPPED "Interrotto" IDS_SERVICES_YES "Sì" - IDS_SERVICES_UNKNOWN "Sconosciuto" + IDS_SERVICES_UNKNOWN "Sconosciuto" END diff --git a/reactos/base/applications/msconfig/lang/nl-NL.rc b/reactos/base/applications/msconfig/lang/nl-NL.rc index ce563d98baa..a1ed9012b4f 100644 --- a/reactos/base/applications/msconfig/lang/nl-NL.rc +++ b/reactos/base/applications/msconfig/lang/nl-NL.rc @@ -108,7 +108,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "&Geavanceerde opties...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "&Geavanceerde opties...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "Time-&out:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "sec.", -1, 340, 91, 15, 10 @@ -144,9 +144,9 @@ BEGIN IDS_MSCONFIG "Hulpprogramma voor systeemconfiguratie" IDS_TAB_GENERAL "Algemeen" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Services" - IDS_TAB_STARTUP "Opstarten" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Services" + IDS_TAB_STARTUP "Opstarten" IDS_TAB_TOOLS "Hulpmiddelen" END @@ -190,5 +190,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Wordt uitgevoerd" IDS_SERVICES_STATUS_STOPPED "Gestopt" IDS_SERVICES_YES "Ja" - IDS_SERVICES_UNKNOWN "Onbekend" + IDS_SERVICES_UNKNOWN "Onbekend" END diff --git a/reactos/base/applications/msconfig/lang/pl-PL.rc b/reactos/base/applications/msconfig/lang/pl-PL.rc index 95430e88a2a..8314351e64a 100644 --- a/reactos/base/applications/msconfig/lang/pl-PL.rc +++ b/reactos/base/applications/msconfig/lang/pl-PL.rc @@ -1,5 +1,5 @@ /* - * translated by TestamenT + * translated by TestamenT * testament@users.sourceforge.net * https://sourceforge.net/projects/reactospl */ @@ -94,7 +94,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "&Opcje zaawansowane...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "&Opcje zaawansowane...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Limit czasu:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "s", -1, 340, 91, 15, 10 @@ -130,9 +130,9 @@ BEGIN IDS_MSCONFIG "Program konfiguracji systemu" IDS_TAB_GENERAL "Ogólne" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Us³ugi" - IDS_TAB_STARTUP "Uruchamianie" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Us³ugi" + IDS_TAB_STARTUP "Uruchamianie" IDS_TAB_TOOLS "Narzêdzia" END @@ -176,5 +176,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Dzia³a" IDS_SERVICES_STATUS_STOPPED "Zatrzymano" IDS_SERVICES_YES "Tak" - IDS_SERVICES_UNKNOWN "Nieznany" + IDS_SERVICES_UNKNOWN "Nieznany" END diff --git a/reactos/base/applications/msconfig/lang/ru-RU.rc b/reactos/base/applications/msconfig/lang/ru-RU.rc index e1f9b483f03..b403ee6bf3c 100644 --- a/reactos/base/applications/msconfig/lang/ru-RU.rc +++ b/reactos/base/applications/msconfig/lang/ru-RU.rc @@ -90,7 +90,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "&Äîïîëíèòåëüíî...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "&Äîïîëíèòåëüíî...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Òàéìàóò:", -1, 280, 82, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 280, 93, 25, 12, ES_LEFT LTEXT "ñåê.", -1, 310, 91, 15, 10 @@ -126,9 +126,9 @@ BEGIN IDS_MSCONFIG "Íàñòðîéêà ñèñòåìû" IDS_TAB_GENERAL "Îáùèå" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Ñëóæáû" - IDS_TAB_STARTUP "Àâòîçàãðóçêà" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Ñëóæáû" + IDS_TAB_STARTUP "Àâòîçàãðóçêà" IDS_TAB_TOOLS "Óòèëèòû" END @@ -172,5 +172,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Çàïóùåíî" IDS_SERVICES_STATUS_STOPPED "Îñòàíîâëåíî" IDS_SERVICES_YES "Äà" - IDS_SERVICES_UNKNOWN "Íåèçâåñòíûé" + IDS_SERVICES_UNKNOWN "Íåèçâåñòíûé" END diff --git a/reactos/base/applications/msconfig/lang/th-TH.rc b/reactos/base/applications/msconfig/lang/th-TH.rc index e2a32f37992..31b75f41108 100644 --- a/reactos/base/applications/msconfig/lang/th-TH.rc +++ b/reactos/base/applications/msconfig/lang/th-TH.rc @@ -108,7 +108,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "&µÑÇàÅ×Í¡ÃдѺÊÙ§...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "&µÑÇàÅ×Í¡ÃдѺÊÙ§...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&ËÁ´àÇÅÒ:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "ÇÔ¹Ò·Õ", -1, 340, 91, 15, 10 @@ -144,9 +144,9 @@ BEGIN IDS_MSCONFIG "â»Ãá¡ÃÁâ¤Ã§áººÃкº" IDS_TAB_GENERAL "·ÑèÇä»" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "ºÃÔ¡ÒÃ" - IDS_TAB_STARTUP "àÃÔèÁ§Ò¹à¤Ã×èͧ" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "ºÃÔ¡ÒÃ" + IDS_TAB_STARTUP "àÃÔèÁ§Ò¹à¤Ã×èͧ" IDS_TAB_TOOLS "à¤Ã×èͧÁ×Í" END @@ -190,5 +190,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "¡ÓÅѧ´Óà¹Ô¹§Ò¹" IDS_SERVICES_STATUS_STOPPED "ËÂØ´áÅéÇ" IDS_SERVICES_YES "ãªè" - IDS_SERVICES_UNKNOWN "äÁè·ÃÒº" + IDS_SERVICES_UNKNOWN "äÁè·ÃÒº" END diff --git a/reactos/base/applications/msconfig/lang/uk-UA.rc b/reactos/base/applications/msconfig/lang/uk-UA.rc index 9d9b2b3eb91..0ebd57c73f1 100644 --- a/reactos/base/applications/msconfig/lang/uk-UA.rc +++ b/reactos/base/applications/msconfig/lang/uk-UA.rc @@ -96,7 +96,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "Ä&îäàòêîâî...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "Ä&îäàòêîâî...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "&Çàòðèìêà:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "ñåê.", -1, 340, 91, 15, 10 @@ -132,9 +132,9 @@ BEGIN IDS_MSCONFIG "Ïðîãðàìà íàëàøòóâàííÿ ñèñòåìè" IDS_TAB_GENERAL "Çàãàëüí³" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "Ñëóæáè" - IDS_TAB_STARTUP "Àâòîçàâàíòàæåííÿ" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "Ñëóæáè" + IDS_TAB_STARTUP "Àâòîçàâàíòàæåííÿ" IDS_TAB_TOOLS "Óòèë³òè" END @@ -178,5 +178,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Ïðàöþº" IDS_SERVICES_STATUS_STOPPED "Çóïèíåíà" IDS_SERVICES_YES "Òàê" - IDS_SERVICES_UNKNOWN "Íåâ³äîìî" + IDS_SERVICES_UNKNOWN "Íåâ³äîìî" END diff --git a/reactos/base/applications/msconfig/lang/zh-CN.rc b/reactos/base/applications/msconfig/lang/zh-CN.rc index 6205c91cd15..f0f1e933188 100644 --- a/reactos/base/applications/msconfig/lang/zh-CN.rc +++ b/reactos/base/applications/msconfig/lang/zh-CN.rc @@ -108,7 +108,7 @@ BEGIN CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 - PUSHBUTTON "¸ß¼¶Ñ¡Ïî(&V)...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + PUSHBUTTON "¸ß¼¶Ñ¡Ïî(&V)...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 LTEXT "³¬Ê±(&T):", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT LTEXT "Ãë", -1, 340, 91, 15, 10 @@ -144,9 +144,9 @@ BEGIN IDS_MSCONFIG "ϵͳÅäÖÃʵÓóÌÐò" IDS_TAB_GENERAL "Ò»°ã" IDS_TAB_SYSTEM "SYSTEM.INI" - IDS_TAB_FREELDR "FREELDR.INI" - IDS_TAB_SERVICES "·þÎñ" - IDS_TAB_STARTUP "Æô¶¯" + IDS_TAB_FREELDR "FREELDR.INI" + IDS_TAB_SERVICES "·þÎñ" + IDS_TAB_STARTUP "Æô¶¯" IDS_TAB_TOOLS "¹¤¾ß" END @@ -190,5 +190,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "ÕýÔÚÔËÐÐ" IDS_SERVICES_STATUS_STOPPED "ÒÑÍ£Ö¹" IDS_SERVICES_YES "ÊÇ" - IDS_SERVICES_UNKNOWN "δ֪" + IDS_SERVICES_UNKNOWN "δ֪" END diff --git a/reactos/base/applications/msconfig/systempage.c b/reactos/base/applications/msconfig/systempage.c index 60a451cddc0..dac7996b4bf 100644 --- a/reactos/base/applications/msconfig/systempage.c +++ b/reactos/base/applications/msconfig/systempage.c @@ -18,7 +18,7 @@ SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) UNREFERENCED_PARAMETER(wParam); switch (message) { case WM_INITDIALOG: - { + { hSystemDialog = hDlg; SetWindowPos(hDlg, NULL, 10, 32, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); return TRUE; diff --git a/reactos/base/applications/msconfig/toolspage.c b/reactos/base/applications/msconfig/toolspage.c index 0084bb620ea..e25738ca76c 100644 --- a/reactos/base/applications/msconfig/toolspage.c +++ b/reactos/base/applications/msconfig/toolspage.c @@ -18,7 +18,7 @@ void FillListView ( void ); DWORD ListItems_Cmds[20]; DWORD ListItems_Params[20]; - + void AddItem ( DWORD name_id, DWORD descr_id, DWORD cmd_id , DWORD param_id ) { TCHAR szTemp[256]; LV_ITEM item; @@ -91,9 +91,9 @@ ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_COMMAND: { switch (LOWORD(wParam)) - { + { case IDC_BTN_RUN: - { + { if (ListView_GetSelectionMark(hToolsListCtrl) != -1) { LoadString(hInst, ListItems_Cmds[ListView_GetSelectionMark(hToolsListCtrl)], szTemp, 256); @@ -112,7 +112,7 @@ ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) switch (nmh->code) { case NM_CLICK: - { + { lpnmitem = (LPNMITEMACTIVATE) lParam; if (lpnmitem->iItem > -1) { diff --git a/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc b/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc index 942bbba562b..3c5ba4f8f81 100644 --- a/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc +++ b/reactos/base/applications/mscutils/devmgmt/lang/pl-PL.rc @@ -1,7 +1,7 @@ -/* +/* * translated by xrogers -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -83,6 +83,6 @@ BEGIN IDS_HINT_SYS_MOVE " Przesuwa to okno." IDS_HINT_SYS_SIZE " Zmienia rozmiar tego okna." IDS_HINT_SYS_MINIMIZE " Minimalizuje to okno do ikony." - IDS_HINT_SYS_MAXIMIZE " Rozszerza to okno do rozmiarów ekranu." + IDS_HINT_SYS_MAXIMIZE " Rozszerza to okno do rozmiarów ekranu." IDS_HINT_SYS_CLOSE " Zamyka okno." END diff --git a/reactos/base/applications/mscutils/eventvwr/eventvwr.c b/reactos/base/applications/mscutils/eventvwr/eventvwr.c index c67bf4849c7..9877d0f01cc 100644 --- a/reactos/base/applications/mscutils/eventvwr/eventvwr.c +++ b/reactos/base/applications/mscutils/eventvwr/eventvwr.c @@ -31,8 +31,8 @@ #include #if _MSC_VER - #pragma warning(disable: 4996) // 'strdup' was declared deprecated - #define _CRT_SECURE_NO_DEPRECATE // all deprecated 'unsafe string functions + #pragma warning(disable: 4996) // 'strdup' was declared deprecated + #define _CRT_SECURE_NO_DEPRECATE // all deprecated 'unsafe string functions #endif static const LPSTR EVENT_SOURCE_APPLICATION = "Application"; @@ -42,8 +42,8 @@ static const TCHAR szWindowClass[] = _T("EVENTVWR"); // the main window class //MessageFile message buffer size #define EVENT_MESSAGE_EVENTTEXT_BUFFER 1024*10 -#define EVENT_MESSAGE_FILE_BUFFER 1024*10 -#define EVENT_DLL_SEPARATOR ";" +#define EVENT_MESSAGE_FILE_BUFFER 1024*10 +#define EVENT_DLL_SEPARATOR ";" #define EVENT_MESSAGE_FILE "EventMessageFile" #define EVENT_CATEGORY_MESSAGE_FILE "CategoryMessageFile" #define EVENT_PARAMETER_MESSAGE_FILE "ParameterMessageFile" @@ -122,7 +122,7 @@ VOID EventTimeToSystemTime (DWORD EventTime, SYSTEMTIME *pSystemTime) FILETIME ft; ULONGLONG ll; } u1970, uUCT; - + uUCT.ft.dwHighDateTime = 0; uUCT.ft.dwLowDateTime = EventTime; SystemTimeToFileTime(&st1970, &u1970.ft); @@ -131,24 +131,24 @@ VOID EventTimeToSystemTime (DWORD EventTime, SYSTEMTIME *pSystemTime) FileTimeToSystemTime(&ftLocal, pSystemTime); } -void -TrimNulls ( LPSTR s ) -{ - char *c; +void +TrimNulls ( LPSTR s ) +{ + char *c; - if ( s != (char *) NULL ) - { - c = s + strlen ( s ) - 1; - while ( c >= s && isspace ( *c ) ) - --c; - *++c = '\0'; - } -} + if ( s != (char *) NULL ) + { + c = s + strlen ( s ) - 1; + while ( c >= s && isspace ( *c ) ) + --c; + *++c = '\0'; + } +} BOOL GetEventMessageFileDLL( IN LPCTSTR lpLogName, IN LPCTSTR SourceName, - IN LPCTSTR EntryName, + IN LPCTSTR EntryName, OUT LPSTR ExpandedName) { DWORD dwSize; @@ -161,13 +161,13 @@ BOOL GetEventMessageFileDLL( _tcscpy(szKeyName, TEXT("SYSTEM\\CurrentControlSet\\Services\\EventLog")); _tcscat(szKeyName, _T("\\")); _tcscat(szKeyName, lpLogName); - + if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_READ, - &hAppKey) == ERROR_SUCCESS) + &hAppKey) == ERROR_SUCCESS) { if (RegOpenKeyEx( hAppKey, @@ -196,15 +196,15 @@ BOOL GetEventMessageFileDLL( else { MessageBox (NULL , - _TEXT("Registry access failed!") , - _TEXT("Event Log") , + _TEXT("Registry access failed!") , + _TEXT("Event Log") , MB_OK | MB_ICONINFORMATION); } - if (hSourceKey != NULL) + if (hSourceKey != NULL) RegCloseKey(hSourceKey); - - if (hAppKey != NULL) + + if (hAppKey != NULL) RegCloseKey(hAppKey); return bReturn; @@ -212,7 +212,7 @@ BOOL GetEventMessageFileDLL( BOOL GetEventCategory( IN LPCTSTR KeyName, - IN LPCTSTR SourceName, + IN LPCTSTR SourceName, IN EVENTLOGRECORD *pevlr, OUT LPTSTR CategoryName) { @@ -227,9 +227,9 @@ BOOL GetEventCategory( NULL, DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_AS_DATAFILE); - if(hLibrary != NULL) + if(hLibrary != NULL) { - // Retrieve the message string. + // Retrieve the message string. if(FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ARGUMENT_ARRAY, hLibrary, @@ -255,7 +255,7 @@ BOOL GetEventCategory( strcpy (CategoryName, "None"); } - if(hLibrary != NULL) + if(hLibrary != NULL) FreeLibrary(hLibrary); // Free the buffer allocated by FormatMessage @@ -273,7 +273,7 @@ BOOL GetEventCategory( BOOL GetEventMessage( IN LPCTSTR KeyName, - IN LPCTSTR SourceName, + IN LPCTSTR SourceName, IN EVENTLOGRECORD *pevlr, OUT LPTSTR EventText) { @@ -299,7 +299,7 @@ BOOL GetEventMessage( for (i = 0; i < pevlr->NumStrings ; i++) { - if (strstr(szMessage , "%%")) + if (strstr(szMessage , "%%")) { if (GetEventMessageFileDLL (KeyName , SourceName, EVENT_PARAMETER_MESSAGE_FILE , ParameterModuleName)) { @@ -318,37 +318,37 @@ BOOL GetEventMessage( szDll = strtok(SourceModuleName, EVENT_DLL_SEPARATOR); while ((szDll != NULL) && (!bDone)) - { + { hLibrary = LoadLibraryEx( szDll, NULL, DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_AS_DATAFILE); - if (hLibrary == NULL) + if (hLibrary == NULL) { // The DLL could not be loaded try the next one (if any) szDll = strtok (NULL, EVENT_DLL_SEPARATOR); } else { - // Retrieve the message string. + // Retrieve the message string. if(FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_HMODULE | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ARGUMENT_ARRAY, hLibrary, pevlr->EventID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, - szArguments) == 0) + szArguments) == 0) { // We haven't found the string , get next DLL (if any) - szDll = strtok (NULL, EVENT_DLL_SEPARATOR); + szDll = strtok (NULL, EVENT_DLL_SEPARATOR); } else - { + { if (lpMsgBuf) { // The ID was found and the message was formated @@ -411,7 +411,7 @@ GetEventType (WORD dwEventType, OUT LPSTR eventTypeText) } } -BOOL +BOOL GetEventUserName (EVENTLOGRECORD *pelr, OUT LPSTR pszUser) { PSID lpSid; @@ -421,19 +421,19 @@ GetEventUserName (EVENTLOGRECORD *pelr, OUT LPSTR pszUser) DWORD cbName = 1024; DWORD cbDomain = 1024; - // Point to the SID. - lpSid = (PSID)((LPBYTE) pelr + pelr->UserSidOffset); + // Point to the SID. + lpSid = (PSID)((LPBYTE) pelr + pelr->UserSidOffset); // User SID if(pelr->UserSidLength > 0) { if (LookupAccountSid( - NULL, - lpSid, - szName, - &cbName, - szDomain, - &cbDomain, + NULL, + lpSid, + szName, + &cbName, + szDomain, + &cbDomain, &peUse)) { strcpy (pszUser , szName); @@ -475,7 +475,7 @@ ShowStatusMessageThread( } VOID QueryEventMessages ( - LPTSTR lpMachineName , + LPTSTR lpMachineName , LPTSTR lpLogName) { HWND hwndDlg; @@ -509,7 +509,7 @@ VOID QueryEventMessages ( lpComputerName = lpMachineName; // Open the event log. - hEventLog = OpenEventLog( + hEventLog = OpenEventLog( lpMachineName, lpLogName); @@ -517,7 +517,7 @@ VOID QueryEventMessages ( { MessageBox (NULL , _TEXT("Could not open the event log.") , - _TEXT("Event Log") , + _TEXT("Event Log") , MB_OK | MB_ICONINFORMATION); return; } @@ -527,7 +527,7 @@ VOID QueryEventMessages ( // Clear the list view (void)ListView_DeleteAllItems (hwndListView); - + // Initialize the event record buffer. pevlr = (EVENTLOGRECORD *)&bBuffer; @@ -552,7 +552,7 @@ VOID QueryEventMessages ( while (dwCurrentRecord < dwTotalRecords) { pevlr = (EVENTLOGRECORD*)malloc(MAX_PATH); - + bResult = ReadEventLog( hEventLog, // Event log handle dwFlags, // Sequential read @@ -588,36 +588,36 @@ VOID QueryEventMessages ( // Get the computer name lpComputerName = (LPSTR) ((LPBYTE) pevlr + sizeof(EVENTLOGRECORD) + lstrlen(lpSourceName) + 1); - // This ist the data section of the current event + // This ist the data section of the current event lpData = (LPSTR) ((LPBYTE)pevlr + pevlr->DataOffset); // This is the text of the current event lpEventStr = (LPSTR) ((LPBYTE) pevlr + pevlr->StringOffset); // Compute the event type - EventTimeToSystemTime(pevlr->TimeWritten, &time); + EventTimeToSystemTime(pevlr->TimeWritten, &time); // Get the username that generated the event GetEventUserName (pevlr , szUsername); GetDateFormat( LOCALE_USER_DEFAULT, DATE_SHORTDATE, &time, NULL, szLocalDate, MAX_PATH ); GetTimeFormat( LOCALE_USER_DEFAULT, TIME_NOSECONDS, &time, NULL, szLocalTime, MAX_PATH ); - + GetEventType (pevlr->EventType , szEventTypeText); GetEventCategory (lpLogName , lpSourceName , pevlr , szCategory); wsprintf (szEventID, "%u", (DWORD)(pevlr->EventID & 0xFFFF)); wsprintf (szCategoryID, "%u", (DWORD)(pevlr->EventCategory)); - lviEventItem.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM; + lviEventItem.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM; lviEventItem.iItem = 0; lviEventItem.iSubItem = 0; lviEventItem.lParam = (LPARAM)pevlr; lviEventItem.pszText = szEventTypeText; - switch(pevlr->EventType) + switch(pevlr->EventType) { - case EVENTLOG_ERROR_TYPE: + case EVENTLOG_ERROR_TYPE: lviEventItem.iImage = 2; break; case EVENTLOG_AUDIT_FAILURE: @@ -647,7 +647,7 @@ VOID QueryEventMessages ( ListView_SetItemText(hwndListView, lviEventItem.iItem, 6, szUsername); //User ListView_SetItemText(hwndListView, lviEventItem.iItem, 7, lpComputerName); //Computer ListView_SetItemText(hwndListView, lviEventItem.iItem, 8, lpData); //Event Text - + dwRead -= pevlr->Length; pevlr = (EVENTLOGRECORD *) ((LPBYTE) pevlr + pevlr->Length); } @@ -672,16 +672,16 @@ VOID QueryEventMessages ( //Resume list view redraw SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0); - + // Close the event log. CloseEventLog(hEventLog); } -VOID +VOID Refresh (VOID) { QueryEventMessages( - lpComputerName , + lpComputerName , lpSourceLogName); } @@ -737,13 +737,13 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) hInst = hInstance; // Store instance handle in our global variable hwndMainWindow = CreateWindow( - szWindowClass, - szTitle, + szWindowClass, + szTitle, WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, - NULL, - NULL, - hInstance, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, + NULL, + NULL, + hInstance, NULL); if (!hwndMainWindow) @@ -751,10 +751,10 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) return FALSE; } - hwndStatus = CreateWindowEx( + hwndStatus = CreateWindowEx( 0, // no extended styles STATUSCLASSNAME, // status bar - "Done.", // no text + "Done.", // no text WS_CHILD | WS_BORDER | WS_VISIBLE, // styles 0, 0, 0, 0, // x, y, cx, cy hwndMainWindow, // parent window @@ -766,17 +766,17 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) // and WS_BORDER to create the normal "sunken" look. Also note that // LVS_EX_ styles cannot be set in CreateWindowEx(). hwndListView = CreateWindowEx( - WS_EX_CLIENTEDGE, - WC_LISTVIEW, + WS_EX_CLIENTEDGE, + WC_LISTVIEW, _T(""), LVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE | LVS_REPORT, - 0, - 0, - 243, - 200, - hwndMainWindow, - NULL, - hInstance, + 0, + 0, + 243, + 200, + hwndMainWindow, + NULL, + hInstance, NULL); // After the ListView is created, we can add extended list view styles. @@ -785,11 +785,11 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) // Create the ImageList hSmall = ImageList_Create( GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), + GetSystemMetrics(SM_CYSMICON), ILC_MASK, 1, 1); - + // Add event type icons to ImageList ImageList_AddIcon (hSmall, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_INFORMATIONICON))); ImageList_AddIcon (hSmall, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WARNINGICON))); @@ -929,8 +929,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case IDM_HELP: MessageBox ( NULL , - _TEXT("Help not implemented yet!") , - _TEXT("Event Log") , + _TEXT("Help not implemented yet!") , + _TEXT("Event Log") , MB_OK | MB_ICONINFORMATION); break; case IDM_EXIT: @@ -944,14 +944,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { //Gets the window rectangle GetClientRect(hWnd, &rect); - + //Relocate the listview MoveWindow( hwndListView, - 0, - 0, - rect.right, - rect.bottom - 20, + 0, + 0, + rect.right, + rect.bottom - 20, 1); // Resize the statusbar; @@ -989,7 +989,7 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) return (INT_PTR)FALSE; } -VOID +VOID DisplayEvent (HWND hDlg) { char szEventType[MAX_PATH]; @@ -1057,7 +1057,7 @@ DisplayEvent (HWND hDlg) } } -static +static INT_PTR CALLBACK StatusMessageWindowProc( IN HWND hwndDlg, IN UINT uMsg, @@ -1126,8 +1126,8 @@ INT_PTR CALLBACK EventDetails(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa if (LOWORD(wParam) == IDHELP) { MessageBox (NULL , - _TEXT("Help not implemented yet!") , - _TEXT("Event Log") , + _TEXT("Help not implemented yet!") , + _TEXT("Event Log") , MB_OK | MB_ICONINFORMATION); return (INT_PTR)TRUE; } diff --git a/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc b/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc index f5005d005ac..1dee7832b9d 100644 --- a/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc +++ b/reactos/base/applications/mscutils/eventvwr/lang/de-DE.rc @@ -1,6 +1,6 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL -IDC_EVENTVWR MENU +IDC_EVENTVWR MENU BEGIN POPUP "&Protokoll" BEGIN @@ -23,7 +23,7 @@ BEGIN END END -IDC_EVENTVWR ACCELERATORS +IDC_EVENTVWR ACCELERATORS BEGIN "?", IDM_ABOUT, ASCII, ALT "/", IDM_ABOUT, ASCII, ALT @@ -41,7 +41,7 @@ BEGIN END IDD_PROGRESSBOX DIALOGEX 0, 0, 230, 40 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER CAPTION "Bitte warten.." FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN @@ -82,7 +82,7 @@ BEGIN CONTROL "&Wörter",IDC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,77,194,33,10 END -STRINGTABLE +STRINGTABLE BEGIN IDS_APP_TITLE "Ereignisanzeige" IDC_EVENTSTRINGIDNOTFOUND "Die Bezeichnung für die Ereignis-ID ( %lu ) in der Quelle ( %s ) kann nicht gefunden werden. Es könnte sein, dass der Lokale Computer die notwendigen Registry Einträge oder Nachrichten DLLs, um Nachrichten von Remoten Computern anzuzeigen, nicht besitzt." diff --git a/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc b/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc index f23d835c581..b8dea84b40a 100644 --- a/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc +++ b/reactos/base/applications/mscutils/eventvwr/lang/en-US.rc @@ -1,6 +1,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -IDC_EVENTVWR MENU +IDC_EVENTVWR MENU BEGIN POPUP "&Log" BEGIN @@ -23,7 +23,7 @@ BEGIN END END -IDC_EVENTVWR ACCELERATORS +IDC_EVENTVWR ACCELERATORS BEGIN "?", IDM_ABOUT, ASCII, ALT "/", IDM_ABOUT, ASCII, ALT @@ -41,7 +41,7 @@ BEGIN END IDD_PROGRESSBOX DIALOGEX 0, 0, 230, 40 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER CAPTION "Wait.." FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN @@ -82,7 +82,7 @@ BEGIN CONTROL "&Word",IDC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,77,194,33,10 END -STRINGTABLE +STRINGTABLE BEGIN IDS_APP_TITLE "Event Viewer" IDC_EVENTSTRINGIDNOTFOUND "The description for Event ID ( %lu ) in Source ( %s ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer." diff --git a/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc b/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc index 8155948ac87..39d53ced674 100644 --- a/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc +++ b/reactos/base/applications/mscutils/eventvwr/lang/fr-FR.rc @@ -1,6 +1,6 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL -IDC_EVENTVWR MENU +IDC_EVENTVWR MENU BEGIN POPUP "Journa&l" BEGIN @@ -23,7 +23,7 @@ BEGIN END END -IDC_EVENTVWR ACCELERATORS +IDC_EVENTVWR ACCELERATORS BEGIN "?", IDM_ABOUT, ASCII, ALT "/", IDM_ABOUT, ASCII, ALT @@ -41,7 +41,7 @@ BEGIN END IDD_PROGRESSBOX DIALOGEX 0, 0, 230, 40 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER CAPTION "Patientez.." FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN @@ -82,7 +82,7 @@ BEGIN CONTROL "&Word",IDC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,77,194,33,10 END -STRINGTABLE +STRINGTABLE BEGIN IDS_APP_TITLE "Visionneuse d'événements" IDC_EVENTSTRINGIDNOTFOUND "La description pour l'événement d'ID ( %lu ) dans la source ( %s ) ne peut être trouvée. L'ordinateur local pourrait ne pas avoir les informations registres nécéssaires ou les fichiers DLL de message pour afficher les messages depuis un ordinateur distant." diff --git a/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc b/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc index 3ffbc0c840e..0ec52cf33ad 100644 --- a/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc +++ b/reactos/base/applications/mscutils/eventvwr/lang/ru-RU.rc @@ -1,6 +1,6 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -IDC_EVENTVWR MENU +IDC_EVENTVWR MENU BEGIN POPUP "&Ëîãè" BEGIN @@ -23,7 +23,7 @@ BEGIN END END -IDC_EVENTVWR ACCELERATORS +IDC_EVENTVWR ACCELERATORS BEGIN "?", IDM_ABOUT, ASCII, ALT "/", IDM_ABOUT, ASCII, ALT @@ -41,7 +41,7 @@ BEGIN END IDD_PROGRESSBOX DIALOGEX 0, 0, 230, 40 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER CAPTION "Ïîäîæäèòå.." FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN @@ -82,7 +82,7 @@ BEGIN CONTROL "&Ñëîâà",IDC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,87,192,33,10 END -STRINGTABLE +STRINGTABLE BEGIN IDS_APP_TITLE "Ïðîñìîòð ñîáûòèé" IDC_EVENTSTRINGIDNOTFOUND "The description for Event ID ( %lu ) in Source ( %s ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer." diff --git a/reactos/base/applications/mscutils/eventvwr/resource.h b/reactos/base/applications/mscutils/eventvwr/resource.h index 4e8aabd8955..f733b14ddee 100644 --- a/reactos/base/applications/mscutils/eventvwr/resource.h +++ b/reactos/base/applications/mscutils/eventvwr/resource.h @@ -57,7 +57,7 @@ #define IDC_STATIC -1 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 diff --git a/reactos/base/applications/mscutils/servman/control.c b/reactos/base/applications/mscutils/servman/control.c index e87649b0da1..a170e80a52f 100644 --- a/reactos/base/applications/mscutils/servman/control.c +++ b/reactos/base/applications/mscutils/servman/control.c @@ -88,7 +88,7 @@ Control(PMAIN_WND_INFO Info, } } } - + CloseServiceHandle(hSc); } diff --git a/reactos/base/applications/mscutils/servman/mainwnd.c b/reactos/base/applications/mscutils/servman/mainwnd.c index 76ff4f3f6c6..a00fca6c8a7 100644 --- a/reactos/base/applications/mscutils/servman/mainwnd.c +++ b/reactos/base/applications/mscutils/servman/mainwnd.c @@ -194,7 +194,7 @@ VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info) SendMessage(Info->hTool, TB_SETSTATE, ID_START, (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); } - + if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) ) { EnableMenuItem(hMainMenu, ID_RESTART, MF_ENABLED); diff --git a/reactos/base/applications/mscutils/servman/start.c b/reactos/base/applications/mscutils/servman/start.c index d97ff96348d..bac02d9810c 100644 --- a/reactos/base/applications/mscutils/servman/start.c +++ b/reactos/base/applications/mscutils/servman/start.c @@ -86,7 +86,7 @@ DoStartService(PMAIN_WND_INFO Info, } } } - + CloseServiceHandle(hSc); } diff --git a/reactos/base/applications/mscutils/servman/stop.c b/reactos/base/applications/mscutils/servman/stop.c index 373bae29848..a082bc52c14 100644 --- a/reactos/base/applications/mscutils/servman/stop.c +++ b/reactos/base/applications/mscutils/servman/stop.c @@ -59,7 +59,7 @@ DoStop(PMAIN_WND_INFO Info) _sntprintf(str, 499, _T("%s depends on this service, implement the dialog to allow closing of other services"), lpServiceConfig->lpDependencies); MessageBox(NULL, str, NULL, 0); - + //FIXME: open 'stop other services' box } else diff --git a/reactos/base/applications/network/arp/arp.c b/reactos/base/applications/network/arp/arp.c index b4577e78527..3b09e5c789e 100644 --- a/reactos/base/applications/network/arp/arp.c +++ b/reactos/base/applications/network/arp/arp.c @@ -69,7 +69,7 @@ DWORD DoFormatMessage(VOID) DWORD ErrorCode = GetLastError(); - if (ErrorCode != ERROR_SUCCESS) + if (ErrorCode != ERROR_SUCCESS) { RetVal = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | @@ -248,7 +248,7 @@ INT DisplayArpEntries(PTCHAR pszInetAddr, PTCHAR pszIfAddr) } return EXIT_SUCCESS; - + cleanup: if (pIpNetTable != NULL) HeapFree(GetProcessHeap(), 0, pIpNetTable); @@ -618,4 +618,4 @@ INT main(int argc, char* argv[]) Usage(); return EXIT_SUCCESS; -} +} diff --git a/reactos/base/applications/network/ipconfig/lang/bg-BG.rc b/reactos/base/applications/network/ipconfig/lang/bg-BG.rc index aa5c2852324..85a1effd414 100644 --- a/reactos/base/applications/network/ipconfig/lang/bg-BG.rc +++ b/reactos/base/applications/network/ipconfig/lang/bg-BG.rc @@ -23,7 +23,7 @@ END STRINGTABLE DISCARDABLE BEGIN /* Please keep the spacing/formatting as per En.rc when translating */ - IDS_USAGE + IDS_USAGE "\nÓÏÎÒÐÅÁÀ:\n \ ipconfig [/? | /all | /renew [adapter] | /release [adapter] |\n \ /flushdns | /displaydns | /registerdns |\n \ diff --git a/reactos/base/applications/network/ipconfig/lang/en-US.rc b/reactos/base/applications/network/ipconfig/lang/en-US.rc index abd6b9f88f6..1805e59a5d1 100644 --- a/reactos/base/applications/network/ipconfig/lang/en-US.rc +++ b/reactos/base/applications/network/ipconfig/lang/en-US.rc @@ -23,7 +23,7 @@ END STRINGTABLE DISCARDABLE BEGIN /* Please keep the spacing/formatting as per En.rc when translating */ - IDS_USAGE + IDS_USAGE "\nUSAGE:\n \ ipconfig [/? | /all | /renew [adapter] | /release [adapter] |\n \ /flushdns | /displaydns | /registerdns |\n \ diff --git a/reactos/base/applications/network/ipconfig/lang/fr-FR.rc b/reactos/base/applications/network/ipconfig/lang/fr-FR.rc index 5edd83754e6..6a619e34783 100644 --- a/reactos/base/applications/network/ipconfig/lang/fr-FR.rc +++ b/reactos/base/applications/network/ipconfig/lang/fr-FR.rc @@ -23,7 +23,7 @@ END STRINGTABLE DISCARDABLE BEGIN /* Please keep the spacing/formatting as per En.rc when translating */ - IDS_USAGE + IDS_USAGE "\nUSAGE:\n \ ipconfig [/? | /all | /renew [adapteur] | /release [adapteur] |\n \ /flushdns | /displaydns | /registerdns |\n \ diff --git a/reactos/base/applications/network/ipconfig/lang/id-ID.rc b/reactos/base/applications/network/ipconfig/lang/id-ID.rc index 4f6c2e64252..5487bb01009 100644 --- a/reactos/base/applications/network/ipconfig/lang/id-ID.rc +++ b/reactos/base/applications/network/ipconfig/lang/id-ID.rc @@ -23,7 +23,7 @@ END STRINGTABLE DISCARDABLE BEGIN /* Please keep the spacing/formatting as per En.rc when translating */ - IDS_USAGE + IDS_USAGE "\nPENGGUNAAN:\n \ ipconfig [/? | /all | /renew [adapter] | /release [adapter] |\n \ /flushdns | /displaydns | /registerdns |\n \ diff --git a/reactos/base/applications/network/ipconfig/lang/it-IT.rc b/reactos/base/applications/network/ipconfig/lang/it-IT.rc index a378cacaaca..a61c20906b0 100644 --- a/reactos/base/applications/network/ipconfig/lang/it-IT.rc +++ b/reactos/base/applications/network/ipconfig/lang/it-IT.rc @@ -24,7 +24,7 @@ END STRINGTABLE DISCARDABLE BEGIN /* Please keep the spacing/formatting as per En.rc when translating */ - IDS_USAGE + IDS_USAGE "\nUSO:\n \ ipconfig [/? | /all | /renew [adattatore] | /release [adattatore] |\n \ /flushdns | /displaydns | /registerdns |\n \ diff --git a/reactos/base/applications/network/ipconfig/lang/ru-RU.rc b/reactos/base/applications/network/ipconfig/lang/ru-RU.rc index 5ac177ee446..bd54562a5aa 100644 --- a/reactos/base/applications/network/ipconfig/lang/ru-RU.rc +++ b/reactos/base/applications/network/ipconfig/lang/ru-RU.rc @@ -25,7 +25,7 @@ END STRINGTABLE DISCARDABLE BEGIN /* Please keep the spacing/formatting as per En.rc when translating */ - IDS_USAGE + IDS_USAGE "\nÈÑÏÎËÜÇÎÂÀÍÈÅ:\n \ ipconfig [/? | /all | /renew [àäàïòåð] | /release [àäàïòåð] |\n \ /flushdns | /displaydns | /registerdns |\n \ diff --git a/reactos/base/applications/network/ipconfig/lang/uk-UA.rc b/reactos/base/applications/network/ipconfig/lang/uk-UA.rc index 544131761eb..2ecaed3c0ef 100644 --- a/reactos/base/applications/network/ipconfig/lang/uk-UA.rc +++ b/reactos/base/applications/network/ipconfig/lang/uk-UA.rc @@ -30,7 +30,7 @@ END STRINGTABLE DISCARDABLE BEGIN /* Please keep the spacing/formatting as per En.rc when translating */ - IDS_USAGE + IDS_USAGE "\nÂÈÊÎÐÈÑÒÀÍÍß:\n \ ipconfig [/? | /all | /renew [àäàïòåð] | /release [àäàïòåð] |\n \ /flushdns | /displaydns | /registerdns |\n \ diff --git a/reactos/base/applications/network/net/cmdStop.c b/reactos/base/applications/network/net/cmdStop.c index 16f36690403..71e5e67e08d 100644 --- a/reactos/base/applications/network/net/cmdStop.c +++ b/reactos/base/applications/network/net/cmdStop.c @@ -1,11 +1,11 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS net command - * FILE: - * PURPOSE: + * PROJECT: ReactOS net command + * FILE: + * PURPOSE: * - * PROGRAMMERS: Magnus Olsen (greatlord@reactos.org) + * PROGRAMMERS: Magnus Olsen (greatlord@reactos.org) */ #include "net.h" @@ -20,7 +20,7 @@ INT cmdStop(INT argc, CHAR **argv ) help(); return 0; } - + if (argc==2) { string = (char *) malloc(size); @@ -32,20 +32,20 @@ INT cmdStop(INT argc, CHAR **argv ) } return 0; } - + if (argc==3) { stop_service(argv[1]); return 0; } - + return 0; } INT stop_service(CHAR *service) -{ - +{ + CHAR *srvlst; LONG pos=0; LONG old_pos=0; @@ -53,8 +53,8 @@ INT stop_service(CHAR *service) LONG size=0; CHAR *row; /* we assume display name can max be 20 row and each row is 80 char */ - - + + /* Get the size for srvlst */ myCreateProcessStartGetSzie("rpcclient -c \"service enum\"", &size); if (size==0) @@ -70,10 +70,10 @@ INT stop_service(CHAR *service) /* Get the server list */ myCreateProcessStart("rpcclient -c \"service enum\"", srvlst, size); - + /* scan after display name */ while (pos=size) @@ -160,7 +160,7 @@ INT row_scanner_service(CHAR *buffer, LONG* pos, LONG size, /* get row start */ for (t=start_pos;t\nand the team. This program comes with ABSOLUTELY NO WARRANTY; for details\nread LICENSE.TXT. " MSG_COPYRIGHT_1 "This is free software, and you are welcome to redistribute\nit under certain conditions.\n\n" diff --git a/reactos/base/applications/network/telnet/src/ansiprsr.cpp b/reactos/base/applications/network/telnet/src/ansiprsr.cpp index 7659111166a..e24f44fea35 100644 --- a/reactos/base/applications/network/telnet/src/ansiprsr.cpp +++ b/reactos/base/applications/network/telnet/src/ansiprsr.cpp @@ -140,7 +140,7 @@ void TANSIParser::ConSetAttribute(unsigned char TextAttrib){ return; } } - + switch (TextAttrib){ // Text Attributes case 0: Console.Normal(); break; // Normal video @@ -179,7 +179,7 @@ void TANSIParser::ConSetAttribute(unsigned char TextAttrib){ // Select second alternate font, // toggle high bit before // displaying as ROM char. - + case 21: // not really Low video case 22: Console.LowVideo(); break; // but this works good also case 24: Console.UnderlineOff(); break; // Underline off @@ -247,13 +247,13 @@ const char* TANSIParser::GetTerminalID() char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) { - + // The buffer contains something like [pA // where p is an optional decimal number specifying the count by which the // appropriate action should take place. // The pointer pszBuffer points us to the p, and [ are // already 'consumed' - + // TITUS: Simplification of the code: Assume default count of 1 in case // there are no parameters. char tmpc; @@ -305,10 +305,10 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) if (iCurrentParam < nParam) iCurrentParam++; } - + //~~~ TITUS: Apparently the digit is optional (look at termcap or terminfo) // So: If there is no digit, assume a count of 1 - + switch ((unsigned char)*pszBuffer++) { // Insert Character case '@': @@ -350,7 +350,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) break; // Move cursor to beginning of line, p lines down. // Added by I.Ioannou 06 April, 1997 - case 'E': + case 'E': Console.MoveCursorPosition(-Console.GetCursorX(), iParam[0]); break; // Moves active position to beginning of line, p lines up @@ -365,7 +365,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) // Go to column p // Added by I.Ioannou 06 April, 1997 // With '=' this changes the default bg color (Paul Brannan 6/27/98) - case '`': + case '`': case 'G': // 'G' is from Linux kernel sources if(flag & FLAG_EQUAL) { Console.setDefaultBg(iParam[0]); @@ -378,14 +378,14 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // Set cursor position. - case 'f': + case 'f': case 'H': if (iCurrentParam < 2 || iParam[1] < 1) iParam[1] = 1; ConSetCursorPos(iParam[1] - 1, iParam[0] - 1); break; // Clear screen - case 'J': + case 'J': if ( iCurrentParam < 1 ) iParam[0] = 0; // Alter Default switch (iParam[0]) { case 0: Console.ClearEOScreen(); break; @@ -397,7 +397,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // Clear line - case 'K': + case 'K': if (iCurrentParam < 1) // Alter Default iParam[0] = 0; switch (iParam[0]) { @@ -408,7 +408,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) break; // Insert p new, blank lines. // Added by I.Ioannou 06 April, 1997 - case 'L': + case 'L': { // for (int i = 1; i <= iParam[0]; i++) // This should speed things up a bit (Paul Brannan 9/2/98) @@ -417,7 +417,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } // Delete p lines. // Added by I.Ioannou 06 April, 1997 - case 'M': + case 'M': { for (int i = 1; i <= iParam[0]; i++) // This should speed things up a bit (Paul Brannan 9/2/98) @@ -425,7 +425,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) break; } // DELETE CHAR - case 'P': + case 'P': Console.DeleteCharacter(iParam[0]); break; // Scrolls screen up (down? -- PB) p lines, @@ -433,7 +433,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) // ANSI X3.64-1979 references this but I didn't // found it in any telnet implementation // note 05 Oct 97 : but SCO terminfo uses them, so uncomment them !! - case 'S': + case 'S': { //for (int i = 1; i <= iParam[0]; i++) // This should speed things up a bit (Paul Brannan 9/2/98) @@ -445,7 +445,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) // ANSI X3.64-1979 references this but I didn't // found it in any telnet implementation // note 05 Oct 97 : but SCO terminfo uses them, so uncomment them !! - case 'T': + case 'T': { // for (int i = 1; i <= iParam[0]; i++) // This should speed things up a bit (Paul Brannan 9/2/98) @@ -454,7 +454,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } // Erases p characters up to the end of line // Added by I.Ioannou 06 April, 1997 - case 'X': + case 'X': { int iKeepX = Console.GetRawCursorX(); int iKeepY = Console.GetRawCursorY(); @@ -477,7 +477,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // Get Terminal ID - case 'c': + case 'c': { const char* szTerminalId = GetTerminalID(); Network.WriteString(szTerminalId, strlen(szTerminalId)); @@ -500,7 +500,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) break; // Go to line p // Added by I.Ioannou 06 April, 1997 - case 'd': + case 'd': if (iCurrentParam < 1) // Alter Default iParam[0] = 0; // this was backward, and we should subtract 1 from y @@ -509,7 +509,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) break; // iBCS2 tab erase // Added by I.Ioannou 06 April, 1997 - case 'g': + case 'g': if (iCurrentParam < 1) // Alter Default iParam[0] = 0; switch (iParam[0]) { @@ -535,7 +535,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // Set extended mode - case 'h': + case 'h': { for (int i = 0; i < iCurrentParam; i++) { // Changed to a switch statement (Paul Brannan 5/27/98) @@ -607,7 +607,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // Print Screen - case 'i': + case 'i': if (iCurrentParam < 1) iParam[0]=0; switch (iParam[0]){ @@ -628,7 +628,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // Unset extended mode - case 'l': + case 'l': { for (int i = 0; i < iCurrentParam; i++) { // Changed to a switch statement (Paul Brannan 5/27/98) @@ -708,7 +708,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // report cursor position Row X Col - case 'n': + case 'n': if (iCurrentParam == 1 && iParam[0]==5) { // report the cursor position Network.WriteString("\x1B[0n", 6); @@ -728,7 +728,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) strcat(szCursorReport, "R"); Network.WriteString(szCursorReport, strlen(szCursorReport)); - + } break; // Miscellaneous weird sequences (Paul Brannan 6/27/98) @@ -747,7 +747,7 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) } break; // Scroll Screen - case 'r': + case 'r': if (iCurrentParam < 1) { // Enable scrolling for entire display Console.SetScroll(-1, -1); @@ -771,12 +771,12 @@ char* TANSIParser::ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd) Console.SetCursorPosition(0, 0); break; // Save cursor position - case 's': + case 's': SaveCurY(Console.GetRawCursorY()); SaveCurX(Console.GetRawCursorX()); break; // Restore cursor position - case 'u': + case 'u': Console.SetRawCursorPosition(iSavedCurX, iSavedCurY); break; // DEC terminal report (Paul Brannan 6/28/98) @@ -814,7 +814,7 @@ char* TANSIParser::ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd) int iParam[nParam] = {1, 0, 0, 0, 0}; // Assume 1 parameter, Default 1 int iCurrentParam = 0; char sRepeat[2]; - + // Get parameters from escape sequence. while ((tmpc = *pszBuffer) <= '?') { if(tmpc < '0' || tmpc > '9') { @@ -825,16 +825,16 @@ char* TANSIParser::ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd) } pszBuffer++; } - + // Got Numerical Parameter. iParam[iCurrentParam] = strtoul(pszBuffer, &pszBuffer, 10); if (iCurrentParam < nParam) iCurrentParam++; } - + //~~~ TITUS: Apparently the digit is optional (look at termcap or terminfo) // So: If there is no digit, assume a count of 1 - + switch ((unsigned char)*pszBuffer++) { case 'A': // set colors @@ -843,7 +843,7 @@ char* TANSIParser::ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd) if (iParam[0] <= 15 && iParam[1] <= 15) Console.SetAttrib( (iParam[1] << 4) | iParam[0] ); break; - + case 'R': // define region mteRegionXF = -1; @@ -852,7 +852,7 @@ char* TANSIParser::ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd) mteRegionXF = iParam[1]-1; mteRegionYF = iParam[0]-1; break; - + case 'F': // fill with char { @@ -868,12 +868,12 @@ char* TANSIParser::ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd) { Console.SetCursorPosition(xi,y); for(int x=xi;x<=xf;++x) - + Console.WriteStringFast(sRepeat,1); } } break; - + case 'S': // Scroll region { @@ -910,7 +910,7 @@ char* TANSIParser::ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd) #endif break; } - + return pszBuffer; } #endif @@ -921,19 +921,19 @@ char* TANSIParser::ParseEscape(char* pszBuffer, char* pszBufferEnd) { // Check if we have enough characters in buffer. if ((pszBufferEnd - pszBuffer) < 2) return pszBuffer; - + // I.Ioannou 04 Sep 1997 // there is no need for pszBuffer++; after each command - + // Decode the command. pszBuffer++; - + switch (*pszBuffer++) { case 'A': // Cursor up Console.MoveCursorPosition(0, -1); break; // Cursor down - case 'B': + case 'B': Console.MoveCursorPosition(0, 1); break; // Cursor right @@ -960,7 +960,7 @@ char* TANSIParser::ParseEscape(char* pszBuffer, char* pszBufferEnd) { Charmap.setmap('B'); break; // Home cursor/tab set - case 'H': + case 'H': if(ini.get_vt100_mode()) { int x = Console.GetCursorX(); if(x != 0) { @@ -980,7 +980,7 @@ char* TANSIParser::ParseEscape(char* pszBuffer, char* pszBufferEnd) { Console.reverse_index(); break; // Erase end of screen - case 'J': + case 'J': Console.ClearEOScreen(); break; // Erase EOL @@ -1040,7 +1040,7 @@ char* TANSIParser::ParseEscape(char* pszBuffer, char* pszBufferEnd) { } } else { pszBuffer--; - } + } break; // Graphics processor off (See note 3) case '2': @@ -1129,7 +1129,7 @@ char* TANSIParser::ParseEscape(char* pszBuffer, char* pszBufferEnd) { char* TANSIParser::ParseBuffer(char* pszHead, char* pszTail){ // copy into ANSI buffer char * pszResult; - + // Parse the buffer for ANSI or display while (pszHead < pszTail) { if(!ini.get_output_redir()) { @@ -1204,7 +1204,7 @@ int TANSIParser::StripBuffer(char* pszHead, char* pszTail, int width) { if(c != 0 && !(c%width)) lines++; } - + // Fill in the end of the buffer with blanks while(pszBuf <= pszTail) *pszBuf++ = ' '; @@ -1216,13 +1216,13 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) if(InPrintMode) { return PrintBuffer(pszBuffer, pszBufferEnd); } - + unsigned char tmpc = *(unsigned char *)pszBuffer; if(tmpc == 27) { return ParseEscape(pszBuffer, pszBufferEnd); } - + // if((fast_write && tmpc < 32) || // !print_ctrl && (tmpc < 32 || (EightBit_Ansi && // (tmpc > 128 && tmpc < 128 + ' ')))) { @@ -1239,7 +1239,7 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) const long CTRL_ACTION = 0x0d00ff81; const long CTRL_ALWAYS = 0x0800f501; if(!(((print_ctrl?CTRL_ALWAYS:CTRL_ACTION)>>tmpc)&1)) { - + Console.WriteString((char *)&tmpc, 1); pszBuffer++; return pszBuffer; @@ -1249,13 +1249,13 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) case 0: pszBuffer++; break; - + // I.Ioannou 5/30/98 case 7: Console.Beep(); pszBuffer++; break; - + // destructive backspace case 8: // Added option for destructive backspace (Paul Brannan 5/13/98) @@ -1269,7 +1269,7 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) else Console.WriteCtrlChar('\b'); pszBuffer++; break; - + // horizontal tab case 9: { @@ -1279,7 +1279,7 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) Console.SetCursorPosition(tab_stops[x], Console.GetCursorY()); } break; - + // Line Feed Char case 10: // Test for local echo (Paul Brannan 8/25/98) @@ -1288,14 +1288,14 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) Console.WriteCtrlChar('\x0a'); pszBuffer++; break; - + // form feed case 12: pszBuffer++; Console.ClearScreen(); Console.SetRawCursorPosition(Console.GetCursorX(), 1); // changed fm 1 break; - + case 13: Console.WriteCtrlChar('\x0d'); pszBuffer++; @@ -1307,13 +1307,13 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) Charmap.setmap(map_G1); // Paul Brannan 6/25/98 current_map = 1; break; - + case 15: // shift in pszBuffer++; Charmap.setmap(map_G0); // Paul Brannan 6/25/98 current_map = 0; break; - + // Paul Brannan 9/1/98 - Is this okay? default: pszBuffer++; @@ -1352,13 +1352,13 @@ char* TANSIParser::ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd) *pszCurrent |= 0x80 ; pszCurrent++; } - + // Note that this may break dumpfiles slightly. // If 'B' is set to anything other than ASCII, this will cause problems // (Paul Brannan 6/28/98) if(current_map != 'B' && Charmap.enabled) - Charmap.translate_buffer(pszBuffer, pszCurrent); - + Charmap.translate_buffer(pszBuffer, pszCurrent); + last_char = *(pszCurrent-1); // TITUS++: Remember last char if(fast_write) { @@ -1379,7 +1379,7 @@ char* TANSIParser::PrintBuffer(char* pszBuffer, char* pszBufferEnd) { if ((pszBufferEnd - pszBuffer) < 4) return pszBuffer; char *tmpChar; - + tmpChar = pszBuffer; if ( *tmpChar == 27 ) { tmpChar++; @@ -1397,13 +1397,13 @@ char* TANSIParser::PrintBuffer(char* pszBuffer, char* pszBufferEnd) { } } } - + if (printfile != NULL) { fputc( *pszBuffer, printfile); pszBuffer++; } else InPrintMode = 0; - + return pszBuffer; } diff --git a/reactos/base/applications/network/telnet/src/keytrans.cpp b/reactos/base/applications/network/telnet/src/keytrans.cpp index 518b96282b2..0647c8e636c 100644 --- a/reactos/base/applications/network/telnet/src/keytrans.cpp +++ b/reactos/base/applications/network/telnet/src/keytrans.cpp @@ -94,11 +94,11 @@ int KeyTranslator::switchMap(TKeyDef& tk) { // Let the calling function interpret the error code (Paul Brannan 12/17/98) int KeyTranslator::SwitchTo(int to) { - + int max = mapArray.GetItemsInContainer(); if (max == 0) return -1; if (to < 0 || to > (max-1)) return 0; - + currentKeyMap = to; return 1; }; @@ -109,16 +109,16 @@ const char *KeyTranslator::TranslateKey(WORD wVirtualKeyCode, DWORD dwControlKeyState) { if ( mapArray.IsEmpty() ) return NULL; - + TKeyDef ask(NULL, dwControlKeyState, wVirtualKeyCode); - + // if a keymap switch pressed if ( switchMap(ask) > 0 ) return ""; - + int i = mapArray[currentKeyMap].map.Find(ask); - + if ( i != INT_MAX) return mapArray[currentKeyMap].map[i].GetszKey(); - + // if not found in current keymap if ( currentKeyMap != mainKeyMap ) { i = mapArray[mainKeyMap].map.Find(ask); @@ -192,9 +192,9 @@ int KeyTranslator::DeleteKeyDef(WORD wVirtualKeyCode, DWORD dwControlKeyState) { if ( mapArray.IsEmpty() || mapArray[currentKeyMap].map.IsEmpty() ) return 0; - + int i = mapArray[currentKeyMap].map.Find(TKeyDef(NULL, dwControlKeyState, wVirtualKeyCode)); - + if ( i != INT_MAX) { mapArray[currentKeyMap].map.Destroy(i); return 1; @@ -211,7 +211,7 @@ void KeyTranslator::DeleteAllDefs(void) // memory. I think flush() should do the same thing, at least the // way it is written with STL_BIDS (Paul Brannan 5/25/98). int max; - + max = mapArray.GetItemsInContainer(); if ( ! mapArray.IsEmpty() ) { for ( int i = 0; i < max; i++ ) { diff --git a/reactos/base/applications/network/telnet/src/tcharmap.cpp b/reactos/base/applications/network/telnet/src/tcharmap.cpp index bafe62e2484..23564c8b872 100644 --- a/reactos/base/applications/network/telnet/src/tcharmap.cpp +++ b/reactos/base/applications/network/telnet/src/tcharmap.cpp @@ -198,7 +198,7 @@ TCharmap::TCharmap() { TCharmap::~TCharmap() { for(int j = 0; j < 256; j++) { if(map[j]) { - // Don't delete static maps! + // Don't delete static maps! switch(j) { case 'B': case 'A': diff --git a/reactos/base/applications/network/telnet/src/tconsole.cpp b/reactos/base/applications/network/telnet/src/tconsole.cpp index ab11fca6bcc..ec866816c0d 100644 --- a/reactos/base/applications/network/telnet/src/tconsole.cpp +++ b/reactos/base/applications/network/telnet/src/tconsole.cpp @@ -75,7 +75,7 @@ TConsole::TConsole(HANDLE h) { SetConsoleTextAttribute(hConsole, wAttributes); insert_mode = 0; - + // Set the screen size SetWindowSize(ini.get_term_width(), ini.get_term_height()); @@ -125,7 +125,7 @@ void TConsole::Normal() { // but not with others (for example SCO) // we must preserve the colors : // 06/04/98 thanks to Paul a .ini parameter from now on - + BlinkOff(); UnderlineOff(); if(ini.get_preserve_colors()) { @@ -141,13 +141,13 @@ void TConsole::Normal() { void TConsole::SetForeground(unsigned char wAttrib) { if(reverse) bg = wAttrib; else fg = wAttrib; - wAttributes = (wAttributes & (unsigned char)0x88) | + wAttributes = (wAttributes & (unsigned char)0x88) | (unsigned char)fg | (bg << 4); } void TConsole::SetBackground(unsigned char wAttrib) { if(reverse) fg = wAttrib; else bg = wAttrib; - wAttributes = (wAttributes & (unsigned char)0x88) | + wAttributes = (wAttributes & (unsigned char)0x88) | (unsigned char)fg | (bg << 4); } @@ -268,7 +268,7 @@ void TConsole::Lightbg() { ReadConsoleOutputAttribute(hConsole, pAttributes, (DWORD)(CON_COLS), Coord, &Result); - + for(DWORD j = 0; j < Result; j++) pAttributes[j] |= 0x80; WriteConsoleOutputAttribute(hConsole, pAttributes, Result, Coord, @@ -294,7 +294,7 @@ void TConsole::Darkbg() { ReadConsoleOutputAttribute(hConsole, pAttributes, (DWORD)(CON_COLS), Coord, &Result); - + for(DWORD j = 0; j < Result; j++) pAttributes[j] &= 0x7f; WriteConsoleOutputAttribute(hConsole, pAttributes, Result, Coord, @@ -473,7 +473,7 @@ unsigned long TConsole::WriteStringFast(const char* pszString, unsigned long cbS unsigned long TConsole::WriteString(const char* pszString, unsigned long cbString) { DWORD Result = 0; - + SetConsoleTextAttribute(hConsole, wAttributes); //check to see if the line is longer than the display @@ -559,14 +559,14 @@ unsigned long TConsole::WriteCtrlChar(char c) { // The console does not handel the CR/LF chars as we might expect // when using color. The attributes are not set correctly, so we // must interpret them manualy to preserve the colors on the screen. - + unsigned long Result = 0; // just in case (Paul Brannan 6/26/98) switch (c) { case '\x09': // horizontal tab SetCursorPosition((((CON_CUR_X/8)+1)*8), CON_CUR_Y); Result = 1; break; - + case '\x0a': // line feed index(); Result = 1; @@ -583,7 +583,7 @@ unsigned long TConsole::WriteCtrlChar(char c) { default : // else just write it like normal break; } - + return Result; } @@ -595,7 +595,7 @@ void TConsole::index() { } else if ((iScrollEnd == -1 && (signed)CON_CUR_Y >= (signed)CON_HEIGHT)) { DWORD Result; WriteConsole(hConsole, "\n", 1, &Result, NULL); - + // If we aren't at the bottom of the buffer, then we need to // scroll down (Paul Brannan 4/14/2000) if(iScrollEnd == -1 && ConsoleInfo.srWindow.Bottom < ConsoleInfo.dwSize.Y - 1) { @@ -626,11 +626,11 @@ void TConsole::reverse_index() { void TConsole::ScrollDown( int iStartRow , int iEndRow, int bUp ){ CHAR_INFO ciChar; SMALL_RECT srScrollWindow; - + // Correction from I.Ioannou 11 May 1997 // check the scroll region if (iStartRow < iScrollStart) iStartRow = iScrollStart; - + // Correction from I.Ioannou 11 May 1997 // this will make Top the CON_TOP if ( iStartRow == -1) iStartRow = 0; @@ -646,7 +646,7 @@ void TConsole::ScrollDown( int iStartRow , int iEndRow, int bUp ){ if ( iStartRow > CON_HEIGHT) iStartRow = CON_HEIGHT; if ( iEndRow > CON_HEIGHT) iEndRow = CON_HEIGHT; - + srScrollWindow.Left = (CON_LEFT); srScrollWindow.Right = (SHORT) (CON_RIGHT); srScrollWindow.Top = (SHORT) (CON_TOP + iStartRow ); @@ -654,10 +654,10 @@ void TConsole::ScrollDown( int iStartRow , int iEndRow, int bUp ){ ciChar.Char.AsciiChar = ' '; // fill with spaces ciChar.Attributes = wAttributes; // fill with current attrib - + // This should speed things up (Paul Brannan 9/2/98) COORD dwDestOrg = {srScrollWindow.Left, srScrollWindow.Top + bUp}; - + // Note that iEndRow and iStartRow had better not be equal to -1 at this // point. There are four cases to consider for out of bounds. Two of // these cause the scroll window to be cleared; the others cause the @@ -680,7 +680,7 @@ void TConsole::ScrollDown( int iStartRow , int iEndRow, int bUp ){ // Modify the scroll region (Paul Brannan 12/3/98) srScrollWindow.Bottom -= bUp; } - + ScrollConsoleScreenBuffer(hConsole, &srScrollWindow, 0, dwDestOrg, &ciChar); } @@ -773,27 +773,27 @@ void TConsole::InsertLine(int numlines) SMALL_RECT clip; CHAR_INFO fill; int acty; - + // Rest of screen would be deleted if ( (acty = GetCursorY()) >= CON_LINES - numlines ) { ClearEOScreen(); // delete rest of screen return; } /* IF */ - + // Else scroll down the part of the screen which is below the // cursor. from.Left = CON_LEFT; from.Top = CON_TOP + (SHORT)acty; from.Right = CON_LEFT + (SHORT)CON_COLS; from.Bottom = CON_TOP + (SHORT)CON_LINES; - + clip = from; to.X = 0; to.Y = (SHORT)(from.Top + numlines); - + fill.Char.AsciiChar = ' '; fill.Attributes = 7; // WHICH ATTRIBUTES TO TAKE FOR BLANK LINE ?? - + ScrollConsoleScreenBuffer(hConsole, &from, &clip, to, &fill); } /* InsertLine */ @@ -805,24 +805,24 @@ void TConsole::InsertCharacter(int numchar) SMALL_RECT clip; COORD to; CHAR_INFO fill; - + if ( (actx = GetCursorX()) >= CON_COLS - numchar ) { ClearEOLine(); return; } /* IF */ - + from.Left = CON_LEFT + (SHORT)actx; from.Top = CON_TOP + (SHORT)GetCursorY(); from.Right = CON_LEFT + (SHORT)CON_COLS; from.Bottom = CON_TOP + (SHORT)from.Top; - + clip = from; to.X = (SHORT)(actx + numchar); to.Y = from.Top; - + fill.Char.AsciiChar = ' '; fill.Attributes = wAttributes; // WHICH ATTRIBUTES TO TAKE FOR BLANK CHAR ?? - + ScrollConsoleScreenBuffer(hConsole, &from, &clip, to, &fill); } /* InsertCharacter */ @@ -837,24 +837,24 @@ void TConsole::DeleteCharacter(int numchar) SMALL_RECT clip; COORD to; CHAR_INFO fill; - + if ( (actx = GetCursorX()) >= CON_COLS - numchar ) { ClearEOLine(); return; } /* IF */ - + from.Left = CON_LEFT + (SHORT)actx; from.Top = CON_TOP + (SHORT)GetCursorY(); from.Right = CON_LEFT + (SHORT)CON_COLS; from.Bottom = CON_TOP + from.Top; - + clip = from; to.X = (SHORT)(actx - numchar); to.Y = from.Top; - + fill.Char.AsciiChar = ' '; fill.Attributes = wAttributes; // WHICH ATTRIBUTES TO TAKE FOR BLANK CHAR ?? - + ScrollConsoleScreenBuffer(hConsole, &from, &clip, to, &fill); } /* DeleteCharacter */ @@ -865,11 +865,11 @@ void TConsole::SetRawCursorPosition(int x, int y) { if (y < 0) y = 0; COORD Coord = {(short)(CON_LEFT + x), (short)(CON_TOP + y)}; SetConsoleCursorPosition(hConsole, Coord); - + // Update the ConsoleInfo struct (Paul Brannan 5/9/98) ConsoleInfo.dwCursorPosition.Y = Coord.Y; ConsoleInfo.dwCursorPosition.X = Coord.X; - + // bug fix in case we went too far (Paul Brannan 5/25/98) if(ConsoleInfo.dwCursorPosition.X < CON_LEFT) ConsoleInfo.dwCursorPosition.X = CON_LEFT; @@ -899,7 +899,7 @@ void TConsole::SetCursorPosition(int x, int y) { COORD Coord = {(short)(CON_LEFT + x), (short)(CON_TOP + y)}; SetConsoleCursorPosition(hConsole, Coord); - + // Update the ConsoleInfo struct ConsoleInfo.dwCursorPosition.Y = Coord.Y; ConsoleInfo.dwCursorPosition.X = Coord.X; @@ -938,26 +938,26 @@ void saveScreen(CHAR_INFO *chiBuffer) { SMALL_RECT srctReadRect; COORD coordBufSize; COORD coordBufCoord; - + hStdout = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hStdout, &ConsoleInfo); - + srctReadRect.Top = CON_TOP; /* top left: row 0, col 0 */ srctReadRect.Left = CON_LEFT; srctReadRect.Bottom = CON_BOTTOM; /* bot. right: row 1, col 79 */ srctReadRect.Right = CON_RIGHT; - + coordBufSize.Y = CON_BOTTOM-CON_TOP+1; coordBufSize.X = CON_RIGHT-CON_LEFT+1; - + coordBufCoord.X = CON_TOP; coordBufCoord.Y = CON_LEFT; - + ReadConsoleOutput( hStdout, /* screen buffer to read from */ chiBuffer, /* buffer to copy into */ coordBufSize, /* col-row size of chiBuffer */ - + coordBufCoord, /* top left dest. cell in chiBuffer */ &srctReadRect); /* screen buffer source rectangle */ } @@ -968,19 +968,19 @@ void restoreScreen(CHAR_INFO *chiBuffer) { SMALL_RECT srctReadRect; COORD coordBufSize; COORD coordBufCoord; - + hStdout = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hStdout, &ConsoleInfo); - + // restore screen srctReadRect.Top = CON_TOP; /* top left: row 0, col 0 */ srctReadRect.Left = CON_LEFT; srctReadRect.Bottom = CON_BOTTOM; /* bot. right: row 1, col 79 */ srctReadRect.Right = CON_RIGHT; - + coordBufSize.Y = CON_BOTTOM-CON_TOP+1; coordBufSize.X = CON_RIGHT-CON_LEFT+1; - + coordBufCoord.X = CON_TOP; coordBufCoord.Y = CON_LEFT; WriteConsoleOutput( @@ -990,7 +990,7 @@ void restoreScreen(CHAR_INFO *chiBuffer) { coordBufCoord, /* top left src cell in chiBuffer */ &srctReadRect); /* dest. screen buffer rectangle */ // end restore screen - + } CHAR_INFO* newBuffer() { diff --git a/reactos/base/applications/network/telnet/src/tmapldr.cpp b/reactos/base/applications/network/telnet/src/tmapldr.cpp index de41cbb539e..16aae9308c1 100644 --- a/reactos/base/applications/network/telnet/src/tmapldr.cpp +++ b/reactos/base/applications/network/telnet/src/tmapldr.cpp @@ -49,44 +49,44 @@ // AVS // skip inline comments, empty lines static char * getline(istream& i, char* buf, int size){ - + int len = 0; - + while (1) { memset(buf,0,size); if (i.eof()) break; i.getline(buf,size,'\n'); - + while (buf[len]) { if ( /*(buf[len]>=0) &&*/ buf[len]< ' ' ) buf[len] = ' '; len++; }; len = 0; - + // not so fast, but work ;) while ( buf[len] ) { if ( (buf[len] == ' ') && (buf[len+1] == ' ')) { memmove(buf+len, buf+len+1, strlen(buf+len)); } else len++; }; - + if (buf[0] == ' ') memmove(buf, buf+1, size-1); - + // empty or comment if ((buf[0]==0)||(buf[0]==';')) continue; - + len = 0; // look for comment like this one while (buf[len]) if ((buf[len] == '/') && (buf[len+1] == '/')) buf[len] = 0; else len++; - + if (len && (buf[len-1] == ' ')) { len--; buf[len]=0; }; // in case for comment like this one (in line just a comment) if (buf[0]==0) continue; - + break; }; return (buf); @@ -95,7 +95,7 @@ static char * getline(istream& i, char* buf, int size){ //AVS // use string as FIFO queue for lines static int getline(string&str, char* buf, size_t sz) { - + if ( !str.length() ) return 0; const char * p = strchr(str.c_str(),'\n'); unsigned int len; // Changed to unsigned (Paul Brannan 6/23/98) @@ -103,9 +103,9 @@ static int getline(string&str, char* buf, size_t sz) { len = str.length(); else len = p - str.c_str(); - + len = len no value for " << Name << endl; @@ -301,12 +301,12 @@ char* TMapLoader::ParseKeyDef(const char* buf, WORD& vk_code, DWORD& control) { strcpy(wbuf,buf); char* ptr = strtok(wbuf, TOKEN_DELIMITERS); if ( ptr == NULL ) return NULL; - + int i = KeyTrans.LookOnGlobal(ptr); if ( i == INT_MAX ) return NULL; - + vk_code = KeyTrans.GetGlobalCode(i); - + control = 0; DWORD st; while (1) { @@ -314,9 +314,9 @@ char* TMapLoader::ParseKeyDef(const char* buf, WORD& vk_code, DWORD& control) { if ((ptr == NULL) || ((st = Fix_ControlKeyState(ptr)) == 0)) break; control |= st; }; - + if ( ptr == NULL ) return NULL; - + return Fix_Tok(ptr); }; @@ -324,7 +324,7 @@ char* TMapLoader::ParseKeyDef(const char* buf, WORD& vk_code, DWORD& control) { // load keymap to current map // be aware - buf must passed by value, its destroyed int TMapLoader::LoadKeyMap(string buf) { - + char wbuf[128]; WORD vk_code; DWORD control; @@ -358,7 +358,7 @@ int TMapLoader::LoadKeyMap(string buf) { if (!getline(buf,wbuf,sizeof(wbuf))) break; if ( wbuf[0]==0 ) break; if ( strnicmp(wbuf,"[keymap",7)==0 ) continue; - + char * keydef = ParseKeyDef(wbuf,vk_code,control); if ( keydef != NULL ) { @@ -378,7 +378,7 @@ int TMapLoader::LoadKeyMap(string buf) { if(!KeyTrans.AddKeyDef(vk_code, control, TN_CR)) return 0; } else if(!strnicmp(keydef, "\\tn_crlf", strlen("\\tn_crlf"))) { if(!KeyTrans.AddKeyDef(vk_code, control, TN_CRLF)) return 0; - } else + } else if(!KeyTrans.AddKeyDef(vk_code,control,keydef)) return 0; // else DeleteKeyDef() ???? - I'm not sure... } @@ -393,9 +393,9 @@ int TMapLoader::LoadCharMap(string buf) { char wbuf[128]; char charmapname[128]; charmapname[0] = 0; - + // xlat.init(); now it done by KeyTranslator::Load() - + while ( buf.length() ) { wbuf[0]=0; if (!getline(buf,wbuf,sizeof(wbuf))) break; @@ -406,10 +406,10 @@ int TMapLoader::LoadCharMap(string buf) { }; char * host = strtok(wbuf, " "); char * console = strtok(NULL, " "); - + int bHost; int bConsole; - + if ( host == NULL || console == NULL ) { // cerr << charmapname << " -> Bad structure" << endl; printm(0, FALSE, MSG_KEYBADSTRUCT, charmapname); @@ -419,12 +419,12 @@ int TMapLoader::LoadCharMap(string buf) { bHost = getbyte(host+1); else bHost = (unsigned char)host[0]; - + if ( strlen(console) > 1 && console[0] == '\\' ) bConsole = getbyte(console+1); else bConsole = (unsigned char)console[0]; - + if ( bHost <= 0 || bConsole <= 0 ) { // cerr << charmapname << " -> Bad chars? " // << host << " -> " << console << endl; @@ -442,7 +442,7 @@ int TMapLoader::LoadCharMap(string buf) { // ignore long comment [comment] ... [end comment] // recursive! int getLongComment(istream& is, char* wbuf, size_t sz) { - + int bufLen; while ( is ) { wbuf[0] = 0; @@ -451,7 +451,7 @@ int getLongComment(istream& is, char* wbuf, size_t sz) { bufLen = strlen(wbuf); if ( wbuf[0] == '[' && wbuf[bufLen-1] == ']' ) { string temps(wbuf); - + if (!normalizeSplitter(temps)) { // cerr << "Unexpected line '" << temps << "'\n"; printm(0, FALSE, MSG_KEYUNEXPLINE, temps.c_str()); @@ -474,25 +474,25 @@ int getLongComment(istream& is, char* wbuf, size_t sz) { int TMapLoader::Load(const char * filename, const char * szActiveEmul) { char buf[256]; int bufLen; - + ifstream inpfile(filename); KeyTrans.DeleteAllDefs(); Charmap.init(); - + // it is an array for store [...] ... [end ...] parts from file stringArray SA(0,0,sizeof(string)); int AllOk = 0; - + while ( inpfile ) { - + getline(inpfile, buf, 255); bufLen = strlen(buf); if ( !bufLen ) continue; - + if ( buf[0] == '[' && buf[bufLen-1] == ']' ) { // is a part splitter [...] string temps(buf); - + if (!normalizeSplitter(temps)) { printm(0, FALSE, MSG_KEYUNEXPLINE, temps.c_str()); AllOk = 0; @@ -512,8 +512,8 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { #endif continue; }; - - + + string back = temps; // prepare line for make it as [end ...] // and check it @@ -550,12 +550,12 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { printm(0, FALSE, MSG_KEYUNEXPTOK, back.c_str()); break; }; - + back.insert(1,"END "); // now it looks like [END ...] #ifdef KEYDEBUG printit(temps.c_str()); #endif - + int ok = 0; // fetch it to temps while ( 1 ) { @@ -565,16 +565,16 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { if ( buf[0] == '[' && buf[bufLen-1] == ']' ) { string t(buf); if ( !normalizeSplitter(t) ) break; - + if ( stricmp(t.c_str(),back.c_str()) == 0 ) { ok = 1; break; }; - + // AVS 31.12.97 fix [comment] block inside another block if ( stricmp(t.c_str(),"[comment]") == 0 && getLongComment(inpfile, buf, sizeof(buf)) ) continue; - + break; }; temps += "\n"; @@ -598,13 +598,13 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { break; }; }; - + inpfile.close(); - + if ( !AllOk ) return 0; - + // now all file are in SA, comments are stripped - + int i = LookForPart(SA, "global", ""); if ( i == INT_MAX ) { // cerr << "No [GLOBAL] definition!" << endl; @@ -614,7 +614,7 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { if ( !LoadGlobal(SA[i]) ) { return 0; }; - + // look for need configuration i = LookForPart(SA, "config", szActiveEmul); if ( i == INT_MAX ) { @@ -625,7 +625,7 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { // cerr << "use configuration: " << szActiveEmul << endl; printm(0, FALSE, MSG_KEYUSECONFIG, szActiveEmul); BOOL hadKeys = FALSE; - + string config = SA[i]; // parse it while ( config.length() ) { @@ -638,7 +638,7 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { printit("\t"); printit(buf); printit("\n"); char * mapdef = strtok(buf,":"); char * switchKey = strtok(NULL,"\n"); - + if ( !KeyTrans.mapArray.IsEmpty() && switchKey == NULL ) { // cerr << "no switch Key for '" << mapdef // << "'" << endl; @@ -687,7 +687,7 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { hadKeys = LoadKeyMap(SA[i]); // load it }; }; - + } else if ( strnicmp(buf,"charmap",7) == 0 ) { printit("\t"); printit(buf); printit("\n"); @@ -713,7 +713,7 @@ int TMapLoader::Load(const char * filename, const char * szActiveEmul) { Charmap.init(); }; /* strtok(buf," "); - + char* name = strtok(NULL," "); if ( name == NULL ) { cerr << "No name for CHARMAP" << endl; diff --git a/reactos/base/applications/network/telnet/src/tmouse.cpp b/reactos/base/applications/network/telnet/src/tmouse.cpp index 9f87c048f8e..322965bc5a3 100644 --- a/reactos/base/applications/network/telnet/src/tmouse.cpp +++ b/reactos/base/applications/network/telnet/src/tmouse.cpp @@ -71,9 +71,9 @@ void TMouse::move_mouse(COORD start_coords, COORD end_coords) { FillConsoleOutputAttribute(hStdout, normal, ConsoleInfo.dwSize.X * ConsoleInfo.dwSize.Y, screen_start, &Result); - + get_coords(&start_coords, &end_coords, &first_coords, &last_coords); - FillConsoleOutputAttribute(hStdout, inverse, ConsoleInfo.dwSize.X * + FillConsoleOutputAttribute(hStdout, inverse, ConsoleInfo.dwSize.X * (last_coords.Y - first_coords.Y) + (last_coords.X - first_coords.X), first_coords, &Result); } @@ -158,7 +158,7 @@ void TMouse::doMouse() { COORD start_coords = InputRecord.Event.MouseEvent.dwMousePosition; COORD end_coords = start_coords; BOOL done = FALSE; - + // init vars doMouse_init(); int normal_bg = ini.get_normal_bg(); @@ -171,7 +171,7 @@ void TMouse::doMouse() { // make screen all one attribute FillConsoleOutputAttribute(hStdout, normal, ConsoleInfo.dwSize.X * ConsoleInfo.dwSize.Y, screen_start, &Result); - + while(!done) { switch (InputRecord.EventType) { @@ -183,23 +183,23 @@ void TMouse::doMouse() { done = TRUE; } break; - + case MOUSE_MOVED: end_coords = InputRecord.Event.MouseEvent.dwMousePosition; - move_mouse(start_coords, end_coords); + move_mouse(start_coords, end_coords); break; } break; // If we are changing focus, we don't want to highlight anything // (Paul Brannan 9/2/98) case FOCUS_EVENT: - return; + return; } - + WaitForSingleObject(hConsole, INFINITE); if (!ReadConsoleInput(hConsole, &InputRecord, 1, &Result)) done = TRUE; - + } doMouse_cleanup(); diff --git a/reactos/base/applications/network/telnet/src/tnclass.cpp b/reactos/base/applications/network/telnet/src/tnclass.cpp index bad1700b834..b7a1f835310 100644 --- a/reactos/base/applications/network/telnet/src/tnclass.cpp +++ b/reactos/base/applications/network/telnet/src/tnclass.cpp @@ -214,7 +214,7 @@ int Telnet::Open(const char *szHost1, const char *strPort1){ } else if(bWinsockUp && bConnected) { printm (0, FALSE, MSG_ALREADYCONNECTED, szHost); } - + return TNNOCON; // cannot do winsock stuff or already connected } @@ -341,7 +341,7 @@ SOCKET Telnet::Connect() itoa(SockAddr.sin_addr.S_un.S_un_b.s_b4, ss_b4, 10); itoa(ntohs(SockAddr.sin_port), ss_b5, 10); printm(0, FALSE, MSG_TRYING, ss_b1, ss_b2, ss_b3, ss_b4, ss_b5); - + if (connect(Socket1, (sockaddr*)&SockAddr, sizeof(SockAddr))) return INVALID_SOCKET; @@ -366,7 +366,7 @@ void Telnet::NewProcess() { strcpy(cmd_line, ini.get_startdir()); strcat(cmd_line, ini.get_exename()); // Thomas Briggs 12/7/98 - + if(!SpawnProcess(cmd_line, &pi)) printm(0, FALSE, MSG_NOSPAWN); } diff --git a/reactos/base/applications/network/telnet/src/tnclip.cpp b/reactos/base/applications/network/telnet/src/tnclip.cpp index d957d5ab7a6..54f3eba2308 100644 --- a/reactos/base/applications/network/telnet/src/tnclip.cpp +++ b/reactos/base/applications/network/telnet/src/tnclip.cpp @@ -41,7 +41,7 @@ Tnclip::~Tnclip() { void Tnclip::Copy(HGLOBAL clipboard_data) { if(!OpenClipboard(Window)) return; if(!EmptyClipboard()) return; - + SetClipboardData(CF_TEXT, clipboard_data); CloseClipboard(); } @@ -54,7 +54,7 @@ void Tnclip::Paste() { DWORD size = strlen((const char *)clipboard_data); Network.WriteString((const char *)clipboard_ptr, size); GlobalUnlock(clipboard_data); - + CloseClipboard(); } diff --git a/reactos/base/applications/network/telnet/src/tncon.cpp b/reactos/base/applications/network/telnet/src/tncon.cpp index cb9fda54aef..10e9d4d0aed 100644 --- a/reactos/base/applications/network/telnet/src/tncon.cpp +++ b/reactos/base/applications/network/telnet/src/tncon.cpp @@ -146,7 +146,7 @@ const char *ClosestStateKey(WORD keyCode, DWORD keyState, const char *FindClosestKey(WORD keyCode, DWORD keyState, KeyTranslator &KeyTrans) { char const *p; - + // Paul Brannan 7/20/98 if(ini.get_alt_erase()) { if(keyCode == VK_BACK) { @@ -210,10 +210,10 @@ int telProcessConsole(NetParams *pParams, KeyTranslator &KeyTrans, HANDLE hConsole = GetStdHandle(STD_INPUT_HANDLE); SetConsoleMode(hConsole, ini.get_enable_mouse() ? ENABLE_MOUSE_INPUT : 0); - + const DWORD nHandle = 2; HANDLE hHandle[nHandle] = {hConsole, pParams->hExit}; - + for (;;) { DWORD dwInput; switch (WaitForMultipleObjects(nHandle, hHandle, FALSE, INFINITE)) { @@ -237,7 +237,7 @@ int telProcessConsole(NetParams *pParams, KeyTranslator &KeyTrans, INPUT_RECORD InputRecord[11]; if (!ReadConsoleInput(hConsole, &InputRecord[0], 10, &dwInput)) return TNPROMPT; - + for (i = 0; (unsigned)i < dwInput; i++){ switch (InputRecord[i].EventType) { case KEY_EVENT:{ @@ -245,7 +245,7 @@ int telProcessConsole(NetParams *pParams, KeyTranslator &KeyTrans, WORD keyCode = KEYEVENT.wVirtualKeyCode; DWORD keyState = KEYEVENT.dwControlKeyState; - + // Paul Brannan 5/27/98 // Moved the code that was here to FindClosestKey() keydef.szKeyDef = FindClosestKey(keyCode, @@ -309,7 +309,7 @@ int telProcessConsole(NetParams *pParams, KeyTranslator &KeyTrans, Network.do_naws(Console.GetWidth(), Console.GetHeight()); break; } - + } // keep going until no more input break; } @@ -323,7 +323,7 @@ WORD scrollkeys() { HANDLE hConsole = GetStdHandle(STD_INPUT_HANDLE); INPUT_RECORD InputRecord; BOOL done = FALSE; - + while (!done) { DWORD dwInput; WaitForSingleObject( hConsole, INFINITE ); diff --git a/reactos/base/applications/network/telnet/src/tnconfig.cpp b/reactos/base/applications/network/telnet/src/tnconfig.cpp index 402dac7f2b7..5bd8dfaef21 100644 --- a/reactos/base/applications/network/telnet/src/tnconfig.cpp +++ b/reactos/base/applications/network/telnet/src/tnconfig.cpp @@ -410,7 +410,7 @@ void TConfig::print_vars(char *s) { printit("\n"); return; } - + // Print out the vars in the given group int count = 0; for(j = 0; j < MAX_INI_VARS; j++) { @@ -486,7 +486,7 @@ int TConfig::print_value(const char *var) { printit(var_name); printit("\t"); Result = Result / 8 + 8; - + switch(ini_varlist[j].data_type) { case INI_STRING: printit((char *)ini_varlist[j].ini_data); @@ -527,7 +527,7 @@ void TConfig::init_vars() { } void TConfig::inifile_init() { - // B. K. Oxley 9/16/98 + // B. K. Oxley 9/16/98 char* env_telnet_ini = getenv (ENV_TELNET_INI); if (env_telnet_ini && *env_telnet_ini) { strncpy (inifile, env_telnet_ini, sizeof(inifile)); @@ -675,7 +675,7 @@ bool TConfig::Process_Params(int argc, char *argv[]) { *(s++) = 0; port = s; } - } + } if(optind < argc) port = argv[optind++]; diff --git a/reactos/base/applications/network/telnet/src/tnmain.cpp b/reactos/base/applications/network/telnet/src/tnmain.cpp index d2148bda9e4..5cbb66995fc 100644 --- a/reactos/base/applications/network/telnet/src/tnmain.cpp +++ b/reactos/base/applications/network/telnet/src/tnmain.cpp @@ -74,7 +74,7 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c char chr; char temp[2]; char temp1[80]; - + INPUT_RECORD InputRecord; BOOL done = FALSE; @@ -93,10 +93,10 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c MustRefresh = 0; if (InputRecord.EventType == KEY_EVENT && InputRecord.Event.KeyEvent.bKeyDown ) { - + if(InputRecord.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) { - + switch(InputRecord.Event.KeyEvent.wVirtualKeyCode) { case 'D': // Thomas Briggs 8/11/98 buf[0] = '\04'; @@ -112,7 +112,7 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c break; } } - + switch (InputRecord.Event.KeyEvent.wVirtualKeyCode) { case VK_UP: // crn@ozemail.com.au @@ -207,7 +207,7 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c } MustRefresh = 1; break; - + default: chr = InputRecord.Event.KeyEvent.uChar.AsciiChar; if (chr == '\r') { @@ -312,11 +312,11 @@ int main(int ArgC, char* ArgV[]) { GetStdHandle(STD_OUTPUT_HANDLE), &ConsoleScreenBufferInfo ); - + char *k; char startdir[MAX_PATH*2]; char exename[MAX_PATH]; - + // strncpy(startdir, ArgV[0],MAX_PATH); // This should be more accurate than using argv[0] (Paul Brannan 9/16/98) GetModuleFileName(NULL, startdir, sizeof(startdir)); @@ -325,7 +325,7 @@ int main(int ArgC, char* ArgV[]) { // ("Pedro A. Aranda Gutiérrez" ) TCHAR ConsoleTitle[255]; GetConsoleTitle(ConsoleTitle, sizeof(ConsoleTitle)); - + k = strrchr(startdir, '\\'); if (k == NULL){ // if the \ character is not found... strcpy(exename, startdir); @@ -338,9 +338,9 @@ int main(int ArgC, char* ArgV[]) { printm(0, FALSE, MSG_COPYRIGHT); printm(0, FALSE, MSG_COPYRIGHT_1); - + // set up the ini class - ini.init(startdir, exename); + ini.init(startdir, exename); // Process the command line arguments and connect to a host if necessary if(ini.Process_Params(ArgC, ArgV)) { @@ -359,7 +359,7 @@ int main(int ArgC, char* ArgV[]) { } } //// (Paul Brannan 5/14/98) - + if(ini.get_term_width() != -1 || ini.get_term_height() != -1) { SetConsoleScreenBufferSize( GetStdHandle(STD_OUTPUT_HANDLE), // handle of console screen buffer @@ -389,7 +389,7 @@ enum { EMPTY_LINE = -2, INVALID_CMD = -1, __FIRST_COMMAND = 0, - + OPEN = __FIRST_COMMAND, CLOSE, KEYS, @@ -399,16 +399,16 @@ enum { K_LOAD, // subcommand of 'keys' K_SWITCH, // subcommand of 'keys' K_DISPLAY, // subcommand of 'keys' - + SET, // Paul Brannan 5/30/98 - + SUSPEND, FASTQUIT, // Thomas Briggs 8/11/98 CMD_HISTORY, // crn@ozemail.com.au CLEAR_HISTORY, // crn@ozemail.com.au - + ALIASES, // Paul Brannan 1/1/99 - + __COMMAND_LIST_SIZE // must be last }; @@ -459,12 +459,12 @@ static int cmdMatch(const char* cmd, const char* token, int tokenLen, int minM) // The (unsigned) gets rid of a compiler warning (Paul Brannan 5/25/98) if ( (unsigned)tokenLen > strlen(cmd) ) return 0; if ( strcmp(cmd,token) == 0 ) return 1; - + int i; for ( i = 0; i < minM; i++ ) if ( cmd[i] != token[i] ) return 0; - + for ( i = minM; i < tokenLen; i++ ) if ( cmd[i] != token[i] ) return 0; - + return 1; }; @@ -510,7 +510,7 @@ int tokenizeCommand(char* szCommand, int& argc, char** argv) { // tokens[args] = p; // args++; // }; - + if ( !args ) return EMPTY_LINE; argc = args - 1; args = 0; @@ -547,12 +547,12 @@ int tokenizeCommand(char* szCommand, int& argc, char** argv) { return -3; }; }; - + for ( int i = 0; iprev != NULL) @@ -678,7 +678,7 @@ int telCommandLine (Telnet &MyConnection){ printf ("Command history:\n"); while (1) { printf ("\t%s\n", cmdhist->cmd); - + if (cmdhist->next != NULL) cmdhist = cmdhist->next; else @@ -686,9 +686,9 @@ int telCommandLine (Telnet &MyConnection){ } } else printf ("No command history available.\n"); - + break; - + case CLEAR_HISTORY: //crn@ozemail.com.au if (cmdhist != NULL) { while (cmdhist->next != NULL) @@ -702,11 +702,11 @@ int telCommandLine (Telnet &MyConnection){ printf ("Command history cleared.\n"); } else printf ("No command history available.\n"); - + case ALIASES: // Paul Brannan 1/1/99 ini.print_aliases(); break; - + default: // paranoik printm(0, FALSE, MSG_INVCMD); break; diff --git a/reactos/base/applications/network/telnet/src/tnmisc.cpp b/reactos/base/applications/network/telnet/src/tnmisc.cpp index 64e5253f7ed..51a2024c11e 100644 --- a/reactos/base/applications/network/telnet/src/tnmisc.cpp +++ b/reactos/base/applications/network/telnet/src/tnmisc.cpp @@ -6,7 +6,7 @@ // from the PVAX (http://www.ccas.ru/~posp/popov/spawn.htm) // Create a process with pipes to stdin/out/err -BOOL CreateHiddenConsoleProcess(LPCTSTR szChildName, PROCESS_INFORMATION* ppi, +BOOL CreateHiddenConsoleProcess(LPCTSTR szChildName, PROCESS_INFORMATION* ppi, LPHANDLE phInWrite, LPHANDLE phOutRead, LPHANDLE phErrRead) { BOOL fCreated; @@ -36,7 +36,7 @@ BOOL CreateHiddenConsoleProcess(LPCTSTR szChildName, PROCESS_INFORMATION* ppi, // process startup information memset( &si, 0, sizeof( si )); - si.cb = sizeof( si ); + si.cb = sizeof( si ); si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; // child process' console must be hidden for Win95 compatibility si.wShowWindow = SW_HIDE; @@ -72,7 +72,7 @@ error: CloseHandle( hErrWrite ); CloseHandle( ppi->hProcess ); CloseHandle( ppi->hThread ); - + hInRead = hOutWrite = hErrWrite = @@ -87,7 +87,7 @@ BOOL SpawnProcess(char *cmd_line, PROCESS_INFORMATION *pi) { memset(&si, 0, sizeof(si)); si.cb = sizeof(si); - + return CreateProcess(cmd_line, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, CREATE_NEW_CONSOLE, NULL, NULL, &si, pi); } @@ -97,9 +97,9 @@ int GetWin32Version(void) { // return win32 version; 0 = Win32s, 1 = Win95, 2 = WinNT, 3 = Unknown -crn@ozemail.com.au LPOSVERSIONINFO osv; DWORD retval; - + osv = new OSVERSIONINFO; - + osv->dwOSVersionInfoSize = sizeof (OSVERSIONINFO); GetVersionEx (osv); retval = osv->dwPlatformId; @@ -134,7 +134,7 @@ HWND TelnetGetConsoleWindow() { bool SetIcon(HWND hConsoleWindow, HANDLE hIcon, LPARAM *pOldBIcon, LPARAM *pOldSIcon, const char *icondir) { if(!hConsoleWindow) return false; - + // FIX ME!!! The LoadIcon code should work with any compiler! // (Paul Brannan 12/17/98) #ifndef __BORLANDC__ // Ioannou Dec. 8, 1998 @@ -149,7 +149,7 @@ bool SetIcon(HWND hConsoleWindow, HANDLE hIcon, LPARAM *pOldBIcon, LPARAM *pOldS hIcon = LoadImage(NULL, filename, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE + LR_LOADFROMFILE); } -#else +#else // load the icon from the resource file -crn@ozemail.com.au 16/12/98 if(!hIcon) { hIcon = LoadIcon ((HANDLE)GetWindowLong(hConsoleWindow, diff --git a/reactos/base/applications/network/telnet/src/tscroll.cpp b/reactos/base/applications/network/telnet/src/tscroll.cpp index 307dc2af080..6c8294ede4a 100644 --- a/reactos/base/applications/network/telnet/src/tscroll.cpp +++ b/reactos/base/applications/network/telnet/src/tscroll.cpp @@ -109,7 +109,7 @@ static BOOL WriteConsoleOutputCharAndAttribute( // we ought to allocate memory before writing to an address (PB 5/12/98) DWORD cWritten; const LPDWORD lpcWritten = &cWritten; - + DWORD cWriteCells = strlen(lpWriteBuffer); COORD coordWrite = {sX,sY}; LPWORD lpwAttribute = new WORD[cWriteCells]; @@ -146,7 +146,7 @@ static int setmaxlines(int iDisplay, int iScrollSize, int strippedlines, int con_width) { switch(iDisplay) { case HEX: return(iScrollSize / 16); break; - case DUMP: + case DUMP: case DUMPB: return(iScrollSize / con_width); break; case TEXTB: return(strippedlines); break; } @@ -196,7 +196,7 @@ void TScroller::ScrollBack(){ // Create buffer with ANSI codes stripped // Fixed this to work properly with a circular buffer (PB 12/4/98) char *stripped = new char[iScrollSize]; - memcpy(stripped, pcScrollData + iScrollBegin, iScrollSize - + memcpy(stripped, pcScrollData + iScrollBegin, iScrollSize - iScrollBegin); if(iScrollBegin != 0) memcpy(stripped + (iScrollSize - iScrollBegin), pcScrollData, iScrollBegin - 1); @@ -210,7 +210,7 @@ void TScroller::ScrollBack(){ // init scroll position int current = maxlines - CON_HEIGHT + 1; if(current < 0) current = 0; - + // paint border and info // paint last two lines black on white char * szStatusLine; @@ -218,7 +218,7 @@ void TScroller::ScrollBack(){ setstatusline(szStatusLine, CON_COLS, iDisplay); WriteConsoleOutputCharAndAttribute(hStdout, szStatusLine, status, CON_LEFT, CON_BOTTOM); - + // loop while not done BOOL done = FALSE; while (!done){ @@ -286,7 +286,7 @@ void TScroller::ScrollBack(){ // Find the starting position for(ch = 0, lines = 0, x = 1; ch < iScrollSize && lines < current; ch++, x++) { - + if(stripped[ch] == '\n') lines++; if(stripped[ch] == '\r') x = 1; } @@ -360,7 +360,7 @@ void TScroller::ScrollBack(){ break; } } - + // Clean up restoreScreen(chiBuffer); delete[] szStatusLine; diff --git a/reactos/base/applications/network/telnet/src/ttelhndl.cpp b/reactos/base/applications/network/telnet/src/ttelhndl.cpp index 1b38d397374..0020f3558f3 100644 --- a/reactos/base/applications/network/telnet/src/ttelhndl.cpp +++ b/reactos/base/applications/network/telnet/src/ttelhndl.cpp @@ -188,20 +188,20 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) // Ioannou 29 May 1998 : I prefer the union redefinitions // than the typecasting (used with them from Pascal and Cobol :-) ) // FIX ME !!!! Shall we use the winsock routines instead ? - + union { char szResponse[2]; int n; }; - + // Added support for user-defined term name (Paul Brannan 5/13/98) #define LASTTERM 4 const char *pszTerms[] = {ini.get_term(), "ANSI","DEC-VT100","DEC-VT52","UNKNOWN"}; if(!iTermSet && (pszTerms[0] == 0 || *pszTerms[0] == 0)) iTermSet++; - + if (pszBuffer + 2 < pszBufferEnd) { switch ((unsigned char)pszBuffer[1]) { - + ///////////////// DO //////////////////// case DO: { @@ -229,15 +229,15 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) TELOPT_PRINTD("RCVD DO TELOPT_NAWS\n"); SendIAC(WILL, TELOPT_NAWS); SendIAC(SB, TELOPT_NAWS); - + Network.SetNawsFunc(naws_string); - + n = Console.GetWidth(); SendIACParams(szResponse[1],szResponse [0]); - + n = Console.GetHeight(); SendIACParams(szResponse[1],szResponse[0]); - + SendIAC(SE); TELOPT_PRINTD("SENT WILL TELOPT_NAWS\n"); break; @@ -257,7 +257,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) pszBuffer += 3; break; } - + ///////////////// WILL //////////////////// case WILL: { @@ -281,7 +281,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) if(Network.get_local_echo()) Network.set_line_mode(0); } break; - + // Suppress Go Ahead (Paul Brannan 12/31/98) case TELOPT_SGA: TELOPT_PRINTD("RCVD WILL TELOPT_SGA\n"); @@ -292,7 +292,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) TELOPT_PRINTD("SENT DO TELOPT_SGA\n"); } break; - + ////added 1/28/97 default: TELOPT_PRINTD2("RCVD WILL", pszBuffer[2]); @@ -305,7 +305,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) pszBuffer += 3; break; } - + ///////////////// WONT //////////////////// case WONT: { @@ -321,7 +321,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) TELOPT_PRINTD("SENT DONT TELOPT_ECHO\n"); } break; - + // Suppress Go Ahead (Paul Brannan 12/31/98) case TELOPT_SGA: TELOPT_PRINTD("RCVD WONT TELOPT_SGA\n"); @@ -332,7 +332,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) TELOPT_PRINTD("SENT DONT TELOPT_SGA\n"); } break; - + default: TELOPT_PRINTD2("RCVD WONT", pszBuffer[2]); break; @@ -341,7 +341,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) pszBuffer += 3; break; } - + ///////////////// DONT //////////////////// case DONT: { @@ -368,7 +368,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) pszBuffer += 3; break; } - + ///////////////// SB //////////////////// case SB: { @@ -384,7 +384,7 @@ char* TTelnetHandler::ParseIAC(char* pszBuffer, char* pszBufferEnd) SendIACParams(0); Network.WriteString(pszTerms[iTermSet], strlen(pszTerms[iTermSet])); SendIAC(SE); - + if (iTermSet < LASTTERM ) iTermSet+=1; } @@ -437,7 +437,7 @@ char* TTelnetHandler::ParseBuffer(char* pszBuffer, char* pszBufferEnd){ while (pszBuffer < pszBufferEnd) { // if IAC then parse IAC if((unsigned char) *pszBuffer == IAC) { - + // check for escaped IAC if((pszBufferEnd >= pszBuffer + 1) && (unsigned char)*(pszBuffer + 1) == IAC) { @@ -492,7 +492,7 @@ DWORD TTelnetHandler::Go(LPVOID pvParams) // of TANSIParser (Paul Brannan 6/15/98) Console.sync(); // Sync with the parser so the cursor is positioned - + Parser.Init(); // Reset the parser (Paul Brannan 9/19/98) init(); // Turn on local echo (Paul Brannan 9/19/98) @@ -515,7 +515,7 @@ DWORD TTelnetHandler::Go(LPVOID pvParams) break; } pszTail += Result; - + // Process the buffer char* pszNewHead = pszHead; do { @@ -525,12 +525,12 @@ DWORD TTelnetHandler::Go(LPVOID pvParams) WaitForSingleObject(pParams->hUnPause, INFINITE); *pParams->bNetPaused = 0; } - + pszHead = pszNewHead; pszNewHead = ParseBuffer(pszHead, pszTail); // Parse buffer } while ((pszNewHead != pszHead) && (pszNewHead < pszTail) && !*pParams->bNetFinish); pszHead = pszNewHead; - + // When we reach the end of the buffer, move contents to the // beginning of the buffer to get free space at the end. if (pszTail == (szBuffer + dwBuffer)) { diff --git a/reactos/base/applications/network/whois/whois.c b/reactos/base/applications/network/whois/whois.c index 2f9242ed8c8..b18deaf3490 100644 --- a/reactos/base/applications/network/whois/whois.c +++ b/reactos/base/applications/network/whois/whois.c @@ -65,7 +65,7 @@ void getwhoisserver(int argc, char **argv) if (i + 2 < argc) { host = argv[i +1]; - optset = i + 1; + optset = i + 1; } else { diff --git a/reactos/base/applications/notepad/lang/bg-BG.rc b/reactos/base/applications/notepad/lang/bg-BG.rc index 473680de465..ad2cdc23f8d 100644 --- a/reactos/base/applications/notepad/lang/bg-BG.rc +++ b/reactos/base/applications/notepad/lang/bg-BG.rc @@ -28,7 +28,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -119,7 +119,7 @@ PUSHBUTTON " /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Çíàêîâ íàáîð" diff --git a/reactos/base/applications/notepad/lang/cs-CZ.rc b/reactos/base/applications/notepad/lang/cs-CZ.rc index 2386294721b..e628a8eab01 100644 --- a/reactos/base/applications/notepad/lang/cs-CZ.rc +++ b/reactos/base/applications/notepad/lang/cs-CZ.rc @@ -29,7 +29,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -41,7 +41,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&Soubor" + POPUP "&Soubor" BEGIN MENUITEM "&Nový...", CMD_NEW MENUITEM "&Otevøít\tCtrl+O", CMD_OPEN diff --git a/reactos/base/applications/notepad/lang/da-DK.rc b/reactos/base/applications/notepad/lang/da-DK.rc index fac9f5e9902..6361ff0b355 100644 --- a/reactos/base/applications/notepad/lang/da-DK.rc +++ b/reactos/base/applications/notepad/lang/da-DK.rc @@ -27,7 +27,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE diff --git a/reactos/base/applications/notepad/lang/de-DE.rc b/reactos/base/applications/notepad/lang/de-DE.rc index 6b51e058715..9832b95c36a 100644 --- a/reactos/base/applications/notepad/lang/de-DE.rc +++ b/reactos/base/applications/notepad/lang/de-DE.rc @@ -28,7 +28,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -40,7 +40,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&Datei" + POPUP "&Datei" BEGIN MENUITEM "&Neu...", CMD_NEW MENUITEM "Ö&ffnen...", CMD_OPEN @@ -53,7 +53,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Beenden", CMD_EXIT END - POPUP "&Bearbeiten" + POPUP "&Bearbeiten" BEGIN MENUITEM "&Rückgängig\tStrg+Z", CMD_UNDO MENUITEM SEPARATOR @@ -70,7 +70,7 @@ BEGIN MENUITEM "Alles &markieren", CMD_SELECT_ALL MENUITEM "&Uhrzeit/Datum\tF5", CMD_TIME_DATE END - POPUP "F&ormat" + POPUP "F&ormat" BEGIN MENUITEM "&Zeilenumbruch", CMD_WRAP MENUITEM "&Schriftart...", CMD_FONT diff --git a/reactos/base/applications/notepad/lang/el-GR.rc b/reactos/base/applications/notepad/lang/el-GR.rc index b3383e20e33..577b3f6985e 100644 --- a/reactos/base/applications/notepad/lang/el-GR.rc +++ b/reactos/base/applications/notepad/lang/el-GR.rc @@ -26,7 +26,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -38,7 +38,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&Áñ÷åßï" + POPUP "&Áñ÷åßï" BEGIN MENUITEM "&ÍÝï...", CMD_NEW MENUITEM "&¢íïéãìá\tCtrl+O", CMD_OPEN @@ -51,7 +51,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "¸&îïäïò", CMD_EXIT END - POPUP "&Edit" + POPUP "&Edit" BEGIN MENUITEM "Á&íáßñåóç\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -68,16 +68,16 @@ BEGIN MENUITEM "ÅðéëïãÞ &¼ëùí\tCtrl+A", CMD_SELECT_ALL MENUITEM "&¿ñá/Çìåñïìçíßá\tF5", CMD_TIME_DATE END - POPUP "Ö&ïñìÜ" + POPUP "Ö&ïñìÜ" BEGIN MENUITEM "&ÅìöÜíéóç ìåãÜëùí ãñáììþí", CMD_WRAP MENUITEM "&ÃñáììáôïóåéñÜ...", CMD_FONT END - POPUP "&ÅìöÜíéóç" + POPUP "&ÅìöÜíéóç" BEGIN MENUITEM "ÃñáììÞ &êáôÜóôáóçò", CMD_STATUSBAR END - POPUP "&ÂïÞèåéá" + POPUP "&ÂïÞèåéá" BEGIN MENUITEM "&Ðåñéå÷üìåíá", CMD_HELP_CONTENTS MENUITEM "&ÁíáæÞôçóç...", CMD_HELP_SEARCH @@ -117,7 +117,7 @@ PUSHBUTTON "& /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Êùäéêïðïßçóç" diff --git a/reactos/base/applications/notepad/lang/en-US.rc b/reactos/base/applications/notepad/lang/en-US.rc index de933d4f41e..70018ef9cea 100644 --- a/reactos/base/applications/notepad/lang/en-US.rc +++ b/reactos/base/applications/notepad/lang/en-US.rc @@ -28,7 +28,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -119,7 +119,7 @@ PUSHBUTTON "&Help", IDHELP, 180, 39, 40, 15, WS_TABSTOP /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Encoding" diff --git a/reactos/base/applications/notepad/lang/es-ES.rc b/reactos/base/applications/notepad/lang/es-ES.rc index cc3ffcd4e1c..6379c9de506 100644 --- a/reactos/base/applications/notepad/lang/es-ES.rc +++ b/reactos/base/applications/notepad/lang/es-ES.rc @@ -30,7 +30,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -55,7 +55,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Salir", CMD_EXIT END - POPUP "&Editar" + POPUP "&Editar" BEGIN MENUITEM "&Deshacer\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -73,7 +73,7 @@ BEGIN MENUITEM "&Ajuste de línea", CMD_WRAP MENUITEM "Tipo de &letra...", CMD_FONT END - POPUP "A&yuda" + POPUP "A&yuda" BEGIN MENUITEM "Í&ndice", CMD_HELP_CONTENTS MENUITEM "&Buscar...", CMD_HELP_SEARCH diff --git a/reactos/base/applications/notepad/lang/fi-FI.rc b/reactos/base/applications/notepad/lang/fi-FI.rc index e3105588a21..7042893cb3f 100644 --- a/reactos/base/applications/notepad/lang/fi-FI.rc +++ b/reactos/base/applications/notepad/lang/fi-FI.rc @@ -27,7 +27,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -39,7 +39,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&Tiedosto" + POPUP "&Tiedosto" BEGIN MENUITEM "&Uusi...", CMD_NEW MENUITEM "&Avaa", CMD_OPEN @@ -51,7 +51,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Poistu", CMD_EXIT END - POPUP "&Muokkaa" + POPUP "&Muokkaa" BEGIN MENUITEM "&Palauta\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -68,7 +68,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Ka&tkaise pitkä rivi", CMD_WRAP END - POPUP "&Apua" + POPUP "&Apua" BEGIN MENUITEM "&Sisältö", CMD_HELP_CONTENTS MENUITEM "&Etsi...", CMD_HELP_SEARCH diff --git a/reactos/base/applications/notepad/lang/fr-FR.rc b/reactos/base/applications/notepad/lang/fr-FR.rc index 1b5927fe708..2a13e702936 100644 --- a/reactos/base/applications/notepad/lang/fr-FR.rc +++ b/reactos/base/applications/notepad/lang/fr-FR.rc @@ -28,7 +28,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -40,7 +40,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&Fichier" + POPUP "&Fichier" BEGIN MENUITEM "&Nouveau...", CMD_NEW MENUITEM "&Ouvrir\tCtrl+O", CMD_OPEN @@ -53,7 +53,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Quitter", CMD_EXIT END - POPUP "&Edition" + POPUP "&Edition" BEGIN MENUITEM "&Annuler\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -80,7 +80,7 @@ BEGIN BEGIN MENUITEM "Barre d'état", CMD_STATUSBAR END - POPUP "&Aide" + POPUP "&Aide" BEGIN MENUITEM "&Sommaire", CMD_HELP_CONTENTS MENUITEM "&Rechercher...", CMD_HELP_SEARCH @@ -120,7 +120,7 @@ PUSHBUTTON "&Aide", IDHELP, 180, 39, 40, 15, WS_TABSTOP /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Encodage" diff --git a/reactos/base/applications/notepad/lang/hu-HU.rc b/reactos/base/applications/notepad/lang/hu-HU.rc index d7319aa745c..49a89bbb295 100644 --- a/reactos/base/applications/notepad/lang/hu-HU.rc +++ b/reactos/base/applications/notepad/lang/hu-HU.rc @@ -29,7 +29,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -39,9 +39,9 @@ ID_ACCEL ACCELERATORS VK_F5, CMD_TIME_DATE, VIRTKEY } -MAIN_MENU MENU +MAIN_MENU MENU BEGIN - POPUP "&Fájl" + POPUP "&Fájl" BEGIN MENUITEM "Ú&j", CMD_NEW MENUITEM "Meg&nyitás...", CMD_OPEN @@ -54,7 +54,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Kilépés", CMD_EXIT END - POPUP "S&zerkesztés" + POPUP "S&zerkesztés" BEGIN MENUITEM "&Visszavonás\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -71,7 +71,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Hosszú sorok tördelése", CMD_WRAP END - POPUP "&Súgó" + POPUP "&Súgó" BEGIN MENUITEM "&Témakörök", CMD_HELP_CONTENTS MENUITEM "&Keresés...", CMD_HELP_SEARCH @@ -129,7 +129,7 @@ BEGIN STRING_LICENSE, "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE { STRING_PAGESETUP_HEADERVALUE, "&n" /* FIXME */ STRING_PAGESETUP_FOOTERVALUE, "Oldalszám: &s." /* FIXME */ diff --git a/reactos/base/applications/notepad/lang/id-ID.rc b/reactos/base/applications/notepad/lang/id-ID.rc index 0bda359f837..ba33088da85 100644 --- a/reactos/base/applications/notepad/lang/id-ID.rc +++ b/reactos/base/applications/notepad/lang/id-ID.rc @@ -29,7 +29,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -120,7 +120,7 @@ PUSHBUTTON "&Bantuan", IDHELP, 180, 39, 40, 15, WS_TABSTOP /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Enkoding" diff --git a/reactos/base/applications/notepad/lang/it-IT.rc b/reactos/base/applications/notepad/lang/it-IT.rc index 945ccf082d8..38a54e9c40e 100644 --- a/reactos/base/applications/notepad/lang/it-IT.rc +++ b/reactos/base/applications/notepad/lang/it-IT.rc @@ -31,7 +31,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -43,7 +43,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&File" + POPUP "&File" BEGIN MENUITEM "&Nuovo", CMD_NEW MENUITEM "&Apri...\tCtrl+O", CMD_OPEN @@ -56,7 +56,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Esci", CMD_EXIT END - POPUP "&Modifica" + POPUP "&Modifica" BEGIN MENUITEM "&Annulla\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -82,7 +82,7 @@ BEGIN BEGIN MENUITEM "&Barra di stato", CMD_STATUSBAR END - POPUP "&?" + POPUP "&?" BEGIN MENUITEM "&Guida in linea", CMD_HELP_CONTENTS MENUITEM "&Trova...", CMD_HELP_SEARCH @@ -122,7 +122,7 @@ PUSHBUTTON "&Aiuto", IDHELP, 180, 39, 40, 15, WS_TABSTOP /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Codifica" diff --git a/reactos/base/applications/notepad/lang/ja-JP.rc b/reactos/base/applications/notepad/lang/ja-JP.rc index cff12cd18f6..2f0e70bf436 100644 --- a/reactos/base/applications/notepad/lang/ja-JP.rc +++ b/reactos/base/applications/notepad/lang/ja-JP.rc @@ -28,7 +28,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -119,7 +119,7 @@ PUSHBUTTON " /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 9, "MS UI Gothic" CAPTION "ƒGƒ“ƒR[ƒfƒBƒ“ƒO" diff --git a/reactos/base/applications/notepad/lang/lt-LT.rc b/reactos/base/applications/notepad/lang/lt-LT.rc index 82ac6354926..6202d7d29fc 100644 --- a/reactos/base/applications/notepad/lang/lt-LT.rc +++ b/reactos/base/applications/notepad/lang/lt-LT.rc @@ -18,8 +18,8 @@ * 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 - * - * Translation by Vytis "CMan" Girdþijauskas (cman@cman.us) + * + * Translation by Vytis "CMan" Girdþijauskas (cman@cman.us) */ LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT @@ -30,7 +30,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -121,7 +121,7 @@ PUSHBUTTON "Pagalba", IDHELP, 180, 39, 40, 15, WS_TABSTO /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Koduotë" diff --git a/reactos/base/applications/notepad/lang/nl-NL.rc b/reactos/base/applications/notepad/lang/nl-NL.rc index c96a68527ff..e9f78241b54 100644 --- a/reactos/base/applications/notepad/lang/nl-NL.rc +++ b/reactos/base/applications/notepad/lang/nl-NL.rc @@ -26,7 +26,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE diff --git a/reactos/base/applications/notepad/lang/pl-PL.rc b/reactos/base/applications/notepad/lang/pl-PL.rc index d8ebaf43bd2..addaedac239 100644 --- a/reactos/base/applications/notepad/lang/pl-PL.rc +++ b/reactos/base/applications/notepad/lang/pl-PL.rc @@ -22,7 +22,7 @@ */ /* - * small changes by TestamenT + * small changes by TestamenT * testament@users.sourceforge.net * https://sourceforge.net/projects/reactospl */ @@ -35,7 +35,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -60,7 +60,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Zakoñ&cz", CMD_EXIT END - POPUP "&Edycja" + POPUP "&Edycja" BEGIN MENUITEM "&Cofnij\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -78,7 +78,7 @@ BEGIN MENUITEM "&Zawijanie wierszy", CMD_WRAP MENUITEM "Czci&onka...", CMD_FONT END - POPUP "Pomo&c" + POPUP "Pomo&c" BEGIN MENUITEM "&Tematy pomocy", CMD_HELP_CONTENTS MENUITEM "&Szukaj...", CMD_HELP_SEARCH diff --git a/reactos/base/applications/notepad/lang/pt-PT.rc b/reactos/base/applications/notepad/lang/pt-PT.rc index 63becc52c89..eac0b240621 100644 --- a/reactos/base/applications/notepad/lang/pt-PT.rc +++ b/reactos/base/applications/notepad/lang/pt-PT.rc @@ -29,7 +29,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -41,7 +41,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&Arquivo" + POPUP "&Arquivo" BEGIN MENUITEM "&Novo...", CMD_NEW MENUITEM "A&brir", CMD_OPEN diff --git a/reactos/base/applications/notepad/lang/ru-RU.rc b/reactos/base/applications/notepad/lang/ru-RU.rc index b33178cc98f..2e1d635fd0a 100644 --- a/reactos/base/applications/notepad/lang/ru-RU.rc +++ b/reactos/base/applications/notepad/lang/ru-RU.rc @@ -26,7 +26,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -36,9 +36,9 @@ ID_ACCEL ACCELERATORS VK_F5, CMD_TIME_DATE, VIRTKEY } -MAIN_MENU MENU +MAIN_MENU MENU BEGIN - POPUP "&Ôàéë" + POPUP "&Ôàéë" BEGIN MENUITEM "Ñîçä&àòü", CMD_NEW MENUITEM "&Îòêðûòü...", CMD_OPEN @@ -77,7 +77,7 @@ BEGIN BEGIN MENUITEM "Ñòðîêà &ñîñòîÿíèÿ", CMD_STATUSBAR END - POPUP "&Ñïðàâêà" + POPUP "&Ñïðàâêà" BEGIN MENUITEM "&Ñîäåðæàíèå", CMD_HELP_CONTENTS MENUITEM "&Ïîèñê...", CMD_HELP_SEARCH @@ -118,7 +118,7 @@ PUSHBUTTON "& /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Êîäèðîâêà ñèìâîëîâ" @@ -162,7 +162,7 @@ BEGIN STRING_LICENSE, "Ýòà ïðîãðàììà ÿâëÿåòñÿ ñâîáîäíî ðàñïðîñòðàíÿåìîé; Âû ìîæåòå ðàñïðîñòðàíÿòü åå ïîâòîðíî è (èëè) èçìåíÿòü, ñîáëþäàÿ óñëîâèÿ Îòêðûòîãî ëèöåíçèîííîãî ñîãëàøåíèÿ GNU, îïóáëèêîâàííîãî Ôîíäîì ñâîáîäíî ðàñïðîñòðàíÿåìîãî ïðîãðàììíîãî îáåñïå÷åíèÿ; ëèáî ðåäàêöèè 2 Ñîãëàøåíèÿ, ëèáî (íà âàøå óñìîòðåíèå) ëþáîé ðåäàêöèè, âûïóùåííîé ïîçæå.\r\n\r\nÝòà ïðîãðàììà ðàñïðîñòðàíÿåòñÿ â íàäåæäå íà òî, ÷òî îíà îêàæåòñÿ ïîëåçíîé, íî ÁÅÇ ÊÀÊÈÕ-ËÈÁÎ ÃÀÐÀÍÒÈÉ, âêëþ÷àÿ ïîäðàçóìåâàåìóþ ãàðàíòèþ ÊÀ×ÅÑÒÂÀ ëèáî ÏÐÈÃÎÄÍÎÑÒÈ ÄËß ÎÏÐÅÄÅËÅÍÍÛÕ ÖÅËÅÉ. Ïîäðîáíîñòè ñîäåðæàòñÿ â Îòêðûòîì ëèöåíçèîííîì ñîãëàøåíèè GNU.\r\n\r\nÂìåñòå ñ ýòîé ïðîãðàììîé äîëæåí ðàñïðîñòðàíÿòüñÿ ýêçåìïëÿð Îòêðûòîãî ëèöåíçèîííîãî ñîãëàøåíèÿ GNU, åñëè îí îòñóòñòâóåò, ñîîáùèòå îá ýòîì â Ôîíä ñâîáîäíî ðàñïðîñòðàíÿåìîãî ïðîãðàììíîãî îáåñïå÷åíèÿ (Free Software Foundation, Inc.), 675 Mass Ave, Cambridge, MA 02139, USA." END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE { STRING_PAGESETUP_HEADERVALUE, "&n" /* FIXME */ STRING_PAGESETUP_FOOTERVALUE, "Ñòðàíèöà &s" /* FIXME */ diff --git a/reactos/base/applications/notepad/lang/sk-SK.rc b/reactos/base/applications/notepad/lang/sk-SK.rc index fdfa9eb5440..0e14b150e95 100644 --- a/reactos/base/applications/notepad/lang/sk-SK.rc +++ b/reactos/base/applications/notepad/lang/sk-SK.rc @@ -16,7 +16,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -59,7 +59,7 @@ MAIN_MENU MENU MENUITEM "&H¾ada", CMD_SEARCH MENUITEM "H¾a&da ïalej\tF3", CMD_SEARCH_NEXT } - POPUP "&Pomocník" + POPUP "&Pomocník" BEGIN MENUITEM "&Témy Pomocníka", CMD_HELP_CONTENTS MENUITEM "&H¾ada...", CMD_HELP_SEARCH diff --git a/reactos/base/applications/notepad/lang/sl-SI.rc b/reactos/base/applications/notepad/lang/sl-SI.rc index 64ceb50455b..af0be6bdf42 100644 --- a/reactos/base/applications/notepad/lang/sl-SI.rc +++ b/reactos/base/applications/notepad/lang/sl-SI.rc @@ -26,7 +26,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -38,7 +38,7 @@ ID_ACCEL ACCELERATORS MAIN_MENU MENU BEGIN - POPUP "&Datoteka" + POPUP "&Datoteka" BEGIN MENUITEM "&Nova", CMD_NEW MENUITEM "&Odpri ...", CMD_OPEN diff --git a/reactos/base/applications/notepad/lang/sv-SE.rc b/reactos/base/applications/notepad/lang/sv-SE.rc index f9675afcdae..536de7de2fb 100644 --- a/reactos/base/applications/notepad/lang/sv-SE.rc +++ b/reactos/base/applications/notepad/lang/sv-SE.rc @@ -29,7 +29,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -69,7 +69,7 @@ BEGIN MENUITEM "&Tid/datum\tF5", CMD_TIME_DATE MENUITEM SEPARATOR MENUITEM "&Automatiskt radbyte", CMD_WRAP - END + END POPUP "&Hjälp" BEGIN MENUITEM "&Innehåll", CMD_HELP_CONTENTS diff --git a/reactos/base/applications/notepad/lang/th-TH.rc b/reactos/base/applications/notepad/lang/th-TH.rc index 9a701226053..d2c58f4c994 100644 --- a/reactos/base/applications/notepad/lang/th-TH.rc +++ b/reactos/base/applications/notepad/lang/th-TH.rc @@ -26,7 +26,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -51,7 +51,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "ÍÍ¡", CMD_EXIT END - POPUP "á¡éä¢" + POPUP "á¡éä¢" BEGIN MENUITEM "àÃÕ¡¤×¹\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR diff --git a/reactos/base/applications/notepad/lang/uk-UA.rc b/reactos/base/applications/notepad/lang/uk-UA.rc index 07ea9f9069d..b2e3f5babbf 100644 --- a/reactos/base/applications/notepad/lang/uk-UA.rc +++ b/reactos/base/applications/notepad/lang/uk-UA.rc @@ -26,7 +26,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -112,7 +112,7 @@ PUSHBUTTON "& /* Dialog `Encoding' */ DIALOG_ENCODING DIALOG 0, 0, 256, 44 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Êîäóâàííÿ" diff --git a/reactos/base/applications/notepad/lang/zh-CN.rc b/reactos/base/applications/notepad/lang/zh-CN.rc index 7fa4d27dcfa..b94b94a9c33 100644 --- a/reactos/base/applications/notepad/lang/zh-CN.rc +++ b/reactos/base/applications/notepad/lang/zh-CN.rc @@ -26,7 +26,7 @@ ID_ACCEL ACCELERATORS "^C", CMD_COPY "^F", CMD_SEARCH "^G", CMD_GOTO - "H", CMD_REPLACE, VIRTKEY, CONTROL + "H", CMD_REPLACE, VIRTKEY, CONTROL "^O", CMD_OPEN "^S", CMD_SAVE "^V", CMD_PASTE @@ -36,7 +36,7 @@ ID_ACCEL ACCELERATORS VK_F5, CMD_TIME_DATE, VIRTKEY } -MAIN_MENU MENU +MAIN_MENU MENU BEGIN POPUP "Îļþ£¨&F£©" BEGIN diff --git a/reactos/base/applications/regedit/childwnd.c b/reactos/base/applications/regedit/childwnd.c index ce92f710702..88e4fad2f90 100644 --- a/reactos/base/applications/regedit/childwnd.c +++ b/reactos/base/applications/regedit/childwnd.c @@ -136,8 +136,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if (keyPath == 0 || *keyPath == 0) { - MessageBeep(MB_ICONHAND); - } else + MessageBeep(MB_ICONHAND); + } else if (DeleteKey(hWnd, hRootKey, keyPath)) DeleteNode(g_pChildWnd->hTreeWnd, 0); break; @@ -319,12 +319,12 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa LoadString(hInst, IDS_MY_COMPUTER, buffer, sizeof(buffer)/sizeof(TCHAR)); g_pChildWnd = pChildWnd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ChildWnd)); - + if (!pChildWnd) return 0; _tcsncpy(pChildWnd->szPath, buffer, MAX_PATH); pChildWnd->nSplitPos = 250; pChildWnd->hWnd = hWnd; - pChildWnd->hAddressBarWnd = CreateWindowEx(WS_EX_CLIENTEDGE, _T("Edit"), NULL, WS_CHILD | WS_VISIBLE | WS_CHILDWINDOW | WS_TABSTOP, + pChildWnd->hAddressBarWnd = CreateWindowEx(WS_EX_CLIENTEDGE, _T("Edit"), NULL, WS_CHILD | WS_VISIBLE | WS_CHILDWINDOW | WS_TABSTOP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hWnd, (HMENU)0, hInst, 0); pChildWnd->hTreeWnd = CreateTreeView(hWnd, pChildWnd->szPath, (HMENU) TREE_WINDOW); @@ -340,7 +340,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa (WPARAM)hFont, 0); } - + /* Subclass the AddressBar */ oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(pChildWnd->hAddressBarWnd, GWL_WNDPROC); SetWindowLongPtr(pChildWnd->hAddressBarWnd, GWL_USERDATA, (DWORD_PTR)oldproc); @@ -488,7 +488,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa { HKEY hKey; - TCHAR szBuffer[MAX_PATH]; + TCHAR szBuffer[MAX_PATH]; _sntprintf(szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]), _T("My Computer\\%s\\%s"), rootName, keyPath); if (RegCreateKey(HKEY_CURRENT_USER, diff --git a/reactos/base/applications/regedit/clb/lang/it-IT.rc b/reactos/base/applications/regedit/clb/lang/it-IT.rc index b3b5db5bc64..b9d6b5340e4 100644 --- a/reactos/base/applications/regedit/clb/lang/it-IT.rc +++ b/reactos/base/applications/regedit/clb/lang/it-IT.rc @@ -2,7 +2,7 @@ * PROJECT: System Setup * LICENSE: GPL - See COPYING in the top level directory * FILE: \ReactOS\base\applications\regedit\clb\lang\it-IT.rc - * PURPOSE: Italian Translation + * PURPOSE: Italian Translation * PROGRAMMERS: Copyright (C) 2007 Paolo Devoti devotip at tiscali.it */ diff --git a/reactos/base/applications/regedit/edit.c b/reactos/base/applications/regedit/edit.c index 9ede49966fe..cf26682a831 100644 --- a/reactos/base/applications/regedit/edit.c +++ b/reactos/base/applications/regedit/edit.c @@ -712,26 +712,26 @@ BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath) BOOL result = FALSE; LONG lRet; HKEY hKey; - + lRet = RegOpenKeyEx(hKeyRoot, keyPath, 0, KEY_READ|KEY_SET_VALUE, &hKey); if (lRet != ERROR_SUCCESS) { error_code_messagebox(hwnd, lRet); return FALSE; } - + LoadString(hInst, IDS_QUERY_DELETE_KEY_CONFIRM, caption, sizeof(caption)/sizeof(TCHAR)); LoadString(hInst, IDS_QUERY_DELETE_KEY_ONE, msg, sizeof(msg)/sizeof(TCHAR)); if (MessageBox(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) != IDYES) goto done; - + lRet = SHDeleteKey(hKeyRoot, keyPath); if (lRet != ERROR_SUCCESS) { error(hwnd, IDS_BAD_KEY, keyPath); goto done; } result = TRUE; - + done: RegCloseKey(hKey); return result; diff --git a/reactos/base/applications/regedit/framewnd.c b/reactos/base/applications/regedit/framewnd.c index a0ea7cb0743..dcb889bd67a 100644 --- a/reactos/base/applications/regedit/framewnd.c +++ b/reactos/base/applications/regedit/framewnd.c @@ -87,7 +87,7 @@ static void OnInitMenu(HWND hWnd) while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION)) ; } - + lResult = RegOpenKey(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey); if (lResult != ERROR_SUCCESS) goto done; @@ -590,7 +590,7 @@ static BOOL CreateNewValue(HKEY hRootKey, LPCTSTR pszKeyPath, DWORD dwType) LVFINDINFO lvfi; if (RegOpenKey(hRootKey, pszKeyPath, &hKey) != ERROR_SUCCESS) - return FALSE; + return FALSE; LoadString(hInst, IDS_NEW_VALUE, szNewValueFormat, sizeof(szNewValueFormat) / sizeof(szNewValueFormat[0])); @@ -805,7 +805,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) IDsObjectPicker *ObjectPicker; TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1]; HRESULT hRet; - + hRet = CoInitialize(NULL); if (SUCCEEDED(hRet)) { @@ -941,12 +941,12 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } } } - } else + } else if (GetFocus() == g_pChildWnd->hTreeWnd) { if (keyPath == 0 || *keyPath == 0) { - MessageBeep(MB_ICONHAND); + MessageBeep(MB_ICONHAND); } else if (DeleteKey(hWnd, hKeyRoot, keyPath)) { @@ -1060,7 +1060,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa return DefWindowProc(hWnd, message, wParam, lParam); break; case WM_ACTIVATE: - if (LOWORD(hWnd)) + if (LOWORD(hWnd)) SetFocus(g_pChildWnd->hWnd); break; case WM_SIZE: diff --git a/reactos/base/applications/regedit/lang/bg-BG.rc b/reactos/base/applications/regedit/lang/bg-BG.rc index 3c4a8ec6e93..86c82cfd3ac 100644 --- a/reactos/base/applications/regedit/lang/bg-BG.rc +++ b/reactos/base/applications/regedit/lang/bg-BG.rc @@ -166,7 +166,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ïðîìÿíà íà íèçà" FONT 8, "MS Shell Dlg" @@ -180,7 +180,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ïðîìÿíà íà ìíîæåñòâåí íèç" FONT 8, "MS Shell Dlg" @@ -194,7 +194,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ïðîìÿíà íà äâîè÷íà ñòîéíîñò" FONT 8, "MS Shell Dlg" @@ -209,7 +209,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ïðîìÿíà íà äâîéíà äóìà" FONT 8, "MS Shell Dlg" @@ -399,7 +399,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "Äîáðå",IDOK,107,114,50,14 PUSHBUTTON "Îòêàç",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Èçáîð íà ëþáèìêè:",IDC_STATIC,7,7,99,12 END @@ -414,20 +414,20 @@ BEGIN GROUPBOX "Òúðñåíå â",IDC_STATIC,7,25,63,51 LTEXT "&Òúðñåíå íà:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Êëþ÷îâå",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Êëþ÷îâå",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,55,8 - CONTROL "&Ñòîéíîñòè",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Ñòîéíîñòè",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,55,8 - CONTROL "&Äàííè",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Äàííè",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,55,8 CONTROL "Ñúâïàäåíèå ñàìî ïðè &öåëè íèçîâå",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,72,39,133,13 - CONTROL "Îò÷èòàíå íà &ãËàâÍîÑÒòà",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Îò÷èòàíå íà &ãËàâÍîÑÒòà",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,72,53,102,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Òúðñåíå" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/cs-CZ.rc b/reactos/base/applications/regedit/lang/cs-CZ.rc index ef0cab220dd..28283aee60a 100644 --- a/reactos/base/applications/regedit/lang/cs-CZ.rc +++ b/reactos/base/applications/regedit/lang/cs-CZ.rc @@ -140,7 +140,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Úprava øetìzce" FONT 8, "MS Shell Dlg" @@ -154,7 +154,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Úprava více-øetìzce" FONT 8, "MS Shell Dlg" @@ -168,7 +168,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Úprava binární hodnoty" FONT 8, "MS Shell Dlg" @@ -183,7 +183,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Úprava DWORD" FONT 8, "MS Shell Dlg" diff --git a/reactos/base/applications/regedit/lang/de-DE.rc b/reactos/base/applications/regedit/lang/de-DE.rc index ea694b13e3f..570b2d944f0 100644 --- a/reactos/base/applications/regedit/lang/de-DE.rc +++ b/reactos/base/applications/regedit/lang/de-DE.rc @@ -144,7 +144,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Zeichenkette ändern" FONT 8, "MS Shell Dlg" @@ -158,7 +158,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Multi-Stringwert editieren" FONT 8, "MS Shell Dlg" @@ -172,7 +172,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Binärwert editieren" FONT 8, "MS Shell Dlg" @@ -187,7 +187,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "DWORD Wert editieren" FONT 8, "MS Shell Dlg" @@ -361,7 +361,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "A&bbrechen",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Favorit(en) auswählen:",IDC_STATIC,7,7,99,12 END @@ -376,15 +376,15 @@ BEGIN GROUPBOX "Suche in",IDC_STATIC,7,25,63,51 LTEXT "Suche &nach:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Schlüssel",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Schlüssel",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,45,8 - CONTROL "&Werte",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Werte",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Daten",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Daten",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Nur &ganze Zeichenkette",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Groß-/Kleinschreibung beachten",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Groß-/Kleinschreibung beachten",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END diff --git a/reactos/base/applications/regedit/lang/en-US.rc b/reactos/base/applications/regedit/lang/en-US.rc index e704114c0b2..ae7b08017e8 100644 --- a/reactos/base/applications/regedit/lang/en-US.rc +++ b/reactos/base/applications/regedit/lang/en-US.rc @@ -170,7 +170,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit String" FONT 8, "MS Shell Dlg" @@ -184,7 +184,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Multi-String" FONT 8, "MS Shell Dlg" @@ -198,7 +198,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Binary Value" FONT 8, "MS Shell Dlg" @@ -213,7 +213,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit DWORD" FONT 8, "MS Shell Dlg" @@ -403,7 +403,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Cancel",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Select Favorite(s):",IDC_STATIC,7,7,99,12 END @@ -418,20 +418,20 @@ BEGIN GROUPBOX "Look at",IDC_STATIC,7,25,63,51 LTEXT "Fi&nd what:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Keys",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Keys",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Values",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Values",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Match &whole string only",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Find" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/es-ES.rc b/reactos/base/applications/regedit/lang/es-ES.rc index 804bee4e915..b27a49f7e19 100644 --- a/reactos/base/applications/regedit/lang/es-ES.rc +++ b/reactos/base/applications/regedit/lang/es-ES.rc @@ -53,7 +53,7 @@ BEGIN BEGIN MENUITEM "&Importar archivo de registro...", ID_REGISTRY_IMPORTREGISTRYFILE MENUITEM "&Exportar archivo de registro...", ID_REGISTRY_EXPORTREGISTRYFILE - + MENUITEM SEPARATOR MENUITEM "Cargar archivo de registro...", ID_REGISTRY_LOADHIVE, GRAYED MENUITEM "Descargar archivo de registro...", ID_REGISTRY_UNLOADHIVE, GRAYED @@ -78,9 +78,9 @@ BEGIN MENUITEM "&Valor de varias lineas", ID_EDIT_NEW_MULTISTRINGVALUE MENUITEM "&Valor de una linea expandibles", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END - MENUITEM SEPARATOR + MENUITEM SEPARATOR MENUITEM "&Permisos...", ID_EDIT_PERMISSIONS - MENUITEM SEPARATOR + MENUITEM SEPARATOR MENUITEM "&Eliminar\tDel", ID_EDIT_DELETE MENUITEM "&Renombrar", ID_EDIT_RENAME MENUITEM SEPARATOR @@ -162,7 +162,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit String" FONT 8, "MS Shell Dlg" @@ -176,7 +176,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Multi-String" FONT 8, "MS Shell Dlg" @@ -190,7 +190,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Binary Value" FONT 8, "MS Shell Dlg" @@ -205,7 +205,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit DWORD" FONT 8, "MS Shell Dlg" @@ -395,7 +395,7 @@ FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "Aceptar",IDOK,107,114,50,14 PUSHBUTTON "Cancelar",IDCANCEL,7,114,50,14 - CONTROL "Lista1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "Lista1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Select Favorite(s):",IDC_STATIC,7,7,99,12 END @@ -410,20 +410,20 @@ BEGIN GROUPBOX "Mirar a",IDC_STATIC,7,25,63,51 LTEXT "Encontrar& que:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Claves",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Claves",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Valores",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Valores",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Match &whole string only",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Find" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/fr-FR.rc b/reactos/base/applications/regedit/lang/fr-FR.rc index 0345721f172..635fd4cbdf9 100644 --- a/reactos/base/applications/regedit/lang/fr-FR.rc +++ b/reactos/base/applications/regedit/lang/fr-FR.rc @@ -4,7 +4,7 @@ * Copyright 2002 Robert Dickenson * Copyright 2003 Vincent Béron * Copyright 2004 Sylvain Pétréolle - * Copyright 2007 Pierre Schweitzer + * Copyright 2007 Pierre Schweitzer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -163,7 +163,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Éditer la chaîne" FONT 8, "MS Shell Dlg" @@ -177,7 +177,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Éditer la chaîne multiple" FONT 8, "MS Shell Dlg" @@ -191,7 +191,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Éditer la valeur binaire" FONT 8, "MS Shell Dlg" @@ -206,7 +206,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Éditer le mot double" FONT 8, "MS Shell Dlg" @@ -396,7 +396,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Annuler",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Seléctionnez le(s) favori(s):",IDC_STATIC,7,7,99,12 END @@ -411,20 +411,20 @@ BEGIN GROUPBOX "Rechercher",IDC_STATIC,7,25,63,51 LTEXT "Rechercher:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "Clés",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "Clés",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Valeurs",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Valeurs",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Données",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Données",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Chaîne complète seulement",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Sensible à la case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Sensible à la case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Chercher" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/hu-HU.rc b/reactos/base/applications/regedit/lang/hu-HU.rc index 60baba8a411..a477563ca31 100644 --- a/reactos/base/applications/regedit/lang/hu-HU.rc +++ b/reactos/base/applications/regedit/lang/hu-HU.rc @@ -158,7 +158,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit String" FONT 8, "MS Shell Dlg" @@ -172,7 +172,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Multi-String" FONT 8, "MS Shell Dlg" @@ -186,7 +186,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Binary Value" FONT 8, "MS Shell Dlg" @@ -201,7 +201,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit DWORD" FONT 8, "MS Shell Dlg" diff --git a/reactos/base/applications/regedit/lang/id-ID.rc b/reactos/base/applications/regedit/lang/id-ID.rc index a1b5e3c2c74..2a742f92170 100644 --- a/reactos/base/applications/regedit/lang/id-ID.rc +++ b/reactos/base/applications/regedit/lang/id-ID.rc @@ -166,7 +166,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit String" FONT 8, "MS Shell Dlg" @@ -180,7 +180,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Multi-String" FONT 8, "MS Shell Dlg" @@ -194,7 +194,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Nilai Biner" FONT 8, "MS Shell Dlg" @@ -209,7 +209,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit DWORD" FONT 8, "MS Shell Dlg" @@ -399,7 +399,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Batal",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Pilih Favorit:",IDC_STATIC,7,7,99,12 END @@ -414,20 +414,20 @@ BEGIN GROUPBOX "Lihat di",IDC_STATIC,7,25,63,51 LTEXT "Cari a&pa:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Kunci",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Kunci",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Nilai",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Nilai",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Hanya sama seluruh &string",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Huru&f sama",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Huru&f sama",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Cari" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/it-IT.rc b/reactos/base/applications/regedit/lang/it-IT.rc index 31ed47da2a4..23c01737a06 100644 --- a/reactos/base/applications/regedit/lang/it-IT.rc +++ b/reactos/base/applications/regedit/lang/it-IT.rc @@ -53,17 +53,17 @@ BEGIN POPUP "&Registro" BEGIN MENUITEM "&Importa...", ID_REGISTRY_IMPORTREGISTRYFILE - + MENUITEM "&Esporta...", ID_REGISTRY_EXPORTREGISTRYFILE - + MENUITEM SEPARATOR MENUITEM "Carica Hive...", ID_REGISTRY_LOADHIVE, GRAYED MENUITEM "Scarica Hive...", ID_REGISTRY_UNLOADHIVE, GRAYED MENUITEM SEPARATOR - MENUITEM "&Connetti a Registro in rete...", + MENUITEM "&Connetti a Registro in rete...", ID_REGISTRY_CONNECTNETWORKREGISTRY - - MENUITEM "&Disconnetti da Registro di rete...", + + MENUITEM "&Disconnetti da Registro di rete...", ID_REGISTRY_DISCONNECTNETWORKREGISTRY ,GRAYED MENUITEM SEPARATOR @@ -177,7 +177,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit String" FONT 8, "MS Shell Dlg" @@ -191,7 +191,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Modifica Multi-Stringa" FONT 8, "MS Shell Dlg" @@ -199,15 +199,15 @@ BEGIN LTEXT "&Name:",IDC_STATIC,6,6,134,8 EDITTEXT IDC_VALUE_NAME,6,17,240,12,ES_AUTOHSCROLL | ES_READONLY LTEXT "&Dati:",IDC_STATIC,6,35,161,8 - EDITTEXT IDC_VALUE_DATA,6,46,240,102,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | + EDITTEXT IDC_VALUE_DATA,6,46,240,102,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,142,154,50,14 PUSHBUTTON "Annulla",IDCANCEL,196,154,50,14 END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Modifica valori binari" FONT 8, "MS Shell Dlg" @@ -222,7 +222,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Modifica DWORD" FONT 8, "MS Shell Dlg" @@ -412,7 +412,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Annulla",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Scegli preferiti:",IDC_STATIC,7,7,99,12 END @@ -427,20 +427,20 @@ BEGIN GROUPBOX "Guarda a",IDC_STATIC,7,25,63,51 LTEXT "Trova il:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Chiavi",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Chiavi",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Valori",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Valori",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Dati",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Dati",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Trova solo stringhe &intere",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Confronta &maiuscole e minuscole",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Confronta &maiuscole e minuscole",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Trova" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/ja-JP.rc b/reactos/base/applications/regedit/lang/ja-JP.rc index 4e7a060285e..5c100e26275 100644 --- a/reactos/base/applications/regedit/lang/ja-JP.rc +++ b/reactos/base/applications/regedit/lang/ja-JP.rc @@ -140,7 +140,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "•¶Žš—ñ‚Ì•ÒW" FONT 9, "MS UI Gothic" @@ -154,7 +154,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "•¡”s•¶Žš—ñ‚Ì•ÒW" FONT 9, "MS UI Gothic" @@ -168,7 +168,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "ƒoƒCƒiƒŠ’l‚Ì•ÒW" FONT 9, "MS UI Gothic" @@ -183,7 +183,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "DWORD ’l‚Ì•ÒW" FONT 9, "MS UI Gothic" diff --git a/reactos/base/applications/regedit/lang/nl-NL.rc b/reactos/base/applications/regedit/lang/nl-NL.rc index fda1f6dd2a5..6b214ba6536 100644 --- a/reactos/base/applications/regedit/lang/nl-NL.rc +++ b/reactos/base/applications/regedit/lang/nl-NL.rc @@ -137,7 +137,7 @@ BEGIN ID_EDIT_NEW_KEY "Een nieuwe sleutel toevoegen" ID_EDIT_NEW_STRINGVALUE "Een nieuwe tekenreekswaarde toevoegen" ID_EDIT_NEW_BINARYVALUE "Een nieuwe binaire waarde toevoegen" - ID_EDIT_NEW_DWORDVALUE "Een nieuwe DWORD-waarde toevoegen" + ID_EDIT_NEW_DWORDVALUE "Een nieuwe DWORD-waarde toevoegen" ID_REGISTRY_IMPORTREGISTRYFILE "Een tekstbestand in het register importeren" ID_REGISTRY_EXPORTREGISTRYFILE "Het register of een gedeelte ervan naar een tekstbestand exporteren" diff --git a/reactos/base/applications/regedit/lang/pl-PL.rc b/reactos/base/applications/regedit/lang/pl-PL.rc index 627fd1a86db..f5422197592 100644 --- a/reactos/base/applications/regedit/lang/pl-PL.rc +++ b/reactos/base/applications/regedit/lang/pl-PL.rc @@ -157,7 +157,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edytowanie ci¹gu" FONT 8, "MS Shell Dlg" @@ -171,7 +171,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edytowanie wieloci¹gu" FONT 8, "MS Shell Dlg" @@ -185,7 +185,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edytowanie wartoœci binarnej" FONT 8, "MS Shell Dlg" @@ -200,7 +200,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edytowanie wartoœci DWORD" FONT 8, "MS Shell Dlg" diff --git a/reactos/base/applications/regedit/lang/pt-BR.rc b/reactos/base/applications/regedit/lang/pt-BR.rc index 436733e817c..cbd963b308a 100644 --- a/reactos/base/applications/regedit/lang/pt-BR.rc +++ b/reactos/base/applications/regedit/lang/pt-BR.rc @@ -169,7 +169,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Editar string" FONT 8, "MS Shell Dlg" @@ -183,7 +183,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Editar string múltipla" FONT 8, "MS Shell Dlg" @@ -197,7 +197,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Editar valor binário" FONT 8, "MS Shell Dlg" @@ -212,7 +212,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Editar DWORD" FONT 8, "MS Shell Dlg" @@ -402,7 +402,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Cancelar",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Selecionar favorito(s):",IDC_STATIC,7,7,99,12 END @@ -417,20 +417,20 @@ BEGIN GROUPBOX "Procurar em",IDC_STATIC,7,25,63,51 LTEXT "L&ocalizar:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "C&haves",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "C&haves",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Valores",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Valores",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Dados",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Dados",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "&Coincidir seqüência inteira",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Diferenciar &maiúsc./minúsc.",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Diferenciar &maiúsc./minúsc.",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Localizar" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/ru-RU.rc b/reactos/base/applications/regedit/lang/ru-RU.rc index 505ceab2774..7004d83494d 100644 --- a/reactos/base/applications/regedit/lang/ru-RU.rc +++ b/reactos/base/applications/regedit/lang/ru-RU.rc @@ -166,7 +166,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit String" FONT 8, "MS Shell Dlg" @@ -180,7 +180,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Multi-String" FONT 8, "MS Shell Dlg" @@ -194,7 +194,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Binary Value" FONT 8, "MS Shell Dlg" @@ -209,7 +209,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit DWORD" FONT 8, "MS Shell Dlg" @@ -399,7 +399,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Cancel",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Select Favorite(s):",IDC_STATIC,7,7,99,12 END @@ -414,20 +414,20 @@ BEGIN GROUPBOX "Look at",IDC_STATIC,7,25,63,51 LTEXT "Fi&nd what:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Keys",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Keys",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Values",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Values",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Match &whole string only",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Find" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/sv-SE.rc b/reactos/base/applications/regedit/lang/sv-SE.rc index a9b9d2d540a..2134fd1189a 100644 --- a/reactos/base/applications/regedit/lang/sv-SE.rc +++ b/reactos/base/applications/regedit/lang/sv-SE.rc @@ -157,7 +157,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ändra sträng" FONT 8, "MS Shell Dlg" @@ -171,7 +171,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ändra multi-sträng" FONT 8, "MS Shell Dlg" @@ -185,7 +185,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ändra Binärvärde" FONT 8, "MS Shell Dlg" @@ -200,7 +200,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ändra DWORD-värde" FONT 8, "MS Shell Dlg" diff --git a/reactos/base/applications/regedit/lang/th-TH.rc b/reactos/base/applications/regedit/lang/th-TH.rc index 86e9cfa36f7..726d4e052ab 100644 --- a/reactos/base/applications/regedit/lang/th-TH.rc +++ b/reactos/base/applications/regedit/lang/th-TH.rc @@ -166,7 +166,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit String" FONT 8, "MS Shell Dlg" @@ -180,7 +180,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Multi-String" FONT 8, "MS Shell Dlg" @@ -194,7 +194,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit Binary Value" FONT 8, "MS Shell Dlg" @@ -209,7 +209,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Edit DWORD" FONT 8, "MS Shell Dlg" @@ -399,7 +399,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Cancel",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Select Favorite(s):",IDC_STATIC,7,7,99,12 END @@ -414,20 +414,20 @@ BEGIN GROUPBOX "Look at",IDC_STATIC,7,25,63,51 LTEXT "Fi&nd what:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Keys",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Keys",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Values",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Values",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Data",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "Match &whole string only",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Match &case",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Find" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/uk-UA.rc b/reactos/base/applications/regedit/lang/uk-UA.rc index c207b7e7618..db53b8f6c6a 100644 --- a/reactos/base/applications/regedit/lang/uk-UA.rc +++ b/reactos/base/applications/regedit/lang/uk-UA.rc @@ -166,7 +166,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ðåäàãóâàííÿ ðÿäêà" FONT 8, "MS Shell Dlg" @@ -180,7 +180,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ðåäàãóâàííÿ ìóëüòèðÿäêîâîãî çíà÷åííÿ" FONT 8, "MS Shell Dlg" @@ -194,7 +194,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ðåäàãóâàííÿ äâ³éêîâîãî çíà÷åííÿ" FONT 8, "MS Shell Dlg" @@ -209,7 +209,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ðåäàãóâàííÿ DWORD çíà÷åííÿ" FONT 8, "MS Shell Dlg" @@ -399,7 +399,7 @@ FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,107,114,50,14 PUSHBUTTON "Ñêàñóâàòè",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Îáåð³òü ³ìåíà äëÿ âèäàëåííÿ:",IDC_STATIC,7,7,99,12 END @@ -414,20 +414,20 @@ BEGIN GROUPBOX "Øóêàòè ó",IDC_STATIC,7,25,63,51 LTEXT "&Ùî øóêàòè:",IDC_STATIC,7,8,37,10 EDITTEXT IDC_FINDWHAT,47,7,142,13,ES_AUTOHSCROLL - CONTROL "&Ðîçä³ëè",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "&Ðîçä³ëè",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "&Çíà÷åííÿ",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "&Çíà÷åííÿ",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "&Äàí³",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "&Äàí³",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "&Ò³ëüêè ðÿäêè ö³ëêîì",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "Ç óðàõóâàííÿì &ðåã³ñòðó",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "Ç óðàõóâàííÿì &ðåã³ñòðó",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Çíàéòè" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/lang/zh-CN.rc b/reactos/base/applications/regedit/lang/zh-CN.rc index a15e832d7ef..52e8dae30aa 100644 --- a/reactos/base/applications/regedit/lang/zh-CN.rc +++ b/reactos/base/applications/regedit/lang/zh-CN.rc @@ -162,7 +162,7 @@ END */ IDD_EDIT_STRING DIALOG 32, 24, 252, 84 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "±à¼­×Ö·û´®" FONT 8, "MS Shell Dlg" @@ -176,7 +176,7 @@ BEGIN END IDD_EDIT_MULTI_STRING DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "±à¼­¶à×Ö·û´®" FONT 8, "MS Shell Dlg" @@ -190,7 +190,7 @@ BEGIN END IDD_EDIT_BIN_DATA DIALOG 32, 24, 252, 174 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "±à¼­¶þ½øÖÆÊýÖµ" FONT 8, "MS Shell Dlg" @@ -205,7 +205,7 @@ END IDD_EDIT_DWORD DIALOG 32, 24, 252, 104 -STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "±à¼­ DWORD Öµ" FONT 8, "MS Shell Dlg" @@ -395,7 +395,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "È·¶¨",IDOK,107,114,50,14 PUSHBUTTON "È¡Ïû",IDCANCEL,7,114,50,14 - CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | + CONTROL "List1",IDC_FAVORITESLIST,"SysListView32",LVS_LIST | WS_BORDER | WS_TABSTOP,7,20,150,90 LTEXT "Ñ¡ÔñÊղؼÐ(&S):",IDC_STATIC,7,7,99,12 END @@ -410,20 +410,20 @@ BEGIN GROUPBOX "²é¿´",IDC_STATIC,7,25,63,51 LTEXT "²éÕÒÄ¿±ê(&N):",IDC_STATIC,7,8,50,10 EDITTEXT IDC_FINDWHAT,55,7,142,13,ES_AUTOHSCROLL - CONTROL "Ïî(&K)",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | + CONTROL "Ïî(&K)",IDC_LOOKAT_KEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,36,35,8 - CONTROL "Öµ(&V)",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | + CONTROL "Öµ(&V)",IDC_LOOKAT_VALUES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,36,8 - CONTROL "Êý¾Ý(&D)",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | + CONTROL "Êý¾Ý(&D)",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,60,42,8 CONTROL "È«×ÖÆ¥Åä(&W)",IDC_MATCHSTRING,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13 - CONTROL "´óСдƥÅä(&C)",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | + CONTROL "´óСдƥÅä(&C)",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,48,90,12 END IDD_FINDING DIALOGEX 0, 0, 145, 50 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "²éÕÒ" FONT 8, "MS Shell Dlg", 400, 0, 0x1 diff --git a/reactos/base/applications/regedit/listview.c b/reactos/base/applications/regedit/listview.c index e4ffaece62f..26d1e497298 100644 --- a/reactos/base/applications/regedit/listview.c +++ b/reactos/base/applications/regedit/listview.c @@ -67,7 +67,7 @@ LPCTSTR GetValueName(HWND hwndLV, int iStartAt) LVItem.iSubItem = 0; LVItem.mask = LVIF_PARAM; if (ListView_GetItem(hwndLV, &LVItem) == FALSE) - return NULL; + return NULL; lineinfo = (PLINE_INFO)LVItem.lParam; if (lineinfo == NULL) @@ -486,7 +486,7 @@ void DestroyListView(HWND hwndLV) free(((LINE_INFO*)item.lParam)->name); HeapFree(GetProcessHeap(), 0, (void*)item.lParam); } - + } BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath) diff --git a/reactos/base/applications/regedit/main.c b/reactos/base/applications/regedit/main.c index d3f248229d3..20bd0940303 100644 --- a/reactos/base/applications/regedit/main.c +++ b/reactos/base/applications/regedit/main.c @@ -76,7 +76,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) wcFrame.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); - wcFrame.hCursor = LoadCursor(0, IDC_ARROW); + wcFrame.hCursor = LoadCursor(0, IDC_ARROW); wcFrame.lpszClassName = szFrameClass; hFrameWndClass = RegisterClassEx(&wcFrame); /* register frame window class */ @@ -170,7 +170,7 @@ void DestroyMainMenu() { void ExitInstance(HINSTANCE hInstance) { UnregisterHexEditorClass(hInstance); - + DestroyMenu(hPopupMenus); UnloadAclUiDll(); } @@ -235,7 +235,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, DispatchMessage(&msg); } } - + ExitInstance(hInstance); return (int) msg.wParam; } diff --git a/reactos/base/applications/regedit/regproc.c b/reactos/base/applications/regedit/regproc.c index 5b360b55c81..d8604e3c5c3 100644 --- a/reactos/base/applications/regedit/regproc.c +++ b/reactos/base/applications/regedit/regproc.c @@ -1623,7 +1623,7 @@ LONG RegRenameKey(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpNewName) else return ERROR_NOT_ENOUGH_MEMORY; } - + Ret = RegMoveKey(hKey, lpNewName, hKey, lpSubKey); if (lpNewSubKey) @@ -1722,7 +1722,7 @@ static LONG RegNextKey(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength) lResult = RegEnumKeyEx(hSubKey, 0, lpSubKey + _tcslen(lpSubKey) + 1, &cbName, NULL, NULL, NULL, &ft); RegCloseKey(hSubKey); - + if (lResult == ERROR_SUCCESS) { lpSubKey[_tcslen(lpSubKey)] = '\\'; @@ -1809,7 +1809,7 @@ static BOOL RegSearchCompare(LPCTSTR s1, LPCTSTR s2, DWORD dwSearchFlags) } LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength, - LPCTSTR pszSearchString, DWORD dwValueIndex, + LPCTSTR pszSearchString, DWORD dwValueIndex, DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam) { LONG lResult; diff --git a/reactos/base/applications/regedit/regproc.h b/reactos/base/applications/regedit/regproc.h index 71de772e7fc..dbbe5f1d223 100644 --- a/reactos/base/applications/regedit/regproc.h +++ b/reactos/base/applications/regedit/regproc.h @@ -101,7 +101,7 @@ LONG RegQueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTST #define RSF_MATCHCASE 0x00010000 LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength, - LPCTSTR pszSearchString, DWORD dwValueIndex, + LPCTSTR pszSearchString, DWORD dwValueIndex, DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam); BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lpSubKey); diff --git a/reactos/base/applications/regedit/resource.h b/reactos/base/applications/regedit/resource.h index 46ba6b7a586..d69f16fcb38 100644 --- a/reactos/base/applications/regedit/resource.h +++ b/reactos/base/applications/regedit/resource.h @@ -193,7 +193,7 @@ #define IDC_EXPORT_BRANCH_TEXT 2010 -#define IDC_FAVORITENAME 2011 +#define IDC_FAVORITENAME 2011 #define IDC_FAVORITESLIST 2012 #define IDC_FINDWHAT 2013 #define IDC_LOOKAT_KEYS 2014 diff --git a/reactos/base/applications/regedit/security.c b/reactos/base/applications/regedit/security.c index aab65bdcfc6..f39a74159e4 100644 --- a/reactos/base/applications/regedit/security.c +++ b/reactos/base/applications/regedit/security.c @@ -409,7 +409,7 @@ ISecurityInformation_fnGetSecurity(struct ISecurityInformation *this, { PCRegKeySecurity obj = impl_from_ISecurityInformation(this); LONG ErrorCode; - + ErrorCode = GetNamedSecurityInfo(obj->szRegKey, SE_REGISTRY_KEY, RequestedInformation, diff --git a/reactos/base/applications/regedit/treeview.c b/reactos/base/applications/regedit/treeview.c index 8f56ca0fa21..ce2881f62f0 100644 --- a/reactos/base/applications/regedit/treeview.c +++ b/reactos/base/applications/regedit/treeview.c @@ -296,7 +296,7 @@ BOOL RefreshTreeView(HWND hwndTV) SendMessage(hwndTV, WM_SETREDRAW, TRUE, 0); SetCursor(hcursorOld); - + /* We reselect the currently selected node, this will prompt a refresh of the listview. */ (void)TreeView_SelectItem(hwndTV, hSelectedItem); return TRUE; @@ -347,7 +347,7 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPTSTR name) item.cchTextMax = COUNT_OF(buf); if (!TreeView_GetItem(hwndTV, &item)) continue; if (lstrcmp(name, item.pszText) == 0) break; - } + } } if (hNewItem) (void)TreeView_SelectItem(hwndTV, hNewItem); @@ -395,7 +395,7 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName) /* Win9x specific key */ if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_DYN_DATA"), HKEY_DYN_DATA, 1)) return FALSE; } - + /* expand and select host name */ (void)TreeView_Expand(hwndTV, hRoot, TVE_EXPAND); (void)TreeView_Select(hwndTV, hRoot, TVGN_CARET); diff --git a/reactos/base/applications/sc/sc.rbuild b/reactos/base/applications/sc/sc.rbuild index 4c3fde7be62..853ccafe827 100644 --- a/reactos/base/applications/sc/sc.rbuild +++ b/reactos/base/applications/sc/sc.rbuild @@ -13,7 +13,7 @@ print.c query.c sc.c - start.c + start.c usage.c sc.rc sc.h diff --git a/reactos/base/applications/screensavers/cylfrac/cylfrac.c b/reactos/base/applications/screensavers/cylfrac/cylfrac.c index 2ad3de5981c..db5f51b9bf0 100644 --- a/reactos/base/applications/screensavers/cylfrac/cylfrac.c +++ b/reactos/base/applications/screensavers/cylfrac/cylfrac.c @@ -239,7 +239,7 @@ void InitSaver(HWND hwndParent) void ParseCommandLine(PSTR szCmdLine, int *chOption, HWND *hwndParent) { int ch; - + if (!strlen(szCmdLine)) return; diff --git a/reactos/base/applications/screensavers/logon/logon.c b/reactos/base/applications/screensavers/logon/logon.c index b79e7730afe..0a0636cd270 100644 --- a/reactos/base/applications/screensavers/logon/logon.c +++ b/reactos/base/applications/screensavers/logon/logon.c @@ -52,21 +52,21 @@ void DrawScreen (HDC hdc, HDC hMemDC , RECT rect) y = RANDOM (0, rect.bottom - height); BitBlt( - hdc, - x, - y, - width, - height, - hMemDC, - 0, - 0, + hdc, + x, + y, + width, + height, + hMemDC, + 0, + 0, SRCCOPY); } HBITMAP GetScreenSaverBitmap (void) { OSVERSIONINFOEX osvi; - + ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); GetVersionEx ((OSVERSIONINFO *) &osvi); @@ -97,7 +97,7 @@ LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) switch (msg) { - case WM_CREATE: + case WM_CREATE: { hDC = GetDC(hwnd); hBlkBrush = (HBRUSH) GetStockObject(BLACK_BRUSH); @@ -109,22 +109,22 @@ LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if(bitmap == NULL) { MessageBox( - hwnd, - _T("Fatal Error: Could not load bitmap"), + hwnd, + _T("Fatal Error: Could not load bitmap"), _T("Error"), - MB_OK | MB_ICONEXCLAMATION); + MB_OK | MB_ICONEXCLAMATION); } SetTimer ( - hwnd, - APP_TIMER, - APP_TIMER_INTERVAL, + hwnd, + APP_TIMER, + APP_TIMER_INTERVAL, NULL); - break; + break; } case WM_PAINT: - { + { hDC = BeginPaint(hwnd, &ps); SelectObject(hMemDC, bitmap); DrawScreen (hDC , hMemDC , rect); @@ -141,13 +141,13 @@ LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_ERASEBKGND: { SelectObject(hDC, hBlkBrush); - + PatBlt( hDC, 0, - 0, - rect.right, - rect.bottom, + 0, + rect.right, + rect.bottom, PATCOPY); break; } @@ -157,9 +157,9 @@ LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) DeleteObject(bitmap); ShowCursor(TRUE); PostQuitMessage(0); - break; + break; } - + // break out of screen-saver if any keyboard activity case WM_NOTIFY: case WM_SYSKEYDOWN: @@ -225,16 +225,16 @@ void InitSaver(HWND hwndParent) { HWND hwnd; hwnd = CreateWindowEx(WS_EX_TOPMOST, - APPNAME, + APPNAME, APPNAME, WS_VISIBLE | WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), HWND_DESKTOP, 0, hInstance, NULL); - - SetWindowPos(hwnd, - 0, 0, 0, 0, 0, + + SetWindowPos(hwnd, + 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE|SWP_SHOWWINDOW); ShowCursor(FALSE); diff --git a/reactos/base/applications/screensavers/matrix/config.c b/reactos/base/applications/screensavers/matrix/config.c index 8c5fb6bebc6..1caa4025935 100644 --- a/reactos/base/applications/screensavers/matrix/config.c +++ b/reactos/base/applications/screensavers/matrix/config.c @@ -77,7 +77,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) //select the first message, and preview it SendDlgItemMessage(hwnd, IDC_COMBO1, CB_SETCURSEL, 0, 0); - + SendDlgItemMessage(hwnd, IDC_SLIDER1, TBM_SETRANGE, 0, MAKELONG(SPEED_MIN, SPEED_MAX)); SendDlgItemMessage(hwnd, IDC_SLIDER2, TBM_SETRANGE, 0, MAKELONG(DENSITY_MIN, DENSITY_MAX)); SendDlgItemMessage(hwnd, IDC_SLIDER3, TBM_SETRANGE, 0, MAKELONG(MSGSPEED_MIN, MSGSPEED_MAX)); @@ -87,7 +87,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(hwnd, IDC_SLIDER2, TBM_SETTICFREQ, 5, 0); SendDlgItemMessage(hwnd, IDC_SLIDER3, TBM_SETTICFREQ, 50, 0); SendDlgItemMessage(hwnd, IDC_SLIDER4, TBM_SETTICFREQ, 2, 0); - + SendDlgItemMessage(hwnd, IDC_SLIDER1, TBM_SETPOS, TRUE, g_nMatrixSpeed); SendDlgItemMessage(hwnd, IDC_SLIDER2, TBM_SETPOS, TRUE, g_nDensity); SendDlgItemMessage(hwnd, IDC_SLIDER3, TBM_SETPOS, TRUE, g_nMessageSpeed); @@ -120,7 +120,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) RECT clip; GetDlgItemText(hwnd, IDC_COMBO1, buf, 256); - + GetClientRect((HWND)lParam, &rect); if(prevwidth < rect.right) @@ -132,7 +132,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { rect.left = 0; rect.right = prevwidth; - } + } if(prevheight < rect.bottom) { @@ -165,10 +165,10 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) // now draw it! DrawText(hdc, buf, -1, &rect, DT_CENTER|DT_VCENTER|DT_WORDBREAK); - + return (BOOL)GetStockObject(NULL_BRUSH); - } + } else { break; @@ -195,7 +195,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) index = SendDlgItemMessage(hwnd, IDC_COMBO2, CB_GETCURSEL, 0, 0); SendDlgItemMessage(hwnd, IDC_COMBO2, CB_GETLBTEXT, index, (LPARAM)g_szFontName); //SetMessageFont(hwnd, g_szFontName, g_nFontSize, TRUE); - + UpdatePreview(hwnd); return 0; } @@ -212,7 +212,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case IDOK: - + hwndCtrl = GetDlgItem(hwnd, IDC_COMBO1); items = min(MAX_MESSAGES, SendMessage(hwndCtrl, CB_GETCOUNT, 0, 0)); @@ -223,24 +223,24 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } g_nNumMessages = items; - + //matrix speed - val = SendDlgItemMessage(hwnd, IDC_SLIDER1, TBM_GETPOS, 0, 0); + val = SendDlgItemMessage(hwnd, IDC_SLIDER1, TBM_GETPOS, 0, 0); if(val >= SPEED_MIN && val <= SPEED_MAX) g_nMatrixSpeed = val; //density - val = SendDlgItemMessage(hwnd, IDC_SLIDER2, TBM_GETPOS, 0, 0); + val = SendDlgItemMessage(hwnd, IDC_SLIDER2, TBM_GETPOS, 0, 0); if(val >= DENSITY_MIN && val <= DENSITY_MAX) g_nDensity = val; //message speed - val = SendDlgItemMessage(hwnd, IDC_SLIDER3, TBM_GETPOS, 0, 0); + val = SendDlgItemMessage(hwnd, IDC_SLIDER3, TBM_GETPOS, 0, 0); if(val >= MSGSPEED_MIN && val <= MSGSPEED_MAX) g_nMessageSpeed = val; //font size - val = SendDlgItemMessage(hwnd, IDC_SLIDER4, TBM_GETPOS, 0, 0); + val = SendDlgItemMessage(hwnd, IDC_SLIDER4, TBM_GETPOS, 0, 0); if(val >= FONT_MIN && val <= FONT_MAX) g_nFontSize = val; @@ -253,14 +253,14 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; case IDC_ADD: - + hwndCombo = GetDlgItem(hwnd, IDC_COMBO1); - + if(GetWindowText(hwndCombo, buf, 256)) { SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)buf); } - + UpdatePreview(hwnd); return 0; @@ -306,7 +306,7 @@ int Configure(HWND hwndParent) #endif DialogBox(GetModuleHandle(0), MAKEINTRESOURCE(IDD_CONFIG), hwndParent, ConfigDlgProc); - + return 0; } diff --git a/reactos/base/applications/screensavers/matrix/lang/bg-BG.rc b/reactos/base/applications/screensavers/matrix/lang/bg-BG.rc index 2d165047045..0ee4a3ad20a 100644 --- a/reactos/base/applications/screensavers/matrix/lang/bg-BG.rc +++ b/reactos/base/applications/screensavers/matrix/lang/bg-BG.rc @@ -9,45 +9,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Decode &Speed",IDC_STATIC,7,7,128,36 LTEXT "Ïî- áàâíî",IDC_STATIC,13,24,22,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "Ïî- áúðçî",IDC_STATIC,104,24,20,8 GROUPBOX "Cypher &Density",IDC_STATIC,7,50,128,36 LTEXT "Ïî- ìàëêî",IDC_STATIC,13,67,19,8 - CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "Ïîâå÷å",IDC_STATIC,104,67,23,8 GROUPBOX "&Ñêîðîñò íà èçîáðàçÿâàíå íà ñúîáùåíèåòî",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "Ïî- íèñêà",IDC_STATIC,13,110,22,8 - CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "Ïî- âèñîêà",IDC_STATIC,104,110,22,8 GROUPBOX "&Ðàçìåð íà øðèôòà",IDC_STATIC,7,137,127,36 LTEXT "Ïî- ìàëúê",IDC_STATIC,13,153,24,8 - CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "Ïî- ãîëÿì",IDC_STATIC,104,153,25,8 GROUPBOX "Coded Messages",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&Äîáàâÿíå",IDC_ADD,280,41,44,18 PUSHBUTTON "&Ïðåìàõâàíå",IDC_REMOVE,280,66,44,18 - CONTROL "Ñëó÷àåí ðåä íà ñúîáùåíèÿòà",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "Ñëó÷àåí ðåä íà ñúîáùåíèÿòà",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,85,10 DEFPUSHBUTTON "Äîáðå",IDOK,222,162,50,14 PUSHBUTTON "Îòêàç",IDCANCEL,283,162,50,14 LTEXT "&Èìå íà øðèôòà:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "Ïîëó&÷åð øðèôò",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "Ïîëó&÷åð øðèôò",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,46,10 CTEXT "Åêðàíåí ïðåäïàçèòåë Matrix www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Åêðàíåí ïðåäïàçèòåë Matrix" END diff --git a/reactos/base/applications/screensavers/matrix/lang/de-DE.rc b/reactos/base/applications/screensavers/matrix/lang/de-DE.rc index a3495518da1..7e10eee4375 100644 --- a/reactos/base/applications/screensavers/matrix/lang/de-DE.rc +++ b/reactos/base/applications/screensavers/matrix/lang/de-DE.rc @@ -9,44 +9,44 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Dekodierung&sgeschwindigkeit",IDC_STATIC,7,7,133,36 LTEXT "Langsamer",IDC_STATIC,13,24,37,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,48,17,62,22 LTEXT "Schneller",IDC_STATIC,105,24,30,8 GROUPBOX "Cypher &Dichte",IDC_STATIC,7,50,133,36 LTEXT "Weniger",IDC_STATIC,13,67,31,8 - CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,48,60,62,22 LTEXT "Mehr",IDC_STATIC,105,67,23,8 GROUPBOX "&Nachrichtengeschwindigkeit",IDC_MSGSPEEDGRP,7,93,133,36 LTEXT "Langsamer",IDC_STATIC,13,110,37,8 - CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,48,103,62,22 LTEXT "Schneller",IDC_STATIC,105,110,30,8 GROUPBOX "&Schriftgröße",IDC_STATIC,7,137,133,36 LTEXT "Kleiner",IDC_STATIC,13,153,24,8 - CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | - TBS_BOTH | WS_TABSTOP,48,146,62,22 + CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + TBS_BOTH | WS_TABSTOP,48,146,62,22 LTEXT "Größer",IDC_STATIC,105,153,25,8 GROUPBOX "Codierte Nachrichten",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&Hinzufügen",IDC_ADD,280,41,44,18 PUSHBUTTON "&Entfernen",IDC_REMOVE,280,66,44,18 - CONTROL "Nachrichten vermischen",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "Nachrichten vermischen",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,90,10 DEFPUSHBUTTON "OK",IDOK,222,162,50,14 PUSHBUTTON "Abbrechen",IDCANCEL,283,162,50,14 LTEXT "&Schrift Name:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "&Fette Schrift",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "&Fette Schrift",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,60,10 CTEXT "Matrix ScreenSaver www.catch22.org.uk",IDC_ABOUT,143, 158, 75, 18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Matrix Bildschirmschoner" END diff --git a/reactos/base/applications/screensavers/matrix/lang/en-US.rc b/reactos/base/applications/screensavers/matrix/lang/en-US.rc index 2f9bb1ba08f..3a13928b5fd 100644 --- a/reactos/base/applications/screensavers/matrix/lang/en-US.rc +++ b/reactos/base/applications/screensavers/matrix/lang/en-US.rc @@ -9,45 +9,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Decode &Speed",IDC_STATIC,7,7,128,36 LTEXT "Slower",IDC_STATIC,13,24,22,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "Faster",IDC_STATIC,104,24,20,8 GROUPBOX "Cypher &Density",IDC_STATIC,7,50,128,36 LTEXT "Less",IDC_STATIC,13,67,19,8 - CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "More",IDC_STATIC,104,67,23,8 GROUPBOX "&Message Display Speed",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "Slower",IDC_STATIC,13,110,22,8 - CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "Faster",IDC_STATIC,104,110,22,8 GROUPBOX "&Font Size",IDC_STATIC,7,137,127,36 LTEXT "Smaller",IDC_STATIC,13,153,24,8 - CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "Bigger",IDC_STATIC,104,153,25,8 GROUPBOX "&Coded Messages",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&Add",IDC_ADD,280,41,44,18 PUSHBUTTON "&Remove",IDC_REMOVE,280,66,44,18 - CONTROL "Ra&ndomize Messages",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "Ra&ndomize Messages",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,85,10 DEFPUSHBUTTON "OK",IDOK,222,162,50,14 PUSHBUTTON "Cancel",IDCANCEL,283,162,50,14 LTEXT "&Font Name:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "&Bold Font",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "&Bold Font",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,46,10 CTEXT "Matrix ScreenSaver www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Matrix ScreenSaver" END diff --git a/reactos/base/applications/screensavers/matrix/lang/fr-FR.rc b/reactos/base/applications/screensavers/matrix/lang/fr-FR.rc index de589329898..3981f326854 100644 --- a/reactos/base/applications/screensavers/matrix/lang/fr-FR.rc +++ b/reactos/base/applications/screensavers/matrix/lang/fr-FR.rc @@ -9,45 +9,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Vite&sse de décodage",IDC_STATIC,7,7,128,36 LTEXT "Plus lent",IDC_STATIC,13,24,22,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "Plus rapide",IDC_STATIC,104,24,20,8 GROUPBOX "&Densité de caractères",IDC_STATIC,7,50,128,36 LTEXT "Moins",IDC_STATIC,13,67,19,8 - CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "Plus",IDC_STATIC,104,67,23,8 GROUPBOX "Vitesse d'affichage du message",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "Plus lent",IDC_STATIC,13,110,22,8 - CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "Plus rapide",IDC_STATIC,104,110,22,8 GROUPBOX "Taille de la police",IDC_STATIC,7,137,127,36 LTEXT "Plus petite",IDC_STATIC,13,153,24,8 - CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "Plus grande",IDC_STATIC,104,153,25,8 GROUPBOX "Messages codés",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&Ajouter",IDC_ADD,280,41,44,18 PUSHBUTTON "Supp&rimer",IDC_REMOVE,280,66,44,18 - CONTROL "Messages aléatoires",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "Messages aléatoires",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,85,10 DEFPUSHBUTTON "OK",IDOK,222,162,50,14 PUSHBUTTON "Annuler",IDCANCEL,283,162,50,14 LTEXT "Nom de la police:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "Gras",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "Gras",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,46,10 CTEXT "Écran de veille Matrix www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Écran de veille Matrix" END diff --git a/reactos/base/applications/screensavers/matrix/lang/lt-LT.rc b/reactos/base/applications/screensavers/matrix/lang/lt-LT.rc index 581e4b14ddf..7eda57ac656 100644 --- a/reactos/base/applications/screensavers/matrix/lang/lt-LT.rc +++ b/reactos/base/applications/screensavers/matrix/lang/lt-LT.rc @@ -18,45 +18,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Dekodavimo &greitis",IDC_STATIC,7,7,128,36 LTEXT "Lëtas",IDC_STATIC,13,24,22,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "Greitas",IDC_STATIC,104,24,29,8 GROUPBOX "Ðifro &tankumas",IDC_STATIC,7,50,128,36 LTEXT "Maþas",IDC_STATIC,13,67,28,8 - CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "Didelis",IDC_STATIC,104,67,29,8 GROUPBOX "&Praneðimo vaizdavimo greitis",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "Lëtas",IDC_STATIC,13,110,22,8 - CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "Greitas",IDC_STATIC,104,110,27,8 GROUPBOX "Ðrifto &dydis",IDC_STATIC,7,137,127,36 LTEXT "Maþas",IDC_STATIC,13,153,24,8 - CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "Didelis",IDC_STATIC,104,153,25,8 GROUPBOX "&Koduoti praneðimai",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&Átraukti",IDC_ADD,280,41,44,18 PUSHBUTTON "&Paðalinti",IDC_REMOVE,280,66,44,18 - CONTROL "Atsitiktiniai praneðimai",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "Atsitiktiniai praneðimai",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,91,10 DEFPUSHBUTTON "OK",IDOK,222,162,50,14 PUSHBUTTON "Atðaukti",IDCANCEL,283,162,50,14 LTEXT "&Ðriftas:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "Pus&juodis ðriftas",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "Pus&juodis ðriftas",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,77,10 CTEXT "Matrix ScreenSaver www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Matrix ekrano uþsklanda" END diff --git a/reactos/base/applications/screensavers/matrix/lang/nl-NL.rc b/reactos/base/applications/screensavers/matrix/lang/nl-NL.rc index a52c8d13ffe..9d2ff781101 100644 --- a/reactos/base/applications/screensavers/matrix/lang/nl-NL.rc +++ b/reactos/base/applications/screensavers/matrix/lang/nl-NL.rc @@ -9,45 +9,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Decodeer &Snelheid",IDC_STATIC,7,7,128,36 LTEXT "Langzamer",IDC_STATIC,13,24,22,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "Sneller",IDC_STATIC,104,24,20,8 GROUPBOX "Cypher &Dichtheid",IDC_STATIC,7,50,128,36 LTEXT "Minder",IDC_STATIC,13,67,19,8 - CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "Meer",IDC_STATIC,104,67,23,8 GROUPBOX "Snel&heid van het bericht",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "Langzamer",IDC_STATIC,13,110,22,8 - CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "Sneller",IDC_STATIC,104,110,22,8 GROUPBOX "&Lettertype Grootte",IDC_STATIC,7,137,127,36 LTEXT "Kleiner",IDC_STATIC,13,153,24,8 - CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "Groter",IDC_STATIC,104,153,25,8 GROUPBOX "&Gecodeerde berichten",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&Toevoegen",IDC_ADD,280,41,44,18 PUSHBUTTON "&Verwijderen",IDC_REMOVE,280,66,44,18 - CONTROL "Willekeurige &Berichten",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "Willekeurige &Berichten",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,85,10 DEFPUSHBUTTON "OK",IDOK,222,162,50,14 PUSHBUTTON "&Annuleren",IDCANCEL,283,162,50,14 LTEXT "&Lettertype:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "&Vetgedrukt",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "&Vetgedrukt",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,46,10 CTEXT "Matrix Schermbeveiliging www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Matrix Schermbeveiliging" END diff --git a/reactos/base/applications/screensavers/matrix/lang/sk-SK.rc b/reactos/base/applications/screensavers/matrix/lang/sk-SK.rc index 83c3ac4b839..db428a9771e 100644 --- a/reactos/base/applications/screensavers/matrix/lang/sk-SK.rc +++ b/reactos/base/applications/screensavers/matrix/lang/sk-SK.rc @@ -17,45 +17,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "&Rýchlos dekódovania",IDC_STATIC,7,7,128,36 LTEXT "Pomaly",IDC_STATIC,13,24,24,8 - CONTROL "Posúvaè1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Posúvaè1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "Rýchlo",IDC_STATIC,104,24,24,8 GROUPBOX "&Zložitos šifry",IDC_STATIC,7,50,128,36 LTEXT "Menšia",IDC_STATIC,13,67,24,8 - CONTROL "Posúvaè2",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Posúvaè2",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "Väèšia",IDC_STATIC,101,67,24,8 GROUPBOX "Rýchlos zobrazovanej &správy",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "Pomaly",IDC_STATIC,13,110,24,8 - CONTROL "Posúvaè3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Posúvaè3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "Rýchlo",IDC_STATIC,104,110,24,8 GROUPBOX "&Ve¾kos písma",IDC_STATIC,7,137,127,36 LTEXT "Menšie",IDC_STATIC,13,153,24,8 - CONTROL "Posúvaè4",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Posúvaè4",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "Väèšie",IDC_STATIC,104,153,24,8 GROUPBOX "&Kódované správy",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "Prid&a",IDC_ADD,280,41,44,18 PUSHBUTTON "O&dstráni",IDC_REMOVE,280,66,44,18 - CONTROL "&Náhodné poradie správ",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "&Náhodné poradie správ",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,85,10 DEFPUSHBUTTON "OK",IDOK,222,162,50,14 PUSHBUTTON "Zruši",IDCANCEL,283,162,50,14 LTEXT "Typ &písma:",IDC_STATIC,151,118,40,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "&Tuèné písmo",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "&Tuèné písmo",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,55,10 CTEXT "Matrix ScreenSaver www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Matrix - šetriè obrazovky" END diff --git a/reactos/base/applications/screensavers/matrix/lang/th-TH.rc b/reactos/base/applications/screensavers/matrix/lang/th-TH.rc index 9917d0770fe..59fb18d5e4d 100644 --- a/reactos/base/applications/screensavers/matrix/lang/th-TH.rc +++ b/reactos/base/applications/screensavers/matrix/lang/th-TH.rc @@ -9,45 +9,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "¶Í´ÃËÑÊ &¤ÇÒÁàÃçÇ",IDC_STATIC,7,7,128,36 LTEXT "ẺªéÒ",IDC_STATIC,13,24,22,8 - CONTROL "ÀÒ¾µèÍà¹×èͧ1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "ÀÒ¾µèÍà¹×èͧ1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "ẺàÃçÇ¡ÇèÒ",IDC_STATIC,104,24,20,8 GROUPBOX "¡Ó˹´ÃËÑÊ &¤ÇÒÁ˹Òá¹è¹",IDC_STATIC,7,50,128,36 LTEXT "ẺËÅÐËÅÇÁ",IDC_STATIC,13,67,19,8 - CONTROL "ÀÒ¾µèÍà¹×èͧ1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "ÀÒ¾µèÍà¹×èͧ1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "à¾ÔèÁàµÔÁ",IDC_STATIC,104,67,23,8 GROUPBOX "&¢éͤÇÒÁáÊ´§¤ÇÒÁàÃçÇ",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "ẺªéÒ",IDC_STATIC,13,110,22,8 - CONTROL "ÀÒ¾µèÍà¹×èͧ3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "ÀÒ¾µèÍà¹×èͧ3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "ẺàÃçÇ¡ÇèÒ",IDC_STATIC,104,110,22,8 GROUPBOX "&¢¹Ò´µÑÇÍÑ¡ÉÃ",IDC_STATIC,7,137,127,36 LTEXT "¢¹Ò´àÅç¡Å§",IDC_STATIC,13,153,24,8 - CONTROL "ÀÒ¾µèÍà¹×èͧ3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "ÀÒ¾µèÍà¹×èͧ3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "¢¹Ò´ãË­è¢Öé¹",IDC_STATIC,104,153,25,8 GROUPBOX "µÑé§ÃËÑÊ¢éͤÇÒÁ",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Ẻ¤§·Õè",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Ẻ¤§·Õè",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&à¾ÔèÁ",IDC_ADD,280,41,44,18 PUSHBUTTON "&à¤Å×è͹ÂéÒÂÍÍ¡",IDC_REMOVE,280,66,44,18 - CONTROL "¢éͤÇÒÁẺÊØèÁ",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "¢éͤÇÒÁẺÊØèÁ",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,85,10 DEFPUSHBUTTON "µ¡Å§",IDOK,222,162,50,14 PUSHBUTTON "¡àÅÔ¡",IDCANCEL,283,162,50,14 LTEXT "&ª×è͵ÑÇÍÑ¡ÉÃ:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "&µÑÇ˹Ò",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "&µÑÇ˹Ò",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,46,10 CTEXT "â»Ãá¡ÃÁÃÑ¡ÉÒ˹éÒ¨ÍẺàÁ·ÃÔ¡«ì www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Matrix ScreenSaver" END diff --git a/reactos/base/applications/screensavers/matrix/lang/uk-UA.rc b/reactos/base/applications/screensavers/matrix/lang/uk-UA.rc index 2c77c04b2ff..099ca1328fb 100644 --- a/reactos/base/applications/screensavers/matrix/lang/uk-UA.rc +++ b/reactos/base/applications/screensavers/matrix/lang/uk-UA.rc @@ -17,45 +17,45 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "&Øâèäê³ñòü äåêîäóâàííÿ",IDC_STATIC,7,7,128,36 LTEXT "Íèæ÷å",IDC_STATIC,13,24,22,8 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,17,62,22 LTEXT "Âèùå",IDC_STATIC,104,24,20,8 GROUPBOX "&Ù³ëüí³ñòü øèôðó",IDC_STATIC,7,50,128,36 LTEXT "Ìåíøå",IDC_STATIC,13,67,19,8 - CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider1",IDC_SLIDER2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,60,62,22 LTEXT "Á³ëüøå",IDC_STATIC,104,67,23,8 GROUPBOX "Øâèäê³ñòü ïîêàçó &ïîâ³äîìëåííÿ",IDC_MSGSPEEDGRP,7,93,127,36 LTEXT "Íèæ÷å",IDC_STATIC,13,110,22,8 - CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,103,62,22 LTEXT "Âèùå",IDC_STATIC,104,110,22,8 GROUPBOX "&Ðîçì³ð øðèôòó",IDC_STATIC,7,137,127,36 LTEXT "Ìåíøèé",IDC_STATIC,13,153,24,8 - CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | + CONTROL "Slider3",IDC_SLIDER4,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,38,146,62,22 LTEXT "Á³ëüøèé",IDC_STATIC,104,153,25,8 GROUPBOX "Çàêîäîâàí³ ïîâ³äîìëåííÿ",IDC_STATIC,145,7,188,142 - COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | + COMBOBOX IDC_COMBO1,153,22,172,62,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | + CONTROL "",IDC_PREVIEW,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,154,39,116,72 PUSHBUTTON "&Äîäàòè",IDC_ADD,280,41,44,18 PUSHBUTTON "Â&èäàëèòè",IDC_REMOVE,280,66,44,18 - CONTROL "Çì³øàòè ïîâ³äîìëåííÿ",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | + CONTROL "Çì³øàòè ïîâ³äîìëåííÿ",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,134,85,10 DEFPUSHBUTTON "OK",IDOK,222,162,50,14 PUSHBUTTON "Ñêàñóâàòè",IDCANCEL,283,162,50,14 LTEXT "&²ì'ÿ øðèôòó:",IDC_STATIC,151,118,38,8 - COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_COMBO2,195,116,130,71,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "Íàï³â&æèðíèé øðèôò",IDC_BOLD,"Button",BS_AUTOCHECKBOX | + CONTROL "Íàï³â&æèðíèé øðèôò",IDC_BOLD,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,247,134,46,10 CTEXT "Çàñòàâêà ""Ìàòðèöÿ"" www.catch22.org.uk",IDC_ABOUT,140, 158,75,18 END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_DESCRIPTION "Çàñòàâêà ""Ìàòðèöÿ""" END diff --git a/reactos/base/applications/screensavers/matrix/matrix.c b/reactos/base/applications/screensavers/matrix/matrix.c index aad0159a21a..4cb385b8b31 100644 --- a/reactos/base/applications/screensavers/matrix/matrix.c +++ b/reactos/base/applications/screensavers/matrix/matrix.c @@ -35,7 +35,7 @@ int GlyphIntensity(GLYPH glyph) GLYPH DarkenGlyph(GLYPH glyph) { int intensity = GlyphIntensity(glyph); - + if(intensity > 0) return GLYPH_REDRAW | ((intensity - 1) << 8) | (glyph & 0x00FF); else @@ -85,19 +85,19 @@ void ScrollMatrixColumn(MATRIX_COLUMN *col) // bottom-most part of "run". Insert a new character (glyph) // at the end to lengthen the run down the screen..gives the // impression that the run is "falling" down the screen - if(GlyphIntensity(thisglyph) < GlyphIntensity(lastglyph) && + if(GlyphIntensity(thisglyph) < GlyphIntensity(lastglyph) && GlyphIntensity(thisglyph) == 0) { col->glyph[y] = RandomGlyph(MAX_INTENSITY - 1); y++; } // top-most part of "run". Delete a character off the top by - // darkening the glyph until it eventually disappears (turns black). + // darkening the glyph until it eventually disappears (turns black). // this gives the effect that the run as dropped downwards else if(GlyphIntensity(thisglyph) > GlyphIntensity(lastglyph)) { col->glyph[y] = DarkenGlyph(thisglyph); - + // if we've just darkened the last bit, skip on so // the whole run doesn't go dark if(GlyphIntensity(thisglyph) == MAX_INTENSITY - 1) @@ -110,7 +110,7 @@ void ScrollMatrixColumn(MATRIX_COLUMN *col) // change state from blanks <-> runs when the current run as expired if(--col->runlen <= 0) { - if(col->state ^= 1) + if(col->state ^= 1) col->runlen = crc_rand() % (3 * DENSITY/2) + DENSITY_MIN; else col->runlen = crc_rand() % (DENSITY_MAX+1-DENSITY) + (DENSITY_MIN*2); @@ -126,7 +126,7 @@ void ScrollMatrixColumn(MATRIX_COLUMN *col) // advance down screen at double-speed col->blippos += 2; - + // if the blip gets to the end of a run, start it again (for a random // length so that the blips never get synched together) if(col->blippos >= col->bliplen) @@ -151,7 +151,7 @@ void RandomMatrixColumn(MATRIX_COLUMN *col) for(i = 1, y = 0; i < 16; i++) { // find a run - while(GlyphIntensity(col->glyph[y]) < MAX_INTENSITY-1 && y < col->length) + while(GlyphIntensity(col->glyph[y]) < MAX_INTENSITY-1 && y < col->length) y++; if(y >= col->length) @@ -186,12 +186,12 @@ void RedrawMatrixColumn(MATRIX_COLUMN *col, MATRIX *matrix, HDC hdc, int xpos) if(glyph & GLYPH_REDRAW) { if((y == col->blippos+0 || y == col->blippos+1 || - y == col->blippos+8 || y == col->blippos+9) && + y == col->blippos+8 || y == col->blippos+9) && GlyphIntensity(glyph) >= MAX_INTENSITY-1) glyph |= MAX_INTENSITY << 8; DrawGlyph(matrix, hdc, xpos, y * GLYPH_HEIGHT, glyph); - + // clear redraw state col->glyph[y] &= ~GLYPH_REDRAW; } @@ -205,7 +205,7 @@ void DecodeMatrix(HWND hwnd, MATRIX *matrix) for(x = 0; x < matrix->numcols; x++) { - RandomMatrixColumn(&matrix->column[x]); + RandomMatrixColumn(&matrix->column[x]); ScrollMatrixColumn(&matrix->column[x]); RedrawMatrixColumn(&matrix->column[x], matrix, hdc, x * GLYPH_WIDTH); } @@ -250,7 +250,7 @@ MATRIX *CreateMatrix(HWND hwnd, int width, int height) for(y = 0; y < rows; y++) matrix->column[x].glyph[y] = 0;//; } - + // Load bitmap!! hdc = GetDC(NULL); matrix->hbmBitmap = LoadBitmap(GetModuleHandle(0), MAKEINTRESOURCE(IDB_BITMAP1)); @@ -351,7 +351,7 @@ LRESULT WINAPI MatrixWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_MBUTTONDOWN: case WM_MBUTTONUP: case WM_MOUSEMOVE: - + // If we've got a parent then we must be a preview if(GetParent(hwnd) != 0) return 0; @@ -363,13 +363,13 @@ LRESULT WINAPI MatrixWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } GetCursorPos(&ptCursor); - + // if the mouse has moved more than 3 pixels then exit if(abs(ptCursor.x - ptLast.x) >= 3 || abs(ptCursor.y - ptLast.y) >= 3) PostMessage(hwnd, WM_CLOSE, 0, 0); ptLast = ptCursor; - + return 0; // someone wants to close us...see if it's ok @@ -400,15 +400,15 @@ HWND CreateScreenSaveWnd(HWND hwndParent, RECT *rect) if(hwndParent) GetClientRect(hwndParent, rect); - return CreateWindowEx( dwStyleEx, - APPNAME, - 0, - WS_VISIBLE | dwStyle, - rect->left, + return CreateWindowEx( dwStyleEx, + APPNAME, + 0, + WS_VISIBLE | dwStyle, + rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top, - hwndParent, + hwndParent, 0, GetModuleHandle(0), 0 diff --git a/reactos/base/applications/screensavers/matrix/matrix.h b/reactos/base/applications/screensavers/matrix/matrix.h index 0bf8d24e2f4..f196b0aa6c0 100644 --- a/reactos/base/applications/screensavers/matrix/matrix.h +++ b/reactos/base/applications/screensavers/matrix/matrix.h @@ -31,7 +31,7 @@ typedef struct BOOL started; int runlen; - + int blippos; int bliplen; diff --git a/reactos/base/applications/screensavers/matrix/message.c b/reactos/base/applications/screensavers/matrix/message.c index d1c91693d49..d1f661315d2 100644 --- a/reactos/base/applications/screensavers/matrix/message.c +++ b/reactos/base/applications/screensavers/matrix/message.c @@ -3,7 +3,7 @@ // // Dissolve in/out messages into the "matrix" // -// +// // #include #include "globals.h" @@ -40,12 +40,12 @@ void SetMatrixMessage(MATRIX_MESSAGE *msg, HFONT hFont, TCHAR *text) HDC hdc; RECT rect; int x, y; - + HDC hdcMessage; HBITMAP hbmMessage; HANDLE hOldFont, hOldBmp; - + // // Create a monochrome off-screen buffer // @@ -100,7 +100,7 @@ void DrawMatrixMessage(MATRIX *matrix, MATRIX_MESSAGE *msg, HDC hdc) for(x = 0; x < msg->width; x++) for(y = 0; y < msg->height; y++) - if((msg->message[x][y] & 0x8000) && + if((msg->message[x][y] & 0x8000) && (msg->message[x][y] & 0x00FF)) { DrawGlyph(matrix, hdc, x * GLYPH_WIDTH, y * GLYPH_HEIGHT, RandomGlyph(MAX_INTENSITY)); @@ -115,11 +115,11 @@ void RevealMatrixMessage(MATRIX_MESSAGE *msg, int amount) while(amount--) { int pos; - + msg->random_reg1 = crc_msgrand(msg->random_reg1); pos = msg->random_reg1 & 0xffff; - msg->message[pos / 256][pos % 256] |= GLYPH_REDRAW; + msg->message[pos / 256][pos % 256] |= GLYPH_REDRAW; } } @@ -167,7 +167,7 @@ void DoMatrixMessage(HDC hdc, MATRIX *matrix) { // mark all message-cells as being "invisible" so the // message gets cleared by the matrix decoding naturally - + if(g_fRandomizeMessages) msg->msgindex = crc_rand() % g_nNumMessages; else @@ -175,7 +175,7 @@ void DoMatrixMessage(HDC hdc, MATRIX *matrix) // make a new message..initially invisible SetMatrixMessage(msg, 0, g_szMessages[msg->msgindex]); - + msg->counter = -(int)(crc_rand() % MSGSPEED_MAX); } // reveal the next part of the message @@ -184,10 +184,10 @@ void DoMatrixMessage(HDC hdc, MATRIX *matrix) int w = (g_nMessageSpeed - MSGSPEED_MIN); w = (1 << 16) + ((w<<16) / MSGSPEED_MAX); w = (w * 3 * g_nMessageSpeed) >> 16; - + RevealMatrixMessage(msg, w + 100); } - + // // draw whatever part of the message is visible at this time // @@ -210,8 +210,8 @@ void SetMessageFont(HWND hwnd, TCHAR *szFontName, int nPointSize, BOOL fBold) ReleaseDC(hwnd, hdc); - hFont = CreateFont(lfHeight, 0, 0, 0, fBold ? FW_BOLD: FW_NORMAL, 0, 0, 0, - ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, + hFont = CreateFont(lfHeight, 0, 0, 0, fBold ? FW_BOLD: FW_NORMAL, 0, 0, 0, + ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, szFontName); if(hFont != 0) @@ -239,7 +239,7 @@ MATRIX_MESSAGE *InitMatrixMessage(HWND hwnd, int width, int height) msg->width = min(width, MAXMSG_WIDTH); msg->height = min(height, MAXMSG_HEIGHT); msg->counter = -(int)(crc_rand() % MSGSPEED_MIN + MSGSPEED_MIN); - + msg->random_reg1 = (WORD)GetTickCount(); SetMessageFont(hwnd, g_szFontName, g_nFontSize, g_fFontBold); diff --git a/reactos/base/applications/screensavers/matrix/message.h b/reactos/base/applications/screensavers/matrix/message.h index 19a9886b3eb..f96761c9c7a 100644 --- a/reactos/base/applications/screensavers/matrix/message.h +++ b/reactos/base/applications/screensavers/matrix/message.h @@ -15,7 +15,7 @@ typedef struct int msgindex; - int counter; + int counter; WORD random_reg1; int width, height; diff --git a/reactos/base/applications/screensavers/matrix/password.c b/reactos/base/applications/screensavers/matrix/password.c index 60808ebb5dc..71df9260d98 100644 --- a/reactos/base/applications/screensavers/matrix/password.c +++ b/reactos/base/applications/screensavers/matrix/password.c @@ -10,7 +10,7 @@ typedef BOOL (WINAPI *VERIFYSCREENSAVEPWD)(HWND hwnd); typedef VOID (WINAPI *PWDCHANGEPASSWORD)(LPCTSTR lpcRegkeyname, HWND hwnd,UINT uiReserved1,UINT uiReserved2); BOOL VerifyPassword(HWND hwnd) -{ +{ // Under NT, we return TRUE immediately. This lets the saver quit, // and the system manages passwords. Under '95, we call VerifyScreenSavePwd. // This checks the appropriate registry key and, if necessary, @@ -19,50 +19,50 @@ BOOL VerifyPassword(HWND hwnd) HINSTANCE hpwdcpl; VERIFYSCREENSAVEPWD VerifyScreenSavePwd; BOOL fResult; - + if(GetVersion() < 0x80000000) return TRUE; hpwdcpl = LoadLibrary(_T("PASSWORD.CPL")); - if(hpwdcpl == NULL) + if(hpwdcpl == NULL) { return FALSE; } - + VerifyScreenSavePwd = (VERIFYSCREENSAVEPWD)GetProcAddress(hpwdcpl, "VerifyScreenSavePwd"); if(VerifyScreenSavePwd == NULL) - { + { FreeLibrary(hpwdcpl); return FALSE; } - fResult = VerifyScreenSavePwd(hwnd); + fResult = VerifyScreenSavePwd(hwnd); FreeLibrary(hpwdcpl); return fResult; } BOOL ChangePassword(HWND hwnd) -{ +{ // This only ever gets called under '95, when started with the /a option. HINSTANCE hmpr = LoadLibrary(_T("MPR.DLL")); PWDCHANGEPASSWORD PwdChangePassword; - if(hmpr == NULL) + if(hmpr == NULL) return FALSE; PwdChangePassword = (PWDCHANGEPASSWORD)GetProcAddress(hmpr, "PwdChangePasswordA"); - + if(PwdChangePassword == NULL) - { + { FreeLibrary(hmpr); return FALSE; } - PwdChangePassword(_T("SCRSAVE"), hwnd, 0, 0); + PwdChangePassword(_T("SCRSAVE"), hwnd, 0, 0); FreeLibrary(hmpr); return TRUE; diff --git a/reactos/base/applications/screensavers/matrix/screensave.c b/reactos/base/applications/screensavers/matrix/screensave.c index 2b4d4b3cb0a..3c771fed1f1 100644 --- a/reactos/base/applications/screensavers/matrix/screensave.c +++ b/reactos/base/applications/screensavers/matrix/screensave.c @@ -1,12 +1,12 @@ // // screensave.c // -// Entrypoint for a win32 screensaver +// Entrypoint for a win32 screensaver // // NOTES: Screen savers don't like being UPX'd (compressed). Don't // know why, it just is. C-runtime has been stripped with -// "libctiny.lib". -// +// "libctiny.lib". +// // v1.0 1/12/2003 J Brown // #include @@ -39,7 +39,7 @@ BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, RECT *rcMonitor // For some reason windows always places this window at 0,0... // position it ourselves - SetWindowPos(hwnd, 0, rcMonitor->left, rcMonitor->top, 0, 0, + SetWindowPos(hwnd, 0, rcMonitor->left, rcMonitor->top, 0, 0, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE|SWP_SHOWWINDOW); return TRUE; @@ -55,9 +55,9 @@ BOOL ScreenSaver(HWND hwndParent) MSG msg; InitScreenSaveClass(hwndParent); - + SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0); - + // Dynamically locate API call from USER32 - not present in all versions hUser32 = GetModuleHandle(_T("USER32.DLL")); pfnEnumDisplayMonitors = (PVOID)GetProcAddress(hUser32, "EnumDisplayMonitors"); @@ -112,8 +112,8 @@ VOID ParseCommandLine(LPSTR szCmdLine, UCHAR *chOption, HWND *hwndParent) *chOption = ch; ch = *szCmdLine++; - - if(ch == ':') + + if(ch == ':') ch = *szCmdLine++; while(ch == ' ' || ch == '\t') @@ -136,7 +136,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int iCmdS HWND hwndParent; UCHAR chOption; - // Make sure that only 1 instance runs at a time - + // Make sure that only 1 instance runs at a time - // Win98 seems to want us to restart every 5 seconds!! if(FindWindowEx(NULL, NULL, APPNAME, APPNAME)) { @@ -146,7 +146,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int iCmdS LoadSettings(); ParseCommandLine(lpCmdLine, &chOption, &hwndParent); - + switch(chOption) { case 's': return ScreenSaver(NULL); // screen save diff --git a/reactos/base/applications/screensavers/matrix/settings.c b/reactos/base/applications/screensavers/matrix/settings.c index c5a7aec7be3..0fb87c87d76 100644 --- a/reactos/base/applications/screensavers/matrix/settings.c +++ b/reactos/base/applications/screensavers/matrix/settings.c @@ -52,7 +52,7 @@ void LoadSettings() if(value >= SPEED_MIN && value <= SPEED_MAX) g_nMatrixSpeed = value; } - + if(ERROR_SUCCESS == RegQueryValueEx(hkey, _T("Density"), 0, 0, (BYTE *)&value, &len)) { if(value >= DENSITY_MIN && value <= DENSITY_MAX) diff --git a/reactos/base/applications/screensavers/scrnsave/scrnsave.c b/reactos/base/applications/screensavers/scrnsave/scrnsave.c index 83468461f23..06579d81b0c 100644 --- a/reactos/base/applications/screensavers/scrnsave/scrnsave.c +++ b/reactos/base/applications/screensavers/scrnsave/scrnsave.c @@ -107,18 +107,18 @@ void InitSaver(HWND hwndParent) { HWND hwnd; hwnd = CreateWindowEx(WS_EX_TOPMOST, - APPNAME, + APPNAME, APPNAME, WS_VISIBLE | WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), HWND_DESKTOP, 0, hInstance, NULL); - - SetWindowPos(hwnd, - 0, 0, 0, 0, 0, + + SetWindowPos(hwnd, + 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE|SWP_SHOWWINDOW); - + ShowCursor(FALSE); fullscreen = TRUE; } diff --git a/reactos/base/applications/screensavers/starfield/screensaver.c b/reactos/base/applications/screensavers/starfield/screensaver.c index 0ce8d80f247..d0e91e96c8d 100644 --- a/reactos/base/applications/screensavers/starfield/screensaver.c +++ b/reactos/base/applications/screensavers/starfield/screensaver.c @@ -56,21 +56,21 @@ void DrawStarField (HDC pDC) { // Clear last position of this star SetPixel ( - pDC, - stars[i].m_nOldX, - stars[i].m_nOldY, + pDC, + stars[i].m_nOldX, + stars[i].m_nOldY, RGB (0, 0, 0)); nX = (int)((((long)stars[i].m_nXPos << 7) / (long)stars[i].m_nZPos) + m_nCenterX); nY = (int)((((long)stars[i].m_nYPos << 7) / (long)stars[i].m_nZPos) + m_nCenterY); - + // Draw star SetPixel ( - pDC, - nX, - nY, + pDC, + nX, + nY, RGB (255, 255, 255)); - + // Remember current position for clearing later stars[i].m_nOldX = nX; stars[i].m_nOldY = nY; @@ -82,9 +82,9 @@ BOOL SetUpStars (int nNumStars) int i; if (nNumStars > MAX_STARS) { - MessageBox (0, - _T("Too many stars! Aborting!"), - _T("Error"), + MessageBox (0, + _T("Too many stars! Aborting!"), + _T("Error"), MB_OK | MB_ICONWARNING); return FALSE; } @@ -99,8 +99,8 @@ BOOL SetUpStars (int nNumStars) if (!stars) { MessageBox (0, - _T("Unable to allocate memory! Aborting!"), - _T("Error"), + _T("Unable to allocate memory! Aborting!"), + _T("Error"), MB_OK | MB_ICONWARNING); return FALSE; } @@ -116,7 +116,7 @@ BOOL SetUpStars (int nNumStars) stars[i].m_nOldY = -1; } while ((stars[i].m_nXPos == 0) || (stars[i].m_nYPos == 0)); } - + return TRUE; } @@ -154,9 +154,9 @@ LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_CREATE : { SetTimer ( - hwnd, - APP_TIMER, - APP_TIMER_INTERVAL, + hwnd, + APP_TIMER, + APP_TIMER_INTERVAL, NULL); } break; @@ -184,7 +184,7 @@ LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { // Change the center point of the starfield SetDimensions ( - LOWORD(lParam), + LOWORD(lParam), HIWORD(lParam)); } break; @@ -226,7 +226,7 @@ LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) GetCursorPos(&ptCursor); // if the mouse has moved more than 3 pixels then exit - if( (abs(ptCursor.x - ptLast.x) >= 3) || + if( (abs(ptCursor.x - ptLast.x) >= 3) || (abs(ptCursor.y - ptLast.y) >= 3)) { PostMessage(hwnd, WM_CLOSE, 0, 0); @@ -268,18 +268,18 @@ void InitSaver(HWND hwndParent) { HWND hwnd; hwnd = CreateWindowEx(WS_EX_TOPMOST, - APPNAME, + APPNAME, APPNAME, WS_VISIBLE | WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), HWND_DESKTOP, 0, hInstance, NULL); - - SetWindowPos(hwnd, - 0, 0, 0, 0, 0, + + SetWindowPos(hwnd, + 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE|SWP_SHOWWINDOW); - + ShowCursor(FALSE); fullscreen = TRUE; } diff --git a/reactos/base/applications/shutdown/shutdown.c b/reactos/base/applications/shutdown/shutdown.c index 03149a6ee63..eb0b593f097 100644 --- a/reactos/base/applications/shutdown/shutdown.c +++ b/reactos/base/applications/shutdown/shutdown.c @@ -42,17 +42,17 @@ static struct CommandLineOptions ParseArguments(int argc, TCHAR *argv[]) { struct CommandLineOptions opts; int i; - + // Reset all flags in struct opts.abort = FALSE; opts.force = FALSE; opts.logoff = FALSE; opts.restart = FALSE; opts.shutdown = FALSE; - + for (i = 1; i < argc; i++) { - if (argv[i][0] == '-' || argv[i][0] == '/') + if (argv[i][0] == '-' || argv[i][0] == '/') { switch(argv[i][1]) { case '?': @@ -82,16 +82,16 @@ static struct CommandLineOptions ParseArguments(int argc, TCHAR *argv[]) } } } - + return opts; } // Converts the commandline arguments to flags used to shutdown computer -static struct ExitOptions ParseCommandLineOptionsToExitOptions(struct CommandLineOptions opts) +static struct ExitOptions ParseCommandLineOptionsToExitOptions(struct CommandLineOptions opts) { struct ExitOptions exitOpts; exitOpts.shouldExit = TRUE; - + // Sets ONE of the exit type flags if (opts.logoff) exitOpts.flags = EWX_LOGOFF; @@ -104,7 +104,7 @@ static struct ExitOptions ParseCommandLineOptionsToExitOptions(struct CommandLin exitOpts.flags = 0; exitOpts.shouldExit = FALSE; } - + // Sets additional flags if (opts.force) { @@ -114,11 +114,11 @@ static struct ExitOptions ParseCommandLineOptionsToExitOptions(struct CommandLin // The Windows shutdown utility does it the same way. exitOpts.shouldExit = TRUE; } - + // Reason for shutdown // Hardcoded to "Other (Planned)" exitOpts.reason = SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED; - + return exitOpts; } @@ -127,7 +127,7 @@ void DisplayLastError() { int errorCode = GetLastError(); LPTSTR lpMsgBuf; - + // Display the error message to the user FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, @@ -137,7 +137,7 @@ void DisplayLastError() (LPTSTR) &lpMsgBuf, 0, NULL); - + _ftprintf(stderr, lpMsgBuf); _ftprintf(stderr, _T("Error code: %d\n"), errorCode); } @@ -146,14 +146,14 @@ void EnableShutdownPrivileges() { HANDLE token; TOKEN_PRIVILEGES privs; - + // Check to see if the choosen action is allowed by the user. Everyone can call LogOff, but only privilieged users can shutdown/restart etc. if (! OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token)) { DisplayLastError(); exit(1); } - + // Get LUID (Locally Unique Identifier) for the privilege we need if (!LookupPrivilegeValue( NULL, // system - NULL is localsystem @@ -180,27 +180,27 @@ void EnableShutdownPrivileges() exit(1); } } - + // Main entry for program int _tmain(int argc, TCHAR *argv[]) { struct CommandLineOptions opts; struct ExitOptions exitOpts; - + if (argc == 1) // i.e. no commandline arguments given { PrintUsage(); exit(0); } - opts = ParseArguments(argc, argv); + opts = ParseArguments(argc, argv); exitOpts = ParseCommandLineOptionsToExitOptions(opts); // Perform the shutdown/restart etc. action if (exitOpts.shouldExit) { EnableShutdownPrivileges(); - + if (!ExitWindowsEx(exitOpts.flags, exitOpts.reason)) { DisplayLastError(); diff --git a/reactos/base/applications/sndvol32/lang/bg-BG.rc b/reactos/base/applications/sndvol32/lang/bg-BG.rc index c5c6d3aaf7a..b2f62123822 100644 --- a/reactos/base/applications/sndvol32/lang/bg-BG.rc +++ b/reactos/base/applications/sndvol32/lang/bg-BG.rc @@ -37,7 +37,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Ïîêàçâàíå íà ñëåäíèòå óïðàâëåíèÿ íà çâóêà:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "Äîáðå", IDOK, 114,226,50,14 PUSHBUTTON "Îòêàç", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/en-US.rc b/reactos/base/applications/sndvol32/lang/en-US.rc index 02baff3f45d..5f7f9cb8042 100644 --- a/reactos/base/applications/sndvol32/lang/en-US.rc +++ b/reactos/base/applications/sndvol32/lang/en-US.rc @@ -37,7 +37,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Show the following volume controls:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Cancel", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/es-ES.rc b/reactos/base/applications/sndvol32/lang/es-ES.rc index f13918f3c06..7db361487c6 100644 --- a/reactos/base/applications/sndvol32/lang/es-ES.rc +++ b/reactos/base/applications/sndvol32/lang/es-ES.rc @@ -40,7 +40,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Mostrar los controles de volumen siguientes:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "Aceptar", IDOK, 114,226,50,14 PUSHBUTTON "Cancelar", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/fr-FR.rc b/reactos/base/applications/sndvol32/lang/fr-FR.rc index ac8132bbc03..706e15f02c7 100644 --- a/reactos/base/applications/sndvol32/lang/fr-FR.rc +++ b/reactos/base/applications/sndvol32/lang/fr-FR.rc @@ -37,7 +37,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Montrer les contrôles du volume suivants:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Annuler", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/hu-HU.rc b/reactos/base/applications/sndvol32/lang/hu-HU.rc index 1239222412c..2b6adefad99 100644 --- a/reactos/base/applications/sndvol32/lang/hu-HU.rc +++ b/reactos/base/applications/sndvol32/lang/hu-HU.rc @@ -39,7 +39,7 @@ BEGIN PUSHBUTTON "&Felvétel", IDC_RECORDING, 13,61,47,8, BS_AUTORADIOBUTTON PUSHBUTTON "&Egyéb:", IDC_OTHER, 13,80,42,8, BS_AUTORADIOBUTTON | WS_DISABLED COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Mégse", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/id-ID.rc b/reactos/base/applications/sndvol32/lang/id-ID.rc index 9df3734bdec..d86bb7c6d90 100644 --- a/reactos/base/applications/sndvol32/lang/id-ID.rc +++ b/reactos/base/applications/sndvol32/lang/id-ID.rc @@ -37,7 +37,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Tampilkan kontrol volume berikut:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Batal", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/it-IT.rc b/reactos/base/applications/sndvol32/lang/it-IT.rc index 71ec8c301c0..21f1daca825 100644 --- a/reactos/base/applications/sndvol32/lang/it-IT.rc +++ b/reactos/base/applications/sndvol32/lang/it-IT.rc @@ -37,7 +37,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Mostra i controlli di volume seguenti:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Annulla", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/ja-JP.rc b/reactos/base/applications/sndvol32/lang/ja-JP.rc index 5f5c417a089..a791bbc2763 100644 --- a/reactos/base/applications/sndvol32/lang/ja-JP.rc +++ b/reactos/base/applications/sndvol32/lang/ja-JP.rc @@ -37,7 +37,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "•\\Ž¦‚·‚éƒRƒ“ƒgƒ[ƒ‹:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/lt-LT.rc b/reactos/base/applications/sndvol32/lang/lt-LT.rc index 10e4c08c09f..7572a55e2a9 100644 --- a/reactos/base/applications/sndvol32/lang/lt-LT.rc +++ b/reactos/base/applications/sndvol32/lang/lt-LT.rc @@ -39,7 +39,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Rodyti ðiuos garso valdiklius:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Atðaukti", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/nl-NL.rc b/reactos/base/applications/sndvol32/lang/nl-NL.rc index 0c7d8fa341e..4c49f6be315 100644 --- a/reactos/base/applications/sndvol32/lang/nl-NL.rc +++ b/reactos/base/applications/sndvol32/lang/nl-NL.rc @@ -37,7 +37,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "De volgende volumeregelingen weergeven:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Annuleren", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/ru-RU.rc b/reactos/base/applications/sndvol32/lang/ru-RU.rc index ea1914bbf1a..fd72f4fa806 100644 --- a/reactos/base/applications/sndvol32/lang/ru-RU.rc +++ b/reactos/base/applications/sndvol32/lang/ru-RU.rc @@ -39,7 +39,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "Îòîáðàæàòü ðåãóëÿòîðû ãðîìêîñòè:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Îòìåíà", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/sv-SE.rc b/reactos/base/applications/sndvol32/lang/sv-SE.rc index c844e898e76..03f16b4242d 100644 --- a/reactos/base/applications/sndvol32/lang/sv-SE.rc +++ b/reactos/base/applications/sndvol32/lang/sv-SE.rc @@ -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 */ - + LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL IDM_MAINMENU MENU DISCARDABLE @@ -55,7 +55,7 @@ BEGIN PUSHBUTTON "&Inspelning", IDC_RECORDING, 13,61,47,8, BS_AUTORADIOBUTTON PUSHBUTTON "&Andra:", IDC_OTHER, 13,80,42,8, BS_AUTORADIOBUTTON | WS_DISABLED COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Avbryt", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/th-TH.rc b/reactos/base/applications/sndvol32/lang/th-TH.rc index 66d3485c0bf..6ba1909050e 100644 --- a/reactos/base/applications/sndvol32/lang/th-TH.rc +++ b/reactos/base/applications/sndvol32/lang/th-TH.rc @@ -45,7 +45,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "áÊ´§¡ÒäǺ¤ØÁÃкºàÊÕ§ :", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "µ¡Å§", IDOK, 114,226,50,14 PUSHBUTTON "¡àÅÔ¡", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/lang/uk-UA.rc b/reactos/base/applications/sndvol32/lang/uk-UA.rc index fbf12ae9243..d09b2f22633 100644 --- a/reactos/base/applications/sndvol32/lang/uk-UA.rc +++ b/reactos/base/applications/sndvol32/lang/uk-UA.rc @@ -45,7 +45,7 @@ BEGIN COMBOBOX IDC_LINE, 55,80,155,50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED LTEXT "³äîáðàæàòè íàñòóïí³ ðåãóëÿòîðè ãó÷íîñò³:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 - + PUSHBUTTON "OK", IDOK, 114,226,50,14 PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 168,226,50,14 END diff --git a/reactos/base/applications/sndvol32/misc.c b/reactos/base/applications/sndvol32/misc.c index c97a855c522..09d278f907b 100644 --- a/reactos/base/applications/sndvol32/misc.c +++ b/reactos/base/applications/sndvol32/misc.c @@ -202,7 +202,7 @@ ReadLineConfig(IN LPTSTR szDeviceName, { goto ExitClose; } - + LineStates = HeapAlloc(GetProcessHeap(), 0, Size); @@ -220,7 +220,7 @@ ReadLineConfig(IN LPTSTR szDeviceName, { goto ExitClose; } - + /* try to find the control */ for (i = 0; i < Size / sizeof(SNDVOL_REG_LINESTATE); i++) { @@ -240,6 +240,6 @@ ExitClose: LineStates); RegCloseKey(hLineKey); } - + return Ret; } diff --git a/reactos/base/applications/sndvol32/sndvol32.c b/reactos/base/applications/sndvol32/sndvol32.c index 80439313703..4ece4a06f2e 100644 --- a/reactos/base/applications/sndvol32/sndvol32.c +++ b/reactos/base/applications/sndvol32/sndvol32.c @@ -43,14 +43,14 @@ typedef struct _PREFERENCES_CONTEXT PMIXER_WINDOW MixerWindow; PSND_MIXER Mixer; HWND hwndDlg; - + UINT Selected; DWORD SelectedLine; DWORD PlaybackID; DWORD RecordingID; UINT OtherLines; TCHAR DeviceName[128]; - + DWORD tmp; } PREFERENCES_CONTEXT, *PPREFERENCES_CONTEXT; @@ -128,7 +128,7 @@ PrefDlgAddLine(PSND_MIXER Mixer, if (PrefContext->RecordingID == (DWORD)-1) { PrefContext->RecordingID = Line->dwLineID; - + if (PrefContext->SelectedLine == (DWORD)-1) { PrefContext->SelectedLine = Line->dwLineID; @@ -143,7 +143,7 @@ PrefDlgAddLine(PSND_MIXER Mixer, { LRESULT lres; HWND hwndCbOthers; - + if (PrefContext->SelectedLine == (DWORD)-1) { PrefContext->SelectedLine = Line->dwLineID; @@ -169,7 +169,7 @@ AddToOthersLines: break; } } - + return TRUE; } @@ -186,7 +186,7 @@ PrefDlgAddConnection(PSND_MIXER Mixer, UNREFERENCED_PARAMETER(Mixer); UNREFERENCED_PARAMETER(LineID); - + if (Line->cControls != 0) { hwndControls = GetDlgItem(PrefContext->hwndDlg, @@ -207,7 +207,7 @@ PrefDlgAddConnection(PSND_MIXER Mixer, TCHAR LineName[MIXER_LONG_NAME_CHARS]; DWORD Flags; BOOL SelLine = FALSE; - + if (SndMixerGetLineName(PrefContext->Mixer, PrefContext->SelectedLine, LineName, @@ -216,7 +216,7 @@ PrefDlgAddConnection(PSND_MIXER Mixer, { LineName[0] = TEXT('\0'); } - + if (ReadLineConfig(PrefContext->DeviceName, LineName, Line->szName, @@ -233,7 +233,7 @@ PrefDlgAddConnection(PSND_MIXER Mixer, SelLine); } } - + return TRUE; } @@ -262,20 +262,20 @@ UpdatePrefDlgControls(PPREFERENCES_CONTEXT Context, MixerID = 0; } } - + OldID = Context->Selected; if (MixerID != OldID && SndMixerSelect(Context->Mixer, MixerID)) { Context->Selected = SndMixerGetSelection(Context->Mixer); - + /* update the controls */ Context->PlaybackID = (DWORD)-1; Context->RecordingID = (DWORD)-1; Context->OtherLines = 0; Context->SelectedLine = (DWORD)-1; - + SndMixerGetProductName(Context->Mixer, Context->DeviceName, sizeof(Context->DeviceName) / sizeof(Context->DeviceName[0])); @@ -322,7 +322,7 @@ UpdatePrefDlgControls(PPREFERENCES_CONTEXT Context, IDC_LINE, (Context->OtherLines != 0 && SelBox++ == 0) ? BST_CHECKED : BST_UNCHECKED); - + /* disable the OK button if the device doesn't have any lines */ EnableWindow(GetDlgItem(Context->hwndDlg, IDOK), @@ -333,16 +333,16 @@ UpdatePrefDlgControls(PPREFERENCES_CONTEXT Context, LineID = Context->SelectedLine; } } - + /* update the line sources list */ if ((MixerID != OldID && Context->SelectedLine != (DWORD)-1) || (Context->SelectedLine != LineID && LineID != (DWORD)-1)) { Context->SelectedLine = LineID; - + (void)ListView_DeleteAllItems(GetDlgItem(Context->hwndDlg, IDC_CONTROLS)); - + Context->tmp = 0; SndMixerEnumConnections(Context->Mixer, LineID, @@ -376,14 +376,14 @@ DlgPreferencesProc(HWND hwndDlg, } break; } - + case IDC_LINE: { if (HIWORD(wParam) == CBN_SELCHANGE) { DWORD LineID; DWORD Index; - + Index = SendDlgItemMessage(hwndDlg, IDC_LINE, CB_GETCURSEL, @@ -405,7 +405,7 @@ DlgPreferencesProc(HWND hwndDlg, } break; } - + case IDC_PLAYBACK: { UpdatePrefDlgControls(Context, @@ -415,7 +415,7 @@ DlgPreferencesProc(HWND hwndDlg, FALSE); break; } - + case IDC_RECORDING: { UpdatePrefDlgControls(Context, @@ -425,12 +425,12 @@ DlgPreferencesProc(HWND hwndDlg, FALSE); break; } - + case IDC_OTHER: { INT LineCbIndex; DWORD LineID; - + EnableWindow(GetDlgItem(hwndDlg, IDC_LINE), TRUE); @@ -455,7 +455,7 @@ DlgPreferencesProc(HWND hwndDlg, } break; } - + case IDOK: case IDCANCEL: { @@ -603,7 +603,7 @@ MainWindowProc(HWND hwnd, PostQuitMessage(0); break; } - + case IDC_ABOUT: { HICON hAppIcon = (HICON)GetClassLongPtrW(hwnd, @@ -812,7 +812,7 @@ WinMain(HINSTANCE hInstance, hAppInstance = hInstance; hAppHeap = GetProcessHeap(); - + if (InitAppConfig()) { /* load the application title */ diff --git a/reactos/base/applications/taskmgr/graph.c b/reactos/base/applications/taskmgr/graph.c index 5d3ed5bb2db..3453a799961 100644 --- a/reactos/base/applications/taskmgr/graph.c +++ b/reactos/base/applications/taskmgr/graph.c @@ -191,7 +191,7 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) nBarsUsed = 1; } nBarsFree = nBars - (nlastBarsUsed>nBarsUsed ? nlastBarsUsed : nBarsUsed); - + if (TaskManagerSettings.ShowKernelTimes) { CpuKernelUsage = PerfDataGetProcessorSystemUsage(); @@ -222,7 +222,7 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) if (nBarsUsedKernel < 0) nBarsUsedKernel = 0; if (nBarsUsedKernel > nBars) nBarsUsedKernel = nBars; - + /* * Draw the "free" bars */ @@ -245,13 +245,13 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) for (i=0; i< (nlastBarsUsed - nBarsUsed); i++) { if (nlastBarsUsed > 5000) nlastBarsUsed = 5000; - + FillSolidRect(hDC, &rcBarLeft, MEDIUM_GREEN); FillSolidRect(hDC, &rcBarRight, MEDIUM_GREEN); - + rcBarLeft.top += 3; rcBarLeft.bottom += 3; - + rcBarRight.top += 3; rcBarRight.bottom += 3; } @@ -277,13 +277,13 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) /* * Draw the "used" kernel bars */ - + rcBarLeft.top -=3; rcBarLeft.bottom -=3; rcBarRight.top -=3; rcBarRight.bottom -=3; - + for (i=0; i 100) CpuUsage = 100; - + if (TaskManagerSettings.ShowKernelTimes) { CpuKernelUsage = PerfDataGetProcessorSystemUsage(); if (CpuKernelUsage <= 0) CpuKernelUsage = 0; if (CpuKernelUsage > 100) CpuKernelUsage = 100; - } + } else { CpuKernelUsage = 0; @@ -449,7 +449,7 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK(); nBarsUsed2 = PhysicalMemoryTotal ? ((PhysicalMemoryAvailable * 100) / PhysicalMemoryTotal) : 0; - + GraphCtrl_AppendPoint(&PerformancePageCpuUsageHistoryGraph, CpuUsage, CpuKernelUsage, 0.0, 0.0); GraphCtrl_AppendPoint(&PerformancePageMemUsageHistoryGraph, nBarsUsed1, nBarsUsed2, 0.0, 0.0); diff --git a/reactos/base/applications/taskmgr/procpage.c b/reactos/base/applications/taskmgr/procpage.c index 4d8f566c5ce..63e6626bdd2 100644 --- a/reactos/base/applications/taskmgr/procpage.c +++ b/reactos/base/applications/taskmgr/procpage.c @@ -91,7 +91,7 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) /* Close the event handle, this will make the */ /* refresh thread exit when the wait fails */ CloseHandle(hProcessPageEvent); - CloseHandle(hRefreshThread); + CloseHandle(hRefreshThread); SaveColumnSettings(); diff --git a/reactos/base/applications/taskmgr/taskmgr.rc b/reactos/base/applications/taskmgr/taskmgr.rc index a919c22a542..f40264d2ef7 100644 --- a/reactos/base/applications/taskmgr/taskmgr.rc +++ b/reactos/base/applications/taskmgr/taskmgr.rc @@ -179,7 +179,7 @@ IDB_TRAYMASK BITMAP DISCARDABLE "res/traymask.bmp" '00 00 00 00 00 FF FF 00 00 00 00 00 00 FF FF FF' 'FF FF FF FF FF FF' } */ - + /* BINRES trayicon.bmp */ IDB_TRAYICON BITMAP DISCARDABLE "res/trayicon.bmp" /* { diff --git a/reactos/base/applications/taskmgr/trayicon.c b/reactos/base/applications/taskmgr/trayicon.c index 19fa498ab61..5f260d73630 100644 --- a/reactos/base/applications/taskmgr/trayicon.c +++ b/reactos/base/applications/taskmgr/trayicon.c @@ -148,7 +148,7 @@ BOOL TrayIcon_ShellAddTrayIcon(void) nid.uCallbackMessage = WM_ONTRAYICON; nid.hIcon = hIcon; - + LoadString( GetModuleHandle(NULL), IDS_MSG_TRAYICONCPUUSAGE, szMsg, sizeof(szMsg) / sizeof(szMsg[0])); wsprintf(nid.szTip, szMsg, PerfDataGetProcessorUsage()); diff --git a/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.cpp b/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.cpp index 84e997ef3bb..0f01f402370 100644 --- a/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.cpp +++ b/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.cpp @@ -42,7 +42,7 @@ namespace void dbgprintf(LPCTSTR fmt, ...) { TCHAR buf[0x1000]; - + va_list args; va_start(args, fmt); StringCbVPrintf(buf, sizeof(buf), fmt, args); @@ -312,7 +312,7 @@ namespace *ppvObject = NULL; hr = E_NOINTERFACE; } - + dbgprintf(TEXT("CConnectionPointContainer::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject); return hr; } @@ -343,7 +343,7 @@ namespace return hr; } - + virtual HRESULT STDMETHODCALLTYPE FindConnectionPoint(REFIID riid, IConnectionPoint ** ppCP) { dbgprintf(TEXT("CConnectionPointContainer::FindConnectionPoint(%ls, %p)"), UUIDToString(riid).c_str(), ppCP); @@ -384,7 +384,7 @@ namespace *ppvObject = NULL; hr = E_NOINTERFACE; } - + dbgprintf(TEXT("CEnumConnectionPoints::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject); return hr; } @@ -415,7 +415,7 @@ namespace return hr; } - + virtual HRESULT STDMETHODCALLTYPE Skip(ULONG cConnections) { dbgprintf(TEXT("CEnumConnectionPoints::Skip(%lu)"), cConnections); @@ -423,7 +423,7 @@ namespace dbgprintf(TEXT("CEnumConnectionPoints:: -> %08X"), hr); return hr; } - + virtual HRESULT STDMETHODCALLTYPE Reset(void) { dbgprintf(TEXT("CEnumConnectionPoints::Reset()")); @@ -431,7 +431,7 @@ namespace dbgprintf(TEXT("CEnumConnectionPoints:: -> %08X"), hr); return hr; } - + virtual HRESULT STDMETHODCALLTYPE Clone(IEnumConnectionPoints ** ppEnum) { dbgprintf(TEXT("CEnumConnectionPoints::Clone(%p)"), ppEnum); @@ -472,7 +472,7 @@ namespace *ppvObject = NULL; hr = E_NOINTERFACE; } - + dbgprintf(TEXT("CConnectionPoint::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject); return hr; } @@ -534,7 +534,7 @@ namespace dbgprintf(TEXT("CConnectionPoint::EnumConnections(%p)"), ppEnum); HRESULT hr = m_IConnectionPoint->EnumConnections(ppEnum); dbgprintf(TEXT("CConnectionPoint::EnumConnections -> %08X, pEnum = %p"), hr, *ppEnum); - + if(SUCCEEDED(hr)) *ppEnum = HookIEnumConnections(*ppEnum); @@ -569,7 +569,7 @@ namespace *ppvObject = NULL; hr = E_NOINTERFACE; } - + dbgprintf(TEXT("CEnumConnections::QueryInterface -> %08X, ppvObject = %p"), hr, *ppvObject); return hr; } @@ -596,7 +596,7 @@ namespace dbgprintf(TEXT("CEnumConnections:: -> %08X, CD = { pUnk = %p, dwCookie = %lu }, cFetched = %lu"), hr, pCD->pUnk, pCD->dwCookie, *pcFetched); return hr; } - + virtual HRESULT STDMETHODCALLTYPE Skip(ULONG cConnections) { dbgprintf(TEXT("CEnumConnections::Skip(%lu)"), cConnections); @@ -604,7 +604,7 @@ namespace dbgprintf(TEXT("CEnumConnections:: -> %08X"), hr); return hr; } - + virtual HRESULT STDMETHODCALLTYPE Reset(void) { dbgprintf(TEXT("CEnumConnections::Reset()")); @@ -612,7 +612,7 @@ namespace dbgprintf(TEXT("CEnumConnections:: -> %08X"), hr); return hr; } - + virtual HRESULT STDMETHODCALLTYPE Clone(IEnumConnections ** ppEnum) { dbgprintf(TEXT("CEnumConnections::Clone(%p)"), ppEnum); @@ -827,7 +827,7 @@ namespace { HRESULT hr; IUnknown * pvObject; - + dbgprintf(TEXT("CAdvancedSettings::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject); #define QIBEGIN() \ @@ -2672,7 +2672,7 @@ namespace { HRESULT hr; IUnknown * pvObject = NULL; - + dbgprintf(TEXT("IUnknown::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject); #define QIBEGIN() \ @@ -2787,7 +2787,7 @@ namespace *ppvObject = this; return S_OK; } - + return InnerToOuter(this)->queryInterface(riid, ppvObject); } @@ -4050,7 +4050,7 @@ namespace dbgprintf(TEXT("IQuickActivate::QuickActivate(%s, %p)"), o1.str().c_str(), pQaControl); HRESULT hr = pIQuickActivate->QuickActivate(pQaContainer, pQaControl); - + std::basic_stringstream o2; o2 << "{ "; @@ -4828,7 +4828,7 @@ namespace { HRESULT hr; IUnknown * pvObject = NULL; - + dbgprintf(TEXT("IUnknown::QueryInterface(%ls, %p)"), UUIDToString(riid).c_str(), ppvObject); #define QIBEGIN() \ diff --git a/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.def b/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.def index f10498793bb..5da85892a99 100644 --- a/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.def +++ b/reactos/base/applications/tsclient/porting-tools/mstscax/mstscax.def @@ -4,10 +4,10 @@ EXPORTS ; OLE inproc server DllGetClassObject PRIVATE DllCanUnloadNow PRIVATE - + ; OLE self-registration ; TODO - + ; Private APIs DllGetTscCtlVer diff --git a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/activex.cpp b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/activex.cpp index 0bb197bcb14..f93fe534f29 100644 --- a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/activex.cpp +++ b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/activex.cpp @@ -338,7 +338,7 @@ public: wcexDisplay.hCursor = LoadCursor(NULL, IDC_ARROW); wcexDisplay.hbrBackground = nullBrush; wcexDisplay.lpszClassName = TEXT("MissTosca_Display"); - + wcexInput.style = CS_VREDRAW | CS_HREDRAW; wcexInput.lpfnWndProc = NULL; // TODO wcexInput.hInstance = GetCurrentModule(); @@ -416,7 +416,7 @@ private: } SCROLLINFO scroll = { sizeof(scroll), SIF_ALL, 0 }; - + // update the horizontal scrollbar scroll.nMax = m_consoleWidth; scroll.nPage = rcClient.right; @@ -1122,7 +1122,7 @@ public: int fromstride = cx * m_displayBufferByteDepth; const uint8 * src = cache_get_desktop(/*This*/NULL, offset, cx, cy, m_displayBufferByteDepth); - + uint8 * dst = (uint8 *)m_displayBufferRaw + x * m_displayBufferByteDepth + @@ -1174,7 +1174,7 @@ public: /* Keyboard stuff */ // TODO: we need a good way to post output cross-thread case WM_SYSKEYDOWN: - case WM_KEYDOWN: + case WM_KEYDOWN: //rdp_send_input(This, GetMessageTime(), RDP_INPUT_SCANCODE, RDP_KEYPRESS | (lparam & 0x1000000 ? KBD_FLAG_EXT : 0), LOBYTE(HIWORD(lparam)), 0); break; @@ -1814,7 +1814,7 @@ private: break; strNewPassword = SysAllocStringLen(redirectArgs->password, redirectArgs->password_len / sizeof(OLECHAR)); - + if(strNewPassword == NULL && redirectArgs->password_len) break; @@ -1904,7 +1904,7 @@ private: ( DISPID eventId, VARIANTARG * rgvarg = NULL, - unsigned int cArgs = 0, + unsigned int cArgs = 0, VARIANTARG * retval = NULL, AsyncEventCallback callback = NULL ) @@ -2516,7 +2516,7 @@ private: { if(iTInfo != 0) return DISP_E_BADINDEX; - + return AcquireDispTypeInfo(ppTInfo); } @@ -3439,7 +3439,7 @@ private: { if(iTInfo != 0) return DISP_E_BADINDEX; - + return AcquireDispTypeInfo(ppTInfo); } @@ -3806,7 +3806,7 @@ private: goto l_Disconnect; } - if(overallConnectionTimer) + if(overallConnectionTimer) SetWaitableTimer(overallConnectionTimer, &overallTimeout, 0, ConnectionTimerAPC, NULL, FALSE); // Initial connection @@ -3930,7 +3930,7 @@ private: ++ autoReconnections; } - if(overallConnectionTimer) + if(overallConnectionTimer) SetWaitableTimer(overallConnectionTimer, &overallTimeout, 0, ConnectionTimerAPC, NULL, FALSE); // Reconnection @@ -4233,11 +4233,11 @@ private: } return 0; - + default: { LRESULT result; - + if(HandleEvent(uMsg, wParam, lParam, result)) return result; } @@ -4354,7 +4354,7 @@ private: else { hr = CreateControlWindow(hwndParent); - + if(FAILED(hr)) break; } @@ -4444,7 +4444,7 @@ public: { if(iTInfo != 0) return DISP_E_BADINDEX; - + return AcquireDispTypeInfo(ppTInfo); } @@ -4532,7 +4532,7 @@ public: return E_OUTOFMEMORY; } - std::copy(sinks, sinks + m_EventSinksCount, newSinks); + std::copy(sinks, sinks + m_EventSinksCount, newSinks); m_EventSinks = newSinks; sinks = newSinks; @@ -4821,7 +4821,7 @@ public: hr = S_OK; break; - default: + default: if(iVerb > 0) hr = OLEOBJ_S_INVALIDVERB; else @@ -5798,7 +5798,7 @@ HCURSOR ui_create_cursor(RDPCLIENT * This, unsigned int x, unsigned int y, int w iconinfo.yHotspot = y; iconinfo.hbmMask = hbmMask; iconinfo.hbmColor = hbmColor; - + HICON icon = CreateIconIndirect(&iconinfo); if(icon == NULL) @@ -5993,7 +5993,7 @@ public: return RdpClient::CreateInstance(m_classId, m_libIndex, pUnkOuter, riid, ppvObject); } - + virtual STDMETHODIMP LockServer(BOOL fLock) { if(fLock) diff --git a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_h.h b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_h.h index b2166643f30..2685131f18a 100644 --- a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_h.h +++ b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_h.h @@ -9,8 +9,8 @@ /* Compiler settings for .\mstsclib.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ @@ -39,7 +39,7 @@ #pragma once #endif -/* Forward Declarations */ +/* Forward Declarations */ #ifndef __IMsTscAxEvents_FWD_DEFINED__ #define __IMsTscAxEvents_FWD_DEFINED__ @@ -205,7 +205,7 @@ typedef struct MsRdpClient4 MsRdpClient4; #ifdef __cplusplus extern "C"{ -#endif +#endif @@ -213,7 +213,7 @@ extern "C"{ #define __MSTSCLib_LIBRARY_DEFINED__ /* library MSTSCLib */ -/* [version][uuid] */ +/* [version][uuid] */ @@ -232,14 +232,14 @@ extern "C"{ -typedef /* [public][public][public] */ +typedef /* [public][public][public] */ enum __MIDL___MIDL_itf_mstsax_0275_0001 { autoReconnectContinueAutomatic = 0, autoReconnectContinueStop = 1, autoReconnectContinueManual = 2 } AutoReconnectContinueState; -typedef /* [public][public][public] */ +typedef /* [public][public][public] */ enum __MIDL_IMsRdpClient_0001 { exDiscReasonNoInfo = 0, exDiscReasonAPIInitiatedDisconnect = 1, @@ -265,7 +265,7 @@ enum __MIDL_IMsRdpClient_0001 exDiscReasonProtocolRangeEnd = 32767 } ExtendedDisconnectReasonCode; -typedef /* [public][public][public] */ +typedef /* [public][public][public] */ enum __MIDL_IMsRdpClient_0002 { controlCloseCanProceed = 0, controlCloseWaitForEvents = 1 @@ -282,7 +282,7 @@ EXTERN_C const IID LIBID_MSTSCLib; #define __IMsTscAxEvents_DISPINTERFACE_DEFINED__ /* dispinterface IMsTscAxEvents */ -/* [uuid] */ +/* [uuid] */ EXTERN_C const IID DIID_IMsTscAxEvents; @@ -293,44 +293,44 @@ EXTERN_C const IID DIID_IMsTscAxEvents; IMsTscAxEvents : public IDispatch { }; - + #else /* C style interface */ typedef struct IMsTscAxEventsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscAxEvents * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscAxEvents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscAxEvents * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscAxEvents * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscAxEvents * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscAxEvents * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscAxEvents * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -340,7 +340,7 @@ EXTERN_C const IID DIID_IMsTscAxEvents; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - + END_INTERFACE } IMsTscAxEventsVtbl; @@ -349,32 +349,32 @@ EXTERN_C const IID DIID_IMsTscAxEvents; CONST_VTBL struct IMsTscAxEventsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscAxEvents_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscAxEvents_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscAxEvents_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscAxEvents_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscAxEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscAxEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscAxEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #endif /* COBJMACROS */ @@ -389,145 +389,145 @@ EXTERN_C const IID DIID_IMsTscAxEvents; #define __IMsTscAx_INTERFACE_DEFINED__ /* interface IMsTscAx */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsTscAx; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("8C11EFAE-92C3-11D1-BC1E-00C04FA31489") IMsTscAx : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Server( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Server( /* [in] */ BSTR pServer) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Server( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Server( /* [retval][out] */ BSTR *pServer) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Domain( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Domain( /* [in] */ BSTR pDomain) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Domain( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Domain( /* [retval][out] */ BSTR *pDomain) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_UserName( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_UserName( /* [in] */ BSTR pUserName) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_UserName( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_UserName( /* [retval][out] */ BSTR *pUserName) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisconnectedText( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisconnectedText( /* [in] */ BSTR pDisconnectedText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisconnectedText( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisconnectedText( /* [retval][out] */ BSTR *pDisconnectedText) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectingText( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectingText( /* [in] */ BSTR pConnectingText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectingText( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectingText( /* [retval][out] */ BSTR *pConnectingText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Connected( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Connected( /* [retval][out] */ short *pIsConnected) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopWidth( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopWidth( /* [in] */ long pVal) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopWidth( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopWidth( /* [retval][out] */ long *pVal) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopHeight( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopHeight( /* [in] */ long pVal) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopHeight( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopHeight( /* [retval][out] */ long *pVal) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartConnected( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartConnected( /* [in] */ long pfStartConnected) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartConnected( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartConnected( /* [retval][out] */ long *pfStartConnected) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HorizontalScrollBarVisible( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HorizontalScrollBarVisible( /* [retval][out] */ long *pfHScrollVisible) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_VerticalScrollBarVisible( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_VerticalScrollBarVisible( /* [retval][out] */ long *pfVScrollVisible) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreenTitle( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreenTitle( /* [in] */ BSTR rhs) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CipherStrength( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CipherStrength( /* [retval][out] */ long *pCipherStrength) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Version( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Version( /* [retval][out] */ BSTR *pVersion) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettingsEnabled( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettingsEnabled( /* [retval][out] */ long *pSecuredSettingsEnabled) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings( /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings( /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings) = 0; - - virtual /* [hidden][propget][id] */ HRESULT STDMETHODCALLTYPE get_Debugger( + + virtual /* [hidden][propget][id] */ HRESULT STDMETHODCALLTYPE get_Debugger( /* [retval][out] */ IMsTscDebug **ppDebugger) = 0; - + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Connect( void) = 0; - + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Disconnect( void) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE CreateVirtualChannels( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE CreateVirtualChannels( /* [in] */ BSTR newVal) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendOnVirtualChannel( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendOnVirtualChannel( /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscAxVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscAx * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscAx * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscAx * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscAx * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscAx * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscAx * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscAx * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -537,126 +537,126 @@ EXTERN_C const IID IID_IMsTscAx; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsTscAx * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsTscAx * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsTscAx * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsTscAx * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsTscAx * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsTscAx * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsTscAx * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsTscAx * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsTscAx * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsTscAx * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsTscAx * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsTscAx * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsTscAx * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsTscAx * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsTscAx * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsTscAx * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsTscAx * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsTscAx * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsTscAx * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsTscAx * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsTscAx * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsTscAx * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsTscAx * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsTscAx * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsTscAx * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsTscAx * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsTscAx * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsTscAx * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsTscAx * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsTscAx * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - + END_INTERFACE } IMsTscAxVtbl; @@ -665,123 +665,123 @@ EXTERN_C const IID IID_IMsTscAx; CONST_VTBL struct IMsTscAxVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscAx_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscAx_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscAx_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscAx_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscAx_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscAx_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscAx_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscAx_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsTscAx_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsTscAx_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsTscAx_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsTscAx_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsTscAx_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsTscAx_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsTscAx_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsTscAx_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsTscAx_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsTscAx_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsTscAx_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsTscAx_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsTscAx_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsTscAx_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsTscAx_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsTscAx_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsTscAx_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsTscAx_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsTscAx_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsTscAx_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsTscAx_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsTscAx_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsTscAx_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsTscAx_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsTscAx_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsTscAx_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsTscAx_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsTscAx_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsTscAx_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #endif /* COBJMACROS */ @@ -798,88 +798,88 @@ EXTERN_C const IID IID_IMsTscAx; #define __IMsRdpClient_INTERFACE_DEFINED__ /* interface IMsRdpClient */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("92B4A539-7115-4B7C-A5A9-E5D9EFC2780A") IMsRdpClient : public IMsTscAx { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ColorDepth( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ColorDepth( /* [in] */ long pcolorDepth) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ColorDepth( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ColorDepth( /* [retval][out] */ long *pcolorDepth) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings2( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings2( /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings2( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings2( /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ExtendedDisconnectReason( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ExtendedDisconnectReason( /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( /* [in] */ VARIANT_BOOL pfFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( /* [retval][out] */ VARIANT_BOOL *pfFullScreen) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE SetVirtualChannelOptions( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE SetVirtualChannelOptions( /* [in] */ BSTR chanName, /* [in] */ long chanOptions) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetVirtualChannelOptions( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetVirtualChannelOptions( /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE RequestClose( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE RequestClose( /* [retval][out] */ ControlCloseStatus *pCloseStatus) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -889,168 +889,168 @@ EXTERN_C const IID IID_IMsRdpClient; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - + END_INTERFACE } IMsRdpClientVtbl; @@ -1059,154 +1059,154 @@ EXTERN_C const IID IID_IMsRdpClient; CONST_VTBL struct IMsRdpClientVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #endif /* COBJMACROS */ @@ -1223,65 +1223,65 @@ EXTERN_C const IID IID_IMsRdpClient; #define __IMsRdpClient2_INTERFACE_DEFINED__ /* interface IMsRdpClient2 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient2; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("E7E17DC4-3B71-4BA7-A8E6-281FFADCA28F") IMsRdpClient2 : public IMsRdpClient { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings3( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings3( /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectedStatusText( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectedStatusText( /* [in] */ BSTR pConnectedStatusText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectedStatusText( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectedStatusText( /* [retval][out] */ BSTR *pConnectedStatusText) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClient2Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient2 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient2 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient2 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient2 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient2 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -1291,180 +1291,180 @@ EXTERN_C const IID IID_IMsRdpClient2; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient2 * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient2 * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient2 * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient2 * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient2 * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient2 * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient2 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient2 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient2 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient2 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient2 * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient2 * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient2 * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient2 * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient2 * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient2 * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient2 * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient2 * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient2 * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient2 * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient2 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient2 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient2 * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient2 * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient2 * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient2 * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient2 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient2 * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient2 * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient2 * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient2 * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient2 * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient2 * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient2 * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( IMsRdpClient2 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( IMsRdpClient2 * This, /* [in] */ BSTR pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pConnectedStatusText); - + END_INTERFACE } IMsRdpClient2Vtbl; @@ -1473,164 +1473,164 @@ EXTERN_C const IID IID_IMsRdpClient2; CONST_VTBL struct IMsRdpClient2Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient2_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient2_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient2_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient2_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient2_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient2_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient2_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient2_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient2_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient2_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient2_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient2_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient2_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient2_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient2_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient2_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient2_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient2_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient2_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient2_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient2_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient2_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient2_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient2_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient2_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient2_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient2_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient2_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient2_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient2_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient2_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient2_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient2_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient2_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient2_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient2_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient2_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient2_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient2_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient2_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient2_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #define IMsRdpClient2_get_AdvancedSettings3(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) #define IMsRdpClient2_put_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient2_get_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) #endif /* COBJMACROS */ @@ -1647,59 +1647,59 @@ EXTERN_C const IID IID_IMsRdpClient2; #define __IMsRdpClient3_INTERFACE_DEFINED__ /* interface IMsRdpClient3 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient3; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("91B7CBC5-A72E-4FA0-9300-D647D7E897FF") IMsRdpClient3 : public IMsRdpClient2 { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings4( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings4( /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClient3Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient3 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient3 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient3 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient3 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient3 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient3 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient3 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -1709,184 +1709,184 @@ EXTERN_C const IID IID_IMsRdpClient3; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient3 * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient3 * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient3 * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient3 * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient3 * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient3 * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient3 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient3 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient3 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient3 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient3 * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient3 * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient3 * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient3 * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient3 * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient3 * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient3 * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient3 * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient3 * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient3 * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient3 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient3 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient3 * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient3 * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient3 * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient3 * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient3 * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient3 * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient3 * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient3 * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient3 * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient3 * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( IMsRdpClient3 * This, /* [in] */ BSTR pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings); - + END_INTERFACE } IMsRdpClient3Vtbl; @@ -1895,168 +1895,168 @@ EXTERN_C const IID IID_IMsRdpClient3; CONST_VTBL struct IMsRdpClient3Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient3_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient3_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient3_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient3_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient3_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient3_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient3_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient3_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient3_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient3_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient3_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient3_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient3_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient3_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient3_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient3_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient3_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient3_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient3_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient3_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient3_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient3_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient3_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient3_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient3_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient3_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient3_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient3_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient3_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient3_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient3_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient3_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient3_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient3_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient3_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient3_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient3_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient3_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient3_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient3_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient3_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient3_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient3_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient3_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #define IMsRdpClient3_get_AdvancedSettings3(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) #define IMsRdpClient3_put_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient3_get_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient3_get_AdvancedSettings4(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) #endif /* COBJMACROS */ @@ -2073,59 +2073,59 @@ EXTERN_C const IID IID_IMsRdpClient3; #define __IMsRdpClient4_INTERFACE_DEFINED__ /* interface IMsRdpClient4 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient4; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("095E0738-D97D-488B-B9F6-DD0E8D66C0DE") IMsRdpClient4 : public IMsRdpClient3 { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings5( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings5( /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClient4Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient4 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient4 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient4 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient4 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient4 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient4 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient4 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -2135,188 +2135,188 @@ EXTERN_C const IID IID_IMsRdpClient4; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient4 * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient4 * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient4 * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient4 * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient4 * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient4 * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient4 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient4 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient4 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient4 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient4 * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient4 * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient4 * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient4 * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient4 * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient4 * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient4 * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient4 * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient4 * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient4 * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient4 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient4 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient4 * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient4 * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient4 * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient4 * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient4 * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient4 * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient4 * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient4 * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient4 * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient4 * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( IMsRdpClient4 * This, /* [in] */ BSTR pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings5 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings5 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5); - + END_INTERFACE } IMsRdpClient4Vtbl; @@ -2325,172 +2325,172 @@ EXTERN_C const IID IID_IMsRdpClient4; CONST_VTBL struct IMsRdpClient4Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient4_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient4_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient4_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient4_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient4_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient4_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient4_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient4_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient4_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient4_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient4_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient4_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient4_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient4_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient4_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient4_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient4_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient4_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient4_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient4_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient4_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient4_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient4_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient4_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient4_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient4_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient4_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient4_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient4_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient4_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient4_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient4_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient4_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient4_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient4_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient4_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient4_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient4_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient4_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient4_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient4_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient4_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient4_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient4_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #define IMsRdpClient4_get_AdvancedSettings3(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) #define IMsRdpClient4_put_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient4_get_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient4_get_AdvancedSettings4(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) #define IMsRdpClient4_get_AdvancedSettings5(This,ppAdvSettings5) \ - ( (This)->lpVtbl -> get_AdvancedSettings5(This,ppAdvSettings5) ) + ( (This)->lpVtbl -> get_AdvancedSettings5(This,ppAdvSettings5) ) #endif /* COBJMACROS */ @@ -2507,105 +2507,105 @@ EXTERN_C const IID IID_IMsRdpClient4; #define __IMsTscNonScriptable_INTERFACE_DEFINED__ /* interface IMsTscNonScriptable */ -/* [object][uuid] */ +/* [object][uuid] */ EXTERN_C const IID IID_IMsTscNonScriptable; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("C1E6743A-41C1-4A74-832A-0DD06C1C7A0E") IMsTscNonScriptable : public IUnknown { public: - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortablePassword( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortablePassword( /* [in] */ BSTR pPortablePass) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortablePassword( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortablePassword( /* [retval][out] */ BSTR *pPortablePass) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortableSalt( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortableSalt( /* [in] */ BSTR pPortableSalt) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortableSalt( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortableSalt( /* [retval][out] */ BSTR *pPortableSalt) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinaryPassword( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinaryPassword( /* [in] */ BSTR pBinaryPassword) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinaryPassword( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinaryPassword( /* [retval][out] */ BSTR *pBinaryPassword) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinarySalt( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinarySalt( /* [in] */ BSTR pSalt) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinarySalt( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinarySalt( /* [retval][out] */ BSTR *pSalt) = 0; - + virtual HRESULT STDMETHODCALLTYPE ResetPassword( void) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscNonScriptableVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscNonScriptable * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscNonScriptable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscNonScriptable * This); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsTscNonScriptable * This, /* [in] */ BSTR rhs); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( IMsTscNonScriptable * This, /* [in] */ BSTR pPortablePass); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pPortablePass); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( IMsTscNonScriptable * This, /* [in] */ BSTR pPortableSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pPortableSalt); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( IMsTscNonScriptable * This, /* [in] */ BSTR pBinaryPassword); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pBinaryPassword); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( IMsTscNonScriptable * This, /* [in] */ BSTR pSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pSalt); - - HRESULT ( STDMETHODCALLTYPE *ResetPassword )( + + HRESULT ( STDMETHODCALLTYPE *ResetPassword )( IMsTscNonScriptable * This); - + END_INTERFACE } IMsTscNonScriptableVtbl; @@ -2614,50 +2614,50 @@ EXTERN_C const IID IID_IMsTscNonScriptable; CONST_VTBL struct IMsTscNonScriptableVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscNonScriptable_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscNonScriptable_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscNonScriptable_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscNonScriptable_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsTscNonScriptable_put_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) #define IMsTscNonScriptable_get_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) #define IMsTscNonScriptable_put_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) #define IMsTscNonScriptable_get_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) #define IMsTscNonScriptable_put_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) #define IMsTscNonScriptable_get_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) #define IMsTscNonScriptable_put_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) #define IMsTscNonScriptable_get_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) #define IMsTscNonScriptable_ResetPassword(This) \ - ( (This)->lpVtbl -> ResetPassword(This) ) + ( (This)->lpVtbl -> ResetPassword(This) ) #endif /* COBJMACROS */ @@ -2674,96 +2674,96 @@ EXTERN_C const IID IID_IMsTscNonScriptable; #define __IMsRdpClientNonScriptable_INTERFACE_DEFINED__ /* interface IMsRdpClientNonScriptable */ -/* [object][uuid] */ +/* [object][uuid] */ EXTERN_C const IID IID_IMsRdpClientNonScriptable; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("2F079C4C-87B2-4AFD-97AB-20CDB43038AE") IMsRdpClientNonScriptable : public IMsTscNonScriptable { public: - virtual HRESULT STDMETHODCALLTYPE NotifyRedirectDeviceChange( + virtual HRESULT STDMETHODCALLTYPE NotifyRedirectDeviceChange( /* [in] */ UINT_PTR wParam, /* [in] */ LONG_PTR lParam) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendKeys( + + virtual HRESULT STDMETHODCALLTYPE SendKeys( /* [in] */ long numKeys, /* [in] */ VARIANT_BOOL *pbArrayKeyUp, /* [in] */ long *plKeyData) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientNonScriptableVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientNonScriptable * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientNonScriptable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientNonScriptable * This); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR rhs); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pPortablePass); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pPortablePass); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pPortableSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pPortableSalt); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pBinaryPassword); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pBinaryPassword); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pSalt); - - HRESULT ( STDMETHODCALLTYPE *ResetPassword )( + + HRESULT ( STDMETHODCALLTYPE *ResetPassword )( IMsRdpClientNonScriptable * This); - - HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( + + HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( IMsRdpClientNonScriptable * This, /* [in] */ UINT_PTR wParam, /* [in] */ LONG_PTR lParam); - - HRESULT ( STDMETHODCALLTYPE *SendKeys )( + + HRESULT ( STDMETHODCALLTYPE *SendKeys )( IMsRdpClientNonScriptable * This, /* [in] */ long numKeys, /* [in] */ VARIANT_BOOL *pbArrayKeyUp, /* [in] */ long *plKeyData); - + END_INTERFACE } IMsRdpClientNonScriptableVtbl; @@ -2772,57 +2772,57 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable; CONST_VTBL struct IMsRdpClientNonScriptableVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientNonScriptable_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientNonScriptable_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientNonScriptable_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientNonScriptable_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientNonScriptable_put_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable_get_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable_put_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable_get_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable_put_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable_get_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable_put_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable_get_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable_ResetPassword(This) \ - ( (This)->lpVtbl -> ResetPassword(This) ) + ( (This)->lpVtbl -> ResetPassword(This) ) #define IMsRdpClientNonScriptable_NotifyRedirectDeviceChange(This,wParam,lParam) \ - ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) + ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) #define IMsRdpClientNonScriptable_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \ - ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) + ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) #endif /* COBJMACROS */ @@ -2839,101 +2839,101 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable; #define __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__ /* interface IMsRdpClientNonScriptable2 */ -/* [object][uuid] */ +/* [object][uuid] */ EXTERN_C const IID IID_IMsRdpClientNonScriptable2; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("17A5E535-4072-4FA4-AF32-C8D0D47345E9") IMsRdpClientNonScriptable2 : public IMsRdpClientNonScriptable { public: - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_UIParentWindowHandle( + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_UIParentWindowHandle( /* [in] */ HWND phwndUIParentWindowHandle) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UIParentWindowHandle( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UIParentWindowHandle( /* [retval][out] */ HWND *phwndUIParentWindowHandle) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientNonScriptable2Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientNonScriptable2 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientNonScriptable2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientNonScriptable2 * This); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR rhs); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pPortablePass); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pPortablePass); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pPortableSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pPortableSalt); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pBinaryPassword); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pBinaryPassword); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pSalt); - - HRESULT ( STDMETHODCALLTYPE *ResetPassword )( + + HRESULT ( STDMETHODCALLTYPE *ResetPassword )( IMsRdpClientNonScriptable2 * This); - - HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( + + HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( IMsRdpClientNonScriptable2 * This, /* [in] */ UINT_PTR wParam, /* [in] */ LONG_PTR lParam); - - HRESULT ( STDMETHODCALLTYPE *SendKeys )( + + HRESULT ( STDMETHODCALLTYPE *SendKeys )( IMsRdpClientNonScriptable2 * This, /* [in] */ long numKeys, /* [in] */ VARIANT_BOOL *pbArrayKeyUp, /* [in] */ long *plKeyData); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_UIParentWindowHandle )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_UIParentWindowHandle )( IMsRdpClientNonScriptable2 * This, /* [in] */ HWND phwndUIParentWindowHandle); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UIParentWindowHandle )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UIParentWindowHandle )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ HWND *phwndUIParentWindowHandle); - + END_INTERFACE } IMsRdpClientNonScriptable2Vtbl; @@ -2942,64 +2942,64 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable2; CONST_VTBL struct IMsRdpClientNonScriptable2Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientNonScriptable2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientNonScriptable2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientNonScriptable2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientNonScriptable2_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientNonScriptable2_put_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable2_get_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable2_put_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable2_get_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable2_put_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable2_get_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable2_put_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable2_get_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable2_ResetPassword(This) \ - ( (This)->lpVtbl -> ResetPassword(This) ) + ( (This)->lpVtbl -> ResetPassword(This) ) #define IMsRdpClientNonScriptable2_NotifyRedirectDeviceChange(This,wParam,lParam) \ - ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) + ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) #define IMsRdpClientNonScriptable2_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \ - ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) + ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) #define IMsRdpClientNonScriptable2_put_UIParentWindowHandle(This,phwndUIParentWindowHandle) \ - ( (This)->lpVtbl -> put_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) + ( (This)->lpVtbl -> put_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) #define IMsRdpClientNonScriptable2_get_UIParentWindowHandle(This,phwndUIParentWindowHandle) \ - ( (This)->lpVtbl -> get_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) + ( (This)->lpVtbl -> get_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) #endif /* COBJMACROS */ @@ -3016,98 +3016,98 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable2; #define __IMsTscAdvancedSettings_INTERFACE_DEFINED__ /* interface IMsTscAdvancedSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsTscAdvancedSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("809945CC-4B3B-4A92-A6B0-DBF9B5F2EF2D") IMsTscAdvancedSettings : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Compress( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Compress( /* [in] */ long pcompress) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Compress( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Compress( /* [retval][out] */ long *pcompress) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPeristence( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPeristence( /* [in] */ long pbitmapPeristence) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPeristence( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPeristence( /* [retval][out] */ long *pbitmapPeristence) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_allowBackgroundInput( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_allowBackgroundInput( /* [in] */ long pallowBackgroundInput) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_allowBackgroundInput( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_allowBackgroundInput( /* [retval][out] */ long *pallowBackgroundInput) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyBoardLayoutStr( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyBoardLayoutStr( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PluginDlls( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PluginDlls( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconFile( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconFile( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconIndex( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconIndex( /* [in] */ long rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ContainerHandledFullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ContainerHandledFullScreen( /* [in] */ long pContainerHandledFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ContainerHandledFullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ContainerHandledFullScreen( /* [retval][out] */ long *pContainerHandledFullScreen) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableRdpdr( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableRdpdr( /* [in] */ long pDisableRdpdr) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableRdpdr( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableRdpdr( /* [retval][out] */ long *pDisableRdpdr) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscAdvancedSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscAdvancedSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscAdvancedSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscAdvancedSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscAdvancedSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscAdvancedSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscAdvancedSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscAdvancedSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -3117,63 +3117,63 @@ EXTERN_C const IID IID_IMsTscAdvancedSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsTscAdvancedSettings * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsTscAdvancedSettings * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsTscAdvancedSettings * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsTscAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsTscAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsTscAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsTscAdvancedSettings * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsTscAdvancedSettings * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsTscAdvancedSettings * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pDisableRdpdr); - + END_INTERFACE } IMsTscAdvancedSettingsVtbl; @@ -3182,75 +3182,75 @@ EXTERN_C const IID IID_IMsTscAdvancedSettings; CONST_VTBL struct IMsTscAdvancedSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscAdvancedSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscAdvancedSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscAdvancedSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscAdvancedSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscAdvancedSettings_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsTscAdvancedSettings_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsTscAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsTscAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsTscAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsTscAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsTscAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsTscAdvancedSettings_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsTscAdvancedSettings_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsTscAdvancedSettings_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsTscAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsTscAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsTscAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsTscAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #endif /* COBJMACROS */ @@ -3267,407 +3267,407 @@ EXTERN_C const IID IID_IMsTscAdvancedSettings; #define __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("3C65B4AB-12B3-465B-ACD4-B8DAD3BFF9E2") IMsRdpClientAdvancedSettings : public IMsTscAdvancedSettings { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmoothScroll( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmoothScroll( /* [in] */ long psmoothScroll) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmoothScroll( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmoothScroll( /* [retval][out] */ long *psmoothScroll) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AcceleratorPassthrough( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AcceleratorPassthrough( /* [in] */ long pacceleratorPassthrough) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AcceleratorPassthrough( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AcceleratorPassthrough( /* [retval][out] */ long *pacceleratorPassthrough) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ShadowBitmap( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ShadowBitmap( /* [in] */ long pshadowBitmap) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ShadowBitmap( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ShadowBitmap( /* [retval][out] */ long *pshadowBitmap) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_TransportType( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_TransportType( /* [in] */ long ptransportType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_TransportType( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_TransportType( /* [retval][out] */ long *ptransportType) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SasSequence( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SasSequence( /* [in] */ long psasSequence) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SasSequence( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SasSequence( /* [retval][out] */ long *psasSequence) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EncryptionEnabled( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EncryptionEnabled( /* [in] */ long pencryptionEnabled) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EncryptionEnabled( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EncryptionEnabled( /* [retval][out] */ long *pencryptionEnabled) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DedicatedTerminal( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DedicatedTerminal( /* [in] */ long pdedicatedTerminal) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DedicatedTerminal( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DedicatedTerminal( /* [retval][out] */ long *pdedicatedTerminal) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RDPPort( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RDPPort( /* [in] */ long prdpPort) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RDPPort( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RDPPort( /* [retval][out] */ long *prdpPort) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableMouse( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableMouse( /* [in] */ long penableMouse) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableMouse( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableMouse( /* [retval][out] */ long *penableMouse) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableCtrlAltDel( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableCtrlAltDel( /* [in] */ long pdisableCtrlAltDel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableCtrlAltDel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableCtrlAltDel( /* [retval][out] */ long *pdisableCtrlAltDel) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableWindowsKey( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableWindowsKey( /* [in] */ long penableWindowsKey) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableWindowsKey( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableWindowsKey( /* [retval][out] */ long *penableWindowsKey) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DoubleClickDetect( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DoubleClickDetect( /* [in] */ long pdoubleClickDetect) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DoubleClickDetect( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DoubleClickDetect( /* [retval][out] */ long *pdoubleClickDetect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaximizeShell( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaximizeShell( /* [in] */ long pmaximizeShell) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaximizeShell( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaximizeShell( /* [retval][out] */ long *pmaximizeShell) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyFullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyFullScreen( /* [in] */ long photKeyFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyFullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyFullScreen( /* [retval][out] */ long *photKeyFullScreen) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlEsc( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlEsc( /* [in] */ long photKeyCtrlEsc) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlEsc( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlEsc( /* [retval][out] */ long *photKeyCtrlEsc) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltEsc( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltEsc( /* [in] */ long photKeyAltEsc) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltEsc( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltEsc( /* [retval][out] */ long *photKeyAltEsc) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltTab( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltTab( /* [in] */ long photKeyAltTab) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltTab( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltTab( /* [retval][out] */ long *photKeyAltTab) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltShiftTab( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltShiftTab( /* [in] */ long photKeyAltShiftTab) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltShiftTab( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltShiftTab( /* [retval][out] */ long *photKeyAltShiftTab) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltSpace( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltSpace( /* [in] */ long photKeyAltSpace) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltSpace( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltSpace( /* [retval][out] */ long *photKeyAltSpace) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlAltDel( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlAltDel( /* [in] */ long photKeyCtrlAltDel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlAltDel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlAltDel( /* [retval][out] */ long *photKeyCtrlAltDel) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_orderDrawThreshold( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_orderDrawThreshold( /* [in] */ long porderDrawThreshold) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_orderDrawThreshold( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_orderDrawThreshold( /* [retval][out] */ long *porderDrawThreshold) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheSize( /* [in] */ long pbitmapCacheSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheSize( /* [retval][out] */ long *pbitmapCacheSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCacheSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCacheSize( /* [in] */ long pbitmapVirtualCacheSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCacheSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCacheSize( /* [retval][out] */ long *pbitmapVirtualCacheSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ScaleBitmapCachesByBPP( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ScaleBitmapCachesByBPP( /* [in] */ long pbScale) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ScaleBitmapCachesByBPP( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ScaleBitmapCachesByBPP( /* [retval][out] */ long *pbScale) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NumBitmapCaches( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NumBitmapCaches( /* [in] */ long pnumBitmapCaches) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NumBitmapCaches( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NumBitmapCaches( /* [retval][out] */ long *pnumBitmapCaches) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CachePersistenceActive( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CachePersistenceActive( /* [in] */ long pcachePersistenceActive) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CachePersistenceActive( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CachePersistenceActive( /* [retval][out] */ long *pcachePersistenceActive) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PersistCacheDirectory( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PersistCacheDirectory( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_brushSupportLevel( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_brushSupportLevel( /* [in] */ long pbrushSupportLevel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_brushSupportLevel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_brushSupportLevel( /* [retval][out] */ long *pbrushSupportLevel) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_minInputSendInterval( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_minInputSendInterval( /* [in] */ long pminInputSendInterval) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInputSendInterval( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInputSendInterval( /* [retval][out] */ long *pminInputSendInterval) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_InputEventsAtOnce( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_InputEventsAtOnce( /* [in] */ long pinputEventsAtOnce) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_InputEventsAtOnce( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_InputEventsAtOnce( /* [retval][out] */ long *pinputEventsAtOnce) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_maxEventCount( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_maxEventCount( /* [in] */ long pmaxEventCount) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxEventCount( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxEventCount( /* [retval][out] */ long *pmaxEventCount) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_keepAliveInterval( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_keepAliveInterval( /* [in] */ long pkeepAliveInterval) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_keepAliveInterval( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_keepAliveInterval( /* [retval][out] */ long *pkeepAliveInterval) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_shutdownTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_shutdownTimeout( /* [in] */ long pshutdownTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_shutdownTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_shutdownTimeout( /* [retval][out] */ long *pshutdownTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_overallConnectionTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_overallConnectionTimeout( /* [in] */ long poverallConnectionTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_overallConnectionTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_overallConnectionTimeout( /* [retval][out] */ long *poverallConnectionTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_singleConnectionTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_singleConnectionTimeout( /* [in] */ long psingleConnectionTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_singleConnectionTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_singleConnectionTimeout( /* [retval][out] */ long *psingleConnectionTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardType( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardType( /* [in] */ long pkeyboardType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardType( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardType( /* [retval][out] */ long *pkeyboardType) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardSubType( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardSubType( /* [in] */ long pkeyboardSubType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardSubType( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardSubType( /* [retval][out] */ long *pkeyboardSubType) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardFunctionKey( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardFunctionKey( /* [in] */ long pkeyboardFunctionKey) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardFunctionKey( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardFunctionKey( /* [retval][out] */ long *pkeyboardFunctionKey) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WinceFixedPalette( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WinceFixedPalette( /* [in] */ long pwinceFixedPalette) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WinceFixedPalette( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WinceFixedPalette( /* [retval][out] */ long *pwinceFixedPalette) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectToServerConsole( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectToServerConsole( /* [in] */ VARIANT_BOOL pConnectToConsole) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectToServerConsole( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectToServerConsole( /* [retval][out] */ VARIANT_BOOL *pConnectToConsole) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPersistence( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPersistence( /* [in] */ long pbitmapPersistence) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPersistence( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPersistence( /* [retval][out] */ long *pbitmapPersistence) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MinutesToIdleTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MinutesToIdleTimeout( /* [in] */ long pminutesToIdleTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MinutesToIdleTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MinutesToIdleTimeout( /* [retval][out] */ long *pminutesToIdleTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmartSizing( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmartSizing( /* [in] */ VARIANT_BOOL pfSmartSizing) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmartSizing( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmartSizing( /* [retval][out] */ VARIANT_BOOL *pfSmartSizing) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrLocalPrintingDocName( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrLocalPrintingDocName( /* [in] */ BSTR pLocalPrintingDocName) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrLocalPrintingDocName( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrLocalPrintingDocName( /* [retval][out] */ BSTR *pLocalPrintingDocName) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipCleanTempDirString( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipCleanTempDirString( /* [in] */ BSTR clipCleanTempDirString) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipCleanTempDirString( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipCleanTempDirString( /* [retval][out] */ BSTR *clipCleanTempDirString) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipPasteInfoString( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipPasteInfoString( /* [in] */ BSTR clipPasteInfoString) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipPasteInfoString( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipPasteInfoString( /* [retval][out] */ BSTR *clipPasteInfoString) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisplayConnectionBar( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisplayConnectionBar( /* [in] */ VARIANT_BOOL pDisplayConnectionBar) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisplayConnectionBar( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisplayConnectionBar( /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PinConnectionBar( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PinConnectionBar( /* [in] */ VARIANT_BOOL pPinConnectionBar) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PinConnectionBar( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PinConnectionBar( /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_GrabFocusOnConnect( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_GrabFocusOnConnect( /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_GrabFocusOnConnect( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_GrabFocusOnConnect( /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LoadBalanceInfo( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LoadBalanceInfo( /* [in] */ BSTR pLBInfo) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LoadBalanceInfo( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LoadBalanceInfo( /* [retval][out] */ BSTR *pLBInfo) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectDrives( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectDrives( /* [in] */ VARIANT_BOOL pRedirectDrives) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectDrives( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectDrives( /* [retval][out] */ VARIANT_BOOL *pRedirectDrives) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPrinters( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPrinters( /* [in] */ VARIANT_BOOL pRedirectPrinters) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPrinters( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPrinters( /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPorts( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPorts( /* [in] */ VARIANT_BOOL pRedirectPorts) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPorts( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPorts( /* [retval][out] */ VARIANT_BOOL *pRedirectPorts) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectSmartCards( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectSmartCards( /* [in] */ VARIANT_BOOL pRedirectSmartCards) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectSmartCards( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectSmartCards( /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache16BppSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache16BppSize( /* [in] */ long pBitmapVirtualCache16BppSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache16BppSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache16BppSize( /* [retval][out] */ long *pBitmapVirtualCache16BppSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache24BppSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache24BppSize( /* [in] */ long pBitmapVirtualCache24BppSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache24BppSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache24BppSize( /* [retval][out] */ long *pBitmapVirtualCache24BppSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PerformanceFlags( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PerformanceFlags( /* [in] */ long pDisableList) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PerformanceFlags( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PerformanceFlags( /* [retval][out] */ long *pDisableList) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectWithEndpoint( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectWithEndpoint( /* [in] */ VARIANT *rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NotifyTSPublicKey( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NotifyTSPublicKey( /* [in] */ VARIANT_BOOL pfNotify) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NotifyTSPublicKey( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NotifyTSPublicKey( /* [retval][out] */ VARIANT_BOOL *pfNotify) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -3677,531 +3677,531 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - + END_INTERFACE } IMsRdpClientAdvancedSettingsVtbl; @@ -4210,427 +4210,427 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; CONST_VTBL struct IMsRdpClientAdvancedSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #endif /* COBJMACROS */ @@ -4639,7 +4639,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); @@ -4651,7 +4651,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache16BppSize); @@ -4663,7 +4663,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Stu DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); @@ -4675,7 +4675,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Stu DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache24BppSize); @@ -4687,7 +4687,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Stu DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); @@ -4699,7 +4699,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Stu DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_PerformanceFlags_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_PerformanceFlags_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ long pDisableList); @@ -4711,7 +4711,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_PerformanceFlags_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_PerformanceFlags_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_PerformanceFlags_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pDisableList); @@ -4723,7 +4723,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_PerformanceFlags_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT *rhs); @@ -4735,7 +4735,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfNotify); @@ -4747,7 +4747,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); @@ -4767,71 +4767,71 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Stub( #define __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings2 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("9AC42117-2B76-4320-AA44-0E616AB8437B") IMsRdpClientAdvancedSettings2 : public IMsRdpClientAdvancedSettings { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CanAutoReconnect( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CanAutoReconnect( /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableAutoReconnect( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableAutoReconnect( /* [in] */ VARIANT_BOOL pfEnableAutoReconnect) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableAutoReconnect( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableAutoReconnect( /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaxReconnectAttempts( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaxReconnectAttempts( /* [in] */ long pMaxReconnectAttempts) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaxReconnectAttempts( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaxReconnectAttempts( /* [retval][out] */ long *pMaxReconnectAttempts) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettings2Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings2 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -4841,551 +4841,551 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pMaxReconnectAttempts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pMaxReconnectAttempts); - + END_INTERFACE } IMsRdpClientAdvancedSettings2Vtbl; @@ -5394,443 +5394,443 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; CONST_VTBL struct IMsRdpClientAdvancedSettings2Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings2_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings2_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings2_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings2_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings2_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings2_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings2_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings2_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings2_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings2_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings2_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings2_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings2_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings2_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings2_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings2_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings2_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings2_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings2_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings2_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings2_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings2_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings2_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings2_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings2_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings2_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings2_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings2_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings2_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings2_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings2_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings2_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings2_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings2_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings2_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings2_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings2_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings2_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings2_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings2_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings2_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings2_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings2_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings2_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings2_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings2_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings2_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings2_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings2_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings2_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings2_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings2_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings2_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings2_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings2_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings2_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings2_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings2_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings2_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings2_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings2_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings2_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings2_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings2_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings2_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings2_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings2_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings2_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings2_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings2_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings2_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings2_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings2_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings2_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings2_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings2_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings2_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings2_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings2_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings2_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings2_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings2_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings2_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings2_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings2_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings2_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings2_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings2_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings2_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings2_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings2_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings2_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings2_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings2_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings2_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings2_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings2_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings2_get_CanAutoReconnect(This,pfCanAutoReconnect) \ - ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) + ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) #define IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #endif /* COBJMACROS */ @@ -5839,7 +5839,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); @@ -5851,7 +5851,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); @@ -5863,7 +5863,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); @@ -5875,7 +5875,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pMaxReconnectAttempts); @@ -5887,7 +5887,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pMaxReconnectAttempts); @@ -5907,68 +5907,68 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Stub( #define __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings3 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("19CD856B-C542-4C53-ACEE-F127E3BE1A59") IMsRdpClientAdvancedSettings3 : public IMsRdpClientAdvancedSettings2 { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowMinimizeButton( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowMinimizeButton( /* [in] */ VARIANT_BOOL pfShowMinimize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowMinimizeButton( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowMinimizeButton( /* [retval][out] */ VARIANT_BOOL *pfShowMinimize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowRestoreButton( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowRestoreButton( /* [in] */ VARIANT_BOOL pfShowRestore) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowRestoreButton( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowRestoreButton( /* [retval][out] */ VARIANT_BOOL *pfShowRestore) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettings3Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings3 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings3 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings3 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -5978,567 +5978,567 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pMaxReconnectAttempts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pMaxReconnectAttempts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowMinimize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowMinimize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowRestore); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowRestore); - + END_INTERFACE } IMsRdpClientAdvancedSettings3Vtbl; @@ -6547,456 +6547,456 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; CONST_VTBL struct IMsRdpClientAdvancedSettings3Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings3_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings3_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings3_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings3_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings3_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings3_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings3_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings3_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings3_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings3_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings3_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings3_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings3_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings3_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings3_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings3_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings3_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings3_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings3_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings3_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings3_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings3_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings3_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings3_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings3_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings3_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings3_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings3_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings3_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings3_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings3_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings3_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings3_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings3_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings3_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings3_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings3_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings3_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings3_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings3_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings3_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings3_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings3_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings3_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings3_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings3_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings3_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings3_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings3_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings3_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings3_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings3_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings3_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings3_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings3_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings3_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings3_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings3_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings3_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings3_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings3_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings3_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings3_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings3_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings3_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings3_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings3_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings3_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings3_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings3_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings3_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings3_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings3_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings3_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings3_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings3_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings3_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings3_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings3_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings3_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings3_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings3_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings3_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings3_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings3_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings3_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings3_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings3_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings3_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings3_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings3_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings3_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings3_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings3_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings3_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings3_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings3_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings3_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings3_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings3_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings3_get_CanAutoReconnect(This,pfCanAutoReconnect) \ - ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) + ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) #define IMsRdpClientAdvancedSettings3_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings3_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings3_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings3_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #endif /* COBJMACROS */ @@ -7005,7 +7005,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowMinimize); @@ -7017,7 +7017,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButto DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowMinimize); @@ -7029,7 +7029,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButto DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowRestore); @@ -7041,7 +7041,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowRestore); @@ -7061,62 +7061,62 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton #define __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings4 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("FBA7F64E-7345-4405-AE50-FA4A763DC0DE") IMsRdpClientAdvancedSettings4 : public IMsRdpClientAdvancedSettings3 { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AuthenticationLevel( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AuthenticationLevel( /* [in] */ unsigned int puiAuthLevel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AuthenticationLevel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AuthenticationLevel( /* [retval][out] */ unsigned int *puiAuthLevel) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettings4Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings4 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings4 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings4 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -7126,575 +7126,575 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pMaxReconnectAttempts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pMaxReconnectAttempts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfShowMinimize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfShowMinimize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfShowRestore); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfShowRestore); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AuthenticationLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AuthenticationLevel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ unsigned int puiAuthLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AuthenticationLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AuthenticationLevel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ unsigned int *puiAuthLevel); - + END_INTERFACE } IMsRdpClientAdvancedSettings4Vtbl; @@ -7703,463 +7703,463 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; CONST_VTBL struct IMsRdpClientAdvancedSettings4Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings4_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings4_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings4_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings4_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings4_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings4_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings4_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings4_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings4_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings4_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings4_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings4_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings4_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings4_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings4_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings4_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings4_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings4_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings4_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings4_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings4_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings4_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings4_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings4_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings4_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings4_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings4_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings4_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings4_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings4_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings4_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings4_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings4_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings4_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings4_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings4_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings4_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings4_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings4_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings4_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings4_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings4_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings4_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings4_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings4_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings4_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings4_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings4_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings4_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings4_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings4_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings4_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings4_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings4_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings4_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings4_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings4_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings4_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings4_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings4_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings4_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings4_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings4_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings4_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings4_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings4_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings4_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings4_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings4_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings4_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings4_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings4_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings4_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings4_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings4_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings4_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings4_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings4_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings4_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings4_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings4_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings4_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings4_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings4_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings4_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings4_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings4_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings4_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings4_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings4_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings4_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings4_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings4_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings4_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings4_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings4_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings4_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings4_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings4_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings4_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings4_get_CanAutoReconnect(This,pfCanAutoReconnect) \ - ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) + ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) #define IMsRdpClientAdvancedSettings4_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings4_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings4_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings4_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #define IMsRdpClientAdvancedSettings4_put_AuthenticationLevel(This,puiAuthLevel) \ - ( (This)->lpVtbl -> put_AuthenticationLevel(This,puiAuthLevel) ) + ( (This)->lpVtbl -> put_AuthenticationLevel(This,puiAuthLevel) ) #define IMsRdpClientAdvancedSettings4_get_AuthenticationLevel(This,puiAuthLevel) \ - ( (This)->lpVtbl -> get_AuthenticationLevel(This,puiAuthLevel) ) + ( (This)->lpVtbl -> get_AuthenticationLevel(This,puiAuthLevel) ) #endif /* COBJMACROS */ @@ -8168,7 +8168,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Proxy( IMsRdpClientAdvancedSettings4 * This, /* [in] */ unsigned int puiAuthLevel); @@ -8180,7 +8180,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Proxy( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ unsigned int *puiAuthLevel); @@ -8200,74 +8200,74 @@ void __RPC_STUB IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Stub( #define __IMsTscSecuredSettings_INTERFACE_DEFINED__ /* interface IMsTscSecuredSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsTscSecuredSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("C9D65442-A0F9-45B2-8F73-D61D2DB8CBB6") IMsTscSecuredSettings : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartProgram( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartProgram( /* [in] */ BSTR pStartProgram) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartProgram( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartProgram( /* [retval][out] */ BSTR *pStartProgram) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WorkDir( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WorkDir( /* [in] */ BSTR pWorkDir) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WorkDir( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WorkDir( /* [retval][out] */ BSTR *pWorkDir) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( /* [in] */ long pfFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( /* [retval][out] */ long *pfFullScreen) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscSecuredSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscSecuredSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscSecuredSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscSecuredSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscSecuredSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscSecuredSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscSecuredSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscSecuredSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -8277,31 +8277,31 @@ EXTERN_C const IID IID_IMsTscSecuredSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( IMsTscSecuredSettings * This, /* [in] */ BSTR pStartProgram); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( IMsTscSecuredSettings * This, /* [retval][out] */ BSTR *pStartProgram); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( IMsTscSecuredSettings * This, /* [in] */ BSTR pWorkDir); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( IMsTscSecuredSettings * This, /* [retval][out] */ BSTR *pWorkDir); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsTscSecuredSettings * This, /* [in] */ long pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsTscSecuredSettings * This, /* [retval][out] */ long *pfFullScreen); - + END_INTERFACE } IMsTscSecuredSettingsVtbl; @@ -8310,51 +8310,51 @@ EXTERN_C const IID IID_IMsTscSecuredSettings; CONST_VTBL struct IMsTscSecuredSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscSecuredSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscSecuredSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscSecuredSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscSecuredSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscSecuredSettings_put_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) #define IMsTscSecuredSettings_get_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) #define IMsTscSecuredSettings_put_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) #define IMsTscSecuredSettings_get_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) #define IMsTscSecuredSettings_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsTscSecuredSettings_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #endif /* COBJMACROS */ @@ -8371,68 +8371,68 @@ EXTERN_C const IID IID_IMsTscSecuredSettings; #define __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__ /* interface IMsRdpClientSecuredSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("605BEFCF-39C1-45CC-A811-068FB7BE346D") IMsRdpClientSecuredSettings : public IMsTscSecuredSettings { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardHookMode( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardHookMode( /* [in] */ long pkeyboardHookMode) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardHookMode( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardHookMode( /* [retval][out] */ long *pkeyboardHookMode) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AudioRedirectionMode( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AudioRedirectionMode( /* [in] */ long pAudioRedirectionMode) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AudioRedirectionMode( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AudioRedirectionMode( /* [retval][out] */ long *pAudioRedirectionMode) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientSecuredSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientSecuredSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientSecuredSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientSecuredSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientSecuredSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientSecuredSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientSecuredSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientSecuredSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -8442,47 +8442,47 @@ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( IMsRdpClientSecuredSettings * This, /* [in] */ BSTR pStartProgram); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ BSTR *pStartProgram); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( IMsRdpClientSecuredSettings * This, /* [in] */ BSTR pWorkDir); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ BSTR *pWorkDir); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClientSecuredSettings * This, /* [in] */ long pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ long *pfFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardHookMode )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardHookMode )( IMsRdpClientSecuredSettings * This, /* [in] */ long pkeyboardHookMode); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardHookMode )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardHookMode )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ long *pkeyboardHookMode); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AudioRedirectionMode )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AudioRedirectionMode )( IMsRdpClientSecuredSettings * This, /* [in] */ long pAudioRedirectionMode); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AudioRedirectionMode )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AudioRedirectionMode )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ long *pAudioRedirectionMode); - + END_INTERFACE } IMsRdpClientSecuredSettingsVtbl; @@ -8491,64 +8491,64 @@ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; CONST_VTBL struct IMsRdpClientSecuredSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientSecuredSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientSecuredSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientSecuredSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientSecuredSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientSecuredSettings_put_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) #define IMsRdpClientSecuredSettings_get_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) #define IMsRdpClientSecuredSettings_put_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) #define IMsRdpClientSecuredSettings_get_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) #define IMsRdpClientSecuredSettings_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClientSecuredSettings_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClientSecuredSettings_put_KeyboardHookMode(This,pkeyboardHookMode) \ - ( (This)->lpVtbl -> put_KeyboardHookMode(This,pkeyboardHookMode) ) + ( (This)->lpVtbl -> put_KeyboardHookMode(This,pkeyboardHookMode) ) #define IMsRdpClientSecuredSettings_get_KeyboardHookMode(This,pkeyboardHookMode) \ - ( (This)->lpVtbl -> get_KeyboardHookMode(This,pkeyboardHookMode) ) + ( (This)->lpVtbl -> get_KeyboardHookMode(This,pkeyboardHookMode) ) #define IMsRdpClientSecuredSettings_put_AudioRedirectionMode(This,pAudioRedirectionMode) \ - ( (This)->lpVtbl -> put_AudioRedirectionMode(This,pAudioRedirectionMode) ) + ( (This)->lpVtbl -> put_AudioRedirectionMode(This,pAudioRedirectionMode) ) #define IMsRdpClientSecuredSettings_get_AudioRedirectionMode(This,pAudioRedirectionMode) \ - ( (This)->lpVtbl -> get_AudioRedirectionMode(This,pAudioRedirectionMode) ) + ( (This)->lpVtbl -> get_AudioRedirectionMode(This,pAudioRedirectionMode) ) #endif /* COBJMACROS */ @@ -8565,122 +8565,122 @@ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; #define __IMsTscDebug_INTERFACE_DEFINED__ /* interface IMsTscDebug */ -/* [object][oleautomation][dual][hidden][uuid] */ +/* [object][oleautomation][dual][hidden][uuid] */ EXTERN_C const IID IID_IMsTscDebug; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("209D0EB9-6254-47B1-9033-A98DAE55BB27") IMsTscDebug : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchBitmapPDU( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchBitmapPDU( /* [in] */ long phatchBitmapPDU) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchBitmapPDU( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchBitmapPDU( /* [retval][out] */ long *phatchBitmapPDU) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchSSBOrder( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchSSBOrder( /* [in] */ long phatchSSBOrder) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchSSBOrder( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchSSBOrder( /* [retval][out] */ long *phatchSSBOrder) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchMembltOrder( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchMembltOrder( /* [in] */ long phatchMembltOrder) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchMembltOrder( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchMembltOrder( /* [retval][out] */ long *phatchMembltOrder) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchIndexPDU( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchIndexPDU( /* [in] */ long phatchIndexPDU) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchIndexPDU( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchIndexPDU( /* [retval][out] */ long *phatchIndexPDU) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LabelMemblt( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LabelMemblt( /* [in] */ long plabelMemblt) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LabelMemblt( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LabelMemblt( /* [retval][out] */ long *plabelMemblt) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheMonitor( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheMonitor( /* [in] */ long pbitmapCacheMonitor) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheMonitor( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheMonitor( /* [retval][out] */ long *pbitmapCacheMonitor) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocFailuresPercent( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocFailuresPercent( /* [in] */ long pmallocFailuresPercent) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocFailuresPercent( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocFailuresPercent( /* [retval][out] */ long *pmallocFailuresPercent) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocHugeFailuresPercent( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocHugeFailuresPercent( /* [in] */ long pmallocHugeFailuresPercent) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocHugeFailuresPercent( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocHugeFailuresPercent( /* [retval][out] */ long *pmallocHugeFailuresPercent) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NetThroughput( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NetThroughput( /* [in] */ long NetThroughput) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NetThroughput( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NetThroughput( /* [retval][out] */ long *NetThroughput) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXCmdLine( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXCmdLine( /* [in] */ BSTR pCLXCmdLine) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXCmdLine( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXCmdLine( /* [retval][out] */ BSTR *pCLXCmdLine) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXDll( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXDll( /* [in] */ BSTR pCLXDll) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXDll( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXDll( /* [retval][out] */ BSTR *pCLXDll) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscDebugVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscDebug * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscDebug * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscDebug * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscDebug * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscDebug * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscDebug * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscDebug * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -8690,95 +8690,95 @@ EXTERN_C const IID IID_IMsTscDebug; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchBitmapPDU )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchBitmapPDU )( IMsTscDebug * This, /* [in] */ long phatchBitmapPDU); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchBitmapPDU )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchBitmapPDU )( IMsTscDebug * This, /* [retval][out] */ long *phatchBitmapPDU); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchSSBOrder )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchSSBOrder )( IMsTscDebug * This, /* [in] */ long phatchSSBOrder); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchSSBOrder )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchSSBOrder )( IMsTscDebug * This, /* [retval][out] */ long *phatchSSBOrder); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchMembltOrder )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchMembltOrder )( IMsTscDebug * This, /* [in] */ long phatchMembltOrder); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchMembltOrder )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchMembltOrder )( IMsTscDebug * This, /* [retval][out] */ long *phatchMembltOrder); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchIndexPDU )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchIndexPDU )( IMsTscDebug * This, /* [in] */ long phatchIndexPDU); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchIndexPDU )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchIndexPDU )( IMsTscDebug * This, /* [retval][out] */ long *phatchIndexPDU); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LabelMemblt )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LabelMemblt )( IMsTscDebug * This, /* [in] */ long plabelMemblt); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LabelMemblt )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LabelMemblt )( IMsTscDebug * This, /* [retval][out] */ long *plabelMemblt); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheMonitor )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheMonitor )( IMsTscDebug * This, /* [in] */ long pbitmapCacheMonitor); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheMonitor )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheMonitor )( IMsTscDebug * This, /* [retval][out] */ long *pbitmapCacheMonitor); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocFailuresPercent )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocFailuresPercent )( IMsTscDebug * This, /* [in] */ long pmallocFailuresPercent); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocFailuresPercent )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocFailuresPercent )( IMsTscDebug * This, /* [retval][out] */ long *pmallocFailuresPercent); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocHugeFailuresPercent )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocHugeFailuresPercent )( IMsTscDebug * This, /* [in] */ long pmallocHugeFailuresPercent); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocHugeFailuresPercent )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocHugeFailuresPercent )( IMsTscDebug * This, /* [retval][out] */ long *pmallocHugeFailuresPercent); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NetThroughput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NetThroughput )( IMsTscDebug * This, /* [in] */ long NetThroughput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NetThroughput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NetThroughput )( IMsTscDebug * This, /* [retval][out] */ long *NetThroughput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXCmdLine )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXCmdLine )( IMsTscDebug * This, /* [in] */ BSTR pCLXCmdLine); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXCmdLine )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXCmdLine )( IMsTscDebug * This, /* [retval][out] */ BSTR *pCLXCmdLine); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXDll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXDll )( IMsTscDebug * This, /* [in] */ BSTR pCLXDll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXDll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXDll )( IMsTscDebug * This, /* [retval][out] */ BSTR *pCLXDll); - + END_INTERFACE } IMsTscDebugVtbl; @@ -8787,99 +8787,99 @@ EXTERN_C const IID IID_IMsTscDebug; CONST_VTBL struct IMsTscDebugVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscDebug_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscDebug_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscDebug_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscDebug_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscDebug_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscDebug_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscDebug_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscDebug_put_HatchBitmapPDU(This,phatchBitmapPDU) \ - ( (This)->lpVtbl -> put_HatchBitmapPDU(This,phatchBitmapPDU) ) + ( (This)->lpVtbl -> put_HatchBitmapPDU(This,phatchBitmapPDU) ) #define IMsTscDebug_get_HatchBitmapPDU(This,phatchBitmapPDU) \ - ( (This)->lpVtbl -> get_HatchBitmapPDU(This,phatchBitmapPDU) ) + ( (This)->lpVtbl -> get_HatchBitmapPDU(This,phatchBitmapPDU) ) #define IMsTscDebug_put_HatchSSBOrder(This,phatchSSBOrder) \ - ( (This)->lpVtbl -> put_HatchSSBOrder(This,phatchSSBOrder) ) + ( (This)->lpVtbl -> put_HatchSSBOrder(This,phatchSSBOrder) ) #define IMsTscDebug_get_HatchSSBOrder(This,phatchSSBOrder) \ - ( (This)->lpVtbl -> get_HatchSSBOrder(This,phatchSSBOrder) ) + ( (This)->lpVtbl -> get_HatchSSBOrder(This,phatchSSBOrder) ) #define IMsTscDebug_put_HatchMembltOrder(This,phatchMembltOrder) \ - ( (This)->lpVtbl -> put_HatchMembltOrder(This,phatchMembltOrder) ) + ( (This)->lpVtbl -> put_HatchMembltOrder(This,phatchMembltOrder) ) #define IMsTscDebug_get_HatchMembltOrder(This,phatchMembltOrder) \ - ( (This)->lpVtbl -> get_HatchMembltOrder(This,phatchMembltOrder) ) + ( (This)->lpVtbl -> get_HatchMembltOrder(This,phatchMembltOrder) ) #define IMsTscDebug_put_HatchIndexPDU(This,phatchIndexPDU) \ - ( (This)->lpVtbl -> put_HatchIndexPDU(This,phatchIndexPDU) ) + ( (This)->lpVtbl -> put_HatchIndexPDU(This,phatchIndexPDU) ) #define IMsTscDebug_get_HatchIndexPDU(This,phatchIndexPDU) \ - ( (This)->lpVtbl -> get_HatchIndexPDU(This,phatchIndexPDU) ) + ( (This)->lpVtbl -> get_HatchIndexPDU(This,phatchIndexPDU) ) #define IMsTscDebug_put_LabelMemblt(This,plabelMemblt) \ - ( (This)->lpVtbl -> put_LabelMemblt(This,plabelMemblt) ) + ( (This)->lpVtbl -> put_LabelMemblt(This,plabelMemblt) ) #define IMsTscDebug_get_LabelMemblt(This,plabelMemblt) \ - ( (This)->lpVtbl -> get_LabelMemblt(This,plabelMemblt) ) + ( (This)->lpVtbl -> get_LabelMemblt(This,plabelMemblt) ) #define IMsTscDebug_put_BitmapCacheMonitor(This,pbitmapCacheMonitor) \ - ( (This)->lpVtbl -> put_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) + ( (This)->lpVtbl -> put_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) #define IMsTscDebug_get_BitmapCacheMonitor(This,pbitmapCacheMonitor) \ - ( (This)->lpVtbl -> get_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) + ( (This)->lpVtbl -> get_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) #define IMsTscDebug_put_MallocFailuresPercent(This,pmallocFailuresPercent) \ - ( (This)->lpVtbl -> put_MallocFailuresPercent(This,pmallocFailuresPercent) ) + ( (This)->lpVtbl -> put_MallocFailuresPercent(This,pmallocFailuresPercent) ) #define IMsTscDebug_get_MallocFailuresPercent(This,pmallocFailuresPercent) \ - ( (This)->lpVtbl -> get_MallocFailuresPercent(This,pmallocFailuresPercent) ) + ( (This)->lpVtbl -> get_MallocFailuresPercent(This,pmallocFailuresPercent) ) #define IMsTscDebug_put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \ - ( (This)->lpVtbl -> put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) + ( (This)->lpVtbl -> put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) #define IMsTscDebug_get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \ - ( (This)->lpVtbl -> get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) + ( (This)->lpVtbl -> get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) #define IMsTscDebug_put_NetThroughput(This,NetThroughput) \ - ( (This)->lpVtbl -> put_NetThroughput(This,NetThroughput) ) + ( (This)->lpVtbl -> put_NetThroughput(This,NetThroughput) ) #define IMsTscDebug_get_NetThroughput(This,NetThroughput) \ - ( (This)->lpVtbl -> get_NetThroughput(This,NetThroughput) ) + ( (This)->lpVtbl -> get_NetThroughput(This,NetThroughput) ) #define IMsTscDebug_put_CLXCmdLine(This,pCLXCmdLine) \ - ( (This)->lpVtbl -> put_CLXCmdLine(This,pCLXCmdLine) ) + ( (This)->lpVtbl -> put_CLXCmdLine(This,pCLXCmdLine) ) #define IMsTscDebug_get_CLXCmdLine(This,pCLXCmdLine) \ - ( (This)->lpVtbl -> get_CLXCmdLine(This,pCLXCmdLine) ) + ( (This)->lpVtbl -> get_CLXCmdLine(This,pCLXCmdLine) ) #define IMsTscDebug_put_CLXDll(This,pCLXDll) \ - ( (This)->lpVtbl -> put_CLXDll(This,pCLXDll) ) + ( (This)->lpVtbl -> put_CLXDll(This,pCLXDll) ) #define IMsTscDebug_get_CLXDll(This,pCLXDll) \ - ( (This)->lpVtbl -> get_CLXDll(This,pCLXDll) ) + ( (This)->lpVtbl -> get_CLXDll(This,pCLXDll) ) #endif /* COBJMACROS */ diff --git a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_i.c b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_i.c index d156c796787..b66a1a51b68 100644 --- a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_i.c +++ b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_i.c @@ -11,8 +11,8 @@ /* Compiler settings for .\mstsclib.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ @@ -23,7 +23,7 @@ #ifdef __cplusplus extern "C"{ -#endif +#endif #include diff --git a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_h.h b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_h.h index 9e99f00309a..3ee3213df53 100644 --- a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_h.h +++ b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_h.h @@ -9,8 +9,8 @@ /* Compiler settings for .\mstsclib_redist.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ @@ -39,7 +39,7 @@ #pragma once #endif -/* Forward Declarations */ +/* Forward Declarations */ #ifndef __IMsTscAxEvents_FWD_DEFINED__ #define __IMsTscAxEvents_FWD_DEFINED__ @@ -205,7 +205,7 @@ typedef struct MsRdpClient4 MsRdpClient4; #ifdef __cplusplus extern "C"{ -#endif +#endif @@ -213,7 +213,7 @@ extern "C"{ #define __MSTSCLib_LIBRARY_DEFINED__ /* library MSTSCLib */ -/* [version][uuid] */ +/* [version][uuid] */ @@ -232,14 +232,14 @@ extern "C"{ -typedef /* [public][public][public] */ +typedef /* [public][public][public] */ enum __MIDL___MIDL_itf_mstsax_0275_0001 { autoReconnectContinueAutomatic = 0, autoReconnectContinueStop = 1, autoReconnectContinueManual = 2 } AutoReconnectContinueState; -typedef /* [public][public][public] */ +typedef /* [public][public][public] */ enum __MIDL_IMsRdpClient_0001 { exDiscReasonNoInfo = 0, exDiscReasonAPIInitiatedDisconnect = 1, @@ -265,7 +265,7 @@ enum __MIDL_IMsRdpClient_0001 exDiscReasonProtocolRangeEnd = 32767 } ExtendedDisconnectReasonCode; -typedef /* [public][public][public] */ +typedef /* [public][public][public] */ enum __MIDL_IMsRdpClient_0002 { controlCloseCanProceed = 0, controlCloseWaitForEvents = 1 @@ -282,7 +282,7 @@ EXTERN_C const IID LIBID_MSTSCLib; #define __IMsTscAxEvents_DISPINTERFACE_DEFINED__ /* dispinterface IMsTscAxEvents */ -/* [uuid] */ +/* [uuid] */ EXTERN_C const IID DIID_IMsTscAxEvents; @@ -293,44 +293,44 @@ EXTERN_C const IID DIID_IMsTscAxEvents; IMsTscAxEvents : public IDispatch { }; - + #else /* C style interface */ typedef struct IMsTscAxEventsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscAxEvents * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscAxEvents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscAxEvents * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscAxEvents * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscAxEvents * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscAxEvents * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscAxEvents * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -340,7 +340,7 @@ EXTERN_C const IID DIID_IMsTscAxEvents; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - + END_INTERFACE } IMsTscAxEventsVtbl; @@ -349,32 +349,32 @@ EXTERN_C const IID DIID_IMsTscAxEvents; CONST_VTBL struct IMsTscAxEventsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscAxEvents_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscAxEvents_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscAxEvents_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscAxEvents_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscAxEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscAxEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscAxEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #endif /* COBJMACROS */ @@ -389,145 +389,145 @@ EXTERN_C const IID DIID_IMsTscAxEvents; #define __IMsTscAx_INTERFACE_DEFINED__ /* interface IMsTscAx */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsTscAx; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("327BB5CD-834E-4400-AEF2-B30E15E5D682") IMsTscAx : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Server( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Server( /* [in] */ BSTR pServer) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Server( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Server( /* [retval][out] */ BSTR *pServer) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Domain( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Domain( /* [in] */ BSTR pDomain) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Domain( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Domain( /* [retval][out] */ BSTR *pDomain) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_UserName( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_UserName( /* [in] */ BSTR pUserName) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_UserName( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_UserName( /* [retval][out] */ BSTR *pUserName) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisconnectedText( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisconnectedText( /* [in] */ BSTR pDisconnectedText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisconnectedText( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisconnectedText( /* [retval][out] */ BSTR *pDisconnectedText) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectingText( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectingText( /* [in] */ BSTR pConnectingText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectingText( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectingText( /* [retval][out] */ BSTR *pConnectingText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Connected( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Connected( /* [retval][out] */ short *pIsConnected) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopWidth( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopWidth( /* [in] */ long pVal) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopWidth( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopWidth( /* [retval][out] */ long *pVal) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopHeight( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DesktopHeight( /* [in] */ long pVal) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopHeight( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DesktopHeight( /* [retval][out] */ long *pVal) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartConnected( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartConnected( /* [in] */ long pfStartConnected) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartConnected( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartConnected( /* [retval][out] */ long *pfStartConnected) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HorizontalScrollBarVisible( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HorizontalScrollBarVisible( /* [retval][out] */ long *pfHScrollVisible) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_VerticalScrollBarVisible( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_VerticalScrollBarVisible( /* [retval][out] */ long *pfVScrollVisible) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreenTitle( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreenTitle( /* [in] */ BSTR rhs) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CipherStrength( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CipherStrength( /* [retval][out] */ long *pCipherStrength) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Version( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Version( /* [retval][out] */ BSTR *pVersion) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettingsEnabled( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettingsEnabled( /* [retval][out] */ long *pSecuredSettingsEnabled) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings( /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings( /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings) = 0; - - virtual /* [hidden][propget][id] */ HRESULT STDMETHODCALLTYPE get_Debugger( + + virtual /* [hidden][propget][id] */ HRESULT STDMETHODCALLTYPE get_Debugger( /* [retval][out] */ IMsTscDebug **ppDebugger) = 0; - + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Connect( void) = 0; - + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Disconnect( void) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE CreateVirtualChannels( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE CreateVirtualChannels( /* [in] */ BSTR newVal) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendOnVirtualChannel( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE SendOnVirtualChannel( /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscAxVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscAx * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscAx * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscAx * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscAx * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscAx * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscAx * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscAx * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -537,126 +537,126 @@ EXTERN_C const IID IID_IMsTscAx; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsTscAx * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsTscAx * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsTscAx * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsTscAx * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsTscAx * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsTscAx * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsTscAx * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsTscAx * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsTscAx * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsTscAx * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsTscAx * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsTscAx * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsTscAx * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsTscAx * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsTscAx * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsTscAx * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsTscAx * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsTscAx * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsTscAx * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsTscAx * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsTscAx * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsTscAx * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsTscAx * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsTscAx * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsTscAx * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsTscAx * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsTscAx * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsTscAx * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsTscAx * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsTscAx * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - + END_INTERFACE } IMsTscAxVtbl; @@ -665,123 +665,123 @@ EXTERN_C const IID IID_IMsTscAx; CONST_VTBL struct IMsTscAxVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscAx_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscAx_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscAx_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscAx_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscAx_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscAx_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscAx_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscAx_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsTscAx_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsTscAx_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsTscAx_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsTscAx_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsTscAx_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsTscAx_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsTscAx_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsTscAx_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsTscAx_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsTscAx_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsTscAx_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsTscAx_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsTscAx_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsTscAx_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsTscAx_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsTscAx_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsTscAx_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsTscAx_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsTscAx_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsTscAx_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsTscAx_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsTscAx_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsTscAx_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsTscAx_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsTscAx_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsTscAx_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsTscAx_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsTscAx_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsTscAx_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #endif /* COBJMACROS */ @@ -798,88 +798,88 @@ EXTERN_C const IID IID_IMsTscAx; #define __IMsRdpClient_INTERFACE_DEFINED__ /* interface IMsRdpClient */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("92B4A539-7115-4B7C-A5A9-E5D9EFC2780A") IMsRdpClient : public IMsTscAx { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ColorDepth( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ColorDepth( /* [in] */ long pcolorDepth) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ColorDepth( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ColorDepth( /* [retval][out] */ long *pcolorDepth) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings2( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings2( /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings2( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SecuredSettings2( /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ExtendedDisconnectReason( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ExtendedDisconnectReason( /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( /* [in] */ VARIANT_BOOL pfFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( /* [retval][out] */ VARIANT_BOOL *pfFullScreen) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE SetVirtualChannelOptions( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE SetVirtualChannelOptions( /* [in] */ BSTR chanName, /* [in] */ long chanOptions) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetVirtualChannelOptions( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE GetVirtualChannelOptions( /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions) = 0; - - virtual /* [id] */ HRESULT STDMETHODCALLTYPE RequestClose( + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE RequestClose( /* [retval][out] */ ControlCloseStatus *pCloseStatus) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -889,168 +889,168 @@ EXTERN_C const IID IID_IMsRdpClient; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - + END_INTERFACE } IMsRdpClientVtbl; @@ -1059,154 +1059,154 @@ EXTERN_C const IID IID_IMsRdpClient; CONST_VTBL struct IMsRdpClientVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #endif /* COBJMACROS */ @@ -1223,65 +1223,65 @@ EXTERN_C const IID IID_IMsRdpClient; #define __IMsRdpClient2_INTERFACE_DEFINED__ /* interface IMsRdpClient2 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient2; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("E7E17DC4-3B71-4BA7-A8E6-281FFADCA28F") IMsRdpClient2 : public IMsRdpClient { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings3( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings3( /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectedStatusText( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectedStatusText( /* [in] */ BSTR pConnectedStatusText) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectedStatusText( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectedStatusText( /* [retval][out] */ BSTR *pConnectedStatusText) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClient2Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient2 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient2 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient2 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient2 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient2 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -1291,180 +1291,180 @@ EXTERN_C const IID IID_IMsRdpClient2; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient2 * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient2 * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient2 * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient2 * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient2 * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient2 * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient2 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient2 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient2 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient2 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient2 * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient2 * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient2 * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient2 * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient2 * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient2 * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient2 * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient2 * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient2 * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient2 * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient2 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient2 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient2 * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient2 * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient2 * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient2 * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient2 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient2 * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient2 * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient2 * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient2 * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient2 * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient2 * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient2 * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( IMsRdpClient2 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( IMsRdpClient2 * This, /* [in] */ BSTR pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( IMsRdpClient2 * This, /* [retval][out] */ BSTR *pConnectedStatusText); - + END_INTERFACE } IMsRdpClient2Vtbl; @@ -1473,164 +1473,164 @@ EXTERN_C const IID IID_IMsRdpClient2; CONST_VTBL struct IMsRdpClient2Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient2_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient2_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient2_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient2_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient2_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient2_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient2_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient2_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient2_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient2_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient2_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient2_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient2_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient2_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient2_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient2_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient2_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient2_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient2_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient2_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient2_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient2_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient2_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient2_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient2_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient2_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient2_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient2_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient2_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient2_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient2_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient2_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient2_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient2_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient2_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient2_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient2_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient2_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient2_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient2_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient2_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #define IMsRdpClient2_get_AdvancedSettings3(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) #define IMsRdpClient2_put_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient2_get_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) #endif /* COBJMACROS */ @@ -1647,59 +1647,59 @@ EXTERN_C const IID IID_IMsRdpClient2; #define __IMsRdpClient3_INTERFACE_DEFINED__ /* interface IMsRdpClient3 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient3; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("91B7CBC5-A72E-4FA0-9300-D647D7E897FF") IMsRdpClient3 : public IMsRdpClient2 { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings4( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings4( /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClient3Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient3 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient3 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient3 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient3 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient3 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient3 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient3 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -1709,184 +1709,184 @@ EXTERN_C const IID IID_IMsRdpClient3; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient3 * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient3 * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient3 * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient3 * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient3 * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient3 * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient3 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient3 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient3 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient3 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient3 * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient3 * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient3 * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient3 * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient3 * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient3 * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient3 * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient3 * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient3 * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient3 * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient3 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient3 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient3 * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient3 * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient3 * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient3 * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient3 * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient3 * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient3 * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient3 * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient3 * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient3 * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( IMsRdpClient3 * This, /* [in] */ BSTR pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( IMsRdpClient3 * This, /* [retval][out] */ BSTR *pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( IMsRdpClient3 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings); - + END_INTERFACE } IMsRdpClient3Vtbl; @@ -1895,168 +1895,168 @@ EXTERN_C const IID IID_IMsRdpClient3; CONST_VTBL struct IMsRdpClient3Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient3_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient3_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient3_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient3_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient3_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient3_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient3_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient3_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient3_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient3_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient3_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient3_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient3_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient3_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient3_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient3_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient3_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient3_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient3_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient3_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient3_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient3_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient3_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient3_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient3_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient3_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient3_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient3_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient3_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient3_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient3_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient3_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient3_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient3_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient3_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient3_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient3_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient3_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient3_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient3_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient3_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient3_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient3_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient3_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #define IMsRdpClient3_get_AdvancedSettings3(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) #define IMsRdpClient3_put_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient3_get_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient3_get_AdvancedSettings4(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) #endif /* COBJMACROS */ @@ -2073,59 +2073,59 @@ EXTERN_C const IID IID_IMsRdpClient3; #define __IMsRdpClient4_INTERFACE_DEFINED__ /* interface IMsRdpClient4 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClient4; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("095E0738-D97D-488B-B9F6-DD0E8D66C0DE") IMsRdpClient4 : public IMsRdpClient3 { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings5( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AdvancedSettings5( /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClient4Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClient4 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClient4 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClient4 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClient4 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClient4 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClient4 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClient4 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -2135,188 +2135,188 @@ EXTERN_C const IID IID_IMsRdpClient4; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Server )( IMsRdpClient4 * This, /* [in] */ BSTR pServer); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Server )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pServer); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Domain )( IMsRdpClient4 * This, /* [in] */ BSTR pDomain); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Domain )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pDomain); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_UserName )( IMsRdpClient4 * This, /* [in] */ BSTR pUserName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_UserName )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pUserName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisconnectedText )( IMsRdpClient4 * This, /* [in] */ BSTR pDisconnectedText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisconnectedText )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pDisconnectedText); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectingText )( IMsRdpClient4 * This, /* [in] */ BSTR pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectingText )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pConnectingText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Connected )( IMsRdpClient4 * This, /* [retval][out] */ short *pIsConnected); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopWidth )( IMsRdpClient4 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopWidth )( IMsRdpClient4 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DesktopHeight )( IMsRdpClient4 * This, /* [in] */ long pVal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DesktopHeight )( IMsRdpClient4 * This, /* [retval][out] */ long *pVal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartConnected )( IMsRdpClient4 * This, /* [in] */ long pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartConnected )( IMsRdpClient4 * This, /* [retval][out] */ long *pfStartConnected); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HorizontalScrollBarVisible )( IMsRdpClient4 * This, /* [retval][out] */ long *pfHScrollVisible); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_VerticalScrollBarVisible )( IMsRdpClient4 * This, /* [retval][out] */ long *pfVScrollVisible); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreenTitle )( IMsRdpClient4 * This, /* [in] */ BSTR rhs); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CipherStrength )( IMsRdpClient4 * This, /* [retval][out] */ long *pCipherStrength); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pVersion); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettingsEnabled )( IMsRdpClient4 * This, /* [retval][out] */ long *pSecuredSettingsEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings )( IMsRdpClient4 * This, /* [retval][out] */ IMsTscSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings )( IMsRdpClient4 * This, /* [retval][out] */ IMsTscAdvancedSettings **ppAdvSettings); - - /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( + + /* [hidden][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Debugger )( IMsRdpClient4 * This, /* [retval][out] */ IMsTscDebug **ppDebugger); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Connect )( IMsRdpClient4 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Disconnect )( IMsRdpClient4 * This); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *CreateVirtualChannels )( IMsRdpClient4 * This, /* [in] */ BSTR newVal); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SendOnVirtualChannel )( IMsRdpClient4 * This, /* [in] */ BSTR chanName, /* [in] */ BSTR ChanData); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ColorDepth )( IMsRdpClient4 * This, /* [in] */ long pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ColorDepth )( IMsRdpClient4 * This, /* [retval][out] */ long *pcolorDepth); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings2 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SecuredSettings2 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientSecuredSettings **ppSecuredSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ExtendedDisconnectReason )( IMsRdpClient4 * This, /* [retval][out] */ ExtendedDisconnectReasonCode *pExtendedDisconnectReason); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClient4 * This, /* [in] */ VARIANT_BOOL pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClient4 * This, /* [retval][out] */ VARIANT_BOOL *pfFullScreen); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *SetVirtualChannelOptions )( IMsRdpClient4 * This, /* [in] */ BSTR chanName, /* [in] */ long chanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *GetVirtualChannelOptions )( IMsRdpClient4 * This, /* [in] */ BSTR chanName, /* [retval][out] */ long *pChanOptions); - - /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *RequestClose )( IMsRdpClient4 * This, /* [retval][out] */ ControlCloseStatus *pCloseStatus); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings3 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings2 **ppAdvSettings); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectedStatusText )( IMsRdpClient4 * This, /* [in] */ BSTR pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectedStatusText )( IMsRdpClient4 * This, /* [retval][out] */ BSTR *pConnectedStatusText); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings4 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings3 **ppAdvSettings); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings5 )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AdvancedSettings5 )( IMsRdpClient4 * This, /* [retval][out] */ IMsRdpClientAdvancedSettings4 **ppAdvSettings5); - + END_INTERFACE } IMsRdpClient4Vtbl; @@ -2325,172 +2325,172 @@ EXTERN_C const IID IID_IMsRdpClient4; CONST_VTBL struct IMsRdpClient4Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClient4_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClient4_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClient4_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClient4_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClient4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClient4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClient4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClient4_put_Server(This,pServer) \ - ( (This)->lpVtbl -> put_Server(This,pServer) ) + ( (This)->lpVtbl -> put_Server(This,pServer) ) #define IMsRdpClient4_get_Server(This,pServer) \ - ( (This)->lpVtbl -> get_Server(This,pServer) ) + ( (This)->lpVtbl -> get_Server(This,pServer) ) #define IMsRdpClient4_put_Domain(This,pDomain) \ - ( (This)->lpVtbl -> put_Domain(This,pDomain) ) + ( (This)->lpVtbl -> put_Domain(This,pDomain) ) #define IMsRdpClient4_get_Domain(This,pDomain) \ - ( (This)->lpVtbl -> get_Domain(This,pDomain) ) + ( (This)->lpVtbl -> get_Domain(This,pDomain) ) #define IMsRdpClient4_put_UserName(This,pUserName) \ - ( (This)->lpVtbl -> put_UserName(This,pUserName) ) + ( (This)->lpVtbl -> put_UserName(This,pUserName) ) #define IMsRdpClient4_get_UserName(This,pUserName) \ - ( (This)->lpVtbl -> get_UserName(This,pUserName) ) + ( (This)->lpVtbl -> get_UserName(This,pUserName) ) #define IMsRdpClient4_put_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> put_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient4_get_DisconnectedText(This,pDisconnectedText) \ - ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) + ( (This)->lpVtbl -> get_DisconnectedText(This,pDisconnectedText) ) #define IMsRdpClient4_put_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> put_ConnectingText(This,pConnectingText) ) #define IMsRdpClient4_get_ConnectingText(This,pConnectingText) \ - ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) + ( (This)->lpVtbl -> get_ConnectingText(This,pConnectingText) ) #define IMsRdpClient4_get_Connected(This,pIsConnected) \ - ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) + ( (This)->lpVtbl -> get_Connected(This,pIsConnected) ) #define IMsRdpClient4_put_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopWidth(This,pVal) ) #define IMsRdpClient4_get_DesktopWidth(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopWidth(This,pVal) ) #define IMsRdpClient4_put_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> put_DesktopHeight(This,pVal) ) #define IMsRdpClient4_get_DesktopHeight(This,pVal) \ - ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) + ( (This)->lpVtbl -> get_DesktopHeight(This,pVal) ) #define IMsRdpClient4_put_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> put_StartConnected(This,pfStartConnected) ) #define IMsRdpClient4_get_StartConnected(This,pfStartConnected) \ - ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) + ( (This)->lpVtbl -> get_StartConnected(This,pfStartConnected) ) #define IMsRdpClient4_get_HorizontalScrollBarVisible(This,pfHScrollVisible) \ - ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) + ( (This)->lpVtbl -> get_HorizontalScrollBarVisible(This,pfHScrollVisible) ) #define IMsRdpClient4_get_VerticalScrollBarVisible(This,pfVScrollVisible) \ - ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) + ( (This)->lpVtbl -> get_VerticalScrollBarVisible(This,pfVScrollVisible) ) #define IMsRdpClient4_put_FullScreenTitle(This,rhs) \ - ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) + ( (This)->lpVtbl -> put_FullScreenTitle(This,rhs) ) #define IMsRdpClient4_get_CipherStrength(This,pCipherStrength) \ - ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) + ( (This)->lpVtbl -> get_CipherStrength(This,pCipherStrength) ) #define IMsRdpClient4_get_Version(This,pVersion) \ - ( (This)->lpVtbl -> get_Version(This,pVersion) ) + ( (This)->lpVtbl -> get_Version(This,pVersion) ) #define IMsRdpClient4_get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) \ - ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) + ( (This)->lpVtbl -> get_SecuredSettingsEnabled(This,pSecuredSettingsEnabled) ) #define IMsRdpClient4_get_SecuredSettings(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings(This,ppSecuredSettings) ) #define IMsRdpClient4_get_AdvancedSettings(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings(This,ppAdvSettings) ) #define IMsRdpClient4_get_Debugger(This,ppDebugger) \ - ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) + ( (This)->lpVtbl -> get_Debugger(This,ppDebugger) ) #define IMsRdpClient4_Connect(This) \ - ( (This)->lpVtbl -> Connect(This) ) + ( (This)->lpVtbl -> Connect(This) ) #define IMsRdpClient4_Disconnect(This) \ - ( (This)->lpVtbl -> Disconnect(This) ) + ( (This)->lpVtbl -> Disconnect(This) ) #define IMsRdpClient4_CreateVirtualChannels(This,newVal) \ - ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) + ( (This)->lpVtbl -> CreateVirtualChannels(This,newVal) ) #define IMsRdpClient4_SendOnVirtualChannel(This,chanName,ChanData) \ - ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) + ( (This)->lpVtbl -> SendOnVirtualChannel(This,chanName,ChanData) ) #define IMsRdpClient4_put_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> put_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient4_get_ColorDepth(This,pcolorDepth) \ - ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) + ( (This)->lpVtbl -> get_ColorDepth(This,pcolorDepth) ) #define IMsRdpClient4_get_AdvancedSettings2(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings2(This,ppAdvSettings) ) #define IMsRdpClient4_get_SecuredSettings2(This,ppSecuredSettings) \ - ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) + ( (This)->lpVtbl -> get_SecuredSettings2(This,ppSecuredSettings) ) #define IMsRdpClient4_get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) \ - ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) + ( (This)->lpVtbl -> get_ExtendedDisconnectReason(This,pExtendedDisconnectReason) ) #define IMsRdpClient4_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClient4_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClient4_SetVirtualChannelOptions(This,chanName,chanOptions) \ - ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) + ( (This)->lpVtbl -> SetVirtualChannelOptions(This,chanName,chanOptions) ) #define IMsRdpClient4_GetVirtualChannelOptions(This,chanName,pChanOptions) \ - ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) + ( (This)->lpVtbl -> GetVirtualChannelOptions(This,chanName,pChanOptions) ) #define IMsRdpClient4_RequestClose(This,pCloseStatus) \ - ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) + ( (This)->lpVtbl -> RequestClose(This,pCloseStatus) ) #define IMsRdpClient4_get_AdvancedSettings3(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings3(This,ppAdvSettings) ) #define IMsRdpClient4_put_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> put_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient4_get_ConnectedStatusText(This,pConnectedStatusText) \ - ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) + ( (This)->lpVtbl -> get_ConnectedStatusText(This,pConnectedStatusText) ) #define IMsRdpClient4_get_AdvancedSettings4(This,ppAdvSettings) \ - ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) + ( (This)->lpVtbl -> get_AdvancedSettings4(This,ppAdvSettings) ) #define IMsRdpClient4_get_AdvancedSettings5(This,ppAdvSettings5) \ - ( (This)->lpVtbl -> get_AdvancedSettings5(This,ppAdvSettings5) ) + ( (This)->lpVtbl -> get_AdvancedSettings5(This,ppAdvSettings5) ) #endif /* COBJMACROS */ @@ -2507,105 +2507,105 @@ EXTERN_C const IID IID_IMsRdpClient4; #define __IMsTscNonScriptable_INTERFACE_DEFINED__ /* interface IMsTscNonScriptable */ -/* [object][uuid] */ +/* [object][uuid] */ EXTERN_C const IID IID_IMsTscNonScriptable; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("C1E6743A-41C1-4A74-832A-0DD06C1C7A0E") IMsTscNonScriptable : public IUnknown { public: - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortablePassword( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortablePassword( /* [in] */ BSTR pPortablePass) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortablePassword( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortablePassword( /* [retval][out] */ BSTR *pPortablePass) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortableSalt( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_PortableSalt( /* [in] */ BSTR pPortableSalt) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortableSalt( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PortableSalt( /* [retval][out] */ BSTR *pPortableSalt) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinaryPassword( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinaryPassword( /* [in] */ BSTR pBinaryPassword) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinaryPassword( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinaryPassword( /* [retval][out] */ BSTR *pBinaryPassword) = 0; - - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinarySalt( + + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_BinarySalt( /* [in] */ BSTR pSalt) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinarySalt( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_BinarySalt( /* [retval][out] */ BSTR *pSalt) = 0; - + virtual HRESULT STDMETHODCALLTYPE ResetPassword( void) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscNonScriptableVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscNonScriptable * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscNonScriptable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscNonScriptable * This); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsTscNonScriptable * This, /* [in] */ BSTR rhs); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( IMsTscNonScriptable * This, /* [in] */ BSTR pPortablePass); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pPortablePass); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( IMsTscNonScriptable * This, /* [in] */ BSTR pPortableSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pPortableSalt); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( IMsTscNonScriptable * This, /* [in] */ BSTR pBinaryPassword); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pBinaryPassword); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( IMsTscNonScriptable * This, /* [in] */ BSTR pSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( IMsTscNonScriptable * This, /* [retval][out] */ BSTR *pSalt); - - HRESULT ( STDMETHODCALLTYPE *ResetPassword )( + + HRESULT ( STDMETHODCALLTYPE *ResetPassword )( IMsTscNonScriptable * This); - + END_INTERFACE } IMsTscNonScriptableVtbl; @@ -2614,50 +2614,50 @@ EXTERN_C const IID IID_IMsTscNonScriptable; CONST_VTBL struct IMsTscNonScriptableVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscNonScriptable_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscNonScriptable_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscNonScriptable_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscNonScriptable_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsTscNonScriptable_put_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) #define IMsTscNonScriptable_get_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) #define IMsTscNonScriptable_put_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) #define IMsTscNonScriptable_get_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) #define IMsTscNonScriptable_put_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) #define IMsTscNonScriptable_get_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) #define IMsTscNonScriptable_put_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) #define IMsTscNonScriptable_get_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) #define IMsTscNonScriptable_ResetPassword(This) \ - ( (This)->lpVtbl -> ResetPassword(This) ) + ( (This)->lpVtbl -> ResetPassword(This) ) #endif /* COBJMACROS */ @@ -2674,96 +2674,96 @@ EXTERN_C const IID IID_IMsTscNonScriptable; #define __IMsRdpClientNonScriptable_INTERFACE_DEFINED__ /* interface IMsRdpClientNonScriptable */ -/* [object][uuid] */ +/* [object][uuid] */ EXTERN_C const IID IID_IMsRdpClientNonScriptable; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("2F079C4C-87B2-4AFD-97AB-20CDB43038AE") IMsRdpClientNonScriptable : public IMsTscNonScriptable { public: - virtual HRESULT STDMETHODCALLTYPE NotifyRedirectDeviceChange( + virtual HRESULT STDMETHODCALLTYPE NotifyRedirectDeviceChange( /* [in] */ UINT_PTR wParam, /* [in] */ LONG_PTR lParam) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendKeys( + + virtual HRESULT STDMETHODCALLTYPE SendKeys( /* [in] */ long numKeys, /* [in] */ VARIANT_BOOL *pbArrayKeyUp, /* [in] */ long *plKeyData) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientNonScriptableVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientNonScriptable * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientNonScriptable * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientNonScriptable * This); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR rhs); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pPortablePass); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pPortablePass); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pPortableSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pPortableSalt); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pBinaryPassword); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pBinaryPassword); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( IMsRdpClientNonScriptable * This, /* [in] */ BSTR pSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( IMsRdpClientNonScriptable * This, /* [retval][out] */ BSTR *pSalt); - - HRESULT ( STDMETHODCALLTYPE *ResetPassword )( + + HRESULT ( STDMETHODCALLTYPE *ResetPassword )( IMsRdpClientNonScriptable * This); - - HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( + + HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( IMsRdpClientNonScriptable * This, /* [in] */ UINT_PTR wParam, /* [in] */ LONG_PTR lParam); - - HRESULT ( STDMETHODCALLTYPE *SendKeys )( + + HRESULT ( STDMETHODCALLTYPE *SendKeys )( IMsRdpClientNonScriptable * This, /* [in] */ long numKeys, /* [in] */ VARIANT_BOOL *pbArrayKeyUp, /* [in] */ long *plKeyData); - + END_INTERFACE } IMsRdpClientNonScriptableVtbl; @@ -2772,57 +2772,57 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable; CONST_VTBL struct IMsRdpClientNonScriptableVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientNonScriptable_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientNonScriptable_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientNonScriptable_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientNonScriptable_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientNonScriptable_put_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable_get_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable_put_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable_get_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable_put_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable_get_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable_put_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable_get_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable_ResetPassword(This) \ - ( (This)->lpVtbl -> ResetPassword(This) ) + ( (This)->lpVtbl -> ResetPassword(This) ) #define IMsRdpClientNonScriptable_NotifyRedirectDeviceChange(This,wParam,lParam) \ - ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) + ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) #define IMsRdpClientNonScriptable_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \ - ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) + ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) #endif /* COBJMACROS */ @@ -2839,101 +2839,101 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable; #define __IMsRdpClientNonScriptable2_INTERFACE_DEFINED__ /* interface IMsRdpClientNonScriptable2 */ -/* [object][uuid] */ +/* [object][uuid] */ EXTERN_C const IID IID_IMsRdpClientNonScriptable2; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("17A5E535-4072-4FA4-AF32-C8D0D47345E9") IMsRdpClientNonScriptable2 : public IMsRdpClientNonScriptable { public: - virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_UIParentWindowHandle( + virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_UIParentWindowHandle( /* [in] */ HWND phwndUIParentWindowHandle) = 0; - - virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UIParentWindowHandle( + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UIParentWindowHandle( /* [retval][out] */ HWND *phwndUIParentWindowHandle) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientNonScriptable2Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientNonScriptable2 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientNonScriptable2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientNonScriptable2 * This); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR rhs); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortablePassword )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pPortablePass); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortablePassword )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pPortablePass); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_PortableSalt )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pPortableSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortableSalt )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pPortableSalt); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinaryPassword )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pBinaryPassword); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinaryPassword )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pBinaryPassword); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_BinarySalt )( IMsRdpClientNonScriptable2 * This, /* [in] */ BSTR pSalt); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_BinarySalt )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ BSTR *pSalt); - - HRESULT ( STDMETHODCALLTYPE *ResetPassword )( + + HRESULT ( STDMETHODCALLTYPE *ResetPassword )( IMsRdpClientNonScriptable2 * This); - - HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( + + HRESULT ( STDMETHODCALLTYPE *NotifyRedirectDeviceChange )( IMsRdpClientNonScriptable2 * This, /* [in] */ UINT_PTR wParam, /* [in] */ LONG_PTR lParam); - - HRESULT ( STDMETHODCALLTYPE *SendKeys )( + + HRESULT ( STDMETHODCALLTYPE *SendKeys )( IMsRdpClientNonScriptable2 * This, /* [in] */ long numKeys, /* [in] */ VARIANT_BOOL *pbArrayKeyUp, /* [in] */ long *plKeyData); - - /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_UIParentWindowHandle )( + + /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_UIParentWindowHandle )( IMsRdpClientNonScriptable2 * This, /* [in] */ HWND phwndUIParentWindowHandle); - - /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UIParentWindowHandle )( + + /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UIParentWindowHandle )( IMsRdpClientNonScriptable2 * This, /* [retval][out] */ HWND *phwndUIParentWindowHandle); - + END_INTERFACE } IMsRdpClientNonScriptable2Vtbl; @@ -2942,64 +2942,64 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable2; CONST_VTBL struct IMsRdpClientNonScriptable2Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientNonScriptable2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientNonScriptable2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientNonScriptable2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientNonScriptable2_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientNonScriptable2_put_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> put_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable2_get_PortablePassword(This,pPortablePass) \ - ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) + ( (This)->lpVtbl -> get_PortablePassword(This,pPortablePass) ) #define IMsRdpClientNonScriptable2_put_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> put_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable2_get_PortableSalt(This,pPortableSalt) \ - ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) + ( (This)->lpVtbl -> get_PortableSalt(This,pPortableSalt) ) #define IMsRdpClientNonScriptable2_put_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> put_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable2_get_BinaryPassword(This,pBinaryPassword) \ - ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) + ( (This)->lpVtbl -> get_BinaryPassword(This,pBinaryPassword) ) #define IMsRdpClientNonScriptable2_put_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> put_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable2_get_BinarySalt(This,pSalt) \ - ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) + ( (This)->lpVtbl -> get_BinarySalt(This,pSalt) ) #define IMsRdpClientNonScriptable2_ResetPassword(This) \ - ( (This)->lpVtbl -> ResetPassword(This) ) + ( (This)->lpVtbl -> ResetPassword(This) ) #define IMsRdpClientNonScriptable2_NotifyRedirectDeviceChange(This,wParam,lParam) \ - ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) + ( (This)->lpVtbl -> NotifyRedirectDeviceChange(This,wParam,lParam) ) #define IMsRdpClientNonScriptable2_SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) \ - ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) + ( (This)->lpVtbl -> SendKeys(This,numKeys,pbArrayKeyUp,plKeyData) ) #define IMsRdpClientNonScriptable2_put_UIParentWindowHandle(This,phwndUIParentWindowHandle) \ - ( (This)->lpVtbl -> put_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) + ( (This)->lpVtbl -> put_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) #define IMsRdpClientNonScriptable2_get_UIParentWindowHandle(This,phwndUIParentWindowHandle) \ - ( (This)->lpVtbl -> get_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) + ( (This)->lpVtbl -> get_UIParentWindowHandle(This,phwndUIParentWindowHandle) ) #endif /* COBJMACROS */ @@ -3016,98 +3016,98 @@ EXTERN_C const IID IID_IMsRdpClientNonScriptable2; #define __IMsTscAdvancedSettings_INTERFACE_DEFINED__ /* interface IMsTscAdvancedSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsTscAdvancedSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("809945CC-4B3B-4A92-A6B0-DBF9B5F2EF2D") IMsTscAdvancedSettings : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Compress( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_Compress( /* [in] */ long pcompress) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Compress( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_Compress( /* [retval][out] */ long *pcompress) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPeristence( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPeristence( /* [in] */ long pbitmapPeristence) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPeristence( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPeristence( /* [retval][out] */ long *pbitmapPeristence) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_allowBackgroundInput( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_allowBackgroundInput( /* [in] */ long pallowBackgroundInput) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_allowBackgroundInput( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_allowBackgroundInput( /* [retval][out] */ long *pallowBackgroundInput) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyBoardLayoutStr( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyBoardLayoutStr( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PluginDlls( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PluginDlls( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconFile( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconFile( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconIndex( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_IconIndex( /* [in] */ long rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ContainerHandledFullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ContainerHandledFullScreen( /* [in] */ long pContainerHandledFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ContainerHandledFullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ContainerHandledFullScreen( /* [retval][out] */ long *pContainerHandledFullScreen) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableRdpdr( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableRdpdr( /* [in] */ long pDisableRdpdr) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableRdpdr( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableRdpdr( /* [retval][out] */ long *pDisableRdpdr) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscAdvancedSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscAdvancedSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscAdvancedSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscAdvancedSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscAdvancedSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscAdvancedSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscAdvancedSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscAdvancedSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -3117,63 +3117,63 @@ EXTERN_C const IID IID_IMsTscAdvancedSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsTscAdvancedSettings * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsTscAdvancedSettings * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsTscAdvancedSettings * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsTscAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsTscAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsTscAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsTscAdvancedSettings * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsTscAdvancedSettings * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsTscAdvancedSettings * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsTscAdvancedSettings * This, /* [retval][out] */ long *pDisableRdpdr); - + END_INTERFACE } IMsTscAdvancedSettingsVtbl; @@ -3182,75 +3182,75 @@ EXTERN_C const IID IID_IMsTscAdvancedSettings; CONST_VTBL struct IMsTscAdvancedSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscAdvancedSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscAdvancedSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscAdvancedSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscAdvancedSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscAdvancedSettings_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsTscAdvancedSettings_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsTscAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsTscAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsTscAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsTscAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsTscAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsTscAdvancedSettings_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsTscAdvancedSettings_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsTscAdvancedSettings_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsTscAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsTscAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsTscAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsTscAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #endif /* COBJMACROS */ @@ -3267,407 +3267,407 @@ EXTERN_C const IID IID_IMsTscAdvancedSettings; #define __IMsRdpClientAdvancedSettings_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("3C65B4AB-12B3-465B-ACD4-B8DAD3BFF9E2") IMsRdpClientAdvancedSettings : public IMsTscAdvancedSettings { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmoothScroll( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmoothScroll( /* [in] */ long psmoothScroll) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmoothScroll( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmoothScroll( /* [retval][out] */ long *psmoothScroll) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AcceleratorPassthrough( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AcceleratorPassthrough( /* [in] */ long pacceleratorPassthrough) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AcceleratorPassthrough( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AcceleratorPassthrough( /* [retval][out] */ long *pacceleratorPassthrough) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ShadowBitmap( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ShadowBitmap( /* [in] */ long pshadowBitmap) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ShadowBitmap( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ShadowBitmap( /* [retval][out] */ long *pshadowBitmap) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_TransportType( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_TransportType( /* [in] */ long ptransportType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_TransportType( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_TransportType( /* [retval][out] */ long *ptransportType) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SasSequence( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SasSequence( /* [in] */ long psasSequence) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SasSequence( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SasSequence( /* [retval][out] */ long *psasSequence) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EncryptionEnabled( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EncryptionEnabled( /* [in] */ long pencryptionEnabled) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EncryptionEnabled( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EncryptionEnabled( /* [retval][out] */ long *pencryptionEnabled) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DedicatedTerminal( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DedicatedTerminal( /* [in] */ long pdedicatedTerminal) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DedicatedTerminal( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DedicatedTerminal( /* [retval][out] */ long *pdedicatedTerminal) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RDPPort( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RDPPort( /* [in] */ long prdpPort) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RDPPort( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RDPPort( /* [retval][out] */ long *prdpPort) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableMouse( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableMouse( /* [in] */ long penableMouse) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableMouse( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableMouse( /* [retval][out] */ long *penableMouse) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableCtrlAltDel( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisableCtrlAltDel( /* [in] */ long pdisableCtrlAltDel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableCtrlAltDel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisableCtrlAltDel( /* [retval][out] */ long *pdisableCtrlAltDel) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableWindowsKey( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableWindowsKey( /* [in] */ long penableWindowsKey) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableWindowsKey( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableWindowsKey( /* [retval][out] */ long *penableWindowsKey) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DoubleClickDetect( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DoubleClickDetect( /* [in] */ long pdoubleClickDetect) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DoubleClickDetect( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DoubleClickDetect( /* [retval][out] */ long *pdoubleClickDetect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaximizeShell( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaximizeShell( /* [in] */ long pmaximizeShell) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaximizeShell( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaximizeShell( /* [retval][out] */ long *pmaximizeShell) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyFullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyFullScreen( /* [in] */ long photKeyFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyFullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyFullScreen( /* [retval][out] */ long *photKeyFullScreen) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlEsc( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlEsc( /* [in] */ long photKeyCtrlEsc) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlEsc( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlEsc( /* [retval][out] */ long *photKeyCtrlEsc) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltEsc( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltEsc( /* [in] */ long photKeyAltEsc) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltEsc( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltEsc( /* [retval][out] */ long *photKeyAltEsc) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltTab( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltTab( /* [in] */ long photKeyAltTab) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltTab( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltTab( /* [retval][out] */ long *photKeyAltTab) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltShiftTab( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltShiftTab( /* [in] */ long photKeyAltShiftTab) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltShiftTab( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltShiftTab( /* [retval][out] */ long *photKeyAltShiftTab) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltSpace( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyAltSpace( /* [in] */ long photKeyAltSpace) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltSpace( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyAltSpace( /* [retval][out] */ long *photKeyAltSpace) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlAltDel( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HotKeyCtrlAltDel( /* [in] */ long photKeyCtrlAltDel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlAltDel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HotKeyCtrlAltDel( /* [retval][out] */ long *photKeyCtrlAltDel) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_orderDrawThreshold( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_orderDrawThreshold( /* [in] */ long porderDrawThreshold) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_orderDrawThreshold( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_orderDrawThreshold( /* [retval][out] */ long *porderDrawThreshold) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheSize( /* [in] */ long pbitmapCacheSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheSize( /* [retval][out] */ long *pbitmapCacheSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCacheSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCacheSize( /* [in] */ long pbitmapVirtualCacheSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCacheSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCacheSize( /* [retval][out] */ long *pbitmapVirtualCacheSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ScaleBitmapCachesByBPP( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ScaleBitmapCachesByBPP( /* [in] */ long pbScale) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ScaleBitmapCachesByBPP( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ScaleBitmapCachesByBPP( /* [retval][out] */ long *pbScale) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NumBitmapCaches( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NumBitmapCaches( /* [in] */ long pnumBitmapCaches) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NumBitmapCaches( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NumBitmapCaches( /* [retval][out] */ long *pnumBitmapCaches) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CachePersistenceActive( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CachePersistenceActive( /* [in] */ long pcachePersistenceActive) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CachePersistenceActive( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CachePersistenceActive( /* [retval][out] */ long *pcachePersistenceActive) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PersistCacheDirectory( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PersistCacheDirectory( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_brushSupportLevel( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_brushSupportLevel( /* [in] */ long pbrushSupportLevel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_brushSupportLevel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_brushSupportLevel( /* [retval][out] */ long *pbrushSupportLevel) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_minInputSendInterval( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_minInputSendInterval( /* [in] */ long pminInputSendInterval) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInputSendInterval( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_minInputSendInterval( /* [retval][out] */ long *pminInputSendInterval) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_InputEventsAtOnce( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_InputEventsAtOnce( /* [in] */ long pinputEventsAtOnce) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_InputEventsAtOnce( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_InputEventsAtOnce( /* [retval][out] */ long *pinputEventsAtOnce) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_maxEventCount( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_maxEventCount( /* [in] */ long pmaxEventCount) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxEventCount( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_maxEventCount( /* [retval][out] */ long *pmaxEventCount) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_keepAliveInterval( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_keepAliveInterval( /* [in] */ long pkeepAliveInterval) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_keepAliveInterval( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_keepAliveInterval( /* [retval][out] */ long *pkeepAliveInterval) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_shutdownTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_shutdownTimeout( /* [in] */ long pshutdownTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_shutdownTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_shutdownTimeout( /* [retval][out] */ long *pshutdownTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_overallConnectionTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_overallConnectionTimeout( /* [in] */ long poverallConnectionTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_overallConnectionTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_overallConnectionTimeout( /* [retval][out] */ long *poverallConnectionTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_singleConnectionTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_singleConnectionTimeout( /* [in] */ long psingleConnectionTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_singleConnectionTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_singleConnectionTimeout( /* [retval][out] */ long *psingleConnectionTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardType( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardType( /* [in] */ long pkeyboardType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardType( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardType( /* [retval][out] */ long *pkeyboardType) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardSubType( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardSubType( /* [in] */ long pkeyboardSubType) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardSubType( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardSubType( /* [retval][out] */ long *pkeyboardSubType) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardFunctionKey( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardFunctionKey( /* [in] */ long pkeyboardFunctionKey) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardFunctionKey( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardFunctionKey( /* [retval][out] */ long *pkeyboardFunctionKey) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WinceFixedPalette( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WinceFixedPalette( /* [in] */ long pwinceFixedPalette) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WinceFixedPalette( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WinceFixedPalette( /* [retval][out] */ long *pwinceFixedPalette) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectToServerConsole( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectToServerConsole( /* [in] */ VARIANT_BOOL pConnectToConsole) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectToServerConsole( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectToServerConsole( /* [retval][out] */ VARIANT_BOOL *pConnectToConsole) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPersistence( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapPersistence( /* [in] */ long pbitmapPersistence) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPersistence( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapPersistence( /* [retval][out] */ long *pbitmapPersistence) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MinutesToIdleTimeout( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MinutesToIdleTimeout( /* [in] */ long pminutesToIdleTimeout) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MinutesToIdleTimeout( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MinutesToIdleTimeout( /* [retval][out] */ long *pminutesToIdleTimeout) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmartSizing( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_SmartSizing( /* [in] */ VARIANT_BOOL pfSmartSizing) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmartSizing( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_SmartSizing( /* [retval][out] */ VARIANT_BOOL *pfSmartSizing) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrLocalPrintingDocName( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrLocalPrintingDocName( /* [in] */ BSTR pLocalPrintingDocName) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrLocalPrintingDocName( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrLocalPrintingDocName( /* [retval][out] */ BSTR *pLocalPrintingDocName) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipCleanTempDirString( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipCleanTempDirString( /* [in] */ BSTR clipCleanTempDirString) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipCleanTempDirString( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipCleanTempDirString( /* [retval][out] */ BSTR *clipCleanTempDirString) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipPasteInfoString( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RdpdrClipPasteInfoString( /* [in] */ BSTR clipPasteInfoString) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipPasteInfoString( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RdpdrClipPasteInfoString( /* [retval][out] */ BSTR *clipPasteInfoString) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ClearTextPassword( /* [in] */ BSTR rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisplayConnectionBar( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_DisplayConnectionBar( /* [in] */ VARIANT_BOOL pDisplayConnectionBar) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisplayConnectionBar( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_DisplayConnectionBar( /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PinConnectionBar( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PinConnectionBar( /* [in] */ VARIANT_BOOL pPinConnectionBar) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PinConnectionBar( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PinConnectionBar( /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_GrabFocusOnConnect( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_GrabFocusOnConnect( /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_GrabFocusOnConnect( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_GrabFocusOnConnect( /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LoadBalanceInfo( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LoadBalanceInfo( /* [in] */ BSTR pLBInfo) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LoadBalanceInfo( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LoadBalanceInfo( /* [retval][out] */ BSTR *pLBInfo) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectDrives( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectDrives( /* [in] */ VARIANT_BOOL pRedirectDrives) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectDrives( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectDrives( /* [retval][out] */ VARIANT_BOOL *pRedirectDrives) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPrinters( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPrinters( /* [in] */ VARIANT_BOOL pRedirectPrinters) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPrinters( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPrinters( /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPorts( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectPorts( /* [in] */ VARIANT_BOOL pRedirectPorts) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPorts( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectPorts( /* [retval][out] */ VARIANT_BOOL *pRedirectPorts) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectSmartCards( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_RedirectSmartCards( /* [in] */ VARIANT_BOOL pRedirectSmartCards) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectSmartCards( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_RedirectSmartCards( /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache16BppSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache16BppSize( /* [in] */ long pBitmapVirtualCache16BppSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache16BppSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache16BppSize( /* [retval][out] */ long *pBitmapVirtualCache16BppSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache24BppSize( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapVirtualCache24BppSize( /* [in] */ long pBitmapVirtualCache24BppSize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache24BppSize( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapVirtualCache24BppSize( /* [retval][out] */ long *pBitmapVirtualCache24BppSize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PerformanceFlags( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_PerformanceFlags( /* [in] */ long pDisableList) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PerformanceFlags( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_PerformanceFlags( /* [retval][out] */ long *pDisableList) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectWithEndpoint( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectWithEndpoint( /* [in] */ VARIANT *rhs) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NotifyTSPublicKey( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NotifyTSPublicKey( /* [in] */ VARIANT_BOOL pfNotify) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NotifyTSPublicKey( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NotifyTSPublicKey( /* [retval][out] */ VARIANT_BOOL *pfNotify) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -3677,531 +3677,531 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - + END_INTERFACE } IMsRdpClientAdvancedSettingsVtbl; @@ -4210,427 +4210,427 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; CONST_VTBL struct IMsRdpClientAdvancedSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #endif /* COBJMACROS */ @@ -4639,7 +4639,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings; -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); @@ -4651,7 +4651,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_RedirectSmartCards_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache16BppSize); @@ -4663,7 +4663,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache16BppSize_Stu DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); @@ -4675,7 +4675,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache16BppSize_Stu DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ long pBitmapVirtualCache24BppSize); @@ -4687,7 +4687,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_BitmapVirtualCache24BppSize_Stu DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); @@ -4699,7 +4699,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_BitmapVirtualCache24BppSize_Stu DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_PerformanceFlags_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_PerformanceFlags_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ long pDisableList); @@ -4711,7 +4711,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_PerformanceFlags_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_PerformanceFlags_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_PerformanceFlags_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ long *pDisableList); @@ -4723,7 +4723,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_PerformanceFlags_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT *rhs); @@ -4735,7 +4735,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_ConnectWithEndpoint_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Proxy( IMsRdpClientAdvancedSettings * This, /* [in] */ VARIANT_BOOL pfNotify); @@ -4747,7 +4747,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_put_NotifyTSPublicKey_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Proxy( IMsRdpClientAdvancedSettings * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); @@ -4767,71 +4767,71 @@ void __RPC_STUB IMsRdpClientAdvancedSettings_get_NotifyTSPublicKey_Stub( #define __IMsRdpClientAdvancedSettings2_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings2 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("9AC42117-2B76-4320-AA44-0E616AB8437B") IMsRdpClientAdvancedSettings2 : public IMsRdpClientAdvancedSettings { public: - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CanAutoReconnect( + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CanAutoReconnect( /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableAutoReconnect( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_EnableAutoReconnect( /* [in] */ VARIANT_BOOL pfEnableAutoReconnect) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableAutoReconnect( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_EnableAutoReconnect( /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaxReconnectAttempts( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MaxReconnectAttempts( /* [in] */ long pMaxReconnectAttempts) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaxReconnectAttempts( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MaxReconnectAttempts( /* [retval][out] */ long *pMaxReconnectAttempts) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettings2Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings2 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -4841,551 +4841,551 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pMaxReconnectAttempts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pMaxReconnectAttempts); - + END_INTERFACE } IMsRdpClientAdvancedSettings2Vtbl; @@ -5394,443 +5394,443 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; CONST_VTBL struct IMsRdpClientAdvancedSettings2Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings2_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings2_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings2_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings2_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings2_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings2_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings2_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings2_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings2_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings2_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings2_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings2_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings2_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings2_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings2_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings2_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings2_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings2_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings2_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings2_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings2_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings2_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings2_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings2_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings2_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings2_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings2_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings2_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings2_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings2_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings2_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings2_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings2_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings2_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings2_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings2_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings2_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings2_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings2_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings2_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings2_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings2_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings2_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings2_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings2_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings2_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings2_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings2_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings2_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings2_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings2_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings2_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings2_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings2_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings2_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings2_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings2_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings2_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings2_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings2_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings2_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings2_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings2_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings2_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings2_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings2_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings2_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings2_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings2_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings2_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings2_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings2_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings2_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings2_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings2_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings2_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings2_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings2_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings2_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings2_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings2_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings2_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings2_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings2_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings2_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings2_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings2_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings2_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings2_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings2_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings2_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings2_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings2_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings2_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings2_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings2_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings2_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings2_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings2_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings2_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings2_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings2_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings2_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings2_get_CanAutoReconnect(This,pfCanAutoReconnect) \ - ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) + ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) #define IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #endif /* COBJMACROS */ @@ -5839,7 +5839,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings2; -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); @@ -5851,7 +5851,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_get_CanAutoReconnect_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); @@ -5863,7 +5863,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_put_EnableAutoReconnect_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); @@ -5875,7 +5875,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_get_EnableAutoReconnect_Stub( DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [in] */ long pMaxReconnectAttempts); @@ -5887,7 +5887,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_put_MaxReconnectAttempts_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Proxy( IMsRdpClientAdvancedSettings2 * This, /* [retval][out] */ long *pMaxReconnectAttempts); @@ -5907,68 +5907,68 @@ void __RPC_STUB IMsRdpClientAdvancedSettings2_get_MaxReconnectAttempts_Stub( #define __IMsRdpClientAdvancedSettings3_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings3 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("19CD856B-C542-4C53-ACEE-F127E3BE1A59") IMsRdpClientAdvancedSettings3 : public IMsRdpClientAdvancedSettings2 { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowMinimizeButton( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowMinimizeButton( /* [in] */ VARIANT_BOOL pfShowMinimize) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowMinimizeButton( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowMinimizeButton( /* [retval][out] */ VARIANT_BOOL *pfShowMinimize) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowRestoreButton( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_ConnectionBarShowRestoreButton( /* [in] */ VARIANT_BOOL pfShowRestore) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowRestoreButton( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_ConnectionBarShowRestoreButton( /* [retval][out] */ VARIANT_BOOL *pfShowRestore) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettings3Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings3 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings3 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings3 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -5978,567 +5978,567 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ long pMaxReconnectAttempts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ long *pMaxReconnectAttempts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowMinimize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowMinimize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowRestore); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowRestore); - + END_INTERFACE } IMsRdpClientAdvancedSettings3Vtbl; @@ -6547,456 +6547,456 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; CONST_VTBL struct IMsRdpClientAdvancedSettings3Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings3_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings3_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings3_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings3_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings3_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings3_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings3_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings3_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings3_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings3_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings3_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings3_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings3_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings3_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings3_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings3_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings3_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings3_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings3_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings3_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings3_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings3_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings3_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings3_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings3_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings3_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings3_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings3_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings3_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings3_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings3_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings3_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings3_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings3_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings3_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings3_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings3_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings3_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings3_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings3_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings3_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings3_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings3_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings3_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings3_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings3_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings3_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings3_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings3_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings3_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings3_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings3_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings3_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings3_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings3_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings3_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings3_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings3_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings3_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings3_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings3_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings3_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings3_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings3_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings3_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings3_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings3_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings3_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings3_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings3_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings3_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings3_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings3_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings3_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings3_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings3_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings3_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings3_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings3_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings3_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings3_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings3_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings3_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings3_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings3_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings3_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings3_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings3_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings3_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings3_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings3_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings3_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings3_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings3_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings3_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings3_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings3_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings3_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings3_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings3_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings3_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings3_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings3_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings3_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings3_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings3_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings3_get_CanAutoReconnect(This,pfCanAutoReconnect) \ - ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) + ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) #define IMsRdpClientAdvancedSettings3_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings3_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings3_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings3_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #define IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #endif /* COBJMACROS */ @@ -7005,7 +7005,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings3; -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowMinimize); @@ -7017,7 +7017,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowMinimizeButto DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowMinimize); @@ -7029,7 +7029,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowMinimizeButto DWORD *_pdwStubPhase); -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [in] */ VARIANT_BOOL pfShowRestore); @@ -7041,7 +7041,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_put_ConnectionBarShowRestoreButton DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton_Proxy( IMsRdpClientAdvancedSettings3 * This, /* [retval][out] */ VARIANT_BOOL *pfShowRestore); @@ -7061,62 +7061,62 @@ void __RPC_STUB IMsRdpClientAdvancedSettings3_get_ConnectionBarShowRestoreButton #define __IMsRdpClientAdvancedSettings4_INTERFACE_DEFINED__ /* interface IMsRdpClientAdvancedSettings4 */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("FBA7F64E-7345-4405-AE50-FA4A763DC0DE") IMsRdpClientAdvancedSettings4 : public IMsRdpClientAdvancedSettings3 { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AuthenticationLevel( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AuthenticationLevel( /* [in] */ unsigned int puiAuthLevel) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AuthenticationLevel( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AuthenticationLevel( /* [retval][out] */ unsigned int *puiAuthLevel) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientAdvancedSettings4Vtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientAdvancedSettings4 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientAdvancedSettings4 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientAdvancedSettings4 * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -7126,575 +7126,575 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Compress )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pcompress); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Compress )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pcompress); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPeristence )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapPeristence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPeristence )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapPeristence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_allowBackgroundInput )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pallowBackgroundInput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_allowBackgroundInput )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pallowBackgroundInput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyBoardLayoutStr )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PluginDlls )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconFile )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IconIndex )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pContainerHandledFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ContainerHandledFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pContainerHandledFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableRdpdr )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pDisableRdpdr); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableRdpdr )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pDisableRdpdr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmoothScroll )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long psmoothScroll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmoothScroll )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *psmoothScroll); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pacceleratorPassthrough); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AcceleratorPassthrough )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pacceleratorPassthrough); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ShadowBitmap )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pshadowBitmap); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ShadowBitmap )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pshadowBitmap); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_TransportType )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long ptransportType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_TransportType )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *ptransportType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SasSequence )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long psasSequence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SasSequence )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *psasSequence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EncryptionEnabled )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pencryptionEnabled); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EncryptionEnabled )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pencryptionEnabled); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DedicatedTerminal )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pdedicatedTerminal); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DedicatedTerminal )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pdedicatedTerminal); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RDPPort )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long prdpPort); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RDPPort )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *prdpPort); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableMouse )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long penableMouse); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableMouse )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *penableMouse); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pdisableCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisableCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pdisableCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableWindowsKey )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long penableWindowsKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableWindowsKey )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *penableWindowsKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DoubleClickDetect )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pdoubleClickDetect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DoubleClickDetect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pdoubleClickDetect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaximizeShell )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pmaximizeShell); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaximizeShell )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pmaximizeShell); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyFullScreen )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyCtrlEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlEsc )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyCtrlEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltEsc )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltEsc); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltEsc )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltEsc); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltTab )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltTab )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltShiftTab); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltShiftTab )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltShiftTab); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyAltSpace )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyAltSpace); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyAltSpace )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyAltSpace); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long photKeyCtrlAltDel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HotKeyCtrlAltDel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *photKeyCtrlAltDel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_orderDrawThreshold )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long porderDrawThreshold); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_orderDrawThreshold )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *porderDrawThreshold); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapVirtualCacheSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCacheSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapVirtualCacheSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbScale); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ScaleBitmapCachesByBPP )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbScale); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NumBitmapCaches )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pnumBitmapCaches); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NumBitmapCaches )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pnumBitmapCaches); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CachePersistenceActive )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pcachePersistenceActive); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CachePersistenceActive )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pcachePersistenceActive); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PersistCacheDirectory )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_brushSupportLevel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbrushSupportLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_brushSupportLevel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbrushSupportLevel); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_minInputSendInterval )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pminInputSendInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_minInputSendInterval )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pminInputSendInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_InputEventsAtOnce )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pinputEventsAtOnce); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_InputEventsAtOnce )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pinputEventsAtOnce); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_maxEventCount )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pmaxEventCount); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_maxEventCount )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pmaxEventCount); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_keepAliveInterval )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeepAliveInterval); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_keepAliveInterval )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeepAliveInterval); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_shutdownTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pshutdownTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_shutdownTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pshutdownTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_overallConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long poverallConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_overallConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *poverallConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_singleConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long psingleConnectionTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_singleConnectionTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *psingleConnectionTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardType )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeyboardType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardType )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeyboardType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardSubType )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeyboardSubType); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardSubType )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeyboardSubType); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pkeyboardFunctionKey); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardFunctionKey )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pkeyboardFunctionKey); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WinceFixedPalette )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pwinceFixedPalette); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WinceFixedPalette )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pwinceFixedPalette); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectToServerConsole )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pConnectToConsole); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectToServerConsole )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pConnectToConsole); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapPersistence )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pbitmapPersistence); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapPersistence )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pbitmapPersistence); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pminutesToIdleTimeout); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MinutesToIdleTimeout )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pminutesToIdleTimeout); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_SmartSizing )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfSmartSizing); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_SmartSizing )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfSmartSizing); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR pLocalPrintingDocName); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrLocalPrintingDocName )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *pLocalPrintingDocName); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR clipCleanTempDirString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipCleanTempDirString )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *clipCleanTempDirString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR clipPasteInfoString); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RdpdrClipPasteInfoString )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *clipPasteInfoString); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClearTextPassword )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_DisplayConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pDisplayConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_DisplayConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pDisplayConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PinConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pPinConnectionBar); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PinConnectionBar )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pPinConnectionBar); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfGrabFocusOnConnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_GrabFocusOnConnect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfGrabFocusOnConnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LoadBalanceInfo )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ BSTR pLBInfo); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LoadBalanceInfo )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ BSTR *pLBInfo); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectDrives )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectDrives); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectDrives )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectDrives); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPrinters )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectPrinters); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPrinters )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPrinters); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectPorts )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectPorts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectPorts )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectPorts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_RedirectSmartCards )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pRedirectSmartCards); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RedirectSmartCards )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pRedirectSmartCards); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pBitmapVirtualCache16BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache16BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pBitmapVirtualCache16BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pBitmapVirtualCache24BppSize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapVirtualCache24BppSize )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pBitmapVirtualCache24BppSize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_PerformanceFlags )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pDisableList); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_PerformanceFlags )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pDisableList); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectWithEndpoint )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT *rhs); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NotifyTSPublicKey )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfNotify); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CanAutoReconnect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfCanAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_EnableAutoReconnect )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfEnableAutoReconnect); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_EnableAutoReconnect )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfEnableAutoReconnect); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ long pMaxReconnectAttempts); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MaxReconnectAttempts )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ long *pMaxReconnectAttempts); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfShowMinimize); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowMinimizeButton )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfShowMinimize); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ VARIANT_BOOL pfShowRestore); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionBarShowRestoreButton )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ VARIANT_BOOL *pfShowRestore); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AuthenticationLevel )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AuthenticationLevel )( IMsRdpClientAdvancedSettings4 * This, /* [in] */ unsigned int puiAuthLevel); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AuthenticationLevel )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AuthenticationLevel )( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ unsigned int *puiAuthLevel); - + END_INTERFACE } IMsRdpClientAdvancedSettings4Vtbl; @@ -7703,463 +7703,463 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; CONST_VTBL struct IMsRdpClientAdvancedSettings4Vtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientAdvancedSettings4_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientAdvancedSettings4_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientAdvancedSettings4_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientAdvancedSettings4_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientAdvancedSettings4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientAdvancedSettings4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientAdvancedSettings4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientAdvancedSettings4_put_Compress(This,pcompress) \ - ( (This)->lpVtbl -> put_Compress(This,pcompress) ) + ( (This)->lpVtbl -> put_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings4_get_Compress(This,pcompress) \ - ( (This)->lpVtbl -> get_Compress(This,pcompress) ) + ( (This)->lpVtbl -> get_Compress(This,pcompress) ) #define IMsRdpClientAdvancedSettings4_put_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> put_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings4_get_BitmapPeristence(This,pbitmapPeristence) \ - ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) + ( (This)->lpVtbl -> get_BitmapPeristence(This,pbitmapPeristence) ) #define IMsRdpClientAdvancedSettings4_put_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> put_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings4_get_allowBackgroundInput(This,pallowBackgroundInput) \ - ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) + ( (This)->lpVtbl -> get_allowBackgroundInput(This,pallowBackgroundInput) ) #define IMsRdpClientAdvancedSettings4_put_KeyBoardLayoutStr(This,rhs) \ - ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) + ( (This)->lpVtbl -> put_KeyBoardLayoutStr(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_PluginDlls(This,rhs) \ - ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) + ( (This)->lpVtbl -> put_PluginDlls(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_IconFile(This,rhs) \ - ( (This)->lpVtbl -> put_IconFile(This,rhs) ) + ( (This)->lpVtbl -> put_IconFile(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_IconIndex(This,rhs) \ - ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) + ( (This)->lpVtbl -> put_IconIndex(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> put_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings4_get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) \ - ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) + ( (This)->lpVtbl -> get_ContainerHandledFullScreen(This,pContainerHandledFullScreen) ) #define IMsRdpClientAdvancedSettings4_put_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> put_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings4_get_DisableRdpdr(This,pDisableRdpdr) \ - ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) + ( (This)->lpVtbl -> get_DisableRdpdr(This,pDisableRdpdr) ) #define IMsRdpClientAdvancedSettings4_put_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> put_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings4_get_SmoothScroll(This,psmoothScroll) \ - ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) + ( (This)->lpVtbl -> get_SmoothScroll(This,psmoothScroll) ) #define IMsRdpClientAdvancedSettings4_put_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> put_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings4_get_AcceleratorPassthrough(This,pacceleratorPassthrough) \ - ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) + ( (This)->lpVtbl -> get_AcceleratorPassthrough(This,pacceleratorPassthrough) ) #define IMsRdpClientAdvancedSettings4_put_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> put_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings4_get_ShadowBitmap(This,pshadowBitmap) \ - ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) + ( (This)->lpVtbl -> get_ShadowBitmap(This,pshadowBitmap) ) #define IMsRdpClientAdvancedSettings4_put_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> put_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings4_get_TransportType(This,ptransportType) \ - ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) + ( (This)->lpVtbl -> get_TransportType(This,ptransportType) ) #define IMsRdpClientAdvancedSettings4_put_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> put_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings4_get_SasSequence(This,psasSequence) \ - ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) + ( (This)->lpVtbl -> get_SasSequence(This,psasSequence) ) #define IMsRdpClientAdvancedSettings4_put_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> put_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings4_get_EncryptionEnabled(This,pencryptionEnabled) \ - ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) + ( (This)->lpVtbl -> get_EncryptionEnabled(This,pencryptionEnabled) ) #define IMsRdpClientAdvancedSettings4_put_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> put_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings4_get_DedicatedTerminal(This,pdedicatedTerminal) \ - ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) + ( (This)->lpVtbl -> get_DedicatedTerminal(This,pdedicatedTerminal) ) #define IMsRdpClientAdvancedSettings4_put_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> put_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings4_get_RDPPort(This,prdpPort) \ - ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) + ( (This)->lpVtbl -> get_RDPPort(This,prdpPort) ) #define IMsRdpClientAdvancedSettings4_put_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> put_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings4_get_EnableMouse(This,penableMouse) \ - ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) + ( (This)->lpVtbl -> get_EnableMouse(This,penableMouse) ) #define IMsRdpClientAdvancedSettings4_put_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> put_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_get_DisableCtrlAltDel(This,pdisableCtrlAltDel) \ - ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) + ( (This)->lpVtbl -> get_DisableCtrlAltDel(This,pdisableCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_put_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> put_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings4_get_EnableWindowsKey(This,penableWindowsKey) \ - ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) + ( (This)->lpVtbl -> get_EnableWindowsKey(This,penableWindowsKey) ) #define IMsRdpClientAdvancedSettings4_put_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> put_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings4_get_DoubleClickDetect(This,pdoubleClickDetect) \ - ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) + ( (This)->lpVtbl -> get_DoubleClickDetect(This,pdoubleClickDetect) ) #define IMsRdpClientAdvancedSettings4_put_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> put_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings4_get_MaximizeShell(This,pmaximizeShell) \ - ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) + ( (This)->lpVtbl -> get_MaximizeShell(This,pmaximizeShell) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> put_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyFullScreen(This,photKeyFullScreen) \ - ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) + ( (This)->lpVtbl -> get_HotKeyFullScreen(This,photKeyFullScreen) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> put_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlEsc(This,photKeyCtrlEsc) \ - ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) + ( (This)->lpVtbl -> get_HotKeyCtrlEsc(This,photKeyCtrlEsc) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> put_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltEsc(This,photKeyAltEsc) \ - ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) + ( (This)->lpVtbl -> get_HotKeyAltEsc(This,photKeyAltEsc) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> put_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltTab(This,photKeyAltTab) \ - ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) + ( (This)->lpVtbl -> get_HotKeyAltTab(This,photKeyAltTab) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> put_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltShiftTab(This,photKeyAltShiftTab) \ - ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) + ( (This)->lpVtbl -> get_HotKeyAltShiftTab(This,photKeyAltShiftTab) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> put_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyAltSpace(This,photKeyAltSpace) \ - ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) + ( (This)->lpVtbl -> get_HotKeyAltSpace(This,photKeyAltSpace) ) #define IMsRdpClientAdvancedSettings4_put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> put_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) \ - ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) + ( (This)->lpVtbl -> get_HotKeyCtrlAltDel(This,photKeyCtrlAltDel) ) #define IMsRdpClientAdvancedSettings4_put_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> put_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings4_get_orderDrawThreshold(This,porderDrawThreshold) \ - ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) + ( (This)->lpVtbl -> get_orderDrawThreshold(This,porderDrawThreshold) ) #define IMsRdpClientAdvancedSettings4_put_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> put_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapCacheSize(This,pbitmapCacheSize) \ - ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) + ( (This)->lpVtbl -> get_BitmapCacheSize(This,pbitmapCacheSize) ) #define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCacheSize(This,pbitmapVirtualCacheSize) ) #define IMsRdpClientAdvancedSettings4_put_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> put_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings4_get_ScaleBitmapCachesByBPP(This,pbScale) \ - ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) + ( (This)->lpVtbl -> get_ScaleBitmapCachesByBPP(This,pbScale) ) #define IMsRdpClientAdvancedSettings4_put_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> put_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings4_get_NumBitmapCaches(This,pnumBitmapCaches) \ - ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) + ( (This)->lpVtbl -> get_NumBitmapCaches(This,pnumBitmapCaches) ) #define IMsRdpClientAdvancedSettings4_put_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> put_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings4_get_CachePersistenceActive(This,pcachePersistenceActive) \ - ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) + ( (This)->lpVtbl -> get_CachePersistenceActive(This,pcachePersistenceActive) ) #define IMsRdpClientAdvancedSettings4_put_PersistCacheDirectory(This,rhs) \ - ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) + ( (This)->lpVtbl -> put_PersistCacheDirectory(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> put_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings4_get_brushSupportLevel(This,pbrushSupportLevel) \ - ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) + ( (This)->lpVtbl -> get_brushSupportLevel(This,pbrushSupportLevel) ) #define IMsRdpClientAdvancedSettings4_put_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> put_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings4_get_minInputSendInterval(This,pminInputSendInterval) \ - ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) + ( (This)->lpVtbl -> get_minInputSendInterval(This,pminInputSendInterval) ) #define IMsRdpClientAdvancedSettings4_put_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> put_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings4_get_InputEventsAtOnce(This,pinputEventsAtOnce) \ - ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) + ( (This)->lpVtbl -> get_InputEventsAtOnce(This,pinputEventsAtOnce) ) #define IMsRdpClientAdvancedSettings4_put_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> put_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings4_get_maxEventCount(This,pmaxEventCount) \ - ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) + ( (This)->lpVtbl -> get_maxEventCount(This,pmaxEventCount) ) #define IMsRdpClientAdvancedSettings4_put_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> put_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings4_get_keepAliveInterval(This,pkeepAliveInterval) \ - ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) + ( (This)->lpVtbl -> get_keepAliveInterval(This,pkeepAliveInterval) ) #define IMsRdpClientAdvancedSettings4_put_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> put_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings4_get_shutdownTimeout(This,pshutdownTimeout) \ - ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) + ( (This)->lpVtbl -> get_shutdownTimeout(This,pshutdownTimeout) ) #define IMsRdpClientAdvancedSettings4_put_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> put_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_get_overallConnectionTimeout(This,poverallConnectionTimeout) \ - ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) + ( (This)->lpVtbl -> get_overallConnectionTimeout(This,poverallConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_put_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> put_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_get_singleConnectionTimeout(This,psingleConnectionTimeout) \ - ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) + ( (This)->lpVtbl -> get_singleConnectionTimeout(This,psingleConnectionTimeout) ) #define IMsRdpClientAdvancedSettings4_put_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> put_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings4_get_KeyboardType(This,pkeyboardType) \ - ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) + ( (This)->lpVtbl -> get_KeyboardType(This,pkeyboardType) ) #define IMsRdpClientAdvancedSettings4_put_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> put_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings4_get_KeyboardSubType(This,pkeyboardSubType) \ - ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) + ( (This)->lpVtbl -> get_KeyboardSubType(This,pkeyboardSubType) ) #define IMsRdpClientAdvancedSettings4_put_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> put_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings4_get_KeyboardFunctionKey(This,pkeyboardFunctionKey) \ - ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) + ( (This)->lpVtbl -> get_KeyboardFunctionKey(This,pkeyboardFunctionKey) ) #define IMsRdpClientAdvancedSettings4_put_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> put_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings4_get_WinceFixedPalette(This,pwinceFixedPalette) \ - ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) + ( (This)->lpVtbl -> get_WinceFixedPalette(This,pwinceFixedPalette) ) #define IMsRdpClientAdvancedSettings4_put_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> put_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings4_get_ConnectToServerConsole(This,pConnectToConsole) \ - ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) + ( (This)->lpVtbl -> get_ConnectToServerConsole(This,pConnectToConsole) ) #define IMsRdpClientAdvancedSettings4_put_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> put_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings4_get_BitmapPersistence(This,pbitmapPersistence) \ - ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) + ( (This)->lpVtbl -> get_BitmapPersistence(This,pbitmapPersistence) ) #define IMsRdpClientAdvancedSettings4_put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> put_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings4_get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) \ - ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) + ( (This)->lpVtbl -> get_MinutesToIdleTimeout(This,pminutesToIdleTimeout) ) #define IMsRdpClientAdvancedSettings4_put_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> put_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings4_get_SmartSizing(This,pfSmartSizing) \ - ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) + ( (This)->lpVtbl -> get_SmartSizing(This,pfSmartSizing) ) #define IMsRdpClientAdvancedSettings4_put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> put_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings4_get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) \ - ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) + ( (This)->lpVtbl -> get_RdpdrLocalPrintingDocName(This,pLocalPrintingDocName) ) #define IMsRdpClientAdvancedSettings4_put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> put_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings4_get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) \ - ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) + ( (This)->lpVtbl -> get_RdpdrClipCleanTempDirString(This,clipCleanTempDirString) ) #define IMsRdpClientAdvancedSettings4_put_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> put_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings4_get_RdpdrClipPasteInfoString(This,clipPasteInfoString) \ - ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) + ( (This)->lpVtbl -> get_RdpdrClipPasteInfoString(This,clipPasteInfoString) ) #define IMsRdpClientAdvancedSettings4_put_ClearTextPassword(This,rhs) \ - ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) + ( (This)->lpVtbl -> put_ClearTextPassword(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> put_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings4_get_DisplayConnectionBar(This,pDisplayConnectionBar) \ - ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) + ( (This)->lpVtbl -> get_DisplayConnectionBar(This,pDisplayConnectionBar) ) #define IMsRdpClientAdvancedSettings4_put_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> put_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings4_get_PinConnectionBar(This,pPinConnectionBar) \ - ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) + ( (This)->lpVtbl -> get_PinConnectionBar(This,pPinConnectionBar) ) #define IMsRdpClientAdvancedSettings4_put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> put_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings4_get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) \ - ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) + ( (This)->lpVtbl -> get_GrabFocusOnConnect(This,pfGrabFocusOnConnect) ) #define IMsRdpClientAdvancedSettings4_put_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> put_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings4_get_LoadBalanceInfo(This,pLBInfo) \ - ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) + ( (This)->lpVtbl -> get_LoadBalanceInfo(This,pLBInfo) ) #define IMsRdpClientAdvancedSettings4_put_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> put_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings4_get_RedirectDrives(This,pRedirectDrives) \ - ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) + ( (This)->lpVtbl -> get_RedirectDrives(This,pRedirectDrives) ) #define IMsRdpClientAdvancedSettings4_put_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> put_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings4_get_RedirectPrinters(This,pRedirectPrinters) \ - ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) + ( (This)->lpVtbl -> get_RedirectPrinters(This,pRedirectPrinters) ) #define IMsRdpClientAdvancedSettings4_put_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> put_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings4_get_RedirectPorts(This,pRedirectPorts) \ - ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) + ( (This)->lpVtbl -> get_RedirectPorts(This,pRedirectPorts) ) #define IMsRdpClientAdvancedSettings4_put_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> put_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings4_get_RedirectSmartCards(This,pRedirectSmartCards) \ - ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) + ( (This)->lpVtbl -> get_RedirectSmartCards(This,pRedirectSmartCards) ) #define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache16BppSize(This,pBitmapVirtualCache16BppSize) ) #define IMsRdpClientAdvancedSettings4_put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> put_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings4_get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) \ - ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) + ( (This)->lpVtbl -> get_BitmapVirtualCache24BppSize(This,pBitmapVirtualCache24BppSize) ) #define IMsRdpClientAdvancedSettings4_put_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> put_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings4_get_PerformanceFlags(This,pDisableList) \ - ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) + ( (This)->lpVtbl -> get_PerformanceFlags(This,pDisableList) ) #define IMsRdpClientAdvancedSettings4_put_ConnectWithEndpoint(This,rhs) \ - ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) + ( (This)->lpVtbl -> put_ConnectWithEndpoint(This,rhs) ) #define IMsRdpClientAdvancedSettings4_put_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> put_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings4_get_NotifyTSPublicKey(This,pfNotify) \ - ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) + ( (This)->lpVtbl -> get_NotifyTSPublicKey(This,pfNotify) ) #define IMsRdpClientAdvancedSettings4_get_CanAutoReconnect(This,pfCanAutoReconnect) \ - ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) + ( (This)->lpVtbl -> get_CanAutoReconnect(This,pfCanAutoReconnect) ) #define IMsRdpClientAdvancedSettings4_put_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> put_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings4_get_EnableAutoReconnect(This,pfEnableAutoReconnect) \ - ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) + ( (This)->lpVtbl -> get_EnableAutoReconnect(This,pfEnableAutoReconnect) ) #define IMsRdpClientAdvancedSettings4_put_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> put_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings4_get_MaxReconnectAttempts(This,pMaxReconnectAttempts) \ - ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) + ( (This)->lpVtbl -> get_MaxReconnectAttempts(This,pMaxReconnectAttempts) ) #define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> put_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) \ - ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) + ( (This)->lpVtbl -> get_ConnectionBarShowMinimizeButton(This,pfShowMinimize) ) #define IMsRdpClientAdvancedSettings4_put_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> put_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #define IMsRdpClientAdvancedSettings4_get_ConnectionBarShowRestoreButton(This,pfShowRestore) \ - ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) + ( (This)->lpVtbl -> get_ConnectionBarShowRestoreButton(This,pfShowRestore) ) #define IMsRdpClientAdvancedSettings4_put_AuthenticationLevel(This,puiAuthLevel) \ - ( (This)->lpVtbl -> put_AuthenticationLevel(This,puiAuthLevel) ) + ( (This)->lpVtbl -> put_AuthenticationLevel(This,puiAuthLevel) ) #define IMsRdpClientAdvancedSettings4_get_AuthenticationLevel(This,puiAuthLevel) \ - ( (This)->lpVtbl -> get_AuthenticationLevel(This,puiAuthLevel) ) + ( (This)->lpVtbl -> get_AuthenticationLevel(This,puiAuthLevel) ) #endif /* COBJMACROS */ @@ -8168,7 +8168,7 @@ EXTERN_C const IID IID_IMsRdpClientAdvancedSettings4; -/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Proxy( +/* [propput][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Proxy( IMsRdpClientAdvancedSettings4 * This, /* [in] */ unsigned int puiAuthLevel); @@ -8180,7 +8180,7 @@ void __RPC_STUB IMsRdpClientAdvancedSettings4_put_AuthenticationLevel_Stub( DWORD *_pdwStubPhase); -/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Proxy( +/* [propget][id] */ HRESULT STDMETHODCALLTYPE IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Proxy( IMsRdpClientAdvancedSettings4 * This, /* [retval][out] */ unsigned int *puiAuthLevel); @@ -8200,74 +8200,74 @@ void __RPC_STUB IMsRdpClientAdvancedSettings4_get_AuthenticationLevel_Stub( #define __IMsTscSecuredSettings_INTERFACE_DEFINED__ /* interface IMsTscSecuredSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsTscSecuredSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("C9D65442-A0F9-45B2-8F73-D61D2DB8CBB6") IMsTscSecuredSettings : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartProgram( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_StartProgram( /* [in] */ BSTR pStartProgram) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartProgram( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_StartProgram( /* [retval][out] */ BSTR *pStartProgram) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WorkDir( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_WorkDir( /* [in] */ BSTR pWorkDir) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WorkDir( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_WorkDir( /* [retval][out] */ BSTR *pWorkDir) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_FullScreen( /* [in] */ long pfFullScreen) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_FullScreen( /* [retval][out] */ long *pfFullScreen) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscSecuredSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscSecuredSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscSecuredSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscSecuredSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscSecuredSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscSecuredSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscSecuredSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscSecuredSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -8277,31 +8277,31 @@ EXTERN_C const IID IID_IMsTscSecuredSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( IMsTscSecuredSettings * This, /* [in] */ BSTR pStartProgram); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( IMsTscSecuredSettings * This, /* [retval][out] */ BSTR *pStartProgram); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( IMsTscSecuredSettings * This, /* [in] */ BSTR pWorkDir); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( IMsTscSecuredSettings * This, /* [retval][out] */ BSTR *pWorkDir); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsTscSecuredSettings * This, /* [in] */ long pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsTscSecuredSettings * This, /* [retval][out] */ long *pfFullScreen); - + END_INTERFACE } IMsTscSecuredSettingsVtbl; @@ -8310,51 +8310,51 @@ EXTERN_C const IID IID_IMsTscSecuredSettings; CONST_VTBL struct IMsTscSecuredSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscSecuredSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscSecuredSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscSecuredSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscSecuredSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscSecuredSettings_put_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) #define IMsTscSecuredSettings_get_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) #define IMsTscSecuredSettings_put_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) #define IMsTscSecuredSettings_get_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) #define IMsTscSecuredSettings_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsTscSecuredSettings_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #endif /* COBJMACROS */ @@ -8371,68 +8371,68 @@ EXTERN_C const IID IID_IMsTscSecuredSettings; #define __IMsRdpClientSecuredSettings_INTERFACE_DEFINED__ /* interface IMsRdpClientSecuredSettings */ -/* [object][oleautomation][dual][uuid] */ +/* [object][oleautomation][dual][uuid] */ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("605BEFCF-39C1-45CC-A811-068FB7BE346D") IMsRdpClientSecuredSettings : public IMsTscSecuredSettings { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardHookMode( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_KeyboardHookMode( /* [in] */ long pkeyboardHookMode) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardHookMode( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_KeyboardHookMode( /* [retval][out] */ long *pkeyboardHookMode) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AudioRedirectionMode( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_AudioRedirectionMode( /* [in] */ long pAudioRedirectionMode) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AudioRedirectionMode( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_AudioRedirectionMode( /* [retval][out] */ long *pAudioRedirectionMode) = 0; - + }; - + #else /* C style interface */ typedef struct IMsRdpClientSecuredSettingsVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsRdpClientSecuredSettings * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsRdpClientSecuredSettings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsRdpClientSecuredSettings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsRdpClientSecuredSettings * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsRdpClientSecuredSettings * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsRdpClientSecuredSettings * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsRdpClientSecuredSettings * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -8442,47 +8442,47 @@ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_StartProgram )( IMsRdpClientSecuredSettings * This, /* [in] */ BSTR pStartProgram); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_StartProgram )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ BSTR *pStartProgram); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_WorkDir )( IMsRdpClientSecuredSettings * This, /* [in] */ BSTR pWorkDir); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_WorkDir )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ BSTR *pWorkDir); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_FullScreen )( IMsRdpClientSecuredSettings * This, /* [in] */ long pfFullScreen); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_FullScreen )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ long *pfFullScreen); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardHookMode )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_KeyboardHookMode )( IMsRdpClientSecuredSettings * This, /* [in] */ long pkeyboardHookMode); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardHookMode )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_KeyboardHookMode )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ long *pkeyboardHookMode); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AudioRedirectionMode )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AudioRedirectionMode )( IMsRdpClientSecuredSettings * This, /* [in] */ long pAudioRedirectionMode); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AudioRedirectionMode )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AudioRedirectionMode )( IMsRdpClientSecuredSettings * This, /* [retval][out] */ long *pAudioRedirectionMode); - + END_INTERFACE } IMsRdpClientSecuredSettingsVtbl; @@ -8491,64 +8491,64 @@ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; CONST_VTBL struct IMsRdpClientSecuredSettingsVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsRdpClientSecuredSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsRdpClientSecuredSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsRdpClientSecuredSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsRdpClientSecuredSettings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsRdpClientSecuredSettings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsRdpClientSecuredSettings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsRdpClientSecuredSettings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsRdpClientSecuredSettings_put_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> put_StartProgram(This,pStartProgram) ) #define IMsRdpClientSecuredSettings_get_StartProgram(This,pStartProgram) \ - ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) + ( (This)->lpVtbl -> get_StartProgram(This,pStartProgram) ) #define IMsRdpClientSecuredSettings_put_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> put_WorkDir(This,pWorkDir) ) #define IMsRdpClientSecuredSettings_get_WorkDir(This,pWorkDir) \ - ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) + ( (This)->lpVtbl -> get_WorkDir(This,pWorkDir) ) #define IMsRdpClientSecuredSettings_put_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> put_FullScreen(This,pfFullScreen) ) #define IMsRdpClientSecuredSettings_get_FullScreen(This,pfFullScreen) \ - ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) + ( (This)->lpVtbl -> get_FullScreen(This,pfFullScreen) ) #define IMsRdpClientSecuredSettings_put_KeyboardHookMode(This,pkeyboardHookMode) \ - ( (This)->lpVtbl -> put_KeyboardHookMode(This,pkeyboardHookMode) ) + ( (This)->lpVtbl -> put_KeyboardHookMode(This,pkeyboardHookMode) ) #define IMsRdpClientSecuredSettings_get_KeyboardHookMode(This,pkeyboardHookMode) \ - ( (This)->lpVtbl -> get_KeyboardHookMode(This,pkeyboardHookMode) ) + ( (This)->lpVtbl -> get_KeyboardHookMode(This,pkeyboardHookMode) ) #define IMsRdpClientSecuredSettings_put_AudioRedirectionMode(This,pAudioRedirectionMode) \ - ( (This)->lpVtbl -> put_AudioRedirectionMode(This,pAudioRedirectionMode) ) + ( (This)->lpVtbl -> put_AudioRedirectionMode(This,pAudioRedirectionMode) ) #define IMsRdpClientSecuredSettings_get_AudioRedirectionMode(This,pAudioRedirectionMode) \ - ( (This)->lpVtbl -> get_AudioRedirectionMode(This,pAudioRedirectionMode) ) + ( (This)->lpVtbl -> get_AudioRedirectionMode(This,pAudioRedirectionMode) ) #endif /* COBJMACROS */ @@ -8565,122 +8565,122 @@ EXTERN_C const IID IID_IMsRdpClientSecuredSettings; #define __IMsTscDebug_INTERFACE_DEFINED__ /* interface IMsTscDebug */ -/* [object][oleautomation][dual][hidden][uuid] */ +/* [object][oleautomation][dual][hidden][uuid] */ EXTERN_C const IID IID_IMsTscDebug; #if defined(__cplusplus) && !defined(CINTERFACE) - + MIDL_INTERFACE("209D0EB9-6254-47B1-9033-A98DAE55BB27") IMsTscDebug : public IDispatch { public: - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchBitmapPDU( + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchBitmapPDU( /* [in] */ long phatchBitmapPDU) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchBitmapPDU( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchBitmapPDU( /* [retval][out] */ long *phatchBitmapPDU) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchSSBOrder( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchSSBOrder( /* [in] */ long phatchSSBOrder) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchSSBOrder( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchSSBOrder( /* [retval][out] */ long *phatchSSBOrder) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchMembltOrder( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchMembltOrder( /* [in] */ long phatchMembltOrder) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchMembltOrder( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchMembltOrder( /* [retval][out] */ long *phatchMembltOrder) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchIndexPDU( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_HatchIndexPDU( /* [in] */ long phatchIndexPDU) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchIndexPDU( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_HatchIndexPDU( /* [retval][out] */ long *phatchIndexPDU) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LabelMemblt( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_LabelMemblt( /* [in] */ long plabelMemblt) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LabelMemblt( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_LabelMemblt( /* [retval][out] */ long *plabelMemblt) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheMonitor( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_BitmapCacheMonitor( /* [in] */ long pbitmapCacheMonitor) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheMonitor( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_BitmapCacheMonitor( /* [retval][out] */ long *pbitmapCacheMonitor) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocFailuresPercent( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocFailuresPercent( /* [in] */ long pmallocFailuresPercent) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocFailuresPercent( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocFailuresPercent( /* [retval][out] */ long *pmallocFailuresPercent) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocHugeFailuresPercent( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_MallocHugeFailuresPercent( /* [in] */ long pmallocHugeFailuresPercent) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocHugeFailuresPercent( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_MallocHugeFailuresPercent( /* [retval][out] */ long *pmallocHugeFailuresPercent) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NetThroughput( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_NetThroughput( /* [in] */ long NetThroughput) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NetThroughput( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_NetThroughput( /* [retval][out] */ long *NetThroughput) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXCmdLine( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXCmdLine( /* [in] */ BSTR pCLXCmdLine) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXCmdLine( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXCmdLine( /* [retval][out] */ BSTR *pCLXCmdLine) = 0; - - virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXDll( + + virtual /* [propput][id] */ HRESULT STDMETHODCALLTYPE put_CLXDll( /* [in] */ BSTR pCLXDll) = 0; - - virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXDll( + + virtual /* [propget][id] */ HRESULT STDMETHODCALLTYPE get_CLXDll( /* [retval][out] */ BSTR *pCLXDll) = 0; - + }; - + #else /* C style interface */ typedef struct IMsTscDebugVtbl { BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMsTscDebug * This, /* [in] */ REFIID riid, - /* [iid_is][out] */ + /* [iid_is][out] */ __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( + + ULONG ( STDMETHODCALLTYPE *AddRef )( IMsTscDebug * This); - - ULONG ( STDMETHODCALLTYPE *Release )( + + ULONG ( STDMETHODCALLTYPE *Release )( IMsTscDebug * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( IMsTscDebug * This, /* [out] */ UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( IMsTscDebug * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( IMsTscDebug * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR *rgszNames, /* [range][in] */ UINT cNames, /* [in] */ LCID lcid, /* [size_is][out] */ DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( IMsTscDebug * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -8690,95 +8690,95 @@ EXTERN_C const IID IID_IMsTscDebug; /* [out] */ VARIANT *pVarResult, /* [out] */ EXCEPINFO *pExcepInfo, /* [out] */ UINT *puArgErr); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchBitmapPDU )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchBitmapPDU )( IMsTscDebug * This, /* [in] */ long phatchBitmapPDU); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchBitmapPDU )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchBitmapPDU )( IMsTscDebug * This, /* [retval][out] */ long *phatchBitmapPDU); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchSSBOrder )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchSSBOrder )( IMsTscDebug * This, /* [in] */ long phatchSSBOrder); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchSSBOrder )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchSSBOrder )( IMsTscDebug * This, /* [retval][out] */ long *phatchSSBOrder); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchMembltOrder )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchMembltOrder )( IMsTscDebug * This, /* [in] */ long phatchMembltOrder); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchMembltOrder )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchMembltOrder )( IMsTscDebug * This, /* [retval][out] */ long *phatchMembltOrder); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchIndexPDU )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_HatchIndexPDU )( IMsTscDebug * This, /* [in] */ long phatchIndexPDU); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchIndexPDU )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_HatchIndexPDU )( IMsTscDebug * This, /* [retval][out] */ long *phatchIndexPDU); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LabelMemblt )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_LabelMemblt )( IMsTscDebug * This, /* [in] */ long plabelMemblt); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LabelMemblt )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_LabelMemblt )( IMsTscDebug * This, /* [retval][out] */ long *plabelMemblt); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheMonitor )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_BitmapCacheMonitor )( IMsTscDebug * This, /* [in] */ long pbitmapCacheMonitor); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheMonitor )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_BitmapCacheMonitor )( IMsTscDebug * This, /* [retval][out] */ long *pbitmapCacheMonitor); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocFailuresPercent )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocFailuresPercent )( IMsTscDebug * This, /* [in] */ long pmallocFailuresPercent); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocFailuresPercent )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocFailuresPercent )( IMsTscDebug * This, /* [retval][out] */ long *pmallocFailuresPercent); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocHugeFailuresPercent )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_MallocHugeFailuresPercent )( IMsTscDebug * This, /* [in] */ long pmallocHugeFailuresPercent); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocHugeFailuresPercent )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_MallocHugeFailuresPercent )( IMsTscDebug * This, /* [retval][out] */ long *pmallocHugeFailuresPercent); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NetThroughput )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_NetThroughput )( IMsTscDebug * This, /* [in] */ long NetThroughput); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NetThroughput )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_NetThroughput )( IMsTscDebug * This, /* [retval][out] */ long *NetThroughput); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXCmdLine )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXCmdLine )( IMsTscDebug * This, /* [in] */ BSTR pCLXCmdLine); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXCmdLine )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXCmdLine )( IMsTscDebug * This, /* [retval][out] */ BSTR *pCLXCmdLine); - - /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXDll )( + + /* [propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_CLXDll )( IMsTscDebug * This, /* [in] */ BSTR pCLXDll); - - /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXDll )( + + /* [propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_CLXDll )( IMsTscDebug * This, /* [retval][out] */ BSTR *pCLXDll); - + END_INTERFACE } IMsTscDebugVtbl; @@ -8787,99 +8787,99 @@ EXTERN_C const IID IID_IMsTscDebug; CONST_VTBL struct IMsTscDebugVtbl *lpVtbl; }; - + #ifdef COBJMACROS #define IMsTscDebug_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IMsTscDebug_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) + ( (This)->lpVtbl -> AddRef(This) ) #define IMsTscDebug_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) + ( (This)->lpVtbl -> Release(This) ) #define IMsTscDebug_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) + ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) #define IMsTscDebug_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) + ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) #define IMsTscDebug_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) + ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) #define IMsTscDebug_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) + ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) #define IMsTscDebug_put_HatchBitmapPDU(This,phatchBitmapPDU) \ - ( (This)->lpVtbl -> put_HatchBitmapPDU(This,phatchBitmapPDU) ) + ( (This)->lpVtbl -> put_HatchBitmapPDU(This,phatchBitmapPDU) ) #define IMsTscDebug_get_HatchBitmapPDU(This,phatchBitmapPDU) \ - ( (This)->lpVtbl -> get_HatchBitmapPDU(This,phatchBitmapPDU) ) + ( (This)->lpVtbl -> get_HatchBitmapPDU(This,phatchBitmapPDU) ) #define IMsTscDebug_put_HatchSSBOrder(This,phatchSSBOrder) \ - ( (This)->lpVtbl -> put_HatchSSBOrder(This,phatchSSBOrder) ) + ( (This)->lpVtbl -> put_HatchSSBOrder(This,phatchSSBOrder) ) #define IMsTscDebug_get_HatchSSBOrder(This,phatchSSBOrder) \ - ( (This)->lpVtbl -> get_HatchSSBOrder(This,phatchSSBOrder) ) + ( (This)->lpVtbl -> get_HatchSSBOrder(This,phatchSSBOrder) ) #define IMsTscDebug_put_HatchMembltOrder(This,phatchMembltOrder) \ - ( (This)->lpVtbl -> put_HatchMembltOrder(This,phatchMembltOrder) ) + ( (This)->lpVtbl -> put_HatchMembltOrder(This,phatchMembltOrder) ) #define IMsTscDebug_get_HatchMembltOrder(This,phatchMembltOrder) \ - ( (This)->lpVtbl -> get_HatchMembltOrder(This,phatchMembltOrder) ) + ( (This)->lpVtbl -> get_HatchMembltOrder(This,phatchMembltOrder) ) #define IMsTscDebug_put_HatchIndexPDU(This,phatchIndexPDU) \ - ( (This)->lpVtbl -> put_HatchIndexPDU(This,phatchIndexPDU) ) + ( (This)->lpVtbl -> put_HatchIndexPDU(This,phatchIndexPDU) ) #define IMsTscDebug_get_HatchIndexPDU(This,phatchIndexPDU) \ - ( (This)->lpVtbl -> get_HatchIndexPDU(This,phatchIndexPDU) ) + ( (This)->lpVtbl -> get_HatchIndexPDU(This,phatchIndexPDU) ) #define IMsTscDebug_put_LabelMemblt(This,plabelMemblt) \ - ( (This)->lpVtbl -> put_LabelMemblt(This,plabelMemblt) ) + ( (This)->lpVtbl -> put_LabelMemblt(This,plabelMemblt) ) #define IMsTscDebug_get_LabelMemblt(This,plabelMemblt) \ - ( (This)->lpVtbl -> get_LabelMemblt(This,plabelMemblt) ) + ( (This)->lpVtbl -> get_LabelMemblt(This,plabelMemblt) ) #define IMsTscDebug_put_BitmapCacheMonitor(This,pbitmapCacheMonitor) \ - ( (This)->lpVtbl -> put_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) + ( (This)->lpVtbl -> put_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) #define IMsTscDebug_get_BitmapCacheMonitor(This,pbitmapCacheMonitor) \ - ( (This)->lpVtbl -> get_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) + ( (This)->lpVtbl -> get_BitmapCacheMonitor(This,pbitmapCacheMonitor) ) #define IMsTscDebug_put_MallocFailuresPercent(This,pmallocFailuresPercent) \ - ( (This)->lpVtbl -> put_MallocFailuresPercent(This,pmallocFailuresPercent) ) + ( (This)->lpVtbl -> put_MallocFailuresPercent(This,pmallocFailuresPercent) ) #define IMsTscDebug_get_MallocFailuresPercent(This,pmallocFailuresPercent) \ - ( (This)->lpVtbl -> get_MallocFailuresPercent(This,pmallocFailuresPercent) ) + ( (This)->lpVtbl -> get_MallocFailuresPercent(This,pmallocFailuresPercent) ) #define IMsTscDebug_put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \ - ( (This)->lpVtbl -> put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) + ( (This)->lpVtbl -> put_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) #define IMsTscDebug_get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) \ - ( (This)->lpVtbl -> get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) + ( (This)->lpVtbl -> get_MallocHugeFailuresPercent(This,pmallocHugeFailuresPercent) ) #define IMsTscDebug_put_NetThroughput(This,NetThroughput) \ - ( (This)->lpVtbl -> put_NetThroughput(This,NetThroughput) ) + ( (This)->lpVtbl -> put_NetThroughput(This,NetThroughput) ) #define IMsTscDebug_get_NetThroughput(This,NetThroughput) \ - ( (This)->lpVtbl -> get_NetThroughput(This,NetThroughput) ) + ( (This)->lpVtbl -> get_NetThroughput(This,NetThroughput) ) #define IMsTscDebug_put_CLXCmdLine(This,pCLXCmdLine) \ - ( (This)->lpVtbl -> put_CLXCmdLine(This,pCLXCmdLine) ) + ( (This)->lpVtbl -> put_CLXCmdLine(This,pCLXCmdLine) ) #define IMsTscDebug_get_CLXCmdLine(This,pCLXCmdLine) \ - ( (This)->lpVtbl -> get_CLXCmdLine(This,pCLXCmdLine) ) + ( (This)->lpVtbl -> get_CLXCmdLine(This,pCLXCmdLine) ) #define IMsTscDebug_put_CLXDll(This,pCLXDll) \ - ( (This)->lpVtbl -> put_CLXDll(This,pCLXDll) ) + ( (This)->lpVtbl -> put_CLXDll(This,pCLXDll) ) #define IMsTscDebug_get_CLXDll(This,pCLXDll) \ - ( (This)->lpVtbl -> get_CLXDll(This,pCLXDll) ) + ( (This)->lpVtbl -> get_CLXDll(This,pCLXDll) ) #endif /* COBJMACROS */ diff --git a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_i.c b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_i.c index 49842cefa2f..eb8092fc8e4 100644 --- a/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_i.c +++ b/reactos/base/applications/tsclient/porting-tools/rdesktop-core-tester/mstsclib_redist_i.c @@ -11,8 +11,8 @@ /* Compiler settings for .\mstsclib_redist.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ @@ -23,7 +23,7 @@ #ifdef __cplusplus extern "C"{ -#endif +#endif #include diff --git a/reactos/base/applications/tsclient/rdesktop/bitmap.c b/reactos/base/applications/tsclient/rdesktop/bitmap.c index a29308448a2..903d253a5e5 100644 --- a/reactos/base/applications/tsclient/rdesktop/bitmap.c +++ b/reactos/base/applications/tsclient/rdesktop/bitmap.c @@ -740,7 +740,7 @@ bitmap_decompress3(uint8 * output, int width, int height, uint8 * input, int siz MASK_UPDATE(); if (mask & mixmask) { - line[x * 3] = + line[x * 3] = prevline[x * 3] ^ mix [0]; line[x * 3 + 1] = prevline[x * 3 + 1] ^ mix [1]; diff --git a/reactos/base/applications/tsclient/rdesktop/disk.h b/reactos/base/applications/tsclient/rdesktop/disk.h index e3a40675858..ce63532aaa5 100644 --- a/reactos/base/applications/tsclient/rdesktop/disk.h +++ b/reactos/base/applications/tsclient/rdesktop/disk.h @@ -3,17 +3,17 @@ Disk Redirection definitions Copyright (C) Jeroen Meijer 2003 Copyright (C) Peter Astrand 2004 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/reactos/base/applications/tsclient/rdesktop/ewmhints.c b/reactos/base/applications/tsclient/rdesktop/ewmhints.c index c249f6cbbe9..3f9d73050f6 100644 --- a/reactos/base/applications/tsclient/rdesktop/ewmhints.c +++ b/reactos/base/applications/tsclient/rdesktop/ewmhints.c @@ -5,17 +5,17 @@ http://www.freedesktop.org/wiki/Standards_2fwm_2dspec Copyright (C) Peter Astrand 2005 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -30,8 +30,8 @@ #define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ -/* - Get window property value (32 bit format) +/* + Get window property value (32 bit format) Returns zero on success, -1 on error */ static int @@ -87,7 +87,7 @@ get_property_value(RDPCLIENT * This, Window wnd, char *propname, long max_length return (0); } -/* +/* Get current desktop number Returns -1 on error */ @@ -183,8 +183,8 @@ ewmh_init(RDPCLIENT * This) } -/* - Get the window state: normal/minimized/maximized. +/* + Get the window state: normal/minimized/maximized. */ #ifndef MAKE_PROTO int @@ -313,9 +313,9 @@ ewmh_modify_state(RDPCLIENT * This, Window wnd, int add, Atom atom1, Atom atom2) return 0; } -/* - Set the window state: normal/minimized/maximized. - Returns -1 on failure. +/* + Set the window state: normal/minimized/maximized. + Returns -1 on failure. */ int ewmh_change_state(RDPCLIENT * This, Window wnd, int state) diff --git a/reactos/base/applications/tsclient/rdesktop/iso.c b/reactos/base/applications/tsclient/rdesktop/iso.c index 0ba89ffafaa..e09c610e59d 100644 --- a/reactos/base/applications/tsclient/rdesktop/iso.c +++ b/reactos/base/applications/tsclient/rdesktop/iso.c @@ -2,17 +2,17 @@ rdesktop: A Remote Desktop Protocol client. Protocol services - ISO layer Copyright (C) Matthew Chapman 1999-2005 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/reactos/base/applications/tsclient/rdesktop/lspci.c b/reactos/base/applications/tsclient/rdesktop/lspci.c index d1e837aa7aa..dbca92686e2 100644 --- a/reactos/base/applications/tsclient/rdesktop/lspci.c +++ b/reactos/base/applications/tsclient/rdesktop/lspci.c @@ -1,7 +1,7 @@ /* -*- c-basic-offset: 8 -*- rdesktop: A Remote Desktop Protocol client. Support for the Matrox "lspci" channel - Copyright (C) 2005 Matrox Graphics Inc. + Copyright (C) 2005 Matrox Graphics Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/reactos/base/applications/tsclient/rdesktop/orders.h b/reactos/base/applications/tsclient/rdesktop/orders.h index a8342b63fd3..f6e62df0fc3 100644 --- a/reactos/base/applications/tsclient/rdesktop/orders.h +++ b/reactos/base/applications/tsclient/rdesktop/orders.h @@ -2,17 +2,17 @@ rdesktop: A Remote Desktop Protocol client. RDP order processing Copyright (C) Matthew Chapman 1999-2005 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/reactos/base/applications/tsclient/rdesktop/parse.h b/reactos/base/applications/tsclient/rdesktop/parse.h index d9c83092f24..7f8b3094c71 100644 --- a/reactos/base/applications/tsclient/rdesktop/parse.h +++ b/reactos/base/applications/tsclient/rdesktop/parse.h @@ -2,17 +2,17 @@ rdesktop: A Remote Desktop Protocol client. Parsing primitives Copyright (C) Matthew Chapman 1999-2005 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/reactos/base/applications/tsclient/rdesktop/rdpsnd_oss.c b/reactos/base/applications/tsclient/rdesktop/rdpsnd_oss.c index 21487eaa8bc..4f76ad6babc 100644 --- a/reactos/base/applications/tsclient/rdesktop/rdpsnd_oss.c +++ b/reactos/base/applications/tsclient/rdesktop/rdpsnd_oss.c @@ -19,9 +19,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* - This is a workaround for Esound bug 312665. - FIXME: Remove this when Esound is fixed. +/* + This is a workaround for Esound bug 312665. + FIXME: Remove this when Esound is fixed. */ #ifdef _FILE_OFFSET_BITS #undef _FILE_OFFSET_BITS diff --git a/reactos/base/applications/tsclient/rdesktop/scancodes.h b/reactos/base/applications/tsclient/rdesktop/scancodes.h index 34d60219175..10c01d90345 100644 --- a/reactos/base/applications/tsclient/rdesktop/scancodes.h +++ b/reactos/base/applications/tsclient/rdesktop/scancodes.h @@ -1,13 +1,13 @@ /* Two defines for every scancode: - One called SCANCODE_KEY_, where is the key location number. - One called SCANCODE_CHAR_, where is the - unshifted character on a US 101/102 keyboard. See the Microsoft - document "Keyboard Scan Code Specification" for more information. + One called SCANCODE_KEY_, where is the key location number. + One called SCANCODE_CHAR_, where is the + unshifted character on a US 101/102 keyboard. See the Microsoft + document "Keyboard Scan Code Specification" for more information. - Up keys normally have scancode values +0x80. + Up keys normally have scancode values +0x80. - 0x0: Avoid + 0x0: Avoid 0x1- 0x59: Normal 0x60, 0x61: Avoid, since the up key would be 0xe1, 0xe1 0x61 - 0x79: Normal @@ -17,8 +17,8 @@ 0xe 0x38 is defined as (0x80 | 0x38) */ -/* FIXME: - Special keys like Numeric / are very complicated and emits many scancodes. +/* FIXME: + Special keys like Numeric / are very complicated and emits many scancodes. */ #define SCANCODE_EXTENDED 0x80 @@ -359,7 +359,7 @@ /* Key 126: The Pause and Break sequences is complicated, and hardcoded in xkeymap.c */ -/* +/* The keys below does not have any key location number */ diff --git a/reactos/base/applications/tsclient/rdesktop/seamless.c b/reactos/base/applications/tsclient/rdesktop/seamless.c index 9520a951caf..d90a4b55c0f 100644 --- a/reactos/base/applications/tsclient/rdesktop/seamless.c +++ b/reactos/base/applications/tsclient/rdesktop/seamless.c @@ -2,17 +2,17 @@ rdesktop: A Remote Desktop Protocol client. Seamless Windows support Copyright (C) Peter Astrand 2005-2006 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/reactos/base/applications/tsclient/rdesktop/seamless.h b/reactos/base/applications/tsclient/rdesktop/seamless.h index 9660c263ef2..83b9ed4e354 100644 --- a/reactos/base/applications/tsclient/rdesktop/seamless.h +++ b/reactos/base/applications/tsclient/rdesktop/seamless.h @@ -2,17 +2,17 @@ rdesktop: A Remote Desktop Protocol client. Seamless Windows support Copyright (C) Peter Astrand 2005-2006 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/reactos/base/applications/tsclient/rdesktop/types.h b/reactos/base/applications/tsclient/rdesktop/types.h index 91ee1620a83..ac787c4ab5a 100644 --- a/reactos/base/applications/tsclient/rdesktop/types.h +++ b/reactos/base/applications/tsclient/rdesktop/types.h @@ -83,7 +83,7 @@ typedef struct _BOUNDS BOUNDS; // TODO: nuke, use LOGPEN -typedef struct _PEN +typedef struct _PEN { uint8 style; uint8 width; diff --git a/reactos/base/applications/tsclient/rdesktop/uiports/svgawin.c b/reactos/base/applications/tsclient/rdesktop/uiports/svgawin.c index bda3b75b5d7..fc63eaabc99 100644 --- a/reactos/base/applications/tsclient/rdesktop/uiports/svgawin.c +++ b/reactos/base/applications/tsclient/rdesktop/uiports/svgawin.c @@ -779,7 +779,7 @@ void key_event(int scancode, int pressed) return; rdpkey = scancode; ext = 0; - + // Keyboard LEDS if ((scancode == SCANCODE_CAPSLOCK) && pressed) { @@ -797,7 +797,7 @@ void key_event(int scancode, int pressed) numlock = !numlock; setled(LED_NUM, numlock); } - + switch (scancode) { case SCANCODE_CURSORBLOCKUP: rdpkey = 0xc8; ext = KBD_FLAG_EXT; break; // up arrow @@ -825,7 +825,7 @@ void key_event(int scancode, int pressed) ext = KBD_FLAG_EXT; rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS | ext, 0x46, 0); rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS | ext, 0xc6, 0); - } + } rdpkey = 0; } case SCANCODE_SCROLLLOCK: rdpkey = 0x46; break; // scroll lock @@ -847,7 +847,7 @@ void key_event(int scancode, int pressed) rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYPRESS | ext, rdpkey, 0); else rdp_send_input(0, RDP_INPUT_SCANCODE, RDP_KEYRELEASE | ext, rdpkey, 0); - + } diff --git a/reactos/base/applications/tsclient/rdesktop/vnc/vnc.c b/reactos/base/applications/tsclient/rdesktop/vnc/vnc.c index acc2e966fbd..3b20dbf485f 100644 --- a/reactos/base/applications/tsclient/rdesktop/vnc/vnc.c +++ b/reactos/base/applications/tsclient/rdesktop/vnc/vnc.c @@ -5,17 +5,17 @@ Copyright (C) 2000 Tim Edmonds Copyright (C) 2001 James "Wez" Weatherall Copyright (C) 2001 Johannes E. Schindelin - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -503,7 +503,7 @@ ui_create_glyph(int width, int height, uint8 * data) buf = vncNewBuffer(width, height, 8); - //data is padded to multiple of 16bit line lengths + //data is padded to multiple of 16bit line lengths for (y = 0; y < height; y++) { for (x = 0; x < width; x++) diff --git a/reactos/base/applications/tsclient/rdesktop/xkeymap.c b/reactos/base/applications/tsclient/rdesktop/xkeymap.c index 771c3583772..b4f5d6f3de3 100644 --- a/reactos/base/applications/tsclient/rdesktop/xkeymap.c +++ b/reactos/base/applications/tsclient/rdesktop/xkeymap.c @@ -4,12 +4,12 @@ Copyright (C) Matthew Chapman 1999-2005 Copyright (C) Peter Astrand 2003 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -374,7 +374,7 @@ xkeymap_read(RDPCLIENT * This, char *mapname) scancode = strtol(p, &line_rest, 16); /* flags */ - /* FIXME: Should allow case-insensitive flag names. + /* FIXME: Should allow case-insensitive flag names. Fix by using lex+yacc... */ modifiers = 0; if (strstr(line_rest, "altgr")) @@ -406,7 +406,7 @@ xkeymap_read(RDPCLIENT * This, char *mapname) if (strstr(line_rest, "addupper")) { - /* Automatically add uppercase key, with same modifiers + /* Automatically add uppercase key, with same modifiers plus shift */ for (p = keyname; *p; p++) *p = toupper((int) *p); diff --git a/reactos/base/applications/winhelp/callback.c b/reactos/base/applications/winhelp/callback.c index b966039f3d6..ade0db729d6 100644 --- a/reactos/base/applications/winhelp/callback.c +++ b/reactos/base/applications/winhelp/callback.c @@ -1,180 +1,180 @@ -/* - * Help Viewer - DLL callback into WineHelp - * - * Copyright 2004 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#define WIN32_LEAN_AND_MEAN - -#include - -#include "windows.h" -#include "winhelp.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(winhelp); - -static WORD CALLBACK WHD_GetFSError(void) -{ - WINE_FIXME("()\n"); - return 0; -} - -static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags) -{ - unsigned mode = 0; - - //WINE_FIXME("(%s %x)\n", wine_dbgstr_a(name), flags); - switch (flags) - { - case 0: mode = GENERIC_READ | GENERIC_WRITE; break; - case 2: mode = GENERIC_READ; break; - default: WINE_FIXME("Undocumented flags %x\n", flags); - } - return CreateFile(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); -} - -static WORD CALLBACK WHD_Close(HANDLE fs) -{ - WINE_FIXME("(%p)\n", fs); - CloseHandle(fs); - return 0; -} - -static HANDLE CALLBACK WHD_OpenBag(HANDLE fs, LPSTR name, BYTE flags) -{ - WINE_FIXME("(%p %s %x)\n", fs, name, flags); - return NULL; -} - -static HANDLE CALLBACK WHD_CloseBag(HANDLE bag) -{ - WINE_FIXME("()\n"); - return NULL; -} - -static LONG CALLBACK WHD_ReadBag(HANDLE bag, BYTE* ptr, LONG len) -{ - WINE_FIXME("()\n"); - return 0; -} - -static LONG CALLBACK WHD_TellBag(HANDLE bag) -{ - WINE_FIXME("()\n"); - return 0; -} - -static LONG CALLBACK WHD_SeekBag(HANDLE bag, LONG offset, WORD whence) -{ - WINE_FIXME("()\n"); - return 0; -} - -static BOOL CALLBACK WHD_IsEofBag(HANDLE bag) -{ - WINE_FIXME("()\n"); - return FALSE; -} - -static LONG CALLBACK WHD_SizeBag(HANDLE bag) -{ - WINE_FIXME("()\n"); - return 0; -} - -static BOOL CALLBACK WHD_Access(HANDLE fs, LPSTR name, BYTE flags) -{ - WINE_FIXME("()\n"); - return FALSE; -} - -static WORD CALLBACK WHD_LLInfoFromBag(HANDLE bag, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3) -{ - WINE_FIXME("()\n"); - return 0; -} - -static WORD CALLBACK WHD_LLInfoFromFile(HANDLE fs, LPSTR name, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3) -{ - WINE_FIXME("()\n"); - return 0; -} - -static void CALLBACK WHD_Error(int err) -{ - WINE_FIXME("()\n"); -} - -static void CALLBACK WHD_ErrorString(LPSTR err) -{ - WINE_FIXME("()\n"); -} - -static LONG CALLBACK WHD_GetInfo(WORD what, HWND hnd) -{ - LONG ret = 0; - - WINE_TRACE("(%x %p)\n", what, hnd); - switch (what) - { - case 0: break; - case 1: /* instance */ ret = (LONG)Globals.hInstance; break; - case 3: /* current window */ ret = (LONG)Globals.active_win->hMainWnd; break; - case 2: /* main window */ - case 4: /* handle to opened file */ - case 5: /* foreground color */ - case 6: /* background color */ - case 7: /* topic number */ - case 8: /* current opened file name */ - WINE_FIXME("NIY %u\n", what); - break; - default: - WINE_FIXME("Undocumented %u\n", what); - break; - } - return ret; -} - -static LONG CALLBACK WHD_API(LPSTR x, WORD xx, DWORD xxx) -{ - WINE_FIXME("()\n"); - return 0; -} - -FARPROC Callbacks[] = -{ - (FARPROC)WHD_GetFSError, - (FARPROC)WHD_Open, - (FARPROC)WHD_Close, - (FARPROC)WHD_OpenBag, - (FARPROC)WHD_CloseBag, - (FARPROC)WHD_ReadBag, - (FARPROC)WHD_TellBag, - (FARPROC)WHD_SeekBag, - (FARPROC)WHD_IsEofBag, - (FARPROC)WHD_SizeBag, - (FARPROC)WHD_Access, - (FARPROC)WHD_LLInfoFromBag, - (FARPROC)WHD_LLInfoFromFile, - (FARPROC)WHD_Error, - (FARPROC)WHD_ErrorString, - (FARPROC)WHD_GetInfo, - (FARPROC)WHD_API -}; +/* + * Help Viewer - DLL callback into WineHelp + * + * Copyright 2004 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_LEAN_AND_MEAN + +#include + +#include "windows.h" +#include "winhelp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winhelp); + +static WORD CALLBACK WHD_GetFSError(void) +{ + WINE_FIXME("()\n"); + return 0; +} + +static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags) +{ + unsigned mode = 0; + + //WINE_FIXME("(%s %x)\n", wine_dbgstr_a(name), flags); + switch (flags) + { + case 0: mode = GENERIC_READ | GENERIC_WRITE; break; + case 2: mode = GENERIC_READ; break; + default: WINE_FIXME("Undocumented flags %x\n", flags); + } + return CreateFile(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); +} + +static WORD CALLBACK WHD_Close(HANDLE fs) +{ + WINE_FIXME("(%p)\n", fs); + CloseHandle(fs); + return 0; +} + +static HANDLE CALLBACK WHD_OpenBag(HANDLE fs, LPSTR name, BYTE flags) +{ + WINE_FIXME("(%p %s %x)\n", fs, name, flags); + return NULL; +} + +static HANDLE CALLBACK WHD_CloseBag(HANDLE bag) +{ + WINE_FIXME("()\n"); + return NULL; +} + +static LONG CALLBACK WHD_ReadBag(HANDLE bag, BYTE* ptr, LONG len) +{ + WINE_FIXME("()\n"); + return 0; +} + +static LONG CALLBACK WHD_TellBag(HANDLE bag) +{ + WINE_FIXME("()\n"); + return 0; +} + +static LONG CALLBACK WHD_SeekBag(HANDLE bag, LONG offset, WORD whence) +{ + WINE_FIXME("()\n"); + return 0; +} + +static BOOL CALLBACK WHD_IsEofBag(HANDLE bag) +{ + WINE_FIXME("()\n"); + return FALSE; +} + +static LONG CALLBACK WHD_SizeBag(HANDLE bag) +{ + WINE_FIXME("()\n"); + return 0; +} + +static BOOL CALLBACK WHD_Access(HANDLE fs, LPSTR name, BYTE flags) +{ + WINE_FIXME("()\n"); + return FALSE; +} + +static WORD CALLBACK WHD_LLInfoFromBag(HANDLE bag, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3) +{ + WINE_FIXME("()\n"); + return 0; +} + +static WORD CALLBACK WHD_LLInfoFromFile(HANDLE fs, LPSTR name, WORD opt, LPWORD p1, LPLONG p2, LPLONG p3) +{ + WINE_FIXME("()\n"); + return 0; +} + +static void CALLBACK WHD_Error(int err) +{ + WINE_FIXME("()\n"); +} + +static void CALLBACK WHD_ErrorString(LPSTR err) +{ + WINE_FIXME("()\n"); +} + +static LONG CALLBACK WHD_GetInfo(WORD what, HWND hnd) +{ + LONG ret = 0; + + WINE_TRACE("(%x %p)\n", what, hnd); + switch (what) + { + case 0: break; + case 1: /* instance */ ret = (LONG)Globals.hInstance; break; + case 3: /* current window */ ret = (LONG)Globals.active_win->hMainWnd; break; + case 2: /* main window */ + case 4: /* handle to opened file */ + case 5: /* foreground color */ + case 6: /* background color */ + case 7: /* topic number */ + case 8: /* current opened file name */ + WINE_FIXME("NIY %u\n", what); + break; + default: + WINE_FIXME("Undocumented %u\n", what); + break; + } + return ret; +} + +static LONG CALLBACK WHD_API(LPSTR x, WORD xx, DWORD xxx) +{ + WINE_FIXME("()\n"); + return 0; +} + +FARPROC Callbacks[] = +{ + (FARPROC)WHD_GetFSError, + (FARPROC)WHD_Open, + (FARPROC)WHD_Close, + (FARPROC)WHD_OpenBag, + (FARPROC)WHD_CloseBag, + (FARPROC)WHD_ReadBag, + (FARPROC)WHD_TellBag, + (FARPROC)WHD_SeekBag, + (FARPROC)WHD_IsEofBag, + (FARPROC)WHD_SizeBag, + (FARPROC)WHD_Access, + (FARPROC)WHD_LLInfoFromBag, + (FARPROC)WHD_LLInfoFromFile, + (FARPROC)WHD_Error, + (FARPROC)WHD_ErrorString, + (FARPROC)WHD_GetInfo, + (FARPROC)WHD_API +}; diff --git a/reactos/base/applications/winhelp/hlpfile.c b/reactos/base/applications/winhelp/hlpfile.c index c6ff1b50161..7b0da832e5e 100644 --- a/reactos/base/applications/winhelp/hlpfile.c +++ b/reactos/base/applications/winhelp/hlpfile.c @@ -1,2065 +1,2065 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * 2002 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "winhelp.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(winhelp); - -static inline unsigned short GET_USHORT(const BYTE* buffer, unsigned i) -{ - return (BYTE)buffer[i] + 0x100 * (BYTE)buffer[i + 1]; -} - -static inline short GET_SHORT(const BYTE* buffer, unsigned i) -{ - return (BYTE)buffer[i] + 0x100 * (signed char)buffer[i+1]; -} - -static inline unsigned GET_UINT(const BYTE* buffer, unsigned i) -{ - return GET_USHORT(buffer, i) + 0x10000 * GET_USHORT(buffer, i + 2); -} - -static HLPFILE *first_hlpfile = 0; -static BYTE *file_buffer; - -static struct -{ - UINT num; - unsigned* offsets; - char* buffer; -} phrases; - -static struct -{ - BYTE** map; - BYTE* end; - UINT wMapLen; -} topic; - -static struct -{ - UINT wFont; - UINT wIndent; - UINT wHSpace; - UINT wVSpace; - HLPFILE_LINK* link; -} attributes; - -static BOOL HLPFILE_DoReadHlpFile(HLPFILE*, LPCSTR); -static BOOL HLPFILE_ReadFileToBuffer(HFILE); -static BOOL HLPFILE_FindSubFile(LPCSTR name, BYTE**, BYTE**); -static BOOL HLPFILE_SystemCommands(HLPFILE*); -static INT HLPFILE_UncompressedLZ77_Size(BYTE *ptr, BYTE *end); -static BYTE* HLPFILE_UncompressLZ77(BYTE *ptr, BYTE *end, BYTE *newptr); -static BOOL HLPFILE_UncompressLZ77_Phrases(HLPFILE*); -static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE*); -static BOOL HLPFILE_Uncompress_Topic(HLPFILE*); -static BOOL HLPFILE_GetContext(HLPFILE*); -static BOOL HLPFILE_GetMap(HLPFILE*); -static BOOL HLPFILE_AddPage(HLPFILE*, BYTE*, BYTE*, unsigned); -static BOOL HLPFILE_AddParagraph(HLPFILE*, BYTE *, BYTE*, unsigned*); -static void HLPFILE_Uncompress2(const BYTE*, const BYTE*, BYTE*, const BYTE*); -static BOOL HLPFILE_Uncompress3(char*, const char*, const BYTE*, const BYTE*); -static void HLPFILE_UncompressRLE(const BYTE* src, const BYTE* end, BYTE** dst, unsigned dstsz); -static BOOL HLPFILE_ReadFont(HLPFILE* hlpfile); - -#if 0 -/*********************************************************************** - * - * HLPFILE_PageByNumber - */ -static HLPFILE_PAGE *HLPFILE_PageByNumber(LPCSTR lpszPath, UINT wNum) -{ - HLPFILE_PAGE *page; - HLPFILE *hlpfile = HLPFILE_ReadHlpFile(lpszPath); - - if (!hlpfile) return 0; - - WINE_TRACE("[%s/%u]\n", lpszPath, wNum); - - for (page = hlpfile->first_page; page && wNum; page = page->next) wNum--; - - /* HLPFILE_FreeHlpFile(lpszPath); */ - - return page; -} -#endif - -/* FIXME: - * this finds the page containing the offset. The offset can either - * refer to the top of the page (offset == page->offset), or - * to some paragraph inside the page... - * As of today, we only return the page... we should also return - * a paragraph, and then, while opening a new page, compute the - * y-offset of the paragraph to be shown and scroll the window - * accordinly - */ -/****************************************************************** - * HLPFILE_PageByOffset - * - * - */ -HLPFILE_PAGE *HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset) -{ - HLPFILE_PAGE* page; - HLPFILE_PAGE* found; - - if (!hlpfile) return 0; - - WINE_TRACE("<%s>[%x]\n", hlpfile->lpszPath, offset); - - if (offset == 0xFFFFFFFF) return NULL; - page = NULL; - - for (found = NULL, page = hlpfile->first_page; page; page = page->next) - { - if (page->offset <= offset && (!found || found->offset < page->offset)) - found = page; - } - if (!found) - WINE_ERR("Page of offset %u not found in file %s\n", - offset, hlpfile->lpszPath); - return found; -} - -/*********************************************************************** - * - * HLPFILE_HlpFilePageByHash - */ -HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash) -{ - int i; - - if (!hlpfile) return 0; - - WINE_TRACE("<%s>[%x]\n", hlpfile->lpszPath, lHash); - - for (i = 0; i < hlpfile->wContextLen; i++) - { - if (hlpfile->Context[i].lHash == lHash) - return HLPFILE_PageByOffset(hlpfile, hlpfile->Context[i].offset); - } - - WINE_ERR("Page of hash %x not found in file %s\n", lHash, hlpfile->lpszPath); - return NULL; -} - -/*********************************************************************** - * - * HLPFILE_PageByMap - */ -HLPFILE_PAGE *HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap) -{ - int i; - - if (!hlpfile) return 0; - - WINE_TRACE("<%s>[%x]\n", hlpfile->lpszPath, lMap); - - for (i = 0; i < hlpfile->wMapLen; i++) - { - if (hlpfile->Map[i].lMap == lMap) - return HLPFILE_PageByOffset(hlpfile, hlpfile->Map[i].offset); - } - - WINE_ERR("Page of Map %x not found in file %s\n", lMap, hlpfile->lpszPath); - return NULL; -} - -/*********************************************************************** - * - * HLPFILE_Contents - */ -HLPFILE_PAGE* HLPFILE_Contents(HLPFILE *hlpfile) -{ - HLPFILE_PAGE* page = NULL; - - if (!hlpfile) return NULL; - - page = HLPFILE_PageByOffset(hlpfile, hlpfile->contents_start); - if (!page) page = hlpfile->first_page; - return page; -} - -/*********************************************************************** - * - * HLPFILE_Hash - */ -LONG HLPFILE_Hash(LPCSTR lpszContext) -{ - LONG lHash = 0; - CHAR c; - - while ((c = *lpszContext++)) - { - CHAR x = 0; - if (c >= 'A' && c <= 'Z') x = c - 'A' + 17; - if (c >= 'a' && c <= 'z') x = c - 'a' + 17; - if (c >= '1' && c <= '9') x = c - '0'; - if (c == '0') x = 10; - if (c == '.') x = 12; - if (c == '_') x = 13; - if (x) lHash = lHash * 43 + x; - } - return lHash; -} - -/*********************************************************************** - * - * HLPFILE_ReadHlpFile - */ -HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath) -{ - HLPFILE* hlpfile; - - for (hlpfile = first_hlpfile; hlpfile; hlpfile = hlpfile->next) - { - if (!strcmp(lpszPath, hlpfile->lpszPath)) - { - hlpfile->wRefCount++; - return hlpfile; - } - } - - hlpfile = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE) + lstrlen(lpszPath) + 1); - if (!hlpfile) return 0; - - hlpfile->lpszPath = (char*)hlpfile + sizeof(HLPFILE); - hlpfile->lpszTitle = NULL; - hlpfile->lpszCopyright = NULL; - hlpfile->first_page = NULL; - hlpfile->first_macro = NULL; - hlpfile->wContextLen = 0; - hlpfile->Context = NULL; - hlpfile->wMapLen = 0; - hlpfile->Map = NULL; - hlpfile->contents_start = 0xFFFFFFFF; - hlpfile->prev = NULL; - hlpfile->next = first_hlpfile; - hlpfile->wRefCount = 1; - - hlpfile->numBmps = 0; - hlpfile->bmps = NULL; - - hlpfile->numFonts = 0; - hlpfile->fonts = NULL; - - hlpfile->numWindows = 0; - hlpfile->windows = NULL; - - strcpy(hlpfile->lpszPath, lpszPath); - - first_hlpfile = hlpfile; - if (hlpfile->next) hlpfile->next->prev = hlpfile; - - phrases.offsets = NULL; - phrases.buffer = NULL; - topic.map = NULL; - topic.end = NULL; - file_buffer = NULL; - - if (!HLPFILE_DoReadHlpFile(hlpfile, lpszPath)) - { - HLPFILE_FreeHlpFile(hlpfile); - hlpfile = 0; - } - - HeapFree(GetProcessHeap(), 0, phrases.offsets); - HeapFree(GetProcessHeap(), 0, phrases.buffer); - HeapFree(GetProcessHeap(), 0, topic.map); - HeapFree(GetProcessHeap(), 0, file_buffer); - - return hlpfile; -} - -/*********************************************************************** - * - * HLPFILE_DoReadHlpFile - */ -static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath) -{ - BOOL ret; - HFILE hFile; - OFSTRUCT ofs; - BYTE* buf; - DWORD ref = 0x0C; - unsigned index, old_index, offset, len, offs; - - hFile = OpenFile(lpszPath, &ofs, OF_READ); - if (hFile == HFILE_ERROR) return FALSE; - - ret = HLPFILE_ReadFileToBuffer(hFile); - _lclose(hFile); - if (!ret) return FALSE; - - if (!HLPFILE_SystemCommands(hlpfile)) return FALSE; - - /* load phrases support */ - if (!HLPFILE_UncompressLZ77_Phrases(hlpfile)) - HLPFILE_Uncompress_Phrases40(hlpfile); - - if (!HLPFILE_Uncompress_Topic(hlpfile)) return FALSE; - if (!HLPFILE_ReadFont(hlpfile)) return FALSE; - - buf = topic.map[0]; - old_index = -1; - offs = 0; - do - { - BYTE* end; - - /* FIXME this depends on the blocksize, can be 2k in some cases */ - index = (ref - 0x0C) >> 14; - offset = (ref - 0x0C) & 0x3fff; - - WINE_TRACE("ref=%08x => [%u/%u]\n", ref, index, offset); - - if (index >= topic.wMapLen) {WINE_WARN("maplen\n"); break;} - buf = topic.map[index] + offset; - if (buf + 0x15 >= topic.end) {WINE_WARN("extra\n"); break;} - end = min(buf + GET_UINT(buf, 0), topic.end); - if (index != old_index) {offs = 0; old_index = index;} - - switch (buf[0x14]) - { - case 0x02: - if (!HLPFILE_AddPage(hlpfile, buf, end, index * 0x8000L + offs)) return FALSE; - break; - - case 0x20: - if (!HLPFILE_AddParagraph(hlpfile, buf, end, &len)) return FALSE; - offs += len; - break; - - case 0x23: - if (!HLPFILE_AddParagraph(hlpfile, buf, end, &len)) return FALSE; - offs += len; - break; - - default: - WINE_ERR("buf[0x14] = %x\n", buf[0x14]); - } - - ref = GET_UINT(buf, 0xc); - } while (ref != 0xffffffff); - - HLPFILE_GetMap(hlpfile); - return HLPFILE_GetContext(hlpfile); -} - -/*********************************************************************** - * - * HLPFILE_AddPage - */ -static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned offset) -{ - HLPFILE_PAGE* page; - BYTE* title; - UINT titlesize; - char* ptr; - HLPFILE_MACRO*macro; - - if (buf + 0x31 > end) {WINE_WARN("page1\n"); return FALSE;}; - title = buf + GET_UINT(buf, 0x10); - if (title > end) {WINE_WARN("page2\n"); return FALSE;}; - - titlesize = GET_UINT(buf, 4); - page = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_PAGE) + titlesize + 1); - if (!page) return FALSE; - page->lpszTitle = (char*)page + sizeof(HLPFILE_PAGE); - - if (hlpfile->hasPhrases) - { - HLPFILE_Uncompress2(title, end, (BYTE*)page->lpszTitle, (BYTE*)page->lpszTitle + titlesize); - } - else - { - if (GET_UINT(buf, 0x4) > GET_UINT(buf, 0) - GET_UINT(buf, 0x10)) - { - /* need to decompress */ - HLPFILE_Uncompress3(page->lpszTitle, page->lpszTitle + titlesize, - title, end); - } - else - { - memcpy(page->lpszTitle, title, titlesize); - } - } - - page->lpszTitle[titlesize] = '\0'; - - if (hlpfile->first_page) - { - HLPFILE_PAGE *p; - - for (p = hlpfile->first_page; p->next; p = p->next); - page->prev = p; - p->next = page; - } - else - { - hlpfile->first_page = page; - page->prev = NULL; - } - - page->file = hlpfile; - page->next = NULL; - page->first_paragraph = NULL; - page->first_macro = NULL; - page->wNumber = GET_UINT(buf, 0x21); - page->offset = offset; - - page->browse_bwd = GET_UINT(buf, 0x19); - page->browse_fwd = GET_UINT(buf, 0x1D); - - WINE_TRACE("Added page[%d]: title='%s' %08x << %08x >> %08x\n", - page->wNumber, page->lpszTitle, - page->browse_bwd, page->offset, page->browse_fwd); - - memset(&attributes, 0, sizeof(attributes)); - - /* now load macros */ - ptr = page->lpszTitle + strlen(page->lpszTitle) + 1; - while (ptr < page->lpszTitle + titlesize) - { - unsigned len = strlen(ptr); - char* macro_str; - - WINE_TRACE("macro: %s\n", ptr); - macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + len + 1); - macro->lpszMacro = macro_str = (char*)(macro + 1); - memcpy(macro_str, ptr, len + 1); - /* FIXME: shall we really link macro in reverse order ?? - * may produce strange results when played at page opening - */ - macro->next = page->first_macro; - page->first_macro = macro; - ptr += len + 1; - } - - return TRUE; -} - -static long fetch_long(BYTE** ptr) -{ - long ret; - - if (*(*ptr) & 1) - { - ret = (*(unsigned long*)(*ptr) - 0x80000000L) / 2; - (*ptr) += 4; - } - else - { - ret = (*(unsigned short*)(*ptr) - 0x8000) / 2; - (*ptr) += 2; - } - - return ret; -} - -static unsigned long fetch_ulong(BYTE** ptr) -{ - unsigned long ret; - - if (*(*ptr) & 1) - { - ret = *(unsigned long*)(*ptr) / 2; - (*ptr) += 4; - } - else - { - ret = *(unsigned short*)(*ptr) / 2; - (*ptr) += 2; - } - return ret; -} - -static short fetch_short(BYTE** ptr) -{ - short ret; - - if (*(*ptr) & 1) - { - ret = (*(unsigned short*)(*ptr) - 0x8000) / 2; - (*ptr) += 2; - } - else - { - ret = (*(unsigned char*)(*ptr) - 0x80) / 2; - (*ptr)++; - } - return ret; -} - -static unsigned short fetch_ushort(BYTE** ptr) -{ - unsigned short ret; - - if (*(*ptr) & 1) - { - ret = *(unsigned short*)(*ptr) / 2; - (*ptr) += 2; - } - else - { - ret = *(unsigned char*)(*ptr) / 2; - (*ptr)++; - } - return ret; -} - -/****************************************************************** - * HLPFILE_DecompressGfx - * - * Decompress the data part of a bitmap or a metafile - */ -static BYTE* HLPFILE_DecompressGfx(BYTE* src, unsigned csz, unsigned sz, BYTE packing) -{ - BYTE* dst; - BYTE* tmp; - BYTE* tmp2; - unsigned sz77; - - WINE_TRACE("Unpacking (%d) from %u bytes to %u bytes\n", packing, csz, sz); - - switch (packing) - { - case 0: /* uncompressed */ - if (sz != csz) - WINE_WARN("Bogus gfx sizes (uncompressed): %u / %u\n", sz, csz); - dst = src; - break; - case 1: /* RunLen */ - tmp = dst = HeapAlloc(GetProcessHeap(), 0, sz); - if (!dst) return NULL; - HLPFILE_UncompressRLE(src, src + csz, &tmp, sz); - if (tmp - dst != sz) - WINE_WARN("Bogus gfx sizes (RunLen): %u/%u\n", tmp - dst, sz); - break; - case 2: /* LZ77 */ - sz77 = HLPFILE_UncompressedLZ77_Size(src, src + csz); - dst = HeapAlloc(GetProcessHeap(), 0, sz77); - if (!dst) return NULL; - HLPFILE_UncompressLZ77(src, src + csz, dst); - if (sz77 != sz) - WINE_WARN("Bogus gfx sizes (LZ77): %u / %u\n", sz77, sz); - break; - case 3: /* LZ77 then RLE */ - sz77 = HLPFILE_UncompressedLZ77_Size(src, src + csz); - tmp = HeapAlloc(GetProcessHeap(), 0, sz77); - if (!tmp) return FALSE; - HLPFILE_UncompressLZ77(src, src + csz, tmp); - dst = tmp2 = HeapAlloc(GetProcessHeap(), 0, sz); - if (!dst) return FALSE; - HLPFILE_UncompressRLE(tmp, tmp + sz77, &tmp2, sz); - if (tmp2 - dst != sz) - WINE_WARN("Bogus gfx sizes (LZ77+RunLen): %u / %u\n", tmp2 - dst, sz); - HeapFree(GetProcessHeap(), 0, tmp); - break; - default: - WINE_FIXME("Unsupported packing %u\n", packing); - return NULL; - } - return dst; -} - -/****************************************************************** - * HLPFILE_LoadBitmap - * - * - */ -static BOOL HLPFILE_LoadBitmap(BYTE* beg, BYTE type, BYTE pack, - HLPFILE_PARAGRAPH* paragraph) -{ - BYTE* ptr; - BYTE* pict_beg; - BITMAPINFO* bi; - unsigned long off, csz; - HDC hdc; - - bi = HeapAlloc(GetProcessHeap(), 0, sizeof(*bi)); - if (!bi) return FALSE; - - ptr = beg + 2; /* for type and pack */ - - bi->bmiHeader.biSize = sizeof(bi->bmiHeader); - bi->bmiHeader.biXPelsPerMeter = fetch_ulong(&ptr); - bi->bmiHeader.biYPelsPerMeter = fetch_ulong(&ptr); - bi->bmiHeader.biPlanes = fetch_ushort(&ptr); - bi->bmiHeader.biBitCount = fetch_ushort(&ptr); - bi->bmiHeader.biWidth = fetch_ulong(&ptr); - bi->bmiHeader.biHeight = fetch_ulong(&ptr); - bi->bmiHeader.biClrUsed = fetch_ulong(&ptr); - bi->bmiHeader.biClrImportant = fetch_ulong(&ptr); - bi->bmiHeader.biCompression = BI_RGB; - if (bi->bmiHeader.biBitCount > 32) WINE_FIXME("Unknown bit count %u\n", bi->bmiHeader.biBitCount); - if (bi->bmiHeader.biPlanes != 1) WINE_FIXME("Unsupported planes %u\n", bi->bmiHeader.biPlanes); - bi->bmiHeader.biSizeImage = (((bi->bmiHeader.biWidth * bi->bmiHeader.biBitCount + 31) & ~31) / 8) * bi->bmiHeader.biHeight; - WINE_TRACE("planes=%d bc=%d size=(%d,%d)\n", - bi->bmiHeader.biPlanes, bi->bmiHeader.biBitCount, - bi->bmiHeader.biWidth, bi->bmiHeader.biHeight); - - csz = fetch_ulong(&ptr); - fetch_ulong(&ptr); /* hotspot size */ - - off = GET_UINT(ptr, 0); ptr += 4; - /* GET_UINT(ptr, 0); hotspot offset */ ptr += 4; - - /* now read palette info */ - if (type == 0x06) - { - unsigned nc = bi->bmiHeader.biClrUsed; - unsigned i; - - /* not quite right, especially for bitfields type of compression */ - if (!nc && bi->bmiHeader.biBitCount <= 8) - nc = 1 << bi->bmiHeader.biBitCount; - - bi = HeapReAlloc(GetProcessHeap(), 0, bi, sizeof(*bi) + nc * sizeof(RGBQUAD)); - if (!bi) return FALSE; - for (i = 0; i < nc; i++) - { - bi->bmiColors[i].rgbBlue = ptr[0]; - bi->bmiColors[i].rgbGreen = ptr[1]; - bi->bmiColors[i].rgbRed = ptr[2]; - bi->bmiColors[i].rgbReserved = 0; - ptr += 4; - } - } - pict_beg = HLPFILE_DecompressGfx(beg + off, csz, bi->bmiHeader.biSizeImage, pack); - - paragraph->u.gfx.u.bmp.hBitmap = CreateDIBitmap(hdc = GetDC(0), &bi->bmiHeader, - CBM_INIT, pict_beg, - bi, DIB_RGB_COLORS); - ReleaseDC(0, hdc); - if (!paragraph->u.gfx.u.bmp.hBitmap) - WINE_ERR("Couldn't create bitmap\n"); - - HeapFree(GetProcessHeap(), 0, bi); - if (pict_beg != beg + off) HeapFree(GetProcessHeap(), 0, pict_beg); - - return TRUE; -} - -/****************************************************************** - * HLPFILE_LoadMetaFile - * - * - */ -static BOOL HLPFILE_LoadMetaFile(BYTE* beg, BYTE pack, HLPFILE_PARAGRAPH* paragraph) -{ - BYTE* ptr; - unsigned long size, csize; - unsigned long off, hsoff; - BYTE* bits; - LPMETAFILEPICT lpmfp; - - WINE_TRACE("Loading metafile\n"); - - ptr = beg + 2; /* for type and pack */ - - lpmfp = ¶graph->u.gfx.u.mfp; - lpmfp->mm = fetch_ushort(&ptr); /* mapping mode */ - - lpmfp->xExt = GET_USHORT(ptr, 0); - lpmfp->yExt = GET_USHORT(ptr, 2); - ptr += 4; - - size = fetch_ulong(&ptr); /* decompressed size */ - csize = fetch_ulong(&ptr); /* compressed size */ - fetch_ulong(&ptr); /* hotspot size */ - off = GET_UINT(ptr, 0); - hsoff = GET_UINT(ptr, 4); - ptr += 8; - - WINE_TRACE("sz=%lu csz=%lu (%d,%d) offs=%lu/%u,%lu\n", - size, csize, lpmfp->xExt, lpmfp->yExt, off, ptr - beg, hsoff); - - bits = HLPFILE_DecompressGfx(beg + off, csize, size, pack); - if (!bits) return FALSE; - - paragraph->cookie = para_metafile; - - lpmfp->hMF = SetMetaFileBitsEx(size, bits); - - if (!lpmfp->hMF) - WINE_FIXME("Couldn't load metafile\n"); - - if (bits != beg + off) HeapFree(GetProcessHeap(), 0, bits); - - return TRUE; -} - -/****************************************************************** - * HLPFILE_LoadGfxByAddr - * - * - */ -static BOOL HLPFILE_LoadGfxByAddr(HLPFILE *hlpfile, BYTE* ref, - unsigned long size, - HLPFILE_PARAGRAPH* paragraph) -{ - unsigned i, numpict; - - numpict = GET_USHORT(ref, 2); - WINE_TRACE("Got picture magic=%04x #=%d\n", - GET_USHORT(ref, 0), numpict); - - for (i = 0; i < numpict; i++) - { - BYTE* beg; - BYTE* ptr; - BYTE type, pack; - - WINE_TRACE("Offset[%d] = %x\n", i, GET_UINT(ref, (1 + i) * 4)); - beg = ptr = ref + GET_UINT(ref, (1 + i) * 4); - - type = *ptr++; - pack = *ptr++; - - switch (type) - { - case 5: /* device dependent bmp */ - case 6: /* device independent bmp */ - HLPFILE_LoadBitmap(beg, type, pack, paragraph); - break; - case 8: - HLPFILE_LoadMetaFile(beg, pack, paragraph); - break; - default: WINE_FIXME("Unknown type %u\n", type); return FALSE; - } - - /* FIXME: hotspots */ - - /* FIXME: implement support for multiple picture format */ - if (numpict != 1) WINE_FIXME("Supporting only one bitmap format per logical bitmap (for now). Using first format\n"); - break; - } - return TRUE; -} - -/****************************************************************** - * HLPFILE_LoadGfxByIndex - * - * - */ -static BOOL HLPFILE_LoadGfxByIndex(HLPFILE *hlpfile, unsigned index, - HLPFILE_PARAGRAPH* paragraph) -{ - char tmp[16]; - BYTE *ref, *end; - BOOL ret; - - WINE_TRACE("Loading picture #%d\n", index); - - if (index < hlpfile->numBmps && hlpfile->bmps[index] != NULL) - { - paragraph->u.gfx.u.bmp.hBitmap = hlpfile->bmps[index]; - return TRUE; - } - - sprintf(tmp, "|bm%u", index); - - if (!HLPFILE_FindSubFile(tmp, &ref, &end)) {WINE_WARN("no sub file\n"); return FALSE;} - - ref += 9; - - ret = HLPFILE_LoadGfxByAddr(hlpfile, ref, end - ref, paragraph); - - /* cache bitmap */ - if (ret && paragraph->cookie == para_bitmap) - { - if (index >= hlpfile->numBmps) - { - hlpfile->numBmps = index + 1; - if (hlpfile->bmps) - hlpfile->bmps = HeapReAlloc(GetProcessHeap(), 0, hlpfile->bmps, - hlpfile->numBmps * sizeof(hlpfile->bmps[0])); - else - hlpfile->bmps = HeapAlloc(GetProcessHeap(), 0, - hlpfile->numBmps * sizeof(hlpfile->bmps[0])); - - } - hlpfile->bmps[index] = paragraph->u.gfx.u.bmp.hBitmap; - } - return ret; -} - -/****************************************************************** - * HLPFILE_AllocLink - * - * - */ -static HLPFILE_LINK* HLPFILE_AllocLink(int cookie, const char* str, LONG hash, - BOOL clrChange, unsigned wnd) -{ - HLPFILE_LINK* link; - char* link_str; - - /* FIXME: should build a string table for the attributes.link.lpszPath - * they are reallocated for each link - */ - link = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_LINK) + strlen(str) + 1); - if (!link) return NULL; - - link->cookie = cookie; - link->lpszString = link_str = (char*)link + sizeof(HLPFILE_LINK); - strcpy(link_str, str); - link->lHash = hash; - link->bClrChange = clrChange ? 1 : 0; - link->window = wnd; - link->wRefCount = 1; - - WINE_TRACE("Link[%d] to %s@%08x:%d\n", - link->cookie, link->lpszString, - link->lHash, link->window); - return link; -} - -/*********************************************************************** - * - * HLPFILE_AddParagraph - */ -static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned* len) -{ - HLPFILE_PAGE *page; - HLPFILE_PARAGRAPH *paragraph, **paragraphptr; - UINT textsize; - BYTE *format, *format_end; - char *text, *text_end; - long size; - unsigned short bits; - unsigned nc, ncol = 1; - - if (!hlpfile->first_page) {WINE_WARN("no page\n"); return FALSE;}; - - for (page = hlpfile->first_page; page->next; page = page->next) /* Nothing */; - for (paragraphptr = &page->first_paragraph; *paragraphptr; - paragraphptr = &(*paragraphptr)->next) /* Nothing */; - - if (buf + 0x19 > end) {WINE_WARN("header too small\n"); return FALSE;}; - - size = GET_UINT(buf, 0x4); - text = HeapAlloc(GetProcessHeap(), 0, size); - if (!text) return FALSE; - if (hlpfile->hasPhrases) - { - HLPFILE_Uncompress2(buf + GET_UINT(buf, 0x10), end, (BYTE*)text, (BYTE*)text + size); - } - else - { - if (GET_UINT(buf, 0x4) > GET_UINT(buf, 0) - GET_UINT(buf, 0x10)) - { - /* block is compressed */ - HLPFILE_Uncompress3(text, text + size, buf + GET_UINT(buf, 0x10), end); - } - else - { - text = (char*)buf + GET_UINT(buf, 0x10); - } - } - text_end = text + size; - - format = buf + 0x15; - format_end = buf + GET_UINT(buf, 0x10); - - fetch_long(&format); - *len = fetch_ushort(&format); - - if (buf[0x14] == 0x23) - { - char type; - - ncol = *format++; - - WINE_TRACE("#cols %u\n", ncol); - type = *format++; - if (type == 0 || type == 2) - format += 2; - format += ncol * 4; - } - - for (nc = 0; nc < ncol; nc++) - { - WINE_TRACE("looking for format at offset %u for column %d\n", format - (buf + 0x15), nc); - if (buf[0x14] == 0x23) - format += 5; - format += 4; - bits = GET_USHORT(format, 0); format += 2; - if (bits & 0x0001) fetch_long(&format); - if (bits & 0x0002) fetch_short(&format); - if (bits & 0x0004) fetch_short(&format); - if (bits & 0x0008) fetch_short(&format); - if (bits & 0x0010) fetch_short(&format); - if (bits & 0x0020) fetch_short(&format); - if (bits & 0x0040) fetch_short(&format); - if (bits & 0x0100) format += 3; - if (bits & 0x0200) - { - int ntab = fetch_short(&format); - unsigned short ts; - - while (ntab-- > 0) - { - ts = fetch_ushort(&format); - if (ts & 0x4000) fetch_ushort(&format); - } - } - /* 0x0400, 0x0800 and 0x1000 don't need space */ - if ((bits & 0xE080) != 0) - WINE_FIXME("Unsupported bits %04x, potential trouble ahead\n", bits); - - while (text < text_end && format < format_end) - { - //WINE_TRACE("Got text: %s (%p/%p - %p/%p)\n", wine_dbgstr_a(text), text, text_end, format, format_end); - textsize = strlen(text) + 1; - if (textsize > 1) - { - paragraph = HeapAlloc(GetProcessHeap(), 0, - sizeof(HLPFILE_PARAGRAPH) + textsize); - if (!paragraph) return FALSE; - *paragraphptr = paragraph; - paragraphptr = ¶graph->next; - - paragraph->next = NULL; - paragraph->link = attributes.link; - if (paragraph->link) paragraph->link->wRefCount++; - paragraph->cookie = para_normal_text; - paragraph->u.text.wFont = attributes.wFont; - paragraph->u.text.wVSpace = attributes.wVSpace; - paragraph->u.text.wHSpace = attributes.wHSpace; - paragraph->u.text.wIndent = attributes.wIndent; - paragraph->u.text.lpszText = (char*)paragraph + sizeof(HLPFILE_PARAGRAPH); - strcpy(paragraph->u.text.lpszText, text); - - attributes.wVSpace = 0; - attributes.wHSpace = 0; - } - /* else: null text, keep on storing attributes */ - text += textsize; - - if (*format == 0xff) - { - format++; - break; - } - - WINE_TRACE("format=%02x\n", *format); - switch (*format) - { - case 0x20: - WINE_FIXME("NIY20\n"); - format += 5; - break; - - case 0x21: - WINE_FIXME("NIY21\n"); - format += 3; - break; - - case 0x80: - attributes.wFont = GET_USHORT(format, 1); - WINE_TRACE("Changing font to %d\n", attributes.wFont); - format += 3; - break; - - case 0x81: - attributes.wVSpace++; - format += 1; - break; - - case 0x82: - attributes.wVSpace++; - attributes.wIndent = 0; - format += 1; - break; - - case 0x83: - attributes.wIndent++; - format += 1; - break; - -#if 0 - case 0x84: - format += 3; - break; -#endif - - case 0x86: - case 0x87: - case 0x88: - { - BYTE pos = (*format - 0x86); - BYTE type = format[1]; - long size; - - format += 2; - size = fetch_long(&format); - - paragraph = HeapAlloc(GetProcessHeap(), 0, - sizeof(HLPFILE_PARAGRAPH) + textsize); - if (!paragraph) return FALSE; - *paragraphptr = paragraph; - paragraphptr = ¶graph->next; - - paragraph->next = NULL; - paragraph->link = attributes.link; - if (paragraph->link) paragraph->link->wRefCount++; - paragraph->cookie = para_bitmap; - paragraph->u.gfx.pos = pos; - switch (type) - { - case 0x22: - fetch_ushort(&format); /* hot spot */ - /* fall thru */ - case 0x03: - switch (GET_SHORT(format, 0)) - { - case 0: - HLPFILE_LoadGfxByIndex(hlpfile, GET_SHORT(format, 2), - paragraph); - break; - case 1: - WINE_FIXME("does it work ??? %x<%lu>#%u\n", - GET_SHORT(format, 0), - size, GET_SHORT(format, 2)); - HLPFILE_LoadGfxByAddr(hlpfile, format + 2, size - 4, - paragraph); - break; - default: - WINE_FIXME("??? %u\n", GET_SHORT(format, 0)); - break; - } - break; - case 0x05: - WINE_FIXME("Got an embedded element %s\n", format + 6); - break; - default: - WINE_FIXME("Got a type %d picture\n", type); - break; - } - if (attributes.wVSpace) paragraph->u.gfx.pos |= 0x8000; - - format += size; - } - break; - - case 0x89: - HLPFILE_FreeLink(attributes.link); - attributes.link = NULL; - format += 1; - break; - - case 0x8B: - case 0x8C: - WINE_FIXME("NIY non-break space/hyphen\n"); - format += 1; - break; - -#if 0 - case 0xA9: - format += 2; - break; -#endif - - case 0xC8: - case 0xCC: - WINE_TRACE("macro => %s\n", format + 3); - HLPFILE_FreeLink(attributes.link); - attributes.link = HLPFILE_AllocLink(hlp_link_macro, (const char*)format + 3, - 0, !(*format & 4), -1); - format += 3 + GET_USHORT(format, 1); - break; - - case 0xE0: - case 0xE1: - WINE_WARN("jump topic 1 => %u\n", GET_UINT(format, 1)); - format += 5; - break; - - case 0xE2: - case 0xE3: - case 0xE6: - case 0xE7: - HLPFILE_FreeLink(attributes.link); - attributes.link = HLPFILE_AllocLink((*format & 1) ? hlp_link_link : hlp_link_popup, - hlpfile->lpszPath, - GET_UINT(format, 1), - !(*format & 4), -1); - format += 5; - break; - - case 0xEA: - case 0xEB: - case 0xEE: - case 0xEF: - { - char* ptr = (char*) format + 8; - BYTE type = format[3]; - int wnd = -1; - char* str; - - if (type == 1) wnd = *ptr++; - if (type == 4 || type == 6) - { - str = ptr; - ptr += strlen(ptr) + 1; - } - else - str = hlpfile->lpszPath; - if (type == 6) - { - for (wnd = hlpfile->numWindows - 1; wnd >= 0; wnd--) - { - if (!strcmp(ptr, hlpfile->windows[wnd].name)) break; - } - if (wnd == -1) - WINE_WARN("Couldn't find window info for %s\n", ptr); - } - HLPFILE_FreeLink(attributes.link); - attributes.link = HLPFILE_AllocLink((*format & 4) ? hlp_link_link : hlp_link_popup, - str, GET_UINT(format, 4), - !(*format & 1), wnd); - } - format += 3 + GET_USHORT(format, 1); - break; - - default: - WINE_WARN("format %02x\n", *format); - format++; - } - } - } - if (text_end != (char*)buf + GET_UINT(buf, 0x10) + size) - HeapFree(GetProcessHeap(), 0, text_end - size); - return TRUE; -} - -/****************************************************************** - * HLPFILE_ReadFont - * - * - */ -static BOOL HLPFILE_ReadFont(HLPFILE* hlpfile) -{ - BYTE *ref, *end; - unsigned i, len, idx; - unsigned face_num, dscr_num, face_offset, dscr_offset; - BYTE flag, family; - - if (!HLPFILE_FindSubFile("|FONT", &ref, &end)) - { - WINE_WARN("no subfile FONT\n"); - hlpfile->numFonts = 0; - hlpfile->fonts = NULL; - return FALSE; - } - - ref += 9; - - face_num = GET_USHORT(ref, 0); - dscr_num = GET_USHORT(ref, 2); - face_offset = GET_USHORT(ref, 4); - dscr_offset = GET_USHORT(ref, 6); - - WINE_TRACE("Got NumFacenames=%u@%u NumDesc=%u@%u\n", - face_num, face_offset, dscr_num, dscr_offset); - - hlpfile->numFonts = dscr_num; - hlpfile->fonts = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_FONT) * dscr_num); - - len = (dscr_offset - face_offset) / face_num; -/* EPP for (i = face_offset; i < dscr_offset; i += len) */ -/* EPP WINE_FIXME("[%d]: %*s\n", i / len, len, ref + i); */ - for (i = 0; i < dscr_num; i++) - { - flag = ref[dscr_offset + i * 11 + 0]; - family = ref[dscr_offset + i * 11 + 2]; - - hlpfile->fonts[i].LogFont.lfHeight = -ref[dscr_offset + i * 11 + 1] / 2; - hlpfile->fonts[i].LogFont.lfWidth = 0; - hlpfile->fonts[i].LogFont.lfEscapement = 0; - hlpfile->fonts[i].LogFont.lfOrientation = 0; - hlpfile->fonts[i].LogFont.lfWeight = (flag & 1) ? 700 : 400; - hlpfile->fonts[i].LogFont.lfItalic = (flag & 2) ? TRUE : FALSE; - hlpfile->fonts[i].LogFont.lfUnderline = (flag & 4) ? TRUE : FALSE; - hlpfile->fonts[i].LogFont.lfStrikeOut = (flag & 8) ? TRUE : FALSE; - hlpfile->fonts[i].LogFont.lfCharSet = ANSI_CHARSET; - hlpfile->fonts[i].LogFont.lfOutPrecision = OUT_DEFAULT_PRECIS; - hlpfile->fonts[i].LogFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - hlpfile->fonts[i].LogFont.lfQuality = DEFAULT_QUALITY; - hlpfile->fonts[i].LogFont.lfPitchAndFamily = DEFAULT_PITCH; - - switch (family) - { - case 0x01: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_MODERN; break; - case 0x02: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_ROMAN; break; - case 0x03: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_SWISS; break; - case 0x04: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_SCRIPT; break; - case 0x05: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_DECORATIVE; break; - default: WINE_FIXME("Unknown family %u\n", family); - } - idx = GET_USHORT(ref, dscr_offset + i * 11 + 3); - - if (idx < face_num) - { - memcpy(hlpfile->fonts[i].LogFont.lfFaceName, ref + face_offset + idx * len, min(len, LF_FACESIZE - 1)); - hlpfile->fonts[i].LogFont.lfFaceName[min(len, LF_FACESIZE - 1)] = '\0'; - } - else - { - WINE_FIXME("Too high face ref (%u/%u)\n", idx, face_num); - strcpy(hlpfile->fonts[i].LogFont.lfFaceName, "Helv"); - } - hlpfile->fonts[i].hFont = 0; - hlpfile->fonts[i].color = RGB(ref[dscr_offset + i * 11 + 5], - ref[dscr_offset + i * 11 + 6], - ref[dscr_offset + i * 11 + 7]); -#define X(b,s) ((flag & (1 << b)) ? "-"s: "") - WINE_TRACE("Font[%d]: flags=%02x%s%s%s%s%s%s pSize=%u family=%u face=%s[%u] color=%08x\n", - i, flag, - X(0, "bold"), - X(1, "italic"), - X(2, "underline"), - X(3, "strikeOut"), - X(4, "dblUnderline"), - X(5, "smallCaps"), - ref[dscr_offset + i * 11 + 1], - family, - hlpfile->fonts[i].LogFont.lfFaceName, idx, - GET_UINT(ref, dscr_offset + i * 11 + 5) & 0x00FFFFFF); - } - return TRUE; -} - -/*********************************************************************** - * - * HLPFILE_ReadFileToBuffer - */ -static BOOL HLPFILE_ReadFileToBuffer(HFILE hFile) -{ - BYTE header[16], dummy[1]; - UINT size; - - if (_hread(hFile, header, 16) != 16) {WINE_WARN("header\n"); return FALSE;}; - - /* sanity checks */ - if (GET_UINT(header, 0) != 0x00035F3F) - {WINE_WARN("wrong header\n"); return FALSE;}; - - size = GET_UINT(header, 12); - file_buffer = HeapAlloc(GetProcessHeap(), 0, size + 1); - if (!file_buffer) return FALSE; - - memcpy(file_buffer, header, 16); - if (_hread(hFile, file_buffer + 16, size - 16) != size - 16) - {WINE_WARN("filesize1\n"); return FALSE;}; - - if (_hread(hFile, dummy, 1) != 0) WINE_WARN("filesize2\n"); - - file_buffer[size] = '\0'; /* FIXME: was '0', sounds ackward to me */ - - return TRUE; -} - -/*********************************************************************** - * - * HLPFILE_FindSubFile - */ -static BOOL HLPFILE_FindSubFile(LPCSTR name, BYTE **subbuf, BYTE **subend) -{ - BYTE *root = file_buffer + GET_UINT(file_buffer, 4); - BYTE *end = file_buffer + GET_UINT(file_buffer, 12); - BYTE *ptr; - BYTE *bth; - - unsigned pgsize; - unsigned pglast; - unsigned nentries; - unsigned i, n; - - bth = root + 9; - - /* FIXME: this should be using the EnumBTree functions from this file */ - pgsize = GET_USHORT(bth, 4); - WINE_TRACE("%s => pgsize=%u #pg=%u rootpg=%u #lvl=%u\n", - name, pgsize, GET_USHORT(bth, 30), GET_USHORT(bth, 26), GET_USHORT(bth, 32)); - - ptr = bth + 38 + GET_USHORT(bth, 26) * pgsize; - - for (n = 1; n < GET_USHORT(bth, 32); n++) - { - nentries = GET_USHORT(ptr, 2); - pglast = GET_USHORT(ptr, 4); - WINE_TRACE("[%u]: #entries=%u next=%u\n", n, nentries, pglast); - - ptr += 6; - for (i = 0; i < nentries; i++) - { - char *str = (char*) ptr; - WINE_TRACE("<= %s\n", str); - if (strcmp(name, str) < 0) break; - ptr += strlen(str) + 1; - pglast = GET_USHORT(ptr, 0); - ptr += 2; - } - ptr = bth + 38 + pglast * pgsize; - } - - nentries = GET_USHORT(ptr, 2); - ptr += 8; - for (i = 0; i < nentries; i++) - { - char* fname = (char*)ptr; - ptr += strlen(fname) + 1; - WINE_TRACE("\\- %s\n", fname); - if (strcmp(fname, name) == 0) - { - *subbuf = file_buffer + GET_UINT(ptr, 0); - *subend = *subbuf + GET_UINT(*subbuf, 0); - if (file_buffer > *subbuf || *subbuf > *subend || *subend > end) - { - WINE_WARN("size mismatch\n"); - return FALSE; - } - return TRUE; - } - ptr += 4; - } - - return FALSE; -} - -/*********************************************************************** - * - * HLPFILE_SystemCommands - */ -static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) -{ - BYTE *buf, *ptr, *end; - HLPFILE_MACRO *macro, **m; - LPSTR p; - unsigned short magic, minor, major, flags; - - hlpfile->lpszTitle = NULL; - - if (!HLPFILE_FindSubFile("|SYSTEM", &buf, &end)) return FALSE; - - magic = GET_USHORT(buf + 9, 0); - minor = GET_USHORT(buf + 9, 2); - major = GET_USHORT(buf + 9, 4); - /* gen date on 4 bytes */ - flags = GET_USHORT(buf + 9, 10); - WINE_TRACE("Got system header: magic=%04x version=%d.%d flags=%04x\n", - magic, major, minor, flags); - if (magic != 0x036C || major != 1) - {WINE_WARN("Wrong system header\n"); return FALSE;} - if (minor <= 16) {WINE_WARN("too old file format (NIY)\n"); return FALSE;} - if (flags & 8) {WINE_WARN("Unsupported yet page size\n"); return FALSE;} - - hlpfile->version = minor; - hlpfile->flags = flags; - - for (ptr = buf + 0x15; ptr + 4 <= end; ptr += GET_USHORT(ptr, 2) + 4) - { - char *str = (char*) ptr + 4; - switch (GET_USHORT(ptr, 0)) - { - case 1: - if (hlpfile->lpszTitle) {WINE_WARN("title\n"); break;} - hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); - if (!hlpfile->lpszTitle) return FALSE; - lstrcpy(hlpfile->lpszTitle, str); - WINE_TRACE("Title: %s\n", hlpfile->lpszTitle); - break; - - case 2: - if (hlpfile->lpszCopyright) {WINE_WARN("copyright\n"); break;} - hlpfile->lpszCopyright = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); - if (!hlpfile->lpszCopyright) return FALSE; - lstrcpy(hlpfile->lpszCopyright, str); - WINE_TRACE("Copyright: %s\n", hlpfile->lpszCopyright); - break; - - case 3: - if (GET_USHORT(ptr, 2) != 4) {WINE_WARN("system3\n");break;} - hlpfile->contents_start = GET_UINT(ptr, 4); - WINE_TRACE("Setting contents start at %08lx\n", hlpfile->contents_start); - break; - - case 4: - macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + lstrlen(str) + 1); - if (!macro) break; - p = (char*)macro + sizeof(HLPFILE_MACRO); - lstrcpy(p, str); - macro->lpszMacro = p; - macro->next = 0; - for (m = &hlpfile->first_macro; *m; m = &(*m)->next); - *m = macro; - break; - - case 6: - if (GET_USHORT(ptr, 2) != 90) {WINE_WARN("system6\n");break;} - - if (hlpfile->windows) - hlpfile->windows = HeapReAlloc(GetProcessHeap(), 0, hlpfile->windows, - sizeof(HLPFILE_WINDOWINFO) * ++hlpfile->numWindows); - else - hlpfile->windows = HeapAlloc(GetProcessHeap(), 0, - sizeof(HLPFILE_WINDOWINFO) * ++hlpfile->numWindows); - - if (hlpfile->windows) - { - unsigned flags = GET_USHORT(ptr, 4); - HLPFILE_WINDOWINFO* wi = &hlpfile->windows[hlpfile->numWindows - 1]; - - if (flags & 0x0001) strcpy(wi->type, &str[2]); - else wi->type[0] = '\0'; - if (flags & 0x0002) strcpy(wi->name, &str[12]); - else wi->name[0] = '\0'; - if (flags & 0x0004) strcpy(wi->caption, &str[23]); - else lstrcpynA(wi->caption, hlpfile->lpszTitle, sizeof(wi->caption)); - wi->origin.x = (flags & 0x0008) ? GET_USHORT(ptr, 76) : CW_USEDEFAULT; - wi->origin.y = (flags & 0x0010) ? GET_USHORT(ptr, 78) : CW_USEDEFAULT; - wi->size.cx = (flags & 0x0020) ? GET_USHORT(ptr, 80) : CW_USEDEFAULT; - wi->size.cy = (flags & 0x0040) ? GET_USHORT(ptr, 82) : CW_USEDEFAULT; - wi->style = (flags & 0x0080) ? GET_USHORT(ptr, 84) : SW_SHOW; - wi->win_style = WS_OVERLAPPEDWINDOW; - wi->sr_color = (flags & 0x0100) ? GET_UINT(ptr, 86) : 0xFFFFFF; - wi->nsr_color = (flags & 0x0200) ? GET_UINT(ptr, 90) : 0xFFFFFF; - WINE_TRACE("System-Window: flags=%c%c%c%c%c%c%c%c type=%s name=%s caption=%s (%d,%d)x(%d,%d)\n", - flags & 0x0001 ? 'T' : 't', - flags & 0x0002 ? 'N' : 'n', - flags & 0x0004 ? 'C' : 'c', - flags & 0x0008 ? 'X' : 'x', - flags & 0x0010 ? 'Y' : 'y', - flags & 0x0020 ? 'W' : 'w', - flags & 0x0040 ? 'H' : 'h', - flags & 0x0080 ? 'S' : 's', - wi->type, wi->name, wi->caption, wi->origin.x, wi->origin.y, - wi->size.cx, wi->size.cy); - } - break; - default: - WINE_WARN("Unsupported SystemRecord[%d]\n", GET_USHORT(ptr, 0)); - } - } - if (!hlpfile->lpszTitle) - hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1); - return TRUE; -} - -/*********************************************************************** - * - * HLPFILE_UncompressedLZ77_Size - */ -static INT HLPFILE_UncompressedLZ77_Size(BYTE *ptr, BYTE *end) -{ - int i, newsize = 0; - - while (ptr < end) - { - int mask = *ptr++; - for (i = 0; i < 8 && ptr < end; i++, mask >>= 1) - { - if (mask & 1) - { - int code = GET_USHORT(ptr, 0); - int len = 3 + (code >> 12); - newsize += len; - ptr += 2; - } - else newsize++, ptr++; - } - } - - return newsize; -} - -/*********************************************************************** - * - * HLPFILE_UncompressLZ77 - */ -static BYTE *HLPFILE_UncompressLZ77(BYTE *ptr, BYTE *end, BYTE *newptr) -{ - int i; - - while (ptr < end) - { - int mask = *ptr++; - for (i = 0; i < 8 && ptr < end; i++, mask >>= 1) - { - if (mask & 1) - { - int code = GET_USHORT(ptr, 0); - int len = 3 + (code >> 12); - int offset = code & 0xfff; - /* - * We must copy byte-by-byte here. We cannot use memcpy nor - * memmove here. Just example: - * a[]={1,2,3,4,5,6,7,8,9,10} - * newptr=a+2; - * offset=1; - * We expect: - * {1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 11, 12} - */ - for (; len>0; len--, newptr++) *newptr = *(newptr-offset-1); - ptr += 2; - } - else *newptr++ = *ptr++; - } - } - - return newptr; -} - -/*********************************************************************** - * - * HLPFILE_UncompressLZ77_Phrases - */ -static BOOL HLPFILE_UncompressLZ77_Phrases(HLPFILE* hlpfile) -{ - UINT i, num, dec_size; - BYTE *buf, *end; - - if (!HLPFILE_FindSubFile("|Phrases", &buf, &end)) return FALSE; - - num = phrases.num = GET_USHORT(buf, 9); - if (buf + 2 * num + 0x13 >= end) {WINE_WARN("1a\n"); return FALSE;}; - - dec_size = HLPFILE_UncompressedLZ77_Size(buf + 0x13 + 2 * num, end); - - phrases.offsets = HeapAlloc(GetProcessHeap(), 0, sizeof(unsigned) * (num + 1)); - phrases.buffer = HeapAlloc(GetProcessHeap(), 0, dec_size); - if (!phrases.offsets || !phrases.buffer) return FALSE; - - for (i = 0; i <= num; i++) - phrases.offsets[i] = GET_USHORT(buf, 0x11 + 2 * i) - 2 * num - 2; - - HLPFILE_UncompressLZ77(buf + 0x13 + 2 * num, end, (BYTE*)phrases.buffer); - - hlpfile->hasPhrases = TRUE; - return TRUE; -} - -/*********************************************************************** - * - * HLPFILE_Uncompress_Phrases40 - */ -static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE* hlpfile) -{ - UINT num, dec_size, cpr_size; - BYTE *buf_idx, *end_idx; - BYTE *buf_phs, *end_phs; - short i, n; - long* ptr, mask = 0; - unsigned short bc; - - if (!HLPFILE_FindSubFile("|PhrIndex", &buf_idx, &end_idx) || - !HLPFILE_FindSubFile("|PhrImage", &buf_phs, &end_phs)) return FALSE; - - ptr = (long*)(buf_idx + 9 + 28); - bc = GET_USHORT(buf_idx, 9 + 24) & 0x0F; - num = phrases.num = GET_USHORT(buf_idx, 9 + 4); - - WINE_TRACE("Index: Magic=%08x #entries=%u CpsdSize=%u PhrImgSize=%u\n" - "\tPhrImgCprsdSize=%u 0=%u bc=%x ukn=%x\n", - GET_UINT(buf_idx, 9 + 0), - GET_UINT(buf_idx, 9 + 4), - GET_UINT(buf_idx, 9 + 8), - GET_UINT(buf_idx, 9 + 12), - GET_UINT(buf_idx, 9 + 16), - GET_UINT(buf_idx, 9 + 20), - GET_USHORT(buf_idx, 9 + 24), - GET_USHORT(buf_idx, 9 + 26)); - - dec_size = GET_UINT(buf_idx, 9 + 12); - cpr_size = GET_UINT(buf_idx, 9 + 16); - - if (dec_size != cpr_size && - dec_size != HLPFILE_UncompressedLZ77_Size(buf_phs + 9, end_phs)) - { - WINE_WARN("size mismatch %u %u\n", - dec_size, HLPFILE_UncompressedLZ77_Size(buf_phs + 9, end_phs)); - dec_size = max(dec_size, HLPFILE_UncompressedLZ77_Size(buf_phs + 9, end_phs)); - } - - phrases.offsets = HeapAlloc(GetProcessHeap(), 0, sizeof(unsigned) * (num + 1)); - phrases.buffer = HeapAlloc(GetProcessHeap(), 0, dec_size); - if (!phrases.offsets || !phrases.buffer) return FALSE; - -#define getbit() (ptr += (mask < 0), mask = mask*2 + (mask<=0), (*ptr & mask) != 0) - - phrases.offsets[0] = 0; - for (i = 0; i < num; i++) - { - for (n = 1; getbit(); n += 1 << bc); - if (getbit()) n++; - if (bc > 1 && getbit()) n += 2; - if (bc > 2 && getbit()) n += 4; - if (bc > 3 && getbit()) n += 8; - if (bc > 4 && getbit()) n += 16; - phrases.offsets[i + 1] = phrases.offsets[i] + n; - } -#undef getbit - - if (dec_size == cpr_size) - memcpy(phrases.buffer, buf_phs + 9, dec_size); - else - HLPFILE_UncompressLZ77(buf_phs + 9, end_phs, (BYTE*)phrases.buffer); - - hlpfile->hasPhrases = FALSE; - return TRUE; -} - -/*********************************************************************** - * - * HLPFILE_Uncompress_Topic - */ -static BOOL HLPFILE_Uncompress_Topic(HLPFILE* hlpfile) -{ - BYTE *buf, *ptr, *end, *newptr; - int i, newsize = 0; - - if (!HLPFILE_FindSubFile("|TOPIC", &buf, &end)) - {WINE_WARN("topic0\n"); return FALSE;} - - switch (hlpfile->flags & (8|4)) - { - case 8: - WINE_FIXME("Unsupported format\n"); - return FALSE; - case 4: - buf += 9; - topic.wMapLen = (end - buf - 1) / 0x1000 + 1; - - for (i = 0; i < topic.wMapLen; i++) - { - ptr = buf + i * 0x1000; - - /* I don't know why, it's necessary for printman.hlp */ - if (ptr + 0x44 > end) ptr = end - 0x44; - - newsize += HLPFILE_UncompressedLZ77_Size(ptr + 0xc, min(end, ptr + 0x1000)); - } - - topic.map = HeapAlloc(GetProcessHeap(), 0, - topic.wMapLen * sizeof(topic.map[0]) + newsize); - if (!topic.map) return FALSE; - newptr = (BYTE*)(topic.map + topic.wMapLen); - topic.end = newptr + newsize; - - for (i = 0; i < topic.wMapLen; i++) - { - ptr = buf + i * 0x1000; - if (ptr + 0x44 > end) ptr = end - 0x44; - - topic.map[i] = newptr; - newptr = HLPFILE_UncompressLZ77(ptr + 0xc, min(end, ptr + 0x1000), newptr); - } - break; - case 0: - /* basically, we need to copy the 0x1000 byte pages (removing the first 0x0C) in - * one single are in memory - */ -#define DST_LEN (0x1000 - 0x0C) - buf += 9; - newsize = end - buf; - /* number of destination pages */ - topic.wMapLen = (newsize - 1) / DST_LEN + 1; - topic.map = HeapAlloc(GetProcessHeap(), 0, - topic.wMapLen * (sizeof(topic.map[0]) + DST_LEN)); - if (!topic.map) return FALSE; - newptr = (BYTE*)(topic.map + topic.wMapLen); - topic.end = newptr + newsize; - - for (i = 0; i < topic.wMapLen; i++) - { - topic.map[i] = newptr + i * DST_LEN; - memcpy(topic.map[i], buf + i * 0x1000 + 0x0C, DST_LEN); - } -#undef DST_LEN - break; - } - return TRUE; -} - -/*********************************************************************** - * - * HLPFILE_Uncompress2 - */ - -static void HLPFILE_Uncompress2(const BYTE *ptr, const BYTE *end, BYTE *newptr, const BYTE *newend) -{ - BYTE *phptr, *phend; - UINT code; - UINT index; - - while (ptr < end && newptr < newend) - { - if (!*ptr || *ptr >= 0x10) - *newptr++ = *ptr++; - else - { - code = 0x100 * ptr[0] + ptr[1]; - index = (code - 0x100) / 2; - - phptr = (BYTE*)phrases.buffer + phrases.offsets[index]; - phend = (BYTE*)phrases.buffer + phrases.offsets[index + 1]; - - if (newptr + (phend - phptr) > newend) - { - WINE_FIXME("buffer overflow %p > %p for %d bytes\n", - newptr, newend, phend - phptr); - return; - } - memcpy(newptr, phptr, phend - phptr); - newptr += phend - phptr; - if (code & 1) *newptr++ = ' '; - - ptr += 2; - } - } - if (newptr > newend) WINE_FIXME("buffer overflow %p > %p\n", newptr, newend); -} - -/****************************************************************** - * HLPFILE_Uncompress3 - * - * - */ -static BOOL HLPFILE_Uncompress3(char* dst, const char* dst_end, - const BYTE* src, const BYTE* src_end) -{ - int idx, len; - - for (; src < src_end; src++) - { - if ((*src & 1) == 0) - { - idx = *src / 2; - if (idx > phrases.num) - { - WINE_ERR("index in phrases %d/%d\n", idx, phrases.num); - len = 0; - } - else - { - len = phrases.offsets[idx + 1] - phrases.offsets[idx]; - if (dst + len <= dst_end) - memcpy(dst, &phrases.buffer[phrases.offsets[idx]], len); - } - } - else if ((*src & 0x03) == 0x01) - { - idx = (*src + 1) * 64; - idx += *++src; - if (idx > phrases.num) - { - WINE_ERR("index in phrases %d/%d\n", idx, phrases.num); - len = 0; - } - else - { - len = phrases.offsets[idx + 1] - phrases.offsets[idx]; - if (dst + len <= dst_end) - memcpy(dst, &phrases.buffer[phrases.offsets[idx]], len); - } - } - else if ((*src & 0x07) == 0x03) - { - len = (*src / 8) + 1; - if (dst + len <= dst_end) - memcpy(dst, src + 1, len); - src += len; - } - else - { - len = (*src / 16) + 1; - if (dst + len <= dst_end) - memset(dst, ((*src & 0x0F) == 0x07) ? ' ' : 0, len); - } - dst += len; - } - - if (dst > dst_end) WINE_ERR("buffer overflow (%p > %p)\n", dst, dst_end); - return TRUE; -} - -/****************************************************************** - * HLPFILE_UncompressRLE - * - * - */ -static void HLPFILE_UncompressRLE(const BYTE* src, const BYTE* end, BYTE** dst, unsigned dstsz) -{ - BYTE ch; - BYTE* sdst = *dst + dstsz; - - while (src < end) - { - ch = *src++; - if (ch & 0x80) - { - ch &= 0x7F; - if ((*dst) + ch <= sdst) - memcpy(*dst, src, ch); - src += ch; - } - else - { - if ((*dst) + ch <= sdst) - memset(*dst, (char)*src, ch); - src++; - } - *dst += ch; - } - if (*dst != sdst) - WINE_WARN("Buffer X-flow: d(%u) instead of d(%u)\n", - *dst - (sdst - dstsz), dstsz); -} - -/****************************************************************** - * HLPFILE_EnumBTreeLeaves - * - * - */ -static void HLPFILE_EnumBTreeLeaves(const BYTE* buf, const BYTE* end, unsigned (*fn)(const BYTE*, void*), void* user) -{ - unsigned psize, pnext; - unsigned num, nlvl; - const BYTE* ptr; - - num = GET_UINT(buf, 9 + 34); - psize = GET_USHORT(buf, 9 + 4); - nlvl = GET_USHORT(buf, 9 + 32); - pnext = GET_USHORT(buf, 9 + 26); - - WINE_TRACE("BTree: #entries=%u pagSize=%u #levels=%u #pages=%u root=%u struct%16s\n", - num, psize, nlvl, GET_USHORT(buf, 9 + 30), pnext, buf + 9 + 6); - if (!num) return; - - while (--nlvl > 0) - { - ptr = (buf + 9 + 38) + pnext * psize; - WINE_TRACE("BTree: (index[%u]) unused=%u #entries=%u <%u\n", - pnext, GET_USHORT(ptr, 0), GET_USHORT(ptr, 2), GET_USHORT(ptr, 4)); - pnext = GET_USHORT(ptr, 4); - } - while (pnext != 0xFFFF) - { - const BYTE* node_page; - unsigned short limit; - - node_page = ptr = (buf + 9 + 38) + pnext * psize; - limit = GET_USHORT(ptr, 2); - WINE_TRACE("BTree: (leaf [%u]) unused=%u #entries=%u <%u >%u\n", - pnext, GET_USHORT(ptr, 0), limit, GET_USHORT(ptr, 4), GET_USHORT(ptr, 6)); - ptr += 8; - while (limit--) - ptr += (fn)(ptr, user); - pnext = GET_USHORT(node_page, 6); - } -} - -struct myfncb { - HLPFILE* hlpfile; - int i; -}; - -static unsigned myfn(const BYTE* ptr, void* user) -{ - struct myfncb* m = user; - - m->hlpfile->Context[m->i].lHash = GET_UINT(ptr, 0); - m->hlpfile->Context[m->i].offset = GET_UINT(ptr, 4); - m->i++; - return 8; -} - -/*********************************************************************** - * - * HLPFILE_GetContext - */ -static BOOL HLPFILE_GetContext(HLPFILE *hlpfile) -{ - BYTE *cbuf, *cend; - struct myfncb m; - unsigned clen; - - if (!HLPFILE_FindSubFile("|CONTEXT", &cbuf, &cend)) {WINE_WARN("context0\n"); return FALSE;} - - clen = GET_UINT(cbuf, 0x2b); - hlpfile->Context = HeapAlloc(GetProcessHeap(), 0, clen * sizeof(HLPFILE_CONTEXT)); - if (!hlpfile->Context) return FALSE; - hlpfile->wContextLen = clen; - - m.hlpfile = hlpfile; - m.i = 0; - HLPFILE_EnumBTreeLeaves(cbuf, cend, myfn, &m); - - return TRUE; -} - -/*********************************************************************** - * - * HLPFILE_GetMap - */ -static BOOL HLPFILE_GetMap(HLPFILE *hlpfile) -{ - BYTE *cbuf, *cend; - unsigned entries, i; - - if (!HLPFILE_FindSubFile("|CTXOMAP", &cbuf, &cend)) {WINE_WARN("no map section\n"); return FALSE;} - - entries = GET_USHORT(cbuf, 9); - hlpfile->Map = HeapAlloc(GetProcessHeap(), 0, entries * sizeof(HLPFILE_MAP)); - if (!hlpfile->Map) return FALSE; - hlpfile->wMapLen = entries; - for (i = 0; i < entries; i++) - { - hlpfile->Map[i].lMap = GET_UINT(cbuf+11,i*8); - hlpfile->Map[i].offset = GET_UINT(cbuf+11,i*8+4); - } - return TRUE; -} - -/****************************************************************** - * HLPFILE_DeleteLink - * - * - */ -void HLPFILE_FreeLink(HLPFILE_LINK* link) -{ - if (link && !--link->wRefCount) - HeapFree(GetProcessHeap(), 0, link); -} - -/*********************************************************************** - * - * HLPFILE_DeleteParagraph - */ -static void HLPFILE_DeleteParagraph(HLPFILE_PARAGRAPH* paragraph) -{ - HLPFILE_PARAGRAPH* next; - - while (paragraph) - { - next = paragraph->next; - - if (paragraph->cookie == para_metafile) - DeleteMetaFile(paragraph->u.gfx.u.mfp.hMF); - - HLPFILE_FreeLink(paragraph->link); - - HeapFree(GetProcessHeap(), 0, paragraph); - paragraph = next; - } -} - -/*********************************************************************** - * - * DeleteMacro - */ -static void HLPFILE_DeleteMacro(HLPFILE_MACRO* macro) -{ - HLPFILE_MACRO* next; - - while (macro) - { - next = macro->next; - HeapFree(GetProcessHeap(), 0, macro); - macro = next; - } -} - -/*********************************************************************** - * - * DeletePage - */ -static void HLPFILE_DeletePage(HLPFILE_PAGE* page) -{ - HLPFILE_PAGE* next; - - while (page) - { - next = page->next; - HLPFILE_DeleteParagraph(page->first_paragraph); - HLPFILE_DeleteMacro(page->first_macro); - HeapFree(GetProcessHeap(), 0, page); - page = next; - } -} - -/*********************************************************************** - * - * HLPFILE_FreeHlpFile - */ -void HLPFILE_FreeHlpFile(HLPFILE* hlpfile) -{ - unsigned i; - - if (!hlpfile || --hlpfile->wRefCount > 0) return; - - if (hlpfile->next) hlpfile->next->prev = hlpfile->prev; - if (hlpfile->prev) hlpfile->prev->next = hlpfile->next; - else first_hlpfile = hlpfile->next; - - if (hlpfile->numFonts) - { - for (i = 0; i < hlpfile->numFonts; i++) - { - DeleteObject(hlpfile->fonts[i].hFont); - } - HeapFree(GetProcessHeap(), 0, hlpfile->fonts); - } - - if (hlpfile->numBmps) - { - for (i = 0; i < hlpfile->numBmps; i++) - { - DeleteObject(hlpfile->bmps[i]); - } - HeapFree(GetProcessHeap(), 0, hlpfile->bmps); - } - - HLPFILE_DeletePage(hlpfile->first_page); - HLPFILE_DeleteMacro(hlpfile->first_macro); - - if (hlpfile->numWindows) HeapFree(GetProcessHeap(), 0, hlpfile->windows); - HeapFree(GetProcessHeap(), 0, hlpfile->Context); - HeapFree(GetProcessHeap(), 0, hlpfile->Map); - HeapFree(GetProcessHeap(), 0, hlpfile->lpszTitle); - HeapFree(GetProcessHeap(), 0, hlpfile->lpszCopyright); - HeapFree(GetProcessHeap(), 0, hlpfile); -} +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * 2002 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winhelp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winhelp); + +static inline unsigned short GET_USHORT(const BYTE* buffer, unsigned i) +{ + return (BYTE)buffer[i] + 0x100 * (BYTE)buffer[i + 1]; +} + +static inline short GET_SHORT(const BYTE* buffer, unsigned i) +{ + return (BYTE)buffer[i] + 0x100 * (signed char)buffer[i+1]; +} + +static inline unsigned GET_UINT(const BYTE* buffer, unsigned i) +{ + return GET_USHORT(buffer, i) + 0x10000 * GET_USHORT(buffer, i + 2); +} + +static HLPFILE *first_hlpfile = 0; +static BYTE *file_buffer; + +static struct +{ + UINT num; + unsigned* offsets; + char* buffer; +} phrases; + +static struct +{ + BYTE** map; + BYTE* end; + UINT wMapLen; +} topic; + +static struct +{ + UINT wFont; + UINT wIndent; + UINT wHSpace; + UINT wVSpace; + HLPFILE_LINK* link; +} attributes; + +static BOOL HLPFILE_DoReadHlpFile(HLPFILE*, LPCSTR); +static BOOL HLPFILE_ReadFileToBuffer(HFILE); +static BOOL HLPFILE_FindSubFile(LPCSTR name, BYTE**, BYTE**); +static BOOL HLPFILE_SystemCommands(HLPFILE*); +static INT HLPFILE_UncompressedLZ77_Size(BYTE *ptr, BYTE *end); +static BYTE* HLPFILE_UncompressLZ77(BYTE *ptr, BYTE *end, BYTE *newptr); +static BOOL HLPFILE_UncompressLZ77_Phrases(HLPFILE*); +static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE*); +static BOOL HLPFILE_Uncompress_Topic(HLPFILE*); +static BOOL HLPFILE_GetContext(HLPFILE*); +static BOOL HLPFILE_GetMap(HLPFILE*); +static BOOL HLPFILE_AddPage(HLPFILE*, BYTE*, BYTE*, unsigned); +static BOOL HLPFILE_AddParagraph(HLPFILE*, BYTE *, BYTE*, unsigned*); +static void HLPFILE_Uncompress2(const BYTE*, const BYTE*, BYTE*, const BYTE*); +static BOOL HLPFILE_Uncompress3(char*, const char*, const BYTE*, const BYTE*); +static void HLPFILE_UncompressRLE(const BYTE* src, const BYTE* end, BYTE** dst, unsigned dstsz); +static BOOL HLPFILE_ReadFont(HLPFILE* hlpfile); + +#if 0 +/*********************************************************************** + * + * HLPFILE_PageByNumber + */ +static HLPFILE_PAGE *HLPFILE_PageByNumber(LPCSTR lpszPath, UINT wNum) +{ + HLPFILE_PAGE *page; + HLPFILE *hlpfile = HLPFILE_ReadHlpFile(lpszPath); + + if (!hlpfile) return 0; + + WINE_TRACE("[%s/%u]\n", lpszPath, wNum); + + for (page = hlpfile->first_page; page && wNum; page = page->next) wNum--; + + /* HLPFILE_FreeHlpFile(lpszPath); */ + + return page; +} +#endif + +/* FIXME: + * this finds the page containing the offset. The offset can either + * refer to the top of the page (offset == page->offset), or + * to some paragraph inside the page... + * As of today, we only return the page... we should also return + * a paragraph, and then, while opening a new page, compute the + * y-offset of the paragraph to be shown and scroll the window + * accordinly + */ +/****************************************************************** + * HLPFILE_PageByOffset + * + * + */ +HLPFILE_PAGE *HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset) +{ + HLPFILE_PAGE* page; + HLPFILE_PAGE* found; + + if (!hlpfile) return 0; + + WINE_TRACE("<%s>[%x]\n", hlpfile->lpszPath, offset); + + if (offset == 0xFFFFFFFF) return NULL; + page = NULL; + + for (found = NULL, page = hlpfile->first_page; page; page = page->next) + { + if (page->offset <= offset && (!found || found->offset < page->offset)) + found = page; + } + if (!found) + WINE_ERR("Page of offset %u not found in file %s\n", + offset, hlpfile->lpszPath); + return found; +} + +/*********************************************************************** + * + * HLPFILE_HlpFilePageByHash + */ +HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash) +{ + int i; + + if (!hlpfile) return 0; + + WINE_TRACE("<%s>[%x]\n", hlpfile->lpszPath, lHash); + + for (i = 0; i < hlpfile->wContextLen; i++) + { + if (hlpfile->Context[i].lHash == lHash) + return HLPFILE_PageByOffset(hlpfile, hlpfile->Context[i].offset); + } + + WINE_ERR("Page of hash %x not found in file %s\n", lHash, hlpfile->lpszPath); + return NULL; +} + +/*********************************************************************** + * + * HLPFILE_PageByMap + */ +HLPFILE_PAGE *HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap) +{ + int i; + + if (!hlpfile) return 0; + + WINE_TRACE("<%s>[%x]\n", hlpfile->lpszPath, lMap); + + for (i = 0; i < hlpfile->wMapLen; i++) + { + if (hlpfile->Map[i].lMap == lMap) + return HLPFILE_PageByOffset(hlpfile, hlpfile->Map[i].offset); + } + + WINE_ERR("Page of Map %x not found in file %s\n", lMap, hlpfile->lpszPath); + return NULL; +} + +/*********************************************************************** + * + * HLPFILE_Contents + */ +HLPFILE_PAGE* HLPFILE_Contents(HLPFILE *hlpfile) +{ + HLPFILE_PAGE* page = NULL; + + if (!hlpfile) return NULL; + + page = HLPFILE_PageByOffset(hlpfile, hlpfile->contents_start); + if (!page) page = hlpfile->first_page; + return page; +} + +/*********************************************************************** + * + * HLPFILE_Hash + */ +LONG HLPFILE_Hash(LPCSTR lpszContext) +{ + LONG lHash = 0; + CHAR c; + + while ((c = *lpszContext++)) + { + CHAR x = 0; + if (c >= 'A' && c <= 'Z') x = c - 'A' + 17; + if (c >= 'a' && c <= 'z') x = c - 'a' + 17; + if (c >= '1' && c <= '9') x = c - '0'; + if (c == '0') x = 10; + if (c == '.') x = 12; + if (c == '_') x = 13; + if (x) lHash = lHash * 43 + x; + } + return lHash; +} + +/*********************************************************************** + * + * HLPFILE_ReadHlpFile + */ +HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath) +{ + HLPFILE* hlpfile; + + for (hlpfile = first_hlpfile; hlpfile; hlpfile = hlpfile->next) + { + if (!strcmp(lpszPath, hlpfile->lpszPath)) + { + hlpfile->wRefCount++; + return hlpfile; + } + } + + hlpfile = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE) + lstrlen(lpszPath) + 1); + if (!hlpfile) return 0; + + hlpfile->lpszPath = (char*)hlpfile + sizeof(HLPFILE); + hlpfile->lpszTitle = NULL; + hlpfile->lpszCopyright = NULL; + hlpfile->first_page = NULL; + hlpfile->first_macro = NULL; + hlpfile->wContextLen = 0; + hlpfile->Context = NULL; + hlpfile->wMapLen = 0; + hlpfile->Map = NULL; + hlpfile->contents_start = 0xFFFFFFFF; + hlpfile->prev = NULL; + hlpfile->next = first_hlpfile; + hlpfile->wRefCount = 1; + + hlpfile->numBmps = 0; + hlpfile->bmps = NULL; + + hlpfile->numFonts = 0; + hlpfile->fonts = NULL; + + hlpfile->numWindows = 0; + hlpfile->windows = NULL; + + strcpy(hlpfile->lpszPath, lpszPath); + + first_hlpfile = hlpfile; + if (hlpfile->next) hlpfile->next->prev = hlpfile; + + phrases.offsets = NULL; + phrases.buffer = NULL; + topic.map = NULL; + topic.end = NULL; + file_buffer = NULL; + + if (!HLPFILE_DoReadHlpFile(hlpfile, lpszPath)) + { + HLPFILE_FreeHlpFile(hlpfile); + hlpfile = 0; + } + + HeapFree(GetProcessHeap(), 0, phrases.offsets); + HeapFree(GetProcessHeap(), 0, phrases.buffer); + HeapFree(GetProcessHeap(), 0, topic.map); + HeapFree(GetProcessHeap(), 0, file_buffer); + + return hlpfile; +} + +/*********************************************************************** + * + * HLPFILE_DoReadHlpFile + */ +static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath) +{ + BOOL ret; + HFILE hFile; + OFSTRUCT ofs; + BYTE* buf; + DWORD ref = 0x0C; + unsigned index, old_index, offset, len, offs; + + hFile = OpenFile(lpszPath, &ofs, OF_READ); + if (hFile == HFILE_ERROR) return FALSE; + + ret = HLPFILE_ReadFileToBuffer(hFile); + _lclose(hFile); + if (!ret) return FALSE; + + if (!HLPFILE_SystemCommands(hlpfile)) return FALSE; + + /* load phrases support */ + if (!HLPFILE_UncompressLZ77_Phrases(hlpfile)) + HLPFILE_Uncompress_Phrases40(hlpfile); + + if (!HLPFILE_Uncompress_Topic(hlpfile)) return FALSE; + if (!HLPFILE_ReadFont(hlpfile)) return FALSE; + + buf = topic.map[0]; + old_index = -1; + offs = 0; + do + { + BYTE* end; + + /* FIXME this depends on the blocksize, can be 2k in some cases */ + index = (ref - 0x0C) >> 14; + offset = (ref - 0x0C) & 0x3fff; + + WINE_TRACE("ref=%08x => [%u/%u]\n", ref, index, offset); + + if (index >= topic.wMapLen) {WINE_WARN("maplen\n"); break;} + buf = topic.map[index] + offset; + if (buf + 0x15 >= topic.end) {WINE_WARN("extra\n"); break;} + end = min(buf + GET_UINT(buf, 0), topic.end); + if (index != old_index) {offs = 0; old_index = index;} + + switch (buf[0x14]) + { + case 0x02: + if (!HLPFILE_AddPage(hlpfile, buf, end, index * 0x8000L + offs)) return FALSE; + break; + + case 0x20: + if (!HLPFILE_AddParagraph(hlpfile, buf, end, &len)) return FALSE; + offs += len; + break; + + case 0x23: + if (!HLPFILE_AddParagraph(hlpfile, buf, end, &len)) return FALSE; + offs += len; + break; + + default: + WINE_ERR("buf[0x14] = %x\n", buf[0x14]); + } + + ref = GET_UINT(buf, 0xc); + } while (ref != 0xffffffff); + + HLPFILE_GetMap(hlpfile); + return HLPFILE_GetContext(hlpfile); +} + +/*********************************************************************** + * + * HLPFILE_AddPage + */ +static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned offset) +{ + HLPFILE_PAGE* page; + BYTE* title; + UINT titlesize; + char* ptr; + HLPFILE_MACRO*macro; + + if (buf + 0x31 > end) {WINE_WARN("page1\n"); return FALSE;}; + title = buf + GET_UINT(buf, 0x10); + if (title > end) {WINE_WARN("page2\n"); return FALSE;}; + + titlesize = GET_UINT(buf, 4); + page = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_PAGE) + titlesize + 1); + if (!page) return FALSE; + page->lpszTitle = (char*)page + sizeof(HLPFILE_PAGE); + + if (hlpfile->hasPhrases) + { + HLPFILE_Uncompress2(title, end, (BYTE*)page->lpszTitle, (BYTE*)page->lpszTitle + titlesize); + } + else + { + if (GET_UINT(buf, 0x4) > GET_UINT(buf, 0) - GET_UINT(buf, 0x10)) + { + /* need to decompress */ + HLPFILE_Uncompress3(page->lpszTitle, page->lpszTitle + titlesize, + title, end); + } + else + { + memcpy(page->lpszTitle, title, titlesize); + } + } + + page->lpszTitle[titlesize] = '\0'; + + if (hlpfile->first_page) + { + HLPFILE_PAGE *p; + + for (p = hlpfile->first_page; p->next; p = p->next); + page->prev = p; + p->next = page; + } + else + { + hlpfile->first_page = page; + page->prev = NULL; + } + + page->file = hlpfile; + page->next = NULL; + page->first_paragraph = NULL; + page->first_macro = NULL; + page->wNumber = GET_UINT(buf, 0x21); + page->offset = offset; + + page->browse_bwd = GET_UINT(buf, 0x19); + page->browse_fwd = GET_UINT(buf, 0x1D); + + WINE_TRACE("Added page[%d]: title='%s' %08x << %08x >> %08x\n", + page->wNumber, page->lpszTitle, + page->browse_bwd, page->offset, page->browse_fwd); + + memset(&attributes, 0, sizeof(attributes)); + + /* now load macros */ + ptr = page->lpszTitle + strlen(page->lpszTitle) + 1; + while (ptr < page->lpszTitle + titlesize) + { + unsigned len = strlen(ptr); + char* macro_str; + + WINE_TRACE("macro: %s\n", ptr); + macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + len + 1); + macro->lpszMacro = macro_str = (char*)(macro + 1); + memcpy(macro_str, ptr, len + 1); + /* FIXME: shall we really link macro in reverse order ?? + * may produce strange results when played at page opening + */ + macro->next = page->first_macro; + page->first_macro = macro; + ptr += len + 1; + } + + return TRUE; +} + +static long fetch_long(BYTE** ptr) +{ + long ret; + + if (*(*ptr) & 1) + { + ret = (*(unsigned long*)(*ptr) - 0x80000000L) / 2; + (*ptr) += 4; + } + else + { + ret = (*(unsigned short*)(*ptr) - 0x8000) / 2; + (*ptr) += 2; + } + + return ret; +} + +static unsigned long fetch_ulong(BYTE** ptr) +{ + unsigned long ret; + + if (*(*ptr) & 1) + { + ret = *(unsigned long*)(*ptr) / 2; + (*ptr) += 4; + } + else + { + ret = *(unsigned short*)(*ptr) / 2; + (*ptr) += 2; + } + return ret; +} + +static short fetch_short(BYTE** ptr) +{ + short ret; + + if (*(*ptr) & 1) + { + ret = (*(unsigned short*)(*ptr) - 0x8000) / 2; + (*ptr) += 2; + } + else + { + ret = (*(unsigned char*)(*ptr) - 0x80) / 2; + (*ptr)++; + } + return ret; +} + +static unsigned short fetch_ushort(BYTE** ptr) +{ + unsigned short ret; + + if (*(*ptr) & 1) + { + ret = *(unsigned short*)(*ptr) / 2; + (*ptr) += 2; + } + else + { + ret = *(unsigned char*)(*ptr) / 2; + (*ptr)++; + } + return ret; +} + +/****************************************************************** + * HLPFILE_DecompressGfx + * + * Decompress the data part of a bitmap or a metafile + */ +static BYTE* HLPFILE_DecompressGfx(BYTE* src, unsigned csz, unsigned sz, BYTE packing) +{ + BYTE* dst; + BYTE* tmp; + BYTE* tmp2; + unsigned sz77; + + WINE_TRACE("Unpacking (%d) from %u bytes to %u bytes\n", packing, csz, sz); + + switch (packing) + { + case 0: /* uncompressed */ + if (sz != csz) + WINE_WARN("Bogus gfx sizes (uncompressed): %u / %u\n", sz, csz); + dst = src; + break; + case 1: /* RunLen */ + tmp = dst = HeapAlloc(GetProcessHeap(), 0, sz); + if (!dst) return NULL; + HLPFILE_UncompressRLE(src, src + csz, &tmp, sz); + if (tmp - dst != sz) + WINE_WARN("Bogus gfx sizes (RunLen): %u/%u\n", tmp - dst, sz); + break; + case 2: /* LZ77 */ + sz77 = HLPFILE_UncompressedLZ77_Size(src, src + csz); + dst = HeapAlloc(GetProcessHeap(), 0, sz77); + if (!dst) return NULL; + HLPFILE_UncompressLZ77(src, src + csz, dst); + if (sz77 != sz) + WINE_WARN("Bogus gfx sizes (LZ77): %u / %u\n", sz77, sz); + break; + case 3: /* LZ77 then RLE */ + sz77 = HLPFILE_UncompressedLZ77_Size(src, src + csz); + tmp = HeapAlloc(GetProcessHeap(), 0, sz77); + if (!tmp) return FALSE; + HLPFILE_UncompressLZ77(src, src + csz, tmp); + dst = tmp2 = HeapAlloc(GetProcessHeap(), 0, sz); + if (!dst) return FALSE; + HLPFILE_UncompressRLE(tmp, tmp + sz77, &tmp2, sz); + if (tmp2 - dst != sz) + WINE_WARN("Bogus gfx sizes (LZ77+RunLen): %u / %u\n", tmp2 - dst, sz); + HeapFree(GetProcessHeap(), 0, tmp); + break; + default: + WINE_FIXME("Unsupported packing %u\n", packing); + return NULL; + } + return dst; +} + +/****************************************************************** + * HLPFILE_LoadBitmap + * + * + */ +static BOOL HLPFILE_LoadBitmap(BYTE* beg, BYTE type, BYTE pack, + HLPFILE_PARAGRAPH* paragraph) +{ + BYTE* ptr; + BYTE* pict_beg; + BITMAPINFO* bi; + unsigned long off, csz; + HDC hdc; + + bi = HeapAlloc(GetProcessHeap(), 0, sizeof(*bi)); + if (!bi) return FALSE; + + ptr = beg + 2; /* for type and pack */ + + bi->bmiHeader.biSize = sizeof(bi->bmiHeader); + bi->bmiHeader.biXPelsPerMeter = fetch_ulong(&ptr); + bi->bmiHeader.biYPelsPerMeter = fetch_ulong(&ptr); + bi->bmiHeader.biPlanes = fetch_ushort(&ptr); + bi->bmiHeader.biBitCount = fetch_ushort(&ptr); + bi->bmiHeader.biWidth = fetch_ulong(&ptr); + bi->bmiHeader.biHeight = fetch_ulong(&ptr); + bi->bmiHeader.biClrUsed = fetch_ulong(&ptr); + bi->bmiHeader.biClrImportant = fetch_ulong(&ptr); + bi->bmiHeader.biCompression = BI_RGB; + if (bi->bmiHeader.biBitCount > 32) WINE_FIXME("Unknown bit count %u\n", bi->bmiHeader.biBitCount); + if (bi->bmiHeader.biPlanes != 1) WINE_FIXME("Unsupported planes %u\n", bi->bmiHeader.biPlanes); + bi->bmiHeader.biSizeImage = (((bi->bmiHeader.biWidth * bi->bmiHeader.biBitCount + 31) & ~31) / 8) * bi->bmiHeader.biHeight; + WINE_TRACE("planes=%d bc=%d size=(%d,%d)\n", + bi->bmiHeader.biPlanes, bi->bmiHeader.biBitCount, + bi->bmiHeader.biWidth, bi->bmiHeader.biHeight); + + csz = fetch_ulong(&ptr); + fetch_ulong(&ptr); /* hotspot size */ + + off = GET_UINT(ptr, 0); ptr += 4; + /* GET_UINT(ptr, 0); hotspot offset */ ptr += 4; + + /* now read palette info */ + if (type == 0x06) + { + unsigned nc = bi->bmiHeader.biClrUsed; + unsigned i; + + /* not quite right, especially for bitfields type of compression */ + if (!nc && bi->bmiHeader.biBitCount <= 8) + nc = 1 << bi->bmiHeader.biBitCount; + + bi = HeapReAlloc(GetProcessHeap(), 0, bi, sizeof(*bi) + nc * sizeof(RGBQUAD)); + if (!bi) return FALSE; + for (i = 0; i < nc; i++) + { + bi->bmiColors[i].rgbBlue = ptr[0]; + bi->bmiColors[i].rgbGreen = ptr[1]; + bi->bmiColors[i].rgbRed = ptr[2]; + bi->bmiColors[i].rgbReserved = 0; + ptr += 4; + } + } + pict_beg = HLPFILE_DecompressGfx(beg + off, csz, bi->bmiHeader.biSizeImage, pack); + + paragraph->u.gfx.u.bmp.hBitmap = CreateDIBitmap(hdc = GetDC(0), &bi->bmiHeader, + CBM_INIT, pict_beg, + bi, DIB_RGB_COLORS); + ReleaseDC(0, hdc); + if (!paragraph->u.gfx.u.bmp.hBitmap) + WINE_ERR("Couldn't create bitmap\n"); + + HeapFree(GetProcessHeap(), 0, bi); + if (pict_beg != beg + off) HeapFree(GetProcessHeap(), 0, pict_beg); + + return TRUE; +} + +/****************************************************************** + * HLPFILE_LoadMetaFile + * + * + */ +static BOOL HLPFILE_LoadMetaFile(BYTE* beg, BYTE pack, HLPFILE_PARAGRAPH* paragraph) +{ + BYTE* ptr; + unsigned long size, csize; + unsigned long off, hsoff; + BYTE* bits; + LPMETAFILEPICT lpmfp; + + WINE_TRACE("Loading metafile\n"); + + ptr = beg + 2; /* for type and pack */ + + lpmfp = ¶graph->u.gfx.u.mfp; + lpmfp->mm = fetch_ushort(&ptr); /* mapping mode */ + + lpmfp->xExt = GET_USHORT(ptr, 0); + lpmfp->yExt = GET_USHORT(ptr, 2); + ptr += 4; + + size = fetch_ulong(&ptr); /* decompressed size */ + csize = fetch_ulong(&ptr); /* compressed size */ + fetch_ulong(&ptr); /* hotspot size */ + off = GET_UINT(ptr, 0); + hsoff = GET_UINT(ptr, 4); + ptr += 8; + + WINE_TRACE("sz=%lu csz=%lu (%d,%d) offs=%lu/%u,%lu\n", + size, csize, lpmfp->xExt, lpmfp->yExt, off, ptr - beg, hsoff); + + bits = HLPFILE_DecompressGfx(beg + off, csize, size, pack); + if (!bits) return FALSE; + + paragraph->cookie = para_metafile; + + lpmfp->hMF = SetMetaFileBitsEx(size, bits); + + if (!lpmfp->hMF) + WINE_FIXME("Couldn't load metafile\n"); + + if (bits != beg + off) HeapFree(GetProcessHeap(), 0, bits); + + return TRUE; +} + +/****************************************************************** + * HLPFILE_LoadGfxByAddr + * + * + */ +static BOOL HLPFILE_LoadGfxByAddr(HLPFILE *hlpfile, BYTE* ref, + unsigned long size, + HLPFILE_PARAGRAPH* paragraph) +{ + unsigned i, numpict; + + numpict = GET_USHORT(ref, 2); + WINE_TRACE("Got picture magic=%04x #=%d\n", + GET_USHORT(ref, 0), numpict); + + for (i = 0; i < numpict; i++) + { + BYTE* beg; + BYTE* ptr; + BYTE type, pack; + + WINE_TRACE("Offset[%d] = %x\n", i, GET_UINT(ref, (1 + i) * 4)); + beg = ptr = ref + GET_UINT(ref, (1 + i) * 4); + + type = *ptr++; + pack = *ptr++; + + switch (type) + { + case 5: /* device dependent bmp */ + case 6: /* device independent bmp */ + HLPFILE_LoadBitmap(beg, type, pack, paragraph); + break; + case 8: + HLPFILE_LoadMetaFile(beg, pack, paragraph); + break; + default: WINE_FIXME("Unknown type %u\n", type); return FALSE; + } + + /* FIXME: hotspots */ + + /* FIXME: implement support for multiple picture format */ + if (numpict != 1) WINE_FIXME("Supporting only one bitmap format per logical bitmap (for now). Using first format\n"); + break; + } + return TRUE; +} + +/****************************************************************** + * HLPFILE_LoadGfxByIndex + * + * + */ +static BOOL HLPFILE_LoadGfxByIndex(HLPFILE *hlpfile, unsigned index, + HLPFILE_PARAGRAPH* paragraph) +{ + char tmp[16]; + BYTE *ref, *end; + BOOL ret; + + WINE_TRACE("Loading picture #%d\n", index); + + if (index < hlpfile->numBmps && hlpfile->bmps[index] != NULL) + { + paragraph->u.gfx.u.bmp.hBitmap = hlpfile->bmps[index]; + return TRUE; + } + + sprintf(tmp, "|bm%u", index); + + if (!HLPFILE_FindSubFile(tmp, &ref, &end)) {WINE_WARN("no sub file\n"); return FALSE;} + + ref += 9; + + ret = HLPFILE_LoadGfxByAddr(hlpfile, ref, end - ref, paragraph); + + /* cache bitmap */ + if (ret && paragraph->cookie == para_bitmap) + { + if (index >= hlpfile->numBmps) + { + hlpfile->numBmps = index + 1; + if (hlpfile->bmps) + hlpfile->bmps = HeapReAlloc(GetProcessHeap(), 0, hlpfile->bmps, + hlpfile->numBmps * sizeof(hlpfile->bmps[0])); + else + hlpfile->bmps = HeapAlloc(GetProcessHeap(), 0, + hlpfile->numBmps * sizeof(hlpfile->bmps[0])); + + } + hlpfile->bmps[index] = paragraph->u.gfx.u.bmp.hBitmap; + } + return ret; +} + +/****************************************************************** + * HLPFILE_AllocLink + * + * + */ +static HLPFILE_LINK* HLPFILE_AllocLink(int cookie, const char* str, LONG hash, + BOOL clrChange, unsigned wnd) +{ + HLPFILE_LINK* link; + char* link_str; + + /* FIXME: should build a string table for the attributes.link.lpszPath + * they are reallocated for each link + */ + link = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_LINK) + strlen(str) + 1); + if (!link) return NULL; + + link->cookie = cookie; + link->lpszString = link_str = (char*)link + sizeof(HLPFILE_LINK); + strcpy(link_str, str); + link->lHash = hash; + link->bClrChange = clrChange ? 1 : 0; + link->window = wnd; + link->wRefCount = 1; + + WINE_TRACE("Link[%d] to %s@%08x:%d\n", + link->cookie, link->lpszString, + link->lHash, link->window); + return link; +} + +/*********************************************************************** + * + * HLPFILE_AddParagraph + */ +static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned* len) +{ + HLPFILE_PAGE *page; + HLPFILE_PARAGRAPH *paragraph, **paragraphptr; + UINT textsize; + BYTE *format, *format_end; + char *text, *text_end; + long size; + unsigned short bits; + unsigned nc, ncol = 1; + + if (!hlpfile->first_page) {WINE_WARN("no page\n"); return FALSE;}; + + for (page = hlpfile->first_page; page->next; page = page->next) /* Nothing */; + for (paragraphptr = &page->first_paragraph; *paragraphptr; + paragraphptr = &(*paragraphptr)->next) /* Nothing */; + + if (buf + 0x19 > end) {WINE_WARN("header too small\n"); return FALSE;}; + + size = GET_UINT(buf, 0x4); + text = HeapAlloc(GetProcessHeap(), 0, size); + if (!text) return FALSE; + if (hlpfile->hasPhrases) + { + HLPFILE_Uncompress2(buf + GET_UINT(buf, 0x10), end, (BYTE*)text, (BYTE*)text + size); + } + else + { + if (GET_UINT(buf, 0x4) > GET_UINT(buf, 0) - GET_UINT(buf, 0x10)) + { + /* block is compressed */ + HLPFILE_Uncompress3(text, text + size, buf + GET_UINT(buf, 0x10), end); + } + else + { + text = (char*)buf + GET_UINT(buf, 0x10); + } + } + text_end = text + size; + + format = buf + 0x15; + format_end = buf + GET_UINT(buf, 0x10); + + fetch_long(&format); + *len = fetch_ushort(&format); + + if (buf[0x14] == 0x23) + { + char type; + + ncol = *format++; + + WINE_TRACE("#cols %u\n", ncol); + type = *format++; + if (type == 0 || type == 2) + format += 2; + format += ncol * 4; + } + + for (nc = 0; nc < ncol; nc++) + { + WINE_TRACE("looking for format at offset %u for column %d\n", format - (buf + 0x15), nc); + if (buf[0x14] == 0x23) + format += 5; + format += 4; + bits = GET_USHORT(format, 0); format += 2; + if (bits & 0x0001) fetch_long(&format); + if (bits & 0x0002) fetch_short(&format); + if (bits & 0x0004) fetch_short(&format); + if (bits & 0x0008) fetch_short(&format); + if (bits & 0x0010) fetch_short(&format); + if (bits & 0x0020) fetch_short(&format); + if (bits & 0x0040) fetch_short(&format); + if (bits & 0x0100) format += 3; + if (bits & 0x0200) + { + int ntab = fetch_short(&format); + unsigned short ts; + + while (ntab-- > 0) + { + ts = fetch_ushort(&format); + if (ts & 0x4000) fetch_ushort(&format); + } + } + /* 0x0400, 0x0800 and 0x1000 don't need space */ + if ((bits & 0xE080) != 0) + WINE_FIXME("Unsupported bits %04x, potential trouble ahead\n", bits); + + while (text < text_end && format < format_end) + { + //WINE_TRACE("Got text: %s (%p/%p - %p/%p)\n", wine_dbgstr_a(text), text, text_end, format, format_end); + textsize = strlen(text) + 1; + if (textsize > 1) + { + paragraph = HeapAlloc(GetProcessHeap(), 0, + sizeof(HLPFILE_PARAGRAPH) + textsize); + if (!paragraph) return FALSE; + *paragraphptr = paragraph; + paragraphptr = ¶graph->next; + + paragraph->next = NULL; + paragraph->link = attributes.link; + if (paragraph->link) paragraph->link->wRefCount++; + paragraph->cookie = para_normal_text; + paragraph->u.text.wFont = attributes.wFont; + paragraph->u.text.wVSpace = attributes.wVSpace; + paragraph->u.text.wHSpace = attributes.wHSpace; + paragraph->u.text.wIndent = attributes.wIndent; + paragraph->u.text.lpszText = (char*)paragraph + sizeof(HLPFILE_PARAGRAPH); + strcpy(paragraph->u.text.lpszText, text); + + attributes.wVSpace = 0; + attributes.wHSpace = 0; + } + /* else: null text, keep on storing attributes */ + text += textsize; + + if (*format == 0xff) + { + format++; + break; + } + + WINE_TRACE("format=%02x\n", *format); + switch (*format) + { + case 0x20: + WINE_FIXME("NIY20\n"); + format += 5; + break; + + case 0x21: + WINE_FIXME("NIY21\n"); + format += 3; + break; + + case 0x80: + attributes.wFont = GET_USHORT(format, 1); + WINE_TRACE("Changing font to %d\n", attributes.wFont); + format += 3; + break; + + case 0x81: + attributes.wVSpace++; + format += 1; + break; + + case 0x82: + attributes.wVSpace++; + attributes.wIndent = 0; + format += 1; + break; + + case 0x83: + attributes.wIndent++; + format += 1; + break; + +#if 0 + case 0x84: + format += 3; + break; +#endif + + case 0x86: + case 0x87: + case 0x88: + { + BYTE pos = (*format - 0x86); + BYTE type = format[1]; + long size; + + format += 2; + size = fetch_long(&format); + + paragraph = HeapAlloc(GetProcessHeap(), 0, + sizeof(HLPFILE_PARAGRAPH) + textsize); + if (!paragraph) return FALSE; + *paragraphptr = paragraph; + paragraphptr = ¶graph->next; + + paragraph->next = NULL; + paragraph->link = attributes.link; + if (paragraph->link) paragraph->link->wRefCount++; + paragraph->cookie = para_bitmap; + paragraph->u.gfx.pos = pos; + switch (type) + { + case 0x22: + fetch_ushort(&format); /* hot spot */ + /* fall thru */ + case 0x03: + switch (GET_SHORT(format, 0)) + { + case 0: + HLPFILE_LoadGfxByIndex(hlpfile, GET_SHORT(format, 2), + paragraph); + break; + case 1: + WINE_FIXME("does it work ??? %x<%lu>#%u\n", + GET_SHORT(format, 0), + size, GET_SHORT(format, 2)); + HLPFILE_LoadGfxByAddr(hlpfile, format + 2, size - 4, + paragraph); + break; + default: + WINE_FIXME("??? %u\n", GET_SHORT(format, 0)); + break; + } + break; + case 0x05: + WINE_FIXME("Got an embedded element %s\n", format + 6); + break; + default: + WINE_FIXME("Got a type %d picture\n", type); + break; + } + if (attributes.wVSpace) paragraph->u.gfx.pos |= 0x8000; + + format += size; + } + break; + + case 0x89: + HLPFILE_FreeLink(attributes.link); + attributes.link = NULL; + format += 1; + break; + + case 0x8B: + case 0x8C: + WINE_FIXME("NIY non-break space/hyphen\n"); + format += 1; + break; + +#if 0 + case 0xA9: + format += 2; + break; +#endif + + case 0xC8: + case 0xCC: + WINE_TRACE("macro => %s\n", format + 3); + HLPFILE_FreeLink(attributes.link); + attributes.link = HLPFILE_AllocLink(hlp_link_macro, (const char*)format + 3, + 0, !(*format & 4), -1); + format += 3 + GET_USHORT(format, 1); + break; + + case 0xE0: + case 0xE1: + WINE_WARN("jump topic 1 => %u\n", GET_UINT(format, 1)); + format += 5; + break; + + case 0xE2: + case 0xE3: + case 0xE6: + case 0xE7: + HLPFILE_FreeLink(attributes.link); + attributes.link = HLPFILE_AllocLink((*format & 1) ? hlp_link_link : hlp_link_popup, + hlpfile->lpszPath, + GET_UINT(format, 1), + !(*format & 4), -1); + format += 5; + break; + + case 0xEA: + case 0xEB: + case 0xEE: + case 0xEF: + { + char* ptr = (char*) format + 8; + BYTE type = format[3]; + int wnd = -1; + char* str; + + if (type == 1) wnd = *ptr++; + if (type == 4 || type == 6) + { + str = ptr; + ptr += strlen(ptr) + 1; + } + else + str = hlpfile->lpszPath; + if (type == 6) + { + for (wnd = hlpfile->numWindows - 1; wnd >= 0; wnd--) + { + if (!strcmp(ptr, hlpfile->windows[wnd].name)) break; + } + if (wnd == -1) + WINE_WARN("Couldn't find window info for %s\n", ptr); + } + HLPFILE_FreeLink(attributes.link); + attributes.link = HLPFILE_AllocLink((*format & 4) ? hlp_link_link : hlp_link_popup, + str, GET_UINT(format, 4), + !(*format & 1), wnd); + } + format += 3 + GET_USHORT(format, 1); + break; + + default: + WINE_WARN("format %02x\n", *format); + format++; + } + } + } + if (text_end != (char*)buf + GET_UINT(buf, 0x10) + size) + HeapFree(GetProcessHeap(), 0, text_end - size); + return TRUE; +} + +/****************************************************************** + * HLPFILE_ReadFont + * + * + */ +static BOOL HLPFILE_ReadFont(HLPFILE* hlpfile) +{ + BYTE *ref, *end; + unsigned i, len, idx; + unsigned face_num, dscr_num, face_offset, dscr_offset; + BYTE flag, family; + + if (!HLPFILE_FindSubFile("|FONT", &ref, &end)) + { + WINE_WARN("no subfile FONT\n"); + hlpfile->numFonts = 0; + hlpfile->fonts = NULL; + return FALSE; + } + + ref += 9; + + face_num = GET_USHORT(ref, 0); + dscr_num = GET_USHORT(ref, 2); + face_offset = GET_USHORT(ref, 4); + dscr_offset = GET_USHORT(ref, 6); + + WINE_TRACE("Got NumFacenames=%u@%u NumDesc=%u@%u\n", + face_num, face_offset, dscr_num, dscr_offset); + + hlpfile->numFonts = dscr_num; + hlpfile->fonts = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_FONT) * dscr_num); + + len = (dscr_offset - face_offset) / face_num; +/* EPP for (i = face_offset; i < dscr_offset; i += len) */ +/* EPP WINE_FIXME("[%d]: %*s\n", i / len, len, ref + i); */ + for (i = 0; i < dscr_num; i++) + { + flag = ref[dscr_offset + i * 11 + 0]; + family = ref[dscr_offset + i * 11 + 2]; + + hlpfile->fonts[i].LogFont.lfHeight = -ref[dscr_offset + i * 11 + 1] / 2; + hlpfile->fonts[i].LogFont.lfWidth = 0; + hlpfile->fonts[i].LogFont.lfEscapement = 0; + hlpfile->fonts[i].LogFont.lfOrientation = 0; + hlpfile->fonts[i].LogFont.lfWeight = (flag & 1) ? 700 : 400; + hlpfile->fonts[i].LogFont.lfItalic = (flag & 2) ? TRUE : FALSE; + hlpfile->fonts[i].LogFont.lfUnderline = (flag & 4) ? TRUE : FALSE; + hlpfile->fonts[i].LogFont.lfStrikeOut = (flag & 8) ? TRUE : FALSE; + hlpfile->fonts[i].LogFont.lfCharSet = ANSI_CHARSET; + hlpfile->fonts[i].LogFont.lfOutPrecision = OUT_DEFAULT_PRECIS; + hlpfile->fonts[i].LogFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; + hlpfile->fonts[i].LogFont.lfQuality = DEFAULT_QUALITY; + hlpfile->fonts[i].LogFont.lfPitchAndFamily = DEFAULT_PITCH; + + switch (family) + { + case 0x01: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_MODERN; break; + case 0x02: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_ROMAN; break; + case 0x03: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_SWISS; break; + case 0x04: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_SCRIPT; break; + case 0x05: hlpfile->fonts[i].LogFont.lfPitchAndFamily |= FF_DECORATIVE; break; + default: WINE_FIXME("Unknown family %u\n", family); + } + idx = GET_USHORT(ref, dscr_offset + i * 11 + 3); + + if (idx < face_num) + { + memcpy(hlpfile->fonts[i].LogFont.lfFaceName, ref + face_offset + idx * len, min(len, LF_FACESIZE - 1)); + hlpfile->fonts[i].LogFont.lfFaceName[min(len, LF_FACESIZE - 1)] = '\0'; + } + else + { + WINE_FIXME("Too high face ref (%u/%u)\n", idx, face_num); + strcpy(hlpfile->fonts[i].LogFont.lfFaceName, "Helv"); + } + hlpfile->fonts[i].hFont = 0; + hlpfile->fonts[i].color = RGB(ref[dscr_offset + i * 11 + 5], + ref[dscr_offset + i * 11 + 6], + ref[dscr_offset + i * 11 + 7]); +#define X(b,s) ((flag & (1 << b)) ? "-"s: "") + WINE_TRACE("Font[%d]: flags=%02x%s%s%s%s%s%s pSize=%u family=%u face=%s[%u] color=%08x\n", + i, flag, + X(0, "bold"), + X(1, "italic"), + X(2, "underline"), + X(3, "strikeOut"), + X(4, "dblUnderline"), + X(5, "smallCaps"), + ref[dscr_offset + i * 11 + 1], + family, + hlpfile->fonts[i].LogFont.lfFaceName, idx, + GET_UINT(ref, dscr_offset + i * 11 + 5) & 0x00FFFFFF); + } + return TRUE; +} + +/*********************************************************************** + * + * HLPFILE_ReadFileToBuffer + */ +static BOOL HLPFILE_ReadFileToBuffer(HFILE hFile) +{ + BYTE header[16], dummy[1]; + UINT size; + + if (_hread(hFile, header, 16) != 16) {WINE_WARN("header\n"); return FALSE;}; + + /* sanity checks */ + if (GET_UINT(header, 0) != 0x00035F3F) + {WINE_WARN("wrong header\n"); return FALSE;}; + + size = GET_UINT(header, 12); + file_buffer = HeapAlloc(GetProcessHeap(), 0, size + 1); + if (!file_buffer) return FALSE; + + memcpy(file_buffer, header, 16); + if (_hread(hFile, file_buffer + 16, size - 16) != size - 16) + {WINE_WARN("filesize1\n"); return FALSE;}; + + if (_hread(hFile, dummy, 1) != 0) WINE_WARN("filesize2\n"); + + file_buffer[size] = '\0'; /* FIXME: was '0', sounds ackward to me */ + + return TRUE; +} + +/*********************************************************************** + * + * HLPFILE_FindSubFile + */ +static BOOL HLPFILE_FindSubFile(LPCSTR name, BYTE **subbuf, BYTE **subend) +{ + BYTE *root = file_buffer + GET_UINT(file_buffer, 4); + BYTE *end = file_buffer + GET_UINT(file_buffer, 12); + BYTE *ptr; + BYTE *bth; + + unsigned pgsize; + unsigned pglast; + unsigned nentries; + unsigned i, n; + + bth = root + 9; + + /* FIXME: this should be using the EnumBTree functions from this file */ + pgsize = GET_USHORT(bth, 4); + WINE_TRACE("%s => pgsize=%u #pg=%u rootpg=%u #lvl=%u\n", + name, pgsize, GET_USHORT(bth, 30), GET_USHORT(bth, 26), GET_USHORT(bth, 32)); + + ptr = bth + 38 + GET_USHORT(bth, 26) * pgsize; + + for (n = 1; n < GET_USHORT(bth, 32); n++) + { + nentries = GET_USHORT(ptr, 2); + pglast = GET_USHORT(ptr, 4); + WINE_TRACE("[%u]: #entries=%u next=%u\n", n, nentries, pglast); + + ptr += 6; + for (i = 0; i < nentries; i++) + { + char *str = (char*) ptr; + WINE_TRACE("<= %s\n", str); + if (strcmp(name, str) < 0) break; + ptr += strlen(str) + 1; + pglast = GET_USHORT(ptr, 0); + ptr += 2; + } + ptr = bth + 38 + pglast * pgsize; + } + + nentries = GET_USHORT(ptr, 2); + ptr += 8; + for (i = 0; i < nentries; i++) + { + char* fname = (char*)ptr; + ptr += strlen(fname) + 1; + WINE_TRACE("\\- %s\n", fname); + if (strcmp(fname, name) == 0) + { + *subbuf = file_buffer + GET_UINT(ptr, 0); + *subend = *subbuf + GET_UINT(*subbuf, 0); + if (file_buffer > *subbuf || *subbuf > *subend || *subend > end) + { + WINE_WARN("size mismatch\n"); + return FALSE; + } + return TRUE; + } + ptr += 4; + } + + return FALSE; +} + +/*********************************************************************** + * + * HLPFILE_SystemCommands + */ +static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) +{ + BYTE *buf, *ptr, *end; + HLPFILE_MACRO *macro, **m; + LPSTR p; + unsigned short magic, minor, major, flags; + + hlpfile->lpszTitle = NULL; + + if (!HLPFILE_FindSubFile("|SYSTEM", &buf, &end)) return FALSE; + + magic = GET_USHORT(buf + 9, 0); + minor = GET_USHORT(buf + 9, 2); + major = GET_USHORT(buf + 9, 4); + /* gen date on 4 bytes */ + flags = GET_USHORT(buf + 9, 10); + WINE_TRACE("Got system header: magic=%04x version=%d.%d flags=%04x\n", + magic, major, minor, flags); + if (magic != 0x036C || major != 1) + {WINE_WARN("Wrong system header\n"); return FALSE;} + if (minor <= 16) {WINE_WARN("too old file format (NIY)\n"); return FALSE;} + if (flags & 8) {WINE_WARN("Unsupported yet page size\n"); return FALSE;} + + hlpfile->version = minor; + hlpfile->flags = flags; + + for (ptr = buf + 0x15; ptr + 4 <= end; ptr += GET_USHORT(ptr, 2) + 4) + { + char *str = (char*) ptr + 4; + switch (GET_USHORT(ptr, 0)) + { + case 1: + if (hlpfile->lpszTitle) {WINE_WARN("title\n"); break;} + hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); + if (!hlpfile->lpszTitle) return FALSE; + lstrcpy(hlpfile->lpszTitle, str); + WINE_TRACE("Title: %s\n", hlpfile->lpszTitle); + break; + + case 2: + if (hlpfile->lpszCopyright) {WINE_WARN("copyright\n"); break;} + hlpfile->lpszCopyright = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); + if (!hlpfile->lpszCopyright) return FALSE; + lstrcpy(hlpfile->lpszCopyright, str); + WINE_TRACE("Copyright: %s\n", hlpfile->lpszCopyright); + break; + + case 3: + if (GET_USHORT(ptr, 2) != 4) {WINE_WARN("system3\n");break;} + hlpfile->contents_start = GET_UINT(ptr, 4); + WINE_TRACE("Setting contents start at %08lx\n", hlpfile->contents_start); + break; + + case 4: + macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + lstrlen(str) + 1); + if (!macro) break; + p = (char*)macro + sizeof(HLPFILE_MACRO); + lstrcpy(p, str); + macro->lpszMacro = p; + macro->next = 0; + for (m = &hlpfile->first_macro; *m; m = &(*m)->next); + *m = macro; + break; + + case 6: + if (GET_USHORT(ptr, 2) != 90) {WINE_WARN("system6\n");break;} + + if (hlpfile->windows) + hlpfile->windows = HeapReAlloc(GetProcessHeap(), 0, hlpfile->windows, + sizeof(HLPFILE_WINDOWINFO) * ++hlpfile->numWindows); + else + hlpfile->windows = HeapAlloc(GetProcessHeap(), 0, + sizeof(HLPFILE_WINDOWINFO) * ++hlpfile->numWindows); + + if (hlpfile->windows) + { + unsigned flags = GET_USHORT(ptr, 4); + HLPFILE_WINDOWINFO* wi = &hlpfile->windows[hlpfile->numWindows - 1]; + + if (flags & 0x0001) strcpy(wi->type, &str[2]); + else wi->type[0] = '\0'; + if (flags & 0x0002) strcpy(wi->name, &str[12]); + else wi->name[0] = '\0'; + if (flags & 0x0004) strcpy(wi->caption, &str[23]); + else lstrcpynA(wi->caption, hlpfile->lpszTitle, sizeof(wi->caption)); + wi->origin.x = (flags & 0x0008) ? GET_USHORT(ptr, 76) : CW_USEDEFAULT; + wi->origin.y = (flags & 0x0010) ? GET_USHORT(ptr, 78) : CW_USEDEFAULT; + wi->size.cx = (flags & 0x0020) ? GET_USHORT(ptr, 80) : CW_USEDEFAULT; + wi->size.cy = (flags & 0x0040) ? GET_USHORT(ptr, 82) : CW_USEDEFAULT; + wi->style = (flags & 0x0080) ? GET_USHORT(ptr, 84) : SW_SHOW; + wi->win_style = WS_OVERLAPPEDWINDOW; + wi->sr_color = (flags & 0x0100) ? GET_UINT(ptr, 86) : 0xFFFFFF; + wi->nsr_color = (flags & 0x0200) ? GET_UINT(ptr, 90) : 0xFFFFFF; + WINE_TRACE("System-Window: flags=%c%c%c%c%c%c%c%c type=%s name=%s caption=%s (%d,%d)x(%d,%d)\n", + flags & 0x0001 ? 'T' : 't', + flags & 0x0002 ? 'N' : 'n', + flags & 0x0004 ? 'C' : 'c', + flags & 0x0008 ? 'X' : 'x', + flags & 0x0010 ? 'Y' : 'y', + flags & 0x0020 ? 'W' : 'w', + flags & 0x0040 ? 'H' : 'h', + flags & 0x0080 ? 'S' : 's', + wi->type, wi->name, wi->caption, wi->origin.x, wi->origin.y, + wi->size.cx, wi->size.cy); + } + break; + default: + WINE_WARN("Unsupported SystemRecord[%d]\n", GET_USHORT(ptr, 0)); + } + } + if (!hlpfile->lpszTitle) + hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1); + return TRUE; +} + +/*********************************************************************** + * + * HLPFILE_UncompressedLZ77_Size + */ +static INT HLPFILE_UncompressedLZ77_Size(BYTE *ptr, BYTE *end) +{ + int i, newsize = 0; + + while (ptr < end) + { + int mask = *ptr++; + for (i = 0; i < 8 && ptr < end; i++, mask >>= 1) + { + if (mask & 1) + { + int code = GET_USHORT(ptr, 0); + int len = 3 + (code >> 12); + newsize += len; + ptr += 2; + } + else newsize++, ptr++; + } + } + + return newsize; +} + +/*********************************************************************** + * + * HLPFILE_UncompressLZ77 + */ +static BYTE *HLPFILE_UncompressLZ77(BYTE *ptr, BYTE *end, BYTE *newptr) +{ + int i; + + while (ptr < end) + { + int mask = *ptr++; + for (i = 0; i < 8 && ptr < end; i++, mask >>= 1) + { + if (mask & 1) + { + int code = GET_USHORT(ptr, 0); + int len = 3 + (code >> 12); + int offset = code & 0xfff; + /* + * We must copy byte-by-byte here. We cannot use memcpy nor + * memmove here. Just example: + * a[]={1,2,3,4,5,6,7,8,9,10} + * newptr=a+2; + * offset=1; + * We expect: + * {1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 11, 12} + */ + for (; len>0; len--, newptr++) *newptr = *(newptr-offset-1); + ptr += 2; + } + else *newptr++ = *ptr++; + } + } + + return newptr; +} + +/*********************************************************************** + * + * HLPFILE_UncompressLZ77_Phrases + */ +static BOOL HLPFILE_UncompressLZ77_Phrases(HLPFILE* hlpfile) +{ + UINT i, num, dec_size; + BYTE *buf, *end; + + if (!HLPFILE_FindSubFile("|Phrases", &buf, &end)) return FALSE; + + num = phrases.num = GET_USHORT(buf, 9); + if (buf + 2 * num + 0x13 >= end) {WINE_WARN("1a\n"); return FALSE;}; + + dec_size = HLPFILE_UncompressedLZ77_Size(buf + 0x13 + 2 * num, end); + + phrases.offsets = HeapAlloc(GetProcessHeap(), 0, sizeof(unsigned) * (num + 1)); + phrases.buffer = HeapAlloc(GetProcessHeap(), 0, dec_size); + if (!phrases.offsets || !phrases.buffer) return FALSE; + + for (i = 0; i <= num; i++) + phrases.offsets[i] = GET_USHORT(buf, 0x11 + 2 * i) - 2 * num - 2; + + HLPFILE_UncompressLZ77(buf + 0x13 + 2 * num, end, (BYTE*)phrases.buffer); + + hlpfile->hasPhrases = TRUE; + return TRUE; +} + +/*********************************************************************** + * + * HLPFILE_Uncompress_Phrases40 + */ +static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE* hlpfile) +{ + UINT num, dec_size, cpr_size; + BYTE *buf_idx, *end_idx; + BYTE *buf_phs, *end_phs; + short i, n; + long* ptr, mask = 0; + unsigned short bc; + + if (!HLPFILE_FindSubFile("|PhrIndex", &buf_idx, &end_idx) || + !HLPFILE_FindSubFile("|PhrImage", &buf_phs, &end_phs)) return FALSE; + + ptr = (long*)(buf_idx + 9 + 28); + bc = GET_USHORT(buf_idx, 9 + 24) & 0x0F; + num = phrases.num = GET_USHORT(buf_idx, 9 + 4); + + WINE_TRACE("Index: Magic=%08x #entries=%u CpsdSize=%u PhrImgSize=%u\n" + "\tPhrImgCprsdSize=%u 0=%u bc=%x ukn=%x\n", + GET_UINT(buf_idx, 9 + 0), + GET_UINT(buf_idx, 9 + 4), + GET_UINT(buf_idx, 9 + 8), + GET_UINT(buf_idx, 9 + 12), + GET_UINT(buf_idx, 9 + 16), + GET_UINT(buf_idx, 9 + 20), + GET_USHORT(buf_idx, 9 + 24), + GET_USHORT(buf_idx, 9 + 26)); + + dec_size = GET_UINT(buf_idx, 9 + 12); + cpr_size = GET_UINT(buf_idx, 9 + 16); + + if (dec_size != cpr_size && + dec_size != HLPFILE_UncompressedLZ77_Size(buf_phs + 9, end_phs)) + { + WINE_WARN("size mismatch %u %u\n", + dec_size, HLPFILE_UncompressedLZ77_Size(buf_phs + 9, end_phs)); + dec_size = max(dec_size, HLPFILE_UncompressedLZ77_Size(buf_phs + 9, end_phs)); + } + + phrases.offsets = HeapAlloc(GetProcessHeap(), 0, sizeof(unsigned) * (num + 1)); + phrases.buffer = HeapAlloc(GetProcessHeap(), 0, dec_size); + if (!phrases.offsets || !phrases.buffer) return FALSE; + +#define getbit() (ptr += (mask < 0), mask = mask*2 + (mask<=0), (*ptr & mask) != 0) + + phrases.offsets[0] = 0; + for (i = 0; i < num; i++) + { + for (n = 1; getbit(); n += 1 << bc); + if (getbit()) n++; + if (bc > 1 && getbit()) n += 2; + if (bc > 2 && getbit()) n += 4; + if (bc > 3 && getbit()) n += 8; + if (bc > 4 && getbit()) n += 16; + phrases.offsets[i + 1] = phrases.offsets[i] + n; + } +#undef getbit + + if (dec_size == cpr_size) + memcpy(phrases.buffer, buf_phs + 9, dec_size); + else + HLPFILE_UncompressLZ77(buf_phs + 9, end_phs, (BYTE*)phrases.buffer); + + hlpfile->hasPhrases = FALSE; + return TRUE; +} + +/*********************************************************************** + * + * HLPFILE_Uncompress_Topic + */ +static BOOL HLPFILE_Uncompress_Topic(HLPFILE* hlpfile) +{ + BYTE *buf, *ptr, *end, *newptr; + int i, newsize = 0; + + if (!HLPFILE_FindSubFile("|TOPIC", &buf, &end)) + {WINE_WARN("topic0\n"); return FALSE;} + + switch (hlpfile->flags & (8|4)) + { + case 8: + WINE_FIXME("Unsupported format\n"); + return FALSE; + case 4: + buf += 9; + topic.wMapLen = (end - buf - 1) / 0x1000 + 1; + + for (i = 0; i < topic.wMapLen; i++) + { + ptr = buf + i * 0x1000; + + /* I don't know why, it's necessary for printman.hlp */ + if (ptr + 0x44 > end) ptr = end - 0x44; + + newsize += HLPFILE_UncompressedLZ77_Size(ptr + 0xc, min(end, ptr + 0x1000)); + } + + topic.map = HeapAlloc(GetProcessHeap(), 0, + topic.wMapLen * sizeof(topic.map[0]) + newsize); + if (!topic.map) return FALSE; + newptr = (BYTE*)(topic.map + topic.wMapLen); + topic.end = newptr + newsize; + + for (i = 0; i < topic.wMapLen; i++) + { + ptr = buf + i * 0x1000; + if (ptr + 0x44 > end) ptr = end - 0x44; + + topic.map[i] = newptr; + newptr = HLPFILE_UncompressLZ77(ptr + 0xc, min(end, ptr + 0x1000), newptr); + } + break; + case 0: + /* basically, we need to copy the 0x1000 byte pages (removing the first 0x0C) in + * one single are in memory + */ +#define DST_LEN (0x1000 - 0x0C) + buf += 9; + newsize = end - buf; + /* number of destination pages */ + topic.wMapLen = (newsize - 1) / DST_LEN + 1; + topic.map = HeapAlloc(GetProcessHeap(), 0, + topic.wMapLen * (sizeof(topic.map[0]) + DST_LEN)); + if (!topic.map) return FALSE; + newptr = (BYTE*)(topic.map + topic.wMapLen); + topic.end = newptr + newsize; + + for (i = 0; i < topic.wMapLen; i++) + { + topic.map[i] = newptr + i * DST_LEN; + memcpy(topic.map[i], buf + i * 0x1000 + 0x0C, DST_LEN); + } +#undef DST_LEN + break; + } + return TRUE; +} + +/*********************************************************************** + * + * HLPFILE_Uncompress2 + */ + +static void HLPFILE_Uncompress2(const BYTE *ptr, const BYTE *end, BYTE *newptr, const BYTE *newend) +{ + BYTE *phptr, *phend; + UINT code; + UINT index; + + while (ptr < end && newptr < newend) + { + if (!*ptr || *ptr >= 0x10) + *newptr++ = *ptr++; + else + { + code = 0x100 * ptr[0] + ptr[1]; + index = (code - 0x100) / 2; + + phptr = (BYTE*)phrases.buffer + phrases.offsets[index]; + phend = (BYTE*)phrases.buffer + phrases.offsets[index + 1]; + + if (newptr + (phend - phptr) > newend) + { + WINE_FIXME("buffer overflow %p > %p for %d bytes\n", + newptr, newend, phend - phptr); + return; + } + memcpy(newptr, phptr, phend - phptr); + newptr += phend - phptr; + if (code & 1) *newptr++ = ' '; + + ptr += 2; + } + } + if (newptr > newend) WINE_FIXME("buffer overflow %p > %p\n", newptr, newend); +} + +/****************************************************************** + * HLPFILE_Uncompress3 + * + * + */ +static BOOL HLPFILE_Uncompress3(char* dst, const char* dst_end, + const BYTE* src, const BYTE* src_end) +{ + int idx, len; + + for (; src < src_end; src++) + { + if ((*src & 1) == 0) + { + idx = *src / 2; + if (idx > phrases.num) + { + WINE_ERR("index in phrases %d/%d\n", idx, phrases.num); + len = 0; + } + else + { + len = phrases.offsets[idx + 1] - phrases.offsets[idx]; + if (dst + len <= dst_end) + memcpy(dst, &phrases.buffer[phrases.offsets[idx]], len); + } + } + else if ((*src & 0x03) == 0x01) + { + idx = (*src + 1) * 64; + idx += *++src; + if (idx > phrases.num) + { + WINE_ERR("index in phrases %d/%d\n", idx, phrases.num); + len = 0; + } + else + { + len = phrases.offsets[idx + 1] - phrases.offsets[idx]; + if (dst + len <= dst_end) + memcpy(dst, &phrases.buffer[phrases.offsets[idx]], len); + } + } + else if ((*src & 0x07) == 0x03) + { + len = (*src / 8) + 1; + if (dst + len <= dst_end) + memcpy(dst, src + 1, len); + src += len; + } + else + { + len = (*src / 16) + 1; + if (dst + len <= dst_end) + memset(dst, ((*src & 0x0F) == 0x07) ? ' ' : 0, len); + } + dst += len; + } + + if (dst > dst_end) WINE_ERR("buffer overflow (%p > %p)\n", dst, dst_end); + return TRUE; +} + +/****************************************************************** + * HLPFILE_UncompressRLE + * + * + */ +static void HLPFILE_UncompressRLE(const BYTE* src, const BYTE* end, BYTE** dst, unsigned dstsz) +{ + BYTE ch; + BYTE* sdst = *dst + dstsz; + + while (src < end) + { + ch = *src++; + if (ch & 0x80) + { + ch &= 0x7F; + if ((*dst) + ch <= sdst) + memcpy(*dst, src, ch); + src += ch; + } + else + { + if ((*dst) + ch <= sdst) + memset(*dst, (char)*src, ch); + src++; + } + *dst += ch; + } + if (*dst != sdst) + WINE_WARN("Buffer X-flow: d(%u) instead of d(%u)\n", + *dst - (sdst - dstsz), dstsz); +} + +/****************************************************************** + * HLPFILE_EnumBTreeLeaves + * + * + */ +static void HLPFILE_EnumBTreeLeaves(const BYTE* buf, const BYTE* end, unsigned (*fn)(const BYTE*, void*), void* user) +{ + unsigned psize, pnext; + unsigned num, nlvl; + const BYTE* ptr; + + num = GET_UINT(buf, 9 + 34); + psize = GET_USHORT(buf, 9 + 4); + nlvl = GET_USHORT(buf, 9 + 32); + pnext = GET_USHORT(buf, 9 + 26); + + WINE_TRACE("BTree: #entries=%u pagSize=%u #levels=%u #pages=%u root=%u struct%16s\n", + num, psize, nlvl, GET_USHORT(buf, 9 + 30), pnext, buf + 9 + 6); + if (!num) return; + + while (--nlvl > 0) + { + ptr = (buf + 9 + 38) + pnext * psize; + WINE_TRACE("BTree: (index[%u]) unused=%u #entries=%u <%u\n", + pnext, GET_USHORT(ptr, 0), GET_USHORT(ptr, 2), GET_USHORT(ptr, 4)); + pnext = GET_USHORT(ptr, 4); + } + while (pnext != 0xFFFF) + { + const BYTE* node_page; + unsigned short limit; + + node_page = ptr = (buf + 9 + 38) + pnext * psize; + limit = GET_USHORT(ptr, 2); + WINE_TRACE("BTree: (leaf [%u]) unused=%u #entries=%u <%u >%u\n", + pnext, GET_USHORT(ptr, 0), limit, GET_USHORT(ptr, 4), GET_USHORT(ptr, 6)); + ptr += 8; + while (limit--) + ptr += (fn)(ptr, user); + pnext = GET_USHORT(node_page, 6); + } +} + +struct myfncb { + HLPFILE* hlpfile; + int i; +}; + +static unsigned myfn(const BYTE* ptr, void* user) +{ + struct myfncb* m = user; + + m->hlpfile->Context[m->i].lHash = GET_UINT(ptr, 0); + m->hlpfile->Context[m->i].offset = GET_UINT(ptr, 4); + m->i++; + return 8; +} + +/*********************************************************************** + * + * HLPFILE_GetContext + */ +static BOOL HLPFILE_GetContext(HLPFILE *hlpfile) +{ + BYTE *cbuf, *cend; + struct myfncb m; + unsigned clen; + + if (!HLPFILE_FindSubFile("|CONTEXT", &cbuf, &cend)) {WINE_WARN("context0\n"); return FALSE;} + + clen = GET_UINT(cbuf, 0x2b); + hlpfile->Context = HeapAlloc(GetProcessHeap(), 0, clen * sizeof(HLPFILE_CONTEXT)); + if (!hlpfile->Context) return FALSE; + hlpfile->wContextLen = clen; + + m.hlpfile = hlpfile; + m.i = 0; + HLPFILE_EnumBTreeLeaves(cbuf, cend, myfn, &m); + + return TRUE; +} + +/*********************************************************************** + * + * HLPFILE_GetMap + */ +static BOOL HLPFILE_GetMap(HLPFILE *hlpfile) +{ + BYTE *cbuf, *cend; + unsigned entries, i; + + if (!HLPFILE_FindSubFile("|CTXOMAP", &cbuf, &cend)) {WINE_WARN("no map section\n"); return FALSE;} + + entries = GET_USHORT(cbuf, 9); + hlpfile->Map = HeapAlloc(GetProcessHeap(), 0, entries * sizeof(HLPFILE_MAP)); + if (!hlpfile->Map) return FALSE; + hlpfile->wMapLen = entries; + for (i = 0; i < entries; i++) + { + hlpfile->Map[i].lMap = GET_UINT(cbuf+11,i*8); + hlpfile->Map[i].offset = GET_UINT(cbuf+11,i*8+4); + } + return TRUE; +} + +/****************************************************************** + * HLPFILE_DeleteLink + * + * + */ +void HLPFILE_FreeLink(HLPFILE_LINK* link) +{ + if (link && !--link->wRefCount) + HeapFree(GetProcessHeap(), 0, link); +} + +/*********************************************************************** + * + * HLPFILE_DeleteParagraph + */ +static void HLPFILE_DeleteParagraph(HLPFILE_PARAGRAPH* paragraph) +{ + HLPFILE_PARAGRAPH* next; + + while (paragraph) + { + next = paragraph->next; + + if (paragraph->cookie == para_metafile) + DeleteMetaFile(paragraph->u.gfx.u.mfp.hMF); + + HLPFILE_FreeLink(paragraph->link); + + HeapFree(GetProcessHeap(), 0, paragraph); + paragraph = next; + } +} + +/*********************************************************************** + * + * DeleteMacro + */ +static void HLPFILE_DeleteMacro(HLPFILE_MACRO* macro) +{ + HLPFILE_MACRO* next; + + while (macro) + { + next = macro->next; + HeapFree(GetProcessHeap(), 0, macro); + macro = next; + } +} + +/*********************************************************************** + * + * DeletePage + */ +static void HLPFILE_DeletePage(HLPFILE_PAGE* page) +{ + HLPFILE_PAGE* next; + + while (page) + { + next = page->next; + HLPFILE_DeleteParagraph(page->first_paragraph); + HLPFILE_DeleteMacro(page->first_macro); + HeapFree(GetProcessHeap(), 0, page); + page = next; + } +} + +/*********************************************************************** + * + * HLPFILE_FreeHlpFile + */ +void HLPFILE_FreeHlpFile(HLPFILE* hlpfile) +{ + unsigned i; + + if (!hlpfile || --hlpfile->wRefCount > 0) return; + + if (hlpfile->next) hlpfile->next->prev = hlpfile->prev; + if (hlpfile->prev) hlpfile->prev->next = hlpfile->next; + else first_hlpfile = hlpfile->next; + + if (hlpfile->numFonts) + { + for (i = 0; i < hlpfile->numFonts; i++) + { + DeleteObject(hlpfile->fonts[i].hFont); + } + HeapFree(GetProcessHeap(), 0, hlpfile->fonts); + } + + if (hlpfile->numBmps) + { + for (i = 0; i < hlpfile->numBmps; i++) + { + DeleteObject(hlpfile->bmps[i]); + } + HeapFree(GetProcessHeap(), 0, hlpfile->bmps); + } + + HLPFILE_DeletePage(hlpfile->first_page); + HLPFILE_DeleteMacro(hlpfile->first_macro); + + if (hlpfile->numWindows) HeapFree(GetProcessHeap(), 0, hlpfile->windows); + HeapFree(GetProcessHeap(), 0, hlpfile->Context); + HeapFree(GetProcessHeap(), 0, hlpfile->Map); + HeapFree(GetProcessHeap(), 0, hlpfile->lpszTitle); + HeapFree(GetProcessHeap(), 0, hlpfile->lpszCopyright); + HeapFree(GetProcessHeap(), 0, hlpfile); +} diff --git a/reactos/base/applications/winhelp/hlpfile.h b/reactos/base/applications/winhelp/hlpfile.h index 4d62cdd22ed..38b3c43538d 100644 --- a/reactos/base/applications/winhelp/hlpfile.h +++ b/reactos/base/applications/winhelp/hlpfile.h @@ -1,163 +1,163 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * 2002 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -struct tagHelpFile; - -typedef struct -{ - char type[10]; - char name[9]; - char caption[51]; - POINT origin; - SIZE size; - int style; - DWORD win_style; - COLORREF sr_color; /* color for scrollable region */ - COLORREF nsr_color; /* color for non scrollable region */ -} HLPFILE_WINDOWINFO; - -typedef struct -{ - enum {hlp_link_link, hlp_link_popup, hlp_link_macro} cookie; - LPCSTR lpszString; /* name of the file to for the link (NULL if same file) */ - LONG lHash; /* topic index */ - unsigned bClrChange : 1, /* true if the link is green & underlined */ - wRefCount; /* number of internal references to this object */ - unsigned window; /* window number for displaying the link (-1 is current) */ -} HLPFILE_LINK; - -enum para_type {para_normal_text, para_debug_text, para_bitmap, para_metafile}; - -typedef struct tagHlpFileParagraph -{ - enum para_type cookie; - - union - { - struct - { - LPSTR lpszText; - unsigned wFont; - unsigned wIndent; - unsigned wHSpace; - unsigned wVSpace; - } text; - struct - { - unsigned pos; /* 0: center, 1: left, 2: right */ - union - { - struct - { - HBITMAP hBitmap; - } bmp; - METAFILEPICT mfp; - } u; - } gfx; /* for bitmaps and metafiles */ - } u; - - HLPFILE_LINK* link; - - struct tagHlpFileParagraph* next; -} HLPFILE_PARAGRAPH; - -typedef struct tagHlpFileMacro -{ - LPCSTR lpszMacro; - struct tagHlpFileMacro* next; -} HLPFILE_MACRO; - -typedef struct tagHlpFilePage -{ - LPSTR lpszTitle; - HLPFILE_PARAGRAPH* first_paragraph; - HLPFILE_MACRO* first_macro; - - unsigned wNumber; - unsigned offset; - struct tagHlpFilePage* next; - struct tagHlpFilePage* prev; - - DWORD browse_bwd; - DWORD browse_fwd; - - struct tagHlpFileFile* file; -} HLPFILE_PAGE; - -typedef struct -{ - LONG lHash; - unsigned long offset; -} HLPFILE_CONTEXT; - -typedef struct -{ - LONG lMap; - unsigned long offset; -} HLPFILE_MAP; - -typedef struct -{ - LOGFONT LogFont; - HFONT hFont; - COLORREF color; -} HLPFILE_FONT; - -typedef struct tagHlpFileFile -{ - LPSTR lpszPath; - LPSTR lpszTitle; - LPSTR lpszCopyright; - HLPFILE_PAGE* first_page; - HLPFILE_MACRO* first_macro; - unsigned wContextLen; - HLPFILE_CONTEXT* Context; - unsigned wMapLen; - HLPFILE_MAP* Map; - unsigned long contents_start; - - struct tagHlpFileFile* prev; - struct tagHlpFileFile* next; - - unsigned wRefCount; - - unsigned short version; - unsigned short flags; - unsigned hasPhrases; /* Phrases or PhrIndex/PhrImage */ - - unsigned numBmps; - HBITMAP* bmps; - - unsigned numFonts; - HLPFILE_FONT* fonts; - - unsigned numWindows; - HLPFILE_WINDOWINFO* windows; -} HLPFILE; - -HLPFILE* HLPFILE_ReadHlpFile(LPCSTR lpszPath); -HLPFILE_PAGE* HLPFILE_Contents(HLPFILE* hlpfile); -HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash); -HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap); -HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset); -LONG HLPFILE_Hash(LPCSTR lpszContext); -void HLPFILE_FreeLink(HLPFILE_LINK* link); -void HLPFILE_FreeHlpFile(HLPFILE*); +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * 2002 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +struct tagHelpFile; + +typedef struct +{ + char type[10]; + char name[9]; + char caption[51]; + POINT origin; + SIZE size; + int style; + DWORD win_style; + COLORREF sr_color; /* color for scrollable region */ + COLORREF nsr_color; /* color for non scrollable region */ +} HLPFILE_WINDOWINFO; + +typedef struct +{ + enum {hlp_link_link, hlp_link_popup, hlp_link_macro} cookie; + LPCSTR lpszString; /* name of the file to for the link (NULL if same file) */ + LONG lHash; /* topic index */ + unsigned bClrChange : 1, /* true if the link is green & underlined */ + wRefCount; /* number of internal references to this object */ + unsigned window; /* window number for displaying the link (-1 is current) */ +} HLPFILE_LINK; + +enum para_type {para_normal_text, para_debug_text, para_bitmap, para_metafile}; + +typedef struct tagHlpFileParagraph +{ + enum para_type cookie; + + union + { + struct + { + LPSTR lpszText; + unsigned wFont; + unsigned wIndent; + unsigned wHSpace; + unsigned wVSpace; + } text; + struct + { + unsigned pos; /* 0: center, 1: left, 2: right */ + union + { + struct + { + HBITMAP hBitmap; + } bmp; + METAFILEPICT mfp; + } u; + } gfx; /* for bitmaps and metafiles */ + } u; + + HLPFILE_LINK* link; + + struct tagHlpFileParagraph* next; +} HLPFILE_PARAGRAPH; + +typedef struct tagHlpFileMacro +{ + LPCSTR lpszMacro; + struct tagHlpFileMacro* next; +} HLPFILE_MACRO; + +typedef struct tagHlpFilePage +{ + LPSTR lpszTitle; + HLPFILE_PARAGRAPH* first_paragraph; + HLPFILE_MACRO* first_macro; + + unsigned wNumber; + unsigned offset; + struct tagHlpFilePage* next; + struct tagHlpFilePage* prev; + + DWORD browse_bwd; + DWORD browse_fwd; + + struct tagHlpFileFile* file; +} HLPFILE_PAGE; + +typedef struct +{ + LONG lHash; + unsigned long offset; +} HLPFILE_CONTEXT; + +typedef struct +{ + LONG lMap; + unsigned long offset; +} HLPFILE_MAP; + +typedef struct +{ + LOGFONT LogFont; + HFONT hFont; + COLORREF color; +} HLPFILE_FONT; + +typedef struct tagHlpFileFile +{ + LPSTR lpszPath; + LPSTR lpszTitle; + LPSTR lpszCopyright; + HLPFILE_PAGE* first_page; + HLPFILE_MACRO* first_macro; + unsigned wContextLen; + HLPFILE_CONTEXT* Context; + unsigned wMapLen; + HLPFILE_MAP* Map; + unsigned long contents_start; + + struct tagHlpFileFile* prev; + struct tagHlpFileFile* next; + + unsigned wRefCount; + + unsigned short version; + unsigned short flags; + unsigned hasPhrases; /* Phrases or PhrIndex/PhrImage */ + + unsigned numBmps; + HBITMAP* bmps; + + unsigned numFonts; + HLPFILE_FONT* fonts; + + unsigned numWindows; + HLPFILE_WINDOWINFO* windows; +} HLPFILE; + +HLPFILE* HLPFILE_ReadHlpFile(LPCSTR lpszPath); +HLPFILE_PAGE* HLPFILE_Contents(HLPFILE* hlpfile); +HLPFILE_PAGE* HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash); +HLPFILE_PAGE* HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap); +HLPFILE_PAGE* HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset); +LONG HLPFILE_Hash(LPCSTR lpszContext); +void HLPFILE_FreeLink(HLPFILE_LINK* link); +void HLPFILE_FreeHlpFile(HLPFILE*); diff --git a/reactos/base/applications/winhelp/lang/sk-SK.rc b/reactos/base/applications/winhelp/lang/sk-SK.rc index 780cf04add3..2165662c483 100644 --- a/reactos/base/applications/winhelp/lang/sk-SK.rc +++ b/reactos/base/applications/winhelp/lang/sk-SK.rc @@ -3,7 +3,7 @@ * PURPOSE: Slovak Language File for winhelp * TRANSLATOR: Kario (kario@szm.sk) * DATE OF TR: 04-08-2007 -*/ +*/ /* * Help Viewer diff --git a/reactos/base/applications/winhelp/lex.yy.c b/reactos/base/applications/winhelp/lex.yy.c index 0f38be750f1..0db38dc2693 100644 --- a/reactos/base/applications/winhelp/lex.yy.c +++ b/reactos/base/applications/winhelp/lex.yy.c @@ -1706,24 +1706,24 @@ static int MACRO_CheckArgs(void* pa[], unsigned max, const char* args) switch (*args) { - case 'S': + case 'S': if (t != STRING) {WINE_WARN("missing S\n");return -1;} - pa[idx] = (void*)yylval.string; + pa[idx] = (void*)yylval.string; break; case 'U': case 'I': if (t != INTEGER) - {WINE_WARN("missing U\n");return -1;} - pa[idx] = (void*)yylval.integer; + {WINE_WARN("missing U\n");return -1;} + pa[idx] = (void*)yylval.integer; break; case 'B': - if (t != BOOL_FUNCTION) - {WINE_WARN("missing B\n");return -1;} + if (t != BOOL_FUNCTION) + {WINE_WARN("missing B\n");return -1;} if (MACRO_CallBoolFunc(yylval.function, yylval.proto, &pa[idx]) == 0) return -1; break; - default: + default: WINE_WARN("unexpected %s while args is %c\n", ts(t), *args); return -1; } diff --git a/reactos/base/applications/winhelp/macro.c b/reactos/base/applications/winhelp/macro.c index 803b5bba935..b51f7986219 100644 --- a/reactos/base/applications/winhelp/macro.c +++ b/reactos/base/applications/winhelp/macro.c @@ -1,928 +1,928 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * Copyright 2002 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#define WIN32_LEAN_AND_MEAN - -#include - -#include "windows.h" -#include "commdlg.h" -#include "winhelp.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(winhelp); - -/**************************************************/ -/* Macro table */ -/**************************************************/ -struct MacroDesc { - const char* name; - const char* alias; - BOOL isBool; - const char* arguments; - FARPROC fn; -}; - -/* types: - * U: 32 bit unsigned int - * I: 32 bit signed int - * S: string - * v: unknown (32 bit entity) - */ - -static struct MacroDesc MACRO_Builtins[] = { - {"About", NULL, 0, "", (FARPROC)MACRO_About}, - {"AddAccelerator", "AA", 0, "UUS", (FARPROC)MACRO_AddAccelerator}, - {"ALink", "AL", 0, "SUS", (FARPROC)MACRO_ALink}, - {"Annotate", NULL, 0, "", (FARPROC)MACRO_Annotate}, - {"AppendItem", NULL, 0, "SSSS", (FARPROC)MACRO_AppendItem}, - {"Back", NULL, 0, "", (FARPROC)MACRO_Back}, - {"BackFlush", "BF", 0, "", (FARPROC)MACRO_BackFlush}, - {"BookmarkDefine", NULL, 0, "", (FARPROC)MACRO_BookmarkDefine}, - {"BookmarkMore", NULL, 0, "", (FARPROC)MACRO_BookmarkMore}, - {"BrowseButtons", NULL, 0, "", (FARPROC)MACRO_BrowseButtons}, - {"ChangeButtonBinding", "CBB",0, "SS", (FARPROC)MACRO_ChangeButtonBinding}, - {"ChangeEnable", "CE", 0, "SS", (FARPROC)MACRO_ChangeEnable}, - {"ChangeItemBinding", "CIB",0, "SS", (FARPROC)MACRO_ChangeItemBinding}, - {"CheckItem", "CI", 0, "S", (FARPROC)MACRO_CheckItem}, - {"CloseSecondarys", "CS", 0, "", (FARPROC)MACRO_CloseSecondarys}, - {"CloseWindow", "CW", 0, "S", (FARPROC)MACRO_CloseWindow}, - {"Compare", NULL, 0, "S", (FARPROC)MACRO_Compare}, - {"Contents", NULL, 0, "", (FARPROC)MACRO_Contents}, - {"ControlPanel", NULL, 0, "SSU", (FARPROC)MACRO_ControlPanel}, - {"CopyDialog", NULL, 0, "", (FARPROC)MACRO_CopyDialog}, - {"CopyTopic", "CT", 0, "", (FARPROC)MACRO_CopyTopic}, - {"CreateButton", "CB", 0, "SSS", (FARPROC)MACRO_CreateButton}, - {"DeleteItem", NULL, 0, "S", (FARPROC)MACRO_DeleteItem}, - {"DeleteMark", NULL, 0, "S", (FARPROC)MACRO_DeleteMark}, - {"DestroyButton", NULL, 0, "S", (FARPROC)MACRO_DestroyButton}, - {"DisableButton", "DB", 0, "S", (FARPROC)MACRO_DisableButton}, - {"DisableItem", "DI", 0, "S", (FARPROC)MACRO_DisableItem}, - {"EnableButton", "EB", 0, "S", (FARPROC)MACRO_EnableButton}, - {"EnableItem", "EI", 0, "S", (FARPROC)MACRO_EnableItem}, - {"EndMPrint", NULL, 0, "", (FARPROC)MACRO_EndMPrint}, - {"ExecFile", "EF", 0, "SSUS", (FARPROC)MACRO_ExecFile}, - {"ExecProgram", "EP", 0, "SU", (FARPROC)MACRO_ExecProgram}, - {"Exit", NULL, 0, "", (FARPROC)MACRO_Exit}, - {"ExtAbleItem", NULL, 0, "SU", (FARPROC)MACRO_ExtAbleItem}, - {"ExtInsertItem", NULL, 0, "SSSSUU", (FARPROC)MACRO_ExtInsertItem}, - {"ExtInsertMenu", NULL, 0, "SSSUU", (FARPROC)MACRO_ExtInsertMenu}, - {"FileExist", "FE", 1, "S", (FARPROC)MACRO_FileExist}, - {"FileOpen", "FO", 0, "", (FARPROC)MACRO_FileOpen}, - {"Find", NULL, 0, "", (FARPROC)MACRO_Find}, - {"Finder", "FD", 0, "", (FARPROC)MACRO_Finder}, - {"FloatingMenu", NULL, 0, "", (FARPROC)MACRO_FloatingMenu}, - {"Flush", "FH", 0, "", (FARPROC)MACRO_Flush}, - {"FocusWindow", NULL, 0, "S", (FARPROC)MACRO_FocusWindow}, - {"Generate", NULL, 0, "SUU", (FARPROC)MACRO_Generate}, - {"GotoMark", NULL, 0, "S", (FARPROC)MACRO_GotoMark}, - {"HelpOn", NULL, 0, "", (FARPROC)MACRO_HelpOn}, - {"HelpOnTop", NULL, 0, "", (FARPROC)MACRO_HelpOnTop}, - {"History", NULL, 0, "", (FARPROC)MACRO_History}, - {"InitMPrint", NULL, 1, "", (FARPROC)MACRO_InitMPrint}, - {"InsertItem", NULL, 0, "SSSSU", (FARPROC)MACRO_InsertItem}, - {"InsertMenu", NULL, 0, "SSU", (FARPROC)MACRO_InsertMenu}, - {"IfThen", "IF", 0, "BS", (FARPROC)MACRO_IfThen}, - {"IfThenElse", "IE", 0, "BSS", (FARPROC)MACRO_IfThenElse}, - {"IsBook", NULL, 1, "", (FARPROC)MACRO_IsBook}, - {"IsMark", NULL, 1, "S", (FARPROC)MACRO_IsMark}, - {"IsNotMark", "NM", 1, "S", (FARPROC)MACRO_IsNotMark}, - {"JumpContents", NULL, 0, "SS", (FARPROC)MACRO_JumpContents}, - {"JumpContext", "JC", 0, "SSU", (FARPROC)MACRO_JumpContext}, - {"JumpHash", "JH", 0, "SSU", (FARPROC)MACRO_JumpHash}, - {"JumpHelpOn", NULL, 0, "", (FARPROC)MACRO_JumpHelpOn}, - {"JumpID", "JI", 0, "SSS", (FARPROC)MACRO_JumpID}, - {"JumpKeyword", "JK", 0, "SSS", (FARPROC)MACRO_JumpKeyword}, - {"KLink", "KL", 0, "SUSS", (FARPROC)MACRO_KLink}, - {"Menu", "MU", 0, "", (FARPROC)MACRO_Menu}, - {"MPrintHash", NULL, 0, "U", (FARPROC)MACRO_MPrintHash}, - {"MPrintID", NULL, 0, "S", (FARPROC)MACRO_MPrintID}, - {"Next", NULL, 0, "", (FARPROC)MACRO_Next}, - {"NoShow", NULL, 0, "", (FARPROC)MACRO_NoShow}, - {"PopupContext", "PC", 0, "SU", (FARPROC)MACRO_PopupContext}, - {"PopupHash", NULL, 0, "SU", (FARPROC)MACRO_PopupHash}, - {"PopupId", "PI", 0, "SS", (FARPROC)MACRO_PopupId}, - {"PositionWindow", "PW", 0, "IIUUUS", (FARPROC)MACRO_PositionWindow}, - {"Prev", NULL, 0, "", (FARPROC)MACRO_Prev}, - {"Print", NULL, 0, "", (FARPROC)MACRO_Print}, - {"PrinterSetup", NULL, 0, "", (FARPROC)MACRO_PrinterSetup}, - {"RegisterRoutine", "RR", 0, "SSS", (FARPROC)MACRO_RegisterRoutine}, - {"RemoveAccelerator", "RA", 0, "UU", (FARPROC)MACRO_RemoveAccelerator}, - {"ResetMenu", NULL, 0, "", (FARPROC)MACRO_ResetMenu}, - {"SaveMark", NULL, 0, "S", (FARPROC)MACRO_SaveMark}, - {"Search", NULL, 0, "", (FARPROC)MACRO_Search}, - {"SetContents", NULL, 0, "SU", (FARPROC)MACRO_SetContents}, - {"SetHelpOnFile", NULL, 0, "S", (FARPROC)MACRO_SetHelpOnFile}, - {"SetPopupColor", "SPC",0, "UUU", (FARPROC)MACRO_SetPopupColor}, - {"ShellExecute", "SE", 0, "SSUUSS", (FARPROC)MACRO_ShellExecute}, - {"ShortCut", "SH", 0, "SSUUS", (FARPROC)MACRO_ShortCut}, - {"TCard", NULL, 0, "U", (FARPROC)MACRO_TCard}, - {"Test", NULL, 0, "U", (FARPROC)MACRO_Test}, - {"TestALink", NULL, 1, "S", (FARPROC)MACRO_TestALink}, - {"TestKLink", NULL, 1, "S", (FARPROC)MACRO_TestKLink}, - {"UncheckItem", "UI", 0, "S", (FARPROC)MACRO_UncheckItem}, - {"UpdateWindow", "UW", 0, "SS", (FARPROC)MACRO_UpdateWindow}, - {NULL, NULL, 0, NULL, NULL} -}; - -static struct MacroDesc*MACRO_Loaded /* = NULL */; -static unsigned MACRO_NumLoaded /* = 0 */; - -static int MACRO_DoLookUp(struct MacroDesc* start, const char* name, struct lexret* lr, unsigned len) -{ - struct MacroDesc* md; - - for (md = start; md->name && len != 0; md++, len--) - { - if (strcasecmp(md->name, name) == 0 || (md->alias != NULL && strcasecmp(md->alias, name) == 0)) - { - lr->proto = md->arguments; - lr->function = md->fn; - return md->isBool ? BOOL_FUNCTION : VOID_FUNCTION; - } - } - return EMPTY; -} - -int MACRO_Lookup(const char* name, struct lexret* lr) -{ - int ret; - - if ((ret = MACRO_DoLookUp(MACRO_Builtins, name, lr, -1)) != EMPTY) - return ret; - if (MACRO_Loaded && (ret = MACRO_DoLookUp(MACRO_Loaded, name, lr, MACRO_NumLoaded)) != EMPTY) - return ret; - - lr->string = name; - return IDENTIFIER; -} - -/******* helper functions *******/ - -static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR name) -{ - WINHELP_BUTTON** b; - - for (b = &win->first_button; *b; b = &(*b)->next) - if (!lstrcmpi(name, (*b)->lpszID)) break; - return b; -} - -/******* real macro implementation *******/ - -void CALLBACK MACRO_About(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str) -{ - WINE_FIXME("(%u, %u, \"%s\")\n", u1, u2, str); -} - -void CALLBACK MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2) -{ - WINE_FIXME("(\"%s\", %u, \"%s\")\n", str1, u, str2); -} - -void CALLBACK MACRO_Annotate(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4) -{ - WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\")\n", str1, str2, str3, str4); -} - -void CALLBACK MACRO_Back(void) -{ - WINHELP_WINDOW* win = Globals.active_win; - - WINE_TRACE("()\n"); - - if (win && win->backIndex >= 2) - WINHELP_CreateHelpWindow(win->back[--win->backIndex - 1], - win->info, SW_SHOW); -} - -void CALLBACK MACRO_BackFlush(void) -{ - WINHELP_WINDOW* win = Globals.active_win; - - WINE_TRACE("()\n"); - - if (win) - { - int i; - - for (i = 0; i < win->backIndex; i++) - { - HLPFILE_FreeHlpFile(win->back[i]->file); - win->back[i] = NULL; - } - win->backIndex = 0; - } -} - -void CALLBACK MACRO_BookmarkDefine(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_BookmarkMore(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_BrowseButtons(void) -{ - WINE_TRACE("()\n"); - - MACRO_CreateButton("BTN_PREV", "&<<", "Prev()"); - MACRO_CreateButton("BTN_NEXT", "&>>", "Next()"); -} - -void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) -{ - WINHELP_WINDOW* win = Globals.active_win; - WINHELP_BUTTON* button; - WINHELP_BUTTON** b; - LONG size; - LPSTR ptr; - - WINE_TRACE("(\"%s\", \"%s\")\n", id, macro); - - b = MACRO_LookupButton(win, id); - if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} - - size = sizeof(WINHELP_BUTTON) + lstrlen(id) + - lstrlen((*b)->lpszName) + lstrlen(macro) + 3; - - button = HeapAlloc(GetProcessHeap(), 0, size); - if (!button) return; - - button->next = (*b)->next; - button->hWnd = (*b)->hWnd; - button->wParam = (*b)->wParam; - - ptr = (char*)button + sizeof(WINHELP_BUTTON); - - lstrcpy(ptr, id); - button->lpszID = ptr; - ptr += lstrlen(id) + 1; - - lstrcpy(ptr, (*b)->lpszName); - button->lpszName = ptr; - ptr += lstrlen((*b)->lpszName) + 1; - - lstrcpy(ptr, macro); - button->lpszMacro = ptr; - - *b = button; - - SendMessage(win->hMainWnd, WM_USER, 0, 0); -} - -void CALLBACK MACRO_ChangeEnable(LPCSTR id, LPCSTR macro) -{ - WINE_TRACE("(\"%s\", \"%s\")\n", id, macro); - - MACRO_ChangeButtonBinding(id, macro); - MACRO_EnableButton(id); -} - -void CALLBACK MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2) -{ - WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); -} - -void CALLBACK MACRO_CheckItem(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_CloseSecondarys(void) -{ - WINHELP_WINDOW *win; - - WINE_TRACE("()\n"); - for (win = Globals.win_list; win; win = win->next) - if (win->lpszName && lstrcmpi(win->lpszName, "main")) - DestroyWindow(win->hMainWnd); -} - -void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) -{ - WINHELP_WINDOW *win; - - WINE_TRACE("(\"%s\")\n", lpszWindow); - - if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; - - for (win = Globals.win_list; win; win = win->next) - if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow)) - DestroyWindow(win->hMainWnd); -} - -void CALLBACK MACRO_Compare(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_Contents(void) -{ - WINE_TRACE("()\n"); - - if (Globals.active_win->page) - MACRO_JumpContents(Globals.active_win->page->file->lpszPath, NULL); -} - -void CALLBACK MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u) -{ - WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); -} - -void CALLBACK MACRO_CopyDialog(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_CopyTopic(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) -{ - WINHELP_WINDOW *win = Globals.active_win; - WINHELP_BUTTON *button, **b; - LONG size; - LPSTR ptr; - - WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro); - - size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; - - button = HeapAlloc(GetProcessHeap(), 0, size); - if (!button) return; - - button->next = 0; - button->hWnd = 0; - - ptr = (char*)button + sizeof(WINHELP_BUTTON); - - lstrcpy(ptr, id); - button->lpszID = ptr; - ptr += lstrlen(id) + 1; - - lstrcpy(ptr, name); - button->lpszName = ptr; - ptr += lstrlen(name) + 1; - - lstrcpy(ptr, macro); - button->lpszMacro = ptr; - - button->wParam = WH_FIRST_BUTTON; - for (b = &win->first_button; *b; b = &(*b)->next) - button->wParam = max(button->wParam, (*b)->wParam + 1); - *b = button; - - SendMessage(win->hMainWnd, WM_USER, 0, 0); -} - -void CALLBACK MACRO_DeleteItem(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_DeleteMark(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_DestroyButton(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_DisableButton(LPCSTR id) -{ - WINHELP_BUTTON** b; - - WINE_FIXME("(\"%s\")\n", id); - - b = MACRO_LookupButton(Globals.active_win, id); - if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} - - EnableWindow((*b)->hWnd, FALSE); -} - -void CALLBACK MACRO_DisableItem(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_EnableButton(LPCSTR id) -{ - WINHELP_BUTTON** b; - - WINE_TRACE("(\"%s\")\n", id); - - b = MACRO_LookupButton(Globals.active_win, id); - if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} - - EnableWindow((*b)->hWnd, TRUE); -} - -void CALLBACK MACRO_EnableItem(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_EndMPrint(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3) -{ - WINE_FIXME("(\"%s\", \"%s\", %u, \"%s\")\n", str1, str2, u, str3); -} - -void CALLBACK MACRO_ExecProgram(LPCSTR str, LONG u) -{ - WINE_FIXME("(\"%s\", %u)\n", str, u); -} - -void CALLBACK MACRO_Exit(void) -{ - WINE_TRACE("()\n"); - - while (Globals.win_list) - DestroyWindow(Globals.win_list->hMainWnd); -} - -void CALLBACK MACRO_ExtAbleItem(LPCSTR str, LONG u) -{ - WINE_FIXME("(\"%s\", %u)\n", str, u); -} - -void CALLBACK MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2) -{ - WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, str4, u1, u2); -} - -void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2) -{ - WINE_FIXME("(\"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, u1, u2); -} - -BOOL CALLBACK MACRO_FileExist(LPCSTR str) -{ - WINE_TRACE("(\"%s\")\n", str); - return GetFileAttributes(str) != INVALID_FILE_ATTRIBUTES; -} - -void CALLBACK MACRO_FileOpen(void) -{ - char szFile[MAX_PATH]; - - if (WINHELP_GetOpenFileName(szFile, MAX_PATH)) - { - HLPFILE* hlpfile = WINHELP_LookupHelpFile(szFile); - - WINHELP_CreateHelpWindowByHash(hlpfile, 0, - WINHELP_GetWindowInfo(hlpfile, "main"), SW_SHOWNORMAL); - } -} - -void CALLBACK MACRO_Find(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_Finder(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_FloatingMenu(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_Flush(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) -{ - WINHELP_WINDOW *win; - - WINE_TRACE("(\"%s\")\n", lpszWindow); - - if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; - - for (win = Globals.win_list; win; win = win->next) - if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow)) - SetFocus(win->hMainWnd); -} - -void CALLBACK MACRO_Generate(LPCSTR str, LONG w, LONG l) -{ - WINE_FIXME("(\"%s\", %x, %x)\n", str, w, l); -} - -void CALLBACK MACRO_GotoMark(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_HelpOn(void) -{ - WINE_TRACE("()\n"); - MACRO_JumpContents((Globals.wVersion > 4) ? "winhelp32.hlp" : "winhelp.hlp", NULL); -} - -void CALLBACK MACRO_HelpOnTop(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_History(void) -{ - WINE_TRACE("()\n"); - - if (Globals.active_win && !Globals.active_win->hHistoryWnd) - { - HWND hWnd = CreateWindow(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW, - 0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win); - ShowWindow(hWnd, SW_NORMAL); - } -} - -void CALLBACK MACRO_IfThen(BOOL b, LPCSTR t) -{ - if (b) MACRO_ExecuteMacro(t); -} - -void CALLBACK MACRO_IfThenElse(BOOL b, LPCSTR t, LPCSTR f) -{ - if (b) MACRO_ExecuteMacro(t); else MACRO_ExecuteMacro(f); -} - -BOOL CALLBACK MACRO_InitMPrint(void) -{ - WINE_FIXME("()\n"); - return FALSE; -} - -void CALLBACK MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u) -{ - WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u)\n", str1, str2, str3, str4, u); -} - -void CALLBACK MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u) -{ - WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); -} - -BOOL CALLBACK MACRO_IsBook(void) -{ - WINE_TRACE("()\n"); - return Globals.isBook; -} - -BOOL CALLBACK MACRO_IsMark(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); - return FALSE; -} - -BOOL CALLBACK MACRO_IsNotMark(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); - return TRUE; -} - -void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow) -{ - HLPFILE* hlpfile; - - WINE_TRACE("(\"%s\", \"%s\")\n", lpszPath, lpszWindow); - hlpfile = WINHELP_LookupHelpFile(lpszPath); - WINHELP_CreateHelpWindowByHash(hlpfile, 0, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); -} - -void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context) -{ - HLPFILE* hlpfile; - - WINE_TRACE("(\"%s\", \"%s\", %d)\n", lpszPath, lpszWindow, context); - hlpfile = WINHELP_LookupHelpFile(lpszPath); - /* Some madness: what user calls 'context', hlpfile calls 'map' */ - WINHELP_CreateHelpWindowByMap(hlpfile, context, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); -} - -void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) -{ - HLPFILE* hlpfile; - - WINE_TRACE("(\"%s\", \"%s\", %u)\n", lpszPath, lpszWindow, lHash); - hlpfile = WINHELP_LookupHelpFile(lpszPath); - WINHELP_CreateHelpWindowByHash(hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); -} - -void CALLBACK MACRO_JumpHelpOn(void) -{ - WINE_FIXME("()\n"); -} - -/* FIXME: those two macros are wrong - * they should only contain 2 strings, path & window are coded as path>window - */ -void CALLBACK MACRO_JumpID(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR topic_id) -{ - WINE_TRACE("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, topic_id); - MACRO_JumpHash(lpszPath, lpszWindow, HLPFILE_Hash(topic_id)); -} - -void CALLBACK MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword) -{ - WINE_FIXME("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword); -} - -void CALLBACK MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3) -{ - WINE_FIXME("(\"%s\", %u, \"%s\", \"%s\")\n", str1, u, str2, str3); -} - -void CALLBACK MACRO_Menu(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_MPrintHash(LONG u) -{ - WINE_FIXME("(%u)\n", u); -} - -void CALLBACK MACRO_MPrintID(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_Next(void) -{ - HLPFILE_PAGE* page; - - WINE_TRACE("()\n"); - page = Globals.active_win->page; - page = HLPFILE_PageByOffset(page->file, page->browse_fwd); - if (page) - { - page->file->wRefCount++; - WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL); - } -} - -void CALLBACK MACRO_NoShow(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_PopupContext(LPCSTR str, LONG u) -{ - WINE_FIXME("(\"%s\", %u)\n", str, u); -} - -void CALLBACK MACRO_PopupHash(LPCSTR str, LONG u) -{ - WINE_FIXME("(\"%s\", %u)\n", str, u); -} - -void CALLBACK MACRO_PopupId(LPCSTR str1, LPCSTR str2) -{ - WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); -} - -void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str) -{ - WINE_FIXME("(%i, %i, %u, %u, %u, \"%s\")\n", i1, i2, u1, u2, u3, str); -} - -void CALLBACK MACRO_Prev(void) -{ - HLPFILE_PAGE* page; - - WINE_TRACE("()\n"); - page = Globals.active_win->page; - page = HLPFILE_PageByOffset(page->file, page->browse_bwd); - if (page) - { - page->file->wRefCount++; - WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL); - } -} - -void CALLBACK MACRO_Print(void) -{ - PRINTDLG printer; - - WINE_TRACE("()\n"); - - printer.lStructSize = sizeof(printer); - printer.hwndOwner = Globals.active_win->hMainWnd; - printer.hInstance = Globals.hInstance; - printer.hDevMode = 0; - printer.hDevNames = 0; - printer.hDC = 0; - printer.Flags = 0; - printer.nFromPage = 0; - printer.nToPage = 0; - printer.nMinPage = 0; - printer.nMaxPage = 0; - printer.nCopies = 0; - printer.lCustData = 0; - printer.lpfnPrintHook = 0; - printer.lpfnSetupHook = 0; - printer.lpPrintTemplateName = 0; - printer.lpSetupTemplateName = 0; - printer.hPrintTemplate = 0; - printer.hSetupTemplate = 0; - - if (PrintDlgA(&printer)) { - WINE_FIXME("Print()\n"); - } -} - -void CALLBACK MACRO_PrinterSetup(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args) -{ - FARPROC fn = NULL; - int size; - WINHELP_DLL* dll; - - WINE_TRACE("(\"%s\", \"%s\", \"%s\")\n", dll_name, proc, args); - - /* FIXME: are the registered DLLs global or linked to the current file ??? - * We assume globals (as we did for macros, but is this really the case ???) - */ - for (dll = Globals.dlls; dll; dll = dll->next) - { - if (!strcmp(dll->name, dll_name)) break; - } - if (!dll) - { - HANDLE hLib = LoadLibrary(dll_name); - - /* FIXME: the library will not be unloaded until exit of program - * We don't send the DW_TERM message - */ - WINE_TRACE("Loading %s\n", dll_name); - /* FIXME: should look in the directory where current hlpfile - * is loaded from - */ - if (hLib == NULL) - { - /* FIXME: internationalisation for error messages */ - WINE_FIXME("Cannot find dll %s\n", dll_name); - } - else if ((dll = HeapAlloc(GetProcessHeap(), 0, sizeof(*dll)))) - { - dll->hLib = hLib; - dll->name = strdup(dll_name); /* FIXME */ - dll->next = Globals.dlls; - Globals.dlls = dll; - dll->handler = (WINHELP_LDLLHandler)GetProcAddress(dll->hLib, "LDLLHandler"); - dll->class = dll->handler ? (dll->handler)(DW_WHATMSG, 0, 0) : DC_NOMSG; - WINE_TRACE("Got class %x for DLL %s\n", dll->class, dll_name); - if (dll->class & DC_INITTERM) dll->handler(DW_INIT, 0, 0); - if (dll->class & DC_CALLBACKS) dll->handler(DW_CALLBACKS, (DWORD)Callbacks, 0); - } - else WINE_WARN("OOM\n"); - } - if (dll && !(fn = GetProcAddress(dll->hLib, proc))) - { - /* FIXME: internationalisation for error messages */ - WINE_FIXME("Cannot find proc %s in dll %s\n", dll_name, proc); - } - - size = ++MACRO_NumLoaded * sizeof(struct MacroDesc); - if (!MACRO_Loaded) MACRO_Loaded = HeapAlloc(GetProcessHeap(), 0, size); - else MACRO_Loaded = HeapReAlloc(GetProcessHeap(), 0, MACRO_Loaded, size); - MACRO_Loaded[MACRO_NumLoaded - 1].name = strdup(proc); /* FIXME */ - MACRO_Loaded[MACRO_NumLoaded - 1].alias = NULL; - MACRO_Loaded[MACRO_NumLoaded - 1].isBool = 0; - MACRO_Loaded[MACRO_NumLoaded - 1].arguments = strdup(args); /* FIXME */ - MACRO_Loaded[MACRO_NumLoaded - 1].fn = fn; - WINE_TRACE("Added %s(%s) at %p\n", proc, args, fn); -} - -void CALLBACK MACRO_RemoveAccelerator(LONG u1, LONG u2) -{ - WINE_FIXME("(%u, %u)\n", u1, u2); -} - -void CALLBACK MACRO_ResetMenu(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_SaveMark(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_Search(void) -{ - WINE_FIXME("()\n"); -} - -void CALLBACK MACRO_SetContents(LPCSTR str, LONG u) -{ - WINE_FIXME("(\"%s\", %u)\n", str, u); -} - -void CALLBACK MACRO_SetHelpOnFile(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_SetPopupColor(LONG u1, LONG u2, LONG u3) -{ - WINE_FIXME("(%u, %u, %u)\n", u1, u2, u3); -} - -void CALLBACK MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4) -{ - WINE_FIXME("(\"%s\", \"%s\", %u, %u, \"%s\", \"%s\")\n", str1, str2, u1, u2, str3, str4); -} - -void CALLBACK MACRO_ShortCut(LPCSTR str1, LPCSTR str2, LONG w, LONG l, LPCSTR str) -{ - WINE_FIXME("(\"%s\", \"%s\", %x, %x, \"%s\")\n", str1, str2, w, l, str); -} - -void CALLBACK MACRO_TCard(LONG u) -{ - WINE_FIXME("(%u)\n", u); -} - -void CALLBACK MACRO_Test(LONG u) -{ - WINE_FIXME("(%u)\n", u); -} - -BOOL CALLBACK MACRO_TestALink(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); - return FALSE; -} - -BOOL CALLBACK MACRO_TestKLink(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); - return FALSE; -} - -void CALLBACK MACRO_UncheckItem(LPCSTR str) -{ - WINE_FIXME("(\"%s\")\n", str); -} - -void CALLBACK MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2) -{ - WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); -} +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * Copyright 2002 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_LEAN_AND_MEAN + +#include + +#include "windows.h" +#include "commdlg.h" +#include "winhelp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winhelp); + +/**************************************************/ +/* Macro table */ +/**************************************************/ +struct MacroDesc { + const char* name; + const char* alias; + BOOL isBool; + const char* arguments; + FARPROC fn; +}; + +/* types: + * U: 32 bit unsigned int + * I: 32 bit signed int + * S: string + * v: unknown (32 bit entity) + */ + +static struct MacroDesc MACRO_Builtins[] = { + {"About", NULL, 0, "", (FARPROC)MACRO_About}, + {"AddAccelerator", "AA", 0, "UUS", (FARPROC)MACRO_AddAccelerator}, + {"ALink", "AL", 0, "SUS", (FARPROC)MACRO_ALink}, + {"Annotate", NULL, 0, "", (FARPROC)MACRO_Annotate}, + {"AppendItem", NULL, 0, "SSSS", (FARPROC)MACRO_AppendItem}, + {"Back", NULL, 0, "", (FARPROC)MACRO_Back}, + {"BackFlush", "BF", 0, "", (FARPROC)MACRO_BackFlush}, + {"BookmarkDefine", NULL, 0, "", (FARPROC)MACRO_BookmarkDefine}, + {"BookmarkMore", NULL, 0, "", (FARPROC)MACRO_BookmarkMore}, + {"BrowseButtons", NULL, 0, "", (FARPROC)MACRO_BrowseButtons}, + {"ChangeButtonBinding", "CBB",0, "SS", (FARPROC)MACRO_ChangeButtonBinding}, + {"ChangeEnable", "CE", 0, "SS", (FARPROC)MACRO_ChangeEnable}, + {"ChangeItemBinding", "CIB",0, "SS", (FARPROC)MACRO_ChangeItemBinding}, + {"CheckItem", "CI", 0, "S", (FARPROC)MACRO_CheckItem}, + {"CloseSecondarys", "CS", 0, "", (FARPROC)MACRO_CloseSecondarys}, + {"CloseWindow", "CW", 0, "S", (FARPROC)MACRO_CloseWindow}, + {"Compare", NULL, 0, "S", (FARPROC)MACRO_Compare}, + {"Contents", NULL, 0, "", (FARPROC)MACRO_Contents}, + {"ControlPanel", NULL, 0, "SSU", (FARPROC)MACRO_ControlPanel}, + {"CopyDialog", NULL, 0, "", (FARPROC)MACRO_CopyDialog}, + {"CopyTopic", "CT", 0, "", (FARPROC)MACRO_CopyTopic}, + {"CreateButton", "CB", 0, "SSS", (FARPROC)MACRO_CreateButton}, + {"DeleteItem", NULL, 0, "S", (FARPROC)MACRO_DeleteItem}, + {"DeleteMark", NULL, 0, "S", (FARPROC)MACRO_DeleteMark}, + {"DestroyButton", NULL, 0, "S", (FARPROC)MACRO_DestroyButton}, + {"DisableButton", "DB", 0, "S", (FARPROC)MACRO_DisableButton}, + {"DisableItem", "DI", 0, "S", (FARPROC)MACRO_DisableItem}, + {"EnableButton", "EB", 0, "S", (FARPROC)MACRO_EnableButton}, + {"EnableItem", "EI", 0, "S", (FARPROC)MACRO_EnableItem}, + {"EndMPrint", NULL, 0, "", (FARPROC)MACRO_EndMPrint}, + {"ExecFile", "EF", 0, "SSUS", (FARPROC)MACRO_ExecFile}, + {"ExecProgram", "EP", 0, "SU", (FARPROC)MACRO_ExecProgram}, + {"Exit", NULL, 0, "", (FARPROC)MACRO_Exit}, + {"ExtAbleItem", NULL, 0, "SU", (FARPROC)MACRO_ExtAbleItem}, + {"ExtInsertItem", NULL, 0, "SSSSUU", (FARPROC)MACRO_ExtInsertItem}, + {"ExtInsertMenu", NULL, 0, "SSSUU", (FARPROC)MACRO_ExtInsertMenu}, + {"FileExist", "FE", 1, "S", (FARPROC)MACRO_FileExist}, + {"FileOpen", "FO", 0, "", (FARPROC)MACRO_FileOpen}, + {"Find", NULL, 0, "", (FARPROC)MACRO_Find}, + {"Finder", "FD", 0, "", (FARPROC)MACRO_Finder}, + {"FloatingMenu", NULL, 0, "", (FARPROC)MACRO_FloatingMenu}, + {"Flush", "FH", 0, "", (FARPROC)MACRO_Flush}, + {"FocusWindow", NULL, 0, "S", (FARPROC)MACRO_FocusWindow}, + {"Generate", NULL, 0, "SUU", (FARPROC)MACRO_Generate}, + {"GotoMark", NULL, 0, "S", (FARPROC)MACRO_GotoMark}, + {"HelpOn", NULL, 0, "", (FARPROC)MACRO_HelpOn}, + {"HelpOnTop", NULL, 0, "", (FARPROC)MACRO_HelpOnTop}, + {"History", NULL, 0, "", (FARPROC)MACRO_History}, + {"InitMPrint", NULL, 1, "", (FARPROC)MACRO_InitMPrint}, + {"InsertItem", NULL, 0, "SSSSU", (FARPROC)MACRO_InsertItem}, + {"InsertMenu", NULL, 0, "SSU", (FARPROC)MACRO_InsertMenu}, + {"IfThen", "IF", 0, "BS", (FARPROC)MACRO_IfThen}, + {"IfThenElse", "IE", 0, "BSS", (FARPROC)MACRO_IfThenElse}, + {"IsBook", NULL, 1, "", (FARPROC)MACRO_IsBook}, + {"IsMark", NULL, 1, "S", (FARPROC)MACRO_IsMark}, + {"IsNotMark", "NM", 1, "S", (FARPROC)MACRO_IsNotMark}, + {"JumpContents", NULL, 0, "SS", (FARPROC)MACRO_JumpContents}, + {"JumpContext", "JC", 0, "SSU", (FARPROC)MACRO_JumpContext}, + {"JumpHash", "JH", 0, "SSU", (FARPROC)MACRO_JumpHash}, + {"JumpHelpOn", NULL, 0, "", (FARPROC)MACRO_JumpHelpOn}, + {"JumpID", "JI", 0, "SSS", (FARPROC)MACRO_JumpID}, + {"JumpKeyword", "JK", 0, "SSS", (FARPROC)MACRO_JumpKeyword}, + {"KLink", "KL", 0, "SUSS", (FARPROC)MACRO_KLink}, + {"Menu", "MU", 0, "", (FARPROC)MACRO_Menu}, + {"MPrintHash", NULL, 0, "U", (FARPROC)MACRO_MPrintHash}, + {"MPrintID", NULL, 0, "S", (FARPROC)MACRO_MPrintID}, + {"Next", NULL, 0, "", (FARPROC)MACRO_Next}, + {"NoShow", NULL, 0, "", (FARPROC)MACRO_NoShow}, + {"PopupContext", "PC", 0, "SU", (FARPROC)MACRO_PopupContext}, + {"PopupHash", NULL, 0, "SU", (FARPROC)MACRO_PopupHash}, + {"PopupId", "PI", 0, "SS", (FARPROC)MACRO_PopupId}, + {"PositionWindow", "PW", 0, "IIUUUS", (FARPROC)MACRO_PositionWindow}, + {"Prev", NULL, 0, "", (FARPROC)MACRO_Prev}, + {"Print", NULL, 0, "", (FARPROC)MACRO_Print}, + {"PrinterSetup", NULL, 0, "", (FARPROC)MACRO_PrinterSetup}, + {"RegisterRoutine", "RR", 0, "SSS", (FARPROC)MACRO_RegisterRoutine}, + {"RemoveAccelerator", "RA", 0, "UU", (FARPROC)MACRO_RemoveAccelerator}, + {"ResetMenu", NULL, 0, "", (FARPROC)MACRO_ResetMenu}, + {"SaveMark", NULL, 0, "S", (FARPROC)MACRO_SaveMark}, + {"Search", NULL, 0, "", (FARPROC)MACRO_Search}, + {"SetContents", NULL, 0, "SU", (FARPROC)MACRO_SetContents}, + {"SetHelpOnFile", NULL, 0, "S", (FARPROC)MACRO_SetHelpOnFile}, + {"SetPopupColor", "SPC",0, "UUU", (FARPROC)MACRO_SetPopupColor}, + {"ShellExecute", "SE", 0, "SSUUSS", (FARPROC)MACRO_ShellExecute}, + {"ShortCut", "SH", 0, "SSUUS", (FARPROC)MACRO_ShortCut}, + {"TCard", NULL, 0, "U", (FARPROC)MACRO_TCard}, + {"Test", NULL, 0, "U", (FARPROC)MACRO_Test}, + {"TestALink", NULL, 1, "S", (FARPROC)MACRO_TestALink}, + {"TestKLink", NULL, 1, "S", (FARPROC)MACRO_TestKLink}, + {"UncheckItem", "UI", 0, "S", (FARPROC)MACRO_UncheckItem}, + {"UpdateWindow", "UW", 0, "SS", (FARPROC)MACRO_UpdateWindow}, + {NULL, NULL, 0, NULL, NULL} +}; + +static struct MacroDesc*MACRO_Loaded /* = NULL */; +static unsigned MACRO_NumLoaded /* = 0 */; + +static int MACRO_DoLookUp(struct MacroDesc* start, const char* name, struct lexret* lr, unsigned len) +{ + struct MacroDesc* md; + + for (md = start; md->name && len != 0; md++, len--) + { + if (strcasecmp(md->name, name) == 0 || (md->alias != NULL && strcasecmp(md->alias, name) == 0)) + { + lr->proto = md->arguments; + lr->function = md->fn; + return md->isBool ? BOOL_FUNCTION : VOID_FUNCTION; + } + } + return EMPTY; +} + +int MACRO_Lookup(const char* name, struct lexret* lr) +{ + int ret; + + if ((ret = MACRO_DoLookUp(MACRO_Builtins, name, lr, -1)) != EMPTY) + return ret; + if (MACRO_Loaded && (ret = MACRO_DoLookUp(MACRO_Loaded, name, lr, MACRO_NumLoaded)) != EMPTY) + return ret; + + lr->string = name; + return IDENTIFIER; +} + +/******* helper functions *******/ + +static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR name) +{ + WINHELP_BUTTON** b; + + for (b = &win->first_button; *b; b = &(*b)->next) + if (!lstrcmpi(name, (*b)->lpszID)) break; + return b; +} + +/******* real macro implementation *******/ + +void CALLBACK MACRO_About(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_AddAccelerator(LONG u1, LONG u2, LPCSTR str) +{ + WINE_FIXME("(%u, %u, \"%s\")\n", u1, u2, str); +} + +void CALLBACK MACRO_ALink(LPCSTR str1, LONG u, LPCSTR str2) +{ + WINE_FIXME("(\"%s\", %u, \"%s\")\n", str1, u, str2); +} + +void CALLBACK MACRO_Annotate(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_AppendItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4) +{ + WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\")\n", str1, str2, str3, str4); +} + +void CALLBACK MACRO_Back(void) +{ + WINHELP_WINDOW* win = Globals.active_win; + + WINE_TRACE("()\n"); + + if (win && win->backIndex >= 2) + WINHELP_CreateHelpWindow(win->back[--win->backIndex - 1], + win->info, SW_SHOW); +} + +void CALLBACK MACRO_BackFlush(void) +{ + WINHELP_WINDOW* win = Globals.active_win; + + WINE_TRACE("()\n"); + + if (win) + { + int i; + + for (i = 0; i < win->backIndex; i++) + { + HLPFILE_FreeHlpFile(win->back[i]->file); + win->back[i] = NULL; + } + win->backIndex = 0; + } +} + +void CALLBACK MACRO_BookmarkDefine(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_BookmarkMore(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_BrowseButtons(void) +{ + WINE_TRACE("()\n"); + + MACRO_CreateButton("BTN_PREV", "&<<", "Prev()"); + MACRO_CreateButton("BTN_NEXT", "&>>", "Next()"); +} + +void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) +{ + WINHELP_WINDOW* win = Globals.active_win; + WINHELP_BUTTON* button; + WINHELP_BUTTON** b; + LONG size; + LPSTR ptr; + + WINE_TRACE("(\"%s\", \"%s\")\n", id, macro); + + b = MACRO_LookupButton(win, id); + if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} + + size = sizeof(WINHELP_BUTTON) + lstrlen(id) + + lstrlen((*b)->lpszName) + lstrlen(macro) + 3; + + button = HeapAlloc(GetProcessHeap(), 0, size); + if (!button) return; + + button->next = (*b)->next; + button->hWnd = (*b)->hWnd; + button->wParam = (*b)->wParam; + + ptr = (char*)button + sizeof(WINHELP_BUTTON); + + lstrcpy(ptr, id); + button->lpszID = ptr; + ptr += lstrlen(id) + 1; + + lstrcpy(ptr, (*b)->lpszName); + button->lpszName = ptr; + ptr += lstrlen((*b)->lpszName) + 1; + + lstrcpy(ptr, macro); + button->lpszMacro = ptr; + + *b = button; + + SendMessage(win->hMainWnd, WM_USER, 0, 0); +} + +void CALLBACK MACRO_ChangeEnable(LPCSTR id, LPCSTR macro) +{ + WINE_TRACE("(\"%s\", \"%s\")\n", id, macro); + + MACRO_ChangeButtonBinding(id, macro); + MACRO_EnableButton(id); +} + +void CALLBACK MACRO_ChangeItemBinding(LPCSTR str1, LPCSTR str2) +{ + WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); +} + +void CALLBACK MACRO_CheckItem(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_CloseSecondarys(void) +{ + WINHELP_WINDOW *win; + + WINE_TRACE("()\n"); + for (win = Globals.win_list; win; win = win->next) + if (win->lpszName && lstrcmpi(win->lpszName, "main")) + DestroyWindow(win->hMainWnd); +} + +void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) +{ + WINHELP_WINDOW *win; + + WINE_TRACE("(\"%s\")\n", lpszWindow); + + if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; + + for (win = Globals.win_list; win; win = win->next) + if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow)) + DestroyWindow(win->hMainWnd); +} + +void CALLBACK MACRO_Compare(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_Contents(void) +{ + WINE_TRACE("()\n"); + + if (Globals.active_win->page) + MACRO_JumpContents(Globals.active_win->page->file->lpszPath, NULL); +} + +void CALLBACK MACRO_ControlPanel(LPCSTR str1, LPCSTR str2, LONG u) +{ + WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); +} + +void CALLBACK MACRO_CopyDialog(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_CopyTopic(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) +{ + WINHELP_WINDOW *win = Globals.active_win; + WINHELP_BUTTON *button, **b; + LONG size; + LPSTR ptr; + + WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro); + + size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; + + button = HeapAlloc(GetProcessHeap(), 0, size); + if (!button) return; + + button->next = 0; + button->hWnd = 0; + + ptr = (char*)button + sizeof(WINHELP_BUTTON); + + lstrcpy(ptr, id); + button->lpszID = ptr; + ptr += lstrlen(id) + 1; + + lstrcpy(ptr, name); + button->lpszName = ptr; + ptr += lstrlen(name) + 1; + + lstrcpy(ptr, macro); + button->lpszMacro = ptr; + + button->wParam = WH_FIRST_BUTTON; + for (b = &win->first_button; *b; b = &(*b)->next) + button->wParam = max(button->wParam, (*b)->wParam + 1); + *b = button; + + SendMessage(win->hMainWnd, WM_USER, 0, 0); +} + +void CALLBACK MACRO_DeleteItem(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_DeleteMark(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_DestroyButton(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_DisableButton(LPCSTR id) +{ + WINHELP_BUTTON** b; + + WINE_FIXME("(\"%s\")\n", id); + + b = MACRO_LookupButton(Globals.active_win, id); + if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} + + EnableWindow((*b)->hWnd, FALSE); +} + +void CALLBACK MACRO_DisableItem(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_EnableButton(LPCSTR id) +{ + WINHELP_BUTTON** b; + + WINE_TRACE("(\"%s\")\n", id); + + b = MACRO_LookupButton(Globals.active_win, id); + if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} + + EnableWindow((*b)->hWnd, TRUE); +} + +void CALLBACK MACRO_EnableItem(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_EndMPrint(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3) +{ + WINE_FIXME("(\"%s\", \"%s\", %u, \"%s\")\n", str1, str2, u, str3); +} + +void CALLBACK MACRO_ExecProgram(LPCSTR str, LONG u) +{ + WINE_FIXME("(\"%s\", %u)\n", str, u); +} + +void CALLBACK MACRO_Exit(void) +{ + WINE_TRACE("()\n"); + + while (Globals.win_list) + DestroyWindow(Globals.win_list->hMainWnd); +} + +void CALLBACK MACRO_ExtAbleItem(LPCSTR str, LONG u) +{ + WINE_FIXME("(\"%s\", %u)\n", str, u); +} + +void CALLBACK MACRO_ExtInsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u1, LONG u2) +{ + WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, str4, u1, u2); +} + +void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, LONG u1, LONG u2) +{ + WINE_FIXME("(\"%s\", \"%s\", \"%s\", %u, %u)\n", str1, str2, str3, u1, u2); +} + +BOOL CALLBACK MACRO_FileExist(LPCSTR str) +{ + WINE_TRACE("(\"%s\")\n", str); + return GetFileAttributes(str) != INVALID_FILE_ATTRIBUTES; +} + +void CALLBACK MACRO_FileOpen(void) +{ + char szFile[MAX_PATH]; + + if (WINHELP_GetOpenFileName(szFile, MAX_PATH)) + { + HLPFILE* hlpfile = WINHELP_LookupHelpFile(szFile); + + WINHELP_CreateHelpWindowByHash(hlpfile, 0, + WINHELP_GetWindowInfo(hlpfile, "main"), SW_SHOWNORMAL); + } +} + +void CALLBACK MACRO_Find(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_Finder(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_FloatingMenu(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_Flush(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) +{ + WINHELP_WINDOW *win; + + WINE_TRACE("(\"%s\")\n", lpszWindow); + + if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; + + for (win = Globals.win_list; win; win = win->next) + if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow)) + SetFocus(win->hMainWnd); +} + +void CALLBACK MACRO_Generate(LPCSTR str, LONG w, LONG l) +{ + WINE_FIXME("(\"%s\", %x, %x)\n", str, w, l); +} + +void CALLBACK MACRO_GotoMark(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_HelpOn(void) +{ + WINE_TRACE("()\n"); + MACRO_JumpContents((Globals.wVersion > 4) ? "winhelp32.hlp" : "winhelp.hlp", NULL); +} + +void CALLBACK MACRO_HelpOnTop(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_History(void) +{ + WINE_TRACE("()\n"); + + if (Globals.active_win && !Globals.active_win->hHistoryWnd) + { + HWND hWnd = CreateWindow(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW, + 0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win); + ShowWindow(hWnd, SW_NORMAL); + } +} + +void CALLBACK MACRO_IfThen(BOOL b, LPCSTR t) +{ + if (b) MACRO_ExecuteMacro(t); +} + +void CALLBACK MACRO_IfThenElse(BOOL b, LPCSTR t, LPCSTR f) +{ + if (b) MACRO_ExecuteMacro(t); else MACRO_ExecuteMacro(f); +} + +BOOL CALLBACK MACRO_InitMPrint(void) +{ + WINE_FIXME("()\n"); + return FALSE; +} + +void CALLBACK MACRO_InsertItem(LPCSTR str1, LPCSTR str2, LPCSTR str3, LPCSTR str4, LONG u) +{ + WINE_FIXME("(\"%s\", \"%s\", \"%s\", \"%s\", %u)\n", str1, str2, str3, str4, u); +} + +void CALLBACK MACRO_InsertMenu(LPCSTR str1, LPCSTR str2, LONG u) +{ + WINE_FIXME("(\"%s\", \"%s\", %u)\n", str1, str2, u); +} + +BOOL CALLBACK MACRO_IsBook(void) +{ + WINE_TRACE("()\n"); + return Globals.isBook; +} + +BOOL CALLBACK MACRO_IsMark(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); + return FALSE; +} + +BOOL CALLBACK MACRO_IsNotMark(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); + return TRUE; +} + +void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow) +{ + HLPFILE* hlpfile; + + WINE_TRACE("(\"%s\", \"%s\")\n", lpszPath, lpszWindow); + hlpfile = WINHELP_LookupHelpFile(lpszPath); + WINHELP_CreateHelpWindowByHash(hlpfile, 0, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); +} + +void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context) +{ + HLPFILE* hlpfile; + + WINE_TRACE("(\"%s\", \"%s\", %d)\n", lpszPath, lpszWindow, context); + hlpfile = WINHELP_LookupHelpFile(lpszPath); + /* Some madness: what user calls 'context', hlpfile calls 'map' */ + WINHELP_CreateHelpWindowByMap(hlpfile, context, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); +} + +void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) +{ + HLPFILE* hlpfile; + + WINE_TRACE("(\"%s\", \"%s\", %u)\n", lpszPath, lpszWindow, lHash); + hlpfile = WINHELP_LookupHelpFile(lpszPath); + WINHELP_CreateHelpWindowByHash(hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); +} + +void CALLBACK MACRO_JumpHelpOn(void) +{ + WINE_FIXME("()\n"); +} + +/* FIXME: those two macros are wrong + * they should only contain 2 strings, path & window are coded as path>window + */ +void CALLBACK MACRO_JumpID(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR topic_id) +{ + WINE_TRACE("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, topic_id); + MACRO_JumpHash(lpszPath, lpszWindow, HLPFILE_Hash(topic_id)); +} + +void CALLBACK MACRO_JumpKeyword(LPCSTR lpszPath, LPCSTR lpszWindow, LPCSTR keyword) +{ + WINE_FIXME("(\"%s\", \"%s\", \"%s\")\n", lpszPath, lpszWindow, keyword); +} + +void CALLBACK MACRO_KLink(LPCSTR str1, LONG u, LPCSTR str2, LPCSTR str3) +{ + WINE_FIXME("(\"%s\", %u, \"%s\", \"%s\")\n", str1, u, str2, str3); +} + +void CALLBACK MACRO_Menu(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_MPrintHash(LONG u) +{ + WINE_FIXME("(%u)\n", u); +} + +void CALLBACK MACRO_MPrintID(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_Next(void) +{ + HLPFILE_PAGE* page; + + WINE_TRACE("()\n"); + page = Globals.active_win->page; + page = HLPFILE_PageByOffset(page->file, page->browse_fwd); + if (page) + { + page->file->wRefCount++; + WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL); + } +} + +void CALLBACK MACRO_NoShow(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_PopupContext(LPCSTR str, LONG u) +{ + WINE_FIXME("(\"%s\", %u)\n", str, u); +} + +void CALLBACK MACRO_PopupHash(LPCSTR str, LONG u) +{ + WINE_FIXME("(\"%s\", %u)\n", str, u); +} + +void CALLBACK MACRO_PopupId(LPCSTR str1, LPCSTR str2) +{ + WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); +} + +void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3, LPCSTR str) +{ + WINE_FIXME("(%i, %i, %u, %u, %u, \"%s\")\n", i1, i2, u1, u2, u3, str); +} + +void CALLBACK MACRO_Prev(void) +{ + HLPFILE_PAGE* page; + + WINE_TRACE("()\n"); + page = Globals.active_win->page; + page = HLPFILE_PageByOffset(page->file, page->browse_bwd); + if (page) + { + page->file->wRefCount++; + WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL); + } +} + +void CALLBACK MACRO_Print(void) +{ + PRINTDLG printer; + + WINE_TRACE("()\n"); + + printer.lStructSize = sizeof(printer); + printer.hwndOwner = Globals.active_win->hMainWnd; + printer.hInstance = Globals.hInstance; + printer.hDevMode = 0; + printer.hDevNames = 0; + printer.hDC = 0; + printer.Flags = 0; + printer.nFromPage = 0; + printer.nToPage = 0; + printer.nMinPage = 0; + printer.nMaxPage = 0; + printer.nCopies = 0; + printer.lCustData = 0; + printer.lpfnPrintHook = 0; + printer.lpfnSetupHook = 0; + printer.lpPrintTemplateName = 0; + printer.lpSetupTemplateName = 0; + printer.hPrintTemplate = 0; + printer.hSetupTemplate = 0; + + if (PrintDlgA(&printer)) { + WINE_FIXME("Print()\n"); + } +} + +void CALLBACK MACRO_PrinterSetup(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR args) +{ + FARPROC fn = NULL; + int size; + WINHELP_DLL* dll; + + WINE_TRACE("(\"%s\", \"%s\", \"%s\")\n", dll_name, proc, args); + + /* FIXME: are the registered DLLs global or linked to the current file ??? + * We assume globals (as we did for macros, but is this really the case ???) + */ + for (dll = Globals.dlls; dll; dll = dll->next) + { + if (!strcmp(dll->name, dll_name)) break; + } + if (!dll) + { + HANDLE hLib = LoadLibrary(dll_name); + + /* FIXME: the library will not be unloaded until exit of program + * We don't send the DW_TERM message + */ + WINE_TRACE("Loading %s\n", dll_name); + /* FIXME: should look in the directory where current hlpfile + * is loaded from + */ + if (hLib == NULL) + { + /* FIXME: internationalisation for error messages */ + WINE_FIXME("Cannot find dll %s\n", dll_name); + } + else if ((dll = HeapAlloc(GetProcessHeap(), 0, sizeof(*dll)))) + { + dll->hLib = hLib; + dll->name = strdup(dll_name); /* FIXME */ + dll->next = Globals.dlls; + Globals.dlls = dll; + dll->handler = (WINHELP_LDLLHandler)GetProcAddress(dll->hLib, "LDLLHandler"); + dll->class = dll->handler ? (dll->handler)(DW_WHATMSG, 0, 0) : DC_NOMSG; + WINE_TRACE("Got class %x for DLL %s\n", dll->class, dll_name); + if (dll->class & DC_INITTERM) dll->handler(DW_INIT, 0, 0); + if (dll->class & DC_CALLBACKS) dll->handler(DW_CALLBACKS, (DWORD)Callbacks, 0); + } + else WINE_WARN("OOM\n"); + } + if (dll && !(fn = GetProcAddress(dll->hLib, proc))) + { + /* FIXME: internationalisation for error messages */ + WINE_FIXME("Cannot find proc %s in dll %s\n", dll_name, proc); + } + + size = ++MACRO_NumLoaded * sizeof(struct MacroDesc); + if (!MACRO_Loaded) MACRO_Loaded = HeapAlloc(GetProcessHeap(), 0, size); + else MACRO_Loaded = HeapReAlloc(GetProcessHeap(), 0, MACRO_Loaded, size); + MACRO_Loaded[MACRO_NumLoaded - 1].name = strdup(proc); /* FIXME */ + MACRO_Loaded[MACRO_NumLoaded - 1].alias = NULL; + MACRO_Loaded[MACRO_NumLoaded - 1].isBool = 0; + MACRO_Loaded[MACRO_NumLoaded - 1].arguments = strdup(args); /* FIXME */ + MACRO_Loaded[MACRO_NumLoaded - 1].fn = fn; + WINE_TRACE("Added %s(%s) at %p\n", proc, args, fn); +} + +void CALLBACK MACRO_RemoveAccelerator(LONG u1, LONG u2) +{ + WINE_FIXME("(%u, %u)\n", u1, u2); +} + +void CALLBACK MACRO_ResetMenu(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_SaveMark(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_Search(void) +{ + WINE_FIXME("()\n"); +} + +void CALLBACK MACRO_SetContents(LPCSTR str, LONG u) +{ + WINE_FIXME("(\"%s\", %u)\n", str, u); +} + +void CALLBACK MACRO_SetHelpOnFile(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_SetPopupColor(LONG u1, LONG u2, LONG u3) +{ + WINE_FIXME("(%u, %u, %u)\n", u1, u2, u3); +} + +void CALLBACK MACRO_ShellExecute(LPCSTR str1, LPCSTR str2, LONG u1, LONG u2, LPCSTR str3, LPCSTR str4) +{ + WINE_FIXME("(\"%s\", \"%s\", %u, %u, \"%s\", \"%s\")\n", str1, str2, u1, u2, str3, str4); +} + +void CALLBACK MACRO_ShortCut(LPCSTR str1, LPCSTR str2, LONG w, LONG l, LPCSTR str) +{ + WINE_FIXME("(\"%s\", \"%s\", %x, %x, \"%s\")\n", str1, str2, w, l, str); +} + +void CALLBACK MACRO_TCard(LONG u) +{ + WINE_FIXME("(%u)\n", u); +} + +void CALLBACK MACRO_Test(LONG u) +{ + WINE_FIXME("(%u)\n", u); +} + +BOOL CALLBACK MACRO_TestALink(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); + return FALSE; +} + +BOOL CALLBACK MACRO_TestKLink(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); + return FALSE; +} + +void CALLBACK MACRO_UncheckItem(LPCSTR str) +{ + WINE_FIXME("(\"%s\")\n", str); +} + +void CALLBACK MACRO_UpdateWindow(LPCSTR str1, LPCSTR str2) +{ + WINE_FIXME("(\"%s\", \"%s\")\n", str1, str2); +} diff --git a/reactos/base/applications/winhelp/macro.h b/reactos/base/applications/winhelp/macro.h index 68be1c69186..a1bfbc61ffb 100644 --- a/reactos/base/applications/winhelp/macro.h +++ b/reactos/base/applications/winhelp/macro.h @@ -1,140 +1,140 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * Copyright 2002 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __MACRO_H__ -#define __MACRO_H__ - -#include - -#include "windef.h" -#include "winbase.h" - -struct lexret { - LPCSTR proto; - BOOL bool; - LONG integer; - LPCSTR string; - FARPROC function; -}; - -extern struct lexret yylval; - -BOOL MACRO_ExecuteMacro(LPCSTR); -int MACRO_Lookup(const char* name, struct lexret* lr); - -enum token_types {EMPTY, VOID_FUNCTION, BOOL_FUNCTION, INTEGER, STRING, IDENTIFIER}; -void CALLBACK MACRO_About(void); -void CALLBACK MACRO_AddAccelerator(LONG, LONG, LPCSTR); -void CALLBACK MACRO_ALink(LPCSTR, LONG, LPCSTR); -void CALLBACK MACRO_Annotate(void); -void CALLBACK MACRO_AppendItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_Back(void); -void CALLBACK MACRO_BackFlush(void); -void CALLBACK MACRO_BookmarkDefine(void); -void CALLBACK MACRO_BookmarkMore(void); -void CALLBACK MACRO_BrowseButtons(void); -void CALLBACK MACRO_ChangeButtonBinding(LPCSTR, LPCSTR); -void CALLBACK MACRO_ChangeEnable(LPCSTR, LPCSTR); -void CALLBACK MACRO_ChangeItemBinding(LPCSTR, LPCSTR); -void CALLBACK MACRO_CheckItem(LPCSTR); -void CALLBACK MACRO_CloseSecondarys(void); -void CALLBACK MACRO_CloseWindow(LPCSTR); -void CALLBACK MACRO_Compare(LPCSTR); -void CALLBACK MACRO_Contents(void); -void CALLBACK MACRO_ControlPanel(LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_CopyDialog(void); -void CALLBACK MACRO_CopyTopic(void); -void CALLBACK MACRO_CreateButton(LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_DeleteItem(LPCSTR); -void CALLBACK MACRO_DeleteMark(LPCSTR); -void CALLBACK MACRO_DestroyButton(LPCSTR); -void CALLBACK MACRO_DisableButton(LPCSTR); -void CALLBACK MACRO_DisableItem(LPCSTR); -void CALLBACK MACRO_EnableButton(LPCSTR); -void CALLBACK MACRO_EnableItem(LPCSTR); -void CALLBACK MACRO_EndMPrint(void); -void CALLBACK MACRO_ExecFile(LPCSTR, LPCSTR, LONG, LPCSTR); -void CALLBACK MACRO_ExecProgram(LPCSTR, LONG); -void CALLBACK MACRO_Exit(void); -void CALLBACK MACRO_ExtAbleItem(LPCSTR, LONG); -void CALLBACK MACRO_ExtInsertItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR, LONG, LONG); -void CALLBACK MACRO_ExtInsertMenu(LPCSTR, LPCSTR, LPCSTR, LONG, LONG); -BOOL CALLBACK MACRO_FileExist(LPCSTR); -void CALLBACK MACRO_FileOpen(void); -void CALLBACK MACRO_Find(void); -void CALLBACK MACRO_Finder(void); -void CALLBACK MACRO_FloatingMenu(void); -void CALLBACK MACRO_Flush(void); -void CALLBACK MACRO_FocusWindow(LPCSTR); -void CALLBACK MACRO_Generate(LPCSTR, LONG, LONG); -void CALLBACK MACRO_GotoMark(LPCSTR); -void CALLBACK MACRO_HelpOn(void); -void CALLBACK MACRO_HelpOnTop(void); -void CALLBACK MACRO_History(void); -void CALLBACK MACRO_IfThen(BOOL, LPCSTR); -void CALLBACK MACRO_IfThenElse(BOOL, LPCSTR, LPCSTR); -BOOL CALLBACK MACRO_InitMPrint(void); -void CALLBACK MACRO_InsertItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_InsertMenu(LPCSTR, LPCSTR, LONG); -BOOL CALLBACK MACRO_IsBook(void); -BOOL CALLBACK MACRO_IsMark(LPCSTR); -BOOL CALLBACK MACRO_IsNotMark(LPCSTR); -void CALLBACK MACRO_JumpContents(LPCSTR, LPCSTR); -void CALLBACK MACRO_JumpContext(LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_JumpHash(LPCSTR, LPCSTR, LONG); -void CALLBACK MACRO_JumpHelpOn(void); -void CALLBACK MACRO_JumpID(LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_JumpKeyword(LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_KLink(LPCSTR, LONG, LPCSTR, LPCSTR); -void CALLBACK MACRO_Menu(void); -void CALLBACK MACRO_MPrintHash(LONG); -void CALLBACK MACRO_MPrintID(LPCSTR); -void CALLBACK MACRO_Next(void); -void CALLBACK MACRO_NoShow(void); -void CALLBACK MACRO_PopupContext(LPCSTR, LONG); -void CALLBACK MACRO_PopupHash(LPCSTR, LONG); -void CALLBACK MACRO_PopupId(LPCSTR, LPCSTR); -void CALLBACK MACRO_PositionWindow(LONG, LONG, LONG, LONG, LONG, LPCSTR); -void CALLBACK MACRO_Prev(void); -void CALLBACK MACRO_Print(void); -void CALLBACK MACRO_PrinterSetup(void); -void CALLBACK MACRO_RegisterRoutine(LPCSTR, LPCSTR, LPCSTR); -void CALLBACK MACRO_RemoveAccelerator(LONG, LONG); -void CALLBACK MACRO_ResetMenu(void); -void CALLBACK MACRO_SaveMark(LPCSTR); -void CALLBACK MACRO_Search(void); -void CALLBACK MACRO_SetContents(LPCSTR, LONG); -void CALLBACK MACRO_SetHelpOnFile(LPCSTR); -void CALLBACK MACRO_SetPopupColor(LONG, LONG, LONG); -void CALLBACK MACRO_ShellExecute(LPCSTR, LPCSTR, LONG, LONG, LPCSTR, LPCSTR); -void CALLBACK MACRO_ShortCut(LPCSTR, LPCSTR, LONG, LONG, LPCSTR); -void CALLBACK MACRO_TCard(LONG); -void CALLBACK MACRO_Test(LONG); -BOOL CALLBACK MACRO_TestALink(LPCSTR); -BOOL CALLBACK MACRO_TestKLink(LPCSTR); -void CALLBACK MACRO_UncheckItem(LPCSTR); -void CALLBACK MACRO_UpdateWindow(LPCSTR, LPCSTR); - -/* Local Variables: */ -/* c-file-style: "GNU" */ -/* End: */ - -#endif /* __MACRO_H__ */ +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * Copyright 2002 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __MACRO_H__ +#define __MACRO_H__ + +#include + +#include "windef.h" +#include "winbase.h" + +struct lexret { + LPCSTR proto; + BOOL bool; + LONG integer; + LPCSTR string; + FARPROC function; +}; + +extern struct lexret yylval; + +BOOL MACRO_ExecuteMacro(LPCSTR); +int MACRO_Lookup(const char* name, struct lexret* lr); + +enum token_types {EMPTY, VOID_FUNCTION, BOOL_FUNCTION, INTEGER, STRING, IDENTIFIER}; +void CALLBACK MACRO_About(void); +void CALLBACK MACRO_AddAccelerator(LONG, LONG, LPCSTR); +void CALLBACK MACRO_ALink(LPCSTR, LONG, LPCSTR); +void CALLBACK MACRO_Annotate(void); +void CALLBACK MACRO_AppendItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR); +void CALLBACK MACRO_Back(void); +void CALLBACK MACRO_BackFlush(void); +void CALLBACK MACRO_BookmarkDefine(void); +void CALLBACK MACRO_BookmarkMore(void); +void CALLBACK MACRO_BrowseButtons(void); +void CALLBACK MACRO_ChangeButtonBinding(LPCSTR, LPCSTR); +void CALLBACK MACRO_ChangeEnable(LPCSTR, LPCSTR); +void CALLBACK MACRO_ChangeItemBinding(LPCSTR, LPCSTR); +void CALLBACK MACRO_CheckItem(LPCSTR); +void CALLBACK MACRO_CloseSecondarys(void); +void CALLBACK MACRO_CloseWindow(LPCSTR); +void CALLBACK MACRO_Compare(LPCSTR); +void CALLBACK MACRO_Contents(void); +void CALLBACK MACRO_ControlPanel(LPCSTR, LPCSTR, LONG); +void CALLBACK MACRO_CopyDialog(void); +void CALLBACK MACRO_CopyTopic(void); +void CALLBACK MACRO_CreateButton(LPCSTR, LPCSTR, LPCSTR); +void CALLBACK MACRO_DeleteItem(LPCSTR); +void CALLBACK MACRO_DeleteMark(LPCSTR); +void CALLBACK MACRO_DestroyButton(LPCSTR); +void CALLBACK MACRO_DisableButton(LPCSTR); +void CALLBACK MACRO_DisableItem(LPCSTR); +void CALLBACK MACRO_EnableButton(LPCSTR); +void CALLBACK MACRO_EnableItem(LPCSTR); +void CALLBACK MACRO_EndMPrint(void); +void CALLBACK MACRO_ExecFile(LPCSTR, LPCSTR, LONG, LPCSTR); +void CALLBACK MACRO_ExecProgram(LPCSTR, LONG); +void CALLBACK MACRO_Exit(void); +void CALLBACK MACRO_ExtAbleItem(LPCSTR, LONG); +void CALLBACK MACRO_ExtInsertItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR, LONG, LONG); +void CALLBACK MACRO_ExtInsertMenu(LPCSTR, LPCSTR, LPCSTR, LONG, LONG); +BOOL CALLBACK MACRO_FileExist(LPCSTR); +void CALLBACK MACRO_FileOpen(void); +void CALLBACK MACRO_Find(void); +void CALLBACK MACRO_Finder(void); +void CALLBACK MACRO_FloatingMenu(void); +void CALLBACK MACRO_Flush(void); +void CALLBACK MACRO_FocusWindow(LPCSTR); +void CALLBACK MACRO_Generate(LPCSTR, LONG, LONG); +void CALLBACK MACRO_GotoMark(LPCSTR); +void CALLBACK MACRO_HelpOn(void); +void CALLBACK MACRO_HelpOnTop(void); +void CALLBACK MACRO_History(void); +void CALLBACK MACRO_IfThen(BOOL, LPCSTR); +void CALLBACK MACRO_IfThenElse(BOOL, LPCSTR, LPCSTR); +BOOL CALLBACK MACRO_InitMPrint(void); +void CALLBACK MACRO_InsertItem(LPCSTR, LPCSTR, LPCSTR, LPCSTR, LONG); +void CALLBACK MACRO_InsertMenu(LPCSTR, LPCSTR, LONG); +BOOL CALLBACK MACRO_IsBook(void); +BOOL CALLBACK MACRO_IsMark(LPCSTR); +BOOL CALLBACK MACRO_IsNotMark(LPCSTR); +void CALLBACK MACRO_JumpContents(LPCSTR, LPCSTR); +void CALLBACK MACRO_JumpContext(LPCSTR, LPCSTR, LONG); +void CALLBACK MACRO_JumpHash(LPCSTR, LPCSTR, LONG); +void CALLBACK MACRO_JumpHelpOn(void); +void CALLBACK MACRO_JumpID(LPCSTR, LPCSTR, LPCSTR); +void CALLBACK MACRO_JumpKeyword(LPCSTR, LPCSTR, LPCSTR); +void CALLBACK MACRO_KLink(LPCSTR, LONG, LPCSTR, LPCSTR); +void CALLBACK MACRO_Menu(void); +void CALLBACK MACRO_MPrintHash(LONG); +void CALLBACK MACRO_MPrintID(LPCSTR); +void CALLBACK MACRO_Next(void); +void CALLBACK MACRO_NoShow(void); +void CALLBACK MACRO_PopupContext(LPCSTR, LONG); +void CALLBACK MACRO_PopupHash(LPCSTR, LONG); +void CALLBACK MACRO_PopupId(LPCSTR, LPCSTR); +void CALLBACK MACRO_PositionWindow(LONG, LONG, LONG, LONG, LONG, LPCSTR); +void CALLBACK MACRO_Prev(void); +void CALLBACK MACRO_Print(void); +void CALLBACK MACRO_PrinterSetup(void); +void CALLBACK MACRO_RegisterRoutine(LPCSTR, LPCSTR, LPCSTR); +void CALLBACK MACRO_RemoveAccelerator(LONG, LONG); +void CALLBACK MACRO_ResetMenu(void); +void CALLBACK MACRO_SaveMark(LPCSTR); +void CALLBACK MACRO_Search(void); +void CALLBACK MACRO_SetContents(LPCSTR, LONG); +void CALLBACK MACRO_SetHelpOnFile(LPCSTR); +void CALLBACK MACRO_SetPopupColor(LONG, LONG, LONG); +void CALLBACK MACRO_ShellExecute(LPCSTR, LPCSTR, LONG, LONG, LPCSTR, LPCSTR); +void CALLBACK MACRO_ShortCut(LPCSTR, LPCSTR, LONG, LONG, LPCSTR); +void CALLBACK MACRO_TCard(LONG); +void CALLBACK MACRO_Test(LONG); +BOOL CALLBACK MACRO_TestALink(LPCSTR); +BOOL CALLBACK MACRO_TestKLink(LPCSTR); +void CALLBACK MACRO_UncheckItem(LPCSTR); +void CALLBACK MACRO_UpdateWindow(LPCSTR, LPCSTR); + +/* Local Variables: */ +/* c-file-style: "GNU" */ +/* End: */ + +#endif /* __MACRO_H__ */ diff --git a/reactos/base/applications/winhelp/string.c b/reactos/base/applications/winhelp/string.c index df85cf466eb..c27cce77e98 100644 --- a/reactos/base/applications/winhelp/string.c +++ b/reactos/base/applications/winhelp/string.c @@ -1,35 +1,35 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/* Class names */ - -const char MAIN_WIN_CLASS_NAME[] = "MS_WINHELP"; -const char BUTTON_BOX_WIN_CLASS_NAME[] = "WHButtonBox"; -const char TEXT_WIN_CLASS_NAME[] = "WHText"; -const char SHADOW_WIN_CLASS_NAME[] = "WHShadow"; -const char HISTORY_WIN_CLASS_NAME[] = "WHHistory"; -const char STRING_BUTTON[] = "BUTTON"; - -/* Resource names */ -const char STRING_DIALOG_TEST[] = "DIALOG_TEST"; - -/* Local Variables: */ -/* c-file-style: "GNU" */ -/* End: */ +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* Class names */ + +const char MAIN_WIN_CLASS_NAME[] = "MS_WINHELP"; +const char BUTTON_BOX_WIN_CLASS_NAME[] = "WHButtonBox"; +const char TEXT_WIN_CLASS_NAME[] = "WHText"; +const char SHADOW_WIN_CLASS_NAME[] = "WHShadow"; +const char HISTORY_WIN_CLASS_NAME[] = "WHHistory"; +const char STRING_BUTTON[] = "BUTTON"; + +/* Resource names */ +const char STRING_DIALOG_TEST[] = "DIALOG_TEST"; + +/* Local Variables: */ +/* c-file-style: "GNU" */ +/* End: */ diff --git a/reactos/base/applications/winhelp/winhelp.c b/reactos/base/applications/winhelp/winhelp.c index 8905d6e222e..c1800938b09 100644 --- a/reactos/base/applications/winhelp/winhelp.c +++ b/reactos/base/applications/winhelp/winhelp.c @@ -1,1930 +1,1930 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * 2002 Sylvain Petreolle - * 2002 Eric Pouech - * 2004 Ken Belleau - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "commdlg.h" -#include "winhelp.h" -#include "winhelp_res.h" -#include "shellapi.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(winhelp); - -static BOOL WINHELP_RegisterWinClasses(void); -static LRESULT CALLBACK WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_TextWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND, UINT, WPARAM, LPARAM); -static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND, UINT, WPARAM, LPARAM); -static void WINHELP_CheckPopup(UINT); -static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE); -static void WINHELP_InitFonts(HWND hWnd); -static void WINHELP_DeleteLines(WINHELP_WINDOW*); -static void WINHELP_DeleteWindow(WINHELP_WINDOW*); -static void WINHELP_SetupText(HWND hWnd); -static WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW*, WPARAM, LPARAM); - -WINHELP_GLOBALS Globals = {3, NULL, NULL, 0, TRUE, NULL, NULL, NULL, NULL}; - - -/*********************************************************************** - * - * WINHELP_GetOpenFileName - */ -BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len) -{ - OPENFILENAME openfilename; - CHAR szDir[MAX_PATH]; - CHAR szzFilter[2 * MAX_STRING_LEN + 100]; - LPSTR p = szzFilter; - - WINE_TRACE("()\n"); - - LoadString(Globals.hInstance, STID_HELP_FILES_HLP, p, MAX_STRING_LEN); - p += strlen(p) + 1; - lstrcpy(p, "*.hlp"); - p += strlen(p) + 1; - LoadString(Globals.hInstance, STID_ALL_FILES, p, MAX_STRING_LEN); - p += strlen(p) + 1; - lstrcpy(p, "*.*"); - p += strlen(p) + 1; - *p = '\0'; - - GetCurrentDirectory(sizeof(szDir), szDir); - - lpszFile[0]='\0'; - - openfilename.lStructSize = sizeof(OPENFILENAME); - openfilename.hwndOwner = NULL; - openfilename.hInstance = Globals.hInstance; - openfilename.lpstrFilter = szzFilter; - openfilename.lpstrCustomFilter = 0; - openfilename.nMaxCustFilter = 0; - openfilename.nFilterIndex = 1; - openfilename.lpstrFile = lpszFile; - openfilename.nMaxFile = len; - openfilename.lpstrFileTitle = 0; - openfilename.nMaxFileTitle = 0; - openfilename.lpstrInitialDir = szDir; - openfilename.lpstrTitle = 0; - openfilename.Flags = 0; - openfilename.nFileOffset = 0; - openfilename.nFileExtension = 0; - openfilename.lpstrDefExt = 0; - openfilename.lCustData = 0; - openfilename.lpfnHook = 0; - openfilename.lpTemplateName = 0; - - return GetOpenFileName(&openfilename); -} - -/*********************************************************************** - * - * WINHELP_LookupHelpFile - */ -HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile) -{ - HLPFILE* hlpfile; - char szFullName[MAX_PATH]; - char szAddPath[MAX_PATH]; - char *p; - - /* - * NOTE: This is needed by popup windows only. - * In other cases it's not needed but does not hurt though. - */ - if (Globals.active_win && Globals.active_win->page && Globals.active_win->page->file) - { - strcpy(szAddPath, Globals.active_win->page->file->lpszPath); - p = strrchr(szAddPath, '\\'); - if (p) *p = 0; - } - - /* - * FIXME: Should we swap conditions? - */ - if (!SearchPath(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL) && - !SearchPath(szAddPath, lpszFile, ".hlp", MAX_PATH, szFullName, NULL)) - { - if (WINHELP_MessageBoxIDS_s(STID_FILE_NOT_FOUND_s, lpszFile, STID_WHERROR, - MB_YESNO|MB_ICONQUESTION) != IDYES) - return NULL; - if (!WINHELP_GetOpenFileName(szFullName, MAX_PATH)) - return NULL; - } - hlpfile = HLPFILE_ReadHlpFile(szFullName); - if (!hlpfile) - WINHELP_MessageBoxIDS_s(STID_HLPFILE_ERROR_s, lpszFile, - STID_WHERROR, MB_OK|MB_ICONSTOP); - return hlpfile; -} - -/****************************************************************** - * WINHELP_GetWindowInfo - * - * - */ -HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name) -{ - static HLPFILE_WINDOWINFO mwi; - unsigned int i; - - if (!name || !name[0]) - name = Globals.active_win->lpszName; - - if (hlpfile) - for (i = 0; i < hlpfile->numWindows; i++) - if (!strcmp(hlpfile->windows[i].name, name)) - return &hlpfile->windows[i]; - - if (strcmp(name, "main") != 0) - { - WINE_FIXME("Couldn't find window info for %s\n", name); - assert(0); - return NULL; - } - if (!mwi.name[0]) - { - strcpy(mwi.type, "primary"); - strcpy(mwi.name, "main"); - if (!LoadString(Globals.hInstance, STID_WINE_HELP, - mwi.caption, sizeof(mwi.caption))) - strcpy(mwi.caption, hlpfile->lpszTitle); - mwi.origin.x = mwi.origin.y = mwi.size.cx = mwi.size.cy = CW_USEDEFAULT; - mwi.style = SW_SHOW; - mwi.win_style = WS_OVERLAPPEDWINDOW; - mwi.sr_color = mwi.sr_color = 0xFFFFFF; - } - return &mwi; -} - -/****************************************************************** - * HLPFILE_GetPopupWindowInfo - * - * - */ -static HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, HWND hParentWnd, POINT* mouse) -{ - static HLPFILE_WINDOWINFO wi; - - RECT parent_rect; - - wi.type[0] = wi.name[0] = wi.caption[0] = '\0'; - - /* Calculate horizontal size and position of a popup window */ - GetWindowRect(hParentWnd, &parent_rect); - wi.size.cx = (parent_rect.right - parent_rect.left) / 2; - wi.size.cy = 10; /* need a non null value, so that border are taken into account while computing */ - - wi.origin = *mouse; - ClientToScreen(hParentWnd, &wi.origin); - wi.origin.x -= wi.size.cx / 2; - wi.origin.x = min(wi.origin.x, GetSystemMetrics(SM_CXSCREEN) - wi.size.cx); - wi.origin.x = max(wi.origin.x, 0); - - wi.style = SW_SHOW; - wi.win_style = WS_POPUPWINDOW; - wi.sr_color = wi.sr_color = 0xFFFFFF; - - return &wi; -} - -/*********************************************************************** - * - * WinMain - */ -int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) -{ - MSG msg; - LONG lHash = 0; - HLPFILE* hlpfile; - static CHAR default_wndname[] = "main"; - LPSTR wndname = default_wndname; - WINHELP_DLL* dll; - - Globals.hInstance = hInstance; - - /* Get options */ - while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) - { - CHAR option; - LPCSTR topic_id; - if (*cmdline++ == ' ') continue; - - option = *cmdline; - if (option) cmdline++; - while (*cmdline && *cmdline == ' ') cmdline++; - switch (option) - { - case 'i': - case 'I': - topic_id = cmdline; - while (*cmdline && *cmdline != ' ') cmdline++; - if (*cmdline) *cmdline++ = '\0'; - lHash = HLPFILE_Hash(topic_id); - break; - - case '3': - case '4': - Globals.wVersion = option - '0'; - break; - - case 'x': - show = SW_HIDE; - Globals.isBook = FALSE; - break; - - default: - WINE_FIXME("Unsupported cmd line: %s\n", cmdline); - break; - } - } - - /* Create primary window */ - if (!WINHELP_RegisterWinClasses()) - { - WINE_FIXME("Couldn't register classes\n"); - return 0; - } - - if (*cmdline) - { - char* ptr; - if ((*cmdline == '"') && (ptr = strchr(cmdline+1, '"'))) - { - cmdline++; - *ptr = '\0'; - } - if ((ptr = strchr(cmdline, '>'))) - { - *ptr = '\0'; - wndname = ptr + 1; - } - hlpfile = WINHELP_LookupHelpFile(cmdline); - if (!hlpfile) return 0; - } - else hlpfile = NULL; - WINHELP_CreateHelpWindowByHash(hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, wndname), show); - - /* Message loop */ - while (GetMessage(&msg, 0, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - for (dll = Globals.dlls; dll; dll = dll->next) - { - if (dll->class & DC_INITTERM) dll->handler(DW_TERM, 0, 0); - } - return 0; -} - -/*********************************************************************** - * - * RegisterWinClasses - */ -static BOOL WINHELP_RegisterWinClasses(void) -{ - WNDCLASS class_main, class_button_box, class_text, class_shadow, class_history; - - class_main.style = CS_HREDRAW | CS_VREDRAW; - class_main.lpfnWndProc = WINHELP_MainWndProc; - class_main.cbClsExtra = 0; - class_main.cbWndExtra = sizeof(LONG); - class_main.hInstance = Globals.hInstance; - class_main.hIcon = LoadIcon(0, IDI_APPLICATION); - class_main.hCursor = LoadCursor(0, IDC_ARROW); - class_main.hbrBackground = GetStockObject(WHITE_BRUSH); - class_main.lpszMenuName = 0; - class_main.lpszClassName = MAIN_WIN_CLASS_NAME; - - class_button_box = class_main; - class_button_box.lpfnWndProc = WINHELP_ButtonBoxWndProc; - class_button_box.hbrBackground = GetStockObject(GRAY_BRUSH); - class_button_box.lpszClassName = BUTTON_BOX_WIN_CLASS_NAME; - - class_text = class_main; - class_text.lpfnWndProc = WINHELP_TextWndProc; - class_text.hbrBackground = 0; - class_text.lpszClassName = TEXT_WIN_CLASS_NAME; - - class_shadow = class_main; - class_shadow.lpfnWndProc = WINHELP_ShadowWndProc; - class_shadow.hbrBackground = GetStockObject(GRAY_BRUSH); - class_shadow.lpszClassName = SHADOW_WIN_CLASS_NAME; - - class_history = class_main; - class_history.lpfnWndProc = WINHELP_HistoryWndProc; - class_history.lpszClassName = HISTORY_WIN_CLASS_NAME; - - return (RegisterClass(&class_main) && - RegisterClass(&class_button_box) && - RegisterClass(&class_text) && - RegisterClass(&class_shadow) && - RegisterClass(&class_history)); -} - -typedef struct -{ - WORD size; - WORD command; - LONG data; - LONG reserved; - WORD ofsFilename; - WORD ofsData; -} WINHELP,*LPWINHELP; - -/****************************************************************** - * WINHELP_HandleCommand - * - * - */ -static LRESULT WINHELP_HandleCommand(HWND hSrcWnd, LPARAM lParam) -{ - COPYDATASTRUCT* cds = (COPYDATASTRUCT*)lParam; - WINHELP* wh; - - if (cds->dwData != 0xA1DE505) - { - WINE_FIXME("Wrong magic number (%08lx)\n", cds->dwData); - return 0; - } - - wh = (WINHELP*)cds->lpData; - - if (wh) - { - char* ptr = (wh->ofsFilename) ? (LPSTR)wh + wh->ofsFilename : NULL; - - WINE_TRACE("Got[%u]: cmd=%u data=%08x fn=%s\n", - wh->size, wh->command, wh->data, ptr); - switch (wh->command) - { - case HELP_CONTEXT: - if (ptr) - { - MACRO_JumpContext(ptr, "main", wh->data); - } - break; - case HELP_QUIT: - MACRO_Exit(); - break; - case HELP_CONTENTS: - if (ptr) - { - MACRO_JumpContents(ptr, "main"); - } - break; - case HELP_HELPONHELP: - MACRO_HelpOn(); - break; - /* case HELP_SETINDEX: */ - case HELP_SETCONTENTS: - if (ptr) - { - MACRO_SetContents(ptr, wh->data); - } - break; - case HELP_CONTEXTPOPUP: - if (ptr) - { - MACRO_PopupContext(ptr, wh->data); - } - break; - /* case HELP_FORCEFILE:*/ - /* case HELP_CONTEXTMENU: */ - case HELP_FINDER: - /* in fact, should be the topic dialog box */ - WINE_FIXME("HELP_FINDER: stub\n"); - if (ptr) - { - MACRO_JumpHash(ptr, "main", 0); - } - break; - /* case HELP_WM_HELP: */ - /* case HELP_SETPOPUP_POS: */ - /* case HELP_KEY: */ - /* case HELP_COMMAND: */ - /* case HELP_PARTIALKEY: */ - /* case HELP_MULTIKEY: */ - /* case HELP_SETWINPOS: */ - WINE_FIXME("Unknown command (%x) for remote winhelp control\n", wh->command); - break; - } - } - return 0L; -} - -/****************************************************************** - * WINHELP_ReuseWindow - * - * - */ -static BOOL WINHELP_ReuseWindow(WINHELP_WINDOW* win, WINHELP_WINDOW* oldwin, - HLPFILE_PAGE* page, int nCmdShow) -{ - unsigned int i; - - win->hMainWnd = oldwin->hMainWnd; - win->hButtonBoxWnd = oldwin->hButtonBoxWnd; - win->hTextWnd = oldwin->hTextWnd; - win->hHistoryWnd = oldwin->hHistoryWnd; - oldwin->hMainWnd = oldwin->hButtonBoxWnd = oldwin->hTextWnd = oldwin->hHistoryWnd = 0; - win->hBrush = oldwin->hBrush; - - SetWindowLong(win->hMainWnd, 0, (LONG)win); - SetWindowLong(win->hButtonBoxWnd, 0, (LONG)win); - SetWindowLong(win->hTextWnd, 0, (LONG)win); - SetWindowLong(win->hHistoryWnd, 0, (LONG)win); - - WINHELP_InitFonts(win->hMainWnd); - - if (page) - SetWindowText(win->hMainWnd, page->file->lpszTitle); - - WINHELP_SetupText(win->hTextWnd); - InvalidateRect(win->hTextWnd, NULL, TRUE); - SendMessage(win->hMainWnd, WM_USER, 0, 0); - ShowWindow(win->hMainWnd, nCmdShow); - UpdateWindow(win->hTextWnd); - - if (!(win->info->win_style & WS_POPUP)) - { - unsigned num; - - memcpy(win->history, oldwin->history, sizeof(win->history)); - win->histIndex = oldwin->histIndex; - - /* FIXME: when using back, we shouldn't update the history... */ - - if (page) - { - for (i = 0; i < win->histIndex; i++) - if (win->history[i] == page) break; - - /* if the new page is already in the history, do nothing */ - if (i == win->histIndex) - { - num = sizeof(win->history) / sizeof(win->history[0]); - if (win->histIndex == num) - { - /* we're full, remove latest entry */ - HLPFILE_FreeHlpFile(win->history[0]->file); - memmove(&win->history[0], &win->history[1], - (num - 1) * sizeof(win->history[0])); - win->histIndex--; - } - win->history[win->histIndex++] = page; - page->file->wRefCount++; - if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE); - } - } - - memcpy(win->back, oldwin->back, sizeof(win->back)); - win->backIndex = oldwin->backIndex; - - if (page) - { - num = sizeof(win->back) / sizeof(win->back[0]); - if (win->backIndex == num) - { - /* we're full, remove latest entry */ - HLPFILE_FreeHlpFile(win->back[0]->file); - memmove(&win->back[0], &win->back[1], - (num - 1) * sizeof(win->back[0])); - win->backIndex--; - } - win->back[win->backIndex++] = page; - page->file->wRefCount++; - } - } - else - win->backIndex = win->histIndex = 0; - - oldwin->histIndex = oldwin->backIndex = 0; - WINHELP_DeleteWindow(oldwin); - return TRUE; -} - -/*********************************************************************** - * - * WINHELP_CreateHelpWindow - */ -BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi, - int nCmdShow) -{ - WINHELP_WINDOW *win, *oldwin; - HWND hWnd; - BOOL bPrimary; - BOOL bPopup; - LPSTR name; - - bPrimary = !lstrcmpi(wi->name, "main"); - bPopup = wi->win_style & WS_POPUP; - - /* Initialize WINHELP_WINDOW struct */ - win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(WINHELP_WINDOW) + strlen(wi->name) + 1); - if (!win) return FALSE; - - win->next = Globals.win_list; - Globals.win_list = win; - - name = (char*)win + sizeof(WINHELP_WINDOW); - lstrcpy(name, wi->name); - win->lpszName = name; - - win->page = page; - - win->hArrowCur = LoadCursorA(0, (LPSTR)IDC_ARROW); - win->hHandCur = LoadCursorA(0, (LPSTR)IDC_HAND); - - win->info = wi; - - Globals.active_win = win; - - /* Initialize default pushbuttons */ - if (bPrimary && page) - { - CHAR buffer[MAX_STRING_LEN]; - - LoadString(Globals.hInstance, STID_CONTENTS, buffer, sizeof(buffer)); - MACRO_CreateButton("BTN_CONTENTS", buffer, "Contents()"); - LoadString(Globals.hInstance, STID_SEARCH,buffer, sizeof(buffer)); - MACRO_CreateButton("BTN_SEARCH", buffer, "Search()"); - LoadString(Globals.hInstance, STID_BACK, buffer, sizeof(buffer)); - MACRO_CreateButton("BTN_BACK", buffer, "Back()"); - LoadString(Globals.hInstance, STID_HISTORY, buffer, sizeof(buffer)); - MACRO_CreateButton("BTN_HISTORY", buffer, "History()"); - LoadString(Globals.hInstance, STID_TOPICS, buffer, sizeof(buffer)); - MACRO_CreateButton("BTN_TOPICS", buffer, "Finder()"); - } - - /* Initialize file specific pushbuttons */ - if (!(wi->win_style & WS_POPUP) && page) - { - HLPFILE_MACRO *macro; - for (macro = page->file->first_macro; macro; macro = macro->next) - MACRO_ExecuteMacro(macro->lpszMacro); - - for (macro = page->first_macro; macro; macro = macro->next) - MACRO_ExecuteMacro(macro->lpszMacro); - } - - /* Reuse existing window */ - if (!bPopup) - { - for (oldwin = win->next; oldwin; oldwin = oldwin->next) - { - if (!lstrcmpi(oldwin->lpszName, wi->name)) - { - return WINHELP_ReuseWindow(win, oldwin, page, nCmdShow); - } - } - if (page) - { - win->histIndex = win->backIndex = 1; - win->history[0] = win->back[0] = page; - page->file->wRefCount += 2; - strcpy(wi->caption, page->file->lpszTitle); - } - } - - hWnd = CreateWindow(bPopup ? TEXT_WIN_CLASS_NAME : MAIN_WIN_CLASS_NAME, - wi->caption, - bPrimary ? WS_OVERLAPPEDWINDOW : wi->win_style, - wi->origin.x, wi->origin.y, wi->size.cx, wi->size.cy, - NULL, bPrimary ? LoadMenu(Globals.hInstance, MAKEINTRESOURCE(MAIN_MENU)) : 0, - Globals.hInstance, win); - - ShowWindow(hWnd, nCmdShow); - UpdateWindow(hWnd); - - return TRUE; -} - -/*********************************************************************** - * - * WINHELP_CreateHelpWindowByHash - */ -BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash, - HLPFILE_WINDOWINFO* wi, int nCmdShow) -{ - HLPFILE_PAGE* page = NULL; - - if (hlpfile) - page = lHash ? HLPFILE_PageByHash(hlpfile, lHash) : - HLPFILE_Contents(hlpfile); - if (page) page->file->wRefCount++; - return WINHELP_CreateHelpWindow(page, wi, nCmdShow); -} - -/*********************************************************************** - * - * WINHELP_CreateHelpWindowByMap - */ -BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap, - HLPFILE_WINDOWINFO* wi, int nCmdShow) -{ - HLPFILE_PAGE* page = NULL; - - page = HLPFILE_PageByMap(hlpfile, lMap); - if (page) page->file->wRefCount++; - return WINHELP_CreateHelpWindow(page, wi, nCmdShow); -} - -/*********************************************************************** - * - * WINHELP_MainWndProc - */ -static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - WINHELP_WINDOW *win; - WINHELP_BUTTON *button; - RECT rect, button_box_rect; - INT text_top, curPos, min, max, dy, keyDelta; - - WINHELP_CheckPopup(msg); - - switch (msg) - { - case WM_NCCREATE: - win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; - SetWindowLong(hWnd, 0, (LONG) win); - win->hMainWnd = hWnd; - break; - - case WM_CREATE: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - - /* Create button box and text Window */ - CreateWindow(BUTTON_BOX_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE, - 0, 0, 0, 0, hWnd, 0, Globals.hInstance, win); - - CreateWindow(TEXT_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE, - 0, 0, 0, 0, hWnd, 0, Globals.hInstance, win); - - /* Fall through */ - case WM_USER: - case WM_WINDOWPOSCHANGED: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - GetClientRect(hWnd, &rect); - - /* Update button box and text Window */ - SetWindowPos(win->hButtonBoxWnd, HWND_TOP, - rect.left, rect.top, - rect.right - rect.left, - rect.bottom - rect.top, 0); - - GetWindowRect(win->hButtonBoxWnd, &button_box_rect); - text_top = rect.top + button_box_rect.bottom - button_box_rect.top; - - SetWindowPos(win->hTextWnd, HWND_TOP, - rect.left, text_top, - rect.right - rect.left, - rect.bottom - text_top, 0); - - break; - - case WM_COMMAND: - Globals.active_win = win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - switch (wParam) - { - /* Menu FILE */ - case MNID_FILE_OPEN: MACRO_FileOpen(); break; - case MNID_FILE_PRINT: MACRO_Print(); break; - case MNID_FILE_SETUP: MACRO_PrinterSetup(); break; - case MNID_FILE_EXIT: MACRO_Exit(); break; - - /* Menu EDIT */ - case MNID_EDIT_COPYDLG: MACRO_CopyDialog(); break; - case MNID_EDIT_ANNOTATE:MACRO_Annotate(); break; - - /* Menu Bookmark */ - case MNID_BKMK_DEFINE: MACRO_BookmarkDefine(); break; - - /* Menu Help */ - case MNID_HELP_HELPON: MACRO_HelpOn(); break; - case MNID_HELP_HELPTOP: MACRO_HelpOnTop(); break; - case MNID_HELP_ABOUT: MACRO_About(); break; - case MNID_HELP_WINE: ShellAbout(hWnd, "WINE", "Help", 0); break; - - default: - /* Buttons */ - for (button = win->first_button; button; button = button->next) - if (wParam == button->wParam) break; - if (button) - MACRO_ExecuteMacro(button->lpszMacro); - else - WINHELP_MessageBoxIDS(STID_NOT_IMPLEMENTED, 0x121, MB_OK); - break; - } - break; - case WM_DESTROY: - if (Globals.hPopupWnd) DestroyWindow(Globals.hPopupWnd); - break; - case WM_COPYDATA: - return WINHELP_HandleCommand((HWND)wParam, lParam); - - case WM_KEYDOWN: - keyDelta = 0; - - switch (wParam) - { - case VK_UP: - case VK_DOWN: - keyDelta = GetSystemMetrics(SM_CXVSCROLL); - if (wParam == VK_UP) - keyDelta = -keyDelta; - - case VK_PRIOR: - case VK_NEXT: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - curPos = GetScrollPos(win->hTextWnd, SB_VERT); - GetScrollRange(win->hTextWnd, SB_VERT, &min, &max); - - if (keyDelta == 0) - { - GetClientRect(win->hTextWnd, &rect); - keyDelta = (rect.bottom - rect.top) / 2; - if (wParam == VK_PRIOR) - keyDelta = -keyDelta; - } - - curPos += keyDelta; - if (curPos > max) - curPos = max; - else if (curPos < min) - curPos = min; - - dy = GetScrollPos(win->hTextWnd, SB_VERT) - curPos; - SetScrollPos(win->hTextWnd, SB_VERT, curPos, TRUE); - ScrollWindow(win->hTextWnd, 0, dy, NULL, NULL); - UpdateWindow(win->hTextWnd); - return 0; - - case VK_ESCAPE: - MACRO_Exit(); - return 0; - } - break; - } - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * WINHELP_ButtonBoxWndProc - */ -static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - WINDOWPOS *winpos; - WINHELP_WINDOW *win; - WINHELP_BUTTON *button; - SIZE button_size; - INT x, y; - - WINHELP_CheckPopup(msg); - - switch (msg) - { - case WM_NCCREATE: - win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; - SetWindowLong(hWnd, 0, (LONG) win); - win->hButtonBoxWnd = hWnd; - break; - - case WM_WINDOWPOSCHANGING: - winpos = (WINDOWPOS*) lParam; - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - - /* Update buttons */ - button_size.cx = 0; - button_size.cy = 0; - for (button = win->first_button; button; button = button->next) - { - HDC hDc; - SIZE textsize; - if (!button->hWnd) - { - button->hWnd = CreateWindow(STRING_BUTTON, button->lpszName, - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - 0, 0, 0, 0, - hWnd, (HMENU) button->wParam, - Globals.hInstance, 0); - if (button->hWnd) { - if (Globals.button_proc == NULL) - Globals.button_proc = (WNDPROC) GetWindowLongPtr(button->hWnd, GWLP_WNDPROC); - SetWindowLongPtr(button->hWnd, GWLP_WNDPROC, (LONG_PTR) WINHELP_ButtonWndProc); - } - } - hDc = GetDC(button->hWnd); - GetTextExtentPoint(hDc, button->lpszName, - lstrlen(button->lpszName), &textsize); - ReleaseDC(button->hWnd, hDc); - - button_size.cx = max(button_size.cx, textsize.cx + BUTTON_CX); - button_size.cy = max(button_size.cy, textsize.cy + BUTTON_CY); - } - - x = 0; - y = 0; - for (button = win->first_button; button; button = button->next) - { - SetWindowPos(button->hWnd, HWND_TOP, x, y, button_size.cx, button_size.cy, 0); - - if (x + 2 * button_size.cx <= winpos->cx) - x += button_size.cx; - else - x = 0, y += button_size.cy; - } - winpos->cy = y + (x ? button_size.cy : 0); - break; - - case WM_COMMAND: - SendMessage(GetParent(hWnd), msg, wParam, lParam); - break; - - case WM_KEYDOWN: - switch (wParam) - { - case VK_UP: - case VK_DOWN: - case VK_PRIOR: - case VK_NEXT: - case VK_ESCAPE: - return SendMessage(GetParent(hWnd), msg, wParam, lParam); - } - break; - } - - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * WINHELP_ButtonWndProc - */ -static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - if (msg == WM_KEYDOWN) - { - switch (wParam) - { - case VK_UP: - case VK_DOWN: - case VK_PRIOR: - case VK_NEXT: - case VK_ESCAPE: - return SendMessage(GetParent(hWnd), msg, wParam, lParam); - } - } - - return CallWindowProc(Globals.button_proc, hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * WINHELP_TextWndProc - */ -static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - WINHELP_WINDOW *win; - WINHELP_LINE *line; - WINHELP_LINE_PART *part; - WINDOWPOS *winpos; - PAINTSTRUCT ps; - HDC hDc; - POINT mouse; - INT scroll_pos; - HWND hPopupWnd; - BOOL bExit; - - if (msg != WM_LBUTTONDOWN) - WINHELP_CheckPopup(msg); - - switch (msg) - { - case WM_NCCREATE: - win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; - SetWindowLong(hWnd, 0, (LONG) win); - win->hTextWnd = hWnd; - win->hBrush = CreateSolidBrush(win->info->sr_color); - if (win->info->win_style & WS_POPUP) Globals.hPopupWnd = win->hMainWnd = hWnd; - WINHELP_InitFonts(hWnd); - break; - - case WM_CREATE: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - - /* Calculate vertical size and position of a popup window */ - if (win->info->win_style & WS_POPUP) - { - POINT origin; - RECT old_window_rect; - RECT old_client_rect; - SIZE old_window_size; - SIZE old_client_size; - SIZE new_client_size; - SIZE new_window_size; - - GetWindowRect(hWnd, &old_window_rect); - origin.x = old_window_rect.left; - origin.y = old_window_rect.top; - old_window_size.cx = old_window_rect.right - old_window_rect.left; - old_window_size.cy = old_window_rect.bottom - old_window_rect.top; - - GetClientRect(hWnd, &old_client_rect); - old_client_size.cx = old_client_rect.right - old_client_rect.left; - old_client_size.cy = old_client_rect.bottom - old_client_rect.top; - - new_client_size = old_client_size; - WINHELP_SplitLines(hWnd, &new_client_size); - - if (origin.y + POPUP_YDISTANCE + new_client_size.cy <= GetSystemMetrics(SM_CYSCREEN)) - origin.y += POPUP_YDISTANCE; - else - origin.y -= POPUP_YDISTANCE + new_client_size.cy; - - 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 = - CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP, - origin.x + SHADOW_DX, origin.y + SHADOW_DY, - new_window_size.cx, new_window_size.cy, - 0, 0, Globals.hInstance, 0); - - SetWindowPos(hWnd, HWND_TOP, origin.x, origin.y, - new_window_size.cx, new_window_size.cy, - 0); - SetWindowPos(win->hShadowWnd, hWnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); - ShowWindow(win->hShadowWnd, SW_NORMAL); - SetActiveWindow(hWnd); - } - break; - - case WM_WINDOWPOSCHANGED: - winpos = (WINDOWPOS*) lParam; - - if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd); - break; - - case WM_MOUSEWHEEL: - { - int wheelDelta = 0; - UINT scrollLines = 3; - int curPos = GetScrollPos(hWnd, SB_VERT); - int min, max; - - GetScrollRange(hWnd, SB_VERT, &min, &max); - - SystemParametersInfo(SPI_GETWHEELSCROLLLINES,0, &scrollLines, 0); - if (wParam & (MK_SHIFT | MK_CONTROL)) - return DefWindowProc(hWnd, msg, wParam, lParam); - wheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam); - if (abs(wheelDelta) >= WHEEL_DELTA && scrollLines) { - int dy; - - curPos += wheelDelta; - if (curPos > max) - curPos = max; - else if (curPos < min) - curPos = min; - - dy = GetScrollPos(hWnd, SB_VERT) - curPos; - SetScrollPos(hWnd, SB_VERT, curPos, TRUE); - ScrollWindow(hWnd, 0, dy, NULL, NULL); - UpdateWindow(hWnd); - } - } - break; - - case WM_VSCROLL: - { - BOOL update = TRUE; - RECT rect; - INT Min, Max; - INT CurPos = GetScrollPos(hWnd, SB_VERT); - INT dy; - - GetScrollRange(hWnd, SB_VERT, &Min, &Max); - GetClientRect(hWnd, &rect); - - switch (wParam & 0xffff) - { - case SB_THUMBTRACK: - case SB_THUMBPOSITION: CurPos = wParam >> 16; break; - case SB_TOP: CurPos = Min; break; - case SB_BOTTOM: CurPos = Max; break; - case SB_PAGEUP: CurPos -= (rect.bottom - rect.top) / 2; break; - case SB_PAGEDOWN: CurPos += (rect.bottom - rect.top) / 2; break; - case SB_LINEUP: CurPos -= GetSystemMetrics(SM_CXVSCROLL); break; - case SB_LINEDOWN: CurPos += GetSystemMetrics(SM_CXVSCROLL); break; - default: update = FALSE; - } - if (update) - { - if (CurPos > Max) - CurPos = Max; - else if (CurPos < Min) - CurPos = Min; - dy = GetScrollPos(hWnd, SB_VERT) - CurPos; - SetScrollPos(hWnd, SB_VERT, CurPos, TRUE); - ScrollWindow(hWnd, 0, dy, NULL, NULL); - UpdateWindow(hWnd); - } - } - break; - - case WM_PAINT: - hDc = BeginPaint(hWnd, &ps); - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - scroll_pos = GetScrollPos(hWnd, SB_VERT); - - /* No DPtoLP needed - MM_TEXT map mode */ - if (ps.fErase) FillRect(hDc, &ps.rcPaint, win->hBrush); - for (line = win->first_line; line; line = line->next) - { - for (part = &line->first_part; part; part = part->next) - { - switch (part->cookie) - { - case hlp_line_part_text: - SelectObject(hDc, part->u.text.hFont); - SetTextColor(hDc, part->u.text.color); - SetBkColor(hDc, win->info->sr_color); - TextOut(hDc, part->rect.left, part->rect.top - scroll_pos, - part->u.text.lpsText, part->u.text.wTextLen); - if (part->u.text.wUnderline) - { - HPEN hPen; - - switch (part->u.text.wUnderline) - { - case 1: /* simple */ - case 2: /* double */ - hPen = CreatePen(PS_SOLID, 1, part->u.text.color); - break; - case 3: /* dotted */ - hPen = CreatePen(PS_DOT, 1, part->u.text.color); - break; - default: - WINE_FIXME("Unknow underline type\n"); - continue; - } - - SelectObject(hDc, hPen); - MoveToEx(hDc, part->rect.left, part->rect.bottom - scroll_pos - 1, NULL); - LineTo(hDc, part->rect.right, part->rect.bottom - scroll_pos - 1); - if (part->u.text.wUnderline == 2) - { - MoveToEx(hDc, part->rect.left, part->rect.bottom - scroll_pos + 1, NULL); - LineTo(hDc, part->rect.right, part->rect.bottom - scroll_pos + 1); - } - DeleteObject(hPen); - } - break; - case hlp_line_part_bitmap: - { - HDC hMemDC; - - hMemDC = CreateCompatibleDC(hDc); - SelectObject(hMemDC, part->u.bitmap.hBitmap); - BitBlt(hDc, part->rect.left, part->rect.top - scroll_pos, - part->rect.right - part->rect.left, part->rect.bottom - part->rect.top, - hMemDC, 0, 0, SRCCOPY); - DeleteDC(hMemDC); - } - break; - case hlp_line_part_metafile: - { - HDC hMemDC; - HBITMAP hBitmap; - SIZE sz; - RECT rc; - - sz.cx = part->rect.right - part->rect.left; - sz.cy = part->rect.bottom - part->rect.top; - hMemDC = CreateCompatibleDC(hDc); - hBitmap = CreateCompatibleBitmap(hDc, sz.cx, sz.cy); - SelectObject(hMemDC, hBitmap); - SelectObject(hMemDC, win->hBrush); - rc.left = 0; - rc.top = 0; - rc.right = sz.cx; - rc.bottom = sz.cy; - FillRect(hMemDC, &rc, win->hBrush); - SetMapMode(hMemDC, part->u.metafile.mm); - SetWindowExtEx(hMemDC, sz.cx, sz.cy, 0); - SetViewportExtEx(hMemDC, sz.cx, sz.cy, 0); - SetWindowOrgEx(hMemDC, 0, 0, 0); - SetViewportOrgEx(hMemDC, 0, 0, 0); - PlayMetaFile(hMemDC, part->u.metafile.hMetaFile); - SetMapMode(hMemDC, MM_TEXT); - SetWindowOrgEx(hMemDC, 0, 0, 0); - SetViewportOrgEx(hMemDC, 0, 0, 0); - BitBlt(hDc, part->rect.left, part->rect.top - scroll_pos, - sz.cx, sz.cy, hMemDC, 0, 0, SRCCOPY); - DeleteDC(hMemDC); - DeleteObject(hBitmap); - } - break; - } - } - } - - EndPaint(hWnd, &ps); - break; - - case WM_MOUSEMOVE: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - - if (WINHELP_IsOverLink(win, wParam, lParam)) - SetCursor(win->hHandCur); /* set to hand pointer cursor to indicate a link */ - else - SetCursor(win->hArrowCur); /* set to hand pointer cursor to indicate a link */ - - break; - - case WM_LBUTTONDOWN: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - - hPopupWnd = Globals.hPopupWnd; - Globals.hPopupWnd = 0; - - part = WINHELP_IsOverLink(win, wParam, lParam); - if (part) - { - HLPFILE* hlpfile; - HLPFILE_WINDOWINFO* wi; - - mouse.x = (short)LOWORD(lParam); - mouse.y = (short)HIWORD(lParam); - - if (part->link) switch (part->link->cookie) - { - case hlp_link_link: - hlpfile = WINHELP_LookupHelpFile(part->link->lpszString); - if (part->link->window == -1) - wi = win->info; - else if ((part->link->window >= 0) && (part->link->window < hlpfile->numWindows)) - wi = &hlpfile->windows[part->link->window]; - else - { - WINE_WARN("link to window %d/%d\n", part->link->window, hlpfile->numWindows); - break; - } - WINHELP_CreateHelpWindowByHash(hlpfile, part->link->lHash, wi, - SW_NORMAL); - break; - case hlp_link_popup: - hlpfile = WINHELP_LookupHelpFile(part->link->lpszString); - if (hlpfile) WINHELP_CreateHelpWindowByHash(hlpfile, part->link->lHash, - WINHELP_GetPopupWindowInfo(hlpfile, hWnd, &mouse), - SW_NORMAL); - break; - case hlp_link_macro: - MACRO_ExecuteMacro(part->link->lpszString); - break; - default: - WINE_FIXME("Unknown link cookie %d\n", part->link->cookie); - } - } - - if (hPopupWnd) - DestroyWindow(hPopupWnd); - break; - - case WM_NCDESTROY: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - - if (hWnd == Globals.hPopupWnd) Globals.hPopupWnd = 0; - - bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main")); - DeleteObject(win->hBrush); - - WINHELP_DeleteWindow(win); - - if (bExit) MACRO_Exit(); - - if (!Globals.win_list) - PostQuitMessage(0); - break; - } - - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -/****************************************************************** - * WINHELP_HistoryWndProc - * - * - */ -static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - WINHELP_WINDOW* win; - PAINTSTRUCT ps; - HDC hDc; - TEXTMETRIC tm; - unsigned int i; - RECT r; - - switch (msg) - { - case WM_NCCREATE: - win = (WINHELP_WINDOW*)((LPCREATESTRUCT)lParam)->lpCreateParams; - SetWindowLong(hWnd, 0, (LONG)win); - win->hHistoryWnd = hWnd; - break; - case WM_CREATE: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - hDc = GetDC(hWnd); - GetTextMetrics(hDc, &tm); - GetWindowRect(hWnd, &r); - - r.right = r.left + 30 * tm.tmAveCharWidth; - r.bottom = r.top + (sizeof(win->history) / sizeof(win->history[0])) * tm.tmHeight; - AdjustWindowRect(&r, GetWindowLong(hWnd, GWL_STYLE), FALSE); - if (r.left < 0) {r.right -= r.left; r.left = 0;} - if (r.top < 0) {r.bottom -= r.top; r.top = 0;} - - MoveWindow(hWnd, r.left, r.top, r.right, r.bottom, TRUE); - ReleaseDC(hWnd, hDc); - break; - case WM_LBUTTONDOWN: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - hDc = GetDC(hWnd); - GetTextMetrics(hDc, &tm); - i = HIWORD(lParam) / tm.tmHeight; - if (i < win->histIndex) - WINHELP_CreateHelpWindow(win->history[i], win->info, SW_SHOW); - ReleaseDC(hWnd, hDc); - break; - case WM_PAINT: - hDc = BeginPaint(hWnd, &ps); - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - GetTextMetrics(hDc, &tm); - - for (i = 0; i < win->histIndex; i++) - { - TextOut(hDc, 0, i * tm.tmHeight, win->history[i]->lpszTitle, - strlen(win->history[i]->lpszTitle)); - } - EndPaint(hWnd, &ps); - break; - case WM_DESTROY: - win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - if (hWnd == win->hHistoryWnd) - win->hHistoryWnd = 0; - break; - } - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * WINHELP_ShadowWndProc - */ -static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - WINHELP_CheckPopup(msg); - return DefWindowProc(hWnd, msg, wParam, lParam); -} - -/*********************************************************************** - * - * SetupText - */ -static void WINHELP_SetupText(HWND hWnd) -{ - HDC hDc = GetDC(hWnd); - RECT rect; - SIZE newsize; - - ShowScrollBar(hWnd, SB_VERT, FALSE); - if (!WINHELP_SplitLines(hWnd, NULL)) - { - ShowScrollBar(hWnd, SB_VERT, TRUE); - GetClientRect(hWnd, &rect); - - WINHELP_SplitLines(hWnd, &newsize); - SetScrollRange(hWnd, SB_VERT, 0, rect.top + newsize.cy - rect.bottom, TRUE); - } - else - { - SetScrollPos(hWnd, SB_VERT, 0, FALSE); - SetScrollRange(hWnd, SB_VERT, 0, 0, FALSE); - } - - ReleaseDC(hWnd, hDc); -} - -/*********************************************************************** - * - * WINHELP_AppendText - */ -static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp, - LPSIZE space, LPSIZE textsize, - INT *line_ascent, INT ascent, - LPCSTR text, UINT textlen, - HFONT font, COLORREF color, HLPFILE_LINK *link, - unsigned underline) -{ - WINHELP_LINE *line; - WINHELP_LINE_PART *part; - LPSTR ptr; - - if (!*partp) /* New line */ - { - *line_ascent = ascent; - - line = HeapAlloc(GetProcessHeap(), 0, - sizeof(WINHELP_LINE) + textlen); - if (!line) return FALSE; - - line->next = 0; - part = &line->first_part; - ptr = (char*)line + sizeof(WINHELP_LINE); - - line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy; - line->rect.bottom = line->rect.top; - line->rect.left = space->cx; - line->rect.right = space->cx; - - if (**linep) *linep = &(**linep)->next; - **linep = line; - space->cy = 0; - } - else /* Same line */ - { - line = **linep; - - if (*line_ascent < ascent) - { - WINHELP_LINE_PART *p; - for (p = &line->first_part; p; p = p->next) - { - p->rect.top += ascent - *line_ascent; - p->rect.bottom += ascent - *line_ascent; - } - line->rect.bottom += ascent - *line_ascent; - *line_ascent = ascent; - } - - part = HeapAlloc(GetProcessHeap(), 0, - sizeof(WINHELP_LINE_PART) + textlen); - if (!part) return FALSE; - **partp = part; - ptr = (char*)part + sizeof(WINHELP_LINE_PART); - } - - memcpy(ptr, text, textlen); - part->cookie = hlp_line_part_text; - part->rect.left = line->rect.right + (*partp ? space->cx : 0); - part->rect.right = part->rect.left + textsize->cx; - line->rect.right = part->rect.right; - part->rect.top = - ((*partp) ? line->rect.top : line->rect.bottom) + *line_ascent - ascent; - part->rect.bottom = part->rect.top + textsize->cy; - line->rect.bottom = max(line->rect.bottom, part->rect.bottom); - part->u.text.lpsText = ptr; - part->u.text.wTextLen = textlen; - part->u.text.hFont = font; - part->u.text.color = color; - part->u.text.wUnderline = underline; - - WINE_TRACE("Appended text '%*.*s'[%d] @ (%d,%d-%d,%d)\n", - part->u.text.wTextLen, - part->u.text.wTextLen, - part->u.text.lpsText, - part->u.text.wTextLen, - part->rect.left, part->rect.top, part->rect.right, part->rect.bottom); - - part->link = link; - if (link) link->wRefCount++; - - part->next = 0; - *partp = &part->next; - - space->cx = 0; - - return TRUE; -} - -/*********************************************************************** - * - * WINHELP_AppendGfxObject - */ -static WINHELP_LINE_PART* WINHELP_AppendGfxObject(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp, - LPSIZE space, LPSIZE gfxSize, - HLPFILE_LINK *link, unsigned pos) -{ - WINHELP_LINE *line; - WINHELP_LINE_PART *part; - LPSTR ptr; - - if (!*partp || pos == 1) /* New line */ - { - line = HeapAlloc(GetProcessHeap(), 0, sizeof(WINHELP_LINE)); - if (!line) return NULL; - - line->next = NULL; - part = &line->first_part; - - line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy; - line->rect.bottom = line->rect.top; - line->rect.left = space->cx; - line->rect.right = space->cx; - - if (**linep) *linep = &(**linep)->next; - **linep = line; - space->cy = 0; - ptr = (char*)line + sizeof(WINHELP_LINE); - } - else /* Same line */ - { - if (pos == 2) WINE_FIXME("Left alignment not handled\n"); - line = **linep; - - part = HeapAlloc(GetProcessHeap(), 0, sizeof(WINHELP_LINE_PART)); - if (!part) return NULL; - **partp = part; - ptr = (char*)part + sizeof(WINHELP_LINE_PART); - } - - /* part->cookie should be set by caller (image or metafile) */ - part->rect.left = line->rect.right + (*partp ? space->cx : 0); - part->rect.right = part->rect.left + gfxSize->cx; - line->rect.right = part->rect.right; - part->rect.top = (*partp) ? line->rect.top : line->rect.bottom; - part->rect.bottom = part->rect.top + gfxSize->cy; - line->rect.bottom = max(line->rect.bottom, part->rect.bottom); - - WINE_TRACE("Appended gfx @ (%d,%d-%d,%d)\n", - part->rect.left, part->rect.top, part->rect.right, part->rect.bottom); - - part->link = link; - if (link) link->wRefCount++; - - part->next = NULL; - *partp = &part->next; - - space->cx = 0; - - return part; -} - - -/*********************************************************************** - * - * WINHELP_SplitLines - */ -static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize) -{ - WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - HLPFILE_PARAGRAPH *p; - WINHELP_LINE **line = &win->first_line; - WINHELP_LINE_PART **part = 0; - INT line_ascent = 0; - SIZE space; - RECT rect; - HDC hDc; - - if (newsize) newsize->cx = newsize->cy = 0; - - if (!win->page) return TRUE; - - WINHELP_DeleteLines(win); - - GetClientRect(hWnd, &rect); - - rect.top += INTERNAL_BORDER_WIDTH; - rect.left += INTERNAL_BORDER_WIDTH; - rect.right -= INTERNAL_BORDER_WIDTH; - rect.bottom -= INTERNAL_BORDER_WIDTH; - - space.cy = rect.top; - space.cx = rect.left; - - hDc = GetDC(hWnd); - - for (p = win->page->first_paragraph; p; p = p->next) - { - switch (p->cookie) - { - case para_normal_text: - case para_debug_text: - { - TEXTMETRIC tm; - SIZE textsize = {0, 0}; - LPCSTR text = p->u.text.lpszText; - UINT indent = 0; - UINT len = strlen(text); - unsigned underline = 0; - - HFONT hFont = 0; - COLORREF color = RGB(0, 0, 0); - - if (p->u.text.wFont < win->page->file->numFonts) - { - HLPFILE* hlpfile = win->page->file; - - if (!hlpfile->fonts[p->u.text.wFont].hFont) - hlpfile->fonts[p->u.text.wFont].hFont = CreateFontIndirect(&hlpfile->fonts[p->u.text.wFont].LogFont); - hFont = hlpfile->fonts[p->u.text.wFont].hFont; - color = hlpfile->fonts[p->u.text.wFont].color; - } - else - { - UINT wFont = (p->u.text.wFont < win->fonts_len) ? p->u.text.wFont : 0; - - hFont = win->fonts[wFont]; - } - - if (p->link && p->link->bClrChange) - { - underline = (p->link->cookie == hlp_link_popup) ? 3 : 1; - color = RGB(0, 0x80, 0); - } - if (p->cookie == para_debug_text) color = RGB(0xff, 0, 0); - - SelectObject(hDc, hFont); - - GetTextMetrics(hDc, &tm); - - if (p->u.text.wIndent) - { - indent = p->u.text.wIndent * 5 * tm.tmAveCharWidth; - if (!part) - space.cx = rect.left + indent - 2 * tm.tmAveCharWidth; - } - - if (p->u.text.wVSpace) - { - part = 0; - space.cx = rect.left + indent; - space.cy += (p->u.text.wVSpace - 1) * tm.tmHeight; - } - - if (p->u.text.wHSpace) - { - space.cx += p->u.text.wHSpace * 2 * tm.tmAveCharWidth; - } - - WINE_TRACE("splitting text %s\n", text); - - while (len) - { - INT free_width = rect.right - (part ? (*line)->rect.right : rect.left) - space.cx; - UINT low = 0, curr = len, high = len, textlen = 0; - - if (free_width > 0) - { - while (1) - { - GetTextExtentPoint(hDc, text, curr, &textsize); - - if (textsize.cx <= free_width) low = curr; - else high = curr; - - if (high <= low + 1) break; - - if (textsize.cx) curr = (curr * free_width) / textsize.cx; - if (curr <= low) curr = low + 1; - else if (curr >= high) curr = high - 1; - } - textlen = low; - while (textlen && text[textlen] && text[textlen] != ' ') textlen--; - } - if (!part && !textlen) textlen = max(low, 1); - - if (free_width <= 0 || !textlen) - { - part = 0; - space.cx = rect.left + indent; - space.cx = min(space.cx, rect.right - rect.left - 1); - continue; - } - - WINE_TRACE("\t => %d %*s\n", textlen, textlen, text); - - if (!WINHELP_AppendText(&line, &part, &space, &textsize, - &line_ascent, tm.tmAscent, - text, textlen, hFont, color, p->link, underline) || - (!newsize && (*line)->rect.bottom > rect.bottom)) - { - ReleaseDC(hWnd, hDc); - return FALSE; - } - - if (newsize) - newsize->cx = max(newsize->cx, (*line)->rect.right + INTERNAL_BORDER_WIDTH); - - len -= textlen; - text += textlen; - if (text[0] == ' ') text++, len--; - } - } - break; - case para_bitmap: - case para_metafile: - { - SIZE gfxSize; - INT free_width; - WINHELP_LINE_PART* ref_part; - - if (p->u.gfx.pos & 0x8000) - { - space.cx = rect.left; - if (*line) - space.cy += (*line)->rect.bottom - (*line)->rect.top; - part = 0; - } - - if (p->cookie == para_bitmap) - { - DIBSECTION dibs; - - GetObject(p->u.gfx.u.bmp.hBitmap, sizeof(dibs), &dibs); - gfxSize.cx = dibs.dsBm.bmWidth; - gfxSize.cy = dibs.dsBm.bmHeight; - } - else - { - LPMETAFILEPICT lpmfp = &p->u.gfx.u.mfp; - if (lpmfp->mm == MM_ANISOTROPIC || lpmfp->mm == MM_ISOTROPIC) - { - gfxSize.cx = MulDiv(lpmfp->xExt, GetDeviceCaps(hDc, HORZRES), - 100*GetDeviceCaps(hDc, HORZSIZE)); - gfxSize.cy = MulDiv(lpmfp->yExt, GetDeviceCaps(hDc, VERTRES), - 100*GetDeviceCaps(hDc, VERTSIZE)); - } - else - { - gfxSize.cx = lpmfp->xExt; - gfxSize.cy = lpmfp->yExt; - } - } - - free_width = rect.right - ((part && *line) ? (*line)->rect.right : rect.left) - space.cx; - if (free_width <= 0) - { - part = NULL; - space.cx = rect.left; - space.cx = min(space.cx, rect.right - rect.left - 1); - } - ref_part = WINHELP_AppendGfxObject(&line, &part, &space, &gfxSize, - p->link, p->u.gfx.pos); - if (!ref_part || (!newsize && (*line)->rect.bottom > rect.bottom)) - { - return FALSE; - } - if (p->cookie == para_bitmap) - { - ref_part->cookie = hlp_line_part_bitmap; - ref_part->u.bitmap.hBitmap = p->u.gfx.u.bmp.hBitmap; - } - else - { - ref_part->cookie = hlp_line_part_metafile; - ref_part->u.metafile.hMetaFile = p->u.gfx.u.mfp.hMF; - ref_part->u.metafile.mm = p->u.gfx.u.mfp.mm; - } - } - break; - } - } - - if (newsize) - newsize->cy = (*line)->rect.bottom + INTERNAL_BORDER_WIDTH; - - ReleaseDC(hWnd, hDc); - return TRUE; -} - -/*********************************************************************** - * - * WINHELP_CheckPopup - */ -static void WINHELP_CheckPopup(UINT msg) -{ - if (!Globals.hPopupWnd) return; - - switch (msg) - { - case WM_COMMAND: - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_NCLBUTTONDOWN: - case WM_NCMBUTTONDOWN: - case WM_NCRBUTTONDOWN: - DestroyWindow(Globals.hPopupWnd); - Globals.hPopupWnd = 0; - } -} - -/*********************************************************************** - * - * WINHELP_DeleteLines - */ -static void WINHELP_DeleteLines(WINHELP_WINDOW *win) -{ - WINHELP_LINE *line, *next_line; - WINHELP_LINE_PART *part, *next_part; - for (line = win->first_line; line; line = next_line) - { - next_line = line->next; - for (part = &line->first_part; part; part = next_part) - { - next_part = part->next; - HLPFILE_FreeLink(part->link); - HeapFree(GetProcessHeap(), 0, part); - } - } - win->first_line = 0; -} - -/*********************************************************************** - * - * WINHELP_DeleteWindow - */ -static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) -{ - WINHELP_WINDOW** w; - unsigned int i; - WINHELP_BUTTON* b; - WINHELP_BUTTON* bp; - - for (w = &Globals.win_list; *w; w = &(*w)->next) - { - if (*w == win) - { - *w = win->next; - break; - } - } - - if (Globals.active_win == win) - { - Globals.active_win = Globals.win_list; - if (Globals.win_list) - SetActiveWindow(Globals.win_list->hMainWnd); - } - - for (b = win->first_button; b; b = bp) - { - DestroyWindow(b->hWnd); - bp = b->next; - HeapFree(GetProcessHeap(), 0, b); - } - - if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); - if (win->hHistoryWnd) DestroyWindow(win->hHistoryWnd); - - for (i = 0; i < win->histIndex; i++) - { - HLPFILE_FreeHlpFile(win->history[i]->file); - } - - for (i = 0; i < win->backIndex; i++) - HLPFILE_FreeHlpFile(win->back[i]->file); - - if (win->page) HLPFILE_FreeHlpFile(win->page->file); - WINHELP_DeleteLines(win); - HeapFree(GetProcessHeap(), 0, win); -} - -/*********************************************************************** - * - * WINHELP_InitFonts - */ -static void WINHELP_InitFonts(HWND hWnd) -{ - WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); - LOGFONT logfontlist[] = { - {-10, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, - {-10, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, - { -8, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}}; -#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) - - static HFONT fonts[FONTS_LEN]; - static BOOL init = 0; - - win->fonts_len = FONTS_LEN; - win->fonts = fonts; - - if (!init) - { - UINT i; - - for (i = 0; i < FONTS_LEN; i++) - { - fonts[i] = CreateFontIndirect(&logfontlist[i]); - } - - init = 1; - } -} - -/*********************************************************************** - * - * WINHELP_MessageBoxIDS - */ -INT WINHELP_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type) -{ - CHAR text[MAX_STRING_LEN]; - CHAR title[MAX_STRING_LEN]; - - LoadString(Globals.hInstance, ids_text, text, sizeof(text)); - LoadString(Globals.hInstance, ids_title, title, sizeof(title)); - - return MessageBox(0, text, title, type); -} - -/*********************************************************************** - * - * MAIN_MessageBoxIDS_s - */ -INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type) -{ - CHAR text[MAX_STRING_LEN]; - CHAR title[MAX_STRING_LEN]; - CHAR newtext[MAX_STRING_LEN + MAX_PATH]; - - LoadString(Globals.hInstance, ids_text, text, sizeof(text)); - LoadString(Globals.hInstance, ids_title, title, sizeof(title)); - wsprintf(newtext, text, str); - - return MessageBox(0, newtext, title, type); -} - -/****************************************************************** - * WINHELP_IsOverLink - * - * - */ -WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW* win, WPARAM wParam, LPARAM lParam) -{ - POINT mouse; - WINHELP_LINE *line; - WINHELP_LINE_PART *part; - int scroll_pos = GetScrollPos(win->hTextWnd, SB_VERT); - - mouse.x = LOWORD(lParam); - mouse.y = HIWORD(lParam); - for (line = win->first_line; line; line = line->next) - { - for (part = &line->first_part; part; part = part->next) - { - if (part->link && - part->link->lpszString && - part->rect.left <= mouse.x && - part->rect.right >= mouse.x && - part->rect.top <= mouse.y + scroll_pos && - part->rect.bottom >= mouse.y + scroll_pos) - { - return part; - } - } - } - - return NULL; -} +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * 2002 Sylvain Petreolle + * 2002 Eric Pouech + * 2004 Ken Belleau + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "commdlg.h" +#include "winhelp.h" +#include "winhelp_res.h" +#include "shellapi.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winhelp); + +static BOOL WINHELP_RegisterWinClasses(void); +static LRESULT CALLBACK WINHELP_MainWndProc(HWND, UINT, WPARAM, LPARAM); +static LRESULT CALLBACK WINHELP_TextWndProc(HWND, UINT, WPARAM, LPARAM); +static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM); +static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND, UINT, WPARAM, LPARAM); +static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND, UINT, WPARAM, LPARAM); +static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND, UINT, WPARAM, LPARAM); +static void WINHELP_CheckPopup(UINT); +static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE); +static void WINHELP_InitFonts(HWND hWnd); +static void WINHELP_DeleteLines(WINHELP_WINDOW*); +static void WINHELP_DeleteWindow(WINHELP_WINDOW*); +static void WINHELP_SetupText(HWND hWnd); +static WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW*, WPARAM, LPARAM); + +WINHELP_GLOBALS Globals = {3, NULL, NULL, 0, TRUE, NULL, NULL, NULL, NULL}; + + +/*********************************************************************** + * + * WINHELP_GetOpenFileName + */ +BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len) +{ + OPENFILENAME openfilename; + CHAR szDir[MAX_PATH]; + CHAR szzFilter[2 * MAX_STRING_LEN + 100]; + LPSTR p = szzFilter; + + WINE_TRACE("()\n"); + + LoadString(Globals.hInstance, STID_HELP_FILES_HLP, p, MAX_STRING_LEN); + p += strlen(p) + 1; + lstrcpy(p, "*.hlp"); + p += strlen(p) + 1; + LoadString(Globals.hInstance, STID_ALL_FILES, p, MAX_STRING_LEN); + p += strlen(p) + 1; + lstrcpy(p, "*.*"); + p += strlen(p) + 1; + *p = '\0'; + + GetCurrentDirectory(sizeof(szDir), szDir); + + lpszFile[0]='\0'; + + openfilename.lStructSize = sizeof(OPENFILENAME); + openfilename.hwndOwner = NULL; + openfilename.hInstance = Globals.hInstance; + openfilename.lpstrFilter = szzFilter; + openfilename.lpstrCustomFilter = 0; + openfilename.nMaxCustFilter = 0; + openfilename.nFilterIndex = 1; + openfilename.lpstrFile = lpszFile; + openfilename.nMaxFile = len; + openfilename.lpstrFileTitle = 0; + openfilename.nMaxFileTitle = 0; + openfilename.lpstrInitialDir = szDir; + openfilename.lpstrTitle = 0; + openfilename.Flags = 0; + openfilename.nFileOffset = 0; + openfilename.nFileExtension = 0; + openfilename.lpstrDefExt = 0; + openfilename.lCustData = 0; + openfilename.lpfnHook = 0; + openfilename.lpTemplateName = 0; + + return GetOpenFileName(&openfilename); +} + +/*********************************************************************** + * + * WINHELP_LookupHelpFile + */ +HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile) +{ + HLPFILE* hlpfile; + char szFullName[MAX_PATH]; + char szAddPath[MAX_PATH]; + char *p; + + /* + * NOTE: This is needed by popup windows only. + * In other cases it's not needed but does not hurt though. + */ + if (Globals.active_win && Globals.active_win->page && Globals.active_win->page->file) + { + strcpy(szAddPath, Globals.active_win->page->file->lpszPath); + p = strrchr(szAddPath, '\\'); + if (p) *p = 0; + } + + /* + * FIXME: Should we swap conditions? + */ + if (!SearchPath(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL) && + !SearchPath(szAddPath, lpszFile, ".hlp", MAX_PATH, szFullName, NULL)) + { + if (WINHELP_MessageBoxIDS_s(STID_FILE_NOT_FOUND_s, lpszFile, STID_WHERROR, + MB_YESNO|MB_ICONQUESTION) != IDYES) + return NULL; + if (!WINHELP_GetOpenFileName(szFullName, MAX_PATH)) + return NULL; + } + hlpfile = HLPFILE_ReadHlpFile(szFullName); + if (!hlpfile) + WINHELP_MessageBoxIDS_s(STID_HLPFILE_ERROR_s, lpszFile, + STID_WHERROR, MB_OK|MB_ICONSTOP); + return hlpfile; +} + +/****************************************************************** + * WINHELP_GetWindowInfo + * + * + */ +HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name) +{ + static HLPFILE_WINDOWINFO mwi; + unsigned int i; + + if (!name || !name[0]) + name = Globals.active_win->lpszName; + + if (hlpfile) + for (i = 0; i < hlpfile->numWindows; i++) + if (!strcmp(hlpfile->windows[i].name, name)) + return &hlpfile->windows[i]; + + if (strcmp(name, "main") != 0) + { + WINE_FIXME("Couldn't find window info for %s\n", name); + assert(0); + return NULL; + } + if (!mwi.name[0]) + { + strcpy(mwi.type, "primary"); + strcpy(mwi.name, "main"); + if (!LoadString(Globals.hInstance, STID_WINE_HELP, + mwi.caption, sizeof(mwi.caption))) + strcpy(mwi.caption, hlpfile->lpszTitle); + mwi.origin.x = mwi.origin.y = mwi.size.cx = mwi.size.cy = CW_USEDEFAULT; + mwi.style = SW_SHOW; + mwi.win_style = WS_OVERLAPPEDWINDOW; + mwi.sr_color = mwi.sr_color = 0xFFFFFF; + } + return &mwi; +} + +/****************************************************************** + * HLPFILE_GetPopupWindowInfo + * + * + */ +static HLPFILE_WINDOWINFO* WINHELP_GetPopupWindowInfo(HLPFILE* hlpfile, HWND hParentWnd, POINT* mouse) +{ + static HLPFILE_WINDOWINFO wi; + + RECT parent_rect; + + wi.type[0] = wi.name[0] = wi.caption[0] = '\0'; + + /* Calculate horizontal size and position of a popup window */ + GetWindowRect(hParentWnd, &parent_rect); + wi.size.cx = (parent_rect.right - parent_rect.left) / 2; + wi.size.cy = 10; /* need a non null value, so that border are taken into account while computing */ + + wi.origin = *mouse; + ClientToScreen(hParentWnd, &wi.origin); + wi.origin.x -= wi.size.cx / 2; + wi.origin.x = min(wi.origin.x, GetSystemMetrics(SM_CXSCREEN) - wi.size.cx); + wi.origin.x = max(wi.origin.x, 0); + + wi.style = SW_SHOW; + wi.win_style = WS_POPUPWINDOW; + wi.sr_color = wi.sr_color = 0xFFFFFF; + + return &wi; +} + +/*********************************************************************** + * + * WinMain + */ +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) +{ + MSG msg; + LONG lHash = 0; + HLPFILE* hlpfile; + static CHAR default_wndname[] = "main"; + LPSTR wndname = default_wndname; + WINHELP_DLL* dll; + + Globals.hInstance = hInstance; + + /* Get options */ + while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) + { + CHAR option; + LPCSTR topic_id; + if (*cmdline++ == ' ') continue; + + option = *cmdline; + if (option) cmdline++; + while (*cmdline && *cmdline == ' ') cmdline++; + switch (option) + { + case 'i': + case 'I': + topic_id = cmdline; + while (*cmdline && *cmdline != ' ') cmdline++; + if (*cmdline) *cmdline++ = '\0'; + lHash = HLPFILE_Hash(topic_id); + break; + + case '3': + case '4': + Globals.wVersion = option - '0'; + break; + + case 'x': + show = SW_HIDE; + Globals.isBook = FALSE; + break; + + default: + WINE_FIXME("Unsupported cmd line: %s\n", cmdline); + break; + } + } + + /* Create primary window */ + if (!WINHELP_RegisterWinClasses()) + { + WINE_FIXME("Couldn't register classes\n"); + return 0; + } + + if (*cmdline) + { + char* ptr; + if ((*cmdline == '"') && (ptr = strchr(cmdline+1, '"'))) + { + cmdline++; + *ptr = '\0'; + } + if ((ptr = strchr(cmdline, '>'))) + { + *ptr = '\0'; + wndname = ptr + 1; + } + hlpfile = WINHELP_LookupHelpFile(cmdline); + if (!hlpfile) return 0; + } + else hlpfile = NULL; + WINHELP_CreateHelpWindowByHash(hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, wndname), show); + + /* Message loop */ + while (GetMessage(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + for (dll = Globals.dlls; dll; dll = dll->next) + { + if (dll->class & DC_INITTERM) dll->handler(DW_TERM, 0, 0); + } + return 0; +} + +/*********************************************************************** + * + * RegisterWinClasses + */ +static BOOL WINHELP_RegisterWinClasses(void) +{ + WNDCLASS class_main, class_button_box, class_text, class_shadow, class_history; + + class_main.style = CS_HREDRAW | CS_VREDRAW; + class_main.lpfnWndProc = WINHELP_MainWndProc; + class_main.cbClsExtra = 0; + class_main.cbWndExtra = sizeof(LONG); + class_main.hInstance = Globals.hInstance; + class_main.hIcon = LoadIcon(0, IDI_APPLICATION); + class_main.hCursor = LoadCursor(0, IDC_ARROW); + class_main.hbrBackground = GetStockObject(WHITE_BRUSH); + class_main.lpszMenuName = 0; + class_main.lpszClassName = MAIN_WIN_CLASS_NAME; + + class_button_box = class_main; + class_button_box.lpfnWndProc = WINHELP_ButtonBoxWndProc; + class_button_box.hbrBackground = GetStockObject(GRAY_BRUSH); + class_button_box.lpszClassName = BUTTON_BOX_WIN_CLASS_NAME; + + class_text = class_main; + class_text.lpfnWndProc = WINHELP_TextWndProc; + class_text.hbrBackground = 0; + class_text.lpszClassName = TEXT_WIN_CLASS_NAME; + + class_shadow = class_main; + class_shadow.lpfnWndProc = WINHELP_ShadowWndProc; + class_shadow.hbrBackground = GetStockObject(GRAY_BRUSH); + class_shadow.lpszClassName = SHADOW_WIN_CLASS_NAME; + + class_history = class_main; + class_history.lpfnWndProc = WINHELP_HistoryWndProc; + class_history.lpszClassName = HISTORY_WIN_CLASS_NAME; + + return (RegisterClass(&class_main) && + RegisterClass(&class_button_box) && + RegisterClass(&class_text) && + RegisterClass(&class_shadow) && + RegisterClass(&class_history)); +} + +typedef struct +{ + WORD size; + WORD command; + LONG data; + LONG reserved; + WORD ofsFilename; + WORD ofsData; +} WINHELP,*LPWINHELP; + +/****************************************************************** + * WINHELP_HandleCommand + * + * + */ +static LRESULT WINHELP_HandleCommand(HWND hSrcWnd, LPARAM lParam) +{ + COPYDATASTRUCT* cds = (COPYDATASTRUCT*)lParam; + WINHELP* wh; + + if (cds->dwData != 0xA1DE505) + { + WINE_FIXME("Wrong magic number (%08lx)\n", cds->dwData); + return 0; + } + + wh = (WINHELP*)cds->lpData; + + if (wh) + { + char* ptr = (wh->ofsFilename) ? (LPSTR)wh + wh->ofsFilename : NULL; + + WINE_TRACE("Got[%u]: cmd=%u data=%08x fn=%s\n", + wh->size, wh->command, wh->data, ptr); + switch (wh->command) + { + case HELP_CONTEXT: + if (ptr) + { + MACRO_JumpContext(ptr, "main", wh->data); + } + break; + case HELP_QUIT: + MACRO_Exit(); + break; + case HELP_CONTENTS: + if (ptr) + { + MACRO_JumpContents(ptr, "main"); + } + break; + case HELP_HELPONHELP: + MACRO_HelpOn(); + break; + /* case HELP_SETINDEX: */ + case HELP_SETCONTENTS: + if (ptr) + { + MACRO_SetContents(ptr, wh->data); + } + break; + case HELP_CONTEXTPOPUP: + if (ptr) + { + MACRO_PopupContext(ptr, wh->data); + } + break; + /* case HELP_FORCEFILE:*/ + /* case HELP_CONTEXTMENU: */ + case HELP_FINDER: + /* in fact, should be the topic dialog box */ + WINE_FIXME("HELP_FINDER: stub\n"); + if (ptr) + { + MACRO_JumpHash(ptr, "main", 0); + } + break; + /* case HELP_WM_HELP: */ + /* case HELP_SETPOPUP_POS: */ + /* case HELP_KEY: */ + /* case HELP_COMMAND: */ + /* case HELP_PARTIALKEY: */ + /* case HELP_MULTIKEY: */ + /* case HELP_SETWINPOS: */ + WINE_FIXME("Unknown command (%x) for remote winhelp control\n", wh->command); + break; + } + } + return 0L; +} + +/****************************************************************** + * WINHELP_ReuseWindow + * + * + */ +static BOOL WINHELP_ReuseWindow(WINHELP_WINDOW* win, WINHELP_WINDOW* oldwin, + HLPFILE_PAGE* page, int nCmdShow) +{ + unsigned int i; + + win->hMainWnd = oldwin->hMainWnd; + win->hButtonBoxWnd = oldwin->hButtonBoxWnd; + win->hTextWnd = oldwin->hTextWnd; + win->hHistoryWnd = oldwin->hHistoryWnd; + oldwin->hMainWnd = oldwin->hButtonBoxWnd = oldwin->hTextWnd = oldwin->hHistoryWnd = 0; + win->hBrush = oldwin->hBrush; + + SetWindowLong(win->hMainWnd, 0, (LONG)win); + SetWindowLong(win->hButtonBoxWnd, 0, (LONG)win); + SetWindowLong(win->hTextWnd, 0, (LONG)win); + SetWindowLong(win->hHistoryWnd, 0, (LONG)win); + + WINHELP_InitFonts(win->hMainWnd); + + if (page) + SetWindowText(win->hMainWnd, page->file->lpszTitle); + + WINHELP_SetupText(win->hTextWnd); + InvalidateRect(win->hTextWnd, NULL, TRUE); + SendMessage(win->hMainWnd, WM_USER, 0, 0); + ShowWindow(win->hMainWnd, nCmdShow); + UpdateWindow(win->hTextWnd); + + if (!(win->info->win_style & WS_POPUP)) + { + unsigned num; + + memcpy(win->history, oldwin->history, sizeof(win->history)); + win->histIndex = oldwin->histIndex; + + /* FIXME: when using back, we shouldn't update the history... */ + + if (page) + { + for (i = 0; i < win->histIndex; i++) + if (win->history[i] == page) break; + + /* if the new page is already in the history, do nothing */ + if (i == win->histIndex) + { + num = sizeof(win->history) / sizeof(win->history[0]); + if (win->histIndex == num) + { + /* we're full, remove latest entry */ + HLPFILE_FreeHlpFile(win->history[0]->file); + memmove(&win->history[0], &win->history[1], + (num - 1) * sizeof(win->history[0])); + win->histIndex--; + } + win->history[win->histIndex++] = page; + page->file->wRefCount++; + if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE); + } + } + + memcpy(win->back, oldwin->back, sizeof(win->back)); + win->backIndex = oldwin->backIndex; + + if (page) + { + num = sizeof(win->back) / sizeof(win->back[0]); + if (win->backIndex == num) + { + /* we're full, remove latest entry */ + HLPFILE_FreeHlpFile(win->back[0]->file); + memmove(&win->back[0], &win->back[1], + (num - 1) * sizeof(win->back[0])); + win->backIndex--; + } + win->back[win->backIndex++] = page; + page->file->wRefCount++; + } + } + else + win->backIndex = win->histIndex = 0; + + oldwin->histIndex = oldwin->backIndex = 0; + WINHELP_DeleteWindow(oldwin); + return TRUE; +} + +/*********************************************************************** + * + * WINHELP_CreateHelpWindow + */ +BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi, + int nCmdShow) +{ + WINHELP_WINDOW *win, *oldwin; + HWND hWnd; + BOOL bPrimary; + BOOL bPopup; + LPSTR name; + + bPrimary = !lstrcmpi(wi->name, "main"); + bPopup = wi->win_style & WS_POPUP; + + /* Initialize WINHELP_WINDOW struct */ + win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(WINHELP_WINDOW) + strlen(wi->name) + 1); + if (!win) return FALSE; + + win->next = Globals.win_list; + Globals.win_list = win; + + name = (char*)win + sizeof(WINHELP_WINDOW); + lstrcpy(name, wi->name); + win->lpszName = name; + + win->page = page; + + win->hArrowCur = LoadCursorA(0, (LPSTR)IDC_ARROW); + win->hHandCur = LoadCursorA(0, (LPSTR)IDC_HAND); + + win->info = wi; + + Globals.active_win = win; + + /* Initialize default pushbuttons */ + if (bPrimary && page) + { + CHAR buffer[MAX_STRING_LEN]; + + LoadString(Globals.hInstance, STID_CONTENTS, buffer, sizeof(buffer)); + MACRO_CreateButton("BTN_CONTENTS", buffer, "Contents()"); + LoadString(Globals.hInstance, STID_SEARCH,buffer, sizeof(buffer)); + MACRO_CreateButton("BTN_SEARCH", buffer, "Search()"); + LoadString(Globals.hInstance, STID_BACK, buffer, sizeof(buffer)); + MACRO_CreateButton("BTN_BACK", buffer, "Back()"); + LoadString(Globals.hInstance, STID_HISTORY, buffer, sizeof(buffer)); + MACRO_CreateButton("BTN_HISTORY", buffer, "History()"); + LoadString(Globals.hInstance, STID_TOPICS, buffer, sizeof(buffer)); + MACRO_CreateButton("BTN_TOPICS", buffer, "Finder()"); + } + + /* Initialize file specific pushbuttons */ + if (!(wi->win_style & WS_POPUP) && page) + { + HLPFILE_MACRO *macro; + for (macro = page->file->first_macro; macro; macro = macro->next) + MACRO_ExecuteMacro(macro->lpszMacro); + + for (macro = page->first_macro; macro; macro = macro->next) + MACRO_ExecuteMacro(macro->lpszMacro); + } + + /* Reuse existing window */ + if (!bPopup) + { + for (oldwin = win->next; oldwin; oldwin = oldwin->next) + { + if (!lstrcmpi(oldwin->lpszName, wi->name)) + { + return WINHELP_ReuseWindow(win, oldwin, page, nCmdShow); + } + } + if (page) + { + win->histIndex = win->backIndex = 1; + win->history[0] = win->back[0] = page; + page->file->wRefCount += 2; + strcpy(wi->caption, page->file->lpszTitle); + } + } + + hWnd = CreateWindow(bPopup ? TEXT_WIN_CLASS_NAME : MAIN_WIN_CLASS_NAME, + wi->caption, + bPrimary ? WS_OVERLAPPEDWINDOW : wi->win_style, + wi->origin.x, wi->origin.y, wi->size.cx, wi->size.cy, + NULL, bPrimary ? LoadMenu(Globals.hInstance, MAKEINTRESOURCE(MAIN_MENU)) : 0, + Globals.hInstance, win); + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + return TRUE; +} + +/*********************************************************************** + * + * WINHELP_CreateHelpWindowByHash + */ +BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash, + HLPFILE_WINDOWINFO* wi, int nCmdShow) +{ + HLPFILE_PAGE* page = NULL; + + if (hlpfile) + page = lHash ? HLPFILE_PageByHash(hlpfile, lHash) : + HLPFILE_Contents(hlpfile); + if (page) page->file->wRefCount++; + return WINHELP_CreateHelpWindow(page, wi, nCmdShow); +} + +/*********************************************************************** + * + * WINHELP_CreateHelpWindowByMap + */ +BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap, + HLPFILE_WINDOWINFO* wi, int nCmdShow) +{ + HLPFILE_PAGE* page = NULL; + + page = HLPFILE_PageByMap(hlpfile, lMap); + if (page) page->file->wRefCount++; + return WINHELP_CreateHelpWindow(page, wi, nCmdShow); +} + +/*********************************************************************** + * + * WINHELP_MainWndProc + */ +static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + WINHELP_WINDOW *win; + WINHELP_BUTTON *button; + RECT rect, button_box_rect; + INT text_top, curPos, min, max, dy, keyDelta; + + WINHELP_CheckPopup(msg); + + switch (msg) + { + case WM_NCCREATE: + win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; + SetWindowLong(hWnd, 0, (LONG) win); + win->hMainWnd = hWnd; + break; + + case WM_CREATE: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + + /* Create button box and text Window */ + CreateWindow(BUTTON_BOX_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE, + 0, 0, 0, 0, hWnd, 0, Globals.hInstance, win); + + CreateWindow(TEXT_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE, + 0, 0, 0, 0, hWnd, 0, Globals.hInstance, win); + + /* Fall through */ + case WM_USER: + case WM_WINDOWPOSCHANGED: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + GetClientRect(hWnd, &rect); + + /* Update button box and text Window */ + SetWindowPos(win->hButtonBoxWnd, HWND_TOP, + rect.left, rect.top, + rect.right - rect.left, + rect.bottom - rect.top, 0); + + GetWindowRect(win->hButtonBoxWnd, &button_box_rect); + text_top = rect.top + button_box_rect.bottom - button_box_rect.top; + + SetWindowPos(win->hTextWnd, HWND_TOP, + rect.left, text_top, + rect.right - rect.left, + rect.bottom - text_top, 0); + + break; + + case WM_COMMAND: + Globals.active_win = win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + switch (wParam) + { + /* Menu FILE */ + case MNID_FILE_OPEN: MACRO_FileOpen(); break; + case MNID_FILE_PRINT: MACRO_Print(); break; + case MNID_FILE_SETUP: MACRO_PrinterSetup(); break; + case MNID_FILE_EXIT: MACRO_Exit(); break; + + /* Menu EDIT */ + case MNID_EDIT_COPYDLG: MACRO_CopyDialog(); break; + case MNID_EDIT_ANNOTATE:MACRO_Annotate(); break; + + /* Menu Bookmark */ + case MNID_BKMK_DEFINE: MACRO_BookmarkDefine(); break; + + /* Menu Help */ + case MNID_HELP_HELPON: MACRO_HelpOn(); break; + case MNID_HELP_HELPTOP: MACRO_HelpOnTop(); break; + case MNID_HELP_ABOUT: MACRO_About(); break; + case MNID_HELP_WINE: ShellAbout(hWnd, "WINE", "Help", 0); break; + + default: + /* Buttons */ + for (button = win->first_button; button; button = button->next) + if (wParam == button->wParam) break; + if (button) + MACRO_ExecuteMacro(button->lpszMacro); + else + WINHELP_MessageBoxIDS(STID_NOT_IMPLEMENTED, 0x121, MB_OK); + break; + } + break; + case WM_DESTROY: + if (Globals.hPopupWnd) DestroyWindow(Globals.hPopupWnd); + break; + case WM_COPYDATA: + return WINHELP_HandleCommand((HWND)wParam, lParam); + + case WM_KEYDOWN: + keyDelta = 0; + + switch (wParam) + { + case VK_UP: + case VK_DOWN: + keyDelta = GetSystemMetrics(SM_CXVSCROLL); + if (wParam == VK_UP) + keyDelta = -keyDelta; + + case VK_PRIOR: + case VK_NEXT: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + curPos = GetScrollPos(win->hTextWnd, SB_VERT); + GetScrollRange(win->hTextWnd, SB_VERT, &min, &max); + + if (keyDelta == 0) + { + GetClientRect(win->hTextWnd, &rect); + keyDelta = (rect.bottom - rect.top) / 2; + if (wParam == VK_PRIOR) + keyDelta = -keyDelta; + } + + curPos += keyDelta; + if (curPos > max) + curPos = max; + else if (curPos < min) + curPos = min; + + dy = GetScrollPos(win->hTextWnd, SB_VERT) - curPos; + SetScrollPos(win->hTextWnd, SB_VERT, curPos, TRUE); + ScrollWindow(win->hTextWnd, 0, dy, NULL, NULL); + UpdateWindow(win->hTextWnd); + return 0; + + case VK_ESCAPE: + MACRO_Exit(); + return 0; + } + break; + } + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +/*********************************************************************** + * + * WINHELP_ButtonBoxWndProc + */ +static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + WINDOWPOS *winpos; + WINHELP_WINDOW *win; + WINHELP_BUTTON *button; + SIZE button_size; + INT x, y; + + WINHELP_CheckPopup(msg); + + switch (msg) + { + case WM_NCCREATE: + win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; + SetWindowLong(hWnd, 0, (LONG) win); + win->hButtonBoxWnd = hWnd; + break; + + case WM_WINDOWPOSCHANGING: + winpos = (WINDOWPOS*) lParam; + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + + /* Update buttons */ + button_size.cx = 0; + button_size.cy = 0; + for (button = win->first_button; button; button = button->next) + { + HDC hDc; + SIZE textsize; + if (!button->hWnd) + { + button->hWnd = CreateWindow(STRING_BUTTON, button->lpszName, + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + 0, 0, 0, 0, + hWnd, (HMENU) button->wParam, + Globals.hInstance, 0); + if (button->hWnd) { + if (Globals.button_proc == NULL) + Globals.button_proc = (WNDPROC) GetWindowLongPtr(button->hWnd, GWLP_WNDPROC); + SetWindowLongPtr(button->hWnd, GWLP_WNDPROC, (LONG_PTR) WINHELP_ButtonWndProc); + } + } + hDc = GetDC(button->hWnd); + GetTextExtentPoint(hDc, button->lpszName, + lstrlen(button->lpszName), &textsize); + ReleaseDC(button->hWnd, hDc); + + button_size.cx = max(button_size.cx, textsize.cx + BUTTON_CX); + button_size.cy = max(button_size.cy, textsize.cy + BUTTON_CY); + } + + x = 0; + y = 0; + for (button = win->first_button; button; button = button->next) + { + SetWindowPos(button->hWnd, HWND_TOP, x, y, button_size.cx, button_size.cy, 0); + + if (x + 2 * button_size.cx <= winpos->cx) + x += button_size.cx; + else + x = 0, y += button_size.cy; + } + winpos->cy = y + (x ? button_size.cy : 0); + break; + + case WM_COMMAND: + SendMessage(GetParent(hWnd), msg, wParam, lParam); + break; + + case WM_KEYDOWN: + switch (wParam) + { + case VK_UP: + case VK_DOWN: + case VK_PRIOR: + case VK_NEXT: + case VK_ESCAPE: + return SendMessage(GetParent(hWnd), msg, wParam, lParam); + } + break; + } + + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +/*********************************************************************** + * + * WINHELP_ButtonWndProc + */ +static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + if (msg == WM_KEYDOWN) + { + switch (wParam) + { + case VK_UP: + case VK_DOWN: + case VK_PRIOR: + case VK_NEXT: + case VK_ESCAPE: + return SendMessage(GetParent(hWnd), msg, wParam, lParam); + } + } + + return CallWindowProc(Globals.button_proc, hWnd, msg, wParam, lParam); +} + +/*********************************************************************** + * + * WINHELP_TextWndProc + */ +static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + WINHELP_WINDOW *win; + WINHELP_LINE *line; + WINHELP_LINE_PART *part; + WINDOWPOS *winpos; + PAINTSTRUCT ps; + HDC hDc; + POINT mouse; + INT scroll_pos; + HWND hPopupWnd; + BOOL bExit; + + if (msg != WM_LBUTTONDOWN) + WINHELP_CheckPopup(msg); + + switch (msg) + { + case WM_NCCREATE: + win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; + SetWindowLong(hWnd, 0, (LONG) win); + win->hTextWnd = hWnd; + win->hBrush = CreateSolidBrush(win->info->sr_color); + if (win->info->win_style & WS_POPUP) Globals.hPopupWnd = win->hMainWnd = hWnd; + WINHELP_InitFonts(hWnd); + break; + + case WM_CREATE: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + + /* Calculate vertical size and position of a popup window */ + if (win->info->win_style & WS_POPUP) + { + POINT origin; + RECT old_window_rect; + RECT old_client_rect; + SIZE old_window_size; + SIZE old_client_size; + SIZE new_client_size; + SIZE new_window_size; + + GetWindowRect(hWnd, &old_window_rect); + origin.x = old_window_rect.left; + origin.y = old_window_rect.top; + old_window_size.cx = old_window_rect.right - old_window_rect.left; + old_window_size.cy = old_window_rect.bottom - old_window_rect.top; + + GetClientRect(hWnd, &old_client_rect); + old_client_size.cx = old_client_rect.right - old_client_rect.left; + old_client_size.cy = old_client_rect.bottom - old_client_rect.top; + + new_client_size = old_client_size; + WINHELP_SplitLines(hWnd, &new_client_size); + + if (origin.y + POPUP_YDISTANCE + new_client_size.cy <= GetSystemMetrics(SM_CYSCREEN)) + origin.y += POPUP_YDISTANCE; + else + origin.y -= POPUP_YDISTANCE + new_client_size.cy; + + 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 = + CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP, + origin.x + SHADOW_DX, origin.y + SHADOW_DY, + new_window_size.cx, new_window_size.cy, + 0, 0, Globals.hInstance, 0); + + SetWindowPos(hWnd, HWND_TOP, origin.x, origin.y, + new_window_size.cx, new_window_size.cy, + 0); + SetWindowPos(win->hShadowWnd, hWnd, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); + ShowWindow(win->hShadowWnd, SW_NORMAL); + SetActiveWindow(hWnd); + } + break; + + case WM_WINDOWPOSCHANGED: + winpos = (WINDOWPOS*) lParam; + + if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd); + break; + + case WM_MOUSEWHEEL: + { + int wheelDelta = 0; + UINT scrollLines = 3; + int curPos = GetScrollPos(hWnd, SB_VERT); + int min, max; + + GetScrollRange(hWnd, SB_VERT, &min, &max); + + SystemParametersInfo(SPI_GETWHEELSCROLLLINES,0, &scrollLines, 0); + if (wParam & (MK_SHIFT | MK_CONTROL)) + return DefWindowProc(hWnd, msg, wParam, lParam); + wheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam); + if (abs(wheelDelta) >= WHEEL_DELTA && scrollLines) { + int dy; + + curPos += wheelDelta; + if (curPos > max) + curPos = max; + else if (curPos < min) + curPos = min; + + dy = GetScrollPos(hWnd, SB_VERT) - curPos; + SetScrollPos(hWnd, SB_VERT, curPos, TRUE); + ScrollWindow(hWnd, 0, dy, NULL, NULL); + UpdateWindow(hWnd); + } + } + break; + + case WM_VSCROLL: + { + BOOL update = TRUE; + RECT rect; + INT Min, Max; + INT CurPos = GetScrollPos(hWnd, SB_VERT); + INT dy; + + GetScrollRange(hWnd, SB_VERT, &Min, &Max); + GetClientRect(hWnd, &rect); + + switch (wParam & 0xffff) + { + case SB_THUMBTRACK: + case SB_THUMBPOSITION: CurPos = wParam >> 16; break; + case SB_TOP: CurPos = Min; break; + case SB_BOTTOM: CurPos = Max; break; + case SB_PAGEUP: CurPos -= (rect.bottom - rect.top) / 2; break; + case SB_PAGEDOWN: CurPos += (rect.bottom - rect.top) / 2; break; + case SB_LINEUP: CurPos -= GetSystemMetrics(SM_CXVSCROLL); break; + case SB_LINEDOWN: CurPos += GetSystemMetrics(SM_CXVSCROLL); break; + default: update = FALSE; + } + if (update) + { + if (CurPos > Max) + CurPos = Max; + else if (CurPos < Min) + CurPos = Min; + dy = GetScrollPos(hWnd, SB_VERT) - CurPos; + SetScrollPos(hWnd, SB_VERT, CurPos, TRUE); + ScrollWindow(hWnd, 0, dy, NULL, NULL); + UpdateWindow(hWnd); + } + } + break; + + case WM_PAINT: + hDc = BeginPaint(hWnd, &ps); + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + scroll_pos = GetScrollPos(hWnd, SB_VERT); + + /* No DPtoLP needed - MM_TEXT map mode */ + if (ps.fErase) FillRect(hDc, &ps.rcPaint, win->hBrush); + for (line = win->first_line; line; line = line->next) + { + for (part = &line->first_part; part; part = part->next) + { + switch (part->cookie) + { + case hlp_line_part_text: + SelectObject(hDc, part->u.text.hFont); + SetTextColor(hDc, part->u.text.color); + SetBkColor(hDc, win->info->sr_color); + TextOut(hDc, part->rect.left, part->rect.top - scroll_pos, + part->u.text.lpsText, part->u.text.wTextLen); + if (part->u.text.wUnderline) + { + HPEN hPen; + + switch (part->u.text.wUnderline) + { + case 1: /* simple */ + case 2: /* double */ + hPen = CreatePen(PS_SOLID, 1, part->u.text.color); + break; + case 3: /* dotted */ + hPen = CreatePen(PS_DOT, 1, part->u.text.color); + break; + default: + WINE_FIXME("Unknow underline type\n"); + continue; + } + + SelectObject(hDc, hPen); + MoveToEx(hDc, part->rect.left, part->rect.bottom - scroll_pos - 1, NULL); + LineTo(hDc, part->rect.right, part->rect.bottom - scroll_pos - 1); + if (part->u.text.wUnderline == 2) + { + MoveToEx(hDc, part->rect.left, part->rect.bottom - scroll_pos + 1, NULL); + LineTo(hDc, part->rect.right, part->rect.bottom - scroll_pos + 1); + } + DeleteObject(hPen); + } + break; + case hlp_line_part_bitmap: + { + HDC hMemDC; + + hMemDC = CreateCompatibleDC(hDc); + SelectObject(hMemDC, part->u.bitmap.hBitmap); + BitBlt(hDc, part->rect.left, part->rect.top - scroll_pos, + part->rect.right - part->rect.left, part->rect.bottom - part->rect.top, + hMemDC, 0, 0, SRCCOPY); + DeleteDC(hMemDC); + } + break; + case hlp_line_part_metafile: + { + HDC hMemDC; + HBITMAP hBitmap; + SIZE sz; + RECT rc; + + sz.cx = part->rect.right - part->rect.left; + sz.cy = part->rect.bottom - part->rect.top; + hMemDC = CreateCompatibleDC(hDc); + hBitmap = CreateCompatibleBitmap(hDc, sz.cx, sz.cy); + SelectObject(hMemDC, hBitmap); + SelectObject(hMemDC, win->hBrush); + rc.left = 0; + rc.top = 0; + rc.right = sz.cx; + rc.bottom = sz.cy; + FillRect(hMemDC, &rc, win->hBrush); + SetMapMode(hMemDC, part->u.metafile.mm); + SetWindowExtEx(hMemDC, sz.cx, sz.cy, 0); + SetViewportExtEx(hMemDC, sz.cx, sz.cy, 0); + SetWindowOrgEx(hMemDC, 0, 0, 0); + SetViewportOrgEx(hMemDC, 0, 0, 0); + PlayMetaFile(hMemDC, part->u.metafile.hMetaFile); + SetMapMode(hMemDC, MM_TEXT); + SetWindowOrgEx(hMemDC, 0, 0, 0); + SetViewportOrgEx(hMemDC, 0, 0, 0); + BitBlt(hDc, part->rect.left, part->rect.top - scroll_pos, + sz.cx, sz.cy, hMemDC, 0, 0, SRCCOPY); + DeleteDC(hMemDC); + DeleteObject(hBitmap); + } + break; + } + } + } + + EndPaint(hWnd, &ps); + break; + + case WM_MOUSEMOVE: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + + if (WINHELP_IsOverLink(win, wParam, lParam)) + SetCursor(win->hHandCur); /* set to hand pointer cursor to indicate a link */ + else + SetCursor(win->hArrowCur); /* set to hand pointer cursor to indicate a link */ + + break; + + case WM_LBUTTONDOWN: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + + hPopupWnd = Globals.hPopupWnd; + Globals.hPopupWnd = 0; + + part = WINHELP_IsOverLink(win, wParam, lParam); + if (part) + { + HLPFILE* hlpfile; + HLPFILE_WINDOWINFO* wi; + + mouse.x = (short)LOWORD(lParam); + mouse.y = (short)HIWORD(lParam); + + if (part->link) switch (part->link->cookie) + { + case hlp_link_link: + hlpfile = WINHELP_LookupHelpFile(part->link->lpszString); + if (part->link->window == -1) + wi = win->info; + else if ((part->link->window >= 0) && (part->link->window < hlpfile->numWindows)) + wi = &hlpfile->windows[part->link->window]; + else + { + WINE_WARN("link to window %d/%d\n", part->link->window, hlpfile->numWindows); + break; + } + WINHELP_CreateHelpWindowByHash(hlpfile, part->link->lHash, wi, + SW_NORMAL); + break; + case hlp_link_popup: + hlpfile = WINHELP_LookupHelpFile(part->link->lpszString); + if (hlpfile) WINHELP_CreateHelpWindowByHash(hlpfile, part->link->lHash, + WINHELP_GetPopupWindowInfo(hlpfile, hWnd, &mouse), + SW_NORMAL); + break; + case hlp_link_macro: + MACRO_ExecuteMacro(part->link->lpszString); + break; + default: + WINE_FIXME("Unknown link cookie %d\n", part->link->cookie); + } + } + + if (hPopupWnd) + DestroyWindow(hPopupWnd); + break; + + case WM_NCDESTROY: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + + if (hWnd == Globals.hPopupWnd) Globals.hPopupWnd = 0; + + bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main")); + DeleteObject(win->hBrush); + + WINHELP_DeleteWindow(win); + + if (bExit) MACRO_Exit(); + + if (!Globals.win_list) + PostQuitMessage(0); + break; + } + + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +/****************************************************************** + * WINHELP_HistoryWndProc + * + * + */ +static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + WINHELP_WINDOW* win; + PAINTSTRUCT ps; + HDC hDc; + TEXTMETRIC tm; + unsigned int i; + RECT r; + + switch (msg) + { + case WM_NCCREATE: + win = (WINHELP_WINDOW*)((LPCREATESTRUCT)lParam)->lpCreateParams; + SetWindowLong(hWnd, 0, (LONG)win); + win->hHistoryWnd = hWnd; + break; + case WM_CREATE: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + hDc = GetDC(hWnd); + GetTextMetrics(hDc, &tm); + GetWindowRect(hWnd, &r); + + r.right = r.left + 30 * tm.tmAveCharWidth; + r.bottom = r.top + (sizeof(win->history) / sizeof(win->history[0])) * tm.tmHeight; + AdjustWindowRect(&r, GetWindowLong(hWnd, GWL_STYLE), FALSE); + if (r.left < 0) {r.right -= r.left; r.left = 0;} + if (r.top < 0) {r.bottom -= r.top; r.top = 0;} + + MoveWindow(hWnd, r.left, r.top, r.right, r.bottom, TRUE); + ReleaseDC(hWnd, hDc); + break; + case WM_LBUTTONDOWN: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + hDc = GetDC(hWnd); + GetTextMetrics(hDc, &tm); + i = HIWORD(lParam) / tm.tmHeight; + if (i < win->histIndex) + WINHELP_CreateHelpWindow(win->history[i], win->info, SW_SHOW); + ReleaseDC(hWnd, hDc); + break; + case WM_PAINT: + hDc = BeginPaint(hWnd, &ps); + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + GetTextMetrics(hDc, &tm); + + for (i = 0; i < win->histIndex; i++) + { + TextOut(hDc, 0, i * tm.tmHeight, win->history[i]->lpszTitle, + strlen(win->history[i]->lpszTitle)); + } + EndPaint(hWnd, &ps); + break; + case WM_DESTROY: + win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + if (hWnd == win->hHistoryWnd) + win->hHistoryWnd = 0; + break; + } + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +/*********************************************************************** + * + * WINHELP_ShadowWndProc + */ +static LRESULT CALLBACK WINHELP_ShadowWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + WINHELP_CheckPopup(msg); + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +/*********************************************************************** + * + * SetupText + */ +static void WINHELP_SetupText(HWND hWnd) +{ + HDC hDc = GetDC(hWnd); + RECT rect; + SIZE newsize; + + ShowScrollBar(hWnd, SB_VERT, FALSE); + if (!WINHELP_SplitLines(hWnd, NULL)) + { + ShowScrollBar(hWnd, SB_VERT, TRUE); + GetClientRect(hWnd, &rect); + + WINHELP_SplitLines(hWnd, &newsize); + SetScrollRange(hWnd, SB_VERT, 0, rect.top + newsize.cy - rect.bottom, TRUE); + } + else + { + SetScrollPos(hWnd, SB_VERT, 0, FALSE); + SetScrollRange(hWnd, SB_VERT, 0, 0, FALSE); + } + + ReleaseDC(hWnd, hDc); +} + +/*********************************************************************** + * + * WINHELP_AppendText + */ +static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp, + LPSIZE space, LPSIZE textsize, + INT *line_ascent, INT ascent, + LPCSTR text, UINT textlen, + HFONT font, COLORREF color, HLPFILE_LINK *link, + unsigned underline) +{ + WINHELP_LINE *line; + WINHELP_LINE_PART *part; + LPSTR ptr; + + if (!*partp) /* New line */ + { + *line_ascent = ascent; + + line = HeapAlloc(GetProcessHeap(), 0, + sizeof(WINHELP_LINE) + textlen); + if (!line) return FALSE; + + line->next = 0; + part = &line->first_part; + ptr = (char*)line + sizeof(WINHELP_LINE); + + line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy; + line->rect.bottom = line->rect.top; + line->rect.left = space->cx; + line->rect.right = space->cx; + + if (**linep) *linep = &(**linep)->next; + **linep = line; + space->cy = 0; + } + else /* Same line */ + { + line = **linep; + + if (*line_ascent < ascent) + { + WINHELP_LINE_PART *p; + for (p = &line->first_part; p; p = p->next) + { + p->rect.top += ascent - *line_ascent; + p->rect.bottom += ascent - *line_ascent; + } + line->rect.bottom += ascent - *line_ascent; + *line_ascent = ascent; + } + + part = HeapAlloc(GetProcessHeap(), 0, + sizeof(WINHELP_LINE_PART) + textlen); + if (!part) return FALSE; + **partp = part; + ptr = (char*)part + sizeof(WINHELP_LINE_PART); + } + + memcpy(ptr, text, textlen); + part->cookie = hlp_line_part_text; + part->rect.left = line->rect.right + (*partp ? space->cx : 0); + part->rect.right = part->rect.left + textsize->cx; + line->rect.right = part->rect.right; + part->rect.top = + ((*partp) ? line->rect.top : line->rect.bottom) + *line_ascent - ascent; + part->rect.bottom = part->rect.top + textsize->cy; + line->rect.bottom = max(line->rect.bottom, part->rect.bottom); + part->u.text.lpsText = ptr; + part->u.text.wTextLen = textlen; + part->u.text.hFont = font; + part->u.text.color = color; + part->u.text.wUnderline = underline; + + WINE_TRACE("Appended text '%*.*s'[%d] @ (%d,%d-%d,%d)\n", + part->u.text.wTextLen, + part->u.text.wTextLen, + part->u.text.lpsText, + part->u.text.wTextLen, + part->rect.left, part->rect.top, part->rect.right, part->rect.bottom); + + part->link = link; + if (link) link->wRefCount++; + + part->next = 0; + *partp = &part->next; + + space->cx = 0; + + return TRUE; +} + +/*********************************************************************** + * + * WINHELP_AppendGfxObject + */ +static WINHELP_LINE_PART* WINHELP_AppendGfxObject(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp, + LPSIZE space, LPSIZE gfxSize, + HLPFILE_LINK *link, unsigned pos) +{ + WINHELP_LINE *line; + WINHELP_LINE_PART *part; + LPSTR ptr; + + if (!*partp || pos == 1) /* New line */ + { + line = HeapAlloc(GetProcessHeap(), 0, sizeof(WINHELP_LINE)); + if (!line) return NULL; + + line->next = NULL; + part = &line->first_part; + + line->rect.top = (**linep ? (**linep)->rect.bottom : 0) + space->cy; + line->rect.bottom = line->rect.top; + line->rect.left = space->cx; + line->rect.right = space->cx; + + if (**linep) *linep = &(**linep)->next; + **linep = line; + space->cy = 0; + ptr = (char*)line + sizeof(WINHELP_LINE); + } + else /* Same line */ + { + if (pos == 2) WINE_FIXME("Left alignment not handled\n"); + line = **linep; + + part = HeapAlloc(GetProcessHeap(), 0, sizeof(WINHELP_LINE_PART)); + if (!part) return NULL; + **partp = part; + ptr = (char*)part + sizeof(WINHELP_LINE_PART); + } + + /* part->cookie should be set by caller (image or metafile) */ + part->rect.left = line->rect.right + (*partp ? space->cx : 0); + part->rect.right = part->rect.left + gfxSize->cx; + line->rect.right = part->rect.right; + part->rect.top = (*partp) ? line->rect.top : line->rect.bottom; + part->rect.bottom = part->rect.top + gfxSize->cy; + line->rect.bottom = max(line->rect.bottom, part->rect.bottom); + + WINE_TRACE("Appended gfx @ (%d,%d-%d,%d)\n", + part->rect.left, part->rect.top, part->rect.right, part->rect.bottom); + + part->link = link; + if (link) link->wRefCount++; + + part->next = NULL; + *partp = &part->next; + + space->cx = 0; + + return part; +} + + +/*********************************************************************** + * + * WINHELP_SplitLines + */ +static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize) +{ + WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + HLPFILE_PARAGRAPH *p; + WINHELP_LINE **line = &win->first_line; + WINHELP_LINE_PART **part = 0; + INT line_ascent = 0; + SIZE space; + RECT rect; + HDC hDc; + + if (newsize) newsize->cx = newsize->cy = 0; + + if (!win->page) return TRUE; + + WINHELP_DeleteLines(win); + + GetClientRect(hWnd, &rect); + + rect.top += INTERNAL_BORDER_WIDTH; + rect.left += INTERNAL_BORDER_WIDTH; + rect.right -= INTERNAL_BORDER_WIDTH; + rect.bottom -= INTERNAL_BORDER_WIDTH; + + space.cy = rect.top; + space.cx = rect.left; + + hDc = GetDC(hWnd); + + for (p = win->page->first_paragraph; p; p = p->next) + { + switch (p->cookie) + { + case para_normal_text: + case para_debug_text: + { + TEXTMETRIC tm; + SIZE textsize = {0, 0}; + LPCSTR text = p->u.text.lpszText; + UINT indent = 0; + UINT len = strlen(text); + unsigned underline = 0; + + HFONT hFont = 0; + COLORREF color = RGB(0, 0, 0); + + if (p->u.text.wFont < win->page->file->numFonts) + { + HLPFILE* hlpfile = win->page->file; + + if (!hlpfile->fonts[p->u.text.wFont].hFont) + hlpfile->fonts[p->u.text.wFont].hFont = CreateFontIndirect(&hlpfile->fonts[p->u.text.wFont].LogFont); + hFont = hlpfile->fonts[p->u.text.wFont].hFont; + color = hlpfile->fonts[p->u.text.wFont].color; + } + else + { + UINT wFont = (p->u.text.wFont < win->fonts_len) ? p->u.text.wFont : 0; + + hFont = win->fonts[wFont]; + } + + if (p->link && p->link->bClrChange) + { + underline = (p->link->cookie == hlp_link_popup) ? 3 : 1; + color = RGB(0, 0x80, 0); + } + if (p->cookie == para_debug_text) color = RGB(0xff, 0, 0); + + SelectObject(hDc, hFont); + + GetTextMetrics(hDc, &tm); + + if (p->u.text.wIndent) + { + indent = p->u.text.wIndent * 5 * tm.tmAveCharWidth; + if (!part) + space.cx = rect.left + indent - 2 * tm.tmAveCharWidth; + } + + if (p->u.text.wVSpace) + { + part = 0; + space.cx = rect.left + indent; + space.cy += (p->u.text.wVSpace - 1) * tm.tmHeight; + } + + if (p->u.text.wHSpace) + { + space.cx += p->u.text.wHSpace * 2 * tm.tmAveCharWidth; + } + + WINE_TRACE("splitting text %s\n", text); + + while (len) + { + INT free_width = rect.right - (part ? (*line)->rect.right : rect.left) - space.cx; + UINT low = 0, curr = len, high = len, textlen = 0; + + if (free_width > 0) + { + while (1) + { + GetTextExtentPoint(hDc, text, curr, &textsize); + + if (textsize.cx <= free_width) low = curr; + else high = curr; + + if (high <= low + 1) break; + + if (textsize.cx) curr = (curr * free_width) / textsize.cx; + if (curr <= low) curr = low + 1; + else if (curr >= high) curr = high - 1; + } + textlen = low; + while (textlen && text[textlen] && text[textlen] != ' ') textlen--; + } + if (!part && !textlen) textlen = max(low, 1); + + if (free_width <= 0 || !textlen) + { + part = 0; + space.cx = rect.left + indent; + space.cx = min(space.cx, rect.right - rect.left - 1); + continue; + } + + WINE_TRACE("\t => %d %*s\n", textlen, textlen, text); + + if (!WINHELP_AppendText(&line, &part, &space, &textsize, + &line_ascent, tm.tmAscent, + text, textlen, hFont, color, p->link, underline) || + (!newsize && (*line)->rect.bottom > rect.bottom)) + { + ReleaseDC(hWnd, hDc); + return FALSE; + } + + if (newsize) + newsize->cx = max(newsize->cx, (*line)->rect.right + INTERNAL_BORDER_WIDTH); + + len -= textlen; + text += textlen; + if (text[0] == ' ') text++, len--; + } + } + break; + case para_bitmap: + case para_metafile: + { + SIZE gfxSize; + INT free_width; + WINHELP_LINE_PART* ref_part; + + if (p->u.gfx.pos & 0x8000) + { + space.cx = rect.left; + if (*line) + space.cy += (*line)->rect.bottom - (*line)->rect.top; + part = 0; + } + + if (p->cookie == para_bitmap) + { + DIBSECTION dibs; + + GetObject(p->u.gfx.u.bmp.hBitmap, sizeof(dibs), &dibs); + gfxSize.cx = dibs.dsBm.bmWidth; + gfxSize.cy = dibs.dsBm.bmHeight; + } + else + { + LPMETAFILEPICT lpmfp = &p->u.gfx.u.mfp; + if (lpmfp->mm == MM_ANISOTROPIC || lpmfp->mm == MM_ISOTROPIC) + { + gfxSize.cx = MulDiv(lpmfp->xExt, GetDeviceCaps(hDc, HORZRES), + 100*GetDeviceCaps(hDc, HORZSIZE)); + gfxSize.cy = MulDiv(lpmfp->yExt, GetDeviceCaps(hDc, VERTRES), + 100*GetDeviceCaps(hDc, VERTSIZE)); + } + else + { + gfxSize.cx = lpmfp->xExt; + gfxSize.cy = lpmfp->yExt; + } + } + + free_width = rect.right - ((part && *line) ? (*line)->rect.right : rect.left) - space.cx; + if (free_width <= 0) + { + part = NULL; + space.cx = rect.left; + space.cx = min(space.cx, rect.right - rect.left - 1); + } + ref_part = WINHELP_AppendGfxObject(&line, &part, &space, &gfxSize, + p->link, p->u.gfx.pos); + if (!ref_part || (!newsize && (*line)->rect.bottom > rect.bottom)) + { + return FALSE; + } + if (p->cookie == para_bitmap) + { + ref_part->cookie = hlp_line_part_bitmap; + ref_part->u.bitmap.hBitmap = p->u.gfx.u.bmp.hBitmap; + } + else + { + ref_part->cookie = hlp_line_part_metafile; + ref_part->u.metafile.hMetaFile = p->u.gfx.u.mfp.hMF; + ref_part->u.metafile.mm = p->u.gfx.u.mfp.mm; + } + } + break; + } + } + + if (newsize) + newsize->cy = (*line)->rect.bottom + INTERNAL_BORDER_WIDTH; + + ReleaseDC(hWnd, hDc); + return TRUE; +} + +/*********************************************************************** + * + * WINHELP_CheckPopup + */ +static void WINHELP_CheckPopup(UINT msg) +{ + if (!Globals.hPopupWnd) return; + + switch (msg) + { + case WM_COMMAND: + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_NCLBUTTONDOWN: + case WM_NCMBUTTONDOWN: + case WM_NCRBUTTONDOWN: + DestroyWindow(Globals.hPopupWnd); + Globals.hPopupWnd = 0; + } +} + +/*********************************************************************** + * + * WINHELP_DeleteLines + */ +static void WINHELP_DeleteLines(WINHELP_WINDOW *win) +{ + WINHELP_LINE *line, *next_line; + WINHELP_LINE_PART *part, *next_part; + for (line = win->first_line; line; line = next_line) + { + next_line = line->next; + for (part = &line->first_part; part; part = next_part) + { + next_part = part->next; + HLPFILE_FreeLink(part->link); + HeapFree(GetProcessHeap(), 0, part); + } + } + win->first_line = 0; +} + +/*********************************************************************** + * + * WINHELP_DeleteWindow + */ +static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) +{ + WINHELP_WINDOW** w; + unsigned int i; + WINHELP_BUTTON* b; + WINHELP_BUTTON* bp; + + for (w = &Globals.win_list; *w; w = &(*w)->next) + { + if (*w == win) + { + *w = win->next; + break; + } + } + + if (Globals.active_win == win) + { + Globals.active_win = Globals.win_list; + if (Globals.win_list) + SetActiveWindow(Globals.win_list->hMainWnd); + } + + for (b = win->first_button; b; b = bp) + { + DestroyWindow(b->hWnd); + bp = b->next; + HeapFree(GetProcessHeap(), 0, b); + } + + if (win->hShadowWnd) DestroyWindow(win->hShadowWnd); + if (win->hHistoryWnd) DestroyWindow(win->hHistoryWnd); + + for (i = 0; i < win->histIndex; i++) + { + HLPFILE_FreeHlpFile(win->history[i]->file); + } + + for (i = 0; i < win->backIndex; i++) + HLPFILE_FreeHlpFile(win->back[i]->file); + + if (win->page) HLPFILE_FreeHlpFile(win->page->file); + WINHELP_DeleteLines(win); + HeapFree(GetProcessHeap(), 0, win); +} + +/*********************************************************************** + * + * WINHELP_InitFonts + */ +static void WINHELP_InitFonts(HWND hWnd) +{ + WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLong(hWnd, 0); + LOGFONT logfontlist[] = { + {-10, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, + {-12, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, + {-10, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}, + { -8, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv"}}; +#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) + + static HFONT fonts[FONTS_LEN]; + static BOOL init = 0; + + win->fonts_len = FONTS_LEN; + win->fonts = fonts; + + if (!init) + { + UINT i; + + for (i = 0; i < FONTS_LEN; i++) + { + fonts[i] = CreateFontIndirect(&logfontlist[i]); + } + + init = 1; + } +} + +/*********************************************************************** + * + * WINHELP_MessageBoxIDS + */ +INT WINHELP_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type) +{ + CHAR text[MAX_STRING_LEN]; + CHAR title[MAX_STRING_LEN]; + + LoadString(Globals.hInstance, ids_text, text, sizeof(text)); + LoadString(Globals.hInstance, ids_title, title, sizeof(title)); + + return MessageBox(0, text, title, type); +} + +/*********************************************************************** + * + * MAIN_MessageBoxIDS_s + */ +INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type) +{ + CHAR text[MAX_STRING_LEN]; + CHAR title[MAX_STRING_LEN]; + CHAR newtext[MAX_STRING_LEN + MAX_PATH]; + + LoadString(Globals.hInstance, ids_text, text, sizeof(text)); + LoadString(Globals.hInstance, ids_title, title, sizeof(title)); + wsprintf(newtext, text, str); + + return MessageBox(0, newtext, title, type); +} + +/****************************************************************** + * WINHELP_IsOverLink + * + * + */ +WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW* win, WPARAM wParam, LPARAM lParam) +{ + POINT mouse; + WINHELP_LINE *line; + WINHELP_LINE_PART *part; + int scroll_pos = GetScrollPos(win->hTextWnd, SB_VERT); + + mouse.x = LOWORD(lParam); + mouse.y = HIWORD(lParam); + for (line = win->first_line; line; line = line->next) + { + for (part = &line->first_part; part; part = part->next) + { + if (part->link && + part->link->lpszString && + part->rect.left <= mouse.x && + part->rect.right >= mouse.x && + part->rect.top <= mouse.y + scroll_pos && + part->rect.bottom >= mouse.y + scroll_pos) + { + return part; + } + } + } + + return NULL; +} diff --git a/reactos/base/applications/winhelp/winhelp.h b/reactos/base/applications/winhelp/winhelp.h index 419880b5c5f..80d9a206dca 100644 --- a/reactos/base/applications/winhelp/winhelp.h +++ b/reactos/base/applications/winhelp/winhelp.h @@ -1,198 +1,198 @@ -/* - * Help Viewer - * - * Copyright 1996 Ulrich Schmid - * Copyright 2002 Sylvain Petreolle - * 2002 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINHELP_H__ -#define __WINHELP_H__ - -#define MAX_LANGUAGE_NUMBER 255 -#define MAX_STRING_LEN 255 - -#define INTERNAL_BORDER_WIDTH 5 -#define POPUP_YDISTANCE 20 -#define SHADOW_DX 10 -#define SHADOW_DY 10 -#define BUTTON_CX 6 -#define BUTTON_CY 6 - -#ifndef RC_INVOKED - -#include - -#include "hlpfile.h" -#include "windef.h" -#include "winbase.h" -#include "macro.h" -#include "winhelp_res.h" - -typedef struct tagHelpLinePart -{ - RECT rect; - enum {hlp_line_part_text, hlp_line_part_bitmap, hlp_line_part_metafile} cookie; - union - { - struct - { - LPCSTR lpsText; - HFONT hFont; - COLORREF color; - WORD wTextLen; - WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */ - } text; - struct - { - HBITMAP hBitmap; - } bitmap; - struct - { - HMETAFILE hMetaFile; - INT mm; - } metafile; - } u; - HLPFILE_LINK* link; - - struct tagHelpLinePart *next; -} WINHELP_LINE_PART; - -typedef struct tagHelpLine -{ - RECT rect; - WINHELP_LINE_PART first_part; - struct tagHelpLine* next; -} WINHELP_LINE; - -typedef struct tagHelpButton -{ - HWND hWnd; - - LPCSTR lpszID; - LPCSTR lpszName; - LPCSTR lpszMacro; - - WPARAM wParam; - - RECT rect; - - struct tagHelpButton*next; -} WINHELP_BUTTON; - -typedef struct tagWinHelp -{ - LPCSTR lpszName; - - WINHELP_BUTTON* first_button; - HLPFILE_PAGE* page; - WINHELP_LINE* first_line; - - HWND hMainWnd; - HWND hButtonBoxWnd; - HWND hTextWnd; - HWND hShadowWnd; - HWND hHistoryWnd; - - HFONT* fonts; - UINT fonts_len; - - HCURSOR hArrowCur; - HCURSOR hHandCur; - - HBRUSH hBrush; - - HLPFILE_WINDOWINFO* info; - - /* FIXME: for now it's a fixed size */ - HLPFILE_PAGE* history[40]; - unsigned histIndex; - HLPFILE_PAGE* back[40]; - unsigned backIndex; - - struct tagWinHelp* next; -} WINHELP_WINDOW; - -#define DC_NOMSG 0x00000000 -#define DC_MINMAX 0x00000001 -#define DC_INITTERM 0x00000002 -#define DC_JUMP 0x00000004 -#define DC_ACTIVATE 0x00000008 -#define DC_CALLBACKS 0x00000010 - -#define DW_NOTUSED 0 -#define DW_WHATMSG 1 -#define DW_MINMAX 2 -#define DW_SIZE 3 -#define DW_INIT 4 -#define DW_TERM 5 -#define DW_STARTJUMP 6 -#define DW_ENDJUMP 7 -#define DW_CHGFILE 8 -#define DW_ACTIVATE 9 -#define DW_CALLBACKS 10 - -typedef long (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG, LONG); - -typedef struct tagDll -{ - HANDLE hLib; - const char* name; - WINHELP_LDLLHandler handler; - DWORD class; - struct tagDll* next; -} WINHELP_DLL; - -typedef struct -{ - UINT wVersion; - HANDLE hInstance; - HWND hPopupWnd; - UINT wStringTableOffset; - BOOL isBook; - WINHELP_WINDOW* active_win; - WINHELP_WINDOW* win_list; - WNDPROC button_proc; - WINHELP_DLL* dlls; -} WINHELP_GLOBALS; - -extern WINHELP_GLOBALS Globals; -extern FARPROC Callbacks[]; - -BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); -BOOL WINHELP_CreateHelpWindowByMap(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); -BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int); -BOOL WINHELP_GetOpenFileName(LPSTR, int); -INT WINHELP_MessageBoxIDS(UINT, UINT, WORD); -INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD); -HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); -HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name); - -extern const char MAIN_WIN_CLASS_NAME[]; -extern const char BUTTON_BOX_WIN_CLASS_NAME[]; -extern const char TEXT_WIN_CLASS_NAME[]; -extern const char SHADOW_WIN_CLASS_NAME[]; -extern const char HISTORY_WIN_CLASS_NAME[]; -extern const char STRING_BUTTON[]; -extern const char STRING_MENU_Xx[]; -extern const char STRING_DIALOG_TEST[]; -#endif - -/* Buttons */ -#define WH_FIRST_BUTTON 500 - -#endif /* __WINHELP_H__ */ +/* + * Help Viewer + * + * Copyright 1996 Ulrich Schmid + * Copyright 2002 Sylvain Petreolle + * 2002 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINHELP_H__ +#define __WINHELP_H__ + +#define MAX_LANGUAGE_NUMBER 255 +#define MAX_STRING_LEN 255 + +#define INTERNAL_BORDER_WIDTH 5 +#define POPUP_YDISTANCE 20 +#define SHADOW_DX 10 +#define SHADOW_DY 10 +#define BUTTON_CX 6 +#define BUTTON_CY 6 + +#ifndef RC_INVOKED + +#include + +#include "hlpfile.h" +#include "windef.h" +#include "winbase.h" +#include "macro.h" +#include "winhelp_res.h" + +typedef struct tagHelpLinePart +{ + RECT rect; + enum {hlp_line_part_text, hlp_line_part_bitmap, hlp_line_part_metafile} cookie; + union + { + struct + { + LPCSTR lpsText; + HFONT hFont; + COLORREF color; + WORD wTextLen; + WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */ + } text; + struct + { + HBITMAP hBitmap; + } bitmap; + struct + { + HMETAFILE hMetaFile; + INT mm; + } metafile; + } u; + HLPFILE_LINK* link; + + struct tagHelpLinePart *next; +} WINHELP_LINE_PART; + +typedef struct tagHelpLine +{ + RECT rect; + WINHELP_LINE_PART first_part; + struct tagHelpLine* next; +} WINHELP_LINE; + +typedef struct tagHelpButton +{ + HWND hWnd; + + LPCSTR lpszID; + LPCSTR lpszName; + LPCSTR lpszMacro; + + WPARAM wParam; + + RECT rect; + + struct tagHelpButton*next; +} WINHELP_BUTTON; + +typedef struct tagWinHelp +{ + LPCSTR lpszName; + + WINHELP_BUTTON* first_button; + HLPFILE_PAGE* page; + WINHELP_LINE* first_line; + + HWND hMainWnd; + HWND hButtonBoxWnd; + HWND hTextWnd; + HWND hShadowWnd; + HWND hHistoryWnd; + + HFONT* fonts; + UINT fonts_len; + + HCURSOR hArrowCur; + HCURSOR hHandCur; + + HBRUSH hBrush; + + HLPFILE_WINDOWINFO* info; + + /* FIXME: for now it's a fixed size */ + HLPFILE_PAGE* history[40]; + unsigned histIndex; + HLPFILE_PAGE* back[40]; + unsigned backIndex; + + struct tagWinHelp* next; +} WINHELP_WINDOW; + +#define DC_NOMSG 0x00000000 +#define DC_MINMAX 0x00000001 +#define DC_INITTERM 0x00000002 +#define DC_JUMP 0x00000004 +#define DC_ACTIVATE 0x00000008 +#define DC_CALLBACKS 0x00000010 + +#define DW_NOTUSED 0 +#define DW_WHATMSG 1 +#define DW_MINMAX 2 +#define DW_SIZE 3 +#define DW_INIT 4 +#define DW_TERM 5 +#define DW_STARTJUMP 6 +#define DW_ENDJUMP 7 +#define DW_CHGFILE 8 +#define DW_ACTIVATE 9 +#define DW_CALLBACKS 10 + +typedef long (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG, LONG); + +typedef struct tagDll +{ + HANDLE hLib; + const char* name; + WINHELP_LDLLHandler handler; + DWORD class; + struct tagDll* next; +} WINHELP_DLL; + +typedef struct +{ + UINT wVersion; + HANDLE hInstance; + HWND hPopupWnd; + UINT wStringTableOffset; + BOOL isBook; + WINHELP_WINDOW* active_win; + WINHELP_WINDOW* win_list; + WNDPROC button_proc; + WINHELP_DLL* dlls; +} WINHELP_GLOBALS; + +extern WINHELP_GLOBALS Globals; +extern FARPROC Callbacks[]; + +BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); +BOOL WINHELP_CreateHelpWindowByMap(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int); +BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int); +BOOL WINHELP_GetOpenFileName(LPSTR, int); +INT WINHELP_MessageBoxIDS(UINT, UINT, WORD); +INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD); +HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile); +HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name); + +extern const char MAIN_WIN_CLASS_NAME[]; +extern const char BUTTON_BOX_WIN_CLASS_NAME[]; +extern const char TEXT_WIN_CLASS_NAME[]; +extern const char SHADOW_WIN_CLASS_NAME[]; +extern const char HISTORY_WIN_CLASS_NAME[]; +extern const char STRING_BUTTON[]; +extern const char STRING_MENU_Xx[]; +extern const char STRING_DIALOG_TEST[]; +#endif + +/* Buttons */ +#define WH_FIRST_BUTTON 500 + +#endif /* __WINHELP_H__ */ diff --git a/reactos/base/applications/winhelp/winhelp_res.h b/reactos/base/applications/winhelp/winhelp_res.h index a6e46f1f127..8ef27fa1a84 100644 --- a/reactos/base/applications/winhelp/winhelp_res.h +++ b/reactos/base/applications/winhelp/winhelp_res.h @@ -1,32 +1,32 @@ -#define MNID_FILE_OPEN 0x101 -#define MNID_FILE_PRINT 0x104 -#define MNID_FILE_SETUP 0x106 -#define MNID_FILE_EXIT 0x108 - -#define MNID_EDIT_COPYDLG 0x111 -#define MNID_EDIT_ANNOTATE 0x112 - -#define MNID_BKMK_DEFINE 0x121 - -#define MNID_HELP_HELPON 0x131 -#define MNID_HELP_HELPTOP 0x132 -#define MNID_HELP_ABOUT 0x141 -#define MNID_HELP_WINE 0x142 - -#define MAIN_MENU 0x10F - -#define STID_WINE_HELP 0x120 -#define STID_WHERROR 0x121 -#define STID_WARNING 0x122 -#define STID_INFO 0x123 -#define STID_NOT_IMPLEMENTED 0x124 -#define STID_HLPFILE_ERROR_s 0x125 -#define STID_CONTENTS 0x126 -#define STID_SEARCH 0x127 -#define STID_BACK 0x128 -#define STID_HISTORY 0x129 -#define STID_TOPICS 0x12A -#define STID_ALL_FILES 0x12B -#define STID_HELP_FILES_HLP 0x12C -#define STID_DIALOG_TEST 0x12D -#define STID_FILE_NOT_FOUND_s 0x12E +#define MNID_FILE_OPEN 0x101 +#define MNID_FILE_PRINT 0x104 +#define MNID_FILE_SETUP 0x106 +#define MNID_FILE_EXIT 0x108 + +#define MNID_EDIT_COPYDLG 0x111 +#define MNID_EDIT_ANNOTATE 0x112 + +#define MNID_BKMK_DEFINE 0x121 + +#define MNID_HELP_HELPON 0x131 +#define MNID_HELP_HELPTOP 0x132 +#define MNID_HELP_ABOUT 0x141 +#define MNID_HELP_WINE 0x142 + +#define MAIN_MENU 0x10F + +#define STID_WINE_HELP 0x120 +#define STID_WHERROR 0x121 +#define STID_WARNING 0x122 +#define STID_INFO 0x123 +#define STID_NOT_IMPLEMENTED 0x124 +#define STID_HLPFILE_ERROR_s 0x125 +#define STID_CONTENTS 0x126 +#define STID_SEARCH 0x127 +#define STID_BACK 0x128 +#define STID_HISTORY 0x129 +#define STID_TOPICS 0x12A +#define STID_ALL_FILES 0x12B +#define STID_HELP_FILES_HLP 0x12C +#define STID_DIALOG_TEST 0x12D +#define STID_FILE_NOT_FOUND_s 0x12E diff --git a/reactos/base/applications/wordpad/De.rc b/reactos/base/applications/wordpad/De.rc index 1b333fd4f4d..21d9cd8a74e 100644 --- a/reactos/base/applications/wordpad/De.rc +++ b/reactos/base/applications/wordpad/De.rc @@ -18,7 +18,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&Datei" BEGIN diff --git a/reactos/base/applications/wordpad/En.rc b/reactos/base/applications/wordpad/En.rc index e0724fb7fcf..5edadd27a3e 100644 --- a/reactos/base/applications/wordpad/En.rc +++ b/reactos/base/applications/wordpad/En.rc @@ -18,7 +18,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&File" BEGIN diff --git a/reactos/base/applications/wordpad/Fr.rc b/reactos/base/applications/wordpad/Fr.rc index dcf80ecfeea..a09f1be61c5 100644 --- a/reactos/base/applications/wordpad/Fr.rc +++ b/reactos/base/applications/wordpad/Fr.rc @@ -18,7 +18,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&Fichier" BEGIN diff --git a/reactos/base/applications/wordpad/Hu.rc b/reactos/base/applications/wordpad/Hu.rc index feca301d8c9..dd446f10bb9 100644 --- a/reactos/base/applications/wordpad/Hu.rc +++ b/reactos/base/applications/wordpad/Hu.rc @@ -18,7 +18,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&Fájl" BEGIN diff --git a/reactos/base/applications/wordpad/Ko.rc b/reactos/base/applications/wordpad/Ko.rc index 7ec919ee3b1..e9b4292f432 100644 --- a/reactos/base/applications/wordpad/Ko.rc +++ b/reactos/base/applications/wordpad/Ko.rc @@ -19,7 +19,7 @@ LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "ÆÄÀÏ(&F)" BEGIN diff --git a/reactos/base/applications/wordpad/Nl.rc b/reactos/base/applications/wordpad/Nl.rc index d6c5346b11b..85725b80eb0 100644 --- a/reactos/base/applications/wordpad/Nl.rc +++ b/reactos/base/applications/wordpad/Nl.rc @@ -18,7 +18,7 @@ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&Bestand" BEGIN diff --git a/reactos/base/applications/wordpad/No.rc b/reactos/base/applications/wordpad/No.rc index 3bebdf9e7b0..fe6971f87c5 100644 --- a/reactos/base/applications/wordpad/No.rc +++ b/reactos/base/applications/wordpad/No.rc @@ -18,7 +18,7 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&Fil" BEGIN diff --git a/reactos/base/applications/wordpad/Ru.rc b/reactos/base/applications/wordpad/Ru.rc index 17828cc3900..6d8cbdf5d29 100644 --- a/reactos/base/applications/wordpad/Ru.rc +++ b/reactos/base/applications/wordpad/Ru.rc @@ -18,7 +18,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN diff --git a/reactos/base/applications/wordpad/Tr.rc b/reactos/base/applications/wordpad/Tr.rc index 65cb31f9b2e..2f854468035 100644 --- a/reactos/base/applications/wordpad/Tr.rc +++ b/reactos/base/applications/wordpad/Tr.rc @@ -20,7 +20,7 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT -MAINMENU MENU DISCARDABLE +MAINMENU MENU DISCARDABLE BEGIN POPUP "&Dosya" BEGIN diff --git a/reactos/base/applications/wordpad/rsrc.rc b/reactos/base/applications/wordpad/rsrc.rc index 37ffae76e69..035c27c99f3 100644 --- a/reactos/base/applications/wordpad/rsrc.rc +++ b/reactos/base/applications/wordpad/rsrc.rc @@ -26,23 +26,23 @@ MAINACCELTABLE ACCELERATORS BEGIN "1", ID_BACK_1, VIRTKEY, CONTROL "2", ID_BACK_2, VIRTKEY, CONTROL - "L", ID_ALIGN_LEFT, VIRTKEY, CONTROL - "E", ID_ALIGN_CENTER, VIRTKEY, CONTROL - "R", ID_ALIGN_RIGHT, VIRTKEY, CONTROL + "L", ID_ALIGN_LEFT, VIRTKEY, CONTROL + "E", ID_ALIGN_CENTER, VIRTKEY, CONTROL + "R", ID_ALIGN_RIGHT, VIRTKEY, CONTROL "F", ID_FIND, VIRTKEY, CONTROL VK_F3, ID_FIND_NEXT, VIRTKEY "H", ID_REPLACE, VIRTKEY, CONTROL - "A", ID_EDIT_SELECTALL, VIRTKEY, CONTROL - "X", ID_EDIT_CUT, VIRTKEY, CONTROL - "C", ID_EDIT_COPY, VIRTKEY, CONTROL - "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL - "Y", ID_EDIT_REDO, VIRTKEY, CONTROL - "B", ID_FORMAT_BOLD, VIRTKEY, CONTROL - "I", ID_FORMAT_ITALIC, VIRTKEY, CONTROL + "A", ID_EDIT_SELECTALL, VIRTKEY, CONTROL + "X", ID_EDIT_CUT, VIRTKEY, CONTROL + "C", ID_EDIT_COPY, VIRTKEY, CONTROL + "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL + "Y", ID_EDIT_REDO, VIRTKEY, CONTROL + "B", ID_FORMAT_BOLD, VIRTKEY, CONTROL + "I", ID_FORMAT_ITALIC, VIRTKEY, CONTROL "U", ID_FORMAT_UNDERLINE,VIRTKEY, CONTROL - "N", ID_FILE_NEW, VIRTKEY, CONTROL - "O", ID_FILE_OPEN, VIRTKEY, CONTROL - "S", ID_FILE_SAVE, VIRTKEY, CONTROL + "N", ID_FILE_NEW, VIRTKEY, CONTROL + "O", ID_FILE_OPEN, VIRTKEY, CONTROL + "S", ID_FILE_SAVE, VIRTKEY, CONTROL "P", ID_PRINT, VIRTKEY, CONTROL END diff --git a/reactos/base/services/audiosrv/pnp.c b/reactos/base/services/audiosrv/pnp.c index 774dfdd5b6d..f087058d7d0 100644 --- a/reactos/base/services/audiosrv/pnp.c +++ b/reactos/base/services/audiosrv/pnp.c @@ -61,7 +61,7 @@ ProcessExistingDevices() 0, length); - while ( + while ( SetupDiEnumDeviceInterfaces(dev_info, NULL, &category_guid, diff --git a/reactos/base/services/dhcp/pipe.c b/reactos/base/services/dhcp/pipe.c index 3e1764ca3f1..026343b9086 100644 --- a/reactos/base/services/dhcp/pipe.c +++ b/reactos/base/services/dhcp/pipe.c @@ -84,7 +84,7 @@ DWORD WINAPI PipeThreadProc( LPVOID Parameter ) { } DisconnectNamedPipe( CommPipe ); } - + return TRUE; } diff --git a/reactos/base/services/dhcp/util.c b/reactos/base/services/dhcp/util.c index 7c4c6b37729..3075fb8d0e5 100644 --- a/reactos/base/services/dhcp/util.c +++ b/reactos/base/services/dhcp/util.c @@ -105,13 +105,13 @@ int read_client_conf(void) { if ((ifi!= NULL) && (ifi->client->config != NULL)) config = ifi->client->config; - else + else { warn("util.c read_client_conf poorly implemented!"); return 0; } - - + + GetComputerName(ComputerName, & ComputerNameSize); /* This never gets freed since it's only called once */ lpCompName = diff --git a/reactos/base/services/eventlog/eventlog.h b/reactos/base/services/eventlog/eventlog.h index 800cf7eba5a..532fe214c5d 100644 --- a/reactos/base/services/eventlog/eventlog.h +++ b/reactos/base/services/eventlog/eventlog.h @@ -36,7 +36,7 @@ typedef struct _IO_ERROR_LPC */ #define LOGFILE_SIGNATURE 0x654c664c -/* +/* * FIXME * Flags used in logfile header */ diff --git a/reactos/base/services/eventlog/logport.c b/reactos/base/services/eventlog/logport.c index c3e75ef6191..dd3afc03871 100644 --- a/reactos/base/services/eventlog/logport.c +++ b/reactos/base/services/eventlog/logport.c @@ -4,7 +4,7 @@ * FILE: services/eventlog/logport.c * PURPOSE: Event logging service * COPYRIGHT: Copyright 2002 Eric Kohl - * Copyright 2005 Saveliy Tretiakov + * Copyright 2005 Saveliy Tretiakov */ /* INCLUDES *****************************************************************/ diff --git a/reactos/base/services/eventlog/rpc.c b/reactos/base/services/eventlog/rpc.c index cd0604acbb0..b2d2b012e93 100644 --- a/reactos/base/services/eventlog/rpc.c +++ b/reactos/base/services/eventlog/rpc.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: services/eventlog/rpc.c * PURPOSE: Event logging service - * COPYRIGHT: Copyright 2005 Saveliy Tretiakov + * COPYRIGHT: Copyright 2005 Saveliy Tretiakov */ /* INCLUDES *****************************************************************/ diff --git a/reactos/base/services/rpcss/endpoint.c b/reactos/base/services/rpcss/endpoint.c index f4053194b2a..f7e207eab5f 100644 --- a/reactos/base/services/rpcss/endpoint.c +++ b/reactos/base/services/rpcss/endpoint.c @@ -1,4 +1,4 @@ -/* +/* * PROJECT: ReactOS RpcSs service * LICENSE: GPL - See COPYING in the top level directory * FILE: services/rpcss/rpcss.c diff --git a/reactos/base/services/rpcss/rpcss.c b/reactos/base/services/rpcss/rpcss.c index e1af5adc415..d1cd3c1960f 100644 --- a/reactos/base/services/rpcss/rpcss.c +++ b/reactos/base/services/rpcss/rpcss.c @@ -1,4 +1,4 @@ -/* +/* * PROJECT: ReactOS RpcSs service * LICENSE: GPL - See COPYING in the top level directory * FILE: services/rpcss/rpcss.c diff --git a/reactos/base/services/tcpsvcs/tcpsvcs.c b/reactos/base/services/tcpsvcs/tcpsvcs.c index 98f260c1ef6..19a31d5db64 100644 --- a/reactos/base/services/tcpsvcs/tcpsvcs.c +++ b/reactos/base/services/tcpsvcs/tcpsvcs.c @@ -67,7 +67,7 @@ LogEvent(LPCTSTR UserMessage, lpvSysMsg); } - else + else { _stprintf(MessageBuffer, _T("\n%s"), diff --git a/reactos/base/setup/reactos/lang/bg-BG.rc b/reactos/base/setup/reactos/lang/bg-BG.rc index 743730d69f0..4c0254376f5 100644 --- a/reactos/base/setup/reactos/lang/bg-BG.rc +++ b/reactos/base/setup/reactos/lang/bg-BG.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Ñëàãàíå íà ÐåàêòÎÑ" IDS_TEXT "Íå ìîæåòå íàïðàâî äà ñëîæèòå ÐåàêòÎÑ îò òîçè êîìïàêòåí äèñê!\n\nÏðåçàïóñíåòå êîìïþòúðà ñè ñ òîçè ÊÄ, çà äà ñëîæèòå ÐåàêòÎÑ." diff --git a/reactos/base/setup/reactos/lang/de-DE.rc b/reactos/base/setup/reactos/lang/de-DE.rc index c263e083a1f..7fd838eba19 100644 --- a/reactos/base/setup/reactos/lang/de-DE.rc +++ b/reactos/base/setup/reactos/lang/de-DE.rc @@ -4,7 +4,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "ReactOS Setup" IDS_TEXT "ReactOS kann nicht direkt von dieser CD installiert werden!\n\nBitte starten Sie Ihren Computer mit dieser CD um ReactOS zu installieren." diff --git a/reactos/base/setup/reactos/lang/en-US.rc b/reactos/base/setup/reactos/lang/en-US.rc index b9ae2edae21..180f36405a4 100644 --- a/reactos/base/setup/reactos/lang/en-US.rc +++ b/reactos/base/setup/reactos/lang/en-US.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "ReactOS Setup" IDS_TEXT "You cannot install ReactOS directly from this CD!\n\nPlease restart your computer from this CD in order to install ReactOS." diff --git a/reactos/base/setup/reactos/lang/es-ES.rc b/reactos/base/setup/reactos/lang/es-ES.rc index 3d725cda16e..6b433173e7e 100644 --- a/reactos/base/setup/reactos/lang/es-ES.rc +++ b/reactos/base/setup/reactos/lang/es-ES.rc @@ -4,7 +4,7 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Instalación de ReactOS" IDS_TEXT "¡No puedes instalar ReactOS directamente desde este CD!\n\nPor favor reinicia tu computadora desde este CD para proceder a instalar ReactOS." diff --git a/reactos/base/setup/reactos/lang/fi-FI.rc b/reactos/base/setup/reactos/lang/fi-FI.rc index da9c47c2252..d52236904d9 100644 --- a/reactos/base/setup/reactos/lang/fi-FI.rc +++ b/reactos/base/setup/reactos/lang/fi-FI.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "ReactOS Asennus" IDS_TEXT "Et voi asentaa ReactOS:ä suoraan tältä CDlevyltä!\n\nKäynnistä tietokoneesi tältä CD levyltä asentaaksesi ReactOS:ä." diff --git a/reactos/base/setup/reactos/lang/fr-FR.rc b/reactos/base/setup/reactos/lang/fr-FR.rc index ace1f2b41a9..77050b8a20b 100644 --- a/reactos/base/setup/reactos/lang/fr-FR.rc +++ b/reactos/base/setup/reactos/lang/fr-FR.rc @@ -4,7 +4,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Installation de ReactOS" IDS_TEXT "Vous ne pouvez pas installer ReactOS directement depuis ce CD!\n\nVeuillez redémarrer votre ordinateur depuis ce CD afin d'installer ReactOS." diff --git a/reactos/base/setup/reactos/lang/hu-HU.rc b/reactos/base/setup/reactos/lang/hu-HU.rc index eaeaa99afd5..14458c94f99 100644 --- a/reactos/base/setup/reactos/lang/hu-HU.rc +++ b/reactos/base/setup/reactos/lang/hu-HU.rc @@ -4,7 +4,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "ReactOS telepítõ" IDS_TEXT "Nem tudod feltelepíteni a ReactOS rendszert így!\n\nKérlek indítsd újra a számítógépet ezzel a CD-vel, hogy feltudjad telepíteni a ReactOS rendszert." diff --git a/reactos/base/setup/reactos/lang/id-ID.rc b/reactos/base/setup/reactos/lang/id-ID.rc index c4a573a270e..5b189bd741f 100644 --- a/reactos/base/setup/reactos/lang/id-ID.rc +++ b/reactos/base/setup/reactos/lang/id-ID.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Setup ReactOS" IDS_TEXT "Anda tidak bisa menginstalasi ReactOS secara langsung dari CD ini!\n\nSilahkan mulai lagi komputer anda dari CD ini agar bisa menginstalasi ReactOS." diff --git a/reactos/base/setup/reactos/lang/it-IT.rc b/reactos/base/setup/reactos/lang/it-IT.rc index 43020164523..75d7d61c819 100644 --- a/reactos/base/setup/reactos/lang/it-IT.rc +++ b/reactos/base/setup/reactos/lang/it-IT.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Installazione di ReactOS" IDS_TEXT "Non è possibile installare direttamente ReactOS da questo CD!\n\nPer installare ReactOS, riavvia il computer da questo CD." diff --git a/reactos/base/setup/reactos/lang/ja-JP.rc b/reactos/base/setup/reactos/lang/ja-JP.rc index 42780a865cd..81683599d7b 100644 --- a/reactos/base/setup/reactos/lang/ja-JP.rc +++ b/reactos/base/setup/reactos/lang/ja-JP.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "ReactOS ƒZƒbƒgƒAƒbƒv" IDS_TEXT "‚±‚Ì CD ‚©‚ç’¼Ú ReactOS ‚ðƒCƒ“ƒXƒg[ƒ‹‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ!\n\nReactOS ‚ðƒCƒ“ƒXƒg[ƒ‹‚·‚é‚É‚ÍAƒRƒ“ƒsƒ…[ƒ^‚ðˆê’UI—¹‚³‚¹A‚±‚Ì CD ‚©‚ç‹N“®‚³‚¹‚Ä‚­‚¾‚³‚¢B" diff --git a/reactos/base/setup/reactos/lang/lt-LT.rc b/reactos/base/setup/reactos/lang/lt-LT.rc index e868daeb792..78c6d50874c 100644 --- a/reactos/base/setup/reactos/lang/lt-LT.rc +++ b/reactos/base/setup/reactos/lang/lt-LT.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "ReactOS Ádiegimas" IDS_TEXT "Jûs negalite ádiegti ReactOS tiesiogiai ið ðio CD!\n\nNorëdami ádiegti ReactOS, praðome perkrauti Jûsø kompiuterá su ðiuo CD." diff --git a/reactos/base/setup/reactos/lang/pl-PL.rc b/reactos/base/setup/reactos/lang/pl-PL.rc index e0f3480e046..474e712065a 100644 --- a/reactos/base/setup/reactos/lang/pl-PL.rc +++ b/reactos/base/setup/reactos/lang/pl-PL.rc @@ -1,14 +1,14 @@ -/* +/* * translation by xrogers - * xxrogers@users.sourceforge.net + * xxrogers@users.sourceforge.net * https://sourceforge.net/projects/reactospl * http://rogers.cyberdusk.pl/ - */ + */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Instalator ReactOS" IDS_TEXT "Nie mo¿esz zainstalowaæ ReactOS bezpoœrednio z tego CD!\n\nProszê zrestartowaæ komputer i uruchomiæ z tego CD, aby zainstalowaæ ReactOS." diff --git a/reactos/base/setup/reactos/lang/pt-BR.rc b/reactos/base/setup/reactos/lang/pt-BR.rc index 927ad1d1230..c5f1cc6ef41 100644 --- a/reactos/base/setup/reactos/lang/pt-BR.rc +++ b/reactos/base/setup/reactos/lang/pt-BR.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Instalação do ReactOS" IDS_TEXT "Você não pode instalar o ReactOS diretamento deste CD!\n\nPor favor reinicie seu computador a partir deste CD para instalar o ReactOS." diff --git a/reactos/base/setup/reactos/lang/ru-RU.rc b/reactos/base/setup/reactos/lang/ru-RU.rc index a51981dcafe..be7a7d71a04 100644 --- a/reactos/base/setup/reactos/lang/ru-RU.rc +++ b/reactos/base/setup/reactos/lang/ru-RU.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Óñòàíîâêà ReactOS" IDS_TEXT "Âû íå ìîæåòå óñòàíîâèòü ReactOS ñ äèñêà â äàííûé ìîìåíò!\n\nÏîæàëóéñòà, çàãðóçèòå êîìïüþòåð ñ ýòîãî äèñêà äëÿ óñòàíîâêè ReactOS." diff --git a/reactos/base/setup/reactos/lang/sv-SE.rc b/reactos/base/setup/reactos/lang/sv-SE.rc index 65e03ac501b..04388869872 100644 --- a/reactos/base/setup/reactos/lang/sv-SE.rc +++ b/reactos/base/setup/reactos/lang/sv-SE.rc @@ -17,11 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "ReactOS installation" IDS_TEXT "Du kan inte installera ReactOS direkt från den här CDn!\n\nStarta om datorn med hjälp av skivan för att installera ReactOS." diff --git a/reactos/base/setup/reactos/lang/th-TH.rc b/reactos/base/setup/reactos/lang/th-TH.rc index f619a1e5be6..bbb99d74bd5 100644 --- a/reactos/base/setup/reactos/lang/th-TH.rc +++ b/reactos/base/setup/reactos/lang/th-TH.rc @@ -20,7 +20,7 @@ LANGUAGE LANG_THAI, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "¡ÒõԴµÑé§ ReactOS" IDS_TEXT "¤Ø³äÁèÊÒÁÒöµÔ´µÑé§ ReactOS ¨Ò¡¡ÒÃÍèÒ¹á¼è¹«Õ´Õ¹Õéä´éâ´ÂµÃ§\n\n¡ÃسÒà»Ô´à¤Ã×èͧ¤ÍÁ¾ÔÇàµÍÃì¢Í§¤Ø³ãËÁèÍÕ¡¤ÃÑé§\n\n¾ÃéÍÁãÊèá¼è¹«Õ´ÕáÅéÇ·ÓµÒÁ¤ÓÊÑè§ã¹¡ÒõԴµÑé§ ReactOS" diff --git a/reactos/base/setup/reactos/lang/uk-UA.rc b/reactos/base/setup/reactos/lang/uk-UA.rc index a6217ee9c00..f3e6918adc5 100644 --- a/reactos/base/setup/reactos/lang/uk-UA.rc +++ b/reactos/base/setup/reactos/lang/uk-UA.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION "Âñòàíîâëåííÿ ReactOS" IDS_TEXT "Âè íå ìîæåòå âñòàíîâèòè ReactOS ïðÿìî ç öüîãî CD!\n\nÁóäü ëàñêà ïåðåçàïóñò³òü Âàø êîìï’þòåð ç öüîãî CD äëÿ òîãî, ùîá âñòàíîâèòè ReactOS." diff --git a/reactos/base/setup/reactos/lang/zh-CN.rc b/reactos/base/setup/reactos/lang/zh-CN.rc index d45a65c1229..50f7d7b2586 100644 --- a/reactos/base/setup/reactos/lang/zh-CN.rc +++ b/reactos/base/setup/reactos/lang/zh-CN.rc @@ -21,7 +21,7 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED /* String Tables */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_CAPTION " ReactOS °²×° " IDS_TEXT " ²»ÄÜÖ±½Ó´ÓÕâ¸ö CD °²×° ReactOS! \n\n ÇëÖØÐÂÆô¶¯ÄãµÄ¼ÆËã»úÑ¡Ôñ´Ó¹âÅÌÒýµ¼À´°²×° ReactOS¡£" diff --git a/reactos/base/setup/usetup/cabinet.c b/reactos/base/setup/usetup/cabinet.c index 82a04901f74..2b872f4c295 100644 --- a/reactos/base/setup/usetup/cabinet.c +++ b/reactos/base/setup/usetup/cabinet.c @@ -73,10 +73,10 @@ static PVOID CabinetReservedArea = NULL; void* __cdecl malloc(size_t _size) { size_t nSize = ROUND_SIZE(_size); - - if (nSize<_size) - return NULL; - + + if (nSize<_size) + return NULL; + return RtlAllocateHeap(ProcessHeap, HEAP_ZERO_MEMORY, nSize); } @@ -147,7 +147,7 @@ MSZipCodecUncompress(PVOID OutputBuffer, DPRINT("Bad MSZIP block header magic (0x%X)\n", Magic); return CS_BADSTREAM; } - + ZStream.next_in = (PUCHAR)((ULONG)InputBuffer + 2); ZStream.avail_in = *InputLength - 2; ZStream.next_out = (PUCHAR)OutputBuffer; @@ -213,12 +213,12 @@ void MSZipFree (voidpf opaque, voidpf address) static BOOL ConvertSystemTimeToFileTime( - CONST SYSTEMTIME * lpSystemTime, + CONST SYSTEMTIME * lpSystemTime, LPFILETIME lpFileTime) { TIME_FIELDS TimeFields; LARGE_INTEGER liTime; - + TimeFields.Year = lpSystemTime->wYear; TimeFields.Month = lpSystemTime->wMonth; TimeFields.Day = lpSystemTime->wDay; @@ -226,7 +226,7 @@ ConvertSystemTimeToFileTime( TimeFields.Minute = lpSystemTime->wMinute; TimeFields.Second = lpSystemTime->wSecond; TimeFields.Milliseconds = lpSystemTime->wMilliseconds; - + if (RtlTimeFieldsToTime(&TimeFields, &liTime)) { lpFileTime->dwLowDateTime = liTime.u.LowPart; @@ -246,21 +246,21 @@ ConvertDosDateTimeToFileTime( PDOSTIME pdtime = (PDOSTIME) &wFatTime; PDOSDATE pddate = (PDOSDATE) &wFatDate; SYSTEMTIME SystemTime; - + if (lpFileTime == NULL) return FALSE; - + SystemTime.wMilliseconds = 0; SystemTime.wSecond = pdtime->Second; SystemTime.wMinute = pdtime->Minute; SystemTime.wHour = pdtime->Hour; - + SystemTime.wDay = pddate->Day; SystemTime.wMonth = pddate->Month; SystemTime.wYear = 1980 + pddate->Year; - + ConvertSystemTimeToFileTime(&SystemTime,lpFileTime); - + return TRUE; } @@ -276,9 +276,9 @@ GetFileName(PWCHAR Path) */ { ULONG i, j; - + j = i = 0; - + while (Path [i++]) { if (Path[i - 1] == L'\\') j = i; @@ -297,10 +297,10 @@ RemoveFileName(PWCHAR Path) { PWCHAR FileName; DWORD i; - + i = 0; FileName = GetFileName(Path + i); - + if ((FileName != (Path + i)) && (FileName [-1] == L'\\')) FileName--; if ((FileName == (Path + i)) && (FileName [0] == L'\\')) @@ -381,7 +381,7 @@ CloseCabinet(VOID) NtClose( FileHandle ); FileBuffer = NULL; } - + return 0; } @@ -398,10 +398,10 @@ CabinetInitialize(VOID) FileOpen = FALSE; wcscpy(DestPath, L""); - + CodecId = CAB_CODEC_RAW; CodecSelected = TRUE; - + FolderUncompSize = 0; BytesLeftInBlock = 0; CabinetReserved = 0; @@ -436,7 +436,7 @@ CabinetNormalizePath(PWCHAR Path, { ULONG n; BOOL OK = TRUE; - + if ((n = wcslen(Path)) && (Path[n - 1] != L'\\') && (OK = ((n + 1) < Length))) @@ -509,7 +509,7 @@ CabinetOpen(VOID) PUCHAR Buffer; UNICODE_STRING ustring; ANSI_STRING astring; - + if (!FileOpen) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -517,7 +517,7 @@ CabinetOpen(VOID) UNICODE_STRING FileName; NTSTATUS NtStatus; ULONG Size; - + RtlInitUnicodeString(&FileName, CabinetName); @@ -571,7 +571,7 @@ CabinetOpen(VOID) } DPRINT( "Cabinet file %S opened and mapped to %x\n", CabinetName, FileBuffer ); PCABHeader = (PCFHEADER)FileBuffer; - + /* Check header */ if(FileSize <= sizeof(CFHEADER) || PCABHeader->Signature != CAB_SIGNATURE || @@ -584,9 +584,9 @@ CabinetOpen(VOID) DPRINT("File has invalid header.\n"); return CAB_STATUS_INVALID_CAB; } - + Size = 0; - Buffer = (PUCHAR)(PCABHeader+1); + Buffer = (PUCHAR)(PCABHeader+1); /* Read/skip any reserved bytes */ if (PCABHeader->Flags & CAB_FLAG_RESERVE) { @@ -602,7 +602,7 @@ CabinetOpen(VOID) Buffer += CabinetReserved; } } - + if (PCABHeader->Flags & CAB_FLAG_HASPREV) { /* The previous cabinet file is in the same directory as the current */ @@ -629,7 +629,7 @@ CabinetOpen(VOID) wcscpy(CabinetPrev, L""); wcscpy(DiskPrev, L""); } - + if (PCABHeader->Flags & CAB_FLAG_HASNEXT) { /* The next cabinet file is in the same directory as the previous */ @@ -764,17 +764,17 @@ CabinetFindNext(PCAB_SEARCH Search) if (wcslen(DiskNext) > 0) { CloseCabinet(); - + CabinetSetCabinetName(CabinetNext); wcscpy( Search->Cabinet, CabinetName ); - + if (DiskChangeHandler != NULL) { DiskChangeHandler(CabinetNext, DiskNext); } - + Status = CabinetOpen(); - if (Status != CAB_STATUS_SUCCESS) + if (Status != CAB_STATUS_SUCCESS) return Status; } @@ -863,7 +863,7 @@ ULONG CabinetExtractFile( PCAB_SEARCH Search ) default: return CAB_STATUS_UNSUPPCOMP; } - + DPRINT("Extracting file at uncompressed offset (0x%X) Size (%d bytes)).\n", (UINT)Search->File->FileOffset, (UINT)Search->File->FileSize); @@ -979,7 +979,7 @@ ULONG CabinetExtractFile( PCAB_SEARCH Search ) else { memcpy(&FileBasic.LastAccessTime, &FileTime, sizeof(FILETIME)); - + NtStatus = NtSetInformationFile(DestFile, &IoStatusBlock, &FileBasic, @@ -992,7 +992,7 @@ ULONG CabinetExtractFile( PCAB_SEARCH Search ) } SetAttributesOnFile(Search->File, DestFile); - + /* Call extract event handler */ if (ExtractHandler != NULL) { @@ -1029,7 +1029,7 @@ ULONG CabinetExtractFile( PCAB_SEARCH Search ) InputLength = -RemainingBlock; // neg for resume decompression of the same block } // now CurrentBuffer points to the first comp byte of the file, so we can begin decompressing - + Size = Search->File->FileSize; // Size = remaining uncomp bytes of the file to decompress while(Size > 0) { diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index ed0974b3818..6331bf6294d 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -826,7 +826,7 @@ RepairIntroPage(PINPUT_RECORD Ir) CONSOLE_SetTextXY(6, 12, "The repair functions are not implemented yet."); CONSOLE_SetTextXY(8, 15, "\x07 Press U for Updating OS."); - + CONSOLE_SetTextXY(8, 17, "\x07 Press R for the Recovery Console."); CONSOLE_SetTextXY(8, 19, "\x07 Press ESC to return to the main page."); @@ -890,10 +890,10 @@ InstallIntroPage(PINPUT_RECORD Ir) if (RepairUpdateFlag) { - //return SELECT_PARTITION_PAGE; + //return SELECT_PARTITION_PAGE; return DEVICE_SETTINGS_PAGE; } - + if (IsUnattendedSetup) { return SELECT_PARTITION_PAGE; @@ -1041,12 +1041,12 @@ DeviceSettingsPage(PINPUT_RECORD Ir) CONSOLE_SetTextXY(6, 24, "and press ENTER."); CONSOLE_SetStatusText(" ENTER = Continue F3 = Quit"); - - if (RepairUpdateFlag) + + if (RepairUpdateFlag) { return SELECT_PARTITION_PAGE; } - + while(TRUE) { CONSOLE_ConInKey(Ir); @@ -2099,12 +2099,12 @@ SelectFileSystemPage (PINPUT_RECORD Ir) DrawFileSystemList (FileSystemList); CONSOLE_SetStatusText (" ENTER = Continue ESC = Cancel F3 = Quit"); - if (RepairUpdateFlag) + if (RepairUpdateFlag) { return (CHECK_FILE_SYSTEM_PAGE); //return SELECT_PARTITION_PAGE; } - + if (IsUnattendedSetup) { if (UnattendFormatPartition) @@ -3092,12 +3092,12 @@ RegistryPage(PINPUT_RECORD Ir) CONSOLE_SetTextXY(6, 8, "Setup is updating the system configuration"); CONSOLE_SetStatusText(" Creating registry hives..."); - - if (RepairUpdateFlag) + + if (RepairUpdateFlag) { return SUCCESS_PAGE; } - + if (!SetInstallPathValue(&DestinationPath)) { DPRINT("SetInstallPathValue() failed\n"); diff --git a/reactos/base/setup/usetup/native/utils/keytrans.c b/reactos/base/setup/usetup/native/utils/keytrans.c index 0ef8f36f658..4e1ad9389ff 100644 --- a/reactos/base/setup/usetup/native/utils/keytrans.c +++ b/reactos/base/setup/usetup/native/utils/keytrans.c @@ -119,8 +119,8 @@ static WORD KeyTableEnhanced[] = { /* * Note how the keyboard lights are not handled, so while NUMLOCK_ON can - * be on, the light will never be. If this starts to be a problem it can be - * fixed, but it's too much work for too little gain to do now. + * be on, the light will never be. If this starts to be a problem it can be + * fixed, but it's too much work for too little gain to do now. * Look in win32k/ntuser/input.c for an example. */ @@ -278,7 +278,7 @@ IntUpdateControlKeyState(LPDWORD State, PKEYBOARD_INPUT_DATA InputData) case 0x45: Value = NUMLOCK_ON; - if (!(InputData->Flags & KEY_BREAK)) + if (!(InputData->Flags & KEY_BREAK)) *State ^= Value; return; default: diff --git a/reactos/base/setup/usetup/partlist.h b/reactos/base/setup/usetup/partlist.h index 72fbe6cc8bc..0e605c09017 100644 --- a/reactos/base/setup/usetup/partlist.h +++ b/reactos/base/setup/usetup/partlist.h @@ -77,7 +77,7 @@ typedef struct _BIOSDISKENTRY BOOLEAN Recognized; CM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry; CM_INT13_DRIVE_PARAMETER Int13DiskData; -} BIOSDISKENTRY, *PBIOSDISKENTRY; +} BIOSDISKENTRY, *PBIOSDISKENTRY; typedef struct _DISKENTRY diff --git a/reactos/base/setup/usetup/progress.c b/reactos/base/setup/usetup/progress.c index 02c0a998e0c..acd6f8559a1 100644 --- a/reactos/base/setup/usetup/progress.c +++ b/reactos/base/setup/usetup/progress.c @@ -192,10 +192,10 @@ DrawProgressBar(PPROGRESSBAR Bar) /* Draw the progress bar border */ DrawBorder(Bar); - + /* Write Text Associated with Bar */ CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->Text); - + /* Draw the progress bar "border" border */ if (Bar->Double) { diff --git a/reactos/base/setup/usetup/progress.h b/reactos/base/setup/usetup/progress.h index 0d90f8969bd..7305573a92d 100644 --- a/reactos/base/setup/usetup/progress.h +++ b/reactos/base/setup/usetup/progress.h @@ -44,7 +44,7 @@ typedef struct _PROGRESS ULONG StepCount; ULONG CurrentStep; - + BOOLEAN Double; CHAR *Text; } PROGRESSBAR, *PPROGRESSBAR; diff --git a/reactos/base/setup/vmwinst/lang/es-ES.rc b/reactos/base/setup/vmwinst/lang/es-ES.rc index 57746c53b51..e4e005a0aa6 100644 --- a/reactos/base/setup/vmwinst/lang/es-ES.rc +++ b/reactos/base/setup/vmwinst/lang/es-ES.rc @@ -88,7 +88,7 @@ BEGIN LTEXT "El instalador de ReactOS va a proceder a desinstalar su controlador SVGA VMware(r)!!!\n\n\nHaga click en 'Finalizar' para desinstalar el controlador o 'Cancelar' para dejarlo como está.",-1,25,25,225,85 END -STRINGTABLE +STRINGTABLE BEGIN IDS_WIZARD_NAME "VMware(r) detectado" IDS_FAILEDTOLOCATEDRIVERS "El instalador de ReactOS no puede encontrar los archivos requeridos.\nPor favor asegúrese que el CD-ROM de VMware(r) tools está insertado." diff --git a/reactos/base/setup/welcome/lang/bg-BG.rc b/reactos/base/setup/welcome/lang/bg-BG.rc index 35ea8e8006a..3aebe380646 100644 --- a/reactos/base/setup/welcome/lang/bg-BG.rc +++ b/reactos/base/setup/welcome/lang/bg-BG.rc @@ -25,7 +25,7 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Äîáðå äîøëè" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/cs-CZ.rc b/reactos/base/setup/welcome/lang/cs-CZ.rc index dd2f659ed45..0ec843837bb 100644 --- a/reactos/base/setup/welcome/lang/cs-CZ.rc +++ b/reactos/base/setup/welcome/lang/cs-CZ.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Vítejte" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/da-DK.rc b/reactos/base/setup/welcome/lang/da-DK.rc index 5325dd1b2ce..a23c060ac33 100644 --- a/reactos/base/setup/welcome/lang/da-DK.rc +++ b/reactos/base/setup/welcome/lang/da-DK.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_DANISH, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Velkommen" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/de-DE.rc b/reactos/base/setup/welcome/lang/de-DE.rc index 38207c7db6f..4e96578839e 100644 --- a/reactos/base/setup/welcome/lang/de-DE.rc +++ b/reactos/base/setup/welcome/lang/de-DE.rc @@ -9,7 +9,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Willkommen" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/el-GR.rc b/reactos/base/setup/welcome/lang/el-GR.rc index bf7292176c2..ffd32fb1d3c 100644 --- a/reactos/base/setup/welcome/lang/el-GR.rc +++ b/reactos/base/setup/welcome/lang/el-GR.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Êáëþò ¹ëèáôå" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/en-US.rc b/reactos/base/setup/welcome/lang/en-US.rc index a10dda7fa09..201e3b916ff 100644 --- a/reactos/base/setup/welcome/lang/en-US.rc +++ b/reactos/base/setup/welcome/lang/en-US.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Welcome" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/es-ES.rc b/reactos/base/setup/welcome/lang/es-ES.rc index eb46e5586b1..96974e9eff6 100644 --- a/reactos/base/setup/welcome/lang/es-ES.rc +++ b/reactos/base/setup/welcome/lang/es-ES.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Bienvenido" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/fr-FR.rc b/reactos/base/setup/welcome/lang/fr-FR.rc index 18a89b29b9f..26bb41773fc 100644 --- a/reactos/base/setup/welcome/lang/fr-FR.rc +++ b/reactos/base/setup/welcome/lang/fr-FR.rc @@ -24,7 +24,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Bienvenue" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/hu-HU.rc b/reactos/base/setup/welcome/lang/hu-HU.rc index 6aea35df418..a3261c936fb 100644 --- a/reactos/base/setup/welcome/lang/hu-HU.rc +++ b/reactos/base/setup/welcome/lang/hu-HU.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Üdvözlünk" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/id-ID.rc b/reactos/base/setup/welcome/lang/id-ID.rc index e1493c0f978..b4eb29c71f9 100644 --- a/reactos/base/setup/welcome/lang/id-ID.rc +++ b/reactos/base/setup/welcome/lang/id-ID.rc @@ -7,7 +7,7 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Selamat Datang" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/it-IT.rc b/reactos/base/setup/welcome/lang/it-IT.rc index 6b1fbc050db..454839c4d35 100644 --- a/reactos/base/setup/welcome/lang/it-IT.rc +++ b/reactos/base/setup/welcome/lang/it-IT.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Benvenuto" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/ja-JP.rc b/reactos/base/setup/welcome/lang/ja-JP.rc index 3405fcfaae8..6b444948dc1 100644 --- a/reactos/base/setup/welcome/lang/ja-JP.rc +++ b/reactos/base/setup/welcome/lang/ja-JP.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Welcome" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/lt-LT.rc b/reactos/base/setup/welcome/lang/lt-LT.rc index 30c672dc7c9..5d13252d2ec 100644 --- a/reactos/base/setup/welcome/lang/lt-LT.rc +++ b/reactos/base/setup/welcome/lang/lt-LT.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Sveiki" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/nl-NL.rc b/reactos/base/setup/welcome/lang/nl-NL.rc index 30fa39901a7..1604a5ce578 100644 --- a/reactos/base/setup/welcome/lang/nl-NL.rc +++ b/reactos/base/setup/welcome/lang/nl-NL.rc @@ -3,7 +3,7 @@ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Welkom" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/pl-PL.rc b/reactos/base/setup/welcome/lang/pl-PL.rc index 5005535c82b..5bc8e174a10 100644 --- a/reactos/base/setup/welcome/lang/pl-PL.rc +++ b/reactos/base/setup/welcome/lang/pl-PL.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Zapraszamy" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/pt-BR.rc b/reactos/base/setup/welcome/lang/pt-BR.rc index 097f7724aaf..f610a5b12a9 100644 --- a/reactos/base/setup/welcome/lang/pt-BR.rc +++ b/reactos/base/setup/welcome/lang/pt-BR.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Bem vindo" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/ru-RU.rc b/reactos/base/setup/welcome/lang/ru-RU.rc index ba4fd24c4e2..42e114301d4 100644 --- a/reactos/base/setup/welcome/lang/ru-RU.rc +++ b/reactos/base/setup/welcome/lang/ru-RU.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Äîáðî ïîæàëîâàòü!" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/sk-SK.rc b/reactos/base/setup/welcome/lang/sk-SK.rc index 797f606f825..aa0687eebd7 100644 --- a/reactos/base/setup/welcome/lang/sk-SK.rc +++ b/reactos/base/setup/welcome/lang/sk-SK.rc @@ -5,7 +5,7 @@ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Vitajte" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/sv-SE.rc b/reactos/base/setup/welcome/lang/sv-SE.rc index ca1155e925b..9e64e4c31ed 100644 --- a/reactos/base/setup/welcome/lang/sv-SE.rc +++ b/reactos/base/setup/welcome/lang/sv-SE.rc @@ -23,7 +23,7 @@ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Välkommen" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/th-TH.rc b/reactos/base/setup/welcome/lang/th-TH.rc index 43b2d3cdf0d..ed77dff27e6 100644 --- a/reactos/base/setup/welcome/lang/th-TH.rc +++ b/reactos/base/setup/welcome/lang/th-TH.rc @@ -10,7 +10,7 @@ LANGUAGE LANG_THAI, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - ÂÔ¹´Õµé͹ÃѺ" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/uk-UA.rc b/reactos/base/setup/welcome/lang/uk-UA.rc index 2a4745850a4..f218f4940b5 100644 --- a/reactos/base/setup/welcome/lang/uk-UA.rc +++ b/reactos/base/setup/welcome/lang/uk-UA.rc @@ -23,7 +23,7 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - Ëàñêàâî ïðîñèìî" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/setup/welcome/lang/zh-CN.rc b/reactos/base/setup/welcome/lang/zh-CN.rc index 38d38b19117..69662b2db2f 100644 --- a/reactos/base/setup/welcome/lang/zh-CN.rc +++ b/reactos/base/setup/welcome/lang/zh-CN.rc @@ -23,7 +23,7 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED /* String Tables */ /* Default settings */ -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APPTITLE "ReactOS - »¶Ó­" IDS_DEFAULTTOPICTITLE "ReactOS" diff --git a/reactos/base/shell/cmd/alias.c b/reactos/base/shell/cmd/alias.c index d09c7a0485a..938128549a2 100644 --- a/reactos/base/shell/cmd/alias.c +++ b/reactos/base/shell/cmd/alias.c @@ -112,7 +112,7 @@ AddAlias (LPTSTR name, LPTSTR subst) { s = (LPTSTR)cmd_alloc ((_tcslen (subst) + 1)*sizeof(TCHAR)); if (!s) - { + { error_out_of_memory (); return; } diff --git a/reactos/base/shell/cmd/call.c b/reactos/base/shell/cmd/call.c index 975eac0da40..b246b127371 100644 --- a/reactos/base/shell/cmd/call.c +++ b/reactos/base/shell/cmd/call.c @@ -84,7 +84,7 @@ INT cmd_call (LPTSTR cmd, LPTSTR param) bc->Out[0] = _T('\0'); bc->Err[0] = _T('\0'); } - + /* Wasn't a batch file so remove conext */ if (bc->hBatchFile == INVALID_HANDLE_VALUE) diff --git a/reactos/base/shell/cmd/chcp.c b/reactos/base/shell/cmd/chcp.c index 6a853f0f92d..272a9816321 100644 --- a/reactos/base/shell/cmd/chcp.c +++ b/reactos/base/shell/cmd/chcp.c @@ -21,7 +21,7 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param) { TCHAR szMsg[RC_STRING_MAX_SIZE]; LPTSTR *arg; - INT args; + INT args; UINT uNewCodePage; /* print help */ @@ -30,7 +30,7 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param) ConOutResPaging(TRUE,STRING_CHCP_HELP); return 0; } - + nErrorLevel = 0; /* get parameters */ diff --git a/reactos/base/shell/cmd/choice.c b/reactos/base/shell/cmd/choice.c index 55a06003230..4cc7b818b47 100644 --- a/reactos/base/shell/cmd/choice.c +++ b/reactos/base/shell/cmd/choice.c @@ -227,7 +227,7 @@ CommandChoice (LPTSTR cmd, LPTSTR param) for (i = 1; (unsigned)i < _tcslen (lpOptions); i++) ConOutPrintf (_T(",%c"), lpOptions[i]); - + ConOutPrintf (_T("]?")); } @@ -248,7 +248,7 @@ CommandChoice (LPTSTR cmd, LPTSTR param) bCaseSensitive); if (val >= 0) - { + { ConOutPrintf (_T("%c\n"), lpOptions[val]); nErrorLevel = val + 1; diff --git a/reactos/base/shell/cmd/cmd.c b/reactos/base/shell/cmd/cmd.c index cdaa3f51bdf..0c4b2bd8efb 100644 --- a/reactos/base/shell/cmd/cmd.c +++ b/reactos/base/shell/cmd/cmd.c @@ -517,7 +517,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) NULL, &stui, &prci)) - + { if (IsConsoleProcess(prci.hProcess)) { @@ -650,7 +650,7 @@ DoCommand (LPTSTR line) */ /* Skip over whitespace to rest of line, exclude 'echo' command */ - if (_tcsicmp (com, _T("echo"))) + if (_tcsicmp (com, _T("echo"))) { while (_istspace (*rest)) rest++; @@ -1271,7 +1271,7 @@ GetParsedEnvVar ( LPCTSTR varName, UINT* varNameLen, BOOL ModeSetA ) if ( varNameLen ) *varNameLen = 2; return ret; - + case _T('*'): if(bc == NULL) { @@ -1509,21 +1509,21 @@ BOOL WINAPI BreakHandler (DWORD dwCtrlType) DWORD dwWritten; INPUT_RECORD rec; static BOOL SelfGenerated = FALSE; - + if ((dwCtrlType != CTRL_C_EVENT) && (dwCtrlType != CTRL_BREAK_EVENT)) { return FALSE; } else - { + { if(SelfGenerated) { SelfGenerated = FALSE; return TRUE; } } - + if (bChildProcessRunning == TRUE) { SelfGenerated = TRUE; @@ -1531,7 +1531,7 @@ BOOL WINAPI BreakHandler (DWORD dwCtrlType) return TRUE; } - + rec.EventType = KEY_EVENT; rec.Event.KeyEvent.bKeyDown = TRUE; rec.Event.KeyEvent.wRepeatCount = 1; @@ -1539,14 +1539,14 @@ BOOL WINAPI BreakHandler (DWORD dwCtrlType) rec.Event.KeyEvent.wVirtualScanCode = _T('C') - 35; rec.Event.KeyEvent.uChar.AsciiChar = _T('C'); rec.Event.KeyEvent.uChar.UnicodeChar = _T('C'); - rec.Event.KeyEvent.dwControlKeyState = RIGHT_CTRL_PRESSED; + rec.Event.KeyEvent.dwControlKeyState = RIGHT_CTRL_PRESSED; WriteConsoleInput( hIn, &rec, 1, &dwWritten); - + bCtrlBreak = TRUE; /* FIXME: Handle batch files */ diff --git a/reactos/base/shell/cmd/color.c b/reactos/base/shell/cmd/color.c index e3f00c95bf7..c624d22529a 100644 --- a/reactos/base/shell/cmd/color.c +++ b/reactos/base/shell/cmd/color.c @@ -82,22 +82,22 @@ INT CommandColor (LPTSTR first, LPTSTR rest) SetScreenColor (wColor, FALSE); return 0; } - - + + if ( _tcslen(&rest[0])==1) - { + { if ( (_tcscmp(&rest[0], _T("0")) >=0 ) && (_tcscmp(&rest[0], _T("9")) <=0 ) ) { SetConsoleTextAttribute (hConsole, (WORD)_ttoi(rest)); return 0; - } + } else if ( (_tcscmp(&rest[0], _T("a")) >=0 ) && (_tcscmp(&rest[0], _T("f")) <=0 ) ) - { + { SetConsoleTextAttribute (hConsole, (WORD) (rest[0] + 10 - _T('a')) ); return 0; } else if ( (_tcscmp(&rest[0], _T("A")) >=0 ) && (_tcscmp(&rest[0], _T("F")) <=0 ) ) - { + { SetConsoleTextAttribute (hConsole, (WORD) (rest[0] + 10 - _T('A')) ); return 0; } @@ -107,7 +107,7 @@ INT CommandColor (LPTSTR first, LPTSTR rest) } if (StringToColor(&wColor, &rest) == FALSE) - { + { ConErrResPuts(STRING_COLOR_ERROR2); nErrorLevel = 1; return 1; diff --git a/reactos/base/shell/cmd/console.c b/reactos/base/shell/cmd/console.c index e6677c0eb3e..f2d248d48c0 100644 --- a/reactos/base/shell/cmd/console.c +++ b/reactos/base/shell/cmd/console.c @@ -246,13 +246,13 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa static int LineCount = 0; /* used to see how big the screen is */ - int ScreenLines = 0; + int ScreenLines = 0; /* the number of chars in a roow */ - int ScreenCol = 0; + int ScreenCol = 0; /* chars since start of line */ - int CharSL = 0; + int CharSL = 0; int i = 0; @@ -275,7 +275,7 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa ScreenLines = (csbi.srWindow.Bottom - csbi.srWindow.Top) - 4; ScreenCol = (csbi.srWindow.Right - csbi.srWindow.Left) + 1; - //make sure they didnt make the screen to small + //make sure they didnt make the screen to small if(ScreenLines<4) { ConPrintf(szFormat, arg_ptr, nStdHandle); @@ -297,13 +297,13 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa CharSL++; WriteFile (GetStdHandle (nStdHandle),&pBuf[i-CharSL],sizeof(CHAR)*(CharSL+1),&dwWritten,NULL); - LineCount++; + LineCount++; CharSL=0; if(LineCount >= ScreenLines) { if(_strnicmp(&pBuf[i], "\n", 2)!=0) - WriteFile (GetStdHandle (nStdHandle),_T("\n"),sizeof(CHAR),&dwWritten,NULL); + WriteFile (GetStdHandle (nStdHandle),_T("\n"),sizeof(CHAR),&dwWritten,NULL); if(PagePrompt() != PROMPT_YES) { @@ -312,7 +312,7 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa #endif return 1; } - //reset the number of lines being printed + //reset the number of lines being printed LineCount = 0; CharSL=0; } diff --git a/reactos/base/shell/cmd/copy.c b/reactos/base/shell/cmd/copy.c index 1108bb8bacc..52ba9d8ec5c 100644 --- a/reactos/base/shell/cmd/copy.c +++ b/reactos/base/shell/cmd/copy.c @@ -30,11 +30,11 @@ * Add touch syntax. "copy arp.exe+,," * Copy command is now completed. */ - + #include - + #ifdef INCLUDE_CMD_COPY - + enum { COPY_ASCII = 0x001, /* /A */ @@ -47,11 +47,11 @@ enum COPY_BINARY = 0x100, /* /B */ }; -INT -copy (TCHAR source[MAX_PATH], - TCHAR dest[MAX_PATH], - INT append, - DWORD lpdwFlags, +INT +copy (TCHAR source[MAX_PATH], + TCHAR dest[MAX_PATH], + INT append, + DWORD lpdwFlags, BOOL bTouch) { TCHAR szMsg[RC_STRING_MAX_SIZE]; @@ -67,7 +67,7 @@ copy (TCHAR source[MAX_PATH], TCHAR TempSrc[MAX_PATH]; TCHAR * FileName; SYSTEMTIME CurrentTime; - + /* Check Breaker */ if(CheckCtrlBreak(BREAK_INPUT)) return 0; @@ -75,7 +75,7 @@ copy (TCHAR source[MAX_PATH], #ifdef _DEBUG DebugPrintf (_T("checking mode\n")); #endif - + if(bTouch) { hFileSrc = CreateFile (source, GENERIC_WRITE, FILE_SHARE_READ, @@ -105,7 +105,7 @@ copy (TCHAR source[MAX_PATH], } dwAttrib = GetFileAttributes (source); - + hFileSrc = CreateFile (source, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (hFileSrc == INVALID_HANDLE_VALUE) @@ -119,14 +119,14 @@ copy (TCHAR source[MAX_PATH], #ifdef _DEBUG DebugPrintf (_T("getting time\n")); #endif - + GetFileTime (hFileSrc, &srctime, NULL, NULL); - + #ifdef _DEBUG DebugPrintf (_T("copy: flags has %s\n"), lpdwFlags & COPY_ASCII ? "ASCII" : "BINARY"); #endif - + /* Check to see if /D or /Z are true, if so we need a middle man to copy the file too to allow us to use CopyFileEx later */ if(lpdwFlags & COPY_DECRYPT) @@ -177,47 +177,47 @@ copy (TCHAR source[MAX_PATH], { LoadString(CMD_ModuleHandle, STRING_COPY_ERROR2, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(szMsg, source); - + CloseHandle (hFileSrc); nErrorLevel = 1; return 0; } - + #ifdef _DEBUG DebugPrintf (_T("SetFileAttributes (%s, FILE_ATTRIBUTE_NORMAL);\n"), dest); #endif SetFileAttributes (dest, FILE_ATTRIBUTE_NORMAL); - + #ifdef _DEBUG DebugPrintf (_T("DeleteFile (%s);\n"), dest); #endif DeleteFile (dest); - + hFileDest = CreateFile (dest, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); } else { LONG lFilePosHigh = 0; - + if (!_tcscmp (dest, source)) { CloseHandle (hFileSrc); return 0; } - + #ifdef _DEBUG DebugPrintf (_T("opening/appending\n")); #endif SetFileAttributes (dest, FILE_ATTRIBUTE_NORMAL); - + hFileDest = CreateFile (dest, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - + /* Move to end of file to start writing */ SetFilePointer (hFileDest, 0, &lFilePosHigh,FILE_END); } - - + + if (hFileDest == INVALID_HANDLE_VALUE) { CloseHandle (hFileSrc); @@ -236,7 +236,7 @@ copy (TCHAR source[MAX_PATH], nErrorLevel = 1; return 0; } - + do { @@ -251,15 +251,15 @@ copy (TCHAR source[MAX_PATH], break; } } - + if (dwRead == 0) break; - + WriteFile (hFileDest, buffer, dwRead, &dwWritten, NULL); if (dwWritten != dwRead || CheckCtrlBreak(BREAK_INPUT)) { ConOutResPuts(STRING_COPY_ERROR3); - + cmd_free (buffer); CloseHandle (hFileDest); CloseHandle (hFileSrc); @@ -268,12 +268,12 @@ copy (TCHAR source[MAX_PATH], } } while (!bEof); - + #ifdef _DEBUG DebugPrintf (_T("setting time\n")); #endif SetFileTime (hFileDest, &srctime, NULL, NULL); - + if ((lpdwFlags & COPY_ASCII) && !bEof) { /* we're dealing with ASCII files! */ @@ -283,16 +283,16 @@ copy (TCHAR source[MAX_PATH], #endif WriteFile (hFileDest, buffer, sizeof(CHAR), &dwWritten, NULL); } - + VirtualFree (buffer, 0, MEM_RELEASE); CloseHandle (hFileDest); CloseHandle (hFileSrc); - + #ifdef _DEBUG DebugPrintf (_T("setting mode\n")); #endif SetFileAttributes (dest, dwAttrib); - + /* Now finish off the copy if needed with CopyFileEx */ if(lpdwFlags & COPY_RESTART) { @@ -300,7 +300,7 @@ copy (TCHAR source[MAX_PATH], { nErrorLevel = 1; DeleteFile(dest); - return 0; + return 0; } /* Take care of file in the temp folder */ DeleteFile(dest); @@ -312,8 +312,8 @@ copy (TCHAR source[MAX_PATH], return 1; } - - + + static INT CopyOverwrite (LPTSTR fn) { /*ask the user if they want to override*/ @@ -324,8 +324,8 @@ static INT CopyOverwrite (LPTSTR fn) res = FilePromptYNA (_T("")); return res; } - - + + INT cmd_copy (LPTSTR cmd, LPTSTR param) { TCHAR szMsg[RC_STRING_MAX_SIZE]; @@ -359,15 +359,15 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) int size; TCHAR * szTouch; BOOL bDone = FALSE; - - + + /*Show help/usage info*/ if (!_tcsncmp (param, _T("/?"), 2)) { ConOutResPaging(TRUE, STRING_COPY_HELP2); return 0; } - + nErrorLevel = 0; /* Get the envor value if it exists */ @@ -375,16 +375,16 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) if (evar==NULL) size = 0; else { - size = GetEnvironmentVariable (_T("COPYCMD"), evar, 512); + size = GetEnvironmentVariable (_T("COPYCMD"), evar, 512); } if (size > 512) { evar = cmd_realloc(evar,size * sizeof(TCHAR) ); if (evar!=NULL) - { + { size = GetEnvironmentVariable (_T("COPYCMD"), evar, size); } - else + else { size=0; } @@ -397,48 +397,48 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) /* scan and set the flags */ for (t=0;t= 3) if(_totupper(arg[i][2]) == _T('Y')) @@ -495,17 +495,17 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) dwFlags &= ~COPY_NO_PROMPT; dwFlags |= COPY_PROMPT; } - + break; - + case _T('Z'): dwFlags |= COPY_RESTART; break; - + default: /* invaild switch */ LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_SWITCH, szMsg, RC_STRING_MAX_SIZE); - ConOutPrintf(szMsg, _totupper(arg[i][1])); + ConOutPrintf(szMsg, _totupper(arg[i][1])); nErrorLevel = 1; return 1; break; @@ -528,15 +528,15 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) directly on source string later on */ _tcscat(arg[nSrc],arg[i]); nFiles--; - } + } else if(nDes == -1) { nDes = i; } - + } } - + /* keep quiet within batch files */ if (bc != NULL) { @@ -551,17 +551,17 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) freep (arg); return 1; } - + if(nFiles > 2) { /* there is too many file names in command */ LoadString(CMD_ModuleHandle, STRING_ERROR_TOO_MANY_PARAMETERS, szMsg, RC_STRING_MAX_SIZE); - ConErrPrintf(szMsg,_T("")); + ConErrPrintf(szMsg,_T("")); nErrorLevel = 1; freep (arg); return 1; } - + if(((_tcschr (arg[nSrc], _T('+')) != NULL) || (_tcschr (arg[nSrc], _T('*')) != NULL && _tcschr (arg[nDes], _T('*')) == NULL) || (IsExistingDirectory (arg[nSrc]) && (_tcschr (arg[nDes], _T('*')) == NULL && !IsExistingDirectory (arg[nDes]))) @@ -574,10 +574,10 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) if(_tcschr (arg[nSrc], _T('+')) != NULL) appendPointer = arg[nSrc]; } - + /* Reusing the number of files variable */ nFiles = 0; - + do { /* Set up the string that is the path to the destination */ @@ -590,16 +590,16 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) else /* If the user entered two file names then form the full string path*/ GetFullPathName (arg[nDes], MAX_PATH, szDestPath, NULL); - + } else { - /* If no destination was entered then just use + /* If no destination was entered then just use the current directory as the destination */ GetCurrentDirectory (MAX_PATH, szDestPath); } - - + + /* Get the full string of the path to the source file*/ if(_tcschr (arg[nSrc], _T('+')) != NULL) { @@ -610,7 +610,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) { if(!_tcsncmp (appendPointer,_T("+"),1) || !_tcsncmp (appendPointer,_T("\0"),1)) { - /* Now that the pointer is on the + we + /* Now that the pointer is on the + we need to go to the start of the next filename */ if(!_tcsncmp (appendPointer,_T("+"),1)) appendPointer++; @@ -619,24 +619,24 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) break; } - + _tcsncat(tmpName,appendPointer,1); appendPointer++; } /* Finish the string off with a null char */ _tcsncat(tmpName,_T("\0"),1); - + if(_tcschr (arg[nSrc], _T(',')) != NULL) { /* Only time there is a , in the source is when they are using touch - Cant have a destination and can only have on ,, at the end of the string + Cant have a destination and can only have on ,, at the end of the string Cant have more then one file name */ szTouch = _tcsstr (arg[nSrc], _T("+")); if(_tcsncmp (szTouch,_T("+,,\0"),4) || nDes != -1) { LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_PARAM_FORMAT, szMsg, RC_STRING_MAX_SIZE); - ConErrPrintf(szMsg,arg[nSrc]); + ConErrPrintf(szMsg,arg[nSrc]); nErrorLevel = 1; freep (arg); return 1; @@ -655,7 +655,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) } else /* Get the full path to first file in the string of file names */ - GetFullPathName (tmpName, MAX_PATH, szSrcPath, NULL); + GetFullPathName (tmpName, MAX_PATH, szSrcPath, NULL); } else { @@ -667,17 +667,17 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) else /* Get the full path of the source file */ GetFullPathName (arg[nSrc], MAX_PATH, szSrcPath, NULL); - + } - + /* From this point on, we can assume that the shortest path is 3 letters long and that would be [DriveLetter]:\ */ - + /* If there is no * in the path name and it is a folder then we will need to add a wildcard to the pathname so FindFirstFile comes up with all the files in that folder */ - if(_tcschr (szSrcPath, _T('*')) == NULL && + if(_tcschr (szSrcPath, _T('*')) == NULL && IsExistingDirectory (szSrcPath)) { /* If it doesnt have a \ at the end already then on needs to be added */ @@ -687,18 +687,18 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) _tcscat (szSrcPath, _T("*")); } /* Make sure there is an ending slash to the path if the dest is a folder */ - if(_tcschr (szDestPath, _T('*')) == NULL && + if(_tcschr (szDestPath, _T('*')) == NULL && IsExistingDirectory(szDestPath)) { if(szDestPath[_tcslen(szDestPath) - 1] != _T('\\')) _tcscat (szDestPath, _T("\\")); } - - + + /* Get a list of all the files */ hFile = FindFirstFile (szSrcPath, &findBuffer); - - + + /* We need to figure out what the name of the file in the is going to be */ if((szDestPath[_tcslen(szDestPath) - 1] == _T('*') && szDestPath[_tcslen(szDestPath) - 2] == _T('\\')) || szDestPath[_tcslen(szDestPath) - 1] == _T('\\')) @@ -714,20 +714,20 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) UseThisName++; _tcscpy(PreserveName,UseThisName); } - + /* Strip the paths back to the folder they are in */ for(i = (_tcslen(szSrcPath) - 1); i > -1; i--) if(szSrcPath[i] != _T('\\')) szSrcPath[i] = _T('\0'); else break; - + for(i = (_tcslen(szDestPath) - 1); i > -1; i--) if(szDestPath[i] != _T('\\')) szDestPath[i] = _T('\0'); else break; - + do { /* Check Breaker */ @@ -738,29 +738,29 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) } /* Set the override to yes each new file */ nOverwrite = 1; - + /* If it couldnt open the file handle, print out the error */ if(hFile == INVALID_HANDLE_VALUE) - { - ConOutFormatMessage (GetLastError(), szSrcPath); + { + ConOutFormatMessage (GetLastError(), szSrcPath); freep (arg); nErrorLevel = 1; return 1; } - + /* Ignore the . and .. files */ if(!_tcscmp (findBuffer.cFileName, _T(".")) || !_tcscmp (findBuffer.cFileName, _T(".."))|| findBuffer.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; - + /* Copy the base folder over to a tmp string */ _tcscpy(tmpDestPath,szDestPath); - + /* Can't put a file into a folder that isnt there */ if(!IsExistingDirectory(szDestPath)) { - ConOutFormatMessage (GetLastError (), szSrcPath); + ConOutFormatMessage (GetLastError (), szSrcPath); freep (arg); nErrorLevel = 1; return 1; @@ -819,10 +819,10 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) *r = 0; /* Add the filename to the tmp string path */ _tcscat (tmpDestPath, DoneFile); - + } } - + /* Build the string path to the source file */ _tcscpy(tmpSrcPath,szSrcPath); @@ -866,13 +866,13 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) /* print out the number of files copied */ LoadString(CMD_ModuleHandle, STRING_COPY_FILE, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(szMsg, nFiles); - - FindClose(hFile); - if (arg!=NULL) + + FindClose(hFile); + if (arg!=NULL) freep(arg); return 0; } - - + + #endif /* INCLUDE_CMD_COPY */ diff --git a/reactos/base/shell/cmd/date.c b/reactos/base/shell/cmd/date.c index b1dda4f30a1..9c00bddb126 100644 --- a/reactos/base/shell/cmd/date.c +++ b/reactos/base/shell/cmd/date.c @@ -194,7 +194,7 @@ INT cmd_date (LPTSTR cmd, LPTSTR param) ConOutResPaging(TRUE,STRING_DATE_HELP4); return 0; } - + nErrorLevel = 0; /* build parameter array */ @@ -246,21 +246,21 @@ INT cmd_date (LPTSTR cmd, LPTSTR param) { while (TRUE) /* forever loop */ { - TCHAR s[40]; + TCHAR s[40]; ConErrResPuts(STRING_DATE_ERROR); - - PrintDateString (); + + PrintDateString (); ConInString (s, 40); - + while (*s && s[_tcslen (s) - 1] < _T(' ')) s[_tcslen (s) - 1] = _T('\0'); if (ParseDate (s)) { freep (arg); return 0; - } + } } - } + } } freep (arg); diff --git a/reactos/base/shell/cmd/del.c b/reactos/base/shell/cmd/del.c index 28ef3f6069b..727ddfc27a7 100644 --- a/reactos/base/shell/cmd/del.c +++ b/reactos/base/shell/cmd/del.c @@ -38,7 +38,7 @@ * * 22-Jun-2005 (Brandon Turner ) * Implemented /A example "del /A:H /A:-R *.exe -ping.exe" -* +* * 07-Aug-2005 * Removed the exclusive deletion (see two comments above) because '-' is a valid file name character. * Optimized the recursive deletion in directories. @@ -104,13 +104,13 @@ static BOOL RemoveFile (LPTSTR lpFileName, DWORD dwFlags, WIN32_FIND_DATA* f) { /*This function is called by CommandDelete and - does the actual process of deleting the single + does the actual process of deleting the single file*/ if(CheckCtrlBreak(BREAK_INPUT)) return 1; /*check to see if it is read only and if this is done based on /A - if it is done by file name, access is denied. However, if it is done + if it is done by file name, access is denied. However, if it is done using the /A switch you must un-read only the file and allow it to be deleted*/ if((dwFlags & DEL_ATTRIBUTES) || (dwFlags & DEL_FORCE)) @@ -174,7 +174,7 @@ DeleteFiles(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags) _tcscpy(szFileName, FileName); - if(_tcschr (szFileName, _T('*')) == NULL && + if(_tcschr (szFileName, _T('*')) == NULL && IsExistingDirectory (szFileName)) { /* If it doesnt have a \ at the end already then on needs to be added */ @@ -282,7 +282,7 @@ DeleteFiles(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags) if(RemoveFile (szFullPath, *dwFlags, &f)) dwFiles++; else - { + { ErrorMessage (GetLastError(), _T("")); // FindClose(hFile); // return -1; @@ -295,7 +295,7 @@ DeleteFiles(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags) } -static DWORD +static DWORD ProcessDirectory(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags) { TCHAR szFullPath[MAX_PATH]; @@ -364,7 +364,7 @@ ProcessDirectory(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags) } } return dwFiles; -} +} @@ -463,7 +463,7 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param) } ch = _totupper (arg[i][3]); if (_tcslen (arg[i]) == 4) - { + { if(ch == _T('A')) { dwAttrFlags |= ATTR_ARCHIVE; @@ -545,7 +545,7 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param) dwFiles += ProcessDirectory(szOrginalArg, &dwFlags, dwAttrFlags); } - + freep (arg); /*Based on MS cmd, we only tell what files are being deleted when /S is used */ diff --git a/reactos/base/shell/cmd/dir.c b/reactos/base/shell/cmd/dir.c index bf673bf0f2f..f9d116d397d 100644 --- a/reactos/base/shell/cmd/dir.c +++ b/reactos/base/shell/cmd/dir.c @@ -220,7 +220,7 @@ static ULARGE_INTEGER recurse_bytes; * displays help screen for dir * Rob Lake */ -static VOID +static VOID DirHelp(VOID) { ConOutResPaging(TRUE, STRING_DIR_HELP1); @@ -233,7 +233,7 @@ DirHelp(VOID) * * Parse the parameters and switches of the command line and exports them */ -static BOOL +static BOOL DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */ LPTSTR** params, /* [OUT] The parameters after parsing */ LPINT entries, /* [OUT] The number of parameters after parsing */ @@ -270,7 +270,7 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */ lpFlags->stOrderBy.bParSetted = TRUE; lpFlags->stTimeField.bParSetted = TRUE; - + /* Main Loop (see README_DIR.txt) */ /* scan the command line char per char, and we process its char */ while (*Line) @@ -363,7 +363,7 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */ { cCurSwitch = _T(' '); if(ptrStart && ptrEnd) - { + { temp = cmd_alloc(((ptrEnd - ptrStart) + 2) * sizeof (TCHAR)); if(!temp) return FALSE; @@ -395,7 +395,7 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */ { /* Process a character for parameter */ if ((cCurSwitch == _T(' ')) && ptrStart && ptrEnd) - { + { temp = cmd_alloc(((ptrEnd - ptrStart) + 2) * sizeof (TCHAR)); if(!temp) return FALSE; @@ -666,7 +666,7 @@ PrintDirectoryHeader(LPTSTR szPath, LPDIRSWITCHFLAGS lpFlags) ConOutPrintfPaging(TRUE,szMsg, szRootName[0], szVolName); else ConOutPrintf(szMsg, szRootName[0], szVolName); - + } else { @@ -886,7 +886,7 @@ PrintSummary(LPTSTR szPath, return 0; /* Print recursive specific results */ - + /* Take this code offline to fix /S does not print duoble info */ if (TotalSummary && lpFlags->bRecursive) { @@ -942,7 +942,7 @@ TCHAR* getExt(const TCHAR* file) * * Get the name of the file without extension */ -static LPTSTR +static LPTSTR getName(const TCHAR* file, TCHAR * dest) { int iLen; @@ -1679,7 +1679,7 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */ cmd_free(ptrStartNode); ptrStartNode = ptrNextNode; dwCount --; - } + } return 1; } @@ -1794,7 +1794,7 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */ * * internal dir command */ -INT +INT CommandDir(LPTSTR first, LPTSTR rest) { TCHAR dircmd[256]; /* A variable to store the DIRCMD enviroment variable */ diff --git a/reactos/base/shell/cmd/filecomp.c b/reactos/base/shell/cmd/filecomp.c index 049d69c92fd..5e64e1447ca 100644 --- a/reactos/base/shell/cmd/filecomp.c +++ b/reactos/base/shell/cmd/filecomp.c @@ -358,7 +358,7 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix) /* String that is to be examined */ TCHAR str[MAX_PATH]; /* temp pointers to used to find needed parts */ - TCHAR * szSearch; + TCHAR * szSearch; TCHAR * szSearch1; TCHAR * szSearch2; TCHAR * szSearch3; @@ -372,7 +372,7 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix) /* when phrasing a string, this tells weather you are inside quotes ot not. */ BOOL bInside = FALSE; - + szPrefix[0] = _T('\0'); szSuffix[0] = _T('\0'); @@ -404,11 +404,11 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix) else szSearch = szSearch1; /* Move one char past */ - szSearch++; + szSearch++; szSearch[0] = _T('\0'); _tcscpy(szPrefix,str); return; - + } if(!_tcschr(str, _T(' '))) @@ -416,10 +416,10 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix) /* No spaces, everything goes to Suffix */ _tcscpy(szSuffix,str); /* look for a slash just in case */ - szSearch = _tcsrchr(str, _T('\\')); + szSearch = _tcsrchr(str, _T('\\')); if(szSearch) { - szSearch++; + szSearch++; szSearch[0] = _T('\0'); _tcscpy(szPrefix,str); } @@ -448,13 +448,13 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix) szSearch = szSearch3; else szSearch = szSearch1; - szSearch++; + szSearch++; szSearch[0] = _T('\0'); - _tcscpy(szPrefix,str); + _tcscpy(szPrefix,str); return; } - - /* All else fails and there is a lot of quotes, spaces and | + + /* All else fails and there is a lot of quotes, spaces and | Then we search through and find the last space or \ that is not inside a quotes */ for(i = 0; i < _tcslen(str); i++) @@ -469,7 +469,7 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix) } SBreak++; PBreak++; - _tcscpy(szSuffix,&strIN[SBreak]); + _tcscpy(szSuffix,&strIN[SBreak]); strIN[PBreak] = _T('\0'); _tcscpy(szPrefix,strIN); if (szPrefix[_tcslen(szPrefix) - 2] == _T('\"') && @@ -537,12 +537,12 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) static INT Sel; BOOL NeededQuote = FALSE; BOOL ShowAll = TRUE; - TCHAR * line = strIN; + TCHAR * line = strIN; strOut[0] = _T('\0'); while (_istspace (*line)) - line++; + line++; if(!_tcsnicmp (line, _T("rd "), 3) || !_tcsnicmp (line, _T("cd "), 3)) ShowAll = FALSE; @@ -617,7 +617,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) if(!_tcscmp (file.cFileName, _T(".")) || !_tcscmp (file.cFileName, _T(".."))) continue; - + /* Don't show files when they are doing 'cd' or 'rd' */ if(!ShowAll && file.dwFileAttributes != 0xFFFFFFFF && @@ -628,8 +628,8 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) /* Add the file to the list of files */ FileList = cmd_realloc(FileList, ++FileListSize * sizeof(FileName)); - - if(FileList == NULL) + + if(FileList == NULL) { /* Assemble the orginal string and return */ _tcscpy(strOut,szOrginal); @@ -639,7 +639,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) } /* Copies the file name into the struct */ _tcscpy(FileList[FileListSize-1].Name,file.cFileName); - + } while(FindNextFile(hFile,&file)); FindClose(hFile); @@ -649,7 +649,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) if(FileListSize == 0) { _tcscpy(strOut,szOrginal); - if(FileList != NULL) + if(FileList != NULL) cmd_free(FileList); return; @@ -680,10 +680,10 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) Sel = 0; } - /* nothing found that matched last time + /* nothing found that matched last time so return the first thing in the list */ strOut[0] = _T('\0'); - + /* space in the name */ if(_tcschr(FileList[Sel].Name, _T(' '))) { @@ -706,7 +706,7 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) if(szPrefix[LastSpace + 1] != _T('\"') && LastSpace != -1) { memmove ( &szPrefix[LastSpace+1], &szPrefix[LastSpace], (_tcslen(szPrefix)-LastSpace+1) * sizeof(TCHAR) ); - + if((UINT)(LastSpace + 1) == _tcslen(szPrefix)) { _tcscat(szPrefix,_T("\"")); @@ -739,8 +739,8 @@ VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) _tcscpy(LastReturned,strOut); EndLength = _tcslen(strOut); DiffLength = EndLength - StartLength; - if(FileList != NULL) + if(FileList != NULL) cmd_free(FileList); - + } #endif diff --git a/reactos/base/shell/cmd/for.c b/reactos/base/shell/cmd/for.c index 27461f6a55b..25cc4889d6a 100644 --- a/reactos/base/shell/cmd/for.c +++ b/reactos/base/shell/cmd/for.c @@ -48,7 +48,7 @@ */ INT cmd_for (LPTSTR cmd, LPTSTR param) -{ +{ LPBATCH_CONTEXT lpNew; LPTSTR pp; TCHAR var; diff --git a/reactos/base/shell/cmd/goto.c b/reactos/base/shell/cmd/goto.c index 8d444434d5e..8de630ecfc7 100644 --- a/reactos/base/shell/cmd/goto.c +++ b/reactos/base/shell/cmd/goto.c @@ -47,7 +47,7 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param) #endif if (!_tcsncmp (param, _T("/?"), 2)) - { + { ConOutResPaging(TRUE,STRING_GOTO_HELP1); return 0; } @@ -67,19 +67,19 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param) /* terminate label at first space char */ tmp = param+1; - while (!_istcntrl (*tmp) && !_istspace (*tmp) && (*tmp != _T(':'))) + while (!_istcntrl (*tmp) && !_istspace (*tmp) && (*tmp != _T(':'))) tmp++; *(tmp) = _T('\0'); - + /* set file pointer to the beginning of the batch file */ lNewPosHigh = 0; - + /* jump to end of the file */ - if ( _tcsicmp( param, _T(":eof"))==0) - { + if ( _tcsicmp( param, _T(":eof"))==0) + { SetFilePointer (bc->hBatchFile, 0, &lNewPosHigh, FILE_END); return 0; - } + } /* jump to begin of the file */ SetFilePointer (bc->hBatchFile, 0, &lNewPosHigh, FILE_BEGIN); @@ -87,18 +87,18 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param) while (FileGetString (bc->hBatchFile, textline, sizeof(textline) / sizeof(textline[0]))) { int pos; - int size; + int size; /* Strip out any trailing spaces or control chars */ tmp = textline + _tcslen (textline) - 1; - - + + while (_istcntrl (*tmp) || _istspace (*tmp) || (*tmp == _T(':'))) tmp--; *(tmp + 1) = _T('\0'); - + /* Then leading spaces... */ - tmp = textline; + tmp = textline; while (_istspace (*tmp)) tmp++; @@ -107,16 +107,16 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param) pos=0; while (tmp+pos < tmp+size) { - if (_istspace(tmp[pos])) + if (_istspace(tmp[pos])) tmp[pos]=_T('\0'); pos++; - } - + } + /* use whole label name */ if ((*tmp == _T(':')) && (_tcsicmp (++tmp, param) == 0)) return 0; } - + LoadString(CMD_ModuleHandle, STRING_GOTO_ERROR2, szMsg, RC_STRING_MAX_SIZE); ConErrPrintf(szMsg, param); ExitBatch(NULL); diff --git a/reactos/base/shell/cmd/if.c b/reactos/base/shell/cmd/if.c index 2019a12d17c..4128074d993 100644 --- a/reactos/base/shell/cmd/if.c +++ b/reactos/base/shell/cmd/if.c @@ -75,10 +75,10 @@ INT cmd_if (LPTSTR cmd, LPTSTR param) /* find the whole path to the file */ for(i = 0; i < _tcslen(param); i++) { - if(param[i] == _T('\"')) + if(param[i] == _T('\"')) bInside = !bInside; if((param[i] == _T(' ')) && !bInside) - { + { break; } pp++; @@ -95,10 +95,10 @@ INT cmd_if (LPTSTR cmd, LPTSTR param) } if (*pp) - { + { WIN32_FIND_DATA f; HANDLE hFind; - + hFind = FindFirstFile (param, &f); x_flag ^= (hFind == INVALID_HANDLE_VALUE) ? 0 : X_EXEC; if (hFind != INVALID_HANDLE_VALUE) diff --git a/reactos/base/shell/cmd/internal.c b/reactos/base/shell/cmd/internal.c index 4cf5caf1542..a04d9a6f0a6 100644 --- a/reactos/base/shell/cmd/internal.c +++ b/reactos/base/shell/cmd/internal.c @@ -129,12 +129,12 @@ * * 19-Jul-2005 (Brandon Turner ) * Rewrite the CD, it working as Windows 2000 CMD - * + * * 19-Jul-2005 (Magnus Olsen ) - * Add SetRootPath and GetRootPath + * Add SetRootPath and GetRootPath * * 14-Jul-2007 (Pierre Schweitzer ) - * Added commands help display to help command (ex. : "help cmd") + * Added commands help display to help command (ex. : "help cmd") */ #include @@ -156,7 +156,7 @@ VOID FreeLastPath (VOID) cmd_free (lpLastPath); } -/* help functions for getting current path from drive +/* help functions for getting current path from drive without changing drive. Return code 0 = ok, 1 = fail. INT GetRootPath("C:",outbuffer,chater size of outbuffer); the first param can have any size, if the the two frist @@ -167,18 +167,18 @@ VOID FreeLastPath (VOID) INT GetRootPath(TCHAR *InPath,TCHAR *OutPath,INT size) { INT retcode = 1; - + if (_tcslen(InPath)>1) { - if (InPath[1]==_T(':')) - { + if (InPath[1]==_T(':')) + { INT t=0; - + if ((InPath[0] >= _T('0')) && (InPath[0] <= _T('9'))) { t = (InPath[0] - _T('0')) +28; } - + if ((InPath[0] >= _T('a')) && (InPath[0] <= _T('z'))) { t = (InPath[0] - _T('a')) +1; @@ -189,29 +189,29 @@ INT GetRootPath(TCHAR *InPath,TCHAR *OutPath,INT size) { t = (InPath[0] - _T('A')) +1; } - - if (_tgetdcwd(t,OutPath,size) != NULL) - { - return 0; - } - } + + if (_tgetdcwd(t,OutPath,size) != NULL) + { + return 0; + } + } } - + /* fail */ if (_tcslen(InPath)>1) { if (InPath[1]==_T(':')) - return 1; + return 1; } /* Get current directory */ - retcode = GetCurrentDirectory(size,OutPath); - if (retcode==0) + retcode = GetCurrentDirectory(size,OutPath); + if (retcode==0) return 1; return 0; } - + BOOL SetRootPath(TCHAR *InPath) { @@ -220,26 +220,26 @@ BOOL SetRootPath(TCHAR *InPath) TCHAR OutPathTemp[MAX_PATH]; TCHAR OutPathTemp2[MAX_PATH]; BOOL fail; - - + + /* Get The current directory path and save it */ fail = GetCurrentDirectory(MAX_PATH,oldpath); - if (!fail) + if (!fail) return 1; - + /* Get current drive directory path if C: was only pass down*/ - + if (_tcsncicmp(&InPath[1],_T(":\\"),2)!=0) { if (!GetRootPath(InPath,OutPathTemp,MAX_PATH)) _tcscpy(OutPathTemp,InPath); } - else + else { _tcscpy(OutPathTemp,InPath); } - - _tcsupr(OutPathTemp); + + _tcsupr(OutPathTemp); /* The use of both of these together will correct the case of a path where as one alone or GetFullPath will not. Exameple: c:\windows\SYSTEM32 => C:\WINDOWS\system32 */ @@ -247,20 +247,20 @@ BOOL SetRootPath(TCHAR *InPath) GetPathCase(OutPathTemp2, OutPath); fail = SetCurrentDirectory(OutPath); - if (!fail) + if (!fail) return 1; - - + + SetCurrentDirectory(OutPath); GetCurrentDirectory(MAX_PATH,OutPath); _tchdir(OutPath); - if (_tcsncicmp(OutPath,oldpath,2)!=0) - SetCurrentDirectory(oldpath); + if (_tcsncicmp(OutPath,oldpath,2)!=0) + SetCurrentDirectory(oldpath); return 0; -} +} /* @@ -269,8 +269,8 @@ BOOL SetRootPath(TCHAR *InPath) */ INT cmd_chdir (LPTSTR cmd, LPTSTR param) { - - WIN32_FIND_DATA f; + + WIN32_FIND_DATA f; HANDLE hFile; BOOL bChangeDrive = FALSE; TCHAR szPath[MAX_PATH]; @@ -279,17 +279,17 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) TCHAR szCurrent[MAX_PATH]; TCHAR szMsg[RC_STRING_MAX_SIZE]; INT i; - - + + /* Filter out special cases first */ - + /* Print Help */ if (!_tcsncmp(param, _T("/?"), 2)) { ConOutResPaging(TRUE,STRING_CD_HELP); return 0; } - + /* Set Error Level to Success */ nErrorLevel = 0; @@ -313,10 +313,10 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) { _tcscpy(szPath,param); } - + /* Print Current Directory on a disk */ if (_tcslen(szPath) == 2 && szPath[1] == _T(':')) - { + { if(GetRootPath(szPath,szCurrent,MAX_PATH)) { nErrorLevel = 1; @@ -325,10 +325,10 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) ConOutPuts(szCurrent); return 0; } - + /* Get Current Directory */ GetRootPath(_T("."),szCurrent,MAX_PATH); - + /* Remove " */ i = 0; while(i < (INT)_tcslen(szPath)) @@ -338,28 +338,28 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) else i++; } - + tmpPath = szPath; while (_istspace (*tmpPath)) tmpPath++; _tcscpy(szPath,tmpPath); - - if (szPath[0] == _T('\0')) + + if (szPath[0] == _T('\0')) { ConOutPuts(szCurrent); return 0; } - + /* change to full path if relative path was given */ GetFullPathName(szPath,MAX_PATH,szFinalPath,NULL); - + if(szFinalPath[_tcslen(szFinalPath) - 1] == _T('\\') && _tcslen(szFinalPath) > 3) szFinalPath[_tcslen(szFinalPath) - 1] = _T('\0'); - + /* Handle Root Directory Alone*/ if (_tcslen(szFinalPath) == 3 && szFinalPath[1] == _T(':')) - { + { if(!SetRootPath(szFinalPath)) { /* Change prompt if it is one the same drive or /D */ @@ -372,38 +372,38 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) ConErrPrintf(szMsg); nErrorLevel = 1; return 1; - + } - + /* Get a list of all the files */ hFile = FindFirstFile (szFinalPath, &f); - + do { if(hFile == INVALID_HANDLE_VALUE) - { - ConErrFormatMessage (GetLastError(), szFinalPath); + { + ConErrFormatMessage (GetLastError(), szFinalPath); nErrorLevel = 1; return 1; } - + /* Strip the paths back to the folder they are in */ for(i = (_tcslen(szFinalPath) - 1); i > -1; i--) if(szFinalPath[i] != _T('\\')) szFinalPath[i] = _T('\0'); else break; - - _tcscat(szFinalPath,f.cFileName); - + + _tcscat(szFinalPath,f.cFileName); + if ((f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) - { + { if(!SetRootPath(szFinalPath)) { /* Change for /D */ if(bChangeDrive) - { - _tcsupr(szFinalPath); + { + _tcsupr(szFinalPath); GetPathCase(szFinalPath, szPath); SetCurrentDirectory(szPath); } @@ -412,7 +412,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) } }while(FindNextFile (hFile, &f)); - + /* Didnt find an directories */ LoadString(CMD_ModuleHandle, STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE); ConErrPrintf(szMsg); @@ -426,18 +426,18 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) #ifdef INCLUDE_CMD_MKDIR -/* Helper funtion for mkdir to make directories in a path. +/* Helper funtion for mkdir to make directories in a path. Dont use the api to decrease depence on libs */ -BOOL +BOOL MakeFullPath(TCHAR * DirPath) { TCHAR path[MAX_PATH]; TCHAR *p = DirPath; INT n; - if (p[0] && p[1] == _T(':')) + if (p[0] && p[1] == _T(':')) p += 2; - while (*p == _T('\\')) + while (*p == _T('\\')) p++; /* skip drive root */ while ((p = _tcschr(p, _T('\\'))) != NULL) { @@ -602,7 +602,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param) INT res; TCHAR szMsg[RC_STRING_MAX_SIZE]; TCHAR szFullPath[MAX_PATH]; - + if (!_tcsncmp (param, _T("/?"), 2)) { ConOutResPaging(TRUE,STRING_RMDIR_HELP); @@ -647,7 +647,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param) _tcscpy(dir,arg[i]); } } - + if (dir[0] == _T('\0')) { /* No folder to remove */ @@ -741,11 +741,11 @@ INT CommandExit (LPTSTR cmd, LPTSTR param) nErrorLevel = _ttoi(param); ExitBatch (NULL); } - + else bExit = TRUE; - + return 0; } diff --git a/reactos/base/shell/cmd/lang/ja-JP.rc b/reactos/base/shell/cmd/lang/ja-JP.rc index f8c1077e35b..1541f1e5906 100644 --- a/reactos/base/shell/cmd/lang/ja-JP.rc +++ b/reactos/base/shell/cmd/lang/ja-JP.rc @@ -139,7 +139,7 @@ DATE [/T][ /T “ú•t‚Ì•\\Ž¦‚Ì‚Ýs‚¢‚Ü‚·B\n\n\ ƒpƒ‰ƒ[ƒ^‚ÌŽw’肪‚È‚¢ê‡‚ÍAŒ»Ý‚Ì“ú•t‚ª•\\Ž¦‚³‚êAV‚µ‚¢“ú•t‚Ì“ü—Í‚ð\n\ ‹‚ß‚ç‚ê‚Ü‚·B•ÏX‚µ‚È‚¢ê‡‚ÍAEnter ƒL[‚ð‰Ÿ‚µ‚Ü‚·B\n" - + STRING_DEL_HELP1, "1 ‚‚܂½‚Í•¡”‚̃tƒ@ƒCƒ‹‚ð휂µ‚Ü‚·B\n\n\ DEL [/N /P /T /Q /S /W /Y /Z /A[[:]‘®«]] ƒtƒ@ƒCƒ‹–¼ ...\n\ DELETE [/N /P /T /Q /S /W /Y /Z /A[[:]‘®«]] ƒtƒ@ƒCƒ‹–¼ ...\n\ @@ -398,7 +398,7 @@ REN [/E /N /P /Q /S /T] STRING_REN_HELP2, " %lu ŒÂ‚̃tƒ@ƒCƒ‹‚Ì–¼‘O‚ª•ÏX‚³‚ê‚Ü‚µ‚½\n" STRING_REN_HELP3, " %lu ŒÂ‚̃tƒ@ƒCƒ‹‚Ì–¼‘O‚ª•ÏX‚³‚ê‚Ü‚µ‚½\n" - + STRING_SHIFT_HELP, "ƒoƒbƒ` ƒtƒ@ƒCƒ‹’†‚Ì’u‚«Š·‚¦‰Â”\\‚ȃpƒ‰ƒ[ƒ^‚̈ʒu‚ð•ÏX‚µ‚Ü‚·B\n\n\ SHIFT [DOWN]" @@ -602,7 +602,7 @@ STRING_ERROR_ERROR1, " STRING_ERROR_ERROR2, "\\•¶ƒGƒ‰[" STRING_FOR_ERROR1, "–½—ß•¶’†‚É 'in' ‚ª•s‘«‚µ‚Ä‚¢‚Ü‚·B" STRING_FOR_ERROR2, "Š‡ŒÊ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñB" -STRING_FOR_ERROR3, "'do' ‚ª•s‘«‚µ‚Ä‚¢‚Ü‚·B" +STRING_FOR_ERROR3, "'do' ‚ª•s‘«‚µ‚Ä‚¢‚Ü‚·B" STRING_FOR_ERROR4, "'do' ‚ÌŒã‚ɃRƒ}ƒ“ƒh‚ª‚ ‚è‚Ü‚¹‚ñB" STRING_FREE_ERROR1, "–³Œø‚ȃhƒ‰ƒCƒu‚Å‚·B" STRING_FREE_ERROR2, "ƒ‰ƒxƒ‹‚ª‚ ‚è‚Ü‚¹‚ñB" diff --git a/reactos/base/shell/cmd/lang/pl-PL.rc b/reactos/base/shell/cmd/lang/pl-PL.rc index 94cabc349b2..57dae29acbc 100644 --- a/reactos/base/shell/cmd/lang/pl-PL.rc +++ b/reactos/base/shell/cmd/lang/pl-PL.rc @@ -595,7 +595,7 @@ STRING_ERROR_ERROR1, "Nieznany b STRING_ERROR_ERROR2, "B³¹d sk³adni" STRING_FOR_ERROR1, "Brak 'in' dla twierdzenia." STRING_FOR_ERROR2, "Nawias nie zosta³ znaleziony." -STRING_FOR_ERROR3, "Brakuje 'do'." +STRING_FOR_ERROR3, "Brakuje 'do'." STRING_FOR_ERROR4, "Brak komendy po 'do'." STRING_FREE_ERROR1, "Nieprawid³owa litera napêdu" STRING_FREE_ERROR2, "brak" diff --git a/reactos/base/shell/cmd/locale.c b/reactos/base/shell/cmd/locale.c index fcdd660049b..d499972dfe0 100644 --- a/reactos/base/shell/cmd/locale.c +++ b/reactos/base/shell/cmd/locale.c @@ -61,7 +61,7 @@ VOID PrintDate (VOID) TCHAR szDate[32]; GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, _T("ddd"), szDateDay, sizeof (szDateDay)); - + GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL,szDate, sizeof (szDate)); ConOutPrintf(_T("%s %s"),szDateDay, szDate); } @@ -69,10 +69,10 @@ VOID PrintDate (VOID) VOID PrintTime (VOID) { - TCHAR szMsg[RC_STRING_MAX_SIZE]; + TCHAR szMsg[RC_STRING_MAX_SIZE]; SYSTEMTIME t; - GetLocalTime(&t); - + GetLocalTime(&t); + LoadString(CMD_ModuleHandle, STRING_LOCALE_HELP1, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(_T("%s: %02d%c%02d%c%02d%c%02d\n"), szMsg, t.wHour, cTimeSeparator, t.wMinute , cTimeSeparator, diff --git a/reactos/base/shell/cmd/misc.c b/reactos/base/shell/cmd/misc.c index dd41e685841..4b4e8edbf28 100644 --- a/reactos/base/shell/cmd/misc.c +++ b/reactos/base/shell/cmd/misc.c @@ -63,7 +63,7 @@ TCHAR cgetchar (VOID) do { ReadConsoleInput (hInput, &irBuffer, 1, &dwRead); - + if (irBuffer.EventType == KEY_EVENT) { if (irBuffer.Event.KeyEvent.dwControlKeyState & @@ -84,7 +84,7 @@ TCHAR cgetchar (VOID) { ; } - + else { break; @@ -106,13 +106,13 @@ TCHAR cgetchar (VOID) VOID GetPathCase( TCHAR * Path, TCHAR * OutPath) { UINT i = 0; - TCHAR TempPath[MAX_PATH]; + TCHAR TempPath[MAX_PATH]; WIN32_FIND_DATA FindFileData; HANDLE hFind; _tcscpy(TempPath, _T("")); _tcscpy(OutPath, _T("")); - + for(i = 0; i < _tcslen(Path); i++) { if(Path[i] != _T('\\')) diff --git a/reactos/base/shell/cmd/prompt.c b/reactos/base/shell/cmd/prompt.c index 5885e786292..399446c0c00 100644 --- a/reactos/base/shell/cmd/prompt.c +++ b/reactos/base/shell/cmd/prompt.c @@ -136,15 +136,15 @@ VOID PrintPrompt(VOID) ConOutChar (_T(' ')); break; - case _T('T'): - { + case _T('T'): + { SYSTEMTIME t; - GetSystemTime(&t); + GetSystemTime(&t); ConOutPrintf(_T("%02d%c%02d%c%02d%c%02d\n"),t.wHour, cTimeSeparator,t.wMinute , cTimeSeparator, t.wSecond , cDecimalSeparator, t.wMilliseconds ); } break; - + case _T('V'): switch (osvi.dwPlatformId) { @@ -191,7 +191,7 @@ VOID PrintPrompt(VOID) #ifdef INCLUDE_CMD_PROMPT INT cmd_prompt (LPTSTR cmd, LPTSTR param) -{ +{ if (!_tcsncmp (param, _T("/?"), 2)) { ConOutResPaging(TRUE,STRING_PROMPT_HELP1); @@ -206,8 +206,8 @@ INT cmd_prompt (LPTSTR cmd, LPTSTR param) /* if it is null, then it needs to set to default, because that means the user entered "prompt" only. so even if param is null you _must_ still set prompt - to the default. There seems to be some kinda difference - between winxp and 2k in this matter and this way will + to the default. There seems to be some kinda difference + between winxp and 2k in this matter and this way will cover both. Do not use fixed size of szParam for param the buffer are 8192bytes and will later change to dymatic buffer */ @@ -222,11 +222,11 @@ INT cmd_prompt (LPTSTR cmd, LPTSTR param) TCHAR szParam[5]; _tcscpy(szParam,_T("$P$G")); if (!SetEnvironmentVariable (_T("PROMPT"),szParam)) - return 1; + return 1; } - - + + return 0; } #endif diff --git a/reactos/base/shell/cmd/redir.c b/reactos/base/shell/cmd/redir.c index 59d341269a5..0d476e4ed2f 100644 --- a/reactos/base/shell/cmd/redir.c +++ b/reactos/base/shell/cmd/redir.c @@ -61,7 +61,7 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags TCHAR * line = s; - + while (_istspace (*line)) line++; @@ -71,9 +71,9 @@ INT GetRedirection (LPTSTR s, LPTSTR ifn, LPTSTR ofn, LPTSTR efn, LPINT lpnFlags lpnFlags = 0; *ifn=('\0'); *ofn=('\0'); - *efn=_T('\0'); + *efn=_T('\0'); return 1; - } + } #endif /* find and remove all the redirections first */ while (*sp) diff --git a/reactos/base/shell/cmd/replace.c b/reactos/base/shell/cmd/replace.c index 4cb1ac2b909..a2238e45a6f 100644 --- a/reactos/base/shell/cmd/replace.c +++ b/reactos/base/shell/cmd/replace.c @@ -66,7 +66,7 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d // ConOutPrintf(_T("old-dest: %s\n"), d); // ConOutPrintf(_T("src: %s\n"), source); // ConOutPrintf(_T("dest: %s\n"), dest); - + /* Open up the sourcefile */ hFileSrc = CreateFile (source, GENERIC_READ, FILE_SHARE_READ,NULL, OPEN_EXISTING, 0, NULL); if (hFileSrc == INVALID_HANDLE_VALUE) @@ -75,15 +75,15 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d ConOutPrintf(szMsg, source); return 0; } - + /* Get the time from source file to be used in the comparison with dest time if update switch is set */ GetFileTime (hFileSrc, &srcCreationTime, &srcLastAccessTime, &srcLastWriteTime); - + /* Retrieve the source attributes so that they later on can be inserted in to the destination */ dwAttrib = GetFileAttributes (source); - + if(IsExistingFile (dest)) { /* Resets the attributes to avoid probles with read only files, @@ -148,7 +148,7 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d *doMore = FALSE; return 0; } - + /* Open destination file to write to */ hFileDest = CreateFile (dest, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); if (hFileDest == INVALID_HANDLE_VALUE) @@ -238,7 +238,7 @@ INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PA /* Problem with file handler */ if(hFile == INVALID_HANDLE_VALUE) return filesReplaced; - + /* We do not want to replace any .. . ocr directory */ if(!_tcscmp (findBuffer.cFileName, _T(".")) || !_tcscmp (findBuffer.cFileName, _T(".."))|| @@ -385,7 +385,7 @@ INT cmd_replace (LPTSTR cmd, LPTSTR param) /* Divide the argument in to an array of c-strings */ arg = split (param, &argc, FALSE); - nFiles = argc; + nFiles = argc; /* Read options */ for (i = 0; i < argc; i++) diff --git a/reactos/base/shell/cmd/resource.h b/reactos/base/shell/cmd/resource.h index 56bebfd84e8..29fc592db53 100644 --- a/reactos/base/shell/cmd/resource.h +++ b/reactos/base/shell/cmd/resource.h @@ -86,7 +86,7 @@ #define STRING_CMD_HELP5 612 #define STRING_CMD_HELP6 613 #define STRING_CMD_HELP7 614 -#define STRING_CMD_HELP8 615 +#define STRING_CMD_HELP8 615 #define STRING_CMD_SHELLINFO 624 diff --git a/reactos/base/shell/cmd/screen.c b/reactos/base/shell/cmd/screen.c index 8e1009b6b5e..d3c08990f04 100644 --- a/reactos/base/shell/cmd/screen.c +++ b/reactos/base/shell/cmd/screen.c @@ -43,7 +43,7 @@ INT CommandScreen (LPTSTR cmd, LPTSTR param) if (y<0 || y>(maxy-1)) { ConOutResPuts(STRING_SCREEN_ROW); - + return 1; } diff --git a/reactos/base/shell/cmd/start.c b/reactos/base/shell/cmd/start.c index 3cab8b2711f..3638bb33b95 100644 --- a/reactos/base/shell/cmd/start.c +++ b/reactos/base/shell/cmd/start.c @@ -20,7 +20,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) { TCHAR szFullName[CMDLINE_LENGTH]; TCHAR first[CMDLINE_LENGTH]; - TCHAR *rest = NULL; + TCHAR *rest = NULL; TCHAR *param = NULL; TCHAR RestWithoutArgs[CMDLINE_LENGTH]; INT size; @@ -35,11 +35,11 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) INT argc = 0; INT i = 0; DWORD Priority = 0; - + RestWithoutArgs[0] = _T('\0'); _tcscpy(first,First); arg = split (Rest, &argc, FALSE); - + for (i = 0; i < argc; i++) { @@ -51,7 +51,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) } else if(!_tcsicmp(arg[i], _T("/LOW"))) { - Priority = IDLE_PRIORITY_CLASS; + Priority = IDLE_PRIORITY_CLASS; } else if(!_tcsicmp(arg[i], _T("/NORMAL"))) { @@ -59,7 +59,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) } else if(!_tcsicmp(arg[i], _T("/HIGH"))) { - Priority = HIGH_PRIORITY_CLASS; + Priority = HIGH_PRIORITY_CLASS; } else if(!_tcsicmp(arg[i], _T("/REALTIME"))) { @@ -67,7 +67,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) } else if(!_tcsicmp(arg[i], _T("/ABOVENORMAL"))) { - Priority = ABOVE_NORMAL_PRIORITY_CLASS; + Priority = ABOVE_NORMAL_PRIORITY_CLASS; } else if(!_tcsicmp(arg[i], _T("/BELOWNORMAL"))) { @@ -82,12 +82,12 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) _tcscat(RestWithoutArgs,arg[i]); } } - - - - + + + + freep (arg); - + /* get comspec */ comspec = cmd_alloc ( MAX_PATH * sizeof(TCHAR)); if (comspec == NULL) @@ -114,7 +114,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) return 1; } size = GetEnvironmentVariable (_T("COMSPEC"), comspec, size); - } + } } nErrorLevel = 0; @@ -126,7 +126,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) _tcscat(RestWithoutArgs,_T("\"")); } - rest = cmd_alloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR)); + rest = cmd_alloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR)); if (rest == NULL) { if(comspec != NULL) @@ -135,7 +135,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) return 1; } - param = cmd_alloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR)); + param = cmd_alloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR)); if (param == NULL) { if(comspec != NULL) @@ -149,18 +149,18 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) _tcscpy(rest,RestWithoutArgs); - + /* Parsing the command that gets called by start, and it's parameters */ if(!_tcschr(rest,_T('\"'))) { INT count = _tcslen(rest); - + /* find the end of the command and start of the args */ for(i = 0; i < count; i++) { if(rest[i] == _T(' ')) - { - + { + _tcscpy(param,&rest[i+1]); rest[i] = _T('\0'); break; @@ -169,16 +169,16 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) } else { - INT count = _tcslen(rest); + INT count = _tcslen(rest); BOOL bInside = FALSE; /* find the end of the command and put the arguments in param */ for(i = 0; i < count; i++) { - if(rest[i] == _T('\"')) + if(rest[i] == _T('\"')) bInside = !bInside; if((rest[i] == _T(' ')) && !bInside) - { + { _tcscpy(param,&rest[i+1]); rest[i] = _T('\0'); break; @@ -194,9 +194,9 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) i++; } } - + /* check for a drive change */ - + if (!_tcscmp (first + 1, _T(":")) && _istalpha (*first)) { TCHAR szPath[CMDLINE_LENGTH]; @@ -208,55 +208,55 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) if (szPath[0] != (TCHAR)_totupper (*first)) ConErrResPuts (STRING_FREE_ERROR1); - if (rest != NULL) + if (rest != NULL) cmd_free(rest); - if (param != NULL) + if (param != NULL) cmd_free(param); if (comspec != NULL) cmd_free(comspec); return 0; } - + /* get the PATH environment variable and parse it */ /* search the PATH environment variable for the binary */ if (!SearchForExecutable (rest, szFullName)) { error_bad_command (); - if (rest != NULL) + if (rest != NULL) cmd_free(rest); - if (param != NULL) + if (param != NULL) cmd_free(param); if (comspec != NULL) cmd_free(comspec); return 1; } - + /* check if this is a .BAT or .CMD file */ if (!_tcsicmp (_tcsrchr (szFullName, _T('.')), _T(".bat")) || !_tcsicmp (_tcsrchr (szFullName, _T('.')), _T(".cmd"))) { - bBat = TRUE; + bBat = TRUE; memset(szFullCmdLine,0,CMDLINE_LENGTH * sizeof(TCHAR)); _tcscpy(szFullCmdLine,comspec); - memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)],_T("\" /K \""), 6 * sizeof(TCHAR)); - memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)], szFullName, _tcslen(szFullName) * sizeof(TCHAR)); - memcpy(&szFullCmdLine[1], &szFullCmdLine[0], _tcslen(szFullCmdLine) * sizeof(TCHAR)); - szFullCmdLine[0] = _T('\"'); + memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)],_T("\" /K \""), 6 * sizeof(TCHAR)); + memcpy(&szFullCmdLine[_tcslen(szFullCmdLine)], szFullName, _tcslen(szFullName) * sizeof(TCHAR)); + memcpy(&szFullCmdLine[1], &szFullCmdLine[0], _tcslen(szFullCmdLine) * sizeof(TCHAR)); + szFullCmdLine[0] = _T('\"'); szFullCmdLine[_tcslen(szFullCmdLine)] = _T('\"'); } #ifdef _DEBUG DebugPrintf (_T("[BATCH: %s %s]\n"), szFullName, rest); #endif - + #ifdef _DEBUG DebugPrintf (_T("[EXEC: %s %s]\n"), szFullName, rest); @@ -267,7 +267,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) _tcscpy (szFullCmdLine, first); if( param != NULL ) { - + _tcscat(szFullCmdLine, _T(" ") ); _tcscat (szFullCmdLine, param); } @@ -278,7 +278,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) stui.cb = sizeof (STARTUPINFO); stui.dwFlags = STARTF_USESHOWWINDOW; stui.wShowWindow = SW_SHOWDEFAULT; - + if (bBat == TRUE) { bCreate = CreateProcess (NULL, szFullCmdLine, NULL, NULL, FALSE, @@ -289,7 +289,7 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) bCreate = CreateProcess (szFullName, szFullCmdLine, NULL, NULL, FALSE, CREATE_NEW_CONSOLE | Priority, NULL, NULL, &stui, &prci); } - + if (bCreate) { if (bWait) @@ -312,10 +312,10 @@ INT cmd_start (LPTSTR First, LPTSTR Rest) } - if (rest != NULL) + if (rest != NULL) cmd_free(rest); - if (param != NULL) + if (param != NULL) cmd_free(param); if (comspec != NULL) diff --git a/reactos/base/shell/cmd/timer.c b/reactos/base/shell/cmd/timer.c index a5f10df1553..57b1df9c13d 100644 --- a/reactos/base/shell/cmd/timer.c +++ b/reactos/base/shell/cmd/timer.c @@ -161,7 +161,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param) { cT=GetTickCount(); cS=TRUE; - + ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF")); PrintTime(); freep(p); @@ -171,7 +171,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param) if(bS) { if(cS) - { + { ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF")); PrintTime(); PrintElapsedTime(GetTickCount()-cT, iFormat); diff --git a/reactos/base/shell/cmd/type.c b/reactos/base/shell/cmd/type.c index c1fe071fcbf..cd0bbbab9cc 100644 --- a/reactos/base/shell/cmd/type.c +++ b/reactos/base/shell/cmd/type.c @@ -49,7 +49,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param) { ConOutResPaging(TRUE,STRING_TYPE_HELP1); return 0; - } + } if (!*param) { @@ -100,7 +100,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param) nErrorLevel = 1; continue; } - + do { bRet = FileGetString (hFile, buff, sizeof(buff) / sizeof(TCHAR)); @@ -116,7 +116,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param) } } else - { + { if(bRet) ConOutPrintf(buff); } diff --git a/reactos/base/shell/cmd/ver.c b/reactos/base/shell/cmd/ver.c index 53fcff861a0..4393e2d560c 100644 --- a/reactos/base/shell/cmd/ver.c +++ b/reactos/base/shell/cmd/ver.c @@ -30,7 +30,7 @@ VOID ShortVersion (VOID) unsigned RosVersionLen; LPTSTR RosVersion; TCHAR szMsg[RC_STRING_MAX_SIZE]; - + ConOutResPuts (STRING_CMD_SHELLINFO ); VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); diff --git a/reactos/base/shell/cmd/vol.c b/reactos/base/shell/cmd/vol.c index c26106df728..f50ffa34021 100644 --- a/reactos/base/shell/cmd/vol.c +++ b/reactos/base/shell/cmd/vol.c @@ -42,7 +42,7 @@ PrintVolumeHeader (LPTSTR pszRootPath) NULL, 0)) { - ErrorMessage (GetLastError (), _T("")); + ErrorMessage (GetLastError (), _T("")); return 1; } @@ -90,7 +90,7 @@ INT cmd_vol (LPTSTR cmd, LPTSTR param) szRootPath[0] = param[0]; else { - error_invalid_drive (); + error_invalid_drive (); nErrorLevel = 1; return 1; } @@ -98,14 +98,14 @@ INT cmd_vol (LPTSTR cmd, LPTSTR param) if (!IsValidPathName (szRootPath)) { - error_invalid_drive (); + error_invalid_drive (); nErrorLevel = 1; return 1; } /* print the header */ if (!PrintVolumeHeader (szRootPath)) - { + { nErrorLevel = 1; return 1; } diff --git a/reactos/base/shell/explorer/dialogs/settings.cpp b/reactos/base/shell/explorer/dialogs/settings.cpp index 0b80458c5ba..c4d7db64bf6 100644 --- a/reactos/base/shell/explorer/dialogs/settings.cpp +++ b/reactos/base/shell/explorer/dialogs/settings.cpp @@ -248,7 +248,7 @@ MdiSdiDlg::MdiSdiDlg(HWND hwnd) } int MdiSdiDlg::Command(int id, int code) -{ +{ if (code == BN_CLICKED) { switch(id) { case IDOK: { diff --git a/reactos/base/shell/explorer/explorer-bg.rc b/reactos/base/shell/explorer/explorer-bg.rc index 1334f16df00..0f1ee4e6408 100644 --- a/reactos/base/shell/explorer/explorer-bg.rc +++ b/reactos/base/shell/explorer/explorer-bg.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Òúðñåíå íà ïðèëîæåíèå" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Ïðå&ñÿâàíå:",IDC_STATIC,2,9,41,8 EDITTEXT IDC_FILTER,43,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Ïðîâåðêà",IDC_CHECK_ENTRIES,143,2,50,20 END @@ -174,29 +174,29 @@ FONT 7, "MS Sans Serif" BEGIN LTEXT "Èçáåðåòå íà÷èí íà ïîäðåæäàíå:", IDC_STATIC,7,7,166,8 - CONTROL "Ãîðåí ëÿâ íàäîëó",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "Ãîðåí ëÿâ íàäîëó",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,6,25,60,44 - CONTROL "Ãîðåí ëÿâ íàäÿñíî",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "Ãîðåí ëÿâ íàäÿñíî",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,67,25,60,44 - CONTROL "Ãîðåí äåñåí íàëÿâî",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "Ãîðåí äåñåí íàëÿâî",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,127,25,60,44 - CONTROL "Ãîðåí äåñåí íàäîëó",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "Ãîðåí äåñåí íàäîëó",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,188,25,60,44 - CONTROL "Äîëåí ëÿâ íàãîðå",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "Äîëåí ëÿâ íàãîðå",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,6,73,60,44 - CONTROL "Äîëåí ëÿâ íàäÿñíî",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "Äîëåí ëÿâ íàäÿñíî",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,67,73,60,44 - CONTROL "Äîëåí äåñåí íàëÿâî",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "Äîëåí äåñåí íàëÿâî",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,127,73,60,44 - CONTROL "Äîëåí äåñåí íàãîðå",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "Äîëåí äåñåí íàãîðå",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,188,73,60,44 - CONTROL "Ñòðàíè÷íî íàäîëó",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "Ñòðàíè÷íî íàäîëó",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,6,121,60,44 - CONTROL "Ïî ðúáîâåòå",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "Ïî ðúáîâåòå",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,67,121,60,44 - CONTROL "Êðúãîâî",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "Êðúãîâî",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,127,121,60,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,188,121,60,44 CONTROL "Ïîêàçâàíå íà &âåðñèÿòà",ID_DESKTOP_VERSION,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,177,120,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Ñâîéñòâà íà çàäà÷íàòà ëåíòà" FONT 8, "MS Sans Serif" BEGIN - CONTROL "Ïîêàçâàíå íà &÷àñîâíèêà",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "Ïîêàçâàíå íà &÷àñîâíèêà",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,100,10 CONTROL "&Ïîêàçâàíå íà íåïîëçâàíèòå çíà÷åòà", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,143,10 PUSHBUTTON "Ó&âåäîìèòåëêà...",ID_CONFIG_NOTIFYAREA,150,173,62,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Íàñòðîéêà íà óâåäîìèòåëíèòå çíà÷åòà" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Ïîäñêàçêà:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Ïúò:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Íà÷èí íà èçîáðàçÿâàíå",IDC_LABEL4,7,96,157,28 - CONTROL "&ïîêàçâàíå",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&ïîêàçâàíå",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,108,49,10 CONTROL "&ñêðèâàíå",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,56, 108,45,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,100,108,61,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Ïðîìåíåíî íà:",IDC_LABEL6,3,132,54,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "&Ïîêàçâàíå íà ñêðèòè",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,2,154,85,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Îòâàðÿíå íà ïîäïàïêèòå â îò&äåëíè ïðîçîðöè", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,180,10 LTEXT "Òàçè íàñòðîéêà âå÷å ùå áúäå èçïîëçâàíà ïî ïîäðàçáèðàíå çà âñè÷êè ïðîçîðöè íà èçñëåäîâàòåëÿ.", IDC_STATIC,7,108,174,25 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "Èçñëåäîâàòåë íà ÐåàêòÎÑ" IDS_START "Ïóñê" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Óïðàâëåíèå" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Ïóñêîâ èçáîðíèê" IDS_MINIMIZE_ALL "Ñìàëÿâàíå íà âñè÷êè ïðîçîðöè" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Ïðåêðàòÿâàíå íà èçñëåäîâàòåëÿ" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Ìðåæà" IDS_CONNECTIONS "Ìðåæîâè âðúçêè" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "Âñè÷êè ïîòðåáèòåëè\\" IDS_SEARCH "Òúðñåíå" IDS_ABOUT_EXPLORER "&Çà èçñëåäîâàòåëÿ..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Èçáðàëè ñòå ïîâå÷å îò åäíî ïðèëîæåíèå.\nÑèãóðåí ëè ñòå, ÷å èñêàòå äà èçïúëíèòå âñè÷êèòå?" IDS_DESKTOPBAR_SETTINGS "Íàñòðîéêè íà ðàáîòíàòà ïëîù" IDS_DESKTOP "Ðàáîòíà ïëîù" diff --git a/reactos/base/shell/explorer/explorer-bn.rc b/reactos/base/shell/explorer/explorer-bn.rc index 40e09ec5130..7cae8285ff2 100644 --- a/reactos/base/shell/explorer/explorer-bn.rc +++ b/reactos/base/shell/explorer/explorer-bn.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_BENGALI, LANG_NEUTRAL // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&ev·" BEGIN @@ -151,7 +151,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Search Program in Startmenu" @@ -159,8 +159,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Check Entries",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -172,29 +172,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Please select your prefered icon alignment algorithm:", IDC_STATIC,7,7,166,8 - CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Display &Version Number",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -205,10 +205,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Taskbar Properties" FONT 8, "MS Sans Serif" BEGIN - CONTROL "show &clock",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "show &clock",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&hide inactive notification icons", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Notifications...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -221,13 +221,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Configure Notification Icons" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Tooltip Text:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -236,7 +236,7 @@ BEGIN LTEXT "&Module Path:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Display Mode",IDC_LABEL4,7,96,157,28 - CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&hide",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -244,7 +244,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Last Change:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "sho&w hidden",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -260,7 +260,7 @@ FONT 12, "SutonnyMJ", 0, 0, 0x1 BEGIN LTEXT "Avcbvi cQ›`gZ Kg©‡¶Î wba©vib Ki“b :-",IDC_STATIC,23,7, 160,8 - CONTROL "&eûgyLx Kg©‡¶Î",IDC_MDI,"Button",BS_AUTORADIOBUTTON | + CONTROL "&eûgyLx Kg©‡¶Î",IDC_MDI,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,23,31,124,10 CONTROL "&GKgyLx Kg©‡¶Î",IDC_SDI,"Button",BS_AUTORADIOBUTTON,23, 61,118,10 @@ -296,18 +296,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -321,7 +321,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "we¯—viK" IDS_START "Kvh©Kvix ZvwjKv" @@ -341,7 +341,7 @@ BEGIN IDS_ADMIN "cÖkvmwbK" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Kvh©Kvix ZvwjKv" IDS_MINIMIZE_ALL "mKj ev· A`„k¨ Kiv" @@ -359,7 +359,7 @@ BEGIN IDS_TERMINATE "‡ivm we¯—viK eÜ Kiv" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "RvjK" IDS_CONNECTIONS "Rvj‡Ki m¤ú©K" @@ -373,7 +373,7 @@ BEGIN IDS_ALL_USERS "mKj e¨enviKvix\\" IDS_SEARCH "AbymÜvb\n" IDS_ABOUT_EXPLORER "&we¯—viK m¤ú©‡K..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "You have selected more than one program.\nAre you sure you want to launch all of them?" IDS_DESKTOPBAR_SETTINGS "‡W¯‹Uc wbqš¿b" IDS_DESKTOP "‡W¯‹Uc" diff --git a/reactos/base/shell/explorer/explorer-cn-msvc.rc b/reactos/base/shell/explorer/explorer-cn-msvc.rc index 5ce78eeafd5ed8daf58870946fe336ede7257be5..9d05f73be34ed907ae59d8a1006ed19119d55bbf 100644 GIT binary patch delta 613 zcmbQXk8!cegn5j-6X)5n@p3WnGVo4(P^184DKlg;q%ov0qyk9=hIoc>22Tb*24e;z zkebN_jA@L#ldmxv07*6`C3c8buE~Z>(gnRX^OGpYGA zGfA5CClpiK5;du`O{fpr2WiEZz9{%2_$G+7z6e55K?7CLK2$2S(7L|8W_iv&ci(%? zou7JB!r|U??mcI(z4qE`t-b#C`RKzTW?kCAZ#5^7ZByjwnfg1e6TxKQF@H|LJXcS&e+%#UK) z9ryp%W&GO(r>+0Pxi0iQutY03B8#`pMrU%1VQ1%(P=yhl^wa=n?(i8D3JuBVhU5&* zMuqxAejfO)3cX80Pk5ptJkcXhmHd-6nPX;qmwYoL%pCA`%2mHWs`_6g`Ilov+KvdU z5xFkAXX@`&*SjxCZ+FQrTG?~))^^u08gygQ%aDiVF1^18SbIGzc%<0DxTigjfcvz3 z_6pWx0XB?Z`Nv>}*j$r*2YM56cd7ZpUBm;v>leCB3C>8 z?4)UHV~A04*GoSh)!zG7&^t67^BmM}|KEQ3wbA(r#b8%K46w9&2-7*?F)gZN(A9jG@Co{dwR$obhe=CJ>+GEROYH}wOVgrN?{`0P>)68n_g|p*0Z+yJamRWelbO>sWWYHbPjvqS&y9GNkoc}y2+PMFxp8ItE(^P9;iiVH;=DGO^AfgT6D(st${>W;d zl3y9r>cCosYRnuKNsrr8c>Wgle7~yw(jPO}tUr?kmio%=$lmpJ=Gt6muqSKcJ7U|6EO}AH zQqZ+TMzGpf5(!yp^y60-j-F%f#d6A9`E6C;tQ;L19cyc!j2D{{dn#O)4Te!59f|p% z`pW1lk9~G=egce$V&q|@Sm32X;~}qo(^A#Ex8?h&Yi%(lt8j9awp=EJlPbbHP_UCY zsW#)L-@W|C^RLcs^%gPKT%*-$Gh!U1(Vl%`k)_8~Y!1urGv8gTzkB)lEBmLu{E*qN z`F*B)nii=X^|Gmc4{@-NW0P4(uF~^SmDce3ZnsbP5G%Z=qvqx72X~yg^wJwoe>ic2 z_bKvxB$X*5DC&_9cv(l%t1?T2;%5)bRY)V7)tFQdJ%98ZlD%&Jwo6w}@9=&azIsfy zwQuc#=sTH!7=4TK2iomw{r0&{?!EfIU(DAkvHqD`##OA(YfrB*uFlLsSe7AuX2m=t z8JEM7f0^@hVs}j@iOS=V60^lWMN6{E_INM3Uw*+^+$R&E*&Z@gJXdmE5^=Y2UyoklO*S| zUqzUOF6p%_y)DZ8FA5jT`a3oGC!M!r9-*cFkM_{)lg|1EKd)N_QkUfFHv98EestDj zK0Z&3{mo~e&|*704qt7F8?n9JLTzxFln*(tNzW-{vyyqocO<4VB3QwF(9E#PJ9jze zWUJ>@Xq9dYr(Ay&j`;Z}{%k(VXH&1_YIe)1{T zBfM1d*5(<>qt1v7ANKS^%IL2wJaSUzc2Vve^>=m#eJ8mXqECAR>R|=)v|8HjQ*euy z{B3?F8F!k3tbV&?UXZQ<=>duh%U`j!avMhggSi^jq7VRp=((l`hi*0k=0 z|4N=m?Hk@R{o3tmlh&`QKZm>~LsJjB2c)mYxgV1L$-Xv!BCdn+$jPx;{yCAwtj6U| znj;jmP*bO6dCcoyvWCf;Kzk_AI70qK!baps$24h?#iZ=kOQPhr``-G_cob!b;^&7%!z}t1 z4Yzu_v?60$kg;`nyQyk2POIqnojRX5F_0uRh^)^2gA1A()wD?ZQ6A`l8wZexP^Nw&2t4 zWsQHpBd&2R?xIx+)K>w=qD-OA)nBm~Qz+G}!K^OWzT4!A-WxTQ+LaaQF+DdL#j-k{ z@Ls6DfExb8>RFkexr`6Lwt9@dSE8}3{c7l@5z$L^v17IVj&FX?3h$IeLbdL$B(-JK z;T@C@=L2#Ns~6j-R zkgCnLij}!R?3y&pe9Mo~QAx2$KF4HS)Bv6qtXT)FM~f}65>kKHFH$n?rJYf|85SL$$djla~wM7yX>hs~1M0nIhW7EgyQOLA&(mqQ6=Yfffsu>dvH2Z~$C zA3rs^{mQ8tbh-3MMxXG8aZ5gTps_lKJGw-7V$-Y!MK&%&R`B3Di5lJBn_L++j2AX} ze{oUbh9&V4j~9@YRvzWYFDq!zZDL*E3!*_+qB-!Kl@f{cW-CBBpH30 zJB(xUDZ)H-4n<6RtOiZc9toEeU2EadPNIkEkCo8_DxC0M@dUbKG+$wyF`E7$=YuGI;qGIT@t|u_z7;FPxEf?8m_4T9E(M z*QyG)5U=K6qgB@HCWDP9LOhYka7=0#cN#atvDsPaXOZ_Lg3uTNjrl3~@#u~1UREqC zP%NSVJR%AjVOV}dK_h%!f`i60KCXy@W}H7sF@=0SCe#03{YSnY-SP$a)?vL_k5q?{_?CM(9?W0ZlZMxyCBBYas~5f1tkrUC-Jw6t1AOhFUsG8~jmB^`P+tBAk1H=4Xehe~OUr`O}E0hvS(^gd#^xW+| z6f_5(%5q|n8aEL@$v zpArqVwh`{m%+%#;^D(ij>T-m+tTd0NE6=d3G>>KNvU#jA(eUK42D}wRELrz}w;vrg zNVbAD%VnvR+L)t?Tdzowu7d0tC+np7R9pY@bDM9@?l|*IebUz)P$?T`H_5h9ZBr4r z+7r?y3tb1A2W6{ zV@_Mi)I)@0HmiBLV{Xr$){LT!%qq}A8#sSt>_oNEv6tKY^v2Pdo!)Ac?f3&lxPZCR z{JM=(7HXb91-IxP zag7wFy-B4Y)dyj1c#Ln-7$oC~UxgHHKkmVLijLMg&ybVAw!KUMzwAfm{W%pc>DF7eZ+Z%CeEuQI)R~82XJ@<)RuIkiW2sTG zWOq6939Fo`l*98FU(&bg-LtPFc}oXx1cHvxFR}k(eW~9QtB|4Rc-1nH^J*Wl#?#f0 zKr?=iL$$kBF-%<}??VEAplyrBDX1gr7mbd`9X?OoEv#p<9<)j}`+OXJx;7%)f?Cn^ zxI#{}-i%sGeTyn)BdGs>dQpw4Rj7u!omY!qR2YU-ZjWMNT(&bPwzeF$Qi?Ukqpnje z(L*MgY5UK1v2_NW!qt2A_8W&m=A>UfyXA|8#!s$c%?hWTI0n05w|C9hSkLGq{gG{*f|oXP`DFBE8?;3 zvQWy7oeQn7fimph(;UKB1ct&ayIW_@pW=NCag2By4t60t%6@@HTnx_E`WsJgZ!+`Q zs`~7B?04BEyD{v)WX{7~@peCZE<1Lu#z#X;K6%qlwq^3W+)@^J^C2MCL(4$ zCY~MKbAO95mffCnZ#@~OlKR>}(##{30Wls_7=OC>li4_&jg%Jt%km38HgVIpo zNZu|mbNSp{91e2IT7;xii4nF=eo6jd=6G#K6DT{SE%l*{E@{(vrBcSbNaNUq)CM

V^I5Pcj>yzGq6T zK6Z9K^&I=H|9J6-RsJ8S-u_XX66W8kw`jX_vQlC@UYhIq5Ki+^=+2oqE}^H`3Win> zD3rC;IITi@6Aj1mFkF(e(!1oo zD3yb8Na=TrB<&in%8qxX#9^qV!rprJ@e|u^Y|lTU#ioZw&s_P}sUmP#d9?aNqs8pf z(nE99`7pA(Wv#v9@=op7&*j5NM~u_$6$TOKIE=J^nna+p5TFUM>mo2L`X7T)6pw5s ZA%RtPmXA\r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "Reactos ä¯ÀÀÆ÷" IDS_START "¿ªÊ¼" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "¹ÜÀí¹¤¾ß" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "¿ªÊ¼²Ëµ¥" IDS_MINIMIZE_ALL "×îС»¯ËùÓд°¿Ú" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "ÖÕÖ¹ ROS ä¯ÀÀÆ÷" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "ÍøÂç" IDS_CONNECTIONS "ÍøÂçÁ¬½Ó" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "All Users\\" IDS_SEARCH "ËÑË÷" IDS_ABOUT_EXPLORER "¹ØÓÚä¯ÀÀÆ÷(&A)..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "ÇëÑ¡ÔñÒ»¸öÒÔÉϵÄÓ¦ÓóÌÐò¡£\nÈ·¶¨ÒªÔËÐÐÕâЩ³ÌÐòô£¿" IDS_DESKTOPBAR_SETTINGS "×ÀÃæÉèÖÃ" IDS_DESKTOP "×ÀÃæ" diff --git a/reactos/base/shell/explorer/explorer-cz.rc b/reactos/base/shell/explorer/explorer-cz.rc index 5140d27323d..10bd4eb51a3 100644 --- a/reactos/base/shell/explorer/explorer-cz.rc +++ b/reactos/base/shell/explorer/explorer-cz.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU PRELOAD DISCARDABLE +IDM_MDIFRAME MENU PRELOAD DISCARDABLE BEGIN POPUP "&Soubor" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU PRELOAD DISCARDABLE +IDM_SDIFRAME MENU PRELOAD DISCARDABLE BEGIN POPUP "&Soubor" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Hledat program v nabídce Start" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filtr:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Vyhledat",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Prosím zvolte si zpùsob zarovnání ikon:",IDC_STATIC,7,7, 166,8 - CONTROL "vlevo/n. d.",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "vlevo/n. d.",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "vlevo/n. p.",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "vlevo/n. p.",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "vpravo/n. l.",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "vpravo/n. l.",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "vpravo/d. d.",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "vpravo/d. d.",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "vlevo/dole n.",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "vlevo/dole n.",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "vlevo/dole p.",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "vlevo/dole p.",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "vpravo/d. l.",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "vpravo/d. l.",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "vpravo/d. n.",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "vpravo/d. n.",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "na okraji d.",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "na okraji d.",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "na okraji",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "na okraji",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "dokola",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "dokola",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Zobrazit verzi",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Vlastnosti panelu úloh" FONT 8, "MS Sans Serif" BEGIN - CONTROL "&Zobrazit èas",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "&Zobrazit èas",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&Skrýt neaktivní ikony", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Upozornìní...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Nastavení ikon v oblasti upozoròování" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Text popisku:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Cesta:",IDC_LABEL3,7,81,80,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Zobrazení",IDC_LABEL4,7,96,157,28 - CONTROL "z&obrazit",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "z&obrazit",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,45,10 CONTROL "&skrýt",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,104,108,55,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Poslední zmìna:",IDC_LABEL6,7,132,60,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "zob&razit skryté",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,158,57,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "&Otevírat složky v novém oknì", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Toto nastavení bude použito jako výchozí pro všechna okna Prùzkumníka.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Prùzkumník" IDS_START "Start" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Systémové nástroje" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Nabídka Start" IDS_MINIMIZE_ALL "minimalizovat všechna okna" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Ukonèit ReactOS Prùzkumníka" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Sí" IDS_CONNECTIONS "Síové spojení" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "Všichni uživatelé\\" IDS_SEARCH "Hledat" IDS_ABOUT_EXPLORER "&O Prùzkumníku" - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Bylo vybráno více programù.\nPøejete si je spustit všechny?" IDS_DESKTOPBAR_SETTINGS "Nastavení plochy" IDS_DESKTOP "Plocha" diff --git a/reactos/base/shell/explorer/explorer-de.rc b/reactos/base/shell/explorer/explorer-de.rc index a0ef83c8028..4362991f061 100644 --- a/reactos/base/shell/explorer/explorer-de.rc +++ b/reactos/base/shell/explorer/explorer-de.rc @@ -29,7 +29,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Datei" BEGIN @@ -70,7 +70,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Datei" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -111,7 +111,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -124,7 +124,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -145,7 +145,7 @@ CAPTION "Ausf FONT 8, "MS Shell Dlg" BEGIN CONTROL "",101,"Static",SS_SIMPLE | SS_NOPREFIX,3,6,162,10 - CONTROL "Befehls&zeile:",-1,"Static",SS_LEFTNOWORDWRAP | + CONTROL "Befehls&zeile:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,18,60,10 EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL CONTROL "Als &Symbol",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, @@ -177,29 +177,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Bitte wählen Sie den gewünschten Platzierungs-Algorithmus für die Desktop-Icons aus:", IDC_STATIC,7,7,197,23 - CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,35,46,44 - CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,35,46,44 - CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,35,46,44 - CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,35,46,44 - CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,83,46,44 - CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,83,46,44 - CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,83,46,44 - CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,83,46,44 - CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,131,46,44 - CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,131,46,44 - CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,131,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,131,46,44 // CONTROL "Anzeige der &Versionsnummer",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,187,107,10 @@ -220,7 +220,7 @@ BEGIN CONTROL "Anzeigen der &Uhr",ID_SHOW_CLOCK,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,152,71,10 CONTROL "&verstecke inaktive Notification-Icons", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,131,10 PUSHBUTTON "&Notifications...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -240,7 +240,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Öffne Unterverzeichnisses in &neuen Fenstern", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,157,10 LTEXT "Diese Auswahl wird künftig für alle Explorer-Fenster verwendet werden.", IDC_STATIC,7,111,174,22 @@ -249,13 +249,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Konfiguration der Benachrichtigungs-Icons" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Tooltip-Text:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -264,7 +264,7 @@ BEGIN LTEXT "&Modulpfad:",IDC_LABEL3,7,81,36,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Anzeigemodus",IDC_LABEL4,7,96,157,28 - CONTROL "&zeigen",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&zeigen",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,37,10 CONTROL "&verstecken",IDC_NOTIFY_HIDE,"Button", BS_AUTORADIOBUTTON,55,108,51,10 @@ -272,7 +272,7 @@ BEGIN BS_AUTORADIOBUTTON,110,108,54,10 ICON "",IDC_PICTURE,173,101,20,20 LTEXT "&Letzte Änderung:",IDC_LABEL6,7,132,55,8 - EDITTEXT IDC_LAST_CHANGE,66,129,98,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,66,129,98,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "zei&ge versteckte",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,68,10 @@ -281,7 +281,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Programmsuche im Startmenü" @@ -289,8 +289,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,96,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "Alle über&prüfen",IDC_CHECK_ENTRIES,138,7,55,14 END @@ -302,12 +302,12 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""resource.h""\r\n" "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" @@ -316,7 +316,7 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" @@ -330,7 +330,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Start" @@ -350,7 +350,7 @@ BEGIN IDS_ADMIN "Verwaltung" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmenü" IDS_MINIMIZE_ALL "alle Fenster minimieren" @@ -368,7 +368,7 @@ BEGIN IDS_TERMINATE "ROS Explorer beenden" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Netzwerk" IDS_CONNECTIONS "Netzwerk-Verbindungen" @@ -382,7 +382,7 @@ BEGIN IDS_ALL_USERS "Alle Benutzer\\" IDS_SEARCH "Suche" IDS_ABOUT_EXPLORER "&Über Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Sie haben mehrere Programme ausgewählt.\nSind Sie sicher, daß sie diese alle starten wollen?" IDS_DESKTOPBAR_SETTINGS "Desktop-Einstellungen" IDS_DESKTOP "Desktop" diff --git a/reactos/base/shell/explorer/explorer-en.rc b/reactos/base/shell/explorer/explorer-en.rc index 14d2756fd80..93a8ae46866 100644 --- a/reactos/base/shell/explorer/explorer-en.rc +++ b/reactos/base/shell/explorer/explorer-en.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Search Program in Startmenu" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Check Entries",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Please select your prefered icon alignment algorithm:", IDC_STATIC,7,7,166,8 - CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "rig./bot. up",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "rig./bot. up",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Display &Version Number",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Taskbar Properties" FONT 8, "MS Sans Serif" BEGIN - CONTROL "show &clock",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "show &clock",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&hide inactive notification icons", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Notifications...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Configure Notification Icons" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Tooltip Text:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Module Path:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Display Mode",IDC_LABEL4,7,96,157,28 - CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&hide",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Last Change:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "sho&w hidden",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Open Subfolders in s&eparate windows", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "This setting will be used as default for all explorer windows in the future.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Start" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Administration" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmenu" IDS_MINIMIZE_ALL "minimize all windows" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Terminate ROS Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Network" IDS_CONNECTIONS "Network Connections" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "All Users\\" IDS_SEARCH "Search" IDS_ABOUT_EXPLORER "&About Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "You have selected more than one program.\nAre you sure you want to launch all of them?" IDS_DESKTOPBAR_SETTINGS "Desktop Settings" IDS_DESKTOP "Desktop" diff --git a/reactos/base/shell/explorer/explorer-es.rc b/reactos/base/shell/explorer/explorer-es.rc index 0913e6a5989..7e0805f3061 100644 --- a/reactos/base/shell/explorer/explorer-es.rc +++ b/reactos/base/shell/explorer/explorer-es.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Archivo" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Archivo" BEGIN @@ -145,7 +145,7 @@ BEGIN CONTROL "Orden:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3,18, 60,10 EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL - CONTROL "Como &Símbolo",214,"Button",BS_AUTOCHECKBOX | + CONTROL "Como &Símbolo",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,45,71,12 DEFPUSHBUTTON "&Aceptar",1,158,6,47,14 PUSHBUTTON "&Cancelar",2,158,23,47,14 @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Buscar Programa en el menu Inicio" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filtro:",IDC_STATIC,7,9,23,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Marcar Entradas",IDC_CHECK_ENTRIES,136,7,57,14 END @@ -188,15 +188,15 @@ BEGIN BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 CONTROL "derecha/abajo izquierda",IDC_ICON_ALIGN_6,"Button", BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "derecha/abajo",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "derecha/abajo",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "borde inferior",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "borde inferior",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "borde H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "borde H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "aproximado",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "aproximado",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Mostrar &Version",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Propiedades de la Barra de Tareas" FONT 8, "MS Sans Serif" BEGIN - CONTROL "Mostrar &Reloj",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "Mostrar &Reloj",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,56,10 CONTROL "&Ocultar iconos de notificacion inactivos", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,136,10 PUSHBUTTON "&Notificaciones...",ID_CONFIG_NOTIFYAREA,145,173,64,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Configurar Iconos de Notificaciones" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Texto de Info:",IDC_LABEL1,8,44,51,8 EDITTEXT IDC_NOTIFY_TOOLTIP,82,42,117,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Parche del Módulo:",IDC_LABEL3,8,81,65,8 EDITTEXT IDC_NOTIFY_MODULE,82,78,117,14,ES_AUTOHSCROLL GROUPBOX "Modo de &Display",IDC_LABEL4,7,96,157,28 - CONTROL "&Mostrar",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&Mostrar",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,38,10 CONTROL "&Ocultar",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON, 66,108,36,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,50,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "Último cambio:",IDC_LABEL6,7,132,50,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "Mostrar Ocu<os",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,64,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Open Subfolders in s&eparate windows", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Esta configuración se usará por defecto y apartir de ahora para todas las ventanas del explorador.", IDC_STATIC,7,111,174,22 @@ -284,18 +284,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -309,7 +309,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Inicio" @@ -329,7 +329,7 @@ BEGIN IDS_ADMIN "Administracion" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Menú Inicio" IDS_MINIMIZE_ALL "Mimimizar todas las ventanas" @@ -347,7 +347,7 @@ BEGIN IDS_TERMINATE "Finalizar ROS Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Red" IDS_CONNECTIONS "Conexiones de Red" @@ -361,7 +361,7 @@ BEGIN IDS_ALL_USERS "Todos los Usuarios\\" IDS_SEARCH "Buscar" IDS_ABOUT_EXPLORER "&Acerca de Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Ha seleccionado más de un programa.\n¿Está seguro de que desea ejecutarlos todos?" IDS_DESKTOPBAR_SETTINGS "Configuracion del Escritorio" IDS_DESKTOP "Escritorio" diff --git a/reactos/base/shell/explorer/explorer-fr.rc b/reactos/base/shell/explorer/explorer-fr.rc index 28800109b63..0df5d819453 100644 --- a/reactos/base/shell/explorer/explorer-fr.rc +++ b/reactos/base/shell/explorer/explorer-fr.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Fichier" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Fichier" BEGIN @@ -145,7 +145,7 @@ BEGIN CONTROL "&Commande:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3, 18,60,10 EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL - CONTROL "Comme &Symbole",214,"Button",BS_AUTOCHECKBOX | + CONTROL "Comme &Symbole",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,45,71,12 DEFPUSHBUTTON "&OK",1,158,6,47,14 PUSHBUTTON "&Annuler",2,158,23,47,14 @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Rechercher un programme dans le menu démarrer" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filtre:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Rechercher",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -190,13 +190,13 @@ BEGIN BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 CONTROL "droite/bas bas",IDC_ICON_ALIGN_7,"Button", BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "haut vers bas",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "haut vers bas",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "bord H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "bord H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "faire le tour",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "faire le tour",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Afficher le numéro de la &version",ID_DESKTOP_VERSION, // "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,177,120,10 @@ -210,7 +210,7 @@ BEGIN CONTROL "Afficher l'&heure",ID_SHOW_CLOCK,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,152,70,10 CONTROL "&Masquer les icônes inactives", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Notifications...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Configurer les Icônes de Notification" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Texte conseil:",IDC_LABEL1,7,44,70,8 EDITTEXT IDC_NOTIFY_TOOLTIP,79,42,122,14,ES_AUTOHSCROLL @@ -238,14 +238,14 @@ BEGIN LTEXT "&Repertoire du module:",IDC_LABEL3,7,81,71,8 EDITTEXT IDC_NOTIFY_MODULE,79,78,123,14,ES_AUTOHSCROLL GROUPBOX "&Mode d'affichage",IDC_LABEL4,7,96,174,28 - CONTROL "&afficher",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&afficher",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,108,35,10 CONTROL "&cacher",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,51,108,34,10 CONTROL "&cacher automatiquement",IDC_NOTIFY_AUTOHIDE,"Button", BS_AUTORADIOBUTTON,89,108,91,10 ICON "",IDC_PICTURE,183,101,21,20 LTEXT "&Dernier changement:",IDC_LABEL6,7,132,69,8 - EDITTEXT IDC_LAST_CHANGE,77,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,77,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "Afficher les cac&hés",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,70,10 @@ -268,7 +268,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Ouvrir les sous-dossiers dans des fenêtres s&éparées", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Ce paramètre sera utilisé par défaut.",IDC_STATIC,7,111, 174,22 @@ -298,18 +298,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -323,7 +323,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Démarrer" @@ -343,7 +343,7 @@ BEGIN IDS_ADMIN "Administration" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Menu démarrer" IDS_MINIMIZE_ALL "Mimimiser toutes les fenêtres" @@ -361,7 +361,7 @@ BEGIN IDS_TERMINATE "Fermer ROS Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Réseaux" IDS_CONNECTIONS "Connections réseau" @@ -375,7 +375,7 @@ BEGIN IDS_ALL_USERS "Tous les utilisateurs\\" IDS_SEARCH "Rechercher" IDS_ABOUT_EXPLORER "&À propos de l'explorateur..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Vous avez sélectionné plus d'un programme.\nÊtes-vous sûr de vouloir tous les lancer?" IDS_DESKTOPBAR_SETTINGS "Paramètres du bureau" IDS_DESKTOP "Bureau" diff --git a/reactos/base/shell/explorer/explorer-hu.rc b/reactos/base/shell/explorer/explorer-hu.rc index 333e5c693ec..538bd8cf662 100644 --- a/reactos/base/shell/explorer/explorer-hu.rc +++ b/reactos/base/shell/explorer/explorer-hu.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Search Program in Startmenu" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Check Entries",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Please select your prefered icon alignment algorithm:", IDC_STATIC,7,7,166,8 - CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Display &Version Number",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Taskbar Properties" FONT 8, "MS Sans Serif" BEGIN - CONTROL "show &clock",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "show &clock",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&hide inactive notification icons", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Notifications...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Configure Notification Icons" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Tooltip Text:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Module Path:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Display Mode",IDC_LABEL4,7,96,157,28 - CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&hide",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Last Change:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "sho&w hidden",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Open Subfolders in s&eparate windows", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "This setting will be used as default for all explorer windows in the future.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Start" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Felügyelet" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmenu" IDS_MINIMIZE_ALL "mimimize all windows" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Kilépés a ROS Explorerbõl" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Hálózat" IDS_CONNECTIONS "Hálózati kapcsolatok" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "All Users\\" IDS_SEARCH "Keresés" IDS_ABOUT_EXPLORER "Az &Explorer névjegye..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Több programot választottál ki.\nBiztosan szeretnéd mindegyiket futtatni?" IDS_DESKTOPBAR_SETTINGS "Asztal beállításai" IDS_DESKTOP "Asztal" diff --git a/reactos/base/shell/explorer/explorer-id.rc b/reactos/base/shell/explorer/explorer-id.rc index ad0e361ab8e..651fcf3266c 100644 --- a/reactos/base/shell/explorer/explorer-id.rc +++ b/reactos/base/shell/explorer/explorer-id.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Cari Program dalam Startmenu" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Periksa Entri",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Silahkan pilih algoritma penajajran ikon yang disukai:", IDC_STATIC,7,7,166,8 - CONTROL "kiri/atas bwh",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "kiri/atas bwh",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "kiri/atas kanan",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "kiri/atas kanan",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "kanan/atas kiri",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "kanan/atas kiri",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "kanan/atas bwh",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "kanan/atas bwh",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "kiri/bwh atas",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "kiri/bwh atas",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "kiri/bwh kanan",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "kiri/bwh kanan",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "kanan/bwh kiri",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "kanan/bwh kiri",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "kanan/bwh turun",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "kanan/bwh turun",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "batas turun",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "batas turun",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "batas H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "batas H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "berputar",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "berputar",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Tampilkan Nomor &Versi",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Properti Taskbar" FONT 8, "MS Sans Serif" BEGIN - CONTROL "tampilkan &jam",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "tampilkan &jam",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&sembunyikan ikon pemberitahuan tidak aktif", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Pemberitahuan...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Konfigurasi Ikon Pemberitahuan" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "Teks &Tooltip:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "Path &Modul:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "Mode Tampi&lan",IDC_LABEL4,7,96,157,28 - CONTROL "&tampil",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&tampil",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&sembunyi",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "Perubahan Terakhir:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "tampil tersemunyi",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Open Subfolder dalam jendela t&erpisah", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Setelan ini akan digunakan sebagai standar untuk semua jendela explorer nantinya.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Mulai" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Administrasi" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmenu" IDS_MINIMIZE_ALL "kecilkan semua jendela" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Akhiri ROS Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Jaringan" IDS_CONNECTIONS "Koneksi Jaringan" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "Semua Pengguna\\" IDS_SEARCH "Cari" IDS_ABOUT_EXPLORER "Tent&ang Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Anda telah memilih lebih dari satu program.\nAnda yakin ingin menjalankan semuanya?" IDS_DESKTOPBAR_SETTINGS "Setelan Desktop" IDS_DESKTOP "Desktop" diff --git a/reactos/base/shell/explorer/explorer-it.rc b/reactos/base/shell/explorer/explorer-it.rc index 6a0c39ce0e1..9955e885538 100644 --- a/reactos/base/shell/explorer/explorer-it.rc +++ b/reactos/base/shell/explorer/explorer-it.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL // Menu // -IDM_MDIFRAME MENU +IDM_MDIFRAME MENU BEGIN POPUP "&File" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU +IDM_DESKTOPBAR MENU BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU +IDM_VOLUME MENU BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU +IDM_NOTIFYAREA MENU BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU +IDM_SDIFRAME MENU BEGIN POPUP "&File" BEGIN @@ -263,18 +263,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -288,7 +288,7 @@ END // String Table // -STRINGTABLE +STRINGTABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Start" @@ -308,7 +308,7 @@ BEGIN IDS_ADMIN "Amministrazione" END -STRINGTABLE +STRINGTABLE BEGIN IDS_STARTMENU "Menu avvio" IDS_MINIMIZE_ALL "Minimizza tutte le finestre" @@ -326,7 +326,7 @@ BEGIN IDS_TERMINATE "Termina ReactOS Explorer" END -STRINGTABLE +STRINGTABLE BEGIN IDS_NETWORK "Rete" IDS_CONNECTIONS "Connessioni di rete" @@ -340,7 +340,7 @@ BEGIN IDS_ALL_USERS "Tutti gli utenti\\" IDS_SEARCH "Cerca" IDS_ABOUT_EXPLORER "&Informazioni su Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Hai selezionato più di un programma.\nSei sicuro di volerli eseguire tutti?" IDS_DESKTOPBAR_SETTINGS "Impostazioni del Desktop" IDS_DESKTOP "Desktop" diff --git a/reactos/base/shell/explorer/explorer-jp.rc b/reactos/base/shell/explorer/explorer-jp.rc index f077ff03ae8..18c4b2a023d 100644 --- a/reactos/base/shell/explorer/explorer-jp.rc +++ b/reactos/base/shell/explorer/explorer-jp.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "ƒtƒ@ƒCƒ‹(&F)" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "ƒtƒ@ƒCƒ‹(&F)" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "ƒXƒ^[ƒgƒƒjƒ…[‚©‚çƒvƒƒOƒ‰ƒ€‚ðŒŸõ" @@ -161,8 +161,8 @@ FONT 9, "MS UI Gothic", 0, 0, 0x1 BEGIN LTEXT "ƒtƒBƒ‹ƒ^(&F):",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "“o˜^‚ðƒ`ƒFƒbƒN‚·‚é(&C)",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 9, "MS UI Gothic" BEGIN LTEXT "Žg—p‚µ‚½‚¢ƒAƒCƒRƒ“‚Ì”z’u‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢:", IDC_STATIC,7,7,166,8 - CONTROL "¶ã‚©‚牺‚Ö",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "¶ã‚©‚牺‚Ö",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "¶ã‚©‚ç‰E‚Ö",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "¶ã‚©‚ç‰E‚Ö",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "‰Eã‚©‚綂Ö",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "‰Eã‚©‚綂Ö",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "‰Eã‚©‚牺‚Ö",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "‰Eã‚©‚牺‚Ö",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "¶‰º‚©‚çã‚Ö",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "¶‰º‚©‚çã‚Ö",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "¶‰º‚©‚ç‰E‚Ö",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "¶‰º‚©‚ç‰E‚Ö",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "‰E‰º‚©‚綂Ö",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "‰E‰º‚©‚綂Ö",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "‰E‰º‚©‚牺‚Ö",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "‰E‰º‚©‚牺‚Ö",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "¶‰E‚ð‰º‚Ö",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "¶‰E‚ð‰º‚Ö",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "ã‚ƶ‰E‚Ì’[",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "ã‚ƶ‰E‚Ì’[",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "—Ö‚É‚È‚é‚悤‚É",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "—Ö‚É‚È‚é‚悤‚É",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "ƒfƒXƒNƒgƒbƒv‚Ƀo[ƒWƒ‡ƒ“‚ð•\\Ž¦‚·‚é(&V)",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "ƒ^ƒXƒN ƒo[‚̃vƒƒpƒeƒB" FONT 9, "MS UI Gothic" BEGIN - CONTROL "ŽžŒv‚ð•\\Ž¦‚·‚é(&C)",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "ŽžŒv‚ð•\\Ž¦‚·‚é(&C)",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "ƒAƒNƒeƒBƒu‚Å‚È‚¢’Ê’mƒAƒCƒRƒ“‚ð‰B‚·(&H)", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "’Ê’mƒAƒCƒRƒ“(&N)...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "’Ê’mƒAƒCƒRƒ“‚ÌÝ’è" FONT 9, "MS UI Gothic", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "ƒc[ƒ‹ ƒ`ƒbƒv‚Ì“à—e(&T):",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "ƒ‚ƒWƒ…[ƒ‹‚ÌêŠ(&M):",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "•\\Ž¦ƒ‚[ƒh(&D)",IDC_LABEL4,7,96,157,28 - CONTROL "•\\Ž¦‚·‚é(&S)",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "•\\Ž¦‚·‚é(&S)",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "‰B‚·(&H)",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "ÅI•ÏX(&L):",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "‰B‚ꂽƒAƒCƒRƒ“‚à•\\Ž¦(&W)",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "ƒTƒuƒtƒHƒ‹ƒ_‚ðV‚µ‚¢ƒEƒBƒ“ƒhƒE‚ÅŠJ‚­(&E)", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "‚±‚ê‚æ‚肱‚Ìݒ肪A‚·‚×‚Ä‚Ì Explorer ƒEƒBƒ“ƒhƒE‚̃fƒtƒHƒ‹ƒg‚É‚È‚è‚Ü‚·B", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "½À°Ä" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "ŠÇ—ƒc[ƒ‹" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "ƒXƒ^[ƒgƒƒjƒ…[" IDS_MINIMIZE_ALL "‘SƒEƒBƒ“ƒhƒE‚ðŬ‰»" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "ROS Explorer ‚ðI—¹‚·‚é" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "ƒlƒbƒgƒ[ƒN" IDS_CONNECTIONS "ƒlƒbƒgƒ[ƒNÚ‘±" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "All Users\\" IDS_SEARCH "ŒŸõ" IDS_ABOUT_EXPLORER "Explorer ‚ɂ‚¢‚Ä(&A)..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "“ñ‚ˆÈã‚̃vƒƒOƒ‰ƒ€‚ª‘I‘ð‚³‚ê‚Ü‚µ‚½B\n‚·‚ׂẴvƒƒOƒ‰ƒ€‚ðŽÀs‚µ‚Ü‚·‚©?" IDS_DESKTOPBAR_SETTINGS "ƒfƒXƒNƒgƒbƒv‚ÌÝ’è" IDS_DESKTOP "ƒfƒXƒNƒgƒbƒv" diff --git a/reactos/base/shell/explorer/explorer-nl.rc b/reactos/base/shell/explorer/explorer-nl.rc index f79413c2371..cd929591062 100644 --- a/reactos/base/shell/explorer/explorer-nl.rc +++ b/reactos/base/shell/explorer/explorer-nl.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL // Vertaald door Lionel Lowie // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Bestand" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,10 +87,10 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" - BEGIN + BEGIN MENUITEM "&Verborgen Pictogrammen weergeven", ID_SHOW_HIDDEN_ICONS MENUITEM "Show Icon &Button", ID_SHOW_ICON_BUTTON MENUITEM "&Meldingen aanpassen...", ID_CONFIG_NOTIFYAREA @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Bestand" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Zoek programma in startmenu" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Check Entries",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Kies uw gewenste pictogrammenuitlijn-algorithme:", IDC_STATIC,7,7,166,8 - CONTROL "Links/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "Links/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "Links/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "Links/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "Rechts/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "Rechts/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "Links/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "Links/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "Links/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "Links/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "Rechts/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "Rechts/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "Rondom",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "Rondom",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "&Versienummer weergeven",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Taakbalk Eigenschappen" FONT 8, "MS Sans Serif" BEGIN - CONTROL "&Klok Weergeven",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "&Klok Weergeven",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&Inactieve Meldingspictogrammen Verbergen", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Meldingen...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Configure Notification Icons" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Tooltip Text:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Module Path:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Display Mode",IDC_LABEL4,7,96,157,28 - CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&show",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&hide",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Last Change:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "sho&w hidden",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Submappen openen in afzonderlijke vensters", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Deze instelling zal in de toekomst als standaard gebruikt worden voor alle Explorer-vensters.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "Reactos Explorer" IDS_START "Start" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Administratie" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmenu" IDS_MINIMIZE_ALL "Alle vensters minimaliseren" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "ROS Explorer Afsluiten" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Netwerk" IDS_CONNECTIONS "Netwerkverbindingen" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "Alle Gebruikers\\" IDS_SEARCH "Zoeken" IDS_ABOUT_EXPLORER "&Over Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "U heeft meer dan één programma geselecteerd.\nWeet u zeker dat u ze allemaal wilt starten?" IDS_DESKTOPBAR_SETTINGS "Bureaublad instellingen" IDS_DESKTOP "Bureaublad" diff --git a/reactos/base/shell/explorer/explorer-no.rc b/reactos/base/shell/explorer/explorer-no.rc index a0425968772..b904592783f 100644 --- a/reactos/base/shell/explorer/explorer-no.rc +++ b/reactos/base/shell/explorer/explorer-no.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Fil" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Fil" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Søk Programmer i Start meny" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Søk",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Velg hvordan ikon skal arrangeres på skrivebordet:", IDC_STATIC,7,7,166,8 - CONTROL "V/topp ned",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "V/topp ned",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "V/topp høyre",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "V/topp høyre",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "H/topp vnstr",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "H/topp vnstr",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "H/topp ned",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "H/topp ned",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "V/bunn opp",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "V/bunn opp",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "V/bunn høyre",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "V/bunn høyre",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "H/bunn vnstr",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "H/bunn vnstr",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "H/bunn opp",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "H/bunn opp",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "Kanter ned",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "Kanter ned",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "Kanter vinkel",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "Kanter vinkel",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "Rundt",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "Rundt",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Vis &versjonsummer",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Egenskaper for Oppgavelinje" FONT 8, "MS Sans Serif" BEGIN - CONTROL "Vis &klokken",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "Vis &klokken",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&Skjul inaktive notifikasjoner", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Notifikasjoner...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Konfigurer justering av ikoner" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Verktøylinje Tekst:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Modul Mappe:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Skjerm modus",IDC_LABEL4,7,96,157,28 - CONTROL "&vis",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&vis",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&skjul",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Sist endret:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "V&is skjulte",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Åpne undermapper i s&eparate vinduer", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Denne innstillingen vil bli brukt som standard for alle explorer-vinduer i fremtiden.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Start" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Administrasjon" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Start meny" IDS_MINIMIZE_ALL "minimalisere alle vinduer" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Avslutte ROS Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Nettverk" IDS_CONNECTIONS "Nettverk tilkoblinger" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "Alle brukere\\" IDS_SEARCH "Søk" IDS_ABOUT_EXPLORER "&Om Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Du har valgt mer enn et program.\nEr du sikker på at du vil kjøre alle på en gang?" IDS_DESKTOPBAR_SETTINGS "Skrivebord Innstillinger" IDS_DESKTOP "Skrivebord" diff --git a/reactos/base/shell/explorer/explorer-pl.rc b/reactos/base/shell/explorer/explorer-pl.rc index 37c88e3d1f6..80f0561c88e 100644 --- a/reactos/base/shell/explorer/explorer-pl.rc +++ b/reactos/base/shell/explorer/explorer-pl.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Plik" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Plik" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Szukaj programu w Menu Start" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filtry:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Szukaj nazwy",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Wybierz sposób uk³adania ikon:", IDC_STATIC,7,7,166,8 - CONTROL "lewy/gór w dó³",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "lewy/gór w dó³",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "lewy/gór w prw",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "lewy/gór w prw",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "prwy/gór w lewo",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "prwy/gór w lewo",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "prwy/gór w dó³",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "prwy/gór w dó³",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "lewy/dol.w gór",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "lewy/dol.w gór",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "lewy/dol.w praw",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "lewy/dol.w praw",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "prwy/dol.w lewo",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "prwy/dol.w lewo",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "prwy/dol.w gór",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "prwy/dol.w gór",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "obustr. w dó³",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "obustr. w dó³",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "na brzegach",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "na brzegach",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "dooko³a",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "dooko³a",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Wyœwietlaj &numer wersji",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "W³aœciwoœci paska zadañ" FONT 8, "MS Sans Serif" BEGIN - CONTROL "Poka¿ &zegar",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "Poka¿ &zegar",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&Ukrywaj nieaktywne ikony", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Dostosuj",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Konfiguracja ikon powiadomieñ" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&PodpowiedŸ:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "Œcie¿ka:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Sposób wyœwietlania",IDC_LABEL4,7,96,157,28 - CONTROL "&widoczny",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&widoczny",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&ukryty",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Zmodyfikowany:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "Po&ka¿ wszystkie",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "&Otwieraj podkatalogi w nowych oknach", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Te opcje bêd¹ stosowane w przysz³oœci do wszystkich okien.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Start" @@ -343,7 +343,7 @@ BEGIN IDS_ADMIN "Administracja" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Menu Start" IDS_MINIMIZE_ALL "Minimalizuj wszystko" @@ -361,7 +361,7 @@ BEGIN IDS_TERMINATE "Zakoñcz dzia³anie ReactOS Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Sieæ" IDS_CONNECTIONS "Po³¹czenia sieciowe" @@ -375,7 +375,7 @@ BEGIN IDS_ALL_USERS "Wszyscy\\" IDS_SEARCH "Szukaj" IDS_ABOUT_EXPLORER "ReactOS Explorer - &informacje" - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Zaznaczy³eœ wiêcej ni¿ jeden program.\nCzy chcesz uruchomiæ je jednoczeœnie?" IDS_DESKTOPBAR_SETTINGS "W³aœciwoœci pulpitu" IDS_DESKTOP "Pulpit" diff --git a/reactos/base/shell/explorer/explorer-pt.rc b/reactos/base/shell/explorer/explorer-pt.rc index 1b760a0719a..03df6f15cc2 100644 --- a/reactos/base/shell/explorer/explorer-pt.rc +++ b/reactos/base/shell/explorer/explorer-pt.rc @@ -30,12 +30,12 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""resource.h""\r\n" "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" @@ -44,7 +44,7 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" @@ -79,7 +79,7 @@ BEGIN CONTROL "Co&mando:",-1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,3, 18,60,10 EDITTEXT 201,3,29,134,12,ES_AUTOHSCROLL - CONTROL "Como &Símbolo",214,"Button",BS_AUTOCHECKBOX | + CONTROL "Como &Símbolo",214,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,45,71,12 DEFPUSHBUTTON "&OK",1,158,6,47,14 PUSHBUTTON "&Cancelar",2,158,23,47,14 @@ -92,7 +92,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "Explorador do ReactOS" IDS_START "Iniciar" @@ -112,7 +112,7 @@ BEGIN IDS_ADMIN "Administrar" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmenu" IDS_MINIMIZE_ALL "mimimize all windows" @@ -130,7 +130,7 @@ BEGIN IDS_TERMINATE "Terminar ROS Explorador" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Rede" IDS_CONNECTIONS "Conecções da rede" @@ -144,7 +144,7 @@ BEGIN IDS_ALL_USERS "Todos utilizadores\\" IDS_SEARCH "Procurar" IDS_ABOUT_EXPLORER "Sobre o Explorador..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "You have selected more than one program.\nAre you sure you want to launch all of them?" IDS_DESKTOPBAR_SETTINGS "Desktop Settings" IDS_DESKTOP "Desktop" diff --git a/reactos/base/shell/explorer/explorer-ro.rc b/reactos/base/shell/explorer/explorer-ro.rc index e65f2e833e3..5b7b25b6548 100644 --- a/reactos/base/shell/explorer/explorer-ro.rc +++ b/reactos/base/shell/explorer/explorer-ro.rc @@ -29,7 +29,7 @@ LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Fiºier" BEGIN @@ -70,7 +70,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Fiºier" BEGIN @@ -128,7 +128,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Începe" @@ -148,7 +148,7 @@ BEGIN IDS_ADMIN "Administrare" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmenu" IDS_MINIMIZE_ALL "mimimize all windows" @@ -166,7 +166,7 @@ BEGIN IDS_TERMINATE "Închide sesiunea" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Reþea" IDS_CONNECTIONS "Conecþii" @@ -180,7 +180,7 @@ BEGIN IDS_ALL_USERS "All Users\\" IDS_SEARCH "Cãutare..." IDS_ABOUT_EXPLORER "&Despre Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "You have selected more than one program.\nAre you sure you want to launch all of them?" IDS_DESKTOPBAR_SETTINGS "Desktop Settings" IDS_DESKTOP "Desktop" @@ -206,12 +206,12 @@ LANGUAGE LANG_ROMANIAN, SUBLANG_DEFAULT // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""resource.h""\r\n" "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" @@ -220,7 +220,7 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" diff --git a/reactos/base/shell/explorer/explorer-ru.rc b/reactos/base/shell/explorer/explorer-ru.rc index 8ed862c0fa8..4c52a335ae8 100644 --- a/reactos/base/shell/explorer/explorer-ru.rc +++ b/reactos/base/shell/explorer/explorer-ru.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Ïîèñê ïðîãðàìì â ìåíþ Ïócê" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Ôèëüòð:",IDC_STATIC,7,9,30,8 EDITTEXT IDC_FILTER,40,7,94,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Ïðîâåðèòü",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Âûáåðèòå, íàèáîëåå ïðåäïî÷òèòåëüíûé äëÿ âàñ, \nñïîñîá âûðàâíèâàíèÿ çíà÷êîâ", IDC_STATIC,7,7,195,18 - CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Ïîêàçûâàòü íîìåð &âåðñèè",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,109,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Ñâîéñòâà ïàíåëè çàäà÷" FONT 8, "MS Sans Serif" BEGIN - CONTROL "Îòîáðàæàòü &÷àñû",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "Îòîáðàæàòü &÷àñû",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,142,100,10 CONTROL "&Ñêðûâàòü íåèñïîëüçóåìûå çíà÷êè", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,157,133,10 PUSHBUTTON "&Óâåäîìëåíèÿ...",ID_CONFIG_NOTIFYAREA,133,173,70,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Êîíôèãóðàöèÿ çíà÷êîâ" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Òåêñò ïîäñêàçêè:",IDC_LABEL1,7,44,62,8 EDITTEXT IDC_NOTIFY_TOOLTIP,76,42,125,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Ïóòü ê ìîäóëþ:",IDC_LABEL3,7,81,54,8 EDITTEXT IDC_NOTIFY_MODULE,76,78,125,14,ES_AUTOHSCROLL GROUPBOX "&Ðåæèì îòîáðàæåíèÿ",IDC_LABEL4,7,96,169,28 - CONTROL "&ïîêàçàòü",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&ïîêàçàòü",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,47,10 CONTROL "&Ñêðûòü",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,41,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,60,10 ICON "",IDC_PICTURE,181,101,20,20 LTEXT "&Ïîñëåäíèå\nèçìåíåíèÿ",IDC_LABEL6,7,129,40,19 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "Ïîêà&çàòü ñêðûòîå",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,78,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Îòêðûâàòü ïîäïàïêè â î&òäåëüíûõ îêíàõ", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,155,10 LTEXT "Ýòè íàñòðîéêè áóäóò èñïîëüçîâàííû, êàê çíà÷åíèå ïî óìîë÷àíèþ äëÿ âñåõ îêîí ïðîâîäíèêà â äàëüíåéøåì.", IDC_STATIC,7,107,185,26 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "Ïðîâîäíèê ReactOS" IDS_START "Ïóñê" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Àäìèíèñòðèðîâàíèå" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Ìåíþ Ïóñê" IDS_MINIMIZE_ALL "Câåðíóòü âñå îêíà" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Çàâåðøèòü ðàáîòó Ïðîâîäíèêà" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Ñåòü" IDS_CONNECTIONS "Ñåòåâûå ïîäêëþ÷åíèÿ" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "Âñå ïîëüçîâàòåëè\\" IDS_SEARCH "Ïîèñê" IDS_ABOUT_EXPLORER "&Î Ïðîâîäíèêå" - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Âû âûáðàëè áîëåå îäíîé ïðîãðàììû.\nÂû óâåðåíû, ÷òî õîòèòå âûïîëíèòü èõ âñå?" IDS_DESKTOPBAR_SETTINGS "Íàñòðîéêè ðàáî÷åãî ñòîëà" IDS_DESKTOP "Ðàáî÷èé ñòîë" diff --git a/reactos/base/shell/explorer/explorer-sk.rc b/reactos/base/shell/explorer/explorer-sk.rc index b17e98fd7b7..824a6ab9907 100644 --- a/reactos/base/shell/explorer/explorer-sk.rc +++ b/reactos/base/shell/explorer/explorer-sk.rc @@ -36,7 +36,7 @@ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Súbor" BEGIN @@ -77,7 +77,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -88,7 +88,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -97,7 +97,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -110,7 +110,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Súbor" BEGIN @@ -163,7 +163,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "H¾ada program v ponuke Štart" @@ -171,8 +171,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Check Entries",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -184,29 +184,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Vyberte si prosím, vami uprednostòovaný spôsob zarovnania ikón:", IDC_STATIC,7,7,166,8 - CONTROL "z¾ava zhora dole",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "z¾ava zhora dole",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "z¾ava zhora vpravo",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "z¾ava zhora vpravo",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "zprava zhora v¾avo",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "zprava zhora v¾avo",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "zprava zhora dole",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "zprava zhora dole",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "z¾ava zdola hore",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "z¾ava zdola hore",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "z¾ava zdola vpravo",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "z¾ava zdola vpravo",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "zprava zdola v¾avo",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "zprava zdola v¾avo",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "zprava zdola hore",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "zprava zdola hore",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "po okrajoch dole",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "po okrajoch dole",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "po okrajoch H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "po okrajoch H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "dookola",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "dookola",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Zobrazi èíslo &verzie",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -217,10 +217,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Vlastnosti panela úloh" FONT 8, "MS Sans Serif" BEGIN - CONTROL "Zobrazi &hodiny",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "Zobrazi &hodiny",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&Skry neaktívne ikony", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Prispôsobi...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -233,13 +233,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Prispôsobenie oznamovacích ikón" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Text popisu:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -248,7 +248,7 @@ BEGIN LTEXT "&Cesta:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Zobrazenie",IDC_LABEL4,7,96,157,28 - CONTROL "z&obrazi",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "z&obrazi",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&skry",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -256,7 +256,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Posledná zmena:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "zo&brazi skryté",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -279,7 +279,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Otvára prieèinky v samostatných &oknách", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Toto nastavenie sa v budúcnosti použije ako predvolené pre všetké okná Priezkumníka.", IDC_STATIC,7,111,174,22 @@ -309,18 +309,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -334,7 +334,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Štart" @@ -354,7 +354,7 @@ BEGIN IDS_ADMIN "Administration" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Ponuka Štart" IDS_MINIMIZE_ALL "minimalizova všetké okná" @@ -372,7 +372,7 @@ BEGIN IDS_TERMINATE "Ukonèi ReactOS Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Sie" IDS_CONNECTIONS "Sieové pripojenia" @@ -386,7 +386,7 @@ BEGIN IDS_ALL_USERS "All Users\\" IDS_SEARCH "H¾ada" IDS_ABOUT_EXPLORER "È&o je Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Vybrali ste viac programov.\nPrajete si spusti ich všetky?" IDS_DESKTOPBAR_SETTINGS "Nastavenia plochy" IDS_DESKTOP "Pracovná plocha" diff --git a/reactos/base/shell/explorer/explorer-sv.rc b/reactos/base/shell/explorer/explorer-sv.rc index 52534115c13..1443472dea3 100644 --- a/reactos/base/shell/explorer/explorer-sv.rc +++ b/reactos/base/shell/explorer/explorer-sv.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -64,7 +64,7 @@ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Arkiv" BEGIN @@ -105,7 +105,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -116,7 +116,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -125,7 +125,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -138,7 +138,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Arkiv" BEGIN @@ -191,7 +191,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Sök program på startmenyn" @@ -199,8 +199,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Filter:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Kontrollera poster",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -212,29 +212,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Välj från vilket hörn och åt vilket håll du föredrar att rada upp ikonerna:", IDC_STATIC,7,7,166,8 - CONTROL "vä. och neråt",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "vä. och neråt",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "övre åt hö.",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "övre åt hö.",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "övre åt vä.",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "övre åt vä.",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "hö. och neråt",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "hö. och neråt",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "vä. och uppåt",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "vä. och uppåt",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "nedre åt hö.",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "nedre åt hö.",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "nedre åt vä.",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "nedre åt vä.",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "hö. och uppåt",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "hö. och uppåt",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "sidor och ner",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "sidor och ner",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "kanter",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "kanter",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "runt om",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "runt om",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "Visa &versionsnummer",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -245,7 +245,7 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Aktivitetsfältsinställningar" FONT 8, "MS Sans Serif" BEGIN - CONTROL "visa &klockan",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "visa &klockan",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "&Göm inaktiva meddelandeikoner",ID_HIDE_INACTIVE_ICONS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 @@ -260,13 +260,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Inställningar för meddelandeikoner" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Hjälptext:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -275,7 +275,7 @@ BEGIN LTEXT "&Modulsökväg:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Visningsläge",IDC_LABEL4,7,96,157,28 - CONTROL "v&isa",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "v&isa",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&dölj",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -283,7 +283,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Senast ändrad:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "visa d&olda",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -305,7 +305,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "Open Subfolders in s&eparate windows", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Den här inställningen kommer att gälla som standard i alla nya explorer-fönster.", IDC_STATIC,7,107,174,22 @@ -319,7 +319,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "Start" @@ -339,7 +339,7 @@ BEGIN IDS_ADMIN "Administration" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Startmeny" IDS_MINIMIZE_ALL "minimera alla fönster" @@ -357,7 +357,7 @@ BEGIN IDS_TERMINATE "Avsluta Explorer" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Nätverk" IDS_CONNECTIONS "Nätverksanslutningar" @@ -371,7 +371,7 @@ BEGIN IDS_ALL_USERS "Alla användare\\" IDS_SEARCH "Sök" IDS_ABOUT_EXPLORER "&Om Explorer..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Du har valt fler än ett program.\nÄr du säker på att du vill öppna dem alla?" IDS_DESKTOPBAR_SETTINGS "Skrivbordsinställningar" IDS_DESKTOP "Skrivbord" diff --git a/reactos/base/shell/explorer/explorer-uk.rc b/reactos/base/shell/explorer/explorer-uk.rc index 8314dcd048b..4e65e798464 100644 --- a/reactos/base/shell/explorer/explorer-uk.rc +++ b/reactos/base/shell/explorer/explorer-uk.rc @@ -26,7 +26,7 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT // Menu // -IDM_MDIFRAME MENU DISCARDABLE +IDM_MDIFRAME MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -67,7 +67,7 @@ BEGIN END END -IDM_DESKTOPBAR MENU DISCARDABLE +IDM_DESKTOPBAR MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -78,7 +78,7 @@ BEGIN END END -IDM_VOLUME MENU DISCARDABLE +IDM_VOLUME MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -87,7 +87,7 @@ BEGIN END END -IDM_NOTIFYAREA MENU DISCARDABLE +IDM_NOTIFYAREA MENU DISCARDABLE BEGIN POPUP "" BEGIN @@ -100,7 +100,7 @@ BEGIN END END -IDM_SDIFRAME MENU DISCARDABLE +IDM_SDIFRAME MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -153,7 +153,7 @@ BEGIN END IDD_SEARCH_PROGRAM DIALOGEX 0, 0, 200, 65 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Ïîøóê ïðîãðàìè â ìåíþ Ïóñê" @@ -161,8 +161,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "&Ô³ëüòð:",IDC_STATIC,7,9,18,8 EDITTEXT IDC_FILTER,34,7,100,14,ES_AUTOHSCROLL - CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | + CONTROL "List1",IDC_PROGRAMS_FOUND,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,7,25,186,33 PUSHBUTTON "&Ïåðåâ³ðèòè",IDC_CHECK_ENTRIES,143,7,50,14 END @@ -174,29 +174,29 @@ FONT 8, "MS Sans Serif" BEGIN LTEXT "Îáåð³òü íàéá³ëüø çðó÷íèé äëÿ âàñ àëãîðèòì âèð³âíþâàííÿ çíà÷ê³â:", IDC_STATIC,7,7,166,8 - CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | + CONTROL "left/top dwn",IDC_ICON_ALIGN_0,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,25,46,44 - CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | + CONTROL "left/top right",IDC_ICON_ALIGN_1,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,25,46,44 - CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | + CONTROL "right/top left",IDC_ICON_ALIGN_2,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,25,46,44 - CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | + CONTROL "rig./top dwn",IDC_ICON_ALIGN_3,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,25,46,44 - CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | + CONTROL "left/bot. up",IDC_ICON_ALIGN_4,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,73,46,44 - CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | + CONTROL "left/bot. right",IDC_ICON_ALIGN_5,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,73,46,44 - CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | + CONTROL "right/bot. left",IDC_ICON_ALIGN_6,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,73,46,44 - CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | + CONTROL "rig./bot. dwn",IDC_ICON_ALIGN_7,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,73,46,44 - CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | + CONTROL "border down",IDC_ICON_ALIGN_8,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,7,121,46,44 - CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | + CONTROL "border H/V",IDC_ICON_ALIGN_9,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,57,121,46,44 - CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | + CONTROL "round about",IDC_ICON_ALIGN_10,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,110,121,46,44 - CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | + CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 // CONTROL "³äîáðàæàòè Íîìåð &Âåðñ³¿",ID_DESKTOP_VERSION,"Button", // BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 @@ -207,10 +207,10 @@ STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Âëàñòèâîñò³ ïàíåë³ çàâäàíü" FONT 8, "MS Sans Serif" BEGIN - CONTROL "³äîáðà&æàòè ãîäèííèê",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | + CONTROL "³äîáðà&æàòè ãîäèííèê",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,152,52,10 CONTROL "Ïðè&õîâóâàòè íåâèêîðèñòîâóâàí³ çíà÷êè", - ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | + ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,174,111,10 PUSHBUTTON "&Ñïîâ³ùåííÿ...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END @@ -223,13 +223,13 @@ BEGIN END IDD_NOTIFYAREA DIALOGEX 0, 0, 208, 174 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Êîíô³ãóðàö³ÿ çíà÷ê³â ñïîâ³ùåíü" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | + CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,194,31 LTEXT "&Òåêñò ϳäêàçêè:",IDC_LABEL1,7,44,40,8 EDITTEXT IDC_NOTIFY_TOOLTIP,58,42,143,14,ES_AUTOHSCROLL @@ -238,7 +238,7 @@ BEGIN LTEXT "&Øëÿõ äî Ìîäóëÿ:",IDC_LABEL3,7,81,43,8 EDITTEXT IDC_NOTIFY_MODULE,58,78,143,14,ES_AUTOHSCROLL GROUPBOX "&Ðåæèì ³äîáðàæåííÿ",IDC_LABEL4,7,96,157,28 - CONTROL "&ïîêàçàòè",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&ïîêàçàòè",IDC_NOTIFY_SHOW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,15,108,33,10 CONTROL "&ñõîâàòè",IDC_NOTIFY_HIDE,"Button",BS_AUTORADIOBUTTON,66, 108,29,10 @@ -246,7 +246,7 @@ BEGIN BS_AUTORADIOBUTTON,112,108,43,10 ICON "",IDC_PICTURE,173,101,21,20 LTEXT "&Îñòàííÿ çì³íà:",IDC_LABEL6,7,132,43,8 - EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | + EDITTEXT IDC_LAST_CHANGE,59,129,105,14,ES_AUTOHSCROLL | ES_READONLY CONTROL "ïîêà&çàòè ïðèõîâàíå",ID_SHOW_HIDDEN_ICONS,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,154,56,10 @@ -269,7 +269,7 @@ BEGIN CONTROL 170,IDC_STATIC,"Static",SS_BITMAP,145,23,15,13 CONTROL 171,IDC_STATIC,"Static",SS_BITMAP,145,57,15,13 CONTROL "³äêðèâàòè ï³äïàïêè â î&êðåìèõ â³êíàõ", - IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | + IDC_SEPARATE_SUBFOLDERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,135,10 LTEXT "Ö³ íàñòðîéêè áóäóòü âèêîðèñòàí³ ÿê çíà÷åííÿ çà çàìîâ÷óâàííÿì äëÿ âñ³õ â³êîí ïðîâ³äíèêà â ìàéáóòíüîìó.", IDC_STATIC,7,111,174,22 @@ -299,18 +299,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "\r\n" "\0" @@ -324,7 +324,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_TITLE "Ïðîâ³äíèê ReactOS" IDS_START "Ïóñê" @@ -344,7 +344,7 @@ BEGIN IDS_ADMIN "Àäì³í³ñòðóâàííÿ" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_STARTMENU "Ìåíþ Ïóñê" IDS_MINIMIZE_ALL "çãîðíóòè âñ³ â³êíà" @@ -362,7 +362,7 @@ BEGIN IDS_TERMINATE "Çàâåðøèòè ðîáîòó Ïðîâ³äíèêà" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_NETWORK "Ìåðåæà" IDS_CONNECTIONS "Ìåðåæí³ ï³äêëþ÷åííÿ" @@ -376,7 +376,7 @@ BEGIN IDS_ALL_USERS "Âñ³ êîðèñòóâà÷³\\" IDS_SEARCH "Ïîøóê" IDS_ABOUT_EXPLORER "&Ïðî Ïðîâ³äíèê..." - IDS_LAUNCH_MANY_PROGRAMS + IDS_LAUNCH_MANY_PROGRAMS "Âè îáðàëè á³ëüøå îäí³º¿ ïðîãðàìè.\nÂè âïåâíåí³, ùî õî÷åòå çàïóñòèòè ¿õ âñ³?" IDS_DESKTOPBAR_SETTINGS "Íàñòðîéêè ðîáî÷îãî ñòîëà" IDS_DESKTOP "Ðîáî÷èé Ñò³ë" diff --git a/reactos/base/shell/explorer/explorer.rc b/reactos/base/shell/explorer/explorer.rc index ed273193777..10aa03a78ff 100644 --- a/reactos/base/shell/explorer/explorer.rc +++ b/reactos/base/shell/explorer/explorer.rc @@ -14,7 +14,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_VERSION_STR REACTOS_STR_PRODUCT_VERSION IDS_EXPLORER_VERSION_STR "ReactOS %s Explorer" diff --git a/reactos/base/shell/explorer/explorer_intres.rc b/reactos/base/shell/explorer/explorer_intres.rc index 050e128c70b..dd072dc2582 100644 --- a/reactos/base/shell/explorer/explorer_intres.rc +++ b/reactos/base/shell/explorer/explorer_intres.rc @@ -49,20 +49,20 @@ IDB_SDI BITMAP MOVEABLE PURE "res/sdi.bmp" // Accelerator // -IDA_EXPLORER ACCELERATORS MOVEABLE PURE +IDA_EXPLORER ACCELERATORS MOVEABLE PURE BEGIN - "S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, + "S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, NOINVERT VK_F5, ID_REFRESH, VIRTKEY, NOINVERT "X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT END -IDA_SEARCH_PROGRAM ACCELERATORS MOVEABLE PURE +IDA_SEARCH_PROGRAM ACCELERATORS MOVEABLE PURE BEGIN VK_F5, ID_REFRESH, VIRTKEY, NOINVERT END -IDA_TRAYNOTIFY ACCELERATORS MOVEABLE PURE +IDA_TRAYNOTIFY ACCELERATORS MOVEABLE PURE BEGIN VK_F5, ID_REFRESH, VIRTKEY, NOINVERT END @@ -74,18 +74,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE MOVEABLE PURE +1 TEXTINCLUDE MOVEABLE PURE BEGIN "resource.h\0" END -2 TEXTINCLUDE MOVEABLE PURE +2 TEXTINCLUDE MOVEABLE PURE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE MOVEABLE PURE +3 TEXTINCLUDE MOVEABLE PURE BEGIN "#ifndef ROSSHELL\r\n" "IDB_IMAGES BITMAP DISCARDABLE ""res/images.bmp""\r\n" @@ -200,7 +200,7 @@ IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp" #endif #ifndef _ROS_ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_VERSION_STR "" #ifdef UNICODE diff --git a/reactos/base/shell/explorer/resource.h b/reactos/base/shell/explorer/resource.h index 678c106e50a..1fb0b08e183 100644 --- a/reactos/base/shell/explorer/resource.h +++ b/reactos/base/shell/explorer/resource.h @@ -224,7 +224,7 @@ #define IDC_STATIC -1 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 169 diff --git a/reactos/base/shell/explorer/shell/mainframe.cpp b/reactos/base/shell/explorer/shell/mainframe.cpp index 64d570baea9..6a432686587 100644 --- a/reactos/base/shell/explorer/shell/mainframe.cpp +++ b/reactos/base/shell/explorer/shell/mainframe.cpp @@ -63,7 +63,7 @@ HWND MainFrameBase::Create(const ExplorerCmd& cmd) // Open the first child window after initializing the application if (cmd.IsValidPath()) { - // We use the static s_path variable to store the path string in order + // We use the static s_path variable to store the path string in order // to avoid accessing prematurely freed memory in the PostMessage handlers. static String s_path = cmd._path; @@ -175,7 +175,7 @@ MainFrameBase::MainFrameBase(HWND hwnd) {13, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0} }; - _htoolbar = CreateToolbarEx(hwnd, + _htoolbar = CreateToolbarEx(hwnd, #ifndef _NO_REBAR CCS_NOPARENTALIGN|CCS_NORESIZE|CCS_NODIVIDER| #endif @@ -536,7 +536,7 @@ void MainFrameBase::resize_frame(int cx, int cy) RECT rect = {0, 0, cx, cy}; if (_hwndrebar) { - int height = SendMessage(_hwndrebar, RB_GETBARHEIGHT, 0, 0); + int height = SendMessage(_hwndrebar, RB_GETBARHEIGHT, 0, 0); rect.top += height; rect.top += 5; } else { diff --git a/reactos/base/shell/explorer/shell/shellbrowser.cpp b/reactos/base/shell/explorer/shell/shellbrowser.cpp index e4ec34714ce..b77411ffda2 100644 --- a/reactos/base/shell/explorer/shell/shellbrowser.cpp +++ b/reactos/base/shell/explorer/shell/shellbrowser.cpp @@ -42,7 +42,7 @@ ShellBrowser::ShellBrowser(HWND hwnd, HWND hwndFrame, HWND left_hwnd, WindowHand #ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) : super(IID_IShellFolderViewCB), #else - : + : #endif _hwnd(hwnd), _hwndFrame(hwndFrame), @@ -673,7 +673,7 @@ LRESULT MDIShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) return super::WndProc(nmsg, wparam, lparam); } return TRUE;} - + default: return super::WndProc(nmsg, wparam, lparam); } @@ -730,7 +730,7 @@ String MDIShellBrowserChild::jump_to_int(LPCTSTR url) if (_shellBrowser->jump_to_pidl(ShellPath(dir))) return FmtString(TEXT("file://%s"), (LPCTSTR)dir); } - + return String(); } diff --git a/reactos/base/shell/explorer/taskbar/desktopbar.cpp b/reactos/base/shell/explorer/taskbar/desktopbar.cpp index 1fa6e34f10a..eba76bde95a 100644 --- a/reactos/base/shell/explorer/taskbar/desktopbar.cpp +++ b/reactos/base/shell/explorer/taskbar/desktopbar.cpp @@ -102,10 +102,10 @@ LRESULT DesktopBar::Init(LPCREATESTRUCT pcs) // create "Start" button HWND hwndStart = Button(_hwnd, start_str, 1, 1, start_btn_width, REBARBAND_HEIGHT, IDC_START, WS_VISIBLE|WS_CHILD|BS_OWNERDRAW); new StartButton(hwndStart); - + /* Save the handle to the window, needed for push-state handling */ _hwndStartButton = hwndStart; - + // disable double clicks SetClassLong(hwndStart, GCL_STYLE, GetClassLong(hwndStart, GCL_STYLE) & ~CS_DBLCLKS); @@ -459,7 +459,7 @@ void DesktopBar::ShowStartMenu() if (_startMenuRoot) { // set the Button, if not set - if (!Button_GetState(_hwndStartButton)) + if (!Button_GetState(_hwndStartButton)) Button_SetState(_hwndStartButton, TRUE); _startMenuRoot->TrackStartmenu(); diff --git a/reactos/base/shell/explorer/taskbar/desktopbar.h b/reactos/base/shell/explorer/taskbar/desktopbar.h index fd17c16a759..2cb95a4a447 100644 --- a/reactos/base/shell/explorer/taskbar/desktopbar.h +++ b/reactos/base/shell/explorer/taskbar/desktopbar.h @@ -107,7 +107,7 @@ protected: WindowHandle _hwndrebar; /* Needed to make the StartButton pushed, if it's called by windowskey: SC_TASKLIST command */ WindowHandle _hwndStartButton; - + struct StartMenuRoot* _startMenuRoot; #ifdef _ROS_ diff --git a/reactos/base/shell/explorer/taskbar/quicklaunch.cpp b/reactos/base/shell/explorer/taskbar/quicklaunch.cpp index b0666f33b70..329007c9c24 100644 --- a/reactos/base/shell/explorer/taskbar/quicklaunch.cpp +++ b/reactos/base/shell/explorer/taskbar/quicklaunch.cpp @@ -212,7 +212,7 @@ LRESULT QuickLaunchBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) break; case PM_GET_WIDTH: { - // take line wrapping into account + // take line wrapping into account int btns = SendMessage(_hwnd, TB_BUTTONCOUNT, 0, 0); int rows = SendMessage(_hwnd, TB_GETROWS, 0, 0); diff --git a/reactos/base/shell/explorer/taskbar/startmenu.cpp b/reactos/base/shell/explorer/taskbar/startmenu.cpp index 7ba98ad51d5..4e794bf654e 100644 --- a/reactos/base/shell/explorer/taskbar/startmenu.cpp +++ b/reactos/base/shell/explorer/taskbar/startmenu.cpp @@ -1482,7 +1482,7 @@ void StartMenu::ResizeToButtons() if (rect.bottom > cyscreen) { _arrow_btns = true; - _invisible_lines = (rect.bottom-cyscreen+(STARTMENU_LINE_HEIGHT(icon_size)+1))/STARTMENU_LINE_HEIGHT(icon_size)+1; + _invisible_lines = (rect.bottom-cyscreen+(STARTMENU_LINE_HEIGHT(icon_size)+1))/STARTMENU_LINE_HEIGHT(icon_size)+1; rect.bottom -= _invisible_lines * STARTMENU_LINE_HEIGHT(icon_size); bottom_max = rect.bottom; diff --git a/reactos/base/shell/explorer/utility/dragdropimpl.cpp b/reactos/base/shell/explorer/utility/dragdropimpl.cpp index 92f7ed559f5..e91a302baba 100644 --- a/reactos/base/shell/explorer/utility/dragdropimpl.cpp +++ b/reactos/base/shell/explorer/utility/dragdropimpl.cpp @@ -190,7 +190,7 @@ STDMETHODIMP IDataObjectImpl::EnumFormatEtc( (*ppenumFormatEtc)->AddRef(); break; - + case DATADIR_SET: default: return E_NOTIMPL; @@ -273,7 +273,7 @@ STDMETHODIMP EnumFormatEtcImpl::Next(ULONG celt,LPFORMATETC lpFormatEtc, ULONG* { if (pceltFetched != NULL) *pceltFetched=0; - + ULONG cReturn = celt; if (celt <= 0 || lpFormatEtc == NULL || m_iCur >= m_pFmtEtc.size()) @@ -307,12 +307,12 @@ STDMETHODIMP EnumFormatEtcImpl::Reset(void) m_iCur = 0; return S_OK; } - + STDMETHODIMP EnumFormatEtcImpl::Clone(IEnumFORMATETC** ppCloneEnumFormatEtc) { if (ppCloneEnumFormatEtc == NULL) return E_POINTER; - + EnumFormatEtcImpl* newEnum = new EnumFormatEtcImpl(m_pFmtEtc); if (!newEnum) @@ -419,7 +419,7 @@ bool IDropTargetImpl::QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect) } return (DROPEFFECT_NONE == *pdwEffect)?false:true; -} +} HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragEnter( /* [unique][in] */ IDataObject __RPC_FAR *pDataObj, @@ -474,7 +474,7 @@ HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragLeave() { if (m_pDropTargetHelper) m_pDropTargetHelper->DragLeave(); - + m_bAllowDrop = false; m_pSupportedFrmt = NULL; @@ -487,7 +487,7 @@ HRESULT STDMETHODCALLTYPE IDropTargetImpl::Drop( /* [out][in] */ DWORD __RPC_FAR *pdwEffect) { if (pDataObj == NULL) - return E_INVALIDARG; + return E_INVALIDARG; if (m_pDropTargetHelper) m_pDropTargetHelper->Drop(pDataObj, (LPPOINT)&pt, *pdwEffect); diff --git a/reactos/base/shell/explorer/utility/shellbrowserimpl.cpp b/reactos/base/shell/explorer/utility/shellbrowserimpl.cpp index 61b11c53c5c..914df82d872 100644 --- a/reactos/base/shell/explorer/utility/shellbrowserimpl.cpp +++ b/reactos/base/shell/explorer/utility/shellbrowserimpl.cpp @@ -19,7 +19,7 @@ // // Explorer clone - // + // // shellbrowserimpl.cpp // // Martin Fuchs, 28.09.2003 diff --git a/reactos/base/shell/explorer/utility/shellclasses.cpp b/reactos/base/shell/explorer/utility/shellclasses.cpp index 535076de388..287a9f2d468 100644 --- a/reactos/base/shell/explorer/utility/shellclasses.cpp +++ b/reactos/base/shell/explorer/utility/shellclasses.cpp @@ -19,7 +19,7 @@ // // Explorer clone - // + // // shellclasses.cpp // // C++ wrapper classes for COM interfaces and shell objects diff --git a/reactos/base/shell/explorer/utility/shelltests.cpp b/reactos/base/shell/explorer/utility/shelltests.cpp index 4984b6c7e5d..c5225c9fac7 100644 --- a/reactos/base/shell/explorer/utility/shelltests.cpp +++ b/reactos/base/shell/explorer/utility/shelltests.cpp @@ -17,7 +17,7 @@ */ - // + // // shelltests.cpp // // Examples for usage of shellclasses.cpp, shellclasses.h diff --git a/reactos/base/shell/explorer/utility/utility.cpp b/reactos/base/shell/explorer/utility/utility.cpp index 825e5370e35..3d2ee5dc838 100644 --- a/reactos/base/shell/explorer/utility/utility.cpp +++ b/reactos/base/shell/explorer/utility/utility.cpp @@ -19,7 +19,7 @@ // // Explorer clone - // + // // utility.cpp // // Martin Fuchs, 23.07.2003 diff --git a/reactos/base/system/expand/expand.c b/reactos/base/system/expand/expand.c index 4dc732b5f2e..3567b42de3f 100644 --- a/reactos/base/system/expand/expand.c +++ b/reactos/base/system/expand/expand.c @@ -30,13 +30,13 @@ int _tmain(int argc, TCHAR *argv[]) { OFSTRUCT SourceOpenStruct1, SourceOpenStruct2; LONG ret; - HFILE hSourceFile, hDestFile; + HFILE hSourceFile, hDestFile; TCHAR szMsg[RC_STRING_MAX_SIZE]; if (argc < 2) { - LoadString( GetModuleHandle(NULL), IDS_Copy, (LPTSTR) szMsg,RC_STRING_MAX_SIZE); - _ftprintf( stderr, szMsg, argv[0] ); + LoadString( GetModuleHandle(NULL), IDS_Copy, (LPTSTR) szMsg,RC_STRING_MAX_SIZE); + _ftprintf( stderr, szMsg, argv[0] ); return 1; } hSourceFile = LZOpenFile(argv[1], &SourceOpenStruct1, OF_READ); @@ -51,7 +51,7 @@ int _tmain(int argc, TCHAR *argv[]) ret = LZCopy(hSourceFile, hDestFile); LZClose(hSourceFile); LZClose(hDestFile); - LoadString( GetModuleHandle(NULL), IDS_FAILS, (LPTSTR) szMsg,RC_STRING_MAX_SIZE); + LoadString( GetModuleHandle(NULL), IDS_FAILS, (LPTSTR) szMsg,RC_STRING_MAX_SIZE); if (ret <= 0) _ftprintf(stderr,szMsg,ret); return (ret <= 0); } diff --git a/reactos/base/system/expand/expand.rbuild b/reactos/base/system/expand/expand.rbuild index c0e319abd88..5de295710f5 100644 --- a/reactos/base/system/expand/expand.rbuild +++ b/reactos/base/system/expand/expand.rbuild @@ -9,6 +9,6 @@ lz32 user32 kernel32 - expand.c - expand.rc + expand.c + expand.rc diff --git a/reactos/base/system/expand/lang/el-GR.rc b/reactos/base/system/expand/lang/el-GR.rc index f0081692c9d..48aae62e18a 100644 --- a/reactos/base/system/expand/lang/el-GR.rc +++ b/reactos/base/system/expand/lang/el-GR.rc @@ -3,7 +3,7 @@ * Moved all hardcoded strings to En.rc. * By Magnus Olsen 2005 magnus@itkonsult-olsen.com * GR.rc by Dj Apal® - * + * */ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT diff --git a/reactos/base/system/expand/lang/pl-PL.rc b/reactos/base/system/expand/lang/pl-PL.rc index cd3f27fdd92..b368ee9864e 100644 --- a/reactos/base/system/expand/lang/pl-PL.rc +++ b/reactos/base/system/expand/lang/pl-PL.rc @@ -1,9 +1,9 @@ #include "resource.h" -/* +/* * translated by xrogers (http://rogers.cyberdusk.pl/) -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE diff --git a/reactos/base/system/format/resource.h b/reactos/base/system/format/resource.h index c393df615fc..23c7fdc6824 100644 --- a/reactos/base/system/format/resource.h +++ b/reactos/base/system/format/resource.h @@ -3,11 +3,11 @@ #define RC_STRING_MAX_SIZE 4096 #define STRING_HELP 100 -#define STRING_COMPLETE 101 +#define STRING_COMPLETE 101 #define STRING_FORMAT_FAIL 102 #define STRING_NO_SUPPORT 103 #define STRING_FMIFS_FAIL 104 -#define STRING_UNKNOW_ARG 105 +#define STRING_UNKNOW_ARG 105 #define STRING_DRIVE_PARM 106 #define STRING_ERROR_DRIVE_TYPE 107 #define STRING_INSERT_DISK 108 diff --git a/reactos/base/system/regsvr32/lang/pl-PL.rc b/reactos/base/system/regsvr32/lang/pl-PL.rc index 1130aef7a86..3ed37688c5e 100644 --- a/reactos/base/system/regsvr32/lang/pl-PL.rc +++ b/reactos/base/system/regsvr32/lang/pl-PL.rc @@ -1,9 +1,9 @@ #include "resource.h" -/* +/* * translated by xrogers (http://rogers.cyberdusk.pl/) -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE diff --git a/reactos/base/system/regsvr32/regsvr32.c b/reactos/base/system/regsvr32/regsvr32.c index f0f9dd489b6..11d871e1a8c 100644 --- a/reactos/base/system/regsvr32/regsvr32.c +++ b/reactos/base/system/regsvr32/regsvr32.c @@ -332,7 +332,7 @@ int WINAPI WinMain( } } - // An unrecognized flag was used, display a message and show available options + // An unrecognized flag was used, display a message and show available options if (lptFuncName) { lptMsgBuffer = (LPTSTR)malloc((_tcslen(UsageMessage) - 2 + _tcslen(InvalidFlag) - 2 + _tcslen(lptFuncName) + 1) * sizeof(TCHAR)); diff --git a/reactos/base/system/rundll32/lang/pl-PL.rc b/reactos/base/system/rundll32/lang/pl-PL.rc index ad191811680..e60ef44b96e 100644 --- a/reactos/base/system/rundll32/lang/pl-PL.rc +++ b/reactos/base/system/rundll32/lang/pl-PL.rc @@ -1,9 +1,9 @@ #include "resource.h" -/* +/* * translated by xrogers (http://rogers.cyberdusk.pl/) -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE diff --git a/reactos/base/system/rundll32/rundll32.c b/reactos/base/system/rundll32/rundll32.c index cceafa88d53..330d1257b35 100644 --- a/reactos/base/system/rundll32/rundll32.c +++ b/reactos/base/system/rundll32/rundll32.c @@ -468,7 +468,7 @@ int WINAPI WinMain( lptMsgBuffer = (LPTSTR)malloc((_tcslen(szMsg) - 2 + _tcslen(lptDllName) + 1) * sizeof(TCHAR)); _stprintf(lptMsgBuffer,szMsg,lptDllName); - + MessageBox(0,lptMsgBuffer,ModuleTitle,MB_ICONERROR); free(lptMsgBuffer); } diff --git a/reactos/base/system/smss/client.c b/reactos/base/system/smss/client.c index 257eba93498..f052c42563d 100644 --- a/reactos/base/system/smss/client.c +++ b/reactos/base/system/smss/client.c @@ -1,9 +1,9 @@ /* $Id$ * * client.c - Session Manager client Management - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -91,7 +91,7 @@ static INT STDCALL SmpGetFirstFreeClientEntry (VOID) } } } - return SM_INVALID_CLIENT_INDEX; // full! + return SM_INVALID_CLIENT_INDEX; // full! } /********************************************************************** * SmpLookupClient/1 PRIVATE @@ -129,7 +129,7 @@ SmpLookupClient (USHORT SubsystemId) } } } - } + } return SM_INVALID_CLIENT_INDEX; } /********************************************************************** @@ -158,7 +158,7 @@ SmpDestroyClientObject (PSM_CLIENT_DATA Client, NTSTATUS DestroyReason) * ARGUMENTS * Request: message received by \SmApiPort * ClientData: - * + * * RETURN VALUES * NTSTATUS */ @@ -175,7 +175,7 @@ SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request, DPRINT("SM: %s(%08lx,%08lx) called\n", __FUNCTION__, Request, ClientData); - + RtlEnterCriticalSection (& SmpClientDirectory.Lock); /* * Is there a subsystem bootstrap in progress? @@ -184,7 +184,7 @@ SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request, { PROCESS_BASIC_INFORMATION pbi; OBJECT_ATTRIBUTES ObjectAttributes; - + RtlZeroMemory (& pbi, sizeof pbi); InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); Status = NtOpenProcess(&Process, @@ -208,7 +208,7 @@ SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request, DPRINT1("SM: %s: subsys booting with no descriptor!\n", __FUNCTION__); Status = STATUS_NOT_FOUND; RtlLeaveCriticalSection (& SmpClientDirectory.Lock); - return Status; + return Status; } /* * Check if a client for the ID already exist. @@ -268,7 +268,7 @@ SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request, /* * Notify to the caller the reference to the client data. */ - if (ClientData) + if (ClientData) { *ClientData = SmpClientDirectory.CandidateClient; } @@ -279,7 +279,7 @@ SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request, /* Done */ RtlLeaveCriticalSection (& SmpClientDirectory.Lock); - + return STATUS_SUCCESS; } /********************************************************************** @@ -301,7 +301,7 @@ SmCompleteClientInitialization (ULONG ProcessId) if (SmpClientDirectory.Count > 0) { for (ClientIndex = 0; ClientIndex < SM_MAX_CLIENT_COUNT; ClientIndex ++) - { + { if ((NULL != SmpClientDirectory.Client [ClientIndex]) && (ProcessId == SmpClientDirectory.Client [ClientIndex]->ServerProcessId)) { @@ -403,14 +403,14 @@ static VOID STDCALL SmpTimeoutCandidateClient (PVOID x) * STATUS_SUCCESS if all OK; * STATUS_DEVICE_BUSY if another SS is still booting; * STATUS_NO_MEMORY if client descriptor allocation failed; - * - * + * + * */ NTSTATUS STDCALL SmCreateClient (PRTL_USER_PROCESS_INFORMATION ProcessInfo, PWSTR ProgramName) { NTSTATUS Status = STATUS_SUCCESS; - + DPRINT("SM: %s(%lx, %S) called\n", __FUNCTION__, ProcessInfo->ProcessHandle, ProgramName); RtlEnterCriticalSection (& SmpClientDirectory.Lock); @@ -450,7 +450,7 @@ SmCreateClient (PRTL_USER_PROCESS_INFORMATION ProcessInfo, PWSTR ProgramName) RtlInitializeCriticalSection(& SmpClientDirectory.CandidateClient->Lock); SmpClientDirectory.CandidateClient->ServerProcess = (HANDLE) ProcessInfo->ProcessHandle; - SmpClientDirectory.CandidateClient->ServerProcessId = + SmpClientDirectory.CandidateClient->ServerProcessId = (ULONG) ProcessInfo->ClientId.UniqueProcess; /* * Copy the program name @@ -534,7 +534,7 @@ SmGetClientBasicInformation (PSM_BASIC_INFORMATION i) i->SubSystemCount = SmpClientDirectory.Count; i->Unused = 0; - + if (SmpClientDirectory.Count > 0) { for (ClientIndex = 0; (ClientIndex < SM_MAX_CLIENT_COUNT); ClientIndex ++) @@ -562,7 +562,7 @@ SmGetSubSystemInformation (PSM_SUBSYSTEM_INFORMATION i) { NTSTATUS Status = STATUS_SUCCESS; INT ClientIndex = SM_INVALID_CLIENT_INDEX; - + DPRINT("SM: %s(%08lx) called\n", __FUNCTION__, i); RtlEnterCriticalSection (& SmpClientDirectory.Lock); diff --git a/reactos/base/system/smss/debug.c b/reactos/base/system/smss/debug.c index 817f8ec4d26..67c861b1893 100644 --- a/reactos/base/system/smss/debug.c +++ b/reactos/base/system/smss/debug.c @@ -1,9 +1,9 @@ /* $Id$ * * debug.c - Session Manager debug messages switch and router - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -42,7 +42,7 @@ DbgSsApiPortThread (PVOID dummy) { NTSTATUS Status = STATUS_SUCCESS; PORT_MESSAGE Request ; - + RtlZeroMemory(&Request, sizeof(PORT_MESSAGE)); while (TRUE) { @@ -62,7 +62,7 @@ DbgUiApiPortThread (PVOID dummy) { NTSTATUS Status = STATUS_SUCCESS; PORT_MESSAGE Request; - + RtlZeroMemory(&Request, sizeof(PORT_MESSAGE)); while (TRUE) { diff --git a/reactos/base/system/smss/initdosdev.c b/reactos/base/system/smss/initdosdev.c index 3506aedc345..c91202dbf32 100644 --- a/reactos/base/system/smss/initdosdev.c +++ b/reactos/base/system/smss/initdosdev.c @@ -1,9 +1,9 @@ /* $Id$ * * initdosdev.c - Define symbolic links to kernel devices (MS-DOS names). - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ diff --git a/reactos/base/system/smss/initenv.c b/reactos/base/system/smss/initenv.c index 28c4160da9e..1df0c26e734 100644 --- a/reactos/base/system/smss/initenv.c +++ b/reactos/base/system/smss/initenv.c @@ -1,9 +1,9 @@ /* $Id$ * * initenv.c - Environment initialization - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -36,7 +36,7 @@ PWSTR SmSystemEnvironment = NULL; /* FUNCTIONS */ -NTSTATUS +NTSTATUS SmCreateEnvironment(VOID) { return RtlCreateEnvironment(FALSE, &SmSystemEnvironment); diff --git a/reactos/base/system/smss/initheap.c b/reactos/base/system/smss/initheap.c index 87b0eb70451..8f279fb31c6 100644 --- a/reactos/base/system/smss/initheap.c +++ b/reactos/base/system/smss/initheap.c @@ -1,9 +1,9 @@ /* $Id$ * * initenv.c - Create the SM private heap - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ diff --git a/reactos/base/system/smss/initmv.c b/reactos/base/system/smss/initmv.c index 315948edb68..24428ff54b3 100644 --- a/reactos/base/system/smss/initmv.c +++ b/reactos/base/system/smss/initmv.c @@ -9,7 +9,7 @@ * Created 13/08/2006 */ - + /* INCLUDES ******************************************************************/ #include "smss.h" @@ -21,16 +21,16 @@ /*++ * @name SmpDeleteFile -* +* * The SmpDeleteFile function deletes a specify file. -* +* * @param lpFileName * the name of a file which should be deleted * * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL * othwerwise. * -* @remarks +* @remarks * This function is called by SmpMoveFilesQueryRoutine(). * * @@ -94,9 +94,9 @@ SmpDeleteFile( IN LPCWSTR lpFileName ) /*++ * @name SmpMoveFile -* +* * The SmpMoveFile function deletes a specify file. -* +* * @param lpExistingFileName * the name of an existing file which should be removed * @@ -106,7 +106,7 @@ SmpDeleteFile( IN LPCWSTR lpFileName ) * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL * othwerwise. * -* @remarks +* @remarks * This function called from the SmpMoveFilesQueryRoutine function. * * @@ -333,9 +333,9 @@ SmpMoveFile( IN LPCWSTR lpExistingFileName, /*++ * @name SmpMoveFilesQueryRoutine -* +* * The SmpMoveFilesQueryRoutine function processes registry entries. -* +* * @param ValueName * The name of the value. * @@ -357,7 +357,7 @@ SmpMoveFile( IN LPCWSTR lpExistingFileName, * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL * othwerwise. * -* @remarks +* @remarks * * * @@ -401,15 +401,15 @@ SmpMoveFilesQueryRoutine(IN PWSTR ValueName, /*++ * @name SmProcessFileRenameList * @implemented -* +* * The SmProcessFileRenameList function moves or deletes files thats have been added to the specify registry key for delayed moving. -* +* * @param VOID * * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL * othwerwise. * -* @remarks +* @remarks * This function reads the following registry value: * HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations * This registry value is of type REG_MULTI_SZ. The each operation is specifed as two file names. diff --git a/reactos/base/system/smss/initobdir.c b/reactos/base/system/smss/initobdir.c index df65eca50d1..4bf8b8c7ab0 100644 --- a/reactos/base/system/smss/initobdir.c +++ b/reactos/base/system/smss/initobdir.c @@ -1,9 +1,9 @@ /* $Id$ * * initobdir.c - Session Manager object directories - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ diff --git a/reactos/base/system/smss/initpage.c b/reactos/base/system/smss/initpage.c index cecbe4317cf..2d59da3feeb 100644 --- a/reactos/base/system/smss/initpage.c +++ b/reactos/base/system/smss/initpage.c @@ -1,8 +1,8 @@ /* - * initpage.c - - * + * initpage.c - + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -83,8 +83,8 @@ SmpPagingFilesQueryRoutine(PWSTR ValueName, /* If there is only a file name or if initial and max are both 0 * the system will pick the sizes. Then it makes intial the size of phyical memory - * and makes max the size of 1.5 * initial. If there isnt enough free space then it will - * fall back to intial 20% of free space and max 25%. There is a max of 1 gig before + * and makes max the size of 1.5 * initial. If there isnt enough free space then it will + * fall back to intial 20% of free space and max 25%. There is a max of 1 gig before * it doesnt make it bigger. */ if ((InitialSize.QuadPart == 0 && MaximumSize.QuadPart == 0) || p == NULL) { @@ -100,8 +100,8 @@ SmpPagingFilesQueryRoutine(PWSTR ValueName, /* Make sure the path that is given for the file actually has the drive in it. At this point if there is not file name, no sizes will be set therefore no page file will be created */ - if (wcslen(ValueString) <= 3 || - ValueString[1] != L':' || + if (wcslen(ValueString) <= 3 || + ValueString[1] != L':' || ValueString[2] != L'\\') { DPRINT1("Invalid path for pagefile.\n"); @@ -118,7 +118,7 @@ SmpPagingFilesQueryRoutine(PWSTR ValueName, goto Cleanup; } DPRINT("PageSize: %d, PhysicalPages: %d, TotalMem: %d\n", SysBasicInfo.PageSize, SysBasicInfo.NumberOfPhysicalPages, (SysBasicInfo.NumberOfPhysicalPages * SysBasicInfo.PageSize) / 1024); - + InitialSize.QuadPart = SysBasicInfo.NumberOfPhysicalPages * SysBasicInfo.PageSize; MaximumSize.QuadPart = InitialSize.QuadPart * 2; @@ -186,8 +186,8 @@ SmpPagingFilesQueryRoutine(PWSTR ValueName, goto Cleanup; } - FreeBytes.QuadPart = FileFsSize.BytesPerSector * - FileFsSize.SectorsPerAllocationUnit * + FreeBytes.QuadPart = FileFsSize.BytesPerSector * + FileFsSize.SectorsPerAllocationUnit * FileFsSize.AvailableAllocationUnits.QuadPart; DPRINT("Free bytes: %I64d Inital Size based on memory: %I64d \n",FreeBytes.QuadPart,InitialSize.QuadPart); @@ -196,7 +196,7 @@ SmpPagingFilesQueryRoutine(PWSTR ValueName, if (InitialSize.QuadPart > (FreeBytes.QuadPart / 4) || InitialSize.QuadPart == 0) { DPRINT("Inital Size took more then 25%% of free space\n"); - /* Set by percentage of free space + /* Set by percentage of free space * intial is 20%, and max is 25% */ InitialSize.QuadPart = FreeBytes.QuadPart / 5; MaximumSize.QuadPart = FreeBytes.QuadPart / 4; diff --git a/reactos/base/system/smss/initreg.c b/reactos/base/system/smss/initreg.c index 4d62827fe40..615381cd74c 100644 --- a/reactos/base/system/smss/initreg.c +++ b/reactos/base/system/smss/initreg.c @@ -1,9 +1,9 @@ /* $Id$ * * initenv.c - Hive loading - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ diff --git a/reactos/base/system/smss/initrun.c b/reactos/base/system/smss/initrun.c index 5b59db9db5a..0b39c69e676 100644 --- a/reactos/base/system/smss/initrun.c +++ b/reactos/base/system/smss/initrun.c @@ -1,9 +1,9 @@ /* $Id$ * * initrun.c - Run all programs in the boot execution list - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -111,7 +111,7 @@ SmpRunBootAppsQueryRoutine(PWSTR ValueName, /********************************************************************** * SmRunBootApplications/0 - * + * * DESCRIPTION * * Run native applications listed in the registry. @@ -141,7 +141,7 @@ SmRunBootApplications(VOID) NULL); if (!NT_SUCCESS(Status)) { - DPRINT1("%s: RtlQueryRegistryValues() failed! (Status %lx)\n", + DPRINT1("%s: RtlQueryRegistryValues() failed! (Status %lx)\n", __FUNCTION__, Status); } diff --git a/reactos/base/system/smss/initss.c b/reactos/base/system/smss/initss.c index 656b1396be3..be1c3cdc4f4 100644 --- a/reactos/base/system/smss/initss.c +++ b/reactos/base/system/smss/initss.c @@ -1,9 +1,9 @@ /* $Id$ * * initss.c - Load the subsystems - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -40,7 +40,7 @@ HANDLE hSmApiPort = (HANDLE) 0; /********************************************************************** * SmRegisterInternalSubsystem/3 - * + * * DESCRIPTION * Register with itself for ImageSubsystemId * (programmatically). @@ -52,7 +52,7 @@ NTSTATUS STDCALL SmRegisterInternalSubsystem (LPWSTR PgmName, NTSTATUS Status = STATUS_SUCCESS; RTL_USER_PROCESS_INFORMATION ProcessInfo; - + DPRINT("SM: %s(%S,%d) called\n",__FUNCTION__, PgmName, ImageSubsystemId); RtlZeroMemory (& ProcessInfo, sizeof ProcessInfo); @@ -65,8 +65,8 @@ NTSTATUS STDCALL SmRegisterInternalSubsystem (LPWSTR PgmName, if (NT_SUCCESS(Status)) { UNICODE_STRING SbApiPortName = {0,0,NULL}; - - RtlInitUnicodeString (& SbApiPortName, L""); + + RtlInitUnicodeString (& SbApiPortName, L""); Status = SmConnectApiPort(& SbApiPortName, (HANDLE) -1, /* internal SS have no SB port */ ImageSubsystemId, @@ -103,7 +103,7 @@ SmpLoadRequiredSubsystems (VOID) ULONG DataLength = sizeof Data; ULONG DataType = 0; - + DPRINT("SM: %s called\n", __FUNCTION__); RtlZeroMemory (Data, DataLength); @@ -116,7 +116,7 @@ SmpLoadRequiredSubsystems (VOID) { PWCHAR Name = NULL; ULONG Offset = 0; - + for (Name = Data; (Offset < DataLength); ) { if(L'\0' != *Name) @@ -154,7 +154,7 @@ SmLoadSubsystems(VOID) { NTSTATUS Status = STATUS_SUCCESS; - + DPRINT("SM: loading subsystems...\n"); /* @@ -162,7 +162,7 @@ SmLoadSubsystems(VOID) * in loading required subsystems. */ Status = SmRegisterInternalSubsystem (L"Session Manager", IMAGE_SUBSYSTEM_NATIVE, & hSmApiPort); - if(!NT_SUCCESS(Status)) + if(!NT_SUCCESS(Status)) { DPRINT1("SM: SmRegisterInternalSubsystem failed Status=%08lx\n", __FUNCTION__, Status); return Status; diff --git a/reactos/base/system/smss/initwkdll.c b/reactos/base/system/smss/initwkdll.c index 46fe7badf8d..adff8aec990 100644 --- a/reactos/base/system/smss/initwkdll.c +++ b/reactos/base/system/smss/initwkdll.c @@ -1,9 +1,9 @@ /* $Id$ * * initwkdll.c - Load the well known DLLs - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ diff --git a/reactos/base/system/smss/print.c b/reactos/base/system/smss/print.c index e8285a50554..bc02de44ac8 100644 --- a/reactos/base/system/smss/print.c +++ b/reactos/base/system/smss/print.c @@ -1,9 +1,9 @@ /* $Id$ * * print.c - Print on the blue screen - * + * * ReactOS Operating System - * + * * -------------------------------------------------------------------- * * This software is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -31,7 +31,7 @@ VOID STDCALL DisplayString(LPCWSTR lpwString) { UNICODE_STRING us; - + RtlInitUnicodeString (&us, lpwString); NtDisplayString (&us); } @@ -42,12 +42,12 @@ VOID STDCALL PrintString (char* fmt, ...) va_list ap; UNICODE_STRING UnicodeString; ANSI_STRING AnsiString; - + va_start(ap, fmt); vsprintf(buffer, fmt, ap); va_end(ap); DPRINT1("%s", buffer); - + RtlInitAnsiString (&AnsiString, buffer); RtlAnsiStringToUnicodeString (&UnicodeString, &AnsiString, diff --git a/reactos/base/system/smss/smapicomp.c b/reactos/base/system/smss/smapicomp.c index 09519c15c95..04a4d779715 100644 --- a/reactos/base/system/smss/smapicomp.c +++ b/reactos/base/system/smss/smapicomp.c @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ diff --git a/reactos/base/system/smss/smapiexec.c b/reactos/base/system/smss/smapiexec.c index 7476c0844a0..967d725afec 100644 --- a/reactos/base/system/smss/smapiexec.c +++ b/reactos/base/system/smss/smapiexec.c @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ @@ -64,7 +64,7 @@ SmCreateUserProcess (LPWSTR ImagePath, NTSTATUS Status = STATUS_SUCCESS; DPRINT("SM: %s called\n", __FUNCTION__); - + if (NULL != UserProcessInfo) { pProcessInfo = UserProcessInfo; @@ -133,9 +133,9 @@ FailProcParams: NULL, NULL, pProcessInfo); - + RtlDestroyProcessParameters (ProcessParameters); - + if (!NT_SUCCESS(Status)) { DPRINT1("SM: %s: Running \"%S\" failed (Status=0x%08lx)\n", @@ -167,7 +167,7 @@ FailProcParams: DPRINT1("SM: %s: NtWaitForSingleObject failed with Status=0x%08lx\n", __FUNCTION__, Status); } - + } if (NULL == UserProcessInfo) { @@ -207,7 +207,7 @@ SMAPI(SmExecPgm) ULONG DataLength = sizeof Data; ULONG DataType = REG_EXPAND_SZ; - + RtlZeroMemory (Name, sizeof Name); RtlCopyMemory (Name, ExecPgm->Name, diff --git a/reactos/base/system/smss/smapiquery.c b/reactos/base/system/smss/smapiquery.c index 5b8af3b7876..a258d619400 100644 --- a/reactos/base/system/smss/smapiquery.c +++ b/reactos/base/system/smss/smapiquery.c @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING.LIB. If not, write * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, - * MA 02139, USA. + * MA 02139, USA. * * -------------------------------------------------------------------- */ diff --git a/reactos/base/system/userinit/lang/bg-BG.rc b/reactos/base/system/userinit/lang/bg-BG.rc index f6a5edb791f..e5dfba2a8e1 100644 --- a/reactos/base/system/userinit/lang/bg-BG.rc +++ b/reactos/base/system/userinit/lang/bg-BG.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/lang/el-GR.rc b/reactos/base/system/userinit/lang/el-GR.rc index 4c9d8771eca..eab6fec52f3 100644 --- a/reactos/base/system/userinit/lang/el-GR.rc +++ b/reactos/base/system/userinit/lang/el-GR.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 * Greek Version by Dj Apal */ diff --git a/reactos/base/system/userinit/lang/en-US.rc b/reactos/base/system/userinit/lang/en-US.rc index d6cfb1191c0..aadc481121d 100644 --- a/reactos/base/system/userinit/lang/en-US.rc +++ b/reactos/base/system/userinit/lang/en-US.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/lang/es-ES.rc b/reactos/base/system/userinit/lang/es-ES.rc index 22a38df6db5..831f5f07dcd 100644 --- a/reactos/base/system/userinit/lang/es-ES.rc +++ b/reactos/base/system/userinit/lang/es-ES.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/lang/fr-FR.rc b/reactos/base/system/userinit/lang/fr-FR.rc index 44ea6014b44..376c6938cbc 100644 --- a/reactos/base/system/userinit/lang/fr-FR.rc +++ b/reactos/base/system/userinit/lang/fr-FR.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to Fr.rc +/* Start move all hard code string to Fr.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/lang/hu-HU.rc b/reactos/base/system/userinit/lang/hu-HU.rc index 750da4812b0..28155151eae 100644 --- a/reactos/base/system/userinit/lang/hu-HU.rc +++ b/reactos/base/system/userinit/lang/hu-HU.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 * Hungarian version is Copyright 2005 - Peter Nagy */ diff --git a/reactos/base/system/userinit/lang/it-IT.rc b/reactos/base/system/userinit/lang/it-IT.rc index a876401fb40..8490ca7ebab 100644 --- a/reactos/base/system/userinit/lang/it-IT.rc +++ b/reactos/base/system/userinit/lang/it-IT.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/lang/ja-JP.rc b/reactos/base/system/userinit/lang/ja-JP.rc index b9e7a50ea61..7b1a42c990e 100644 --- a/reactos/base/system/userinit/lang/ja-JP.rc +++ b/reactos/base/system/userinit/lang/ja-JP.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/lang/pl-PL.rc b/reactos/base/system/userinit/lang/pl-PL.rc index 2ad2d73fbb1..5b441e68bb8 100644 --- a/reactos/base/system/userinit/lang/pl-PL.rc +++ b/reactos/base/system/userinit/lang/pl-PL.rc @@ -1,9 +1,9 @@ #include "resource.h" -/* +/* * translated by xrogers (http://rogers.cyberdusk.pl/) -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE { diff --git a/reactos/base/system/userinit/lang/pt-BR.rc b/reactos/base/system/userinit/lang/pt-BR.rc index 95d4da3f215..10128398555 100644 --- a/reactos/base/system/userinit/lang/pt-BR.rc +++ b/reactos/base/system/userinit/lang/pt-BR.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/lang/ru-RU.rc b/reactos/base/system/userinit/lang/ru-RU.rc index a06133fee6b..8102d9f0898 100644 --- a/reactos/base/system/userinit/lang/ru-RU.rc +++ b/reactos/base/system/userinit/lang/ru-RU.rc @@ -1,5 +1,5 @@ #include "resource.h" -/* Start move all hard code string to En.rc +/* Start move all hard code string to En.rc * By Magnus Olsen 2005 */ diff --git a/reactos/base/system/userinit/resource.h b/reactos/base/system/userinit/resource.h index d19ca24ced2..ab26523f006 100644 --- a/reactos/base/system/userinit/resource.h +++ b/reactos/base/system/userinit/resource.h @@ -5,7 +5,7 @@ - + diff --git a/reactos/base/system/winlogon/lang/bg-BG.rc b/reactos/base/system/winlogon/lang/bg-BG.rc index 99437fb0175..5f109ba5e20 100644 --- a/reactos/base/system/winlogon/lang/bg-BG.rc +++ b/reactos/base/system/winlogon/lang/bg-BG.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "Ïðå&çàïóñê", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Ïîäãîòîâêà íà ìðåæîâèòå ñâúðçâàíèÿ..." IDS_APPLYINGCOMPUTERSETTINGS "Ïðèëàãàíå íàñòðîéêèòå íà êîìïþòúðà..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ÐåàêòÎÑ òðúãâà..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Óüèíëîãîí íå óñïÿ äà çàäåéñòâà ïîòðåáèòåëñêàòà îáâèâêà!" END diff --git a/reactos/base/system/winlogon/lang/cs-CZ.rc b/reactos/base/system/winlogon/lang/cs-CZ.rc index 7e79f639b1f..1cbe4cd4518 100644 --- a/reactos/base/system/winlogon/lang/cs-CZ.rc +++ b/reactos/base/system/winlogon/lang/cs-CZ.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "&Restart", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Pøíprava síových pøipojení..." IDS_APPLYINGCOMPUTERSETTINGS "Nastavení poèítaèe..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS se spouští..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Aplikace Winlogon selhala pøi aktivaci shellu!" END diff --git a/reactos/base/system/winlogon/lang/en-US.rc b/reactos/base/system/winlogon/lang/en-US.rc index 129df72c19c..87cb0710df2 100644 --- a/reactos/base/system/winlogon/lang/en-US.rc +++ b/reactos/base/system/winlogon/lang/en-US.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "&Restart", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Preparing network connections..." IDS_APPLYINGCOMPUTERSETTINGS "Applying computer settings..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS is starting up..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon failed to activate user shell!" END diff --git a/reactos/base/system/winlogon/lang/es-ES.rc b/reactos/base/system/winlogon/lang/es-ES.rc index a135db6d293..0e99abc8f51 100644 --- a/reactos/base/system/winlogon/lang/es-ES.rc +++ b/reactos/base/system/winlogon/lang/es-ES.rc @@ -22,7 +22,7 @@ BEGIN DEFPUSHBUTTON "&Reiniciar", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Preparando las conexiones de red..." IDS_APPLYINGCOMPUTERSETTINGS "Aplicando los parámetros de configuración..." @@ -40,7 +40,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS se está iniciando..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "!Winlogon falló al activar el shell de usuario!" END diff --git a/reactos/base/system/winlogon/lang/fr-FR.rc b/reactos/base/system/winlogon/lang/fr-FR.rc index 9d31257e34a..a805f1ff1ee 100644 --- a/reactos/base/system/winlogon/lang/fr-FR.rc +++ b/reactos/base/system/winlogon/lang/fr-FR.rc @@ -22,7 +22,7 @@ BEGIN DEFPUSHBUTTON "&Redémarrer", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Préparation des connections réseau..." IDS_APPLYINGCOMPUTERSETTINGS "Application des paramètres de l'ordinateur..." @@ -40,7 +40,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "Démarrage de ReactOS..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon a échoué lors de l'activation du shell!" END diff --git a/reactos/base/system/winlogon/lang/hu-HU.rc b/reactos/base/system/winlogon/lang/hu-HU.rc index 7902130276c..bd8962de726 100644 --- a/reactos/base/system/winlogon/lang/hu-HU.rc +++ b/reactos/base/system/winlogon/lang/hu-HU.rc @@ -24,7 +24,7 @@ BEGIN DEFPUSHBUTTON "&Újraindítás", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Hálózati kapcsolatok elõkészítése..." IDS_APPLYINGCOMPUTERSETTINGS "Beállítások érvényesítése..." @@ -42,7 +42,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "A ReactOS indul..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "A Winlogon nemtudta elindítani a felhasználói felületet!" END diff --git a/reactos/base/system/winlogon/lang/id-ID.rc b/reactos/base/system/winlogon/lang/id-ID.rc index 3d258160528..63b9c169ec9 100644 --- a/reactos/base/system/winlogon/lang/id-ID.rc +++ b/reactos/base/system/winlogon/lang/id-ID.rc @@ -22,7 +22,7 @@ BEGIN DEFPUSHBUTTON "&Mulai Lagi", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Menyiapkan koneksi jaringan..." IDS_APPLYINGCOMPUTERSETTINGS "Menerapkan setelan komputer..." @@ -40,7 +40,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS dimulai..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon gagal untuk mengaktifkan shell pengguna!" END diff --git a/reactos/base/system/winlogon/lang/it-IT.rc b/reactos/base/system/winlogon/lang/it-IT.rc index 9e1bdfb6dbc..c3a9f381dcf 100644 --- a/reactos/base/system/winlogon/lang/it-IT.rc +++ b/reactos/base/system/winlogon/lang/it-IT.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "&Riavvio", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Preparazione connessioni di rete..." IDS_APPLYINGCOMPUTERSETTINGS "Attivazione delle impostazioni del computer..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS sta avviandosi..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon non ha potuto avviare l'ambiente utente!" END diff --git a/reactos/base/system/winlogon/lang/ja-JP.rc b/reactos/base/system/winlogon/lang/ja-JP.rc index 3ffb1e21b0e..ba5737137a5 100644 --- a/reactos/base/system/winlogon/lang/ja-JP.rc +++ b/reactos/base/system/winlogon/lang/ja-JP.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "Ä‹N“®(&R)", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "ƒlƒbƒgƒ[ƒNÚ‘±‚ð€”õ‚µ‚Ä‚¢‚Ü‚·..." IDS_APPLYINGCOMPUTERSETTINGS "ƒRƒ“ƒsƒ…[ƒ^‚ÌÝ’è‚ð“K—p‚µ‚Ä‚¢‚Ü‚·..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS ‚ð‹N“®‚µ‚Ä‚¢‚Ü‚·..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon ‚̓†[ƒU[ ƒVƒFƒ‹‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½!" END diff --git a/reactos/base/system/winlogon/lang/lt-LT.rc b/reactos/base/system/winlogon/lang/lt-LT.rc index 9db1d9cb615..6e5441b810b 100644 --- a/reactos/base/system/winlogon/lang/lt-LT.rc +++ b/reactos/base/system/winlogon/lang/lt-LT.rc @@ -22,7 +22,7 @@ BEGIN DEFPUSHBUTTON "&Perkrauti", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Ruoðiami tinklo susijungimai..." IDS_APPLYINGCOMPUTERSETTINGS "Pritaikomos kompiuterio nuostatos..." @@ -40,7 +40,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "Paleidþiama ReactOS..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon nepavyko aktyvuoti vartotojo aplinkos!" END diff --git a/reactos/base/system/winlogon/lang/nl-NL.rc b/reactos/base/system/winlogon/lang/nl-NL.rc index 47ae3aee00e..c05213d232b 100644 --- a/reactos/base/system/winlogon/lang/nl-NL.rc +++ b/reactos/base/system/winlogon/lang/nl-NL.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "&Restart", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Netwerkverbindingen voorbereiden..." IDS_APPLYINGCOMPUTERSETTINGS "Computerinstellingen aanbrengen..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS is aan het opstarten..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon heeft de gebruikers shell niet kunnen activeren!" END diff --git a/reactos/base/system/winlogon/lang/pl-PL.rc b/reactos/base/system/winlogon/lang/pl-PL.rc index 934d95eeb3c..5ea33a1e7fb 100644 --- a/reactos/base/system/winlogon/lang/pl-PL.rc +++ b/reactos/base/system/winlogon/lang/pl-PL.rc @@ -21,7 +21,7 @@ BEGIN DEFPUSHBUTTON "&Uruchom ponownie", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Trwa przygotowywanie po³¹czeñ sieciowych..." IDS_APPLYINGCOMPUTERSETTINGS "Trwa wprowadzanie ustawieñ komputera..." @@ -39,7 +39,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "Trwa uruchamianie systemu ReactOS..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon nie móg³ aktywowaæ pow³oki u¿ytkownika!" END diff --git a/reactos/base/system/winlogon/lang/ru-RU.rc b/reactos/base/system/winlogon/lang/ru-RU.rc index f49fbbaab69..562c9a04ed7 100644 --- a/reactos/base/system/winlogon/lang/ru-RU.rc +++ b/reactos/base/system/winlogon/lang/ru-RU.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "&Ïåðåçàãðóçêà", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Ïîäãîòàâëèâàþòñÿ ñåòåâûå ïîäêëþ÷åíèÿ..." IDS_APPLYINGCOMPUTERSETTINGS "Ïðèìåíÿþòñÿ íàñòðîéêè..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS çàãðóæàåòñÿ..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon íå ìîæåò àêòèâèðîâàòü ïîëüçîâàòåëüñêèé èíòåðôåéñ!" END diff --git a/reactos/base/system/winlogon/lang/sv-SE.rc b/reactos/base/system/winlogon/lang/sv-SE.rc index 0c70e6150d0..a5464966a0a 100644 --- a/reactos/base/system/winlogon/lang/sv-SE.rc +++ b/reactos/base/system/winlogon/lang/sv-SE.rc @@ -22,7 +22,7 @@ BEGIN DEFPUSHBUTTON "&Starta om", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "Förbereder nätverksanslutningar..." IDS_APPLYINGCOMPUTERSETTINGS "Verkställer datorns inställningar..." @@ -40,7 +40,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS startas..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon kunde inte ladda användarskalet!" END diff --git a/reactos/base/system/winlogon/lang/uk-UA.rc b/reactos/base/system/winlogon/lang/uk-UA.rc index 30a13b4692e..541503a12d5 100644 --- a/reactos/base/system/winlogon/lang/uk-UA.rc +++ b/reactos/base/system/winlogon/lang/uk-UA.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "&Ïåðåçàâàíòàæåííÿ", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "ϳäãîòîâêà ìåðåæíèõ ï³äêëþ÷åíü..." IDS_APPLYINGCOMPUTERSETTINGS "Çàñòîñóâàííÿ ïàðàìåòð³â êîìï'þòåðà..." @@ -38,7 +38,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "Çàïóñê ReactOS..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon íå âäàëîñÿ àêòèâóâàòè îáîëîíêó êîðèñòóâà÷à!" END diff --git a/reactos/base/system/winlogon/lang/zh-CN.rc b/reactos/base/system/winlogon/lang/zh-CN.rc index 3ad737c3359..eac20e5418b 100644 --- a/reactos/base/system/winlogon/lang/zh-CN.rc +++ b/reactos/base/system/winlogon/lang/zh-CN.rc @@ -40,7 +40,7 @@ BEGIN DEFPUSHBUTTON "ÖØÐÂÆô¶¯(&R)", 1, 80, 91, 68, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_PREPARENETWORKCONNECTIONS "ÕýÔÚ×¼±¸ÍøÂçÁ¬½Ó..." IDS_APPLYINGCOMPUTERSETTINGS "ÕýÔÚÓ¦ÓüÆËã»úÉèÖÃ..." @@ -58,7 +58,7 @@ BEGIN IDS_REACTOSISSTARTINGUP "ReactOS ÕýÔÚÆô¶¯..." END -STRINGTABLE +STRINGTABLE BEGIN IDS_FAILEDACTIVATEUSERSHELL "Winlogon ¼¤»îÓû§²Ù×÷½çÃæʧ°Ü!" END diff --git a/reactos/base/system/winlogon/sas.c b/reactos/base/system/winlogon/sas.c index 8e1981cabf7..d11a879ffea 100644 --- a/reactos/base/system/winlogon/sas.c +++ b/reactos/base/system/winlogon/sas.c @@ -328,7 +328,7 @@ CreateLogoffSecurityAttributes( #else /* The following code is no only incomplete, it's a mess and uncompilable */ /* Still, it gives some ideas about data types and functions involved and */ - /* required to set up a SECURITY_DESCRIPTOR for a SECURITY_ATTRIBUTES */ + /* required to set up a SECURITY_DESCRIPTOR for a SECURITY_ATTRIBUTES */ /* instance for a thread, to allow that thread to ImpersonateLoggedOnUser(). */ /* Specifically THREAD_SET_THREAD_TOKEN is required. */ PSECURITY_DESCRIPTOR psd = 0; @@ -396,10 +396,10 @@ CreateLogoffSecurityAttributes( ea[0].Trustee.TrusteeType = TRUSTEE_IS_USER; ea[0].Trustee.ptstrName = (LPTSTR) pEveryoneSID; - if (!SetSecurityDescriptorDacl(pSD, - TRUE, // bDaclPresent flag - pACL, - FALSE)) // not a default DACL + if (!SetSecurityDescriptorDacl(pSD, + TRUE, // bDaclPresent flag + pACL, + FALSE)) // not a default DACL { DPRINT("SetSecurityDescriptorDacl Error %u\n", GetLastError()); HeapFree(GetProcessHeap(), 0, pMem); diff --git a/reactos/base/system/winlogon/screensaver.c b/reactos/base/system/winlogon/screensaver.c index 9c0971b235b..8dc3c061c47 100644 --- a/reactos/base/system/winlogon/screensaver.c +++ b/reactos/base/system/winlogon/screensaver.c @@ -280,7 +280,7 @@ StartScreenSaver( if (bufferSize == 0) goto cleanup; - + szApplicationName[bufferSize] = 0; /* Terminate the string */ if (wcslen(szApplicationName) == 0) diff --git a/reactos/boot/freeldr/FREELDR.INI b/reactos/boot/freeldr/FREELDR.INI index c829b87da4e..63f712361a3 100644 --- a/reactos/boot/freeldr/FREELDR.INI +++ b/reactos/boot/freeldr/FREELDR.INI @@ -83,7 +83,7 @@ TimeOut=10 ; 0x503C for 80x60 [Display] DisplayMode=NORMAL_VGA -TitleText=Brian’s Custom FreeLoader Boot Disk +TitleText=Brian’s Custom FreeLoader Boot Disk StatusBarColor=Cyan StatusBarTextColor=Black BackdropTextColor=White diff --git a/reactos/boot/freeldr/bootsect/fat.h b/reactos/boot/freeldr/bootsect/fat.h index 51a61efd4b3..dfb55ad21f7 100644 --- a/reactos/boot/freeldr/bootsect/fat.h +++ b/reactos/boot/freeldr/bootsect/fat.h @@ -1,35 +1,35 @@ unsigned char fat_data[] = { -0xeb, 0x3c, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00, -0x02, 0xe0, 0x00, 0x40, 0x0b, 0xf0, 0x09, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, -0x4d, 0x45, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, -0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0xf2, 0x7b, 0x8e, 0xd8, 0x8e, 0xc0, 0x80, 0x7e, 0x24, 0xff, -0x75, 0x03, 0x88, 0x56, 0x24, 0xb4, 0x08, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff, -0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, 0x66, 0x0f, 0xb6, -0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1, -0x66, 0xf7, 0xe3, 0x66, 0x89, 0x46, 0xf8, 0x31, 0xc0, 0x31, 0xc9, 0x8a, 0x46, 0x10, 0xf7, 0x66, -0x16, 0x03, 0x46, 0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x11, 0xca, 0x89, 0x46, 0xfc, 0x89, -0x56, 0xfe, 0x8b, 0x76, 0x11, 0x60, 0x31, 0xd2, 0xb8, 0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b, -0x01, 0xd8, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11, 0x4e, 0xfe, 0x61, 0xbb, 0xe0, 0x07, 0x8e, -0xc3, 0x31, 0xdb, 0x31, 0xc9, 0x41, 0x31, 0xff, 0x06, 0xe8, 0x78, 0x00, 0x07, 0x26, 0x38, 0x2d, -0x74, 0x38, 0x60, 0xb1, 0x0b, 0xbe, 0xef, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x0e, 0x4e, 0x74, 0x2a, -0x83, 0xc7, 0x20, 0x81, 0xff, 0x00, 0x02, 0x72, 0xe4, 0xeb, 0xd1, 0x26, 0x8b, 0x45, 0x1a, 0x50, -0x68, 0x00, 0x08, 0x07, 0xe8, 0x3c, 0x00, 0x58, 0xc7, 0x46, 0xf6, 0x44, 0x7d, 0xc7, 0x46, 0xf4, -0x33, 0x7d, 0xc7, 0x46, 0xf2, 0x1c, 0x7d, 0xe9, 0xf9, 0x02, 0xbe, 0xc7, 0x7d, 0xe8, 0x0c, 0x00, -0xbe, 0xdf, 0x7d, 0xe8, 0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, -0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0xbe, 0xba, 0x7d, 0xe8, 0xeb, -0xff, 0xeb, 0xdd, 0x48, 0x48, 0x30, 0xed, 0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, -0x56, 0xfe, 0x31, 0xdb, 0x60, 0x49, 0x01, 0xc8, 0x83, 0xd2, 0x00, 0x3b, 0x56, 0xfa, 0x77, 0x07, -0x72, 0x31, 0x3b, 0x46, 0xf8, 0x76, 0x2c, 0x61, 0x60, 0x66, 0x6a, 0x00, 0x52, 0x50, 0x06, 0x53, -0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x56, 0x24, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0xbc, 0x83, -0xc4, 0x10, 0x61, 0x40, 0x83, 0xd2, 0x00, 0x53, 0x8c, 0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b, -0xe2, 0xd6, 0xc3, 0x61, 0x60, 0x91, 0x92, 0x31, 0xd2, 0xf7, 0x76, 0x18, 0x91, 0xf7, 0x76, 0x18, -0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x24, 0x88, 0xc5, 0xc0, 0xcc, 0x02, -0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x82, 0x61, 0x40, 0x75, 0x01, 0x42, 0x53, 0x8c, -0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b, 0xe2, 0xcb, 0xc3, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65, -0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, -0x79, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x50, -0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x46, +0xeb, 0x3c, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00, +0x02, 0xe0, 0x00, 0x40, 0x0b, 0xf0, 0x09, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, +0x4d, 0x45, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, +0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0xf2, 0x7b, 0x8e, 0xd8, 0x8e, 0xc0, 0x80, 0x7e, 0x24, 0xff, +0x75, 0x03, 0x88, 0x56, 0x24, 0xb4, 0x08, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff, +0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, 0x66, 0x0f, 0xb6, +0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1, +0x66, 0xf7, 0xe3, 0x66, 0x89, 0x46, 0xf8, 0x31, 0xc0, 0x31, 0xc9, 0x8a, 0x46, 0x10, 0xf7, 0x66, +0x16, 0x03, 0x46, 0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x11, 0xca, 0x89, 0x46, 0xfc, 0x89, +0x56, 0xfe, 0x8b, 0x76, 0x11, 0x60, 0x31, 0xd2, 0xb8, 0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b, +0x01, 0xd8, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11, 0x4e, 0xfe, 0x61, 0xbb, 0xe0, 0x07, 0x8e, +0xc3, 0x31, 0xdb, 0x31, 0xc9, 0x41, 0x31, 0xff, 0x06, 0xe8, 0x78, 0x00, 0x07, 0x26, 0x38, 0x2d, +0x74, 0x38, 0x60, 0xb1, 0x0b, 0xbe, 0xef, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x0e, 0x4e, 0x74, 0x2a, +0x83, 0xc7, 0x20, 0x81, 0xff, 0x00, 0x02, 0x72, 0xe4, 0xeb, 0xd1, 0x26, 0x8b, 0x45, 0x1a, 0x50, +0x68, 0x00, 0x08, 0x07, 0xe8, 0x3c, 0x00, 0x58, 0xc7, 0x46, 0xf6, 0x44, 0x7d, 0xc7, 0x46, 0xf4, +0x33, 0x7d, 0xc7, 0x46, 0xf2, 0x1c, 0x7d, 0xe9, 0xf9, 0x02, 0xbe, 0xc7, 0x7d, 0xe8, 0x0c, 0x00, +0xbe, 0xdf, 0x7d, 0xe8, 0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, +0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0xbe, 0xba, 0x7d, 0xe8, 0xeb, +0xff, 0xeb, 0xdd, 0x48, 0x48, 0x30, 0xed, 0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, +0x56, 0xfe, 0x31, 0xdb, 0x60, 0x49, 0x01, 0xc8, 0x83, 0xd2, 0x00, 0x3b, 0x56, 0xfa, 0x77, 0x07, +0x72, 0x31, 0x3b, 0x46, 0xf8, 0x76, 0x2c, 0x61, 0x60, 0x66, 0x6a, 0x00, 0x52, 0x50, 0x06, 0x53, +0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x56, 0x24, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0xbc, 0x83, +0xc4, 0x10, 0x61, 0x40, 0x83, 0xd2, 0x00, 0x53, 0x8c, 0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b, +0xe2, 0xd6, 0xc3, 0x61, 0x60, 0x91, 0x92, 0x31, 0xd2, 0xf7, 0x76, 0x18, 0x91, 0xf7, 0x76, 0x18, +0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x24, 0x88, 0xc5, 0xc0, 0xcc, 0x02, +0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x82, 0x61, 0x40, 0x75, 0x01, 0x42, 0x53, 0x8c, +0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b, 0xe2, 0xcb, 0xc3, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65, +0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, +0x79, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x50, +0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa }; diff --git a/reactos/boot/freeldr/bootsect/fat32.h b/reactos/boot/freeldr/bootsect/fat32.h index c25fae32f38..b9b9d6875ca 100644 --- a/reactos/boot/freeldr/bootsect/fat32.h +++ b/reactos/boot/freeldr/bootsect/fat32.h @@ -1,67 +1,67 @@ unsigned char fat32_data[] = { -0xeb, 0x58, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x00, 0x20, 0x00, -0x02, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x20, -0x20, 0x20, 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, 0x8e, 0xd8, 0x8e, 0xc0, -0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0x00, 0x7c, 0x80, 0x7e, 0x40, 0xff, 0x75, 0x03, 0x88, 0x56, -0x40, 0x83, 0x7e, 0x16, 0x00, 0x75, 0x0d, 0x66, 0x83, 0x7e, 0x11, 0x00, 0x75, 0x06, 0x83, 0x7e, -0x2a, 0x00, 0x76, 0x03, 0xe9, 0xff, 0x00, 0xb8, 0x00, 0x08, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x73, -0x05, 0xb9, 0xff, 0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, -0x66, 0x0f, 0xb6, 0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43, -0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0xa3, 0xa7, 0x7d, 0x66, 0xb8, 0x0e, 0x00, 0x00, 0x00, -0x66, 0x03, 0x46, 0x1c, 0xb9, 0x01, 0x00, 0x31, 0xdb, 0x8e, 0xc3, 0xbb, 0x00, 0x7e, 0xe8, 0x03, -0x00, 0xe9, 0x2c, 0x01, 0x66, 0x3b, 0x06, 0xa7, 0x7d, 0x73, 0x1b, 0x66, 0x60, 0xb4, 0x41, 0xbb, -0xaa, 0x55, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x72, 0x55, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x4f, 0xf6, -0xc1, 0x01, 0x74, 0x4a, 0x66, 0x61, 0x66, 0x60, 0x81, 0xf9, 0x40, 0x00, 0x76, 0x03, 0xb9, 0x40, -0x00, 0x89, 0x0e, 0x3a, 0x7d, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x53, 0x51, 0x6a, 0x10, 0x89, -0xe6, 0x8a, 0x56, 0x40, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0x63, 0x83, 0xc4, 0x10, 0x66, 0x61, 0x53, -0x66, 0x8b, 0x1e, 0x3a, 0x7d, 0x66, 0x01, 0xd8, 0x66, 0xc1, 0xe3, 0x05, 0x8c, 0xc2, 0x01, 0xda, -0x8e, 0xc2, 0x5b, 0x2b, 0x0e, 0x3a, 0x7d, 0x75, 0xbd, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x66, 0x61, -0x66, 0x60, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x4e, 0x18, 0x66, 0xf7, 0xf1, 0xfe, 0xc2, 0x88, -0xd1, 0x66, 0x89, 0xc2, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x40, -0x88, 0xc5, 0xd0, 0xcc, 0xd0, 0xcc, 0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x0e, 0x66, -0x61, 0x66, 0x40, 0x8c, 0xc2, 0x83, 0xc2, 0x20, 0x8e, 0xc2, 0xe2, 0xc4, 0xc3, 0xbe, 0xab, 0x7d, -0xe8, 0x15, 0x00, 0xe9, 0x06, 0x00, 0xbe, 0xb8, 0x7d, 0xe8, 0x0c, 0x00, 0xbe, 0xcc, 0x7d, 0xe8, -0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, 0x09, 0xb4, 0x0e, 0xbb, -0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x44, 0x69, 0x73, 0x6b, 0x20, -0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x79, 0x73, -0x74, 0x65, 0x6d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, -0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x73, -0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, -0x66, 0x8b, 0x46, 0x2c, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72, 0x03, 0xe9, 0x67, 0x01, 0xbb, -0x00, 0x20, 0x8e, 0xc3, 0xe8, 0x27, 0x01, 0x31, 0xdb, 0x8a, 0x5e, 0x0d, 0xc1, 0xe3, 0x04, 0xb8, -0x00, 0x20, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x2a, -0x4b, 0x75, 0x03, 0xe9, 0x40, 0x01, 0x8c, 0xc0, 0x05, 0x02, 0x00, 0x8e, 0xc0, 0x31, 0xff, 0xbe, -0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x11, 0x4b, 0x75, 0xea, 0x66, 0x8b, 0x46, 0x2c, -0xe8, 0x6f, 0x00, 0x66, 0x89, 0x46, 0x2c, 0xe9, 0xa6, 0xff, 0xbe, 0xa8, 0x7f, 0xe8, 0x38, 0xff, -0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x14, 0x66, 0xc1, 0xe0, 0x10, 0x26, 0x8b, 0x45, 0x1a, -0x66, 0x3d, 0x02, 0x00, 0x00, 0x00, 0x73, 0x03, 0xe9, 0x0b, 0xff, 0x66, 0x3d, 0xf8, 0xff, 0xff, -0x0f, 0x72, 0x03, 0xe9, 0x00, 0xff, 0xbb, 0x00, 0x08, 0x8e, 0xc3, 0x66, 0x3d, 0xf8, 0xff, 0xff, -0x0f, 0x73, 0x21, 0x66, 0x50, 0x31, 0xdb, 0x06, 0xe8, 0xa3, 0x00, 0x07, 0x31, 0xdb, 0x8a, 0x5e, -0x0d, 0xc1, 0xe3, 0x05, 0x8c, 0xc0, 0x01, 0xd8, 0x8e, 0xc0, 0x66, 0x58, 0x06, 0xe8, 0x12, 0x00, -0x07, 0xe9, 0xd7, 0xff, 0x8a, 0x56, 0x40, 0x8a, 0x36, 0xfd, 0x7d, 0x31, 0xc0, 0x50, 0x68, 0x00, -0x80, 0xcb, 0x66, 0xc1, 0xe0, 0x02, 0x66, 0x89, 0xc1, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x5e, -0x0b, 0x66, 0x53, 0x66, 0xf7, 0xf3, 0x66, 0x0f, 0xb7, 0x5e, 0x0e, 0x66, 0x01, 0xd8, 0x66, 0x8b, -0x5e, 0x1c, 0x66, 0x01, 0xd8, 0x66, 0x5b, 0x66, 0x4b, 0x66, 0x21, 0xd9, 0x66, 0x0f, 0xb7, 0x5e, -0x28, 0x81, 0xe3, 0x0f, 0x00, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x72, 0x03, 0xe9, 0x87, 0xfe, 0x66, -0x50, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x5a, 0x66, 0x01, 0xd0, 0x66, 0x51, 0x66, -0x3b, 0x06, 0x3a, 0x7f, 0x74, 0x11, 0x66, 0xa3, 0x3a, 0x7f, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x31, -0xdb, 0xb9, 0x01, 0x00, 0xe8, 0xad, 0xfd, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x66, 0x59, 0x26, 0x66, -0x67, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x66, 0x48, -0x66, 0x48, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x66, 0xf7, 0xe3, 0x66, 0x50, 0x66, -0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0xf7, 0x66, 0x24, 0x66, 0x0f, 0xb7, 0x5e, 0x0e, -0x66, 0x01, 0xd8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x5b, 0x66, 0x01, 0xd8, 0x31, 0xdb, 0x0f, 0xb6, -0x4e, 0x0d, 0xe8, 0x5f, 0xfd, 0xc3, 0xbe, 0x85, 0x7f, 0xe8, 0x1c, 0xfe, 0xbe, 0xcc, 0x7d, 0xe8, -0x16, 0xfe, 0xe9, 0x07, 0xfe, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, 0x79, 0x73, -0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45, -0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, -0x46, 0x72, 0x65, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xeb, 0x58, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x00, 0x20, 0x00, +0x02, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x20, +0x20, 0x20, 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, 0x8e, 0xd8, 0x8e, 0xc0, +0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0x00, 0x7c, 0x80, 0x7e, 0x40, 0xff, 0x75, 0x03, 0x88, 0x56, +0x40, 0x83, 0x7e, 0x16, 0x00, 0x75, 0x0d, 0x66, 0x83, 0x7e, 0x11, 0x00, 0x75, 0x06, 0x83, 0x7e, +0x2a, 0x00, 0x76, 0x03, 0xe9, 0xff, 0x00, 0xb8, 0x00, 0x08, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x73, +0x05, 0xb9, 0xff, 0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, +0x66, 0x0f, 0xb6, 0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43, +0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0xa3, 0xa7, 0x7d, 0x66, 0xb8, 0x0e, 0x00, 0x00, 0x00, +0x66, 0x03, 0x46, 0x1c, 0xb9, 0x01, 0x00, 0x31, 0xdb, 0x8e, 0xc3, 0xbb, 0x00, 0x7e, 0xe8, 0x03, +0x00, 0xe9, 0x2c, 0x01, 0x66, 0x3b, 0x06, 0xa7, 0x7d, 0x73, 0x1b, 0x66, 0x60, 0xb4, 0x41, 0xbb, +0xaa, 0x55, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x72, 0x55, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x4f, 0xf6, +0xc1, 0x01, 0x74, 0x4a, 0x66, 0x61, 0x66, 0x60, 0x81, 0xf9, 0x40, 0x00, 0x76, 0x03, 0xb9, 0x40, +0x00, 0x89, 0x0e, 0x3a, 0x7d, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x53, 0x51, 0x6a, 0x10, 0x89, +0xe6, 0x8a, 0x56, 0x40, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0x63, 0x83, 0xc4, 0x10, 0x66, 0x61, 0x53, +0x66, 0x8b, 0x1e, 0x3a, 0x7d, 0x66, 0x01, 0xd8, 0x66, 0xc1, 0xe3, 0x05, 0x8c, 0xc2, 0x01, 0xda, +0x8e, 0xc2, 0x5b, 0x2b, 0x0e, 0x3a, 0x7d, 0x75, 0xbd, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x66, 0x61, +0x66, 0x60, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x4e, 0x18, 0x66, 0xf7, 0xf1, 0xfe, 0xc2, 0x88, +0xd1, 0x66, 0x89, 0xc2, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x40, +0x88, 0xc5, 0xd0, 0xcc, 0xd0, 0xcc, 0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x0e, 0x66, +0x61, 0x66, 0x40, 0x8c, 0xc2, 0x83, 0xc2, 0x20, 0x8e, 0xc2, 0xe2, 0xc4, 0xc3, 0xbe, 0xab, 0x7d, +0xe8, 0x15, 0x00, 0xe9, 0x06, 0x00, 0xbe, 0xb8, 0x7d, 0xe8, 0x0c, 0x00, 0xbe, 0xcc, 0x7d, 0xe8, +0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, 0x09, 0xb4, 0x0e, 0xbb, +0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x44, 0x69, 0x73, 0x6b, 0x20, +0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x79, 0x73, +0x74, 0x65, 0x6d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, +0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x73, +0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, +0x66, 0x8b, 0x46, 0x2c, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72, 0x03, 0xe9, 0x67, 0x01, 0xbb, +0x00, 0x20, 0x8e, 0xc3, 0xe8, 0x27, 0x01, 0x31, 0xdb, 0x8a, 0x5e, 0x0d, 0xc1, 0xe3, 0x04, 0xb8, +0x00, 0x20, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x2a, +0x4b, 0x75, 0x03, 0xe9, 0x40, 0x01, 0x8c, 0xc0, 0x05, 0x02, 0x00, 0x8e, 0xc0, 0x31, 0xff, 0xbe, +0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x11, 0x4b, 0x75, 0xea, 0x66, 0x8b, 0x46, 0x2c, +0xe8, 0x6f, 0x00, 0x66, 0x89, 0x46, 0x2c, 0xe9, 0xa6, 0xff, 0xbe, 0xa8, 0x7f, 0xe8, 0x38, 0xff, +0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x14, 0x66, 0xc1, 0xe0, 0x10, 0x26, 0x8b, 0x45, 0x1a, +0x66, 0x3d, 0x02, 0x00, 0x00, 0x00, 0x73, 0x03, 0xe9, 0x0b, 0xff, 0x66, 0x3d, 0xf8, 0xff, 0xff, +0x0f, 0x72, 0x03, 0xe9, 0x00, 0xff, 0xbb, 0x00, 0x08, 0x8e, 0xc3, 0x66, 0x3d, 0xf8, 0xff, 0xff, +0x0f, 0x73, 0x21, 0x66, 0x50, 0x31, 0xdb, 0x06, 0xe8, 0xa3, 0x00, 0x07, 0x31, 0xdb, 0x8a, 0x5e, +0x0d, 0xc1, 0xe3, 0x05, 0x8c, 0xc0, 0x01, 0xd8, 0x8e, 0xc0, 0x66, 0x58, 0x06, 0xe8, 0x12, 0x00, +0x07, 0xe9, 0xd7, 0xff, 0x8a, 0x56, 0x40, 0x8a, 0x36, 0xfd, 0x7d, 0x31, 0xc0, 0x50, 0x68, 0x00, +0x80, 0xcb, 0x66, 0xc1, 0xe0, 0x02, 0x66, 0x89, 0xc1, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x5e, +0x0b, 0x66, 0x53, 0x66, 0xf7, 0xf3, 0x66, 0x0f, 0xb7, 0x5e, 0x0e, 0x66, 0x01, 0xd8, 0x66, 0x8b, +0x5e, 0x1c, 0x66, 0x01, 0xd8, 0x66, 0x5b, 0x66, 0x4b, 0x66, 0x21, 0xd9, 0x66, 0x0f, 0xb7, 0x5e, +0x28, 0x81, 0xe3, 0x0f, 0x00, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x72, 0x03, 0xe9, 0x87, 0xfe, 0x66, +0x50, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x5a, 0x66, 0x01, 0xd0, 0x66, 0x51, 0x66, +0x3b, 0x06, 0x3a, 0x7f, 0x74, 0x11, 0x66, 0xa3, 0x3a, 0x7f, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x31, +0xdb, 0xb9, 0x01, 0x00, 0xe8, 0xad, 0xfd, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x66, 0x59, 0x26, 0x66, +0x67, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x66, 0x48, +0x66, 0x48, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x66, 0xf7, 0xe3, 0x66, 0x50, 0x66, +0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0xf7, 0x66, 0x24, 0x66, 0x0f, 0xb7, 0x5e, 0x0e, +0x66, 0x01, 0xd8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x5b, 0x66, 0x01, 0xd8, 0x31, 0xdb, 0x0f, 0xb6, +0x4e, 0x0d, 0xe8, 0x5f, 0xfd, 0xc3, 0xbe, 0x85, 0x7f, 0xe8, 0x1c, 0xfe, 0xbe, 0xcc, 0x7d, 0xe8, +0x16, 0xfe, 0xe9, 0x07, 0xfe, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, 0x79, 0x73, +0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45, +0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, +0x46, 0x72, 0x65, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa }; diff --git a/reactos/boot/freeldr/fdebug/lang/de-DE.rc b/reactos/boot/freeldr/fdebug/lang/de-DE.rc index 1acbf55d4a0..86f024f643a 100644 --- a/reactos/boot/freeldr/fdebug/lang/de-DE.rc +++ b/reactos/boot/freeldr/fdebug/lang/de-DE.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&Datei" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -161,14 +161,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Hello World!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Dieses Programm ist kostenlos; Sie können es frei verteilen mit od. ohne Änderungen unter der GNU Lesser General Public License wie es von der Free Software Foundation veröffentlicht wurde; entweder Version 2.1 der Lizenz, oder eine spätere Version (ihrer Wahl).\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." END diff --git a/reactos/boot/freeldr/fdebug/lang/en-US.rc b/reactos/boot/freeldr/fdebug/lang/en-US.rc index 9fca9f70907..9ce62aec9cd 100644 --- a/reactos/boot/freeldr/fdebug/lang/en-US.rc +++ b/reactos/boot/freeldr/fdebug/lang/en-US.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -162,14 +162,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Hello World!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." END diff --git a/reactos/boot/freeldr/fdebug/lang/fr-FR.rc b/reactos/boot/freeldr/fdebug/lang/fr-FR.rc index 40c6726a67d..951c61a4b74 100644 --- a/reactos/boot/freeldr/fdebug/lang/fr-FR.rc +++ b/reactos/boot/freeldr/fdebug/lang/fr-FR.rc @@ -21,7 +21,7 @@ IDI_FDEBUG ICON DISCARDABLE "fdebug.ico" // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&Fichier" BEGIN @@ -49,7 +49,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -62,7 +62,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -71,13 +71,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -91,7 +91,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -135,7 +135,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -171,14 +171,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Hello World!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." END diff --git a/reactos/boot/freeldr/fdebug/lang/hu-HU.rc b/reactos/boot/freeldr/fdebug/lang/hu-HU.rc index 28c84abbd83..9d4eb414e5e 100644 --- a/reactos/boot/freeldr/fdebug/lang/hu-HU.rc +++ b/reactos/boot/freeldr/fdebug/lang/hu-HU.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -162,19 +162,19 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Hellóka!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." END -#endif +#endif ///////////////////////////////////////////////////////////////////////////// diff --git a/reactos/boot/freeldr/fdebug/lang/id-ID.rc b/reactos/boot/freeldr/fdebug/lang/id-ID.rc index b94e8ca16e6..307eab516fc 100644 --- a/reactos/boot/freeldr/fdebug/lang/id-ID.rc +++ b/reactos/boot/freeldr/fdebug/lang/id-ID.rc @@ -13,7 +13,7 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -41,7 +41,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -54,7 +54,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -63,13 +63,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -83,7 +83,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -127,7 +127,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -163,14 +163,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Halo Dunia!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Program ini adalah software bebas; anda dapat mendistribusikan dan/atau mengubahnya di bawah term GNU General Public License seperti dipublikasikan oleh Free Software Foundation; baik Lisensi versi 2, atau (menurut opini anda) setiap versi berikutnya.\r\n\r\nProgram ini didistribusikan dengan harapan ia akan berguna, tetapi TANPA JAMINAN APAPUN; bahkan tanpa jaminan berarti dari MERCANTABILITAS atau KECUKUPAN UNTUK KEPERLUAN TERTENTU. Lihat GNU General Public License untuk lebih jelasnya.\r\n\r\nAnda seharusnya menerima duplikat GNU General Public License bersamaan dengan program ini; jika tidak, tulis ke Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." END diff --git a/reactos/boot/freeldr/fdebug/lang/it-IT.rc b/reactos/boot/freeldr/fdebug/lang/it-IT.rc index da042c94d21..0ceadbdaca0 100644 --- a/reactos/boot/freeldr/fdebug/lang/it-IT.rc +++ b/reactos/boot/freeldr/fdebug/lang/it-IT.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&File" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -162,19 +162,19 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Hello World!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Questo programma è software libero; puoi distribuirlo e/o modificarlo nei termini di licenza di 'GNU General Public License' come pubblicata dalla 'Free Software Foundation'; entrambe le versioni 2 della Licenza, o (a vostra scelta) qualunque versione successiva.\r\n\r\nQuesto programma è distribuito con l'augurio che sia utile, ma PRIVO DI OGNI GARANZIA; privo anche della garanzia implicita di VENDIBILITA' o ADEGUATEZZA PER UNO SPECIFICO USO. Vedi la 'GNU General Public License' per ulteriori dettagli.\r\n\r\nVoi dovreste aver ricevuto una copia della 'GNU General Public License' assieme a questo programma; se non è cosi' scrivete a 'Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA'." END -#endif +#endif ///////////////////////////////////////////////////////////////////////////// diff --git a/reactos/boot/freeldr/fdebug/lang/ja-JP.rc b/reactos/boot/freeldr/fdebug/lang/ja-JP.rc index f2325a3e5d1..77986d52cce 100644 --- a/reactos/boot/freeldr/fdebug/lang/ja-JP.rc +++ b/reactos/boot/freeldr/fdebug/lang/ja-JP.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "ƒtƒ@ƒCƒ‹(&F)" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -162,14 +162,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Hello World!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "‚±‚̃vƒƒOƒ‰ƒ€‚̓tƒŠ[ƒ\\ƒtƒgƒEƒFƒA‚Å‚·B‚ ‚È‚½‚Í‚±‚ê‚ðAƒtƒŠ[ƒ\\ƒtƒgƒEƒFƒAà’c‚É‚æ‚Á‚Ä”­s‚³‚ꂽ GNU General Public License (ƒo[ƒWƒ‡ƒ“ 2 ‚©AŠó–]‚É‚æ‚Á‚Ä‚Í‚»‚êˆÈ~‚̃o[ƒWƒ‡ƒ“‚Ì‚¤‚¿‚Ç‚ê‚©) ‚Ì’è‚ß‚éðŒ‚̉º‚ÅĔЕz‚Ü‚½‚͉ü•Ï‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B\r\n\r\n‚±‚̃vƒƒOƒ‰ƒ€‚Í—L—p‚Å‚ ‚邱‚Æ‚ðŠè‚Á‚ĔЕz‚³‚ê‚Ü‚·‚ªA*‘S‚­‚Ì–³•ÛØ* ‚Å‚·B¤‹Æ‰Â”\\«‚Ì•ÛØ‚â“Á’è‚Ì–Ú“I‚Ö‚Ì“K‡«‚ÍAŒ¾ŠO‚ÉŽ¦‚³‚ꂽ‚à‚Ì‚àŠÜ‚ß‘S‚­‘¶Ý‚µ‚Ü‚¹‚ñBÚ‚µ‚­‚Í GNU General Public License ‚ð‚²——‚­‚¾‚³‚¢B\r\n\r\n‚ ‚È‚½‚Í‚±‚̃vƒƒOƒ‰ƒ€‚Æ‹¤‚ÉAGNU General Public License ‚Ì•¡»•¨‚ðˆê•”Žó‚¯Žæ‚Á‚½‚Í‚¸‚Å‚·B‚à‚µŽó‚¯Žæ‚Á‚Ä‚¢‚È‚¯‚ê‚ÎAƒtƒŠ[ƒ\\ƒtƒgƒEƒFƒAà’c‚Ü‚Å¿‹‚µ‚Ä‚­‚¾‚³‚¢ (ˆ¶æ‚Í the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA)B" END diff --git a/reactos/boot/freeldr/fdebug/lang/pl-PL.rc b/reactos/boot/freeldr/fdebug/lang/pl-PL.rc index 2d8e9ae0690..ce3d9434262 100644 --- a/reactos/boot/freeldr/fdebug/lang/pl-PL.rc +++ b/reactos/boot/freeldr/fdebug/lang/pl-PL.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&Plik" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -162,16 +162,16 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Hello World!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN - + IDS_LICENSE "Ten program nale¿y do wolnego oprogramowania; mo¿esz go rozpowszechniaæ i/lub modyfikowaæ w zgodzie z zasadami licencji GNU GPL w formie w jakiej zosta³y opublikowane przez fundacjê Free Software Foundation; albo w wersji 2 Licencji albo (tu masz wybór) w jakiejkolwiek póŸniejszej wersji.\r\n\r\nRozpowszechniaj¹c ten program mamy nadziejê, ¿e bêdzie u¿yteczny, ale BEZ ¯ADNEJ GWARANCJI; nawet bez zak³adanej gwarancji HANDLOWOŒCI, a w szczególnym przypadku zdatnoœci. Aby poznaæ wiêcej szczegó³ów, zajrzyj do licencji GNU.\r\n\r\nKopia licencji GNU GPL powinna byæ dostarczona razem z tym programem; jeœli tak nie jest, napisz list do fundacji na adres: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." END diff --git a/reactos/boot/freeldr/fdebug/lang/ru-RU.rc b/reactos/boot/freeldr/fdebug/lang/ru-RU.rc index 4f52b673de6..7cdeba81ba0 100644 --- a/reactos/boot/freeldr/fdebug/lang/ru-RU.rc +++ b/reactos/boot/freeldr/fdebug/lang/ru-RU.rc @@ -11,7 +11,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -39,7 +39,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -52,7 +52,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -61,13 +61,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -81,7 +81,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -125,7 +125,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -161,14 +161,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Ïðèâåò ìèð!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." END diff --git a/reactos/boot/freeldr/fdebug/lang/tr-TR.rc b/reactos/boot/freeldr/fdebug/lang/tr-TR.rc index 4c34581ff6d..c5d1f1f6da7 100644 --- a/reactos/boot/freeldr/fdebug/lang/tr-TR.rc +++ b/reactos/boot/freeldr/fdebug/lang/tr-TR.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&Dosya" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "Tamam",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -162,14 +162,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Merhaba Dünya!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "Bu program özgür bir yazýlýmdýr; Özgür Yazýlým Vakfý'nýn (Free Software Foundation) yayýnladýðý GNU Genel Kamu Lisansý'nýn 2. versiyonu yada (dilerseniz) herhangi bir sonraki versiyonunun kurallarýna uyarak daðýtabilir ve deðiþtirebilirsiniz.\r\n\r\nBu program faydalý olacaðý umularak daðýtýlmaktadýr, fakat HÝÇBÝR GARANTÝ VERÝLMEZ; ve TÝCARÝ YADA DÝÐER AMAÇLARA UYGUNLUÐU hakkýnda açýktan yada imalý bir bildirim yapýlmaz. Ayrýntýlar için lütfen GNU Genel Kamu Lisansý'ný (General Public License) inceleyiniz.\r\n\r\nBu programla birlikte GNU Genel Kamu Lisansý'nýn da bir kopyasýnýn size verilmiþ olmasý gerekir; aksi söz konusu ise, Özgür Yazýlým Vakfý'na yazýnýz: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." END diff --git a/reactos/boot/freeldr/fdebug/lang/uk-UA.rc b/reactos/boot/freeldr/fdebug/lang/uk-UA.rc index 2c37c5bbd3d..8ba1e43f69f 100644 --- a/reactos/boot/freeldr/fdebug/lang/uk-UA.rc +++ b/reactos/boot/freeldr/fdebug/lang/uk-UA.rc @@ -12,7 +12,7 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT // Menu // -IDC_FDEBUG MENU DISCARDABLE +IDC_FDEBUG MENU DISCARDABLE BEGIN POPUP "&Ôàéë" BEGIN @@ -40,7 +40,7 @@ END // Accelerator // -IDC_FDEBUG ACCELERATORS MOVEABLE PURE +IDC_FDEBUG ACCELERATORS MOVEABLE PURE BEGIN 63, IDM_ABOUT, ASCII, ALT // "?" 47, IDM_ABOUT, ASCII, ALT // "/" @@ -53,7 +53,7 @@ END // TEXTINCLUDE // -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE DISCARDABLE BEGIN "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" "#include ""windows.h""\r\n" @@ -62,13 +62,13 @@ BEGIN "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END @@ -82,7 +82,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -126,7 +126,7 @@ BEGIN 122,26 DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP ICON IDI_FDEBUG,IDC_STATIC,19,30,20,20 - EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | ES_READONLY | WS_VSCROLL END @@ -162,14 +162,14 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_APP_TITLE "fdebug" IDS_HELLO "Ïðèâ³ò Ñâ³ò!" IDC_FDEBUG "FDEBUG" END -STRINGTABLE DISCARDABLE +STRINGTABLE DISCARDABLE BEGIN IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." END diff --git a/reactos/boot/freeldr/freeldr/arch/i386/loader.c b/reactos/boot/freeldr/freeldr/arch/i386/loader.c index 5862db2b843..0c9421e7b2e 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/loader.c @@ -568,7 +568,7 @@ FrLdrMapImage(IN FILE *Image, /* Try to see, maybe it's loaded already */ if (LdrGetModuleObject(Name) != NULL) { - /* It's loaded, return NULL. It would be wise to return + /* It's loaded, return NULL. It would be wise to return correct LoadBase, but it seems to be ignored almost everywhere */ return NULL; } diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxi2c.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxi2c.c index ac8e3b3bd82..edb4900e269 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxi2c.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxi2c.c @@ -199,7 +199,7 @@ void XboxSetLED(PCSTR pattern) { const char *x = pattern; int r, g; - + if(strlen(pattern) == 4) { r = g = 0; while (*x) { @@ -207,7 +207,7 @@ XboxSetLED(PCSTR pattern) { g *= 2; switch (*x) { case 'r': - r++; + r++; break; case 'g': g++; diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c b/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c index 78f79c3784d..06e4a176660 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/loader.c @@ -299,7 +299,7 @@ LdrPEGetOrLoadModule(IN PCHAR ModuleName, * code, and we'll just call it instead. */ FrLdrLoadDriver(ImportedName, 0); - + /* Return the new module */ *ImportedModule = LdrGetModuleObject(ImportedName); if (*ImportedModule == NULL) diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c index 6ace3b11a78..ede3569edbd 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c @@ -29,7 +29,7 @@ extern PCHAR GetFreeLoaderVersionString(); extern ULONG CacheSizeLimit; of_proxy ofproxy; void *PageDirectoryStart, *PageDirectoryEnd; -static int chosen_package, stdin_handle, stdout_handle, +static int chosen_package, stdin_handle, stdout_handle, part_handle = -1, kernel_mem = 0; int mmu_handle = 0, FixedMemory = 0; BOOLEAN AcpiPresent = FALSE; @@ -40,7 +40,7 @@ boot_infos_t BootInfo; void PpcOfwPutChar( int ch ) { char buf[3]; - if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; } + if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; } else { buf[0] = ch; buf[1] = 0; } buf[2] = 0; ofw_write(stdout_handle, buf, strlen(buf)); @@ -66,7 +66,7 @@ int PpcFindDevice( int depth, int parent, char *devname, int *nth ) { if( !nth && match ) return parent; for( i = 0; i < depth; i++ ) PpcOfwPutChar( ' ' ); - + if( depth == 1 ) { if( gotname > 0 ) { printf( "%c Name: %s\n", match ? '*' : ' ', buf ); @@ -152,12 +152,12 @@ BOOLEAN PpcVideoIsPaletteFixed() { return FALSE; } -VOID PpcVideoSetPaletteColor( UCHAR Color, +VOID PpcVideoSetPaletteColor( UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue ) { printf( "SetPaletteColor(%x,%x,%x,%x)\n", Color, Red, Green, Blue ); } -VOID PpcVideoGetPaletteColor( UCHAR Color, +VOID PpcVideoGetPaletteColor( UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue ) { printf( "GetPaletteColor(%x)\n", Color); } @@ -212,7 +212,7 @@ VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) { for( node = ofw_finddevice("/"); prom_next_node(&node); ) { memset(type, 0, sizeof(type)); memset(path, 0, sizeof(path)); - + ret = ofw_getprop(node, "name", name, sizeof(name)); if(ofw_getprop(node, "device_type", type, sizeof(type)) <= 0) { @@ -238,7 +238,7 @@ VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) { BootInfo.dispDeviceRect[0] = BootInfo.dispDeviceRect[1] = 0; - ofw_getprop(display_package, "width", + ofw_getprop(display_package, "width", (void *)&BootInfo.dispDeviceRect[2], sizeof(int)); ofw_getprop(display_package, "height", (void *)&BootInfo.dispDeviceRect[3], sizeof(int)); @@ -266,7 +266,7 @@ VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) { display_size = BootInfo.dispDeviceRowBytes * BootInfo.dispDeviceRect[3]; printf("Display size is %x bytes (%x per row times %x rows)\n", - display_size, + display_size, BootInfo.dispDeviceRowBytes, BootInfo.dispDeviceRect[3]); @@ -279,7 +279,7 @@ VOID PpcVideoPrepareForReactOS(BOOLEAN Setup) { for( k = 0; k < BootInfo.dispDeviceDepth/8; k++ ) { SetPhysByte(((ULONG_PTR)BootInfo.dispDeviceBase)+ k + - ((j * (BootInfo.dispDeviceDepth/8)) + + ((j * (BootInfo.dispDeviceDepth/8)) + (i * (BootInfo.dispDeviceRowBytes))), logo[elts] == ' ' ? 0 : 255); } @@ -301,7 +301,7 @@ VOID PpcInitializeMmu(int max_mem) } } -/* +/* * Get memory the proper openfirmware way */ ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, @@ -313,7 +313,7 @@ ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, memhandle = ofw_finddevice("/memory"); - returned = ofw_getprop(memhandle, "available", + returned = ofw_getprop(memhandle, "available", (char *)memdata, sizeof(memdata)); printf("Returned data: %d\n", returned); @@ -331,16 +331,16 @@ ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, BiosMemoryMap[slots].Type = 1/*MEMTYPE_USABLE*/; BiosMemoryMap[slots].BaseAddress = memdata[i*2]; BiosMemoryMap[slots].Length = memdata[i*2+1]; - printf("MemoryMap[%d] = (%x:%x)\n", - i, + printf("MemoryMap[%d] = (%x:%x)\n", + i, (int)BiosMemoryMap[slots].BaseAddress, (int)BiosMemoryMap[slots].Length); - + // Track end of ram - if (BiosMemoryMap[slots].BaseAddress + BiosMemoryMap[slots].Length > + if (BiosMemoryMap[slots].BaseAddress + BiosMemoryMap[slots].Length > mem_range_end) { - mem_range_end = + mem_range_end = BiosMemoryMap[slots].BaseAddress + BiosMemoryMap[slots].Length; } @@ -389,9 +389,9 @@ BOOLEAN PpcDiskGetBootVolume( PULONG DriveNumber, PULONGLONG StartSector, PULONG BOOLEAN PpcDiskGetSystemVolume( char *SystemPath, char *RemainingPath, PULONG Device, - PULONG DriveNumber, - PULONGLONG StartSector, - PULONGLONG SectorCount, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, int *FsType ) { char *remain = strchr(SystemPath, '\\'); if( remain ) { @@ -424,7 +424,7 @@ BOOLEAN PpcDiskReadLogicalSectors( ULONG DriveNumber, ULONGLONG SectorNumber, if( part_handle == -1 ) { part_handle = ofw_open( BootPart ); - + if( part_handle == -1 ) { printf("Could not open any disk devices we know about\n"); return FALSE; @@ -436,8 +436,8 @@ BOOLEAN PpcDiskReadLogicalSectors( ULONG DriveNumber, ULONGLONG SectorNumber, return FALSE; } - if( ofw_seek( part_handle, - (ULONG)(SectorNumber >> 25), + if( ofw_seek( part_handle, + (ULONG)(SectorNumber >> 25), (ULONG)((SectorNumber * 512) & 0xffffffff) ) ) { printf("Seek to %x failed\n", (ULONG)(SectorNumber * 512)); return FALSE; @@ -466,7 +466,7 @@ ULONG PpcDiskGetCacheableBlockCount( ULONG DriveNumber ) { return 1; } -VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day, +VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second ) { //printf("RTCGeturrentDateTime\n"); } @@ -528,7 +528,7 @@ void PpcDefaultMachVtbl() MachVtbl.VideoSetTextCursorPosition = PpcVideoSetTextCursorPosition; MachVtbl.VideoHideShowTextCursor = PpcVideoHideShowTextCursor; MachVtbl.VideoPutChar = PpcVideoPutChar; - MachVtbl.VideoCopyOffScreenBufferToVRAM = + MachVtbl.VideoCopyOffScreenBufferToVRAM = PpcVideoCopyOffScreenBufferToVRAM; MachVtbl.VideoIsPaletteFixed = PpcVideoIsPaletteFixed; MachVtbl.VideoSetPaletteColor = PpcVideoSetPaletteColor; @@ -614,16 +614,16 @@ void MachInit(const char *CmdLine) { if( strlen(BootPart) == 0 ) { if (ofproxy) - len = ofw_getprop(chosen_package, "bootpath", + len = ofw_getprop(chosen_package, "bootpath", BootPath, sizeof(BootPath)); else len = 0; if( len < 0 ) len = 0; BootPath[len] = 0; printf( "Boot Path: %s\n", BootPath ); - + sep = strrchr(BootPath, ','); - + strcpy(BootPart, BootPath); if( sep ) { BootPart[sep - BootPath] = 0; diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c index b81f7b92ff5..b773edf6466 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c @@ -127,7 +127,7 @@ VOID NTAPI FrLdrStartup(ULONG Magic) { - KernelEntryFn KernelEntryAddress = + KernelEntryFn KernelEntryAddress = (KernelEntryFn)(KernelEntryPoint + KernelBase); ULONG_PTR i, j, page, count; PCHAR ModHeader; @@ -160,8 +160,8 @@ FrLdrStartup(ULONG Magic) info = MmAllocateMemory((KernelMemorySize >> PAGE_SHIFT) * sizeof(*info)); /* Map kernel space 0x80000000 ... */ - for( i = (ULONG)KernelMemory, page = 0; - i < (ULONG)KernelMemory + KernelMemorySize; + for( i = (ULONG)KernelMemory, page = 0; + i < (ULONG)KernelMemory + KernelMemorySize; i += (1<sh_addr = 0; @@ -411,7 +411,7 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern ImageHeader = (PIMAGE_DOS_HEADER)MemLoadAddr; NtHeader = (PIMAGE_NT_HEADERS)((PCHAR)MemLoadAddr + SWAPD(ImageHeader->e_lfanew)); printf("NtHeader at %x\n", SWAPD(ImageHeader->e_lfanew)); - printf("SectionAlignment %x\n", + printf("SectionAlignment %x\n", SWAPD(NtHeader->OptionalHeader.SectionAlignment)); SectionAddr = ROUND_UP (shdr->sh_size, SWAPD(NtHeader->OptionalHeader.SectionAlignment)); @@ -420,7 +420,7 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern } } - if(i == shnum) + if(i == shnum) { printf("No peheader section encountered :-(\n"); return 0; @@ -455,13 +455,13 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern printf("Loading section %d at %x (real: %x:%d)\n", i, KernelAddr + SectionAddr, MemLoadAddr+SectionAddr, shdr->sh_size); FsSetFilePointer(KernelImage, shdr->sh_offset); FsReadFile(KernelImage, shdr->sh_size, NULL, MemLoadAddr + SectionAddr); - } + } else { /* Zero it out */ printf("BSS section %d at %x\n", i, KernelAddr + SectionAddr); - memset(MemLoadAddr + SectionAddr, 0, - ROUND_UP(shdr->sh_size, + memset(MemLoadAddr + SectionAddr, 0, + ROUND_UP(shdr->sh_size, SWAPD(NtHeader->OptionalHeader.SectionAlignment))); } } @@ -469,7 +469,7 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern ImageSize = SWAPD(NtHeader->OptionalHeader.SizeOfImage); KernelEntryPoint = SWAPD(NtHeader->OptionalHeader.AddressOfEntryPoint); printf("Total image size is %x\n", ImageSize); - + /* Handle relocation sections */ for (i = 0; i < shnum; i++) { Elf32_Rela reloc = { }; @@ -478,12 +478,12 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern int numreloc, relstart, targetSection; Elf32_Sym symbol; PCHAR RelocSection, SymbolSection; - + shdr = ELF_SECTION(i); /* Only relocs here */ if((shdr->sh_type != SHT_REL) && (shdr->sh_type != SHT_RELA)) continue; - + relstart = shdr->sh_offset; relsize = shdr->sh_type == SHT_RELA ? 12 : 8; numreloc = shdr->sh_size / relsize; @@ -505,7 +505,7 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern for(j = 0; j < numreloc; j++) { ULONG S,A,P; - + /* Get the reloc */ memcpy(&reloc, RelocSection + (j * relsize), sizeof(reloc)); @@ -520,8 +520,8 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern #if 0 printf("Symbol[%d] %d -> %d(%x:%x) -> %x(+%x)@%x\n", ELF32_R_TYPE(reloc.r_info), - ELF32_R_SYM(reloc.r_info), - symbol.st_shndx, + ELF32_R_SYM(reloc.r_info), + symbol.st_shndx, ELF_SECTION(symbol.st_shndx)->sh_addr, symbol.st_value, S, @@ -532,7 +532,7 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern Target32 = (ULONG*)(((PCHAR)MemLoadAddr) + (P - KernelAddr)); Target16 = (USHORT *)Target32; x = *Target32; - + switch (ELF32_R_TYPE(reloc.r_info)) { case R_PPC_NONE: @@ -561,16 +561,16 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern default: break; } - + #if 0 - printf("reloc[%d:%x]: (type %x sym %d val %d) off %x add %x (old %x new %x)\n", + printf("reloc[%d:%x]: (type %x sym %d val %d) off %x add %x (old %x new %x)\n", j, ((ULONG)Target32) - ((ULONG)MemLoadAddr), ELF32_R_TYPE(reloc.r_info), - ELF32_R_SYM(reloc.r_info), + ELF32_R_SYM(reloc.r_info), symbol.st_value, reloc.r_offset, reloc.r_addend, - x, *Target32); + x, *Target32); #endif } @@ -587,7 +587,7 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern ModuleData->String = (ULONG)MmAllocateMemory(strlen(ImageName)+1); strcpy((PCHAR)ModuleData->String, ImageName); printf("Module %s (%x-%x) next at %x\n", - ModuleData->String, + ModuleData->String, ModuleData->ModStart, ModuleData->ModEnd, NextModuleBase); @@ -662,7 +662,7 @@ FrLdrLoadModule(FILE *ModuleImage, ModuleData->ModStart = NextModuleBase; ModuleData->ModEnd = NextModuleBase + LocalModuleSize; - printf("Module size %x len %x name %s\n", + printf("Module size %x len %x name %s\n", ModuleData->ModStart, ModuleData->ModEnd - ModuleData->ModStart, ModuleName); diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c index 18676a2a9ea..409e35204ba 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mmu.c @@ -294,7 +294,7 @@ inline void SetSDR1( int sdr ) { __asm__("sync"); __asm__("isync"); __asm__("ptesync"); - + for( i = 0; i < 256; i++ ) { j = i << 12; __asm__("tlbie %0,0" : : "r" (j)); @@ -321,7 +321,7 @@ int PpcVirt2phys( int virt, int inst ) { int i, bath, batl, sr, sdr1, physbase, vahi, valo; int npteg, hash, hashmask, ptehi, ptelo, ptegaddr; int vsid, pteh, ptevsid, pteapi; - + if( msr & txmask ) { sr = GetSR( virt >> 28 ); vsid = sr & 0xfffffff; @@ -358,7 +358,7 @@ int PpcVirt2phys( int virt, int inst ) { if( (ptehi & 64) != pteh ) continue; if( ptevsid != (vsid & 0xffffff) ) continue; if( pteapi != ((virt >> 22) & 0x3f) ) continue; - + return (ptelo & 0xfffff000) | (virt & 0xfff); } } @@ -382,7 +382,7 @@ BOOLEAN InsertPageEntry( int virt, int phys, int slot, int _sdr1 ) { for( i = 0; i < 8; i++ ) { ptehi = GetPhys( ptegaddr + (i * 8) ); - + if( (slot != i) && (ptehi & 0x80000000) ) continue; ptehi = (1 << 31) | (vsid << 7) | ((virt >> 22) & 0x3f); diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c index e54683b7594..54c2502b08c 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c @@ -22,7 +22,7 @@ BOOLEAN PpcPrepDiskReadLogicalSectors ( ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer ) { int secct; - + for(secct = 0; secct < SectorCount; secct++) { ide_seek(&ide1_desc, SectorNumber + secct, 0); @@ -38,7 +38,7 @@ BOOLEAN PpcPrepConsKbHit() //return GetPhysByte(prep_serial+5) & 1; } -int PpcPrepConsGetCh() +int PpcPrepConsGetCh() { while(!PpcPrepConsKbHit()); return GetPhysByte(prep_serial); diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h index ce2cfbff75d..c0bbc614503 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h @@ -18,7 +18,7 @@ void print_bar( struct _pci_bar *bar ); void pci_setup( struct _pci_desc *pci_desc ); void pci_read_bar( struct _pci_desc *pci_desc, int bus, int dev, int fn, int bar, struct _pci_bar *bar_data ); -void vga_setup( struct _pci_desc *pci_desc, struct _vga_desc *vga_desc, +void vga_setup( struct _pci_desc *pci_desc, struct _vga_desc *vga_desc, int bus, int dev, int fn ); #endif//FREELDR_ARCH_POWERPC_PREP_H diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c b/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c index abfcf753313..aab820cfd91 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/prep_ide.c @@ -30,20 +30,20 @@ void ide_seek( void *extension, int low, int high ) { /* Wait for ready */ void ide_rdy( void *extension ) { idectl_desc *desc = (idectl_desc *)extension; - while( !(GetPhysByte(desc->port+7) & 0x40) ) sync(); + while( !(GetPhysByte(desc->port+7) & 0x40) ) sync(); } void ide_drq( void *extension ) { idectl_desc *desc = (idectl_desc *)extension; - while( !(GetPhysByte(desc->port+7) & 0x08) ) sync(); + while( !(GetPhysByte(desc->port+7) & 0x08) ) sync(); } void ide_bsy( void *extension ) { idectl_desc *desc = (idectl_desc *)extension; - while( GetPhysByte(desc->port+7) & 0x80 ) + while( GetPhysByte(desc->port+7) & 0x80 ) { printf("Waiting for not busy\n"); - sync(); + sync(); } } @@ -59,7 +59,7 @@ int ide_read( void *extension, char *buffer, int bytes ) { SetPhysByte(desc->port+5, desc->seek_cylinder >> 8); SetPhysByte(desc->port+6, desc->seek_head | 0xa0); SetPhysByte(desc->port+7, 0x20); - + for( inwords = 0; inwords < desc->bytespersec / sizeof(short); inwords++ ) { databuf[inwords] = GetPhysHalf(desc->port); } @@ -101,6 +101,6 @@ void ide_setup( void *extension ) { /* Debug: Write out hard disc model */ strncpy(namebuf, (char *)(identbuffer+0x1b), 41); - printf("HARD DISC MODEL: %s c,h,s %d,%d,%d\n", + printf("HARD DISC MODEL: %s c,h,s %d,%d,%d\n", namebuf, desc->cylinders, desc->heads, desc->sectors); } diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c b/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c index 6254723f25b..4bdabb4cca2 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/prep_pci.c @@ -54,12 +54,12 @@ pci_desc pci1_desc = { (void *)0x80000cf8 }; return ret; } -void pci_read_bar( pci_desc *desc, int bus, int dev, int fn, int bar, +void pci_read_bar( pci_desc *desc, int bus, int dev, int fn, int bar, struct _pci_bar *bar_data ) { bar_data->data = pci_read( desc, bus, dev, fn, 0x10 + (bar * 4), 4 ); } -/* +/* * Imagine: offset 3, len 1 * let oldval = 0x12345678 and val = 0xabcd1234; * mask = ((1 << 8) - 1) << 24; // 0xff000000 @@ -106,7 +106,7 @@ void pci_setup( pci_desc *desc ) { type = pci_read(desc,bus,dev,0,PCI_HEADER_TYPE,1); vendor = pci_read(desc,bus,dev,0,PCI_VENDORID,2); device = pci_read(desc,bus,dev,0,PCI_DEVICEID,2); - + if(vendor == 0 || vendor == 0xffff) continue; if(type & 0x80) funcs = 8; else funcs = 1; @@ -114,7 +114,7 @@ void pci_setup( pci_desc *desc ) { devclass = pci_read(desc,bus,dev,fn,PCI_BASECLASS,1); printf(" %d:%d -> vendor:device:class %x:%x:%x\n", bus, dev, vendor, device, devclass); - + if( devclass == 3 ) { printf("Setting up vga...\n"); vga_setup(desc,&vga1_desc,bus,dev,fn); diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c b/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c index 24d8368e245..ea9c67ea17b 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c @@ -13,7 +13,7 @@ struct _vga_desc { #define VGA_HEIGHT 768 struct _vga_desc vga1_desc = { (char *)0x800003c0 }; -void vga_setup( struct _pci_desc *desc, struct _vga_desc *vga_desc, +void vga_setup( struct _pci_desc *desc, struct _vga_desc *vga_desc, int bus, int dev, int fn ) { struct _pci_bar bar_data; int i; diff --git a/reactos/boot/freeldr/freeldr/fs/ntfs.c b/reactos/boot/freeldr/freeldr/fs/ntfs.c index 7a12f258919..2fc42ee42c5 100644 --- a/reactos/boot/freeldr/freeldr/fs/ntfs.c +++ b/reactos/boot/freeldr/freeldr/fs/ntfs.c @@ -176,7 +176,7 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, ULONGLONG CurrentOffset; ULONGLONG ReadLength; ULONGLONG AlreadyRead; - + if (!Context->Record.IsNonResident) { if (Offset > Context->Record.Resident.ValueLength) @@ -186,17 +186,17 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, RtlCopyMemory(Buffer, (PCHAR)&Context->Record + Context->Record.Resident.ValueOffset + Offset, Length); return Length; } - + /* * Non-resident attribute */ - + /* * I. Find the corresponding start data run. */ - + AlreadyRead = 0; - + if(Context->CacheRunOffset <= Offset && Offset < Context->CacheRunOffset + Context->CacheRunLength * NtfsClusterSize) { DataRun = Context->CacheRun; @@ -210,7 +210,7 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, LastLCN = 0; DataRun = (PUCHAR)&Context->Record + Context->Record.NonResident.MappingPairsOffset; CurrentOffset = 0; - + while (1) { DataRun = NtfsDecodeRun(DataRun, &DataRunOffset, &DataRunLength); @@ -225,26 +225,26 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, /* Sparse data run. */ DataRunStartLCN = -1; } - + if (Offset >= CurrentOffset && Offset < CurrentOffset + (DataRunLength * NtfsClusterSize)) { break; } - + if (*DataRun == 0) { return AlreadyRead; } - + CurrentOffset += DataRunLength * NtfsClusterSize; } } - + /* * II. Go through the run list and read the data */ - + ReadLength = min(DataRunLength * NtfsClusterSize - (Offset - CurrentOffset), Length); if (DataRunStartLCN == -1) RtlZeroMemory(Buffer, ReadLength); @@ -253,7 +253,7 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, Length -= ReadLength; Buffer += ReadLength; AlreadyRead += ReadLength; - + if (ReadLength == DataRunLength * NtfsClusterSize - (Offset - CurrentOffset)) { CurrentOffset += DataRunLength * NtfsClusterSize; @@ -265,11 +265,11 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, } else DataRunStartLCN = -1; - + if (*DataRun == 0) return AlreadyRead; } - + while (Length > 0) { ReadLength = min(DataRunLength * NtfsClusterSize, Length); @@ -277,19 +277,19 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, RtlZeroMemory(Buffer, ReadLength); else if (!NtfsDiskRead(DataRunStartLCN * NtfsClusterSize, ReadLength, Buffer)) break; - + Length -= ReadLength; Buffer += ReadLength; AlreadyRead += ReadLength; - + /* We finished this request, but there still data in this data run. */ if (Length == 0 && ReadLength != DataRunLength * NtfsClusterSize) break; - + /* * Go to next run in the list. */ - + if (*DataRun == 0) break; CurrentOffset += DataRunLength * NtfsClusterSize; @@ -306,16 +306,16 @@ static ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, DataRunStartLCN = -1; } } /* while */ - + } /* if Disk */ - + Context->CacheRun = DataRun; Context->CacheRunOffset = Offset + AlreadyRead; Context->CacheRunStartLCN = DataRunStartLCN; Context->CacheRunLength = DataRunLength; Context->CacheRunLastLCN = LastLCN; Context->CacheRunCurrentOffset = CurrentOffset; - + return AlreadyRead; } @@ -339,7 +339,7 @@ static PNTFS_ATTR_CONTEXT NtfsFindAttributeHelper(PNTFS_ATTR_RECORD AttrRecord, ListSize = NtfsGetAttributeSize(&ListContext->Record); ListBuffer = MmAllocateMemory(ListSize); - + ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer; ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize); @@ -350,7 +350,7 @@ static PNTFS_ATTR_CONTEXT NtfsFindAttributeHelper(PNTFS_ATTR_RECORD AttrRecord, NtfsReleaseAttributeContext(ListContext); MmFreeMemory(ListBuffer); - + if (Context != NULL) return Context; } @@ -546,7 +546,7 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn DbgPrint((DPRINT_FILESYSTEM, "Large Index!\n")); IndexBlockSize = IndexRoot->IndexBlockSize; - + IndexBitmapCtx = NtfsFindAttribute(MftRecord, NTFS_ATTR_TYPE_BITMAP, L"$I30"); if (IndexBitmapCtx == NULL) { diff --git a/reactos/boot/freeldr/freeldr/mm/mm.c b/reactos/boot/freeldr/freeldr/mm/mm.c index b510f9a251c..adee5f7dc56 100644 --- a/reactos/boot/freeldr/freeldr/mm/mm.c +++ b/reactos/boot/freeldr/freeldr/mm/mm.c @@ -110,7 +110,7 @@ PVOID MmAllocateMemory(ULONG MemorySize) SubAllocationPage = MemPointer; SubAllocationRest = MM_PAGE_SIZE - MemorySize; } - + #ifdef DBG IncrementAllocationCount(); diff --git a/reactos/boot/freeldr/freeldr/reactos/binhive.c b/reactos/boot/freeldr/freeldr/reactos/binhive.c index ac484ac38bb..b50cb89eea9 100644 --- a/reactos/boot/freeldr/freeldr/reactos/binhive.c +++ b/reactos/boot/freeldr/freeldr/reactos/binhive.c @@ -310,7 +310,7 @@ CmiExportSubKey (PHHIVE Hive, break; } } - + /* Allocate key cell */ KeyCellSize = sizeof(CM_KEY_NODE) + NameSize; NKBOffset = HvAllocateCell (Hive, KeyCellSize, HvStable); @@ -583,7 +583,7 @@ RegImportValue (PHHIVE Hive, ValueCell->DataType, DataCell, DataSize); - + if (Error != ERROR_SUCCESS) { DbgPrint((DPRINT_REGISTRY, "RegSetValue() failed!\n")); diff --git a/reactos/boot/freeldr/freeldr/reactos/registry.c b/reactos/boot/freeldr/freeldr/reactos/registry.c index 89c440428ee..b1af9b2b481 100644 --- a/reactos/boot/freeldr/freeldr/reactos/registry.c +++ b/reactos/boot/freeldr/freeldr/reactos/registry.c @@ -258,7 +258,7 @@ RegCreateKey(FRLDRHKEY ParentKey, name = KeyName; } NameSize = (subkeyLength + 1) * sizeof(WCHAR); - + Ptr = CurrentKey->SubKeyList.Flink; CmpResult = 1; while (Ptr != &CurrentKey->SubKeyList) @@ -271,7 +271,7 @@ RegCreateKey(FRLDRHKEY ParentKey, DbgPrint((DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey)); DbgPrint((DPRINT_REGISTRY, "Searching '%S'\n", SearchKey->Name)); CmpResult = _wcsnicmp(SearchKey->Name, name, subkeyLength); - if (CmpResult == 0 && SearchKey->NameSize == NameSize) + if (CmpResult == 0 && SearchKey->NameSize == NameSize) break; else if (CmpResult == -1) break; diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index eca50a35e1c..9396ebf4d70 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -274,7 +274,7 @@ VOID RunLoader(VOID) SourcePath = "\\"; #ifdef DBG - /* Get load options */ + /* Get load options */ if (InfFindFirstLine (InfHandle, "SetupData", "DbgOsLoadOptions", @@ -311,7 +311,7 @@ VOID RunLoader(VOID) strcpy(SystemRoot, SourcePath); strcat(SystemRoot, "\\"); - + /* Setup the boot path and kernel path */ strcpy(szBootPath, SourcePath); strcpy(szKernelName, szBootPath); diff --git a/reactos/boot/freeldr/freeldr/ui/ui.c b/reactos/boot/freeldr/freeldr/ui/ui.c index 044d521239a..4d2c3f7f5d0 100644 --- a/reactos/boot/freeldr/freeldr/ui/ui.c +++ b/reactos/boot/freeldr/freeldr/ui/ui.c @@ -252,9 +252,9 @@ BOOLEAN SetupUiInitialize(VOID) CHAR DisplayModeText[260]; ULONG Depth; - + DisplayModeText[0] = '\0'; - + UiDisplayMode = MachVideoSetDisplayMode(DisplayModeText, TRUE); MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth); @@ -272,7 +272,7 @@ BOOLEAN SetupUiInitialize(VOID) UiDrawTime = FALSE; UiStatusBarBgColor = 7; UserInterfaceUp = TRUE; - + TuiDrawText(4, 1, "ReactOS " KERNEL_VERSION_STR " Setup", ATTR(COLOR_GRAY, UiBackdropBgColor)); TuiDrawText(3, 2, "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD", ATTR(COLOR_GRAY, UiBackdropBgColor)); diff --git a/reactos/boot/freeldr/freeldr/windows/winldr.c b/reactos/boot/freeldr/freeldr/windows/winldr.c index 5d3e2efbb29..d111a45fdd2 100644 --- a/reactos/boot/freeldr/freeldr/windows/winldr.c +++ b/reactos/boot/freeldr/freeldr/windows/winldr.c @@ -127,7 +127,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock) PLOADER_PARAMETER_EXTENSION Extension; LoaderBlock->u.I386.CommonDataArea = NULL; // Force No ABIOS support - + /* Fill Arc BootDevice */ LoaderBlock->ArcBootDeviceName = MmAllocateMemory(strlen(ArcBoot)+1); strcpy(LoaderBlock->ArcBootDeviceName, ArcBoot); diff --git a/reactos/boot/freeldr/freeldr/windows/wlmemory.c b/reactos/boot/freeldr/freeldr/windows/wlmemory.c index 7e150e21e3e..ae447b372b1 100644 --- a/reactos/boot/freeldr/freeldr/windows/wlmemory.c +++ b/reactos/boot/freeldr/freeldr/windows/wlmemory.c @@ -211,7 +211,7 @@ MempSetupPaging(IN ULONG StartPage, ULONG Entry, Page; //Print(L"MempSetupPaging: SP 0x%X, Number: 0x%X\n", StartPage, NumberOfPages); - + // HACK if (StartPage+NumberOfPages >= 0x80000) { @@ -309,7 +309,7 @@ MempAddMemoryBlock(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, } return; } - + if (BasePage == 0xFFF && PageCount == 1) { Mad[MadCount].MemoryType = LoaderSpecialMemory; @@ -527,7 +527,7 @@ WinLdrTurnOnPaging(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, Tss = (PKTSS)(KSEG0_BASE | (TssBasePage << MM_PAGE_SHIFT)); - // Fill the memory descriptor list and + // Fill the memory descriptor list and //PrepareMemoryDescriptorList(); DbgPrint((DPRINT_WINDOWS, "Memory Descriptor List prepared, printing PDE\n")); List_PaToVa(&LoaderBlock->MemoryDescriptorListHead); diff --git a/reactos/boot/freeldr/tools/rcopy.c b/reactos/boot/freeldr/tools/rcopy.c index 359a4790b8b..e4d3fbae68a 100644 --- a/reactos/boot/freeldr/tools/rcopy.c +++ b/reactos/boot/freeldr/tools/rcopy.c @@ -12,9 +12,9 @@ char* convert_path(char* origpath) { char* newpath; int i; - + newpath = strdup(origpath); - + i = 0; while (newpath[i] != 0) { @@ -29,8 +29,8 @@ char* convert_path(char* origpath) { newpath[i] = '\\'; } -#endif -#endif +#endif +#endif i++; } return(newpath); @@ -47,16 +47,16 @@ int main(int argc, char* argv[]) char* buf; int n_in; int n_out; - + if (argc != 3) { fprintf(stderr, "Too many arguments\n"); exit(1); } - + path1 = convert_path(argv[1]); path2 = convert_path(argv[2]); - + in = fopen(path1, "rb"); if (in == NULL) { @@ -64,8 +64,8 @@ int main(int argc, char* argv[]) exit(1); } - - + + out = fopen(path2, "wb"); if (out == NULL) { @@ -73,9 +73,9 @@ int main(int argc, char* argv[]) fclose(in); exit(1); } - + buf = malloc(TRANSFER_SIZE); - + while (!feof(in)) { n_in = fread(buf, 1, TRANSFER_SIZE, in); diff --git a/reactos/boot/freeldr/tools/rdel.c b/reactos/boot/freeldr/tools/rdel.c index 0e233fa3b6f..2bd312be2d2 100644 --- a/reactos/boot/freeldr/tools/rdel.c +++ b/reactos/boot/freeldr/tools/rdel.c @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id$ * COPYRIGHT: See COPYING in the top level directory * PROGRAMMER: Rex Jolliff (rex@lvcablemodem.com) * PURPOSE: Platform independant delete command @@ -11,7 +11,7 @@ #include #include -void +void convertPath (char * pathToConvert) { while (*pathToConvert != 0) @@ -54,7 +54,7 @@ getFilename (const char *filename, char * fileSpec) } } -int +int main (int argc, char* argv[]) { int justPrint = 0; @@ -76,7 +76,7 @@ main (int argc, char* argv[]) { /* Continue even if there is errors */ #if 0 - printf ("Unlink of %s failed. Unlink returned %d.\n", + printf ("Unlink of %s failed. Unlink returned %d.\n", argv [idx], returnCode); return returnCode; diff --git a/reactos/boot/freeldr/tools/rmkdir.c b/reactos/boot/freeldr/tools/rmkdir.c index 9b082f683c2..2574db584aa 100644 --- a/reactos/boot/freeldr/tools/rmkdir.c +++ b/reactos/boot/freeldr/tools/rmkdir.c @@ -21,7 +21,7 @@ void ConvertPathCharacters(char *Path) { int i; - + i = 0; while (Path[i] != 0) { @@ -67,7 +67,7 @@ int MakeDirectory(char *Directory) } chdir(CurrentDirectory); - + return 0; } diff --git a/reactos/boot/freeldr/tools/rrmdir.c b/reactos/boot/freeldr/tools/rrmdir.c index 9877ff5b828..f48a0fd9d22 100644 --- a/reactos/boot/freeldr/tools/rrmdir.c +++ b/reactos/boot/freeldr/tools/rrmdir.c @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id$ * COPYRIGHT: See COPYING in the top level directory * PROGRAMMER: Rex Jolliff (rex@lvcablemodem.com) * Casper S. Hornstrup (chorns@users.sourceforge.net) @@ -13,7 +13,7 @@ #include #include -void +void convertPath (char * pathToConvert) { while (*pathToConvert != 0) @@ -56,7 +56,7 @@ getFilename (const char *filename, char * fileSpec) } } -int +int main (int argc, char* argv[]) { int justPrint = 0; @@ -78,7 +78,7 @@ main (int argc, char* argv[]) { /* Continue even if there is errors */ #if 0 - printf ("Rmdir of %s failed. Rmdir returned %d.\n", + printf ("Rmdir of %s failed. Rmdir returned %d.\n", argv [idx], returnCode); return returnCode; diff --git a/reactos/config-ppc.template.rbuild b/reactos/config-ppc.template.rbuild index 9eca1ed4696..f4de96723c3 100644 --- a/reactos/config-ppc.template.rbuild +++ b/reactos/config-ppc.template.rbuild @@ -36,7 +36,7 @@ diff --git a/reactos/config.template.rbuild b/reactos/config.template.rbuild index 45413d2b98c..0e67afb5d40 100644 --- a/reactos/config.template.rbuild +++ b/reactos/config.template.rbuild @@ -31,12 +31,12 @@ lcar values...handled by lcar callback function - */ - - static GXV_LookupValueDesc - gxv_lcar_LookupFmt4_transit( FT_UShort relative_gindex, - GXV_LookupValueDesc base_value, - FT_Bytes lookuptbl_limit, - GXV_Validator valid ) - { - FT_Bytes p; - FT_Bytes limit; - FT_UShort offset; - GXV_LookupValueDesc value; - - FT_UNUSED( lookuptbl_limit ); - - /* XXX: check range? */ - offset = (FT_UShort)( base_value.u + - relative_gindex * sizeof ( FT_UShort ) ); - p = valid->root->base + offset; - limit = valid->root->limit; - - GXV_LIMIT_CHECK ( 2 ); - value.u = FT_NEXT_USHORT( p ); - - return value; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** lcar TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - gxv_lcar_validate( FT_Bytes table, - FT_Face face, - FT_Validator ftvalid ) - { - FT_Bytes p = table; - FT_Bytes limit = 0; - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; - - GXV_lcar_DataRec lcarrec; - GXV_lcar_Data lcar = &lcarrec; - - FT_Fixed version; - - - valid->root = ftvalid; - valid->table_data = lcar; - valid->face = face; - - FT_TRACE3(( "validating `lcar' table\n" )); - GXV_INIT; - - GXV_LIMIT_CHECK( 4 + 2 ); - version = FT_NEXT_ULONG( p ); - GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p ); - - if ( version != 0x00010000UL) - FT_INVALID_FORMAT; - - if ( GXV_LCAR_DATA( format ) > 1 ) - FT_INVALID_FORMAT; - - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_lcar_LookupValue_validate; - valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit; - gxv_LookupTable_validate( p, limit, valid ); - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvlcar.c */ +/* */ +/* TrueTypeGX/AAT lcar table validation (body). */ +/* */ +/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvalid.h" +#include "gxvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvlcar + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** Data and Types *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct GXV_lcar_DataRec_ + { + FT_UShort format; + + } GXV_lcar_DataRec, *GXV_lcar_Data; + + +#define GXV_LCAR_DATA( FIELD ) GXV_TABLE_DATA( lcar, FIELD ) + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + gxv_lcar_partial_validate( FT_UShort partial, + FT_UShort glyph, + GXV_Validator valid ) + { + GXV_NAME_ENTER( "partial" ); + + if ( GXV_LCAR_DATA( format ) != 1 ) + goto Exit; + + gxv_ctlPoint_validate( glyph, partial, valid ); + + Exit: + GXV_EXIT; + } + + + static void + gxv_lcar_LookupValue_validate( FT_UShort glyph, + GXV_LookupValueDesc value, + GXV_Validator valid ) + { + FT_Bytes p = valid->root->base + value.u; + FT_Bytes limit = valid->root->limit; + FT_UShort count; + FT_Short partial; + FT_UShort i; + + + GXV_NAME_ENTER( "element in lookupTable" ); + + GXV_LIMIT_CHECK( 2 ); + count = FT_NEXT_USHORT( p ); + + GXV_LIMIT_CHECK( 2 * count ); + for ( i = 0; i < count; i++ ) + { + partial = FT_NEXT_SHORT( p ); + gxv_lcar_partial_validate( partial, glyph, valid ); + } + + GXV_EXIT; + } + + + /* + +------ lcar --------------------+ + | | + | +===============+ | + | | looup header | | + | +===============+ | + | | BinSrchHeader | | + | +===============+ | + | | lastGlyph[0] | | + | +---------------+ | + | | firstGlyph[0] | | head of lcar sfnt table + | +---------------+ | + + | | offset[0] | -> | offset [byte] + | +===============+ | + + | | lastGlyph[1] | | (glyphID - firstGlyph) * 2 [byte] + | +---------------+ | + | | firstGlyph[1] | | + | +---------------+ | + | | offset[1] | | + | +===============+ | + | | + | .... | + | | + | 16bit value array | + | +===============+ | + +------| value | <-------+ + | .... + | + | + | + | + | + +----> lcar values...handled by lcar callback function + */ + + static GXV_LookupValueDesc + gxv_lcar_LookupFmt4_transit( FT_UShort relative_gindex, + GXV_LookupValueDesc base_value, + FT_Bytes lookuptbl_limit, + GXV_Validator valid ) + { + FT_Bytes p; + FT_Bytes limit; + FT_UShort offset; + GXV_LookupValueDesc value; + + FT_UNUSED( lookuptbl_limit ); + + /* XXX: check range? */ + offset = (FT_UShort)( base_value.u + + relative_gindex * sizeof ( FT_UShort ) ); + p = valid->root->base + offset; + limit = valid->root->limit; + + GXV_LIMIT_CHECK ( 2 ); + value.u = FT_NEXT_USHORT( p ); + + return value; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** lcar TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + gxv_lcar_validate( FT_Bytes table, + FT_Face face, + FT_Validator ftvalid ) + { + FT_Bytes p = table; + FT_Bytes limit = 0; + GXV_ValidatorRec validrec; + GXV_Validator valid = &validrec; + + GXV_lcar_DataRec lcarrec; + GXV_lcar_Data lcar = &lcarrec; + + FT_Fixed version; + + + valid->root = ftvalid; + valid->table_data = lcar; + valid->face = face; + + FT_TRACE3(( "validating `lcar' table\n" )); + GXV_INIT; + + GXV_LIMIT_CHECK( 4 + 2 ); + version = FT_NEXT_ULONG( p ); + GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p ); + + if ( version != 0x00010000UL) + FT_INVALID_FORMAT; + + if ( GXV_LCAR_DATA( format ) > 1 ) + FT_INVALID_FORMAT; + + valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + valid->lookupval_func = gxv_lcar_LookupValue_validate; + valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit; + gxv_LookupTable_validate( p, limit, valid ); + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.c index b2b16b1ff38..e7bb0daad40 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.c @@ -1,285 +1,285 @@ -/***************************************************************************/ -/* */ -/* gxvmod.c */ -/* */ -/* FreeType's TrueTypeGX/AAT validation module implementation (body). */ -/* */ -/* Copyright 2004, 2005, 2006 */ -/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_TRUETYPE_TABLES_H -#include FT_TRUETYPE_TAGS_H -#include FT_GX_VALIDATE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_GX_VALIDATE_H - -#include "gxvmod.h" -#include "gxvalid.h" -#include "gxvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmodule - - - static FT_Error - gxv_load_table( FT_Face face, - FT_Tag tag, - FT_Byte* volatile* table, - FT_ULong* table_len ) - { - FT_Error error; - FT_Memory memory = FT_FACE_MEMORY( face ); - - - error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len ); - if ( error == GXV_Err_Table_Missing ) - return GXV_Err_Ok; - if ( error ) - goto Exit; - - if ( FT_ALLOC( *table, *table_len ) ) - goto Exit; - - error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len ); - - Exit: - return error; - } - - -#define GXV_TABLE_DECL( _sfnt ) \ - FT_Byte* volatile _sfnt = NULL; \ - FT_ULong len_ ## _sfnt = 0 - -#define GXV_TABLE_LOAD( _sfnt ) \ - if ( ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) && \ - ( gx_flags & FT_VALIDATE_ ## _sfnt ) ) \ - { \ - error = gxv_load_table( face, TTAG_ ## _sfnt, \ - &_sfnt, &len_ ## _sfnt ); \ - if ( error ) \ - goto Exit; \ - } - -#define GXV_TABLE_VALIDATE( _sfnt ) \ - if ( _sfnt ) \ - { \ - ft_validator_init( &valid, _sfnt, _sfnt + len_ ## _sfnt, \ - FT_VALIDATE_DEFAULT ); \ - if ( ft_setjmp( valid.jump_buffer ) == 0 ) \ - gxv_ ## _sfnt ## _validate( _sfnt, face, &valid ); \ - error = valid.error; \ - if ( error ) \ - goto Exit; \ - } - -#define GXV_TABLE_SET( _sfnt ) \ - if ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) \ - tables[FT_VALIDATE_ ## _sfnt ## _INDEX] = (FT_Bytes)_sfnt - - - static FT_Error - gxv_validate( FT_Face face, - FT_UInt gx_flags, - FT_Bytes tables[FT_VALIDATE_GX_LENGTH], - FT_UInt table_count ) - { - FT_Memory volatile memory = FT_FACE_MEMORY( face ); - - FT_Error error = GXV_Err_Ok; - FT_ValidatorRec volatile valid; - - FT_UInt i; - - - GXV_TABLE_DECL( feat ); - GXV_TABLE_DECL( bsln ); - GXV_TABLE_DECL( trak ); - GXV_TABLE_DECL( just ); - GXV_TABLE_DECL( mort ); - GXV_TABLE_DECL( morx ); - GXV_TABLE_DECL( kern ); - GXV_TABLE_DECL( opbd ); - GXV_TABLE_DECL( prop ); - GXV_TABLE_DECL( lcar ); - - for ( i = 0; i < table_count; i++ ) - tables[i] = 0; - - /* load tables */ - GXV_TABLE_LOAD( feat ); - GXV_TABLE_LOAD( bsln ); - GXV_TABLE_LOAD( trak ); - GXV_TABLE_LOAD( just ); - GXV_TABLE_LOAD( mort ); - GXV_TABLE_LOAD( morx ); - GXV_TABLE_LOAD( kern ); - GXV_TABLE_LOAD( opbd ); - GXV_TABLE_LOAD( prop ); - GXV_TABLE_LOAD( lcar ); - - /* validate tables */ - GXV_TABLE_VALIDATE( feat ); - GXV_TABLE_VALIDATE( bsln ); - GXV_TABLE_VALIDATE( trak ); - GXV_TABLE_VALIDATE( just ); - GXV_TABLE_VALIDATE( mort ); - GXV_TABLE_VALIDATE( morx ); - GXV_TABLE_VALIDATE( kern ); - GXV_TABLE_VALIDATE( opbd ); - GXV_TABLE_VALIDATE( prop ); - GXV_TABLE_VALIDATE( lcar ); - - /* Set results */ - GXV_TABLE_SET( feat ); - GXV_TABLE_SET( mort ); - GXV_TABLE_SET( morx ); - GXV_TABLE_SET( bsln ); - GXV_TABLE_SET( just ); - GXV_TABLE_SET( kern ); - GXV_TABLE_SET( opbd ); - GXV_TABLE_SET( trak ); - GXV_TABLE_SET( prop ); - GXV_TABLE_SET( lcar ); - - Exit: - if ( error ) - { - FT_FREE( feat ); - FT_FREE( bsln ); - FT_FREE( trak ); - FT_FREE( just ); - FT_FREE( mort ); - FT_FREE( morx ); - FT_FREE( kern ); - FT_FREE( opbd ); - FT_FREE( prop ); - FT_FREE( lcar ); - } - - return error; - } - - - static FT_Error - classic_kern_validate( FT_Face face, - FT_UInt ckern_flags, - FT_Bytes* ckern_table ) - { - FT_Memory volatile memory = FT_FACE_MEMORY( face ); - - FT_Byte* volatile ckern = NULL; - FT_ULong len_ckern = 0; - - /* without volatile on `error' GCC 4.1.1. emits: */ - /* warning: variable 'error' might be clobbered by 'longjmp' or 'vfork' */ - /* this warning seems spurious but --- */ - FT_Error volatile error = GXV_Err_Ok; - FT_ValidatorRec volatile valid; - - - *ckern_table = NULL; - - error = gxv_load_table( face, TTAG_kern, &ckern, &len_ckern ); - if ( error ) - goto Exit; - - if ( ckern ) - { - ft_validator_init( &valid, ckern, ckern + len_ckern, - FT_VALIDATE_DEFAULT ); - if ( ft_setjmp( valid.jump_buffer ) == 0 ) - gxv_kern_validate_classic( ckern, face, - ckern_flags & FT_VALIDATE_CKERN, &valid ); - error = valid.error; - if ( error ) - goto Exit; - } - - *ckern_table = ckern; - - Exit: - if ( error ) - FT_FREE( ckern ); - - return error; - } - - - static - const FT_Service_GXvalidateRec gxvalid_interface = - { - gxv_validate - }; - - - static - const FT_Service_CKERNvalidateRec ckernvalid_interface = - { - classic_kern_validate - }; - - - static - const FT_ServiceDescRec gxvalid_services[] = - { - { FT_SERVICE_ID_GX_VALIDATE, &gxvalid_interface }, - { FT_SERVICE_ID_CLASSICKERN_VALIDATE, &ckernvalid_interface }, - { NULL, NULL } - }; - - - static FT_Pointer - gxvalid_get_service( FT_Module module, - const char* service_id ) - { - FT_UNUSED( module ); - - return ft_service_list_lookup( gxvalid_services, service_id ); - } - - - FT_CALLBACK_TABLE_DEF - const FT_Module_Class gxv_module_class = - { - 0, - sizeof( FT_ModuleRec ), - "gxvalid", - 0x10000L, - 0x20000L, - - 0, /* module-specific interface */ - - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) gxvalid_get_service - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmod.c */ +/* */ +/* FreeType's TrueTypeGX/AAT validation module implementation (body). */ +/* */ +/* Copyright 2004, 2005, 2006 */ +/* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_TRUETYPE_TABLES_H +#include FT_TRUETYPE_TAGS_H +#include FT_GX_VALIDATE_H +#include FT_INTERNAL_OBJECTS_H +#include FT_SERVICE_GX_VALIDATE_H + +#include "gxvmod.h" +#include "gxvalid.h" +#include "gxvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmodule + + + static FT_Error + gxv_load_table( FT_Face face, + FT_Tag tag, + FT_Byte* volatile* table, + FT_ULong* table_len ) + { + FT_Error error; + FT_Memory memory = FT_FACE_MEMORY( face ); + + + error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len ); + if ( error == GXV_Err_Table_Missing ) + return GXV_Err_Ok; + if ( error ) + goto Exit; + + if ( FT_ALLOC( *table, *table_len ) ) + goto Exit; + + error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len ); + + Exit: + return error; + } + + +#define GXV_TABLE_DECL( _sfnt ) \ + FT_Byte* volatile _sfnt = NULL; \ + FT_ULong len_ ## _sfnt = 0 + +#define GXV_TABLE_LOAD( _sfnt ) \ + if ( ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) && \ + ( gx_flags & FT_VALIDATE_ ## _sfnt ) ) \ + { \ + error = gxv_load_table( face, TTAG_ ## _sfnt, \ + &_sfnt, &len_ ## _sfnt ); \ + if ( error ) \ + goto Exit; \ + } + +#define GXV_TABLE_VALIDATE( _sfnt ) \ + if ( _sfnt ) \ + { \ + ft_validator_init( &valid, _sfnt, _sfnt + len_ ## _sfnt, \ + FT_VALIDATE_DEFAULT ); \ + if ( ft_setjmp( valid.jump_buffer ) == 0 ) \ + gxv_ ## _sfnt ## _validate( _sfnt, face, &valid ); \ + error = valid.error; \ + if ( error ) \ + goto Exit; \ + } + +#define GXV_TABLE_SET( _sfnt ) \ + if ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) \ + tables[FT_VALIDATE_ ## _sfnt ## _INDEX] = (FT_Bytes)_sfnt + + + static FT_Error + gxv_validate( FT_Face face, + FT_UInt gx_flags, + FT_Bytes tables[FT_VALIDATE_GX_LENGTH], + FT_UInt table_count ) + { + FT_Memory volatile memory = FT_FACE_MEMORY( face ); + + FT_Error error = GXV_Err_Ok; + FT_ValidatorRec volatile valid; + + FT_UInt i; + + + GXV_TABLE_DECL( feat ); + GXV_TABLE_DECL( bsln ); + GXV_TABLE_DECL( trak ); + GXV_TABLE_DECL( just ); + GXV_TABLE_DECL( mort ); + GXV_TABLE_DECL( morx ); + GXV_TABLE_DECL( kern ); + GXV_TABLE_DECL( opbd ); + GXV_TABLE_DECL( prop ); + GXV_TABLE_DECL( lcar ); + + for ( i = 0; i < table_count; i++ ) + tables[i] = 0; + + /* load tables */ + GXV_TABLE_LOAD( feat ); + GXV_TABLE_LOAD( bsln ); + GXV_TABLE_LOAD( trak ); + GXV_TABLE_LOAD( just ); + GXV_TABLE_LOAD( mort ); + GXV_TABLE_LOAD( morx ); + GXV_TABLE_LOAD( kern ); + GXV_TABLE_LOAD( opbd ); + GXV_TABLE_LOAD( prop ); + GXV_TABLE_LOAD( lcar ); + + /* validate tables */ + GXV_TABLE_VALIDATE( feat ); + GXV_TABLE_VALIDATE( bsln ); + GXV_TABLE_VALIDATE( trak ); + GXV_TABLE_VALIDATE( just ); + GXV_TABLE_VALIDATE( mort ); + GXV_TABLE_VALIDATE( morx ); + GXV_TABLE_VALIDATE( kern ); + GXV_TABLE_VALIDATE( opbd ); + GXV_TABLE_VALIDATE( prop ); + GXV_TABLE_VALIDATE( lcar ); + + /* Set results */ + GXV_TABLE_SET( feat ); + GXV_TABLE_SET( mort ); + GXV_TABLE_SET( morx ); + GXV_TABLE_SET( bsln ); + GXV_TABLE_SET( just ); + GXV_TABLE_SET( kern ); + GXV_TABLE_SET( opbd ); + GXV_TABLE_SET( trak ); + GXV_TABLE_SET( prop ); + GXV_TABLE_SET( lcar ); + + Exit: + if ( error ) + { + FT_FREE( feat ); + FT_FREE( bsln ); + FT_FREE( trak ); + FT_FREE( just ); + FT_FREE( mort ); + FT_FREE( morx ); + FT_FREE( kern ); + FT_FREE( opbd ); + FT_FREE( prop ); + FT_FREE( lcar ); + } + + return error; + } + + + static FT_Error + classic_kern_validate( FT_Face face, + FT_UInt ckern_flags, + FT_Bytes* ckern_table ) + { + FT_Memory volatile memory = FT_FACE_MEMORY( face ); + + FT_Byte* volatile ckern = NULL; + FT_ULong len_ckern = 0; + + /* without volatile on `error' GCC 4.1.1. emits: */ + /* warning: variable 'error' might be clobbered by 'longjmp' or 'vfork' */ + /* this warning seems spurious but --- */ + FT_Error volatile error = GXV_Err_Ok; + FT_ValidatorRec volatile valid; + + + *ckern_table = NULL; + + error = gxv_load_table( face, TTAG_kern, &ckern, &len_ckern ); + if ( error ) + goto Exit; + + if ( ckern ) + { + ft_validator_init( &valid, ckern, ckern + len_ckern, + FT_VALIDATE_DEFAULT ); + if ( ft_setjmp( valid.jump_buffer ) == 0 ) + gxv_kern_validate_classic( ckern, face, + ckern_flags & FT_VALIDATE_CKERN, &valid ); + error = valid.error; + if ( error ) + goto Exit; + } + + *ckern_table = ckern; + + Exit: + if ( error ) + FT_FREE( ckern ); + + return error; + } + + + static + const FT_Service_GXvalidateRec gxvalid_interface = + { + gxv_validate + }; + + + static + const FT_Service_CKERNvalidateRec ckernvalid_interface = + { + classic_kern_validate + }; + + + static + const FT_ServiceDescRec gxvalid_services[] = + { + { FT_SERVICE_ID_GX_VALIDATE, &gxvalid_interface }, + { FT_SERVICE_ID_CLASSICKERN_VALIDATE, &ckernvalid_interface }, + { NULL, NULL } + }; + + + static FT_Pointer + gxvalid_get_service( FT_Module module, + const char* service_id ) + { + FT_UNUSED( module ); + + return ft_service_list_lookup( gxvalid_services, service_id ); + } + + + FT_CALLBACK_TABLE_DEF + const FT_Module_Class gxv_module_class = + { + 0, + sizeof( FT_ModuleRec ), + "gxvalid", + 0x10000L, + 0x20000L, + + 0, /* module-specific interface */ + + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) gxvalid_get_service + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.h b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.h index 466584ef4fd..9979a7c6a14 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.h +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmod.h @@ -1,46 +1,46 @@ -/***************************************************************************/ -/* */ -/* gxvmod.h */ -/* */ -/* FreeType's TrueTypeGX/AAT validation module implementation */ -/* (specification). */ -/* */ -/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#ifndef __GXVMOD_H__ -#define __GXVMOD_H__ - -#include -#include FT_MODULE_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Module_Class ) gxv_module_class; - - -FT_END_HEADER - -#endif /* __GXVMOD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmod.h */ +/* */ +/* FreeType's TrueTypeGX/AAT validation module implementation */ +/* (specification). */ +/* */ +/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#ifndef __GXVMOD_H__ +#define __GXVMOD_H__ + +#include +#include FT_MODULE_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Module_Class ) gxv_module_class; + + +FT_END_HEADER + +#endif /* __GXVMOD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.c index 6fb71b92be4..1472d8c90bd 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.c @@ -1,285 +1,285 @@ -/***************************************************************************/ -/* */ -/* gxvmort.c */ -/* */ -/* TrueTypeGX/AAT mort table validation (body). */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmort.h" -#include "gxvfeat.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmort - - - static void - gxv_mort_feature_validate( GXV_mort_feature f, - GXV_Validator valid ) - { - if ( f->featureType > gxv_feat_registry_length ) - { - GXV_TRACE(( "featureType %d is out of registered range, " - "setting %d is unchecked\n", - f->featureType, f->featureSetting )); - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_DATA; - } - else if ( !gxv_feat_registry[f->featureType].existence ) - { - GXV_TRACE(( "featureType %d is within registered area " - "but undefined, setting %d is unchecked\n", - f->featureType, f->featureSetting )); - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_DATA; - } - else - { - FT_Byte nSettings_max; - - - /* nSettings in gxvfeat.c is halved for exclusive on/off settings */ - nSettings_max = gxv_feat_registry[f->featureType].nSettings; - if ( gxv_feat_registry[f->featureType].exclusive ) - nSettings_max = (FT_Byte)( 2 * nSettings_max ); - - GXV_TRACE(( "featureType %d is registered", f->featureType )); - GXV_TRACE(( "setting %d", f->featureSetting )); - - if ( f->featureSetting > nSettings_max ) - { - GXV_TRACE(( "out of defined range %d", nSettings_max )); - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_DATA; - } - GXV_TRACE(( "\n" )); - } - - /* TODO: enableFlags must be unique value in specified chain? */ - } - - - /* - * nFeatureFlags is typed to FT_UInt to accept that in - * mort (typed FT_UShort) and morx (typed FT_ULong). - */ - FT_LOCAL_DEF( void ) - gxv_mort_featurearray_validate( FT_Bytes table, - FT_Bytes limit, - FT_UInt nFeatureFlags, - GXV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt i; - - GXV_mort_featureRec f = GXV_MORT_FEATURE_OFF; - - - GXV_NAME_ENTER( "mort feature list" ); - for ( i = 0; i < nFeatureFlags; i++ ) - { - GXV_LIMIT_CHECK( 2 + 2 + 4 + 4 ); - f.featureType = FT_NEXT_USHORT( p ); - f.featureSetting = FT_NEXT_USHORT( p ); - f.enableFlags = FT_NEXT_ULONG( p ); - f.disableFlags = FT_NEXT_ULONG( p ); - - gxv_mort_feature_validate( &f, valid ); - } - - if ( !IS_GXV_MORT_FEATURE_OFF( f ) ) - FT_INVALID_DATA; - - valid->subtable_length = p - table; - GXV_EXIT; - } - - - FT_LOCAL_DEF( void ) - gxv_mort_coverage_validate( FT_UShort coverage, - GXV_Validator valid ) - { - FT_UNUSED( valid ); - - if ( coverage & 0x8000U ) - GXV_TRACE(( " this subtable is for vertical text only\n" )); - else - GXV_TRACE(( " this subtable is for horizontal text only\n" )); - - if ( coverage & 0x4000 ) - GXV_TRACE(( " this subtable is applied to glyph array " - "in descending order\n" )); - else - GXV_TRACE(( " this subtable is applied to glyph array " - "in ascending order\n" )); - - if ( coverage & 0x2000 ) - GXV_TRACE(( " this subtable is forcibly applied to " - "vertical/horizontal text\n" )); - - if ( coverage & 0x1FF8 ) - GXV_TRACE(( " coverage has non-zero bits in reserved area\n" )); - } - - - static void - gxv_mort_subtables_validate( FT_Bytes table, - FT_Bytes limit, - FT_UShort nSubtables, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_Validate_Func fmt_funcs_table[] = - { - gxv_mort_subtable_type0_validate, /* 0 */ - gxv_mort_subtable_type1_validate, /* 1 */ - gxv_mort_subtable_type2_validate, /* 2 */ - NULL, /* 3 */ - gxv_mort_subtable_type4_validate, /* 4 */ - gxv_mort_subtable_type5_validate, /* 5 */ - - }; - - GXV_Validate_Func func; - FT_UShort i; - - - GXV_NAME_ENTER( "subtables in a chain" ); - - for ( i = 0; i < nSubtables; i++ ) - { - FT_UShort length; - FT_UShort coverage; - FT_ULong subFeatureFlags; - FT_UInt type; - FT_UInt rest; - - - GXV_LIMIT_CHECK( 2 + 2 + 4 ); - length = FT_NEXT_USHORT( p ); - coverage = FT_NEXT_USHORT( p ); - subFeatureFlags = FT_NEXT_ULONG( p ); - - GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n", - i + 1, nSubtables, length )); - type = coverage & 0x0007; - rest = length - ( 2 + 2 + 4 ); - - GXV_LIMIT_CHECK( rest ); - gxv_mort_coverage_validate( coverage, valid ); - - if ( type > 5 ) - FT_INVALID_FORMAT; - - func = fmt_funcs_table[type]; - if ( func == NULL ) - GXV_TRACE(( "morx type %d is reserved\n", type )); - - func( p, p + rest, valid ); - - p += rest; - } - - valid->subtable_length = p - table; - - GXV_EXIT; - } - - - static void - gxv_mort_chain_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - FT_ULong defaultFlags; - FT_ULong chainLength; - FT_UShort nFeatureFlags; - FT_UShort nSubtables; - - - GXV_NAME_ENTER( "mort chain header" ); - - GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 ); - defaultFlags = FT_NEXT_ULONG( p ); - chainLength = FT_NEXT_ULONG( p ); - nFeatureFlags = FT_NEXT_USHORT( p ); - nSubtables = FT_NEXT_USHORT( p ); - - gxv_mort_featurearray_validate( p, table + chainLength, - nFeatureFlags, valid ); - p += valid->subtable_length; - gxv_mort_subtables_validate( p, table + chainLength, nSubtables, valid ); - valid->subtable_length = chainLength; - - GXV_EXIT; - } - - - FT_LOCAL_DEF( void ) - gxv_mort_validate( FT_Bytes table, - FT_Face face, - FT_Validator ftvalid ) - { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; - FT_Bytes p = table; - FT_Bytes limit = 0; - FT_ULong version; - FT_ULong nChains; - FT_ULong i; - - - valid->root = ftvalid; - valid->face = face; - limit = valid->root->limit; - - FT_TRACE3(( "validating `mort' table\n" )); - GXV_INIT; - - GXV_LIMIT_CHECK( 4 + 4 ); - version = FT_NEXT_ULONG( p ); - nChains = FT_NEXT_ULONG( p ); - - if (version != 0x00010000UL) - FT_INVALID_FORMAT; - - for ( i = 0; i < nChains; i++ ) - { - GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains )); - GXV_32BIT_ALIGNMENT_VALIDATE( p - table ); - gxv_mort_chain_validate( p, limit, valid ); - p += valid->subtable_length; - } - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmort.c */ +/* */ +/* TrueTypeGX/AAT mort table validation (body). */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmort.h" +#include "gxvfeat.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmort + + + static void + gxv_mort_feature_validate( GXV_mort_feature f, + GXV_Validator valid ) + { + if ( f->featureType > gxv_feat_registry_length ) + { + GXV_TRACE(( "featureType %d is out of registered range, " + "setting %d is unchecked\n", + f->featureType, f->featureSetting )); + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_DATA; + } + else if ( !gxv_feat_registry[f->featureType].existence ) + { + GXV_TRACE(( "featureType %d is within registered area " + "but undefined, setting %d is unchecked\n", + f->featureType, f->featureSetting )); + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_DATA; + } + else + { + FT_Byte nSettings_max; + + + /* nSettings in gxvfeat.c is halved for exclusive on/off settings */ + nSettings_max = gxv_feat_registry[f->featureType].nSettings; + if ( gxv_feat_registry[f->featureType].exclusive ) + nSettings_max = (FT_Byte)( 2 * nSettings_max ); + + GXV_TRACE(( "featureType %d is registered", f->featureType )); + GXV_TRACE(( "setting %d", f->featureSetting )); + + if ( f->featureSetting > nSettings_max ) + { + GXV_TRACE(( "out of defined range %d", nSettings_max )); + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_DATA; + } + GXV_TRACE(( "\n" )); + } + + /* TODO: enableFlags must be unique value in specified chain? */ + } + + + /* + * nFeatureFlags is typed to FT_UInt to accept that in + * mort (typed FT_UShort) and morx (typed FT_ULong). + */ + FT_LOCAL_DEF( void ) + gxv_mort_featurearray_validate( FT_Bytes table, + FT_Bytes limit, + FT_UInt nFeatureFlags, + GXV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt i; + + GXV_mort_featureRec f = GXV_MORT_FEATURE_OFF; + + + GXV_NAME_ENTER( "mort feature list" ); + for ( i = 0; i < nFeatureFlags; i++ ) + { + GXV_LIMIT_CHECK( 2 + 2 + 4 + 4 ); + f.featureType = FT_NEXT_USHORT( p ); + f.featureSetting = FT_NEXT_USHORT( p ); + f.enableFlags = FT_NEXT_ULONG( p ); + f.disableFlags = FT_NEXT_ULONG( p ); + + gxv_mort_feature_validate( &f, valid ); + } + + if ( !IS_GXV_MORT_FEATURE_OFF( f ) ) + FT_INVALID_DATA; + + valid->subtable_length = p - table; + GXV_EXIT; + } + + + FT_LOCAL_DEF( void ) + gxv_mort_coverage_validate( FT_UShort coverage, + GXV_Validator valid ) + { + FT_UNUSED( valid ); + + if ( coverage & 0x8000U ) + GXV_TRACE(( " this subtable is for vertical text only\n" )); + else + GXV_TRACE(( " this subtable is for horizontal text only\n" )); + + if ( coverage & 0x4000 ) + GXV_TRACE(( " this subtable is applied to glyph array " + "in descending order\n" )); + else + GXV_TRACE(( " this subtable is applied to glyph array " + "in ascending order\n" )); + + if ( coverage & 0x2000 ) + GXV_TRACE(( " this subtable is forcibly applied to " + "vertical/horizontal text\n" )); + + if ( coverage & 0x1FF8 ) + GXV_TRACE(( " coverage has non-zero bits in reserved area\n" )); + } + + + static void + gxv_mort_subtables_validate( FT_Bytes table, + FT_Bytes limit, + FT_UShort nSubtables, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_Validate_Func fmt_funcs_table[] = + { + gxv_mort_subtable_type0_validate, /* 0 */ + gxv_mort_subtable_type1_validate, /* 1 */ + gxv_mort_subtable_type2_validate, /* 2 */ + NULL, /* 3 */ + gxv_mort_subtable_type4_validate, /* 4 */ + gxv_mort_subtable_type5_validate, /* 5 */ + + }; + + GXV_Validate_Func func; + FT_UShort i; + + + GXV_NAME_ENTER( "subtables in a chain" ); + + for ( i = 0; i < nSubtables; i++ ) + { + FT_UShort length; + FT_UShort coverage; + FT_ULong subFeatureFlags; + FT_UInt type; + FT_UInt rest; + + + GXV_LIMIT_CHECK( 2 + 2 + 4 ); + length = FT_NEXT_USHORT( p ); + coverage = FT_NEXT_USHORT( p ); + subFeatureFlags = FT_NEXT_ULONG( p ); + + GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n", + i + 1, nSubtables, length )); + type = coverage & 0x0007; + rest = length - ( 2 + 2 + 4 ); + + GXV_LIMIT_CHECK( rest ); + gxv_mort_coverage_validate( coverage, valid ); + + if ( type > 5 ) + FT_INVALID_FORMAT; + + func = fmt_funcs_table[type]; + if ( func == NULL ) + GXV_TRACE(( "morx type %d is reserved\n", type )); + + func( p, p + rest, valid ); + + p += rest; + } + + valid->subtable_length = p - table; + + GXV_EXIT; + } + + + static void + gxv_mort_chain_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + FT_ULong defaultFlags; + FT_ULong chainLength; + FT_UShort nFeatureFlags; + FT_UShort nSubtables; + + + GXV_NAME_ENTER( "mort chain header" ); + + GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 ); + defaultFlags = FT_NEXT_ULONG( p ); + chainLength = FT_NEXT_ULONG( p ); + nFeatureFlags = FT_NEXT_USHORT( p ); + nSubtables = FT_NEXT_USHORT( p ); + + gxv_mort_featurearray_validate( p, table + chainLength, + nFeatureFlags, valid ); + p += valid->subtable_length; + gxv_mort_subtables_validate( p, table + chainLength, nSubtables, valid ); + valid->subtable_length = chainLength; + + GXV_EXIT; + } + + + FT_LOCAL_DEF( void ) + gxv_mort_validate( FT_Bytes table, + FT_Face face, + FT_Validator ftvalid ) + { + GXV_ValidatorRec validrec; + GXV_Validator valid = &validrec; + FT_Bytes p = table; + FT_Bytes limit = 0; + FT_ULong version; + FT_ULong nChains; + FT_ULong i; + + + valid->root = ftvalid; + valid->face = face; + limit = valid->root->limit; + + FT_TRACE3(( "validating `mort' table\n" )); + GXV_INIT; + + GXV_LIMIT_CHECK( 4 + 4 ); + version = FT_NEXT_ULONG( p ); + nChains = FT_NEXT_ULONG( p ); + + if (version != 0x00010000UL) + FT_INVALID_FORMAT; + + for ( i = 0; i < nChains; i++ ) + { + GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains )); + GXV_32BIT_ALIGNMENT_VALIDATE( p - table ); + gxv_mort_chain_validate( p, limit, valid ); + p += valid->subtable_length; + } + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.h b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.h index 1d64e69c475..8ac956d97c5 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.h +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort.h @@ -1,93 +1,93 @@ -/***************************************************************************/ -/* */ -/* gxvmort.h */ -/* */ -/* TrueTypeGX/AAT common definition for mort table (specification). */ -/* */ -/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#ifndef __GXVMORT_H__ -#define __GXVMORT_H__ - -#include "gxvalid.h" -#include "gxvcommn.h" - -#include FT_SFNT_NAMES_H - - - typedef struct GXV_mort_featureRec_ - { - FT_UShort featureType; - FT_UShort featureSetting; - FT_ULong enableFlags; - FT_ULong disableFlags; - - } GXV_mort_featureRec, *GXV_mort_feature; - -#define GXV_MORT_FEATURE_OFF {0, 1, 0x00000000UL, 0x00000000UL} - -#define IS_GXV_MORT_FEATURE_OFF( f ) \ - ( (f).featureType == 0 || \ - (f).featureSetting == 1 || \ - (f).enableFlags == 0x00000000UL || \ - (f).disableFlags == 0x00000000UL ) - - - FT_LOCAL( void ) - gxv_mort_featurearray_validate( FT_Bytes table, - FT_Bytes limit, - FT_UInt nFeatureFlags, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_mort_coverage_validate( FT_UShort coverage, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_mort_subtable_type0_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_mort_subtable_type1_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_mort_subtable_type2_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_mort_subtable_type4_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_mort_subtable_type5_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - -#endif /* __GXVMORT_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmort.h */ +/* */ +/* TrueTypeGX/AAT common definition for mort table (specification). */ +/* */ +/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#ifndef __GXVMORT_H__ +#define __GXVMORT_H__ + +#include "gxvalid.h" +#include "gxvcommn.h" + +#include FT_SFNT_NAMES_H + + + typedef struct GXV_mort_featureRec_ + { + FT_UShort featureType; + FT_UShort featureSetting; + FT_ULong enableFlags; + FT_ULong disableFlags; + + } GXV_mort_featureRec, *GXV_mort_feature; + +#define GXV_MORT_FEATURE_OFF {0, 1, 0x00000000UL, 0x00000000UL} + +#define IS_GXV_MORT_FEATURE_OFF( f ) \ + ( (f).featureType == 0 || \ + (f).featureSetting == 1 || \ + (f).enableFlags == 0x00000000UL || \ + (f).disableFlags == 0x00000000UL ) + + + FT_LOCAL( void ) + gxv_mort_featurearray_validate( FT_Bytes table, + FT_Bytes limit, + FT_UInt nFeatureFlags, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_mort_coverage_validate( FT_UShort coverage, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_mort_subtable_type0_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_mort_subtable_type1_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_mort_subtable_type2_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_mort_subtable_type4_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_mort_subtable_type5_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + +#endif /* __GXVMORT_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort0.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort0.c index 0902056c628..b9ac2ee2d0f 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort0.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort0.c @@ -1,137 +1,137 @@ -/***************************************************************************/ -/* */ -/* gxvmort0.c */ -/* */ -/* TrueTypeGX/AAT mort table validation */ -/* body for type0 (Indic Script Rearrangement) subtable. */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmort.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmort - - - static const char* GXV_Mort_IndicScript_Msg[] = - { - "no change", - "Ax => xA", - "xD => Dx", - "AxD => DxA", - "ABx => xAB", - "ABx => xBA", - "xCD => CDx", - "xCD => DCx", - "AxCD => CDxA", - "AxCD => DCxA", - "ABxD => DxAB", - "ABxD => DxBA", - "ABxCD => CDxAB", - "ABxCD => CDxBA", - "ABxCD => DCxAB", - "ABxCD => DCxBA", - - }; - - - static void - gxv_mort_subtable_type0_entry_validate( - FT_Byte state, - FT_UShort flags, - GXV_StateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_UShort markFirst; - FT_UShort dontAdvance; - FT_UShort markLast; - FT_UShort reserved; - FT_UShort verb = 0; - - FT_UNUSED( state ); - FT_UNUSED( table ); - FT_UNUSED( limit ); - - FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] ); /* for the non-debugging */ - FT_UNUSED( glyphOffset ); /* case */ - - - markFirst = (FT_UShort)( ( flags >> 15 ) & 1 ); - dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); - markLast = (FT_UShort)( ( flags >> 13 ) & 1 ); - - reserved = (FT_UShort)( flags & 0x1FF0 ); - verb = (FT_UShort)( flags & 0x000F ); - - GXV_TRACE(( " IndicScript MorphRule for glyphOffset 0x%04x", - glyphOffset.u )); - GXV_TRACE(( " markFirst=%01d", markFirst )); - GXV_TRACE(( " dontAdvance=%01d", dontAdvance )); - GXV_TRACE(( " markLast=%01d", markLast )); - GXV_TRACE(( " %02d", verb )); - GXV_TRACE(( " %s\n", GXV_Mort_IndicScript_Msg[verb] )); - - if ( 0 < reserved ) - { - GXV_TRACE(( " non-zero bits found in reserved range\n" )); - FT_INVALID_DATA; - } - else - GXV_TRACE(( "\n" )); - } - - - FT_LOCAL_DEF( void ) - gxv_mort_subtable_type0_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - - GXV_NAME_ENTER( - "mort chain subtable type0 (Indic-Script Rearrangement)" ); - - GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE ); - - valid->statetable.optdata = NULL; - valid->statetable.optdata_load_func = NULL; - valid->statetable.subtable_setup_func = NULL; - valid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; - valid->statetable.entry_validate_func = - gxv_mort_subtable_type0_entry_validate; - - gxv_StateTable_validate( p, limit, valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmort0.c */ +/* */ +/* TrueTypeGX/AAT mort table validation */ +/* body for type0 (Indic Script Rearrangement) subtable. */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmort.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmort + + + static const char* GXV_Mort_IndicScript_Msg[] = + { + "no change", + "Ax => xA", + "xD => Dx", + "AxD => DxA", + "ABx => xAB", + "ABx => xBA", + "xCD => CDx", + "xCD => DCx", + "AxCD => CDxA", + "AxCD => DCxA", + "ABxD => DxAB", + "ABxD => DxBA", + "ABxCD => CDxAB", + "ABxCD => CDxBA", + "ABxCD => DCxAB", + "ABxCD => DCxBA", + + }; + + + static void + gxv_mort_subtable_type0_entry_validate( + FT_Byte state, + FT_UShort flags, + GXV_StateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_UShort markFirst; + FT_UShort dontAdvance; + FT_UShort markLast; + FT_UShort reserved; + FT_UShort verb = 0; + + FT_UNUSED( state ); + FT_UNUSED( table ); + FT_UNUSED( limit ); + + FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] ); /* for the non-debugging */ + FT_UNUSED( glyphOffset ); /* case */ + + + markFirst = (FT_UShort)( ( flags >> 15 ) & 1 ); + dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); + markLast = (FT_UShort)( ( flags >> 13 ) & 1 ); + + reserved = (FT_UShort)( flags & 0x1FF0 ); + verb = (FT_UShort)( flags & 0x000F ); + + GXV_TRACE(( " IndicScript MorphRule for glyphOffset 0x%04x", + glyphOffset.u )); + GXV_TRACE(( " markFirst=%01d", markFirst )); + GXV_TRACE(( " dontAdvance=%01d", dontAdvance )); + GXV_TRACE(( " markLast=%01d", markLast )); + GXV_TRACE(( " %02d", verb )); + GXV_TRACE(( " %s\n", GXV_Mort_IndicScript_Msg[verb] )); + + if ( 0 < reserved ) + { + GXV_TRACE(( " non-zero bits found in reserved range\n" )); + FT_INVALID_DATA; + } + else + GXV_TRACE(( "\n" )); + } + + + FT_LOCAL_DEF( void ) + gxv_mort_subtable_type0_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + + GXV_NAME_ENTER( + "mort chain subtable type0 (Indic-Script Rearrangement)" ); + + GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE ); + + valid->statetable.optdata = NULL; + valid->statetable.optdata_load_func = NULL; + valid->statetable.subtable_setup_func = NULL; + valid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; + valid->statetable.entry_validate_func = + gxv_mort_subtable_type0_entry_validate; + + gxv_StateTable_validate( p, limit, valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort1.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort1.c index 0575b1260ac..df0b5ad37e0 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort1.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort1.c @@ -1,258 +1,258 @@ -/***************************************************************************/ -/* */ -/* gxvmort1.c */ -/* */ -/* TrueTypeGX/AAT mort table validation */ -/* body for type1 (Contextual Substitution) subtable. */ -/* */ -/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmort.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmort - - - typedef struct GXV_mort_subtable_type1_StateOptRec_ - { - FT_UShort substitutionTable; - FT_UShort substitutionTable_length; - - } GXV_mort_subtable_type1_StateOptRec, - *GXV_mort_subtable_type1_StateOptRecData; - -#define GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE \ - ( GXV_STATETABLE_HEADER_SIZE + 2 ) - - - static void - gxv_mort_subtable_type1_substitutionTable_load( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_mort_subtable_type1_StateOptRecData optdata = - (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata; - - - GXV_LIMIT_CHECK( 2 ); - optdata->substitutionTable = FT_NEXT_USHORT( p ); - } - - - static void - gxv_mort_subtable_type1_subtable_setup( FT_UShort table_size, - FT_UShort classTable, - FT_UShort stateArray, - FT_UShort entryTable, - FT_UShort* classTable_length_p, - FT_UShort* stateArray_length_p, - FT_UShort* entryTable_length_p, - GXV_Validator valid ) - { - FT_UShort o[4]; - FT_UShort *l[4]; - FT_UShort buff[5]; - - GXV_mort_subtable_type1_StateOptRecData optdata = - (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata; - - - o[0] = classTable; - o[1] = stateArray; - o[2] = entryTable; - o[3] = optdata->substitutionTable; - l[0] = classTable_length_p; - l[1] = stateArray_length_p; - l[2] = entryTable_length_p; - l[3] = &( optdata->substitutionTable_length ); - - gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, valid ); - } - - - static void - gxv_mort_subtable_type1_offset_to_subst_validate( - FT_Short wordOffset, - const FT_String* tag, - FT_Byte state, - GXV_Validator valid ) - { - FT_UShort substTable; - FT_UShort substTable_limit; - FT_UShort min_gid; - FT_UShort max_gid; - - FT_UNUSED( tag ); - FT_UNUSED( state ); - - - substTable = - ((GXV_mort_subtable_type1_StateOptRec *) - (valid->statetable.optdata))->substitutionTable; - substTable_limit = - (FT_UShort)( substTable + - ((GXV_mort_subtable_type1_StateOptRec *) - (valid->statetable.optdata))->substitutionTable_length ); - - min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 ); - max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 ); - max_gid = (FT_UShort)( FT_MAX( max_gid, valid->face->num_glyphs ) ); - - /* XXX: check range? */ - - /* TODO: min_gid & max_gid comparison with ClassTable contents */ - } - - - static void - gxv_mort_subtable_type1_entry_validate( - FT_Byte state, - FT_UShort flags, - GXV_StateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_UShort setMark; - FT_UShort dontAdvance; - FT_UShort reserved; - FT_Short markOffset; - FT_Short currentOffset; - - FT_UNUSED( table ); - FT_UNUSED( limit ); - - - setMark = (FT_UShort)( flags >> 15 ); - dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); - reserved = (FT_Short)( flags & 0x3FFF ); - - markOffset = (FT_Short)( glyphOffset.ul >> 16 ); - currentOffset = (FT_Short)( glyphOffset.ul ); - - if ( 0 < reserved ) - { - GXV_TRACE(( " non-zero bits found in reserved range\n" )); - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_DATA; - } - - gxv_mort_subtable_type1_offset_to_subst_validate( markOffset, - "markOffset", - state, - valid ); - - gxv_mort_subtable_type1_offset_to_subst_validate( currentOffset, - "currentOffset", - state, - valid ); - } - - - static void - gxv_mort_subtable_type1_substTable_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - FT_UShort num_gids = (FT_UShort)( - ((GXV_mort_subtable_type1_StateOptRec *) - (valid->statetable.optdata))->substitutionTable_length / 2 ); - FT_UShort i; - - - GXV_NAME_ENTER( "validating contents of substitutionTable" ); - for ( i = 0; i < num_gids ; i ++ ) - { - FT_UShort dst_gid; - - - GXV_LIMIT_CHECK( 2 ); - dst_gid = FT_NEXT_USHORT( p ); - - if ( dst_gid >= 0xFFFFU ) - continue; - - if ( dst_gid > valid->face->num_glyphs ) - { - GXV_TRACE(( "substTable include toolarge gid[%d]=%d >" - " max defined gid #%d\n", - i, dst_gid, valid->face->num_glyphs )); - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_GLYPH_ID; - } - } - - GXV_EXIT; - } - - - /* - * subtable for Contextual glyph substitution is a modified StateTable. - * In addition to classTable, stateArray, and entryTable, the field - * `substitutionTable' is added. - */ - FT_LOCAL_DEF( void ) - gxv_mort_subtable_type1_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_mort_subtable_type1_StateOptRec st_rec; - - - GXV_NAME_ENTER( "mort chain subtable type1 (Contextual Glyph Subst)" ); - - GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE ); - - valid->statetable.optdata = - &st_rec; - valid->statetable.optdata_load_func = - gxv_mort_subtable_type1_substitutionTable_load; - valid->statetable.subtable_setup_func = - gxv_mort_subtable_type1_subtable_setup; - valid->statetable.entry_glyphoffset_fmt = - GXV_GLYPHOFFSET_ULONG; - valid->statetable.entry_validate_func = - - gxv_mort_subtable_type1_entry_validate; - gxv_StateTable_validate( p, limit, valid ); - - gxv_mort_subtable_type1_substTable_validate( - table + st_rec.substitutionTable, - table + st_rec.substitutionTable + st_rec.substitutionTable_length, - valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmort1.c */ +/* */ +/* TrueTypeGX/AAT mort table validation */ +/* body for type1 (Contextual Substitution) subtable. */ +/* */ +/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmort.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmort + + + typedef struct GXV_mort_subtable_type1_StateOptRec_ + { + FT_UShort substitutionTable; + FT_UShort substitutionTable_length; + + } GXV_mort_subtable_type1_StateOptRec, + *GXV_mort_subtable_type1_StateOptRecData; + +#define GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE \ + ( GXV_STATETABLE_HEADER_SIZE + 2 ) + + + static void + gxv_mort_subtable_type1_substitutionTable_load( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_mort_subtable_type1_StateOptRecData optdata = + (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata; + + + GXV_LIMIT_CHECK( 2 ); + optdata->substitutionTable = FT_NEXT_USHORT( p ); + } + + + static void + gxv_mort_subtable_type1_subtable_setup( FT_UShort table_size, + FT_UShort classTable, + FT_UShort stateArray, + FT_UShort entryTable, + FT_UShort* classTable_length_p, + FT_UShort* stateArray_length_p, + FT_UShort* entryTable_length_p, + GXV_Validator valid ) + { + FT_UShort o[4]; + FT_UShort *l[4]; + FT_UShort buff[5]; + + GXV_mort_subtable_type1_StateOptRecData optdata = + (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata; + + + o[0] = classTable; + o[1] = stateArray; + o[2] = entryTable; + o[3] = optdata->substitutionTable; + l[0] = classTable_length_p; + l[1] = stateArray_length_p; + l[2] = entryTable_length_p; + l[3] = &( optdata->substitutionTable_length ); + + gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, valid ); + } + + + static void + gxv_mort_subtable_type1_offset_to_subst_validate( + FT_Short wordOffset, + const FT_String* tag, + FT_Byte state, + GXV_Validator valid ) + { + FT_UShort substTable; + FT_UShort substTable_limit; + FT_UShort min_gid; + FT_UShort max_gid; + + FT_UNUSED( tag ); + FT_UNUSED( state ); + + + substTable = + ((GXV_mort_subtable_type1_StateOptRec *) + (valid->statetable.optdata))->substitutionTable; + substTable_limit = + (FT_UShort)( substTable + + ((GXV_mort_subtable_type1_StateOptRec *) + (valid->statetable.optdata))->substitutionTable_length ); + + min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 ); + max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 ); + max_gid = (FT_UShort)( FT_MAX( max_gid, valid->face->num_glyphs ) ); + + /* XXX: check range? */ + + /* TODO: min_gid & max_gid comparison with ClassTable contents */ + } + + + static void + gxv_mort_subtable_type1_entry_validate( + FT_Byte state, + FT_UShort flags, + GXV_StateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_UShort setMark; + FT_UShort dontAdvance; + FT_UShort reserved; + FT_Short markOffset; + FT_Short currentOffset; + + FT_UNUSED( table ); + FT_UNUSED( limit ); + + + setMark = (FT_UShort)( flags >> 15 ); + dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); + reserved = (FT_Short)( flags & 0x3FFF ); + + markOffset = (FT_Short)( glyphOffset.ul >> 16 ); + currentOffset = (FT_Short)( glyphOffset.ul ); + + if ( 0 < reserved ) + { + GXV_TRACE(( " non-zero bits found in reserved range\n" )); + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_DATA; + } + + gxv_mort_subtable_type1_offset_to_subst_validate( markOffset, + "markOffset", + state, + valid ); + + gxv_mort_subtable_type1_offset_to_subst_validate( currentOffset, + "currentOffset", + state, + valid ); + } + + + static void + gxv_mort_subtable_type1_substTable_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + FT_UShort num_gids = (FT_UShort)( + ((GXV_mort_subtable_type1_StateOptRec *) + (valid->statetable.optdata))->substitutionTable_length / 2 ); + FT_UShort i; + + + GXV_NAME_ENTER( "validating contents of substitutionTable" ); + for ( i = 0; i < num_gids ; i ++ ) + { + FT_UShort dst_gid; + + + GXV_LIMIT_CHECK( 2 ); + dst_gid = FT_NEXT_USHORT( p ); + + if ( dst_gid >= 0xFFFFU ) + continue; + + if ( dst_gid > valid->face->num_glyphs ) + { + GXV_TRACE(( "substTable include toolarge gid[%d]=%d >" + " max defined gid #%d\n", + i, dst_gid, valid->face->num_glyphs )); + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_GLYPH_ID; + } + } + + GXV_EXIT; + } + + + /* + * subtable for Contextual glyph substitution is a modified StateTable. + * In addition to classTable, stateArray, and entryTable, the field + * `substitutionTable' is added. + */ + FT_LOCAL_DEF( void ) + gxv_mort_subtable_type1_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_mort_subtable_type1_StateOptRec st_rec; + + + GXV_NAME_ENTER( "mort chain subtable type1 (Contextual Glyph Subst)" ); + + GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE ); + + valid->statetable.optdata = + &st_rec; + valid->statetable.optdata_load_func = + gxv_mort_subtable_type1_substitutionTable_load; + valid->statetable.subtable_setup_func = + gxv_mort_subtable_type1_subtable_setup; + valid->statetable.entry_glyphoffset_fmt = + GXV_GLYPHOFFSET_ULONG; + valid->statetable.entry_validate_func = + + gxv_mort_subtable_type1_entry_validate; + gxv_StateTable_validate( p, limit, valid ); + + gxv_mort_subtable_type1_substTable_validate( + table + st_rec.substitutionTable, + table + st_rec.substitutionTable + st_rec.substitutionTable_length, + valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort2.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort2.c index f19d15dab5d..a33d1679a69 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort2.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort2.c @@ -1,282 +1,282 @@ -/***************************************************************************/ -/* */ -/* gxvmort2.c */ -/* */ -/* TrueTypeGX/AAT mort table validation */ -/* body for type2 (Ligature Substitution) subtable. */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmort.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmort - - - typedef struct GXV_mort_subtable_type2_StateOptRec_ - { - FT_UShort ligActionTable; - FT_UShort componentTable; - FT_UShort ligatureTable; - FT_UShort ligActionTable_length; - FT_UShort componentTable_length; - FT_UShort ligatureTable_length; - - } GXV_mort_subtable_type2_StateOptRec, - *GXV_mort_subtable_type2_StateOptRecData; - -#define GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE \ - ( GXV_STATETABLE_HEADER_SIZE + 2 + 2 + 2 ) - - - static void - gxv_mort_subtable_type2_opttable_load( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; - - - GXV_LIMIT_CHECK( 2 + 2 + 2 ); - optdata->ligActionTable = FT_NEXT_USHORT( p ); - optdata->componentTable = FT_NEXT_USHORT( p ); - optdata->ligatureTable = FT_NEXT_USHORT( p ); - - GXV_TRACE(( "offset to ligActionTable=0x%04x\n", - optdata->ligActionTable )); - GXV_TRACE(( "offset to componentTable=0x%04x\n", - optdata->componentTable )); - GXV_TRACE(( "offset to ligatureTable=0x%04x\n", - optdata->ligatureTable )); - } - - - static void - gxv_mort_subtable_type2_subtable_setup( FT_UShort table_size, - FT_UShort classTable, - FT_UShort stateArray, - FT_UShort entryTable, - FT_UShort *classTable_length_p, - FT_UShort *stateArray_length_p, - FT_UShort *entryTable_length_p, - GXV_Validator valid ) - { - FT_UShort o[6]; - FT_UShort *l[6]; - FT_UShort buff[7]; - - GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; - - - GXV_NAME_ENTER( "subtable boundaries setup" ); - - o[0] = classTable; - o[1] = stateArray; - o[2] = entryTable; - o[3] = optdata->ligActionTable; - o[4] = optdata->componentTable; - o[5] = optdata->ligatureTable; - l[0] = classTable_length_p; - l[1] = stateArray_length_p; - l[2] = entryTable_length_p; - l[3] = &(optdata->ligActionTable_length); - l[4] = &(optdata->componentTable_length); - l[5] = &(optdata->ligatureTable_length); - - gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, valid ); - - GXV_TRACE(( "classTable: offset=0x%04x length=0x%04x\n", - classTable, *classTable_length_p )); - GXV_TRACE(( "stateArray: offset=0x%04x length=0x%04x\n", - stateArray, *stateArray_length_p )); - GXV_TRACE(( "entryTable: offset=0x%04x length=0x%04x\n", - entryTable, *entryTable_length_p )); - GXV_TRACE(( "ligActionTable: offset=0x%04x length=0x%04x\n", - optdata->ligActionTable, - optdata->ligActionTable_length )); - GXV_TRACE(( "componentTable: offset=0x%04x length=0x%04x\n", - optdata->componentTable, - optdata->componentTable_length )); - GXV_TRACE(( "ligatureTable: offset=0x%04x length=0x%04x\n", - optdata->ligatureTable, - optdata->ligatureTable_length )); - - GXV_EXIT; - } - - - static void - gxv_mort_subtable_type2_ligActionOffset_validate( - FT_Bytes table, - FT_UShort ligActionOffset, - GXV_Validator valid ) - { - /* access ligActionTable */ - GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; - - FT_Bytes lat_base = table + optdata->ligActionTable; - FT_Bytes p = table + ligActionOffset; - FT_Bytes lat_limit = lat_base + optdata->ligActionTable; - - - GXV_32BIT_ALIGNMENT_VALIDATE( ligActionOffset ); - if ( p < lat_base ) - { - GXV_TRACE(( "too short offset 0x%04x: p < lat_base (%d byte rewind)\n", - ligActionOffset, lat_base - p )); - - /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */ - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_OFFSET; - } - else if ( lat_limit < p ) - { - GXV_TRACE(( "too large offset 0x%04x: lat_limit < p (%d byte overrun)\n", - ligActionOffset, p - lat_limit )); - - /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */ - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_OFFSET; - } - else - { - /* validate entry in ligActionTable */ - FT_ULong lig_action; - FT_UShort last; - FT_UShort store; - FT_ULong offset; - - - lig_action = FT_NEXT_ULONG( p ); - last = (FT_UShort)( ( lig_action >> 31 ) & 1 ); - store = (FT_UShort)( ( lig_action >> 30 ) & 1 ); - - offset = lig_action & 0x3FFFFFFFUL; - } - } - - - static void - gxv_mort_subtable_type2_entry_validate( - FT_Byte state, - FT_UShort flags, - GXV_StateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_UShort setComponent; - FT_UShort dontAdvance; - FT_UShort offset; - - FT_UNUSED( state ); - FT_UNUSED( glyphOffset ); - FT_UNUSED( limit ); - - - setComponent = (FT_UShort)( ( flags >> 15 ) & 1 ); - dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); - - offset = (FT_UShort)( flags & 0x3FFFU ); - - if ( 0 < offset ) - gxv_mort_subtable_type2_ligActionOffset_validate( table, offset, - valid ); - } - - - static void - gxv_mort_subtable_type2_ligatureTable_validate( FT_Bytes table, - GXV_Validator valid ) - { - GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; - - FT_Bytes p = table + optdata->ligatureTable; - FT_Bytes limit = table + optdata->ligatureTable - + optdata->ligatureTable_length; - - - GXV_NAME_ENTER( "mort chain subtable type2 - substitutionTable" ); - if ( 0 != optdata->ligatureTable ) - { - /* Apple does not give specification of ligatureTable format */ - while ( p < limit ) - { - FT_UShort lig_gid; - - - GXV_LIMIT_CHECK( 2 ); - lig_gid = FT_NEXT_USHORT( p ); - } - } - GXV_EXIT; - } - - - FT_LOCAL_DEF( void ) - gxv_mort_subtable_type2_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_mort_subtable_type2_StateOptRec lig_rec; - - - GXV_NAME_ENTER( "mort chain subtable type2 (Ligature Substitution)" ); - - GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE ); - - valid->statetable.optdata = - &lig_rec; - valid->statetable.optdata_load_func = - gxv_mort_subtable_type2_opttable_load; - valid->statetable.subtable_setup_func = - gxv_mort_subtable_type2_subtable_setup; - valid->statetable.entry_glyphoffset_fmt = - GXV_GLYPHOFFSET_NONE; - valid->statetable.entry_validate_func = - gxv_mort_subtable_type2_entry_validate; - - gxv_StateTable_validate( p, limit, valid ); - - p += valid->subtable_length; - gxv_mort_subtable_type2_ligatureTable_validate( table, valid ); - - valid->subtable_length = p - table; - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmort2.c */ +/* */ +/* TrueTypeGX/AAT mort table validation */ +/* body for type2 (Ligature Substitution) subtable. */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmort.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmort + + + typedef struct GXV_mort_subtable_type2_StateOptRec_ + { + FT_UShort ligActionTable; + FT_UShort componentTable; + FT_UShort ligatureTable; + FT_UShort ligActionTable_length; + FT_UShort componentTable_length; + FT_UShort ligatureTable_length; + + } GXV_mort_subtable_type2_StateOptRec, + *GXV_mort_subtable_type2_StateOptRecData; + +#define GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE \ + ( GXV_STATETABLE_HEADER_SIZE + 2 + 2 + 2 ) + + + static void + gxv_mort_subtable_type2_opttable_load( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + GXV_mort_subtable_type2_StateOptRecData optdata = + (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + + + GXV_LIMIT_CHECK( 2 + 2 + 2 ); + optdata->ligActionTable = FT_NEXT_USHORT( p ); + optdata->componentTable = FT_NEXT_USHORT( p ); + optdata->ligatureTable = FT_NEXT_USHORT( p ); + + GXV_TRACE(( "offset to ligActionTable=0x%04x\n", + optdata->ligActionTable )); + GXV_TRACE(( "offset to componentTable=0x%04x\n", + optdata->componentTable )); + GXV_TRACE(( "offset to ligatureTable=0x%04x\n", + optdata->ligatureTable )); + } + + + static void + gxv_mort_subtable_type2_subtable_setup( FT_UShort table_size, + FT_UShort classTable, + FT_UShort stateArray, + FT_UShort entryTable, + FT_UShort *classTable_length_p, + FT_UShort *stateArray_length_p, + FT_UShort *entryTable_length_p, + GXV_Validator valid ) + { + FT_UShort o[6]; + FT_UShort *l[6]; + FT_UShort buff[7]; + + GXV_mort_subtable_type2_StateOptRecData optdata = + (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + + + GXV_NAME_ENTER( "subtable boundaries setup" ); + + o[0] = classTable; + o[1] = stateArray; + o[2] = entryTable; + o[3] = optdata->ligActionTable; + o[4] = optdata->componentTable; + o[5] = optdata->ligatureTable; + l[0] = classTable_length_p; + l[1] = stateArray_length_p; + l[2] = entryTable_length_p; + l[3] = &(optdata->ligActionTable_length); + l[4] = &(optdata->componentTable_length); + l[5] = &(optdata->ligatureTable_length); + + gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, valid ); + + GXV_TRACE(( "classTable: offset=0x%04x length=0x%04x\n", + classTable, *classTable_length_p )); + GXV_TRACE(( "stateArray: offset=0x%04x length=0x%04x\n", + stateArray, *stateArray_length_p )); + GXV_TRACE(( "entryTable: offset=0x%04x length=0x%04x\n", + entryTable, *entryTable_length_p )); + GXV_TRACE(( "ligActionTable: offset=0x%04x length=0x%04x\n", + optdata->ligActionTable, + optdata->ligActionTable_length )); + GXV_TRACE(( "componentTable: offset=0x%04x length=0x%04x\n", + optdata->componentTable, + optdata->componentTable_length )); + GXV_TRACE(( "ligatureTable: offset=0x%04x length=0x%04x\n", + optdata->ligatureTable, + optdata->ligatureTable_length )); + + GXV_EXIT; + } + + + static void + gxv_mort_subtable_type2_ligActionOffset_validate( + FT_Bytes table, + FT_UShort ligActionOffset, + GXV_Validator valid ) + { + /* access ligActionTable */ + GXV_mort_subtable_type2_StateOptRecData optdata = + (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + + FT_Bytes lat_base = table + optdata->ligActionTable; + FT_Bytes p = table + ligActionOffset; + FT_Bytes lat_limit = lat_base + optdata->ligActionTable; + + + GXV_32BIT_ALIGNMENT_VALIDATE( ligActionOffset ); + if ( p < lat_base ) + { + GXV_TRACE(( "too short offset 0x%04x: p < lat_base (%d byte rewind)\n", + ligActionOffset, lat_base - p )); + + /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */ + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_OFFSET; + } + else if ( lat_limit < p ) + { + GXV_TRACE(( "too large offset 0x%04x: lat_limit < p (%d byte overrun)\n", + ligActionOffset, p - lat_limit )); + + /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */ + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_OFFSET; + } + else + { + /* validate entry in ligActionTable */ + FT_ULong lig_action; + FT_UShort last; + FT_UShort store; + FT_ULong offset; + + + lig_action = FT_NEXT_ULONG( p ); + last = (FT_UShort)( ( lig_action >> 31 ) & 1 ); + store = (FT_UShort)( ( lig_action >> 30 ) & 1 ); + + offset = lig_action & 0x3FFFFFFFUL; + } + } + + + static void + gxv_mort_subtable_type2_entry_validate( + FT_Byte state, + FT_UShort flags, + GXV_StateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_UShort setComponent; + FT_UShort dontAdvance; + FT_UShort offset; + + FT_UNUSED( state ); + FT_UNUSED( glyphOffset ); + FT_UNUSED( limit ); + + + setComponent = (FT_UShort)( ( flags >> 15 ) & 1 ); + dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); + + offset = (FT_UShort)( flags & 0x3FFFU ); + + if ( 0 < offset ) + gxv_mort_subtable_type2_ligActionOffset_validate( table, offset, + valid ); + } + + + static void + gxv_mort_subtable_type2_ligatureTable_validate( FT_Bytes table, + GXV_Validator valid ) + { + GXV_mort_subtable_type2_StateOptRecData optdata = + (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + + FT_Bytes p = table + optdata->ligatureTable; + FT_Bytes limit = table + optdata->ligatureTable + + optdata->ligatureTable_length; + + + GXV_NAME_ENTER( "mort chain subtable type2 - substitutionTable" ); + if ( 0 != optdata->ligatureTable ) + { + /* Apple does not give specification of ligatureTable format */ + while ( p < limit ) + { + FT_UShort lig_gid; + + + GXV_LIMIT_CHECK( 2 ); + lig_gid = FT_NEXT_USHORT( p ); + } + } + GXV_EXIT; + } + + + FT_LOCAL_DEF( void ) + gxv_mort_subtable_type2_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_mort_subtable_type2_StateOptRec lig_rec; + + + GXV_NAME_ENTER( "mort chain subtable type2 (Ligature Substitution)" ); + + GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE ); + + valid->statetable.optdata = + &lig_rec; + valid->statetable.optdata_load_func = + gxv_mort_subtable_type2_opttable_load; + valid->statetable.subtable_setup_func = + gxv_mort_subtable_type2_subtable_setup; + valid->statetable.entry_glyphoffset_fmt = + GXV_GLYPHOFFSET_NONE; + valid->statetable.entry_validate_func = + gxv_mort_subtable_type2_entry_validate; + + gxv_StateTable_validate( p, limit, valid ); + + p += valid->subtable_length; + gxv_mort_subtable_type2_ligatureTable_validate( table, valid ); + + valid->subtable_length = p - table; + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort4.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort4.c index a04bc1efaf4..2df0257c74d 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort4.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort4.c @@ -1,125 +1,125 @@ -/***************************************************************************/ -/* */ -/* gxvmort4.c */ -/* */ -/* TrueTypeGX/AAT mort table validation */ -/* body for type4 (Non-Contextual Glyph Substitution) subtable. */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmort.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmort - - - static void - gxv_mort_subtable_type4_lookupval_validate( FT_UShort glyph, - GXV_LookupValueDesc value, - GXV_Validator valid ) - { - FT_UNUSED( glyph ); - - gxv_glyphid_validate( value.u, valid ); - } - - /* - +===============+ --------+ - | lookup header | | - +===============+ | - | BinSrchHeader | | - +===============+ | - | lastGlyph[0] | | - +---------------+ | - | firstGlyph[0] | | head of lookup table - +---------------+ | + - | offset[0] | -> | offset [byte] - +===============+ | + - | lastGlyph[1] | | (glyphID - firstGlyph) * 2 [byte] - +---------------+ | - | firstGlyph[1] | | - +---------------+ | - | offset[1] | | - +===============+ | - | - .... | - | - 16bit value array | - +===============+ | - | value | <-------+ - .... - */ - - static GXV_LookupValueDesc - gxv_mort_subtable_type4_lookupfmt4_transit( - FT_UShort relative_gindex, - GXV_LookupValueDesc base_value, - FT_Bytes lookuptbl_limit, - GXV_Validator valid ) - { - FT_Bytes p; - FT_Bytes limit; - FT_UShort offset; - GXV_LookupValueDesc value; - - /* XXX: check range? */ - offset = (FT_UShort)( base_value.u + - relative_gindex * sizeof ( FT_UShort ) ); - - p = valid->lookuptbl_head + offset; - limit = lookuptbl_limit; - - GXV_LIMIT_CHECK( 2 ); - value.u = FT_NEXT_USHORT( p ); - - return value; - } - - - FT_LOCAL_DEF( void ) - gxv_mort_subtable_type4_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - - GXV_NAME_ENTER( "mort chain subtable type4 " - "(Non-Contextual Glyph Substitution)" ); - - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_mort_subtable_type4_lookupval_validate; - valid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit; - - gxv_LookupTable_validate( p, limit, valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmort4.c */ +/* */ +/* TrueTypeGX/AAT mort table validation */ +/* body for type4 (Non-Contextual Glyph Substitution) subtable. */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmort.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmort + + + static void + gxv_mort_subtable_type4_lookupval_validate( FT_UShort glyph, + GXV_LookupValueDesc value, + GXV_Validator valid ) + { + FT_UNUSED( glyph ); + + gxv_glyphid_validate( value.u, valid ); + } + + /* + +===============+ --------+ + | lookup header | | + +===============+ | + | BinSrchHeader | | + +===============+ | + | lastGlyph[0] | | + +---------------+ | + | firstGlyph[0] | | head of lookup table + +---------------+ | + + | offset[0] | -> | offset [byte] + +===============+ | + + | lastGlyph[1] | | (glyphID - firstGlyph) * 2 [byte] + +---------------+ | + | firstGlyph[1] | | + +---------------+ | + | offset[1] | | + +===============+ | + | + .... | + | + 16bit value array | + +===============+ | + | value | <-------+ + .... + */ + + static GXV_LookupValueDesc + gxv_mort_subtable_type4_lookupfmt4_transit( + FT_UShort relative_gindex, + GXV_LookupValueDesc base_value, + FT_Bytes lookuptbl_limit, + GXV_Validator valid ) + { + FT_Bytes p; + FT_Bytes limit; + FT_UShort offset; + GXV_LookupValueDesc value; + + /* XXX: check range? */ + offset = (FT_UShort)( base_value.u + + relative_gindex * sizeof ( FT_UShort ) ); + + p = valid->lookuptbl_head + offset; + limit = lookuptbl_limit; + + GXV_LIMIT_CHECK( 2 ); + value.u = FT_NEXT_USHORT( p ); + + return value; + } + + + FT_LOCAL_DEF( void ) + gxv_mort_subtable_type4_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + + GXV_NAME_ENTER( "mort chain subtable type4 " + "(Non-Contextual Glyph Substitution)" ); + + valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + valid->lookupval_func = gxv_mort_subtable_type4_lookupval_validate; + valid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit; + + gxv_LookupTable_validate( p, limit, valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort5.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort5.c index a7cabc359fc..5ff53001ef3 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort5.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmort5.c @@ -1,226 +1,226 @@ -/***************************************************************************/ -/* */ -/* gxvmort5.c */ -/* */ -/* TrueTypeGX/AAT mort table validation */ -/* body for type5 (Contextual Glyph Insertion) subtable. */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmort.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmort - - - /* - * mort subtable type5 (Contextual Glyph Insertion) - * has the format of StateTable with insertion-glyph-list, - * but without name. The offset is given by glyphOffset in - * entryTable. There is no table location declaration - * like xxxTable. - */ - - typedef struct GXV_mort_subtable_type5_StateOptRec_ - { - FT_UShort classTable; - FT_UShort stateArray; - FT_UShort entryTable; - -#define GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE GXV_STATETABLE_HEADER_SIZE - - FT_UShort* classTable_length_p; - FT_UShort* stateArray_length_p; - FT_UShort* entryTable_length_p; - - } GXV_mort_subtable_type5_StateOptRec, - *GXV_mort_subtable_type5_StateOptRecData; - - - FT_LOCAL_DEF( void ) - gxv_mort_subtable_type5_subtable_setup( FT_UShort table_size, - FT_UShort classTable, - FT_UShort stateArray, - FT_UShort entryTable, - FT_UShort* classTable_length_p, - FT_UShort* stateArray_length_p, - FT_UShort* entryTable_length_p, - GXV_Validator valid ) - { - GXV_mort_subtable_type5_StateOptRecData optdata = - (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata; - - - gxv_StateTable_subtable_setup( table_size, - classTable, - stateArray, - entryTable, - classTable_length_p, - stateArray_length_p, - entryTable_length_p, - valid ); - - optdata->classTable = classTable; - optdata->stateArray = stateArray; - optdata->entryTable = entryTable; - - optdata->classTable_length_p = classTable_length_p; - optdata->stateArray_length_p = stateArray_length_p; - optdata->entryTable_length_p = entryTable_length_p; - } - - - static void - gxv_mort_subtable_type5_InsertList_validate( FT_UShort offset, - FT_UShort count, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - /* - * We don't know the range of insertion-glyph-list. - * Set range by whole of state table. - */ - FT_Bytes p = table + offset; - - GXV_mort_subtable_type5_StateOptRecData optdata = - (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata; - - if ( optdata->classTable < offset && - offset < optdata->classTable + *(optdata->classTable_length_p) ) - GXV_TRACE(( " offset runs into ClassTable" )); - if ( optdata->stateArray < offset && - offset < optdata->stateArray + *(optdata->stateArray_length_p) ) - GXV_TRACE(( " offset runs into StateArray" )); - if ( optdata->entryTable < offset && - offset < optdata->entryTable + *(optdata->entryTable_length_p) ) - GXV_TRACE(( " offset runs into EntryTable" )); - - while ( p < table + offset + ( count * 2 ) ) - { - FT_UShort insert_glyphID; - - - GXV_LIMIT_CHECK( 2 ); - insert_glyphID = FT_NEXT_USHORT( p ); - GXV_TRACE(( " 0x%04x", insert_glyphID )); - } - - GXV_TRACE(( "\n" )); - } - - - static void - gxv_mort_subtable_type5_entry_validate( - FT_Byte state, - FT_UShort flags, - GXV_StateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bool setMark; - FT_Bool dontAdvance; - FT_Bool currentIsKashidaLike; - FT_Bool markedIsKashidaLike; - FT_Bool currentInsertBefore; - FT_Bool markedInsertBefore; - FT_Byte currentInsertCount; - FT_Byte markedInsertCount; - FT_UShort currentInsertList; - FT_UShort markedInsertList; - - FT_UNUSED( state ); - - - setMark = FT_BOOL( ( flags >> 15 ) & 1 ); - dontAdvance = FT_BOOL( ( flags >> 14 ) & 1 ); - currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 ); - markedIsKashidaLike = FT_BOOL( ( flags >> 12 ) & 1 ); - currentInsertBefore = FT_BOOL( ( flags >> 11 ) & 1 ); - markedInsertBefore = FT_BOOL( ( flags >> 10 ) & 1 ); - - currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F ); - markedInsertCount = (FT_Byte)( flags & 0x001F ); - - currentInsertList = (FT_UShort)( glyphOffset.ul >> 16 ); - markedInsertList = (FT_UShort)( glyphOffset.ul ); - - if ( 0 != currentInsertList && 0 != currentInsertCount ) - { - gxv_mort_subtable_type5_InsertList_validate( currentInsertList, - currentInsertCount, - table, - limit, - valid ); - } - - if ( 0 != markedInsertList && 0 != markedInsertCount ) - { - gxv_mort_subtable_type5_InsertList_validate( markedInsertList, - markedInsertCount, - table, - limit, - valid ); - } - } - - - FT_LOCAL_DEF( void ) - gxv_mort_subtable_type5_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_mort_subtable_type5_StateOptRec et_rec; - GXV_mort_subtable_type5_StateOptRecData et = &et_rec; - - - GXV_NAME_ENTER( "mort chain subtable type5 (Glyph Insertion)" ); - - GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE ); - - valid->statetable.optdata = - et; - valid->statetable.optdata_load_func = - NULL; - valid->statetable.subtable_setup_func = - gxv_mort_subtable_type5_subtable_setup; - valid->statetable.entry_glyphoffset_fmt = - GXV_GLYPHOFFSET_ULONG; - valid->statetable.entry_validate_func = - gxv_mort_subtable_type5_entry_validate; - - gxv_StateTable_validate( p, limit, valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmort5.c */ +/* */ +/* TrueTypeGX/AAT mort table validation */ +/* body for type5 (Contextual Glyph Insertion) subtable. */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmort.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmort + + + /* + * mort subtable type5 (Contextual Glyph Insertion) + * has the format of StateTable with insertion-glyph-list, + * but without name. The offset is given by glyphOffset in + * entryTable. There is no table location declaration + * like xxxTable. + */ + + typedef struct GXV_mort_subtable_type5_StateOptRec_ + { + FT_UShort classTable; + FT_UShort stateArray; + FT_UShort entryTable; + +#define GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE GXV_STATETABLE_HEADER_SIZE + + FT_UShort* classTable_length_p; + FT_UShort* stateArray_length_p; + FT_UShort* entryTable_length_p; + + } GXV_mort_subtable_type5_StateOptRec, + *GXV_mort_subtable_type5_StateOptRecData; + + + FT_LOCAL_DEF( void ) + gxv_mort_subtable_type5_subtable_setup( FT_UShort table_size, + FT_UShort classTable, + FT_UShort stateArray, + FT_UShort entryTable, + FT_UShort* classTable_length_p, + FT_UShort* stateArray_length_p, + FT_UShort* entryTable_length_p, + GXV_Validator valid ) + { + GXV_mort_subtable_type5_StateOptRecData optdata = + (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata; + + + gxv_StateTable_subtable_setup( table_size, + classTable, + stateArray, + entryTable, + classTable_length_p, + stateArray_length_p, + entryTable_length_p, + valid ); + + optdata->classTable = classTable; + optdata->stateArray = stateArray; + optdata->entryTable = entryTable; + + optdata->classTable_length_p = classTable_length_p; + optdata->stateArray_length_p = stateArray_length_p; + optdata->entryTable_length_p = entryTable_length_p; + } + + + static void + gxv_mort_subtable_type5_InsertList_validate( FT_UShort offset, + FT_UShort count, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + /* + * We don't know the range of insertion-glyph-list. + * Set range by whole of state table. + */ + FT_Bytes p = table + offset; + + GXV_mort_subtable_type5_StateOptRecData optdata = + (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata; + + if ( optdata->classTable < offset && + offset < optdata->classTable + *(optdata->classTable_length_p) ) + GXV_TRACE(( " offset runs into ClassTable" )); + if ( optdata->stateArray < offset && + offset < optdata->stateArray + *(optdata->stateArray_length_p) ) + GXV_TRACE(( " offset runs into StateArray" )); + if ( optdata->entryTable < offset && + offset < optdata->entryTable + *(optdata->entryTable_length_p) ) + GXV_TRACE(( " offset runs into EntryTable" )); + + while ( p < table + offset + ( count * 2 ) ) + { + FT_UShort insert_glyphID; + + + GXV_LIMIT_CHECK( 2 ); + insert_glyphID = FT_NEXT_USHORT( p ); + GXV_TRACE(( " 0x%04x", insert_glyphID )); + } + + GXV_TRACE(( "\n" )); + } + + + static void + gxv_mort_subtable_type5_entry_validate( + FT_Byte state, + FT_UShort flags, + GXV_StateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bool setMark; + FT_Bool dontAdvance; + FT_Bool currentIsKashidaLike; + FT_Bool markedIsKashidaLike; + FT_Bool currentInsertBefore; + FT_Bool markedInsertBefore; + FT_Byte currentInsertCount; + FT_Byte markedInsertCount; + FT_UShort currentInsertList; + FT_UShort markedInsertList; + + FT_UNUSED( state ); + + + setMark = FT_BOOL( ( flags >> 15 ) & 1 ); + dontAdvance = FT_BOOL( ( flags >> 14 ) & 1 ); + currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 ); + markedIsKashidaLike = FT_BOOL( ( flags >> 12 ) & 1 ); + currentInsertBefore = FT_BOOL( ( flags >> 11 ) & 1 ); + markedInsertBefore = FT_BOOL( ( flags >> 10 ) & 1 ); + + currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F ); + markedInsertCount = (FT_Byte)( flags & 0x001F ); + + currentInsertList = (FT_UShort)( glyphOffset.ul >> 16 ); + markedInsertList = (FT_UShort)( glyphOffset.ul ); + + if ( 0 != currentInsertList && 0 != currentInsertCount ) + { + gxv_mort_subtable_type5_InsertList_validate( currentInsertList, + currentInsertCount, + table, + limit, + valid ); + } + + if ( 0 != markedInsertList && 0 != markedInsertCount ) + { + gxv_mort_subtable_type5_InsertList_validate( markedInsertList, + markedInsertCount, + table, + limit, + valid ); + } + } + + + FT_LOCAL_DEF( void ) + gxv_mort_subtable_type5_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_mort_subtable_type5_StateOptRec et_rec; + GXV_mort_subtable_type5_StateOptRecData et = &et_rec; + + + GXV_NAME_ENTER( "mort chain subtable type5 (Glyph Insertion)" ); + + GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE ); + + valid->statetable.optdata = + et; + valid->statetable.optdata_load_func = + NULL; + valid->statetable.subtable_setup_func = + gxv_mort_subtable_type5_subtable_setup; + valid->statetable.entry_glyphoffset_fmt = + GXV_GLYPHOFFSET_ULONG; + valid->statetable.entry_validate_func = + gxv_mort_subtable_type5_entry_validate; + + gxv_StateTable_validate( p, limit, valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.c index 849d5e942a5..a2b54596bc5 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.c @@ -1,183 +1,183 @@ -/***************************************************************************/ -/* */ -/* gxvmorx.c */ -/* */ -/* TrueTypeGX/AAT morx table validation (body). */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmorx.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmorx - - - static void - gxv_morx_subtables_validate( FT_Bytes table, - FT_Bytes limit, - FT_UShort nSubtables, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_Validate_Func fmt_funcs_table[] = - { - gxv_morx_subtable_type0_validate, /* 0 */ - gxv_morx_subtable_type1_validate, /* 1 */ - gxv_morx_subtable_type2_validate, /* 2 */ - NULL, /* 3 */ - gxv_morx_subtable_type4_validate, /* 4 */ - gxv_morx_subtable_type5_validate, /* 5 */ - - }; - - GXV_Validate_Func func; - - FT_UShort i; - - - GXV_NAME_ENTER( "subtables in a chain" ); - - for ( i = 0; i < nSubtables; i++ ) - { - FT_ULong length; - FT_ULong coverage; - FT_ULong subFeatureFlags; - FT_UInt type; - FT_UInt rest; - - - GXV_LIMIT_CHECK( 4 + 4 + 4 ); - length = FT_NEXT_ULONG( p ); - coverage = FT_NEXT_ULONG( p ); - subFeatureFlags = FT_NEXT_ULONG( p ); - - GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n", - i + 1, nSubtables, length )); - - type = coverage & 0x0007; - rest = length - ( 4 + 4 + 4 ); - GXV_LIMIT_CHECK( rest ); - - /* morx coverage consists of mort_coverage & 16bit padding */ - gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ), - valid ); - if ( type > 5 ) - FT_INVALID_FORMAT; - - func = fmt_funcs_table[type]; - if ( func == NULL ) - GXV_TRACE(( "morx type %d is reserved\n", type )); - - func( p, p + rest, valid ); - - p += rest; - } - - valid->subtable_length = p - table; - - GXV_EXIT; - } - - - static void - gxv_morx_chain_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - FT_ULong defaultFlags; - FT_ULong chainLength; - FT_ULong nFeatureFlags; - FT_ULong nSubtables; - - - GXV_NAME_ENTER( "morx chain header" ); - - GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 ); - defaultFlags = FT_NEXT_ULONG( p ); - chainLength = FT_NEXT_ULONG( p ); - nFeatureFlags = FT_NEXT_ULONG( p ); - nSubtables = FT_NEXT_ULONG( p ); - - /* feature-array of morx is same with that of mort */ - gxv_mort_featurearray_validate( p, limit, nFeatureFlags, valid ); - p += valid->subtable_length; - - if ( nSubtables >= 0x10000 ) - FT_INVALID_DATA; - - gxv_morx_subtables_validate( p, table + chainLength, - (FT_UShort)nSubtables, valid ); - - valid->subtable_length = chainLength; - - GXV_EXIT; - } - - - FT_LOCAL_DEF( void ) - gxv_morx_validate( FT_Bytes table, - FT_Face face, - FT_Validator ftvalid ) - { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; - FT_Bytes p = table; - FT_Bytes limit = 0; - FT_ULong version; - FT_ULong nChains; - FT_ULong i; - - - valid->root = ftvalid; - valid->face = face; - - FT_TRACE3(( "validating `morx' table\n" )); - GXV_INIT; - - GXV_LIMIT_CHECK( 4 + 4 ); - version = FT_NEXT_ULONG( p ); - nChains = FT_NEXT_ULONG( p ); - - if ( version != 0x00020000UL ) - FT_INVALID_FORMAT; - - for ( i = 0; i < nChains; i++ ) - { - GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains )); - GXV_32BIT_ALIGNMENT_VALIDATE( p - table ); - gxv_morx_chain_validate( p, limit, valid ); - p += valid->subtable_length; - } - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmorx.c */ +/* */ +/* TrueTypeGX/AAT morx table validation (body). */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmorx.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmorx + + + static void + gxv_morx_subtables_validate( FT_Bytes table, + FT_Bytes limit, + FT_UShort nSubtables, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_Validate_Func fmt_funcs_table[] = + { + gxv_morx_subtable_type0_validate, /* 0 */ + gxv_morx_subtable_type1_validate, /* 1 */ + gxv_morx_subtable_type2_validate, /* 2 */ + NULL, /* 3 */ + gxv_morx_subtable_type4_validate, /* 4 */ + gxv_morx_subtable_type5_validate, /* 5 */ + + }; + + GXV_Validate_Func func; + + FT_UShort i; + + + GXV_NAME_ENTER( "subtables in a chain" ); + + for ( i = 0; i < nSubtables; i++ ) + { + FT_ULong length; + FT_ULong coverage; + FT_ULong subFeatureFlags; + FT_UInt type; + FT_UInt rest; + + + GXV_LIMIT_CHECK( 4 + 4 + 4 ); + length = FT_NEXT_ULONG( p ); + coverage = FT_NEXT_ULONG( p ); + subFeatureFlags = FT_NEXT_ULONG( p ); + + GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n", + i + 1, nSubtables, length )); + + type = coverage & 0x0007; + rest = length - ( 4 + 4 + 4 ); + GXV_LIMIT_CHECK( rest ); + + /* morx coverage consists of mort_coverage & 16bit padding */ + gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ), + valid ); + if ( type > 5 ) + FT_INVALID_FORMAT; + + func = fmt_funcs_table[type]; + if ( func == NULL ) + GXV_TRACE(( "morx type %d is reserved\n", type )); + + func( p, p + rest, valid ); + + p += rest; + } + + valid->subtable_length = p - table; + + GXV_EXIT; + } + + + static void + gxv_morx_chain_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + FT_ULong defaultFlags; + FT_ULong chainLength; + FT_ULong nFeatureFlags; + FT_ULong nSubtables; + + + GXV_NAME_ENTER( "morx chain header" ); + + GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 ); + defaultFlags = FT_NEXT_ULONG( p ); + chainLength = FT_NEXT_ULONG( p ); + nFeatureFlags = FT_NEXT_ULONG( p ); + nSubtables = FT_NEXT_ULONG( p ); + + /* feature-array of morx is same with that of mort */ + gxv_mort_featurearray_validate( p, limit, nFeatureFlags, valid ); + p += valid->subtable_length; + + if ( nSubtables >= 0x10000 ) + FT_INVALID_DATA; + + gxv_morx_subtables_validate( p, table + chainLength, + (FT_UShort)nSubtables, valid ); + + valid->subtable_length = chainLength; + + GXV_EXIT; + } + + + FT_LOCAL_DEF( void ) + gxv_morx_validate( FT_Bytes table, + FT_Face face, + FT_Validator ftvalid ) + { + GXV_ValidatorRec validrec; + GXV_Validator valid = &validrec; + FT_Bytes p = table; + FT_Bytes limit = 0; + FT_ULong version; + FT_ULong nChains; + FT_ULong i; + + + valid->root = ftvalid; + valid->face = face; + + FT_TRACE3(( "validating `morx' table\n" )); + GXV_INIT; + + GXV_LIMIT_CHECK( 4 + 4 ); + version = FT_NEXT_ULONG( p ); + nChains = FT_NEXT_ULONG( p ); + + if ( version != 0x00020000UL ) + FT_INVALID_FORMAT; + + for ( i = 0; i < nChains; i++ ) + { + GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains )); + GXV_32BIT_ALIGNMENT_VALIDATE( p - table ); + gxv_morx_chain_validate( p, limit, valid ); + p += valid->subtable_length; + } + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.h b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.h index 28c1a44f6fb..7d38fd731c2 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.h +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx.h @@ -1,67 +1,67 @@ -/***************************************************************************/ -/* */ -/* gxvmorx.h */ -/* */ -/* TrueTypeGX/AAT common definition for morx table (specification). */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#ifndef __GXVMORX_H__ -#define __GXVMORX_H__ - - -#include "gxvalid.h" -#include "gxvcommn.h" -#include "gxvmort.h" - -#include FT_SFNT_NAMES_H - - - FT_LOCAL( void ) - gxv_morx_subtable_type0_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_morx_subtable_type1_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_morx_subtable_type2_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_morx_subtable_type4_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - FT_LOCAL( void ) - gxv_morx_subtable_type5_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ); - - -#endif /* __GXVMORX_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmorx.h */ +/* */ +/* TrueTypeGX/AAT common definition for morx table (specification). */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#ifndef __GXVMORX_H__ +#define __GXVMORX_H__ + + +#include "gxvalid.h" +#include "gxvcommn.h" +#include "gxvmort.h" + +#include FT_SFNT_NAMES_H + + + FT_LOCAL( void ) + gxv_morx_subtable_type0_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_morx_subtable_type1_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_morx_subtable_type2_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_morx_subtable_type4_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + FT_LOCAL( void ) + gxv_morx_subtable_type5_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ); + + +#endif /* __GXVMORX_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx0.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx0.c index ca92b6c3925..072c7e5943a 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx0.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx0.c @@ -1,103 +1,103 @@ -/***************************************************************************/ -/* */ -/* gxvmorx0.c */ -/* */ -/* TrueTypeGX/AAT morx table validation */ -/* body for type0 (Indic Script Rearrangement) subtable. */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmorx.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmorx - - - static void - gxv_morx_subtable_type0_entry_validate( - FT_UShort state, - FT_UShort flags, - GXV_XStateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_UShort markFirst; - FT_UShort dontAdvance; - FT_UShort markLast; - FT_UShort reserved; - FT_UShort verb; - - FT_UNUSED( state ); - FT_UNUSED( glyphOffset ); - FT_UNUSED( table ); - FT_UNUSED( limit ); - - - markFirst = (FT_UShort)( ( flags >> 15 ) & 1 ); - dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); - markLast = (FT_UShort)( ( flags >> 13 ) & 1 ); - - reserved = (FT_UShort)( flags & 0x1FF0 ); - verb = (FT_UShort)( flags & 0x000F ); - - if ( 0 < reserved ) - { - GXV_TRACE(( " non-zero bits found in reserved range\n" )); - FT_INVALID_DATA; - } - } - - - FT_LOCAL_DEF( void ) - gxv_morx_subtable_type0_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - - GXV_NAME_ENTER( - "morx chain subtable type0 (Indic-Script Rearrangement)" ); - - GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE ); - - valid->xstatetable.optdata = NULL; - valid->xstatetable.optdata_load_func = NULL; - valid->xstatetable.subtable_setup_func = NULL; - valid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; - valid->xstatetable.entry_validate_func = - gxv_morx_subtable_type0_entry_validate; - - gxv_XStateTable_validate( p, limit, valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmorx0.c */ +/* */ +/* TrueTypeGX/AAT morx table validation */ +/* body for type0 (Indic Script Rearrangement) subtable. */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmorx.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmorx + + + static void + gxv_morx_subtable_type0_entry_validate( + FT_UShort state, + FT_UShort flags, + GXV_XStateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_UShort markFirst; + FT_UShort dontAdvance; + FT_UShort markLast; + FT_UShort reserved; + FT_UShort verb; + + FT_UNUSED( state ); + FT_UNUSED( glyphOffset ); + FT_UNUSED( table ); + FT_UNUSED( limit ); + + + markFirst = (FT_UShort)( ( flags >> 15 ) & 1 ); + dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); + markLast = (FT_UShort)( ( flags >> 13 ) & 1 ); + + reserved = (FT_UShort)( flags & 0x1FF0 ); + verb = (FT_UShort)( flags & 0x000F ); + + if ( 0 < reserved ) + { + GXV_TRACE(( " non-zero bits found in reserved range\n" )); + FT_INVALID_DATA; + } + } + + + FT_LOCAL_DEF( void ) + gxv_morx_subtable_type0_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + + GXV_NAME_ENTER( + "morx chain subtable type0 (Indic-Script Rearrangement)" ); + + GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE ); + + valid->xstatetable.optdata = NULL; + valid->xstatetable.optdata_load_func = NULL; + valid->xstatetable.subtable_setup_func = NULL; + valid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; + valid->xstatetable.entry_validate_func = + gxv_morx_subtable_type0_entry_validate; + + gxv_XStateTable_validate( p, limit, valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx1.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx1.c index 331d4ccdab3..162512e2a7d 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx1.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx1.c @@ -1,274 +1,274 @@ -/***************************************************************************/ -/* */ -/* gxvmorx1.c */ -/* */ -/* TrueTypeGX/AAT morx table validation */ -/* body for type1 (Contextual Substitution) subtable. */ -/* */ -/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmorx.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmorx - - - typedef struct GXV_morx_subtable_type1_StateOptRec_ - { - FT_ULong substitutionTable; - FT_ULong substitutionTable_length; - FT_UShort substitutionTable_num_lookupTables; - - } GXV_morx_subtable_type1_StateOptRec, - *GXV_morx_subtable_type1_StateOptRecData; - - -#define GXV_MORX_SUBTABLE_TYPE1_HEADER_SIZE \ - ( GXV_STATETABLE_HEADER_SIZE + 2 ) - - - static void - gxv_morx_subtable_type1_substitutionTable_load( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; - - - GXV_LIMIT_CHECK( 2 ); - optdata->substitutionTable = FT_NEXT_USHORT( p ); - } - - - static void - gxv_morx_subtable_type1_subtable_setup( FT_ULong table_size, - FT_ULong classTable, - FT_ULong stateArray, - FT_ULong entryTable, - FT_ULong* classTable_length_p, - FT_ULong* stateArray_length_p, - FT_ULong* entryTable_length_p, - GXV_Validator valid ) - { - FT_ULong o[4]; - FT_ULong *l[4]; - FT_ULong buff[5]; - - GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; - - - o[0] = classTable; - o[1] = stateArray; - o[2] = entryTable; - o[3] = optdata->substitutionTable; - l[0] = classTable_length_p; - l[1] = stateArray_length_p; - l[2] = entryTable_length_p; - l[3] = &(optdata->substitutionTable_length); - - gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid ); - } - - - static void - gxv_morx_subtable_type1_entry_validate( - FT_UShort state, - FT_UShort flags, - GXV_StateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_UShort setMark; - FT_UShort dontAdvance; - FT_UShort reserved; - FT_Short markIndex; - FT_Short currentIndex; - - GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; - - FT_UNUSED( state ); - FT_UNUSED( table ); - FT_UNUSED( limit ); - - - setMark = (FT_UShort)( ( flags >> 15 ) & 1 ); - dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); - - reserved = (FT_UShort)( flags & 0x3FFF ); - - markIndex = (FT_Short)( glyphOffset.ul >> 16 ); - currentIndex = (FT_Short)( glyphOffset.ul ); - - GXV_TRACE(( " setMark=%01d dontAdvance=%01d\n", - setMark, dontAdvance )); - - if ( 0 < reserved ) - { - GXV_TRACE(( " non-zero bits found in reserved range\n" )); - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_DATA; - } - - GXV_TRACE(( "markIndex = %d, currentIndex = %d\n", - markIndex, currentIndex )); - - if ( optdata->substitutionTable_num_lookupTables < markIndex + 1 ) - optdata->substitutionTable_num_lookupTables = - (FT_Short)( markIndex + 1 ); - - if ( optdata->substitutionTable_num_lookupTables < currentIndex + 1 ) - optdata->substitutionTable_num_lookupTables = - (FT_Short)( currentIndex + 1 ); - } - - - static void - gxv_morx_subtable_type1_LookupValue_validate( FT_UShort glyph, - GXV_LookupValueDesc value, - GXV_Validator valid ) - { - FT_UNUSED( glyph ); /* for the non-debugging case */ - - GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value.u )); - - if ( value.u > valid->face->num_glyphs ) - FT_INVALID_GLYPH_ID; - } - - - static GXV_LookupValueDesc - gxv_morx_subtable_type1_LookupFmt4_transit( - FT_UShort relative_gindex, - GXV_LookupValueDesc base_value, - FT_Bytes lookuptbl_limit, - GXV_Validator valid ) - { - FT_Bytes p; - FT_Bytes limit; - FT_UShort offset; - GXV_LookupValueDesc value; - - /* XXX: check range? */ - offset = (FT_UShort)( base_value.u + - relative_gindex * sizeof ( FT_UShort ) ); - - p = valid->lookuptbl_head + offset; - limit = lookuptbl_limit; - - GXV_LIMIT_CHECK ( 2 ); - value.u = FT_NEXT_USHORT( p ); - - return value; - } - - - /* - * TODO: length should be limit? - **/ - static void - gxv_morx_subtable_type1_substitutionTable_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - FT_UShort i; - - GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; - - - /* TODO: calculate offset/length for each lookupTables */ - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_morx_subtable_type1_LookupValue_validate; - valid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit; - - for ( i = 0; i < optdata->substitutionTable_num_lookupTables; i++ ) - { - FT_ULong offset; - - - GXV_LIMIT_CHECK( 4 ); - offset = FT_NEXT_ULONG( p ); - - gxv_LookupTable_validate( table + offset, limit, valid ); - } - - /* TODO: overlapping of lookupTables in substitutionTable */ - } - - - /* - * subtable for Contextual glyph substitution is a modified StateTable. - * In addition to classTable, stateArray, entryTable, the field - * `substitutionTable' is added. - */ - FT_LOCAL_DEF( void ) - gxv_morx_subtable_type1_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_morx_subtable_type1_StateOptRec st_rec; - - - GXV_NAME_ENTER( "morx chain subtable type1 (Contextual Glyph Subst)" ); - - GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE1_HEADER_SIZE ); - - st_rec.substitutionTable_num_lookupTables = 0; - - valid->xstatetable.optdata = - &st_rec; - valid->xstatetable.optdata_load_func = - gxv_morx_subtable_type1_substitutionTable_load; - valid->xstatetable.subtable_setup_func = - gxv_morx_subtable_type1_subtable_setup; - valid->xstatetable.entry_glyphoffset_fmt = - GXV_GLYPHOFFSET_ULONG; - valid->xstatetable.entry_validate_func = - gxv_morx_subtable_type1_entry_validate; - - gxv_XStateTable_validate( p, limit, valid ); - - gxv_morx_subtable_type1_substitutionTable_validate( - table + st_rec.substitutionTable, - table + st_rec.substitutionTable + st_rec.substitutionTable_length, - valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmorx1.c */ +/* */ +/* TrueTypeGX/AAT morx table validation */ +/* body for type1 (Contextual Substitution) subtable. */ +/* */ +/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmorx.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmorx + + + typedef struct GXV_morx_subtable_type1_StateOptRec_ + { + FT_ULong substitutionTable; + FT_ULong substitutionTable_length; + FT_UShort substitutionTable_num_lookupTables; + + } GXV_morx_subtable_type1_StateOptRec, + *GXV_morx_subtable_type1_StateOptRecData; + + +#define GXV_MORX_SUBTABLE_TYPE1_HEADER_SIZE \ + ( GXV_STATETABLE_HEADER_SIZE + 2 ) + + + static void + gxv_morx_subtable_type1_substitutionTable_load( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_morx_subtable_type1_StateOptRecData optdata = + (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + + + GXV_LIMIT_CHECK( 2 ); + optdata->substitutionTable = FT_NEXT_USHORT( p ); + } + + + static void + gxv_morx_subtable_type1_subtable_setup( FT_ULong table_size, + FT_ULong classTable, + FT_ULong stateArray, + FT_ULong entryTable, + FT_ULong* classTable_length_p, + FT_ULong* stateArray_length_p, + FT_ULong* entryTable_length_p, + GXV_Validator valid ) + { + FT_ULong o[4]; + FT_ULong *l[4]; + FT_ULong buff[5]; + + GXV_morx_subtable_type1_StateOptRecData optdata = + (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + + + o[0] = classTable; + o[1] = stateArray; + o[2] = entryTable; + o[3] = optdata->substitutionTable; + l[0] = classTable_length_p; + l[1] = stateArray_length_p; + l[2] = entryTable_length_p; + l[3] = &(optdata->substitutionTable_length); + + gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid ); + } + + + static void + gxv_morx_subtable_type1_entry_validate( + FT_UShort state, + FT_UShort flags, + GXV_StateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_UShort setMark; + FT_UShort dontAdvance; + FT_UShort reserved; + FT_Short markIndex; + FT_Short currentIndex; + + GXV_morx_subtable_type1_StateOptRecData optdata = + (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + + FT_UNUSED( state ); + FT_UNUSED( table ); + FT_UNUSED( limit ); + + + setMark = (FT_UShort)( ( flags >> 15 ) & 1 ); + dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); + + reserved = (FT_UShort)( flags & 0x3FFF ); + + markIndex = (FT_Short)( glyphOffset.ul >> 16 ); + currentIndex = (FT_Short)( glyphOffset.ul ); + + GXV_TRACE(( " setMark=%01d dontAdvance=%01d\n", + setMark, dontAdvance )); + + if ( 0 < reserved ) + { + GXV_TRACE(( " non-zero bits found in reserved range\n" )); + if ( valid->root->level >= FT_VALIDATE_PARANOID ) + FT_INVALID_DATA; + } + + GXV_TRACE(( "markIndex = %d, currentIndex = %d\n", + markIndex, currentIndex )); + + if ( optdata->substitutionTable_num_lookupTables < markIndex + 1 ) + optdata->substitutionTable_num_lookupTables = + (FT_Short)( markIndex + 1 ); + + if ( optdata->substitutionTable_num_lookupTables < currentIndex + 1 ) + optdata->substitutionTable_num_lookupTables = + (FT_Short)( currentIndex + 1 ); + } + + + static void + gxv_morx_subtable_type1_LookupValue_validate( FT_UShort glyph, + GXV_LookupValueDesc value, + GXV_Validator valid ) + { + FT_UNUSED( glyph ); /* for the non-debugging case */ + + GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value.u )); + + if ( value.u > valid->face->num_glyphs ) + FT_INVALID_GLYPH_ID; + } + + + static GXV_LookupValueDesc + gxv_morx_subtable_type1_LookupFmt4_transit( + FT_UShort relative_gindex, + GXV_LookupValueDesc base_value, + FT_Bytes lookuptbl_limit, + GXV_Validator valid ) + { + FT_Bytes p; + FT_Bytes limit; + FT_UShort offset; + GXV_LookupValueDesc value; + + /* XXX: check range? */ + offset = (FT_UShort)( base_value.u + + relative_gindex * sizeof ( FT_UShort ) ); + + p = valid->lookuptbl_head + offset; + limit = lookuptbl_limit; + + GXV_LIMIT_CHECK ( 2 ); + value.u = FT_NEXT_USHORT( p ); + + return value; + } + + + /* + * TODO: length should be limit? + **/ + static void + gxv_morx_subtable_type1_substitutionTable_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + FT_UShort i; + + GXV_morx_subtable_type1_StateOptRecData optdata = + (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + + + /* TODO: calculate offset/length for each lookupTables */ + valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + valid->lookupval_func = gxv_morx_subtable_type1_LookupValue_validate; + valid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit; + + for ( i = 0; i < optdata->substitutionTable_num_lookupTables; i++ ) + { + FT_ULong offset; + + + GXV_LIMIT_CHECK( 4 ); + offset = FT_NEXT_ULONG( p ); + + gxv_LookupTable_validate( table + offset, limit, valid ); + } + + /* TODO: overlapping of lookupTables in substitutionTable */ + } + + + /* + * subtable for Contextual glyph substitution is a modified StateTable. + * In addition to classTable, stateArray, entryTable, the field + * `substitutionTable' is added. + */ + FT_LOCAL_DEF( void ) + gxv_morx_subtable_type1_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_morx_subtable_type1_StateOptRec st_rec; + + + GXV_NAME_ENTER( "morx chain subtable type1 (Contextual Glyph Subst)" ); + + GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE1_HEADER_SIZE ); + + st_rec.substitutionTable_num_lookupTables = 0; + + valid->xstatetable.optdata = + &st_rec; + valid->xstatetable.optdata_load_func = + gxv_morx_subtable_type1_substitutionTable_load; + valid->xstatetable.subtable_setup_func = + gxv_morx_subtable_type1_subtable_setup; + valid->xstatetable.entry_glyphoffset_fmt = + GXV_GLYPHOFFSET_ULONG; + valid->xstatetable.entry_validate_func = + gxv_morx_subtable_type1_entry_validate; + + gxv_XStateTable_validate( p, limit, valid ); + + gxv_morx_subtable_type1_substitutionTable_validate( + table + st_rec.substitutionTable, + table + st_rec.substitutionTable + st_rec.substitutionTable_length, + valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx2.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx2.c index 5cad5169c21..4f2801eb02d 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx2.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx2.c @@ -1,285 +1,285 @@ -/***************************************************************************/ -/* */ -/* gxvmorx2.c */ -/* */ -/* TrueTypeGX/AAT morx table validation */ -/* body for type2 (Ligature Substitution) subtable. */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmorx.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmorx - - - typedef struct GXV_morx_subtable_type2_StateOptRec_ - { - FT_ULong ligActionTable; - FT_ULong componentTable; - FT_ULong ligatureTable; - FT_ULong ligActionTable_length; - FT_ULong componentTable_length; - FT_ULong ligatureTable_length; - - } GXV_morx_subtable_type2_StateOptRec, - *GXV_morx_subtable_type2_StateOptRecData; - - -#define GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE \ - ( GXV_XSTATETABLE_HEADER_SIZE + 4 + 4 + 4 ) - - - static void - gxv_morx_subtable_type2_opttable_load( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; - - - GXV_LIMIT_CHECK( 4 + 4 + 4 ); - optdata->ligActionTable = FT_NEXT_ULONG( p ); - optdata->componentTable = FT_NEXT_ULONG( p ); - optdata->ligatureTable = FT_NEXT_ULONG( p ); - - GXV_TRACE(( "offset to ligActionTable=0x%08x\n", - optdata->ligActionTable )); - GXV_TRACE(( "offset to componentTable=0x%08x\n", - optdata->componentTable )); - GXV_TRACE(( "offset to ligatureTable=0x%08x\n", - optdata->ligatureTable )); - } - - - static void - gxv_morx_subtable_type2_subtable_setup( FT_ULong table_size, - FT_ULong classTable, - FT_ULong stateArray, - FT_ULong entryTable, - FT_ULong* classTable_length_p, - FT_ULong* stateArray_length_p, - FT_ULong* entryTable_length_p, - GXV_Validator valid ) - { - FT_ULong o[6]; - FT_ULong* l[6]; - FT_ULong buff[7]; - - GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; - - - GXV_NAME_ENTER( "subtable boundaries setup" ); - - o[0] = classTable; - o[1] = stateArray; - o[2] = entryTable; - o[3] = optdata->ligActionTable; - o[4] = optdata->componentTable; - o[5] = optdata->ligatureTable; - l[0] = classTable_length_p; - l[1] = stateArray_length_p; - l[2] = entryTable_length_p; - l[3] = &(optdata->ligActionTable_length); - l[4] = &(optdata->componentTable_length); - l[5] = &(optdata->ligatureTable_length); - - gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, valid ); - - GXV_TRACE(( "classTable: offset=0x%08x length=0x%08x\n", - classTable, *classTable_length_p )); - GXV_TRACE(( "stateArray: offset=0x%08x length=0x%08x\n", - stateArray, *stateArray_length_p )); - GXV_TRACE(( "entryTable: offset=0x%08x length=0x%08x\n", - entryTable, *entryTable_length_p )); - GXV_TRACE(( "ligActionTable: offset=0x%08x length=0x%08x\n", - optdata->ligActionTable, - optdata->ligActionTable_length )); - GXV_TRACE(( "componentTable: offset=0x%08x length=0x%08x\n", - optdata->componentTable, - optdata->componentTable_length )); - GXV_TRACE(( "ligatureTable: offset=0x%08x length=0x%08x\n", - optdata->ligatureTable, - optdata->ligatureTable_length )); - - GXV_EXIT; - } - - -#define GXV_MORX_LIGACTION_ENTRY_SIZE 4 - - - static void - gxv_morx_subtable_type2_ligActionIndex_validate( - FT_Bytes table, - FT_UShort ligActionIndex, - GXV_Validator valid ) - { - /* access ligActionTable */ - GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; - - FT_Bytes lat_base = table + optdata->ligActionTable; - FT_Bytes p = lat_base + - ligActionIndex * GXV_MORX_LIGACTION_ENTRY_SIZE; - FT_Bytes lat_limit = lat_base + optdata->ligActionTable; - - - if ( p < lat_base ) - { - GXV_TRACE(( "p < lat_base (%d byte rewind)\n", lat_base - p )); - FT_INVALID_OFFSET; - } - else if ( lat_limit < p ) - { - GXV_TRACE(( "lat_limit < p (%d byte overrun)\n", p - lat_limit )); - FT_INVALID_OFFSET; - } - - { - /* validate entry in ligActionTable */ - FT_ULong lig_action; - FT_UShort last; - FT_UShort store; - FT_ULong offset; - - - lig_action = FT_NEXT_ULONG( p ); - last = (FT_UShort)( ( lig_action >> 31 ) & 1 ); - store = (FT_UShort)( ( lig_action >> 30 ) & 1 ); - - offset = lig_action & 0x3FFFFFFFUL; - } - } - - - static void - gxv_morx_subtable_type2_entry_validate( - FT_UShort state, - FT_UShort flags, - GXV_StateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_UShort setComponent; - FT_UShort dontAdvance; - FT_UShort performAction; - FT_UShort reserved; - FT_UShort ligActionIndex; - - FT_UNUSED( state ); - FT_UNUSED( limit ); - - - setComponent = (FT_UShort)( ( flags >> 15 ) & 1 ); - dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); - performAction = (FT_UShort)( ( flags >> 13 ) & 1 ); - - reserved = (FT_UShort)( flags & 0x1FFF ); - ligActionIndex = glyphOffset.u; - - if ( reserved > 0 ) - GXV_TRACE(( " reserved 14bit is non-zero\n" )); - - if ( 0 < ligActionIndex ) - gxv_morx_subtable_type2_ligActionIndex_validate( - table, ligActionIndex, valid ); - } - - - static void - gxv_morx_subtable_type2_ligatureTable_validate( FT_Bytes table, - GXV_Validator valid ) - { - GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; - - FT_Bytes p = table + optdata->ligatureTable; - FT_Bytes limit = table + optdata->ligatureTable - + optdata->ligatureTable_length; - - - GXV_NAME_ENTER( "morx chain subtable type2 - substitutionTable" ); - - if ( 0 != optdata->ligatureTable ) - { - /* Apple does not give specification of ligatureTable format */ - while ( p < limit ) - { - FT_UShort lig_gid; - - - GXV_LIMIT_CHECK( 2 ); - lig_gid = FT_NEXT_USHORT( p ); - } - } - - GXV_EXIT; - } - - - FT_LOCAL_DEF( void ) - gxv_morx_subtable_type2_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_morx_subtable_type2_StateOptRec lig_rec; - - - GXV_NAME_ENTER( "morx chain subtable type2 (Ligature Substitution)" ); - - GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE ); - - valid->xstatetable.optdata = - &lig_rec; - valid->xstatetable.optdata_load_func = - gxv_morx_subtable_type2_opttable_load; - valid->xstatetable.subtable_setup_func = - gxv_morx_subtable_type2_subtable_setup; - valid->xstatetable.entry_glyphoffset_fmt = - GXV_GLYPHOFFSET_USHORT; - valid->xstatetable.entry_validate_func = - gxv_morx_subtable_type2_entry_validate; - - gxv_XStateTable_validate( p, limit, valid ); - - p += valid->subtable_length; - gxv_morx_subtable_type2_ligatureTable_validate( table, valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmorx2.c */ +/* */ +/* TrueTypeGX/AAT morx table validation */ +/* body for type2 (Ligature Substitution) subtable. */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmorx.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmorx + + + typedef struct GXV_morx_subtable_type2_StateOptRec_ + { + FT_ULong ligActionTable; + FT_ULong componentTable; + FT_ULong ligatureTable; + FT_ULong ligActionTable_length; + FT_ULong componentTable_length; + FT_ULong ligatureTable_length; + + } GXV_morx_subtable_type2_StateOptRec, + *GXV_morx_subtable_type2_StateOptRecData; + + +#define GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE \ + ( GXV_XSTATETABLE_HEADER_SIZE + 4 + 4 + 4 ) + + + static void + gxv_morx_subtable_type2_opttable_load( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_morx_subtable_type2_StateOptRecData optdata = + (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + + + GXV_LIMIT_CHECK( 4 + 4 + 4 ); + optdata->ligActionTable = FT_NEXT_ULONG( p ); + optdata->componentTable = FT_NEXT_ULONG( p ); + optdata->ligatureTable = FT_NEXT_ULONG( p ); + + GXV_TRACE(( "offset to ligActionTable=0x%08x\n", + optdata->ligActionTable )); + GXV_TRACE(( "offset to componentTable=0x%08x\n", + optdata->componentTable )); + GXV_TRACE(( "offset to ligatureTable=0x%08x\n", + optdata->ligatureTable )); + } + + + static void + gxv_morx_subtable_type2_subtable_setup( FT_ULong table_size, + FT_ULong classTable, + FT_ULong stateArray, + FT_ULong entryTable, + FT_ULong* classTable_length_p, + FT_ULong* stateArray_length_p, + FT_ULong* entryTable_length_p, + GXV_Validator valid ) + { + FT_ULong o[6]; + FT_ULong* l[6]; + FT_ULong buff[7]; + + GXV_morx_subtable_type2_StateOptRecData optdata = + (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + + + GXV_NAME_ENTER( "subtable boundaries setup" ); + + o[0] = classTable; + o[1] = stateArray; + o[2] = entryTable; + o[3] = optdata->ligActionTable; + o[4] = optdata->componentTable; + o[5] = optdata->ligatureTable; + l[0] = classTable_length_p; + l[1] = stateArray_length_p; + l[2] = entryTable_length_p; + l[3] = &(optdata->ligActionTable_length); + l[4] = &(optdata->componentTable_length); + l[5] = &(optdata->ligatureTable_length); + + gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, valid ); + + GXV_TRACE(( "classTable: offset=0x%08x length=0x%08x\n", + classTable, *classTable_length_p )); + GXV_TRACE(( "stateArray: offset=0x%08x length=0x%08x\n", + stateArray, *stateArray_length_p )); + GXV_TRACE(( "entryTable: offset=0x%08x length=0x%08x\n", + entryTable, *entryTable_length_p )); + GXV_TRACE(( "ligActionTable: offset=0x%08x length=0x%08x\n", + optdata->ligActionTable, + optdata->ligActionTable_length )); + GXV_TRACE(( "componentTable: offset=0x%08x length=0x%08x\n", + optdata->componentTable, + optdata->componentTable_length )); + GXV_TRACE(( "ligatureTable: offset=0x%08x length=0x%08x\n", + optdata->ligatureTable, + optdata->ligatureTable_length )); + + GXV_EXIT; + } + + +#define GXV_MORX_LIGACTION_ENTRY_SIZE 4 + + + static void + gxv_morx_subtable_type2_ligActionIndex_validate( + FT_Bytes table, + FT_UShort ligActionIndex, + GXV_Validator valid ) + { + /* access ligActionTable */ + GXV_morx_subtable_type2_StateOptRecData optdata = + (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + + FT_Bytes lat_base = table + optdata->ligActionTable; + FT_Bytes p = lat_base + + ligActionIndex * GXV_MORX_LIGACTION_ENTRY_SIZE; + FT_Bytes lat_limit = lat_base + optdata->ligActionTable; + + + if ( p < lat_base ) + { + GXV_TRACE(( "p < lat_base (%d byte rewind)\n", lat_base - p )); + FT_INVALID_OFFSET; + } + else if ( lat_limit < p ) + { + GXV_TRACE(( "lat_limit < p (%d byte overrun)\n", p - lat_limit )); + FT_INVALID_OFFSET; + } + + { + /* validate entry in ligActionTable */ + FT_ULong lig_action; + FT_UShort last; + FT_UShort store; + FT_ULong offset; + + + lig_action = FT_NEXT_ULONG( p ); + last = (FT_UShort)( ( lig_action >> 31 ) & 1 ); + store = (FT_UShort)( ( lig_action >> 30 ) & 1 ); + + offset = lig_action & 0x3FFFFFFFUL; + } + } + + + static void + gxv_morx_subtable_type2_entry_validate( + FT_UShort state, + FT_UShort flags, + GXV_StateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_UShort setComponent; + FT_UShort dontAdvance; + FT_UShort performAction; + FT_UShort reserved; + FT_UShort ligActionIndex; + + FT_UNUSED( state ); + FT_UNUSED( limit ); + + + setComponent = (FT_UShort)( ( flags >> 15 ) & 1 ); + dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 ); + performAction = (FT_UShort)( ( flags >> 13 ) & 1 ); + + reserved = (FT_UShort)( flags & 0x1FFF ); + ligActionIndex = glyphOffset.u; + + if ( reserved > 0 ) + GXV_TRACE(( " reserved 14bit is non-zero\n" )); + + if ( 0 < ligActionIndex ) + gxv_morx_subtable_type2_ligActionIndex_validate( + table, ligActionIndex, valid ); + } + + + static void + gxv_morx_subtable_type2_ligatureTable_validate( FT_Bytes table, + GXV_Validator valid ) + { + GXV_morx_subtable_type2_StateOptRecData optdata = + (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + + FT_Bytes p = table + optdata->ligatureTable; + FT_Bytes limit = table + optdata->ligatureTable + + optdata->ligatureTable_length; + + + GXV_NAME_ENTER( "morx chain subtable type2 - substitutionTable" ); + + if ( 0 != optdata->ligatureTable ) + { + /* Apple does not give specification of ligatureTable format */ + while ( p < limit ) + { + FT_UShort lig_gid; + + + GXV_LIMIT_CHECK( 2 ); + lig_gid = FT_NEXT_USHORT( p ); + } + } + + GXV_EXIT; + } + + + FT_LOCAL_DEF( void ) + gxv_morx_subtable_type2_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_morx_subtable_type2_StateOptRec lig_rec; + + + GXV_NAME_ENTER( "morx chain subtable type2 (Ligature Substitution)" ); + + GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE ); + + valid->xstatetable.optdata = + &lig_rec; + valid->xstatetable.optdata_load_func = + gxv_morx_subtable_type2_opttable_load; + valid->xstatetable.subtable_setup_func = + gxv_morx_subtable_type2_subtable_setup; + valid->xstatetable.entry_glyphoffset_fmt = + GXV_GLYPHOFFSET_USHORT; + valid->xstatetable.entry_validate_func = + gxv_morx_subtable_type2_entry_validate; + + gxv_XStateTable_validate( p, limit, valid ); + + p += valid->subtable_length; + gxv_morx_subtable_type2_ligatureTable_validate( table, valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx4.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx4.c index c0d2f78e397..adf33405833 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx4.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx4.c @@ -1,55 +1,55 @@ -/***************************************************************************/ -/* */ -/* gxvmorx4.c */ -/* */ -/* TrueTypeGX/AAT morx table validation */ -/* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. */ -/* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmorx.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmorx - - - FT_LOCAL_DEF( void ) - gxv_morx_subtable_type4_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - GXV_NAME_ENTER( "morx chain subtable type4 " - "(Non-Contextual Glyph Substitution)" ); - - gxv_mort_subtable_type4_validate( table, limit, valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmorx4.c */ +/* */ +/* TrueTypeGX/AAT morx table validation */ +/* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. */ +/* */ +/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmorx.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmorx + + + FT_LOCAL_DEF( void ) + gxv_morx_subtable_type4_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + GXV_NAME_ENTER( "morx chain subtable type4 " + "(Non-Contextual Glyph Substitution)" ); + + gxv_mort_subtable_type4_validate( table, limit, valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx5.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx5.c index d9115618c09..41e1879305e 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx5.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvmorx5.c @@ -1,217 +1,217 @@ -/***************************************************************************/ -/* */ -/* gxvmorx5.c */ -/* */ -/* TrueTypeGX/AAT morx table validation */ -/* body for type5 (Contextual Glyph Insertion) subtable. */ -/* */ -/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvmorx.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvmorx - - - /* - * `morx' subtable type5 (Contextual Glyph Insertion) - * has format of a StateTable with insertion-glyph-list - * without name. However, the 32bit offset from the head - * of subtable to the i-g-l is given after `entryTable', - * without variable name specification (the existence of - * this offset to the table is different from mort type5). - */ - - - typedef struct GXV_morx_subtable_type5_StateOptRec_ - { - FT_ULong insertionGlyphList; - FT_ULong insertionGlyphList_length; - - } GXV_morx_subtable_type5_StateOptRec, - *GXV_morx_subtable_type5_StateOptRecData; - - -#define GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE \ - ( GXV_STATETABLE_HEADER_SIZE + 4 ) - - - static void - gxv_morx_subtable_type5_insertionGlyphList_load( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_morx_subtable_type5_StateOptRecData optdata = - (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata; - - - GXV_LIMIT_CHECK( 4 ); - optdata->insertionGlyphList = FT_NEXT_ULONG( p ); - } - - - static void - gxv_morx_subtable_type5_subtable_setup( FT_ULong table_size, - FT_ULong classTable, - FT_ULong stateArray, - FT_ULong entryTable, - FT_ULong* classTable_length_p, - FT_ULong* stateArray_length_p, - FT_ULong* entryTable_length_p, - GXV_Validator valid ) - { - FT_ULong o[4]; - FT_ULong* l[4]; - FT_ULong buff[5]; - - GXV_morx_subtable_type5_StateOptRecData optdata = - (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata; - - - o[0] = classTable; - o[1] = stateArray; - o[2] = entryTable; - o[3] = optdata->insertionGlyphList; - l[0] = classTable_length_p; - l[1] = stateArray_length_p; - l[2] = entryTable_length_p; - l[3] = &(optdata->insertionGlyphList_length); - - gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid ); - } - - - static void - gxv_morx_subtable_type5_InsertList_validate( FT_UShort table_index, - FT_UShort count, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table + table_index * 2; - - - while ( p < table + count * 2 + table_index * 2 ) - { - FT_UShort insert_glyphID; - - - GXV_LIMIT_CHECK( 2 ); - insert_glyphID = FT_NEXT_USHORT( p ); - GXV_TRACE(( " 0x%04x", insert_glyphID )); - } - - GXV_TRACE(( "\n" )); - } - - - static void - gxv_morx_subtable_type5_entry_validate( - FT_UShort state, - FT_UShort flags, - GXV_StateTable_GlyphOffsetDesc glyphOffset, - FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bool setMark; - FT_Bool dontAdvance; - FT_Bool currentIsKashidaLike; - FT_Bool markedIsKashidaLike; - FT_Bool currentInsertBefore; - FT_Bool markedInsertBefore; - FT_Byte currentInsertCount; - FT_Byte markedInsertCount; - FT_Byte currentInsertList; - FT_UShort markedInsertList; - - FT_UNUSED( state ); - - - setMark = FT_BOOL( ( flags >> 15 ) & 1 ); - dontAdvance = FT_BOOL( ( flags >> 14 ) & 1 ); - currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 ); - markedIsKashidaLike = FT_BOOL( ( flags >> 12 ) & 1 ); - currentInsertBefore = FT_BOOL( ( flags >> 11 ) & 1 ); - markedInsertBefore = FT_BOOL( ( flags >> 10 ) & 1 ); - - currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F ); - markedInsertCount = (FT_Byte)( flags & 0x001F ); - - currentInsertList = (FT_Byte) ( glyphOffset.ul >> 16 ); - markedInsertList = (FT_UShort)( glyphOffset.ul ); - - if ( currentInsertList && 0 != currentInsertCount ) - gxv_morx_subtable_type5_InsertList_validate( currentInsertList, - currentInsertCount, - table, limit, - valid ); - - if ( markedInsertList && 0 != markedInsertCount ) - gxv_morx_subtable_type5_InsertList_validate( markedInsertList, - markedInsertCount, - table, limit, - valid ); - } - - - FT_LOCAL_DEF( void ) - gxv_morx_subtable_type5_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - - GXV_morx_subtable_type5_StateOptRec et_rec; - GXV_morx_subtable_type5_StateOptRecData et = &et_rec; - - - GXV_NAME_ENTER( "morx chain subtable type5 (Glyph Insertion)" ); - - GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE ); - - valid->xstatetable.optdata = - et; - valid->xstatetable.optdata_load_func = - gxv_morx_subtable_type5_insertionGlyphList_load; - valid->xstatetable.subtable_setup_func = - gxv_morx_subtable_type5_subtable_setup; - valid->xstatetable.entry_glyphoffset_fmt = - GXV_GLYPHOFFSET_ULONG; - valid->xstatetable.entry_validate_func = - gxv_morx_subtable_type5_entry_validate; - - gxv_XStateTable_validate( p, limit, valid ); - - GXV_EXIT; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvmorx5.c */ +/* */ +/* TrueTypeGX/AAT morx table validation */ +/* body for type5 (Contextual Glyph Insertion) subtable. */ +/* */ +/* Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvmorx.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvmorx + + + /* + * `morx' subtable type5 (Contextual Glyph Insertion) + * has format of a StateTable with insertion-glyph-list + * without name. However, the 32bit offset from the head + * of subtable to the i-g-l is given after `entryTable', + * without variable name specification (the existence of + * this offset to the table is different from mort type5). + */ + + + typedef struct GXV_morx_subtable_type5_StateOptRec_ + { + FT_ULong insertionGlyphList; + FT_ULong insertionGlyphList_length; + + } GXV_morx_subtable_type5_StateOptRec, + *GXV_morx_subtable_type5_StateOptRecData; + + +#define GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE \ + ( GXV_STATETABLE_HEADER_SIZE + 4 ) + + + static void + gxv_morx_subtable_type5_insertionGlyphList_load( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_morx_subtable_type5_StateOptRecData optdata = + (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata; + + + GXV_LIMIT_CHECK( 4 ); + optdata->insertionGlyphList = FT_NEXT_ULONG( p ); + } + + + static void + gxv_morx_subtable_type5_subtable_setup( FT_ULong table_size, + FT_ULong classTable, + FT_ULong stateArray, + FT_ULong entryTable, + FT_ULong* classTable_length_p, + FT_ULong* stateArray_length_p, + FT_ULong* entryTable_length_p, + GXV_Validator valid ) + { + FT_ULong o[4]; + FT_ULong* l[4]; + FT_ULong buff[5]; + + GXV_morx_subtable_type5_StateOptRecData optdata = + (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata; + + + o[0] = classTable; + o[1] = stateArray; + o[2] = entryTable; + o[3] = optdata->insertionGlyphList; + l[0] = classTable_length_p; + l[1] = stateArray_length_p; + l[2] = entryTable_length_p; + l[3] = &(optdata->insertionGlyphList_length); + + gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid ); + } + + + static void + gxv_morx_subtable_type5_InsertList_validate( FT_UShort table_index, + FT_UShort count, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table + table_index * 2; + + + while ( p < table + count * 2 + table_index * 2 ) + { + FT_UShort insert_glyphID; + + + GXV_LIMIT_CHECK( 2 ); + insert_glyphID = FT_NEXT_USHORT( p ); + GXV_TRACE(( " 0x%04x", insert_glyphID )); + } + + GXV_TRACE(( "\n" )); + } + + + static void + gxv_morx_subtable_type5_entry_validate( + FT_UShort state, + FT_UShort flags, + GXV_StateTable_GlyphOffsetDesc glyphOffset, + FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bool setMark; + FT_Bool dontAdvance; + FT_Bool currentIsKashidaLike; + FT_Bool markedIsKashidaLike; + FT_Bool currentInsertBefore; + FT_Bool markedInsertBefore; + FT_Byte currentInsertCount; + FT_Byte markedInsertCount; + FT_Byte currentInsertList; + FT_UShort markedInsertList; + + FT_UNUSED( state ); + + + setMark = FT_BOOL( ( flags >> 15 ) & 1 ); + dontAdvance = FT_BOOL( ( flags >> 14 ) & 1 ); + currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 ); + markedIsKashidaLike = FT_BOOL( ( flags >> 12 ) & 1 ); + currentInsertBefore = FT_BOOL( ( flags >> 11 ) & 1 ); + markedInsertBefore = FT_BOOL( ( flags >> 10 ) & 1 ); + + currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F ); + markedInsertCount = (FT_Byte)( flags & 0x001F ); + + currentInsertList = (FT_Byte) ( glyphOffset.ul >> 16 ); + markedInsertList = (FT_UShort)( glyphOffset.ul ); + + if ( currentInsertList && 0 != currentInsertCount ) + gxv_morx_subtable_type5_InsertList_validate( currentInsertList, + currentInsertCount, + table, limit, + valid ); + + if ( markedInsertList && 0 != markedInsertCount ) + gxv_morx_subtable_type5_InsertList_validate( markedInsertList, + markedInsertCount, + table, limit, + valid ); + } + + + FT_LOCAL_DEF( void ) + gxv_morx_subtable_type5_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + + GXV_morx_subtable_type5_StateOptRec et_rec; + GXV_morx_subtable_type5_StateOptRecData et = &et_rec; + + + GXV_NAME_ENTER( "morx chain subtable type5 (Glyph Insertion)" ); + + GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE ); + + valid->xstatetable.optdata = + et; + valid->xstatetable.optdata_load_func = + gxv_morx_subtable_type5_insertionGlyphList_load; + valid->xstatetable.subtable_setup_func = + gxv_morx_subtable_type5_subtable_setup; + valid->xstatetable.entry_glyphoffset_fmt = + GXV_GLYPHOFFSET_ULONG; + valid->xstatetable.entry_validate_func = + gxv_morx_subtable_type5_entry_validate; + + gxv_XStateTable_validate( p, limit, valid ); + + GXV_EXIT; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvopbd.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvopbd.c index 8d6fe669f30..802a1e54bd2 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvopbd.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvopbd.c @@ -1,217 +1,217 @@ -/***************************************************************************/ -/* */ -/* gxvopbd.c */ -/* */ -/* TrueTypeGX/AAT opbd table validation (body). */ -/* */ -/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvalid.h" -#include "gxvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvopbd - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** Data and Types *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - typedef struct GXV_opbd_DataRec_ - { - FT_UShort format; - FT_UShort valueOffset_min; - - } GXV_opbd_DataRec, *GXV_opbd_Data; - - -#define GXV_OPBD_DATA( FIELD ) GXV_TABLE_DATA( opbd, FIELD ) - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** UTILITY FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - gxv_opbd_LookupValue_validate( FT_UShort glyph, - GXV_LookupValueDesc value, - GXV_Validator valid ) - { - /* offset in LookupTable is measured from the head of opbd table */ - FT_Bytes p = valid->root->base + value.u; - FT_Bytes limit = valid->root->limit; - FT_Short delta_value; - int i; - - - if ( value.u < GXV_OPBD_DATA( valueOffset_min ) ) - GXV_OPBD_DATA( valueOffset_min ) = value.u; - - for ( i = 0; i < 4; i++ ) - { - GXV_LIMIT_CHECK( 2 ); - delta_value = FT_NEXT_SHORT( p ); - - if ( GXV_OPBD_DATA( format ) ) /* format 1, value is ctrl pt. */ - { - if ( delta_value == -1 ) - continue; - - gxv_ctlPoint_validate( glyph, delta_value, valid ); - } - else /* format 0, value is distance */ - continue; - } - } - - - /* - opbd ---------------------+ - | - +===============+ | - | lookup header | | - +===============+ | - | BinSrchHeader | | - +===============+ | - | lastGlyph[0] | | - +---------------+ | - | firstGlyph[0] | | head of opbd sfnt table - +---------------+ | + - | offset[0] | -> | offset [byte] - +===============+ | + - | lastGlyph[1] | | (glyphID - firstGlyph) * 4 * sizeof(FT_Short) [byte] - +---------------+ | - | firstGlyph[1] | | - +---------------+ | - | offset[1] | | - +===============+ | - | - .... | - | - 48bit value array | - +===============+ | - | value | <-------+ - | | - | | - | | - +---------------+ - .... */ - - static GXV_LookupValueDesc - gxv_opbd_LookupFmt4_transit( FT_UShort relative_gindex, - GXV_LookupValueDesc base_value, - FT_Bytes lookuptbl_limit, - GXV_Validator valid ) - { - GXV_LookupValueDesc value; - - FT_UNUSED( lookuptbl_limit ); - FT_UNUSED( valid ); - - /* XXX: check range? */ - value.u = (FT_UShort)( base_value.u + - relative_gindex * 4 * sizeof ( FT_Short ) ); - - return value; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** opbd TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - gxv_opbd_validate( FT_Bytes table, - FT_Face face, - FT_Validator ftvalid ) - { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; - GXV_opbd_DataRec opbdrec; - GXV_opbd_Data opbd = &opbdrec; - FT_Bytes p = table; - FT_Bytes limit = 0; - - FT_ULong version; - - - valid->root = ftvalid; - valid->table_data = opbd; - valid->face = face; - - FT_TRACE3(( "validating `opbd' table\n" )); - GXV_INIT; - GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU; - - - GXV_LIMIT_CHECK( 4 + 2 ); - version = FT_NEXT_ULONG( p ); - GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p ); - - - /* only 0x00010000 is defined (1996) */ - GXV_TRACE(( "(version=0x%08x)\n", version )); - if ( 0x00010000UL != version ) - FT_INVALID_FORMAT; - - /* only values 0 and 1 are defined (1996) */ - GXV_TRACE(( "(format=0x%04x)\n", GXV_OPBD_DATA( format ) )); - if ( 0x0001 < GXV_OPBD_DATA( format ) ) - FT_INVALID_FORMAT; - - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_opbd_LookupValue_validate; - valid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit; - - gxv_LookupTable_validate( p, limit, valid ); - p += valid->subtable_length; - - if ( p > table + GXV_OPBD_DATA( valueOffset_min ) ) - { - GXV_TRACE(( - "found overlap between LookupTable and opbd_value array\n" )); - FT_INVALID_OFFSET; - } - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvopbd.c */ +/* */ +/* TrueTypeGX/AAT opbd table validation (body). */ +/* */ +/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvalid.h" +#include "gxvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvopbd + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** Data and Types *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct GXV_opbd_DataRec_ + { + FT_UShort format; + FT_UShort valueOffset_min; + + } GXV_opbd_DataRec, *GXV_opbd_Data; + + +#define GXV_OPBD_DATA( FIELD ) GXV_TABLE_DATA( opbd, FIELD ) + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + gxv_opbd_LookupValue_validate( FT_UShort glyph, + GXV_LookupValueDesc value, + GXV_Validator valid ) + { + /* offset in LookupTable is measured from the head of opbd table */ + FT_Bytes p = valid->root->base + value.u; + FT_Bytes limit = valid->root->limit; + FT_Short delta_value; + int i; + + + if ( value.u < GXV_OPBD_DATA( valueOffset_min ) ) + GXV_OPBD_DATA( valueOffset_min ) = value.u; + + for ( i = 0; i < 4; i++ ) + { + GXV_LIMIT_CHECK( 2 ); + delta_value = FT_NEXT_SHORT( p ); + + if ( GXV_OPBD_DATA( format ) ) /* format 1, value is ctrl pt. */ + { + if ( delta_value == -1 ) + continue; + + gxv_ctlPoint_validate( glyph, delta_value, valid ); + } + else /* format 0, value is distance */ + continue; + } + } + + + /* + opbd ---------------------+ + | + +===============+ | + | lookup header | | + +===============+ | + | BinSrchHeader | | + +===============+ | + | lastGlyph[0] | | + +---------------+ | + | firstGlyph[0] | | head of opbd sfnt table + +---------------+ | + + | offset[0] | -> | offset [byte] + +===============+ | + + | lastGlyph[1] | | (glyphID - firstGlyph) * 4 * sizeof(FT_Short) [byte] + +---------------+ | + | firstGlyph[1] | | + +---------------+ | + | offset[1] | | + +===============+ | + | + .... | + | + 48bit value array | + +===============+ | + | value | <-------+ + | | + | | + | | + +---------------+ + .... */ + + static GXV_LookupValueDesc + gxv_opbd_LookupFmt4_transit( FT_UShort relative_gindex, + GXV_LookupValueDesc base_value, + FT_Bytes lookuptbl_limit, + GXV_Validator valid ) + { + GXV_LookupValueDesc value; + + FT_UNUSED( lookuptbl_limit ); + FT_UNUSED( valid ); + + /* XXX: check range? */ + value.u = (FT_UShort)( base_value.u + + relative_gindex * 4 * sizeof ( FT_Short ) ); + + return value; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** opbd TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + gxv_opbd_validate( FT_Bytes table, + FT_Face face, + FT_Validator ftvalid ) + { + GXV_ValidatorRec validrec; + GXV_Validator valid = &validrec; + GXV_opbd_DataRec opbdrec; + GXV_opbd_Data opbd = &opbdrec; + FT_Bytes p = table; + FT_Bytes limit = 0; + + FT_ULong version; + + + valid->root = ftvalid; + valid->table_data = opbd; + valid->face = face; + + FT_TRACE3(( "validating `opbd' table\n" )); + GXV_INIT; + GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU; + + + GXV_LIMIT_CHECK( 4 + 2 ); + version = FT_NEXT_ULONG( p ); + GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p ); + + + /* only 0x00010000 is defined (1996) */ + GXV_TRACE(( "(version=0x%08x)\n", version )); + if ( 0x00010000UL != version ) + FT_INVALID_FORMAT; + + /* only values 0 and 1 are defined (1996) */ + GXV_TRACE(( "(format=0x%04x)\n", GXV_OPBD_DATA( format ) )); + if ( 0x0001 < GXV_OPBD_DATA( format ) ) + FT_INVALID_FORMAT; + + valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + valid->lookupval_func = gxv_opbd_LookupValue_validate; + valid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit; + + gxv_LookupTable_validate( p, limit, valid ); + p += valid->subtable_length; + + if ( p > table + GXV_OPBD_DATA( valueOffset_min ) ) + { + GXV_TRACE(( + "found overlap between LookupTable and opbd_value array\n" )); + FT_INVALID_OFFSET; + } + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvprop.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvprop.c index 010eeda4266..021f7e903e9 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvprop.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvprop.c @@ -1,301 +1,301 @@ -/***************************************************************************/ -/* */ -/* gxvprop.c */ -/* */ -/* TrueTypeGX/AAT prop table validation (body). */ -/* */ -/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvalid.h" -#include "gxvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvprop - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** Data and Types *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#define GXV_PROP_HEADER_SIZE ( 4 + 2 + 2 ) -#define GXV_PROP_SIZE_MIN GXV_PROP_HEADER_SIZE - - typedef struct GXV_prop_DataRec_ - { - FT_Fixed version; - - } GXV_prop_DataRec, *GXV_prop_Data; - -#define GXV_PROP_DATA( field ) GXV_TABLE_DATA( prop, field ) - -#define GXV_PROP_FLOATER 0x8000U -#define GXV_PROP_USE_COMPLEMENTARY_BRACKET 0x1000U -#define GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET 0x0F00U -#define GXV_PROP_ATTACHING_TO_RIGHT 0x0080U -#define GXV_PROP_RESERVED 0x0060U -#define GXV_PROP_DIRECTIONALITY_CLASS 0x001FU - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** UTILITY FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - gxv_prop_zero_advance_validate( FT_UShort gid, - GXV_Validator valid ) - { - FT_Face face; - FT_Error error; - FT_GlyphSlot glyph; - - - GXV_NAME_ENTER( "zero advance" ); - - face = valid->face; - - error = FT_Load_Glyph( face, - gid, - FT_LOAD_IGNORE_TRANSFORM ); - if ( error ) - FT_INVALID_GLYPH_ID; - - glyph = face->glyph; - - if ( glyph->advance.x != (FT_Pos)0 || - glyph->advance.y != (FT_Pos)0 ) - FT_INVALID_DATA; - - GXV_EXIT; - } - - - /* Pass 0 as GLYPH to check the default property */ - static void - gxv_prop_property_validate( FT_UShort property, - FT_UShort glyph, - GXV_Validator valid ) - { - if ( glyph != 0 && ( property & GXV_PROP_FLOATER ) ) - gxv_prop_zero_advance_validate( glyph, valid ); - - if ( property & GXV_PROP_USE_COMPLEMENTARY_BRACKET ) - { - FT_UShort offset; - char complement; - - - offset = (FT_UShort)( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET ); - if ( offset == 0 ) - FT_INVALID_DATA; - - complement = (char)( offset >> 8 ); - if ( complement & 0x08 ) - { - /* Top bit is set: negative */ - - /* Calculate the absolute offset */ - complement = (char)( ( complement & 0x07 ) + 1 ); - - /* The gid for complement must be greater than 0 */ - if ( glyph <= complement ) - FT_INVALID_DATA; - } - else - { - /* The gid for complement must be the face. */ - gxv_glyphid_validate( (FT_UShort)( glyph + complement ), valid ); - } - } - else - { - if ( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET ) - GXV_TRACE(( "glyph %d cannot have complementary bracketing\n", - glyph )); - } - - /* this is introduced in version 2.0 */ - if ( property & GXV_PROP_ATTACHING_TO_RIGHT ) - { - if ( GXV_PROP_DATA( version ) == 0x00010000UL ) - FT_INVALID_DATA; - } - - if ( property & GXV_PROP_RESERVED ) - FT_INVALID_DATA; - - if ( ( property & GXV_PROP_DIRECTIONALITY_CLASS ) > 11 ) - { - /* TODO: Too restricted. Use the validation level. */ - if ( GXV_PROP_DATA( version ) == 0x00010000UL || - GXV_PROP_DATA( version ) == 0x00020000UL ) - FT_INVALID_DATA; - } - } - - - static void - gxv_prop_LookupValue_validate( FT_UShort glyph, - GXV_LookupValueDesc value, - GXV_Validator valid ) - { - gxv_prop_property_validate( value.u, glyph, valid ); - } - - - /* - +===============+ --------+ - | lookup header | | - +===============+ | - | BinSrchHeader | | - +===============+ | - | lastGlyph[0] | | - +---------------+ | - | firstGlyph[0] | | head of lookup table - +---------------+ | + - | offset[0] | -> | offset [byte] - +===============+ | + - | lastGlyph[1] | | (glyphID - firstGlyph) * 2 [byte] - +---------------+ | - | firstGlyph[1] | | - +---------------+ | - | offset[1] | | - +===============+ | - | - ... | - | - 16bit value array | - +===============+ | - | value | <-------+ - ... - */ - - static GXV_LookupValueDesc - gxv_prop_LookupFmt4_transit( FT_UShort relative_gindex, - GXV_LookupValueDesc base_value, - FT_Bytes lookuptbl_limit, - GXV_Validator valid ) - { - FT_Bytes p; - FT_Bytes limit; - FT_UShort offset; - GXV_LookupValueDesc value; - - /* XXX: check range? */ - offset = (FT_UShort)( base_value.u + - relative_gindex * sizeof( FT_UShort ) ); - p = valid->lookuptbl_head + offset; - limit = lookuptbl_limit; - - GXV_LIMIT_CHECK ( 2 ); - value.u = FT_NEXT_USHORT( p ); - - return value; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** prop TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - gxv_prop_validate( FT_Bytes table, - FT_Face face, - FT_Validator ftvalid ) - { - FT_Bytes p = table; - FT_Bytes limit = 0; - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; - - GXV_prop_DataRec proprec; - GXV_prop_Data prop = &proprec; - - FT_Fixed version; - FT_UShort format; - FT_UShort defaultProp; - - - valid->root = ftvalid; - valid->table_data = prop; - valid->face = face; - - FT_TRACE3(( "validating `prop' table\n" )); - GXV_INIT; - - GXV_LIMIT_CHECK( 4 + 2 + 2 ); - version = FT_NEXT_ULONG( p ); - format = FT_NEXT_USHORT( p ); - defaultProp = FT_NEXT_USHORT( p ); - - /* only versions 1.0, 2.0, 3.0 are defined (1996) */ - if ( version != 0x00010000UL && - version != 0x00020000UL && - version != 0x00030000UL ) - FT_INVALID_FORMAT; - - - /* only formats 0x0000, 0x0001 are defined (1996) */ - if ( format > 1 ) - FT_INVALID_FORMAT; - - gxv_prop_property_validate( defaultProp, 0, valid ); - - if ( format == 0 ) - { - FT_TRACE3(( "(format 0, no per-glyph properties, " - "remaining %d bytes are skipped)", limit - p )); - goto Exit; - } - - /* format == 1 */ - GXV_PROP_DATA( version ) = version; - - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_prop_LookupValue_validate; - valid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit; - - gxv_LookupTable_validate( p, limit, valid ); - - Exit: - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvprop.c */ +/* */ +/* TrueTypeGX/AAT prop table validation (body). */ +/* */ +/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvalid.h" +#include "gxvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvprop + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** Data and Types *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define GXV_PROP_HEADER_SIZE ( 4 + 2 + 2 ) +#define GXV_PROP_SIZE_MIN GXV_PROP_HEADER_SIZE + + typedef struct GXV_prop_DataRec_ + { + FT_Fixed version; + + } GXV_prop_DataRec, *GXV_prop_Data; + +#define GXV_PROP_DATA( field ) GXV_TABLE_DATA( prop, field ) + +#define GXV_PROP_FLOATER 0x8000U +#define GXV_PROP_USE_COMPLEMENTARY_BRACKET 0x1000U +#define GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET 0x0F00U +#define GXV_PROP_ATTACHING_TO_RIGHT 0x0080U +#define GXV_PROP_RESERVED 0x0060U +#define GXV_PROP_DIRECTIONALITY_CLASS 0x001FU + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + gxv_prop_zero_advance_validate( FT_UShort gid, + GXV_Validator valid ) + { + FT_Face face; + FT_Error error; + FT_GlyphSlot glyph; + + + GXV_NAME_ENTER( "zero advance" ); + + face = valid->face; + + error = FT_Load_Glyph( face, + gid, + FT_LOAD_IGNORE_TRANSFORM ); + if ( error ) + FT_INVALID_GLYPH_ID; + + glyph = face->glyph; + + if ( glyph->advance.x != (FT_Pos)0 || + glyph->advance.y != (FT_Pos)0 ) + FT_INVALID_DATA; + + GXV_EXIT; + } + + + /* Pass 0 as GLYPH to check the default property */ + static void + gxv_prop_property_validate( FT_UShort property, + FT_UShort glyph, + GXV_Validator valid ) + { + if ( glyph != 0 && ( property & GXV_PROP_FLOATER ) ) + gxv_prop_zero_advance_validate( glyph, valid ); + + if ( property & GXV_PROP_USE_COMPLEMENTARY_BRACKET ) + { + FT_UShort offset; + char complement; + + + offset = (FT_UShort)( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET ); + if ( offset == 0 ) + FT_INVALID_DATA; + + complement = (char)( offset >> 8 ); + if ( complement & 0x08 ) + { + /* Top bit is set: negative */ + + /* Calculate the absolute offset */ + complement = (char)( ( complement & 0x07 ) + 1 ); + + /* The gid for complement must be greater than 0 */ + if ( glyph <= complement ) + FT_INVALID_DATA; + } + else + { + /* The gid for complement must be the face. */ + gxv_glyphid_validate( (FT_UShort)( glyph + complement ), valid ); + } + } + else + { + if ( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET ) + GXV_TRACE(( "glyph %d cannot have complementary bracketing\n", + glyph )); + } + + /* this is introduced in version 2.0 */ + if ( property & GXV_PROP_ATTACHING_TO_RIGHT ) + { + if ( GXV_PROP_DATA( version ) == 0x00010000UL ) + FT_INVALID_DATA; + } + + if ( property & GXV_PROP_RESERVED ) + FT_INVALID_DATA; + + if ( ( property & GXV_PROP_DIRECTIONALITY_CLASS ) > 11 ) + { + /* TODO: Too restricted. Use the validation level. */ + if ( GXV_PROP_DATA( version ) == 0x00010000UL || + GXV_PROP_DATA( version ) == 0x00020000UL ) + FT_INVALID_DATA; + } + } + + + static void + gxv_prop_LookupValue_validate( FT_UShort glyph, + GXV_LookupValueDesc value, + GXV_Validator valid ) + { + gxv_prop_property_validate( value.u, glyph, valid ); + } + + + /* + +===============+ --------+ + | lookup header | | + +===============+ | + | BinSrchHeader | | + +===============+ | + | lastGlyph[0] | | + +---------------+ | + | firstGlyph[0] | | head of lookup table + +---------------+ | + + | offset[0] | -> | offset [byte] + +===============+ | + + | lastGlyph[1] | | (glyphID - firstGlyph) * 2 [byte] + +---------------+ | + | firstGlyph[1] | | + +---------------+ | + | offset[1] | | + +===============+ | + | + ... | + | + 16bit value array | + +===============+ | + | value | <-------+ + ... + */ + + static GXV_LookupValueDesc + gxv_prop_LookupFmt4_transit( FT_UShort relative_gindex, + GXV_LookupValueDesc base_value, + FT_Bytes lookuptbl_limit, + GXV_Validator valid ) + { + FT_Bytes p; + FT_Bytes limit; + FT_UShort offset; + GXV_LookupValueDesc value; + + /* XXX: check range? */ + offset = (FT_UShort)( base_value.u + + relative_gindex * sizeof( FT_UShort ) ); + p = valid->lookuptbl_head + offset; + limit = lookuptbl_limit; + + GXV_LIMIT_CHECK ( 2 ); + value.u = FT_NEXT_USHORT( p ); + + return value; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** prop TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + gxv_prop_validate( FT_Bytes table, + FT_Face face, + FT_Validator ftvalid ) + { + FT_Bytes p = table; + FT_Bytes limit = 0; + GXV_ValidatorRec validrec; + GXV_Validator valid = &validrec; + + GXV_prop_DataRec proprec; + GXV_prop_Data prop = &proprec; + + FT_Fixed version; + FT_UShort format; + FT_UShort defaultProp; + + + valid->root = ftvalid; + valid->table_data = prop; + valid->face = face; + + FT_TRACE3(( "validating `prop' table\n" )); + GXV_INIT; + + GXV_LIMIT_CHECK( 4 + 2 + 2 ); + version = FT_NEXT_ULONG( p ); + format = FT_NEXT_USHORT( p ); + defaultProp = FT_NEXT_USHORT( p ); + + /* only versions 1.0, 2.0, 3.0 are defined (1996) */ + if ( version != 0x00010000UL && + version != 0x00020000UL && + version != 0x00030000UL ) + FT_INVALID_FORMAT; + + + /* only formats 0x0000, 0x0001 are defined (1996) */ + if ( format > 1 ) + FT_INVALID_FORMAT; + + gxv_prop_property_validate( defaultProp, 0, valid ); + + if ( format == 0 ) + { + FT_TRACE3(( "(format 0, no per-glyph properties, " + "remaining %d bytes are skipped)", limit - p )); + goto Exit; + } + + /* format == 1 */ + GXV_PROP_DATA( version ) = version; + + valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + valid->lookupval_func = gxv_prop_LookupValue_validate; + valid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit; + + gxv_LookupTable_validate( p, limit, valid ); + + Exit: + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvtrak.c b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvtrak.c index 432ee4e2719..44c53acab3c 100644 --- a/reactos/dll/3rdparty/freetype/src/gxvalid/gxvtrak.c +++ b/reactos/dll/3rdparty/freetype/src/gxvalid/gxvtrak.c @@ -1,277 +1,277 @@ -/***************************************************************************/ -/* */ -/* gxvtrak.c */ -/* */ -/* TrueTypeGX/AAT trak table validation (body). */ -/* */ -/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -/***************************************************************************/ -/* */ -/* gxvalid is derived from both gxlayout module and otvalid module. */ -/* Development of gxlayout is supported by the Information-technology */ -/* Promotion Agency(IPA), Japan. */ -/* */ -/***************************************************************************/ - - -#include "gxvalid.h" -#include "gxvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_gxvtrak - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** Data and Types *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* - * referred track table format specification: - * http://developer.apple.com/fonts/TTRefMan/RM06/Chap6trak.html - * last update was 1996. - * ---------------------------------------------- - * [MINIMUM HEADER]: GXV_TRAK_SIZE_MIN - * version (fixed: 32bit) = 0x00010000 - * format (uint16: 16bit) = 0 is only defined (1996) - * horizOffset (uint16: 16bit) - * vertOffset (uint16: 16bit) - * reserved (uint16: 16bit) = 0 - * ---------------------------------------------- - * [VARIABLE BODY]: - * horizData - * header ( 2 + 2 + 4 - * trackTable + nTracks * ( 4 + 2 + 2 ) - * sizeTable + nSizes * 4 ) - * ---------------------------------------------- - * vertData - * header ( 2 + 2 + 4 - * trackTable + nTracks * ( 4 + 2 + 2 ) - * sizeTable + nSizes * 4 ) - * ---------------------------------------------- - */ - typedef struct GXV_trak_DataRec_ - { - FT_UShort trackValueOffset_min; - FT_UShort trackValueOffset_max; - - } GXV_trak_DataRec, *GXV_trak_Data; - - -#define GXV_TRAK_DATA( FIELD ) GXV_TABLE_DATA( trak, FIELD ) - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** UTILITY FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - gxv_trak_trackTable_validate( FT_Bytes table, - FT_Bytes limit, - FT_UShort nTracks, - GXV_Validator valid ) - { - FT_Bytes p = table; - - FT_Fixed track; - FT_UShort nameIndex; - FT_UShort offset; - FT_UShort i; - - - GXV_NAME_ENTER( "trackTable" ); - - GXV_TRAK_DATA( trackValueOffset_min ) = 0xFFFFU; - GXV_TRAK_DATA( trackValueOffset_max ) = 0x0000; - - for ( i = 0; i < nTracks; i ++ ) - { - GXV_LIMIT_CHECK( 4 + 2 + 2 ); - track = FT_NEXT_LONG( p ); - nameIndex = FT_NEXT_USHORT( p ); - offset = FT_NEXT_USHORT( p ); - - if ( offset < GXV_TRAK_DATA( trackValueOffset_min ) ) - GXV_TRAK_DATA( trackValueOffset_min ) = offset; - if ( offset > GXV_TRAK_DATA( trackValueOffset_max ) ) - GXV_TRAK_DATA( trackValueOffset_max ) = offset; - - gxv_sfntName_validate( nameIndex, 256, 32767, valid ); - } - - valid->subtable_length = p - table; - GXV_EXIT; - } - - - static void - gxv_trak_trackData_validate( FT_Bytes table, - FT_Bytes limit, - GXV_Validator valid ) - { - FT_Bytes p = table; - FT_UShort nTracks; - FT_UShort nSizes; - FT_ULong sizeTableOffset; - - GXV_ODTECT( 4, odtect ); - - - GXV_ODTECT_INIT( odtect ); - GXV_NAME_ENTER( "trackData" ); - - /* read the header of trackData */ - GXV_LIMIT_CHECK( 2 + 2 + 4 ); - nTracks = FT_NEXT_USHORT( p ); - nSizes = FT_NEXT_USHORT( p ); - sizeTableOffset = FT_NEXT_ULONG( p ); - - gxv_odtect_add_range( table, p - table, "trackData header", odtect ); - - /* validate trackTable */ - gxv_trak_trackTable_validate( p, limit, nTracks, valid ); - gxv_odtect_add_range( p, valid->subtable_length, - "trackTable", odtect ); - - /* sizeTable is array of FT_Fixed, don't check contents */ - p = valid->root->base + sizeTableOffset; - GXV_LIMIT_CHECK( nSizes * 4 ); - gxv_odtect_add_range( p, nSizes * 4, "sizeTable", odtect ); - - /* validate trackValueOffet */ - p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_min ); - if ( limit - p < nTracks * nSizes * 2 ) - GXV_TRACE(( "too short trackValue array\n" )); - - p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_max ); - GXV_LIMIT_CHECK( nSizes * 2 ); - - gxv_odtect_add_range( valid->root->base - + GXV_TRAK_DATA( trackValueOffset_min ), - GXV_TRAK_DATA( trackValueOffset_max ) - - GXV_TRAK_DATA( trackValueOffset_min ) - + nSizes * 2, - "trackValue array", odtect ); - - gxv_odtect_validate( odtect, valid ); - - GXV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** trak TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - gxv_trak_validate( FT_Bytes table, - FT_Face face, - FT_Validator ftvalid ) - { - FT_Bytes p = table; - FT_Bytes limit = 0; - FT_UInt table_size; - - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; - GXV_trak_DataRec trakrec; - GXV_trak_Data trak = &trakrec; - - FT_ULong version; - FT_UShort format; - FT_UShort horizOffset; - FT_UShort vertOffset; - FT_UShort reserved; - - - GXV_ODTECT( 3, odtect ); - - GXV_ODTECT_INIT( odtect ); - valid->root = ftvalid; - valid->table_data = trak; - valid->face = face; - - limit = valid->root->limit; - table_size = limit - table; - - FT_TRACE3(( "validating `trak' table\n" )); - GXV_INIT; - - GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 + 2 ); - version = FT_NEXT_ULONG( p ); - format = FT_NEXT_USHORT( p ); - horizOffset = FT_NEXT_USHORT( p ); - vertOffset = FT_NEXT_USHORT( p ); - reserved = FT_NEXT_USHORT( p ); - - GXV_TRACE(( " (version = 0x%08x)\n", version )); - GXV_TRACE(( " (format = 0x%04x)\n", format )); - GXV_TRACE(( " (horizOffset = 0x%04x)\n", horizOffset )); - GXV_TRACE(( " (vertOffset = 0x%04x)\n", vertOffset )); - GXV_TRACE(( " (reserved = 0x%04x)\n", reserved )); - - /* Version 1.0 (always:1996) */ - if ( version != 0x00010000UL ) - FT_INVALID_FORMAT; - - /* format 0 (always:1996) */ - if ( format != 0x0000 ) - FT_INVALID_FORMAT; - - GXV_32BIT_ALIGNMENT_VALIDATE( horizOffset ); - GXV_32BIT_ALIGNMENT_VALIDATE( vertOffset ); - - /* Reserved Fixed Value (always) */ - if ( reserved != 0x0000 ) - FT_INVALID_DATA; - - /* validate trackData */ - if ( 0 < horizOffset ) - { - gxv_trak_trackData_validate( table + horizOffset, limit, valid ); - gxv_odtect_add_range( table + horizOffset, valid->subtable_length, - "horizJustData", odtect ); - } - - if ( 0 < vertOffset ) - { - gxv_trak_trackData_validate( table + vertOffset, limit, valid ); - gxv_odtect_add_range( table + vertOffset, valid->subtable_length, - "vertJustData", odtect ); - } - - gxv_odtect_validate( odtect, valid ); - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* gxvtrak.c */ +/* */ +/* TrueTypeGX/AAT trak table validation (body). */ +/* */ +/* Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +/***************************************************************************/ +/* */ +/* gxvalid is derived from both gxlayout module and otvalid module. */ +/* Development of gxlayout is supported by the Information-technology */ +/* Promotion Agency(IPA), Japan. */ +/* */ +/***************************************************************************/ + + +#include "gxvalid.h" +#include "gxvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_gxvtrak + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** Data and Types *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* + * referred track table format specification: + * http://developer.apple.com/fonts/TTRefMan/RM06/Chap6trak.html + * last update was 1996. + * ---------------------------------------------- + * [MINIMUM HEADER]: GXV_TRAK_SIZE_MIN + * version (fixed: 32bit) = 0x00010000 + * format (uint16: 16bit) = 0 is only defined (1996) + * horizOffset (uint16: 16bit) + * vertOffset (uint16: 16bit) + * reserved (uint16: 16bit) = 0 + * ---------------------------------------------- + * [VARIABLE BODY]: + * horizData + * header ( 2 + 2 + 4 + * trackTable + nTracks * ( 4 + 2 + 2 ) + * sizeTable + nSizes * 4 ) + * ---------------------------------------------- + * vertData + * header ( 2 + 2 + 4 + * trackTable + nTracks * ( 4 + 2 + 2 ) + * sizeTable + nSizes * 4 ) + * ---------------------------------------------- + */ + typedef struct GXV_trak_DataRec_ + { + FT_UShort trackValueOffset_min; + FT_UShort trackValueOffset_max; + + } GXV_trak_DataRec, *GXV_trak_Data; + + +#define GXV_TRAK_DATA( FIELD ) GXV_TABLE_DATA( trak, FIELD ) + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + gxv_trak_trackTable_validate( FT_Bytes table, + FT_Bytes limit, + FT_UShort nTracks, + GXV_Validator valid ) + { + FT_Bytes p = table; + + FT_Fixed track; + FT_UShort nameIndex; + FT_UShort offset; + FT_UShort i; + + + GXV_NAME_ENTER( "trackTable" ); + + GXV_TRAK_DATA( trackValueOffset_min ) = 0xFFFFU; + GXV_TRAK_DATA( trackValueOffset_max ) = 0x0000; + + for ( i = 0; i < nTracks; i ++ ) + { + GXV_LIMIT_CHECK( 4 + 2 + 2 ); + track = FT_NEXT_LONG( p ); + nameIndex = FT_NEXT_USHORT( p ); + offset = FT_NEXT_USHORT( p ); + + if ( offset < GXV_TRAK_DATA( trackValueOffset_min ) ) + GXV_TRAK_DATA( trackValueOffset_min ) = offset; + if ( offset > GXV_TRAK_DATA( trackValueOffset_max ) ) + GXV_TRAK_DATA( trackValueOffset_max ) = offset; + + gxv_sfntName_validate( nameIndex, 256, 32767, valid ); + } + + valid->subtable_length = p - table; + GXV_EXIT; + } + + + static void + gxv_trak_trackData_validate( FT_Bytes table, + FT_Bytes limit, + GXV_Validator valid ) + { + FT_Bytes p = table; + FT_UShort nTracks; + FT_UShort nSizes; + FT_ULong sizeTableOffset; + + GXV_ODTECT( 4, odtect ); + + + GXV_ODTECT_INIT( odtect ); + GXV_NAME_ENTER( "trackData" ); + + /* read the header of trackData */ + GXV_LIMIT_CHECK( 2 + 2 + 4 ); + nTracks = FT_NEXT_USHORT( p ); + nSizes = FT_NEXT_USHORT( p ); + sizeTableOffset = FT_NEXT_ULONG( p ); + + gxv_odtect_add_range( table, p - table, "trackData header", odtect ); + + /* validate trackTable */ + gxv_trak_trackTable_validate( p, limit, nTracks, valid ); + gxv_odtect_add_range( p, valid->subtable_length, + "trackTable", odtect ); + + /* sizeTable is array of FT_Fixed, don't check contents */ + p = valid->root->base + sizeTableOffset; + GXV_LIMIT_CHECK( nSizes * 4 ); + gxv_odtect_add_range( p, nSizes * 4, "sizeTable", odtect ); + + /* validate trackValueOffet */ + p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_min ); + if ( limit - p < nTracks * nSizes * 2 ) + GXV_TRACE(( "too short trackValue array\n" )); + + p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_max ); + GXV_LIMIT_CHECK( nSizes * 2 ); + + gxv_odtect_add_range( valid->root->base + + GXV_TRAK_DATA( trackValueOffset_min ), + GXV_TRAK_DATA( trackValueOffset_max ) + - GXV_TRAK_DATA( trackValueOffset_min ) + + nSizes * 2, + "trackValue array", odtect ); + + gxv_odtect_validate( odtect, valid ); + + GXV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** trak TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + gxv_trak_validate( FT_Bytes table, + FT_Face face, + FT_Validator ftvalid ) + { + FT_Bytes p = table; + FT_Bytes limit = 0; + FT_UInt table_size; + + GXV_ValidatorRec validrec; + GXV_Validator valid = &validrec; + GXV_trak_DataRec trakrec; + GXV_trak_Data trak = &trakrec; + + FT_ULong version; + FT_UShort format; + FT_UShort horizOffset; + FT_UShort vertOffset; + FT_UShort reserved; + + + GXV_ODTECT( 3, odtect ); + + GXV_ODTECT_INIT( odtect ); + valid->root = ftvalid; + valid->table_data = trak; + valid->face = face; + + limit = valid->root->limit; + table_size = limit - table; + + FT_TRACE3(( "validating `trak' table\n" )); + GXV_INIT; + + GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 + 2 ); + version = FT_NEXT_ULONG( p ); + format = FT_NEXT_USHORT( p ); + horizOffset = FT_NEXT_USHORT( p ); + vertOffset = FT_NEXT_USHORT( p ); + reserved = FT_NEXT_USHORT( p ); + + GXV_TRACE(( " (version = 0x%08x)\n", version )); + GXV_TRACE(( " (format = 0x%04x)\n", format )); + GXV_TRACE(( " (horizOffset = 0x%04x)\n", horizOffset )); + GXV_TRACE(( " (vertOffset = 0x%04x)\n", vertOffset )); + GXV_TRACE(( " (reserved = 0x%04x)\n", reserved )); + + /* Version 1.0 (always:1996) */ + if ( version != 0x00010000UL ) + FT_INVALID_FORMAT; + + /* format 0 (always:1996) */ + if ( format != 0x0000 ) + FT_INVALID_FORMAT; + + GXV_32BIT_ALIGNMENT_VALIDATE( horizOffset ); + GXV_32BIT_ALIGNMENT_VALIDATE( vertOffset ); + + /* Reserved Fixed Value (always) */ + if ( reserved != 0x0000 ) + FT_INVALID_DATA; + + /* validate trackData */ + if ( 0 < horizOffset ) + { + gxv_trak_trackData_validate( table + horizOffset, limit, valid ); + gxv_odtect_add_range( table + horizOffset, valid->subtable_length, + "horizJustData", odtect ); + } + + if ( 0 < vertOffset ) + { + gxv_trak_trackData_validate( table + vertOffset, limit, valid ); + gxv_odtect_add_range( table + vertOffset, valid->subtable_length, + "vertJustData", odtect ); + } + + gxv_odtect_validate( odtect, valid ); + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/adler32.c b/reactos/dll/3rdparty/freetype/src/gzip/adler32.c index 36f6a432eaf..e0d6340f368 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/adler32.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/adler32.c @@ -1,48 +1,48 @@ -/* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: adler32.c,v 1.5 2007/06/01 06:56:17 wl Exp $ */ - -#include "zlib.h" - -#define BASE 65521L /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - -/* ========================================================================= */ -ZEXPORT(uLong) adler32( /* adler, buf, len) */ - uLong adler, - const Bytef *buf, - uInt len ) -{ - unsigned long s1 = adler & 0xffff; - unsigned long s2 = (adler >> 16) & 0xffff; - int k; - - if (buf == Z_NULL) return 1L; - - while (len > 0) { - k = len < NMAX ? len : NMAX; - len -= k; - while (k >= 16) { - DO16(buf); - buf += 16; - k -= 16; - } - if (k != 0) do { - s1 += *buf++; - s2 += s1; - } while (--k); - s1 %= BASE; - s2 %= BASE; - } - return (s2 << 16) | s1; -} +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id: adler32.c,v 1.5 2007/06/01 06:56:17 wl Exp $ */ + +#include "zlib.h" + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* ========================================================================= */ +ZEXPORT(uLong) adler32( /* adler, buf, len) */ + uLong adler, + const Bytef *buf, + uInt len ) +{ + unsigned long s1 = adler & 0xffff; + unsigned long s2 = (adler >> 16) & 0xffff; + int k; + + if (buf == Z_NULL) return 1L; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + return (s2 << 16) | s1; +} diff --git a/reactos/dll/3rdparty/freetype/src/gzip/ftgzip.c b/reactos/dll/3rdparty/freetype/src/gzip/ftgzip.c index af2022d7f5a..7ea7c7e54ac 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/ftgzip.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/ftgzip.c @@ -1,682 +1,682 @@ -/***************************************************************************/ -/* */ -/* ftgzip.c */ -/* */ -/* FreeType support for .gz compressed files. */ -/* */ -/* This optional component relies on zlib. It should mainly be used to */ -/* parse compressed PCF fonts, as found with many X11 server */ -/* distributions. */ -/* */ -/* Copyright 2002, 2003, 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H -#include FT_GZIP_H -#include - - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX Gzip_Err_ -#define FT_ERR_BASE FT_Mod_Err_Gzip - -#include FT_ERRORS_H - - -#ifdef FT_CONFIG_OPTION_USE_ZLIB - -#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB - -#include - -#else /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */ - - /* In this case, we include our own modified sources of the ZLib */ - /* within the "ftgzip" component. The modifications were necessary */ - /* to #include all files without conflicts, as well as preventing */ - /* the definition of "extern" functions that may cause linking */ - /* conflicts when a program is linked with both FreeType and the */ - /* original ZLib. */ - -#define NO_DUMMY_DECL -#define MY_ZCALLOC - -#include "zlib.h" - -#undef SLOW -#define SLOW 1 /* we can't use asm-optimized sources here! */ - - /* Urgh. `inflate_mask' must not be declared twice -- C++ doesn't like - this. We temporarily disable it and load all necessary header files. */ -#define NO_INFLATE_MASK -#include "zutil.h" -#include "inftrees.h" -#include "infblock.h" -#include "infcodes.h" -#include "infutil.h" -#undef NO_INFLATE_MASK - - /* infutil.c must be included before infcodes.c */ -#include "zutil.c" -#include "inftrees.c" -#include "infutil.c" -#include "infcodes.c" -#include "infblock.c" -#include "inflate.c" -#include "adler32.c" - -#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */ - - -/***************************************************************************/ -/***************************************************************************/ -/***** *****/ -/***** Z L I B M E M O R Y M A N A G E M E N T *****/ -/***** *****/ -/***************************************************************************/ -/***************************************************************************/ - - /* it is better to use FreeType memory routines instead of raw - 'malloc/free' */ - - static voidpf - ft_gzip_alloc( FT_Memory memory, - uInt items, - uInt size ) - { - FT_ULong sz = (FT_ULong)size * items; - FT_Error error; - FT_Pointer p; - - - (void)FT_ALLOC( p, sz ); - return p; - } - - - static void - ft_gzip_free( FT_Memory memory, - voidpf address ) - { - FT_MEM_FREE( address ); - } - - -#ifndef FT_CONFIG_OPTION_SYSTEM_ZLIB - - local voidpf - zcalloc ( voidpf opaque, - unsigned items, - unsigned size ) - { - return ft_gzip_alloc( (FT_Memory)opaque, items, size ); - } - - local void - zcfree( voidpf opaque, - voidpf ptr ) - { - ft_gzip_free( (FT_Memory)opaque, ptr ); - } - -#endif /* !SYSTEM_ZLIB */ - - -/***************************************************************************/ -/***************************************************************************/ -/***** *****/ -/***** Z L I B F I L E D E S C R I P T O R *****/ -/***** *****/ -/***************************************************************************/ -/***************************************************************************/ - -#define FT_GZIP_BUFFER_SIZE 4096 - - typedef struct FT_GZipFileRec_ - { - FT_Stream source; /* parent/source stream */ - FT_Stream stream; /* embedding stream */ - FT_Memory memory; /* memory allocator */ - z_stream zstream; /* zlib input stream */ - - FT_ULong start; /* starting position, after .gz header */ - FT_Byte input[FT_GZIP_BUFFER_SIZE]; /* input read buffer */ - - FT_Byte buffer[FT_GZIP_BUFFER_SIZE]; /* output buffer */ - FT_ULong pos; /* position in output */ - FT_Byte* cursor; - FT_Byte* limit; - - } FT_GZipFileRec, *FT_GZipFile; - - - /* gzip flag byte */ -#define FT_GZIP_ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define FT_GZIP_HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define FT_GZIP_EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define FT_GZIP_ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define FT_GZIP_COMMENT 0x10 /* bit 4 set: file comment present */ -#define FT_GZIP_RESERVED 0xE0 /* bits 5..7: reserved */ - - - /* check and skip .gz header - we don't support `transparent' compression */ - static FT_Error - ft_gzip_check_header( FT_Stream stream ) - { - FT_Error error; - FT_Byte head[4]; - - - if ( FT_STREAM_SEEK( 0 ) || - FT_STREAM_READ( head, 4 ) ) - goto Exit; - - /* head[0] && head[1] are the magic numbers; */ - /* head[2] is the method, and head[3] the flags */ - if ( head[0] != 0x1f || - head[1] != 0x8b || - head[2] != Z_DEFLATED || - (head[3] & FT_GZIP_RESERVED) ) - { - error = Gzip_Err_Invalid_File_Format; - goto Exit; - } - - /* skip time, xflags and os code */ - (void)FT_STREAM_SKIP( 6 ); - - /* skip the extra field */ - if ( head[3] & FT_GZIP_EXTRA_FIELD ) - { - FT_UInt len; - - - if ( FT_READ_USHORT_LE( len ) || - FT_STREAM_SKIP( len ) ) - goto Exit; - } - - /* skip original file name */ - if ( head[3] & FT_GZIP_ORIG_NAME ) - for (;;) - { - FT_UInt c; - - - if ( FT_READ_BYTE( c ) ) - goto Exit; - - if ( c == 0 ) - break; - } - - /* skip .gz comment */ - if ( head[3] & FT_GZIP_COMMENT ) - for (;;) - { - FT_UInt c; - - - if ( FT_READ_BYTE( c ) ) - goto Exit; - - if ( c == 0 ) - break; - } - - /* skip CRC */ - if ( head[3] & FT_GZIP_HEAD_CRC ) - if ( FT_STREAM_SKIP( 2 ) ) - goto Exit; - - Exit: - return error; - } - - - static FT_Error - ft_gzip_file_init( FT_GZipFile zip, - FT_Stream stream, - FT_Stream source ) - { - z_stream* zstream = &zip->zstream; - FT_Error error = Gzip_Err_Ok; - - - zip->stream = stream; - zip->source = source; - zip->memory = stream->memory; - - zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE; - zip->cursor = zip->limit; - zip->pos = 0; - - /* check and skip .gz header */ - { - stream = source; - - error = ft_gzip_check_header( stream ); - if ( error ) - goto Exit; - - zip->start = FT_STREAM_POS(); - } - - /* initialize zlib -- there is no zlib header in the compressed stream */ - zstream->zalloc = (alloc_func)ft_gzip_alloc; - zstream->zfree = (free_func) ft_gzip_free; - zstream->opaque = stream->memory; - - zstream->avail_in = 0; - zstream->next_in = zip->buffer; - - if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK || - zstream->next_in == NULL ) - error = Gzip_Err_Invalid_File_Format; - - Exit: - return error; - } - - - static void - ft_gzip_file_done( FT_GZipFile zip ) - { - z_stream* zstream = &zip->zstream; - - - inflateEnd( zstream ); - - /* clear the rest */ - zstream->zalloc = NULL; - zstream->zfree = NULL; - zstream->opaque = NULL; - zstream->next_in = NULL; - zstream->next_out = NULL; - zstream->avail_in = 0; - zstream->avail_out = 0; - - zip->memory = NULL; - zip->source = NULL; - zip->stream = NULL; - } - - - static FT_Error - ft_gzip_file_reset( FT_GZipFile zip ) - { - FT_Stream stream = zip->source; - FT_Error error; - - - if ( !FT_STREAM_SEEK( zip->start ) ) - { - z_stream* zstream = &zip->zstream; - - - inflateReset( zstream ); - - zstream->avail_in = 0; - zstream->next_in = zip->input; - zstream->avail_out = 0; - zstream->next_out = zip->buffer; - - zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE; - zip->cursor = zip->limit; - zip->pos = 0; - } - - return error; - } - - - static FT_Error - ft_gzip_file_fill_input( FT_GZipFile zip ) - { - z_stream* zstream = &zip->zstream; - FT_Stream stream = zip->source; - FT_ULong size; - - - if ( stream->read ) - { - size = stream->read( stream, stream->pos, zip->input, - FT_GZIP_BUFFER_SIZE ); - if ( size == 0 ) - return Gzip_Err_Invalid_Stream_Operation; - } - else - { - size = stream->size - stream->pos; - if ( size > FT_GZIP_BUFFER_SIZE ) - size = FT_GZIP_BUFFER_SIZE; - - if ( size == 0 ) - return Gzip_Err_Invalid_Stream_Operation; - - FT_MEM_COPY( zip->input, stream->base + stream->pos, size ); - } - stream->pos += size; - - zstream->next_in = zip->input; - zstream->avail_in = size; - - return Gzip_Err_Ok; - } - - - static FT_Error - ft_gzip_file_fill_output( FT_GZipFile zip ) - { - z_stream* zstream = &zip->zstream; - FT_Error error = 0; - - - zip->cursor = zip->buffer; - zstream->next_out = zip->cursor; - zstream->avail_out = FT_GZIP_BUFFER_SIZE; - - while ( zstream->avail_out > 0 ) - { - int err; - - - if ( zstream->avail_in == 0 ) - { - error = ft_gzip_file_fill_input( zip ); - if ( error ) - break; - } - - err = inflate( zstream, Z_NO_FLUSH ); - - if ( err == Z_STREAM_END ) - { - zip->limit = zstream->next_out; - if ( zip->limit == zip->cursor ) - error = Gzip_Err_Invalid_Stream_Operation; - break; - } - else if ( err != Z_OK ) - { - error = Gzip_Err_Invalid_Stream_Operation; - break; - } - } - - return error; - } - - - /* fill output buffer; `count' must be <= FT_GZIP_BUFFER_SIZE */ - static FT_Error - ft_gzip_file_skip_output( FT_GZipFile zip, - FT_ULong count ) - { - FT_Error error = Gzip_Err_Ok; - FT_ULong delta; - - - for (;;) - { - delta = (FT_ULong)( zip->limit - zip->cursor ); - if ( delta >= count ) - delta = count; - - zip->cursor += delta; - zip->pos += delta; - - count -= delta; - if ( count == 0 ) - break; - - error = ft_gzip_file_fill_output( zip ); - if ( error ) - break; - } - - return error; - } - - - static FT_ULong - ft_gzip_file_io( FT_GZipFile zip, - FT_ULong pos, - FT_Byte* buffer, - FT_ULong count ) - { - FT_ULong result = 0; - FT_Error error; - - - /* Reset inflate stream if we're seeking backwards. */ - /* Yes, that is not too efficient, but it saves memory :-) */ - if ( pos < zip->pos ) - { - error = ft_gzip_file_reset( zip ); - if ( error ) - goto Exit; - } - - /* skip unwanted bytes */ - if ( pos > zip->pos ) - { - error = ft_gzip_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) ); - if ( error ) - goto Exit; - } - - if ( count == 0 ) - goto Exit; - - /* now read the data */ - for (;;) - { - FT_ULong delta; - - - delta = (FT_ULong)( zip->limit - zip->cursor ); - if ( delta >= count ) - delta = count; - - FT_MEM_COPY( buffer, zip->cursor, delta ); - buffer += delta; - result += delta; - zip->cursor += delta; - zip->pos += delta; - - count -= delta; - if ( count == 0 ) - break; - - error = ft_gzip_file_fill_output( zip ); - if ( error ) - break; - } - - Exit: - return result; - } - - -/***************************************************************************/ -/***************************************************************************/ -/***** *****/ -/***** G Z E M B E D D I N G S T R E A M *****/ -/***** *****/ -/***************************************************************************/ -/***************************************************************************/ - - static void - ft_gzip_stream_close( FT_Stream stream ) - { - FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer; - FT_Memory memory = stream->memory; - - - if ( zip ) - { - /* finalize gzip file descriptor */ - ft_gzip_file_done( zip ); - - FT_FREE( zip ); - - stream->descriptor.pointer = NULL; - } - } - - - static FT_ULong - ft_gzip_stream_io( FT_Stream stream, - FT_ULong pos, - FT_Byte* buffer, - FT_ULong count ) - { - FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer; - - - return ft_gzip_file_io( zip, pos, buffer, count ); - } - - - static FT_ULong - ft_gzip_get_uncompressed_size( FT_Stream stream ) - { - FT_Error error; - FT_ULong old_pos; - FT_ULong result = 0; - - - old_pos = stream->pos; - if ( !FT_Stream_Seek( stream, stream->size - 4 ) ) - { - result = (FT_ULong)FT_Stream_ReadLong( stream, &error ); - if ( error ) - result = 0; - - FT_Stream_Seek( stream, old_pos ); - } - - return result; - } - - - FT_EXPORT_DEF( FT_Error ) - FT_Stream_OpenGzip( FT_Stream stream, - FT_Stream source ) - { - FT_Error error; - FT_Memory memory = source->memory; - FT_GZipFile zip; - - - /* - * check the header right now; this prevents allocating un-necessary - * objects when we don't need them - */ - error = ft_gzip_check_header( source ); - if ( error ) - goto Exit; - - FT_ZERO( stream ); - stream->memory = memory; - - if ( !FT_QNEW( zip ) ) - { - error = ft_gzip_file_init( zip, stream, source ); - if ( error ) - { - FT_FREE( zip ); - goto Exit; - } - - stream->descriptor.pointer = zip; - } - - /* - * We use the following trick to try to dramatically improve the - * performance while dealing with small files. If the original stream - * size is less than a certain threshold, we try to load the whole font - * file into memory. This saves us from using the 32KB buffer needed - * to inflate the file, plus the two 4KB intermediate input/output - * buffers used in the `FT_GZipFile' structure. - */ - { - FT_ULong zip_size = ft_gzip_get_uncompressed_size( source ); - - - if ( zip_size != 0 && zip_size < 40 * 1024 ) - { - FT_Byte* zip_buff; - - - if ( !FT_ALLOC( zip_buff, zip_size ) ) - { - FT_ULong count; - - - count = ft_gzip_file_io( zip, 0, zip_buff, zip_size ); - if ( count == zip_size ) - { - ft_gzip_file_done( zip ); - FT_FREE( zip ); - - stream->descriptor.pointer = NULL; - - stream->size = zip_size; - stream->pos = 0; - stream->base = zip_buff; - stream->read = NULL; - stream->close = ft_gzip_stream_close; - - goto Exit; - } - - ft_gzip_file_io( zip, 0, NULL, 0 ); - FT_FREE( zip_buff ); - } - error = 0; - } - } - - stream->size = 0x7FFFFFFFL; /* don't know the real size! */ - stream->pos = 0; - stream->base = 0; - stream->read = ft_gzip_stream_io; - stream->close = ft_gzip_stream_close; - - Exit: - return error; - } - -#else /* !FT_CONFIG_OPTION_USE_ZLIB */ - - FT_EXPORT_DEF( FT_Error ) - FT_Stream_OpenGzip( FT_Stream stream, - FT_Stream source ) - { - FT_UNUSED( stream ); - FT_UNUSED( source ); - - return Gzip_Err_Unimplemented_Feature; - } - -#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftgzip.c */ +/* */ +/* FreeType support for .gz compressed files. */ +/* */ +/* This optional component relies on zlib. It should mainly be used to */ +/* parse compressed PCF fonts, as found with many X11 server */ +/* distributions. */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_MEMORY_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_DEBUG_H +#include FT_GZIP_H +#include + + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX Gzip_Err_ +#define FT_ERR_BASE FT_Mod_Err_Gzip + +#include FT_ERRORS_H + + +#ifdef FT_CONFIG_OPTION_USE_ZLIB + +#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB + +#include + +#else /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */ + + /* In this case, we include our own modified sources of the ZLib */ + /* within the "ftgzip" component. The modifications were necessary */ + /* to #include all files without conflicts, as well as preventing */ + /* the definition of "extern" functions that may cause linking */ + /* conflicts when a program is linked with both FreeType and the */ + /* original ZLib. */ + +#define NO_DUMMY_DECL +#define MY_ZCALLOC + +#include "zlib.h" + +#undef SLOW +#define SLOW 1 /* we can't use asm-optimized sources here! */ + + /* Urgh. `inflate_mask' must not be declared twice -- C++ doesn't like + this. We temporarily disable it and load all necessary header files. */ +#define NO_INFLATE_MASK +#include "zutil.h" +#include "inftrees.h" +#include "infblock.h" +#include "infcodes.h" +#include "infutil.h" +#undef NO_INFLATE_MASK + + /* infutil.c must be included before infcodes.c */ +#include "zutil.c" +#include "inftrees.c" +#include "infutil.c" +#include "infcodes.c" +#include "infblock.c" +#include "inflate.c" +#include "adler32.c" + +#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */ + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** Z L I B M E M O R Y M A N A G E M E N T *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + + /* it is better to use FreeType memory routines instead of raw + 'malloc/free' */ + + static voidpf + ft_gzip_alloc( FT_Memory memory, + uInt items, + uInt size ) + { + FT_ULong sz = (FT_ULong)size * items; + FT_Error error; + FT_Pointer p; + + + (void)FT_ALLOC( p, sz ); + return p; + } + + + static void + ft_gzip_free( FT_Memory memory, + voidpf address ) + { + FT_MEM_FREE( address ); + } + + +#ifndef FT_CONFIG_OPTION_SYSTEM_ZLIB + + local voidpf + zcalloc ( voidpf opaque, + unsigned items, + unsigned size ) + { + return ft_gzip_alloc( (FT_Memory)opaque, items, size ); + } + + local void + zcfree( voidpf opaque, + voidpf ptr ) + { + ft_gzip_free( (FT_Memory)opaque, ptr ); + } + +#endif /* !SYSTEM_ZLIB */ + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** Z L I B F I L E D E S C R I P T O R *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + +#define FT_GZIP_BUFFER_SIZE 4096 + + typedef struct FT_GZipFileRec_ + { + FT_Stream source; /* parent/source stream */ + FT_Stream stream; /* embedding stream */ + FT_Memory memory; /* memory allocator */ + z_stream zstream; /* zlib input stream */ + + FT_ULong start; /* starting position, after .gz header */ + FT_Byte input[FT_GZIP_BUFFER_SIZE]; /* input read buffer */ + + FT_Byte buffer[FT_GZIP_BUFFER_SIZE]; /* output buffer */ + FT_ULong pos; /* position in output */ + FT_Byte* cursor; + FT_Byte* limit; + + } FT_GZipFileRec, *FT_GZipFile; + + + /* gzip flag byte */ +#define FT_GZIP_ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +#define FT_GZIP_HEAD_CRC 0x02 /* bit 1 set: header CRC present */ +#define FT_GZIP_EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ +#define FT_GZIP_ORIG_NAME 0x08 /* bit 3 set: original file name present */ +#define FT_GZIP_COMMENT 0x10 /* bit 4 set: file comment present */ +#define FT_GZIP_RESERVED 0xE0 /* bits 5..7: reserved */ + + + /* check and skip .gz header - we don't support `transparent' compression */ + static FT_Error + ft_gzip_check_header( FT_Stream stream ) + { + FT_Error error; + FT_Byte head[4]; + + + if ( FT_STREAM_SEEK( 0 ) || + FT_STREAM_READ( head, 4 ) ) + goto Exit; + + /* head[0] && head[1] are the magic numbers; */ + /* head[2] is the method, and head[3] the flags */ + if ( head[0] != 0x1f || + head[1] != 0x8b || + head[2] != Z_DEFLATED || + (head[3] & FT_GZIP_RESERVED) ) + { + error = Gzip_Err_Invalid_File_Format; + goto Exit; + } + + /* skip time, xflags and os code */ + (void)FT_STREAM_SKIP( 6 ); + + /* skip the extra field */ + if ( head[3] & FT_GZIP_EXTRA_FIELD ) + { + FT_UInt len; + + + if ( FT_READ_USHORT_LE( len ) || + FT_STREAM_SKIP( len ) ) + goto Exit; + } + + /* skip original file name */ + if ( head[3] & FT_GZIP_ORIG_NAME ) + for (;;) + { + FT_UInt c; + + + if ( FT_READ_BYTE( c ) ) + goto Exit; + + if ( c == 0 ) + break; + } + + /* skip .gz comment */ + if ( head[3] & FT_GZIP_COMMENT ) + for (;;) + { + FT_UInt c; + + + if ( FT_READ_BYTE( c ) ) + goto Exit; + + if ( c == 0 ) + break; + } + + /* skip CRC */ + if ( head[3] & FT_GZIP_HEAD_CRC ) + if ( FT_STREAM_SKIP( 2 ) ) + goto Exit; + + Exit: + return error; + } + + + static FT_Error + ft_gzip_file_init( FT_GZipFile zip, + FT_Stream stream, + FT_Stream source ) + { + z_stream* zstream = &zip->zstream; + FT_Error error = Gzip_Err_Ok; + + + zip->stream = stream; + zip->source = source; + zip->memory = stream->memory; + + zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE; + zip->cursor = zip->limit; + zip->pos = 0; + + /* check and skip .gz header */ + { + stream = source; + + error = ft_gzip_check_header( stream ); + if ( error ) + goto Exit; + + zip->start = FT_STREAM_POS(); + } + + /* initialize zlib -- there is no zlib header in the compressed stream */ + zstream->zalloc = (alloc_func)ft_gzip_alloc; + zstream->zfree = (free_func) ft_gzip_free; + zstream->opaque = stream->memory; + + zstream->avail_in = 0; + zstream->next_in = zip->buffer; + + if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK || + zstream->next_in == NULL ) + error = Gzip_Err_Invalid_File_Format; + + Exit: + return error; + } + + + static void + ft_gzip_file_done( FT_GZipFile zip ) + { + z_stream* zstream = &zip->zstream; + + + inflateEnd( zstream ); + + /* clear the rest */ + zstream->zalloc = NULL; + zstream->zfree = NULL; + zstream->opaque = NULL; + zstream->next_in = NULL; + zstream->next_out = NULL; + zstream->avail_in = 0; + zstream->avail_out = 0; + + zip->memory = NULL; + zip->source = NULL; + zip->stream = NULL; + } + + + static FT_Error + ft_gzip_file_reset( FT_GZipFile zip ) + { + FT_Stream stream = zip->source; + FT_Error error; + + + if ( !FT_STREAM_SEEK( zip->start ) ) + { + z_stream* zstream = &zip->zstream; + + + inflateReset( zstream ); + + zstream->avail_in = 0; + zstream->next_in = zip->input; + zstream->avail_out = 0; + zstream->next_out = zip->buffer; + + zip->limit = zip->buffer + FT_GZIP_BUFFER_SIZE; + zip->cursor = zip->limit; + zip->pos = 0; + } + + return error; + } + + + static FT_Error + ft_gzip_file_fill_input( FT_GZipFile zip ) + { + z_stream* zstream = &zip->zstream; + FT_Stream stream = zip->source; + FT_ULong size; + + + if ( stream->read ) + { + size = stream->read( stream, stream->pos, zip->input, + FT_GZIP_BUFFER_SIZE ); + if ( size == 0 ) + return Gzip_Err_Invalid_Stream_Operation; + } + else + { + size = stream->size - stream->pos; + if ( size > FT_GZIP_BUFFER_SIZE ) + size = FT_GZIP_BUFFER_SIZE; + + if ( size == 0 ) + return Gzip_Err_Invalid_Stream_Operation; + + FT_MEM_COPY( zip->input, stream->base + stream->pos, size ); + } + stream->pos += size; + + zstream->next_in = zip->input; + zstream->avail_in = size; + + return Gzip_Err_Ok; + } + + + static FT_Error + ft_gzip_file_fill_output( FT_GZipFile zip ) + { + z_stream* zstream = &zip->zstream; + FT_Error error = 0; + + + zip->cursor = zip->buffer; + zstream->next_out = zip->cursor; + zstream->avail_out = FT_GZIP_BUFFER_SIZE; + + while ( zstream->avail_out > 0 ) + { + int err; + + + if ( zstream->avail_in == 0 ) + { + error = ft_gzip_file_fill_input( zip ); + if ( error ) + break; + } + + err = inflate( zstream, Z_NO_FLUSH ); + + if ( err == Z_STREAM_END ) + { + zip->limit = zstream->next_out; + if ( zip->limit == zip->cursor ) + error = Gzip_Err_Invalid_Stream_Operation; + break; + } + else if ( err != Z_OK ) + { + error = Gzip_Err_Invalid_Stream_Operation; + break; + } + } + + return error; + } + + + /* fill output buffer; `count' must be <= FT_GZIP_BUFFER_SIZE */ + static FT_Error + ft_gzip_file_skip_output( FT_GZipFile zip, + FT_ULong count ) + { + FT_Error error = Gzip_Err_Ok; + FT_ULong delta; + + + for (;;) + { + delta = (FT_ULong)( zip->limit - zip->cursor ); + if ( delta >= count ) + delta = count; + + zip->cursor += delta; + zip->pos += delta; + + count -= delta; + if ( count == 0 ) + break; + + error = ft_gzip_file_fill_output( zip ); + if ( error ) + break; + } + + return error; + } + + + static FT_ULong + ft_gzip_file_io( FT_GZipFile zip, + FT_ULong pos, + FT_Byte* buffer, + FT_ULong count ) + { + FT_ULong result = 0; + FT_Error error; + + + /* Reset inflate stream if we're seeking backwards. */ + /* Yes, that is not too efficient, but it saves memory :-) */ + if ( pos < zip->pos ) + { + error = ft_gzip_file_reset( zip ); + if ( error ) + goto Exit; + } + + /* skip unwanted bytes */ + if ( pos > zip->pos ) + { + error = ft_gzip_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) ); + if ( error ) + goto Exit; + } + + if ( count == 0 ) + goto Exit; + + /* now read the data */ + for (;;) + { + FT_ULong delta; + + + delta = (FT_ULong)( zip->limit - zip->cursor ); + if ( delta >= count ) + delta = count; + + FT_MEM_COPY( buffer, zip->cursor, delta ); + buffer += delta; + result += delta; + zip->cursor += delta; + zip->pos += delta; + + count -= delta; + if ( count == 0 ) + break; + + error = ft_gzip_file_fill_output( zip ); + if ( error ) + break; + } + + Exit: + return result; + } + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** G Z E M B E D D I N G S T R E A M *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + + static void + ft_gzip_stream_close( FT_Stream stream ) + { + FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer; + FT_Memory memory = stream->memory; + + + if ( zip ) + { + /* finalize gzip file descriptor */ + ft_gzip_file_done( zip ); + + FT_FREE( zip ); + + stream->descriptor.pointer = NULL; + } + } + + + static FT_ULong + ft_gzip_stream_io( FT_Stream stream, + FT_ULong pos, + FT_Byte* buffer, + FT_ULong count ) + { + FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer; + + + return ft_gzip_file_io( zip, pos, buffer, count ); + } + + + static FT_ULong + ft_gzip_get_uncompressed_size( FT_Stream stream ) + { + FT_Error error; + FT_ULong old_pos; + FT_ULong result = 0; + + + old_pos = stream->pos; + if ( !FT_Stream_Seek( stream, stream->size - 4 ) ) + { + result = (FT_ULong)FT_Stream_ReadLong( stream, &error ); + if ( error ) + result = 0; + + FT_Stream_Seek( stream, old_pos ); + } + + return result; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Stream_OpenGzip( FT_Stream stream, + FT_Stream source ) + { + FT_Error error; + FT_Memory memory = source->memory; + FT_GZipFile zip; + + + /* + * check the header right now; this prevents allocating un-necessary + * objects when we don't need them + */ + error = ft_gzip_check_header( source ); + if ( error ) + goto Exit; + + FT_ZERO( stream ); + stream->memory = memory; + + if ( !FT_QNEW( zip ) ) + { + error = ft_gzip_file_init( zip, stream, source ); + if ( error ) + { + FT_FREE( zip ); + goto Exit; + } + + stream->descriptor.pointer = zip; + } + + /* + * We use the following trick to try to dramatically improve the + * performance while dealing with small files. If the original stream + * size is less than a certain threshold, we try to load the whole font + * file into memory. This saves us from using the 32KB buffer needed + * to inflate the file, plus the two 4KB intermediate input/output + * buffers used in the `FT_GZipFile' structure. + */ + { + FT_ULong zip_size = ft_gzip_get_uncompressed_size( source ); + + + if ( zip_size != 0 && zip_size < 40 * 1024 ) + { + FT_Byte* zip_buff; + + + if ( !FT_ALLOC( zip_buff, zip_size ) ) + { + FT_ULong count; + + + count = ft_gzip_file_io( zip, 0, zip_buff, zip_size ); + if ( count == zip_size ) + { + ft_gzip_file_done( zip ); + FT_FREE( zip ); + + stream->descriptor.pointer = NULL; + + stream->size = zip_size; + stream->pos = 0; + stream->base = zip_buff; + stream->read = NULL; + stream->close = ft_gzip_stream_close; + + goto Exit; + } + + ft_gzip_file_io( zip, 0, NULL, 0 ); + FT_FREE( zip_buff ); + } + error = 0; + } + } + + stream->size = 0x7FFFFFFFL; /* don't know the real size! */ + stream->pos = 0; + stream->base = 0; + stream->read = ft_gzip_stream_io; + stream->close = ft_gzip_stream_close; + + Exit: + return error; + } + +#else /* !FT_CONFIG_OPTION_USE_ZLIB */ + + FT_EXPORT_DEF( FT_Error ) + FT_Stream_OpenGzip( FT_Stream stream, + FT_Stream source ) + { + FT_UNUSED( stream ); + FT_UNUSED( source ); + + return Gzip_Err_Unimplemented_Feature; + } + +#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/infblock.c b/reactos/dll/3rdparty/freetype/src/gzip/infblock.c index d6e2dc297da..0bc6bbc829d 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/infblock.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/infblock.c @@ -1,387 +1,387 @@ -/* infblock.c -- interpret and process block types to last block - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "infblock.h" -#include "inftrees.h" -#include "infcodes.h" -#include "infutil.h" - - -/* simplify the use of the inflate_huft type with some defines */ -#define exop word.what.Exop -#define bits word.what.Bits - -/* Table for deflate from PKZIP's appnote.txt. */ -local const uInt border[] = { /* Order of the bit length code lengths */ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - -/* - Notes beyond the 1.93a appnote.txt: - - 1. Distance pointers never point before the beginning of the output - stream. - 2. Distance pointers can point back across blocks, up to 32k away. - 3. There is an implied maximum of 7 bits for the bit length table and - 15 bits for the actual data. - 4. If only one code exists, then it is encoded using one bit. (Zero - would be more efficient, but perhaps a little confusing.) If two - codes exist, they are coded using one bit each (0 and 1). - 5. There is no way of sending zero distance codes--a dummy must be - sent if there are none. (History: a pre 2.0 version of PKZIP would - store blocks with no distance codes, but this was discovered to be - too harsh a criterion.) Valid only for 1.93a. 2.04c does allow - zero distance codes, which is sent as one code of zero bits in - length. - 6. There are up to 286 literal/length codes. Code 256 represents the - end-of-block. Note however that the static length tree defines - 288 codes just to fill out the Huffman codes. Codes 286 and 287 - cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. - However, static trees define 32 codes (all 5 bits) to fill out the - Huffman codes, but the last two had better not show up in the data. - 7. Unzip can check dynamic Huffman blocks for complete code sets. - The exception is that a single code would not be complete (see #4). - 8. The five bits following the block type is really the number of - literal codes sent minus 257. - 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits - (1+6+6). Therefore, to output three times the length, you output - three codes (1+1+1), whereas to output four times the same length, - you only need two codes (1+3). Hmm. - 10. In the tree reconstruction algorithm, Code = Code + Increment - only if BitLength(i) is not zero. (Pretty obvious.) - 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) - 12. Note: length code 284 can represent 227-258, but length code 285 - really is 258. The last length deserves its own, short code - since it gets used a lot in very redundant files. The length - 258 is special since 258 - 3 (the min match length) is 255. - 13. The literal/length and distance code bit lengths are read as a - single stream of lengths. It is possible (and advantageous) for - a repeat code (16, 17, or 18) to go across the boundary between - the two sets of lengths. - */ - - -local void inflate_blocks_reset( /* s, z, c) */ -inflate_blocks_statef *s, -z_streamp z, -uLongf *c ) -{ - if (c != Z_NULL) - *c = s->check; - if (s->mode == BTREE || s->mode == DTREE) - ZFREE(z, s->sub.trees.blens); - if (s->mode == CODES) - inflate_codes_free(s->sub.decode.codes, z); - s->mode = TYPE; - s->bitk = 0; - s->bitb = 0; - s->read = s->write = s->window; - if (s->checkfn != Z_NULL) - z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); - Tracev((stderr, "inflate: blocks reset\n")); -} - - -local inflate_blocks_statef *inflate_blocks_new( /* z, c, w) */ -z_streamp z, -check_func c, -uInt w ) -{ - inflate_blocks_statef *s; - - if ((s = (inflate_blocks_statef *)ZALLOC - (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) - return s; - if ((s->hufts = - (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) - { - ZFREE(z, s); - return Z_NULL; - } - if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL) - { - ZFREE(z, s->hufts); - ZFREE(z, s); - return Z_NULL; - } - s->end = s->window + w; - s->checkfn = c; - s->mode = TYPE; - Tracev((stderr, "inflate: blocks allocated\n")); - inflate_blocks_reset(s, z, Z_NULL); - return s; -} - - -local int inflate_blocks( /* s, z, r) */ -inflate_blocks_statef *s, -z_streamp z, -int r ) -{ - uInt t; /* temporary storage */ - uLong b; /* bit buffer */ - uInt k; /* bits in bit buffer */ - Bytef *p; /* input data pointer */ - uInt n; /* bytes available there */ - Bytef *q; /* output window write pointer */ - uInt m; /* bytes to end of window or read pointer */ - - /* copy input/output information to locals (UPDATE macro restores) */ - LOAD - - /* process input based on current state */ - while (1) switch (s->mode) - { - case TYPE: - NEEDBITS(3) - t = (uInt)b & 7; - s->last = t & 1; - switch (t >> 1) - { - case 0: /* stored */ - Tracev((stderr, "inflate: stored block%s\n", - s->last ? " (last)" : "")); - DUMPBITS(3) - t = k & 7; /* go to byte boundary */ - DUMPBITS(t) - s->mode = LENS; /* get length of stored block */ - break; - case 1: /* fixed */ - Tracev((stderr, "inflate: fixed codes block%s\n", - s->last ? " (last)" : "")); - { - uInt bl, bd; - inflate_huft *tl, *td; - - inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl, - (const inflate_huft**)&td, z); - s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); - if (s->sub.decode.codes == Z_NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - } - DUMPBITS(3) - s->mode = CODES; - break; - case 2: /* dynamic */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - s->last ? " (last)" : "")); - DUMPBITS(3) - s->mode = TABLE; - break; - case 3: /* illegal */ - DUMPBITS(3) - s->mode = BAD; - z->msg = (char*)"invalid block type"; - r = Z_DATA_ERROR; - LEAVE - } - break; - case LENS: - NEEDBITS(32) - if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) - { - s->mode = BAD; - z->msg = (char*)"invalid stored block lengths"; - r = Z_DATA_ERROR; - LEAVE - } - s->sub.left = (uInt)b & 0xffff; - b = k = 0; /* dump bits */ - Tracev((stderr, "inflate: stored length %u\n", s->sub.left)); - s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); - break; - case STORED: - if (n == 0) - LEAVE - NEEDOUT - t = s->sub.left; - if (t > n) t = n; - if (t > m) t = m; - zmemcpy(q, p, t); - p += t; n -= t; - q += t; m -= t; - if ((s->sub.left -= t) != 0) - break; - Tracev((stderr, "inflate: stored end, %lu total out\n", - z->total_out + (q >= s->read ? q - s->read : - (s->end - s->read) + (q - s->window)))); - s->mode = s->last ? DRY : TYPE; - break; - case TABLE: - NEEDBITS(14) - s->sub.trees.table = t = (uInt)b & 0x3fff; -#ifndef PKZIP_BUG_WORKAROUND - if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) - { - s->mode = BAD; - z->msg = (char*)"too many length or distance symbols"; - r = Z_DATA_ERROR; - LEAVE - } -#endif - t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); - if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - DUMPBITS(14) - s->sub.trees.index = 0; - Tracev((stderr, "inflate: table sizes ok\n")); - s->mode = BTREE; - case BTREE: - while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) - { - NEEDBITS(3) - s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; - DUMPBITS(3) - } - while (s->sub.trees.index < 19) - s->sub.trees.blens[border[s->sub.trees.index++]] = 0; - s->sub.trees.bb = 7; - t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, - &s->sub.trees.tb, s->hufts, z); - if (t != Z_OK) - { - r = t; - if (r == Z_DATA_ERROR) - { - ZFREE(z, s->sub.trees.blens); - s->mode = BAD; - } - LEAVE - } - s->sub.trees.index = 0; - Tracev((stderr, "inflate: bits tree ok\n")); - s->mode = DTREE; - case DTREE: - while (t = s->sub.trees.table, - s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) - { - inflate_huft *h; - uInt i, j, c; - - t = s->sub.trees.bb; - NEEDBITS(t) - h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); - t = h->bits; - c = h->base; - if (c < 16) - { - DUMPBITS(t) - s->sub.trees.blens[s->sub.trees.index++] = c; - } - else /* c == 16..18 */ - { - i = c == 18 ? 7 : c - 14; - j = c == 18 ? 11 : 3; - NEEDBITS(t + i) - DUMPBITS(t) - j += (uInt)b & inflate_mask[i]; - DUMPBITS(i) - i = s->sub.trees.index; - t = s->sub.trees.table; - if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || - (c == 16 && i < 1)) - { - ZFREE(z, s->sub.trees.blens); - s->mode = BAD; - z->msg = (char*)"invalid bit length repeat"; - r = Z_DATA_ERROR; - LEAVE - } - c = c == 16 ? s->sub.trees.blens[i - 1] : 0; - do { - s->sub.trees.blens[i++] = c; - } while (--j); - s->sub.trees.index = i; - } - } - s->sub.trees.tb = Z_NULL; - { - uInt bl, bd; - inflate_huft *tl, *td; - inflate_codes_statef *c; - - bl = 9; /* must be <= 9 for lookahead assumptions */ - bd = 6; /* must be <= 9 for lookahead assumptions */ - t = s->sub.trees.table; - t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), - s->sub.trees.blens, &bl, &bd, &tl, &td, - s->hufts, z); - if (t != Z_OK) - { - if (t == (uInt)Z_DATA_ERROR) - { - ZFREE(z, s->sub.trees.blens); - s->mode = BAD; - } - r = t; - LEAVE - } - Tracev((stderr, "inflate: trees ok\n")); - if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - s->sub.decode.codes = c; - } - ZFREE(z, s->sub.trees.blens); - s->mode = CODES; - case CODES: - UPDATE - if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) - return inflate_flush(s, z, r); - r = Z_OK; - inflate_codes_free(s->sub.decode.codes, z); - LOAD - Tracev((stderr, "inflate: codes end, %lu total out\n", - z->total_out + (q >= s->read ? q - s->read : - (s->end - s->read) + (q - s->window)))); - if (!s->last) - { - s->mode = TYPE; - break; - } - s->mode = DRY; - case DRY: - FLUSH - if (s->read != s->write) - LEAVE - s->mode = DONE; - case DONE: - r = Z_STREAM_END; - LEAVE - case BAD: - r = Z_DATA_ERROR; - LEAVE - default: - r = Z_STREAM_ERROR; - LEAVE - } -#ifdef NEED_DUMMY_RETURN - return 0; -#endif -} - - -local int inflate_blocks_free( /* s, z) */ -inflate_blocks_statef *s, -z_streamp z ) -{ - inflate_blocks_reset(s, z, Z_NULL); - ZFREE(z, s->window); - ZFREE(z, s->hufts); - ZFREE(z, s); - Tracev((stderr, "inflate: blocks freed\n")); - return Z_OK; -} - - +/* infblock.c -- interpret and process block types to last block + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" +#include "inftrees.h" +#include "infcodes.h" +#include "infutil.h" + + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +/* Table for deflate from PKZIP's appnote.txt. */ +local const uInt border[] = { /* Order of the bit length code lengths */ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* + Notes beyond the 1.93a appnote.txt: + + 1. Distance pointers never point before the beginning of the output + stream. + 2. Distance pointers can point back across blocks, up to 32k away. + 3. There is an implied maximum of 7 bits for the bit length table and + 15 bits for the actual data. + 4. If only one code exists, then it is encoded using one bit. (Zero + would be more efficient, but perhaps a little confusing.) If two + codes exist, they are coded using one bit each (0 and 1). + 5. There is no way of sending zero distance codes--a dummy must be + sent if there are none. (History: a pre 2.0 version of PKZIP would + store blocks with no distance codes, but this was discovered to be + too harsh a criterion.) Valid only for 1.93a. 2.04c does allow + zero distance codes, which is sent as one code of zero bits in + length. + 6. There are up to 286 literal/length codes. Code 256 represents the + end-of-block. Note however that the static length tree defines + 288 codes just to fill out the Huffman codes. Codes 286 and 287 + cannot be used though, since there is no length base or extra bits + defined for them. Similarily, there are up to 30 distance codes. + However, static trees define 32 codes (all 5 bits) to fill out the + Huffman codes, but the last two had better not show up in the data. + 7. Unzip can check dynamic Huffman blocks for complete code sets. + The exception is that a single code would not be complete (see #4). + 8. The five bits following the block type is really the number of + literal codes sent minus 257. + 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits + (1+6+6). Therefore, to output three times the length, you output + three codes (1+1+1), whereas to output four times the same length, + you only need two codes (1+3). Hmm. + 10. In the tree reconstruction algorithm, Code = Code + Increment + only if BitLength(i) is not zero. (Pretty obvious.) + 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) + 12. Note: length code 284 can represent 227-258, but length code 285 + really is 258. The last length deserves its own, short code + since it gets used a lot in very redundant files. The length + 258 is special since 258 - 3 (the min match length) is 255. + 13. The literal/length and distance code bit lengths are read as a + single stream of lengths. It is possible (and advantageous) for + a repeat code (16, 17, or 18) to go across the boundary between + the two sets of lengths. + */ + + +local void inflate_blocks_reset( /* s, z, c) */ +inflate_blocks_statef *s, +z_streamp z, +uLongf *c ) +{ + if (c != Z_NULL) + *c = s->check; + if (s->mode == BTREE || s->mode == DTREE) + ZFREE(z, s->sub.trees.blens); + if (s->mode == CODES) + inflate_codes_free(s->sub.decode.codes, z); + s->mode = TYPE; + s->bitk = 0; + s->bitb = 0; + s->read = s->write = s->window; + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); + Tracev((stderr, "inflate: blocks reset\n")); +} + + +local inflate_blocks_statef *inflate_blocks_new( /* z, c, w) */ +z_streamp z, +check_func c, +uInt w ) +{ + inflate_blocks_statef *s; + + if ((s = (inflate_blocks_statef *)ZALLOC + (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) + return s; + if ((s->hufts = + (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) + { + ZFREE(z, s); + return Z_NULL; + } + if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL) + { + ZFREE(z, s->hufts); + ZFREE(z, s); + return Z_NULL; + } + s->end = s->window + w; + s->checkfn = c; + s->mode = TYPE; + Tracev((stderr, "inflate: blocks allocated\n")); + inflate_blocks_reset(s, z, Z_NULL); + return s; +} + + +local int inflate_blocks( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) +{ + uInt t; /* temporary storage */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input based on current state */ + while (1) switch (s->mode) + { + case TYPE: + NEEDBITS(3) + t = (uInt)b & 7; + s->last = t & 1; + switch (t >> 1) + { + case 0: /* stored */ + Tracev((stderr, "inflate: stored block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + t = k & 7; /* go to byte boundary */ + DUMPBITS(t) + s->mode = LENS; /* get length of stored block */ + break; + case 1: /* fixed */ + Tracev((stderr, "inflate: fixed codes block%s\n", + s->last ? " (last)" : "")); + { + uInt bl, bd; + inflate_huft *tl, *td; + + inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl, + (const inflate_huft**)&td, z); + s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); + if (s->sub.decode.codes == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + } + DUMPBITS(3) + s->mode = CODES; + break; + case 2: /* dynamic */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + s->last ? " (last)" : "")); + DUMPBITS(3) + s->mode = TABLE; + break; + case 3: /* illegal */ + DUMPBITS(3) + s->mode = BAD; + z->msg = (char*)"invalid block type"; + r = Z_DATA_ERROR; + LEAVE + } + break; + case LENS: + NEEDBITS(32) + if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) + { + s->mode = BAD; + z->msg = (char*)"invalid stored block lengths"; + r = Z_DATA_ERROR; + LEAVE + } + s->sub.left = (uInt)b & 0xffff; + b = k = 0; /* dump bits */ + Tracev((stderr, "inflate: stored length %u\n", s->sub.left)); + s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); + break; + case STORED: + if (n == 0) + LEAVE + NEEDOUT + t = s->sub.left; + if (t > n) t = n; + if (t > m) t = m; + zmemcpy(q, p, t); + p += t; n -= t; + q += t; m -= t; + if ((s->sub.left -= t) != 0) + break; + Tracev((stderr, "inflate: stored end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + s->mode = s->last ? DRY : TYPE; + break; + case TABLE: + NEEDBITS(14) + s->sub.trees.table = t = (uInt)b & 0x3fff; +#ifndef PKZIP_BUG_WORKAROUND + if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) + { + s->mode = BAD; + z->msg = (char*)"too many length or distance symbols"; + r = Z_DATA_ERROR; + LEAVE + } +#endif + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + DUMPBITS(14) + s->sub.trees.index = 0; + Tracev((stderr, "inflate: table sizes ok\n")); + s->mode = BTREE; + case BTREE: + while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) + { + NEEDBITS(3) + s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; + DUMPBITS(3) + } + while (s->sub.trees.index < 19) + s->sub.trees.blens[border[s->sub.trees.index++]] = 0; + s->sub.trees.bb = 7; + t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, + &s->sub.trees.tb, s->hufts, z); + if (t != Z_OK) + { + r = t; + if (r == Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + } + LEAVE + } + s->sub.trees.index = 0; + Tracev((stderr, "inflate: bits tree ok\n")); + s->mode = DTREE; + case DTREE: + while (t = s->sub.trees.table, + s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) + { + inflate_huft *h; + uInt i, j, c; + + t = s->sub.trees.bb; + NEEDBITS(t) + h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); + t = h->bits; + c = h->base; + if (c < 16) + { + DUMPBITS(t) + s->sub.trees.blens[s->sub.trees.index++] = c; + } + else /* c == 16..18 */ + { + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + NEEDBITS(t + i) + DUMPBITS(t) + j += (uInt)b & inflate_mask[i]; + DUMPBITS(i) + i = s->sub.trees.index; + t = s->sub.trees.table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || + (c == 16 && i < 1)) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + z->msg = (char*)"invalid bit length repeat"; + r = Z_DATA_ERROR; + LEAVE + } + c = c == 16 ? s->sub.trees.blens[i - 1] : 0; + do { + s->sub.trees.blens[i++] = c; + } while (--j); + s->sub.trees.index = i; + } + } + s->sub.trees.tb = Z_NULL; + { + uInt bl, bd; + inflate_huft *tl, *td; + inflate_codes_statef *c; + + bl = 9; /* must be <= 9 for lookahead assumptions */ + bd = 6; /* must be <= 9 for lookahead assumptions */ + t = s->sub.trees.table; + t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), + s->sub.trees.blens, &bl, &bd, &tl, &td, + s->hufts, z); + if (t != Z_OK) + { + if (t == (uInt)Z_DATA_ERROR) + { + ZFREE(z, s->sub.trees.blens); + s->mode = BAD; + } + r = t; + LEAVE + } + Tracev((stderr, "inflate: trees ok\n")); + if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) + { + r = Z_MEM_ERROR; + LEAVE + } + s->sub.decode.codes = c; + } + ZFREE(z, s->sub.trees.blens); + s->mode = CODES; + case CODES: + UPDATE + if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) + return inflate_flush(s, z, r); + r = Z_OK; + inflate_codes_free(s->sub.decode.codes, z); + LOAD + Tracev((stderr, "inflate: codes end, %lu total out\n", + z->total_out + (q >= s->read ? q - s->read : + (s->end - s->read) + (q - s->window)))); + if (!s->last) + { + s->mode = TYPE; + break; + } + s->mode = DRY; + case DRY: + FLUSH + if (s->read != s->write) + LEAVE + s->mode = DONE; + case DONE: + r = Z_STREAM_END; + LEAVE + case BAD: + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +#ifdef NEED_DUMMY_RETURN + return 0; +#endif +} + + +local int inflate_blocks_free( /* s, z) */ +inflate_blocks_statef *s, +z_streamp z ) +{ + inflate_blocks_reset(s, z, Z_NULL); + ZFREE(z, s->window); + ZFREE(z, s->hufts); + ZFREE(z, s); + Tracev((stderr, "inflate: blocks freed\n")); + return Z_OK; +} + + diff --git a/reactos/dll/3rdparty/freetype/src/gzip/infblock.h b/reactos/dll/3rdparty/freetype/src/gzip/infblock.h index c2535a1e452..93038aecdab 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/infblock.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/infblock.h @@ -1,36 +1,36 @@ -/* infblock.h -- header to use infblock.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -#ifndef _INFBLOCK_H -#define _INFBLOCK_H - -struct inflate_blocks_state; -typedef struct inflate_blocks_state FAR inflate_blocks_statef; - -local inflate_blocks_statef * inflate_blocks_new OF(( - z_streamp z, - check_func c, /* check function */ - uInt w)); /* window size */ - -local int inflate_blocks OF(( - inflate_blocks_statef *, - z_streamp , - int)); /* initial return code */ - -local void inflate_blocks_reset OF(( - inflate_blocks_statef *, - z_streamp , - uLongf *)); /* check value on output */ - -local int inflate_blocks_free OF(( - inflate_blocks_statef *, - z_streamp)); - -#endif /* _INFBLOCK_H */ +/* infblock.h -- header to use infblock.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFBLOCK_H +#define _INFBLOCK_H + +struct inflate_blocks_state; +typedef struct inflate_blocks_state FAR inflate_blocks_statef; + +local inflate_blocks_statef * inflate_blocks_new OF(( + z_streamp z, + check_func c, /* check function */ + uInt w)); /* window size */ + +local int inflate_blocks OF(( + inflate_blocks_statef *, + z_streamp , + int)); /* initial return code */ + +local void inflate_blocks_reset OF(( + inflate_blocks_statef *, + z_streamp , + uLongf *)); /* check value on output */ + +local int inflate_blocks_free OF(( + inflate_blocks_statef *, + z_streamp)); + +#endif /* _INFBLOCK_H */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/infcodes.c b/reactos/dll/3rdparty/freetype/src/gzip/infcodes.c index f7bfd58c4ff..6500f8d189c 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/infcodes.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/infcodes.c @@ -1,250 +1,250 @@ -/* infcodes.c -- process literals and length/distance pairs - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" -#include "infblock.h" -#include "infcodes.h" -#include "infutil.h" - -/* simplify the use of the inflate_huft type with some defines */ -#define exop word.what.Exop -#define bits word.what.Bits - -typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ - START, /* x: set up for LEN */ - LEN, /* i: get length/literal/eob next */ - LENEXT, /* i: getting length extra (have base) */ - DIST, /* i: get distance next */ - DISTEXT, /* i: getting distance extra */ - COPY, /* o: copying bytes in window, waiting for space */ - LIT, /* o: got literal, waiting for output space */ - WASH, /* o: got eob, possibly still output waiting */ - END, /* x: got eob and all data flushed */ - BADCODE} /* x: got error */ -inflate_codes_mode; - -/* inflate codes private state */ -struct inflate_codes_state { - - /* mode */ - inflate_codes_mode mode; /* current inflate_codes mode */ - - /* mode dependent information */ - uInt len; - union { - struct { - inflate_huft *tree; /* pointer into tree */ - uInt need; /* bits needed */ - } code; /* if LEN or DIST, where in tree */ - uInt lit; /* if LIT, literal */ - struct { - uInt get; /* bits to get for extra */ - uInt dist; /* distance back to copy from */ - } copy; /* if EXT or COPY, where and how much */ - } sub; /* submode */ - - /* mode independent information */ - Byte lbits; /* ltree bits decoded per branch */ - Byte dbits; /* dtree bits decoder per branch */ - inflate_huft *ltree; /* literal/length/eob tree */ - inflate_huft *dtree; /* distance tree */ - -}; - - -local inflate_codes_statef *inflate_codes_new( /* bl, bd, tl, td, z) */ -uInt bl, uInt bd, -inflate_huft *tl, -inflate_huft *td, /* need separate declaration for Borland C++ */ -z_streamp z ) -{ - inflate_codes_statef *c; - - if ((c = (inflate_codes_statef *) - ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL) - { - c->mode = START; - c->lbits = (Byte)bl; - c->dbits = (Byte)bd; - c->ltree = tl; - c->dtree = td; - Tracev((stderr, "inflate: codes new\n")); - } - return c; -} - - -local int inflate_codes( /* s, z, r) */ -inflate_blocks_statef *s, -z_streamp z, -int r ) -{ - uInt j; /* temporary storage */ - inflate_huft *t; /* temporary pointer */ - uInt e; /* extra bits or operation */ - uLong b; /* bit buffer */ - uInt k; /* bits in bit buffer */ - Bytef *p; /* input data pointer */ - uInt n; /* bytes available there */ - Bytef *q; /* output window write pointer */ - uInt m; /* bytes to end of window or read pointer */ - Bytef *f; /* pointer to copy strings from */ - inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ - - /* copy input/output information to locals (UPDATE macro restores) */ - LOAD - - /* process input and output based on current state */ - while (1) switch (c->mode) - { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ - case START: /* x: set up for LEN */ -#ifndef SLOW - if (m >= 258 && n >= 10) - { - UPDATE - r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); - LOAD - if (r != Z_OK) - { - c->mode = r == Z_STREAM_END ? WASH : BADCODE; - break; - } - } -#endif /* !SLOW */ - c->sub.code.need = c->lbits; - c->sub.code.tree = c->ltree; - c->mode = LEN; - case LEN: /* i: get length/literal/eob next */ - j = c->sub.code.need; - NEEDBITS(j) - t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); - DUMPBITS(t->bits) - e = (uInt)(t->exop); - if (e == 0) /* literal */ - { - c->sub.lit = t->base; - Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", t->base)); - c->mode = LIT; - break; - } - if (e & 16) /* length */ - { - c->sub.copy.get = e & 15; - c->len = t->base; - c->mode = LENEXT; - break; - } - if ((e & 64) == 0) /* next table */ - { - c->sub.code.need = e; - c->sub.code.tree = t + t->base; - break; - } - if (e & 32) /* end of block */ - { - Tracevv((stderr, "inflate: end of block\n")); - c->mode = WASH; - break; - } - c->mode = BADCODE; /* invalid code */ - z->msg = (char*)"invalid literal/length code"; - r = Z_DATA_ERROR; - LEAVE - case LENEXT: /* i: getting length extra (have base) */ - j = c->sub.copy.get; - NEEDBITS(j) - c->len += (uInt)b & inflate_mask[j]; - DUMPBITS(j) - c->sub.code.need = c->dbits; - c->sub.code.tree = c->dtree; - Tracevv((stderr, "inflate: length %u\n", c->len)); - c->mode = DIST; - case DIST: /* i: get distance next */ - j = c->sub.code.need; - NEEDBITS(j) - t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); - DUMPBITS(t->bits) - e = (uInt)(t->exop); - if (e & 16) /* distance */ - { - c->sub.copy.get = e & 15; - c->sub.copy.dist = t->base; - c->mode = DISTEXT; - break; - } - if ((e & 64) == 0) /* next table */ - { - c->sub.code.need = e; - c->sub.code.tree = t + t->base; - break; - } - c->mode = BADCODE; /* invalid code */ - z->msg = (char*)"invalid distance code"; - r = Z_DATA_ERROR; - LEAVE - case DISTEXT: /* i: getting distance extra */ - j = c->sub.copy.get; - NEEDBITS(j) - c->sub.copy.dist += (uInt)b & inflate_mask[j]; - DUMPBITS(j) - Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist)); - c->mode = COPY; - case COPY: /* o: copying bytes in window, waiting for space */ - f = q - c->sub.copy.dist; - while (f < s->window) /* modulo window size-"while" instead */ - f += s->end - s->window; /* of "if" handles invalid distances */ - while (c->len) - { - NEEDOUT - OUTBYTE(*f++) - if (f == s->end) - f = s->window; - c->len--; - } - c->mode = START; - break; - case LIT: /* o: got literal, waiting for output space */ - NEEDOUT - OUTBYTE(c->sub.lit) - c->mode = START; - break; - case WASH: /* o: got eob, possibly more output */ - if (k > 7) /* return unused byte, if any */ - { - Assert(k < 16, "inflate_codes grabbed too many bytes") - k -= 8; - n++; - p--; /* can always return one */ - } - FLUSH - if (s->read != s->write) - LEAVE - c->mode = END; - case END: - r = Z_STREAM_END; - LEAVE - case BADCODE: /* x: got error */ - r = Z_DATA_ERROR; - LEAVE - default: - r = Z_STREAM_ERROR; - LEAVE - } -#ifdef NEED_DUMMY_RETURN - return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ -#endif -} - - -local void inflate_codes_free( /* c, z) */ -inflate_codes_statef *c, -z_streamp z ) -{ - ZFREE(z, c); - Tracev((stderr, "inflate: codes free\n")); -} +/* infcodes.c -- process literals and length/distance pairs + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" +#include "infblock.h" +#include "infcodes.h" +#include "infutil.h" + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + +typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + START, /* x: set up for LEN */ + LEN, /* i: get length/literal/eob next */ + LENEXT, /* i: getting length extra (have base) */ + DIST, /* i: get distance next */ + DISTEXT, /* i: getting distance extra */ + COPY, /* o: copying bytes in window, waiting for space */ + LIT, /* o: got literal, waiting for output space */ + WASH, /* o: got eob, possibly still output waiting */ + END, /* x: got eob and all data flushed */ + BADCODE} /* x: got error */ +inflate_codes_mode; + +/* inflate codes private state */ +struct inflate_codes_state { + + /* mode */ + inflate_codes_mode mode; /* current inflate_codes mode */ + + /* mode dependent information */ + uInt len; + union { + struct { + inflate_huft *tree; /* pointer into tree */ + uInt need; /* bits needed */ + } code; /* if LEN or DIST, where in tree */ + uInt lit; /* if LIT, literal */ + struct { + uInt get; /* bits to get for extra */ + uInt dist; /* distance back to copy from */ + } copy; /* if EXT or COPY, where and how much */ + } sub; /* submode */ + + /* mode independent information */ + Byte lbits; /* ltree bits decoded per branch */ + Byte dbits; /* dtree bits decoder per branch */ + inflate_huft *ltree; /* literal/length/eob tree */ + inflate_huft *dtree; /* distance tree */ + +}; + + +local inflate_codes_statef *inflate_codes_new( /* bl, bd, tl, td, z) */ +uInt bl, uInt bd, +inflate_huft *tl, +inflate_huft *td, /* need separate declaration for Borland C++ */ +z_streamp z ) +{ + inflate_codes_statef *c; + + if ((c = (inflate_codes_statef *) + ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL) + { + c->mode = START; + c->lbits = (Byte)bl; + c->dbits = (Byte)bd; + c->ltree = tl; + c->dtree = td; + Tracev((stderr, "inflate: codes new\n")); + } + return c; +} + + +local int inflate_codes( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) +{ + uInt j; /* temporary storage */ + inflate_huft *t; /* temporary pointer */ + uInt e; /* extra bits or operation */ + uLong b; /* bit buffer */ + uInt k; /* bits in bit buffer */ + Bytef *p; /* input data pointer */ + uInt n; /* bytes available there */ + Bytef *q; /* output window write pointer */ + uInt m; /* bytes to end of window or read pointer */ + Bytef *f; /* pointer to copy strings from */ + inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ + + /* copy input/output information to locals (UPDATE macro restores) */ + LOAD + + /* process input and output based on current state */ + while (1) switch (c->mode) + { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */ + case START: /* x: set up for LEN */ +#ifndef SLOW + if (m >= 258 && n >= 10) + { + UPDATE + r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); + LOAD + if (r != Z_OK) + { + c->mode = r == Z_STREAM_END ? WASH : BADCODE; + break; + } + } +#endif /* !SLOW */ + c->sub.code.need = c->lbits; + c->sub.code.tree = c->ltree; + c->mode = LEN; + case LEN: /* i: get length/literal/eob next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e == 0) /* literal */ + { + c->sub.lit = t->base; + Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", t->base)); + c->mode = LIT; + break; + } + if (e & 16) /* length */ + { + c->sub.copy.get = e & 15; + c->len = t->base; + c->mode = LENEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + if (e & 32) /* end of block */ + { + Tracevv((stderr, "inflate: end of block\n")); + c->mode = WASH; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid literal/length code"; + r = Z_DATA_ERROR; + LEAVE + case LENEXT: /* i: getting length extra (have base) */ + j = c->sub.copy.get; + NEEDBITS(j) + c->len += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + c->sub.code.need = c->dbits; + c->sub.code.tree = c->dtree; + Tracevv((stderr, "inflate: length %u\n", c->len)); + c->mode = DIST; + case DIST: /* i: get distance next */ + j = c->sub.code.need; + NEEDBITS(j) + t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + DUMPBITS(t->bits) + e = (uInt)(t->exop); + if (e & 16) /* distance */ + { + c->sub.copy.get = e & 15; + c->sub.copy.dist = t->base; + c->mode = DISTEXT; + break; + } + if ((e & 64) == 0) /* next table */ + { + c->sub.code.need = e; + c->sub.code.tree = t + t->base; + break; + } + c->mode = BADCODE; /* invalid code */ + z->msg = (char*)"invalid distance code"; + r = Z_DATA_ERROR; + LEAVE + case DISTEXT: /* i: getting distance extra */ + j = c->sub.copy.get; + NEEDBITS(j) + c->sub.copy.dist += (uInt)b & inflate_mask[j]; + DUMPBITS(j) + Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist)); + c->mode = COPY; + case COPY: /* o: copying bytes in window, waiting for space */ + f = q - c->sub.copy.dist; + while (f < s->window) /* modulo window size-"while" instead */ + f += s->end - s->window; /* of "if" handles invalid distances */ + while (c->len) + { + NEEDOUT + OUTBYTE(*f++) + if (f == s->end) + f = s->window; + c->len--; + } + c->mode = START; + break; + case LIT: /* o: got literal, waiting for output space */ + NEEDOUT + OUTBYTE(c->sub.lit) + c->mode = START; + break; + case WASH: /* o: got eob, possibly more output */ + if (k > 7) /* return unused byte, if any */ + { + Assert(k < 16, "inflate_codes grabbed too many bytes") + k -= 8; + n++; + p--; /* can always return one */ + } + FLUSH + if (s->read != s->write) + LEAVE + c->mode = END; + case END: + r = Z_STREAM_END; + LEAVE + case BADCODE: /* x: got error */ + r = Z_DATA_ERROR; + LEAVE + default: + r = Z_STREAM_ERROR; + LEAVE + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + + +local void inflate_codes_free( /* c, z) */ +inflate_codes_statef *c, +z_streamp z ) +{ + ZFREE(z, c); + Tracev((stderr, "inflate: codes free\n")); +} diff --git a/reactos/dll/3rdparty/freetype/src/gzip/infcodes.h b/reactos/dll/3rdparty/freetype/src/gzip/infcodes.h index 154d7f896ca..f53fdafbb56 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/infcodes.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/infcodes.h @@ -1,31 +1,31 @@ -/* infcodes.h -- header to use infcodes.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -#ifndef _INFCODES_H -#define _INFCODES_H - -struct inflate_codes_state; -typedef struct inflate_codes_state FAR inflate_codes_statef; - -local inflate_codes_statef *inflate_codes_new OF(( - uInt, uInt, - inflate_huft *, inflate_huft *, - z_streamp )); - -local int inflate_codes OF(( - inflate_blocks_statef *, - z_streamp , - int)); - -local void inflate_codes_free OF(( - inflate_codes_statef *, - z_streamp )); - -#endif /* _INFCODES_H */ +/* infcodes.h -- header to use infcodes.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFCODES_H +#define _INFCODES_H + +struct inflate_codes_state; +typedef struct inflate_codes_state FAR inflate_codes_statef; + +local inflate_codes_statef *inflate_codes_new OF(( + uInt, uInt, + inflate_huft *, inflate_huft *, + z_streamp )); + +local int inflate_codes OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +local void inflate_codes_free OF(( + inflate_codes_statef *, + z_streamp )); + +#endif /* _INFCODES_H */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/inffixed.h b/reactos/dll/3rdparty/freetype/src/gzip/inffixed.h index 4d4760ea00e..fd999929621 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/inffixed.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/inffixed.h @@ -1,151 +1,151 @@ -/* inffixed.h -- table for decoding fixed codes - * Generated automatically by the maketree.c program - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -local const uInt fixed_bl = 9; -local const uInt fixed_bd = 5; -local const inflate_huft fixed_tl[] = { - {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, - {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, - {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, - {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, - {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, - {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, - {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, - {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, - {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, - {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, - {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, - {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, - {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, - {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, - {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, - {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, - {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, - {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, - {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, - {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, - {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, - {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, - {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, - {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, - {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, - {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, - {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, - {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, - {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, - {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, - {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, - {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, - {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, - {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, - {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, - {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, - {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, - {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, - {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, - {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, - {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, - {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, - {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, - {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, - {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, - {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, - {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, - {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, - {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, - {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, - {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, - {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, - {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, - {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, - {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, - {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, - {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, - {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, - {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, - {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, - {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, - {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, - {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, - {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, - {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, - {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, - {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, - {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, - {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, - {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, - {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, - {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, - {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, - {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, - {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, - {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, - {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, - {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, - {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, - {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, - {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, - {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, - {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, - {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, - {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, - {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, - {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, - {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, - {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, - {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, - {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, - {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, - {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, - {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, - {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, - {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, - {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, - {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, - {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, - {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, - {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, - {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, - {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, - {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, - {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, - {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, - {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, - {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, - {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, - {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, - {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, - {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, - {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, - {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, - {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, - {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, - {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, - {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, - {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, - {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, - {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, - {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, - {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, - {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, - {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} - }; -local const inflate_huft fixed_td[] = { - {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, - {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, - {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, - {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, - {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, - {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, - {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, - {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} - }; +/* inffixed.h -- table for decoding fixed codes + * Generated automatically by the maketree.c program + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +local const uInt fixed_bl = 9; +local const uInt fixed_bd = 5; +local const inflate_huft fixed_tl[] = { + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254}, + {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115}, + {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193}, + {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161}, + {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225}, + {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145}, + {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209}, + {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177}, + {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241}, + {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227}, + {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201}, + {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169}, + {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233}, + {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153}, + {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217}, + {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185}, + {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249}, + {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163}, + {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197}, + {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165}, + {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229}, + {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149}, + {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213}, + {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181}, + {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245}, + {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205}, + {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173}, + {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237}, + {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157}, + {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221}, + {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189}, + {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253}, + {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131}, + {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195}, + {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163}, + {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227}, + {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147}, + {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211}, + {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179}, + {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243}, + {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258}, + {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203}, + {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171}, + {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235}, + {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155}, + {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219}, + {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187}, + {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251}, + {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195}, + {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199}, + {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167}, + {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231}, + {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151}, + {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215}, + {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183}, + {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247}, + {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0}, + {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207}, + {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175}, + {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239}, + {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159}, + {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223}, + {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191}, + {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255} + }; +local const inflate_huft fixed_td[] = { + {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097}, + {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385}, + {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193}, + {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577}, + {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145}, + {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577}, + {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289}, + {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577} + }; diff --git a/reactos/dll/3rdparty/freetype/src/gzip/inflate.c b/reactos/dll/3rdparty/freetype/src/gzip/inflate.c index 8877fa3eb2b..64f68325cbc 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/inflate.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/inflate.c @@ -1,273 +1,273 @@ -/* inflate.c -- zlib interface to inflate modules - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "infblock.h" - -#define DONE INFLATE_DONE -#define BAD INFLATE_BAD - -typedef enum { - METHOD, /* waiting for method byte */ - FLAG, /* waiting for flag byte */ - DICT4, /* four dictionary check bytes to go */ - DICT3, /* three dictionary check bytes to go */ - DICT2, /* two dictionary check bytes to go */ - DICT1, /* one dictionary check byte to go */ - DICT0, /* waiting for inflateSetDictionary */ - BLOCKS, /* decompressing blocks */ - CHECK4, /* four check bytes to go */ - CHECK3, /* three check bytes to go */ - CHECK2, /* two check bytes to go */ - CHECK1, /* one check byte to go */ - DONE, /* finished check, done */ - BAD} /* got an error--stay here */ -inflate_mode; - -/* inflate private state */ -struct internal_state { - - /* mode */ - inflate_mode mode; /* current inflate mode */ - - /* mode dependent information */ - union { - uInt method; /* if FLAGS, method byte */ - struct { - uLong was; /* computed check value */ - uLong need; /* stream check value */ - } check; /* if CHECK, check values to compare */ - uInt marker; /* if BAD, inflateSync's marker bytes count */ - } sub; /* submode */ - - /* mode independent information */ - int nowrap; /* flag for no wrapper */ - uInt wbits; /* log2(window size) (8..15, defaults to 15) */ - inflate_blocks_statef - *blocks; /* current inflate_blocks state */ - -}; - - -ZEXPORT(int) inflateReset( /* z) */ -z_streamp z ) -{ - if (z == Z_NULL || z->state == Z_NULL) - return Z_STREAM_ERROR; - z->total_in = z->total_out = 0; - z->msg = Z_NULL; - z->state->mode = z->state->nowrap ? BLOCKS : METHOD; - inflate_blocks_reset(z->state->blocks, z, Z_NULL); - Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - - -ZEXPORT(int) inflateEnd( /* z) */ -z_streamp z ) -{ - if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) - return Z_STREAM_ERROR; - if (z->state->blocks != Z_NULL) - inflate_blocks_free(z->state->blocks, z); - ZFREE(z, z->state); - z->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} - - -ZEXPORT(int) inflateInit2_( /* z, w, version, stream_size) */ -z_streamp z, -int w, -const char *version, -int stream_size ) -{ - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != sizeof(z_stream)) - return Z_VERSION_ERROR; - - /* initialize state */ - if (z == Z_NULL) - return Z_STREAM_ERROR; - z->msg = Z_NULL; - if (z->zalloc == Z_NULL) - { - z->zalloc = zcalloc; - z->opaque = (voidpf)0; - } - if (z->zfree == Z_NULL) z->zfree = zcfree; - if ((z->state = (struct internal_state FAR *) - ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL) - return Z_MEM_ERROR; - z->state->blocks = Z_NULL; - - /* handle undocumented nowrap option (no zlib header or check) */ - z->state->nowrap = 0; - if (w < 0) - { - w = - w; - z->state->nowrap = 1; - } - - /* set window size */ - if (w < 8 || w > 15) - { - inflateEnd(z); - return Z_STREAM_ERROR; - } - z->state->wbits = (uInt)w; - - /* create inflate_blocks state */ - if ((z->state->blocks = - inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) - == Z_NULL) - { - inflateEnd(z); - return Z_MEM_ERROR; - } - Tracev((stderr, "inflate: allocated\n")); - - /* reset state */ - inflateReset(z); - return Z_OK; -} - - - -#undef NEEDBYTE -#define NEEDBYTE {if(z->avail_in==0)return r;r=f;} - -#undef NEXTBYTE -#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) - - -ZEXPORT(int) inflate( /* z, f) */ -z_streamp z, -int f ) -{ - int r; - uInt b; - - if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL) - return Z_STREAM_ERROR; - f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; - r = Z_BUF_ERROR; - while (1) switch (z->state->mode) - { - case METHOD: - NEEDBYTE - if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED) - { - z->state->mode = BAD; - z->msg = (char*)"unknown compression method"; - z->state->sub.marker = 5; /* can't try inflateSync */ - break; - } - if ((z->state->sub.method >> 4) + 8 > z->state->wbits) - { - z->state->mode = BAD; - z->msg = (char*)"invalid window size"; - z->state->sub.marker = 5; /* can't try inflateSync */ - break; - } - z->state->mode = FLAG; - case FLAG: - NEEDBYTE - b = NEXTBYTE; - if (((z->state->sub.method << 8) + b) % 31) - { - z->state->mode = BAD; - z->msg = (char*)"incorrect header check"; - z->state->sub.marker = 5; /* can't try inflateSync */ - break; - } - Tracev((stderr, "inflate: zlib header ok\n")); - if (!(b & PRESET_DICT)) - { - z->state->mode = BLOCKS; - break; - } - z->state->mode = DICT4; - case DICT4: - NEEDBYTE - z->state->sub.check.need = (uLong)NEXTBYTE << 24; - z->state->mode = DICT3; - case DICT3: - NEEDBYTE - z->state->sub.check.need += (uLong)NEXTBYTE << 16; - z->state->mode = DICT2; - case DICT2: - NEEDBYTE - z->state->sub.check.need += (uLong)NEXTBYTE << 8; - z->state->mode = DICT1; - case DICT1: - NEEDBYTE - z->state->sub.check.need += (uLong)NEXTBYTE; - z->adler = z->state->sub.check.need; - z->state->mode = DICT0; - return Z_NEED_DICT; - case DICT0: - z->state->mode = BAD; - z->msg = (char*)"need dictionary"; - z->state->sub.marker = 0; /* can try inflateSync */ - return Z_STREAM_ERROR; - case BLOCKS: - r = inflate_blocks(z->state->blocks, z, r); - if (r == Z_DATA_ERROR) - { - z->state->mode = BAD; - z->state->sub.marker = 0; /* can try inflateSync */ - break; - } - if (r == Z_OK) - r = f; - if (r != Z_STREAM_END) - return r; - r = f; - inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); - if (z->state->nowrap) - { - z->state->mode = DONE; - break; - } - z->state->mode = CHECK4; - case CHECK4: - NEEDBYTE - z->state->sub.check.need = (uLong)NEXTBYTE << 24; - z->state->mode = CHECK3; - case CHECK3: - NEEDBYTE - z->state->sub.check.need += (uLong)NEXTBYTE << 16; - z->state->mode = CHECK2; - case CHECK2: - NEEDBYTE - z->state->sub.check.need += (uLong)NEXTBYTE << 8; - z->state->mode = CHECK1; - case CHECK1: - NEEDBYTE - z->state->sub.check.need += (uLong)NEXTBYTE; - - if (z->state->sub.check.was != z->state->sub.check.need) - { - z->state->mode = BAD; - z->msg = (char*)"incorrect data check"; - z->state->sub.marker = 5; /* can't try inflateSync */ - break; - } - Tracev((stderr, "inflate: zlib check ok\n")); - z->state->mode = DONE; - case DONE: - return Z_STREAM_END; - case BAD: - return Z_DATA_ERROR; - default: - return Z_STREAM_ERROR; - } -#ifdef NEED_DUMMY_RETURN - return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ -#endif -} - +/* inflate.c -- zlib interface to inflate modules + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" + +#define DONE INFLATE_DONE +#define BAD INFLATE_BAD + +typedef enum { + METHOD, /* waiting for method byte */ + FLAG, /* waiting for flag byte */ + DICT4, /* four dictionary check bytes to go */ + DICT3, /* three dictionary check bytes to go */ + DICT2, /* two dictionary check bytes to go */ + DICT1, /* one dictionary check byte to go */ + DICT0, /* waiting for inflateSetDictionary */ + BLOCKS, /* decompressing blocks */ + CHECK4, /* four check bytes to go */ + CHECK3, /* three check bytes to go */ + CHECK2, /* two check bytes to go */ + CHECK1, /* one check byte to go */ + DONE, /* finished check, done */ + BAD} /* got an error--stay here */ +inflate_mode; + +/* inflate private state */ +struct internal_state { + + /* mode */ + inflate_mode mode; /* current inflate mode */ + + /* mode dependent information */ + union { + uInt method; /* if FLAGS, method byte */ + struct { + uLong was; /* computed check value */ + uLong need; /* stream check value */ + } check; /* if CHECK, check values to compare */ + uInt marker; /* if BAD, inflateSync's marker bytes count */ + } sub; /* submode */ + + /* mode independent information */ + int nowrap; /* flag for no wrapper */ + uInt wbits; /* log2(window size) (8..15, defaults to 15) */ + inflate_blocks_statef + *blocks; /* current inflate_blocks state */ + +}; + + +ZEXPORT(int) inflateReset( /* z) */ +z_streamp z ) +{ + if (z == Z_NULL || z->state == Z_NULL) + return Z_STREAM_ERROR; + z->total_in = z->total_out = 0; + z->msg = Z_NULL; + z->state->mode = z->state->nowrap ? BLOCKS : METHOD; + inflate_blocks_reset(z->state->blocks, z, Z_NULL); + Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + + +ZEXPORT(int) inflateEnd( /* z) */ +z_streamp z ) +{ + if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL) + return Z_STREAM_ERROR; + if (z->state->blocks != Z_NULL) + inflate_blocks_free(z->state->blocks, z); + ZFREE(z, z->state); + z->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} + + +ZEXPORT(int) inflateInit2_( /* z, w, version, stream_size) */ +z_streamp z, +int w, +const char *version, +int stream_size ) +{ + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != sizeof(z_stream)) + return Z_VERSION_ERROR; + + /* initialize state */ + if (z == Z_NULL) + return Z_STREAM_ERROR; + z->msg = Z_NULL; + if (z->zalloc == Z_NULL) + { + z->zalloc = zcalloc; + z->opaque = (voidpf)0; + } + if (z->zfree == Z_NULL) z->zfree = zcfree; + if ((z->state = (struct internal_state FAR *) + ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL) + return Z_MEM_ERROR; + z->state->blocks = Z_NULL; + + /* handle undocumented nowrap option (no zlib header or check) */ + z->state->nowrap = 0; + if (w < 0) + { + w = - w; + z->state->nowrap = 1; + } + + /* set window size */ + if (w < 8 || w > 15) + { + inflateEnd(z); + return Z_STREAM_ERROR; + } + z->state->wbits = (uInt)w; + + /* create inflate_blocks state */ + if ((z->state->blocks = + inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) + == Z_NULL) + { + inflateEnd(z); + return Z_MEM_ERROR; + } + Tracev((stderr, "inflate: allocated\n")); + + /* reset state */ + inflateReset(z); + return Z_OK; +} + + + +#undef NEEDBYTE +#define NEEDBYTE {if(z->avail_in==0)return r;r=f;} + +#undef NEXTBYTE +#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) + + +ZEXPORT(int) inflate( /* z, f) */ +z_streamp z, +int f ) +{ + int r; + uInt b; + + if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL) + return Z_STREAM_ERROR; + f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK; + r = Z_BUF_ERROR; + while (1) switch (z->state->mode) + { + case METHOD: + NEEDBYTE + if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED) + { + z->state->mode = BAD; + z->msg = (char*)"unknown compression method"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + if ((z->state->sub.method >> 4) + 8 > z->state->wbits) + { + z->state->mode = BAD; + z->msg = (char*)"invalid window size"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + z->state->mode = FLAG; + case FLAG: + NEEDBYTE + b = NEXTBYTE; + if (((z->state->sub.method << 8) + b) % 31) + { + z->state->mode = BAD; + z->msg = (char*)"incorrect header check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev((stderr, "inflate: zlib header ok\n")); + if (!(b & PRESET_DICT)) + { + z->state->mode = BLOCKS; + break; + } + z->state->mode = DICT4; + case DICT4: + NEEDBYTE + z->state->sub.check.need = (uLong)NEXTBYTE << 24; + z->state->mode = DICT3; + case DICT3: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 16; + z->state->mode = DICT2; + case DICT2: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 8; + z->state->mode = DICT1; + case DICT1: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE; + z->adler = z->state->sub.check.need; + z->state->mode = DICT0; + return Z_NEED_DICT; + case DICT0: + z->state->mode = BAD; + z->msg = (char*)"need dictionary"; + z->state->sub.marker = 0; /* can try inflateSync */ + return Z_STREAM_ERROR; + case BLOCKS: + r = inflate_blocks(z->state->blocks, z, r); + if (r == Z_DATA_ERROR) + { + z->state->mode = BAD; + z->state->sub.marker = 0; /* can try inflateSync */ + break; + } + if (r == Z_OK) + r = f; + if (r != Z_STREAM_END) + return r; + r = f; + inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); + if (z->state->nowrap) + { + z->state->mode = DONE; + break; + } + z->state->mode = CHECK4; + case CHECK4: + NEEDBYTE + z->state->sub.check.need = (uLong)NEXTBYTE << 24; + z->state->mode = CHECK3; + case CHECK3: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 16; + z->state->mode = CHECK2; + case CHECK2: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE << 8; + z->state->mode = CHECK1; + case CHECK1: + NEEDBYTE + z->state->sub.check.need += (uLong)NEXTBYTE; + + if (z->state->sub.check.was != z->state->sub.check.need) + { + z->state->mode = BAD; + z->msg = (char*)"incorrect data check"; + z->state->sub.marker = 5; /* can't try inflateSync */ + break; + } + Tracev((stderr, "inflate: zlib check ok\n")); + z->state->mode = DONE; + case DONE: + return Z_STREAM_END; + case BAD: + return Z_DATA_ERROR; + default: + return Z_STREAM_ERROR; + } +#ifdef NEED_DUMMY_RETURN + return Z_STREAM_ERROR; /* Some dumb compilers complain without this */ +#endif +} + diff --git a/reactos/dll/3rdparty/freetype/src/gzip/inftrees.c b/reactos/dll/3rdparty/freetype/src/gzip/inftrees.c index 3c39aca6e3a..0740e33cb81 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/inftrees.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/inftrees.c @@ -1,465 +1,465 @@ -/* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" - -#if !defined(BUILDFIXED) && !defined(STDC) -# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */ -#endif - - -#if 0 -local const char inflate_copyright[] = - " inflate 1.1.4 Copyright 1995-2002 Mark Adler "; -#endif -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* simplify the use of the inflate_huft type with some defines */ -#define exop word.what.Exop -#define bits word.what.Bits - - -local int huft_build OF(( - uIntf *, /* code lengths in bits */ - uInt, /* number of codes */ - uInt, /* number of "simple" codes */ - const uIntf *, /* list of base values for non-simple codes */ - const uIntf *, /* list of extra bits for non-simple codes */ - inflate_huft * FAR*,/* result: starting table */ - uIntf *, /* maximum lookup bits (returns actual) */ - inflate_huft *, /* space for trees */ - uInt *, /* hufts used in space */ - uIntf * )); /* space for values */ - -/* Tables for deflate from PKZIP's appnote.txt. */ -local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - /* see note #13 above about 258 */ -local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ -local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577}; -local const uInt cpdext[30] = { /* Extra bits for distance codes */ - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13}; - -/* - Huffman code decoding is performed using a multi-level table lookup. - The fastest way to decode is to simply build a lookup table whose - size is determined by the longest code. However, the time it takes - to build this table can also be a factor if the data being decoded - is not very long. The most common codes are necessarily the - shortest codes, so those codes dominate the decoding time, and hence - the speed. The idea is you can have a shorter table that decodes the - shorter, more probable codes, and then point to subsidiary tables for - the longer codes. The time it costs to decode the longer codes is - then traded against the time it takes to make longer tables. - - This results of this trade are in the variables lbits and dbits - below. lbits is the number of bits the first level table for literal/ - length codes can decode in one step, and dbits is the same thing for - the distance codes. Subsequent tables are also less than or equal to - those sizes. These values may be adjusted either when all of the - codes are shorter than that, in which case the longest code length in - bits is used, or when the shortest code is *longer* than the requested - table size, in which case the length of the shortest code in bits is - used. - - There are two different values for the two tables, since they code a - different number of possibilities each. The literal/length table - codes 286 possible values, or in a flat code, a little over eight - bits. The distance table codes 30 possible values, or a little less - than five bits, flat. The optimum values for speed end up being - about one bit more than those, so lbits is 8+1 and dbits is 5+1. - The optimum values may differ though from machine to machine, and - possibly even between compilers. Your mileage may vary. - */ - - -/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ -#define BMAX 15 /* maximum bit length of any code */ - -local int huft_build( /* b, n, s, d, e, t, m, hp, hn, v) */ -uIntf *b, /* code lengths in bits (all assumed <= BMAX) */ -uInt n, /* number of codes (assumed <= 288) */ -uInt s, /* number of simple-valued codes (0..s-1) */ -const uIntf *d, /* list of base values for non-simple codes */ -const uIntf *e, /* list of extra bits for non-simple codes */ -inflate_huft * FAR *t, /* result: starting table */ -uIntf *m, /* maximum lookup bits, returns actual */ -inflate_huft *hp, /* space for trees */ -uInt *hn, /* hufts used in space */ -uIntf *v /* working area: values in order of bit length */ -/* Given a list of code lengths and a maximum table size, make a set of - tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR - if the given code set is incomplete (the tables are still built in this - case), or Z_DATA_ERROR if the input is invalid. */ -) -{ - - uInt a; /* counter for codes of length k */ - uInt c[BMAX+1]; /* bit length count table */ - uInt f; /* i repeats in table every f entries */ - int g; /* maximum code length */ - int h; /* table level */ - register uInt i; /* counter, current code */ - register uInt j; /* counter */ - register int k; /* number of bits in current code */ - int l; /* bits per table (returned in m) */ - uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ - register uIntf *p; /* pointer into c[], b[], or v[] */ - inflate_huft *q; /* points to current table */ - struct inflate_huft_s r; /* table entry for structure assignment */ - inflate_huft *u[BMAX]; /* table stack */ - register int w; /* bits before this table == (l * h) */ - uInt x[BMAX+1]; /* bit offsets, then code stack */ - uIntf *xp; /* pointer into x */ - int y; /* number of dummy codes added */ - uInt z; /* number of entries in current table */ - - - /* Make compiler happy */ - r.base = 0; - - /* Generate counts for each bit length */ - p = c; -#define C0 *p++ = 0; -#define C2 C0 C0 C0 C0 -#define C4 C2 C2 C2 C2 - C4 /* clear c[]--assume BMAX+1 is 16 */ - p = b; i = n; - do { - c[*p++]++; /* assume all entries <= BMAX */ - } while (--i); - if (c[0] == n) /* null input--all zero length codes */ - { - *t = (inflate_huft *)Z_NULL; - *m = 0; - return Z_OK; - } - - - /* Find minimum and maximum length, bound *m by those */ - l = *m; - for (j = 1; j <= BMAX; j++) - if (c[j]) - break; - k = j; /* minimum code length */ - if ((uInt)l < j) - l = j; - for (i = BMAX; i; i--) - if (c[i]) - break; - g = i; /* maximum code length */ - if ((uInt)l > i) - l = i; - *m = l; - - - /* Adjust last length count to fill out codes, if needed */ - for (y = 1 << j; j < i; j++, y <<= 1) - if ((y -= c[j]) < 0) - return Z_DATA_ERROR; - if ((y -= c[i]) < 0) - return Z_DATA_ERROR; - c[i] += y; - - - /* Generate starting offsets into the value table for each length */ - x[1] = j = 0; - p = c + 1; xp = x + 2; - while (--i) { /* note that i == g from above */ - *xp++ = (j += *p++); - } - - - /* Make a table of values in order of bit lengths */ - p = b; i = 0; - do { - if ((j = *p++) != 0) - v[x[j]++] = i; - } while (++i < n); - n = x[g]; /* set n to length of v */ - - - /* Generate the Huffman codes and for each, make the table entries */ - x[0] = i = 0; /* first Huffman code is zero */ - p = v; /* grab values in bit order */ - h = -1; /* no tables yet--level -1 */ - w = -l; /* bits decoded == (l * h) */ - u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */ - q = (inflate_huft *)Z_NULL; /* ditto */ - z = 0; /* ditto */ - - /* go through the bit lengths (k already is bits in shortest code) */ - for (; k <= g; k++) - { - a = c[k]; - while (a--) - { - /* here i is the Huffman code of length k bits for value *p */ - /* make tables up to required level */ - while (k > w + l) - { - h++; - w += l; /* previous table always l bits */ - - /* compute minimum size table less than or equal to l bits */ - z = g - w; - z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */ - if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ - { /* too few codes for k-w bit table */ - f -= a + 1; /* deduct codes from patterns left */ - xp = c + k; - if (j < z) - while (++j < z) /* try smaller tables up to z bits */ - { - if ((f <<= 1) <= *++xp) - break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ - } - } - z = 1 << j; /* table entries for j-bit table */ - - /* allocate new table */ - if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ - return Z_DATA_ERROR; /* overflow of MANY */ - u[h] = q = hp + *hn; - *hn += z; - - /* connect to last table, if there is one */ - if (h) - { - x[h] = i; /* save pattern for backing up */ - r.bits = (Byte)l; /* bits to dump before this table */ - r.exop = (Byte)j; /* bits in this table */ - j = i >> (w - l); - r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ - u[h-1][j] = r; /* connect to last table */ - } - else - *t = q; /* first table is returned result */ - } - - /* set up table entry in r */ - r.bits = (Byte)(k - w); - if (p >= v + n) - r.exop = 128 + 64; /* out of values--invalid code */ - else if (*p < s) - { - r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ - r.base = *p++; /* simple code is just the value */ - } - else - { - r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ - r.base = d[*p++ - s]; - } - - /* fill code-like entries with r */ - f = 1 << (k - w); - for (j = i >> w; j < z; j += f) - q[j] = r; - - /* backwards increment the k-bit code i */ - for (j = 1 << (k - 1); i & j; j >>= 1) - i ^= j; - i ^= j; - - /* backup over finished tables */ - mask = (1 << w) - 1; /* needed on HP, cc -O bug */ - while ((i & mask) != x[h]) - { - h--; /* don't need to update q */ - w -= l; - mask = (1 << w) - 1; - } - } - } - - - /* Return Z_BUF_ERROR if we were given an incomplete table */ - return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; -} - - -local int inflate_trees_bits( /* c, bb, tb, hp, z) */ -uIntf *c, /* 19 code lengths */ -uIntf *bb, /* bits tree desired/actual depth */ -inflate_huft * FAR *tb, /* bits tree result */ -inflate_huft *hp, /* space for trees */ -z_streamp z /* for messages */ -) -{ - int r; - uInt hn = 0; /* hufts used in space */ - uIntf *v; /* work area for huft_build */ - - if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL) - return Z_MEM_ERROR; - r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, - tb, bb, hp, &hn, v); - if (r == Z_DATA_ERROR) - z->msg = (char*)"oversubscribed dynamic bit lengths tree"; - else if (r == Z_BUF_ERROR || *bb == 0) - { - z->msg = (char*)"incomplete dynamic bit lengths tree"; - r = Z_DATA_ERROR; - } - ZFREE(z, v); - return r; -} - - -local int inflate_trees_dynamic( /* nl, nd, c, bl, bd, tl, td, hp, z) */ -uInt nl, /* number of literal/length codes */ -uInt nd, /* number of distance codes */ -uIntf *c, /* that many (total) code lengths */ -uIntf *bl, /* literal desired/actual bit depth */ -uIntf *bd, /* distance desired/actual bit depth */ -inflate_huft * FAR *tl, /* literal/length tree result */ -inflate_huft * FAR *td, /* distance tree result */ -inflate_huft *hp, /* space for trees */ -z_streamp z /* for messages */ -) -{ - int r; - uInt hn = 0; /* hufts used in space */ - uIntf *v; /* work area for huft_build */ - - /* allocate work area */ - if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) - return Z_MEM_ERROR; - - /* build literal/length tree */ - r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); - if (r != Z_OK || *bl == 0) - { - if (r == Z_DATA_ERROR) - z->msg = (char*)"oversubscribed literal/length tree"; - else if (r != Z_MEM_ERROR) - { - z->msg = (char*)"incomplete literal/length tree"; - r = Z_DATA_ERROR; - } - ZFREE(z, v); - return r; - } - - /* build distance tree */ - r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); - if (r != Z_OK || (*bd == 0 && nl > 257)) - { - if (r == Z_DATA_ERROR) - z->msg = (char*)"oversubscribed distance tree"; - else if (r == Z_BUF_ERROR) { -#ifdef PKZIP_BUG_WORKAROUND - r = Z_OK; - } -#else - z->msg = (char*)"incomplete distance tree"; - r = Z_DATA_ERROR; - } - else if (r != Z_MEM_ERROR) - { - z->msg = (char*)"empty distance tree with lengths"; - r = Z_DATA_ERROR; - } - ZFREE(z, v); - return r; -#endif - } - - /* done */ - ZFREE(z, v); - return Z_OK; -} - - -/* build fixed tables only once--keep them here */ -#ifdef BUILDFIXED -local int fixed_built = 0; -#define FIXEDH 544 /* number of hufts used by fixed tables */ -local inflate_huft fixed_mem[FIXEDH]; -local uInt fixed_bl; -local uInt fixed_bd; -local inflate_huft *fixed_tl; -local inflate_huft *fixed_td; -#else -#include "inffixed.h" -#endif - - -local int inflate_trees_fixed( /* bl, bd, tl, td, z) */ -uIntf *bl, /* literal desired/actual bit depth */ -uIntf *bd, /* distance desired/actual bit depth */ -const inflate_huft * FAR *tl, /* literal/length tree result */ -const inflate_huft * FAR *td, /* distance tree result */ -z_streamp z /* for memory allocation */ -) -{ -#ifdef BUILDFIXED - /* build fixed tables if not already */ - if (!fixed_built) - { - int k; /* temporary variable */ - uInt f = 0; /* number of hufts used in fixed_mem */ - uIntf *c; /* length list for huft_build */ - uIntf *v; /* work area for huft_build */ - - /* allocate memory */ - if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) - return Z_MEM_ERROR; - if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) - { - ZFREE(z, c); - return Z_MEM_ERROR; - } - - /* literal table */ - for (k = 0; k < 144; k++) - c[k] = 8; - for (; k < 256; k++) - c[k] = 9; - for (; k < 280; k++) - c[k] = 7; - for (; k < 288; k++) - c[k] = 8; - fixed_bl = 9; - huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, - fixed_mem, &f, v); - - /* distance table */ - for (k = 0; k < 30; k++) - c[k] = 5; - fixed_bd = 5; - huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, - fixed_mem, &f, v); - - /* done */ - ZFREE(z, v); - ZFREE(z, c); - fixed_built = 1; - } -#else - FT_UNUSED(z); -#endif - *bl = fixed_bl; - *bd = fixed_bd; - *tl = fixed_tl; - *td = fixed_td; - return Z_OK; -} +/* inftrees.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" + +#if !defined(BUILDFIXED) && !defined(STDC) +# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */ +#endif + + +#if 0 +local const char inflate_copyright[] = + " inflate 1.1.4 Copyright 1995-2002 Mark Adler "; +#endif +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* simplify the use of the inflate_huft type with some defines */ +#define exop word.what.Exop +#define bits word.what.Bits + + +local int huft_build OF(( + uIntf *, /* code lengths in bits */ + uInt, /* number of codes */ + uInt, /* number of "simple" codes */ + const uIntf *, /* list of base values for non-simple codes */ + const uIntf *, /* list of extra bits for non-simple codes */ + inflate_huft * FAR*,/* result: starting table */ + uIntf *, /* maximum lookup bits (returns actual) */ + inflate_huft *, /* space for trees */ + uInt *, /* hufts used in space */ + uIntf * )); /* space for values */ + +/* Tables for deflate from PKZIP's appnote.txt. */ +local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* see note #13 above about 258 */ +local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */ +local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; +local const uInt cpdext[30] = { /* Extra bits for distance codes */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + +/* + Huffman code decoding is performed using a multi-level table lookup. + The fastest way to decode is to simply build a lookup table whose + size is determined by the longest code. However, the time it takes + to build this table can also be a factor if the data being decoded + is not very long. The most common codes are necessarily the + shortest codes, so those codes dominate the decoding time, and hence + the speed. The idea is you can have a shorter table that decodes the + shorter, more probable codes, and then point to subsidiary tables for + the longer codes. The time it costs to decode the longer codes is + then traded against the time it takes to make longer tables. + + This results of this trade are in the variables lbits and dbits + below. lbits is the number of bits the first level table for literal/ + length codes can decode in one step, and dbits is the same thing for + the distance codes. Subsequent tables are also less than or equal to + those sizes. These values may be adjusted either when all of the + codes are shorter than that, in which case the longest code length in + bits is used, or when the shortest code is *longer* than the requested + table size, in which case the length of the shortest code in bits is + used. + + There are two different values for the two tables, since they code a + different number of possibilities each. The literal/length table + codes 286 possible values, or in a flat code, a little over eight + bits. The distance table codes 30 possible values, or a little less + than five bits, flat. The optimum values for speed end up being + about one bit more than those, so lbits is 8+1 and dbits is 5+1. + The optimum values may differ though from machine to machine, and + possibly even between compilers. Your mileage may vary. + */ + + +/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */ +#define BMAX 15 /* maximum bit length of any code */ + +local int huft_build( /* b, n, s, d, e, t, m, hp, hn, v) */ +uIntf *b, /* code lengths in bits (all assumed <= BMAX) */ +uInt n, /* number of codes (assumed <= 288) */ +uInt s, /* number of simple-valued codes (0..s-1) */ +const uIntf *d, /* list of base values for non-simple codes */ +const uIntf *e, /* list of extra bits for non-simple codes */ +inflate_huft * FAR *t, /* result: starting table */ +uIntf *m, /* maximum lookup bits, returns actual */ +inflate_huft *hp, /* space for trees */ +uInt *hn, /* hufts used in space */ +uIntf *v /* working area: values in order of bit length */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + if the given code set is incomplete (the tables are still built in this + case), or Z_DATA_ERROR if the input is invalid. */ +) +{ + + uInt a; /* counter for codes of length k */ + uInt c[BMAX+1]; /* bit length count table */ + uInt f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register uInt i; /* counter, current code */ + register uInt j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ + register uIntf *p; /* pointer into c[], b[], or v[] */ + inflate_huft *q; /* points to current table */ + struct inflate_huft_s r; /* table entry for structure assignment */ + inflate_huft *u[BMAX]; /* table stack */ + register int w; /* bits before this table == (l * h) */ + uInt x[BMAX+1]; /* bit offsets, then code stack */ + uIntf *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + uInt z; /* number of entries in current table */ + + + /* Make compiler happy */ + r.base = 0; + + /* Generate counts for each bit length */ + p = c; +#define C0 *p++ = 0; +#define C2 C0 C0 C0 C0 +#define C4 C2 C2 C2 C2 + C4 /* clear c[]--assume BMAX+1 is 16 */ + p = b; i = n; + do { + c[*p++]++; /* assume all entries <= BMAX */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (inflate_huft *)Z_NULL; + *m = 0; + return Z_OK; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((uInt)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((uInt)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return Z_DATA_ERROR; + if ((y -= c[i]) < 0) + return Z_DATA_ERROR; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + n = x[g]; /* set n to length of v */ + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */ + q = (inflate_huft *)Z_NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = g - w; + z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + if (j < z) + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate new table */ + if (*hn + z > MANY) /* (note: doesn't matter for fixed) */ + return Z_DATA_ERROR; /* overflow of MANY */ + u[h] = q = hp + *hn; + *hn += z; + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.bits = (Byte)l; /* bits to dump before this table */ + r.exop = (Byte)j; /* bits in this table */ + j = i >> (w - l); + r.base = (uInt)(q - u[h-1] - j); /* offset to this table */ + u[h-1][j] = r; /* connect to last table */ + } + else + *t = q; /* first table is returned result */ + } + + /* set up table entry in r */ + r.bits = (Byte)(k - w); + if (p >= v + n) + r.exop = 128 + 64; /* out of values--invalid code */ + else if (*p < s) + { + r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ + r.base = *p++; /* simple code is just the value */ + } + else + { + r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */ + r.base = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + mask = (1 << w) - 1; /* needed on HP, cc -O bug */ + while ((i & mask) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + mask = (1 << w) - 1; + } + } + } + + + /* Return Z_BUF_ERROR if we were given an incomplete table */ + return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; +} + + +local int inflate_trees_bits( /* c, bb, tb, hp, z) */ +uIntf *c, /* 19 code lengths */ +uIntf *bb, /* bits tree desired/actual depth */ +inflate_huft * FAR *tb, /* bits tree result */ +inflate_huft *hp, /* space for trees */ +z_streamp z /* for messages */ +) +{ + int r; + uInt hn = 0; /* hufts used in space */ + uIntf *v; /* work area for huft_build */ + + if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, + tb, bb, hp, &hn, v); + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed dynamic bit lengths tree"; + else if (r == Z_BUF_ERROR || *bb == 0) + { + z->msg = (char*)"incomplete dynamic bit lengths tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +} + + +local int inflate_trees_dynamic( /* nl, nd, c, bl, bd, tl, td, hp, z) */ +uInt nl, /* number of literal/length codes */ +uInt nd, /* number of distance codes */ +uIntf *c, /* that many (total) code lengths */ +uIntf *bl, /* literal desired/actual bit depth */ +uIntf *bd, /* distance desired/actual bit depth */ +inflate_huft * FAR *tl, /* literal/length tree result */ +inflate_huft * FAR *td, /* distance tree result */ +inflate_huft *hp, /* space for trees */ +z_streamp z /* for messages */ +) +{ + int r; + uInt hn = 0; /* hufts used in space */ + uIntf *v; /* work area for huft_build */ + + /* allocate work area */ + if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + + /* build literal/length tree */ + r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v); + if (r != Z_OK || *bl == 0) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed literal/length tree"; + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"incomplete literal/length tree"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; + } + + /* build distance tree */ + r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v); + if (r != Z_OK || (*bd == 0 && nl > 257)) + { + if (r == Z_DATA_ERROR) + z->msg = (char*)"oversubscribed distance tree"; + else if (r == Z_BUF_ERROR) { +#ifdef PKZIP_BUG_WORKAROUND + r = Z_OK; + } +#else + z->msg = (char*)"incomplete distance tree"; + r = Z_DATA_ERROR; + } + else if (r != Z_MEM_ERROR) + { + z->msg = (char*)"empty distance tree with lengths"; + r = Z_DATA_ERROR; + } + ZFREE(z, v); + return r; +#endif + } + + /* done */ + ZFREE(z, v); + return Z_OK; +} + + +/* build fixed tables only once--keep them here */ +#ifdef BUILDFIXED +local int fixed_built = 0; +#define FIXEDH 544 /* number of hufts used by fixed tables */ +local inflate_huft fixed_mem[FIXEDH]; +local uInt fixed_bl; +local uInt fixed_bd; +local inflate_huft *fixed_tl; +local inflate_huft *fixed_td; +#else +#include "inffixed.h" +#endif + + +local int inflate_trees_fixed( /* bl, bd, tl, td, z) */ +uIntf *bl, /* literal desired/actual bit depth */ +uIntf *bd, /* distance desired/actual bit depth */ +const inflate_huft * FAR *tl, /* literal/length tree result */ +const inflate_huft * FAR *td, /* distance tree result */ +z_streamp z /* for memory allocation */ +) +{ +#ifdef BUILDFIXED + /* build fixed tables if not already */ + if (!fixed_built) + { + int k; /* temporary variable */ + uInt f = 0; /* number of hufts used in fixed_mem */ + uIntf *c; /* length list for huft_build */ + uIntf *v; /* work area for huft_build */ + + /* allocate memory */ + if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + return Z_MEM_ERROR; + if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL) + { + ZFREE(z, c); + return Z_MEM_ERROR; + } + + /* literal table */ + for (k = 0; k < 144; k++) + c[k] = 8; + for (; k < 256; k++) + c[k] = 9; + for (; k < 280; k++) + c[k] = 7; + for (; k < 288; k++) + c[k] = 8; + fixed_bl = 9; + huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, + fixed_mem, &f, v); + + /* distance table */ + for (k = 0; k < 30; k++) + c[k] = 5; + fixed_bd = 5; + huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, + fixed_mem, &f, v); + + /* done */ + ZFREE(z, v); + ZFREE(z, c); + fixed_built = 1; + } +#else + FT_UNUSED(z); +#endif + *bl = fixed_bl; + *bd = fixed_bd; + *tl = fixed_tl; + *td = fixed_td; + return Z_OK; +} diff --git a/reactos/dll/3rdparty/freetype/src/gzip/inftrees.h b/reactos/dll/3rdparty/freetype/src/gzip/inftrees.h index 07bf2aa0bf8..ab21cc3825e 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/inftrees.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/inftrees.h @@ -1,63 +1,63 @@ -/* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* Huffman code lookup table entry--this entry is four bytes for machines - that have 16-bit pointers (e.g. PC's in the small or medium model). */ - -#ifndef _INFTREES_H -#define _INFTREES_H - -typedef struct inflate_huft_s FAR inflate_huft; - -struct inflate_huft_s { - union { - struct { - Byte Exop; /* number of extra bits or operation */ - Byte Bits; /* number of bits in this code or subcode */ - } what; - uInt pad; /* pad structure to a power of 2 (4 bytes for */ - } word; /* 16-bit, 8 bytes for 32-bit int's) */ - uInt base; /* literal, length base, distance base, - or table offset */ -}; - -/* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 huft structures (850 for length/literals - and 154 for distances, the latter actually the result of an - exhaustive search). The actual maximum is not known, but the - value below is more than safe. */ -#define MANY 1440 - -local int inflate_trees_bits OF(( - uIntf *, /* 19 code lengths */ - uIntf *, /* bits tree desired/actual depth */ - inflate_huft * FAR *, /* bits tree result */ - inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ - -local int inflate_trees_dynamic OF(( - uInt, /* number of literal/length codes */ - uInt, /* number of distance codes */ - uIntf *, /* that many (total) code lengths */ - uIntf *, /* literal desired/actual bit depth */ - uIntf *, /* distance desired/actual bit depth */ - inflate_huft * FAR *, /* literal/length tree result */ - inflate_huft * FAR *, /* distance tree result */ - inflate_huft *, /* space for trees */ - z_streamp)); /* for messages */ - -local int inflate_trees_fixed OF(( - uIntf *, /* literal desired/actual bit depth */ - uIntf *, /* distance desired/actual bit depth */ - const inflate_huft * FAR *, /* literal/length tree result */ - const inflate_huft * FAR *, /* distance tree result */ - z_streamp)); /* for memory allocation */ - -#endif /* _INFTREES_H */ +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). */ + +#ifndef _INFTREES_H +#define _INFTREES_H + +typedef struct inflate_huft_s FAR inflate_huft; + +struct inflate_huft_s { + union { + struct { + Byte Exop; /* number of extra bits or operation */ + Byte Bits; /* number of bits in this code or subcode */ + } what; + uInt pad; /* pad structure to a power of 2 (4 bytes for */ + } word; /* 16-bit, 8 bytes for 32-bit int's) */ + uInt base; /* literal, length base, distance base, + or table offset */ +}; + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1004 huft structures (850 for length/literals + and 154 for distances, the latter actually the result of an + exhaustive search). The actual maximum is not known, but the + value below is more than safe. */ +#define MANY 1440 + +local int inflate_trees_bits OF(( + uIntf *, /* 19 code lengths */ + uIntf *, /* bits tree desired/actual depth */ + inflate_huft * FAR *, /* bits tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +local int inflate_trees_dynamic OF(( + uInt, /* number of literal/length codes */ + uInt, /* number of distance codes */ + uIntf *, /* that many (total) code lengths */ + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + inflate_huft * FAR *, /* literal/length tree result */ + inflate_huft * FAR *, /* distance tree result */ + inflate_huft *, /* space for trees */ + z_streamp)); /* for messages */ + +local int inflate_trees_fixed OF(( + uIntf *, /* literal desired/actual bit depth */ + uIntf *, /* distance desired/actual bit depth */ + const inflate_huft * FAR *, /* literal/length tree result */ + const inflate_huft * FAR *, /* distance tree result */ + z_streamp)); /* for memory allocation */ + +#endif /* _INFTREES_H */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/infutil.c b/reactos/dll/3rdparty/freetype/src/gzip/infutil.c index 6087b406473..54be9741b5c 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/infutil.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/infutil.c @@ -1,86 +1,86 @@ -/* inflate_util.c -- data and routines common to blocks and codes - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "infblock.h" -#include "inftrees.h" -#include "infcodes.h" -#include "infutil.h" - - -/* And'ing with mask[n] masks the lower n bits */ -local const uInt inflate_mask[17] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; - - -/* copy as much as possible from the sliding window to the output area */ -local int inflate_flush( /* s, z, r) */ -inflate_blocks_statef *s, -z_streamp z, -int r ) -{ - uInt n; - Bytef *p; - Bytef *q; - - /* local copies of source and destination pointers */ - p = z->next_out; - q = s->read; - - /* compute number of bytes to copy as far as end of window */ - n = (uInt)((q <= s->write ? s->write : s->end) - q); - if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; - - /* update counters */ - z->avail_out -= n; - z->total_out += n; - - /* update check information */ - if (s->checkfn != Z_NULL) - z->adler = s->check = (*s->checkfn)(s->check, q, n); - - /* copy as far as end of window */ - zmemcpy(p, q, n); - p += n; - q += n; - - /* see if more to copy at beginning of window */ - if (q == s->end) - { - /* wrap pointers */ - q = s->window; - if (s->write == s->end) - s->write = s->window; - - /* compute bytes to copy */ - n = (uInt)(s->write - q); - if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; - - /* update counters */ - z->avail_out -= n; - z->total_out += n; - - /* update check information */ - if (s->checkfn != Z_NULL) - z->adler = s->check = (*s->checkfn)(s->check, q, n); - - /* copy */ - zmemcpy(p, q, n); - p += n; - q += n; - } - - /* update pointers */ - z->next_out = p; - s->read = q; - - /* done */ - return r; -} +/* inflate_util.c -- data and routines common to blocks and codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infblock.h" +#include "inftrees.h" +#include "infcodes.h" +#include "infutil.h" + + +/* And'ing with mask[n] masks the lower n bits */ +local const uInt inflate_mask[17] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + + +/* copy as much as possible from the sliding window to the output area */ +local int inflate_flush( /* s, z, r) */ +inflate_blocks_statef *s, +z_streamp z, +int r ) +{ + uInt n; + Bytef *p; + Bytef *q; + + /* local copies of source and destination pointers */ + p = z->next_out; + q = s->read; + + /* compute number of bytes to copy as far as end of window */ + n = (uInt)((q <= s->write ? s->write : s->end) - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy as far as end of window */ + zmemcpy(p, q, n); + p += n; + q += n; + + /* see if more to copy at beginning of window */ + if (q == s->end) + { + /* wrap pointers */ + q = s->window; + if (s->write == s->end) + s->write = s->window; + + /* compute bytes to copy */ + n = (uInt)(s->write - q); + if (n > z->avail_out) n = z->avail_out; + if (n && r == Z_BUF_ERROR) r = Z_OK; + + /* update counters */ + z->avail_out -= n; + z->total_out += n; + + /* update check information */ + if (s->checkfn != Z_NULL) + z->adler = s->check = (*s->checkfn)(s->check, q, n); + + /* copy */ + zmemcpy(p, q, n); + p += n; + q += n; + } + + /* update pointers */ + z->next_out = p; + s->read = q; + + /* done */ + return r; +} diff --git a/reactos/dll/3rdparty/freetype/src/gzip/infutil.h b/reactos/dll/3rdparty/freetype/src/gzip/infutil.h index 7174b6dd0ff..36c1a1a4c1e 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/infutil.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/infutil.h @@ -1,98 +1,98 @@ -/* infutil.h -- types and macros common to blocks and codes - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -#ifndef _INFUTIL_H -#define _INFUTIL_H - -typedef enum { - TYPE, /* get type bits (3, including end bit) */ - LENS, /* get lengths for stored */ - STORED, /* processing stored block */ - TABLE, /* get table lengths */ - BTREE, /* get bit lengths tree for a dynamic block */ - DTREE, /* get length, distance trees for a dynamic block */ - CODES, /* processing fixed or dynamic block */ - DRY, /* output remaining window bytes */ - DONE, /* finished last block, done */ - BAD} /* got a data error--stuck here */ -inflate_block_mode; - -/* inflate blocks semi-private state */ -struct inflate_blocks_state { - - /* mode */ - inflate_block_mode mode; /* current inflate_block mode */ - - /* mode dependent information */ - union { - uInt left; /* if STORED, bytes left to copy */ - struct { - uInt table; /* table lengths (14 bits) */ - uInt index; /* index into blens (or border) */ - uIntf *blens; /* bit lengths of codes */ - uInt bb; /* bit length tree depth */ - inflate_huft *tb; /* bit length decoding tree */ - } trees; /* if DTREE, decoding info for trees */ - struct { - inflate_codes_statef - *codes; - } decode; /* if CODES, current state */ - } sub; /* submode */ - uInt last; /* true if this block is the last block */ - - /* mode independent information */ - uInt bitk; /* bits in bit buffer */ - uLong bitb; /* bit buffer */ - inflate_huft *hufts; /* single malloc for tree space */ - Bytef *window; /* sliding window */ - Bytef *end; /* one byte after sliding window */ - Bytef *read; /* window read pointer */ - Bytef *write; /* window write pointer */ - check_func checkfn; /* check function */ - uLong check; /* check on output */ - -}; - - -/* defines for inflate input/output */ -/* update pointers and return */ -#define UPDBITS {s->bitb=b;s->bitk=k;} -#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} -#define UPDOUT {s->write=q;} -#define UPDATE {UPDBITS UPDIN UPDOUT} -#define LEAVE {UPDATE return inflate_flush(s,z,r);} -/* get bytes and bits */ -#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} -#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} -#define NEXTBYTE (n--,*p++) -#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} -/* output bytes */ -#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) -#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} -#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} -#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} -#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} -#define OUTBYTE(a) {*q++=(Byte)(a);m--;} -/* load local pointers */ -#define LOAD {LOADIN LOADOUT} - -/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ -#ifndef NO_INFLATE_MASK -local uInt inflate_mask[17]; -#endif - -/* copy as much as possible from the sliding window to the output area */ -local int inflate_flush OF(( - inflate_blocks_statef *, - z_streamp , - int)); - -#endif +/* infutil.h -- types and macros common to blocks and codes + * Copyright (C) 1995-2002 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +#ifndef _INFUTIL_H +#define _INFUTIL_H + +typedef enum { + TYPE, /* get type bits (3, including end bit) */ + LENS, /* get lengths for stored */ + STORED, /* processing stored block */ + TABLE, /* get table lengths */ + BTREE, /* get bit lengths tree for a dynamic block */ + DTREE, /* get length, distance trees for a dynamic block */ + CODES, /* processing fixed or dynamic block */ + DRY, /* output remaining window bytes */ + DONE, /* finished last block, done */ + BAD} /* got a data error--stuck here */ +inflate_block_mode; + +/* inflate blocks semi-private state */ +struct inflate_blocks_state { + + /* mode */ + inflate_block_mode mode; /* current inflate_block mode */ + + /* mode dependent information */ + union { + uInt left; /* if STORED, bytes left to copy */ + struct { + uInt table; /* table lengths (14 bits) */ + uInt index; /* index into blens (or border) */ + uIntf *blens; /* bit lengths of codes */ + uInt bb; /* bit length tree depth */ + inflate_huft *tb; /* bit length decoding tree */ + } trees; /* if DTREE, decoding info for trees */ + struct { + inflate_codes_statef + *codes; + } decode; /* if CODES, current state */ + } sub; /* submode */ + uInt last; /* true if this block is the last block */ + + /* mode independent information */ + uInt bitk; /* bits in bit buffer */ + uLong bitb; /* bit buffer */ + inflate_huft *hufts; /* single malloc for tree space */ + Bytef *window; /* sliding window */ + Bytef *end; /* one byte after sliding window */ + Bytef *read; /* window read pointer */ + Bytef *write; /* window write pointer */ + check_func checkfn; /* check function */ + uLong check; /* check on output */ + +}; + + +/* defines for inflate input/output */ +/* update pointers and return */ +#define UPDBITS {s->bitb=b;s->bitk=k;} +#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} +#define UPDOUT {s->write=q;} +#define UPDATE {UPDBITS UPDIN UPDOUT} +#define LEAVE {UPDATE return inflate_flush(s,z,r);} +/* get bytes and bits */ +#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} +#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} +#define NEXTBYTE (n--,*p++) +#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} +/* output bytes */ +#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) +#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} +#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} +#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} +#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} +#define OUTBYTE(a) {*q++=(Byte)(a);m--;} +/* load local pointers */ +#define LOAD {LOADIN LOADOUT} + +/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ +#ifndef NO_INFLATE_MASK +local uInt inflate_mask[17]; +#endif + +/* copy as much as possible from the sliding window to the output area */ +local int inflate_flush OF(( + inflate_blocks_statef *, + z_streamp , + int)); + +#endif diff --git a/reactos/dll/3rdparty/freetype/src/gzip/zconf.h b/reactos/dll/3rdparty/freetype/src/gzip/zconf.h index 3ccc3a66ab6..7e2cf76141f 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/zconf.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/zconf.h @@ -1,278 +1,278 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2002 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: zconf.h,v 1.4 2007/06/01 06:56:17 wl Exp $ */ - -#ifndef _ZCONF_H -#define _ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateReset z_inflateReset -# define compress z_compress -# define compress2 z_compress2 -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table - -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) -# define WIN32 -#endif -#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) -# ifndef __32BIT__ -# define __32BIT__ -# endif -#endif -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#if defined(MSDOS) && !defined(__32BIT__) -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) -# define STDC -#endif -#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) -# ifndef STDC -# define STDC -# endif -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Old Borland C and LCC incorrectly complains about missing returns: */ -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) -# define NEED_DUMMY_RETURN -#endif - -#if defined(__LCC__) -# define NEED_DUMMY_RETURN -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -#endif -#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) -# ifndef __32BIT__ -# define SMALL_MEDIUM -# define FAR _far -# endif -#endif - -/* Compile with -DZLIB_DLL for Windows DLL support */ -#if defined(ZLIB_DLL) -# if defined(_WINDOWS) || defined(WINDOWS) -# ifdef FAR -# undef FAR -# endif -# include -# define ZEXPORT(x) x WINAPI -# ifdef WIN32 -# define ZEXPORTVA(x) x WINAPIV -# else -# define ZEXPORTVA(x) x FAR _cdecl _export -# endif -# endif -# if defined (__BORLANDC__) -# if (__BORLANDC__ >= 0x0500) && defined (WIN32) -# include -# define ZEXPORT(x) x __declspec(dllexport) WINAPI -# define ZEXPORTRVA(x) x __declspec(dllexport) WINAPIV -# else -# if defined (_Windows) && defined (__DLL__) -# define ZEXPORT(x) x _export -# define ZEXPORTVA(x) x _export -# endif -# endif -# endif -#endif - - -#ifndef ZEXPORT -# define ZEXPORT(x) static x -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA(x) static x -#endif -#ifndef ZEXTERN -# define ZEXTERN(x) static x -#endif -#ifndef ZEXTERNDEF -# define ZEXTERNDEF(x) static x -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(MACOS) && !defined(TARGET_OS_MAC) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#ifdef HAVE_UNISTD_H -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(inflate_blocks,"INBL") -# pragma map(inflate_blocks_new,"INBLNE") -# pragma map(inflate_blocks_free,"INBLFR") -# pragma map(inflate_blocks_reset,"INBLRE") -# pragma map(inflate_codes_free,"INCOFR") -# pragma map(inflate_codes,"INCO") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_flush,"INFLU") -# pragma map(inflate_mask,"INMA") -# pragma map(inflate_set_dictionary,"INSEDI2") -# pragma map(inflate_copyright,"INCOPY") -# pragma map(inflate_trees_bits,"INTRBI") -# pragma map(inflate_trees_dynamic,"INTRDY") -# pragma map(inflate_trees_fixed,"INTRFI") -# pragma map(inflate_trees_free,"INTRFR") -#endif - -#endif /* _ZCONF_H */ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id: zconf.h,v 1.4 2007/06/01 06:56:17 wl Exp $ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateReset z_inflateReset +# define compress z_compress +# define compress2 z_compress2 +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table + +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#if defined(MSDOS) && !defined(__32BIT__) +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) +# define STDC +#endif +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__) +# ifndef STDC +# define STDC +# endif +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Old Borland C and LCC incorrectly complains about missing returns: */ +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define NEED_DUMMY_RETURN +#endif + +#if defined(__LCC__) +# define NEED_DUMMY_RETURN +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +#endif +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__)) +# ifndef __32BIT__ +# define SMALL_MEDIUM +# define FAR _far +# endif +#endif + +/* Compile with -DZLIB_DLL for Windows DLL support */ +#if defined(ZLIB_DLL) +# if defined(_WINDOWS) || defined(WINDOWS) +# ifdef FAR +# undef FAR +# endif +# include +# define ZEXPORT(x) x WINAPI +# ifdef WIN32 +# define ZEXPORTVA(x) x WINAPIV +# else +# define ZEXPORTVA(x) x FAR _cdecl _export +# endif +# endif +# if defined (__BORLANDC__) +# if (__BORLANDC__ >= 0x0500) && defined (WIN32) +# include +# define ZEXPORT(x) x __declspec(dllexport) WINAPI +# define ZEXPORTRVA(x) x __declspec(dllexport) WINAPIV +# else +# if defined (_Windows) && defined (__DLL__) +# define ZEXPORT(x) x _export +# define ZEXPORTVA(x) x _export +# endif +# endif +# endif +#endif + + +#ifndef ZEXPORT +# define ZEXPORT(x) static x +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA(x) static x +#endif +#ifndef ZEXTERN +# define ZEXTERN(x) static x +#endif +#ifndef ZEXTERNDEF +# define ZEXTERNDEF(x) static x +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(MACOS) && !defined(TARGET_OS_MAC) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#ifdef HAVE_UNISTD_H +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(inflate_blocks,"INBL") +# pragma map(inflate_blocks_new,"INBLNE") +# pragma map(inflate_blocks_free,"INBLFR") +# pragma map(inflate_blocks_reset,"INBLRE") +# pragma map(inflate_codes_free,"INCOFR") +# pragma map(inflate_codes,"INCO") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_flush,"INFLU") +# pragma map(inflate_mask,"INMA") +# pragma map(inflate_set_dictionary,"INSEDI2") +# pragma map(inflate_copyright,"INCOPY") +# pragma map(inflate_trees_bits,"INTRBI") +# pragma map(inflate_trees_dynamic,"INTRDY") +# pragma map(inflate_trees_fixed,"INTRFI") +# pragma map(inflate_trees_free,"INTRFR") +#endif + +#endif /* _ZCONF_H */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/zlib.h b/reactos/dll/3rdparty/freetype/src/gzip/zlib.h index 50d0d3f146d..3762564c7da 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/zlib.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/zlib.h @@ -1,830 +1,830 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.1.4, March 11th, 2002 - - Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef _ZLIB_H -#define _ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.1.4" - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: ascii or binary */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -/* Allowed flush values; see deflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_ASCII 1 -#define Z_UNKNOWN 2 -/* Possible values of the data_type field */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - - - /* basic functions */ - -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN(int) deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - the compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - 0.1% larger than avail_in plus 12 bytes. If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update data_type if it can make a good guess about - the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). -*/ - - -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN(int) inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN(int) inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may some - introduce some output latency (reading input without producing any output) - except when forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much - output as possible to the output buffer. The flushing behavior of inflate is - not specified for values of the flush parameter other than Z_SYNC_FLUSH - and Z_FINISH, but the current implementation actually flushes as much output - as possible anyway. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster routine - may be used for the single inflate() call. - - If a preset dictionary is needed at this point (see inflateSetDictionary - below), inflate sets strm-adler to the adler32 checksum of the - dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise - it sets strm->adler to the adler32 checksum of all output produced - so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or - an error code as described below. At the end of the stream, inflate() - checks that its computed adler32 checksum is equal to that saved by the - compressor and returns Z_STREAM_END only if the checksum is correct. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect - adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent - (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if no progress is possible or if there was not - enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR - case, the application may then call inflateSync to look for a good - compression block. -*/ - - -ZEXTERN(int) inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN(int) deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match). Filtered data consists mostly of small values with a - somewhat random distribution. In this case, the compression algorithm is - tuned to compress them better. The effect of Z_FILTERED is to force more - Huffman coding and less string matching; it is somewhat intermediate - between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects - the compression ratio but not the correctness of the compressed output even - if it is not set appropriately. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. - - Upon return of this function, strm->adler is set to the Adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The Adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -/* -ZEXTERN(int) inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. If a compressed stream with a larger window size is given as - input, inflate() will return with the error code Z_DATA_ERROR instead of - trying to allocate a larger window. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative - memLevel). msg is set to null if there is no error message. inflateInit2 - does not perform any decompression apart from reading the zlib header if - present: this will be done by inflate(). (So next_in and avail_in may be - modified, but next_out and avail_out are unchanged.) -*/ - -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate - if this call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the Adler32 value returned by this call of - inflate. The compressor and decompressor must use exactly the same - dictionary (see deflateSetDictionary). - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect Adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN(int) inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least 0.1% larger than - sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least 0.1% larger than sourceLen plus - 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. -*/ - - -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h". (See the description - of deflateInit2 for more information about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). -*/ - -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len)); - -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -/* - Update a running crc with the bytes buf[0..len-1] and return the updated - crc. If buf is NULL, this function returns the required initial value - for the crc. Pre- and post-conditioning (one's complement) is performed - within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) - - -#ifdef __cplusplus -} -#endif - -#endif /* _ZLIB_H */ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZLIB_H +#define _ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.1.4" + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: ascii or binary */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +/* Allowed flush values; see deflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_ASCII 1 +#define Z_UNKNOWN 2 +/* Possible values of the data_type field */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + + + /* basic functions */ + +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN(int) deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + the compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + 0.1% larger than avail_in plus 12 bytes. If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update data_type if it can make a good guess about + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). +*/ + + +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN(int) inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN(int) inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may some + introduce some output latency (reading input without producing any output) + except when forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much + output as possible to the output buffer. The flushing behavior of inflate is + not specified for values of the flush parameter other than Z_SYNC_FLUSH + and Z_FINISH, but the current implementation actually flushes as much output + as possible anyway. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster routine + may be used for the single inflate() call. + + If a preset dictionary is needed at this point (see inflateSetDictionary + below), inflate sets strm-adler to the adler32 checksum of the + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise + it sets strm->adler to the adler32 checksum of all output produced + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or + an error code as described below. At the end of the stream, inflate() + checks that its computed adler32 checksum is equal to that saved by the + compressor and returns Z_STREAM_END only if the checksum is correct. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if no progress is possible or if there was not + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR + case, the application may then call inflateSync to look for a good + compression block. +*/ + + +ZEXTERN(int) inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN(int) deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match). Filtered data consists mostly of small values with a + somewhat random distribution. In this case, the compression algorithm is + tuned to compress them better. The effect of Z_FILTERED is to force more + Huffman coding and less string matching; it is somewhat intermediate + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects + the compression ratio but not the correctness of the compressed output even + if it is not set appropriately. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. + + Upon return of this function, strm->adler is set to the Adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +/* +ZEXTERN(int) inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. If a compressed stream with a larger window size is given as + input, inflate() will return with the error code Z_DATA_ERROR instead of + trying to allocate a larger window. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative + memLevel). msg is set to null if there is no error message. inflateInit2 + does not perform any decompression apart from reading the zlib header if + present: this will be done by inflate(). (So next_in and avail_in may be + modified, but next_out and avail_out are unchanged.) +*/ + +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler32 value returned by this call of + inflate. The compressor and decompressor must use exactly the same + dictionary (see deflateSetDictionary). + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN(int) inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least 0.1% larger than + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ + + +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h". (See the description + of deflateInit2 for more information about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). +*/ + +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len)); + +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +/* + Update a running crc with the bytes buf[0..len-1] and return the updated + crc. If buf is NULL, this function returns the required initial value + for the crc. Pre- and post-conditioning (one's complement) is performed + within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + + +#ifdef __cplusplus +} +#endif + +#endif /* _ZLIB_H */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/zutil.c b/reactos/dll/3rdparty/freetype/src/gzip/zutil.c index 5ed2da08713..5213edbe80e 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/zutil.c +++ b/reactos/dll/3rdparty/freetype/src/gzip/zutil.c @@ -1,181 +1,181 @@ -/* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2002 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id: zutil.c,v 1.3 2006/04/29 07:31:16 wl Exp $ */ - -#include "zutil.h" - -#ifndef STDC -extern void exit OF((int)); -#endif - - -#ifndef HAVE_MEMCPY - -void zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = *source++; /* ??? to be unrolled */ - } while (--len != 0); -} - -int zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ - uInt j; - - for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; - } - return 0; -} - -void zmemzero(dest, len) - Bytef* dest; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = 0; /* ??? to be unrolled */ - } while (--len != 0); -} -#endif - -#ifdef __TURBOC__ -#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__) -/* Small and medium model in Turbo C are for now limited to near allocation - * with reduced MAX_WBITS and MAX_MEM_LEVEL - */ -# define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { - voidpf org_ptr; - voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - voidpf buf = opaque; /* just to make some compilers happy */ - ulg bsize = (ulg)items*size; - - /* If we allocate less than 65520 bytes, we assume that farmalloc - * will return a usable pointer which doesn't have to be normalized. - */ - if (bsize < 65520L) { - buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; - } else { - buf = farmalloc(bsize + 16L); - } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; - table[next_ptr].org_ptr = buf; - - /* Normalize the pointer to seg:0 */ - *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; - *(ush*)&buf = 0; - table[next_ptr++].new_ptr = buf; - return buf; -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - int n; - if (*(ush*)&ptr != 0) { /* object < 64K */ - farfree(ptr); - return; - } - /* Find the original pointer */ - for (n = 0; n < next_ptr; n++) { - if (ptr != table[n].new_ptr) continue; - - farfree(table[n].org_ptr); - while (++n < next_ptr) { - table[n-1] = table[n]; - } - next_ptr--; - return; - } - ptr = opaque; /* just to make some compilers happy */ - Assert(0, "zcfree: ptr not found"); -} -#endif -#endif /* __TURBOC__ */ - - -#if defined(M_I86) && !defined(__32BIT__) -/* Microsoft C in 16-bit mode */ - -# define MY_ZCALLOC - -#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) -# define _halloc halloc -# define _hfree hfree -#endif - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - return _halloc((long)items, size); -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - _hfree(ptr); -} - -#endif /* MSC */ - - -#ifndef MY_ZCALLOC /* Any system without a special alloc function */ - -#ifndef STDC -extern voidp ft_scalloc OF((uInt items, uInt size)); -extern void ft_sfree OF((voidpf ptr)); -#endif - -voidpf zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ - if (opaque) items += size - size; /* make compiler happy */ - return (voidpf)ft_scalloc(items, size); -} - -void zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ - ft_sfree(ptr); - if (opaque) return; /* make compiler happy */ -} - -#endif /* MY_ZCALLOC */ +/* zutil.c -- target dependent utility functions for the compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id: zutil.c,v 1.3 2006/04/29 07:31:16 wl Exp $ */ + +#include "zutil.h" + +#ifndef STDC +extern void exit OF((int)); +#endif + + +#ifndef HAVE_MEMCPY + +void zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + +#ifdef __TURBOC__ +#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__) +/* Small and medium model in Turbo C are for now limited to near allocation + * with reduced MAX_WBITS and MAX_MEM_LEVEL + */ +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} +#endif +#endif /* __TURBOC__ */ + + +#if defined(M_I86) && !defined(__32BIT__) +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* MSC */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#ifndef STDC +extern voidp ft_scalloc OF((uInt items, uInt size)); +extern void ft_sfree OF((voidpf ptr)); +#endif + +voidpf zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return (voidpf)ft_scalloc(items, size); +} + +void zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + ft_sfree(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ diff --git a/reactos/dll/3rdparty/freetype/src/gzip/zutil.h b/reactos/dll/3rdparty/freetype/src/gzip/zutil.h index 8e3c69a9f06..3d549da8fcc 100644 --- a/reactos/dll/3rdparty/freetype/src/gzip/zutil.h +++ b/reactos/dll/3rdparty/freetype/src/gzip/zutil.h @@ -1,215 +1,215 @@ -/* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2002 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id: zutil.h,v 1.6 2007/06/01 06:56:17 wl Exp $ */ - -#ifndef _Z_UTIL_H -#define _Z_UTIL_H - -#include "zlib.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -typedef unsigned char uch; -typedef uch FAR uchf; -typedef unsigned short ush; -typedef ush FAR ushf; -typedef unsigned long ulg; - - -#define ERR_RETURN(strm,err) \ - return (strm->msg = (char*)ERR_MSG(err), (err)) -/* To be used only when the state is known to be valid */ - - /* common constants */ - -#ifndef DEF_WBITS -# define DEF_WBITS MAX_WBITS -#endif -/* default windowBits for decompression. MAX_WBITS is for compression only */ - -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -/* default memLevel */ - -#define STORED_BLOCK 0 -#define STATIC_TREES 1 -#define DYN_TREES 2 -/* The three kinds of block type */ - -#define MIN_MATCH 3 -#define MAX_MATCH 258 -/* The minimum and maximum match lengths */ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - - /* target dependencies */ - -#ifdef MSDOS -# define OS_CODE 0x00 -# if defined(__TURBOC__) || defined(__BORLANDC__) -# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) - /* Allow compilation with ANSI keywords only enabled */ - void _Cdecl farfree( void *block ); - void *_Cdecl farmalloc( unsigned long nbytes ); -# else -# include -# endif -# else /* MSC or DJGPP */ -# endif -#endif - -#ifdef OS2 -# define OS_CODE 0x06 -#endif - -#ifdef WIN32 /* Window 95 & Windows NT */ -# define OS_CODE 0x0b -#endif - -#if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 -# define F_OPEN(name, mode) \ - ft_fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") -#endif - -#ifdef AMIGA -# define OS_CODE 0x01 -#endif - -#if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 -#endif - -#if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -#endif - -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0F -#endif - -#ifdef TOPS20 -# define OS_CODE 0x0a -#endif - -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) -# define fdopen(fd,type) _fdopen(fd,type) -#endif - - - /* Common defaults */ - -#ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ -#endif - -#ifndef F_OPEN -# define F_OPEN(name, mode) ft_fopen((name), (mode)) -#endif - - /* functions */ - -#ifdef HAVE_STRERROR - extern char *strerror OF((int)); -# define zstrerror(errnum) strerror(errnum) -#else -# define zstrerror(errnum) "" -#endif - -#if defined(pyr) -# define NO_MEMCPY -#endif -#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) - /* Use our own functions for small and medium model with MSC <= 5.0. - * You may have to use the same strategy for Borland C (untested). - * The __SC__ check is for Symantec. - */ -# define NO_MEMCPY -#endif -#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) -# define HAVE_MEMCPY -#endif -#ifdef HAVE_MEMCPY -# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ -# define zmemcpy _fmemcpy -# define zmemcmp _fmemcmp -# define zmemzero(dest, len) _fmemset(dest, 0, len) -# else -# define zmemcpy ft_memcpy -# define zmemcmp ft_memcmp -# define zmemzero(dest, len) ft_memset(dest, 0, len) -# endif -#else - extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - extern void zmemzero OF((Bytef* dest, uInt len)); -#endif - -/* Diagnostic functions */ -#ifdef DEBUG -# include - extern int z_verbose; - extern void z_error OF((char *m)); -# define Assert(cond,msg) {if(!(cond)) z_error(msg);} -# define Trace(x) {if (z_verbose>=0) fprintf x ;} -# define Tracev(x) {if (z_verbose>0) fprintf x ;} -# define Tracevv(x) {if (z_verbose>1) fprintf x ;} -# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} -# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} -#else -# define Assert(cond,msg) -# define Trace(x) -# define Tracev(x) -# define Tracevv(x) -# define Tracec(c,x) -# define Tracecv(c,x) -#endif - - -typedef uLong (*check_func) OF((uLong check, const Bytef *buf, - uInt len)); -local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); -local void zcfree OF((voidpf opaque, voidpf ptr)); - -#define ZALLOC(strm, items, size) \ - (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} - -#endif /* _Z_UTIL_H */ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-2002 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id: zutil.h,v 1.6 2007/06/01 06:56:17 wl Exp $ */ + +#ifndef _Z_UTIL_H +#define _Z_UTIL_H + +#include "zlib.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#ifdef MSDOS +# define OS_CODE 0x00 +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# endif +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +#endif + +#ifdef WIN32 /* Window 95 & Windows NT */ +# define OS_CODE 0x0b +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + ft_fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0F +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) +# define fdopen(fd,type) _fdopen(fd,type) +#endif + + + /* Common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) ft_fopen((name), (mode)) +#endif + + /* functions */ + +#ifdef HAVE_STRERROR + extern char *strerror OF((int)); +# define zstrerror(errnum) strerror(errnum) +#else +# define zstrerror(errnum) "" +#endif + +#if defined(pyr) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy ft_memcpy +# define zmemcmp ft_memcmp +# define zmemzero(dest, len) ft_memset(dest, 0, len) +# endif +#else + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# include + extern int z_verbose; + extern void z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +typedef uLong (*check_func) OF((uLong check, const Bytef *buf, + uInt len)); +local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); +local void zcfree OF((voidpf opaque, voidpf ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +#endif /* _Z_UTIL_H */ diff --git a/reactos/dll/3rdparty/freetype/src/lzw/ftlzw.c b/reactos/dll/3rdparty/freetype/src/lzw/ftlzw.c index 45fbf7b6ea1..1f66ab27f34 100644 --- a/reactos/dll/3rdparty/freetype/src/lzw/ftlzw.c +++ b/reactos/dll/3rdparty/freetype/src/lzw/ftlzw.c @@ -1,413 +1,413 @@ -/***************************************************************************/ -/* */ -/* ftlzw.c */ -/* */ -/* FreeType support for .Z compressed files. */ -/* */ -/* This optional component relies on NetBSD's zopen(). It should mainly */ -/* be used to parse compressed PCF fonts, as found with many X11 server */ -/* distributions. */ -/* */ -/* Copyright 2004, 2005, 2006 by */ -/* Albert Chin-A-Young. */ -/* */ -/* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#include -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H -#include FT_LZW_H -#include -#include - - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX LZW_Err_ -#define FT_ERR_BASE FT_Mod_Err_LZW - -#include FT_ERRORS_H - - -#ifdef FT_CONFIG_OPTION_USE_LZW - -#include "ftzopen.h" - - -/***************************************************************************/ -/***************************************************************************/ -/***** *****/ -/***** M E M O R Y M A N A G E M E N T *****/ -/***** *****/ -/***************************************************************************/ -/***************************************************************************/ - -/***************************************************************************/ -/***************************************************************************/ -/***** *****/ -/***** F I L E D E S C R I P T O R *****/ -/***** *****/ -/***************************************************************************/ -/***************************************************************************/ - -#define FT_LZW_BUFFER_SIZE 4096 - - typedef struct FT_LZWFileRec_ - { - FT_Stream source; /* parent/source stream */ - FT_Stream stream; /* embedding stream */ - FT_Memory memory; /* memory allocator */ - FT_LzwStateRec lzw; /* lzw decompressor state */ - - FT_Byte buffer[FT_LZW_BUFFER_SIZE]; /* output buffer */ - FT_ULong pos; /* position in output */ - FT_Byte* cursor; - FT_Byte* limit; - - } FT_LZWFileRec, *FT_LZWFile; - - - /* check and skip .Z header */ - static FT_Error - ft_lzw_check_header( FT_Stream stream ) - { - FT_Error error; - FT_Byte head[2]; - - - if ( FT_STREAM_SEEK( 0 ) || - FT_STREAM_READ( head, 2 ) ) - goto Exit; - - /* head[0] && head[1] are the magic numbers */ - if ( head[0] != 0x1f || - head[1] != 0x9d ) - error = LZW_Err_Invalid_File_Format; - - Exit: - return error; - } - - - static FT_Error - ft_lzw_file_init( FT_LZWFile zip, - FT_Stream stream, - FT_Stream source ) - { - FT_LzwState lzw = &zip->lzw; - FT_Error error = LZW_Err_Ok; - - - zip->stream = stream; - zip->source = source; - zip->memory = stream->memory; - - zip->limit = zip->buffer + FT_LZW_BUFFER_SIZE; - zip->cursor = zip->limit; - zip->pos = 0; - - /* check and skip .Z header */ - { - stream = source; - - error = ft_lzw_check_header( source ); - if ( error ) - goto Exit; - } - - /* initialize internal lzw variable */ - ft_lzwstate_init( lzw, source ); - - Exit: - return error; - } - - - static void - ft_lzw_file_done( FT_LZWFile zip ) - { - /* clear the rest */ - ft_lzwstate_done( &zip->lzw ); - - zip->memory = NULL; - zip->source = NULL; - zip->stream = NULL; - } - - - static FT_Error - ft_lzw_file_reset( FT_LZWFile zip ) - { - FT_Stream stream = zip->source; - FT_Error error; - - - if ( !FT_STREAM_SEEK( 0 ) ) - { - ft_lzwstate_reset( &zip->lzw ); - - zip->limit = zip->buffer + FT_LZW_BUFFER_SIZE; - zip->cursor = zip->limit; - zip->pos = 0; - } - - return error; - } - - - static FT_Error - ft_lzw_file_fill_output( FT_LZWFile zip ) - { - FT_LzwState lzw = &zip->lzw; - FT_ULong count; - FT_Error error = 0; - - - zip->cursor = zip->buffer; - - count = ft_lzwstate_io( lzw, zip->buffer, FT_LZW_BUFFER_SIZE ); - - zip->limit = zip->cursor + count; - - if ( count == 0 ) - error = LZW_Err_Invalid_Stream_Operation; - - return error; - } - - - /* fill output buffer; `count' must be <= FT_LZW_BUFFER_SIZE */ - static FT_Error - ft_lzw_file_skip_output( FT_LZWFile zip, - FT_ULong count ) - { - FT_Error error = LZW_Err_Ok; - - - /* first, we skip what we can from the output buffer */ - { - FT_ULong delta = (FT_ULong)( zip->limit - zip->cursor ); - - - if ( delta >= count ) - delta = count; - - zip->cursor += delta; - zip->pos += delta; - - count -= delta; - } - - /* next, we skip as many bytes remaining as possible */ - while ( count > 0 ) - { - FT_ULong delta = FT_LZW_BUFFER_SIZE; - FT_ULong numread; - - - if ( delta > count ) - delta = count; - - numread = ft_lzwstate_io( &zip->lzw, NULL, delta ); - if ( numread < delta ) - { - /* not enough bytes */ - error = LZW_Err_Invalid_Stream_Operation; - break; - } - - zip->pos += delta; - count -= delta; - } - - return error; - } - - - static FT_ULong - ft_lzw_file_io( FT_LZWFile zip, - FT_ULong pos, - FT_Byte* buffer, - FT_ULong count ) - { - FT_ULong result = 0; - FT_Error error; - - - /* seeking backwards. */ - if ( pos < zip->pos ) - { - /* If the new position is within the output buffer, simply */ - /* decrement pointers, otherwise we reset the stream completely! */ - if ( ( zip->pos - pos ) <= (FT_ULong)( zip->cursor - zip->buffer ) ) - { - zip->cursor -= zip->pos - pos; - zip->pos = pos; - } - else - { - error = ft_lzw_file_reset( zip ); - if ( error ) - goto Exit; - } - } - - /* skip unwanted bytes */ - if ( pos > zip->pos ) - { - error = ft_lzw_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) ); - if ( error ) - goto Exit; - } - - if ( count == 0 ) - goto Exit; - - /* now read the data */ - for (;;) - { - FT_ULong delta; - - - delta = (FT_ULong)( zip->limit - zip->cursor ); - if ( delta >= count ) - delta = count; - - FT_MEM_COPY( buffer + result, zip->cursor, delta ); - result += delta; - zip->cursor += delta; - zip->pos += delta; - - count -= delta; - if ( count == 0 ) - break; - - error = ft_lzw_file_fill_output( zip ); - if ( error ) - break; - } - - Exit: - return result; - } - - -/***************************************************************************/ -/***************************************************************************/ -/***** *****/ -/***** L Z W E M B E D D I N G S T R E A M *****/ -/***** *****/ -/***************************************************************************/ -/***************************************************************************/ - - static void - ft_lzw_stream_close( FT_Stream stream ) - { - FT_LZWFile zip = (FT_LZWFile)stream->descriptor.pointer; - FT_Memory memory = stream->memory; - - - if ( zip ) - { - /* finalize lzw file descriptor */ - ft_lzw_file_done( zip ); - - FT_FREE( zip ); - - stream->descriptor.pointer = NULL; - } - } - - - static FT_ULong - ft_lzw_stream_io( FT_Stream stream, - FT_ULong pos, - FT_Byte* buffer, - FT_ULong count ) - { - FT_LZWFile zip = (FT_LZWFile)stream->descriptor.pointer; - - - return ft_lzw_file_io( zip, pos, buffer, count ); - } - - - FT_EXPORT_DEF( FT_Error ) - FT_Stream_OpenLZW( FT_Stream stream, - FT_Stream source ) - { - FT_Error error; - FT_Memory memory = source->memory; - FT_LZWFile zip; - - - /* - * Check the header right now; this prevents allocation of a huge - * LZWFile object (400 KByte of heap memory) if not necessary. - * - * Did I mention that you should never use .Z compressed font - * files? - */ - error = ft_lzw_check_header( source ); - if ( error ) - goto Exit; - - FT_ZERO( stream ); - stream->memory = memory; - - if ( !FT_NEW( zip ) ) - { - error = ft_lzw_file_init( zip, stream, source ); - if ( error ) - { - FT_FREE( zip ); - goto Exit; - } - - stream->descriptor.pointer = zip; - } - - stream->size = 0x7FFFFFFFL; /* don't know the real size! */ - stream->pos = 0; - stream->base = 0; - stream->read = ft_lzw_stream_io; - stream->close = ft_lzw_stream_close; - - Exit: - return error; - } - - -#include "ftzopen.c" - - -#else /* !FT_CONFIG_OPTION_USE_LZW */ - - - FT_EXPORT_DEF( FT_Error ) - FT_Stream_OpenLZW( FT_Stream stream, - FT_Stream source ) - { - FT_UNUSED( stream ); - FT_UNUSED( source ); - - return LZW_Err_Unimplemented_Feature; - } - - -#endif /* !FT_CONFIG_OPTION_USE_LZW */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftlzw.c */ +/* */ +/* FreeType support for .Z compressed files. */ +/* */ +/* This optional component relies on NetBSD's zopen(). It should mainly */ +/* be used to parse compressed PCF fonts, as found with many X11 server */ +/* distributions. */ +/* */ +/* Copyright 2004, 2005, 2006 by */ +/* Albert Chin-A-Young. */ +/* */ +/* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#include +#include FT_INTERNAL_MEMORY_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_DEBUG_H +#include FT_LZW_H +#include +#include + + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX LZW_Err_ +#define FT_ERR_BASE FT_Mod_Err_LZW + +#include FT_ERRORS_H + + +#ifdef FT_CONFIG_OPTION_USE_LZW + +#include "ftzopen.h" + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** M E M O R Y M A N A G E M E N T *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** F I L E D E S C R I P T O R *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + +#define FT_LZW_BUFFER_SIZE 4096 + + typedef struct FT_LZWFileRec_ + { + FT_Stream source; /* parent/source stream */ + FT_Stream stream; /* embedding stream */ + FT_Memory memory; /* memory allocator */ + FT_LzwStateRec lzw; /* lzw decompressor state */ + + FT_Byte buffer[FT_LZW_BUFFER_SIZE]; /* output buffer */ + FT_ULong pos; /* position in output */ + FT_Byte* cursor; + FT_Byte* limit; + + } FT_LZWFileRec, *FT_LZWFile; + + + /* check and skip .Z header */ + static FT_Error + ft_lzw_check_header( FT_Stream stream ) + { + FT_Error error; + FT_Byte head[2]; + + + if ( FT_STREAM_SEEK( 0 ) || + FT_STREAM_READ( head, 2 ) ) + goto Exit; + + /* head[0] && head[1] are the magic numbers */ + if ( head[0] != 0x1f || + head[1] != 0x9d ) + error = LZW_Err_Invalid_File_Format; + + Exit: + return error; + } + + + static FT_Error + ft_lzw_file_init( FT_LZWFile zip, + FT_Stream stream, + FT_Stream source ) + { + FT_LzwState lzw = &zip->lzw; + FT_Error error = LZW_Err_Ok; + + + zip->stream = stream; + zip->source = source; + zip->memory = stream->memory; + + zip->limit = zip->buffer + FT_LZW_BUFFER_SIZE; + zip->cursor = zip->limit; + zip->pos = 0; + + /* check and skip .Z header */ + { + stream = source; + + error = ft_lzw_check_header( source ); + if ( error ) + goto Exit; + } + + /* initialize internal lzw variable */ + ft_lzwstate_init( lzw, source ); + + Exit: + return error; + } + + + static void + ft_lzw_file_done( FT_LZWFile zip ) + { + /* clear the rest */ + ft_lzwstate_done( &zip->lzw ); + + zip->memory = NULL; + zip->source = NULL; + zip->stream = NULL; + } + + + static FT_Error + ft_lzw_file_reset( FT_LZWFile zip ) + { + FT_Stream stream = zip->source; + FT_Error error; + + + if ( !FT_STREAM_SEEK( 0 ) ) + { + ft_lzwstate_reset( &zip->lzw ); + + zip->limit = zip->buffer + FT_LZW_BUFFER_SIZE; + zip->cursor = zip->limit; + zip->pos = 0; + } + + return error; + } + + + static FT_Error + ft_lzw_file_fill_output( FT_LZWFile zip ) + { + FT_LzwState lzw = &zip->lzw; + FT_ULong count; + FT_Error error = 0; + + + zip->cursor = zip->buffer; + + count = ft_lzwstate_io( lzw, zip->buffer, FT_LZW_BUFFER_SIZE ); + + zip->limit = zip->cursor + count; + + if ( count == 0 ) + error = LZW_Err_Invalid_Stream_Operation; + + return error; + } + + + /* fill output buffer; `count' must be <= FT_LZW_BUFFER_SIZE */ + static FT_Error + ft_lzw_file_skip_output( FT_LZWFile zip, + FT_ULong count ) + { + FT_Error error = LZW_Err_Ok; + + + /* first, we skip what we can from the output buffer */ + { + FT_ULong delta = (FT_ULong)( zip->limit - zip->cursor ); + + + if ( delta >= count ) + delta = count; + + zip->cursor += delta; + zip->pos += delta; + + count -= delta; + } + + /* next, we skip as many bytes remaining as possible */ + while ( count > 0 ) + { + FT_ULong delta = FT_LZW_BUFFER_SIZE; + FT_ULong numread; + + + if ( delta > count ) + delta = count; + + numread = ft_lzwstate_io( &zip->lzw, NULL, delta ); + if ( numread < delta ) + { + /* not enough bytes */ + error = LZW_Err_Invalid_Stream_Operation; + break; + } + + zip->pos += delta; + count -= delta; + } + + return error; + } + + + static FT_ULong + ft_lzw_file_io( FT_LZWFile zip, + FT_ULong pos, + FT_Byte* buffer, + FT_ULong count ) + { + FT_ULong result = 0; + FT_Error error; + + + /* seeking backwards. */ + if ( pos < zip->pos ) + { + /* If the new position is within the output buffer, simply */ + /* decrement pointers, otherwise we reset the stream completely! */ + if ( ( zip->pos - pos ) <= (FT_ULong)( zip->cursor - zip->buffer ) ) + { + zip->cursor -= zip->pos - pos; + zip->pos = pos; + } + else + { + error = ft_lzw_file_reset( zip ); + if ( error ) + goto Exit; + } + } + + /* skip unwanted bytes */ + if ( pos > zip->pos ) + { + error = ft_lzw_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) ); + if ( error ) + goto Exit; + } + + if ( count == 0 ) + goto Exit; + + /* now read the data */ + for (;;) + { + FT_ULong delta; + + + delta = (FT_ULong)( zip->limit - zip->cursor ); + if ( delta >= count ) + delta = count; + + FT_MEM_COPY( buffer + result, zip->cursor, delta ); + result += delta; + zip->cursor += delta; + zip->pos += delta; + + count -= delta; + if ( count == 0 ) + break; + + error = ft_lzw_file_fill_output( zip ); + if ( error ) + break; + } + + Exit: + return result; + } + + +/***************************************************************************/ +/***************************************************************************/ +/***** *****/ +/***** L Z W E M B E D D I N G S T R E A M *****/ +/***** *****/ +/***************************************************************************/ +/***************************************************************************/ + + static void + ft_lzw_stream_close( FT_Stream stream ) + { + FT_LZWFile zip = (FT_LZWFile)stream->descriptor.pointer; + FT_Memory memory = stream->memory; + + + if ( zip ) + { + /* finalize lzw file descriptor */ + ft_lzw_file_done( zip ); + + FT_FREE( zip ); + + stream->descriptor.pointer = NULL; + } + } + + + static FT_ULong + ft_lzw_stream_io( FT_Stream stream, + FT_ULong pos, + FT_Byte* buffer, + FT_ULong count ) + { + FT_LZWFile zip = (FT_LZWFile)stream->descriptor.pointer; + + + return ft_lzw_file_io( zip, pos, buffer, count ); + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Stream_OpenLZW( FT_Stream stream, + FT_Stream source ) + { + FT_Error error; + FT_Memory memory = source->memory; + FT_LZWFile zip; + + + /* + * Check the header right now; this prevents allocation of a huge + * LZWFile object (400 KByte of heap memory) if not necessary. + * + * Did I mention that you should never use .Z compressed font + * files? + */ + error = ft_lzw_check_header( source ); + if ( error ) + goto Exit; + + FT_ZERO( stream ); + stream->memory = memory; + + if ( !FT_NEW( zip ) ) + { + error = ft_lzw_file_init( zip, stream, source ); + if ( error ) + { + FT_FREE( zip ); + goto Exit; + } + + stream->descriptor.pointer = zip; + } + + stream->size = 0x7FFFFFFFL; /* don't know the real size! */ + stream->pos = 0; + stream->base = 0; + stream->read = ft_lzw_stream_io; + stream->close = ft_lzw_stream_close; + + Exit: + return error; + } + + +#include "ftzopen.c" + + +#else /* !FT_CONFIG_OPTION_USE_LZW */ + + + FT_EXPORT_DEF( FT_Error ) + FT_Stream_OpenLZW( FT_Stream stream, + FT_Stream source ) + { + FT_UNUSED( stream ); + FT_UNUSED( source ); + + return LZW_Err_Unimplemented_Feature; + } + + +#endif /* !FT_CONFIG_OPTION_USE_LZW */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.c b/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.c index fc7831510d1..c2bf33bdad4 100644 --- a/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.c +++ b/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.c @@ -1,398 +1,398 @@ -/***************************************************************************/ -/* */ -/* ftzopen.c */ -/* */ -/* FreeType support for .Z compressed files. */ -/* */ -/* This optional component relies on NetBSD's zopen(). It should mainly */ -/* be used to parse compressed PCF fonts, as found with many X11 server */ -/* distributions. */ -/* */ -/* Copyright 2005, 2006, 2007 by David Turner. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#include "ftzopen.h" -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H - - - static int - ft_lzwstate_refill( FT_LzwState state ) - { - FT_ULong count; - - - if ( state->in_eof ) - return -1; - - count = FT_Stream_TryRead( state->source, - state->buf_tab, - state->num_bits ); /* WHY? */ - - state->buf_size = (FT_UInt)count; - state->buf_total += count; - state->in_eof = FT_BOOL( count < state->num_bits ); - state->buf_offset = 0; - state->buf_size = ( state->buf_size << 3 ) - ( state->num_bits - 1 ); - - if ( count == 0 ) /* end of file */ - return -1; - - return 0; - } - - - static FT_Int32 - ft_lzwstate_get_code( FT_LzwState state ) - { - FT_UInt num_bits = state->num_bits; - FT_Int offset = state->buf_offset; - FT_Byte* p; - FT_Int result; - - - if ( state->buf_clear || - offset >= state->buf_size || - state->free_ent >= state->free_bits ) - { - if ( state->free_ent >= state->free_bits ) - { - state->num_bits = ++num_bits; - state->free_bits = state->num_bits < state->max_bits - ? (FT_UInt)( ( 1UL << num_bits ) - 256 ) - : state->max_free + 1; - } - - if ( state->buf_clear ) - { - state->num_bits = num_bits = LZW_INIT_BITS; - state->free_bits = (FT_UInt)( ( 1UL << num_bits ) - 256 ); - state->buf_clear = 0; - } - - if ( ft_lzwstate_refill( state ) < 0 ) - return -1; - - offset = 0; - } - - state->buf_offset = offset + num_bits; - - p = &state->buf_tab[offset >> 3]; - offset &= 7; - result = *p++ >> offset; - offset = 8 - offset; - num_bits -= offset; - - if ( num_bits >= 8 ) - { - result |= *p++ << offset; - offset += 8; - num_bits -= 8; - } - if ( num_bits > 0 ) - result |= ( *p & LZW_MASK( num_bits ) ) << offset; - - return result; - } - - - /* grow the character stack */ - static int - ft_lzwstate_stack_grow( FT_LzwState state ) - { - if ( state->stack_top >= state->stack_size ) - { - FT_Memory memory = state->memory; - FT_Error error; - FT_UInt old_size = state->stack_size; - FT_UInt new_size = old_size; - - new_size = new_size + ( new_size >> 1 ) + 4; - - if ( state->stack == state->stack_0 ) - { - state->stack = NULL; - old_size = 0; - } - - if ( FT_RENEW_ARRAY( state->stack, old_size, new_size ) ) - return -1; - - state->stack_size = new_size; - } - return 0; - } - - - /* grow the prefix/suffix arrays */ - static int - ft_lzwstate_prefix_grow( FT_LzwState state ) - { - FT_UInt old_size = state->prefix_size; - FT_UInt new_size = old_size; - FT_Memory memory = state->memory; - FT_Error error; - - - if ( new_size == 0 ) /* first allocation -> 9 bits */ - new_size = 512; - else - new_size += new_size >> 2; /* don't grow too fast */ - - /* - * Note that the `suffix' array is located in the same memory block - * pointed to by `prefix'. - * - * I know that sizeof(FT_Byte) == 1 by definition, but it is clearer - * to write it literally. - * - */ - if ( FT_REALLOC_MULT( state->prefix, old_size, new_size, - sizeof ( FT_UShort ) + sizeof ( FT_Byte ) ) ) - return -1; - - /* now adjust `suffix' and move the data accordingly */ - state->suffix = (FT_Byte*)( state->prefix + new_size ); - - FT_MEM_MOVE( state->suffix, - state->prefix + old_size, - old_size * sizeof ( FT_Byte ) ); - - state->prefix_size = new_size; - return 0; - } - - - FT_LOCAL_DEF( void ) - ft_lzwstate_reset( FT_LzwState state ) - { - state->in_eof = 0; - state->buf_offset = 0; - state->buf_size = 0; - state->buf_clear = 0; - state->buf_total = 0; - state->stack_top = 0; - state->num_bits = LZW_INIT_BITS; - state->phase = FT_LZW_PHASE_START; - } - - - FT_LOCAL_DEF( void ) - ft_lzwstate_init( FT_LzwState state, - FT_Stream source ) - { - FT_ZERO( state ); - - state->source = source; - state->memory = source->memory; - - state->prefix = NULL; - state->suffix = NULL; - state->prefix_size = 0; - - state->stack = state->stack_0; - state->stack_size = sizeof ( state->stack_0 ); - - ft_lzwstate_reset( state ); - } - - - FT_LOCAL_DEF( void ) - ft_lzwstate_done( FT_LzwState state ) - { - FT_Memory memory = state->memory; - - - ft_lzwstate_reset( state ); - - if ( state->stack != state->stack_0 ) - FT_FREE( state->stack ); - - FT_FREE( state->prefix ); - state->suffix = NULL; - - FT_ZERO( state ); - } - - -#define FTLZW_STACK_PUSH( c ) \ - FT_BEGIN_STMNT \ - if ( state->stack_top >= state->stack_size && \ - ft_lzwstate_stack_grow( state ) < 0 ) \ - goto Eof; \ - \ - state->stack[state->stack_top++] = (FT_Byte)(c); \ - FT_END_STMNT - - - FT_LOCAL_DEF( FT_ULong ) - ft_lzwstate_io( FT_LzwState state, - FT_Byte* buffer, - FT_ULong out_size ) - { - FT_ULong result = 0; - - FT_UInt old_char = state->old_char; - FT_UInt old_code = state->old_code; - FT_UInt in_code = state->in_code; - - - if ( out_size == 0 ) - goto Exit; - - switch ( state->phase ) - { - case FT_LZW_PHASE_START: - { - FT_Byte max_bits; - FT_Int32 c; - - - /* skip magic bytes, and read max_bits + block_flag */ - if ( FT_Stream_Seek( state->source, 2 ) != 0 || - FT_Stream_TryRead( state->source, &max_bits, 1 ) != 1 ) - goto Eof; - - state->max_bits = max_bits & LZW_BIT_MASK; - state->block_mode = max_bits & LZW_BLOCK_MASK; - state->max_free = (FT_UInt)( ( 1UL << state->max_bits ) - 256 ); - - if ( state->max_bits > LZW_MAX_BITS ) - goto Eof; - - state->num_bits = LZW_INIT_BITS; - state->free_ent = ( state->block_mode ? LZW_FIRST - : LZW_CLEAR ) - 256; - in_code = 0; - - state->free_bits = state->num_bits < state->max_bits - ? (FT_UInt)( ( 1UL << state->num_bits ) - 256 ) - : state->max_free + 1; - - c = ft_lzwstate_get_code( state ); - if ( c < 0 ) - goto Eof; - - old_code = old_char = (FT_UInt)c; - - if ( buffer ) - buffer[result] = (FT_Byte)old_char; - - if ( ++result >= out_size ) - goto Exit; - - state->phase = FT_LZW_PHASE_CODE; - } - /* fall-through */ - - case FT_LZW_PHASE_CODE: - { - FT_Int32 c; - FT_UInt code; - - - NextCode: - c = ft_lzwstate_get_code( state ); - if ( c < 0 ) - goto Eof; - - code = (FT_UInt)c; - - if ( code == LZW_CLEAR && state->block_mode ) - { - /* why not LZW_FIRST-256 ? */ - state->free_ent = ( LZW_FIRST - 1 ) - 256; - state->buf_clear = 1; - c = ft_lzwstate_get_code( state ); - if ( c < 0 ) - goto Eof; - - code = (FT_UInt)c; - } - - in_code = code; /* save code for later */ - - if ( code >= 256U ) - { - /* special case for KwKwKwK */ - if ( code - 256U >= state->free_ent ) - { - FTLZW_STACK_PUSH( old_char ); - code = old_code; - } - - while ( code >= 256U ) - { - FTLZW_STACK_PUSH( state->suffix[code - 256] ); - code = state->prefix[code - 256]; - } - } - - old_char = code; - FTLZW_STACK_PUSH( old_char ); - - state->phase = FT_LZW_PHASE_STACK; - } - /* fall-through */ - - case FT_LZW_PHASE_STACK: - { - while ( state->stack_top > 0 ) - { - --state->stack_top; - - if ( buffer ) - buffer[result] = state->stack[state->stack_top]; - - if ( ++result == out_size ) - goto Exit; - } - - /* now create new entry */ - if ( state->free_ent < state->max_free ) - { - if ( state->free_ent >= state->prefix_size && - ft_lzwstate_prefix_grow( state ) < 0 ) - goto Eof; - - FT_ASSERT( state->free_ent < state->prefix_size ); - - state->prefix[state->free_ent] = (FT_UShort)old_code; - state->suffix[state->free_ent] = (FT_Byte) old_char; - - state->free_ent += 1; - } - - old_code = in_code; - - state->phase = FT_LZW_PHASE_CODE; - goto NextCode; - } - - default: /* state == EOF */ - ; - } - - Exit: - state->old_code = old_code; - state->old_char = old_char; - state->in_code = in_code; - - return result; - - Eof: - state->phase = FT_LZW_PHASE_EOF; - goto Exit; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* ftzopen.c */ +/* */ +/* FreeType support for .Z compressed files. */ +/* */ +/* This optional component relies on NetBSD's zopen(). It should mainly */ +/* be used to parse compressed PCF fonts, as found with many X11 server */ +/* distributions. */ +/* */ +/* Copyright 2005, 2006, 2007 by David Turner. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#include "ftzopen.h" +#include FT_INTERNAL_MEMORY_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_DEBUG_H + + + static int + ft_lzwstate_refill( FT_LzwState state ) + { + FT_ULong count; + + + if ( state->in_eof ) + return -1; + + count = FT_Stream_TryRead( state->source, + state->buf_tab, + state->num_bits ); /* WHY? */ + + state->buf_size = (FT_UInt)count; + state->buf_total += count; + state->in_eof = FT_BOOL( count < state->num_bits ); + state->buf_offset = 0; + state->buf_size = ( state->buf_size << 3 ) - ( state->num_bits - 1 ); + + if ( count == 0 ) /* end of file */ + return -1; + + return 0; + } + + + static FT_Int32 + ft_lzwstate_get_code( FT_LzwState state ) + { + FT_UInt num_bits = state->num_bits; + FT_Int offset = state->buf_offset; + FT_Byte* p; + FT_Int result; + + + if ( state->buf_clear || + offset >= state->buf_size || + state->free_ent >= state->free_bits ) + { + if ( state->free_ent >= state->free_bits ) + { + state->num_bits = ++num_bits; + state->free_bits = state->num_bits < state->max_bits + ? (FT_UInt)( ( 1UL << num_bits ) - 256 ) + : state->max_free + 1; + } + + if ( state->buf_clear ) + { + state->num_bits = num_bits = LZW_INIT_BITS; + state->free_bits = (FT_UInt)( ( 1UL << num_bits ) - 256 ); + state->buf_clear = 0; + } + + if ( ft_lzwstate_refill( state ) < 0 ) + return -1; + + offset = 0; + } + + state->buf_offset = offset + num_bits; + + p = &state->buf_tab[offset >> 3]; + offset &= 7; + result = *p++ >> offset; + offset = 8 - offset; + num_bits -= offset; + + if ( num_bits >= 8 ) + { + result |= *p++ << offset; + offset += 8; + num_bits -= 8; + } + if ( num_bits > 0 ) + result |= ( *p & LZW_MASK( num_bits ) ) << offset; + + return result; + } + + + /* grow the character stack */ + static int + ft_lzwstate_stack_grow( FT_LzwState state ) + { + if ( state->stack_top >= state->stack_size ) + { + FT_Memory memory = state->memory; + FT_Error error; + FT_UInt old_size = state->stack_size; + FT_UInt new_size = old_size; + + new_size = new_size + ( new_size >> 1 ) + 4; + + if ( state->stack == state->stack_0 ) + { + state->stack = NULL; + old_size = 0; + } + + if ( FT_RENEW_ARRAY( state->stack, old_size, new_size ) ) + return -1; + + state->stack_size = new_size; + } + return 0; + } + + + /* grow the prefix/suffix arrays */ + static int + ft_lzwstate_prefix_grow( FT_LzwState state ) + { + FT_UInt old_size = state->prefix_size; + FT_UInt new_size = old_size; + FT_Memory memory = state->memory; + FT_Error error; + + + if ( new_size == 0 ) /* first allocation -> 9 bits */ + new_size = 512; + else + new_size += new_size >> 2; /* don't grow too fast */ + + /* + * Note that the `suffix' array is located in the same memory block + * pointed to by `prefix'. + * + * I know that sizeof(FT_Byte) == 1 by definition, but it is clearer + * to write it literally. + * + */ + if ( FT_REALLOC_MULT( state->prefix, old_size, new_size, + sizeof ( FT_UShort ) + sizeof ( FT_Byte ) ) ) + return -1; + + /* now adjust `suffix' and move the data accordingly */ + state->suffix = (FT_Byte*)( state->prefix + new_size ); + + FT_MEM_MOVE( state->suffix, + state->prefix + old_size, + old_size * sizeof ( FT_Byte ) ); + + state->prefix_size = new_size; + return 0; + } + + + FT_LOCAL_DEF( void ) + ft_lzwstate_reset( FT_LzwState state ) + { + state->in_eof = 0; + state->buf_offset = 0; + state->buf_size = 0; + state->buf_clear = 0; + state->buf_total = 0; + state->stack_top = 0; + state->num_bits = LZW_INIT_BITS; + state->phase = FT_LZW_PHASE_START; + } + + + FT_LOCAL_DEF( void ) + ft_lzwstate_init( FT_LzwState state, + FT_Stream source ) + { + FT_ZERO( state ); + + state->source = source; + state->memory = source->memory; + + state->prefix = NULL; + state->suffix = NULL; + state->prefix_size = 0; + + state->stack = state->stack_0; + state->stack_size = sizeof ( state->stack_0 ); + + ft_lzwstate_reset( state ); + } + + + FT_LOCAL_DEF( void ) + ft_lzwstate_done( FT_LzwState state ) + { + FT_Memory memory = state->memory; + + + ft_lzwstate_reset( state ); + + if ( state->stack != state->stack_0 ) + FT_FREE( state->stack ); + + FT_FREE( state->prefix ); + state->suffix = NULL; + + FT_ZERO( state ); + } + + +#define FTLZW_STACK_PUSH( c ) \ + FT_BEGIN_STMNT \ + if ( state->stack_top >= state->stack_size && \ + ft_lzwstate_stack_grow( state ) < 0 ) \ + goto Eof; \ + \ + state->stack[state->stack_top++] = (FT_Byte)(c); \ + FT_END_STMNT + + + FT_LOCAL_DEF( FT_ULong ) + ft_lzwstate_io( FT_LzwState state, + FT_Byte* buffer, + FT_ULong out_size ) + { + FT_ULong result = 0; + + FT_UInt old_char = state->old_char; + FT_UInt old_code = state->old_code; + FT_UInt in_code = state->in_code; + + + if ( out_size == 0 ) + goto Exit; + + switch ( state->phase ) + { + case FT_LZW_PHASE_START: + { + FT_Byte max_bits; + FT_Int32 c; + + + /* skip magic bytes, and read max_bits + block_flag */ + if ( FT_Stream_Seek( state->source, 2 ) != 0 || + FT_Stream_TryRead( state->source, &max_bits, 1 ) != 1 ) + goto Eof; + + state->max_bits = max_bits & LZW_BIT_MASK; + state->block_mode = max_bits & LZW_BLOCK_MASK; + state->max_free = (FT_UInt)( ( 1UL << state->max_bits ) - 256 ); + + if ( state->max_bits > LZW_MAX_BITS ) + goto Eof; + + state->num_bits = LZW_INIT_BITS; + state->free_ent = ( state->block_mode ? LZW_FIRST + : LZW_CLEAR ) - 256; + in_code = 0; + + state->free_bits = state->num_bits < state->max_bits + ? (FT_UInt)( ( 1UL << state->num_bits ) - 256 ) + : state->max_free + 1; + + c = ft_lzwstate_get_code( state ); + if ( c < 0 ) + goto Eof; + + old_code = old_char = (FT_UInt)c; + + if ( buffer ) + buffer[result] = (FT_Byte)old_char; + + if ( ++result >= out_size ) + goto Exit; + + state->phase = FT_LZW_PHASE_CODE; + } + /* fall-through */ + + case FT_LZW_PHASE_CODE: + { + FT_Int32 c; + FT_UInt code; + + + NextCode: + c = ft_lzwstate_get_code( state ); + if ( c < 0 ) + goto Eof; + + code = (FT_UInt)c; + + if ( code == LZW_CLEAR && state->block_mode ) + { + /* why not LZW_FIRST-256 ? */ + state->free_ent = ( LZW_FIRST - 1 ) - 256; + state->buf_clear = 1; + c = ft_lzwstate_get_code( state ); + if ( c < 0 ) + goto Eof; + + code = (FT_UInt)c; + } + + in_code = code; /* save code for later */ + + if ( code >= 256U ) + { + /* special case for KwKwKwK */ + if ( code - 256U >= state->free_ent ) + { + FTLZW_STACK_PUSH( old_char ); + code = old_code; + } + + while ( code >= 256U ) + { + FTLZW_STACK_PUSH( state->suffix[code - 256] ); + code = state->prefix[code - 256]; + } + } + + old_char = code; + FTLZW_STACK_PUSH( old_char ); + + state->phase = FT_LZW_PHASE_STACK; + } + /* fall-through */ + + case FT_LZW_PHASE_STACK: + { + while ( state->stack_top > 0 ) + { + --state->stack_top; + + if ( buffer ) + buffer[result] = state->stack[state->stack_top]; + + if ( ++result == out_size ) + goto Exit; + } + + /* now create new entry */ + if ( state->free_ent < state->max_free ) + { + if ( state->free_ent >= state->prefix_size && + ft_lzwstate_prefix_grow( state ) < 0 ) + goto Eof; + + FT_ASSERT( state->free_ent < state->prefix_size ); + + state->prefix[state->free_ent] = (FT_UShort)old_code; + state->suffix[state->free_ent] = (FT_Byte) old_char; + + state->free_ent += 1; + } + + old_code = in_code; + + state->phase = FT_LZW_PHASE_CODE; + goto NextCode; + } + + default: /* state == EOF */ + ; + } + + Exit: + state->old_code = old_code; + state->old_char = old_char; + state->in_code = in_code; + + return result; + + Eof: + state->phase = FT_LZW_PHASE_EOF; + goto Exit; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.h b/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.h index 97881149c22..f5788f25bff 100644 --- a/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.h +++ b/reactos/dll/3rdparty/freetype/src/lzw/ftzopen.h @@ -1,171 +1,171 @@ -/***************************************************************************/ -/* */ -/* ftzopen.h */ -/* */ -/* FreeType support for .Z compressed files. */ -/* */ -/* This optional component relies on NetBSD's zopen(). It should mainly */ -/* be used to parse compressed PCF fonts, as found with many X11 server */ -/* distributions. */ -/* */ -/* Copyright 2005, 2006, 2007 by David Turner. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#ifndef __FT_ZOPEN_H__ -#define __FT_ZOPEN_H__ - -#include -#include FT_FREETYPE_H - - - /* - * This is a complete re-implementation of the LZW file reader, - * since the old one was incredibly badly written, using - * 400 KByte of heap memory before decompressing anything. - * - */ - -#define FT_LZW_IN_BUFF_SIZE 64 -#define FT_LZW_DEFAULT_STACK_SIZE 64 - -#define LZW_INIT_BITS 9 -#define LZW_MAX_BITS 16 - -#define LZW_CLEAR 256 -#define LZW_FIRST 257 - -#define LZW_BIT_MASK 0x1f -#define LZW_BLOCK_MASK 0x80 -#define LZW_MASK( n ) ( ( 1U << (n) ) - 1U ) - - - typedef enum - { - FT_LZW_PHASE_START = 0, - FT_LZW_PHASE_CODE, - FT_LZW_PHASE_STACK, - FT_LZW_PHASE_EOF - - } FT_LzwPhase; - - - /* - * state of LZW decompressor - * - * small technical note - * -------------------- - * - * We use a few tricks in this implementation that are explained here to - * ease debugging and maintenance. - * - * - First of all, the `prefix' and `suffix' arrays contain the suffix - * and prefix for codes over 256; this means that - * - * prefix_of(code) == state->prefix[code-256] - * suffix_of(code) == state->suffix[code-256] - * - * Each prefix is a 16-bit code, and each suffix an 8-bit byte. - * - * Both arrays are stored in a single memory block, pointed to by - * `state->prefix'. This means that the following equality is always - * true: - * - * state->suffix == (FT_Byte*)(state->prefix + state->prefix_size) - * - * Of course, state->prefix_size is the number of prefix/suffix slots - * in the arrays, corresponding to codes 256..255+prefix_size. - * - * - `free_ent' is the index of the next free entry in the `prefix' - * and `suffix' arrays. This means that the corresponding `next free - * code' is really `256+free_ent'. - * - * Moreover, `max_free' is the maximum value that `free_ent' can reach. - * - * `max_free' corresponds to `(1 << max_bits) - 256'. Note that this - * value is always <= 0xFF00, which means that both `free_ent' and - * `max_free' can be stored in an FT_UInt variable, even on 16-bit - * machines. - * - * If `free_ent == max_free', you cannot add new codes to the - * prefix/suffix table. - * - * - `num_bits' is the current number of code bits, starting at 9 and - * growing each time `free_ent' reaches the value of `free_bits'. The - * latter is computed as follows - * - * if num_bits < max_bits: - * free_bits = (1 << num_bits)-256 - * else: - * free_bits = max_free + 1 - * - * Since the value of `max_free + 1' can never be reached by - * `free_ent', `num_bits' cannot grow larger than `max_bits'. - */ - - typedef struct _FT_LzwStateRec - { - FT_LzwPhase phase; - FT_Int in_eof; - - FT_Byte buf_tab[16]; - FT_Int buf_offset; - FT_Int buf_size; - FT_Bool buf_clear; - FT_Int buf_total; - - FT_UInt max_bits; /* max code bits, from file header */ - FT_Int block_mode; /* block mode flag, from file header */ - FT_UInt max_free; /* (1 << max_bits) - 256 */ - - FT_UInt num_bits; /* current code bit number */ - FT_UInt free_ent; /* index of next free entry */ - FT_UInt free_bits; /* if reached by free_ent, increment num_bits */ - FT_UInt old_code; - FT_UInt old_char; - FT_UInt in_code; - - FT_UShort* prefix; /* always dynamically allocated / reallocated */ - FT_Byte* suffix; /* suffix = (FT_Byte*)(prefix + prefix_size) */ - FT_UInt prefix_size; /* number of slots in `prefix' or `suffix' */ - - FT_Byte* stack; /* character stack */ - FT_UInt stack_top; - FT_UInt stack_size; - FT_Byte stack_0[FT_LZW_DEFAULT_STACK_SIZE]; /* minimize heap alloc */ - - FT_Stream source; /* source stream */ - FT_Memory memory; - - } FT_LzwStateRec, *FT_LzwState; - - - FT_LOCAL( void ) - ft_lzwstate_init( FT_LzwState state, - FT_Stream source ); - - FT_LOCAL( void ) - ft_lzwstate_done( FT_LzwState state ); - - - FT_LOCAL( void ) - ft_lzwstate_reset( FT_LzwState state ); - - - FT_LOCAL( FT_ULong ) - ft_lzwstate_io( FT_LzwState state, - FT_Byte* buffer, - FT_ULong out_size ); - -/* */ - -#endif /* __FT_ZOPEN_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftzopen.h */ +/* */ +/* FreeType support for .Z compressed files. */ +/* */ +/* This optional component relies on NetBSD's zopen(). It should mainly */ +/* be used to parse compressed PCF fonts, as found with many X11 server */ +/* distributions. */ +/* */ +/* Copyright 2005, 2006, 2007 by David Turner. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#ifndef __FT_ZOPEN_H__ +#define __FT_ZOPEN_H__ + +#include +#include FT_FREETYPE_H + + + /* + * This is a complete re-implementation of the LZW file reader, + * since the old one was incredibly badly written, using + * 400 KByte of heap memory before decompressing anything. + * + */ + +#define FT_LZW_IN_BUFF_SIZE 64 +#define FT_LZW_DEFAULT_STACK_SIZE 64 + +#define LZW_INIT_BITS 9 +#define LZW_MAX_BITS 16 + +#define LZW_CLEAR 256 +#define LZW_FIRST 257 + +#define LZW_BIT_MASK 0x1f +#define LZW_BLOCK_MASK 0x80 +#define LZW_MASK( n ) ( ( 1U << (n) ) - 1U ) + + + typedef enum + { + FT_LZW_PHASE_START = 0, + FT_LZW_PHASE_CODE, + FT_LZW_PHASE_STACK, + FT_LZW_PHASE_EOF + + } FT_LzwPhase; + + + /* + * state of LZW decompressor + * + * small technical note + * -------------------- + * + * We use a few tricks in this implementation that are explained here to + * ease debugging and maintenance. + * + * - First of all, the `prefix' and `suffix' arrays contain the suffix + * and prefix for codes over 256; this means that + * + * prefix_of(code) == state->prefix[code-256] + * suffix_of(code) == state->suffix[code-256] + * + * Each prefix is a 16-bit code, and each suffix an 8-bit byte. + * + * Both arrays are stored in a single memory block, pointed to by + * `state->prefix'. This means that the following equality is always + * true: + * + * state->suffix == (FT_Byte*)(state->prefix + state->prefix_size) + * + * Of course, state->prefix_size is the number of prefix/suffix slots + * in the arrays, corresponding to codes 256..255+prefix_size. + * + * - `free_ent' is the index of the next free entry in the `prefix' + * and `suffix' arrays. This means that the corresponding `next free + * code' is really `256+free_ent'. + * + * Moreover, `max_free' is the maximum value that `free_ent' can reach. + * + * `max_free' corresponds to `(1 << max_bits) - 256'. Note that this + * value is always <= 0xFF00, which means that both `free_ent' and + * `max_free' can be stored in an FT_UInt variable, even on 16-bit + * machines. + * + * If `free_ent == max_free', you cannot add new codes to the + * prefix/suffix table. + * + * - `num_bits' is the current number of code bits, starting at 9 and + * growing each time `free_ent' reaches the value of `free_bits'. The + * latter is computed as follows + * + * if num_bits < max_bits: + * free_bits = (1 << num_bits)-256 + * else: + * free_bits = max_free + 1 + * + * Since the value of `max_free + 1' can never be reached by + * `free_ent', `num_bits' cannot grow larger than `max_bits'. + */ + + typedef struct _FT_LzwStateRec + { + FT_LzwPhase phase; + FT_Int in_eof; + + FT_Byte buf_tab[16]; + FT_Int buf_offset; + FT_Int buf_size; + FT_Bool buf_clear; + FT_Int buf_total; + + FT_UInt max_bits; /* max code bits, from file header */ + FT_Int block_mode; /* block mode flag, from file header */ + FT_UInt max_free; /* (1 << max_bits) - 256 */ + + FT_UInt num_bits; /* current code bit number */ + FT_UInt free_ent; /* index of next free entry */ + FT_UInt free_bits; /* if reached by free_ent, increment num_bits */ + FT_UInt old_code; + FT_UInt old_char; + FT_UInt in_code; + + FT_UShort* prefix; /* always dynamically allocated / reallocated */ + FT_Byte* suffix; /* suffix = (FT_Byte*)(prefix + prefix_size) */ + FT_UInt prefix_size; /* number of slots in `prefix' or `suffix' */ + + FT_Byte* stack; /* character stack */ + FT_UInt stack_top; + FT_UInt stack_size; + FT_Byte stack_0[FT_LZW_DEFAULT_STACK_SIZE]; /* minimize heap alloc */ + + FT_Stream source; /* source stream */ + FT_Memory memory; + + } FT_LzwStateRec, *FT_LzwState; + + + FT_LOCAL( void ) + ft_lzwstate_init( FT_LzwState state, + FT_Stream source ); + + FT_LOCAL( void ) + ft_lzwstate_done( FT_LzwState state ); + + + FT_LOCAL( void ) + ft_lzwstate_reset( FT_LzwState state ); + + + FT_LOCAL( FT_ULong ) + ft_lzwstate_io( FT_LzwState state, + FT_Byte* buffer, + FT_ULong out_size ); + +/* */ + +#endif /* __FT_ZOPEN_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.c index 2f85f601b66..121142eebe1 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.c @@ -1,30 +1,30 @@ -/***************************************************************************/ -/* */ -/* otvalid.c */ -/* */ -/* FreeType validator for OpenType tables (body only). */ -/* */ -/* Copyright 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include - -#include "otvbase.c" -#include "otvcommn.c" -#include "otvgdef.c" -#include "otvgpos.c" -#include "otvgsub.c" -#include "otvjstf.c" -#include "otvmod.c" - -/* END */ +/***************************************************************************/ +/* */ +/* otvalid.c */ +/* */ +/* FreeType validator for OpenType tables (body only). */ +/* */ +/* Copyright 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include + +#include "otvbase.c" +#include "otvcommn.c" +#include "otvgdef.c" +#include "otvgpos.c" +#include "otvgsub.c" +#include "otvjstf.c" +#include "otvmod.c" + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.h b/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.h index 38f030f3935..826ea098d11 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.h +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvalid.h @@ -1,72 +1,72 @@ -/***************************************************************************/ -/* */ -/* otvalid.h */ -/* */ -/* OpenType table validation (specification only). */ -/* */ -/* Copyright 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __OTVALID_H__ -#define __OTVALID_H__ - - -#include -#include FT_FREETYPE_H - -#include "otverror.h" /* must come before FT_INTERNAL_VALIDATE_H */ - -#include FT_INTERNAL_VALIDATE_H -#include FT_INTERNAL_STREAM_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( void ) - otv_BASE_validate( FT_Bytes table, - FT_Validator valid ); - - /* GSUB and GPOS tables should already be validated; */ - /* if missing, set corresponding argument to 0 */ - FT_LOCAL( void ) - otv_GDEF_validate( FT_Bytes table, - FT_Bytes gsub, - FT_Bytes gpos, - FT_Validator valid ); - - FT_LOCAL( void ) - otv_GPOS_validate( FT_Bytes table, - FT_UInt glyph_count, - FT_Validator valid ); - - FT_LOCAL( void ) - otv_GSUB_validate( FT_Bytes table, - FT_UInt glyph_count, - FT_Validator valid ); - - /* GSUB and GPOS tables should already be validated; */ - /* if missing, set corresponding argument to 0 */ - FT_LOCAL( void ) - otv_JSTF_validate( FT_Bytes table, - FT_Bytes gsub, - FT_Bytes gpos, - FT_UInt glyph_count, - FT_Validator valid ); - - -FT_END_HEADER - -#endif /* __OTVALID_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* otvalid.h */ +/* */ +/* OpenType table validation (specification only). */ +/* */ +/* Copyright 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __OTVALID_H__ +#define __OTVALID_H__ + + +#include +#include FT_FREETYPE_H + +#include "otverror.h" /* must come before FT_INTERNAL_VALIDATE_H */ + +#include FT_INTERNAL_VALIDATE_H +#include FT_INTERNAL_STREAM_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( void ) + otv_BASE_validate( FT_Bytes table, + FT_Validator valid ); + + /* GSUB and GPOS tables should already be validated; */ + /* if missing, set corresponding argument to 0 */ + FT_LOCAL( void ) + otv_GDEF_validate( FT_Bytes table, + FT_Bytes gsub, + FT_Bytes gpos, + FT_Validator valid ); + + FT_LOCAL( void ) + otv_GPOS_validate( FT_Bytes table, + FT_UInt glyph_count, + FT_Validator valid ); + + FT_LOCAL( void ) + otv_GSUB_validate( FT_Bytes table, + FT_UInt glyph_count, + FT_Validator valid ); + + /* GSUB and GPOS tables should already be validated; */ + /* if missing, set corresponding argument to 0 */ + FT_LOCAL( void ) + otv_JSTF_validate( FT_Bytes table, + FT_Bytes gsub, + FT_Bytes gpos, + FT_UInt glyph_count, + FT_Validator valid ); + + +FT_END_HEADER + +#endif /* __OTVALID_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvbase.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvbase.c index 8ad2238d6d6..4f04b518ed8 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvbase.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvbase.c @@ -1,318 +1,318 @@ -/***************************************************************************/ -/* */ -/* otvbase.c */ -/* */ -/* OpenType BASE table validation (body). */ -/* */ -/* Copyright 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "otvalid.h" -#include "otvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_otvbase - - - static void - otv_BaseCoord_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt BaseCoordFormat; - - - OTV_NAME_ENTER( "BaseCoord" ); - - OTV_LIMIT_CHECK( 4 ); - BaseCoordFormat = FT_NEXT_USHORT( p ); - p += 2; /* skip Coordinate */ - - OTV_TRACE(( " (format %d)\n", BaseCoordFormat )); - - switch ( BaseCoordFormat ) - { - case 1: /* BaseCoordFormat1 */ - break; - - case 2: /* BaseCoordFormat2 */ - OTV_LIMIT_CHECK( 4 ); /* ReferenceGlyph, BaseCoordPoint */ - break; - - case 3: /* BaseCoordFormat3 */ - OTV_LIMIT_CHECK( 2 ); - /* DeviceTable */ - otv_Device_validate( table + FT_NEXT_USHORT( p ), valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - static void - otv_BaseTagList_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt BaseTagCount; - - - OTV_NAME_ENTER( "BaseTagList" ); - - OTV_LIMIT_CHECK( 2 ); - - BaseTagCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (BaseTagCount = %d)\n", BaseTagCount )); - - OTV_LIMIT_CHECK( BaseTagCount * 4 ); /* BaselineTag */ - - OTV_EXIT; - } - - - static void - otv_BaseValues_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt BaseCoordCount; - - - OTV_NAME_ENTER( "BaseValues" ); - - OTV_LIMIT_CHECK( 4 ); - - p += 2; /* skip DefaultIndex */ - BaseCoordCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (BaseCoordCount = %d)\n", BaseCoordCount )); - - OTV_LIMIT_CHECK( BaseCoordCount * 2 ); - - /* BaseCoord */ - for ( ; BaseCoordCount > 0; BaseCoordCount-- ) - otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), valid ); - - OTV_EXIT; - } - - - static void - otv_MinMax_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt table_size; - FT_UInt FeatMinMaxCount; - - OTV_OPTIONAL_TABLE( MinCoord ); - OTV_OPTIONAL_TABLE( MaxCoord ); - - - OTV_NAME_ENTER( "MinMax" ); - - OTV_LIMIT_CHECK( 6 ); - - OTV_OPTIONAL_OFFSET( MinCoord ); - OTV_OPTIONAL_OFFSET( MaxCoord ); - FeatMinMaxCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (FeatMinMaxCount = %d)\n", FeatMinMaxCount )); - - table_size = FeatMinMaxCount * 8 + 6; - - OTV_SIZE_CHECK( MinCoord ); - if ( MinCoord ) - otv_BaseCoord_validate( table + MinCoord, valid ); - - OTV_SIZE_CHECK( MaxCoord ); - if ( MaxCoord ) - otv_BaseCoord_validate( table + MaxCoord, valid ); - - OTV_LIMIT_CHECK( FeatMinMaxCount * 8 ); - - /* FeatMinMaxRecord */ - for ( ; FeatMinMaxCount > 0; FeatMinMaxCount-- ) - { - p += 4; /* skip FeatureTableTag */ - - OTV_OPTIONAL_OFFSET( MinCoord ); - OTV_OPTIONAL_OFFSET( MaxCoord ); - - OTV_SIZE_CHECK( MinCoord ); - if ( MinCoord ) - otv_BaseCoord_validate( table + MinCoord, valid ); - - OTV_SIZE_CHECK( MaxCoord ); - if ( MaxCoord ) - otv_BaseCoord_validate( table + MaxCoord, valid ); - } - - OTV_EXIT; - } - - - static void - otv_BaseScript_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt table_size; - FT_UInt BaseLangSysCount; - - OTV_OPTIONAL_TABLE( BaseValues ); - OTV_OPTIONAL_TABLE( DefaultMinMax ); - - - OTV_NAME_ENTER( "BaseScript" ); - - OTV_LIMIT_CHECK( 6 ); - OTV_OPTIONAL_OFFSET( BaseValues ); - OTV_OPTIONAL_OFFSET( DefaultMinMax ); - BaseLangSysCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (BaseLangSysCount = %d)\n", BaseLangSysCount )); - - table_size = BaseLangSysCount * 6 + 6; - - OTV_SIZE_CHECK( BaseValues ); - if ( BaseValues ) - otv_BaseValues_validate( table + BaseValues, valid ); - - OTV_SIZE_CHECK( DefaultMinMax ); - if ( DefaultMinMax ) - otv_MinMax_validate( table + DefaultMinMax, valid ); - - OTV_LIMIT_CHECK( BaseLangSysCount * 6 ); - - /* BaseLangSysRecord */ - for ( ; BaseLangSysCount > 0; BaseLangSysCount-- ) - { - p += 4; /* skip BaseLangSysTag */ - - otv_MinMax_validate( table + FT_NEXT_USHORT( p ), valid ); - } - - OTV_EXIT; - } - - - static void - otv_BaseScriptList_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt BaseScriptCount; - - - OTV_NAME_ENTER( "BaseScriptList" ); - - OTV_LIMIT_CHECK( 2 ); - BaseScriptCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (BaseScriptCount = %d)\n", BaseScriptCount )); - - OTV_LIMIT_CHECK( BaseScriptCount * 6 ); - - /* BaseScriptRecord */ - for ( ; BaseScriptCount > 0; BaseScriptCount-- ) - { - p += 4; /* skip BaseScriptTag */ - - /* BaseScript */ - otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), valid ); - } - - OTV_EXIT; - } - - - static void - otv_Axis_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt table_size; - - OTV_OPTIONAL_TABLE( BaseTagList ); - - - OTV_NAME_ENTER( "Axis" ); - - OTV_LIMIT_CHECK( 4 ); - OTV_OPTIONAL_OFFSET( BaseTagList ); - - table_size = 4; - - OTV_SIZE_CHECK( BaseTagList ); - if ( BaseTagList ) - otv_BaseTagList_validate( table + BaseTagList, valid ); - - /* BaseScriptList */ - otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), valid ); - - OTV_EXIT; - } - - - FT_LOCAL_DEF( void ) - otv_BASE_validate( FT_Bytes table, - FT_Validator ftvalid ) - { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; - FT_UInt table_size; - - OTV_OPTIONAL_TABLE( HorizAxis ); - OTV_OPTIONAL_TABLE( VertAxis ); - - - valid->root = ftvalid; - - FT_TRACE3(( "validating BASE table\n" )); - OTV_INIT; - - OTV_LIMIT_CHECK( 6 ); - - if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ - FT_INVALID_DATA; - - table_size = 6; - - OTV_OPTIONAL_OFFSET( HorizAxis ); - OTV_SIZE_CHECK( HorizAxis ); - if ( HorizAxis ) - otv_Axis_validate( table + HorizAxis, valid ); - - OTV_OPTIONAL_OFFSET( VertAxis ); - OTV_SIZE_CHECK( VertAxis ); - if ( VertAxis ) - otv_Axis_validate( table + VertAxis, valid ); - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* otvbase.c */ +/* */ +/* OpenType BASE table validation (body). */ +/* */ +/* Copyright 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "otvalid.h" +#include "otvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_otvbase + + + static void + otv_BaseCoord_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt BaseCoordFormat; + + + OTV_NAME_ENTER( "BaseCoord" ); + + OTV_LIMIT_CHECK( 4 ); + BaseCoordFormat = FT_NEXT_USHORT( p ); + p += 2; /* skip Coordinate */ + + OTV_TRACE(( " (format %d)\n", BaseCoordFormat )); + + switch ( BaseCoordFormat ) + { + case 1: /* BaseCoordFormat1 */ + break; + + case 2: /* BaseCoordFormat2 */ + OTV_LIMIT_CHECK( 4 ); /* ReferenceGlyph, BaseCoordPoint */ + break; + + case 3: /* BaseCoordFormat3 */ + OTV_LIMIT_CHECK( 2 ); + /* DeviceTable */ + otv_Device_validate( table + FT_NEXT_USHORT( p ), valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + static void + otv_BaseTagList_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt BaseTagCount; + + + OTV_NAME_ENTER( "BaseTagList" ); + + OTV_LIMIT_CHECK( 2 ); + + BaseTagCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (BaseTagCount = %d)\n", BaseTagCount )); + + OTV_LIMIT_CHECK( BaseTagCount * 4 ); /* BaselineTag */ + + OTV_EXIT; + } + + + static void + otv_BaseValues_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt BaseCoordCount; + + + OTV_NAME_ENTER( "BaseValues" ); + + OTV_LIMIT_CHECK( 4 ); + + p += 2; /* skip DefaultIndex */ + BaseCoordCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (BaseCoordCount = %d)\n", BaseCoordCount )); + + OTV_LIMIT_CHECK( BaseCoordCount * 2 ); + + /* BaseCoord */ + for ( ; BaseCoordCount > 0; BaseCoordCount-- ) + otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), valid ); + + OTV_EXIT; + } + + + static void + otv_MinMax_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt table_size; + FT_UInt FeatMinMaxCount; + + OTV_OPTIONAL_TABLE( MinCoord ); + OTV_OPTIONAL_TABLE( MaxCoord ); + + + OTV_NAME_ENTER( "MinMax" ); + + OTV_LIMIT_CHECK( 6 ); + + OTV_OPTIONAL_OFFSET( MinCoord ); + OTV_OPTIONAL_OFFSET( MaxCoord ); + FeatMinMaxCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (FeatMinMaxCount = %d)\n", FeatMinMaxCount )); + + table_size = FeatMinMaxCount * 8 + 6; + + OTV_SIZE_CHECK( MinCoord ); + if ( MinCoord ) + otv_BaseCoord_validate( table + MinCoord, valid ); + + OTV_SIZE_CHECK( MaxCoord ); + if ( MaxCoord ) + otv_BaseCoord_validate( table + MaxCoord, valid ); + + OTV_LIMIT_CHECK( FeatMinMaxCount * 8 ); + + /* FeatMinMaxRecord */ + for ( ; FeatMinMaxCount > 0; FeatMinMaxCount-- ) + { + p += 4; /* skip FeatureTableTag */ + + OTV_OPTIONAL_OFFSET( MinCoord ); + OTV_OPTIONAL_OFFSET( MaxCoord ); + + OTV_SIZE_CHECK( MinCoord ); + if ( MinCoord ) + otv_BaseCoord_validate( table + MinCoord, valid ); + + OTV_SIZE_CHECK( MaxCoord ); + if ( MaxCoord ) + otv_BaseCoord_validate( table + MaxCoord, valid ); + } + + OTV_EXIT; + } + + + static void + otv_BaseScript_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt table_size; + FT_UInt BaseLangSysCount; + + OTV_OPTIONAL_TABLE( BaseValues ); + OTV_OPTIONAL_TABLE( DefaultMinMax ); + + + OTV_NAME_ENTER( "BaseScript" ); + + OTV_LIMIT_CHECK( 6 ); + OTV_OPTIONAL_OFFSET( BaseValues ); + OTV_OPTIONAL_OFFSET( DefaultMinMax ); + BaseLangSysCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (BaseLangSysCount = %d)\n", BaseLangSysCount )); + + table_size = BaseLangSysCount * 6 + 6; + + OTV_SIZE_CHECK( BaseValues ); + if ( BaseValues ) + otv_BaseValues_validate( table + BaseValues, valid ); + + OTV_SIZE_CHECK( DefaultMinMax ); + if ( DefaultMinMax ) + otv_MinMax_validate( table + DefaultMinMax, valid ); + + OTV_LIMIT_CHECK( BaseLangSysCount * 6 ); + + /* BaseLangSysRecord */ + for ( ; BaseLangSysCount > 0; BaseLangSysCount-- ) + { + p += 4; /* skip BaseLangSysTag */ + + otv_MinMax_validate( table + FT_NEXT_USHORT( p ), valid ); + } + + OTV_EXIT; + } + + + static void + otv_BaseScriptList_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt BaseScriptCount; + + + OTV_NAME_ENTER( "BaseScriptList" ); + + OTV_LIMIT_CHECK( 2 ); + BaseScriptCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (BaseScriptCount = %d)\n", BaseScriptCount )); + + OTV_LIMIT_CHECK( BaseScriptCount * 6 ); + + /* BaseScriptRecord */ + for ( ; BaseScriptCount > 0; BaseScriptCount-- ) + { + p += 4; /* skip BaseScriptTag */ + + /* BaseScript */ + otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), valid ); + } + + OTV_EXIT; + } + + + static void + otv_Axis_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt table_size; + + OTV_OPTIONAL_TABLE( BaseTagList ); + + + OTV_NAME_ENTER( "Axis" ); + + OTV_LIMIT_CHECK( 4 ); + OTV_OPTIONAL_OFFSET( BaseTagList ); + + table_size = 4; + + OTV_SIZE_CHECK( BaseTagList ); + if ( BaseTagList ) + otv_BaseTagList_validate( table + BaseTagList, valid ); + + /* BaseScriptList */ + otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), valid ); + + OTV_EXIT; + } + + + FT_LOCAL_DEF( void ) + otv_BASE_validate( FT_Bytes table, + FT_Validator ftvalid ) + { + OTV_ValidatorRec validrec; + OTV_Validator valid = &validrec; + FT_Bytes p = table; + FT_UInt table_size; + + OTV_OPTIONAL_TABLE( HorizAxis ); + OTV_OPTIONAL_TABLE( VertAxis ); + + + valid->root = ftvalid; + + FT_TRACE3(( "validating BASE table\n" )); + OTV_INIT; + + OTV_LIMIT_CHECK( 6 ); + + if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ + FT_INVALID_DATA; + + table_size = 6; + + OTV_OPTIONAL_OFFSET( HorizAxis ); + OTV_SIZE_CHECK( HorizAxis ); + if ( HorizAxis ) + otv_Axis_validate( table + HorizAxis, valid ); + + OTV_OPTIONAL_OFFSET( VertAxis ); + OTV_SIZE_CHECK( VertAxis ); + if ( VertAxis ) + otv_Axis_validate( table + VertAxis, valid ); + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.c index d94e4f3cb62..82473dd1c4f 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.c @@ -1,1055 +1,1055 @@ -/***************************************************************************/ -/* */ -/* otvcommn.c */ -/* */ -/* OpenType common tables validation (body). */ -/* */ -/* Copyright 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "otvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_otvcommon - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** COVERAGE TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - otv_Coverage_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt CoverageFormat; - - - OTV_NAME_ENTER( "Coverage" ); - - OTV_LIMIT_CHECK( 4 ); - CoverageFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", CoverageFormat )); - - switch ( CoverageFormat ) - { - case 1: /* CoverageFormat1 */ - { - FT_UInt GlyphCount; - - - GlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - - OTV_LIMIT_CHECK( GlyphCount * 2 ); /* GlyphArray */ - } - break; - - case 2: /* CoverageFormat2 */ - { - FT_UInt n, RangeCount; - FT_UInt Start, End, StartCoverageIndex, total = 0, last = 0; - - - RangeCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (RangeCount = %d)\n", RangeCount )); - - OTV_LIMIT_CHECK( RangeCount * 6 ); - - /* RangeRecord */ - for ( n = 0; n < RangeCount; n++ ) - { - Start = FT_NEXT_USHORT( p ); - End = FT_NEXT_USHORT( p ); - StartCoverageIndex = FT_NEXT_USHORT( p ); - - if ( Start > End || StartCoverageIndex != total ) - FT_INVALID_DATA; - - if ( n > 0 && Start <= last ) - FT_INVALID_DATA; - - total += End - Start + 1; - last = End; - } - } - break; - - default: - FT_INVALID_FORMAT; - } - - /* no need to check glyph indices used as input to coverage tables */ - /* since even invalid glyph indices return a meaningful result */ - - OTV_EXIT; - } - - - FT_LOCAL_DEF( FT_UInt ) - otv_Coverage_get_first( FT_Bytes table ) - { - FT_Bytes p = table; - - - p += 4; /* skip CoverageFormat and Glyph/RangeCount */ - - return FT_NEXT_USHORT( p ); - } - - - FT_LOCAL_DEF( FT_UInt ) - otv_Coverage_get_last( FT_Bytes table ) - { - FT_Bytes p = table; - FT_UInt CoverageFormat = FT_NEXT_USHORT( p ); - FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */ - FT_UInt result = 0; - - - switch ( CoverageFormat ) - { - case 1: - p += ( count - 1 ) * 2; - result = FT_NEXT_USHORT( p ); - break; - - case 2: - p += ( count - 1 ) * 6 + 2; - result = FT_NEXT_USHORT( p ); - break; - - default: - ; - } - - return result; - } - - - FT_LOCAL_DEF( FT_UInt ) - otv_Coverage_get_count( FT_Bytes table ) - { - FT_Bytes p = table; - FT_UInt CoverageFormat = FT_NEXT_USHORT( p ); - FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */ - FT_UInt result = 0; - - - switch ( CoverageFormat ) - { - case 1: - return count; - - case 2: - { - FT_UInt Start, End; - - - for ( ; count > 0; count-- ) - { - Start = FT_NEXT_USHORT( p ); - End = FT_NEXT_USHORT( p ); - p += 2; /* skip StartCoverageIndex */ - - result += End - Start + 1; - } - } - break; - - default: - ; - } - - return result; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** CLASS DEFINITION TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - otv_ClassDef_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt ClassFormat; - - - OTV_NAME_ENTER( "ClassDef" ); - - OTV_LIMIT_CHECK( 4 ); - ClassFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", ClassFormat )); - - switch ( ClassFormat ) - { - case 1: /* ClassDefFormat1 */ - { - FT_UInt GlyphCount; - - - p += 2; /* skip StartGlyph */ - - OTV_LIMIT_CHECK( 2 ); - - GlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - - OTV_LIMIT_CHECK( GlyphCount * 2 ); /* ClassValueArray */ - } - break; - - case 2: /* ClassDefFormat2 */ - { - FT_UInt n, ClassRangeCount; - FT_UInt Start, End, last = 0; - - - ClassRangeCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (ClassRangeCount = %d)\n", ClassRangeCount )); - - OTV_LIMIT_CHECK( ClassRangeCount * 6 ); - - /* ClassRangeRecord */ - for ( n = 0; n < ClassRangeCount; n++ ) - { - Start = FT_NEXT_USHORT( p ); - End = FT_NEXT_USHORT( p ); - p += 2; /* skip Class */ - - if ( Start > End || ( n > 0 && Start <= last ) ) - FT_INVALID_DATA; - - last = End; - } - } - break; - - default: - FT_INVALID_FORMAT; - } - - /* no need to check glyph indices used as input to class definition */ - /* tables since even invalid glyph indices return a meaningful result */ - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** DEVICE TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - otv_Device_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt StartSize, EndSize, DeltaFormat, count; - - - OTV_NAME_ENTER( "Device" ); - - OTV_LIMIT_CHECK( 8 ); - StartSize = FT_NEXT_USHORT( p ); - EndSize = FT_NEXT_USHORT( p ); - DeltaFormat = FT_NEXT_USHORT( p ); - - if ( DeltaFormat < 1 || DeltaFormat > 3 || EndSize < StartSize ) - FT_INVALID_DATA; - - count = EndSize - StartSize + 1; - OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */ - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** LOOKUPS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* uses valid->type_count */ - /* uses valid->type_funcs */ - - FT_LOCAL_DEF( void ) - otv_Lookup_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt LookupType, SubTableCount; - OTV_Validate_Func validate; - - - OTV_NAME_ENTER( "Lookup" ); - - OTV_LIMIT_CHECK( 6 ); - LookupType = FT_NEXT_USHORT( p ); - p += 2; /* skip LookupFlag */ - SubTableCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (type %d)\n", LookupType )); - - if ( LookupType == 0 || LookupType >= valid->type_count ) - FT_INVALID_DATA; - - validate = valid->type_funcs[LookupType - 1]; - - OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount )); - - OTV_LIMIT_CHECK( SubTableCount * 2 ); - - /* SubTable */ - for ( ; SubTableCount > 0; SubTableCount-- ) - validate( table + FT_NEXT_USHORT( p ), valid ); - - OTV_EXIT; - } - - - /* uses valid->lookup_count */ - - FT_LOCAL_DEF( void ) - otv_LookupList_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt LookupCount; - - - OTV_NAME_ENTER( "LookupList" ); - - OTV_LIMIT_CHECK( 2 ); - LookupCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (LookupCount = %d)\n", LookupCount )); - - OTV_LIMIT_CHECK( LookupCount * 2 ); - - valid->lookup_count = LookupCount; - - /* Lookup */ - for ( ; LookupCount > 0; LookupCount-- ) - otv_Lookup_validate( table + FT_NEXT_USHORT( p ), valid ); - - OTV_EXIT; - } - - - static FT_UInt - otv_LookupList_get_count( FT_Bytes table ) - { - return FT_NEXT_USHORT( table ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FEATURES *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* uses valid->lookup_count */ - - FT_LOCAL_DEF( void ) - otv_Feature_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt LookupCount; - - - OTV_NAME_ENTER( "Feature" ); - - OTV_LIMIT_CHECK( 4 ); - p += 2; /* skip FeatureParams (unused) */ - LookupCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (LookupCount = %d)\n", LookupCount )); - - OTV_LIMIT_CHECK( LookupCount * 2 ); - - /* LookupListIndex */ - for ( ; LookupCount > 0; LookupCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) - FT_INVALID_DATA; - - OTV_EXIT; - } - - - static FT_UInt - otv_Feature_get_count( FT_Bytes table ) - { - return FT_NEXT_USHORT( table ); - } - - - /* sets valid->lookup_count */ - - FT_LOCAL_DEF( void ) - otv_FeatureList_validate( FT_Bytes table, - FT_Bytes lookups, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt FeatureCount; - - - OTV_NAME_ENTER( "FeatureList" ); - - OTV_LIMIT_CHECK( 2 ); - FeatureCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount )); - - OTV_LIMIT_CHECK( FeatureCount * 2 ); - - valid->lookup_count = otv_LookupList_get_count( lookups ); - - /* FeatureRecord */ - for ( ; FeatureCount > 0; FeatureCount-- ) - { - p += 4; /* skip FeatureTag */ - - /* Feature */ - otv_Feature_validate( table + FT_NEXT_USHORT( p ), valid ); - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** LANGUAGE SYSTEM *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /* uses valid->extra1 (number of features) */ - - FT_LOCAL_DEF( void ) - otv_LangSys_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt ReqFeatureIndex; - FT_UInt FeatureCount; - - - OTV_NAME_ENTER( "LangSys" ); - - OTV_LIMIT_CHECK( 6 ); - p += 2; /* skip LookupOrder (unused) */ - ReqFeatureIndex = FT_NEXT_USHORT( p ); - FeatureCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex )); - OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount )); - - if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= valid->extra1 ) - FT_INVALID_DATA; - - OTV_LIMIT_CHECK( FeatureCount * 2 ); - - /* FeatureIndex */ - for ( ; FeatureCount > 0; FeatureCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) - FT_INVALID_DATA; - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** SCRIPTS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - otv_Script_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_UInt DefaultLangSys, LangSysCount; - FT_Bytes p = table; - - - OTV_NAME_ENTER( "Script" ); - - OTV_LIMIT_CHECK( 4 ); - DefaultLangSys = FT_NEXT_USHORT( p ); - LangSysCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount )); - - if ( DefaultLangSys != 0 ) - otv_LangSys_validate( table + DefaultLangSys, valid ); - - OTV_LIMIT_CHECK( LangSysCount * 6 ); - - /* LangSysRecord */ - for ( ; LangSysCount > 0; LangSysCount-- ) - { - p += 4; /* skip LangSysTag */ - - /* LangSys */ - otv_LangSys_validate( table + FT_NEXT_USHORT( p ), valid ); - } - - OTV_EXIT; - } - - - /* sets valid->extra1 (number of features) */ - - FT_LOCAL_DEF( void ) - otv_ScriptList_validate( FT_Bytes table, - FT_Bytes features, - OTV_Validator valid ) - { - FT_UInt ScriptCount; - FT_Bytes p = table; - - - OTV_NAME_ENTER( "ScriptList" ); - - OTV_LIMIT_CHECK( 2 ); - ScriptCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (ScriptCount = %d)\n", ScriptCount )); - - OTV_LIMIT_CHECK( ScriptCount * 6 ); - - valid->extra1 = otv_Feature_get_count( features ); - - /* ScriptRecord */ - for ( ; ScriptCount > 0; ScriptCount-- ) - { - p += 4; /* skip ScriptTag */ - - otv_Script_validate( table + FT_NEXT_USHORT( p ), valid ); /* Script */ - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** UTILITY FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* - u: uint16 - ux: unit16 [x] - - s: struct - sx: struct [x] - sxy: struct [x], using external y count - - x: uint16 x - - C: Coverage - - O: Offset - On: Offset (NULL) - Ox: Offset [x] - Onx: Offset (NULL) [x] - */ - - FT_LOCAL_DEF( void ) - otv_x_Ox( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Count; - OTV_Validate_Func func; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 2 ); - Count = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (Count = %d)\n", Count )); - - OTV_LIMIT_CHECK( Count * 2 ); - - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - - for ( ; Count > 0; Count-- ) - func( table + FT_NEXT_USHORT( p ), valid ); - - valid->nesting_level--; - - OTV_EXIT; - } - - - FT_LOCAL_DEF( void ) - otv_u_C_x_Ox( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Count, Coverage; - OTV_Validate_Func func; - - - OTV_ENTER; - - p += 2; /* skip Format */ - - OTV_LIMIT_CHECK( 4 ); - Coverage = FT_NEXT_USHORT( p ); - Count = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (Count = %d)\n", Count )); - - otv_Coverage_validate( table + Coverage, valid ); - - OTV_LIMIT_CHECK( Count * 2 ); - - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - - for ( ; Count > 0; Count-- ) - func( table + FT_NEXT_USHORT( p ), valid ); - - valid->nesting_level--; - - OTV_EXIT; - } - - - /* uses valid->extra1 (if > 0: array value limit) */ - - FT_LOCAL_DEF( void ) - otv_x_ux( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Count; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 2 ); - Count = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (Count = %d)\n", Count )); - - OTV_LIMIT_CHECK( Count * 2 ); - - if ( valid->extra1 ) - { - for ( ; Count > 0; Count-- ) - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /* `ux' in the function's name is not really correct since only x-1 */ - /* elements are tested */ - - /* uses valid->extra1 (array value limit) */ - - FT_LOCAL_DEF( void ) - otv_x_y_ux_sy( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Count1, Count2; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 4 ); - Count1 = FT_NEXT_USHORT( p ); - Count2 = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (Count1 = %d)\n", Count1 )); - OTV_TRACE(( " (Count2 = %d)\n", Count2 )); - - if ( Count1 == 0 ) - FT_INVALID_DATA; - - OTV_LIMIT_CHECK( ( Count1 - 1 ) * 2 + Count2 * 4 ); - - for ( ; Count2 > 0; Count2-- ) - { - if ( FT_NEXT_USHORT( p ) >= Count1 ) - FT_INVALID_DATA; - - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /* `uy' in the function's name is not really correct since only y-1 */ - /* elements are tested */ - - /* uses valid->extra1 (array value limit) */ - - FT_LOCAL_DEF( void ) - otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt BacktrackCount, InputCount, LookaheadCount; - FT_UInt Count; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 2 ); - BacktrackCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (BacktrackCount = %d)\n", BacktrackCount )); - - OTV_LIMIT_CHECK( BacktrackCount * 2 + 2 ); - p += BacktrackCount * 2; - - InputCount = FT_NEXT_USHORT( p ); - if ( InputCount == 0 ) - FT_INVALID_DATA; - - OTV_TRACE(( " (InputCount = %d)\n", InputCount )); - - OTV_LIMIT_CHECK( InputCount * 2 ); - p += ( InputCount - 1 ) * 2; - - LookaheadCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (LookaheadCount = %d)\n", LookaheadCount )); - - OTV_LIMIT_CHECK( LookaheadCount * 2 + 2 ); - p += LookaheadCount * 2; - - Count = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (Count = %d)\n", Count )); - - OTV_LIMIT_CHECK( Count * 4 ); - - for ( ; Count > 0; Count-- ) - { - if ( FT_NEXT_USHORT( p ) >= InputCount ) - FT_INVALID_DATA; - - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /* sets valid->extra1 (valid->lookup_count) */ - - FT_LOCAL_DEF( void ) - otv_u_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Coverage, ClassDef, ClassSetCount; - OTV_Validate_Func func; - - - OTV_ENTER; - - p += 2; /* skip Format */ - - OTV_LIMIT_CHECK( 6 ); - Coverage = FT_NEXT_USHORT( p ); - ClassDef = FT_NEXT_USHORT( p ); - ClassSetCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount )); - - otv_Coverage_validate( table + Coverage, valid ); - otv_ClassDef_validate( table + ClassDef, valid ); - - OTV_LIMIT_CHECK( ClassSetCount * 2 ); - - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = valid->lookup_count; - - for ( ; ClassSetCount > 0; ClassSetCount-- ) - { - FT_UInt offset = FT_NEXT_USHORT( p ); - - - if ( offset ) - func( table + offset, valid ); - } - - valid->nesting_level--; - - OTV_EXIT; - } - - - /* uses valid->lookup_count */ - - FT_LOCAL_DEF( void ) - otv_u_x_y_Ox_sy( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt GlyphCount, Count, count1; - - - OTV_ENTER; - - p += 2; /* skip Format */ - - OTV_LIMIT_CHECK( 4 ); - GlyphCount = FT_NEXT_USHORT( p ); - Count = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - OTV_TRACE(( " (Count = %d)\n", Count )); - - OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 ); - - for ( count1 = GlyphCount; count1 > 0; count1-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); - - for ( ; Count > 0; Count-- ) - { - if ( FT_NEXT_USHORT( p ) >= GlyphCount ) - FT_INVALID_DATA; - - if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /* sets valid->extra1 (valid->lookup_count) */ - - FT_LOCAL_DEF( void ) - otv_u_O_O_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Coverage; - FT_UInt BacktrackClassDef, InputClassDef, LookaheadClassDef; - FT_UInt ChainClassSetCount; - OTV_Validate_Func func; - - - OTV_ENTER; - - p += 2; /* skip Format */ - - OTV_LIMIT_CHECK( 10 ); - Coverage = FT_NEXT_USHORT( p ); - BacktrackClassDef = FT_NEXT_USHORT( p ); - InputClassDef = FT_NEXT_USHORT( p ); - LookaheadClassDef = FT_NEXT_USHORT( p ); - ChainClassSetCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount )); - - otv_Coverage_validate( table + Coverage, valid ); - - otv_ClassDef_validate( table + BacktrackClassDef, valid ); - otv_ClassDef_validate( table + InputClassDef, valid ); - otv_ClassDef_validate( table + LookaheadClassDef, valid ); - - OTV_LIMIT_CHECK( ChainClassSetCount * 2 ); - - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = valid->lookup_count; - - for ( ; ChainClassSetCount > 0; ChainClassSetCount-- ) - { - FT_UInt offset = FT_NEXT_USHORT( p ); - - - if ( offset ) - func( table + offset, valid ); - } - - valid->nesting_level--; - - OTV_EXIT; - } - - - /* uses valid->lookup_count */ - - FT_LOCAL_DEF( void ) - otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount; - FT_UInt count1, count2; - - - OTV_ENTER; - - p += 2; /* skip Format */ - - OTV_LIMIT_CHECK( 2 ); - BacktrackGlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount )); - - OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 ); - - for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); - - InputGlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (InputGlyphCount = %d)\n", InputGlyphCount )); - - OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 ); - - for ( count1 = InputGlyphCount; count1 > 0; count1-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); - - LookaheadGlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount )); - - OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); - - for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); - - count2 = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (Count = %d)\n", count2 )); - - OTV_LIMIT_CHECK( count2 * 4 ); - - for ( ; count2 > 0; count2-- ) - { - if ( FT_NEXT_USHORT( p ) >= InputGlyphCount ) - FT_INVALID_DATA; - - if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - FT_LOCAL_DEF( FT_UInt ) - otv_GSUBGPOS_get_Lookup_count( FT_Bytes table ) - { - FT_Bytes p = table + 8; - - - return otv_LookupList_get_count( table + FT_NEXT_USHORT( p ) ); - } - - - FT_LOCAL_DEF( FT_UInt ) - otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes table ) - { - FT_Bytes p, lookup; - FT_UInt count; - - - if ( !table ) - return 0; - - /* LookupList */ - p = table + 8; - table += FT_NEXT_USHORT( p ); - - /* LookupCount */ - p = table; - count = FT_NEXT_USHORT( p ); - - for ( ; count > 0; count-- ) - { - FT_Bytes oldp; - - - /* Lookup */ - lookup = table + FT_NEXT_USHORT( p ); - - oldp = p; - - /* LookupFlag */ - p = lookup + 2; - if ( FT_NEXT_USHORT( p ) & 0xFF00U ) - return 1; - - p = oldp; - } - - return 0; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* otvcommn.c */ +/* */ +/* OpenType common tables validation (body). */ +/* */ +/* Copyright 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "otvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_otvcommon + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** COVERAGE TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + otv_Coverage_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt CoverageFormat; + + + OTV_NAME_ENTER( "Coverage" ); + + OTV_LIMIT_CHECK( 4 ); + CoverageFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", CoverageFormat )); + + switch ( CoverageFormat ) + { + case 1: /* CoverageFormat1 */ + { + FT_UInt GlyphCount; + + + GlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + + OTV_LIMIT_CHECK( GlyphCount * 2 ); /* GlyphArray */ + } + break; + + case 2: /* CoverageFormat2 */ + { + FT_UInt n, RangeCount; + FT_UInt Start, End, StartCoverageIndex, total = 0, last = 0; + + + RangeCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (RangeCount = %d)\n", RangeCount )); + + OTV_LIMIT_CHECK( RangeCount * 6 ); + + /* RangeRecord */ + for ( n = 0; n < RangeCount; n++ ) + { + Start = FT_NEXT_USHORT( p ); + End = FT_NEXT_USHORT( p ); + StartCoverageIndex = FT_NEXT_USHORT( p ); + + if ( Start > End || StartCoverageIndex != total ) + FT_INVALID_DATA; + + if ( n > 0 && Start <= last ) + FT_INVALID_DATA; + + total += End - Start + 1; + last = End; + } + } + break; + + default: + FT_INVALID_FORMAT; + } + + /* no need to check glyph indices used as input to coverage tables */ + /* since even invalid glyph indices return a meaningful result */ + + OTV_EXIT; + } + + + FT_LOCAL_DEF( FT_UInt ) + otv_Coverage_get_first( FT_Bytes table ) + { + FT_Bytes p = table; + + + p += 4; /* skip CoverageFormat and Glyph/RangeCount */ + + return FT_NEXT_USHORT( p ); + } + + + FT_LOCAL_DEF( FT_UInt ) + otv_Coverage_get_last( FT_Bytes table ) + { + FT_Bytes p = table; + FT_UInt CoverageFormat = FT_NEXT_USHORT( p ); + FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */ + FT_UInt result = 0; + + + switch ( CoverageFormat ) + { + case 1: + p += ( count - 1 ) * 2; + result = FT_NEXT_USHORT( p ); + break; + + case 2: + p += ( count - 1 ) * 6 + 2; + result = FT_NEXT_USHORT( p ); + break; + + default: + ; + } + + return result; + } + + + FT_LOCAL_DEF( FT_UInt ) + otv_Coverage_get_count( FT_Bytes table ) + { + FT_Bytes p = table; + FT_UInt CoverageFormat = FT_NEXT_USHORT( p ); + FT_UInt count = FT_NEXT_USHORT( p ); /* Glyph/RangeCount */ + FT_UInt result = 0; + + + switch ( CoverageFormat ) + { + case 1: + return count; + + case 2: + { + FT_UInt Start, End; + + + for ( ; count > 0; count-- ) + { + Start = FT_NEXT_USHORT( p ); + End = FT_NEXT_USHORT( p ); + p += 2; /* skip StartCoverageIndex */ + + result += End - Start + 1; + } + } + break; + + default: + ; + } + + return result; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CLASS DEFINITION TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + otv_ClassDef_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt ClassFormat; + + + OTV_NAME_ENTER( "ClassDef" ); + + OTV_LIMIT_CHECK( 4 ); + ClassFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", ClassFormat )); + + switch ( ClassFormat ) + { + case 1: /* ClassDefFormat1 */ + { + FT_UInt GlyphCount; + + + p += 2; /* skip StartGlyph */ + + OTV_LIMIT_CHECK( 2 ); + + GlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + + OTV_LIMIT_CHECK( GlyphCount * 2 ); /* ClassValueArray */ + } + break; + + case 2: /* ClassDefFormat2 */ + { + FT_UInt n, ClassRangeCount; + FT_UInt Start, End, last = 0; + + + ClassRangeCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (ClassRangeCount = %d)\n", ClassRangeCount )); + + OTV_LIMIT_CHECK( ClassRangeCount * 6 ); + + /* ClassRangeRecord */ + for ( n = 0; n < ClassRangeCount; n++ ) + { + Start = FT_NEXT_USHORT( p ); + End = FT_NEXT_USHORT( p ); + p += 2; /* skip Class */ + + if ( Start > End || ( n > 0 && Start <= last ) ) + FT_INVALID_DATA; + + last = End; + } + } + break; + + default: + FT_INVALID_FORMAT; + } + + /* no need to check glyph indices used as input to class definition */ + /* tables since even invalid glyph indices return a meaningful result */ + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** DEVICE TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + otv_Device_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt StartSize, EndSize, DeltaFormat, count; + + + OTV_NAME_ENTER( "Device" ); + + OTV_LIMIT_CHECK( 8 ); + StartSize = FT_NEXT_USHORT( p ); + EndSize = FT_NEXT_USHORT( p ); + DeltaFormat = FT_NEXT_USHORT( p ); + + if ( DeltaFormat < 1 || DeltaFormat > 3 || EndSize < StartSize ) + FT_INVALID_DATA; + + count = EndSize - StartSize + 1; + OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */ + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** LOOKUPS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* uses valid->type_count */ + /* uses valid->type_funcs */ + + FT_LOCAL_DEF( void ) + otv_Lookup_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt LookupType, SubTableCount; + OTV_Validate_Func validate; + + + OTV_NAME_ENTER( "Lookup" ); + + OTV_LIMIT_CHECK( 6 ); + LookupType = FT_NEXT_USHORT( p ); + p += 2; /* skip LookupFlag */ + SubTableCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (type %d)\n", LookupType )); + + if ( LookupType == 0 || LookupType >= valid->type_count ) + FT_INVALID_DATA; + + validate = valid->type_funcs[LookupType - 1]; + + OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount )); + + OTV_LIMIT_CHECK( SubTableCount * 2 ); + + /* SubTable */ + for ( ; SubTableCount > 0; SubTableCount-- ) + validate( table + FT_NEXT_USHORT( p ), valid ); + + OTV_EXIT; + } + + + /* uses valid->lookup_count */ + + FT_LOCAL_DEF( void ) + otv_LookupList_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt LookupCount; + + + OTV_NAME_ENTER( "LookupList" ); + + OTV_LIMIT_CHECK( 2 ); + LookupCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (LookupCount = %d)\n", LookupCount )); + + OTV_LIMIT_CHECK( LookupCount * 2 ); + + valid->lookup_count = LookupCount; + + /* Lookup */ + for ( ; LookupCount > 0; LookupCount-- ) + otv_Lookup_validate( table + FT_NEXT_USHORT( p ), valid ); + + OTV_EXIT; + } + + + static FT_UInt + otv_LookupList_get_count( FT_Bytes table ) + { + return FT_NEXT_USHORT( table ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FEATURES *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* uses valid->lookup_count */ + + FT_LOCAL_DEF( void ) + otv_Feature_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt LookupCount; + + + OTV_NAME_ENTER( "Feature" ); + + OTV_LIMIT_CHECK( 4 ); + p += 2; /* skip FeatureParams (unused) */ + LookupCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (LookupCount = %d)\n", LookupCount )); + + OTV_LIMIT_CHECK( LookupCount * 2 ); + + /* LookupListIndex */ + for ( ; LookupCount > 0; LookupCount-- ) + if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) + FT_INVALID_DATA; + + OTV_EXIT; + } + + + static FT_UInt + otv_Feature_get_count( FT_Bytes table ) + { + return FT_NEXT_USHORT( table ); + } + + + /* sets valid->lookup_count */ + + FT_LOCAL_DEF( void ) + otv_FeatureList_validate( FT_Bytes table, + FT_Bytes lookups, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt FeatureCount; + + + OTV_NAME_ENTER( "FeatureList" ); + + OTV_LIMIT_CHECK( 2 ); + FeatureCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount )); + + OTV_LIMIT_CHECK( FeatureCount * 2 ); + + valid->lookup_count = otv_LookupList_get_count( lookups ); + + /* FeatureRecord */ + for ( ; FeatureCount > 0; FeatureCount-- ) + { + p += 4; /* skip FeatureTag */ + + /* Feature */ + otv_Feature_validate( table + FT_NEXT_USHORT( p ), valid ); + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** LANGUAGE SYSTEM *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /* uses valid->extra1 (number of features) */ + + FT_LOCAL_DEF( void ) + otv_LangSys_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt ReqFeatureIndex; + FT_UInt FeatureCount; + + + OTV_NAME_ENTER( "LangSys" ); + + OTV_LIMIT_CHECK( 6 ); + p += 2; /* skip LookupOrder (unused) */ + ReqFeatureIndex = FT_NEXT_USHORT( p ); + FeatureCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex )); + OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount )); + + if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= valid->extra1 ) + FT_INVALID_DATA; + + OTV_LIMIT_CHECK( FeatureCount * 2 ); + + /* FeatureIndex */ + for ( ; FeatureCount > 0; FeatureCount-- ) + if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + FT_INVALID_DATA; + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** SCRIPTS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + otv_Script_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_UInt DefaultLangSys, LangSysCount; + FT_Bytes p = table; + + + OTV_NAME_ENTER( "Script" ); + + OTV_LIMIT_CHECK( 4 ); + DefaultLangSys = FT_NEXT_USHORT( p ); + LangSysCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount )); + + if ( DefaultLangSys != 0 ) + otv_LangSys_validate( table + DefaultLangSys, valid ); + + OTV_LIMIT_CHECK( LangSysCount * 6 ); + + /* LangSysRecord */ + for ( ; LangSysCount > 0; LangSysCount-- ) + { + p += 4; /* skip LangSysTag */ + + /* LangSys */ + otv_LangSys_validate( table + FT_NEXT_USHORT( p ), valid ); + } + + OTV_EXIT; + } + + + /* sets valid->extra1 (number of features) */ + + FT_LOCAL_DEF( void ) + otv_ScriptList_validate( FT_Bytes table, + FT_Bytes features, + OTV_Validator valid ) + { + FT_UInt ScriptCount; + FT_Bytes p = table; + + + OTV_NAME_ENTER( "ScriptList" ); + + OTV_LIMIT_CHECK( 2 ); + ScriptCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (ScriptCount = %d)\n", ScriptCount )); + + OTV_LIMIT_CHECK( ScriptCount * 6 ); + + valid->extra1 = otv_Feature_get_count( features ); + + /* ScriptRecord */ + for ( ; ScriptCount > 0; ScriptCount-- ) + { + p += 4; /* skip ScriptTag */ + + otv_Script_validate( table + FT_NEXT_USHORT( p ), valid ); /* Script */ + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* + u: uint16 + ux: unit16 [x] + + s: struct + sx: struct [x] + sxy: struct [x], using external y count + + x: uint16 x + + C: Coverage + + O: Offset + On: Offset (NULL) + Ox: Offset [x] + Onx: Offset (NULL) [x] + */ + + FT_LOCAL_DEF( void ) + otv_x_Ox( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Count; + OTV_Validate_Func func; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 2 ); + Count = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (Count = %d)\n", Count )); + + OTV_LIMIT_CHECK( Count * 2 ); + + valid->nesting_level++; + func = valid->func[valid->nesting_level]; + + for ( ; Count > 0; Count-- ) + func( table + FT_NEXT_USHORT( p ), valid ); + + valid->nesting_level--; + + OTV_EXIT; + } + + + FT_LOCAL_DEF( void ) + otv_u_C_x_Ox( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Count, Coverage; + OTV_Validate_Func func; + + + OTV_ENTER; + + p += 2; /* skip Format */ + + OTV_LIMIT_CHECK( 4 ); + Coverage = FT_NEXT_USHORT( p ); + Count = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (Count = %d)\n", Count )); + + otv_Coverage_validate( table + Coverage, valid ); + + OTV_LIMIT_CHECK( Count * 2 ); + + valid->nesting_level++; + func = valid->func[valid->nesting_level]; + + for ( ; Count > 0; Count-- ) + func( table + FT_NEXT_USHORT( p ), valid ); + + valid->nesting_level--; + + OTV_EXIT; + } + + + /* uses valid->extra1 (if > 0: array value limit) */ + + FT_LOCAL_DEF( void ) + otv_x_ux( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Count; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 2 ); + Count = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (Count = %d)\n", Count )); + + OTV_LIMIT_CHECK( Count * 2 ); + + if ( valid->extra1 ) + { + for ( ; Count > 0; Count-- ) + if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /* `ux' in the function's name is not really correct since only x-1 */ + /* elements are tested */ + + /* uses valid->extra1 (array value limit) */ + + FT_LOCAL_DEF( void ) + otv_x_y_ux_sy( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Count1, Count2; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 4 ); + Count1 = FT_NEXT_USHORT( p ); + Count2 = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (Count1 = %d)\n", Count1 )); + OTV_TRACE(( " (Count2 = %d)\n", Count2 )); + + if ( Count1 == 0 ) + FT_INVALID_DATA; + + OTV_LIMIT_CHECK( ( Count1 - 1 ) * 2 + Count2 * 4 ); + + for ( ; Count2 > 0; Count2-- ) + { + if ( FT_NEXT_USHORT( p ) >= Count1 ) + FT_INVALID_DATA; + + if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /* `uy' in the function's name is not really correct since only y-1 */ + /* elements are tested */ + + /* uses valid->extra1 (array value limit) */ + + FT_LOCAL_DEF( void ) + otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt BacktrackCount, InputCount, LookaheadCount; + FT_UInt Count; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 2 ); + BacktrackCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (BacktrackCount = %d)\n", BacktrackCount )); + + OTV_LIMIT_CHECK( BacktrackCount * 2 + 2 ); + p += BacktrackCount * 2; + + InputCount = FT_NEXT_USHORT( p ); + if ( InputCount == 0 ) + FT_INVALID_DATA; + + OTV_TRACE(( " (InputCount = %d)\n", InputCount )); + + OTV_LIMIT_CHECK( InputCount * 2 ); + p += ( InputCount - 1 ) * 2; + + LookaheadCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (LookaheadCount = %d)\n", LookaheadCount )); + + OTV_LIMIT_CHECK( LookaheadCount * 2 + 2 ); + p += LookaheadCount * 2; + + Count = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (Count = %d)\n", Count )); + + OTV_LIMIT_CHECK( Count * 4 ); + + for ( ; Count > 0; Count-- ) + { + if ( FT_NEXT_USHORT( p ) >= InputCount ) + FT_INVALID_DATA; + + if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /* sets valid->extra1 (valid->lookup_count) */ + + FT_LOCAL_DEF( void ) + otv_u_O_O_x_Onx( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Coverage, ClassDef, ClassSetCount; + OTV_Validate_Func func; + + + OTV_ENTER; + + p += 2; /* skip Format */ + + OTV_LIMIT_CHECK( 6 ); + Coverage = FT_NEXT_USHORT( p ); + ClassDef = FT_NEXT_USHORT( p ); + ClassSetCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount )); + + otv_Coverage_validate( table + Coverage, valid ); + otv_ClassDef_validate( table + ClassDef, valid ); + + OTV_LIMIT_CHECK( ClassSetCount * 2 ); + + valid->nesting_level++; + func = valid->func[valid->nesting_level]; + valid->extra1 = valid->lookup_count; + + for ( ; ClassSetCount > 0; ClassSetCount-- ) + { + FT_UInt offset = FT_NEXT_USHORT( p ); + + + if ( offset ) + func( table + offset, valid ); + } + + valid->nesting_level--; + + OTV_EXIT; + } + + + /* uses valid->lookup_count */ + + FT_LOCAL_DEF( void ) + otv_u_x_y_Ox_sy( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt GlyphCount, Count, count1; + + + OTV_ENTER; + + p += 2; /* skip Format */ + + OTV_LIMIT_CHECK( 4 ); + GlyphCount = FT_NEXT_USHORT( p ); + Count = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + OTV_TRACE(( " (Count = %d)\n", Count )); + + OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 ); + + for ( count1 = GlyphCount; count1 > 0; count1-- ) + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); + + for ( ; Count > 0; Count-- ) + { + if ( FT_NEXT_USHORT( p ) >= GlyphCount ) + FT_INVALID_DATA; + + if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /* sets valid->extra1 (valid->lookup_count) */ + + FT_LOCAL_DEF( void ) + otv_u_O_O_O_O_x_Onx( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Coverage; + FT_UInt BacktrackClassDef, InputClassDef, LookaheadClassDef; + FT_UInt ChainClassSetCount; + OTV_Validate_Func func; + + + OTV_ENTER; + + p += 2; /* skip Format */ + + OTV_LIMIT_CHECK( 10 ); + Coverage = FT_NEXT_USHORT( p ); + BacktrackClassDef = FT_NEXT_USHORT( p ); + InputClassDef = FT_NEXT_USHORT( p ); + LookaheadClassDef = FT_NEXT_USHORT( p ); + ChainClassSetCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount )); + + otv_Coverage_validate( table + Coverage, valid ); + + otv_ClassDef_validate( table + BacktrackClassDef, valid ); + otv_ClassDef_validate( table + InputClassDef, valid ); + otv_ClassDef_validate( table + LookaheadClassDef, valid ); + + OTV_LIMIT_CHECK( ChainClassSetCount * 2 ); + + valid->nesting_level++; + func = valid->func[valid->nesting_level]; + valid->extra1 = valid->lookup_count; + + for ( ; ChainClassSetCount > 0; ChainClassSetCount-- ) + { + FT_UInt offset = FT_NEXT_USHORT( p ); + + + if ( offset ) + func( table + offset, valid ); + } + + valid->nesting_level--; + + OTV_EXIT; + } + + + /* uses valid->lookup_count */ + + FT_LOCAL_DEF( void ) + otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount; + FT_UInt count1, count2; + + + OTV_ENTER; + + p += 2; /* skip Format */ + + OTV_LIMIT_CHECK( 2 ); + BacktrackGlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount )); + + OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 ); + + for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- ) + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); + + InputGlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (InputGlyphCount = %d)\n", InputGlyphCount )); + + OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 ); + + for ( count1 = InputGlyphCount; count1 > 0; count1-- ) + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); + + LookaheadGlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount )); + + OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); + + for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- ) + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); + + count2 = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (Count = %d)\n", count2 )); + + OTV_LIMIT_CHECK( count2 * 4 ); + + for ( ; count2 > 0; count2-- ) + { + if ( FT_NEXT_USHORT( p ) >= InputGlyphCount ) + FT_INVALID_DATA; + + if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + FT_LOCAL_DEF( FT_UInt ) + otv_GSUBGPOS_get_Lookup_count( FT_Bytes table ) + { + FT_Bytes p = table + 8; + + + return otv_LookupList_get_count( table + FT_NEXT_USHORT( p ) ); + } + + + FT_LOCAL_DEF( FT_UInt ) + otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes table ) + { + FT_Bytes p, lookup; + FT_UInt count; + + + if ( !table ) + return 0; + + /* LookupList */ + p = table + 8; + table += FT_NEXT_USHORT( p ); + + /* LookupCount */ + p = table; + count = FT_NEXT_USHORT( p ); + + for ( ; count > 0; count-- ) + { + FT_Bytes oldp; + + + /* Lookup */ + lookup = table + FT_NEXT_USHORT( p ); + + oldp = p; + + /* LookupFlag */ + p = lookup + 2; + if ( FT_NEXT_USHORT( p ) & 0xFF00U ) + return 1; + + p = oldp; + } + + return 0; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.h b/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.h index be6ac69c284..292a9163745 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.h +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvcommn.h @@ -1,436 +1,436 @@ -/***************************************************************************/ -/* */ -/* otvcommn.h */ -/* */ -/* OpenType common tables validation (specification). */ -/* */ -/* Copyright 2004, 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __OTVCOMMN_H__ -#define __OTVCOMMN_H__ - - -#include -#include "otvalid.h" -#include FT_INTERNAL_DEBUG_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** VALIDATION *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - typedef struct OTV_ValidatorRec_* OTV_Validator; - - typedef void (*OTV_Validate_Func)( FT_Bytes table, - OTV_Validator valid ); - - typedef struct OTV_ValidatorRec_ - { - FT_Validator root; - FT_UInt type_count; - OTV_Validate_Func* type_funcs; - - FT_UInt lookup_count; - FT_UInt glyph_count; - - FT_UInt nesting_level; - - OTV_Validate_Func func[3]; - - FT_UInt extra1; /* for passing parameters */ - FT_UInt extra2; - FT_Bytes extra3; - -#ifdef FT_DEBUG_LEVEL_TRACE - FT_UInt debug_indent; - const FT_String* debug_function_name[3]; -#endif - - } OTV_ValidatorRec; - - -#undef FT_INVALID_ -#define FT_INVALID_( _prefix, _error ) \ - ft_validator_error( valid->root, _prefix ## _error ) - -#define OTV_OPTIONAL_TABLE( _table ) FT_UShort _table; \ - FT_Bytes _table ## _p - -#define OTV_OPTIONAL_OFFSET( _offset ) \ - FT_BEGIN_STMNT \ - _offset ## _p = p; \ - _offset = FT_NEXT_USHORT( p ); \ - FT_END_STMNT - -#define OTV_LIMIT_CHECK( _count ) \ - FT_BEGIN_STMNT \ - if ( p + (_count) > valid->root->limit ) \ - FT_INVALID_TOO_SHORT; \ - FT_END_STMNT - -#define OTV_SIZE_CHECK( _size ) \ - FT_BEGIN_STMNT \ - if ( _size > 0 && _size < table_size ) \ - { \ - if ( valid->root->level == FT_VALIDATE_PARANOID ) \ - FT_INVALID_OFFSET; \ - else \ - { \ - /* strip off `const' */ \ - FT_Byte* pp = (FT_Byte*)_size ## _p; \ - \ - \ - FT_TRACE3(( "\n" \ - "Invalid offset to optional table `%s'!\n" \ - "Set to zero.\n" \ - "\n", #_size )); \ - \ - /* always assume 16bit entities */ \ - _size = pp[0] = pp[1] = 0; \ - } \ - } \ - FT_END_STMNT - - -#define OTV_NAME_(x) #x -#define OTV_NAME(x) OTV_NAME_(x) - -#define OTV_FUNC_(x) x##Func -#define OTV_FUNC(x) OTV_FUNC_(x) - -#ifdef FT_DEBUG_LEVEL_TRACE - -#define OTV_NEST1( x ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->debug_function_name[0] = OTV_NAME( x ); \ - FT_END_STMNT - -#define OTV_NEST2( x, y ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ - valid->debug_function_name[0] = OTV_NAME( x ); \ - valid->debug_function_name[1] = OTV_NAME( y ); \ - FT_END_STMNT - -#define OTV_NEST3( x, y, z ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ - valid->func[2] = OTV_FUNC( z ); \ - valid->debug_function_name[0] = OTV_NAME( x ); \ - valid->debug_function_name[1] = OTV_NAME( y ); \ - valid->debug_function_name[2] = OTV_NAME( z ); \ - FT_END_STMNT - -#define OTV_INIT valid->debug_indent = 0 - -#define OTV_ENTER \ - FT_BEGIN_STMNT \ - valid->debug_indent += 2; \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ - FT_TRACE4(( "%s table\n", \ - valid->debug_function_name[valid->nesting_level] )); \ - FT_END_STMNT - -#define OTV_NAME_ENTER( name ) \ - FT_BEGIN_STMNT \ - valid->debug_indent += 2; \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ - FT_TRACE4(( "%s table\n", name )); \ - FT_END_STMNT - -#define OTV_EXIT valid->debug_indent -= 2 - -#define OTV_TRACE( s ) \ - FT_BEGIN_STMNT \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ - FT_TRACE4( s ); \ - FT_END_STMNT - -#else /* !FT_DEBUG_LEVEL_TRACE */ - -#define OTV_NEST1( x ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - FT_END_STMNT - -#define OTV_NEST2( x, y ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ - FT_END_STMNT - -#define OTV_NEST3( x, y, z ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ - valid->func[2] = OTV_FUNC( z ); \ - FT_END_STMNT - -#define OTV_INIT do ; while ( 0 ) -#define OTV_ENTER do ; while ( 0 ) -#define OTV_NAME_ENTER( name ) do ; while ( 0 ) -#define OTV_EXIT do ; while ( 0 ) - -#define OTV_TRACE( s ) do ; while ( 0 ) - -#endif /* !FT_DEBUG_LEVEL_TRACE */ - - -#define OTV_RUN valid->func[0] - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** COVERAGE TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - otv_Coverage_validate( FT_Bytes table, - OTV_Validator valid ); - - /* return first covered glyph */ - FT_LOCAL( FT_UInt ) - otv_Coverage_get_first( FT_Bytes table ); - - /* return last covered glyph */ - FT_LOCAL( FT_UInt ) - otv_Coverage_get_last( FT_Bytes table ); - - /* return number of covered glyphs */ - FT_LOCAL( FT_UInt ) - otv_Coverage_get_count( FT_Bytes table ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** CLASS DEFINITION TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - otv_ClassDef_validate( FT_Bytes table, - OTV_Validator valid ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** DEVICE TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - otv_Device_validate( FT_Bytes table, - OTV_Validator valid ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** LOOKUPS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - otv_Lookup_validate( FT_Bytes table, - OTV_Validator valid ); - - FT_LOCAL( void ) - otv_LookupList_validate( FT_Bytes table, - OTV_Validator valid ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FEATURES *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - otv_Feature_validate( FT_Bytes table, - OTV_Validator valid ); - - /* lookups must already be validated */ - FT_LOCAL( void ) - otv_FeatureList_validate( FT_Bytes table, - FT_Bytes lookups, - OTV_Validator valid ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** LANGUAGE SYSTEM *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - otv_LangSys_validate( FT_Bytes table, - OTV_Validator valid ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** SCRIPTS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - otv_Script_validate( FT_Bytes table, - OTV_Validator valid ); - - /* features must already be validated */ - FT_LOCAL( void ) - otv_ScriptList_validate( FT_Bytes table, - FT_Bytes features, - OTV_Validator valid ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** UTILITY FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#define ChainPosClassSetFunc otv_x_Ox -#define ChainPosRuleSetFunc otv_x_Ox -#define ChainSubClassSetFunc otv_x_Ox -#define ChainSubRuleSetFunc otv_x_Ox -#define JstfLangSysFunc otv_x_Ox -#define JstfMaxFunc otv_x_Ox -#define LigGlyphFunc otv_x_Ox -#define LigatureArrayFunc otv_x_Ox -#define LigatureSetFunc otv_x_Ox -#define PosClassSetFunc otv_x_Ox -#define PosRuleSetFunc otv_x_Ox -#define SubClassSetFunc otv_x_Ox -#define SubRuleSetFunc otv_x_Ox - - FT_LOCAL( void ) - otv_x_Ox ( FT_Bytes table, - OTV_Validator valid ); - -#define AlternateSubstFormat1Func otv_u_C_x_Ox -#define ChainContextPosFormat1Func otv_u_C_x_Ox -#define ChainContextSubstFormat1Func otv_u_C_x_Ox -#define ContextPosFormat1Func otv_u_C_x_Ox -#define ContextSubstFormat1Func otv_u_C_x_Ox -#define LigatureSubstFormat1Func otv_u_C_x_Ox -#define MultipleSubstFormat1Func otv_u_C_x_Ox - - FT_LOCAL( void ) - otv_u_C_x_Ox( FT_Bytes table, - OTV_Validator valid ); - -#define AlternateSetFunc otv_x_ux -#define AttachPointFunc otv_x_ux -#define ExtenderGlyphFunc otv_x_ux -#define JstfGPOSModListFunc otv_x_ux -#define JstfGSUBModListFunc otv_x_ux -#define SequenceFunc otv_x_ux - - FT_LOCAL( void ) - otv_x_ux( FT_Bytes table, - OTV_Validator valid ); - -#define PosClassRuleFunc otv_x_y_ux_sy -#define PosRuleFunc otv_x_y_ux_sy -#define SubClassRuleFunc otv_x_y_ux_sy -#define SubRuleFunc otv_x_y_ux_sy - - FT_LOCAL( void ) - otv_x_y_ux_sy( FT_Bytes table, - OTV_Validator valid ); - -#define ChainPosClassRuleFunc otv_x_ux_y_uy_z_uz_p_sp -#define ChainPosRuleFunc otv_x_ux_y_uy_z_uz_p_sp -#define ChainSubClassRuleFunc otv_x_ux_y_uy_z_uz_p_sp -#define ChainSubRuleFunc otv_x_ux_y_uy_z_uz_p_sp - - FT_LOCAL( void ) - otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes table, - OTV_Validator valid ); - -#define ContextPosFormat2Func otv_u_O_O_x_Onx -#define ContextSubstFormat2Func otv_u_O_O_x_Onx - - FT_LOCAL( void ) - otv_u_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ); - -#define ContextPosFormat3Func otv_u_x_y_Ox_sy -#define ContextSubstFormat3Func otv_u_x_y_Ox_sy - - FT_LOCAL( void ) - otv_u_x_y_Ox_sy( FT_Bytes table, - OTV_Validator valid ); - -#define ChainContextPosFormat2Func otv_u_O_O_O_O_x_Onx -#define ChainContextSubstFormat2Func otv_u_O_O_O_O_x_Onx - - FT_LOCAL( void ) - otv_u_O_O_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ); - -#define ChainContextPosFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp -#define ChainContextSubstFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp - - FT_LOCAL( void ) - otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes table, - OTV_Validator valid ); - - - FT_LOCAL( FT_UInt ) - otv_GSUBGPOS_get_Lookup_count( FT_Bytes table ); - - FT_LOCAL( FT_UInt ) - otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes table ); - - /* */ - -FT_END_HEADER - -#endif /* __OTVCOMMN_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* otvcommn.h */ +/* */ +/* OpenType common tables validation (specification). */ +/* */ +/* Copyright 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __OTVCOMMN_H__ +#define __OTVCOMMN_H__ + + +#include +#include "otvalid.h" +#include FT_INTERNAL_DEBUG_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** VALIDATION *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct OTV_ValidatorRec_* OTV_Validator; + + typedef void (*OTV_Validate_Func)( FT_Bytes table, + OTV_Validator valid ); + + typedef struct OTV_ValidatorRec_ + { + FT_Validator root; + FT_UInt type_count; + OTV_Validate_Func* type_funcs; + + FT_UInt lookup_count; + FT_UInt glyph_count; + + FT_UInt nesting_level; + + OTV_Validate_Func func[3]; + + FT_UInt extra1; /* for passing parameters */ + FT_UInt extra2; + FT_Bytes extra3; + +#ifdef FT_DEBUG_LEVEL_TRACE + FT_UInt debug_indent; + const FT_String* debug_function_name[3]; +#endif + + } OTV_ValidatorRec; + + +#undef FT_INVALID_ +#define FT_INVALID_( _prefix, _error ) \ + ft_validator_error( valid->root, _prefix ## _error ) + +#define OTV_OPTIONAL_TABLE( _table ) FT_UShort _table; \ + FT_Bytes _table ## _p + +#define OTV_OPTIONAL_OFFSET( _offset ) \ + FT_BEGIN_STMNT \ + _offset ## _p = p; \ + _offset = FT_NEXT_USHORT( p ); \ + FT_END_STMNT + +#define OTV_LIMIT_CHECK( _count ) \ + FT_BEGIN_STMNT \ + if ( p + (_count) > valid->root->limit ) \ + FT_INVALID_TOO_SHORT; \ + FT_END_STMNT + +#define OTV_SIZE_CHECK( _size ) \ + FT_BEGIN_STMNT \ + if ( _size > 0 && _size < table_size ) \ + { \ + if ( valid->root->level == FT_VALIDATE_PARANOID ) \ + FT_INVALID_OFFSET; \ + else \ + { \ + /* strip off `const' */ \ + FT_Byte* pp = (FT_Byte*)_size ## _p; \ + \ + \ + FT_TRACE3(( "\n" \ + "Invalid offset to optional table `%s'!\n" \ + "Set to zero.\n" \ + "\n", #_size )); \ + \ + /* always assume 16bit entities */ \ + _size = pp[0] = pp[1] = 0; \ + } \ + } \ + FT_END_STMNT + + +#define OTV_NAME_(x) #x +#define OTV_NAME(x) OTV_NAME_(x) + +#define OTV_FUNC_(x) x##Func +#define OTV_FUNC(x) OTV_FUNC_(x) + +#ifdef FT_DEBUG_LEVEL_TRACE + +#define OTV_NEST1( x ) \ + FT_BEGIN_STMNT \ + valid->nesting_level = 0; \ + valid->func[0] = OTV_FUNC( x ); \ + valid->debug_function_name[0] = OTV_NAME( x ); \ + FT_END_STMNT + +#define OTV_NEST2( x, y ) \ + FT_BEGIN_STMNT \ + valid->nesting_level = 0; \ + valid->func[0] = OTV_FUNC( x ); \ + valid->func[1] = OTV_FUNC( y ); \ + valid->debug_function_name[0] = OTV_NAME( x ); \ + valid->debug_function_name[1] = OTV_NAME( y ); \ + FT_END_STMNT + +#define OTV_NEST3( x, y, z ) \ + FT_BEGIN_STMNT \ + valid->nesting_level = 0; \ + valid->func[0] = OTV_FUNC( x ); \ + valid->func[1] = OTV_FUNC( y ); \ + valid->func[2] = OTV_FUNC( z ); \ + valid->debug_function_name[0] = OTV_NAME( x ); \ + valid->debug_function_name[1] = OTV_NAME( y ); \ + valid->debug_function_name[2] = OTV_NAME( z ); \ + FT_END_STMNT + +#define OTV_INIT valid->debug_indent = 0 + +#define OTV_ENTER \ + FT_BEGIN_STMNT \ + valid->debug_indent += 2; \ + FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ + FT_TRACE4(( "%s table\n", \ + valid->debug_function_name[valid->nesting_level] )); \ + FT_END_STMNT + +#define OTV_NAME_ENTER( name ) \ + FT_BEGIN_STMNT \ + valid->debug_indent += 2; \ + FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ + FT_TRACE4(( "%s table\n", name )); \ + FT_END_STMNT + +#define OTV_EXIT valid->debug_indent -= 2 + +#define OTV_TRACE( s ) \ + FT_BEGIN_STMNT \ + FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ + FT_TRACE4( s ); \ + FT_END_STMNT + +#else /* !FT_DEBUG_LEVEL_TRACE */ + +#define OTV_NEST1( x ) \ + FT_BEGIN_STMNT \ + valid->nesting_level = 0; \ + valid->func[0] = OTV_FUNC( x ); \ + FT_END_STMNT + +#define OTV_NEST2( x, y ) \ + FT_BEGIN_STMNT \ + valid->nesting_level = 0; \ + valid->func[0] = OTV_FUNC( x ); \ + valid->func[1] = OTV_FUNC( y ); \ + FT_END_STMNT + +#define OTV_NEST3( x, y, z ) \ + FT_BEGIN_STMNT \ + valid->nesting_level = 0; \ + valid->func[0] = OTV_FUNC( x ); \ + valid->func[1] = OTV_FUNC( y ); \ + valid->func[2] = OTV_FUNC( z ); \ + FT_END_STMNT + +#define OTV_INIT do ; while ( 0 ) +#define OTV_ENTER do ; while ( 0 ) +#define OTV_NAME_ENTER( name ) do ; while ( 0 ) +#define OTV_EXIT do ; while ( 0 ) + +#define OTV_TRACE( s ) do ; while ( 0 ) + +#endif /* !FT_DEBUG_LEVEL_TRACE */ + + +#define OTV_RUN valid->func[0] + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** COVERAGE TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + otv_Coverage_validate( FT_Bytes table, + OTV_Validator valid ); + + /* return first covered glyph */ + FT_LOCAL( FT_UInt ) + otv_Coverage_get_first( FT_Bytes table ); + + /* return last covered glyph */ + FT_LOCAL( FT_UInt ) + otv_Coverage_get_last( FT_Bytes table ); + + /* return number of covered glyphs */ + FT_LOCAL( FT_UInt ) + otv_Coverage_get_count( FT_Bytes table ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** CLASS DEFINITION TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + otv_ClassDef_validate( FT_Bytes table, + OTV_Validator valid ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** DEVICE TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + otv_Device_validate( FT_Bytes table, + OTV_Validator valid ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** LOOKUPS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + otv_Lookup_validate( FT_Bytes table, + OTV_Validator valid ); + + FT_LOCAL( void ) + otv_LookupList_validate( FT_Bytes table, + OTV_Validator valid ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FEATURES *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + otv_Feature_validate( FT_Bytes table, + OTV_Validator valid ); + + /* lookups must already be validated */ + FT_LOCAL( void ) + otv_FeatureList_validate( FT_Bytes table, + FT_Bytes lookups, + OTV_Validator valid ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** LANGUAGE SYSTEM *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + otv_LangSys_validate( FT_Bytes table, + OTV_Validator valid ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** SCRIPTS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + otv_Script_validate( FT_Bytes table, + OTV_Validator valid ); + + /* features must already be validated */ + FT_LOCAL( void ) + otv_ScriptList_validate( FT_Bytes table, + FT_Bytes features, + OTV_Validator valid ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define ChainPosClassSetFunc otv_x_Ox +#define ChainPosRuleSetFunc otv_x_Ox +#define ChainSubClassSetFunc otv_x_Ox +#define ChainSubRuleSetFunc otv_x_Ox +#define JstfLangSysFunc otv_x_Ox +#define JstfMaxFunc otv_x_Ox +#define LigGlyphFunc otv_x_Ox +#define LigatureArrayFunc otv_x_Ox +#define LigatureSetFunc otv_x_Ox +#define PosClassSetFunc otv_x_Ox +#define PosRuleSetFunc otv_x_Ox +#define SubClassSetFunc otv_x_Ox +#define SubRuleSetFunc otv_x_Ox + + FT_LOCAL( void ) + otv_x_Ox ( FT_Bytes table, + OTV_Validator valid ); + +#define AlternateSubstFormat1Func otv_u_C_x_Ox +#define ChainContextPosFormat1Func otv_u_C_x_Ox +#define ChainContextSubstFormat1Func otv_u_C_x_Ox +#define ContextPosFormat1Func otv_u_C_x_Ox +#define ContextSubstFormat1Func otv_u_C_x_Ox +#define LigatureSubstFormat1Func otv_u_C_x_Ox +#define MultipleSubstFormat1Func otv_u_C_x_Ox + + FT_LOCAL( void ) + otv_u_C_x_Ox( FT_Bytes table, + OTV_Validator valid ); + +#define AlternateSetFunc otv_x_ux +#define AttachPointFunc otv_x_ux +#define ExtenderGlyphFunc otv_x_ux +#define JstfGPOSModListFunc otv_x_ux +#define JstfGSUBModListFunc otv_x_ux +#define SequenceFunc otv_x_ux + + FT_LOCAL( void ) + otv_x_ux( FT_Bytes table, + OTV_Validator valid ); + +#define PosClassRuleFunc otv_x_y_ux_sy +#define PosRuleFunc otv_x_y_ux_sy +#define SubClassRuleFunc otv_x_y_ux_sy +#define SubRuleFunc otv_x_y_ux_sy + + FT_LOCAL( void ) + otv_x_y_ux_sy( FT_Bytes table, + OTV_Validator valid ); + +#define ChainPosClassRuleFunc otv_x_ux_y_uy_z_uz_p_sp +#define ChainPosRuleFunc otv_x_ux_y_uy_z_uz_p_sp +#define ChainSubClassRuleFunc otv_x_ux_y_uy_z_uz_p_sp +#define ChainSubRuleFunc otv_x_ux_y_uy_z_uz_p_sp + + FT_LOCAL( void ) + otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes table, + OTV_Validator valid ); + +#define ContextPosFormat2Func otv_u_O_O_x_Onx +#define ContextSubstFormat2Func otv_u_O_O_x_Onx + + FT_LOCAL( void ) + otv_u_O_O_x_Onx( FT_Bytes table, + OTV_Validator valid ); + +#define ContextPosFormat3Func otv_u_x_y_Ox_sy +#define ContextSubstFormat3Func otv_u_x_y_Ox_sy + + FT_LOCAL( void ) + otv_u_x_y_Ox_sy( FT_Bytes table, + OTV_Validator valid ); + +#define ChainContextPosFormat2Func otv_u_O_O_O_O_x_Onx +#define ChainContextSubstFormat2Func otv_u_O_O_O_O_x_Onx + + FT_LOCAL( void ) + otv_u_O_O_O_O_x_Onx( FT_Bytes table, + OTV_Validator valid ); + +#define ChainContextPosFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp +#define ChainContextSubstFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp + + FT_LOCAL( void ) + otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes table, + OTV_Validator valid ); + + + FT_LOCAL( FT_UInt ) + otv_GSUBGPOS_get_Lookup_count( FT_Bytes table ); + + FT_LOCAL( FT_UInt ) + otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes table ); + + /* */ + +FT_END_HEADER + +#endif /* __OTVCOMMN_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otverror.h b/reactos/dll/3rdparty/freetype/src/otvalid/otverror.h index 041b538368c..cbf5ae12469 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otverror.h +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otverror.h @@ -1,43 +1,43 @@ -/***************************************************************************/ -/* */ -/* otverror.h */ -/* */ -/* OpenType validation module error codes (specification only). */ -/* */ -/* Copyright 2004, 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the OpenType validation module error */ - /* enumeration constants. */ - /* */ - /*************************************************************************/ - -#ifndef __OTVERROR_H__ -#define __OTVERROR_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX OTV_Err_ -#define FT_ERR_BASE FT_Mod_Err_OTvalid - -#define FT_KEEP_ERR_PREFIX - -#include FT_ERRORS_H - -#endif /* __OTVERROR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* otverror.h */ +/* */ +/* OpenType validation module error codes (specification only). */ +/* */ +/* Copyright 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the OpenType validation module error */ + /* enumeration constants. */ + /* */ + /*************************************************************************/ + +#ifndef __OTVERROR_H__ +#define __OTVERROR_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX OTV_Err_ +#define FT_ERR_BASE FT_Mod_Err_OTvalid + +#define FT_KEEP_ERR_PREFIX + +#include FT_ERRORS_H + +#endif /* __OTVERROR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvgdef.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvgdef.c index 7d24902e881..5f7f4db3c47 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvgdef.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvgdef.c @@ -1,219 +1,219 @@ -/***************************************************************************/ -/* */ -/* otvgdef.c */ -/* */ -/* OpenType GDEF table validation (body). */ -/* */ -/* Copyright 2004, 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "otvalid.h" -#include "otvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_otvgdef - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** UTILITY FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#define AttachListFunc otv_O_x_Ox -#define LigCaretListFunc otv_O_x_Ox - - /* sets valid->extra1 (0) */ - - static void - otv_O_x_Ox( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_Bytes Coverage; - FT_UInt GlyphCount; - OTV_Validate_Func func; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 4 ); - Coverage = table + FT_NEXT_USHORT( p ); - GlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - - otv_Coverage_validate( Coverage, valid ); - if ( GlyphCount != otv_Coverage_get_count( Coverage ) ) - FT_INVALID_DATA; - - OTV_LIMIT_CHECK( GlyphCount * 2 ); - - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = 0; - - for ( ; GlyphCount > 0; GlyphCount-- ) - func( table + FT_NEXT_USHORT( p ), valid ); - - valid->nesting_level--; - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** LIGATURE CARETS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#define CaretValueFunc otv_CaretValue_validate - - static void - otv_CaretValue_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt CaretValueFormat; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 4 ); - - CaretValueFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format = %d)\n", CaretValueFormat )); - - switch ( CaretValueFormat ) - { - case 1: /* CaretValueFormat1 */ - /* skip Coordinate, no test */ - break; - - case 2: /* CaretValueFormat2 */ - /* skip CaretValuePoint, no test */ - break; - - case 3: /* CaretValueFormat3 */ - p += 2; /* skip Coordinate */ - - OTV_LIMIT_CHECK( 2 ); - - /* DeviceTable */ - otv_Device_validate( table + FT_NEXT_USHORT( p ), valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GDEF TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - otv_GDEF_validate( FT_Bytes table, - FT_Bytes gsub, - FT_Bytes gpos, - FT_Validator ftvalid ) - { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; - FT_UInt table_size; - FT_Bool need_MarkAttachClassDef; - - OTV_OPTIONAL_TABLE( GlyphClassDef ); - OTV_OPTIONAL_TABLE( AttachListOffset ); - OTV_OPTIONAL_TABLE( LigCaretListOffset ); - OTV_OPTIONAL_TABLE( MarkAttachClassDef ); - - - valid->root = ftvalid; - - FT_TRACE3(( "validating GDEF table\n" )); - OTV_INIT; - - OTV_LIMIT_CHECK( 12 ); - - if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ - FT_INVALID_FORMAT; - - /* MarkAttachClassDef has been added to the OpenType */ - /* specification without increasing GDEF's version, */ - /* so we use this ugly hack to find out whether the */ - /* table is needed actually. */ - - need_MarkAttachClassDef = FT_BOOL( - otv_GSUBGPOS_have_MarkAttachmentType_flag( gsub ) || - otv_GSUBGPOS_have_MarkAttachmentType_flag( gpos ) ); - - if ( need_MarkAttachClassDef ) - table_size = 12; /* OpenType >= 1.2 */ - else - table_size = 10; /* OpenType < 1.2 */ - - OTV_OPTIONAL_OFFSET( GlyphClassDef ); - OTV_SIZE_CHECK( GlyphClassDef ); - if ( GlyphClassDef ) - otv_ClassDef_validate( table + GlyphClassDef, valid ); - - OTV_OPTIONAL_OFFSET( AttachListOffset ); - OTV_SIZE_CHECK( AttachListOffset ); - if ( AttachListOffset ) - { - OTV_NEST2( AttachList, AttachPoint ); - OTV_RUN( table + AttachListOffset, valid ); - } - - OTV_OPTIONAL_OFFSET( LigCaretListOffset ); - OTV_SIZE_CHECK( LigCaretListOffset ); - if ( LigCaretListOffset ) - { - OTV_NEST3( LigCaretList, LigGlyph, CaretValue ); - OTV_RUN( table + LigCaretListOffset, valid ); - } - - if ( need_MarkAttachClassDef ) - { - OTV_OPTIONAL_OFFSET( MarkAttachClassDef ); - OTV_SIZE_CHECK( MarkAttachClassDef ); - if ( MarkAttachClassDef ) - otv_ClassDef_validate( table + MarkAttachClassDef, valid ); - } - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* otvgdef.c */ +/* */ +/* OpenType GDEF table validation (body). */ +/* */ +/* Copyright 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "otvalid.h" +#include "otvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_otvgdef + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define AttachListFunc otv_O_x_Ox +#define LigCaretListFunc otv_O_x_Ox + + /* sets valid->extra1 (0) */ + + static void + otv_O_x_Ox( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_Bytes Coverage; + FT_UInt GlyphCount; + OTV_Validate_Func func; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 4 ); + Coverage = table + FT_NEXT_USHORT( p ); + GlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + + otv_Coverage_validate( Coverage, valid ); + if ( GlyphCount != otv_Coverage_get_count( Coverage ) ) + FT_INVALID_DATA; + + OTV_LIMIT_CHECK( GlyphCount * 2 ); + + valid->nesting_level++; + func = valid->func[valid->nesting_level]; + valid->extra1 = 0; + + for ( ; GlyphCount > 0; GlyphCount-- ) + func( table + FT_NEXT_USHORT( p ), valid ); + + valid->nesting_level--; + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** LIGATURE CARETS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define CaretValueFunc otv_CaretValue_validate + + static void + otv_CaretValue_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt CaretValueFormat; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 4 ); + + CaretValueFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format = %d)\n", CaretValueFormat )); + + switch ( CaretValueFormat ) + { + case 1: /* CaretValueFormat1 */ + /* skip Coordinate, no test */ + break; + + case 2: /* CaretValueFormat2 */ + /* skip CaretValuePoint, no test */ + break; + + case 3: /* CaretValueFormat3 */ + p += 2; /* skip Coordinate */ + + OTV_LIMIT_CHECK( 2 ); + + /* DeviceTable */ + otv_Device_validate( table + FT_NEXT_USHORT( p ), valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GDEF TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + otv_GDEF_validate( FT_Bytes table, + FT_Bytes gsub, + FT_Bytes gpos, + FT_Validator ftvalid ) + { + OTV_ValidatorRec validrec; + OTV_Validator valid = &validrec; + FT_Bytes p = table; + FT_UInt table_size; + FT_Bool need_MarkAttachClassDef; + + OTV_OPTIONAL_TABLE( GlyphClassDef ); + OTV_OPTIONAL_TABLE( AttachListOffset ); + OTV_OPTIONAL_TABLE( LigCaretListOffset ); + OTV_OPTIONAL_TABLE( MarkAttachClassDef ); + + + valid->root = ftvalid; + + FT_TRACE3(( "validating GDEF table\n" )); + OTV_INIT; + + OTV_LIMIT_CHECK( 12 ); + + if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ + FT_INVALID_FORMAT; + + /* MarkAttachClassDef has been added to the OpenType */ + /* specification without increasing GDEF's version, */ + /* so we use this ugly hack to find out whether the */ + /* table is needed actually. */ + + need_MarkAttachClassDef = FT_BOOL( + otv_GSUBGPOS_have_MarkAttachmentType_flag( gsub ) || + otv_GSUBGPOS_have_MarkAttachmentType_flag( gpos ) ); + + if ( need_MarkAttachClassDef ) + table_size = 12; /* OpenType >= 1.2 */ + else + table_size = 10; /* OpenType < 1.2 */ + + OTV_OPTIONAL_OFFSET( GlyphClassDef ); + OTV_SIZE_CHECK( GlyphClassDef ); + if ( GlyphClassDef ) + otv_ClassDef_validate( table + GlyphClassDef, valid ); + + OTV_OPTIONAL_OFFSET( AttachListOffset ); + OTV_SIZE_CHECK( AttachListOffset ); + if ( AttachListOffset ) + { + OTV_NEST2( AttachList, AttachPoint ); + OTV_RUN( table + AttachListOffset, valid ); + } + + OTV_OPTIONAL_OFFSET( LigCaretListOffset ); + OTV_SIZE_CHECK( LigCaretListOffset ); + if ( LigCaretListOffset ) + { + OTV_NEST3( LigCaretList, LigGlyph, CaretValue ); + OTV_RUN( table + LigCaretListOffset, valid ); + } + + if ( need_MarkAttachClassDef ) + { + OTV_OPTIONAL_OFFSET( MarkAttachClassDef ); + OTV_SIZE_CHECK( MarkAttachClassDef ); + if ( MarkAttachClassDef ) + otv_ClassDef_validate( table + MarkAttachClassDef, valid ); + } + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.c index ed347053d65..16b63bbb4ba 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.c @@ -1,1013 +1,1013 @@ -/***************************************************************************/ -/* */ -/* otvgpos.c */ -/* */ -/* OpenType GPOS table validation (body). */ -/* */ -/* Copyright 2002, 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "otvalid.h" -#include "otvcommn.h" -#include "otvgpos.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_otvgpos - - - static void - otv_Anchor_validate( FT_Bytes table, - OTV_Validator valid ); - - static void - otv_MarkArray_validate( FT_Bytes table, - OTV_Validator valid ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** UTILITY FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#define BaseArrayFunc otv_x_sxy -#define LigatureAttachFunc otv_x_sxy -#define Mark2ArrayFunc otv_x_sxy - - /* uses valid->extra1 (counter) */ - /* uses valid->extra2 (boolean to handle NULL anchor field) */ - - static void - otv_x_sxy( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Count, count1, table_size; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 2 ); - - Count = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (Count = %d)\n", Count )); - - OTV_LIMIT_CHECK( Count * valid->extra1 * 2 ); - - table_size = Count * valid->extra1 * 2 + 2; - - for ( ; Count > 0; Count-- ) - for ( count1 = valid->extra1; count1 > 0; count1-- ) - { - OTV_OPTIONAL_TABLE( anchor_offset ); - - - OTV_OPTIONAL_OFFSET( anchor_offset ); - - if ( valid->extra2 ) - { - OTV_SIZE_CHECK( anchor_offset ); - if ( anchor_offset ) - otv_Anchor_validate( table + anchor_offset, valid ); - } - else - otv_Anchor_validate( table + anchor_offset, valid ); - } - - OTV_EXIT; - } - - -#define MarkBasePosFormat1Func otv_u_O_O_u_O_O -#define MarkLigPosFormat1Func otv_u_O_O_u_O_O -#define MarkMarkPosFormat1Func otv_u_O_O_u_O_O - - /* sets valid->extra1 (class count) */ - - static void - otv_u_O_O_u_O_O( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt Coverage1, Coverage2, ClassCount; - FT_UInt Array1, Array2; - OTV_Validate_Func func; - - - OTV_ENTER; - - p += 2; /* skip PosFormat */ - - OTV_LIMIT_CHECK( 10 ); - Coverage1 = FT_NEXT_USHORT( p ); - Coverage2 = FT_NEXT_USHORT( p ); - ClassCount = FT_NEXT_USHORT( p ); - Array1 = FT_NEXT_USHORT( p ); - Array2 = FT_NEXT_USHORT( p ); - - otv_Coverage_validate( table + Coverage1, valid ); - otv_Coverage_validate( table + Coverage2, valid ); - - otv_MarkArray_validate( table + Array1, valid ); - - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = ClassCount; - - func( table + Array2, valid ); - - valid->nesting_level--; - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** VALUE RECORDS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static FT_UInt - otv_value_length( FT_UInt format ) - { - FT_UInt count; - - - count = ( ( format & 0xAA ) >> 1 ) + ( format & 0x55 ); - count = ( ( count & 0xCC ) >> 2 ) + ( count & 0x33 ); - count = ( ( count & 0xF0 ) >> 4 ) + ( count & 0x0F ); - - return count * 2; - } - - - /* uses valid->extra3 (pointer to base table) */ - - static void - otv_ValueRecord_validate( FT_Bytes table, - FT_UInt format, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt count; - -#ifdef FT_DEBUG_LEVEL_TRACE - FT_Int loop; - FT_ULong res = 0; - - - OTV_NAME_ENTER( "ValueRecord" ); - - /* display `format' in dual representation */ - for ( loop = 7; loop >= 0; loop-- ) - { - res <<= 4; - res += ( format >> loop ) & 1; - } - - OTV_TRACE(( " (format 0b%08lx)\n", res )); -#endif - - if ( format >= 0x100 ) - FT_INVALID_DATA; - - for ( count = 4; count > 0; count-- ) - { - if ( format & 1 ) - { - /* XPlacement, YPlacement, XAdvance, YAdvance */ - OTV_LIMIT_CHECK( 2 ); - p += 2; - } - - format >>= 1; - } - - for ( count = 4; count > 0; count-- ) - { - if ( format & 1 ) - { - FT_UInt table_size; - - OTV_OPTIONAL_TABLE( device ); - - - /* XPlaDevice, YPlaDevice, XAdvDevice, YAdvDevice */ - OTV_LIMIT_CHECK( 2 ); - OTV_OPTIONAL_OFFSET( device ); - - /* XXX: this value is usually too small, especially if the current */ - /* ValueRecord is part of an array -- getting the correct table */ - /* size is probably not worth the trouble */ - - table_size = p - valid->extra3; - - OTV_SIZE_CHECK( device ); - if ( device ) - otv_Device_validate( valid->extra3 + device, valid ); - } - format >>= 1; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** ANCHORS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - otv_Anchor_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt AnchorFormat; - - - OTV_NAME_ENTER( "Anchor"); - - OTV_LIMIT_CHECK( 6 ); - AnchorFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", AnchorFormat )); - - p += 4; /* skip XCoordinate and YCoordinate */ - - switch ( AnchorFormat ) - { - case 1: - break; - - case 2: - OTV_LIMIT_CHECK( 2 ); /* AnchorPoint */ - break; - - case 3: - { - FT_UInt table_size; - - OTV_OPTIONAL_TABLE( XDeviceTable ); - OTV_OPTIONAL_TABLE( YDeviceTable ); - - - OTV_LIMIT_CHECK( 4 ); - OTV_OPTIONAL_OFFSET( XDeviceTable ); - OTV_OPTIONAL_OFFSET( YDeviceTable ); - - table_size = 6 + 4; - - OTV_SIZE_CHECK( XDeviceTable ); - if ( XDeviceTable ) - otv_Device_validate( table + XDeviceTable, valid ); - - OTV_SIZE_CHECK( YDeviceTable ); - if ( YDeviceTable ) - otv_Device_validate( table + YDeviceTable, valid ); - } - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** MARK ARRAYS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - otv_MarkArray_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt MarkCount; - - - OTV_NAME_ENTER( "MarkArray" ); - - OTV_LIMIT_CHECK( 2 ); - MarkCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (MarkCount = %d)\n", MarkCount )); - - OTV_LIMIT_CHECK( MarkCount * 4 ); - - /* MarkRecord */ - for ( ; MarkCount > 0; MarkCount-- ) - { - p += 2; /* skip Class */ - /* MarkAnchor */ - otv_Anchor_validate( table + FT_NEXT_USHORT( p ), valid ); - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 1 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra3 (pointer to base table) */ - - static void - otv_SinglePos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "SinglePos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - valid->extra3 = table; - - switch ( PosFormat ) - { - case 1: /* SinglePosFormat1 */ - { - FT_UInt Coverage, ValueFormat; - - - OTV_LIMIT_CHECK( 4 ); - Coverage = FT_NEXT_USHORT( p ); - ValueFormat = FT_NEXT_USHORT( p ); - - otv_Coverage_validate( table + Coverage, valid ); - otv_ValueRecord_validate( p, ValueFormat, valid ); /* Value */ - } - break; - - case 2: /* SinglePosFormat2 */ - { - FT_UInt Coverage, ValueFormat, ValueCount, len_value; - - - OTV_LIMIT_CHECK( 6 ); - Coverage = FT_NEXT_USHORT( p ); - ValueFormat = FT_NEXT_USHORT( p ); - ValueCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (ValueCount = %d)\n", ValueCount )); - - len_value = otv_value_length( ValueFormat ); - - otv_Coverage_validate( table + Coverage, valid ); - - OTV_LIMIT_CHECK( ValueCount * len_value ); - - /* Value */ - for ( ; ValueCount > 0; ValueCount-- ) - { - otv_ValueRecord_validate( p, ValueFormat, valid ); - p += len_value; - } - } - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 2 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - otv_PairSet_validate( FT_Bytes table, - FT_UInt format1, - FT_UInt format2, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt value_len1, value_len2, PairValueCount; - - - OTV_NAME_ENTER( "PairSet" ); - - OTV_LIMIT_CHECK( 2 ); - PairValueCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (PairValueCount = %d)\n", PairValueCount )); - - value_len1 = otv_value_length( format1 ); - value_len2 = otv_value_length( format2 ); - - OTV_LIMIT_CHECK( PairValueCount * ( value_len1 + value_len2 + 2 ) ); - - /* PairValueRecord */ - for ( ; PairValueCount > 0; PairValueCount-- ) - { - p += 2; /* skip SecondGlyph */ - - if ( format1 ) - otv_ValueRecord_validate( p, format1, valid ); /* Value1 */ - p += value_len1; - - if ( format2 ) - otv_ValueRecord_validate( p, format2, valid ); /* Value2 */ - p += value_len2; - } - - OTV_EXIT; - } - - - /* sets valid->extra3 (pointer to base table) */ - - static void - otv_PairPos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "PairPos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - valid->extra3 = table; - - switch ( PosFormat ) - { - case 1: /* PairPosFormat1 */ - { - FT_UInt Coverage, ValueFormat1, ValueFormat2, PairSetCount; - - - OTV_LIMIT_CHECK( 8 ); - Coverage = FT_NEXT_USHORT( p ); - ValueFormat1 = FT_NEXT_USHORT( p ); - ValueFormat2 = FT_NEXT_USHORT( p ); - PairSetCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (PairSetCount = %d)\n", PairSetCount )); - - otv_Coverage_validate( table + Coverage, valid ); - - OTV_LIMIT_CHECK( PairSetCount * 2 ); - - /* PairSetOffset */ - for ( ; PairSetCount > 0; PairSetCount-- ) - otv_PairSet_validate( table + FT_NEXT_USHORT( p ), - ValueFormat1, ValueFormat2, valid ); - } - break; - - case 2: /* PairPosFormat2 */ - { - FT_UInt Coverage, ValueFormat1, ValueFormat2, ClassDef1, ClassDef2; - FT_UInt ClassCount1, ClassCount2, len_value1, len_value2, count; - - - OTV_LIMIT_CHECK( 14 ); - Coverage = FT_NEXT_USHORT( p ); - ValueFormat1 = FT_NEXT_USHORT( p ); - ValueFormat2 = FT_NEXT_USHORT( p ); - ClassDef1 = FT_NEXT_USHORT( p ); - ClassDef2 = FT_NEXT_USHORT( p ); - ClassCount1 = FT_NEXT_USHORT( p ); - ClassCount2 = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (ClassCount1 = %d)\n", ClassCount1 )); - OTV_TRACE(( " (ClassCount2 = %d)\n", ClassCount2 )); - - len_value1 = otv_value_length( ValueFormat1 ); - len_value2 = otv_value_length( ValueFormat2 ); - - otv_Coverage_validate( table + Coverage, valid ); - otv_ClassDef_validate( table + ClassDef1, valid ); - otv_ClassDef_validate( table + ClassDef2, valid ); - - OTV_LIMIT_CHECK( ClassCount1 * ClassCount2 * - ( len_value1 + len_value2 ) ); - - /* Class1Record */ - for ( ; ClassCount1 > 0; ClassCount1-- ) - { - /* Class2Record */ - for ( count = ClassCount2; count > 0; count-- ) - { - if ( ValueFormat1 ) - /* Value1 */ - otv_ValueRecord_validate( p, ValueFormat1, valid ); - p += len_value1; - - if ( ValueFormat2 ) - /* Value2 */ - otv_ValueRecord_validate( p, ValueFormat2, valid ); - p += len_value2; - } - } - } - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 3 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - otv_CursivePos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "CursivePos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - switch ( PosFormat ) - { - case 1: /* CursivePosFormat1 */ - { - FT_UInt table_size; - FT_UInt Coverage, EntryExitCount; - - OTV_OPTIONAL_TABLE( EntryAnchor ); - OTV_OPTIONAL_TABLE( ExitAnchor ); - - - OTV_LIMIT_CHECK( 4 ); - Coverage = FT_NEXT_USHORT( p ); - EntryExitCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (EntryExitCount = %d)\n", EntryExitCount )); - - otv_Coverage_validate( table + Coverage, valid ); - - OTV_LIMIT_CHECK( EntryExitCount * 4 ); - - table_size = EntryExitCount * 4 + 4; - - /* EntryExitRecord */ - for ( ; EntryExitCount > 0; EntryExitCount-- ) - { - OTV_OPTIONAL_OFFSET( EntryAnchor ); - OTV_OPTIONAL_OFFSET( ExitAnchor ); - - OTV_SIZE_CHECK( EntryAnchor ); - if ( EntryAnchor ) - otv_Anchor_validate( table + EntryAnchor, valid ); - - OTV_SIZE_CHECK( ExitAnchor ); - if ( ExitAnchor ) - otv_Anchor_validate( table + ExitAnchor, valid ); - } - } - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 4 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra2 (0) */ - - static void - otv_MarkBasePos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "MarkBasePos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - switch ( PosFormat ) - { - case 1: - valid->extra2 = 0; - OTV_NEST2( MarkBasePosFormat1, BaseArray ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 5 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra2 (1) */ - - static void - otv_MarkLigPos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "MarkLigPos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - switch ( PosFormat ) - { - case 1: - valid->extra2 = 1; - OTV_NEST3( MarkLigPosFormat1, LigatureArray, LigatureAttach ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 6 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra2 (0) */ - - static void - otv_MarkMarkPos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "MarkMarkPos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - switch ( PosFormat ) - { - case 1: - valid->extra2 = 0; - OTV_NEST2( MarkMarkPosFormat1, Mark2Array ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 7 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra1 (lookup count) */ - - static void - otv_ContextPos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "ContextPos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - switch ( PosFormat ) - { - case 1: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - valid->extra1 = valid->lookup_count; - OTV_NEST3( ContextPosFormat1, PosRuleSet, PosRule ); - OTV_RUN( table, valid ); - break; - - case 2: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - OTV_NEST3( ContextPosFormat2, PosClassSet, PosClassRule ); - OTV_RUN( table, valid ); - break; - - case 3: - OTV_NEST1( ContextPosFormat3 ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 8 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra1 (lookup count) */ - - static void - otv_ChainContextPos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "ChainContextPos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - switch ( PosFormat ) - { - case 1: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - valid->extra1 = valid->lookup_count; - OTV_NEST3( ChainContextPosFormat1, - ChainPosRuleSet, ChainPosRule ); - OTV_RUN( table, valid ); - break; - - case 2: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - OTV_NEST3( ChainContextPosFormat2, - ChainPosClassSet, ChainPosClassRule ); - OTV_RUN( table, valid ); - break; - - case 3: - OTV_NEST1( ChainContextPosFormat3 ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS LOOKUP TYPE 9 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* uses valid->type_funcs */ - - static void - otv_ExtensionPos_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt PosFormat; - - - OTV_NAME_ENTER( "ExtensionPos" ); - - OTV_LIMIT_CHECK( 2 ); - PosFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", PosFormat )); - - switch ( PosFormat ) - { - case 1: /* ExtensionPosFormat1 */ - { - FT_UInt ExtensionLookupType, ExtensionOffset; - OTV_Validate_Func validate; - - - OTV_LIMIT_CHECK( 6 ); - ExtensionLookupType = FT_NEXT_USHORT( p ); - ExtensionOffset = FT_NEXT_ULONG( p ); - - if ( ExtensionLookupType == 0 || ExtensionLookupType >= 9 ) - FT_INVALID_DATA; - - validate = valid->type_funcs[ExtensionLookupType - 1]; - validate( table + ExtensionOffset, valid ); - } - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - static const OTV_Validate_Func otv_gpos_validate_funcs[9] = - { - otv_SinglePos_validate, - otv_PairPos_validate, - otv_CursivePos_validate, - otv_MarkBasePos_validate, - otv_MarkLigPos_validate, - otv_MarkMarkPos_validate, - otv_ContextPos_validate, - otv_ChainContextPos_validate, - otv_ExtensionPos_validate - }; - - - /* sets valid->type_count */ - /* sets valid->type_funcs */ - - FT_LOCAL_DEF( void ) - otv_GPOS_subtable_validate( FT_Bytes table, - OTV_Validator valid ) - { - valid->type_count = 9; - valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; - - otv_Lookup_validate( table, valid ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GPOS TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->glyph_count */ - - FT_LOCAL_DEF( void ) - otv_GPOS_validate( FT_Bytes table, - FT_UInt glyph_count, - FT_Validator ftvalid ) - { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; - FT_UInt ScriptList, FeatureList, LookupList; - - - valid->root = ftvalid; - - FT_TRACE3(( "validating GPOS table\n" )); - OTV_INIT; - - OTV_LIMIT_CHECK( 10 ); - - if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ - FT_INVALID_DATA; - - ScriptList = FT_NEXT_USHORT( p ); - FeatureList = FT_NEXT_USHORT( p ); - LookupList = FT_NEXT_USHORT( p ); - - valid->type_count = 9; - valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; - valid->glyph_count = glyph_count; - - otv_LookupList_validate( table + LookupList, - valid ); - otv_FeatureList_validate( table + FeatureList, table + LookupList, - valid ); - otv_ScriptList_validate( table + ScriptList, table + FeatureList, - valid ); - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* otvgpos.c */ +/* */ +/* OpenType GPOS table validation (body). */ +/* */ +/* Copyright 2002, 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "otvalid.h" +#include "otvcommn.h" +#include "otvgpos.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_otvgpos + + + static void + otv_Anchor_validate( FT_Bytes table, + OTV_Validator valid ); + + static void + otv_MarkArray_validate( FT_Bytes table, + OTV_Validator valid ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** UTILITY FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define BaseArrayFunc otv_x_sxy +#define LigatureAttachFunc otv_x_sxy +#define Mark2ArrayFunc otv_x_sxy + + /* uses valid->extra1 (counter) */ + /* uses valid->extra2 (boolean to handle NULL anchor field) */ + + static void + otv_x_sxy( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Count, count1, table_size; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 2 ); + + Count = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (Count = %d)\n", Count )); + + OTV_LIMIT_CHECK( Count * valid->extra1 * 2 ); + + table_size = Count * valid->extra1 * 2 + 2; + + for ( ; Count > 0; Count-- ) + for ( count1 = valid->extra1; count1 > 0; count1-- ) + { + OTV_OPTIONAL_TABLE( anchor_offset ); + + + OTV_OPTIONAL_OFFSET( anchor_offset ); + + if ( valid->extra2 ) + { + OTV_SIZE_CHECK( anchor_offset ); + if ( anchor_offset ) + otv_Anchor_validate( table + anchor_offset, valid ); + } + else + otv_Anchor_validate( table + anchor_offset, valid ); + } + + OTV_EXIT; + } + + +#define MarkBasePosFormat1Func otv_u_O_O_u_O_O +#define MarkLigPosFormat1Func otv_u_O_O_u_O_O +#define MarkMarkPosFormat1Func otv_u_O_O_u_O_O + + /* sets valid->extra1 (class count) */ + + static void + otv_u_O_O_u_O_O( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt Coverage1, Coverage2, ClassCount; + FT_UInt Array1, Array2; + OTV_Validate_Func func; + + + OTV_ENTER; + + p += 2; /* skip PosFormat */ + + OTV_LIMIT_CHECK( 10 ); + Coverage1 = FT_NEXT_USHORT( p ); + Coverage2 = FT_NEXT_USHORT( p ); + ClassCount = FT_NEXT_USHORT( p ); + Array1 = FT_NEXT_USHORT( p ); + Array2 = FT_NEXT_USHORT( p ); + + otv_Coverage_validate( table + Coverage1, valid ); + otv_Coverage_validate( table + Coverage2, valid ); + + otv_MarkArray_validate( table + Array1, valid ); + + valid->nesting_level++; + func = valid->func[valid->nesting_level]; + valid->extra1 = ClassCount; + + func( table + Array2, valid ); + + valid->nesting_level--; + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** VALUE RECORDS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static FT_UInt + otv_value_length( FT_UInt format ) + { + FT_UInt count; + + + count = ( ( format & 0xAA ) >> 1 ) + ( format & 0x55 ); + count = ( ( count & 0xCC ) >> 2 ) + ( count & 0x33 ); + count = ( ( count & 0xF0 ) >> 4 ) + ( count & 0x0F ); + + return count * 2; + } + + + /* uses valid->extra3 (pointer to base table) */ + + static void + otv_ValueRecord_validate( FT_Bytes table, + FT_UInt format, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt count; + +#ifdef FT_DEBUG_LEVEL_TRACE + FT_Int loop; + FT_ULong res = 0; + + + OTV_NAME_ENTER( "ValueRecord" ); + + /* display `format' in dual representation */ + for ( loop = 7; loop >= 0; loop-- ) + { + res <<= 4; + res += ( format >> loop ) & 1; + } + + OTV_TRACE(( " (format 0b%08lx)\n", res )); +#endif + + if ( format >= 0x100 ) + FT_INVALID_DATA; + + for ( count = 4; count > 0; count-- ) + { + if ( format & 1 ) + { + /* XPlacement, YPlacement, XAdvance, YAdvance */ + OTV_LIMIT_CHECK( 2 ); + p += 2; + } + + format >>= 1; + } + + for ( count = 4; count > 0; count-- ) + { + if ( format & 1 ) + { + FT_UInt table_size; + + OTV_OPTIONAL_TABLE( device ); + + + /* XPlaDevice, YPlaDevice, XAdvDevice, YAdvDevice */ + OTV_LIMIT_CHECK( 2 ); + OTV_OPTIONAL_OFFSET( device ); + + /* XXX: this value is usually too small, especially if the current */ + /* ValueRecord is part of an array -- getting the correct table */ + /* size is probably not worth the trouble */ + + table_size = p - valid->extra3; + + OTV_SIZE_CHECK( device ); + if ( device ) + otv_Device_validate( valid->extra3 + device, valid ); + } + format >>= 1; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** ANCHORS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + otv_Anchor_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt AnchorFormat; + + + OTV_NAME_ENTER( "Anchor"); + + OTV_LIMIT_CHECK( 6 ); + AnchorFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", AnchorFormat )); + + p += 4; /* skip XCoordinate and YCoordinate */ + + switch ( AnchorFormat ) + { + case 1: + break; + + case 2: + OTV_LIMIT_CHECK( 2 ); /* AnchorPoint */ + break; + + case 3: + { + FT_UInt table_size; + + OTV_OPTIONAL_TABLE( XDeviceTable ); + OTV_OPTIONAL_TABLE( YDeviceTable ); + + + OTV_LIMIT_CHECK( 4 ); + OTV_OPTIONAL_OFFSET( XDeviceTable ); + OTV_OPTIONAL_OFFSET( YDeviceTable ); + + table_size = 6 + 4; + + OTV_SIZE_CHECK( XDeviceTable ); + if ( XDeviceTable ) + otv_Device_validate( table + XDeviceTable, valid ); + + OTV_SIZE_CHECK( YDeviceTable ); + if ( YDeviceTable ) + otv_Device_validate( table + YDeviceTable, valid ); + } + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** MARK ARRAYS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + otv_MarkArray_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt MarkCount; + + + OTV_NAME_ENTER( "MarkArray" ); + + OTV_LIMIT_CHECK( 2 ); + MarkCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (MarkCount = %d)\n", MarkCount )); + + OTV_LIMIT_CHECK( MarkCount * 4 ); + + /* MarkRecord */ + for ( ; MarkCount > 0; MarkCount-- ) + { + p += 2; /* skip Class */ + /* MarkAnchor */ + otv_Anchor_validate( table + FT_NEXT_USHORT( p ), valid ); + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 1 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra3 (pointer to base table) */ + + static void + otv_SinglePos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "SinglePos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + valid->extra3 = table; + + switch ( PosFormat ) + { + case 1: /* SinglePosFormat1 */ + { + FT_UInt Coverage, ValueFormat; + + + OTV_LIMIT_CHECK( 4 ); + Coverage = FT_NEXT_USHORT( p ); + ValueFormat = FT_NEXT_USHORT( p ); + + otv_Coverage_validate( table + Coverage, valid ); + otv_ValueRecord_validate( p, ValueFormat, valid ); /* Value */ + } + break; + + case 2: /* SinglePosFormat2 */ + { + FT_UInt Coverage, ValueFormat, ValueCount, len_value; + + + OTV_LIMIT_CHECK( 6 ); + Coverage = FT_NEXT_USHORT( p ); + ValueFormat = FT_NEXT_USHORT( p ); + ValueCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (ValueCount = %d)\n", ValueCount )); + + len_value = otv_value_length( ValueFormat ); + + otv_Coverage_validate( table + Coverage, valid ); + + OTV_LIMIT_CHECK( ValueCount * len_value ); + + /* Value */ + for ( ; ValueCount > 0; ValueCount-- ) + { + otv_ValueRecord_validate( p, ValueFormat, valid ); + p += len_value; + } + } + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 2 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + otv_PairSet_validate( FT_Bytes table, + FT_UInt format1, + FT_UInt format2, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt value_len1, value_len2, PairValueCount; + + + OTV_NAME_ENTER( "PairSet" ); + + OTV_LIMIT_CHECK( 2 ); + PairValueCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (PairValueCount = %d)\n", PairValueCount )); + + value_len1 = otv_value_length( format1 ); + value_len2 = otv_value_length( format2 ); + + OTV_LIMIT_CHECK( PairValueCount * ( value_len1 + value_len2 + 2 ) ); + + /* PairValueRecord */ + for ( ; PairValueCount > 0; PairValueCount-- ) + { + p += 2; /* skip SecondGlyph */ + + if ( format1 ) + otv_ValueRecord_validate( p, format1, valid ); /* Value1 */ + p += value_len1; + + if ( format2 ) + otv_ValueRecord_validate( p, format2, valid ); /* Value2 */ + p += value_len2; + } + + OTV_EXIT; + } + + + /* sets valid->extra3 (pointer to base table) */ + + static void + otv_PairPos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "PairPos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + valid->extra3 = table; + + switch ( PosFormat ) + { + case 1: /* PairPosFormat1 */ + { + FT_UInt Coverage, ValueFormat1, ValueFormat2, PairSetCount; + + + OTV_LIMIT_CHECK( 8 ); + Coverage = FT_NEXT_USHORT( p ); + ValueFormat1 = FT_NEXT_USHORT( p ); + ValueFormat2 = FT_NEXT_USHORT( p ); + PairSetCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (PairSetCount = %d)\n", PairSetCount )); + + otv_Coverage_validate( table + Coverage, valid ); + + OTV_LIMIT_CHECK( PairSetCount * 2 ); + + /* PairSetOffset */ + for ( ; PairSetCount > 0; PairSetCount-- ) + otv_PairSet_validate( table + FT_NEXT_USHORT( p ), + ValueFormat1, ValueFormat2, valid ); + } + break; + + case 2: /* PairPosFormat2 */ + { + FT_UInt Coverage, ValueFormat1, ValueFormat2, ClassDef1, ClassDef2; + FT_UInt ClassCount1, ClassCount2, len_value1, len_value2, count; + + + OTV_LIMIT_CHECK( 14 ); + Coverage = FT_NEXT_USHORT( p ); + ValueFormat1 = FT_NEXT_USHORT( p ); + ValueFormat2 = FT_NEXT_USHORT( p ); + ClassDef1 = FT_NEXT_USHORT( p ); + ClassDef2 = FT_NEXT_USHORT( p ); + ClassCount1 = FT_NEXT_USHORT( p ); + ClassCount2 = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (ClassCount1 = %d)\n", ClassCount1 )); + OTV_TRACE(( " (ClassCount2 = %d)\n", ClassCount2 )); + + len_value1 = otv_value_length( ValueFormat1 ); + len_value2 = otv_value_length( ValueFormat2 ); + + otv_Coverage_validate( table + Coverage, valid ); + otv_ClassDef_validate( table + ClassDef1, valid ); + otv_ClassDef_validate( table + ClassDef2, valid ); + + OTV_LIMIT_CHECK( ClassCount1 * ClassCount2 * + ( len_value1 + len_value2 ) ); + + /* Class1Record */ + for ( ; ClassCount1 > 0; ClassCount1-- ) + { + /* Class2Record */ + for ( count = ClassCount2; count > 0; count-- ) + { + if ( ValueFormat1 ) + /* Value1 */ + otv_ValueRecord_validate( p, ValueFormat1, valid ); + p += len_value1; + + if ( ValueFormat2 ) + /* Value2 */ + otv_ValueRecord_validate( p, ValueFormat2, valid ); + p += len_value2; + } + } + } + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 3 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + otv_CursivePos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "CursivePos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + switch ( PosFormat ) + { + case 1: /* CursivePosFormat1 */ + { + FT_UInt table_size; + FT_UInt Coverage, EntryExitCount; + + OTV_OPTIONAL_TABLE( EntryAnchor ); + OTV_OPTIONAL_TABLE( ExitAnchor ); + + + OTV_LIMIT_CHECK( 4 ); + Coverage = FT_NEXT_USHORT( p ); + EntryExitCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (EntryExitCount = %d)\n", EntryExitCount )); + + otv_Coverage_validate( table + Coverage, valid ); + + OTV_LIMIT_CHECK( EntryExitCount * 4 ); + + table_size = EntryExitCount * 4 + 4; + + /* EntryExitRecord */ + for ( ; EntryExitCount > 0; EntryExitCount-- ) + { + OTV_OPTIONAL_OFFSET( EntryAnchor ); + OTV_OPTIONAL_OFFSET( ExitAnchor ); + + OTV_SIZE_CHECK( EntryAnchor ); + if ( EntryAnchor ) + otv_Anchor_validate( table + EntryAnchor, valid ); + + OTV_SIZE_CHECK( ExitAnchor ); + if ( ExitAnchor ) + otv_Anchor_validate( table + ExitAnchor, valid ); + } + } + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 4 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra2 (0) */ + + static void + otv_MarkBasePos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "MarkBasePos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + switch ( PosFormat ) + { + case 1: + valid->extra2 = 0; + OTV_NEST2( MarkBasePosFormat1, BaseArray ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 5 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra2 (1) */ + + static void + otv_MarkLigPos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "MarkLigPos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + switch ( PosFormat ) + { + case 1: + valid->extra2 = 1; + OTV_NEST3( MarkLigPosFormat1, LigatureArray, LigatureAttach ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 6 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra2 (0) */ + + static void + otv_MarkMarkPos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "MarkMarkPos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + switch ( PosFormat ) + { + case 1: + valid->extra2 = 0; + OTV_NEST2( MarkMarkPosFormat1, Mark2Array ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 7 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra1 (lookup count) */ + + static void + otv_ContextPos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "ContextPos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + switch ( PosFormat ) + { + case 1: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + valid->extra1 = valid->lookup_count; + OTV_NEST3( ContextPosFormat1, PosRuleSet, PosRule ); + OTV_RUN( table, valid ); + break; + + case 2: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + OTV_NEST3( ContextPosFormat2, PosClassSet, PosClassRule ); + OTV_RUN( table, valid ); + break; + + case 3: + OTV_NEST1( ContextPosFormat3 ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 8 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra1 (lookup count) */ + + static void + otv_ChainContextPos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "ChainContextPos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + switch ( PosFormat ) + { + case 1: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + valid->extra1 = valid->lookup_count; + OTV_NEST3( ChainContextPosFormat1, + ChainPosRuleSet, ChainPosRule ); + OTV_RUN( table, valid ); + break; + + case 2: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + OTV_NEST3( ChainContextPosFormat2, + ChainPosClassSet, ChainPosClassRule ); + OTV_RUN( table, valid ); + break; + + case 3: + OTV_NEST1( ChainContextPosFormat3 ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS LOOKUP TYPE 9 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* uses valid->type_funcs */ + + static void + otv_ExtensionPos_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt PosFormat; + + + OTV_NAME_ENTER( "ExtensionPos" ); + + OTV_LIMIT_CHECK( 2 ); + PosFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", PosFormat )); + + switch ( PosFormat ) + { + case 1: /* ExtensionPosFormat1 */ + { + FT_UInt ExtensionLookupType, ExtensionOffset; + OTV_Validate_Func validate; + + + OTV_LIMIT_CHECK( 6 ); + ExtensionLookupType = FT_NEXT_USHORT( p ); + ExtensionOffset = FT_NEXT_ULONG( p ); + + if ( ExtensionLookupType == 0 || ExtensionLookupType >= 9 ) + FT_INVALID_DATA; + + validate = valid->type_funcs[ExtensionLookupType - 1]; + validate( table + ExtensionOffset, valid ); + } + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + static const OTV_Validate_Func otv_gpos_validate_funcs[9] = + { + otv_SinglePos_validate, + otv_PairPos_validate, + otv_CursivePos_validate, + otv_MarkBasePos_validate, + otv_MarkLigPos_validate, + otv_MarkMarkPos_validate, + otv_ContextPos_validate, + otv_ChainContextPos_validate, + otv_ExtensionPos_validate + }; + + + /* sets valid->type_count */ + /* sets valid->type_funcs */ + + FT_LOCAL_DEF( void ) + otv_GPOS_subtable_validate( FT_Bytes table, + OTV_Validator valid ) + { + valid->type_count = 9; + valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; + + otv_Lookup_validate( table, valid ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GPOS TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->glyph_count */ + + FT_LOCAL_DEF( void ) + otv_GPOS_validate( FT_Bytes table, + FT_UInt glyph_count, + FT_Validator ftvalid ) + { + OTV_ValidatorRec validrec; + OTV_Validator valid = &validrec; + FT_Bytes p = table; + FT_UInt ScriptList, FeatureList, LookupList; + + + valid->root = ftvalid; + + FT_TRACE3(( "validating GPOS table\n" )); + OTV_INIT; + + OTV_LIMIT_CHECK( 10 ); + + if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ + FT_INVALID_DATA; + + ScriptList = FT_NEXT_USHORT( p ); + FeatureList = FT_NEXT_USHORT( p ); + LookupList = FT_NEXT_USHORT( p ); + + valid->type_count = 9; + valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; + valid->glyph_count = glyph_count; + + otv_LookupList_validate( table + LookupList, + valid ); + otv_FeatureList_validate( table + FeatureList, table + LookupList, + valid ); + otv_ScriptList_validate( table + ScriptList, table + FeatureList, + valid ); + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.h b/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.h index 14ca408261d..a2a1b99042e 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.h +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvgpos.h @@ -1,36 +1,36 @@ -/***************************************************************************/ -/* */ -/* otvgpos.h */ -/* */ -/* OpenType GPOS table validator (specification). */ -/* */ -/* Copyright 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __OTVGPOS_H__ -#define __OTVGPOS_H__ - - -FT_BEGIN_HEADER - - - FT_LOCAL( void ) - otv_GPOS_subtable_validate( FT_Bytes table, - OTV_Validator valid ); - - -FT_END_HEADER - -#endif /* __OTVGPOS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* otvgpos.h */ +/* */ +/* OpenType GPOS table validator (specification). */ +/* */ +/* Copyright 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __OTVGPOS_H__ +#define __OTVGPOS_H__ + + +FT_BEGIN_HEADER + + + FT_LOCAL( void ) + otv_GPOS_subtable_validate( FT_Bytes table, + OTV_Validator valid ); + + +FT_END_HEADER + +#endif /* __OTVGPOS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvgsub.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvgsub.c index 91dae0bb161..b57c61a65ae 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvgsub.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvgsub.c @@ -1,584 +1,584 @@ -/***************************************************************************/ -/* */ -/* otvgsub.c */ -/* */ -/* OpenType GSUB table validation (body). */ -/* */ -/* Copyright 2004, 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "otvalid.h" -#include "otvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_otvgsub - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 1 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* uses valid->glyph_count */ - - static void - otv_SingleSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt SubstFormat; - - - OTV_NAME_ENTER( "SingleSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: /* SingleSubstFormat1 */ - { - FT_Bytes Coverage; - FT_Int DeltaGlyphID; - FT_Long idx; - - - OTV_LIMIT_CHECK( 4 ); - Coverage = table + FT_NEXT_USHORT( p ); - DeltaGlyphID = FT_NEXT_SHORT( p ); - - otv_Coverage_validate( Coverage, valid ); - - idx = otv_Coverage_get_first( Coverage ) + DeltaGlyphID; - if ( idx < 0 ) - FT_INVALID_DATA; - - idx = otv_Coverage_get_last( Coverage ) + DeltaGlyphID; - if ( (FT_UInt)idx >= valid->glyph_count ) - FT_INVALID_DATA; - } - break; - - case 2: /* SingleSubstFormat2 */ - { - FT_UInt Coverage, GlyphCount; - - - OTV_LIMIT_CHECK( 4 ); - Coverage = FT_NEXT_USHORT( p ); - GlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - - otv_Coverage_validate( table + Coverage, valid ); - - OTV_LIMIT_CHECK( GlyphCount * 2 ); - - /* Substitute */ - for ( ; GlyphCount > 0; GlyphCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->glyph_count ) - FT_INVALID_DATA; - } - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 2 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra1 (glyph count) */ - - static void - otv_MultipleSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt SubstFormat; - - - OTV_NAME_ENTER( "MultipleSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: - valid->extra1 = valid->glyph_count; - OTV_NEST2( MultipleSubstFormat1, Sequence ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 3 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra1 (glyph count) */ - - static void - otv_AlternateSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt SubstFormat; - - - OTV_NAME_ENTER( "AlternateSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: - valid->extra1 = valid->glyph_count; - OTV_NEST2( AlternateSubstFormat1, AlternateSet ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 4 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#define LigatureFunc otv_Ligature_validate - - /* uses valid->glyph_count */ - - static void - otv_Ligature_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt LigatureGlyph, CompCount; - - - OTV_ENTER; - - OTV_LIMIT_CHECK( 4 ); - LigatureGlyph = FT_NEXT_USHORT( p ); - if ( LigatureGlyph >= valid->glyph_count ) - FT_INVALID_DATA; - - CompCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (CompCount = %d)\n", CompCount )); - - if ( CompCount == 0 ) - FT_INVALID_DATA; - - CompCount--; - - OTV_LIMIT_CHECK( CompCount * 2 ); /* Component */ - - /* no need to check the Component glyph indices */ - - OTV_EXIT; - } - - - static void - otv_LigatureSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt SubstFormat; - - - OTV_NAME_ENTER( "LigatureSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: - OTV_NEST3( LigatureSubstFormat1, LigatureSet, Ligature ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 5 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra1 (lookup count) */ - - static void - otv_ContextSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt SubstFormat; - - - OTV_NAME_ENTER( "ContextSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - valid->extra1 = valid->lookup_count; - OTV_NEST3( ContextSubstFormat1, SubRuleSet, SubRule ); - OTV_RUN( table, valid ); - break; - - case 2: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - OTV_NEST3( ContextSubstFormat2, SubClassSet, SubClassRule ); - OTV_RUN( table, valid ); - break; - - case 3: - OTV_NEST1( ContextSubstFormat3 ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 6 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->extra1 (lookup count) */ - - static void - otv_ChainContextSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt SubstFormat; - - - OTV_NAME_ENTER( "ChainContextSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - valid->extra1 = valid->lookup_count; - OTV_NEST3( ChainContextSubstFormat1, - ChainSubRuleSet, ChainSubRule ); - OTV_RUN( table, valid ); - break; - - case 2: - /* no need to check glyph indices/classes used as input for these */ - /* context rules since even invalid glyph indices/classes return */ - /* meaningful results */ - - OTV_NEST3( ChainContextSubstFormat2, - ChainSubClassSet, ChainSubClassRule ); - OTV_RUN( table, valid ); - break; - - case 3: - OTV_NEST1( ChainContextSubstFormat3 ); - OTV_RUN( table, valid ); - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 7 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* uses valid->type_funcs */ - - static void - otv_ExtensionSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt SubstFormat; - - - OTV_NAME_ENTER( "ExtensionSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: /* ExtensionSubstFormat1 */ - { - FT_UInt ExtensionLookupType, ExtensionOffset; - OTV_Validate_Func validate; - - - OTV_LIMIT_CHECK( 6 ); - ExtensionLookupType = FT_NEXT_USHORT( p ); - ExtensionOffset = FT_NEXT_ULONG( p ); - - if ( ExtensionLookupType == 0 || - ExtensionLookupType == 7 || - ExtensionLookupType > 8 ) - FT_INVALID_DATA; - - validate = valid->type_funcs[ExtensionLookupType - 1]; - validate( table + ExtensionOffset, valid ); - } - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB LOOKUP TYPE 8 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* uses valid->glyph_count */ - - static void - otv_ReverseChainSingleSubst_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table, Coverage; - FT_UInt SubstFormat; - FT_UInt BacktrackGlyphCount, LookaheadGlyphCount, GlyphCount; - - - OTV_NAME_ENTER( "ReverseChainSingleSubst" ); - - OTV_LIMIT_CHECK( 2 ); - SubstFormat = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (format %d)\n", SubstFormat )); - - switch ( SubstFormat ) - { - case 1: /* ReverseChainSingleSubstFormat1 */ - OTV_LIMIT_CHECK( 4 ); - Coverage = table + FT_NEXT_USHORT( p ); - BacktrackGlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount )); - - otv_Coverage_validate( Coverage, valid ); - - OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 ); - - for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); - - LookaheadGlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount )); - - OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); - - for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); - - GlyphCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - - if ( GlyphCount != otv_Coverage_get_count( Coverage ) ) - FT_INVALID_DATA; - - OTV_LIMIT_CHECK( GlyphCount * 2 ); - - /* Substitute */ - for ( ; GlyphCount > 0; GlyphCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->glyph_count ) - FT_INVALID_DATA; - - break; - - default: - FT_INVALID_DATA; - } - - OTV_EXIT; - } - - - static const OTV_Validate_Func otv_gsub_validate_funcs[8] = - { - otv_SingleSubst_validate, - otv_MultipleSubst_validate, - otv_AlternateSubst_validate, - otv_LigatureSubst_validate, - otv_ContextSubst_validate, - otv_ChainContextSubst_validate, - otv_ExtensionSubst_validate, - otv_ReverseChainSingleSubst_validate - }; - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GSUB TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* sets valid->type_count */ - /* sets valid->type_funcs */ - /* sets valid->glyph_count */ - - FT_LOCAL_DEF( void ) - otv_GSUB_validate( FT_Bytes table, - FT_UInt glyph_count, - FT_Validator ftvalid ) - { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; - FT_UInt ScriptList, FeatureList, LookupList; - - - valid->root = ftvalid; - - FT_TRACE3(( "validating GSUB table\n" )); - OTV_INIT; - - OTV_LIMIT_CHECK( 10 ); - - if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ - FT_INVALID_DATA; - - ScriptList = FT_NEXT_USHORT( p ); - FeatureList = FT_NEXT_USHORT( p ); - LookupList = FT_NEXT_USHORT( p ); - - valid->type_count = 8; - valid->type_funcs = (OTV_Validate_Func*)otv_gsub_validate_funcs; - valid->glyph_count = glyph_count; - - otv_LookupList_validate( table + LookupList, - valid ); - otv_FeatureList_validate( table + FeatureList, table + LookupList, - valid ); - otv_ScriptList_validate( table + ScriptList, table + FeatureList, - valid ); - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* otvgsub.c */ +/* */ +/* OpenType GSUB table validation (body). */ +/* */ +/* Copyright 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "otvalid.h" +#include "otvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_otvgsub + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 1 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* uses valid->glyph_count */ + + static void + otv_SingleSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt SubstFormat; + + + OTV_NAME_ENTER( "SingleSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: /* SingleSubstFormat1 */ + { + FT_Bytes Coverage; + FT_Int DeltaGlyphID; + FT_Long idx; + + + OTV_LIMIT_CHECK( 4 ); + Coverage = table + FT_NEXT_USHORT( p ); + DeltaGlyphID = FT_NEXT_SHORT( p ); + + otv_Coverage_validate( Coverage, valid ); + + idx = otv_Coverage_get_first( Coverage ) + DeltaGlyphID; + if ( idx < 0 ) + FT_INVALID_DATA; + + idx = otv_Coverage_get_last( Coverage ) + DeltaGlyphID; + if ( (FT_UInt)idx >= valid->glyph_count ) + FT_INVALID_DATA; + } + break; + + case 2: /* SingleSubstFormat2 */ + { + FT_UInt Coverage, GlyphCount; + + + OTV_LIMIT_CHECK( 4 ); + Coverage = FT_NEXT_USHORT( p ); + GlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + + otv_Coverage_validate( table + Coverage, valid ); + + OTV_LIMIT_CHECK( GlyphCount * 2 ); + + /* Substitute */ + for ( ; GlyphCount > 0; GlyphCount-- ) + if ( FT_NEXT_USHORT( p ) >= valid->glyph_count ) + FT_INVALID_DATA; + } + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 2 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra1 (glyph count) */ + + static void + otv_MultipleSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt SubstFormat; + + + OTV_NAME_ENTER( "MultipleSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: + valid->extra1 = valid->glyph_count; + OTV_NEST2( MultipleSubstFormat1, Sequence ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 3 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra1 (glyph count) */ + + static void + otv_AlternateSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt SubstFormat; + + + OTV_NAME_ENTER( "AlternateSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: + valid->extra1 = valid->glyph_count; + OTV_NEST2( AlternateSubstFormat1, AlternateSet ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 4 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define LigatureFunc otv_Ligature_validate + + /* uses valid->glyph_count */ + + static void + otv_Ligature_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt LigatureGlyph, CompCount; + + + OTV_ENTER; + + OTV_LIMIT_CHECK( 4 ); + LigatureGlyph = FT_NEXT_USHORT( p ); + if ( LigatureGlyph >= valid->glyph_count ) + FT_INVALID_DATA; + + CompCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (CompCount = %d)\n", CompCount )); + + if ( CompCount == 0 ) + FT_INVALID_DATA; + + CompCount--; + + OTV_LIMIT_CHECK( CompCount * 2 ); /* Component */ + + /* no need to check the Component glyph indices */ + + OTV_EXIT; + } + + + static void + otv_LigatureSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt SubstFormat; + + + OTV_NAME_ENTER( "LigatureSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: + OTV_NEST3( LigatureSubstFormat1, LigatureSet, Ligature ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 5 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra1 (lookup count) */ + + static void + otv_ContextSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt SubstFormat; + + + OTV_NAME_ENTER( "ContextSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + valid->extra1 = valid->lookup_count; + OTV_NEST3( ContextSubstFormat1, SubRuleSet, SubRule ); + OTV_RUN( table, valid ); + break; + + case 2: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + OTV_NEST3( ContextSubstFormat2, SubClassSet, SubClassRule ); + OTV_RUN( table, valid ); + break; + + case 3: + OTV_NEST1( ContextSubstFormat3 ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 6 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->extra1 (lookup count) */ + + static void + otv_ChainContextSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt SubstFormat; + + + OTV_NAME_ENTER( "ChainContextSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + valid->extra1 = valid->lookup_count; + OTV_NEST3( ChainContextSubstFormat1, + ChainSubRuleSet, ChainSubRule ); + OTV_RUN( table, valid ); + break; + + case 2: + /* no need to check glyph indices/classes used as input for these */ + /* context rules since even invalid glyph indices/classes return */ + /* meaningful results */ + + OTV_NEST3( ChainContextSubstFormat2, + ChainSubClassSet, ChainSubClassRule ); + OTV_RUN( table, valid ); + break; + + case 3: + OTV_NEST1( ChainContextSubstFormat3 ); + OTV_RUN( table, valid ); + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 7 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* uses valid->type_funcs */ + + static void + otv_ExtensionSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt SubstFormat; + + + OTV_NAME_ENTER( "ExtensionSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: /* ExtensionSubstFormat1 */ + { + FT_UInt ExtensionLookupType, ExtensionOffset; + OTV_Validate_Func validate; + + + OTV_LIMIT_CHECK( 6 ); + ExtensionLookupType = FT_NEXT_USHORT( p ); + ExtensionOffset = FT_NEXT_ULONG( p ); + + if ( ExtensionLookupType == 0 || + ExtensionLookupType == 7 || + ExtensionLookupType > 8 ) + FT_INVALID_DATA; + + validate = valid->type_funcs[ExtensionLookupType - 1]; + validate( table + ExtensionOffset, valid ); + } + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB LOOKUP TYPE 8 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* uses valid->glyph_count */ + + static void + otv_ReverseChainSingleSubst_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table, Coverage; + FT_UInt SubstFormat; + FT_UInt BacktrackGlyphCount, LookaheadGlyphCount, GlyphCount; + + + OTV_NAME_ENTER( "ReverseChainSingleSubst" ); + + OTV_LIMIT_CHECK( 2 ); + SubstFormat = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (format %d)\n", SubstFormat )); + + switch ( SubstFormat ) + { + case 1: /* ReverseChainSingleSubstFormat1 */ + OTV_LIMIT_CHECK( 4 ); + Coverage = table + FT_NEXT_USHORT( p ); + BacktrackGlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount )); + + otv_Coverage_validate( Coverage, valid ); + + OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 ); + + for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- ) + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); + + LookaheadGlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (LookaheadGlyphCount = %d)\n", LookaheadGlyphCount )); + + OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); + + for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- ) + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid ); + + GlyphCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); + + if ( GlyphCount != otv_Coverage_get_count( Coverage ) ) + FT_INVALID_DATA; + + OTV_LIMIT_CHECK( GlyphCount * 2 ); + + /* Substitute */ + for ( ; GlyphCount > 0; GlyphCount-- ) + if ( FT_NEXT_USHORT( p ) >= valid->glyph_count ) + FT_INVALID_DATA; + + break; + + default: + FT_INVALID_DATA; + } + + OTV_EXIT; + } + + + static const OTV_Validate_Func otv_gsub_validate_funcs[8] = + { + otv_SingleSubst_validate, + otv_MultipleSubst_validate, + otv_AlternateSubst_validate, + otv_LigatureSubst_validate, + otv_ContextSubst_validate, + otv_ChainContextSubst_validate, + otv_ExtensionSubst_validate, + otv_ReverseChainSingleSubst_validate + }; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GSUB TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* sets valid->type_count */ + /* sets valid->type_funcs */ + /* sets valid->glyph_count */ + + FT_LOCAL_DEF( void ) + otv_GSUB_validate( FT_Bytes table, + FT_UInt glyph_count, + FT_Validator ftvalid ) + { + OTV_ValidatorRec validrec; + OTV_Validator valid = &validrec; + FT_Bytes p = table; + FT_UInt ScriptList, FeatureList, LookupList; + + + valid->root = ftvalid; + + FT_TRACE3(( "validating GSUB table\n" )); + OTV_INIT; + + OTV_LIMIT_CHECK( 10 ); + + if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ + FT_INVALID_DATA; + + ScriptList = FT_NEXT_USHORT( p ); + FeatureList = FT_NEXT_USHORT( p ); + LookupList = FT_NEXT_USHORT( p ); + + valid->type_count = 8; + valid->type_funcs = (OTV_Validate_Func*)otv_gsub_validate_funcs; + valid->glyph_count = glyph_count; + + otv_LookupList_validate( table + LookupList, + valid ); + otv_FeatureList_validate( table + FeatureList, table + LookupList, + valid ); + otv_ScriptList_validate( table + ScriptList, table + FeatureList, + valid ); + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvjstf.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvjstf.c index 80b8dd66043..bdf5e8a3eb3 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvjstf.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvjstf.c @@ -1,258 +1,258 @@ -/***************************************************************************/ -/* */ -/* otvjstf.c */ -/* */ -/* OpenType JSTF table validation (body). */ -/* */ -/* Copyright 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "otvalid.h" -#include "otvcommn.h" -#include "otvgpos.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_otvjstf - - -#define JstfPriorityFunc otv_JstfPriority_validate -#define JstfLookupFunc otv_GPOS_subtable_validate - - /* uses valid->extra1 (GSUB lookup count) */ - /* uses valid->extra2 (GPOS lookup count) */ - /* sets valid->extra1 (counter) */ - - static void - otv_JstfPriority_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt table_size; - FT_UInt gsub_lookup_count, gpos_lookup_count; - - OTV_OPTIONAL_TABLE( ShrinkageEnableGSUB ); - OTV_OPTIONAL_TABLE( ShrinkageDisableGSUB ); - OTV_OPTIONAL_TABLE( ShrinkageEnableGPOS ); - OTV_OPTIONAL_TABLE( ShrinkageDisableGPOS ); - OTV_OPTIONAL_TABLE( ExtensionEnableGSUB ); - OTV_OPTIONAL_TABLE( ExtensionDisableGSUB ); - OTV_OPTIONAL_TABLE( ExtensionEnableGPOS ); - OTV_OPTIONAL_TABLE( ExtensionDisableGPOS ); - OTV_OPTIONAL_TABLE( ShrinkageJstfMax ); - OTV_OPTIONAL_TABLE( ExtensionJstfMax ); - - - OTV_ENTER; - OTV_TRACE(( "JstfPriority table\n" )); - - OTV_LIMIT_CHECK( 20 ); - - gsub_lookup_count = valid->extra1; - gpos_lookup_count = valid->extra2; - - table_size = 20; - - valid->extra1 = gsub_lookup_count; - - OTV_OPTIONAL_OFFSET( ShrinkageEnableGSUB ); - OTV_SIZE_CHECK( ShrinkageEnableGSUB ); - if ( ShrinkageEnableGSUB ) - otv_x_ux( table + ShrinkageEnableGSUB, valid ); - - OTV_OPTIONAL_OFFSET( ShrinkageDisableGSUB ); - OTV_SIZE_CHECK( ShrinkageDisableGSUB ); - if ( ShrinkageDisableGSUB ) - otv_x_ux( table + ShrinkageDisableGSUB, valid ); - - valid->extra1 = gpos_lookup_count; - - OTV_OPTIONAL_OFFSET( ShrinkageEnableGPOS ); - OTV_SIZE_CHECK( ShrinkageEnableGPOS ); - if ( ShrinkageEnableGPOS ) - otv_x_ux( table + ShrinkageEnableGPOS, valid ); - - OTV_OPTIONAL_OFFSET( ShrinkageDisableGPOS ); - OTV_SIZE_CHECK( ShrinkageDisableGPOS ); - if ( ShrinkageDisableGPOS ) - otv_x_ux( table + ShrinkageDisableGPOS, valid ); - - OTV_OPTIONAL_OFFSET( ShrinkageJstfMax ); - OTV_SIZE_CHECK( ShrinkageJstfMax ); - if ( ShrinkageJstfMax ) - { - /* XXX: check lookup types? */ - OTV_NEST2( JstfMax, JstfLookup ); - OTV_RUN( table + ShrinkageJstfMax, valid ); - } - - valid->extra1 = gsub_lookup_count; - - OTV_OPTIONAL_OFFSET( ExtensionEnableGSUB ); - OTV_SIZE_CHECK( ExtensionEnableGSUB ); - if ( ExtensionEnableGSUB ) - otv_x_ux( table + ExtensionEnableGSUB, valid ); - - OTV_OPTIONAL_OFFSET( ExtensionDisableGSUB ); - OTV_SIZE_CHECK( ExtensionDisableGSUB ); - if ( ExtensionDisableGSUB ) - otv_x_ux( table + ExtensionDisableGSUB, valid ); - - valid->extra1 = gpos_lookup_count; - - OTV_OPTIONAL_OFFSET( ExtensionEnableGPOS ); - OTV_SIZE_CHECK( ExtensionEnableGPOS ); - if ( ExtensionEnableGPOS ) - otv_x_ux( table + ExtensionEnableGPOS, valid ); - - OTV_OPTIONAL_OFFSET( ExtensionDisableGPOS ); - OTV_SIZE_CHECK( ExtensionDisableGPOS ); - if ( ExtensionDisableGPOS ) - otv_x_ux( table + ExtensionDisableGPOS, valid ); - - OTV_OPTIONAL_OFFSET( ExtensionJstfMax ); - OTV_SIZE_CHECK( ExtensionJstfMax ); - if ( ExtensionJstfMax ) - { - /* XXX: check lookup types? */ - OTV_NEST2( JstfMax, JstfLookup ); - OTV_RUN( table + ExtensionJstfMax, valid ); - } - - valid->extra1 = gsub_lookup_count; - valid->extra2 = gpos_lookup_count; - - OTV_EXIT; - } - - - /* sets valid->extra (glyph count) */ - /* sets valid->func1 (otv_JstfPriority_validate) */ - - static void - otv_JstfScript_validate( FT_Bytes table, - OTV_Validator valid ) - { - FT_Bytes p = table; - FT_UInt table_size; - FT_UInt JstfLangSysCount; - - OTV_OPTIONAL_TABLE( ExtGlyph ); - OTV_OPTIONAL_TABLE( DefJstfLangSys ); - - - OTV_NAME_ENTER( "JstfScript" ); - - OTV_LIMIT_CHECK( 6 ); - OTV_OPTIONAL_OFFSET( ExtGlyph ); - OTV_OPTIONAL_OFFSET( DefJstfLangSys ); - JstfLangSysCount = FT_NEXT_USHORT( p ); - - OTV_TRACE(( " (JstfLangSysCount = %d)\n", JstfLangSysCount )); - - table_size = JstfLangSysCount * 6 + 6; - - OTV_SIZE_CHECK( ExtGlyph ); - if ( ExtGlyph ) - { - valid->extra1 = valid->glyph_count; - OTV_NEST1( ExtenderGlyph ); - OTV_RUN( table + ExtGlyph, valid ); - } - - OTV_SIZE_CHECK( DefJstfLangSys ); - if ( DefJstfLangSys ) - { - OTV_NEST2( JstfLangSys, JstfPriority ); - OTV_RUN( table + DefJstfLangSys, valid ); - } - - OTV_LIMIT_CHECK( 6 * JstfLangSysCount ); - - /* JstfLangSysRecord */ - OTV_NEST2( JstfLangSys, JstfPriority ); - for ( ; JstfLangSysCount > 0; JstfLangSysCount-- ) - { - p += 4; /* skip JstfLangSysTag */ - - OTV_RUN( table + FT_NEXT_USHORT( p ), valid ); - } - - OTV_EXIT; - } - - - /* sets valid->extra1 (GSUB lookup count) */ - /* sets valid->extra2 (GPOS lookup count) */ - /* sets valid->glyph_count */ - - FT_LOCAL_DEF( void ) - otv_JSTF_validate( FT_Bytes table, - FT_Bytes gsub, - FT_Bytes gpos, - FT_UInt glyph_count, - FT_Validator ftvalid ) - { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; - FT_UInt JstfScriptCount; - - - valid->root = ftvalid; - - FT_TRACE3(( "validating JSTF table\n" )); - OTV_INIT; - - OTV_LIMIT_CHECK( 6 ); - - if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ - FT_INVALID_DATA; - - JstfScriptCount = FT_NEXT_USHORT( p ); - - FT_TRACE3(( " (JstfScriptCount = %d)\n", JstfScriptCount )); - - OTV_LIMIT_CHECK( JstfScriptCount * 6 ); - - if ( gsub ) - valid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub ); - else - valid->extra1 = 0; - - if ( gpos ) - valid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos ); - else - valid->extra2 = 0; - - valid->glyph_count = glyph_count; - - /* JstfScriptRecord */ - for ( ; JstfScriptCount > 0; JstfScriptCount-- ) - { - p += 4; /* skip JstfScriptTag */ - - /* JstfScript */ - otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), valid ); - } - - FT_TRACE4(( "\n" )); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* otvjstf.c */ +/* */ +/* OpenType JSTF table validation (body). */ +/* */ +/* Copyright 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "otvalid.h" +#include "otvcommn.h" +#include "otvgpos.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_otvjstf + + +#define JstfPriorityFunc otv_JstfPriority_validate +#define JstfLookupFunc otv_GPOS_subtable_validate + + /* uses valid->extra1 (GSUB lookup count) */ + /* uses valid->extra2 (GPOS lookup count) */ + /* sets valid->extra1 (counter) */ + + static void + otv_JstfPriority_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt table_size; + FT_UInt gsub_lookup_count, gpos_lookup_count; + + OTV_OPTIONAL_TABLE( ShrinkageEnableGSUB ); + OTV_OPTIONAL_TABLE( ShrinkageDisableGSUB ); + OTV_OPTIONAL_TABLE( ShrinkageEnableGPOS ); + OTV_OPTIONAL_TABLE( ShrinkageDisableGPOS ); + OTV_OPTIONAL_TABLE( ExtensionEnableGSUB ); + OTV_OPTIONAL_TABLE( ExtensionDisableGSUB ); + OTV_OPTIONAL_TABLE( ExtensionEnableGPOS ); + OTV_OPTIONAL_TABLE( ExtensionDisableGPOS ); + OTV_OPTIONAL_TABLE( ShrinkageJstfMax ); + OTV_OPTIONAL_TABLE( ExtensionJstfMax ); + + + OTV_ENTER; + OTV_TRACE(( "JstfPriority table\n" )); + + OTV_LIMIT_CHECK( 20 ); + + gsub_lookup_count = valid->extra1; + gpos_lookup_count = valid->extra2; + + table_size = 20; + + valid->extra1 = gsub_lookup_count; + + OTV_OPTIONAL_OFFSET( ShrinkageEnableGSUB ); + OTV_SIZE_CHECK( ShrinkageEnableGSUB ); + if ( ShrinkageEnableGSUB ) + otv_x_ux( table + ShrinkageEnableGSUB, valid ); + + OTV_OPTIONAL_OFFSET( ShrinkageDisableGSUB ); + OTV_SIZE_CHECK( ShrinkageDisableGSUB ); + if ( ShrinkageDisableGSUB ) + otv_x_ux( table + ShrinkageDisableGSUB, valid ); + + valid->extra1 = gpos_lookup_count; + + OTV_OPTIONAL_OFFSET( ShrinkageEnableGPOS ); + OTV_SIZE_CHECK( ShrinkageEnableGPOS ); + if ( ShrinkageEnableGPOS ) + otv_x_ux( table + ShrinkageEnableGPOS, valid ); + + OTV_OPTIONAL_OFFSET( ShrinkageDisableGPOS ); + OTV_SIZE_CHECK( ShrinkageDisableGPOS ); + if ( ShrinkageDisableGPOS ) + otv_x_ux( table + ShrinkageDisableGPOS, valid ); + + OTV_OPTIONAL_OFFSET( ShrinkageJstfMax ); + OTV_SIZE_CHECK( ShrinkageJstfMax ); + if ( ShrinkageJstfMax ) + { + /* XXX: check lookup types? */ + OTV_NEST2( JstfMax, JstfLookup ); + OTV_RUN( table + ShrinkageJstfMax, valid ); + } + + valid->extra1 = gsub_lookup_count; + + OTV_OPTIONAL_OFFSET( ExtensionEnableGSUB ); + OTV_SIZE_CHECK( ExtensionEnableGSUB ); + if ( ExtensionEnableGSUB ) + otv_x_ux( table + ExtensionEnableGSUB, valid ); + + OTV_OPTIONAL_OFFSET( ExtensionDisableGSUB ); + OTV_SIZE_CHECK( ExtensionDisableGSUB ); + if ( ExtensionDisableGSUB ) + otv_x_ux( table + ExtensionDisableGSUB, valid ); + + valid->extra1 = gpos_lookup_count; + + OTV_OPTIONAL_OFFSET( ExtensionEnableGPOS ); + OTV_SIZE_CHECK( ExtensionEnableGPOS ); + if ( ExtensionEnableGPOS ) + otv_x_ux( table + ExtensionEnableGPOS, valid ); + + OTV_OPTIONAL_OFFSET( ExtensionDisableGPOS ); + OTV_SIZE_CHECK( ExtensionDisableGPOS ); + if ( ExtensionDisableGPOS ) + otv_x_ux( table + ExtensionDisableGPOS, valid ); + + OTV_OPTIONAL_OFFSET( ExtensionJstfMax ); + OTV_SIZE_CHECK( ExtensionJstfMax ); + if ( ExtensionJstfMax ) + { + /* XXX: check lookup types? */ + OTV_NEST2( JstfMax, JstfLookup ); + OTV_RUN( table + ExtensionJstfMax, valid ); + } + + valid->extra1 = gsub_lookup_count; + valid->extra2 = gpos_lookup_count; + + OTV_EXIT; + } + + + /* sets valid->extra (glyph count) */ + /* sets valid->func1 (otv_JstfPriority_validate) */ + + static void + otv_JstfScript_validate( FT_Bytes table, + OTV_Validator valid ) + { + FT_Bytes p = table; + FT_UInt table_size; + FT_UInt JstfLangSysCount; + + OTV_OPTIONAL_TABLE( ExtGlyph ); + OTV_OPTIONAL_TABLE( DefJstfLangSys ); + + + OTV_NAME_ENTER( "JstfScript" ); + + OTV_LIMIT_CHECK( 6 ); + OTV_OPTIONAL_OFFSET( ExtGlyph ); + OTV_OPTIONAL_OFFSET( DefJstfLangSys ); + JstfLangSysCount = FT_NEXT_USHORT( p ); + + OTV_TRACE(( " (JstfLangSysCount = %d)\n", JstfLangSysCount )); + + table_size = JstfLangSysCount * 6 + 6; + + OTV_SIZE_CHECK( ExtGlyph ); + if ( ExtGlyph ) + { + valid->extra1 = valid->glyph_count; + OTV_NEST1( ExtenderGlyph ); + OTV_RUN( table + ExtGlyph, valid ); + } + + OTV_SIZE_CHECK( DefJstfLangSys ); + if ( DefJstfLangSys ) + { + OTV_NEST2( JstfLangSys, JstfPriority ); + OTV_RUN( table + DefJstfLangSys, valid ); + } + + OTV_LIMIT_CHECK( 6 * JstfLangSysCount ); + + /* JstfLangSysRecord */ + OTV_NEST2( JstfLangSys, JstfPriority ); + for ( ; JstfLangSysCount > 0; JstfLangSysCount-- ) + { + p += 4; /* skip JstfLangSysTag */ + + OTV_RUN( table + FT_NEXT_USHORT( p ), valid ); + } + + OTV_EXIT; + } + + + /* sets valid->extra1 (GSUB lookup count) */ + /* sets valid->extra2 (GPOS lookup count) */ + /* sets valid->glyph_count */ + + FT_LOCAL_DEF( void ) + otv_JSTF_validate( FT_Bytes table, + FT_Bytes gsub, + FT_Bytes gpos, + FT_UInt glyph_count, + FT_Validator ftvalid ) + { + OTV_ValidatorRec validrec; + OTV_Validator valid = &validrec; + FT_Bytes p = table; + FT_UInt JstfScriptCount; + + + valid->root = ftvalid; + + FT_TRACE3(( "validating JSTF table\n" )); + OTV_INIT; + + OTV_LIMIT_CHECK( 6 ); + + if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */ + FT_INVALID_DATA; + + JstfScriptCount = FT_NEXT_USHORT( p ); + + FT_TRACE3(( " (JstfScriptCount = %d)\n", JstfScriptCount )); + + OTV_LIMIT_CHECK( JstfScriptCount * 6 ); + + if ( gsub ) + valid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub ); + else + valid->extra1 = 0; + + if ( gpos ) + valid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos ); + else + valid->extra2 = 0; + + valid->glyph_count = glyph_count; + + /* JstfScriptRecord */ + for ( ; JstfScriptCount > 0; JstfScriptCount-- ) + { + p += 4; /* skip JstfScriptTag */ + + /* JstfScript */ + otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), valid ); + } + + FT_TRACE4(( "\n" )); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.c b/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.c index 157272f1ae9..bd523e14e9c 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.c +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.c @@ -1,242 +1,242 @@ -/***************************************************************************/ -/* */ -/* otvmod.c */ -/* */ -/* FreeType's OpenType validation module implementation (body). */ -/* */ -/* Copyright 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_TRUETYPE_TABLES_H -#include FT_TRUETYPE_TAGS_H -#include FT_OPENTYPE_VALIDATE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_OPENTYPE_VALIDATE_H - -#include "otvmod.h" -#include "otvalid.h" -#include "otvcommn.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_otvmodule - - - static FT_Error - otv_load_table( FT_Face face, - FT_Tag tag, - FT_Byte* volatile* table, - FT_ULong* table_len ) - { - FT_Error error; - FT_Memory memory = FT_FACE_MEMORY( face ); - - - error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len ); - if ( error == OTV_Err_Table_Missing ) - return OTV_Err_Ok; - if ( error ) - goto Exit; - - if ( FT_ALLOC( *table, *table_len ) ) - goto Exit; - - error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len ); - - Exit: - return error; - } - - - static FT_Error - otv_validate( FT_Face volatile face, - FT_UInt ot_flags, - FT_Bytes *ot_base, - FT_Bytes *ot_gdef, - FT_Bytes *ot_gpos, - FT_Bytes *ot_gsub, - FT_Bytes *ot_jstf ) - { - FT_Error error = OTV_Err_Ok; - FT_Byte* volatile base; - FT_Byte* volatile gdef; - FT_Byte* volatile gpos; - FT_Byte* volatile gsub; - FT_Byte* volatile jstf; - FT_ULong len_base, len_gdef, len_gpos, len_gsub, len_jstf; - FT_ValidatorRec volatile valid; - - - base = gdef = gpos = gsub = jstf = NULL; - len_base = len_gdef = len_gpos = len_gsub = len_jstf = 0; - - /* load tables */ - - if ( ot_flags & FT_VALIDATE_BASE ) - { - error = otv_load_table( face, TTAG_BASE, &base, &len_base ); - if ( error ) - goto Exit; - } - - if ( ot_flags & FT_VALIDATE_GDEF ) - { - error = otv_load_table( face, TTAG_GDEF, &gdef, &len_gdef ); - if ( error ) - goto Exit; - } - - if ( ot_flags & FT_VALIDATE_GPOS ) - { - error = otv_load_table( face, TTAG_GPOS, &gpos, &len_gpos ); - if ( error ) - goto Exit; - } - - if ( ot_flags & FT_VALIDATE_GSUB ) - { - error = otv_load_table( face, TTAG_GSUB, &gsub, &len_gsub ); - if ( error ) - goto Exit; - } - - if ( ot_flags & FT_VALIDATE_JSTF ) - { - error = otv_load_table( face, TTAG_JSTF, &jstf, &len_jstf ); - if ( error ) - goto Exit; - } - - /* validate tables */ - - if ( base ) - { - ft_validator_init( &valid, base, base + len_base, FT_VALIDATE_DEFAULT ); - if ( ft_setjmp( valid.jump_buffer ) == 0 ) - otv_BASE_validate( base, &valid ); - error = valid.error; - if ( error ) - goto Exit; - } - - if ( gpos ) - { - ft_validator_init( &valid, gpos, gpos + len_gpos, FT_VALIDATE_DEFAULT ); - if ( ft_setjmp( valid.jump_buffer ) == 0 ) - otv_GPOS_validate( gpos, face->num_glyphs, &valid ); - error = valid.error; - if ( error ) - goto Exit; - } - - if ( gsub ) - { - ft_validator_init( &valid, gsub, gsub + len_gsub, FT_VALIDATE_DEFAULT ); - if ( ft_setjmp( valid.jump_buffer ) == 0 ) - otv_GSUB_validate( gsub, face->num_glyphs, &valid ); - error = valid.error; - if ( error ) - goto Exit; - } - - if ( gdef ) - { - ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT ); - if ( ft_setjmp( valid.jump_buffer ) == 0 ) - otv_GDEF_validate( gdef, gsub, gpos, &valid ); - error = valid.error; - if ( error ) - goto Exit; - } - - if ( jstf ) - { - ft_validator_init( &valid, jstf, jstf + len_jstf, FT_VALIDATE_DEFAULT ); - if ( ft_setjmp( valid.jump_buffer ) == 0 ) - otv_JSTF_validate( jstf, gsub, gpos, face->num_glyphs, &valid ); - error = valid.error; - if ( error ) - goto Exit; - } - - *ot_base = (FT_Bytes)base; - *ot_gdef = (FT_Bytes)gdef; - *ot_gpos = (FT_Bytes)gpos; - *ot_gsub = (FT_Bytes)gsub; - *ot_jstf = (FT_Bytes)jstf; - - Exit: - if ( error ) { - FT_Memory memory = FT_FACE_MEMORY( face ); - - - FT_FREE( base ); - FT_FREE( gdef ); - FT_FREE( gpos ); - FT_FREE( gsub ); - FT_FREE( jstf ); - } - - return error; - } - - - static - const FT_Service_OTvalidateRec otvalid_interface = - { - otv_validate - }; - - - static - const FT_ServiceDescRec otvalid_services[] = - { - { FT_SERVICE_ID_OPENTYPE_VALIDATE, &otvalid_interface }, - { NULL, NULL } - }; - - - static FT_Pointer - otvalid_get_service( FT_Module module, - const char* service_id ) - { - FT_UNUSED( module ); - - return ft_service_list_lookup( otvalid_services, service_id ); - } - - - FT_CALLBACK_TABLE_DEF - const FT_Module_Class otv_module_class = - { - 0, - sizeof( FT_ModuleRec ), - "otvalid", - 0x10000L, - 0x20000L, - - 0, /* module-specific interface */ - - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) otvalid_get_service - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* otvmod.c */ +/* */ +/* FreeType's OpenType validation module implementation (body). */ +/* */ +/* Copyright 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_TRUETYPE_TABLES_H +#include FT_TRUETYPE_TAGS_H +#include FT_OPENTYPE_VALIDATE_H +#include FT_INTERNAL_OBJECTS_H +#include FT_SERVICE_OPENTYPE_VALIDATE_H + +#include "otvmod.h" +#include "otvalid.h" +#include "otvcommn.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_otvmodule + + + static FT_Error + otv_load_table( FT_Face face, + FT_Tag tag, + FT_Byte* volatile* table, + FT_ULong* table_len ) + { + FT_Error error; + FT_Memory memory = FT_FACE_MEMORY( face ); + + + error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len ); + if ( error == OTV_Err_Table_Missing ) + return OTV_Err_Ok; + if ( error ) + goto Exit; + + if ( FT_ALLOC( *table, *table_len ) ) + goto Exit; + + error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len ); + + Exit: + return error; + } + + + static FT_Error + otv_validate( FT_Face volatile face, + FT_UInt ot_flags, + FT_Bytes *ot_base, + FT_Bytes *ot_gdef, + FT_Bytes *ot_gpos, + FT_Bytes *ot_gsub, + FT_Bytes *ot_jstf ) + { + FT_Error error = OTV_Err_Ok; + FT_Byte* volatile base; + FT_Byte* volatile gdef; + FT_Byte* volatile gpos; + FT_Byte* volatile gsub; + FT_Byte* volatile jstf; + FT_ULong len_base, len_gdef, len_gpos, len_gsub, len_jstf; + FT_ValidatorRec volatile valid; + + + base = gdef = gpos = gsub = jstf = NULL; + len_base = len_gdef = len_gpos = len_gsub = len_jstf = 0; + + /* load tables */ + + if ( ot_flags & FT_VALIDATE_BASE ) + { + error = otv_load_table( face, TTAG_BASE, &base, &len_base ); + if ( error ) + goto Exit; + } + + if ( ot_flags & FT_VALIDATE_GDEF ) + { + error = otv_load_table( face, TTAG_GDEF, &gdef, &len_gdef ); + if ( error ) + goto Exit; + } + + if ( ot_flags & FT_VALIDATE_GPOS ) + { + error = otv_load_table( face, TTAG_GPOS, &gpos, &len_gpos ); + if ( error ) + goto Exit; + } + + if ( ot_flags & FT_VALIDATE_GSUB ) + { + error = otv_load_table( face, TTAG_GSUB, &gsub, &len_gsub ); + if ( error ) + goto Exit; + } + + if ( ot_flags & FT_VALIDATE_JSTF ) + { + error = otv_load_table( face, TTAG_JSTF, &jstf, &len_jstf ); + if ( error ) + goto Exit; + } + + /* validate tables */ + + if ( base ) + { + ft_validator_init( &valid, base, base + len_base, FT_VALIDATE_DEFAULT ); + if ( ft_setjmp( valid.jump_buffer ) == 0 ) + otv_BASE_validate( base, &valid ); + error = valid.error; + if ( error ) + goto Exit; + } + + if ( gpos ) + { + ft_validator_init( &valid, gpos, gpos + len_gpos, FT_VALIDATE_DEFAULT ); + if ( ft_setjmp( valid.jump_buffer ) == 0 ) + otv_GPOS_validate( gpos, face->num_glyphs, &valid ); + error = valid.error; + if ( error ) + goto Exit; + } + + if ( gsub ) + { + ft_validator_init( &valid, gsub, gsub + len_gsub, FT_VALIDATE_DEFAULT ); + if ( ft_setjmp( valid.jump_buffer ) == 0 ) + otv_GSUB_validate( gsub, face->num_glyphs, &valid ); + error = valid.error; + if ( error ) + goto Exit; + } + + if ( gdef ) + { + ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT ); + if ( ft_setjmp( valid.jump_buffer ) == 0 ) + otv_GDEF_validate( gdef, gsub, gpos, &valid ); + error = valid.error; + if ( error ) + goto Exit; + } + + if ( jstf ) + { + ft_validator_init( &valid, jstf, jstf + len_jstf, FT_VALIDATE_DEFAULT ); + if ( ft_setjmp( valid.jump_buffer ) == 0 ) + otv_JSTF_validate( jstf, gsub, gpos, face->num_glyphs, &valid ); + error = valid.error; + if ( error ) + goto Exit; + } + + *ot_base = (FT_Bytes)base; + *ot_gdef = (FT_Bytes)gdef; + *ot_gpos = (FT_Bytes)gpos; + *ot_gsub = (FT_Bytes)gsub; + *ot_jstf = (FT_Bytes)jstf; + + Exit: + if ( error ) { + FT_Memory memory = FT_FACE_MEMORY( face ); + + + FT_FREE( base ); + FT_FREE( gdef ); + FT_FREE( gpos ); + FT_FREE( gsub ); + FT_FREE( jstf ); + } + + return error; + } + + + static + const FT_Service_OTvalidateRec otvalid_interface = + { + otv_validate + }; + + + static + const FT_ServiceDescRec otvalid_services[] = + { + { FT_SERVICE_ID_OPENTYPE_VALIDATE, &otvalid_interface }, + { NULL, NULL } + }; + + + static FT_Pointer + otvalid_get_service( FT_Module module, + const char* service_id ) + { + FT_UNUSED( module ); + + return ft_service_list_lookup( otvalid_services, service_id ); + } + + + FT_CALLBACK_TABLE_DEF + const FT_Module_Class otv_module_class = + { + 0, + sizeof( FT_ModuleRec ), + "otvalid", + 0x10000L, + 0x20000L, + + 0, /* module-specific interface */ + + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) otvalid_get_service + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.h b/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.h index 1bfc1899fe3..303655933fa 100644 --- a/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.h +++ b/reactos/dll/3rdparty/freetype/src/otvalid/otvmod.h @@ -1,39 +1,39 @@ -/***************************************************************************/ -/* */ -/* otvmod.h */ -/* */ -/* FreeType's OpenType validation module implementation */ -/* (specification). */ -/* */ -/* Copyright 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __OTVMOD_H__ -#define __OTVMOD_H__ - - -#include -#include FT_MODULE_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Module_Class ) otv_module_class; - - -FT_END_HEADER - -#endif /* __OTVMOD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* otvmod.h */ +/* */ +/* FreeType's OpenType validation module implementation */ +/* (specification). */ +/* */ +/* Copyright 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __OTVMOD_H__ +#define __OTVMOD_H__ + + +#include +#include FT_MODULE_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Module_Class ) otv_module_class; + + +FT_END_HEADER + +#endif /* __OTVMOD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcf.c b/reactos/dll/3rdparty/freetype/src/pcf/pcf.c index 11d5b7b2a06..67ccd44000a 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcf.c +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcf.c @@ -1,36 +1,36 @@ -/* pcf.c - - FreeType font driver for pcf fonts - - Copyright 2000-2001, 2003 by - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - - -#include -#include "pcfutil.c" -#include "pcfread.c" -#include "pcfdrivr.c" - -/* END */ +/* pcf.c + + FreeType font driver for pcf fonts + + Copyright 2000-2001, 2003 by + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + + +#include +#include "pcfutil.c" +#include "pcfread.c" +#include "pcfdrivr.c" + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcf.h b/reactos/dll/3rdparty/freetype/src/pcf/pcf.h index 9d2d8e0e429..a3e91c16dd4 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcf.h +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcf.h @@ -1,237 +1,237 @@ -/* pcf.h - - FreeType font driver for pcf fonts - - Copyright (C) 2000, 2001, 2002, 2003, 2006 by - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#ifndef __PCF_H__ -#define __PCF_H__ - - -#include -#include FT_INTERNAL_DRIVER_H -#include FT_INTERNAL_STREAM_H - - -FT_BEGIN_HEADER - - typedef struct PCF_TableRec_ - { - FT_ULong type; - FT_ULong format; - FT_ULong size; - FT_ULong offset; - - } PCF_TableRec, *PCF_Table; - - - typedef struct PCF_TocRec_ - { - FT_ULong version; - FT_ULong count; - PCF_Table tables; - - } PCF_TocRec, *PCF_Toc; - - - typedef struct PCF_ParsePropertyRec_ - { - FT_Long name; - FT_Byte isString; - FT_Long value; - - } PCF_ParsePropertyRec, *PCF_ParseProperty; - - - typedef struct PCF_PropertyRec_ - { - FT_String* name; - FT_Byte isString; - - union - { - FT_String* atom; - FT_Long integer; - FT_ULong cardinal; - - } value; - - } PCF_PropertyRec, *PCF_Property; - - - typedef struct PCF_Compressed_MetricRec_ - { - FT_Byte leftSideBearing; - FT_Byte rightSideBearing; - FT_Byte characterWidth; - FT_Byte ascent; - FT_Byte descent; - - } PCF_Compressed_MetricRec, *PCF_Compressed_Metric; - - - typedef struct PCF_MetricRec_ - { - FT_Short leftSideBearing; - FT_Short rightSideBearing; - FT_Short characterWidth; - FT_Short ascent; - FT_Short descent; - FT_Short attributes; - FT_ULong bits; - - } PCF_MetricRec, *PCF_Metric; - - - typedef struct PCF_AccelRec_ - { - FT_Byte noOverlap; - FT_Byte constantMetrics; - FT_Byte terminalFont; - FT_Byte constantWidth; - FT_Byte inkInside; - FT_Byte inkMetrics; - FT_Byte drawDirection; - FT_Long fontAscent; - FT_Long fontDescent; - FT_Long maxOverlap; - PCF_MetricRec minbounds; - PCF_MetricRec maxbounds; - PCF_MetricRec ink_minbounds; - PCF_MetricRec ink_maxbounds; - - } PCF_AccelRec, *PCF_Accel; - - - typedef struct PCF_EncodingRec_ - { - FT_Long enc; - FT_UShort glyph; - - } PCF_EncodingRec, *PCF_Encoding; - - - typedef struct PCF_FaceRec_ - { - FT_FaceRec root; - - FT_StreamRec gzip_stream; - FT_Stream gzip_source; - - char* charset_encoding; - char* charset_registry; - - PCF_TocRec toc; - PCF_AccelRec accel; - - int nprops; - PCF_Property properties; - - FT_Long nmetrics; - PCF_Metric metrics; - FT_Long nencodings; - PCF_Encoding encodings; - - FT_Short defaultChar; - - FT_ULong bitmapsFormat; - - FT_CharMap charmap_handle; - FT_CharMapRec charmap; /* a single charmap per face */ - - } PCF_FaceRec, *PCF_Face; - - - /* macros for pcf font format */ - -#define LSBFirst 0 -#define MSBFirst 1 - -#define PCF_FILE_VERSION ( ( 'p' << 24 ) | \ - ( 'c' << 16 ) | \ - ( 'f' << 8 ) | 1 ) -#define PCF_FORMAT_MASK 0xFFFFFF00UL - -#define PCF_DEFAULT_FORMAT 0x00000000UL -#define PCF_INKBOUNDS 0x00000200UL -#define PCF_ACCEL_W_INKBOUNDS 0x00000100UL -#define PCF_COMPRESSED_METRICS 0x00000100UL - -#define PCF_FORMAT_MATCH( a, b ) \ - ( ( (a) & PCF_FORMAT_MASK ) == ( (b) & PCF_FORMAT_MASK ) ) - -#define PCF_GLYPH_PAD_MASK ( 3 << 0 ) -#define PCF_BYTE_MASK ( 1 << 2 ) -#define PCF_BIT_MASK ( 1 << 3 ) -#define PCF_SCAN_UNIT_MASK ( 3 << 4 ) - -#define PCF_BYTE_ORDER( f ) \ - ( ( (f) & PCF_BYTE_MASK ) ? MSBFirst : LSBFirst ) -#define PCF_BIT_ORDER( f ) \ - ( ( (f) & PCF_BIT_MASK ) ? MSBFirst : LSBFirst ) -#define PCF_GLYPH_PAD_INDEX( f ) \ - ( (f) & PCF_GLYPH_PAD_MASK ) -#define PCF_GLYPH_PAD( f ) \ - ( 1 << PCF_GLYPH_PAD_INDEX( f ) ) -#define PCF_SCAN_UNIT_INDEX( f ) \ - ( ( (f) & PCF_SCAN_UNIT_MASK ) >> 4 ) -#define PCF_SCAN_UNIT( f ) \ - ( 1 << PCF_SCAN_UNIT_INDEX( f ) ) -#define PCF_FORMAT_BITS( f ) \ - ( (f) & ( PCF_GLYPH_PAD_MASK | \ - PCF_BYTE_MASK | \ - PCF_BIT_MASK | \ - PCF_SCAN_UNIT_MASK ) ) - -#define PCF_SIZE_TO_INDEX( s ) ( (s) == 4 ? 2 : (s) == 2 ? 1 : 0 ) -#define PCF_INDEX_TO_SIZE( b ) ( 1 << b ) - -#define PCF_FORMAT( bit, byte, glyph, scan ) \ - ( ( PCF_SIZE_TO_INDEX( scan ) << 4 ) | \ - ( ( (bit) == MSBFirst ? 1 : 0 ) << 3 ) | \ - ( ( (byte) == MSBFirst ? 1 : 0 ) << 2 ) | \ - ( PCF_SIZE_TO_INDEX( glyph ) << 0 ) ) - -#define PCF_PROPERTIES ( 1 << 0 ) -#define PCF_ACCELERATORS ( 1 << 1 ) -#define PCF_METRICS ( 1 << 2 ) -#define PCF_BITMAPS ( 1 << 3 ) -#define PCF_INK_METRICS ( 1 << 4 ) -#define PCF_BDF_ENCODINGS ( 1 << 5 ) -#define PCF_SWIDTHS ( 1 << 6 ) -#define PCF_GLYPH_NAMES ( 1 << 7 ) -#define PCF_BDF_ACCELERATORS ( 1 << 8 ) - -#define GLYPHPADOPTIONS 4 /* I'm not sure about this */ - - FT_LOCAL( FT_Error ) - pcf_load_font( FT_Stream, - PCF_Face ); - -FT_END_HEADER - -#endif /* __PCF_H__ */ - - -/* END */ +/* pcf.h + + FreeType font driver for pcf fonts + + Copyright (C) 2000, 2001, 2002, 2003, 2006 by + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#ifndef __PCF_H__ +#define __PCF_H__ + + +#include +#include FT_INTERNAL_DRIVER_H +#include FT_INTERNAL_STREAM_H + + +FT_BEGIN_HEADER + + typedef struct PCF_TableRec_ + { + FT_ULong type; + FT_ULong format; + FT_ULong size; + FT_ULong offset; + + } PCF_TableRec, *PCF_Table; + + + typedef struct PCF_TocRec_ + { + FT_ULong version; + FT_ULong count; + PCF_Table tables; + + } PCF_TocRec, *PCF_Toc; + + + typedef struct PCF_ParsePropertyRec_ + { + FT_Long name; + FT_Byte isString; + FT_Long value; + + } PCF_ParsePropertyRec, *PCF_ParseProperty; + + + typedef struct PCF_PropertyRec_ + { + FT_String* name; + FT_Byte isString; + + union + { + FT_String* atom; + FT_Long integer; + FT_ULong cardinal; + + } value; + + } PCF_PropertyRec, *PCF_Property; + + + typedef struct PCF_Compressed_MetricRec_ + { + FT_Byte leftSideBearing; + FT_Byte rightSideBearing; + FT_Byte characterWidth; + FT_Byte ascent; + FT_Byte descent; + + } PCF_Compressed_MetricRec, *PCF_Compressed_Metric; + + + typedef struct PCF_MetricRec_ + { + FT_Short leftSideBearing; + FT_Short rightSideBearing; + FT_Short characterWidth; + FT_Short ascent; + FT_Short descent; + FT_Short attributes; + FT_ULong bits; + + } PCF_MetricRec, *PCF_Metric; + + + typedef struct PCF_AccelRec_ + { + FT_Byte noOverlap; + FT_Byte constantMetrics; + FT_Byte terminalFont; + FT_Byte constantWidth; + FT_Byte inkInside; + FT_Byte inkMetrics; + FT_Byte drawDirection; + FT_Long fontAscent; + FT_Long fontDescent; + FT_Long maxOverlap; + PCF_MetricRec minbounds; + PCF_MetricRec maxbounds; + PCF_MetricRec ink_minbounds; + PCF_MetricRec ink_maxbounds; + + } PCF_AccelRec, *PCF_Accel; + + + typedef struct PCF_EncodingRec_ + { + FT_Long enc; + FT_UShort glyph; + + } PCF_EncodingRec, *PCF_Encoding; + + + typedef struct PCF_FaceRec_ + { + FT_FaceRec root; + + FT_StreamRec gzip_stream; + FT_Stream gzip_source; + + char* charset_encoding; + char* charset_registry; + + PCF_TocRec toc; + PCF_AccelRec accel; + + int nprops; + PCF_Property properties; + + FT_Long nmetrics; + PCF_Metric metrics; + FT_Long nencodings; + PCF_Encoding encodings; + + FT_Short defaultChar; + + FT_ULong bitmapsFormat; + + FT_CharMap charmap_handle; + FT_CharMapRec charmap; /* a single charmap per face */ + + } PCF_FaceRec, *PCF_Face; + + + /* macros for pcf font format */ + +#define LSBFirst 0 +#define MSBFirst 1 + +#define PCF_FILE_VERSION ( ( 'p' << 24 ) | \ + ( 'c' << 16 ) | \ + ( 'f' << 8 ) | 1 ) +#define PCF_FORMAT_MASK 0xFFFFFF00UL + +#define PCF_DEFAULT_FORMAT 0x00000000UL +#define PCF_INKBOUNDS 0x00000200UL +#define PCF_ACCEL_W_INKBOUNDS 0x00000100UL +#define PCF_COMPRESSED_METRICS 0x00000100UL + +#define PCF_FORMAT_MATCH( a, b ) \ + ( ( (a) & PCF_FORMAT_MASK ) == ( (b) & PCF_FORMAT_MASK ) ) + +#define PCF_GLYPH_PAD_MASK ( 3 << 0 ) +#define PCF_BYTE_MASK ( 1 << 2 ) +#define PCF_BIT_MASK ( 1 << 3 ) +#define PCF_SCAN_UNIT_MASK ( 3 << 4 ) + +#define PCF_BYTE_ORDER( f ) \ + ( ( (f) & PCF_BYTE_MASK ) ? MSBFirst : LSBFirst ) +#define PCF_BIT_ORDER( f ) \ + ( ( (f) & PCF_BIT_MASK ) ? MSBFirst : LSBFirst ) +#define PCF_GLYPH_PAD_INDEX( f ) \ + ( (f) & PCF_GLYPH_PAD_MASK ) +#define PCF_GLYPH_PAD( f ) \ + ( 1 << PCF_GLYPH_PAD_INDEX( f ) ) +#define PCF_SCAN_UNIT_INDEX( f ) \ + ( ( (f) & PCF_SCAN_UNIT_MASK ) >> 4 ) +#define PCF_SCAN_UNIT( f ) \ + ( 1 << PCF_SCAN_UNIT_INDEX( f ) ) +#define PCF_FORMAT_BITS( f ) \ + ( (f) & ( PCF_GLYPH_PAD_MASK | \ + PCF_BYTE_MASK | \ + PCF_BIT_MASK | \ + PCF_SCAN_UNIT_MASK ) ) + +#define PCF_SIZE_TO_INDEX( s ) ( (s) == 4 ? 2 : (s) == 2 ? 1 : 0 ) +#define PCF_INDEX_TO_SIZE( b ) ( 1 << b ) + +#define PCF_FORMAT( bit, byte, glyph, scan ) \ + ( ( PCF_SIZE_TO_INDEX( scan ) << 4 ) | \ + ( ( (bit) == MSBFirst ? 1 : 0 ) << 3 ) | \ + ( ( (byte) == MSBFirst ? 1 : 0 ) << 2 ) | \ + ( PCF_SIZE_TO_INDEX( glyph ) << 0 ) ) + +#define PCF_PROPERTIES ( 1 << 0 ) +#define PCF_ACCELERATORS ( 1 << 1 ) +#define PCF_METRICS ( 1 << 2 ) +#define PCF_BITMAPS ( 1 << 3 ) +#define PCF_INK_METRICS ( 1 << 4 ) +#define PCF_BDF_ENCODINGS ( 1 << 5 ) +#define PCF_SWIDTHS ( 1 << 6 ) +#define PCF_GLYPH_NAMES ( 1 << 7 ) +#define PCF_BDF_ACCELERATORS ( 1 << 8 ) + +#define GLYPHPADOPTIONS 4 /* I'm not sure about this */ + + FT_LOCAL( FT_Error ) + pcf_load_font( FT_Stream, + PCF_Face ); + +FT_END_HEADER + +#endif /* __PCF_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.c b/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.c index c0f0e49ca12..30dc1e46b81 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.c +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.c @@ -1,668 +1,668 @@ -/* pcfdrivr.c - - FreeType font driver for pcf files - - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 by - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#include - -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H -#include FT_GZIP_H -#include FT_LZW_H -#include FT_ERRORS_H -#include FT_BDF_H - -#include "pcf.h" -#include "pcfdrivr.h" -#include "pcfread.h" - -#include "pcferror.h" -#include "pcfutil.h" - -#undef FT_COMPONENT -#define FT_COMPONENT trace_pcfread - -#include FT_SERVICE_BDF_H -#include FT_SERVICE_XFREE86_NAME_H - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_pcfdriver - - - typedef struct PCF_CMapRec_ - { - FT_CMapRec root; - FT_UInt num_encodings; - PCF_Encoding encodings; - - } PCF_CMapRec, *PCF_CMap; - - - FT_CALLBACK_DEF( FT_Error ) - pcf_cmap_init( FT_CMap pcfcmap, /* PCF_CMap */ - FT_Pointer init_data ) - { - PCF_CMap cmap = (PCF_CMap)pcfcmap; - PCF_Face face = (PCF_Face)FT_CMAP_FACE( pcfcmap ); - - FT_UNUSED( init_data ); - - - cmap->num_encodings = (FT_UInt)face->nencodings; - cmap->encodings = face->encodings; - - return PCF_Err_Ok; - } - - - FT_CALLBACK_DEF( void ) - pcf_cmap_done( FT_CMap pcfcmap ) /* PCF_CMap */ - { - PCF_CMap cmap = (PCF_CMap)pcfcmap; - - - cmap->encodings = NULL; - cmap->num_encodings = 0; - } - - - FT_CALLBACK_DEF( FT_UInt ) - pcf_cmap_char_index( FT_CMap pcfcmap, /* PCF_CMap */ - FT_UInt32 charcode ) - { - PCF_CMap cmap = (PCF_CMap)pcfcmap; - PCF_Encoding encodings = cmap->encodings; - FT_UInt min, max, mid; - FT_UInt result = 0; - - - min = 0; - max = cmap->num_encodings; - - while ( min < max ) - { - FT_UInt32 code; - - - mid = ( min + max ) >> 1; - code = encodings[mid].enc; - - if ( charcode == code ) - { - result = encodings[mid].glyph + 1; - break; - } - - if ( charcode < code ) - max = mid; - else - min = mid + 1; - } - - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - pcf_cmap_char_next( FT_CMap pcfcmap, /* PCF_CMap */ - FT_UInt32 *acharcode ) - { - PCF_CMap cmap = (PCF_CMap)pcfcmap; - PCF_Encoding encodings = cmap->encodings; - FT_UInt min, max, mid; - FT_UInt32 charcode = *acharcode + 1; - FT_UInt result = 0; - - - min = 0; - max = cmap->num_encodings; - - while ( min < max ) - { - FT_UInt32 code; - - - mid = ( min + max ) >> 1; - code = encodings[mid].enc; - - if ( charcode == code ) - { - result = encodings[mid].glyph + 1; - goto Exit; - } - - if ( charcode < code ) - max = mid; - else - min = mid + 1; - } - - charcode = 0; - if ( min < cmap->num_encodings ) - { - charcode = encodings[min].enc; - result = encodings[min].glyph + 1; - } - - Exit: - *acharcode = charcode; - return result; - } - - - FT_CALLBACK_TABLE_DEF - const FT_CMap_ClassRec pcf_cmap_class = - { - sizeof ( PCF_CMapRec ), - pcf_cmap_init, - pcf_cmap_done, - pcf_cmap_char_index, - pcf_cmap_char_next - }; - - - FT_CALLBACK_DEF( void ) - PCF_Face_Done( FT_Face pcfface ) /* PCF_Face */ - { - PCF_Face face = (PCF_Face)pcfface; - FT_Memory memory = FT_FACE_MEMORY( face ); - - - FT_FREE( face->encodings ); - FT_FREE( face->metrics ); - - /* free properties */ - { - PCF_Property prop; - FT_Int i; - - - if ( face->properties ) - { - for ( i = 0; i < face->nprops; i++ ) - { - prop = &face->properties[i]; - - if ( prop ) { - FT_FREE( prop->name ); - if ( prop->isString ) - FT_FREE( prop->value.atom ); - } - } - } - FT_FREE( face->properties ); - } - - FT_FREE( face->toc.tables ); - FT_FREE( pcfface->family_name ); - FT_FREE( pcfface->style_name ); - FT_FREE( pcfface->available_sizes ); - FT_FREE( face->charset_encoding ); - FT_FREE( face->charset_registry ); - - FT_TRACE4(( "PCF_Face_Done: done face\n" )); - - /* close gzip/LZW stream if any */ - if ( pcfface->stream == &face->gzip_stream ) - { - FT_Stream_Close( &face->gzip_stream ); - pcfface->stream = face->gzip_source; - } - } - - - FT_CALLBACK_DEF( FT_Error ) - PCF_Face_Init( FT_Stream stream, - FT_Face pcfface, /* PCF_Face */ - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - PCF_Face face = (PCF_Face)pcfface; - FT_Error error = PCF_Err_Ok; - - FT_UNUSED( num_params ); - FT_UNUSED( params ); - FT_UNUSED( face_index ); - - - error = pcf_load_font( stream, face ); - if ( error ) - { - FT_Error error2; - - - PCF_Face_Done( pcfface ); - - /* this didn't work, try gzip support! */ - error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream ); - if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature ) - goto Fail; - - error = error2; - if ( error ) - { - FT_Error error3; - - - /* this didn't work, try LZW support! */ - error3 = FT_Stream_OpenLZW( &face->gzip_stream, stream ); - if ( FT_ERROR_BASE( error3 ) == FT_Err_Unimplemented_Feature ) - goto Fail; - - error = error3; - if ( error ) - goto Fail; - - face->gzip_source = stream; - pcfface->stream = &face->gzip_stream; - - stream = pcfface->stream; - - error = pcf_load_font( stream, face ); - if ( error ) - goto Fail; - } - else - { - face->gzip_source = stream; - pcfface->stream = &face->gzip_stream; - - stream = pcfface->stream; - - error = pcf_load_font( stream, face ); - if ( error ) - goto Fail; - } - } - - /* set up charmap */ - { - FT_String *charset_registry = face->charset_registry; - FT_String *charset_encoding = face->charset_encoding; - FT_Bool unicode_charmap = 0; - - - if ( charset_registry && charset_encoding ) - { - char* s = charset_registry; - - - /* Uh, oh, compare first letters manually to avoid dependency - on locales. */ - if ( ( s[0] == 'i' || s[0] == 'I' ) && - ( s[1] == 's' || s[1] == 'S' ) && - ( s[2] == 'o' || s[2] == 'O' ) ) - { - s += 3; - if ( !ft_strcmp( s, "10646" ) || - ( !ft_strcmp( s, "8859" ) && - !ft_strcmp( face->charset_encoding, "1" ) ) ) - unicode_charmap = 1; - } - } - - { - FT_CharMapRec charmap; - - - charmap.face = FT_FACE( face ); - charmap.encoding = FT_ENCODING_NONE; - charmap.platform_id = 0; - charmap.encoding_id = 0; - - if ( unicode_charmap ) - { - charmap.encoding = FT_ENCODING_UNICODE; - charmap.platform_id = 3; - charmap.encoding_id = 1; - } - - error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL ); - -#if 0 - /* Select default charmap */ - if ( pcfface->num_charmaps ) - pcfface->charmap = pcfface->charmaps[0]; -#endif - } - } - - Exit: - return error; - - Fail: - FT_TRACE2(( "[not a valid PCF file]\n" )); - PCF_Face_Done( pcfface ); - error = PCF_Err_Unknown_File_Format; /* error */ - goto Exit; - } - - - FT_CALLBACK_DEF( FT_Error ) - PCF_Size_Select( FT_Size size, - FT_ULong strike_index ) - { - PCF_Accel accel = &( (PCF_Face)size->face )->accel; - - - FT_Select_Metrics( size->face, strike_index ); - - size->metrics.ascender = accel->fontAscent << 6; - size->metrics.descender = -accel->fontDescent << 6; - size->metrics.max_advance = accel->maxbounds.characterWidth << 6; - - return PCF_Err_Ok; - } - - - FT_CALLBACK_DEF( FT_Error ) - PCF_Size_Request( FT_Size size, - FT_Size_Request req ) - { - PCF_Face face = (PCF_Face)size->face; - FT_Bitmap_Size* bsize = size->face->available_sizes; - FT_Error error = PCF_Err_Invalid_Pixel_Size; - FT_Long height; - - - height = FT_REQUEST_HEIGHT( req ); - height = ( height + 32 ) >> 6; - - switch ( req->type ) - { - case FT_SIZE_REQUEST_TYPE_NOMINAL: - if ( height == ( bsize->y_ppem + 32 ) >> 6 ) - error = PCF_Err_Ok; - break; - - case FT_SIZE_REQUEST_TYPE_REAL_DIM: - if ( height == ( face->accel.fontAscent + - face->accel.fontDescent ) ) - error = PCF_Err_Ok; - break; - - default: - error = PCF_Err_Unimplemented_Feature; - break; - } - - if ( error ) - return error; - else - return PCF_Size_Select( size, 0 ); - } - - - FT_CALLBACK_DEF( FT_Error ) - PCF_Glyph_Load( FT_GlyphSlot slot, - FT_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - PCF_Face face = (PCF_Face)FT_SIZE_FACE( size ); - FT_Stream stream = face->root.stream; - FT_Error error = PCF_Err_Ok; - FT_Bitmap* bitmap = &slot->bitmap; - PCF_Metric metric; - int bytes; - - FT_UNUSED( load_flags ); - - - FT_TRACE4(( "load_glyph %d ---", glyph_index )); - - if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs ) - { - error = PCF_Err_Invalid_Argument; - goto Exit; - } - - if ( glyph_index > 0 ) - glyph_index--; - - metric = face->metrics + glyph_index; - - bitmap->rows = metric->ascent + metric->descent; - bitmap->width = metric->rightSideBearing - metric->leftSideBearing; - bitmap->num_grays = 1; - bitmap->pixel_mode = FT_PIXEL_MODE_MONO; - - FT_TRACE6(( "BIT_ORDER %d ; BYTE_ORDER %d ; GLYPH_PAD %d\n", - PCF_BIT_ORDER( face->bitmapsFormat ), - PCF_BYTE_ORDER( face->bitmapsFormat ), - PCF_GLYPH_PAD( face->bitmapsFormat ) )); - - switch ( PCF_GLYPH_PAD( face->bitmapsFormat ) ) - { - case 1: - bitmap->pitch = ( bitmap->width + 7 ) >> 3; - break; - - case 2: - bitmap->pitch = ( ( bitmap->width + 15 ) >> 4 ) << 1; - break; - - case 4: - bitmap->pitch = ( ( bitmap->width + 31 ) >> 5 ) << 2; - break; - - case 8: - bitmap->pitch = ( ( bitmap->width + 63 ) >> 6 ) << 3; - break; - - default: - return PCF_Err_Invalid_File_Format; - } - - /* XXX: to do: are there cases that need repadding the bitmap? */ - bytes = bitmap->pitch * bitmap->rows; - - error = ft_glyphslot_alloc_bitmap( slot, bytes ); - if ( error ) - goto Exit; - - if ( FT_STREAM_SEEK( metric->bits ) || - FT_STREAM_READ( bitmap->buffer, bytes ) ) - goto Exit; - - if ( PCF_BIT_ORDER( face->bitmapsFormat ) != MSBFirst ) - BitOrderInvert( bitmap->buffer, bytes ); - - if ( ( PCF_BYTE_ORDER( face->bitmapsFormat ) != - PCF_BIT_ORDER( face->bitmapsFormat ) ) ) - { - switch ( PCF_SCAN_UNIT( face->bitmapsFormat ) ) - { - case 1: - break; - - case 2: - TwoByteSwap( bitmap->buffer, bytes ); - break; - - case 4: - FourByteSwap( bitmap->buffer, bytes ); - break; - } - } - - slot->format = FT_GLYPH_FORMAT_BITMAP; - slot->bitmap_left = metric->leftSideBearing; - slot->bitmap_top = metric->ascent; - - slot->metrics.horiAdvance = metric->characterWidth << 6; - slot->metrics.horiBearingX = metric->leftSideBearing << 6; - slot->metrics.horiBearingY = metric->ascent << 6; - slot->metrics.width = ( metric->rightSideBearing - - metric->leftSideBearing ) << 6; - slot->metrics.height = bitmap->rows << 6; - - ft_synthesize_vertical_metrics( &slot->metrics, - ( face->accel.fontAscent + - face->accel.fontDescent ) << 6 ); - - FT_TRACE4(( " --- ok\n" )); - - Exit: - return error; - } - - - /* - * - * BDF SERVICE - * - */ - - static FT_Error - pcf_get_bdf_property( PCF_Face face, - const char* prop_name, - BDF_PropertyRec *aproperty ) - { - PCF_Property prop; - - - prop = pcf_find_property( face, prop_name ); - if ( prop != NULL ) - { - if ( prop->isString ) - { - aproperty->type = BDF_PROPERTY_TYPE_ATOM; - aproperty->u.atom = prop->value.atom; - } - else - { - /* Apparently, the PCF driver loads all properties as signed integers! - * This really doesn't seem to be a problem, because this is - * sufficient for any meaningful values. - */ - aproperty->type = BDF_PROPERTY_TYPE_INTEGER; - aproperty->u.integer = prop->value.integer; - } - return 0; - } - - return PCF_Err_Invalid_Argument; - } - - - static FT_Error - pcf_get_charset_id( PCF_Face face, - const char* *acharset_encoding, - const char* *acharset_registry ) - { - *acharset_encoding = face->charset_encoding; - *acharset_registry = face->charset_registry; - - return 0; - } - - - static const FT_Service_BDFRec pcf_service_bdf = - { - (FT_BDF_GetCharsetIdFunc)pcf_get_charset_id, - (FT_BDF_GetPropertyFunc) pcf_get_bdf_property - }; - - - /* - * - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec pcf_services[] = - { - { FT_SERVICE_ID_BDF, &pcf_service_bdf }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PCF }, - { NULL, NULL } - }; - - - FT_CALLBACK_DEF( FT_Module_Interface ) - pcf_driver_requester( FT_Module module, - const char* name ) - { - FT_UNUSED( module ); - - return ft_service_list_lookup( pcf_services, name ); - } - - - FT_CALLBACK_TABLE_DEF - const FT_Driver_ClassRec pcf_driver_class = - { - { - FT_MODULE_FONT_DRIVER | - FT_MODULE_DRIVER_NO_OUTLINES, - sizeof ( FT_DriverRec ), - - "pcf", - 0x10000L, - 0x20000L, - - 0, - - 0, - 0, - pcf_driver_requester - }, - - sizeof ( PCF_FaceRec ), - sizeof ( FT_SizeRec ), - sizeof ( FT_GlyphSlotRec ), - - PCF_Face_Init, - PCF_Face_Done, - 0, /* FT_Size_InitFunc */ - 0, /* FT_Size_DoneFunc */ - 0, /* FT_Slot_InitFunc */ - 0, /* FT_Slot_DoneFunc */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif - PCF_Glyph_Load, - - 0, /* FT_Face_GetKerningFunc */ - 0, /* FT_Face_AttachFunc */ - 0, /* FT_Face_GetAdvancesFunc */ - - PCF_Size_Request, - PCF_Size_Select - }; - - -/* END */ +/* pcfdrivr.c + + FreeType font driver for pcf files + + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 by + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#include + +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_OBJECTS_H +#include FT_GZIP_H +#include FT_LZW_H +#include FT_ERRORS_H +#include FT_BDF_H + +#include "pcf.h" +#include "pcfdrivr.h" +#include "pcfread.h" + +#include "pcferror.h" +#include "pcfutil.h" + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pcfread + +#include FT_SERVICE_BDF_H +#include FT_SERVICE_XFREE86_NAME_H + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_pcfdriver + + + typedef struct PCF_CMapRec_ + { + FT_CMapRec root; + FT_UInt num_encodings; + PCF_Encoding encodings; + + } PCF_CMapRec, *PCF_CMap; + + + FT_CALLBACK_DEF( FT_Error ) + pcf_cmap_init( FT_CMap pcfcmap, /* PCF_CMap */ + FT_Pointer init_data ) + { + PCF_CMap cmap = (PCF_CMap)pcfcmap; + PCF_Face face = (PCF_Face)FT_CMAP_FACE( pcfcmap ); + + FT_UNUSED( init_data ); + + + cmap->num_encodings = (FT_UInt)face->nencodings; + cmap->encodings = face->encodings; + + return PCF_Err_Ok; + } + + + FT_CALLBACK_DEF( void ) + pcf_cmap_done( FT_CMap pcfcmap ) /* PCF_CMap */ + { + PCF_CMap cmap = (PCF_CMap)pcfcmap; + + + cmap->encodings = NULL; + cmap->num_encodings = 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + pcf_cmap_char_index( FT_CMap pcfcmap, /* PCF_CMap */ + FT_UInt32 charcode ) + { + PCF_CMap cmap = (PCF_CMap)pcfcmap; + PCF_Encoding encodings = cmap->encodings; + FT_UInt min, max, mid; + FT_UInt result = 0; + + + min = 0; + max = cmap->num_encodings; + + while ( min < max ) + { + FT_UInt32 code; + + + mid = ( min + max ) >> 1; + code = encodings[mid].enc; + + if ( charcode == code ) + { + result = encodings[mid].glyph + 1; + break; + } + + if ( charcode < code ) + max = mid; + else + min = mid + 1; + } + + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + pcf_cmap_char_next( FT_CMap pcfcmap, /* PCF_CMap */ + FT_UInt32 *acharcode ) + { + PCF_CMap cmap = (PCF_CMap)pcfcmap; + PCF_Encoding encodings = cmap->encodings; + FT_UInt min, max, mid; + FT_UInt32 charcode = *acharcode + 1; + FT_UInt result = 0; + + + min = 0; + max = cmap->num_encodings; + + while ( min < max ) + { + FT_UInt32 code; + + + mid = ( min + max ) >> 1; + code = encodings[mid].enc; + + if ( charcode == code ) + { + result = encodings[mid].glyph + 1; + goto Exit; + } + + if ( charcode < code ) + max = mid; + else + min = mid + 1; + } + + charcode = 0; + if ( min < cmap->num_encodings ) + { + charcode = encodings[min].enc; + result = encodings[min].glyph + 1; + } + + Exit: + *acharcode = charcode; + return result; + } + + + FT_CALLBACK_TABLE_DEF + const FT_CMap_ClassRec pcf_cmap_class = + { + sizeof ( PCF_CMapRec ), + pcf_cmap_init, + pcf_cmap_done, + pcf_cmap_char_index, + pcf_cmap_char_next + }; + + + FT_CALLBACK_DEF( void ) + PCF_Face_Done( FT_Face pcfface ) /* PCF_Face */ + { + PCF_Face face = (PCF_Face)pcfface; + FT_Memory memory = FT_FACE_MEMORY( face ); + + + FT_FREE( face->encodings ); + FT_FREE( face->metrics ); + + /* free properties */ + { + PCF_Property prop; + FT_Int i; + + + if ( face->properties ) + { + for ( i = 0; i < face->nprops; i++ ) + { + prop = &face->properties[i]; + + if ( prop ) { + FT_FREE( prop->name ); + if ( prop->isString ) + FT_FREE( prop->value.atom ); + } + } + } + FT_FREE( face->properties ); + } + + FT_FREE( face->toc.tables ); + FT_FREE( pcfface->family_name ); + FT_FREE( pcfface->style_name ); + FT_FREE( pcfface->available_sizes ); + FT_FREE( face->charset_encoding ); + FT_FREE( face->charset_registry ); + + FT_TRACE4(( "PCF_Face_Done: done face\n" )); + + /* close gzip/LZW stream if any */ + if ( pcfface->stream == &face->gzip_stream ) + { + FT_Stream_Close( &face->gzip_stream ); + pcfface->stream = face->gzip_source; + } + } + + + FT_CALLBACK_DEF( FT_Error ) + PCF_Face_Init( FT_Stream stream, + FT_Face pcfface, /* PCF_Face */ + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + PCF_Face face = (PCF_Face)pcfface; + FT_Error error = PCF_Err_Ok; + + FT_UNUSED( num_params ); + FT_UNUSED( params ); + FT_UNUSED( face_index ); + + + error = pcf_load_font( stream, face ); + if ( error ) + { + FT_Error error2; + + + PCF_Face_Done( pcfface ); + + /* this didn't work, try gzip support! */ + error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream ); + if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature ) + goto Fail; + + error = error2; + if ( error ) + { + FT_Error error3; + + + /* this didn't work, try LZW support! */ + error3 = FT_Stream_OpenLZW( &face->gzip_stream, stream ); + if ( FT_ERROR_BASE( error3 ) == FT_Err_Unimplemented_Feature ) + goto Fail; + + error = error3; + if ( error ) + goto Fail; + + face->gzip_source = stream; + pcfface->stream = &face->gzip_stream; + + stream = pcfface->stream; + + error = pcf_load_font( stream, face ); + if ( error ) + goto Fail; + } + else + { + face->gzip_source = stream; + pcfface->stream = &face->gzip_stream; + + stream = pcfface->stream; + + error = pcf_load_font( stream, face ); + if ( error ) + goto Fail; + } + } + + /* set up charmap */ + { + FT_String *charset_registry = face->charset_registry; + FT_String *charset_encoding = face->charset_encoding; + FT_Bool unicode_charmap = 0; + + + if ( charset_registry && charset_encoding ) + { + char* s = charset_registry; + + + /* Uh, oh, compare first letters manually to avoid dependency + on locales. */ + if ( ( s[0] == 'i' || s[0] == 'I' ) && + ( s[1] == 's' || s[1] == 'S' ) && + ( s[2] == 'o' || s[2] == 'O' ) ) + { + s += 3; + if ( !ft_strcmp( s, "10646" ) || + ( !ft_strcmp( s, "8859" ) && + !ft_strcmp( face->charset_encoding, "1" ) ) ) + unicode_charmap = 1; + } + } + + { + FT_CharMapRec charmap; + + + charmap.face = FT_FACE( face ); + charmap.encoding = FT_ENCODING_NONE; + charmap.platform_id = 0; + charmap.encoding_id = 0; + + if ( unicode_charmap ) + { + charmap.encoding = FT_ENCODING_UNICODE; + charmap.platform_id = 3; + charmap.encoding_id = 1; + } + + error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL ); + +#if 0 + /* Select default charmap */ + if ( pcfface->num_charmaps ) + pcfface->charmap = pcfface->charmaps[0]; +#endif + } + } + + Exit: + return error; + + Fail: + FT_TRACE2(( "[not a valid PCF file]\n" )); + PCF_Face_Done( pcfface ); + error = PCF_Err_Unknown_File_Format; /* error */ + goto Exit; + } + + + FT_CALLBACK_DEF( FT_Error ) + PCF_Size_Select( FT_Size size, + FT_ULong strike_index ) + { + PCF_Accel accel = &( (PCF_Face)size->face )->accel; + + + FT_Select_Metrics( size->face, strike_index ); + + size->metrics.ascender = accel->fontAscent << 6; + size->metrics.descender = -accel->fontDescent << 6; + size->metrics.max_advance = accel->maxbounds.characterWidth << 6; + + return PCF_Err_Ok; + } + + + FT_CALLBACK_DEF( FT_Error ) + PCF_Size_Request( FT_Size size, + FT_Size_Request req ) + { + PCF_Face face = (PCF_Face)size->face; + FT_Bitmap_Size* bsize = size->face->available_sizes; + FT_Error error = PCF_Err_Invalid_Pixel_Size; + FT_Long height; + + + height = FT_REQUEST_HEIGHT( req ); + height = ( height + 32 ) >> 6; + + switch ( req->type ) + { + case FT_SIZE_REQUEST_TYPE_NOMINAL: + if ( height == ( bsize->y_ppem + 32 ) >> 6 ) + error = PCF_Err_Ok; + break; + + case FT_SIZE_REQUEST_TYPE_REAL_DIM: + if ( height == ( face->accel.fontAscent + + face->accel.fontDescent ) ) + error = PCF_Err_Ok; + break; + + default: + error = PCF_Err_Unimplemented_Feature; + break; + } + + if ( error ) + return error; + else + return PCF_Size_Select( size, 0 ); + } + + + FT_CALLBACK_DEF( FT_Error ) + PCF_Glyph_Load( FT_GlyphSlot slot, + FT_Size size, + FT_UInt glyph_index, + FT_Int32 load_flags ) + { + PCF_Face face = (PCF_Face)FT_SIZE_FACE( size ); + FT_Stream stream = face->root.stream; + FT_Error error = PCF_Err_Ok; + FT_Bitmap* bitmap = &slot->bitmap; + PCF_Metric metric; + int bytes; + + FT_UNUSED( load_flags ); + + + FT_TRACE4(( "load_glyph %d ---", glyph_index )); + + if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs ) + { + error = PCF_Err_Invalid_Argument; + goto Exit; + } + + if ( glyph_index > 0 ) + glyph_index--; + + metric = face->metrics + glyph_index; + + bitmap->rows = metric->ascent + metric->descent; + bitmap->width = metric->rightSideBearing - metric->leftSideBearing; + bitmap->num_grays = 1; + bitmap->pixel_mode = FT_PIXEL_MODE_MONO; + + FT_TRACE6(( "BIT_ORDER %d ; BYTE_ORDER %d ; GLYPH_PAD %d\n", + PCF_BIT_ORDER( face->bitmapsFormat ), + PCF_BYTE_ORDER( face->bitmapsFormat ), + PCF_GLYPH_PAD( face->bitmapsFormat ) )); + + switch ( PCF_GLYPH_PAD( face->bitmapsFormat ) ) + { + case 1: + bitmap->pitch = ( bitmap->width + 7 ) >> 3; + break; + + case 2: + bitmap->pitch = ( ( bitmap->width + 15 ) >> 4 ) << 1; + break; + + case 4: + bitmap->pitch = ( ( bitmap->width + 31 ) >> 5 ) << 2; + break; + + case 8: + bitmap->pitch = ( ( bitmap->width + 63 ) >> 6 ) << 3; + break; + + default: + return PCF_Err_Invalid_File_Format; + } + + /* XXX: to do: are there cases that need repadding the bitmap? */ + bytes = bitmap->pitch * bitmap->rows; + + error = ft_glyphslot_alloc_bitmap( slot, bytes ); + if ( error ) + goto Exit; + + if ( FT_STREAM_SEEK( metric->bits ) || + FT_STREAM_READ( bitmap->buffer, bytes ) ) + goto Exit; + + if ( PCF_BIT_ORDER( face->bitmapsFormat ) != MSBFirst ) + BitOrderInvert( bitmap->buffer, bytes ); + + if ( ( PCF_BYTE_ORDER( face->bitmapsFormat ) != + PCF_BIT_ORDER( face->bitmapsFormat ) ) ) + { + switch ( PCF_SCAN_UNIT( face->bitmapsFormat ) ) + { + case 1: + break; + + case 2: + TwoByteSwap( bitmap->buffer, bytes ); + break; + + case 4: + FourByteSwap( bitmap->buffer, bytes ); + break; + } + } + + slot->format = FT_GLYPH_FORMAT_BITMAP; + slot->bitmap_left = metric->leftSideBearing; + slot->bitmap_top = metric->ascent; + + slot->metrics.horiAdvance = metric->characterWidth << 6; + slot->metrics.horiBearingX = metric->leftSideBearing << 6; + slot->metrics.horiBearingY = metric->ascent << 6; + slot->metrics.width = ( metric->rightSideBearing - + metric->leftSideBearing ) << 6; + slot->metrics.height = bitmap->rows << 6; + + ft_synthesize_vertical_metrics( &slot->metrics, + ( face->accel.fontAscent + + face->accel.fontDescent ) << 6 ); + + FT_TRACE4(( " --- ok\n" )); + + Exit: + return error; + } + + + /* + * + * BDF SERVICE + * + */ + + static FT_Error + pcf_get_bdf_property( PCF_Face face, + const char* prop_name, + BDF_PropertyRec *aproperty ) + { + PCF_Property prop; + + + prop = pcf_find_property( face, prop_name ); + if ( prop != NULL ) + { + if ( prop->isString ) + { + aproperty->type = BDF_PROPERTY_TYPE_ATOM; + aproperty->u.atom = prop->value.atom; + } + else + { + /* Apparently, the PCF driver loads all properties as signed integers! + * This really doesn't seem to be a problem, because this is + * sufficient for any meaningful values. + */ + aproperty->type = BDF_PROPERTY_TYPE_INTEGER; + aproperty->u.integer = prop->value.integer; + } + return 0; + } + + return PCF_Err_Invalid_Argument; + } + + + static FT_Error + pcf_get_charset_id( PCF_Face face, + const char* *acharset_encoding, + const char* *acharset_registry ) + { + *acharset_encoding = face->charset_encoding; + *acharset_registry = face->charset_registry; + + return 0; + } + + + static const FT_Service_BDFRec pcf_service_bdf = + { + (FT_BDF_GetCharsetIdFunc)pcf_get_charset_id, + (FT_BDF_GetPropertyFunc) pcf_get_bdf_property + }; + + + /* + * + * SERVICE LIST + * + */ + + static const FT_ServiceDescRec pcf_services[] = + { + { FT_SERVICE_ID_BDF, &pcf_service_bdf }, + { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PCF }, + { NULL, NULL } + }; + + + FT_CALLBACK_DEF( FT_Module_Interface ) + pcf_driver_requester( FT_Module module, + const char* name ) + { + FT_UNUSED( module ); + + return ft_service_list_lookup( pcf_services, name ); + } + + + FT_CALLBACK_TABLE_DEF + const FT_Driver_ClassRec pcf_driver_class = + { + { + FT_MODULE_FONT_DRIVER | + FT_MODULE_DRIVER_NO_OUTLINES, + sizeof ( FT_DriverRec ), + + "pcf", + 0x10000L, + 0x20000L, + + 0, + + 0, + 0, + pcf_driver_requester + }, + + sizeof ( PCF_FaceRec ), + sizeof ( FT_SizeRec ), + sizeof ( FT_GlyphSlotRec ), + + PCF_Face_Init, + PCF_Face_Done, + 0, /* FT_Size_InitFunc */ + 0, /* FT_Size_DoneFunc */ + 0, /* FT_Slot_InitFunc */ + 0, /* FT_Slot_DoneFunc */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + ft_stub_set_char_sizes, + ft_stub_set_pixel_sizes, +#endif + PCF_Glyph_Load, + + 0, /* FT_Face_GetKerningFunc */ + 0, /* FT_Face_AttachFunc */ + 0, /* FT_Face_GetAdvancesFunc */ + + PCF_Size_Request, + PCF_Size_Select + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.h b/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.h index 7ddf697e164..78e81500673 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.h +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcfdrivr.h @@ -1,44 +1,44 @@ -/* pcfdrivr.h - - FreeType font driver for pcf fonts - - Copyright 2000-2001, 2002 by - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#ifndef __PCFDRIVR_H__ -#define __PCFDRIVR_H__ - -#include -#include FT_INTERNAL_DRIVER_H - -FT_BEGIN_HEADER - - FT_EXPORT_VAR( const FT_Driver_ClassRec ) pcf_driver_class; - -FT_END_HEADER - - -#endif /* __PCFDRIVR_H__ */ - - -/* END */ +/* pcfdrivr.h + + FreeType font driver for pcf fonts + + Copyright 2000-2001, 2002 by + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#ifndef __PCFDRIVR_H__ +#define __PCFDRIVR_H__ + +#include +#include FT_INTERNAL_DRIVER_H + +FT_BEGIN_HEADER + + FT_EXPORT_VAR( const FT_Driver_ClassRec ) pcf_driver_class; + +FT_END_HEADER + + +#endif /* __PCFDRIVR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcferror.h b/reactos/dll/3rdparty/freetype/src/pcf/pcferror.h index d75c067aa6a..36369886048 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcferror.h +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcferror.h @@ -1,40 +1,40 @@ -/***************************************************************************/ -/* */ -/* pcferror.h */ -/* */ -/* PCF error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the PCF error enumeration constants. */ - /* */ - /*************************************************************************/ - -#ifndef __PCFERROR_H__ -#define __PCFERROR_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX PCF_Err_ -#define FT_ERR_BASE FT_Mod_Err_PCF - -#include FT_ERRORS_H - -#endif /* __PCFERROR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pcferror.h */ +/* */ +/* PCF error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the PCF error enumeration constants. */ + /* */ + /*************************************************************************/ + +#ifndef __PCFERROR_H__ +#define __PCFERROR_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX PCF_Err_ +#define FT_ERR_BASE FT_Mod_Err_PCF + +#include FT_ERRORS_H + +#endif /* __PCFERROR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcfread.c b/reactos/dll/3rdparty/freetype/src/pcf/pcfread.c index b9123cf574f..637b265f996 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcfread.c +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcfread.c @@ -1,1267 +1,1267 @@ -/* pcfread.c - - FreeType font driver for pcf fonts - - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#include - -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H - -#include "pcf.h" -#include "pcfdrivr.h" -#include "pcfread.h" - -#include "pcferror.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_pcfread - - -#if defined( FT_DEBUG_LEVEL_TRACE ) - static const char* const tableNames[] = - { - "prop", "accl", "mtrcs", "bmps", "imtrcs", - "enc", "swidth", "names", "accel" - }; -#endif - - - static - const FT_Frame_Field pcf_toc_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_TocRec - - FT_FRAME_START( 8 ), - FT_FRAME_ULONG_LE( version ), - FT_FRAME_ULONG_LE( count ), - FT_FRAME_END - }; - - - static - const FT_Frame_Field pcf_table_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_TableRec - - FT_FRAME_START( 16 ), - FT_FRAME_ULONG_LE( type ), - FT_FRAME_ULONG_LE( format ), - FT_FRAME_ULONG_LE( size ), - FT_FRAME_ULONG_LE( offset ), - FT_FRAME_END - }; - - - static FT_Error - pcf_read_TOC( FT_Stream stream, - PCF_Face face ) - { - FT_Error error; - PCF_Toc toc = &face->toc; - PCF_Table tables; - - FT_Memory memory = FT_FACE(face)->memory; - FT_UInt n; - - - if ( FT_STREAM_SEEK ( 0 ) || - FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) ) - return PCF_Err_Cannot_Open_Resource; - - if ( toc->version != PCF_FILE_VERSION || - toc->count > FT_ARRAY_MAX( face->toc.tables ) || - toc->count == 0 ) - return PCF_Err_Invalid_File_Format; - - if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) ) - return PCF_Err_Out_Of_Memory; - - tables = face->toc.tables; - for ( n = 0; n < toc->count; n++ ) - { - if ( FT_STREAM_READ_FIELDS( pcf_table_header, tables ) ) - goto Exit; - tables++; - } - - /* Sort tables and check for overlaps. Because they are almost */ - /* always ordered already, an in-place bubble sort with simultaneous */ - /* boundary checking seems appropriate. */ - tables = face->toc.tables; - - for ( n = 0; n < toc->count - 1; n++ ) - { - FT_UInt i, have_change; - - - have_change = 0; - - for ( i = 0; i < toc->count - 1 - n; i++ ) - { - PCF_TableRec tmp; - - - if ( tables[i].offset > tables[i + 1].offset ) - { - tmp = tables[i]; - tables[i] = tables[i + 1]; - tables[i + 1] = tmp; - - have_change = 1; - } - - if ( ( tables[i].size > tables[i + 1].offset ) || - ( tables[i].offset > tables[i + 1].offset - tables[i].size ) ) - return PCF_Err_Invalid_Offset; - } - - if ( !have_change ) - break; - } - -#if defined( FT_DEBUG_LEVEL_TRACE ) - - { - FT_UInt i, j; - const char* name = "?"; - - - FT_TRACE4(( "pcf_read_TOC:\n" )); - - FT_TRACE4(( " number of tables: %ld\n", face->toc.count )); - - tables = face->toc.tables; - for ( i = 0; i < toc->count; i++ ) - { - for ( j = 0; j < sizeof ( tableNames ) / sizeof ( tableNames[0] ); - j++ ) - if ( tables[i].type == (FT_UInt)( 1 << j ) ) - name = tableNames[j]; - - FT_TRACE4(( " %d: type=%s, format=0x%X, " - "size=%ld (0x%lX), offset=%ld (0x%lX)\n", - i, name, - tables[i].format, - tables[i].size, tables[i].size, - tables[i].offset, tables[i].offset )); - } - } - -#endif - - return PCF_Err_Ok; - - Exit: - FT_FREE( face->toc.tables ); - return error; - } - - -#define PCF_METRIC_SIZE 12 - - static - const FT_Frame_Field pcf_metric_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_MetricRec - - FT_FRAME_START( PCF_METRIC_SIZE ), - FT_FRAME_SHORT_LE( leftSideBearing ), - FT_FRAME_SHORT_LE( rightSideBearing ), - FT_FRAME_SHORT_LE( characterWidth ), - FT_FRAME_SHORT_LE( ascent ), - FT_FRAME_SHORT_LE( descent ), - FT_FRAME_SHORT_LE( attributes ), - FT_FRAME_END - }; - - - static - const FT_Frame_Field pcf_metric_msb_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_MetricRec - - FT_FRAME_START( PCF_METRIC_SIZE ), - FT_FRAME_SHORT( leftSideBearing ), - FT_FRAME_SHORT( rightSideBearing ), - FT_FRAME_SHORT( characterWidth ), - FT_FRAME_SHORT( ascent ), - FT_FRAME_SHORT( descent ), - FT_FRAME_SHORT( attributes ), - FT_FRAME_END - }; - - -#define PCF_COMPRESSED_METRIC_SIZE 5 - - static - const FT_Frame_Field pcf_compressed_metric_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_Compressed_MetricRec - - FT_FRAME_START( PCF_COMPRESSED_METRIC_SIZE ), - FT_FRAME_BYTE( leftSideBearing ), - FT_FRAME_BYTE( rightSideBearing ), - FT_FRAME_BYTE( characterWidth ), - FT_FRAME_BYTE( ascent ), - FT_FRAME_BYTE( descent ), - FT_FRAME_END - }; - - - static FT_Error - pcf_get_metric( FT_Stream stream, - FT_ULong format, - PCF_Metric metric ) - { - FT_Error error = PCF_Err_Ok; - - - if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) - { - const FT_Frame_Field* fields; - - - /* parsing normal metrics */ - fields = PCF_BYTE_ORDER( format ) == MSBFirst - ? pcf_metric_msb_header - : pcf_metric_header; - - /* the following sets `error' but doesn't return in case of failure */ - (void)FT_STREAM_READ_FIELDS( fields, metric ); - } - else - { - PCF_Compressed_MetricRec compr; - - - /* parsing compressed metrics */ - if ( FT_STREAM_READ_FIELDS( pcf_compressed_metric_header, &compr ) ) - goto Exit; - - metric->leftSideBearing = (FT_Short)( compr.leftSideBearing - 0x80 ); - metric->rightSideBearing = (FT_Short)( compr.rightSideBearing - 0x80 ); - metric->characterWidth = (FT_Short)( compr.characterWidth - 0x80 ); - metric->ascent = (FT_Short)( compr.ascent - 0x80 ); - metric->descent = (FT_Short)( compr.descent - 0x80 ); - metric->attributes = 0; - } - - Exit: - return error; - } - - - static FT_Error - pcf_seek_to_table_type( FT_Stream stream, - PCF_Table tables, - FT_Int ntables, - FT_ULong type, - FT_ULong *aformat, - FT_ULong *asize ) - { - FT_Error error = PCF_Err_Invalid_File_Format; - FT_Int i; - - - for ( i = 0; i < ntables; i++ ) - if ( tables[i].type == type ) - { - if ( stream->pos > tables[i].offset ) - { - error = PCF_Err_Invalid_Stream_Skip; - goto Fail; - } - - if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) ) - { - error = PCF_Err_Invalid_Stream_Skip; - goto Fail; - } - - *asize = tables[i].size; - *aformat = tables[i].format; - - return PCF_Err_Ok; - } - - Fail: - *asize = 0; - return error; - } - - - static FT_Bool - pcf_has_table_type( PCF_Table tables, - FT_Int ntables, - FT_ULong type ) - { - FT_Int i; - - - for ( i = 0; i < ntables; i++ ) - if ( tables[i].type == type ) - return TRUE; - - return FALSE; - } - - -#define PCF_PROPERTY_SIZE 9 - - static - const FT_Frame_Field pcf_property_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_ParsePropertyRec - - FT_FRAME_START( PCF_PROPERTY_SIZE ), - FT_FRAME_LONG_LE( name ), - FT_FRAME_BYTE ( isString ), - FT_FRAME_LONG_LE( value ), - FT_FRAME_END - }; - - - static - const FT_Frame_Field pcf_property_msb_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_ParsePropertyRec - - FT_FRAME_START( PCF_PROPERTY_SIZE ), - FT_FRAME_LONG( name ), - FT_FRAME_BYTE( isString ), - FT_FRAME_LONG( value ), - FT_FRAME_END - }; - - - FT_LOCAL_DEF( PCF_Property ) - pcf_find_property( PCF_Face face, - const FT_String* prop ) - { - PCF_Property properties = face->properties; - FT_Bool found = 0; - int i; - - - for ( i = 0 ; i < face->nprops && !found; i++ ) - { - if ( !ft_strcmp( properties[i].name, prop ) ) - found = 1; - } - - if ( found ) - return properties + i - 1; - else - return NULL; - } - - - static FT_Error - pcf_get_properties( FT_Stream stream, - PCF_Face face ) - { - PCF_ParseProperty props = 0; - PCF_Property properties; - FT_UInt nprops, i; - FT_ULong format, size; - FT_Error error; - FT_Memory memory = FT_FACE(face)->memory; - FT_ULong string_size; - FT_String* strings = 0; - - - error = pcf_seek_to_table_type( stream, - face->toc.tables, - face->toc.count, - PCF_PROPERTIES, - &format, - &size ); - if ( error ) - goto Bail; - - if ( FT_READ_ULONG_LE( format ) ) - goto Bail; - - FT_TRACE4(( "pcf_get_properties:\n" )); - - FT_TRACE4(( " format = %ld\n", format )); - - if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) - goto Bail; - - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_ULONG( nprops ); - else - (void)FT_READ_ULONG_LE( nprops ); - if ( error ) - goto Bail; - - FT_TRACE4(( " nprop = %d\n", nprops )); - - /* rough estimate */ - if ( nprops > size / PCF_PROPERTY_SIZE ) - { - error = PCF_Err_Invalid_Table; - goto Bail; - } - - face->nprops = nprops; - - if ( FT_NEW_ARRAY( props, nprops ) ) - goto Bail; - - for ( i = 0; i < nprops; i++ ) - { - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - { - if ( FT_STREAM_READ_FIELDS( pcf_property_msb_header, props + i ) ) - goto Bail; - } - else - { - if ( FT_STREAM_READ_FIELDS( pcf_property_header, props + i ) ) - goto Bail; - } - } - - /* pad the property array */ - /* */ - /* clever here - nprops is the same as the number of odd-units read, */ - /* as only isStringProp are odd length (Keith Packard) */ - /* */ - if ( nprops & 3 ) - { - i = 4 - ( nprops & 3 ); - FT_Stream_Skip( stream, i ); - } - - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_ULONG( string_size ); - else - (void)FT_READ_ULONG_LE( string_size ); - if ( error ) - goto Bail; - - FT_TRACE4(( " string_size = %ld\n", string_size )); - - /* rough estimate */ - if ( string_size > size - nprops * PCF_PROPERTY_SIZE ) - { - error = PCF_Err_Invalid_Table; - goto Bail; - } - - if ( FT_NEW_ARRAY( strings, string_size ) ) - goto Bail; - - error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size ); - if ( error ) - goto Bail; - - if ( FT_NEW_ARRAY( properties, nprops ) ) - goto Bail; - - face->properties = properties; - - for ( i = 0; i < nprops; i++ ) - { - FT_Long name_offset = props[i].name; - - - if ( ( name_offset < 0 ) || - ( (FT_ULong)name_offset > string_size ) ) - { - error = PCF_Err_Invalid_Offset; - goto Bail; - } - - if ( FT_STRDUP( properties[i].name, strings + name_offset ) ) - goto Bail; - - FT_TRACE4(( " %s:", properties[i].name )); - - properties[i].isString = props[i].isString; - - if ( props[i].isString ) - { - FT_Long value_offset = props[i].value; - - - if ( ( value_offset < 0 ) || - ( (FT_ULong)value_offset > string_size ) ) - { - error = PCF_Err_Invalid_Offset; - goto Bail; - } - - if ( FT_STRDUP( properties[i].value.atom, strings + value_offset ) ) - goto Bail; - - FT_TRACE4(( " `%s'\n", properties[i].value.atom )); - } - else - { - properties[i].value.integer = props[i].value; - - FT_TRACE4(( " %d\n", properties[i].value.integer )); - } - } - - error = PCF_Err_Ok; - - Bail: - FT_FREE( props ); - FT_FREE( strings ); - - return error; - } - - - static FT_Error - pcf_get_metrics( FT_Stream stream, - PCF_Face face ) - { - FT_Error error = PCF_Err_Ok; - FT_Memory memory = FT_FACE(face)->memory; - FT_ULong format, size; - PCF_Metric metrics = 0; - FT_ULong nmetrics, i; - - - error = pcf_seek_to_table_type( stream, - face->toc.tables, - face->toc.count, - PCF_METRICS, - &format, - &size ); - if ( error ) - return error; - - if ( FT_READ_ULONG_LE( format ) ) - goto Bail; - - if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) && - !PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) ) - return PCF_Err_Invalid_File_Format; - - if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) - { - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_ULONG( nmetrics ); - else - (void)FT_READ_ULONG_LE( nmetrics ); - } - else - { - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_USHORT( nmetrics ); - else - (void)FT_READ_USHORT_LE( nmetrics ); - } - if ( error ) - return PCF_Err_Invalid_File_Format; - - face->nmetrics = nmetrics; - - FT_TRACE4(( "pcf_get_metrics:\n" )); - - FT_TRACE4(( " number of metrics: %d\n", nmetrics )); - - /* rough estimate */ - if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) - { - if ( nmetrics > size / PCF_METRIC_SIZE ) - return PCF_Err_Invalid_Table; - } - else - { - if ( nmetrics > size / PCF_COMPRESSED_METRIC_SIZE ) - return PCF_Err_Invalid_Table; - } - - if ( FT_NEW_ARRAY( face->metrics, nmetrics ) ) - return PCF_Err_Out_Of_Memory; - - metrics = face->metrics; - for ( i = 0; i < nmetrics; i++ ) - { - pcf_get_metric( stream, format, metrics + i ); - - metrics[i].bits = 0; - - FT_TRACE5(( " idx %d: width=%d, " - "lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\n", - i, - ( metrics + i )->characterWidth, - ( metrics + i )->leftSideBearing, - ( metrics + i )->rightSideBearing, - ( metrics + i )->ascent, - ( metrics + i )->descent, - ( metrics + i )->attributes )); - - if ( error ) - break; - } - - if ( error ) - FT_FREE( face->metrics ); - - Bail: - return error; - } - - - static FT_Error - pcf_get_bitmaps( FT_Stream stream, - PCF_Face face ) - { - FT_Error error = PCF_Err_Ok; - FT_Memory memory = FT_FACE(face)->memory; - FT_Long* offsets; - FT_Long bitmapSizes[GLYPHPADOPTIONS]; - FT_ULong format, size; - int nbitmaps, i, sizebitmaps = 0; - - - error = pcf_seek_to_table_type( stream, - face->toc.tables, - face->toc.count, - PCF_BITMAPS, - &format, - &size ); - if ( error ) - return error; - - error = FT_Stream_EnterFrame( stream, 8 ); - if ( error ) - return error; - - format = FT_GET_ULONG_LE(); - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - nbitmaps = FT_GET_ULONG(); - else - nbitmaps = FT_GET_ULONG_LE(); - - FT_Stream_ExitFrame( stream ); - - if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) - return PCF_Err_Invalid_File_Format; - - FT_TRACE4(( "pcf_get_bitmaps:\n" )); - - FT_TRACE4(( " number of bitmaps: %d\n", nbitmaps )); - - if ( nbitmaps != face->nmetrics ) - return PCF_Err_Invalid_File_Format; - - if ( FT_NEW_ARRAY( offsets, nbitmaps ) ) - return error; - - for ( i = 0; i < nbitmaps; i++ ) - { - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_LONG( offsets[i] ); - else - (void)FT_READ_LONG_LE( offsets[i] ); - - FT_TRACE5(( " bitmap %d: offset %ld (0x%lX)\n", - i, offsets[i], offsets[i] )); - } - if ( error ) - goto Bail; - - for ( i = 0; i < GLYPHPADOPTIONS; i++ ) - { - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - (void)FT_READ_LONG( bitmapSizes[i] ); - else - (void)FT_READ_LONG_LE( bitmapSizes[i] ); - if ( error ) - goto Bail; - - sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )]; - - FT_TRACE4(( " padding %d implies a size of %ld\n", i, bitmapSizes[i] )); - } - - FT_TRACE4(( " %d bitmaps, padding index %ld\n", - nbitmaps, - PCF_GLYPH_PAD_INDEX( format ) )); - FT_TRACE4(( " bitmap size = %d\n", sizebitmaps )); - - FT_UNUSED( sizebitmaps ); /* only used for debugging */ - - for ( i = 0; i < nbitmaps; i++ ) - { - /* rough estimate */ - if ( ( offsets[i] < 0 ) || - ( (FT_ULong)offsets[i] > size ) ) - { - FT_ERROR(( "pcf_get_bitmaps:")); - FT_ERROR(( " invalid offset to bitmap data of glyph %d\n", i )); - } - else - face->metrics[i].bits = stream->pos + offsets[i]; - } - - face->bitmapsFormat = format; - - Bail: - FT_FREE( offsets ); - return error; - } - - - static FT_Error - pcf_get_encodings( FT_Stream stream, - PCF_Face face ) - { - FT_Error error = PCF_Err_Ok; - FT_Memory memory = FT_FACE(face)->memory; - FT_ULong format, size; - int firstCol, lastCol; - int firstRow, lastRow; - int nencoding, encodingOffset; - int i, j; - PCF_Encoding tmpEncoding, encoding = 0; - - - error = pcf_seek_to_table_type( stream, - face->toc.tables, - face->toc.count, - PCF_BDF_ENCODINGS, - &format, - &size ); - if ( error ) - return error; - - error = FT_Stream_EnterFrame( stream, 14 ); - if ( error ) - return error; - - format = FT_GET_ULONG_LE(); - - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - { - firstCol = FT_GET_SHORT(); - lastCol = FT_GET_SHORT(); - firstRow = FT_GET_SHORT(); - lastRow = FT_GET_SHORT(); - face->defaultChar = FT_GET_SHORT(); - } - else - { - firstCol = FT_GET_SHORT_LE(); - lastCol = FT_GET_SHORT_LE(); - firstRow = FT_GET_SHORT_LE(); - lastRow = FT_GET_SHORT_LE(); - face->defaultChar = FT_GET_SHORT_LE(); - } - - FT_Stream_ExitFrame( stream ); - - if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) - return PCF_Err_Invalid_File_Format; - - FT_TRACE4(( "pdf_get_encodings:\n" )); - - FT_TRACE4(( " firstCol %d, lastCol %d, firstRow %d, lastRow %d\n", - firstCol, lastCol, firstRow, lastRow )); - - nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 ); - - if ( FT_NEW_ARRAY( tmpEncoding, nencoding ) ) - return PCF_Err_Out_Of_Memory; - - error = FT_Stream_EnterFrame( stream, 2 * nencoding ); - if ( error ) - goto Bail; - - for ( i = 0, j = 0 ; i < nencoding; i++ ) - { - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - encodingOffset = FT_GET_SHORT(); - else - encodingOffset = FT_GET_SHORT_LE(); - - if ( encodingOffset != -1 ) - { - tmpEncoding[j].enc = ( ( ( i / ( lastCol - firstCol + 1 ) ) + - firstRow ) * 256 ) + - ( ( i % ( lastCol - firstCol + 1 ) ) + - firstCol ); - - tmpEncoding[j].glyph = (FT_Short)encodingOffset; - - FT_TRACE5(( " code %d (0x%04X): idx %d\n", - tmpEncoding[j].enc, tmpEncoding[j].enc, - tmpEncoding[j].glyph )); - - j++; - } - } - FT_Stream_ExitFrame( stream ); - - if ( FT_NEW_ARRAY( encoding, j ) ) - goto Bail; - - for ( i = 0; i < j; i++ ) - { - encoding[i].enc = tmpEncoding[i].enc; - encoding[i].glyph = tmpEncoding[i].glyph; - } - - face->nencodings = j; - face->encodings = encoding; - FT_FREE( tmpEncoding ); - - return error; - - Bail: - FT_FREE( encoding ); - FT_FREE( tmpEncoding ); - return error; - } - - - static - const FT_Frame_Field pcf_accel_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_AccelRec - - FT_FRAME_START( 20 ), - FT_FRAME_BYTE ( noOverlap ), - FT_FRAME_BYTE ( constantMetrics ), - FT_FRAME_BYTE ( terminalFont ), - FT_FRAME_BYTE ( constantWidth ), - FT_FRAME_BYTE ( inkInside ), - FT_FRAME_BYTE ( inkMetrics ), - FT_FRAME_BYTE ( drawDirection ), - FT_FRAME_SKIP_BYTES( 1 ), - FT_FRAME_LONG_LE ( fontAscent ), - FT_FRAME_LONG_LE ( fontDescent ), - FT_FRAME_LONG_LE ( maxOverlap ), - FT_FRAME_END - }; - - - static - const FT_Frame_Field pcf_accel_msb_header[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PCF_AccelRec - - FT_FRAME_START( 20 ), - FT_FRAME_BYTE ( noOverlap ), - FT_FRAME_BYTE ( constantMetrics ), - FT_FRAME_BYTE ( terminalFont ), - FT_FRAME_BYTE ( constantWidth ), - FT_FRAME_BYTE ( inkInside ), - FT_FRAME_BYTE ( inkMetrics ), - FT_FRAME_BYTE ( drawDirection ), - FT_FRAME_SKIP_BYTES( 1 ), - FT_FRAME_LONG ( fontAscent ), - FT_FRAME_LONG ( fontDescent ), - FT_FRAME_LONG ( maxOverlap ), - FT_FRAME_END - }; - - - static FT_Error - pcf_get_accel( FT_Stream stream, - PCF_Face face, - FT_ULong type ) - { - FT_ULong format, size; - FT_Error error = PCF_Err_Ok; - PCF_Accel accel = &face->accel; - - - error = pcf_seek_to_table_type( stream, - face->toc.tables, - face->toc.count, - type, - &format, - &size ); - if ( error ) - goto Bail; - - if ( FT_READ_ULONG_LE( format ) ) - goto Bail; - - if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) && - !PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ) - goto Bail; - - if ( PCF_BYTE_ORDER( format ) == MSBFirst ) - { - if ( FT_STREAM_READ_FIELDS( pcf_accel_msb_header, accel ) ) - goto Bail; - } - else - { - if ( FT_STREAM_READ_FIELDS( pcf_accel_header, accel ) ) - goto Bail; - } - - error = pcf_get_metric( stream, - format & ( ~PCF_FORMAT_MASK ), - &(accel->minbounds) ); - if ( error ) - goto Bail; - - error = pcf_get_metric( stream, - format & ( ~PCF_FORMAT_MASK ), - &(accel->maxbounds) ); - if ( error ) - goto Bail; - - if ( PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ) - { - error = pcf_get_metric( stream, - format & ( ~PCF_FORMAT_MASK ), - &(accel->ink_minbounds) ); - if ( error ) - goto Bail; - - error = pcf_get_metric( stream, - format & ( ~PCF_FORMAT_MASK ), - &(accel->ink_maxbounds) ); - if ( error ) - goto Bail; - } - else - { - accel->ink_minbounds = accel->minbounds; /* I'm not sure about this */ - accel->ink_maxbounds = accel->maxbounds; - } - - Bail: - return error; - } - - - static FT_Error - pcf_interpret_style( PCF_Face pcf ) - { - FT_Error error = PCF_Err_Ok; - FT_Face face = FT_FACE( pcf ); - FT_Memory memory = face->memory; - - PCF_Property prop; - - int nn, len; - char* strings[4] = { NULL, NULL, NULL, NULL }; - int lengths[4]; - - - face->style_flags = 0; - - prop = pcf_find_property( pcf, "SLANT" ); - if ( prop && prop->isString && - ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' || - *(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) ) - { - face->style_flags |= FT_STYLE_FLAG_ITALIC; - strings[2] = ( *(prop->value.atom) == 'O' || - *(prop->value.atom) == 'o' ) ? (char *)"Oblique" - : (char *)"Italic"; - } - - prop = pcf_find_property( pcf, "WEIGHT_NAME" ); - if ( prop && prop->isString && - ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) ) - { - face->style_flags |= FT_STYLE_FLAG_BOLD; - strings[1] = (char *)"Bold"; - } - - prop = pcf_find_property( pcf, "SETWIDTH_NAME" ); - if ( prop && prop->isString && - *(prop->value.atom) && - !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - strings[3] = (char *)(prop->value.atom); - - prop = pcf_find_property( pcf, "ADD_STYLE_NAME" ); - if ( prop && prop->isString && - *(prop->value.atom) && - !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) - strings[0] = (char *)(prop->value.atom); - - for ( len = 0, nn = 0; nn < 4; nn++ ) - { - lengths[nn] = 0; - if ( strings[nn] ) - { - lengths[nn] = ft_strlen( strings[nn] ); - len += lengths[nn] + 1; - } - } - - if ( len == 0 ) - { - strings[0] = (char *)"Regular"; - lengths[0] = ft_strlen( strings[0] ); - len = lengths[0] + 1; - } - - { - char* s; - - - if ( FT_ALLOC( face->style_name, len ) ) - return error; - - s = face->style_name; - - for ( nn = 0; nn < 4; nn++ ) - { - char* src = strings[nn]; - - - len = lengths[nn]; - - if ( src == NULL ) - continue; - - /* separate elements with a space */ - if ( s != face->style_name ) - *s++ = ' '; - - ft_memcpy( s, src, len ); - - /* need to convert spaces to dashes for */ - /* add_style_name and setwidth_name */ - if ( nn == 0 || nn == 3 ) - { - int mm; - - - for ( mm = 0; mm < len; mm++ ) - if (s[mm] == ' ') - s[mm] = '-'; - } - - s += len; - } - *s = 0; - } - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - pcf_load_font( FT_Stream stream, - PCF_Face face ) - { - FT_Error error = PCF_Err_Ok; - FT_Memory memory = FT_FACE(face)->memory; - FT_Bool hasBDFAccelerators; - - - error = pcf_read_TOC( stream, face ); - if ( error ) - goto Exit; - - error = pcf_get_properties( stream, face ); - if ( error ) - goto Exit; - - /* Use the old accelerators if no BDF accelerators are in the file. */ - hasBDFAccelerators = pcf_has_table_type( face->toc.tables, - face->toc.count, - PCF_BDF_ACCELERATORS ); - if ( !hasBDFAccelerators ) - { - error = pcf_get_accel( stream, face, PCF_ACCELERATORS ); - if ( error ) - goto Exit; - } - - /* metrics */ - error = pcf_get_metrics( stream, face ); - if ( error ) - goto Exit; - - /* bitmaps */ - error = pcf_get_bitmaps( stream, face ); - if ( error ) - goto Exit; - - /* encodings */ - error = pcf_get_encodings( stream, face ); - if ( error ) - goto Exit; - - /* BDF style accelerators (i.e. bounds based on encoded glyphs) */ - if ( hasBDFAccelerators ) - { - error = pcf_get_accel( stream, face, PCF_BDF_ACCELERATORS ); - if ( error ) - goto Exit; - } - - /* XXX: TO DO: inkmetrics and glyph_names are missing */ - - /* now construct the face object */ - { - FT_Face root = FT_FACE( face ); - PCF_Property prop; - - - root->num_faces = 1; - root->face_index = 0; - root->face_flags = FT_FACE_FLAG_FIXED_SIZES | - FT_FACE_FLAG_HORIZONTAL | - FT_FACE_FLAG_FAST_GLYPHS; - - if ( face->accel.constantWidth ) - root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; - - if ( ( error = pcf_interpret_style( face ) ) != 0 ) - goto Exit; - - prop = pcf_find_property( face, "FAMILY_NAME" ); - if ( prop && prop->isString ) - { - if ( FT_STRDUP( root->family_name, prop->value.atom ) ) - goto Exit; - } - else - root->family_name = NULL; - - /* - * Note: We shift all glyph indices by +1 since we must - * respect the convention that glyph 0 always corresponds - * to the `missing glyph'. - * - * This implies bumping the number of `available' glyphs by 1. - */ - root->num_glyphs = face->nmetrics + 1; - - root->num_fixed_sizes = 1; - if ( FT_NEW_ARRAY( root->available_sizes, 1 ) ) - goto Exit; - - { - FT_Bitmap_Size* bsize = root->available_sizes; - FT_Short resolution_x = 0, resolution_y = 0; - - - FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) ); - -#if 0 - bsize->height = face->accel.maxbounds.ascent << 6; -#endif - bsize->height = (FT_Short)( face->accel.fontAscent + - face->accel.fontDescent ); - - prop = pcf_find_property( face, "AVERAGE_WIDTH" ); - if ( prop ) - bsize->width = (FT_Short)( ( prop->value.integer + 5 ) / 10 ); - else - bsize->width = (FT_Short)( bsize->height * 2/3 ); - - prop = pcf_find_property( face, "POINT_SIZE" ); - if ( prop ) - /* convert from 722.7 decipoints to 72 points per inch */ - bsize->size = - (FT_Pos)( ( prop->value.integer * 64 * 7200 + 36135L ) / 72270L ); - - prop = pcf_find_property( face, "PIXEL_SIZE" ); - if ( prop ) - bsize->y_ppem = (FT_Short)prop->value.integer << 6; - - prop = pcf_find_property( face, "RESOLUTION_X" ); - if ( prop ) - resolution_x = (FT_Short)prop->value.integer; - - prop = pcf_find_property( face, "RESOLUTION_Y" ); - if ( prop ) - resolution_y = (FT_Short)prop->value.integer; - - if ( bsize->y_ppem == 0 ) - { - bsize->y_ppem = bsize->size; - if ( resolution_y ) - bsize->y_ppem = bsize->y_ppem * resolution_y / 72; - } - if ( resolution_x && resolution_y ) - bsize->x_ppem = bsize->y_ppem * resolution_x / resolution_y; - else - bsize->x_ppem = bsize->y_ppem; - } - - /* set up charset */ - { - PCF_Property charset_registry = 0, charset_encoding = 0; - - - charset_registry = pcf_find_property( face, "CHARSET_REGISTRY" ); - charset_encoding = pcf_find_property( face, "CHARSET_ENCODING" ); - - if ( charset_registry && charset_registry->isString && - charset_encoding && charset_encoding->isString ) - { - if ( FT_STRDUP( face->charset_encoding, - charset_encoding->value.atom ) || - FT_STRDUP( face->charset_registry, - charset_registry->value.atom ) ) - goto Exit; - } - } - } - - Exit: - if ( error ) - { - /* This is done to respect the behaviour of the original */ - /* PCF font driver. */ - error = PCF_Err_Invalid_File_Format; - } - - return error; - } - - -/* END */ +/* pcfread.c + + FreeType font driver for pcf fonts + + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#include + +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_OBJECTS_H + +#include "pcf.h" +#include "pcfdrivr.h" +#include "pcfread.h" + +#include "pcferror.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_pcfread + + +#if defined( FT_DEBUG_LEVEL_TRACE ) + static const char* const tableNames[] = + { + "prop", "accl", "mtrcs", "bmps", "imtrcs", + "enc", "swidth", "names", "accel" + }; +#endif + + + static + const FT_Frame_Field pcf_toc_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_TocRec + + FT_FRAME_START( 8 ), + FT_FRAME_ULONG_LE( version ), + FT_FRAME_ULONG_LE( count ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_table_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_TableRec + + FT_FRAME_START( 16 ), + FT_FRAME_ULONG_LE( type ), + FT_FRAME_ULONG_LE( format ), + FT_FRAME_ULONG_LE( size ), + FT_FRAME_ULONG_LE( offset ), + FT_FRAME_END + }; + + + static FT_Error + pcf_read_TOC( FT_Stream stream, + PCF_Face face ) + { + FT_Error error; + PCF_Toc toc = &face->toc; + PCF_Table tables; + + FT_Memory memory = FT_FACE(face)->memory; + FT_UInt n; + + + if ( FT_STREAM_SEEK ( 0 ) || + FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) ) + return PCF_Err_Cannot_Open_Resource; + + if ( toc->version != PCF_FILE_VERSION || + toc->count > FT_ARRAY_MAX( face->toc.tables ) || + toc->count == 0 ) + return PCF_Err_Invalid_File_Format; + + if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) ) + return PCF_Err_Out_Of_Memory; + + tables = face->toc.tables; + for ( n = 0; n < toc->count; n++ ) + { + if ( FT_STREAM_READ_FIELDS( pcf_table_header, tables ) ) + goto Exit; + tables++; + } + + /* Sort tables and check for overlaps. Because they are almost */ + /* always ordered already, an in-place bubble sort with simultaneous */ + /* boundary checking seems appropriate. */ + tables = face->toc.tables; + + for ( n = 0; n < toc->count - 1; n++ ) + { + FT_UInt i, have_change; + + + have_change = 0; + + for ( i = 0; i < toc->count - 1 - n; i++ ) + { + PCF_TableRec tmp; + + + if ( tables[i].offset > tables[i + 1].offset ) + { + tmp = tables[i]; + tables[i] = tables[i + 1]; + tables[i + 1] = tmp; + + have_change = 1; + } + + if ( ( tables[i].size > tables[i + 1].offset ) || + ( tables[i].offset > tables[i + 1].offset - tables[i].size ) ) + return PCF_Err_Invalid_Offset; + } + + if ( !have_change ) + break; + } + +#if defined( FT_DEBUG_LEVEL_TRACE ) + + { + FT_UInt i, j; + const char* name = "?"; + + + FT_TRACE4(( "pcf_read_TOC:\n" )); + + FT_TRACE4(( " number of tables: %ld\n", face->toc.count )); + + tables = face->toc.tables; + for ( i = 0; i < toc->count; i++ ) + { + for ( j = 0; j < sizeof ( tableNames ) / sizeof ( tableNames[0] ); + j++ ) + if ( tables[i].type == (FT_UInt)( 1 << j ) ) + name = tableNames[j]; + + FT_TRACE4(( " %d: type=%s, format=0x%X, " + "size=%ld (0x%lX), offset=%ld (0x%lX)\n", + i, name, + tables[i].format, + tables[i].size, tables[i].size, + tables[i].offset, tables[i].offset )); + } + } + +#endif + + return PCF_Err_Ok; + + Exit: + FT_FREE( face->toc.tables ); + return error; + } + + +#define PCF_METRIC_SIZE 12 + + static + const FT_Frame_Field pcf_metric_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_MetricRec + + FT_FRAME_START( PCF_METRIC_SIZE ), + FT_FRAME_SHORT_LE( leftSideBearing ), + FT_FRAME_SHORT_LE( rightSideBearing ), + FT_FRAME_SHORT_LE( characterWidth ), + FT_FRAME_SHORT_LE( ascent ), + FT_FRAME_SHORT_LE( descent ), + FT_FRAME_SHORT_LE( attributes ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_metric_msb_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_MetricRec + + FT_FRAME_START( PCF_METRIC_SIZE ), + FT_FRAME_SHORT( leftSideBearing ), + FT_FRAME_SHORT( rightSideBearing ), + FT_FRAME_SHORT( characterWidth ), + FT_FRAME_SHORT( ascent ), + FT_FRAME_SHORT( descent ), + FT_FRAME_SHORT( attributes ), + FT_FRAME_END + }; + + +#define PCF_COMPRESSED_METRIC_SIZE 5 + + static + const FT_Frame_Field pcf_compressed_metric_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_Compressed_MetricRec + + FT_FRAME_START( PCF_COMPRESSED_METRIC_SIZE ), + FT_FRAME_BYTE( leftSideBearing ), + FT_FRAME_BYTE( rightSideBearing ), + FT_FRAME_BYTE( characterWidth ), + FT_FRAME_BYTE( ascent ), + FT_FRAME_BYTE( descent ), + FT_FRAME_END + }; + + + static FT_Error + pcf_get_metric( FT_Stream stream, + FT_ULong format, + PCF_Metric metric ) + { + FT_Error error = PCF_Err_Ok; + + + if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + { + const FT_Frame_Field* fields; + + + /* parsing normal metrics */ + fields = PCF_BYTE_ORDER( format ) == MSBFirst + ? pcf_metric_msb_header + : pcf_metric_header; + + /* the following sets `error' but doesn't return in case of failure */ + (void)FT_STREAM_READ_FIELDS( fields, metric ); + } + else + { + PCF_Compressed_MetricRec compr; + + + /* parsing compressed metrics */ + if ( FT_STREAM_READ_FIELDS( pcf_compressed_metric_header, &compr ) ) + goto Exit; + + metric->leftSideBearing = (FT_Short)( compr.leftSideBearing - 0x80 ); + metric->rightSideBearing = (FT_Short)( compr.rightSideBearing - 0x80 ); + metric->characterWidth = (FT_Short)( compr.characterWidth - 0x80 ); + metric->ascent = (FT_Short)( compr.ascent - 0x80 ); + metric->descent = (FT_Short)( compr.descent - 0x80 ); + metric->attributes = 0; + } + + Exit: + return error; + } + + + static FT_Error + pcf_seek_to_table_type( FT_Stream stream, + PCF_Table tables, + FT_Int ntables, + FT_ULong type, + FT_ULong *aformat, + FT_ULong *asize ) + { + FT_Error error = PCF_Err_Invalid_File_Format; + FT_Int i; + + + for ( i = 0; i < ntables; i++ ) + if ( tables[i].type == type ) + { + if ( stream->pos > tables[i].offset ) + { + error = PCF_Err_Invalid_Stream_Skip; + goto Fail; + } + + if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) ) + { + error = PCF_Err_Invalid_Stream_Skip; + goto Fail; + } + + *asize = tables[i].size; + *aformat = tables[i].format; + + return PCF_Err_Ok; + } + + Fail: + *asize = 0; + return error; + } + + + static FT_Bool + pcf_has_table_type( PCF_Table tables, + FT_Int ntables, + FT_ULong type ) + { + FT_Int i; + + + for ( i = 0; i < ntables; i++ ) + if ( tables[i].type == type ) + return TRUE; + + return FALSE; + } + + +#define PCF_PROPERTY_SIZE 9 + + static + const FT_Frame_Field pcf_property_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_ParsePropertyRec + + FT_FRAME_START( PCF_PROPERTY_SIZE ), + FT_FRAME_LONG_LE( name ), + FT_FRAME_BYTE ( isString ), + FT_FRAME_LONG_LE( value ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_property_msb_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_ParsePropertyRec + + FT_FRAME_START( PCF_PROPERTY_SIZE ), + FT_FRAME_LONG( name ), + FT_FRAME_BYTE( isString ), + FT_FRAME_LONG( value ), + FT_FRAME_END + }; + + + FT_LOCAL_DEF( PCF_Property ) + pcf_find_property( PCF_Face face, + const FT_String* prop ) + { + PCF_Property properties = face->properties; + FT_Bool found = 0; + int i; + + + for ( i = 0 ; i < face->nprops && !found; i++ ) + { + if ( !ft_strcmp( properties[i].name, prop ) ) + found = 1; + } + + if ( found ) + return properties + i - 1; + else + return NULL; + } + + + static FT_Error + pcf_get_properties( FT_Stream stream, + PCF_Face face ) + { + PCF_ParseProperty props = 0; + PCF_Property properties; + FT_UInt nprops, i; + FT_ULong format, size; + FT_Error error; + FT_Memory memory = FT_FACE(face)->memory; + FT_ULong string_size; + FT_String* strings = 0; + + + error = pcf_seek_to_table_type( stream, + face->toc.tables, + face->toc.count, + PCF_PROPERTIES, + &format, + &size ); + if ( error ) + goto Bail; + + if ( FT_READ_ULONG_LE( format ) ) + goto Bail; + + FT_TRACE4(( "pcf_get_properties:\n" )); + + FT_TRACE4(( " format = %ld\n", format )); + + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + goto Bail; + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)FT_READ_ULONG( nprops ); + else + (void)FT_READ_ULONG_LE( nprops ); + if ( error ) + goto Bail; + + FT_TRACE4(( " nprop = %d\n", nprops )); + + /* rough estimate */ + if ( nprops > size / PCF_PROPERTY_SIZE ) + { + error = PCF_Err_Invalid_Table; + goto Bail; + } + + face->nprops = nprops; + + if ( FT_NEW_ARRAY( props, nprops ) ) + goto Bail; + + for ( i = 0; i < nprops; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + { + if ( FT_STREAM_READ_FIELDS( pcf_property_msb_header, props + i ) ) + goto Bail; + } + else + { + if ( FT_STREAM_READ_FIELDS( pcf_property_header, props + i ) ) + goto Bail; + } + } + + /* pad the property array */ + /* */ + /* clever here - nprops is the same as the number of odd-units read, */ + /* as only isStringProp are odd length (Keith Packard) */ + /* */ + if ( nprops & 3 ) + { + i = 4 - ( nprops & 3 ); + FT_Stream_Skip( stream, i ); + } + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)FT_READ_ULONG( string_size ); + else + (void)FT_READ_ULONG_LE( string_size ); + if ( error ) + goto Bail; + + FT_TRACE4(( " string_size = %ld\n", string_size )); + + /* rough estimate */ + if ( string_size > size - nprops * PCF_PROPERTY_SIZE ) + { + error = PCF_Err_Invalid_Table; + goto Bail; + } + + if ( FT_NEW_ARRAY( strings, string_size ) ) + goto Bail; + + error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size ); + if ( error ) + goto Bail; + + if ( FT_NEW_ARRAY( properties, nprops ) ) + goto Bail; + + face->properties = properties; + + for ( i = 0; i < nprops; i++ ) + { + FT_Long name_offset = props[i].name; + + + if ( ( name_offset < 0 ) || + ( (FT_ULong)name_offset > string_size ) ) + { + error = PCF_Err_Invalid_Offset; + goto Bail; + } + + if ( FT_STRDUP( properties[i].name, strings + name_offset ) ) + goto Bail; + + FT_TRACE4(( " %s:", properties[i].name )); + + properties[i].isString = props[i].isString; + + if ( props[i].isString ) + { + FT_Long value_offset = props[i].value; + + + if ( ( value_offset < 0 ) || + ( (FT_ULong)value_offset > string_size ) ) + { + error = PCF_Err_Invalid_Offset; + goto Bail; + } + + if ( FT_STRDUP( properties[i].value.atom, strings + value_offset ) ) + goto Bail; + + FT_TRACE4(( " `%s'\n", properties[i].value.atom )); + } + else + { + properties[i].value.integer = props[i].value; + + FT_TRACE4(( " %d\n", properties[i].value.integer )); + } + } + + error = PCF_Err_Ok; + + Bail: + FT_FREE( props ); + FT_FREE( strings ); + + return error; + } + + + static FT_Error + pcf_get_metrics( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = PCF_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_ULong format, size; + PCF_Metric metrics = 0; + FT_ULong nmetrics, i; + + + error = pcf_seek_to_table_type( stream, + face->toc.tables, + face->toc.count, + PCF_METRICS, + &format, + &size ); + if ( error ) + return error; + + if ( FT_READ_ULONG_LE( format ) ) + goto Bail; + + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) && + !PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) ) + return PCF_Err_Invalid_File_Format; + + if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)FT_READ_ULONG( nmetrics ); + else + (void)FT_READ_ULONG_LE( nmetrics ); + } + else + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)FT_READ_USHORT( nmetrics ); + else + (void)FT_READ_USHORT_LE( nmetrics ); + } + if ( error ) + return PCF_Err_Invalid_File_Format; + + face->nmetrics = nmetrics; + + FT_TRACE4(( "pcf_get_metrics:\n" )); + + FT_TRACE4(( " number of metrics: %d\n", nmetrics )); + + /* rough estimate */ + if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + { + if ( nmetrics > size / PCF_METRIC_SIZE ) + return PCF_Err_Invalid_Table; + } + else + { + if ( nmetrics > size / PCF_COMPRESSED_METRIC_SIZE ) + return PCF_Err_Invalid_Table; + } + + if ( FT_NEW_ARRAY( face->metrics, nmetrics ) ) + return PCF_Err_Out_Of_Memory; + + metrics = face->metrics; + for ( i = 0; i < nmetrics; i++ ) + { + pcf_get_metric( stream, format, metrics + i ); + + metrics[i].bits = 0; + + FT_TRACE5(( " idx %d: width=%d, " + "lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\n", + i, + ( metrics + i )->characterWidth, + ( metrics + i )->leftSideBearing, + ( metrics + i )->rightSideBearing, + ( metrics + i )->ascent, + ( metrics + i )->descent, + ( metrics + i )->attributes )); + + if ( error ) + break; + } + + if ( error ) + FT_FREE( face->metrics ); + + Bail: + return error; + } + + + static FT_Error + pcf_get_bitmaps( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = PCF_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_Long* offsets; + FT_Long bitmapSizes[GLYPHPADOPTIONS]; + FT_ULong format, size; + int nbitmaps, i, sizebitmaps = 0; + + + error = pcf_seek_to_table_type( stream, + face->toc.tables, + face->toc.count, + PCF_BITMAPS, + &format, + &size ); + if ( error ) + return error; + + error = FT_Stream_EnterFrame( stream, 8 ); + if ( error ) + return error; + + format = FT_GET_ULONG_LE(); + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + nbitmaps = FT_GET_ULONG(); + else + nbitmaps = FT_GET_ULONG_LE(); + + FT_Stream_ExitFrame( stream ); + + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + return PCF_Err_Invalid_File_Format; + + FT_TRACE4(( "pcf_get_bitmaps:\n" )); + + FT_TRACE4(( " number of bitmaps: %d\n", nbitmaps )); + + if ( nbitmaps != face->nmetrics ) + return PCF_Err_Invalid_File_Format; + + if ( FT_NEW_ARRAY( offsets, nbitmaps ) ) + return error; + + for ( i = 0; i < nbitmaps; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)FT_READ_LONG( offsets[i] ); + else + (void)FT_READ_LONG_LE( offsets[i] ); + + FT_TRACE5(( " bitmap %d: offset %ld (0x%lX)\n", + i, offsets[i], offsets[i] )); + } + if ( error ) + goto Bail; + + for ( i = 0; i < GLYPHPADOPTIONS; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)FT_READ_LONG( bitmapSizes[i] ); + else + (void)FT_READ_LONG_LE( bitmapSizes[i] ); + if ( error ) + goto Bail; + + sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )]; + + FT_TRACE4(( " padding %d implies a size of %ld\n", i, bitmapSizes[i] )); + } + + FT_TRACE4(( " %d bitmaps, padding index %ld\n", + nbitmaps, + PCF_GLYPH_PAD_INDEX( format ) )); + FT_TRACE4(( " bitmap size = %d\n", sizebitmaps )); + + FT_UNUSED( sizebitmaps ); /* only used for debugging */ + + for ( i = 0; i < nbitmaps; i++ ) + { + /* rough estimate */ + if ( ( offsets[i] < 0 ) || + ( (FT_ULong)offsets[i] > size ) ) + { + FT_ERROR(( "pcf_get_bitmaps:")); + FT_ERROR(( " invalid offset to bitmap data of glyph %d\n", i )); + } + else + face->metrics[i].bits = stream->pos + offsets[i]; + } + + face->bitmapsFormat = format; + + Bail: + FT_FREE( offsets ); + return error; + } + + + static FT_Error + pcf_get_encodings( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = PCF_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_ULong format, size; + int firstCol, lastCol; + int firstRow, lastRow; + int nencoding, encodingOffset; + int i, j; + PCF_Encoding tmpEncoding, encoding = 0; + + + error = pcf_seek_to_table_type( stream, + face->toc.tables, + face->toc.count, + PCF_BDF_ENCODINGS, + &format, + &size ); + if ( error ) + return error; + + error = FT_Stream_EnterFrame( stream, 14 ); + if ( error ) + return error; + + format = FT_GET_ULONG_LE(); + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + { + firstCol = FT_GET_SHORT(); + lastCol = FT_GET_SHORT(); + firstRow = FT_GET_SHORT(); + lastRow = FT_GET_SHORT(); + face->defaultChar = FT_GET_SHORT(); + } + else + { + firstCol = FT_GET_SHORT_LE(); + lastCol = FT_GET_SHORT_LE(); + firstRow = FT_GET_SHORT_LE(); + lastRow = FT_GET_SHORT_LE(); + face->defaultChar = FT_GET_SHORT_LE(); + } + + FT_Stream_ExitFrame( stream ); + + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + return PCF_Err_Invalid_File_Format; + + FT_TRACE4(( "pdf_get_encodings:\n" )); + + FT_TRACE4(( " firstCol %d, lastCol %d, firstRow %d, lastRow %d\n", + firstCol, lastCol, firstRow, lastRow )); + + nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 ); + + if ( FT_NEW_ARRAY( tmpEncoding, nencoding ) ) + return PCF_Err_Out_Of_Memory; + + error = FT_Stream_EnterFrame( stream, 2 * nencoding ); + if ( error ) + goto Bail; + + for ( i = 0, j = 0 ; i < nencoding; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + encodingOffset = FT_GET_SHORT(); + else + encodingOffset = FT_GET_SHORT_LE(); + + if ( encodingOffset != -1 ) + { + tmpEncoding[j].enc = ( ( ( i / ( lastCol - firstCol + 1 ) ) + + firstRow ) * 256 ) + + ( ( i % ( lastCol - firstCol + 1 ) ) + + firstCol ); + + tmpEncoding[j].glyph = (FT_Short)encodingOffset; + + FT_TRACE5(( " code %d (0x%04X): idx %d\n", + tmpEncoding[j].enc, tmpEncoding[j].enc, + tmpEncoding[j].glyph )); + + j++; + } + } + FT_Stream_ExitFrame( stream ); + + if ( FT_NEW_ARRAY( encoding, j ) ) + goto Bail; + + for ( i = 0; i < j; i++ ) + { + encoding[i].enc = tmpEncoding[i].enc; + encoding[i].glyph = tmpEncoding[i].glyph; + } + + face->nencodings = j; + face->encodings = encoding; + FT_FREE( tmpEncoding ); + + return error; + + Bail: + FT_FREE( encoding ); + FT_FREE( tmpEncoding ); + return error; + } + + + static + const FT_Frame_Field pcf_accel_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_AccelRec + + FT_FRAME_START( 20 ), + FT_FRAME_BYTE ( noOverlap ), + FT_FRAME_BYTE ( constantMetrics ), + FT_FRAME_BYTE ( terminalFont ), + FT_FRAME_BYTE ( constantWidth ), + FT_FRAME_BYTE ( inkInside ), + FT_FRAME_BYTE ( inkMetrics ), + FT_FRAME_BYTE ( drawDirection ), + FT_FRAME_SKIP_BYTES( 1 ), + FT_FRAME_LONG_LE ( fontAscent ), + FT_FRAME_LONG_LE ( fontDescent ), + FT_FRAME_LONG_LE ( maxOverlap ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_accel_msb_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_AccelRec + + FT_FRAME_START( 20 ), + FT_FRAME_BYTE ( noOverlap ), + FT_FRAME_BYTE ( constantMetrics ), + FT_FRAME_BYTE ( terminalFont ), + FT_FRAME_BYTE ( constantWidth ), + FT_FRAME_BYTE ( inkInside ), + FT_FRAME_BYTE ( inkMetrics ), + FT_FRAME_BYTE ( drawDirection ), + FT_FRAME_SKIP_BYTES( 1 ), + FT_FRAME_LONG ( fontAscent ), + FT_FRAME_LONG ( fontDescent ), + FT_FRAME_LONG ( maxOverlap ), + FT_FRAME_END + }; + + + static FT_Error + pcf_get_accel( FT_Stream stream, + PCF_Face face, + FT_ULong type ) + { + FT_ULong format, size; + FT_Error error = PCF_Err_Ok; + PCF_Accel accel = &face->accel; + + + error = pcf_seek_to_table_type( stream, + face->toc.tables, + face->toc.count, + type, + &format, + &size ); + if ( error ) + goto Bail; + + if ( FT_READ_ULONG_LE( format ) ) + goto Bail; + + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) && + !PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ) + goto Bail; + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + { + if ( FT_STREAM_READ_FIELDS( pcf_accel_msb_header, accel ) ) + goto Bail; + } + else + { + if ( FT_STREAM_READ_FIELDS( pcf_accel_header, accel ) ) + goto Bail; + } + + error = pcf_get_metric( stream, + format & ( ~PCF_FORMAT_MASK ), + &(accel->minbounds) ); + if ( error ) + goto Bail; + + error = pcf_get_metric( stream, + format & ( ~PCF_FORMAT_MASK ), + &(accel->maxbounds) ); + if ( error ) + goto Bail; + + if ( PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ) + { + error = pcf_get_metric( stream, + format & ( ~PCF_FORMAT_MASK ), + &(accel->ink_minbounds) ); + if ( error ) + goto Bail; + + error = pcf_get_metric( stream, + format & ( ~PCF_FORMAT_MASK ), + &(accel->ink_maxbounds) ); + if ( error ) + goto Bail; + } + else + { + accel->ink_minbounds = accel->minbounds; /* I'm not sure about this */ + accel->ink_maxbounds = accel->maxbounds; + } + + Bail: + return error; + } + + + static FT_Error + pcf_interpret_style( PCF_Face pcf ) + { + FT_Error error = PCF_Err_Ok; + FT_Face face = FT_FACE( pcf ); + FT_Memory memory = face->memory; + + PCF_Property prop; + + int nn, len; + char* strings[4] = { NULL, NULL, NULL, NULL }; + int lengths[4]; + + + face->style_flags = 0; + + prop = pcf_find_property( pcf, "SLANT" ); + if ( prop && prop->isString && + ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' || + *(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) ) + { + face->style_flags |= FT_STYLE_FLAG_ITALIC; + strings[2] = ( *(prop->value.atom) == 'O' || + *(prop->value.atom) == 'o' ) ? (char *)"Oblique" + : (char *)"Italic"; + } + + prop = pcf_find_property( pcf, "WEIGHT_NAME" ); + if ( prop && prop->isString && + ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) ) + { + face->style_flags |= FT_STYLE_FLAG_BOLD; + strings[1] = (char *)"Bold"; + } + + prop = pcf_find_property( pcf, "SETWIDTH_NAME" ); + if ( prop && prop->isString && + *(prop->value.atom) && + !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) + strings[3] = (char *)(prop->value.atom); + + prop = pcf_find_property( pcf, "ADD_STYLE_NAME" ); + if ( prop && prop->isString && + *(prop->value.atom) && + !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) + strings[0] = (char *)(prop->value.atom); + + for ( len = 0, nn = 0; nn < 4; nn++ ) + { + lengths[nn] = 0; + if ( strings[nn] ) + { + lengths[nn] = ft_strlen( strings[nn] ); + len += lengths[nn] + 1; + } + } + + if ( len == 0 ) + { + strings[0] = (char *)"Regular"; + lengths[0] = ft_strlen( strings[0] ); + len = lengths[0] + 1; + } + + { + char* s; + + + if ( FT_ALLOC( face->style_name, len ) ) + return error; + + s = face->style_name; + + for ( nn = 0; nn < 4; nn++ ) + { + char* src = strings[nn]; + + + len = lengths[nn]; + + if ( src == NULL ) + continue; + + /* separate elements with a space */ + if ( s != face->style_name ) + *s++ = ' '; + + ft_memcpy( s, src, len ); + + /* need to convert spaces to dashes for */ + /* add_style_name and setwidth_name */ + if ( nn == 0 || nn == 3 ) + { + int mm; + + + for ( mm = 0; mm < len; mm++ ) + if (s[mm] == ' ') + s[mm] = '-'; + } + + s += len; + } + *s = 0; + } + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + pcf_load_font( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = PCF_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_Bool hasBDFAccelerators; + + + error = pcf_read_TOC( stream, face ); + if ( error ) + goto Exit; + + error = pcf_get_properties( stream, face ); + if ( error ) + goto Exit; + + /* Use the old accelerators if no BDF accelerators are in the file. */ + hasBDFAccelerators = pcf_has_table_type( face->toc.tables, + face->toc.count, + PCF_BDF_ACCELERATORS ); + if ( !hasBDFAccelerators ) + { + error = pcf_get_accel( stream, face, PCF_ACCELERATORS ); + if ( error ) + goto Exit; + } + + /* metrics */ + error = pcf_get_metrics( stream, face ); + if ( error ) + goto Exit; + + /* bitmaps */ + error = pcf_get_bitmaps( stream, face ); + if ( error ) + goto Exit; + + /* encodings */ + error = pcf_get_encodings( stream, face ); + if ( error ) + goto Exit; + + /* BDF style accelerators (i.e. bounds based on encoded glyphs) */ + if ( hasBDFAccelerators ) + { + error = pcf_get_accel( stream, face, PCF_BDF_ACCELERATORS ); + if ( error ) + goto Exit; + } + + /* XXX: TO DO: inkmetrics and glyph_names are missing */ + + /* now construct the face object */ + { + FT_Face root = FT_FACE( face ); + PCF_Property prop; + + + root->num_faces = 1; + root->face_index = 0; + root->face_flags = FT_FACE_FLAG_FIXED_SIZES | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_FAST_GLYPHS; + + if ( face->accel.constantWidth ) + root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + + if ( ( error = pcf_interpret_style( face ) ) != 0 ) + goto Exit; + + prop = pcf_find_property( face, "FAMILY_NAME" ); + if ( prop && prop->isString ) + { + if ( FT_STRDUP( root->family_name, prop->value.atom ) ) + goto Exit; + } + else + root->family_name = NULL; + + /* + * Note: We shift all glyph indices by +1 since we must + * respect the convention that glyph 0 always corresponds + * to the `missing glyph'. + * + * This implies bumping the number of `available' glyphs by 1. + */ + root->num_glyphs = face->nmetrics + 1; + + root->num_fixed_sizes = 1; + if ( FT_NEW_ARRAY( root->available_sizes, 1 ) ) + goto Exit; + + { + FT_Bitmap_Size* bsize = root->available_sizes; + FT_Short resolution_x = 0, resolution_y = 0; + + + FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) ); + +#if 0 + bsize->height = face->accel.maxbounds.ascent << 6; +#endif + bsize->height = (FT_Short)( face->accel.fontAscent + + face->accel.fontDescent ); + + prop = pcf_find_property( face, "AVERAGE_WIDTH" ); + if ( prop ) + bsize->width = (FT_Short)( ( prop->value.integer + 5 ) / 10 ); + else + bsize->width = (FT_Short)( bsize->height * 2/3 ); + + prop = pcf_find_property( face, "POINT_SIZE" ); + if ( prop ) + /* convert from 722.7 decipoints to 72 points per inch */ + bsize->size = + (FT_Pos)( ( prop->value.integer * 64 * 7200 + 36135L ) / 72270L ); + + prop = pcf_find_property( face, "PIXEL_SIZE" ); + if ( prop ) + bsize->y_ppem = (FT_Short)prop->value.integer << 6; + + prop = pcf_find_property( face, "RESOLUTION_X" ); + if ( prop ) + resolution_x = (FT_Short)prop->value.integer; + + prop = pcf_find_property( face, "RESOLUTION_Y" ); + if ( prop ) + resolution_y = (FT_Short)prop->value.integer; + + if ( bsize->y_ppem == 0 ) + { + bsize->y_ppem = bsize->size; + if ( resolution_y ) + bsize->y_ppem = bsize->y_ppem * resolution_y / 72; + } + if ( resolution_x && resolution_y ) + bsize->x_ppem = bsize->y_ppem * resolution_x / resolution_y; + else + bsize->x_ppem = bsize->y_ppem; + } + + /* set up charset */ + { + PCF_Property charset_registry = 0, charset_encoding = 0; + + + charset_registry = pcf_find_property( face, "CHARSET_REGISTRY" ); + charset_encoding = pcf_find_property( face, "CHARSET_ENCODING" ); + + if ( charset_registry && charset_registry->isString && + charset_encoding && charset_encoding->isString ) + { + if ( FT_STRDUP( face->charset_encoding, + charset_encoding->value.atom ) || + FT_STRDUP( face->charset_registry, + charset_registry->value.atom ) ) + goto Exit; + } + } + } + + Exit: + if ( error ) + { + /* This is done to respect the behaviour of the original */ + /* PCF font driver. */ + error = PCF_Err_Invalid_File_Format; + } + + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcfread.h b/reactos/dll/3rdparty/freetype/src/pcf/pcfread.h index c9524f13464..16991e6a2f1 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcfread.h +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcfread.h @@ -1,45 +1,45 @@ -/* pcfread.h - - FreeType font driver for pcf fonts - - Copyright 2003 by - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#ifndef __PCFREAD_H__ -#define __PCFREAD_H__ - - -#include - -FT_BEGIN_HEADER - - FT_LOCAL( PCF_Property ) - pcf_find_property( PCF_Face face, - const FT_String* prop ); - -FT_END_HEADER - -#endif /* __PCFREAD_H__ */ - - -/* END */ +/* pcfread.h + + FreeType font driver for pcf fonts + + Copyright 2003 by + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#ifndef __PCFREAD_H__ +#define __PCFREAD_H__ + + +#include + +FT_BEGIN_HEADER + + FT_LOCAL( PCF_Property ) + pcf_find_property( PCF_Face face, + const FT_String* prop ); + +FT_END_HEADER + +#endif /* __PCFREAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.c b/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.c index 67ddbe8890b..991b4132989 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.c +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.c @@ -1,104 +1,104 @@ -/* - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ -/* $XFree86: xc/lib/font/util/utilbitmap.c,v 1.3 1999/08/22 08:58:58 dawes Exp $ */ - -/* - * Author: Keith Packard, MIT X Consortium - */ - -/* Modified for use with FreeType */ - - -#include -#include "pcfutil.h" - - - /* - * Invert bit order within each BYTE of an array. - */ - - FT_LOCAL_DEF( void ) - BitOrderInvert( unsigned char* buf, - int nbytes ) - { - for ( ; --nbytes >= 0; buf++ ) - { - unsigned int val = *buf; - - - val = ( ( val >> 1 ) & 0x55 ) | ( ( val << 1 ) & 0xAA ); - val = ( ( val >> 2 ) & 0x33 ) | ( ( val << 2 ) & 0xCC ); - val = ( ( val >> 4 ) & 0x0F ) | ( ( val << 4 ) & 0xF0 ); - - *buf = (unsigned char)val; - } - } - - - /* - * Invert byte order within each 16-bits of an array. - */ - - FT_LOCAL_DEF( void ) - TwoByteSwap( unsigned char* buf, - int nbytes ) - { - unsigned char c; - - - for ( ; nbytes >= 2; nbytes -= 2, buf += 2 ) - { - c = buf[0]; - buf[0] = buf[1]; - buf[1] = c; - } - } - - /* - * Invert byte order within each 32-bits of an array. - */ - - FT_LOCAL_DEF( void ) - FourByteSwap( unsigned char* buf, - int nbytes ) - { - unsigned char c; - - - for ( ; nbytes >= 4; nbytes -= 4, buf += 4 ) - { - c = buf[0]; - buf[0] = buf[3]; - buf[3] = c; - - c = buf[1]; - buf[1] = buf[2]; - buf[2] = c; - } - } - - -/* END */ +/* + +Copyright 1990, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/lib/font/util/utilbitmap.c,v 1.3 1999/08/22 08:58:58 dawes Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +/* Modified for use with FreeType */ + + +#include +#include "pcfutil.h" + + + /* + * Invert bit order within each BYTE of an array. + */ + + FT_LOCAL_DEF( void ) + BitOrderInvert( unsigned char* buf, + int nbytes ) + { + for ( ; --nbytes >= 0; buf++ ) + { + unsigned int val = *buf; + + + val = ( ( val >> 1 ) & 0x55 ) | ( ( val << 1 ) & 0xAA ); + val = ( ( val >> 2 ) & 0x33 ) | ( ( val << 2 ) & 0xCC ); + val = ( ( val >> 4 ) & 0x0F ) | ( ( val << 4 ) & 0xF0 ); + + *buf = (unsigned char)val; + } + } + + + /* + * Invert byte order within each 16-bits of an array. + */ + + FT_LOCAL_DEF( void ) + TwoByteSwap( unsigned char* buf, + int nbytes ) + { + unsigned char c; + + + for ( ; nbytes >= 2; nbytes -= 2, buf += 2 ) + { + c = buf[0]; + buf[0] = buf[1]; + buf[1] = c; + } + } + + /* + * Invert byte order within each 32-bits of an array. + */ + + FT_LOCAL_DEF( void ) + FourByteSwap( unsigned char* buf, + int nbytes ) + { + unsigned char c; + + + for ( ; nbytes >= 4; nbytes -= 4, buf += 4 ) + { + c = buf[0]; + buf[0] = buf[3]; + buf[3] = c; + + c = buf[1]; + buf[1] = buf[2]; + buf[2] = c; + } + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.h b/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.h index 1557be3e800..dbdd99de7e8 100644 --- a/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.h +++ b/reactos/dll/3rdparty/freetype/src/pcf/pcfutil.h @@ -1,55 +1,55 @@ -/* pcfutil.h - - FreeType font driver for pcf fonts - - Copyright 2000, 2001, 2004 by - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - - -#ifndef __PCFUTIL_H__ -#define __PCFUTIL_H__ - - -#include -#include FT_CONFIG_CONFIG_H - - -FT_BEGIN_HEADER - - FT_LOCAL( void ) - BitOrderInvert( unsigned char* buf, - int nbytes ); - - FT_LOCAL( void ) - TwoByteSwap( unsigned char* buf, - int nbytes ); - - FT_LOCAL( void ) - FourByteSwap( unsigned char* buf, - int nbytes ); - -FT_END_HEADER - -#endif /* __PCFUTIL_H__ */ - - -/* END */ +/* pcfutil.h + + FreeType font driver for pcf fonts + + Copyright 2000, 2001, 2004 by + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#ifndef __PCFUTIL_H__ +#define __PCFUTIL_H__ + + +#include +#include FT_CONFIG_CONFIG_H + + +FT_BEGIN_HEADER + + FT_LOCAL( void ) + BitOrderInvert( unsigned char* buf, + int nbytes ); + + FT_LOCAL( void ) + TwoByteSwap( unsigned char* buf, + int nbytes ); + + FT_LOCAL( void ) + FourByteSwap( unsigned char* buf, + int nbytes ); + +FT_END_HEADER + +#endif /* __PCFUTIL_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfr.c b/reactos/dll/3rdparty/freetype/src/pfr/pfr.c index eb2c4edb7ec..a771d3b898d 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfr.c +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfr.c @@ -1,29 +1,29 @@ -/***************************************************************************/ -/* */ -/* pfr.c */ -/* */ -/* FreeType PFR driver component. */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include - -#include "pfrload.c" -#include "pfrgload.c" -#include "pfrcmap.c" -#include "pfrobjs.c" -#include "pfrdrivr.c" -#include "pfrsbit.c" - -/* END */ +/***************************************************************************/ +/* */ +/* pfr.c */ +/* */ +/* FreeType PFR driver component. */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include + +#include "pfrload.c" +#include "pfrgload.c" +#include "pfrcmap.c" +#include "pfrobjs.c" +#include "pfrdrivr.c" +#include "pfrsbit.c" + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.c b/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.c index c8faee04364..2e5792dfbc0 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.c +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.c @@ -1,163 +1,163 @@ -/***************************************************************************/ -/* */ -/* pfrcmap.c */ -/* */ -/* FreeType PFR cmap handling (body). */ -/* */ -/* Copyright 2002, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "pfrcmap.h" -#include "pfrobjs.h" -#include FT_INTERNAL_DEBUG_H - - - FT_CALLBACK_DEF( FT_Error ) - pfr_cmap_init( PFR_CMap cmap ) - { - FT_Error error = PFR_Err_Ok; - PFR_Face face = (PFR_Face)FT_CMAP_FACE( cmap ); - - - cmap->num_chars = face->phy_font.num_chars; - cmap->chars = face->phy_font.chars; - - /* just for safety, check that the character entries are correctly */ - /* sorted in increasing character code order */ - { - FT_UInt n; - - - for ( n = 1; n < cmap->num_chars; n++ ) - { - if ( cmap->chars[n - 1].char_code >= cmap->chars[n].char_code ) - { - error = PFR_Err_Invalid_Table; - goto Exit; - } - } - } - - Exit: - return error; - } - - - FT_CALLBACK_DEF( void ) - pfr_cmap_done( PFR_CMap cmap ) - { - cmap->chars = NULL; - cmap->num_chars = 0; - } - - - FT_CALLBACK_DEF( FT_UInt ) - pfr_cmap_char_index( PFR_CMap cmap, - FT_UInt32 char_code ) - { - FT_UInt min = 0; - FT_UInt max = cmap->num_chars; - FT_UInt mid; - PFR_Char gchar; - - - while ( min < max ) - { - mid = min + ( max - min ) / 2; - gchar = cmap->chars + mid; - - if ( gchar->char_code == char_code ) - return mid + 1; - - if ( gchar->char_code < char_code ) - min = mid + 1; - else - max = mid; - } - return 0; - } - - - FT_CALLBACK_DEF( FT_UInt ) - pfr_cmap_char_next( PFR_CMap cmap, - FT_UInt32 *pchar_code ) - { - FT_UInt result = 0; - FT_UInt32 char_code = *pchar_code + 1; - - - Restart: - { - FT_UInt min = 0; - FT_UInt max = cmap->num_chars; - FT_UInt mid; - PFR_Char gchar; - - - while ( min < max ) - { - mid = min + ( ( max - min ) >> 1 ); - gchar = cmap->chars + mid; - - if ( gchar->char_code == char_code ) - { - result = mid; - if ( result != 0 ) - { - result++; - goto Exit; - } - - char_code++; - goto Restart; - } - - if ( gchar->char_code < char_code ) - min = mid+1; - else - max = mid; - } - - /* we didn't find it, but we have a pair just above it */ - char_code = 0; - - if ( min < cmap->num_chars ) - { - gchar = cmap->chars + min; - result = min; - if ( result != 0 ) - { - result++; - char_code = gchar->char_code; - } - } - } - - Exit: - *pchar_code = char_code; - return result; - } - - - FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec - pfr_cmap_class_rec = - { - sizeof ( PFR_CMapRec ), - - (FT_CMap_InitFunc) pfr_cmap_init, - (FT_CMap_DoneFunc) pfr_cmap_done, - (FT_CMap_CharIndexFunc)pfr_cmap_char_index, - (FT_CMap_CharNextFunc) pfr_cmap_char_next - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrcmap.c */ +/* */ +/* FreeType PFR cmap handling (body). */ +/* */ +/* Copyright 2002, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "pfrcmap.h" +#include "pfrobjs.h" +#include FT_INTERNAL_DEBUG_H + + + FT_CALLBACK_DEF( FT_Error ) + pfr_cmap_init( PFR_CMap cmap ) + { + FT_Error error = PFR_Err_Ok; + PFR_Face face = (PFR_Face)FT_CMAP_FACE( cmap ); + + + cmap->num_chars = face->phy_font.num_chars; + cmap->chars = face->phy_font.chars; + + /* just for safety, check that the character entries are correctly */ + /* sorted in increasing character code order */ + { + FT_UInt n; + + + for ( n = 1; n < cmap->num_chars; n++ ) + { + if ( cmap->chars[n - 1].char_code >= cmap->chars[n].char_code ) + { + error = PFR_Err_Invalid_Table; + goto Exit; + } + } + } + + Exit: + return error; + } + + + FT_CALLBACK_DEF( void ) + pfr_cmap_done( PFR_CMap cmap ) + { + cmap->chars = NULL; + cmap->num_chars = 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + pfr_cmap_char_index( PFR_CMap cmap, + FT_UInt32 char_code ) + { + FT_UInt min = 0; + FT_UInt max = cmap->num_chars; + FT_UInt mid; + PFR_Char gchar; + + + while ( min < max ) + { + mid = min + ( max - min ) / 2; + gchar = cmap->chars + mid; + + if ( gchar->char_code == char_code ) + return mid + 1; + + if ( gchar->char_code < char_code ) + min = mid + 1; + else + max = mid; + } + return 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + pfr_cmap_char_next( PFR_CMap cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt result = 0; + FT_UInt32 char_code = *pchar_code + 1; + + + Restart: + { + FT_UInt min = 0; + FT_UInt max = cmap->num_chars; + FT_UInt mid; + PFR_Char gchar; + + + while ( min < max ) + { + mid = min + ( ( max - min ) >> 1 ); + gchar = cmap->chars + mid; + + if ( gchar->char_code == char_code ) + { + result = mid; + if ( result != 0 ) + { + result++; + goto Exit; + } + + char_code++; + goto Restart; + } + + if ( gchar->char_code < char_code ) + min = mid+1; + else + max = mid; + } + + /* we didn't find it, but we have a pair just above it */ + char_code = 0; + + if ( min < cmap->num_chars ) + { + gchar = cmap->chars + min; + result = min; + if ( result != 0 ) + { + result++; + char_code = gchar->char_code; + } + } + } + + Exit: + *pchar_code = char_code; + return result; + } + + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec + pfr_cmap_class_rec = + { + sizeof ( PFR_CMapRec ), + + (FT_CMap_InitFunc) pfr_cmap_init, + (FT_CMap_DoneFunc) pfr_cmap_done, + (FT_CMap_CharIndexFunc)pfr_cmap_char_index, + (FT_CMap_CharNextFunc) pfr_cmap_char_next + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.h index a6269530543..f5d0bd04d8a 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrcmap.h @@ -1,46 +1,46 @@ -/***************************************************************************/ -/* */ -/* pfrcmap.h */ -/* */ -/* FreeType PFR cmap handling (specification). */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PFRCMAP_H__ -#define __PFRCMAP_H__ - -#include -#include FT_INTERNAL_OBJECTS_H -#include "pfrtypes.h" - - -FT_BEGIN_HEADER - - typedef struct PFR_CMapRec_ - { - FT_CMapRec cmap; - FT_UInt num_chars; - PFR_Char chars; - - } PFR_CMapRec, *PFR_CMap; - - - FT_CALLBACK_TABLE const FT_CMap_ClassRec pfr_cmap_class_rec; - -FT_END_HEADER - - -#endif /* __PFRCMAP_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrcmap.h */ +/* */ +/* FreeType PFR cmap handling (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFRCMAP_H__ +#define __PFRCMAP_H__ + +#include +#include FT_INTERNAL_OBJECTS_H +#include "pfrtypes.h" + + +FT_BEGIN_HEADER + + typedef struct PFR_CMapRec_ + { + FT_CMapRec cmap; + FT_UInt num_chars; + PFR_Char chars; + + } PFR_CMapRec, *PFR_CMap; + + + FT_CALLBACK_TABLE const FT_CMap_ClassRec pfr_cmap_class_rec; + +FT_END_HEADER + + +#endif /* __PFRCMAP_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.c b/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.c index 40206720efb..a51f0f7a6ad 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.c +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.c @@ -1,207 +1,207 @@ -/***************************************************************************/ -/* */ -/* pfrdrivr.c */ -/* */ -/* FreeType PFR driver interface (body). */ -/* */ -/* Copyright 2002, 2003, 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_SERVICE_PFR_H -#include FT_SERVICE_XFREE86_NAME_H -#include "pfrdrivr.h" -#include "pfrobjs.h" - -#include "pfrerror.h" - - - FT_CALLBACK_DEF( FT_Error ) - pfr_get_kerning( FT_Face pfrface, /* PFR_Face */ - FT_UInt left, - FT_UInt right, - FT_Vector *avector ) - { - PFR_Face face = (PFR_Face)pfrface; - PFR_PhyFont phys = &face->phy_font; - - - pfr_face_get_kerning( pfrface, left, right, avector ); - - /* convert from metrics to outline units when necessary */ - if ( phys->outline_resolution != phys->metrics_resolution ) - { - if ( avector->x != 0 ) - avector->x = FT_MulDiv( avector->x, phys->outline_resolution, - phys->metrics_resolution ); - - if ( avector->y != 0 ) - avector->y = FT_MulDiv( avector->x, phys->outline_resolution, - phys->metrics_resolution ); - } - - return PFR_Err_Ok; - } - - - /* - * PFR METRICS SERVICE - * - */ - - FT_CALLBACK_DEF( FT_Error ) - pfr_get_advance( FT_Face pfrface, /* PFR_Face */ - FT_UInt gindex, - FT_Pos *anadvance ) - { - PFR_Face face = (PFR_Face)pfrface; - FT_Error error = PFR_Err_Bad_Argument; - - - *anadvance = 0; - if ( face ) - { - PFR_PhyFont phys = &face->phy_font; - - - if ( gindex < phys->num_chars ) - { - *anadvance = phys->chars[gindex].advance; - error = 0; - } - } - - return error; - } - - - FT_CALLBACK_DEF( FT_Error ) - pfr_get_metrics( FT_Face pfrface, /* PFR_Face */ - FT_UInt *anoutline_resolution, - FT_UInt *ametrics_resolution, - FT_Fixed *ametrics_x_scale, - FT_Fixed *ametrics_y_scale ) - { - PFR_Face face = (PFR_Face)pfrface; - PFR_PhyFont phys = &face->phy_font; - FT_Fixed x_scale, y_scale; - FT_Size size = face->root.size; - - - if ( anoutline_resolution ) - *anoutline_resolution = phys->outline_resolution; - - if ( ametrics_resolution ) - *ametrics_resolution = phys->metrics_resolution; - - x_scale = 0x10000L; - y_scale = 0x10000L; - - if ( size ) - { - x_scale = FT_DivFix( size->metrics.x_ppem << 6, - phys->metrics_resolution ); - - y_scale = FT_DivFix( size->metrics.y_ppem << 6, - phys->metrics_resolution ); - } - - if ( ametrics_x_scale ) - *ametrics_x_scale = x_scale; - - if ( ametrics_y_scale ) - *ametrics_y_scale = y_scale; - - return PFR_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const FT_Service_PfrMetricsRec pfr_metrics_service_rec = - { - pfr_get_metrics, - pfr_face_get_kerning, - pfr_get_advance - }; - - - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec pfr_services[] = - { - { FT_SERVICE_ID_PFR_METRICS, &pfr_metrics_service_rec }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PFR }, - { NULL, NULL } - }; - - - FT_CALLBACK_DEF( FT_Module_Interface ) - pfr_get_service( FT_Module module, - const FT_String* service_id ) - { - FT_UNUSED( module ); - - return ft_service_list_lookup( pfr_services, service_id ); - } - - - FT_CALLBACK_TABLE_DEF - const FT_Driver_ClassRec pfr_driver_class = - { - { - FT_MODULE_FONT_DRIVER | - FT_MODULE_DRIVER_SCALABLE, - - sizeof( FT_DriverRec ), - - "pfr", - 0x10000L, - 0x20000L, - - NULL, - - 0, - 0, - pfr_get_service - }, - - sizeof( PFR_FaceRec ), - sizeof( PFR_SizeRec ), - sizeof( PFR_SlotRec ), - - pfr_face_init, - pfr_face_done, - 0, /* FT_Size_InitFunc */ - 0, /* FT_Size_DoneFunc */ - pfr_slot_init, - pfr_slot_done, - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif - pfr_slot_load, - - pfr_get_kerning, - 0, /* FT_Face_AttachFunc */ - 0, /* FT_Face_GetAdvancesFunc */ - 0, /* FT_Size_RequestFunc */ - 0, /* FT_Size_SelectFunc */ - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrdrivr.c */ +/* */ +/* FreeType PFR driver interface (body). */ +/* */ +/* Copyright 2002, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_SERVICE_PFR_H +#include FT_SERVICE_XFREE86_NAME_H +#include "pfrdrivr.h" +#include "pfrobjs.h" + +#include "pfrerror.h" + + + FT_CALLBACK_DEF( FT_Error ) + pfr_get_kerning( FT_Face pfrface, /* PFR_Face */ + FT_UInt left, + FT_UInt right, + FT_Vector *avector ) + { + PFR_Face face = (PFR_Face)pfrface; + PFR_PhyFont phys = &face->phy_font; + + + pfr_face_get_kerning( pfrface, left, right, avector ); + + /* convert from metrics to outline units when necessary */ + if ( phys->outline_resolution != phys->metrics_resolution ) + { + if ( avector->x != 0 ) + avector->x = FT_MulDiv( avector->x, phys->outline_resolution, + phys->metrics_resolution ); + + if ( avector->y != 0 ) + avector->y = FT_MulDiv( avector->x, phys->outline_resolution, + phys->metrics_resolution ); + } + + return PFR_Err_Ok; + } + + + /* + * PFR METRICS SERVICE + * + */ + + FT_CALLBACK_DEF( FT_Error ) + pfr_get_advance( FT_Face pfrface, /* PFR_Face */ + FT_UInt gindex, + FT_Pos *anadvance ) + { + PFR_Face face = (PFR_Face)pfrface; + FT_Error error = PFR_Err_Bad_Argument; + + + *anadvance = 0; + if ( face ) + { + PFR_PhyFont phys = &face->phy_font; + + + if ( gindex < phys->num_chars ) + { + *anadvance = phys->chars[gindex].advance; + error = 0; + } + } + + return error; + } + + + FT_CALLBACK_DEF( FT_Error ) + pfr_get_metrics( FT_Face pfrface, /* PFR_Face */ + FT_UInt *anoutline_resolution, + FT_UInt *ametrics_resolution, + FT_Fixed *ametrics_x_scale, + FT_Fixed *ametrics_y_scale ) + { + PFR_Face face = (PFR_Face)pfrface; + PFR_PhyFont phys = &face->phy_font; + FT_Fixed x_scale, y_scale; + FT_Size size = face->root.size; + + + if ( anoutline_resolution ) + *anoutline_resolution = phys->outline_resolution; + + if ( ametrics_resolution ) + *ametrics_resolution = phys->metrics_resolution; + + x_scale = 0x10000L; + y_scale = 0x10000L; + + if ( size ) + { + x_scale = FT_DivFix( size->metrics.x_ppem << 6, + phys->metrics_resolution ); + + y_scale = FT_DivFix( size->metrics.y_ppem << 6, + phys->metrics_resolution ); + } + + if ( ametrics_x_scale ) + *ametrics_x_scale = x_scale; + + if ( ametrics_y_scale ) + *ametrics_y_scale = y_scale; + + return PFR_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const FT_Service_PfrMetricsRec pfr_metrics_service_rec = + { + pfr_get_metrics, + pfr_face_get_kerning, + pfr_get_advance + }; + + + /* + * SERVICE LIST + * + */ + + static const FT_ServiceDescRec pfr_services[] = + { + { FT_SERVICE_ID_PFR_METRICS, &pfr_metrics_service_rec }, + { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PFR }, + { NULL, NULL } + }; + + + FT_CALLBACK_DEF( FT_Module_Interface ) + pfr_get_service( FT_Module module, + const FT_String* service_id ) + { + FT_UNUSED( module ); + + return ft_service_list_lookup( pfr_services, service_id ); + } + + + FT_CALLBACK_TABLE_DEF + const FT_Driver_ClassRec pfr_driver_class = + { + { + FT_MODULE_FONT_DRIVER | + FT_MODULE_DRIVER_SCALABLE, + + sizeof( FT_DriverRec ), + + "pfr", + 0x10000L, + 0x20000L, + + NULL, + + 0, + 0, + pfr_get_service + }, + + sizeof( PFR_FaceRec ), + sizeof( PFR_SizeRec ), + sizeof( PFR_SlotRec ), + + pfr_face_init, + pfr_face_done, + 0, /* FT_Size_InitFunc */ + 0, /* FT_Size_DoneFunc */ + pfr_slot_init, + pfr_slot_done, + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + ft_stub_set_char_sizes, + ft_stub_set_pixel_sizes, +#endif + pfr_slot_load, + + pfr_get_kerning, + 0, /* FT_Face_AttachFunc */ + 0, /* FT_Face_GetAdvancesFunc */ + 0, /* FT_Size_RequestFunc */ + 0, /* FT_Size_SelectFunc */ + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.h index 36f1205b772..8226fc0735b 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrdrivr.h @@ -1,39 +1,39 @@ -/***************************************************************************/ -/* */ -/* pfrdrivr.h */ -/* */ -/* High-level Type PFR driver interface (specification). */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PFRDRIVR_H__ -#define __PFRDRIVR_H__ - - -#include -#include FT_INTERNAL_DRIVER_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Driver_ClassRec ) pfr_driver_class; - - -FT_END_HEADER - - -#endif /* __PFRDRIVR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrdrivr.h */ +/* */ +/* High-level Type PFR driver interface (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFRDRIVR_H__ +#define __PFRDRIVR_H__ + + +#include +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Driver_ClassRec ) pfr_driver_class; + + +FT_END_HEADER + + +#endif /* __PFRDRIVR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrerror.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrerror.h index 2e1c401dd23..3ba08a7c44a 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrerror.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrerror.h @@ -1,40 +1,40 @@ -/***************************************************************************/ -/* */ -/* pfrerror.h */ -/* */ -/* PFR error codes (specification only). */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the PFR error enumeration constants. */ - /* */ - /*************************************************************************/ - -#ifndef __PFRERROR_H__ -#define __PFRERROR_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX PFR_Err_ -#define FT_ERR_BASE FT_Mod_Err_PFR - -#include FT_ERRORS_H - -#endif /* __PFRERROR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrerror.h */ +/* */ +/* PFR error codes (specification only). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the PFR error enumeration constants. */ + /* */ + /*************************************************************************/ + +#ifndef __PFRERROR_H__ +#define __PFRERROR_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX PFR_Err_ +#define FT_ERR_BASE FT_Mod_Err_PFR + +#include FT_ERRORS_H + +#endif /* __PFRERROR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.c b/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.c index 3bb173302d4..f5d2da7902d 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.c +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.c @@ -1,828 +1,828 @@ -/***************************************************************************/ -/* */ -/* pfrgload.c */ -/* */ -/* FreeType PFR glyph loader (body). */ -/* */ -/* Copyright 2002, 2003, 2005, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "pfrgload.h" -#include "pfrsbit.h" -#include "pfrload.h" /* for macro definitions */ -#include FT_INTERNAL_DEBUG_H - -#include "pfrerror.h" - -#undef FT_COMPONENT -#define FT_COMPONENT trace_pfr - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PFR GLYPH BUILDER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - FT_LOCAL_DEF( void ) - pfr_glyph_init( PFR_Glyph glyph, - FT_GlyphLoader loader ) - { - FT_ZERO( glyph ); - - glyph->loader = loader; - glyph->path_begun = 0; - - FT_GlyphLoader_Rewind( loader ); - } - - - FT_LOCAL_DEF( void ) - pfr_glyph_done( PFR_Glyph glyph ) - { - FT_Memory memory = glyph->loader->memory; - - - FT_FREE( glyph->x_control ); - glyph->y_control = NULL; - - glyph->max_xy_control = 0; -#if 0 - glyph->num_x_control = 0; - glyph->num_y_control = 0; -#endif - - FT_FREE( glyph->subs ); - - glyph->max_subs = 0; - glyph->num_subs = 0; - - glyph->loader = NULL; - glyph->path_begun = 0; - } - - - /* close current contour, if any */ - static void - pfr_glyph_close_contour( PFR_Glyph glyph ) - { - FT_GlyphLoader loader = glyph->loader; - FT_Outline* outline = &loader->current.outline; - FT_Int last, first; - - - if ( !glyph->path_begun ) - return; - - /* compute first and last point indices in current glyph outline */ - last = outline->n_points - 1; - first = 0; - if ( outline->n_contours > 0 ) - first = outline->contours[outline->n_contours - 1]; - - /* if the last point falls on the same location than the first one */ - /* we need to delete it */ - if ( last > first ) - { - FT_Vector* p1 = outline->points + first; - FT_Vector* p2 = outline->points + last; - - - if ( p1->x == p2->x && p1->y == p2->y ) - { - outline->n_points--; - last--; - } - } - - /* don't add empty contours */ - if ( last >= first ) - outline->contours[outline->n_contours++] = (short)last; - - glyph->path_begun = 0; - } - - - /* reset glyph to start the loading of a new glyph */ - static void - pfr_glyph_start( PFR_Glyph glyph ) - { - glyph->path_begun = 0; - } - - - static FT_Error - pfr_glyph_line_to( PFR_Glyph glyph, - FT_Vector* to ) - { - FT_GlyphLoader loader = glyph->loader; - FT_Outline* outline = &loader->current.outline; - FT_Error error; - - - /* check that we have begun a new path */ - if ( !glyph->path_begun ) - { - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" )); - goto Exit; - } - - error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 0 ); - if ( !error ) - { - FT_UInt n = outline->n_points; - - - outline->points[n] = *to; - outline->tags [n] = FT_CURVE_TAG_ON; - - outline->n_points++; - } - - Exit: - return error; - } - - - static FT_Error - pfr_glyph_curve_to( PFR_Glyph glyph, - FT_Vector* control1, - FT_Vector* control2, - FT_Vector* to ) - { - FT_GlyphLoader loader = glyph->loader; - FT_Outline* outline = &loader->current.outline; - FT_Error error; - - - /* check that we have begun a new path */ - if ( !glyph->path_begun ) - { - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" )); - goto Exit; - } - - error = FT_GLYPHLOADER_CHECK_POINTS( loader, 3, 0 ); - if ( !error ) - { - FT_Vector* vec = outline->points + outline->n_points; - FT_Byte* tag = (FT_Byte*)outline->tags + outline->n_points; - - - vec[0] = *control1; - vec[1] = *control2; - vec[2] = *to; - tag[0] = FT_CURVE_TAG_CUBIC; - tag[1] = FT_CURVE_TAG_CUBIC; - tag[2] = FT_CURVE_TAG_ON; - - outline->n_points = (FT_Short)( outline->n_points + 3 ); - } - - Exit: - return error; - } - - - static FT_Error - pfr_glyph_move_to( PFR_Glyph glyph, - FT_Vector* to ) - { - FT_GlyphLoader loader = glyph->loader; - FT_Error error; - - - /* close current contour if any */ - pfr_glyph_close_contour( glyph ); - - /* indicate that a new contour has started */ - glyph->path_begun = 1; - - /* check that there is space for a new contour and a new point */ - error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 1 ); - if ( !error ) - /* add new start point */ - error = pfr_glyph_line_to( glyph, to ); - - return error; - } - - - static void - pfr_glyph_end( PFR_Glyph glyph ) - { - /* close current contour if any */ - pfr_glyph_close_contour( glyph ); - - /* merge the current glyph into the stack */ - FT_GlyphLoader_Add( glyph->loader ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PFR GLYPH LOADER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /* load a simple glyph */ - static FT_Error - pfr_glyph_load_simple( PFR_Glyph glyph, - FT_Byte* p, - FT_Byte* limit ) - { - FT_Error error = 0; - FT_Memory memory = glyph->loader->memory; - FT_UInt flags, x_count, y_count, i, count, mask; - FT_Int x; - - - PFR_CHECK( 1 ); - flags = PFR_NEXT_BYTE( p ); - - /* test for composite glyphs */ - if ( flags & PFR_GLYPH_IS_COMPOUND ) - goto Failure; - - x_count = 0; - y_count = 0; - - if ( flags & PFR_GLYPH_1BYTE_XYCOUNT ) - { - PFR_CHECK( 1 ); - count = PFR_NEXT_BYTE( p ); - x_count = ( count & 15 ); - y_count = ( count >> 4 ); - } - else - { - if ( flags & PFR_GLYPH_XCOUNT ) - { - PFR_CHECK( 1 ); - x_count = PFR_NEXT_BYTE( p ); - } - - if ( flags & PFR_GLYPH_YCOUNT ) - { - PFR_CHECK( 1 ); - y_count = PFR_NEXT_BYTE( p ); - } - } - - count = x_count + y_count; - - /* re-allocate array when necessary */ - if ( count > glyph->max_xy_control ) - { - FT_UInt new_max = FT_PAD_CEIL( count, 8 ); - - - if ( FT_RENEW_ARRAY( glyph->x_control, - glyph->max_xy_control, - new_max ) ) - goto Exit; - - glyph->max_xy_control = new_max; - } - - glyph->y_control = glyph->x_control + x_count; - - mask = 0; - x = 0; - - for ( i = 0; i < count; i++ ) - { - if ( ( i & 7 ) == 0 ) - { - PFR_CHECK( 1 ); - mask = PFR_NEXT_BYTE( p ); - } - - if ( mask & 1 ) - { - PFR_CHECK( 2 ); - x = PFR_NEXT_SHORT( p ); - } - else - { - PFR_CHECK( 1 ); - x += PFR_NEXT_BYTE( p ); - } - - glyph->x_control[i] = x; - - mask >>= 1; - } - - /* XXX: for now we ignore the secondary stroke and edge definitions */ - /* since we don't want to support native PFR hinting */ - /* */ - if ( flags & PFR_GLYPH_EXTRA_ITEMS ) - { - error = pfr_extra_items_skip( &p, limit ); - if ( error ) - goto Exit; - } - - pfr_glyph_start( glyph ); - - /* now load a simple glyph */ - { - FT_Vector pos[4]; - FT_Vector* cur; - - - pos[0].x = pos[0].y = 0; - pos[3] = pos[0]; - - for (;;) - { - FT_UInt format, format_low, args_format = 0, args_count, n; - - - /***************************************************************/ - /* read instruction */ - /* */ - PFR_CHECK( 1 ); - format = PFR_NEXT_BYTE( p ); - format_low = format & 15; - - switch ( format >> 4 ) - { - case 0: /* end glyph */ - FT_TRACE6(( "- end glyph" )); - args_count = 0; - break; - - case 1: /* general line operation */ - FT_TRACE6(( "- general line" )); - goto Line1; - - case 4: /* move to inside contour */ - FT_TRACE6(( "- move to inside" )); - goto Line1; - - case 5: /* move to outside contour */ - FT_TRACE6(( "- move to outside" )); - Line1: - args_format = format_low; - args_count = 1; - break; - - case 2: /* horizontal line to */ - FT_TRACE6(( "- horizontal line to cx.%d", format_low )); - if ( format_low > x_count ) - goto Failure; - pos[0].x = glyph->x_control[format_low]; - pos[0].y = pos[3].y; - pos[3] = pos[0]; - args_count = 0; - break; - - case 3: /* vertical line to */ - FT_TRACE6(( "- vertical line to cy.%d", format_low )); - if ( format_low > y_count ) - goto Failure; - pos[0].x = pos[3].x; - pos[0].y = glyph->y_control[format_low]; - pos[3] = pos[0]; - args_count = 0; - break; - - case 6: /* horizontal to vertical curve */ - FT_TRACE6(( "- hv curve " )); - args_format = 0xB8E; - args_count = 3; - break; - - case 7: /* vertical to horizontal curve */ - FT_TRACE6(( "- vh curve" )); - args_format = 0xE2B; - args_count = 3; - break; - - default: /* general curve to */ - FT_TRACE6(( "- general curve" )); - args_count = 4; - args_format = format_low; - } - - /***********************************************************/ - /* now read arguments */ - /* */ - cur = pos; - for ( n = 0; n < args_count; n++ ) - { - FT_UInt idx; - FT_Int delta; - - - /* read the X argument */ - switch ( args_format & 3 ) - { - case 0: /* 8-bit index */ - PFR_CHECK( 1 ); - idx = PFR_NEXT_BYTE( p ); - if ( idx > x_count ) - goto Failure; - cur->x = glyph->x_control[idx]; - FT_TRACE7(( " cx#%d", idx )); - break; - - case 1: /* 16-bit value */ - PFR_CHECK( 2 ); - cur->x = PFR_NEXT_SHORT( p ); - FT_TRACE7(( " x.%d", cur->x )); - break; - - case 2: /* 8-bit delta */ - PFR_CHECK( 1 ); - delta = PFR_NEXT_INT8( p ); - cur->x = pos[3].x + delta; - FT_TRACE7(( " dx.%d", delta )); - break; - - default: - FT_TRACE7(( " |" )); - cur->x = pos[3].x; - } - - /* read the Y argument */ - switch ( ( args_format >> 2 ) & 3 ) - { - case 0: /* 8-bit index */ - PFR_CHECK( 1 ); - idx = PFR_NEXT_BYTE( p ); - if ( idx > y_count ) - goto Failure; - cur->y = glyph->y_control[idx]; - FT_TRACE7(( " cy#%d", idx )); - break; - - case 1: /* 16-bit absolute value */ - PFR_CHECK( 2 ); - cur->y = PFR_NEXT_SHORT( p ); - FT_TRACE7(( " y.%d", cur->y )); - break; - - case 2: /* 8-bit delta */ - PFR_CHECK( 1 ); - delta = PFR_NEXT_INT8( p ); - cur->y = pos[3].y + delta; - FT_TRACE7(( " dy.%d", delta )); - break; - - default: - FT_TRACE7(( " -" )); - cur->y = pos[3].y; - } - - /* read the additional format flag for the general curve */ - if ( n == 0 && args_count == 4 ) - { - PFR_CHECK( 1 ); - args_format = PFR_NEXT_BYTE( p ); - args_count--; - } - else - args_format >>= 4; - - /* save the previous point */ - pos[3] = cur[0]; - cur++; - } - - FT_TRACE7(( "\n" )); - - /***********************************************************/ - /* finally, execute instruction */ - /* */ - switch ( format >> 4 ) - { - case 0: /* end glyph => EXIT */ - pfr_glyph_end( glyph ); - goto Exit; - - case 1: /* line operations */ - case 2: - case 3: - error = pfr_glyph_line_to( glyph, pos ); - goto Test_Error; - - case 4: /* move to inside contour */ - case 5: /* move to outside contour */ - error = pfr_glyph_move_to( glyph, pos ); - goto Test_Error; - - default: /* curve operations */ - error = pfr_glyph_curve_to( glyph, pos, pos + 1, pos + 2 ); - - Test_Error: /* test error condition */ - if ( error ) - goto Exit; - } - } /* for (;;) */ - } - - Exit: - return error; - - Failure: - Too_Short: - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_glyph_load_simple: invalid glyph data\n" )); - goto Exit; - } - - - /* load a composite/compound glyph */ - static FT_Error - pfr_glyph_load_compound( PFR_Glyph glyph, - FT_Byte* p, - FT_Byte* limit ) - { - FT_Error error = 0; - FT_GlyphLoader loader = glyph->loader; - FT_Memory memory = loader->memory; - PFR_SubGlyph subglyph; - FT_UInt flags, i, count, org_count; - FT_Int x_pos, y_pos; - - - PFR_CHECK( 1 ); - flags = PFR_NEXT_BYTE( p ); - - /* test for composite glyphs */ - if ( !( flags & PFR_GLYPH_IS_COMPOUND ) ) - goto Failure; - - count = flags & 0x3F; - - /* ignore extra items when present */ - /* */ - if ( flags & PFR_GLYPH_EXTRA_ITEMS ) - { - error = pfr_extra_items_skip( &p, limit ); - if (error) goto Exit; - } - - /* we can't rely on the FT_GlyphLoader to load sub-glyphs, because */ - /* the PFR format is dumb, using direct file offsets to point to the */ - /* sub-glyphs (instead of glyph indices). Sigh. */ - /* */ - /* For now, we load the list of sub-glyphs into a different array */ - /* but this will prevent us from using the auto-hinter at its best */ - /* quality. */ - /* */ - org_count = glyph->num_subs; - - if ( org_count + count > glyph->max_subs ) - { - FT_UInt new_max = ( org_count + count + 3 ) & -4; - - - if ( FT_RENEW_ARRAY( glyph->subs, glyph->max_subs, new_max ) ) - goto Exit; - - glyph->max_subs = new_max; - } - - subglyph = glyph->subs + org_count; - - for ( i = 0; i < count; i++, subglyph++ ) - { - FT_UInt format; - - - x_pos = 0; - y_pos = 0; - - PFR_CHECK( 1 ); - format = PFR_NEXT_BYTE( p ); - - /* read scale when available */ - subglyph->x_scale = 0x10000L; - if ( format & PFR_SUBGLYPH_XSCALE ) - { - PFR_CHECK( 2 ); - subglyph->x_scale = PFR_NEXT_SHORT( p ) << 4; - } - - subglyph->y_scale = 0x10000L; - if ( format & PFR_SUBGLYPH_YSCALE ) - { - PFR_CHECK( 2 ); - subglyph->y_scale = PFR_NEXT_SHORT( p ) << 4; - } - - /* read offset */ - switch ( format & 3 ) - { - case 1: - PFR_CHECK( 2 ); - x_pos = PFR_NEXT_SHORT( p ); - break; - - case 2: - PFR_CHECK( 1 ); - x_pos += PFR_NEXT_INT8( p ); - break; - - default: - ; - } - - switch ( ( format >> 2 ) & 3 ) - { - case 1: - PFR_CHECK( 2 ); - y_pos = PFR_NEXT_SHORT( p ); - break; - - case 2: - PFR_CHECK( 1 ); - y_pos += PFR_NEXT_INT8( p ); - break; - - default: - ; - } - - subglyph->x_delta = x_pos; - subglyph->y_delta = y_pos; - - /* read glyph position and size now */ - if ( format & PFR_SUBGLYPH_2BYTE_SIZE ) - { - PFR_CHECK( 2 ); - subglyph->gps_size = PFR_NEXT_USHORT( p ); - } - else - { - PFR_CHECK( 1 ); - subglyph->gps_size = PFR_NEXT_BYTE( p ); - } - - if ( format & PFR_SUBGLYPH_3BYTE_OFFSET ) - { - PFR_CHECK( 3 ); - subglyph->gps_offset = PFR_NEXT_LONG( p ); - } - else - { - PFR_CHECK( 2 ); - subglyph->gps_offset = PFR_NEXT_USHORT( p ); - } - - glyph->num_subs++; - } - - Exit: - return error; - - Failure: - Too_Short: - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_glyph_load_compound: invalid glyph data\n" )); - goto Exit; - } - - - static FT_Error - pfr_glyph_load_rec( PFR_Glyph glyph, - FT_Stream stream, - FT_ULong gps_offset, - FT_ULong offset, - FT_ULong size ) - { - FT_Error error; - FT_Byte* p; - FT_Byte* limit; - - - if ( FT_STREAM_SEEK( gps_offset + offset ) || - FT_FRAME_ENTER( size ) ) - goto Exit; - - p = (FT_Byte*)stream->cursor; - limit = p + size; - - if ( size > 0 && *p & PFR_GLYPH_IS_COMPOUND ) - { - FT_Int n, old_count, count; - FT_GlyphLoader loader = glyph->loader; - FT_Outline* base = &loader->base.outline; - - - old_count = glyph->num_subs; - - /* this is a compound glyph - load it */ - error = pfr_glyph_load_compound( glyph, p, limit ); - - FT_FRAME_EXIT(); - - if ( error ) - goto Exit; - - count = glyph->num_subs - old_count; - - /* now, load each individual glyph */ - for ( n = 0; n < count; n++ ) - { - FT_Int i, old_points, num_points; - PFR_SubGlyph subglyph; - - - subglyph = glyph->subs + old_count + n; - old_points = base->n_points; - - error = pfr_glyph_load_rec( glyph, stream, gps_offset, - subglyph->gps_offset, - subglyph->gps_size ); - if ( error ) - goto Exit; - - /* note that `glyph->subs' might have been re-allocated */ - subglyph = glyph->subs + old_count + n; - num_points = base->n_points - old_points; - - /* translate and eventually scale the new glyph points */ - if ( subglyph->x_scale != 0x10000L || subglyph->y_scale != 0x10000L ) - { - FT_Vector* vec = base->points + old_points; - - - for ( i = 0; i < num_points; i++, vec++ ) - { - vec->x = FT_MulFix( vec->x, subglyph->x_scale ) + - subglyph->x_delta; - vec->y = FT_MulFix( vec->y, subglyph->y_scale ) + - subglyph->y_delta; - } - } - else - { - FT_Vector* vec = loader->base.outline.points + old_points; - - - for ( i = 0; i < num_points; i++, vec++ ) - { - vec->x += subglyph->x_delta; - vec->y += subglyph->y_delta; - } - } - - /* proceed to next sub-glyph */ - } - } - else - { - /* load a simple glyph */ - error = pfr_glyph_load_simple( glyph, p, limit ); - - FT_FRAME_EXIT(); - } - - Exit: - return error; - } - - - - - - FT_LOCAL_DEF( FT_Error ) - pfr_glyph_load( PFR_Glyph glyph, - FT_Stream stream, - FT_ULong gps_offset, - FT_ULong offset, - FT_ULong size ) - { - /* initialize glyph loader */ - FT_GlyphLoader_Rewind( glyph->loader ); - - glyph->num_subs = 0; - - /* load the glyph, recursively when needed */ - return pfr_glyph_load_rec( glyph, stream, gps_offset, offset, size ); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrgload.c */ +/* */ +/* FreeType PFR glyph loader (body). */ +/* */ +/* Copyright 2002, 2003, 2005, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "pfrgload.h" +#include "pfrsbit.h" +#include "pfrload.h" /* for macro definitions */ +#include FT_INTERNAL_DEBUG_H + +#include "pfrerror.h" + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pfr + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PFR GLYPH BUILDER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_LOCAL_DEF( void ) + pfr_glyph_init( PFR_Glyph glyph, + FT_GlyphLoader loader ) + { + FT_ZERO( glyph ); + + glyph->loader = loader; + glyph->path_begun = 0; + + FT_GlyphLoader_Rewind( loader ); + } + + + FT_LOCAL_DEF( void ) + pfr_glyph_done( PFR_Glyph glyph ) + { + FT_Memory memory = glyph->loader->memory; + + + FT_FREE( glyph->x_control ); + glyph->y_control = NULL; + + glyph->max_xy_control = 0; +#if 0 + glyph->num_x_control = 0; + glyph->num_y_control = 0; +#endif + + FT_FREE( glyph->subs ); + + glyph->max_subs = 0; + glyph->num_subs = 0; + + glyph->loader = NULL; + glyph->path_begun = 0; + } + + + /* close current contour, if any */ + static void + pfr_glyph_close_contour( PFR_Glyph glyph ) + { + FT_GlyphLoader loader = glyph->loader; + FT_Outline* outline = &loader->current.outline; + FT_Int last, first; + + + if ( !glyph->path_begun ) + return; + + /* compute first and last point indices in current glyph outline */ + last = outline->n_points - 1; + first = 0; + if ( outline->n_contours > 0 ) + first = outline->contours[outline->n_contours - 1]; + + /* if the last point falls on the same location than the first one */ + /* we need to delete it */ + if ( last > first ) + { + FT_Vector* p1 = outline->points + first; + FT_Vector* p2 = outline->points + last; + + + if ( p1->x == p2->x && p1->y == p2->y ) + { + outline->n_points--; + last--; + } + } + + /* don't add empty contours */ + if ( last >= first ) + outline->contours[outline->n_contours++] = (short)last; + + glyph->path_begun = 0; + } + + + /* reset glyph to start the loading of a new glyph */ + static void + pfr_glyph_start( PFR_Glyph glyph ) + { + glyph->path_begun = 0; + } + + + static FT_Error + pfr_glyph_line_to( PFR_Glyph glyph, + FT_Vector* to ) + { + FT_GlyphLoader loader = glyph->loader; + FT_Outline* outline = &loader->current.outline; + FT_Error error; + + + /* check that we have begun a new path */ + if ( !glyph->path_begun ) + { + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" )); + goto Exit; + } + + error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 0 ); + if ( !error ) + { + FT_UInt n = outline->n_points; + + + outline->points[n] = *to; + outline->tags [n] = FT_CURVE_TAG_ON; + + outline->n_points++; + } + + Exit: + return error; + } + + + static FT_Error + pfr_glyph_curve_to( PFR_Glyph glyph, + FT_Vector* control1, + FT_Vector* control2, + FT_Vector* to ) + { + FT_GlyphLoader loader = glyph->loader; + FT_Outline* outline = &loader->current.outline; + FT_Error error; + + + /* check that we have begun a new path */ + if ( !glyph->path_begun ) + { + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" )); + goto Exit; + } + + error = FT_GLYPHLOADER_CHECK_POINTS( loader, 3, 0 ); + if ( !error ) + { + FT_Vector* vec = outline->points + outline->n_points; + FT_Byte* tag = (FT_Byte*)outline->tags + outline->n_points; + + + vec[0] = *control1; + vec[1] = *control2; + vec[2] = *to; + tag[0] = FT_CURVE_TAG_CUBIC; + tag[1] = FT_CURVE_TAG_CUBIC; + tag[2] = FT_CURVE_TAG_ON; + + outline->n_points = (FT_Short)( outline->n_points + 3 ); + } + + Exit: + return error; + } + + + static FT_Error + pfr_glyph_move_to( PFR_Glyph glyph, + FT_Vector* to ) + { + FT_GlyphLoader loader = glyph->loader; + FT_Error error; + + + /* close current contour if any */ + pfr_glyph_close_contour( glyph ); + + /* indicate that a new contour has started */ + glyph->path_begun = 1; + + /* check that there is space for a new contour and a new point */ + error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 1 ); + if ( !error ) + /* add new start point */ + error = pfr_glyph_line_to( glyph, to ); + + return error; + } + + + static void + pfr_glyph_end( PFR_Glyph glyph ) + { + /* close current contour if any */ + pfr_glyph_close_contour( glyph ); + + /* merge the current glyph into the stack */ + FT_GlyphLoader_Add( glyph->loader ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PFR GLYPH LOADER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /* load a simple glyph */ + static FT_Error + pfr_glyph_load_simple( PFR_Glyph glyph, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Error error = 0; + FT_Memory memory = glyph->loader->memory; + FT_UInt flags, x_count, y_count, i, count, mask; + FT_Int x; + + + PFR_CHECK( 1 ); + flags = PFR_NEXT_BYTE( p ); + + /* test for composite glyphs */ + if ( flags & PFR_GLYPH_IS_COMPOUND ) + goto Failure; + + x_count = 0; + y_count = 0; + + if ( flags & PFR_GLYPH_1BYTE_XYCOUNT ) + { + PFR_CHECK( 1 ); + count = PFR_NEXT_BYTE( p ); + x_count = ( count & 15 ); + y_count = ( count >> 4 ); + } + else + { + if ( flags & PFR_GLYPH_XCOUNT ) + { + PFR_CHECK( 1 ); + x_count = PFR_NEXT_BYTE( p ); + } + + if ( flags & PFR_GLYPH_YCOUNT ) + { + PFR_CHECK( 1 ); + y_count = PFR_NEXT_BYTE( p ); + } + } + + count = x_count + y_count; + + /* re-allocate array when necessary */ + if ( count > glyph->max_xy_control ) + { + FT_UInt new_max = FT_PAD_CEIL( count, 8 ); + + + if ( FT_RENEW_ARRAY( glyph->x_control, + glyph->max_xy_control, + new_max ) ) + goto Exit; + + glyph->max_xy_control = new_max; + } + + glyph->y_control = glyph->x_control + x_count; + + mask = 0; + x = 0; + + for ( i = 0; i < count; i++ ) + { + if ( ( i & 7 ) == 0 ) + { + PFR_CHECK( 1 ); + mask = PFR_NEXT_BYTE( p ); + } + + if ( mask & 1 ) + { + PFR_CHECK( 2 ); + x = PFR_NEXT_SHORT( p ); + } + else + { + PFR_CHECK( 1 ); + x += PFR_NEXT_BYTE( p ); + } + + glyph->x_control[i] = x; + + mask >>= 1; + } + + /* XXX: for now we ignore the secondary stroke and edge definitions */ + /* since we don't want to support native PFR hinting */ + /* */ + if ( flags & PFR_GLYPH_EXTRA_ITEMS ) + { + error = pfr_extra_items_skip( &p, limit ); + if ( error ) + goto Exit; + } + + pfr_glyph_start( glyph ); + + /* now load a simple glyph */ + { + FT_Vector pos[4]; + FT_Vector* cur; + + + pos[0].x = pos[0].y = 0; + pos[3] = pos[0]; + + for (;;) + { + FT_UInt format, format_low, args_format = 0, args_count, n; + + + /***************************************************************/ + /* read instruction */ + /* */ + PFR_CHECK( 1 ); + format = PFR_NEXT_BYTE( p ); + format_low = format & 15; + + switch ( format >> 4 ) + { + case 0: /* end glyph */ + FT_TRACE6(( "- end glyph" )); + args_count = 0; + break; + + case 1: /* general line operation */ + FT_TRACE6(( "- general line" )); + goto Line1; + + case 4: /* move to inside contour */ + FT_TRACE6(( "- move to inside" )); + goto Line1; + + case 5: /* move to outside contour */ + FT_TRACE6(( "- move to outside" )); + Line1: + args_format = format_low; + args_count = 1; + break; + + case 2: /* horizontal line to */ + FT_TRACE6(( "- horizontal line to cx.%d", format_low )); + if ( format_low > x_count ) + goto Failure; + pos[0].x = glyph->x_control[format_low]; + pos[0].y = pos[3].y; + pos[3] = pos[0]; + args_count = 0; + break; + + case 3: /* vertical line to */ + FT_TRACE6(( "- vertical line to cy.%d", format_low )); + if ( format_low > y_count ) + goto Failure; + pos[0].x = pos[3].x; + pos[0].y = glyph->y_control[format_low]; + pos[3] = pos[0]; + args_count = 0; + break; + + case 6: /* horizontal to vertical curve */ + FT_TRACE6(( "- hv curve " )); + args_format = 0xB8E; + args_count = 3; + break; + + case 7: /* vertical to horizontal curve */ + FT_TRACE6(( "- vh curve" )); + args_format = 0xE2B; + args_count = 3; + break; + + default: /* general curve to */ + FT_TRACE6(( "- general curve" )); + args_count = 4; + args_format = format_low; + } + + /***********************************************************/ + /* now read arguments */ + /* */ + cur = pos; + for ( n = 0; n < args_count; n++ ) + { + FT_UInt idx; + FT_Int delta; + + + /* read the X argument */ + switch ( args_format & 3 ) + { + case 0: /* 8-bit index */ + PFR_CHECK( 1 ); + idx = PFR_NEXT_BYTE( p ); + if ( idx > x_count ) + goto Failure; + cur->x = glyph->x_control[idx]; + FT_TRACE7(( " cx#%d", idx )); + break; + + case 1: /* 16-bit value */ + PFR_CHECK( 2 ); + cur->x = PFR_NEXT_SHORT( p ); + FT_TRACE7(( " x.%d", cur->x )); + break; + + case 2: /* 8-bit delta */ + PFR_CHECK( 1 ); + delta = PFR_NEXT_INT8( p ); + cur->x = pos[3].x + delta; + FT_TRACE7(( " dx.%d", delta )); + break; + + default: + FT_TRACE7(( " |" )); + cur->x = pos[3].x; + } + + /* read the Y argument */ + switch ( ( args_format >> 2 ) & 3 ) + { + case 0: /* 8-bit index */ + PFR_CHECK( 1 ); + idx = PFR_NEXT_BYTE( p ); + if ( idx > y_count ) + goto Failure; + cur->y = glyph->y_control[idx]; + FT_TRACE7(( " cy#%d", idx )); + break; + + case 1: /* 16-bit absolute value */ + PFR_CHECK( 2 ); + cur->y = PFR_NEXT_SHORT( p ); + FT_TRACE7(( " y.%d", cur->y )); + break; + + case 2: /* 8-bit delta */ + PFR_CHECK( 1 ); + delta = PFR_NEXT_INT8( p ); + cur->y = pos[3].y + delta; + FT_TRACE7(( " dy.%d", delta )); + break; + + default: + FT_TRACE7(( " -" )); + cur->y = pos[3].y; + } + + /* read the additional format flag for the general curve */ + if ( n == 0 && args_count == 4 ) + { + PFR_CHECK( 1 ); + args_format = PFR_NEXT_BYTE( p ); + args_count--; + } + else + args_format >>= 4; + + /* save the previous point */ + pos[3] = cur[0]; + cur++; + } + + FT_TRACE7(( "\n" )); + + /***********************************************************/ + /* finally, execute instruction */ + /* */ + switch ( format >> 4 ) + { + case 0: /* end glyph => EXIT */ + pfr_glyph_end( glyph ); + goto Exit; + + case 1: /* line operations */ + case 2: + case 3: + error = pfr_glyph_line_to( glyph, pos ); + goto Test_Error; + + case 4: /* move to inside contour */ + case 5: /* move to outside contour */ + error = pfr_glyph_move_to( glyph, pos ); + goto Test_Error; + + default: /* curve operations */ + error = pfr_glyph_curve_to( glyph, pos, pos + 1, pos + 2 ); + + Test_Error: /* test error condition */ + if ( error ) + goto Exit; + } + } /* for (;;) */ + } + + Exit: + return error; + + Failure: + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_glyph_load_simple: invalid glyph data\n" )); + goto Exit; + } + + + /* load a composite/compound glyph */ + static FT_Error + pfr_glyph_load_compound( PFR_Glyph glyph, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Error error = 0; + FT_GlyphLoader loader = glyph->loader; + FT_Memory memory = loader->memory; + PFR_SubGlyph subglyph; + FT_UInt flags, i, count, org_count; + FT_Int x_pos, y_pos; + + + PFR_CHECK( 1 ); + flags = PFR_NEXT_BYTE( p ); + + /* test for composite glyphs */ + if ( !( flags & PFR_GLYPH_IS_COMPOUND ) ) + goto Failure; + + count = flags & 0x3F; + + /* ignore extra items when present */ + /* */ + if ( flags & PFR_GLYPH_EXTRA_ITEMS ) + { + error = pfr_extra_items_skip( &p, limit ); + if (error) goto Exit; + } + + /* we can't rely on the FT_GlyphLoader to load sub-glyphs, because */ + /* the PFR format is dumb, using direct file offsets to point to the */ + /* sub-glyphs (instead of glyph indices). Sigh. */ + /* */ + /* For now, we load the list of sub-glyphs into a different array */ + /* but this will prevent us from using the auto-hinter at its best */ + /* quality. */ + /* */ + org_count = glyph->num_subs; + + if ( org_count + count > glyph->max_subs ) + { + FT_UInt new_max = ( org_count + count + 3 ) & -4; + + + if ( FT_RENEW_ARRAY( glyph->subs, glyph->max_subs, new_max ) ) + goto Exit; + + glyph->max_subs = new_max; + } + + subglyph = glyph->subs + org_count; + + for ( i = 0; i < count; i++, subglyph++ ) + { + FT_UInt format; + + + x_pos = 0; + y_pos = 0; + + PFR_CHECK( 1 ); + format = PFR_NEXT_BYTE( p ); + + /* read scale when available */ + subglyph->x_scale = 0x10000L; + if ( format & PFR_SUBGLYPH_XSCALE ) + { + PFR_CHECK( 2 ); + subglyph->x_scale = PFR_NEXT_SHORT( p ) << 4; + } + + subglyph->y_scale = 0x10000L; + if ( format & PFR_SUBGLYPH_YSCALE ) + { + PFR_CHECK( 2 ); + subglyph->y_scale = PFR_NEXT_SHORT( p ) << 4; + } + + /* read offset */ + switch ( format & 3 ) + { + case 1: + PFR_CHECK( 2 ); + x_pos = PFR_NEXT_SHORT( p ); + break; + + case 2: + PFR_CHECK( 1 ); + x_pos += PFR_NEXT_INT8( p ); + break; + + default: + ; + } + + switch ( ( format >> 2 ) & 3 ) + { + case 1: + PFR_CHECK( 2 ); + y_pos = PFR_NEXT_SHORT( p ); + break; + + case 2: + PFR_CHECK( 1 ); + y_pos += PFR_NEXT_INT8( p ); + break; + + default: + ; + } + + subglyph->x_delta = x_pos; + subglyph->y_delta = y_pos; + + /* read glyph position and size now */ + if ( format & PFR_SUBGLYPH_2BYTE_SIZE ) + { + PFR_CHECK( 2 ); + subglyph->gps_size = PFR_NEXT_USHORT( p ); + } + else + { + PFR_CHECK( 1 ); + subglyph->gps_size = PFR_NEXT_BYTE( p ); + } + + if ( format & PFR_SUBGLYPH_3BYTE_OFFSET ) + { + PFR_CHECK( 3 ); + subglyph->gps_offset = PFR_NEXT_LONG( p ); + } + else + { + PFR_CHECK( 2 ); + subglyph->gps_offset = PFR_NEXT_USHORT( p ); + } + + glyph->num_subs++; + } + + Exit: + return error; + + Failure: + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_glyph_load_compound: invalid glyph data\n" )); + goto Exit; + } + + + static FT_Error + pfr_glyph_load_rec( PFR_Glyph glyph, + FT_Stream stream, + FT_ULong gps_offset, + FT_ULong offset, + FT_ULong size ) + { + FT_Error error; + FT_Byte* p; + FT_Byte* limit; + + + if ( FT_STREAM_SEEK( gps_offset + offset ) || + FT_FRAME_ENTER( size ) ) + goto Exit; + + p = (FT_Byte*)stream->cursor; + limit = p + size; + + if ( size > 0 && *p & PFR_GLYPH_IS_COMPOUND ) + { + FT_Int n, old_count, count; + FT_GlyphLoader loader = glyph->loader; + FT_Outline* base = &loader->base.outline; + + + old_count = glyph->num_subs; + + /* this is a compound glyph - load it */ + error = pfr_glyph_load_compound( glyph, p, limit ); + + FT_FRAME_EXIT(); + + if ( error ) + goto Exit; + + count = glyph->num_subs - old_count; + + /* now, load each individual glyph */ + for ( n = 0; n < count; n++ ) + { + FT_Int i, old_points, num_points; + PFR_SubGlyph subglyph; + + + subglyph = glyph->subs + old_count + n; + old_points = base->n_points; + + error = pfr_glyph_load_rec( glyph, stream, gps_offset, + subglyph->gps_offset, + subglyph->gps_size ); + if ( error ) + goto Exit; + + /* note that `glyph->subs' might have been re-allocated */ + subglyph = glyph->subs + old_count + n; + num_points = base->n_points - old_points; + + /* translate and eventually scale the new glyph points */ + if ( subglyph->x_scale != 0x10000L || subglyph->y_scale != 0x10000L ) + { + FT_Vector* vec = base->points + old_points; + + + for ( i = 0; i < num_points; i++, vec++ ) + { + vec->x = FT_MulFix( vec->x, subglyph->x_scale ) + + subglyph->x_delta; + vec->y = FT_MulFix( vec->y, subglyph->y_scale ) + + subglyph->y_delta; + } + } + else + { + FT_Vector* vec = loader->base.outline.points + old_points; + + + for ( i = 0; i < num_points; i++, vec++ ) + { + vec->x += subglyph->x_delta; + vec->y += subglyph->y_delta; + } + } + + /* proceed to next sub-glyph */ + } + } + else + { + /* load a simple glyph */ + error = pfr_glyph_load_simple( glyph, p, limit ); + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + + + + + + FT_LOCAL_DEF( FT_Error ) + pfr_glyph_load( PFR_Glyph glyph, + FT_Stream stream, + FT_ULong gps_offset, + FT_ULong offset, + FT_ULong size ) + { + /* initialize glyph loader */ + FT_GlyphLoader_Rewind( glyph->loader ); + + glyph->num_subs = 0; + + /* load the glyph, recursively when needed */ + return pfr_glyph_load_rec( glyph, stream, gps_offset, offset, size ); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.h index 7cc7a8702a4..204204d547f 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrgload.h @@ -1,49 +1,49 @@ -/***************************************************************************/ -/* */ -/* pfrgload.h */ -/* */ -/* FreeType PFR glyph loader (specification). */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PFRGLOAD_H__ -#define __PFRGLOAD_H__ - -#include "pfrtypes.h" - -FT_BEGIN_HEADER - - - FT_LOCAL( void ) - pfr_glyph_init( PFR_Glyph glyph, - FT_GlyphLoader loader ); - - FT_LOCAL( void ) - pfr_glyph_done( PFR_Glyph glyph ); - - - FT_LOCAL( FT_Error ) - pfr_glyph_load( PFR_Glyph glyph, - FT_Stream stream, - FT_ULong gps_offset, - FT_ULong offset, - FT_ULong size ); - - -FT_END_HEADER - - -#endif /* __PFRGLOAD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrgload.h */ +/* */ +/* FreeType PFR glyph loader (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFRGLOAD_H__ +#define __PFRGLOAD_H__ + +#include "pfrtypes.h" + +FT_BEGIN_HEADER + + + FT_LOCAL( void ) + pfr_glyph_init( PFR_Glyph glyph, + FT_GlyphLoader loader ); + + FT_LOCAL( void ) + pfr_glyph_done( PFR_Glyph glyph ); + + + FT_LOCAL( FT_Error ) + pfr_glyph_load( PFR_Glyph glyph, + FT_Stream stream, + FT_ULong gps_offset, + FT_ULong offset, + FT_ULong size ); + + +FT_END_HEADER + + +#endif /* __PFRGLOAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrload.c b/reactos/dll/3rdparty/freetype/src/pfr/pfrload.c index 1ee2c1f8c8b..d3cc421b035 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrload.c +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrload.c @@ -1,938 +1,938 @@ -/***************************************************************************/ -/* */ -/* pfrload.c */ -/* */ -/* FreeType PFR loader (body). */ -/* */ -/* Copyright 2002, 2003, 2004, 2005, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "pfrload.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H - -#include "pfrerror.h" - -#undef FT_COMPONENT -#define FT_COMPONENT trace_pfr - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** EXTRA ITEMS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - FT_LOCAL_DEF( FT_Error ) - pfr_extra_items_skip( FT_Byte* *pp, - FT_Byte* limit ) - { - return pfr_extra_items_parse( pp, limit, NULL, NULL ); - } - - - FT_LOCAL_DEF( FT_Error ) - pfr_extra_items_parse( FT_Byte* *pp, - FT_Byte* limit, - PFR_ExtraItem item_list, - FT_Pointer item_data ) - { - FT_Error error = 0; - FT_Byte* p = *pp; - FT_UInt num_items, item_type, item_size; - - - PFR_CHECK( 1 ); - num_items = PFR_NEXT_BYTE( p ); - - for ( ; num_items > 0; num_items-- ) - { - PFR_CHECK( 2 ); - item_size = PFR_NEXT_BYTE( p ); - item_type = PFR_NEXT_BYTE( p ); - - PFR_CHECK( item_size ); - - if ( item_list ) - { - PFR_ExtraItem extra = item_list; - - - for ( extra = item_list; extra->parser != NULL; extra++ ) - { - if ( extra->type == item_type ) - { - error = extra->parser( p, p + item_size, item_data ); - if ( error ) goto Exit; - - break; - } - } - } - - p += item_size; - } - - Exit: - *pp = p; - return error; - - Too_Short: - FT_ERROR(( "pfr_extra_items_parse: invalid extra items table\n" )); - error = PFR_Err_Invalid_Table; - goto Exit; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PFR HEADER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static const FT_Frame_Field pfr_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE PFR_HeaderRec - - FT_FRAME_START( 58 ), - FT_FRAME_ULONG ( signature ), - FT_FRAME_USHORT( version ), - FT_FRAME_USHORT( signature2 ), - FT_FRAME_USHORT( header_size ), - - FT_FRAME_USHORT( log_dir_size ), - FT_FRAME_USHORT( log_dir_offset ), - - FT_FRAME_USHORT( log_font_max_size ), - FT_FRAME_UOFF3 ( log_font_section_size ), - FT_FRAME_UOFF3 ( log_font_section_offset ), - - FT_FRAME_USHORT( phy_font_max_size ), - FT_FRAME_UOFF3 ( phy_font_section_size ), - FT_FRAME_UOFF3 ( phy_font_section_offset ), - - FT_FRAME_USHORT( gps_max_size ), - FT_FRAME_UOFF3 ( gps_section_size ), - FT_FRAME_UOFF3 ( gps_section_offset ), - - FT_FRAME_BYTE ( max_blue_values ), - FT_FRAME_BYTE ( max_x_orus ), - FT_FRAME_BYTE ( max_y_orus ), - - FT_FRAME_BYTE ( phy_font_max_size_high ), - FT_FRAME_BYTE ( color_flags ), - - FT_FRAME_UOFF3 ( bct_max_size ), - FT_FRAME_UOFF3 ( bct_set_max_size ), - FT_FRAME_UOFF3 ( phy_bct_set_max_size ), - - FT_FRAME_USHORT( num_phy_fonts ), - FT_FRAME_BYTE ( max_vert_stem_snap ), - FT_FRAME_BYTE ( max_horz_stem_snap ), - FT_FRAME_USHORT( max_chars ), - FT_FRAME_END - }; - - - FT_LOCAL_DEF( FT_Error ) - pfr_header_load( PFR_Header header, - FT_Stream stream ) - { - FT_Error error; - - - /* read header directly */ - if ( !FT_STREAM_SEEK( 0 ) && - !FT_STREAM_READ_FIELDS( pfr_header_fields, header ) ) - { - /* make a few adjustments to the header */ - header->phy_font_max_size += - (FT_UInt32)header->phy_font_max_size_high << 16; - } - - return error; - } - - - FT_LOCAL_DEF( FT_Bool ) - pfr_header_check( PFR_Header header ) - { - FT_Bool result = 1; - - - /* check signature and header size */ - if ( header->signature != 0x50465230L || /* "PFR0" */ - header->version > 4 || - header->header_size < 58 || - header->signature2 != 0x0d0a ) /* CR/LF */ - { - result = 0; - } - return result; - } - - - /***********************************************************************/ - /***********************************************************************/ - /***** *****/ - /***** PFR LOGICAL FONTS *****/ - /***** *****/ - /***********************************************************************/ - /***********************************************************************/ - - - FT_LOCAL_DEF( FT_Error ) - pfr_log_font_count( FT_Stream stream, - FT_UInt32 section_offset, - FT_UInt *acount ) - { - FT_Error error; - FT_UInt count; - FT_UInt result = 0; - - - if ( FT_STREAM_SEEK( section_offset ) || FT_READ_USHORT( count ) ) - goto Exit; - - result = count; - - Exit: - *acount = result; - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - pfr_log_font_load( PFR_LogFont log_font, - FT_Stream stream, - FT_UInt idx, - FT_UInt32 section_offset, - FT_Bool size_increment ) - { - FT_UInt num_log_fonts; - FT_UInt flags; - FT_UInt32 offset; - FT_UInt32 size; - FT_Error error; - - - if ( FT_STREAM_SEEK( section_offset ) || - FT_READ_USHORT( num_log_fonts ) ) - goto Exit; - - if ( idx >= num_log_fonts ) - return PFR_Err_Invalid_Argument; - - if ( FT_STREAM_SKIP( idx * 5 ) || - FT_READ_USHORT( size ) || - FT_READ_UOFF3 ( offset ) ) - goto Exit; - - /* save logical font size and offset */ - log_font->size = size; - log_font->offset = offset; - - /* now, check the rest of the table before loading it */ - { - FT_Byte* p; - FT_Byte* limit; - FT_UInt local; - - - if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) - goto Exit; - - p = stream->cursor; - limit = p + size; - - PFR_CHECK(13); - - log_font->matrix[0] = PFR_NEXT_LONG( p ); - log_font->matrix[1] = PFR_NEXT_LONG( p ); - log_font->matrix[2] = PFR_NEXT_LONG( p ); - log_font->matrix[3] = PFR_NEXT_LONG( p ); - - flags = PFR_NEXT_BYTE( p ); - - local = 0; - if ( flags & PFR_LOG_STROKE ) - { - local++; - if ( flags & PFR_LOG_2BYTE_STROKE ) - local++; - - if ( (flags & PFR_LINE_JOIN_MASK) == PFR_LINE_JOIN_MITER ) - local += 3; - } - if ( flags & PFR_LOG_BOLD ) - { - local++; - if ( flags & PFR_LOG_2BYTE_BOLD ) - local++; - } - - PFR_CHECK( local ); - - if ( flags & PFR_LOG_STROKE ) - { - log_font->stroke_thickness = ( flags & PFR_LOG_2BYTE_STROKE ) - ? PFR_NEXT_SHORT( p ) - : PFR_NEXT_BYTE( p ); - - if ( ( flags & PFR_LINE_JOIN_MASK ) == PFR_LINE_JOIN_MITER ) - log_font->miter_limit = PFR_NEXT_LONG( p ); - } - - if ( flags & PFR_LOG_BOLD ) - { - log_font->bold_thickness = ( flags & PFR_LOG_2BYTE_BOLD ) - ? PFR_NEXT_SHORT( p ) - : PFR_NEXT_BYTE( p ); - } - - if ( flags & PFR_LOG_EXTRA_ITEMS ) - { - error = pfr_extra_items_skip( &p, limit ); - if (error) goto Fail; - } - - PFR_CHECK(5); - log_font->phys_size = PFR_NEXT_USHORT( p ); - log_font->phys_offset = PFR_NEXT_ULONG( p ); - if ( size_increment ) - { - PFR_CHECK( 1 ); - log_font->phys_size += (FT_UInt32)PFR_NEXT_BYTE( p ) << 16; - } - } - - Fail: - FT_FRAME_EXIT(); - - Exit: - return error; - - Too_Short: - FT_ERROR(( "pfr_log_font_load: invalid logical font table\n" )); - error = PFR_Err_Invalid_Table; - goto Fail; - } - - - /***********************************************************************/ - /***********************************************************************/ - /***** *****/ - /***** PFR PHYSICAL FONTS *****/ - /***** *****/ - /***********************************************************************/ - /***********************************************************************/ - - - /* load bitmap strikes lists */ - FT_CALLBACK_DEF( FT_Error ) - pfr_extra_item_load_bitmap_info( FT_Byte* p, - FT_Byte* limit, - PFR_PhyFont phy_font ) - { - FT_Memory memory = phy_font->memory; - PFR_Strike strike; - FT_UInt flags0; - FT_UInt n, count, size1; - FT_Error error = 0; - - - PFR_CHECK( 5 ); - - p += 3; /* skip bctSize */ - flags0 = PFR_NEXT_BYTE( p ); - count = PFR_NEXT_BYTE( p ); - - /* re-allocate when needed */ - if ( phy_font->num_strikes + count > phy_font->max_strikes ) - { - FT_UInt new_max = FT_PAD_CEIL( phy_font->num_strikes + count, 4 ); - - - if ( FT_RENEW_ARRAY( phy_font->strikes, - phy_font->num_strikes, - new_max ) ) - goto Exit; - - phy_font->max_strikes = new_max; - } - - size1 = 1 + 1 + 1 + 2 + 2 + 1; - if ( flags0 & PFR_STRIKE_2BYTE_XPPM ) - size1++; - - if ( flags0 & PFR_STRIKE_2BYTE_YPPM ) - size1++; - - if ( flags0 & PFR_STRIKE_3BYTE_SIZE ) - size1++; - - if ( flags0 & PFR_STRIKE_3BYTE_OFFSET ) - size1++; - - if ( flags0 & PFR_STRIKE_2BYTE_COUNT ) - size1++; - - strike = phy_font->strikes + phy_font->num_strikes; - - PFR_CHECK( count * size1 ); - - for ( n = 0; n < count; n++, strike++ ) - { - strike->x_ppm = ( flags0 & PFR_STRIKE_2BYTE_XPPM ) - ? PFR_NEXT_USHORT( p ) - : PFR_NEXT_BYTE( p ); - - strike->y_ppm = ( flags0 & PFR_STRIKE_2BYTE_YPPM ) - ? PFR_NEXT_USHORT( p ) - : PFR_NEXT_BYTE( p ); - - strike->flags = PFR_NEXT_BYTE( p ); - - strike->bct_size = ( flags0 & PFR_STRIKE_3BYTE_SIZE ) - ? PFR_NEXT_ULONG( p ) - : PFR_NEXT_USHORT( p ); - - strike->bct_offset = ( flags0 & PFR_STRIKE_3BYTE_OFFSET ) - ? PFR_NEXT_ULONG( p ) - : PFR_NEXT_USHORT( p ); - - strike->num_bitmaps = ( flags0 & PFR_STRIKE_2BYTE_COUNT ) - ? PFR_NEXT_USHORT( p ) - : PFR_NEXT_BYTE( p ); - } - - phy_font->num_strikes += count; - - Exit: - return error; - - Too_Short: - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_extra_item_load_bitmap_info: invalid bitmap info table\n" )); - goto Exit; - } - - - /* Load font ID. This is a so-called "unique" name that is rather - * long and descriptive (like "Tiresias ScreenFont v7.51"). - * - * Note that a PFR font's family name is contained in an *undocumented* - * string of the "auxiliary data" portion of a physical font record. This - * may also contain the "real" style name! - * - * If no family name is present, the font ID is used instead for the - * family. - */ - FT_CALLBACK_DEF( FT_Error ) - pfr_extra_item_load_font_id( FT_Byte* p, - FT_Byte* limit, - PFR_PhyFont phy_font ) - { - FT_Error error = 0; - FT_Memory memory = phy_font->memory; - FT_PtrDist len = limit - p; - - - if ( phy_font->font_id != NULL ) - goto Exit; - - if ( FT_ALLOC( phy_font->font_id, len + 1 ) ) - goto Exit; - - /* copy font ID name, and terminate it for safety */ - FT_MEM_COPY( phy_font->font_id, p, len ); - phy_font->font_id[len] = 0; - - Exit: - return error; - } - - - /* load stem snap tables */ - FT_CALLBACK_DEF( FT_Error ) - pfr_extra_item_load_stem_snaps( FT_Byte* p, - FT_Byte* limit, - PFR_PhyFont phy_font ) - { - FT_UInt count, num_vert, num_horz; - FT_Int* snaps; - FT_Error error = 0; - FT_Memory memory = phy_font->memory; - - - if ( phy_font->vertical.stem_snaps != NULL ) - goto Exit; - - PFR_CHECK( 1 ); - count = PFR_NEXT_BYTE( p ); - - num_vert = count & 15; - num_horz = count >> 4; - count = num_vert + num_horz; - - PFR_CHECK( count * 2 ); - - if ( FT_NEW_ARRAY( snaps, count ) ) - goto Exit; - - phy_font->vertical.stem_snaps = snaps; - phy_font->horizontal.stem_snaps = snaps + num_vert; - - for ( ; count > 0; count--, snaps++ ) - *snaps = FT_NEXT_SHORT( p ); - - Exit: - return error; - - Too_Short: - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_exta_item_load_stem_snaps: invalid stem snaps table\n" )); - goto Exit; - } - - - - /* load kerning pair data */ - FT_CALLBACK_DEF( FT_Error ) - pfr_extra_item_load_kerning_pairs( FT_Byte* p, - FT_Byte* limit, - PFR_PhyFont phy_font ) - { - PFR_KernItem item; - FT_Error error = 0; - FT_Memory memory = phy_font->memory; - - - FT_TRACE2(( "pfr_extra_item_load_kerning_pairs()\n" )); - - if ( FT_NEW( item ) ) - goto Exit; - - PFR_CHECK( 4 ); - - item->pair_count = PFR_NEXT_BYTE( p ); - item->base_adj = PFR_NEXT_SHORT( p ); - item->flags = PFR_NEXT_BYTE( p ); - item->offset = phy_font->offset + ( p - phy_font->cursor ); - -#ifndef PFR_CONFIG_NO_CHECKS - item->pair_size = 3; - - if ( item->flags & PFR_KERN_2BYTE_CHAR ) - item->pair_size += 2; - - if ( item->flags & PFR_KERN_2BYTE_ADJ ) - item->pair_size += 1; - - PFR_CHECK( item->pair_count * item->pair_size ); -#endif - - /* load first and last pairs into the item to speed up */ - /* lookup later... */ - if ( item->pair_count > 0 ) - { - FT_UInt char1, char2; - FT_Byte* q; - - - if ( item->flags & PFR_KERN_2BYTE_CHAR ) - { - q = p; - char1 = PFR_NEXT_USHORT( q ); - char2 = PFR_NEXT_USHORT( q ); - - item->pair1 = PFR_KERN_INDEX( char1, char2 ); - - q = p + item->pair_size * ( item->pair_count - 1 ); - char1 = PFR_NEXT_USHORT( q ); - char2 = PFR_NEXT_USHORT( q ); - - item->pair2 = PFR_KERN_INDEX( char1, char2 ); - } - else - { - q = p; - char1 = PFR_NEXT_BYTE( q ); - char2 = PFR_NEXT_BYTE( q ); - - item->pair1 = PFR_KERN_INDEX( char1, char2 ); - - q = p + item->pair_size * ( item->pair_count - 1 ); - char1 = PFR_NEXT_BYTE( q ); - char2 = PFR_NEXT_BYTE( q ); - - item->pair2 = PFR_KERN_INDEX( char1, char2 ); - } - - /* add new item to the current list */ - item->next = NULL; - *phy_font->kern_items_tail = item; - phy_font->kern_items_tail = &item->next; - phy_font->num_kern_pairs += item->pair_count; - } - else - { - /* empty item! */ - FT_FREE( item ); - } - - Exit: - return error; - - Too_Short: - FT_FREE( item ); - - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_extra_item_load_kerning_pairs: " - "invalid kerning pairs table\n" )); - goto Exit; - } - - - - static const PFR_ExtraItemRec pfr_phy_font_extra_items[] = - { - { 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info }, - { 2, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_font_id }, - { 3, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_stem_snaps }, - { 4, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_kerning_pairs }, - { 0, NULL } - }; - - - /* Loads a name from the auxiliary data. Since this extracts undocumented - * strings from the font file, we need to be careful here. - */ - static FT_Error - pfr_aux_name_load( FT_Byte* p, - FT_UInt len, - FT_Memory memory, - FT_String* *astring ) - { - FT_Error error = 0; - FT_String* result = NULL; - FT_UInt n, ok; - - - if ( len > 0 && p[len - 1] == 0 ) - len--; - - /* check that each character is ASCII for making sure not to - load garbage - */ - ok = ( len > 0 ); - for ( n = 0; n < len; n++ ) - if ( p[n] < 32 || p[n] > 127 ) - { - ok = 0; - break; - } - - if ( ok ) - { - if ( FT_ALLOC( result, len + 1 ) ) - goto Exit; - - FT_MEM_COPY( result, p, len ); - result[len] = 0; - } - Exit: - *astring = result; - return error; - } - - - FT_LOCAL_DEF( void ) - pfr_phy_font_done( PFR_PhyFont phy_font, - FT_Memory memory ) - { - FT_FREE( phy_font->font_id ); - FT_FREE( phy_font->family_name ); - FT_FREE( phy_font->style_name ); - - FT_FREE( phy_font->vertical.stem_snaps ); - phy_font->vertical.num_stem_snaps = 0; - - phy_font->horizontal.stem_snaps = NULL; - phy_font->horizontal.num_stem_snaps = 0; - - FT_FREE( phy_font->strikes ); - phy_font->num_strikes = 0; - phy_font->max_strikes = 0; - - FT_FREE( phy_font->chars ); - phy_font->num_chars = 0; - phy_font->chars_offset = 0; - - FT_FREE( phy_font->blue_values ); - phy_font->num_blue_values = 0; - - { - PFR_KernItem item, next; - - - item = phy_font->kern_items; - while ( item ) - { - next = item->next; - FT_FREE( item ); - item = next; - } - phy_font->kern_items = NULL; - phy_font->kern_items_tail = NULL; - } - - phy_font->num_kern_pairs = 0; - } - - - FT_LOCAL_DEF( FT_Error ) - pfr_phy_font_load( PFR_PhyFont phy_font, - FT_Stream stream, - FT_UInt32 offset, - FT_UInt32 size ) - { - FT_Error error; - FT_Memory memory = stream->memory; - FT_UInt flags, num_aux; - FT_Byte* p; - FT_Byte* limit; - - - phy_font->memory = memory; - phy_font->offset = offset; - - phy_font->kern_items = NULL; - phy_font->kern_items_tail = &phy_font->kern_items; - - if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) - goto Exit; - - phy_font->cursor = stream->cursor; - - p = stream->cursor; - limit = p + size; - - PFR_CHECK( 15 ); - phy_font->font_ref_number = PFR_NEXT_USHORT( p ); - phy_font->outline_resolution = PFR_NEXT_USHORT( p ); - phy_font->metrics_resolution = PFR_NEXT_USHORT( p ); - phy_font->bbox.xMin = PFR_NEXT_SHORT( p ); - phy_font->bbox.yMin = PFR_NEXT_SHORT( p ); - phy_font->bbox.xMax = PFR_NEXT_SHORT( p ); - phy_font->bbox.yMax = PFR_NEXT_SHORT( p ); - phy_font->flags = flags = PFR_NEXT_BYTE( p ); - - /* get the standard advance for non-proportional fonts */ - if ( !(flags & PFR_PHY_PROPORTIONAL) ) - { - PFR_CHECK( 2 ); - phy_font->standard_advance = PFR_NEXT_SHORT( p ); - } - - /* load the extra items when present */ - if ( flags & PFR_PHY_EXTRA_ITEMS ) - { - error = pfr_extra_items_parse( &p, limit, - pfr_phy_font_extra_items, phy_font ); - - if ( error ) - goto Fail; - } - - /* In certain fonts, the auxiliary bytes contain interesting */ - /* information. These are not in the specification but can be */ - /* guessed by looking at the content of a few PFR0 fonts. */ - PFR_CHECK( 3 ); - num_aux = PFR_NEXT_ULONG( p ); - - if ( num_aux > 0 ) - { - FT_Byte* q = p; - FT_Byte* q2; - - - PFR_CHECK( num_aux ); - p += num_aux; - - while ( num_aux > 0 ) - { - FT_UInt length, type; - - - if ( q + 4 > p ) - break; - - length = PFR_NEXT_USHORT( q ); - if ( length < 4 || length > num_aux ) - break; - - q2 = q + length - 2; - type = PFR_NEXT_USHORT( q ); - - switch ( type ) - { - case 1: - /* this seems to correspond to the font's family name, - * padded to 16-bits with one zero when necessary - */ - error = pfr_aux_name_load( q, length - 4U, memory, - &phy_font->family_name ); - if ( error ) - goto Exit; - break; - - case 2: - if ( q + 32 > q2 ) - break; - - q += 10; - phy_font->ascent = PFR_NEXT_SHORT( q ); - phy_font->descent = PFR_NEXT_SHORT( q ); - phy_font->leading = PFR_NEXT_SHORT( q ); - q += 16; - break; - - case 3: - /* this seems to correspond to the font's style name, - * padded to 16-bits with one zero when necessary - */ - error = pfr_aux_name_load( q, length - 4U, memory, - &phy_font->style_name ); - if ( error ) - goto Exit; - break; - - default: - ; - } - - q = q2; - num_aux -= length; - } - } - - /* read the blue values */ - { - FT_UInt n, count; - - - PFR_CHECK( 1 ); - phy_font->num_blue_values = count = PFR_NEXT_BYTE( p ); - - PFR_CHECK( count * 2 ); - - if ( FT_NEW_ARRAY( phy_font->blue_values, count ) ) - goto Fail; - - for ( n = 0; n < count; n++ ) - phy_font->blue_values[n] = PFR_NEXT_SHORT( p ); - } - - PFR_CHECK( 8 ); - phy_font->blue_fuzz = PFR_NEXT_BYTE( p ); - phy_font->blue_scale = PFR_NEXT_BYTE( p ); - - phy_font->vertical.standard = PFR_NEXT_USHORT( p ); - phy_font->horizontal.standard = PFR_NEXT_USHORT( p ); - - /* read the character descriptors */ - { - FT_UInt n, count, Size; - - - phy_font->num_chars = count = PFR_NEXT_USHORT( p ); - phy_font->chars_offset = offset + ( p - stream->cursor ); - - if ( FT_NEW_ARRAY( phy_font->chars, count ) ) - goto Fail; - - Size = 1 + 1 + 2; - if ( flags & PFR_PHY_2BYTE_CHARCODE ) - Size += 1; - - if ( flags & PFR_PHY_PROPORTIONAL ) - Size += 2; - - if ( flags & PFR_PHY_ASCII_CODE ) - Size += 1; - - if ( flags & PFR_PHY_2BYTE_GPS_SIZE ) - Size += 1; - - if ( flags & PFR_PHY_3BYTE_GPS_OFFSET ) - Size += 1; - - PFR_CHECK( count * Size ); - - for ( n = 0; n < count; n++ ) - { - PFR_Char cur = &phy_font->chars[n]; - - - cur->char_code = ( flags & PFR_PHY_2BYTE_CHARCODE ) - ? PFR_NEXT_USHORT( p ) - : PFR_NEXT_BYTE( p ); - - cur->advance = ( flags & PFR_PHY_PROPORTIONAL ) - ? PFR_NEXT_SHORT( p ) - : (FT_Int) phy_font->standard_advance; - -#if 0 - cur->ascii = ( flags & PFR_PHY_ASCII_CODE ) - ? PFR_NEXT_BYTE( p ) - : 0; -#else - if ( flags & PFR_PHY_ASCII_CODE ) - p += 1; -#endif - cur->gps_size = ( flags & PFR_PHY_2BYTE_GPS_SIZE ) - ? PFR_NEXT_USHORT( p ) - : PFR_NEXT_BYTE( p ); - - cur->gps_offset = ( flags & PFR_PHY_3BYTE_GPS_OFFSET ) - ? PFR_NEXT_ULONG( p ) - : PFR_NEXT_USHORT( p ); - } - } - - /* that's it! */ - - Fail: - FT_FRAME_EXIT(); - - /* save position of bitmap info */ - phy_font->bct_offset = FT_STREAM_POS(); - phy_font->cursor = NULL; - - Exit: - return error; - - Too_Short: - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_phy_font_load: invalid physical font table\n" )); - goto Fail; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrload.c */ +/* */ +/* FreeType PFR loader (body). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "pfrload.h" +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H + +#include "pfrerror.h" + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pfr + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** EXTRA ITEMS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_LOCAL_DEF( FT_Error ) + pfr_extra_items_skip( FT_Byte* *pp, + FT_Byte* limit ) + { + return pfr_extra_items_parse( pp, limit, NULL, NULL ); + } + + + FT_LOCAL_DEF( FT_Error ) + pfr_extra_items_parse( FT_Byte* *pp, + FT_Byte* limit, + PFR_ExtraItem item_list, + FT_Pointer item_data ) + { + FT_Error error = 0; + FT_Byte* p = *pp; + FT_UInt num_items, item_type, item_size; + + + PFR_CHECK( 1 ); + num_items = PFR_NEXT_BYTE( p ); + + for ( ; num_items > 0; num_items-- ) + { + PFR_CHECK( 2 ); + item_size = PFR_NEXT_BYTE( p ); + item_type = PFR_NEXT_BYTE( p ); + + PFR_CHECK( item_size ); + + if ( item_list ) + { + PFR_ExtraItem extra = item_list; + + + for ( extra = item_list; extra->parser != NULL; extra++ ) + { + if ( extra->type == item_type ) + { + error = extra->parser( p, p + item_size, item_data ); + if ( error ) goto Exit; + + break; + } + } + } + + p += item_size; + } + + Exit: + *pp = p; + return error; + + Too_Short: + FT_ERROR(( "pfr_extra_items_parse: invalid extra items table\n" )); + error = PFR_Err_Invalid_Table; + goto Exit; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PFR HEADER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static const FT_Frame_Field pfr_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PFR_HeaderRec + + FT_FRAME_START( 58 ), + FT_FRAME_ULONG ( signature ), + FT_FRAME_USHORT( version ), + FT_FRAME_USHORT( signature2 ), + FT_FRAME_USHORT( header_size ), + + FT_FRAME_USHORT( log_dir_size ), + FT_FRAME_USHORT( log_dir_offset ), + + FT_FRAME_USHORT( log_font_max_size ), + FT_FRAME_UOFF3 ( log_font_section_size ), + FT_FRAME_UOFF3 ( log_font_section_offset ), + + FT_FRAME_USHORT( phy_font_max_size ), + FT_FRAME_UOFF3 ( phy_font_section_size ), + FT_FRAME_UOFF3 ( phy_font_section_offset ), + + FT_FRAME_USHORT( gps_max_size ), + FT_FRAME_UOFF3 ( gps_section_size ), + FT_FRAME_UOFF3 ( gps_section_offset ), + + FT_FRAME_BYTE ( max_blue_values ), + FT_FRAME_BYTE ( max_x_orus ), + FT_FRAME_BYTE ( max_y_orus ), + + FT_FRAME_BYTE ( phy_font_max_size_high ), + FT_FRAME_BYTE ( color_flags ), + + FT_FRAME_UOFF3 ( bct_max_size ), + FT_FRAME_UOFF3 ( bct_set_max_size ), + FT_FRAME_UOFF3 ( phy_bct_set_max_size ), + + FT_FRAME_USHORT( num_phy_fonts ), + FT_FRAME_BYTE ( max_vert_stem_snap ), + FT_FRAME_BYTE ( max_horz_stem_snap ), + FT_FRAME_USHORT( max_chars ), + FT_FRAME_END + }; + + + FT_LOCAL_DEF( FT_Error ) + pfr_header_load( PFR_Header header, + FT_Stream stream ) + { + FT_Error error; + + + /* read header directly */ + if ( !FT_STREAM_SEEK( 0 ) && + !FT_STREAM_READ_FIELDS( pfr_header_fields, header ) ) + { + /* make a few adjustments to the header */ + header->phy_font_max_size += + (FT_UInt32)header->phy_font_max_size_high << 16; + } + + return error; + } + + + FT_LOCAL_DEF( FT_Bool ) + pfr_header_check( PFR_Header header ) + { + FT_Bool result = 1; + + + /* check signature and header size */ + if ( header->signature != 0x50465230L || /* "PFR0" */ + header->version > 4 || + header->header_size < 58 || + header->signature2 != 0x0d0a ) /* CR/LF */ + { + result = 0; + } + return result; + } + + + /***********************************************************************/ + /***********************************************************************/ + /***** *****/ + /***** PFR LOGICAL FONTS *****/ + /***** *****/ + /***********************************************************************/ + /***********************************************************************/ + + + FT_LOCAL_DEF( FT_Error ) + pfr_log_font_count( FT_Stream stream, + FT_UInt32 section_offset, + FT_UInt *acount ) + { + FT_Error error; + FT_UInt count; + FT_UInt result = 0; + + + if ( FT_STREAM_SEEK( section_offset ) || FT_READ_USHORT( count ) ) + goto Exit; + + result = count; + + Exit: + *acount = result; + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + pfr_log_font_load( PFR_LogFont log_font, + FT_Stream stream, + FT_UInt idx, + FT_UInt32 section_offset, + FT_Bool size_increment ) + { + FT_UInt num_log_fonts; + FT_UInt flags; + FT_UInt32 offset; + FT_UInt32 size; + FT_Error error; + + + if ( FT_STREAM_SEEK( section_offset ) || + FT_READ_USHORT( num_log_fonts ) ) + goto Exit; + + if ( idx >= num_log_fonts ) + return PFR_Err_Invalid_Argument; + + if ( FT_STREAM_SKIP( idx * 5 ) || + FT_READ_USHORT( size ) || + FT_READ_UOFF3 ( offset ) ) + goto Exit; + + /* save logical font size and offset */ + log_font->size = size; + log_font->offset = offset; + + /* now, check the rest of the table before loading it */ + { + FT_Byte* p; + FT_Byte* limit; + FT_UInt local; + + + if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) + goto Exit; + + p = stream->cursor; + limit = p + size; + + PFR_CHECK(13); + + log_font->matrix[0] = PFR_NEXT_LONG( p ); + log_font->matrix[1] = PFR_NEXT_LONG( p ); + log_font->matrix[2] = PFR_NEXT_LONG( p ); + log_font->matrix[3] = PFR_NEXT_LONG( p ); + + flags = PFR_NEXT_BYTE( p ); + + local = 0; + if ( flags & PFR_LOG_STROKE ) + { + local++; + if ( flags & PFR_LOG_2BYTE_STROKE ) + local++; + + if ( (flags & PFR_LINE_JOIN_MASK) == PFR_LINE_JOIN_MITER ) + local += 3; + } + if ( flags & PFR_LOG_BOLD ) + { + local++; + if ( flags & PFR_LOG_2BYTE_BOLD ) + local++; + } + + PFR_CHECK( local ); + + if ( flags & PFR_LOG_STROKE ) + { + log_font->stroke_thickness = ( flags & PFR_LOG_2BYTE_STROKE ) + ? PFR_NEXT_SHORT( p ) + : PFR_NEXT_BYTE( p ); + + if ( ( flags & PFR_LINE_JOIN_MASK ) == PFR_LINE_JOIN_MITER ) + log_font->miter_limit = PFR_NEXT_LONG( p ); + } + + if ( flags & PFR_LOG_BOLD ) + { + log_font->bold_thickness = ( flags & PFR_LOG_2BYTE_BOLD ) + ? PFR_NEXT_SHORT( p ) + : PFR_NEXT_BYTE( p ); + } + + if ( flags & PFR_LOG_EXTRA_ITEMS ) + { + error = pfr_extra_items_skip( &p, limit ); + if (error) goto Fail; + } + + PFR_CHECK(5); + log_font->phys_size = PFR_NEXT_USHORT( p ); + log_font->phys_offset = PFR_NEXT_ULONG( p ); + if ( size_increment ) + { + PFR_CHECK( 1 ); + log_font->phys_size += (FT_UInt32)PFR_NEXT_BYTE( p ) << 16; + } + } + + Fail: + FT_FRAME_EXIT(); + + Exit: + return error; + + Too_Short: + FT_ERROR(( "pfr_log_font_load: invalid logical font table\n" )); + error = PFR_Err_Invalid_Table; + goto Fail; + } + + + /***********************************************************************/ + /***********************************************************************/ + /***** *****/ + /***** PFR PHYSICAL FONTS *****/ + /***** *****/ + /***********************************************************************/ + /***********************************************************************/ + + + /* load bitmap strikes lists */ + FT_CALLBACK_DEF( FT_Error ) + pfr_extra_item_load_bitmap_info( FT_Byte* p, + FT_Byte* limit, + PFR_PhyFont phy_font ) + { + FT_Memory memory = phy_font->memory; + PFR_Strike strike; + FT_UInt flags0; + FT_UInt n, count, size1; + FT_Error error = 0; + + + PFR_CHECK( 5 ); + + p += 3; /* skip bctSize */ + flags0 = PFR_NEXT_BYTE( p ); + count = PFR_NEXT_BYTE( p ); + + /* re-allocate when needed */ + if ( phy_font->num_strikes + count > phy_font->max_strikes ) + { + FT_UInt new_max = FT_PAD_CEIL( phy_font->num_strikes + count, 4 ); + + + if ( FT_RENEW_ARRAY( phy_font->strikes, + phy_font->num_strikes, + new_max ) ) + goto Exit; + + phy_font->max_strikes = new_max; + } + + size1 = 1 + 1 + 1 + 2 + 2 + 1; + if ( flags0 & PFR_STRIKE_2BYTE_XPPM ) + size1++; + + if ( flags0 & PFR_STRIKE_2BYTE_YPPM ) + size1++; + + if ( flags0 & PFR_STRIKE_3BYTE_SIZE ) + size1++; + + if ( flags0 & PFR_STRIKE_3BYTE_OFFSET ) + size1++; + + if ( flags0 & PFR_STRIKE_2BYTE_COUNT ) + size1++; + + strike = phy_font->strikes + phy_font->num_strikes; + + PFR_CHECK( count * size1 ); + + for ( n = 0; n < count; n++, strike++ ) + { + strike->x_ppm = ( flags0 & PFR_STRIKE_2BYTE_XPPM ) + ? PFR_NEXT_USHORT( p ) + : PFR_NEXT_BYTE( p ); + + strike->y_ppm = ( flags0 & PFR_STRIKE_2BYTE_YPPM ) + ? PFR_NEXT_USHORT( p ) + : PFR_NEXT_BYTE( p ); + + strike->flags = PFR_NEXT_BYTE( p ); + + strike->bct_size = ( flags0 & PFR_STRIKE_3BYTE_SIZE ) + ? PFR_NEXT_ULONG( p ) + : PFR_NEXT_USHORT( p ); + + strike->bct_offset = ( flags0 & PFR_STRIKE_3BYTE_OFFSET ) + ? PFR_NEXT_ULONG( p ) + : PFR_NEXT_USHORT( p ); + + strike->num_bitmaps = ( flags0 & PFR_STRIKE_2BYTE_COUNT ) + ? PFR_NEXT_USHORT( p ) + : PFR_NEXT_BYTE( p ); + } + + phy_font->num_strikes += count; + + Exit: + return error; + + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_extra_item_load_bitmap_info: invalid bitmap info table\n" )); + goto Exit; + } + + + /* Load font ID. This is a so-called "unique" name that is rather + * long and descriptive (like "Tiresias ScreenFont v7.51"). + * + * Note that a PFR font's family name is contained in an *undocumented* + * string of the "auxiliary data" portion of a physical font record. This + * may also contain the "real" style name! + * + * If no family name is present, the font ID is used instead for the + * family. + */ + FT_CALLBACK_DEF( FT_Error ) + pfr_extra_item_load_font_id( FT_Byte* p, + FT_Byte* limit, + PFR_PhyFont phy_font ) + { + FT_Error error = 0; + FT_Memory memory = phy_font->memory; + FT_PtrDist len = limit - p; + + + if ( phy_font->font_id != NULL ) + goto Exit; + + if ( FT_ALLOC( phy_font->font_id, len + 1 ) ) + goto Exit; + + /* copy font ID name, and terminate it for safety */ + FT_MEM_COPY( phy_font->font_id, p, len ); + phy_font->font_id[len] = 0; + + Exit: + return error; + } + + + /* load stem snap tables */ + FT_CALLBACK_DEF( FT_Error ) + pfr_extra_item_load_stem_snaps( FT_Byte* p, + FT_Byte* limit, + PFR_PhyFont phy_font ) + { + FT_UInt count, num_vert, num_horz; + FT_Int* snaps; + FT_Error error = 0; + FT_Memory memory = phy_font->memory; + + + if ( phy_font->vertical.stem_snaps != NULL ) + goto Exit; + + PFR_CHECK( 1 ); + count = PFR_NEXT_BYTE( p ); + + num_vert = count & 15; + num_horz = count >> 4; + count = num_vert + num_horz; + + PFR_CHECK( count * 2 ); + + if ( FT_NEW_ARRAY( snaps, count ) ) + goto Exit; + + phy_font->vertical.stem_snaps = snaps; + phy_font->horizontal.stem_snaps = snaps + num_vert; + + for ( ; count > 0; count--, snaps++ ) + *snaps = FT_NEXT_SHORT( p ); + + Exit: + return error; + + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_exta_item_load_stem_snaps: invalid stem snaps table\n" )); + goto Exit; + } + + + + /* load kerning pair data */ + FT_CALLBACK_DEF( FT_Error ) + pfr_extra_item_load_kerning_pairs( FT_Byte* p, + FT_Byte* limit, + PFR_PhyFont phy_font ) + { + PFR_KernItem item; + FT_Error error = 0; + FT_Memory memory = phy_font->memory; + + + FT_TRACE2(( "pfr_extra_item_load_kerning_pairs()\n" )); + + if ( FT_NEW( item ) ) + goto Exit; + + PFR_CHECK( 4 ); + + item->pair_count = PFR_NEXT_BYTE( p ); + item->base_adj = PFR_NEXT_SHORT( p ); + item->flags = PFR_NEXT_BYTE( p ); + item->offset = phy_font->offset + ( p - phy_font->cursor ); + +#ifndef PFR_CONFIG_NO_CHECKS + item->pair_size = 3; + + if ( item->flags & PFR_KERN_2BYTE_CHAR ) + item->pair_size += 2; + + if ( item->flags & PFR_KERN_2BYTE_ADJ ) + item->pair_size += 1; + + PFR_CHECK( item->pair_count * item->pair_size ); +#endif + + /* load first and last pairs into the item to speed up */ + /* lookup later... */ + if ( item->pair_count > 0 ) + { + FT_UInt char1, char2; + FT_Byte* q; + + + if ( item->flags & PFR_KERN_2BYTE_CHAR ) + { + q = p; + char1 = PFR_NEXT_USHORT( q ); + char2 = PFR_NEXT_USHORT( q ); + + item->pair1 = PFR_KERN_INDEX( char1, char2 ); + + q = p + item->pair_size * ( item->pair_count - 1 ); + char1 = PFR_NEXT_USHORT( q ); + char2 = PFR_NEXT_USHORT( q ); + + item->pair2 = PFR_KERN_INDEX( char1, char2 ); + } + else + { + q = p; + char1 = PFR_NEXT_BYTE( q ); + char2 = PFR_NEXT_BYTE( q ); + + item->pair1 = PFR_KERN_INDEX( char1, char2 ); + + q = p + item->pair_size * ( item->pair_count - 1 ); + char1 = PFR_NEXT_BYTE( q ); + char2 = PFR_NEXT_BYTE( q ); + + item->pair2 = PFR_KERN_INDEX( char1, char2 ); + } + + /* add new item to the current list */ + item->next = NULL; + *phy_font->kern_items_tail = item; + phy_font->kern_items_tail = &item->next; + phy_font->num_kern_pairs += item->pair_count; + } + else + { + /* empty item! */ + FT_FREE( item ); + } + + Exit: + return error; + + Too_Short: + FT_FREE( item ); + + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_extra_item_load_kerning_pairs: " + "invalid kerning pairs table\n" )); + goto Exit; + } + + + + static const PFR_ExtraItemRec pfr_phy_font_extra_items[] = + { + { 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info }, + { 2, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_font_id }, + { 3, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_stem_snaps }, + { 4, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_kerning_pairs }, + { 0, NULL } + }; + + + /* Loads a name from the auxiliary data. Since this extracts undocumented + * strings from the font file, we need to be careful here. + */ + static FT_Error + pfr_aux_name_load( FT_Byte* p, + FT_UInt len, + FT_Memory memory, + FT_String* *astring ) + { + FT_Error error = 0; + FT_String* result = NULL; + FT_UInt n, ok; + + + if ( len > 0 && p[len - 1] == 0 ) + len--; + + /* check that each character is ASCII for making sure not to + load garbage + */ + ok = ( len > 0 ); + for ( n = 0; n < len; n++ ) + if ( p[n] < 32 || p[n] > 127 ) + { + ok = 0; + break; + } + + if ( ok ) + { + if ( FT_ALLOC( result, len + 1 ) ) + goto Exit; + + FT_MEM_COPY( result, p, len ); + result[len] = 0; + } + Exit: + *astring = result; + return error; + } + + + FT_LOCAL_DEF( void ) + pfr_phy_font_done( PFR_PhyFont phy_font, + FT_Memory memory ) + { + FT_FREE( phy_font->font_id ); + FT_FREE( phy_font->family_name ); + FT_FREE( phy_font->style_name ); + + FT_FREE( phy_font->vertical.stem_snaps ); + phy_font->vertical.num_stem_snaps = 0; + + phy_font->horizontal.stem_snaps = NULL; + phy_font->horizontal.num_stem_snaps = 0; + + FT_FREE( phy_font->strikes ); + phy_font->num_strikes = 0; + phy_font->max_strikes = 0; + + FT_FREE( phy_font->chars ); + phy_font->num_chars = 0; + phy_font->chars_offset = 0; + + FT_FREE( phy_font->blue_values ); + phy_font->num_blue_values = 0; + + { + PFR_KernItem item, next; + + + item = phy_font->kern_items; + while ( item ) + { + next = item->next; + FT_FREE( item ); + item = next; + } + phy_font->kern_items = NULL; + phy_font->kern_items_tail = NULL; + } + + phy_font->num_kern_pairs = 0; + } + + + FT_LOCAL_DEF( FT_Error ) + pfr_phy_font_load( PFR_PhyFont phy_font, + FT_Stream stream, + FT_UInt32 offset, + FT_UInt32 size ) + { + FT_Error error; + FT_Memory memory = stream->memory; + FT_UInt flags, num_aux; + FT_Byte* p; + FT_Byte* limit; + + + phy_font->memory = memory; + phy_font->offset = offset; + + phy_font->kern_items = NULL; + phy_font->kern_items_tail = &phy_font->kern_items; + + if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) + goto Exit; + + phy_font->cursor = stream->cursor; + + p = stream->cursor; + limit = p + size; + + PFR_CHECK( 15 ); + phy_font->font_ref_number = PFR_NEXT_USHORT( p ); + phy_font->outline_resolution = PFR_NEXT_USHORT( p ); + phy_font->metrics_resolution = PFR_NEXT_USHORT( p ); + phy_font->bbox.xMin = PFR_NEXT_SHORT( p ); + phy_font->bbox.yMin = PFR_NEXT_SHORT( p ); + phy_font->bbox.xMax = PFR_NEXT_SHORT( p ); + phy_font->bbox.yMax = PFR_NEXT_SHORT( p ); + phy_font->flags = flags = PFR_NEXT_BYTE( p ); + + /* get the standard advance for non-proportional fonts */ + if ( !(flags & PFR_PHY_PROPORTIONAL) ) + { + PFR_CHECK( 2 ); + phy_font->standard_advance = PFR_NEXT_SHORT( p ); + } + + /* load the extra items when present */ + if ( flags & PFR_PHY_EXTRA_ITEMS ) + { + error = pfr_extra_items_parse( &p, limit, + pfr_phy_font_extra_items, phy_font ); + + if ( error ) + goto Fail; + } + + /* In certain fonts, the auxiliary bytes contain interesting */ + /* information. These are not in the specification but can be */ + /* guessed by looking at the content of a few PFR0 fonts. */ + PFR_CHECK( 3 ); + num_aux = PFR_NEXT_ULONG( p ); + + if ( num_aux > 0 ) + { + FT_Byte* q = p; + FT_Byte* q2; + + + PFR_CHECK( num_aux ); + p += num_aux; + + while ( num_aux > 0 ) + { + FT_UInt length, type; + + + if ( q + 4 > p ) + break; + + length = PFR_NEXT_USHORT( q ); + if ( length < 4 || length > num_aux ) + break; + + q2 = q + length - 2; + type = PFR_NEXT_USHORT( q ); + + switch ( type ) + { + case 1: + /* this seems to correspond to the font's family name, + * padded to 16-bits with one zero when necessary + */ + error = pfr_aux_name_load( q, length - 4U, memory, + &phy_font->family_name ); + if ( error ) + goto Exit; + break; + + case 2: + if ( q + 32 > q2 ) + break; + + q += 10; + phy_font->ascent = PFR_NEXT_SHORT( q ); + phy_font->descent = PFR_NEXT_SHORT( q ); + phy_font->leading = PFR_NEXT_SHORT( q ); + q += 16; + break; + + case 3: + /* this seems to correspond to the font's style name, + * padded to 16-bits with one zero when necessary + */ + error = pfr_aux_name_load( q, length - 4U, memory, + &phy_font->style_name ); + if ( error ) + goto Exit; + break; + + default: + ; + } + + q = q2; + num_aux -= length; + } + } + + /* read the blue values */ + { + FT_UInt n, count; + + + PFR_CHECK( 1 ); + phy_font->num_blue_values = count = PFR_NEXT_BYTE( p ); + + PFR_CHECK( count * 2 ); + + if ( FT_NEW_ARRAY( phy_font->blue_values, count ) ) + goto Fail; + + for ( n = 0; n < count; n++ ) + phy_font->blue_values[n] = PFR_NEXT_SHORT( p ); + } + + PFR_CHECK( 8 ); + phy_font->blue_fuzz = PFR_NEXT_BYTE( p ); + phy_font->blue_scale = PFR_NEXT_BYTE( p ); + + phy_font->vertical.standard = PFR_NEXT_USHORT( p ); + phy_font->horizontal.standard = PFR_NEXT_USHORT( p ); + + /* read the character descriptors */ + { + FT_UInt n, count, Size; + + + phy_font->num_chars = count = PFR_NEXT_USHORT( p ); + phy_font->chars_offset = offset + ( p - stream->cursor ); + + if ( FT_NEW_ARRAY( phy_font->chars, count ) ) + goto Fail; + + Size = 1 + 1 + 2; + if ( flags & PFR_PHY_2BYTE_CHARCODE ) + Size += 1; + + if ( flags & PFR_PHY_PROPORTIONAL ) + Size += 2; + + if ( flags & PFR_PHY_ASCII_CODE ) + Size += 1; + + if ( flags & PFR_PHY_2BYTE_GPS_SIZE ) + Size += 1; + + if ( flags & PFR_PHY_3BYTE_GPS_OFFSET ) + Size += 1; + + PFR_CHECK( count * Size ); + + for ( n = 0; n < count; n++ ) + { + PFR_Char cur = &phy_font->chars[n]; + + + cur->char_code = ( flags & PFR_PHY_2BYTE_CHARCODE ) + ? PFR_NEXT_USHORT( p ) + : PFR_NEXT_BYTE( p ); + + cur->advance = ( flags & PFR_PHY_PROPORTIONAL ) + ? PFR_NEXT_SHORT( p ) + : (FT_Int) phy_font->standard_advance; + +#if 0 + cur->ascii = ( flags & PFR_PHY_ASCII_CODE ) + ? PFR_NEXT_BYTE( p ) + : 0; +#else + if ( flags & PFR_PHY_ASCII_CODE ) + p += 1; +#endif + cur->gps_size = ( flags & PFR_PHY_2BYTE_GPS_SIZE ) + ? PFR_NEXT_USHORT( p ) + : PFR_NEXT_BYTE( p ); + + cur->gps_offset = ( flags & PFR_PHY_3BYTE_GPS_OFFSET ) + ? PFR_NEXT_ULONG( p ) + : PFR_NEXT_USHORT( p ); + } + } + + /* that's it! */ + + Fail: + FT_FRAME_EXIT(); + + /* save position of bitmap info */ + phy_font->bct_offset = FT_STREAM_POS(); + phy_font->cursor = NULL; + + Exit: + return error; + + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_phy_font_load: invalid physical font table\n" )); + goto Fail; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrload.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrload.h index ed010715d1c..bf6fb630b1f 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrload.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrload.h @@ -1,118 +1,118 @@ -/***************************************************************************/ -/* */ -/* pfrload.h */ -/* */ -/* FreeType PFR loader (specification). */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PFRLOAD_H__ -#define __PFRLOAD_H__ - -#include "pfrobjs.h" -#include FT_INTERNAL_STREAM_H - - -FT_BEGIN_HEADER - -#ifdef PFR_CONFIG_NO_CHECKS -#define PFR_CHECK( x ) do { } while ( 0 ) -#else -#define PFR_CHECK( x ) do \ - { \ - if ( p + (x) > limit ) \ - goto Too_Short; \ - } while ( 0 ) -#endif - -#define PFR_NEXT_BYTE( p ) FT_NEXT_BYTE( p ) -#define PFR_NEXT_INT8( p ) FT_NEXT_CHAR( p ) -#define PFR_NEXT_SHORT( p ) FT_NEXT_SHORT( p ) -#define PFR_NEXT_USHORT( p ) FT_NEXT_USHORT( p ) -#define PFR_NEXT_LONG( p ) FT_NEXT_OFF3( p ) -#define PFR_NEXT_ULONG( p ) FT_NEXT_UOFF3( p ) - - - /* handling extra items */ - - typedef FT_Error - (*PFR_ExtraItem_ParseFunc)( FT_Byte* p, - FT_Byte* limit, - FT_Pointer data ); - - typedef struct PFR_ExtraItemRec_ - { - FT_UInt type; - PFR_ExtraItem_ParseFunc parser; - - } PFR_ExtraItemRec; - - typedef const struct PFR_ExtraItemRec_* PFR_ExtraItem; - - - FT_LOCAL( FT_Error ) - pfr_extra_items_skip( FT_Byte* *pp, - FT_Byte* limit ); - - FT_LOCAL( FT_Error ) - pfr_extra_items_parse( FT_Byte* *pp, - FT_Byte* limit, - PFR_ExtraItem item_list, - FT_Pointer item_data ); - - - /* load a PFR header */ - FT_LOCAL( FT_Error ) - pfr_header_load( PFR_Header header, - FT_Stream stream ); - - /* check a PFR header */ - FT_LOCAL( FT_Bool ) - pfr_header_check( PFR_Header header ); - - - /* return number of logical fonts in this file */ - FT_LOCAL( FT_Error ) - pfr_log_font_count( FT_Stream stream, - FT_UInt32 log_section_offset, - FT_UInt *acount ); - - /* load a pfr logical font entry */ - FT_LOCAL( FT_Error ) - pfr_log_font_load( PFR_LogFont log_font, - FT_Stream stream, - FT_UInt face_index, - FT_UInt32 section_offset, - FT_Bool size_increment ); - - - /* load a physical font entry */ - FT_LOCAL( FT_Error ) - pfr_phy_font_load( PFR_PhyFont phy_font, - FT_Stream stream, - FT_UInt32 offset, - FT_UInt32 size ); - - /* finalize a physical font */ - FT_LOCAL( void ) - pfr_phy_font_done( PFR_PhyFont phy_font, - FT_Memory memory ); - - /* */ - -FT_END_HEADER - -#endif /* __PFRLOAD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrload.h */ +/* */ +/* FreeType PFR loader (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFRLOAD_H__ +#define __PFRLOAD_H__ + +#include "pfrobjs.h" +#include FT_INTERNAL_STREAM_H + + +FT_BEGIN_HEADER + +#ifdef PFR_CONFIG_NO_CHECKS +#define PFR_CHECK( x ) do { } while ( 0 ) +#else +#define PFR_CHECK( x ) do \ + { \ + if ( p + (x) > limit ) \ + goto Too_Short; \ + } while ( 0 ) +#endif + +#define PFR_NEXT_BYTE( p ) FT_NEXT_BYTE( p ) +#define PFR_NEXT_INT8( p ) FT_NEXT_CHAR( p ) +#define PFR_NEXT_SHORT( p ) FT_NEXT_SHORT( p ) +#define PFR_NEXT_USHORT( p ) FT_NEXT_USHORT( p ) +#define PFR_NEXT_LONG( p ) FT_NEXT_OFF3( p ) +#define PFR_NEXT_ULONG( p ) FT_NEXT_UOFF3( p ) + + + /* handling extra items */ + + typedef FT_Error + (*PFR_ExtraItem_ParseFunc)( FT_Byte* p, + FT_Byte* limit, + FT_Pointer data ); + + typedef struct PFR_ExtraItemRec_ + { + FT_UInt type; + PFR_ExtraItem_ParseFunc parser; + + } PFR_ExtraItemRec; + + typedef const struct PFR_ExtraItemRec_* PFR_ExtraItem; + + + FT_LOCAL( FT_Error ) + pfr_extra_items_skip( FT_Byte* *pp, + FT_Byte* limit ); + + FT_LOCAL( FT_Error ) + pfr_extra_items_parse( FT_Byte* *pp, + FT_Byte* limit, + PFR_ExtraItem item_list, + FT_Pointer item_data ); + + + /* load a PFR header */ + FT_LOCAL( FT_Error ) + pfr_header_load( PFR_Header header, + FT_Stream stream ); + + /* check a PFR header */ + FT_LOCAL( FT_Bool ) + pfr_header_check( PFR_Header header ); + + + /* return number of logical fonts in this file */ + FT_LOCAL( FT_Error ) + pfr_log_font_count( FT_Stream stream, + FT_UInt32 log_section_offset, + FT_UInt *acount ); + + /* load a pfr logical font entry */ + FT_LOCAL( FT_Error ) + pfr_log_font_load( PFR_LogFont log_font, + FT_Stream stream, + FT_UInt face_index, + FT_UInt32 section_offset, + FT_Bool size_increment ); + + + /* load a physical font entry */ + FT_LOCAL( FT_Error ) + pfr_phy_font_load( PFR_PhyFont phy_font, + FT_Stream stream, + FT_UInt32 offset, + FT_UInt32 size ); + + /* finalize a physical font */ + FT_LOCAL( void ) + pfr_phy_font_done( PFR_PhyFont phy_font, + FT_Memory memory ); + + /* */ + +FT_END_HEADER + +#endif /* __PFRLOAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.c b/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.c index 180446d737d..1ab199742dc 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.c +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.c @@ -1,576 +1,576 @@ -/***************************************************************************/ -/* */ -/* pfrobjs.c */ -/* */ -/* FreeType PFR object methods (body). */ -/* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "pfrobjs.h" -#include "pfrload.h" -#include "pfrgload.h" -#include "pfrcmap.h" -#include "pfrsbit.h" -#include FT_OUTLINE_H -#include FT_INTERNAL_DEBUG_H - -#include "pfrerror.h" - -#undef FT_COMPONENT -#define FT_COMPONENT trace_pfr - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FACE OBJECT METHODS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - pfr_face_done( FT_Face pfrface ) /* PFR_Face */ - { - PFR_Face face = (PFR_Face)pfrface; - FT_Memory memory = pfrface->driver->root.memory; - - - /* we don't want dangling pointers */ - pfrface->family_name = NULL; - pfrface->style_name = NULL; - - /* finalize the physical font record */ - pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) ); - - /* no need to finalize the logical font or the header */ - FT_FREE( pfrface->available_sizes ); - } - - - FT_LOCAL_DEF( FT_Error ) - pfr_face_init( FT_Stream stream, - FT_Face pfrface, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - PFR_Face face = (PFR_Face)pfrface; - FT_Error error; - - FT_UNUSED( num_params ); - FT_UNUSED( params ); - - - /* load the header and check it */ - error = pfr_header_load( &face->header, stream ); - if ( error ) - goto Exit; - - if ( !pfr_header_check( &face->header ) ) - { - FT_TRACE4(( "pfr_face_init: not a valid PFR font\n" )); - error = PFR_Err_Unknown_File_Format; - goto Exit; - } - - /* check face index */ - { - FT_UInt num_faces; - - - error = pfr_log_font_count( stream, - face->header.log_dir_offset, - &num_faces ); - if ( error ) - goto Exit; - - pfrface->num_faces = num_faces; - } - - if ( face_index < 0 ) - goto Exit; - - if ( face_index >= pfrface->num_faces ) - { - FT_ERROR(( "pfr_face_init: invalid face index\n" )); - error = PFR_Err_Invalid_Argument; - goto Exit; - } - - /* load the face */ - error = pfr_log_font_load( - &face->log_font, stream, face_index, - face->header.log_dir_offset, - FT_BOOL( face->header.phy_font_max_size_high != 0 ) ); - if ( error ) - goto Exit; - - /* now load the physical font descriptor */ - error = pfr_phy_font_load( &face->phy_font, stream, - face->log_font.phys_offset, - face->log_font.phys_size ); - if ( error ) - goto Exit; - - /* now set up all root face fields */ - { - PFR_PhyFont phy_font = &face->phy_font; - - - pfrface->face_index = face_index; - pfrface->num_glyphs = phy_font->num_chars + 1; - pfrface->face_flags = FT_FACE_FLAG_SCALABLE; - - /* if all characters point to the same gps_offset 0, we */ - /* assume that the font only contains bitmaps */ - { - FT_UInt nn; - - - for ( nn = 0; nn < phy_font->num_chars; nn++ ) - if ( phy_font->chars[nn].gps_offset != 0 ) - break; - - if ( nn == phy_font->num_chars ) - pfrface->face_flags = 0; /* not scalable */ - } - - if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 ) - pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; - - if ( phy_font->flags & PFR_PHY_VERTICAL ) - pfrface->face_flags |= FT_FACE_FLAG_VERTICAL; - else - pfrface->face_flags |= FT_FACE_FLAG_HORIZONTAL; - - if ( phy_font->num_strikes > 0 ) - pfrface->face_flags |= FT_FACE_FLAG_FIXED_SIZES; - - if ( phy_font->num_kern_pairs > 0 ) - pfrface->face_flags |= FT_FACE_FLAG_KERNING; - - /* If no family name was found in the "undocumented" auxiliary - * data, use the font ID instead. This sucks but is better than - * nothing. - */ - pfrface->family_name = phy_font->family_name; - if ( pfrface->family_name == NULL ) - pfrface->family_name = phy_font->font_id; - - /* note that the style name can be NULL in certain PFR fonts, - * probably meaning "Regular" - */ - pfrface->style_name = phy_font->style_name; - - pfrface->num_fixed_sizes = 0; - pfrface->available_sizes = 0; - - pfrface->bbox = phy_font->bbox; - pfrface->units_per_EM = (FT_UShort)phy_font->outline_resolution; - pfrface->ascender = (FT_Short) phy_font->bbox.yMax; - pfrface->descender = (FT_Short) phy_font->bbox.yMin; - - pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 ); - if ( pfrface->height < pfrface->ascender - pfrface->descender ) - pfrface->height = (FT_Short)(pfrface->ascender - pfrface->descender); - - if ( phy_font->num_strikes > 0 ) - { - FT_UInt n, count = phy_font->num_strikes; - FT_Bitmap_Size* size; - PFR_Strike strike; - FT_Memory memory = pfrface->stream->memory; - - - if ( FT_NEW_ARRAY( pfrface->available_sizes, count ) ) - goto Exit; - - size = pfrface->available_sizes; - strike = phy_font->strikes; - for ( n = 0; n < count; n++, size++, strike++ ) - { - size->height = (FT_UShort)strike->y_ppm; - size->width = (FT_UShort)strike->x_ppm; - size->size = strike->y_ppm << 6; - size->x_ppem = strike->x_ppm << 6; - size->y_ppem = strike->y_ppm << 6; - } - pfrface->num_fixed_sizes = count; - } - - /* now compute maximum advance width */ - if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 ) - pfrface->max_advance_width = (FT_Short)phy_font->standard_advance; - else - { - FT_Int max = 0; - FT_UInt count = phy_font->num_chars; - PFR_Char gchar = phy_font->chars; - - - for ( ; count > 0; count--, gchar++ ) - { - if ( max < gchar->advance ) - max = gchar->advance; - } - - pfrface->max_advance_width = (FT_Short)max; - } - - pfrface->max_advance_height = pfrface->height; - - pfrface->underline_position = (FT_Short)( -pfrface->units_per_EM / 10 ); - pfrface->underline_thickness = (FT_Short)( pfrface->units_per_EM / 30 ); - - /* create charmap */ - { - FT_CharMapRec charmap; - - - charmap.face = pfrface; - charmap.platform_id = 3; - charmap.encoding_id = 1; - charmap.encoding = FT_ENCODING_UNICODE; - - FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL ); - -#if 0 - /* Select default charmap */ - if ( pfrface->num_charmaps ) - pfrface->charmap = pfrface->charmaps[0]; -#endif - } - - /* check whether we've loaded any kerning pairs */ - if ( phy_font->num_kern_pairs ) - pfrface->face_flags |= FT_FACE_FLAG_KERNING; - } - - Exit: - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** SLOT OBJECT METHOD *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( FT_Error ) - pfr_slot_init( FT_GlyphSlot pfrslot ) /* PFR_Slot */ - { - PFR_Slot slot = (PFR_Slot)pfrslot; - FT_GlyphLoader loader = pfrslot->internal->loader; - - - pfr_glyph_init( &slot->glyph, loader ); - - return 0; - } - - - FT_LOCAL_DEF( void ) - pfr_slot_done( FT_GlyphSlot pfrslot ) /* PFR_Slot */ - { - PFR_Slot slot = (PFR_Slot)pfrslot; - - - pfr_glyph_done( &slot->glyph ); - } - - - FT_LOCAL_DEF( FT_Error ) - pfr_slot_load( FT_GlyphSlot pfrslot, /* PFR_Slot */ - FT_Size pfrsize, /* PFR_Size */ - FT_UInt gindex, - FT_Int32 load_flags ) - { - PFR_Slot slot = (PFR_Slot)pfrslot; - PFR_Size size = (PFR_Size)pfrsize; - FT_Error error; - PFR_Face face = (PFR_Face)pfrslot->face; - PFR_Char gchar; - FT_Outline* outline = &pfrslot->outline; - FT_ULong gps_offset; - - - if ( gindex > 0 ) - gindex--; - - if ( !face || gindex >= face->phy_font.num_chars ) - { - error = PFR_Err_Invalid_Argument; - goto Exit; - } - - /* try to load an embedded bitmap */ - if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 ) - { - error = pfr_slot_load_bitmap( slot, size, gindex ); - if ( error == 0 ) - goto Exit; - } - - if ( load_flags & FT_LOAD_SBITS_ONLY ) - { - error = PFR_Err_Invalid_Argument; - goto Exit; - } - - gchar = face->phy_font.chars + gindex; - pfrslot->format = FT_GLYPH_FORMAT_OUTLINE; - outline->n_points = 0; - outline->n_contours = 0; - gps_offset = face->header.gps_section_offset; - - /* load the glyph outline (FT_LOAD_NO_RECURSE isn't supported) */ - error = pfr_glyph_load( &slot->glyph, face->root.stream, - gps_offset, gchar->gps_offset, gchar->gps_size ); - - if ( !error ) - { - FT_BBox cbox; - FT_Glyph_Metrics* metrics = &pfrslot->metrics; - FT_Pos advance; - FT_Int em_metrics, em_outline; - FT_Bool scaling; - - - scaling = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ); - - /* copy outline data */ - *outline = slot->glyph.loader->base.outline; - - outline->flags &= ~FT_OUTLINE_OWNER; - outline->flags |= FT_OUTLINE_REVERSE_FILL; - - if ( size && pfrsize->metrics.y_ppem < 24 ) - outline->flags |= FT_OUTLINE_HIGH_PRECISION; - - /* compute the advance vector */ - metrics->horiAdvance = 0; - metrics->vertAdvance = 0; - - advance = gchar->advance; - em_metrics = face->phy_font.metrics_resolution; - em_outline = face->phy_font.outline_resolution; - - if ( em_metrics != em_outline ) - advance = FT_MulDiv( advance, em_outline, em_metrics ); - - if ( face->phy_font.flags & PFR_PHY_VERTICAL ) - metrics->vertAdvance = advance; - else - metrics->horiAdvance = advance; - - pfrslot->linearHoriAdvance = metrics->horiAdvance; - pfrslot->linearVertAdvance = metrics->vertAdvance; - - /* make-up vertical metrics(?) */ - metrics->vertBearingX = 0; - metrics->vertBearingY = 0; - -#if 0 /* some fonts seem to be broken here! */ - - /* Apply the font matrix, if any. */ - /* TODO: Test existing fonts with unusual matrix */ - /* whether we have to adjust Units per EM. */ - { - FT_Matrix font_matrix; - - - font_matrix.xx = face->log_font.matrix[0] << 8; - font_matrix.yx = face->log_font.matrix[1] << 8; - font_matrix.xy = face->log_font.matrix[2] << 8; - font_matrix.yy = face->log_font.matrix[3] << 8; - - FT_Outline_Transform( outline, &font_matrix ); - } -#endif - - /* scale when needed */ - if ( scaling ) - { - FT_Int n; - FT_Fixed x_scale = pfrsize->metrics.x_scale; - FT_Fixed y_scale = pfrsize->metrics.y_scale; - FT_Vector* vec = outline->points; - - - /* scale outline points */ - for ( n = 0; n < outline->n_points; n++, vec++ ) - { - vec->x = FT_MulFix( vec->x, x_scale ); - vec->y = FT_MulFix( vec->y, y_scale ); - } - - /* scale the advance */ - metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); - metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); - } - - /* compute the rest of the metrics */ - FT_Outline_Get_CBox( outline, &cbox ); - - metrics->width = cbox.xMax - cbox.xMin; - metrics->height = cbox.yMax - cbox.yMin; - metrics->horiBearingX = cbox.xMin; - metrics->horiBearingY = cbox.yMax - metrics->height; - } - - Exit: - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** KERNING METHOD *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( FT_Error ) - pfr_face_get_kerning( FT_Face pfrface, /* PFR_Face */ - FT_UInt glyph1, - FT_UInt glyph2, - FT_Vector* kerning ) - { - PFR_Face face = (PFR_Face)pfrface; - FT_Error error = PFR_Err_Ok; - PFR_PhyFont phy_font = &face->phy_font; - FT_UInt32 code1, code2, pair; - - - kerning->x = 0; - kerning->y = 0; - - if ( glyph1 > 0 ) - glyph1--; - - if ( glyph2 > 0 ) - glyph2--; - - /* convert glyph indices to character codes */ - if ( glyph1 > phy_font->num_chars || - glyph2 > phy_font->num_chars ) - goto Exit; - - code1 = phy_font->chars[glyph1].char_code; - code2 = phy_font->chars[glyph2].char_code; - pair = PFR_KERN_INDEX( code1, code2 ); - - /* now search the list of kerning items */ - { - PFR_KernItem item = phy_font->kern_items; - FT_Stream stream = pfrface->stream; - - - for ( ; item; item = item->next ) - { - if ( pair >= item->pair1 && pair <= item->pair2 ) - goto FoundPair; - } - goto Exit; - - FoundPair: /* we found an item, now parse it and find the value if any */ - if ( FT_STREAM_SEEK( item->offset ) || - FT_FRAME_ENTER( item->pair_count * item->pair_size ) ) - goto Exit; - - { - FT_UInt count = item->pair_count; - FT_UInt size = item->pair_size; - FT_UInt power = (FT_UInt)ft_highpow2( (FT_UInt32)count ); - FT_UInt probe = power * size; - FT_UInt extra = count - power; - FT_Byte* base = stream->cursor; - FT_Bool twobytes = FT_BOOL( item->flags & 1 ); - FT_Bool twobyte_adj = FT_BOOL( item->flags & 2 ); - FT_Byte* p; - FT_UInt32 cpair; - - - if ( extra > 0 ) - { - p = base + extra * size; - - if ( twobytes ) - cpair = FT_NEXT_ULONG( p ); - else - cpair = PFR_NEXT_KPAIR( p ); - - if ( cpair == pair ) - goto Found; - - if ( cpair < pair ) - { - if ( twobyte_adj ) - p += 2; - else - p++; - base = p; - } - } - - while ( probe > size ) - { - probe >>= 1; - p = base + probe; - - if ( twobytes ) - cpair = FT_NEXT_ULONG( p ); - else - cpair = PFR_NEXT_KPAIR( p ); - - if ( cpair == pair ) - goto Found; - - if ( cpair < pair ) - base += probe; - } - - p = base; - - if ( twobytes ) - cpair = FT_NEXT_ULONG( p ); - else - cpair = PFR_NEXT_KPAIR( p ); - - if ( cpair == pair ) - { - FT_Int value; - - - Found: - if ( twobyte_adj ) - value = FT_PEEK_SHORT( p ); - else - value = p[0]; - - kerning->x = item->base_adj + value; - } - } - - FT_FRAME_EXIT(); - } - - Exit: - return error; - } - -/* END */ +/***************************************************************************/ +/* */ +/* pfrobjs.c */ +/* */ +/* FreeType PFR object methods (body). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "pfrobjs.h" +#include "pfrload.h" +#include "pfrgload.h" +#include "pfrcmap.h" +#include "pfrsbit.h" +#include FT_OUTLINE_H +#include FT_INTERNAL_DEBUG_H + +#include "pfrerror.h" + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pfr + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FACE OBJECT METHODS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + pfr_face_done( FT_Face pfrface ) /* PFR_Face */ + { + PFR_Face face = (PFR_Face)pfrface; + FT_Memory memory = pfrface->driver->root.memory; + + + /* we don't want dangling pointers */ + pfrface->family_name = NULL; + pfrface->style_name = NULL; + + /* finalize the physical font record */ + pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) ); + + /* no need to finalize the logical font or the header */ + FT_FREE( pfrface->available_sizes ); + } + + + FT_LOCAL_DEF( FT_Error ) + pfr_face_init( FT_Stream stream, + FT_Face pfrface, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + PFR_Face face = (PFR_Face)pfrface; + FT_Error error; + + FT_UNUSED( num_params ); + FT_UNUSED( params ); + + + /* load the header and check it */ + error = pfr_header_load( &face->header, stream ); + if ( error ) + goto Exit; + + if ( !pfr_header_check( &face->header ) ) + { + FT_TRACE4(( "pfr_face_init: not a valid PFR font\n" )); + error = PFR_Err_Unknown_File_Format; + goto Exit; + } + + /* check face index */ + { + FT_UInt num_faces; + + + error = pfr_log_font_count( stream, + face->header.log_dir_offset, + &num_faces ); + if ( error ) + goto Exit; + + pfrface->num_faces = num_faces; + } + + if ( face_index < 0 ) + goto Exit; + + if ( face_index >= pfrface->num_faces ) + { + FT_ERROR(( "pfr_face_init: invalid face index\n" )); + error = PFR_Err_Invalid_Argument; + goto Exit; + } + + /* load the face */ + error = pfr_log_font_load( + &face->log_font, stream, face_index, + face->header.log_dir_offset, + FT_BOOL( face->header.phy_font_max_size_high != 0 ) ); + if ( error ) + goto Exit; + + /* now load the physical font descriptor */ + error = pfr_phy_font_load( &face->phy_font, stream, + face->log_font.phys_offset, + face->log_font.phys_size ); + if ( error ) + goto Exit; + + /* now set up all root face fields */ + { + PFR_PhyFont phy_font = &face->phy_font; + + + pfrface->face_index = face_index; + pfrface->num_glyphs = phy_font->num_chars + 1; + pfrface->face_flags = FT_FACE_FLAG_SCALABLE; + + /* if all characters point to the same gps_offset 0, we */ + /* assume that the font only contains bitmaps */ + { + FT_UInt nn; + + + for ( nn = 0; nn < phy_font->num_chars; nn++ ) + if ( phy_font->chars[nn].gps_offset != 0 ) + break; + + if ( nn == phy_font->num_chars ) + pfrface->face_flags = 0; /* not scalable */ + } + + if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 ) + pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + + if ( phy_font->flags & PFR_PHY_VERTICAL ) + pfrface->face_flags |= FT_FACE_FLAG_VERTICAL; + else + pfrface->face_flags |= FT_FACE_FLAG_HORIZONTAL; + + if ( phy_font->num_strikes > 0 ) + pfrface->face_flags |= FT_FACE_FLAG_FIXED_SIZES; + + if ( phy_font->num_kern_pairs > 0 ) + pfrface->face_flags |= FT_FACE_FLAG_KERNING; + + /* If no family name was found in the "undocumented" auxiliary + * data, use the font ID instead. This sucks but is better than + * nothing. + */ + pfrface->family_name = phy_font->family_name; + if ( pfrface->family_name == NULL ) + pfrface->family_name = phy_font->font_id; + + /* note that the style name can be NULL in certain PFR fonts, + * probably meaning "Regular" + */ + pfrface->style_name = phy_font->style_name; + + pfrface->num_fixed_sizes = 0; + pfrface->available_sizes = 0; + + pfrface->bbox = phy_font->bbox; + pfrface->units_per_EM = (FT_UShort)phy_font->outline_resolution; + pfrface->ascender = (FT_Short) phy_font->bbox.yMax; + pfrface->descender = (FT_Short) phy_font->bbox.yMin; + + pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 ); + if ( pfrface->height < pfrface->ascender - pfrface->descender ) + pfrface->height = (FT_Short)(pfrface->ascender - pfrface->descender); + + if ( phy_font->num_strikes > 0 ) + { + FT_UInt n, count = phy_font->num_strikes; + FT_Bitmap_Size* size; + PFR_Strike strike; + FT_Memory memory = pfrface->stream->memory; + + + if ( FT_NEW_ARRAY( pfrface->available_sizes, count ) ) + goto Exit; + + size = pfrface->available_sizes; + strike = phy_font->strikes; + for ( n = 0; n < count; n++, size++, strike++ ) + { + size->height = (FT_UShort)strike->y_ppm; + size->width = (FT_UShort)strike->x_ppm; + size->size = strike->y_ppm << 6; + size->x_ppem = strike->x_ppm << 6; + size->y_ppem = strike->y_ppm << 6; + } + pfrface->num_fixed_sizes = count; + } + + /* now compute maximum advance width */ + if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 ) + pfrface->max_advance_width = (FT_Short)phy_font->standard_advance; + else + { + FT_Int max = 0; + FT_UInt count = phy_font->num_chars; + PFR_Char gchar = phy_font->chars; + + + for ( ; count > 0; count--, gchar++ ) + { + if ( max < gchar->advance ) + max = gchar->advance; + } + + pfrface->max_advance_width = (FT_Short)max; + } + + pfrface->max_advance_height = pfrface->height; + + pfrface->underline_position = (FT_Short)( -pfrface->units_per_EM / 10 ); + pfrface->underline_thickness = (FT_Short)( pfrface->units_per_EM / 30 ); + + /* create charmap */ + { + FT_CharMapRec charmap; + + + charmap.face = pfrface; + charmap.platform_id = 3; + charmap.encoding_id = 1; + charmap.encoding = FT_ENCODING_UNICODE; + + FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL ); + +#if 0 + /* Select default charmap */ + if ( pfrface->num_charmaps ) + pfrface->charmap = pfrface->charmaps[0]; +#endif + } + + /* check whether we've loaded any kerning pairs */ + if ( phy_font->num_kern_pairs ) + pfrface->face_flags |= FT_FACE_FLAG_KERNING; + } + + Exit: + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** SLOT OBJECT METHOD *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( FT_Error ) + pfr_slot_init( FT_GlyphSlot pfrslot ) /* PFR_Slot */ + { + PFR_Slot slot = (PFR_Slot)pfrslot; + FT_GlyphLoader loader = pfrslot->internal->loader; + + + pfr_glyph_init( &slot->glyph, loader ); + + return 0; + } + + + FT_LOCAL_DEF( void ) + pfr_slot_done( FT_GlyphSlot pfrslot ) /* PFR_Slot */ + { + PFR_Slot slot = (PFR_Slot)pfrslot; + + + pfr_glyph_done( &slot->glyph ); + } + + + FT_LOCAL_DEF( FT_Error ) + pfr_slot_load( FT_GlyphSlot pfrslot, /* PFR_Slot */ + FT_Size pfrsize, /* PFR_Size */ + FT_UInt gindex, + FT_Int32 load_flags ) + { + PFR_Slot slot = (PFR_Slot)pfrslot; + PFR_Size size = (PFR_Size)pfrsize; + FT_Error error; + PFR_Face face = (PFR_Face)pfrslot->face; + PFR_Char gchar; + FT_Outline* outline = &pfrslot->outline; + FT_ULong gps_offset; + + + if ( gindex > 0 ) + gindex--; + + if ( !face || gindex >= face->phy_font.num_chars ) + { + error = PFR_Err_Invalid_Argument; + goto Exit; + } + + /* try to load an embedded bitmap */ + if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 ) + { + error = pfr_slot_load_bitmap( slot, size, gindex ); + if ( error == 0 ) + goto Exit; + } + + if ( load_flags & FT_LOAD_SBITS_ONLY ) + { + error = PFR_Err_Invalid_Argument; + goto Exit; + } + + gchar = face->phy_font.chars + gindex; + pfrslot->format = FT_GLYPH_FORMAT_OUTLINE; + outline->n_points = 0; + outline->n_contours = 0; + gps_offset = face->header.gps_section_offset; + + /* load the glyph outline (FT_LOAD_NO_RECURSE isn't supported) */ + error = pfr_glyph_load( &slot->glyph, face->root.stream, + gps_offset, gchar->gps_offset, gchar->gps_size ); + + if ( !error ) + { + FT_BBox cbox; + FT_Glyph_Metrics* metrics = &pfrslot->metrics; + FT_Pos advance; + FT_Int em_metrics, em_outline; + FT_Bool scaling; + + + scaling = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ); + + /* copy outline data */ + *outline = slot->glyph.loader->base.outline; + + outline->flags &= ~FT_OUTLINE_OWNER; + outline->flags |= FT_OUTLINE_REVERSE_FILL; + + if ( size && pfrsize->metrics.y_ppem < 24 ) + outline->flags |= FT_OUTLINE_HIGH_PRECISION; + + /* compute the advance vector */ + metrics->horiAdvance = 0; + metrics->vertAdvance = 0; + + advance = gchar->advance; + em_metrics = face->phy_font.metrics_resolution; + em_outline = face->phy_font.outline_resolution; + + if ( em_metrics != em_outline ) + advance = FT_MulDiv( advance, em_outline, em_metrics ); + + if ( face->phy_font.flags & PFR_PHY_VERTICAL ) + metrics->vertAdvance = advance; + else + metrics->horiAdvance = advance; + + pfrslot->linearHoriAdvance = metrics->horiAdvance; + pfrslot->linearVertAdvance = metrics->vertAdvance; + + /* make-up vertical metrics(?) */ + metrics->vertBearingX = 0; + metrics->vertBearingY = 0; + +#if 0 /* some fonts seem to be broken here! */ + + /* Apply the font matrix, if any. */ + /* TODO: Test existing fonts with unusual matrix */ + /* whether we have to adjust Units per EM. */ + { + FT_Matrix font_matrix; + + + font_matrix.xx = face->log_font.matrix[0] << 8; + font_matrix.yx = face->log_font.matrix[1] << 8; + font_matrix.xy = face->log_font.matrix[2] << 8; + font_matrix.yy = face->log_font.matrix[3] << 8; + + FT_Outline_Transform( outline, &font_matrix ); + } +#endif + + /* scale when needed */ + if ( scaling ) + { + FT_Int n; + FT_Fixed x_scale = pfrsize->metrics.x_scale; + FT_Fixed y_scale = pfrsize->metrics.y_scale; + FT_Vector* vec = outline->points; + + + /* scale outline points */ + for ( n = 0; n < outline->n_points; n++, vec++ ) + { + vec->x = FT_MulFix( vec->x, x_scale ); + vec->y = FT_MulFix( vec->y, y_scale ); + } + + /* scale the advance */ + metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); + metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); + } + + /* compute the rest of the metrics */ + FT_Outline_Get_CBox( outline, &cbox ); + + metrics->width = cbox.xMax - cbox.xMin; + metrics->height = cbox.yMax - cbox.yMin; + metrics->horiBearingX = cbox.xMin; + metrics->horiBearingY = cbox.yMax - metrics->height; + } + + Exit: + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** KERNING METHOD *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( FT_Error ) + pfr_face_get_kerning( FT_Face pfrface, /* PFR_Face */ + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ) + { + PFR_Face face = (PFR_Face)pfrface; + FT_Error error = PFR_Err_Ok; + PFR_PhyFont phy_font = &face->phy_font; + FT_UInt32 code1, code2, pair; + + + kerning->x = 0; + kerning->y = 0; + + if ( glyph1 > 0 ) + glyph1--; + + if ( glyph2 > 0 ) + glyph2--; + + /* convert glyph indices to character codes */ + if ( glyph1 > phy_font->num_chars || + glyph2 > phy_font->num_chars ) + goto Exit; + + code1 = phy_font->chars[glyph1].char_code; + code2 = phy_font->chars[glyph2].char_code; + pair = PFR_KERN_INDEX( code1, code2 ); + + /* now search the list of kerning items */ + { + PFR_KernItem item = phy_font->kern_items; + FT_Stream stream = pfrface->stream; + + + for ( ; item; item = item->next ) + { + if ( pair >= item->pair1 && pair <= item->pair2 ) + goto FoundPair; + } + goto Exit; + + FoundPair: /* we found an item, now parse it and find the value if any */ + if ( FT_STREAM_SEEK( item->offset ) || + FT_FRAME_ENTER( item->pair_count * item->pair_size ) ) + goto Exit; + + { + FT_UInt count = item->pair_count; + FT_UInt size = item->pair_size; + FT_UInt power = (FT_UInt)ft_highpow2( (FT_UInt32)count ); + FT_UInt probe = power * size; + FT_UInt extra = count - power; + FT_Byte* base = stream->cursor; + FT_Bool twobytes = FT_BOOL( item->flags & 1 ); + FT_Bool twobyte_adj = FT_BOOL( item->flags & 2 ); + FT_Byte* p; + FT_UInt32 cpair; + + + if ( extra > 0 ) + { + p = base + extra * size; + + if ( twobytes ) + cpair = FT_NEXT_ULONG( p ); + else + cpair = PFR_NEXT_KPAIR( p ); + + if ( cpair == pair ) + goto Found; + + if ( cpair < pair ) + { + if ( twobyte_adj ) + p += 2; + else + p++; + base = p; + } + } + + while ( probe > size ) + { + probe >>= 1; + p = base + probe; + + if ( twobytes ) + cpair = FT_NEXT_ULONG( p ); + else + cpair = PFR_NEXT_KPAIR( p ); + + if ( cpair == pair ) + goto Found; + + if ( cpair < pair ) + base += probe; + } + + p = base; + + if ( twobytes ) + cpair = FT_NEXT_ULONG( p ); + else + cpair = PFR_NEXT_KPAIR( p ); + + if ( cpair == pair ) + { + FT_Int value; + + + Found: + if ( twobyte_adj ) + value = FT_PEEK_SHORT( p ); + else + value = p[0]; + + kerning->x = item->base_adj + value; + } + } + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.h index f6aa8b44cc6..85153a09e78 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrobjs.h @@ -1,96 +1,96 @@ -/***************************************************************************/ -/* */ -/* pfrobjs.h */ -/* */ -/* FreeType PFR object methods (specification). */ -/* */ -/* Copyright 2002, 2003, 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PFROBJS_H__ -#define __PFROBJS_H__ - -#include "pfrtypes.h" - - -FT_BEGIN_HEADER - - typedef struct PFR_FaceRec_* PFR_Face; - - typedef struct PFR_SizeRec_* PFR_Size; - - typedef struct PFR_SlotRec_* PFR_Slot; - - - typedef struct PFR_FaceRec_ - { - FT_FaceRec root; - PFR_HeaderRec header; - PFR_LogFontRec log_font; - PFR_PhyFontRec phy_font; - - } PFR_FaceRec; - - - typedef struct PFR_SizeRec_ - { - FT_SizeRec root; - - } PFR_SizeRec; - - - typedef struct PFR_SlotRec_ - { - FT_GlyphSlotRec root; - PFR_GlyphRec glyph; - - } PFR_SlotRec; - - - FT_LOCAL( FT_Error ) - pfr_face_init( FT_Stream stream, - FT_Face face, /* PFR_Face */ - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ); - - FT_LOCAL( void ) - pfr_face_done( FT_Face face ); /* PFR_Face */ - - - FT_LOCAL( FT_Error ) - pfr_face_get_kerning( FT_Face face, /* PFR_Face */ - FT_UInt glyph1, - FT_UInt glyph2, - FT_Vector* kerning ); - - - FT_LOCAL( FT_Error ) - pfr_slot_init( FT_GlyphSlot slot ); /* PFR_Slot */ - - FT_LOCAL( void ) - pfr_slot_done( FT_GlyphSlot slot ); /* PFR_Slot */ - - - FT_LOCAL( FT_Error ) - pfr_slot_load( FT_GlyphSlot slot, /* PFR_Slot */ - FT_Size size, /* PFR_Size */ - FT_UInt gindex, - FT_Int32 load_flags ); - - -FT_END_HEADER - -#endif /* __PFROBJS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrobjs.h */ +/* */ +/* FreeType PFR object methods (specification). */ +/* */ +/* Copyright 2002, 2003, 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFROBJS_H__ +#define __PFROBJS_H__ + +#include "pfrtypes.h" + + +FT_BEGIN_HEADER + + typedef struct PFR_FaceRec_* PFR_Face; + + typedef struct PFR_SizeRec_* PFR_Size; + + typedef struct PFR_SlotRec_* PFR_Slot; + + + typedef struct PFR_FaceRec_ + { + FT_FaceRec root; + PFR_HeaderRec header; + PFR_LogFontRec log_font; + PFR_PhyFontRec phy_font; + + } PFR_FaceRec; + + + typedef struct PFR_SizeRec_ + { + FT_SizeRec root; + + } PFR_SizeRec; + + + typedef struct PFR_SlotRec_ + { + FT_GlyphSlotRec root; + PFR_GlyphRec glyph; + + } PFR_SlotRec; + + + FT_LOCAL( FT_Error ) + pfr_face_init( FT_Stream stream, + FT_Face face, /* PFR_Face */ + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); + + FT_LOCAL( void ) + pfr_face_done( FT_Face face ); /* PFR_Face */ + + + FT_LOCAL( FT_Error ) + pfr_face_get_kerning( FT_Face face, /* PFR_Face */ + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ); + + + FT_LOCAL( FT_Error ) + pfr_slot_init( FT_GlyphSlot slot ); /* PFR_Slot */ + + FT_LOCAL( void ) + pfr_slot_done( FT_GlyphSlot slot ); /* PFR_Slot */ + + + FT_LOCAL( FT_Error ) + pfr_slot_load( FT_GlyphSlot slot, /* PFR_Slot */ + FT_Size size, /* PFR_Size */ + FT_UInt gindex, + FT_Int32 load_flags ); + + +FT_END_HEADER + +#endif /* __PFROBJS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.c b/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.c index 45ff6663b36..8e1c5beafc1 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.c +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.c @@ -1,680 +1,680 @@ -/***************************************************************************/ -/* */ -/* pfrsbit.c */ -/* */ -/* FreeType PFR bitmap loader (body). */ -/* */ -/* Copyright 2002, 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "pfrsbit.h" -#include "pfrload.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H - -#include "pfrerror.h" - -#undef FT_COMPONENT -#define FT_COMPONENT trace_pfr - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PFR BIT WRITER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - typedef struct PFR_BitWriter_ - { - FT_Byte* line; /* current line start */ - FT_Int pitch; /* line size in bytes */ - FT_Int width; /* width in pixels/bits */ - FT_Int rows; /* number of remaining rows to scan */ - FT_Int total; /* total number of bits to draw */ - - } PFR_BitWriterRec, *PFR_BitWriter; - - - static void - pfr_bitwriter_init( PFR_BitWriter writer, - FT_Bitmap* target, - FT_Bool decreasing ) - { - writer->line = target->buffer; - writer->pitch = target->pitch; - writer->width = target->width; - writer->rows = target->rows; - writer->total = writer->width * writer->rows; - - if ( !decreasing ) - { - writer->line += writer->pitch * ( target->rows-1 ); - writer->pitch = -writer->pitch; - } - } - - - static void - pfr_bitwriter_decode_bytes( PFR_BitWriter writer, - FT_Byte* p, - FT_Byte* limit ) - { - FT_Int n, reload; - FT_Int left = writer->width; - FT_Byte* cur = writer->line; - FT_UInt mask = 0x80; - FT_UInt val = 0; - FT_UInt c = 0; - - - n = (FT_Int)( limit - p ) * 8; - if ( n > writer->total ) - n = writer->total; - - reload = n & 7; - - for ( ; n > 0; n-- ) - { - if ( ( n & 7 ) == reload ) - val = *p++; - - if ( val & 0x80 ) - c |= mask; - - val <<= 1; - mask >>= 1; - - if ( --left <= 0 ) - { - cur[0] = (FT_Byte)c; - left = writer->width; - mask = 0x80; - - writer->line += writer->pitch; - cur = writer->line; - c = 0; - } - else if ( mask == 0 ) - { - cur[0] = (FT_Byte)c; - mask = 0x80; - c = 0; - cur ++; - } - } - - if ( mask != 0x80 ) - cur[0] = (FT_Byte)c; - } - - - static void - pfr_bitwriter_decode_rle1( PFR_BitWriter writer, - FT_Byte* p, - FT_Byte* limit ) - { - FT_Int n, phase, count, counts[2], reload; - FT_Int left = writer->width; - FT_Byte* cur = writer->line; - FT_UInt mask = 0x80; - FT_UInt c = 0; - - - n = writer->total; - - phase = 1; - counts[0] = 0; - counts[1] = 0; - count = 0; - reload = 1; - - for ( ; n > 0; n-- ) - { - if ( reload ) - { - do - { - if ( phase ) - { - FT_Int v; - - - if ( p >= limit ) - break; - - v = *p++; - counts[0] = v >> 4; - counts[1] = v & 15; - phase = 0; - count = counts[0]; - } - else - { - phase = 1; - count = counts[1]; - } - - } while ( count == 0 ); - } - - if ( phase ) - c |= mask; - - mask >>= 1; - - if ( --left <= 0 ) - { - cur[0] = (FT_Byte) c; - left = writer->width; - mask = 0x80; - - writer->line += writer->pitch; - cur = writer->line; - c = 0; - } - else if ( mask == 0 ) - { - cur[0] = (FT_Byte)c; - mask = 0x80; - c = 0; - cur ++; - } - - reload = ( --count <= 0 ); - } - - if ( mask != 0x80 ) - cur[0] = (FT_Byte) c; - } - - - static void - pfr_bitwriter_decode_rle2( PFR_BitWriter writer, - FT_Byte* p, - FT_Byte* limit ) - { - FT_Int n, phase, count, reload; - FT_Int left = writer->width; - FT_Byte* cur = writer->line; - FT_UInt mask = 0x80; - FT_UInt c = 0; - - - n = writer->total; - - phase = 1; - count = 0; - reload = 1; - - for ( ; n > 0; n-- ) - { - if ( reload ) - { - do - { - if ( p >= limit ) - break; - - count = *p++; - phase = phase ^ 1; - - } while ( count == 0 ); - } - - if ( phase ) - c |= mask; - - mask >>= 1; - - if ( --left <= 0 ) - { - cur[0] = (FT_Byte) c; - c = 0; - mask = 0x80; - left = writer->width; - - writer->line += writer->pitch; - cur = writer->line; - } - else if ( mask == 0 ) - { - cur[0] = (FT_Byte)c; - c = 0; - mask = 0x80; - cur ++; - } - - reload = ( --count <= 0 ); - } - - if ( mask != 0x80 ) - cur[0] = (FT_Byte) c; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** BITMAP DATA DECODING *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - pfr_lookup_bitmap_data( FT_Byte* base, - FT_Byte* limit, - FT_UInt count, - FT_UInt flags, - FT_UInt char_code, - FT_ULong* found_offset, - FT_ULong* found_size ) - { - FT_UInt left, right, char_len; - FT_Bool two = FT_BOOL( flags & 1 ); - FT_Byte* buff; - - - char_len = 4; - if ( two ) char_len += 1; - if ( flags & 2 ) char_len += 1; - if ( flags & 4 ) char_len += 1; - - left = 0; - right = count; - - while ( left < right ) - { - FT_UInt middle, code; - - - middle = ( left + right ) >> 1; - buff = base + middle * char_len; - - /* check that we are not outside of the table -- */ - /* this is possible with broken fonts... */ - if ( buff + char_len > limit ) - goto Fail; - - if ( two ) - code = PFR_NEXT_USHORT( buff ); - else - code = PFR_NEXT_BYTE( buff ); - - if ( code == char_code ) - goto Found_It; - - if ( code < char_code ) - left = middle; - else - right = middle; - } - - Fail: - /* Not found */ - *found_size = 0; - *found_offset = 0; - return; - - Found_It: - if ( flags & 2 ) - *found_size = PFR_NEXT_USHORT( buff ); - else - *found_size = PFR_NEXT_BYTE( buff ); - - if ( flags & 4 ) - *found_offset = PFR_NEXT_ULONG( buff ); - else - *found_offset = PFR_NEXT_USHORT( buff ); - } - - - /* load bitmap metrics. "*padvance" must be set to the default value */ - /* before calling this function... */ - /* */ - static FT_Error - pfr_load_bitmap_metrics( FT_Byte** pdata, - FT_Byte* limit, - FT_Long scaled_advance, - FT_Long *axpos, - FT_Long *aypos, - FT_UInt *axsize, - FT_UInt *aysize, - FT_Long *aadvance, - FT_UInt *aformat ) - { - FT_Error error = 0; - FT_Byte flags; - FT_Char b; - FT_Byte* p = *pdata; - FT_Long xpos, ypos, advance; - FT_UInt xsize, ysize; - - - PFR_CHECK( 1 ); - flags = PFR_NEXT_BYTE( p ); - - xpos = 0; - ypos = 0; - xsize = 0; - ysize = 0; - advance = 0; - - switch ( flags & 3 ) - { - case 0: - PFR_CHECK( 1 ); - b = PFR_NEXT_INT8( p ); - xpos = b >> 4; - ypos = ( (FT_Char)( b << 4 ) ) >> 4; - break; - - case 1: - PFR_CHECK( 2 ); - xpos = PFR_NEXT_INT8( p ); - ypos = PFR_NEXT_INT8( p ); - break; - - case 2: - PFR_CHECK( 4 ); - xpos = PFR_NEXT_SHORT( p ); - ypos = PFR_NEXT_SHORT( p ); - break; - - case 3: - PFR_CHECK( 6 ); - xpos = PFR_NEXT_LONG( p ); - ypos = PFR_NEXT_LONG( p ); - break; - - default: - ; - } - - flags >>= 2; - switch ( flags & 3 ) - { - case 0: - /* blank image */ - xsize = 0; - ysize = 0; - break; - - case 1: - PFR_CHECK( 1 ); - b = PFR_NEXT_BYTE( p ); - xsize = ( b >> 4 ) & 0xF; - ysize = b & 0xF; - break; - - case 2: - PFR_CHECK( 2 ); - xsize = PFR_NEXT_BYTE( p ); - ysize = PFR_NEXT_BYTE( p ); - break; - - case 3: - PFR_CHECK( 4 ); - xsize = PFR_NEXT_USHORT( p ); - ysize = PFR_NEXT_USHORT( p ); - break; - - default: - ; - } - - flags >>= 2; - switch ( flags & 3 ) - { - case 0: - advance = scaled_advance; - break; - - case 1: - PFR_CHECK( 1 ); - advance = PFR_NEXT_INT8( p ) << 8; - break; - - case 2: - PFR_CHECK( 2 ); - advance = PFR_NEXT_SHORT( p ); - break; - - case 3: - PFR_CHECK( 3 ); - advance = PFR_NEXT_LONG( p ); - break; - - default: - ; - } - - *axpos = xpos; - *aypos = ypos; - *axsize = xsize; - *aysize = ysize; - *aadvance = advance; - *aformat = flags >> 2; - *pdata = p; - - Exit: - return error; - - Too_Short: - error = PFR_Err_Invalid_Table; - FT_ERROR(( "pfr_load_bitmap_metrics: invalid glyph data\n" )); - goto Exit; - } - - - static FT_Error - pfr_load_bitmap_bits( FT_Byte* p, - FT_Byte* limit, - FT_UInt format, - FT_Bool decreasing, - FT_Bitmap* target ) - { - FT_Error error = 0; - PFR_BitWriterRec writer; - - - if ( target->rows > 0 && target->width > 0 ) - { - pfr_bitwriter_init( &writer, target, decreasing ); - - switch ( format ) - { - case 0: /* packed bits */ - pfr_bitwriter_decode_bytes( &writer, p, limit ); - break; - - case 1: /* RLE1 */ - pfr_bitwriter_decode_rle1( &writer, p, limit ); - break; - - case 2: /* RLE2 */ - pfr_bitwriter_decode_rle2( &writer, p, limit ); - break; - - default: - FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" )); - error = PFR_Err_Invalid_File_Format; - } - } - - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** BITMAP LOADING *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( FT_Error ) - pfr_slot_load_bitmap( PFR_Slot glyph, - PFR_Size size, - FT_UInt glyph_index ) - { - FT_Error error; - PFR_Face face = (PFR_Face) glyph->root.face; - FT_Stream stream = face->root.stream; - PFR_PhyFont phys = &face->phy_font; - FT_ULong gps_offset; - FT_ULong gps_size; - PFR_Char character; - PFR_Strike strike; - - - character = &phys->chars[glyph_index]; - - /* Look-up a bitmap strike corresponding to the current */ - /* character dimensions */ - { - FT_UInt n; - - - strike = phys->strikes; - for ( n = 0; n < phys->num_strikes; n++ ) - { - if ( strike->x_ppm == (FT_UInt)size->root.metrics.x_ppem && - strike->y_ppm == (FT_UInt)size->root.metrics.y_ppem ) - { - goto Found_Strike; - } - - strike++; - } - - /* couldn't find it */ - return PFR_Err_Invalid_Argument; - } - - Found_Strike: - - /* Now lookup the glyph's position within the file */ - { - FT_UInt char_len; - - - char_len = 4; - if ( strike->flags & 1 ) char_len += 1; - if ( strike->flags & 2 ) char_len += 1; - if ( strike->flags & 4 ) char_len += 1; - - /* Access data directly in the frame to speed lookups */ - if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) || - FT_FRAME_ENTER( char_len * strike->num_bitmaps ) ) - goto Exit; - - pfr_lookup_bitmap_data( stream->cursor, - stream->limit, - strike->num_bitmaps, - strike->flags, - character->char_code, - &gps_offset, - &gps_size ); - - FT_FRAME_EXIT(); - - if ( gps_size == 0 ) - { - /* Could not find a bitmap program string for this glyph */ - error = PFR_Err_Invalid_Argument; - goto Exit; - } - } - - /* get the bitmap metrics */ - { - FT_Long xpos, ypos, advance; - FT_UInt xsize, ysize, format; - FT_Byte* p; - - - /* compute linear advance */ - advance = character->advance; - if ( phys->metrics_resolution != phys->outline_resolution ) - advance = FT_MulDiv( advance, - phys->outline_resolution, - phys->metrics_resolution ); - - glyph->root.linearHoriAdvance = advance; - - /* compute default advance, i.e., scaled advance. This can be */ - /* overridden in the bitmap header of certain glyphs. */ - advance = FT_MulDiv( (FT_Fixed)size->root.metrics.x_ppem << 8, - character->advance, - phys->metrics_resolution ); - - if ( FT_STREAM_SEEK( face->header.gps_section_offset + gps_offset ) || - FT_FRAME_ENTER( gps_size ) ) - goto Exit; - - p = stream->cursor; - error = pfr_load_bitmap_metrics( &p, stream->limit, - advance, - &xpos, &ypos, - &xsize, &ysize, - &advance, &format ); - if ( !error ) - { - glyph->root.format = FT_GLYPH_FORMAT_BITMAP; - - /* Set up glyph bitmap and metrics */ - glyph->root.bitmap.width = (FT_Int)xsize; - glyph->root.bitmap.rows = (FT_Int)ysize; - glyph->root.bitmap.pitch = (FT_Long)( xsize + 7 ) >> 3; - glyph->root.bitmap.pixel_mode = FT_PIXEL_MODE_MONO; - - glyph->root.metrics.width = (FT_Long)xsize << 6; - glyph->root.metrics.height = (FT_Long)ysize << 6; - glyph->root.metrics.horiBearingX = xpos << 6; - glyph->root.metrics.horiBearingY = ypos << 6; - glyph->root.metrics.horiAdvance = FT_PIX_ROUND( ( advance >> 2 ) ); - glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1; - glyph->root.metrics.vertBearingY = 0; - glyph->root.metrics.vertAdvance = size->root.metrics.height; - - glyph->root.bitmap_left = xpos; - glyph->root.bitmap_top = ypos + ysize; - - /* Allocate and read bitmap data */ - { - FT_ULong len = glyph->root.bitmap.pitch * ysize; - - - error = ft_glyphslot_alloc_bitmap( &glyph->root, len ); - if ( !error ) - { - error = pfr_load_bitmap_bits( - p, - stream->limit, - format, - FT_BOOL(face->header.color_flags & 2), - &glyph->root.bitmap ); - } - } - } - - FT_FRAME_EXIT(); - } - - Exit: - return error; - } - -/* END */ +/***************************************************************************/ +/* */ +/* pfrsbit.c */ +/* */ +/* FreeType PFR bitmap loader (body). */ +/* */ +/* Copyright 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "pfrsbit.h" +#include "pfrload.h" +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H + +#include "pfrerror.h" + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pfr + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PFR BIT WRITER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct PFR_BitWriter_ + { + FT_Byte* line; /* current line start */ + FT_Int pitch; /* line size in bytes */ + FT_Int width; /* width in pixels/bits */ + FT_Int rows; /* number of remaining rows to scan */ + FT_Int total; /* total number of bits to draw */ + + } PFR_BitWriterRec, *PFR_BitWriter; + + + static void + pfr_bitwriter_init( PFR_BitWriter writer, + FT_Bitmap* target, + FT_Bool decreasing ) + { + writer->line = target->buffer; + writer->pitch = target->pitch; + writer->width = target->width; + writer->rows = target->rows; + writer->total = writer->width * writer->rows; + + if ( !decreasing ) + { + writer->line += writer->pitch * ( target->rows-1 ); + writer->pitch = -writer->pitch; + } + } + + + static void + pfr_bitwriter_decode_bytes( PFR_BitWriter writer, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Int n, reload; + FT_Int left = writer->width; + FT_Byte* cur = writer->line; + FT_UInt mask = 0x80; + FT_UInt val = 0; + FT_UInt c = 0; + + + n = (FT_Int)( limit - p ) * 8; + if ( n > writer->total ) + n = writer->total; + + reload = n & 7; + + for ( ; n > 0; n-- ) + { + if ( ( n & 7 ) == reload ) + val = *p++; + + if ( val & 0x80 ) + c |= mask; + + val <<= 1; + mask >>= 1; + + if ( --left <= 0 ) + { + cur[0] = (FT_Byte)c; + left = writer->width; + mask = 0x80; + + writer->line += writer->pitch; + cur = writer->line; + c = 0; + } + else if ( mask == 0 ) + { + cur[0] = (FT_Byte)c; + mask = 0x80; + c = 0; + cur ++; + } + } + + if ( mask != 0x80 ) + cur[0] = (FT_Byte)c; + } + + + static void + pfr_bitwriter_decode_rle1( PFR_BitWriter writer, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Int n, phase, count, counts[2], reload; + FT_Int left = writer->width; + FT_Byte* cur = writer->line; + FT_UInt mask = 0x80; + FT_UInt c = 0; + + + n = writer->total; + + phase = 1; + counts[0] = 0; + counts[1] = 0; + count = 0; + reload = 1; + + for ( ; n > 0; n-- ) + { + if ( reload ) + { + do + { + if ( phase ) + { + FT_Int v; + + + if ( p >= limit ) + break; + + v = *p++; + counts[0] = v >> 4; + counts[1] = v & 15; + phase = 0; + count = counts[0]; + } + else + { + phase = 1; + count = counts[1]; + } + + } while ( count == 0 ); + } + + if ( phase ) + c |= mask; + + mask >>= 1; + + if ( --left <= 0 ) + { + cur[0] = (FT_Byte) c; + left = writer->width; + mask = 0x80; + + writer->line += writer->pitch; + cur = writer->line; + c = 0; + } + else if ( mask == 0 ) + { + cur[0] = (FT_Byte)c; + mask = 0x80; + c = 0; + cur ++; + } + + reload = ( --count <= 0 ); + } + + if ( mask != 0x80 ) + cur[0] = (FT_Byte) c; + } + + + static void + pfr_bitwriter_decode_rle2( PFR_BitWriter writer, + FT_Byte* p, + FT_Byte* limit ) + { + FT_Int n, phase, count, reload; + FT_Int left = writer->width; + FT_Byte* cur = writer->line; + FT_UInt mask = 0x80; + FT_UInt c = 0; + + + n = writer->total; + + phase = 1; + count = 0; + reload = 1; + + for ( ; n > 0; n-- ) + { + if ( reload ) + { + do + { + if ( p >= limit ) + break; + + count = *p++; + phase = phase ^ 1; + + } while ( count == 0 ); + } + + if ( phase ) + c |= mask; + + mask >>= 1; + + if ( --left <= 0 ) + { + cur[0] = (FT_Byte) c; + c = 0; + mask = 0x80; + left = writer->width; + + writer->line += writer->pitch; + cur = writer->line; + } + else if ( mask == 0 ) + { + cur[0] = (FT_Byte)c; + c = 0; + mask = 0x80; + cur ++; + } + + reload = ( --count <= 0 ); + } + + if ( mask != 0x80 ) + cur[0] = (FT_Byte) c; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BITMAP DATA DECODING *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + pfr_lookup_bitmap_data( FT_Byte* base, + FT_Byte* limit, + FT_UInt count, + FT_UInt flags, + FT_UInt char_code, + FT_ULong* found_offset, + FT_ULong* found_size ) + { + FT_UInt left, right, char_len; + FT_Bool two = FT_BOOL( flags & 1 ); + FT_Byte* buff; + + + char_len = 4; + if ( two ) char_len += 1; + if ( flags & 2 ) char_len += 1; + if ( flags & 4 ) char_len += 1; + + left = 0; + right = count; + + while ( left < right ) + { + FT_UInt middle, code; + + + middle = ( left + right ) >> 1; + buff = base + middle * char_len; + + /* check that we are not outside of the table -- */ + /* this is possible with broken fonts... */ + if ( buff + char_len > limit ) + goto Fail; + + if ( two ) + code = PFR_NEXT_USHORT( buff ); + else + code = PFR_NEXT_BYTE( buff ); + + if ( code == char_code ) + goto Found_It; + + if ( code < char_code ) + left = middle; + else + right = middle; + } + + Fail: + /* Not found */ + *found_size = 0; + *found_offset = 0; + return; + + Found_It: + if ( flags & 2 ) + *found_size = PFR_NEXT_USHORT( buff ); + else + *found_size = PFR_NEXT_BYTE( buff ); + + if ( flags & 4 ) + *found_offset = PFR_NEXT_ULONG( buff ); + else + *found_offset = PFR_NEXT_USHORT( buff ); + } + + + /* load bitmap metrics. "*padvance" must be set to the default value */ + /* before calling this function... */ + /* */ + static FT_Error + pfr_load_bitmap_metrics( FT_Byte** pdata, + FT_Byte* limit, + FT_Long scaled_advance, + FT_Long *axpos, + FT_Long *aypos, + FT_UInt *axsize, + FT_UInt *aysize, + FT_Long *aadvance, + FT_UInt *aformat ) + { + FT_Error error = 0; + FT_Byte flags; + FT_Char b; + FT_Byte* p = *pdata; + FT_Long xpos, ypos, advance; + FT_UInt xsize, ysize; + + + PFR_CHECK( 1 ); + flags = PFR_NEXT_BYTE( p ); + + xpos = 0; + ypos = 0; + xsize = 0; + ysize = 0; + advance = 0; + + switch ( flags & 3 ) + { + case 0: + PFR_CHECK( 1 ); + b = PFR_NEXT_INT8( p ); + xpos = b >> 4; + ypos = ( (FT_Char)( b << 4 ) ) >> 4; + break; + + case 1: + PFR_CHECK( 2 ); + xpos = PFR_NEXT_INT8( p ); + ypos = PFR_NEXT_INT8( p ); + break; + + case 2: + PFR_CHECK( 4 ); + xpos = PFR_NEXT_SHORT( p ); + ypos = PFR_NEXT_SHORT( p ); + break; + + case 3: + PFR_CHECK( 6 ); + xpos = PFR_NEXT_LONG( p ); + ypos = PFR_NEXT_LONG( p ); + break; + + default: + ; + } + + flags >>= 2; + switch ( flags & 3 ) + { + case 0: + /* blank image */ + xsize = 0; + ysize = 0; + break; + + case 1: + PFR_CHECK( 1 ); + b = PFR_NEXT_BYTE( p ); + xsize = ( b >> 4 ) & 0xF; + ysize = b & 0xF; + break; + + case 2: + PFR_CHECK( 2 ); + xsize = PFR_NEXT_BYTE( p ); + ysize = PFR_NEXT_BYTE( p ); + break; + + case 3: + PFR_CHECK( 4 ); + xsize = PFR_NEXT_USHORT( p ); + ysize = PFR_NEXT_USHORT( p ); + break; + + default: + ; + } + + flags >>= 2; + switch ( flags & 3 ) + { + case 0: + advance = scaled_advance; + break; + + case 1: + PFR_CHECK( 1 ); + advance = PFR_NEXT_INT8( p ) << 8; + break; + + case 2: + PFR_CHECK( 2 ); + advance = PFR_NEXT_SHORT( p ); + break; + + case 3: + PFR_CHECK( 3 ); + advance = PFR_NEXT_LONG( p ); + break; + + default: + ; + } + + *axpos = xpos; + *aypos = ypos; + *axsize = xsize; + *aysize = ysize; + *aadvance = advance; + *aformat = flags >> 2; + *pdata = p; + + Exit: + return error; + + Too_Short: + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_load_bitmap_metrics: invalid glyph data\n" )); + goto Exit; + } + + + static FT_Error + pfr_load_bitmap_bits( FT_Byte* p, + FT_Byte* limit, + FT_UInt format, + FT_Bool decreasing, + FT_Bitmap* target ) + { + FT_Error error = 0; + PFR_BitWriterRec writer; + + + if ( target->rows > 0 && target->width > 0 ) + { + pfr_bitwriter_init( &writer, target, decreasing ); + + switch ( format ) + { + case 0: /* packed bits */ + pfr_bitwriter_decode_bytes( &writer, p, limit ); + break; + + case 1: /* RLE1 */ + pfr_bitwriter_decode_rle1( &writer, p, limit ); + break; + + case 2: /* RLE2 */ + pfr_bitwriter_decode_rle2( &writer, p, limit ); + break; + + default: + FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" )); + error = PFR_Err_Invalid_File_Format; + } + } + + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BITMAP LOADING *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( FT_Error ) + pfr_slot_load_bitmap( PFR_Slot glyph, + PFR_Size size, + FT_UInt glyph_index ) + { + FT_Error error; + PFR_Face face = (PFR_Face) glyph->root.face; + FT_Stream stream = face->root.stream; + PFR_PhyFont phys = &face->phy_font; + FT_ULong gps_offset; + FT_ULong gps_size; + PFR_Char character; + PFR_Strike strike; + + + character = &phys->chars[glyph_index]; + + /* Look-up a bitmap strike corresponding to the current */ + /* character dimensions */ + { + FT_UInt n; + + + strike = phys->strikes; + for ( n = 0; n < phys->num_strikes; n++ ) + { + if ( strike->x_ppm == (FT_UInt)size->root.metrics.x_ppem && + strike->y_ppm == (FT_UInt)size->root.metrics.y_ppem ) + { + goto Found_Strike; + } + + strike++; + } + + /* couldn't find it */ + return PFR_Err_Invalid_Argument; + } + + Found_Strike: + + /* Now lookup the glyph's position within the file */ + { + FT_UInt char_len; + + + char_len = 4; + if ( strike->flags & 1 ) char_len += 1; + if ( strike->flags & 2 ) char_len += 1; + if ( strike->flags & 4 ) char_len += 1; + + /* Access data directly in the frame to speed lookups */ + if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) || + FT_FRAME_ENTER( char_len * strike->num_bitmaps ) ) + goto Exit; + + pfr_lookup_bitmap_data( stream->cursor, + stream->limit, + strike->num_bitmaps, + strike->flags, + character->char_code, + &gps_offset, + &gps_size ); + + FT_FRAME_EXIT(); + + if ( gps_size == 0 ) + { + /* Could not find a bitmap program string for this glyph */ + error = PFR_Err_Invalid_Argument; + goto Exit; + } + } + + /* get the bitmap metrics */ + { + FT_Long xpos, ypos, advance; + FT_UInt xsize, ysize, format; + FT_Byte* p; + + + /* compute linear advance */ + advance = character->advance; + if ( phys->metrics_resolution != phys->outline_resolution ) + advance = FT_MulDiv( advance, + phys->outline_resolution, + phys->metrics_resolution ); + + glyph->root.linearHoriAdvance = advance; + + /* compute default advance, i.e., scaled advance. This can be */ + /* overridden in the bitmap header of certain glyphs. */ + advance = FT_MulDiv( (FT_Fixed)size->root.metrics.x_ppem << 8, + character->advance, + phys->metrics_resolution ); + + if ( FT_STREAM_SEEK( face->header.gps_section_offset + gps_offset ) || + FT_FRAME_ENTER( gps_size ) ) + goto Exit; + + p = stream->cursor; + error = pfr_load_bitmap_metrics( &p, stream->limit, + advance, + &xpos, &ypos, + &xsize, &ysize, + &advance, &format ); + if ( !error ) + { + glyph->root.format = FT_GLYPH_FORMAT_BITMAP; + + /* Set up glyph bitmap and metrics */ + glyph->root.bitmap.width = (FT_Int)xsize; + glyph->root.bitmap.rows = (FT_Int)ysize; + glyph->root.bitmap.pitch = (FT_Long)( xsize + 7 ) >> 3; + glyph->root.bitmap.pixel_mode = FT_PIXEL_MODE_MONO; + + glyph->root.metrics.width = (FT_Long)xsize << 6; + glyph->root.metrics.height = (FT_Long)ysize << 6; + glyph->root.metrics.horiBearingX = xpos << 6; + glyph->root.metrics.horiBearingY = ypos << 6; + glyph->root.metrics.horiAdvance = FT_PIX_ROUND( ( advance >> 2 ) ); + glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1; + glyph->root.metrics.vertBearingY = 0; + glyph->root.metrics.vertAdvance = size->root.metrics.height; + + glyph->root.bitmap_left = xpos; + glyph->root.bitmap_top = ypos + ysize; + + /* Allocate and read bitmap data */ + { + FT_ULong len = glyph->root.bitmap.pitch * ysize; + + + error = ft_glyphslot_alloc_bitmap( &glyph->root, len ); + if ( !error ) + { + error = pfr_load_bitmap_bits( + p, + stream->limit, + format, + FT_BOOL(face->header.color_flags & 2), + &glyph->root.bitmap ); + } + } + } + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.h index 015e9e6dada..2241495b100 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrsbit.h @@ -1,36 +1,36 @@ -/***************************************************************************/ -/* */ -/* pfrsbit.h */ -/* */ -/* FreeType PFR bitmap loader (specification). */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PFRSBIT_H__ -#define __PFRSBIT_H__ - -#include "pfrobjs.h" - -FT_BEGIN_HEADER - - FT_LOCAL( FT_Error ) - pfr_slot_load_bitmap( PFR_Slot glyph, - PFR_Size size, - FT_UInt glyph_index ); - -FT_END_HEADER - -#endif /* __PFR_SBIT_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrsbit.h */ +/* */ +/* FreeType PFR bitmap loader (specification). */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFRSBIT_H__ +#define __PFRSBIT_H__ + +#include "pfrobjs.h" + +FT_BEGIN_HEADER + + FT_LOCAL( FT_Error ) + pfr_slot_load_bitmap( PFR_Slot glyph, + PFR_Size size, + FT_UInt glyph_index ); + +FT_END_HEADER + +#endif /* __PFR_SBIT_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pfr/pfrtypes.h b/reactos/dll/3rdparty/freetype/src/pfr/pfrtypes.h index c0ae04253a2..3c306fd9941 100644 --- a/reactos/dll/3rdparty/freetype/src/pfr/pfrtypes.h +++ b/reactos/dll/3rdparty/freetype/src/pfr/pfrtypes.h @@ -1,362 +1,362 @@ -/***************************************************************************/ -/* */ -/* pfrtypes.h */ -/* */ -/* FreeType PFR data structures (specification only). */ -/* */ -/* Copyright 2002, 2003, 2005, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PFRTYPES_H__ -#define __PFRTYPES_H__ - -#include -#include FT_INTERNAL_OBJECTS_H - -FT_BEGIN_HEADER - - /************************************************************************/ - - /* the PFR Header structure */ - typedef struct PFR_HeaderRec_ - { - FT_UInt32 signature; - FT_UInt version; - FT_UInt signature2; - FT_UInt header_size; - - FT_UInt log_dir_size; - FT_UInt log_dir_offset; - - FT_UInt log_font_max_size; - FT_UInt32 log_font_section_size; - FT_UInt32 log_font_section_offset; - - FT_UInt32 phy_font_max_size; - FT_UInt32 phy_font_section_size; - FT_UInt32 phy_font_section_offset; - - FT_UInt gps_max_size; - FT_UInt32 gps_section_size; - FT_UInt32 gps_section_offset; - - FT_UInt max_blue_values; - FT_UInt max_x_orus; - FT_UInt max_y_orus; - - FT_UInt phy_font_max_size_high; - FT_UInt color_flags; - - FT_UInt32 bct_max_size; - FT_UInt32 bct_set_max_size; - FT_UInt32 phy_bct_set_max_size; - - FT_UInt num_phy_fonts; - FT_UInt max_vert_stem_snap; - FT_UInt max_horz_stem_snap; - FT_UInt max_chars; - - } PFR_HeaderRec, *PFR_Header; - - - /* used in `color_flags' field of the PFR_Header */ - typedef enum PFR_HeaderFlags_ - { - PFR_FLAG_BLACK_PIXEL = 1, - PFR_FLAG_INVERT_BITMAP = 2 - - } PFR_HeaderFlags; - - - /************************************************************************/ - - typedef struct PFR_LogFontRec_ - { - FT_UInt32 size; - FT_UInt32 offset; - - FT_Int32 matrix[4]; - FT_UInt stroke_flags; - FT_Int stroke_thickness; - FT_Int bold_thickness; - FT_Int32 miter_limit; - - FT_UInt32 phys_size; - FT_UInt32 phys_offset; - - } PFR_LogFontRec, *PFR_LogFont; - - - typedef enum PFR_LogFlags_ - { - PFR_LOG_EXTRA_ITEMS = 0x40, - PFR_LOG_2BYTE_BOLD = 0x20, - PFR_LOG_BOLD = 0x10, - PFR_LOG_2BYTE_STROKE = 8, - PFR_LOG_STROKE = 4, - PFR_LINE_JOIN_MASK = 3 - - } PFR_LogFlags; - - - typedef enum PFR_LineJoinFlags_ - { - PFR_LINE_JOIN_MITER = 0, - PFR_LINE_JOIN_ROUND = 1, - PFR_LINE_JOIN_BEVEL = 2 - - } PFR_LineJoinFlags; - - - /************************************************************************/ - - typedef enum PFR_BitmapFlags_ - { - PFR_BITMAP_3BYTE_OFFSET = 4, - PFR_BITMAP_2BYTE_SIZE = 2, - PFR_BITMAP_2BYTE_CHARCODE = 1 - - } PFR_BitmapFlags; - - - typedef struct PFR_BitmapCharRec_ - { - FT_UInt char_code; - FT_UInt gps_size; - FT_UInt32 gps_offset; - - } PFR_BitmapCharRec, *PFR_BitmapChar; - - - typedef enum PFR_StrikeFlags_ - { - PFR_STRIKE_2BYTE_COUNT = 0x10, - PFR_STRIKE_3BYTE_OFFSET = 0x08, - PFR_STRIKE_3BYTE_SIZE = 0x04, - PFR_STRIKE_2BYTE_YPPM = 0x02, - PFR_STRIKE_2BYTE_XPPM = 0x01 - - } PFR_StrikeFlags; - - - typedef struct PFR_StrikeRec_ - { - FT_UInt x_ppm; - FT_UInt y_ppm; - FT_UInt flags; - - FT_UInt32 gps_size; - FT_UInt32 gps_offset; - - FT_UInt32 bct_size; - FT_UInt32 bct_offset; - - /* optional */ - FT_UInt num_bitmaps; - PFR_BitmapChar bitmaps; - - } PFR_StrikeRec, *PFR_Strike; - - - /************************************************************************/ - - typedef struct PFR_CharRec_ - { - FT_UInt char_code; - FT_Int advance; - FT_UInt gps_size; - FT_UInt32 gps_offset; - - } PFR_CharRec, *PFR_Char; - - - /************************************************************************/ - - typedef struct PFR_DimensionRec_ - { - FT_UInt standard; - FT_UInt num_stem_snaps; - FT_Int* stem_snaps; - - } PFR_DimensionRec, *PFR_Dimension; - - /************************************************************************/ - - typedef struct PFR_KernItemRec_* PFR_KernItem; - - typedef struct PFR_KernItemRec_ - { - PFR_KernItem next; - FT_Byte pair_count; - FT_Byte flags; - FT_Short base_adj; - FT_UInt pair_size; - FT_UInt32 offset; - FT_UInt32 pair1; - FT_UInt32 pair2; - - } PFR_KernItemRec; - - -#define PFR_KERN_INDEX( g1, g2 ) \ - ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) ) - -#define PFR_KERN_PAIR_INDEX( pair ) \ - PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 ) - -#define PFR_NEXT_KPAIR( p ) ( p += 2, \ - ( (FT_UInt32)p[-2] << 16 ) | p[-1] ) - - - /************************************************************************/ - - typedef struct PFR_PhyFontRec_ - { - FT_Memory memory; - FT_UInt32 offset; - - FT_UInt font_ref_number; - FT_UInt outline_resolution; - FT_UInt metrics_resolution; - FT_BBox bbox; - FT_UInt flags; - FT_UInt standard_advance; - - FT_Int ascent; /* optional, bbox.yMax if not present */ - FT_Int descent; /* optional, bbox.yMin if not present */ - FT_Int leading; /* optional, 0 if not present */ - - PFR_DimensionRec horizontal; - PFR_DimensionRec vertical; - - FT_String* font_id; - FT_String* family_name; - FT_String* style_name; - - FT_UInt num_strikes; - FT_UInt max_strikes; - PFR_StrikeRec* strikes; - - FT_UInt num_blue_values; - FT_Int *blue_values; - FT_UInt blue_fuzz; - FT_UInt blue_scale; - - FT_UInt num_chars; - FT_UInt32 chars_offset; - PFR_Char chars; - - FT_UInt num_kern_pairs; - PFR_KernItem kern_items; - PFR_KernItem* kern_items_tail; - - /* not part of the spec, but used during load */ - FT_UInt32 bct_offset; - FT_Byte* cursor; - - } PFR_PhyFontRec, *PFR_PhyFont; - - - typedef enum PFR_PhyFlags_ - { - PFR_PHY_EXTRA_ITEMS = 0x80, - PFR_PHY_3BYTE_GPS_OFFSET = 0x20, - PFR_PHY_2BYTE_GPS_SIZE = 0x10, - PFR_PHY_ASCII_CODE = 0x08, - PFR_PHY_PROPORTIONAL = 0x04, - PFR_PHY_2BYTE_CHARCODE = 0x02, - PFR_PHY_VERTICAL = 0x01 - - } PFR_PhyFlags; - - - typedef enum PFR_KernFlags_ - { - PFR_KERN_2BYTE_CHAR = 0x01, - PFR_KERN_2BYTE_ADJ = 0x02 - - } PFR_KernFlags; - - - /************************************************************************/ - - typedef enum PFR_GlyphFlags_ - { - PFR_GLYPH_IS_COMPOUND = 0x80, - PFR_GLYPH_EXTRA_ITEMS = 0x08, - PFR_GLYPH_1BYTE_XYCOUNT = 0x04, - PFR_GLYPH_XCOUNT = 0x02, - PFR_GLYPH_YCOUNT = 0x01 - - } PFR_GlyphFlags; - - - /* controlled coordinate */ - typedef struct PFR_CoordRec_ - { - FT_UInt org; - FT_UInt cur; - - } PFR_CoordRec, *PFR_Coord; - - - typedef struct PFR_SubGlyphRec_ - { - FT_Fixed x_scale; - FT_Fixed y_scale; - FT_Int x_delta; - FT_Int y_delta; - FT_UInt32 gps_offset; - FT_UInt gps_size; - - } PFR_SubGlyphRec, *PFR_SubGlyph; - - - typedef enum PFR_SubgGlyphFlags_ - { - PFR_SUBGLYPH_3BYTE_OFFSET = 0x80, - PFR_SUBGLYPH_2BYTE_SIZE = 0x40, - PFR_SUBGLYPH_YSCALE = 0x20, - PFR_SUBGLYPH_XSCALE = 0x10 - - } PFR_SubGlyphFlags; - - - typedef struct PFR_GlyphRec_ - { - FT_Byte format; - -#if 0 - FT_UInt num_x_control; - FT_UInt num_y_control; -#endif - FT_UInt max_xy_control; - FT_Pos* x_control; - FT_Pos* y_control; - - - FT_UInt num_subs; - FT_UInt max_subs; - PFR_SubGlyphRec* subs; - - FT_GlyphLoader loader; - FT_Bool path_begun; - - } PFR_GlyphRec, *PFR_Glyph; - - -FT_END_HEADER - -#endif /* __PFRTYPES_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pfrtypes.h */ +/* */ +/* FreeType PFR data structures (specification only). */ +/* */ +/* Copyright 2002, 2003, 2005, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PFRTYPES_H__ +#define __PFRTYPES_H__ + +#include +#include FT_INTERNAL_OBJECTS_H + +FT_BEGIN_HEADER + + /************************************************************************/ + + /* the PFR Header structure */ + typedef struct PFR_HeaderRec_ + { + FT_UInt32 signature; + FT_UInt version; + FT_UInt signature2; + FT_UInt header_size; + + FT_UInt log_dir_size; + FT_UInt log_dir_offset; + + FT_UInt log_font_max_size; + FT_UInt32 log_font_section_size; + FT_UInt32 log_font_section_offset; + + FT_UInt32 phy_font_max_size; + FT_UInt32 phy_font_section_size; + FT_UInt32 phy_font_section_offset; + + FT_UInt gps_max_size; + FT_UInt32 gps_section_size; + FT_UInt32 gps_section_offset; + + FT_UInt max_blue_values; + FT_UInt max_x_orus; + FT_UInt max_y_orus; + + FT_UInt phy_font_max_size_high; + FT_UInt color_flags; + + FT_UInt32 bct_max_size; + FT_UInt32 bct_set_max_size; + FT_UInt32 phy_bct_set_max_size; + + FT_UInt num_phy_fonts; + FT_UInt max_vert_stem_snap; + FT_UInt max_horz_stem_snap; + FT_UInt max_chars; + + } PFR_HeaderRec, *PFR_Header; + + + /* used in `color_flags' field of the PFR_Header */ + typedef enum PFR_HeaderFlags_ + { + PFR_FLAG_BLACK_PIXEL = 1, + PFR_FLAG_INVERT_BITMAP = 2 + + } PFR_HeaderFlags; + + + /************************************************************************/ + + typedef struct PFR_LogFontRec_ + { + FT_UInt32 size; + FT_UInt32 offset; + + FT_Int32 matrix[4]; + FT_UInt stroke_flags; + FT_Int stroke_thickness; + FT_Int bold_thickness; + FT_Int32 miter_limit; + + FT_UInt32 phys_size; + FT_UInt32 phys_offset; + + } PFR_LogFontRec, *PFR_LogFont; + + + typedef enum PFR_LogFlags_ + { + PFR_LOG_EXTRA_ITEMS = 0x40, + PFR_LOG_2BYTE_BOLD = 0x20, + PFR_LOG_BOLD = 0x10, + PFR_LOG_2BYTE_STROKE = 8, + PFR_LOG_STROKE = 4, + PFR_LINE_JOIN_MASK = 3 + + } PFR_LogFlags; + + + typedef enum PFR_LineJoinFlags_ + { + PFR_LINE_JOIN_MITER = 0, + PFR_LINE_JOIN_ROUND = 1, + PFR_LINE_JOIN_BEVEL = 2 + + } PFR_LineJoinFlags; + + + /************************************************************************/ + + typedef enum PFR_BitmapFlags_ + { + PFR_BITMAP_3BYTE_OFFSET = 4, + PFR_BITMAP_2BYTE_SIZE = 2, + PFR_BITMAP_2BYTE_CHARCODE = 1 + + } PFR_BitmapFlags; + + + typedef struct PFR_BitmapCharRec_ + { + FT_UInt char_code; + FT_UInt gps_size; + FT_UInt32 gps_offset; + + } PFR_BitmapCharRec, *PFR_BitmapChar; + + + typedef enum PFR_StrikeFlags_ + { + PFR_STRIKE_2BYTE_COUNT = 0x10, + PFR_STRIKE_3BYTE_OFFSET = 0x08, + PFR_STRIKE_3BYTE_SIZE = 0x04, + PFR_STRIKE_2BYTE_YPPM = 0x02, + PFR_STRIKE_2BYTE_XPPM = 0x01 + + } PFR_StrikeFlags; + + + typedef struct PFR_StrikeRec_ + { + FT_UInt x_ppm; + FT_UInt y_ppm; + FT_UInt flags; + + FT_UInt32 gps_size; + FT_UInt32 gps_offset; + + FT_UInt32 bct_size; + FT_UInt32 bct_offset; + + /* optional */ + FT_UInt num_bitmaps; + PFR_BitmapChar bitmaps; + + } PFR_StrikeRec, *PFR_Strike; + + + /************************************************************************/ + + typedef struct PFR_CharRec_ + { + FT_UInt char_code; + FT_Int advance; + FT_UInt gps_size; + FT_UInt32 gps_offset; + + } PFR_CharRec, *PFR_Char; + + + /************************************************************************/ + + typedef struct PFR_DimensionRec_ + { + FT_UInt standard; + FT_UInt num_stem_snaps; + FT_Int* stem_snaps; + + } PFR_DimensionRec, *PFR_Dimension; + + /************************************************************************/ + + typedef struct PFR_KernItemRec_* PFR_KernItem; + + typedef struct PFR_KernItemRec_ + { + PFR_KernItem next; + FT_Byte pair_count; + FT_Byte flags; + FT_Short base_adj; + FT_UInt pair_size; + FT_UInt32 offset; + FT_UInt32 pair1; + FT_UInt32 pair2; + + } PFR_KernItemRec; + + +#define PFR_KERN_INDEX( g1, g2 ) \ + ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) ) + +#define PFR_KERN_PAIR_INDEX( pair ) \ + PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 ) + +#define PFR_NEXT_KPAIR( p ) ( p += 2, \ + ( (FT_UInt32)p[-2] << 16 ) | p[-1] ) + + + /************************************************************************/ + + typedef struct PFR_PhyFontRec_ + { + FT_Memory memory; + FT_UInt32 offset; + + FT_UInt font_ref_number; + FT_UInt outline_resolution; + FT_UInt metrics_resolution; + FT_BBox bbox; + FT_UInt flags; + FT_UInt standard_advance; + + FT_Int ascent; /* optional, bbox.yMax if not present */ + FT_Int descent; /* optional, bbox.yMin if not present */ + FT_Int leading; /* optional, 0 if not present */ + + PFR_DimensionRec horizontal; + PFR_DimensionRec vertical; + + FT_String* font_id; + FT_String* family_name; + FT_String* style_name; + + FT_UInt num_strikes; + FT_UInt max_strikes; + PFR_StrikeRec* strikes; + + FT_UInt num_blue_values; + FT_Int *blue_values; + FT_UInt blue_fuzz; + FT_UInt blue_scale; + + FT_UInt num_chars; + FT_UInt32 chars_offset; + PFR_Char chars; + + FT_UInt num_kern_pairs; + PFR_KernItem kern_items; + PFR_KernItem* kern_items_tail; + + /* not part of the spec, but used during load */ + FT_UInt32 bct_offset; + FT_Byte* cursor; + + } PFR_PhyFontRec, *PFR_PhyFont; + + + typedef enum PFR_PhyFlags_ + { + PFR_PHY_EXTRA_ITEMS = 0x80, + PFR_PHY_3BYTE_GPS_OFFSET = 0x20, + PFR_PHY_2BYTE_GPS_SIZE = 0x10, + PFR_PHY_ASCII_CODE = 0x08, + PFR_PHY_PROPORTIONAL = 0x04, + PFR_PHY_2BYTE_CHARCODE = 0x02, + PFR_PHY_VERTICAL = 0x01 + + } PFR_PhyFlags; + + + typedef enum PFR_KernFlags_ + { + PFR_KERN_2BYTE_CHAR = 0x01, + PFR_KERN_2BYTE_ADJ = 0x02 + + } PFR_KernFlags; + + + /************************************************************************/ + + typedef enum PFR_GlyphFlags_ + { + PFR_GLYPH_IS_COMPOUND = 0x80, + PFR_GLYPH_EXTRA_ITEMS = 0x08, + PFR_GLYPH_1BYTE_XYCOUNT = 0x04, + PFR_GLYPH_XCOUNT = 0x02, + PFR_GLYPH_YCOUNT = 0x01 + + } PFR_GlyphFlags; + + + /* controlled coordinate */ + typedef struct PFR_CoordRec_ + { + FT_UInt org; + FT_UInt cur; + + } PFR_CoordRec, *PFR_Coord; + + + typedef struct PFR_SubGlyphRec_ + { + FT_Fixed x_scale; + FT_Fixed y_scale; + FT_Int x_delta; + FT_Int y_delta; + FT_UInt32 gps_offset; + FT_UInt gps_size; + + } PFR_SubGlyphRec, *PFR_SubGlyph; + + + typedef enum PFR_SubgGlyphFlags_ + { + PFR_SUBGLYPH_3BYTE_OFFSET = 0x80, + PFR_SUBGLYPH_2BYTE_SIZE = 0x40, + PFR_SUBGLYPH_YSCALE = 0x20, + PFR_SUBGLYPH_XSCALE = 0x10 + + } PFR_SubGlyphFlags; + + + typedef struct PFR_GlyphRec_ + { + FT_Byte format; + +#if 0 + FT_UInt num_x_control; + FT_UInt num_y_control; +#endif + FT_UInt max_xy_control; + FT_Pos* x_control; + FT_Pos* y_control; + + + FT_UInt num_subs; + FT_UInt max_subs; + PFR_SubGlyphRec* subs; + + FT_GlyphLoader loader; + FT_Bool path_begun; + + } PFR_GlyphRec, *PFR_Glyph; + + +FT_END_HEADER + +#endif /* __PFRTYPES_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/afmparse.c b/reactos/dll/3rdparty/freetype/src/psaux/afmparse.c index 0528fe6ff4f..5021fa3f0b1 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/afmparse.c +++ b/reactos/dll/3rdparty/freetype/src/psaux/afmparse.c @@ -1,960 +1,960 @@ -/***************************************************************************/ -/* */ -/* afmparse.c */ -/* */ -/* AFM parser (body). */ -/* */ -/* Copyright 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#include -#include FT_FREETYPE_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_DEBUG_H - -#include "afmparse.h" -#include "psconv.h" - -#include "psauxerr.h" - - -/***************************************************************************/ -/* */ -/* AFM_Stream */ -/* */ -/* The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib. */ -/* */ -/* */ - - enum - { - AFM_STREAM_STATUS_NORMAL, - AFM_STREAM_STATUS_EOC, - AFM_STREAM_STATUS_EOL, - AFM_STREAM_STATUS_EOF - }; - - - typedef struct AFM_StreamRec_ - { - FT_Byte* cursor; - FT_Byte* base; - FT_Byte* limit; - - FT_Int status; - - } AFM_StreamRec; - - -#ifndef EOF -#define EOF -1 -#endif - - - /* this works because empty lines are ignored */ -#define AFM_IS_NEWLINE( ch ) ( (ch) == '\r' || (ch) == '\n' ) - -#define AFM_IS_EOF( ch ) ( (ch) == EOF || (ch) == '\x1a' ) -#define AFM_IS_SPACE( ch ) ( (ch) == ' ' || (ch) == '\t' ) - - /* column separator; there is no `column' in the spec actually */ -#define AFM_IS_SEP( ch ) ( (ch) == ';' ) - -#define AFM_GETC() \ - ( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \ - : EOF ) - -#define AFM_STREAM_KEY_BEGIN( stream ) \ - (char*)( (stream)->cursor - 1 ) - -#define AFM_STREAM_KEY_LEN( stream, key ) \ - ( (char*)(stream)->cursor - key - 1 ) - -#define AFM_STATUS_EOC( stream ) \ - ( (stream)->status >= AFM_STREAM_STATUS_EOC ) - -#define AFM_STATUS_EOL( stream ) \ - ( (stream)->status >= AFM_STREAM_STATUS_EOL ) - -#define AFM_STATUS_EOF( stream ) \ - ( (stream)->status >= AFM_STREAM_STATUS_EOF ) - - - static int - afm_stream_skip_spaces( AFM_Stream stream ) - { - int ch = 0; /* make stupid compiler happy */ - - - if ( AFM_STATUS_EOC( stream ) ) - return ';'; - - while ( 1 ) - { - ch = AFM_GETC(); - if ( !AFM_IS_SPACE( ch ) ) - break; - } - - if ( AFM_IS_NEWLINE( ch ) ) - stream->status = AFM_STREAM_STATUS_EOL; - else if ( AFM_IS_SEP( ch ) ) - stream->status = AFM_STREAM_STATUS_EOC; - else if ( AFM_IS_EOF( ch ) ) - stream->status = AFM_STREAM_STATUS_EOF; - - return ch; - } - - - /* read a key or value in current column */ - static char* - afm_stream_read_one( AFM_Stream stream ) - { - char* str; - int ch; - - - afm_stream_skip_spaces( stream ); - if ( AFM_STATUS_EOC( stream ) ) - return NULL; - - str = AFM_STREAM_KEY_BEGIN( stream ); - - while ( 1 ) - { - ch = AFM_GETC(); - if ( AFM_IS_SPACE( ch ) ) - break; - else if ( AFM_IS_NEWLINE( ch ) ) - { - stream->status = AFM_STREAM_STATUS_EOL; - break; - } - else if ( AFM_IS_SEP( ch ) ) - { - stream->status = AFM_STREAM_STATUS_EOC; - break; - } - else if ( AFM_IS_EOF( ch ) ) - { - stream->status = AFM_STREAM_STATUS_EOF; - break; - } - } - - return str; - } - - - /* read a string (i.e., read to EOL) */ - static char* - afm_stream_read_string( AFM_Stream stream ) - { - char* str; - int ch; - - - afm_stream_skip_spaces( stream ); - if ( AFM_STATUS_EOL( stream ) ) - return NULL; - - str = AFM_STREAM_KEY_BEGIN( stream ); - - /* scan to eol */ - while ( 1 ) - { - ch = AFM_GETC(); - if ( AFM_IS_NEWLINE( ch ) ) - { - stream->status = AFM_STREAM_STATUS_EOL; - break; - } - else if ( AFM_IS_EOF( ch ) ) - { - stream->status = AFM_STREAM_STATUS_EOF; - break; - } - } - - return str; - } - - - /*************************************************************************/ - /* */ - /* AFM_Parser */ - /* */ - /* */ - - /* all keys defined in Ch. 7-10 of 5004.AFM_Spec.pdf */ - typedef enum AFM_Token_ - { - AFM_TOKEN_ASCENDER, - AFM_TOKEN_AXISLABEL, - AFM_TOKEN_AXISTYPE, - AFM_TOKEN_B, - AFM_TOKEN_BLENDAXISTYPES, - AFM_TOKEN_BLENDDESIGNMAP, - AFM_TOKEN_BLENDDESIGNPOSITIONS, - AFM_TOKEN_C, - AFM_TOKEN_CC, - AFM_TOKEN_CH, - AFM_TOKEN_CAPHEIGHT, - AFM_TOKEN_CHARWIDTH, - AFM_TOKEN_CHARACTERSET, - AFM_TOKEN_CHARACTERS, - AFM_TOKEN_DESCENDER, - AFM_TOKEN_ENCODINGSCHEME, - AFM_TOKEN_ENDAXIS, - AFM_TOKEN_ENDCHARMETRICS, - AFM_TOKEN_ENDCOMPOSITES, - AFM_TOKEN_ENDDIRECTION, - AFM_TOKEN_ENDFONTMETRICS, - AFM_TOKEN_ENDKERNDATA, - AFM_TOKEN_ENDKERNPAIRS, - AFM_TOKEN_ENDTRACKKERN, - AFM_TOKEN_ESCCHAR, - AFM_TOKEN_FAMILYNAME, - AFM_TOKEN_FONTBBOX, - AFM_TOKEN_FONTNAME, - AFM_TOKEN_FULLNAME, - AFM_TOKEN_ISBASEFONT, - AFM_TOKEN_ISCIDFONT, - AFM_TOKEN_ISFIXEDPITCH, - AFM_TOKEN_ISFIXEDV, - AFM_TOKEN_ITALICANGLE, - AFM_TOKEN_KP, - AFM_TOKEN_KPH, - AFM_TOKEN_KPX, - AFM_TOKEN_KPY, - AFM_TOKEN_L, - AFM_TOKEN_MAPPINGSCHEME, - AFM_TOKEN_METRICSSETS, - AFM_TOKEN_N, - AFM_TOKEN_NOTICE, - AFM_TOKEN_PCC, - AFM_TOKEN_STARTAXIS, - AFM_TOKEN_STARTCHARMETRICS, - AFM_TOKEN_STARTCOMPOSITES, - AFM_TOKEN_STARTDIRECTION, - AFM_TOKEN_STARTFONTMETRICS, - AFM_TOKEN_STARTKERNDATA, - AFM_TOKEN_STARTKERNPAIRS, - AFM_TOKEN_STARTKERNPAIRS0, - AFM_TOKEN_STARTKERNPAIRS1, - AFM_TOKEN_STARTTRACKKERN, - AFM_TOKEN_STDHW, - AFM_TOKEN_STDVW, - AFM_TOKEN_TRACKKERN, - AFM_TOKEN_UNDERLINEPOSITION, - AFM_TOKEN_UNDERLINETHICKNESS, - AFM_TOKEN_VV, - AFM_TOKEN_VVECTOR, - AFM_TOKEN_VERSION, - AFM_TOKEN_W, - AFM_TOKEN_W0, - AFM_TOKEN_W0X, - AFM_TOKEN_W0Y, - AFM_TOKEN_W1, - AFM_TOKEN_W1X, - AFM_TOKEN_W1Y, - AFM_TOKEN_WX, - AFM_TOKEN_WY, - AFM_TOKEN_WEIGHT, - AFM_TOKEN_WEIGHTVECTOR, - AFM_TOKEN_XHEIGHT, - N_AFM_TOKENS, - AFM_TOKEN_UNKNOWN - - } AFM_Token; - - - static const char* const afm_key_table[N_AFM_TOKENS] = - { - "Ascender", - "AxisLabel", - "AxisType", - "B", - "BlendAxisTypes", - "BlendDesignMap", - "BlendDesignPositions", - "C", - "CC", - "CH", - "CapHeight", - "CharWidth", - "CharacterSet", - "Characters", - "Descender", - "EncodingScheme", - "EndAxis", - "EndCharMetrics", - "EndComposites", - "EndDirection", - "EndFontMetrics", - "EndKernData", - "EndKernPairs", - "EndTrackKern", - "EscChar", - "FamilyName", - "FontBBox", - "FontName", - "FullName", - "IsBaseFont", - "IsCIDFont", - "IsFixedPitch", - "IsFixedV", - "ItalicAngle", - "KP", - "KPH", - "KPX", - "KPY", - "L", - "MappingScheme", - "MetricsSets", - "N", - "Notice", - "PCC", - "StartAxis", - "StartCharMetrics", - "StartComposites", - "StartDirection", - "StartFontMetrics", - "StartKernData", - "StartKernPairs", - "StartKernPairs0", - "StartKernPairs1", - "StartTrackKern", - "StdHW", - "StdVW", - "TrackKern", - "UnderlinePosition", - "UnderlineThickness", - "VV", - "VVector", - "Version", - "W", - "W0", - "W0X", - "W0Y", - "W1", - "W1X", - "W1Y", - "WX", - "WY", - "Weight", - "WeightVector", - "XHeight" - }; - - - /* - * `afm_parser_read_vals' and `afm_parser_next_key' provide - * high-level operations to an AFM_Stream. The rest of the - * parser functions should use them without accessing the - * AFM_Stream directly. - */ - - FT_LOCAL_DEF( FT_Int ) - afm_parser_read_vals( AFM_Parser parser, - AFM_Value vals, - FT_Int n ) - { - AFM_Stream stream = parser->stream; - char* str; - FT_Int i; - - - if ( n > AFM_MAX_ARGUMENTS ) - return 0; - - for ( i = 0; i < n; i++ ) - { - FT_UInt len; - AFM_Value val = vals + i; - - - if ( val->type == AFM_VALUE_TYPE_STRING ) - str = afm_stream_read_string( stream ); - else - str = afm_stream_read_one( stream ); - - if ( !str ) - break; - - len = AFM_STREAM_KEY_LEN( stream, str ); - - switch ( val->type ) - { - case AFM_VALUE_TYPE_STRING: - case AFM_VALUE_TYPE_NAME: - { - FT_Memory memory = parser->memory; - FT_Error error; - - - if ( !FT_QALLOC( val->u.s, len + 1 ) ) - { - ft_memcpy( val->u.s, str, len ); - val->u.s[len] = '\0'; - } - } - break; - - case AFM_VALUE_TYPE_FIXED: - val->u.f = PS_Conv_ToFixed( (FT_Byte**)(void*)&str, - (FT_Byte*)str + len, 0 ); - break; - - case AFM_VALUE_TYPE_INTEGER: - val->u.i = PS_Conv_ToInt( (FT_Byte**)(void*)&str, - (FT_Byte*)str + len ); - break; - - case AFM_VALUE_TYPE_BOOL: - val->u.b = FT_BOOL( len == 4 && - !ft_strncmp( str, "true", 4 ) ); - break; - - case AFM_VALUE_TYPE_INDEX: - if ( parser->get_index ) - val->u.i = parser->get_index( str, len, parser->user_data ); - else - val->u.i = 0; - break; - } - } - - return i; - } - - - FT_LOCAL_DEF( char* ) - afm_parser_next_key( AFM_Parser parser, - FT_Bool line, - FT_UInt* len ) - { - AFM_Stream stream = parser->stream; - char* key = 0; /* make stupid compiler happy */ - - - if ( line ) - { - while ( 1 ) - { - /* skip current line */ - if ( !AFM_STATUS_EOL( stream ) ) - afm_stream_read_string( stream ); - - stream->status = AFM_STREAM_STATUS_NORMAL; - key = afm_stream_read_one( stream ); - - /* skip empty line */ - if ( !key && - !AFM_STATUS_EOF( stream ) && - AFM_STATUS_EOL( stream ) ) - continue; - - break; - } - } - else - { - while ( 1 ) - { - /* skip current column */ - while ( !AFM_STATUS_EOC( stream ) ) - afm_stream_read_one( stream ); - - stream->status = AFM_STREAM_STATUS_NORMAL; - key = afm_stream_read_one( stream ); - - /* skip empty column */ - if ( !key && - !AFM_STATUS_EOF( stream ) && - AFM_STATUS_EOC( stream ) ) - continue; - - break; - } - } - - if ( len ) - *len = ( key ) ? AFM_STREAM_KEY_LEN( stream, key ) - : 0; - - return key; - } - - - static AFM_Token - afm_tokenize( const char* key, - FT_UInt len ) - { - int n; - - - for ( n = 0; n < N_AFM_TOKENS; n++ ) - { - if ( *( afm_key_table[n] ) == *key ) - { - for ( ; n < N_AFM_TOKENS; n++ ) - { - if ( *( afm_key_table[n] ) != *key ) - return AFM_TOKEN_UNKNOWN; - - if ( ft_strncmp( afm_key_table[n], key, len ) == 0 ) - return (AFM_Token) n; - } - } - } - - return AFM_TOKEN_UNKNOWN; - } - - - FT_LOCAL_DEF( FT_Error ) - afm_parser_init( AFM_Parser parser, - FT_Memory memory, - FT_Byte* base, - FT_Byte* limit ) - { - AFM_Stream stream; - FT_Error error; - - - if ( FT_NEW( stream ) ) - return error; - - stream->cursor = stream->base = base; - stream->limit = limit; - - /* don't skip the first line during the first call */ - stream->status = AFM_STREAM_STATUS_EOL; - - parser->memory = memory; - parser->stream = stream; - parser->FontInfo = NULL; - parser->get_index = NULL; - - return PSaux_Err_Ok; - } - - - FT_LOCAL( void ) - afm_parser_done( AFM_Parser parser ) - { - FT_Memory memory = parser->memory; - - - FT_FREE( parser->stream ); - } - - - FT_LOCAL_DEF( FT_Error ) - afm_parser_read_int( AFM_Parser parser, - FT_Int* aint ) - { - AFM_ValueRec val; - - - val.type = AFM_VALUE_TYPE_INTEGER; - - if ( afm_parser_read_vals( parser, &val, 1 ) == 1 ) - { - *aint = val.u.i; - - return PSaux_Err_Ok; - } - else - return PSaux_Err_Syntax_Error; - } - - - static FT_Error - afm_parse_track_kern( AFM_Parser parser ) - { - AFM_FontInfo fi = parser->FontInfo; - AFM_TrackKern tk; - char* key; - FT_UInt len; - int n = -1; - - - if ( afm_parser_read_int( parser, &fi->NumTrackKern ) ) - goto Fail; - - if ( fi->NumTrackKern ) - { - FT_Memory memory = parser->memory; - FT_Error error; - - - if ( FT_QNEW_ARRAY( fi->TrackKerns, fi->NumTrackKern ) ) - return error; - } - - while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) - { - AFM_ValueRec shared_vals[5]; - - - switch ( afm_tokenize( key, len ) ) - { - case AFM_TOKEN_TRACKKERN: - n++; - - if ( n >= fi->NumTrackKern ) - goto Fail; - - tk = fi->TrackKerns + n; - - shared_vals[0].type = AFM_VALUE_TYPE_INTEGER; - shared_vals[1].type = AFM_VALUE_TYPE_FIXED; - shared_vals[2].type = AFM_VALUE_TYPE_FIXED; - shared_vals[3].type = AFM_VALUE_TYPE_FIXED; - shared_vals[4].type = AFM_VALUE_TYPE_FIXED; - if ( afm_parser_read_vals( parser, shared_vals, 5 ) != 5 ) - goto Fail; - - tk->degree = shared_vals[0].u.i; - tk->min_ptsize = shared_vals[1].u.f; - tk->min_kern = shared_vals[2].u.f; - tk->max_ptsize = shared_vals[3].u.f; - tk->max_kern = shared_vals[4].u.f; - - /* is this correct? */ - if ( tk->degree < 0 && tk->min_kern > 0 ) - tk->min_kern = -tk->min_kern; - break; - - case AFM_TOKEN_ENDTRACKKERN: - case AFM_TOKEN_ENDKERNDATA: - case AFM_TOKEN_ENDFONTMETRICS: - fi->NumTrackKern = n + 1; - return PSaux_Err_Ok; - - case AFM_TOKEN_UNKNOWN: - break; - - default: - goto Fail; - } - } - - Fail: - return PSaux_Err_Syntax_Error; - } - - -#undef KERN_INDEX -#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 ) - - - /* compare two kerning pairs */ - FT_CALLBACK_DEF( int ) - afm_compare_kern_pairs( const void* a, - const void* b ) - { - AFM_KernPair kp1 = (AFM_KernPair)a; - AFM_KernPair kp2 = (AFM_KernPair)b; - - FT_ULong index1 = KERN_INDEX( kp1->index1, kp1->index2 ); - FT_ULong index2 = KERN_INDEX( kp2->index1, kp2->index2 ); - - - return (int)( index1 - index2 ); - } - - - static FT_Error - afm_parse_kern_pairs( AFM_Parser parser ) - { - AFM_FontInfo fi = parser->FontInfo; - AFM_KernPair kp; - char* key; - FT_UInt len; - int n = -1; - - - if ( afm_parser_read_int( parser, &fi->NumKernPair ) ) - goto Fail; - - if ( fi->NumKernPair ) - { - FT_Memory memory = parser->memory; - FT_Error error; - - - if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) ) - return error; - } - - while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) - { - AFM_Token token = afm_tokenize( key, len ); - - - switch ( token ) - { - case AFM_TOKEN_KP: - case AFM_TOKEN_KPX: - case AFM_TOKEN_KPY: - { - FT_Int r; - AFM_ValueRec shared_vals[4]; - - - n++; - - if ( n >= fi->NumKernPair ) - goto Fail; - - kp = fi->KernPairs + n; - - shared_vals[0].type = AFM_VALUE_TYPE_INDEX; - shared_vals[1].type = AFM_VALUE_TYPE_INDEX; - shared_vals[2].type = AFM_VALUE_TYPE_INTEGER; - shared_vals[3].type = AFM_VALUE_TYPE_INTEGER; - r = afm_parser_read_vals( parser, shared_vals, 4 ); - if ( r < 3 ) - goto Fail; - - kp->index1 = shared_vals[0].u.i; - kp->index2 = shared_vals[1].u.i; - if ( token == AFM_TOKEN_KPY ) - { - kp->x = 0; - kp->y = shared_vals[2].u.i; - } - else - { - kp->x = shared_vals[2].u.i; - kp->y = ( token == AFM_TOKEN_KP && r == 4 ) - ? shared_vals[3].u.i : 0; - } - } - break; - - case AFM_TOKEN_ENDKERNPAIRS: - case AFM_TOKEN_ENDKERNDATA: - case AFM_TOKEN_ENDFONTMETRICS: - fi->NumKernPair = n + 1; - ft_qsort( fi->KernPairs, fi->NumKernPair, - sizeof( AFM_KernPairRec ), - afm_compare_kern_pairs ); - return PSaux_Err_Ok; - - case AFM_TOKEN_UNKNOWN: - break; - - default: - goto Fail; - } - } - - Fail: - return PSaux_Err_Syntax_Error; - } - - - static FT_Error - afm_parse_kern_data( AFM_Parser parser ) - { - FT_Error error; - char* key; - FT_UInt len; - - - while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) - { - switch ( afm_tokenize( key, len ) ) - { - case AFM_TOKEN_STARTTRACKKERN: - error = afm_parse_track_kern( parser ); - if ( error ) - return error; - break; - - case AFM_TOKEN_STARTKERNPAIRS: - case AFM_TOKEN_STARTKERNPAIRS0: - error = afm_parse_kern_pairs( parser ); - if ( error ) - return error; - break; - - case AFM_TOKEN_ENDKERNDATA: - case AFM_TOKEN_ENDFONTMETRICS: - return PSaux_Err_Ok; - - case AFM_TOKEN_UNKNOWN: - break; - - default: - goto Fail; - } - } - - Fail: - return PSaux_Err_Syntax_Error; - } - - - static FT_Error - afm_parser_skip_section( AFM_Parser parser, - FT_UInt n, - AFM_Token end_section ) - { - char* key; - FT_UInt len; - - - while ( n-- > 0 ) - { - key = afm_parser_next_key( parser, 1, NULL ); - if ( !key ) - goto Fail; - } - - while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) - { - AFM_Token token = afm_tokenize( key, len ); - - - if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS ) - return PSaux_Err_Ok; - } - - Fail: - return PSaux_Err_Syntax_Error; - } - - - FT_LOCAL_DEF( FT_Error ) - afm_parser_parse( AFM_Parser parser ) - { - FT_Memory memory = parser->memory; - AFM_FontInfo fi = parser->FontInfo; - FT_Error error = PSaux_Err_Syntax_Error; - char* key; - FT_UInt len; - FT_Int metrics_sets = 0; - - - if ( !fi ) - return PSaux_Err_Invalid_Argument; - - key = afm_parser_next_key( parser, 1, &len ); - if ( !key || len != 16 || - ft_strncmp( key, "StartFontMetrics", 16 ) != 0 ) - return PSaux_Err_Unknown_File_Format; - - while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) - { - AFM_ValueRec shared_vals[4]; - - - switch ( afm_tokenize( key, len ) ) - { - case AFM_TOKEN_METRICSSETS: - if ( afm_parser_read_int( parser, &metrics_sets ) ) - goto Fail; - - if ( metrics_sets != 0 && metrics_sets != 2 ) - { - error = PSaux_Err_Unimplemented_Feature; - - goto Fail; - } - break; - - case AFM_TOKEN_ISCIDFONT: - shared_vals[0].type = AFM_VALUE_TYPE_BOOL; - if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 ) - goto Fail; - - fi->IsCIDFont = shared_vals[0].u.b; - break; - - case AFM_TOKEN_FONTBBOX: - shared_vals[0].type = AFM_VALUE_TYPE_FIXED; - shared_vals[1].type = AFM_VALUE_TYPE_FIXED; - shared_vals[2].type = AFM_VALUE_TYPE_FIXED; - shared_vals[3].type = AFM_VALUE_TYPE_FIXED; - if ( afm_parser_read_vals( parser, shared_vals, 4 ) != 4 ) - goto Fail; - - fi->FontBBox.xMin = shared_vals[0].u.f; - fi->FontBBox.yMin = shared_vals[1].u.f; - fi->FontBBox.xMax = shared_vals[2].u.f; - fi->FontBBox.yMax = shared_vals[3].u.f; - break; - - case AFM_TOKEN_ASCENDER: - shared_vals[0].type = AFM_VALUE_TYPE_FIXED; - if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 ) - goto Fail; - - fi->Ascender = shared_vals[0].u.f; - break; - - case AFM_TOKEN_DESCENDER: - shared_vals[0].type = AFM_VALUE_TYPE_FIXED; - if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 ) - goto Fail; - - fi->Descender = shared_vals[0].u.f; - break; - - case AFM_TOKEN_STARTCHARMETRICS: - { - FT_Int n = 0; - - - if ( afm_parser_read_int( parser, &n ) ) - goto Fail; - - error = afm_parser_skip_section( parser, n, - AFM_TOKEN_ENDCHARMETRICS ); - if ( error ) - return error; - } - break; - - case AFM_TOKEN_STARTKERNDATA: - error = afm_parse_kern_data( parser ); - if ( error ) - goto Fail; - /* fall through since we only support kern data */ - - case AFM_TOKEN_ENDFONTMETRICS: - return PSaux_Err_Ok; - - default: - break; - } - } - - Fail: - FT_FREE( fi->TrackKerns ); - fi->NumTrackKern = 0; - - FT_FREE( fi->KernPairs ); - fi->NumKernPair = 0; - - fi->IsCIDFont = 0; - - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* afmparse.c */ +/* */ +/* AFM parser (body). */ +/* */ +/* Copyright 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#include +#include FT_FREETYPE_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_INTERNAL_DEBUG_H + +#include "afmparse.h" +#include "psconv.h" + +#include "psauxerr.h" + + +/***************************************************************************/ +/* */ +/* AFM_Stream */ +/* */ +/* The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib. */ +/* */ +/* */ + + enum + { + AFM_STREAM_STATUS_NORMAL, + AFM_STREAM_STATUS_EOC, + AFM_STREAM_STATUS_EOL, + AFM_STREAM_STATUS_EOF + }; + + + typedef struct AFM_StreamRec_ + { + FT_Byte* cursor; + FT_Byte* base; + FT_Byte* limit; + + FT_Int status; + + } AFM_StreamRec; + + +#ifndef EOF +#define EOF -1 +#endif + + + /* this works because empty lines are ignored */ +#define AFM_IS_NEWLINE( ch ) ( (ch) == '\r' || (ch) == '\n' ) + +#define AFM_IS_EOF( ch ) ( (ch) == EOF || (ch) == '\x1a' ) +#define AFM_IS_SPACE( ch ) ( (ch) == ' ' || (ch) == '\t' ) + + /* column separator; there is no `column' in the spec actually */ +#define AFM_IS_SEP( ch ) ( (ch) == ';' ) + +#define AFM_GETC() \ + ( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \ + : EOF ) + +#define AFM_STREAM_KEY_BEGIN( stream ) \ + (char*)( (stream)->cursor - 1 ) + +#define AFM_STREAM_KEY_LEN( stream, key ) \ + ( (char*)(stream)->cursor - key - 1 ) + +#define AFM_STATUS_EOC( stream ) \ + ( (stream)->status >= AFM_STREAM_STATUS_EOC ) + +#define AFM_STATUS_EOL( stream ) \ + ( (stream)->status >= AFM_STREAM_STATUS_EOL ) + +#define AFM_STATUS_EOF( stream ) \ + ( (stream)->status >= AFM_STREAM_STATUS_EOF ) + + + static int + afm_stream_skip_spaces( AFM_Stream stream ) + { + int ch = 0; /* make stupid compiler happy */ + + + if ( AFM_STATUS_EOC( stream ) ) + return ';'; + + while ( 1 ) + { + ch = AFM_GETC(); + if ( !AFM_IS_SPACE( ch ) ) + break; + } + + if ( AFM_IS_NEWLINE( ch ) ) + stream->status = AFM_STREAM_STATUS_EOL; + else if ( AFM_IS_SEP( ch ) ) + stream->status = AFM_STREAM_STATUS_EOC; + else if ( AFM_IS_EOF( ch ) ) + stream->status = AFM_STREAM_STATUS_EOF; + + return ch; + } + + + /* read a key or value in current column */ + static char* + afm_stream_read_one( AFM_Stream stream ) + { + char* str; + int ch; + + + afm_stream_skip_spaces( stream ); + if ( AFM_STATUS_EOC( stream ) ) + return NULL; + + str = AFM_STREAM_KEY_BEGIN( stream ); + + while ( 1 ) + { + ch = AFM_GETC(); + if ( AFM_IS_SPACE( ch ) ) + break; + else if ( AFM_IS_NEWLINE( ch ) ) + { + stream->status = AFM_STREAM_STATUS_EOL; + break; + } + else if ( AFM_IS_SEP( ch ) ) + { + stream->status = AFM_STREAM_STATUS_EOC; + break; + } + else if ( AFM_IS_EOF( ch ) ) + { + stream->status = AFM_STREAM_STATUS_EOF; + break; + } + } + + return str; + } + + + /* read a string (i.e., read to EOL) */ + static char* + afm_stream_read_string( AFM_Stream stream ) + { + char* str; + int ch; + + + afm_stream_skip_spaces( stream ); + if ( AFM_STATUS_EOL( stream ) ) + return NULL; + + str = AFM_STREAM_KEY_BEGIN( stream ); + + /* scan to eol */ + while ( 1 ) + { + ch = AFM_GETC(); + if ( AFM_IS_NEWLINE( ch ) ) + { + stream->status = AFM_STREAM_STATUS_EOL; + break; + } + else if ( AFM_IS_EOF( ch ) ) + { + stream->status = AFM_STREAM_STATUS_EOF; + break; + } + } + + return str; + } + + + /*************************************************************************/ + /* */ + /* AFM_Parser */ + /* */ + /* */ + + /* all keys defined in Ch. 7-10 of 5004.AFM_Spec.pdf */ + typedef enum AFM_Token_ + { + AFM_TOKEN_ASCENDER, + AFM_TOKEN_AXISLABEL, + AFM_TOKEN_AXISTYPE, + AFM_TOKEN_B, + AFM_TOKEN_BLENDAXISTYPES, + AFM_TOKEN_BLENDDESIGNMAP, + AFM_TOKEN_BLENDDESIGNPOSITIONS, + AFM_TOKEN_C, + AFM_TOKEN_CC, + AFM_TOKEN_CH, + AFM_TOKEN_CAPHEIGHT, + AFM_TOKEN_CHARWIDTH, + AFM_TOKEN_CHARACTERSET, + AFM_TOKEN_CHARACTERS, + AFM_TOKEN_DESCENDER, + AFM_TOKEN_ENCODINGSCHEME, + AFM_TOKEN_ENDAXIS, + AFM_TOKEN_ENDCHARMETRICS, + AFM_TOKEN_ENDCOMPOSITES, + AFM_TOKEN_ENDDIRECTION, + AFM_TOKEN_ENDFONTMETRICS, + AFM_TOKEN_ENDKERNDATA, + AFM_TOKEN_ENDKERNPAIRS, + AFM_TOKEN_ENDTRACKKERN, + AFM_TOKEN_ESCCHAR, + AFM_TOKEN_FAMILYNAME, + AFM_TOKEN_FONTBBOX, + AFM_TOKEN_FONTNAME, + AFM_TOKEN_FULLNAME, + AFM_TOKEN_ISBASEFONT, + AFM_TOKEN_ISCIDFONT, + AFM_TOKEN_ISFIXEDPITCH, + AFM_TOKEN_ISFIXEDV, + AFM_TOKEN_ITALICANGLE, + AFM_TOKEN_KP, + AFM_TOKEN_KPH, + AFM_TOKEN_KPX, + AFM_TOKEN_KPY, + AFM_TOKEN_L, + AFM_TOKEN_MAPPINGSCHEME, + AFM_TOKEN_METRICSSETS, + AFM_TOKEN_N, + AFM_TOKEN_NOTICE, + AFM_TOKEN_PCC, + AFM_TOKEN_STARTAXIS, + AFM_TOKEN_STARTCHARMETRICS, + AFM_TOKEN_STARTCOMPOSITES, + AFM_TOKEN_STARTDIRECTION, + AFM_TOKEN_STARTFONTMETRICS, + AFM_TOKEN_STARTKERNDATA, + AFM_TOKEN_STARTKERNPAIRS, + AFM_TOKEN_STARTKERNPAIRS0, + AFM_TOKEN_STARTKERNPAIRS1, + AFM_TOKEN_STARTTRACKKERN, + AFM_TOKEN_STDHW, + AFM_TOKEN_STDVW, + AFM_TOKEN_TRACKKERN, + AFM_TOKEN_UNDERLINEPOSITION, + AFM_TOKEN_UNDERLINETHICKNESS, + AFM_TOKEN_VV, + AFM_TOKEN_VVECTOR, + AFM_TOKEN_VERSION, + AFM_TOKEN_W, + AFM_TOKEN_W0, + AFM_TOKEN_W0X, + AFM_TOKEN_W0Y, + AFM_TOKEN_W1, + AFM_TOKEN_W1X, + AFM_TOKEN_W1Y, + AFM_TOKEN_WX, + AFM_TOKEN_WY, + AFM_TOKEN_WEIGHT, + AFM_TOKEN_WEIGHTVECTOR, + AFM_TOKEN_XHEIGHT, + N_AFM_TOKENS, + AFM_TOKEN_UNKNOWN + + } AFM_Token; + + + static const char* const afm_key_table[N_AFM_TOKENS] = + { + "Ascender", + "AxisLabel", + "AxisType", + "B", + "BlendAxisTypes", + "BlendDesignMap", + "BlendDesignPositions", + "C", + "CC", + "CH", + "CapHeight", + "CharWidth", + "CharacterSet", + "Characters", + "Descender", + "EncodingScheme", + "EndAxis", + "EndCharMetrics", + "EndComposites", + "EndDirection", + "EndFontMetrics", + "EndKernData", + "EndKernPairs", + "EndTrackKern", + "EscChar", + "FamilyName", + "FontBBox", + "FontName", + "FullName", + "IsBaseFont", + "IsCIDFont", + "IsFixedPitch", + "IsFixedV", + "ItalicAngle", + "KP", + "KPH", + "KPX", + "KPY", + "L", + "MappingScheme", + "MetricsSets", + "N", + "Notice", + "PCC", + "StartAxis", + "StartCharMetrics", + "StartComposites", + "StartDirection", + "StartFontMetrics", + "StartKernData", + "StartKernPairs", + "StartKernPairs0", + "StartKernPairs1", + "StartTrackKern", + "StdHW", + "StdVW", + "TrackKern", + "UnderlinePosition", + "UnderlineThickness", + "VV", + "VVector", + "Version", + "W", + "W0", + "W0X", + "W0Y", + "W1", + "W1X", + "W1Y", + "WX", + "WY", + "Weight", + "WeightVector", + "XHeight" + }; + + + /* + * `afm_parser_read_vals' and `afm_parser_next_key' provide + * high-level operations to an AFM_Stream. The rest of the + * parser functions should use them without accessing the + * AFM_Stream directly. + */ + + FT_LOCAL_DEF( FT_Int ) + afm_parser_read_vals( AFM_Parser parser, + AFM_Value vals, + FT_Int n ) + { + AFM_Stream stream = parser->stream; + char* str; + FT_Int i; + + + if ( n > AFM_MAX_ARGUMENTS ) + return 0; + + for ( i = 0; i < n; i++ ) + { + FT_UInt len; + AFM_Value val = vals + i; + + + if ( val->type == AFM_VALUE_TYPE_STRING ) + str = afm_stream_read_string( stream ); + else + str = afm_stream_read_one( stream ); + + if ( !str ) + break; + + len = AFM_STREAM_KEY_LEN( stream, str ); + + switch ( val->type ) + { + case AFM_VALUE_TYPE_STRING: + case AFM_VALUE_TYPE_NAME: + { + FT_Memory memory = parser->memory; + FT_Error error; + + + if ( !FT_QALLOC( val->u.s, len + 1 ) ) + { + ft_memcpy( val->u.s, str, len ); + val->u.s[len] = '\0'; + } + } + break; + + case AFM_VALUE_TYPE_FIXED: + val->u.f = PS_Conv_ToFixed( (FT_Byte**)(void*)&str, + (FT_Byte*)str + len, 0 ); + break; + + case AFM_VALUE_TYPE_INTEGER: + val->u.i = PS_Conv_ToInt( (FT_Byte**)(void*)&str, + (FT_Byte*)str + len ); + break; + + case AFM_VALUE_TYPE_BOOL: + val->u.b = FT_BOOL( len == 4 && + !ft_strncmp( str, "true", 4 ) ); + break; + + case AFM_VALUE_TYPE_INDEX: + if ( parser->get_index ) + val->u.i = parser->get_index( str, len, parser->user_data ); + else + val->u.i = 0; + break; + } + } + + return i; + } + + + FT_LOCAL_DEF( char* ) + afm_parser_next_key( AFM_Parser parser, + FT_Bool line, + FT_UInt* len ) + { + AFM_Stream stream = parser->stream; + char* key = 0; /* make stupid compiler happy */ + + + if ( line ) + { + while ( 1 ) + { + /* skip current line */ + if ( !AFM_STATUS_EOL( stream ) ) + afm_stream_read_string( stream ); + + stream->status = AFM_STREAM_STATUS_NORMAL; + key = afm_stream_read_one( stream ); + + /* skip empty line */ + if ( !key && + !AFM_STATUS_EOF( stream ) && + AFM_STATUS_EOL( stream ) ) + continue; + + break; + } + } + else + { + while ( 1 ) + { + /* skip current column */ + while ( !AFM_STATUS_EOC( stream ) ) + afm_stream_read_one( stream ); + + stream->status = AFM_STREAM_STATUS_NORMAL; + key = afm_stream_read_one( stream ); + + /* skip empty column */ + if ( !key && + !AFM_STATUS_EOF( stream ) && + AFM_STATUS_EOC( stream ) ) + continue; + + break; + } + } + + if ( len ) + *len = ( key ) ? AFM_STREAM_KEY_LEN( stream, key ) + : 0; + + return key; + } + + + static AFM_Token + afm_tokenize( const char* key, + FT_UInt len ) + { + int n; + + + for ( n = 0; n < N_AFM_TOKENS; n++ ) + { + if ( *( afm_key_table[n] ) == *key ) + { + for ( ; n < N_AFM_TOKENS; n++ ) + { + if ( *( afm_key_table[n] ) != *key ) + return AFM_TOKEN_UNKNOWN; + + if ( ft_strncmp( afm_key_table[n], key, len ) == 0 ) + return (AFM_Token) n; + } + } + } + + return AFM_TOKEN_UNKNOWN; + } + + + FT_LOCAL_DEF( FT_Error ) + afm_parser_init( AFM_Parser parser, + FT_Memory memory, + FT_Byte* base, + FT_Byte* limit ) + { + AFM_Stream stream; + FT_Error error; + + + if ( FT_NEW( stream ) ) + return error; + + stream->cursor = stream->base = base; + stream->limit = limit; + + /* don't skip the first line during the first call */ + stream->status = AFM_STREAM_STATUS_EOL; + + parser->memory = memory; + parser->stream = stream; + parser->FontInfo = NULL; + parser->get_index = NULL; + + return PSaux_Err_Ok; + } + + + FT_LOCAL( void ) + afm_parser_done( AFM_Parser parser ) + { + FT_Memory memory = parser->memory; + + + FT_FREE( parser->stream ); + } + + + FT_LOCAL_DEF( FT_Error ) + afm_parser_read_int( AFM_Parser parser, + FT_Int* aint ) + { + AFM_ValueRec val; + + + val.type = AFM_VALUE_TYPE_INTEGER; + + if ( afm_parser_read_vals( parser, &val, 1 ) == 1 ) + { + *aint = val.u.i; + + return PSaux_Err_Ok; + } + else + return PSaux_Err_Syntax_Error; + } + + + static FT_Error + afm_parse_track_kern( AFM_Parser parser ) + { + AFM_FontInfo fi = parser->FontInfo; + AFM_TrackKern tk; + char* key; + FT_UInt len; + int n = -1; + + + if ( afm_parser_read_int( parser, &fi->NumTrackKern ) ) + goto Fail; + + if ( fi->NumTrackKern ) + { + FT_Memory memory = parser->memory; + FT_Error error; + + + if ( FT_QNEW_ARRAY( fi->TrackKerns, fi->NumTrackKern ) ) + return error; + } + + while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) + { + AFM_ValueRec shared_vals[5]; + + + switch ( afm_tokenize( key, len ) ) + { + case AFM_TOKEN_TRACKKERN: + n++; + + if ( n >= fi->NumTrackKern ) + goto Fail; + + tk = fi->TrackKerns + n; + + shared_vals[0].type = AFM_VALUE_TYPE_INTEGER; + shared_vals[1].type = AFM_VALUE_TYPE_FIXED; + shared_vals[2].type = AFM_VALUE_TYPE_FIXED; + shared_vals[3].type = AFM_VALUE_TYPE_FIXED; + shared_vals[4].type = AFM_VALUE_TYPE_FIXED; + if ( afm_parser_read_vals( parser, shared_vals, 5 ) != 5 ) + goto Fail; + + tk->degree = shared_vals[0].u.i; + tk->min_ptsize = shared_vals[1].u.f; + tk->min_kern = shared_vals[2].u.f; + tk->max_ptsize = shared_vals[3].u.f; + tk->max_kern = shared_vals[4].u.f; + + /* is this correct? */ + if ( tk->degree < 0 && tk->min_kern > 0 ) + tk->min_kern = -tk->min_kern; + break; + + case AFM_TOKEN_ENDTRACKKERN: + case AFM_TOKEN_ENDKERNDATA: + case AFM_TOKEN_ENDFONTMETRICS: + fi->NumTrackKern = n + 1; + return PSaux_Err_Ok; + + case AFM_TOKEN_UNKNOWN: + break; + + default: + goto Fail; + } + } + + Fail: + return PSaux_Err_Syntax_Error; + } + + +#undef KERN_INDEX +#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 ) + + + /* compare two kerning pairs */ + FT_CALLBACK_DEF( int ) + afm_compare_kern_pairs( const void* a, + const void* b ) + { + AFM_KernPair kp1 = (AFM_KernPair)a; + AFM_KernPair kp2 = (AFM_KernPair)b; + + FT_ULong index1 = KERN_INDEX( kp1->index1, kp1->index2 ); + FT_ULong index2 = KERN_INDEX( kp2->index1, kp2->index2 ); + + + return (int)( index1 - index2 ); + } + + + static FT_Error + afm_parse_kern_pairs( AFM_Parser parser ) + { + AFM_FontInfo fi = parser->FontInfo; + AFM_KernPair kp; + char* key; + FT_UInt len; + int n = -1; + + + if ( afm_parser_read_int( parser, &fi->NumKernPair ) ) + goto Fail; + + if ( fi->NumKernPair ) + { + FT_Memory memory = parser->memory; + FT_Error error; + + + if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) ) + return error; + } + + while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) + { + AFM_Token token = afm_tokenize( key, len ); + + + switch ( token ) + { + case AFM_TOKEN_KP: + case AFM_TOKEN_KPX: + case AFM_TOKEN_KPY: + { + FT_Int r; + AFM_ValueRec shared_vals[4]; + + + n++; + + if ( n >= fi->NumKernPair ) + goto Fail; + + kp = fi->KernPairs + n; + + shared_vals[0].type = AFM_VALUE_TYPE_INDEX; + shared_vals[1].type = AFM_VALUE_TYPE_INDEX; + shared_vals[2].type = AFM_VALUE_TYPE_INTEGER; + shared_vals[3].type = AFM_VALUE_TYPE_INTEGER; + r = afm_parser_read_vals( parser, shared_vals, 4 ); + if ( r < 3 ) + goto Fail; + + kp->index1 = shared_vals[0].u.i; + kp->index2 = shared_vals[1].u.i; + if ( token == AFM_TOKEN_KPY ) + { + kp->x = 0; + kp->y = shared_vals[2].u.i; + } + else + { + kp->x = shared_vals[2].u.i; + kp->y = ( token == AFM_TOKEN_KP && r == 4 ) + ? shared_vals[3].u.i : 0; + } + } + break; + + case AFM_TOKEN_ENDKERNPAIRS: + case AFM_TOKEN_ENDKERNDATA: + case AFM_TOKEN_ENDFONTMETRICS: + fi->NumKernPair = n + 1; + ft_qsort( fi->KernPairs, fi->NumKernPair, + sizeof( AFM_KernPairRec ), + afm_compare_kern_pairs ); + return PSaux_Err_Ok; + + case AFM_TOKEN_UNKNOWN: + break; + + default: + goto Fail; + } + } + + Fail: + return PSaux_Err_Syntax_Error; + } + + + static FT_Error + afm_parse_kern_data( AFM_Parser parser ) + { + FT_Error error; + char* key; + FT_UInt len; + + + while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) + { + switch ( afm_tokenize( key, len ) ) + { + case AFM_TOKEN_STARTTRACKKERN: + error = afm_parse_track_kern( parser ); + if ( error ) + return error; + break; + + case AFM_TOKEN_STARTKERNPAIRS: + case AFM_TOKEN_STARTKERNPAIRS0: + error = afm_parse_kern_pairs( parser ); + if ( error ) + return error; + break; + + case AFM_TOKEN_ENDKERNDATA: + case AFM_TOKEN_ENDFONTMETRICS: + return PSaux_Err_Ok; + + case AFM_TOKEN_UNKNOWN: + break; + + default: + goto Fail; + } + } + + Fail: + return PSaux_Err_Syntax_Error; + } + + + static FT_Error + afm_parser_skip_section( AFM_Parser parser, + FT_UInt n, + AFM_Token end_section ) + { + char* key; + FT_UInt len; + + + while ( n-- > 0 ) + { + key = afm_parser_next_key( parser, 1, NULL ); + if ( !key ) + goto Fail; + } + + while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) + { + AFM_Token token = afm_tokenize( key, len ); + + + if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS ) + return PSaux_Err_Ok; + } + + Fail: + return PSaux_Err_Syntax_Error; + } + + + FT_LOCAL_DEF( FT_Error ) + afm_parser_parse( AFM_Parser parser ) + { + FT_Memory memory = parser->memory; + AFM_FontInfo fi = parser->FontInfo; + FT_Error error = PSaux_Err_Syntax_Error; + char* key; + FT_UInt len; + FT_Int metrics_sets = 0; + + + if ( !fi ) + return PSaux_Err_Invalid_Argument; + + key = afm_parser_next_key( parser, 1, &len ); + if ( !key || len != 16 || + ft_strncmp( key, "StartFontMetrics", 16 ) != 0 ) + return PSaux_Err_Unknown_File_Format; + + while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) + { + AFM_ValueRec shared_vals[4]; + + + switch ( afm_tokenize( key, len ) ) + { + case AFM_TOKEN_METRICSSETS: + if ( afm_parser_read_int( parser, &metrics_sets ) ) + goto Fail; + + if ( metrics_sets != 0 && metrics_sets != 2 ) + { + error = PSaux_Err_Unimplemented_Feature; + + goto Fail; + } + break; + + case AFM_TOKEN_ISCIDFONT: + shared_vals[0].type = AFM_VALUE_TYPE_BOOL; + if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 ) + goto Fail; + + fi->IsCIDFont = shared_vals[0].u.b; + break; + + case AFM_TOKEN_FONTBBOX: + shared_vals[0].type = AFM_VALUE_TYPE_FIXED; + shared_vals[1].type = AFM_VALUE_TYPE_FIXED; + shared_vals[2].type = AFM_VALUE_TYPE_FIXED; + shared_vals[3].type = AFM_VALUE_TYPE_FIXED; + if ( afm_parser_read_vals( parser, shared_vals, 4 ) != 4 ) + goto Fail; + + fi->FontBBox.xMin = shared_vals[0].u.f; + fi->FontBBox.yMin = shared_vals[1].u.f; + fi->FontBBox.xMax = shared_vals[2].u.f; + fi->FontBBox.yMax = shared_vals[3].u.f; + break; + + case AFM_TOKEN_ASCENDER: + shared_vals[0].type = AFM_VALUE_TYPE_FIXED; + if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 ) + goto Fail; + + fi->Ascender = shared_vals[0].u.f; + break; + + case AFM_TOKEN_DESCENDER: + shared_vals[0].type = AFM_VALUE_TYPE_FIXED; + if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 ) + goto Fail; + + fi->Descender = shared_vals[0].u.f; + break; + + case AFM_TOKEN_STARTCHARMETRICS: + { + FT_Int n = 0; + + + if ( afm_parser_read_int( parser, &n ) ) + goto Fail; + + error = afm_parser_skip_section( parser, n, + AFM_TOKEN_ENDCHARMETRICS ); + if ( error ) + return error; + } + break; + + case AFM_TOKEN_STARTKERNDATA: + error = afm_parse_kern_data( parser ); + if ( error ) + goto Fail; + /* fall through since we only support kern data */ + + case AFM_TOKEN_ENDFONTMETRICS: + return PSaux_Err_Ok; + + default: + break; + } + } + + Fail: + FT_FREE( fi->TrackKerns ); + fi->NumTrackKern = 0; + + FT_FREE( fi->KernPairs ); + fi->NumKernPair = 0; + + fi->IsCIDFont = 0; + + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/afmparse.h b/reactos/dll/3rdparty/freetype/src/psaux/afmparse.h index c2fce75c86e..2b7c7cfa69d 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/afmparse.h +++ b/reactos/dll/3rdparty/freetype/src/psaux/afmparse.h @@ -1,87 +1,87 @@ -/***************************************************************************/ -/* */ -/* afmparse.h */ -/* */ -/* AFM parser (specification). */ -/* */ -/* Copyright 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __AFMPARSE_H__ -#define __AFMPARSE_H__ - - -#include -#include FT_INTERNAL_POSTSCRIPT_AUX_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - afm_parser_init( AFM_Parser parser, - FT_Memory memory, - FT_Byte* base, - FT_Byte* limit ); - - - FT_LOCAL( void ) - afm_parser_done( AFM_Parser parser ); - - - FT_LOCAL( FT_Error ) - afm_parser_parse( AFM_Parser parser ); - - - enum AFM_ValueType_ - { - AFM_VALUE_TYPE_STRING, - AFM_VALUE_TYPE_NAME, - AFM_VALUE_TYPE_FIXED, /* real number */ - AFM_VALUE_TYPE_INTEGER, - AFM_VALUE_TYPE_BOOL, - AFM_VALUE_TYPE_INDEX /* glyph index */ - }; - - - typedef struct AFM_ValueRec_ - { - enum AFM_ValueType_ type; - union { - char* s; - FT_Fixed f; - FT_Int i; - FT_Bool b; - - } u; - - } AFM_ValueRec, *AFM_Value; - -#define AFM_MAX_ARGUMENTS 5 - - FT_LOCAL( FT_Int ) - afm_parser_read_vals( AFM_Parser parser, - AFM_Value vals, - FT_Int n ); - - /* read the next key from the next line or column */ - FT_LOCAL( char* ) - afm_parser_next_key( AFM_Parser parser, - FT_Bool line, - FT_UInt* len ); - -FT_END_HEADER - -#endif /* __AFMPARSE_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* afmparse.h */ +/* */ +/* AFM parser (specification). */ +/* */ +/* Copyright 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __AFMPARSE_H__ +#define __AFMPARSE_H__ + + +#include +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + afm_parser_init( AFM_Parser parser, + FT_Memory memory, + FT_Byte* base, + FT_Byte* limit ); + + + FT_LOCAL( void ) + afm_parser_done( AFM_Parser parser ); + + + FT_LOCAL( FT_Error ) + afm_parser_parse( AFM_Parser parser ); + + + enum AFM_ValueType_ + { + AFM_VALUE_TYPE_STRING, + AFM_VALUE_TYPE_NAME, + AFM_VALUE_TYPE_FIXED, /* real number */ + AFM_VALUE_TYPE_INTEGER, + AFM_VALUE_TYPE_BOOL, + AFM_VALUE_TYPE_INDEX /* glyph index */ + }; + + + typedef struct AFM_ValueRec_ + { + enum AFM_ValueType_ type; + union { + char* s; + FT_Fixed f; + FT_Int i; + FT_Bool b; + + } u; + + } AFM_ValueRec, *AFM_Value; + +#define AFM_MAX_ARGUMENTS 5 + + FT_LOCAL( FT_Int ) + afm_parser_read_vals( AFM_Parser parser, + AFM_Value vals, + FT_Int n ); + + /* read the next key from the next line or column */ + FT_LOCAL( char* ) + afm_parser_next_key( AFM_Parser parser, + FT_Bool line, + FT_UInt* len ); + +FT_END_HEADER + +#endif /* __AFMPARSE_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psaux.c b/reactos/dll/3rdparty/freetype/src/psaux/psaux.c index a4b9c5c6e45..ec9ba7aebbc 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psaux.c +++ b/reactos/dll/3rdparty/freetype/src/psaux/psaux.c @@ -1,34 +1,34 @@ -/***************************************************************************/ -/* */ -/* psaux.c */ -/* */ -/* FreeType auxiliary PostScript driver component (body only). */ -/* */ -/* Copyright 1996-2001, 2002, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "psobjs.c" -#include "psauxmod.c" -#include "t1decode.c" -#include "t1cmap.c" - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include "afmparse.c" -#endif - -#include "psconv.c" - - -/* END */ +/***************************************************************************/ +/* */ +/* psaux.c */ +/* */ +/* FreeType auxiliary PostScript driver component (body only). */ +/* */ +/* Copyright 1996-2001, 2002, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "psobjs.c" +#include "psauxmod.c" +#include "t1decode.c" +#include "t1cmap.c" + +#ifndef T1_CONFIG_OPTION_NO_AFM +#include "afmparse.c" +#endif + +#include "psconv.c" + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psauxerr.h b/reactos/dll/3rdparty/freetype/src/psaux/psauxerr.h index d0baa3cbb9c..7d723acba09 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psauxerr.h +++ b/reactos/dll/3rdparty/freetype/src/psaux/psauxerr.h @@ -1,41 +1,41 @@ -/***************************************************************************/ -/* */ -/* psauxerr.h */ -/* */ -/* PS auxiliary module error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the PS auxiliary module error enumeration */ - /* constants. */ - /* */ - /*************************************************************************/ - -#ifndef __PSAUXERR_H__ -#define __PSAUXERR_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX PSaux_Err_ -#define FT_ERR_BASE FT_Mod_Err_PSaux - -#include FT_ERRORS_H - -#endif /* __PSAUXERR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* psauxerr.h */ +/* */ +/* PS auxiliary module error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the PS auxiliary module error enumeration */ + /* constants. */ + /* */ + /*************************************************************************/ + +#ifndef __PSAUXERR_H__ +#define __PSAUXERR_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX PSaux_Err_ +#define FT_ERR_BASE FT_Mod_Err_PSaux + +#include FT_ERRORS_H + +#endif /* __PSAUXERR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.c b/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.c index 4c3579f7b8e..016e73ce327 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.c +++ b/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.c @@ -1,139 +1,139 @@ -/***************************************************************************/ -/* */ -/* psauxmod.c */ -/* */ -/* FreeType auxiliary PostScript module implementation (body). */ -/* */ -/* Copyright 2000-2001, 2002, 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include "psauxmod.h" -#include "psobjs.h" -#include "t1decode.h" -#include "t1cmap.h" - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include "afmparse.h" -#endif - - - FT_CALLBACK_TABLE_DEF - const PS_Table_FuncsRec ps_table_funcs = - { - ps_table_new, - ps_table_done, - ps_table_add, - ps_table_release - }; - - - FT_CALLBACK_TABLE_DEF - const PS_Parser_FuncsRec ps_parser_funcs = - { - ps_parser_init, - ps_parser_done, - ps_parser_skip_spaces, - ps_parser_skip_PS_token, - ps_parser_to_int, - ps_parser_to_fixed, - ps_parser_to_bytes, - ps_parser_to_coord_array, - ps_parser_to_fixed_array, - ps_parser_to_token, - ps_parser_to_token_array, - ps_parser_load_field, - ps_parser_load_field_table - }; - - - FT_CALLBACK_TABLE_DEF - const T1_Builder_FuncsRec t1_builder_funcs = - { - t1_builder_init, - t1_builder_done, - t1_builder_check_points, - t1_builder_add_point, - t1_builder_add_point1, - t1_builder_add_contour, - t1_builder_start_point, - t1_builder_close_contour - }; - - - FT_CALLBACK_TABLE_DEF - const T1_Decoder_FuncsRec t1_decoder_funcs = - { - t1_decoder_init, - t1_decoder_done, - t1_decoder_parse_charstrings - }; - - -#ifndef T1_CONFIG_OPTION_NO_AFM - FT_CALLBACK_TABLE_DEF - const AFM_Parser_FuncsRec afm_parser_funcs = - { - afm_parser_init, - afm_parser_done, - afm_parser_parse - }; -#endif - - - FT_CALLBACK_TABLE_DEF - const T1_CMap_ClassesRec t1_cmap_classes = - { - &t1_cmap_standard_class_rec, - &t1_cmap_expert_class_rec, - &t1_cmap_custom_class_rec, - &t1_cmap_unicode_class_rec - }; - - - static - const PSAux_Interface psaux_interface = - { - &ps_table_funcs, - &ps_parser_funcs, - &t1_builder_funcs, - &t1_decoder_funcs, - t1_decrypt, - - (const T1_CMap_ClassesRec*) &t1_cmap_classes, - -#ifndef T1_CONFIG_OPTION_NO_AFM - &afm_parser_funcs, -#else - 0, -#endif - }; - - - FT_CALLBACK_TABLE_DEF - const FT_Module_Class psaux_module_class = - { - 0, - sizeof( FT_ModuleRec ), - "psaux", - 0x20000L, - 0x20000L, - - &psaux_interface, /* module-specific interface */ - - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* psauxmod.c */ +/* */ +/* FreeType auxiliary PostScript module implementation (body). */ +/* */ +/* Copyright 2000-2001, 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include "psauxmod.h" +#include "psobjs.h" +#include "t1decode.h" +#include "t1cmap.h" + +#ifndef T1_CONFIG_OPTION_NO_AFM +#include "afmparse.h" +#endif + + + FT_CALLBACK_TABLE_DEF + const PS_Table_FuncsRec ps_table_funcs = + { + ps_table_new, + ps_table_done, + ps_table_add, + ps_table_release + }; + + + FT_CALLBACK_TABLE_DEF + const PS_Parser_FuncsRec ps_parser_funcs = + { + ps_parser_init, + ps_parser_done, + ps_parser_skip_spaces, + ps_parser_skip_PS_token, + ps_parser_to_int, + ps_parser_to_fixed, + ps_parser_to_bytes, + ps_parser_to_coord_array, + ps_parser_to_fixed_array, + ps_parser_to_token, + ps_parser_to_token_array, + ps_parser_load_field, + ps_parser_load_field_table + }; + + + FT_CALLBACK_TABLE_DEF + const T1_Builder_FuncsRec t1_builder_funcs = + { + t1_builder_init, + t1_builder_done, + t1_builder_check_points, + t1_builder_add_point, + t1_builder_add_point1, + t1_builder_add_contour, + t1_builder_start_point, + t1_builder_close_contour + }; + + + FT_CALLBACK_TABLE_DEF + const T1_Decoder_FuncsRec t1_decoder_funcs = + { + t1_decoder_init, + t1_decoder_done, + t1_decoder_parse_charstrings + }; + + +#ifndef T1_CONFIG_OPTION_NO_AFM + FT_CALLBACK_TABLE_DEF + const AFM_Parser_FuncsRec afm_parser_funcs = + { + afm_parser_init, + afm_parser_done, + afm_parser_parse + }; +#endif + + + FT_CALLBACK_TABLE_DEF + const T1_CMap_ClassesRec t1_cmap_classes = + { + &t1_cmap_standard_class_rec, + &t1_cmap_expert_class_rec, + &t1_cmap_custom_class_rec, + &t1_cmap_unicode_class_rec + }; + + + static + const PSAux_Interface psaux_interface = + { + &ps_table_funcs, + &ps_parser_funcs, + &t1_builder_funcs, + &t1_decoder_funcs, + t1_decrypt, + + (const T1_CMap_ClassesRec*) &t1_cmap_classes, + +#ifndef T1_CONFIG_OPTION_NO_AFM + &afm_parser_funcs, +#else + 0, +#endif + }; + + + FT_CALLBACK_TABLE_DEF + const FT_Module_Class psaux_module_class = + { + 0, + sizeof( FT_ModuleRec ), + "psaux", + 0x20000L, + 0x20000L, + + &psaux_interface, /* module-specific interface */ + + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.h b/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.h index 92ac0560484..a8ef2827281 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.h +++ b/reactos/dll/3rdparty/freetype/src/psaux/psauxmod.h @@ -1,38 +1,38 @@ -/***************************************************************************/ -/* */ -/* psauxmod.h */ -/* */ -/* FreeType auxiliary PostScript module implementation (specification). */ -/* */ -/* Copyright 2000-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSAUXMOD_H__ -#define __PSAUXMOD_H__ - - -#include -#include FT_MODULE_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Module_Class ) psaux_driver_class; - - -FT_END_HEADER - -#endif /* __PSAUXMOD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* psauxmod.h */ +/* */ +/* FreeType auxiliary PostScript module implementation (specification). */ +/* */ +/* Copyright 2000-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSAUXMOD_H__ +#define __PSAUXMOD_H__ + + +#include +#include FT_MODULE_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Module_Class ) psaux_driver_class; + + +FT_END_HEADER + +#endif /* __PSAUXMOD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psconv.c b/reactos/dll/3rdparty/freetype/src/psaux/psconv.c index 3bbeab6d256..598f1267115 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psconv.c +++ b/reactos/dll/3rdparty/freetype/src/psaux/psconv.c @@ -1,466 +1,466 @@ -/***************************************************************************/ -/* */ -/* psconv.c */ -/* */ -/* Some convenience conversions (body). */ -/* */ -/* Copyright 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_DEBUG_H - -#include "psconv.h" -#include "psobjs.h" -#include "psauxerr.h" - - - /* The following array is used by various functions to quickly convert */ - /* digits (both decimal and non-decimal) into numbers. */ - -#if 'A' == 65 - /* ASCII */ - - static const FT_Char ft_char_table[128] = - { - /* 0x00 */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, - }; - - /* no character >= 0x80 can represent a valid number */ -#define OP >= - -#endif /* 'A' == 65 */ - -#if 'A' == 193 - /* EBCDIC */ - - static const FT_Char ft_char_table[128] = - { - /* 0x80 */ - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, - -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, - -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, - -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, - -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - }; - - /* no character < 0x80 can represent a valid number */ -#define OP < - -#endif /* 'A' == 193 */ - - - FT_LOCAL_DEF( FT_Int ) - PS_Conv_Strtol( FT_Byte** cursor, - FT_Byte* limit, - FT_Int base ) - { - FT_Byte* p = *cursor; - FT_Int num = 0; - FT_Bool sign = 0; - - - if ( p == limit || base < 2 || base > 36 ) - return 0; - - if ( *p == '-' || *p == '+' ) - { - sign = FT_BOOL( *p == '-' ); - - p++; - if ( p == limit ) - return 0; - } - - for ( ; p < limit; p++ ) - { - FT_Char c; - - - if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) - break; - - c = ft_char_table[*p & 0x7f]; - - if ( c < 0 || c >= base ) - break; - - num = num * base + c; - } - - if ( sign ) - num = -num; - - *cursor = p; - - return num; - } - - - FT_LOCAL_DEF( FT_Int ) - PS_Conv_ToInt( FT_Byte** cursor, - FT_Byte* limit ) - - { - FT_Byte* p; - FT_Int num; - - - num = PS_Conv_Strtol( cursor, limit, 10 ); - p = *cursor; - - if ( p < limit && *p == '#' ) - { - *cursor = p + 1; - - return PS_Conv_Strtol( cursor, limit, num ); - } - else - return num; - } - - - FT_LOCAL_DEF( FT_Fixed ) - PS_Conv_ToFixed( FT_Byte** cursor, - FT_Byte* limit, - FT_Int power_ten ) - { - FT_Byte* p = *cursor; - FT_Fixed integral; - FT_Long decimal = 0, divider = 1; - FT_Bool sign = 0; - - - if ( p == limit ) - return 0; - - if ( *p == '-' || *p == '+' ) - { - sign = FT_BOOL( *p == '-' ); - - p++; - if ( p == limit ) - return 0; - } - - if ( *p != '.' ) - integral = PS_Conv_ToInt( &p, limit ) << 16; - else - integral = 0; - - /* read the decimal part */ - if ( p < limit && *p == '.' ) - { - p++; - - for ( ; p < limit; p++ ) - { - FT_Char c; - - - if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) - break; - - c = ft_char_table[*p & 0x7f]; - - if ( c < 0 || c >= 10 ) - break; - - if ( divider < 10000000L ) - { - decimal = decimal * 10 + c; - divider *= 10; - } - } - } - - /* read exponent, if any */ - if ( p + 1 < limit && ( *p == 'e' || *p == 'E' ) ) - { - p++; - power_ten += PS_Conv_ToInt( &p, limit ); - } - - while ( power_ten > 0 ) - { - integral *= 10; - decimal *= 10; - power_ten--; - } - - while ( power_ten < 0 ) - { - integral /= 10; - divider *= 10; - power_ten++; - } - - if ( decimal ) - integral += FT_DivFix( decimal, divider ); - - if ( sign ) - integral = -integral; - - *cursor = p; - - return integral; - } - - -#if 0 - FT_LOCAL_DEF( FT_UInt ) - PS_Conv_StringDecode( FT_Byte** cursor, - FT_Byte* limit, - FT_Byte* buffer, - FT_UInt n ) - { - FT_Byte* p; - FT_UInt r = 0; - - - for ( p = *cursor; r < n && p < limit; p++ ) - { - FT_Byte b; - - - if ( *p != '\\' ) - { - buffer[r++] = *p; - - continue; - } - - p++; - - switch ( *p ) - { - case 'n': - b = '\n'; - break; - case 'r': - b = '\r'; - break; - case 't': - b = '\t'; - break; - case 'b': - b = '\b'; - break; - case 'f': - b = '\f'; - break; - case '\r': - p++; - if ( *p != '\n' ) - { - b = *p; - - break; - } - /* no break */ - case '\n': - continue; - break; - default: - if ( IS_PS_DIGIT( *p ) ) - { - b = *p - '0'; - - p++; - - if ( IS_PS_DIGIT( *p ) ) - { - b = b * 8 + *p - '0'; - - p++; - - if ( IS_PS_DIGIT( *p ) ) - b = b * 8 + *p - '0'; - else - { - buffer[r++] = b; - b = *p; - } - } - else - { - buffer[r++] = b; - b = *p; - } - } - else - b = *p; - break; - } - - buffer[r++] = b; - } - - *cursor = p; - - return r; - } -#endif /* 0 */ - - - FT_LOCAL_DEF( FT_UInt ) - PS_Conv_ASCIIHexDecode( FT_Byte** cursor, - FT_Byte* limit, - FT_Byte* buffer, - FT_UInt n ) - { - FT_Byte* p; - FT_UInt r = 0; - FT_UInt w = 0; - FT_UInt pad = 0x01; - - - n *= 2; - -#if 1 - - p = *cursor; - if ( n > (FT_UInt)( limit - p ) ) - n = (FT_UInt)( limit - p ); - - /* we try to process two nibbles at a time to be as fast as possible */ - for ( ; r < n; r++ ) - { - FT_UInt c = p[r]; - - - if ( IS_PS_SPACE( c ) ) - continue; - - if ( c OP 0x80 ) - break; - - c = ft_char_table[c & 0x7F]; - if ( (unsigned)c >= 16 ) - break; - - pad = ( pad << 4 ) | c; - if ( pad & 0x100 ) - { - buffer[w++] = (FT_Byte)pad; - pad = 0x01; - } - } - - if ( pad != 0x01 ) - buffer[w++] = (FT_Byte)( pad << 4 ); - - *cursor = p + r; - - return w; - -#else /* 0 */ - - for ( r = 0; r < n; r++ ) - { - FT_Char c; - - - if ( IS_PS_SPACE( *p ) ) - continue; - - if ( *p OP 0x80 ) - break; - - c = ft_char_table[*p & 0x7f]; - - if ( (unsigned)c >= 16 ) - break; - - if ( r & 1 ) - { - *buffer = (FT_Byte)(*buffer + c); - buffer++; - } - else - *buffer = (FT_Byte)(c << 4); - - r++; - } - - *cursor = p; - - return ( r + 1 ) / 2; - -#endif /* 0 */ - - } - - - FT_LOCAL_DEF( FT_UInt ) - PS_Conv_EexecDecode( FT_Byte** cursor, - FT_Byte* limit, - FT_Byte* buffer, - FT_UInt n, - FT_UShort* seed ) - { - FT_Byte* p; - FT_UInt r; - FT_UInt s = *seed; - - -#if 1 - - p = *cursor; - if ( n > (FT_UInt)(limit - p) ) - n = (FT_UInt)(limit - p); - - for ( r = 0; r < n; r++ ) - { - FT_UInt val = p[r]; - FT_UInt b = ( val ^ ( s >> 8 ) ); - - - s = ( (val + s)*52845U + 22719 ) & 0xFFFFU; - buffer[r] = (FT_Byte) b; - } - - *cursor = p + n; - *seed = (FT_UShort)s; - -#else /* 0 */ - - for ( r = 0, p = *cursor; r < n && p < limit; r++, p++ ) - { - FT_Byte b = (FT_Byte)( *p ^ ( s >> 8 ) ); - - - s = (FT_UShort)( ( *p + s ) * 52845U + 22719 ); - *buffer++ = b; - } - *cursor = p; - *seed = s; - -#endif /* 0 */ - - return r; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* psconv.c */ +/* */ +/* Some convenience conversions (body). */ +/* */ +/* Copyright 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_INTERNAL_DEBUG_H + +#include "psconv.h" +#include "psobjs.h" +#include "psauxerr.h" + + + /* The following array is used by various functions to quickly convert */ + /* digits (both decimal and non-decimal) into numbers. */ + +#if 'A' == 65 + /* ASCII */ + + static const FT_Char ft_char_table[128] = + { + /* 0x00 */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + }; + + /* no character >= 0x80 can represent a valid number */ +#define OP >= + +#endif /* 'A' == 65 */ + +#if 'A' == 193 + /* EBCDIC */ + + static const FT_Char ft_char_table[128] = + { + /* 0x80 */ + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, + -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, + -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, + -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, + -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, + }; + + /* no character < 0x80 can represent a valid number */ +#define OP < + +#endif /* 'A' == 193 */ + + + FT_LOCAL_DEF( FT_Int ) + PS_Conv_Strtol( FT_Byte** cursor, + FT_Byte* limit, + FT_Int base ) + { + FT_Byte* p = *cursor; + FT_Int num = 0; + FT_Bool sign = 0; + + + if ( p == limit || base < 2 || base > 36 ) + return 0; + + if ( *p == '-' || *p == '+' ) + { + sign = FT_BOOL( *p == '-' ); + + p++; + if ( p == limit ) + return 0; + } + + for ( ; p < limit; p++ ) + { + FT_Char c; + + + if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) + break; + + c = ft_char_table[*p & 0x7f]; + + if ( c < 0 || c >= base ) + break; + + num = num * base + c; + } + + if ( sign ) + num = -num; + + *cursor = p; + + return num; + } + + + FT_LOCAL_DEF( FT_Int ) + PS_Conv_ToInt( FT_Byte** cursor, + FT_Byte* limit ) + + { + FT_Byte* p; + FT_Int num; + + + num = PS_Conv_Strtol( cursor, limit, 10 ); + p = *cursor; + + if ( p < limit && *p == '#' ) + { + *cursor = p + 1; + + return PS_Conv_Strtol( cursor, limit, num ); + } + else + return num; + } + + + FT_LOCAL_DEF( FT_Fixed ) + PS_Conv_ToFixed( FT_Byte** cursor, + FT_Byte* limit, + FT_Int power_ten ) + { + FT_Byte* p = *cursor; + FT_Fixed integral; + FT_Long decimal = 0, divider = 1; + FT_Bool sign = 0; + + + if ( p == limit ) + return 0; + + if ( *p == '-' || *p == '+' ) + { + sign = FT_BOOL( *p == '-' ); + + p++; + if ( p == limit ) + return 0; + } + + if ( *p != '.' ) + integral = PS_Conv_ToInt( &p, limit ) << 16; + else + integral = 0; + + /* read the decimal part */ + if ( p < limit && *p == '.' ) + { + p++; + + for ( ; p < limit; p++ ) + { + FT_Char c; + + + if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) + break; + + c = ft_char_table[*p & 0x7f]; + + if ( c < 0 || c >= 10 ) + break; + + if ( divider < 10000000L ) + { + decimal = decimal * 10 + c; + divider *= 10; + } + } + } + + /* read exponent, if any */ + if ( p + 1 < limit && ( *p == 'e' || *p == 'E' ) ) + { + p++; + power_ten += PS_Conv_ToInt( &p, limit ); + } + + while ( power_ten > 0 ) + { + integral *= 10; + decimal *= 10; + power_ten--; + } + + while ( power_ten < 0 ) + { + integral /= 10; + divider *= 10; + power_ten++; + } + + if ( decimal ) + integral += FT_DivFix( decimal, divider ); + + if ( sign ) + integral = -integral; + + *cursor = p; + + return integral; + } + + +#if 0 + FT_LOCAL_DEF( FT_UInt ) + PS_Conv_StringDecode( FT_Byte** cursor, + FT_Byte* limit, + FT_Byte* buffer, + FT_UInt n ) + { + FT_Byte* p; + FT_UInt r = 0; + + + for ( p = *cursor; r < n && p < limit; p++ ) + { + FT_Byte b; + + + if ( *p != '\\' ) + { + buffer[r++] = *p; + + continue; + } + + p++; + + switch ( *p ) + { + case 'n': + b = '\n'; + break; + case 'r': + b = '\r'; + break; + case 't': + b = '\t'; + break; + case 'b': + b = '\b'; + break; + case 'f': + b = '\f'; + break; + case '\r': + p++; + if ( *p != '\n' ) + { + b = *p; + + break; + } + /* no break */ + case '\n': + continue; + break; + default: + if ( IS_PS_DIGIT( *p ) ) + { + b = *p - '0'; + + p++; + + if ( IS_PS_DIGIT( *p ) ) + { + b = b * 8 + *p - '0'; + + p++; + + if ( IS_PS_DIGIT( *p ) ) + b = b * 8 + *p - '0'; + else + { + buffer[r++] = b; + b = *p; + } + } + else + { + buffer[r++] = b; + b = *p; + } + } + else + b = *p; + break; + } + + buffer[r++] = b; + } + + *cursor = p; + + return r; + } +#endif /* 0 */ + + + FT_LOCAL_DEF( FT_UInt ) + PS_Conv_ASCIIHexDecode( FT_Byte** cursor, + FT_Byte* limit, + FT_Byte* buffer, + FT_UInt n ) + { + FT_Byte* p; + FT_UInt r = 0; + FT_UInt w = 0; + FT_UInt pad = 0x01; + + + n *= 2; + +#if 1 + + p = *cursor; + if ( n > (FT_UInt)( limit - p ) ) + n = (FT_UInt)( limit - p ); + + /* we try to process two nibbles at a time to be as fast as possible */ + for ( ; r < n; r++ ) + { + FT_UInt c = p[r]; + + + if ( IS_PS_SPACE( c ) ) + continue; + + if ( c OP 0x80 ) + break; + + c = ft_char_table[c & 0x7F]; + if ( (unsigned)c >= 16 ) + break; + + pad = ( pad << 4 ) | c; + if ( pad & 0x100 ) + { + buffer[w++] = (FT_Byte)pad; + pad = 0x01; + } + } + + if ( pad != 0x01 ) + buffer[w++] = (FT_Byte)( pad << 4 ); + + *cursor = p + r; + + return w; + +#else /* 0 */ + + for ( r = 0; r < n; r++ ) + { + FT_Char c; + + + if ( IS_PS_SPACE( *p ) ) + continue; + + if ( *p OP 0x80 ) + break; + + c = ft_char_table[*p & 0x7f]; + + if ( (unsigned)c >= 16 ) + break; + + if ( r & 1 ) + { + *buffer = (FT_Byte)(*buffer + c); + buffer++; + } + else + *buffer = (FT_Byte)(c << 4); + + r++; + } + + *cursor = p; + + return ( r + 1 ) / 2; + +#endif /* 0 */ + + } + + + FT_LOCAL_DEF( FT_UInt ) + PS_Conv_EexecDecode( FT_Byte** cursor, + FT_Byte* limit, + FT_Byte* buffer, + FT_UInt n, + FT_UShort* seed ) + { + FT_Byte* p; + FT_UInt r; + FT_UInt s = *seed; + + +#if 1 + + p = *cursor; + if ( n > (FT_UInt)(limit - p) ) + n = (FT_UInt)(limit - p); + + for ( r = 0; r < n; r++ ) + { + FT_UInt val = p[r]; + FT_UInt b = ( val ^ ( s >> 8 ) ); + + + s = ( (val + s)*52845U + 22719 ) & 0xFFFFU; + buffer[r] = (FT_Byte) b; + } + + *cursor = p + n; + *seed = (FT_UShort)s; + +#else /* 0 */ + + for ( r = 0, p = *cursor; r < n && p < limit; r++, p++ ) + { + FT_Byte b = (FT_Byte)( *p ^ ( s >> 8 ) ); + + + s = (FT_UShort)( ( *p + s ) * 52845U + 22719 ); + *buffer++ = b; + } + *cursor = p; + *seed = s; + +#endif /* 0 */ + + return r; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psconv.h b/reactos/dll/3rdparty/freetype/src/psaux/psconv.h index e51124185d7..585591da190 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psconv.h +++ b/reactos/dll/3rdparty/freetype/src/psaux/psconv.h @@ -1,71 +1,71 @@ -/***************************************************************************/ -/* */ -/* psconv.h */ -/* */ -/* Some convenience conversions (specification). */ -/* */ -/* Copyright 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSCONV_H__ -#define __PSCONV_H__ - - -#include -#include FT_INTERNAL_POSTSCRIPT_AUX_H - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Int ) - PS_Conv_Strtol( FT_Byte** cursor, - FT_Byte* limit, - FT_Int base ); - - - FT_LOCAL( FT_Int ) - PS_Conv_ToInt( FT_Byte** cursor, - FT_Byte* limit ); - - FT_LOCAL( FT_Fixed ) - PS_Conv_ToFixed( FT_Byte** cursor, - FT_Byte* limit, - FT_Int power_ten ); - -#if 0 - FT_LOCAL( FT_UInt ) - PS_Conv_StringDecode( FT_Byte** cursor, - FT_Byte* limit, - FT_Byte* buffer, - FT_UInt n ); -#endif - - FT_LOCAL( FT_UInt ) - PS_Conv_ASCIIHexDecode( FT_Byte** cursor, - FT_Byte* limit, - FT_Byte* buffer, - FT_UInt n ); - - FT_LOCAL( FT_UInt ) - PS_Conv_EexecDecode( FT_Byte** cursor, - FT_Byte* limit, - FT_Byte* buffer, - FT_UInt n, - FT_UShort* seed ); - - -FT_END_HEADER - -#endif /* __PSCONV_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* psconv.h */ +/* */ +/* Some convenience conversions (specification). */ +/* */ +/* Copyright 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSCONV_H__ +#define __PSCONV_H__ + + +#include +#include FT_INTERNAL_POSTSCRIPT_AUX_H + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Int ) + PS_Conv_Strtol( FT_Byte** cursor, + FT_Byte* limit, + FT_Int base ); + + + FT_LOCAL( FT_Int ) + PS_Conv_ToInt( FT_Byte** cursor, + FT_Byte* limit ); + + FT_LOCAL( FT_Fixed ) + PS_Conv_ToFixed( FT_Byte** cursor, + FT_Byte* limit, + FT_Int power_ten ); + +#if 0 + FT_LOCAL( FT_UInt ) + PS_Conv_StringDecode( FT_Byte** cursor, + FT_Byte* limit, + FT_Byte* buffer, + FT_UInt n ); +#endif + + FT_LOCAL( FT_UInt ) + PS_Conv_ASCIIHexDecode( FT_Byte** cursor, + FT_Byte* limit, + FT_Byte* buffer, + FT_UInt n ); + + FT_LOCAL( FT_UInt ) + PS_Conv_EexecDecode( FT_Byte** cursor, + FT_Byte* limit, + FT_Byte* buffer, + FT_UInt n, + FT_UShort* seed ); + + +FT_END_HEADER + +#endif /* __PSCONV_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psobjs.c b/reactos/dll/3rdparty/freetype/src/psaux/psobjs.c index 957085668be..c39408e36b5 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psobjs.c +++ b/reactos/dll/3rdparty/freetype/src/psaux/psobjs.c @@ -1,1698 +1,1698 @@ -/***************************************************************************/ -/* */ -/* psobjs.c */ -/* */ -/* Auxiliary functions for PostScript fonts (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_DEBUG_H - -#include "psobjs.h" -#include "psconv.h" - -#include "psauxerr.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_psobjs - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PS_TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* */ - /* ps_table_new */ - /* */ - /* */ - /* Initializes a PS_Table. */ - /* */ - /* */ - /* table :: The address of the target table. */ - /* */ - /* */ - /* count :: The table size = the maximum number of elements. */ - /* */ - /* memory :: The memory object to use for all subsequent */ - /* reallocations. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - ps_table_new( PS_Table table, - FT_Int count, - FT_Memory memory ) - { - FT_Error error; - - - table->memory = memory; - if ( FT_NEW_ARRAY( table->elements, count ) || - FT_NEW_ARRAY( table->lengths, count ) ) - goto Exit; - - table->max_elems = count; - table->init = 0xDEADBEEFUL; - table->num_elems = 0; - table->block = 0; - table->capacity = 0; - table->cursor = 0; - - *(PS_Table_FuncsRec*)&table->funcs = ps_table_funcs; - - Exit: - if ( error ) - FT_FREE( table->elements ); - - return error; - } - - - static void - shift_elements( PS_Table table, - FT_Byte* old_base ) - { - FT_PtrDist delta = table->block - old_base; - FT_Byte** offset = table->elements; - FT_Byte** limit = offset + table->max_elems; - - - for ( ; offset < limit; offset++ ) - { - if ( offset[0] ) - offset[0] += delta; - } - } - - - static FT_Error - reallocate_t1_table( PS_Table table, - FT_Long new_size ) - { - FT_Memory memory = table->memory; - FT_Byte* old_base = table->block; - FT_Error error; - - - /* allocate new base block */ - if ( FT_ALLOC( table->block, new_size ) ) - { - table->block = old_base; - return error; - } - - /* copy elements and shift offsets */ - if ( old_base ) - { - FT_MEM_COPY( table->block, old_base, table->capacity ); - shift_elements( table, old_base ); - FT_FREE( old_base ); - } - - table->capacity = new_size; - - return PSaux_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* ps_table_add */ - /* */ - /* */ - /* Adds an object to a PS_Table, possibly growing its memory block. */ - /* */ - /* */ - /* table :: The target table. */ - /* */ - /* */ - /* idx :: The index of the object in the table. */ - /* */ - /* object :: The address of the object to copy in memory. */ - /* */ - /* length :: The length in bytes of the source object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. An error is returned if a */ - /* reallocation fails. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - ps_table_add( PS_Table table, - FT_Int idx, - void* object, - FT_PtrDist length ) - { - if ( idx < 0 || idx > table->max_elems ) - { - FT_ERROR(( "ps_table_add: invalid index\n" )); - return PSaux_Err_Invalid_Argument; - } - - /* grow the base block if needed */ - if ( table->cursor + length > table->capacity ) - { - FT_Error error; - FT_Offset new_size = table->capacity; - FT_Long in_offset; - - - in_offset = (FT_Long)((FT_Byte*)object - table->block); - if ( (FT_ULong)in_offset >= table->capacity ) - in_offset = -1; - - while ( new_size < table->cursor + length ) - { - /* increase size by 25% and round up to the nearest multiple - of 1024 */ - new_size += ( new_size >> 2 ) + 1; - new_size = FT_PAD_CEIL( new_size, 1024 ); - } - - error = reallocate_t1_table( table, new_size ); - if ( error ) - return error; - - if ( in_offset >= 0 ) - object = table->block + in_offset; - } - - /* add the object to the base block and adjust offset */ - table->elements[idx] = table->block + table->cursor; - table->lengths [idx] = length; - FT_MEM_COPY( table->block + table->cursor, object, length ); - - table->cursor += length; - return PSaux_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* ps_table_done */ - /* */ - /* */ - /* Finalizes a PS_TableRec (i.e., reallocate it to its current */ - /* cursor). */ - /* */ - /* */ - /* table :: The target table. */ - /* */ - /* */ - /* This function does NOT release the heap's memory block. It is up */ - /* to the caller to clean it, or reference it in its own structures. */ - /* */ - FT_LOCAL_DEF( void ) - ps_table_done( PS_Table table ) - { - FT_Memory memory = table->memory; - FT_Error error; - FT_Byte* old_base = table->block; - - - /* should never fail, because rec.cursor <= rec.size */ - if ( !old_base ) - return; - - if ( FT_ALLOC( table->block, table->cursor ) ) - return; - FT_MEM_COPY( table->block, old_base, table->cursor ); - shift_elements( table, old_base ); - - table->capacity = table->cursor; - FT_FREE( old_base ); - - FT_UNUSED( error ); - } - - - FT_LOCAL_DEF( void ) - ps_table_release( PS_Table table ) - { - FT_Memory memory = table->memory; - - - if ( (FT_ULong)table->init == 0xDEADBEEFUL ) - { - FT_FREE( table->block ); - FT_FREE( table->elements ); - FT_FREE( table->lengths ); - table->init = 0; - } - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** T1 PARSER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /* first character must be already part of the comment */ - - static void - skip_comment( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur = *acur; - - - while ( cur < limit ) - { - if ( IS_PS_NEWLINE( *cur ) ) - break; - cur++; - } - - *acur = cur; - } - - - static void - skip_spaces( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur = *acur; - - - while ( cur < limit ) - { - if ( !IS_PS_SPACE( *cur ) ) - { - if ( *cur == '%' ) - /* According to the PLRM, a comment is equal to a space. */ - skip_comment( &cur, limit ); - else - break; - } - cur++; - } - - *acur = cur; - } - - -#define IS_OCTAL_DIGIT( c ) ( '0' <= (c) && (c) <= '7' ) - - - /* first character must be `('; */ - /* *acur is positioned at the character after the closing `)' */ - - static FT_Error - skip_literal_string( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur = *acur; - FT_Int embed = 0; - FT_Error error = PSaux_Err_Invalid_File_Format; - unsigned int i; - - - while ( cur < limit ) - { - FT_Byte c = *cur; - - - ++cur; - - if ( c == '\\' ) - { - /* Red Book 3rd ed., section `Literal Text Strings', p. 29: */ - /* A backslash can introduce three different types */ - /* of escape sequences: */ - /* - a special escaped char like \r, \n, etc. */ - /* - a one-, two-, or three-digit octal number */ - /* - none of the above in which case the backslash is ignored */ - - if ( cur == limit ) - /* error (or to be ignored?) */ - break; - - switch ( *cur ) - { - /* skip `special' escape */ - case 'n': - case 'r': - case 't': - case 'b': - case 'f': - case '\\': - case '(': - case ')': - ++cur; - break; - - default: - /* skip octal escape or ignore backslash */ - for ( i = 0; i < 3 && cur < limit; ++i ) - { - if ( ! IS_OCTAL_DIGIT( *cur ) ) - break; - - ++cur; - } - } - } - else if ( c == '(' ) - embed++; - else if ( c == ')' ) - { - embed--; - if ( embed == 0 ) - { - error = PSaux_Err_Ok; - break; - } - } - } - - *acur = cur; - - return error; - } - - - /* first character must be `<' */ - - static FT_Error - skip_string( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur = *acur; - FT_Error err = PSaux_Err_Ok; - - - while ( ++cur < limit ) - { - /* All whitespace characters are ignored. */ - skip_spaces( &cur, limit ); - if ( cur >= limit ) - break; - - if ( !IS_PS_XDIGIT( *cur ) ) - break; - } - - if ( cur < limit && *cur != '>' ) - { - FT_ERROR(( "skip_string: missing closing delimiter `>'\n" )); - err = PSaux_Err_Invalid_File_Format; - } - else - cur++; - - *acur = cur; - return err; - } - - - /* first character must be the opening brace that */ - /* starts the procedure */ - - /* NB: [ and ] need not match: */ - /* `/foo {[} def' is a valid PostScript fragment, */ - /* even within a Type1 font */ - - static FT_Error - skip_procedure( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur; - FT_Int embed = 0; - FT_Error error = PSaux_Err_Ok; - - - FT_ASSERT( **acur == '{' ); - - for ( cur = *acur; cur < limit && error == PSaux_Err_Ok; ++cur ) - { - switch ( *cur ) - { - case '{': - ++embed; - break; - - case '}': - --embed; - if ( embed == 0 ) - { - ++cur; - goto end; - } - break; - - case '(': - error = skip_literal_string( &cur, limit ); - break; - - case '<': - error = skip_string( &cur, limit ); - break; - - case '%': - skip_comment( &cur, limit ); - break; - } - } - - end: - if ( embed != 0 ) - error = PSaux_Err_Invalid_File_Format; - - *acur = cur; - - return error; - } - - - /***********************************************************************/ - /* */ - /* All exported parsing routines handle leading whitespace and stop at */ - /* the first character which isn't part of the just handled token. */ - /* */ - /***********************************************************************/ - - - FT_LOCAL_DEF( void ) - ps_parser_skip_PS_token( PS_Parser parser ) - { - /* Note: PostScript allows any non-delimiting, non-whitespace */ - /* character in a name (PS Ref Manual, 3rd ed, p31). */ - /* PostScript delimiters are (, ), <, >, [, ], {, }, /, and %. */ - - FT_Byte* cur = parser->cursor; - FT_Byte* limit = parser->limit; - FT_Error error = PSaux_Err_Ok; - - - skip_spaces( &cur, limit ); /* this also skips comments */ - if ( cur >= limit ) - goto Exit; - - /* self-delimiting, single-character tokens */ - if ( *cur == '[' || *cur == ']' ) - { - cur++; - goto Exit; - } - - /* skip balanced expressions (procedures and strings) */ - - if ( *cur == '{' ) /* {...} */ - { - error = skip_procedure( &cur, limit ); - goto Exit; - } - - if ( *cur == '(' ) /* (...) */ - { - error = skip_literal_string( &cur, limit ); - goto Exit; - } - - if ( *cur == '<' ) /* <...> */ - { - if ( cur + 1 < limit && *(cur + 1) == '<' ) /* << */ - { - cur++; - cur++; - } - else - error = skip_string( &cur, limit ); - - goto Exit; - } - - if ( *cur == '>' ) - { - cur++; - if ( cur >= limit || *cur != '>' ) /* >> */ - { - FT_ERROR(( "ps_parser_skip_PS_token: " - "unexpected closing delimiter `>'\n" )); - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - cur++; - goto Exit; - } - - if ( *cur == '/' ) - cur++; - - /* anything else */ - while ( cur < limit ) - { - /* *cur might be invalid (e.g., ')' or '}'), but this */ - /* is handled by the test `cur == parser->cursor' below */ - if ( IS_PS_DELIM( *cur ) ) - break; - - cur++; - } - - Exit: - if ( cur == parser->cursor ) - { - FT_ERROR(( "ps_parser_skip_PS_token: " - "current token is `%c', which is self-delimiting " - "but invalid at this point\n", - *cur )); - - error = PSaux_Err_Invalid_File_Format; - } - - parser->error = error; - parser->cursor = cur; - } - - - FT_LOCAL_DEF( void ) - ps_parser_skip_spaces( PS_Parser parser ) - { - skip_spaces( &parser->cursor, parser->limit ); - } - - - /* `token' here means either something between balanced delimiters */ - /* or the next token; the delimiters are not removed. */ - - FT_LOCAL_DEF( void ) - ps_parser_to_token( PS_Parser parser, - T1_Token token ) - { - FT_Byte* cur; - FT_Byte* limit; - FT_Int embed; - - - token->type = T1_TOKEN_TYPE_NONE; - token->start = 0; - token->limit = 0; - - /* first of all, skip leading whitespace */ - ps_parser_skip_spaces( parser ); - - cur = parser->cursor; - limit = parser->limit; - - if ( cur >= limit ) - return; - - switch ( *cur ) - { - /************* check for literal string *****************/ - case '(': - token->type = T1_TOKEN_TYPE_STRING; - token->start = cur; - - if ( skip_literal_string( &cur, limit ) == PSaux_Err_Ok ) - token->limit = cur; - break; - - /************* check for programs/array *****************/ - case '{': - token->type = T1_TOKEN_TYPE_ARRAY; - token->start = cur; - - if ( skip_procedure( &cur, limit ) == PSaux_Err_Ok ) - token->limit = cur; - break; - - /************* check for table/array ********************/ - /* XXX: in theory we should also look for "<<" */ - /* since this is semantically equivalent to "["; */ - /* in practice it doesn't matter (?) */ - case '[': - token->type = T1_TOKEN_TYPE_ARRAY; - embed = 1; - token->start = cur++; - - /* we need this to catch `[ ]' */ - parser->cursor = cur; - ps_parser_skip_spaces( parser ); - cur = parser->cursor; - - while ( cur < limit && !parser->error ) - { - /* XXX: this is wrong because it does not */ - /* skip comments, procedures, and strings */ - if ( *cur == '[' ) - embed++; - else if ( *cur == ']' ) - { - embed--; - if ( embed <= 0 ) - { - token->limit = ++cur; - break; - } - } - - parser->cursor = cur; - ps_parser_skip_PS_token( parser ); - /* we need this to catch `[XXX ]' */ - ps_parser_skip_spaces ( parser ); - cur = parser->cursor; - } - break; - - /* ************ otherwise, it is any token **************/ - default: - token->start = cur; - token->type = ( *cur == '/' ? T1_TOKEN_TYPE_KEY : T1_TOKEN_TYPE_ANY ); - ps_parser_skip_PS_token( parser ); - cur = parser->cursor; - if ( !parser->error ) - token->limit = cur; - } - - if ( !token->limit ) - { - token->start = 0; - token->type = T1_TOKEN_TYPE_NONE; - } - - parser->cursor = cur; - } - - - /* NB: `tokens' can be NULL if we only want to count */ - /* the number of array elements */ - - FT_LOCAL_DEF( void ) - ps_parser_to_token_array( PS_Parser parser, - T1_Token tokens, - FT_UInt max_tokens, - FT_Int* pnum_tokens ) - { - T1_TokenRec master; - - - *pnum_tokens = -1; - - /* this also handles leading whitespace */ - ps_parser_to_token( parser, &master ); - - if ( master.type == T1_TOKEN_TYPE_ARRAY ) - { - FT_Byte* old_cursor = parser->cursor; - FT_Byte* old_limit = parser->limit; - T1_Token cur = tokens; - T1_Token limit = cur + max_tokens; - - - /* don't include outermost delimiters */ - parser->cursor = master.start + 1; - parser->limit = master.limit - 1; - - while ( parser->cursor < parser->limit ) - { - T1_TokenRec token; - - - ps_parser_to_token( parser, &token ); - if ( !token.type ) - break; - - if ( tokens != NULL && cur < limit ) - *cur = token; - - cur++; - } - - *pnum_tokens = (FT_Int)( cur - tokens ); - - parser->cursor = old_cursor; - parser->limit = old_limit; - } - } - - - /* first character must be a delimiter or a part of a number */ - /* NB: `coords' can be NULL if we just want to skip the */ - /* array; in this case we ignore `max_coords' */ - - static FT_Int - ps_tocoordarray( FT_Byte* *acur, - FT_Byte* limit, - FT_Int max_coords, - FT_Short* coords ) - { - FT_Byte* cur = *acur; - FT_Int count = 0; - FT_Byte c, ender; - - - if ( cur >= limit ) - goto Exit; - - /* check for the beginning of an array; otherwise, only one number */ - /* will be read */ - c = *cur; - ender = 0; - - if ( c == '[' ) - ender = ']'; - else if ( c == '{' ) - ender = '}'; - - if ( ender ) - cur++; - - /* now, read the coordinates */ - while ( cur < limit ) - { - FT_Short dummy; - FT_Byte* old_cur; - - - /* skip whitespace in front of data */ - skip_spaces( &cur, limit ); - if ( cur >= limit ) - goto Exit; - - if ( *cur == ender ) - { - cur++; - break; - } - - old_cur = cur; - - if ( coords != NULL && count >= max_coords ) - break; - - /* call PS_Conv_ToFixed() even if coords == NULL */ - /* to properly parse number at `cur' */ - *( coords != NULL ? &coords[count] : &dummy ) = - (FT_Short)( PS_Conv_ToFixed( &cur, limit, 0 ) >> 16 ); - - if ( old_cur == cur ) - { - count = -1; - goto Exit; - } - else - count++; - - if ( !ender ) - break; - } - - Exit: - *acur = cur; - return count; - } - - - /* first character must be a delimiter or a part of a number */ - /* NB: `values' can be NULL if we just want to skip the */ - /* array; in this case we ignore `max_values' */ - - static FT_Int - ps_tofixedarray( FT_Byte* *acur, - FT_Byte* limit, - FT_Int max_values, - FT_Fixed* values, - FT_Int power_ten ) - { - FT_Byte* cur = *acur; - FT_Int count = 0; - FT_Byte c, ender; - - - if ( cur >= limit ) - goto Exit; - - /* Check for the beginning of an array. Otherwise, only one number */ - /* will be read. */ - c = *cur; - ender = 0; - - if ( c == '[' ) - ender = ']'; - else if ( c == '{' ) - ender = '}'; - - if ( ender ) - cur++; - - /* now, read the values */ - while ( cur < limit ) - { - FT_Fixed dummy; - FT_Byte* old_cur; - - - /* skip whitespace in front of data */ - skip_spaces( &cur, limit ); - if ( cur >= limit ) - goto Exit; - - if ( *cur == ender ) - { - cur++; - break; - } - - old_cur = cur; - - if ( values != NULL && count >= max_values ) - break; - - /* call PS_Conv_ToFixed() even if coords == NULL */ - /* to properly parse number at `cur' */ - *( values != NULL ? &values[count] : &dummy ) = - PS_Conv_ToFixed( &cur, limit, power_ten ); - - if ( old_cur == cur ) - { - count = -1; - goto Exit; - } - else - count++; - - if ( !ender ) - break; - } - - Exit: - *acur = cur; - return count; - } - - -#if 0 - - static FT_String* - ps_tostring( FT_Byte** cursor, - FT_Byte* limit, - FT_Memory memory ) - { - FT_Byte* cur = *cursor; - FT_PtrDist len = 0; - FT_Int count; - FT_String* result; - FT_Error error; - - - /* XXX: some stupid fonts have a `Notice' or `Copyright' string */ - /* that simply doesn't begin with an opening parenthesis, even */ - /* though they have a closing one! E.g. "amuncial.pfb" */ - /* */ - /* We must deal with these ill-fated cases there. Note that */ - /* these fonts didn't work with the old Type 1 driver as the */ - /* notice/copyright was not recognized as a valid string token */ - /* and made the old token parser commit errors. */ - - while ( cur < limit && ( *cur == ' ' || *cur == '\t' ) ) - cur++; - if ( cur + 1 >= limit ) - return 0; - - if ( *cur == '(' ) - cur++; /* skip the opening parenthesis, if there is one */ - - *cursor = cur; - count = 0; - - /* then, count its length */ - for ( ; cur < limit; cur++ ) - { - if ( *cur == '(' ) - count++; - - else if ( *cur == ')' ) - { - count--; - if ( count < 0 ) - break; - } - } - - len = cur - *cursor; - if ( cur >= limit || FT_ALLOC( result, len + 1 ) ) - return 0; - - /* now copy the string */ - FT_MEM_COPY( result, *cursor, len ); - result[len] = '\0'; - *cursor = cur; - return result; - } - -#endif /* 0 */ - - - static int - ps_tobool( FT_Byte* *acur, - FT_Byte* limit ) - { - FT_Byte* cur = *acur; - FT_Bool result = 0; - - - /* return 1 if we find `true', 0 otherwise */ - if ( cur + 3 < limit && - cur[0] == 't' && - cur[1] == 'r' && - cur[2] == 'u' && - cur[3] == 'e' ) - { - result = 1; - cur += 5; - } - else if ( cur + 4 < limit && - cur[0] == 'f' && - cur[1] == 'a' && - cur[2] == 'l' && - cur[3] == 's' && - cur[4] == 'e' ) - { - result = 0; - cur += 6; - } - - *acur = cur; - return result; - } - - - /* load a simple field (i.e. non-table) into the current list of objects */ - - FT_LOCAL_DEF( FT_Error ) - ps_parser_load_field( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ) - { - T1_TokenRec token; - FT_Byte* cur; - FT_Byte* limit; - FT_UInt count; - FT_UInt idx; - FT_Error error; - - - /* this also skips leading whitespace */ - ps_parser_to_token( parser, &token ); - if ( !token.type ) - goto Fail; - - count = 1; - idx = 0; - cur = token.start; - limit = token.limit; - - /* we must detect arrays in /FontBBox */ - if ( field->type == T1_FIELD_TYPE_BBOX ) - { - T1_TokenRec token2; - FT_Byte* old_cur = parser->cursor; - FT_Byte* old_limit = parser->limit; - - - /* don't include delimiters */ - parser->cursor = token.start + 1; - parser->limit = token.limit - 1; - - ps_parser_to_token( parser, &token2 ); - parser->cursor = old_cur; - parser->limit = old_limit; - - if ( token2.type == T1_TOKEN_TYPE_ARRAY ) - goto FieldArray; - } - else if ( token.type == T1_TOKEN_TYPE_ARRAY ) - { - FieldArray: - /* if this is an array and we have no blend, an error occurs */ - if ( max_objects == 0 ) - goto Fail; - - count = max_objects; - idx = 1; - - /* don't include delimiters */ - cur++; - limit--; - } - - for ( ; count > 0; count--, idx++ ) - { - FT_Byte* q = (FT_Byte*)objects[idx] + field->offset; - FT_Long val; - FT_String* string; - - - skip_spaces( &cur, limit ); - - switch ( field->type ) - { - case T1_FIELD_TYPE_BOOL: - val = ps_tobool( &cur, limit ); - goto Store_Integer; - - case T1_FIELD_TYPE_FIXED: - val = PS_Conv_ToFixed( &cur, limit, 0 ); - goto Store_Integer; - - case T1_FIELD_TYPE_FIXED_1000: - val = PS_Conv_ToFixed( &cur, limit, 3 ); - goto Store_Integer; - - case T1_FIELD_TYPE_INTEGER: - val = PS_Conv_ToInt( &cur, limit ); - /* fall through */ - - Store_Integer: - switch ( field->size ) - { - case (8 / FT_CHAR_BIT): - *(FT_Byte*)q = (FT_Byte)val; - break; - - case (16 / FT_CHAR_BIT): - *(FT_UShort*)q = (FT_UShort)val; - break; - - case (32 / FT_CHAR_BIT): - *(FT_UInt32*)q = (FT_UInt32)val; - break; - - default: /* for 64-bit systems */ - *(FT_Long*)q = val; - } - break; - - case T1_FIELD_TYPE_STRING: - case T1_FIELD_TYPE_KEY: - { - FT_Memory memory = parser->memory; - FT_UInt len = (FT_UInt)( limit - cur ); - - - if ( cur >= limit ) - break; - - /* we allow both a string or a name */ - /* for cases like /FontName (foo) def */ - if ( token.type == T1_TOKEN_TYPE_KEY ) - { - /* don't include leading `/' */ - len--; - cur++; - } - else if ( token.type == T1_TOKEN_TYPE_STRING ) - { - /* don't include delimiting parentheses */ - /* XXX we don't handle <<...>> here */ - /* XXX should we convert octal escapes? */ - /* if so, what encoding should we use? */ - cur++; - len -= 2; - } - else - { - FT_ERROR(( "ps_parser_load_field: expected a name or string " - "but found token of type %d instead\n", - token.type )); - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - /* for this to work (FT_String**)q must have been */ - /* initialized to NULL */ - if ( *(FT_String**)q != NULL ) - { - FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n", - field->ident )); - FT_FREE( *(FT_String**)q ); - *(FT_String**)q = NULL; - } - - if ( FT_ALLOC( string, len + 1 ) ) - goto Exit; - - FT_MEM_COPY( string, cur, len ); - string[len] = 0; - - *(FT_String**)q = string; - } - break; - - case T1_FIELD_TYPE_BBOX: - { - FT_Fixed temp[4]; - FT_BBox* bbox = (FT_BBox*)q; - FT_Int result; - - - result = ps_tofixedarray( &cur, limit, 4, temp, 0 ); - - if ( result < 0 ) - { - FT_ERROR(( "ps_parser_load_field: " - "expected four integers in bounding box\n" )); - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - bbox->xMin = FT_RoundFix( temp[0] ); - bbox->yMin = FT_RoundFix( temp[1] ); - bbox->xMax = FT_RoundFix( temp[2] ); - bbox->yMax = FT_RoundFix( temp[3] ); - } - break; - - default: - /* an error occurred */ - goto Fail; - } - } - -#if 0 /* obsolete -- keep for reference */ - if ( pflags ) - *pflags |= 1L << field->flag_bit; -#else - FT_UNUSED( pflags ); -#endif - - error = PSaux_Err_Ok; - - Exit: - return error; - - Fail: - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - -#define T1_MAX_TABLE_ELEMENTS 32 - - - FT_LOCAL_DEF( FT_Error ) - ps_parser_load_field_table( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ) - { - T1_TokenRec elements[T1_MAX_TABLE_ELEMENTS]; - T1_Token token; - FT_Int num_elements; - FT_Error error = PSaux_Err_Ok; - FT_Byte* old_cursor; - FT_Byte* old_limit; - T1_FieldRec fieldrec = *(T1_Field)field; - - - fieldrec.type = T1_FIELD_TYPE_INTEGER; - if ( field->type == T1_FIELD_TYPE_FIXED_ARRAY || - field->type == T1_FIELD_TYPE_BBOX ) - fieldrec.type = T1_FIELD_TYPE_FIXED; - - ps_parser_to_token_array( parser, elements, - T1_MAX_TABLE_ELEMENTS, &num_elements ); - if ( num_elements < 0 ) - { - error = PSaux_Err_Ignore; - goto Exit; - } - if ( (FT_UInt)num_elements > field->array_max ) - num_elements = field->array_max; - - old_cursor = parser->cursor; - old_limit = parser->limit; - - /* we store the elements count if necessary */ - if ( field->type != T1_FIELD_TYPE_BBOX ) - *(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) = - (FT_Byte)num_elements; - - /* we now load each element, adjusting the field.offset on each one */ - token = elements; - for ( ; num_elements > 0; num_elements--, token++ ) - { - parser->cursor = token->start; - parser->limit = token->limit; - ps_parser_load_field( parser, &fieldrec, objects, max_objects, 0 ); - fieldrec.offset += fieldrec.size; - } - -#if 0 /* obsolete -- keep for reference */ - if ( pflags ) - *pflags |= 1L << field->flag_bit; -#else - FT_UNUSED( pflags ); -#endif - - parser->cursor = old_cursor; - parser->limit = old_limit; - - Exit: - return error; - } - - - FT_LOCAL_DEF( FT_Long ) - ps_parser_to_int( PS_Parser parser ) - { - ps_parser_skip_spaces( parser ); - return PS_Conv_ToInt( &parser->cursor, parser->limit ); - } - - - /* first character must be `<' if `delimiters' is non-zero */ - - FT_LOCAL_DEF( FT_Error ) - ps_parser_to_bytes( PS_Parser parser, - FT_Byte* bytes, - FT_Long max_bytes, - FT_Long* pnum_bytes, - FT_Bool delimiters ) - { - FT_Error error = PSaux_Err_Ok; - FT_Byte* cur; - - - ps_parser_skip_spaces( parser ); - cur = parser->cursor; - - if ( cur >= parser->limit ) - goto Exit; - - if ( delimiters ) - { - if ( *cur != '<' ) - { - FT_ERROR(( "ps_parser_to_bytes: Missing starting delimiter `<'\n" )); - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - cur++; - } - - *pnum_bytes = PS_Conv_ASCIIHexDecode( &cur, - parser->limit, - bytes, - max_bytes ); - - if ( delimiters ) - { - if ( cur < parser->limit && *cur != '>' ) - { - FT_ERROR(( "ps_parser_to_bytes: Missing closing delimiter `>'\n" )); - error = PSaux_Err_Invalid_File_Format; - goto Exit; - } - - cur++; - } - - parser->cursor = cur; - - Exit: - return error; - } - - - FT_LOCAL_DEF( FT_Fixed ) - ps_parser_to_fixed( PS_Parser parser, - FT_Int power_ten ) - { - ps_parser_skip_spaces( parser ); - return PS_Conv_ToFixed( &parser->cursor, parser->limit, power_ten ); - } - - - FT_LOCAL_DEF( FT_Int ) - ps_parser_to_coord_array( PS_Parser parser, - FT_Int max_coords, - FT_Short* coords ) - { - ps_parser_skip_spaces( parser ); - return ps_tocoordarray( &parser->cursor, parser->limit, - max_coords, coords ); - } - - - FT_LOCAL_DEF( FT_Int ) - ps_parser_to_fixed_array( PS_Parser parser, - FT_Int max_values, - FT_Fixed* values, - FT_Int power_ten ) - { - ps_parser_skip_spaces( parser ); - return ps_tofixedarray( &parser->cursor, parser->limit, - max_values, values, power_ten ); - } - - -#if 0 - - FT_LOCAL_DEF( FT_String* ) - T1_ToString( PS_Parser parser ) - { - return ps_tostring( &parser->cursor, parser->limit, parser->memory ); - } - - - FT_LOCAL_DEF( FT_Bool ) - T1_ToBool( PS_Parser parser ) - { - return ps_tobool( &parser->cursor, parser->limit ); - } - -#endif /* 0 */ - - - FT_LOCAL_DEF( void ) - ps_parser_init( PS_Parser parser, - FT_Byte* base, - FT_Byte* limit, - FT_Memory memory ) - { - parser->error = PSaux_Err_Ok; - parser->base = base; - parser->limit = limit; - parser->cursor = base; - parser->memory = memory; - parser->funcs = ps_parser_funcs; - } - - - FT_LOCAL_DEF( void ) - ps_parser_done( PS_Parser parser ) - { - FT_UNUSED( parser ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** T1 BUILDER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* */ - /* t1_builder_init */ - /* */ - /* */ - /* Initializes a given glyph builder. */ - /* */ - /* */ - /* builder :: A pointer to the glyph builder to initialize. */ - /* */ - /* */ - /* face :: The current face object. */ - /* */ - /* size :: The current size object. */ - /* */ - /* glyph :: The current glyph object. */ - /* */ - /* hinting :: Whether hinting should be applied. */ - /* */ - FT_LOCAL_DEF( void ) - t1_builder_init( T1_Builder builder, - FT_Face face, - FT_Size size, - FT_GlyphSlot glyph, - FT_Bool hinting ) - { - builder->parse_state = T1_Parse_Start; - builder->load_points = 1; - - builder->face = face; - builder->glyph = glyph; - builder->memory = face->memory; - - if ( glyph ) - { - FT_GlyphLoader loader = glyph->internal->loader; - - - builder->loader = loader; - builder->base = &loader->base.outline; - builder->current = &loader->current.outline; - FT_GlyphLoader_Rewind( loader ); - - builder->hints_globals = size->internal; - builder->hints_funcs = 0; - - if ( hinting ) - builder->hints_funcs = glyph->internal->glyph_hints; - } - - if ( size ) - { - builder->scale_x = size->metrics.x_scale; - builder->scale_y = size->metrics.y_scale; - } - - builder->pos_x = 0; - builder->pos_y = 0; - - builder->left_bearing.x = 0; - builder->left_bearing.y = 0; - builder->advance.x = 0; - builder->advance.y = 0; - - builder->funcs = t1_builder_funcs; - } - - - /*************************************************************************/ - /* */ - /* */ - /* t1_builder_done */ - /* */ - /* */ - /* Finalizes a given glyph builder. Its contents can still be used */ - /* after the call, but the function saves important information */ - /* within the corresponding glyph slot. */ - /* */ - /* */ - /* builder :: A pointer to the glyph builder to finalize. */ - /* */ - FT_LOCAL_DEF( void ) - t1_builder_done( T1_Builder builder ) - { - FT_GlyphSlot glyph = builder->glyph; - - - if ( glyph ) - glyph->outline = *builder->base; - } - - - /* check that there is enough space for `count' more points */ - FT_LOCAL_DEF( FT_Error ) - t1_builder_check_points( T1_Builder builder, - FT_Int count ) - { - return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 ); - } - - - /* add a new point, do not check space */ - FT_LOCAL_DEF( void ) - t1_builder_add_point( T1_Builder builder, - FT_Pos x, - FT_Pos y, - FT_Byte flag ) - { - FT_Outline* outline = builder->current; - - - if ( builder->load_points ) - { - FT_Vector* point = outline->points + outline->n_points; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; - - - if ( builder->shift ) - { - x >>= 16; - y >>= 16; - } - point->x = x; - point->y = y; - *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC ); - - builder->last = *point; - } - outline->n_points++; - } - - - /* check space for a new on-curve point, then add it */ - FT_LOCAL_DEF( FT_Error ) - t1_builder_add_point1( T1_Builder builder, - FT_Pos x, - FT_Pos y ) - { - FT_Error error; - - - error = t1_builder_check_points( builder, 1 ); - if ( !error ) - t1_builder_add_point( builder, x, y, 1 ); - - return error; - } - - - /* check space for a new contour, then add it */ - FT_LOCAL_DEF( FT_Error ) - t1_builder_add_contour( T1_Builder builder ) - { - FT_Outline* outline = builder->current; - FT_Error error; - - - if ( !builder->load_points ) - { - outline->n_contours++; - return PSaux_Err_Ok; - } - - error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 ); - if ( !error ) - { - if ( outline->n_contours > 0 ) - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); - - outline->n_contours++; - } - - return error; - } - - - /* if a path was begun, add its first on-curve point */ - FT_LOCAL_DEF( FT_Error ) - t1_builder_start_point( T1_Builder builder, - FT_Pos x, - FT_Pos y ) - { - FT_Error error = PSaux_Err_Invalid_File_Format; - - - /* test whether we are building a new contour */ - - if ( builder->parse_state == T1_Parse_Have_Path ) - error = PSaux_Err_Ok; - else if ( builder->parse_state == T1_Parse_Have_Moveto ) - { - builder->parse_state = T1_Parse_Have_Path; - error = t1_builder_add_contour( builder ); - if ( !error ) - error = t1_builder_add_point1( builder, x, y ); - } - - return error; - } - - - /* close the current contour */ - FT_LOCAL_DEF( void ) - t1_builder_close_contour( T1_Builder builder ) - { - FT_Outline* outline = builder->current; - - - if ( !outline ) - return; - - /* XXXX: We must not include the last point in the path if it */ - /* is located on the first point. */ - if ( outline->n_points > 1 ) - { - FT_Int first = 0; - FT_Vector* p1 = outline->points + first; - FT_Vector* p2 = outline->points + outline->n_points - 1; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1; - - - if ( outline->n_contours > 1 ) - { - first = outline->contours[outline->n_contours - 2] + 1; - p1 = outline->points + first; - } - - /* `delete' last point only if it coincides with the first */ - /* point and it is not a control point (which can happen). */ - if ( p1->x == p2->x && p1->y == p2->y ) - if ( *control == FT_CURVE_TAG_ON ) - outline->n_points--; - } - - if ( outline->n_contours > 0 ) - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** OTHER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - t1_decrypt( FT_Byte* buffer, - FT_Offset length, - FT_UShort seed ) - { - PS_Conv_EexecDecode( &buffer, - buffer + length, - buffer, - length, - &seed ); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* psobjs.c */ +/* */ +/* Auxiliary functions for PostScript fonts (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_INTERNAL_DEBUG_H + +#include "psobjs.h" +#include "psconv.h" + +#include "psauxerr.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_psobjs + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PS_TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* */ + /* ps_table_new */ + /* */ + /* */ + /* Initializes a PS_Table. */ + /* */ + /* */ + /* table :: The address of the target table. */ + /* */ + /* */ + /* count :: The table size = the maximum number of elements. */ + /* */ + /* memory :: The memory object to use for all subsequent */ + /* reallocations. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + ps_table_new( PS_Table table, + FT_Int count, + FT_Memory memory ) + { + FT_Error error; + + + table->memory = memory; + if ( FT_NEW_ARRAY( table->elements, count ) || + FT_NEW_ARRAY( table->lengths, count ) ) + goto Exit; + + table->max_elems = count; + table->init = 0xDEADBEEFUL; + table->num_elems = 0; + table->block = 0; + table->capacity = 0; + table->cursor = 0; + + *(PS_Table_FuncsRec*)&table->funcs = ps_table_funcs; + + Exit: + if ( error ) + FT_FREE( table->elements ); + + return error; + } + + + static void + shift_elements( PS_Table table, + FT_Byte* old_base ) + { + FT_PtrDist delta = table->block - old_base; + FT_Byte** offset = table->elements; + FT_Byte** limit = offset + table->max_elems; + + + for ( ; offset < limit; offset++ ) + { + if ( offset[0] ) + offset[0] += delta; + } + } + + + static FT_Error + reallocate_t1_table( PS_Table table, + FT_Long new_size ) + { + FT_Memory memory = table->memory; + FT_Byte* old_base = table->block; + FT_Error error; + + + /* allocate new base block */ + if ( FT_ALLOC( table->block, new_size ) ) + { + table->block = old_base; + return error; + } + + /* copy elements and shift offsets */ + if ( old_base ) + { + FT_MEM_COPY( table->block, old_base, table->capacity ); + shift_elements( table, old_base ); + FT_FREE( old_base ); + } + + table->capacity = new_size; + + return PSaux_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* ps_table_add */ + /* */ + /* */ + /* Adds an object to a PS_Table, possibly growing its memory block. */ + /* */ + /* */ + /* table :: The target table. */ + /* */ + /* */ + /* idx :: The index of the object in the table. */ + /* */ + /* object :: The address of the object to copy in memory. */ + /* */ + /* length :: The length in bytes of the source object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. An error is returned if a */ + /* reallocation fails. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + ps_table_add( PS_Table table, + FT_Int idx, + void* object, + FT_PtrDist length ) + { + if ( idx < 0 || idx > table->max_elems ) + { + FT_ERROR(( "ps_table_add: invalid index\n" )); + return PSaux_Err_Invalid_Argument; + } + + /* grow the base block if needed */ + if ( table->cursor + length > table->capacity ) + { + FT_Error error; + FT_Offset new_size = table->capacity; + FT_Long in_offset; + + + in_offset = (FT_Long)((FT_Byte*)object - table->block); + if ( (FT_ULong)in_offset >= table->capacity ) + in_offset = -1; + + while ( new_size < table->cursor + length ) + { + /* increase size by 25% and round up to the nearest multiple + of 1024 */ + new_size += ( new_size >> 2 ) + 1; + new_size = FT_PAD_CEIL( new_size, 1024 ); + } + + error = reallocate_t1_table( table, new_size ); + if ( error ) + return error; + + if ( in_offset >= 0 ) + object = table->block + in_offset; + } + + /* add the object to the base block and adjust offset */ + table->elements[idx] = table->block + table->cursor; + table->lengths [idx] = length; + FT_MEM_COPY( table->block + table->cursor, object, length ); + + table->cursor += length; + return PSaux_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* ps_table_done */ + /* */ + /* */ + /* Finalizes a PS_TableRec (i.e., reallocate it to its current */ + /* cursor). */ + /* */ + /* */ + /* table :: The target table. */ + /* */ + /* */ + /* This function does NOT release the heap's memory block. It is up */ + /* to the caller to clean it, or reference it in its own structures. */ + /* */ + FT_LOCAL_DEF( void ) + ps_table_done( PS_Table table ) + { + FT_Memory memory = table->memory; + FT_Error error; + FT_Byte* old_base = table->block; + + + /* should never fail, because rec.cursor <= rec.size */ + if ( !old_base ) + return; + + if ( FT_ALLOC( table->block, table->cursor ) ) + return; + FT_MEM_COPY( table->block, old_base, table->cursor ); + shift_elements( table, old_base ); + + table->capacity = table->cursor; + FT_FREE( old_base ); + + FT_UNUSED( error ); + } + + + FT_LOCAL_DEF( void ) + ps_table_release( PS_Table table ) + { + FT_Memory memory = table->memory; + + + if ( (FT_ULong)table->init == 0xDEADBEEFUL ) + { + FT_FREE( table->block ); + FT_FREE( table->elements ); + FT_FREE( table->lengths ); + table->init = 0; + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** T1 PARSER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /* first character must be already part of the comment */ + + static void + skip_comment( FT_Byte* *acur, + FT_Byte* limit ) + { + FT_Byte* cur = *acur; + + + while ( cur < limit ) + { + if ( IS_PS_NEWLINE( *cur ) ) + break; + cur++; + } + + *acur = cur; + } + + + static void + skip_spaces( FT_Byte* *acur, + FT_Byte* limit ) + { + FT_Byte* cur = *acur; + + + while ( cur < limit ) + { + if ( !IS_PS_SPACE( *cur ) ) + { + if ( *cur == '%' ) + /* According to the PLRM, a comment is equal to a space. */ + skip_comment( &cur, limit ); + else + break; + } + cur++; + } + + *acur = cur; + } + + +#define IS_OCTAL_DIGIT( c ) ( '0' <= (c) && (c) <= '7' ) + + + /* first character must be `('; */ + /* *acur is positioned at the character after the closing `)' */ + + static FT_Error + skip_literal_string( FT_Byte* *acur, + FT_Byte* limit ) + { + FT_Byte* cur = *acur; + FT_Int embed = 0; + FT_Error error = PSaux_Err_Invalid_File_Format; + unsigned int i; + + + while ( cur < limit ) + { + FT_Byte c = *cur; + + + ++cur; + + if ( c == '\\' ) + { + /* Red Book 3rd ed., section `Literal Text Strings', p. 29: */ + /* A backslash can introduce three different types */ + /* of escape sequences: */ + /* - a special escaped char like \r, \n, etc. */ + /* - a one-, two-, or three-digit octal number */ + /* - none of the above in which case the backslash is ignored */ + + if ( cur == limit ) + /* error (or to be ignored?) */ + break; + + switch ( *cur ) + { + /* skip `special' escape */ + case 'n': + case 'r': + case 't': + case 'b': + case 'f': + case '\\': + case '(': + case ')': + ++cur; + break; + + default: + /* skip octal escape or ignore backslash */ + for ( i = 0; i < 3 && cur < limit; ++i ) + { + if ( ! IS_OCTAL_DIGIT( *cur ) ) + break; + + ++cur; + } + } + } + else if ( c == '(' ) + embed++; + else if ( c == ')' ) + { + embed--; + if ( embed == 0 ) + { + error = PSaux_Err_Ok; + break; + } + } + } + + *acur = cur; + + return error; + } + + + /* first character must be `<' */ + + static FT_Error + skip_string( FT_Byte* *acur, + FT_Byte* limit ) + { + FT_Byte* cur = *acur; + FT_Error err = PSaux_Err_Ok; + + + while ( ++cur < limit ) + { + /* All whitespace characters are ignored. */ + skip_spaces( &cur, limit ); + if ( cur >= limit ) + break; + + if ( !IS_PS_XDIGIT( *cur ) ) + break; + } + + if ( cur < limit && *cur != '>' ) + { + FT_ERROR(( "skip_string: missing closing delimiter `>'\n" )); + err = PSaux_Err_Invalid_File_Format; + } + else + cur++; + + *acur = cur; + return err; + } + + + /* first character must be the opening brace that */ + /* starts the procedure */ + + /* NB: [ and ] need not match: */ + /* `/foo {[} def' is a valid PostScript fragment, */ + /* even within a Type1 font */ + + static FT_Error + skip_procedure( FT_Byte* *acur, + FT_Byte* limit ) + { + FT_Byte* cur; + FT_Int embed = 0; + FT_Error error = PSaux_Err_Ok; + + + FT_ASSERT( **acur == '{' ); + + for ( cur = *acur; cur < limit && error == PSaux_Err_Ok; ++cur ) + { + switch ( *cur ) + { + case '{': + ++embed; + break; + + case '}': + --embed; + if ( embed == 0 ) + { + ++cur; + goto end; + } + break; + + case '(': + error = skip_literal_string( &cur, limit ); + break; + + case '<': + error = skip_string( &cur, limit ); + break; + + case '%': + skip_comment( &cur, limit ); + break; + } + } + + end: + if ( embed != 0 ) + error = PSaux_Err_Invalid_File_Format; + + *acur = cur; + + return error; + } + + + /***********************************************************************/ + /* */ + /* All exported parsing routines handle leading whitespace and stop at */ + /* the first character which isn't part of the just handled token. */ + /* */ + /***********************************************************************/ + + + FT_LOCAL_DEF( void ) + ps_parser_skip_PS_token( PS_Parser parser ) + { + /* Note: PostScript allows any non-delimiting, non-whitespace */ + /* character in a name (PS Ref Manual, 3rd ed, p31). */ + /* PostScript delimiters are (, ), <, >, [, ], {, }, /, and %. */ + + FT_Byte* cur = parser->cursor; + FT_Byte* limit = parser->limit; + FT_Error error = PSaux_Err_Ok; + + + skip_spaces( &cur, limit ); /* this also skips comments */ + if ( cur >= limit ) + goto Exit; + + /* self-delimiting, single-character tokens */ + if ( *cur == '[' || *cur == ']' ) + { + cur++; + goto Exit; + } + + /* skip balanced expressions (procedures and strings) */ + + if ( *cur == '{' ) /* {...} */ + { + error = skip_procedure( &cur, limit ); + goto Exit; + } + + if ( *cur == '(' ) /* (...) */ + { + error = skip_literal_string( &cur, limit ); + goto Exit; + } + + if ( *cur == '<' ) /* <...> */ + { + if ( cur + 1 < limit && *(cur + 1) == '<' ) /* << */ + { + cur++; + cur++; + } + else + error = skip_string( &cur, limit ); + + goto Exit; + } + + if ( *cur == '>' ) + { + cur++; + if ( cur >= limit || *cur != '>' ) /* >> */ + { + FT_ERROR(( "ps_parser_skip_PS_token: " + "unexpected closing delimiter `>'\n" )); + error = PSaux_Err_Invalid_File_Format; + goto Exit; + } + cur++; + goto Exit; + } + + if ( *cur == '/' ) + cur++; + + /* anything else */ + while ( cur < limit ) + { + /* *cur might be invalid (e.g., ')' or '}'), but this */ + /* is handled by the test `cur == parser->cursor' below */ + if ( IS_PS_DELIM( *cur ) ) + break; + + cur++; + } + + Exit: + if ( cur == parser->cursor ) + { + FT_ERROR(( "ps_parser_skip_PS_token: " + "current token is `%c', which is self-delimiting " + "but invalid at this point\n", + *cur )); + + error = PSaux_Err_Invalid_File_Format; + } + + parser->error = error; + parser->cursor = cur; + } + + + FT_LOCAL_DEF( void ) + ps_parser_skip_spaces( PS_Parser parser ) + { + skip_spaces( &parser->cursor, parser->limit ); + } + + + /* `token' here means either something between balanced delimiters */ + /* or the next token; the delimiters are not removed. */ + + FT_LOCAL_DEF( void ) + ps_parser_to_token( PS_Parser parser, + T1_Token token ) + { + FT_Byte* cur; + FT_Byte* limit; + FT_Int embed; + + + token->type = T1_TOKEN_TYPE_NONE; + token->start = 0; + token->limit = 0; + + /* first of all, skip leading whitespace */ + ps_parser_skip_spaces( parser ); + + cur = parser->cursor; + limit = parser->limit; + + if ( cur >= limit ) + return; + + switch ( *cur ) + { + /************* check for literal string *****************/ + case '(': + token->type = T1_TOKEN_TYPE_STRING; + token->start = cur; + + if ( skip_literal_string( &cur, limit ) == PSaux_Err_Ok ) + token->limit = cur; + break; + + /************* check for programs/array *****************/ + case '{': + token->type = T1_TOKEN_TYPE_ARRAY; + token->start = cur; + + if ( skip_procedure( &cur, limit ) == PSaux_Err_Ok ) + token->limit = cur; + break; + + /************* check for table/array ********************/ + /* XXX: in theory we should also look for "<<" */ + /* since this is semantically equivalent to "["; */ + /* in practice it doesn't matter (?) */ + case '[': + token->type = T1_TOKEN_TYPE_ARRAY; + embed = 1; + token->start = cur++; + + /* we need this to catch `[ ]' */ + parser->cursor = cur; + ps_parser_skip_spaces( parser ); + cur = parser->cursor; + + while ( cur < limit && !parser->error ) + { + /* XXX: this is wrong because it does not */ + /* skip comments, procedures, and strings */ + if ( *cur == '[' ) + embed++; + else if ( *cur == ']' ) + { + embed--; + if ( embed <= 0 ) + { + token->limit = ++cur; + break; + } + } + + parser->cursor = cur; + ps_parser_skip_PS_token( parser ); + /* we need this to catch `[XXX ]' */ + ps_parser_skip_spaces ( parser ); + cur = parser->cursor; + } + break; + + /* ************ otherwise, it is any token **************/ + default: + token->start = cur; + token->type = ( *cur == '/' ? T1_TOKEN_TYPE_KEY : T1_TOKEN_TYPE_ANY ); + ps_parser_skip_PS_token( parser ); + cur = parser->cursor; + if ( !parser->error ) + token->limit = cur; + } + + if ( !token->limit ) + { + token->start = 0; + token->type = T1_TOKEN_TYPE_NONE; + } + + parser->cursor = cur; + } + + + /* NB: `tokens' can be NULL if we only want to count */ + /* the number of array elements */ + + FT_LOCAL_DEF( void ) + ps_parser_to_token_array( PS_Parser parser, + T1_Token tokens, + FT_UInt max_tokens, + FT_Int* pnum_tokens ) + { + T1_TokenRec master; + + + *pnum_tokens = -1; + + /* this also handles leading whitespace */ + ps_parser_to_token( parser, &master ); + + if ( master.type == T1_TOKEN_TYPE_ARRAY ) + { + FT_Byte* old_cursor = parser->cursor; + FT_Byte* old_limit = parser->limit; + T1_Token cur = tokens; + T1_Token limit = cur + max_tokens; + + + /* don't include outermost delimiters */ + parser->cursor = master.start + 1; + parser->limit = master.limit - 1; + + while ( parser->cursor < parser->limit ) + { + T1_TokenRec token; + + + ps_parser_to_token( parser, &token ); + if ( !token.type ) + break; + + if ( tokens != NULL && cur < limit ) + *cur = token; + + cur++; + } + + *pnum_tokens = (FT_Int)( cur - tokens ); + + parser->cursor = old_cursor; + parser->limit = old_limit; + } + } + + + /* first character must be a delimiter or a part of a number */ + /* NB: `coords' can be NULL if we just want to skip the */ + /* array; in this case we ignore `max_coords' */ + + static FT_Int + ps_tocoordarray( FT_Byte* *acur, + FT_Byte* limit, + FT_Int max_coords, + FT_Short* coords ) + { + FT_Byte* cur = *acur; + FT_Int count = 0; + FT_Byte c, ender; + + + if ( cur >= limit ) + goto Exit; + + /* check for the beginning of an array; otherwise, only one number */ + /* will be read */ + c = *cur; + ender = 0; + + if ( c == '[' ) + ender = ']'; + else if ( c == '{' ) + ender = '}'; + + if ( ender ) + cur++; + + /* now, read the coordinates */ + while ( cur < limit ) + { + FT_Short dummy; + FT_Byte* old_cur; + + + /* skip whitespace in front of data */ + skip_spaces( &cur, limit ); + if ( cur >= limit ) + goto Exit; + + if ( *cur == ender ) + { + cur++; + break; + } + + old_cur = cur; + + if ( coords != NULL && count >= max_coords ) + break; + + /* call PS_Conv_ToFixed() even if coords == NULL */ + /* to properly parse number at `cur' */ + *( coords != NULL ? &coords[count] : &dummy ) = + (FT_Short)( PS_Conv_ToFixed( &cur, limit, 0 ) >> 16 ); + + if ( old_cur == cur ) + { + count = -1; + goto Exit; + } + else + count++; + + if ( !ender ) + break; + } + + Exit: + *acur = cur; + return count; + } + + + /* first character must be a delimiter or a part of a number */ + /* NB: `values' can be NULL if we just want to skip the */ + /* array; in this case we ignore `max_values' */ + + static FT_Int + ps_tofixedarray( FT_Byte* *acur, + FT_Byte* limit, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ) + { + FT_Byte* cur = *acur; + FT_Int count = 0; + FT_Byte c, ender; + + + if ( cur >= limit ) + goto Exit; + + /* Check for the beginning of an array. Otherwise, only one number */ + /* will be read. */ + c = *cur; + ender = 0; + + if ( c == '[' ) + ender = ']'; + else if ( c == '{' ) + ender = '}'; + + if ( ender ) + cur++; + + /* now, read the values */ + while ( cur < limit ) + { + FT_Fixed dummy; + FT_Byte* old_cur; + + + /* skip whitespace in front of data */ + skip_spaces( &cur, limit ); + if ( cur >= limit ) + goto Exit; + + if ( *cur == ender ) + { + cur++; + break; + } + + old_cur = cur; + + if ( values != NULL && count >= max_values ) + break; + + /* call PS_Conv_ToFixed() even if coords == NULL */ + /* to properly parse number at `cur' */ + *( values != NULL ? &values[count] : &dummy ) = + PS_Conv_ToFixed( &cur, limit, power_ten ); + + if ( old_cur == cur ) + { + count = -1; + goto Exit; + } + else + count++; + + if ( !ender ) + break; + } + + Exit: + *acur = cur; + return count; + } + + +#if 0 + + static FT_String* + ps_tostring( FT_Byte** cursor, + FT_Byte* limit, + FT_Memory memory ) + { + FT_Byte* cur = *cursor; + FT_PtrDist len = 0; + FT_Int count; + FT_String* result; + FT_Error error; + + + /* XXX: some stupid fonts have a `Notice' or `Copyright' string */ + /* that simply doesn't begin with an opening parenthesis, even */ + /* though they have a closing one! E.g. "amuncial.pfb" */ + /* */ + /* We must deal with these ill-fated cases there. Note that */ + /* these fonts didn't work with the old Type 1 driver as the */ + /* notice/copyright was not recognized as a valid string token */ + /* and made the old token parser commit errors. */ + + while ( cur < limit && ( *cur == ' ' || *cur == '\t' ) ) + cur++; + if ( cur + 1 >= limit ) + return 0; + + if ( *cur == '(' ) + cur++; /* skip the opening parenthesis, if there is one */ + + *cursor = cur; + count = 0; + + /* then, count its length */ + for ( ; cur < limit; cur++ ) + { + if ( *cur == '(' ) + count++; + + else if ( *cur == ')' ) + { + count--; + if ( count < 0 ) + break; + } + } + + len = cur - *cursor; + if ( cur >= limit || FT_ALLOC( result, len + 1 ) ) + return 0; + + /* now copy the string */ + FT_MEM_COPY( result, *cursor, len ); + result[len] = '\0'; + *cursor = cur; + return result; + } + +#endif /* 0 */ + + + static int + ps_tobool( FT_Byte* *acur, + FT_Byte* limit ) + { + FT_Byte* cur = *acur; + FT_Bool result = 0; + + + /* return 1 if we find `true', 0 otherwise */ + if ( cur + 3 < limit && + cur[0] == 't' && + cur[1] == 'r' && + cur[2] == 'u' && + cur[3] == 'e' ) + { + result = 1; + cur += 5; + } + else if ( cur + 4 < limit && + cur[0] == 'f' && + cur[1] == 'a' && + cur[2] == 'l' && + cur[3] == 's' && + cur[4] == 'e' ) + { + result = 0; + cur += 6; + } + + *acur = cur; + return result; + } + + + /* load a simple field (i.e. non-table) into the current list of objects */ + + FT_LOCAL_DEF( FT_Error ) + ps_parser_load_field( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ) + { + T1_TokenRec token; + FT_Byte* cur; + FT_Byte* limit; + FT_UInt count; + FT_UInt idx; + FT_Error error; + + + /* this also skips leading whitespace */ + ps_parser_to_token( parser, &token ); + if ( !token.type ) + goto Fail; + + count = 1; + idx = 0; + cur = token.start; + limit = token.limit; + + /* we must detect arrays in /FontBBox */ + if ( field->type == T1_FIELD_TYPE_BBOX ) + { + T1_TokenRec token2; + FT_Byte* old_cur = parser->cursor; + FT_Byte* old_limit = parser->limit; + + + /* don't include delimiters */ + parser->cursor = token.start + 1; + parser->limit = token.limit - 1; + + ps_parser_to_token( parser, &token2 ); + parser->cursor = old_cur; + parser->limit = old_limit; + + if ( token2.type == T1_TOKEN_TYPE_ARRAY ) + goto FieldArray; + } + else if ( token.type == T1_TOKEN_TYPE_ARRAY ) + { + FieldArray: + /* if this is an array and we have no blend, an error occurs */ + if ( max_objects == 0 ) + goto Fail; + + count = max_objects; + idx = 1; + + /* don't include delimiters */ + cur++; + limit--; + } + + for ( ; count > 0; count--, idx++ ) + { + FT_Byte* q = (FT_Byte*)objects[idx] + field->offset; + FT_Long val; + FT_String* string; + + + skip_spaces( &cur, limit ); + + switch ( field->type ) + { + case T1_FIELD_TYPE_BOOL: + val = ps_tobool( &cur, limit ); + goto Store_Integer; + + case T1_FIELD_TYPE_FIXED: + val = PS_Conv_ToFixed( &cur, limit, 0 ); + goto Store_Integer; + + case T1_FIELD_TYPE_FIXED_1000: + val = PS_Conv_ToFixed( &cur, limit, 3 ); + goto Store_Integer; + + case T1_FIELD_TYPE_INTEGER: + val = PS_Conv_ToInt( &cur, limit ); + /* fall through */ + + Store_Integer: + switch ( field->size ) + { + case (8 / FT_CHAR_BIT): + *(FT_Byte*)q = (FT_Byte)val; + break; + + case (16 / FT_CHAR_BIT): + *(FT_UShort*)q = (FT_UShort)val; + break; + + case (32 / FT_CHAR_BIT): + *(FT_UInt32*)q = (FT_UInt32)val; + break; + + default: /* for 64-bit systems */ + *(FT_Long*)q = val; + } + break; + + case T1_FIELD_TYPE_STRING: + case T1_FIELD_TYPE_KEY: + { + FT_Memory memory = parser->memory; + FT_UInt len = (FT_UInt)( limit - cur ); + + + if ( cur >= limit ) + break; + + /* we allow both a string or a name */ + /* for cases like /FontName (foo) def */ + if ( token.type == T1_TOKEN_TYPE_KEY ) + { + /* don't include leading `/' */ + len--; + cur++; + } + else if ( token.type == T1_TOKEN_TYPE_STRING ) + { + /* don't include delimiting parentheses */ + /* XXX we don't handle <<...>> here */ + /* XXX should we convert octal escapes? */ + /* if so, what encoding should we use? */ + cur++; + len -= 2; + } + else + { + FT_ERROR(( "ps_parser_load_field: expected a name or string " + "but found token of type %d instead\n", + token.type )); + error = PSaux_Err_Invalid_File_Format; + goto Exit; + } + + /* for this to work (FT_String**)q must have been */ + /* initialized to NULL */ + if ( *(FT_String**)q != NULL ) + { + FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n", + field->ident )); + FT_FREE( *(FT_String**)q ); + *(FT_String**)q = NULL; + } + + if ( FT_ALLOC( string, len + 1 ) ) + goto Exit; + + FT_MEM_COPY( string, cur, len ); + string[len] = 0; + + *(FT_String**)q = string; + } + break; + + case T1_FIELD_TYPE_BBOX: + { + FT_Fixed temp[4]; + FT_BBox* bbox = (FT_BBox*)q; + FT_Int result; + + + result = ps_tofixedarray( &cur, limit, 4, temp, 0 ); + + if ( result < 0 ) + { + FT_ERROR(( "ps_parser_load_field: " + "expected four integers in bounding box\n" )); + error = PSaux_Err_Invalid_File_Format; + goto Exit; + } + + bbox->xMin = FT_RoundFix( temp[0] ); + bbox->yMin = FT_RoundFix( temp[1] ); + bbox->xMax = FT_RoundFix( temp[2] ); + bbox->yMax = FT_RoundFix( temp[3] ); + } + break; + + default: + /* an error occurred */ + goto Fail; + } + } + +#if 0 /* obsolete -- keep for reference */ + if ( pflags ) + *pflags |= 1L << field->flag_bit; +#else + FT_UNUSED( pflags ); +#endif + + error = PSaux_Err_Ok; + + Exit: + return error; + + Fail: + error = PSaux_Err_Invalid_File_Format; + goto Exit; + } + + +#define T1_MAX_TABLE_ELEMENTS 32 + + + FT_LOCAL_DEF( FT_Error ) + ps_parser_load_field_table( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ) + { + T1_TokenRec elements[T1_MAX_TABLE_ELEMENTS]; + T1_Token token; + FT_Int num_elements; + FT_Error error = PSaux_Err_Ok; + FT_Byte* old_cursor; + FT_Byte* old_limit; + T1_FieldRec fieldrec = *(T1_Field)field; + + + fieldrec.type = T1_FIELD_TYPE_INTEGER; + if ( field->type == T1_FIELD_TYPE_FIXED_ARRAY || + field->type == T1_FIELD_TYPE_BBOX ) + fieldrec.type = T1_FIELD_TYPE_FIXED; + + ps_parser_to_token_array( parser, elements, + T1_MAX_TABLE_ELEMENTS, &num_elements ); + if ( num_elements < 0 ) + { + error = PSaux_Err_Ignore; + goto Exit; + } + if ( (FT_UInt)num_elements > field->array_max ) + num_elements = field->array_max; + + old_cursor = parser->cursor; + old_limit = parser->limit; + + /* we store the elements count if necessary */ + if ( field->type != T1_FIELD_TYPE_BBOX ) + *(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) = + (FT_Byte)num_elements; + + /* we now load each element, adjusting the field.offset on each one */ + token = elements; + for ( ; num_elements > 0; num_elements--, token++ ) + { + parser->cursor = token->start; + parser->limit = token->limit; + ps_parser_load_field( parser, &fieldrec, objects, max_objects, 0 ); + fieldrec.offset += fieldrec.size; + } + +#if 0 /* obsolete -- keep for reference */ + if ( pflags ) + *pflags |= 1L << field->flag_bit; +#else + FT_UNUSED( pflags ); +#endif + + parser->cursor = old_cursor; + parser->limit = old_limit; + + Exit: + return error; + } + + + FT_LOCAL_DEF( FT_Long ) + ps_parser_to_int( PS_Parser parser ) + { + ps_parser_skip_spaces( parser ); + return PS_Conv_ToInt( &parser->cursor, parser->limit ); + } + + + /* first character must be `<' if `delimiters' is non-zero */ + + FT_LOCAL_DEF( FT_Error ) + ps_parser_to_bytes( PS_Parser parser, + FT_Byte* bytes, + FT_Long max_bytes, + FT_Long* pnum_bytes, + FT_Bool delimiters ) + { + FT_Error error = PSaux_Err_Ok; + FT_Byte* cur; + + + ps_parser_skip_spaces( parser ); + cur = parser->cursor; + + if ( cur >= parser->limit ) + goto Exit; + + if ( delimiters ) + { + if ( *cur != '<' ) + { + FT_ERROR(( "ps_parser_to_bytes: Missing starting delimiter `<'\n" )); + error = PSaux_Err_Invalid_File_Format; + goto Exit; + } + + cur++; + } + + *pnum_bytes = PS_Conv_ASCIIHexDecode( &cur, + parser->limit, + bytes, + max_bytes ); + + if ( delimiters ) + { + if ( cur < parser->limit && *cur != '>' ) + { + FT_ERROR(( "ps_parser_to_bytes: Missing closing delimiter `>'\n" )); + error = PSaux_Err_Invalid_File_Format; + goto Exit; + } + + cur++; + } + + parser->cursor = cur; + + Exit: + return error; + } + + + FT_LOCAL_DEF( FT_Fixed ) + ps_parser_to_fixed( PS_Parser parser, + FT_Int power_ten ) + { + ps_parser_skip_spaces( parser ); + return PS_Conv_ToFixed( &parser->cursor, parser->limit, power_ten ); + } + + + FT_LOCAL_DEF( FT_Int ) + ps_parser_to_coord_array( PS_Parser parser, + FT_Int max_coords, + FT_Short* coords ) + { + ps_parser_skip_spaces( parser ); + return ps_tocoordarray( &parser->cursor, parser->limit, + max_coords, coords ); + } + + + FT_LOCAL_DEF( FT_Int ) + ps_parser_to_fixed_array( PS_Parser parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ) + { + ps_parser_skip_spaces( parser ); + return ps_tofixedarray( &parser->cursor, parser->limit, + max_values, values, power_ten ); + } + + +#if 0 + + FT_LOCAL_DEF( FT_String* ) + T1_ToString( PS_Parser parser ) + { + return ps_tostring( &parser->cursor, parser->limit, parser->memory ); + } + + + FT_LOCAL_DEF( FT_Bool ) + T1_ToBool( PS_Parser parser ) + { + return ps_tobool( &parser->cursor, parser->limit ); + } + +#endif /* 0 */ + + + FT_LOCAL_DEF( void ) + ps_parser_init( PS_Parser parser, + FT_Byte* base, + FT_Byte* limit, + FT_Memory memory ) + { + parser->error = PSaux_Err_Ok; + parser->base = base; + parser->limit = limit; + parser->cursor = base; + parser->memory = memory; + parser->funcs = ps_parser_funcs; + } + + + FT_LOCAL_DEF( void ) + ps_parser_done( PS_Parser parser ) + { + FT_UNUSED( parser ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** T1 BUILDER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* */ + /* t1_builder_init */ + /* */ + /* */ + /* Initializes a given glyph builder. */ + /* */ + /* */ + /* builder :: A pointer to the glyph builder to initialize. */ + /* */ + /* */ + /* face :: The current face object. */ + /* */ + /* size :: The current size object. */ + /* */ + /* glyph :: The current glyph object. */ + /* */ + /* hinting :: Whether hinting should be applied. */ + /* */ + FT_LOCAL_DEF( void ) + t1_builder_init( T1_Builder builder, + FT_Face face, + FT_Size size, + FT_GlyphSlot glyph, + FT_Bool hinting ) + { + builder->parse_state = T1_Parse_Start; + builder->load_points = 1; + + builder->face = face; + builder->glyph = glyph; + builder->memory = face->memory; + + if ( glyph ) + { + FT_GlyphLoader loader = glyph->internal->loader; + + + builder->loader = loader; + builder->base = &loader->base.outline; + builder->current = &loader->current.outline; + FT_GlyphLoader_Rewind( loader ); + + builder->hints_globals = size->internal; + builder->hints_funcs = 0; + + if ( hinting ) + builder->hints_funcs = glyph->internal->glyph_hints; + } + + if ( size ) + { + builder->scale_x = size->metrics.x_scale; + builder->scale_y = size->metrics.y_scale; + } + + builder->pos_x = 0; + builder->pos_y = 0; + + builder->left_bearing.x = 0; + builder->left_bearing.y = 0; + builder->advance.x = 0; + builder->advance.y = 0; + + builder->funcs = t1_builder_funcs; + } + + + /*************************************************************************/ + /* */ + /* */ + /* t1_builder_done */ + /* */ + /* */ + /* Finalizes a given glyph builder. Its contents can still be used */ + /* after the call, but the function saves important information */ + /* within the corresponding glyph slot. */ + /* */ + /* */ + /* builder :: A pointer to the glyph builder to finalize. */ + /* */ + FT_LOCAL_DEF( void ) + t1_builder_done( T1_Builder builder ) + { + FT_GlyphSlot glyph = builder->glyph; + + + if ( glyph ) + glyph->outline = *builder->base; + } + + + /* check that there is enough space for `count' more points */ + FT_LOCAL_DEF( FT_Error ) + t1_builder_check_points( T1_Builder builder, + FT_Int count ) + { + return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 ); + } + + + /* add a new point, do not check space */ + FT_LOCAL_DEF( void ) + t1_builder_add_point( T1_Builder builder, + FT_Pos x, + FT_Pos y, + FT_Byte flag ) + { + FT_Outline* outline = builder->current; + + + if ( builder->load_points ) + { + FT_Vector* point = outline->points + outline->n_points; + FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; + + + if ( builder->shift ) + { + x >>= 16; + y >>= 16; + } + point->x = x; + point->y = y; + *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC ); + + builder->last = *point; + } + outline->n_points++; + } + + + /* check space for a new on-curve point, then add it */ + FT_LOCAL_DEF( FT_Error ) + t1_builder_add_point1( T1_Builder builder, + FT_Pos x, + FT_Pos y ) + { + FT_Error error; + + + error = t1_builder_check_points( builder, 1 ); + if ( !error ) + t1_builder_add_point( builder, x, y, 1 ); + + return error; + } + + + /* check space for a new contour, then add it */ + FT_LOCAL_DEF( FT_Error ) + t1_builder_add_contour( T1_Builder builder ) + { + FT_Outline* outline = builder->current; + FT_Error error; + + + if ( !builder->load_points ) + { + outline->n_contours++; + return PSaux_Err_Ok; + } + + error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 ); + if ( !error ) + { + if ( outline->n_contours > 0 ) + outline->contours[outline->n_contours - 1] = + (short)( outline->n_points - 1 ); + + outline->n_contours++; + } + + return error; + } + + + /* if a path was begun, add its first on-curve point */ + FT_LOCAL_DEF( FT_Error ) + t1_builder_start_point( T1_Builder builder, + FT_Pos x, + FT_Pos y ) + { + FT_Error error = PSaux_Err_Invalid_File_Format; + + + /* test whether we are building a new contour */ + + if ( builder->parse_state == T1_Parse_Have_Path ) + error = PSaux_Err_Ok; + else if ( builder->parse_state == T1_Parse_Have_Moveto ) + { + builder->parse_state = T1_Parse_Have_Path; + error = t1_builder_add_contour( builder ); + if ( !error ) + error = t1_builder_add_point1( builder, x, y ); + } + + return error; + } + + + /* close the current contour */ + FT_LOCAL_DEF( void ) + t1_builder_close_contour( T1_Builder builder ) + { + FT_Outline* outline = builder->current; + + + if ( !outline ) + return; + + /* XXXX: We must not include the last point in the path if it */ + /* is located on the first point. */ + if ( outline->n_points > 1 ) + { + FT_Int first = 0; + FT_Vector* p1 = outline->points + first; + FT_Vector* p2 = outline->points + outline->n_points - 1; + FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1; + + + if ( outline->n_contours > 1 ) + { + first = outline->contours[outline->n_contours - 2] + 1; + p1 = outline->points + first; + } + + /* `delete' last point only if it coincides with the first */ + /* point and it is not a control point (which can happen). */ + if ( p1->x == p2->x && p1->y == p2->y ) + if ( *control == FT_CURVE_TAG_ON ) + outline->n_points--; + } + + if ( outline->n_contours > 0 ) + outline->contours[outline->n_contours - 1] = + (short)( outline->n_points - 1 ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** OTHER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + t1_decrypt( FT_Byte* buffer, + FT_Offset length, + FT_UShort seed ) + { + PS_Conv_EexecDecode( &buffer, + buffer + length, + buffer, + length, + &seed ); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/psobjs.h b/reactos/dll/3rdparty/freetype/src/psaux/psobjs.h index c2cbf2c79b3..9bbafea30a2 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/psobjs.h +++ b/reactos/dll/3rdparty/freetype/src/psaux/psobjs.h @@ -1,212 +1,212 @@ -/***************************************************************************/ -/* */ -/* psobjs.h */ -/* */ -/* Auxiliary functions for PostScript fonts (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSOBJS_H__ -#define __PSOBJS_H__ - - -#include -#include FT_INTERNAL_POSTSCRIPT_AUX_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** T1_TABLE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - FT_CALLBACK_TABLE - const PS_Table_FuncsRec ps_table_funcs; - - FT_CALLBACK_TABLE - const PS_Parser_FuncsRec ps_parser_funcs; - - FT_CALLBACK_TABLE - const T1_Builder_FuncsRec t1_builder_funcs; - - - FT_LOCAL( FT_Error ) - ps_table_new( PS_Table table, - FT_Int count, - FT_Memory memory ); - - FT_LOCAL( FT_Error ) - ps_table_add( PS_Table table, - FT_Int idx, - void* object, - FT_PtrDist length ); - - FT_LOCAL( void ) - ps_table_done( PS_Table table ); - - - FT_LOCAL( void ) - ps_table_release( PS_Table table ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** T1 PARSER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - FT_LOCAL( void ) - ps_parser_skip_spaces( PS_Parser parser ); - - FT_LOCAL( void ) - ps_parser_skip_PS_token( PS_Parser parser ); - - FT_LOCAL( void ) - ps_parser_to_token( PS_Parser parser, - T1_Token token ); - - FT_LOCAL( void ) - ps_parser_to_token_array( PS_Parser parser, - T1_Token tokens, - FT_UInt max_tokens, - FT_Int* pnum_tokens ); - - FT_LOCAL( FT_Error ) - ps_parser_load_field( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ); - - FT_LOCAL( FT_Error ) - ps_parser_load_field_table( PS_Parser parser, - const T1_Field field, - void** objects, - FT_UInt max_objects, - FT_ULong* pflags ); - - FT_LOCAL( FT_Long ) - ps_parser_to_int( PS_Parser parser ); - - - FT_LOCAL( FT_Error ) - ps_parser_to_bytes( PS_Parser parser, - FT_Byte* bytes, - FT_Long max_bytes, - FT_Long* pnum_bytes, - FT_Bool delimiters ); - - - FT_LOCAL( FT_Fixed ) - ps_parser_to_fixed( PS_Parser parser, - FT_Int power_ten ); - - - FT_LOCAL( FT_Int ) - ps_parser_to_coord_array( PS_Parser parser, - FT_Int max_coords, - FT_Short* coords ); - - FT_LOCAL( FT_Int ) - ps_parser_to_fixed_array( PS_Parser parser, - FT_Int max_values, - FT_Fixed* values, - FT_Int power_ten ); - - - FT_LOCAL( void ) - ps_parser_init( PS_Parser parser, - FT_Byte* base, - FT_Byte* limit, - FT_Memory memory ); - - FT_LOCAL( void ) - ps_parser_done( PS_Parser parser ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** T1 BUILDER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - t1_builder_init( T1_Builder builder, - FT_Face face, - FT_Size size, - FT_GlyphSlot glyph, - FT_Bool hinting ); - - FT_LOCAL( void ) - t1_builder_done( T1_Builder builder ); - - FT_LOCAL( FT_Error ) - t1_builder_check_points( T1_Builder builder, - FT_Int count ); - - FT_LOCAL( void ) - t1_builder_add_point( T1_Builder builder, - FT_Pos x, - FT_Pos y, - FT_Byte flag ); - - FT_LOCAL( FT_Error ) - t1_builder_add_point1( T1_Builder builder, - FT_Pos x, - FT_Pos y ); - - FT_LOCAL( FT_Error ) - t1_builder_add_contour( T1_Builder builder ); - - - FT_LOCAL( FT_Error ) - t1_builder_start_point( T1_Builder builder, - FT_Pos x, - FT_Pos y ); - - - FT_LOCAL( void ) - t1_builder_close_contour( T1_Builder builder ); - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** OTHER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_LOCAL( void ) - t1_decrypt( FT_Byte* buffer, - FT_Offset length, - FT_UShort seed ); - - -FT_END_HEADER - -#endif /* __PSOBJS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* psobjs.h */ +/* */ +/* Auxiliary functions for PostScript fonts (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSOBJS_H__ +#define __PSOBJS_H__ + + +#include +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** T1_TABLE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_CALLBACK_TABLE + const PS_Table_FuncsRec ps_table_funcs; + + FT_CALLBACK_TABLE + const PS_Parser_FuncsRec ps_parser_funcs; + + FT_CALLBACK_TABLE + const T1_Builder_FuncsRec t1_builder_funcs; + + + FT_LOCAL( FT_Error ) + ps_table_new( PS_Table table, + FT_Int count, + FT_Memory memory ); + + FT_LOCAL( FT_Error ) + ps_table_add( PS_Table table, + FT_Int idx, + void* object, + FT_PtrDist length ); + + FT_LOCAL( void ) + ps_table_done( PS_Table table ); + + + FT_LOCAL( void ) + ps_table_release( PS_Table table ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** T1 PARSER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_LOCAL( void ) + ps_parser_skip_spaces( PS_Parser parser ); + + FT_LOCAL( void ) + ps_parser_skip_PS_token( PS_Parser parser ); + + FT_LOCAL( void ) + ps_parser_to_token( PS_Parser parser, + T1_Token token ); + + FT_LOCAL( void ) + ps_parser_to_token_array( PS_Parser parser, + T1_Token tokens, + FT_UInt max_tokens, + FT_Int* pnum_tokens ); + + FT_LOCAL( FT_Error ) + ps_parser_load_field( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ); + + FT_LOCAL( FT_Error ) + ps_parser_load_field_table( PS_Parser parser, + const T1_Field field, + void** objects, + FT_UInt max_objects, + FT_ULong* pflags ); + + FT_LOCAL( FT_Long ) + ps_parser_to_int( PS_Parser parser ); + + + FT_LOCAL( FT_Error ) + ps_parser_to_bytes( PS_Parser parser, + FT_Byte* bytes, + FT_Long max_bytes, + FT_Long* pnum_bytes, + FT_Bool delimiters ); + + + FT_LOCAL( FT_Fixed ) + ps_parser_to_fixed( PS_Parser parser, + FT_Int power_ten ); + + + FT_LOCAL( FT_Int ) + ps_parser_to_coord_array( PS_Parser parser, + FT_Int max_coords, + FT_Short* coords ); + + FT_LOCAL( FT_Int ) + ps_parser_to_fixed_array( PS_Parser parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ); + + + FT_LOCAL( void ) + ps_parser_init( PS_Parser parser, + FT_Byte* base, + FT_Byte* limit, + FT_Memory memory ); + + FT_LOCAL( void ) + ps_parser_done( PS_Parser parser ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** T1 BUILDER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + t1_builder_init( T1_Builder builder, + FT_Face face, + FT_Size size, + FT_GlyphSlot glyph, + FT_Bool hinting ); + + FT_LOCAL( void ) + t1_builder_done( T1_Builder builder ); + + FT_LOCAL( FT_Error ) + t1_builder_check_points( T1_Builder builder, + FT_Int count ); + + FT_LOCAL( void ) + t1_builder_add_point( T1_Builder builder, + FT_Pos x, + FT_Pos y, + FT_Byte flag ); + + FT_LOCAL( FT_Error ) + t1_builder_add_point1( T1_Builder builder, + FT_Pos x, + FT_Pos y ); + + FT_LOCAL( FT_Error ) + t1_builder_add_contour( T1_Builder builder ); + + + FT_LOCAL( FT_Error ) + t1_builder_start_point( T1_Builder builder, + FT_Pos x, + FT_Pos y ); + + + FT_LOCAL( void ) + t1_builder_close_contour( T1_Builder builder ); + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** OTHER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_LOCAL( void ) + t1_decrypt( FT_Byte* buffer, + FT_Offset length, + FT_UShort seed ); + + +FT_END_HEADER + +#endif /* __PSOBJS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.c b/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.c index 29346869660..c5c9bb2160d 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.c +++ b/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.c @@ -1,333 +1,333 @@ -/***************************************************************************/ -/* */ -/* t1cmap.c */ -/* */ -/* Type 1 character map support (body). */ -/* */ -/* Copyright 2002, 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "t1cmap.h" - -#include FT_INTERNAL_DEBUG_H - -#include "psauxerr.h" - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - t1_cmap_std_init( T1_CMapStd cmap, - FT_Int is_expert ) - { - T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; - - - cmap->num_glyphs = face->type1.num_glyphs; - cmap->glyph_names = (const char* const*)face->type1.glyph_names; - cmap->sid_to_string = psnames->adobe_std_strings; - cmap->code_to_sid = is_expert ? psnames->adobe_expert_encoding - : psnames->adobe_std_encoding; - - FT_ASSERT( cmap->code_to_sid != NULL ); - } - - - FT_CALLBACK_DEF( void ) - t1_cmap_std_done( T1_CMapStd cmap ) - { - cmap->num_glyphs = 0; - cmap->glyph_names = NULL; - cmap->sid_to_string = NULL; - cmap->code_to_sid = NULL; - } - - - FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_std_char_index( T1_CMapStd cmap, - FT_UInt32 char_code ) - { - FT_UInt result = 0; - - - if ( char_code < 256 ) - { - FT_UInt code, n; - const char* glyph_name; - - - /* convert character code to Adobe SID string */ - code = cmap->code_to_sid[char_code]; - glyph_name = cmap->sid_to_string( code ); - - /* look for the corresponding glyph name */ - for ( n = 0; n < cmap->num_glyphs; n++ ) - { - const char* gname = cmap->glyph_names[n]; - - - if ( gname && gname[0] == glyph_name[0] && - ft_strcmp( gname, glyph_name ) == 0 ) - { - result = n; - break; - } - } - } - - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_std_char_next( T1_CMapStd cmap, - FT_UInt32 *pchar_code ) - { - FT_UInt result = 0; - FT_UInt32 char_code = *pchar_code + 1; - - - while ( char_code < 256 ) - { - result = t1_cmap_std_char_index( cmap, char_code ); - if ( result != 0 ) - goto Exit; - - char_code++; - } - char_code = 0; - - Exit: - *pchar_code = char_code; - return result; - } - - - FT_CALLBACK_DEF( FT_Error ) - t1_cmap_standard_init( T1_CMapStd cmap ) - { - t1_cmap_std_init( cmap, 0 ); - return 0; - } - - - FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec - t1_cmap_standard_class_rec = - { - sizeof ( T1_CMapStdRec ), - - (FT_CMap_InitFunc) t1_cmap_standard_init, - (FT_CMap_DoneFunc) t1_cmap_std_done, - (FT_CMap_CharIndexFunc)t1_cmap_std_char_index, - (FT_CMap_CharNextFunc) t1_cmap_std_char_next - }; - - - FT_CALLBACK_DEF( FT_Error ) - t1_cmap_expert_init( T1_CMapStd cmap ) - { - t1_cmap_std_init( cmap, 1 ); - return 0; - } - - FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec - t1_cmap_expert_class_rec = - { - sizeof ( T1_CMapStdRec ), - - (FT_CMap_InitFunc) t1_cmap_expert_init, - (FT_CMap_DoneFunc) t1_cmap_std_done, - (FT_CMap_CharIndexFunc)t1_cmap_std_char_index, - (FT_CMap_CharNextFunc) t1_cmap_std_char_next - }; - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE1 CUSTOM ENCODING CMAP *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - FT_CALLBACK_DEF( FT_Error ) - t1_cmap_custom_init( T1_CMapCustom cmap ) - { - T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); - T1_Encoding encoding = &face->type1.encoding; - - - cmap->first = encoding->code_first; - cmap->count = (FT_UInt)( encoding->code_last - cmap->first + 1 ); - cmap->indices = encoding->char_index; - - FT_ASSERT( cmap->indices != NULL ); - FT_ASSERT( encoding->code_first <= encoding->code_last ); - - return 0; - } - - - FT_CALLBACK_DEF( void ) - t1_cmap_custom_done( T1_CMapCustom cmap ) - { - cmap->indices = NULL; - cmap->first = 0; - cmap->count = 0; - } - - - FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_custom_char_index( T1_CMapCustom cmap, - FT_UInt32 char_code ) - { - FT_UInt result = 0; - - - if ( ( char_code >= cmap->first ) && - ( char_code < ( cmap->first + cmap->count ) ) ) - result = cmap->indices[char_code]; - - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_custom_char_next( T1_CMapCustom cmap, - FT_UInt32 *pchar_code ) - { - FT_UInt result = 0; - FT_UInt32 char_code = *pchar_code; - - - ++char_code; - - if ( char_code < cmap->first ) - char_code = cmap->first; - - for ( ; char_code < ( cmap->first + cmap->count ); char_code++ ) - { - result = cmap->indices[char_code]; - if ( result != 0 ) - goto Exit; - } - - char_code = 0; - - Exit: - *pchar_code = char_code; - return result; - } - - - FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec - t1_cmap_custom_class_rec = - { - sizeof ( T1_CMapCustomRec ), - - (FT_CMap_InitFunc) t1_cmap_custom_init, - (FT_CMap_DoneFunc) t1_cmap_custom_done, - (FT_CMap_CharIndexFunc)t1_cmap_custom_char_index, - (FT_CMap_CharNextFunc) t1_cmap_custom_char_next - }; - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_CALLBACK_DEF( const char * ) - t1_get_glyph_name( T1_Face face, - FT_UInt idx ) - { - return face->type1.glyph_names[idx]; - } - - - FT_CALLBACK_DEF( FT_Error ) - t1_cmap_unicode_init( PS_Unicodes unicodes ) - { - T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; - - - return psnames->unicodes_init( memory, - unicodes, - face->type1.num_glyphs, - (PS_GetGlyphNameFunc)&t1_get_glyph_name, - (PS_FreeGlyphNameFunc)NULL, - (FT_Pointer)face ); - } - - - FT_CALLBACK_DEF( void ) - t1_cmap_unicode_done( PS_Unicodes unicodes ) - { - FT_Face face = FT_CMAP_FACE( unicodes ); - FT_Memory memory = FT_FACE_MEMORY( face ); - - - FT_FREE( unicodes->maps ); - unicodes->num_maps = 0; - } - - - FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_unicode_char_index( PS_Unicodes unicodes, - FT_UInt32 char_code ) - { - T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; - - - return psnames->unicodes_char_index( unicodes, char_code ); - } - - - FT_CALLBACK_DEF( FT_UInt ) - t1_cmap_unicode_char_next( PS_Unicodes unicodes, - FT_UInt32 *pchar_code ) - { - T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; - - - return psnames->unicodes_char_next( unicodes, pchar_code ); - } - - - FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec - t1_cmap_unicode_class_rec = - { - sizeof ( PS_UnicodesRec ), - - (FT_CMap_InitFunc) t1_cmap_unicode_init, - (FT_CMap_DoneFunc) t1_cmap_unicode_done, - (FT_CMap_CharIndexFunc)t1_cmap_unicode_char_index, - (FT_CMap_CharNextFunc) t1_cmap_unicode_char_next - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* t1cmap.c */ +/* */ +/* Type 1 character map support (body). */ +/* */ +/* Copyright 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "t1cmap.h" + +#include FT_INTERNAL_DEBUG_H + +#include "psauxerr.h" + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + t1_cmap_std_init( T1_CMapStd cmap, + FT_Int is_expert ) + { + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + + + cmap->num_glyphs = face->type1.num_glyphs; + cmap->glyph_names = (const char* const*)face->type1.glyph_names; + cmap->sid_to_string = psnames->adobe_std_strings; + cmap->code_to_sid = is_expert ? psnames->adobe_expert_encoding + : psnames->adobe_std_encoding; + + FT_ASSERT( cmap->code_to_sid != NULL ); + } + + + FT_CALLBACK_DEF( void ) + t1_cmap_std_done( T1_CMapStd cmap ) + { + cmap->num_glyphs = 0; + cmap->glyph_names = NULL; + cmap->sid_to_string = NULL; + cmap->code_to_sid = NULL; + } + + + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_std_char_index( T1_CMapStd cmap, + FT_UInt32 char_code ) + { + FT_UInt result = 0; + + + if ( char_code < 256 ) + { + FT_UInt code, n; + const char* glyph_name; + + + /* convert character code to Adobe SID string */ + code = cmap->code_to_sid[char_code]; + glyph_name = cmap->sid_to_string( code ); + + /* look for the corresponding glyph name */ + for ( n = 0; n < cmap->num_glyphs; n++ ) + { + const char* gname = cmap->glyph_names[n]; + + + if ( gname && gname[0] == glyph_name[0] && + ft_strcmp( gname, glyph_name ) == 0 ) + { + result = n; + break; + } + } + } + + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_std_char_next( T1_CMapStd cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt result = 0; + FT_UInt32 char_code = *pchar_code + 1; + + + while ( char_code < 256 ) + { + result = t1_cmap_std_char_index( cmap, char_code ); + if ( result != 0 ) + goto Exit; + + char_code++; + } + char_code = 0; + + Exit: + *pchar_code = char_code; + return result; + } + + + FT_CALLBACK_DEF( FT_Error ) + t1_cmap_standard_init( T1_CMapStd cmap ) + { + t1_cmap_std_init( cmap, 0 ); + return 0; + } + + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec + t1_cmap_standard_class_rec = + { + sizeof ( T1_CMapStdRec ), + + (FT_CMap_InitFunc) t1_cmap_standard_init, + (FT_CMap_DoneFunc) t1_cmap_std_done, + (FT_CMap_CharIndexFunc)t1_cmap_std_char_index, + (FT_CMap_CharNextFunc) t1_cmap_std_char_next + }; + + + FT_CALLBACK_DEF( FT_Error ) + t1_cmap_expert_init( T1_CMapStd cmap ) + { + t1_cmap_std_init( cmap, 1 ); + return 0; + } + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec + t1_cmap_expert_class_rec = + { + sizeof ( T1_CMapStdRec ), + + (FT_CMap_InitFunc) t1_cmap_expert_init, + (FT_CMap_DoneFunc) t1_cmap_std_done, + (FT_CMap_CharIndexFunc)t1_cmap_std_char_index, + (FT_CMap_CharNextFunc) t1_cmap_std_char_next + }; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE1 CUSTOM ENCODING CMAP *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_CALLBACK_DEF( FT_Error ) + t1_cmap_custom_init( T1_CMapCustom cmap ) + { + T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); + T1_Encoding encoding = &face->type1.encoding; + + + cmap->first = encoding->code_first; + cmap->count = (FT_UInt)( encoding->code_last - cmap->first + 1 ); + cmap->indices = encoding->char_index; + + FT_ASSERT( cmap->indices != NULL ); + FT_ASSERT( encoding->code_first <= encoding->code_last ); + + return 0; + } + + + FT_CALLBACK_DEF( void ) + t1_cmap_custom_done( T1_CMapCustom cmap ) + { + cmap->indices = NULL; + cmap->first = 0; + cmap->count = 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_custom_char_index( T1_CMapCustom cmap, + FT_UInt32 char_code ) + { + FT_UInt result = 0; + + + if ( ( char_code >= cmap->first ) && + ( char_code < ( cmap->first + cmap->count ) ) ) + result = cmap->indices[char_code]; + + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_custom_char_next( T1_CMapCustom cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt result = 0; + FT_UInt32 char_code = *pchar_code; + + + ++char_code; + + if ( char_code < cmap->first ) + char_code = cmap->first; + + for ( ; char_code < ( cmap->first + cmap->count ); char_code++ ) + { + result = cmap->indices[char_code]; + if ( result != 0 ) + goto Exit; + } + + char_code = 0; + + Exit: + *pchar_code = char_code; + return result; + } + + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec + t1_cmap_custom_class_rec = + { + sizeof ( T1_CMapCustomRec ), + + (FT_CMap_InitFunc) t1_cmap_custom_init, + (FT_CMap_DoneFunc) t1_cmap_custom_done, + (FT_CMap_CharIndexFunc)t1_cmap_custom_char_index, + (FT_CMap_CharNextFunc) t1_cmap_custom_char_next + }; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_CALLBACK_DEF( const char * ) + t1_get_glyph_name( T1_Face face, + FT_UInt idx ) + { + return face->type1.glyph_names[idx]; + } + + + FT_CALLBACK_DEF( FT_Error ) + t1_cmap_unicode_init( PS_Unicodes unicodes ) + { + T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); + FT_Memory memory = FT_FACE_MEMORY( face ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + + + return psnames->unicodes_init( memory, + unicodes, + face->type1.num_glyphs, + (PS_GetGlyphNameFunc)&t1_get_glyph_name, + (PS_FreeGlyphNameFunc)NULL, + (FT_Pointer)face ); + } + + + FT_CALLBACK_DEF( void ) + t1_cmap_unicode_done( PS_Unicodes unicodes ) + { + FT_Face face = FT_CMAP_FACE( unicodes ); + FT_Memory memory = FT_FACE_MEMORY( face ); + + + FT_FREE( unicodes->maps ); + unicodes->num_maps = 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_unicode_char_index( PS_Unicodes unicodes, + FT_UInt32 char_code ) + { + T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + + + return psnames->unicodes_char_index( unicodes, char_code ); + } + + + FT_CALLBACK_DEF( FT_UInt ) + t1_cmap_unicode_char_next( PS_Unicodes unicodes, + FT_UInt32 *pchar_code ) + { + T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); + FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + + + return psnames->unicodes_char_next( unicodes, pchar_code ); + } + + + FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec + t1_cmap_unicode_class_rec = + { + sizeof ( PS_UnicodesRec ), + + (FT_CMap_InitFunc) t1_cmap_unicode_init, + (FT_CMap_DoneFunc) t1_cmap_unicode_done, + (FT_CMap_CharIndexFunc)t1_cmap_unicode_char_index, + (FT_CMap_CharNextFunc) t1_cmap_unicode_char_next + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.h b/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.h index 7ae65d2fa16..782aa975286 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.h +++ b/reactos/dll/3rdparty/freetype/src/psaux/t1cmap.h @@ -1,105 +1,105 @@ -/***************************************************************************/ -/* */ -/* t1cmap.h */ -/* */ -/* Type 1 character map support (specification). */ -/* */ -/* Copyright 2002, 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1CMAP_H__ -#define __T1CMAP_H__ - -#include -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_TYPE1_TYPES_H - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* standard (and expert) encoding cmaps */ - typedef struct T1_CMapStdRec_* T1_CMapStd; - - typedef struct T1_CMapStdRec_ - { - FT_CMapRec cmap; - - const FT_UShort* code_to_sid; - PS_Adobe_Std_StringsFunc sid_to_string; - - FT_UInt num_glyphs; - const char* const* glyph_names; - - } T1_CMapStdRec; - - - FT_CALLBACK_TABLE const FT_CMap_ClassRec - t1_cmap_standard_class_rec; - - FT_CALLBACK_TABLE const FT_CMap_ClassRec - t1_cmap_expert_class_rec; - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE1 CUSTOM ENCODING CMAP *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - typedef struct T1_CMapCustomRec_* T1_CMapCustom; - - typedef struct T1_CMapCustomRec_ - { - FT_CMapRec cmap; - FT_UInt first; - FT_UInt count; - FT_UShort* indices; - - } T1_CMapCustomRec; - - - FT_CALLBACK_TABLE const FT_CMap_ClassRec - t1_cmap_custom_class_rec; - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* unicode (synthetic) cmaps */ - - FT_CALLBACK_TABLE const FT_CMap_ClassRec - t1_cmap_unicode_class_rec; - - /* */ - - -FT_END_HEADER - -#endif /* __T1CMAP_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1cmap.h */ +/* */ +/* Type 1 character map support (specification). */ +/* */ +/* Copyright 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1CMAP_H__ +#define __T1CMAP_H__ + +#include +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_TYPE1_TYPES_H + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* standard (and expert) encoding cmaps */ + typedef struct T1_CMapStdRec_* T1_CMapStd; + + typedef struct T1_CMapStdRec_ + { + FT_CMapRec cmap; + + const FT_UShort* code_to_sid; + PS_Adobe_Std_StringsFunc sid_to_string; + + FT_UInt num_glyphs; + const char* const* glyph_names; + + } T1_CMapStdRec; + + + FT_CALLBACK_TABLE const FT_CMap_ClassRec + t1_cmap_standard_class_rec; + + FT_CALLBACK_TABLE const FT_CMap_ClassRec + t1_cmap_expert_class_rec; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE1 CUSTOM ENCODING CMAP *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct T1_CMapCustomRec_* T1_CMapCustom; + + typedef struct T1_CMapCustomRec_ + { + FT_CMapRec cmap; + FT_UInt first; + FT_UInt count; + FT_UShort* indices; + + } T1_CMapCustomRec; + + + FT_CALLBACK_TABLE const FT_CMap_ClassRec + t1_cmap_custom_class_rec; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* unicode (synthetic) cmaps */ + + FT_CALLBACK_TABLE const FT_CMap_ClassRec + t1_cmap_unicode_class_rec; + + /* */ + + +FT_END_HEADER + +#endif /* __T1CMAP_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/t1decode.c b/reactos/dll/3rdparty/freetype/src/psaux/t1decode.c index f790643f961..a32d51b26ed 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/t1decode.c +++ b/reactos/dll/3rdparty/freetype/src/psaux/t1decode.c @@ -1,1474 +1,1474 @@ -/***************************************************************************/ -/* */ -/* t1decode.c */ -/* */ -/* PostScript Type 1 decoding routines (body). */ -/* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H -#include FT_OUTLINE_H - -#include "t1decode.h" -#include "psobjs.h" - -#include "psauxerr.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1decode - - - typedef enum T1_Operator_ - { - op_none = 0, - op_endchar, - op_hsbw, - op_seac, - op_sbw, - op_closepath, - op_hlineto, - op_hmoveto, - op_hvcurveto, - op_rlineto, - op_rmoveto, - op_rrcurveto, - op_vhcurveto, - op_vlineto, - op_vmoveto, - op_dotsection, - op_hstem, - op_hstem3, - op_vstem, - op_vstem3, - op_div, - op_callothersubr, - op_callsubr, - op_pop, - op_return, - op_setcurrentpoint, - op_unknown15, - - op_max /* never remove this one */ - - } T1_Operator; - - - static - const FT_Int t1_args_count[op_max] = - { - 0, /* none */ - 0, /* endchar */ - 2, /* hsbw */ - 5, /* seac */ - 4, /* sbw */ - 0, /* closepath */ - 1, /* hlineto */ - 1, /* hmoveto */ - 4, /* hvcurveto */ - 2, /* rlineto */ - 2, /* rmoveto */ - 6, /* rrcurveto */ - 4, /* vhcurveto */ - 1, /* vlineto */ - 1, /* vmoveto */ - 0, /* dotsection */ - 2, /* hstem */ - 6, /* hstem3 */ - 2, /* vstem */ - 6, /* vstem3 */ - 2, /* div */ - -1, /* callothersubr */ - 1, /* callsubr */ - 0, /* pop */ - 0, /* return */ - 2, /* setcurrentpoint */ - 2 /* opcode 15 (undocumented and obsolete) */ - }; - - - /*************************************************************************/ - /* */ - /* */ - /* t1_lookup_glyph_by_stdcharcode */ - /* */ - /* */ - /* Looks up a given glyph by its StandardEncoding charcode. Used to */ - /* implement the SEAC Type 1 operator. */ - /* */ - /* */ - /* face :: The current face object. */ - /* */ - /* charcode :: The character code to look for. */ - /* */ - /* */ - /* A glyph index in the font face. Returns -1 if the corresponding */ - /* glyph wasn't found. */ - /* */ - static FT_Int - t1_lookup_glyph_by_stdcharcode( T1_Decoder decoder, - FT_Int charcode ) - { - FT_UInt n; - const FT_String* glyph_name; - FT_Service_PsCMaps psnames = decoder->psnames; - - - /* check range of standard char code */ - if ( charcode < 0 || charcode > 255 ) - return -1; - - glyph_name = psnames->adobe_std_strings( - psnames->adobe_std_encoding[charcode]); - - for ( n = 0; n < decoder->num_glyphs; n++ ) - { - FT_String* name = (FT_String*)decoder->glyph_names[n]; - - - if ( name && name[0] == glyph_name[0] && - ft_strcmp( name, glyph_name ) == 0 ) - return n; - } - - return -1; - } - - - /*************************************************************************/ - /* */ - /* */ - /* t1operator_seac */ - /* */ - /* */ - /* Implements the `seac' Type 1 operator for a Type 1 decoder. */ - /* */ - /* */ - /* decoder :: The current CID decoder. */ - /* */ - /* asb :: The accent's side bearing. */ - /* */ - /* adx :: The horizontal offset of the accent. */ - /* */ - /* ady :: The vertical offset of the accent. */ - /* */ - /* bchar :: The base character's StandardEncoding charcode. */ - /* */ - /* achar :: The accent character's StandardEncoding charcode. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - t1operator_seac( T1_Decoder decoder, - FT_Pos asb, - FT_Pos adx, - FT_Pos ady, - FT_Int bchar, - FT_Int achar ) - { - FT_Error error; - FT_Int bchar_index, achar_index; -#if 0 - FT_Int n_base_points; - FT_Outline* base = decoder->builder.base; -#endif - FT_Vector left_bearing, advance; - - - /* seac weirdness */ - adx += decoder->builder.left_bearing.x; - - /* `glyph_names' is set to 0 for CID fonts which do not */ - /* include an encoding. How can we deal with these? */ - if ( decoder->glyph_names == 0 ) - { - FT_ERROR(( "t1operator_seac:" )); - FT_ERROR(( " glyph names table not available in this font!\n" )); - return PSaux_Err_Syntax_Error; - } - - bchar_index = t1_lookup_glyph_by_stdcharcode( decoder, bchar ); - achar_index = t1_lookup_glyph_by_stdcharcode( decoder, achar ); - - if ( bchar_index < 0 || achar_index < 0 ) - { - FT_ERROR(( "t1operator_seac:" )); - FT_ERROR(( " invalid seac character code arguments\n" )); - return PSaux_Err_Syntax_Error; - } - - /* if we are trying to load a composite glyph, do not load the */ - /* accent character and return the array of subglyphs. */ - if ( decoder->builder.no_recurse ) - { - FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph; - FT_GlyphLoader loader = glyph->internal->loader; - FT_SubGlyph subg; - - - /* reallocate subglyph array if necessary */ - error = FT_GlyphLoader_CheckSubGlyphs( loader, 2 ); - if ( error ) - goto Exit; - - subg = loader->current.subglyphs; - - /* subglyph 0 = base character */ - subg->index = bchar_index; - subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES | - FT_SUBGLYPH_FLAG_USE_MY_METRICS; - subg->arg1 = 0; - subg->arg2 = 0; - subg++; - - /* subglyph 1 = accent character */ - subg->index = achar_index; - subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES; - subg->arg1 = (FT_Int)( adx - asb ); - subg->arg2 = (FT_Int)ady; - - /* set up remaining glyph fields */ - glyph->num_subglyphs = 2; - glyph->subglyphs = loader->base.subglyphs; - glyph->format = FT_GLYPH_FORMAT_COMPOSITE; - - loader->current.num_subglyphs = 2; - goto Exit; - } - - /* First load `bchar' in builder */ - /* now load the unscaled outline */ - - FT_GlyphLoader_Prepare( decoder->builder.loader ); /* prepare loader */ - - error = t1_decoder_parse_glyph( decoder, bchar_index ); - if ( error ) - goto Exit; - - /* save the left bearing and width of the base character */ - /* as they will be erased by the next load. */ - - left_bearing = decoder->builder.left_bearing; - advance = decoder->builder.advance; - - decoder->builder.left_bearing.x = 0; - decoder->builder.left_bearing.y = 0; - - decoder->builder.pos_x = adx - asb; - decoder->builder.pos_y = ady; - - /* Now load `achar' on top of */ - /* the base outline */ - error = t1_decoder_parse_glyph( decoder, achar_index ); - if ( error ) - goto Exit; - - /* restore the left side bearing and */ - /* advance width of the base character */ - - decoder->builder.left_bearing = left_bearing; - decoder->builder.advance = advance; - - decoder->builder.pos_x = 0; - decoder->builder.pos_y = 0; - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* t1_decoder_parse_charstrings */ - /* */ - /* */ - /* Parses a given Type 1 charstrings program. */ - /* */ - /* */ - /* decoder :: The current Type 1 decoder. */ - /* */ - /* charstring_base :: The base address of the charstring stream. */ - /* */ - /* charstring_len :: The length in bytes of the charstring stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - t1_decoder_parse_charstrings( T1_Decoder decoder, - FT_Byte* charstring_base, - FT_UInt charstring_len ) - { - FT_Error error; - T1_Decoder_Zone zone; - FT_Byte* ip; - FT_Byte* limit; - T1_Builder builder = &decoder->builder; - FT_Pos x, y, orig_x, orig_y; - FT_Int known_othersubr_result_cnt = 0; - FT_Int unknown_othersubr_result_cnt = 0; - - T1_Hints_Funcs hinter; - - - /* we don't want to touch the source code -- use macro trick */ -#define start_point t1_builder_start_point -#define check_points t1_builder_check_points -#define add_point t1_builder_add_point -#define add_point1 t1_builder_add_point1 -#define add_contour t1_builder_add_contour -#define close_contour t1_builder_close_contour - - /* First of all, initialize the decoder */ - decoder->top = decoder->stack; - decoder->zone = decoder->zones; - zone = decoder->zones; - - builder->parse_state = T1_Parse_Start; - - hinter = (T1_Hints_Funcs)builder->hints_funcs; - - /* a font that reads BuildCharArray without setting */ - /* its values first is buggy, but ... */ - FT_ASSERT( ( decoder->len_buildchar == 0 ) == - ( decoder->buildchar == NULL ) ); - - if ( decoder->len_buildchar > 0 ) - memset( &decoder->buildchar[0], - 0, - sizeof( decoder->buildchar[0] ) * - decoder->len_buildchar ); - - FT_TRACE4(( "\nStart charstring\n" )); - - zone->base = charstring_base; - limit = zone->limit = charstring_base + charstring_len; - ip = zone->cursor = zone->base; - - error = PSaux_Err_Ok; - - x = orig_x = builder->pos_x; - y = orig_y = builder->pos_y; - - /* begin hints recording session, if any */ - if ( hinter ) - hinter->open( hinter->hints ); - - /* now, execute loop */ - while ( ip < limit ) - { - FT_Long* top = decoder->top; - T1_Operator op = op_none; - FT_Long value = 0; - - - FT_ASSERT( known_othersubr_result_cnt == 0 || - unknown_othersubr_result_cnt == 0 ); - - FT_TRACE5(( " (%d)", decoder->top - decoder->stack )); - - /*********************************************************************/ - /* */ - /* Decode operator or operand */ - /* */ - /* */ - - /* first of all, decompress operator or value */ - switch ( *ip++ ) - { - case 1: - op = op_hstem; - break; - - case 3: - op = op_vstem; - break; - case 4: - op = op_vmoveto; - break; - case 5: - op = op_rlineto; - break; - case 6: - op = op_hlineto; - break; - case 7: - op = op_vlineto; - break; - case 8: - op = op_rrcurveto; - break; - case 9: - op = op_closepath; - break; - case 10: - op = op_callsubr; - break; - case 11: - op = op_return; - break; - - case 13: - op = op_hsbw; - break; - case 14: - op = op_endchar; - break; - - case 15: /* undocumented, obsolete operator */ - op = op_unknown15; - break; - - case 21: - op = op_rmoveto; - break; - case 22: - op = op_hmoveto; - break; - - case 30: - op = op_vhcurveto; - break; - case 31: - op = op_hvcurveto; - break; - - case 12: - if ( ip > limit ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "invalid escape (12+EOF)\n" )); - goto Syntax_Error; - } - - switch ( *ip++ ) - { - case 0: - op = op_dotsection; - break; - case 1: - op = op_vstem3; - break; - case 2: - op = op_hstem3; - break; - case 6: - op = op_seac; - break; - case 7: - op = op_sbw; - break; - case 12: - op = op_div; - break; - case 16: - op = op_callothersubr; - break; - case 17: - op = op_pop; - break; - case 33: - op = op_setcurrentpoint; - break; - - default: - FT_ERROR(( "t1_decoder_parse_charstrings: " - "invalid escape (12+%d)\n", - ip[-1] )); - goto Syntax_Error; - } - break; - - case 255: /* four bytes integer */ - if ( ip + 4 > limit ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "unexpected EOF in integer\n" )); - goto Syntax_Error; - } - - value = (FT_Int32)( ((FT_Long)ip[0] << 24) | - ((FT_Long)ip[1] << 16) | - ((FT_Long)ip[2] << 8 ) | - ip[3] ); - ip += 4; - break; - - default: - if ( ip[-1] >= 32 ) - { - if ( ip[-1] < 247 ) - value = (FT_Long)ip[-1] - 139; - else - { - if ( ++ip > limit ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " )); - FT_ERROR(( "unexpected EOF in integer\n" )); - goto Syntax_Error; - } - - if ( ip[-2] < 251 ) - value = ( ( (FT_Long)ip[-2] - 247 ) << 8 ) + ip[-1] + 108; - else - value = -( ( ( (FT_Long)ip[-2] - 251 ) << 8 ) + ip[-1] + 108 ); - } - } - else - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "invalid byte (%d)\n", ip[-1] )); - goto Syntax_Error; - } - } - - if ( unknown_othersubr_result_cnt > 0 ) - { - switch ( op ) - { - case op_callsubr: - case op_return: - case op_none: - case op_pop: - break; - - default: - /* all operands have been transferred by previous pops */ - unknown_othersubr_result_cnt = 0; - break; - } - } - - /*********************************************************************/ - /* */ - /* Push value on stack, or process operator */ - /* */ - /* */ - if ( op == op_none ) - { - if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: stack overflow!\n" )); - goto Syntax_Error; - } - - FT_TRACE4(( " %ld", value )); - - *top++ = value; - decoder->top = top; - } - else if ( op == op_callothersubr ) /* callothersubr */ - { - FT_Int subr_no; - FT_Int arg_cnt; - - - FT_TRACE4(( " callothersubr" )); - - if ( top - decoder->stack < 2 ) - goto Stack_Underflow; - - top -= 2; - - subr_no = (FT_Int)top[1]; - arg_cnt = (FT_Int)top[0]; - - /***********************************************************/ - /* */ - /* remove all operands to callothersubr from the stack */ - /* */ - /* for handled othersubrs, where we know the number of */ - /* arguments, we increase the stack by the value of */ - /* known_othersubr_result_cnt */ - /* */ - /* for unhandled othersubrs the following pops adjust the */ - /* stack pointer as necessary */ - - if ( arg_cnt > top - decoder->stack ) - goto Stack_Underflow; - - top -= arg_cnt; - - known_othersubr_result_cnt = 0; - unknown_othersubr_result_cnt = 0; - - /* XXX TODO: The checks to `arg_count == ' */ - /* might not be correct; an othersubr expects a certain */ - /* number of operands on the PostScript stack (as opposed */ - /* to the T1 stack) but it doesn't have to put them there */ - /* by itself; previous othersubrs might have left the */ - /* operands there if they were not followed by an */ - /* appropriate number of pops */ - /* */ - /* On the other hand, Adobe Reader 7.0.8 for Linux doesn't */ - /* accept a font that contains charstrings like */ - /* */ - /* 100 200 2 20 callothersubr */ - /* 300 1 20 callothersubr pop */ - /* */ - /* Perhaps this is the reason why BuildCharArray exists. */ - - switch ( subr_no ) - { - case 1: /* start flex feature */ - if ( arg_cnt != 0 ) - goto Unexpected_OtherSubr; - - decoder->flex_state = 1; - decoder->num_flex_vectors = 0; - if ( start_point( builder, x, y ) || - check_points( builder, 6 ) ) - goto Fail; - break; - - case 2: /* add flex vectors */ - { - FT_Int idx; - - - if ( arg_cnt != 0 ) - goto Unexpected_OtherSubr; - - /* note that we should not add a point for index 0; */ - /* this will move our current position to the flex */ - /* point without adding any point to the outline */ - idx = decoder->num_flex_vectors++; - if ( idx > 0 && idx < 7 ) - add_point( builder, - x, - y, - (FT_Byte)( idx == 3 || idx == 6 ) ); - } - break; - - case 0: /* end flex feature */ - if ( arg_cnt != 3 ) - goto Unexpected_OtherSubr; - - if ( decoder->flex_state == 0 || - decoder->num_flex_vectors != 7 ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "unexpected flex end\n" )); - goto Syntax_Error; - } - - /* the two `results' are popped by the following setcurrentpoint */ - known_othersubr_result_cnt = 2; - break; - - case 3: /* change hints */ - if ( arg_cnt != 1 ) - goto Unexpected_OtherSubr; - - known_othersubr_result_cnt = 1; - - if ( hinter ) - hinter->reset( hinter->hints, builder->current->n_points ); - - break; - - case 12: - case 13: - /* counter control hints, clear stack */ - top = decoder->stack; - break; - - case 14: - case 15: - case 16: - case 17: - case 18: /* multiple masters */ - { - PS_Blend blend = decoder->blend; - FT_UInt num_points, nn, mm; - FT_Long* delta; - FT_Long* values; - - - if ( !blend ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " )); - FT_ERROR(( "unexpected multiple masters operator!\n" )); - goto Syntax_Error; - } - - num_points = (FT_UInt)subr_no - 13 + ( subr_no == 18 ); - if ( arg_cnt != (FT_Int)( num_points * blend->num_designs ) ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " )); - FT_ERROR(( "incorrect number of mm arguments\n" )); - goto Syntax_Error; - } - - /* we want to compute: */ - /* */ - /* a0*w0 + a1*w1 + ... + ak*wk */ - /* */ - /* but we only have the a0, a1-a0, a2-a0, .. ak-a0 */ - /* however, given that w0 + w1 + ... + wk == 1, we can */ - /* rewrite it easily as: */ - /* */ - /* a0 + (a1-a0)*w1 + (a2-a0)*w2 + .. + (ak-a0)*wk */ - /* */ - /* where k == num_designs-1 */ - /* */ - /* I guess that's why it's written in this `compact' */ - /* form. */ - /* */ - delta = top + num_points; - values = top; - for ( nn = 0; nn < num_points; nn++ ) - { - FT_Long tmp = values[0]; - - - for ( mm = 1; mm < blend->num_designs; mm++ ) - tmp += FT_MulFix( *delta++, blend->weight_vector[mm] ); - - *values++ = tmp; - } - - known_othersubr_result_cnt = num_points; - break; - } - -#ifdef CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS - - /* We cannot yet enable these since currently */ - /* our T1 stack stores integers which lack the */ - /* precision to express the values */ - - case 19: - /* 1 19 callothersubr */ - /* => replace elements starting from index cvi( ) */ - /* of BuildCharArray with WeightVector */ - { - FT_Int idx; - PS_Blend blend = decoder->blend; - - - if ( arg_cnt != 1 || blend == NULL ) - goto Unexpected_OtherSubr; - - idx = top[0]; - - if ( idx < 0 || - idx + blend->num_designs > decoder->face->len_buildchar ) - goto Unexpected_OtherSubr; - - memcpy( &decoder->buildchar[idx], - blend->weight_vector, - blend->num_designs * - sizeof( blend->weight_vector[ 0 ] ) ); - } - break; - - case 20: - /* 2 20 callothersubr pop */ - /* ==> push + onto T1 stack */ - if ( arg_cnt != 2 ) - goto Unexpected_OtherSubr; - - top[0] += top[1]; /* XXX (over|under)flow */ - - known_othersubr_result_cnt = 1; - break; - - case 21: - /* 2 21 callothersubr pop */ - /* ==> push - onto T1 stack */ - if ( arg_cnt != 2 ) - goto Unexpected_OtherSubr; - - top[0] -= top[1]; /* XXX (over|under)flow */ - - known_othersubr_result_cnt = 1; - break; - - case 22: - /* 2 22 callothersubr pop */ - /* ==> push * onto T1 stack */ - if ( arg_cnt != 2 ) - goto Unexpected_OtherSubr; - - top[0] *= top[1]; /* XXX (over|under)flow */ - - known_othersubr_result_cnt = 1; - break; - - case 23: - /* 2 23 callothersubr pop */ - /* ==> push / onto T1 stack */ - if ( arg_cnt != 2 || top[1] == 0 ) - goto Unexpected_OtherSubr; - - top[0] /= top[1]; /* XXX (over|under)flow */ - - known_othersubr_result_cnt = 1; - break; - -#endif /* CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS */ - - case 24: - /* 2 24 callothersubr */ - /* => set BuildCharArray[cvi( )] = */ - { - FT_Int idx; - PS_Blend blend = decoder->blend; - - if ( arg_cnt != 2 || blend == NULL ) - goto Unexpected_OtherSubr; - - idx = top[1]; - - if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) - goto Unexpected_OtherSubr; - - decoder->buildchar[idx] = top[0]; - } - break; - - case 25: - /* 1 25 callothersubr pop */ - /* => push BuildCharArray[cvi( idx )] */ - /* onto T1 stack */ - { - FT_Int idx; - PS_Blend blend = decoder->blend; - - if ( arg_cnt != 1 || blend == NULL ) - goto Unexpected_OtherSubr; - - idx = top[0]; - - if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) - goto Unexpected_OtherSubr; - - top[0] = decoder->buildchar[idx]; - } - - known_othersubr_result_cnt = 1; - break; - -#if 0 - case 26: - /* mark ==> set BuildCharArray[cvi( )] = , */ - /* leave mark on T1 stack */ - /* ==> set BuildCharArray[cvi( )] = */ - XXX who has left his mark on the (PostScript) stack ?; - break; -#endif - - case 27: - /* 4 27 callothersubr pop */ - /* ==> push onto T1 stack if <= , */ - /* otherwise push */ - if ( arg_cnt != 4 ) - goto Unexpected_OtherSubr; - - if ( top[2] > top[3] ) - top[0] = top[1]; - - known_othersubr_result_cnt = 1; - break; - -#ifdef CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS - case 28: - /* 0 28 callothersubr pop */ - /* => push random value from interval [0, 1) onto stack */ - if ( arg_cnt != 0 ) - goto Unexpected_OtherSubr; - - top[0] = FT_rand(); - known_othersubr_result_cnt = 1; - break; -#endif - - default: - FT_ERROR(( "t1_decoder_parse_charstrings: " - "unknown othersubr [%d %d], wish me luck!\n", - arg_cnt, subr_no )); - unknown_othersubr_result_cnt = arg_cnt; - break; - - Unexpected_OtherSubr: - FT_ERROR(( "t1_decoder_parse_charstrings: " - "invalid othersubr [%d %d]!\n", arg_cnt, subr_no )); - goto Syntax_Error; - } - - top += known_othersubr_result_cnt; - - decoder->top = top; - } - else /* general operator */ - { - FT_Int num_args = t1_args_count[op]; - - - FT_ASSERT( num_args >= 0 ); - - if ( top - decoder->stack < num_args ) - goto Stack_Underflow; - - /* XXX Operators usually take their operands from the */ - /* bottom of the stack, i.e., the operands are */ - /* decoder->stack[0], ..., decoder->stack[num_args - 1]; */ - /* only div, callsubr, and callothersubr are different. */ - /* In practice it doesn't matter (?). */ - -#ifdef FT_DEBUG_LEVEL_TRACE - - switch ( op ) - { - case op_callsubr: - case op_div: - case op_callothersubr: - case op_pop: - case op_return: - break; - - default: - if ( top - decoder->stack != num_args ) - FT_TRACE0(( "t1_decoder_parse_charstrings: " - "too much operands on the stack " - "(seen %d, expected %d)\n", - top - decoder->stack, num_args )); - break; - } - -#endif /* FT_DEBUG_LEVEL_TRACE */ - - top -= num_args; - - switch ( op ) - { - case op_endchar: - FT_TRACE4(( " endchar" )); - - close_contour( builder ); - - /* close hints recording session */ - if ( hinter ) - { - if (hinter->close( hinter->hints, builder->current->n_points )) - goto Syntax_Error; - - /* apply hints to the loaded glyph outline now */ - hinter->apply( hinter->hints, - builder->current, - (PSH_Globals) builder->hints_globals, - decoder->hint_mode ); - } - - /* add current outline to the glyph slot */ - FT_GlyphLoader_Add( builder->loader ); - - FT_TRACE4(( "\n" )); - - /* the compiler should optimize away this empty loop but ... */ - -#ifdef FT_DEBUG_LEVEL_TRACE - - if ( decoder->len_buildchar > 0 ) - { - FT_UInt i; - - - FT_TRACE4(( "BuildCharArray = [ " )); - - for ( i = 0; i < decoder->len_buildchar; ++i ) - FT_TRACE4(( "%d ", decoder->buildchar[ i ] )); - - FT_TRACE4(( "]\n" )); - } - -#endif /* FT_DEBUG_LEVEL_TRACE */ - - FT_TRACE4(( "\n" )); - - /* return now! */ - return PSaux_Err_Ok; - - case op_hsbw: - FT_TRACE4(( " hsbw" )); - - builder->parse_state = T1_Parse_Have_Width; - - builder->left_bearing.x += top[0]; - builder->advance.x = top[1]; - builder->advance.y = 0; - - orig_x = builder->last.x = x = builder->pos_x + top[0]; - orig_y = builder->last.y = y = builder->pos_y; - - FT_UNUSED( orig_y ); - - /* the `metrics_only' indicates that we only want to compute */ - /* the glyph's metrics (lsb + advance width), not load the */ - /* rest of it; so exit immediately */ - if ( builder->metrics_only ) - return PSaux_Err_Ok; - - break; - - case op_seac: - /* return immediately after the processing */ - return t1operator_seac( decoder, top[0], top[1], top[2], - (FT_Int)top[3], (FT_Int)top[4] ); - - case op_sbw: - FT_TRACE4(( " sbw" )); - - builder->parse_state = T1_Parse_Have_Width; - - builder->left_bearing.x += top[0]; - builder->left_bearing.y += top[1]; - builder->advance.x = top[2]; - builder->advance.y = top[3]; - - builder->last.x = x = builder->pos_x + top[0]; - builder->last.y = y = builder->pos_y + top[1]; - - /* the `metrics_only' indicates that we only want to compute */ - /* the glyph's metrics (lsb + advance width), not load the */ - /* rest of it; so exit immediately */ - if ( builder->metrics_only ) - return PSaux_Err_Ok; - - break; - - case op_closepath: - FT_TRACE4(( " closepath" )); - - close_contour( builder ); - if ( !( builder->parse_state == T1_Parse_Have_Path || - builder->parse_state == T1_Parse_Have_Moveto ) ) - goto Syntax_Error; - builder->parse_state = T1_Parse_Have_Width; - break; - - case op_hlineto: - FT_TRACE4(( " hlineto" )); - - if ( start_point( builder, x, y ) ) - goto Fail; - - x += top[0]; - goto Add_Line; - - case op_hmoveto: - FT_TRACE4(( " hmoveto" )); - - x += top[0]; - if ( !decoder->flex_state ) - { - if ( builder->parse_state == T1_Parse_Start ) - goto Syntax_Error; - builder->parse_state = T1_Parse_Have_Moveto; - } - break; - - case op_hvcurveto: - FT_TRACE4(( " hvcurveto" )); - - if ( start_point( builder, x, y ) || - check_points( builder, 3 ) ) - goto Fail; - - x += top[0]; - add_point( builder, x, y, 0 ); - x += top[1]; - y += top[2]; - add_point( builder, x, y, 0 ); - y += top[3]; - add_point( builder, x, y, 1 ); - break; - - case op_rlineto: - FT_TRACE4(( " rlineto" )); - - if ( start_point( builder, x, y ) ) - goto Fail; - - x += top[0]; - y += top[1]; - - Add_Line: - if ( add_point1( builder, x, y ) ) - goto Fail; - break; - - case op_rmoveto: - FT_TRACE4(( " rmoveto" )); - - x += top[0]; - y += top[1]; - if ( !decoder->flex_state ) - { - if ( builder->parse_state == T1_Parse_Start ) - goto Syntax_Error; - builder->parse_state = T1_Parse_Have_Moveto; - } - break; - - case op_rrcurveto: - FT_TRACE4(( " rcurveto" )); - - if ( start_point( builder, x, y ) || - check_points( builder, 3 ) ) - goto Fail; - - x += top[0]; - y += top[1]; - add_point( builder, x, y, 0 ); - - x += top[2]; - y += top[3]; - add_point( builder, x, y, 0 ); - - x += top[4]; - y += top[5]; - add_point( builder, x, y, 1 ); - break; - - case op_vhcurveto: - FT_TRACE4(( " vhcurveto" )); - - if ( start_point( builder, x, y ) || - check_points( builder, 3 ) ) - goto Fail; - - y += top[0]; - add_point( builder, x, y, 0 ); - x += top[1]; - y += top[2]; - add_point( builder, x, y, 0 ); - x += top[3]; - add_point( builder, x, y, 1 ); - break; - - case op_vlineto: - FT_TRACE4(( " vlineto" )); - - if ( start_point( builder, x, y ) ) - goto Fail; - - y += top[0]; - goto Add_Line; - - case op_vmoveto: - FT_TRACE4(( " vmoveto" )); - - y += top[0]; - if ( !decoder->flex_state ) - { - if ( builder->parse_state == T1_Parse_Start ) - goto Syntax_Error; - builder->parse_state = T1_Parse_Have_Moveto; - } - break; - - case op_div: - FT_TRACE4(( " div" )); - - if ( top[1] ) - { - *top = top[0] / top[1]; - ++top; - } - else - { - FT_ERROR(( "t1_decoder_parse_charstrings: division by 0\n" )); - goto Syntax_Error; - } - break; - - case op_callsubr: - { - FT_Int idx; - - - FT_TRACE4(( " callsubr" )); - - idx = (FT_Int)top[0]; - if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "invalid subrs index\n" )); - goto Syntax_Error; - } - - if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "too many nested subrs\n" )); - goto Syntax_Error; - } - - zone->cursor = ip; /* save current instruction pointer */ - - zone++; - - /* The Type 1 driver stores subroutines without the seed bytes. */ - /* The CID driver stores subroutines with seed bytes. This */ - /* case is taken care of when decoder->subrs_len == 0. */ - zone->base = decoder->subrs[idx]; - - if ( decoder->subrs_len ) - zone->limit = zone->base + decoder->subrs_len[idx]; - else - { - /* We are using subroutines from a CID font. We must adjust */ - /* for the seed bytes. */ - zone->base += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 ); - zone->limit = decoder->subrs[idx + 1]; - } - - zone->cursor = zone->base; - - if ( !zone->base ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "invoking empty subrs!\n" )); - goto Syntax_Error; - } - - decoder->zone = zone; - ip = zone->base; - limit = zone->limit; - break; - } - - case op_pop: - FT_TRACE4(( " pop" )); - - if ( known_othersubr_result_cnt > 0 ) - { - known_othersubr_result_cnt--; - /* ignore, we pushed the operands ourselves */ - break; - } - - if ( unknown_othersubr_result_cnt == 0 ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " - "no more operands for othersubr!\n" )); - goto Syntax_Error; - } - - unknown_othersubr_result_cnt--; - top++; /* `push' the operand to callothersubr onto the stack */ - break; - - case op_return: - FT_TRACE4(( " return" )); - - if ( zone <= decoder->zones ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: unexpected return\n" )); - goto Syntax_Error; - } - - zone--; - ip = zone->cursor; - limit = zone->limit; - decoder->zone = zone; - break; - - case op_dotsection: - FT_TRACE4(( " dotsection" )); - - break; - - case op_hstem: - FT_TRACE4(( " hstem" )); - - /* record horizontal hint */ - if ( hinter ) - { - /* top[0] += builder->left_bearing.y; */ - hinter->stem( hinter->hints, 1, top ); - } - - break; - - case op_hstem3: - FT_TRACE4(( " hstem3" )); - - /* record horizontal counter-controlled hints */ - if ( hinter ) - hinter->stem3( hinter->hints, 1, top ); - - break; - - case op_vstem: - FT_TRACE4(( " vstem" )); - - /* record vertical hint */ - if ( hinter ) - { - top[0] += orig_x; - hinter->stem( hinter->hints, 0, top ); - } - - break; - - case op_vstem3: - FT_TRACE4(( " vstem3" )); - - /* record vertical counter-controlled hints */ - if ( hinter ) - { - FT_Pos dx = orig_x; - - - top[0] += dx; - top[2] += dx; - top[4] += dx; - hinter->stem3( hinter->hints, 0, top ); - } - break; - - case op_setcurrentpoint: - FT_TRACE4(( " setcurrentpoint" )); - - /* From the T1 specs, section 6.4: */ - /* */ - /* The setcurrentpoint command is used only in */ - /* conjunction with results from OtherSubrs procedures. */ - - /* known_othersubr_result_cnt != 0 is already handled above */ - if ( decoder->flex_state != 1 ) - { - FT_ERROR(( "t1_decoder_parse_charstrings: " )); - FT_ERROR(( "unexpected `setcurrentpoint'\n" )); - - goto Syntax_Error; - } - else - decoder->flex_state = 0; - break; - - case op_unknown15: - FT_TRACE4(( " opcode_15" )); - /* nothing to do except to pop the two arguments */ - break; - - default: - FT_ERROR(( "t1_decoder_parse_charstrings: " - "unhandled opcode %d\n", op )); - goto Syntax_Error; - } - - /* XXX Operators usually clear the operand stack; */ - /* only div, callsubr, callothersubr, pop, and */ - /* return are different. */ - /* In practice it doesn't matter (?). */ - - decoder->top = top; - - } /* general operator processing */ - - } /* while ip < limit */ - - FT_TRACE4(( "..end..\n\n" )); - - Fail: - return error; - - Syntax_Error: - return PSaux_Err_Syntax_Error; - - Stack_Underflow: - return PSaux_Err_Stack_Underflow; - } - - - /* parse a single Type 1 glyph */ - FT_LOCAL_DEF( FT_Error ) - t1_decoder_parse_glyph( T1_Decoder decoder, - FT_UInt glyph ) - { - return decoder->parse_callback( decoder, glyph ); - } - - - /* initialize T1 decoder */ - FT_LOCAL_DEF( FT_Error ) - t1_decoder_init( T1_Decoder decoder, - FT_Face face, - FT_Size size, - FT_GlyphSlot slot, - FT_Byte** glyph_names, - PS_Blend blend, - FT_Bool hinting, - FT_Render_Mode hint_mode, - T1_Decoder_Callback parse_callback ) - { - FT_MEM_ZERO( decoder, sizeof ( *decoder ) ); - - /* retrieve PSNames interface from list of current modules */ - { - FT_Service_PsCMaps psnames = 0; - - - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); - if ( !psnames ) - { - FT_ERROR(( "t1_decoder_init: " )); - FT_ERROR(( "the `psnames' module is not available\n" )); - return PSaux_Err_Unimplemented_Feature; - } - - decoder->psnames = psnames; - } - - t1_builder_init( &decoder->builder, face, size, slot, hinting ); - - /* decoder->buildchar and decoder->len_buildchar have to be */ - /* initialized by the caller since we cannot know the length */ - /* of the BuildCharArray */ - - decoder->num_glyphs = (FT_UInt)face->num_glyphs; - decoder->glyph_names = glyph_names; - decoder->hint_mode = hint_mode; - decoder->blend = blend; - decoder->parse_callback = parse_callback; - - decoder->funcs = t1_decoder_funcs; - - return PSaux_Err_Ok; - } - - - /* finalize T1 decoder */ - FT_LOCAL_DEF( void ) - t1_decoder_done( T1_Decoder decoder ) - { - t1_builder_done( &decoder->builder ); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t1decode.c */ +/* */ +/* PostScript Type 1 decoding routines (body). */ +/* */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_POSTSCRIPT_HINTS_H +#include FT_OUTLINE_H + +#include "t1decode.h" +#include "psobjs.h" + +#include "psauxerr.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t1decode + + + typedef enum T1_Operator_ + { + op_none = 0, + op_endchar, + op_hsbw, + op_seac, + op_sbw, + op_closepath, + op_hlineto, + op_hmoveto, + op_hvcurveto, + op_rlineto, + op_rmoveto, + op_rrcurveto, + op_vhcurveto, + op_vlineto, + op_vmoveto, + op_dotsection, + op_hstem, + op_hstem3, + op_vstem, + op_vstem3, + op_div, + op_callothersubr, + op_callsubr, + op_pop, + op_return, + op_setcurrentpoint, + op_unknown15, + + op_max /* never remove this one */ + + } T1_Operator; + + + static + const FT_Int t1_args_count[op_max] = + { + 0, /* none */ + 0, /* endchar */ + 2, /* hsbw */ + 5, /* seac */ + 4, /* sbw */ + 0, /* closepath */ + 1, /* hlineto */ + 1, /* hmoveto */ + 4, /* hvcurveto */ + 2, /* rlineto */ + 2, /* rmoveto */ + 6, /* rrcurveto */ + 4, /* vhcurveto */ + 1, /* vlineto */ + 1, /* vmoveto */ + 0, /* dotsection */ + 2, /* hstem */ + 6, /* hstem3 */ + 2, /* vstem */ + 6, /* vstem3 */ + 2, /* div */ + -1, /* callothersubr */ + 1, /* callsubr */ + 0, /* pop */ + 0, /* return */ + 2, /* setcurrentpoint */ + 2 /* opcode 15 (undocumented and obsolete) */ + }; + + + /*************************************************************************/ + /* */ + /* */ + /* t1_lookup_glyph_by_stdcharcode */ + /* */ + /* */ + /* Looks up a given glyph by its StandardEncoding charcode. Used to */ + /* implement the SEAC Type 1 operator. */ + /* */ + /* */ + /* face :: The current face object. */ + /* */ + /* charcode :: The character code to look for. */ + /* */ + /* */ + /* A glyph index in the font face. Returns -1 if the corresponding */ + /* glyph wasn't found. */ + /* */ + static FT_Int + t1_lookup_glyph_by_stdcharcode( T1_Decoder decoder, + FT_Int charcode ) + { + FT_UInt n; + const FT_String* glyph_name; + FT_Service_PsCMaps psnames = decoder->psnames; + + + /* check range of standard char code */ + if ( charcode < 0 || charcode > 255 ) + return -1; + + glyph_name = psnames->adobe_std_strings( + psnames->adobe_std_encoding[charcode]); + + for ( n = 0; n < decoder->num_glyphs; n++ ) + { + FT_String* name = (FT_String*)decoder->glyph_names[n]; + + + if ( name && name[0] == glyph_name[0] && + ft_strcmp( name, glyph_name ) == 0 ) + return n; + } + + return -1; + } + + + /*************************************************************************/ + /* */ + /* */ + /* t1operator_seac */ + /* */ + /* */ + /* Implements the `seac' Type 1 operator for a Type 1 decoder. */ + /* */ + /* */ + /* decoder :: The current CID decoder. */ + /* */ + /* asb :: The accent's side bearing. */ + /* */ + /* adx :: The horizontal offset of the accent. */ + /* */ + /* ady :: The vertical offset of the accent. */ + /* */ + /* bchar :: The base character's StandardEncoding charcode. */ + /* */ + /* achar :: The accent character's StandardEncoding charcode. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + t1operator_seac( T1_Decoder decoder, + FT_Pos asb, + FT_Pos adx, + FT_Pos ady, + FT_Int bchar, + FT_Int achar ) + { + FT_Error error; + FT_Int bchar_index, achar_index; +#if 0 + FT_Int n_base_points; + FT_Outline* base = decoder->builder.base; +#endif + FT_Vector left_bearing, advance; + + + /* seac weirdness */ + adx += decoder->builder.left_bearing.x; + + /* `glyph_names' is set to 0 for CID fonts which do not */ + /* include an encoding. How can we deal with these? */ + if ( decoder->glyph_names == 0 ) + { + FT_ERROR(( "t1operator_seac:" )); + FT_ERROR(( " glyph names table not available in this font!\n" )); + return PSaux_Err_Syntax_Error; + } + + bchar_index = t1_lookup_glyph_by_stdcharcode( decoder, bchar ); + achar_index = t1_lookup_glyph_by_stdcharcode( decoder, achar ); + + if ( bchar_index < 0 || achar_index < 0 ) + { + FT_ERROR(( "t1operator_seac:" )); + FT_ERROR(( " invalid seac character code arguments\n" )); + return PSaux_Err_Syntax_Error; + } + + /* if we are trying to load a composite glyph, do not load the */ + /* accent character and return the array of subglyphs. */ + if ( decoder->builder.no_recurse ) + { + FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph; + FT_GlyphLoader loader = glyph->internal->loader; + FT_SubGlyph subg; + + + /* reallocate subglyph array if necessary */ + error = FT_GlyphLoader_CheckSubGlyphs( loader, 2 ); + if ( error ) + goto Exit; + + subg = loader->current.subglyphs; + + /* subglyph 0 = base character */ + subg->index = bchar_index; + subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES | + FT_SUBGLYPH_FLAG_USE_MY_METRICS; + subg->arg1 = 0; + subg->arg2 = 0; + subg++; + + /* subglyph 1 = accent character */ + subg->index = achar_index; + subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES; + subg->arg1 = (FT_Int)( adx - asb ); + subg->arg2 = (FT_Int)ady; + + /* set up remaining glyph fields */ + glyph->num_subglyphs = 2; + glyph->subglyphs = loader->base.subglyphs; + glyph->format = FT_GLYPH_FORMAT_COMPOSITE; + + loader->current.num_subglyphs = 2; + goto Exit; + } + + /* First load `bchar' in builder */ + /* now load the unscaled outline */ + + FT_GlyphLoader_Prepare( decoder->builder.loader ); /* prepare loader */ + + error = t1_decoder_parse_glyph( decoder, bchar_index ); + if ( error ) + goto Exit; + + /* save the left bearing and width of the base character */ + /* as they will be erased by the next load. */ + + left_bearing = decoder->builder.left_bearing; + advance = decoder->builder.advance; + + decoder->builder.left_bearing.x = 0; + decoder->builder.left_bearing.y = 0; + + decoder->builder.pos_x = adx - asb; + decoder->builder.pos_y = ady; + + /* Now load `achar' on top of */ + /* the base outline */ + error = t1_decoder_parse_glyph( decoder, achar_index ); + if ( error ) + goto Exit; + + /* restore the left side bearing and */ + /* advance width of the base character */ + + decoder->builder.left_bearing = left_bearing; + decoder->builder.advance = advance; + + decoder->builder.pos_x = 0; + decoder->builder.pos_y = 0; + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* t1_decoder_parse_charstrings */ + /* */ + /* */ + /* Parses a given Type 1 charstrings program. */ + /* */ + /* */ + /* decoder :: The current Type 1 decoder. */ + /* */ + /* charstring_base :: The base address of the charstring stream. */ + /* */ + /* charstring_len :: The length in bytes of the charstring stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + t1_decoder_parse_charstrings( T1_Decoder decoder, + FT_Byte* charstring_base, + FT_UInt charstring_len ) + { + FT_Error error; + T1_Decoder_Zone zone; + FT_Byte* ip; + FT_Byte* limit; + T1_Builder builder = &decoder->builder; + FT_Pos x, y, orig_x, orig_y; + FT_Int known_othersubr_result_cnt = 0; + FT_Int unknown_othersubr_result_cnt = 0; + + T1_Hints_Funcs hinter; + + + /* we don't want to touch the source code -- use macro trick */ +#define start_point t1_builder_start_point +#define check_points t1_builder_check_points +#define add_point t1_builder_add_point +#define add_point1 t1_builder_add_point1 +#define add_contour t1_builder_add_contour +#define close_contour t1_builder_close_contour + + /* First of all, initialize the decoder */ + decoder->top = decoder->stack; + decoder->zone = decoder->zones; + zone = decoder->zones; + + builder->parse_state = T1_Parse_Start; + + hinter = (T1_Hints_Funcs)builder->hints_funcs; + + /* a font that reads BuildCharArray without setting */ + /* its values first is buggy, but ... */ + FT_ASSERT( ( decoder->len_buildchar == 0 ) == + ( decoder->buildchar == NULL ) ); + + if ( decoder->len_buildchar > 0 ) + memset( &decoder->buildchar[0], + 0, + sizeof( decoder->buildchar[0] ) * + decoder->len_buildchar ); + + FT_TRACE4(( "\nStart charstring\n" )); + + zone->base = charstring_base; + limit = zone->limit = charstring_base + charstring_len; + ip = zone->cursor = zone->base; + + error = PSaux_Err_Ok; + + x = orig_x = builder->pos_x; + y = orig_y = builder->pos_y; + + /* begin hints recording session, if any */ + if ( hinter ) + hinter->open( hinter->hints ); + + /* now, execute loop */ + while ( ip < limit ) + { + FT_Long* top = decoder->top; + T1_Operator op = op_none; + FT_Long value = 0; + + + FT_ASSERT( known_othersubr_result_cnt == 0 || + unknown_othersubr_result_cnt == 0 ); + + FT_TRACE5(( " (%d)", decoder->top - decoder->stack )); + + /*********************************************************************/ + /* */ + /* Decode operator or operand */ + /* */ + /* */ + + /* first of all, decompress operator or value */ + switch ( *ip++ ) + { + case 1: + op = op_hstem; + break; + + case 3: + op = op_vstem; + break; + case 4: + op = op_vmoveto; + break; + case 5: + op = op_rlineto; + break; + case 6: + op = op_hlineto; + break; + case 7: + op = op_vlineto; + break; + case 8: + op = op_rrcurveto; + break; + case 9: + op = op_closepath; + break; + case 10: + op = op_callsubr; + break; + case 11: + op = op_return; + break; + + case 13: + op = op_hsbw; + break; + case 14: + op = op_endchar; + break; + + case 15: /* undocumented, obsolete operator */ + op = op_unknown15; + break; + + case 21: + op = op_rmoveto; + break; + case 22: + op = op_hmoveto; + break; + + case 30: + op = op_vhcurveto; + break; + case 31: + op = op_hvcurveto; + break; + + case 12: + if ( ip > limit ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "invalid escape (12+EOF)\n" )); + goto Syntax_Error; + } + + switch ( *ip++ ) + { + case 0: + op = op_dotsection; + break; + case 1: + op = op_vstem3; + break; + case 2: + op = op_hstem3; + break; + case 6: + op = op_seac; + break; + case 7: + op = op_sbw; + break; + case 12: + op = op_div; + break; + case 16: + op = op_callothersubr; + break; + case 17: + op = op_pop; + break; + case 33: + op = op_setcurrentpoint; + break; + + default: + FT_ERROR(( "t1_decoder_parse_charstrings: " + "invalid escape (12+%d)\n", + ip[-1] )); + goto Syntax_Error; + } + break; + + case 255: /* four bytes integer */ + if ( ip + 4 > limit ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "unexpected EOF in integer\n" )); + goto Syntax_Error; + } + + value = (FT_Int32)( ((FT_Long)ip[0] << 24) | + ((FT_Long)ip[1] << 16) | + ((FT_Long)ip[2] << 8 ) | + ip[3] ); + ip += 4; + break; + + default: + if ( ip[-1] >= 32 ) + { + if ( ip[-1] < 247 ) + value = (FT_Long)ip[-1] - 139; + else + { + if ( ++ip > limit ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " )); + FT_ERROR(( "unexpected EOF in integer\n" )); + goto Syntax_Error; + } + + if ( ip[-2] < 251 ) + value = ( ( (FT_Long)ip[-2] - 247 ) << 8 ) + ip[-1] + 108; + else + value = -( ( ( (FT_Long)ip[-2] - 251 ) << 8 ) + ip[-1] + 108 ); + } + } + else + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "invalid byte (%d)\n", ip[-1] )); + goto Syntax_Error; + } + } + + if ( unknown_othersubr_result_cnt > 0 ) + { + switch ( op ) + { + case op_callsubr: + case op_return: + case op_none: + case op_pop: + break; + + default: + /* all operands have been transferred by previous pops */ + unknown_othersubr_result_cnt = 0; + break; + } + } + + /*********************************************************************/ + /* */ + /* Push value on stack, or process operator */ + /* */ + /* */ + if ( op == op_none ) + { + if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: stack overflow!\n" )); + goto Syntax_Error; + } + + FT_TRACE4(( " %ld", value )); + + *top++ = value; + decoder->top = top; + } + else if ( op == op_callothersubr ) /* callothersubr */ + { + FT_Int subr_no; + FT_Int arg_cnt; + + + FT_TRACE4(( " callothersubr" )); + + if ( top - decoder->stack < 2 ) + goto Stack_Underflow; + + top -= 2; + + subr_no = (FT_Int)top[1]; + arg_cnt = (FT_Int)top[0]; + + /***********************************************************/ + /* */ + /* remove all operands to callothersubr from the stack */ + /* */ + /* for handled othersubrs, where we know the number of */ + /* arguments, we increase the stack by the value of */ + /* known_othersubr_result_cnt */ + /* */ + /* for unhandled othersubrs the following pops adjust the */ + /* stack pointer as necessary */ + + if ( arg_cnt > top - decoder->stack ) + goto Stack_Underflow; + + top -= arg_cnt; + + known_othersubr_result_cnt = 0; + unknown_othersubr_result_cnt = 0; + + /* XXX TODO: The checks to `arg_count == ' */ + /* might not be correct; an othersubr expects a certain */ + /* number of operands on the PostScript stack (as opposed */ + /* to the T1 stack) but it doesn't have to put them there */ + /* by itself; previous othersubrs might have left the */ + /* operands there if they were not followed by an */ + /* appropriate number of pops */ + /* */ + /* On the other hand, Adobe Reader 7.0.8 for Linux doesn't */ + /* accept a font that contains charstrings like */ + /* */ + /* 100 200 2 20 callothersubr */ + /* 300 1 20 callothersubr pop */ + /* */ + /* Perhaps this is the reason why BuildCharArray exists. */ + + switch ( subr_no ) + { + case 1: /* start flex feature */ + if ( arg_cnt != 0 ) + goto Unexpected_OtherSubr; + + decoder->flex_state = 1; + decoder->num_flex_vectors = 0; + if ( start_point( builder, x, y ) || + check_points( builder, 6 ) ) + goto Fail; + break; + + case 2: /* add flex vectors */ + { + FT_Int idx; + + + if ( arg_cnt != 0 ) + goto Unexpected_OtherSubr; + + /* note that we should not add a point for index 0; */ + /* this will move our current position to the flex */ + /* point without adding any point to the outline */ + idx = decoder->num_flex_vectors++; + if ( idx > 0 && idx < 7 ) + add_point( builder, + x, + y, + (FT_Byte)( idx == 3 || idx == 6 ) ); + } + break; + + case 0: /* end flex feature */ + if ( arg_cnt != 3 ) + goto Unexpected_OtherSubr; + + if ( decoder->flex_state == 0 || + decoder->num_flex_vectors != 7 ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "unexpected flex end\n" )); + goto Syntax_Error; + } + + /* the two `results' are popped by the following setcurrentpoint */ + known_othersubr_result_cnt = 2; + break; + + case 3: /* change hints */ + if ( arg_cnt != 1 ) + goto Unexpected_OtherSubr; + + known_othersubr_result_cnt = 1; + + if ( hinter ) + hinter->reset( hinter->hints, builder->current->n_points ); + + break; + + case 12: + case 13: + /* counter control hints, clear stack */ + top = decoder->stack; + break; + + case 14: + case 15: + case 16: + case 17: + case 18: /* multiple masters */ + { + PS_Blend blend = decoder->blend; + FT_UInt num_points, nn, mm; + FT_Long* delta; + FT_Long* values; + + + if ( !blend ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " )); + FT_ERROR(( "unexpected multiple masters operator!\n" )); + goto Syntax_Error; + } + + num_points = (FT_UInt)subr_no - 13 + ( subr_no == 18 ); + if ( arg_cnt != (FT_Int)( num_points * blend->num_designs ) ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " )); + FT_ERROR(( "incorrect number of mm arguments\n" )); + goto Syntax_Error; + } + + /* we want to compute: */ + /* */ + /* a0*w0 + a1*w1 + ... + ak*wk */ + /* */ + /* but we only have the a0, a1-a0, a2-a0, .. ak-a0 */ + /* however, given that w0 + w1 + ... + wk == 1, we can */ + /* rewrite it easily as: */ + /* */ + /* a0 + (a1-a0)*w1 + (a2-a0)*w2 + .. + (ak-a0)*wk */ + /* */ + /* where k == num_designs-1 */ + /* */ + /* I guess that's why it's written in this `compact' */ + /* form. */ + /* */ + delta = top + num_points; + values = top; + for ( nn = 0; nn < num_points; nn++ ) + { + FT_Long tmp = values[0]; + + + for ( mm = 1; mm < blend->num_designs; mm++ ) + tmp += FT_MulFix( *delta++, blend->weight_vector[mm] ); + + *values++ = tmp; + } + + known_othersubr_result_cnt = num_points; + break; + } + +#ifdef CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS + + /* We cannot yet enable these since currently */ + /* our T1 stack stores integers which lack the */ + /* precision to express the values */ + + case 19: + /* 1 19 callothersubr */ + /* => replace elements starting from index cvi( ) */ + /* of BuildCharArray with WeightVector */ + { + FT_Int idx; + PS_Blend blend = decoder->blend; + + + if ( arg_cnt != 1 || blend == NULL ) + goto Unexpected_OtherSubr; + + idx = top[0]; + + if ( idx < 0 || + idx + blend->num_designs > decoder->face->len_buildchar ) + goto Unexpected_OtherSubr; + + memcpy( &decoder->buildchar[idx], + blend->weight_vector, + blend->num_designs * + sizeof( blend->weight_vector[ 0 ] ) ); + } + break; + + case 20: + /* 2 20 callothersubr pop */ + /* ==> push + onto T1 stack */ + if ( arg_cnt != 2 ) + goto Unexpected_OtherSubr; + + top[0] += top[1]; /* XXX (over|under)flow */ + + known_othersubr_result_cnt = 1; + break; + + case 21: + /* 2 21 callothersubr pop */ + /* ==> push - onto T1 stack */ + if ( arg_cnt != 2 ) + goto Unexpected_OtherSubr; + + top[0] -= top[1]; /* XXX (over|under)flow */ + + known_othersubr_result_cnt = 1; + break; + + case 22: + /* 2 22 callothersubr pop */ + /* ==> push * onto T1 stack */ + if ( arg_cnt != 2 ) + goto Unexpected_OtherSubr; + + top[0] *= top[1]; /* XXX (over|under)flow */ + + known_othersubr_result_cnt = 1; + break; + + case 23: + /* 2 23 callothersubr pop */ + /* ==> push / onto T1 stack */ + if ( arg_cnt != 2 || top[1] == 0 ) + goto Unexpected_OtherSubr; + + top[0] /= top[1]; /* XXX (over|under)flow */ + + known_othersubr_result_cnt = 1; + break; + +#endif /* CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS */ + + case 24: + /* 2 24 callothersubr */ + /* => set BuildCharArray[cvi( )] = */ + { + FT_Int idx; + PS_Blend blend = decoder->blend; + + if ( arg_cnt != 2 || blend == NULL ) + goto Unexpected_OtherSubr; + + idx = top[1]; + + if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) + goto Unexpected_OtherSubr; + + decoder->buildchar[idx] = top[0]; + } + break; + + case 25: + /* 1 25 callothersubr pop */ + /* => push BuildCharArray[cvi( idx )] */ + /* onto T1 stack */ + { + FT_Int idx; + PS_Blend blend = decoder->blend; + + if ( arg_cnt != 1 || blend == NULL ) + goto Unexpected_OtherSubr; + + idx = top[0]; + + if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar ) + goto Unexpected_OtherSubr; + + top[0] = decoder->buildchar[idx]; + } + + known_othersubr_result_cnt = 1; + break; + +#if 0 + case 26: + /* mark ==> set BuildCharArray[cvi( )] = , */ + /* leave mark on T1 stack */ + /* ==> set BuildCharArray[cvi( )] = */ + XXX who has left his mark on the (PostScript) stack ?; + break; +#endif + + case 27: + /* 4 27 callothersubr pop */ + /* ==> push onto T1 stack if <= , */ + /* otherwise push */ + if ( arg_cnt != 4 ) + goto Unexpected_OtherSubr; + + if ( top[2] > top[3] ) + top[0] = top[1]; + + known_othersubr_result_cnt = 1; + break; + +#ifdef CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS + case 28: + /* 0 28 callothersubr pop */ + /* => push random value from interval [0, 1) onto stack */ + if ( arg_cnt != 0 ) + goto Unexpected_OtherSubr; + + top[0] = FT_rand(); + known_othersubr_result_cnt = 1; + break; +#endif + + default: + FT_ERROR(( "t1_decoder_parse_charstrings: " + "unknown othersubr [%d %d], wish me luck!\n", + arg_cnt, subr_no )); + unknown_othersubr_result_cnt = arg_cnt; + break; + + Unexpected_OtherSubr: + FT_ERROR(( "t1_decoder_parse_charstrings: " + "invalid othersubr [%d %d]!\n", arg_cnt, subr_no )); + goto Syntax_Error; + } + + top += known_othersubr_result_cnt; + + decoder->top = top; + } + else /* general operator */ + { + FT_Int num_args = t1_args_count[op]; + + + FT_ASSERT( num_args >= 0 ); + + if ( top - decoder->stack < num_args ) + goto Stack_Underflow; + + /* XXX Operators usually take their operands from the */ + /* bottom of the stack, i.e., the operands are */ + /* decoder->stack[0], ..., decoder->stack[num_args - 1]; */ + /* only div, callsubr, and callothersubr are different. */ + /* In practice it doesn't matter (?). */ + +#ifdef FT_DEBUG_LEVEL_TRACE + + switch ( op ) + { + case op_callsubr: + case op_div: + case op_callothersubr: + case op_pop: + case op_return: + break; + + default: + if ( top - decoder->stack != num_args ) + FT_TRACE0(( "t1_decoder_parse_charstrings: " + "too much operands on the stack " + "(seen %d, expected %d)\n", + top - decoder->stack, num_args )); + break; + } + +#endif /* FT_DEBUG_LEVEL_TRACE */ + + top -= num_args; + + switch ( op ) + { + case op_endchar: + FT_TRACE4(( " endchar" )); + + close_contour( builder ); + + /* close hints recording session */ + if ( hinter ) + { + if (hinter->close( hinter->hints, builder->current->n_points )) + goto Syntax_Error; + + /* apply hints to the loaded glyph outline now */ + hinter->apply( hinter->hints, + builder->current, + (PSH_Globals) builder->hints_globals, + decoder->hint_mode ); + } + + /* add current outline to the glyph slot */ + FT_GlyphLoader_Add( builder->loader ); + + FT_TRACE4(( "\n" )); + + /* the compiler should optimize away this empty loop but ... */ + +#ifdef FT_DEBUG_LEVEL_TRACE + + if ( decoder->len_buildchar > 0 ) + { + FT_UInt i; + + + FT_TRACE4(( "BuildCharArray = [ " )); + + for ( i = 0; i < decoder->len_buildchar; ++i ) + FT_TRACE4(( "%d ", decoder->buildchar[ i ] )); + + FT_TRACE4(( "]\n" )); + } + +#endif /* FT_DEBUG_LEVEL_TRACE */ + + FT_TRACE4(( "\n" )); + + /* return now! */ + return PSaux_Err_Ok; + + case op_hsbw: + FT_TRACE4(( " hsbw" )); + + builder->parse_state = T1_Parse_Have_Width; + + builder->left_bearing.x += top[0]; + builder->advance.x = top[1]; + builder->advance.y = 0; + + orig_x = builder->last.x = x = builder->pos_x + top[0]; + orig_y = builder->last.y = y = builder->pos_y; + + FT_UNUSED( orig_y ); + + /* the `metrics_only' indicates that we only want to compute */ + /* the glyph's metrics (lsb + advance width), not load the */ + /* rest of it; so exit immediately */ + if ( builder->metrics_only ) + return PSaux_Err_Ok; + + break; + + case op_seac: + /* return immediately after the processing */ + return t1operator_seac( decoder, top[0], top[1], top[2], + (FT_Int)top[3], (FT_Int)top[4] ); + + case op_sbw: + FT_TRACE4(( " sbw" )); + + builder->parse_state = T1_Parse_Have_Width; + + builder->left_bearing.x += top[0]; + builder->left_bearing.y += top[1]; + builder->advance.x = top[2]; + builder->advance.y = top[3]; + + builder->last.x = x = builder->pos_x + top[0]; + builder->last.y = y = builder->pos_y + top[1]; + + /* the `metrics_only' indicates that we only want to compute */ + /* the glyph's metrics (lsb + advance width), not load the */ + /* rest of it; so exit immediately */ + if ( builder->metrics_only ) + return PSaux_Err_Ok; + + break; + + case op_closepath: + FT_TRACE4(( " closepath" )); + + close_contour( builder ); + if ( !( builder->parse_state == T1_Parse_Have_Path || + builder->parse_state == T1_Parse_Have_Moveto ) ) + goto Syntax_Error; + builder->parse_state = T1_Parse_Have_Width; + break; + + case op_hlineto: + FT_TRACE4(( " hlineto" )); + + if ( start_point( builder, x, y ) ) + goto Fail; + + x += top[0]; + goto Add_Line; + + case op_hmoveto: + FT_TRACE4(( " hmoveto" )); + + x += top[0]; + if ( !decoder->flex_state ) + { + if ( builder->parse_state == T1_Parse_Start ) + goto Syntax_Error; + builder->parse_state = T1_Parse_Have_Moveto; + } + break; + + case op_hvcurveto: + FT_TRACE4(( " hvcurveto" )); + + if ( start_point( builder, x, y ) || + check_points( builder, 3 ) ) + goto Fail; + + x += top[0]; + add_point( builder, x, y, 0 ); + x += top[1]; + y += top[2]; + add_point( builder, x, y, 0 ); + y += top[3]; + add_point( builder, x, y, 1 ); + break; + + case op_rlineto: + FT_TRACE4(( " rlineto" )); + + if ( start_point( builder, x, y ) ) + goto Fail; + + x += top[0]; + y += top[1]; + + Add_Line: + if ( add_point1( builder, x, y ) ) + goto Fail; + break; + + case op_rmoveto: + FT_TRACE4(( " rmoveto" )); + + x += top[0]; + y += top[1]; + if ( !decoder->flex_state ) + { + if ( builder->parse_state == T1_Parse_Start ) + goto Syntax_Error; + builder->parse_state = T1_Parse_Have_Moveto; + } + break; + + case op_rrcurveto: + FT_TRACE4(( " rcurveto" )); + + if ( start_point( builder, x, y ) || + check_points( builder, 3 ) ) + goto Fail; + + x += top[0]; + y += top[1]; + add_point( builder, x, y, 0 ); + + x += top[2]; + y += top[3]; + add_point( builder, x, y, 0 ); + + x += top[4]; + y += top[5]; + add_point( builder, x, y, 1 ); + break; + + case op_vhcurveto: + FT_TRACE4(( " vhcurveto" )); + + if ( start_point( builder, x, y ) || + check_points( builder, 3 ) ) + goto Fail; + + y += top[0]; + add_point( builder, x, y, 0 ); + x += top[1]; + y += top[2]; + add_point( builder, x, y, 0 ); + x += top[3]; + add_point( builder, x, y, 1 ); + break; + + case op_vlineto: + FT_TRACE4(( " vlineto" )); + + if ( start_point( builder, x, y ) ) + goto Fail; + + y += top[0]; + goto Add_Line; + + case op_vmoveto: + FT_TRACE4(( " vmoveto" )); + + y += top[0]; + if ( !decoder->flex_state ) + { + if ( builder->parse_state == T1_Parse_Start ) + goto Syntax_Error; + builder->parse_state = T1_Parse_Have_Moveto; + } + break; + + case op_div: + FT_TRACE4(( " div" )); + + if ( top[1] ) + { + *top = top[0] / top[1]; + ++top; + } + else + { + FT_ERROR(( "t1_decoder_parse_charstrings: division by 0\n" )); + goto Syntax_Error; + } + break; + + case op_callsubr: + { + FT_Int idx; + + + FT_TRACE4(( " callsubr" )); + + idx = (FT_Int)top[0]; + if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "invalid subrs index\n" )); + goto Syntax_Error; + } + + if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "too many nested subrs\n" )); + goto Syntax_Error; + } + + zone->cursor = ip; /* save current instruction pointer */ + + zone++; + + /* The Type 1 driver stores subroutines without the seed bytes. */ + /* The CID driver stores subroutines with seed bytes. This */ + /* case is taken care of when decoder->subrs_len == 0. */ + zone->base = decoder->subrs[idx]; + + if ( decoder->subrs_len ) + zone->limit = zone->base + decoder->subrs_len[idx]; + else + { + /* We are using subroutines from a CID font. We must adjust */ + /* for the seed bytes. */ + zone->base += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 ); + zone->limit = decoder->subrs[idx + 1]; + } + + zone->cursor = zone->base; + + if ( !zone->base ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "invoking empty subrs!\n" )); + goto Syntax_Error; + } + + decoder->zone = zone; + ip = zone->base; + limit = zone->limit; + break; + } + + case op_pop: + FT_TRACE4(( " pop" )); + + if ( known_othersubr_result_cnt > 0 ) + { + known_othersubr_result_cnt--; + /* ignore, we pushed the operands ourselves */ + break; + } + + if ( unknown_othersubr_result_cnt == 0 ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " + "no more operands for othersubr!\n" )); + goto Syntax_Error; + } + + unknown_othersubr_result_cnt--; + top++; /* `push' the operand to callothersubr onto the stack */ + break; + + case op_return: + FT_TRACE4(( " return" )); + + if ( zone <= decoder->zones ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: unexpected return\n" )); + goto Syntax_Error; + } + + zone--; + ip = zone->cursor; + limit = zone->limit; + decoder->zone = zone; + break; + + case op_dotsection: + FT_TRACE4(( " dotsection" )); + + break; + + case op_hstem: + FT_TRACE4(( " hstem" )); + + /* record horizontal hint */ + if ( hinter ) + { + /* top[0] += builder->left_bearing.y; */ + hinter->stem( hinter->hints, 1, top ); + } + + break; + + case op_hstem3: + FT_TRACE4(( " hstem3" )); + + /* record horizontal counter-controlled hints */ + if ( hinter ) + hinter->stem3( hinter->hints, 1, top ); + + break; + + case op_vstem: + FT_TRACE4(( " vstem" )); + + /* record vertical hint */ + if ( hinter ) + { + top[0] += orig_x; + hinter->stem( hinter->hints, 0, top ); + } + + break; + + case op_vstem3: + FT_TRACE4(( " vstem3" )); + + /* record vertical counter-controlled hints */ + if ( hinter ) + { + FT_Pos dx = orig_x; + + + top[0] += dx; + top[2] += dx; + top[4] += dx; + hinter->stem3( hinter->hints, 0, top ); + } + break; + + case op_setcurrentpoint: + FT_TRACE4(( " setcurrentpoint" )); + + /* From the T1 specs, section 6.4: */ + /* */ + /* The setcurrentpoint command is used only in */ + /* conjunction with results from OtherSubrs procedures. */ + + /* known_othersubr_result_cnt != 0 is already handled above */ + if ( decoder->flex_state != 1 ) + { + FT_ERROR(( "t1_decoder_parse_charstrings: " )); + FT_ERROR(( "unexpected `setcurrentpoint'\n" )); + + goto Syntax_Error; + } + else + decoder->flex_state = 0; + break; + + case op_unknown15: + FT_TRACE4(( " opcode_15" )); + /* nothing to do except to pop the two arguments */ + break; + + default: + FT_ERROR(( "t1_decoder_parse_charstrings: " + "unhandled opcode %d\n", op )); + goto Syntax_Error; + } + + /* XXX Operators usually clear the operand stack; */ + /* only div, callsubr, callothersubr, pop, and */ + /* return are different. */ + /* In practice it doesn't matter (?). */ + + decoder->top = top; + + } /* general operator processing */ + + } /* while ip < limit */ + + FT_TRACE4(( "..end..\n\n" )); + + Fail: + return error; + + Syntax_Error: + return PSaux_Err_Syntax_Error; + + Stack_Underflow: + return PSaux_Err_Stack_Underflow; + } + + + /* parse a single Type 1 glyph */ + FT_LOCAL_DEF( FT_Error ) + t1_decoder_parse_glyph( T1_Decoder decoder, + FT_UInt glyph ) + { + return decoder->parse_callback( decoder, glyph ); + } + + + /* initialize T1 decoder */ + FT_LOCAL_DEF( FT_Error ) + t1_decoder_init( T1_Decoder decoder, + FT_Face face, + FT_Size size, + FT_GlyphSlot slot, + FT_Byte** glyph_names, + PS_Blend blend, + FT_Bool hinting, + FT_Render_Mode hint_mode, + T1_Decoder_Callback parse_callback ) + { + FT_MEM_ZERO( decoder, sizeof ( *decoder ) ); + + /* retrieve PSNames interface from list of current modules */ + { + FT_Service_PsCMaps psnames = 0; + + + FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); + if ( !psnames ) + { + FT_ERROR(( "t1_decoder_init: " )); + FT_ERROR(( "the `psnames' module is not available\n" )); + return PSaux_Err_Unimplemented_Feature; + } + + decoder->psnames = psnames; + } + + t1_builder_init( &decoder->builder, face, size, slot, hinting ); + + /* decoder->buildchar and decoder->len_buildchar have to be */ + /* initialized by the caller since we cannot know the length */ + /* of the BuildCharArray */ + + decoder->num_glyphs = (FT_UInt)face->num_glyphs; + decoder->glyph_names = glyph_names; + decoder->hint_mode = hint_mode; + decoder->blend = blend; + decoder->parse_callback = parse_callback; + + decoder->funcs = t1_decoder_funcs; + + return PSaux_Err_Ok; + } + + + /* finalize T1 decoder */ + FT_LOCAL_DEF( void ) + t1_decoder_done( T1_Decoder decoder ) + { + t1_builder_done( &decoder->builder ); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psaux/t1decode.h b/reactos/dll/3rdparty/freetype/src/psaux/t1decode.h index 00728db501e..4d4a5a3d634 100644 --- a/reactos/dll/3rdparty/freetype/src/psaux/t1decode.h +++ b/reactos/dll/3rdparty/freetype/src/psaux/t1decode.h @@ -1,64 +1,64 @@ -/***************************************************************************/ -/* */ -/* t1decode.h */ -/* */ -/* PostScript Type 1 decoding routines (specification). */ -/* */ -/* Copyright 2000-2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1DECODE_H__ -#define __T1DECODE_H__ - - -#include -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_TYPE1_TYPES_H - - -FT_BEGIN_HEADER - - - FT_CALLBACK_TABLE - const T1_Decoder_FuncsRec t1_decoder_funcs; - - - FT_LOCAL( FT_Error ) - t1_decoder_parse_glyph( T1_Decoder decoder, - FT_UInt glyph_index ); - - FT_LOCAL( FT_Error ) - t1_decoder_parse_charstrings( T1_Decoder decoder, - FT_Byte* base, - FT_UInt len ); - - FT_LOCAL( FT_Error ) - t1_decoder_init( T1_Decoder decoder, - FT_Face face, - FT_Size size, - FT_GlyphSlot slot, - FT_Byte** glyph_names, - PS_Blend blend, - FT_Bool hinting, - FT_Render_Mode hint_mode, - T1_Decoder_Callback parse_glyph ); - - FT_LOCAL( void ) - t1_decoder_done( T1_Decoder decoder ); - - -FT_END_HEADER - -#endif /* __T1DECODE_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1decode.h */ +/* */ +/* PostScript Type 1 decoding routines (specification). */ +/* */ +/* Copyright 2000-2001, 2002, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1DECODE_H__ +#define __T1DECODE_H__ + + +#include +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_INTERNAL_TYPE1_TYPES_H + + +FT_BEGIN_HEADER + + + FT_CALLBACK_TABLE + const T1_Decoder_FuncsRec t1_decoder_funcs; + + + FT_LOCAL( FT_Error ) + t1_decoder_parse_glyph( T1_Decoder decoder, + FT_UInt glyph_index ); + + FT_LOCAL( FT_Error ) + t1_decoder_parse_charstrings( T1_Decoder decoder, + FT_Byte* base, + FT_UInt len ); + + FT_LOCAL( FT_Error ) + t1_decoder_init( T1_Decoder decoder, + FT_Face face, + FT_Size size, + FT_GlyphSlot slot, + FT_Byte** glyph_names, + PS_Blend blend, + FT_Bool hinting, + FT_Render_Mode hint_mode, + T1_Decoder_Callback parse_glyph ); + + FT_LOCAL( void ) + t1_decoder_done( T1_Decoder decoder ); + + +FT_END_HEADER + +#endif /* __T1DECODE_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.c b/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.c index 505d95c5720..060dcb2f55e 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.c +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.c @@ -1,2291 +1,2291 @@ -/***************************************************************************/ -/* */ -/* pshalgo.c */ -/* */ -/* PostScript hinting algorithm (body). */ -/* */ -/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used */ -/* modified and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include "pshalgo.h" - -#include "pshnterr.h" - - -#undef FT_COMPONENT -#define FT_COMPONENT trace_pshalgo2 - - -#ifdef DEBUG_HINTER - PSH_Hint_Table ps_debug_hint_table = 0; - PSH_HintFunc ps_debug_hint_func = 0; - PSH_Glyph ps_debug_glyph = 0; -#endif - - -#define COMPUTE_INFLEXS /* compute inflection points to optimize `S' */ - /* and similar glyphs */ -#define STRONGER /* slightly increase the contrast of smooth */ - /* hinting */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** BASIC HINTS RECORDINGS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* return true if two stem hints overlap */ - static FT_Int - psh_hint_overlap( PSH_Hint hint1, - PSH_Hint hint2 ) - { - return hint1->org_pos + hint1->org_len >= hint2->org_pos && - hint2->org_pos + hint2->org_len >= hint1->org_pos; - } - - - /* destroy hints table */ - static void - psh_hint_table_done( PSH_Hint_Table table, - FT_Memory memory ) - { - FT_FREE( table->zones ); - table->num_zones = 0; - table->zone = 0; - - FT_FREE( table->sort ); - FT_FREE( table->hints ); - table->num_hints = 0; - table->max_hints = 0; - table->sort_global = 0; - } - - - /* deactivate all hints in a table */ - static void - psh_hint_table_deactivate( PSH_Hint_Table table ) - { - FT_UInt count = table->max_hints; - PSH_Hint hint = table->hints; - - - for ( ; count > 0; count--, hint++ ) - { - psh_hint_deactivate( hint ); - hint->order = -1; - } - } - - - /* internal function to record a new hint */ - static void - psh_hint_table_record( PSH_Hint_Table table, - FT_UInt idx ) - { - PSH_Hint hint = table->hints + idx; - - - if ( idx >= table->max_hints ) - { - FT_ERROR(( "psh_hint_table_record: invalid hint index %d\n", idx )); - return; - } - - /* ignore active hints */ - if ( psh_hint_is_active( hint ) ) - return; - - psh_hint_activate( hint ); - - /* now scan the current active hint set to check */ - /* whether `hint' overlaps with another hint */ - { - PSH_Hint* sorted = table->sort_global; - FT_UInt count = table->num_hints; - PSH_Hint hint2; - - - hint->parent = 0; - for ( ; count > 0; count--, sorted++ ) - { - hint2 = sorted[0]; - - if ( psh_hint_overlap( hint, hint2 ) ) - { - hint->parent = hint2; - break; - } - } - } - - if ( table->num_hints < table->max_hints ) - table->sort_global[table->num_hints++] = hint; - else - FT_ERROR(( "psh_hint_table_record: too many sorted hints! BUG!\n" )); - } - - - static void - psh_hint_table_record_mask( PSH_Hint_Table table, - PS_Mask hint_mask ) - { - FT_Int mask = 0, val = 0; - FT_Byte* cursor = hint_mask->bytes; - FT_UInt idx, limit; - - - limit = hint_mask->num_bits; - - for ( idx = 0; idx < limit; idx++ ) - { - if ( mask == 0 ) - { - val = *cursor++; - mask = 0x80; - } - - if ( val & mask ) - psh_hint_table_record( table, idx ); - - mask >>= 1; - } - } - - - /* create hints table */ - static FT_Error - psh_hint_table_init( PSH_Hint_Table table, - PS_Hint_Table hints, - PS_Mask_Table hint_masks, - PS_Mask_Table counter_masks, - FT_Memory memory ) - { - FT_UInt count; - FT_Error error; - - FT_UNUSED( counter_masks ); - - - count = hints->num_hints; - - /* allocate our tables */ - if ( FT_NEW_ARRAY( table->sort, 2 * count ) || - FT_NEW_ARRAY( table->hints, count ) || - FT_NEW_ARRAY( table->zones, 2 * count + 1 ) ) - goto Exit; - - table->max_hints = count; - table->sort_global = table->sort + count; - table->num_hints = 0; - table->num_zones = 0; - table->zone = 0; - - /* initialize the `table->hints' array */ - { - PSH_Hint write = table->hints; - PS_Hint read = hints->hints; - - - for ( ; count > 0; count--, write++, read++ ) - { - write->org_pos = read->pos; - write->org_len = read->len; - write->flags = read->flags; - } - } - - /* we now need to determine the initial `parent' stems; first */ - /* activate the hints that are given by the initial hint masks */ - if ( hint_masks ) - { - PS_Mask mask = hint_masks->masks; - - - count = hint_masks->num_masks; - table->hint_masks = hint_masks; - - for ( ; count > 0; count--, mask++ ) - psh_hint_table_record_mask( table, mask ); - } - - /* finally, do a linear parse in case some hints were left alone */ - if ( table->num_hints != table->max_hints ) - { - FT_UInt idx; - - - FT_ERROR(( "psh_hint_table_init: missing/incorrect hint masks!\n" )); - - count = table->max_hints; - for ( idx = 0; idx < count; idx++ ) - psh_hint_table_record( table, idx ); - } - - Exit: - return error; - } - - - static void - psh_hint_table_activate_mask( PSH_Hint_Table table, - PS_Mask hint_mask ) - { - FT_Int mask = 0, val = 0; - FT_Byte* cursor = hint_mask->bytes; - FT_UInt idx, limit, count; - - - limit = hint_mask->num_bits; - count = 0; - - psh_hint_table_deactivate( table ); - - for ( idx = 0; idx < limit; idx++ ) - { - if ( mask == 0 ) - { - val = *cursor++; - mask = 0x80; - } - - if ( val & mask ) - { - PSH_Hint hint = &table->hints[idx]; - - - if ( !psh_hint_is_active( hint ) ) - { - FT_UInt count2; - -#if 0 - PSH_Hint* sort = table->sort; - PSH_Hint hint2; - - - for ( count2 = count; count2 > 0; count2--, sort++ ) - { - hint2 = sort[0]; - if ( psh_hint_overlap( hint, hint2 ) ) - FT_ERROR(( "psh_hint_table_activate_mask:" - " found overlapping hints\n" )) - } -#else - count2 = 0; -#endif - - if ( count2 == 0 ) - { - psh_hint_activate( hint ); - if ( count < table->max_hints ) - table->sort[count++] = hint; - else - FT_ERROR(( "psh_hint_tableactivate_mask:" - " too many active hints\n" )); - } - } - } - - mask >>= 1; - } - table->num_hints = count; - - /* now, sort the hints; they are guaranteed to not overlap */ - /* so we can compare their "org_pos" field directly */ - { - FT_Int i1, i2; - PSH_Hint hint1, hint2; - PSH_Hint* sort = table->sort; - - - /* a simple bubble sort will do, since in 99% of cases, the hints */ - /* will be already sorted -- and the sort will be linear */ - for ( i1 = 1; i1 < (FT_Int)count; i1++ ) - { - hint1 = sort[i1]; - for ( i2 = i1 - 1; i2 >= 0; i2-- ) - { - hint2 = sort[i2]; - - if ( hint2->org_pos < hint1->org_pos ) - break; - - sort[i2 + 1] = hint2; - sort[i2] = hint1; - } - } - } - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** HINTS GRID-FITTING AND OPTIMIZATION *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#if 1 - static FT_Pos - psh_dimension_quantize_len( PSH_Dimension dim, - FT_Pos len, - FT_Bool do_snapping ) - { - if ( len <= 64 ) - len = 64; - else - { - FT_Pos delta = len - dim->stdw.widths[0].cur; - - - if ( delta < 0 ) - delta = -delta; - - if ( delta < 40 ) - { - len = dim->stdw.widths[0].cur; - if ( len < 48 ) - len = 48; - } - - if ( len < 3 * 64 ) - { - delta = ( len & 63 ); - len &= -64; - - if ( delta < 10 ) - len += delta; - - else if ( delta < 32 ) - len += 10; - - else if ( delta < 54 ) - len += 54; - - else - len += delta; - } - else - len = FT_PIX_ROUND( len ); - } - - if ( do_snapping ) - len = FT_PIX_ROUND( len ); - - return len; - } -#endif /* 0 */ - - -#ifdef DEBUG_HINTER - - static void - ps_simple_scale( PSH_Hint_Table table, - FT_Fixed scale, - FT_Fixed delta, - FT_Int dimension ) - { - PSH_Hint hint; - FT_UInt count; - - - for ( count = 0; count < table->max_hints; count++ ) - { - hint = table->hints + count; - - hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta; - hint->cur_len = FT_MulFix( hint->org_len, scale ); - - if ( ps_debug_hint_func ) - ps_debug_hint_func( hint, dimension ); - } - } - -#endif /* DEBUG_HINTER */ - - - static FT_Fixed - psh_hint_snap_stem_side_delta( FT_Fixed pos, - FT_Fixed len ) - { - FT_Fixed delta1 = FT_PIX_ROUND( pos ) - pos; - FT_Fixed delta2 = FT_PIX_ROUND( pos + len ) - pos - len; - - - if ( FT_ABS( delta1 ) <= FT_ABS( delta2 ) ) - return delta1; - else - return delta2; - } - - - static void - psh_hint_align( PSH_Hint hint, - PSH_Globals globals, - FT_Int dimension, - PSH_Glyph glyph ) - { - PSH_Dimension dim = &globals->dimension[dimension]; - FT_Fixed scale = dim->scale_mult; - FT_Fixed delta = dim->scale_delta; - - - if ( !psh_hint_is_fitted( hint ) ) - { - FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta; - FT_Pos len = FT_MulFix( hint->org_len, scale ); - - FT_Int do_snapping; - FT_Pos fit_len; - PSH_AlignmentRec align; - - - /* ignore stem alignments when requested through the hint flags */ - if ( ( dimension == 0 && !glyph->do_horz_hints ) || - ( dimension == 1 && !glyph->do_vert_hints ) ) - { - hint->cur_pos = pos; - hint->cur_len = len; - - psh_hint_set_fitted( hint ); - return; - } - - /* perform stem snapping when requested - this is necessary - * for monochrome and LCD hinting modes only - */ - do_snapping = ( dimension == 0 && glyph->do_horz_snapping ) || - ( dimension == 1 && glyph->do_vert_snapping ); - - hint->cur_len = fit_len = len; - - /* check blue zones for horizontal stems */ - align.align = PSH_BLUE_ALIGN_NONE; - align.align_bot = align.align_top = 0; - - if ( dimension == 1 ) - psh_blues_snap_stem( &globals->blues, - hint->org_pos + hint->org_len, - hint->org_pos, - &align ); - - switch ( align.align ) - { - case PSH_BLUE_ALIGN_TOP: - /* the top of the stem is aligned against a blue zone */ - hint->cur_pos = align.align_top - fit_len; - break; - - case PSH_BLUE_ALIGN_BOT: - /* the bottom of the stem is aligned against a blue zone */ - hint->cur_pos = align.align_bot; - break; - - case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT: - /* both edges of the stem are aligned against blue zones */ - hint->cur_pos = align.align_bot; - hint->cur_len = align.align_top - align.align_bot; - break; - - default: - { - PSH_Hint parent = hint->parent; - - - if ( parent ) - { - FT_Pos par_org_center, par_cur_center; - FT_Pos cur_org_center, cur_delta; - - - /* ensure that parent is already fitted */ - if ( !psh_hint_is_fitted( parent ) ) - psh_hint_align( parent, globals, dimension, glyph ); - - /* keep original relation between hints, this is, use the */ - /* scaled distance between the centers of the hints to */ - /* compute the new position */ - par_org_center = parent->org_pos + ( parent->org_len >> 1 ); - par_cur_center = parent->cur_pos + ( parent->cur_len >> 1 ); - cur_org_center = hint->org_pos + ( hint->org_len >> 1 ); - - cur_delta = FT_MulFix( cur_org_center - par_org_center, scale ); - pos = par_cur_center + cur_delta - ( len >> 1 ); - } - - hint->cur_pos = pos; - hint->cur_len = fit_len; - - /* Stem adjustment tries to snap stem widths to standard - * ones. This is important to prevent unpleasant rounding - * artefacts. - */ - if ( glyph->do_stem_adjust ) - { - if ( len <= 64 ) - { - /* the stem is less than one pixel; we will center it - * around the nearest pixel center - */ - if ( len >= 32 ) - { - /* This is a special case where we also widen the stem - * and align it to the pixel grid. - * - * stem_center = pos + (len/2) - * nearest_pixel_center = FT_ROUND(stem_center-32)+32 - * new_pos = nearest_pixel_center-32 - * = FT_ROUND(stem_center-32) - * = FT_FLOOR(stem_center-32+32) - * = FT_FLOOR(stem_center) - * new_len = 64 - */ - pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ); - len = 64; - } - else if ( len > 0 ) - { - /* This is a very small stem; we simply align it to the - * pixel grid, trying to find the minimal displacement. - * - * left = pos - * right = pos + len - * left_nearest_edge = ROUND(pos) - * right_nearest_edge = ROUND(right) - * - * if ( ABS(left_nearest_edge - left) <= - * ABS(right_nearest_edge - right) ) - * new_pos = left - * else - * new_pos = right - */ - FT_Pos left_nearest = FT_PIX_ROUND( pos ); - FT_Pos right_nearest = FT_PIX_ROUND( pos + len ); - FT_Pos left_disp = left_nearest - pos; - FT_Pos right_disp = right_nearest - ( pos + len ); - - - if ( left_disp < 0 ) - left_disp = -left_disp; - if ( right_disp < 0 ) - right_disp = -right_disp; - if ( left_disp <= right_disp ) - pos = left_nearest; - else - pos = right_nearest; - } - else - { - /* this is a ghost stem; we simply round it */ - pos = FT_PIX_ROUND( pos ); - } - } - else - { - len = psh_dimension_quantize_len( dim, len, 0 ); - } - } - - /* now that we have a good hinted stem width, try to position */ - /* the stem along a pixel grid integer coordinate */ - hint->cur_pos = pos + psh_hint_snap_stem_side_delta( pos, len ); - hint->cur_len = len; - } - } - - if ( do_snapping ) - { - pos = hint->cur_pos; - len = hint->cur_len; - - if ( len < 64 ) - len = 64; - else - len = FT_PIX_ROUND( len ); - - switch ( align.align ) - { - case PSH_BLUE_ALIGN_TOP: - hint->cur_pos = align.align_top - len; - hint->cur_len = len; - break; - - case PSH_BLUE_ALIGN_BOT: - hint->cur_len = len; - break; - - case PSH_BLUE_ALIGN_BOT | PSH_BLUE_ALIGN_TOP: - /* don't touch */ - break; - - - default: - hint->cur_len = len; - if ( len & 64 ) - pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ) + 32; - else - pos = FT_PIX_ROUND( pos + ( len >> 1 ) ); - - hint->cur_pos = pos - ( len >> 1 ); - hint->cur_len = len; - } - } - - psh_hint_set_fitted( hint ); - -#ifdef DEBUG_HINTER - if ( ps_debug_hint_func ) - ps_debug_hint_func( hint, dimension ); -#endif - } - } - - -#if 0 /* not used for now, experimental */ - - /* - * A variant to perform "light" hinting (i.e. FT_RENDER_MODE_LIGHT) - * of stems - */ - static void - psh_hint_align_light( PSH_Hint hint, - PSH_Globals globals, - FT_Int dimension, - PSH_Glyph glyph ) - { - PSH_Dimension dim = &globals->dimension[dimension]; - FT_Fixed scale = dim->scale_mult; - FT_Fixed delta = dim->scale_delta; - - - if ( !psh_hint_is_fitted( hint ) ) - { - FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta; - FT_Pos len = FT_MulFix( hint->org_len, scale ); - - FT_Pos fit_len; - - PSH_AlignmentRec align; - - - /* ignore stem alignments when requested through the hint flags */ - if ( ( dimension == 0 && !glyph->do_horz_hints ) || - ( dimension == 1 && !glyph->do_vert_hints ) ) - { - hint->cur_pos = pos; - hint->cur_len = len; - - psh_hint_set_fitted( hint ); - return; - } - - fit_len = len; - - hint->cur_len = fit_len; - - /* check blue zones for horizontal stems */ - align.align = PSH_BLUE_ALIGN_NONE; - align.align_bot = align.align_top = 0; - - if ( dimension == 1 ) - psh_blues_snap_stem( &globals->blues, - hint->org_pos + hint->org_len, - hint->org_pos, - &align ); - - switch ( align.align ) - { - case PSH_BLUE_ALIGN_TOP: - /* the top of the stem is aligned against a blue zone */ - hint->cur_pos = align.align_top - fit_len; - break; - - case PSH_BLUE_ALIGN_BOT: - /* the bottom of the stem is aligned against a blue zone */ - hint->cur_pos = align.align_bot; - break; - - case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT: - /* both edges of the stem are aligned against blue zones */ - hint->cur_pos = align.align_bot; - hint->cur_len = align.align_top - align.align_bot; - break; - - default: - { - PSH_Hint parent = hint->parent; - - - if ( parent ) - { - FT_Pos par_org_center, par_cur_center; - FT_Pos cur_org_center, cur_delta; - - - /* ensure that parent is already fitted */ - if ( !psh_hint_is_fitted( parent ) ) - psh_hint_align_light( parent, globals, dimension, glyph ); - - par_org_center = parent->org_pos + ( parent->org_len / 2 ); - par_cur_center = parent->cur_pos + ( parent->cur_len / 2 ); - cur_org_center = hint->org_pos + ( hint->org_len / 2 ); - - cur_delta = FT_MulFix( cur_org_center - par_org_center, scale ); - pos = par_cur_center + cur_delta - ( len >> 1 ); - } - - /* Stems less than one pixel wide are easy -- we want to - * make them as dark as possible, so they must fall within - * one pixel. If the stem is split between two pixels - * then snap the edge that is nearer to the pixel boundary - * to the pixel boundary. - */ - if ( len <= 64 ) - { - if ( ( pos + len + 63 ) / 64 != pos / 64 + 1 ) - pos += psh_hint_snap_stem_side_delta ( pos, len ); - } - - /* Position stems other to minimize the amount of mid-grays. - * There are, in general, two positions that do this, - * illustrated as A) and B) below. - * - * + + + + - * - * A) |--------------------------------| - * B) |--------------------------------| - * C) |--------------------------------| - * - * Position A) (split the excess stem equally) should be better - * for stems of width N + f where f < 0.5. - * - * Position B) (split the deficiency equally) should be better - * for stems of width N + f where f > 0.5. - * - * It turns out though that minimizing the total number of lit - * pixels is also important, so position C), with one edge - * aligned with a pixel boundary is actually preferable - * to A). There are also more possibile positions for C) than - * for A) or B), so it involves less distortion of the overall - * character shape. - */ - else /* len > 64 */ - { - FT_Fixed frac_len = len & 63; - FT_Fixed center = pos + ( len >> 1 ); - FT_Fixed delta_a, delta_b; - - - if ( ( len / 64 ) & 1 ) - { - delta_a = FT_PIX_FLOOR( center ) + 32 - center; - delta_b = FT_PIX_ROUND( center ) - center; - } - else - { - delta_a = FT_PIX_ROUND( center ) - center; - delta_b = FT_PIX_FLOOR( center ) + 32 - center; - } - - /* We choose between B) and C) above based on the amount - * of fractinal stem width; for small amounts, choose - * C) always, for large amounts, B) always, and inbetween, - * pick whichever one involves less stem movement. - */ - if ( frac_len < 32 ) - { - pos += psh_hint_snap_stem_side_delta ( pos, len ); - } - else if ( frac_len < 48 ) - { - FT_Fixed side_delta = psh_hint_snap_stem_side_delta ( pos, - len ); - - if ( FT_ABS( side_delta ) < FT_ABS( delta_b ) ) - pos += side_delta; - else - pos += delta_b; - } - else - { - pos += delta_b; - } - } - - hint->cur_pos = pos; - } - } /* switch */ - - psh_hint_set_fitted( hint ); - -#ifdef DEBUG_HINTER - if ( ps_debug_hint_func ) - ps_debug_hint_func( hint, dimension ); -#endif - } - } - -#endif /* 0 */ - - - static void - psh_hint_table_align_hints( PSH_Hint_Table table, - PSH_Globals globals, - FT_Int dimension, - PSH_Glyph glyph ) - { - PSH_Hint hint; - FT_UInt count; - -#ifdef DEBUG_HINTER - - PSH_Dimension dim = &globals->dimension[dimension]; - FT_Fixed scale = dim->scale_mult; - FT_Fixed delta = dim->scale_delta; - - - if ( ps_debug_no_vert_hints && dimension == 0 ) - { - ps_simple_scale( table, scale, delta, dimension ); - return; - } - - if ( ps_debug_no_horz_hints && dimension == 1 ) - { - ps_simple_scale( table, scale, delta, dimension ); - return; - } - -#endif /* DEBUG_HINTER*/ - - hint = table->hints; - count = table->max_hints; - - for ( ; count > 0; count--, hint++ ) - psh_hint_align( hint, globals, dimension, glyph ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** POINTS INTERPOLATION ROUTINES *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#define PSH_ZONE_MIN -3200000L -#define PSH_ZONE_MAX +3200000L - -#define xxDEBUG_ZONES - - -#ifdef DEBUG_ZONES - -#include - - static void - psh_print_zone( PSH_Zone zone ) - { - printf( "zone [scale,delta,min,max] = [%.3f,%.3f,%d,%d]\n", - zone->scale / 65536.0, - zone->delta / 64.0, - zone->min, - zone->max ); - } - -#else - -#define psh_print_zone( x ) do { } while ( 0 ) - -#endif /* DEBUG_ZONES */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** HINTER GLYPH MANAGEMENT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - -#if 1 - -#define psh_corner_is_flat ft_corner_is_flat -#define psh_corner_orientation ft_corner_orientation - -#else - - FT_LOCAL_DEF( FT_Int ) - psh_corner_is_flat( FT_Pos x_in, - FT_Pos y_in, - FT_Pos x_out, - FT_Pos y_out ) - { - FT_Pos ax = x_in; - FT_Pos ay = y_in; - - FT_Pos d_in, d_out, d_corner; - - - if ( ax < 0 ) - ax = -ax; - if ( ay < 0 ) - ay = -ay; - d_in = ax + ay; - - ax = x_out; - if ( ax < 0 ) - ax = -ax; - ay = y_out; - if ( ay < 0 ) - ay = -ay; - d_out = ax + ay; - - ax = x_out + x_in; - if ( ax < 0 ) - ax = -ax; - ay = y_out + y_in; - if ( ay < 0 ) - ay = -ay; - d_corner = ax + ay; - - return ( d_in + d_out - d_corner ) < ( d_corner >> 4 ); - } - - static FT_Int - psh_corner_orientation( FT_Pos in_x, - FT_Pos in_y, - FT_Pos out_x, - FT_Pos out_y ) - { - FT_Int result; - - - /* deal with the trivial cases quickly */ - if ( in_y == 0 ) - { - if ( in_x >= 0 ) - result = out_y; - else - result = -out_y; - } - else if ( in_x == 0 ) - { - if ( in_y >= 0 ) - result = -out_x; - else - result = out_x; - } - else if ( out_y == 0 ) - { - if ( out_x >= 0 ) - result = in_y; - else - result = -in_y; - } - else if ( out_x == 0 ) - { - if ( out_y >= 0 ) - result = -in_x; - else - result = in_x; - } - else /* general case */ - { - long long delta = (long long)in_x * out_y - (long long)in_y * out_x; - - if ( delta == 0 ) - result = 0; - else - result = 1 - 2 * ( delta < 0 ); - } - - return result; - } - -#endif /* !1 */ - - -#ifdef COMPUTE_INFLEXS - - /* compute all inflex points in a given glyph */ - static void - psh_glyph_compute_inflections( PSH_Glyph glyph ) - { - FT_UInt n; - - - for ( n = 0; n < glyph->num_contours; n++ ) - { - PSH_Point first, start, end, before, after; - FT_Pos in_x, in_y, out_x, out_y; - FT_Int orient_prev, orient_cur; - FT_Int finished = 0; - - - /* we need at least 4 points to create an inflection point */ - if ( glyph->contours[n].count < 4 ) - continue; - - /* compute first segment in contour */ - first = glyph->contours[n].start; - - start = end = first; - do - { - end = end->next; - if ( end == first ) - goto Skip; - - in_x = end->org_u - start->org_u; - in_y = end->org_v - start->org_v; - - } while ( in_x == 0 && in_y == 0 ); - - /* extend the segment start whenever possible */ - before = start; - do - { - do - { - start = before; - before = before->prev; - if ( before == first ) - goto Skip; - - out_x = start->org_u - before->org_u; - out_y = start->org_v - before->org_v; - - } while ( out_x == 0 && out_y == 0 ); - - orient_prev = psh_corner_orientation( in_x, in_y, out_x, out_y ); - - } while ( orient_prev == 0 ); - - first = start; - in_x = out_x; - in_y = out_y; - - /* now, process all segments in the contour */ - do - { - /* first, extend current segment's end whenever possible */ - after = end; - do - { - do - { - end = after; - after = after->next; - if ( after == first ) - finished = 1; - - out_x = after->org_u - end->org_u; - out_y = after->org_v - end->org_v; - - } while ( out_x == 0 && out_y == 0 ); - - orient_cur = psh_corner_orientation( in_x, in_y, out_x, out_y ); - - } while ( orient_cur == 0 ); - - if ( ( orient_cur ^ orient_prev ) < 0 ) - { - do - { - psh_point_set_inflex( start ); - start = start->next; - } - while ( start != end ); - - psh_point_set_inflex( start ); - } - - start = end; - end = after; - orient_prev = orient_cur; - in_x = out_x; - in_y = out_y; - - } while ( !finished ); - - Skip: - ; - } - } - -#endif /* COMPUTE_INFLEXS */ - - - static void - psh_glyph_done( PSH_Glyph glyph ) - { - FT_Memory memory = glyph->memory; - - - psh_hint_table_done( &glyph->hint_tables[1], memory ); - psh_hint_table_done( &glyph->hint_tables[0], memory ); - - FT_FREE( glyph->points ); - FT_FREE( glyph->contours ); - - glyph->num_points = 0; - glyph->num_contours = 0; - - glyph->memory = 0; - } - - - static int - psh_compute_dir( FT_Pos dx, - FT_Pos dy ) - { - FT_Pos ax, ay; - int result = PSH_DIR_NONE; - - - ax = ( dx >= 0 ) ? dx : -dx; - ay = ( dy >= 0 ) ? dy : -dy; - - if ( ay * 12 < ax ) - { - /* |dy| <<< |dx| means a near-horizontal segment */ - result = ( dx >= 0 ) ? PSH_DIR_RIGHT : PSH_DIR_LEFT; - } - else if ( ax * 12 < ay ) - { - /* |dx| <<< |dy| means a near-vertical segment */ - result = ( dy >= 0 ) ? PSH_DIR_UP : PSH_DIR_DOWN; - } - - return result; - } - - - /* load outline point coordinates into hinter glyph */ - static void - psh_glyph_load_points( PSH_Glyph glyph, - FT_Int dimension ) - { - FT_Vector* vec = glyph->outline->points; - PSH_Point point = glyph->points; - FT_UInt count = glyph->num_points; - - - for ( ; count > 0; count--, point++, vec++ ) - { - point->flags2 = 0; - point->hint = NULL; - if ( dimension == 0 ) - { - point->org_u = vec->x; - point->org_v = vec->y; - } - else - { - point->org_u = vec->y; - point->org_v = vec->x; - } - -#ifdef DEBUG_HINTER - point->org_x = vec->x; - point->org_y = vec->y; -#endif - - } - } - - - /* save hinted point coordinates back to outline */ - static void - psh_glyph_save_points( PSH_Glyph glyph, - FT_Int dimension ) - { - FT_UInt n; - PSH_Point point = glyph->points; - FT_Vector* vec = glyph->outline->points; - char* tags = glyph->outline->tags; - - - for ( n = 0; n < glyph->num_points; n++ ) - { - if ( dimension == 0 ) - vec[n].x = point->cur_u; - else - vec[n].y = point->cur_u; - - if ( psh_point_is_strong( point ) ) - tags[n] |= (char)( ( dimension == 0 ) ? 32 : 64 ); - -#ifdef DEBUG_HINTER - - if ( dimension == 0 ) - { - point->cur_x = point->cur_u; - point->flags_x = point->flags2 | point->flags; - } - else - { - point->cur_y = point->cur_u; - point->flags_y = point->flags2 | point->flags; - } - -#endif - - point++; - } - } - - - static FT_Error - psh_glyph_init( PSH_Glyph glyph, - FT_Outline* outline, - PS_Hints ps_hints, - PSH_Globals globals ) - { - FT_Error error; - FT_Memory memory; - - - /* clear all fields */ - FT_MEM_ZERO( glyph, sizeof ( *glyph ) ); - - memory = glyph->memory = globals->memory; - - /* allocate and setup points + contours arrays */ - if ( FT_NEW_ARRAY( glyph->points, outline->n_points ) || - FT_NEW_ARRAY( glyph->contours, outline->n_contours ) ) - goto Exit; - - glyph->num_points = outline->n_points; - glyph->num_contours = outline->n_contours; - - { - FT_UInt first = 0, next, n; - PSH_Point points = glyph->points; - PSH_Contour contour = glyph->contours; - - - for ( n = 0; n < glyph->num_contours; n++ ) - { - FT_Int count; - PSH_Point point; - - - next = outline->contours[n] + 1; - count = next - first; - - contour->start = points + first; - contour->count = (FT_UInt)count; - - if ( count > 0 ) - { - point = points + first; - - point->prev = points + next - 1; - point->contour = contour; - - for ( ; count > 1; count-- ) - { - point[0].next = point + 1; - point[1].prev = point; - point++; - point->contour = contour; - } - point->next = points + first; - } - - contour++; - first = next; - } - } - - { - PSH_Point points = glyph->points; - PSH_Point point = points; - FT_Vector* vec = outline->points; - FT_UInt n; - - - for ( n = 0; n < glyph->num_points; n++, point++ ) - { - FT_Int n_prev = (FT_Int)( point->prev - points ); - FT_Int n_next = (FT_Int)( point->next - points ); - FT_Pos dxi, dyi, dxo, dyo; - - - if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) ) - point->flags = PSH_POINT_OFF; - - dxi = vec[n].x - vec[n_prev].x; - dyi = vec[n].y - vec[n_prev].y; - - point->dir_in = (FT_Char)psh_compute_dir( dxi, dyi ); - - dxo = vec[n_next].x - vec[n].x; - dyo = vec[n_next].y - vec[n].y; - - point->dir_out = (FT_Char)psh_compute_dir( dxo, dyo ); - - /* detect smooth points */ - if ( point->flags & PSH_POINT_OFF ) - point->flags |= PSH_POINT_SMOOTH; - - else if ( point->dir_in == point->dir_out ) - { - if ( point->dir_out != PSH_DIR_NONE || - psh_corner_is_flat( dxi, dyi, dxo, dyo ) ) - point->flags |= PSH_POINT_SMOOTH; - } - } - } - - glyph->outline = outline; - glyph->globals = globals; - -#ifdef COMPUTE_INFLEXS - psh_glyph_load_points( glyph, 0 ); - psh_glyph_compute_inflections( glyph ); -#endif /* COMPUTE_INFLEXS */ - - /* now deal with hints tables */ - error = psh_hint_table_init( &glyph->hint_tables [0], - &ps_hints->dimension[0].hints, - &ps_hints->dimension[0].masks, - &ps_hints->dimension[0].counters, - memory ); - if ( error ) - goto Exit; - - error = psh_hint_table_init( &glyph->hint_tables [1], - &ps_hints->dimension[1].hints, - &ps_hints->dimension[1].masks, - &ps_hints->dimension[1].counters, - memory ); - if ( error ) - goto Exit; - - Exit: - return error; - } - - - /* compute all extrema in a glyph for a given dimension */ - static void - psh_glyph_compute_extrema( PSH_Glyph glyph ) - { - FT_UInt n; - - - /* first of all, compute all local extrema */ - for ( n = 0; n < glyph->num_contours; n++ ) - { - PSH_Point first = glyph->contours[n].start; - PSH_Point point, before, after; - - - if ( glyph->contours[n].count == 0 ) - continue; - - point = first; - before = point; - after = point; - - do - { - before = before->prev; - if ( before == first ) - goto Skip; - - } while ( before->org_u == point->org_u ); - - first = point = before->next; - - for (;;) - { - after = point; - do - { - after = after->next; - if ( after == first ) - goto Next; - - } while ( after->org_u == point->org_u ); - - if ( before->org_u < point->org_u ) - { - if ( after->org_u < point->org_u ) - { - /* local maximum */ - goto Extremum; - } - } - else /* before->org_u > point->org_u */ - { - if ( after->org_u > point->org_u ) - { - /* local minimum */ - Extremum: - do - { - psh_point_set_extremum( point ); - point = point->next; - - } while ( point != after ); - } - } - - before = after->prev; - point = after; - - } /* for */ - - Next: - ; - } - - /* for each extremum, determine its direction along the */ - /* orthogonal axis */ - for ( n = 0; n < glyph->num_points; n++ ) - { - PSH_Point point, before, after; - - - point = &glyph->points[n]; - before = point; - after = point; - - if ( psh_point_is_extremum( point ) ) - { - do - { - before = before->prev; - if ( before == point ) - goto Skip; - - } while ( before->org_v == point->org_v ); - - do - { - after = after->next; - if ( after == point ) - goto Skip; - - } while ( after->org_v == point->org_v ); - } - - if ( before->org_v < point->org_v && - after->org_v > point->org_v ) - { - psh_point_set_positive( point ); - } - else if ( before->org_v > point->org_v && - after->org_v < point->org_v ) - { - psh_point_set_negative( point ); - } - - Skip: - ; - } - } - - - /* major_dir is the direction for points on the bottom/left of the stem; */ - /* Points on the top/right of the stem will have a direction of */ - /* -major_dir. */ - - static void - psh_hint_table_find_strong_points( PSH_Hint_Table table, - PSH_Point point, - FT_UInt count, - FT_Int threshold, - FT_Int major_dir ) - { - PSH_Hint* sort = table->sort; - FT_UInt num_hints = table->num_hints; - - - for ( ; count > 0; count--, point++ ) - { - FT_Int point_dir = 0; - FT_Pos org_u = point->org_u; - - - if ( psh_point_is_strong( point ) ) - continue; - - if ( PSH_DIR_COMPARE( point->dir_in, major_dir ) ) - point_dir = point->dir_in; - - else if ( PSH_DIR_COMPARE( point->dir_out, major_dir ) ) - point_dir = point->dir_out; - - if ( point_dir ) - { - if ( point_dir == major_dir ) - { - FT_UInt nn; - - - for ( nn = 0; nn < num_hints; nn++ ) - { - PSH_Hint hint = sort[nn]; - FT_Pos d = org_u - hint->org_pos; - - - if ( d < threshold && -d < threshold ) - { - psh_point_set_strong( point ); - point->flags2 |= PSH_POINT_EDGE_MIN; - point->hint = hint; - break; - } - } - } - else if ( point_dir == -major_dir ) - { - FT_UInt nn; - - - for ( nn = 0; nn < num_hints; nn++ ) - { - PSH_Hint hint = sort[nn]; - FT_Pos d = org_u - hint->org_pos - hint->org_len; - - - if ( d < threshold && -d < threshold ) - { - psh_point_set_strong( point ); - point->flags2 |= PSH_POINT_EDGE_MAX; - point->hint = hint; - break; - } - } - } - } - -#if 1 - else if ( psh_point_is_extremum( point ) ) - { - /* treat extrema as special cases for stem edge alignment */ - FT_UInt nn, min_flag, max_flag; - - - if ( major_dir == PSH_DIR_HORIZONTAL ) - { - min_flag = PSH_POINT_POSITIVE; - max_flag = PSH_POINT_NEGATIVE; - } - else - { - min_flag = PSH_POINT_NEGATIVE; - max_flag = PSH_POINT_POSITIVE; - } - - if ( point->flags2 & min_flag ) - { - for ( nn = 0; nn < num_hints; nn++ ) - { - PSH_Hint hint = sort[nn]; - FT_Pos d = org_u - hint->org_pos; - - - if ( d < threshold && -d < threshold ) - { - point->flags2 |= PSH_POINT_EDGE_MIN; - point->hint = hint; - psh_point_set_strong( point ); - break; - } - } - } - else if ( point->flags2 & max_flag ) - { - for ( nn = 0; nn < num_hints; nn++ ) - { - PSH_Hint hint = sort[nn]; - FT_Pos d = org_u - hint->org_pos - hint->org_len; - - - if ( d < threshold && -d < threshold ) - { - point->flags2 |= PSH_POINT_EDGE_MAX; - point->hint = hint; - psh_point_set_strong( point ); - break; - } - } - } - - if ( point->hint == NULL ) - { - for ( nn = 0; nn < num_hints; nn++ ) - { - PSH_Hint hint = sort[nn]; - - - if ( org_u >= hint->org_pos && - org_u <= hint->org_pos + hint->org_len ) - { - point->hint = hint; - break; - } - } - } - } - -#endif /* 1 */ - } - } - - - /* the accepted shift for strong points in fractional pixels */ -#define PSH_STRONG_THRESHOLD 32 - - /* the maximum shift value in font units */ -#define PSH_STRONG_THRESHOLD_MAXIMUM 30 - - - /* find strong points in a glyph */ - static void - psh_glyph_find_strong_points( PSH_Glyph glyph, - FT_Int dimension ) - { - /* a point is `strong' if it is located on a stem edge and */ - /* has an `in' or `out' tangent parallel to the hint's direction */ - - PSH_Hint_Table table = &glyph->hint_tables[dimension]; - PS_Mask mask = table->hint_masks->masks; - FT_UInt num_masks = table->hint_masks->num_masks; - FT_UInt first = 0; - FT_Int major_dir = dimension == 0 ? PSH_DIR_VERTICAL - : PSH_DIR_HORIZONTAL; - PSH_Dimension dim = &glyph->globals->dimension[dimension]; - FT_Fixed scale = dim->scale_mult; - FT_Int threshold; - - - threshold = (FT_Int)FT_DivFix( PSH_STRONG_THRESHOLD, scale ); - if ( threshold > PSH_STRONG_THRESHOLD_MAXIMUM ) - threshold = PSH_STRONG_THRESHOLD_MAXIMUM; - - /* process secondary hints to `selected' points */ - if ( num_masks > 1 && glyph->num_points > 0 ) - { - first = mask->end_point; - mask++; - for ( ; num_masks > 1; num_masks--, mask++ ) - { - FT_UInt next; - FT_Int count; - - - next = mask->end_point; - count = next - first; - if ( count > 0 ) - { - PSH_Point point = glyph->points + first; - - - psh_hint_table_activate_mask( table, mask ); - - psh_hint_table_find_strong_points( table, point, count, - threshold, major_dir ); - } - first = next; - } - } - - /* process primary hints for all points */ - if ( num_masks == 1 ) - { - FT_UInt count = glyph->num_points; - PSH_Point point = glyph->points; - - - psh_hint_table_activate_mask( table, table->hint_masks->masks ); - - psh_hint_table_find_strong_points( table, point, count, - threshold, major_dir ); - } - - /* now, certain points may have been attached to a hint and */ - /* not marked as strong; update their flags then */ - { - FT_UInt count = glyph->num_points; - PSH_Point point = glyph->points; - - - for ( ; count > 0; count--, point++ ) - if ( point->hint && !psh_point_is_strong( point ) ) - psh_point_set_strong( point ); - } - } - - - /* find points in a glyph which are in a blue zone and have `in' or */ - /* `out' tangents parallel to the horizontal axis */ - static void - psh_glyph_find_blue_points( PSH_Blues blues, - PSH_Glyph glyph ) - { - PSH_Blue_Table table; - PSH_Blue_Zone zone; - FT_UInt glyph_count = glyph->num_points; - FT_UInt blue_count; - PSH_Point point = glyph->points; - - - for ( ; glyph_count > 0; glyph_count--, point++ ) - { - FT_Pos y; - - - /* check tangents */ - if ( !PSH_DIR_COMPARE( point->dir_in, PSH_DIR_HORIZONTAL ) && - !PSH_DIR_COMPARE( point->dir_out, PSH_DIR_HORIZONTAL ) ) - continue; - - /* skip strong points */ - if ( psh_point_is_strong( point ) ) - continue; - - y = point->org_u; - - /* look up top zones */ - table = &blues->normal_top; - blue_count = table->count; - zone = table->zones; - - for ( ; blue_count > 0; blue_count--, zone++ ) - { - FT_Pos delta = y - zone->org_bottom; - - - if ( delta < -blues->blue_fuzz ) - break; - - if ( y <= zone->org_top + blues->blue_fuzz ) - if ( blues->no_overshoots || delta <= blues->blue_threshold ) - { - point->cur_u = zone->cur_bottom; - psh_point_set_strong( point ); - psh_point_set_fitted( point ); - } - } - - /* look up bottom zones */ - table = &blues->normal_bottom; - blue_count = table->count; - zone = table->zones + blue_count - 1; - - for ( ; blue_count > 0; blue_count--, zone-- ) - { - FT_Pos delta = zone->org_top - y; - - - if ( delta < -blues->blue_fuzz ) - break; - - if ( y >= zone->org_bottom - blues->blue_fuzz ) - if ( blues->no_overshoots || delta < blues->blue_threshold ) - { - point->cur_u = zone->cur_top; - psh_point_set_strong( point ); - psh_point_set_fitted( point ); - } - } - } - } - - - /* interpolate strong points with the help of hinted coordinates */ - static void - psh_glyph_interpolate_strong_points( PSH_Glyph glyph, - FT_Int dimension ) - { - PSH_Dimension dim = &glyph->globals->dimension[dimension]; - FT_Fixed scale = dim->scale_mult; - - FT_UInt count = glyph->num_points; - PSH_Point point = glyph->points; - - - for ( ; count > 0; count--, point++ ) - { - PSH_Hint hint = point->hint; - - - if ( hint ) - { - FT_Pos delta; - - - if ( psh_point_is_edge_min( point ) ) - point->cur_u = hint->cur_pos; - - else if ( psh_point_is_edge_max( point ) ) - point->cur_u = hint->cur_pos + hint->cur_len; - - else - { - delta = point->org_u - hint->org_pos; - - if ( delta <= 0 ) - point->cur_u = hint->cur_pos + FT_MulFix( delta, scale ); - - else if ( delta >= hint->org_len ) - point->cur_u = hint->cur_pos + hint->cur_len + - FT_MulFix( delta - hint->org_len, scale ); - - else if ( hint->org_len > 0 ) - point->cur_u = hint->cur_pos + - FT_MulDiv( delta, hint->cur_len, - hint->org_len ); - else - point->cur_u = hint->cur_pos; - } - psh_point_set_fitted( point ); - } - } - } - - -#define PSH_MAX_STRONG_INTERNAL 16 - - static void - psh_glyph_interpolate_normal_points( PSH_Glyph glyph, - FT_Int dimension ) - { - -#if 1 - /* first technique: a point is strong if it is a local extremum */ - - PSH_Dimension dim = &glyph->globals->dimension[dimension]; - FT_Fixed scale = dim->scale_mult; - FT_Memory memory = glyph->memory; - - PSH_Point* strongs = NULL; - PSH_Point strongs_0[PSH_MAX_STRONG_INTERNAL]; - FT_UInt num_strongs = 0; - - PSH_Point points = glyph->points; - PSH_Point points_end = points + glyph->num_points; - PSH_Point point; - - - /* first count the number of strong points */ - for ( point = points; point < points_end; point++ ) - { - if ( psh_point_is_strong( point ) ) - num_strongs++; - } - - if ( num_strongs == 0 ) /* nothing to do here */ - return; - - /* allocate an array to store a list of points, */ - /* stored in increasing org_u order */ - if ( num_strongs <= PSH_MAX_STRONG_INTERNAL ) - strongs = strongs_0; - else - { - FT_Error error; - - - if ( FT_NEW_ARRAY( strongs, num_strongs ) ) - return; - } - - num_strongs = 0; - for ( point = points; point < points_end; point++ ) - { - PSH_Point* insert; - - - if ( !psh_point_is_strong( point ) ) - continue; - - for ( insert = strongs + num_strongs; insert > strongs; insert-- ) - { - if ( insert[-1]->org_u <= point->org_u ) - break; - - insert[0] = insert[-1]; - } - insert[0] = point; - num_strongs++; - } - - /* now try to interpolate all normal points */ - for ( point = points; point < points_end; point++ ) - { - if ( psh_point_is_strong( point ) ) - continue; - - /* sometimes, some local extrema are smooth points */ - if ( psh_point_is_smooth( point ) ) - { - if ( point->dir_in == PSH_DIR_NONE || - point->dir_in != point->dir_out ) - continue; - - if ( !psh_point_is_extremum( point ) && - !psh_point_is_inflex( point ) ) - continue; - - point->flags &= ~PSH_POINT_SMOOTH; - } - - /* find best enclosing point coordinates then interpolate */ - { - PSH_Point before, after; - FT_UInt nn; - - - for ( nn = 0; nn < num_strongs; nn++ ) - if ( strongs[nn]->org_u > point->org_u ) - break; - - if ( nn == 0 ) /* point before the first strong point */ - { - after = strongs[0]; - - point->cur_u = after->cur_u + - FT_MulFix( point->org_u - after->org_u, - scale ); - } - else - { - before = strongs[nn - 1]; - - for ( nn = num_strongs; nn > 0; nn-- ) - if ( strongs[nn - 1]->org_u < point->org_u ) - break; - - if ( nn == num_strongs ) /* point is after last strong point */ - { - before = strongs[nn - 1]; - - point->cur_u = before->cur_u + - FT_MulFix( point->org_u - before->org_u, - scale ); - } - else - { - FT_Pos u; - - - after = strongs[nn]; - - /* now interpolate point between before and after */ - u = point->org_u; - - if ( u == before->org_u ) - point->cur_u = before->cur_u; - - else if ( u == after->org_u ) - point->cur_u = after->cur_u; - - else - point->cur_u = before->cur_u + - FT_MulDiv( u - before->org_u, - after->cur_u - before->cur_u, - after->org_u - before->org_u ); - } - } - psh_point_set_fitted( point ); - } - } - - if ( strongs != strongs_0 ) - FT_FREE( strongs ); - -#endif /* 1 */ - - } - - - /* interpolate other points */ - static void - psh_glyph_interpolate_other_points( PSH_Glyph glyph, - FT_Int dimension ) - { - PSH_Dimension dim = &glyph->globals->dimension[dimension]; - FT_Fixed scale = dim->scale_mult; - FT_Fixed delta = dim->scale_delta; - PSH_Contour contour = glyph->contours; - FT_UInt num_contours = glyph->num_contours; - - - for ( ; num_contours > 0; num_contours--, contour++ ) - { - PSH_Point start = contour->start; - PSH_Point first, next, point; - FT_UInt fit_count; - - - /* count the number of strong points in this contour */ - next = start + contour->count; - fit_count = 0; - first = 0; - - for ( point = start; point < next; point++ ) - if ( psh_point_is_fitted( point ) ) - { - if ( !first ) - first = point; - - fit_count++; - } - - /* if there are less than 2 fitted points in the contour, we */ - /* simply scale and eventually translate the contour points */ - if ( fit_count < 2 ) - { - if ( fit_count == 1 ) - delta = first->cur_u - FT_MulFix( first->org_u, scale ); - - for ( point = start; point < next; point++ ) - if ( point != first ) - point->cur_u = FT_MulFix( point->org_u, scale ) + delta; - - goto Next_Contour; - } - - /* there are more than 2 strong points in this contour; we */ - /* need to interpolate weak points between them */ - start = first; - do - { - point = first; - - /* skip consecutive fitted points */ - for (;;) - { - next = first->next; - if ( next == start ) - goto Next_Contour; - - if ( !psh_point_is_fitted( next ) ) - break; - - first = next; - } - - /* find next fitted point after unfitted one */ - for (;;) - { - next = next->next; - if ( psh_point_is_fitted( next ) ) - break; - } - - /* now interpolate between them */ - { - FT_Pos org_a, org_ab, cur_a, cur_ab; - FT_Pos org_c, org_ac, cur_c; - FT_Fixed scale_ab; - - - if ( first->org_u <= next->org_u ) - { - org_a = first->org_u; - cur_a = first->cur_u; - org_ab = next->org_u - org_a; - cur_ab = next->cur_u - cur_a; - } - else - { - org_a = next->org_u; - cur_a = next->cur_u; - org_ab = first->org_u - org_a; - cur_ab = first->cur_u - cur_a; - } - - scale_ab = 0x10000L; - if ( org_ab > 0 ) - scale_ab = FT_DivFix( cur_ab, org_ab ); - - point = first->next; - do - { - org_c = point->org_u; - org_ac = org_c - org_a; - - if ( org_ac <= 0 ) - { - /* on the left of the interpolation zone */ - cur_c = cur_a + FT_MulFix( org_ac, scale ); - } - else if ( org_ac >= org_ab ) - { - /* on the right on the interpolation zone */ - cur_c = cur_a + cur_ab + FT_MulFix( org_ac - org_ab, scale ); - } - else - { - /* within the interpolation zone */ - cur_c = cur_a + FT_MulFix( org_ac, scale_ab ); - } - - point->cur_u = cur_c; - - point = point->next; - - } while ( point != next ); - } - - /* keep going until all points in the contours have been processed */ - first = next; - - } while ( first != start ); - - Next_Contour: - ; - } - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** HIGH-LEVEL INTERFACE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - FT_Error - ps_hints_apply( PS_Hints ps_hints, - FT_Outline* outline, - PSH_Globals globals, - FT_Render_Mode hint_mode ) - { - PSH_GlyphRec glyphrec; - PSH_Glyph glyph = &glyphrec; - FT_Error error; -#ifdef DEBUG_HINTER - FT_Memory memory; -#endif - FT_Int dimension; - - - /* something to do? */ - if ( outline->n_points == 0 || outline->n_contours == 0 ) - return PSH_Err_Ok; - -#ifdef DEBUG_HINTER - - memory = globals->memory; - - if ( ps_debug_glyph ) - { - psh_glyph_done( ps_debug_glyph ); - FT_FREE( ps_debug_glyph ); - } - - if ( FT_NEW( glyph ) ) - return error; - - ps_debug_glyph = glyph; - -#endif /* DEBUG_HINTER */ - - error = psh_glyph_init( glyph, outline, ps_hints, globals ); - if ( error ) - goto Exit; - - /* try to optimize the y_scale so that the top of non-capital letters - * is aligned on a pixel boundary whenever possible - */ - { - PSH_Dimension dim_x = &glyph->globals->dimension[0]; - PSH_Dimension dim_y = &glyph->globals->dimension[1]; - - FT_Fixed x_scale = dim_x->scale_mult; - FT_Fixed y_scale = dim_y->scale_mult; - - FT_Fixed scaled; - FT_Fixed fitted; - - - scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale ); - fitted = FT_PIX_ROUND( scaled ); - - if ( fitted != 0 && scaled != fitted ) - { - y_scale = FT_MulDiv( y_scale, fitted, scaled ); - - if ( fitted < scaled ) - x_scale -= x_scale / 50; - - psh_globals_set_scale( glyph->globals, x_scale, y_scale, 0, 0 ); - } - } - - glyph->do_horz_hints = 1; - glyph->do_vert_hints = 1; - - glyph->do_horz_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || - hint_mode == FT_RENDER_MODE_LCD ); - - glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || - hint_mode == FT_RENDER_MODE_LCD_V ); - - glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); - - for ( dimension = 0; dimension < 2; dimension++ ) - { - /* load outline coordinates into glyph */ - psh_glyph_load_points( glyph, dimension ); - - /* compute local extrema */ - psh_glyph_compute_extrema( glyph ); - - /* compute aligned stem/hints positions */ - psh_hint_table_align_hints( &glyph->hint_tables[dimension], - glyph->globals, - dimension, - glyph ); - - /* find strong points, align them, then interpolate others */ - psh_glyph_find_strong_points( glyph, dimension ); - if ( dimension == 1 ) - psh_glyph_find_blue_points( &globals->blues, glyph ); - psh_glyph_interpolate_strong_points( glyph, dimension ); - psh_glyph_interpolate_normal_points( glyph, dimension ); - psh_glyph_interpolate_other_points( glyph, dimension ); - - /* save hinted coordinates back to outline */ - psh_glyph_save_points( glyph, dimension ); - } - - Exit: - -#ifndef DEBUG_HINTER - psh_glyph_done( glyph ); -#endif - - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* pshalgo.c */ +/* */ +/* PostScript hinting algorithm (body). */ +/* */ +/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include "pshalgo.h" + +#include "pshnterr.h" + + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pshalgo2 + + +#ifdef DEBUG_HINTER + PSH_Hint_Table ps_debug_hint_table = 0; + PSH_HintFunc ps_debug_hint_func = 0; + PSH_Glyph ps_debug_glyph = 0; +#endif + + +#define COMPUTE_INFLEXS /* compute inflection points to optimize `S' */ + /* and similar glyphs */ +#define STRONGER /* slightly increase the contrast of smooth */ + /* hinting */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BASIC HINTS RECORDINGS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* return true if two stem hints overlap */ + static FT_Int + psh_hint_overlap( PSH_Hint hint1, + PSH_Hint hint2 ) + { + return hint1->org_pos + hint1->org_len >= hint2->org_pos && + hint2->org_pos + hint2->org_len >= hint1->org_pos; + } + + + /* destroy hints table */ + static void + psh_hint_table_done( PSH_Hint_Table table, + FT_Memory memory ) + { + FT_FREE( table->zones ); + table->num_zones = 0; + table->zone = 0; + + FT_FREE( table->sort ); + FT_FREE( table->hints ); + table->num_hints = 0; + table->max_hints = 0; + table->sort_global = 0; + } + + + /* deactivate all hints in a table */ + static void + psh_hint_table_deactivate( PSH_Hint_Table table ) + { + FT_UInt count = table->max_hints; + PSH_Hint hint = table->hints; + + + for ( ; count > 0; count--, hint++ ) + { + psh_hint_deactivate( hint ); + hint->order = -1; + } + } + + + /* internal function to record a new hint */ + static void + psh_hint_table_record( PSH_Hint_Table table, + FT_UInt idx ) + { + PSH_Hint hint = table->hints + idx; + + + if ( idx >= table->max_hints ) + { + FT_ERROR(( "psh_hint_table_record: invalid hint index %d\n", idx )); + return; + } + + /* ignore active hints */ + if ( psh_hint_is_active( hint ) ) + return; + + psh_hint_activate( hint ); + + /* now scan the current active hint set to check */ + /* whether `hint' overlaps with another hint */ + { + PSH_Hint* sorted = table->sort_global; + FT_UInt count = table->num_hints; + PSH_Hint hint2; + + + hint->parent = 0; + for ( ; count > 0; count--, sorted++ ) + { + hint2 = sorted[0]; + + if ( psh_hint_overlap( hint, hint2 ) ) + { + hint->parent = hint2; + break; + } + } + } + + if ( table->num_hints < table->max_hints ) + table->sort_global[table->num_hints++] = hint; + else + FT_ERROR(( "psh_hint_table_record: too many sorted hints! BUG!\n" )); + } + + + static void + psh_hint_table_record_mask( PSH_Hint_Table table, + PS_Mask hint_mask ) + { + FT_Int mask = 0, val = 0; + FT_Byte* cursor = hint_mask->bytes; + FT_UInt idx, limit; + + + limit = hint_mask->num_bits; + + for ( idx = 0; idx < limit; idx++ ) + { + if ( mask == 0 ) + { + val = *cursor++; + mask = 0x80; + } + + if ( val & mask ) + psh_hint_table_record( table, idx ); + + mask >>= 1; + } + } + + + /* create hints table */ + static FT_Error + psh_hint_table_init( PSH_Hint_Table table, + PS_Hint_Table hints, + PS_Mask_Table hint_masks, + PS_Mask_Table counter_masks, + FT_Memory memory ) + { + FT_UInt count; + FT_Error error; + + FT_UNUSED( counter_masks ); + + + count = hints->num_hints; + + /* allocate our tables */ + if ( FT_NEW_ARRAY( table->sort, 2 * count ) || + FT_NEW_ARRAY( table->hints, count ) || + FT_NEW_ARRAY( table->zones, 2 * count + 1 ) ) + goto Exit; + + table->max_hints = count; + table->sort_global = table->sort + count; + table->num_hints = 0; + table->num_zones = 0; + table->zone = 0; + + /* initialize the `table->hints' array */ + { + PSH_Hint write = table->hints; + PS_Hint read = hints->hints; + + + for ( ; count > 0; count--, write++, read++ ) + { + write->org_pos = read->pos; + write->org_len = read->len; + write->flags = read->flags; + } + } + + /* we now need to determine the initial `parent' stems; first */ + /* activate the hints that are given by the initial hint masks */ + if ( hint_masks ) + { + PS_Mask mask = hint_masks->masks; + + + count = hint_masks->num_masks; + table->hint_masks = hint_masks; + + for ( ; count > 0; count--, mask++ ) + psh_hint_table_record_mask( table, mask ); + } + + /* finally, do a linear parse in case some hints were left alone */ + if ( table->num_hints != table->max_hints ) + { + FT_UInt idx; + + + FT_ERROR(( "psh_hint_table_init: missing/incorrect hint masks!\n" )); + + count = table->max_hints; + for ( idx = 0; idx < count; idx++ ) + psh_hint_table_record( table, idx ); + } + + Exit: + return error; + } + + + static void + psh_hint_table_activate_mask( PSH_Hint_Table table, + PS_Mask hint_mask ) + { + FT_Int mask = 0, val = 0; + FT_Byte* cursor = hint_mask->bytes; + FT_UInt idx, limit, count; + + + limit = hint_mask->num_bits; + count = 0; + + psh_hint_table_deactivate( table ); + + for ( idx = 0; idx < limit; idx++ ) + { + if ( mask == 0 ) + { + val = *cursor++; + mask = 0x80; + } + + if ( val & mask ) + { + PSH_Hint hint = &table->hints[idx]; + + + if ( !psh_hint_is_active( hint ) ) + { + FT_UInt count2; + +#if 0 + PSH_Hint* sort = table->sort; + PSH_Hint hint2; + + + for ( count2 = count; count2 > 0; count2--, sort++ ) + { + hint2 = sort[0]; + if ( psh_hint_overlap( hint, hint2 ) ) + FT_ERROR(( "psh_hint_table_activate_mask:" + " found overlapping hints\n" )) + } +#else + count2 = 0; +#endif + + if ( count2 == 0 ) + { + psh_hint_activate( hint ); + if ( count < table->max_hints ) + table->sort[count++] = hint; + else + FT_ERROR(( "psh_hint_tableactivate_mask:" + " too many active hints\n" )); + } + } + } + + mask >>= 1; + } + table->num_hints = count; + + /* now, sort the hints; they are guaranteed to not overlap */ + /* so we can compare their "org_pos" field directly */ + { + FT_Int i1, i2; + PSH_Hint hint1, hint2; + PSH_Hint* sort = table->sort; + + + /* a simple bubble sort will do, since in 99% of cases, the hints */ + /* will be already sorted -- and the sort will be linear */ + for ( i1 = 1; i1 < (FT_Int)count; i1++ ) + { + hint1 = sort[i1]; + for ( i2 = i1 - 1; i2 >= 0; i2-- ) + { + hint2 = sort[i2]; + + if ( hint2->org_pos < hint1->org_pos ) + break; + + sort[i2 + 1] = hint2; + sort[i2] = hint1; + } + } + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** HINTS GRID-FITTING AND OPTIMIZATION *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#if 1 + static FT_Pos + psh_dimension_quantize_len( PSH_Dimension dim, + FT_Pos len, + FT_Bool do_snapping ) + { + if ( len <= 64 ) + len = 64; + else + { + FT_Pos delta = len - dim->stdw.widths[0].cur; + + + if ( delta < 0 ) + delta = -delta; + + if ( delta < 40 ) + { + len = dim->stdw.widths[0].cur; + if ( len < 48 ) + len = 48; + } + + if ( len < 3 * 64 ) + { + delta = ( len & 63 ); + len &= -64; + + if ( delta < 10 ) + len += delta; + + else if ( delta < 32 ) + len += 10; + + else if ( delta < 54 ) + len += 54; + + else + len += delta; + } + else + len = FT_PIX_ROUND( len ); + } + + if ( do_snapping ) + len = FT_PIX_ROUND( len ); + + return len; + } +#endif /* 0 */ + + +#ifdef DEBUG_HINTER + + static void + ps_simple_scale( PSH_Hint_Table table, + FT_Fixed scale, + FT_Fixed delta, + FT_Int dimension ) + { + PSH_Hint hint; + FT_UInt count; + + + for ( count = 0; count < table->max_hints; count++ ) + { + hint = table->hints + count; + + hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta; + hint->cur_len = FT_MulFix( hint->org_len, scale ); + + if ( ps_debug_hint_func ) + ps_debug_hint_func( hint, dimension ); + } + } + +#endif /* DEBUG_HINTER */ + + + static FT_Fixed + psh_hint_snap_stem_side_delta( FT_Fixed pos, + FT_Fixed len ) + { + FT_Fixed delta1 = FT_PIX_ROUND( pos ) - pos; + FT_Fixed delta2 = FT_PIX_ROUND( pos + len ) - pos - len; + + + if ( FT_ABS( delta1 ) <= FT_ABS( delta2 ) ) + return delta1; + else + return delta2; + } + + + static void + psh_hint_align( PSH_Hint hint, + PSH_Globals globals, + FT_Int dimension, + PSH_Glyph glyph ) + { + PSH_Dimension dim = &globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + + + if ( !psh_hint_is_fitted( hint ) ) + { + FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta; + FT_Pos len = FT_MulFix( hint->org_len, scale ); + + FT_Int do_snapping; + FT_Pos fit_len; + PSH_AlignmentRec align; + + + /* ignore stem alignments when requested through the hint flags */ + if ( ( dimension == 0 && !glyph->do_horz_hints ) || + ( dimension == 1 && !glyph->do_vert_hints ) ) + { + hint->cur_pos = pos; + hint->cur_len = len; + + psh_hint_set_fitted( hint ); + return; + } + + /* perform stem snapping when requested - this is necessary + * for monochrome and LCD hinting modes only + */ + do_snapping = ( dimension == 0 && glyph->do_horz_snapping ) || + ( dimension == 1 && glyph->do_vert_snapping ); + + hint->cur_len = fit_len = len; + + /* check blue zones for horizontal stems */ + align.align = PSH_BLUE_ALIGN_NONE; + align.align_bot = align.align_top = 0; + + if ( dimension == 1 ) + psh_blues_snap_stem( &globals->blues, + hint->org_pos + hint->org_len, + hint->org_pos, + &align ); + + switch ( align.align ) + { + case PSH_BLUE_ALIGN_TOP: + /* the top of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_top - fit_len; + break; + + case PSH_BLUE_ALIGN_BOT: + /* the bottom of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_bot; + break; + + case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT: + /* both edges of the stem are aligned against blue zones */ + hint->cur_pos = align.align_bot; + hint->cur_len = align.align_top - align.align_bot; + break; + + default: + { + PSH_Hint parent = hint->parent; + + + if ( parent ) + { + FT_Pos par_org_center, par_cur_center; + FT_Pos cur_org_center, cur_delta; + + + /* ensure that parent is already fitted */ + if ( !psh_hint_is_fitted( parent ) ) + psh_hint_align( parent, globals, dimension, glyph ); + + /* keep original relation between hints, this is, use the */ + /* scaled distance between the centers of the hints to */ + /* compute the new position */ + par_org_center = parent->org_pos + ( parent->org_len >> 1 ); + par_cur_center = parent->cur_pos + ( parent->cur_len >> 1 ); + cur_org_center = hint->org_pos + ( hint->org_len >> 1 ); + + cur_delta = FT_MulFix( cur_org_center - par_org_center, scale ); + pos = par_cur_center + cur_delta - ( len >> 1 ); + } + + hint->cur_pos = pos; + hint->cur_len = fit_len; + + /* Stem adjustment tries to snap stem widths to standard + * ones. This is important to prevent unpleasant rounding + * artefacts. + */ + if ( glyph->do_stem_adjust ) + { + if ( len <= 64 ) + { + /* the stem is less than one pixel; we will center it + * around the nearest pixel center + */ + if ( len >= 32 ) + { + /* This is a special case where we also widen the stem + * and align it to the pixel grid. + * + * stem_center = pos + (len/2) + * nearest_pixel_center = FT_ROUND(stem_center-32)+32 + * new_pos = nearest_pixel_center-32 + * = FT_ROUND(stem_center-32) + * = FT_FLOOR(stem_center-32+32) + * = FT_FLOOR(stem_center) + * new_len = 64 + */ + pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ); + len = 64; + } + else if ( len > 0 ) + { + /* This is a very small stem; we simply align it to the + * pixel grid, trying to find the minimal displacement. + * + * left = pos + * right = pos + len + * left_nearest_edge = ROUND(pos) + * right_nearest_edge = ROUND(right) + * + * if ( ABS(left_nearest_edge - left) <= + * ABS(right_nearest_edge - right) ) + * new_pos = left + * else + * new_pos = right + */ + FT_Pos left_nearest = FT_PIX_ROUND( pos ); + FT_Pos right_nearest = FT_PIX_ROUND( pos + len ); + FT_Pos left_disp = left_nearest - pos; + FT_Pos right_disp = right_nearest - ( pos + len ); + + + if ( left_disp < 0 ) + left_disp = -left_disp; + if ( right_disp < 0 ) + right_disp = -right_disp; + if ( left_disp <= right_disp ) + pos = left_nearest; + else + pos = right_nearest; + } + else + { + /* this is a ghost stem; we simply round it */ + pos = FT_PIX_ROUND( pos ); + } + } + else + { + len = psh_dimension_quantize_len( dim, len, 0 ); + } + } + + /* now that we have a good hinted stem width, try to position */ + /* the stem along a pixel grid integer coordinate */ + hint->cur_pos = pos + psh_hint_snap_stem_side_delta( pos, len ); + hint->cur_len = len; + } + } + + if ( do_snapping ) + { + pos = hint->cur_pos; + len = hint->cur_len; + + if ( len < 64 ) + len = 64; + else + len = FT_PIX_ROUND( len ); + + switch ( align.align ) + { + case PSH_BLUE_ALIGN_TOP: + hint->cur_pos = align.align_top - len; + hint->cur_len = len; + break; + + case PSH_BLUE_ALIGN_BOT: + hint->cur_len = len; + break; + + case PSH_BLUE_ALIGN_BOT | PSH_BLUE_ALIGN_TOP: + /* don't touch */ + break; + + + default: + hint->cur_len = len; + if ( len & 64 ) + pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ) + 32; + else + pos = FT_PIX_ROUND( pos + ( len >> 1 ) ); + + hint->cur_pos = pos - ( len >> 1 ); + hint->cur_len = len; + } + } + + psh_hint_set_fitted( hint ); + +#ifdef DEBUG_HINTER + if ( ps_debug_hint_func ) + ps_debug_hint_func( hint, dimension ); +#endif + } + } + + +#if 0 /* not used for now, experimental */ + + /* + * A variant to perform "light" hinting (i.e. FT_RENDER_MODE_LIGHT) + * of stems + */ + static void + psh_hint_align_light( PSH_Hint hint, + PSH_Globals globals, + FT_Int dimension, + PSH_Glyph glyph ) + { + PSH_Dimension dim = &globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + + + if ( !psh_hint_is_fitted( hint ) ) + { + FT_Pos pos = FT_MulFix( hint->org_pos, scale ) + delta; + FT_Pos len = FT_MulFix( hint->org_len, scale ); + + FT_Pos fit_len; + + PSH_AlignmentRec align; + + + /* ignore stem alignments when requested through the hint flags */ + if ( ( dimension == 0 && !glyph->do_horz_hints ) || + ( dimension == 1 && !glyph->do_vert_hints ) ) + { + hint->cur_pos = pos; + hint->cur_len = len; + + psh_hint_set_fitted( hint ); + return; + } + + fit_len = len; + + hint->cur_len = fit_len; + + /* check blue zones for horizontal stems */ + align.align = PSH_BLUE_ALIGN_NONE; + align.align_bot = align.align_top = 0; + + if ( dimension == 1 ) + psh_blues_snap_stem( &globals->blues, + hint->org_pos + hint->org_len, + hint->org_pos, + &align ); + + switch ( align.align ) + { + case PSH_BLUE_ALIGN_TOP: + /* the top of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_top - fit_len; + break; + + case PSH_BLUE_ALIGN_BOT: + /* the bottom of the stem is aligned against a blue zone */ + hint->cur_pos = align.align_bot; + break; + + case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT: + /* both edges of the stem are aligned against blue zones */ + hint->cur_pos = align.align_bot; + hint->cur_len = align.align_top - align.align_bot; + break; + + default: + { + PSH_Hint parent = hint->parent; + + + if ( parent ) + { + FT_Pos par_org_center, par_cur_center; + FT_Pos cur_org_center, cur_delta; + + + /* ensure that parent is already fitted */ + if ( !psh_hint_is_fitted( parent ) ) + psh_hint_align_light( parent, globals, dimension, glyph ); + + par_org_center = parent->org_pos + ( parent->org_len / 2 ); + par_cur_center = parent->cur_pos + ( parent->cur_len / 2 ); + cur_org_center = hint->org_pos + ( hint->org_len / 2 ); + + cur_delta = FT_MulFix( cur_org_center - par_org_center, scale ); + pos = par_cur_center + cur_delta - ( len >> 1 ); + } + + /* Stems less than one pixel wide are easy -- we want to + * make them as dark as possible, so they must fall within + * one pixel. If the stem is split between two pixels + * then snap the edge that is nearer to the pixel boundary + * to the pixel boundary. + */ + if ( len <= 64 ) + { + if ( ( pos + len + 63 ) / 64 != pos / 64 + 1 ) + pos += psh_hint_snap_stem_side_delta ( pos, len ); + } + + /* Position stems other to minimize the amount of mid-grays. + * There are, in general, two positions that do this, + * illustrated as A) and B) below. + * + * + + + + + * + * A) |--------------------------------| + * B) |--------------------------------| + * C) |--------------------------------| + * + * Position A) (split the excess stem equally) should be better + * for stems of width N + f where f < 0.5. + * + * Position B) (split the deficiency equally) should be better + * for stems of width N + f where f > 0.5. + * + * It turns out though that minimizing the total number of lit + * pixels is also important, so position C), with one edge + * aligned with a pixel boundary is actually preferable + * to A). There are also more possibile positions for C) than + * for A) or B), so it involves less distortion of the overall + * character shape. + */ + else /* len > 64 */ + { + FT_Fixed frac_len = len & 63; + FT_Fixed center = pos + ( len >> 1 ); + FT_Fixed delta_a, delta_b; + + + if ( ( len / 64 ) & 1 ) + { + delta_a = FT_PIX_FLOOR( center ) + 32 - center; + delta_b = FT_PIX_ROUND( center ) - center; + } + else + { + delta_a = FT_PIX_ROUND( center ) - center; + delta_b = FT_PIX_FLOOR( center ) + 32 - center; + } + + /* We choose between B) and C) above based on the amount + * of fractinal stem width; for small amounts, choose + * C) always, for large amounts, B) always, and inbetween, + * pick whichever one involves less stem movement. + */ + if ( frac_len < 32 ) + { + pos += psh_hint_snap_stem_side_delta ( pos, len ); + } + else if ( frac_len < 48 ) + { + FT_Fixed side_delta = psh_hint_snap_stem_side_delta ( pos, + len ); + + if ( FT_ABS( side_delta ) < FT_ABS( delta_b ) ) + pos += side_delta; + else + pos += delta_b; + } + else + { + pos += delta_b; + } + } + + hint->cur_pos = pos; + } + } /* switch */ + + psh_hint_set_fitted( hint ); + +#ifdef DEBUG_HINTER + if ( ps_debug_hint_func ) + ps_debug_hint_func( hint, dimension ); +#endif + } + } + +#endif /* 0 */ + + + static void + psh_hint_table_align_hints( PSH_Hint_Table table, + PSH_Globals globals, + FT_Int dimension, + PSH_Glyph glyph ) + { + PSH_Hint hint; + FT_UInt count; + +#ifdef DEBUG_HINTER + + PSH_Dimension dim = &globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + + + if ( ps_debug_no_vert_hints && dimension == 0 ) + { + ps_simple_scale( table, scale, delta, dimension ); + return; + } + + if ( ps_debug_no_horz_hints && dimension == 1 ) + { + ps_simple_scale( table, scale, delta, dimension ); + return; + } + +#endif /* DEBUG_HINTER*/ + + hint = table->hints; + count = table->max_hints; + + for ( ; count > 0; count--, hint++ ) + psh_hint_align( hint, globals, dimension, glyph ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** POINTS INTERPOLATION ROUTINES *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#define PSH_ZONE_MIN -3200000L +#define PSH_ZONE_MAX +3200000L + +#define xxDEBUG_ZONES + + +#ifdef DEBUG_ZONES + +#include + + static void + psh_print_zone( PSH_Zone zone ) + { + printf( "zone [scale,delta,min,max] = [%.3f,%.3f,%d,%d]\n", + zone->scale / 65536.0, + zone->delta / 64.0, + zone->min, + zone->max ); + } + +#else + +#define psh_print_zone( x ) do { } while ( 0 ) + +#endif /* DEBUG_ZONES */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** HINTER GLYPH MANAGEMENT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + +#if 1 + +#define psh_corner_is_flat ft_corner_is_flat +#define psh_corner_orientation ft_corner_orientation + +#else + + FT_LOCAL_DEF( FT_Int ) + psh_corner_is_flat( FT_Pos x_in, + FT_Pos y_in, + FT_Pos x_out, + FT_Pos y_out ) + { + FT_Pos ax = x_in; + FT_Pos ay = y_in; + + FT_Pos d_in, d_out, d_corner; + + + if ( ax < 0 ) + ax = -ax; + if ( ay < 0 ) + ay = -ay; + d_in = ax + ay; + + ax = x_out; + if ( ax < 0 ) + ax = -ax; + ay = y_out; + if ( ay < 0 ) + ay = -ay; + d_out = ax + ay; + + ax = x_out + x_in; + if ( ax < 0 ) + ax = -ax; + ay = y_out + y_in; + if ( ay < 0 ) + ay = -ay; + d_corner = ax + ay; + + return ( d_in + d_out - d_corner ) < ( d_corner >> 4 ); + } + + static FT_Int + psh_corner_orientation( FT_Pos in_x, + FT_Pos in_y, + FT_Pos out_x, + FT_Pos out_y ) + { + FT_Int result; + + + /* deal with the trivial cases quickly */ + if ( in_y == 0 ) + { + if ( in_x >= 0 ) + result = out_y; + else + result = -out_y; + } + else if ( in_x == 0 ) + { + if ( in_y >= 0 ) + result = -out_x; + else + result = out_x; + } + else if ( out_y == 0 ) + { + if ( out_x >= 0 ) + result = in_y; + else + result = -in_y; + } + else if ( out_x == 0 ) + { + if ( out_y >= 0 ) + result = -in_x; + else + result = in_x; + } + else /* general case */ + { + long long delta = (long long)in_x * out_y - (long long)in_y * out_x; + + if ( delta == 0 ) + result = 0; + else + result = 1 - 2 * ( delta < 0 ); + } + + return result; + } + +#endif /* !1 */ + + +#ifdef COMPUTE_INFLEXS + + /* compute all inflex points in a given glyph */ + static void + psh_glyph_compute_inflections( PSH_Glyph glyph ) + { + FT_UInt n; + + + for ( n = 0; n < glyph->num_contours; n++ ) + { + PSH_Point first, start, end, before, after; + FT_Pos in_x, in_y, out_x, out_y; + FT_Int orient_prev, orient_cur; + FT_Int finished = 0; + + + /* we need at least 4 points to create an inflection point */ + if ( glyph->contours[n].count < 4 ) + continue; + + /* compute first segment in contour */ + first = glyph->contours[n].start; + + start = end = first; + do + { + end = end->next; + if ( end == first ) + goto Skip; + + in_x = end->org_u - start->org_u; + in_y = end->org_v - start->org_v; + + } while ( in_x == 0 && in_y == 0 ); + + /* extend the segment start whenever possible */ + before = start; + do + { + do + { + start = before; + before = before->prev; + if ( before == first ) + goto Skip; + + out_x = start->org_u - before->org_u; + out_y = start->org_v - before->org_v; + + } while ( out_x == 0 && out_y == 0 ); + + orient_prev = psh_corner_orientation( in_x, in_y, out_x, out_y ); + + } while ( orient_prev == 0 ); + + first = start; + in_x = out_x; + in_y = out_y; + + /* now, process all segments in the contour */ + do + { + /* first, extend current segment's end whenever possible */ + after = end; + do + { + do + { + end = after; + after = after->next; + if ( after == first ) + finished = 1; + + out_x = after->org_u - end->org_u; + out_y = after->org_v - end->org_v; + + } while ( out_x == 0 && out_y == 0 ); + + orient_cur = psh_corner_orientation( in_x, in_y, out_x, out_y ); + + } while ( orient_cur == 0 ); + + if ( ( orient_cur ^ orient_prev ) < 0 ) + { + do + { + psh_point_set_inflex( start ); + start = start->next; + } + while ( start != end ); + + psh_point_set_inflex( start ); + } + + start = end; + end = after; + orient_prev = orient_cur; + in_x = out_x; + in_y = out_y; + + } while ( !finished ); + + Skip: + ; + } + } + +#endif /* COMPUTE_INFLEXS */ + + + static void + psh_glyph_done( PSH_Glyph glyph ) + { + FT_Memory memory = glyph->memory; + + + psh_hint_table_done( &glyph->hint_tables[1], memory ); + psh_hint_table_done( &glyph->hint_tables[0], memory ); + + FT_FREE( glyph->points ); + FT_FREE( glyph->contours ); + + glyph->num_points = 0; + glyph->num_contours = 0; + + glyph->memory = 0; + } + + + static int + psh_compute_dir( FT_Pos dx, + FT_Pos dy ) + { + FT_Pos ax, ay; + int result = PSH_DIR_NONE; + + + ax = ( dx >= 0 ) ? dx : -dx; + ay = ( dy >= 0 ) ? dy : -dy; + + if ( ay * 12 < ax ) + { + /* |dy| <<< |dx| means a near-horizontal segment */ + result = ( dx >= 0 ) ? PSH_DIR_RIGHT : PSH_DIR_LEFT; + } + else if ( ax * 12 < ay ) + { + /* |dx| <<< |dy| means a near-vertical segment */ + result = ( dy >= 0 ) ? PSH_DIR_UP : PSH_DIR_DOWN; + } + + return result; + } + + + /* load outline point coordinates into hinter glyph */ + static void + psh_glyph_load_points( PSH_Glyph glyph, + FT_Int dimension ) + { + FT_Vector* vec = glyph->outline->points; + PSH_Point point = glyph->points; + FT_UInt count = glyph->num_points; + + + for ( ; count > 0; count--, point++, vec++ ) + { + point->flags2 = 0; + point->hint = NULL; + if ( dimension == 0 ) + { + point->org_u = vec->x; + point->org_v = vec->y; + } + else + { + point->org_u = vec->y; + point->org_v = vec->x; + } + +#ifdef DEBUG_HINTER + point->org_x = vec->x; + point->org_y = vec->y; +#endif + + } + } + + + /* save hinted point coordinates back to outline */ + static void + psh_glyph_save_points( PSH_Glyph glyph, + FT_Int dimension ) + { + FT_UInt n; + PSH_Point point = glyph->points; + FT_Vector* vec = glyph->outline->points; + char* tags = glyph->outline->tags; + + + for ( n = 0; n < glyph->num_points; n++ ) + { + if ( dimension == 0 ) + vec[n].x = point->cur_u; + else + vec[n].y = point->cur_u; + + if ( psh_point_is_strong( point ) ) + tags[n] |= (char)( ( dimension == 0 ) ? 32 : 64 ); + +#ifdef DEBUG_HINTER + + if ( dimension == 0 ) + { + point->cur_x = point->cur_u; + point->flags_x = point->flags2 | point->flags; + } + else + { + point->cur_y = point->cur_u; + point->flags_y = point->flags2 | point->flags; + } + +#endif + + point++; + } + } + + + static FT_Error + psh_glyph_init( PSH_Glyph glyph, + FT_Outline* outline, + PS_Hints ps_hints, + PSH_Globals globals ) + { + FT_Error error; + FT_Memory memory; + + + /* clear all fields */ + FT_MEM_ZERO( glyph, sizeof ( *glyph ) ); + + memory = glyph->memory = globals->memory; + + /* allocate and setup points + contours arrays */ + if ( FT_NEW_ARRAY( glyph->points, outline->n_points ) || + FT_NEW_ARRAY( glyph->contours, outline->n_contours ) ) + goto Exit; + + glyph->num_points = outline->n_points; + glyph->num_contours = outline->n_contours; + + { + FT_UInt first = 0, next, n; + PSH_Point points = glyph->points; + PSH_Contour contour = glyph->contours; + + + for ( n = 0; n < glyph->num_contours; n++ ) + { + FT_Int count; + PSH_Point point; + + + next = outline->contours[n] + 1; + count = next - first; + + contour->start = points + first; + contour->count = (FT_UInt)count; + + if ( count > 0 ) + { + point = points + first; + + point->prev = points + next - 1; + point->contour = contour; + + for ( ; count > 1; count-- ) + { + point[0].next = point + 1; + point[1].prev = point; + point++; + point->contour = contour; + } + point->next = points + first; + } + + contour++; + first = next; + } + } + + { + PSH_Point points = glyph->points; + PSH_Point point = points; + FT_Vector* vec = outline->points; + FT_UInt n; + + + for ( n = 0; n < glyph->num_points; n++, point++ ) + { + FT_Int n_prev = (FT_Int)( point->prev - points ); + FT_Int n_next = (FT_Int)( point->next - points ); + FT_Pos dxi, dyi, dxo, dyo; + + + if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) ) + point->flags = PSH_POINT_OFF; + + dxi = vec[n].x - vec[n_prev].x; + dyi = vec[n].y - vec[n_prev].y; + + point->dir_in = (FT_Char)psh_compute_dir( dxi, dyi ); + + dxo = vec[n_next].x - vec[n].x; + dyo = vec[n_next].y - vec[n].y; + + point->dir_out = (FT_Char)psh_compute_dir( dxo, dyo ); + + /* detect smooth points */ + if ( point->flags & PSH_POINT_OFF ) + point->flags |= PSH_POINT_SMOOTH; + + else if ( point->dir_in == point->dir_out ) + { + if ( point->dir_out != PSH_DIR_NONE || + psh_corner_is_flat( dxi, dyi, dxo, dyo ) ) + point->flags |= PSH_POINT_SMOOTH; + } + } + } + + glyph->outline = outline; + glyph->globals = globals; + +#ifdef COMPUTE_INFLEXS + psh_glyph_load_points( glyph, 0 ); + psh_glyph_compute_inflections( glyph ); +#endif /* COMPUTE_INFLEXS */ + + /* now deal with hints tables */ + error = psh_hint_table_init( &glyph->hint_tables [0], + &ps_hints->dimension[0].hints, + &ps_hints->dimension[0].masks, + &ps_hints->dimension[0].counters, + memory ); + if ( error ) + goto Exit; + + error = psh_hint_table_init( &glyph->hint_tables [1], + &ps_hints->dimension[1].hints, + &ps_hints->dimension[1].masks, + &ps_hints->dimension[1].counters, + memory ); + if ( error ) + goto Exit; + + Exit: + return error; + } + + + /* compute all extrema in a glyph for a given dimension */ + static void + psh_glyph_compute_extrema( PSH_Glyph glyph ) + { + FT_UInt n; + + + /* first of all, compute all local extrema */ + for ( n = 0; n < glyph->num_contours; n++ ) + { + PSH_Point first = glyph->contours[n].start; + PSH_Point point, before, after; + + + if ( glyph->contours[n].count == 0 ) + continue; + + point = first; + before = point; + after = point; + + do + { + before = before->prev; + if ( before == first ) + goto Skip; + + } while ( before->org_u == point->org_u ); + + first = point = before->next; + + for (;;) + { + after = point; + do + { + after = after->next; + if ( after == first ) + goto Next; + + } while ( after->org_u == point->org_u ); + + if ( before->org_u < point->org_u ) + { + if ( after->org_u < point->org_u ) + { + /* local maximum */ + goto Extremum; + } + } + else /* before->org_u > point->org_u */ + { + if ( after->org_u > point->org_u ) + { + /* local minimum */ + Extremum: + do + { + psh_point_set_extremum( point ); + point = point->next; + + } while ( point != after ); + } + } + + before = after->prev; + point = after; + + } /* for */ + + Next: + ; + } + + /* for each extremum, determine its direction along the */ + /* orthogonal axis */ + for ( n = 0; n < glyph->num_points; n++ ) + { + PSH_Point point, before, after; + + + point = &glyph->points[n]; + before = point; + after = point; + + if ( psh_point_is_extremum( point ) ) + { + do + { + before = before->prev; + if ( before == point ) + goto Skip; + + } while ( before->org_v == point->org_v ); + + do + { + after = after->next; + if ( after == point ) + goto Skip; + + } while ( after->org_v == point->org_v ); + } + + if ( before->org_v < point->org_v && + after->org_v > point->org_v ) + { + psh_point_set_positive( point ); + } + else if ( before->org_v > point->org_v && + after->org_v < point->org_v ) + { + psh_point_set_negative( point ); + } + + Skip: + ; + } + } + + + /* major_dir is the direction for points on the bottom/left of the stem; */ + /* Points on the top/right of the stem will have a direction of */ + /* -major_dir. */ + + static void + psh_hint_table_find_strong_points( PSH_Hint_Table table, + PSH_Point point, + FT_UInt count, + FT_Int threshold, + FT_Int major_dir ) + { + PSH_Hint* sort = table->sort; + FT_UInt num_hints = table->num_hints; + + + for ( ; count > 0; count--, point++ ) + { + FT_Int point_dir = 0; + FT_Pos org_u = point->org_u; + + + if ( psh_point_is_strong( point ) ) + continue; + + if ( PSH_DIR_COMPARE( point->dir_in, major_dir ) ) + point_dir = point->dir_in; + + else if ( PSH_DIR_COMPARE( point->dir_out, major_dir ) ) + point_dir = point->dir_out; + + if ( point_dir ) + { + if ( point_dir == major_dir ) + { + FT_UInt nn; + + + for ( nn = 0; nn < num_hints; nn++ ) + { + PSH_Hint hint = sort[nn]; + FT_Pos d = org_u - hint->org_pos; + + + if ( d < threshold && -d < threshold ) + { + psh_point_set_strong( point ); + point->flags2 |= PSH_POINT_EDGE_MIN; + point->hint = hint; + break; + } + } + } + else if ( point_dir == -major_dir ) + { + FT_UInt nn; + + + for ( nn = 0; nn < num_hints; nn++ ) + { + PSH_Hint hint = sort[nn]; + FT_Pos d = org_u - hint->org_pos - hint->org_len; + + + if ( d < threshold && -d < threshold ) + { + psh_point_set_strong( point ); + point->flags2 |= PSH_POINT_EDGE_MAX; + point->hint = hint; + break; + } + } + } + } + +#if 1 + else if ( psh_point_is_extremum( point ) ) + { + /* treat extrema as special cases for stem edge alignment */ + FT_UInt nn, min_flag, max_flag; + + + if ( major_dir == PSH_DIR_HORIZONTAL ) + { + min_flag = PSH_POINT_POSITIVE; + max_flag = PSH_POINT_NEGATIVE; + } + else + { + min_flag = PSH_POINT_NEGATIVE; + max_flag = PSH_POINT_POSITIVE; + } + + if ( point->flags2 & min_flag ) + { + for ( nn = 0; nn < num_hints; nn++ ) + { + PSH_Hint hint = sort[nn]; + FT_Pos d = org_u - hint->org_pos; + + + if ( d < threshold && -d < threshold ) + { + point->flags2 |= PSH_POINT_EDGE_MIN; + point->hint = hint; + psh_point_set_strong( point ); + break; + } + } + } + else if ( point->flags2 & max_flag ) + { + for ( nn = 0; nn < num_hints; nn++ ) + { + PSH_Hint hint = sort[nn]; + FT_Pos d = org_u - hint->org_pos - hint->org_len; + + + if ( d < threshold && -d < threshold ) + { + point->flags2 |= PSH_POINT_EDGE_MAX; + point->hint = hint; + psh_point_set_strong( point ); + break; + } + } + } + + if ( point->hint == NULL ) + { + for ( nn = 0; nn < num_hints; nn++ ) + { + PSH_Hint hint = sort[nn]; + + + if ( org_u >= hint->org_pos && + org_u <= hint->org_pos + hint->org_len ) + { + point->hint = hint; + break; + } + } + } + } + +#endif /* 1 */ + } + } + + + /* the accepted shift for strong points in fractional pixels */ +#define PSH_STRONG_THRESHOLD 32 + + /* the maximum shift value in font units */ +#define PSH_STRONG_THRESHOLD_MAXIMUM 30 + + + /* find strong points in a glyph */ + static void + psh_glyph_find_strong_points( PSH_Glyph glyph, + FT_Int dimension ) + { + /* a point is `strong' if it is located on a stem edge and */ + /* has an `in' or `out' tangent parallel to the hint's direction */ + + PSH_Hint_Table table = &glyph->hint_tables[dimension]; + PS_Mask mask = table->hint_masks->masks; + FT_UInt num_masks = table->hint_masks->num_masks; + FT_UInt first = 0; + FT_Int major_dir = dimension == 0 ? PSH_DIR_VERTICAL + : PSH_DIR_HORIZONTAL; + PSH_Dimension dim = &glyph->globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Int threshold; + + + threshold = (FT_Int)FT_DivFix( PSH_STRONG_THRESHOLD, scale ); + if ( threshold > PSH_STRONG_THRESHOLD_MAXIMUM ) + threshold = PSH_STRONG_THRESHOLD_MAXIMUM; + + /* process secondary hints to `selected' points */ + if ( num_masks > 1 && glyph->num_points > 0 ) + { + first = mask->end_point; + mask++; + for ( ; num_masks > 1; num_masks--, mask++ ) + { + FT_UInt next; + FT_Int count; + + + next = mask->end_point; + count = next - first; + if ( count > 0 ) + { + PSH_Point point = glyph->points + first; + + + psh_hint_table_activate_mask( table, mask ); + + psh_hint_table_find_strong_points( table, point, count, + threshold, major_dir ); + } + first = next; + } + } + + /* process primary hints for all points */ + if ( num_masks == 1 ) + { + FT_UInt count = glyph->num_points; + PSH_Point point = glyph->points; + + + psh_hint_table_activate_mask( table, table->hint_masks->masks ); + + psh_hint_table_find_strong_points( table, point, count, + threshold, major_dir ); + } + + /* now, certain points may have been attached to a hint and */ + /* not marked as strong; update their flags then */ + { + FT_UInt count = glyph->num_points; + PSH_Point point = glyph->points; + + + for ( ; count > 0; count--, point++ ) + if ( point->hint && !psh_point_is_strong( point ) ) + psh_point_set_strong( point ); + } + } + + + /* find points in a glyph which are in a blue zone and have `in' or */ + /* `out' tangents parallel to the horizontal axis */ + static void + psh_glyph_find_blue_points( PSH_Blues blues, + PSH_Glyph glyph ) + { + PSH_Blue_Table table; + PSH_Blue_Zone zone; + FT_UInt glyph_count = glyph->num_points; + FT_UInt blue_count; + PSH_Point point = glyph->points; + + + for ( ; glyph_count > 0; glyph_count--, point++ ) + { + FT_Pos y; + + + /* check tangents */ + if ( !PSH_DIR_COMPARE( point->dir_in, PSH_DIR_HORIZONTAL ) && + !PSH_DIR_COMPARE( point->dir_out, PSH_DIR_HORIZONTAL ) ) + continue; + + /* skip strong points */ + if ( psh_point_is_strong( point ) ) + continue; + + y = point->org_u; + + /* look up top zones */ + table = &blues->normal_top; + blue_count = table->count; + zone = table->zones; + + for ( ; blue_count > 0; blue_count--, zone++ ) + { + FT_Pos delta = y - zone->org_bottom; + + + if ( delta < -blues->blue_fuzz ) + break; + + if ( y <= zone->org_top + blues->blue_fuzz ) + if ( blues->no_overshoots || delta <= blues->blue_threshold ) + { + point->cur_u = zone->cur_bottom; + psh_point_set_strong( point ); + psh_point_set_fitted( point ); + } + } + + /* look up bottom zones */ + table = &blues->normal_bottom; + blue_count = table->count; + zone = table->zones + blue_count - 1; + + for ( ; blue_count > 0; blue_count--, zone-- ) + { + FT_Pos delta = zone->org_top - y; + + + if ( delta < -blues->blue_fuzz ) + break; + + if ( y >= zone->org_bottom - blues->blue_fuzz ) + if ( blues->no_overshoots || delta < blues->blue_threshold ) + { + point->cur_u = zone->cur_top; + psh_point_set_strong( point ); + psh_point_set_fitted( point ); + } + } + } + } + + + /* interpolate strong points with the help of hinted coordinates */ + static void + psh_glyph_interpolate_strong_points( PSH_Glyph glyph, + FT_Int dimension ) + { + PSH_Dimension dim = &glyph->globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + + FT_UInt count = glyph->num_points; + PSH_Point point = glyph->points; + + + for ( ; count > 0; count--, point++ ) + { + PSH_Hint hint = point->hint; + + + if ( hint ) + { + FT_Pos delta; + + + if ( psh_point_is_edge_min( point ) ) + point->cur_u = hint->cur_pos; + + else if ( psh_point_is_edge_max( point ) ) + point->cur_u = hint->cur_pos + hint->cur_len; + + else + { + delta = point->org_u - hint->org_pos; + + if ( delta <= 0 ) + point->cur_u = hint->cur_pos + FT_MulFix( delta, scale ); + + else if ( delta >= hint->org_len ) + point->cur_u = hint->cur_pos + hint->cur_len + + FT_MulFix( delta - hint->org_len, scale ); + + else if ( hint->org_len > 0 ) + point->cur_u = hint->cur_pos + + FT_MulDiv( delta, hint->cur_len, + hint->org_len ); + else + point->cur_u = hint->cur_pos; + } + psh_point_set_fitted( point ); + } + } + } + + +#define PSH_MAX_STRONG_INTERNAL 16 + + static void + psh_glyph_interpolate_normal_points( PSH_Glyph glyph, + FT_Int dimension ) + { + +#if 1 + /* first technique: a point is strong if it is a local extremum */ + + PSH_Dimension dim = &glyph->globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Memory memory = glyph->memory; + + PSH_Point* strongs = NULL; + PSH_Point strongs_0[PSH_MAX_STRONG_INTERNAL]; + FT_UInt num_strongs = 0; + + PSH_Point points = glyph->points; + PSH_Point points_end = points + glyph->num_points; + PSH_Point point; + + + /* first count the number of strong points */ + for ( point = points; point < points_end; point++ ) + { + if ( psh_point_is_strong( point ) ) + num_strongs++; + } + + if ( num_strongs == 0 ) /* nothing to do here */ + return; + + /* allocate an array to store a list of points, */ + /* stored in increasing org_u order */ + if ( num_strongs <= PSH_MAX_STRONG_INTERNAL ) + strongs = strongs_0; + else + { + FT_Error error; + + + if ( FT_NEW_ARRAY( strongs, num_strongs ) ) + return; + } + + num_strongs = 0; + for ( point = points; point < points_end; point++ ) + { + PSH_Point* insert; + + + if ( !psh_point_is_strong( point ) ) + continue; + + for ( insert = strongs + num_strongs; insert > strongs; insert-- ) + { + if ( insert[-1]->org_u <= point->org_u ) + break; + + insert[0] = insert[-1]; + } + insert[0] = point; + num_strongs++; + } + + /* now try to interpolate all normal points */ + for ( point = points; point < points_end; point++ ) + { + if ( psh_point_is_strong( point ) ) + continue; + + /* sometimes, some local extrema are smooth points */ + if ( psh_point_is_smooth( point ) ) + { + if ( point->dir_in == PSH_DIR_NONE || + point->dir_in != point->dir_out ) + continue; + + if ( !psh_point_is_extremum( point ) && + !psh_point_is_inflex( point ) ) + continue; + + point->flags &= ~PSH_POINT_SMOOTH; + } + + /* find best enclosing point coordinates then interpolate */ + { + PSH_Point before, after; + FT_UInt nn; + + + for ( nn = 0; nn < num_strongs; nn++ ) + if ( strongs[nn]->org_u > point->org_u ) + break; + + if ( nn == 0 ) /* point before the first strong point */ + { + after = strongs[0]; + + point->cur_u = after->cur_u + + FT_MulFix( point->org_u - after->org_u, + scale ); + } + else + { + before = strongs[nn - 1]; + + for ( nn = num_strongs; nn > 0; nn-- ) + if ( strongs[nn - 1]->org_u < point->org_u ) + break; + + if ( nn == num_strongs ) /* point is after last strong point */ + { + before = strongs[nn - 1]; + + point->cur_u = before->cur_u + + FT_MulFix( point->org_u - before->org_u, + scale ); + } + else + { + FT_Pos u; + + + after = strongs[nn]; + + /* now interpolate point between before and after */ + u = point->org_u; + + if ( u == before->org_u ) + point->cur_u = before->cur_u; + + else if ( u == after->org_u ) + point->cur_u = after->cur_u; + + else + point->cur_u = before->cur_u + + FT_MulDiv( u - before->org_u, + after->cur_u - before->cur_u, + after->org_u - before->org_u ); + } + } + psh_point_set_fitted( point ); + } + } + + if ( strongs != strongs_0 ) + FT_FREE( strongs ); + +#endif /* 1 */ + + } + + + /* interpolate other points */ + static void + psh_glyph_interpolate_other_points( PSH_Glyph glyph, + FT_Int dimension ) + { + PSH_Dimension dim = &glyph->globals->dimension[dimension]; + FT_Fixed scale = dim->scale_mult; + FT_Fixed delta = dim->scale_delta; + PSH_Contour contour = glyph->contours; + FT_UInt num_contours = glyph->num_contours; + + + for ( ; num_contours > 0; num_contours--, contour++ ) + { + PSH_Point start = contour->start; + PSH_Point first, next, point; + FT_UInt fit_count; + + + /* count the number of strong points in this contour */ + next = start + contour->count; + fit_count = 0; + first = 0; + + for ( point = start; point < next; point++ ) + if ( psh_point_is_fitted( point ) ) + { + if ( !first ) + first = point; + + fit_count++; + } + + /* if there are less than 2 fitted points in the contour, we */ + /* simply scale and eventually translate the contour points */ + if ( fit_count < 2 ) + { + if ( fit_count == 1 ) + delta = first->cur_u - FT_MulFix( first->org_u, scale ); + + for ( point = start; point < next; point++ ) + if ( point != first ) + point->cur_u = FT_MulFix( point->org_u, scale ) + delta; + + goto Next_Contour; + } + + /* there are more than 2 strong points in this contour; we */ + /* need to interpolate weak points between them */ + start = first; + do + { + point = first; + + /* skip consecutive fitted points */ + for (;;) + { + next = first->next; + if ( next == start ) + goto Next_Contour; + + if ( !psh_point_is_fitted( next ) ) + break; + + first = next; + } + + /* find next fitted point after unfitted one */ + for (;;) + { + next = next->next; + if ( psh_point_is_fitted( next ) ) + break; + } + + /* now interpolate between them */ + { + FT_Pos org_a, org_ab, cur_a, cur_ab; + FT_Pos org_c, org_ac, cur_c; + FT_Fixed scale_ab; + + + if ( first->org_u <= next->org_u ) + { + org_a = first->org_u; + cur_a = first->cur_u; + org_ab = next->org_u - org_a; + cur_ab = next->cur_u - cur_a; + } + else + { + org_a = next->org_u; + cur_a = next->cur_u; + org_ab = first->org_u - org_a; + cur_ab = first->cur_u - cur_a; + } + + scale_ab = 0x10000L; + if ( org_ab > 0 ) + scale_ab = FT_DivFix( cur_ab, org_ab ); + + point = first->next; + do + { + org_c = point->org_u; + org_ac = org_c - org_a; + + if ( org_ac <= 0 ) + { + /* on the left of the interpolation zone */ + cur_c = cur_a + FT_MulFix( org_ac, scale ); + } + else if ( org_ac >= org_ab ) + { + /* on the right on the interpolation zone */ + cur_c = cur_a + cur_ab + FT_MulFix( org_ac - org_ab, scale ); + } + else + { + /* within the interpolation zone */ + cur_c = cur_a + FT_MulFix( org_ac, scale_ab ); + } + + point->cur_u = cur_c; + + point = point->next; + + } while ( point != next ); + } + + /* keep going until all points in the contours have been processed */ + first = next; + + } while ( first != start ); + + Next_Contour: + ; + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** HIGH-LEVEL INTERFACE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + FT_Error + ps_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ) + { + PSH_GlyphRec glyphrec; + PSH_Glyph glyph = &glyphrec; + FT_Error error; +#ifdef DEBUG_HINTER + FT_Memory memory; +#endif + FT_Int dimension; + + + /* something to do? */ + if ( outline->n_points == 0 || outline->n_contours == 0 ) + return PSH_Err_Ok; + +#ifdef DEBUG_HINTER + + memory = globals->memory; + + if ( ps_debug_glyph ) + { + psh_glyph_done( ps_debug_glyph ); + FT_FREE( ps_debug_glyph ); + } + + if ( FT_NEW( glyph ) ) + return error; + + ps_debug_glyph = glyph; + +#endif /* DEBUG_HINTER */ + + error = psh_glyph_init( glyph, outline, ps_hints, globals ); + if ( error ) + goto Exit; + + /* try to optimize the y_scale so that the top of non-capital letters + * is aligned on a pixel boundary whenever possible + */ + { + PSH_Dimension dim_x = &glyph->globals->dimension[0]; + PSH_Dimension dim_y = &glyph->globals->dimension[1]; + + FT_Fixed x_scale = dim_x->scale_mult; + FT_Fixed y_scale = dim_y->scale_mult; + + FT_Fixed scaled; + FT_Fixed fitted; + + + scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale ); + fitted = FT_PIX_ROUND( scaled ); + + if ( fitted != 0 && scaled != fitted ) + { + y_scale = FT_MulDiv( y_scale, fitted, scaled ); + + if ( fitted < scaled ) + x_scale -= x_scale / 50; + + psh_globals_set_scale( glyph->globals, x_scale, y_scale, 0, 0 ); + } + } + + glyph->do_horz_hints = 1; + glyph->do_vert_hints = 1; + + glyph->do_horz_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || + hint_mode == FT_RENDER_MODE_LCD ); + + glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || + hint_mode == FT_RENDER_MODE_LCD_V ); + + glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); + + for ( dimension = 0; dimension < 2; dimension++ ) + { + /* load outline coordinates into glyph */ + psh_glyph_load_points( glyph, dimension ); + + /* compute local extrema */ + psh_glyph_compute_extrema( glyph ); + + /* compute aligned stem/hints positions */ + psh_hint_table_align_hints( &glyph->hint_tables[dimension], + glyph->globals, + dimension, + glyph ); + + /* find strong points, align them, then interpolate others */ + psh_glyph_find_strong_points( glyph, dimension ); + if ( dimension == 1 ) + psh_glyph_find_blue_points( &globals->blues, glyph ); + psh_glyph_interpolate_strong_points( glyph, dimension ); + psh_glyph_interpolate_normal_points( glyph, dimension ); + psh_glyph_interpolate_other_points( glyph, dimension ); + + /* save hinted coordinates back to outline */ + psh_glyph_save_points( glyph, dimension ); + } + + Exit: + +#ifndef DEBUG_HINTER + psh_glyph_done( glyph ); +#endif + + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.h b/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.h index f68de71202e..914570d1e63 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.h +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshalgo.h @@ -1,255 +1,255 @@ -/***************************************************************************/ -/* */ -/* pshalgo.h */ -/* */ -/* PostScript hinting algorithm (specification). */ -/* */ -/* Copyright 2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSHALGO_H__ -#define __PSHALGO_H__ - - -#include "pshrec.h" -#include "pshglob.h" -#include FT_TRIGONOMETRY_H - - -FT_BEGIN_HEADER - - - /* handle to Hint structure */ - typedef struct PSH_HintRec_* PSH_Hint; - - /* hint bit-flags */ - typedef enum - { - PSH_HINT_GHOST = PS_HINT_FLAG_GHOST, - PSH_HINT_BOTTOM = PS_HINT_FLAG_BOTTOM, - PSH_HINT_ACTIVE = 4, - PSH_HINT_FITTED = 8 - - } PSH_Hint_Flags; - - -#define psh_hint_is_active( x ) ( ( (x)->flags & PSH_HINT_ACTIVE ) != 0 ) -#define psh_hint_is_ghost( x ) ( ( (x)->flags & PSH_HINT_GHOST ) != 0 ) -#define psh_hint_is_fitted( x ) ( ( (x)->flags & PSH_HINT_FITTED ) != 0 ) - -#define psh_hint_activate( x ) (x)->flags |= PSH_HINT_ACTIVE -#define psh_hint_deactivate( x ) (x)->flags &= ~PSH_HINT_ACTIVE -#define psh_hint_set_fitted( x ) (x)->flags |= PSH_HINT_FITTED - - /* hint structure */ - typedef struct PSH_HintRec_ - { - FT_Int org_pos; - FT_Int org_len; - FT_Pos cur_pos; - FT_Pos cur_len; - FT_UInt flags; - PSH_Hint parent; - FT_Int order; - - } PSH_HintRec; - - - /* this is an interpolation zone used for strong points; */ - /* weak points are interpolated according to their strong */ - /* neighbours */ - typedef struct PSH_ZoneRec_ - { - FT_Fixed scale; - FT_Fixed delta; - FT_Pos min; - FT_Pos max; - - } PSH_ZoneRec, *PSH_Zone; - - - typedef struct PSH_Hint_TableRec_ - { - FT_UInt max_hints; - FT_UInt num_hints; - PSH_Hint hints; - PSH_Hint* sort; - PSH_Hint* sort_global; - FT_UInt num_zones; - PSH_ZoneRec* zones; - PSH_Zone zone; - PS_Mask_Table hint_masks; - PS_Mask_Table counter_masks; - - } PSH_Hint_TableRec, *PSH_Hint_Table; - - - typedef struct PSH_PointRec_* PSH_Point; - typedef struct PSH_ContourRec_* PSH_Contour; - - enum - { - PSH_DIR_NONE = 4, - PSH_DIR_UP = -1, - PSH_DIR_DOWN = 1, - PSH_DIR_LEFT = -2, - PSH_DIR_RIGHT = 2 - }; - -#define PSH_DIR_HORIZONTAL 2 -#define PSH_DIR_VERTICAL 1 - -#define PSH_DIR_COMPARE( d1, d2 ) ( (d1) == (d2) || (d1) == -(d2) ) -#define PSH_DIR_IS_HORIZONTAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_HORIZONTAL ) -#define PSH_DIR_IS_VERTICAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_VERTICAL ) - - - /* the following bit-flags are computed once by the glyph */ - /* analyzer, for both dimensions */ - enum - { - PSH_POINT_OFF = 1, /* point is off the curve */ - PSH_POINT_SMOOTH = 2, /* point is smooth */ - PSH_POINT_INFLEX = 4 /* point is inflection */ - }; - -#define psh_point_is_smooth( p ) ( (p)->flags & PSH_POINT_SMOOTH ) -#define psh_point_is_off( p ) ( (p)->flags & PSH_POINT_OFF ) -#define psh_point_is_inflex( p ) ( (p)->flags & PSH_POINT_INFLEX ) - -#define psh_point_set_smooth( p ) (p)->flags |= PSH_POINT_SMOOTH -#define psh_point_set_off( p ) (p)->flags |= PSH_POINT_OFF -#define psh_point_set_inflex( p ) (p)->flags |= PSH_POINT_INFLEX - - /* the following bit-flags are re-computed for each dimension */ - enum - { - PSH_POINT_STRONG = 16, /* point is strong */ - PSH_POINT_FITTED = 32, /* point is already fitted */ - PSH_POINT_EXTREMUM = 64, /* point is local extremum */ - PSH_POINT_POSITIVE = 128, /* extremum has positive contour flow */ - PSH_POINT_NEGATIVE = 256, /* extremum has negative contour flow */ - PSH_POINT_EDGE_MIN = 512, /* point is aligned to left/bottom stem edge */ - PSH_POINT_EDGE_MAX = 1024 /* point is aligned to top/right stem edge */ - }; - -#define psh_point_is_strong( p ) ( (p)->flags2 & PSH_POINT_STRONG ) -#define psh_point_is_fitted( p ) ( (p)->flags2 & PSH_POINT_FITTED ) -#define psh_point_is_extremum( p ) ( (p)->flags2 & PSH_POINT_EXTREMUM ) -#define psh_point_is_positive( p ) ( (p)->flags2 & PSH_POINT_POSITIVE ) -#define psh_point_is_negative( p ) ( (p)->flags2 & PSH_POINT_NEGATIVE ) -#define psh_point_is_edge_min( p ) ( (p)->flags2 & PSH_POINT_EDGE_MIN ) -#define psh_point_is_edge_max( p ) ( (p)->flags2 & PSH_POINT_EDGE_MAX ) - -#define psh_point_set_strong( p ) (p)->flags2 |= PSH_POINT_STRONG -#define psh_point_set_fitted( p ) (p)->flags2 |= PSH_POINT_FITTED -#define psh_point_set_extremum( p ) (p)->flags2 |= PSH_POINT_EXTREMUM -#define psh_point_set_positive( p ) (p)->flags2 |= PSH_POINT_POSITIVE -#define psh_point_set_negative( p ) (p)->flags2 |= PSH_POINT_NEGATIVE -#define psh_point_set_edge_min( p ) (p)->flags2 |= PSH_POINT_EDGE_MIN -#define psh_point_set_edge_max( p ) (p)->flags2 |= PSH_POINT_EDGE_MAX - - - typedef struct PSH_PointRec_ - { - PSH_Point prev; - PSH_Point next; - PSH_Contour contour; - FT_UInt flags; - FT_UInt flags2; - FT_Char dir_in; - FT_Char dir_out; - FT_Angle angle_in; - FT_Angle angle_out; - PSH_Hint hint; - FT_Pos org_u; - FT_Pos org_v; - FT_Pos cur_u; -#ifdef DEBUG_HINTER - FT_Pos org_x; - FT_Pos cur_x; - FT_Pos org_y; - FT_Pos cur_y; - FT_UInt flags_x; - FT_UInt flags_y; -#endif - - } PSH_PointRec; - - -#define PSH_POINT_EQUAL_ORG( a, b ) ( (a)->org_u == (b)->org_u && \ - (a)->org_v == (b)->org_v ) - -#define PSH_POINT_ANGLE( a, b ) FT_Atan2( (b)->org_u - (a)->org_u, \ - (b)->org_v - (a)->org_v ) - - typedef struct PSH_ContourRec_ - { - PSH_Point start; - FT_UInt count; - - } PSH_ContourRec; - - - typedef struct PSH_GlyphRec_ - { - FT_UInt num_points; - FT_UInt num_contours; - - PSH_Point points; - PSH_Contour contours; - - FT_Memory memory; - FT_Outline* outline; - PSH_Globals globals; - PSH_Hint_TableRec hint_tables[2]; - - FT_Bool vertical; - FT_Int major_dir; - FT_Int minor_dir; - - FT_Bool do_horz_hints; - FT_Bool do_vert_hints; - FT_Bool do_horz_snapping; - FT_Bool do_vert_snapping; - FT_Bool do_stem_adjust; - - } PSH_GlyphRec, *PSH_Glyph; - - -#ifdef DEBUG_HINTER - extern PSH_Hint_Table ps_debug_hint_table; - - typedef void - (*PSH_HintFunc)( PSH_Hint hint, - FT_Bool vertical ); - - extern PSH_HintFunc ps_debug_hint_func; - - extern PSH_Glyph ps_debug_glyph; -#endif - - - extern FT_Error - ps_hints_apply( PS_Hints ps_hints, - FT_Outline* outline, - PSH_Globals globals, - FT_Render_Mode hint_mode ); - - -FT_END_HEADER - - -#endif /* __PSHALGO_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pshalgo.h */ +/* */ +/* PostScript hinting algorithm (specification). */ +/* */ +/* Copyright 2001, 2002, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSHALGO_H__ +#define __PSHALGO_H__ + + +#include "pshrec.h" +#include "pshglob.h" +#include FT_TRIGONOMETRY_H + + +FT_BEGIN_HEADER + + + /* handle to Hint structure */ + typedef struct PSH_HintRec_* PSH_Hint; + + /* hint bit-flags */ + typedef enum + { + PSH_HINT_GHOST = PS_HINT_FLAG_GHOST, + PSH_HINT_BOTTOM = PS_HINT_FLAG_BOTTOM, + PSH_HINT_ACTIVE = 4, + PSH_HINT_FITTED = 8 + + } PSH_Hint_Flags; + + +#define psh_hint_is_active( x ) ( ( (x)->flags & PSH_HINT_ACTIVE ) != 0 ) +#define psh_hint_is_ghost( x ) ( ( (x)->flags & PSH_HINT_GHOST ) != 0 ) +#define psh_hint_is_fitted( x ) ( ( (x)->flags & PSH_HINT_FITTED ) != 0 ) + +#define psh_hint_activate( x ) (x)->flags |= PSH_HINT_ACTIVE +#define psh_hint_deactivate( x ) (x)->flags &= ~PSH_HINT_ACTIVE +#define psh_hint_set_fitted( x ) (x)->flags |= PSH_HINT_FITTED + + /* hint structure */ + typedef struct PSH_HintRec_ + { + FT_Int org_pos; + FT_Int org_len; + FT_Pos cur_pos; + FT_Pos cur_len; + FT_UInt flags; + PSH_Hint parent; + FT_Int order; + + } PSH_HintRec; + + + /* this is an interpolation zone used for strong points; */ + /* weak points are interpolated according to their strong */ + /* neighbours */ + typedef struct PSH_ZoneRec_ + { + FT_Fixed scale; + FT_Fixed delta; + FT_Pos min; + FT_Pos max; + + } PSH_ZoneRec, *PSH_Zone; + + + typedef struct PSH_Hint_TableRec_ + { + FT_UInt max_hints; + FT_UInt num_hints; + PSH_Hint hints; + PSH_Hint* sort; + PSH_Hint* sort_global; + FT_UInt num_zones; + PSH_ZoneRec* zones; + PSH_Zone zone; + PS_Mask_Table hint_masks; + PS_Mask_Table counter_masks; + + } PSH_Hint_TableRec, *PSH_Hint_Table; + + + typedef struct PSH_PointRec_* PSH_Point; + typedef struct PSH_ContourRec_* PSH_Contour; + + enum + { + PSH_DIR_NONE = 4, + PSH_DIR_UP = -1, + PSH_DIR_DOWN = 1, + PSH_DIR_LEFT = -2, + PSH_DIR_RIGHT = 2 + }; + +#define PSH_DIR_HORIZONTAL 2 +#define PSH_DIR_VERTICAL 1 + +#define PSH_DIR_COMPARE( d1, d2 ) ( (d1) == (d2) || (d1) == -(d2) ) +#define PSH_DIR_IS_HORIZONTAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_HORIZONTAL ) +#define PSH_DIR_IS_VERTICAL( d ) PSH_DIR_COMPARE( d, PSH_DIR_VERTICAL ) + + + /* the following bit-flags are computed once by the glyph */ + /* analyzer, for both dimensions */ + enum + { + PSH_POINT_OFF = 1, /* point is off the curve */ + PSH_POINT_SMOOTH = 2, /* point is smooth */ + PSH_POINT_INFLEX = 4 /* point is inflection */ + }; + +#define psh_point_is_smooth( p ) ( (p)->flags & PSH_POINT_SMOOTH ) +#define psh_point_is_off( p ) ( (p)->flags & PSH_POINT_OFF ) +#define psh_point_is_inflex( p ) ( (p)->flags & PSH_POINT_INFLEX ) + +#define psh_point_set_smooth( p ) (p)->flags |= PSH_POINT_SMOOTH +#define psh_point_set_off( p ) (p)->flags |= PSH_POINT_OFF +#define psh_point_set_inflex( p ) (p)->flags |= PSH_POINT_INFLEX + + /* the following bit-flags are re-computed for each dimension */ + enum + { + PSH_POINT_STRONG = 16, /* point is strong */ + PSH_POINT_FITTED = 32, /* point is already fitted */ + PSH_POINT_EXTREMUM = 64, /* point is local extremum */ + PSH_POINT_POSITIVE = 128, /* extremum has positive contour flow */ + PSH_POINT_NEGATIVE = 256, /* extremum has negative contour flow */ + PSH_POINT_EDGE_MIN = 512, /* point is aligned to left/bottom stem edge */ + PSH_POINT_EDGE_MAX = 1024 /* point is aligned to top/right stem edge */ + }; + +#define psh_point_is_strong( p ) ( (p)->flags2 & PSH_POINT_STRONG ) +#define psh_point_is_fitted( p ) ( (p)->flags2 & PSH_POINT_FITTED ) +#define psh_point_is_extremum( p ) ( (p)->flags2 & PSH_POINT_EXTREMUM ) +#define psh_point_is_positive( p ) ( (p)->flags2 & PSH_POINT_POSITIVE ) +#define psh_point_is_negative( p ) ( (p)->flags2 & PSH_POINT_NEGATIVE ) +#define psh_point_is_edge_min( p ) ( (p)->flags2 & PSH_POINT_EDGE_MIN ) +#define psh_point_is_edge_max( p ) ( (p)->flags2 & PSH_POINT_EDGE_MAX ) + +#define psh_point_set_strong( p ) (p)->flags2 |= PSH_POINT_STRONG +#define psh_point_set_fitted( p ) (p)->flags2 |= PSH_POINT_FITTED +#define psh_point_set_extremum( p ) (p)->flags2 |= PSH_POINT_EXTREMUM +#define psh_point_set_positive( p ) (p)->flags2 |= PSH_POINT_POSITIVE +#define psh_point_set_negative( p ) (p)->flags2 |= PSH_POINT_NEGATIVE +#define psh_point_set_edge_min( p ) (p)->flags2 |= PSH_POINT_EDGE_MIN +#define psh_point_set_edge_max( p ) (p)->flags2 |= PSH_POINT_EDGE_MAX + + + typedef struct PSH_PointRec_ + { + PSH_Point prev; + PSH_Point next; + PSH_Contour contour; + FT_UInt flags; + FT_UInt flags2; + FT_Char dir_in; + FT_Char dir_out; + FT_Angle angle_in; + FT_Angle angle_out; + PSH_Hint hint; + FT_Pos org_u; + FT_Pos org_v; + FT_Pos cur_u; +#ifdef DEBUG_HINTER + FT_Pos org_x; + FT_Pos cur_x; + FT_Pos org_y; + FT_Pos cur_y; + FT_UInt flags_x; + FT_UInt flags_y; +#endif + + } PSH_PointRec; + + +#define PSH_POINT_EQUAL_ORG( a, b ) ( (a)->org_u == (b)->org_u && \ + (a)->org_v == (b)->org_v ) + +#define PSH_POINT_ANGLE( a, b ) FT_Atan2( (b)->org_u - (a)->org_u, \ + (b)->org_v - (a)->org_v ) + + typedef struct PSH_ContourRec_ + { + PSH_Point start; + FT_UInt count; + + } PSH_ContourRec; + + + typedef struct PSH_GlyphRec_ + { + FT_UInt num_points; + FT_UInt num_contours; + + PSH_Point points; + PSH_Contour contours; + + FT_Memory memory; + FT_Outline* outline; + PSH_Globals globals; + PSH_Hint_TableRec hint_tables[2]; + + FT_Bool vertical; + FT_Int major_dir; + FT_Int minor_dir; + + FT_Bool do_horz_hints; + FT_Bool do_vert_hints; + FT_Bool do_horz_snapping; + FT_Bool do_vert_snapping; + FT_Bool do_stem_adjust; + + } PSH_GlyphRec, *PSH_Glyph; + + +#ifdef DEBUG_HINTER + extern PSH_Hint_Table ps_debug_hint_table; + + typedef void + (*PSH_HintFunc)( PSH_Hint hint, + FT_Bool vertical ); + + extern PSH_HintFunc ps_debug_hint_func; + + extern PSH_Glyph ps_debug_glyph; +#endif + + + extern FT_Error + ps_hints_apply( PS_Hints ps_hints, + FT_Outline* outline, + PSH_Globals globals, + FT_Render_Mode hint_mode ); + + +FT_END_HEADER + + +#endif /* __PSHALGO_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.c b/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.c index 8a69aa1e845..8670b59aff1 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.c +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.c @@ -1,750 +1,750 @@ -/***************************************************************************/ -/* */ -/* pshglob.c */ -/* */ -/* PostScript hinter global hinting management (body). */ -/* Inspired by the new auto-hinter module. */ -/* */ -/* Copyright 2001, 2002, 2003, 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used */ -/* modified and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_FREETYPE_H -#include FT_INTERNAL_OBJECTS_H -#include "pshglob.h" - -#ifdef DEBUG_HINTER - PSH_Globals ps_debug_globals = 0; -#endif - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** STANDARD WIDTHS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /* scale the widths/heights table */ - static void - psh_globals_scale_widths( PSH_Globals globals, - FT_UInt direction ) - { - PSH_Dimension dim = &globals->dimension[direction]; - PSH_Widths stdw = &dim->stdw; - FT_UInt count = stdw->count; - PSH_Width width = stdw->widths; - PSH_Width stand = width; /* standard width/height */ - FT_Fixed scale = dim->scale_mult; - - - if ( count > 0 ) - { - width->cur = FT_MulFix( width->org, scale ); - width->fit = FT_PIX_ROUND( width->cur ); - - width++; - count--; - - for ( ; count > 0; count--, width++ ) - { - FT_Pos w, dist; - - - w = FT_MulFix( width->org, scale ); - dist = w - stand->cur; - - if ( dist < 0 ) - dist = -dist; - - if ( dist < 128 ) - w = stand->cur; - - width->cur = w; - width->fit = FT_PIX_ROUND( w ); - } - } - } - - -#if 0 - - /* org_width is is font units, result in device pixels, 26.6 format */ - FT_LOCAL_DEF( FT_Pos ) - psh_dimension_snap_width( PSH_Dimension dimension, - FT_Int org_width ) - { - FT_UInt n; - FT_Pos width = FT_MulFix( org_width, dimension->scale_mult ); - FT_Pos best = 64 + 32 + 2; - FT_Pos reference = width; - - - for ( n = 0; n < dimension->stdw.count; n++ ) - { - FT_Pos w; - FT_Pos dist; - - - w = dimension->stdw.widths[n].cur; - dist = width - w; - if ( dist < 0 ) - dist = -dist; - if ( dist < best ) - { - best = dist; - reference = w; - } - } - - if ( width >= reference ) - { - width -= 0x21; - if ( width < reference ) - width = reference; - } - else - { - width += 0x21; - if ( width > reference ) - width = reference; - } - - return width; - } - -#endif /* 0 */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** BLUE ZONES *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - psh_blues_set_zones_0( PSH_Blues target, - FT_Bool is_others, - FT_UInt read_count, - FT_Short* read, - PSH_Blue_Table top_table, - PSH_Blue_Table bot_table ) - { - FT_UInt count_top = top_table->count; - FT_UInt count_bot = bot_table->count; - FT_Bool first = 1; - - FT_UNUSED( target ); - - - for ( ; read_count > 1; read_count -= 2 ) - { - FT_Int reference, delta; - FT_UInt count; - PSH_Blue_Zone zones, zone; - FT_Bool top; - - - /* read blue zone entry, and select target top/bottom zone */ - top = 0; - if ( first || is_others ) - { - reference = read[1]; - delta = read[0] - reference; - - zones = bot_table->zones; - count = count_bot; - first = 0; - } - else - { - reference = read[0]; - delta = read[1] - reference; - - zones = top_table->zones; - count = count_top; - top = 1; - } - - /* insert into sorted table */ - zone = zones; - for ( ; count > 0; count--, zone++ ) - { - if ( reference < zone->org_ref ) - break; - - if ( reference == zone->org_ref ) - { - FT_Int delta0 = zone->org_delta; - - - /* we have two zones on the same reference position -- */ - /* only keep the largest one */ - if ( delta < 0 ) - { - if ( delta < delta0 ) - zone->org_delta = delta; - } - else - { - if ( delta > delta0 ) - zone->org_delta = delta; - } - goto Skip; - } - } - - for ( ; count > 0; count-- ) - zone[count] = zone[count-1]; - - zone->org_ref = reference; - zone->org_delta = delta; - - if ( top ) - count_top++; - else - count_bot++; - - Skip: - read += 2; - } - - top_table->count = count_top; - bot_table->count = count_bot; - } - - - /* Re-read blue zones from the original fonts and store them into out */ - /* private structure. This function re-orders, sanitizes and */ - /* fuzz-expands the zones as well. */ - static void - psh_blues_set_zones( PSH_Blues target, - FT_UInt count, - FT_Short* blues, - FT_UInt count_others, - FT_Short* other_blues, - FT_Int fuzz, - FT_Int family ) - { - PSH_Blue_Table top_table, bot_table; - FT_Int count_top, count_bot; - - - if ( family ) - { - top_table = &target->family_top; - bot_table = &target->family_bottom; - } - else - { - top_table = &target->normal_top; - bot_table = &target->normal_bottom; - } - - /* read the input blue zones, and build two sorted tables */ - /* (one for the top zones, the other for the bottom zones) */ - top_table->count = 0; - bot_table->count = 0; - - /* first, the blues */ - psh_blues_set_zones_0( target, 0, - count, blues, top_table, bot_table ); - psh_blues_set_zones_0( target, 1, - count_others, other_blues, top_table, bot_table ); - - count_top = top_table->count; - count_bot = bot_table->count; - - /* sanitize top table */ - if ( count_top > 0 ) - { - PSH_Blue_Zone zone = top_table->zones; - - - for ( count = count_top; count > 0; count--, zone++ ) - { - FT_Int delta; - - - if ( count > 1 ) - { - delta = zone[1].org_ref - zone[0].org_ref; - if ( zone->org_delta > delta ) - zone->org_delta = delta; - } - - zone->org_bottom = zone->org_ref; - zone->org_top = zone->org_delta + zone->org_ref; - } - } - - /* sanitize bottom table */ - if ( count_bot > 0 ) - { - PSH_Blue_Zone zone = bot_table->zones; - - - for ( count = count_bot; count > 0; count--, zone++ ) - { - FT_Int delta; - - - if ( count > 1 ) - { - delta = zone[0].org_ref - zone[1].org_ref; - if ( zone->org_delta < delta ) - zone->org_delta = delta; - } - - zone->org_top = zone->org_ref; - zone->org_bottom = zone->org_delta + zone->org_ref; - } - } - - /* expand top and bottom tables with blue fuzz */ - { - FT_Int dim, top, bot, delta; - PSH_Blue_Zone zone; - - - zone = top_table->zones; - count = count_top; - - for ( dim = 1; dim >= 0; dim-- ) - { - if ( count > 0 ) - { - /* expand the bottom of the lowest zone normally */ - zone->org_bottom -= fuzz; - - /* expand the top and bottom of intermediate zones; */ - /* checking that the interval is smaller than the fuzz */ - top = zone->org_top; - - for ( count--; count > 0; count-- ) - { - bot = zone[1].org_bottom; - delta = bot - top; - - if ( delta < 2 * fuzz ) - zone[0].org_top = zone[1].org_bottom = top + delta / 2; - else - { - zone[0].org_top = top + fuzz; - zone[1].org_bottom = bot - fuzz; - } - - zone++; - top = zone->org_top; - } - - /* expand the top of the highest zone normally */ - zone->org_top = top + fuzz; - } - zone = bot_table->zones; - count = count_bot; - } - } - } - - - /* reset the blues table when the device transform changes */ - static void - psh_blues_scale_zones( PSH_Blues blues, - FT_Fixed scale, - FT_Pos delta ) - { - FT_UInt count; - FT_UInt num; - PSH_Blue_Table table = 0; - - /* */ - /* Determine whether we need to suppress overshoots or */ - /* not. We simply need to compare the vertical scale */ - /* parameter to the raw bluescale value. Here is why: */ - /* */ - /* We need to suppress overshoots for all pointsizes. */ - /* At 300dpi that satisfies: */ - /* */ - /* pointsize < 240*bluescale + 0.49 */ - /* */ - /* This corresponds to: */ - /* */ - /* pixelsize < 1000*bluescale + 49/24 */ - /* */ - /* scale*EM_Size < 1000*bluescale + 49/24 */ - /* */ - /* However, for normal Type 1 fonts, EM_Size is 1000! */ - /* We thus only check: */ - /* */ - /* scale < bluescale + 49/24000 */ - /* */ - /* which we shorten to */ - /* */ - /* "scale < bluescale" */ - /* */ - /* Note that `blue_scale' is stored 1000 times its real */ - /* value, and that `scale' converts from font units to */ - /* fractional pixels. */ - /* */ - - /* 1000 / 64 = 125 / 8 */ - if ( scale >= 0x20C49BAL ) - blues->no_overshoots = FT_BOOL( scale < blues->blue_scale * 8 / 125 ); - else - blues->no_overshoots = FT_BOOL( scale * 125 < blues->blue_scale * 8 ); - - /* */ - /* The blue threshold is the font units distance under */ - /* which overshoots are suppressed due to the BlueShift */ - /* even if the scale is greater than BlueScale. */ - /* */ - /* It is the smallest distance such that */ - /* */ - /* dist <= BlueShift && dist*scale <= 0.5 pixels */ - /* */ - { - FT_Int threshold = blues->blue_shift; - - - while ( threshold > 0 && FT_MulFix( threshold, scale ) > 32 ) - threshold--; - - blues->blue_threshold = threshold; - } - - for ( num = 0; num < 4; num++ ) - { - PSH_Blue_Zone zone; - - - switch ( num ) - { - case 0: - table = &blues->normal_top; - break; - case 1: - table = &blues->normal_bottom; - break; - case 2: - table = &blues->family_top; - break; - default: - table = &blues->family_bottom; - break; - } - - zone = table->zones; - count = table->count; - for ( ; count > 0; count--, zone++ ) - { - zone->cur_top = FT_MulFix( zone->org_top, scale ) + delta; - zone->cur_bottom = FT_MulFix( zone->org_bottom, scale ) + delta; - zone->cur_ref = FT_MulFix( zone->org_ref, scale ) + delta; - zone->cur_delta = FT_MulFix( zone->org_delta, scale ); - - /* round scaled reference position */ - zone->cur_ref = FT_PIX_ROUND( zone->cur_ref ); - -#if 0 - if ( zone->cur_ref > zone->cur_top ) - zone->cur_ref -= 64; - else if ( zone->cur_ref < zone->cur_bottom ) - zone->cur_ref += 64; -#endif - } - } - - /* process the families now */ - - for ( num = 0; num < 2; num++ ) - { - PSH_Blue_Zone zone1, zone2; - FT_UInt count1, count2; - PSH_Blue_Table normal, family; - - - switch ( num ) - { - case 0: - normal = &blues->normal_top; - family = &blues->family_top; - break; - - default: - normal = &blues->normal_bottom; - family = &blues->family_bottom; - } - - zone1 = normal->zones; - count1 = normal->count; - - for ( ; count1 > 0; count1--, zone1++ ) - { - /* try to find a family zone whose reference position is less */ - /* than 1 pixel far from the current zone */ - zone2 = family->zones; - count2 = family->count; - - for ( ; count2 > 0; count2--, zone2++ ) - { - FT_Pos Delta; - - - Delta = zone1->org_ref - zone2->org_ref; - if ( Delta < 0 ) - Delta = -Delta; - - if ( FT_MulFix( Delta, scale ) < 64 ) - { - zone1->cur_top = zone2->cur_top; - zone1->cur_bottom = zone2->cur_bottom; - zone1->cur_ref = zone2->cur_ref; - zone1->cur_delta = zone2->cur_delta; - break; - } - } - } - } - } - - - FT_LOCAL_DEF( void ) - psh_blues_snap_stem( PSH_Blues blues, - FT_Int stem_top, - FT_Int stem_bot, - PSH_Alignment alignment ) - { - PSH_Blue_Table table; - FT_UInt count; - FT_Pos delta; - PSH_Blue_Zone zone; - FT_Int no_shoots; - - - alignment->align = PSH_BLUE_ALIGN_NONE; - - no_shoots = blues->no_overshoots; - - /* look up stem top in top zones table */ - table = &blues->normal_top; - count = table->count; - zone = table->zones; - - for ( ; count > 0; count--, zone++ ) - { - delta = stem_top - zone->org_bottom; - if ( delta < -blues->blue_fuzz ) - break; - - if ( stem_top <= zone->org_top + blues->blue_fuzz ) - { - if ( no_shoots || delta <= blues->blue_threshold ) - { - alignment->align |= PSH_BLUE_ALIGN_TOP; - alignment->align_top = zone->cur_ref; - } - break; - } - } - - /* look up stem bottom in bottom zones table */ - table = &blues->normal_bottom; - count = table->count; - zone = table->zones + count-1; - - for ( ; count > 0; count--, zone-- ) - { - delta = zone->org_top - stem_bot; - if ( delta < -blues->blue_fuzz ) - break; - - if ( stem_bot >= zone->org_bottom - blues->blue_fuzz ) - { - if ( no_shoots || delta < blues->blue_threshold ) - { - alignment->align |= PSH_BLUE_ALIGN_BOT; - alignment->align_bot = zone->cur_ref; - } - break; - } - } - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GLOBAL HINTS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - psh_globals_destroy( PSH_Globals globals ) - { - if ( globals ) - { - FT_Memory memory; - - - memory = globals->memory; - globals->dimension[0].stdw.count = 0; - globals->dimension[1].stdw.count = 0; - - globals->blues.normal_top.count = 0; - globals->blues.normal_bottom.count = 0; - globals->blues.family_top.count = 0; - globals->blues.family_bottom.count = 0; - - FT_FREE( globals ); - -#ifdef DEBUG_HINTER - ps_debug_globals = 0; -#endif - } - } - - - static FT_Error - psh_globals_new( FT_Memory memory, - T1_Private* priv, - PSH_Globals *aglobals ) - { - PSH_Globals globals; - FT_Error error; - - - if ( !FT_NEW( globals ) ) - { - FT_UInt count; - FT_Short* read; - - - globals->memory = memory; - - /* copy standard widths */ - { - PSH_Dimension dim = &globals->dimension[1]; - PSH_Width write = dim->stdw.widths; - - - write->org = priv->standard_width[0]; - write++; - - read = priv->snap_widths; - for ( count = priv->num_snap_widths; count > 0; count-- ) - { - write->org = *read; - write++; - read++; - } - - dim->stdw.count = priv->num_snap_widths + 1; - } - - /* copy standard heights */ - { - PSH_Dimension dim = &globals->dimension[0]; - PSH_Width write = dim->stdw.widths; - - - write->org = priv->standard_height[0]; - write++; - read = priv->snap_heights; - for ( count = priv->num_snap_heights; count > 0; count-- ) - { - write->org = *read; - write++; - read++; - } - - dim->stdw.count = priv->num_snap_heights + 1; - } - - /* copy blue zones */ - psh_blues_set_zones( &globals->blues, priv->num_blue_values, - priv->blue_values, priv->num_other_blues, - priv->other_blues, priv->blue_fuzz, 0 ); - - psh_blues_set_zones( &globals->blues, priv->num_family_blues, - priv->family_blues, priv->num_family_other_blues, - priv->family_other_blues, priv->blue_fuzz, 1 ); - - globals->blues.blue_scale = priv->blue_scale; - globals->blues.blue_shift = priv->blue_shift; - globals->blues.blue_fuzz = priv->blue_fuzz; - - globals->dimension[0].scale_mult = 0; - globals->dimension[0].scale_delta = 0; - globals->dimension[1].scale_mult = 0; - globals->dimension[1].scale_delta = 0; - -#ifdef DEBUG_HINTER - ps_debug_globals = globals; -#endif - } - - *aglobals = globals; - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - psh_globals_set_scale( PSH_Globals globals, - FT_Fixed x_scale, - FT_Fixed y_scale, - FT_Fixed x_delta, - FT_Fixed y_delta ) - { - PSH_Dimension dim = &globals->dimension[0]; - - - dim = &globals->dimension[0]; - if ( x_scale != dim->scale_mult || - x_delta != dim->scale_delta ) - { - dim->scale_mult = x_scale; - dim->scale_delta = x_delta; - - psh_globals_scale_widths( globals, 0 ); - } - - dim = &globals->dimension[1]; - if ( y_scale != dim->scale_mult || - y_delta != dim->scale_delta ) - { - dim->scale_mult = y_scale; - dim->scale_delta = y_delta; - - psh_globals_scale_widths( globals, 1 ); - psh_blues_scale_zones( &globals->blues, y_scale, y_delta ); - } - - return 0; - } - - - FT_LOCAL_DEF( void ) - psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs ) - { - funcs->create = psh_globals_new; - funcs->set_scale = psh_globals_set_scale; - funcs->destroy = psh_globals_destroy; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* pshglob.c */ +/* */ +/* PostScript hinter global hinting management (body). */ +/* Inspired by the new auto-hinter module. */ +/* */ +/* Copyright 2001, 2002, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_FREETYPE_H +#include FT_INTERNAL_OBJECTS_H +#include "pshglob.h" + +#ifdef DEBUG_HINTER + PSH_Globals ps_debug_globals = 0; +#endif + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** STANDARD WIDTHS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /* scale the widths/heights table */ + static void + psh_globals_scale_widths( PSH_Globals globals, + FT_UInt direction ) + { + PSH_Dimension dim = &globals->dimension[direction]; + PSH_Widths stdw = &dim->stdw; + FT_UInt count = stdw->count; + PSH_Width width = stdw->widths; + PSH_Width stand = width; /* standard width/height */ + FT_Fixed scale = dim->scale_mult; + + + if ( count > 0 ) + { + width->cur = FT_MulFix( width->org, scale ); + width->fit = FT_PIX_ROUND( width->cur ); + + width++; + count--; + + for ( ; count > 0; count--, width++ ) + { + FT_Pos w, dist; + + + w = FT_MulFix( width->org, scale ); + dist = w - stand->cur; + + if ( dist < 0 ) + dist = -dist; + + if ( dist < 128 ) + w = stand->cur; + + width->cur = w; + width->fit = FT_PIX_ROUND( w ); + } + } + } + + +#if 0 + + /* org_width is is font units, result in device pixels, 26.6 format */ + FT_LOCAL_DEF( FT_Pos ) + psh_dimension_snap_width( PSH_Dimension dimension, + FT_Int org_width ) + { + FT_UInt n; + FT_Pos width = FT_MulFix( org_width, dimension->scale_mult ); + FT_Pos best = 64 + 32 + 2; + FT_Pos reference = width; + + + for ( n = 0; n < dimension->stdw.count; n++ ) + { + FT_Pos w; + FT_Pos dist; + + + w = dimension->stdw.widths[n].cur; + dist = width - w; + if ( dist < 0 ) + dist = -dist; + if ( dist < best ) + { + best = dist; + reference = w; + } + } + + if ( width >= reference ) + { + width -= 0x21; + if ( width < reference ) + width = reference; + } + else + { + width += 0x21; + if ( width > reference ) + width = reference; + } + + return width; + } + +#endif /* 0 */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** BLUE ZONES *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + psh_blues_set_zones_0( PSH_Blues target, + FT_Bool is_others, + FT_UInt read_count, + FT_Short* read, + PSH_Blue_Table top_table, + PSH_Blue_Table bot_table ) + { + FT_UInt count_top = top_table->count; + FT_UInt count_bot = bot_table->count; + FT_Bool first = 1; + + FT_UNUSED( target ); + + + for ( ; read_count > 1; read_count -= 2 ) + { + FT_Int reference, delta; + FT_UInt count; + PSH_Blue_Zone zones, zone; + FT_Bool top; + + + /* read blue zone entry, and select target top/bottom zone */ + top = 0; + if ( first || is_others ) + { + reference = read[1]; + delta = read[0] - reference; + + zones = bot_table->zones; + count = count_bot; + first = 0; + } + else + { + reference = read[0]; + delta = read[1] - reference; + + zones = top_table->zones; + count = count_top; + top = 1; + } + + /* insert into sorted table */ + zone = zones; + for ( ; count > 0; count--, zone++ ) + { + if ( reference < zone->org_ref ) + break; + + if ( reference == zone->org_ref ) + { + FT_Int delta0 = zone->org_delta; + + + /* we have two zones on the same reference position -- */ + /* only keep the largest one */ + if ( delta < 0 ) + { + if ( delta < delta0 ) + zone->org_delta = delta; + } + else + { + if ( delta > delta0 ) + zone->org_delta = delta; + } + goto Skip; + } + } + + for ( ; count > 0; count-- ) + zone[count] = zone[count-1]; + + zone->org_ref = reference; + zone->org_delta = delta; + + if ( top ) + count_top++; + else + count_bot++; + + Skip: + read += 2; + } + + top_table->count = count_top; + bot_table->count = count_bot; + } + + + /* Re-read blue zones from the original fonts and store them into out */ + /* private structure. This function re-orders, sanitizes and */ + /* fuzz-expands the zones as well. */ + static void + psh_blues_set_zones( PSH_Blues target, + FT_UInt count, + FT_Short* blues, + FT_UInt count_others, + FT_Short* other_blues, + FT_Int fuzz, + FT_Int family ) + { + PSH_Blue_Table top_table, bot_table; + FT_Int count_top, count_bot; + + + if ( family ) + { + top_table = &target->family_top; + bot_table = &target->family_bottom; + } + else + { + top_table = &target->normal_top; + bot_table = &target->normal_bottom; + } + + /* read the input blue zones, and build two sorted tables */ + /* (one for the top zones, the other for the bottom zones) */ + top_table->count = 0; + bot_table->count = 0; + + /* first, the blues */ + psh_blues_set_zones_0( target, 0, + count, blues, top_table, bot_table ); + psh_blues_set_zones_0( target, 1, + count_others, other_blues, top_table, bot_table ); + + count_top = top_table->count; + count_bot = bot_table->count; + + /* sanitize top table */ + if ( count_top > 0 ) + { + PSH_Blue_Zone zone = top_table->zones; + + + for ( count = count_top; count > 0; count--, zone++ ) + { + FT_Int delta; + + + if ( count > 1 ) + { + delta = zone[1].org_ref - zone[0].org_ref; + if ( zone->org_delta > delta ) + zone->org_delta = delta; + } + + zone->org_bottom = zone->org_ref; + zone->org_top = zone->org_delta + zone->org_ref; + } + } + + /* sanitize bottom table */ + if ( count_bot > 0 ) + { + PSH_Blue_Zone zone = bot_table->zones; + + + for ( count = count_bot; count > 0; count--, zone++ ) + { + FT_Int delta; + + + if ( count > 1 ) + { + delta = zone[0].org_ref - zone[1].org_ref; + if ( zone->org_delta < delta ) + zone->org_delta = delta; + } + + zone->org_top = zone->org_ref; + zone->org_bottom = zone->org_delta + zone->org_ref; + } + } + + /* expand top and bottom tables with blue fuzz */ + { + FT_Int dim, top, bot, delta; + PSH_Blue_Zone zone; + + + zone = top_table->zones; + count = count_top; + + for ( dim = 1; dim >= 0; dim-- ) + { + if ( count > 0 ) + { + /* expand the bottom of the lowest zone normally */ + zone->org_bottom -= fuzz; + + /* expand the top and bottom of intermediate zones; */ + /* checking that the interval is smaller than the fuzz */ + top = zone->org_top; + + for ( count--; count > 0; count-- ) + { + bot = zone[1].org_bottom; + delta = bot - top; + + if ( delta < 2 * fuzz ) + zone[0].org_top = zone[1].org_bottom = top + delta / 2; + else + { + zone[0].org_top = top + fuzz; + zone[1].org_bottom = bot - fuzz; + } + + zone++; + top = zone->org_top; + } + + /* expand the top of the highest zone normally */ + zone->org_top = top + fuzz; + } + zone = bot_table->zones; + count = count_bot; + } + } + } + + + /* reset the blues table when the device transform changes */ + static void + psh_blues_scale_zones( PSH_Blues blues, + FT_Fixed scale, + FT_Pos delta ) + { + FT_UInt count; + FT_UInt num; + PSH_Blue_Table table = 0; + + /* */ + /* Determine whether we need to suppress overshoots or */ + /* not. We simply need to compare the vertical scale */ + /* parameter to the raw bluescale value. Here is why: */ + /* */ + /* We need to suppress overshoots for all pointsizes. */ + /* At 300dpi that satisfies: */ + /* */ + /* pointsize < 240*bluescale + 0.49 */ + /* */ + /* This corresponds to: */ + /* */ + /* pixelsize < 1000*bluescale + 49/24 */ + /* */ + /* scale*EM_Size < 1000*bluescale + 49/24 */ + /* */ + /* However, for normal Type 1 fonts, EM_Size is 1000! */ + /* We thus only check: */ + /* */ + /* scale < bluescale + 49/24000 */ + /* */ + /* which we shorten to */ + /* */ + /* "scale < bluescale" */ + /* */ + /* Note that `blue_scale' is stored 1000 times its real */ + /* value, and that `scale' converts from font units to */ + /* fractional pixels. */ + /* */ + + /* 1000 / 64 = 125 / 8 */ + if ( scale >= 0x20C49BAL ) + blues->no_overshoots = FT_BOOL( scale < blues->blue_scale * 8 / 125 ); + else + blues->no_overshoots = FT_BOOL( scale * 125 < blues->blue_scale * 8 ); + + /* */ + /* The blue threshold is the font units distance under */ + /* which overshoots are suppressed due to the BlueShift */ + /* even if the scale is greater than BlueScale. */ + /* */ + /* It is the smallest distance such that */ + /* */ + /* dist <= BlueShift && dist*scale <= 0.5 pixels */ + /* */ + { + FT_Int threshold = blues->blue_shift; + + + while ( threshold > 0 && FT_MulFix( threshold, scale ) > 32 ) + threshold--; + + blues->blue_threshold = threshold; + } + + for ( num = 0; num < 4; num++ ) + { + PSH_Blue_Zone zone; + + + switch ( num ) + { + case 0: + table = &blues->normal_top; + break; + case 1: + table = &blues->normal_bottom; + break; + case 2: + table = &blues->family_top; + break; + default: + table = &blues->family_bottom; + break; + } + + zone = table->zones; + count = table->count; + for ( ; count > 0; count--, zone++ ) + { + zone->cur_top = FT_MulFix( zone->org_top, scale ) + delta; + zone->cur_bottom = FT_MulFix( zone->org_bottom, scale ) + delta; + zone->cur_ref = FT_MulFix( zone->org_ref, scale ) + delta; + zone->cur_delta = FT_MulFix( zone->org_delta, scale ); + + /* round scaled reference position */ + zone->cur_ref = FT_PIX_ROUND( zone->cur_ref ); + +#if 0 + if ( zone->cur_ref > zone->cur_top ) + zone->cur_ref -= 64; + else if ( zone->cur_ref < zone->cur_bottom ) + zone->cur_ref += 64; +#endif + } + } + + /* process the families now */ + + for ( num = 0; num < 2; num++ ) + { + PSH_Blue_Zone zone1, zone2; + FT_UInt count1, count2; + PSH_Blue_Table normal, family; + + + switch ( num ) + { + case 0: + normal = &blues->normal_top; + family = &blues->family_top; + break; + + default: + normal = &blues->normal_bottom; + family = &blues->family_bottom; + } + + zone1 = normal->zones; + count1 = normal->count; + + for ( ; count1 > 0; count1--, zone1++ ) + { + /* try to find a family zone whose reference position is less */ + /* than 1 pixel far from the current zone */ + zone2 = family->zones; + count2 = family->count; + + for ( ; count2 > 0; count2--, zone2++ ) + { + FT_Pos Delta; + + + Delta = zone1->org_ref - zone2->org_ref; + if ( Delta < 0 ) + Delta = -Delta; + + if ( FT_MulFix( Delta, scale ) < 64 ) + { + zone1->cur_top = zone2->cur_top; + zone1->cur_bottom = zone2->cur_bottom; + zone1->cur_ref = zone2->cur_ref; + zone1->cur_delta = zone2->cur_delta; + break; + } + } + } + } + } + + + FT_LOCAL_DEF( void ) + psh_blues_snap_stem( PSH_Blues blues, + FT_Int stem_top, + FT_Int stem_bot, + PSH_Alignment alignment ) + { + PSH_Blue_Table table; + FT_UInt count; + FT_Pos delta; + PSH_Blue_Zone zone; + FT_Int no_shoots; + + + alignment->align = PSH_BLUE_ALIGN_NONE; + + no_shoots = blues->no_overshoots; + + /* look up stem top in top zones table */ + table = &blues->normal_top; + count = table->count; + zone = table->zones; + + for ( ; count > 0; count--, zone++ ) + { + delta = stem_top - zone->org_bottom; + if ( delta < -blues->blue_fuzz ) + break; + + if ( stem_top <= zone->org_top + blues->blue_fuzz ) + { + if ( no_shoots || delta <= blues->blue_threshold ) + { + alignment->align |= PSH_BLUE_ALIGN_TOP; + alignment->align_top = zone->cur_ref; + } + break; + } + } + + /* look up stem bottom in bottom zones table */ + table = &blues->normal_bottom; + count = table->count; + zone = table->zones + count-1; + + for ( ; count > 0; count--, zone-- ) + { + delta = zone->org_top - stem_bot; + if ( delta < -blues->blue_fuzz ) + break; + + if ( stem_bot >= zone->org_bottom - blues->blue_fuzz ) + { + if ( no_shoots || delta < blues->blue_threshold ) + { + alignment->align |= PSH_BLUE_ALIGN_BOT; + alignment->align_bot = zone->cur_ref; + } + break; + } + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GLOBAL HINTS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + psh_globals_destroy( PSH_Globals globals ) + { + if ( globals ) + { + FT_Memory memory; + + + memory = globals->memory; + globals->dimension[0].stdw.count = 0; + globals->dimension[1].stdw.count = 0; + + globals->blues.normal_top.count = 0; + globals->blues.normal_bottom.count = 0; + globals->blues.family_top.count = 0; + globals->blues.family_bottom.count = 0; + + FT_FREE( globals ); + +#ifdef DEBUG_HINTER + ps_debug_globals = 0; +#endif + } + } + + + static FT_Error + psh_globals_new( FT_Memory memory, + T1_Private* priv, + PSH_Globals *aglobals ) + { + PSH_Globals globals; + FT_Error error; + + + if ( !FT_NEW( globals ) ) + { + FT_UInt count; + FT_Short* read; + + + globals->memory = memory; + + /* copy standard widths */ + { + PSH_Dimension dim = &globals->dimension[1]; + PSH_Width write = dim->stdw.widths; + + + write->org = priv->standard_width[0]; + write++; + + read = priv->snap_widths; + for ( count = priv->num_snap_widths; count > 0; count-- ) + { + write->org = *read; + write++; + read++; + } + + dim->stdw.count = priv->num_snap_widths + 1; + } + + /* copy standard heights */ + { + PSH_Dimension dim = &globals->dimension[0]; + PSH_Width write = dim->stdw.widths; + + + write->org = priv->standard_height[0]; + write++; + read = priv->snap_heights; + for ( count = priv->num_snap_heights; count > 0; count-- ) + { + write->org = *read; + write++; + read++; + } + + dim->stdw.count = priv->num_snap_heights + 1; + } + + /* copy blue zones */ + psh_blues_set_zones( &globals->blues, priv->num_blue_values, + priv->blue_values, priv->num_other_blues, + priv->other_blues, priv->blue_fuzz, 0 ); + + psh_blues_set_zones( &globals->blues, priv->num_family_blues, + priv->family_blues, priv->num_family_other_blues, + priv->family_other_blues, priv->blue_fuzz, 1 ); + + globals->blues.blue_scale = priv->blue_scale; + globals->blues.blue_shift = priv->blue_shift; + globals->blues.blue_fuzz = priv->blue_fuzz; + + globals->dimension[0].scale_mult = 0; + globals->dimension[0].scale_delta = 0; + globals->dimension[1].scale_mult = 0; + globals->dimension[1].scale_delta = 0; + +#ifdef DEBUG_HINTER + ps_debug_globals = globals; +#endif + } + + *aglobals = globals; + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + psh_globals_set_scale( PSH_Globals globals, + FT_Fixed x_scale, + FT_Fixed y_scale, + FT_Fixed x_delta, + FT_Fixed y_delta ) + { + PSH_Dimension dim = &globals->dimension[0]; + + + dim = &globals->dimension[0]; + if ( x_scale != dim->scale_mult || + x_delta != dim->scale_delta ) + { + dim->scale_mult = x_scale; + dim->scale_delta = x_delta; + + psh_globals_scale_widths( globals, 0 ); + } + + dim = &globals->dimension[1]; + if ( y_scale != dim->scale_mult || + y_delta != dim->scale_delta ) + { + dim->scale_mult = y_scale; + dim->scale_delta = y_delta; + + psh_globals_scale_widths( globals, 1 ); + psh_blues_scale_zones( &globals->blues, y_scale, y_delta ); + } + + return 0; + } + + + FT_LOCAL_DEF( void ) + psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs ) + { + funcs->create = psh_globals_new; + funcs->set_scale = psh_globals_set_scale; + funcs->destroy = psh_globals_destroy; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.h b/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.h index c511626157a..4ceda71a75a 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.h +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshglob.h @@ -1,196 +1,196 @@ -/***************************************************************************/ -/* */ -/* pshglob.h */ -/* */ -/* PostScript hinter global hinting management. */ -/* */ -/* Copyright 2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSHGLOB_H__ -#define __PSHGLOB_H__ - - -#include FT_FREETYPE_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GLOBAL HINTS INTERNALS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* @constant: */ - /* PS_GLOBALS_MAX_BLUE_ZONES */ - /* */ - /* @description: */ - /* The maximum number of blue zones in a font global hints structure. */ - /* See @PS_Globals_BluesRec. */ - /* */ -#define PS_GLOBALS_MAX_BLUE_ZONES 16 - - - /*************************************************************************/ - /* */ - /* @constant: */ - /* PS_GLOBALS_MAX_STD_WIDTHS */ - /* */ - /* @description: */ - /* The maximum number of standard and snap widths in either the */ - /* horizontal or vertical direction. See @PS_Globals_WidthsRec. */ - /* */ -#define PS_GLOBALS_MAX_STD_WIDTHS 16 - - - /* standard and snap width */ - typedef struct PSH_WidthRec_ - { - FT_Int org; - FT_Pos cur; - FT_Pos fit; - - } PSH_WidthRec, *PSH_Width; - - - /* standard and snap widths table */ - typedef struct PSH_WidthsRec_ - { - FT_UInt count; - PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS]; - - } PSH_WidthsRec, *PSH_Widths; - - - typedef struct PSH_DimensionRec_ - { - PSH_WidthsRec stdw; - FT_Fixed scale_mult; - FT_Fixed scale_delta; - - } PSH_DimensionRec, *PSH_Dimension; - - - /* blue zone descriptor */ - typedef struct PSH_Blue_ZoneRec_ - { - FT_Int org_ref; - FT_Int org_delta; - FT_Int org_top; - FT_Int org_bottom; - - FT_Pos cur_ref; - FT_Pos cur_delta; - FT_Pos cur_bottom; - FT_Pos cur_top; - - } PSH_Blue_ZoneRec, *PSH_Blue_Zone; - - - typedef struct PSH_Blue_TableRec_ - { - FT_UInt count; - PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES]; - - } PSH_Blue_TableRec, *PSH_Blue_Table; - - - /* blue zones table */ - typedef struct PSH_BluesRec_ - { - PSH_Blue_TableRec normal_top; - PSH_Blue_TableRec normal_bottom; - PSH_Blue_TableRec family_top; - PSH_Blue_TableRec family_bottom; - - FT_Fixed blue_scale; - FT_Int blue_shift; - FT_Int blue_threshold; - FT_Int blue_fuzz; - FT_Bool no_overshoots; - - } PSH_BluesRec, *PSH_Blues; - - - /* font globals. */ - /* dimension 0 => X coordinates + vertical hints/stems */ - /* dimension 1 => Y coordinates + horizontal hints/stems */ - typedef struct PSH_GlobalsRec_ - { - FT_Memory memory; - PSH_DimensionRec dimension[2]; - PSH_BluesRec blues; - - } PSH_GlobalsRec; - - -#define PSH_BLUE_ALIGN_NONE 0 -#define PSH_BLUE_ALIGN_TOP 1 -#define PSH_BLUE_ALIGN_BOT 2 - - - typedef struct PSH_AlignmentRec_ - { - int align; - FT_Pos align_top; - FT_Pos align_bot; - - } PSH_AlignmentRec, *PSH_Alignment; - - - FT_LOCAL( void ) - psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs ); - - -#if 0 - /* snap a stem width to fitter coordinates. `org_width' is in font */ - /* units. The result is in device pixels (26.6 format). */ - FT_LOCAL( FT_Pos ) - psh_dimension_snap_width( PSH_Dimension dimension, - FT_Int org_width ); -#endif - - FT_LOCAL( FT_Error ) - psh_globals_set_scale( PSH_Globals globals, - FT_Fixed x_scale, - FT_Fixed y_scale, - FT_Fixed x_delta, - FT_Fixed y_delta ); - - /* snap a stem to one or two blue zones */ - FT_LOCAL( void ) - psh_blues_snap_stem( PSH_Blues blues, - FT_Int stem_top, - FT_Int stem_bot, - PSH_Alignment alignment ); - /* */ - -#ifdef DEBUG_HINTER - extern PSH_Globals ps_debug_globals; -#endif - - -FT_END_HEADER - - -#endif /* __PSHGLOB_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pshglob.h */ +/* */ +/* PostScript hinter global hinting management. */ +/* */ +/* Copyright 2001, 2002, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSHGLOB_H__ +#define __PSHGLOB_H__ + + +#include FT_FREETYPE_H +#include FT_INTERNAL_POSTSCRIPT_HINTS_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GLOBAL HINTS INTERNALS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* @constant: */ + /* PS_GLOBALS_MAX_BLUE_ZONES */ + /* */ + /* @description: */ + /* The maximum number of blue zones in a font global hints structure. */ + /* See @PS_Globals_BluesRec. */ + /* */ +#define PS_GLOBALS_MAX_BLUE_ZONES 16 + + + /*************************************************************************/ + /* */ + /* @constant: */ + /* PS_GLOBALS_MAX_STD_WIDTHS */ + /* */ + /* @description: */ + /* The maximum number of standard and snap widths in either the */ + /* horizontal or vertical direction. See @PS_Globals_WidthsRec. */ + /* */ +#define PS_GLOBALS_MAX_STD_WIDTHS 16 + + + /* standard and snap width */ + typedef struct PSH_WidthRec_ + { + FT_Int org; + FT_Pos cur; + FT_Pos fit; + + } PSH_WidthRec, *PSH_Width; + + + /* standard and snap widths table */ + typedef struct PSH_WidthsRec_ + { + FT_UInt count; + PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS]; + + } PSH_WidthsRec, *PSH_Widths; + + + typedef struct PSH_DimensionRec_ + { + PSH_WidthsRec stdw; + FT_Fixed scale_mult; + FT_Fixed scale_delta; + + } PSH_DimensionRec, *PSH_Dimension; + + + /* blue zone descriptor */ + typedef struct PSH_Blue_ZoneRec_ + { + FT_Int org_ref; + FT_Int org_delta; + FT_Int org_top; + FT_Int org_bottom; + + FT_Pos cur_ref; + FT_Pos cur_delta; + FT_Pos cur_bottom; + FT_Pos cur_top; + + } PSH_Blue_ZoneRec, *PSH_Blue_Zone; + + + typedef struct PSH_Blue_TableRec_ + { + FT_UInt count; + PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES]; + + } PSH_Blue_TableRec, *PSH_Blue_Table; + + + /* blue zones table */ + typedef struct PSH_BluesRec_ + { + PSH_Blue_TableRec normal_top; + PSH_Blue_TableRec normal_bottom; + PSH_Blue_TableRec family_top; + PSH_Blue_TableRec family_bottom; + + FT_Fixed blue_scale; + FT_Int blue_shift; + FT_Int blue_threshold; + FT_Int blue_fuzz; + FT_Bool no_overshoots; + + } PSH_BluesRec, *PSH_Blues; + + + /* font globals. */ + /* dimension 0 => X coordinates + vertical hints/stems */ + /* dimension 1 => Y coordinates + horizontal hints/stems */ + typedef struct PSH_GlobalsRec_ + { + FT_Memory memory; + PSH_DimensionRec dimension[2]; + PSH_BluesRec blues; + + } PSH_GlobalsRec; + + +#define PSH_BLUE_ALIGN_NONE 0 +#define PSH_BLUE_ALIGN_TOP 1 +#define PSH_BLUE_ALIGN_BOT 2 + + + typedef struct PSH_AlignmentRec_ + { + int align; + FT_Pos align_top; + FT_Pos align_bot; + + } PSH_AlignmentRec, *PSH_Alignment; + + + FT_LOCAL( void ) + psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs ); + + +#if 0 + /* snap a stem width to fitter coordinates. `org_width' is in font */ + /* units. The result is in device pixels (26.6 format). */ + FT_LOCAL( FT_Pos ) + psh_dimension_snap_width( PSH_Dimension dimension, + FT_Int org_width ); +#endif + + FT_LOCAL( FT_Error ) + psh_globals_set_scale( PSH_Globals globals, + FT_Fixed x_scale, + FT_Fixed y_scale, + FT_Fixed x_delta, + FT_Fixed y_delta ); + + /* snap a stem to one or two blue zones */ + FT_LOCAL( void ) + psh_blues_snap_stem( PSH_Blues blues, + FT_Int stem_top, + FT_Int stem_bot, + PSH_Alignment alignment ); + /* */ + +#ifdef DEBUG_HINTER + extern PSH_Globals ps_debug_globals; +#endif + + +FT_END_HEADER + + +#endif /* __PSHGLOB_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshinter.c b/reactos/dll/3rdparty/freetype/src/pshinter/pshinter.c index 8e3f193093b..fabf797ddbc 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshinter.c +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshinter.c @@ -1,28 +1,28 @@ -/***************************************************************************/ -/* */ -/* pshinter.c */ -/* */ -/* FreeType PostScript Hinting module */ -/* */ -/* Copyright 2001, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "pshrec.c" -#include "pshglob.c" -#include "pshalgo.c" -#include "pshmod.c" - - -/* END */ +/***************************************************************************/ +/* */ +/* pshinter.c */ +/* */ +/* FreeType PostScript Hinting module */ +/* */ +/* Copyright 2001, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "pshrec.c" +#include "pshglob.c" +#include "pshalgo.c" +#include "pshmod.c" + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.c b/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.c index 4eb3d912729..8e37cf24826 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.c +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.c @@ -1,121 +1,121 @@ -/***************************************************************************/ -/* */ -/* pshmod.c */ -/* */ -/* FreeType PostScript hinter module implementation (body). */ -/* */ -/* Copyright 2001, 2002, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_OBJECTS_H -#include "pshrec.h" -#include "pshalgo.h" - - - /* the Postscript Hinter module structure */ - typedef struct PS_Hinter_Module_Rec_ - { - FT_ModuleRec root; - PS_HintsRec ps_hints; - - PSH_Globals_FuncsRec globals_funcs; - T1_Hints_FuncsRec t1_funcs; - T2_Hints_FuncsRec t2_funcs; - - } PS_Hinter_ModuleRec, *PS_Hinter_Module; - - - /* finalize module */ - FT_CALLBACK_DEF( void ) - ps_hinter_done( PS_Hinter_Module module ) - { - module->t1_funcs.hints = NULL; - module->t2_funcs.hints = NULL; - - ps_hints_done( &module->ps_hints ); - } - - - /* initialize module, create hints recorder and the interface */ - FT_CALLBACK_DEF( FT_Error ) - ps_hinter_init( PS_Hinter_Module module ) - { - FT_Memory memory = module->root.memory; - void* ph = &module->ps_hints; - - - ps_hints_init( &module->ps_hints, memory ); - - psh_globals_funcs_init( &module->globals_funcs ); - - t1_hints_funcs_init( &module->t1_funcs ); - module->t1_funcs.hints = (T1_Hints)ph; - - t2_hints_funcs_init( &module->t2_funcs ); - module->t2_funcs.hints = (T2_Hints)ph; - - return 0; - } - - - /* returns global hints interface */ - FT_CALLBACK_DEF( PSH_Globals_Funcs ) - pshinter_get_globals_funcs( FT_Module module ) - { - return &((PS_Hinter_Module)module)->globals_funcs; - } - - - /* return Type 1 hints interface */ - FT_CALLBACK_DEF( T1_Hints_Funcs ) - pshinter_get_t1_funcs( FT_Module module ) - { - return &((PS_Hinter_Module)module)->t1_funcs; - } - - - /* return Type 2 hints interface */ - FT_CALLBACK_DEF( T2_Hints_Funcs ) - pshinter_get_t2_funcs( FT_Module module ) - { - return &((PS_Hinter_Module)module)->t2_funcs; - } - - - static - const PSHinter_Interface pshinter_interface = - { - pshinter_get_globals_funcs, - pshinter_get_t1_funcs, - pshinter_get_t2_funcs - }; - - - FT_CALLBACK_TABLE_DEF - const FT_Module_Class pshinter_module_class = - { - 0, - sizeof ( PS_Hinter_ModuleRec ), - "pshinter", - 0x10000L, - 0x20000L, - - &pshinter_interface, /* module-specific interface */ - - (FT_Module_Constructor)ps_hinter_init, - (FT_Module_Destructor) ps_hinter_done, - (FT_Module_Requester) 0 /* no additional interface for now */ - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* pshmod.c */ +/* */ +/* FreeType PostScript hinter module implementation (body). */ +/* */ +/* Copyright 2001, 2002, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_OBJECTS_H +#include "pshrec.h" +#include "pshalgo.h" + + + /* the Postscript Hinter module structure */ + typedef struct PS_Hinter_Module_Rec_ + { + FT_ModuleRec root; + PS_HintsRec ps_hints; + + PSH_Globals_FuncsRec globals_funcs; + T1_Hints_FuncsRec t1_funcs; + T2_Hints_FuncsRec t2_funcs; + + } PS_Hinter_ModuleRec, *PS_Hinter_Module; + + + /* finalize module */ + FT_CALLBACK_DEF( void ) + ps_hinter_done( PS_Hinter_Module module ) + { + module->t1_funcs.hints = NULL; + module->t2_funcs.hints = NULL; + + ps_hints_done( &module->ps_hints ); + } + + + /* initialize module, create hints recorder and the interface */ + FT_CALLBACK_DEF( FT_Error ) + ps_hinter_init( PS_Hinter_Module module ) + { + FT_Memory memory = module->root.memory; + void* ph = &module->ps_hints; + + + ps_hints_init( &module->ps_hints, memory ); + + psh_globals_funcs_init( &module->globals_funcs ); + + t1_hints_funcs_init( &module->t1_funcs ); + module->t1_funcs.hints = (T1_Hints)ph; + + t2_hints_funcs_init( &module->t2_funcs ); + module->t2_funcs.hints = (T2_Hints)ph; + + return 0; + } + + + /* returns global hints interface */ + FT_CALLBACK_DEF( PSH_Globals_Funcs ) + pshinter_get_globals_funcs( FT_Module module ) + { + return &((PS_Hinter_Module)module)->globals_funcs; + } + + + /* return Type 1 hints interface */ + FT_CALLBACK_DEF( T1_Hints_Funcs ) + pshinter_get_t1_funcs( FT_Module module ) + { + return &((PS_Hinter_Module)module)->t1_funcs; + } + + + /* return Type 2 hints interface */ + FT_CALLBACK_DEF( T2_Hints_Funcs ) + pshinter_get_t2_funcs( FT_Module module ) + { + return &((PS_Hinter_Module)module)->t2_funcs; + } + + + static + const PSHinter_Interface pshinter_interface = + { + pshinter_get_globals_funcs, + pshinter_get_t1_funcs, + pshinter_get_t2_funcs + }; + + + FT_CALLBACK_TABLE_DEF + const FT_Module_Class pshinter_module_class = + { + 0, + sizeof ( PS_Hinter_ModuleRec ), + "pshinter", + 0x10000L, + 0x20000L, + + &pshinter_interface, /* module-specific interface */ + + (FT_Module_Constructor)ps_hinter_init, + (FT_Module_Destructor) ps_hinter_done, + (FT_Module_Requester) 0 /* no additional interface for now */ + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.h b/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.h index 1a91025b260..94e2cc6689a 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.h +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshmod.h @@ -1,39 +1,39 @@ -/***************************************************************************/ -/* */ -/* pshmod.h */ -/* */ -/* PostScript hinter module interface (specification). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSHMOD_H__ -#define __PSHMOD_H__ - - -#include -#include FT_MODULE_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Module_Class ) pshinter_module_class; - - -FT_END_HEADER - - -#endif /* __PSHMOD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pshmod.h */ +/* */ +/* PostScript hinter module interface (specification). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSHMOD_H__ +#define __PSHMOD_H__ + + +#include +#include FT_MODULE_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Module_Class ) pshinter_module_class; + + +FT_END_HEADER + + +#endif /* __PSHMOD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshnterr.h b/reactos/dll/3rdparty/freetype/src/pshinter/pshnterr.h index 3c0029fbf39..806d90b24af 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshnterr.h +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshnterr.h @@ -1,40 +1,40 @@ -/***************************************************************************/ -/* */ -/* pshnterr.h */ -/* */ -/* PS Hinter error codes (specification only). */ -/* */ -/* Copyright 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the PSHinter error enumeration constants. */ - /* */ - /*************************************************************************/ - -#ifndef __PSHNTERR_H__ -#define __PSHNTERR_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX PSH_Err_ -#define FT_ERR_BASE FT_Mod_Err_PShinter - -#include FT_ERRORS_H - -#endif /* __PSHNTERR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pshnterr.h */ +/* */ +/* PS Hinter error codes (specification only). */ +/* */ +/* Copyright 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the PSHinter error enumeration constants. */ + /* */ + /*************************************************************************/ + +#ifndef __PSHNTERR_H__ +#define __PSHNTERR_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX PSH_Err_ +#define FT_ERR_BASE FT_Mod_Err_PShinter + +#include FT_ERRORS_H + +#endif /* __PSHNTERR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.c b/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.c index 2a885ef2763..d8ad1192d01 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.c +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.c @@ -1,1215 +1,1215 @@ -/***************************************************************************/ -/* */ -/* pshrec.c */ -/* */ -/* FreeType PostScript hints recorder (body). */ -/* */ -/* Copyright 2001, 2002, 2003, 2004, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_FREETYPE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include "pshrec.h" -#include "pshalgo.h" - -#include "pshnterr.h" - -#undef FT_COMPONENT -#define FT_COMPONENT trace_pshrec - -#ifdef DEBUG_HINTER - PS_Hints ps_debug_hints = 0; - int ps_debug_no_horz_hints = 0; - int ps_debug_no_vert_hints = 0; -#endif - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PS_HINT MANAGEMENT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* destroy hints table */ - static void - ps_hint_table_done( PS_Hint_Table table, - FT_Memory memory ) - { - FT_FREE( table->hints ); - table->num_hints = 0; - table->max_hints = 0; - } - - - /* ensure that a table can contain "count" elements */ - static FT_Error - ps_hint_table_ensure( PS_Hint_Table table, - FT_UInt count, - FT_Memory memory ) - { - FT_UInt old_max = table->max_hints; - FT_UInt new_max = count; - FT_Error error = 0; - - - if ( new_max > old_max ) - { - /* try to grow the table */ - new_max = FT_PAD_CEIL( new_max, 8 ); - if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) ) - table->max_hints = new_max; - } - return error; - } - - - static FT_Error - ps_hint_table_alloc( PS_Hint_Table table, - FT_Memory memory, - PS_Hint *ahint ) - { - FT_Error error = 0; - FT_UInt count; - PS_Hint hint = 0; - - - count = table->num_hints; - count++; - - if ( count >= table->max_hints ) - { - error = ps_hint_table_ensure( table, count, memory ); - if ( error ) - goto Exit; - } - - hint = table->hints + count - 1; - hint->pos = 0; - hint->len = 0; - hint->flags = 0; - - table->num_hints = count; - - Exit: - *ahint = hint; - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PS_MASK MANAGEMENT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* destroy mask */ - static void - ps_mask_done( PS_Mask mask, - FT_Memory memory ) - { - FT_FREE( mask->bytes ); - mask->num_bits = 0; - mask->max_bits = 0; - mask->end_point = 0; - } - - - /* ensure that a mask can contain "count" bits */ - static FT_Error - ps_mask_ensure( PS_Mask mask, - FT_UInt count, - FT_Memory memory ) - { - FT_UInt old_max = ( mask->max_bits + 7 ) >> 3; - FT_UInt new_max = ( count + 7 ) >> 3; - FT_Error error = 0; - - - if ( new_max > old_max ) - { - new_max = FT_PAD_CEIL( new_max, 8 ); - if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) ) - mask->max_bits = new_max * 8; - } - return error; - } - - - /* test a bit value in a given mask */ - static FT_Int - ps_mask_test_bit( PS_Mask mask, - FT_Int idx ) - { - if ( (FT_UInt)idx >= mask->num_bits ) - return 0; - - return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) ); - } - - - /* clear a given bit */ - static void - ps_mask_clear_bit( PS_Mask mask, - FT_Int idx ) - { - FT_Byte* p; - - - if ( (FT_UInt)idx >= mask->num_bits ) - return; - - p = mask->bytes + ( idx >> 3 ); - p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( idx & 7 ) ) ); - } - - - /* set a given bit, possibly grow the mask */ - static FT_Error - ps_mask_set_bit( PS_Mask mask, - FT_Int idx, - FT_Memory memory ) - { - FT_Error error = 0; - FT_Byte* p; - - - if ( idx < 0 ) - goto Exit; - - if ( (FT_UInt)idx >= mask->num_bits ) - { - error = ps_mask_ensure( mask, idx + 1, memory ); - if ( error ) - goto Exit; - - mask->num_bits = idx + 1; - } - - p = mask->bytes + ( idx >> 3 ); - p[0] = (FT_Byte)( p[0] | ( 0x80 >> ( idx & 7 ) ) ); - - Exit: - return error; - } - - - /* destroy mask table */ - static void - ps_mask_table_done( PS_Mask_Table table, - FT_Memory memory ) - { - FT_UInt count = table->max_masks; - PS_Mask mask = table->masks; - - - for ( ; count > 0; count--, mask++ ) - ps_mask_done( mask, memory ); - - FT_FREE( table->masks ); - table->num_masks = 0; - table->max_masks = 0; - } - - - /* ensure that a mask table can contain "count" masks */ - static FT_Error - ps_mask_table_ensure( PS_Mask_Table table, - FT_UInt count, - FT_Memory memory ) - { - FT_UInt old_max = table->max_masks; - FT_UInt new_max = count; - FT_Error error = 0; - - - if ( new_max > old_max ) - { - new_max = FT_PAD_CEIL( new_max, 8 ); - if ( !FT_RENEW_ARRAY( table->masks, old_max, new_max ) ) - table->max_masks = new_max; - } - return error; - } - - - /* allocate a new mask in a table */ - static FT_Error - ps_mask_table_alloc( PS_Mask_Table table, - FT_Memory memory, - PS_Mask *amask ) - { - FT_UInt count; - FT_Error error = 0; - PS_Mask mask = 0; - - - count = table->num_masks; - count++; - - if ( count > table->max_masks ) - { - error = ps_mask_table_ensure( table, count, memory ); - if ( error ) - goto Exit; - } - - mask = table->masks + count - 1; - mask->num_bits = 0; - mask->end_point = 0; - table->num_masks = count; - - Exit: - *amask = mask; - return error; - } - - - /* return last hint mask in a table, create one if the table is empty */ - static FT_Error - ps_mask_table_last( PS_Mask_Table table, - FT_Memory memory, - PS_Mask *amask ) - { - FT_Error error = 0; - FT_UInt count; - PS_Mask mask; - - - count = table->num_masks; - if ( count == 0 ) - { - error = ps_mask_table_alloc( table, memory, &mask ); - if ( error ) - goto Exit; - } - else - mask = table->masks + count - 1; - - Exit: - *amask = mask; - return error; - } - - - /* set a new mask to a given bit range */ - static FT_Error - ps_mask_table_set_bits( PS_Mask_Table table, - const FT_Byte* source, - FT_UInt bit_pos, - FT_UInt bit_count, - FT_Memory memory ) - { - FT_Error error = 0; - PS_Mask mask; - - - error = ps_mask_table_last( table, memory, &mask ); - if ( error ) - goto Exit; - - error = ps_mask_ensure( mask, bit_count, memory ); - if ( error ) - goto Exit; - - mask->num_bits = bit_count; - - /* now, copy bits */ - { - FT_Byte* read = (FT_Byte*)source + ( bit_pos >> 3 ); - FT_Int rmask = 0x80 >> ( bit_pos & 7 ); - FT_Byte* write = mask->bytes; - FT_Int wmask = 0x80; - FT_Int val; - - - for ( ; bit_count > 0; bit_count-- ) - { - val = write[0] & ~wmask; - - if ( read[0] & rmask ) - val |= wmask; - - write[0] = (FT_Byte)val; - - rmask >>= 1; - if ( rmask == 0 ) - { - read++; - rmask = 0x80; - } - - wmask >>= 1; - if ( wmask == 0 ) - { - write++; - wmask = 0x80; - } - } - } - - Exit: - return error; - } - - - /* test whether two masks in a table intersect */ - static FT_Int - ps_mask_table_test_intersect( PS_Mask_Table table, - FT_Int index1, - FT_Int index2 ) - { - PS_Mask mask1 = table->masks + index1; - PS_Mask mask2 = table->masks + index2; - FT_Byte* p1 = mask1->bytes; - FT_Byte* p2 = mask2->bytes; - FT_UInt count1 = mask1->num_bits; - FT_UInt count2 = mask2->num_bits; - FT_UInt count; - - - count = ( count1 <= count2 ) ? count1 : count2; - for ( ; count >= 8; count -= 8 ) - { - if ( p1[0] & p2[0] ) - return 1; - - p1++; - p2++; - } - - if ( count == 0 ) - return 0; - - return ( p1[0] & p2[0] ) & ~( 0xFF >> count ); - } - - - /* merge two masks, used by ps_mask_table_merge_all */ - static FT_Error - ps_mask_table_merge( PS_Mask_Table table, - FT_Int index1, - FT_Int index2, - FT_Memory memory ) - { - FT_UInt temp; - FT_Error error = 0; - - - /* swap index1 and index2 so that index1 < index2 */ - if ( index1 > index2 ) - { - temp = index1; - index1 = index2; - index2 = temp; - } - - if ( index1 < index2 && index1 >= 0 && index2 < (FT_Int)table->num_masks ) - { - /* we need to merge the bitsets of index1 and index2 with a */ - /* simple union */ - PS_Mask mask1 = table->masks + index1; - PS_Mask mask2 = table->masks + index2; - FT_UInt count1 = mask1->num_bits; - FT_UInt count2 = mask2->num_bits; - FT_Int delta; - - - if ( count2 > 0 ) - { - FT_UInt pos; - FT_Byte* read; - FT_Byte* write; - - - /* if "count2" is greater than "count1", we need to grow the */ - /* first bitset, and clear the highest bits */ - if ( count2 > count1 ) - { - error = ps_mask_ensure( mask1, count2, memory ); - if ( error ) - goto Exit; - - for ( pos = count1; pos < count2; pos++ ) - ps_mask_clear_bit( mask1, pos ); - } - - /* merge (unite) the bitsets */ - read = mask2->bytes; - write = mask1->bytes; - pos = (FT_UInt)( ( count2 + 7 ) >> 3 ); - - for ( ; pos > 0; pos-- ) - { - write[0] = (FT_Byte)( write[0] | read[0] ); - write++; - read++; - } - } - - /* Now, remove "mask2" from the list. We need to keep the masks */ - /* sorted in order of importance, so move table elements. */ - mask2->num_bits = 0; - mask2->end_point = 0; - - delta = table->num_masks - 1 - index2; /* number of masks to move */ - if ( delta > 0 ) - { - /* move to end of table for reuse */ - PS_MaskRec dummy = *mask2; - - - ft_memmove( mask2, mask2 + 1, delta * sizeof ( PS_MaskRec ) ); - - mask2[delta] = dummy; - } - - table->num_masks--; - } - else - FT_ERROR(( "ps_mask_table_merge: ignoring invalid indices (%d,%d)\n", - index1, index2 )); - - Exit: - return error; - } - - - /* Try to merge all masks in a given table. This is used to merge */ - /* all counter masks into independent counter "paths". */ - /* */ - static FT_Error - ps_mask_table_merge_all( PS_Mask_Table table, - FT_Memory memory ) - { - FT_Int index1, index2; - FT_Error error = 0; - - - for ( index1 = table->num_masks - 1; index1 > 0; index1-- ) - { - for ( index2 = index1 - 1; index2 >= 0; index2-- ) - { - if ( ps_mask_table_test_intersect( table, index1, index2 ) ) - { - error = ps_mask_table_merge( table, index2, index1, memory ); - if ( error ) - goto Exit; - - break; - } - } - } - - Exit: - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PS_DIMENSION MANAGEMENT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /* finalize a given dimension */ - static void - ps_dimension_done( PS_Dimension dimension, - FT_Memory memory ) - { - ps_mask_table_done( &dimension->counters, memory ); - ps_mask_table_done( &dimension->masks, memory ); - ps_hint_table_done( &dimension->hints, memory ); - } - - - /* initialize a given dimension */ - static void - ps_dimension_init( PS_Dimension dimension ) - { - dimension->hints.num_hints = 0; - dimension->masks.num_masks = 0; - dimension->counters.num_masks = 0; - } - - -#if 0 - - /* set a bit at a given index in the current hint mask */ - static FT_Error - ps_dimension_set_mask_bit( PS_Dimension dim, - FT_UInt idx, - FT_Memory memory ) - { - PS_Mask mask; - FT_Error error = 0; - - - /* get last hint mask */ - error = ps_mask_table_last( &dim->masks, memory, &mask ); - if ( error ) - goto Exit; - - error = ps_mask_set_bit( mask, idx, memory ); - - Exit: - return error; - } - -#endif - - /* set the end point in a mask, called from "End" & "Reset" methods */ - static void - ps_dimension_end_mask( PS_Dimension dim, - FT_UInt end_point ) - { - FT_UInt count = dim->masks.num_masks; - PS_Mask mask; - - - if ( count > 0 ) - { - mask = dim->masks.masks + count - 1; - mask->end_point = end_point; - } - } - - - /* set the end point in the current mask, then create a new empty one */ - /* (called by "Reset" method) */ - static FT_Error - ps_dimension_reset_mask( PS_Dimension dim, - FT_UInt end_point, - FT_Memory memory ) - { - PS_Mask mask; - - - /* end current mask */ - ps_dimension_end_mask( dim, end_point ); - - /* allocate new one */ - return ps_mask_table_alloc( &dim->masks, memory, &mask ); - } - - - /* set a new mask, called from the "T2Stem" method */ - static FT_Error - ps_dimension_set_mask_bits( PS_Dimension dim, - const FT_Byte* source, - FT_UInt source_pos, - FT_UInt source_bits, - FT_UInt end_point, - FT_Memory memory ) - { - FT_Error error = 0; - - - /* reset current mask, if any */ - error = ps_dimension_reset_mask( dim, end_point, memory ); - if ( error ) - goto Exit; - - /* set bits in new mask */ - error = ps_mask_table_set_bits( &dim->masks, source, - source_pos, source_bits, memory ); - - Exit: - return error; - } - - - /* add a new single stem (called from "T1Stem" method) */ - static FT_Error - ps_dimension_add_t1stem( PS_Dimension dim, - FT_Int pos, - FT_Int len, - FT_Memory memory, - FT_Int *aindex ) - { - FT_Error error = 0; - FT_UInt flags = 0; - - - /* detect ghost stem */ - if ( len < 0 ) - { - flags |= PS_HINT_FLAG_GHOST; - if ( len == -21 ) - { - flags |= PS_HINT_FLAG_BOTTOM; - pos += len; - } - len = 0; - } - - if ( aindex ) - *aindex = -1; - - /* now, lookup stem in the current hints table */ - { - PS_Mask mask; - FT_UInt idx; - FT_UInt max = dim->hints.num_hints; - PS_Hint hint = dim->hints.hints; - - - for ( idx = 0; idx < max; idx++, hint++ ) - { - if ( hint->pos == pos && hint->len == len ) - break; - } - - /* we need to create a new hint in the table */ - if ( idx >= max ) - { - error = ps_hint_table_alloc( &dim->hints, memory, &hint ); - if ( error ) - goto Exit; - - hint->pos = pos; - hint->len = len; - hint->flags = flags; - } - - /* now, store the hint in the current mask */ - error = ps_mask_table_last( &dim->masks, memory, &mask ); - if ( error ) - goto Exit; - - error = ps_mask_set_bit( mask, idx, memory ); - if ( error ) - goto Exit; - - if ( aindex ) - *aindex = (FT_Int)idx; - } - - Exit: - return error; - } - - - /* add a "hstem3/vstem3" counter to our dimension table */ - static FT_Error - ps_dimension_add_counter( PS_Dimension dim, - FT_Int hint1, - FT_Int hint2, - FT_Int hint3, - FT_Memory memory ) - { - FT_Error error = 0; - FT_UInt count = dim->counters.num_masks; - PS_Mask counter = dim->counters.masks; - - - /* try to find an existing counter mask that already uses */ - /* one of these stems here */ - for ( ; count > 0; count--, counter++ ) - { - if ( ps_mask_test_bit( counter, hint1 ) || - ps_mask_test_bit( counter, hint2 ) || - ps_mask_test_bit( counter, hint3 ) ) - break; - } - - /* create a new counter when needed */ - if ( count == 0 ) - { - error = ps_mask_table_alloc( &dim->counters, memory, &counter ); - if ( error ) - goto Exit; - } - - /* now, set the bits for our hints in the counter mask */ - error = ps_mask_set_bit( counter, hint1, memory ); - if ( error ) - goto Exit; - - error = ps_mask_set_bit( counter, hint2, memory ); - if ( error ) - goto Exit; - - error = ps_mask_set_bit( counter, hint3, memory ); - if ( error ) - goto Exit; - - Exit: - return error; - } - - - /* end of recording session for a given dimension */ - static FT_Error - ps_dimension_end( PS_Dimension dim, - FT_UInt end_point, - FT_Memory memory ) - { - /* end hint mask table */ - ps_dimension_end_mask( dim, end_point ); - - /* merge all counter masks into independent "paths" */ - return ps_mask_table_merge_all( &dim->counters, memory ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** PS_RECORDER MANAGEMENT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /* destroy hints */ - FT_LOCAL( void ) - ps_hints_done( PS_Hints hints ) - { - FT_Memory memory = hints->memory; - - - ps_dimension_done( &hints->dimension[0], memory ); - ps_dimension_done( &hints->dimension[1], memory ); - - hints->error = 0; - hints->memory = 0; - } - - - FT_LOCAL( FT_Error ) - ps_hints_init( PS_Hints hints, - FT_Memory memory ) - { - FT_MEM_ZERO( hints, sizeof ( *hints ) ); - hints->memory = memory; - return 0; - } - - - /* initialize a hints for a new session */ - static void - ps_hints_open( PS_Hints hints, - PS_Hint_Type hint_type ) - { - switch ( hint_type ) - { - case PS_HINT_TYPE_1: - case PS_HINT_TYPE_2: - hints->error = 0; - hints->hint_type = hint_type; - - ps_dimension_init( &hints->dimension[0] ); - ps_dimension_init( &hints->dimension[1] ); - break; - - default: - hints->error = PSH_Err_Invalid_Argument; - hints->hint_type = hint_type; - - FT_ERROR(( "ps_hints_open: invalid charstring type!\n" )); - break; - } - } - - - /* add one or more stems to the current hints table */ - static void - ps_hints_stem( PS_Hints hints, - FT_Int dimension, - FT_UInt count, - FT_Long* stems ) - { - if ( !hints->error ) - { - /* limit "dimension" to 0..1 */ - if ( dimension < 0 || dimension > 1 ) - { - FT_ERROR(( "ps_hints_stem: invalid dimension (%d) used\n", - dimension )); - dimension = ( dimension != 0 ); - } - - /* record the stems in the current hints/masks table */ - switch ( hints->hint_type ) - { - case PS_HINT_TYPE_1: /* Type 1 "hstem" or "vstem" operator */ - case PS_HINT_TYPE_2: /* Type 2 "hstem" or "vstem" operator */ - { - PS_Dimension dim = &hints->dimension[dimension]; - - - for ( ; count > 0; count--, stems += 2 ) - { - FT_Error error; - FT_Memory memory = hints->memory; - - - error = ps_dimension_add_t1stem( - dim, (FT_Int)stems[0], (FT_Int)stems[1], - memory, NULL ); - if ( error ) - { - FT_ERROR(( "ps_hints_stem: could not add stem" - " (%d,%d) to hints table\n", stems[0], stems[1] )); - - hints->error = error; - return; - } - } - break; - } - - default: - FT_ERROR(( "ps_hints_stem: called with invalid hint type (%d)\n", - hints->hint_type )); - break; - } - } - } - - - /* add one Type1 counter stem to the current hints table */ - static void - ps_hints_t1stem3( PS_Hints hints, - FT_Int dimension, - FT_Long* stems ) - { - FT_Error error = 0; - - - if ( !hints->error ) - { - PS_Dimension dim; - FT_Memory memory = hints->memory; - FT_Int count; - FT_Int idx[3]; - - - /* limit "dimension" to 0..1 */ - if ( dimension < 0 || dimension > 1 ) - { - FT_ERROR(( "ps_hints_t1stem3: invalid dimension (%d) used\n", - dimension )); - dimension = ( dimension != 0 ); - } - - dim = &hints->dimension[dimension]; - - /* there must be 6 elements in the 'stem' array */ - if ( hints->hint_type == PS_HINT_TYPE_1 ) - { - /* add the three stems to our hints/masks table */ - for ( count = 0; count < 3; count++, stems += 2 ) - { - error = ps_dimension_add_t1stem( - dim, (FT_Int)stems[0], (FT_Int)stems[1], - memory, &idx[count] ); - if ( error ) - goto Fail; - } - - /* now, add the hints to the counters table */ - error = ps_dimension_add_counter( dim, idx[0], idx[1], idx[2], - memory ); - if ( error ) - goto Fail; - } - else - { - FT_ERROR(( "ps_hints_t1stem3: called with invalid hint type!\n" )); - error = PSH_Err_Invalid_Argument; - goto Fail; - } - } - - return; - - Fail: - FT_ERROR(( "ps_hints_t1stem3: could not add counter stems to table\n" )); - hints->error = error; - } - - - /* reset hints (only with Type 1 hints) */ - static void - ps_hints_t1reset( PS_Hints hints, - FT_UInt end_point ) - { - FT_Error error = 0; - - - if ( !hints->error ) - { - FT_Memory memory = hints->memory; - - - if ( hints->hint_type == PS_HINT_TYPE_1 ) - { - error = ps_dimension_reset_mask( &hints->dimension[0], - end_point, memory ); - if ( error ) - goto Fail; - - error = ps_dimension_reset_mask( &hints->dimension[1], - end_point, memory ); - if ( error ) - goto Fail; - } - else - { - /* invalid hint type */ - error = PSH_Err_Invalid_Argument; - goto Fail; - } - } - return; - - Fail: - hints->error = error; - } - - - /* Type2 "hintmask" operator, add a new hintmask to each direction */ - static void - ps_hints_t2mask( PS_Hints hints, - FT_UInt end_point, - FT_UInt bit_count, - const FT_Byte* bytes ) - { - FT_Error error; - - - if ( !hints->error ) - { - PS_Dimension dim = hints->dimension; - FT_Memory memory = hints->memory; - FT_UInt count1 = dim[0].hints.num_hints; - FT_UInt count2 = dim[1].hints.num_hints; - - - /* check bit count; must be equal to current total hint count */ - if ( bit_count != count1 + count2 ) - { - FT_ERROR(( "ps_hints_t2mask: " - "called with invalid bitcount %d (instead of %d)\n", - bit_count, count1 + count2 )); - - /* simply ignore the operator */ - return; - } - - /* set-up new horizontal and vertical hint mask now */ - error = ps_dimension_set_mask_bits( &dim[0], bytes, count2, count1, - end_point, memory ); - if ( error ) - goto Fail; - - error = ps_dimension_set_mask_bits( &dim[1], bytes, 0, count2, - end_point, memory ); - if ( error ) - goto Fail; - } - return; - - Fail: - hints->error = error; - } - - - static void - ps_hints_t2counter( PS_Hints hints, - FT_UInt bit_count, - const FT_Byte* bytes ) - { - FT_Error error; - - - if ( !hints->error ) - { - PS_Dimension dim = hints->dimension; - FT_Memory memory = hints->memory; - FT_UInt count1 = dim[0].hints.num_hints; - FT_UInt count2 = dim[1].hints.num_hints; - - - /* check bit count, must be equal to current total hint count */ - if ( bit_count != count1 + count2 ) - { - FT_ERROR(( "ps_hints_t2counter: " - "called with invalid bitcount %d (instead of %d)\n", - bit_count, count1 + count2 )); - - /* simply ignore the operator */ - return; - } - - /* set-up new horizontal and vertical hint mask now */ - error = ps_dimension_set_mask_bits( &dim[0], bytes, 0, count1, - 0, memory ); - if ( error ) - goto Fail; - - error = ps_dimension_set_mask_bits( &dim[1], bytes, count1, count2, - 0, memory ); - if ( error ) - goto Fail; - } - return; - - Fail: - hints->error = error; - } - - - /* end recording session */ - static FT_Error - ps_hints_close( PS_Hints hints, - FT_UInt end_point ) - { - FT_Error error; - - - error = hints->error; - if ( !error ) - { - FT_Memory memory = hints->memory; - PS_Dimension dim = hints->dimension; - - - error = ps_dimension_end( &dim[0], end_point, memory ); - if ( !error ) - { - error = ps_dimension_end( &dim[1], end_point, memory ); - } - } - -#ifdef DEBUG_HINTER - if ( !error ) - ps_debug_hints = hints; -#endif - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE 1 HINTS RECORDING INTERFACE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - t1_hints_open( T1_Hints hints ) - { - ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_1 ); - } - - static void - t1_hints_stem( T1_Hints hints, - FT_Int dimension, - FT_Long* coords ) - { - ps_hints_stem( (PS_Hints)hints, dimension, 1, coords ); - } - - - FT_LOCAL_DEF( void ) - t1_hints_funcs_init( T1_Hints_FuncsRec* funcs ) - { - FT_MEM_ZERO( (char*)funcs, sizeof ( *funcs ) ); - - funcs->open = (T1_Hints_OpenFunc) t1_hints_open; - funcs->close = (T1_Hints_CloseFunc) ps_hints_close; - funcs->stem = (T1_Hints_SetStemFunc) t1_hints_stem; - funcs->stem3 = (T1_Hints_SetStem3Func)ps_hints_t1stem3; - funcs->reset = (T1_Hints_ResetFunc) ps_hints_t1reset; - funcs->apply = (T1_Hints_ApplyFunc) ps_hints_apply; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE 2 HINTS RECORDING INTERFACE *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static void - t2_hints_open( T2_Hints hints ) - { - ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_2 ); - } - - - static void - t2_hints_stems( T2_Hints hints, - FT_Int dimension, - FT_Int count, - FT_Fixed* coords ) - { - FT_Pos stems[32], y, n; - FT_Int total = count; - - - y = 0; - while ( total > 0 ) - { - /* determine number of stems to write */ - count = total; - if ( count > 16 ) - count = 16; - - /* compute integer stem positions in font units */ - for ( n = 0; n < count * 2; n++ ) - { - y += coords[n]; - stems[n] = ( y + 0x8000L ) >> 16; - } - - /* compute lengths */ - for ( n = 0; n < count * 2; n += 2 ) - stems[n + 1] = stems[n + 1] - stems[n]; - - /* add them to the current dimension */ - ps_hints_stem( (PS_Hints)hints, dimension, count, stems ); - - total -= count; - } - } - - - FT_LOCAL_DEF( void ) - t2_hints_funcs_init( T2_Hints_FuncsRec* funcs ) - { - FT_MEM_ZERO( funcs, sizeof ( *funcs ) ); - - funcs->open = (T2_Hints_OpenFunc) t2_hints_open; - funcs->close = (T2_Hints_CloseFunc) ps_hints_close; - funcs->stems = (T2_Hints_StemsFunc) t2_hints_stems; - funcs->hintmask= (T2_Hints_MaskFunc) ps_hints_t2mask; - funcs->counter = (T2_Hints_CounterFunc)ps_hints_t2counter; - funcs->apply = (T2_Hints_ApplyFunc) ps_hints_apply; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* pshrec.c */ +/* */ +/* FreeType PostScript hints recorder (body). */ +/* */ +/* Copyright 2001, 2002, 2003, 2004, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_FREETYPE_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include "pshrec.h" +#include "pshalgo.h" + +#include "pshnterr.h" + +#undef FT_COMPONENT +#define FT_COMPONENT trace_pshrec + +#ifdef DEBUG_HINTER + PS_Hints ps_debug_hints = 0; + int ps_debug_no_horz_hints = 0; + int ps_debug_no_vert_hints = 0; +#endif + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PS_HINT MANAGEMENT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* destroy hints table */ + static void + ps_hint_table_done( PS_Hint_Table table, + FT_Memory memory ) + { + FT_FREE( table->hints ); + table->num_hints = 0; + table->max_hints = 0; + } + + + /* ensure that a table can contain "count" elements */ + static FT_Error + ps_hint_table_ensure( PS_Hint_Table table, + FT_UInt count, + FT_Memory memory ) + { + FT_UInt old_max = table->max_hints; + FT_UInt new_max = count; + FT_Error error = 0; + + + if ( new_max > old_max ) + { + /* try to grow the table */ + new_max = FT_PAD_CEIL( new_max, 8 ); + if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) ) + table->max_hints = new_max; + } + return error; + } + + + static FT_Error + ps_hint_table_alloc( PS_Hint_Table table, + FT_Memory memory, + PS_Hint *ahint ) + { + FT_Error error = 0; + FT_UInt count; + PS_Hint hint = 0; + + + count = table->num_hints; + count++; + + if ( count >= table->max_hints ) + { + error = ps_hint_table_ensure( table, count, memory ); + if ( error ) + goto Exit; + } + + hint = table->hints + count - 1; + hint->pos = 0; + hint->len = 0; + hint->flags = 0; + + table->num_hints = count; + + Exit: + *ahint = hint; + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PS_MASK MANAGEMENT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* destroy mask */ + static void + ps_mask_done( PS_Mask mask, + FT_Memory memory ) + { + FT_FREE( mask->bytes ); + mask->num_bits = 0; + mask->max_bits = 0; + mask->end_point = 0; + } + + + /* ensure that a mask can contain "count" bits */ + static FT_Error + ps_mask_ensure( PS_Mask mask, + FT_UInt count, + FT_Memory memory ) + { + FT_UInt old_max = ( mask->max_bits + 7 ) >> 3; + FT_UInt new_max = ( count + 7 ) >> 3; + FT_Error error = 0; + + + if ( new_max > old_max ) + { + new_max = FT_PAD_CEIL( new_max, 8 ); + if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) ) + mask->max_bits = new_max * 8; + } + return error; + } + + + /* test a bit value in a given mask */ + static FT_Int + ps_mask_test_bit( PS_Mask mask, + FT_Int idx ) + { + if ( (FT_UInt)idx >= mask->num_bits ) + return 0; + + return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) ); + } + + + /* clear a given bit */ + static void + ps_mask_clear_bit( PS_Mask mask, + FT_Int idx ) + { + FT_Byte* p; + + + if ( (FT_UInt)idx >= mask->num_bits ) + return; + + p = mask->bytes + ( idx >> 3 ); + p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( idx & 7 ) ) ); + } + + + /* set a given bit, possibly grow the mask */ + static FT_Error + ps_mask_set_bit( PS_Mask mask, + FT_Int idx, + FT_Memory memory ) + { + FT_Error error = 0; + FT_Byte* p; + + + if ( idx < 0 ) + goto Exit; + + if ( (FT_UInt)idx >= mask->num_bits ) + { + error = ps_mask_ensure( mask, idx + 1, memory ); + if ( error ) + goto Exit; + + mask->num_bits = idx + 1; + } + + p = mask->bytes + ( idx >> 3 ); + p[0] = (FT_Byte)( p[0] | ( 0x80 >> ( idx & 7 ) ) ); + + Exit: + return error; + } + + + /* destroy mask table */ + static void + ps_mask_table_done( PS_Mask_Table table, + FT_Memory memory ) + { + FT_UInt count = table->max_masks; + PS_Mask mask = table->masks; + + + for ( ; count > 0; count--, mask++ ) + ps_mask_done( mask, memory ); + + FT_FREE( table->masks ); + table->num_masks = 0; + table->max_masks = 0; + } + + + /* ensure that a mask table can contain "count" masks */ + static FT_Error + ps_mask_table_ensure( PS_Mask_Table table, + FT_UInt count, + FT_Memory memory ) + { + FT_UInt old_max = table->max_masks; + FT_UInt new_max = count; + FT_Error error = 0; + + + if ( new_max > old_max ) + { + new_max = FT_PAD_CEIL( new_max, 8 ); + if ( !FT_RENEW_ARRAY( table->masks, old_max, new_max ) ) + table->max_masks = new_max; + } + return error; + } + + + /* allocate a new mask in a table */ + static FT_Error + ps_mask_table_alloc( PS_Mask_Table table, + FT_Memory memory, + PS_Mask *amask ) + { + FT_UInt count; + FT_Error error = 0; + PS_Mask mask = 0; + + + count = table->num_masks; + count++; + + if ( count > table->max_masks ) + { + error = ps_mask_table_ensure( table, count, memory ); + if ( error ) + goto Exit; + } + + mask = table->masks + count - 1; + mask->num_bits = 0; + mask->end_point = 0; + table->num_masks = count; + + Exit: + *amask = mask; + return error; + } + + + /* return last hint mask in a table, create one if the table is empty */ + static FT_Error + ps_mask_table_last( PS_Mask_Table table, + FT_Memory memory, + PS_Mask *amask ) + { + FT_Error error = 0; + FT_UInt count; + PS_Mask mask; + + + count = table->num_masks; + if ( count == 0 ) + { + error = ps_mask_table_alloc( table, memory, &mask ); + if ( error ) + goto Exit; + } + else + mask = table->masks + count - 1; + + Exit: + *amask = mask; + return error; + } + + + /* set a new mask to a given bit range */ + static FT_Error + ps_mask_table_set_bits( PS_Mask_Table table, + const FT_Byte* source, + FT_UInt bit_pos, + FT_UInt bit_count, + FT_Memory memory ) + { + FT_Error error = 0; + PS_Mask mask; + + + error = ps_mask_table_last( table, memory, &mask ); + if ( error ) + goto Exit; + + error = ps_mask_ensure( mask, bit_count, memory ); + if ( error ) + goto Exit; + + mask->num_bits = bit_count; + + /* now, copy bits */ + { + FT_Byte* read = (FT_Byte*)source + ( bit_pos >> 3 ); + FT_Int rmask = 0x80 >> ( bit_pos & 7 ); + FT_Byte* write = mask->bytes; + FT_Int wmask = 0x80; + FT_Int val; + + + for ( ; bit_count > 0; bit_count-- ) + { + val = write[0] & ~wmask; + + if ( read[0] & rmask ) + val |= wmask; + + write[0] = (FT_Byte)val; + + rmask >>= 1; + if ( rmask == 0 ) + { + read++; + rmask = 0x80; + } + + wmask >>= 1; + if ( wmask == 0 ) + { + write++; + wmask = 0x80; + } + } + } + + Exit: + return error; + } + + + /* test whether two masks in a table intersect */ + static FT_Int + ps_mask_table_test_intersect( PS_Mask_Table table, + FT_Int index1, + FT_Int index2 ) + { + PS_Mask mask1 = table->masks + index1; + PS_Mask mask2 = table->masks + index2; + FT_Byte* p1 = mask1->bytes; + FT_Byte* p2 = mask2->bytes; + FT_UInt count1 = mask1->num_bits; + FT_UInt count2 = mask2->num_bits; + FT_UInt count; + + + count = ( count1 <= count2 ) ? count1 : count2; + for ( ; count >= 8; count -= 8 ) + { + if ( p1[0] & p2[0] ) + return 1; + + p1++; + p2++; + } + + if ( count == 0 ) + return 0; + + return ( p1[0] & p2[0] ) & ~( 0xFF >> count ); + } + + + /* merge two masks, used by ps_mask_table_merge_all */ + static FT_Error + ps_mask_table_merge( PS_Mask_Table table, + FT_Int index1, + FT_Int index2, + FT_Memory memory ) + { + FT_UInt temp; + FT_Error error = 0; + + + /* swap index1 and index2 so that index1 < index2 */ + if ( index1 > index2 ) + { + temp = index1; + index1 = index2; + index2 = temp; + } + + if ( index1 < index2 && index1 >= 0 && index2 < (FT_Int)table->num_masks ) + { + /* we need to merge the bitsets of index1 and index2 with a */ + /* simple union */ + PS_Mask mask1 = table->masks + index1; + PS_Mask mask2 = table->masks + index2; + FT_UInt count1 = mask1->num_bits; + FT_UInt count2 = mask2->num_bits; + FT_Int delta; + + + if ( count2 > 0 ) + { + FT_UInt pos; + FT_Byte* read; + FT_Byte* write; + + + /* if "count2" is greater than "count1", we need to grow the */ + /* first bitset, and clear the highest bits */ + if ( count2 > count1 ) + { + error = ps_mask_ensure( mask1, count2, memory ); + if ( error ) + goto Exit; + + for ( pos = count1; pos < count2; pos++ ) + ps_mask_clear_bit( mask1, pos ); + } + + /* merge (unite) the bitsets */ + read = mask2->bytes; + write = mask1->bytes; + pos = (FT_UInt)( ( count2 + 7 ) >> 3 ); + + for ( ; pos > 0; pos-- ) + { + write[0] = (FT_Byte)( write[0] | read[0] ); + write++; + read++; + } + } + + /* Now, remove "mask2" from the list. We need to keep the masks */ + /* sorted in order of importance, so move table elements. */ + mask2->num_bits = 0; + mask2->end_point = 0; + + delta = table->num_masks - 1 - index2; /* number of masks to move */ + if ( delta > 0 ) + { + /* move to end of table for reuse */ + PS_MaskRec dummy = *mask2; + + + ft_memmove( mask2, mask2 + 1, delta * sizeof ( PS_MaskRec ) ); + + mask2[delta] = dummy; + } + + table->num_masks--; + } + else + FT_ERROR(( "ps_mask_table_merge: ignoring invalid indices (%d,%d)\n", + index1, index2 )); + + Exit: + return error; + } + + + /* Try to merge all masks in a given table. This is used to merge */ + /* all counter masks into independent counter "paths". */ + /* */ + static FT_Error + ps_mask_table_merge_all( PS_Mask_Table table, + FT_Memory memory ) + { + FT_Int index1, index2; + FT_Error error = 0; + + + for ( index1 = table->num_masks - 1; index1 > 0; index1-- ) + { + for ( index2 = index1 - 1; index2 >= 0; index2-- ) + { + if ( ps_mask_table_test_intersect( table, index1, index2 ) ) + { + error = ps_mask_table_merge( table, index2, index1, memory ); + if ( error ) + goto Exit; + + break; + } + } + } + + Exit: + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PS_DIMENSION MANAGEMENT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /* finalize a given dimension */ + static void + ps_dimension_done( PS_Dimension dimension, + FT_Memory memory ) + { + ps_mask_table_done( &dimension->counters, memory ); + ps_mask_table_done( &dimension->masks, memory ); + ps_hint_table_done( &dimension->hints, memory ); + } + + + /* initialize a given dimension */ + static void + ps_dimension_init( PS_Dimension dimension ) + { + dimension->hints.num_hints = 0; + dimension->masks.num_masks = 0; + dimension->counters.num_masks = 0; + } + + +#if 0 + + /* set a bit at a given index in the current hint mask */ + static FT_Error + ps_dimension_set_mask_bit( PS_Dimension dim, + FT_UInt idx, + FT_Memory memory ) + { + PS_Mask mask; + FT_Error error = 0; + + + /* get last hint mask */ + error = ps_mask_table_last( &dim->masks, memory, &mask ); + if ( error ) + goto Exit; + + error = ps_mask_set_bit( mask, idx, memory ); + + Exit: + return error; + } + +#endif + + /* set the end point in a mask, called from "End" & "Reset" methods */ + static void + ps_dimension_end_mask( PS_Dimension dim, + FT_UInt end_point ) + { + FT_UInt count = dim->masks.num_masks; + PS_Mask mask; + + + if ( count > 0 ) + { + mask = dim->masks.masks + count - 1; + mask->end_point = end_point; + } + } + + + /* set the end point in the current mask, then create a new empty one */ + /* (called by "Reset" method) */ + static FT_Error + ps_dimension_reset_mask( PS_Dimension dim, + FT_UInt end_point, + FT_Memory memory ) + { + PS_Mask mask; + + + /* end current mask */ + ps_dimension_end_mask( dim, end_point ); + + /* allocate new one */ + return ps_mask_table_alloc( &dim->masks, memory, &mask ); + } + + + /* set a new mask, called from the "T2Stem" method */ + static FT_Error + ps_dimension_set_mask_bits( PS_Dimension dim, + const FT_Byte* source, + FT_UInt source_pos, + FT_UInt source_bits, + FT_UInt end_point, + FT_Memory memory ) + { + FT_Error error = 0; + + + /* reset current mask, if any */ + error = ps_dimension_reset_mask( dim, end_point, memory ); + if ( error ) + goto Exit; + + /* set bits in new mask */ + error = ps_mask_table_set_bits( &dim->masks, source, + source_pos, source_bits, memory ); + + Exit: + return error; + } + + + /* add a new single stem (called from "T1Stem" method) */ + static FT_Error + ps_dimension_add_t1stem( PS_Dimension dim, + FT_Int pos, + FT_Int len, + FT_Memory memory, + FT_Int *aindex ) + { + FT_Error error = 0; + FT_UInt flags = 0; + + + /* detect ghost stem */ + if ( len < 0 ) + { + flags |= PS_HINT_FLAG_GHOST; + if ( len == -21 ) + { + flags |= PS_HINT_FLAG_BOTTOM; + pos += len; + } + len = 0; + } + + if ( aindex ) + *aindex = -1; + + /* now, lookup stem in the current hints table */ + { + PS_Mask mask; + FT_UInt idx; + FT_UInt max = dim->hints.num_hints; + PS_Hint hint = dim->hints.hints; + + + for ( idx = 0; idx < max; idx++, hint++ ) + { + if ( hint->pos == pos && hint->len == len ) + break; + } + + /* we need to create a new hint in the table */ + if ( idx >= max ) + { + error = ps_hint_table_alloc( &dim->hints, memory, &hint ); + if ( error ) + goto Exit; + + hint->pos = pos; + hint->len = len; + hint->flags = flags; + } + + /* now, store the hint in the current mask */ + error = ps_mask_table_last( &dim->masks, memory, &mask ); + if ( error ) + goto Exit; + + error = ps_mask_set_bit( mask, idx, memory ); + if ( error ) + goto Exit; + + if ( aindex ) + *aindex = (FT_Int)idx; + } + + Exit: + return error; + } + + + /* add a "hstem3/vstem3" counter to our dimension table */ + static FT_Error + ps_dimension_add_counter( PS_Dimension dim, + FT_Int hint1, + FT_Int hint2, + FT_Int hint3, + FT_Memory memory ) + { + FT_Error error = 0; + FT_UInt count = dim->counters.num_masks; + PS_Mask counter = dim->counters.masks; + + + /* try to find an existing counter mask that already uses */ + /* one of these stems here */ + for ( ; count > 0; count--, counter++ ) + { + if ( ps_mask_test_bit( counter, hint1 ) || + ps_mask_test_bit( counter, hint2 ) || + ps_mask_test_bit( counter, hint3 ) ) + break; + } + + /* create a new counter when needed */ + if ( count == 0 ) + { + error = ps_mask_table_alloc( &dim->counters, memory, &counter ); + if ( error ) + goto Exit; + } + + /* now, set the bits for our hints in the counter mask */ + error = ps_mask_set_bit( counter, hint1, memory ); + if ( error ) + goto Exit; + + error = ps_mask_set_bit( counter, hint2, memory ); + if ( error ) + goto Exit; + + error = ps_mask_set_bit( counter, hint3, memory ); + if ( error ) + goto Exit; + + Exit: + return error; + } + + + /* end of recording session for a given dimension */ + static FT_Error + ps_dimension_end( PS_Dimension dim, + FT_UInt end_point, + FT_Memory memory ) + { + /* end hint mask table */ + ps_dimension_end_mask( dim, end_point ); + + /* merge all counter masks into independent "paths" */ + return ps_mask_table_merge_all( &dim->counters, memory ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** PS_RECORDER MANAGEMENT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /* destroy hints */ + FT_LOCAL( void ) + ps_hints_done( PS_Hints hints ) + { + FT_Memory memory = hints->memory; + + + ps_dimension_done( &hints->dimension[0], memory ); + ps_dimension_done( &hints->dimension[1], memory ); + + hints->error = 0; + hints->memory = 0; + } + + + FT_LOCAL( FT_Error ) + ps_hints_init( PS_Hints hints, + FT_Memory memory ) + { + FT_MEM_ZERO( hints, sizeof ( *hints ) ); + hints->memory = memory; + return 0; + } + + + /* initialize a hints for a new session */ + static void + ps_hints_open( PS_Hints hints, + PS_Hint_Type hint_type ) + { + switch ( hint_type ) + { + case PS_HINT_TYPE_1: + case PS_HINT_TYPE_2: + hints->error = 0; + hints->hint_type = hint_type; + + ps_dimension_init( &hints->dimension[0] ); + ps_dimension_init( &hints->dimension[1] ); + break; + + default: + hints->error = PSH_Err_Invalid_Argument; + hints->hint_type = hint_type; + + FT_ERROR(( "ps_hints_open: invalid charstring type!\n" )); + break; + } + } + + + /* add one or more stems to the current hints table */ + static void + ps_hints_stem( PS_Hints hints, + FT_Int dimension, + FT_UInt count, + FT_Long* stems ) + { + if ( !hints->error ) + { + /* limit "dimension" to 0..1 */ + if ( dimension < 0 || dimension > 1 ) + { + FT_ERROR(( "ps_hints_stem: invalid dimension (%d) used\n", + dimension )); + dimension = ( dimension != 0 ); + } + + /* record the stems in the current hints/masks table */ + switch ( hints->hint_type ) + { + case PS_HINT_TYPE_1: /* Type 1 "hstem" or "vstem" operator */ + case PS_HINT_TYPE_2: /* Type 2 "hstem" or "vstem" operator */ + { + PS_Dimension dim = &hints->dimension[dimension]; + + + for ( ; count > 0; count--, stems += 2 ) + { + FT_Error error; + FT_Memory memory = hints->memory; + + + error = ps_dimension_add_t1stem( + dim, (FT_Int)stems[0], (FT_Int)stems[1], + memory, NULL ); + if ( error ) + { + FT_ERROR(( "ps_hints_stem: could not add stem" + " (%d,%d) to hints table\n", stems[0], stems[1] )); + + hints->error = error; + return; + } + } + break; + } + + default: + FT_ERROR(( "ps_hints_stem: called with invalid hint type (%d)\n", + hints->hint_type )); + break; + } + } + } + + + /* add one Type1 counter stem to the current hints table */ + static void + ps_hints_t1stem3( PS_Hints hints, + FT_Int dimension, + FT_Long* stems ) + { + FT_Error error = 0; + + + if ( !hints->error ) + { + PS_Dimension dim; + FT_Memory memory = hints->memory; + FT_Int count; + FT_Int idx[3]; + + + /* limit "dimension" to 0..1 */ + if ( dimension < 0 || dimension > 1 ) + { + FT_ERROR(( "ps_hints_t1stem3: invalid dimension (%d) used\n", + dimension )); + dimension = ( dimension != 0 ); + } + + dim = &hints->dimension[dimension]; + + /* there must be 6 elements in the 'stem' array */ + if ( hints->hint_type == PS_HINT_TYPE_1 ) + { + /* add the three stems to our hints/masks table */ + for ( count = 0; count < 3; count++, stems += 2 ) + { + error = ps_dimension_add_t1stem( + dim, (FT_Int)stems[0], (FT_Int)stems[1], + memory, &idx[count] ); + if ( error ) + goto Fail; + } + + /* now, add the hints to the counters table */ + error = ps_dimension_add_counter( dim, idx[0], idx[1], idx[2], + memory ); + if ( error ) + goto Fail; + } + else + { + FT_ERROR(( "ps_hints_t1stem3: called with invalid hint type!\n" )); + error = PSH_Err_Invalid_Argument; + goto Fail; + } + } + + return; + + Fail: + FT_ERROR(( "ps_hints_t1stem3: could not add counter stems to table\n" )); + hints->error = error; + } + + + /* reset hints (only with Type 1 hints) */ + static void + ps_hints_t1reset( PS_Hints hints, + FT_UInt end_point ) + { + FT_Error error = 0; + + + if ( !hints->error ) + { + FT_Memory memory = hints->memory; + + + if ( hints->hint_type == PS_HINT_TYPE_1 ) + { + error = ps_dimension_reset_mask( &hints->dimension[0], + end_point, memory ); + if ( error ) + goto Fail; + + error = ps_dimension_reset_mask( &hints->dimension[1], + end_point, memory ); + if ( error ) + goto Fail; + } + else + { + /* invalid hint type */ + error = PSH_Err_Invalid_Argument; + goto Fail; + } + } + return; + + Fail: + hints->error = error; + } + + + /* Type2 "hintmask" operator, add a new hintmask to each direction */ + static void + ps_hints_t2mask( PS_Hints hints, + FT_UInt end_point, + FT_UInt bit_count, + const FT_Byte* bytes ) + { + FT_Error error; + + + if ( !hints->error ) + { + PS_Dimension dim = hints->dimension; + FT_Memory memory = hints->memory; + FT_UInt count1 = dim[0].hints.num_hints; + FT_UInt count2 = dim[1].hints.num_hints; + + + /* check bit count; must be equal to current total hint count */ + if ( bit_count != count1 + count2 ) + { + FT_ERROR(( "ps_hints_t2mask: " + "called with invalid bitcount %d (instead of %d)\n", + bit_count, count1 + count2 )); + + /* simply ignore the operator */ + return; + } + + /* set-up new horizontal and vertical hint mask now */ + error = ps_dimension_set_mask_bits( &dim[0], bytes, count2, count1, + end_point, memory ); + if ( error ) + goto Fail; + + error = ps_dimension_set_mask_bits( &dim[1], bytes, 0, count2, + end_point, memory ); + if ( error ) + goto Fail; + } + return; + + Fail: + hints->error = error; + } + + + static void + ps_hints_t2counter( PS_Hints hints, + FT_UInt bit_count, + const FT_Byte* bytes ) + { + FT_Error error; + + + if ( !hints->error ) + { + PS_Dimension dim = hints->dimension; + FT_Memory memory = hints->memory; + FT_UInt count1 = dim[0].hints.num_hints; + FT_UInt count2 = dim[1].hints.num_hints; + + + /* check bit count, must be equal to current total hint count */ + if ( bit_count != count1 + count2 ) + { + FT_ERROR(( "ps_hints_t2counter: " + "called with invalid bitcount %d (instead of %d)\n", + bit_count, count1 + count2 )); + + /* simply ignore the operator */ + return; + } + + /* set-up new horizontal and vertical hint mask now */ + error = ps_dimension_set_mask_bits( &dim[0], bytes, 0, count1, + 0, memory ); + if ( error ) + goto Fail; + + error = ps_dimension_set_mask_bits( &dim[1], bytes, count1, count2, + 0, memory ); + if ( error ) + goto Fail; + } + return; + + Fail: + hints->error = error; + } + + + /* end recording session */ + static FT_Error + ps_hints_close( PS_Hints hints, + FT_UInt end_point ) + { + FT_Error error; + + + error = hints->error; + if ( !error ) + { + FT_Memory memory = hints->memory; + PS_Dimension dim = hints->dimension; + + + error = ps_dimension_end( &dim[0], end_point, memory ); + if ( !error ) + { + error = ps_dimension_end( &dim[1], end_point, memory ); + } + } + +#ifdef DEBUG_HINTER + if ( !error ) + ps_debug_hints = hints; +#endif + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE 1 HINTS RECORDING INTERFACE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + t1_hints_open( T1_Hints hints ) + { + ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_1 ); + } + + static void + t1_hints_stem( T1_Hints hints, + FT_Int dimension, + FT_Long* coords ) + { + ps_hints_stem( (PS_Hints)hints, dimension, 1, coords ); + } + + + FT_LOCAL_DEF( void ) + t1_hints_funcs_init( T1_Hints_FuncsRec* funcs ) + { + FT_MEM_ZERO( (char*)funcs, sizeof ( *funcs ) ); + + funcs->open = (T1_Hints_OpenFunc) t1_hints_open; + funcs->close = (T1_Hints_CloseFunc) ps_hints_close; + funcs->stem = (T1_Hints_SetStemFunc) t1_hints_stem; + funcs->stem3 = (T1_Hints_SetStem3Func)ps_hints_t1stem3; + funcs->reset = (T1_Hints_ResetFunc) ps_hints_t1reset; + funcs->apply = (T1_Hints_ApplyFunc) ps_hints_apply; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE 2 HINTS RECORDING INTERFACE *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static void + t2_hints_open( T2_Hints hints ) + { + ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_2 ); + } + + + static void + t2_hints_stems( T2_Hints hints, + FT_Int dimension, + FT_Int count, + FT_Fixed* coords ) + { + FT_Pos stems[32], y, n; + FT_Int total = count; + + + y = 0; + while ( total > 0 ) + { + /* determine number of stems to write */ + count = total; + if ( count > 16 ) + count = 16; + + /* compute integer stem positions in font units */ + for ( n = 0; n < count * 2; n++ ) + { + y += coords[n]; + stems[n] = ( y + 0x8000L ) >> 16; + } + + /* compute lengths */ + for ( n = 0; n < count * 2; n += 2 ) + stems[n + 1] = stems[n + 1] - stems[n]; + + /* add them to the current dimension */ + ps_hints_stem( (PS_Hints)hints, dimension, count, stems ); + + total -= count; + } + } + + + FT_LOCAL_DEF( void ) + t2_hints_funcs_init( T2_Hints_FuncsRec* funcs ) + { + FT_MEM_ZERO( funcs, sizeof ( *funcs ) ); + + funcs->open = (T2_Hints_OpenFunc) t2_hints_open; + funcs->close = (T2_Hints_CloseFunc) ps_hints_close; + funcs->stems = (T2_Hints_StemsFunc) t2_hints_stems; + funcs->hintmask= (T2_Hints_MaskFunc) ps_hints_t2mask; + funcs->counter = (T2_Hints_CounterFunc)ps_hints_t2counter; + funcs->apply = (T2_Hints_ApplyFunc) ps_hints_apply; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.h b/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.h index f7ef9004ea1..5f37b573d9c 100644 --- a/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.h +++ b/reactos/dll/3rdparty/freetype/src/pshinter/pshrec.h @@ -1,176 +1,176 @@ -/***************************************************************************/ -/* */ -/* pshrec.h */ -/* */ -/* Postscript (Type1/Type2) hints recorder (specification). */ -/* */ -/* Copyright 2001, 2002, 2003, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /**************************************************************************/ - /* */ - /* The functions defined here are called from the Type 1, CID and CFF */ - /* font drivers to record the hints of a given character/glyph. */ - /* */ - /* The hints are recorded in a unified format, and are later processed */ - /* by the `optimizer' and `fitter' to adjust the outlines to the pixel */ - /* grid. */ - /* */ - /**************************************************************************/ - - -#ifndef __PSHREC_H__ -#define __PSHREC_H__ - - -#include -#include FT_INTERNAL_POSTSCRIPT_HINTS_H -#include "pshglob.h" - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GLYPH HINTS RECORDER INTERNALS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /* handle to hint record */ - typedef struct PS_HintRec_* PS_Hint; - - /* hint types */ - typedef enum - { - PS_HINT_TYPE_1 = 1, - PS_HINT_TYPE_2 = 2 - - } PS_Hint_Type; - - - /* hint flags */ - typedef enum - { - PS_HINT_FLAG_GHOST = 1, - PS_HINT_FLAG_BOTTOM = 2 - - } PS_Hint_Flags; - - - /* hint descriptor */ - typedef struct PS_HintRec_ - { - FT_Int pos; - FT_Int len; - FT_UInt flags; - - } PS_HintRec; - - -#define ps_hint_is_active( x ) ( (x)->flags & PS_HINT_FLAG_ACTIVE ) -#define ps_hint_is_ghost( x ) ( (x)->flags & PS_HINT_FLAG_GHOST ) -#define ps_hint_is_bottom( x ) ( (x)->flags & PS_HINT_FLAG_BOTTOM ) - - - /* hints table descriptor */ - typedef struct PS_Hint_TableRec_ - { - FT_UInt num_hints; - FT_UInt max_hints; - PS_Hint hints; - - } PS_Hint_TableRec, *PS_Hint_Table; - - - /* hint and counter mask descriptor */ - typedef struct PS_MaskRec_ - { - FT_UInt num_bits; - FT_UInt max_bits; - FT_Byte* bytes; - FT_UInt end_point; - - } PS_MaskRec, *PS_Mask; - - - /* masks and counters table descriptor */ - typedef struct PS_Mask_TableRec_ - { - FT_UInt num_masks; - FT_UInt max_masks; - PS_Mask masks; - - } PS_Mask_TableRec, *PS_Mask_Table; - - - /* dimension-specific hints descriptor */ - typedef struct PS_DimensionRec_ - { - PS_Hint_TableRec hints; - PS_Mask_TableRec masks; - PS_Mask_TableRec counters; - - } PS_DimensionRec, *PS_Dimension; - - - /* glyph hints descriptor */ - /* dimension 0 => X coordinates + vertical hints/stems */ - /* dimension 1 => Y coordinates + horizontal hints/stems */ - typedef struct PS_HintsRec_ - { - FT_Memory memory; - FT_Error error; - FT_UInt32 magic; - PS_Hint_Type hint_type; - PS_DimensionRec dimension[2]; - - } PS_HintsRec, *PS_Hints; - - /* */ - - /* initialize hints recorder */ - FT_LOCAL( FT_Error ) - ps_hints_init( PS_Hints hints, - FT_Memory memory ); - - /* finalize hints recorder */ - FT_LOCAL( void ) - ps_hints_done( PS_Hints hints ); - - /* initialize Type1 hints recorder interface */ - FT_LOCAL( void ) - t1_hints_funcs_init( T1_Hints_FuncsRec* funcs ); - - /* initialize Type2 hints recorder interface */ - FT_LOCAL( void ) - t2_hints_funcs_init( T2_Hints_FuncsRec* funcs ); - - -#ifdef DEBUG_HINTER - extern PS_Hints ps_debug_hints; - extern int ps_debug_no_horz_hints; - extern int ps_debug_no_vert_hints; -#endif - - /* */ - - -FT_END_HEADER - - -#endif /* __PS_HINTER_RECORD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* pshrec.h */ +/* */ +/* Postscript (Type1/Type2) hints recorder (specification). */ +/* */ +/* Copyright 2001, 2002, 2003, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /**************************************************************************/ + /* */ + /* The functions defined here are called from the Type 1, CID and CFF */ + /* font drivers to record the hints of a given character/glyph. */ + /* */ + /* The hints are recorded in a unified format, and are later processed */ + /* by the `optimizer' and `fitter' to adjust the outlines to the pixel */ + /* grid. */ + /* */ + /**************************************************************************/ + + +#ifndef __PSHREC_H__ +#define __PSHREC_H__ + + +#include +#include FT_INTERNAL_POSTSCRIPT_HINTS_H +#include "pshglob.h" + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GLYPH HINTS RECORDER INTERNALS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* handle to hint record */ + typedef struct PS_HintRec_* PS_Hint; + + /* hint types */ + typedef enum + { + PS_HINT_TYPE_1 = 1, + PS_HINT_TYPE_2 = 2 + + } PS_Hint_Type; + + + /* hint flags */ + typedef enum + { + PS_HINT_FLAG_GHOST = 1, + PS_HINT_FLAG_BOTTOM = 2 + + } PS_Hint_Flags; + + + /* hint descriptor */ + typedef struct PS_HintRec_ + { + FT_Int pos; + FT_Int len; + FT_UInt flags; + + } PS_HintRec; + + +#define ps_hint_is_active( x ) ( (x)->flags & PS_HINT_FLAG_ACTIVE ) +#define ps_hint_is_ghost( x ) ( (x)->flags & PS_HINT_FLAG_GHOST ) +#define ps_hint_is_bottom( x ) ( (x)->flags & PS_HINT_FLAG_BOTTOM ) + + + /* hints table descriptor */ + typedef struct PS_Hint_TableRec_ + { + FT_UInt num_hints; + FT_UInt max_hints; + PS_Hint hints; + + } PS_Hint_TableRec, *PS_Hint_Table; + + + /* hint and counter mask descriptor */ + typedef struct PS_MaskRec_ + { + FT_UInt num_bits; + FT_UInt max_bits; + FT_Byte* bytes; + FT_UInt end_point; + + } PS_MaskRec, *PS_Mask; + + + /* masks and counters table descriptor */ + typedef struct PS_Mask_TableRec_ + { + FT_UInt num_masks; + FT_UInt max_masks; + PS_Mask masks; + + } PS_Mask_TableRec, *PS_Mask_Table; + + + /* dimension-specific hints descriptor */ + typedef struct PS_DimensionRec_ + { + PS_Hint_TableRec hints; + PS_Mask_TableRec masks; + PS_Mask_TableRec counters; + + } PS_DimensionRec, *PS_Dimension; + + + /* glyph hints descriptor */ + /* dimension 0 => X coordinates + vertical hints/stems */ + /* dimension 1 => Y coordinates + horizontal hints/stems */ + typedef struct PS_HintsRec_ + { + FT_Memory memory; + FT_Error error; + FT_UInt32 magic; + PS_Hint_Type hint_type; + PS_DimensionRec dimension[2]; + + } PS_HintsRec, *PS_Hints; + + /* */ + + /* initialize hints recorder */ + FT_LOCAL( FT_Error ) + ps_hints_init( PS_Hints hints, + FT_Memory memory ); + + /* finalize hints recorder */ + FT_LOCAL( void ) + ps_hints_done( PS_Hints hints ); + + /* initialize Type1 hints recorder interface */ + FT_LOCAL( void ) + t1_hints_funcs_init( T1_Hints_FuncsRec* funcs ); + + /* initialize Type2 hints recorder interface */ + FT_LOCAL( void ) + t2_hints_funcs_init( T2_Hints_FuncsRec* funcs ); + + +#ifdef DEBUG_HINTER + extern PS_Hints ps_debug_hints; + extern int ps_debug_no_horz_hints; + extern int ps_debug_no_vert_hints; +#endif + + /* */ + + +FT_END_HEADER + + +#endif /* __PS_HINTER_RECORD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psnames/psmodule.c b/reactos/dll/3rdparty/freetype/src/psnames/psmodule.c index 8d8c476a145..fdffcceb6a9 100644 --- a/reactos/dll/3rdparty/freetype/src/psnames/psmodule.c +++ b/reactos/dll/3rdparty/freetype/src/psnames/psmodule.c @@ -1,458 +1,458 @@ -/***************************************************************************/ -/* */ -/* psmodule.c */ -/* */ -/* PSNames module implementation (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H - -#include "psmodule.h" -#include "pstables.h" - -#include "psnamerr.h" - - -#ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES - - -#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - - -#define VARIANT_BIT 0x80000000UL -#define BASE_GLYPH( code ) ( (code) & ~VARIANT_BIT ) - - - /* Return the Unicode value corresponding to a given glyph. Note that */ - /* we do deal with glyph variants by detecting a non-initial dot in */ - /* the name, as in `A.swash' or `e.final'; in this case, the */ - /* VARIANT_BIT is set in the return value. */ - /* */ - static FT_UInt32 - ps_unicode_value( const char* glyph_name ) - { - /* If the name begins with `uni', then the glyph name may be a */ - /* hard-coded unicode character code. */ - if ( glyph_name[0] == 'u' && - glyph_name[1] == 'n' && - glyph_name[2] == 'i' ) - { - /* determine whether the next four characters following are */ - /* hexadecimal. */ - - /* XXX: Add code to deal with ligatures, i.e. glyph names like */ - /* `uniXXXXYYYYZZZZ'... */ - - FT_Int count; - FT_ULong value = 0; - const char* p = glyph_name + 3; - - - for ( count = 4; count > 0; count--, p++ ) - { - char c = *p; - unsigned int d; - - - d = (unsigned char)c - '0'; - if ( d >= 10 ) - { - d = (unsigned char)c - 'A'; - if ( d >= 6 ) - d = 16; - else - d += 10; - } - - /* Exit if a non-uppercase hexadecimal character was found */ - /* -- this also catches character codes below `0' since such */ - /* negative numbers cast to `unsigned int' are far too big. */ - if ( d >= 16 ) - break; - - value = ( value << 4 ) + d; - } - - /* there must be exactly four hex digits */ - if ( count == 0 ) - { - if ( *p == '\0' ) - return value; - if ( *p == '.' ) - return value | VARIANT_BIT; - } - } - - /* If the name begins with `u', followed by four to six uppercase */ - /* hexadecimal digits, it is a hard-coded unicode character code. */ - if ( glyph_name[0] == 'u' ) - { - FT_Int count; - FT_ULong value = 0; - const char* p = glyph_name + 1; - - - for ( count = 6; count > 0; count--, p++ ) - { - char c = *p; - unsigned int d; - - - d = (unsigned char)c - '0'; - if ( d >= 10 ) - { - d = (unsigned char)c - 'A'; - if ( d >= 6 ) - d = 16; - else - d += 10; - } - - if ( d >= 16 ) - break; - - value = ( value << 4 ) + d; - } - - if ( count <= 2 ) - { - if ( *p == '\0' ) - return value; - if ( *p == '.' ) - return value | VARIANT_BIT; - } - } - - /* Look for a non-initial dot in the glyph name in order to */ - /* find variants like `A.swash', `e.final', etc. */ - { - const char* p = glyph_name; - const char* dot = NULL; - - - for ( ; *p; p++ ) - { - if ( *p == '.' && p > glyph_name ) - { - dot = p; - break; - } - } - - /* now look up the glyph in the Adobe Glyph List */ - if ( !dot ) - return ft_get_adobe_glyph_index( glyph_name, p ); - else - return ft_get_adobe_glyph_index( glyph_name, dot ) | VARIANT_BIT; - } - } - - - /* ft_qsort callback to sort the unicode map */ - FT_CALLBACK_DEF( int ) - compare_uni_maps( const void* a, - const void* b ) - { - PS_UniMap* map1 = (PS_UniMap*)a; - PS_UniMap* map2 = (PS_UniMap*)b; - FT_UInt32 unicode1 = BASE_GLYPH( map1->unicode ); - FT_UInt32 unicode2 = BASE_GLYPH( map2->unicode ); - - - /* sort base glyphs before glyph variants */ - if ( unicode1 == unicode2 ) - return map1->unicode - map2->unicode; - else - return unicode1 - unicode2; - } - - - /* Build a table that maps Unicode values to glyph indices. */ - static FT_Error - ps_unicodes_init( FT_Memory memory, - PS_Unicodes table, - FT_UInt num_glyphs, - PS_GetGlyphNameFunc get_glyph_name, - PS_FreeGlyphNameFunc free_glyph_name, - FT_Pointer glyph_data ) - { - FT_Error error; - - - /* we first allocate the table */ - table->num_maps = 0; - table->maps = 0; - - if ( !FT_NEW_ARRAY( table->maps, num_glyphs ) ) - { - FT_UInt n; - FT_UInt count; - PS_UniMap* map; - FT_UInt32 uni_char; - - - map = table->maps; - - for ( n = 0; n < num_glyphs; n++ ) - { - const char* gname = get_glyph_name( glyph_data, n ); - - - if ( gname ) - { - uni_char = ps_unicode_value( gname ); - - if ( BASE_GLYPH( uni_char ) != 0 ) - { - map->unicode = uni_char; - map->glyph_index = n; - map++; - } - - if ( free_glyph_name ) - free_glyph_name( glyph_data, gname ); - } - } - - /* now compress the table a bit */ - count = (FT_UInt)( map - table->maps ); - - if ( count == 0 ) - { - FT_FREE( table->maps ); - if ( !error ) - error = PSnames_Err_Invalid_Argument; /* No unicode chars here! */ - } - else { - /* Reallocate if the number of used entries is much smaller. */ - if ( count < num_glyphs / 2 ) - { - (void)FT_RENEW_ARRAY( table->maps, num_glyphs, count ); - error = PSnames_Err_Ok; - } - - /* Sort the table in increasing order of unicode values, */ - /* taking care of glyph variants. */ - ft_qsort( table->maps, count, sizeof ( PS_UniMap ), - compare_uni_maps ); - } - - table->num_maps = count; - } - - return error; - } - - - static FT_UInt - ps_unicodes_char_index( PS_Unicodes table, - FT_UInt32 unicode ) - { - PS_UniMap *min, *max, *mid, *result = NULL; - - - /* Perform a binary search on the table. */ - - min = table->maps; - max = min + table->num_maps - 1; - - while ( min <= max ) - { - FT_UInt32 base_glyph; - - - mid = min + ( ( max - min ) >> 1 ); - - if ( mid->unicode == unicode ) - { - result = mid; - break; - } - - base_glyph = BASE_GLYPH( mid->unicode ); - - if ( base_glyph == unicode ) - result = mid; /* remember match but continue search for base glyph */ - - if ( min == max ) - break; - - if ( base_glyph < unicode ) - min = mid + 1; - else - max = mid - 1; - } - - if ( result ) - return result->glyph_index; - else - return 0; - } - - - static FT_ULong - ps_unicodes_char_next( PS_Unicodes table, - FT_UInt32 *unicode ) - { - FT_UInt result = 0; - FT_UInt32 char_code = *unicode + 1; - - - { - FT_UInt min = 0; - FT_UInt max = table->num_maps; - FT_UInt mid; - PS_UniMap* map; - FT_UInt32 base_glyph; - - - while ( min < max ) - { - mid = min + ( ( max - min ) >> 1 ); - map = table->maps + mid; - - if ( map->unicode == char_code ) - { - result = map->glyph_index; - goto Exit; - } - - base_glyph = BASE_GLYPH( map->unicode ); - - if ( base_glyph == char_code ) - result = map->glyph_index; - - if ( base_glyph < char_code ) - min = mid + 1; - else - max = mid; - } - - if ( result ) - goto Exit; /* we have a variant glyph */ - - /* we didn't find it; check whether we have a map just above it */ - char_code = 0; - - if ( min < table->num_maps ) - { - map = table->maps + min; - result = map->glyph_index; - char_code = BASE_GLYPH( map->unicode ); - } - } - - Exit: - *unicode = char_code; - return result; - } - - -#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ - - - static const char* - ps_get_macintosh_name( FT_UInt name_index ) - { - if ( name_index >= FT_NUM_MAC_NAMES ) - name_index = 0; - - return ft_standard_glyph_names + ft_mac_names[name_index]; - } - - - static const char* - ps_get_standard_strings( FT_UInt sid ) - { - if ( sid >= FT_NUM_SID_NAMES ) - return 0; - - return ft_standard_glyph_names + ft_sid_names[sid]; - } - - - static - const FT_Service_PsCMapsRec pscmaps_interface = - { -#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - - (PS_Unicode_ValueFunc) ps_unicode_value, - (PS_Unicodes_InitFunc) ps_unicodes_init, - (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, - (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, - -#else - - 0, - 0, - 0, - 0, - -#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ - - (PS_Macintosh_NameFunc) ps_get_macintosh_name, - (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, - - t1_standard_encoding, - t1_expert_encoding - }; - - - static const FT_ServiceDescRec pscmaps_services[] = - { - { FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface }, - { NULL, NULL } - }; - - - static FT_Pointer - psnames_get_service( FT_Module module, - const char* service_id ) - { - FT_UNUSED( module ); - - return ft_service_list_lookup( pscmaps_services, service_id ); - } - -#endif /* !FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES */ - - - - FT_CALLBACK_TABLE_DEF - const FT_Module_Class psnames_module_class = - { - 0, /* this is not a font driver, nor a renderer */ - sizeof ( FT_ModuleRec ), - - "psnames", /* driver name */ - 0x10000L, /* driver version */ - 0x20000L, /* driver requires FreeType 2 or above */ - -#ifdef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES - 0, - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 -#else - (void*)&pscmaps_interface, /* module specific interface */ - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) psnames_get_service -#endif - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* psmodule.c */ +/* */ +/* PSNames module implementation (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_OBJECTS_H +#include FT_SERVICE_POSTSCRIPT_CMAPS_H + +#include "psmodule.h" +#include "pstables.h" + +#include "psnamerr.h" + + +#ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES + + +#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + + +#define VARIANT_BIT 0x80000000UL +#define BASE_GLYPH( code ) ( (code) & ~VARIANT_BIT ) + + + /* Return the Unicode value corresponding to a given glyph. Note that */ + /* we do deal with glyph variants by detecting a non-initial dot in */ + /* the name, as in `A.swash' or `e.final'; in this case, the */ + /* VARIANT_BIT is set in the return value. */ + /* */ + static FT_UInt32 + ps_unicode_value( const char* glyph_name ) + { + /* If the name begins with `uni', then the glyph name may be a */ + /* hard-coded unicode character code. */ + if ( glyph_name[0] == 'u' && + glyph_name[1] == 'n' && + glyph_name[2] == 'i' ) + { + /* determine whether the next four characters following are */ + /* hexadecimal. */ + + /* XXX: Add code to deal with ligatures, i.e. glyph names like */ + /* `uniXXXXYYYYZZZZ'... */ + + FT_Int count; + FT_ULong value = 0; + const char* p = glyph_name + 3; + + + for ( count = 4; count > 0; count--, p++ ) + { + char c = *p; + unsigned int d; + + + d = (unsigned char)c - '0'; + if ( d >= 10 ) + { + d = (unsigned char)c - 'A'; + if ( d >= 6 ) + d = 16; + else + d += 10; + } + + /* Exit if a non-uppercase hexadecimal character was found */ + /* -- this also catches character codes below `0' since such */ + /* negative numbers cast to `unsigned int' are far too big. */ + if ( d >= 16 ) + break; + + value = ( value << 4 ) + d; + } + + /* there must be exactly four hex digits */ + if ( count == 0 ) + { + if ( *p == '\0' ) + return value; + if ( *p == '.' ) + return value | VARIANT_BIT; + } + } + + /* If the name begins with `u', followed by four to six uppercase */ + /* hexadecimal digits, it is a hard-coded unicode character code. */ + if ( glyph_name[0] == 'u' ) + { + FT_Int count; + FT_ULong value = 0; + const char* p = glyph_name + 1; + + + for ( count = 6; count > 0; count--, p++ ) + { + char c = *p; + unsigned int d; + + + d = (unsigned char)c - '0'; + if ( d >= 10 ) + { + d = (unsigned char)c - 'A'; + if ( d >= 6 ) + d = 16; + else + d += 10; + } + + if ( d >= 16 ) + break; + + value = ( value << 4 ) + d; + } + + if ( count <= 2 ) + { + if ( *p == '\0' ) + return value; + if ( *p == '.' ) + return value | VARIANT_BIT; + } + } + + /* Look for a non-initial dot in the glyph name in order to */ + /* find variants like `A.swash', `e.final', etc. */ + { + const char* p = glyph_name; + const char* dot = NULL; + + + for ( ; *p; p++ ) + { + if ( *p == '.' && p > glyph_name ) + { + dot = p; + break; + } + } + + /* now look up the glyph in the Adobe Glyph List */ + if ( !dot ) + return ft_get_adobe_glyph_index( glyph_name, p ); + else + return ft_get_adobe_glyph_index( glyph_name, dot ) | VARIANT_BIT; + } + } + + + /* ft_qsort callback to sort the unicode map */ + FT_CALLBACK_DEF( int ) + compare_uni_maps( const void* a, + const void* b ) + { + PS_UniMap* map1 = (PS_UniMap*)a; + PS_UniMap* map2 = (PS_UniMap*)b; + FT_UInt32 unicode1 = BASE_GLYPH( map1->unicode ); + FT_UInt32 unicode2 = BASE_GLYPH( map2->unicode ); + + + /* sort base glyphs before glyph variants */ + if ( unicode1 == unicode2 ) + return map1->unicode - map2->unicode; + else + return unicode1 - unicode2; + } + + + /* Build a table that maps Unicode values to glyph indices. */ + static FT_Error + ps_unicodes_init( FT_Memory memory, + PS_Unicodes table, + FT_UInt num_glyphs, + PS_GetGlyphNameFunc get_glyph_name, + PS_FreeGlyphNameFunc free_glyph_name, + FT_Pointer glyph_data ) + { + FT_Error error; + + + /* we first allocate the table */ + table->num_maps = 0; + table->maps = 0; + + if ( !FT_NEW_ARRAY( table->maps, num_glyphs ) ) + { + FT_UInt n; + FT_UInt count; + PS_UniMap* map; + FT_UInt32 uni_char; + + + map = table->maps; + + for ( n = 0; n < num_glyphs; n++ ) + { + const char* gname = get_glyph_name( glyph_data, n ); + + + if ( gname ) + { + uni_char = ps_unicode_value( gname ); + + if ( BASE_GLYPH( uni_char ) != 0 ) + { + map->unicode = uni_char; + map->glyph_index = n; + map++; + } + + if ( free_glyph_name ) + free_glyph_name( glyph_data, gname ); + } + } + + /* now compress the table a bit */ + count = (FT_UInt)( map - table->maps ); + + if ( count == 0 ) + { + FT_FREE( table->maps ); + if ( !error ) + error = PSnames_Err_Invalid_Argument; /* No unicode chars here! */ + } + else { + /* Reallocate if the number of used entries is much smaller. */ + if ( count < num_glyphs / 2 ) + { + (void)FT_RENEW_ARRAY( table->maps, num_glyphs, count ); + error = PSnames_Err_Ok; + } + + /* Sort the table in increasing order of unicode values, */ + /* taking care of glyph variants. */ + ft_qsort( table->maps, count, sizeof ( PS_UniMap ), + compare_uni_maps ); + } + + table->num_maps = count; + } + + return error; + } + + + static FT_UInt + ps_unicodes_char_index( PS_Unicodes table, + FT_UInt32 unicode ) + { + PS_UniMap *min, *max, *mid, *result = NULL; + + + /* Perform a binary search on the table. */ + + min = table->maps; + max = min + table->num_maps - 1; + + while ( min <= max ) + { + FT_UInt32 base_glyph; + + + mid = min + ( ( max - min ) >> 1 ); + + if ( mid->unicode == unicode ) + { + result = mid; + break; + } + + base_glyph = BASE_GLYPH( mid->unicode ); + + if ( base_glyph == unicode ) + result = mid; /* remember match but continue search for base glyph */ + + if ( min == max ) + break; + + if ( base_glyph < unicode ) + min = mid + 1; + else + max = mid - 1; + } + + if ( result ) + return result->glyph_index; + else + return 0; + } + + + static FT_ULong + ps_unicodes_char_next( PS_Unicodes table, + FT_UInt32 *unicode ) + { + FT_UInt result = 0; + FT_UInt32 char_code = *unicode + 1; + + + { + FT_UInt min = 0; + FT_UInt max = table->num_maps; + FT_UInt mid; + PS_UniMap* map; + FT_UInt32 base_glyph; + + + while ( min < max ) + { + mid = min + ( ( max - min ) >> 1 ); + map = table->maps + mid; + + if ( map->unicode == char_code ) + { + result = map->glyph_index; + goto Exit; + } + + base_glyph = BASE_GLYPH( map->unicode ); + + if ( base_glyph == char_code ) + result = map->glyph_index; + + if ( base_glyph < char_code ) + min = mid + 1; + else + max = mid; + } + + if ( result ) + goto Exit; /* we have a variant glyph */ + + /* we didn't find it; check whether we have a map just above it */ + char_code = 0; + + if ( min < table->num_maps ) + { + map = table->maps + min; + result = map->glyph_index; + char_code = BASE_GLYPH( map->unicode ); + } + } + + Exit: + *unicode = char_code; + return result; + } + + +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + + + static const char* + ps_get_macintosh_name( FT_UInt name_index ) + { + if ( name_index >= FT_NUM_MAC_NAMES ) + name_index = 0; + + return ft_standard_glyph_names + ft_mac_names[name_index]; + } + + + static const char* + ps_get_standard_strings( FT_UInt sid ) + { + if ( sid >= FT_NUM_SID_NAMES ) + return 0; + + return ft_standard_glyph_names + ft_sid_names[sid]; + } + + + static + const FT_Service_PsCMapsRec pscmaps_interface = + { +#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + + (PS_Unicode_ValueFunc) ps_unicode_value, + (PS_Unicodes_InitFunc) ps_unicodes_init, + (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, + (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, + +#else + + 0, + 0, + 0, + 0, + +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + + (PS_Macintosh_NameFunc) ps_get_macintosh_name, + (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, + + t1_standard_encoding, + t1_expert_encoding + }; + + + static const FT_ServiceDescRec pscmaps_services[] = + { + { FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface }, + { NULL, NULL } + }; + + + static FT_Pointer + psnames_get_service( FT_Module module, + const char* service_id ) + { + FT_UNUSED( module ); + + return ft_service_list_lookup( pscmaps_services, service_id ); + } + +#endif /* !FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES */ + + + + FT_CALLBACK_TABLE_DEF + const FT_Module_Class psnames_module_class = + { + 0, /* this is not a font driver, nor a renderer */ + sizeof ( FT_ModuleRec ), + + "psnames", /* driver name */ + 0x10000L, /* driver version */ + 0x20000L, /* driver requires FreeType 2 or above */ + +#ifdef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES + 0, + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 +#else + (void*)&pscmaps_interface, /* module specific interface */ + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) psnames_get_service +#endif + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psnames/psmodule.h b/reactos/dll/3rdparty/freetype/src/psnames/psmodule.h index 232fdfb9a90..96e58dd9556 100644 --- a/reactos/dll/3rdparty/freetype/src/psnames/psmodule.h +++ b/reactos/dll/3rdparty/freetype/src/psnames/psmodule.h @@ -1,38 +1,38 @@ -/***************************************************************************/ -/* */ -/* psmodule.h */ -/* */ -/* High-level PSNames module interface (specification). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __PSMODULE_H__ -#define __PSMODULE_H__ - - -#include -#include FT_MODULE_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Module_Class ) psnames_module_class; - - -FT_END_HEADER - -#endif /* __PSMODULE_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* psmodule.h */ +/* */ +/* High-level PSNames module interface (specification). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __PSMODULE_H__ +#define __PSMODULE_H__ + + +#include +#include FT_MODULE_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Module_Class ) psnames_module_class; + + +FT_END_HEADER + +#endif /* __PSMODULE_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psnames/psnamerr.h b/reactos/dll/3rdparty/freetype/src/psnames/psnamerr.h index ae1541d960a..776fdd70855 100644 --- a/reactos/dll/3rdparty/freetype/src/psnames/psnamerr.h +++ b/reactos/dll/3rdparty/freetype/src/psnames/psnamerr.h @@ -1,41 +1,41 @@ -/***************************************************************************/ -/* */ -/* psnamerr.h */ -/* */ -/* PS names module error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the PS names module error enumeration */ - /* constants. */ - /* */ - /*************************************************************************/ - -#ifndef __PSNAMERR_H__ -#define __PSNAMERR_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX PSnames_Err_ -#define FT_ERR_BASE FT_Mod_Err_PSnames - -#include FT_ERRORS_H - -#endif /* __PSNAMERR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* psnamerr.h */ +/* */ +/* PS names module error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the PS names module error enumeration */ + /* constants. */ + /* */ + /*************************************************************************/ + +#ifndef __PSNAMERR_H__ +#define __PSNAMERR_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX PSnames_Err_ +#define FT_ERR_BASE FT_Mod_Err_PSnames + +#include FT_ERRORS_H + +#endif /* __PSNAMERR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psnames/psnames.c b/reactos/dll/3rdparty/freetype/src/psnames/psnames.c index d6ed998bfb1..9ca926b0845 100644 --- a/reactos/dll/3rdparty/freetype/src/psnames/psnames.c +++ b/reactos/dll/3rdparty/freetype/src/psnames/psnames.c @@ -1,25 +1,25 @@ -/***************************************************************************/ -/* */ -/* psnames.c */ -/* */ -/* FreeType PSNames module component (body only). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "psmodule.c" - - -/* END */ +/***************************************************************************/ +/* */ +/* psnames.c */ +/* */ +/* FreeType PSNames module component (body only). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "psmodule.c" + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/psnames/pstables.h b/reactos/dll/3rdparty/freetype/src/psnames/pstables.h index cc40ef735d6..cdf64c11d7f 100644 --- a/reactos/dll/3rdparty/freetype/src/psnames/pstables.h +++ b/reactos/dll/3rdparty/freetype/src/psnames/pstables.h @@ -1,4090 +1,4090 @@ -/***************************************************************************/ -/* */ -/* pstables.h */ -/* */ -/* PostScript glyph names. */ -/* */ -/* Copyright 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /* This file has been generated automatically -- do not edit! */ - - - static const char ft_standard_glyph_names[3696] = - { - '.','n','u','l','l', 0, - 'n','o','n','m','a','r','k','i','n','g','r','e','t','u','r','n', 0, - 'n','o','t','e','q','u','a','l', 0, - 'i','n','f','i','n','i','t','y', 0, - 'l','e','s','s','e','q','u','a','l', 0, - 'g','r','e','a','t','e','r','e','q','u','a','l', 0, - 'p','a','r','t','i','a','l','d','i','f','f', 0, - 's','u','m','m','a','t','i','o','n', 0, - 'p','r','o','d','u','c','t', 0, - 'p','i', 0, - 'i','n','t','e','g','r','a','l', 0, - 'O','m','e','g','a', 0, - 'r','a','d','i','c','a','l', 0, - 'a','p','p','r','o','x','e','q','u','a','l', 0, - 'D','e','l','t','a', 0, - 'n','o','n','b','r','e','a','k','i','n','g','s','p','a','c','e', 0, - 'l','o','z','e','n','g','e', 0, - 'a','p','p','l','e', 0, - 'f','r','a','n','c', 0, - 'G','b','r','e','v','e', 0, - 'g','b','r','e','v','e', 0, - 'I','d','o','t','a','c','c','e','n','t', 0, - 'S','c','e','d','i','l','l','a', 0, - 's','c','e','d','i','l','l','a', 0, - 'C','a','c','u','t','e', 0, - 'c','a','c','u','t','e', 0, - 'C','c','a','r','o','n', 0, - 'c','c','a','r','o','n', 0, - 'd','c','r','o','a','t', 0, - '.','n','o','t','d','e','f', 0, - 's','p','a','c','e', 0, - 'e','x','c','l','a','m', 0, - 'q','u','o','t','e','d','b','l', 0, - 'n','u','m','b','e','r','s','i','g','n', 0, - 'd','o','l','l','a','r', 0, - 'p','e','r','c','e','n','t', 0, - 'a','m','p','e','r','s','a','n','d', 0, - 'q','u','o','t','e','r','i','g','h','t', 0, - 'p','a','r','e','n','l','e','f','t', 0, - 'p','a','r','e','n','r','i','g','h','t', 0, - 'a','s','t','e','r','i','s','k', 0, - 'p','l','u','s', 0, - 'c','o','m','m','a', 0, - 'h','y','p','h','e','n', 0, - 'p','e','r','i','o','d', 0, - 's','l','a','s','h', 0, - 'z','e','r','o', 0, - 'o','n','e', 0, - 't','w','o', 0, - 't','h','r','e','e', 0, - 'f','o','u','r', 0, - 'f','i','v','e', 0, - 's','i','x', 0, - 's','e','v','e','n', 0, - 'e','i','g','h','t', 0, - 'n','i','n','e', 0, - 'c','o','l','o','n', 0, - 's','e','m','i','c','o','l','o','n', 0, - 'l','e','s','s', 0, - 'e','q','u','a','l', 0, - 'g','r','e','a','t','e','r', 0, - 'q','u','e','s','t','i','o','n', 0, - 'a','t', 0, - 'A', 0, - 'B', 0, - 'C', 0, - 'D', 0, - 'E', 0, - 'F', 0, - 'G', 0, - 'H', 0, - 'I', 0, - 'J', 0, - 'K', 0, - 'L', 0, - 'M', 0, - 'N', 0, - 'O', 0, - 'P', 0, - 'Q', 0, - 'R', 0, - 'S', 0, - 'T', 0, - 'U', 0, - 'V', 0, - 'W', 0, - 'X', 0, - 'Y', 0, - 'Z', 0, - 'b','r','a','c','k','e','t','l','e','f','t', 0, - 'b','a','c','k','s','l','a','s','h', 0, - 'b','r','a','c','k','e','t','r','i','g','h','t', 0, - 'a','s','c','i','i','c','i','r','c','u','m', 0, - 'u','n','d','e','r','s','c','o','r','e', 0, - 'q','u','o','t','e','l','e','f','t', 0, - 'a', 0, - 'b', 0, - 'c', 0, - 'd', 0, - 'e', 0, - 'f', 0, - 'g', 0, - 'h', 0, - 'i', 0, - 'j', 0, - 'k', 0, - 'l', 0, - 'm', 0, - 'n', 0, - 'o', 0, - 'p', 0, - 'q', 0, - 'r', 0, - 's', 0, - 't', 0, - 'u', 0, - 'v', 0, - 'w', 0, - 'x', 0, - 'y', 0, - 'z', 0, - 'b','r','a','c','e','l','e','f','t', 0, - 'b','a','r', 0, - 'b','r','a','c','e','r','i','g','h','t', 0, - 'a','s','c','i','i','t','i','l','d','e', 0, - 'e','x','c','l','a','m','d','o','w','n', 0, - 'c','e','n','t', 0, - 's','t','e','r','l','i','n','g', 0, - 'f','r','a','c','t','i','o','n', 0, - 'y','e','n', 0, - 'f','l','o','r','i','n', 0, - 's','e','c','t','i','o','n', 0, - 'c','u','r','r','e','n','c','y', 0, - 'q','u','o','t','e','s','i','n','g','l','e', 0, - 'q','u','o','t','e','d','b','l','l','e','f','t', 0, - 'g','u','i','l','l','e','m','o','t','l','e','f','t', 0, - 'g','u','i','l','s','i','n','g','l','l','e','f','t', 0, - 'g','u','i','l','s','i','n','g','l','r','i','g','h','t', 0, - 'f','i', 0, - 'f','l', 0, - 'e','n','d','a','s','h', 0, - 'd','a','g','g','e','r', 0, - 'd','a','g','g','e','r','d','b','l', 0, - 'p','e','r','i','o','d','c','e','n','t','e','r','e','d', 0, - 'p','a','r','a','g','r','a','p','h', 0, - 'b','u','l','l','e','t', 0, - 'q','u','o','t','e','s','i','n','g','l','b','a','s','e', 0, - 'q','u','o','t','e','d','b','l','b','a','s','e', 0, - 'q','u','o','t','e','d','b','l','r','i','g','h','t', 0, - 'g','u','i','l','l','e','m','o','t','r','i','g','h','t', 0, - 'e','l','l','i','p','s','i','s', 0, - 'p','e','r','t','h','o','u','s','a','n','d', 0, - 'q','u','e','s','t','i','o','n','d','o','w','n', 0, - 'g','r','a','v','e', 0, - 'a','c','u','t','e', 0, - 'c','i','r','c','u','m','f','l','e','x', 0, - 't','i','l','d','e', 0, - 'm','a','c','r','o','n', 0, - 'b','r','e','v','e', 0, - 'd','o','t','a','c','c','e','n','t', 0, - 'd','i','e','r','e','s','i','s', 0, - 'r','i','n','g', 0, - 'c','e','d','i','l','l','a', 0, - 'h','u','n','g','a','r','u','m','l','a','u','t', 0, - 'o','g','o','n','e','k', 0, - 'c','a','r','o','n', 0, - 'e','m','d','a','s','h', 0, - 'A','E', 0, - 'o','r','d','f','e','m','i','n','i','n','e', 0, - 'L','s','l','a','s','h', 0, - 'O','s','l','a','s','h', 0, - 'O','E', 0, - 'o','r','d','m','a','s','c','u','l','i','n','e', 0, - 'a','e', 0, - 'd','o','t','l','e','s','s','i', 0, - 'l','s','l','a','s','h', 0, - 'o','s','l','a','s','h', 0, - 'o','e', 0, - 'g','e','r','m','a','n','d','b','l','s', 0, - 'o','n','e','s','u','p','e','r','i','o','r', 0, - 'l','o','g','i','c','a','l','n','o','t', 0, - 'm','u', 0, - 't','r','a','d','e','m','a','r','k', 0, - 'E','t','h', 0, - 'o','n','e','h','a','l','f', 0, - 'p','l','u','s','m','i','n','u','s', 0, - 'T','h','o','r','n', 0, - 'o','n','e','q','u','a','r','t','e','r', 0, - 'd','i','v','i','d','e', 0, - 'b','r','o','k','e','n','b','a','r', 0, - 'd','e','g','r','e','e', 0, - 't','h','o','r','n', 0, - 't','h','r','e','e','q','u','a','r','t','e','r','s', 0, - 't','w','o','s','u','p','e','r','i','o','r', 0, - 'r','e','g','i','s','t','e','r','e','d', 0, - 'm','i','n','u','s', 0, - 'e','t','h', 0, - 'm','u','l','t','i','p','l','y', 0, - 't','h','r','e','e','s','u','p','e','r','i','o','r', 0, - 'c','o','p','y','r','i','g','h','t', 0, - 'A','a','c','u','t','e', 0, - 'A','c','i','r','c','u','m','f','l','e','x', 0, - 'A','d','i','e','r','e','s','i','s', 0, - 'A','g','r','a','v','e', 0, - 'A','r','i','n','g', 0, - 'A','t','i','l','d','e', 0, - 'C','c','e','d','i','l','l','a', 0, - 'E','a','c','u','t','e', 0, - 'E','c','i','r','c','u','m','f','l','e','x', 0, - 'E','d','i','e','r','e','s','i','s', 0, - 'E','g','r','a','v','e', 0, - 'I','a','c','u','t','e', 0, - 'I','c','i','r','c','u','m','f','l','e','x', 0, - 'I','d','i','e','r','e','s','i','s', 0, - 'I','g','r','a','v','e', 0, - 'N','t','i','l','d','e', 0, - 'O','a','c','u','t','e', 0, - 'O','c','i','r','c','u','m','f','l','e','x', 0, - 'O','d','i','e','r','e','s','i','s', 0, - 'O','g','r','a','v','e', 0, - 'O','t','i','l','d','e', 0, - 'S','c','a','r','o','n', 0, - 'U','a','c','u','t','e', 0, - 'U','c','i','r','c','u','m','f','l','e','x', 0, - 'U','d','i','e','r','e','s','i','s', 0, - 'U','g','r','a','v','e', 0, - 'Y','a','c','u','t','e', 0, - 'Y','d','i','e','r','e','s','i','s', 0, - 'Z','c','a','r','o','n', 0, - 'a','a','c','u','t','e', 0, - 'a','c','i','r','c','u','m','f','l','e','x', 0, - 'a','d','i','e','r','e','s','i','s', 0, - 'a','g','r','a','v','e', 0, - 'a','r','i','n','g', 0, - 'a','t','i','l','d','e', 0, - 'c','c','e','d','i','l','l','a', 0, - 'e','a','c','u','t','e', 0, - 'e','c','i','r','c','u','m','f','l','e','x', 0, - 'e','d','i','e','r','e','s','i','s', 0, - 'e','g','r','a','v','e', 0, - 'i','a','c','u','t','e', 0, - 'i','c','i','r','c','u','m','f','l','e','x', 0, - 'i','d','i','e','r','e','s','i','s', 0, - 'i','g','r','a','v','e', 0, - 'n','t','i','l','d','e', 0, - 'o','a','c','u','t','e', 0, - 'o','c','i','r','c','u','m','f','l','e','x', 0, - 'o','d','i','e','r','e','s','i','s', 0, - 'o','g','r','a','v','e', 0, - 'o','t','i','l','d','e', 0, - 's','c','a','r','o','n', 0, - 'u','a','c','u','t','e', 0, - 'u','c','i','r','c','u','m','f','l','e','x', 0, - 'u','d','i','e','r','e','s','i','s', 0, - 'u','g','r','a','v','e', 0, - 'y','a','c','u','t','e', 0, - 'y','d','i','e','r','e','s','i','s', 0, - 'z','c','a','r','o','n', 0, - 'e','x','c','l','a','m','s','m','a','l','l', 0, - 'H','u','n','g','a','r','u','m','l','a','u','t','s','m','a','l','l', 0, - 'd','o','l','l','a','r','o','l','d','s','t','y','l','e', 0, - 'd','o','l','l','a','r','s','u','p','e','r','i','o','r', 0, - 'a','m','p','e','r','s','a','n','d','s','m','a','l','l', 0, - 'A','c','u','t','e','s','m','a','l','l', 0, - 'p','a','r','e','n','l','e','f','t','s','u','p','e','r','i','o','r', 0, - 'p','a','r','e','n','r','i','g','h','t','s','u','p','e','r','i','o','r', 0, - 't','w','o','d','o','t','e','n','l','e','a','d','e','r', 0, - 'o','n','e','d','o','t','e','n','l','e','a','d','e','r', 0, - 'z','e','r','o','o','l','d','s','t','y','l','e', 0, - 'o','n','e','o','l','d','s','t','y','l','e', 0, - 't','w','o','o','l','d','s','t','y','l','e', 0, - 't','h','r','e','e','o','l','d','s','t','y','l','e', 0, - 'f','o','u','r','o','l','d','s','t','y','l','e', 0, - 'f','i','v','e','o','l','d','s','t','y','l','e', 0, - 's','i','x','o','l','d','s','t','y','l','e', 0, - 's','e','v','e','n','o','l','d','s','t','y','l','e', 0, - 'e','i','g','h','t','o','l','d','s','t','y','l','e', 0, - 'n','i','n','e','o','l','d','s','t','y','l','e', 0, - 'c','o','m','m','a','s','u','p','e','r','i','o','r', 0, - 't','h','r','e','e','q','u','a','r','t','e','r','s','e','m','d','a','s','h', 0, - 'p','e','r','i','o','d','s','u','p','e','r','i','o','r', 0, - 'q','u','e','s','t','i','o','n','s','m','a','l','l', 0, - 'a','s','u','p','e','r','i','o','r', 0, - 'b','s','u','p','e','r','i','o','r', 0, - 'c','e','n','t','s','u','p','e','r','i','o','r', 0, - 'd','s','u','p','e','r','i','o','r', 0, - 'e','s','u','p','e','r','i','o','r', 0, - 'i','s','u','p','e','r','i','o','r', 0, - 'l','s','u','p','e','r','i','o','r', 0, - 'm','s','u','p','e','r','i','o','r', 0, - 'n','s','u','p','e','r','i','o','r', 0, - 'o','s','u','p','e','r','i','o','r', 0, - 'r','s','u','p','e','r','i','o','r', 0, - 's','s','u','p','e','r','i','o','r', 0, - 't','s','u','p','e','r','i','o','r', 0, - 'f','f', 0, - 'f','f','i', 0, - 'f','f','l', 0, - 'p','a','r','e','n','l','e','f','t','i','n','f','e','r','i','o','r', 0, - 'p','a','r','e','n','r','i','g','h','t','i','n','f','e','r','i','o','r', 0, - 'C','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, - 'h','y','p','h','e','n','s','u','p','e','r','i','o','r', 0, - 'G','r','a','v','e','s','m','a','l','l', 0, - 'A','s','m','a','l','l', 0, - 'B','s','m','a','l','l', 0, - 'C','s','m','a','l','l', 0, - 'D','s','m','a','l','l', 0, - 'E','s','m','a','l','l', 0, - 'F','s','m','a','l','l', 0, - 'G','s','m','a','l','l', 0, - 'H','s','m','a','l','l', 0, - 'I','s','m','a','l','l', 0, - 'J','s','m','a','l','l', 0, - 'K','s','m','a','l','l', 0, - 'L','s','m','a','l','l', 0, - 'M','s','m','a','l','l', 0, - 'N','s','m','a','l','l', 0, - 'O','s','m','a','l','l', 0, - 'P','s','m','a','l','l', 0, - 'Q','s','m','a','l','l', 0, - 'R','s','m','a','l','l', 0, - 'S','s','m','a','l','l', 0, - 'T','s','m','a','l','l', 0, - 'U','s','m','a','l','l', 0, - 'V','s','m','a','l','l', 0, - 'W','s','m','a','l','l', 0, - 'X','s','m','a','l','l', 0, - 'Y','s','m','a','l','l', 0, - 'Z','s','m','a','l','l', 0, - 'c','o','l','o','n','m','o','n','e','t','a','r','y', 0, - 'o','n','e','f','i','t','t','e','d', 0, - 'r','u','p','i','a','h', 0, - 'T','i','l','d','e','s','m','a','l','l', 0, - 'e','x','c','l','a','m','d','o','w','n','s','m','a','l','l', 0, - 'c','e','n','t','o','l','d','s','t','y','l','e', 0, - 'L','s','l','a','s','h','s','m','a','l','l', 0, - 'S','c','a','r','o','n','s','m','a','l','l', 0, - 'Z','c','a','r','o','n','s','m','a','l','l', 0, - 'D','i','e','r','e','s','i','s','s','m','a','l','l', 0, - 'B','r','e','v','e','s','m','a','l','l', 0, - 'C','a','r','o','n','s','m','a','l','l', 0, - 'D','o','t','a','c','c','e','n','t','s','m','a','l','l', 0, - 'M','a','c','r','o','n','s','m','a','l','l', 0, - 'f','i','g','u','r','e','d','a','s','h', 0, - 'h','y','p','h','e','n','i','n','f','e','r','i','o','r', 0, - 'O','g','o','n','e','k','s','m','a','l','l', 0, - 'R','i','n','g','s','m','a','l','l', 0, - 'C','e','d','i','l','l','a','s','m','a','l','l', 0, - 'q','u','e','s','t','i','o','n','d','o','w','n','s','m','a','l','l', 0, - 'o','n','e','e','i','g','h','t','h', 0, - 't','h','r','e','e','e','i','g','h','t','h','s', 0, - 'f','i','v','e','e','i','g','h','t','h','s', 0, - 's','e','v','e','n','e','i','g','h','t','h','s', 0, - 'o','n','e','t','h','i','r','d', 0, - 't','w','o','t','h','i','r','d','s', 0, - 'z','e','r','o','s','u','p','e','r','i','o','r', 0, - 'f','o','u','r','s','u','p','e','r','i','o','r', 0, - 'f','i','v','e','s','u','p','e','r','i','o','r', 0, - 's','i','x','s','u','p','e','r','i','o','r', 0, - 's','e','v','e','n','s','u','p','e','r','i','o','r', 0, - 'e','i','g','h','t','s','u','p','e','r','i','o','r', 0, - 'n','i','n','e','s','u','p','e','r','i','o','r', 0, - 'z','e','r','o','i','n','f','e','r','i','o','r', 0, - 'o','n','e','i','n','f','e','r','i','o','r', 0, - 't','w','o','i','n','f','e','r','i','o','r', 0, - 't','h','r','e','e','i','n','f','e','r','i','o','r', 0, - 'f','o','u','r','i','n','f','e','r','i','o','r', 0, - 'f','i','v','e','i','n','f','e','r','i','o','r', 0, - 's','i','x','i','n','f','e','r','i','o','r', 0, - 's','e','v','e','n','i','n','f','e','r','i','o','r', 0, - 'e','i','g','h','t','i','n','f','e','r','i','o','r', 0, - 'n','i','n','e','i','n','f','e','r','i','o','r', 0, - 'c','e','n','t','i','n','f','e','r','i','o','r', 0, - 'd','o','l','l','a','r','i','n','f','e','r','i','o','r', 0, - 'p','e','r','i','o','d','i','n','f','e','r','i','o','r', 0, - 'c','o','m','m','a','i','n','f','e','r','i','o','r', 0, - 'A','g','r','a','v','e','s','m','a','l','l', 0, - 'A','a','c','u','t','e','s','m','a','l','l', 0, - 'A','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, - 'A','t','i','l','d','e','s','m','a','l','l', 0, - 'A','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, - 'A','r','i','n','g','s','m','a','l','l', 0, - 'A','E','s','m','a','l','l', 0, - 'C','c','e','d','i','l','l','a','s','m','a','l','l', 0, - 'E','g','r','a','v','e','s','m','a','l','l', 0, - 'E','a','c','u','t','e','s','m','a','l','l', 0, - 'E','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, - 'E','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, - 'I','g','r','a','v','e','s','m','a','l','l', 0, - 'I','a','c','u','t','e','s','m','a','l','l', 0, - 'I','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, - 'I','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, - 'E','t','h','s','m','a','l','l', 0, - 'N','t','i','l','d','e','s','m','a','l','l', 0, - 'O','g','r','a','v','e','s','m','a','l','l', 0, - 'O','a','c','u','t','e','s','m','a','l','l', 0, - 'O','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, - 'O','t','i','l','d','e','s','m','a','l','l', 0, - 'O','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, - 'O','E','s','m','a','l','l', 0, - 'O','s','l','a','s','h','s','m','a','l','l', 0, - 'U','g','r','a','v','e','s','m','a','l','l', 0, - 'U','a','c','u','t','e','s','m','a','l','l', 0, - 'U','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, - 'U','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, - 'Y','a','c','u','t','e','s','m','a','l','l', 0, - 'T','h','o','r','n','s','m','a','l','l', 0, - 'Y','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, - '0','0','1','.','0','0','0', 0, - '0','0','1','.','0','0','1', 0, - '0','0','1','.','0','0','2', 0, - '0','0','1','.','0','0','3', 0, - 'B','l','a','c','k', 0, - 'B','o','l','d', 0, - 'B','o','o','k', 0, - 'L','i','g','h','t', 0, - 'M','e','d','i','u','m', 0, - 'R','e','g','u','l','a','r', 0, - 'R','o','m','a','n', 0, - 'S','e','m','i','b','o','l','d', 0, - }; - - -#define FT_NUM_MAC_NAMES 258 - - /* Values are offsets into the `ft_standard_glyph_names' table */ - - static const short ft_mac_names[FT_NUM_MAC_NAMES] = - { - 253, 0, 6, 261, 267, 274, 283, 294, 301, 309, 758, 330, 340, 351, - 360, 365, 371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430, - 436, 441, 447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498, - 500, 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, - 528, 530, 532, 534, 536, 538, 540, 552, 562, 575, 587, 979, 608, 610, - 612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, - 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685, - 1375,1392,1405,1414,1486,1512,1562,1603,1632,1610,1622,1645,1639,1652, - 1661,1690,1668,1680,1697,1726,1704,1716,1733,1740,1769,1747,1759,1776, - 1790,1819,1797,1809, 839,1263, 707, 712, 741, 881, 871,1160,1302,1346, - 1197, 985,1031, 23,1086,1108, 32,1219, 41, 51, 730,1194, 64, 76, - 86, 94, 97,1089,1118, 106,1131,1150, 966, 696,1183, 112, 734, 120, - 132, 783, 930, 945, 138,1385,1398,1529,1115,1157, 832,1079, 770, 916, - 598, 319,1246, 155,1833,1586, 721, 749, 797, 811, 826, 829, 846, 856, - 888, 903, 954,1363,1421,1356,1433,1443,1450,1457,1469,1479,1493,1500, - 163,1522,1543,1550,1572,1134, 991,1002,1008,1015,1021,1040,1045,1053, - 1066,1073,1101,1143,1536,1783,1596,1843,1253,1207,1319,1579,1826,1229, - 1270,1313,1323,1171,1290,1332,1211,1235,1276, 169, 175, 182, 189, 200, - 209, 218, 225, 232, 239, 246 - }; - - -#define FT_NUM_SID_NAMES 391 - - /* Values are offsets into the `ft_standard_glyph_names' table */ - - static const short ft_sid_names[FT_NUM_SID_NAMES] = - { - 253, 261, 267, 274, 283, 294, 301, 309, 319, 330, 340, 351, 360, 365, - 371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430, 436, 441, - 447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498, 500, 502, - 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, - 532, 534, 536, 538, 540, 552, 562, 575, 587, 598, 608, 610, 612, 614, - 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642, - 644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685, 696, 707, - 712, 721, 730, 734, 741, 749, 758, 770, 783, 797, 811, 826, 829, 832, - 839, 846, 856, 871, 881, 888, 903, 916, 930, 945, 954, 966, 979, 985, - 991,1002,1008,1015,1021,1031,1040,1045,1053,1066,1073,1079,1086,1089, - 1101,1108,1115,1118,1131,1134,1143,1150,1157,1160,1171,1183,1194,1197, - 1207,1211,1219,1229,1235,1246,1253,1263,1270,1276,1290,1302,1313,1319, - 1323,1332,1346,1356,1363,1375,1385,1392,1398,1405,1414,1421,1433,1443, - 1450,1457,1469,1479,1486,1493,1500,1512,1522,1529,1536,1543,1550,1562, - 1572,1579,1586,1596,1603,1610,1622,1632,1639,1645,1652,1661,1668,1680, - 1690,1697,1704,1716,1726,1733,1740,1747,1759,1769,1776,1783,1790,1797, - 1809,1819,1826,1833,1843,1850,1862,1880,1895,1910,1925,1936,1954,1973, - 1988,2003,2016,2028,2040,2054,2067,2080,2092,2106,2120,2133,2147,2167, - 2182,2196,2206,2216,2229,2239,2249,2259,2269,2279,2289,2299,2309,2319, - 2329,2332,2336,2340,2358,2377,2393,2408,2419,2426,2433,2440,2447,2454, - 2461,2468,2475,2482,2489,2496,2503,2510,2517,2524,2531,2538,2545,2552, - 2559,2566,2573,2580,2587,2594,2601,2615,2625,2632,2643,2659,2672,2684, - 2696,2708,2722,2733,2744,2759,2771,2782,2797,2809,2819,2832,2850,2860, - 2873,2885,2898,2907,2917,2930,2943,2956,2968,2982,2996,3009,3022,3034, - 3046,3060,3073,3086,3098,3112,3126,3139,3152,3167,3182,3196,3208,3220, - 3237,3249,3264,3275,3283,3297,3309,3321,3338,3353,3365,3377,3394,3409, - 3418,3430,3442,3454,3471,3483,3498,3506,3518,3530,3542,3559,3574,3586, - 3597,3612,3620,3628,3636,3644,3650,3655,3660,3666,3673,3681,3687 - }; - - - /* the following are indices into the SID name table */ - static const unsigned short t1_standard_encoding[256] = - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110, - 0,111,112,113,114, 0,115,116,117,118,119,120,121,122, 0,123, - 0,124,125,126,127,128,129,130,131, 0,132,133, 0,134,135,136, - 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,138, 0,139, 0, 0, 0, 0,140,141,142,143, 0, 0, 0, 0, - 0,144, 0, 0, 0,145, 0, 0,146,147,148,149, 0, 0, 0, 0 - }; - - - /* the following are indices into the SID name table */ - static const unsigned short t1_expert_encoding[256] = - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1,229,230, 0,231,232,233,234,235,236,237,238, 13, 14, 15, 99, - 239,240,241,242,243,244,245,246,247,248, 27, 28,249,250,251,252, - 0,253,254,255,256,257, 0, 0, 0,258, 0, 0,259,260,261,262, - 0, 0,263,264,265, 0,266,109,110,267,268,269, 0,270,271,272, - 273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288, - 289,290,291,292,293,294,295,296,297,298,299,300,301,302,303, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,304,305,306, 0, 0,307,308,309,310,311, 0,312, 0, 0,313, - 0, 0,314,315, 0, 0,316,317,318, 0, 0, 0,158,155,163,319, - 320,321,322,323,324,325, 0, 0,326,150,164,169,327,328,329,330, - 331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346, - 347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362, - 363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378 - }; - - - /* - * This table is a compressed version of the Adobe Glyph List (AGL), - * optimized for efficient searching. It has been generated by the - * `glnames.py' python script located in the `src/tools' directory. - * - * The lookup function to get the Unicode value for a given string - * is defined below the table. - */ - static const unsigned char ft_adobe_glyph_list[54791] = - { - 0, 52, 0,106, 2,167, 3, 63, 4,220, 6,125, 9,143, 10, 23, - 11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88, - 22,110, 23, 32, 23, 71, 24, 77, 27,156, 29, 73, 31,247, 32,107, - 32,222, 33, 55, 34,154, 35,218, 53, 84, 59,196, 68, 6, 75,183, - 83,178, 88,135, 93,242,101,165,109,185,111, 55,117,254,123, 73, - 130,238,138,206,145, 31,153,182,156,189,163,249,178,221,193, 17, - 197, 99,199,240,204, 27,204,155,210,100, 65,143, 0, 65, 0,140, - 0,175, 0,193, 1, 15, 1,147, 1,233, 1,251, 2, 7, 2, 40, - 2, 57, 2, 82, 2, 91, 2,128, 2,136, 2,154, 69,131, 0,198, - 0,150, 0,158, 0,167,225,227,245,244,101,128, 1,252,237,225, - 227,242,239,110,128, 1,226,243,237,225,236,108,128,247,230,225, - 227,245,244,101,129, 0,193, 0,185,243,237,225,236,108,128,247, - 225,226,242,229,246,101,134, 1, 2, 0,213, 0,221, 0,232, 0, - 243, 0,251, 1, 7,225,227,245,244,101,128, 30,174,227,249,242, - 233,236,236,233, 99,128, 4,208,228,239,244,226,229,236,239,119, - 128, 30,182,231,242,225,246,101,128, 30,176,232,239,239,235,225, - 226,239,246,101,128, 30,178,244,233,236,228,101,128, 30,180, 99, - 4, 1, 25, 1, 32, 1,121, 1,137,225,242,239,110,128, 1,205, - 233,242, 99, 2, 1, 40, 1, 45,236,101,128, 36,182,245,237,230, - 236,229,120,134, 0,194, 1, 66, 1, 74, 1, 85, 1, 93, 1,105, - 1,113,225,227,245,244,101,128, 30,164,228,239,244,226,229,236, - 239,119,128, 30,172,231,242,225,246,101,128, 30,166,232,239,239, - 235,225,226,239,246,101,128, 30,168,243,237,225,236,108,128,247, - 226,244,233,236,228,101,128, 30,170,245,244,101,129,246,201, 1, - 129,243,237,225,236,108,128,247,180,249,242,233,236,236,233, 99, - 128, 4, 16,100, 3, 1,155, 1,165, 1,209,226,236,231,242,225, - 246,101,128, 2, 0,233,229,242,229,243,233,115,131, 0,196, 1, - 181, 1,192, 1,201,227,249,242,233,236,236,233, 99,128, 4,210, - 237,225,227,242,239,110,128, 1,222,243,237,225,236,108,128,247, - 228,239,116, 2, 1,216, 1,224,226,229,236,239,119,128, 30,160, - 237,225,227,242,239,110,128, 1,224,231,242,225,246,101,129, 0, - 192, 1,243,243,237,225,236,108,128,247,224,232,239,239,235,225, - 226,239,246,101,128, 30,162,105, 2, 2, 13, 2, 25,229,227,249, - 242,233,236,236,233, 99,128, 4,212,238,246,229,242,244,229,228, - 226,242,229,246,101,128, 2, 2,236,240,232, 97,129, 3,145, 2, - 49,244,239,238,239,115,128, 3,134,109, 2, 2, 63, 2, 71,225, - 227,242,239,110,128, 1, 0,239,238,239,243,240,225,227,101,128, - 255, 33,239,231,239,238,229,107,128, 1, 4,242,233,238,103,131, - 0,197, 2,104, 2,112, 2,120,225,227,245,244,101,128, 1,250, - 226,229,236,239,119,128, 30, 0,243,237,225,236,108,128,247,229, - 243,237,225,236,108,128,247, 97,244,233,236,228,101,129, 0,195, - 2,146,243,237,225,236,108,128,247,227,249,226,225,242,237,229, - 238,233,225,110,128, 5, 49, 66,137, 0, 66, 2,189, 2,198, 2, - 223, 3, 3, 3, 10, 3, 22, 3, 34, 3, 46, 3, 54,227,233,242, - 227,236,101,128, 36,183,228,239,116, 2, 2,206, 2,215,225,227, - 227,229,238,116,128, 30, 2,226,229,236,239,119,128, 30, 4,101, - 3, 2,231, 2,242, 2,254,227,249,242,233,236,236,233, 99,128, - 4, 17,238,225,242,237,229,238,233,225,110,128, 5, 50,244, 97, - 128, 3,146,232,239,239,107,128, 1,129,236,233,238,229,226,229, - 236,239,119,128, 30, 6,237,239,238,239,243,240,225,227,101,128, - 255, 34,242,229,246,229,243,237,225,236,108,128,246,244,243,237, - 225,236,108,128,247, 98,244,239,240,226,225,114,128, 1,130, 67, - 137, 0, 67, 3, 85, 3,127, 3,193, 3,210, 3,224, 4,171, 4, - 188, 4,200, 4,212, 97, 3, 3, 93, 3,104, 3,111,225,242,237, - 229,238,233,225,110,128, 5, 62,227,245,244,101,128, 1, 6,242, - 239,110,129,246,202, 3,119,243,237,225,236,108,128,246,245, 99, - 3, 3,135, 3,142, 3,171,225,242,239,110,128, 1, 12,229,228, - 233,236,236, 97,130, 0,199, 3,155, 3,163,225,227,245,244,101, - 128, 30, 8,243,237,225,236,108,128,247,231,233,242, 99, 2, 3, - 179, 3,184,236,101,128, 36,184,245,237,230,236,229,120,128, 1, - 8,228,239,116,129, 1, 10, 3,201,225,227,227,229,238,116,128, - 1, 10,229,228,233,236,236,225,243,237,225,236,108,128,247,184, - 104, 4, 3,234, 3,246, 4,161, 4,165,225,225,242,237,229,238, - 233,225,110,128, 5, 73,101, 6, 4, 4, 4, 24, 4, 35, 4,103, - 4,115, 4,136,225,226,235,232,225,243,233,225,238,227,249,242, - 233,236,236,233, 99,128, 4,188,227,249,242,233,236,236,233, 99, - 128, 4, 39,100, 2, 4, 41, 4, 85,229,243,227,229,238,228,229, - 114, 2, 4, 54, 4, 74,225,226,235,232,225,243,233,225,238,227, - 249,242,233,236,236,233, 99,128, 4,190,227,249,242,233,236,236, - 233, 99,128, 4,182,233,229,242,229,243,233,243,227,249,242,233, - 236,236,233, 99,128, 4,244,232,225,242,237,229,238,233,225,110, - 128, 5, 67,235,232,225,235,225,243,243,233,225,238,227,249,242, - 233,236,236,233, 99,128, 4,203,246,229,242,244,233,227,225,236, - 243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128, 4, - 184,105,128, 3,167,239,239,107,128, 1,135,233,242,227,245,237, - 230,236,229,248,243,237,225,236,108,128,246,246,237,239,238,239, - 243,240,225,227,101,128,255, 35,239,225,242,237,229,238,233,225, - 110,128, 5, 81,243,237,225,236,108,128,247, 99, 68,142, 0, 68, - 4,252, 5, 10, 5, 36, 5, 96, 5,121, 5,166, 5,173, 5,231, - 5,244, 6, 0, 6, 12, 6, 28, 6, 48, 6, 57, 90,129, 1,241, - 5, 2,227,225,242,239,110,128, 1,196, 97, 2, 5, 16, 5, 27, - 225,242,237,229,238,233,225,110,128, 5, 52,230,242,233,227,225, - 110,128, 1,137, 99, 4, 5, 46, 5, 53, 5, 62, 5, 89,225,242, - 239,110,128, 1, 14,229,228,233,236,236, 97,128, 30, 16,233,242, - 99, 2, 5, 70, 5, 75,236,101,128, 36,185,245,237,230,236,229, - 248,226,229,236,239,119,128, 30, 18,242,239,225,116,128, 1, 16, - 228,239,116, 2, 5,104, 5,113,225,227,227,229,238,116,128, 30, - 10,226,229,236,239,119,128, 30, 12,101, 3, 5,129, 5,140, 5, - 150,227,249,242,233,236,236,233, 99,128, 4, 20,233,227,239,240, - 244,233, 99,128, 3,238,236,244, 97,129, 34, 6, 5,158,231,242, - 229,229,107,128, 3,148,232,239,239,107,128, 1,138,105, 2, 5, - 179, 5,218,229,242,229,243,233,115,131,246,203, 5,194, 5,202, - 5,210,193,227,245,244,101,128,246,204,199,242,225,246,101,128, - 246,205,243,237,225,236,108,128,247,168,231,225,237,237,225,231, - 242,229,229,107,128, 3,220,234,229,227,249,242,233,236,236,233, - 99,128, 4, 2,236,233,238,229,226,229,236,239,119,128, 30, 14, - 237,239,238,239,243,240,225,227,101,128,255, 36,239,244,225,227, - 227,229,238,244,243,237,225,236,108,128,246,247,115, 2, 6, 34, - 6, 41,236,225,243,104,128, 1, 16,237,225,236,108,128,247,100, - 244,239,240,226,225,114,128, 1,139,122,131, 1,242, 6, 67, 6, - 75, 6,112,227,225,242,239,110,128, 1,197,101, 2, 6, 81, 6, - 101,225,226,235,232,225,243,233,225,238,227,249,242,233,236,236, - 233, 99,128, 4,224,227,249,242,233,236,236,233, 99,128, 4, 5, - 232,229,227,249,242,233,236,236,233, 99,128, 4, 15, 69,146, 0, - 69, 6,165, 6,183, 6,191, 7, 89, 7,153, 7,165, 7,183, 7, - 211, 8, 7, 8, 36, 8, 94, 8,169, 8,189, 8,208, 8,248, 9, - 44, 9,109, 9,115,225,227,245,244,101,129, 0,201, 6,175,243, - 237,225,236,108,128,247,233,226,242,229,246,101,128, 1, 20, 99, - 5, 6,203, 6,210, 6,224, 6,236, 7, 79,225,242,239,110,128, - 1, 26,229,228,233,236,236,225,226,242,229,246,101,128, 30, 28, - 232,225,242,237,229,238,233,225,110,128, 5, 53,233,242, 99, 2, - 6,244, 6,249,236,101,128, 36,186,245,237,230,236,229,120,135, - 0,202, 7, 16, 7, 24, 7, 32, 7, 43, 7, 51, 7, 63, 7, 71, - 225,227,245,244,101,128, 30,190,226,229,236,239,119,128, 30, 24, - 228,239,244,226,229,236,239,119,128, 30,198,231,242,225,246,101, - 128, 30,192,232,239,239,235,225,226,239,246,101,128, 30,194,243, - 237,225,236,108,128,247,234,244,233,236,228,101,128, 30,196,249, - 242,233,236,236,233, 99,128, 4, 4,100, 3, 7, 97, 7,107, 7, - 127,226,236,231,242,225,246,101,128, 2, 4,233,229,242,229,243, - 233,115,129, 0,203, 7,119,243,237,225,236,108,128,247,235,239, - 116,130, 1, 22, 7,136, 7,145,225,227,227,229,238,116,128, 1, - 22,226,229,236,239,119,128, 30,184,230,227,249,242,233,236,236, - 233, 99,128, 4, 36,231,242,225,246,101,129, 0,200, 7,175,243, - 237,225,236,108,128,247,232,104, 2, 7,189, 7,200,225,242,237, - 229,238,233,225,110,128, 5, 55,239,239,235,225,226,239,246,101, - 128, 30,186,105, 3, 7,219, 7,230, 7,245,231,232,244,242,239, - 237,225,110,128, 33,103,238,246,229,242,244,229,228,226,242,229, - 246,101,128, 2, 6,239,244,233,230,233,229,228,227,249,242,233, - 236,236,233, 99,128, 4,100,108, 2, 8, 13, 8, 24,227,249,242, - 233,236,236,233, 99,128, 4, 27,229,246,229,238,242,239,237,225, - 110,128, 33,106,109, 3, 8, 44, 8, 72, 8, 83,225,227,242,239, - 110,130, 1, 18, 8, 56, 8, 64,225,227,245,244,101,128, 30, 22, - 231,242,225,246,101,128, 30, 20,227,249,242,233,236,236,233, 99, - 128, 4, 28,239,238,239,243,240,225,227,101,128,255, 37,110, 4, - 8,104, 8,115, 8,135, 8,154,227,249,242,233,236,236,233, 99, - 128, 4, 29,228,229,243,227,229,238,228,229,242,227,249,242,233, - 236,236,233, 99,128, 4,162,103,129, 1, 74, 8,141,232,229,227, - 249,242,233,236,236,233, 99,128, 4,164,232,239,239,235,227,249, - 242,233,236,236,233, 99,128, 4,199,111, 2, 8,175, 8,183,231, - 239,238,229,107,128, 1, 24,240,229,110,128, 1,144,240,243,233, - 236,239,110,129, 3,149, 8,200,244,239,238,239,115,128, 3,136, - 114, 2, 8,214, 8,225,227,249,242,233,236,236,233, 99,128, 4, - 32,229,246,229,242,243,229,100,129, 1,142, 8,237,227,249,242, - 233,236,236,233, 99,128, 4, 45,115, 4, 9, 2, 9, 13, 9, 33, - 9, 37,227,249,242,233,236,236,233, 99,128, 4, 33,228,229,243, - 227,229,238,228,229,242,227,249,242,233,236,236,233, 99,128, 4, - 170,104,128, 1,169,237,225,236,108,128,247,101,116, 3, 9, 52, - 9, 78, 9, 92, 97,130, 3,151, 9, 60, 9, 70,242,237,229,238, - 233,225,110,128, 5, 56,244,239,238,239,115,128, 3,137,104,129, - 0,208, 9, 84,243,237,225,236,108,128,247,240,233,236,228,101, - 129, 30,188, 9,101,226,229,236,239,119,128, 30, 26,245,242,111, - 128, 32,172,250,104,130, 1,183, 9,124, 9,132,227,225,242,239, - 110,128, 1,238,242,229,246,229,242,243,229,100,128, 1,184, 70, - 136, 0, 70, 9,163, 9,172, 9,184, 9,212, 9,219, 9,248, 10, - 4, 10, 15,227,233,242,227,236,101,128, 36,187,228,239,244,225, - 227,227,229,238,116,128, 30, 30,101, 2, 9,190, 9,202,232,225, - 242,237,229,238,233,225,110,128, 5, 86,233,227,239,240,244,233, - 99,128, 3,228,232,239,239,107,128, 1,145,105, 2, 9,225, 9, - 238,244,225,227,249,242,233,236,236,233, 99,128, 4,114,246,229, - 242,239,237,225,110,128, 33,100,237,239,238,239,243,240,225,227, - 101,128,255, 38,239,245,242,242,239,237,225,110,128, 33, 99,243, - 237,225,236,108,128,247,102, 71,140, 0, 71, 10, 51, 10, 61, 10, - 107, 10,115, 10,176, 10,193, 10,205, 11, 39, 11, 52, 11, 65, 11, - 90, 11,107,194,243,241,245,225,242,101,128, 51,135, 97, 3, 10, - 69, 10, 76, 10, 94,227,245,244,101,128, 1,244,237,237, 97,129, - 3,147, 10, 84,225,230,242,233,227,225,110,128, 1,148,238,231, - 233,225,227,239,240,244,233, 99,128, 3,234,226,242,229,246,101, - 128, 1, 30, 99, 4, 10,125, 10,132, 10,141, 10,163,225,242,239, - 110,128, 1,230,229,228,233,236,236, 97,128, 1, 34,233,242, 99, - 2, 10,149, 10,154,236,101,128, 36,188,245,237,230,236,229,120, - 128, 1, 28,239,237,237,225,225,227,227,229,238,116,128, 1, 34, - 228,239,116,129, 1, 32, 10,184,225,227,227,229,238,116,128, 1, - 32,229,227,249,242,233,236,236,233, 99,128, 4, 19,104, 3, 10, - 213, 10,226, 11, 33,225,228,225,242,237,229,238,233,225,110,128, - 5, 66,101, 3, 10,234, 10,255, 11, 16,237,233,228,228,236,229, - 232,239,239,235,227,249,242,233,236,236,233, 99,128, 4,148,243, - 244,242,239,235,229,227,249,242,233,236,236,233, 99,128, 4,146, - 245,240,244,245,242,238,227,249,242,233,236,236,233, 99,128, 4, - 144,239,239,107,128, 1,147,233,237,225,242,237,229,238,233,225, - 110,128, 5, 51,234,229,227,249,242,233,236,236,233, 99,128, 4, - 3,109, 2, 11, 71, 11, 79,225,227,242,239,110,128, 30, 32,239, - 238,239,243,240,225,227,101,128,255, 39,242,225,246,101,129,246, - 206, 11, 99,243,237,225,236,108,128,247, 96,115, 2, 11,113, 11, - 129,237,225,236,108,129,247,103, 11,122,232,239,239,107,128, 2, - 155,244,242,239,235,101,128, 1,228, 72,140, 0, 72, 11,165, 11, - 190, 11,198, 11,208, 12, 17, 12, 40, 12, 77, 12,117, 12,129, 12, - 157, 12,165, 12,189,177,184, 53, 3, 11,175, 11,180, 11,185,179, - 51,128, 37,207,180, 51,128, 37,170,181, 49,128, 37,171,178,178, - 176,183, 51,128, 37,161,208,243,241,245,225,242,101,128, 51,203, - 97, 3, 11,216, 11,236, 12, 0,225,226,235,232,225,243,233,225, - 238,227,249,242,233,236,236,233, 99,128, 4,168,228,229,243,227, - 229,238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,178, - 242,228,243,233,231,238,227,249,242,233,236,236,233, 99,128, 4, - 42, 98, 2, 12, 23, 12, 28,225,114,128, 1, 38,242,229,246,229, - 226,229,236,239,119,128, 30, 42, 99, 2, 12, 46, 12, 55,229,228, - 233,236,236, 97,128, 30, 40,233,242, 99, 2, 12, 63, 12, 68,236, - 101,128, 36,189,245,237,230,236,229,120,128, 1, 36,100, 2, 12, - 83, 12, 93,233,229,242,229,243,233,115,128, 30, 38,239,116, 2, - 12,100, 12,109,225,227,227,229,238,116,128, 30, 34,226,229,236, - 239,119,128, 30, 36,237,239,238,239,243,240,225,227,101,128,255, - 40,111, 2, 12,135, 12,146,225,242,237,229,238,233,225,110,128, - 5, 64,242,233,227,239,240,244,233, 99,128, 3,232,243,237,225, - 236,108,128,247,104,245,238,231,225,242,245,237,236,225,245,116, - 129,246,207, 12,181,243,237,225,236,108,128,246,248,250,243,241, - 245,225,242,101,128, 51,144, 73,146, 0, 73, 12,239, 12,251, 12, - 255, 13, 11, 13, 29, 13, 37, 13, 94, 13,181, 13,214, 13,224, 13, - 242, 13,254, 14, 48, 14, 86, 14, 99, 14,166, 14,187, 14,205,193, - 227,249,242,233,236,236,233, 99,128, 4, 47, 74,128, 1, 50,213, - 227,249,242,233,236,236,233, 99,128, 4, 46,225,227,245,244,101, - 129, 0,205, 13, 21,243,237,225,236,108,128,247,237,226,242,229, - 246,101,128, 1, 44, 99, 3, 13, 45, 13, 52, 13, 84,225,242,239, - 110,128, 1,207,233,242, 99, 2, 13, 60, 13, 65,236,101,128, 36, - 190,245,237,230,236,229,120,129, 0,206, 13, 76,243,237,225,236, - 108,128,247,238,249,242,233,236,236,233, 99,128, 4, 6,100, 3, - 13,102, 13,112, 13,155,226,236,231,242,225,246,101,128, 2, 8, - 233,229,242,229,243,233,115,131, 0,207, 13,128, 13,136, 13,147, - 225,227,245,244,101,128, 30, 46,227,249,242,233,236,236,233, 99, - 128, 4,228,243,237,225,236,108,128,247,239,239,116,130, 1, 48, - 13,164, 13,173,225,227,227,229,238,116,128, 1, 48,226,229,236, - 239,119,128, 30,202,101, 2, 13,187, 13,203,226,242,229,246,229, - 227,249,242,233,236,236,233, 99,128, 4,214,227,249,242,233,236, - 236,233, 99,128, 4, 21,230,242,225,235,244,245,114,128, 33, 17, - 231,242,225,246,101,129, 0,204, 13,234,243,237,225,236,108,128, - 247,236,232,239,239,235,225,226,239,246,101,128, 30,200,105, 3, - 14, 6, 14, 17, 14, 32,227,249,242,233,236,236,233, 99,128, 4, - 24,238,246,229,242,244,229,228,226,242,229,246,101,128, 2, 10, - 243,232,239,242,244,227,249,242,233,236,236,233, 99,128, 4, 25, - 109, 2, 14, 54, 14, 75,225,227,242,239,110,129, 1, 42, 14, 64, - 227,249,242,233,236,236,233, 99,128, 4,226,239,238,239,243,240, - 225,227,101,128,255, 41,238,233,225,242,237,229,238,233,225,110, - 128, 5, 59,111, 3, 14,107, 14,118, 14,126,227,249,242,233,236, - 236,233, 99,128, 4, 1,231,239,238,229,107,128, 1, 46,244, 97, - 131, 3,153, 14,137, 14,147, 14,158,225,230,242,233,227,225,110, - 128, 1,150,228,233,229,242,229,243,233,115,128, 3,170,244,239, - 238,239,115,128, 3,138,115, 2, 14,172, 14,179,237,225,236,108, - 128,247,105,244,242,239,235,101,128, 1,151,244,233,236,228,101, - 129, 1, 40, 14,197,226,229,236,239,119,128, 30, 44,250,232,233, - 244,243, 97, 2, 14,216, 14,227,227,249,242,233,236,236,233, 99, - 128, 4,116,228,226,236,231,242,225,246,229,227,249,242,233,236, - 236,233, 99,128, 4,118, 74,134, 0, 74, 15, 6, 15, 18, 15, 41, - 15, 53, 15, 67, 15, 79,225,225,242,237,229,238,233,225,110,128, - 5, 65,227,233,242, 99, 2, 15, 27, 15, 32,236,101,128, 36,191, - 245,237,230,236,229,120,128, 1, 52,229,227,249,242,233,236,236, - 233, 99,128, 4, 8,232,229,232,225,242,237,229,238,233,225,110, - 128, 5, 75,237,239,238,239,243,240,225,227,101,128,255, 42,243, - 237,225,236,108,128,247,106, 75,140, 0, 75, 15,115, 15,125, 15, - 135, 16, 18, 16, 65, 16, 76, 16,106, 16,143, 16,156, 16,168, 16, - 180, 16,208,194,243,241,245,225,242,101,128, 51,133,203,243,241, - 245,225,242,101,128, 51,205, 97, 7, 15,151, 15,169, 15,191, 15, - 211, 15,226, 15,232, 15,249,226,225,243,232,235,233,242,227,249, - 242,233,236,236,233, 99,128, 4,160, 99, 2, 15,175, 15,181,245, - 244,101,128, 30, 48,249,242,233,236,236,233, 99,128, 4, 26,228, - 229,243,227,229,238,228,229,242,227,249,242,233,236,236,233, 99, - 128, 4,154,232,239,239,235,227,249,242,233,236,236,233, 99,128, - 4,195,240,240, 97,128, 3,154,243,244,242,239,235,229,227,249, - 242,233,236,236,233, 99,128, 4,158,246,229,242,244,233,227,225, - 236,243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128, - 4,156, 99, 4, 16, 28, 16, 35, 16, 44, 16, 52,225,242,239,110, - 128, 1,232,229,228,233,236,236, 97,128, 1, 54,233,242,227,236, - 101,128, 36,192,239,237,237,225,225,227,227,229,238,116,128, 1, - 54,228,239,244,226,229,236,239,119,128, 30, 50,101, 2, 16, 82, - 16, 94,232,225,242,237,229,238,233,225,110,128, 5, 84,238,225, - 242,237,229,238,233,225,110,128, 5, 63,104, 3, 16,114, 16,126, - 16,137,225,227,249,242,233,236,236,233, 99,128, 4, 37,229,233, - 227,239,240,244,233, 99,128, 3,230,239,239,107,128, 1,152,234, - 229,227,249,242,233,236,236,233, 99,128, 4, 12,236,233,238,229, - 226,229,236,239,119,128, 30, 52,237,239,238,239,243,240,225,227, - 101,128,255, 43,239,240,240, 97, 2, 16,189, 16,200,227,249,242, - 233,236,236,233, 99,128, 4,128,231,242,229,229,107,128, 3,222, - 115, 2, 16,214, 16,226,233,227,249,242,233,236,236,233, 99,128, - 4,110,237,225,236,108,128,247,107, 76,138, 0, 76, 17, 1, 17, - 5, 17, 9, 17, 29, 17, 95, 17,133, 17,147, 17,165, 17,177, 17, - 189, 74,128, 1,199, 76,128,246,191, 97, 2, 17, 15, 17, 22,227, - 245,244,101,128, 1, 57,237,226,228, 97,128, 3,155, 99, 4, 17, - 39, 17, 46, 17, 55, 17, 82,225,242,239,110,128, 1, 61,229,228, - 233,236,236, 97,128, 1, 59,233,242, 99, 2, 17, 63, 17, 68,236, - 101,128, 36,193,245,237,230,236,229,248,226,229,236,239,119,128, - 30, 60,239,237,237,225,225,227,227,229,238,116,128, 1, 59,228, - 239,116,130, 1, 63, 17,105, 17,114,225,227,227,229,238,116,128, - 1, 63,226,229,236,239,119,129, 30, 54, 17,124,237,225,227,242, - 239,110,128, 30, 56,233,247,238,225,242,237,229,238,233,225,110, - 128, 5, 60,106,129, 1,200, 17,153,229,227,249,242,233,236,236, - 233, 99,128, 4, 9,236,233,238,229,226,229,236,239,119,128, 30, - 58,237,239,238,239,243,240,225,227,101,128,255, 44,115, 2, 17, - 195, 17,212,236,225,243,104,129, 1, 65, 17,204,243,237,225,236, - 108,128,246,249,237,225,236,108,128,247,108, 77,137, 0, 77, 17, - 241, 17,251, 18, 24, 18, 33, 18, 58, 18, 71, 18, 83, 18, 91, 18, - 100,194,243,241,245,225,242,101,128, 51,134,225, 99, 2, 18, 2, - 18, 18,242,239,110,129,246,208, 18, 10,243,237,225,236,108,128, - 247,175,245,244,101,128, 30, 62,227,233,242,227,236,101,128, 36, - 194,228,239,116, 2, 18, 41, 18, 50,225,227,227,229,238,116,128, - 30, 64,226,229,236,239,119,128, 30, 66,229,238,225,242,237,229, - 238,233,225,110,128, 5, 68,237,239,238,239,243,240,225,227,101, - 128,255, 45,243,237,225,236,108,128,247,109,244,245,242,238,229, - 100,128, 1,156,117,128, 3,156, 78,141, 0, 78, 18,134, 18,138, - 18,146, 18,212, 18,237, 18,248, 19, 3, 19, 21, 19, 33, 19, 45, - 19, 58, 19, 66, 19, 84, 74,128, 1,202,225,227,245,244,101,128, - 1, 67, 99, 4, 18,156, 18,163, 18,172, 18,199,225,242,239,110, - 128, 1, 71,229,228,233,236,236, 97,128, 1, 69,233,242, 99, 2, - 18,180, 18,185,236,101,128, 36,195,245,237,230,236,229,248,226, - 229,236,239,119,128, 30, 74,239,237,237,225,225,227,227,229,238, - 116,128, 1, 69,228,239,116, 2, 18,220, 18,229,225,227,227,229, - 238,116,128, 30, 68,226,229,236,239,119,128, 30, 70,232,239,239, - 235,236,229,230,116,128, 1,157,233,238,229,242,239,237,225,110, - 128, 33,104,106,129, 1,203, 19, 9,229,227,249,242,233,236,236, - 233, 99,128, 4, 10,236,233,238,229,226,229,236,239,119,128, 30, - 72,237,239,238,239,243,240,225,227,101,128,255, 46,239,247,225, - 242,237,229,238,233,225,110,128, 5, 70,243,237,225,236,108,128, - 247,110,244,233,236,228,101,129, 0,209, 19, 76,243,237,225,236, - 108,128,247,241,117,128, 3,157, 79,141, 0, 79, 19,118, 19,132, - 19,150, 19,203, 20, 78, 20,152, 20,187, 21, 48, 21, 69, 21,213, - 21,223, 21,254, 22, 53, 69,129, 1, 82, 19,124,243,237,225,236, - 108,128,246,250,225,227,245,244,101,129, 0,211, 19,142,243,237, - 225,236,108,128,247,243, 98, 2, 19,156, 19,196,225,242,242,229, - 100, 2, 19,166, 19,177,227,249,242,233,236,236,233, 99,128, 4, - 232,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, - 99,128, 4,234,242,229,246,101,128, 1, 78, 99, 4, 19,213, 19, - 220, 19,235, 20, 68,225,242,239,110,128, 1,209,229,238,244,229, - 242,229,228,244,233,236,228,101,128, 1,159,233,242, 99, 2, 19, - 243, 19,248,236,101,128, 36,196,245,237,230,236,229,120,134, 0, - 212, 20, 13, 20, 21, 20, 32, 20, 40, 20, 52, 20, 60,225,227,245, - 244,101,128, 30,208,228,239,244,226,229,236,239,119,128, 30,216, - 231,242,225,246,101,128, 30,210,232,239,239,235,225,226,239,246, - 101,128, 30,212,243,237,225,236,108,128,247,244,244,233,236,228, - 101,128, 30,214,249,242,233,236,236,233, 99,128, 4, 30,100, 3, - 20, 86, 20,109, 20,142,226,108, 2, 20, 93, 20,101,225,227,245, - 244,101,128, 1, 80,231,242,225,246,101,128, 2, 12,233,229,242, - 229,243,233,115,130, 0,214, 20,123, 20,134,227,249,242,233,236, - 236,233, 99,128, 4,230,243,237,225,236,108,128,247,246,239,244, - 226,229,236,239,119,128, 30,204,103, 2, 20,158, 20,170,239,238, - 229,235,243,237,225,236,108,128,246,251,242,225,246,101,129, 0, - 210, 20,179,243,237,225,236,108,128,247,242,104, 4, 20,197, 20, - 208, 20,212, 21, 34,225,242,237,229,238,233,225,110,128, 5, 85, - 109,128, 33, 38,111, 2, 20,218, 20,228,239,235,225,226,239,246, - 101,128, 30,206,242,110,133, 1,160, 20,243, 20,251, 21, 6, 21, - 14, 21, 26,225,227,245,244,101,128, 30,218,228,239,244,226,229, - 236,239,119,128, 30,226,231,242,225,246,101,128, 30,220,232,239, - 239,235,225,226,239,246,101,128, 30,222,244,233,236,228,101,128, - 30,224,245,238,231,225,242,245,237,236,225,245,116,128, 1, 80, - 105,129, 1,162, 21, 54,238,246,229,242,244,229,228,226,242,229, - 246,101,128, 2, 14,109, 4, 21, 79, 21,107, 21,184, 21,202,225, - 227,242,239,110,130, 1, 76, 21, 91, 21, 99,225,227,245,244,101, - 128, 30, 82,231,242,225,246,101,128, 30, 80,229,231, 97,132, 33, - 38, 21,121, 21,132, 21,140, 21,156,227,249,242,233,236,236,233, - 99,128, 4, 96,231,242,229,229,107,128, 3,169,242,239,245,238, - 228,227,249,242,233,236,236,233, 99,128, 4,122,116, 2, 21,162, - 21,177,233,244,236,239,227,249,242,233,236,236,233, 99,128, 4, - 124,239,238,239,115,128, 3,143,233,227,242,239,110,129, 3,159, - 21,194,244,239,238,239,115,128, 3,140,239,238,239,243,240,225, - 227,101,128,255, 47,238,229,242,239,237,225,110,128, 33, 96,111, - 2, 21,229, 21,248,231,239,238,229,107,129, 1,234, 21,239,237, - 225,227,242,239,110,128, 1,236,240,229,110,128, 1,134,115, 3, - 22, 6, 22, 33, 22, 40,236,225,243,104,130, 0,216, 22, 17, 22, - 25,225,227,245,244,101,128, 1,254,243,237,225,236,108,128,247, - 248,237,225,236,108,128,247,111,244,242,239,235,229,225,227,245, - 244,101,128, 1,254,116, 2, 22, 59, 22, 70,227,249,242,233,236, - 236,233, 99,128, 4,126,233,236,228,101,131, 0,213, 22, 83, 22, - 91, 22,102,225,227,245,244,101,128, 30, 76,228,233,229,242,229, - 243,233,115,128, 30, 78,243,237,225,236,108,128,247,245, 80,136, - 0, 80, 22,130, 22,138, 22,147, 22,159, 22,211, 22,227, 22,246, - 23, 2,225,227,245,244,101,128, 30, 84,227,233,242,227,236,101, - 128, 36,197,228,239,244,225,227,227,229,238,116,128, 30, 86,101, - 3, 22,167, 22,178, 22,190,227,249,242,233,236,236,233, 99,128, - 4, 31,232,225,242,237,229,238,233,225,110,128, 5, 74,237,233, - 228,228,236,229,232,239,239,235,227,249,242,233,236,236,233, 99, - 128, 4,166,104, 2, 22,217, 22,221,105,128, 3,166,239,239,107, - 128, 1,164,105,129, 3,160, 22,233,247,242,225,242,237,229,238, - 233,225,110,128, 5, 83,237,239,238,239,243,240,225,227,101,128, - 255, 48,115, 2, 23, 8, 23, 25,105,129, 3,168, 23, 14,227,249, - 242,233,236,236,233, 99,128, 4,112,237,225,236,108,128,247,112, - 81,131, 0, 81, 23, 42, 23, 51, 23, 63,227,233,242,227,236,101, - 128, 36,198,237,239,238,239,243,240,225,227,101,128,255, 49,243, - 237,225,236,108,128,247,113, 82,138, 0, 82, 23, 95, 23,119, 23, - 166, 23,217, 23,230, 23,240, 23,245, 24, 19, 24, 31, 24, 43, 97, - 2, 23,101, 23,112,225,242,237,229,238,233,225,110,128, 5, 76, - 227,245,244,101,128, 1, 84, 99, 4, 23,129, 23,136, 23,145, 23, - 153,225,242,239,110,128, 1, 88,229,228,233,236,236, 97,128, 1, - 86,233,242,227,236,101,128, 36,199,239,237,237,225,225,227,227, - 229,238,116,128, 1, 86,100, 2, 23,172, 23,182,226,236,231,242, - 225,246,101,128, 2, 16,239,116, 2, 23,189, 23,198,225,227,227, - 229,238,116,128, 30, 88,226,229,236,239,119,129, 30, 90, 23,208, - 237,225,227,242,239,110,128, 30, 92,229,232,225,242,237,229,238, - 233,225,110,128, 5, 80,230,242,225,235,244,245,114,128, 33, 28, - 232,111,128, 3,161,233,110, 2, 23,252, 24, 5,231,243,237,225, - 236,108,128,246,252,246,229,242,244,229,228,226,242,229,246,101, - 128, 2, 18,236,233,238,229,226,229,236,239,119,128, 30, 94,237, - 239,238,239,243,240,225,227,101,128,255, 50,243,237,225,236,108, - 129,247,114, 24, 53,233,238,246,229,242,244,229,100,129, 2,129, - 24, 66,243,245,240,229,242,233,239,114,128, 2,182, 83,139, 0, - 83, 24,103, 26, 17, 26, 55, 26,182, 26,221, 26,250, 27, 84, 27, - 105, 27,117, 27,135, 27,143, 70, 6, 24,117, 24,209, 24,241, 25, - 77, 25,119, 25,221, 48, 9, 24,137, 24,145, 24,153, 24,161, 24, - 169, 24,177, 24,185, 24,193, 24,201,177,176,176,176, 48,128, 37, - 12,178,176,176,176, 48,128, 37, 20,179,176,176,176, 48,128, 37, - 16,180,176,176,176, 48,128, 37, 24,181,176,176,176, 48,128, 37, - 60,182,176,176,176, 48,128, 37, 44,183,176,176,176, 48,128, 37, - 52,184,176,176,176, 48,128, 37, 28,185,176,176,176, 48,128, 37, - 36, 49, 3, 24,217, 24,225, 24,233,176,176,176,176, 48,128, 37, - 0,177,176,176,176, 48,128, 37, 2,185,176,176,176, 48,128, 37, - 97, 50, 9, 25, 5, 25, 13, 25, 21, 25, 29, 25, 37, 25, 45, 25, - 53, 25, 61, 25, 69,176,176,176,176, 48,128, 37, 98,177,176,176, - 176, 48,128, 37, 86,178,176,176,176, 48,128, 37, 85,179,176,176, - 176, 48,128, 37, 99,180,176,176,176, 48,128, 37, 81,181,176,176, - 176, 48,128, 37, 87,182,176,176,176, 48,128, 37, 93,183,176,176, - 176, 48,128, 37, 92,184,176,176,176, 48,128, 37, 91, 51, 4, 25, - 87, 25, 95, 25,103, 25,111,182,176,176,176, 48,128, 37, 94,183, - 176,176,176, 48,128, 37, 95,184,176,176,176, 48,128, 37, 90,185, - 176,176,176, 48,128, 37, 84, 52, 10, 25,141, 25,149, 25,157, 25, - 165, 25,173, 25,181, 25,189, 25,197, 25,205, 25,213,176,176,176, - 176, 48,128, 37,105,177,176,176,176, 48,128, 37,102,178,176,176, - 176, 48,128, 37, 96,179,176,176,176, 48,128, 37, 80,180,176,176, - 176, 48,128, 37,108,181,176,176,176, 48,128, 37,103,182,176,176, - 176, 48,128, 37,104,183,176,176,176, 48,128, 37,100,184,176,176, - 176, 48,128, 37,101,185,176,176,176, 48,128, 37, 89, 53, 5, 25, - 233, 25,241, 25,249, 26, 1, 26, 9,176,176,176,176, 48,128, 37, - 88,177,176,176,176, 48,128, 37, 82,178,176,176,176, 48,128, 37, - 83,179,176,176,176, 48,128, 37,107,180,176,176,176, 48,128, 37, - 106, 97, 2, 26, 23, 26, 44,227,245,244,101,129, 1, 90, 26, 32, - 228,239,244,225,227,227,229,238,116,128, 30,100,237,240,233,231, - 242,229,229,107,128, 3,224, 99, 5, 26, 67, 26, 98, 26,107, 26, - 147, 26,169,225,242,239,110,130, 1, 96, 26, 78, 26, 90,228,239, - 244,225,227,227,229,238,116,128, 30,102,243,237,225,236,108,128, - 246,253,229,228,233,236,236, 97,128, 1, 94,232,247, 97,130, 1, - 143, 26,117, 26,128,227,249,242,233,236,236,233, 99,128, 4,216, - 228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99, - 128, 4,218,233,242, 99, 2, 26,155, 26,160,236,101,128, 36,200, - 245,237,230,236,229,120,128, 1, 92,239,237,237,225,225,227,227, - 229,238,116,128, 2, 24,228,239,116, 2, 26,190, 26,199,225,227, - 227,229,238,116,128, 30, 96,226,229,236,239,119,129, 30, 98, 26, - 209,228,239,244,225,227,227,229,238,116,128, 30,104,101, 2, 26, - 227, 26,239,232,225,242,237,229,238,233,225,110,128, 5, 77,246, - 229,238,242,239,237,225,110,128, 33,102,104, 5, 27, 6, 27, 34, - 27, 48, 27, 59, 27, 72, 97, 2, 27, 12, 27, 23,225,242,237,229, - 238,233,225,110,128, 5, 71,227,249,242,233,236,236,233, 99,128, - 4, 40,227,232,225,227,249,242,233,236,236,233, 99,128, 4, 41, - 229,233,227,239,240,244,233, 99,128, 3,226,232,225,227,249,242, - 233,236,236,233, 99,128, 4,186,233,237,225,227,239,240,244,233, - 99,128, 3,236,105, 2, 27, 90, 27, 96,231,237, 97,128, 3,163, - 248,242,239,237,225,110,128, 33,101,237,239,238,239,243,240,225, - 227,101,128,255, 51,239,230,244,243,233,231,238,227,249,242,233, - 236,236,233, 99,128, 4, 44,243,237,225,236,108,128,247,115,244, - 233,231,237,225,231,242,229,229,107,128, 3,218, 84,141, 0, 84, - 27,186, 27,191, 27,197, 28, 7, 28, 32, 28, 96, 28,147, 28,177, - 28,189, 28,201, 28,246, 29, 6, 29, 46,225,117,128, 3,164,226, - 225,114,128, 1,102, 99, 4, 27,207, 27,214, 27,223, 27,250,225, - 242,239,110,128, 1,100,229,228,233,236,236, 97,128, 1, 98,233, - 242, 99, 2, 27,231, 27,236,236,101,128, 36,201,245,237,230,236, - 229,248,226,229,236,239,119,128, 30,112,239,237,237,225,225,227, - 227,229,238,116,128, 1, 98,228,239,116, 2, 28, 15, 28, 24,225, - 227,227,229,238,116,128, 30,106,226,229,236,239,119,128, 30,108, - 101, 4, 28, 42, 28, 53, 28, 73, 28, 82,227,249,242,233,236,236, - 233, 99,128, 4, 34,228,229,243,227,229,238,228,229,242,227,249, - 242,233,236,236,233, 99,128, 4,172,238,242,239,237,225,110,128, - 33,105,244,243,229,227,249,242,233,236,236,233, 99,128, 4,180, - 104, 3, 28,104, 28,110, 28,136,229,244, 97,128, 3,152,111, 2, - 28,116, 28,121,239,107,128, 1,172,242,110,129, 0,222, 28,128, - 243,237,225,236,108,128,247,254,242,229,229,242,239,237,225,110, - 128, 33, 98,105, 2, 28,153, 28,164,236,228,229,243,237,225,236, - 108,128,246,254,247,238,225,242,237,229,238,233,225,110,128, 5, - 79,236,233,238,229,226,229,236,239,119,128, 30,110,237,239,238, - 239,243,240,225,227,101,128,255, 52,111, 2, 28,207, 28,218,225, - 242,237,229,238,233,225,110,128, 5, 57,238,101, 3, 28,227, 28, - 234, 28,240,230,233,246,101,128, 1,188,243,233,120,128, 1,132, - 244,247,111,128, 1,167,242,229,244,242,239,230,236,229,248,232, - 239,239,107,128, 1,174,115, 3, 29, 14, 29, 26, 29, 39,229,227, - 249,242,233,236,236,233, 99,128, 4, 38,232,229,227,249,242,233, - 236,236,233, 99,128, 4, 11,237,225,236,108,128,247,116,119, 2, - 29, 52, 29, 64,229,236,246,229,242,239,237,225,110,128, 33,107, - 239,242,239,237,225,110,128, 33, 97, 85,142, 0, 85, 29,105, 29, - 123, 29,131, 29,198, 30, 69, 30, 87, 30,198, 30,214, 30,226, 31, - 21, 31, 30, 31,142, 31,149, 31,219,225,227,245,244,101,129, 0, - 218, 29,115,243,237,225,236,108,128,247,250,226,242,229,246,101, - 128, 1,108, 99, 3, 29,139, 29,146, 29,188,225,242,239,110,128, - 1,211,233,242, 99, 2, 29,154, 29,159,236,101,128, 36,202,245, - 237,230,236,229,120,130, 0,219, 29,172, 29,180,226,229,236,239, - 119,128, 30,118,243,237,225,236,108,128,247,251,249,242,233,236, - 236,233, 99,128, 4, 35,100, 3, 29,206, 29,229, 30, 59,226,108, - 2, 29,213, 29,221,225,227,245,244,101,128, 1,112,231,242,225, - 246,101,128, 2, 20,233,229,242,229,243,233,115,134, 0,220, 29, - 251, 30, 3, 30, 11, 30, 34, 30, 42, 30, 51,225,227,245,244,101, - 128, 1,215,226,229,236,239,119,128, 30,114, 99, 2, 30, 17, 30, - 24,225,242,239,110,128, 1,217,249,242,233,236,236,233, 99,128, - 4,240,231,242,225,246,101,128, 1,219,237,225,227,242,239,110, - 128, 1,213,243,237,225,236,108,128,247,252,239,244,226,229,236, - 239,119,128, 30,228,231,242,225,246,101,129, 0,217, 30, 79,243, - 237,225,236,108,128,247,249,104, 2, 30, 93, 30,171,111, 2, 30, - 99, 30,109,239,235,225,226,239,246,101,128, 30,230,242,110,133, - 1,175, 30,124, 30,132, 30,143, 30,151, 30,163,225,227,245,244, - 101,128, 30,232,228,239,244,226,229,236,239,119,128, 30,240,231, - 242,225,246,101,128, 30,234,232,239,239,235,225,226,239,246,101, - 128, 30,236,244,233,236,228,101,128, 30,238,245,238,231,225,242, - 245,237,236,225,245,116,129, 1,112, 30,187,227,249,242,233,236, - 236,233, 99,128, 4,242,233,238,246,229,242,244,229,228,226,242, - 229,246,101,128, 2, 22,235,227,249,242,233,236,236,233, 99,128, - 4,120,109, 2, 30,232, 31, 10,225,227,242,239,110,130, 1,106, - 30,244, 30,255,227,249,242,233,236,236,233, 99,128, 4,238,228, - 233,229,242,229,243,233,115,128, 30,122,239,238,239,243,240,225, - 227,101,128,255, 53,239,231,239,238,229,107,128, 1,114,240,243, - 233,236,239,110,133, 3,165, 31, 49, 31, 53, 31, 90, 31,121, 31, - 134, 49,128, 3,210, 97, 2, 31, 59, 31, 81,227,245,244,229,232, - 239,239,235,243,249,237,226,239,236,231,242,229,229,107,128, 3, - 211,230,242,233,227,225,110,128, 1,177,228,233,229,242,229,243, - 233,115,129, 3,171, 31,103,232,239,239,235,243,249,237,226,239, - 236,231,242,229,229,107,128, 3,212,232,239,239,235,243,249,237, - 226,239,108,128, 3,210,244,239,238,239,115,128, 3,142,242,233, - 238,103,128, 1,110,115, 3, 31,157, 31,172, 31,179,232,239,242, - 244,227,249,242,233,236,236,233, 99,128, 4, 14,237,225,236,108, - 128,247,117,244,242,225,233,231,232,116, 2, 31,191, 31,202,227, - 249,242,233,236,236,233, 99,128, 4,174,243,244,242,239,235,229, - 227,249,242,233,236,236,233, 99,128, 4,176,244,233,236,228,101, - 130, 1,104, 31,231, 31,239,225,227,245,244,101,128, 30,120,226, - 229,236,239,119,128, 30,116, 86,136, 0, 86, 32, 11, 32, 20, 32, - 31, 32, 60, 32, 67, 32, 79, 32, 91, 32, 99,227,233,242,227,236, - 101,128, 36,203,228,239,244,226,229,236,239,119,128, 30,126,101, - 2, 32, 37, 32, 48,227,249,242,233,236,236,233, 99,128, 4, 18, - 247,225,242,237,229,238,233,225,110,128, 5, 78,232,239,239,107, - 128, 1,178,237,239,238,239,243,240,225,227,101,128,255, 54,239, - 225,242,237,229,238,233,225,110,128, 5, 72,243,237,225,236,108, - 128,247,118,244,233,236,228,101,128, 30,124, 87,134, 0, 87, 32, - 123, 32,131, 32,154, 32,194, 32,202, 32,214,225,227,245,244,101, - 128, 30,130,227,233,242, 99, 2, 32,140, 32,145,236,101,128, 36, - 204,245,237,230,236,229,120,128, 1,116,100, 2, 32,160, 32,170, - 233,229,242,229,243,233,115,128, 30,132,239,116, 2, 32,177, 32, - 186,225,227,227,229,238,116,128, 30,134,226,229,236,239,119,128, - 30,136,231,242,225,246,101,128, 30,128,237,239,238,239,243,240, - 225,227,101,128,255, 55,243,237,225,236,108,128,247,119, 88,134, - 0, 88, 32,238, 32,247, 33, 18, 33, 31, 33, 35, 33, 47,227,233, - 242,227,236,101,128, 36,205,100, 2, 32,253, 33, 7,233,229,242, - 229,243,233,115,128, 30,140,239,244,225,227,227,229,238,116,128, - 30,138,229,232,225,242,237,229,238,233,225,110,128, 5, 61,105, - 128, 3,158,237,239,238,239,243,240,225,227,101,128,255, 56,243, - 237,225,236,108,128,247,120, 89,139, 0, 89, 33, 81, 33,116, 33, - 139, 33,189, 33,228, 33,236, 33,253, 34, 40, 34, 52, 34, 60, 34, - 68, 97, 2, 33, 87, 33,104,227,245,244,101,129, 0,221, 33, 96, - 243,237,225,236,108,128,247,253,244,227,249,242,233,236,236,233, - 99,128, 4, 98,227,233,242, 99, 2, 33,125, 33,130,236,101,128, - 36,206,245,237,230,236,229,120,128, 1,118,100, 2, 33,145, 33, - 165,233,229,242,229,243,233,115,129, 1,120, 33,157,243,237,225, - 236,108,128,247,255,239,116, 2, 33,172, 33,181,225,227,227,229, - 238,116,128, 30,142,226,229,236,239,119,128, 30,244,229,114, 2, - 33,196, 33,208,233,227,249,242,233,236,236,233, 99,128, 4, 43, - 245,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, - 99,128, 4,248,231,242,225,246,101,128, 30,242,232,239,239,107, - 129, 1,179, 33,245,225,226,239,246,101,128, 30,246,105, 3, 34, - 5, 34, 16, 34, 27,225,242,237,229,238,233,225,110,128, 5, 69, - 227,249,242,233,236,236,233, 99,128, 4, 7,247,238,225,242,237, - 229,238,233,225,110,128, 5, 82,237,239,238,239,243,240,225,227, - 101,128,255, 57,243,237,225,236,108,128,247,121,244,233,236,228, - 101,128, 30,248,245,115, 2, 34, 75, 34,113,226,233,103, 2, 34, - 83, 34, 94,227,249,242,233,236,236,233, 99,128, 4,106,233,239, - 244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128, 4, - 108,236,233,244,244,236,101, 2, 34,124, 34,135,227,249,242,233, - 236,236,233, 99,128, 4,102,233,239,244,233,230,233,229,228,227, - 249,242,233,236,236,233, 99,128, 4,104, 90,136, 0, 90, 34,174, - 34,198, 34,243, 35, 14, 35, 81, 35,173, 35,185, 35,197, 97, 2, - 34,180, 34,191,225,242,237,229,238,233,225,110,128, 5, 54,227, - 245,244,101,128, 1,121, 99, 2, 34,204, 34,221,225,242,239,110, - 129, 1,125, 34,213,243,237,225,236,108,128,246,255,233,242, 99, - 2, 34,229, 34,234,236,101,128, 36,207,245,237,230,236,229,120, - 128, 30,144,228,239,116,130, 1,123, 34,253, 35, 6,225,227,227, - 229,238,116,128, 1,123,226,229,236,239,119,128, 30,146,101, 3, - 35, 22, 35, 33, 35, 76,227,249,242,233,236,236,233, 99,128, 4, - 23,100, 2, 35, 39, 35, 58,229,243,227,229,238,228,229,242,227, - 249,242,233,236,236,233, 99,128, 4,152,233,229,242,229,243,233, - 243,227,249,242,233,236,236,233, 99,128, 4,222,244, 97,128, 3, - 150,232,101, 4, 35, 92, 35,103, 35,119, 35,130,225,242,237,229, - 238,233,225,110,128, 5, 58,226,242,229,246,229,227,249,242,233, - 236,236,233, 99,128, 4,193,227,249,242,233,236,236,233, 99,128, - 4, 22,100, 2, 35,136, 35,155,229,243,227,229,238,228,229,242, - 227,249,242,233,236,236,233, 99,128, 4,150,233,229,242,229,243, - 233,243,227,249,242,233,236,236,233, 99,128, 4,220,236,233,238, - 229,226,229,236,239,119,128, 30,148,237,239,238,239,243,240,225, - 227,101,128,255, 58,115, 2, 35,203, 35,210,237,225,236,108,128, - 247,122,244,242,239,235,101,128, 1,181, 97,149, 0, 97, 36, 8, - 36,144, 37, 35, 37,211, 38, 55, 38, 91, 45, 10, 45, 47, 45, 74, - 46, 43, 46, 81, 47,170, 47,242, 48,197, 48,206, 49, 79, 51, 87, - 52, 77, 52,124, 53, 19, 53, 33, 97, 7, 36, 24, 36, 34, 36, 41, - 36, 48, 36, 73, 36, 89, 36,100,226,229,238,231,225,236,105,128, - 9,134,227,245,244,101,128, 0,225,228,229,246, 97,128, 9, 6, - 231,117, 2, 36, 55, 36, 64,234,225,242,225,244,105,128, 10,134, - 242,237,245,235,232,105,128, 10, 6,237,225,244,242,225,231,245, - 242,237,245,235,232,105,128, 10, 62,242,245,243,241,245,225,242, - 101,128, 51, 3,246,239,247,229,236,243,233,231,110, 3, 36,116, - 36,126, 36,133,226,229,238,231,225,236,105,128, 9,190,228,229, - 246, 97,128, 9, 62,231,245,234,225,242,225,244,105,128, 10,190, - 98, 4, 36,154, 36,195, 36,204, 36,214,226,242,229,246,233,225, - 244,233,239,110, 2, 36,169, 36,184,237,225,242,235,225,242,237, - 229,238,233,225,110,128, 5, 95,243,233,231,238,228,229,246, 97, - 128, 9,112,229,238,231,225,236,105,128, 9,133,239,240,239,237, - 239,230,111,128, 49, 26,242,229,246,101,134, 1, 3, 36,233, 36, - 241, 36,252, 37, 7, 37, 15, 37, 27,225,227,245,244,101,128, 30, - 175,227,249,242,233,236,236,233, 99,128, 4,209,228,239,244,226, - 229,236,239,119,128, 30,183,231,242,225,246,101,128, 30,177,232, - 239,239,235,225,226,239,246,101,128, 30,179,244,233,236,228,101, - 128, 30,181, 99, 4, 37, 45, 37, 52, 37,131, 37,201,225,242,239, - 110,128, 1,206,233,242, 99, 2, 37, 60, 37, 65,236,101,128, 36, - 208,245,237,230,236,229,120,133, 0,226, 37, 84, 37, 92, 37,103, - 37,111, 37,123,225,227,245,244,101,128, 30,165,228,239,244,226, - 229,236,239,119,128, 30,173,231,242,225,246,101,128, 30,167,232, - 239,239,235,225,226,239,246,101,128, 30,169,244,233,236,228,101, - 128, 30,171,245,244,101,133, 0,180, 37,147, 37,158, 37,175, 37, - 182, 37,191,226,229,236,239,247,227,237, 98,128, 3, 23, 99, 2, - 37,164, 37,169,237, 98,128, 3, 1,239,237, 98,128, 3, 1,228, - 229,246, 97,128, 9, 84,236,239,247,237,239,100,128, 2,207,244, - 239,238,229,227,237, 98,128, 3, 65,249,242,233,236,236,233, 99, - 128, 4, 48,100, 5, 37,223, 37,233, 37,247, 37,253, 38, 31,226, - 236,231,242,225,246,101,128, 2, 1,228,225,235,231,245,242,237, - 245,235,232,105,128, 10,113,229,246, 97,128, 9, 5,233,229,242, - 229,243,233,115,130, 0,228, 38, 11, 38, 22,227,249,242,233,236, - 236,233, 99,128, 4,211,237,225,227,242,239,110,128, 1,223,239, - 116, 2, 38, 38, 38, 46,226,229,236,239,119,128, 30,161,237,225, - 227,242,239,110,128, 1,225,101,131, 0,230, 38, 65, 38, 73, 38, - 82,225,227,245,244,101,128, 1,253,235,239,242,229,225,110,128, - 49, 80,237,225,227,242,239,110,128, 1,227,230,233,105, 6, 38, - 107, 38,127, 41, 64, 41, 70, 41, 85, 44,185, 48, 2, 38,113, 38, - 120,176,178,176, 56,128, 32, 21,184,185,180, 49,128, 32,164,177, - 48, 3, 38,136, 40,160, 41, 39, 48, 9, 38,156, 38,176, 38,238, - 39, 44, 39,106, 39,168, 39,230, 40, 36, 40, 98, 49, 3, 38,164, - 38,168, 38,172, 55,128, 4, 16, 56,128, 4, 17, 57,128, 4, 18, - 50, 10, 38,198, 38,202, 38,206, 38,210, 38,214, 38,218, 38,222, - 38,226, 38,230, 38,234, 48,128, 4, 19, 49,128, 4, 20, 50,128, - 4, 21, 51,128, 4, 1, 52,128, 4, 22, 53,128, 4, 23, 54,128, - 4, 24, 55,128, 4, 25, 56,128, 4, 26, 57,128, 4, 27, 51, 10, - 39, 4, 39, 8, 39, 12, 39, 16, 39, 20, 39, 24, 39, 28, 39, 32, - 39, 36, 39, 40, 48,128, 4, 28, 49,128, 4, 29, 50,128, 4, 30, - 51,128, 4, 31, 52,128, 4, 32, 53,128, 4, 33, 54,128, 4, 34, - 55,128, 4, 35, 56,128, 4, 36, 57,128, 4, 37, 52, 10, 39, 66, - 39, 70, 39, 74, 39, 78, 39, 82, 39, 86, 39, 90, 39, 94, 39, 98, - 39,102, 48,128, 4, 38, 49,128, 4, 39, 50,128, 4, 40, 51,128, - 4, 41, 52,128, 4, 42, 53,128, 4, 43, 54,128, 4, 44, 55,128, - 4, 45, 56,128, 4, 46, 57,128, 4, 47, 53, 10, 39,128, 39,132, - 39,136, 39,140, 39,144, 39,148, 39,152, 39,156, 39,160, 39,164, - 48,128, 4,144, 49,128, 4, 2, 50,128, 4, 3, 51,128, 4, 4, - 52,128, 4, 5, 53,128, 4, 6, 54,128, 4, 7, 55,128, 4, 8, - 56,128, 4, 9, 57,128, 4, 10, 54, 10, 39,190, 39,194, 39,198, - 39,202, 39,206, 39,210, 39,214, 39,218, 39,222, 39,226, 48,128, - 4, 11, 49,128, 4, 12, 50,128, 4, 14, 51,128,246,196, 52,128, - 246,197, 53,128, 4, 48, 54,128, 4, 49, 55,128, 4, 50, 56,128, - 4, 51, 57,128, 4, 52, 55, 10, 39,252, 40, 0, 40, 4, 40, 8, - 40, 12, 40, 16, 40, 20, 40, 24, 40, 28, 40, 32, 48,128, 4, 53, - 49,128, 4, 81, 50,128, 4, 54, 51,128, 4, 55, 52,128, 4, 56, - 53,128, 4, 57, 54,128, 4, 58, 55,128, 4, 59, 56,128, 4, 60, - 57,128, 4, 61, 56, 10, 40, 58, 40, 62, 40, 66, 40, 70, 40, 74, - 40, 78, 40, 82, 40, 86, 40, 90, 40, 94, 48,128, 4, 62, 49,128, - 4, 63, 50,128, 4, 64, 51,128, 4, 65, 52,128, 4, 66, 53,128, - 4, 67, 54,128, 4, 68, 55,128, 4, 69, 56,128, 4, 70, 57,128, - 4, 71, 57, 10, 40,120, 40,124, 40,128, 40,132, 40,136, 40,140, - 40,144, 40,148, 40,152, 40,156, 48,128, 4, 72, 49,128, 4, 73, - 50,128, 4, 74, 51,128, 4, 75, 52,128, 4, 76, 53,128, 4, 77, - 54,128, 4, 78, 55,128, 4, 79, 56,128, 4,145, 57,128, 4, 82, - 49, 4, 40,170, 40,232, 40,237, 41, 7, 48, 10, 40,192, 40,196, - 40,200, 40,204, 40,208, 40,212, 40,216, 40,220, 40,224, 40,228, - 48,128, 4, 83, 49,128, 4, 84, 50,128, 4, 85, 51,128, 4, 86, - 52,128, 4, 87, 53,128, 4, 88, 54,128, 4, 89, 55,128, 4, 90, - 56,128, 4, 91, 57,128, 4, 92,177, 48,128, 4, 94, 52, 4, 40, - 247, 40,251, 40,255, 41, 3, 53,128, 4, 15, 54,128, 4, 98, 55, - 128, 4,114, 56,128, 4,116, 57, 5, 41, 19, 41, 23, 41, 27, 41, - 31, 41, 35, 50,128,246,198, 51,128, 4, 95, 52,128, 4, 99, 53, - 128, 4,115, 54,128, 4,117, 56, 2, 41, 45, 41, 59, 51, 2, 41, - 51, 41, 55, 49,128,246,199, 50,128,246,200,180, 54,128, 4,217, - 178,185, 57,128, 32, 14,179, 48, 2, 41, 77, 41, 81, 48,128, 32, - 15, 49,128, 32, 13,181, 55, 7, 41,102, 41,172, 42,237, 43, 58, - 44, 15, 44,108, 44,179, 51, 2, 41,108, 41,122, 56, 2, 41,114, - 41,118, 49,128, 6,106, 56,128, 6, 12, 57, 8, 41,140, 41,144, - 41,148, 41,152, 41,156, 41,160, 41,164, 41,168, 50,128, 6, 96, - 51,128, 6, 97, 52,128, 6, 98, 53,128, 6, 99, 54,128, 6,100, - 55,128, 6,101, 56,128, 6,102, 57,128, 6,103, 52, 7, 41,188, - 41,220, 42, 26, 42, 88, 42,120, 42,176, 42,232, 48, 5, 41,200, - 41,204, 41,208, 41,212, 41,216, 48,128, 6,104, 49,128, 6,105, - 51,128, 6, 27, 55,128, 6, 31, 57,128, 6, 33, 49, 10, 41,242, - 41,246, 41,250, 41,254, 42, 2, 42, 6, 42, 10, 42, 14, 42, 18, - 42, 22, 48,128, 6, 34, 49,128, 6, 35, 50,128, 6, 36, 51,128, - 6, 37, 52,128, 6, 38, 53,128, 6, 39, 54,128, 6, 40, 55,128, - 6, 41, 56,128, 6, 42, 57,128, 6, 43, 50, 10, 42, 48, 42, 52, - 42, 56, 42, 60, 42, 64, 42, 68, 42, 72, 42, 76, 42, 80, 42, 84, - 48,128, 6, 44, 49,128, 6, 45, 50,128, 6, 46, 51,128, 6, 47, - 52,128, 6, 48, 53,128, 6, 49, 54,128, 6, 50, 55,128, 6, 51, - 56,128, 6, 52, 57,128, 6, 53, 51, 5, 42,100, 42,104, 42,108, - 42,112, 42,116, 48,128, 6, 54, 49,128, 6, 55, 50,128, 6, 56, - 51,128, 6, 57, 52,128, 6, 58, 52, 9, 42,140, 42,144, 42,148, - 42,152, 42,156, 42,160, 42,164, 42,168, 42,172, 48,128, 6, 64, - 49,128, 6, 65, 50,128, 6, 66, 51,128, 6, 67, 52,128, 6, 68, - 53,128, 6, 69, 54,128, 6, 70, 56,128, 6, 72, 57,128, 6, 73, - 53, 9, 42,196, 42,200, 42,204, 42,208, 42,212, 42,216, 42,220, - 42,224, 42,228, 48,128, 6, 74, 49,128, 6, 75, 50,128, 6, 76, - 51,128, 6, 77, 52,128, 6, 78, 53,128, 6, 79, 54,128, 6, 80, - 55,128, 6, 81, 56,128, 6, 82,183, 48,128, 6, 71, 53, 3, 42, - 245, 43, 21, 43, 53, 48, 5, 43, 1, 43, 5, 43, 9, 43, 13, 43, - 17, 53,128, 6,164, 54,128, 6,126, 55,128, 6,134, 56,128, 6, - 152, 57,128, 6,175, 49, 5, 43, 33, 43, 37, 43, 41, 43, 45, 43, - 49, 49,128, 6,121, 50,128, 6,136, 51,128, 6,145, 52,128, 6, - 186, 57,128, 6,210,179, 52,128, 6,213, 54, 7, 43, 74, 43, 79, - 43, 84, 43, 89, 43,127, 43,189, 43,251,179, 54,128, 32,170,180, - 53,128, 5,190,181, 56,128, 5,195, 54, 6, 43,103, 43,107, 43, - 111, 43,115, 43,119, 43,123, 52,128, 5,208, 53,128, 5,209, 54, - 128, 5,210, 55,128, 5,211, 56,128, 5,212, 57,128, 5,213, 55, - 10, 43,149, 43,153, 43,157, 43,161, 43,165, 43,169, 43,173, 43, - 177, 43,181, 43,185, 48,128, 5,214, 49,128, 5,215, 50,128, 5, - 216, 51,128, 5,217, 52,128, 5,218, 53,128, 5,219, 54,128, 5, - 220, 55,128, 5,221, 56,128, 5,222, 57,128, 5,223, 56, 10, 43, - 211, 43,215, 43,219, 43,223, 43,227, 43,231, 43,235, 43,239, 43, - 243, 43,247, 48,128, 5,224, 49,128, 5,225, 50,128, 5,226, 51, - 128, 5,227, 52,128, 5,228, 53,128, 5,229, 54,128, 5,230, 55, - 128, 5,231, 56,128, 5,232, 57,128, 5,233, 57, 3, 44, 3, 44, - 7, 44, 11, 48,128, 5,234, 52,128,251, 42, 53,128,251, 43, 55, - 4, 44, 25, 44, 39, 44, 59, 44, 64, 48, 2, 44, 31, 44, 35, 48, - 128,251, 75, 53,128,251, 31, 49, 3, 44, 47, 44, 51, 44, 55, 54, - 128, 5,240, 55,128, 5,241, 56,128, 5,242,178, 51,128,251, 53, - 57, 7, 44, 80, 44, 84, 44, 88, 44, 92, 44, 96, 44,100, 44,104, - 51,128, 5,180, 52,128, 5,181, 53,128, 5,182, 54,128, 5,187, - 55,128, 5,184, 56,128, 5,183, 57,128, 5,176, 56, 3, 44,116, - 44,160, 44,165, 48, 7, 44,132, 44,136, 44,140, 44,144, 44,148, - 44,152, 44,156, 48,128, 5,178, 49,128, 5,177, 50,128, 5,179, - 51,128, 5,194, 52,128, 5,193, 54,128, 5,185, 55,128, 5,188, - 179, 57,128, 5,189, 52, 2, 44,171, 44,175, 49,128, 5,191, 50, - 128, 5,192,185,178, 57,128, 2,188, 54, 3, 44,193, 44,252, 45, - 3, 49, 4, 44,203, 44,219, 44,225, 44,246, 50, 2, 44,209, 44, - 214,180, 56,128, 33, 5,184, 57,128, 33, 19,179,181, 50,128, 33, - 22,181, 55, 3, 44,234, 44,238, 44,242, 51,128, 32, 44, 52,128, - 32, 45, 53,128, 32, 46,182,182, 52,128, 32, 12,179,177,182, 55, - 128, 6,109,180,185,179, 55,128, 2,189,103, 2, 45, 16, 45, 23, - 242,225,246,101,128, 0,224,117, 2, 45, 29, 45, 38,234,225,242, - 225,244,105,128, 10,133,242,237,245,235,232,105,128, 10, 5,104, - 2, 45, 53, 45, 63,233,242,225,231,225,238, 97,128, 48, 66,239, - 239,235,225,226,239,246,101,128, 30,163,105, 7, 45, 90, 45,115, - 45,122, 45,134, 45,159, 45,175, 45,255, 98, 2, 45, 96, 45,105, - 229,238,231,225,236,105,128, 9,144,239,240,239,237,239,230,111, - 128, 49, 30,228,229,246, 97,128, 9, 16,229,227,249,242,233,236, - 236,233, 99,128, 4,213,231,117, 2, 45,141, 45,150,234,225,242, - 225,244,105,128, 10,144,242,237,245,235,232,105,128, 10, 16,237, - 225,244,242,225,231,245,242,237,245,235,232,105,128, 10, 72,110, - 5, 45,187, 45,196, 45,210, 45,226, 45,241,225,242,225,226,233, - 99,128, 6, 57,230,233,238,225,236,225,242,225,226,233, 99,128, - 254,202,233,238,233,244,233,225,236,225,242,225,226,233, 99,128, - 254,203,237,229,228,233,225,236,225,242,225,226,233, 99,128,254, - 204,246,229,242,244,229,228,226,242,229,246,101,128, 2, 3,246, - 239,247,229,236,243,233,231,110, 3, 46, 15, 46, 25, 46, 32,226, - 229,238,231,225,236,105,128, 9,200,228,229,246, 97,128, 9, 72, - 231,245,234,225,242,225,244,105,128, 10,200,107, 2, 46, 49, 46, - 73,225,244,225,235,225,238, 97,129, 48,162, 46, 61,232,225,236, - 230,247,233,228,244,104,128,255,113,239,242,229,225,110,128, 49, - 79,108, 3, 46, 89, 47,145, 47,154,101, 2, 46, 95, 47,140,102, - 136, 5,208, 46,115, 46,124, 46,139, 46,153, 46,242, 47, 0, 47, - 111, 47,125,225,242,225,226,233, 99,128, 6, 39,228,225,231,229, - 243,232,232,229,226,242,229,119,128,251, 48,230,233,238,225,236, - 225,242,225,226,233, 99,128,254,142,104, 2, 46,159, 46,234,225, - 237,250, 97, 2, 46,168, 46,201,225,226,239,246,101, 2, 46,178, - 46,187,225,242,225,226,233, 99,128, 6, 35,230,233,238,225,236, - 225,242,225,226,233, 99,128,254,132,226,229,236,239,119, 2, 46, - 211, 46,220,225,242,225,226,233, 99,128, 6, 37,230,233,238,225, - 236,225,242,225,226,233, 99,128,254,136,229,226,242,229,119,128, - 5,208,236,225,237,229,228,232,229,226,242,229,119,128,251, 79, - 237, 97, 2, 47, 7, 47, 43,228,228,225,225,226,239,246,101, 2, - 47, 20, 47, 29,225,242,225,226,233, 99,128, 6, 34,230,233,238, - 225,236,225,242,225,226,233, 99,128,254,130,235,243,245,242, 97, - 4, 47, 57, 47, 66, 47, 80, 47, 96,225,242,225,226,233, 99,128, - 6, 73,230,233,238,225,236,225,242,225,226,233, 99,128,254,240, - 233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,243, - 237,229,228,233,225,236,225,242,225,226,233, 99,128,254,244,240, - 225,244,225,232,232,229,226,242,229,119,128,251, 46,241,225,237, - 225,244,243,232,229,226,242,229,119,128,251, 47,240,104,128, 33, - 53,236,229,241,245,225,108,128, 34, 76,240,232, 97,129, 3,177, - 47,162,244,239,238,239,115,128, 3,172,109, 4, 47,180, 47,188, - 47,199, 47,233,225,227,242,239,110,128, 1, 1,239,238,239,243, - 240,225,227,101,128,255, 65,240,229,242,243,225,238,100,130, 0, - 38, 47,213, 47,225,237,239,238,239,243,240,225,227,101,128,255, - 6,243,237,225,236,108,128,247, 38,243,241,245,225,242,101,128, - 51,194,110, 4, 47,252, 48, 7, 48,129, 48,139,226,239,240,239, - 237,239,230,111,128, 49, 34,103, 4, 48, 17, 48, 28, 48, 42, 48, - 121,226,239,240,239,237,239,230,111,128, 49, 36,235,232,225,238, - 235,232,245,244,232,225,105,128, 14, 90,236,101,131, 34, 32, 48, - 53, 48,106, 48,113,226,242,225,227,235,229,116, 2, 48, 65, 48, - 85,236,229,230,116,129, 48, 8, 48, 74,246,229,242,244,233,227, - 225,108,128,254, 63,242,233,231,232,116,129, 48, 9, 48, 95,246, - 229,242,244,233,227,225,108,128,254, 64,236,229,230,116,128, 35, - 41,242,233,231,232,116,128, 35, 42,243,244,242,239,109,128, 33, - 43,239,244,229,236,229,233, 97,128, 3,135,117, 2, 48,145, 48, - 157,228,225,244,244,225,228,229,246, 97,128, 9, 82,243,246,225, - 242, 97, 3, 48,169, 48,179, 48,186,226,229,238,231,225,236,105, - 128, 9,130,228,229,246, 97,128, 9, 2,231,245,234,225,242,225, - 244,105,128, 10,130,239,231,239,238,229,107,128, 1, 5,112, 3, - 48,214, 48,238, 49, 12, 97, 2, 48,220, 48,232,225,244,239,243, - 241,245,225,242,101,128, 51, 0,242,229,110,128, 36,156,239,243, - 244,242,239,240,232,101, 2, 48,251, 49, 6,225,242,237,229,238, - 233,225,110,128, 5, 90,237,239,100,128, 2,188,112, 2, 49, 18, - 49, 23,236,101,128,248,255,242,111, 2, 49, 30, 49, 38,225,227, - 232,229,115,128, 34, 80,120, 2, 49, 44, 49, 64,229,241,245,225, - 108,129, 34, 72, 49, 54,239,242,233,237,225,231,101,128, 34, 82, - 233,237,225,244,229,236,249,229,241,245,225,108,128, 34, 69,114, - 4, 49, 89, 49,116, 49,120, 49,165,225,229, 97, 2, 49, 97, 49, - 107,229,235,239,242,229,225,110,128, 49,142,235,239,242,229,225, - 110,128, 49,141, 99,128, 35, 18,105, 2, 49,126, 49,140,231,232, - 244,232,225,236,230,242,233,238,103,128, 30,154,238,103,130, 0, - 229, 49,149, 49,157,225,227,245,244,101,128, 1,251,226,229,236, - 239,119,128, 30, 1,242,239,119, 8, 49,185, 49,192, 50, 65, 50, - 131, 50,181, 50,236, 51, 3, 51, 78,226,239,244,104,128, 33,148, - 100, 3, 49,200, 49,239, 50, 30,225,243,104, 4, 49,212, 49,219, - 49,226, 49,234,228,239,247,110,128, 33,227,236,229,230,116,128, - 33,224,242,233,231,232,116,128, 33,226,245,112,128, 33,225,226, - 108, 5, 49,252, 50, 3, 50, 10, 50, 17, 50, 25,226,239,244,104, - 128, 33,212,228,239,247,110,128, 33,211,236,229,230,116,128, 33, - 208,242,233,231,232,116,128, 33,210,245,112,128, 33,209,239,247, - 110,131, 33,147, 50, 42, 50, 49, 50, 57,236,229,230,116,128, 33, - 153,242,233,231,232,116,128, 33,152,247,232,233,244,101,128, 33, - 233,104, 2, 50, 71, 50,122,229,225,100, 4, 50, 83, 50, 93, 50, - 103, 50,114,228,239,247,238,237,239,100,128, 2,197,236,229,230, - 244,237,239,100,128, 2,194,242,233,231,232,244,237,239,100,128, - 2,195,245,240,237,239,100,128, 2,196,239,242,233,250,229,120, - 128,248,231,236,229,230,116,131, 33,144, 50,144, 50,161, 50,173, - 228,226,108,129, 33,208, 50,152,243,244,242,239,235,101,128, 33, - 205,239,246,229,242,242,233,231,232,116,128, 33,198,247,232,233, - 244,101,128, 33,230,242,233,231,232,116,132, 33,146, 50,197, 50, - 209, 50,217, 50,228,228,226,236,243,244,242,239,235,101,128, 33, - 207,232,229,225,246,121,128, 39,158,239,246,229,242,236,229,230, - 116,128, 33,196,247,232,233,244,101,128, 33,232,244,225, 98, 2, - 50,244, 50,251,236,229,230,116,128, 33,228,242,233,231,232,116, - 128, 33,229,245,112,132, 33,145, 51, 16, 51, 44, 51, 62, 51, 70, - 100, 2, 51, 22, 51, 34,110,129, 33,149, 51, 28,226,243,101,128, - 33,168,239,247,238,226,225,243,101,128, 33,168,236,229,230,116, - 129, 33,150, 51, 53,239,230,228,239,247,110,128, 33,197,242,233, - 231,232,116,128, 33,151,247,232,233,244,101,128, 33,231,246,229, - 242,244,229,120,128,248,230,115, 5, 51, 99, 51,175, 51,220, 52, - 47, 52, 57, 99, 2, 51,105, 51,157,233,105, 2, 51,112, 51,135, - 227,233,242,227,245,109,129, 0, 94, 51,123,237,239,238,239,243, - 240,225,227,101,128,255, 62,244,233,236,228,101,129, 0,126, 51, - 145,237,239,238,239,243,240,225,227,101,128,255, 94,242,233,240, - 116,129, 2, 81, 51,166,244,245,242,238,229,100,128, 2, 82,237, - 225,236,108, 2, 51,184, 51,195,232,233,242,225,231,225,238, 97, - 128, 48, 65,235,225,244,225,235,225,238, 97,129, 48,161, 51,208, - 232,225,236,230,247,233,228,244,104,128,255,103,244,229,242,233, - 115, 2, 51,230, 52, 43,107,131, 0, 42, 51,240, 52, 12, 52, 35, - 97, 2, 51,246, 52, 4,236,244,239,238,229,225,242,225,226,233, - 99,128, 6,109,242,225,226,233, 99,128, 6,109,109, 2, 52, 18, - 52, 24,225,244,104,128, 34, 23,239,238,239,243,240,225,227,101, - 128,255, 10,243,237,225,236,108,128,254, 97,109,128, 32, 66,245, - 240,229,242,233,239,114,128,246,233,249,237,240,244,239,244,233, - 227,225,236,236,249,229,241,245,225,108,128, 34, 67,116,132, 0, - 64, 52, 89, 52, 96, 52,108, 52,116,233,236,228,101,128, 0,227, - 237,239,238,239,243,240,225,227,101,128,255, 32,243,237,225,236, - 108,128,254,107,245,242,238,229,100,128, 2, 80,117, 6, 52,138, - 52,163, 52,170, 52,195, 52,215, 52,231, 98, 2, 52,144, 52,153, - 229,238,231,225,236,105,128, 9,148,239,240,239,237,239,230,111, - 128, 49, 32,228,229,246, 97,128, 9, 20,231,117, 2, 52,177, 52, - 186,234,225,242,225,244,105,128, 10,148,242,237,245,235,232,105, - 128, 10, 20,236,229,238,231,244,232,237,225,242,235,226,229,238, - 231,225,236,105,128, 9,215,237,225,244,242,225,231,245,242,237, - 245,235,232,105,128, 10, 76,246,239,247,229,236,243,233,231,110, - 3, 52,247, 53, 1, 53, 8,226,229,238,231,225,236,105,128, 9, - 204,228,229,246, 97,128, 9, 76,231,245,234,225,242,225,244,105, - 128, 10,204,246,225,231,242,225,232,225,228,229,246, 97,128, 9, - 61,121, 2, 53, 39, 53, 51,226,225,242,237,229,238,233,225,110, - 128, 5, 97,233,110,130, 5,226, 53, 60, 53, 75,225,236,244,239, - 238,229,232,229,226,242,229,119,128,251, 32,232,229,226,242,229, - 119,128, 5,226, 98,144, 0, 98, 53,120, 53,255, 54, 10, 54, 19, - 54, 44, 55, 85, 55,147, 55,220, 57,146, 57,158, 57,201, 57,209, - 57,219, 59, 89, 59,113, 59,122, 97, 7, 53,136, 53,146, 53,170, - 53,177, 53,202, 53,226, 53,237,226,229,238,231,225,236,105,128, - 9,172,227,235,243,236,225,243,104,129, 0, 92, 53,158,237,239, - 238,239,243,240,225,227,101,128,255, 60,228,229,246, 97,128, 9, - 44,231,117, 2, 53,184, 53,193,234,225,242,225,244,105,128, 10, - 172,242,237,245,235,232,105,128, 10, 44,104, 2, 53,208, 53,218, - 233,242,225,231,225,238, 97,128, 48,112,244,244,232,225,105,128, - 14, 63,235,225,244,225,235,225,238, 97,128, 48,208,114,129, 0, - 124, 53,243,237,239,238,239,243,240,225,227,101,128,255, 92,226, - 239,240,239,237,239,230,111,128, 49, 5,227,233,242,227,236,101, - 128, 36,209,228,239,116, 2, 54, 27, 54, 36,225,227,227,229,238, - 116,128, 30, 3,226,229,236,239,119,128, 30, 5,101, 6, 54, 58, - 54, 79, 54,102, 54,244, 54,255, 55, 11,225,237,229,228,243,233, - 248,244,229,229,238,244,232,238,239,244,229,115,128, 38,108, 99, - 2, 54, 85, 54, 92,225,245,243,101,128, 34, 53,249,242,233,236, - 236,233, 99,128, 4, 49,104, 5, 54,114, 54,123, 54,137, 54,167, - 54,226,225,242,225,226,233, 99,128, 6, 40,230,233,238,225,236, - 225,242,225,226,233, 99,128,254,144,105, 2, 54,143, 54,158,238, - 233,244,233,225,236,225,242,225,226,233, 99,128,254,145,242,225, - 231,225,238, 97,128, 48,121,237,101, 2, 54,174, 54,187,228,233, - 225,236,225,242,225,226,233, 99,128,254,146,229,237,105, 2, 54, - 195, 54,210,238,233,244,233,225,236,225,242,225,226,233, 99,128, - 252,159,243,239,236,225,244,229,228,225,242,225,226,233, 99,128, - 252, 8,238,239,239,238,230,233,238,225,236,225,242,225,226,233, - 99,128,252,109,235,225,244,225,235,225,238, 97,128, 48,217,238, - 225,242,237,229,238,233,225,110,128, 5, 98,116,132, 5,209, 55, - 23, 55, 43, 55, 63, 55, 72, 97,129, 3,178, 55, 29,243,249,237, - 226,239,236,231,242,229,229,107,128, 3,208,228,225,231,229,243, - 104,129,251, 49, 55, 54,232,229,226,242,229,119,128,251, 49,232, - 229,226,242,229,119,128, 5,209,242,225,230,229,232,229,226,242, - 229,119,128,251, 76,104, 2, 55, 91, 55,141, 97, 3, 55, 99, 55, - 109, 55,116,226,229,238,231,225,236,105,128, 9,173,228,229,246, - 97,128, 9, 45,231,117, 2, 55,123, 55,132,234,225,242,225,244, - 105,128, 10,173,242,237,245,235,232,105,128, 10, 45,239,239,107, - 128, 2, 83,105, 5, 55,159, 55,170, 55,181, 55,195, 55,209,232, - 233,242,225,231,225,238, 97,128, 48,115,235,225,244,225,235,225, - 238, 97,128, 48,211,236,225,226,233,225,236,227,236,233,227,107, - 128, 2,152,238,228,233,231,245,242,237,245,235,232,105,128, 10, - 2,242,245,243,241,245,225,242,101,128, 51, 49,108, 3, 55,228, - 57,129, 57,140, 97, 2, 55,234, 57,124,227,107, 6, 55,249, 56, - 2, 56, 39, 56,188, 56,243, 57, 39,227,233,242,227,236,101,128, - 37,207,100, 2, 56, 8, 56, 17,233,225,237,239,238,100,128, 37, - 198,239,247,238,240,239,233,238,244,233,238,231,244,242,233,225, - 238,231,236,101,128, 37,188,108, 2, 56, 45, 56,148,101, 2, 56, - 51, 56, 87,230,244,240,239,233,238,244,233,238,103, 2, 56, 66, - 56, 76,240,239,233,238,244,229,114,128, 37,196,244,242,233,225, - 238,231,236,101,128, 37,192,238,244,233,227,245,236,225,242,226, - 242,225,227,235,229,116, 2, 56,107, 56,127,236,229,230,116,129, - 48, 16, 56,116,246,229,242,244,233,227,225,108,128,254, 59,242, - 233,231,232,116,129, 48, 17, 56,137,246,229,242,244,233,227,225, - 108,128,254, 60,239,247,229,114, 2, 56,157, 56,172,236,229,230, - 244,244,242,233,225,238,231,236,101,128, 37,227,242,233,231,232, - 244,244,242,233,225,238,231,236,101,128, 37,226,114, 2, 56,194, - 56,205,229,227,244,225,238,231,236,101,128, 37,172,233,231,232, - 244,240,239,233,238,244,233,238,103, 2, 56,222, 56,232,240,239, - 233,238,244,229,114,128, 37,186,244,242,233,225,238,231,236,101, - 128, 37,182,115, 3, 56,251, 57, 25, 57, 33,109, 2, 57, 1, 57, - 13,225,236,236,243,241,245,225,242,101,128, 37,170,233,236,233, - 238,231,230,225,227,101,128, 38, 59,241,245,225,242,101,128, 37, - 160,244,225,114,128, 38, 5,245,240,112, 2, 57, 47, 57, 85,229, - 114, 2, 57, 54, 57, 69,236,229,230,244,244,242,233,225,238,231, - 236,101,128, 37,228,242,233,231,232,244,244,242,233,225,238,231, - 236,101,128, 37,229,239,233,238,244,233,238,103, 2, 57, 97, 57, - 113,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37, - 180,244,242,233,225,238,231,236,101,128, 37,178,238,107,128, 36, - 35,233,238,229,226,229,236,239,119,128, 30, 7,239,227,107,128, - 37,136,237,239,238,239,243,240,225,227,101,128,255, 66,111, 3, - 57,166, 57,179, 57,190,226,225,233,237,225,233,244,232,225,105, - 128, 14, 26,232,233,242,225,231,225,238, 97,128, 48,124,235,225, - 244,225,235,225,238, 97,128, 48,220,240,225,242,229,110,128, 36, - 157,241,243,241,245,225,242,101,128, 51,195,114, 4, 57,229, 58, - 223, 59, 40, 59, 79,225, 99, 2, 57,236, 58,130,101, 3, 57,244, - 57,249, 58, 61,229,120,128,248,244,236,229,230,116,133, 0,123, - 58, 10, 58, 15, 58, 37, 58, 45, 58, 50,226,116,128,248,243,109, - 2, 58, 21, 58, 26,233,100,128,248,242,239,238,239,243,240,225, - 227,101,128,255, 91,243,237,225,236,108,128,254, 91,244,112,128, - 248,241,246,229,242,244,233,227,225,108,128,254, 55,242,233,231, - 232,116,133, 0,125, 58, 79, 58, 84, 58,106, 58,114, 58,119,226, - 116,128,248,254,109, 2, 58, 90, 58, 95,233,100,128,248,253,239, - 238,239,243,240,225,227,101,128,255, 93,243,237,225,236,108,128, - 254, 92,244,112,128,248,252,246,229,242,244,233,227,225,108,128, - 254, 56,235,229,116, 2, 58,138, 58,180,236,229,230,116,132, 0, - 91, 58,153, 58,158, 58,163, 58,175,226,116,128,248,240,229,120, - 128,248,239,237,239,238,239,243,240,225,227,101,128,255, 59,244, - 112,128,248,238,242,233,231,232,116,132, 0, 93, 58,196, 58,201, - 58,206, 58,218,226,116,128,248,251,229,120,128,248,250,237,239, - 238,239,243,240,225,227,101,128,255, 61,244,112,128,248,249,229, - 246,101,131, 2,216, 58,235, 58,246, 58,252,226,229,236,239,247, - 227,237, 98,128, 3, 46,227,237, 98,128, 3, 6,233,238,246,229, - 242,244,229,100, 3, 59, 11, 59, 22, 59, 28,226,229,236,239,247, - 227,237, 98,128, 3, 47,227,237, 98,128, 3, 17,228,239,245,226, - 236,229,227,237, 98,128, 3, 97,233,228,231,101, 2, 59, 49, 59, - 60,226,229,236,239,247,227,237, 98,128, 3, 42,233,238,246,229, - 242,244,229,228,226,229,236,239,247,227,237, 98,128, 3, 58,239, - 235,229,238,226,225,114,128, 0,166,115, 2, 59, 95, 59,103,244, - 242,239,235,101,128, 1,128,245,240,229,242,233,239,114,128,246, - 234,244,239,240,226,225,114,128, 1,131,117, 3, 59,130, 59,141, - 59,152,232,233,242,225,231,225,238, 97,128, 48,118,235,225,244, - 225,235,225,238, 97,128, 48,214,236,108, 2, 59,159, 59,189,229, - 116,130, 32, 34, 59,168, 59,178,233,238,246,229,242,243,101,128, - 37,216,239,240,229,242,225,244,239,114,128, 34, 25,243,229,249, - 101,128, 37,206, 99,143, 0, 99, 59,230, 60,179, 60,190, 60,254, - 61, 29, 61,122, 63, 33, 64, 17, 64,117, 64,166, 67,158, 67,166, - 67,176, 67,188, 67,221, 97, 9, 59,250, 60, 5, 60, 15, 60, 22, - 60, 29, 60, 54, 60, 64, 60,116, 60,125,225,242,237,229,238,233, - 225,110,128, 5,110,226,229,238,231,225,236,105,128, 9,154,227, - 245,244,101,128, 1, 7,228,229,246, 97,128, 9, 26,231,117, 2, - 60, 36, 60, 45,234,225,242,225,244,105,128, 10,154,242,237,245, - 235,232,105,128, 10, 26,236,243,241,245,225,242,101,128, 51,136, - 238,228,242,225,226,233,238,228,117, 4, 60, 82, 60, 92, 60, 98, - 60,105,226,229,238,231,225,236,105,128, 9,129,227,237, 98,128, - 3, 16,228,229,246, 97,128, 9, 1,231,245,234,225,242,225,244, - 105,128, 10,129,240,243,236,239,227,107,128, 33,234,114, 3, 60, - 133, 60,139, 60,165,229,239,102,128, 33, 5,239,110,130, 2,199, - 60,148, 60,159,226,229,236,239,247,227,237, 98,128, 3, 44,227, - 237, 98,128, 3, 12,242,233,225,231,229,242,229,244,245,242,110, - 128, 33,181,226,239,240,239,237,239,230,111,128, 49, 24, 99, 4, - 60,200, 60,207, 60,226, 60,248,225,242,239,110,128, 1, 13,229, - 228,233,236,236, 97,129, 0,231, 60,218,225,227,245,244,101,128, - 30, 9,233,242, 99, 2, 60,234, 60,239,236,101,128, 36,210,245, - 237,230,236,229,120,128, 1, 9,245,242,108,128, 2, 85,100, 2, - 61, 4, 61, 20,239,116,129, 1, 11, 61, 11,225,227,227,229,238, - 116,128, 1, 11,243,241,245,225,242,101,128, 51,197,101, 2, 61, - 35, 61, 51,228,233,236,236, 97,129, 0,184, 61, 45,227,237, 98, - 128, 3, 39,238,116,132, 0,162, 61, 64, 61, 88, 61,100, 61,111, - 105, 2, 61, 70, 61, 78,231,242,225,228,101,128, 33, 3,238,230, - 229,242,233,239,114,128,246,223,237,239,238,239,243,240,225,227, - 101,128,255,224,239,236,228,243,244,249,236,101,128,247,162,243, - 245,240,229,242,233,239,114,128,246,224,104, 5, 61,134, 61,197, - 61,208, 62,136, 62,228, 97, 4, 61,144, 61,155, 61,165, 61,172, - 225,242,237,229,238,233,225,110,128, 5,121,226,229,238,231,225, - 236,105,128, 9,155,228,229,246, 97,128, 9, 27,231,117, 2, 61, - 179, 61,188,234,225,242,225,244,105,128, 10,155,242,237,245,235, - 232,105,128, 10, 27,226,239,240,239,237,239,230,111,128, 49, 20, - 101, 6, 61,222, 61,242, 62, 10, 62, 78, 62, 90, 62,111,225,226, - 235,232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128, - 4,189, 99, 2, 61,248, 62, 0,235,237,225,242,107,128, 39, 19, - 249,242,233,236,236,233, 99,128, 4, 71,100, 2, 62, 16, 62, 60, - 229,243,227,229,238,228,229,114, 2, 62, 29, 62, 49,225,226,235, - 232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128, 4, - 191,227,249,242,233,236,236,233, 99,128, 4,183,233,229,242,229, - 243,233,243,227,249,242,233,236,236,233, 99,128, 4,245,232,225, - 242,237,229,238,233,225,110,128, 5,115,235,232,225,235,225,243, - 243,233,225,238,227,249,242,233,236,236,233, 99,128, 4,204,246, - 229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242, - 233,236,236,233, 99,128, 4,185,105,129, 3,199, 62,142,229,245, - 227,104, 4, 62,155, 62,190, 62,205, 62,214, 97, 2, 62,161, 62, - 176,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,119, - 240,225,242,229,238,235,239,242,229,225,110,128, 50, 23,227,233, - 242,227,236,229,235,239,242,229,225,110,128, 50,105,235,239,242, - 229,225,110,128, 49, 74,240,225,242,229,238,235,239,242,229,225, - 110,128, 50, 9,111, 2, 62,234, 63, 28,227,104, 3, 62,243, 63, - 9, 63, 19,225,110, 2, 62,250, 63, 2,231,244,232,225,105,128, - 14, 10,244,232,225,105,128, 14, 8,233,238,231,244,232,225,105, - 128, 14, 9,239,229,244,232,225,105,128, 14, 12,239,107,128, 1, - 136,105, 2, 63, 39, 63,141,229,245, 99, 5, 63, 53, 63, 88, 63, - 103, 63,112, 63,126, 97, 2, 63, 59, 63, 74,227,233,242,227,236, - 229,235,239,242,229,225,110,128, 50,118,240,225,242,229,238,235, - 239,242,229,225,110,128, 50, 22,227,233,242,227,236,229,235,239, - 242,229,225,110,128, 50,104,235,239,242,229,225,110,128, 49, 72, - 240,225,242,229,238,235,239,242,229,225,110,128, 50, 8,245,240, - 225,242,229,238,235,239,242,229,225,110,128, 50, 28,242, 99, 2, - 63,148, 63,243,236,101,132, 37,203, 63,161, 63,172, 63,177, 63, - 201,237,245,236,244,233,240,236,121,128, 34,151,239,116,128, 34, - 153,112, 2, 63,183, 63,189,236,245,115,128, 34,149,239,243,244, - 225,236,237,225,242,107,128, 48, 54,247,233,244,104, 2, 63,210, - 63,226,236,229,230,244,232,225,236,230,226,236,225,227,107,128, - 37,208,242,233,231,232,244,232,225,236,230,226,236,225,227,107, - 128, 37,209,245,237,230,236,229,120,130, 2,198, 64, 0, 64, 11, - 226,229,236,239,247,227,237, 98,128, 3, 45,227,237, 98,128, 3, - 2,108, 3, 64, 25, 64, 31, 64, 85,229,225,114,128, 35, 39,233, - 227,107, 4, 64, 43, 64, 54, 64, 63, 64, 73,225,236,246,229,239, - 236,225,114,128, 1,194,228,229,238,244,225,108,128, 1,192,236, - 225,244,229,242,225,108,128, 1,193,242,229,244,242,239,230,236, - 229,120,128, 1,195,245, 98,129, 38, 99, 64, 92,243,245,233,116, - 2, 64,101, 64,109,226,236,225,227,107,128, 38, 99,247,232,233, - 244,101,128, 38,103,109, 3, 64,125, 64,139, 64,150,227,245,226, - 229,228,243,241,245,225,242,101,128, 51,164,239,238,239,243,240, - 225,227,101,128,255, 67,243,241,245,225,242,229,228,243,241,245, - 225,242,101,128, 51,160,111, 8, 64,184, 64,195, 65, 26, 65,224, - 66,253, 67, 28, 67,135, 67,144,225,242,237,229,238,233,225,110, - 128, 5,129,236,239,110,131, 0, 58, 64,207, 64,232, 64,251,237, - 239,110, 2, 64,215, 64,223,229,244,225,242,121,128, 32,161,239, - 243,240,225,227,101,128,255, 26,115, 2, 64,238, 64,244,233,231, - 110,128, 32,161,237,225,236,108,128,254, 85,244,242,233,225,238, - 231,245,236,225,114, 2, 65, 10, 65, 20,232,225,236,230,237,239, - 100,128, 2,209,237,239,100,128, 2,208,109, 2, 65, 32, 65,217, - 237, 97,134, 0, 44, 65, 49, 65,113, 65,124, 65,136, 65,166, 65, - 189, 97, 3, 65, 57, 65, 83, 65, 91,226,239,246,101, 2, 65, 66, - 65, 72,227,237, 98,128, 3, 19,242,233,231,232,244,227,237, 98, - 128, 3, 21,227,227,229,238,116,128,246,195,114, 2, 65, 97, 65, - 104,225,226,233, 99,128, 6, 12,237,229,238,233,225,110,128, 5, - 93,233,238,230,229,242,233,239,114,128,246,225,237,239,238,239, - 243,240,225,227,101,128,255, 12,242,229,246,229,242,243,229,100, - 2, 65,149, 65,160,225,226,239,246,229,227,237, 98,128, 3, 20, - 237,239,100,128, 2,189,115, 2, 65,172, 65,179,237,225,236,108, - 128,254, 80,245,240,229,242,233,239,114,128,246,226,244,245,242, - 238,229,100, 2, 65,200, 65,211,225,226,239,246,229,227,237, 98, - 128, 3, 18,237,239,100,128, 2,187,240,225,243,115,128, 38, 60, - 110, 2, 65,230, 65,239,231,242,245,229,238,116,128, 34, 69,116, - 2, 65,245, 66, 3,239,245,242,233,238,244,229,231,242,225,108, - 128, 34, 46,242,239,108,142, 35, 3, 66, 37, 66, 43, 66, 58, 66, - 73, 66,117, 66,162, 66,176, 66,181, 66,186, 66,191, 66,197, 66, - 202, 66,243, 66,248,193,195, 75,128, 0, 6, 66, 2, 66, 49, 66, - 54,197, 76,128, 0, 7, 83,128, 0, 8, 67, 2, 66, 64, 66, 69, - 193, 78,128, 0, 24, 82,128, 0, 13, 68, 3, 66, 81, 66,107, 66, - 112, 67, 4, 66, 91, 66, 95, 66, 99, 66,103, 49,128, 0, 17, 50, - 128, 0, 18, 51,128, 0, 19, 52,128, 0, 20,197, 76,128, 0,127, - 204, 69,128, 0, 16, 69, 5, 66,129, 66,133, 66,138, 66,143, 66, - 148, 77,128, 0, 25,206, 81,128, 0, 5,207, 84,128, 0, 4,211, - 67,128, 0, 27, 84, 2, 66,154, 66,158, 66,128, 0, 23, 88,128, - 0, 3, 70, 2, 66,168, 66,172, 70,128, 0, 12, 83,128, 0, 28, - 199, 83,128, 0, 29,200, 84,128, 0, 9,204, 70,128, 0, 10,206, - 193, 75,128, 0, 21,210, 83,128, 0, 30, 83, 5, 66,214, 66,218, - 66,228, 66,233, 66,238, 73,128, 0, 15, 79,129, 0, 14, 66,224, - 84,128, 0, 2,212, 88,128, 0, 1,213, 66,128, 0, 26,217, 78, - 128, 0, 22,213, 83,128, 0, 31,214, 84,128, 0, 11,240,249,242, - 233,231,232,116,129, 0,169, 67, 9,115, 2, 67, 15, 67, 21,225, - 238,115,128,248,233,229,242,233,102,128,246,217,114, 2, 67, 34, - 67,118,238,229,242,226,242,225,227,235,229,116, 2, 67, 49, 67, - 83,236,229,230,116,130, 48, 12, 67, 60, 67, 72,232,225,236,230, - 247,233,228,244,104,128,255, 98,246,229,242,244,233,227,225,108, - 128,254, 65,242,233,231,232,116,130, 48, 13, 67, 95, 67,107,232, - 225,236,230,247,233,228,244,104,128,255, 99,246,229,242,244,233, - 227,225,108,128,254, 66,240,239,242,225,244,233,239,238,243,241, - 245,225,242,101,128, 51,127,243,241,245,225,242,101,128, 51,199, - 246,229,242,235,231,243,241,245,225,242,101,128, 51,198,240,225, - 242,229,110,128, 36,158,242,245,250,229,233,242,111,128, 32,162, - 243,244,242,229,244,227,232,229,100,128, 2,151,245,114, 2, 67, - 195, 67,213,236,121, 2, 67,202, 67,208,225,238,100,128, 34,207, - 239,114,128, 34,206,242,229,238,227,121,128, 0,164,249,114, 4, - 67,232, 67,240, 67,247, 67,255,194,242,229,246,101,128,246,209, - 198,236,229,120,128,246,210,226,242,229,246,101,128,246,212,230, - 236,229,120,128,246,213,100,146, 0,100, 68, 46, 69,184, 70,208, - 71, 12, 71,188, 72,142, 72,204, 73,133, 73,146, 73,155, 73,181, - 73,206, 73,215, 75, 26, 75, 34, 75, 45, 75, 65, 75, 93, 97, 11, - 68, 70, 68, 81, 68, 91, 68,163, 68,226, 68,237, 68,248, 69, 61, - 69,123, 69,129, 69,159,225,242,237,229,238,233,225,110,128, 5, - 100,226,229,238,231,225,236,105,128, 9,166,100, 5, 68,103, 68, - 112, 68,118, 68,132, 68,148,225,242,225,226,233, 99,128, 6, 54, - 229,246, 97,128, 9, 38,230,233,238,225,236,225,242,225,226,233, - 99,128,254,190,233,238,233,244,233,225,236,225,242,225,226,233, - 99,128,254,191,237,229,228,233,225,236,225,242,225,226,233, 99, - 128,254,192,103, 3, 68,171, 68,188, 68,202,229,243,104,129, 5, - 188, 68,179,232,229,226,242,229,119,128, 5,188,231,229,114,129, - 32, 32, 68,196,228,226,108,128, 32, 33,117, 2, 68,208, 68,217, - 234,225,242,225,244,105,128, 10,166,242,237,245,235,232,105,128, - 10, 38,232,233,242,225,231,225,238, 97,128, 48, 96,235,225,244, - 225,235,225,238, 97,128, 48,192,108, 3, 69, 0, 69, 9, 69, 47, - 225,242,225,226,233, 99,128, 6, 47,229,116,130, 5,211, 69, 18, - 69, 38,228,225,231,229,243,104,129,251, 51, 69, 29,232,229,226, - 242,229,119,128,251, 51,232,229,226,242,229,119,128, 5,211,230, - 233,238,225,236,225,242,225,226,233, 99,128,254,170,237,237, 97, - 3, 69, 71, 69, 80, 69, 92,225,242,225,226,233, 99,128, 6, 79, - 236,239,247,225,242,225,226,233, 99,128, 6, 79,244,225,238, 97, - 2, 69,101, 69,115,236,244,239,238,229,225,242,225,226,233, 99, - 128, 6, 76,242,225,226,233, 99,128, 6, 76,238,228, 97,128, 9, - 100,242,231, 97, 2, 69,137, 69,146,232,229,226,242,229,119,128, - 5,167,236,229,230,244,232,229,226,242,229,119,128, 5,167,243, - 233,225,240,238,229,245,237,225,244,225,227,249,242,233,236,236, - 233,227,227,237, 98,128, 4,133, 98, 3, 69,192, 70,189, 70,199, - 108, 9, 69,212, 69,220, 70, 77, 70, 85, 70,101, 70,112, 70,130, - 70,144, 70,155,199,242,225,246,101,128,246,211, 97, 2, 69,226, - 70, 27,238,231,236,229,226,242,225,227,235,229,116, 2, 69,242, - 70, 6,236,229,230,116,129, 48, 10, 69,251,246,229,242,244,233, - 227,225,108,128,254, 61,242,233,231,232,116,129, 48, 11, 70, 16, - 246,229,242,244,233,227,225,108,128,254, 62,114, 2, 70, 33, 70, - 54,227,232,233,238,246,229,242,244,229,228,226,229,236,239,247, - 227,237, 98,128, 3, 43,242,239,119, 2, 70, 62, 70, 69,236,229, - 230,116,128, 33,212,242,233,231,232,116,128, 33,210,228,225,238, - 228, 97,128, 9,101,231,242,225,246,101,129,246,214, 70, 95,227, - 237, 98,128, 3, 15,233,238,244,229,231,242,225,108,128, 34, 44, - 236,239,247,236,233,238,101,129, 32, 23, 70,124,227,237, 98,128, - 3, 51,239,246,229,242,236,233,238,229,227,237, 98,128, 3, 63, - 240,242,233,237,229,237,239,100,128, 2,186,246,229,242,244,233, - 227,225,108, 2, 70,168, 70,174,226,225,114,128, 32, 22,236,233, - 238,229,225,226,239,246,229,227,237, 98,128, 3, 14,239,240,239, - 237,239,230,111,128, 49, 9,243,241,245,225,242,101,128, 51,200, - 99, 4, 70,218, 70,225, 70,234, 71, 5,225,242,239,110,128, 1, - 15,229,228,233,236,236, 97,128, 30, 17,233,242, 99, 2, 70,242, - 70,247,236,101,128, 36,211,245,237,230,236,229,248,226,229,236, - 239,119,128, 30, 19,242,239,225,116,128, 1, 17,100, 4, 71, 22, - 71,103, 71,113, 71,164, 97, 4, 71, 32, 71, 42, 71, 49, 71, 74, - 226,229,238,231,225,236,105,128, 9,161,228,229,246, 97,128, 9, - 33,231,117, 2, 71, 56, 71, 65,234,225,242,225,244,105,128, 10, - 161,242,237,245,235,232,105,128, 10, 33,108, 2, 71, 80, 71, 89, - 225,242,225,226,233, 99,128, 6,136,230,233,238,225,236,225,242, - 225,226,233, 99,128,251,137,228,232,225,228,229,246, 97,128, 9, - 92,232, 97, 3, 71,122, 71,132, 71,139,226,229,238,231,225,236, - 105,128, 9,162,228,229,246, 97,128, 9, 34,231,117, 2, 71,146, - 71,155,234,225,242,225,244,105,128, 10,162,242,237,245,235,232, - 105,128, 10, 34,239,116, 2, 71,171, 71,180,225,227,227,229,238, - 116,128, 30, 11,226,229,236,239,119,128, 30, 13,101, 8, 71,206, - 72, 3, 72, 10, 72, 35, 72, 45, 72, 56, 72,101, 72,137, 99, 2, - 71,212, 71,249,233,237,225,236,243,229,240,225,242,225,244,239, - 114, 2, 71,230, 71,239,225,242,225,226,233, 99,128, 6,107,240, - 229,242,243,233,225,110,128, 6,107,249,242,233,236,236,233, 99, - 128, 4, 52,231,242,229,101,128, 0,176,232,105, 2, 72, 17, 72, - 26,232,229,226,242,229,119,128, 5,173,242,225,231,225,238, 97, - 128, 48,103,233,227,239,240,244,233, 99,128, 3,239,235,225,244, - 225,235,225,238, 97,128, 48,199,108, 2, 72, 62, 72, 85,229,244, - 101, 2, 72, 70, 72, 77,236,229,230,116,128, 35, 43,242,233,231, - 232,116,128, 35, 38,244, 97,129, 3,180, 72, 92,244,245,242,238, - 229,100,128, 1,141,238,239,237,233,238,225,244,239,242,237,233, - 238,245,243,239,238,229,238,245,237,229,242,225,244,239,242,226, - 229,238,231,225,236,105,128, 9,248,250,104,128, 2,164,104, 2, - 72,148, 72,198, 97, 3, 72,156, 72,166, 72,173,226,229,238,231, - 225,236,105,128, 9,167,228,229,246, 97,128, 9, 39,231,117, 2, - 72,180, 72,189,234,225,242,225,244,105,128, 10,167,242,237,245, - 235,232,105,128, 10, 39,239,239,107,128, 2, 87,105, 6, 72,218, - 73, 11, 73, 71, 73, 82, 73, 93, 73,103, 97, 2, 72,224, 72,246, - 236,249,244,233,235,225,244,239,238,239,115,129, 3,133, 72,240, - 227,237, 98,128, 3, 68,237,239,238,100,129, 38,102, 72,255,243, - 245,233,244,247,232,233,244,101,128, 38, 98,229,242,229,243,233, - 115,133, 0,168, 73, 30, 73, 38, 73, 49, 73, 55, 73, 63,225,227, - 245,244,101,128,246,215,226,229,236,239,247,227,237, 98,128, 3, - 36,227,237, 98,128, 3, 8,231,242,225,246,101,128,246,216,244, - 239,238,239,115,128, 3,133,232,233,242,225,231,225,238, 97,128, - 48, 98,235,225,244,225,235,225,238, 97,128, 48,194,244,244,239, - 237,225,242,107,128, 48, 3,246,105, 2, 73,110, 73,121,228,101, - 129, 0,247, 73,117,115,128, 34, 35,243,233,239,238,243,236,225, - 243,104,128, 34, 21,234,229,227,249,242,233,236,236,233, 99,128, - 4, 82,235,243,232,225,228,101,128, 37,147,108, 2, 73,161, 73, - 172,233,238,229,226,229,236,239,119,128, 30, 15,243,241,245,225, - 242,101,128, 51,151,109, 2, 73,187, 73,195,225,227,242,239,110, - 128, 1, 17,239,238,239,243,240,225,227,101,128,255, 68,238,226, - 236,239,227,107,128, 37,132,111, 10, 73,237, 73,249, 74, 3, 74, - 14, 74, 25, 74, 97, 74,102, 74,113, 74,228, 74,254,227,232,225, - 228,225,244,232,225,105,128, 14, 14,228,229,235,244,232,225,105, - 128, 14, 20,232,233,242,225,231,225,238, 97,128, 48,105,235,225, - 244,225,235,225,238, 97,128, 48,201,236,236,225,114,132, 0, 36, - 74, 40, 74, 51, 74, 63, 74, 74,233,238,230,229,242,233,239,114, - 128,246,227,237,239,238,239,243,240,225,227,101,128,255, 4,239, - 236,228,243,244,249,236,101,128,247, 36,115, 2, 74, 80, 74, 87, - 237,225,236,108,128,254,105,245,240,229,242,233,239,114,128,246, - 228,238,103,128, 32,171,242,245,243,241,245,225,242,101,128, 51, - 38,116, 6, 74,127, 74,144, 74,166, 74,177, 74,209, 74,216,225, - 227,227,229,238,116,129, 2,217, 74,138,227,237, 98,128, 3, 7, - 226,229,236,239,247, 99, 2, 74,155, 74,160,237, 98,128, 3, 35, - 239,237, 98,128, 3, 35,235,225,244,225,235,225,238, 97,128, 48, - 251,236,229,243,115, 2, 74,186, 74,190,105,128, 1, 49,106,129, - 246,190, 74,196,243,244,242,239,235,229,232,239,239,107,128, 2, - 132,237,225,244,104,128, 34,197,244,229,228,227,233,242,227,236, - 101,128, 37,204,245,226,236,229,249,239,228,240,225,244,225,104, - 129,251, 31, 74,245,232,229,226,242,229,119,128,251, 31,247,238, - 244,225,227,107, 2, 75, 9, 75, 20,226,229,236,239,247,227,237, - 98,128, 3, 30,237,239,100,128, 2,213,240,225,242,229,110,128, - 36,159,243,245,240,229,242,233,239,114,128,246,235,116, 2, 75, - 51, 75, 57,225,233,108,128, 2, 86,239,240,226,225,114,128, 1, - 140,117, 2, 75, 71, 75, 82,232,233,242,225,231,225,238, 97,128, - 48,101,235,225,244,225,235,225,238, 97,128, 48,197,122,132, 1, - 243, 75,105, 75,114, 75,133, 75,170,225,236,244,239,238,101,128, - 2,163, 99, 2, 75,120, 75,127,225,242,239,110,128, 1,198,245, - 242,108,128, 2,165,101, 2, 75,139, 75,159,225,226,235,232,225, - 243,233,225,238,227,249,242,233,236,236,233, 99,128, 4,225,227, - 249,242,233,236,236,233, 99,128, 4, 85,232,229,227,249,242,233, - 236,236,233, 99,128, 4, 95,101,151, 0,101, 75,233, 75,252, 76, - 30, 77, 4, 77, 66, 77, 99, 77,111, 77,134, 77,187, 79, 43, 79, - 101, 79,203, 80, 63, 80,198, 81, 17, 81, 48, 81,110, 81,163, 82, - 98, 82,231, 82,251, 83, 39, 83,130, 97, 2, 75,239, 75,246,227, - 245,244,101,128, 0,233,242,244,104,128, 38, 65, 98, 3, 76, 4, - 76, 13, 76, 23,229,238,231,225,236,105,128, 9,143,239,240,239, - 237,239,230,111,128, 49, 28,242,229,246,101,128, 1, 21, 99, 5, - 76, 42, 76,115, 76,129, 76,161, 76,250, 97, 2, 76, 48, 76,109, - 238,228,242, 97, 3, 76, 59, 76, 66, 76, 77,228,229,246, 97,128, - 9, 13,231,245,234,225,242,225,244,105,128, 10,141,246,239,247, - 229,236,243,233,231,110, 2, 76, 91, 76, 98,228,229,246, 97,128, - 9, 69,231,245,234,225,242,225,244,105,128, 10,197,242,239,110, - 128, 1, 27,229,228,233,236,236,225,226,242,229,246,101,128, 30, - 29,104, 2, 76,135, 76,146,225,242,237,229,238,233,225,110,128, - 5,101,249,233,247,238,225,242,237,229,238,233,225,110,128, 5, - 135,233,242, 99, 2, 76,169, 76,174,236,101,128, 36,212,245,237, - 230,236,229,120,134, 0,234, 76,195, 76,203, 76,211, 76,222, 76, - 230, 76,242,225,227,245,244,101,128, 30,191,226,229,236,239,119, - 128, 30, 25,228,239,244,226,229,236,239,119,128, 30,199,231,242, - 225,246,101,128, 30,193,232,239,239,235,225,226,239,246,101,128, - 30,195,244,233,236,228,101,128, 30,197,249,242,233,236,236,233, - 99,128, 4, 84,100, 4, 77, 14, 77, 24, 77, 30, 77, 40,226,236, - 231,242,225,246,101,128, 2, 5,229,246, 97,128, 9, 15,233,229, - 242,229,243,233,115,128, 0,235,239,116,130, 1, 23, 77, 49, 77, - 58,225,227,227,229,238,116,128, 1, 23,226,229,236,239,119,128, - 30,185,101, 2, 77, 72, 77, 83,231,245,242,237,245,235,232,105, - 128, 10, 15,237,225,244,242,225,231,245,242,237,245,235,232,105, - 128, 10, 71,230,227,249,242,233,236,236,233, 99,128, 4, 68,103, - 2, 77,117, 77,124,242,225,246,101,128, 0,232,245,234,225,242, - 225,244,105,128, 10,143,104, 4, 77,144, 77,155, 77,166, 77,176, - 225,242,237,229,238,233,225,110,128, 5,103,226,239,240,239,237, - 239,230,111,128, 49, 29,233,242,225,231,225,238, 97,128, 48, 72, - 239,239,235,225,226,239,246,101,128, 30,187,105, 4, 77,197, 77, - 208, 79, 10, 79, 25,226,239,240,239,237,239,230,111,128, 49, 31, - 231,232,116,142, 0, 56, 77,242, 77,251, 78, 5, 78, 35, 78, 42, - 78, 80, 78,105, 78,150, 78,184, 78,196, 78,207, 78,240, 78,248, - 79, 3,225,242,225,226,233, 99,128, 6,104,226,229,238,231,225, - 236,105,128, 9,238,227,233,242,227,236,101,129, 36,103, 78, 16, - 233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,102, - 128, 39,145,228,229,246, 97,128, 9,110,229,229,110, 2, 78, 50, - 78, 59,227,233,242,227,236,101,128, 36,113,112, 2, 78, 65, 78, - 72,225,242,229,110,128, 36,133,229,242,233,239,100,128, 36,153, - 231,117, 2, 78, 87, 78, 96,234,225,242,225,244,105,128, 10,238, - 242,237,245,235,232,105,128, 10,110,104, 2, 78,111, 78,137, 97, - 2, 78,117, 78,128,227,235,225,242,225,226,233, 99,128, 6,104, - 238,231,250,232,239,117,128, 48, 40,238,239,244,229,226,229,225, - 237,229,100,128, 38,107,105, 2, 78,156, 78,174,228,229,239,231, - 242,225,240,232,233,227,240,225,242,229,110,128, 50, 39,238,230, - 229,242,233,239,114,128, 32,136,237,239,238,239,243,240,225,227, - 101,128,255, 24,239,236,228,243,244,249,236,101,128,247, 56,112, - 2, 78,213, 78,220,225,242,229,110,128, 36,123,229,114, 2, 78, - 227, 78,233,233,239,100,128, 36,143,243,233,225,110,128, 6,248, - 242,239,237,225,110,128, 33,119,243,245,240,229,242,233,239,114, - 128, 32,120,244,232,225,105,128, 14, 88,238,246,229,242,244,229, - 228,226,242,229,246,101,128, 2, 7,239,244,233,230,233,229,228, - 227,249,242,233,236,236,233, 99,128, 4,101,107, 2, 79, 49, 79, - 73,225,244,225,235,225,238, 97,129, 48,168, 79, 61,232,225,236, - 230,247,233,228,244,104,128,255,116,111, 2, 79, 79, 79, 94,238, - 235,225,242,231,245,242,237,245,235,232,105,128, 10,116,242,229, - 225,110,128, 49, 84,108, 3, 79,109, 79,120, 79,181,227,249,242, - 233,236,236,233, 99,128, 4, 59,101, 2, 79,126, 79,133,237,229, - 238,116,128, 34, 8,246,229,110, 3, 79,143, 79,152, 79,173,227, - 233,242,227,236,101,128, 36,106,112, 2, 79,158, 79,165,225,242, - 229,110,128, 36,126,229,242,233,239,100,128, 36,146,242,239,237, - 225,110,128, 33,122,236,233,240,243,233,115,129, 32, 38, 79,192, - 246,229,242,244,233,227,225,108,128, 34,238,109, 5, 79,215, 79, - 243, 79,254, 80, 18, 80, 29,225,227,242,239,110,130, 1, 19, 79, - 227, 79,235,225,227,245,244,101,128, 30, 23,231,242,225,246,101, - 128, 30, 21,227,249,242,233,236,236,233, 99,128, 4, 60,228,225, - 243,104,129, 32, 20, 80, 7,246,229,242,244,233,227,225,108,128, - 254, 49,239,238,239,243,240,225,227,101,128,255, 69,112, 2, 80, - 35, 80, 55,232,225,243,233,243,237,225,242,235,225,242,237,229, - 238,233,225,110,128, 5, 91,244,249,243,229,116,128, 34, 5,110, - 6, 80, 77, 80, 88, 80, 99, 80,143, 80,175, 80,190,226,239,240, - 239,237,239,230,111,128, 49, 35,227,249,242,233,236,236,233, 99, - 128, 4, 61,100, 2, 80,105, 80,124,225,243,104,129, 32, 19, 80, - 113,246,229,242,244,233,227,225,108,128,254, 50,229,243,227,229, - 238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,163,103, - 130, 1, 75, 80,151, 80,162,226,239,240,239,237,239,230,111,128, - 49, 37,232,229,227,249,242,233,236,236,233, 99,128, 4,165,232, - 239,239,235,227,249,242,233,236,236,233, 99,128, 4,200,243,240, - 225,227,101,128, 32, 2,111, 3, 80,206, 80,214, 80,223,231,239, - 238,229,107,128, 1, 25,235,239,242,229,225,110,128, 49, 83,240, - 229,110,130, 2, 91, 80,233, 80,242,227,236,239,243,229,100,128, - 2,154,242,229,246,229,242,243,229,100,130, 2, 92, 81, 1, 81, - 10,227,236,239,243,229,100,128, 2, 94,232,239,239,107,128, 2, - 93,112, 2, 81, 23, 81, 30,225,242,229,110,128, 36,160,243,233, - 236,239,110,129, 3,181, 81, 40,244,239,238,239,115,128, 3,173, - 241,117, 2, 81, 55, 81, 99,225,108,130, 0, 61, 81, 64, 81, 76, - 237,239,238,239,243,240,225,227,101,128,255, 29,115, 2, 81, 82, - 81, 89,237,225,236,108,128,254,102,245,240,229,242,233,239,114, - 128, 32,124,233,246,225,236,229,238,227,101,128, 34, 97,114, 3, - 81,118, 81,129, 81,140,226,239,240,239,237,239,230,111,128, 49, - 38,227,249,242,233,236,236,233, 99,128, 4, 64,229,246,229,242, - 243,229,100,129, 2, 88, 81,152,227,249,242,233,236,236,233, 99, - 128, 4, 77,115, 6, 81,177, 81,188, 81,208, 82, 33, 82, 78, 82, - 88,227,249,242,233,236,236,233, 99,128, 4, 65,228,229,243,227, - 229,238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,171, - 104,132, 2,131, 81,220, 81,227, 82, 2, 82, 17,227,245,242,108, - 128, 2,134,239,242,116, 2, 81,235, 81,242,228,229,246, 97,128, - 9, 14,246,239,247,229,236,243,233,231,238,228,229,246, 97,128, - 9, 70,242,229,246,229,242,243,229,228,236,239,239,112,128, 1, - 170,243,241,245,225,244,242,229,246,229,242,243,229,100,128, 2, - 133,237,225,236,108, 2, 82, 42, 82, 53,232,233,242,225,231,225, - 238, 97,128, 48, 71,235,225,244,225,235,225,238, 97,129, 48,167, - 82, 66,232,225,236,230,247,233,228,244,104,128,255,106,244,233, - 237,225,244,229,100,128, 33, 46,245,240,229,242,233,239,114,128, - 246,236,116, 5, 82,110, 82,136, 82,140, 82,157, 82,223, 97,130, - 3,183, 82,118, 82,128,242,237,229,238,233,225,110,128, 5,104, - 244,239,238,239,115,128, 3,174,104,128, 0,240,233,236,228,101, - 129, 30,189, 82,149,226,229,236,239,119,128, 30, 27,238,225,232, - 244, 97, 3, 82,169, 82,201, 82,210,230,239,245,235,104, 2, 82, - 179, 82,188,232,229,226,242,229,119,128, 5,145,236,229,230,244, - 232,229,226,242,229,119,128, 5,145,232,229,226,242,229,119,128, - 5,145,236,229,230,244,232,229,226,242,229,119,128, 5,145,245, - 242,238,229,100,128, 1,221,117, 2, 82,237, 82,246,235,239,242, - 229,225,110,128, 49, 97,242,111,128, 32,172,246,239,247,229,236, - 243,233,231,110, 3, 83, 11, 83, 21, 83, 28,226,229,238,231,225, - 236,105,128, 9,199,228,229,246, 97,128, 9, 71,231,245,234,225, - 242,225,244,105,128, 10,199,120, 2, 83, 45, 83,118,227,236,225, - 109,132, 0, 33, 83, 60, 83, 71, 83, 98, 83,110,225,242,237,229, - 238,233,225,110,128, 5, 92,100, 2, 83, 77, 83, 82,226,108,128, - 32, 60,239,247,110,129, 0,161, 83, 90,243,237,225,236,108,128, - 247,161,237,239,238,239,243,240,225,227,101,128,255, 1,243,237, - 225,236,108,128,247, 33,233,243,244,229,238,244,233,225,108,128, - 34, 3,250,104,131, 2,146, 83,141, 83,160, 83,171, 99, 2, 83, - 147, 83,154,225,242,239,110,128, 1,239,245,242,108,128, 2,147, - 242,229,246,229,242,243,229,100,128, 1,185,244,225,233,108,128, - 1,186,102,140, 0,102, 83,206, 84, 32, 84, 43, 84, 52, 84, 64, - 84,167, 84,183, 86,191, 86,204, 86,230, 88,107, 88,115, 97, 4, - 83,216, 83,223, 83,234, 83,245,228,229,246, 97,128, 9, 94,231, - 245,242,237,245,235,232,105,128, 10, 94,232,242,229,238,232,229, - 233,116,128, 33, 9,244,232, 97, 3, 83,255, 84, 8, 84, 20,225, - 242,225,226,233, 99,128, 6, 78,236,239,247,225,242,225,226,233, - 99,128, 6, 78,244,225,238,225,242,225,226,233, 99,128, 6, 75, - 226,239,240,239,237,239,230,111,128, 49, 8,227,233,242,227,236, - 101,128, 36,213,228,239,244,225,227,227,229,238,116,128, 30, 31, - 101, 3, 84, 72, 84,150, 84,160,104, 4, 84, 82, 84,105, 84,119, - 84,135,225,114, 2, 84, 89, 84, 96,225,226,233, 99,128, 6, 65, - 237,229,238,233,225,110,128, 5,134,230,233,238,225,236,225,242, - 225,226,233, 99,128,254,210,233,238,233,244,233,225,236,225,242, - 225,226,233, 99,128,254,211,237,229,228,233,225,236,225,242,225, - 226,233, 99,128,254,212,233,227,239,240,244,233, 99,128, 3,229, - 237,225,236,101,128, 38, 64,102,130,251, 0, 84,175, 84,179,105, - 128,251, 3,108,128,251, 4,105,136,251, 1, 84,203, 84,243, 84, - 254, 85, 20, 85,142, 85,159, 85,167, 85,180,230,244,229,229,110, - 2, 84,213, 84,222,227,233,242,227,236,101,128, 36,110,112, 2, - 84,228, 84,235,225,242,229,110,128, 36,130,229,242,233,239,100, - 128, 36,150,231,245,242,229,228,225,243,104,128, 32, 18,236,236, - 229,100, 2, 85, 7, 85, 13,226,239,120,128, 37,160,242,229,227, - 116,128, 37,172,238,225,108, 5, 85, 34, 85, 73, 85, 90, 85,107, - 85,123,235,225,102,130, 5,218, 85, 44, 85, 64,228,225,231,229, - 243,104,129,251, 58, 85, 55,232,229,226,242,229,119,128,251, 58, - 232,229,226,242,229,119,128, 5,218,237,229,109,129, 5,221, 85, - 81,232,229,226,242,229,119,128, 5,221,238,245,110,129, 5,223, - 85, 98,232,229,226,242,229,119,128, 5,223,240,101,129, 5,227, - 85,114,232,229,226,242,229,119,128, 5,227,244,243,225,228,105, - 129, 5,229, 85,133,232,229,226,242,229,119,128, 5,229,242,243, - 244,244,239,238,229,227,232,233,238,229,243,101,128, 2,201,243, - 232,229,249,101,128, 37,201,244,225,227,249,242,233,236,236,233, - 99,128, 4,115,246,101,142, 0, 53, 85,213, 85,222, 85,232, 86, - 6, 86, 13, 86, 23, 86, 48, 86, 75, 86,109, 86,121, 86,132, 86, - 165, 86,173, 86,184,225,242,225,226,233, 99,128, 6,101,226,229, - 238,231,225,236,105,128, 9,235,227,233,242,227,236,101,129, 36, - 100, 85,243,233,238,246,229,242,243,229,243,225,238,243,243,229, - 242,233,102,128, 39,142,228,229,246, 97,128, 9,107,229,233,231, - 232,244,232,115,128, 33, 93,231,117, 2, 86, 30, 86, 39,234,225, - 242,225,244,105,128, 10,235,242,237,245,235,232,105,128, 10,107, - 232, 97, 2, 86, 55, 86, 66,227,235,225,242,225,226,233, 99,128, - 6,101,238,231,250,232,239,117,128, 48, 37,105, 2, 86, 81, 86, - 99,228,229,239,231,242,225,240,232,233,227,240,225,242,229,110, - 128, 50, 36,238,230,229,242,233,239,114,128, 32,133,237,239,238, - 239,243,240,225,227,101,128,255, 21,239,236,228,243,244,249,236, - 101,128,247, 53,112, 2, 86,138, 86,145,225,242,229,110,128, 36, - 120,229,114, 2, 86,152, 86,158,233,239,100,128, 36,140,243,233, - 225,110,128, 6,245,242,239,237,225,110,128, 33,116,243,245,240, - 229,242,233,239,114,128, 32,117,244,232,225,105,128, 14, 85,108, - 129,251, 2, 86,197,239,242,233,110,128, 1,146,109, 2, 86,210, - 86,221,239,238,239,243,240,225,227,101,128,255, 70,243,241,245, - 225,242,101,128, 51,153,111, 4, 86,240, 87, 6, 87, 18, 87, 25, - 230, 97, 2, 86,247, 86,255,238,244,232,225,105,128, 14, 31,244, - 232,225,105,128, 14, 29,238,231,237,225,238,244,232,225,105,128, - 14, 79,242,225,236,108,128, 34, 0,245,114,142, 0, 52, 87, 58, - 87, 67, 87, 77, 87,107, 87,114, 87,139, 87,166, 87,200, 87,212, - 87,231, 87,242, 88, 19, 88, 27, 88, 38,225,242,225,226,233, 99, - 128, 6,100,226,229,238,231,225,236,105,128, 9,234,227,233,242, - 227,236,101,129, 36, 99, 87, 88,233,238,246,229,242,243,229,243, - 225,238,243,243,229,242,233,102,128, 39,141,228,229,246, 97,128, - 9,106,231,117, 2, 87,121, 87,130,234,225,242,225,244,105,128, - 10,234,242,237,245,235,232,105,128, 10,106,232, 97, 2, 87,146, - 87,157,227,235,225,242,225,226,233, 99,128, 6,100,238,231,250, - 232,239,117,128, 48, 36,105, 2, 87,172, 87,190,228,229,239,231, - 242,225,240,232,233,227,240,225,242,229,110,128, 50, 35,238,230, - 229,242,233,239,114,128, 32,132,237,239,238,239,243,240,225,227, - 101,128,255, 20,238,245,237,229,242,225,244,239,242,226,229,238, - 231,225,236,105,128, 9,247,239,236,228,243,244,249,236,101,128, - 247, 52,112, 2, 87,248, 87,255,225,242,229,110,128, 36,119,229, - 114, 2, 88, 6, 88, 12,233,239,100,128, 36,139,243,233,225,110, - 128, 6,244,242,239,237,225,110,128, 33,115,243,245,240,229,242, - 233,239,114,128, 32,116,116, 2, 88, 44, 88, 82,229,229,110, 2, - 88, 52, 88, 61,227,233,242,227,236,101,128, 36,109,112, 2, 88, - 67, 88, 74,225,242,229,110,128, 36,129,229,242,233,239,100,128, - 36,149,104, 2, 88, 88, 88, 93,225,105,128, 14, 84,244,239,238, - 229,227,232,233,238,229,243,101,128, 2,203,240,225,242,229,110, - 128, 36,161,242, 97, 2, 88,122, 88,130,227,244,233,239,110,128, - 32, 68,238, 99,128, 32,163,103,144, 0,103, 88,171, 89,117, 89, - 140, 89,201, 89,218, 90,139, 91,132, 91,217, 91,230, 92, 88, 92, - 113, 92,141, 92,163, 93,108, 93,130, 93,232, 97, 9, 88,191, 88, - 201, 88,208, 88,215, 89, 23, 89, 48, 89, 59, 89, 70, 89,104,226, - 229,238,231,225,236,105,128, 9,151,227,245,244,101,128, 1,245, - 228,229,246, 97,128, 9, 23,102, 4, 88,225, 88,234, 88,248, 89, - 8,225,242,225,226,233, 99,128, 6,175,230,233,238,225,236,225, - 242,225,226,233, 99,128,251,147,233,238,233,244,233,225,236,225, - 242,225,226,233, 99,128,251,148,237,229,228,233,225,236,225,242, - 225,226,233, 99,128,251,149,231,117, 2, 89, 30, 89, 39,234,225, - 242,225,244,105,128, 10,151,242,237,245,235,232,105,128, 10, 23, - 232,233,242,225,231,225,238, 97,128, 48, 76,235,225,244,225,235, - 225,238, 97,128, 48,172,237,237, 97,130, 3,179, 89, 80, 89, 93, - 236,225,244,233,238,243,237,225,236,108,128, 2, 99,243,245,240, - 229,242,233,239,114,128, 2,224,238,231,233,225,227,239,240,244, - 233, 99,128, 3,235, 98, 2, 89,123, 89,133,239,240,239,237,239, - 230,111,128, 49, 13,242,229,246,101,128, 1, 31, 99, 4, 89,150, - 89,157, 89,166, 89,188,225,242,239,110,128, 1,231,229,228,233, - 236,236, 97,128, 1, 35,233,242, 99, 2, 89,174, 89,179,236,101, - 128, 36,214,245,237,230,236,229,120,128, 1, 29,239,237,237,225, - 225,227,227,229,238,116,128, 1, 35,228,239,116,129, 1, 33, 89, - 209,225,227,227,229,238,116,128, 1, 33,101, 6, 89,232, 89,243, - 89,254, 90, 9, 90, 28, 90,130,227,249,242,233,236,236,233, 99, - 128, 4, 51,232,233,242,225,231,225,238, 97,128, 48, 82,235,225, - 244,225,235,225,238, 97,128, 48,178,239,237,229,244,242,233,227, - 225,236,236,249,229,241,245,225,108,128, 34, 81,114, 3, 90, 36, - 90, 85, 90, 95,229,243,104, 3, 90, 46, 90, 61, 90, 70,225,227, - 227,229,238,244,232,229,226,242,229,119,128, 5,156,232,229,226, - 242,229,119,128, 5,243,237,245,241,228,225,237,232,229,226,242, - 229,119,128, 5,157,237,225,238,228,226,236,115,128, 0,223,243, - 232,225,249,233,109, 2, 90,106, 90,121,225,227,227,229,238,244, - 232,229,226,242,229,119,128, 5,158,232,229,226,242,229,119,128, - 5,244,244,225,237,225,242,107,128, 48, 19,104, 5, 90,151, 91, - 28, 91, 91, 91,116, 91,122, 97, 4, 90,161, 90,171, 90,194, 90, - 219,226,229,238,231,225,236,105,128, 9,152,100, 2, 90,177, 90, - 188,225,242,237,229,238,233,225,110,128, 5,114,229,246, 97,128, - 9, 24,231,117, 2, 90,201, 90,210,234,225,242,225,244,105,128, - 10,152,242,237,245,235,232,105,128, 10, 24,233,110, 4, 90,230, - 90,239, 90,253, 91, 13,225,242,225,226,233, 99,128, 6, 58,230, - 233,238,225,236,225,242,225,226,233, 99,128,254,206,233,238,233, - 244,233,225,236,225,242,225,226,233, 99,128,254,207,237,229,228, - 233,225,236,225,242,225,226,233, 99,128,254,208,101, 3, 91, 36, - 91, 57, 91, 74,237,233,228,228,236,229,232,239,239,235,227,249, - 242,233,236,236,233, 99,128, 4,149,243,244,242,239,235,229,227, - 249,242,233,236,236,233, 99,128, 4,147,245,240,244,245,242,238, - 227,249,242,233,236,236,233, 99,128, 4,145,232, 97, 2, 91, 98, - 91,105,228,229,246, 97,128, 9, 90,231,245,242,237,245,235,232, - 105,128, 10, 90,239,239,107,128, 2, 96,250,243,241,245,225,242, - 101,128, 51,147,105, 3, 91,140, 91,151, 91,162,232,233,242,225, - 231,225,238, 97,128, 48, 78,235,225,244,225,235,225,238, 97,128, - 48,174,109, 2, 91,168, 91,179,225,242,237,229,238,233,225,110, - 128, 5, 99,229,108,130, 5,210, 91,188, 91,208,228,225,231,229, - 243,104,129,251, 50, 91,199,232,229,226,242,229,119,128,251, 50, - 232,229,226,242,229,119,128, 5,210,234,229,227,249,242,233,236, - 236,233, 99,128, 4, 83,236,239,244,244,225,108, 2, 91,241, 92, - 2,233,238,246,229,242,244,229,228,243,244,242,239,235,101,128, - 1,190,243,244,239,112,132, 2,148, 92, 17, 92, 28, 92, 34, 92, - 66,233,238,246,229,242,244,229,100,128, 2,150,237,239,100,128, - 2,192,242,229,246,229,242,243,229,100,130, 2,149, 92, 49, 92, - 55,237,239,100,128, 2,193,243,245,240,229,242,233,239,114,128, - 2,228,243,244,242,239,235,101,129, 2,161, 92, 77,242,229,246, - 229,242,243,229,100,128, 2,162,109, 2, 92, 94, 92,102,225,227, - 242,239,110,128, 30, 33,239,238,239,243,240,225,227,101,128,255, - 71,111, 2, 92,119, 92,130,232,233,242,225,231,225,238, 97,128, - 48, 84,235,225,244,225,235,225,238, 97,128, 48,180,240, 97, 2, - 92,148, 92,154,242,229,110,128, 36,162,243,241,245,225,242,101, - 128, 51,172,114, 2, 92,169, 93, 10, 97, 2, 92,175, 92,183,228, - 233,229,238,116,128, 34, 7,246,101,134, 0, 96, 92,200, 92,211, - 92,228, 92,235, 92,244, 93, 0,226,229,236,239,247,227,237, 98, - 128, 3, 22, 99, 2, 92,217, 92,222,237, 98,128, 3, 0,239,237, - 98,128, 3, 0,228,229,246, 97,128, 9, 83,236,239,247,237,239, - 100,128, 2,206,237,239,238,239,243,240,225,227,101,128,255, 64, - 244,239,238,229,227,237, 98,128, 3, 64,229,225,244,229,114,132, - 0, 62, 93, 26, 93, 45, 93, 57, 93,100,229,241,245,225,108,129, - 34,101, 93, 36,239,242,236,229,243,115,128, 34,219,237,239,238, - 239,243,240,225,227,101,128,255, 30,111, 2, 93, 63, 93, 89,114, - 2, 93, 69, 93, 82,229,241,245,233,246,225,236,229,238,116,128, - 34,115,236,229,243,115,128, 34,119,246,229,242,229,241,245,225, - 108,128, 34,103,243,237,225,236,108,128,254,101,115, 2, 93,114, - 93,122,227,242,233,240,116,128, 2, 97,244,242,239,235,101,128, - 1,229,117, 4, 93,140, 93,151, 93,208, 93,219,232,233,242,225, - 231,225,238, 97,128, 48, 80,233,108, 2, 93,158, 93,183,236,229, - 237,239,116, 2, 93,168, 93,175,236,229,230,116,128, 0,171,242, - 233,231,232,116,128, 0,187,243,233,238,231,108, 2, 93,193, 93, - 200,236,229,230,116,128, 32, 57,242,233,231,232,116,128, 32, 58, - 235,225,244,225,235,225,238, 97,128, 48,176,242,225,237,245,243, - 241,245,225,242,101,128, 51, 24,249,243,241,245,225,242,101,128, - 51,201,104,144, 0,104, 94, 22, 96,164, 96,199, 96,236, 97, 20, - 98,164, 98,184, 99,149, 99,161, 99,173,100,241,100,249,101, 4, - 101, 13,101, 93,101, 97, 97, 13, 94, 50, 94, 89, 94, 99, 94,129, - 94,154, 94,232, 94,244, 95, 13, 95, 28, 95, 57, 95, 70, 95,128, - 95,137, 97, 2, 94, 56, 94, 75,226,235,232,225,243,233,225,238, - 227,249,242,233,236,236,233, 99,128, 4,169,236,244,239,238,229, - 225,242,225,226,233, 99,128, 6,193,226,229,238,231,225,236,105, - 128, 9,185,228,101, 2, 94,106, 94,124,243,227,229,238,228,229, - 242,227,249,242,233,236,236,233, 99,128, 4,179,246, 97,128, 9, - 57,231,117, 2, 94,136, 94,145,234,225,242,225,244,105,128, 10, - 185,242,237,245,235,232,105,128, 10, 57,104, 4, 94,164, 94,173, - 94,187, 94,217,225,242,225,226,233, 99,128, 6, 45,230,233,238, - 225,236,225,242,225,226,233, 99,128,254,162,105, 2, 94,193, 94, - 208,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,163, - 242,225,231,225,238, 97,128, 48,111,237,229,228,233,225,236,225, - 242,225,226,233, 99,128,254,164,233,244,245,243,241,245,225,242, - 101,128, 51, 42,235,225,244,225,235,225,238, 97,129, 48,207, 95, - 1,232,225,236,230,247,233,228,244,104,128,255,138,236,225,238, - 244,231,245,242,237,245,235,232,105,128, 10, 77,237,250, 97, 2, - 95, 36, 95, 45,225,242,225,226,233, 99,128, 6, 33,236,239,247, - 225,242,225,226,233, 99,128, 6, 33,238,231,245,236,230,233,236, - 236,229,114,128, 49,100,114, 2, 95, 76, 95, 92,228,243,233,231, - 238,227,249,242,233,236,236,233, 99,128, 4, 74,240,239,239,110, - 2, 95,101, 95,114,236,229,230,244,226,225,242,226,245,112,128, - 33,188,242,233,231,232,244,226,225,242,226,245,112,128, 33,192, - 243,241,245,225,242,101,128, 51,202,244,225,102, 3, 95,147, 95, - 239, 96, 74,240,225,244,225,104,134, 5,178, 95,167, 95,172, 95, - 186, 95,195, 95,210, 95,226,177, 54,128, 5,178, 50, 2, 95,178, - 95,182, 51,128, 5,178,102,128, 5,178,232,229,226,242,229,119, - 128, 5,178,238,225,242,242,239,247,232,229,226,242,229,119,128, - 5,178,241,245,225,242,244,229,242,232,229,226,242,229,119,128, - 5,178,247,233,228,229,232,229,226,242,229,119,128, 5,178,241, - 225,237,225,244,115,135, 5,179, 96, 6, 96, 11, 96, 16, 96, 21, - 96, 30, 96, 45, 96, 61,177, 98,128, 5,179,178, 56,128, 5,179, - 179, 52,128, 5,179,232,229,226,242,229,119,128, 5,179,238,225, - 242,242,239,247,232,229,226,242,229,119,128, 5,179,241,245,225, - 242,244,229,242,232,229,226,242,229,119,128, 5,179,247,233,228, - 229,232,229,226,242,229,119,128, 5,179,243,229,231,239,108,135, - 5,177, 96, 96, 96,101, 96,106, 96,111, 96,120, 96,135, 96,151, - 177, 55,128, 5,177,178, 52,128, 5,177,179, 48,128, 5,177,232, - 229,226,242,229,119,128, 5,177,238,225,242,242,239,247,232,229, - 226,242,229,119,128, 5,177,241,245,225,242,244,229,242,232,229, - 226,242,229,119,128, 5,177,247,233,228,229,232,229,226,242,229, - 119,128, 5,177, 98, 3, 96,172, 96,177, 96,187,225,114,128, 1, - 39,239,240,239,237,239,230,111,128, 49, 15,242,229,246,229,226, - 229,236,239,119,128, 30, 43, 99, 2, 96,205, 96,214,229,228,233, - 236,236, 97,128, 30, 41,233,242, 99, 2, 96,222, 96,227,236,101, - 128, 36,215,245,237,230,236,229,120,128, 1, 37,100, 2, 96,242, - 96,252,233,229,242,229,243,233,115,128, 30, 39,239,116, 2, 97, - 3, 97, 12,225,227,227,229,238,116,128, 30, 35,226,229,236,239, - 119,128, 30, 37,101,136, 5,212, 97, 40, 97, 73, 97, 93, 98, 66, - 98, 82, 98,127, 98,136, 98,149,225,242,116,129, 38,101, 97, 48, - 243,245,233,116, 2, 97, 57, 97, 65,226,236,225,227,107,128, 38, - 101,247,232,233,244,101,128, 38, 97,228,225,231,229,243,104,129, - 251, 52, 97, 84,232,229,226,242,229,119,128,251, 52,104, 6, 97, - 107, 97,135, 97,143, 97,193, 97,239, 98, 32, 97, 2, 97,113, 97, - 127,236,244,239,238,229,225,242,225,226,233, 99,128, 6,193,242, - 225,226,233, 99,128, 6, 71,229,226,242,229,119,128, 5,212,230, - 233,238,225,236, 97, 2, 97,154, 97,185,236,116, 2, 97,161, 97, - 173,239,238,229,225,242,225,226,233, 99,128,251,167,244,247,239, - 225,242,225,226,233, 99,128,254,234,242,225,226,233, 99,128,254, - 234,232,225,237,250,225,225,226,239,246,101, 2, 97,208, 97,222, - 230,233,238,225,236,225,242,225,226,233, 99,128,251,165,233,243, - 239,236,225,244,229,228,225,242,225,226,233, 99,128,251,164,105, - 2, 97,245, 98, 23,238,233,244,233,225,236, 97, 2, 98, 1, 98, - 15,236,244,239,238,229,225,242,225,226,233, 99,128,251,168,242, - 225,226,233, 99,128,254,235,242,225,231,225,238, 97,128, 48,120, - 237,229,228,233,225,236, 97, 2, 98, 44, 98, 58,236,244,239,238, - 229,225,242,225,226,233, 99,128,251,169,242,225,226,233, 99,128, - 254,236,233,243,229,233,229,242,225,243,241,245,225,242,101,128, - 51,123,107, 2, 98, 88, 98,112,225,244,225,235,225,238, 97,129, - 48,216, 98,100,232,225,236,230,247,233,228,244,104,128,255,141, - 245,244,225,225,242,245,243,241,245,225,242,101,128, 51, 54,238, - 231,232,239,239,107,128, 2,103,242,245,244,245,243,241,245,225, - 242,101,128, 51, 57,116,129, 5,215, 98,155,232,229,226,242,229, - 119,128, 5,215,232,239,239,107,129, 2,102, 98,173,243,245,240, - 229,242,233,239,114,128, 2,177,105, 4, 98,194, 99, 23, 99, 34, - 99, 59,229,245,104, 4, 98,206, 98,241, 99, 0, 99, 9, 97, 2, - 98,212, 98,227,227,233,242,227,236,229,235,239,242,229,225,110, - 128, 50,123,240,225,242,229,238,235,239,242,229,225,110,128, 50, - 27,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,109, - 235,239,242,229,225,110,128, 49, 78,240,225,242,229,238,235,239, - 242,229,225,110,128, 50, 13,232,233,242,225,231,225,238, 97,128, - 48,114,235,225,244,225,235,225,238, 97,129, 48,210, 99, 47,232, - 225,236,230,247,233,228,244,104,128,255,139,242,233,113,134, 5, - 180, 99, 77, 99, 82, 99, 96, 99,105, 99,120, 99,136,177, 52,128, - 5,180, 50, 2, 99, 88, 99, 92, 49,128, 5,180,100,128, 5,180, - 232,229,226,242,229,119,128, 5,180,238,225,242,242,239,247,232, - 229,226,242,229,119,128, 5,180,241,245,225,242,244,229,242,232, - 229,226,242,229,119,128, 5,180,247,233,228,229,232,229,226,242, - 229,119,128, 5,180,236,233,238,229,226,229,236,239,119,128, 30, - 150,237,239,238,239,243,240,225,227,101,128,255, 72,111, 9, 99, - 193, 99,204, 99,228, 99,253,100, 85,100, 98,100,184,100,224,100, - 235,225,242,237,229,238,233,225,110,128, 5,112,232,105, 2, 99, - 211, 99,219,240,244,232,225,105,128, 14, 43,242,225,231,225,238, - 97,128, 48,123,235,225,244,225,235,225,238, 97,129, 48,219, 99, - 241,232,225,236,230,247,233,228,244,104,128,255,142,236,225,109, - 135, 5,185,100, 17,100, 22,100, 27,100, 32,100, 41,100, 56,100, - 72,177, 57,128, 5,185,178, 54,128, 5,185,179, 50,128, 5,185, - 232,229,226,242,229,119,128, 5,185,238,225,242,242,239,247,232, - 229,226,242,229,119,128, 5,185,241,245,225,242,244,229,242,232, - 229,226,242,229,119,128, 5,185,247,233,228,229,232,229,226,242, - 229,119,128, 5,185,238,239,235,232,245,235,244,232,225,105,128, - 14, 46,111, 2,100,104,100,174,107, 4,100,114,100,126,100,132, - 100,154,225,226,239,246,229,227,239,237, 98,128, 3, 9,227,237, - 98,128, 3, 9,240,225,236,225,244,225,236,233,250,229,228,226, - 229,236,239,247,227,237, 98,128, 3, 33,242,229,244,242,239,230, - 236,229,248,226,229,236,239,247,227,237, 98,128, 3, 34,238,243, - 241,245,225,242,101,128, 51, 66,114, 2,100,190,100,217,105, 2, - 100,196,100,205,227,239,240,244,233, 99,128, 3,233,250,239,238, - 244,225,236,226,225,114,128, 32, 21,238,227,237, 98,128, 3, 27, - 244,243,240,242,233,238,231,115,128, 38,104,245,243,101,128, 35, - 2,240,225,242,229,110,128, 36,163,243,245,240,229,242,233,239, - 114,128, 2,176,244,245,242,238,229,100,128, 2,101,117, 4,101, - 23,101, 34,101, 47,101, 72,232,233,242,225,231,225,238, 97,128, - 48,117,233,233,244,239,243,241,245,225,242,101,128, 51, 51,235, - 225,244,225,235,225,238, 97,129, 48,213,101, 60,232,225,236,230, - 247,233,228,244,104,128,255,140,238,231,225,242,245,237,236,225, - 245,116,129, 2,221,101, 87,227,237, 98,128, 3, 11,118,128, 1, - 149,249,240,232,229,110,132, 0, 45,101,113,101,124,101,136,101, - 159,233,238,230,229,242,233,239,114,128,246,229,237,239,238,239, - 243,240,225,227,101,128,255, 13,115, 2,101,142,101,149,237,225, - 236,108,128,254, 99,245,240,229,242,233,239,114,128,246,230,244, - 247,111,128, 32, 16,105,149, 0,105,101,211,101,234,102, 12,102, - 59,105,197,106, 61,106, 98,106,125,107, 31,107, 35,107, 73,107, - 95,107,179,108, 88,108,163,108,171,108,184,109, 15,109, 72,109, - 100,109,144,225, 99, 2,101,218,101,224,245,244,101,128, 0,237, - 249,242,233,236,236,233, 99,128, 4, 79, 98, 3,101,242,101,251, - 102, 5,229,238,231,225,236,105,128, 9,135,239,240,239,237,239, - 230,111,128, 49, 39,242,229,246,101,128, 1, 45, 99, 3,102, 20, - 102, 27,102, 49,225,242,239,110,128, 1,208,233,242, 99, 2,102, - 35,102, 40,236,101,128, 36,216,245,237,230,236,229,120,128, 0, - 238,249,242,233,236,236,233, 99,128, 4, 86,100, 4,102, 69,102, - 79,105,154,105,187,226,236,231,242,225,246,101,128, 2, 9,101, - 2,102, 85,105,149,239,231,242,225,240,104, 7,102,106,102,120, - 102,133,105, 62,105, 93,105,106,105,118,229,225,242,244,232,227, - 233,242,227,236,101,128, 50,143,230,233,242,229,227,233,242,227, - 236,101,128, 50,139,233, 99, 14,102,164,102,180,103, 23,103, 77, - 103,143,103,172,103,188,103,245,104, 38,104, 50,104, 77,104,144, - 105, 26,105, 55,225,236,236,233,225,238,227,229,240,225,242,229, - 110,128, 50, 63, 99, 4,102,190,102,201,102,215,102,222,225,236, - 236,240,225,242,229,110,128, 50, 58,229,238,244,242,229,227,233, - 242,227,236,101,128, 50,165,236,239,243,101,128, 48, 6,111, 3, - 102,230,102,245,103, 9,237,237, 97,129, 48, 1,102,238,236,229, - 230,116,128,255,100,238,231,242,225,244,245,236,225,244,233,239, - 238,240,225,242,229,110,128, 50, 55,242,242,229,227,244,227,233, - 242,227,236,101,128, 50,163,101, 3,103, 31,103, 43,103, 60,225, - 242,244,232,240,225,242,229,110,128, 50, 47,238,244,229,242,240, - 242,233,243,229,240,225,242,229,110,128, 50, 61,248,227,229,236, - 236,229,238,244,227,233,242,227,236,101,128, 50,157,102, 2,103, - 83,103, 98,229,243,244,233,246,225,236,240,225,242,229,110,128, - 50, 64,105, 2,103,104,103,133,238,225,238,227,233,225,108, 2, - 103,116,103,125,227,233,242,227,236,101,128, 50,150,240,225,242, - 229,110,128, 50, 54,242,229,240,225,242,229,110,128, 50, 43,104, - 2,103,149,103,160,225,246,229,240,225,242,229,110,128, 50, 50, - 233,231,232,227,233,242,227,236,101,128, 50,164,233,244,229,242, - 225,244,233,239,238,237,225,242,107,128, 48, 5,108, 3,103,196, - 103,222,103,234,225,226,239,114, 2,103,205,103,214,227,233,242, - 227,236,101,128, 50,152,240,225,242,229,110,128, 50, 56,229,230, - 244,227,233,242,227,236,101,128, 50,167,239,247,227,233,242,227, - 236,101,128, 50,166,109, 2,103,251,104, 27,101, 2,104, 1,104, - 16,228,233,227,233,238,229,227,233,242,227,236,101,128, 50,169, - 244,225,236,240,225,242,229,110,128, 50, 46,239,239,238,240,225, - 242,229,110,128, 50, 42,238,225,237,229,240,225,242,229,110,128, - 50, 52,112, 2,104, 56,104, 64,229,242,233,239,100,128, 48, 2, - 242,233,238,244,227,233,242,227,236,101,128, 50,158,114, 2,104, - 83,104,131,101, 3,104, 91,104,102,104,117,225,227,232,240,225, - 242,229,110,128, 50, 67,240,242,229,243,229,238,244,240,225,242, - 229,110,128, 50, 57,243,239,245,242,227,229,240,225,242,229,110, - 128, 50, 62,233,231,232,244,227,233,242,227,236,101,128, 50,168, - 115, 5,104,156,104,185,104,199,104,224,104,252,101, 2,104,162, - 104,175,227,242,229,244,227,233,242,227,236,101,128, 50,153,236, - 230,240,225,242,229,110,128, 50, 66,239,227,233,229,244,249,240, - 225,242,229,110,128, 50, 51,112, 2,104,205,104,211,225,227,101, - 128, 48, 0,229,227,233,225,236,240,225,242,229,110,128, 50, 53, - 116, 2,104,230,104,241,239,227,235,240,225,242,229,110,128, 50, - 49,245,228,249,240,225,242,229,110,128, 50, 59,117, 2,105, 2, - 105, 11,238,240,225,242,229,110,128, 50, 48,240,229,242,246,233, - 243,229,240,225,242,229,110,128, 50, 60,119, 2,105, 32,105, 44, - 225,244,229,242,240,225,242,229,110,128, 50, 44,239,239,228,240, - 225,242,229,110,128, 50, 45,250,229,242,111,128, 48, 7,109, 2, - 105, 68,105, 81,229,244,225,236,227,233,242,227,236,101,128, 50, - 142,239,239,238,227,233,242,227,236,101,128, 50,138,238,225,237, - 229,227,233,242,227,236,101,128, 50,148,243,245,238,227,233,242, - 227,236,101,128, 50,144,119, 2,105,124,105,137,225,244,229,242, - 227,233,242,227,236,101,128, 50,140,239,239,228,227,233,242,227, - 236,101,128, 50,141,246, 97,128, 9, 7,233,229,242,229,243,233, - 115,130, 0,239,105,168,105,176,225,227,245,244,101,128, 30, 47, - 227,249,242,233,236,236,233, 99,128, 4,229,239,244,226,229,236, - 239,119,128, 30,203,101, 3,105,205,105,221,105,232,226,242,229, - 246,229,227,249,242,233,236,236,233, 99,128, 4,215,227,249,242, - 233,236,236,233, 99,128, 4, 53,245,238,103, 4,105,244,106, 23, - 106, 38,106, 47, 97, 2,105,250,106, 9,227,233,242,227,236,229, - 235,239,242,229,225,110,128, 50,117,240,225,242,229,238,235,239, - 242,229,225,110,128, 50, 21,227,233,242,227,236,229,235,239,242, - 229,225,110,128, 50,103,235,239,242,229,225,110,128, 49, 71,240, - 225,242,229,238,235,239,242,229,225,110,128, 50, 7,103, 2,106, - 67,106, 74,242,225,246,101,128, 0,236,117, 2,106, 80,106, 89, - 234,225,242,225,244,105,128, 10,135,242,237,245,235,232,105,128, - 10, 7,104, 2,106,104,106,114,233,242,225,231,225,238, 97,128, - 48, 68,239,239,235,225,226,239,246,101,128, 30,201,105, 8,106, - 143,106,153,106,164,106,171,106,196,106,212,106,227,106,243,226, - 229,238,231,225,236,105,128, 9,136,227,249,242,233,236,236,233, - 99,128, 4, 56,228,229,246, 97,128, 9, 8,231,117, 2,106,178, - 106,187,234,225,242,225,244,105,128, 10,136,242,237,245,235,232, - 105,128, 10, 8,237,225,244,242,225,231,245,242,237,245,235,232, - 105,128, 10, 64,238,246,229,242,244,229,228,226,242,229,246,101, - 128, 2, 11,243,232,239,242,244,227,249,242,233,236,236,233, 99, - 128, 4, 57,246,239,247,229,236,243,233,231,110, 3,107, 3,107, - 13,107, 20,226,229,238,231,225,236,105,128, 9,192,228,229,246, - 97,128, 9, 64,231,245,234,225,242,225,244,105,128, 10,192,106, - 128, 1, 51,107, 2,107, 41,107, 65,225,244,225,235,225,238, 97, - 129, 48,164,107, 53,232,225,236,230,247,233,228,244,104,128,255, - 114,239,242,229,225,110,128, 49, 99,108, 2,107, 79,107, 84,228, - 101,128, 2,220,245,249,232,229,226,242,229,119,128, 5,172,109, - 2,107,101,107,168, 97, 3,107,109,107,129,107,154,227,242,239, - 110,129, 1, 43,107,118,227,249,242,233,236,236,233, 99,128, 4, - 227,231,229,239,242,225,240,240,242,239,248,233,237,225,244,229, - 236,249,229,241,245,225,108,128, 34, 83,244,242,225,231,245,242, - 237,245,235,232,105,128, 10, 63,239,238,239,243,240,225,227,101, - 128,255, 73,110, 5,107,191,107,201,107,210,107,222,108, 50,227, - 242,229,237,229,238,116,128, 34, 6,230,233,238,233,244,121,128, - 34, 30,233,225,242,237,229,238,233,225,110,128, 5,107,116, 2, - 107,228,108, 40,101, 2,107,234,108, 29,231,242,225,108,131, 34, - 43,107,247,108, 9,108, 14, 98, 2,107,253,108, 5,239,244,244, - 239,109,128, 35, 33,116,128, 35, 33,229,120,128,248,245,116, 2, - 108, 20,108, 25,239,112,128, 35, 32,112,128, 35, 32,242,243,229, - 227,244,233,239,110,128, 34, 41,233,243,241,245,225,242,101,128, - 51, 5,118, 3,108, 58,108, 67,108, 76,226,245,236,236,229,116, - 128, 37,216,227,233,242,227,236,101,128, 37,217,243,237,233,236, - 229,230,225,227,101,128, 38, 59,111, 3,108, 96,108,107,108,115, - 227,249,242,233,236,236,233, 99,128, 4, 81,231,239,238,229,107, - 128, 1, 47,244, 97,131, 3,185,108,126,108,147,108,155,228,233, - 229,242,229,243,233,115,129, 3,202,108,139,244,239,238,239,115, - 128, 3,144,236,225,244,233,110,128, 2,105,244,239,238,239,115, - 128, 3,175,240,225,242,229,110,128, 36,164,242,233,231,245,242, - 237,245,235,232,105,128, 10,114,115, 4,108,194,108,239,108,253, - 109, 5,237,225,236,108, 2,108,203,108,214,232,233,242,225,231, - 225,238, 97,128, 48, 67,235,225,244,225,235,225,238, 97,129, 48, - 163,108,227,232,225,236,230,247,233,228,244,104,128,255,104,243, - 232,225,242,226,229,238,231,225,236,105,128, 9,250,244,242,239, - 235,101,128, 2,104,245,240,229,242,233,239,114,128,246,237,116, - 2,109, 21,109, 55,229,242,225,244,233,239,110, 2,109, 33,109, - 44,232,233,242,225,231,225,238, 97,128, 48,157,235,225,244,225, - 235,225,238, 97,128, 48,253,233,236,228,101,129, 1, 41,109, 64, - 226,229,236,239,119,128, 30, 45,117, 2,109, 78,109, 89,226,239, - 240,239,237,239,230,111,128, 49, 41,227,249,242,233,236,236,233, - 99,128, 4, 78,246,239,247,229,236,243,233,231,110, 3,109,116, - 109,126,109,133,226,229,238,231,225,236,105,128, 9,191,228,229, - 246, 97,128, 9, 63,231,245,234,225,242,225,244,105,128, 10,191, - 250,232,233,244,243, 97, 2,109,155,109,166,227,249,242,233,236, - 236,233, 99,128, 4,117,228,226,236,231,242,225,246,229,227,249, - 242,233,236,236,233, 99,128, 4,119,106,138, 0,106,109,209,110, - 16,110, 27,110, 77,110, 93,110,206,111, 19,111, 24,111, 36,111, - 44, 97, 4,109,219,109,230,109,240,109,247,225,242,237,229,238, - 233,225,110,128, 5,113,226,229,238,231,225,236,105,128, 9,156, - 228,229,246, 97,128, 9, 28,231,117, 2,109,254,110, 7,234,225, - 242,225,244,105,128, 10,156,242,237,245,235,232,105,128, 10, 28, - 226,239,240,239,237,239,230,111,128, 49, 16, 99, 3,110, 35,110, - 42,110, 64,225,242,239,110,128, 1,240,233,242, 99, 2,110, 50, - 110, 55,236,101,128, 36,217,245,237,230,236,229,120,128, 1, 53, - 242,239,243,243,229,228,244,225,233,108,128, 2,157,228,239,244, - 236,229,243,243,243,244,242,239,235,101,128, 2, 95,101, 3,110, - 101,110,112,110,177,227,249,242,233,236,236,233, 99,128, 4, 88, - 229,109, 4,110,123,110,132,110,146,110,162,225,242,225,226,233, - 99,128, 6, 44,230,233,238,225,236,225,242,225,226,233, 99,128, - 254,158,233,238,233,244,233,225,236,225,242,225,226,233, 99,128, - 254,159,237,229,228,233,225,236,225,242,225,226,233, 99,128,254, - 160,104, 2,110,183,110,192,225,242,225,226,233, 99,128, 6,152, - 230,233,238,225,236,225,242,225,226,233, 99,128,251,139,104, 2, - 110,212,111, 6, 97, 3,110,220,110,230,110,237,226,229,238,231, - 225,236,105,128, 9,157,228,229,246, 97,128, 9, 29,231,117, 2, - 110,244,110,253,234,225,242,225,244,105,128, 10,157,242,237,245, - 235,232,105,128, 10, 29,229,232,225,242,237,229,238,233,225,110, - 128, 5,123,233,115,128, 48, 4,237,239,238,239,243,240,225,227, - 101,128,255, 74,240,225,242,229,110,128, 36,165,243,245,240,229, - 242,233,239,114,128, 2,178,107,146, 0,107,111, 95,113,184,113, - 195,114, 1,114, 12,114,102,114,116,115,224,116,164,116,177,116, - 203,116,252,117,134,117,156,117,169,117,192,117,234,117,244, 97, - 12,111,121,111,153,111,175,111,205,112, 63,112, 88,112,118,112, - 143,112,249,113, 7,113,130,113,159, 98, 2,111,127,111,144,225, - 243,232,235,233,242,227,249,242,233,236,236,233, 99,128, 4,161, - 229,238,231,225,236,105,128, 9,149, 99, 2,111,159,111,165,245, - 244,101,128, 30, 49,249,242,233,236,236,233, 99,128, 4, 58,228, - 101, 2,111,182,111,200,243,227,229,238,228,229,242,227,249,242, - 233,236,236,233, 99,128, 4,155,246, 97,128, 9, 21,102,135, 5, - 219,111,223,111,232,111,252,112, 10,112, 19,112, 35,112, 50,225, - 242,225,226,233, 99,128, 6, 67,228,225,231,229,243,104,129,251, - 59,111,243,232,229,226,242,229,119,128,251, 59,230,233,238,225, - 236,225,242,225,226,233, 99,128,254,218,232,229,226,242,229,119, - 128, 5,219,233,238,233,244,233,225,236,225,242,225,226,233, 99, - 128,254,219,237,229,228,233,225,236,225,242,225,226,233, 99,128, - 254,220,242,225,230,229,232,229,226,242,229,119,128,251, 77,231, - 117, 2,112, 70,112, 79,234,225,242,225,244,105,128, 10,149,242, - 237,245,235,232,105,128, 10, 21,104, 2,112, 94,112,104,233,242, - 225,231,225,238, 97,128, 48, 75,239,239,235,227,249,242,233,236, - 236,233, 99,128, 4,196,235,225,244,225,235,225,238, 97,129, 48, - 171,112,131,232,225,236,230,247,233,228,244,104,128,255,118,112, - 2,112,149,112,170,240, 97,129, 3,186,112,156,243,249,237,226, - 239,236,231,242,229,229,107,128, 3,240,249,229,239,245,110, 3, - 112,182,112,196,112,230,237,233,229,245,237,235,239,242,229,225, - 110,128, 49,113,112, 2,112,202,112,217,232,233,229,245,240,232, - 235,239,242,229,225,110,128, 49,132,233,229,245,240,235,239,242, - 229,225,110,128, 49,120,243,243,225,238,231,240,233,229,245,240, - 235,239,242,229,225,110,128, 49,121,242,239,242,233,233,243,241, - 245,225,242,101,128, 51, 13,115, 5,113, 19,113, 63,113, 78,113, - 86,113,114,232,233,228,225,225,245,244,111, 2,113, 32,113, 41, - 225,242,225,226,233, 99,128, 6, 64,238,239,243,233,228,229,226, - 229,225,242,233,238,231,225,242,225,226,233, 99,128, 6, 64,237, - 225,236,236,235,225,244,225,235,225,238, 97,128, 48,245,241,245, - 225,242,101,128, 51,132,242, 97, 2,113, 93,113,102,225,242,225, - 226,233, 99,128, 6, 80,244,225,238,225,242,225,226,233, 99,128, - 6, 77,244,242,239,235,229,227,249,242,233,236,236,233, 99,128, - 4,159,244,225,232,233,242,225,240,242,239,236,239,238,231,237, - 225,242,235,232,225,236,230,247,233,228,244,104,128,255,112,246, - 229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242, - 233,236,236,233, 99,128, 4,157,226,239,240,239,237,239,230,111, - 128, 49, 14, 99, 4,113,205,113,227,113,236,113,244, 97, 2,113, - 211,113,221,236,243,241,245,225,242,101,128, 51,137,242,239,110, - 128, 1,233,229,228,233,236,236, 97,128, 1, 55,233,242,227,236, - 101,128, 36,218,239,237,237,225,225,227,227,229,238,116,128, 1, - 55,228,239,244,226,229,236,239,119,128, 30, 51,101, 4,114, 22, - 114, 49,114, 74,114, 86,104, 2,114, 28,114, 39,225,242,237,229, - 238,233,225,110,128, 5,132,233,242,225,231,225,238, 97,128, 48, - 81,235,225,244,225,235,225,238, 97,129, 48,177,114, 62,232,225, - 236,230,247,233,228,244,104,128,255,121,238,225,242,237,229,238, - 233,225,110,128, 5,111,243,237,225,236,236,235,225,244,225,235, - 225,238, 97,128, 48,246,231,242,229,229,238,236,225,238,228,233, - 99,128, 1, 56,104, 6,114,130,115, 3,115, 14,115, 39,115,126, - 115,214, 97, 5,114,142,114,152,114,163,114,170,114,195,226,229, - 238,231,225,236,105,128, 9,150,227,249,242,233,236,236,233, 99, - 128, 4, 69,228,229,246, 97,128, 9, 22,231,117, 2,114,177,114, - 186,234,225,242,225,244,105,128, 10,150,242,237,245,235,232,105, - 128, 10, 22,104, 4,114,205,114,214,114,228,114,244,225,242,225, - 226,233, 99,128, 6, 46,230,233,238,225,236,225,242,225,226,233, - 99,128,254,166,233,238,233,244,233,225,236,225,242,225,226,233, - 99,128,254,167,237,229,228,233,225,236,225,242,225,226,233, 99, - 128,254,168,229,233,227,239,240,244,233, 99,128, 3,231,232, 97, - 2,115, 21,115, 28,228,229,246, 97,128, 9, 89,231,245,242,237, - 245,235,232,105,128, 10, 89,233,229,245,235,104, 4,115, 53,115, - 88,115,103,115,112, 97, 2,115, 59,115, 74,227,233,242,227,236, - 229,235,239,242,229,225,110,128, 50,120,240,225,242,229,238,235, - 239,242,229,225,110,128, 50, 24,227,233,242,227,236,229,235,239, - 242,229,225,110,128, 50,106,235,239,242,229,225,110,128, 49, 75, - 240,225,242,229,238,235,239,242,229,225,110,128, 50, 10,111, 4, - 115,136,115,185,115,195,115,200,235,104, 4,115,147,115,156,115, - 165,115,175,225,233,244,232,225,105,128, 14, 2,239,238,244,232, - 225,105,128, 14, 5,245,225,244,244,232,225,105,128, 14, 3,247, - 225,233,244,232,225,105,128, 14, 4,237,245,244,244,232,225,105, - 128, 14, 91,239,107,128, 1,153,242,225,235,232,225,238,231,244, - 232,225,105,128, 14, 6,250,243,241,245,225,242,101,128, 51,145, - 105, 4,115,234,115,245,116, 14,116, 63,232,233,242,225,231,225, - 238, 97,128, 48, 77,235,225,244,225,235,225,238, 97,129, 48,173, - 116, 2,232,225,236,230,247,233,228,244,104,128,255,119,242,111, - 3,116, 23,116, 38,116, 54,231,245,242,225,237,245,243,241,245, - 225,242,101,128, 51, 21,237,229,229,244,239,242,245,243,241,245, - 225,242,101,128, 51, 22,243,241,245,225,242,101,128, 51, 20,249, - 229,239,107, 5,116, 78,116,113,116,128,116,137,116,151, 97, 2, - 116, 84,116, 99,227,233,242,227,236,229,235,239,242,229,225,110, - 128, 50,110,240,225,242,229,238,235,239,242,229,225,110,128, 50, - 14,227,233,242,227,236,229,235,239,242,229,225,110,128, 50, 96, - 235,239,242,229,225,110,128, 49, 49,240,225,242,229,238,235,239, - 242,229,225,110,128, 50, 0,243,233,239,243,235,239,242,229,225, - 110,128, 49, 51,234,229,227,249,242,233,236,236,233, 99,128, 4, - 92,108, 2,116,183,116,194,233,238,229,226,229,236,239,119,128, - 30, 53,243,241,245,225,242,101,128, 51,152,109, 3,116,211,116, - 225,116,236,227,245,226,229,228,243,241,245,225,242,101,128, 51, - 166,239,238,239,243,240,225,227,101,128,255, 75,243,241,245,225, - 242,229,228,243,241,245,225,242,101,128, 51,162,111, 5,117, 8, - 117, 34,117, 72,117, 84,117, 98,104, 2,117, 14,117, 24,233,242, - 225,231,225,238, 97,128, 48, 83,237,243,241,245,225,242,101,128, - 51,192,235, 97, 2,117, 41,117, 49,233,244,232,225,105,128, 14, - 1,244,225,235,225,238, 97,129, 48,179,117, 60,232,225,236,230, - 247,233,228,244,104,128,255,122,239,240,239,243,241,245,225,242, - 101,128, 51, 30,240,240,225,227,249,242,233,236,236,233, 99,128, - 4,129,114, 2,117,104,117,124,229,225,238,243,244,225,238,228, - 225,242,228,243,249,237,226,239,108,128, 50,127,239,238,233,243, - 227,237, 98,128, 3, 67,240, 97, 2,117,141,117,147,242,229,110, - 128, 36,166,243,241,245,225,242,101,128, 51,170,243,233,227,249, - 242,233,236,236,233, 99,128, 4,111,116, 2,117,175,117,184,243, - 241,245,225,242,101,128, 51,207,245,242,238,229,100,128, 2,158, - 117, 2,117,198,117,209,232,233,242,225,231,225,238, 97,128, 48, - 79,235,225,244,225,235,225,238, 97,129, 48,175,117,222,232,225, - 236,230,247,233,228,244,104,128,255,120,246,243,241,245,225,242, - 101,128, 51,184,247,243,241,245,225,242,101,128, 51,190,108,146, - 0,108,118, 38,120, 65,120, 94,120,160,120,198,121, 94,121,103, - 121,119,121,143,121,161,122, 23,122, 64,122,199,122,207,122,240, - 122,249,123, 1,123, 63, 97, 7,118, 54,118, 64,118, 71,118, 78, - 118,103,118,119,120, 53,226,229,238,231,225,236,105,128, 9,178, - 227,245,244,101,128, 1, 58,228,229,246, 97,128, 9, 50,231,117, - 2,118, 85,118, 94,234,225,242,225,244,105,128, 10,178,242,237, - 245,235,232,105,128, 10, 50,235,235,232,225,238,231,249,225,239, - 244,232,225,105,128, 14, 69,109, 10,118,141,119, 80,119, 97,119, - 135,119,149,119,168,119,184,119,204,119,224,119,247, 97, 2,118, - 147,119, 72,236,229,102, 4,118,159,118,173,119, 9,119, 26,230, - 233,238,225,236,225,242,225,226,233, 99,128,254,252,232,225,237, - 250, 97, 2,118,183,118,224,225,226,239,246,101, 2,118,193,118, - 207,230,233,238,225,236,225,242,225,226,233, 99,128,254,248,233, - 243,239,236,225,244,229,228,225,242,225,226,233, 99,128,254,247, - 226,229,236,239,119, 2,118,234,118,248,230,233,238,225,236,225, - 242,225,226,233, 99,128,254,250,233,243,239,236,225,244,229,228, - 225,242,225,226,233, 99,128,254,249,233,243,239,236,225,244,229, - 228,225,242,225,226,233, 99,128,254,251,237,225,228,228,225,225, - 226,239,246,101, 2,119, 41,119, 55,230,233,238,225,236,225,242, - 225,226,233, 99,128,254,246,233,243,239,236,225,244,229,228,225, - 242,225,226,233, 99,128,254,245,242,225,226,233, 99,128, 6, 68, - 226,228, 97,129, 3,187,119, 88,243,244,242,239,235,101,128, 1, - 155,229,100,130, 5,220,119,106,119,126,228,225,231,229,243,104, - 129,251, 60,119,117,232,229,226,242,229,119,128,251, 60,232,229, - 226,242,229,119,128, 5,220,230,233,238,225,236,225,242,225,226, - 233, 99,128,254,222,232,225,232,233,238,233,244,233,225,236,225, - 242,225,226,233, 99,128,252,202,233,238,233,244,233,225,236,225, - 242,225,226,233, 99,128,254,223,234,229,229,237,233,238,233,244, - 233,225,236,225,242,225,226,233, 99,128,252,201,235,232,225,232, - 233,238,233,244,233,225,236,225,242,225,226,233, 99,128,252,203, - 236,225,237,232,229,232,233,243,239,236,225,244,229,228,225,242, - 225,226,233, 99,128,253,242,237,101, 2,119,254,120, 11,228,233, - 225,236,225,242,225,226,233, 99,128,254,224,229,109, 2,120, 18, - 120, 37,232,225,232,233,238,233,244,233,225,236,225,242,225,226, - 233, 99,128,253,136,233,238,233,244,233,225,236,225,242,225,226, - 233, 99,128,252,204,242,231,229,227,233,242,227,236,101,128, 37, - 239, 98, 3,120, 73,120, 78,120, 84,225,114,128, 1,154,229,236, - 116,128, 2,108,239,240,239,237,239,230,111,128, 49, 12, 99, 4, - 120,104,120,111,120,120,120,147,225,242,239,110,128, 1, 62,229, - 228,233,236,236, 97,128, 1, 60,233,242, 99, 2,120,128,120,133, - 236,101,128, 36,219,245,237,230,236,229,248,226,229,236,239,119, - 128, 30, 61,239,237,237,225,225,227,227,229,238,116,128, 1, 60, - 228,239,116,130, 1, 64,120,170,120,179,225,227,227,229,238,116, - 128, 1, 64,226,229,236,239,119,129, 30, 55,120,189,237,225,227, - 242,239,110,128, 30, 57,101, 3,120,206,120,244,121, 89,230,116, - 2,120,213,120,229,225,238,231,236,229,225,226,239,246,229,227, - 237, 98,128, 3, 26,244,225,227,235,226,229,236,239,247,227,237, - 98,128, 3, 24,243,115,132, 0, 60,121, 1,121, 23,121, 35,121, - 81,229,241,245,225,108,129, 34,100,121, 11,239,242,231,242,229, - 225,244,229,114,128, 34,218,237,239,238,239,243,240,225,227,101, - 128,255, 28,111, 2,121, 41,121, 70,114, 2,121, 47,121, 60,229, - 241,245,233,246,225,236,229,238,116,128, 34,114,231,242,229,225, - 244,229,114,128, 34,118,246,229,242,229,241,245,225,108,128, 34, - 102,243,237,225,236,108,128,254,100,250,104,128, 2,110,230,226, - 236,239,227,107,128, 37,140,232,239,239,235,242,229,244,242,239, - 230,236,229,120,128, 2,109,105, 2,121,125,121,130,242, 97,128, - 32,164,247,238,225,242,237,229,238,233,225,110,128, 5,108,106, - 129, 1,201,121,149,229,227,249,242,233,236,236,233, 99,128, 4, - 89,108,132,246,192,121,173,121,197,121,208,121,217, 97, 2,121, - 179,121,186,228,229,246, 97,128, 9, 51,231,245,234,225,242,225, - 244,105,128, 10,179,233,238,229,226,229,236,239,119,128, 30, 59, - 236,225,228,229,246, 97,128, 9, 52,246,239,227,225,236,233, 99, - 3,121,231,121,241,121,248,226,229,238,231,225,236,105,128, 9, - 225,228,229,246, 97,128, 9, 97,246,239,247,229,236,243,233,231, - 110, 2,122, 6,122, 16,226,229,238,231,225,236,105,128, 9,227, - 228,229,246, 97,128, 9, 99,109, 3,122, 31,122, 44,122, 55,233, - 228,228,236,229,244,233,236,228,101,128, 2,107,239,238,239,243, - 240,225,227,101,128,255, 76,243,241,245,225,242,101,128, 51,208, - 111, 6,122, 78,122, 90,122,132,122,143,122,149,122,191,227,232, - 245,236,225,244,232,225,105,128, 14, 44,231,233,227,225,108, 3, - 122,102,122,108,122,127,225,238,100,128, 34, 39,238,239,116,129, - 0,172,122,116,242,229,246,229,242,243,229,100,128, 35, 16,239, - 114,128, 34, 40,236,233,238,231,244,232,225,105,128, 14, 37,238, - 231,115,128, 1,127,247,236,233,238,101, 2,122,159,122,182, 99, - 2,122,165,122,177,229,238,244,229,242,236,233,238,101,128,254, - 78,237, 98,128, 3, 50,228,225,243,232,229,100,128,254, 77,250, - 229,238,231,101,128, 37,202,240,225,242,229,110,128, 36,167,115, - 3,122,215,122,222,122,230,236,225,243,104,128, 1, 66,241,245, - 225,242,101,128, 33, 19,245,240,229,242,233,239,114,128,246,238, - 244,243,232,225,228,101,128, 37,145,245,244,232,225,105,128, 14, - 38,246,239,227,225,236,233, 99, 3,123, 15,123, 25,123, 32,226, - 229,238,231,225,236,105,128, 9,140,228,229,246, 97,128, 9, 12, - 246,239,247,229,236,243,233,231,110, 2,123, 46,123, 56,226,229, - 238,231,225,236,105,128, 9,226,228,229,246, 97,128, 9, 98,248, - 243,241,245,225,242,101,128, 51,211,109,144, 0,109,123,109,125, - 218,125,243,126, 14,126, 39,127, 92,127,114,128,169,128,199,128, - 248,129, 99,129,121,129,146,129,155,130,182,130,210, 97, 12,123, - 135,123,145,123,209,123,216,123,241,124, 33,125,125,125,150,125, - 155,125,169,125,181,125,186,226,229,238,231,225,236,105,128, 9, - 174, 99, 2,123,151,123,203,242,239,110,132, 0,175,123,165,123, - 176,123,182,123,191,226,229,236,239,247,227,237, 98,128, 3, 49, - 227,237, 98,128, 3, 4,236,239,247,237,239,100,128, 2,205,237, - 239,238,239,243,240,225,227,101,128,255,227,245,244,101,128, 30, - 63,228,229,246, 97,128, 9, 46,231,117, 2,123,223,123,232,234, - 225,242,225,244,105,128, 10,174,242,237,245,235,232,105,128, 10, - 46,104, 2,123,247,124, 23,225,240,225,235,104, 2,124, 1,124, - 10,232,229,226,242,229,119,128, 5,164,236,229,230,244,232,229, - 226,242,229,119,128, 5,164,233,242,225,231,225,238, 97,128, 48, - 126,105, 5,124, 45,124,114,124,177,124,207,125,113,227,232,225, - 244,244,225,247, 97, 3,124, 60,124, 91,124, 98,236,239,119, 2, - 124, 68,124, 79,236,229,230,244,244,232,225,105,128,248,149,242, - 233,231,232,244,244,232,225,105,128,248,148,244,232,225,105,128, - 14, 75,245,240,240,229,242,236,229,230,244,244,232,225,105,128, - 248,147,229,107, 3,124,123,124,154,124,161,236,239,119, 2,124, - 131,124,142,236,229,230,244,244,232,225,105,128,248,140,242,233, - 231,232,244,244,232,225,105,128,248,139,244,232,225,105,128, 14, - 72,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248, - 138,232,225,238,225,235,225,116, 2,124,189,124,200,236,229,230, - 244,244,232,225,105,128,248,132,244,232,225,105,128, 14, 49,116, - 3,124,215,124,243,125, 50,225,233,235,232,117, 2,124,225,124, - 236,236,229,230,244,244,232,225,105,128,248,137,244,232,225,105, - 128, 14, 71,232,111, 3,124,252,125, 27,125, 34,236,239,119, 2, - 125, 4,125, 15,236,229,230,244,244,232,225,105,128,248,143,242, - 233,231,232,244,244,232,225,105,128,248,142,244,232,225,105,128, - 14, 73,245,240,240,229,242,236,229,230,244,244,232,225,105,128, - 248,141,242,105, 3,125, 59,125, 90,125, 97,236,239,119, 2,125, - 67,125, 78,236,229,230,244,244,232,225,105,128,248,146,242,233, - 231,232,244,244,232,225,105,128,248,145,244,232,225,105,128, 14, - 74,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248, - 144,249,225,237,239,235,244,232,225,105,128, 14, 70,235,225,244, - 225,235,225,238, 97,129, 48,222,125,138,232,225,236,230,247,233, - 228,244,104,128,255,143,236,101,128, 38, 66,238,243,249,239,238, - 243,241,245,225,242,101,128, 51, 71,241,225,230,232,229,226,242, - 229,119,128, 5,190,242,115,128, 38, 66,115, 2,125,192,125,210, - 239,242,225,227,233,242,227,236,229,232,229,226,242,229,119,128, - 5,175,241,245,225,242,101,128, 51,131, 98, 2,125,224,125,234, - 239,240,239,237,239,230,111,128, 49, 7,243,241,245,225,242,101, - 128, 51,212, 99, 2,125,249,126, 1,233,242,227,236,101,128, 36, - 220,245,226,229,228,243,241,245,225,242,101,128, 51,165,228,239, - 116, 2,126, 22,126, 31,225,227,227,229,238,116,128, 30, 65,226, - 229,236,239,119,128, 30, 67,101, 7,126, 55,126,182,126,193,126, - 208,126,233,127, 14,127, 26,101, 2,126, 61,126,169,109, 4,126, - 71,126, 80,126, 94,126,110,225,242,225,226,233, 99,128, 6, 69, - 230,233,238,225,236,225,242,225,226,233, 99,128,254,226,233,238, - 233,244,233,225,236,225,242,225,226,233, 99,128,254,227,237,101, - 2,126,117,126,130,228,233,225,236,225,242,225,226,233, 99,128, - 254,228,229,237,105, 2,126,138,126,153,238,233,244,233,225,236, - 225,242,225,226,233, 99,128,252,209,243,239,236,225,244,229,228, - 225,242,225,226,233, 99,128,252, 72,244,239,242,245,243,241,245, - 225,242,101,128, 51, 77,232,233,242,225,231,225,238, 97,128, 48, - 129,233,250,233,229,242,225,243,241,245,225,242,101,128, 51,126, - 235,225,244,225,235,225,238, 97,129, 48,225,126,221,232,225,236, - 230,247,233,228,244,104,128,255,146,109,130, 5,222,126,241,127, - 5,228,225,231,229,243,104,129,251, 62,126,252,232,229,226,242, - 229,119,128,251, 62,232,229,226,242,229,119,128, 5,222,238,225, - 242,237,229,238,233,225,110,128, 5,116,242,235,232, 97, 3,127, - 37,127, 46,127, 79,232,229,226,242,229,119,128, 5,165,235,229, - 230,245,236, 97, 2,127, 57,127, 66,232,229,226,242,229,119,128, - 5,166,236,229,230,244,232,229,226,242,229,119,128, 5,166,236, - 229,230,244,232,229,226,242,229,119,128, 5,165,104, 2,127, 98, - 127,104,239,239,107,128, 2,113,250,243,241,245,225,242,101,128, - 51,146,105, 6,127,128,127,165,128, 46,128, 57,128, 82,128,139, - 228,100, 2,127,135,127,160,236,229,228,239,244,235,225,244,225, - 235,225,238,225,232,225,236,230,247,233,228,244,104,128,255,101, - 239,116,128, 0,183,229,245,109, 5,127,179,127,214,127,229,127, - 238,128, 33, 97, 2,127,185,127,200,227,233,242,227,236,229,235, - 239,242,229,225,110,128, 50,114,240,225,242,229,238,235,239,242, - 229,225,110,128, 50, 18,227,233,242,227,236,229,235,239,242,229, - 225,110,128, 50,100,235,239,242,229,225,110,128, 49, 65,112, 2, - 127,244,128, 20, 97, 2,127,250,128, 8,238,243,233,239,243,235, - 239,242,229,225,110,128, 49,112,242,229,238,235,239,242,229,225, - 110,128, 50, 4,233,229,245,240,235,239,242,229,225,110,128, 49, - 110,243,233,239,243,235,239,242,229,225,110,128, 49,111,232,233, - 242,225,231,225,238, 97,128, 48,127,235,225,244,225,235,225,238, - 97,129, 48,223,128, 70,232,225,236,230,247,233,228,244,104,128, - 255,144,238,117, 2,128, 89,128,134,115,132, 34, 18,128,101,128, - 112,128,121,128,127,226,229,236,239,247,227,237, 98,128, 3, 32, - 227,233,242,227,236,101,128, 34,150,237,239,100,128, 2,215,240, - 236,245,115,128, 34, 19,244,101,128, 32, 50,242,105, 2,128,146, - 128,160,226,225,225,242,245,243,241,245,225,242,101,128, 51, 74, - 243,241,245,225,242,101,128, 51, 73,108, 2,128,175,128,190,239, - 238,231,236,229,231,244,245,242,238,229,100,128, 2,112,243,241, - 245,225,242,101,128, 51,150,109, 3,128,207,128,221,128,232,227, - 245,226,229,228,243,241,245,225,242,101,128, 51,163,239,238,239, - 243,240,225,227,101,128,255, 77,243,241,245,225,242,229,228,243, - 241,245,225,242,101,128, 51,159,111, 5,129, 4,129, 30,129, 55, - 129, 65,129, 74,104, 2,129, 10,129, 20,233,242,225,231,225,238, - 97,128, 48,130,237,243,241,245,225,242,101,128, 51,193,235,225, - 244,225,235,225,238, 97,129, 48,226,129, 43,232,225,236,230,247, - 233,228,244,104,128,255,147,236,243,241,245,225,242,101,128, 51, - 214,237,225,244,232,225,105,128, 14, 33,246,229,242,243,243,241, - 245,225,242,101,129, 51,167,129, 89,228,243,241,245,225,242,101, - 128, 51,168,240, 97, 2,129,106,129,112,242,229,110,128, 36,168, - 243,241,245,225,242,101,128, 51,171,115, 2,129,127,129,136,243, - 241,245,225,242,101,128, 51,179,245,240,229,242,233,239,114,128, - 246,239,244,245,242,238,229,100,128, 2,111,117,141, 0,181,129, - 185,129,189,129,199,129,223,129,233,129,255,130, 10,130, 35,130, - 58,130, 68,130, 98,130,162,130,172, 49,128, 0,181,225,243,241, - 245,225,242,101,128, 51,130,227,104, 2,129,206,129,216,231,242, - 229,225,244,229,114,128, 34,107,236,229,243,115,128, 34,106,230, - 243,241,245,225,242,101,128, 51,140,103, 2,129,239,129,246,242, - 229,229,107,128, 3,188,243,241,245,225,242,101,128, 51,141,232, - 233,242,225,231,225,238, 97,128, 48,128,235,225,244,225,235,225, - 238, 97,129, 48,224,130, 23,232,225,236,230,247,233,228,244,104, - 128,255,145,108, 2,130, 41,130, 50,243,241,245,225,242,101,128, - 51,149,244,233,240,236,121,128, 0,215,237,243,241,245,225,242, - 101,128, 51,155,238,225,104, 2,130, 76,130, 85,232,229,226,242, - 229,119,128, 5,163,236,229,230,244,232,229,226,242,229,119,128, - 5,163,115, 2,130,104,130,153,233, 99, 3,130,113,130,130,130, - 141,225,236,238,239,244,101,129, 38,106,130,124,228,226,108,128, - 38,107,230,236,225,244,243,233,231,110,128, 38,109,243,232,225, - 242,240,243,233,231,110,128, 38,111,243,241,245,225,242,101,128, - 51,178,246,243,241,245,225,242,101,128, 51,182,247,243,241,245, - 225,242,101,128, 51,188,118, 2,130,188,130,201,237,229,231,225, - 243,241,245,225,242,101,128, 51,185,243,241,245,225,242,101,128, - 51,183,119, 2,130,216,130,229,237,229,231,225,243,241,245,225, - 242,101,128, 51,191,243,241,245,225,242,101,128, 51,189,110,150, - 0,110,131, 30,131,164,131,188,131,254,132, 23,132, 81,132, 91, - 132,158,132,201,134,235,134,253,135, 22,135, 53,135, 79,135,144, - 137,126,137,134,137,159,137,167,138,135,138,145,138,155, 97, 8, - 131, 48,131, 68,131, 75,131, 82,131,107,131,118,131,143,131,155, - 98, 2,131, 54,131, 63,229,238,231,225,236,105,128, 9,168,236, - 97,128, 34, 7,227,245,244,101,128, 1, 68,228,229,246, 97,128, - 9, 40,231,117, 2,131, 89,131, 98,234,225,242,225,244,105,128, - 10,168,242,237,245,235,232,105,128, 10, 40,232,233,242,225,231, - 225,238, 97,128, 48,106,235,225,244,225,235,225,238, 97,129, 48, - 202,131,131,232,225,236,230,247,233,228,244,104,128,255,133,240, - 239,243,244,242,239,240,232,101,128, 1, 73,243,241,245,225,242, - 101,128, 51,129, 98, 2,131,170,131,180,239,240,239,237,239,230, - 111,128, 49, 11,243,240,225,227,101,128, 0,160, 99, 4,131,198, - 131,205,131,214,131,241,225,242,239,110,128, 1, 72,229,228,233, - 236,236, 97,128, 1, 70,233,242, 99, 2,131,222,131,227,236,101, - 128, 36,221,245,237,230,236,229,248,226,229,236,239,119,128, 30, - 75,239,237,237,225,225,227,227,229,238,116,128, 1, 70,228,239, - 116, 2,132, 6,132, 15,225,227,227,229,238,116,128, 30, 69,226, - 229,236,239,119,128, 30, 71,101, 3,132, 31,132, 42,132, 67,232, - 233,242,225,231,225,238, 97,128, 48,109,235,225,244,225,235,225, - 238, 97,129, 48,205,132, 55,232,225,236,230,247,233,228,244,104, - 128,255,136,247,243,232,229,241,229,236,243,233,231,110,128, 32, - 170,230,243,241,245,225,242,101,128, 51,139,103, 2,132, 97,132, - 147, 97, 3,132,105,132,115,132,122,226,229,238,231,225,236,105, - 128, 9,153,228,229,246, 97,128, 9, 25,231,117, 2,132,129,132, - 138,234,225,242,225,244,105,128, 10,153,242,237,245,235,232,105, - 128, 10, 25,239,238,231,245,244,232,225,105,128, 14, 7,104, 2, - 132,164,132,174,233,242,225,231,225,238, 97,128, 48,147,239,239, - 107, 2,132,182,132,189,236,229,230,116,128, 2,114,242,229,244, - 242,239,230,236,229,120,128, 2,115,105, 4,132,211,133,124,133, - 135,133,193,229,245,110, 7,132,229,133, 8,133, 40,133, 54,133, - 63,133, 96,133,109, 97, 2,132,235,132,250,227,233,242,227,236, - 229,235,239,242,229,225,110,128, 50,111,240,225,242,229,238,235, - 239,242,229,225,110,128, 50, 15,227,105, 2,133, 15,133, 27,229, - 245,227,235,239,242,229,225,110,128, 49, 53,242,227,236,229,235, - 239,242,229,225,110,128, 50, 97,232,233,229,245,232,235,239,242, - 229,225,110,128, 49, 54,235,239,242,229,225,110,128, 49, 52,240, - 97, 2,133, 70,133, 84,238,243,233,239,243,235,239,242,229,225, - 110,128, 49,104,242,229,238,235,239,242,229,225,110,128, 50, 1, - 243,233,239,243,235,239,242,229,225,110,128, 49,103,244,233,235, - 229,245,244,235,239,242,229,225,110,128, 49,102,232,233,242,225, - 231,225,238, 97,128, 48,107,107, 2,133,141,133,165,225,244,225, - 235,225,238, 97,129, 48,203,133,153,232,225,236,230,247,233,228, - 244,104,128,255,134,232,225,232,233,116, 2,133,175,133,186,236, - 229,230,244,244,232,225,105,128,248,153,244,232,225,105,128, 14, - 77,238,101,141, 0, 57,133,224,133,233,133,243,134, 17,134, 24, - 134, 49,134, 76,134,110,134,122,134,133,134,166,134,174,134,185, - 225,242,225,226,233, 99,128, 6,105,226,229,238,231,225,236,105, - 128, 9,239,227,233,242,227,236,101,129, 36,104,133,254,233,238, - 246,229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39, - 146,228,229,246, 97,128, 9,111,231,117, 2,134, 31,134, 40,234, - 225,242,225,244,105,128, 10,239,242,237,245,235,232,105,128, 10, - 111,232, 97, 2,134, 56,134, 67,227,235,225,242,225,226,233, 99, - 128, 6,105,238,231,250,232,239,117,128, 48, 41,105, 2,134, 82, - 134,100,228,229,239,231,242,225,240,232,233,227,240,225,242,229, - 110,128, 50, 40,238,230,229,242,233,239,114,128, 32,137,237,239, - 238,239,243,240,225,227,101,128,255, 25,239,236,228,243,244,249, - 236,101,128,247, 57,112, 2,134,139,134,146,225,242,229,110,128, - 36,124,229,114, 2,134,153,134,159,233,239,100,128, 36,144,243, - 233,225,110,128, 6,249,242,239,237,225,110,128, 33,120,243,245, - 240,229,242,233,239,114,128, 32,121,116, 2,134,191,134,229,229, - 229,110, 2,134,199,134,208,227,233,242,227,236,101,128, 36,114, - 112, 2,134,214,134,221,225,242,229,110,128, 36,134,229,242,233, - 239,100,128, 36,154,232,225,105,128, 14, 89,106,129, 1,204,134, - 241,229,227,249,242,233,236,236,233, 99,128, 4, 90,235,225,244, - 225,235,225,238, 97,129, 48,243,135, 10,232,225,236,230,247,233, - 228,244,104,128,255,157,108, 2,135, 28,135, 42,229,231,242,233, - 231,232,244,236,239,238,103,128, 1,158,233,238,229,226,229,236, - 239,119,128, 30, 73,109, 2,135, 59,135, 70,239,238,239,243,240, - 225,227,101,128,255, 78,243,241,245,225,242,101,128, 51,154,110, - 2,135, 85,135,135, 97, 3,135, 93,135,103,135,110,226,229,238, - 231,225,236,105,128, 9,163,228,229,246, 97,128, 9, 35,231,117, - 2,135,117,135,126,234,225,242,225,244,105,128, 10,163,242,237, - 245,235,232,105,128, 10, 35,238,225,228,229,246, 97,128, 9, 41, - 111, 6,135,158,135,169,135,194,135,235,136,187,137,114,232,233, - 242,225,231,225,238, 97,128, 48,110,235,225,244,225,235,225,238, - 97,129, 48,206,135,182,232,225,236,230,247,233,228,244,104,128, - 255,137,110, 3,135,202,135,218,135,227,226,242,229,225,235,233, - 238,231,243,240,225,227,101,128, 0,160,229,238,244,232,225,105, - 128, 14, 19,245,244,232,225,105,128, 14, 25,239,110, 7,135,252, - 136, 5,136, 19,136, 53,136, 69,136,110,136,169,225,242,225,226, - 233, 99,128, 6, 70,230,233,238,225,236,225,242,225,226,233, 99, - 128,254,230,231,232,245,238,238, 97, 2,136, 30,136, 39,225,242, - 225,226,233, 99,128, 6,186,230,233,238,225,236,225,242,225,226, - 233, 99,128,251,159,233,238,233,244,233,225,236,225,242,225,226, - 233, 99,128,254,231,234,229,229,237,105, 2,136, 79,136, 94,238, - 233,244,233,225,236,225,242,225,226,233, 99,128,252,210,243,239, - 236,225,244,229,228,225,242,225,226,233, 99,128,252, 75,237,101, - 2,136,117,136,130,228,233,225,236,225,242,225,226,233, 99,128, - 254,232,229,237,105, 2,136,138,136,153,238,233,244,233,225,236, - 225,242,225,226,233, 99,128,252,213,243,239,236,225,244,229,228, - 225,242,225,226,233, 99,128,252, 78,238,239,239,238,230,233,238, - 225,236,225,242,225,226,233, 99,128,252,141,116, 7,136,203,136, - 214,136,243,137, 22,137, 34,137, 54,137, 80,227,239,238,244,225, - 233,238,115,128, 34, 12,101, 2,136,220,136,236,236,229,237,229, - 238,116,129, 34, 9,136,231,239,102,128, 34, 9,241,245,225,108, - 128, 34, 96,231,242,229,225,244,229,114,129, 34,111,136,255,238, - 239,114, 2,137, 7,137, 15,229,241,245,225,108,128, 34,113,236, - 229,243,115,128, 34,121,233,228,229,238,244,233,227,225,108,128, - 34, 98,236,229,243,115,129, 34,110,137, 43,238,239,242,229,241, - 245,225,108,128, 34,112,112, 2,137, 60,137, 70,225,242,225,236, - 236,229,108,128, 34, 38,242,229,227,229,228,229,115,128, 34,128, - 243,117, 3,137, 89,137, 96,137,105,226,243,229,116,128, 34,132, - 227,227,229,229,228,115,128, 34,129,240,229,242,243,229,116,128, - 34,133,247,225,242,237,229,238,233,225,110,128, 5,118,240,225, - 242,229,110,128, 36,169,115, 2,137,140,137,149,243,241,245,225, - 242,101,128, 51,177,245,240,229,242,233,239,114,128, 32,127,244, - 233,236,228,101,128, 0,241,117,132, 3,189,137,179,137,190,138, - 15,138, 98,232,233,242,225,231,225,238, 97,128, 48,108,107, 2, - 137,196,137,220,225,244,225,235,225,238, 97,129, 48,204,137,208, - 232,225,236,230,247,233,228,244,104,128,255,135,244, 97, 3,137, - 229,137,239,137,246,226,229,238,231,225,236,105,128, 9,188,228, - 229,246, 97,128, 9, 60,231,117, 2,137,253,138, 6,234,225,242, - 225,244,105,128, 10,188,242,237,245,235,232,105,128, 10, 60,109, - 2,138, 21,138, 55,226,229,242,243,233,231,110,130, 0, 35,138, - 35,138, 47,237,239,238,239,243,240,225,227,101,128,255, 3,243, - 237,225,236,108,128,254, 95,229,114, 2,138, 62,138, 94,225,236, - 243,233,231,110, 2,138, 73,138, 81,231,242,229,229,107,128, 3, - 116,236,239,247,229,242,231,242,229,229,107,128, 3,117,111,128, - 33, 22,110,130, 5,224,138,106,138,126,228,225,231,229,243,104, - 129,251, 64,138,117,232,229,226,242,229,119,128,251, 64,232,229, - 226,242,229,119,128, 5,224,246,243,241,245,225,242,101,128, 51, - 181,247,243,241,245,225,242,101,128, 51,187,249, 97, 3,138,164, - 138,174,138,181,226,229,238,231,225,236,105,128, 9,158,228,229, - 246, 97,128, 9, 30,231,117, 2,138,188,138,197,234,225,242,225, - 244,105,128, 10,158,242,237,245,235,232,105,128, 10, 30,111,147, - 0,111,138,248,139, 14,139, 92,140, 6,140, 78,140, 93,140,133, - 141, 0,141, 21,141, 59,141, 70,141,248,143, 82,143,146,143,179, - 143,225,144, 98,144,145,144,157, 97, 2,138,254,139, 5,227,245, - 244,101,128, 0,243,238,231,244,232,225,105,128, 14, 45, 98, 4, - 139, 24,139, 66,139, 75,139, 85,225,242,242,229,100,130, 2,117, - 139, 36,139, 47,227,249,242,233,236,236,233, 99,128, 4,233,228, - 233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128, - 4,235,229,238,231,225,236,105,128, 9,147,239,240,239,237,239, - 230,111,128, 49, 27,242,229,246,101,128, 1, 79, 99, 3,139,100, - 139,173,139,252, 97, 2,139,106,139,167,238,228,242, 97, 3,139, - 117,139,124,139,135,228,229,246, 97,128, 9, 17,231,245,234,225, - 242,225,244,105,128, 10,145,246,239,247,229,236,243,233,231,110, - 2,139,149,139,156,228,229,246, 97,128, 9, 73,231,245,234,225, - 242,225,244,105,128, 10,201,242,239,110,128, 1,210,233,242, 99, - 2,139,181,139,186,236,101,128, 36,222,245,237,230,236,229,120, - 133, 0,244,139,205,139,213,139,224,139,232,139,244,225,227,245, - 244,101,128, 30,209,228,239,244,226,229,236,239,119,128, 30,217, - 231,242,225,246,101,128, 30,211,232,239,239,235,225,226,239,246, - 101,128, 30,213,244,233,236,228,101,128, 30,215,249,242,233,236, - 236,233, 99,128, 4, 62,100, 4,140, 16,140, 39,140, 45,140, 68, - 226,108, 2,140, 23,140, 31,225,227,245,244,101,128, 1, 81,231, - 242,225,246,101,128, 2, 13,229,246, 97,128, 9, 19,233,229,242, - 229,243,233,115,129, 0,246,140, 57,227,249,242,233,236,236,233, - 99,128, 4,231,239,244,226,229,236,239,119,128, 30,205,101,129, - 1, 83,140, 84,235,239,242,229,225,110,128, 49, 90,103, 3,140, - 101,140,116,140,123,239,238,229,107,129, 2,219,140,110,227,237, - 98,128, 3, 40,242,225,246,101,128, 0,242,245,234,225,242,225, - 244,105,128, 10,147,104, 4,140,143,140,154,140,164,140,242,225, - 242,237,229,238,233,225,110,128, 5,133,233,242,225,231,225,238, - 97,128, 48, 74,111, 2,140,170,140,180,239,235,225,226,239,246, - 101,128, 30,207,242,110,133, 1,161,140,195,140,203,140,214,140, - 222,140,234,225,227,245,244,101,128, 30,219,228,239,244,226,229, - 236,239,119,128, 30,227,231,242,225,246,101,128, 30,221,232,239, - 239,235,225,226,239,246,101,128, 30,223,244,233,236,228,101,128, - 30,225,245,238,231,225,242,245,237,236,225,245,116,128, 1, 81, - 105,129, 1,163,141, 6,238,246,229,242,244,229,228,226,242,229, - 246,101,128, 2, 15,107, 2,141, 27,141, 51,225,244,225,235,225, - 238, 97,129, 48,170,141, 39,232,225,236,230,247,233,228,244,104, - 128,255,117,239,242,229,225,110,128, 49, 87,236,229,232,229,226, - 242,229,119,128, 5,171,109, 6,141, 84,141,112,141,119,141,208, - 141,219,141,237,225,227,242,239,110,130, 1, 77,141, 96,141,104, - 225,227,245,244,101,128, 30, 83,231,242,225,246,101,128, 30, 81, - 228,229,246, 97,128, 9, 80,229,231, 97,133, 3,201,141,135,141, - 139,141,150,141,164,141,180, 49,128, 3,214,227,249,242,233,236, - 236,233, 99,128, 4, 97,236,225,244,233,238,227,236,239,243,229, - 100,128, 2,119,242,239,245,238,228,227,249,242,233,236,236,233, - 99,128, 4,123,116, 2,141,186,141,201,233,244,236,239,227,249, - 242,233,236,236,233, 99,128, 4,125,239,238,239,115,128, 3,206, - 231,245,234,225,242,225,244,105,128, 10,208,233,227,242,239,110, - 129, 3,191,141,229,244,239,238,239,115,128, 3,204,239,238,239, - 243,240,225,227,101,128,255, 79,238,101,145, 0, 49,142, 31,142, - 40,142, 50,142, 80,142,105,142,114,142,123,142,148,142,182,142, - 216,142,228,142,247,143, 2,143, 35,143, 45,143, 53,143, 64,225, - 242,225,226,233, 99,128, 6, 97,226,229,238,231,225,236,105,128, - 9,231,227,233,242,227,236,101,129, 36, 96,142, 61,233,238,246, - 229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,138, - 100, 2,142, 86,142, 92,229,246, 97,128, 9,103,239,244,229,238, - 236,229,225,228,229,114,128, 32, 36,229,233,231,232,244,104,128, - 33, 91,230,233,244,244,229,100,128,246,220,231,117, 2,142,130, - 142,139,234,225,242,225,244,105,128, 10,231,242,237,245,235,232, - 105,128, 10,103,232, 97, 3,142,157,142,168,142,173,227,235,225, - 242,225,226,233, 99,128, 6, 97,236,102,128, 0,189,238,231,250, - 232,239,117,128, 48, 33,105, 2,142,188,142,206,228,229,239,231, - 242,225,240,232,233,227,240,225,242,229,110,128, 50, 32,238,230, - 229,242,233,239,114,128, 32,129,237,239,238,239,243,240,225,227, - 101,128,255, 17,238,245,237,229,242,225,244,239,242,226,229,238, - 231,225,236,105,128, 9,244,239,236,228,243,244,249,236,101,128, - 247, 49,112, 2,143, 8,143, 15,225,242,229,110,128, 36,116,229, - 114, 2,143, 22,143, 28,233,239,100,128, 36,136,243,233,225,110, - 128, 6,241,241,245,225,242,244,229,114,128, 0,188,242,239,237, - 225,110,128, 33,112,243,245,240,229,242,233,239,114,128, 0,185, - 244,104, 2,143, 71,143, 76,225,105,128, 14, 81,233,242,100,128, - 33, 83,111, 3,143, 90,143,124,143,140,103, 2,143, 96,143,114, - 239,238,229,107,129, 1,235,143,105,237,225,227,242,239,110,128, - 1,237,245,242,237,245,235,232,105,128, 10, 19,237,225,244,242, - 225,231,245,242,237,245,235,232,105,128, 10, 75,240,229,110,128, - 2, 84,112, 3,143,154,143,161,143,172,225,242,229,110,128, 36, - 170,229,238,226,245,236,236,229,116,128, 37,230,244,233,239,110, - 128, 35, 37,114, 2,143,185,143,214,100, 2,143,191,143,202,230, - 229,237,233,238,233,238,101,128, 0,170,237,225,243,227,245,236, - 233,238,101,128, 0,186,244,232,239,231,239,238,225,108,128, 34, - 31,115, 5,143,237,144, 13,144, 30,144, 75,144, 88,232,239,242, - 116, 2,143,246,143,253,228,229,246, 97,128, 9, 18,246,239,247, - 229,236,243,233,231,238,228,229,246, 97,128, 9, 74,236,225,243, - 104,129, 0,248,144, 22,225,227,245,244,101,128, 1,255,237,225, - 236,108, 2,144, 39,144, 50,232,233,242,225,231,225,238, 97,128, - 48, 73,235,225,244,225,235,225,238, 97,129, 48,169,144, 63,232, - 225,236,230,247,233,228,244,104,128,255,107,244,242,239,235,229, - 225,227,245,244,101,128, 1,255,245,240,229,242,233,239,114,128, - 246,240,116, 2,144,104,144,115,227,249,242,233,236,236,233, 99, - 128, 4,127,233,236,228,101,130, 0,245,144,126,144,134,225,227, - 245,244,101,128, 30, 77,228,233,229,242,229,243,233,115,128, 30, - 79,245,226,239,240,239,237,239,230,111,128, 49, 33,118, 2,144, - 163,144,244,229,114, 2,144,170,144,236,236,233,238,101,131, 32, - 62,144,183,144,206,144,229, 99, 2,144,189,144,201,229,238,244, - 229,242,236,233,238,101,128,254, 74,237, 98,128, 3, 5,100, 2, - 144,212,144,220,225,243,232,229,100,128,254, 73,226,236,247,225, - 246,121,128,254, 76,247,225,246,121,128,254, 75,243,227,239,242, - 101,128, 0,175,239,247,229,236,243,233,231,110, 3,145, 3,145, - 13,145, 20,226,229,238,231,225,236,105,128, 9,203,228,229,246, - 97,128, 9, 75,231,245,234,225,242,225,244,105,128, 10,203,112, - 145, 0,112,145, 69,147,197,147,208,147,217,147,229,149,154,149, - 164,150,156,151,175,152, 9,152, 35,152,166,152,174,153, 76,153, - 134,153,162,153,172, 97, 14,145, 99,145,131,145,141,145,148,145, - 155,145,203,145,214,145,228,145,239,146, 30,146, 44,147, 56,147, - 95,147,185, 97, 2,145,105,145,117,237,240,243,243,241,245,225, - 242,101,128, 51,128,243,229,238,244,239,243,241,245,225,242,101, - 128, 51, 43,226,229,238,231,225,236,105,128, 9,170,227,245,244, - 101,128, 30, 85,228,229,246, 97,128, 9, 42,103, 2,145,161,145, - 179,101, 2,145,167,145,174,228,239,247,110,128, 33,223,245,112, - 128, 33,222,117, 2,145,185,145,194,234,225,242,225,244,105,128, - 10,170,242,237,245,235,232,105,128, 10, 42,232,233,242,225,231, - 225,238, 97,128, 48,113,233,249,225,238,238,239,233,244,232,225, - 105,128, 14, 47,235,225,244,225,235,225,238, 97,128, 48,209,108, - 2,145,245,146, 14,225,244,225,236,233,250,225,244,233,239,238, - 227,249,242,233,236,236,233,227,227,237, 98,128, 4,132,239,227, - 232,235,225,227,249,242,233,236,236,233, 99,128, 4,192,238,243, - 233,239,243,235,239,242,229,225,110,128, 49,127,114, 3,146, 52, - 146, 73,147, 45, 97, 2,146, 58,146, 66,231,242,225,240,104,128, - 0,182,236,236,229,108,128, 34, 37,229,110, 2,146, 80,146,190, - 236,229,230,116,136, 0, 40,146,103,146,118,146,123,146,128,146, - 139,146,151,146,174,146,179,225,236,244,239,238,229,225,242,225, - 226,233, 99,128,253, 62,226,116,128,248,237,229,120,128,248,236, - 233,238,230,229,242,233,239,114,128, 32,141,237,239,238,239,243, - 240,225,227,101,128,255, 8,115, 2,146,157,146,164,237,225,236, - 108,128,254, 89,245,240,229,242,233,239,114,128, 32,125,244,112, - 128,248,235,246,229,242,244,233,227,225,108,128,254, 53,242,233, - 231,232,116,136, 0, 41,146,214,146,229,146,234,146,239,146,250, - 147, 6,147, 29,147, 34,225,236,244,239,238,229,225,242,225,226, - 233, 99,128,253, 63,226,116,128,248,248,229,120,128,248,247,233, - 238,230,229,242,233,239,114,128, 32,142,237,239,238,239,243,240, - 225,227,101,128,255, 9,115, 2,147, 12,147, 19,237,225,236,108, - 128,254, 90,245,240,229,242,233,239,114,128, 32,126,244,112,128, - 248,246,246,229,242,244,233,227,225,108,128,254, 54,244,233,225, - 236,228,233,230,102,128, 34, 2,115, 3,147, 64,147, 75,147, 87, - 229,241,232,229,226,242,229,119,128, 5,192,232,244,225,232,229, - 226,242,229,119,128, 5,153,241,245,225,242,101,128, 51,169,244, - 225,104,134, 5,183,147,113,147,127,147,132,147,141,147,156,147, - 172, 49, 2,147,119,147,123, 49,128, 5,183,100,128, 5,183,178, - 97,128, 5,183,232,229,226,242,229,119,128, 5,183,238,225,242, - 242,239,247,232,229,226,242,229,119,128, 5,183,241,245,225,242, - 244,229,242,232,229,226,242,229,119,128, 5,183,247,233,228,229, - 232,229,226,242,229,119,128, 5,183,250,229,242,232,229,226,242, - 229,119,128, 5,161,226,239,240,239,237,239,230,111,128, 49, 6, - 227,233,242,227,236,101,128, 36,223,228,239,244,225,227,227,229, - 238,116,128, 30, 87,101,137, 5,228,147,251,148, 6,148, 26,148, - 38,148, 58,148,160,148,171,148,192,149,147,227,249,242,233,236, - 236,233, 99,128, 4, 63,228,225,231,229,243,104,129,251, 68,148, - 17,232,229,226,242,229,119,128,251, 68,229,250,233,243,241,245, - 225,242,101,128, 51, 59,230,233,238,225,236,228,225,231,229,243, - 232,232,229,226,242,229,119,128,251, 67,104, 5,148, 70,148, 93, - 148,101,148,115,148,145,225,114, 2,148, 77,148, 84,225,226,233, - 99,128, 6,126,237,229,238,233,225,110,128, 5,122,229,226,242, - 229,119,128, 5,228,230,233,238,225,236,225,242,225,226,233, 99, - 128,251, 87,105, 2,148,121,148,136,238,233,244,233,225,236,225, - 242,225,226,233, 99,128,251, 88,242,225,231,225,238, 97,128, 48, - 122,237,229,228,233,225,236,225,242,225,226,233, 99,128,251, 89, - 235,225,244,225,235,225,238, 97,128, 48,218,237,233,228,228,236, - 229,232,239,239,235,227,249,242,233,236,236,233, 99,128, 4,167, - 114, 5,148,204,148,216,149, 2,149,123,149,136,225,230,229,232, - 229,226,242,229,119,128,251, 78,227,229,238,116,131, 0, 37,148, - 229,148,238,148,250,225,242,225,226,233, 99,128, 6,106,237,239, - 238,239,243,240,225,227,101,128,255, 5,243,237,225,236,108,128, - 254,106,105, 2,149, 8,149,105,239,100,134, 0, 46,149, 25,149, - 36,149, 47,149, 59,149, 70,149, 82,225,242,237,229,238,233,225, - 110,128, 5,137,227,229,238,244,229,242,229,100,128, 0,183,232, - 225,236,230,247,233,228,244,104,128,255, 97,233,238,230,229,242, - 233,239,114,128,246,231,237,239,238,239,243,240,225,227,101,128, - 255, 14,115, 2,149, 88,149, 95,237,225,236,108,128,254, 82,245, - 240,229,242,233,239,114,128,246,232,243,240,239,237,229,238,233, - 231,242,229,229,235,227,237, 98,128, 3, 66,240,229,238,228,233, - 227,245,236,225,114,128, 34,165,244,232,239,245,243,225,238,100, - 128, 32, 48,243,229,244, 97,128, 32,167,230,243,241,245,225,242, - 101,128, 51,138,104, 3,149,172,149,222,150,103, 97, 3,149,180, - 149,190,149,197,226,229,238,231,225,236,105,128, 9,171,228,229, - 246, 97,128, 9, 43,231,117, 2,149,204,149,213,234,225,242,225, - 244,105,128, 10,171,242,237,245,235,232,105,128, 10, 43,105,133, - 3,198,149,236,149,240,150, 70,150, 78,150, 89, 49,128, 3,213, - 229,245,240,104, 4,149,253,150, 32,150, 47,150, 56, 97, 2,150, - 3,150, 18,227,233,242,227,236,229,235,239,242,229,225,110,128, - 50,122,240,225,242,229,238,235,239,242,229,225,110,128, 50, 26, - 227,233,242,227,236,229,235,239,242,229,225,110,128, 50,108,235, - 239,242,229,225,110,128, 49, 77,240,225,242,229,238,235,239,242, - 229,225,110,128, 50, 12,236,225,244,233,110,128, 2,120,238,244, - 232,245,244,232,225,105,128, 14, 58,243,249,237,226,239,236,231, - 242,229,229,107,128, 3,213,111, 3,150,111,150,116,150,142,239, - 107,128, 1,165,240,104, 2,150,123,150,132,225,238,244,232,225, - 105,128, 14, 30,245,238,231,244,232,225,105,128, 14, 28,243,225, - 237,240,232,225,239,244,232,225,105,128, 14, 32,105,133, 3,192, - 150,170,151,126,151,137,151,148,151,162,229,245,112, 6,150,186, - 150,221,150,253,151, 25,151, 39,151, 91, 97, 2,150,192,150,207, - 227,233,242,227,236,229,235,239,242,229,225,110,128, 50,115,240, - 225,242,229,238,235,239,242,229,225,110,128, 50, 19,227,105, 2, - 150,228,150,240,229,245,227,235,239,242,229,225,110,128, 49,118, - 242,227,236,229,235,239,242,229,225,110,128, 50,101,107, 2,151, - 3,151, 17,233,249,229,239,235,235,239,242,229,225,110,128, 49, - 114,239,242,229,225,110,128, 49, 66,240,225,242,229,238,235,239, - 242,229,225,110,128, 50, 5,243,233,239,115, 2,151, 48,151, 76, - 107, 2,151, 54,151, 68,233,249,229,239,235,235,239,242,229,225, - 110,128, 49,116,239,242,229,225,110,128, 49, 68,244,233,235,229, - 245,244,235,239,242,229,225,110,128, 49,117,116, 2,151, 97,151, - 112,232,233,229,245,244,232,235,239,242,229,225,110,128, 49,119, - 233,235,229,245,244,235,239,242,229,225,110,128, 49,115,232,233, - 242,225,231,225,238, 97,128, 48,116,235,225,244,225,235,225,238, - 97,128, 48,212,243,249,237,226,239,236,231,242,229,229,107,128, - 3,214,247,242,225,242,237,229,238,233,225,110,128, 5,131,236, - 245,115,132, 0, 43,151,189,151,200,151,209,151,242,226,229,236, - 239,247,227,237, 98,128, 3, 31,227,233,242,227,236,101,128, 34, - 149,109, 2,151,215,151,222,233,238,245,115,128, 0,177,111, 2, - 151,228,151,232,100,128, 2,214,238,239,243,240,225,227,101,128, - 255, 11,115, 2,151,248,151,255,237,225,236,108,128,254, 98,245, - 240,229,242,233,239,114,128, 32,122,109, 2,152, 15,152, 26,239, - 238,239,243,240,225,227,101,128,255, 80,243,241,245,225,242,101, - 128, 51,216,111, 5,152, 47,152, 58,152,125,152,136,152,146,232, - 233,242,225,231,225,238, 97,128, 48,125,233,238,244,233,238,231, - 233,238,228,229,120, 4,152, 78,152, 90,152,102,152,115,228,239, - 247,238,247,232,233,244,101,128, 38, 31,236,229,230,244,247,232, - 233,244,101,128, 38, 28,242,233,231,232,244,247,232,233,244,101, - 128, 38, 30,245,240,247,232,233,244,101,128, 38, 29,235,225,244, - 225,235,225,238, 97,128, 48,221,240,236,225,244,232,225,105,128, - 14, 27,243,244,225,236,237,225,242,107,129, 48, 18,152,159,230, - 225,227,101,128, 48, 32,240,225,242,229,110,128, 36,171,114, 3, - 152,182,152,208,152,233,101, 2,152,188,152,196,227,229,228,229, - 115,128, 34,122,243,227,242,233,240,244,233,239,110,128, 33, 30, - 233,237,101, 2,152,216,152,222,237,239,100,128, 2,185,242,229, - 246,229,242,243,229,100,128, 32, 53,111, 4,152,243,152,250,153, - 4,153, 17,228,245,227,116,128, 34, 15,234,229,227,244,233,246, - 101,128, 35, 5,236,239,238,231,229,228,235,225,238, 97,128, 48, - 252,112, 2,153, 23,153, 60,101, 2,153, 29,153, 36,236,236,239, - 114,128, 35, 24,242,243,117, 2,153, 44,153, 51,226,243,229,116, - 128, 34,130,240,229,242,243,229,116,128, 34,131,239,242,244,233, - 239,110,129, 34, 55,153, 71,225,108,128, 34, 29,115, 2,153, 82, - 153,125,105,130, 3,200,153, 90,153,101,227,249,242,233,236,236, - 233, 99,128, 4,113,236,233,240,238,229,245,237,225,244,225,227, - 249,242,233,236,236,233,227,227,237, 98,128, 4,134,243,241,245, - 225,242,101,128, 51,176,117, 2,153,140,153,151,232,233,242,225, - 231,225,238, 97,128, 48,119,235,225,244,225,235,225,238, 97,128, - 48,215,246,243,241,245,225,242,101,128, 51,180,247,243,241,245, - 225,242,101,128, 51,186,113,136, 0,113,153,202,154,251,155, 6, - 155, 15,155, 22,155, 34,155, 72,155, 80, 97, 4,153,212,153,235, - 154, 43,154,234,100, 2,153,218,153,224,229,246, 97,128, 9, 88, - 237,225,232,229,226,242,229,119,128, 5,168,102, 4,153,245,153, - 254,154, 12,154, 28,225,242,225,226,233, 99,128, 6, 66,230,233, - 238,225,236,225,242,225,226,233, 99,128,254,214,233,238,233,244, - 233,225,236,225,242,225,226,233, 99,128,254,215,237,229,228,233, - 225,236,225,242,225,226,233, 99,128,254,216,237,225,244,115,136, - 5,184,154, 66,154, 86,154,100,154,105,154,110,154,119,154,134, - 154,221, 49, 3,154, 74,154, 78,154, 82, 48,128, 5,184, 97,128, - 5,184, 99,128, 5,184, 50, 2,154, 92,154, 96, 55,128, 5,184, - 57,128, 5,184,179, 51,128, 5,184,228,101,128, 5,184,232,229, - 226,242,229,119,128, 5,184,238,225,242,242,239,247,232,229,226, - 242,229,119,128, 5,184,113, 2,154,140,154,206,225,244,225,110, - 4,154,153,154,162,154,177,154,193,232,229,226,242,229,119,128, - 5,184,238,225,242,242,239,247,232,229,226,242,229,119,128, 5, - 184,241,245,225,242,244,229,242,232,229,226,242,229,119,128, 5, - 184,247,233,228,229,232,229,226,242,229,119,128, 5,184,245,225, - 242,244,229,242,232,229,226,242,229,119,128, 5,184,247,233,228, - 229,232,229,226,242,229,119,128, 5,184,242,238,229,249,240,225, - 242,225,232,229,226,242,229,119,128, 5,159,226,239,240,239,237, - 239,230,111,128, 49, 17,227,233,242,227,236,101,128, 36,224,232, - 239,239,107,128, 2,160,237,239,238,239,243,240,225,227,101,128, - 255, 81,239,102,130, 5,231,155, 43,155, 63,228,225,231,229,243, - 104,129,251, 71,155, 54,232,229,226,242,229,119,128,251, 71,232, - 229,226,242,229,119,128, 5,231,240,225,242,229,110,128, 36,172, - 117, 4,155, 90,155,102,155,191,156, 22,225,242,244,229,242,238, - 239,244,101,128, 38,105,226,245,244,115,135, 5,187,155,123,155, - 128,155,133,155,138,155,147,155,162,155,178,177, 56,128, 5,187, - 178, 53,128, 5,187,179, 49,128, 5,187,232,229,226,242,229,119, - 128, 5,187,238,225,242,242,239,247,232,229,226,242,229,119,128, - 5,187,241,245,225,242,244,229,242,232,229,226,242,229,119,128, - 5,187,247,233,228,229,232,229,226,242,229,119,128, 5,187,229, - 243,244,233,239,110,133, 0, 63,155,210,155,233,155,250,156, 2, - 156, 14,225,114, 2,155,217,155,224,225,226,233, 99,128, 6, 31, - 237,229,238,233,225,110,128, 5, 94,228,239,247,110,129, 0,191, - 155,242,243,237,225,236,108,128,247,191,231,242,229,229,107,128, - 3,126,237,239,238,239,243,240,225,227,101,128,255, 31,243,237, - 225,236,108,128,247, 63,239,244,101, 4,156, 34,156,105,156,125, - 156,154,228,226,108,133, 0, 34,156, 50,156, 57,156, 64,156, 76, - 156, 97,226,225,243,101,128, 32, 30,236,229,230,116,128, 32, 28, - 237,239,238,239,243,240,225,227,101,128,255, 2,240,242,233,237, - 101,129, 48, 30,156, 86,242,229,246,229,242,243,229,100,128, 48, - 29,242,233,231,232,116,128, 32, 29,236,229,230,116,129, 32, 24, - 156,114,242,229,246,229,242,243,229,100,128, 32, 27,114, 2,156, - 131,156,141,229,246,229,242,243,229,100,128, 32, 27,233,231,232, - 116,129, 32, 25,156,150,110,128, 1, 73,243,233,238,231,108, 2, - 156,164,156,171,226,225,243,101,128, 32, 26,101,129, 0, 39,156, - 177,237,239,238,239,243,240,225,227,101,128,255, 7,114,145, 0, - 114,156,227,157,231,157,242,158, 33,158, 84,159,101,159,125,159, - 220,161,254,162, 35,162, 47,162,101,162,109,163, 15,163, 26,163, - 61,163,161, 97, 11,156,251,157, 6,157, 16,157, 23,157, 88,157, - 104,157,129,157,140,157,165,157,188,157,225,225,242,237,229,238, - 233,225,110,128, 5,124,226,229,238,231,225,236,105,128, 9,176, - 227,245,244,101,128, 1, 85,100, 4,157, 33,157, 39,157, 53,157, - 79,229,246, 97,128, 9, 48,233,227,225,108,129, 34, 26,157, 48, - 229,120,128,248,229,239,246,229,242,243,243,241,245,225,242,101, - 129, 51,174,157, 69,228,243,241,245,225,242,101,128, 51,175,243, - 241,245,225,242,101,128, 51,173,230,101,129, 5,191,157, 95,232, - 229,226,242,229,119,128, 5,191,231,117, 2,157,111,157,120,234, - 225,242,225,244,105,128, 10,176,242,237,245,235,232,105,128, 10, - 48,232,233,242,225,231,225,238, 97,128, 48,137,235,225,244,225, - 235,225,238, 97,129, 48,233,157,153,232,225,236,230,247,233,228, - 244,104,128,255,151,236,239,247,229,242,228,233,225,231,239,238, - 225,236,226,229,238,231,225,236,105,128, 9,241,109, 2,157,194, - 157,217,233,228,228,236,229,228,233,225,231,239,238,225,236,226, - 229,238,231,225,236,105,128, 9,240,243,232,239,242,110,128, 2, - 100,244,233,111,128, 34, 54,226,239,240,239,237,239,230,111,128, - 49, 22, 99, 4,157,252,158, 3,158, 12,158, 20,225,242,239,110, - 128, 1, 89,229,228,233,236,236, 97,128, 1, 87,233,242,227,236, - 101,128, 36,225,239,237,237,225,225,227,227,229,238,116,128, 1, - 87,100, 2,158, 39,158, 49,226,236,231,242,225,246,101,128, 2, - 17,239,116, 2,158, 56,158, 65,225,227,227,229,238,116,128, 30, - 89,226,229,236,239,119,129, 30, 91,158, 75,237,225,227,242,239, - 110,128, 30, 93,101, 6,158, 98,158,143,158,178,158,233,159, 2, - 159, 35,102, 2,158,104,158,117,229,242,229,238,227,229,237,225, - 242,107,128, 32, 59,236,229,248,243,117, 2,158,127,158,134,226, - 243,229,116,128, 34,134,240,229,242,243,229,116,128, 34,135,231, - 233,243,244,229,114, 2,158,154,158,159,229,100,128, 0,174,115, - 2,158,165,158,171,225,238,115,128,248,232,229,242,233,102,128, - 246,218,104, 3,158,186,158,209,158,223,225,114, 2,158,193,158, - 200,225,226,233, 99,128, 6, 49,237,229,238,233,225,110,128, 5, - 128,230,233,238,225,236,225,242,225,226,233, 99,128,254,174,233, - 242,225,231,225,238, 97,128, 48,140,235,225,244,225,235,225,238, - 97,129, 48,236,158,246,232,225,236,230,247,233,228,244,104,128, - 255,154,243,104,130, 5,232,159, 11,159, 26,228,225,231,229,243, - 232,232,229,226,242,229,119,128,251, 72,232,229,226,242,229,119, - 128, 5,232,118, 3,159, 43,159, 56,159, 88,229,242,243,229,228, - 244,233,236,228,101,128, 34, 61,233, 97, 2,159, 63,159, 72,232, - 229,226,242,229,119,128, 5,151,237,245,231,242,225,243,232,232, - 229,226,242,229,119,128, 5,151,236,239,231,233,227,225,236,238, - 239,116,128, 35, 16,230,233,243,232,232,239,239,107,129, 2,126, - 159,114,242,229,246,229,242,243,229,100,128, 2,127,104, 2,159, - 131,159,154, 97, 2,159,137,159,147,226,229,238,231,225,236,105, - 128, 9,221,228,229,246, 97,128, 9, 93,111,131, 3,193,159,164, - 159,193,159,207,239,107,129, 2,125,159,171,244,245,242,238,229, - 100,129, 2,123,159,182,243,245,240,229,242,233,239,114,128, 2, - 181,243,249,237,226,239,236,231,242,229,229,107,128, 3,241,244, - 233,227,232,239,239,235,237,239,100,128, 2,222,105, 6,159,234, - 161, 22,161, 68,161, 79,161,104,161,240,229,245,108, 9,160, 0, - 160, 35,160, 50,160, 64,160,110,160,124,160,210,160,223,161, 2, - 97, 2,160, 6,160, 21,227,233,242,227,236,229,235,239,242,229, - 225,110,128, 50,113,240,225,242,229,238,235,239,242,229,225,110, - 128, 50, 17,227,233,242,227,236,229,235,239,242,229,225,110,128, - 50, 99,232,233,229,245,232,235,239,242,229,225,110,128, 49, 64, - 107, 2,160, 70,160,102,233,249,229,239,107, 2,160, 80,160, 89, - 235,239,242,229,225,110,128, 49, 58,243,233,239,243,235,239,242, - 229,225,110,128, 49,105,239,242,229,225,110,128, 49, 57,237,233, - 229,245,237,235,239,242,229,225,110,128, 49, 59,112, 3,160,132, - 160,164,160,179, 97, 2,160,138,160,152,238,243,233,239,243,235, - 239,242,229,225,110,128, 49,108,242,229,238,235,239,242,229,225, - 110,128, 50, 3,232,233,229,245,240,232,235,239,242,229,225,110, - 128, 49, 63,233,229,245,112, 2,160,188,160,197,235,239,242,229, - 225,110,128, 49, 60,243,233,239,243,235,239,242,229,225,110,128, - 49,107,243,233,239,243,235,239,242,229,225,110,128, 49, 61,116, - 2,160,229,160,244,232,233,229,245,244,232,235,239,242,229,225, - 110,128, 49, 62,233,235,229,245,244,235,239,242,229,225,110,128, - 49,106,249,229,239,242,233,238,232,233,229,245,232,235,239,242, - 229,225,110,128, 49,109,231,232,116, 2,161, 30,161, 38,225,238, - 231,236,101,128, 34, 31,116, 2,161, 44,161, 58,225,227,235,226, - 229,236,239,247,227,237, 98,128, 3, 25,242,233,225,238,231,236, - 101,128, 34,191,232,233,242,225,231,225,238, 97,128, 48,138,235, - 225,244,225,235,225,238, 97,129, 48,234,161, 92,232,225,236,230, - 247,233,228,244,104,128,255,152,110, 2,161,110,161,226,103,131, - 2,218,161,120,161,131,161,137,226,229,236,239,247,227,237, 98, - 128, 3, 37,227,237, 98,128, 3, 10,232,225,236,102, 2,161,146, - 161,192,236,229,230,116,131, 2,191,161,159,161,170,161,181,225, - 242,237,229,238,233,225,110,128, 5, 89,226,229,236,239,247,227, - 237, 98,128, 3, 28,227,229,238,244,229,242,229,100,128, 2,211, - 242,233,231,232,116,130, 2,190,161,204,161,215,226,229,236,239, - 247,227,237, 98,128, 3, 57,227,229,238,244,229,242,229,100,128, - 2,210,246,229,242,244,229,228,226,242,229,246,101,128, 2, 19, - 244,244,239,242,245,243,241,245,225,242,101,128, 51, 81,108, 2, - 162, 4,162, 15,233,238,229,226,229,236,239,119,128, 30, 95,239, - 238,231,236,229,103,129, 2,124,162, 26,244,245,242,238,229,100, - 128, 2,122,237,239,238,239,243,240,225,227,101,128,255, 82,111, - 3,162, 55,162, 66,162, 91,232,233,242,225,231,225,238, 97,128, - 48,141,235,225,244,225,235,225,238, 97,129, 48,237,162, 79,232, - 225,236,230,247,233,228,244,104,128,255,155,242,245,225,244,232, - 225,105,128, 14, 35,240,225,242,229,110,128, 36,173,114, 3,162, - 117,162,153,162,183, 97, 3,162,125,162,135,162,142,226,229,238, - 231,225,236,105,128, 9,220,228,229,246, 97,128, 9, 49,231,245, - 242,237,245,235,232,105,128, 10, 92,229,104, 2,162,160,162,169, - 225,242,225,226,233, 99,128, 6,145,230,233,238,225,236,225,242, - 225,226,233, 99,128,251,141,246,239,227,225,236,233, 99, 4,162, - 199,162,209,162,216,162,227,226,229,238,231,225,236,105,128, 9, - 224,228,229,246, 97,128, 9, 96,231,245,234,225,242,225,244,105, - 128, 10,224,246,239,247,229,236,243,233,231,110, 3,162,243,162, - 253,163, 4,226,229,238,231,225,236,105,128, 9,196,228,229,246, - 97,128, 9, 68,231,245,234,225,242,225,244,105,128, 10,196,243, - 245,240,229,242,233,239,114,128,246,241,116, 2,163, 32,163, 40, - 226,236,239,227,107,128, 37,144,245,242,238,229,100,129, 2,121, - 163, 50,243,245,240,229,242,233,239,114,128, 2,180,117, 4,163, - 71,163, 82,163,107,163,154,232,233,242,225,231,225,238, 97,128, - 48,139,235,225,244,225,235,225,238, 97,129, 48,235,163, 95,232, - 225,236,230,247,233,228,244,104,128,255,153,112, 2,163,113,163, - 148,229,101, 2,163,120,163,134,237,225,242,235,226,229,238,231, - 225,236,105,128, 9,242,243,233,231,238,226,229,238,231,225,236, - 105,128, 9,243,233,225,104,128,246,221,244,232,225,105,128, 14, - 36,246,239,227,225,236,233, 99, 4,163,177,163,187,163,194,163, - 205,226,229,238,231,225,236,105,128, 9,139,228,229,246, 97,128, - 9, 11,231,245,234,225,242,225,244,105,128, 10,139,246,239,247, - 229,236,243,233,231,110, 3,163,221,163,231,163,238,226,229,238, - 231,225,236,105,128, 9,195,228,229,246, 97,128, 9, 67,231,245, - 234,225,242,225,244,105,128, 10,195,115,147, 0,115,164, 35,166, - 5,166, 16,166,142,166,181,169,123,169,134,172, 21,174,159,174, - 205,174,232,175,167,175,234,177, 11,177, 21,177,207,178, 24,178, - 194,178,204, 97, 9,164, 55,164, 65,164, 86,164,158,164,183,164, - 194,164,219,164,251,165, 35,226,229,238,231,225,236,105,128, 9, - 184,227,245,244,101,129, 1, 91,164, 74,228,239,244,225,227,227, - 229,238,116,128, 30,101,100, 5,164, 98,164,107,164,113,164,127, - 164,143,225,242,225,226,233, 99,128, 6, 53,229,246, 97,128, 9, - 56,230,233,238,225,236,225,242,225,226,233, 99,128,254,186,233, - 238,233,244,233,225,236,225,242,225,226,233, 99,128,254,187,237, - 229,228,233,225,236,225,242,225,226,233, 99,128,254,188,231,117, - 2,164,165,164,174,234,225,242,225,244,105,128, 10,184,242,237, - 245,235,232,105,128, 10, 56,232,233,242,225,231,225,238, 97,128, - 48, 85,235,225,244,225,235,225,238, 97,129, 48,181,164,207,232, - 225,236,230,247,233,228,244,104,128,255,123,236,236,225,236,236, - 225,232,239,245,225,236,225,249,232,229,247,225,243,225,236,236, - 225,237,225,242,225,226,233, 99,128,253,250,237,229,235,104,130, - 5,225,165, 6,165, 26,228,225,231,229,243,104,129,251, 65,165, - 17,232,229,226,242,229,119,128,251, 65,232,229,226,242,229,119, - 128, 5,225,242, 97, 5,165, 48,165,122,165,130,165,180,165,188, - 97, 5,165, 60,165, 68,165, 76,165,107,165,115,225,244,232,225, - 105,128, 14, 50,229,244,232,225,105,128, 14, 65,233,237,225,233, - 109, 2,165, 86,165, 97,225,236,225,233,244,232,225,105,128, 14, - 68,245,225,238,244,232,225,105,128, 14, 67,237,244,232,225,105, - 128, 14, 51,244,232,225,105,128, 14, 48,229,244,232,225,105,128, - 14, 64,105, 3,165,138,165,162,165,173,105, 2,165,144,165,155, - 236,229,230,244,244,232,225,105,128,248,134,244,232,225,105,128, - 14, 53,236,229,230,244,244,232,225,105,128,248,133,244,232,225, - 105,128, 14, 52,239,244,232,225,105,128, 14, 66,117, 3,165,196, - 165,246,165,253,101, 3,165,204,165,228,165,239,101, 2,165,210, - 165,221,236,229,230,244,244,232,225,105,128,248,136,244,232,225, - 105,128, 14, 55,236,229,230,244,244,232,225,105,128,248,135,244, - 232,225,105,128, 14, 54,244,232,225,105,128, 14, 56,245,244,232, - 225,105,128, 14, 57,226,239,240,239,237,239,230,111,128, 49, 25, - 99, 5,166, 28,166, 49,166, 58,166,107,166,129,225,242,239,110, - 129, 1, 97,166, 37,228,239,244,225,227,227,229,238,116,128, 30, - 103,229,228,233,236,236, 97,128, 1, 95,232,247, 97,131, 2, 89, - 166, 70,166, 81,166,100,227,249,242,233,236,236,233, 99,128, 4, - 217,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, - 99,128, 4,219,232,239,239,107,128, 2, 90,233,242, 99, 2,166, - 115,166,120,236,101,128, 36,226,245,237,230,236,229,120,128, 1, - 93,239,237,237,225,225,227,227,229,238,116,128, 2, 25,228,239, - 116, 2,166,150,166,159,225,227,227,229,238,116,128, 30, 97,226, - 229,236,239,119,129, 30, 99,166,169,228,239,244,225,227,227,229, - 238,116,128, 30,105,101, 9,166,201,166,217,166,252,167, 61,167, - 164,167,191,167,216,168, 41,168, 68,225,231,245,236,236,226,229, - 236,239,247,227,237, 98,128, 3, 60, 99, 2,166,223,166,245,239, - 238,100,129, 32, 51,166,231,244,239,238,229,227,232,233,238,229, - 243,101,128, 2,202,244,233,239,110,128, 0,167,229,110, 4,167, - 7,167, 16,167, 30,167, 46,225,242,225,226,233, 99,128, 6, 51, - 230,233,238,225,236,225,242,225,226,233, 99,128,254,178,233,238, - 233,244,233,225,236,225,242,225,226,233, 99,128,254,179,237,229, - 228,233,225,236,225,242,225,226,233, 99,128,254,180,231,239,108, - 135, 5,182,167, 81,167, 95,167,100,167,109,167,124,167,140,167, - 151, 49, 2,167, 87,167, 91, 51,128, 5,182,102,128, 5,182,178, - 99,128, 5,182,232,229,226,242,229,119,128, 5,182,238,225,242, - 242,239,247,232,229,226,242,229,119,128, 5,182,241,245,225,242, - 244,229,242,232,229,226,242,229,119,128, 5,182,244,225,232,229, - 226,242,229,119,128, 5,146,247,233,228,229,232,229,226,242,229, - 119,128, 5,182,104, 2,167,170,167,181,225,242,237,229,238,233, - 225,110,128, 5,125,233,242,225,231,225,238, 97,128, 48, 91,235, - 225,244,225,235,225,238, 97,129, 48,187,167,204,232,225,236,230, - 247,233,228,244,104,128,255,126,237,105, 2,167,223,168, 10,227, - 239,236,239,110,131, 0, 59,167,237,167,246,168, 2,225,242,225, - 226,233, 99,128, 6, 27,237,239,238,239,243,240,225,227,101,128, - 255, 27,243,237,225,236,108,128,254, 84,246,239,233,227,229,228, - 237,225,242,235,235,225,238, 97,129, 48,156,168, 29,232,225,236, - 230,247,233,228,244,104,128,255,159,238,116, 2,168, 48,168, 58, - 233,243,241,245,225,242,101,128, 51, 34,239,243,241,245,225,242, - 101,128, 51, 35,246,229,110,142, 0, 55,168,102,168,111,168,121, - 168,151,168,158,168,168,168,193,168,220,168,254,169, 10,169, 21, - 169, 54,169, 62,169, 73,225,242,225,226,233, 99,128, 6,103,226, - 229,238,231,225,236,105,128, 9,237,227,233,242,227,236,101,129, - 36,102,168,132,233,238,246,229,242,243,229,243,225,238,243,243, - 229,242,233,102,128, 39,144,228,229,246, 97,128, 9,109,229,233, - 231,232,244,232,115,128, 33, 94,231,117, 2,168,175,168,184,234, - 225,242,225,244,105,128, 10,237,242,237,245,235,232,105,128, 10, - 109,232, 97, 2,168,200,168,211,227,235,225,242,225,226,233, 99, - 128, 6,103,238,231,250,232,239,117,128, 48, 39,105, 2,168,226, - 168,244,228,229,239,231,242,225,240,232,233,227,240,225,242,229, - 110,128, 50, 38,238,230,229,242,233,239,114,128, 32,135,237,239, - 238,239,243,240,225,227,101,128,255, 23,239,236,228,243,244,249, - 236,101,128,247, 55,112, 2,169, 27,169, 34,225,242,229,110,128, - 36,122,229,114, 2,169, 41,169, 47,233,239,100,128, 36,142,243, - 233,225,110,128, 6,247,242,239,237,225,110,128, 33,118,243,245, - 240,229,242,233,239,114,128, 32,119,116, 2,169, 79,169,117,229, - 229,110, 2,169, 87,169, 96,227,233,242,227,236,101,128, 36,112, - 112, 2,169,102,169,109,225,242,229,110,128, 36,132,229,242,233, - 239,100,128, 36,152,232,225,105,128, 14, 87,230,244,232,249,240, - 232,229,110,128, 0,173,104, 7,169,150,170,124,170,135,170,149, - 171, 94,171,107,172, 15, 97, 6,169,164,169,175,169,185,169,196, - 170, 83,170,108,225,242,237,229,238,233,225,110,128, 5,119,226, - 229,238,231,225,236,105,128, 9,182,227,249,242,233,236,236,233, - 99,128, 4, 72,100, 2,169,202,170, 42,228, 97, 4,169,213,169, - 222,169,253,170, 11,225,242,225,226,233, 99,128, 6, 81,228,225, - 237,237, 97, 2,169,232,169,241,225,242,225,226,233, 99,128,252, - 97,244,225,238,225,242,225,226,233, 99,128,252, 94,230,225,244, - 232,225,225,242,225,226,233, 99,128,252, 96,235,225,243,242, 97, - 2,170, 21,170, 30,225,242,225,226,233, 99,128,252, 98,244,225, - 238,225,242,225,226,233, 99,128,252, 95,101,132, 37,146,170, 54, - 170, 61,170, 69,170, 78,228,225,242,107,128, 37,147,236,233,231, - 232,116,128, 37,145,237,229,228,233,245,109,128, 37,146,246, 97, - 128, 9, 54,231,117, 2,170, 90,170, 99,234,225,242,225,244,105, - 128, 10,182,242,237,245,235,232,105,128, 10, 54,236,243,232,229, - 236,229,244,232,229,226,242,229,119,128, 5,147,226,239,240,239, - 237,239,230,111,128, 49, 21,227,232,225,227,249,242,233,236,236, - 233, 99,128, 4, 73,101, 4,170,159,170,224,170,234,170,251,229, - 110, 4,170,170,170,179,170,193,170,209,225,242,225,226,233, 99, - 128, 6, 52,230,233,238,225,236,225,242,225,226,233, 99,128,254, - 182,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254, - 183,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,184, - 233,227,239,240,244,233, 99,128, 3,227,241,229,108,129, 32,170, - 170,242,232,229,226,242,229,119,128, 32,170,246, 97,134, 5,176, - 171, 12,171, 27,171, 41,171, 50,171, 65,171, 81, 49, 2,171, 18, - 171, 23,177, 53,128, 5,176, 53,128, 5,176, 50, 2,171, 33,171, - 37, 50,128, 5,176,101,128, 5,176,232,229,226,242,229,119,128, - 5,176,238,225,242,242,239,247,232,229,226,242,229,119,128, 5, - 176,241,245,225,242,244,229,242,232,229,226,242,229,119,128, 5, - 176,247,233,228,229,232,229,226,242,229,119,128, 5,176,232,225, - 227,249,242,233,236,236,233, 99,128, 4,187,105, 2,171,113,171, - 124,237,225,227,239,240,244,233, 99,128, 3,237,110,131, 5,233, - 171,134,171,217,171,226,100, 2,171,140,171,206,225,231,229,243, - 104,130,251, 73,171,152,171,161,232,229,226,242,229,119,128,251, - 73,115, 2,171,167,171,187,232,233,238,228,239,116,129,251, 44, - 171,178,232,229,226,242,229,119,128,251, 44,233,238,228,239,116, - 129,251, 45,171,197,232,229,226,242,229,119,128,251, 45,239,244, - 232,229,226,242,229,119,128, 5,193,232,229,226,242,229,119,128, - 5,233,115, 2,171,232,171,252,232,233,238,228,239,116,129,251, - 42,171,243,232,229,226,242,229,119,128,251, 42,233,238,228,239, - 116,129,251, 43,172, 6,232,229,226,242,229,119,128,251, 43,239, - 239,107,128, 2,130,105, 8,172, 39,172, 83,172, 94,172,119,172, - 149,172,157,172,170,173, 85,231,237, 97,131, 3,195,172, 51,172, - 55,172, 63, 49,128, 3,194,230,233,238,225,108,128, 3,194,236, - 245,238,225,244,229,243,249,237,226,239,236,231,242,229,229,107, - 128, 3,242,232,233,242,225,231,225,238, 97,128, 48, 87,235,225, - 244,225,235,225,238, 97,129, 48,183,172,107,232,225,236,230,247, - 233,228,244,104,128,255,124,236,245,113, 2,172,127,172,136,232, - 229,226,242,229,119,128, 5,189,236,229,230,244,232,229,226,242, - 229,119,128, 5,189,237,233,236,225,114,128, 34, 60,238,228,239, - 244,232,229,226,242,229,119,128, 5,194,239,115, 6,172,185,172, - 220,172,252,173, 24,173, 38,173, 70, 97, 2,172,191,172,206,227, - 233,242,227,236,229,235,239,242,229,225,110,128, 50,116,240,225, - 242,229,238,235,239,242,229,225,110,128, 50, 20,227,105, 2,172, - 227,172,239,229,245,227,235,239,242,229,225,110,128, 49,126,242, - 227,236,229,235,239,242,229,225,110,128, 50,102,107, 2,173, 2, - 173, 16,233,249,229,239,235,235,239,242,229,225,110,128, 49,122, - 239,242,229,225,110,128, 49, 69,238,233,229,245,238,235,239,242, - 229,225,110,128, 49,123,112, 2,173, 44,173, 57,225,242,229,238, - 235,239,242,229,225,110,128, 50, 6,233,229,245,240,235,239,242, - 229,225,110,128, 49,125,244,233,235,229,245,244,235,239,242,229, - 225,110,128, 49,124,120,141, 0, 54,173,115,173,124,173,134,173, - 164,173,171,173,196,173,223,174, 1,174, 13,174, 24,174, 57,174, - 65,174, 76,225,242,225,226,233, 99,128, 6,102,226,229,238,231, - 225,236,105,128, 9,236,227,233,242,227,236,101,129, 36,101,173, - 145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233, - 102,128, 39,143,228,229,246, 97,128, 9,108,231,117, 2,173,178, - 173,187,234,225,242,225,244,105,128, 10,236,242,237,245,235,232, - 105,128, 10,108,232, 97, 2,173,203,173,214,227,235,225,242,225, - 226,233, 99,128, 6,102,238,231,250,232,239,117,128, 48, 38,105, - 2,173,229,173,247,228,229,239,231,242,225,240,232,233,227,240, - 225,242,229,110,128, 50, 37,238,230,229,242,233,239,114,128, 32, - 134,237,239,238,239,243,240,225,227,101,128,255, 22,239,236,228, - 243,244,249,236,101,128,247, 54,112, 2,174, 30,174, 37,225,242, - 229,110,128, 36,121,229,114, 2,174, 44,174, 50,233,239,100,128, - 36,141,243,233,225,110,128, 6,246,242,239,237,225,110,128, 33, - 117,243,245,240,229,242,233,239,114,128, 32,118,116, 2,174, 82, - 174,153,229,229,110, 2,174, 90,174,132, 99, 2,174, 96,174,104, - 233,242,227,236,101,128, 36,111,245,242,242,229,238,227,249,228, - 229,238,239,237,233,238,225,244,239,242,226,229,238,231,225,236, - 105,128, 9,249,112, 2,174,138,174,145,225,242,229,110,128, 36, - 131,229,242,233,239,100,128, 36,151,232,225,105,128, 14, 86,108, - 2,174,165,174,185,225,243,104,129, 0, 47,174,173,237,239,238, - 239,243,240,225,227,101,128,255, 15,239,238,103,129, 1,127,174, - 193,228,239,244,225,227,227,229,238,116,128, 30,155,109, 2,174, - 211,174,221,233,236,229,230,225,227,101,128, 38, 58,239,238,239, - 243,240,225,227,101,128,255, 83,111, 6,174,246,175, 40,175, 51, - 175, 76,175,121,175,132,102, 2,174,252,175, 10,240,225,243,245, - 241,232,229,226,242,229,119,128, 5,195,116, 2,175, 16,175, 25, - 232,249,240,232,229,110,128, 0,173,243,233,231,238,227,249,242, - 233,236,236,233, 99,128, 4, 76,232,233,242,225,231,225,238, 97, - 128, 48, 93,235,225,244,225,235,225,238, 97,129, 48,189,175, 64, - 232,225,236,230,247,233,228,244,104,128,255,127,236,233,228,245, - 115, 2,175, 86,175,103,236,239,238,231,239,246,229,242,236,225, - 249,227,237, 98,128, 3, 56,243,232,239,242,244,239,246,229,242, - 236,225,249,227,237, 98,128, 3, 55,242,245,243,233,244,232,225, - 105,128, 14, 41,115, 3,175,140,175,150,175,158,225,236,225,244, - 232,225,105,128, 14, 40,239,244,232,225,105,128, 14, 11,245,225, - 244,232,225,105,128, 14, 42,240, 97, 3,175,176,175,196,175,228, - 227,101,129, 0, 32,175,183,232,225,227,235,225,242,225,226,233, - 99,128, 0, 32,228,101,129, 38, 96,175,203,243,245,233,116, 2, - 175,212,175,220,226,236,225,227,107,128, 38, 96,247,232,233,244, - 101,128, 38,100,242,229,110,128, 36,174,241,245,225,242,101, 11, - 176, 6,176, 17,176, 31,176, 56,176, 73,176, 99,176,114,176,147, - 176,174,176,230,176,245,226,229,236,239,247,227,237, 98,128, 3, - 59, 99, 2,176, 23,176, 27, 99,128, 51,196,109,128, 51,157,228, - 233,225,231,239,238,225,236,227,242,239,243,243,232,225,244,227, - 232,230,233,236,108,128, 37,169,232,239,242,233,250,239,238,244, - 225,236,230,233,236,108,128, 37,164,107, 2,176, 79,176, 83,103, - 128, 51,143,109,129, 51,158,176, 89,227,225,240,233,244,225,108, - 128, 51,206,108, 2,176,105,176,109,110,128, 51,209,239,103,128, - 51,210,109, 4,176,124,176,128,176,133,176,137,103,128, 51,142, - 233,108,128, 51,213,109,128, 51,156,243,241,245,225,242,229,100, - 128, 51,161,239,242,244,232,239,231,239,238,225,236,227,242,239, - 243,243,232,225,244,227,232,230,233,236,108,128, 37,166,245,240, - 240,229,114, 2,176,184,176,207,236,229,230,244,244,239,236,239, - 247,229,242,242,233,231,232,244,230,233,236,108,128, 37,167,242, - 233,231,232,244,244,239,236,239,247,229,242,236,229,230,244,230, - 233,236,108,128, 37,168,246,229,242,244,233,227,225,236,230,233, - 236,108,128, 37,165,247,232,233,244,229,247,233,244,232,243,237, - 225,236,236,226,236,225,227,107,128, 37,163,242,243,241,245,225, - 242,101,128, 51,219,115, 2,177, 27,177,197, 97, 4,177, 37,177, - 47,177, 54,177, 65,226,229,238,231,225,236,105,128, 9,183,228, - 229,246, 97,128, 9, 55,231,245,234,225,242,225,244,105,128, 10, - 183,238,103, 8,177, 84,177, 98,177,112,177,126,177,141,177,155, - 177,169,177,182,227,233,229,245,227,235,239,242,229,225,110,128, - 49, 73,232,233,229,245,232,235,239,242,229,225,110,128, 49,133, - 233,229,245,238,231,235,239,242,229,225,110,128, 49,128,235,233, - 249,229,239,235,235,239,242,229,225,110,128, 49, 50,238,233,229, - 245,238,235,239,242,229,225,110,128, 49,101,240,233,229,245,240, - 235,239,242,229,225,110,128, 49, 67,243,233,239,243,235,239,242, - 229,225,110,128, 49, 70,244,233,235,229,245,244,235,239,242,229, - 225,110,128, 49, 56,245,240,229,242,233,239,114,128,246,242,116, - 2,177,213,177,236,229,242,236,233,238,103,129, 0,163,177,224, - 237,239,238,239,243,240,225,227,101,128,255,225,242,239,235,101, - 2,177,245,178, 6,236,239,238,231,239,246,229,242,236,225,249, - 227,237, 98,128, 3, 54,243,232,239,242,244,239,246,229,242,236, - 225,249,227,237, 98,128, 3, 53,117, 7,178, 40,178, 72,178, 94, - 178,105,178,146,178,156,178,160,226,243,229,116,130, 34,130,178, - 51,178, 62,238,239,244,229,241,245,225,108,128, 34,138,239,242, - 229,241,245,225,108,128, 34,134, 99, 2,178, 78,178, 86,227,229, - 229,228,115,128, 34,123,232,244,232,225,116,128, 34, 11,232,233, - 242,225,231,225,238, 97,128, 48, 89,107, 2,178,111,178,135,225, - 244,225,235,225,238, 97,129, 48,185,178,123,232,225,236,230,247, - 233,228,244,104,128,255,125,245,238,225,242,225,226,233, 99,128, - 6, 82,237,237,225,244,233,239,110,128, 34, 17,110,128, 38, 60, - 240,229,242,243,229,116,130, 34,131,178,173,178,184,238,239,244, - 229,241,245,225,108,128, 34,139,239,242,229,241,245,225,108,128, - 34,135,246,243,241,245,225,242,101,128, 51,220,249,239,245,247, - 225,229,242,225,243,241,245,225,242,101,128, 51,124,116,144, 0, - 116,179, 1,180, 10,180, 31,180,174,180,214,183, 6,186,144,187, - 219,187,231,187,243,189, 20,189, 45,189,131,190, 55,190,239,191, - 73, 97, 10,179, 23,179, 33,179, 54,179, 61,179, 86,179,164,179, - 181,179,206,179,220,179,224,226,229,238,231,225,236,105,128, 9, - 164,227,107, 2,179, 40,179, 47,228,239,247,110,128, 34,164,236, - 229,230,116,128, 34,163,228,229,246, 97,128, 9, 36,231,117, 2, - 179, 68,179, 77,234,225,242,225,244,105,128, 10,164,242,237,245, - 235,232,105,128, 10, 36,104, 4,179, 96,179,105,179,119,179,149, - 225,242,225,226,233, 99,128, 6, 55,230,233,238,225,236,225,242, - 225,226,233, 99,128,254,194,105, 2,179,125,179,140,238,233,244, - 233,225,236,225,242,225,226,233, 99,128,254,195,242,225,231,225, - 238, 97,128, 48, 95,237,229,228,233,225,236,225,242,225,226,233, - 99,128,254,196,233,243,249,239,245,229,242,225,243,241,245,225, - 242,101,128, 51,125,235,225,244,225,235,225,238, 97,129, 48,191, - 179,194,232,225,236,230,247,233,228,244,104,128,255,128,244,247, - 229,229,236,225,242,225,226,233, 99,128, 6, 64,117,128, 3,196, - 118,130, 5,234,179,232,180, 1,228,225,231,229,115,129,251, 74, - 179,242,104,129,251, 74,179,248,232,229,226,242,229,119,128,251, - 74,232,229,226,242,229,119,128, 5,234, 98, 2,180, 16,180, 21, - 225,114,128, 1,103,239,240,239,237,239,230,111,128, 49, 10, 99, - 6,180, 45,180, 52,180, 59,180, 68,180,134,180,161,225,242,239, - 110,128, 1,101,227,245,242,108,128, 2,168,229,228,233,236,236, - 97,128, 1, 99,232,229,104, 4,180, 80,180, 89,180,103,180,119, - 225,242,225,226,233, 99,128, 6,134,230,233,238,225,236,225,242, - 225,226,233, 99,128,251,123,233,238,233,244,233,225,236,225,242, - 225,226,233, 99,128,251,124,237,229,228,233,225,236,225,242,225, - 226,233, 99,128,251,125,233,242, 99, 2,180,142,180,147,236,101, - 128, 36,227,245,237,230,236,229,248,226,229,236,239,119,128, 30, - 113,239,237,237,225,225,227,227,229,238,116,128, 1, 99,100, 2, - 180,180,180,190,233,229,242,229,243,233,115,128, 30,151,239,116, - 2,180,197,180,206,225,227,227,229,238,116,128, 30,107,226,229, - 236,239,119,128, 30,109,101, 9,180,234,180,245,181, 9,182, 19, - 182, 44,182,108,182,175,182,180,182,232,227,249,242,233,236,236, - 233, 99,128, 4, 66,228,229,243,227,229,238,228,229,242,227,249, - 242,233,236,236,233, 99,128, 4,173,104, 7,181, 25,181, 34,181, - 48,181, 88,181,118,181,159,182, 1,225,242,225,226,233, 99,128, - 6, 42,230,233,238,225,236,225,242,225,226,233, 99,128,254,150, - 232,225,232,105, 2,181, 57,181, 72,238,233,244,233,225,236,225, - 242,225,226,233, 99,128,252,162,243,239,236,225,244,229,228,225, - 242,225,226,233, 99,128,252, 12,105, 2,181, 94,181,109,238,233, - 244,233,225,236,225,242,225,226,233, 99,128,254,151,242,225,231, - 225,238, 97,128, 48,102,234,229,229,237,105, 2,181,128,181,143, - 238,233,244,233,225,236,225,242,225,226,233, 99,128,252,161,243, - 239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 11,109, - 2,181,165,181,199,225,242,226,245,244, 97, 2,181,176,181,185, - 225,242,225,226,233, 99,128, 6, 41,230,233,238,225,236,225,242, - 225,226,233, 99,128,254,148,101, 2,181,205,181,218,228,233,225, - 236,225,242,225,226,233, 99,128,254,152,229,237,105, 2,181,226, - 181,241,238,233,244,233,225,236,225,242,225,226,233, 99,128,252, - 164,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,252, - 14,238,239,239,238,230,233,238,225,236,225,242,225,226,233, 99, - 128,252,115,235,225,244,225,235,225,238, 97,129, 48,198,182, 32, - 232,225,236,230,247,233,228,244,104,128,255,131,108, 2,182, 50, - 182, 69,229,240,232,239,238,101,129, 33, 33,182, 61,226,236,225, - 227,107,128, 38, 14,233,243,232, 97, 2,182, 78,182, 93,231,229, - 228,239,236,225,232,229,226,242,229,119,128, 5,160,241,229,244, - 225,238,225,232,229,226,242,229,119,128, 5,169,110, 4,182,118, - 182,127,182,146,182,167,227,233,242,227,236,101,128, 36,105,233, - 228,229,239,231,242,225,240,232,233,227,240,225,242,229,110,128, - 50, 41,112, 2,182,152,182,159,225,242,229,110,128, 36,125,229, - 242,233,239,100,128, 36,145,242,239,237,225,110,128, 33,121,243, - 104,128, 2,167,116,131, 5,216,182,190,182,210,182,219,228,225, - 231,229,243,104,129,251, 56,182,201,232,229,226,242,229,119,128, - 251, 56,232,229,226,242,229,119,128, 5,216,243,229,227,249,242, - 233,236,236,233, 99,128, 4,181,246,233,114, 2,182,240,182,249, - 232,229,226,242,229,119,128, 5,155,236,229,230,244,232,229,226, - 242,229,119,128, 5,155,104, 6,183, 20,183,172,184, 38,184,170, - 185, 77,186,134, 97, 5,183, 32,183, 42,183, 49,183, 74,183,103, - 226,229,238,231,225,236,105,128, 9,165,228,229,246, 97,128, 9, - 37,231,117, 2,183, 56,183, 65,234,225,242,225,244,105,128, 10, - 165,242,237,245,235,232,105,128, 10, 37,108, 2,183, 80,183, 89, - 225,242,225,226,233, 99,128, 6, 48,230,233,238,225,236,225,242, - 225,226,233, 99,128,254,172,238,244,232,225,235,232,225,116, 3, - 183,118,183,149,183,156,236,239,119, 2,183,126,183,137,236,229, - 230,244,244,232,225,105,128,248,152,242,233,231,232,244,244,232, - 225,105,128,248,151,244,232,225,105,128, 14, 76,245,240,240,229, - 242,236,229,230,244,244,232,225,105,128,248,150,101, 3,183,180, - 183,244,184, 11,104, 4,183,190,183,199,183,213,183,229,225,242, - 225,226,233, 99,128, 6, 43,230,233,238,225,236,225,242,225,226, - 233, 99,128,254,154,233,238,233,244,233,225,236,225,242,225,226, - 233, 99,128,254,155,237,229,228,233,225,236,225,242,225,226,233, - 99,128,254,156,242,101, 2,183,251,184, 4,229,248,233,243,244, - 115,128, 34, 3,230,239,242,101,128, 34, 52,244, 97,130, 3,184, - 184, 20,184, 24, 49,128, 3,209,243,249,237,226,239,236,231,242, - 229,229,107,128, 3,209,105, 2,184, 44,184,130,229,245,244,104, - 4,184, 57,184, 92,184,107,184,116, 97, 2,184, 63,184, 78,227, - 233,242,227,236,229,235,239,242,229,225,110,128, 50,121,240,225, - 242,229,238,235,239,242,229,225,110,128, 50, 25,227,233,242,227, - 236,229,235,239,242,229,225,110,128, 50,107,235,239,242,229,225, - 110,128, 49, 76,240,225,242,229,238,235,239,242,229,225,110,128, - 50, 11,242,244,229,229,110, 2,184,140,184,149,227,233,242,227, - 236,101,128, 36,108,112, 2,184,155,184,162,225,242,229,110,128, - 36,128,229,242,233,239,100,128, 36,148,111, 6,184,184,184,201, - 184,206,184,220,184,225,185, 22,238,225,238,231,237,239,238,244, - 232,239,244,232,225,105,128, 14, 17,239,107,128, 1,173,240,232, - 245,244,232,225,239,244,232,225,105,128, 14, 18,242,110,128, 0, - 254,244,104, 3,184,234,185, 2,185, 12, 97, 2,184,240,184,250, - 232,225,238,244,232,225,105,128, 14, 23,238,244,232,225,105,128, - 14, 16,239,238,231,244,232,225,105,128, 14, 24,245,238,231,244, - 232,225,105,128, 14, 22,245,243,225,238,100, 2,185, 32,185, 43, - 227,249,242,233,236,236,233, 99,128, 4,130,243,243,229,240,225, - 242,225,244,239,114, 2,185, 58,185, 67,225,242,225,226,233, 99, - 128, 6,108,240,229,242,243,233,225,110,128, 6,108,242,229,101, - 144, 0, 51,185,115,185,124,185,134,185,164,185,171,185,181,185, - 206,185,233,186, 11,186, 23,186, 42,186, 53,186, 86,186,108,186, - 116,186,127,225,242,225,226,233, 99,128, 6, 99,226,229,238,231, - 225,236,105,128, 9,233,227,233,242,227,236,101,129, 36, 98,185, - 145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233, - 102,128, 39,140,228,229,246, 97,128, 9,105,229,233,231,232,244, - 232,115,128, 33, 92,231,117, 2,185,188,185,197,234,225,242,225, - 244,105,128, 10,233,242,237,245,235,232,105,128, 10,105,232, 97, - 2,185,213,185,224,227,235,225,242,225,226,233, 99,128, 6, 99, - 238,231,250,232,239,117,128, 48, 35,105, 2,185,239,186, 1,228, - 229,239,231,242,225,240,232,233,227,240,225,242,229,110,128, 50, - 34,238,230,229,242,233,239,114,128, 32,131,237,239,238,239,243, - 240,225,227,101,128,255, 19,238,245,237,229,242,225,244,239,242, - 226,229,238,231,225,236,105,128, 9,246,239,236,228,243,244,249, - 236,101,128,247, 51,112, 2,186, 59,186, 66,225,242,229,110,128, - 36,118,229,114, 2,186, 73,186, 79,233,239,100,128, 36,138,243, - 233,225,110,128, 6,243,241,245,225,242,244,229,242,115,129, 0, - 190,186, 99,229,237,228,225,243,104,128,246,222,242,239,237,225, - 110,128, 33,114,243,245,240,229,242,233,239,114,128, 0,179,244, - 232,225,105,128, 14, 83,250,243,241,245,225,242,101,128, 51,148, - 105, 7,186,160,186,171,187, 30,187,128,187,140,187,189,187,206, - 232,233,242,225,231,225,238, 97,128, 48, 97,107, 2,186,177,186, - 201,225,244,225,235,225,238, 97,129, 48,193,186,189,232,225,236, - 230,247,233,228,244,104,128,255,129,229,245,116, 4,186,213,186, - 248,187, 7,187, 16, 97, 2,186,219,186,234,227,233,242,227,236, - 229,235,239,242,229,225,110,128, 50,112,240,225,242,229,238,235, - 239,242,229,225,110,128, 50, 16,227,233,242,227,236,229,235,239, - 242,229,225,110,128, 50, 98,235,239,242,229,225,110,128, 49, 55, - 240,225,242,229,238,235,239,242,229,225,110,128, 50, 2,236,228, - 101,133, 2,220,187, 46,187, 57,187, 74,187, 86,187,114,226,229, - 236,239,247,227,237, 98,128, 3, 48, 99, 2,187, 63,187, 68,237, - 98,128, 3, 3,239,237, 98,128, 3, 3,228,239,245,226,236,229, - 227,237, 98,128, 3, 96,111, 2,187, 92,187,102,240,229,242,225, - 244,239,114,128, 34, 60,246,229,242,236,225,249,227,237, 98,128, - 3, 52,246,229,242,244,233,227,225,236,227,237, 98,128, 3, 62, - 237,229,243,227,233,242,227,236,101,128, 34,151,112, 2,187,146, - 187,176,229,232, 97, 2,187,154,187,163,232,229,226,242,229,119, - 128, 5,150,236,229,230,244,232,229,226,242,229,119,128, 5,150, - 240,233,231,245,242,237,245,235,232,105,128, 10,112,244,236,239, - 227,249,242,233,236,236,233,227,227,237, 98,128, 4,131,247,238, - 225,242,237,229,238,233,225,110,128, 5,127,236,233,238,229,226, - 229,236,239,119,128, 30,111,237,239,238,239,243,240,225,227,101, - 128,255, 84,111, 7,188, 3,188, 14,188, 25,188, 50,188,170,188, - 182,189, 10,225,242,237,229,238,233,225,110,128, 5,105,232,233, - 242,225,231,225,238, 97,128, 48,104,235,225,244,225,235,225,238, - 97,129, 48,200,188, 38,232,225,236,230,247,233,228,244,104,128, - 255,132,110, 3,188, 58,188,156,188,161,101, 4,188, 68,188,137, - 188,144,188,150,226,225,114, 4,188, 80,188,109,188,119,188,128, - 229,248,244,242, 97, 2,188, 90,188,100,232,233,231,232,237,239, - 100,128, 2,229,236,239,247,237,239,100,128, 2,233,232,233,231, - 232,237,239,100,128, 2,230,236,239,247,237,239,100,128, 2,232, - 237,233,228,237,239,100,128, 2,231,230,233,246,101,128, 1,189, - 243,233,120,128, 1,133,244,247,111,128, 1,168,239,115,128, 3, - 132,243,241,245,225,242,101,128, 51, 39,240,225,244,225,235,244, - 232,225,105,128, 14, 15,242,244,239,233,243,229,243,232,229,236, - 236,226,242,225,227,235,229,116, 2,188,205,188,235,236,229,230, - 116,130, 48, 20,188,216,188,224,243,237,225,236,108,128,254, 93, - 246,229,242,244,233,227,225,108,128,254, 57,242,233,231,232,116, - 130, 48, 21,188,247,188,255,243,237,225,236,108,128,254, 94,246, - 229,242,244,233,227,225,108,128,254, 58,244,225,239,244,232,225, - 105,128, 14, 21,240, 97, 2,189, 27,189, 39,236,225,244,225,236, - 232,239,239,107,128, 1,171,242,229,110,128, 36,175,114, 3,189, - 53,189, 84,189, 99,225,228,229,237,225,242,107,129, 33, 34,189, - 65,115, 2,189, 71,189, 77,225,238,115,128,248,234,229,242,233, - 102,128,246,219,229,244,242,239,230,236,229,248,232,239,239,107, - 128, 2,136,233,225,103, 4,189,111,189,116,189,121,189,126,228, - 110,128, 37,188,236,102,128, 37,196,242,116,128, 37,186,245,112, - 128, 37,178,115,132, 2,166,189,143,189,182,190, 32,190, 45,225, - 228,105,130, 5,230,189,153,189,173,228,225,231,229,243,104,129, - 251, 70,189,164,232,229,226,242,229,119,128,251, 70,232,229,226, - 242,229,119,128, 5,230,101, 2,189,188,189,199,227,249,242,233, - 236,236,233, 99,128, 4, 70,242,101,134, 5,181,189,216,189,230, - 189,235,189,244,190, 3,190, 19, 49, 2,189,222,189,226, 50,128, - 5,181,101,128, 5,181,178, 98,128, 5,181,232,229,226,242,229, - 119,128, 5,181,238,225,242,242,239,247,232,229,226,242,229,119, - 128, 5,181,241,245,225,242,244,229,242,232,229,226,242,229,119, - 128, 5,181,247,233,228,229,232,229,226,242,229,119,128, 5,181, - 232,229,227,249,242,233,236,236,233, 99,128, 4, 91,245,240,229, - 242,233,239,114,128,246,243,116, 4,190, 65,190,115,190,180,190, - 231, 97, 3,190, 73,190, 83,190, 90,226,229,238,231,225,236,105, - 128, 9,159,228,229,246, 97,128, 9, 31,231,117, 2,190, 97,190, - 106,234,225,242,225,244,105,128, 10,159,242,237,245,235,232,105, - 128, 10, 31,229,104, 4,190,126,190,135,190,149,190,165,225,242, - 225,226,233, 99,128, 6,121,230,233,238,225,236,225,242,225,226, - 233, 99,128,251,103,233,238,233,244,233,225,236,225,242,225,226, - 233, 99,128,251,104,237,229,228,233,225,236,225,242,225,226,233, - 99,128,251,105,232, 97, 3,190,189,190,199,190,206,226,229,238, - 231,225,236,105,128, 9,160,228,229,246, 97,128, 9, 32,231,117, - 2,190,213,190,222,234,225,242,225,244,105,128, 10,160,242,237, - 245,235,232,105,128, 10, 32,245,242,238,229,100,128, 2,135,117, - 3,190,247,191, 2,191, 27,232,233,242,225,231,225,238, 97,128, - 48,100,235,225,244,225,235,225,238, 97,129, 48,196,191, 15,232, - 225,236,230,247,233,228,244,104,128,255,130,243,237,225,236,108, - 2,191, 37,191, 48,232,233,242,225,231,225,238, 97,128, 48, 99, - 235,225,244,225,235,225,238, 97,129, 48,195,191, 61,232,225,236, - 230,247,233,228,244,104,128,255,111,119, 2,191, 79,191,184,101, - 2,191, 85,191,133,236,246,101, 3,191, 95,191,104,191,125,227, - 233,242,227,236,101,128, 36,107,112, 2,191,110,191,117,225,242, - 229,110,128, 36,127,229,242,233,239,100,128, 36,147,242,239,237, - 225,110,128, 33,123,238,244,121, 3,191,143,191,152,191,163,227, - 233,242,227,236,101,128, 36,115,232,225,238,231,250,232,239,117, - 128, 83, 68,112, 2,191,169,191,176,225,242,229,110,128, 36,135, - 229,242,233,239,100,128, 36,155,111,142, 0, 50,191,216,191,225, - 191,235,192, 9,192, 61,192, 86,192,113,192,147,192,159,192,178, - 192,189,192,222,192,230,192,254,225,242,225,226,233, 99,128, 6, - 98,226,229,238,231,225,236,105,128, 9,232,227,233,242,227,236, - 101,129, 36, 97,191,246,233,238,246,229,242,243,229,243,225,238, - 243,243,229,242,233,102,128, 39,139,100, 2,192, 15,192, 21,229, - 246, 97,128, 9,104,239,116, 2,192, 28,192, 39,229,238,236,229, - 225,228,229,114,128, 32, 37,236,229,225,228,229,114,129, 32, 37, - 192, 50,246,229,242,244,233,227,225,108,128,254, 48,231,117, 2, - 192, 68,192, 77,234,225,242,225,244,105,128, 10,232,242,237,245, - 235,232,105,128, 10,104,232, 97, 2,192, 93,192,104,227,235,225, - 242,225,226,233, 99,128, 6, 98,238,231,250,232,239,117,128, 48, - 34,105, 2,192,119,192,137,228,229,239,231,242,225,240,232,233, - 227,240,225,242,229,110,128, 50, 33,238,230,229,242,233,239,114, - 128, 32,130,237,239,238,239,243,240,225,227,101,128,255, 18,238, - 245,237,229,242,225,244,239,242,226,229,238,231,225,236,105,128, - 9,245,239,236,228,243,244,249,236,101,128,247, 50,112, 2,192, - 195,192,202,225,242,229,110,128, 36,117,229,114, 2,192,209,192, - 215,233,239,100,128, 36,137,243,233,225,110,128, 6,242,242,239, - 237,225,110,128, 33,113,115, 2,192,236,192,244,244,242,239,235, - 101,128, 1,187,245,240,229,242,233,239,114,128, 0,178,244,104, - 2,193, 5,193, 10,225,105,128, 14, 82,233,242,228,115,128, 33, - 84,117,145, 0,117,193, 55,193, 63,193,104,193,161,194, 43,194, - 80,194,203,194,219,195, 14,195, 84,195,165,195,174,196, 37,196, - 61,196,169,196,197,197, 55,225,227,245,244,101,128, 0,250, 98, - 4,193, 73,193, 78,193, 87,193, 97,225,114,128, 2,137,229,238, - 231,225,236,105,128, 9,137,239,240,239,237,239,230,111,128, 49, - 40,242,229,246,101,128, 1,109, 99, 3,193,112,193,119,193,151, - 225,242,239,110,128, 1,212,233,242, 99, 2,193,127,193,132,236, - 101,128, 36,228,245,237,230,236,229,120,129, 0,251,193,143,226, - 229,236,239,119,128, 30,119,249,242,233,236,236,233, 99,128, 4, - 67,100, 5,193,173,193,184,193,207,193,213,194, 33,225,244,244, - 225,228,229,246, 97,128, 9, 81,226,108, 2,193,191,193,199,225, - 227,245,244,101,128, 1,113,231,242,225,246,101,128, 2, 21,229, - 246, 97,128, 9, 9,233,229,242,229,243,233,115,133, 0,252,193, - 233,193,241,193,249,194, 16,194, 24,225,227,245,244,101,128, 1, - 216,226,229,236,239,119,128, 30,115, 99, 2,193,255,194, 6,225, - 242,239,110,128, 1,218,249,242,233,236,236,233, 99,128, 4,241, - 231,242,225,246,101,128, 1,220,237,225,227,242,239,110,128, 1, - 214,239,244,226,229,236,239,119,128, 30,229,103, 2,194, 49,194, - 56,242,225,246,101,128, 0,249,117, 2,194, 62,194, 71,234,225, - 242,225,244,105,128, 10,137,242,237,245,235,232,105,128, 10, 9, - 104, 3,194, 88,194, 98,194,176,233,242,225,231,225,238, 97,128, - 48, 70,111, 2,194,104,194,114,239,235,225,226,239,246,101,128, - 30,231,242,110,133, 1,176,194,129,194,137,194,148,194,156,194, - 168,225,227,245,244,101,128, 30,233,228,239,244,226,229,236,239, - 119,128, 30,241,231,242,225,246,101,128, 30,235,232,239,239,235, - 225,226,239,246,101,128, 30,237,244,233,236,228,101,128, 30,239, - 245,238,231,225,242,245,237,236,225,245,116,129, 1,113,194,192, - 227,249,242,233,236,236,233, 99,128, 4,243,233,238,246,229,242, - 244,229,228,226,242,229,246,101,128, 2, 23,107, 3,194,227,194, - 251,195, 6,225,244,225,235,225,238, 97,129, 48,166,194,239,232, - 225,236,230,247,233,228,244,104,128,255,115,227,249,242,233,236, - 236,233, 99,128, 4,121,239,242,229,225,110,128, 49, 92,109, 2, - 195, 20,195, 73, 97, 2,195, 26,195, 59,227,242,239,110,130, 1, - 107,195, 37,195, 48,227,249,242,233,236,236,233, 99,128, 4,239, - 228,233,229,242,229,243,233,115,128, 30,123,244,242,225,231,245, - 242,237,245,235,232,105,128, 10, 65,239,238,239,243,240,225,227, - 101,128,255, 85,110, 2,195, 90,195,145,228,229,242,243,227,239, - 242,101,132, 0, 95,195,109,195,115,195,127,195,138,228,226,108, - 128, 32, 23,237,239,238,239,243,240,225,227,101,128,255, 63,246, - 229,242,244,233,227,225,108,128,254, 51,247,225,246,121,128,254, - 79,105, 2,195,151,195,156,239,110,128, 34, 42,246,229,242,243, - 225,108,128, 34, 0,239,231,239,238,229,107,128, 1,115,112, 5, - 195,186,195,193,195,201,195,216,196, 11,225,242,229,110,128, 36, - 176,226,236,239,227,107,128, 37,128,240,229,242,228,239,244,232, - 229,226,242,229,119,128, 5,196,243,233,236,239,110,131, 3,197, - 195,230,195,251,196, 3,228,233,229,242,229,243,233,115,129, 3, - 203,195,243,244,239,238,239,115,128, 3,176,236,225,244,233,110, - 128, 2,138,244,239,238,239,115,128, 3,205,244,225,227,107, 2, - 196, 20,196, 31,226,229,236,239,247,227,237, 98,128, 3, 29,237, - 239,100,128, 2,212,114, 2,196, 43,196, 55,225,231,245,242,237, - 245,235,232,105,128, 10,115,233,238,103,128, 1,111,115, 3,196, - 69,196, 84,196,129,232,239,242,244,227,249,242,233,236,236,233, - 99,128, 4, 94,237,225,236,108, 2,196, 93,196,104,232,233,242, - 225,231,225,238, 97,128, 48, 69,235,225,244,225,235,225,238, 97, - 129, 48,165,196,117,232,225,236,230,247,233,228,244,104,128,255, - 105,244,242,225,233,231,232,116, 2,196,141,196,152,227,249,242, - 233,236,236,233, 99,128, 4,175,243,244,242,239,235,229,227,249, - 242,233,236,236,233, 99,128, 4,177,244,233,236,228,101,130, 1, - 105,196,181,196,189,225,227,245,244,101,128, 30,121,226,229,236, - 239,119,128, 30,117,117, 5,196,209,196,219,196,226,196,251,197, - 11,226,229,238,231,225,236,105,128, 9,138,228,229,246, 97,128, - 9, 10,231,117, 2,196,233,196,242,234,225,242,225,244,105,128, - 10,138,242,237,245,235,232,105,128, 10, 10,237,225,244,242,225, - 231,245,242,237,245,235,232,105,128, 10, 66,246,239,247,229,236, - 243,233,231,110, 3,197, 27,197, 37,197, 44,226,229,238,231,225, - 236,105,128, 9,194,228,229,246, 97,128, 9, 66,231,245,234,225, - 242,225,244,105,128, 10,194,246,239,247,229,236,243,233,231,110, - 3,197, 71,197, 81,197, 88,226,229,238,231,225,236,105,128, 9, - 193,228,229,246, 97,128, 9, 65,231,245,234,225,242,225,244,105, - 128, 10,193,118,139, 0,118,197,125,198, 17,198, 26,198, 37,198, - 222,198,229,199, 71,199, 83,199,183,199,191,199,212, 97, 4,197, - 135,197,142,197,167,197,178,228,229,246, 97,128, 9, 53,231,117, - 2,197,149,197,158,234,225,242,225,244,105,128, 10,181,242,237, - 245,235,232,105,128, 10, 53,235,225,244,225,235,225,238, 97,128, - 48,247,118,132, 5,213,197,190,197,217,197,249,198, 5,228,225, - 231,229,243,104,130,251, 53,197,203,197,208,182, 53,128,251, 53, - 232,229,226,242,229,119,128,251, 53,104, 2,197,223,197,231,229, - 226,242,229,119,128, 5,213,239,236,225,109,129,251, 75,197,240, - 232,229,226,242,229,119,128,251, 75,246,225,246,232,229,226,242, - 229,119,128, 5,240,249,239,228,232,229,226,242,229,119,128, 5, - 241,227,233,242,227,236,101,128, 36,229,228,239,244,226,229,236, - 239,119,128, 30,127,101, 6,198, 51,198, 62,198,126,198,137,198, - 143,198,210,227,249,242,233,236,236,233, 99,128, 4, 50,104, 4, - 198, 72,198, 81,198, 95,198,111,225,242,225,226,233, 99,128, 6, - 164,230,233,238,225,236,225,242,225,226,233, 99,128,251,107,233, - 238,233,244,233,225,236,225,242,225,226,233, 99,128,251,108,237, - 229,228,233,225,236,225,242,225,226,233, 99,128,251,109,235,225, - 244,225,235,225,238, 97,128, 48,249,238,245,115,128, 38, 64,242, - 244,233,227,225,108, 2,198,154,198,160,226,225,114,128, 0,124, - 236,233,238,101, 4,198,173,198,184,198,195,198,204,225,226,239, - 246,229,227,237, 98,128, 3, 13,226,229,236,239,247,227,237, 98, - 128, 3, 41,236,239,247,237,239,100,128, 2,204,237,239,100,128, - 2,200,247,225,242,237,229,238,233,225,110,128, 5,126,232,239, - 239,107,128, 2,139,105, 3,198,237,198,248,199, 31,235,225,244, - 225,235,225,238, 97,128, 48,248,242,225,237, 97, 3,199, 3,199, - 13,199, 20,226,229,238,231,225,236,105,128, 9,205,228,229,246, - 97,128, 9, 77,231,245,234,225,242,225,244,105,128, 10,205,243, - 225,242,231, 97, 3,199, 43,199, 53,199, 60,226,229,238,231,225, - 236,105,128, 9,131,228,229,246, 97,128, 9, 3,231,245,234,225, - 242,225,244,105,128, 10,131,237,239,238,239,243,240,225,227,101, - 128,255, 86,111, 3,199, 91,199,102,199,172,225,242,237,229,238, - 233,225,110,128, 5,120,233,227,229,100, 2,199,111,199,147,233, - 244,229,242,225,244,233,239,110, 2,199,125,199,136,232,233,242, - 225,231,225,238, 97,128, 48,158,235,225,244,225,235,225,238, 97, - 128, 48,254,237,225,242,235,235,225,238, 97,129, 48,155,199,160, - 232,225,236,230,247,233,228,244,104,128,255,158,235,225,244,225, - 235,225,238, 97,128, 48,250,240,225,242,229,110,128, 36,177,116, - 2,199,197,199,204,233,236,228,101,128, 30,125,245,242,238,229, - 100,128, 2,140,117, 2,199,218,199,229,232,233,242,225,231,225, - 238, 97,128, 48,148,235,225,244,225,235,225,238, 97,128, 48,244, - 119,143, 0,119,200, 18,200,251,201, 5,201, 28,201, 68,201,135, - 201,143,203,114,203,155,203,167,203,242,203,250,204, 1,204, 12, - 204, 21, 97, 8,200, 36,200, 43,200, 53,200, 64,200,102,200,134, - 200,146,200,182,227,245,244,101,128, 30,131,229,235,239,242,229, - 225,110,128, 49, 89,232,233,242,225,231,225,238, 97,128, 48,143, - 107, 2,200, 70,200, 94,225,244,225,235,225,238, 97,129, 48,239, - 200, 82,232,225,236,230,247,233,228,244,104,128,255,156,239,242, - 229,225,110,128, 49, 88,243,237,225,236,108, 2,200,112,200,123, - 232,233,242,225,231,225,238, 97,128, 48,142,235,225,244,225,235, - 225,238, 97,128, 48,238,244,244,239,243,241,245,225,242,101,128, - 51, 87,118, 2,200,152,200,160,229,228,225,243,104,128, 48, 28, - 249,245,238,228,229,242,243,227,239,242,229,246,229,242,244,233, - 227,225,108,128,254, 52,119, 3,200,190,200,199,200,213,225,242, - 225,226,233, 99,128, 6, 72,230,233,238,225,236,225,242,225,226, - 233, 99,128,254,238,232,225,237,250,225,225,226,239,246,101, 2, - 200,228,200,237,225,242,225,226,233, 99,128, 6, 36,230,233,238, - 225,236,225,242,225,226,233, 99,128,254,134,226,243,241,245,225, - 242,101,128, 51,221,227,233,242, 99, 2,201, 14,201, 19,236,101, - 128, 36,230,245,237,230,236,229,120,128, 1,117,100, 2,201, 34, - 201, 44,233,229,242,229,243,233,115,128, 30,133,239,116, 2,201, - 51,201, 60,225,227,227,229,238,116,128, 30,135,226,229,236,239, - 119,128, 30,137,101, 4,201, 78,201, 89,201,101,201,125,232,233, - 242,225,231,225,238, 97,128, 48,145,233,229,242,243,244,242,225, - 243,115,128, 33, 24,107, 2,201,107,201,117,225,244,225,235,225, - 238, 97,128, 48,241,239,242,229,225,110,128, 49, 94,239,235,239, - 242,229,225,110,128, 49, 93,231,242,225,246,101,128, 30,129,232, - 233,244,101, 8,201,164,201,173,202, 1,202, 91,202,175,202,220, - 203, 16,203, 72,226,245,236,236,229,116,128, 37,230, 99, 2,201, - 179,201,199,233,242,227,236,101,129, 37,203,201,189,233,238,246, - 229,242,243,101,128, 37,217,239,242,238,229,242,226,242,225,227, - 235,229,116, 2,201,216,201,236,236,229,230,116,129, 48, 14,201, - 225,246,229,242,244,233,227,225,108,128,254, 67,242,233,231,232, - 116,129, 48, 15,201,246,246,229,242,244,233,227,225,108,128,254, - 68,100, 2,202, 7,202, 48,233,225,237,239,238,100,129, 37,199, - 202, 18,227,239,238,244,225,233,238,233,238,231,226,236,225,227, - 235,243,237,225,236,236,228,233,225,237,239,238,100,128, 37,200, - 239,247,238,240,239,233,238,244,233,238,103, 2,202, 64,202, 80, - 243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,191, - 244,242,233,225,238,231,236,101,128, 37,189,236,101, 2,202, 98, - 202,140,230,244,240,239,233,238,244,233,238,103, 2,202,113,202, - 129,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37, - 195,244,242,233,225,238,231,236,101,128, 37,193,238,244,233,227, - 245,236,225,242,226,242,225,227,235,229,116, 2,202,160,202,167, - 236,229,230,116,128, 48, 22,242,233,231,232,116,128, 48, 23,242, - 233,231,232,244,240,239,233,238,244,233,238,103, 2,202,193,202, - 209,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37, - 185,244,242,233,225,238,231,236,101,128, 37,183,115, 3,202,228, - 203, 2,203, 10,109, 2,202,234,202,246,225,236,236,243,241,245, - 225,242,101,128, 37,171,233,236,233,238,231,230,225,227,101,128, - 38, 58,241,245,225,242,101,128, 37,161,244,225,114,128, 38, 6, - 116, 2,203, 22,203, 33,229,236,229,240,232,239,238,101,128, 38, - 15,239,242,244,239,233,243,229,243,232,229,236,236,226,242,225, - 227,235,229,116, 2,203, 57,203, 64,236,229,230,116,128, 48, 24, - 242,233,231,232,116,128, 48, 25,245,240,240,239,233,238,244,233, - 238,103, 2,203, 87,203,103,243,237,225,236,236,244,242,233,225, - 238,231,236,101,128, 37,181,244,242,233,225,238,231,236,101,128, - 37,179,105, 2,203,120,203,131,232,233,242,225,231,225,238, 97, - 128, 48,144,107, 2,203,137,203,147,225,244,225,235,225,238, 97, - 128, 48,240,239,242,229,225,110,128, 49, 95,237,239,238,239,243, - 240,225,227,101,128,255, 87,111, 4,203,177,203,188,203,213,203, - 231,232,233,242,225,231,225,238, 97,128, 48,146,235,225,244,225, - 235,225,238, 97,129, 48,242,203,201,232,225,236,230,247,233,228, - 244,104,128,255,102,110,129, 32,169,203,219,237,239,238,239,243, - 240,225,227,101,128,255,230,247,225,229,238,244,232,225,105,128, - 14, 39,240,225,242,229,110,128, 36,178,242,233,238,103,128, 30, - 152,243,245,240,229,242,233,239,114,128, 2,183,244,245,242,238, - 229,100,128, 2,141,249,238,110,128, 1,191,120,137, 0,120,204, - 49,204, 60,204, 71,204, 80,204,107,204,120,204,124,204,136,204, - 144,225,226,239,246,229,227,237, 98,128, 3, 61,226,239,240,239, - 237,239,230,111,128, 49, 18,227,233,242,227,236,101,128, 36,231, - 100, 2,204, 86,204, 96,233,229,242,229,243,233,115,128, 30,141, - 239,244,225,227,227,229,238,116,128, 30,139,229,232,225,242,237, - 229,238,233,225,110,128, 5,109,105,128, 3,190,237,239,238,239, - 243,240,225,227,101,128,255, 88,240,225,242,229,110,128, 36,179, - 243,245,240,229,242,233,239,114,128, 2,227,121,143, 0,121,204, - 189,205,148,205,171,205,211,207,177,207,185,207,202,208, 10,208, - 22,209, 19,209, 59,209, 71,209, 82,209,103,210, 76, 97, 11,204, - 213,204,225,204,235,204,242,204,249,205, 3,205, 28,205, 39,205, - 77,205, 90,205,136,225,228,239,243,241,245,225,242,101,128, 51, - 78,226,229,238,231,225,236,105,128, 9,175,227,245,244,101,128, - 0,253,228,229,246, 97,128, 9, 47,229,235,239,242,229,225,110, - 128, 49, 82,231,117, 2,205, 10,205, 19,234,225,242,225,244,105, - 128, 10,175,242,237,245,235,232,105,128, 10, 47,232,233,242,225, - 231,225,238, 97,128, 48,132,107, 2,205, 45,205, 69,225,244,225, - 235,225,238, 97,129, 48,228,205, 57,232,225,236,230,247,233,228, - 244,104,128,255,148,239,242,229,225,110,128, 49, 81,237,225,235, - 235,225,238,244,232,225,105,128, 14, 78,243,237,225,236,108, 2, - 205,100,205,111,232,233,242,225,231,225,238, 97,128, 48,131,235, - 225,244,225,235,225,238, 97,129, 48,227,205,124,232,225,236,230, - 247,233,228,244,104,128,255,108,244,227,249,242,233,236,236,233, - 99,128, 4, 99,227,233,242, 99, 2,205,157,205,162,236,101,128, - 36,232,245,237,230,236,229,120,128, 1,119,100, 2,205,177,205, - 187,233,229,242,229,243,233,115,128, 0,255,239,116, 2,205,194, - 205,203,225,227,227,229,238,116,128, 30,143,226,229,236,239,119, - 128, 30,245,101, 7,205,227,206,235,206,244,207, 6,207, 38,207, - 114,207,165,104, 8,205,245,205,254,206, 32,206, 46,206,119,206, - 135,206,194,206,212,225,242,225,226,233, 99,128, 6, 74,226,225, - 242,242,229,101, 2,206, 9,206, 18,225,242,225,226,233, 99,128, - 6,210,230,233,238,225,236,225,242,225,226,233, 99,128,251,175, - 230,233,238,225,236,225,242,225,226,233, 99,128,254,242,232,225, - 237,250,225,225,226,239,246,101, 4,206, 65,206, 74,206, 88,206, - 104,225,242,225,226,233, 99,128, 6, 38,230,233,238,225,236,225, - 242,225,226,233, 99,128,254,138,233,238,233,244,233,225,236,225, - 242,225,226,233, 99,128,254,139,237,229,228,233,225,236,225,242, - 225,226,233, 99,128,254,140,233,238,233,244,233,225,236,225,242, - 225,226,233, 99,128,254,243,237,101, 2,206,142,206,155,228,233, - 225,236,225,242,225,226,233, 99,128,254,244,229,237,105, 2,206, - 163,206,178,238,233,244,233,225,236,225,242,225,226,233, 99,128, - 252,221,243,239,236,225,244,229,228,225,242,225,226,233, 99,128, - 252, 88,238,239,239,238,230,233,238,225,236,225,242,225,226,233, - 99,128,252,148,244,232,242,229,229,228,239,244,243,226,229,236, - 239,247,225,242,225,226,233, 99,128, 6,209,235,239,242,229,225, - 110,128, 49, 86,110,129, 0,165,206,250,237,239,238,239,243,240, - 225,227,101,128,255,229,111, 2,207, 12,207, 21,235,239,242,229, - 225,110,128, 49, 85,242,233,238,232,233,229,245,232,235,239,242, - 229,225,110,128, 49,134,114, 3,207, 46,207, 82,207, 94,225,232, - 226,229,238,249,239,237,111, 2,207, 60,207, 69,232,229,226,242, - 229,119,128, 5,170,236,229,230,244,232,229,226,242,229,119,128, - 5,170,233,227,249,242,233,236,236,233, 99,128, 4, 75,245,228, - 233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128, - 4,249,243,233,229,245,238,103, 3,207,127,207,136,207,152,235, - 239,242,229,225,110,128, 49,129,240,225,238,243,233,239,243,235, - 239,242,229,225,110,128, 49,131,243,233,239,243,235,239,242,229, - 225,110,128, 49,130,244,233,246,232,229,226,242,229,119,128, 5, - 154,231,242,225,246,101,128, 30,243,232,239,239,107,129, 1,180, - 207,194,225,226,239,246,101,128, 30,247,105, 5,207,214,207,225, - 207,236,207,245,207,253,225,242,237,229,238,233,225,110,128, 5, - 117,227,249,242,233,236,236,233, 99,128, 4, 87,235,239,242,229, - 225,110,128, 49, 98,238,249,225,238,103,128, 38, 47,247,238,225, - 242,237,229,238,233,225,110,128, 5,130,237,239,238,239,243,240, - 225,227,101,128,255, 89,111, 7,208, 38,208,108,208,119,208,129, - 208,167,208,213,208,222,100,131, 5,217,208, 48,208, 68,208, 77, - 228,225,231,229,243,104,129,251, 57,208, 59,232,229,226,242,229, - 119,128,251, 57,232,229,226,242,229,119,128, 5,217,249,239,100, - 2,208, 85,208, 94,232,229,226,242,229,119,128, 5,242,240,225, - 244,225,232,232,229,226,242,229,119,128,251, 31,232,233,242,225, - 231,225,238, 97,128, 48,136,233,235,239,242,229,225,110,128, 49, - 137,107, 2,208,135,208,159,225,244,225,235,225,238, 97,129, 48, - 232,208,147,232,225,236,230,247,233,228,244,104,128,255,150,239, - 242,229,225,110,128, 49, 91,243,237,225,236,108, 2,208,177,208, - 188,232,233,242,225,231,225,238, 97,128, 48,135,235,225,244,225, - 235,225,238, 97,129, 48,231,208,201,232,225,236,230,247,233,228, - 244,104,128,255,110,244,231,242,229,229,107,128, 3,243,121, 2, - 208,228,209, 9, 97, 2,208,234,208,244,229,235,239,242,229,225, - 110,128, 49,136,107, 2,208,250,209, 2,239,242,229,225,110,128, - 49,135,244,232,225,105,128, 14, 34,233,238,231,244,232,225,105, - 128, 14, 13,112, 2,209, 25,209, 32,225,242,229,110,128, 36,180, - 239,231,229,231,242,225,237,237,229,238,105,129, 3,122,209, 48, - 231,242,229,229,235,227,237, 98,128, 3, 69,114,129, 1,166,209, - 65,233,238,103,128, 30,153,243,245,240,229,242,233,239,114,128, - 2,184,116, 2,209, 88,209, 95,233,236,228,101,128, 30,249,245, - 242,238,229,100,128, 2,142,117, 5,209,115,209,126,209,136,209, - 174,210, 50,232,233,242,225,231,225,238, 97,128, 48,134,233,235, - 239,242,229,225,110,128, 49,140,107, 2,209,142,209,166,225,244, - 225,235,225,238, 97,129, 48,230,209,154,232,225,236,230,247,233, - 228,244,104,128,255,149,239,242,229,225,110,128, 49, 96,115, 3, - 209,182,209,220,210, 5,226,233,103, 2,209,190,209,201,227,249, - 242,233,236,236,233, 99,128, 4,107,233,239,244,233,230,233,229, - 228,227,249,242,233,236,236,233, 99,128, 4,109,236,233,244,244, - 236,101, 2,209,231,209,242,227,249,242,233,236,236,233, 99,128, - 4,103,233,239,244,233,230,233,229,228,227,249,242,233,236,236, - 233, 99,128, 4,105,237,225,236,108, 2,210, 14,210, 25,232,233, - 242,225,231,225,238, 97,128, 48,133,235,225,244,225,235,225,238, - 97,129, 48,229,210, 38,232,225,236,230,247,233,228,244,104,128, - 255,109,249,101, 2,210, 57,210, 66,235,239,242,229,225,110,128, - 49,139,239,235,239,242,229,225,110,128, 49,138,249, 97, 2,210, - 83,210, 93,226,229,238,231,225,236,105,128, 9,223,228,229,246, - 97,128, 9, 95,122,142, 0,122,210,132,211,140,211,151,211,194, - 211,221,213, 0,213,108,213,150,213,162,213,174,213,202,213,210, - 213,226,213,235, 97, 10,210,154,210,165,210,172,210,179,210,190, - 211, 12,211, 42,211, 53,211, 89,211,101,225,242,237,229,238,233, - 225,110,128, 5,102,227,245,244,101,128, 1,122,228,229,246, 97, - 128, 9, 91,231,245,242,237,245,235,232,105,128, 10, 91,104, 4, - 210,200,210,209,210,223,210,253,225,242,225,226,233, 99,128, 6, - 56,230,233,238,225,236,225,242,225,226,233, 99,128,254,198,105, - 2,210,229,210,244,238,233,244,233,225,236,225,242,225,226,233, - 99,128,254,199,242,225,231,225,238, 97,128, 48, 86,237,229,228, - 233,225,236,225,242,225,226,233, 99,128,254,200,233,110, 2,211, - 19,211, 28,225,242,225,226,233, 99,128, 6, 50,230,233,238,225, - 236,225,242,225,226,233, 99,128,254,176,235,225,244,225,235,225, - 238, 97,128, 48,182,241,229,102, 2,211, 61,211, 75,231,225,228, - 239,236,232,229,226,242,229,119,128, 5,149,241,225,244,225,238, - 232,229,226,242,229,119,128, 5,148,242,241,225,232,229,226,242, - 229,119,128, 5,152,249,233,110,130, 5,214,211,111,211,131,228, - 225,231,229,243,104,129,251, 54,211,122,232,229,226,242,229,119, - 128,251, 54,232,229,226,242,229,119,128, 5,214,226,239,240,239, - 237,239,230,111,128, 49, 23, 99, 3,211,159,211,166,211,188,225, - 242,239,110,128, 1,126,233,242, 99, 2,211,174,211,179,236,101, - 128, 36,233,245,237,230,236,229,120,128, 30,145,245,242,108,128, - 2,145,228,239,116,130, 1,124,211,204,211,213,225,227,227,229, - 238,116,128, 1,124,226,229,236,239,119,128, 30,147,101, 6,211, - 235,211,246,212, 33,212, 44,212, 55,212,251,227,249,242,233,236, - 236,233, 99,128, 4, 55,100, 2,211,252,212, 15,229,243,227,229, - 238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,153,233, - 229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128, 4, - 223,232,233,242,225,231,225,238, 97,128, 48, 92,235,225,244,225, - 235,225,238, 97,128, 48,188,242,111,140, 0, 48,212, 84,212, 93, - 212,103,212,110,212,135,212,148,212,159,212,171,212,182,212,192, - 212,203,212,210,225,242,225,226,233, 99,128, 6, 96,226,229,238, - 231,225,236,105,128, 9,230,228,229,246, 97,128, 9,102,231,117, - 2,212,117,212,126,234,225,242,225,244,105,128, 10,230,242,237, - 245,235,232,105,128, 10,102,232,225,227,235,225,242,225,226,233, - 99,128, 6, 96,233,238,230,229,242,233,239,114,128, 32,128,237, - 239,238,239,243,240,225,227,101,128,255, 16,239,236,228,243,244, - 249,236,101,128,247, 48,240,229,242,243,233,225,110,128, 6,240, - 243,245,240,229,242,233,239,114,128, 32,112,244,232,225,105,128, - 14, 80,247,233,228,244,104, 3,212,222,212,231,212,243,234,239, - 233,238,229,114,128,254,255,238,239,238,234,239,233,238,229,114, - 128, 32, 12,243,240,225,227,101,128, 32, 11,244, 97,128, 3,182, - 104, 2,213, 6,213, 17,226,239,240,239,237,239,230,111,128, 49, - 19,101, 4,213, 27,213, 38,213, 54,213, 65,225,242,237,229,238, - 233,225,110,128, 5,106,226,242,229,246,229,227,249,242,233,236, - 236,233, 99,128, 4,194,227,249,242,233,236,236,233, 99,128, 4, - 54,100, 2,213, 71,213, 90,229,243,227,229,238,228,229,242,227, - 249,242,233,236,236,233, 99,128, 4,151,233,229,242,229,243,233, - 243,227,249,242,233,236,236,233, 99,128, 4,221,105, 3,213,116, - 213,127,213,138,232,233,242,225,231,225,238, 97,128, 48, 88,235, - 225,244,225,235,225,238, 97,128, 48,184,238,239,242,232,229,226, - 242,229,119,128, 5,174,236,233,238,229,226,229,236,239,119,128, - 30,149,237,239,238,239,243,240,225,227,101,128,255, 90,111, 2, - 213,180,213,191,232,233,242,225,231,225,238, 97,128, 48, 94,235, - 225,244,225,235,225,238, 97,128, 48,190,240,225,242,229,110,128, - 36,181,242,229,244,242,239,230,236,229,248,232,239,239,107,128, - 2,144,243,244,242,239,235,101,128, 1,182,117, 2,213,241,213, - 252,232,233,242,225,231,225,238, 97,128, 48, 90,235,225,244,225, - 235,225,238, 97,128, 48,186 - }; - - - /* - * This function searches the compressed table efficiently. - */ - static unsigned long - ft_get_adobe_glyph_index( const char* name, - const char* limit ) - { - int c = 0; - int count, min, max; - const unsigned char* p = ft_adobe_glyph_list; - - - if ( name == 0 || name >= limit ) - goto NotFound; - - c = *name++; - count = p[1]; - p += 2; - - min = 0; - max = count; - - while ( min < max ) - { - int mid = ( min + max ) >> 1; - const unsigned char* q = p + mid * 2; - int c2; - - - q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] ); - - c2 = q[0] & 127; - if ( c2 == c ) - { - p = q; - goto Found; - } - if ( c2 < c ) - min = mid + 1; - else - max = mid; - } - goto NotFound; - - Found: - for (;;) - { - /* assert (*p & 127) == c */ - - if ( name >= limit ) - { - if ( (p[0] & 128) == 0 && - (p[1] & 128) != 0 ) - return (unsigned long)( ( (int)p[2] << 8 ) | p[3] ); - - goto NotFound; - } - c = *name++; - if ( p[0] & 128 ) - { - p++; - if ( c != (p[0] & 127) ) - goto NotFound; - - continue; - } - - p++; - count = p[0] & 127; - if ( p[0] & 128 ) - p += 2; - - p++; - - for ( ; count > 0; count--, p += 2 ) - { - int offset = ( (int)p[0] << 8 ) | p[1]; - const unsigned char* q = ft_adobe_glyph_list + offset; - - if ( c == ( q[0] & 127 ) ) - { - p = q; - goto NextIter; - } - } - goto NotFound; - - NextIter: - ; - } - - NotFound: - return 0; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* pstables.h */ +/* */ +/* PostScript glyph names. */ +/* */ +/* Copyright 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /* This file has been generated automatically -- do not edit! */ + + + static const char ft_standard_glyph_names[3696] = + { + '.','n','u','l','l', 0, + 'n','o','n','m','a','r','k','i','n','g','r','e','t','u','r','n', 0, + 'n','o','t','e','q','u','a','l', 0, + 'i','n','f','i','n','i','t','y', 0, + 'l','e','s','s','e','q','u','a','l', 0, + 'g','r','e','a','t','e','r','e','q','u','a','l', 0, + 'p','a','r','t','i','a','l','d','i','f','f', 0, + 's','u','m','m','a','t','i','o','n', 0, + 'p','r','o','d','u','c','t', 0, + 'p','i', 0, + 'i','n','t','e','g','r','a','l', 0, + 'O','m','e','g','a', 0, + 'r','a','d','i','c','a','l', 0, + 'a','p','p','r','o','x','e','q','u','a','l', 0, + 'D','e','l','t','a', 0, + 'n','o','n','b','r','e','a','k','i','n','g','s','p','a','c','e', 0, + 'l','o','z','e','n','g','e', 0, + 'a','p','p','l','e', 0, + 'f','r','a','n','c', 0, + 'G','b','r','e','v','e', 0, + 'g','b','r','e','v','e', 0, + 'I','d','o','t','a','c','c','e','n','t', 0, + 'S','c','e','d','i','l','l','a', 0, + 's','c','e','d','i','l','l','a', 0, + 'C','a','c','u','t','e', 0, + 'c','a','c','u','t','e', 0, + 'C','c','a','r','o','n', 0, + 'c','c','a','r','o','n', 0, + 'd','c','r','o','a','t', 0, + '.','n','o','t','d','e','f', 0, + 's','p','a','c','e', 0, + 'e','x','c','l','a','m', 0, + 'q','u','o','t','e','d','b','l', 0, + 'n','u','m','b','e','r','s','i','g','n', 0, + 'd','o','l','l','a','r', 0, + 'p','e','r','c','e','n','t', 0, + 'a','m','p','e','r','s','a','n','d', 0, + 'q','u','o','t','e','r','i','g','h','t', 0, + 'p','a','r','e','n','l','e','f','t', 0, + 'p','a','r','e','n','r','i','g','h','t', 0, + 'a','s','t','e','r','i','s','k', 0, + 'p','l','u','s', 0, + 'c','o','m','m','a', 0, + 'h','y','p','h','e','n', 0, + 'p','e','r','i','o','d', 0, + 's','l','a','s','h', 0, + 'z','e','r','o', 0, + 'o','n','e', 0, + 't','w','o', 0, + 't','h','r','e','e', 0, + 'f','o','u','r', 0, + 'f','i','v','e', 0, + 's','i','x', 0, + 's','e','v','e','n', 0, + 'e','i','g','h','t', 0, + 'n','i','n','e', 0, + 'c','o','l','o','n', 0, + 's','e','m','i','c','o','l','o','n', 0, + 'l','e','s','s', 0, + 'e','q','u','a','l', 0, + 'g','r','e','a','t','e','r', 0, + 'q','u','e','s','t','i','o','n', 0, + 'a','t', 0, + 'A', 0, + 'B', 0, + 'C', 0, + 'D', 0, + 'E', 0, + 'F', 0, + 'G', 0, + 'H', 0, + 'I', 0, + 'J', 0, + 'K', 0, + 'L', 0, + 'M', 0, + 'N', 0, + 'O', 0, + 'P', 0, + 'Q', 0, + 'R', 0, + 'S', 0, + 'T', 0, + 'U', 0, + 'V', 0, + 'W', 0, + 'X', 0, + 'Y', 0, + 'Z', 0, + 'b','r','a','c','k','e','t','l','e','f','t', 0, + 'b','a','c','k','s','l','a','s','h', 0, + 'b','r','a','c','k','e','t','r','i','g','h','t', 0, + 'a','s','c','i','i','c','i','r','c','u','m', 0, + 'u','n','d','e','r','s','c','o','r','e', 0, + 'q','u','o','t','e','l','e','f','t', 0, + 'a', 0, + 'b', 0, + 'c', 0, + 'd', 0, + 'e', 0, + 'f', 0, + 'g', 0, + 'h', 0, + 'i', 0, + 'j', 0, + 'k', 0, + 'l', 0, + 'm', 0, + 'n', 0, + 'o', 0, + 'p', 0, + 'q', 0, + 'r', 0, + 's', 0, + 't', 0, + 'u', 0, + 'v', 0, + 'w', 0, + 'x', 0, + 'y', 0, + 'z', 0, + 'b','r','a','c','e','l','e','f','t', 0, + 'b','a','r', 0, + 'b','r','a','c','e','r','i','g','h','t', 0, + 'a','s','c','i','i','t','i','l','d','e', 0, + 'e','x','c','l','a','m','d','o','w','n', 0, + 'c','e','n','t', 0, + 's','t','e','r','l','i','n','g', 0, + 'f','r','a','c','t','i','o','n', 0, + 'y','e','n', 0, + 'f','l','o','r','i','n', 0, + 's','e','c','t','i','o','n', 0, + 'c','u','r','r','e','n','c','y', 0, + 'q','u','o','t','e','s','i','n','g','l','e', 0, + 'q','u','o','t','e','d','b','l','l','e','f','t', 0, + 'g','u','i','l','l','e','m','o','t','l','e','f','t', 0, + 'g','u','i','l','s','i','n','g','l','l','e','f','t', 0, + 'g','u','i','l','s','i','n','g','l','r','i','g','h','t', 0, + 'f','i', 0, + 'f','l', 0, + 'e','n','d','a','s','h', 0, + 'd','a','g','g','e','r', 0, + 'd','a','g','g','e','r','d','b','l', 0, + 'p','e','r','i','o','d','c','e','n','t','e','r','e','d', 0, + 'p','a','r','a','g','r','a','p','h', 0, + 'b','u','l','l','e','t', 0, + 'q','u','o','t','e','s','i','n','g','l','b','a','s','e', 0, + 'q','u','o','t','e','d','b','l','b','a','s','e', 0, + 'q','u','o','t','e','d','b','l','r','i','g','h','t', 0, + 'g','u','i','l','l','e','m','o','t','r','i','g','h','t', 0, + 'e','l','l','i','p','s','i','s', 0, + 'p','e','r','t','h','o','u','s','a','n','d', 0, + 'q','u','e','s','t','i','o','n','d','o','w','n', 0, + 'g','r','a','v','e', 0, + 'a','c','u','t','e', 0, + 'c','i','r','c','u','m','f','l','e','x', 0, + 't','i','l','d','e', 0, + 'm','a','c','r','o','n', 0, + 'b','r','e','v','e', 0, + 'd','o','t','a','c','c','e','n','t', 0, + 'd','i','e','r','e','s','i','s', 0, + 'r','i','n','g', 0, + 'c','e','d','i','l','l','a', 0, + 'h','u','n','g','a','r','u','m','l','a','u','t', 0, + 'o','g','o','n','e','k', 0, + 'c','a','r','o','n', 0, + 'e','m','d','a','s','h', 0, + 'A','E', 0, + 'o','r','d','f','e','m','i','n','i','n','e', 0, + 'L','s','l','a','s','h', 0, + 'O','s','l','a','s','h', 0, + 'O','E', 0, + 'o','r','d','m','a','s','c','u','l','i','n','e', 0, + 'a','e', 0, + 'd','o','t','l','e','s','s','i', 0, + 'l','s','l','a','s','h', 0, + 'o','s','l','a','s','h', 0, + 'o','e', 0, + 'g','e','r','m','a','n','d','b','l','s', 0, + 'o','n','e','s','u','p','e','r','i','o','r', 0, + 'l','o','g','i','c','a','l','n','o','t', 0, + 'm','u', 0, + 't','r','a','d','e','m','a','r','k', 0, + 'E','t','h', 0, + 'o','n','e','h','a','l','f', 0, + 'p','l','u','s','m','i','n','u','s', 0, + 'T','h','o','r','n', 0, + 'o','n','e','q','u','a','r','t','e','r', 0, + 'd','i','v','i','d','e', 0, + 'b','r','o','k','e','n','b','a','r', 0, + 'd','e','g','r','e','e', 0, + 't','h','o','r','n', 0, + 't','h','r','e','e','q','u','a','r','t','e','r','s', 0, + 't','w','o','s','u','p','e','r','i','o','r', 0, + 'r','e','g','i','s','t','e','r','e','d', 0, + 'm','i','n','u','s', 0, + 'e','t','h', 0, + 'm','u','l','t','i','p','l','y', 0, + 't','h','r','e','e','s','u','p','e','r','i','o','r', 0, + 'c','o','p','y','r','i','g','h','t', 0, + 'A','a','c','u','t','e', 0, + 'A','c','i','r','c','u','m','f','l','e','x', 0, + 'A','d','i','e','r','e','s','i','s', 0, + 'A','g','r','a','v','e', 0, + 'A','r','i','n','g', 0, + 'A','t','i','l','d','e', 0, + 'C','c','e','d','i','l','l','a', 0, + 'E','a','c','u','t','e', 0, + 'E','c','i','r','c','u','m','f','l','e','x', 0, + 'E','d','i','e','r','e','s','i','s', 0, + 'E','g','r','a','v','e', 0, + 'I','a','c','u','t','e', 0, + 'I','c','i','r','c','u','m','f','l','e','x', 0, + 'I','d','i','e','r','e','s','i','s', 0, + 'I','g','r','a','v','e', 0, + 'N','t','i','l','d','e', 0, + 'O','a','c','u','t','e', 0, + 'O','c','i','r','c','u','m','f','l','e','x', 0, + 'O','d','i','e','r','e','s','i','s', 0, + 'O','g','r','a','v','e', 0, + 'O','t','i','l','d','e', 0, + 'S','c','a','r','o','n', 0, + 'U','a','c','u','t','e', 0, + 'U','c','i','r','c','u','m','f','l','e','x', 0, + 'U','d','i','e','r','e','s','i','s', 0, + 'U','g','r','a','v','e', 0, + 'Y','a','c','u','t','e', 0, + 'Y','d','i','e','r','e','s','i','s', 0, + 'Z','c','a','r','o','n', 0, + 'a','a','c','u','t','e', 0, + 'a','c','i','r','c','u','m','f','l','e','x', 0, + 'a','d','i','e','r','e','s','i','s', 0, + 'a','g','r','a','v','e', 0, + 'a','r','i','n','g', 0, + 'a','t','i','l','d','e', 0, + 'c','c','e','d','i','l','l','a', 0, + 'e','a','c','u','t','e', 0, + 'e','c','i','r','c','u','m','f','l','e','x', 0, + 'e','d','i','e','r','e','s','i','s', 0, + 'e','g','r','a','v','e', 0, + 'i','a','c','u','t','e', 0, + 'i','c','i','r','c','u','m','f','l','e','x', 0, + 'i','d','i','e','r','e','s','i','s', 0, + 'i','g','r','a','v','e', 0, + 'n','t','i','l','d','e', 0, + 'o','a','c','u','t','e', 0, + 'o','c','i','r','c','u','m','f','l','e','x', 0, + 'o','d','i','e','r','e','s','i','s', 0, + 'o','g','r','a','v','e', 0, + 'o','t','i','l','d','e', 0, + 's','c','a','r','o','n', 0, + 'u','a','c','u','t','e', 0, + 'u','c','i','r','c','u','m','f','l','e','x', 0, + 'u','d','i','e','r','e','s','i','s', 0, + 'u','g','r','a','v','e', 0, + 'y','a','c','u','t','e', 0, + 'y','d','i','e','r','e','s','i','s', 0, + 'z','c','a','r','o','n', 0, + 'e','x','c','l','a','m','s','m','a','l','l', 0, + 'H','u','n','g','a','r','u','m','l','a','u','t','s','m','a','l','l', 0, + 'd','o','l','l','a','r','o','l','d','s','t','y','l','e', 0, + 'd','o','l','l','a','r','s','u','p','e','r','i','o','r', 0, + 'a','m','p','e','r','s','a','n','d','s','m','a','l','l', 0, + 'A','c','u','t','e','s','m','a','l','l', 0, + 'p','a','r','e','n','l','e','f','t','s','u','p','e','r','i','o','r', 0, + 'p','a','r','e','n','r','i','g','h','t','s','u','p','e','r','i','o','r', 0, + 't','w','o','d','o','t','e','n','l','e','a','d','e','r', 0, + 'o','n','e','d','o','t','e','n','l','e','a','d','e','r', 0, + 'z','e','r','o','o','l','d','s','t','y','l','e', 0, + 'o','n','e','o','l','d','s','t','y','l','e', 0, + 't','w','o','o','l','d','s','t','y','l','e', 0, + 't','h','r','e','e','o','l','d','s','t','y','l','e', 0, + 'f','o','u','r','o','l','d','s','t','y','l','e', 0, + 'f','i','v','e','o','l','d','s','t','y','l','e', 0, + 's','i','x','o','l','d','s','t','y','l','e', 0, + 's','e','v','e','n','o','l','d','s','t','y','l','e', 0, + 'e','i','g','h','t','o','l','d','s','t','y','l','e', 0, + 'n','i','n','e','o','l','d','s','t','y','l','e', 0, + 'c','o','m','m','a','s','u','p','e','r','i','o','r', 0, + 't','h','r','e','e','q','u','a','r','t','e','r','s','e','m','d','a','s','h', 0, + 'p','e','r','i','o','d','s','u','p','e','r','i','o','r', 0, + 'q','u','e','s','t','i','o','n','s','m','a','l','l', 0, + 'a','s','u','p','e','r','i','o','r', 0, + 'b','s','u','p','e','r','i','o','r', 0, + 'c','e','n','t','s','u','p','e','r','i','o','r', 0, + 'd','s','u','p','e','r','i','o','r', 0, + 'e','s','u','p','e','r','i','o','r', 0, + 'i','s','u','p','e','r','i','o','r', 0, + 'l','s','u','p','e','r','i','o','r', 0, + 'm','s','u','p','e','r','i','o','r', 0, + 'n','s','u','p','e','r','i','o','r', 0, + 'o','s','u','p','e','r','i','o','r', 0, + 'r','s','u','p','e','r','i','o','r', 0, + 's','s','u','p','e','r','i','o','r', 0, + 't','s','u','p','e','r','i','o','r', 0, + 'f','f', 0, + 'f','f','i', 0, + 'f','f','l', 0, + 'p','a','r','e','n','l','e','f','t','i','n','f','e','r','i','o','r', 0, + 'p','a','r','e','n','r','i','g','h','t','i','n','f','e','r','i','o','r', 0, + 'C','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, + 'h','y','p','h','e','n','s','u','p','e','r','i','o','r', 0, + 'G','r','a','v','e','s','m','a','l','l', 0, + 'A','s','m','a','l','l', 0, + 'B','s','m','a','l','l', 0, + 'C','s','m','a','l','l', 0, + 'D','s','m','a','l','l', 0, + 'E','s','m','a','l','l', 0, + 'F','s','m','a','l','l', 0, + 'G','s','m','a','l','l', 0, + 'H','s','m','a','l','l', 0, + 'I','s','m','a','l','l', 0, + 'J','s','m','a','l','l', 0, + 'K','s','m','a','l','l', 0, + 'L','s','m','a','l','l', 0, + 'M','s','m','a','l','l', 0, + 'N','s','m','a','l','l', 0, + 'O','s','m','a','l','l', 0, + 'P','s','m','a','l','l', 0, + 'Q','s','m','a','l','l', 0, + 'R','s','m','a','l','l', 0, + 'S','s','m','a','l','l', 0, + 'T','s','m','a','l','l', 0, + 'U','s','m','a','l','l', 0, + 'V','s','m','a','l','l', 0, + 'W','s','m','a','l','l', 0, + 'X','s','m','a','l','l', 0, + 'Y','s','m','a','l','l', 0, + 'Z','s','m','a','l','l', 0, + 'c','o','l','o','n','m','o','n','e','t','a','r','y', 0, + 'o','n','e','f','i','t','t','e','d', 0, + 'r','u','p','i','a','h', 0, + 'T','i','l','d','e','s','m','a','l','l', 0, + 'e','x','c','l','a','m','d','o','w','n','s','m','a','l','l', 0, + 'c','e','n','t','o','l','d','s','t','y','l','e', 0, + 'L','s','l','a','s','h','s','m','a','l','l', 0, + 'S','c','a','r','o','n','s','m','a','l','l', 0, + 'Z','c','a','r','o','n','s','m','a','l','l', 0, + 'D','i','e','r','e','s','i','s','s','m','a','l','l', 0, + 'B','r','e','v','e','s','m','a','l','l', 0, + 'C','a','r','o','n','s','m','a','l','l', 0, + 'D','o','t','a','c','c','e','n','t','s','m','a','l','l', 0, + 'M','a','c','r','o','n','s','m','a','l','l', 0, + 'f','i','g','u','r','e','d','a','s','h', 0, + 'h','y','p','h','e','n','i','n','f','e','r','i','o','r', 0, + 'O','g','o','n','e','k','s','m','a','l','l', 0, + 'R','i','n','g','s','m','a','l','l', 0, + 'C','e','d','i','l','l','a','s','m','a','l','l', 0, + 'q','u','e','s','t','i','o','n','d','o','w','n','s','m','a','l','l', 0, + 'o','n','e','e','i','g','h','t','h', 0, + 't','h','r','e','e','e','i','g','h','t','h','s', 0, + 'f','i','v','e','e','i','g','h','t','h','s', 0, + 's','e','v','e','n','e','i','g','h','t','h','s', 0, + 'o','n','e','t','h','i','r','d', 0, + 't','w','o','t','h','i','r','d','s', 0, + 'z','e','r','o','s','u','p','e','r','i','o','r', 0, + 'f','o','u','r','s','u','p','e','r','i','o','r', 0, + 'f','i','v','e','s','u','p','e','r','i','o','r', 0, + 's','i','x','s','u','p','e','r','i','o','r', 0, + 's','e','v','e','n','s','u','p','e','r','i','o','r', 0, + 'e','i','g','h','t','s','u','p','e','r','i','o','r', 0, + 'n','i','n','e','s','u','p','e','r','i','o','r', 0, + 'z','e','r','o','i','n','f','e','r','i','o','r', 0, + 'o','n','e','i','n','f','e','r','i','o','r', 0, + 't','w','o','i','n','f','e','r','i','o','r', 0, + 't','h','r','e','e','i','n','f','e','r','i','o','r', 0, + 'f','o','u','r','i','n','f','e','r','i','o','r', 0, + 'f','i','v','e','i','n','f','e','r','i','o','r', 0, + 's','i','x','i','n','f','e','r','i','o','r', 0, + 's','e','v','e','n','i','n','f','e','r','i','o','r', 0, + 'e','i','g','h','t','i','n','f','e','r','i','o','r', 0, + 'n','i','n','e','i','n','f','e','r','i','o','r', 0, + 'c','e','n','t','i','n','f','e','r','i','o','r', 0, + 'd','o','l','l','a','r','i','n','f','e','r','i','o','r', 0, + 'p','e','r','i','o','d','i','n','f','e','r','i','o','r', 0, + 'c','o','m','m','a','i','n','f','e','r','i','o','r', 0, + 'A','g','r','a','v','e','s','m','a','l','l', 0, + 'A','a','c','u','t','e','s','m','a','l','l', 0, + 'A','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, + 'A','t','i','l','d','e','s','m','a','l','l', 0, + 'A','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, + 'A','r','i','n','g','s','m','a','l','l', 0, + 'A','E','s','m','a','l','l', 0, + 'C','c','e','d','i','l','l','a','s','m','a','l','l', 0, + 'E','g','r','a','v','e','s','m','a','l','l', 0, + 'E','a','c','u','t','e','s','m','a','l','l', 0, + 'E','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, + 'E','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, + 'I','g','r','a','v','e','s','m','a','l','l', 0, + 'I','a','c','u','t','e','s','m','a','l','l', 0, + 'I','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, + 'I','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, + 'E','t','h','s','m','a','l','l', 0, + 'N','t','i','l','d','e','s','m','a','l','l', 0, + 'O','g','r','a','v','e','s','m','a','l','l', 0, + 'O','a','c','u','t','e','s','m','a','l','l', 0, + 'O','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, + 'O','t','i','l','d','e','s','m','a','l','l', 0, + 'O','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, + 'O','E','s','m','a','l','l', 0, + 'O','s','l','a','s','h','s','m','a','l','l', 0, + 'U','g','r','a','v','e','s','m','a','l','l', 0, + 'U','a','c','u','t','e','s','m','a','l','l', 0, + 'U','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0, + 'U','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, + 'Y','a','c','u','t','e','s','m','a','l','l', 0, + 'T','h','o','r','n','s','m','a','l','l', 0, + 'Y','d','i','e','r','e','s','i','s','s','m','a','l','l', 0, + '0','0','1','.','0','0','0', 0, + '0','0','1','.','0','0','1', 0, + '0','0','1','.','0','0','2', 0, + '0','0','1','.','0','0','3', 0, + 'B','l','a','c','k', 0, + 'B','o','l','d', 0, + 'B','o','o','k', 0, + 'L','i','g','h','t', 0, + 'M','e','d','i','u','m', 0, + 'R','e','g','u','l','a','r', 0, + 'R','o','m','a','n', 0, + 'S','e','m','i','b','o','l','d', 0, + }; + + +#define FT_NUM_MAC_NAMES 258 + + /* Values are offsets into the `ft_standard_glyph_names' table */ + + static const short ft_mac_names[FT_NUM_MAC_NAMES] = + { + 253, 0, 6, 261, 267, 274, 283, 294, 301, 309, 758, 330, 340, 351, + 360, 365, 371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430, + 436, 441, 447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498, + 500, 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, + 528, 530, 532, 534, 536, 538, 540, 552, 562, 575, 587, 979, 608, 610, + 612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, + 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685, + 1375,1392,1405,1414,1486,1512,1562,1603,1632,1610,1622,1645,1639,1652, + 1661,1690,1668,1680,1697,1726,1704,1716,1733,1740,1769,1747,1759,1776, + 1790,1819,1797,1809, 839,1263, 707, 712, 741, 881, 871,1160,1302,1346, + 1197, 985,1031, 23,1086,1108, 32,1219, 41, 51, 730,1194, 64, 76, + 86, 94, 97,1089,1118, 106,1131,1150, 966, 696,1183, 112, 734, 120, + 132, 783, 930, 945, 138,1385,1398,1529,1115,1157, 832,1079, 770, 916, + 598, 319,1246, 155,1833,1586, 721, 749, 797, 811, 826, 829, 846, 856, + 888, 903, 954,1363,1421,1356,1433,1443,1450,1457,1469,1479,1493,1500, + 163,1522,1543,1550,1572,1134, 991,1002,1008,1015,1021,1040,1045,1053, + 1066,1073,1101,1143,1536,1783,1596,1843,1253,1207,1319,1579,1826,1229, + 1270,1313,1323,1171,1290,1332,1211,1235,1276, 169, 175, 182, 189, 200, + 209, 218, 225, 232, 239, 246 + }; + + +#define FT_NUM_SID_NAMES 391 + + /* Values are offsets into the `ft_standard_glyph_names' table */ + + static const short ft_sid_names[FT_NUM_SID_NAMES] = + { + 253, 261, 267, 274, 283, 294, 301, 309, 319, 330, 340, 351, 360, 365, + 371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430, 436, 441, + 447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498, 500, 502, + 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, + 532, 534, 536, 538, 540, 552, 562, 575, 587, 598, 608, 610, 612, 614, + 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642, + 644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685, 696, 707, + 712, 721, 730, 734, 741, 749, 758, 770, 783, 797, 811, 826, 829, 832, + 839, 846, 856, 871, 881, 888, 903, 916, 930, 945, 954, 966, 979, 985, + 991,1002,1008,1015,1021,1031,1040,1045,1053,1066,1073,1079,1086,1089, + 1101,1108,1115,1118,1131,1134,1143,1150,1157,1160,1171,1183,1194,1197, + 1207,1211,1219,1229,1235,1246,1253,1263,1270,1276,1290,1302,1313,1319, + 1323,1332,1346,1356,1363,1375,1385,1392,1398,1405,1414,1421,1433,1443, + 1450,1457,1469,1479,1486,1493,1500,1512,1522,1529,1536,1543,1550,1562, + 1572,1579,1586,1596,1603,1610,1622,1632,1639,1645,1652,1661,1668,1680, + 1690,1697,1704,1716,1726,1733,1740,1747,1759,1769,1776,1783,1790,1797, + 1809,1819,1826,1833,1843,1850,1862,1880,1895,1910,1925,1936,1954,1973, + 1988,2003,2016,2028,2040,2054,2067,2080,2092,2106,2120,2133,2147,2167, + 2182,2196,2206,2216,2229,2239,2249,2259,2269,2279,2289,2299,2309,2319, + 2329,2332,2336,2340,2358,2377,2393,2408,2419,2426,2433,2440,2447,2454, + 2461,2468,2475,2482,2489,2496,2503,2510,2517,2524,2531,2538,2545,2552, + 2559,2566,2573,2580,2587,2594,2601,2615,2625,2632,2643,2659,2672,2684, + 2696,2708,2722,2733,2744,2759,2771,2782,2797,2809,2819,2832,2850,2860, + 2873,2885,2898,2907,2917,2930,2943,2956,2968,2982,2996,3009,3022,3034, + 3046,3060,3073,3086,3098,3112,3126,3139,3152,3167,3182,3196,3208,3220, + 3237,3249,3264,3275,3283,3297,3309,3321,3338,3353,3365,3377,3394,3409, + 3418,3430,3442,3454,3471,3483,3498,3506,3518,3530,3542,3559,3574,3586, + 3597,3612,3620,3628,3636,3644,3650,3655,3660,3666,3673,3681,3687 + }; + + + /* the following are indices into the SID name table */ + static const unsigned short t1_standard_encoding[256] = + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110, + 0,111,112,113,114, 0,115,116,117,118,119,120,121,122, 0,123, + 0,124,125,126,127,128,129,130,131, 0,132,133, 0,134,135,136, + 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,138, 0,139, 0, 0, 0, 0,140,141,142,143, 0, 0, 0, 0, + 0,144, 0, 0, 0,145, 0, 0,146,147,148,149, 0, 0, 0, 0 + }; + + + /* the following are indices into the SID name table */ + static const unsigned short t1_expert_encoding[256] = + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1,229,230, 0,231,232,233,234,235,236,237,238, 13, 14, 15, 99, + 239,240,241,242,243,244,245,246,247,248, 27, 28,249,250,251,252, + 0,253,254,255,256,257, 0, 0, 0,258, 0, 0,259,260,261,262, + 0, 0,263,264,265, 0,266,109,110,267,268,269, 0,270,271,272, + 273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288, + 289,290,291,292,293,294,295,296,297,298,299,300,301,302,303, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0,304,305,306, 0, 0,307,308,309,310,311, 0,312, 0, 0,313, + 0, 0,314,315, 0, 0,316,317,318, 0, 0, 0,158,155,163,319, + 320,321,322,323,324,325, 0, 0,326,150,164,169,327,328,329,330, + 331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346, + 347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362, + 363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378 + }; + + + /* + * This table is a compressed version of the Adobe Glyph List (AGL), + * optimized for efficient searching. It has been generated by the + * `glnames.py' python script located in the `src/tools' directory. + * + * The lookup function to get the Unicode value for a given string + * is defined below the table. + */ + static const unsigned char ft_adobe_glyph_list[54791] = + { + 0, 52, 0,106, 2,167, 3, 63, 4,220, 6,125, 9,143, 10, 23, + 11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88, + 22,110, 23, 32, 23, 71, 24, 77, 27,156, 29, 73, 31,247, 32,107, + 32,222, 33, 55, 34,154, 35,218, 53, 84, 59,196, 68, 6, 75,183, + 83,178, 88,135, 93,242,101,165,109,185,111, 55,117,254,123, 73, + 130,238,138,206,145, 31,153,182,156,189,163,249,178,221,193, 17, + 197, 99,199,240,204, 27,204,155,210,100, 65,143, 0, 65, 0,140, + 0,175, 0,193, 1, 15, 1,147, 1,233, 1,251, 2, 7, 2, 40, + 2, 57, 2, 82, 2, 91, 2,128, 2,136, 2,154, 69,131, 0,198, + 0,150, 0,158, 0,167,225,227,245,244,101,128, 1,252,237,225, + 227,242,239,110,128, 1,226,243,237,225,236,108,128,247,230,225, + 227,245,244,101,129, 0,193, 0,185,243,237,225,236,108,128,247, + 225,226,242,229,246,101,134, 1, 2, 0,213, 0,221, 0,232, 0, + 243, 0,251, 1, 7,225,227,245,244,101,128, 30,174,227,249,242, + 233,236,236,233, 99,128, 4,208,228,239,244,226,229,236,239,119, + 128, 30,182,231,242,225,246,101,128, 30,176,232,239,239,235,225, + 226,239,246,101,128, 30,178,244,233,236,228,101,128, 30,180, 99, + 4, 1, 25, 1, 32, 1,121, 1,137,225,242,239,110,128, 1,205, + 233,242, 99, 2, 1, 40, 1, 45,236,101,128, 36,182,245,237,230, + 236,229,120,134, 0,194, 1, 66, 1, 74, 1, 85, 1, 93, 1,105, + 1,113,225,227,245,244,101,128, 30,164,228,239,244,226,229,236, + 239,119,128, 30,172,231,242,225,246,101,128, 30,166,232,239,239, + 235,225,226,239,246,101,128, 30,168,243,237,225,236,108,128,247, + 226,244,233,236,228,101,128, 30,170,245,244,101,129,246,201, 1, + 129,243,237,225,236,108,128,247,180,249,242,233,236,236,233, 99, + 128, 4, 16,100, 3, 1,155, 1,165, 1,209,226,236,231,242,225, + 246,101,128, 2, 0,233,229,242,229,243,233,115,131, 0,196, 1, + 181, 1,192, 1,201,227,249,242,233,236,236,233, 99,128, 4,210, + 237,225,227,242,239,110,128, 1,222,243,237,225,236,108,128,247, + 228,239,116, 2, 1,216, 1,224,226,229,236,239,119,128, 30,160, + 237,225,227,242,239,110,128, 1,224,231,242,225,246,101,129, 0, + 192, 1,243,243,237,225,236,108,128,247,224,232,239,239,235,225, + 226,239,246,101,128, 30,162,105, 2, 2, 13, 2, 25,229,227,249, + 242,233,236,236,233, 99,128, 4,212,238,246,229,242,244,229,228, + 226,242,229,246,101,128, 2, 2,236,240,232, 97,129, 3,145, 2, + 49,244,239,238,239,115,128, 3,134,109, 2, 2, 63, 2, 71,225, + 227,242,239,110,128, 1, 0,239,238,239,243,240,225,227,101,128, + 255, 33,239,231,239,238,229,107,128, 1, 4,242,233,238,103,131, + 0,197, 2,104, 2,112, 2,120,225,227,245,244,101,128, 1,250, + 226,229,236,239,119,128, 30, 0,243,237,225,236,108,128,247,229, + 243,237,225,236,108,128,247, 97,244,233,236,228,101,129, 0,195, + 2,146,243,237,225,236,108,128,247,227,249,226,225,242,237,229, + 238,233,225,110,128, 5, 49, 66,137, 0, 66, 2,189, 2,198, 2, + 223, 3, 3, 3, 10, 3, 22, 3, 34, 3, 46, 3, 54,227,233,242, + 227,236,101,128, 36,183,228,239,116, 2, 2,206, 2,215,225,227, + 227,229,238,116,128, 30, 2,226,229,236,239,119,128, 30, 4,101, + 3, 2,231, 2,242, 2,254,227,249,242,233,236,236,233, 99,128, + 4, 17,238,225,242,237,229,238,233,225,110,128, 5, 50,244, 97, + 128, 3,146,232,239,239,107,128, 1,129,236,233,238,229,226,229, + 236,239,119,128, 30, 6,237,239,238,239,243,240,225,227,101,128, + 255, 34,242,229,246,229,243,237,225,236,108,128,246,244,243,237, + 225,236,108,128,247, 98,244,239,240,226,225,114,128, 1,130, 67, + 137, 0, 67, 3, 85, 3,127, 3,193, 3,210, 3,224, 4,171, 4, + 188, 4,200, 4,212, 97, 3, 3, 93, 3,104, 3,111,225,242,237, + 229,238,233,225,110,128, 5, 62,227,245,244,101,128, 1, 6,242, + 239,110,129,246,202, 3,119,243,237,225,236,108,128,246,245, 99, + 3, 3,135, 3,142, 3,171,225,242,239,110,128, 1, 12,229,228, + 233,236,236, 97,130, 0,199, 3,155, 3,163,225,227,245,244,101, + 128, 30, 8,243,237,225,236,108,128,247,231,233,242, 99, 2, 3, + 179, 3,184,236,101,128, 36,184,245,237,230,236,229,120,128, 1, + 8,228,239,116,129, 1, 10, 3,201,225,227,227,229,238,116,128, + 1, 10,229,228,233,236,236,225,243,237,225,236,108,128,247,184, + 104, 4, 3,234, 3,246, 4,161, 4,165,225,225,242,237,229,238, + 233,225,110,128, 5, 73,101, 6, 4, 4, 4, 24, 4, 35, 4,103, + 4,115, 4,136,225,226,235,232,225,243,233,225,238,227,249,242, + 233,236,236,233, 99,128, 4,188,227,249,242,233,236,236,233, 99, + 128, 4, 39,100, 2, 4, 41, 4, 85,229,243,227,229,238,228,229, + 114, 2, 4, 54, 4, 74,225,226,235,232,225,243,233,225,238,227, + 249,242,233,236,236,233, 99,128, 4,190,227,249,242,233,236,236, + 233, 99,128, 4,182,233,229,242,229,243,233,243,227,249,242,233, + 236,236,233, 99,128, 4,244,232,225,242,237,229,238,233,225,110, + 128, 5, 67,235,232,225,235,225,243,243,233,225,238,227,249,242, + 233,236,236,233, 99,128, 4,203,246,229,242,244,233,227,225,236, + 243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128, 4, + 184,105,128, 3,167,239,239,107,128, 1,135,233,242,227,245,237, + 230,236,229,248,243,237,225,236,108,128,246,246,237,239,238,239, + 243,240,225,227,101,128,255, 35,239,225,242,237,229,238,233,225, + 110,128, 5, 81,243,237,225,236,108,128,247, 99, 68,142, 0, 68, + 4,252, 5, 10, 5, 36, 5, 96, 5,121, 5,166, 5,173, 5,231, + 5,244, 6, 0, 6, 12, 6, 28, 6, 48, 6, 57, 90,129, 1,241, + 5, 2,227,225,242,239,110,128, 1,196, 97, 2, 5, 16, 5, 27, + 225,242,237,229,238,233,225,110,128, 5, 52,230,242,233,227,225, + 110,128, 1,137, 99, 4, 5, 46, 5, 53, 5, 62, 5, 89,225,242, + 239,110,128, 1, 14,229,228,233,236,236, 97,128, 30, 16,233,242, + 99, 2, 5, 70, 5, 75,236,101,128, 36,185,245,237,230,236,229, + 248,226,229,236,239,119,128, 30, 18,242,239,225,116,128, 1, 16, + 228,239,116, 2, 5,104, 5,113,225,227,227,229,238,116,128, 30, + 10,226,229,236,239,119,128, 30, 12,101, 3, 5,129, 5,140, 5, + 150,227,249,242,233,236,236,233, 99,128, 4, 20,233,227,239,240, + 244,233, 99,128, 3,238,236,244, 97,129, 34, 6, 5,158,231,242, + 229,229,107,128, 3,148,232,239,239,107,128, 1,138,105, 2, 5, + 179, 5,218,229,242,229,243,233,115,131,246,203, 5,194, 5,202, + 5,210,193,227,245,244,101,128,246,204,199,242,225,246,101,128, + 246,205,243,237,225,236,108,128,247,168,231,225,237,237,225,231, + 242,229,229,107,128, 3,220,234,229,227,249,242,233,236,236,233, + 99,128, 4, 2,236,233,238,229,226,229,236,239,119,128, 30, 14, + 237,239,238,239,243,240,225,227,101,128,255, 36,239,244,225,227, + 227,229,238,244,243,237,225,236,108,128,246,247,115, 2, 6, 34, + 6, 41,236,225,243,104,128, 1, 16,237,225,236,108,128,247,100, + 244,239,240,226,225,114,128, 1,139,122,131, 1,242, 6, 67, 6, + 75, 6,112,227,225,242,239,110,128, 1,197,101, 2, 6, 81, 6, + 101,225,226,235,232,225,243,233,225,238,227,249,242,233,236,236, + 233, 99,128, 4,224,227,249,242,233,236,236,233, 99,128, 4, 5, + 232,229,227,249,242,233,236,236,233, 99,128, 4, 15, 69,146, 0, + 69, 6,165, 6,183, 6,191, 7, 89, 7,153, 7,165, 7,183, 7, + 211, 8, 7, 8, 36, 8, 94, 8,169, 8,189, 8,208, 8,248, 9, + 44, 9,109, 9,115,225,227,245,244,101,129, 0,201, 6,175,243, + 237,225,236,108,128,247,233,226,242,229,246,101,128, 1, 20, 99, + 5, 6,203, 6,210, 6,224, 6,236, 7, 79,225,242,239,110,128, + 1, 26,229,228,233,236,236,225,226,242,229,246,101,128, 30, 28, + 232,225,242,237,229,238,233,225,110,128, 5, 53,233,242, 99, 2, + 6,244, 6,249,236,101,128, 36,186,245,237,230,236,229,120,135, + 0,202, 7, 16, 7, 24, 7, 32, 7, 43, 7, 51, 7, 63, 7, 71, + 225,227,245,244,101,128, 30,190,226,229,236,239,119,128, 30, 24, + 228,239,244,226,229,236,239,119,128, 30,198,231,242,225,246,101, + 128, 30,192,232,239,239,235,225,226,239,246,101,128, 30,194,243, + 237,225,236,108,128,247,234,244,233,236,228,101,128, 30,196,249, + 242,233,236,236,233, 99,128, 4, 4,100, 3, 7, 97, 7,107, 7, + 127,226,236,231,242,225,246,101,128, 2, 4,233,229,242,229,243, + 233,115,129, 0,203, 7,119,243,237,225,236,108,128,247,235,239, + 116,130, 1, 22, 7,136, 7,145,225,227,227,229,238,116,128, 1, + 22,226,229,236,239,119,128, 30,184,230,227,249,242,233,236,236, + 233, 99,128, 4, 36,231,242,225,246,101,129, 0,200, 7,175,243, + 237,225,236,108,128,247,232,104, 2, 7,189, 7,200,225,242,237, + 229,238,233,225,110,128, 5, 55,239,239,235,225,226,239,246,101, + 128, 30,186,105, 3, 7,219, 7,230, 7,245,231,232,244,242,239, + 237,225,110,128, 33,103,238,246,229,242,244,229,228,226,242,229, + 246,101,128, 2, 6,239,244,233,230,233,229,228,227,249,242,233, + 236,236,233, 99,128, 4,100,108, 2, 8, 13, 8, 24,227,249,242, + 233,236,236,233, 99,128, 4, 27,229,246,229,238,242,239,237,225, + 110,128, 33,106,109, 3, 8, 44, 8, 72, 8, 83,225,227,242,239, + 110,130, 1, 18, 8, 56, 8, 64,225,227,245,244,101,128, 30, 22, + 231,242,225,246,101,128, 30, 20,227,249,242,233,236,236,233, 99, + 128, 4, 28,239,238,239,243,240,225,227,101,128,255, 37,110, 4, + 8,104, 8,115, 8,135, 8,154,227,249,242,233,236,236,233, 99, + 128, 4, 29,228,229,243,227,229,238,228,229,242,227,249,242,233, + 236,236,233, 99,128, 4,162,103,129, 1, 74, 8,141,232,229,227, + 249,242,233,236,236,233, 99,128, 4,164,232,239,239,235,227,249, + 242,233,236,236,233, 99,128, 4,199,111, 2, 8,175, 8,183,231, + 239,238,229,107,128, 1, 24,240,229,110,128, 1,144,240,243,233, + 236,239,110,129, 3,149, 8,200,244,239,238,239,115,128, 3,136, + 114, 2, 8,214, 8,225,227,249,242,233,236,236,233, 99,128, 4, + 32,229,246,229,242,243,229,100,129, 1,142, 8,237,227,249,242, + 233,236,236,233, 99,128, 4, 45,115, 4, 9, 2, 9, 13, 9, 33, + 9, 37,227,249,242,233,236,236,233, 99,128, 4, 33,228,229,243, + 227,229,238,228,229,242,227,249,242,233,236,236,233, 99,128, 4, + 170,104,128, 1,169,237,225,236,108,128,247,101,116, 3, 9, 52, + 9, 78, 9, 92, 97,130, 3,151, 9, 60, 9, 70,242,237,229,238, + 233,225,110,128, 5, 56,244,239,238,239,115,128, 3,137,104,129, + 0,208, 9, 84,243,237,225,236,108,128,247,240,233,236,228,101, + 129, 30,188, 9,101,226,229,236,239,119,128, 30, 26,245,242,111, + 128, 32,172,250,104,130, 1,183, 9,124, 9,132,227,225,242,239, + 110,128, 1,238,242,229,246,229,242,243,229,100,128, 1,184, 70, + 136, 0, 70, 9,163, 9,172, 9,184, 9,212, 9,219, 9,248, 10, + 4, 10, 15,227,233,242,227,236,101,128, 36,187,228,239,244,225, + 227,227,229,238,116,128, 30, 30,101, 2, 9,190, 9,202,232,225, + 242,237,229,238,233,225,110,128, 5, 86,233,227,239,240,244,233, + 99,128, 3,228,232,239,239,107,128, 1,145,105, 2, 9,225, 9, + 238,244,225,227,249,242,233,236,236,233, 99,128, 4,114,246,229, + 242,239,237,225,110,128, 33,100,237,239,238,239,243,240,225,227, + 101,128,255, 38,239,245,242,242,239,237,225,110,128, 33, 99,243, + 237,225,236,108,128,247,102, 71,140, 0, 71, 10, 51, 10, 61, 10, + 107, 10,115, 10,176, 10,193, 10,205, 11, 39, 11, 52, 11, 65, 11, + 90, 11,107,194,243,241,245,225,242,101,128, 51,135, 97, 3, 10, + 69, 10, 76, 10, 94,227,245,244,101,128, 1,244,237,237, 97,129, + 3,147, 10, 84,225,230,242,233,227,225,110,128, 1,148,238,231, + 233,225,227,239,240,244,233, 99,128, 3,234,226,242,229,246,101, + 128, 1, 30, 99, 4, 10,125, 10,132, 10,141, 10,163,225,242,239, + 110,128, 1,230,229,228,233,236,236, 97,128, 1, 34,233,242, 99, + 2, 10,149, 10,154,236,101,128, 36,188,245,237,230,236,229,120, + 128, 1, 28,239,237,237,225,225,227,227,229,238,116,128, 1, 34, + 228,239,116,129, 1, 32, 10,184,225,227,227,229,238,116,128, 1, + 32,229,227,249,242,233,236,236,233, 99,128, 4, 19,104, 3, 10, + 213, 10,226, 11, 33,225,228,225,242,237,229,238,233,225,110,128, + 5, 66,101, 3, 10,234, 10,255, 11, 16,237,233,228,228,236,229, + 232,239,239,235,227,249,242,233,236,236,233, 99,128, 4,148,243, + 244,242,239,235,229,227,249,242,233,236,236,233, 99,128, 4,146, + 245,240,244,245,242,238,227,249,242,233,236,236,233, 99,128, 4, + 144,239,239,107,128, 1,147,233,237,225,242,237,229,238,233,225, + 110,128, 5, 51,234,229,227,249,242,233,236,236,233, 99,128, 4, + 3,109, 2, 11, 71, 11, 79,225,227,242,239,110,128, 30, 32,239, + 238,239,243,240,225,227,101,128,255, 39,242,225,246,101,129,246, + 206, 11, 99,243,237,225,236,108,128,247, 96,115, 2, 11,113, 11, + 129,237,225,236,108,129,247,103, 11,122,232,239,239,107,128, 2, + 155,244,242,239,235,101,128, 1,228, 72,140, 0, 72, 11,165, 11, + 190, 11,198, 11,208, 12, 17, 12, 40, 12, 77, 12,117, 12,129, 12, + 157, 12,165, 12,189,177,184, 53, 3, 11,175, 11,180, 11,185,179, + 51,128, 37,207,180, 51,128, 37,170,181, 49,128, 37,171,178,178, + 176,183, 51,128, 37,161,208,243,241,245,225,242,101,128, 51,203, + 97, 3, 11,216, 11,236, 12, 0,225,226,235,232,225,243,233,225, + 238,227,249,242,233,236,236,233, 99,128, 4,168,228,229,243,227, + 229,238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,178, + 242,228,243,233,231,238,227,249,242,233,236,236,233, 99,128, 4, + 42, 98, 2, 12, 23, 12, 28,225,114,128, 1, 38,242,229,246,229, + 226,229,236,239,119,128, 30, 42, 99, 2, 12, 46, 12, 55,229,228, + 233,236,236, 97,128, 30, 40,233,242, 99, 2, 12, 63, 12, 68,236, + 101,128, 36,189,245,237,230,236,229,120,128, 1, 36,100, 2, 12, + 83, 12, 93,233,229,242,229,243,233,115,128, 30, 38,239,116, 2, + 12,100, 12,109,225,227,227,229,238,116,128, 30, 34,226,229,236, + 239,119,128, 30, 36,237,239,238,239,243,240,225,227,101,128,255, + 40,111, 2, 12,135, 12,146,225,242,237,229,238,233,225,110,128, + 5, 64,242,233,227,239,240,244,233, 99,128, 3,232,243,237,225, + 236,108,128,247,104,245,238,231,225,242,245,237,236,225,245,116, + 129,246,207, 12,181,243,237,225,236,108,128,246,248,250,243,241, + 245,225,242,101,128, 51,144, 73,146, 0, 73, 12,239, 12,251, 12, + 255, 13, 11, 13, 29, 13, 37, 13, 94, 13,181, 13,214, 13,224, 13, + 242, 13,254, 14, 48, 14, 86, 14, 99, 14,166, 14,187, 14,205,193, + 227,249,242,233,236,236,233, 99,128, 4, 47, 74,128, 1, 50,213, + 227,249,242,233,236,236,233, 99,128, 4, 46,225,227,245,244,101, + 129, 0,205, 13, 21,243,237,225,236,108,128,247,237,226,242,229, + 246,101,128, 1, 44, 99, 3, 13, 45, 13, 52, 13, 84,225,242,239, + 110,128, 1,207,233,242, 99, 2, 13, 60, 13, 65,236,101,128, 36, + 190,245,237,230,236,229,120,129, 0,206, 13, 76,243,237,225,236, + 108,128,247,238,249,242,233,236,236,233, 99,128, 4, 6,100, 3, + 13,102, 13,112, 13,155,226,236,231,242,225,246,101,128, 2, 8, + 233,229,242,229,243,233,115,131, 0,207, 13,128, 13,136, 13,147, + 225,227,245,244,101,128, 30, 46,227,249,242,233,236,236,233, 99, + 128, 4,228,243,237,225,236,108,128,247,239,239,116,130, 1, 48, + 13,164, 13,173,225,227,227,229,238,116,128, 1, 48,226,229,236, + 239,119,128, 30,202,101, 2, 13,187, 13,203,226,242,229,246,229, + 227,249,242,233,236,236,233, 99,128, 4,214,227,249,242,233,236, + 236,233, 99,128, 4, 21,230,242,225,235,244,245,114,128, 33, 17, + 231,242,225,246,101,129, 0,204, 13,234,243,237,225,236,108,128, + 247,236,232,239,239,235,225,226,239,246,101,128, 30,200,105, 3, + 14, 6, 14, 17, 14, 32,227,249,242,233,236,236,233, 99,128, 4, + 24,238,246,229,242,244,229,228,226,242,229,246,101,128, 2, 10, + 243,232,239,242,244,227,249,242,233,236,236,233, 99,128, 4, 25, + 109, 2, 14, 54, 14, 75,225,227,242,239,110,129, 1, 42, 14, 64, + 227,249,242,233,236,236,233, 99,128, 4,226,239,238,239,243,240, + 225,227,101,128,255, 41,238,233,225,242,237,229,238,233,225,110, + 128, 5, 59,111, 3, 14,107, 14,118, 14,126,227,249,242,233,236, + 236,233, 99,128, 4, 1,231,239,238,229,107,128, 1, 46,244, 97, + 131, 3,153, 14,137, 14,147, 14,158,225,230,242,233,227,225,110, + 128, 1,150,228,233,229,242,229,243,233,115,128, 3,170,244,239, + 238,239,115,128, 3,138,115, 2, 14,172, 14,179,237,225,236,108, + 128,247,105,244,242,239,235,101,128, 1,151,244,233,236,228,101, + 129, 1, 40, 14,197,226,229,236,239,119,128, 30, 44,250,232,233, + 244,243, 97, 2, 14,216, 14,227,227,249,242,233,236,236,233, 99, + 128, 4,116,228,226,236,231,242,225,246,229,227,249,242,233,236, + 236,233, 99,128, 4,118, 74,134, 0, 74, 15, 6, 15, 18, 15, 41, + 15, 53, 15, 67, 15, 79,225,225,242,237,229,238,233,225,110,128, + 5, 65,227,233,242, 99, 2, 15, 27, 15, 32,236,101,128, 36,191, + 245,237,230,236,229,120,128, 1, 52,229,227,249,242,233,236,236, + 233, 99,128, 4, 8,232,229,232,225,242,237,229,238,233,225,110, + 128, 5, 75,237,239,238,239,243,240,225,227,101,128,255, 42,243, + 237,225,236,108,128,247,106, 75,140, 0, 75, 15,115, 15,125, 15, + 135, 16, 18, 16, 65, 16, 76, 16,106, 16,143, 16,156, 16,168, 16, + 180, 16,208,194,243,241,245,225,242,101,128, 51,133,203,243,241, + 245,225,242,101,128, 51,205, 97, 7, 15,151, 15,169, 15,191, 15, + 211, 15,226, 15,232, 15,249,226,225,243,232,235,233,242,227,249, + 242,233,236,236,233, 99,128, 4,160, 99, 2, 15,175, 15,181,245, + 244,101,128, 30, 48,249,242,233,236,236,233, 99,128, 4, 26,228, + 229,243,227,229,238,228,229,242,227,249,242,233,236,236,233, 99, + 128, 4,154,232,239,239,235,227,249,242,233,236,236,233, 99,128, + 4,195,240,240, 97,128, 3,154,243,244,242,239,235,229,227,249, + 242,233,236,236,233, 99,128, 4,158,246,229,242,244,233,227,225, + 236,243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128, + 4,156, 99, 4, 16, 28, 16, 35, 16, 44, 16, 52,225,242,239,110, + 128, 1,232,229,228,233,236,236, 97,128, 1, 54,233,242,227,236, + 101,128, 36,192,239,237,237,225,225,227,227,229,238,116,128, 1, + 54,228,239,244,226,229,236,239,119,128, 30, 50,101, 2, 16, 82, + 16, 94,232,225,242,237,229,238,233,225,110,128, 5, 84,238,225, + 242,237,229,238,233,225,110,128, 5, 63,104, 3, 16,114, 16,126, + 16,137,225,227,249,242,233,236,236,233, 99,128, 4, 37,229,233, + 227,239,240,244,233, 99,128, 3,230,239,239,107,128, 1,152,234, + 229,227,249,242,233,236,236,233, 99,128, 4, 12,236,233,238,229, + 226,229,236,239,119,128, 30, 52,237,239,238,239,243,240,225,227, + 101,128,255, 43,239,240,240, 97, 2, 16,189, 16,200,227,249,242, + 233,236,236,233, 99,128, 4,128,231,242,229,229,107,128, 3,222, + 115, 2, 16,214, 16,226,233,227,249,242,233,236,236,233, 99,128, + 4,110,237,225,236,108,128,247,107, 76,138, 0, 76, 17, 1, 17, + 5, 17, 9, 17, 29, 17, 95, 17,133, 17,147, 17,165, 17,177, 17, + 189, 74,128, 1,199, 76,128,246,191, 97, 2, 17, 15, 17, 22,227, + 245,244,101,128, 1, 57,237,226,228, 97,128, 3,155, 99, 4, 17, + 39, 17, 46, 17, 55, 17, 82,225,242,239,110,128, 1, 61,229,228, + 233,236,236, 97,128, 1, 59,233,242, 99, 2, 17, 63, 17, 68,236, + 101,128, 36,193,245,237,230,236,229,248,226,229,236,239,119,128, + 30, 60,239,237,237,225,225,227,227,229,238,116,128, 1, 59,228, + 239,116,130, 1, 63, 17,105, 17,114,225,227,227,229,238,116,128, + 1, 63,226,229,236,239,119,129, 30, 54, 17,124,237,225,227,242, + 239,110,128, 30, 56,233,247,238,225,242,237,229,238,233,225,110, + 128, 5, 60,106,129, 1,200, 17,153,229,227,249,242,233,236,236, + 233, 99,128, 4, 9,236,233,238,229,226,229,236,239,119,128, 30, + 58,237,239,238,239,243,240,225,227,101,128,255, 44,115, 2, 17, + 195, 17,212,236,225,243,104,129, 1, 65, 17,204,243,237,225,236, + 108,128,246,249,237,225,236,108,128,247,108, 77,137, 0, 77, 17, + 241, 17,251, 18, 24, 18, 33, 18, 58, 18, 71, 18, 83, 18, 91, 18, + 100,194,243,241,245,225,242,101,128, 51,134,225, 99, 2, 18, 2, + 18, 18,242,239,110,129,246,208, 18, 10,243,237,225,236,108,128, + 247,175,245,244,101,128, 30, 62,227,233,242,227,236,101,128, 36, + 194,228,239,116, 2, 18, 41, 18, 50,225,227,227,229,238,116,128, + 30, 64,226,229,236,239,119,128, 30, 66,229,238,225,242,237,229, + 238,233,225,110,128, 5, 68,237,239,238,239,243,240,225,227,101, + 128,255, 45,243,237,225,236,108,128,247,109,244,245,242,238,229, + 100,128, 1,156,117,128, 3,156, 78,141, 0, 78, 18,134, 18,138, + 18,146, 18,212, 18,237, 18,248, 19, 3, 19, 21, 19, 33, 19, 45, + 19, 58, 19, 66, 19, 84, 74,128, 1,202,225,227,245,244,101,128, + 1, 67, 99, 4, 18,156, 18,163, 18,172, 18,199,225,242,239,110, + 128, 1, 71,229,228,233,236,236, 97,128, 1, 69,233,242, 99, 2, + 18,180, 18,185,236,101,128, 36,195,245,237,230,236,229,248,226, + 229,236,239,119,128, 30, 74,239,237,237,225,225,227,227,229,238, + 116,128, 1, 69,228,239,116, 2, 18,220, 18,229,225,227,227,229, + 238,116,128, 30, 68,226,229,236,239,119,128, 30, 70,232,239,239, + 235,236,229,230,116,128, 1,157,233,238,229,242,239,237,225,110, + 128, 33,104,106,129, 1,203, 19, 9,229,227,249,242,233,236,236, + 233, 99,128, 4, 10,236,233,238,229,226,229,236,239,119,128, 30, + 72,237,239,238,239,243,240,225,227,101,128,255, 46,239,247,225, + 242,237,229,238,233,225,110,128, 5, 70,243,237,225,236,108,128, + 247,110,244,233,236,228,101,129, 0,209, 19, 76,243,237,225,236, + 108,128,247,241,117,128, 3,157, 79,141, 0, 79, 19,118, 19,132, + 19,150, 19,203, 20, 78, 20,152, 20,187, 21, 48, 21, 69, 21,213, + 21,223, 21,254, 22, 53, 69,129, 1, 82, 19,124,243,237,225,236, + 108,128,246,250,225,227,245,244,101,129, 0,211, 19,142,243,237, + 225,236,108,128,247,243, 98, 2, 19,156, 19,196,225,242,242,229, + 100, 2, 19,166, 19,177,227,249,242,233,236,236,233, 99,128, 4, + 232,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, + 99,128, 4,234,242,229,246,101,128, 1, 78, 99, 4, 19,213, 19, + 220, 19,235, 20, 68,225,242,239,110,128, 1,209,229,238,244,229, + 242,229,228,244,233,236,228,101,128, 1,159,233,242, 99, 2, 19, + 243, 19,248,236,101,128, 36,196,245,237,230,236,229,120,134, 0, + 212, 20, 13, 20, 21, 20, 32, 20, 40, 20, 52, 20, 60,225,227,245, + 244,101,128, 30,208,228,239,244,226,229,236,239,119,128, 30,216, + 231,242,225,246,101,128, 30,210,232,239,239,235,225,226,239,246, + 101,128, 30,212,243,237,225,236,108,128,247,244,244,233,236,228, + 101,128, 30,214,249,242,233,236,236,233, 99,128, 4, 30,100, 3, + 20, 86, 20,109, 20,142,226,108, 2, 20, 93, 20,101,225,227,245, + 244,101,128, 1, 80,231,242,225,246,101,128, 2, 12,233,229,242, + 229,243,233,115,130, 0,214, 20,123, 20,134,227,249,242,233,236, + 236,233, 99,128, 4,230,243,237,225,236,108,128,247,246,239,244, + 226,229,236,239,119,128, 30,204,103, 2, 20,158, 20,170,239,238, + 229,235,243,237,225,236,108,128,246,251,242,225,246,101,129, 0, + 210, 20,179,243,237,225,236,108,128,247,242,104, 4, 20,197, 20, + 208, 20,212, 21, 34,225,242,237,229,238,233,225,110,128, 5, 85, + 109,128, 33, 38,111, 2, 20,218, 20,228,239,235,225,226,239,246, + 101,128, 30,206,242,110,133, 1,160, 20,243, 20,251, 21, 6, 21, + 14, 21, 26,225,227,245,244,101,128, 30,218,228,239,244,226,229, + 236,239,119,128, 30,226,231,242,225,246,101,128, 30,220,232,239, + 239,235,225,226,239,246,101,128, 30,222,244,233,236,228,101,128, + 30,224,245,238,231,225,242,245,237,236,225,245,116,128, 1, 80, + 105,129, 1,162, 21, 54,238,246,229,242,244,229,228,226,242,229, + 246,101,128, 2, 14,109, 4, 21, 79, 21,107, 21,184, 21,202,225, + 227,242,239,110,130, 1, 76, 21, 91, 21, 99,225,227,245,244,101, + 128, 30, 82,231,242,225,246,101,128, 30, 80,229,231, 97,132, 33, + 38, 21,121, 21,132, 21,140, 21,156,227,249,242,233,236,236,233, + 99,128, 4, 96,231,242,229,229,107,128, 3,169,242,239,245,238, + 228,227,249,242,233,236,236,233, 99,128, 4,122,116, 2, 21,162, + 21,177,233,244,236,239,227,249,242,233,236,236,233, 99,128, 4, + 124,239,238,239,115,128, 3,143,233,227,242,239,110,129, 3,159, + 21,194,244,239,238,239,115,128, 3,140,239,238,239,243,240,225, + 227,101,128,255, 47,238,229,242,239,237,225,110,128, 33, 96,111, + 2, 21,229, 21,248,231,239,238,229,107,129, 1,234, 21,239,237, + 225,227,242,239,110,128, 1,236,240,229,110,128, 1,134,115, 3, + 22, 6, 22, 33, 22, 40,236,225,243,104,130, 0,216, 22, 17, 22, + 25,225,227,245,244,101,128, 1,254,243,237,225,236,108,128,247, + 248,237,225,236,108,128,247,111,244,242,239,235,229,225,227,245, + 244,101,128, 1,254,116, 2, 22, 59, 22, 70,227,249,242,233,236, + 236,233, 99,128, 4,126,233,236,228,101,131, 0,213, 22, 83, 22, + 91, 22,102,225,227,245,244,101,128, 30, 76,228,233,229,242,229, + 243,233,115,128, 30, 78,243,237,225,236,108,128,247,245, 80,136, + 0, 80, 22,130, 22,138, 22,147, 22,159, 22,211, 22,227, 22,246, + 23, 2,225,227,245,244,101,128, 30, 84,227,233,242,227,236,101, + 128, 36,197,228,239,244,225,227,227,229,238,116,128, 30, 86,101, + 3, 22,167, 22,178, 22,190,227,249,242,233,236,236,233, 99,128, + 4, 31,232,225,242,237,229,238,233,225,110,128, 5, 74,237,233, + 228,228,236,229,232,239,239,235,227,249,242,233,236,236,233, 99, + 128, 4,166,104, 2, 22,217, 22,221,105,128, 3,166,239,239,107, + 128, 1,164,105,129, 3,160, 22,233,247,242,225,242,237,229,238, + 233,225,110,128, 5, 83,237,239,238,239,243,240,225,227,101,128, + 255, 48,115, 2, 23, 8, 23, 25,105,129, 3,168, 23, 14,227,249, + 242,233,236,236,233, 99,128, 4,112,237,225,236,108,128,247,112, + 81,131, 0, 81, 23, 42, 23, 51, 23, 63,227,233,242,227,236,101, + 128, 36,198,237,239,238,239,243,240,225,227,101,128,255, 49,243, + 237,225,236,108,128,247,113, 82,138, 0, 82, 23, 95, 23,119, 23, + 166, 23,217, 23,230, 23,240, 23,245, 24, 19, 24, 31, 24, 43, 97, + 2, 23,101, 23,112,225,242,237,229,238,233,225,110,128, 5, 76, + 227,245,244,101,128, 1, 84, 99, 4, 23,129, 23,136, 23,145, 23, + 153,225,242,239,110,128, 1, 88,229,228,233,236,236, 97,128, 1, + 86,233,242,227,236,101,128, 36,199,239,237,237,225,225,227,227, + 229,238,116,128, 1, 86,100, 2, 23,172, 23,182,226,236,231,242, + 225,246,101,128, 2, 16,239,116, 2, 23,189, 23,198,225,227,227, + 229,238,116,128, 30, 88,226,229,236,239,119,129, 30, 90, 23,208, + 237,225,227,242,239,110,128, 30, 92,229,232,225,242,237,229,238, + 233,225,110,128, 5, 80,230,242,225,235,244,245,114,128, 33, 28, + 232,111,128, 3,161,233,110, 2, 23,252, 24, 5,231,243,237,225, + 236,108,128,246,252,246,229,242,244,229,228,226,242,229,246,101, + 128, 2, 18,236,233,238,229,226,229,236,239,119,128, 30, 94,237, + 239,238,239,243,240,225,227,101,128,255, 50,243,237,225,236,108, + 129,247,114, 24, 53,233,238,246,229,242,244,229,100,129, 2,129, + 24, 66,243,245,240,229,242,233,239,114,128, 2,182, 83,139, 0, + 83, 24,103, 26, 17, 26, 55, 26,182, 26,221, 26,250, 27, 84, 27, + 105, 27,117, 27,135, 27,143, 70, 6, 24,117, 24,209, 24,241, 25, + 77, 25,119, 25,221, 48, 9, 24,137, 24,145, 24,153, 24,161, 24, + 169, 24,177, 24,185, 24,193, 24,201,177,176,176,176, 48,128, 37, + 12,178,176,176,176, 48,128, 37, 20,179,176,176,176, 48,128, 37, + 16,180,176,176,176, 48,128, 37, 24,181,176,176,176, 48,128, 37, + 60,182,176,176,176, 48,128, 37, 44,183,176,176,176, 48,128, 37, + 52,184,176,176,176, 48,128, 37, 28,185,176,176,176, 48,128, 37, + 36, 49, 3, 24,217, 24,225, 24,233,176,176,176,176, 48,128, 37, + 0,177,176,176,176, 48,128, 37, 2,185,176,176,176, 48,128, 37, + 97, 50, 9, 25, 5, 25, 13, 25, 21, 25, 29, 25, 37, 25, 45, 25, + 53, 25, 61, 25, 69,176,176,176,176, 48,128, 37, 98,177,176,176, + 176, 48,128, 37, 86,178,176,176,176, 48,128, 37, 85,179,176,176, + 176, 48,128, 37, 99,180,176,176,176, 48,128, 37, 81,181,176,176, + 176, 48,128, 37, 87,182,176,176,176, 48,128, 37, 93,183,176,176, + 176, 48,128, 37, 92,184,176,176,176, 48,128, 37, 91, 51, 4, 25, + 87, 25, 95, 25,103, 25,111,182,176,176,176, 48,128, 37, 94,183, + 176,176,176, 48,128, 37, 95,184,176,176,176, 48,128, 37, 90,185, + 176,176,176, 48,128, 37, 84, 52, 10, 25,141, 25,149, 25,157, 25, + 165, 25,173, 25,181, 25,189, 25,197, 25,205, 25,213,176,176,176, + 176, 48,128, 37,105,177,176,176,176, 48,128, 37,102,178,176,176, + 176, 48,128, 37, 96,179,176,176,176, 48,128, 37, 80,180,176,176, + 176, 48,128, 37,108,181,176,176,176, 48,128, 37,103,182,176,176, + 176, 48,128, 37,104,183,176,176,176, 48,128, 37,100,184,176,176, + 176, 48,128, 37,101,185,176,176,176, 48,128, 37, 89, 53, 5, 25, + 233, 25,241, 25,249, 26, 1, 26, 9,176,176,176,176, 48,128, 37, + 88,177,176,176,176, 48,128, 37, 82,178,176,176,176, 48,128, 37, + 83,179,176,176,176, 48,128, 37,107,180,176,176,176, 48,128, 37, + 106, 97, 2, 26, 23, 26, 44,227,245,244,101,129, 1, 90, 26, 32, + 228,239,244,225,227,227,229,238,116,128, 30,100,237,240,233,231, + 242,229,229,107,128, 3,224, 99, 5, 26, 67, 26, 98, 26,107, 26, + 147, 26,169,225,242,239,110,130, 1, 96, 26, 78, 26, 90,228,239, + 244,225,227,227,229,238,116,128, 30,102,243,237,225,236,108,128, + 246,253,229,228,233,236,236, 97,128, 1, 94,232,247, 97,130, 1, + 143, 26,117, 26,128,227,249,242,233,236,236,233, 99,128, 4,216, + 228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99, + 128, 4,218,233,242, 99, 2, 26,155, 26,160,236,101,128, 36,200, + 245,237,230,236,229,120,128, 1, 92,239,237,237,225,225,227,227, + 229,238,116,128, 2, 24,228,239,116, 2, 26,190, 26,199,225,227, + 227,229,238,116,128, 30, 96,226,229,236,239,119,129, 30, 98, 26, + 209,228,239,244,225,227,227,229,238,116,128, 30,104,101, 2, 26, + 227, 26,239,232,225,242,237,229,238,233,225,110,128, 5, 77,246, + 229,238,242,239,237,225,110,128, 33,102,104, 5, 27, 6, 27, 34, + 27, 48, 27, 59, 27, 72, 97, 2, 27, 12, 27, 23,225,242,237,229, + 238,233,225,110,128, 5, 71,227,249,242,233,236,236,233, 99,128, + 4, 40,227,232,225,227,249,242,233,236,236,233, 99,128, 4, 41, + 229,233,227,239,240,244,233, 99,128, 3,226,232,225,227,249,242, + 233,236,236,233, 99,128, 4,186,233,237,225,227,239,240,244,233, + 99,128, 3,236,105, 2, 27, 90, 27, 96,231,237, 97,128, 3,163, + 248,242,239,237,225,110,128, 33,101,237,239,238,239,243,240,225, + 227,101,128,255, 51,239,230,244,243,233,231,238,227,249,242,233, + 236,236,233, 99,128, 4, 44,243,237,225,236,108,128,247,115,244, + 233,231,237,225,231,242,229,229,107,128, 3,218, 84,141, 0, 84, + 27,186, 27,191, 27,197, 28, 7, 28, 32, 28, 96, 28,147, 28,177, + 28,189, 28,201, 28,246, 29, 6, 29, 46,225,117,128, 3,164,226, + 225,114,128, 1,102, 99, 4, 27,207, 27,214, 27,223, 27,250,225, + 242,239,110,128, 1,100,229,228,233,236,236, 97,128, 1, 98,233, + 242, 99, 2, 27,231, 27,236,236,101,128, 36,201,245,237,230,236, + 229,248,226,229,236,239,119,128, 30,112,239,237,237,225,225,227, + 227,229,238,116,128, 1, 98,228,239,116, 2, 28, 15, 28, 24,225, + 227,227,229,238,116,128, 30,106,226,229,236,239,119,128, 30,108, + 101, 4, 28, 42, 28, 53, 28, 73, 28, 82,227,249,242,233,236,236, + 233, 99,128, 4, 34,228,229,243,227,229,238,228,229,242,227,249, + 242,233,236,236,233, 99,128, 4,172,238,242,239,237,225,110,128, + 33,105,244,243,229,227,249,242,233,236,236,233, 99,128, 4,180, + 104, 3, 28,104, 28,110, 28,136,229,244, 97,128, 3,152,111, 2, + 28,116, 28,121,239,107,128, 1,172,242,110,129, 0,222, 28,128, + 243,237,225,236,108,128,247,254,242,229,229,242,239,237,225,110, + 128, 33, 98,105, 2, 28,153, 28,164,236,228,229,243,237,225,236, + 108,128,246,254,247,238,225,242,237,229,238,233,225,110,128, 5, + 79,236,233,238,229,226,229,236,239,119,128, 30,110,237,239,238, + 239,243,240,225,227,101,128,255, 52,111, 2, 28,207, 28,218,225, + 242,237,229,238,233,225,110,128, 5, 57,238,101, 3, 28,227, 28, + 234, 28,240,230,233,246,101,128, 1,188,243,233,120,128, 1,132, + 244,247,111,128, 1,167,242,229,244,242,239,230,236,229,248,232, + 239,239,107,128, 1,174,115, 3, 29, 14, 29, 26, 29, 39,229,227, + 249,242,233,236,236,233, 99,128, 4, 38,232,229,227,249,242,233, + 236,236,233, 99,128, 4, 11,237,225,236,108,128,247,116,119, 2, + 29, 52, 29, 64,229,236,246,229,242,239,237,225,110,128, 33,107, + 239,242,239,237,225,110,128, 33, 97, 85,142, 0, 85, 29,105, 29, + 123, 29,131, 29,198, 30, 69, 30, 87, 30,198, 30,214, 30,226, 31, + 21, 31, 30, 31,142, 31,149, 31,219,225,227,245,244,101,129, 0, + 218, 29,115,243,237,225,236,108,128,247,250,226,242,229,246,101, + 128, 1,108, 99, 3, 29,139, 29,146, 29,188,225,242,239,110,128, + 1,211,233,242, 99, 2, 29,154, 29,159,236,101,128, 36,202,245, + 237,230,236,229,120,130, 0,219, 29,172, 29,180,226,229,236,239, + 119,128, 30,118,243,237,225,236,108,128,247,251,249,242,233,236, + 236,233, 99,128, 4, 35,100, 3, 29,206, 29,229, 30, 59,226,108, + 2, 29,213, 29,221,225,227,245,244,101,128, 1,112,231,242,225, + 246,101,128, 2, 20,233,229,242,229,243,233,115,134, 0,220, 29, + 251, 30, 3, 30, 11, 30, 34, 30, 42, 30, 51,225,227,245,244,101, + 128, 1,215,226,229,236,239,119,128, 30,114, 99, 2, 30, 17, 30, + 24,225,242,239,110,128, 1,217,249,242,233,236,236,233, 99,128, + 4,240,231,242,225,246,101,128, 1,219,237,225,227,242,239,110, + 128, 1,213,243,237,225,236,108,128,247,252,239,244,226,229,236, + 239,119,128, 30,228,231,242,225,246,101,129, 0,217, 30, 79,243, + 237,225,236,108,128,247,249,104, 2, 30, 93, 30,171,111, 2, 30, + 99, 30,109,239,235,225,226,239,246,101,128, 30,230,242,110,133, + 1,175, 30,124, 30,132, 30,143, 30,151, 30,163,225,227,245,244, + 101,128, 30,232,228,239,244,226,229,236,239,119,128, 30,240,231, + 242,225,246,101,128, 30,234,232,239,239,235,225,226,239,246,101, + 128, 30,236,244,233,236,228,101,128, 30,238,245,238,231,225,242, + 245,237,236,225,245,116,129, 1,112, 30,187,227,249,242,233,236, + 236,233, 99,128, 4,242,233,238,246,229,242,244,229,228,226,242, + 229,246,101,128, 2, 22,235,227,249,242,233,236,236,233, 99,128, + 4,120,109, 2, 30,232, 31, 10,225,227,242,239,110,130, 1,106, + 30,244, 30,255,227,249,242,233,236,236,233, 99,128, 4,238,228, + 233,229,242,229,243,233,115,128, 30,122,239,238,239,243,240,225, + 227,101,128,255, 53,239,231,239,238,229,107,128, 1,114,240,243, + 233,236,239,110,133, 3,165, 31, 49, 31, 53, 31, 90, 31,121, 31, + 134, 49,128, 3,210, 97, 2, 31, 59, 31, 81,227,245,244,229,232, + 239,239,235,243,249,237,226,239,236,231,242,229,229,107,128, 3, + 211,230,242,233,227,225,110,128, 1,177,228,233,229,242,229,243, + 233,115,129, 3,171, 31,103,232,239,239,235,243,249,237,226,239, + 236,231,242,229,229,107,128, 3,212,232,239,239,235,243,249,237, + 226,239,108,128, 3,210,244,239,238,239,115,128, 3,142,242,233, + 238,103,128, 1,110,115, 3, 31,157, 31,172, 31,179,232,239,242, + 244,227,249,242,233,236,236,233, 99,128, 4, 14,237,225,236,108, + 128,247,117,244,242,225,233,231,232,116, 2, 31,191, 31,202,227, + 249,242,233,236,236,233, 99,128, 4,174,243,244,242,239,235,229, + 227,249,242,233,236,236,233, 99,128, 4,176,244,233,236,228,101, + 130, 1,104, 31,231, 31,239,225,227,245,244,101,128, 30,120,226, + 229,236,239,119,128, 30,116, 86,136, 0, 86, 32, 11, 32, 20, 32, + 31, 32, 60, 32, 67, 32, 79, 32, 91, 32, 99,227,233,242,227,236, + 101,128, 36,203,228,239,244,226,229,236,239,119,128, 30,126,101, + 2, 32, 37, 32, 48,227,249,242,233,236,236,233, 99,128, 4, 18, + 247,225,242,237,229,238,233,225,110,128, 5, 78,232,239,239,107, + 128, 1,178,237,239,238,239,243,240,225,227,101,128,255, 54,239, + 225,242,237,229,238,233,225,110,128, 5, 72,243,237,225,236,108, + 128,247,118,244,233,236,228,101,128, 30,124, 87,134, 0, 87, 32, + 123, 32,131, 32,154, 32,194, 32,202, 32,214,225,227,245,244,101, + 128, 30,130,227,233,242, 99, 2, 32,140, 32,145,236,101,128, 36, + 204,245,237,230,236,229,120,128, 1,116,100, 2, 32,160, 32,170, + 233,229,242,229,243,233,115,128, 30,132,239,116, 2, 32,177, 32, + 186,225,227,227,229,238,116,128, 30,134,226,229,236,239,119,128, + 30,136,231,242,225,246,101,128, 30,128,237,239,238,239,243,240, + 225,227,101,128,255, 55,243,237,225,236,108,128,247,119, 88,134, + 0, 88, 32,238, 32,247, 33, 18, 33, 31, 33, 35, 33, 47,227,233, + 242,227,236,101,128, 36,205,100, 2, 32,253, 33, 7,233,229,242, + 229,243,233,115,128, 30,140,239,244,225,227,227,229,238,116,128, + 30,138,229,232,225,242,237,229,238,233,225,110,128, 5, 61,105, + 128, 3,158,237,239,238,239,243,240,225,227,101,128,255, 56,243, + 237,225,236,108,128,247,120, 89,139, 0, 89, 33, 81, 33,116, 33, + 139, 33,189, 33,228, 33,236, 33,253, 34, 40, 34, 52, 34, 60, 34, + 68, 97, 2, 33, 87, 33,104,227,245,244,101,129, 0,221, 33, 96, + 243,237,225,236,108,128,247,253,244,227,249,242,233,236,236,233, + 99,128, 4, 98,227,233,242, 99, 2, 33,125, 33,130,236,101,128, + 36,206,245,237,230,236,229,120,128, 1,118,100, 2, 33,145, 33, + 165,233,229,242,229,243,233,115,129, 1,120, 33,157,243,237,225, + 236,108,128,247,255,239,116, 2, 33,172, 33,181,225,227,227,229, + 238,116,128, 30,142,226,229,236,239,119,128, 30,244,229,114, 2, + 33,196, 33,208,233,227,249,242,233,236,236,233, 99,128, 4, 43, + 245,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, + 99,128, 4,248,231,242,225,246,101,128, 30,242,232,239,239,107, + 129, 1,179, 33,245,225,226,239,246,101,128, 30,246,105, 3, 34, + 5, 34, 16, 34, 27,225,242,237,229,238,233,225,110,128, 5, 69, + 227,249,242,233,236,236,233, 99,128, 4, 7,247,238,225,242,237, + 229,238,233,225,110,128, 5, 82,237,239,238,239,243,240,225,227, + 101,128,255, 57,243,237,225,236,108,128,247,121,244,233,236,228, + 101,128, 30,248,245,115, 2, 34, 75, 34,113,226,233,103, 2, 34, + 83, 34, 94,227,249,242,233,236,236,233, 99,128, 4,106,233,239, + 244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128, 4, + 108,236,233,244,244,236,101, 2, 34,124, 34,135,227,249,242,233, + 236,236,233, 99,128, 4,102,233,239,244,233,230,233,229,228,227, + 249,242,233,236,236,233, 99,128, 4,104, 90,136, 0, 90, 34,174, + 34,198, 34,243, 35, 14, 35, 81, 35,173, 35,185, 35,197, 97, 2, + 34,180, 34,191,225,242,237,229,238,233,225,110,128, 5, 54,227, + 245,244,101,128, 1,121, 99, 2, 34,204, 34,221,225,242,239,110, + 129, 1,125, 34,213,243,237,225,236,108,128,246,255,233,242, 99, + 2, 34,229, 34,234,236,101,128, 36,207,245,237,230,236,229,120, + 128, 30,144,228,239,116,130, 1,123, 34,253, 35, 6,225,227,227, + 229,238,116,128, 1,123,226,229,236,239,119,128, 30,146,101, 3, + 35, 22, 35, 33, 35, 76,227,249,242,233,236,236,233, 99,128, 4, + 23,100, 2, 35, 39, 35, 58,229,243,227,229,238,228,229,242,227, + 249,242,233,236,236,233, 99,128, 4,152,233,229,242,229,243,233, + 243,227,249,242,233,236,236,233, 99,128, 4,222,244, 97,128, 3, + 150,232,101, 4, 35, 92, 35,103, 35,119, 35,130,225,242,237,229, + 238,233,225,110,128, 5, 58,226,242,229,246,229,227,249,242,233, + 236,236,233, 99,128, 4,193,227,249,242,233,236,236,233, 99,128, + 4, 22,100, 2, 35,136, 35,155,229,243,227,229,238,228,229,242, + 227,249,242,233,236,236,233, 99,128, 4,150,233,229,242,229,243, + 233,243,227,249,242,233,236,236,233, 99,128, 4,220,236,233,238, + 229,226,229,236,239,119,128, 30,148,237,239,238,239,243,240,225, + 227,101,128,255, 58,115, 2, 35,203, 35,210,237,225,236,108,128, + 247,122,244,242,239,235,101,128, 1,181, 97,149, 0, 97, 36, 8, + 36,144, 37, 35, 37,211, 38, 55, 38, 91, 45, 10, 45, 47, 45, 74, + 46, 43, 46, 81, 47,170, 47,242, 48,197, 48,206, 49, 79, 51, 87, + 52, 77, 52,124, 53, 19, 53, 33, 97, 7, 36, 24, 36, 34, 36, 41, + 36, 48, 36, 73, 36, 89, 36,100,226,229,238,231,225,236,105,128, + 9,134,227,245,244,101,128, 0,225,228,229,246, 97,128, 9, 6, + 231,117, 2, 36, 55, 36, 64,234,225,242,225,244,105,128, 10,134, + 242,237,245,235,232,105,128, 10, 6,237,225,244,242,225,231,245, + 242,237,245,235,232,105,128, 10, 62,242,245,243,241,245,225,242, + 101,128, 51, 3,246,239,247,229,236,243,233,231,110, 3, 36,116, + 36,126, 36,133,226,229,238,231,225,236,105,128, 9,190,228,229, + 246, 97,128, 9, 62,231,245,234,225,242,225,244,105,128, 10,190, + 98, 4, 36,154, 36,195, 36,204, 36,214,226,242,229,246,233,225, + 244,233,239,110, 2, 36,169, 36,184,237,225,242,235,225,242,237, + 229,238,233,225,110,128, 5, 95,243,233,231,238,228,229,246, 97, + 128, 9,112,229,238,231,225,236,105,128, 9,133,239,240,239,237, + 239,230,111,128, 49, 26,242,229,246,101,134, 1, 3, 36,233, 36, + 241, 36,252, 37, 7, 37, 15, 37, 27,225,227,245,244,101,128, 30, + 175,227,249,242,233,236,236,233, 99,128, 4,209,228,239,244,226, + 229,236,239,119,128, 30,183,231,242,225,246,101,128, 30,177,232, + 239,239,235,225,226,239,246,101,128, 30,179,244,233,236,228,101, + 128, 30,181, 99, 4, 37, 45, 37, 52, 37,131, 37,201,225,242,239, + 110,128, 1,206,233,242, 99, 2, 37, 60, 37, 65,236,101,128, 36, + 208,245,237,230,236,229,120,133, 0,226, 37, 84, 37, 92, 37,103, + 37,111, 37,123,225,227,245,244,101,128, 30,165,228,239,244,226, + 229,236,239,119,128, 30,173,231,242,225,246,101,128, 30,167,232, + 239,239,235,225,226,239,246,101,128, 30,169,244,233,236,228,101, + 128, 30,171,245,244,101,133, 0,180, 37,147, 37,158, 37,175, 37, + 182, 37,191,226,229,236,239,247,227,237, 98,128, 3, 23, 99, 2, + 37,164, 37,169,237, 98,128, 3, 1,239,237, 98,128, 3, 1,228, + 229,246, 97,128, 9, 84,236,239,247,237,239,100,128, 2,207,244, + 239,238,229,227,237, 98,128, 3, 65,249,242,233,236,236,233, 99, + 128, 4, 48,100, 5, 37,223, 37,233, 37,247, 37,253, 38, 31,226, + 236,231,242,225,246,101,128, 2, 1,228,225,235,231,245,242,237, + 245,235,232,105,128, 10,113,229,246, 97,128, 9, 5,233,229,242, + 229,243,233,115,130, 0,228, 38, 11, 38, 22,227,249,242,233,236, + 236,233, 99,128, 4,211,237,225,227,242,239,110,128, 1,223,239, + 116, 2, 38, 38, 38, 46,226,229,236,239,119,128, 30,161,237,225, + 227,242,239,110,128, 1,225,101,131, 0,230, 38, 65, 38, 73, 38, + 82,225,227,245,244,101,128, 1,253,235,239,242,229,225,110,128, + 49, 80,237,225,227,242,239,110,128, 1,227,230,233,105, 6, 38, + 107, 38,127, 41, 64, 41, 70, 41, 85, 44,185, 48, 2, 38,113, 38, + 120,176,178,176, 56,128, 32, 21,184,185,180, 49,128, 32,164,177, + 48, 3, 38,136, 40,160, 41, 39, 48, 9, 38,156, 38,176, 38,238, + 39, 44, 39,106, 39,168, 39,230, 40, 36, 40, 98, 49, 3, 38,164, + 38,168, 38,172, 55,128, 4, 16, 56,128, 4, 17, 57,128, 4, 18, + 50, 10, 38,198, 38,202, 38,206, 38,210, 38,214, 38,218, 38,222, + 38,226, 38,230, 38,234, 48,128, 4, 19, 49,128, 4, 20, 50,128, + 4, 21, 51,128, 4, 1, 52,128, 4, 22, 53,128, 4, 23, 54,128, + 4, 24, 55,128, 4, 25, 56,128, 4, 26, 57,128, 4, 27, 51, 10, + 39, 4, 39, 8, 39, 12, 39, 16, 39, 20, 39, 24, 39, 28, 39, 32, + 39, 36, 39, 40, 48,128, 4, 28, 49,128, 4, 29, 50,128, 4, 30, + 51,128, 4, 31, 52,128, 4, 32, 53,128, 4, 33, 54,128, 4, 34, + 55,128, 4, 35, 56,128, 4, 36, 57,128, 4, 37, 52, 10, 39, 66, + 39, 70, 39, 74, 39, 78, 39, 82, 39, 86, 39, 90, 39, 94, 39, 98, + 39,102, 48,128, 4, 38, 49,128, 4, 39, 50,128, 4, 40, 51,128, + 4, 41, 52,128, 4, 42, 53,128, 4, 43, 54,128, 4, 44, 55,128, + 4, 45, 56,128, 4, 46, 57,128, 4, 47, 53, 10, 39,128, 39,132, + 39,136, 39,140, 39,144, 39,148, 39,152, 39,156, 39,160, 39,164, + 48,128, 4,144, 49,128, 4, 2, 50,128, 4, 3, 51,128, 4, 4, + 52,128, 4, 5, 53,128, 4, 6, 54,128, 4, 7, 55,128, 4, 8, + 56,128, 4, 9, 57,128, 4, 10, 54, 10, 39,190, 39,194, 39,198, + 39,202, 39,206, 39,210, 39,214, 39,218, 39,222, 39,226, 48,128, + 4, 11, 49,128, 4, 12, 50,128, 4, 14, 51,128,246,196, 52,128, + 246,197, 53,128, 4, 48, 54,128, 4, 49, 55,128, 4, 50, 56,128, + 4, 51, 57,128, 4, 52, 55, 10, 39,252, 40, 0, 40, 4, 40, 8, + 40, 12, 40, 16, 40, 20, 40, 24, 40, 28, 40, 32, 48,128, 4, 53, + 49,128, 4, 81, 50,128, 4, 54, 51,128, 4, 55, 52,128, 4, 56, + 53,128, 4, 57, 54,128, 4, 58, 55,128, 4, 59, 56,128, 4, 60, + 57,128, 4, 61, 56, 10, 40, 58, 40, 62, 40, 66, 40, 70, 40, 74, + 40, 78, 40, 82, 40, 86, 40, 90, 40, 94, 48,128, 4, 62, 49,128, + 4, 63, 50,128, 4, 64, 51,128, 4, 65, 52,128, 4, 66, 53,128, + 4, 67, 54,128, 4, 68, 55,128, 4, 69, 56,128, 4, 70, 57,128, + 4, 71, 57, 10, 40,120, 40,124, 40,128, 40,132, 40,136, 40,140, + 40,144, 40,148, 40,152, 40,156, 48,128, 4, 72, 49,128, 4, 73, + 50,128, 4, 74, 51,128, 4, 75, 52,128, 4, 76, 53,128, 4, 77, + 54,128, 4, 78, 55,128, 4, 79, 56,128, 4,145, 57,128, 4, 82, + 49, 4, 40,170, 40,232, 40,237, 41, 7, 48, 10, 40,192, 40,196, + 40,200, 40,204, 40,208, 40,212, 40,216, 40,220, 40,224, 40,228, + 48,128, 4, 83, 49,128, 4, 84, 50,128, 4, 85, 51,128, 4, 86, + 52,128, 4, 87, 53,128, 4, 88, 54,128, 4, 89, 55,128, 4, 90, + 56,128, 4, 91, 57,128, 4, 92,177, 48,128, 4, 94, 52, 4, 40, + 247, 40,251, 40,255, 41, 3, 53,128, 4, 15, 54,128, 4, 98, 55, + 128, 4,114, 56,128, 4,116, 57, 5, 41, 19, 41, 23, 41, 27, 41, + 31, 41, 35, 50,128,246,198, 51,128, 4, 95, 52,128, 4, 99, 53, + 128, 4,115, 54,128, 4,117, 56, 2, 41, 45, 41, 59, 51, 2, 41, + 51, 41, 55, 49,128,246,199, 50,128,246,200,180, 54,128, 4,217, + 178,185, 57,128, 32, 14,179, 48, 2, 41, 77, 41, 81, 48,128, 32, + 15, 49,128, 32, 13,181, 55, 7, 41,102, 41,172, 42,237, 43, 58, + 44, 15, 44,108, 44,179, 51, 2, 41,108, 41,122, 56, 2, 41,114, + 41,118, 49,128, 6,106, 56,128, 6, 12, 57, 8, 41,140, 41,144, + 41,148, 41,152, 41,156, 41,160, 41,164, 41,168, 50,128, 6, 96, + 51,128, 6, 97, 52,128, 6, 98, 53,128, 6, 99, 54,128, 6,100, + 55,128, 6,101, 56,128, 6,102, 57,128, 6,103, 52, 7, 41,188, + 41,220, 42, 26, 42, 88, 42,120, 42,176, 42,232, 48, 5, 41,200, + 41,204, 41,208, 41,212, 41,216, 48,128, 6,104, 49,128, 6,105, + 51,128, 6, 27, 55,128, 6, 31, 57,128, 6, 33, 49, 10, 41,242, + 41,246, 41,250, 41,254, 42, 2, 42, 6, 42, 10, 42, 14, 42, 18, + 42, 22, 48,128, 6, 34, 49,128, 6, 35, 50,128, 6, 36, 51,128, + 6, 37, 52,128, 6, 38, 53,128, 6, 39, 54,128, 6, 40, 55,128, + 6, 41, 56,128, 6, 42, 57,128, 6, 43, 50, 10, 42, 48, 42, 52, + 42, 56, 42, 60, 42, 64, 42, 68, 42, 72, 42, 76, 42, 80, 42, 84, + 48,128, 6, 44, 49,128, 6, 45, 50,128, 6, 46, 51,128, 6, 47, + 52,128, 6, 48, 53,128, 6, 49, 54,128, 6, 50, 55,128, 6, 51, + 56,128, 6, 52, 57,128, 6, 53, 51, 5, 42,100, 42,104, 42,108, + 42,112, 42,116, 48,128, 6, 54, 49,128, 6, 55, 50,128, 6, 56, + 51,128, 6, 57, 52,128, 6, 58, 52, 9, 42,140, 42,144, 42,148, + 42,152, 42,156, 42,160, 42,164, 42,168, 42,172, 48,128, 6, 64, + 49,128, 6, 65, 50,128, 6, 66, 51,128, 6, 67, 52,128, 6, 68, + 53,128, 6, 69, 54,128, 6, 70, 56,128, 6, 72, 57,128, 6, 73, + 53, 9, 42,196, 42,200, 42,204, 42,208, 42,212, 42,216, 42,220, + 42,224, 42,228, 48,128, 6, 74, 49,128, 6, 75, 50,128, 6, 76, + 51,128, 6, 77, 52,128, 6, 78, 53,128, 6, 79, 54,128, 6, 80, + 55,128, 6, 81, 56,128, 6, 82,183, 48,128, 6, 71, 53, 3, 42, + 245, 43, 21, 43, 53, 48, 5, 43, 1, 43, 5, 43, 9, 43, 13, 43, + 17, 53,128, 6,164, 54,128, 6,126, 55,128, 6,134, 56,128, 6, + 152, 57,128, 6,175, 49, 5, 43, 33, 43, 37, 43, 41, 43, 45, 43, + 49, 49,128, 6,121, 50,128, 6,136, 51,128, 6,145, 52,128, 6, + 186, 57,128, 6,210,179, 52,128, 6,213, 54, 7, 43, 74, 43, 79, + 43, 84, 43, 89, 43,127, 43,189, 43,251,179, 54,128, 32,170,180, + 53,128, 5,190,181, 56,128, 5,195, 54, 6, 43,103, 43,107, 43, + 111, 43,115, 43,119, 43,123, 52,128, 5,208, 53,128, 5,209, 54, + 128, 5,210, 55,128, 5,211, 56,128, 5,212, 57,128, 5,213, 55, + 10, 43,149, 43,153, 43,157, 43,161, 43,165, 43,169, 43,173, 43, + 177, 43,181, 43,185, 48,128, 5,214, 49,128, 5,215, 50,128, 5, + 216, 51,128, 5,217, 52,128, 5,218, 53,128, 5,219, 54,128, 5, + 220, 55,128, 5,221, 56,128, 5,222, 57,128, 5,223, 56, 10, 43, + 211, 43,215, 43,219, 43,223, 43,227, 43,231, 43,235, 43,239, 43, + 243, 43,247, 48,128, 5,224, 49,128, 5,225, 50,128, 5,226, 51, + 128, 5,227, 52,128, 5,228, 53,128, 5,229, 54,128, 5,230, 55, + 128, 5,231, 56,128, 5,232, 57,128, 5,233, 57, 3, 44, 3, 44, + 7, 44, 11, 48,128, 5,234, 52,128,251, 42, 53,128,251, 43, 55, + 4, 44, 25, 44, 39, 44, 59, 44, 64, 48, 2, 44, 31, 44, 35, 48, + 128,251, 75, 53,128,251, 31, 49, 3, 44, 47, 44, 51, 44, 55, 54, + 128, 5,240, 55,128, 5,241, 56,128, 5,242,178, 51,128,251, 53, + 57, 7, 44, 80, 44, 84, 44, 88, 44, 92, 44, 96, 44,100, 44,104, + 51,128, 5,180, 52,128, 5,181, 53,128, 5,182, 54,128, 5,187, + 55,128, 5,184, 56,128, 5,183, 57,128, 5,176, 56, 3, 44,116, + 44,160, 44,165, 48, 7, 44,132, 44,136, 44,140, 44,144, 44,148, + 44,152, 44,156, 48,128, 5,178, 49,128, 5,177, 50,128, 5,179, + 51,128, 5,194, 52,128, 5,193, 54,128, 5,185, 55,128, 5,188, + 179, 57,128, 5,189, 52, 2, 44,171, 44,175, 49,128, 5,191, 50, + 128, 5,192,185,178, 57,128, 2,188, 54, 3, 44,193, 44,252, 45, + 3, 49, 4, 44,203, 44,219, 44,225, 44,246, 50, 2, 44,209, 44, + 214,180, 56,128, 33, 5,184, 57,128, 33, 19,179,181, 50,128, 33, + 22,181, 55, 3, 44,234, 44,238, 44,242, 51,128, 32, 44, 52,128, + 32, 45, 53,128, 32, 46,182,182, 52,128, 32, 12,179,177,182, 55, + 128, 6,109,180,185,179, 55,128, 2,189,103, 2, 45, 16, 45, 23, + 242,225,246,101,128, 0,224,117, 2, 45, 29, 45, 38,234,225,242, + 225,244,105,128, 10,133,242,237,245,235,232,105,128, 10, 5,104, + 2, 45, 53, 45, 63,233,242,225,231,225,238, 97,128, 48, 66,239, + 239,235,225,226,239,246,101,128, 30,163,105, 7, 45, 90, 45,115, + 45,122, 45,134, 45,159, 45,175, 45,255, 98, 2, 45, 96, 45,105, + 229,238,231,225,236,105,128, 9,144,239,240,239,237,239,230,111, + 128, 49, 30,228,229,246, 97,128, 9, 16,229,227,249,242,233,236, + 236,233, 99,128, 4,213,231,117, 2, 45,141, 45,150,234,225,242, + 225,244,105,128, 10,144,242,237,245,235,232,105,128, 10, 16,237, + 225,244,242,225,231,245,242,237,245,235,232,105,128, 10, 72,110, + 5, 45,187, 45,196, 45,210, 45,226, 45,241,225,242,225,226,233, + 99,128, 6, 57,230,233,238,225,236,225,242,225,226,233, 99,128, + 254,202,233,238,233,244,233,225,236,225,242,225,226,233, 99,128, + 254,203,237,229,228,233,225,236,225,242,225,226,233, 99,128,254, + 204,246,229,242,244,229,228,226,242,229,246,101,128, 2, 3,246, + 239,247,229,236,243,233,231,110, 3, 46, 15, 46, 25, 46, 32,226, + 229,238,231,225,236,105,128, 9,200,228,229,246, 97,128, 9, 72, + 231,245,234,225,242,225,244,105,128, 10,200,107, 2, 46, 49, 46, + 73,225,244,225,235,225,238, 97,129, 48,162, 46, 61,232,225,236, + 230,247,233,228,244,104,128,255,113,239,242,229,225,110,128, 49, + 79,108, 3, 46, 89, 47,145, 47,154,101, 2, 46, 95, 47,140,102, + 136, 5,208, 46,115, 46,124, 46,139, 46,153, 46,242, 47, 0, 47, + 111, 47,125,225,242,225,226,233, 99,128, 6, 39,228,225,231,229, + 243,232,232,229,226,242,229,119,128,251, 48,230,233,238,225,236, + 225,242,225,226,233, 99,128,254,142,104, 2, 46,159, 46,234,225, + 237,250, 97, 2, 46,168, 46,201,225,226,239,246,101, 2, 46,178, + 46,187,225,242,225,226,233, 99,128, 6, 35,230,233,238,225,236, + 225,242,225,226,233, 99,128,254,132,226,229,236,239,119, 2, 46, + 211, 46,220,225,242,225,226,233, 99,128, 6, 37,230,233,238,225, + 236,225,242,225,226,233, 99,128,254,136,229,226,242,229,119,128, + 5,208,236,225,237,229,228,232,229,226,242,229,119,128,251, 79, + 237, 97, 2, 47, 7, 47, 43,228,228,225,225,226,239,246,101, 2, + 47, 20, 47, 29,225,242,225,226,233, 99,128, 6, 34,230,233,238, + 225,236,225,242,225,226,233, 99,128,254,130,235,243,245,242, 97, + 4, 47, 57, 47, 66, 47, 80, 47, 96,225,242,225,226,233, 99,128, + 6, 73,230,233,238,225,236,225,242,225,226,233, 99,128,254,240, + 233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,243, + 237,229,228,233,225,236,225,242,225,226,233, 99,128,254,244,240, + 225,244,225,232,232,229,226,242,229,119,128,251, 46,241,225,237, + 225,244,243,232,229,226,242,229,119,128,251, 47,240,104,128, 33, + 53,236,229,241,245,225,108,128, 34, 76,240,232, 97,129, 3,177, + 47,162,244,239,238,239,115,128, 3,172,109, 4, 47,180, 47,188, + 47,199, 47,233,225,227,242,239,110,128, 1, 1,239,238,239,243, + 240,225,227,101,128,255, 65,240,229,242,243,225,238,100,130, 0, + 38, 47,213, 47,225,237,239,238,239,243,240,225,227,101,128,255, + 6,243,237,225,236,108,128,247, 38,243,241,245,225,242,101,128, + 51,194,110, 4, 47,252, 48, 7, 48,129, 48,139,226,239,240,239, + 237,239,230,111,128, 49, 34,103, 4, 48, 17, 48, 28, 48, 42, 48, + 121,226,239,240,239,237,239,230,111,128, 49, 36,235,232,225,238, + 235,232,245,244,232,225,105,128, 14, 90,236,101,131, 34, 32, 48, + 53, 48,106, 48,113,226,242,225,227,235,229,116, 2, 48, 65, 48, + 85,236,229,230,116,129, 48, 8, 48, 74,246,229,242,244,233,227, + 225,108,128,254, 63,242,233,231,232,116,129, 48, 9, 48, 95,246, + 229,242,244,233,227,225,108,128,254, 64,236,229,230,116,128, 35, + 41,242,233,231,232,116,128, 35, 42,243,244,242,239,109,128, 33, + 43,239,244,229,236,229,233, 97,128, 3,135,117, 2, 48,145, 48, + 157,228,225,244,244,225,228,229,246, 97,128, 9, 82,243,246,225, + 242, 97, 3, 48,169, 48,179, 48,186,226,229,238,231,225,236,105, + 128, 9,130,228,229,246, 97,128, 9, 2,231,245,234,225,242,225, + 244,105,128, 10,130,239,231,239,238,229,107,128, 1, 5,112, 3, + 48,214, 48,238, 49, 12, 97, 2, 48,220, 48,232,225,244,239,243, + 241,245,225,242,101,128, 51, 0,242,229,110,128, 36,156,239,243, + 244,242,239,240,232,101, 2, 48,251, 49, 6,225,242,237,229,238, + 233,225,110,128, 5, 90,237,239,100,128, 2,188,112, 2, 49, 18, + 49, 23,236,101,128,248,255,242,111, 2, 49, 30, 49, 38,225,227, + 232,229,115,128, 34, 80,120, 2, 49, 44, 49, 64,229,241,245,225, + 108,129, 34, 72, 49, 54,239,242,233,237,225,231,101,128, 34, 82, + 233,237,225,244,229,236,249,229,241,245,225,108,128, 34, 69,114, + 4, 49, 89, 49,116, 49,120, 49,165,225,229, 97, 2, 49, 97, 49, + 107,229,235,239,242,229,225,110,128, 49,142,235,239,242,229,225, + 110,128, 49,141, 99,128, 35, 18,105, 2, 49,126, 49,140,231,232, + 244,232,225,236,230,242,233,238,103,128, 30,154,238,103,130, 0, + 229, 49,149, 49,157,225,227,245,244,101,128, 1,251,226,229,236, + 239,119,128, 30, 1,242,239,119, 8, 49,185, 49,192, 50, 65, 50, + 131, 50,181, 50,236, 51, 3, 51, 78,226,239,244,104,128, 33,148, + 100, 3, 49,200, 49,239, 50, 30,225,243,104, 4, 49,212, 49,219, + 49,226, 49,234,228,239,247,110,128, 33,227,236,229,230,116,128, + 33,224,242,233,231,232,116,128, 33,226,245,112,128, 33,225,226, + 108, 5, 49,252, 50, 3, 50, 10, 50, 17, 50, 25,226,239,244,104, + 128, 33,212,228,239,247,110,128, 33,211,236,229,230,116,128, 33, + 208,242,233,231,232,116,128, 33,210,245,112,128, 33,209,239,247, + 110,131, 33,147, 50, 42, 50, 49, 50, 57,236,229,230,116,128, 33, + 153,242,233,231,232,116,128, 33,152,247,232,233,244,101,128, 33, + 233,104, 2, 50, 71, 50,122,229,225,100, 4, 50, 83, 50, 93, 50, + 103, 50,114,228,239,247,238,237,239,100,128, 2,197,236,229,230, + 244,237,239,100,128, 2,194,242,233,231,232,244,237,239,100,128, + 2,195,245,240,237,239,100,128, 2,196,239,242,233,250,229,120, + 128,248,231,236,229,230,116,131, 33,144, 50,144, 50,161, 50,173, + 228,226,108,129, 33,208, 50,152,243,244,242,239,235,101,128, 33, + 205,239,246,229,242,242,233,231,232,116,128, 33,198,247,232,233, + 244,101,128, 33,230,242,233,231,232,116,132, 33,146, 50,197, 50, + 209, 50,217, 50,228,228,226,236,243,244,242,239,235,101,128, 33, + 207,232,229,225,246,121,128, 39,158,239,246,229,242,236,229,230, + 116,128, 33,196,247,232,233,244,101,128, 33,232,244,225, 98, 2, + 50,244, 50,251,236,229,230,116,128, 33,228,242,233,231,232,116, + 128, 33,229,245,112,132, 33,145, 51, 16, 51, 44, 51, 62, 51, 70, + 100, 2, 51, 22, 51, 34,110,129, 33,149, 51, 28,226,243,101,128, + 33,168,239,247,238,226,225,243,101,128, 33,168,236,229,230,116, + 129, 33,150, 51, 53,239,230,228,239,247,110,128, 33,197,242,233, + 231,232,116,128, 33,151,247,232,233,244,101,128, 33,231,246,229, + 242,244,229,120,128,248,230,115, 5, 51, 99, 51,175, 51,220, 52, + 47, 52, 57, 99, 2, 51,105, 51,157,233,105, 2, 51,112, 51,135, + 227,233,242,227,245,109,129, 0, 94, 51,123,237,239,238,239,243, + 240,225,227,101,128,255, 62,244,233,236,228,101,129, 0,126, 51, + 145,237,239,238,239,243,240,225,227,101,128,255, 94,242,233,240, + 116,129, 2, 81, 51,166,244,245,242,238,229,100,128, 2, 82,237, + 225,236,108, 2, 51,184, 51,195,232,233,242,225,231,225,238, 97, + 128, 48, 65,235,225,244,225,235,225,238, 97,129, 48,161, 51,208, + 232,225,236,230,247,233,228,244,104,128,255,103,244,229,242,233, + 115, 2, 51,230, 52, 43,107,131, 0, 42, 51,240, 52, 12, 52, 35, + 97, 2, 51,246, 52, 4,236,244,239,238,229,225,242,225,226,233, + 99,128, 6,109,242,225,226,233, 99,128, 6,109,109, 2, 52, 18, + 52, 24,225,244,104,128, 34, 23,239,238,239,243,240,225,227,101, + 128,255, 10,243,237,225,236,108,128,254, 97,109,128, 32, 66,245, + 240,229,242,233,239,114,128,246,233,249,237,240,244,239,244,233, + 227,225,236,236,249,229,241,245,225,108,128, 34, 67,116,132, 0, + 64, 52, 89, 52, 96, 52,108, 52,116,233,236,228,101,128, 0,227, + 237,239,238,239,243,240,225,227,101,128,255, 32,243,237,225,236, + 108,128,254,107,245,242,238,229,100,128, 2, 80,117, 6, 52,138, + 52,163, 52,170, 52,195, 52,215, 52,231, 98, 2, 52,144, 52,153, + 229,238,231,225,236,105,128, 9,148,239,240,239,237,239,230,111, + 128, 49, 32,228,229,246, 97,128, 9, 20,231,117, 2, 52,177, 52, + 186,234,225,242,225,244,105,128, 10,148,242,237,245,235,232,105, + 128, 10, 20,236,229,238,231,244,232,237,225,242,235,226,229,238, + 231,225,236,105,128, 9,215,237,225,244,242,225,231,245,242,237, + 245,235,232,105,128, 10, 76,246,239,247,229,236,243,233,231,110, + 3, 52,247, 53, 1, 53, 8,226,229,238,231,225,236,105,128, 9, + 204,228,229,246, 97,128, 9, 76,231,245,234,225,242,225,244,105, + 128, 10,204,246,225,231,242,225,232,225,228,229,246, 97,128, 9, + 61,121, 2, 53, 39, 53, 51,226,225,242,237,229,238,233,225,110, + 128, 5, 97,233,110,130, 5,226, 53, 60, 53, 75,225,236,244,239, + 238,229,232,229,226,242,229,119,128,251, 32,232,229,226,242,229, + 119,128, 5,226, 98,144, 0, 98, 53,120, 53,255, 54, 10, 54, 19, + 54, 44, 55, 85, 55,147, 55,220, 57,146, 57,158, 57,201, 57,209, + 57,219, 59, 89, 59,113, 59,122, 97, 7, 53,136, 53,146, 53,170, + 53,177, 53,202, 53,226, 53,237,226,229,238,231,225,236,105,128, + 9,172,227,235,243,236,225,243,104,129, 0, 92, 53,158,237,239, + 238,239,243,240,225,227,101,128,255, 60,228,229,246, 97,128, 9, + 44,231,117, 2, 53,184, 53,193,234,225,242,225,244,105,128, 10, + 172,242,237,245,235,232,105,128, 10, 44,104, 2, 53,208, 53,218, + 233,242,225,231,225,238, 97,128, 48,112,244,244,232,225,105,128, + 14, 63,235,225,244,225,235,225,238, 97,128, 48,208,114,129, 0, + 124, 53,243,237,239,238,239,243,240,225,227,101,128,255, 92,226, + 239,240,239,237,239,230,111,128, 49, 5,227,233,242,227,236,101, + 128, 36,209,228,239,116, 2, 54, 27, 54, 36,225,227,227,229,238, + 116,128, 30, 3,226,229,236,239,119,128, 30, 5,101, 6, 54, 58, + 54, 79, 54,102, 54,244, 54,255, 55, 11,225,237,229,228,243,233, + 248,244,229,229,238,244,232,238,239,244,229,115,128, 38,108, 99, + 2, 54, 85, 54, 92,225,245,243,101,128, 34, 53,249,242,233,236, + 236,233, 99,128, 4, 49,104, 5, 54,114, 54,123, 54,137, 54,167, + 54,226,225,242,225,226,233, 99,128, 6, 40,230,233,238,225,236, + 225,242,225,226,233, 99,128,254,144,105, 2, 54,143, 54,158,238, + 233,244,233,225,236,225,242,225,226,233, 99,128,254,145,242,225, + 231,225,238, 97,128, 48,121,237,101, 2, 54,174, 54,187,228,233, + 225,236,225,242,225,226,233, 99,128,254,146,229,237,105, 2, 54, + 195, 54,210,238,233,244,233,225,236,225,242,225,226,233, 99,128, + 252,159,243,239,236,225,244,229,228,225,242,225,226,233, 99,128, + 252, 8,238,239,239,238,230,233,238,225,236,225,242,225,226,233, + 99,128,252,109,235,225,244,225,235,225,238, 97,128, 48,217,238, + 225,242,237,229,238,233,225,110,128, 5, 98,116,132, 5,209, 55, + 23, 55, 43, 55, 63, 55, 72, 97,129, 3,178, 55, 29,243,249,237, + 226,239,236,231,242,229,229,107,128, 3,208,228,225,231,229,243, + 104,129,251, 49, 55, 54,232,229,226,242,229,119,128,251, 49,232, + 229,226,242,229,119,128, 5,209,242,225,230,229,232,229,226,242, + 229,119,128,251, 76,104, 2, 55, 91, 55,141, 97, 3, 55, 99, 55, + 109, 55,116,226,229,238,231,225,236,105,128, 9,173,228,229,246, + 97,128, 9, 45,231,117, 2, 55,123, 55,132,234,225,242,225,244, + 105,128, 10,173,242,237,245,235,232,105,128, 10, 45,239,239,107, + 128, 2, 83,105, 5, 55,159, 55,170, 55,181, 55,195, 55,209,232, + 233,242,225,231,225,238, 97,128, 48,115,235,225,244,225,235,225, + 238, 97,128, 48,211,236,225,226,233,225,236,227,236,233,227,107, + 128, 2,152,238,228,233,231,245,242,237,245,235,232,105,128, 10, + 2,242,245,243,241,245,225,242,101,128, 51, 49,108, 3, 55,228, + 57,129, 57,140, 97, 2, 55,234, 57,124,227,107, 6, 55,249, 56, + 2, 56, 39, 56,188, 56,243, 57, 39,227,233,242,227,236,101,128, + 37,207,100, 2, 56, 8, 56, 17,233,225,237,239,238,100,128, 37, + 198,239,247,238,240,239,233,238,244,233,238,231,244,242,233,225, + 238,231,236,101,128, 37,188,108, 2, 56, 45, 56,148,101, 2, 56, + 51, 56, 87,230,244,240,239,233,238,244,233,238,103, 2, 56, 66, + 56, 76,240,239,233,238,244,229,114,128, 37,196,244,242,233,225, + 238,231,236,101,128, 37,192,238,244,233,227,245,236,225,242,226, + 242,225,227,235,229,116, 2, 56,107, 56,127,236,229,230,116,129, + 48, 16, 56,116,246,229,242,244,233,227,225,108,128,254, 59,242, + 233,231,232,116,129, 48, 17, 56,137,246,229,242,244,233,227,225, + 108,128,254, 60,239,247,229,114, 2, 56,157, 56,172,236,229,230, + 244,244,242,233,225,238,231,236,101,128, 37,227,242,233,231,232, + 244,244,242,233,225,238,231,236,101,128, 37,226,114, 2, 56,194, + 56,205,229,227,244,225,238,231,236,101,128, 37,172,233,231,232, + 244,240,239,233,238,244,233,238,103, 2, 56,222, 56,232,240,239, + 233,238,244,229,114,128, 37,186,244,242,233,225,238,231,236,101, + 128, 37,182,115, 3, 56,251, 57, 25, 57, 33,109, 2, 57, 1, 57, + 13,225,236,236,243,241,245,225,242,101,128, 37,170,233,236,233, + 238,231,230,225,227,101,128, 38, 59,241,245,225,242,101,128, 37, + 160,244,225,114,128, 38, 5,245,240,112, 2, 57, 47, 57, 85,229, + 114, 2, 57, 54, 57, 69,236,229,230,244,244,242,233,225,238,231, + 236,101,128, 37,228,242,233,231,232,244,244,242,233,225,238,231, + 236,101,128, 37,229,239,233,238,244,233,238,103, 2, 57, 97, 57, + 113,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37, + 180,244,242,233,225,238,231,236,101,128, 37,178,238,107,128, 36, + 35,233,238,229,226,229,236,239,119,128, 30, 7,239,227,107,128, + 37,136,237,239,238,239,243,240,225,227,101,128,255, 66,111, 3, + 57,166, 57,179, 57,190,226,225,233,237,225,233,244,232,225,105, + 128, 14, 26,232,233,242,225,231,225,238, 97,128, 48,124,235,225, + 244,225,235,225,238, 97,128, 48,220,240,225,242,229,110,128, 36, + 157,241,243,241,245,225,242,101,128, 51,195,114, 4, 57,229, 58, + 223, 59, 40, 59, 79,225, 99, 2, 57,236, 58,130,101, 3, 57,244, + 57,249, 58, 61,229,120,128,248,244,236,229,230,116,133, 0,123, + 58, 10, 58, 15, 58, 37, 58, 45, 58, 50,226,116,128,248,243,109, + 2, 58, 21, 58, 26,233,100,128,248,242,239,238,239,243,240,225, + 227,101,128,255, 91,243,237,225,236,108,128,254, 91,244,112,128, + 248,241,246,229,242,244,233,227,225,108,128,254, 55,242,233,231, + 232,116,133, 0,125, 58, 79, 58, 84, 58,106, 58,114, 58,119,226, + 116,128,248,254,109, 2, 58, 90, 58, 95,233,100,128,248,253,239, + 238,239,243,240,225,227,101,128,255, 93,243,237,225,236,108,128, + 254, 92,244,112,128,248,252,246,229,242,244,233,227,225,108,128, + 254, 56,235,229,116, 2, 58,138, 58,180,236,229,230,116,132, 0, + 91, 58,153, 58,158, 58,163, 58,175,226,116,128,248,240,229,120, + 128,248,239,237,239,238,239,243,240,225,227,101,128,255, 59,244, + 112,128,248,238,242,233,231,232,116,132, 0, 93, 58,196, 58,201, + 58,206, 58,218,226,116,128,248,251,229,120,128,248,250,237,239, + 238,239,243,240,225,227,101,128,255, 61,244,112,128,248,249,229, + 246,101,131, 2,216, 58,235, 58,246, 58,252,226,229,236,239,247, + 227,237, 98,128, 3, 46,227,237, 98,128, 3, 6,233,238,246,229, + 242,244,229,100, 3, 59, 11, 59, 22, 59, 28,226,229,236,239,247, + 227,237, 98,128, 3, 47,227,237, 98,128, 3, 17,228,239,245,226, + 236,229,227,237, 98,128, 3, 97,233,228,231,101, 2, 59, 49, 59, + 60,226,229,236,239,247,227,237, 98,128, 3, 42,233,238,246,229, + 242,244,229,228,226,229,236,239,247,227,237, 98,128, 3, 58,239, + 235,229,238,226,225,114,128, 0,166,115, 2, 59, 95, 59,103,244, + 242,239,235,101,128, 1,128,245,240,229,242,233,239,114,128,246, + 234,244,239,240,226,225,114,128, 1,131,117, 3, 59,130, 59,141, + 59,152,232,233,242,225,231,225,238, 97,128, 48,118,235,225,244, + 225,235,225,238, 97,128, 48,214,236,108, 2, 59,159, 59,189,229, + 116,130, 32, 34, 59,168, 59,178,233,238,246,229,242,243,101,128, + 37,216,239,240,229,242,225,244,239,114,128, 34, 25,243,229,249, + 101,128, 37,206, 99,143, 0, 99, 59,230, 60,179, 60,190, 60,254, + 61, 29, 61,122, 63, 33, 64, 17, 64,117, 64,166, 67,158, 67,166, + 67,176, 67,188, 67,221, 97, 9, 59,250, 60, 5, 60, 15, 60, 22, + 60, 29, 60, 54, 60, 64, 60,116, 60,125,225,242,237,229,238,233, + 225,110,128, 5,110,226,229,238,231,225,236,105,128, 9,154,227, + 245,244,101,128, 1, 7,228,229,246, 97,128, 9, 26,231,117, 2, + 60, 36, 60, 45,234,225,242,225,244,105,128, 10,154,242,237,245, + 235,232,105,128, 10, 26,236,243,241,245,225,242,101,128, 51,136, + 238,228,242,225,226,233,238,228,117, 4, 60, 82, 60, 92, 60, 98, + 60,105,226,229,238,231,225,236,105,128, 9,129,227,237, 98,128, + 3, 16,228,229,246, 97,128, 9, 1,231,245,234,225,242,225,244, + 105,128, 10,129,240,243,236,239,227,107,128, 33,234,114, 3, 60, + 133, 60,139, 60,165,229,239,102,128, 33, 5,239,110,130, 2,199, + 60,148, 60,159,226,229,236,239,247,227,237, 98,128, 3, 44,227, + 237, 98,128, 3, 12,242,233,225,231,229,242,229,244,245,242,110, + 128, 33,181,226,239,240,239,237,239,230,111,128, 49, 24, 99, 4, + 60,200, 60,207, 60,226, 60,248,225,242,239,110,128, 1, 13,229, + 228,233,236,236, 97,129, 0,231, 60,218,225,227,245,244,101,128, + 30, 9,233,242, 99, 2, 60,234, 60,239,236,101,128, 36,210,245, + 237,230,236,229,120,128, 1, 9,245,242,108,128, 2, 85,100, 2, + 61, 4, 61, 20,239,116,129, 1, 11, 61, 11,225,227,227,229,238, + 116,128, 1, 11,243,241,245,225,242,101,128, 51,197,101, 2, 61, + 35, 61, 51,228,233,236,236, 97,129, 0,184, 61, 45,227,237, 98, + 128, 3, 39,238,116,132, 0,162, 61, 64, 61, 88, 61,100, 61,111, + 105, 2, 61, 70, 61, 78,231,242,225,228,101,128, 33, 3,238,230, + 229,242,233,239,114,128,246,223,237,239,238,239,243,240,225,227, + 101,128,255,224,239,236,228,243,244,249,236,101,128,247,162,243, + 245,240,229,242,233,239,114,128,246,224,104, 5, 61,134, 61,197, + 61,208, 62,136, 62,228, 97, 4, 61,144, 61,155, 61,165, 61,172, + 225,242,237,229,238,233,225,110,128, 5,121,226,229,238,231,225, + 236,105,128, 9,155,228,229,246, 97,128, 9, 27,231,117, 2, 61, + 179, 61,188,234,225,242,225,244,105,128, 10,155,242,237,245,235, + 232,105,128, 10, 27,226,239,240,239,237,239,230,111,128, 49, 20, + 101, 6, 61,222, 61,242, 62, 10, 62, 78, 62, 90, 62,111,225,226, + 235,232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128, + 4,189, 99, 2, 61,248, 62, 0,235,237,225,242,107,128, 39, 19, + 249,242,233,236,236,233, 99,128, 4, 71,100, 2, 62, 16, 62, 60, + 229,243,227,229,238,228,229,114, 2, 62, 29, 62, 49,225,226,235, + 232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128, 4, + 191,227,249,242,233,236,236,233, 99,128, 4,183,233,229,242,229, + 243,233,243,227,249,242,233,236,236,233, 99,128, 4,245,232,225, + 242,237,229,238,233,225,110,128, 5,115,235,232,225,235,225,243, + 243,233,225,238,227,249,242,233,236,236,233, 99,128, 4,204,246, + 229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242, + 233,236,236,233, 99,128, 4,185,105,129, 3,199, 62,142,229,245, + 227,104, 4, 62,155, 62,190, 62,205, 62,214, 97, 2, 62,161, 62, + 176,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,119, + 240,225,242,229,238,235,239,242,229,225,110,128, 50, 23,227,233, + 242,227,236,229,235,239,242,229,225,110,128, 50,105,235,239,242, + 229,225,110,128, 49, 74,240,225,242,229,238,235,239,242,229,225, + 110,128, 50, 9,111, 2, 62,234, 63, 28,227,104, 3, 62,243, 63, + 9, 63, 19,225,110, 2, 62,250, 63, 2,231,244,232,225,105,128, + 14, 10,244,232,225,105,128, 14, 8,233,238,231,244,232,225,105, + 128, 14, 9,239,229,244,232,225,105,128, 14, 12,239,107,128, 1, + 136,105, 2, 63, 39, 63,141,229,245, 99, 5, 63, 53, 63, 88, 63, + 103, 63,112, 63,126, 97, 2, 63, 59, 63, 74,227,233,242,227,236, + 229,235,239,242,229,225,110,128, 50,118,240,225,242,229,238,235, + 239,242,229,225,110,128, 50, 22,227,233,242,227,236,229,235,239, + 242,229,225,110,128, 50,104,235,239,242,229,225,110,128, 49, 72, + 240,225,242,229,238,235,239,242,229,225,110,128, 50, 8,245,240, + 225,242,229,238,235,239,242,229,225,110,128, 50, 28,242, 99, 2, + 63,148, 63,243,236,101,132, 37,203, 63,161, 63,172, 63,177, 63, + 201,237,245,236,244,233,240,236,121,128, 34,151,239,116,128, 34, + 153,112, 2, 63,183, 63,189,236,245,115,128, 34,149,239,243,244, + 225,236,237,225,242,107,128, 48, 54,247,233,244,104, 2, 63,210, + 63,226,236,229,230,244,232,225,236,230,226,236,225,227,107,128, + 37,208,242,233,231,232,244,232,225,236,230,226,236,225,227,107, + 128, 37,209,245,237,230,236,229,120,130, 2,198, 64, 0, 64, 11, + 226,229,236,239,247,227,237, 98,128, 3, 45,227,237, 98,128, 3, + 2,108, 3, 64, 25, 64, 31, 64, 85,229,225,114,128, 35, 39,233, + 227,107, 4, 64, 43, 64, 54, 64, 63, 64, 73,225,236,246,229,239, + 236,225,114,128, 1,194,228,229,238,244,225,108,128, 1,192,236, + 225,244,229,242,225,108,128, 1,193,242,229,244,242,239,230,236, + 229,120,128, 1,195,245, 98,129, 38, 99, 64, 92,243,245,233,116, + 2, 64,101, 64,109,226,236,225,227,107,128, 38, 99,247,232,233, + 244,101,128, 38,103,109, 3, 64,125, 64,139, 64,150,227,245,226, + 229,228,243,241,245,225,242,101,128, 51,164,239,238,239,243,240, + 225,227,101,128,255, 67,243,241,245,225,242,229,228,243,241,245, + 225,242,101,128, 51,160,111, 8, 64,184, 64,195, 65, 26, 65,224, + 66,253, 67, 28, 67,135, 67,144,225,242,237,229,238,233,225,110, + 128, 5,129,236,239,110,131, 0, 58, 64,207, 64,232, 64,251,237, + 239,110, 2, 64,215, 64,223,229,244,225,242,121,128, 32,161,239, + 243,240,225,227,101,128,255, 26,115, 2, 64,238, 64,244,233,231, + 110,128, 32,161,237,225,236,108,128,254, 85,244,242,233,225,238, + 231,245,236,225,114, 2, 65, 10, 65, 20,232,225,236,230,237,239, + 100,128, 2,209,237,239,100,128, 2,208,109, 2, 65, 32, 65,217, + 237, 97,134, 0, 44, 65, 49, 65,113, 65,124, 65,136, 65,166, 65, + 189, 97, 3, 65, 57, 65, 83, 65, 91,226,239,246,101, 2, 65, 66, + 65, 72,227,237, 98,128, 3, 19,242,233,231,232,244,227,237, 98, + 128, 3, 21,227,227,229,238,116,128,246,195,114, 2, 65, 97, 65, + 104,225,226,233, 99,128, 6, 12,237,229,238,233,225,110,128, 5, + 93,233,238,230,229,242,233,239,114,128,246,225,237,239,238,239, + 243,240,225,227,101,128,255, 12,242,229,246,229,242,243,229,100, + 2, 65,149, 65,160,225,226,239,246,229,227,237, 98,128, 3, 20, + 237,239,100,128, 2,189,115, 2, 65,172, 65,179,237,225,236,108, + 128,254, 80,245,240,229,242,233,239,114,128,246,226,244,245,242, + 238,229,100, 2, 65,200, 65,211,225,226,239,246,229,227,237, 98, + 128, 3, 18,237,239,100,128, 2,187,240,225,243,115,128, 38, 60, + 110, 2, 65,230, 65,239,231,242,245,229,238,116,128, 34, 69,116, + 2, 65,245, 66, 3,239,245,242,233,238,244,229,231,242,225,108, + 128, 34, 46,242,239,108,142, 35, 3, 66, 37, 66, 43, 66, 58, 66, + 73, 66,117, 66,162, 66,176, 66,181, 66,186, 66,191, 66,197, 66, + 202, 66,243, 66,248,193,195, 75,128, 0, 6, 66, 2, 66, 49, 66, + 54,197, 76,128, 0, 7, 83,128, 0, 8, 67, 2, 66, 64, 66, 69, + 193, 78,128, 0, 24, 82,128, 0, 13, 68, 3, 66, 81, 66,107, 66, + 112, 67, 4, 66, 91, 66, 95, 66, 99, 66,103, 49,128, 0, 17, 50, + 128, 0, 18, 51,128, 0, 19, 52,128, 0, 20,197, 76,128, 0,127, + 204, 69,128, 0, 16, 69, 5, 66,129, 66,133, 66,138, 66,143, 66, + 148, 77,128, 0, 25,206, 81,128, 0, 5,207, 84,128, 0, 4,211, + 67,128, 0, 27, 84, 2, 66,154, 66,158, 66,128, 0, 23, 88,128, + 0, 3, 70, 2, 66,168, 66,172, 70,128, 0, 12, 83,128, 0, 28, + 199, 83,128, 0, 29,200, 84,128, 0, 9,204, 70,128, 0, 10,206, + 193, 75,128, 0, 21,210, 83,128, 0, 30, 83, 5, 66,214, 66,218, + 66,228, 66,233, 66,238, 73,128, 0, 15, 79,129, 0, 14, 66,224, + 84,128, 0, 2,212, 88,128, 0, 1,213, 66,128, 0, 26,217, 78, + 128, 0, 22,213, 83,128, 0, 31,214, 84,128, 0, 11,240,249,242, + 233,231,232,116,129, 0,169, 67, 9,115, 2, 67, 15, 67, 21,225, + 238,115,128,248,233,229,242,233,102,128,246,217,114, 2, 67, 34, + 67,118,238,229,242,226,242,225,227,235,229,116, 2, 67, 49, 67, + 83,236,229,230,116,130, 48, 12, 67, 60, 67, 72,232,225,236,230, + 247,233,228,244,104,128,255, 98,246,229,242,244,233,227,225,108, + 128,254, 65,242,233,231,232,116,130, 48, 13, 67, 95, 67,107,232, + 225,236,230,247,233,228,244,104,128,255, 99,246,229,242,244,233, + 227,225,108,128,254, 66,240,239,242,225,244,233,239,238,243,241, + 245,225,242,101,128, 51,127,243,241,245,225,242,101,128, 51,199, + 246,229,242,235,231,243,241,245,225,242,101,128, 51,198,240,225, + 242,229,110,128, 36,158,242,245,250,229,233,242,111,128, 32,162, + 243,244,242,229,244,227,232,229,100,128, 2,151,245,114, 2, 67, + 195, 67,213,236,121, 2, 67,202, 67,208,225,238,100,128, 34,207, + 239,114,128, 34,206,242,229,238,227,121,128, 0,164,249,114, 4, + 67,232, 67,240, 67,247, 67,255,194,242,229,246,101,128,246,209, + 198,236,229,120,128,246,210,226,242,229,246,101,128,246,212,230, + 236,229,120,128,246,213,100,146, 0,100, 68, 46, 69,184, 70,208, + 71, 12, 71,188, 72,142, 72,204, 73,133, 73,146, 73,155, 73,181, + 73,206, 73,215, 75, 26, 75, 34, 75, 45, 75, 65, 75, 93, 97, 11, + 68, 70, 68, 81, 68, 91, 68,163, 68,226, 68,237, 68,248, 69, 61, + 69,123, 69,129, 69,159,225,242,237,229,238,233,225,110,128, 5, + 100,226,229,238,231,225,236,105,128, 9,166,100, 5, 68,103, 68, + 112, 68,118, 68,132, 68,148,225,242,225,226,233, 99,128, 6, 54, + 229,246, 97,128, 9, 38,230,233,238,225,236,225,242,225,226,233, + 99,128,254,190,233,238,233,244,233,225,236,225,242,225,226,233, + 99,128,254,191,237,229,228,233,225,236,225,242,225,226,233, 99, + 128,254,192,103, 3, 68,171, 68,188, 68,202,229,243,104,129, 5, + 188, 68,179,232,229,226,242,229,119,128, 5,188,231,229,114,129, + 32, 32, 68,196,228,226,108,128, 32, 33,117, 2, 68,208, 68,217, + 234,225,242,225,244,105,128, 10,166,242,237,245,235,232,105,128, + 10, 38,232,233,242,225,231,225,238, 97,128, 48, 96,235,225,244, + 225,235,225,238, 97,128, 48,192,108, 3, 69, 0, 69, 9, 69, 47, + 225,242,225,226,233, 99,128, 6, 47,229,116,130, 5,211, 69, 18, + 69, 38,228,225,231,229,243,104,129,251, 51, 69, 29,232,229,226, + 242,229,119,128,251, 51,232,229,226,242,229,119,128, 5,211,230, + 233,238,225,236,225,242,225,226,233, 99,128,254,170,237,237, 97, + 3, 69, 71, 69, 80, 69, 92,225,242,225,226,233, 99,128, 6, 79, + 236,239,247,225,242,225,226,233, 99,128, 6, 79,244,225,238, 97, + 2, 69,101, 69,115,236,244,239,238,229,225,242,225,226,233, 99, + 128, 6, 76,242,225,226,233, 99,128, 6, 76,238,228, 97,128, 9, + 100,242,231, 97, 2, 69,137, 69,146,232,229,226,242,229,119,128, + 5,167,236,229,230,244,232,229,226,242,229,119,128, 5,167,243, + 233,225,240,238,229,245,237,225,244,225,227,249,242,233,236,236, + 233,227,227,237, 98,128, 4,133, 98, 3, 69,192, 70,189, 70,199, + 108, 9, 69,212, 69,220, 70, 77, 70, 85, 70,101, 70,112, 70,130, + 70,144, 70,155,199,242,225,246,101,128,246,211, 97, 2, 69,226, + 70, 27,238,231,236,229,226,242,225,227,235,229,116, 2, 69,242, + 70, 6,236,229,230,116,129, 48, 10, 69,251,246,229,242,244,233, + 227,225,108,128,254, 61,242,233,231,232,116,129, 48, 11, 70, 16, + 246,229,242,244,233,227,225,108,128,254, 62,114, 2, 70, 33, 70, + 54,227,232,233,238,246,229,242,244,229,228,226,229,236,239,247, + 227,237, 98,128, 3, 43,242,239,119, 2, 70, 62, 70, 69,236,229, + 230,116,128, 33,212,242,233,231,232,116,128, 33,210,228,225,238, + 228, 97,128, 9,101,231,242,225,246,101,129,246,214, 70, 95,227, + 237, 98,128, 3, 15,233,238,244,229,231,242,225,108,128, 34, 44, + 236,239,247,236,233,238,101,129, 32, 23, 70,124,227,237, 98,128, + 3, 51,239,246,229,242,236,233,238,229,227,237, 98,128, 3, 63, + 240,242,233,237,229,237,239,100,128, 2,186,246,229,242,244,233, + 227,225,108, 2, 70,168, 70,174,226,225,114,128, 32, 22,236,233, + 238,229,225,226,239,246,229,227,237, 98,128, 3, 14,239,240,239, + 237,239,230,111,128, 49, 9,243,241,245,225,242,101,128, 51,200, + 99, 4, 70,218, 70,225, 70,234, 71, 5,225,242,239,110,128, 1, + 15,229,228,233,236,236, 97,128, 30, 17,233,242, 99, 2, 70,242, + 70,247,236,101,128, 36,211,245,237,230,236,229,248,226,229,236, + 239,119,128, 30, 19,242,239,225,116,128, 1, 17,100, 4, 71, 22, + 71,103, 71,113, 71,164, 97, 4, 71, 32, 71, 42, 71, 49, 71, 74, + 226,229,238,231,225,236,105,128, 9,161,228,229,246, 97,128, 9, + 33,231,117, 2, 71, 56, 71, 65,234,225,242,225,244,105,128, 10, + 161,242,237,245,235,232,105,128, 10, 33,108, 2, 71, 80, 71, 89, + 225,242,225,226,233, 99,128, 6,136,230,233,238,225,236,225,242, + 225,226,233, 99,128,251,137,228,232,225,228,229,246, 97,128, 9, + 92,232, 97, 3, 71,122, 71,132, 71,139,226,229,238,231,225,236, + 105,128, 9,162,228,229,246, 97,128, 9, 34,231,117, 2, 71,146, + 71,155,234,225,242,225,244,105,128, 10,162,242,237,245,235,232, + 105,128, 10, 34,239,116, 2, 71,171, 71,180,225,227,227,229,238, + 116,128, 30, 11,226,229,236,239,119,128, 30, 13,101, 8, 71,206, + 72, 3, 72, 10, 72, 35, 72, 45, 72, 56, 72,101, 72,137, 99, 2, + 71,212, 71,249,233,237,225,236,243,229,240,225,242,225,244,239, + 114, 2, 71,230, 71,239,225,242,225,226,233, 99,128, 6,107,240, + 229,242,243,233,225,110,128, 6,107,249,242,233,236,236,233, 99, + 128, 4, 52,231,242,229,101,128, 0,176,232,105, 2, 72, 17, 72, + 26,232,229,226,242,229,119,128, 5,173,242,225,231,225,238, 97, + 128, 48,103,233,227,239,240,244,233, 99,128, 3,239,235,225,244, + 225,235,225,238, 97,128, 48,199,108, 2, 72, 62, 72, 85,229,244, + 101, 2, 72, 70, 72, 77,236,229,230,116,128, 35, 43,242,233,231, + 232,116,128, 35, 38,244, 97,129, 3,180, 72, 92,244,245,242,238, + 229,100,128, 1,141,238,239,237,233,238,225,244,239,242,237,233, + 238,245,243,239,238,229,238,245,237,229,242,225,244,239,242,226, + 229,238,231,225,236,105,128, 9,248,250,104,128, 2,164,104, 2, + 72,148, 72,198, 97, 3, 72,156, 72,166, 72,173,226,229,238,231, + 225,236,105,128, 9,167,228,229,246, 97,128, 9, 39,231,117, 2, + 72,180, 72,189,234,225,242,225,244,105,128, 10,167,242,237,245, + 235,232,105,128, 10, 39,239,239,107,128, 2, 87,105, 6, 72,218, + 73, 11, 73, 71, 73, 82, 73, 93, 73,103, 97, 2, 72,224, 72,246, + 236,249,244,233,235,225,244,239,238,239,115,129, 3,133, 72,240, + 227,237, 98,128, 3, 68,237,239,238,100,129, 38,102, 72,255,243, + 245,233,244,247,232,233,244,101,128, 38, 98,229,242,229,243,233, + 115,133, 0,168, 73, 30, 73, 38, 73, 49, 73, 55, 73, 63,225,227, + 245,244,101,128,246,215,226,229,236,239,247,227,237, 98,128, 3, + 36,227,237, 98,128, 3, 8,231,242,225,246,101,128,246,216,244, + 239,238,239,115,128, 3,133,232,233,242,225,231,225,238, 97,128, + 48, 98,235,225,244,225,235,225,238, 97,128, 48,194,244,244,239, + 237,225,242,107,128, 48, 3,246,105, 2, 73,110, 73,121,228,101, + 129, 0,247, 73,117,115,128, 34, 35,243,233,239,238,243,236,225, + 243,104,128, 34, 21,234,229,227,249,242,233,236,236,233, 99,128, + 4, 82,235,243,232,225,228,101,128, 37,147,108, 2, 73,161, 73, + 172,233,238,229,226,229,236,239,119,128, 30, 15,243,241,245,225, + 242,101,128, 51,151,109, 2, 73,187, 73,195,225,227,242,239,110, + 128, 1, 17,239,238,239,243,240,225,227,101,128,255, 68,238,226, + 236,239,227,107,128, 37,132,111, 10, 73,237, 73,249, 74, 3, 74, + 14, 74, 25, 74, 97, 74,102, 74,113, 74,228, 74,254,227,232,225, + 228,225,244,232,225,105,128, 14, 14,228,229,235,244,232,225,105, + 128, 14, 20,232,233,242,225,231,225,238, 97,128, 48,105,235,225, + 244,225,235,225,238, 97,128, 48,201,236,236,225,114,132, 0, 36, + 74, 40, 74, 51, 74, 63, 74, 74,233,238,230,229,242,233,239,114, + 128,246,227,237,239,238,239,243,240,225,227,101,128,255, 4,239, + 236,228,243,244,249,236,101,128,247, 36,115, 2, 74, 80, 74, 87, + 237,225,236,108,128,254,105,245,240,229,242,233,239,114,128,246, + 228,238,103,128, 32,171,242,245,243,241,245,225,242,101,128, 51, + 38,116, 6, 74,127, 74,144, 74,166, 74,177, 74,209, 74,216,225, + 227,227,229,238,116,129, 2,217, 74,138,227,237, 98,128, 3, 7, + 226,229,236,239,247, 99, 2, 74,155, 74,160,237, 98,128, 3, 35, + 239,237, 98,128, 3, 35,235,225,244,225,235,225,238, 97,128, 48, + 251,236,229,243,115, 2, 74,186, 74,190,105,128, 1, 49,106,129, + 246,190, 74,196,243,244,242,239,235,229,232,239,239,107,128, 2, + 132,237,225,244,104,128, 34,197,244,229,228,227,233,242,227,236, + 101,128, 37,204,245,226,236,229,249,239,228,240,225,244,225,104, + 129,251, 31, 74,245,232,229,226,242,229,119,128,251, 31,247,238, + 244,225,227,107, 2, 75, 9, 75, 20,226,229,236,239,247,227,237, + 98,128, 3, 30,237,239,100,128, 2,213,240,225,242,229,110,128, + 36,159,243,245,240,229,242,233,239,114,128,246,235,116, 2, 75, + 51, 75, 57,225,233,108,128, 2, 86,239,240,226,225,114,128, 1, + 140,117, 2, 75, 71, 75, 82,232,233,242,225,231,225,238, 97,128, + 48,101,235,225,244,225,235,225,238, 97,128, 48,197,122,132, 1, + 243, 75,105, 75,114, 75,133, 75,170,225,236,244,239,238,101,128, + 2,163, 99, 2, 75,120, 75,127,225,242,239,110,128, 1,198,245, + 242,108,128, 2,165,101, 2, 75,139, 75,159,225,226,235,232,225, + 243,233,225,238,227,249,242,233,236,236,233, 99,128, 4,225,227, + 249,242,233,236,236,233, 99,128, 4, 85,232,229,227,249,242,233, + 236,236,233, 99,128, 4, 95,101,151, 0,101, 75,233, 75,252, 76, + 30, 77, 4, 77, 66, 77, 99, 77,111, 77,134, 77,187, 79, 43, 79, + 101, 79,203, 80, 63, 80,198, 81, 17, 81, 48, 81,110, 81,163, 82, + 98, 82,231, 82,251, 83, 39, 83,130, 97, 2, 75,239, 75,246,227, + 245,244,101,128, 0,233,242,244,104,128, 38, 65, 98, 3, 76, 4, + 76, 13, 76, 23,229,238,231,225,236,105,128, 9,143,239,240,239, + 237,239,230,111,128, 49, 28,242,229,246,101,128, 1, 21, 99, 5, + 76, 42, 76,115, 76,129, 76,161, 76,250, 97, 2, 76, 48, 76,109, + 238,228,242, 97, 3, 76, 59, 76, 66, 76, 77,228,229,246, 97,128, + 9, 13,231,245,234,225,242,225,244,105,128, 10,141,246,239,247, + 229,236,243,233,231,110, 2, 76, 91, 76, 98,228,229,246, 97,128, + 9, 69,231,245,234,225,242,225,244,105,128, 10,197,242,239,110, + 128, 1, 27,229,228,233,236,236,225,226,242,229,246,101,128, 30, + 29,104, 2, 76,135, 76,146,225,242,237,229,238,233,225,110,128, + 5,101,249,233,247,238,225,242,237,229,238,233,225,110,128, 5, + 135,233,242, 99, 2, 76,169, 76,174,236,101,128, 36,212,245,237, + 230,236,229,120,134, 0,234, 76,195, 76,203, 76,211, 76,222, 76, + 230, 76,242,225,227,245,244,101,128, 30,191,226,229,236,239,119, + 128, 30, 25,228,239,244,226,229,236,239,119,128, 30,199,231,242, + 225,246,101,128, 30,193,232,239,239,235,225,226,239,246,101,128, + 30,195,244,233,236,228,101,128, 30,197,249,242,233,236,236,233, + 99,128, 4, 84,100, 4, 77, 14, 77, 24, 77, 30, 77, 40,226,236, + 231,242,225,246,101,128, 2, 5,229,246, 97,128, 9, 15,233,229, + 242,229,243,233,115,128, 0,235,239,116,130, 1, 23, 77, 49, 77, + 58,225,227,227,229,238,116,128, 1, 23,226,229,236,239,119,128, + 30,185,101, 2, 77, 72, 77, 83,231,245,242,237,245,235,232,105, + 128, 10, 15,237,225,244,242,225,231,245,242,237,245,235,232,105, + 128, 10, 71,230,227,249,242,233,236,236,233, 99,128, 4, 68,103, + 2, 77,117, 77,124,242,225,246,101,128, 0,232,245,234,225,242, + 225,244,105,128, 10,143,104, 4, 77,144, 77,155, 77,166, 77,176, + 225,242,237,229,238,233,225,110,128, 5,103,226,239,240,239,237, + 239,230,111,128, 49, 29,233,242,225,231,225,238, 97,128, 48, 72, + 239,239,235,225,226,239,246,101,128, 30,187,105, 4, 77,197, 77, + 208, 79, 10, 79, 25,226,239,240,239,237,239,230,111,128, 49, 31, + 231,232,116,142, 0, 56, 77,242, 77,251, 78, 5, 78, 35, 78, 42, + 78, 80, 78,105, 78,150, 78,184, 78,196, 78,207, 78,240, 78,248, + 79, 3,225,242,225,226,233, 99,128, 6,104,226,229,238,231,225, + 236,105,128, 9,238,227,233,242,227,236,101,129, 36,103, 78, 16, + 233,238,246,229,242,243,229,243,225,238,243,243,229,242,233,102, + 128, 39,145,228,229,246, 97,128, 9,110,229,229,110, 2, 78, 50, + 78, 59,227,233,242,227,236,101,128, 36,113,112, 2, 78, 65, 78, + 72,225,242,229,110,128, 36,133,229,242,233,239,100,128, 36,153, + 231,117, 2, 78, 87, 78, 96,234,225,242,225,244,105,128, 10,238, + 242,237,245,235,232,105,128, 10,110,104, 2, 78,111, 78,137, 97, + 2, 78,117, 78,128,227,235,225,242,225,226,233, 99,128, 6,104, + 238,231,250,232,239,117,128, 48, 40,238,239,244,229,226,229,225, + 237,229,100,128, 38,107,105, 2, 78,156, 78,174,228,229,239,231, + 242,225,240,232,233,227,240,225,242,229,110,128, 50, 39,238,230, + 229,242,233,239,114,128, 32,136,237,239,238,239,243,240,225,227, + 101,128,255, 24,239,236,228,243,244,249,236,101,128,247, 56,112, + 2, 78,213, 78,220,225,242,229,110,128, 36,123,229,114, 2, 78, + 227, 78,233,233,239,100,128, 36,143,243,233,225,110,128, 6,248, + 242,239,237,225,110,128, 33,119,243,245,240,229,242,233,239,114, + 128, 32,120,244,232,225,105,128, 14, 88,238,246,229,242,244,229, + 228,226,242,229,246,101,128, 2, 7,239,244,233,230,233,229,228, + 227,249,242,233,236,236,233, 99,128, 4,101,107, 2, 79, 49, 79, + 73,225,244,225,235,225,238, 97,129, 48,168, 79, 61,232,225,236, + 230,247,233,228,244,104,128,255,116,111, 2, 79, 79, 79, 94,238, + 235,225,242,231,245,242,237,245,235,232,105,128, 10,116,242,229, + 225,110,128, 49, 84,108, 3, 79,109, 79,120, 79,181,227,249,242, + 233,236,236,233, 99,128, 4, 59,101, 2, 79,126, 79,133,237,229, + 238,116,128, 34, 8,246,229,110, 3, 79,143, 79,152, 79,173,227, + 233,242,227,236,101,128, 36,106,112, 2, 79,158, 79,165,225,242, + 229,110,128, 36,126,229,242,233,239,100,128, 36,146,242,239,237, + 225,110,128, 33,122,236,233,240,243,233,115,129, 32, 38, 79,192, + 246,229,242,244,233,227,225,108,128, 34,238,109, 5, 79,215, 79, + 243, 79,254, 80, 18, 80, 29,225,227,242,239,110,130, 1, 19, 79, + 227, 79,235,225,227,245,244,101,128, 30, 23,231,242,225,246,101, + 128, 30, 21,227,249,242,233,236,236,233, 99,128, 4, 60,228,225, + 243,104,129, 32, 20, 80, 7,246,229,242,244,233,227,225,108,128, + 254, 49,239,238,239,243,240,225,227,101,128,255, 69,112, 2, 80, + 35, 80, 55,232,225,243,233,243,237,225,242,235,225,242,237,229, + 238,233,225,110,128, 5, 91,244,249,243,229,116,128, 34, 5,110, + 6, 80, 77, 80, 88, 80, 99, 80,143, 80,175, 80,190,226,239,240, + 239,237,239,230,111,128, 49, 35,227,249,242,233,236,236,233, 99, + 128, 4, 61,100, 2, 80,105, 80,124,225,243,104,129, 32, 19, 80, + 113,246,229,242,244,233,227,225,108,128,254, 50,229,243,227,229, + 238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,163,103, + 130, 1, 75, 80,151, 80,162,226,239,240,239,237,239,230,111,128, + 49, 37,232,229,227,249,242,233,236,236,233, 99,128, 4,165,232, + 239,239,235,227,249,242,233,236,236,233, 99,128, 4,200,243,240, + 225,227,101,128, 32, 2,111, 3, 80,206, 80,214, 80,223,231,239, + 238,229,107,128, 1, 25,235,239,242,229,225,110,128, 49, 83,240, + 229,110,130, 2, 91, 80,233, 80,242,227,236,239,243,229,100,128, + 2,154,242,229,246,229,242,243,229,100,130, 2, 92, 81, 1, 81, + 10,227,236,239,243,229,100,128, 2, 94,232,239,239,107,128, 2, + 93,112, 2, 81, 23, 81, 30,225,242,229,110,128, 36,160,243,233, + 236,239,110,129, 3,181, 81, 40,244,239,238,239,115,128, 3,173, + 241,117, 2, 81, 55, 81, 99,225,108,130, 0, 61, 81, 64, 81, 76, + 237,239,238,239,243,240,225,227,101,128,255, 29,115, 2, 81, 82, + 81, 89,237,225,236,108,128,254,102,245,240,229,242,233,239,114, + 128, 32,124,233,246,225,236,229,238,227,101,128, 34, 97,114, 3, + 81,118, 81,129, 81,140,226,239,240,239,237,239,230,111,128, 49, + 38,227,249,242,233,236,236,233, 99,128, 4, 64,229,246,229,242, + 243,229,100,129, 2, 88, 81,152,227,249,242,233,236,236,233, 99, + 128, 4, 77,115, 6, 81,177, 81,188, 81,208, 82, 33, 82, 78, 82, + 88,227,249,242,233,236,236,233, 99,128, 4, 65,228,229,243,227, + 229,238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,171, + 104,132, 2,131, 81,220, 81,227, 82, 2, 82, 17,227,245,242,108, + 128, 2,134,239,242,116, 2, 81,235, 81,242,228,229,246, 97,128, + 9, 14,246,239,247,229,236,243,233,231,238,228,229,246, 97,128, + 9, 70,242,229,246,229,242,243,229,228,236,239,239,112,128, 1, + 170,243,241,245,225,244,242,229,246,229,242,243,229,100,128, 2, + 133,237,225,236,108, 2, 82, 42, 82, 53,232,233,242,225,231,225, + 238, 97,128, 48, 71,235,225,244,225,235,225,238, 97,129, 48,167, + 82, 66,232,225,236,230,247,233,228,244,104,128,255,106,244,233, + 237,225,244,229,100,128, 33, 46,245,240,229,242,233,239,114,128, + 246,236,116, 5, 82,110, 82,136, 82,140, 82,157, 82,223, 97,130, + 3,183, 82,118, 82,128,242,237,229,238,233,225,110,128, 5,104, + 244,239,238,239,115,128, 3,174,104,128, 0,240,233,236,228,101, + 129, 30,189, 82,149,226,229,236,239,119,128, 30, 27,238,225,232, + 244, 97, 3, 82,169, 82,201, 82,210,230,239,245,235,104, 2, 82, + 179, 82,188,232,229,226,242,229,119,128, 5,145,236,229,230,244, + 232,229,226,242,229,119,128, 5,145,232,229,226,242,229,119,128, + 5,145,236,229,230,244,232,229,226,242,229,119,128, 5,145,245, + 242,238,229,100,128, 1,221,117, 2, 82,237, 82,246,235,239,242, + 229,225,110,128, 49, 97,242,111,128, 32,172,246,239,247,229,236, + 243,233,231,110, 3, 83, 11, 83, 21, 83, 28,226,229,238,231,225, + 236,105,128, 9,199,228,229,246, 97,128, 9, 71,231,245,234,225, + 242,225,244,105,128, 10,199,120, 2, 83, 45, 83,118,227,236,225, + 109,132, 0, 33, 83, 60, 83, 71, 83, 98, 83,110,225,242,237,229, + 238,233,225,110,128, 5, 92,100, 2, 83, 77, 83, 82,226,108,128, + 32, 60,239,247,110,129, 0,161, 83, 90,243,237,225,236,108,128, + 247,161,237,239,238,239,243,240,225,227,101,128,255, 1,243,237, + 225,236,108,128,247, 33,233,243,244,229,238,244,233,225,108,128, + 34, 3,250,104,131, 2,146, 83,141, 83,160, 83,171, 99, 2, 83, + 147, 83,154,225,242,239,110,128, 1,239,245,242,108,128, 2,147, + 242,229,246,229,242,243,229,100,128, 1,185,244,225,233,108,128, + 1,186,102,140, 0,102, 83,206, 84, 32, 84, 43, 84, 52, 84, 64, + 84,167, 84,183, 86,191, 86,204, 86,230, 88,107, 88,115, 97, 4, + 83,216, 83,223, 83,234, 83,245,228,229,246, 97,128, 9, 94,231, + 245,242,237,245,235,232,105,128, 10, 94,232,242,229,238,232,229, + 233,116,128, 33, 9,244,232, 97, 3, 83,255, 84, 8, 84, 20,225, + 242,225,226,233, 99,128, 6, 78,236,239,247,225,242,225,226,233, + 99,128, 6, 78,244,225,238,225,242,225,226,233, 99,128, 6, 75, + 226,239,240,239,237,239,230,111,128, 49, 8,227,233,242,227,236, + 101,128, 36,213,228,239,244,225,227,227,229,238,116,128, 30, 31, + 101, 3, 84, 72, 84,150, 84,160,104, 4, 84, 82, 84,105, 84,119, + 84,135,225,114, 2, 84, 89, 84, 96,225,226,233, 99,128, 6, 65, + 237,229,238,233,225,110,128, 5,134,230,233,238,225,236,225,242, + 225,226,233, 99,128,254,210,233,238,233,244,233,225,236,225,242, + 225,226,233, 99,128,254,211,237,229,228,233,225,236,225,242,225, + 226,233, 99,128,254,212,233,227,239,240,244,233, 99,128, 3,229, + 237,225,236,101,128, 38, 64,102,130,251, 0, 84,175, 84,179,105, + 128,251, 3,108,128,251, 4,105,136,251, 1, 84,203, 84,243, 84, + 254, 85, 20, 85,142, 85,159, 85,167, 85,180,230,244,229,229,110, + 2, 84,213, 84,222,227,233,242,227,236,101,128, 36,110,112, 2, + 84,228, 84,235,225,242,229,110,128, 36,130,229,242,233,239,100, + 128, 36,150,231,245,242,229,228,225,243,104,128, 32, 18,236,236, + 229,100, 2, 85, 7, 85, 13,226,239,120,128, 37,160,242,229,227, + 116,128, 37,172,238,225,108, 5, 85, 34, 85, 73, 85, 90, 85,107, + 85,123,235,225,102,130, 5,218, 85, 44, 85, 64,228,225,231,229, + 243,104,129,251, 58, 85, 55,232,229,226,242,229,119,128,251, 58, + 232,229,226,242,229,119,128, 5,218,237,229,109,129, 5,221, 85, + 81,232,229,226,242,229,119,128, 5,221,238,245,110,129, 5,223, + 85, 98,232,229,226,242,229,119,128, 5,223,240,101,129, 5,227, + 85,114,232,229,226,242,229,119,128, 5,227,244,243,225,228,105, + 129, 5,229, 85,133,232,229,226,242,229,119,128, 5,229,242,243, + 244,244,239,238,229,227,232,233,238,229,243,101,128, 2,201,243, + 232,229,249,101,128, 37,201,244,225,227,249,242,233,236,236,233, + 99,128, 4,115,246,101,142, 0, 53, 85,213, 85,222, 85,232, 86, + 6, 86, 13, 86, 23, 86, 48, 86, 75, 86,109, 86,121, 86,132, 86, + 165, 86,173, 86,184,225,242,225,226,233, 99,128, 6,101,226,229, + 238,231,225,236,105,128, 9,235,227,233,242,227,236,101,129, 36, + 100, 85,243,233,238,246,229,242,243,229,243,225,238,243,243,229, + 242,233,102,128, 39,142,228,229,246, 97,128, 9,107,229,233,231, + 232,244,232,115,128, 33, 93,231,117, 2, 86, 30, 86, 39,234,225, + 242,225,244,105,128, 10,235,242,237,245,235,232,105,128, 10,107, + 232, 97, 2, 86, 55, 86, 66,227,235,225,242,225,226,233, 99,128, + 6,101,238,231,250,232,239,117,128, 48, 37,105, 2, 86, 81, 86, + 99,228,229,239,231,242,225,240,232,233,227,240,225,242,229,110, + 128, 50, 36,238,230,229,242,233,239,114,128, 32,133,237,239,238, + 239,243,240,225,227,101,128,255, 21,239,236,228,243,244,249,236, + 101,128,247, 53,112, 2, 86,138, 86,145,225,242,229,110,128, 36, + 120,229,114, 2, 86,152, 86,158,233,239,100,128, 36,140,243,233, + 225,110,128, 6,245,242,239,237,225,110,128, 33,116,243,245,240, + 229,242,233,239,114,128, 32,117,244,232,225,105,128, 14, 85,108, + 129,251, 2, 86,197,239,242,233,110,128, 1,146,109, 2, 86,210, + 86,221,239,238,239,243,240,225,227,101,128,255, 70,243,241,245, + 225,242,101,128, 51,153,111, 4, 86,240, 87, 6, 87, 18, 87, 25, + 230, 97, 2, 86,247, 86,255,238,244,232,225,105,128, 14, 31,244, + 232,225,105,128, 14, 29,238,231,237,225,238,244,232,225,105,128, + 14, 79,242,225,236,108,128, 34, 0,245,114,142, 0, 52, 87, 58, + 87, 67, 87, 77, 87,107, 87,114, 87,139, 87,166, 87,200, 87,212, + 87,231, 87,242, 88, 19, 88, 27, 88, 38,225,242,225,226,233, 99, + 128, 6,100,226,229,238,231,225,236,105,128, 9,234,227,233,242, + 227,236,101,129, 36, 99, 87, 88,233,238,246,229,242,243,229,243, + 225,238,243,243,229,242,233,102,128, 39,141,228,229,246, 97,128, + 9,106,231,117, 2, 87,121, 87,130,234,225,242,225,244,105,128, + 10,234,242,237,245,235,232,105,128, 10,106,232, 97, 2, 87,146, + 87,157,227,235,225,242,225,226,233, 99,128, 6,100,238,231,250, + 232,239,117,128, 48, 36,105, 2, 87,172, 87,190,228,229,239,231, + 242,225,240,232,233,227,240,225,242,229,110,128, 50, 35,238,230, + 229,242,233,239,114,128, 32,132,237,239,238,239,243,240,225,227, + 101,128,255, 20,238,245,237,229,242,225,244,239,242,226,229,238, + 231,225,236,105,128, 9,247,239,236,228,243,244,249,236,101,128, + 247, 52,112, 2, 87,248, 87,255,225,242,229,110,128, 36,119,229, + 114, 2, 88, 6, 88, 12,233,239,100,128, 36,139,243,233,225,110, + 128, 6,244,242,239,237,225,110,128, 33,115,243,245,240,229,242, + 233,239,114,128, 32,116,116, 2, 88, 44, 88, 82,229,229,110, 2, + 88, 52, 88, 61,227,233,242,227,236,101,128, 36,109,112, 2, 88, + 67, 88, 74,225,242,229,110,128, 36,129,229,242,233,239,100,128, + 36,149,104, 2, 88, 88, 88, 93,225,105,128, 14, 84,244,239,238, + 229,227,232,233,238,229,243,101,128, 2,203,240,225,242,229,110, + 128, 36,161,242, 97, 2, 88,122, 88,130,227,244,233,239,110,128, + 32, 68,238, 99,128, 32,163,103,144, 0,103, 88,171, 89,117, 89, + 140, 89,201, 89,218, 90,139, 91,132, 91,217, 91,230, 92, 88, 92, + 113, 92,141, 92,163, 93,108, 93,130, 93,232, 97, 9, 88,191, 88, + 201, 88,208, 88,215, 89, 23, 89, 48, 89, 59, 89, 70, 89,104,226, + 229,238,231,225,236,105,128, 9,151,227,245,244,101,128, 1,245, + 228,229,246, 97,128, 9, 23,102, 4, 88,225, 88,234, 88,248, 89, + 8,225,242,225,226,233, 99,128, 6,175,230,233,238,225,236,225, + 242,225,226,233, 99,128,251,147,233,238,233,244,233,225,236,225, + 242,225,226,233, 99,128,251,148,237,229,228,233,225,236,225,242, + 225,226,233, 99,128,251,149,231,117, 2, 89, 30, 89, 39,234,225, + 242,225,244,105,128, 10,151,242,237,245,235,232,105,128, 10, 23, + 232,233,242,225,231,225,238, 97,128, 48, 76,235,225,244,225,235, + 225,238, 97,128, 48,172,237,237, 97,130, 3,179, 89, 80, 89, 93, + 236,225,244,233,238,243,237,225,236,108,128, 2, 99,243,245,240, + 229,242,233,239,114,128, 2,224,238,231,233,225,227,239,240,244, + 233, 99,128, 3,235, 98, 2, 89,123, 89,133,239,240,239,237,239, + 230,111,128, 49, 13,242,229,246,101,128, 1, 31, 99, 4, 89,150, + 89,157, 89,166, 89,188,225,242,239,110,128, 1,231,229,228,233, + 236,236, 97,128, 1, 35,233,242, 99, 2, 89,174, 89,179,236,101, + 128, 36,214,245,237,230,236,229,120,128, 1, 29,239,237,237,225, + 225,227,227,229,238,116,128, 1, 35,228,239,116,129, 1, 33, 89, + 209,225,227,227,229,238,116,128, 1, 33,101, 6, 89,232, 89,243, + 89,254, 90, 9, 90, 28, 90,130,227,249,242,233,236,236,233, 99, + 128, 4, 51,232,233,242,225,231,225,238, 97,128, 48, 82,235,225, + 244,225,235,225,238, 97,128, 48,178,239,237,229,244,242,233,227, + 225,236,236,249,229,241,245,225,108,128, 34, 81,114, 3, 90, 36, + 90, 85, 90, 95,229,243,104, 3, 90, 46, 90, 61, 90, 70,225,227, + 227,229,238,244,232,229,226,242,229,119,128, 5,156,232,229,226, + 242,229,119,128, 5,243,237,245,241,228,225,237,232,229,226,242, + 229,119,128, 5,157,237,225,238,228,226,236,115,128, 0,223,243, + 232,225,249,233,109, 2, 90,106, 90,121,225,227,227,229,238,244, + 232,229,226,242,229,119,128, 5,158,232,229,226,242,229,119,128, + 5,244,244,225,237,225,242,107,128, 48, 19,104, 5, 90,151, 91, + 28, 91, 91, 91,116, 91,122, 97, 4, 90,161, 90,171, 90,194, 90, + 219,226,229,238,231,225,236,105,128, 9,152,100, 2, 90,177, 90, + 188,225,242,237,229,238,233,225,110,128, 5,114,229,246, 97,128, + 9, 24,231,117, 2, 90,201, 90,210,234,225,242,225,244,105,128, + 10,152,242,237,245,235,232,105,128, 10, 24,233,110, 4, 90,230, + 90,239, 90,253, 91, 13,225,242,225,226,233, 99,128, 6, 58,230, + 233,238,225,236,225,242,225,226,233, 99,128,254,206,233,238,233, + 244,233,225,236,225,242,225,226,233, 99,128,254,207,237,229,228, + 233,225,236,225,242,225,226,233, 99,128,254,208,101, 3, 91, 36, + 91, 57, 91, 74,237,233,228,228,236,229,232,239,239,235,227,249, + 242,233,236,236,233, 99,128, 4,149,243,244,242,239,235,229,227, + 249,242,233,236,236,233, 99,128, 4,147,245,240,244,245,242,238, + 227,249,242,233,236,236,233, 99,128, 4,145,232, 97, 2, 91, 98, + 91,105,228,229,246, 97,128, 9, 90,231,245,242,237,245,235,232, + 105,128, 10, 90,239,239,107,128, 2, 96,250,243,241,245,225,242, + 101,128, 51,147,105, 3, 91,140, 91,151, 91,162,232,233,242,225, + 231,225,238, 97,128, 48, 78,235,225,244,225,235,225,238, 97,128, + 48,174,109, 2, 91,168, 91,179,225,242,237,229,238,233,225,110, + 128, 5, 99,229,108,130, 5,210, 91,188, 91,208,228,225,231,229, + 243,104,129,251, 50, 91,199,232,229,226,242,229,119,128,251, 50, + 232,229,226,242,229,119,128, 5,210,234,229,227,249,242,233,236, + 236,233, 99,128, 4, 83,236,239,244,244,225,108, 2, 91,241, 92, + 2,233,238,246,229,242,244,229,228,243,244,242,239,235,101,128, + 1,190,243,244,239,112,132, 2,148, 92, 17, 92, 28, 92, 34, 92, + 66,233,238,246,229,242,244,229,100,128, 2,150,237,239,100,128, + 2,192,242,229,246,229,242,243,229,100,130, 2,149, 92, 49, 92, + 55,237,239,100,128, 2,193,243,245,240,229,242,233,239,114,128, + 2,228,243,244,242,239,235,101,129, 2,161, 92, 77,242,229,246, + 229,242,243,229,100,128, 2,162,109, 2, 92, 94, 92,102,225,227, + 242,239,110,128, 30, 33,239,238,239,243,240,225,227,101,128,255, + 71,111, 2, 92,119, 92,130,232,233,242,225,231,225,238, 97,128, + 48, 84,235,225,244,225,235,225,238, 97,128, 48,180,240, 97, 2, + 92,148, 92,154,242,229,110,128, 36,162,243,241,245,225,242,101, + 128, 51,172,114, 2, 92,169, 93, 10, 97, 2, 92,175, 92,183,228, + 233,229,238,116,128, 34, 7,246,101,134, 0, 96, 92,200, 92,211, + 92,228, 92,235, 92,244, 93, 0,226,229,236,239,247,227,237, 98, + 128, 3, 22, 99, 2, 92,217, 92,222,237, 98,128, 3, 0,239,237, + 98,128, 3, 0,228,229,246, 97,128, 9, 83,236,239,247,237,239, + 100,128, 2,206,237,239,238,239,243,240,225,227,101,128,255, 64, + 244,239,238,229,227,237, 98,128, 3, 64,229,225,244,229,114,132, + 0, 62, 93, 26, 93, 45, 93, 57, 93,100,229,241,245,225,108,129, + 34,101, 93, 36,239,242,236,229,243,115,128, 34,219,237,239,238, + 239,243,240,225,227,101,128,255, 30,111, 2, 93, 63, 93, 89,114, + 2, 93, 69, 93, 82,229,241,245,233,246,225,236,229,238,116,128, + 34,115,236,229,243,115,128, 34,119,246,229,242,229,241,245,225, + 108,128, 34,103,243,237,225,236,108,128,254,101,115, 2, 93,114, + 93,122,227,242,233,240,116,128, 2, 97,244,242,239,235,101,128, + 1,229,117, 4, 93,140, 93,151, 93,208, 93,219,232,233,242,225, + 231,225,238, 97,128, 48, 80,233,108, 2, 93,158, 93,183,236,229, + 237,239,116, 2, 93,168, 93,175,236,229,230,116,128, 0,171,242, + 233,231,232,116,128, 0,187,243,233,238,231,108, 2, 93,193, 93, + 200,236,229,230,116,128, 32, 57,242,233,231,232,116,128, 32, 58, + 235,225,244,225,235,225,238, 97,128, 48,176,242,225,237,245,243, + 241,245,225,242,101,128, 51, 24,249,243,241,245,225,242,101,128, + 51,201,104,144, 0,104, 94, 22, 96,164, 96,199, 96,236, 97, 20, + 98,164, 98,184, 99,149, 99,161, 99,173,100,241,100,249,101, 4, + 101, 13,101, 93,101, 97, 97, 13, 94, 50, 94, 89, 94, 99, 94,129, + 94,154, 94,232, 94,244, 95, 13, 95, 28, 95, 57, 95, 70, 95,128, + 95,137, 97, 2, 94, 56, 94, 75,226,235,232,225,243,233,225,238, + 227,249,242,233,236,236,233, 99,128, 4,169,236,244,239,238,229, + 225,242,225,226,233, 99,128, 6,193,226,229,238,231,225,236,105, + 128, 9,185,228,101, 2, 94,106, 94,124,243,227,229,238,228,229, + 242,227,249,242,233,236,236,233, 99,128, 4,179,246, 97,128, 9, + 57,231,117, 2, 94,136, 94,145,234,225,242,225,244,105,128, 10, + 185,242,237,245,235,232,105,128, 10, 57,104, 4, 94,164, 94,173, + 94,187, 94,217,225,242,225,226,233, 99,128, 6, 45,230,233,238, + 225,236,225,242,225,226,233, 99,128,254,162,105, 2, 94,193, 94, + 208,238,233,244,233,225,236,225,242,225,226,233, 99,128,254,163, + 242,225,231,225,238, 97,128, 48,111,237,229,228,233,225,236,225, + 242,225,226,233, 99,128,254,164,233,244,245,243,241,245,225,242, + 101,128, 51, 42,235,225,244,225,235,225,238, 97,129, 48,207, 95, + 1,232,225,236,230,247,233,228,244,104,128,255,138,236,225,238, + 244,231,245,242,237,245,235,232,105,128, 10, 77,237,250, 97, 2, + 95, 36, 95, 45,225,242,225,226,233, 99,128, 6, 33,236,239,247, + 225,242,225,226,233, 99,128, 6, 33,238,231,245,236,230,233,236, + 236,229,114,128, 49,100,114, 2, 95, 76, 95, 92,228,243,233,231, + 238,227,249,242,233,236,236,233, 99,128, 4, 74,240,239,239,110, + 2, 95,101, 95,114,236,229,230,244,226,225,242,226,245,112,128, + 33,188,242,233,231,232,244,226,225,242,226,245,112,128, 33,192, + 243,241,245,225,242,101,128, 51,202,244,225,102, 3, 95,147, 95, + 239, 96, 74,240,225,244,225,104,134, 5,178, 95,167, 95,172, 95, + 186, 95,195, 95,210, 95,226,177, 54,128, 5,178, 50, 2, 95,178, + 95,182, 51,128, 5,178,102,128, 5,178,232,229,226,242,229,119, + 128, 5,178,238,225,242,242,239,247,232,229,226,242,229,119,128, + 5,178,241,245,225,242,244,229,242,232,229,226,242,229,119,128, + 5,178,247,233,228,229,232,229,226,242,229,119,128, 5,178,241, + 225,237,225,244,115,135, 5,179, 96, 6, 96, 11, 96, 16, 96, 21, + 96, 30, 96, 45, 96, 61,177, 98,128, 5,179,178, 56,128, 5,179, + 179, 52,128, 5,179,232,229,226,242,229,119,128, 5,179,238,225, + 242,242,239,247,232,229,226,242,229,119,128, 5,179,241,245,225, + 242,244,229,242,232,229,226,242,229,119,128, 5,179,247,233,228, + 229,232,229,226,242,229,119,128, 5,179,243,229,231,239,108,135, + 5,177, 96, 96, 96,101, 96,106, 96,111, 96,120, 96,135, 96,151, + 177, 55,128, 5,177,178, 52,128, 5,177,179, 48,128, 5,177,232, + 229,226,242,229,119,128, 5,177,238,225,242,242,239,247,232,229, + 226,242,229,119,128, 5,177,241,245,225,242,244,229,242,232,229, + 226,242,229,119,128, 5,177,247,233,228,229,232,229,226,242,229, + 119,128, 5,177, 98, 3, 96,172, 96,177, 96,187,225,114,128, 1, + 39,239,240,239,237,239,230,111,128, 49, 15,242,229,246,229,226, + 229,236,239,119,128, 30, 43, 99, 2, 96,205, 96,214,229,228,233, + 236,236, 97,128, 30, 41,233,242, 99, 2, 96,222, 96,227,236,101, + 128, 36,215,245,237,230,236,229,120,128, 1, 37,100, 2, 96,242, + 96,252,233,229,242,229,243,233,115,128, 30, 39,239,116, 2, 97, + 3, 97, 12,225,227,227,229,238,116,128, 30, 35,226,229,236,239, + 119,128, 30, 37,101,136, 5,212, 97, 40, 97, 73, 97, 93, 98, 66, + 98, 82, 98,127, 98,136, 98,149,225,242,116,129, 38,101, 97, 48, + 243,245,233,116, 2, 97, 57, 97, 65,226,236,225,227,107,128, 38, + 101,247,232,233,244,101,128, 38, 97,228,225,231,229,243,104,129, + 251, 52, 97, 84,232,229,226,242,229,119,128,251, 52,104, 6, 97, + 107, 97,135, 97,143, 97,193, 97,239, 98, 32, 97, 2, 97,113, 97, + 127,236,244,239,238,229,225,242,225,226,233, 99,128, 6,193,242, + 225,226,233, 99,128, 6, 71,229,226,242,229,119,128, 5,212,230, + 233,238,225,236, 97, 2, 97,154, 97,185,236,116, 2, 97,161, 97, + 173,239,238,229,225,242,225,226,233, 99,128,251,167,244,247,239, + 225,242,225,226,233, 99,128,254,234,242,225,226,233, 99,128,254, + 234,232,225,237,250,225,225,226,239,246,101, 2, 97,208, 97,222, + 230,233,238,225,236,225,242,225,226,233, 99,128,251,165,233,243, + 239,236,225,244,229,228,225,242,225,226,233, 99,128,251,164,105, + 2, 97,245, 98, 23,238,233,244,233,225,236, 97, 2, 98, 1, 98, + 15,236,244,239,238,229,225,242,225,226,233, 99,128,251,168,242, + 225,226,233, 99,128,254,235,242,225,231,225,238, 97,128, 48,120, + 237,229,228,233,225,236, 97, 2, 98, 44, 98, 58,236,244,239,238, + 229,225,242,225,226,233, 99,128,251,169,242,225,226,233, 99,128, + 254,236,233,243,229,233,229,242,225,243,241,245,225,242,101,128, + 51,123,107, 2, 98, 88, 98,112,225,244,225,235,225,238, 97,129, + 48,216, 98,100,232,225,236,230,247,233,228,244,104,128,255,141, + 245,244,225,225,242,245,243,241,245,225,242,101,128, 51, 54,238, + 231,232,239,239,107,128, 2,103,242,245,244,245,243,241,245,225, + 242,101,128, 51, 57,116,129, 5,215, 98,155,232,229,226,242,229, + 119,128, 5,215,232,239,239,107,129, 2,102, 98,173,243,245,240, + 229,242,233,239,114,128, 2,177,105, 4, 98,194, 99, 23, 99, 34, + 99, 59,229,245,104, 4, 98,206, 98,241, 99, 0, 99, 9, 97, 2, + 98,212, 98,227,227,233,242,227,236,229,235,239,242,229,225,110, + 128, 50,123,240,225,242,229,238,235,239,242,229,225,110,128, 50, + 27,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,109, + 235,239,242,229,225,110,128, 49, 78,240,225,242,229,238,235,239, + 242,229,225,110,128, 50, 13,232,233,242,225,231,225,238, 97,128, + 48,114,235,225,244,225,235,225,238, 97,129, 48,210, 99, 47,232, + 225,236,230,247,233,228,244,104,128,255,139,242,233,113,134, 5, + 180, 99, 77, 99, 82, 99, 96, 99,105, 99,120, 99,136,177, 52,128, + 5,180, 50, 2, 99, 88, 99, 92, 49,128, 5,180,100,128, 5,180, + 232,229,226,242,229,119,128, 5,180,238,225,242,242,239,247,232, + 229,226,242,229,119,128, 5,180,241,245,225,242,244,229,242,232, + 229,226,242,229,119,128, 5,180,247,233,228,229,232,229,226,242, + 229,119,128, 5,180,236,233,238,229,226,229,236,239,119,128, 30, + 150,237,239,238,239,243,240,225,227,101,128,255, 72,111, 9, 99, + 193, 99,204, 99,228, 99,253,100, 85,100, 98,100,184,100,224,100, + 235,225,242,237,229,238,233,225,110,128, 5,112,232,105, 2, 99, + 211, 99,219,240,244,232,225,105,128, 14, 43,242,225,231,225,238, + 97,128, 48,123,235,225,244,225,235,225,238, 97,129, 48,219, 99, + 241,232,225,236,230,247,233,228,244,104,128,255,142,236,225,109, + 135, 5,185,100, 17,100, 22,100, 27,100, 32,100, 41,100, 56,100, + 72,177, 57,128, 5,185,178, 54,128, 5,185,179, 50,128, 5,185, + 232,229,226,242,229,119,128, 5,185,238,225,242,242,239,247,232, + 229,226,242,229,119,128, 5,185,241,245,225,242,244,229,242,232, + 229,226,242,229,119,128, 5,185,247,233,228,229,232,229,226,242, + 229,119,128, 5,185,238,239,235,232,245,235,244,232,225,105,128, + 14, 46,111, 2,100,104,100,174,107, 4,100,114,100,126,100,132, + 100,154,225,226,239,246,229,227,239,237, 98,128, 3, 9,227,237, + 98,128, 3, 9,240,225,236,225,244,225,236,233,250,229,228,226, + 229,236,239,247,227,237, 98,128, 3, 33,242,229,244,242,239,230, + 236,229,248,226,229,236,239,247,227,237, 98,128, 3, 34,238,243, + 241,245,225,242,101,128, 51, 66,114, 2,100,190,100,217,105, 2, + 100,196,100,205,227,239,240,244,233, 99,128, 3,233,250,239,238, + 244,225,236,226,225,114,128, 32, 21,238,227,237, 98,128, 3, 27, + 244,243,240,242,233,238,231,115,128, 38,104,245,243,101,128, 35, + 2,240,225,242,229,110,128, 36,163,243,245,240,229,242,233,239, + 114,128, 2,176,244,245,242,238,229,100,128, 2,101,117, 4,101, + 23,101, 34,101, 47,101, 72,232,233,242,225,231,225,238, 97,128, + 48,117,233,233,244,239,243,241,245,225,242,101,128, 51, 51,235, + 225,244,225,235,225,238, 97,129, 48,213,101, 60,232,225,236,230, + 247,233,228,244,104,128,255,140,238,231,225,242,245,237,236,225, + 245,116,129, 2,221,101, 87,227,237, 98,128, 3, 11,118,128, 1, + 149,249,240,232,229,110,132, 0, 45,101,113,101,124,101,136,101, + 159,233,238,230,229,242,233,239,114,128,246,229,237,239,238,239, + 243,240,225,227,101,128,255, 13,115, 2,101,142,101,149,237,225, + 236,108,128,254, 99,245,240,229,242,233,239,114,128,246,230,244, + 247,111,128, 32, 16,105,149, 0,105,101,211,101,234,102, 12,102, + 59,105,197,106, 61,106, 98,106,125,107, 31,107, 35,107, 73,107, + 95,107,179,108, 88,108,163,108,171,108,184,109, 15,109, 72,109, + 100,109,144,225, 99, 2,101,218,101,224,245,244,101,128, 0,237, + 249,242,233,236,236,233, 99,128, 4, 79, 98, 3,101,242,101,251, + 102, 5,229,238,231,225,236,105,128, 9,135,239,240,239,237,239, + 230,111,128, 49, 39,242,229,246,101,128, 1, 45, 99, 3,102, 20, + 102, 27,102, 49,225,242,239,110,128, 1,208,233,242, 99, 2,102, + 35,102, 40,236,101,128, 36,216,245,237,230,236,229,120,128, 0, + 238,249,242,233,236,236,233, 99,128, 4, 86,100, 4,102, 69,102, + 79,105,154,105,187,226,236,231,242,225,246,101,128, 2, 9,101, + 2,102, 85,105,149,239,231,242,225,240,104, 7,102,106,102,120, + 102,133,105, 62,105, 93,105,106,105,118,229,225,242,244,232,227, + 233,242,227,236,101,128, 50,143,230,233,242,229,227,233,242,227, + 236,101,128, 50,139,233, 99, 14,102,164,102,180,103, 23,103, 77, + 103,143,103,172,103,188,103,245,104, 38,104, 50,104, 77,104,144, + 105, 26,105, 55,225,236,236,233,225,238,227,229,240,225,242,229, + 110,128, 50, 63, 99, 4,102,190,102,201,102,215,102,222,225,236, + 236,240,225,242,229,110,128, 50, 58,229,238,244,242,229,227,233, + 242,227,236,101,128, 50,165,236,239,243,101,128, 48, 6,111, 3, + 102,230,102,245,103, 9,237,237, 97,129, 48, 1,102,238,236,229, + 230,116,128,255,100,238,231,242,225,244,245,236,225,244,233,239, + 238,240,225,242,229,110,128, 50, 55,242,242,229,227,244,227,233, + 242,227,236,101,128, 50,163,101, 3,103, 31,103, 43,103, 60,225, + 242,244,232,240,225,242,229,110,128, 50, 47,238,244,229,242,240, + 242,233,243,229,240,225,242,229,110,128, 50, 61,248,227,229,236, + 236,229,238,244,227,233,242,227,236,101,128, 50,157,102, 2,103, + 83,103, 98,229,243,244,233,246,225,236,240,225,242,229,110,128, + 50, 64,105, 2,103,104,103,133,238,225,238,227,233,225,108, 2, + 103,116,103,125,227,233,242,227,236,101,128, 50,150,240,225,242, + 229,110,128, 50, 54,242,229,240,225,242,229,110,128, 50, 43,104, + 2,103,149,103,160,225,246,229,240,225,242,229,110,128, 50, 50, + 233,231,232,227,233,242,227,236,101,128, 50,164,233,244,229,242, + 225,244,233,239,238,237,225,242,107,128, 48, 5,108, 3,103,196, + 103,222,103,234,225,226,239,114, 2,103,205,103,214,227,233,242, + 227,236,101,128, 50,152,240,225,242,229,110,128, 50, 56,229,230, + 244,227,233,242,227,236,101,128, 50,167,239,247,227,233,242,227, + 236,101,128, 50,166,109, 2,103,251,104, 27,101, 2,104, 1,104, + 16,228,233,227,233,238,229,227,233,242,227,236,101,128, 50,169, + 244,225,236,240,225,242,229,110,128, 50, 46,239,239,238,240,225, + 242,229,110,128, 50, 42,238,225,237,229,240,225,242,229,110,128, + 50, 52,112, 2,104, 56,104, 64,229,242,233,239,100,128, 48, 2, + 242,233,238,244,227,233,242,227,236,101,128, 50,158,114, 2,104, + 83,104,131,101, 3,104, 91,104,102,104,117,225,227,232,240,225, + 242,229,110,128, 50, 67,240,242,229,243,229,238,244,240,225,242, + 229,110,128, 50, 57,243,239,245,242,227,229,240,225,242,229,110, + 128, 50, 62,233,231,232,244,227,233,242,227,236,101,128, 50,168, + 115, 5,104,156,104,185,104,199,104,224,104,252,101, 2,104,162, + 104,175,227,242,229,244,227,233,242,227,236,101,128, 50,153,236, + 230,240,225,242,229,110,128, 50, 66,239,227,233,229,244,249,240, + 225,242,229,110,128, 50, 51,112, 2,104,205,104,211,225,227,101, + 128, 48, 0,229,227,233,225,236,240,225,242,229,110,128, 50, 53, + 116, 2,104,230,104,241,239,227,235,240,225,242,229,110,128, 50, + 49,245,228,249,240,225,242,229,110,128, 50, 59,117, 2,105, 2, + 105, 11,238,240,225,242,229,110,128, 50, 48,240,229,242,246,233, + 243,229,240,225,242,229,110,128, 50, 60,119, 2,105, 32,105, 44, + 225,244,229,242,240,225,242,229,110,128, 50, 44,239,239,228,240, + 225,242,229,110,128, 50, 45,250,229,242,111,128, 48, 7,109, 2, + 105, 68,105, 81,229,244,225,236,227,233,242,227,236,101,128, 50, + 142,239,239,238,227,233,242,227,236,101,128, 50,138,238,225,237, + 229,227,233,242,227,236,101,128, 50,148,243,245,238,227,233,242, + 227,236,101,128, 50,144,119, 2,105,124,105,137,225,244,229,242, + 227,233,242,227,236,101,128, 50,140,239,239,228,227,233,242,227, + 236,101,128, 50,141,246, 97,128, 9, 7,233,229,242,229,243,233, + 115,130, 0,239,105,168,105,176,225,227,245,244,101,128, 30, 47, + 227,249,242,233,236,236,233, 99,128, 4,229,239,244,226,229,236, + 239,119,128, 30,203,101, 3,105,205,105,221,105,232,226,242,229, + 246,229,227,249,242,233,236,236,233, 99,128, 4,215,227,249,242, + 233,236,236,233, 99,128, 4, 53,245,238,103, 4,105,244,106, 23, + 106, 38,106, 47, 97, 2,105,250,106, 9,227,233,242,227,236,229, + 235,239,242,229,225,110,128, 50,117,240,225,242,229,238,235,239, + 242,229,225,110,128, 50, 21,227,233,242,227,236,229,235,239,242, + 229,225,110,128, 50,103,235,239,242,229,225,110,128, 49, 71,240, + 225,242,229,238,235,239,242,229,225,110,128, 50, 7,103, 2,106, + 67,106, 74,242,225,246,101,128, 0,236,117, 2,106, 80,106, 89, + 234,225,242,225,244,105,128, 10,135,242,237,245,235,232,105,128, + 10, 7,104, 2,106,104,106,114,233,242,225,231,225,238, 97,128, + 48, 68,239,239,235,225,226,239,246,101,128, 30,201,105, 8,106, + 143,106,153,106,164,106,171,106,196,106,212,106,227,106,243,226, + 229,238,231,225,236,105,128, 9,136,227,249,242,233,236,236,233, + 99,128, 4, 56,228,229,246, 97,128, 9, 8,231,117, 2,106,178, + 106,187,234,225,242,225,244,105,128, 10,136,242,237,245,235,232, + 105,128, 10, 8,237,225,244,242,225,231,245,242,237,245,235,232, + 105,128, 10, 64,238,246,229,242,244,229,228,226,242,229,246,101, + 128, 2, 11,243,232,239,242,244,227,249,242,233,236,236,233, 99, + 128, 4, 57,246,239,247,229,236,243,233,231,110, 3,107, 3,107, + 13,107, 20,226,229,238,231,225,236,105,128, 9,192,228,229,246, + 97,128, 9, 64,231,245,234,225,242,225,244,105,128, 10,192,106, + 128, 1, 51,107, 2,107, 41,107, 65,225,244,225,235,225,238, 97, + 129, 48,164,107, 53,232,225,236,230,247,233,228,244,104,128,255, + 114,239,242,229,225,110,128, 49, 99,108, 2,107, 79,107, 84,228, + 101,128, 2,220,245,249,232,229,226,242,229,119,128, 5,172,109, + 2,107,101,107,168, 97, 3,107,109,107,129,107,154,227,242,239, + 110,129, 1, 43,107,118,227,249,242,233,236,236,233, 99,128, 4, + 227,231,229,239,242,225,240,240,242,239,248,233,237,225,244,229, + 236,249,229,241,245,225,108,128, 34, 83,244,242,225,231,245,242, + 237,245,235,232,105,128, 10, 63,239,238,239,243,240,225,227,101, + 128,255, 73,110, 5,107,191,107,201,107,210,107,222,108, 50,227, + 242,229,237,229,238,116,128, 34, 6,230,233,238,233,244,121,128, + 34, 30,233,225,242,237,229,238,233,225,110,128, 5,107,116, 2, + 107,228,108, 40,101, 2,107,234,108, 29,231,242,225,108,131, 34, + 43,107,247,108, 9,108, 14, 98, 2,107,253,108, 5,239,244,244, + 239,109,128, 35, 33,116,128, 35, 33,229,120,128,248,245,116, 2, + 108, 20,108, 25,239,112,128, 35, 32,112,128, 35, 32,242,243,229, + 227,244,233,239,110,128, 34, 41,233,243,241,245,225,242,101,128, + 51, 5,118, 3,108, 58,108, 67,108, 76,226,245,236,236,229,116, + 128, 37,216,227,233,242,227,236,101,128, 37,217,243,237,233,236, + 229,230,225,227,101,128, 38, 59,111, 3,108, 96,108,107,108,115, + 227,249,242,233,236,236,233, 99,128, 4, 81,231,239,238,229,107, + 128, 1, 47,244, 97,131, 3,185,108,126,108,147,108,155,228,233, + 229,242,229,243,233,115,129, 3,202,108,139,244,239,238,239,115, + 128, 3,144,236,225,244,233,110,128, 2,105,244,239,238,239,115, + 128, 3,175,240,225,242,229,110,128, 36,164,242,233,231,245,242, + 237,245,235,232,105,128, 10,114,115, 4,108,194,108,239,108,253, + 109, 5,237,225,236,108, 2,108,203,108,214,232,233,242,225,231, + 225,238, 97,128, 48, 67,235,225,244,225,235,225,238, 97,129, 48, + 163,108,227,232,225,236,230,247,233,228,244,104,128,255,104,243, + 232,225,242,226,229,238,231,225,236,105,128, 9,250,244,242,239, + 235,101,128, 2,104,245,240,229,242,233,239,114,128,246,237,116, + 2,109, 21,109, 55,229,242,225,244,233,239,110, 2,109, 33,109, + 44,232,233,242,225,231,225,238, 97,128, 48,157,235,225,244,225, + 235,225,238, 97,128, 48,253,233,236,228,101,129, 1, 41,109, 64, + 226,229,236,239,119,128, 30, 45,117, 2,109, 78,109, 89,226,239, + 240,239,237,239,230,111,128, 49, 41,227,249,242,233,236,236,233, + 99,128, 4, 78,246,239,247,229,236,243,233,231,110, 3,109,116, + 109,126,109,133,226,229,238,231,225,236,105,128, 9,191,228,229, + 246, 97,128, 9, 63,231,245,234,225,242,225,244,105,128, 10,191, + 250,232,233,244,243, 97, 2,109,155,109,166,227,249,242,233,236, + 236,233, 99,128, 4,117,228,226,236,231,242,225,246,229,227,249, + 242,233,236,236,233, 99,128, 4,119,106,138, 0,106,109,209,110, + 16,110, 27,110, 77,110, 93,110,206,111, 19,111, 24,111, 36,111, + 44, 97, 4,109,219,109,230,109,240,109,247,225,242,237,229,238, + 233,225,110,128, 5,113,226,229,238,231,225,236,105,128, 9,156, + 228,229,246, 97,128, 9, 28,231,117, 2,109,254,110, 7,234,225, + 242,225,244,105,128, 10,156,242,237,245,235,232,105,128, 10, 28, + 226,239,240,239,237,239,230,111,128, 49, 16, 99, 3,110, 35,110, + 42,110, 64,225,242,239,110,128, 1,240,233,242, 99, 2,110, 50, + 110, 55,236,101,128, 36,217,245,237,230,236,229,120,128, 1, 53, + 242,239,243,243,229,228,244,225,233,108,128, 2,157,228,239,244, + 236,229,243,243,243,244,242,239,235,101,128, 2, 95,101, 3,110, + 101,110,112,110,177,227,249,242,233,236,236,233, 99,128, 4, 88, + 229,109, 4,110,123,110,132,110,146,110,162,225,242,225,226,233, + 99,128, 6, 44,230,233,238,225,236,225,242,225,226,233, 99,128, + 254,158,233,238,233,244,233,225,236,225,242,225,226,233, 99,128, + 254,159,237,229,228,233,225,236,225,242,225,226,233, 99,128,254, + 160,104, 2,110,183,110,192,225,242,225,226,233, 99,128, 6,152, + 230,233,238,225,236,225,242,225,226,233, 99,128,251,139,104, 2, + 110,212,111, 6, 97, 3,110,220,110,230,110,237,226,229,238,231, + 225,236,105,128, 9,157,228,229,246, 97,128, 9, 29,231,117, 2, + 110,244,110,253,234,225,242,225,244,105,128, 10,157,242,237,245, + 235,232,105,128, 10, 29,229,232,225,242,237,229,238,233,225,110, + 128, 5,123,233,115,128, 48, 4,237,239,238,239,243,240,225,227, + 101,128,255, 74,240,225,242,229,110,128, 36,165,243,245,240,229, + 242,233,239,114,128, 2,178,107,146, 0,107,111, 95,113,184,113, + 195,114, 1,114, 12,114,102,114,116,115,224,116,164,116,177,116, + 203,116,252,117,134,117,156,117,169,117,192,117,234,117,244, 97, + 12,111,121,111,153,111,175,111,205,112, 63,112, 88,112,118,112, + 143,112,249,113, 7,113,130,113,159, 98, 2,111,127,111,144,225, + 243,232,235,233,242,227,249,242,233,236,236,233, 99,128, 4,161, + 229,238,231,225,236,105,128, 9,149, 99, 2,111,159,111,165,245, + 244,101,128, 30, 49,249,242,233,236,236,233, 99,128, 4, 58,228, + 101, 2,111,182,111,200,243,227,229,238,228,229,242,227,249,242, + 233,236,236,233, 99,128, 4,155,246, 97,128, 9, 21,102,135, 5, + 219,111,223,111,232,111,252,112, 10,112, 19,112, 35,112, 50,225, + 242,225,226,233, 99,128, 6, 67,228,225,231,229,243,104,129,251, + 59,111,243,232,229,226,242,229,119,128,251, 59,230,233,238,225, + 236,225,242,225,226,233, 99,128,254,218,232,229,226,242,229,119, + 128, 5,219,233,238,233,244,233,225,236,225,242,225,226,233, 99, + 128,254,219,237,229,228,233,225,236,225,242,225,226,233, 99,128, + 254,220,242,225,230,229,232,229,226,242,229,119,128,251, 77,231, + 117, 2,112, 70,112, 79,234,225,242,225,244,105,128, 10,149,242, + 237,245,235,232,105,128, 10, 21,104, 2,112, 94,112,104,233,242, + 225,231,225,238, 97,128, 48, 75,239,239,235,227,249,242,233,236, + 236,233, 99,128, 4,196,235,225,244,225,235,225,238, 97,129, 48, + 171,112,131,232,225,236,230,247,233,228,244,104,128,255,118,112, + 2,112,149,112,170,240, 97,129, 3,186,112,156,243,249,237,226, + 239,236,231,242,229,229,107,128, 3,240,249,229,239,245,110, 3, + 112,182,112,196,112,230,237,233,229,245,237,235,239,242,229,225, + 110,128, 49,113,112, 2,112,202,112,217,232,233,229,245,240,232, + 235,239,242,229,225,110,128, 49,132,233,229,245,240,235,239,242, + 229,225,110,128, 49,120,243,243,225,238,231,240,233,229,245,240, + 235,239,242,229,225,110,128, 49,121,242,239,242,233,233,243,241, + 245,225,242,101,128, 51, 13,115, 5,113, 19,113, 63,113, 78,113, + 86,113,114,232,233,228,225,225,245,244,111, 2,113, 32,113, 41, + 225,242,225,226,233, 99,128, 6, 64,238,239,243,233,228,229,226, + 229,225,242,233,238,231,225,242,225,226,233, 99,128, 6, 64,237, + 225,236,236,235,225,244,225,235,225,238, 97,128, 48,245,241,245, + 225,242,101,128, 51,132,242, 97, 2,113, 93,113,102,225,242,225, + 226,233, 99,128, 6, 80,244,225,238,225,242,225,226,233, 99,128, + 6, 77,244,242,239,235,229,227,249,242,233,236,236,233, 99,128, + 4,159,244,225,232,233,242,225,240,242,239,236,239,238,231,237, + 225,242,235,232,225,236,230,247,233,228,244,104,128,255,112,246, + 229,242,244,233,227,225,236,243,244,242,239,235,229,227,249,242, + 233,236,236,233, 99,128, 4,157,226,239,240,239,237,239,230,111, + 128, 49, 14, 99, 4,113,205,113,227,113,236,113,244, 97, 2,113, + 211,113,221,236,243,241,245,225,242,101,128, 51,137,242,239,110, + 128, 1,233,229,228,233,236,236, 97,128, 1, 55,233,242,227,236, + 101,128, 36,218,239,237,237,225,225,227,227,229,238,116,128, 1, + 55,228,239,244,226,229,236,239,119,128, 30, 51,101, 4,114, 22, + 114, 49,114, 74,114, 86,104, 2,114, 28,114, 39,225,242,237,229, + 238,233,225,110,128, 5,132,233,242,225,231,225,238, 97,128, 48, + 81,235,225,244,225,235,225,238, 97,129, 48,177,114, 62,232,225, + 236,230,247,233,228,244,104,128,255,121,238,225,242,237,229,238, + 233,225,110,128, 5,111,243,237,225,236,236,235,225,244,225,235, + 225,238, 97,128, 48,246,231,242,229,229,238,236,225,238,228,233, + 99,128, 1, 56,104, 6,114,130,115, 3,115, 14,115, 39,115,126, + 115,214, 97, 5,114,142,114,152,114,163,114,170,114,195,226,229, + 238,231,225,236,105,128, 9,150,227,249,242,233,236,236,233, 99, + 128, 4, 69,228,229,246, 97,128, 9, 22,231,117, 2,114,177,114, + 186,234,225,242,225,244,105,128, 10,150,242,237,245,235,232,105, + 128, 10, 22,104, 4,114,205,114,214,114,228,114,244,225,242,225, + 226,233, 99,128, 6, 46,230,233,238,225,236,225,242,225,226,233, + 99,128,254,166,233,238,233,244,233,225,236,225,242,225,226,233, + 99,128,254,167,237,229,228,233,225,236,225,242,225,226,233, 99, + 128,254,168,229,233,227,239,240,244,233, 99,128, 3,231,232, 97, + 2,115, 21,115, 28,228,229,246, 97,128, 9, 89,231,245,242,237, + 245,235,232,105,128, 10, 89,233,229,245,235,104, 4,115, 53,115, + 88,115,103,115,112, 97, 2,115, 59,115, 74,227,233,242,227,236, + 229,235,239,242,229,225,110,128, 50,120,240,225,242,229,238,235, + 239,242,229,225,110,128, 50, 24,227,233,242,227,236,229,235,239, + 242,229,225,110,128, 50,106,235,239,242,229,225,110,128, 49, 75, + 240,225,242,229,238,235,239,242,229,225,110,128, 50, 10,111, 4, + 115,136,115,185,115,195,115,200,235,104, 4,115,147,115,156,115, + 165,115,175,225,233,244,232,225,105,128, 14, 2,239,238,244,232, + 225,105,128, 14, 5,245,225,244,244,232,225,105,128, 14, 3,247, + 225,233,244,232,225,105,128, 14, 4,237,245,244,244,232,225,105, + 128, 14, 91,239,107,128, 1,153,242,225,235,232,225,238,231,244, + 232,225,105,128, 14, 6,250,243,241,245,225,242,101,128, 51,145, + 105, 4,115,234,115,245,116, 14,116, 63,232,233,242,225,231,225, + 238, 97,128, 48, 77,235,225,244,225,235,225,238, 97,129, 48,173, + 116, 2,232,225,236,230,247,233,228,244,104,128,255,119,242,111, + 3,116, 23,116, 38,116, 54,231,245,242,225,237,245,243,241,245, + 225,242,101,128, 51, 21,237,229,229,244,239,242,245,243,241,245, + 225,242,101,128, 51, 22,243,241,245,225,242,101,128, 51, 20,249, + 229,239,107, 5,116, 78,116,113,116,128,116,137,116,151, 97, 2, + 116, 84,116, 99,227,233,242,227,236,229,235,239,242,229,225,110, + 128, 50,110,240,225,242,229,238,235,239,242,229,225,110,128, 50, + 14,227,233,242,227,236,229,235,239,242,229,225,110,128, 50, 96, + 235,239,242,229,225,110,128, 49, 49,240,225,242,229,238,235,239, + 242,229,225,110,128, 50, 0,243,233,239,243,235,239,242,229,225, + 110,128, 49, 51,234,229,227,249,242,233,236,236,233, 99,128, 4, + 92,108, 2,116,183,116,194,233,238,229,226,229,236,239,119,128, + 30, 53,243,241,245,225,242,101,128, 51,152,109, 3,116,211,116, + 225,116,236,227,245,226,229,228,243,241,245,225,242,101,128, 51, + 166,239,238,239,243,240,225,227,101,128,255, 75,243,241,245,225, + 242,229,228,243,241,245,225,242,101,128, 51,162,111, 5,117, 8, + 117, 34,117, 72,117, 84,117, 98,104, 2,117, 14,117, 24,233,242, + 225,231,225,238, 97,128, 48, 83,237,243,241,245,225,242,101,128, + 51,192,235, 97, 2,117, 41,117, 49,233,244,232,225,105,128, 14, + 1,244,225,235,225,238, 97,129, 48,179,117, 60,232,225,236,230, + 247,233,228,244,104,128,255,122,239,240,239,243,241,245,225,242, + 101,128, 51, 30,240,240,225,227,249,242,233,236,236,233, 99,128, + 4,129,114, 2,117,104,117,124,229,225,238,243,244,225,238,228, + 225,242,228,243,249,237,226,239,108,128, 50,127,239,238,233,243, + 227,237, 98,128, 3, 67,240, 97, 2,117,141,117,147,242,229,110, + 128, 36,166,243,241,245,225,242,101,128, 51,170,243,233,227,249, + 242,233,236,236,233, 99,128, 4,111,116, 2,117,175,117,184,243, + 241,245,225,242,101,128, 51,207,245,242,238,229,100,128, 2,158, + 117, 2,117,198,117,209,232,233,242,225,231,225,238, 97,128, 48, + 79,235,225,244,225,235,225,238, 97,129, 48,175,117,222,232,225, + 236,230,247,233,228,244,104,128,255,120,246,243,241,245,225,242, + 101,128, 51,184,247,243,241,245,225,242,101,128, 51,190,108,146, + 0,108,118, 38,120, 65,120, 94,120,160,120,198,121, 94,121,103, + 121,119,121,143,121,161,122, 23,122, 64,122,199,122,207,122,240, + 122,249,123, 1,123, 63, 97, 7,118, 54,118, 64,118, 71,118, 78, + 118,103,118,119,120, 53,226,229,238,231,225,236,105,128, 9,178, + 227,245,244,101,128, 1, 58,228,229,246, 97,128, 9, 50,231,117, + 2,118, 85,118, 94,234,225,242,225,244,105,128, 10,178,242,237, + 245,235,232,105,128, 10, 50,235,235,232,225,238,231,249,225,239, + 244,232,225,105,128, 14, 69,109, 10,118,141,119, 80,119, 97,119, + 135,119,149,119,168,119,184,119,204,119,224,119,247, 97, 2,118, + 147,119, 72,236,229,102, 4,118,159,118,173,119, 9,119, 26,230, + 233,238,225,236,225,242,225,226,233, 99,128,254,252,232,225,237, + 250, 97, 2,118,183,118,224,225,226,239,246,101, 2,118,193,118, + 207,230,233,238,225,236,225,242,225,226,233, 99,128,254,248,233, + 243,239,236,225,244,229,228,225,242,225,226,233, 99,128,254,247, + 226,229,236,239,119, 2,118,234,118,248,230,233,238,225,236,225, + 242,225,226,233, 99,128,254,250,233,243,239,236,225,244,229,228, + 225,242,225,226,233, 99,128,254,249,233,243,239,236,225,244,229, + 228,225,242,225,226,233, 99,128,254,251,237,225,228,228,225,225, + 226,239,246,101, 2,119, 41,119, 55,230,233,238,225,236,225,242, + 225,226,233, 99,128,254,246,233,243,239,236,225,244,229,228,225, + 242,225,226,233, 99,128,254,245,242,225,226,233, 99,128, 6, 68, + 226,228, 97,129, 3,187,119, 88,243,244,242,239,235,101,128, 1, + 155,229,100,130, 5,220,119,106,119,126,228,225,231,229,243,104, + 129,251, 60,119,117,232,229,226,242,229,119,128,251, 60,232,229, + 226,242,229,119,128, 5,220,230,233,238,225,236,225,242,225,226, + 233, 99,128,254,222,232,225,232,233,238,233,244,233,225,236,225, + 242,225,226,233, 99,128,252,202,233,238,233,244,233,225,236,225, + 242,225,226,233, 99,128,254,223,234,229,229,237,233,238,233,244, + 233,225,236,225,242,225,226,233, 99,128,252,201,235,232,225,232, + 233,238,233,244,233,225,236,225,242,225,226,233, 99,128,252,203, + 236,225,237,232,229,232,233,243,239,236,225,244,229,228,225,242, + 225,226,233, 99,128,253,242,237,101, 2,119,254,120, 11,228,233, + 225,236,225,242,225,226,233, 99,128,254,224,229,109, 2,120, 18, + 120, 37,232,225,232,233,238,233,244,233,225,236,225,242,225,226, + 233, 99,128,253,136,233,238,233,244,233,225,236,225,242,225,226, + 233, 99,128,252,204,242,231,229,227,233,242,227,236,101,128, 37, + 239, 98, 3,120, 73,120, 78,120, 84,225,114,128, 1,154,229,236, + 116,128, 2,108,239,240,239,237,239,230,111,128, 49, 12, 99, 4, + 120,104,120,111,120,120,120,147,225,242,239,110,128, 1, 62,229, + 228,233,236,236, 97,128, 1, 60,233,242, 99, 2,120,128,120,133, + 236,101,128, 36,219,245,237,230,236,229,248,226,229,236,239,119, + 128, 30, 61,239,237,237,225,225,227,227,229,238,116,128, 1, 60, + 228,239,116,130, 1, 64,120,170,120,179,225,227,227,229,238,116, + 128, 1, 64,226,229,236,239,119,129, 30, 55,120,189,237,225,227, + 242,239,110,128, 30, 57,101, 3,120,206,120,244,121, 89,230,116, + 2,120,213,120,229,225,238,231,236,229,225,226,239,246,229,227, + 237, 98,128, 3, 26,244,225,227,235,226,229,236,239,247,227,237, + 98,128, 3, 24,243,115,132, 0, 60,121, 1,121, 23,121, 35,121, + 81,229,241,245,225,108,129, 34,100,121, 11,239,242,231,242,229, + 225,244,229,114,128, 34,218,237,239,238,239,243,240,225,227,101, + 128,255, 28,111, 2,121, 41,121, 70,114, 2,121, 47,121, 60,229, + 241,245,233,246,225,236,229,238,116,128, 34,114,231,242,229,225, + 244,229,114,128, 34,118,246,229,242,229,241,245,225,108,128, 34, + 102,243,237,225,236,108,128,254,100,250,104,128, 2,110,230,226, + 236,239,227,107,128, 37,140,232,239,239,235,242,229,244,242,239, + 230,236,229,120,128, 2,109,105, 2,121,125,121,130,242, 97,128, + 32,164,247,238,225,242,237,229,238,233,225,110,128, 5,108,106, + 129, 1,201,121,149,229,227,249,242,233,236,236,233, 99,128, 4, + 89,108,132,246,192,121,173,121,197,121,208,121,217, 97, 2,121, + 179,121,186,228,229,246, 97,128, 9, 51,231,245,234,225,242,225, + 244,105,128, 10,179,233,238,229,226,229,236,239,119,128, 30, 59, + 236,225,228,229,246, 97,128, 9, 52,246,239,227,225,236,233, 99, + 3,121,231,121,241,121,248,226,229,238,231,225,236,105,128, 9, + 225,228,229,246, 97,128, 9, 97,246,239,247,229,236,243,233,231, + 110, 2,122, 6,122, 16,226,229,238,231,225,236,105,128, 9,227, + 228,229,246, 97,128, 9, 99,109, 3,122, 31,122, 44,122, 55,233, + 228,228,236,229,244,233,236,228,101,128, 2,107,239,238,239,243, + 240,225,227,101,128,255, 76,243,241,245,225,242,101,128, 51,208, + 111, 6,122, 78,122, 90,122,132,122,143,122,149,122,191,227,232, + 245,236,225,244,232,225,105,128, 14, 44,231,233,227,225,108, 3, + 122,102,122,108,122,127,225,238,100,128, 34, 39,238,239,116,129, + 0,172,122,116,242,229,246,229,242,243,229,100,128, 35, 16,239, + 114,128, 34, 40,236,233,238,231,244,232,225,105,128, 14, 37,238, + 231,115,128, 1,127,247,236,233,238,101, 2,122,159,122,182, 99, + 2,122,165,122,177,229,238,244,229,242,236,233,238,101,128,254, + 78,237, 98,128, 3, 50,228,225,243,232,229,100,128,254, 77,250, + 229,238,231,101,128, 37,202,240,225,242,229,110,128, 36,167,115, + 3,122,215,122,222,122,230,236,225,243,104,128, 1, 66,241,245, + 225,242,101,128, 33, 19,245,240,229,242,233,239,114,128,246,238, + 244,243,232,225,228,101,128, 37,145,245,244,232,225,105,128, 14, + 38,246,239,227,225,236,233, 99, 3,123, 15,123, 25,123, 32,226, + 229,238,231,225,236,105,128, 9,140,228,229,246, 97,128, 9, 12, + 246,239,247,229,236,243,233,231,110, 2,123, 46,123, 56,226,229, + 238,231,225,236,105,128, 9,226,228,229,246, 97,128, 9, 98,248, + 243,241,245,225,242,101,128, 51,211,109,144, 0,109,123,109,125, + 218,125,243,126, 14,126, 39,127, 92,127,114,128,169,128,199,128, + 248,129, 99,129,121,129,146,129,155,130,182,130,210, 97, 12,123, + 135,123,145,123,209,123,216,123,241,124, 33,125,125,125,150,125, + 155,125,169,125,181,125,186,226,229,238,231,225,236,105,128, 9, + 174, 99, 2,123,151,123,203,242,239,110,132, 0,175,123,165,123, + 176,123,182,123,191,226,229,236,239,247,227,237, 98,128, 3, 49, + 227,237, 98,128, 3, 4,236,239,247,237,239,100,128, 2,205,237, + 239,238,239,243,240,225,227,101,128,255,227,245,244,101,128, 30, + 63,228,229,246, 97,128, 9, 46,231,117, 2,123,223,123,232,234, + 225,242,225,244,105,128, 10,174,242,237,245,235,232,105,128, 10, + 46,104, 2,123,247,124, 23,225,240,225,235,104, 2,124, 1,124, + 10,232,229,226,242,229,119,128, 5,164,236,229,230,244,232,229, + 226,242,229,119,128, 5,164,233,242,225,231,225,238, 97,128, 48, + 126,105, 5,124, 45,124,114,124,177,124,207,125,113,227,232,225, + 244,244,225,247, 97, 3,124, 60,124, 91,124, 98,236,239,119, 2, + 124, 68,124, 79,236,229,230,244,244,232,225,105,128,248,149,242, + 233,231,232,244,244,232,225,105,128,248,148,244,232,225,105,128, + 14, 75,245,240,240,229,242,236,229,230,244,244,232,225,105,128, + 248,147,229,107, 3,124,123,124,154,124,161,236,239,119, 2,124, + 131,124,142,236,229,230,244,244,232,225,105,128,248,140,242,233, + 231,232,244,244,232,225,105,128,248,139,244,232,225,105,128, 14, + 72,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248, + 138,232,225,238,225,235,225,116, 2,124,189,124,200,236,229,230, + 244,244,232,225,105,128,248,132,244,232,225,105,128, 14, 49,116, + 3,124,215,124,243,125, 50,225,233,235,232,117, 2,124,225,124, + 236,236,229,230,244,244,232,225,105,128,248,137,244,232,225,105, + 128, 14, 71,232,111, 3,124,252,125, 27,125, 34,236,239,119, 2, + 125, 4,125, 15,236,229,230,244,244,232,225,105,128,248,143,242, + 233,231,232,244,244,232,225,105,128,248,142,244,232,225,105,128, + 14, 73,245,240,240,229,242,236,229,230,244,244,232,225,105,128, + 248,141,242,105, 3,125, 59,125, 90,125, 97,236,239,119, 2,125, + 67,125, 78,236,229,230,244,244,232,225,105,128,248,146,242,233, + 231,232,244,244,232,225,105,128,248,145,244,232,225,105,128, 14, + 74,245,240,240,229,242,236,229,230,244,244,232,225,105,128,248, + 144,249,225,237,239,235,244,232,225,105,128, 14, 70,235,225,244, + 225,235,225,238, 97,129, 48,222,125,138,232,225,236,230,247,233, + 228,244,104,128,255,143,236,101,128, 38, 66,238,243,249,239,238, + 243,241,245,225,242,101,128, 51, 71,241,225,230,232,229,226,242, + 229,119,128, 5,190,242,115,128, 38, 66,115, 2,125,192,125,210, + 239,242,225,227,233,242,227,236,229,232,229,226,242,229,119,128, + 5,175,241,245,225,242,101,128, 51,131, 98, 2,125,224,125,234, + 239,240,239,237,239,230,111,128, 49, 7,243,241,245,225,242,101, + 128, 51,212, 99, 2,125,249,126, 1,233,242,227,236,101,128, 36, + 220,245,226,229,228,243,241,245,225,242,101,128, 51,165,228,239, + 116, 2,126, 22,126, 31,225,227,227,229,238,116,128, 30, 65,226, + 229,236,239,119,128, 30, 67,101, 7,126, 55,126,182,126,193,126, + 208,126,233,127, 14,127, 26,101, 2,126, 61,126,169,109, 4,126, + 71,126, 80,126, 94,126,110,225,242,225,226,233, 99,128, 6, 69, + 230,233,238,225,236,225,242,225,226,233, 99,128,254,226,233,238, + 233,244,233,225,236,225,242,225,226,233, 99,128,254,227,237,101, + 2,126,117,126,130,228,233,225,236,225,242,225,226,233, 99,128, + 254,228,229,237,105, 2,126,138,126,153,238,233,244,233,225,236, + 225,242,225,226,233, 99,128,252,209,243,239,236,225,244,229,228, + 225,242,225,226,233, 99,128,252, 72,244,239,242,245,243,241,245, + 225,242,101,128, 51, 77,232,233,242,225,231,225,238, 97,128, 48, + 129,233,250,233,229,242,225,243,241,245,225,242,101,128, 51,126, + 235,225,244,225,235,225,238, 97,129, 48,225,126,221,232,225,236, + 230,247,233,228,244,104,128,255,146,109,130, 5,222,126,241,127, + 5,228,225,231,229,243,104,129,251, 62,126,252,232,229,226,242, + 229,119,128,251, 62,232,229,226,242,229,119,128, 5,222,238,225, + 242,237,229,238,233,225,110,128, 5,116,242,235,232, 97, 3,127, + 37,127, 46,127, 79,232,229,226,242,229,119,128, 5,165,235,229, + 230,245,236, 97, 2,127, 57,127, 66,232,229,226,242,229,119,128, + 5,166,236,229,230,244,232,229,226,242,229,119,128, 5,166,236, + 229,230,244,232,229,226,242,229,119,128, 5,165,104, 2,127, 98, + 127,104,239,239,107,128, 2,113,250,243,241,245,225,242,101,128, + 51,146,105, 6,127,128,127,165,128, 46,128, 57,128, 82,128,139, + 228,100, 2,127,135,127,160,236,229,228,239,244,235,225,244,225, + 235,225,238,225,232,225,236,230,247,233,228,244,104,128,255,101, + 239,116,128, 0,183,229,245,109, 5,127,179,127,214,127,229,127, + 238,128, 33, 97, 2,127,185,127,200,227,233,242,227,236,229,235, + 239,242,229,225,110,128, 50,114,240,225,242,229,238,235,239,242, + 229,225,110,128, 50, 18,227,233,242,227,236,229,235,239,242,229, + 225,110,128, 50,100,235,239,242,229,225,110,128, 49, 65,112, 2, + 127,244,128, 20, 97, 2,127,250,128, 8,238,243,233,239,243,235, + 239,242,229,225,110,128, 49,112,242,229,238,235,239,242,229,225, + 110,128, 50, 4,233,229,245,240,235,239,242,229,225,110,128, 49, + 110,243,233,239,243,235,239,242,229,225,110,128, 49,111,232,233, + 242,225,231,225,238, 97,128, 48,127,235,225,244,225,235,225,238, + 97,129, 48,223,128, 70,232,225,236,230,247,233,228,244,104,128, + 255,144,238,117, 2,128, 89,128,134,115,132, 34, 18,128,101,128, + 112,128,121,128,127,226,229,236,239,247,227,237, 98,128, 3, 32, + 227,233,242,227,236,101,128, 34,150,237,239,100,128, 2,215,240, + 236,245,115,128, 34, 19,244,101,128, 32, 50,242,105, 2,128,146, + 128,160,226,225,225,242,245,243,241,245,225,242,101,128, 51, 74, + 243,241,245,225,242,101,128, 51, 73,108, 2,128,175,128,190,239, + 238,231,236,229,231,244,245,242,238,229,100,128, 2,112,243,241, + 245,225,242,101,128, 51,150,109, 3,128,207,128,221,128,232,227, + 245,226,229,228,243,241,245,225,242,101,128, 51,163,239,238,239, + 243,240,225,227,101,128,255, 77,243,241,245,225,242,229,228,243, + 241,245,225,242,101,128, 51,159,111, 5,129, 4,129, 30,129, 55, + 129, 65,129, 74,104, 2,129, 10,129, 20,233,242,225,231,225,238, + 97,128, 48,130,237,243,241,245,225,242,101,128, 51,193,235,225, + 244,225,235,225,238, 97,129, 48,226,129, 43,232,225,236,230,247, + 233,228,244,104,128,255,147,236,243,241,245,225,242,101,128, 51, + 214,237,225,244,232,225,105,128, 14, 33,246,229,242,243,243,241, + 245,225,242,101,129, 51,167,129, 89,228,243,241,245,225,242,101, + 128, 51,168,240, 97, 2,129,106,129,112,242,229,110,128, 36,168, + 243,241,245,225,242,101,128, 51,171,115, 2,129,127,129,136,243, + 241,245,225,242,101,128, 51,179,245,240,229,242,233,239,114,128, + 246,239,244,245,242,238,229,100,128, 2,111,117,141, 0,181,129, + 185,129,189,129,199,129,223,129,233,129,255,130, 10,130, 35,130, + 58,130, 68,130, 98,130,162,130,172, 49,128, 0,181,225,243,241, + 245,225,242,101,128, 51,130,227,104, 2,129,206,129,216,231,242, + 229,225,244,229,114,128, 34,107,236,229,243,115,128, 34,106,230, + 243,241,245,225,242,101,128, 51,140,103, 2,129,239,129,246,242, + 229,229,107,128, 3,188,243,241,245,225,242,101,128, 51,141,232, + 233,242,225,231,225,238, 97,128, 48,128,235,225,244,225,235,225, + 238, 97,129, 48,224,130, 23,232,225,236,230,247,233,228,244,104, + 128,255,145,108, 2,130, 41,130, 50,243,241,245,225,242,101,128, + 51,149,244,233,240,236,121,128, 0,215,237,243,241,245,225,242, + 101,128, 51,155,238,225,104, 2,130, 76,130, 85,232,229,226,242, + 229,119,128, 5,163,236,229,230,244,232,229,226,242,229,119,128, + 5,163,115, 2,130,104,130,153,233, 99, 3,130,113,130,130,130, + 141,225,236,238,239,244,101,129, 38,106,130,124,228,226,108,128, + 38,107,230,236,225,244,243,233,231,110,128, 38,109,243,232,225, + 242,240,243,233,231,110,128, 38,111,243,241,245,225,242,101,128, + 51,178,246,243,241,245,225,242,101,128, 51,182,247,243,241,245, + 225,242,101,128, 51,188,118, 2,130,188,130,201,237,229,231,225, + 243,241,245,225,242,101,128, 51,185,243,241,245,225,242,101,128, + 51,183,119, 2,130,216,130,229,237,229,231,225,243,241,245,225, + 242,101,128, 51,191,243,241,245,225,242,101,128, 51,189,110,150, + 0,110,131, 30,131,164,131,188,131,254,132, 23,132, 81,132, 91, + 132,158,132,201,134,235,134,253,135, 22,135, 53,135, 79,135,144, + 137,126,137,134,137,159,137,167,138,135,138,145,138,155, 97, 8, + 131, 48,131, 68,131, 75,131, 82,131,107,131,118,131,143,131,155, + 98, 2,131, 54,131, 63,229,238,231,225,236,105,128, 9,168,236, + 97,128, 34, 7,227,245,244,101,128, 1, 68,228,229,246, 97,128, + 9, 40,231,117, 2,131, 89,131, 98,234,225,242,225,244,105,128, + 10,168,242,237,245,235,232,105,128, 10, 40,232,233,242,225,231, + 225,238, 97,128, 48,106,235,225,244,225,235,225,238, 97,129, 48, + 202,131,131,232,225,236,230,247,233,228,244,104,128,255,133,240, + 239,243,244,242,239,240,232,101,128, 1, 73,243,241,245,225,242, + 101,128, 51,129, 98, 2,131,170,131,180,239,240,239,237,239,230, + 111,128, 49, 11,243,240,225,227,101,128, 0,160, 99, 4,131,198, + 131,205,131,214,131,241,225,242,239,110,128, 1, 72,229,228,233, + 236,236, 97,128, 1, 70,233,242, 99, 2,131,222,131,227,236,101, + 128, 36,221,245,237,230,236,229,248,226,229,236,239,119,128, 30, + 75,239,237,237,225,225,227,227,229,238,116,128, 1, 70,228,239, + 116, 2,132, 6,132, 15,225,227,227,229,238,116,128, 30, 69,226, + 229,236,239,119,128, 30, 71,101, 3,132, 31,132, 42,132, 67,232, + 233,242,225,231,225,238, 97,128, 48,109,235,225,244,225,235,225, + 238, 97,129, 48,205,132, 55,232,225,236,230,247,233,228,244,104, + 128,255,136,247,243,232,229,241,229,236,243,233,231,110,128, 32, + 170,230,243,241,245,225,242,101,128, 51,139,103, 2,132, 97,132, + 147, 97, 3,132,105,132,115,132,122,226,229,238,231,225,236,105, + 128, 9,153,228,229,246, 97,128, 9, 25,231,117, 2,132,129,132, + 138,234,225,242,225,244,105,128, 10,153,242,237,245,235,232,105, + 128, 10, 25,239,238,231,245,244,232,225,105,128, 14, 7,104, 2, + 132,164,132,174,233,242,225,231,225,238, 97,128, 48,147,239,239, + 107, 2,132,182,132,189,236,229,230,116,128, 2,114,242,229,244, + 242,239,230,236,229,120,128, 2,115,105, 4,132,211,133,124,133, + 135,133,193,229,245,110, 7,132,229,133, 8,133, 40,133, 54,133, + 63,133, 96,133,109, 97, 2,132,235,132,250,227,233,242,227,236, + 229,235,239,242,229,225,110,128, 50,111,240,225,242,229,238,235, + 239,242,229,225,110,128, 50, 15,227,105, 2,133, 15,133, 27,229, + 245,227,235,239,242,229,225,110,128, 49, 53,242,227,236,229,235, + 239,242,229,225,110,128, 50, 97,232,233,229,245,232,235,239,242, + 229,225,110,128, 49, 54,235,239,242,229,225,110,128, 49, 52,240, + 97, 2,133, 70,133, 84,238,243,233,239,243,235,239,242,229,225, + 110,128, 49,104,242,229,238,235,239,242,229,225,110,128, 50, 1, + 243,233,239,243,235,239,242,229,225,110,128, 49,103,244,233,235, + 229,245,244,235,239,242,229,225,110,128, 49,102,232,233,242,225, + 231,225,238, 97,128, 48,107,107, 2,133,141,133,165,225,244,225, + 235,225,238, 97,129, 48,203,133,153,232,225,236,230,247,233,228, + 244,104,128,255,134,232,225,232,233,116, 2,133,175,133,186,236, + 229,230,244,244,232,225,105,128,248,153,244,232,225,105,128, 14, + 77,238,101,141, 0, 57,133,224,133,233,133,243,134, 17,134, 24, + 134, 49,134, 76,134,110,134,122,134,133,134,166,134,174,134,185, + 225,242,225,226,233, 99,128, 6,105,226,229,238,231,225,236,105, + 128, 9,239,227,233,242,227,236,101,129, 36,104,133,254,233,238, + 246,229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39, + 146,228,229,246, 97,128, 9,111,231,117, 2,134, 31,134, 40,234, + 225,242,225,244,105,128, 10,239,242,237,245,235,232,105,128, 10, + 111,232, 97, 2,134, 56,134, 67,227,235,225,242,225,226,233, 99, + 128, 6,105,238,231,250,232,239,117,128, 48, 41,105, 2,134, 82, + 134,100,228,229,239,231,242,225,240,232,233,227,240,225,242,229, + 110,128, 50, 40,238,230,229,242,233,239,114,128, 32,137,237,239, + 238,239,243,240,225,227,101,128,255, 25,239,236,228,243,244,249, + 236,101,128,247, 57,112, 2,134,139,134,146,225,242,229,110,128, + 36,124,229,114, 2,134,153,134,159,233,239,100,128, 36,144,243, + 233,225,110,128, 6,249,242,239,237,225,110,128, 33,120,243,245, + 240,229,242,233,239,114,128, 32,121,116, 2,134,191,134,229,229, + 229,110, 2,134,199,134,208,227,233,242,227,236,101,128, 36,114, + 112, 2,134,214,134,221,225,242,229,110,128, 36,134,229,242,233, + 239,100,128, 36,154,232,225,105,128, 14, 89,106,129, 1,204,134, + 241,229,227,249,242,233,236,236,233, 99,128, 4, 90,235,225,244, + 225,235,225,238, 97,129, 48,243,135, 10,232,225,236,230,247,233, + 228,244,104,128,255,157,108, 2,135, 28,135, 42,229,231,242,233, + 231,232,244,236,239,238,103,128, 1,158,233,238,229,226,229,236, + 239,119,128, 30, 73,109, 2,135, 59,135, 70,239,238,239,243,240, + 225,227,101,128,255, 78,243,241,245,225,242,101,128, 51,154,110, + 2,135, 85,135,135, 97, 3,135, 93,135,103,135,110,226,229,238, + 231,225,236,105,128, 9,163,228,229,246, 97,128, 9, 35,231,117, + 2,135,117,135,126,234,225,242,225,244,105,128, 10,163,242,237, + 245,235,232,105,128, 10, 35,238,225,228,229,246, 97,128, 9, 41, + 111, 6,135,158,135,169,135,194,135,235,136,187,137,114,232,233, + 242,225,231,225,238, 97,128, 48,110,235,225,244,225,235,225,238, + 97,129, 48,206,135,182,232,225,236,230,247,233,228,244,104,128, + 255,137,110, 3,135,202,135,218,135,227,226,242,229,225,235,233, + 238,231,243,240,225,227,101,128, 0,160,229,238,244,232,225,105, + 128, 14, 19,245,244,232,225,105,128, 14, 25,239,110, 7,135,252, + 136, 5,136, 19,136, 53,136, 69,136,110,136,169,225,242,225,226, + 233, 99,128, 6, 70,230,233,238,225,236,225,242,225,226,233, 99, + 128,254,230,231,232,245,238,238, 97, 2,136, 30,136, 39,225,242, + 225,226,233, 99,128, 6,186,230,233,238,225,236,225,242,225,226, + 233, 99,128,251,159,233,238,233,244,233,225,236,225,242,225,226, + 233, 99,128,254,231,234,229,229,237,105, 2,136, 79,136, 94,238, + 233,244,233,225,236,225,242,225,226,233, 99,128,252,210,243,239, + 236,225,244,229,228,225,242,225,226,233, 99,128,252, 75,237,101, + 2,136,117,136,130,228,233,225,236,225,242,225,226,233, 99,128, + 254,232,229,237,105, 2,136,138,136,153,238,233,244,233,225,236, + 225,242,225,226,233, 99,128,252,213,243,239,236,225,244,229,228, + 225,242,225,226,233, 99,128,252, 78,238,239,239,238,230,233,238, + 225,236,225,242,225,226,233, 99,128,252,141,116, 7,136,203,136, + 214,136,243,137, 22,137, 34,137, 54,137, 80,227,239,238,244,225, + 233,238,115,128, 34, 12,101, 2,136,220,136,236,236,229,237,229, + 238,116,129, 34, 9,136,231,239,102,128, 34, 9,241,245,225,108, + 128, 34, 96,231,242,229,225,244,229,114,129, 34,111,136,255,238, + 239,114, 2,137, 7,137, 15,229,241,245,225,108,128, 34,113,236, + 229,243,115,128, 34,121,233,228,229,238,244,233,227,225,108,128, + 34, 98,236,229,243,115,129, 34,110,137, 43,238,239,242,229,241, + 245,225,108,128, 34,112,112, 2,137, 60,137, 70,225,242,225,236, + 236,229,108,128, 34, 38,242,229,227,229,228,229,115,128, 34,128, + 243,117, 3,137, 89,137, 96,137,105,226,243,229,116,128, 34,132, + 227,227,229,229,228,115,128, 34,129,240,229,242,243,229,116,128, + 34,133,247,225,242,237,229,238,233,225,110,128, 5,118,240,225, + 242,229,110,128, 36,169,115, 2,137,140,137,149,243,241,245,225, + 242,101,128, 51,177,245,240,229,242,233,239,114,128, 32,127,244, + 233,236,228,101,128, 0,241,117,132, 3,189,137,179,137,190,138, + 15,138, 98,232,233,242,225,231,225,238, 97,128, 48,108,107, 2, + 137,196,137,220,225,244,225,235,225,238, 97,129, 48,204,137,208, + 232,225,236,230,247,233,228,244,104,128,255,135,244, 97, 3,137, + 229,137,239,137,246,226,229,238,231,225,236,105,128, 9,188,228, + 229,246, 97,128, 9, 60,231,117, 2,137,253,138, 6,234,225,242, + 225,244,105,128, 10,188,242,237,245,235,232,105,128, 10, 60,109, + 2,138, 21,138, 55,226,229,242,243,233,231,110,130, 0, 35,138, + 35,138, 47,237,239,238,239,243,240,225,227,101,128,255, 3,243, + 237,225,236,108,128,254, 95,229,114, 2,138, 62,138, 94,225,236, + 243,233,231,110, 2,138, 73,138, 81,231,242,229,229,107,128, 3, + 116,236,239,247,229,242,231,242,229,229,107,128, 3,117,111,128, + 33, 22,110,130, 5,224,138,106,138,126,228,225,231,229,243,104, + 129,251, 64,138,117,232,229,226,242,229,119,128,251, 64,232,229, + 226,242,229,119,128, 5,224,246,243,241,245,225,242,101,128, 51, + 181,247,243,241,245,225,242,101,128, 51,187,249, 97, 3,138,164, + 138,174,138,181,226,229,238,231,225,236,105,128, 9,158,228,229, + 246, 97,128, 9, 30,231,117, 2,138,188,138,197,234,225,242,225, + 244,105,128, 10,158,242,237,245,235,232,105,128, 10, 30,111,147, + 0,111,138,248,139, 14,139, 92,140, 6,140, 78,140, 93,140,133, + 141, 0,141, 21,141, 59,141, 70,141,248,143, 82,143,146,143,179, + 143,225,144, 98,144,145,144,157, 97, 2,138,254,139, 5,227,245, + 244,101,128, 0,243,238,231,244,232,225,105,128, 14, 45, 98, 4, + 139, 24,139, 66,139, 75,139, 85,225,242,242,229,100,130, 2,117, + 139, 36,139, 47,227,249,242,233,236,236,233, 99,128, 4,233,228, + 233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128, + 4,235,229,238,231,225,236,105,128, 9,147,239,240,239,237,239, + 230,111,128, 49, 27,242,229,246,101,128, 1, 79, 99, 3,139,100, + 139,173,139,252, 97, 2,139,106,139,167,238,228,242, 97, 3,139, + 117,139,124,139,135,228,229,246, 97,128, 9, 17,231,245,234,225, + 242,225,244,105,128, 10,145,246,239,247,229,236,243,233,231,110, + 2,139,149,139,156,228,229,246, 97,128, 9, 73,231,245,234,225, + 242,225,244,105,128, 10,201,242,239,110,128, 1,210,233,242, 99, + 2,139,181,139,186,236,101,128, 36,222,245,237,230,236,229,120, + 133, 0,244,139,205,139,213,139,224,139,232,139,244,225,227,245, + 244,101,128, 30,209,228,239,244,226,229,236,239,119,128, 30,217, + 231,242,225,246,101,128, 30,211,232,239,239,235,225,226,239,246, + 101,128, 30,213,244,233,236,228,101,128, 30,215,249,242,233,236, + 236,233, 99,128, 4, 62,100, 4,140, 16,140, 39,140, 45,140, 68, + 226,108, 2,140, 23,140, 31,225,227,245,244,101,128, 1, 81,231, + 242,225,246,101,128, 2, 13,229,246, 97,128, 9, 19,233,229,242, + 229,243,233,115,129, 0,246,140, 57,227,249,242,233,236,236,233, + 99,128, 4,231,239,244,226,229,236,239,119,128, 30,205,101,129, + 1, 83,140, 84,235,239,242,229,225,110,128, 49, 90,103, 3,140, + 101,140,116,140,123,239,238,229,107,129, 2,219,140,110,227,237, + 98,128, 3, 40,242,225,246,101,128, 0,242,245,234,225,242,225, + 244,105,128, 10,147,104, 4,140,143,140,154,140,164,140,242,225, + 242,237,229,238,233,225,110,128, 5,133,233,242,225,231,225,238, + 97,128, 48, 74,111, 2,140,170,140,180,239,235,225,226,239,246, + 101,128, 30,207,242,110,133, 1,161,140,195,140,203,140,214,140, + 222,140,234,225,227,245,244,101,128, 30,219,228,239,244,226,229, + 236,239,119,128, 30,227,231,242,225,246,101,128, 30,221,232,239, + 239,235,225,226,239,246,101,128, 30,223,244,233,236,228,101,128, + 30,225,245,238,231,225,242,245,237,236,225,245,116,128, 1, 81, + 105,129, 1,163,141, 6,238,246,229,242,244,229,228,226,242,229, + 246,101,128, 2, 15,107, 2,141, 27,141, 51,225,244,225,235,225, + 238, 97,129, 48,170,141, 39,232,225,236,230,247,233,228,244,104, + 128,255,117,239,242,229,225,110,128, 49, 87,236,229,232,229,226, + 242,229,119,128, 5,171,109, 6,141, 84,141,112,141,119,141,208, + 141,219,141,237,225,227,242,239,110,130, 1, 77,141, 96,141,104, + 225,227,245,244,101,128, 30, 83,231,242,225,246,101,128, 30, 81, + 228,229,246, 97,128, 9, 80,229,231, 97,133, 3,201,141,135,141, + 139,141,150,141,164,141,180, 49,128, 3,214,227,249,242,233,236, + 236,233, 99,128, 4, 97,236,225,244,233,238,227,236,239,243,229, + 100,128, 2,119,242,239,245,238,228,227,249,242,233,236,236,233, + 99,128, 4,123,116, 2,141,186,141,201,233,244,236,239,227,249, + 242,233,236,236,233, 99,128, 4,125,239,238,239,115,128, 3,206, + 231,245,234,225,242,225,244,105,128, 10,208,233,227,242,239,110, + 129, 3,191,141,229,244,239,238,239,115,128, 3,204,239,238,239, + 243,240,225,227,101,128,255, 79,238,101,145, 0, 49,142, 31,142, + 40,142, 50,142, 80,142,105,142,114,142,123,142,148,142,182,142, + 216,142,228,142,247,143, 2,143, 35,143, 45,143, 53,143, 64,225, + 242,225,226,233, 99,128, 6, 97,226,229,238,231,225,236,105,128, + 9,231,227,233,242,227,236,101,129, 36, 96,142, 61,233,238,246, + 229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,138, + 100, 2,142, 86,142, 92,229,246, 97,128, 9,103,239,244,229,238, + 236,229,225,228,229,114,128, 32, 36,229,233,231,232,244,104,128, + 33, 91,230,233,244,244,229,100,128,246,220,231,117, 2,142,130, + 142,139,234,225,242,225,244,105,128, 10,231,242,237,245,235,232, + 105,128, 10,103,232, 97, 3,142,157,142,168,142,173,227,235,225, + 242,225,226,233, 99,128, 6, 97,236,102,128, 0,189,238,231,250, + 232,239,117,128, 48, 33,105, 2,142,188,142,206,228,229,239,231, + 242,225,240,232,233,227,240,225,242,229,110,128, 50, 32,238,230, + 229,242,233,239,114,128, 32,129,237,239,238,239,243,240,225,227, + 101,128,255, 17,238,245,237,229,242,225,244,239,242,226,229,238, + 231,225,236,105,128, 9,244,239,236,228,243,244,249,236,101,128, + 247, 49,112, 2,143, 8,143, 15,225,242,229,110,128, 36,116,229, + 114, 2,143, 22,143, 28,233,239,100,128, 36,136,243,233,225,110, + 128, 6,241,241,245,225,242,244,229,114,128, 0,188,242,239,237, + 225,110,128, 33,112,243,245,240,229,242,233,239,114,128, 0,185, + 244,104, 2,143, 71,143, 76,225,105,128, 14, 81,233,242,100,128, + 33, 83,111, 3,143, 90,143,124,143,140,103, 2,143, 96,143,114, + 239,238,229,107,129, 1,235,143,105,237,225,227,242,239,110,128, + 1,237,245,242,237,245,235,232,105,128, 10, 19,237,225,244,242, + 225,231,245,242,237,245,235,232,105,128, 10, 75,240,229,110,128, + 2, 84,112, 3,143,154,143,161,143,172,225,242,229,110,128, 36, + 170,229,238,226,245,236,236,229,116,128, 37,230,244,233,239,110, + 128, 35, 37,114, 2,143,185,143,214,100, 2,143,191,143,202,230, + 229,237,233,238,233,238,101,128, 0,170,237,225,243,227,245,236, + 233,238,101,128, 0,186,244,232,239,231,239,238,225,108,128, 34, + 31,115, 5,143,237,144, 13,144, 30,144, 75,144, 88,232,239,242, + 116, 2,143,246,143,253,228,229,246, 97,128, 9, 18,246,239,247, + 229,236,243,233,231,238,228,229,246, 97,128, 9, 74,236,225,243, + 104,129, 0,248,144, 22,225,227,245,244,101,128, 1,255,237,225, + 236,108, 2,144, 39,144, 50,232,233,242,225,231,225,238, 97,128, + 48, 73,235,225,244,225,235,225,238, 97,129, 48,169,144, 63,232, + 225,236,230,247,233,228,244,104,128,255,107,244,242,239,235,229, + 225,227,245,244,101,128, 1,255,245,240,229,242,233,239,114,128, + 246,240,116, 2,144,104,144,115,227,249,242,233,236,236,233, 99, + 128, 4,127,233,236,228,101,130, 0,245,144,126,144,134,225,227, + 245,244,101,128, 30, 77,228,233,229,242,229,243,233,115,128, 30, + 79,245,226,239,240,239,237,239,230,111,128, 49, 33,118, 2,144, + 163,144,244,229,114, 2,144,170,144,236,236,233,238,101,131, 32, + 62,144,183,144,206,144,229, 99, 2,144,189,144,201,229,238,244, + 229,242,236,233,238,101,128,254, 74,237, 98,128, 3, 5,100, 2, + 144,212,144,220,225,243,232,229,100,128,254, 73,226,236,247,225, + 246,121,128,254, 76,247,225,246,121,128,254, 75,243,227,239,242, + 101,128, 0,175,239,247,229,236,243,233,231,110, 3,145, 3,145, + 13,145, 20,226,229,238,231,225,236,105,128, 9,203,228,229,246, + 97,128, 9, 75,231,245,234,225,242,225,244,105,128, 10,203,112, + 145, 0,112,145, 69,147,197,147,208,147,217,147,229,149,154,149, + 164,150,156,151,175,152, 9,152, 35,152,166,152,174,153, 76,153, + 134,153,162,153,172, 97, 14,145, 99,145,131,145,141,145,148,145, + 155,145,203,145,214,145,228,145,239,146, 30,146, 44,147, 56,147, + 95,147,185, 97, 2,145,105,145,117,237,240,243,243,241,245,225, + 242,101,128, 51,128,243,229,238,244,239,243,241,245,225,242,101, + 128, 51, 43,226,229,238,231,225,236,105,128, 9,170,227,245,244, + 101,128, 30, 85,228,229,246, 97,128, 9, 42,103, 2,145,161,145, + 179,101, 2,145,167,145,174,228,239,247,110,128, 33,223,245,112, + 128, 33,222,117, 2,145,185,145,194,234,225,242,225,244,105,128, + 10,170,242,237,245,235,232,105,128, 10, 42,232,233,242,225,231, + 225,238, 97,128, 48,113,233,249,225,238,238,239,233,244,232,225, + 105,128, 14, 47,235,225,244,225,235,225,238, 97,128, 48,209,108, + 2,145,245,146, 14,225,244,225,236,233,250,225,244,233,239,238, + 227,249,242,233,236,236,233,227,227,237, 98,128, 4,132,239,227, + 232,235,225,227,249,242,233,236,236,233, 99,128, 4,192,238,243, + 233,239,243,235,239,242,229,225,110,128, 49,127,114, 3,146, 52, + 146, 73,147, 45, 97, 2,146, 58,146, 66,231,242,225,240,104,128, + 0,182,236,236,229,108,128, 34, 37,229,110, 2,146, 80,146,190, + 236,229,230,116,136, 0, 40,146,103,146,118,146,123,146,128,146, + 139,146,151,146,174,146,179,225,236,244,239,238,229,225,242,225, + 226,233, 99,128,253, 62,226,116,128,248,237,229,120,128,248,236, + 233,238,230,229,242,233,239,114,128, 32,141,237,239,238,239,243, + 240,225,227,101,128,255, 8,115, 2,146,157,146,164,237,225,236, + 108,128,254, 89,245,240,229,242,233,239,114,128, 32,125,244,112, + 128,248,235,246,229,242,244,233,227,225,108,128,254, 53,242,233, + 231,232,116,136, 0, 41,146,214,146,229,146,234,146,239,146,250, + 147, 6,147, 29,147, 34,225,236,244,239,238,229,225,242,225,226, + 233, 99,128,253, 63,226,116,128,248,248,229,120,128,248,247,233, + 238,230,229,242,233,239,114,128, 32,142,237,239,238,239,243,240, + 225,227,101,128,255, 9,115, 2,147, 12,147, 19,237,225,236,108, + 128,254, 90,245,240,229,242,233,239,114,128, 32,126,244,112,128, + 248,246,246,229,242,244,233,227,225,108,128,254, 54,244,233,225, + 236,228,233,230,102,128, 34, 2,115, 3,147, 64,147, 75,147, 87, + 229,241,232,229,226,242,229,119,128, 5,192,232,244,225,232,229, + 226,242,229,119,128, 5,153,241,245,225,242,101,128, 51,169,244, + 225,104,134, 5,183,147,113,147,127,147,132,147,141,147,156,147, + 172, 49, 2,147,119,147,123, 49,128, 5,183,100,128, 5,183,178, + 97,128, 5,183,232,229,226,242,229,119,128, 5,183,238,225,242, + 242,239,247,232,229,226,242,229,119,128, 5,183,241,245,225,242, + 244,229,242,232,229,226,242,229,119,128, 5,183,247,233,228,229, + 232,229,226,242,229,119,128, 5,183,250,229,242,232,229,226,242, + 229,119,128, 5,161,226,239,240,239,237,239,230,111,128, 49, 6, + 227,233,242,227,236,101,128, 36,223,228,239,244,225,227,227,229, + 238,116,128, 30, 87,101,137, 5,228,147,251,148, 6,148, 26,148, + 38,148, 58,148,160,148,171,148,192,149,147,227,249,242,233,236, + 236,233, 99,128, 4, 63,228,225,231,229,243,104,129,251, 68,148, + 17,232,229,226,242,229,119,128,251, 68,229,250,233,243,241,245, + 225,242,101,128, 51, 59,230,233,238,225,236,228,225,231,229,243, + 232,232,229,226,242,229,119,128,251, 67,104, 5,148, 70,148, 93, + 148,101,148,115,148,145,225,114, 2,148, 77,148, 84,225,226,233, + 99,128, 6,126,237,229,238,233,225,110,128, 5,122,229,226,242, + 229,119,128, 5,228,230,233,238,225,236,225,242,225,226,233, 99, + 128,251, 87,105, 2,148,121,148,136,238,233,244,233,225,236,225, + 242,225,226,233, 99,128,251, 88,242,225,231,225,238, 97,128, 48, + 122,237,229,228,233,225,236,225,242,225,226,233, 99,128,251, 89, + 235,225,244,225,235,225,238, 97,128, 48,218,237,233,228,228,236, + 229,232,239,239,235,227,249,242,233,236,236,233, 99,128, 4,167, + 114, 5,148,204,148,216,149, 2,149,123,149,136,225,230,229,232, + 229,226,242,229,119,128,251, 78,227,229,238,116,131, 0, 37,148, + 229,148,238,148,250,225,242,225,226,233, 99,128, 6,106,237,239, + 238,239,243,240,225,227,101,128,255, 5,243,237,225,236,108,128, + 254,106,105, 2,149, 8,149,105,239,100,134, 0, 46,149, 25,149, + 36,149, 47,149, 59,149, 70,149, 82,225,242,237,229,238,233,225, + 110,128, 5,137,227,229,238,244,229,242,229,100,128, 0,183,232, + 225,236,230,247,233,228,244,104,128,255, 97,233,238,230,229,242, + 233,239,114,128,246,231,237,239,238,239,243,240,225,227,101,128, + 255, 14,115, 2,149, 88,149, 95,237,225,236,108,128,254, 82,245, + 240,229,242,233,239,114,128,246,232,243,240,239,237,229,238,233, + 231,242,229,229,235,227,237, 98,128, 3, 66,240,229,238,228,233, + 227,245,236,225,114,128, 34,165,244,232,239,245,243,225,238,100, + 128, 32, 48,243,229,244, 97,128, 32,167,230,243,241,245,225,242, + 101,128, 51,138,104, 3,149,172,149,222,150,103, 97, 3,149,180, + 149,190,149,197,226,229,238,231,225,236,105,128, 9,171,228,229, + 246, 97,128, 9, 43,231,117, 2,149,204,149,213,234,225,242,225, + 244,105,128, 10,171,242,237,245,235,232,105,128, 10, 43,105,133, + 3,198,149,236,149,240,150, 70,150, 78,150, 89, 49,128, 3,213, + 229,245,240,104, 4,149,253,150, 32,150, 47,150, 56, 97, 2,150, + 3,150, 18,227,233,242,227,236,229,235,239,242,229,225,110,128, + 50,122,240,225,242,229,238,235,239,242,229,225,110,128, 50, 26, + 227,233,242,227,236,229,235,239,242,229,225,110,128, 50,108,235, + 239,242,229,225,110,128, 49, 77,240,225,242,229,238,235,239,242, + 229,225,110,128, 50, 12,236,225,244,233,110,128, 2,120,238,244, + 232,245,244,232,225,105,128, 14, 58,243,249,237,226,239,236,231, + 242,229,229,107,128, 3,213,111, 3,150,111,150,116,150,142,239, + 107,128, 1,165,240,104, 2,150,123,150,132,225,238,244,232,225, + 105,128, 14, 30,245,238,231,244,232,225,105,128, 14, 28,243,225, + 237,240,232,225,239,244,232,225,105,128, 14, 32,105,133, 3,192, + 150,170,151,126,151,137,151,148,151,162,229,245,112, 6,150,186, + 150,221,150,253,151, 25,151, 39,151, 91, 97, 2,150,192,150,207, + 227,233,242,227,236,229,235,239,242,229,225,110,128, 50,115,240, + 225,242,229,238,235,239,242,229,225,110,128, 50, 19,227,105, 2, + 150,228,150,240,229,245,227,235,239,242,229,225,110,128, 49,118, + 242,227,236,229,235,239,242,229,225,110,128, 50,101,107, 2,151, + 3,151, 17,233,249,229,239,235,235,239,242,229,225,110,128, 49, + 114,239,242,229,225,110,128, 49, 66,240,225,242,229,238,235,239, + 242,229,225,110,128, 50, 5,243,233,239,115, 2,151, 48,151, 76, + 107, 2,151, 54,151, 68,233,249,229,239,235,235,239,242,229,225, + 110,128, 49,116,239,242,229,225,110,128, 49, 68,244,233,235,229, + 245,244,235,239,242,229,225,110,128, 49,117,116, 2,151, 97,151, + 112,232,233,229,245,244,232,235,239,242,229,225,110,128, 49,119, + 233,235,229,245,244,235,239,242,229,225,110,128, 49,115,232,233, + 242,225,231,225,238, 97,128, 48,116,235,225,244,225,235,225,238, + 97,128, 48,212,243,249,237,226,239,236,231,242,229,229,107,128, + 3,214,247,242,225,242,237,229,238,233,225,110,128, 5,131,236, + 245,115,132, 0, 43,151,189,151,200,151,209,151,242,226,229,236, + 239,247,227,237, 98,128, 3, 31,227,233,242,227,236,101,128, 34, + 149,109, 2,151,215,151,222,233,238,245,115,128, 0,177,111, 2, + 151,228,151,232,100,128, 2,214,238,239,243,240,225,227,101,128, + 255, 11,115, 2,151,248,151,255,237,225,236,108,128,254, 98,245, + 240,229,242,233,239,114,128, 32,122,109, 2,152, 15,152, 26,239, + 238,239,243,240,225,227,101,128,255, 80,243,241,245,225,242,101, + 128, 51,216,111, 5,152, 47,152, 58,152,125,152,136,152,146,232, + 233,242,225,231,225,238, 97,128, 48,125,233,238,244,233,238,231, + 233,238,228,229,120, 4,152, 78,152, 90,152,102,152,115,228,239, + 247,238,247,232,233,244,101,128, 38, 31,236,229,230,244,247,232, + 233,244,101,128, 38, 28,242,233,231,232,244,247,232,233,244,101, + 128, 38, 30,245,240,247,232,233,244,101,128, 38, 29,235,225,244, + 225,235,225,238, 97,128, 48,221,240,236,225,244,232,225,105,128, + 14, 27,243,244,225,236,237,225,242,107,129, 48, 18,152,159,230, + 225,227,101,128, 48, 32,240,225,242,229,110,128, 36,171,114, 3, + 152,182,152,208,152,233,101, 2,152,188,152,196,227,229,228,229, + 115,128, 34,122,243,227,242,233,240,244,233,239,110,128, 33, 30, + 233,237,101, 2,152,216,152,222,237,239,100,128, 2,185,242,229, + 246,229,242,243,229,100,128, 32, 53,111, 4,152,243,152,250,153, + 4,153, 17,228,245,227,116,128, 34, 15,234,229,227,244,233,246, + 101,128, 35, 5,236,239,238,231,229,228,235,225,238, 97,128, 48, + 252,112, 2,153, 23,153, 60,101, 2,153, 29,153, 36,236,236,239, + 114,128, 35, 24,242,243,117, 2,153, 44,153, 51,226,243,229,116, + 128, 34,130,240,229,242,243,229,116,128, 34,131,239,242,244,233, + 239,110,129, 34, 55,153, 71,225,108,128, 34, 29,115, 2,153, 82, + 153,125,105,130, 3,200,153, 90,153,101,227,249,242,233,236,236, + 233, 99,128, 4,113,236,233,240,238,229,245,237,225,244,225,227, + 249,242,233,236,236,233,227,227,237, 98,128, 4,134,243,241,245, + 225,242,101,128, 51,176,117, 2,153,140,153,151,232,233,242,225, + 231,225,238, 97,128, 48,119,235,225,244,225,235,225,238, 97,128, + 48,215,246,243,241,245,225,242,101,128, 51,180,247,243,241,245, + 225,242,101,128, 51,186,113,136, 0,113,153,202,154,251,155, 6, + 155, 15,155, 22,155, 34,155, 72,155, 80, 97, 4,153,212,153,235, + 154, 43,154,234,100, 2,153,218,153,224,229,246, 97,128, 9, 88, + 237,225,232,229,226,242,229,119,128, 5,168,102, 4,153,245,153, + 254,154, 12,154, 28,225,242,225,226,233, 99,128, 6, 66,230,233, + 238,225,236,225,242,225,226,233, 99,128,254,214,233,238,233,244, + 233,225,236,225,242,225,226,233, 99,128,254,215,237,229,228,233, + 225,236,225,242,225,226,233, 99,128,254,216,237,225,244,115,136, + 5,184,154, 66,154, 86,154,100,154,105,154,110,154,119,154,134, + 154,221, 49, 3,154, 74,154, 78,154, 82, 48,128, 5,184, 97,128, + 5,184, 99,128, 5,184, 50, 2,154, 92,154, 96, 55,128, 5,184, + 57,128, 5,184,179, 51,128, 5,184,228,101,128, 5,184,232,229, + 226,242,229,119,128, 5,184,238,225,242,242,239,247,232,229,226, + 242,229,119,128, 5,184,113, 2,154,140,154,206,225,244,225,110, + 4,154,153,154,162,154,177,154,193,232,229,226,242,229,119,128, + 5,184,238,225,242,242,239,247,232,229,226,242,229,119,128, 5, + 184,241,245,225,242,244,229,242,232,229,226,242,229,119,128, 5, + 184,247,233,228,229,232,229,226,242,229,119,128, 5,184,245,225, + 242,244,229,242,232,229,226,242,229,119,128, 5,184,247,233,228, + 229,232,229,226,242,229,119,128, 5,184,242,238,229,249,240,225, + 242,225,232,229,226,242,229,119,128, 5,159,226,239,240,239,237, + 239,230,111,128, 49, 17,227,233,242,227,236,101,128, 36,224,232, + 239,239,107,128, 2,160,237,239,238,239,243,240,225,227,101,128, + 255, 81,239,102,130, 5,231,155, 43,155, 63,228,225,231,229,243, + 104,129,251, 71,155, 54,232,229,226,242,229,119,128,251, 71,232, + 229,226,242,229,119,128, 5,231,240,225,242,229,110,128, 36,172, + 117, 4,155, 90,155,102,155,191,156, 22,225,242,244,229,242,238, + 239,244,101,128, 38,105,226,245,244,115,135, 5,187,155,123,155, + 128,155,133,155,138,155,147,155,162,155,178,177, 56,128, 5,187, + 178, 53,128, 5,187,179, 49,128, 5,187,232,229,226,242,229,119, + 128, 5,187,238,225,242,242,239,247,232,229,226,242,229,119,128, + 5,187,241,245,225,242,244,229,242,232,229,226,242,229,119,128, + 5,187,247,233,228,229,232,229,226,242,229,119,128, 5,187,229, + 243,244,233,239,110,133, 0, 63,155,210,155,233,155,250,156, 2, + 156, 14,225,114, 2,155,217,155,224,225,226,233, 99,128, 6, 31, + 237,229,238,233,225,110,128, 5, 94,228,239,247,110,129, 0,191, + 155,242,243,237,225,236,108,128,247,191,231,242,229,229,107,128, + 3,126,237,239,238,239,243,240,225,227,101,128,255, 31,243,237, + 225,236,108,128,247, 63,239,244,101, 4,156, 34,156,105,156,125, + 156,154,228,226,108,133, 0, 34,156, 50,156, 57,156, 64,156, 76, + 156, 97,226,225,243,101,128, 32, 30,236,229,230,116,128, 32, 28, + 237,239,238,239,243,240,225,227,101,128,255, 2,240,242,233,237, + 101,129, 48, 30,156, 86,242,229,246,229,242,243,229,100,128, 48, + 29,242,233,231,232,116,128, 32, 29,236,229,230,116,129, 32, 24, + 156,114,242,229,246,229,242,243,229,100,128, 32, 27,114, 2,156, + 131,156,141,229,246,229,242,243,229,100,128, 32, 27,233,231,232, + 116,129, 32, 25,156,150,110,128, 1, 73,243,233,238,231,108, 2, + 156,164,156,171,226,225,243,101,128, 32, 26,101,129, 0, 39,156, + 177,237,239,238,239,243,240,225,227,101,128,255, 7,114,145, 0, + 114,156,227,157,231,157,242,158, 33,158, 84,159,101,159,125,159, + 220,161,254,162, 35,162, 47,162,101,162,109,163, 15,163, 26,163, + 61,163,161, 97, 11,156,251,157, 6,157, 16,157, 23,157, 88,157, + 104,157,129,157,140,157,165,157,188,157,225,225,242,237,229,238, + 233,225,110,128, 5,124,226,229,238,231,225,236,105,128, 9,176, + 227,245,244,101,128, 1, 85,100, 4,157, 33,157, 39,157, 53,157, + 79,229,246, 97,128, 9, 48,233,227,225,108,129, 34, 26,157, 48, + 229,120,128,248,229,239,246,229,242,243,243,241,245,225,242,101, + 129, 51,174,157, 69,228,243,241,245,225,242,101,128, 51,175,243, + 241,245,225,242,101,128, 51,173,230,101,129, 5,191,157, 95,232, + 229,226,242,229,119,128, 5,191,231,117, 2,157,111,157,120,234, + 225,242,225,244,105,128, 10,176,242,237,245,235,232,105,128, 10, + 48,232,233,242,225,231,225,238, 97,128, 48,137,235,225,244,225, + 235,225,238, 97,129, 48,233,157,153,232,225,236,230,247,233,228, + 244,104,128,255,151,236,239,247,229,242,228,233,225,231,239,238, + 225,236,226,229,238,231,225,236,105,128, 9,241,109, 2,157,194, + 157,217,233,228,228,236,229,228,233,225,231,239,238,225,236,226, + 229,238,231,225,236,105,128, 9,240,243,232,239,242,110,128, 2, + 100,244,233,111,128, 34, 54,226,239,240,239,237,239,230,111,128, + 49, 22, 99, 4,157,252,158, 3,158, 12,158, 20,225,242,239,110, + 128, 1, 89,229,228,233,236,236, 97,128, 1, 87,233,242,227,236, + 101,128, 36,225,239,237,237,225,225,227,227,229,238,116,128, 1, + 87,100, 2,158, 39,158, 49,226,236,231,242,225,246,101,128, 2, + 17,239,116, 2,158, 56,158, 65,225,227,227,229,238,116,128, 30, + 89,226,229,236,239,119,129, 30, 91,158, 75,237,225,227,242,239, + 110,128, 30, 93,101, 6,158, 98,158,143,158,178,158,233,159, 2, + 159, 35,102, 2,158,104,158,117,229,242,229,238,227,229,237,225, + 242,107,128, 32, 59,236,229,248,243,117, 2,158,127,158,134,226, + 243,229,116,128, 34,134,240,229,242,243,229,116,128, 34,135,231, + 233,243,244,229,114, 2,158,154,158,159,229,100,128, 0,174,115, + 2,158,165,158,171,225,238,115,128,248,232,229,242,233,102,128, + 246,218,104, 3,158,186,158,209,158,223,225,114, 2,158,193,158, + 200,225,226,233, 99,128, 6, 49,237,229,238,233,225,110,128, 5, + 128,230,233,238,225,236,225,242,225,226,233, 99,128,254,174,233, + 242,225,231,225,238, 97,128, 48,140,235,225,244,225,235,225,238, + 97,129, 48,236,158,246,232,225,236,230,247,233,228,244,104,128, + 255,154,243,104,130, 5,232,159, 11,159, 26,228,225,231,229,243, + 232,232,229,226,242,229,119,128,251, 72,232,229,226,242,229,119, + 128, 5,232,118, 3,159, 43,159, 56,159, 88,229,242,243,229,228, + 244,233,236,228,101,128, 34, 61,233, 97, 2,159, 63,159, 72,232, + 229,226,242,229,119,128, 5,151,237,245,231,242,225,243,232,232, + 229,226,242,229,119,128, 5,151,236,239,231,233,227,225,236,238, + 239,116,128, 35, 16,230,233,243,232,232,239,239,107,129, 2,126, + 159,114,242,229,246,229,242,243,229,100,128, 2,127,104, 2,159, + 131,159,154, 97, 2,159,137,159,147,226,229,238,231,225,236,105, + 128, 9,221,228,229,246, 97,128, 9, 93,111,131, 3,193,159,164, + 159,193,159,207,239,107,129, 2,125,159,171,244,245,242,238,229, + 100,129, 2,123,159,182,243,245,240,229,242,233,239,114,128, 2, + 181,243,249,237,226,239,236,231,242,229,229,107,128, 3,241,244, + 233,227,232,239,239,235,237,239,100,128, 2,222,105, 6,159,234, + 161, 22,161, 68,161, 79,161,104,161,240,229,245,108, 9,160, 0, + 160, 35,160, 50,160, 64,160,110,160,124,160,210,160,223,161, 2, + 97, 2,160, 6,160, 21,227,233,242,227,236,229,235,239,242,229, + 225,110,128, 50,113,240,225,242,229,238,235,239,242,229,225,110, + 128, 50, 17,227,233,242,227,236,229,235,239,242,229,225,110,128, + 50, 99,232,233,229,245,232,235,239,242,229,225,110,128, 49, 64, + 107, 2,160, 70,160,102,233,249,229,239,107, 2,160, 80,160, 89, + 235,239,242,229,225,110,128, 49, 58,243,233,239,243,235,239,242, + 229,225,110,128, 49,105,239,242,229,225,110,128, 49, 57,237,233, + 229,245,237,235,239,242,229,225,110,128, 49, 59,112, 3,160,132, + 160,164,160,179, 97, 2,160,138,160,152,238,243,233,239,243,235, + 239,242,229,225,110,128, 49,108,242,229,238,235,239,242,229,225, + 110,128, 50, 3,232,233,229,245,240,232,235,239,242,229,225,110, + 128, 49, 63,233,229,245,112, 2,160,188,160,197,235,239,242,229, + 225,110,128, 49, 60,243,233,239,243,235,239,242,229,225,110,128, + 49,107,243,233,239,243,235,239,242,229,225,110,128, 49, 61,116, + 2,160,229,160,244,232,233,229,245,244,232,235,239,242,229,225, + 110,128, 49, 62,233,235,229,245,244,235,239,242,229,225,110,128, + 49,106,249,229,239,242,233,238,232,233,229,245,232,235,239,242, + 229,225,110,128, 49,109,231,232,116, 2,161, 30,161, 38,225,238, + 231,236,101,128, 34, 31,116, 2,161, 44,161, 58,225,227,235,226, + 229,236,239,247,227,237, 98,128, 3, 25,242,233,225,238,231,236, + 101,128, 34,191,232,233,242,225,231,225,238, 97,128, 48,138,235, + 225,244,225,235,225,238, 97,129, 48,234,161, 92,232,225,236,230, + 247,233,228,244,104,128,255,152,110, 2,161,110,161,226,103,131, + 2,218,161,120,161,131,161,137,226,229,236,239,247,227,237, 98, + 128, 3, 37,227,237, 98,128, 3, 10,232,225,236,102, 2,161,146, + 161,192,236,229,230,116,131, 2,191,161,159,161,170,161,181,225, + 242,237,229,238,233,225,110,128, 5, 89,226,229,236,239,247,227, + 237, 98,128, 3, 28,227,229,238,244,229,242,229,100,128, 2,211, + 242,233,231,232,116,130, 2,190,161,204,161,215,226,229,236,239, + 247,227,237, 98,128, 3, 57,227,229,238,244,229,242,229,100,128, + 2,210,246,229,242,244,229,228,226,242,229,246,101,128, 2, 19, + 244,244,239,242,245,243,241,245,225,242,101,128, 51, 81,108, 2, + 162, 4,162, 15,233,238,229,226,229,236,239,119,128, 30, 95,239, + 238,231,236,229,103,129, 2,124,162, 26,244,245,242,238,229,100, + 128, 2,122,237,239,238,239,243,240,225,227,101,128,255, 82,111, + 3,162, 55,162, 66,162, 91,232,233,242,225,231,225,238, 97,128, + 48,141,235,225,244,225,235,225,238, 97,129, 48,237,162, 79,232, + 225,236,230,247,233,228,244,104,128,255,155,242,245,225,244,232, + 225,105,128, 14, 35,240,225,242,229,110,128, 36,173,114, 3,162, + 117,162,153,162,183, 97, 3,162,125,162,135,162,142,226,229,238, + 231,225,236,105,128, 9,220,228,229,246, 97,128, 9, 49,231,245, + 242,237,245,235,232,105,128, 10, 92,229,104, 2,162,160,162,169, + 225,242,225,226,233, 99,128, 6,145,230,233,238,225,236,225,242, + 225,226,233, 99,128,251,141,246,239,227,225,236,233, 99, 4,162, + 199,162,209,162,216,162,227,226,229,238,231,225,236,105,128, 9, + 224,228,229,246, 97,128, 9, 96,231,245,234,225,242,225,244,105, + 128, 10,224,246,239,247,229,236,243,233,231,110, 3,162,243,162, + 253,163, 4,226,229,238,231,225,236,105,128, 9,196,228,229,246, + 97,128, 9, 68,231,245,234,225,242,225,244,105,128, 10,196,243, + 245,240,229,242,233,239,114,128,246,241,116, 2,163, 32,163, 40, + 226,236,239,227,107,128, 37,144,245,242,238,229,100,129, 2,121, + 163, 50,243,245,240,229,242,233,239,114,128, 2,180,117, 4,163, + 71,163, 82,163,107,163,154,232,233,242,225,231,225,238, 97,128, + 48,139,235,225,244,225,235,225,238, 97,129, 48,235,163, 95,232, + 225,236,230,247,233,228,244,104,128,255,153,112, 2,163,113,163, + 148,229,101, 2,163,120,163,134,237,225,242,235,226,229,238,231, + 225,236,105,128, 9,242,243,233,231,238,226,229,238,231,225,236, + 105,128, 9,243,233,225,104,128,246,221,244,232,225,105,128, 14, + 36,246,239,227,225,236,233, 99, 4,163,177,163,187,163,194,163, + 205,226,229,238,231,225,236,105,128, 9,139,228,229,246, 97,128, + 9, 11,231,245,234,225,242,225,244,105,128, 10,139,246,239,247, + 229,236,243,233,231,110, 3,163,221,163,231,163,238,226,229,238, + 231,225,236,105,128, 9,195,228,229,246, 97,128, 9, 67,231,245, + 234,225,242,225,244,105,128, 10,195,115,147, 0,115,164, 35,166, + 5,166, 16,166,142,166,181,169,123,169,134,172, 21,174,159,174, + 205,174,232,175,167,175,234,177, 11,177, 21,177,207,178, 24,178, + 194,178,204, 97, 9,164, 55,164, 65,164, 86,164,158,164,183,164, + 194,164,219,164,251,165, 35,226,229,238,231,225,236,105,128, 9, + 184,227,245,244,101,129, 1, 91,164, 74,228,239,244,225,227,227, + 229,238,116,128, 30,101,100, 5,164, 98,164,107,164,113,164,127, + 164,143,225,242,225,226,233, 99,128, 6, 53,229,246, 97,128, 9, + 56,230,233,238,225,236,225,242,225,226,233, 99,128,254,186,233, + 238,233,244,233,225,236,225,242,225,226,233, 99,128,254,187,237, + 229,228,233,225,236,225,242,225,226,233, 99,128,254,188,231,117, + 2,164,165,164,174,234,225,242,225,244,105,128, 10,184,242,237, + 245,235,232,105,128, 10, 56,232,233,242,225,231,225,238, 97,128, + 48, 85,235,225,244,225,235,225,238, 97,129, 48,181,164,207,232, + 225,236,230,247,233,228,244,104,128,255,123,236,236,225,236,236, + 225,232,239,245,225,236,225,249,232,229,247,225,243,225,236,236, + 225,237,225,242,225,226,233, 99,128,253,250,237,229,235,104,130, + 5,225,165, 6,165, 26,228,225,231,229,243,104,129,251, 65,165, + 17,232,229,226,242,229,119,128,251, 65,232,229,226,242,229,119, + 128, 5,225,242, 97, 5,165, 48,165,122,165,130,165,180,165,188, + 97, 5,165, 60,165, 68,165, 76,165,107,165,115,225,244,232,225, + 105,128, 14, 50,229,244,232,225,105,128, 14, 65,233,237,225,233, + 109, 2,165, 86,165, 97,225,236,225,233,244,232,225,105,128, 14, + 68,245,225,238,244,232,225,105,128, 14, 67,237,244,232,225,105, + 128, 14, 51,244,232,225,105,128, 14, 48,229,244,232,225,105,128, + 14, 64,105, 3,165,138,165,162,165,173,105, 2,165,144,165,155, + 236,229,230,244,244,232,225,105,128,248,134,244,232,225,105,128, + 14, 53,236,229,230,244,244,232,225,105,128,248,133,244,232,225, + 105,128, 14, 52,239,244,232,225,105,128, 14, 66,117, 3,165,196, + 165,246,165,253,101, 3,165,204,165,228,165,239,101, 2,165,210, + 165,221,236,229,230,244,244,232,225,105,128,248,136,244,232,225, + 105,128, 14, 55,236,229,230,244,244,232,225,105,128,248,135,244, + 232,225,105,128, 14, 54,244,232,225,105,128, 14, 56,245,244,232, + 225,105,128, 14, 57,226,239,240,239,237,239,230,111,128, 49, 25, + 99, 5,166, 28,166, 49,166, 58,166,107,166,129,225,242,239,110, + 129, 1, 97,166, 37,228,239,244,225,227,227,229,238,116,128, 30, + 103,229,228,233,236,236, 97,128, 1, 95,232,247, 97,131, 2, 89, + 166, 70,166, 81,166,100,227,249,242,233,236,236,233, 99,128, 4, + 217,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, + 99,128, 4,219,232,239,239,107,128, 2, 90,233,242, 99, 2,166, + 115,166,120,236,101,128, 36,226,245,237,230,236,229,120,128, 1, + 93,239,237,237,225,225,227,227,229,238,116,128, 2, 25,228,239, + 116, 2,166,150,166,159,225,227,227,229,238,116,128, 30, 97,226, + 229,236,239,119,129, 30, 99,166,169,228,239,244,225,227,227,229, + 238,116,128, 30,105,101, 9,166,201,166,217,166,252,167, 61,167, + 164,167,191,167,216,168, 41,168, 68,225,231,245,236,236,226,229, + 236,239,247,227,237, 98,128, 3, 60, 99, 2,166,223,166,245,239, + 238,100,129, 32, 51,166,231,244,239,238,229,227,232,233,238,229, + 243,101,128, 2,202,244,233,239,110,128, 0,167,229,110, 4,167, + 7,167, 16,167, 30,167, 46,225,242,225,226,233, 99,128, 6, 51, + 230,233,238,225,236,225,242,225,226,233, 99,128,254,178,233,238, + 233,244,233,225,236,225,242,225,226,233, 99,128,254,179,237,229, + 228,233,225,236,225,242,225,226,233, 99,128,254,180,231,239,108, + 135, 5,182,167, 81,167, 95,167,100,167,109,167,124,167,140,167, + 151, 49, 2,167, 87,167, 91, 51,128, 5,182,102,128, 5,182,178, + 99,128, 5,182,232,229,226,242,229,119,128, 5,182,238,225,242, + 242,239,247,232,229,226,242,229,119,128, 5,182,241,245,225,242, + 244,229,242,232,229,226,242,229,119,128, 5,182,244,225,232,229, + 226,242,229,119,128, 5,146,247,233,228,229,232,229,226,242,229, + 119,128, 5,182,104, 2,167,170,167,181,225,242,237,229,238,233, + 225,110,128, 5,125,233,242,225,231,225,238, 97,128, 48, 91,235, + 225,244,225,235,225,238, 97,129, 48,187,167,204,232,225,236,230, + 247,233,228,244,104,128,255,126,237,105, 2,167,223,168, 10,227, + 239,236,239,110,131, 0, 59,167,237,167,246,168, 2,225,242,225, + 226,233, 99,128, 6, 27,237,239,238,239,243,240,225,227,101,128, + 255, 27,243,237,225,236,108,128,254, 84,246,239,233,227,229,228, + 237,225,242,235,235,225,238, 97,129, 48,156,168, 29,232,225,236, + 230,247,233,228,244,104,128,255,159,238,116, 2,168, 48,168, 58, + 233,243,241,245,225,242,101,128, 51, 34,239,243,241,245,225,242, + 101,128, 51, 35,246,229,110,142, 0, 55,168,102,168,111,168,121, + 168,151,168,158,168,168,168,193,168,220,168,254,169, 10,169, 21, + 169, 54,169, 62,169, 73,225,242,225,226,233, 99,128, 6,103,226, + 229,238,231,225,236,105,128, 9,237,227,233,242,227,236,101,129, + 36,102,168,132,233,238,246,229,242,243,229,243,225,238,243,243, + 229,242,233,102,128, 39,144,228,229,246, 97,128, 9,109,229,233, + 231,232,244,232,115,128, 33, 94,231,117, 2,168,175,168,184,234, + 225,242,225,244,105,128, 10,237,242,237,245,235,232,105,128, 10, + 109,232, 97, 2,168,200,168,211,227,235,225,242,225,226,233, 99, + 128, 6,103,238,231,250,232,239,117,128, 48, 39,105, 2,168,226, + 168,244,228,229,239,231,242,225,240,232,233,227,240,225,242,229, + 110,128, 50, 38,238,230,229,242,233,239,114,128, 32,135,237,239, + 238,239,243,240,225,227,101,128,255, 23,239,236,228,243,244,249, + 236,101,128,247, 55,112, 2,169, 27,169, 34,225,242,229,110,128, + 36,122,229,114, 2,169, 41,169, 47,233,239,100,128, 36,142,243, + 233,225,110,128, 6,247,242,239,237,225,110,128, 33,118,243,245, + 240,229,242,233,239,114,128, 32,119,116, 2,169, 79,169,117,229, + 229,110, 2,169, 87,169, 96,227,233,242,227,236,101,128, 36,112, + 112, 2,169,102,169,109,225,242,229,110,128, 36,132,229,242,233, + 239,100,128, 36,152,232,225,105,128, 14, 87,230,244,232,249,240, + 232,229,110,128, 0,173,104, 7,169,150,170,124,170,135,170,149, + 171, 94,171,107,172, 15, 97, 6,169,164,169,175,169,185,169,196, + 170, 83,170,108,225,242,237,229,238,233,225,110,128, 5,119,226, + 229,238,231,225,236,105,128, 9,182,227,249,242,233,236,236,233, + 99,128, 4, 72,100, 2,169,202,170, 42,228, 97, 4,169,213,169, + 222,169,253,170, 11,225,242,225,226,233, 99,128, 6, 81,228,225, + 237,237, 97, 2,169,232,169,241,225,242,225,226,233, 99,128,252, + 97,244,225,238,225,242,225,226,233, 99,128,252, 94,230,225,244, + 232,225,225,242,225,226,233, 99,128,252, 96,235,225,243,242, 97, + 2,170, 21,170, 30,225,242,225,226,233, 99,128,252, 98,244,225, + 238,225,242,225,226,233, 99,128,252, 95,101,132, 37,146,170, 54, + 170, 61,170, 69,170, 78,228,225,242,107,128, 37,147,236,233,231, + 232,116,128, 37,145,237,229,228,233,245,109,128, 37,146,246, 97, + 128, 9, 54,231,117, 2,170, 90,170, 99,234,225,242,225,244,105, + 128, 10,182,242,237,245,235,232,105,128, 10, 54,236,243,232,229, + 236,229,244,232,229,226,242,229,119,128, 5,147,226,239,240,239, + 237,239,230,111,128, 49, 21,227,232,225,227,249,242,233,236,236, + 233, 99,128, 4, 73,101, 4,170,159,170,224,170,234,170,251,229, + 110, 4,170,170,170,179,170,193,170,209,225,242,225,226,233, 99, + 128, 6, 52,230,233,238,225,236,225,242,225,226,233, 99,128,254, + 182,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,254, + 183,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,184, + 233,227,239,240,244,233, 99,128, 3,227,241,229,108,129, 32,170, + 170,242,232,229,226,242,229,119,128, 32,170,246, 97,134, 5,176, + 171, 12,171, 27,171, 41,171, 50,171, 65,171, 81, 49, 2,171, 18, + 171, 23,177, 53,128, 5,176, 53,128, 5,176, 50, 2,171, 33,171, + 37, 50,128, 5,176,101,128, 5,176,232,229,226,242,229,119,128, + 5,176,238,225,242,242,239,247,232,229,226,242,229,119,128, 5, + 176,241,245,225,242,244,229,242,232,229,226,242,229,119,128, 5, + 176,247,233,228,229,232,229,226,242,229,119,128, 5,176,232,225, + 227,249,242,233,236,236,233, 99,128, 4,187,105, 2,171,113,171, + 124,237,225,227,239,240,244,233, 99,128, 3,237,110,131, 5,233, + 171,134,171,217,171,226,100, 2,171,140,171,206,225,231,229,243, + 104,130,251, 73,171,152,171,161,232,229,226,242,229,119,128,251, + 73,115, 2,171,167,171,187,232,233,238,228,239,116,129,251, 44, + 171,178,232,229,226,242,229,119,128,251, 44,233,238,228,239,116, + 129,251, 45,171,197,232,229,226,242,229,119,128,251, 45,239,244, + 232,229,226,242,229,119,128, 5,193,232,229,226,242,229,119,128, + 5,233,115, 2,171,232,171,252,232,233,238,228,239,116,129,251, + 42,171,243,232,229,226,242,229,119,128,251, 42,233,238,228,239, + 116,129,251, 43,172, 6,232,229,226,242,229,119,128,251, 43,239, + 239,107,128, 2,130,105, 8,172, 39,172, 83,172, 94,172,119,172, + 149,172,157,172,170,173, 85,231,237, 97,131, 3,195,172, 51,172, + 55,172, 63, 49,128, 3,194,230,233,238,225,108,128, 3,194,236, + 245,238,225,244,229,243,249,237,226,239,236,231,242,229,229,107, + 128, 3,242,232,233,242,225,231,225,238, 97,128, 48, 87,235,225, + 244,225,235,225,238, 97,129, 48,183,172,107,232,225,236,230,247, + 233,228,244,104,128,255,124,236,245,113, 2,172,127,172,136,232, + 229,226,242,229,119,128, 5,189,236,229,230,244,232,229,226,242, + 229,119,128, 5,189,237,233,236,225,114,128, 34, 60,238,228,239, + 244,232,229,226,242,229,119,128, 5,194,239,115, 6,172,185,172, + 220,172,252,173, 24,173, 38,173, 70, 97, 2,172,191,172,206,227, + 233,242,227,236,229,235,239,242,229,225,110,128, 50,116,240,225, + 242,229,238,235,239,242,229,225,110,128, 50, 20,227,105, 2,172, + 227,172,239,229,245,227,235,239,242,229,225,110,128, 49,126,242, + 227,236,229,235,239,242,229,225,110,128, 50,102,107, 2,173, 2, + 173, 16,233,249,229,239,235,235,239,242,229,225,110,128, 49,122, + 239,242,229,225,110,128, 49, 69,238,233,229,245,238,235,239,242, + 229,225,110,128, 49,123,112, 2,173, 44,173, 57,225,242,229,238, + 235,239,242,229,225,110,128, 50, 6,233,229,245,240,235,239,242, + 229,225,110,128, 49,125,244,233,235,229,245,244,235,239,242,229, + 225,110,128, 49,124,120,141, 0, 54,173,115,173,124,173,134,173, + 164,173,171,173,196,173,223,174, 1,174, 13,174, 24,174, 57,174, + 65,174, 76,225,242,225,226,233, 99,128, 6,102,226,229,238,231, + 225,236,105,128, 9,236,227,233,242,227,236,101,129, 36,101,173, + 145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233, + 102,128, 39,143,228,229,246, 97,128, 9,108,231,117, 2,173,178, + 173,187,234,225,242,225,244,105,128, 10,236,242,237,245,235,232, + 105,128, 10,108,232, 97, 2,173,203,173,214,227,235,225,242,225, + 226,233, 99,128, 6,102,238,231,250,232,239,117,128, 48, 38,105, + 2,173,229,173,247,228,229,239,231,242,225,240,232,233,227,240, + 225,242,229,110,128, 50, 37,238,230,229,242,233,239,114,128, 32, + 134,237,239,238,239,243,240,225,227,101,128,255, 22,239,236,228, + 243,244,249,236,101,128,247, 54,112, 2,174, 30,174, 37,225,242, + 229,110,128, 36,121,229,114, 2,174, 44,174, 50,233,239,100,128, + 36,141,243,233,225,110,128, 6,246,242,239,237,225,110,128, 33, + 117,243,245,240,229,242,233,239,114,128, 32,118,116, 2,174, 82, + 174,153,229,229,110, 2,174, 90,174,132, 99, 2,174, 96,174,104, + 233,242,227,236,101,128, 36,111,245,242,242,229,238,227,249,228, + 229,238,239,237,233,238,225,244,239,242,226,229,238,231,225,236, + 105,128, 9,249,112, 2,174,138,174,145,225,242,229,110,128, 36, + 131,229,242,233,239,100,128, 36,151,232,225,105,128, 14, 86,108, + 2,174,165,174,185,225,243,104,129, 0, 47,174,173,237,239,238, + 239,243,240,225,227,101,128,255, 15,239,238,103,129, 1,127,174, + 193,228,239,244,225,227,227,229,238,116,128, 30,155,109, 2,174, + 211,174,221,233,236,229,230,225,227,101,128, 38, 58,239,238,239, + 243,240,225,227,101,128,255, 83,111, 6,174,246,175, 40,175, 51, + 175, 76,175,121,175,132,102, 2,174,252,175, 10,240,225,243,245, + 241,232,229,226,242,229,119,128, 5,195,116, 2,175, 16,175, 25, + 232,249,240,232,229,110,128, 0,173,243,233,231,238,227,249,242, + 233,236,236,233, 99,128, 4, 76,232,233,242,225,231,225,238, 97, + 128, 48, 93,235,225,244,225,235,225,238, 97,129, 48,189,175, 64, + 232,225,236,230,247,233,228,244,104,128,255,127,236,233,228,245, + 115, 2,175, 86,175,103,236,239,238,231,239,246,229,242,236,225, + 249,227,237, 98,128, 3, 56,243,232,239,242,244,239,246,229,242, + 236,225,249,227,237, 98,128, 3, 55,242,245,243,233,244,232,225, + 105,128, 14, 41,115, 3,175,140,175,150,175,158,225,236,225,244, + 232,225,105,128, 14, 40,239,244,232,225,105,128, 14, 11,245,225, + 244,232,225,105,128, 14, 42,240, 97, 3,175,176,175,196,175,228, + 227,101,129, 0, 32,175,183,232,225,227,235,225,242,225,226,233, + 99,128, 0, 32,228,101,129, 38, 96,175,203,243,245,233,116, 2, + 175,212,175,220,226,236,225,227,107,128, 38, 96,247,232,233,244, + 101,128, 38,100,242,229,110,128, 36,174,241,245,225,242,101, 11, + 176, 6,176, 17,176, 31,176, 56,176, 73,176, 99,176,114,176,147, + 176,174,176,230,176,245,226,229,236,239,247,227,237, 98,128, 3, + 59, 99, 2,176, 23,176, 27, 99,128, 51,196,109,128, 51,157,228, + 233,225,231,239,238,225,236,227,242,239,243,243,232,225,244,227, + 232,230,233,236,108,128, 37,169,232,239,242,233,250,239,238,244, + 225,236,230,233,236,108,128, 37,164,107, 2,176, 79,176, 83,103, + 128, 51,143,109,129, 51,158,176, 89,227,225,240,233,244,225,108, + 128, 51,206,108, 2,176,105,176,109,110,128, 51,209,239,103,128, + 51,210,109, 4,176,124,176,128,176,133,176,137,103,128, 51,142, + 233,108,128, 51,213,109,128, 51,156,243,241,245,225,242,229,100, + 128, 51,161,239,242,244,232,239,231,239,238,225,236,227,242,239, + 243,243,232,225,244,227,232,230,233,236,108,128, 37,166,245,240, + 240,229,114, 2,176,184,176,207,236,229,230,244,244,239,236,239, + 247,229,242,242,233,231,232,244,230,233,236,108,128, 37,167,242, + 233,231,232,244,244,239,236,239,247,229,242,236,229,230,244,230, + 233,236,108,128, 37,168,246,229,242,244,233,227,225,236,230,233, + 236,108,128, 37,165,247,232,233,244,229,247,233,244,232,243,237, + 225,236,236,226,236,225,227,107,128, 37,163,242,243,241,245,225, + 242,101,128, 51,219,115, 2,177, 27,177,197, 97, 4,177, 37,177, + 47,177, 54,177, 65,226,229,238,231,225,236,105,128, 9,183,228, + 229,246, 97,128, 9, 55,231,245,234,225,242,225,244,105,128, 10, + 183,238,103, 8,177, 84,177, 98,177,112,177,126,177,141,177,155, + 177,169,177,182,227,233,229,245,227,235,239,242,229,225,110,128, + 49, 73,232,233,229,245,232,235,239,242,229,225,110,128, 49,133, + 233,229,245,238,231,235,239,242,229,225,110,128, 49,128,235,233, + 249,229,239,235,235,239,242,229,225,110,128, 49, 50,238,233,229, + 245,238,235,239,242,229,225,110,128, 49,101,240,233,229,245,240, + 235,239,242,229,225,110,128, 49, 67,243,233,239,243,235,239,242, + 229,225,110,128, 49, 70,244,233,235,229,245,244,235,239,242,229, + 225,110,128, 49, 56,245,240,229,242,233,239,114,128,246,242,116, + 2,177,213,177,236,229,242,236,233,238,103,129, 0,163,177,224, + 237,239,238,239,243,240,225,227,101,128,255,225,242,239,235,101, + 2,177,245,178, 6,236,239,238,231,239,246,229,242,236,225,249, + 227,237, 98,128, 3, 54,243,232,239,242,244,239,246,229,242,236, + 225,249,227,237, 98,128, 3, 53,117, 7,178, 40,178, 72,178, 94, + 178,105,178,146,178,156,178,160,226,243,229,116,130, 34,130,178, + 51,178, 62,238,239,244,229,241,245,225,108,128, 34,138,239,242, + 229,241,245,225,108,128, 34,134, 99, 2,178, 78,178, 86,227,229, + 229,228,115,128, 34,123,232,244,232,225,116,128, 34, 11,232,233, + 242,225,231,225,238, 97,128, 48, 89,107, 2,178,111,178,135,225, + 244,225,235,225,238, 97,129, 48,185,178,123,232,225,236,230,247, + 233,228,244,104,128,255,125,245,238,225,242,225,226,233, 99,128, + 6, 82,237,237,225,244,233,239,110,128, 34, 17,110,128, 38, 60, + 240,229,242,243,229,116,130, 34,131,178,173,178,184,238,239,244, + 229,241,245,225,108,128, 34,139,239,242,229,241,245,225,108,128, + 34,135,246,243,241,245,225,242,101,128, 51,220,249,239,245,247, + 225,229,242,225,243,241,245,225,242,101,128, 51,124,116,144, 0, + 116,179, 1,180, 10,180, 31,180,174,180,214,183, 6,186,144,187, + 219,187,231,187,243,189, 20,189, 45,189,131,190, 55,190,239,191, + 73, 97, 10,179, 23,179, 33,179, 54,179, 61,179, 86,179,164,179, + 181,179,206,179,220,179,224,226,229,238,231,225,236,105,128, 9, + 164,227,107, 2,179, 40,179, 47,228,239,247,110,128, 34,164,236, + 229,230,116,128, 34,163,228,229,246, 97,128, 9, 36,231,117, 2, + 179, 68,179, 77,234,225,242,225,244,105,128, 10,164,242,237,245, + 235,232,105,128, 10, 36,104, 4,179, 96,179,105,179,119,179,149, + 225,242,225,226,233, 99,128, 6, 55,230,233,238,225,236,225,242, + 225,226,233, 99,128,254,194,105, 2,179,125,179,140,238,233,244, + 233,225,236,225,242,225,226,233, 99,128,254,195,242,225,231,225, + 238, 97,128, 48, 95,237,229,228,233,225,236,225,242,225,226,233, + 99,128,254,196,233,243,249,239,245,229,242,225,243,241,245,225, + 242,101,128, 51,125,235,225,244,225,235,225,238, 97,129, 48,191, + 179,194,232,225,236,230,247,233,228,244,104,128,255,128,244,247, + 229,229,236,225,242,225,226,233, 99,128, 6, 64,117,128, 3,196, + 118,130, 5,234,179,232,180, 1,228,225,231,229,115,129,251, 74, + 179,242,104,129,251, 74,179,248,232,229,226,242,229,119,128,251, + 74,232,229,226,242,229,119,128, 5,234, 98, 2,180, 16,180, 21, + 225,114,128, 1,103,239,240,239,237,239,230,111,128, 49, 10, 99, + 6,180, 45,180, 52,180, 59,180, 68,180,134,180,161,225,242,239, + 110,128, 1,101,227,245,242,108,128, 2,168,229,228,233,236,236, + 97,128, 1, 99,232,229,104, 4,180, 80,180, 89,180,103,180,119, + 225,242,225,226,233, 99,128, 6,134,230,233,238,225,236,225,242, + 225,226,233, 99,128,251,123,233,238,233,244,233,225,236,225,242, + 225,226,233, 99,128,251,124,237,229,228,233,225,236,225,242,225, + 226,233, 99,128,251,125,233,242, 99, 2,180,142,180,147,236,101, + 128, 36,227,245,237,230,236,229,248,226,229,236,239,119,128, 30, + 113,239,237,237,225,225,227,227,229,238,116,128, 1, 99,100, 2, + 180,180,180,190,233,229,242,229,243,233,115,128, 30,151,239,116, + 2,180,197,180,206,225,227,227,229,238,116,128, 30,107,226,229, + 236,239,119,128, 30,109,101, 9,180,234,180,245,181, 9,182, 19, + 182, 44,182,108,182,175,182,180,182,232,227,249,242,233,236,236, + 233, 99,128, 4, 66,228,229,243,227,229,238,228,229,242,227,249, + 242,233,236,236,233, 99,128, 4,173,104, 7,181, 25,181, 34,181, + 48,181, 88,181,118,181,159,182, 1,225,242,225,226,233, 99,128, + 6, 42,230,233,238,225,236,225,242,225,226,233, 99,128,254,150, + 232,225,232,105, 2,181, 57,181, 72,238,233,244,233,225,236,225, + 242,225,226,233, 99,128,252,162,243,239,236,225,244,229,228,225, + 242,225,226,233, 99,128,252, 12,105, 2,181, 94,181,109,238,233, + 244,233,225,236,225,242,225,226,233, 99,128,254,151,242,225,231, + 225,238, 97,128, 48,102,234,229,229,237,105, 2,181,128,181,143, + 238,233,244,233,225,236,225,242,225,226,233, 99,128,252,161,243, + 239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 11,109, + 2,181,165,181,199,225,242,226,245,244, 97, 2,181,176,181,185, + 225,242,225,226,233, 99,128, 6, 41,230,233,238,225,236,225,242, + 225,226,233, 99,128,254,148,101, 2,181,205,181,218,228,233,225, + 236,225,242,225,226,233, 99,128,254,152,229,237,105, 2,181,226, + 181,241,238,233,244,233,225,236,225,242,225,226,233, 99,128,252, + 164,243,239,236,225,244,229,228,225,242,225,226,233, 99,128,252, + 14,238,239,239,238,230,233,238,225,236,225,242,225,226,233, 99, + 128,252,115,235,225,244,225,235,225,238, 97,129, 48,198,182, 32, + 232,225,236,230,247,233,228,244,104,128,255,131,108, 2,182, 50, + 182, 69,229,240,232,239,238,101,129, 33, 33,182, 61,226,236,225, + 227,107,128, 38, 14,233,243,232, 97, 2,182, 78,182, 93,231,229, + 228,239,236,225,232,229,226,242,229,119,128, 5,160,241,229,244, + 225,238,225,232,229,226,242,229,119,128, 5,169,110, 4,182,118, + 182,127,182,146,182,167,227,233,242,227,236,101,128, 36,105,233, + 228,229,239,231,242,225,240,232,233,227,240,225,242,229,110,128, + 50, 41,112, 2,182,152,182,159,225,242,229,110,128, 36,125,229, + 242,233,239,100,128, 36,145,242,239,237,225,110,128, 33,121,243, + 104,128, 2,167,116,131, 5,216,182,190,182,210,182,219,228,225, + 231,229,243,104,129,251, 56,182,201,232,229,226,242,229,119,128, + 251, 56,232,229,226,242,229,119,128, 5,216,243,229,227,249,242, + 233,236,236,233, 99,128, 4,181,246,233,114, 2,182,240,182,249, + 232,229,226,242,229,119,128, 5,155,236,229,230,244,232,229,226, + 242,229,119,128, 5,155,104, 6,183, 20,183,172,184, 38,184,170, + 185, 77,186,134, 97, 5,183, 32,183, 42,183, 49,183, 74,183,103, + 226,229,238,231,225,236,105,128, 9,165,228,229,246, 97,128, 9, + 37,231,117, 2,183, 56,183, 65,234,225,242,225,244,105,128, 10, + 165,242,237,245,235,232,105,128, 10, 37,108, 2,183, 80,183, 89, + 225,242,225,226,233, 99,128, 6, 48,230,233,238,225,236,225,242, + 225,226,233, 99,128,254,172,238,244,232,225,235,232,225,116, 3, + 183,118,183,149,183,156,236,239,119, 2,183,126,183,137,236,229, + 230,244,244,232,225,105,128,248,152,242,233,231,232,244,244,232, + 225,105,128,248,151,244,232,225,105,128, 14, 76,245,240,240,229, + 242,236,229,230,244,244,232,225,105,128,248,150,101, 3,183,180, + 183,244,184, 11,104, 4,183,190,183,199,183,213,183,229,225,242, + 225,226,233, 99,128, 6, 43,230,233,238,225,236,225,242,225,226, + 233, 99,128,254,154,233,238,233,244,233,225,236,225,242,225,226, + 233, 99,128,254,155,237,229,228,233,225,236,225,242,225,226,233, + 99,128,254,156,242,101, 2,183,251,184, 4,229,248,233,243,244, + 115,128, 34, 3,230,239,242,101,128, 34, 52,244, 97,130, 3,184, + 184, 20,184, 24, 49,128, 3,209,243,249,237,226,239,236,231,242, + 229,229,107,128, 3,209,105, 2,184, 44,184,130,229,245,244,104, + 4,184, 57,184, 92,184,107,184,116, 97, 2,184, 63,184, 78,227, + 233,242,227,236,229,235,239,242,229,225,110,128, 50,121,240,225, + 242,229,238,235,239,242,229,225,110,128, 50, 25,227,233,242,227, + 236,229,235,239,242,229,225,110,128, 50,107,235,239,242,229,225, + 110,128, 49, 76,240,225,242,229,238,235,239,242,229,225,110,128, + 50, 11,242,244,229,229,110, 2,184,140,184,149,227,233,242,227, + 236,101,128, 36,108,112, 2,184,155,184,162,225,242,229,110,128, + 36,128,229,242,233,239,100,128, 36,148,111, 6,184,184,184,201, + 184,206,184,220,184,225,185, 22,238,225,238,231,237,239,238,244, + 232,239,244,232,225,105,128, 14, 17,239,107,128, 1,173,240,232, + 245,244,232,225,239,244,232,225,105,128, 14, 18,242,110,128, 0, + 254,244,104, 3,184,234,185, 2,185, 12, 97, 2,184,240,184,250, + 232,225,238,244,232,225,105,128, 14, 23,238,244,232,225,105,128, + 14, 16,239,238,231,244,232,225,105,128, 14, 24,245,238,231,244, + 232,225,105,128, 14, 22,245,243,225,238,100, 2,185, 32,185, 43, + 227,249,242,233,236,236,233, 99,128, 4,130,243,243,229,240,225, + 242,225,244,239,114, 2,185, 58,185, 67,225,242,225,226,233, 99, + 128, 6,108,240,229,242,243,233,225,110,128, 6,108,242,229,101, + 144, 0, 51,185,115,185,124,185,134,185,164,185,171,185,181,185, + 206,185,233,186, 11,186, 23,186, 42,186, 53,186, 86,186,108,186, + 116,186,127,225,242,225,226,233, 99,128, 6, 99,226,229,238,231, + 225,236,105,128, 9,233,227,233,242,227,236,101,129, 36, 98,185, + 145,233,238,246,229,242,243,229,243,225,238,243,243,229,242,233, + 102,128, 39,140,228,229,246, 97,128, 9,105,229,233,231,232,244, + 232,115,128, 33, 92,231,117, 2,185,188,185,197,234,225,242,225, + 244,105,128, 10,233,242,237,245,235,232,105,128, 10,105,232, 97, + 2,185,213,185,224,227,235,225,242,225,226,233, 99,128, 6, 99, + 238,231,250,232,239,117,128, 48, 35,105, 2,185,239,186, 1,228, + 229,239,231,242,225,240,232,233,227,240,225,242,229,110,128, 50, + 34,238,230,229,242,233,239,114,128, 32,131,237,239,238,239,243, + 240,225,227,101,128,255, 19,238,245,237,229,242,225,244,239,242, + 226,229,238,231,225,236,105,128, 9,246,239,236,228,243,244,249, + 236,101,128,247, 51,112, 2,186, 59,186, 66,225,242,229,110,128, + 36,118,229,114, 2,186, 73,186, 79,233,239,100,128, 36,138,243, + 233,225,110,128, 6,243,241,245,225,242,244,229,242,115,129, 0, + 190,186, 99,229,237,228,225,243,104,128,246,222,242,239,237,225, + 110,128, 33,114,243,245,240,229,242,233,239,114,128, 0,179,244, + 232,225,105,128, 14, 83,250,243,241,245,225,242,101,128, 51,148, + 105, 7,186,160,186,171,187, 30,187,128,187,140,187,189,187,206, + 232,233,242,225,231,225,238, 97,128, 48, 97,107, 2,186,177,186, + 201,225,244,225,235,225,238, 97,129, 48,193,186,189,232,225,236, + 230,247,233,228,244,104,128,255,129,229,245,116, 4,186,213,186, + 248,187, 7,187, 16, 97, 2,186,219,186,234,227,233,242,227,236, + 229,235,239,242,229,225,110,128, 50,112,240,225,242,229,238,235, + 239,242,229,225,110,128, 50, 16,227,233,242,227,236,229,235,239, + 242,229,225,110,128, 50, 98,235,239,242,229,225,110,128, 49, 55, + 240,225,242,229,238,235,239,242,229,225,110,128, 50, 2,236,228, + 101,133, 2,220,187, 46,187, 57,187, 74,187, 86,187,114,226,229, + 236,239,247,227,237, 98,128, 3, 48, 99, 2,187, 63,187, 68,237, + 98,128, 3, 3,239,237, 98,128, 3, 3,228,239,245,226,236,229, + 227,237, 98,128, 3, 96,111, 2,187, 92,187,102,240,229,242,225, + 244,239,114,128, 34, 60,246,229,242,236,225,249,227,237, 98,128, + 3, 52,246,229,242,244,233,227,225,236,227,237, 98,128, 3, 62, + 237,229,243,227,233,242,227,236,101,128, 34,151,112, 2,187,146, + 187,176,229,232, 97, 2,187,154,187,163,232,229,226,242,229,119, + 128, 5,150,236,229,230,244,232,229,226,242,229,119,128, 5,150, + 240,233,231,245,242,237,245,235,232,105,128, 10,112,244,236,239, + 227,249,242,233,236,236,233,227,227,237, 98,128, 4,131,247,238, + 225,242,237,229,238,233,225,110,128, 5,127,236,233,238,229,226, + 229,236,239,119,128, 30,111,237,239,238,239,243,240,225,227,101, + 128,255, 84,111, 7,188, 3,188, 14,188, 25,188, 50,188,170,188, + 182,189, 10,225,242,237,229,238,233,225,110,128, 5,105,232,233, + 242,225,231,225,238, 97,128, 48,104,235,225,244,225,235,225,238, + 97,129, 48,200,188, 38,232,225,236,230,247,233,228,244,104,128, + 255,132,110, 3,188, 58,188,156,188,161,101, 4,188, 68,188,137, + 188,144,188,150,226,225,114, 4,188, 80,188,109,188,119,188,128, + 229,248,244,242, 97, 2,188, 90,188,100,232,233,231,232,237,239, + 100,128, 2,229,236,239,247,237,239,100,128, 2,233,232,233,231, + 232,237,239,100,128, 2,230,236,239,247,237,239,100,128, 2,232, + 237,233,228,237,239,100,128, 2,231,230,233,246,101,128, 1,189, + 243,233,120,128, 1,133,244,247,111,128, 1,168,239,115,128, 3, + 132,243,241,245,225,242,101,128, 51, 39,240,225,244,225,235,244, + 232,225,105,128, 14, 15,242,244,239,233,243,229,243,232,229,236, + 236,226,242,225,227,235,229,116, 2,188,205,188,235,236,229,230, + 116,130, 48, 20,188,216,188,224,243,237,225,236,108,128,254, 93, + 246,229,242,244,233,227,225,108,128,254, 57,242,233,231,232,116, + 130, 48, 21,188,247,188,255,243,237,225,236,108,128,254, 94,246, + 229,242,244,233,227,225,108,128,254, 58,244,225,239,244,232,225, + 105,128, 14, 21,240, 97, 2,189, 27,189, 39,236,225,244,225,236, + 232,239,239,107,128, 1,171,242,229,110,128, 36,175,114, 3,189, + 53,189, 84,189, 99,225,228,229,237,225,242,107,129, 33, 34,189, + 65,115, 2,189, 71,189, 77,225,238,115,128,248,234,229,242,233, + 102,128,246,219,229,244,242,239,230,236,229,248,232,239,239,107, + 128, 2,136,233,225,103, 4,189,111,189,116,189,121,189,126,228, + 110,128, 37,188,236,102,128, 37,196,242,116,128, 37,186,245,112, + 128, 37,178,115,132, 2,166,189,143,189,182,190, 32,190, 45,225, + 228,105,130, 5,230,189,153,189,173,228,225,231,229,243,104,129, + 251, 70,189,164,232,229,226,242,229,119,128,251, 70,232,229,226, + 242,229,119,128, 5,230,101, 2,189,188,189,199,227,249,242,233, + 236,236,233, 99,128, 4, 70,242,101,134, 5,181,189,216,189,230, + 189,235,189,244,190, 3,190, 19, 49, 2,189,222,189,226, 50,128, + 5,181,101,128, 5,181,178, 98,128, 5,181,232,229,226,242,229, + 119,128, 5,181,238,225,242,242,239,247,232,229,226,242,229,119, + 128, 5,181,241,245,225,242,244,229,242,232,229,226,242,229,119, + 128, 5,181,247,233,228,229,232,229,226,242,229,119,128, 5,181, + 232,229,227,249,242,233,236,236,233, 99,128, 4, 91,245,240,229, + 242,233,239,114,128,246,243,116, 4,190, 65,190,115,190,180,190, + 231, 97, 3,190, 73,190, 83,190, 90,226,229,238,231,225,236,105, + 128, 9,159,228,229,246, 97,128, 9, 31,231,117, 2,190, 97,190, + 106,234,225,242,225,244,105,128, 10,159,242,237,245,235,232,105, + 128, 10, 31,229,104, 4,190,126,190,135,190,149,190,165,225,242, + 225,226,233, 99,128, 6,121,230,233,238,225,236,225,242,225,226, + 233, 99,128,251,103,233,238,233,244,233,225,236,225,242,225,226, + 233, 99,128,251,104,237,229,228,233,225,236,225,242,225,226,233, + 99,128,251,105,232, 97, 3,190,189,190,199,190,206,226,229,238, + 231,225,236,105,128, 9,160,228,229,246, 97,128, 9, 32,231,117, + 2,190,213,190,222,234,225,242,225,244,105,128, 10,160,242,237, + 245,235,232,105,128, 10, 32,245,242,238,229,100,128, 2,135,117, + 3,190,247,191, 2,191, 27,232,233,242,225,231,225,238, 97,128, + 48,100,235,225,244,225,235,225,238, 97,129, 48,196,191, 15,232, + 225,236,230,247,233,228,244,104,128,255,130,243,237,225,236,108, + 2,191, 37,191, 48,232,233,242,225,231,225,238, 97,128, 48, 99, + 235,225,244,225,235,225,238, 97,129, 48,195,191, 61,232,225,236, + 230,247,233,228,244,104,128,255,111,119, 2,191, 79,191,184,101, + 2,191, 85,191,133,236,246,101, 3,191, 95,191,104,191,125,227, + 233,242,227,236,101,128, 36,107,112, 2,191,110,191,117,225,242, + 229,110,128, 36,127,229,242,233,239,100,128, 36,147,242,239,237, + 225,110,128, 33,123,238,244,121, 3,191,143,191,152,191,163,227, + 233,242,227,236,101,128, 36,115,232,225,238,231,250,232,239,117, + 128, 83, 68,112, 2,191,169,191,176,225,242,229,110,128, 36,135, + 229,242,233,239,100,128, 36,155,111,142, 0, 50,191,216,191,225, + 191,235,192, 9,192, 61,192, 86,192,113,192,147,192,159,192,178, + 192,189,192,222,192,230,192,254,225,242,225,226,233, 99,128, 6, + 98,226,229,238,231,225,236,105,128, 9,232,227,233,242,227,236, + 101,129, 36, 97,191,246,233,238,246,229,242,243,229,243,225,238, + 243,243,229,242,233,102,128, 39,139,100, 2,192, 15,192, 21,229, + 246, 97,128, 9,104,239,116, 2,192, 28,192, 39,229,238,236,229, + 225,228,229,114,128, 32, 37,236,229,225,228,229,114,129, 32, 37, + 192, 50,246,229,242,244,233,227,225,108,128,254, 48,231,117, 2, + 192, 68,192, 77,234,225,242,225,244,105,128, 10,232,242,237,245, + 235,232,105,128, 10,104,232, 97, 2,192, 93,192,104,227,235,225, + 242,225,226,233, 99,128, 6, 98,238,231,250,232,239,117,128, 48, + 34,105, 2,192,119,192,137,228,229,239,231,242,225,240,232,233, + 227,240,225,242,229,110,128, 50, 33,238,230,229,242,233,239,114, + 128, 32,130,237,239,238,239,243,240,225,227,101,128,255, 18,238, + 245,237,229,242,225,244,239,242,226,229,238,231,225,236,105,128, + 9,245,239,236,228,243,244,249,236,101,128,247, 50,112, 2,192, + 195,192,202,225,242,229,110,128, 36,117,229,114, 2,192,209,192, + 215,233,239,100,128, 36,137,243,233,225,110,128, 6,242,242,239, + 237,225,110,128, 33,113,115, 2,192,236,192,244,244,242,239,235, + 101,128, 1,187,245,240,229,242,233,239,114,128, 0,178,244,104, + 2,193, 5,193, 10,225,105,128, 14, 82,233,242,228,115,128, 33, + 84,117,145, 0,117,193, 55,193, 63,193,104,193,161,194, 43,194, + 80,194,203,194,219,195, 14,195, 84,195,165,195,174,196, 37,196, + 61,196,169,196,197,197, 55,225,227,245,244,101,128, 0,250, 98, + 4,193, 73,193, 78,193, 87,193, 97,225,114,128, 2,137,229,238, + 231,225,236,105,128, 9,137,239,240,239,237,239,230,111,128, 49, + 40,242,229,246,101,128, 1,109, 99, 3,193,112,193,119,193,151, + 225,242,239,110,128, 1,212,233,242, 99, 2,193,127,193,132,236, + 101,128, 36,228,245,237,230,236,229,120,129, 0,251,193,143,226, + 229,236,239,119,128, 30,119,249,242,233,236,236,233, 99,128, 4, + 67,100, 5,193,173,193,184,193,207,193,213,194, 33,225,244,244, + 225,228,229,246, 97,128, 9, 81,226,108, 2,193,191,193,199,225, + 227,245,244,101,128, 1,113,231,242,225,246,101,128, 2, 21,229, + 246, 97,128, 9, 9,233,229,242,229,243,233,115,133, 0,252,193, + 233,193,241,193,249,194, 16,194, 24,225,227,245,244,101,128, 1, + 216,226,229,236,239,119,128, 30,115, 99, 2,193,255,194, 6,225, + 242,239,110,128, 1,218,249,242,233,236,236,233, 99,128, 4,241, + 231,242,225,246,101,128, 1,220,237,225,227,242,239,110,128, 1, + 214,239,244,226,229,236,239,119,128, 30,229,103, 2,194, 49,194, + 56,242,225,246,101,128, 0,249,117, 2,194, 62,194, 71,234,225, + 242,225,244,105,128, 10,137,242,237,245,235,232,105,128, 10, 9, + 104, 3,194, 88,194, 98,194,176,233,242,225,231,225,238, 97,128, + 48, 70,111, 2,194,104,194,114,239,235,225,226,239,246,101,128, + 30,231,242,110,133, 1,176,194,129,194,137,194,148,194,156,194, + 168,225,227,245,244,101,128, 30,233,228,239,244,226,229,236,239, + 119,128, 30,241,231,242,225,246,101,128, 30,235,232,239,239,235, + 225,226,239,246,101,128, 30,237,244,233,236,228,101,128, 30,239, + 245,238,231,225,242,245,237,236,225,245,116,129, 1,113,194,192, + 227,249,242,233,236,236,233, 99,128, 4,243,233,238,246,229,242, + 244,229,228,226,242,229,246,101,128, 2, 23,107, 3,194,227,194, + 251,195, 6,225,244,225,235,225,238, 97,129, 48,166,194,239,232, + 225,236,230,247,233,228,244,104,128,255,115,227,249,242,233,236, + 236,233, 99,128, 4,121,239,242,229,225,110,128, 49, 92,109, 2, + 195, 20,195, 73, 97, 2,195, 26,195, 59,227,242,239,110,130, 1, + 107,195, 37,195, 48,227,249,242,233,236,236,233, 99,128, 4,239, + 228,233,229,242,229,243,233,115,128, 30,123,244,242,225,231,245, + 242,237,245,235,232,105,128, 10, 65,239,238,239,243,240,225,227, + 101,128,255, 85,110, 2,195, 90,195,145,228,229,242,243,227,239, + 242,101,132, 0, 95,195,109,195,115,195,127,195,138,228,226,108, + 128, 32, 23,237,239,238,239,243,240,225,227,101,128,255, 63,246, + 229,242,244,233,227,225,108,128,254, 51,247,225,246,121,128,254, + 79,105, 2,195,151,195,156,239,110,128, 34, 42,246,229,242,243, + 225,108,128, 34, 0,239,231,239,238,229,107,128, 1,115,112, 5, + 195,186,195,193,195,201,195,216,196, 11,225,242,229,110,128, 36, + 176,226,236,239,227,107,128, 37,128,240,229,242,228,239,244,232, + 229,226,242,229,119,128, 5,196,243,233,236,239,110,131, 3,197, + 195,230,195,251,196, 3,228,233,229,242,229,243,233,115,129, 3, + 203,195,243,244,239,238,239,115,128, 3,176,236,225,244,233,110, + 128, 2,138,244,239,238,239,115,128, 3,205,244,225,227,107, 2, + 196, 20,196, 31,226,229,236,239,247,227,237, 98,128, 3, 29,237, + 239,100,128, 2,212,114, 2,196, 43,196, 55,225,231,245,242,237, + 245,235,232,105,128, 10,115,233,238,103,128, 1,111,115, 3,196, + 69,196, 84,196,129,232,239,242,244,227,249,242,233,236,236,233, + 99,128, 4, 94,237,225,236,108, 2,196, 93,196,104,232,233,242, + 225,231,225,238, 97,128, 48, 69,235,225,244,225,235,225,238, 97, + 129, 48,165,196,117,232,225,236,230,247,233,228,244,104,128,255, + 105,244,242,225,233,231,232,116, 2,196,141,196,152,227,249,242, + 233,236,236,233, 99,128, 4,175,243,244,242,239,235,229,227,249, + 242,233,236,236,233, 99,128, 4,177,244,233,236,228,101,130, 1, + 105,196,181,196,189,225,227,245,244,101,128, 30,121,226,229,236, + 239,119,128, 30,117,117, 5,196,209,196,219,196,226,196,251,197, + 11,226,229,238,231,225,236,105,128, 9,138,228,229,246, 97,128, + 9, 10,231,117, 2,196,233,196,242,234,225,242,225,244,105,128, + 10,138,242,237,245,235,232,105,128, 10, 10,237,225,244,242,225, + 231,245,242,237,245,235,232,105,128, 10, 66,246,239,247,229,236, + 243,233,231,110, 3,197, 27,197, 37,197, 44,226,229,238,231,225, + 236,105,128, 9,194,228,229,246, 97,128, 9, 66,231,245,234,225, + 242,225,244,105,128, 10,194,246,239,247,229,236,243,233,231,110, + 3,197, 71,197, 81,197, 88,226,229,238,231,225,236,105,128, 9, + 193,228,229,246, 97,128, 9, 65,231,245,234,225,242,225,244,105, + 128, 10,193,118,139, 0,118,197,125,198, 17,198, 26,198, 37,198, + 222,198,229,199, 71,199, 83,199,183,199,191,199,212, 97, 4,197, + 135,197,142,197,167,197,178,228,229,246, 97,128, 9, 53,231,117, + 2,197,149,197,158,234,225,242,225,244,105,128, 10,181,242,237, + 245,235,232,105,128, 10, 53,235,225,244,225,235,225,238, 97,128, + 48,247,118,132, 5,213,197,190,197,217,197,249,198, 5,228,225, + 231,229,243,104,130,251, 53,197,203,197,208,182, 53,128,251, 53, + 232,229,226,242,229,119,128,251, 53,104, 2,197,223,197,231,229, + 226,242,229,119,128, 5,213,239,236,225,109,129,251, 75,197,240, + 232,229,226,242,229,119,128,251, 75,246,225,246,232,229,226,242, + 229,119,128, 5,240,249,239,228,232,229,226,242,229,119,128, 5, + 241,227,233,242,227,236,101,128, 36,229,228,239,244,226,229,236, + 239,119,128, 30,127,101, 6,198, 51,198, 62,198,126,198,137,198, + 143,198,210,227,249,242,233,236,236,233, 99,128, 4, 50,104, 4, + 198, 72,198, 81,198, 95,198,111,225,242,225,226,233, 99,128, 6, + 164,230,233,238,225,236,225,242,225,226,233, 99,128,251,107,233, + 238,233,244,233,225,236,225,242,225,226,233, 99,128,251,108,237, + 229,228,233,225,236,225,242,225,226,233, 99,128,251,109,235,225, + 244,225,235,225,238, 97,128, 48,249,238,245,115,128, 38, 64,242, + 244,233,227,225,108, 2,198,154,198,160,226,225,114,128, 0,124, + 236,233,238,101, 4,198,173,198,184,198,195,198,204,225,226,239, + 246,229,227,237, 98,128, 3, 13,226,229,236,239,247,227,237, 98, + 128, 3, 41,236,239,247,237,239,100,128, 2,204,237,239,100,128, + 2,200,247,225,242,237,229,238,233,225,110,128, 5,126,232,239, + 239,107,128, 2,139,105, 3,198,237,198,248,199, 31,235,225,244, + 225,235,225,238, 97,128, 48,248,242,225,237, 97, 3,199, 3,199, + 13,199, 20,226,229,238,231,225,236,105,128, 9,205,228,229,246, + 97,128, 9, 77,231,245,234,225,242,225,244,105,128, 10,205,243, + 225,242,231, 97, 3,199, 43,199, 53,199, 60,226,229,238,231,225, + 236,105,128, 9,131,228,229,246, 97,128, 9, 3,231,245,234,225, + 242,225,244,105,128, 10,131,237,239,238,239,243,240,225,227,101, + 128,255, 86,111, 3,199, 91,199,102,199,172,225,242,237,229,238, + 233,225,110,128, 5,120,233,227,229,100, 2,199,111,199,147,233, + 244,229,242,225,244,233,239,110, 2,199,125,199,136,232,233,242, + 225,231,225,238, 97,128, 48,158,235,225,244,225,235,225,238, 97, + 128, 48,254,237,225,242,235,235,225,238, 97,129, 48,155,199,160, + 232,225,236,230,247,233,228,244,104,128,255,158,235,225,244,225, + 235,225,238, 97,128, 48,250,240,225,242,229,110,128, 36,177,116, + 2,199,197,199,204,233,236,228,101,128, 30,125,245,242,238,229, + 100,128, 2,140,117, 2,199,218,199,229,232,233,242,225,231,225, + 238, 97,128, 48,148,235,225,244,225,235,225,238, 97,128, 48,244, + 119,143, 0,119,200, 18,200,251,201, 5,201, 28,201, 68,201,135, + 201,143,203,114,203,155,203,167,203,242,203,250,204, 1,204, 12, + 204, 21, 97, 8,200, 36,200, 43,200, 53,200, 64,200,102,200,134, + 200,146,200,182,227,245,244,101,128, 30,131,229,235,239,242,229, + 225,110,128, 49, 89,232,233,242,225,231,225,238, 97,128, 48,143, + 107, 2,200, 70,200, 94,225,244,225,235,225,238, 97,129, 48,239, + 200, 82,232,225,236,230,247,233,228,244,104,128,255,156,239,242, + 229,225,110,128, 49, 88,243,237,225,236,108, 2,200,112,200,123, + 232,233,242,225,231,225,238, 97,128, 48,142,235,225,244,225,235, + 225,238, 97,128, 48,238,244,244,239,243,241,245,225,242,101,128, + 51, 87,118, 2,200,152,200,160,229,228,225,243,104,128, 48, 28, + 249,245,238,228,229,242,243,227,239,242,229,246,229,242,244,233, + 227,225,108,128,254, 52,119, 3,200,190,200,199,200,213,225,242, + 225,226,233, 99,128, 6, 72,230,233,238,225,236,225,242,225,226, + 233, 99,128,254,238,232,225,237,250,225,225,226,239,246,101, 2, + 200,228,200,237,225,242,225,226,233, 99,128, 6, 36,230,233,238, + 225,236,225,242,225,226,233, 99,128,254,134,226,243,241,245,225, + 242,101,128, 51,221,227,233,242, 99, 2,201, 14,201, 19,236,101, + 128, 36,230,245,237,230,236,229,120,128, 1,117,100, 2,201, 34, + 201, 44,233,229,242,229,243,233,115,128, 30,133,239,116, 2,201, + 51,201, 60,225,227,227,229,238,116,128, 30,135,226,229,236,239, + 119,128, 30,137,101, 4,201, 78,201, 89,201,101,201,125,232,233, + 242,225,231,225,238, 97,128, 48,145,233,229,242,243,244,242,225, + 243,115,128, 33, 24,107, 2,201,107,201,117,225,244,225,235,225, + 238, 97,128, 48,241,239,242,229,225,110,128, 49, 94,239,235,239, + 242,229,225,110,128, 49, 93,231,242,225,246,101,128, 30,129,232, + 233,244,101, 8,201,164,201,173,202, 1,202, 91,202,175,202,220, + 203, 16,203, 72,226,245,236,236,229,116,128, 37,230, 99, 2,201, + 179,201,199,233,242,227,236,101,129, 37,203,201,189,233,238,246, + 229,242,243,101,128, 37,217,239,242,238,229,242,226,242,225,227, + 235,229,116, 2,201,216,201,236,236,229,230,116,129, 48, 14,201, + 225,246,229,242,244,233,227,225,108,128,254, 67,242,233,231,232, + 116,129, 48, 15,201,246,246,229,242,244,233,227,225,108,128,254, + 68,100, 2,202, 7,202, 48,233,225,237,239,238,100,129, 37,199, + 202, 18,227,239,238,244,225,233,238,233,238,231,226,236,225,227, + 235,243,237,225,236,236,228,233,225,237,239,238,100,128, 37,200, + 239,247,238,240,239,233,238,244,233,238,103, 2,202, 64,202, 80, + 243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37,191, + 244,242,233,225,238,231,236,101,128, 37,189,236,101, 2,202, 98, + 202,140,230,244,240,239,233,238,244,233,238,103, 2,202,113,202, + 129,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37, + 195,244,242,233,225,238,231,236,101,128, 37,193,238,244,233,227, + 245,236,225,242,226,242,225,227,235,229,116, 2,202,160,202,167, + 236,229,230,116,128, 48, 22,242,233,231,232,116,128, 48, 23,242, + 233,231,232,244,240,239,233,238,244,233,238,103, 2,202,193,202, + 209,243,237,225,236,236,244,242,233,225,238,231,236,101,128, 37, + 185,244,242,233,225,238,231,236,101,128, 37,183,115, 3,202,228, + 203, 2,203, 10,109, 2,202,234,202,246,225,236,236,243,241,245, + 225,242,101,128, 37,171,233,236,233,238,231,230,225,227,101,128, + 38, 58,241,245,225,242,101,128, 37,161,244,225,114,128, 38, 6, + 116, 2,203, 22,203, 33,229,236,229,240,232,239,238,101,128, 38, + 15,239,242,244,239,233,243,229,243,232,229,236,236,226,242,225, + 227,235,229,116, 2,203, 57,203, 64,236,229,230,116,128, 48, 24, + 242,233,231,232,116,128, 48, 25,245,240,240,239,233,238,244,233, + 238,103, 2,203, 87,203,103,243,237,225,236,236,244,242,233,225, + 238,231,236,101,128, 37,181,244,242,233,225,238,231,236,101,128, + 37,179,105, 2,203,120,203,131,232,233,242,225,231,225,238, 97, + 128, 48,144,107, 2,203,137,203,147,225,244,225,235,225,238, 97, + 128, 48,240,239,242,229,225,110,128, 49, 95,237,239,238,239,243, + 240,225,227,101,128,255, 87,111, 4,203,177,203,188,203,213,203, + 231,232,233,242,225,231,225,238, 97,128, 48,146,235,225,244,225, + 235,225,238, 97,129, 48,242,203,201,232,225,236,230,247,233,228, + 244,104,128,255,102,110,129, 32,169,203,219,237,239,238,239,243, + 240,225,227,101,128,255,230,247,225,229,238,244,232,225,105,128, + 14, 39,240,225,242,229,110,128, 36,178,242,233,238,103,128, 30, + 152,243,245,240,229,242,233,239,114,128, 2,183,244,245,242,238, + 229,100,128, 2,141,249,238,110,128, 1,191,120,137, 0,120,204, + 49,204, 60,204, 71,204, 80,204,107,204,120,204,124,204,136,204, + 144,225,226,239,246,229,227,237, 98,128, 3, 61,226,239,240,239, + 237,239,230,111,128, 49, 18,227,233,242,227,236,101,128, 36,231, + 100, 2,204, 86,204, 96,233,229,242,229,243,233,115,128, 30,141, + 239,244,225,227,227,229,238,116,128, 30,139,229,232,225,242,237, + 229,238,233,225,110,128, 5,109,105,128, 3,190,237,239,238,239, + 243,240,225,227,101,128,255, 88,240,225,242,229,110,128, 36,179, + 243,245,240,229,242,233,239,114,128, 2,227,121,143, 0,121,204, + 189,205,148,205,171,205,211,207,177,207,185,207,202,208, 10,208, + 22,209, 19,209, 59,209, 71,209, 82,209,103,210, 76, 97, 11,204, + 213,204,225,204,235,204,242,204,249,205, 3,205, 28,205, 39,205, + 77,205, 90,205,136,225,228,239,243,241,245,225,242,101,128, 51, + 78,226,229,238,231,225,236,105,128, 9,175,227,245,244,101,128, + 0,253,228,229,246, 97,128, 9, 47,229,235,239,242,229,225,110, + 128, 49, 82,231,117, 2,205, 10,205, 19,234,225,242,225,244,105, + 128, 10,175,242,237,245,235,232,105,128, 10, 47,232,233,242,225, + 231,225,238, 97,128, 48,132,107, 2,205, 45,205, 69,225,244,225, + 235,225,238, 97,129, 48,228,205, 57,232,225,236,230,247,233,228, + 244,104,128,255,148,239,242,229,225,110,128, 49, 81,237,225,235, + 235,225,238,244,232,225,105,128, 14, 78,243,237,225,236,108, 2, + 205,100,205,111,232,233,242,225,231,225,238, 97,128, 48,131,235, + 225,244,225,235,225,238, 97,129, 48,227,205,124,232,225,236,230, + 247,233,228,244,104,128,255,108,244,227,249,242,233,236,236,233, + 99,128, 4, 99,227,233,242, 99, 2,205,157,205,162,236,101,128, + 36,232,245,237,230,236,229,120,128, 1,119,100, 2,205,177,205, + 187,233,229,242,229,243,233,115,128, 0,255,239,116, 2,205,194, + 205,203,225,227,227,229,238,116,128, 30,143,226,229,236,239,119, + 128, 30,245,101, 7,205,227,206,235,206,244,207, 6,207, 38,207, + 114,207,165,104, 8,205,245,205,254,206, 32,206, 46,206,119,206, + 135,206,194,206,212,225,242,225,226,233, 99,128, 6, 74,226,225, + 242,242,229,101, 2,206, 9,206, 18,225,242,225,226,233, 99,128, + 6,210,230,233,238,225,236,225,242,225,226,233, 99,128,251,175, + 230,233,238,225,236,225,242,225,226,233, 99,128,254,242,232,225, + 237,250,225,225,226,239,246,101, 4,206, 65,206, 74,206, 88,206, + 104,225,242,225,226,233, 99,128, 6, 38,230,233,238,225,236,225, + 242,225,226,233, 99,128,254,138,233,238,233,244,233,225,236,225, + 242,225,226,233, 99,128,254,139,237,229,228,233,225,236,225,242, + 225,226,233, 99,128,254,140,233,238,233,244,233,225,236,225,242, + 225,226,233, 99,128,254,243,237,101, 2,206,142,206,155,228,233, + 225,236,225,242,225,226,233, 99,128,254,244,229,237,105, 2,206, + 163,206,178,238,233,244,233,225,236,225,242,225,226,233, 99,128, + 252,221,243,239,236,225,244,229,228,225,242,225,226,233, 99,128, + 252, 88,238,239,239,238,230,233,238,225,236,225,242,225,226,233, + 99,128,252,148,244,232,242,229,229,228,239,244,243,226,229,236, + 239,247,225,242,225,226,233, 99,128, 6,209,235,239,242,229,225, + 110,128, 49, 86,110,129, 0,165,206,250,237,239,238,239,243,240, + 225,227,101,128,255,229,111, 2,207, 12,207, 21,235,239,242,229, + 225,110,128, 49, 85,242,233,238,232,233,229,245,232,235,239,242, + 229,225,110,128, 49,134,114, 3,207, 46,207, 82,207, 94,225,232, + 226,229,238,249,239,237,111, 2,207, 60,207, 69,232,229,226,242, + 229,119,128, 5,170,236,229,230,244,232,229,226,242,229,119,128, + 5,170,233,227,249,242,233,236,236,233, 99,128, 4, 75,245,228, + 233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128, + 4,249,243,233,229,245,238,103, 3,207,127,207,136,207,152,235, + 239,242,229,225,110,128, 49,129,240,225,238,243,233,239,243,235, + 239,242,229,225,110,128, 49,131,243,233,239,243,235,239,242,229, + 225,110,128, 49,130,244,233,246,232,229,226,242,229,119,128, 5, + 154,231,242,225,246,101,128, 30,243,232,239,239,107,129, 1,180, + 207,194,225,226,239,246,101,128, 30,247,105, 5,207,214,207,225, + 207,236,207,245,207,253,225,242,237,229,238,233,225,110,128, 5, + 117,227,249,242,233,236,236,233, 99,128, 4, 87,235,239,242,229, + 225,110,128, 49, 98,238,249,225,238,103,128, 38, 47,247,238,225, + 242,237,229,238,233,225,110,128, 5,130,237,239,238,239,243,240, + 225,227,101,128,255, 89,111, 7,208, 38,208,108,208,119,208,129, + 208,167,208,213,208,222,100,131, 5,217,208, 48,208, 68,208, 77, + 228,225,231,229,243,104,129,251, 57,208, 59,232,229,226,242,229, + 119,128,251, 57,232,229,226,242,229,119,128, 5,217,249,239,100, + 2,208, 85,208, 94,232,229,226,242,229,119,128, 5,242,240,225, + 244,225,232,232,229,226,242,229,119,128,251, 31,232,233,242,225, + 231,225,238, 97,128, 48,136,233,235,239,242,229,225,110,128, 49, + 137,107, 2,208,135,208,159,225,244,225,235,225,238, 97,129, 48, + 232,208,147,232,225,236,230,247,233,228,244,104,128,255,150,239, + 242,229,225,110,128, 49, 91,243,237,225,236,108, 2,208,177,208, + 188,232,233,242,225,231,225,238, 97,128, 48,135,235,225,244,225, + 235,225,238, 97,129, 48,231,208,201,232,225,236,230,247,233,228, + 244,104,128,255,110,244,231,242,229,229,107,128, 3,243,121, 2, + 208,228,209, 9, 97, 2,208,234,208,244,229,235,239,242,229,225, + 110,128, 49,136,107, 2,208,250,209, 2,239,242,229,225,110,128, + 49,135,244,232,225,105,128, 14, 34,233,238,231,244,232,225,105, + 128, 14, 13,112, 2,209, 25,209, 32,225,242,229,110,128, 36,180, + 239,231,229,231,242,225,237,237,229,238,105,129, 3,122,209, 48, + 231,242,229,229,235,227,237, 98,128, 3, 69,114,129, 1,166,209, + 65,233,238,103,128, 30,153,243,245,240,229,242,233,239,114,128, + 2,184,116, 2,209, 88,209, 95,233,236,228,101,128, 30,249,245, + 242,238,229,100,128, 2,142,117, 5,209,115,209,126,209,136,209, + 174,210, 50,232,233,242,225,231,225,238, 97,128, 48,134,233,235, + 239,242,229,225,110,128, 49,140,107, 2,209,142,209,166,225,244, + 225,235,225,238, 97,129, 48,230,209,154,232,225,236,230,247,233, + 228,244,104,128,255,149,239,242,229,225,110,128, 49, 96,115, 3, + 209,182,209,220,210, 5,226,233,103, 2,209,190,209,201,227,249, + 242,233,236,236,233, 99,128, 4,107,233,239,244,233,230,233,229, + 228,227,249,242,233,236,236,233, 99,128, 4,109,236,233,244,244, + 236,101, 2,209,231,209,242,227,249,242,233,236,236,233, 99,128, + 4,103,233,239,244,233,230,233,229,228,227,249,242,233,236,236, + 233, 99,128, 4,105,237,225,236,108, 2,210, 14,210, 25,232,233, + 242,225,231,225,238, 97,128, 48,133,235,225,244,225,235,225,238, + 97,129, 48,229,210, 38,232,225,236,230,247,233,228,244,104,128, + 255,109,249,101, 2,210, 57,210, 66,235,239,242,229,225,110,128, + 49,139,239,235,239,242,229,225,110,128, 49,138,249, 97, 2,210, + 83,210, 93,226,229,238,231,225,236,105,128, 9,223,228,229,246, + 97,128, 9, 95,122,142, 0,122,210,132,211,140,211,151,211,194, + 211,221,213, 0,213,108,213,150,213,162,213,174,213,202,213,210, + 213,226,213,235, 97, 10,210,154,210,165,210,172,210,179,210,190, + 211, 12,211, 42,211, 53,211, 89,211,101,225,242,237,229,238,233, + 225,110,128, 5,102,227,245,244,101,128, 1,122,228,229,246, 97, + 128, 9, 91,231,245,242,237,245,235,232,105,128, 10, 91,104, 4, + 210,200,210,209,210,223,210,253,225,242,225,226,233, 99,128, 6, + 56,230,233,238,225,236,225,242,225,226,233, 99,128,254,198,105, + 2,210,229,210,244,238,233,244,233,225,236,225,242,225,226,233, + 99,128,254,199,242,225,231,225,238, 97,128, 48, 86,237,229,228, + 233,225,236,225,242,225,226,233, 99,128,254,200,233,110, 2,211, + 19,211, 28,225,242,225,226,233, 99,128, 6, 50,230,233,238,225, + 236,225,242,225,226,233, 99,128,254,176,235,225,244,225,235,225, + 238, 97,128, 48,182,241,229,102, 2,211, 61,211, 75,231,225,228, + 239,236,232,229,226,242,229,119,128, 5,149,241,225,244,225,238, + 232,229,226,242,229,119,128, 5,148,242,241,225,232,229,226,242, + 229,119,128, 5,152,249,233,110,130, 5,214,211,111,211,131,228, + 225,231,229,243,104,129,251, 54,211,122,232,229,226,242,229,119, + 128,251, 54,232,229,226,242,229,119,128, 5,214,226,239,240,239, + 237,239,230,111,128, 49, 23, 99, 3,211,159,211,166,211,188,225, + 242,239,110,128, 1,126,233,242, 99, 2,211,174,211,179,236,101, + 128, 36,233,245,237,230,236,229,120,128, 30,145,245,242,108,128, + 2,145,228,239,116,130, 1,124,211,204,211,213,225,227,227,229, + 238,116,128, 1,124,226,229,236,239,119,128, 30,147,101, 6,211, + 235,211,246,212, 33,212, 44,212, 55,212,251,227,249,242,233,236, + 236,233, 99,128, 4, 55,100, 2,211,252,212, 15,229,243,227,229, + 238,228,229,242,227,249,242,233,236,236,233, 99,128, 4,153,233, + 229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128, 4, + 223,232,233,242,225,231,225,238, 97,128, 48, 92,235,225,244,225, + 235,225,238, 97,128, 48,188,242,111,140, 0, 48,212, 84,212, 93, + 212,103,212,110,212,135,212,148,212,159,212,171,212,182,212,192, + 212,203,212,210,225,242,225,226,233, 99,128, 6, 96,226,229,238, + 231,225,236,105,128, 9,230,228,229,246, 97,128, 9,102,231,117, + 2,212,117,212,126,234,225,242,225,244,105,128, 10,230,242,237, + 245,235,232,105,128, 10,102,232,225,227,235,225,242,225,226,233, + 99,128, 6, 96,233,238,230,229,242,233,239,114,128, 32,128,237, + 239,238,239,243,240,225,227,101,128,255, 16,239,236,228,243,244, + 249,236,101,128,247, 48,240,229,242,243,233,225,110,128, 6,240, + 243,245,240,229,242,233,239,114,128, 32,112,244,232,225,105,128, + 14, 80,247,233,228,244,104, 3,212,222,212,231,212,243,234,239, + 233,238,229,114,128,254,255,238,239,238,234,239,233,238,229,114, + 128, 32, 12,243,240,225,227,101,128, 32, 11,244, 97,128, 3,182, + 104, 2,213, 6,213, 17,226,239,240,239,237,239,230,111,128, 49, + 19,101, 4,213, 27,213, 38,213, 54,213, 65,225,242,237,229,238, + 233,225,110,128, 5,106,226,242,229,246,229,227,249,242,233,236, + 236,233, 99,128, 4,194,227,249,242,233,236,236,233, 99,128, 4, + 54,100, 2,213, 71,213, 90,229,243,227,229,238,228,229,242,227, + 249,242,233,236,236,233, 99,128, 4,151,233,229,242,229,243,233, + 243,227,249,242,233,236,236,233, 99,128, 4,221,105, 3,213,116, + 213,127,213,138,232,233,242,225,231,225,238, 97,128, 48, 88,235, + 225,244,225,235,225,238, 97,128, 48,184,238,239,242,232,229,226, + 242,229,119,128, 5,174,236,233,238,229,226,229,236,239,119,128, + 30,149,237,239,238,239,243,240,225,227,101,128,255, 90,111, 2, + 213,180,213,191,232,233,242,225,231,225,238, 97,128, 48, 94,235, + 225,244,225,235,225,238, 97,128, 48,190,240,225,242,229,110,128, + 36,181,242,229,244,242,239,230,236,229,248,232,239,239,107,128, + 2,144,243,244,242,239,235,101,128, 1,182,117, 2,213,241,213, + 252,232,233,242,225,231,225,238, 97,128, 48, 90,235,225,244,225, + 235,225,238, 97,128, 48,186 + }; + + + /* + * This function searches the compressed table efficiently. + */ + static unsigned long + ft_get_adobe_glyph_index( const char* name, + const char* limit ) + { + int c = 0; + int count, min, max; + const unsigned char* p = ft_adobe_glyph_list; + + + if ( name == 0 || name >= limit ) + goto NotFound; + + c = *name++; + count = p[1]; + p += 2; + + min = 0; + max = count; + + while ( min < max ) + { + int mid = ( min + max ) >> 1; + const unsigned char* q = p + mid * 2; + int c2; + + + q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] ); + + c2 = q[0] & 127; + if ( c2 == c ) + { + p = q; + goto Found; + } + if ( c2 < c ) + min = mid + 1; + else + max = mid; + } + goto NotFound; + + Found: + for (;;) + { + /* assert (*p & 127) == c */ + + if ( name >= limit ) + { + if ( (p[0] & 128) == 0 && + (p[1] & 128) != 0 ) + return (unsigned long)( ( (int)p[2] << 8 ) | p[3] ); + + goto NotFound; + } + c = *name++; + if ( p[0] & 128 ) + { + p++; + if ( c != (p[0] & 127) ) + goto NotFound; + + continue; + } + + p++; + count = p[0] & 127; + if ( p[0] & 128 ) + p += 2; + + p++; + + for ( ; count > 0; count--, p += 2 ) + { + int offset = ( (int)p[0] << 8 ) | p[1]; + const unsigned char* q = ft_adobe_glyph_list + offset; + + if ( c == ( q[0] & 127 ) ) + { + p = q; + goto NextIter; + } + } + goto NotFound; + + NextIter: + ; + } + + NotFound: + return 0; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/raster/ftmisc.h b/reactos/dll/3rdparty/freetype/src/raster/ftmisc.h index c5dbd50d003..927ac4ce952 100644 --- a/reactos/dll/3rdparty/freetype/src/raster/ftmisc.h +++ b/reactos/dll/3rdparty/freetype/src/raster/ftmisc.h @@ -1,83 +1,83 @@ -/***************************************************************************/ -/* */ -/* ftmisc.h */ -/* */ -/* Miscellaneous macros for stand-alone rasterizer (specification */ -/* only). */ -/* */ -/* Copyright 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used */ -/* modified and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /***************************************************/ - /* */ - /* This file is *not* portable! You have to adapt */ - /* its definitions to your platform. */ - /* */ - /***************************************************/ - -#ifndef __FTMISC_H__ -#define __FTMISC_H__ - -#include /* memset */ - -#define FT_BEGIN_HEADER -#define FT_END_HEADER - -#define FT_LOCAL_DEF( x ) static x - - /* from include/freetype2/fttypes.h */ - - typedef unsigned char FT_Byte; - typedef signed int FT_Int; - typedef unsigned int FT_UInt; - typedef signed long FT_Long; - typedef unsigned long FT_ULong; - typedef signed long FT_F26Dot6; - typedef int FT_Error; - -#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ - ( ( (FT_ULong)_x1 << 24 ) | \ - ( (FT_ULong)_x2 << 16 ) | \ - ( (FT_ULong)_x3 << 8 ) | \ - (FT_ULong)_x4 ) - - - /* from src/ftcalc.c */ - -#include - - typedef int64_t FT_Int64; - - static FT_Long - FT_MulDiv( FT_Long a, - FT_Long b, - FT_Long c ) - { - FT_Int s; - FT_Long d; - - - s = 1; - if ( a < 0 ) { a = -a; s = -1; } - if ( b < 0 ) { b = -b; s = -s; } - if ( c < 0 ) { c = -c; s = -s; } - - d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c - : 0x7FFFFFFFL ); - - return ( s > 0 ) ? d : -d; - } - -#endif /* __FTMISC_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftmisc.h */ +/* */ +/* Miscellaneous macros for stand-alone rasterizer (specification */ +/* only). */ +/* */ +/* Copyright 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /***************************************************/ + /* */ + /* This file is *not* portable! You have to adapt */ + /* its definitions to your platform. */ + /* */ + /***************************************************/ + +#ifndef __FTMISC_H__ +#define __FTMISC_H__ + +#include /* memset */ + +#define FT_BEGIN_HEADER +#define FT_END_HEADER + +#define FT_LOCAL_DEF( x ) static x + + /* from include/freetype2/fttypes.h */ + + typedef unsigned char FT_Byte; + typedef signed int FT_Int; + typedef unsigned int FT_UInt; + typedef signed long FT_Long; + typedef unsigned long FT_ULong; + typedef signed long FT_F26Dot6; + typedef int FT_Error; + +#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ + ( ( (FT_ULong)_x1 << 24 ) | \ + ( (FT_ULong)_x2 << 16 ) | \ + ( (FT_ULong)_x3 << 8 ) | \ + (FT_ULong)_x4 ) + + + /* from src/ftcalc.c */ + +#include + + typedef int64_t FT_Int64; + + static FT_Long + FT_MulDiv( FT_Long a, + FT_Long b, + FT_Long c ) + { + FT_Int s; + FT_Long d; + + + s = 1; + if ( a < 0 ) { a = -a; s = -1; } + if ( b < 0 ) { b = -b; s = -s; } + if ( c < 0 ) { c = -c; s = -s; } + + d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c + : 0x7FFFFFFFL ); + + return ( s > 0 ) ? d : -d; + } + +#endif /* __FTMISC_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/raster/ftraster.c b/reactos/dll/3rdparty/freetype/src/raster/ftraster.c index 4cfca4ed035..403f4d60353 100644 --- a/reactos/dll/3rdparty/freetype/src/raster/ftraster.c +++ b/reactos/dll/3rdparty/freetype/src/raster/ftraster.c @@ -1,3369 +1,3369 @@ -/***************************************************************************/ -/* */ -/* ftraster.c */ -/* */ -/* The FreeType glyph rasterizer (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - /*************************************************************************/ - /* */ - /* This file can be compiled without the rest of the FreeType engine, by */ - /* defining the _STANDALONE_ macro when compiling it. You also need to */ - /* put the files `ftimage.h' and `ftmisc.h' into the $(incdir) */ - /* directory. Typically, you should do something like */ - /* */ - /* - copy `src/raster/ftraster.c' (this file) to your current directory */ - /* */ - /* - copy `include/freetype/ftimage.h' and `src/raster/ftmisc.h' */ - /* to your current directory */ - /* */ - /* - compile `ftraster' with the _STANDALONE_ macro defined, as in */ - /* */ - /* cc -c -D_STANDALONE_ ftraster.c */ - /* */ - /* The renderer can be initialized with a call to */ - /* `ft_standard_raster.raster_new'; a bitmap can be generated */ - /* with a call to `ft_standard_raster.raster_render'. */ - /* */ - /* See the comments and documentation in the file `ftimage.h' for more */ - /* details on how the raster works. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This is a rewrite of the FreeType 1.x scan-line converter */ - /* */ - /*************************************************************************/ - -#ifdef _STANDALONE_ - -#include "ftmisc.h" -#include "ftimage.h" - -#else /* !_STANDALONE_ */ - -#include -#include "ftraster.h" -#include FT_INTERNAL_CALC_H /* for FT_MulDiv only */ - -#endif /* !_STANDALONE_ */ - - - /*************************************************************************/ - /* */ - /* A simple technical note on how the raster works */ - /* ----------------------------------------------- */ - /* */ - /* Converting an outline into a bitmap is achieved in several steps: */ - /* */ - /* 1 - Decomposing the outline into successive `profiles'. Each */ - /* profile is simply an array of scanline intersections on a given */ - /* dimension. A profile's main attributes are */ - /* */ - /* o its scanline position boundaries, i.e. `Ymin' and `Ymax'. */ - /* */ - /* o an array of intersection coordinates for each scanline */ - /* between `Ymin' and `Ymax'. */ - /* */ - /* o a direction, indicating whether it was built going `up' or */ - /* `down', as this is very important for filling rules. */ - /* */ - /* 2 - Sweeping the target map's scanlines in order to compute segment */ - /* `spans' which are then filled. Additionally, this pass */ - /* performs drop-out control. */ - /* */ - /* The outline data is parsed during step 1 only. The profiles are */ - /* built from the bottom of the render pool, used as a stack. The */ - /* following graphics shows the profile list under construction: */ - /* */ - /* ____________________________________________________________ _ _ */ - /* | | | | | */ - /* | profile | coordinates for | profile | coordinates for |--> */ - /* | 1 | profile 1 | 2 | profile 2 |--> */ - /* |_________|___________________|_________|_________________|__ _ _ */ - /* */ - /* ^ ^ */ - /* | | */ - /* start of render pool top */ - /* */ - /* The top of the profile stack is kept in the `top' variable. */ - /* */ - /* As you can see, a profile record is pushed on top of the render */ - /* pool, which is then followed by its coordinates/intersections. If */ - /* a change of direction is detected in the outline, a new profile is */ - /* generated until the end of the outline. */ - /* */ - /* Note that when all profiles have been generated, the function */ - /* Finalize_Profile_Table() is used to record, for each profile, its */ - /* bottom-most scanline as well as the scanline above its upmost */ - /* boundary. These positions are called `y-turns' because they (sort */ - /* of) correspond to local extrema. They are stored in a sorted list */ - /* built from the top of the render pool as a downwards stack: */ - /* */ - /* _ _ _______________________________________ */ - /* | | */ - /* <--| sorted list of | */ - /* <--| extrema scanlines | */ - /* _ _ __________________|____________________| */ - /* */ - /* ^ ^ */ - /* | | */ - /* maxBuff sizeBuff = end of pool */ - /* */ - /* This list is later used during the sweep phase in order to */ - /* optimize performance (see technical note on the sweep below). */ - /* */ - /* Of course, the raster detects whether the two stacks collide and */ - /* handles the situation properly. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /*************************************************************************/ - /** **/ - /** CONFIGURATION MACROS **/ - /** **/ - /*************************************************************************/ - /*************************************************************************/ - - /* define DEBUG_RASTER if you want to compile a debugging version */ -#define xxxDEBUG_RASTER - - /* undefine FT_RASTER_OPTION_ANTI_ALIASING if you do not want to support */ - /* 5-levels anti-aliasing */ -#ifdef FT_CONFIG_OPTION_5_GRAY_LEVELS -#define FT_RASTER_OPTION_ANTI_ALIASING -#endif - - /* The size of the two-lines intermediate bitmap used */ - /* for anti-aliasing, in bytes. */ -#define RASTER_GRAY_LINES 2048 - - - /*************************************************************************/ - /*************************************************************************/ - /** **/ - /** OTHER MACROS (do not change) **/ - /** **/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_raster - - -#ifdef _STANDALONE_ - - - /* This macro is used to indicate that a function parameter is unused. */ - /* Its purpose is simply to reduce compiler warnings. Note also that */ - /* simply defining it as `(void)x' doesn't avoid warnings with certain */ - /* ANSI compilers (e.g. LCC). */ -#define FT_UNUSED( x ) (x) = (x) - - /* Disable the tracing mechanism for simplicity -- developers can */ - /* activate it easily by redefining these two macros. */ -#ifndef FT_ERROR -#define FT_ERROR( x ) do ; while ( 0 ) /* nothing */ -#endif - -#ifndef FT_TRACE -#define FT_TRACE( x ) do ; while ( 0 ) /* nothing */ -#define FT_TRACE1( x ) do ; while ( 0 ) /* nothing */ -#define FT_TRACE6( x ) do ; while ( 0 ) /* nothing */ -#endif - -#define Raster_Err_None 0 -#define Raster_Err_Not_Ini -1 -#define Raster_Err_Overflow -2 -#define Raster_Err_Neg_Height -3 -#define Raster_Err_Invalid -4 -#define Raster_Err_Unsupported -5 - -#define ft_memset memset - -#else /* _STANDALONE_ */ - - -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H /* for FT_TRACE() and FT_ERROR() */ - -#include "rasterrs.h" - -#define Raster_Err_None Raster_Err_Ok -#define Raster_Err_Not_Ini Raster_Err_Raster_Uninitialized -#define Raster_Err_Overflow Raster_Err_Raster_Overflow -#define Raster_Err_Neg_Height Raster_Err_Raster_Negative_Height -#define Raster_Err_Invalid Raster_Err_Invalid_Outline -#define Raster_Err_Unsupported Raster_Err_Cannot_Render_Glyph - - -#endif /* _STANDALONE_ */ - - -#ifndef FT_MEM_SET -#define FT_MEM_SET( d, s, c ) ft_memset( d, s, c ) -#endif - -#ifndef FT_MEM_ZERO -#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count ) -#endif - - /* FMulDiv means `Fast MulDiv'; it is used in case where `b' is */ - /* typically a small value and the result of a*b is known to fit into */ - /* 32 bits. */ -#define FMulDiv( a, b, c ) ( (a) * (b) / (c) ) - - /* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */ - /* for clipping computations. It simply uses the FT_MulDiv() function */ - /* defined in `ftcalc.h'. */ -#define SMulDiv FT_MulDiv - - /* The rasterizer is a very general purpose component; please leave */ - /* the following redefinitions there (you never know your target */ - /* environment). */ - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef NULL -#define NULL (void*)0 -#endif - -#ifndef SUCCESS -#define SUCCESS 0 -#endif - -#ifndef FAILURE -#define FAILURE 1 -#endif - - -#define MaxBezier 32 /* The maximum number of stacked Bezier curves. */ - /* Setting this constant to more than 32 is a */ - /* pure waste of space. */ - -#define Pixel_Bits 6 /* fractional bits of *input* coordinates */ - - - /*************************************************************************/ - /*************************************************************************/ - /** **/ - /** SIMPLE TYPE DECLARATIONS **/ - /** **/ - /*************************************************************************/ - /*************************************************************************/ - - typedef int Int; - typedef unsigned int UInt; - typedef short Short; - typedef unsigned short UShort, *PUShort; - typedef long Long, *PLong; - typedef unsigned long ULong; - - typedef unsigned char Byte, *PByte; - typedef char Bool; - - - typedef union Alignment_ - { - long l; - void* p; - void (*f)(void); - - } Alignment, *PAlignment; - - - typedef struct TPoint_ - { - Long x; - Long y; - - } TPoint; - - - typedef enum TFlow_ - { - Flow_None = 0, - Flow_Up = 1, - Flow_Down = -1 - - } TFlow; - - - /* States of each line, arc, and profile */ - typedef enum TStates_ - { - Unknown_State, - Ascending_State, - Descending_State, - Flat_State - - } TStates; - - - typedef struct TProfile_ TProfile; - typedef TProfile* PProfile; - - struct TProfile_ - { - FT_F26Dot6 X; /* current coordinate during sweep */ - PProfile link; /* link to next profile - various purpose */ - PLong offset; /* start of profile's data in render pool */ - int flow; /* Profile orientation: Asc/Descending */ - long height; /* profile's height in scanlines */ - long start; /* profile's starting scanline */ - - unsigned countL; /* number of lines to step before this */ - /* profile becomes drawable */ - - PProfile next; /* next profile in same contour, used */ - /* during drop-out control */ - }; - - typedef PProfile TProfileList; - typedef PProfile* PProfileList; - - - /* Simple record used to implement a stack of bands, required */ - /* by the sub-banding mechanism */ - typedef struct TBand_ - { - Short y_min; /* band's minimum */ - Short y_max; /* band's maximum */ - - } TBand; - - -#define AlignProfileSize \ - ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) ) - - -#ifdef FT_STATIC_RASTER - - -#define RAS_ARGS /* void */ -#define RAS_ARG /* void */ - -#define RAS_VARS /* void */ -#define RAS_VAR /* void */ - -#define FT_UNUSED_RASTER do ; while ( 0 ) - - -#else /* FT_STATIC_RASTER */ - - -#define RAS_ARGS PWorker worker, -#define RAS_ARG PWorker worker - -#define RAS_VARS worker, -#define RAS_VAR worker - -#define FT_UNUSED_RASTER FT_UNUSED( worker ) - - -#endif /* FT_STATIC_RASTER */ - - - typedef struct TWorker_ TWorker, *PWorker; - - - /* prototypes used for sweep function dispatch */ - typedef void - Function_Sweep_Init( RAS_ARGS Short* min, - Short* max ); - - typedef void - Function_Sweep_Span( RAS_ARGS Short y, - FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ); - - typedef void - Function_Sweep_Step( RAS_ARG ); - - - /* NOTE: These operations are only valid on 2's complement processors */ - -#define FLOOR( x ) ( (x) & -ras.precision ) -#define CEILING( x ) ( ( (x) + ras.precision - 1 ) & -ras.precision ) -#define TRUNC( x ) ( (signed long)(x) >> ras.precision_bits ) -#define FRAC( x ) ( (x) & ( ras.precision - 1 ) ) -#define SCALED( x ) ( ( (x) << ras.scale_shift ) - ras.precision_half ) - - /* Note that I have moved the location of some fields in the */ - /* structure to ensure that the most used variables are used */ - /* at the top. Thus, their offset can be coded with less */ - /* opcodes, and it results in a smaller executable. */ - - struct TWorker_ - { - Int precision_bits; /* precision related variables */ - Int precision; - Int precision_half; - Long precision_mask; - Int precision_shift; - Int precision_step; - Int precision_jitter; - - Int scale_shift; /* == precision_shift for bitmaps */ - /* == precision_shift+1 for pixmaps */ - - PLong buff; /* The profiles buffer */ - PLong sizeBuff; /* Render pool size */ - PLong maxBuff; /* Profiles buffer size */ - PLong top; /* Current cursor in buffer */ - - FT_Error error; - - Int numTurns; /* number of Y-turns in outline */ - - TPoint* arc; /* current Bezier arc pointer */ - - UShort bWidth; /* target bitmap width */ - PByte bTarget; /* target bitmap buffer */ - PByte gTarget; /* target pixmap buffer */ - - Long lastX, lastY, minY, maxY; - - UShort num_Profs; /* current number of profiles */ - - Bool fresh; /* signals a fresh new profile which */ - /* 'start' field must be completed */ - Bool joint; /* signals that the last arc ended */ - /* exactly on a scanline. Allows */ - /* removal of doublets */ - PProfile cProfile; /* current profile */ - PProfile fProfile; /* head of linked list of profiles */ - PProfile gProfile; /* contour's first profile in case */ - /* of impact */ - - TStates state; /* rendering state */ - - FT_Bitmap target; /* description of target bit/pixmap */ - FT_Outline outline; - - Long traceOfs; /* current offset in target bitmap */ - Long traceG; /* current offset in target pixmap */ - - Short traceIncr; /* sweep's increment in target bitmap */ - - Short gray_min_x; /* current min x during gray rendering */ - Short gray_max_x; /* current max x during gray rendering */ - - /* dispatch variables */ - - Function_Sweep_Init* Proc_Sweep_Init; - Function_Sweep_Span* Proc_Sweep_Span; - Function_Sweep_Span* Proc_Sweep_Drop; - Function_Sweep_Step* Proc_Sweep_Step; - - Byte dropOutControl; /* current drop_out control method */ - - Bool second_pass; /* indicates whether a horizontal pass */ - /* should be performed to control */ - /* drop-out accurately when calling */ - /* Render_Glyph. Note that there is */ - /* no horizontal pass during gray */ - /* rendering. */ - - TPoint arcs[3 * MaxBezier + 1]; /* The Bezier stack */ - - TBand band_stack[16]; /* band stack used for sub-banding */ - Int band_top; /* band stack top */ - -#ifdef FT_RASTER_OPTION_ANTI_ALIASING - - Byte* grays; - - Byte gray_lines[RASTER_GRAY_LINES]; - /* Intermediate table used to render the */ - /* graylevels pixmaps. */ - /* gray_lines is a buffer holding two */ - /* monochrome scanlines */ - - Short gray_width; /* width in bytes of one monochrome */ - /* intermediate scanline of gray_lines. */ - /* Each gray pixel takes 2 bits long there */ - - /* The gray_lines must hold 2 lines, thus with size */ - /* in bytes of at least `gray_width*2'. */ - -#endif /* FT_RASTER_ANTI_ALIASING */ - - }; - - - typedef struct TRaster_ - { - char* buffer; - long buffer_size; - void* memory; - PWorker worker; - Byte grays[5]; - Short gray_width; - - } TRaster, *PRaster; - -#ifdef FT_STATIC_RASTER - - static TWorker cur_ras; -#define ras cur_ras - -#else - -#define ras (*worker) - -#endif /* FT_STATIC_RASTER */ - - -static const char count_table[256] = -{ - 0 , 1 , 1 , 2 , 1 , 2 , 2 , 3 , 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4, - 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, - 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, - 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, - 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, - 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, - 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, - 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, - 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, - 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, - 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, - 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, - 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, - 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, - 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, - 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7 , 5 , 6 , 6 , 7 , 6 , 7 , 7 , 8 }; - - - - /*************************************************************************/ - /*************************************************************************/ - /** **/ - /** PROFILES COMPUTATION **/ - /** **/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* Set_High_Precision */ - /* */ - /* */ - /* Sets precision variables according to param flag. */ - /* */ - /* */ - /* High :: Set to True for high precision (typically for ppem < 18), */ - /* false otherwise. */ - /* */ - static void - Set_High_Precision( RAS_ARGS Int High ) - { - if ( High ) - { - ras.precision_bits = 10; - ras.precision_step = 128; - ras.precision_jitter = 24; - } - else - { - ras.precision_bits = 6; - ras.precision_step = 32; - ras.precision_jitter = 2; - } - - FT_TRACE6(( "Set_High_Precision(%s)\n", High ? "true" : "false" )); - - ras.precision = 1 << ras.precision_bits; - ras.precision_half = ras.precision / 2; - ras.precision_shift = ras.precision_bits - Pixel_Bits; - ras.precision_mask = -ras.precision; - } - - - /*************************************************************************/ - /* */ - /* */ - /* New_Profile */ - /* */ - /* */ - /* Creates a new profile in the render pool. */ - /* */ - /* */ - /* aState :: The state/orientation of the new profile. */ - /* */ - /* */ - /* SUCCESS on success. FAILURE in case of overflow or of incoherent */ - /* profile. */ - /* */ - static Bool - New_Profile( RAS_ARGS TStates aState ) - { - if ( !ras.fProfile ) - { - ras.cProfile = (PProfile)ras.top; - ras.fProfile = ras.cProfile; - ras.top += AlignProfileSize; - } - - if ( ras.top >= ras.maxBuff ) - { - ras.error = Raster_Err_Overflow; - return FAILURE; - } - - switch ( aState ) - { - case Ascending_State: - ras.cProfile->flow = Flow_Up; - FT_TRACE6(( "New ascending profile = %lx\n", (long)ras.cProfile )); - break; - - case Descending_State: - ras.cProfile->flow = Flow_Down; - FT_TRACE6(( "New descending profile = %lx\n", (long)ras.cProfile )); - break; - - default: - FT_ERROR(( "New_Profile: invalid profile direction!\n" )); - ras.error = Raster_Err_Invalid; - return FAILURE; - } - - ras.cProfile->start = 0; - ras.cProfile->height = 0; - ras.cProfile->offset = ras.top; - ras.cProfile->link = (PProfile)0; - ras.cProfile->next = (PProfile)0; - - if ( !ras.gProfile ) - ras.gProfile = ras.cProfile; - - ras.state = aState; - ras.fresh = TRUE; - ras.joint = FALSE; - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* End_Profile */ - /* */ - /* */ - /* Finalizes the current profile. */ - /* */ - /* */ - /* SUCCESS on success. FAILURE in case of overflow or incoherency. */ - /* */ - static Bool - End_Profile( RAS_ARG ) - { - Long h; - PProfile oldProfile; - - - h = (Long)( ras.top - ras.cProfile->offset ); - - if ( h < 0 ) - { - FT_ERROR(( "End_Profile: negative height encountered!\n" )); - ras.error = Raster_Err_Neg_Height; - return FAILURE; - } - - if ( h > 0 ) - { - FT_TRACE6(( "Ending profile %lx, start = %ld, height = %ld\n", - (long)ras.cProfile, ras.cProfile->start, h )); - - oldProfile = ras.cProfile; - ras.cProfile->height = h; - ras.cProfile = (PProfile)ras.top; - - ras.top += AlignProfileSize; - - ras.cProfile->height = 0; - ras.cProfile->offset = ras.top; - oldProfile->next = ras.cProfile; - ras.num_Profs++; - } - - if ( ras.top >= ras.maxBuff ) - { - FT_TRACE1(( "overflow in End_Profile\n" )); - ras.error = Raster_Err_Overflow; - return FAILURE; - } - - ras.joint = FALSE; - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Insert_Y_Turn */ - /* */ - /* */ - /* Inserts a salient into the sorted list placed on top of the render */ - /* pool. */ - /* */ - /* */ - /* New y scanline position. */ - /* */ - /* */ - /* SUCCESS on success. FAILURE in case of overflow. */ - /* */ - static Bool - Insert_Y_Turn( RAS_ARGS Int y ) - { - PLong y_turns; - Int y2, n; - - - n = ras.numTurns - 1; - y_turns = ras.sizeBuff - ras.numTurns; - - /* look for first y value that is <= */ - while ( n >= 0 && y < y_turns[n] ) - n--; - - /* if it is <, simply insert it, ignore if == */ - if ( n >= 0 && y > y_turns[n] ) - while ( n >= 0 ) - { - y2 = (Int)y_turns[n]; - y_turns[n] = y; - y = y2; - n--; - } - - if ( n < 0 ) - { - ras.maxBuff--; - if ( ras.maxBuff <= ras.top ) - { - ras.error = Raster_Err_Overflow; - return FAILURE; - } - ras.numTurns++; - ras.sizeBuff[-ras.numTurns] = y; - } - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Finalize_Profile_Table */ - /* */ - /* */ - /* Adjusts all links in the profiles list. */ - /* */ - /* */ - /* SUCCESS on success. FAILURE in case of overflow. */ - /* */ - static Bool - Finalize_Profile_Table( RAS_ARG ) - { - Int bottom, top; - UShort n; - PProfile p; - - - n = ras.num_Profs; - - if ( n > 1 ) - { - p = ras.fProfile; - while ( n > 0 ) - { - if ( n > 1 ) - p->link = (PProfile)( p->offset + p->height ); - else - p->link = NULL; - - switch ( p->flow ) - { - case Flow_Down: - bottom = (Int)( p->start - p->height + 1 ); - top = (Int)p->start; - p->start = bottom; - p->offset += p->height - 1; - break; - - case Flow_Up: - default: - bottom = (Int)p->start; - top = (Int)( p->start + p->height - 1 ); - } - - if ( Insert_Y_Turn( RAS_VARS bottom ) || - Insert_Y_Turn( RAS_VARS top + 1 ) ) - return FAILURE; - - p = p->link; - n--; - } - } - else - ras.fProfile = NULL; - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Split_Conic */ - /* */ - /* */ - /* Subdivides one conic Bezier into two joint sub-arcs in the Bezier */ - /* stack. */ - /* */ - /* */ - /* None (subdivided Bezier is taken from the top of the stack). */ - /* */ - /* */ - /* This routine is the `beef' of this component. It is _the_ inner */ - /* loop that should be optimized to hell to get the best performance. */ - /* */ - static void - Split_Conic( TPoint* base ) - { - Long a, b; - - - base[4].x = base[2].x; - b = base[1].x; - a = base[3].x = ( base[2].x + b ) / 2; - b = base[1].x = ( base[0].x + b ) / 2; - base[2].x = ( a + b ) / 2; - - base[4].y = base[2].y; - b = base[1].y; - a = base[3].y = ( base[2].y + b ) / 2; - b = base[1].y = ( base[0].y + b ) / 2; - base[2].y = ( a + b ) / 2; - - /* hand optimized. gcc doesn't seem to be too good at common */ - /* expression substitution and instruction scheduling ;-) */ - } - - - /*************************************************************************/ - /* */ - /* */ - /* Split_Cubic */ - /* */ - /* */ - /* Subdivides a third-order Bezier arc into two joint sub-arcs in the */ - /* Bezier stack. */ - /* */ - /* */ - /* This routine is the `beef' of the component. It is one of _the_ */ - /* inner loops that should be optimized like hell to get the best */ - /* performance. */ - /* */ - static void - Split_Cubic( TPoint* base ) - { - Long a, b, c, d; - - - base[6].x = base[3].x; - c = base[1].x; - d = base[2].x; - base[1].x = a = ( base[0].x + c + 1 ) >> 1; - base[5].x = b = ( base[3].x + d + 1 ) >> 1; - c = ( c + d + 1 ) >> 1; - base[2].x = a = ( a + c + 1 ) >> 1; - base[4].x = b = ( b + c + 1 ) >> 1; - base[3].x = ( a + b + 1 ) >> 1; - - base[6].y = base[3].y; - c = base[1].y; - d = base[2].y; - base[1].y = a = ( base[0].y + c + 1 ) >> 1; - base[5].y = b = ( base[3].y + d + 1 ) >> 1; - c = ( c + d + 1 ) >> 1; - base[2].y = a = ( a + c + 1 ) >> 1; - base[4].y = b = ( b + c + 1 ) >> 1; - base[3].y = ( a + b + 1 ) >> 1; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Line_Up */ - /* */ - /* */ - /* Computes the x-coordinates of an ascending line segment and stores */ - /* them in the render pool. */ - /* */ - /* */ - /* x1 :: The x-coordinate of the segment's start point. */ - /* */ - /* y1 :: The y-coordinate of the segment's start point. */ - /* */ - /* x2 :: The x-coordinate of the segment's end point. */ - /* */ - /* y2 :: The y-coordinate of the segment's end point. */ - /* */ - /* miny :: A lower vertical clipping bound value. */ - /* */ - /* maxy :: An upper vertical clipping bound value. */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on render pool overflow. */ - /* */ - static Bool - Line_Up( RAS_ARGS Long x1, - Long y1, - Long x2, - Long y2, - Long miny, - Long maxy ) - { - Long Dx, Dy; - Int e1, e2, f1, f2, size; /* XXX: is `Short' sufficient? */ - Long Ix, Rx, Ax; - - PLong top; - - - Dx = x2 - x1; - Dy = y2 - y1; - - if ( Dy <= 0 || y2 < miny || y1 > maxy ) - return SUCCESS; - - if ( y1 < miny ) - { - /* Take care: miny-y1 can be a very large value; we use */ - /* a slow MulDiv function to avoid clipping bugs */ - x1 += SMulDiv( Dx, miny - y1, Dy ); - e1 = (Int)TRUNC( miny ); - f1 = 0; - } - else - { - e1 = (Int)TRUNC( y1 ); - f1 = (Int)FRAC( y1 ); - } - - if ( y2 > maxy ) - { - /* x2 += FMulDiv( Dx, maxy - y2, Dy ); UNNECESSARY */ - e2 = (Int)TRUNC( maxy ); - f2 = 0; - } - else - { - e2 = (Int)TRUNC( y2 ); - f2 = (Int)FRAC( y2 ); - } - - if ( f1 > 0 ) - { - if ( e1 == e2 ) - return SUCCESS; - else - { - x1 += FMulDiv( Dx, ras.precision - f1, Dy ); - e1 += 1; - } - } - else - if ( ras.joint ) - { - ras.top--; - ras.joint = FALSE; - } - - ras.joint = (char)( f2 == 0 ); - - if ( ras.fresh ) - { - ras.cProfile->start = e1; - ras.fresh = FALSE; - } - - size = e2 - e1 + 1; - if ( ras.top + size >= ras.maxBuff ) - { - ras.error = Raster_Err_Overflow; - return FAILURE; - } - - if ( Dx > 0 ) - { - Ix = ( ras.precision * Dx ) / Dy; - Rx = ( ras.precision * Dx ) % Dy; - Dx = 1; - } - else - { - Ix = -( ( ras.precision * -Dx ) / Dy ); - Rx = ( ras.precision * -Dx ) % Dy; - Dx = -1; - } - - Ax = -Dy; - top = ras.top; - - while ( size > 0 ) - { - *top++ = x1; - - x1 += Ix; - Ax += Rx; - if ( Ax >= 0 ) - { - Ax -= Dy; - x1 += Dx; - } - size--; - } - - ras.top = top; - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Line_Down */ - /* */ - /* */ - /* Computes the x-coordinates of an descending line segment and */ - /* stores them in the render pool. */ - /* */ - /* */ - /* x1 :: The x-coordinate of the segment's start point. */ - /* */ - /* y1 :: The y-coordinate of the segment's start point. */ - /* */ - /* x2 :: The x-coordinate of the segment's end point. */ - /* */ - /* y2 :: The y-coordinate of the segment's end point. */ - /* */ - /* miny :: A lower vertical clipping bound value. */ - /* */ - /* maxy :: An upper vertical clipping bound value. */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on render pool overflow. */ - /* */ - static Bool - Line_Down( RAS_ARGS Long x1, - Long y1, - Long x2, - Long y2, - Long miny, - Long maxy ) - { - Bool result, fresh; - - - fresh = ras.fresh; - - result = Line_Up( RAS_VARS x1, -y1, x2, -y2, -maxy, -miny ); - - if ( fresh && !ras.fresh ) - ras.cProfile->start = -ras.cProfile->start; - - return result; - } - - - /* A function type describing the functions used to split Bezier arcs */ - typedef void (*TSplitter)( TPoint* base ); - - - /*************************************************************************/ - /* */ - /* */ - /* Bezier_Up */ - /* */ - /* */ - /* Computes the x-coordinates of an ascending Bezier arc and stores */ - /* them in the render pool. */ - /* */ - /* */ - /* degree :: The degree of the Bezier arc (either 2 or 3). */ - /* */ - /* splitter :: The function to split Bezier arcs. */ - /* */ - /* miny :: A lower vertical clipping bound value. */ - /* */ - /* maxy :: An upper vertical clipping bound value. */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on render pool overflow. */ - /* */ - static Bool - Bezier_Up( RAS_ARGS Int degree, - TSplitter splitter, - Long miny, - Long maxy ) - { - Long y1, y2, e, e2, e0; - Short f1; - - TPoint* arc; - TPoint* start_arc; - - PLong top; - - - arc = ras.arc; - y1 = arc[degree].y; - y2 = arc[0].y; - top = ras.top; - - if ( y2 < miny || y1 > maxy ) - goto Fin; - - e2 = FLOOR( y2 ); - - if ( e2 > maxy ) - e2 = maxy; - - e0 = miny; - - if ( y1 < miny ) - e = miny; - else - { - e = CEILING( y1 ); - f1 = (Short)( FRAC( y1 ) ); - e0 = e; - - if ( f1 == 0 ) - { - if ( ras.joint ) - { - top--; - ras.joint = FALSE; - } - - *top++ = arc[degree].x; - - e += ras.precision; - } - } - - if ( ras.fresh ) - { - ras.cProfile->start = TRUNC( e0 ); - ras.fresh = FALSE; - } - - if ( e2 < e ) - goto Fin; - - if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff ) - { - ras.top = top; - ras.error = Raster_Err_Overflow; - return FAILURE; - } - - start_arc = arc; - - while ( arc >= start_arc && e <= e2 ) - { - ras.joint = FALSE; - - y2 = arc[0].y; - - if ( y2 > e ) - { - y1 = arc[degree].y; - if ( y2 - y1 >= ras.precision_step ) - { - splitter( arc ); - arc += degree; - } - else - { - *top++ = arc[degree].x + FMulDiv( arc[0].x-arc[degree].x, - e - y1, y2 - y1 ); - arc -= degree; - e += ras.precision; - } - } - else - { - if ( y2 == e ) - { - ras.joint = TRUE; - *top++ = arc[0].x; - - e += ras.precision; - } - arc -= degree; - } - } - - Fin: - ras.top = top; - ras.arc -= degree; - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Bezier_Down */ - /* */ - /* */ - /* Computes the x-coordinates of an descending Bezier arc and stores */ - /* them in the render pool. */ - /* */ - /* */ - /* degree :: The degree of the Bezier arc (either 2 or 3). */ - /* */ - /* splitter :: The function to split Bezier arcs. */ - /* */ - /* miny :: A lower vertical clipping bound value. */ - /* */ - /* maxy :: An upper vertical clipping bound value. */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on render pool overflow. */ - /* */ - static Bool - Bezier_Down( RAS_ARGS Int degree, - TSplitter splitter, - Long miny, - Long maxy ) - { - TPoint* arc = ras.arc; - Bool result, fresh; - - - arc[0].y = -arc[0].y; - arc[1].y = -arc[1].y; - arc[2].y = -arc[2].y; - if ( degree > 2 ) - arc[3].y = -arc[3].y; - - fresh = ras.fresh; - - result = Bezier_Up( RAS_VARS degree, splitter, -maxy, -miny ); - - if ( fresh && !ras.fresh ) - ras.cProfile->start = -ras.cProfile->start; - - arc[0].y = -arc[0].y; - return result; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Line_To */ - /* */ - /* */ - /* Injects a new line segment and adjusts Profiles list. */ - /* */ - /* */ - /* x :: The x-coordinate of the segment's end point (its start point */ - /* is stored in `lastX'). */ - /* */ - /* y :: The y-coordinate of the segment's end point (its start point */ - /* is stored in `lastY'). */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on render pool overflow or incorrect */ - /* profile. */ - /* */ - static Bool - Line_To( RAS_ARGS Long x, - Long y ) - { - /* First, detect a change of direction */ - - switch ( ras.state ) - { - case Unknown_State: - if ( y > ras.lastY ) - { - if ( New_Profile( RAS_VARS Ascending_State ) ) - return FAILURE; - } - else - { - if ( y < ras.lastY ) - if ( New_Profile( RAS_VARS Descending_State ) ) - return FAILURE; - } - break; - - case Ascending_State: - if ( y < ras.lastY ) - { - if ( End_Profile( RAS_VAR ) || - New_Profile( RAS_VARS Descending_State ) ) - return FAILURE; - } - break; - - case Descending_State: - if ( y > ras.lastY ) - { - if ( End_Profile( RAS_VAR ) || - New_Profile( RAS_VARS Ascending_State ) ) - return FAILURE; - } - break; - - default: - ; - } - - /* Then compute the lines */ - - switch ( ras.state ) - { - case Ascending_State: - if ( Line_Up( RAS_VARS ras.lastX, ras.lastY, - x, y, ras.minY, ras.maxY ) ) - return FAILURE; - break; - - case Descending_State: - if ( Line_Down( RAS_VARS ras.lastX, ras.lastY, - x, y, ras.minY, ras.maxY ) ) - return FAILURE; - break; - - default: - ; - } - - ras.lastX = x; - ras.lastY = y; - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Conic_To */ - /* */ - /* */ - /* Injects a new conic arc and adjusts the profile list. */ - /* */ - /* */ - /* cx :: The x-coordinate of the arc's new control point. */ - /* */ - /* cy :: The y-coordinate of the arc's new control point. */ - /* */ - /* x :: The x-coordinate of the arc's end point (its start point is */ - /* stored in `lastX'). */ - /* */ - /* y :: The y-coordinate of the arc's end point (its start point is */ - /* stored in `lastY'). */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on render pool overflow or incorrect */ - /* profile. */ - /* */ - static Bool - Conic_To( RAS_ARGS Long cx, - Long cy, - Long x, - Long y ) - { - Long y1, y2, y3, x3, ymin, ymax; - TStates state_bez; - - - ras.arc = ras.arcs; - ras.arc[2].x = ras.lastX; - ras.arc[2].y = ras.lastY; - ras.arc[1].x = cx; ras.arc[1].y = cy; - ras.arc[0].x = x; ras.arc[0].y = y; - - do - { - y1 = ras.arc[2].y; - y2 = ras.arc[1].y; - y3 = ras.arc[0].y; - x3 = ras.arc[0].x; - - /* first, categorize the Bezier arc */ - - if ( y1 <= y3 ) - { - ymin = y1; - ymax = y3; - } - else - { - ymin = y3; - ymax = y1; - } - - if ( y2 < ymin || y2 > ymax ) - { - /* this arc has no given direction, split it! */ - Split_Conic( ras.arc ); - ras.arc += 2; - } - else if ( y1 == y3 ) - { - /* this arc is flat, ignore it and pop it from the Bezier stack */ - ras.arc -= 2; - } - else - { - /* the arc is y-monotonous, either ascending or descending */ - /* detect a change of direction */ - state_bez = y1 < y3 ? Ascending_State : Descending_State; - if ( ras.state != state_bez ) - { - /* finalize current profile if any */ - if ( ras.state != Unknown_State && - End_Profile( RAS_VAR ) ) - goto Fail; - - /* create a new profile */ - if ( New_Profile( RAS_VARS state_bez ) ) - goto Fail; - } - - /* now call the appropriate routine */ - if ( state_bez == Ascending_State ) - { - if ( Bezier_Up( RAS_VARS 2, Split_Conic, ras.minY, ras.maxY ) ) - goto Fail; - } - else - if ( Bezier_Down( RAS_VARS 2, Split_Conic, ras.minY, ras.maxY ) ) - goto Fail; - } - - } while ( ras.arc >= ras.arcs ); - - ras.lastX = x3; - ras.lastY = y3; - - return SUCCESS; - - Fail: - return FAILURE; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Cubic_To */ - /* */ - /* */ - /* Injects a new cubic arc and adjusts the profile list. */ - /* */ - /* */ - /* cx1 :: The x-coordinate of the arc's first new control point. */ - /* */ - /* cy1 :: The y-coordinate of the arc's first new control point. */ - /* */ - /* cx2 :: The x-coordinate of the arc's second new control point. */ - /* */ - /* cy2 :: The y-coordinate of the arc's second new control point. */ - /* */ - /* x :: The x-coordinate of the arc's end point (its start point is */ - /* stored in `lastX'). */ - /* */ - /* y :: The y-coordinate of the arc's end point (its start point is */ - /* stored in `lastY'). */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on render pool overflow or incorrect */ - /* profile. */ - /* */ - static Bool - Cubic_To( RAS_ARGS Long cx1, - Long cy1, - Long cx2, - Long cy2, - Long x, - Long y ) - { - Long y1, y2, y3, y4, x4, ymin1, ymax1, ymin2, ymax2; - TStates state_bez; - - - ras.arc = ras.arcs; - ras.arc[3].x = ras.lastX; - ras.arc[3].y = ras.lastY; - ras.arc[2].x = cx1; ras.arc[2].y = cy1; - ras.arc[1].x = cx2; ras.arc[1].y = cy2; - ras.arc[0].x = x; ras.arc[0].y = y; - - do - { - y1 = ras.arc[3].y; - y2 = ras.arc[2].y; - y3 = ras.arc[1].y; - y4 = ras.arc[0].y; - x4 = ras.arc[0].x; - - /* first, categorize the Bezier arc */ - - if ( y1 <= y4 ) - { - ymin1 = y1; - ymax1 = y4; - } - else - { - ymin1 = y4; - ymax1 = y1; - } - - if ( y2 <= y3 ) - { - ymin2 = y2; - ymax2 = y3; - } - else - { - ymin2 = y3; - ymax2 = y2; - } - - if ( ymin2 < ymin1 || ymax2 > ymax1 ) - { - /* this arc has no given direction, split it! */ - Split_Cubic( ras.arc ); - ras.arc += 3; - } - else if ( y1 == y4 ) - { - /* this arc is flat, ignore it and pop it from the Bezier stack */ - ras.arc -= 3; - } - else - { - state_bez = ( y1 <= y4 ) ? Ascending_State : Descending_State; - - /* detect a change of direction */ - if ( ras.state != state_bez ) - { - if ( ras.state != Unknown_State && - End_Profile( RAS_VAR ) ) - goto Fail; - - if ( New_Profile( RAS_VARS state_bez ) ) - goto Fail; - } - - /* compute intersections */ - if ( state_bez == Ascending_State ) - { - if ( Bezier_Up( RAS_VARS 3, Split_Cubic, ras.minY, ras.maxY ) ) - goto Fail; - } - else - if ( Bezier_Down( RAS_VARS 3, Split_Cubic, ras.minY, ras.maxY ) ) - goto Fail; - } - - } while ( ras.arc >= ras.arcs ); - - ras.lastX = x4; - ras.lastY = y4; - - return SUCCESS; - - Fail: - return FAILURE; - } - - -#undef SWAP_ -#define SWAP_( x, y ) do \ - { \ - Long swap = x; \ - \ - \ - x = y; \ - y = swap; \ - } while ( 0 ) - - - /*************************************************************************/ - /* */ - /* */ - /* Decompose_Curve */ - /* */ - /* */ - /* Scans the outline arrays in order to emit individual segments and */ - /* Beziers by calling Line_To() and Bezier_To(). It handles all */ - /* weird cases, like when the first point is off the curve, or when */ - /* there are simply no `on' points in the contour! */ - /* */ - /* */ - /* first :: The index of the first point in the contour. */ - /* */ - /* last :: The index of the last point in the contour. */ - /* */ - /* flipped :: If set, flip the direction of the curve. */ - /* */ - /* */ - /* SUCCESS on success, FAILURE on error. */ - /* */ - static Bool - Decompose_Curve( RAS_ARGS UShort first, - UShort last, - int flipped ) - { - FT_Vector v_last; - FT_Vector v_control; - FT_Vector v_start; - - FT_Vector* points; - FT_Vector* point; - FT_Vector* limit; - char* tags; - - unsigned tag; /* current point's state */ - - - points = ras.outline.points; - limit = points + last; - - v_start.x = SCALED( points[first].x ); - v_start.y = SCALED( points[first].y ); - v_last.x = SCALED( points[last].x ); - v_last.y = SCALED( points[last].y ); - - if ( flipped ) - { - SWAP_( v_start.x, v_start.y ); - SWAP_( v_last.x, v_last.y ); - } - - v_control = v_start; - - point = points + first; - tags = ras.outline.tags + first; - tag = FT_CURVE_TAG( tags[0] ); - - /* A contour cannot start with a cubic control point! */ - if ( tag == FT_CURVE_TAG_CUBIC ) - goto Invalid_Outline; - - /* check first point to determine origin */ - if ( tag == FT_CURVE_TAG_CONIC ) - { - /* first point is conic control. Yes, this happens. */ - if ( FT_CURVE_TAG( ras.outline.tags[last] ) == FT_CURVE_TAG_ON ) - { - /* start at last point if it is on the curve */ - v_start = v_last; - limit--; - } - else - { - /* if both first and last points are conic, */ - /* start at their middle and record its position */ - /* for closure */ - v_start.x = ( v_start.x + v_last.x ) / 2; - v_start.y = ( v_start.y + v_last.y ) / 2; - - v_last = v_start; - } - point--; - tags--; - } - - ras.lastX = v_start.x; - ras.lastY = v_start.y; - - while ( point < limit ) - { - point++; - tags++; - - tag = FT_CURVE_TAG( tags[0] ); - - switch ( tag ) - { - case FT_CURVE_TAG_ON: /* emit a single line_to */ - { - Long x, y; - - - x = SCALED( point->x ); - y = SCALED( point->y ); - if ( flipped ) - SWAP_( x, y ); - - if ( Line_To( RAS_VARS x, y ) ) - goto Fail; - continue; - } - - case FT_CURVE_TAG_CONIC: /* consume conic arcs */ - v_control.x = SCALED( point[0].x ); - v_control.y = SCALED( point[0].y ); - - if ( flipped ) - SWAP_( v_control.x, v_control.y ); - - Do_Conic: - if ( point < limit ) - { - FT_Vector v_middle; - Long x, y; - - - point++; - tags++; - tag = FT_CURVE_TAG( tags[0] ); - - x = SCALED( point[0].x ); - y = SCALED( point[0].y ); - - if ( flipped ) - SWAP_( x, y ); - - if ( tag == FT_CURVE_TAG_ON ) - { - if ( Conic_To( RAS_VARS v_control.x, v_control.y, x, y ) ) - goto Fail; - continue; - } - - if ( tag != FT_CURVE_TAG_CONIC ) - goto Invalid_Outline; - - v_middle.x = ( v_control.x + x ) / 2; - v_middle.y = ( v_control.y + y ) / 2; - - if ( Conic_To( RAS_VARS v_control.x, v_control.y, - v_middle.x, v_middle.y ) ) - goto Fail; - - v_control.x = x; - v_control.y = y; - - goto Do_Conic; - } - - if ( Conic_To( RAS_VARS v_control.x, v_control.y, - v_start.x, v_start.y ) ) - goto Fail; - - goto Close; - - default: /* FT_CURVE_TAG_CUBIC */ - { - Long x1, y1, x2, y2, x3, y3; - - - if ( point + 1 > limit || - FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) - goto Invalid_Outline; - - point += 2; - tags += 2; - - x1 = SCALED( point[-2].x ); - y1 = SCALED( point[-2].y ); - x2 = SCALED( point[-1].x ); - y2 = SCALED( point[-1].y ); - x3 = SCALED( point[ 0].x ); - y3 = SCALED( point[ 0].y ); - - if ( flipped ) - { - SWAP_( x1, y1 ); - SWAP_( x2, y2 ); - SWAP_( x3, y3 ); - } - - if ( point <= limit ) - { - if ( Cubic_To( RAS_VARS x1, y1, x2, y2, x3, y3 ) ) - goto Fail; - continue; - } - - if ( Cubic_To( RAS_VARS x1, y1, x2, y2, v_start.x, v_start.y ) ) - goto Fail; - goto Close; - } - } - } - - /* close the contour with a line segment */ - if ( Line_To( RAS_VARS v_start.x, v_start.y ) ) - goto Fail; - - Close: - return SUCCESS; - - Invalid_Outline: - ras.error = Raster_Err_Invalid; - - Fail: - return FAILURE; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Convert_Glyph */ - /* */ - /* */ - /* Converts a glyph into a series of segments and arcs and makes a */ - /* profiles list with them. */ - /* */ - /* */ - /* flipped :: If set, flip the direction of curve. */ - /* */ - /* */ - /* SUCCESS on success, FAILURE if any error was encountered during */ - /* rendering. */ - /* */ - static Bool - Convert_Glyph( RAS_ARGS int flipped ) - { - int i; - unsigned start; - - PProfile lastProfile; - - - ras.fProfile = NULL; - ras.joint = FALSE; - ras.fresh = FALSE; - - ras.maxBuff = ras.sizeBuff - AlignProfileSize; - - ras.numTurns = 0; - - ras.cProfile = (PProfile)ras.top; - ras.cProfile->offset = ras.top; - ras.num_Profs = 0; - - start = 0; - - for ( i = 0; i < ras.outline.n_contours; i++ ) - { - ras.state = Unknown_State; - ras.gProfile = NULL; - - if ( Decompose_Curve( RAS_VARS (unsigned short)start, - ras.outline.contours[i], - flipped ) ) - return FAILURE; - - start = ras.outline.contours[i] + 1; - - /* We must now see whether the extreme arcs join or not */ - if ( FRAC( ras.lastY ) == 0 && - ras.lastY >= ras.minY && - ras.lastY <= ras.maxY ) - if ( ras.gProfile && ras.gProfile->flow == ras.cProfile->flow ) - ras.top--; - /* Note that ras.gProfile can be nil if the contour was too small */ - /* to be drawn. */ - - lastProfile = ras.cProfile; - if ( End_Profile( RAS_VAR ) ) - return FAILURE; - - /* close the `next profile in contour' linked list */ - if ( ras.gProfile ) - lastProfile->next = ras.gProfile; - } - - if ( Finalize_Profile_Table( RAS_VAR ) ) - return FAILURE; - - return (Bool)( ras.top < ras.maxBuff ? SUCCESS : FAILURE ); - } - - - /*************************************************************************/ - /*************************************************************************/ - /** **/ - /** SCAN-LINE SWEEPS AND DRAWING **/ - /** **/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Init_Linked */ - /* */ - /* Initializes an empty linked list. */ - /* */ - static void - Init_Linked( TProfileList* l ) - { - *l = NULL; - } - - - /*************************************************************************/ - /* */ - /* InsNew */ - /* */ - /* Inserts a new profile in a linked list. */ - /* */ - static void - InsNew( PProfileList list, - PProfile profile ) - { - PProfile *old, current; - Long x; - - - old = list; - current = *old; - x = profile->X; - - while ( current ) - { - if ( x < current->X ) - break; - old = ¤t->link; - current = *old; - } - - profile->link = current; - *old = profile; - } - - - /*************************************************************************/ - /* */ - /* DelOld */ - /* */ - /* Removes an old profile from a linked list. */ - /* */ - static void - DelOld( PProfileList list, - PProfile profile ) - { - PProfile *old, current; - - - old = list; - current = *old; - - while ( current ) - { - if ( current == profile ) - { - *old = current->link; - return; - } - - old = ¤t->link; - current = *old; - } - - /* we should never get there, unless the profile was not part of */ - /* the list. */ - } - - - /*************************************************************************/ - /* */ - /* Sort */ - /* */ - /* Sorts a trace list. In 95%, the list is already sorted. We need */ - /* an algorithm which is fast in this case. Bubble sort is enough */ - /* and simple. */ - /* */ - static void - Sort( PProfileList list ) - { - PProfile *old, current, next; - - - /* First, set the new X coordinate of each profile */ - current = *list; - while ( current ) - { - current->X = *current->offset; - current->offset += current->flow; - current->height--; - current = current->link; - } - - /* Then sort them */ - old = list; - current = *old; - - if ( !current ) - return; - - next = current->link; - - while ( next ) - { - if ( current->X <= next->X ) - { - old = ¤t->link; - current = *old; - - if ( !current ) - return; - } - else - { - *old = next; - current->link = next->link; - next->link = current; - - old = list; - current = *old; - } - - next = current->link; - } - } - - - /*************************************************************************/ - /* */ - /* Vertical Sweep Procedure Set */ - /* */ - /* These four routines are used during the vertical black/white sweep */ - /* phase by the generic Draw_Sweep() function. */ - /* */ - /*************************************************************************/ - - static void - Vertical_Sweep_Init( RAS_ARGS Short* min, - Short* max ) - { - Long pitch = ras.target.pitch; - - FT_UNUSED( max ); - - - ras.traceIncr = (Short)-pitch; - ras.traceOfs = -*min * pitch; - if ( pitch > 0 ) - ras.traceOfs += ( ras.target.rows - 1 ) * pitch; - - ras.gray_min_x = 0; - ras.gray_max_x = 0; - } - - - static void - Vertical_Sweep_Span( RAS_ARGS Short y, - FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) - { - Long e1, e2; - int c1, c2; - Byte f1, f2; - Byte* target; - - FT_UNUSED( y ); - FT_UNUSED( left ); - FT_UNUSED( right ); - - - /* Drop-out control */ - - e1 = TRUNC( CEILING( x1 ) ); - - if ( x2 - x1 - ras.precision <= ras.precision_jitter ) - e2 = e1; - else - e2 = TRUNC( FLOOR( x2 ) ); - - if ( e2 >= 0 && e1 < ras.bWidth ) - { - if ( e1 < 0 ) - e1 = 0; - if ( e2 >= ras.bWidth ) - e2 = ras.bWidth - 1; - - c1 = (Short)( e1 >> 3 ); - c2 = (Short)( e2 >> 3 ); - - f1 = (Byte) ( 0xFF >> ( e1 & 7 ) ); - f2 = (Byte) ~( 0x7F >> ( e2 & 7 ) ); - - if ( ras.gray_min_x > c1 ) ras.gray_min_x = (short)c1; - if ( ras.gray_max_x < c2 ) ras.gray_max_x = (short)c2; - - target = ras.bTarget + ras.traceOfs + c1; - c2 -= c1; - - if ( c2 > 0 ) - { - target[0] |= f1; - - /* memset() is slower than the following code on many platforms. */ - /* This is due to the fact that, in the vast majority of cases, */ - /* the span length in bytes is relatively small. */ - c2--; - while ( c2 > 0 ) - { - *(++target) = 0xFF; - c2--; - } - target[1] |= f2; - } - else - *target |= ( f1 & f2 ); - } - } - - - static void - Vertical_Sweep_Drop( RAS_ARGS Short y, - FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) - { - Long e1, e2; - Short c1, f1; - - - /* Drop-out control */ - - e1 = CEILING( x1 ); - e2 = FLOOR ( x2 ); - - if ( e1 > e2 ) - { - if ( e1 == e2 + ras.precision ) - { - switch ( ras.dropOutControl ) - { - case 1: - e1 = e2; - break; - - case 4: - e1 = CEILING( (x1 + x2 + 1) / 2 ); - break; - - case 2: - case 5: - /* Drop-out Control Rule #4 */ - - /* The spec is not very clear regarding rule #4. It */ - /* presents a method that is way too costly to implement */ - /* while the general idea seems to get rid of `stubs'. */ - /* */ - /* Here, we only get rid of stubs recognized if: */ - /* */ - /* upper stub: */ - /* */ - /* - P_Left and P_Right are in the same contour */ - /* - P_Right is the successor of P_Left in that contour */ - /* - y is the top of P_Left and P_Right */ - /* */ - /* lower stub: */ - /* */ - /* - P_Left and P_Right are in the same contour */ - /* - P_Left is the successor of P_Right in that contour */ - /* - y is the bottom of P_Left */ - /* */ - - /* FIXXXME: uncommenting this line solves the disappearing */ - /* bit problem in the `7' of verdana 10pts, but */ - /* makes a new one in the `C' of arial 14pts */ - -#if 0 - if ( x2 - x1 < ras.precision_half ) -#endif - { - /* upper stub test */ - if ( left->next == right && left->height <= 0 ) - return; - - /* lower stub test */ - if ( right->next == left && left->start == y ) - return; - } - - /* check that the rightmost pixel isn't set */ - - e1 = TRUNC( e1 ); - - c1 = (Short)( e1 >> 3 ); - f1 = (Short)( e1 & 7 ); - - if ( e1 >= 0 && e1 < ras.bWidth && - ras.bTarget[ras.traceOfs + c1] & ( 0x80 >> f1 ) ) - return; - - if ( ras.dropOutControl == 2 ) - e1 = e2; - else - e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); - - break; - - default: - return; /* unsupported mode */ - } - } - else - return; - } - - e1 = TRUNC( e1 ); - - if ( e1 >= 0 && e1 < ras.bWidth ) - { - c1 = (Short)( e1 >> 3 ); - f1 = (Short)( e1 & 7 ); - - if ( ras.gray_min_x > c1 ) ras.gray_min_x = c1; - if ( ras.gray_max_x < c1 ) ras.gray_max_x = c1; - - ras.bTarget[ras.traceOfs + c1] |= (char)( 0x80 >> f1 ); - } - } - - - static void - Vertical_Sweep_Step( RAS_ARG ) - { - ras.traceOfs += ras.traceIncr; - } - - - /***********************************************************************/ - /* */ - /* Horizontal Sweep Procedure Set */ - /* */ - /* These four routines are used during the horizontal black/white */ - /* sweep phase by the generic Draw_Sweep() function. */ - /* */ - /***********************************************************************/ - - static void - Horizontal_Sweep_Init( RAS_ARGS Short* min, - Short* max ) - { - /* nothing, really */ - FT_UNUSED_RASTER; - FT_UNUSED( min ); - FT_UNUSED( max ); - } - - - static void - Horizontal_Sweep_Span( RAS_ARGS Short y, - FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) - { - Long e1, e2; - PByte bits; - Byte f1; - - FT_UNUSED( left ); - FT_UNUSED( right ); - - - if ( x2 - x1 < ras.precision ) - { - e1 = CEILING( x1 ); - e2 = FLOOR ( x2 ); - - if ( e1 == e2 ) - { - bits = ras.bTarget + ( y >> 3 ); - f1 = (Byte)( 0x80 >> ( y & 7 ) ); - - e1 = TRUNC( e1 ); - - if ( e1 >= 0 && e1 < ras.target.rows ) - { - PByte p; - - - p = bits - e1*ras.target.pitch; - if ( ras.target.pitch > 0 ) - p += ( ras.target.rows - 1 ) * ras.target.pitch; - - p[0] |= f1; - } - } - } - } - - - static void - Horizontal_Sweep_Drop( RAS_ARGS Short y, - FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) - { - Long e1, e2; - PByte bits; - Byte f1; - - - /* During the horizontal sweep, we only take care of drop-outs */ - - e1 = CEILING( x1 ); - e2 = FLOOR ( x2 ); - - if ( e1 > e2 ) - { - if ( e1 == e2 + ras.precision ) - { - switch ( ras.dropOutControl ) - { - case 1: - e1 = e2; - break; - - case 4: - e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); - break; - - case 2: - case 5: - - /* Drop-out Control Rule #4 */ - - /* The spec is not very clear regarding rule #4. It */ - /* presents a method that is way too costly to implement */ - /* while the general idea seems to get rid of `stubs'. */ - /* */ - - /* rightmost stub test */ - if ( left->next == right && left->height <= 0 ) - return; - - /* leftmost stub test */ - if ( right->next == left && left->start == y ) - return; - - /* check that the rightmost pixel isn't set */ - - e1 = TRUNC( e1 ); - - bits = ras.bTarget + ( y >> 3 ); - f1 = (Byte)( 0x80 >> ( y & 7 ) ); - - bits -= e1 * ras.target.pitch; - if ( ras.target.pitch > 0 ) - bits += ( ras.target.rows - 1 ) * ras.target.pitch; - - if ( e1 >= 0 && - e1 < ras.target.rows && - *bits & f1 ) - return; - - if ( ras.dropOutControl == 2 ) - e1 = e2; - else - e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); - - break; - - default: - return; /* unsupported mode */ - } - } - else - return; - } - - bits = ras.bTarget + ( y >> 3 ); - f1 = (Byte)( 0x80 >> ( y & 7 ) ); - - e1 = TRUNC( e1 ); - - if ( e1 >= 0 && e1 < ras.target.rows ) - { - bits -= e1 * ras.target.pitch; - if ( ras.target.pitch > 0 ) - bits += ( ras.target.rows - 1 ) * ras.target.pitch; - - bits[0] |= f1; - } - } - - - static void - Horizontal_Sweep_Step( RAS_ARG ) - { - /* Nothing, really */ - FT_UNUSED_RASTER; - } - - -#ifdef FT_RASTER_OPTION_ANTI_ALIASING - - - /*************************************************************************/ - /* */ - /* Vertical Gray Sweep Procedure Set */ - /* */ - /* These two routines are used during the vertical gray-levels sweep */ - /* phase by the generic Draw_Sweep() function. */ - /* */ - /* NOTES */ - /* */ - /* - The target pixmap's width *must* be a multiple of 4. */ - /* */ - /* - You have to use the function Vertical_Sweep_Span() for the gray */ - /* span call. */ - /* */ - /*************************************************************************/ - - static void - Vertical_Gray_Sweep_Init( RAS_ARGS Short* min, - Short* max ) - { - Long pitch, byte_len; - - - *min = *min & -2; - *max = ( *max + 3 ) & -2; - - ras.traceOfs = 0; - pitch = ras.target.pitch; - byte_len = -pitch; - ras.traceIncr = (Short)byte_len; - ras.traceG = ( *min / 2 ) * byte_len; - - if ( pitch > 0 ) - { - ras.traceG += ( ras.target.rows - 1 ) * pitch; - byte_len = -byte_len; - } - - ras.gray_min_x = (Short)byte_len; - ras.gray_max_x = -(Short)byte_len; - } - - - static void - Vertical_Gray_Sweep_Step( RAS_ARG ) - { - Int c1, c2; - PByte pix, bit, bit2; - char* count = (char*)count_table; - Byte* grays; - - - ras.traceOfs += ras.gray_width; - - if ( ras.traceOfs > ras.gray_width ) - { - pix = ras.gTarget + ras.traceG + ras.gray_min_x * 4; - grays = ras.grays; - - if ( ras.gray_max_x >= 0 ) - { - Long last_pixel = ras.target.width - 1; - Int last_cell = last_pixel >> 2; - Int last_bit = last_pixel & 3; - Bool over = 0; - - - if ( ras.gray_max_x >= last_cell && last_bit != 3 ) - { - ras.gray_max_x = last_cell - 1; - over = 1; - } - - if ( ras.gray_min_x < 0 ) - ras.gray_min_x = 0; - - bit = ras.bTarget + ras.gray_min_x; - bit2 = bit + ras.gray_width; - - c1 = ras.gray_max_x - ras.gray_min_x; - - while ( c1 >= 0 ) - { - c2 = count[*bit] + count[*bit2]; - - if ( c2 ) - { - pix[0] = grays[(c2 >> 12) & 0x000F]; - pix[1] = grays[(c2 >> 8 ) & 0x000F]; - pix[2] = grays[(c2 >> 4 ) & 0x000F]; - pix[3] = grays[ c2 & 0x000F]; - - *bit = 0; - *bit2 = 0; - } - - bit++; - bit2++; - pix += 4; - c1--; - } - - if ( over ) - { - c2 = count[*bit] + count[*bit2]; - if ( c2 ) - { - switch ( last_bit ) - { - case 2: - pix[2] = grays[(c2 >> 4 ) & 0x000F]; - case 1: - pix[1] = grays[(c2 >> 8 ) & 0x000F]; - default: - pix[0] = grays[(c2 >> 12) & 0x000F]; - } - - *bit = 0; - *bit2 = 0; - } - } - } - - ras.traceOfs = 0; - ras.traceG += ras.traceIncr; - - ras.gray_min_x = 32000; - ras.gray_max_x = -32000; - } - } - - - static void - Horizontal_Gray_Sweep_Span( RAS_ARGS Short y, - FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) - { - /* nothing, really */ - FT_UNUSED_RASTER; - FT_UNUSED( y ); - FT_UNUSED( x1 ); - FT_UNUSED( x2 ); - FT_UNUSED( left ); - FT_UNUSED( right ); - } - - - static void - Horizontal_Gray_Sweep_Drop( RAS_ARGS Short y, - FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) - { - Long e1, e2; - PByte pixel; - Byte color; - - - /* During the horizontal sweep, we only take care of drop-outs */ - e1 = CEILING( x1 ); - e2 = FLOOR ( x2 ); - - if ( e1 > e2 ) - { - if ( e1 == e2 + ras.precision ) - { - switch ( ras.dropOutControl ) - { - case 1: - e1 = e2; - break; - - case 4: - e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); - break; - - case 2: - case 5: - - /* Drop-out Control Rule #4 */ - - /* The spec is not very clear regarding rule #4. It */ - /* presents a method that is way too costly to implement */ - /* while the general idea seems to get rid of `stubs'. */ - /* */ - - /* rightmost stub test */ - if ( left->next == right && left->height <= 0 ) - return; - - /* leftmost stub test */ - if ( right->next == left && left->start == y ) - return; - - if ( ras.dropOutControl == 2 ) - e1 = e2; - else - e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); - - break; - - default: - return; /* unsupported mode */ - } - } - else - return; - } - - if ( e1 >= 0 ) - { - if ( x2 - x1 >= ras.precision_half ) - color = ras.grays[2]; - else - color = ras.grays[1]; - - e1 = TRUNC( e1 ) / 2; - if ( e1 < ras.target.rows ) - { - pixel = ras.gTarget - e1 * ras.target.pitch + y / 2; - if ( ras.target.pitch > 0 ) - pixel += ( ras.target.rows - 1 ) * ras.target.pitch; - - if ( pixel[0] == ras.grays[0] ) - pixel[0] = color; - } - } - } - - -#endif /* FT_RASTER_OPTION_ANTI_ALIASING */ - - - /*************************************************************************/ - /* */ - /* Generic Sweep Drawing routine */ - /* */ - /*************************************************************************/ - - static Bool - Draw_Sweep( RAS_ARG ) - { - Short y, y_change, y_height; - - PProfile P, Q, P_Left, P_Right; - - Short min_Y, max_Y, top, bottom, dropouts; - - Long x1, x2, xs, e1, e2; - - TProfileList waiting; - TProfileList draw_left, draw_right; - - - /* Init empty linked lists */ - - Init_Linked( &waiting ); - - Init_Linked( &draw_left ); - Init_Linked( &draw_right ); - - /* first, compute min and max Y */ - - P = ras.fProfile; - max_Y = (Short)TRUNC( ras.minY ); - min_Y = (Short)TRUNC( ras.maxY ); - - while ( P ) - { - Q = P->link; - - bottom = (Short)P->start; - top = (Short)( P->start + P->height - 1 ); - - if ( min_Y > bottom ) min_Y = bottom; - if ( max_Y < top ) max_Y = top; - - P->X = 0; - InsNew( &waiting, P ); - - P = Q; - } - - /* Check the Y-turns */ - if ( ras.numTurns == 0 ) - { - ras.error = Raster_Err_Invalid; - return FAILURE; - } - - /* Now inits the sweep */ - - ras.Proc_Sweep_Init( RAS_VARS &min_Y, &max_Y ); - - /* Then compute the distance of each profile from min_Y */ - - P = waiting; - - while ( P ) - { - P->countL = (UShort)( P->start - min_Y ); - P = P->link; - } - - /* Let's go */ - - y = min_Y; - y_height = 0; - - if ( ras.numTurns > 0 && - ras.sizeBuff[-ras.numTurns] == min_Y ) - ras.numTurns--; - - while ( ras.numTurns > 0 ) - { - /* look in the waiting list for new activations */ - - P = waiting; - - while ( P ) - { - Q = P->link; - P->countL -= y_height; - if ( P->countL == 0 ) - { - DelOld( &waiting, P ); - - switch ( P->flow ) - { - case Flow_Up: - InsNew( &draw_left, P ); - break; - - case Flow_Down: - InsNew( &draw_right, P ); - break; - } - } - - P = Q; - } - - /* Sort the drawing lists */ - - Sort( &draw_left ); - Sort( &draw_right ); - - y_change = (Short)ras.sizeBuff[-ras.numTurns--]; - y_height = (Short)( y_change - y ); - - while ( y < y_change ) - { - /* Let's trace */ - - dropouts = 0; - - P_Left = draw_left; - P_Right = draw_right; - - while ( P_Left ) - { - x1 = P_Left ->X; - x2 = P_Right->X; - - if ( x1 > x2 ) - { - xs = x1; - x1 = x2; - x2 = xs; - } - - if ( x2 - x1 <= ras.precision ) - { - e1 = FLOOR( x1 ); - e2 = CEILING( x2 ); - - if ( ras.dropOutControl != 0 && - ( e1 > e2 || e2 == e1 + ras.precision ) ) - { - /* a drop out was detected */ - - P_Left ->X = x1; - P_Right->X = x2; - - /* mark profile for drop-out processing */ - P_Left->countL = 1; - dropouts++; - - goto Skip_To_Next; - } - } - - ras.Proc_Sweep_Span( RAS_VARS y, x1, x2, P_Left, P_Right ); - - Skip_To_Next: - - P_Left = P_Left->link; - P_Right = P_Right->link; - } - - /* now perform the dropouts _after_ the span drawing -- */ - /* drop-outs processing has been moved out of the loop */ - /* for performance tuning */ - if ( dropouts > 0 ) - goto Scan_DropOuts; - - Next_Line: - - ras.Proc_Sweep_Step( RAS_VAR ); - - y++; - - if ( y < y_change ) - { - Sort( &draw_left ); - Sort( &draw_right ); - } - } - - /* Now finalize the profiles that needs it */ - - P = draw_left; - while ( P ) - { - Q = P->link; - if ( P->height == 0 ) - DelOld( &draw_left, P ); - P = Q; - } - - P = draw_right; - while ( P ) - { - Q = P->link; - if ( P->height == 0 ) - DelOld( &draw_right, P ); - P = Q; - } - } - - /* for gray-scaling, flushes the bitmap scanline cache */ - while ( y <= max_Y ) - { - ras.Proc_Sweep_Step( RAS_VAR ); - y++; - } - - return SUCCESS; - - Scan_DropOuts: - - P_Left = draw_left; - P_Right = draw_right; - - while ( P_Left ) - { - if ( P_Left->countL ) - { - P_Left->countL = 0; -#if 0 - dropouts--; /* -- this is useful when debugging only */ -#endif - ras.Proc_Sweep_Drop( RAS_VARS y, - P_Left->X, - P_Right->X, - P_Left, - P_Right ); - } - - P_Left = P_Left->link; - P_Right = P_Right->link; - } - - goto Next_Line; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Render_Single_Pass */ - /* */ - /* */ - /* Performs one sweep with sub-banding. */ - /* */ - /* */ - /* flipped :: If set, flip the direction of the outline. */ - /* */ - /* */ - /* Renderer error code. */ - /* */ - static int - Render_Single_Pass( RAS_ARGS Bool flipped ) - { - Short i, j, k; - - - while ( ras.band_top >= 0 ) - { - ras.maxY = (Long)ras.band_stack[ras.band_top].y_max * ras.precision; - ras.minY = (Long)ras.band_stack[ras.band_top].y_min * ras.precision; - - ras.top = ras.buff; - - ras.error = Raster_Err_None; - - if ( Convert_Glyph( RAS_VARS flipped ) ) - { - if ( ras.error != Raster_Err_Overflow ) - return FAILURE; - - ras.error = Raster_Err_None; - - /* sub-banding */ - -#ifdef DEBUG_RASTER - ClearBand( RAS_VARS TRUNC( ras.minY ), TRUNC( ras.maxY ) ); -#endif - - i = ras.band_stack[ras.band_top].y_min; - j = ras.band_stack[ras.band_top].y_max; - - k = (Short)( ( i + j ) / 2 ); - - if ( ras.band_top >= 7 || k < i ) - { - ras.band_top = 0; - ras.error = Raster_Err_Invalid; - - return ras.error; - } - - ras.band_stack[ras.band_top + 1].y_min = k; - ras.band_stack[ras.band_top + 1].y_max = j; - - ras.band_stack[ras.band_top].y_max = (Short)( k - 1 ); - - ras.band_top++; - } - else - { - if ( ras.fProfile ) - if ( Draw_Sweep( RAS_VAR ) ) - return ras.error; - ras.band_top--; - } - } - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Render_Glyph */ - /* */ - /* */ - /* Renders a glyph in a bitmap. Sub-banding if needed. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - Render_Glyph( RAS_ARG ) - { - FT_Error error; - - - Set_High_Precision( RAS_VARS ras.outline.flags & - FT_OUTLINE_HIGH_PRECISION ); - ras.scale_shift = ras.precision_shift; - /* Drop-out mode 2 is hard-coded since this is the only mode used */ - /* on Windows platforms. Using other modes, as specified by the */ - /* font, results in misplaced pixels. */ - ras.dropOutControl = 2; - ras.second_pass = (FT_Byte)( !( ras.outline.flags & - FT_OUTLINE_SINGLE_PASS ) ); - - /* Vertical Sweep */ - ras.Proc_Sweep_Init = Vertical_Sweep_Init; - ras.Proc_Sweep_Span = Vertical_Sweep_Span; - ras.Proc_Sweep_Drop = Vertical_Sweep_Drop; - ras.Proc_Sweep_Step = Vertical_Sweep_Step; - - ras.band_top = 0; - ras.band_stack[0].y_min = 0; - ras.band_stack[0].y_max = (short)( ras.target.rows - 1 ); - - ras.bWidth = (unsigned short)ras.target.width; - ras.bTarget = (Byte*)ras.target.buffer; - - if ( ( error = Render_Single_Pass( RAS_VARS 0 ) ) != 0 ) - return error; - - /* Horizontal Sweep */ - if ( ras.second_pass && ras.dropOutControl != 0 ) - { - ras.Proc_Sweep_Init = Horizontal_Sweep_Init; - ras.Proc_Sweep_Span = Horizontal_Sweep_Span; - ras.Proc_Sweep_Drop = Horizontal_Sweep_Drop; - ras.Proc_Sweep_Step = Horizontal_Sweep_Step; - - ras.band_top = 0; - ras.band_stack[0].y_min = 0; - ras.band_stack[0].y_max = (short)( ras.target.width - 1 ); - - if ( ( error = Render_Single_Pass( RAS_VARS 1 ) ) != 0 ) - return error; - } - - return Raster_Err_None; - } - - -#ifdef FT_RASTER_OPTION_ANTI_ALIASING - - - /*************************************************************************/ - /* */ - /* */ - /* Render_Gray_Glyph */ - /* */ - /* */ - /* Renders a glyph with grayscaling. Sub-banding if needed. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - Render_Gray_Glyph( RAS_ARG ) - { - Long pixel_width; - FT_Error error; - - - Set_High_Precision( RAS_VARS ras.outline.flags & - FT_OUTLINE_HIGH_PRECISION ); - ras.scale_shift = ras.precision_shift + 1; - /* Drop-out mode 2 is hard-coded since this is the only mode used */ - /* on Windows platforms. Using other modes, as specified by the */ - /* font, results in misplaced pixels. */ - ras.dropOutControl = 2; - ras.second_pass = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS ); - - /* Vertical Sweep */ - - ras.band_top = 0; - ras.band_stack[0].y_min = 0; - ras.band_stack[0].y_max = 2 * ras.target.rows - 1; - - ras.bWidth = ras.gray_width; - pixel_width = 2 * ( ( ras.target.width + 3 ) >> 2 ); - - if ( ras.bWidth > pixel_width ) - ras.bWidth = pixel_width; - - ras.bWidth = ras.bWidth * 8; - ras.bTarget = (Byte*)ras.gray_lines; - ras.gTarget = (Byte*)ras.target.buffer; - - ras.Proc_Sweep_Init = Vertical_Gray_Sweep_Init; - ras.Proc_Sweep_Span = Vertical_Sweep_Span; - ras.Proc_Sweep_Drop = Vertical_Sweep_Drop; - ras.Proc_Sweep_Step = Vertical_Gray_Sweep_Step; - - error = Render_Single_Pass( RAS_VARS 0 ); - if ( error ) - return error; - - /* Horizontal Sweep */ - if ( ras.second_pass && ras.dropOutControl != 0 ) - { - ras.Proc_Sweep_Init = Horizontal_Sweep_Init; - ras.Proc_Sweep_Span = Horizontal_Gray_Sweep_Span; - ras.Proc_Sweep_Drop = Horizontal_Gray_Sweep_Drop; - ras.Proc_Sweep_Step = Horizontal_Sweep_Step; - - ras.band_top = 0; - ras.band_stack[0].y_min = 0; - ras.band_stack[0].y_max = ras.target.width * 2 - 1; - - error = Render_Single_Pass( RAS_VARS 1 ); - if ( error ) - return error; - } - - return Raster_Err_None; - } - -#else /* !FT_RASTER_OPTION_ANTI_ALIASING */ - - FT_LOCAL_DEF( FT_Error ) - Render_Gray_Glyph( RAS_ARG ) - { - FT_UNUSED_RASTER; - - return Raster_Err_Unsupported; - } - -#endif /* !FT_RASTER_OPTION_ANTI_ALIASING */ - - - static void - ft_black_init( PRaster raster ) - { - FT_UNUSED( raster ); - -#ifdef FT_RASTER_OPTION_ANTI_ALIASING - FT_UInt n; - - - /* set default 5-levels gray palette */ - for ( n = 0; n < 5; n++ ) - raster->grays[n] = n * 255 / 4; - - raster->gray_width = RASTER_GRAY_LINES / 2; - -#endif - } - - - /**** RASTER OBJECT CREATION: In standalone mode, we simply use *****/ - /**** a static object. *****/ - - -#ifdef _STANDALONE_ - - - static int - ft_black_new( void* memory, - FT_Raster *araster ) - { - static TRaster the_raster; - - - *araster = (FT_Raster)&the_raster; - FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) ); - ft_black_init( &the_raster ); - - return 0; - } - - - static void - ft_black_done( FT_Raster raster ) - { - /* nothing */ - FT_UNUSED( raster ); - } - - -#else /* _STANDALONE_ */ - - - static int - ft_black_new( FT_Memory memory, - PRaster *araster ) - { - FT_Error error; - PRaster raster; - - - *araster = 0; - if ( !FT_NEW( raster ) ) - { - raster->memory = memory; - ft_black_init( raster ); - - *araster = raster; - } - - return error; - } - - - static void - ft_black_done( PRaster raster ) - { - FT_Memory memory = (FT_Memory)raster->memory; - FT_FREE( raster ); - } - - -#endif /* _STANDALONE_ */ - - - static void - ft_black_reset( PRaster raster, - char* pool_base, - long pool_size ) - { - if ( raster ) - { - if ( pool_base && pool_size >= (long)sizeof(TWorker) + 2048 ) - { - PWorker worker = (PWorker)pool_base; - - - raster->buffer = pool_base + ( (sizeof ( *worker ) + 7 ) & ~7 ); - raster->buffer_size = ( ( pool_base + pool_size ) - - (char*)raster->buffer ) / sizeof ( Long ); - raster->worker = worker; - } - else - { - raster->buffer = NULL; - raster->buffer_size = 0; - raster->worker = NULL; - } - } - } - - - static void - ft_black_set_mode( PRaster raster, - unsigned long mode, - const char* palette ) - { -#ifdef FT_RASTER_OPTION_ANTI_ALIASING - - if ( mode == FT_MAKE_TAG( 'p', 'a', 'l', '5' ) ) - { - /* set 5-levels gray palette */ - raster->grays[0] = palette[0]; - raster->grays[1] = palette[1]; - raster->grays[2] = palette[2]; - raster->grays[3] = palette[3]; - raster->grays[4] = palette[4]; - } - -#else - - FT_UNUSED( raster ); - FT_UNUSED( mode ); - FT_UNUSED( palette ); - -#endif - } - - - static int - ft_black_render( PRaster raster, - const FT_Raster_Params* params ) - { - const FT_Outline* outline = (const FT_Outline*)params->source; - const FT_Bitmap* target_map = params->target; - PWorker worker; - - - if ( !raster || !raster->buffer || !raster->buffer_size ) - return Raster_Err_Not_Ini; - - /* return immediately if the outline is empty */ - if ( outline->n_points == 0 || outline->n_contours <= 0 ) - return Raster_Err_None; - - if ( !outline || !outline->contours || !outline->points ) - return Raster_Err_Invalid; - - if ( outline->n_points != outline->contours[outline->n_contours - 1] + 1 ) - return Raster_Err_Invalid; - - worker = raster->worker; - - /* this version of the raster does not support direct rendering, sorry */ - if ( params->flags & FT_RASTER_FLAG_DIRECT ) - return Raster_Err_Unsupported; - - if ( !target_map || !target_map->buffer ) - return Raster_Err_Invalid; - - ras.outline = *outline; - ras.target = *target_map; - - worker->buff = (PLong) raster->buffer; - worker->sizeBuff = worker->buff + - raster->buffer_size / sizeof ( Long ); -#ifdef FT_RASTER_OPTION_ANTI_ALIASING - worker->grays = raster->grays; - worker->gray_width = raster->gray_width; -#endif - - return ( ( params->flags & FT_RASTER_FLAG_AA ) - ? Render_Gray_Glyph( RAS_VAR ) - : Render_Glyph( RAS_VAR ) ); - } - - - const FT_Raster_Funcs ft_standard_raster = - { - FT_GLYPH_FORMAT_OUTLINE, - (FT_Raster_New_Func) ft_black_new, - (FT_Raster_Reset_Func) ft_black_reset, - (FT_Raster_Set_Mode_Func)ft_black_set_mode, - (FT_Raster_Render_Func) ft_black_render, - (FT_Raster_Done_Func) ft_black_done - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* ftraster.c */ +/* */ +/* The FreeType glyph rasterizer (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + /*************************************************************************/ + /* */ + /* This file can be compiled without the rest of the FreeType engine, by */ + /* defining the _STANDALONE_ macro when compiling it. You also need to */ + /* put the files `ftimage.h' and `ftmisc.h' into the $(incdir) */ + /* directory. Typically, you should do something like */ + /* */ + /* - copy `src/raster/ftraster.c' (this file) to your current directory */ + /* */ + /* - copy `include/freetype/ftimage.h' and `src/raster/ftmisc.h' */ + /* to your current directory */ + /* */ + /* - compile `ftraster' with the _STANDALONE_ macro defined, as in */ + /* */ + /* cc -c -D_STANDALONE_ ftraster.c */ + /* */ + /* The renderer can be initialized with a call to */ + /* `ft_standard_raster.raster_new'; a bitmap can be generated */ + /* with a call to `ft_standard_raster.raster_render'. */ + /* */ + /* See the comments and documentation in the file `ftimage.h' for more */ + /* details on how the raster works. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This is a rewrite of the FreeType 1.x scan-line converter */ + /* */ + /*************************************************************************/ + +#ifdef _STANDALONE_ + +#include "ftmisc.h" +#include "ftimage.h" + +#else /* !_STANDALONE_ */ + +#include +#include "ftraster.h" +#include FT_INTERNAL_CALC_H /* for FT_MulDiv only */ + +#endif /* !_STANDALONE_ */ + + + /*************************************************************************/ + /* */ + /* A simple technical note on how the raster works */ + /* ----------------------------------------------- */ + /* */ + /* Converting an outline into a bitmap is achieved in several steps: */ + /* */ + /* 1 - Decomposing the outline into successive `profiles'. Each */ + /* profile is simply an array of scanline intersections on a given */ + /* dimension. A profile's main attributes are */ + /* */ + /* o its scanline position boundaries, i.e. `Ymin' and `Ymax'. */ + /* */ + /* o an array of intersection coordinates for each scanline */ + /* between `Ymin' and `Ymax'. */ + /* */ + /* o a direction, indicating whether it was built going `up' or */ + /* `down', as this is very important for filling rules. */ + /* */ + /* 2 - Sweeping the target map's scanlines in order to compute segment */ + /* `spans' which are then filled. Additionally, this pass */ + /* performs drop-out control. */ + /* */ + /* The outline data is parsed during step 1 only. The profiles are */ + /* built from the bottom of the render pool, used as a stack. The */ + /* following graphics shows the profile list under construction: */ + /* */ + /* ____________________________________________________________ _ _ */ + /* | | | | | */ + /* | profile | coordinates for | profile | coordinates for |--> */ + /* | 1 | profile 1 | 2 | profile 2 |--> */ + /* |_________|___________________|_________|_________________|__ _ _ */ + /* */ + /* ^ ^ */ + /* | | */ + /* start of render pool top */ + /* */ + /* The top of the profile stack is kept in the `top' variable. */ + /* */ + /* As you can see, a profile record is pushed on top of the render */ + /* pool, which is then followed by its coordinates/intersections. If */ + /* a change of direction is detected in the outline, a new profile is */ + /* generated until the end of the outline. */ + /* */ + /* Note that when all profiles have been generated, the function */ + /* Finalize_Profile_Table() is used to record, for each profile, its */ + /* bottom-most scanline as well as the scanline above its upmost */ + /* boundary. These positions are called `y-turns' because they (sort */ + /* of) correspond to local extrema. They are stored in a sorted list */ + /* built from the top of the render pool as a downwards stack: */ + /* */ + /* _ _ _______________________________________ */ + /* | | */ + /* <--| sorted list of | */ + /* <--| extrema scanlines | */ + /* _ _ __________________|____________________| */ + /* */ + /* ^ ^ */ + /* | | */ + /* maxBuff sizeBuff = end of pool */ + /* */ + /* This list is later used during the sweep phase in order to */ + /* optimize performance (see technical note on the sweep below). */ + /* */ + /* Of course, the raster detects whether the two stacks collide and */ + /* handles the situation properly. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /** **/ + /** CONFIGURATION MACROS **/ + /** **/ + /*************************************************************************/ + /*************************************************************************/ + + /* define DEBUG_RASTER if you want to compile a debugging version */ +#define xxxDEBUG_RASTER + + /* undefine FT_RASTER_OPTION_ANTI_ALIASING if you do not want to support */ + /* 5-levels anti-aliasing */ +#ifdef FT_CONFIG_OPTION_5_GRAY_LEVELS +#define FT_RASTER_OPTION_ANTI_ALIASING +#endif + + /* The size of the two-lines intermediate bitmap used */ + /* for anti-aliasing, in bytes. */ +#define RASTER_GRAY_LINES 2048 + + + /*************************************************************************/ + /*************************************************************************/ + /** **/ + /** OTHER MACROS (do not change) **/ + /** **/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_raster + + +#ifdef _STANDALONE_ + + + /* This macro is used to indicate that a function parameter is unused. */ + /* Its purpose is simply to reduce compiler warnings. Note also that */ + /* simply defining it as `(void)x' doesn't avoid warnings with certain */ + /* ANSI compilers (e.g. LCC). */ +#define FT_UNUSED( x ) (x) = (x) + + /* Disable the tracing mechanism for simplicity -- developers can */ + /* activate it easily by redefining these two macros. */ +#ifndef FT_ERROR +#define FT_ERROR( x ) do ; while ( 0 ) /* nothing */ +#endif + +#ifndef FT_TRACE +#define FT_TRACE( x ) do ; while ( 0 ) /* nothing */ +#define FT_TRACE1( x ) do ; while ( 0 ) /* nothing */ +#define FT_TRACE6( x ) do ; while ( 0 ) /* nothing */ +#endif + +#define Raster_Err_None 0 +#define Raster_Err_Not_Ini -1 +#define Raster_Err_Overflow -2 +#define Raster_Err_Neg_Height -3 +#define Raster_Err_Invalid -4 +#define Raster_Err_Unsupported -5 + +#define ft_memset memset + +#else /* _STANDALONE_ */ + + +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H /* for FT_TRACE() and FT_ERROR() */ + +#include "rasterrs.h" + +#define Raster_Err_None Raster_Err_Ok +#define Raster_Err_Not_Ini Raster_Err_Raster_Uninitialized +#define Raster_Err_Overflow Raster_Err_Raster_Overflow +#define Raster_Err_Neg_Height Raster_Err_Raster_Negative_Height +#define Raster_Err_Invalid Raster_Err_Invalid_Outline +#define Raster_Err_Unsupported Raster_Err_Cannot_Render_Glyph + + +#endif /* _STANDALONE_ */ + + +#ifndef FT_MEM_SET +#define FT_MEM_SET( d, s, c ) ft_memset( d, s, c ) +#endif + +#ifndef FT_MEM_ZERO +#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count ) +#endif + + /* FMulDiv means `Fast MulDiv'; it is used in case where `b' is */ + /* typically a small value and the result of a*b is known to fit into */ + /* 32 bits. */ +#define FMulDiv( a, b, c ) ( (a) * (b) / (c) ) + + /* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */ + /* for clipping computations. It simply uses the FT_MulDiv() function */ + /* defined in `ftcalc.h'. */ +#define SMulDiv FT_MulDiv + + /* The rasterizer is a very general purpose component; please leave */ + /* the following redefinitions there (you never know your target */ + /* environment). */ + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef NULL +#define NULL (void*)0 +#endif + +#ifndef SUCCESS +#define SUCCESS 0 +#endif + +#ifndef FAILURE +#define FAILURE 1 +#endif + + +#define MaxBezier 32 /* The maximum number of stacked Bezier curves. */ + /* Setting this constant to more than 32 is a */ + /* pure waste of space. */ + +#define Pixel_Bits 6 /* fractional bits of *input* coordinates */ + + + /*************************************************************************/ + /*************************************************************************/ + /** **/ + /** SIMPLE TYPE DECLARATIONS **/ + /** **/ + /*************************************************************************/ + /*************************************************************************/ + + typedef int Int; + typedef unsigned int UInt; + typedef short Short; + typedef unsigned short UShort, *PUShort; + typedef long Long, *PLong; + typedef unsigned long ULong; + + typedef unsigned char Byte, *PByte; + typedef char Bool; + + + typedef union Alignment_ + { + long l; + void* p; + void (*f)(void); + + } Alignment, *PAlignment; + + + typedef struct TPoint_ + { + Long x; + Long y; + + } TPoint; + + + typedef enum TFlow_ + { + Flow_None = 0, + Flow_Up = 1, + Flow_Down = -1 + + } TFlow; + + + /* States of each line, arc, and profile */ + typedef enum TStates_ + { + Unknown_State, + Ascending_State, + Descending_State, + Flat_State + + } TStates; + + + typedef struct TProfile_ TProfile; + typedef TProfile* PProfile; + + struct TProfile_ + { + FT_F26Dot6 X; /* current coordinate during sweep */ + PProfile link; /* link to next profile - various purpose */ + PLong offset; /* start of profile's data in render pool */ + int flow; /* Profile orientation: Asc/Descending */ + long height; /* profile's height in scanlines */ + long start; /* profile's starting scanline */ + + unsigned countL; /* number of lines to step before this */ + /* profile becomes drawable */ + + PProfile next; /* next profile in same contour, used */ + /* during drop-out control */ + }; + + typedef PProfile TProfileList; + typedef PProfile* PProfileList; + + + /* Simple record used to implement a stack of bands, required */ + /* by the sub-banding mechanism */ + typedef struct TBand_ + { + Short y_min; /* band's minimum */ + Short y_max; /* band's maximum */ + + } TBand; + + +#define AlignProfileSize \ + ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) ) + + +#ifdef FT_STATIC_RASTER + + +#define RAS_ARGS /* void */ +#define RAS_ARG /* void */ + +#define RAS_VARS /* void */ +#define RAS_VAR /* void */ + +#define FT_UNUSED_RASTER do ; while ( 0 ) + + +#else /* FT_STATIC_RASTER */ + + +#define RAS_ARGS PWorker worker, +#define RAS_ARG PWorker worker + +#define RAS_VARS worker, +#define RAS_VAR worker + +#define FT_UNUSED_RASTER FT_UNUSED( worker ) + + +#endif /* FT_STATIC_RASTER */ + + + typedef struct TWorker_ TWorker, *PWorker; + + + /* prototypes used for sweep function dispatch */ + typedef void + Function_Sweep_Init( RAS_ARGS Short* min, + Short* max ); + + typedef void + Function_Sweep_Span( RAS_ARGS Short y, + FT_F26Dot6 x1, + FT_F26Dot6 x2, + PProfile left, + PProfile right ); + + typedef void + Function_Sweep_Step( RAS_ARG ); + + + /* NOTE: These operations are only valid on 2's complement processors */ + +#define FLOOR( x ) ( (x) & -ras.precision ) +#define CEILING( x ) ( ( (x) + ras.precision - 1 ) & -ras.precision ) +#define TRUNC( x ) ( (signed long)(x) >> ras.precision_bits ) +#define FRAC( x ) ( (x) & ( ras.precision - 1 ) ) +#define SCALED( x ) ( ( (x) << ras.scale_shift ) - ras.precision_half ) + + /* Note that I have moved the location of some fields in the */ + /* structure to ensure that the most used variables are used */ + /* at the top. Thus, their offset can be coded with less */ + /* opcodes, and it results in a smaller executable. */ + + struct TWorker_ + { + Int precision_bits; /* precision related variables */ + Int precision; + Int precision_half; + Long precision_mask; + Int precision_shift; + Int precision_step; + Int precision_jitter; + + Int scale_shift; /* == precision_shift for bitmaps */ + /* == precision_shift+1 for pixmaps */ + + PLong buff; /* The profiles buffer */ + PLong sizeBuff; /* Render pool size */ + PLong maxBuff; /* Profiles buffer size */ + PLong top; /* Current cursor in buffer */ + + FT_Error error; + + Int numTurns; /* number of Y-turns in outline */ + + TPoint* arc; /* current Bezier arc pointer */ + + UShort bWidth; /* target bitmap width */ + PByte bTarget; /* target bitmap buffer */ + PByte gTarget; /* target pixmap buffer */ + + Long lastX, lastY, minY, maxY; + + UShort num_Profs; /* current number of profiles */ + + Bool fresh; /* signals a fresh new profile which */ + /* 'start' field must be completed */ + Bool joint; /* signals that the last arc ended */ + /* exactly on a scanline. Allows */ + /* removal of doublets */ + PProfile cProfile; /* current profile */ + PProfile fProfile; /* head of linked list of profiles */ + PProfile gProfile; /* contour's first profile in case */ + /* of impact */ + + TStates state; /* rendering state */ + + FT_Bitmap target; /* description of target bit/pixmap */ + FT_Outline outline; + + Long traceOfs; /* current offset in target bitmap */ + Long traceG; /* current offset in target pixmap */ + + Short traceIncr; /* sweep's increment in target bitmap */ + + Short gray_min_x; /* current min x during gray rendering */ + Short gray_max_x; /* current max x during gray rendering */ + + /* dispatch variables */ + + Function_Sweep_Init* Proc_Sweep_Init; + Function_Sweep_Span* Proc_Sweep_Span; + Function_Sweep_Span* Proc_Sweep_Drop; + Function_Sweep_Step* Proc_Sweep_Step; + + Byte dropOutControl; /* current drop_out control method */ + + Bool second_pass; /* indicates whether a horizontal pass */ + /* should be performed to control */ + /* drop-out accurately when calling */ + /* Render_Glyph. Note that there is */ + /* no horizontal pass during gray */ + /* rendering. */ + + TPoint arcs[3 * MaxBezier + 1]; /* The Bezier stack */ + + TBand band_stack[16]; /* band stack used for sub-banding */ + Int band_top; /* band stack top */ + +#ifdef FT_RASTER_OPTION_ANTI_ALIASING + + Byte* grays; + + Byte gray_lines[RASTER_GRAY_LINES]; + /* Intermediate table used to render the */ + /* graylevels pixmaps. */ + /* gray_lines is a buffer holding two */ + /* monochrome scanlines */ + + Short gray_width; /* width in bytes of one monochrome */ + /* intermediate scanline of gray_lines. */ + /* Each gray pixel takes 2 bits long there */ + + /* The gray_lines must hold 2 lines, thus with size */ + /* in bytes of at least `gray_width*2'. */ + +#endif /* FT_RASTER_ANTI_ALIASING */ + + }; + + + typedef struct TRaster_ + { + char* buffer; + long buffer_size; + void* memory; + PWorker worker; + Byte grays[5]; + Short gray_width; + + } TRaster, *PRaster; + +#ifdef FT_STATIC_RASTER + + static TWorker cur_ras; +#define ras cur_ras + +#else + +#define ras (*worker) + +#endif /* FT_STATIC_RASTER */ + + +static const char count_table[256] = +{ + 0 , 1 , 1 , 2 , 1 , 2 , 2 , 3 , 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4, + 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, + 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, + 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, + 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, + 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, + 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, + 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, + 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5, + 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, + 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, + 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, + 2 , 3 , 3 , 4 , 3 , 4 , 4 , 5 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6, + 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, + 3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7, + 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7 , 5 , 6 , 6 , 7 , 6 , 7 , 7 , 8 }; + + + + /*************************************************************************/ + /*************************************************************************/ + /** **/ + /** PROFILES COMPUTATION **/ + /** **/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* Set_High_Precision */ + /* */ + /* */ + /* Sets precision variables according to param flag. */ + /* */ + /* */ + /* High :: Set to True for high precision (typically for ppem < 18), */ + /* false otherwise. */ + /* */ + static void + Set_High_Precision( RAS_ARGS Int High ) + { + if ( High ) + { + ras.precision_bits = 10; + ras.precision_step = 128; + ras.precision_jitter = 24; + } + else + { + ras.precision_bits = 6; + ras.precision_step = 32; + ras.precision_jitter = 2; + } + + FT_TRACE6(( "Set_High_Precision(%s)\n", High ? "true" : "false" )); + + ras.precision = 1 << ras.precision_bits; + ras.precision_half = ras.precision / 2; + ras.precision_shift = ras.precision_bits - Pixel_Bits; + ras.precision_mask = -ras.precision; + } + + + /*************************************************************************/ + /* */ + /* */ + /* New_Profile */ + /* */ + /* */ + /* Creates a new profile in the render pool. */ + /* */ + /* */ + /* aState :: The state/orientation of the new profile. */ + /* */ + /* */ + /* SUCCESS on success. FAILURE in case of overflow or of incoherent */ + /* profile. */ + /* */ + static Bool + New_Profile( RAS_ARGS TStates aState ) + { + if ( !ras.fProfile ) + { + ras.cProfile = (PProfile)ras.top; + ras.fProfile = ras.cProfile; + ras.top += AlignProfileSize; + } + + if ( ras.top >= ras.maxBuff ) + { + ras.error = Raster_Err_Overflow; + return FAILURE; + } + + switch ( aState ) + { + case Ascending_State: + ras.cProfile->flow = Flow_Up; + FT_TRACE6(( "New ascending profile = %lx\n", (long)ras.cProfile )); + break; + + case Descending_State: + ras.cProfile->flow = Flow_Down; + FT_TRACE6(( "New descending profile = %lx\n", (long)ras.cProfile )); + break; + + default: + FT_ERROR(( "New_Profile: invalid profile direction!\n" )); + ras.error = Raster_Err_Invalid; + return FAILURE; + } + + ras.cProfile->start = 0; + ras.cProfile->height = 0; + ras.cProfile->offset = ras.top; + ras.cProfile->link = (PProfile)0; + ras.cProfile->next = (PProfile)0; + + if ( !ras.gProfile ) + ras.gProfile = ras.cProfile; + + ras.state = aState; + ras.fresh = TRUE; + ras.joint = FALSE; + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* End_Profile */ + /* */ + /* */ + /* Finalizes the current profile. */ + /* */ + /* */ + /* SUCCESS on success. FAILURE in case of overflow or incoherency. */ + /* */ + static Bool + End_Profile( RAS_ARG ) + { + Long h; + PProfile oldProfile; + + + h = (Long)( ras.top - ras.cProfile->offset ); + + if ( h < 0 ) + { + FT_ERROR(( "End_Profile: negative height encountered!\n" )); + ras.error = Raster_Err_Neg_Height; + return FAILURE; + } + + if ( h > 0 ) + { + FT_TRACE6(( "Ending profile %lx, start = %ld, height = %ld\n", + (long)ras.cProfile, ras.cProfile->start, h )); + + oldProfile = ras.cProfile; + ras.cProfile->height = h; + ras.cProfile = (PProfile)ras.top; + + ras.top += AlignProfileSize; + + ras.cProfile->height = 0; + ras.cProfile->offset = ras.top; + oldProfile->next = ras.cProfile; + ras.num_Profs++; + } + + if ( ras.top >= ras.maxBuff ) + { + FT_TRACE1(( "overflow in End_Profile\n" )); + ras.error = Raster_Err_Overflow; + return FAILURE; + } + + ras.joint = FALSE; + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Insert_Y_Turn */ + /* */ + /* */ + /* Inserts a salient into the sorted list placed on top of the render */ + /* pool. */ + /* */ + /* */ + /* New y scanline position. */ + /* */ + /* */ + /* SUCCESS on success. FAILURE in case of overflow. */ + /* */ + static Bool + Insert_Y_Turn( RAS_ARGS Int y ) + { + PLong y_turns; + Int y2, n; + + + n = ras.numTurns - 1; + y_turns = ras.sizeBuff - ras.numTurns; + + /* look for first y value that is <= */ + while ( n >= 0 && y < y_turns[n] ) + n--; + + /* if it is <, simply insert it, ignore if == */ + if ( n >= 0 && y > y_turns[n] ) + while ( n >= 0 ) + { + y2 = (Int)y_turns[n]; + y_turns[n] = y; + y = y2; + n--; + } + + if ( n < 0 ) + { + ras.maxBuff--; + if ( ras.maxBuff <= ras.top ) + { + ras.error = Raster_Err_Overflow; + return FAILURE; + } + ras.numTurns++; + ras.sizeBuff[-ras.numTurns] = y; + } + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Finalize_Profile_Table */ + /* */ + /* */ + /* Adjusts all links in the profiles list. */ + /* */ + /* */ + /* SUCCESS on success. FAILURE in case of overflow. */ + /* */ + static Bool + Finalize_Profile_Table( RAS_ARG ) + { + Int bottom, top; + UShort n; + PProfile p; + + + n = ras.num_Profs; + + if ( n > 1 ) + { + p = ras.fProfile; + while ( n > 0 ) + { + if ( n > 1 ) + p->link = (PProfile)( p->offset + p->height ); + else + p->link = NULL; + + switch ( p->flow ) + { + case Flow_Down: + bottom = (Int)( p->start - p->height + 1 ); + top = (Int)p->start; + p->start = bottom; + p->offset += p->height - 1; + break; + + case Flow_Up: + default: + bottom = (Int)p->start; + top = (Int)( p->start + p->height - 1 ); + } + + if ( Insert_Y_Turn( RAS_VARS bottom ) || + Insert_Y_Turn( RAS_VARS top + 1 ) ) + return FAILURE; + + p = p->link; + n--; + } + } + else + ras.fProfile = NULL; + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Split_Conic */ + /* */ + /* */ + /* Subdivides one conic Bezier into two joint sub-arcs in the Bezier */ + /* stack. */ + /* */ + /* */ + /* None (subdivided Bezier is taken from the top of the stack). */ + /* */ + /* */ + /* This routine is the `beef' of this component. It is _the_ inner */ + /* loop that should be optimized to hell to get the best performance. */ + /* */ + static void + Split_Conic( TPoint* base ) + { + Long a, b; + + + base[4].x = base[2].x; + b = base[1].x; + a = base[3].x = ( base[2].x + b ) / 2; + b = base[1].x = ( base[0].x + b ) / 2; + base[2].x = ( a + b ) / 2; + + base[4].y = base[2].y; + b = base[1].y; + a = base[3].y = ( base[2].y + b ) / 2; + b = base[1].y = ( base[0].y + b ) / 2; + base[2].y = ( a + b ) / 2; + + /* hand optimized. gcc doesn't seem to be too good at common */ + /* expression substitution and instruction scheduling ;-) */ + } + + + /*************************************************************************/ + /* */ + /* */ + /* Split_Cubic */ + /* */ + /* */ + /* Subdivides a third-order Bezier arc into two joint sub-arcs in the */ + /* Bezier stack. */ + /* */ + /* */ + /* This routine is the `beef' of the component. It is one of _the_ */ + /* inner loops that should be optimized like hell to get the best */ + /* performance. */ + /* */ + static void + Split_Cubic( TPoint* base ) + { + Long a, b, c, d; + + + base[6].x = base[3].x; + c = base[1].x; + d = base[2].x; + base[1].x = a = ( base[0].x + c + 1 ) >> 1; + base[5].x = b = ( base[3].x + d + 1 ) >> 1; + c = ( c + d + 1 ) >> 1; + base[2].x = a = ( a + c + 1 ) >> 1; + base[4].x = b = ( b + c + 1 ) >> 1; + base[3].x = ( a + b + 1 ) >> 1; + + base[6].y = base[3].y; + c = base[1].y; + d = base[2].y; + base[1].y = a = ( base[0].y + c + 1 ) >> 1; + base[5].y = b = ( base[3].y + d + 1 ) >> 1; + c = ( c + d + 1 ) >> 1; + base[2].y = a = ( a + c + 1 ) >> 1; + base[4].y = b = ( b + c + 1 ) >> 1; + base[3].y = ( a + b + 1 ) >> 1; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Line_Up */ + /* */ + /* */ + /* Computes the x-coordinates of an ascending line segment and stores */ + /* them in the render pool. */ + /* */ + /* */ + /* x1 :: The x-coordinate of the segment's start point. */ + /* */ + /* y1 :: The y-coordinate of the segment's start point. */ + /* */ + /* x2 :: The x-coordinate of the segment's end point. */ + /* */ + /* y2 :: The y-coordinate of the segment's end point. */ + /* */ + /* miny :: A lower vertical clipping bound value. */ + /* */ + /* maxy :: An upper vertical clipping bound value. */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on render pool overflow. */ + /* */ + static Bool + Line_Up( RAS_ARGS Long x1, + Long y1, + Long x2, + Long y2, + Long miny, + Long maxy ) + { + Long Dx, Dy; + Int e1, e2, f1, f2, size; /* XXX: is `Short' sufficient? */ + Long Ix, Rx, Ax; + + PLong top; + + + Dx = x2 - x1; + Dy = y2 - y1; + + if ( Dy <= 0 || y2 < miny || y1 > maxy ) + return SUCCESS; + + if ( y1 < miny ) + { + /* Take care: miny-y1 can be a very large value; we use */ + /* a slow MulDiv function to avoid clipping bugs */ + x1 += SMulDiv( Dx, miny - y1, Dy ); + e1 = (Int)TRUNC( miny ); + f1 = 0; + } + else + { + e1 = (Int)TRUNC( y1 ); + f1 = (Int)FRAC( y1 ); + } + + if ( y2 > maxy ) + { + /* x2 += FMulDiv( Dx, maxy - y2, Dy ); UNNECESSARY */ + e2 = (Int)TRUNC( maxy ); + f2 = 0; + } + else + { + e2 = (Int)TRUNC( y2 ); + f2 = (Int)FRAC( y2 ); + } + + if ( f1 > 0 ) + { + if ( e1 == e2 ) + return SUCCESS; + else + { + x1 += FMulDiv( Dx, ras.precision - f1, Dy ); + e1 += 1; + } + } + else + if ( ras.joint ) + { + ras.top--; + ras.joint = FALSE; + } + + ras.joint = (char)( f2 == 0 ); + + if ( ras.fresh ) + { + ras.cProfile->start = e1; + ras.fresh = FALSE; + } + + size = e2 - e1 + 1; + if ( ras.top + size >= ras.maxBuff ) + { + ras.error = Raster_Err_Overflow; + return FAILURE; + } + + if ( Dx > 0 ) + { + Ix = ( ras.precision * Dx ) / Dy; + Rx = ( ras.precision * Dx ) % Dy; + Dx = 1; + } + else + { + Ix = -( ( ras.precision * -Dx ) / Dy ); + Rx = ( ras.precision * -Dx ) % Dy; + Dx = -1; + } + + Ax = -Dy; + top = ras.top; + + while ( size > 0 ) + { + *top++ = x1; + + x1 += Ix; + Ax += Rx; + if ( Ax >= 0 ) + { + Ax -= Dy; + x1 += Dx; + } + size--; + } + + ras.top = top; + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Line_Down */ + /* */ + /* */ + /* Computes the x-coordinates of an descending line segment and */ + /* stores them in the render pool. */ + /* */ + /* */ + /* x1 :: The x-coordinate of the segment's start point. */ + /* */ + /* y1 :: The y-coordinate of the segment's start point. */ + /* */ + /* x2 :: The x-coordinate of the segment's end point. */ + /* */ + /* y2 :: The y-coordinate of the segment's end point. */ + /* */ + /* miny :: A lower vertical clipping bound value. */ + /* */ + /* maxy :: An upper vertical clipping bound value. */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on render pool overflow. */ + /* */ + static Bool + Line_Down( RAS_ARGS Long x1, + Long y1, + Long x2, + Long y2, + Long miny, + Long maxy ) + { + Bool result, fresh; + + + fresh = ras.fresh; + + result = Line_Up( RAS_VARS x1, -y1, x2, -y2, -maxy, -miny ); + + if ( fresh && !ras.fresh ) + ras.cProfile->start = -ras.cProfile->start; + + return result; + } + + + /* A function type describing the functions used to split Bezier arcs */ + typedef void (*TSplitter)( TPoint* base ); + + + /*************************************************************************/ + /* */ + /* */ + /* Bezier_Up */ + /* */ + /* */ + /* Computes the x-coordinates of an ascending Bezier arc and stores */ + /* them in the render pool. */ + /* */ + /* */ + /* degree :: The degree of the Bezier arc (either 2 or 3). */ + /* */ + /* splitter :: The function to split Bezier arcs. */ + /* */ + /* miny :: A lower vertical clipping bound value. */ + /* */ + /* maxy :: An upper vertical clipping bound value. */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on render pool overflow. */ + /* */ + static Bool + Bezier_Up( RAS_ARGS Int degree, + TSplitter splitter, + Long miny, + Long maxy ) + { + Long y1, y2, e, e2, e0; + Short f1; + + TPoint* arc; + TPoint* start_arc; + + PLong top; + + + arc = ras.arc; + y1 = arc[degree].y; + y2 = arc[0].y; + top = ras.top; + + if ( y2 < miny || y1 > maxy ) + goto Fin; + + e2 = FLOOR( y2 ); + + if ( e2 > maxy ) + e2 = maxy; + + e0 = miny; + + if ( y1 < miny ) + e = miny; + else + { + e = CEILING( y1 ); + f1 = (Short)( FRAC( y1 ) ); + e0 = e; + + if ( f1 == 0 ) + { + if ( ras.joint ) + { + top--; + ras.joint = FALSE; + } + + *top++ = arc[degree].x; + + e += ras.precision; + } + } + + if ( ras.fresh ) + { + ras.cProfile->start = TRUNC( e0 ); + ras.fresh = FALSE; + } + + if ( e2 < e ) + goto Fin; + + if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff ) + { + ras.top = top; + ras.error = Raster_Err_Overflow; + return FAILURE; + } + + start_arc = arc; + + while ( arc >= start_arc && e <= e2 ) + { + ras.joint = FALSE; + + y2 = arc[0].y; + + if ( y2 > e ) + { + y1 = arc[degree].y; + if ( y2 - y1 >= ras.precision_step ) + { + splitter( arc ); + arc += degree; + } + else + { + *top++ = arc[degree].x + FMulDiv( arc[0].x-arc[degree].x, + e - y1, y2 - y1 ); + arc -= degree; + e += ras.precision; + } + } + else + { + if ( y2 == e ) + { + ras.joint = TRUE; + *top++ = arc[0].x; + + e += ras.precision; + } + arc -= degree; + } + } + + Fin: + ras.top = top; + ras.arc -= degree; + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Bezier_Down */ + /* */ + /* */ + /* Computes the x-coordinates of an descending Bezier arc and stores */ + /* them in the render pool. */ + /* */ + /* */ + /* degree :: The degree of the Bezier arc (either 2 or 3). */ + /* */ + /* splitter :: The function to split Bezier arcs. */ + /* */ + /* miny :: A lower vertical clipping bound value. */ + /* */ + /* maxy :: An upper vertical clipping bound value. */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on render pool overflow. */ + /* */ + static Bool + Bezier_Down( RAS_ARGS Int degree, + TSplitter splitter, + Long miny, + Long maxy ) + { + TPoint* arc = ras.arc; + Bool result, fresh; + + + arc[0].y = -arc[0].y; + arc[1].y = -arc[1].y; + arc[2].y = -arc[2].y; + if ( degree > 2 ) + arc[3].y = -arc[3].y; + + fresh = ras.fresh; + + result = Bezier_Up( RAS_VARS degree, splitter, -maxy, -miny ); + + if ( fresh && !ras.fresh ) + ras.cProfile->start = -ras.cProfile->start; + + arc[0].y = -arc[0].y; + return result; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Line_To */ + /* */ + /* */ + /* Injects a new line segment and adjusts Profiles list. */ + /* */ + /* */ + /* x :: The x-coordinate of the segment's end point (its start point */ + /* is stored in `lastX'). */ + /* */ + /* y :: The y-coordinate of the segment's end point (its start point */ + /* is stored in `lastY'). */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on render pool overflow or incorrect */ + /* profile. */ + /* */ + static Bool + Line_To( RAS_ARGS Long x, + Long y ) + { + /* First, detect a change of direction */ + + switch ( ras.state ) + { + case Unknown_State: + if ( y > ras.lastY ) + { + if ( New_Profile( RAS_VARS Ascending_State ) ) + return FAILURE; + } + else + { + if ( y < ras.lastY ) + if ( New_Profile( RAS_VARS Descending_State ) ) + return FAILURE; + } + break; + + case Ascending_State: + if ( y < ras.lastY ) + { + if ( End_Profile( RAS_VAR ) || + New_Profile( RAS_VARS Descending_State ) ) + return FAILURE; + } + break; + + case Descending_State: + if ( y > ras.lastY ) + { + if ( End_Profile( RAS_VAR ) || + New_Profile( RAS_VARS Ascending_State ) ) + return FAILURE; + } + break; + + default: + ; + } + + /* Then compute the lines */ + + switch ( ras.state ) + { + case Ascending_State: + if ( Line_Up( RAS_VARS ras.lastX, ras.lastY, + x, y, ras.minY, ras.maxY ) ) + return FAILURE; + break; + + case Descending_State: + if ( Line_Down( RAS_VARS ras.lastX, ras.lastY, + x, y, ras.minY, ras.maxY ) ) + return FAILURE; + break; + + default: + ; + } + + ras.lastX = x; + ras.lastY = y; + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Conic_To */ + /* */ + /* */ + /* Injects a new conic arc and adjusts the profile list. */ + /* */ + /* */ + /* cx :: The x-coordinate of the arc's new control point. */ + /* */ + /* cy :: The y-coordinate of the arc's new control point. */ + /* */ + /* x :: The x-coordinate of the arc's end point (its start point is */ + /* stored in `lastX'). */ + /* */ + /* y :: The y-coordinate of the arc's end point (its start point is */ + /* stored in `lastY'). */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on render pool overflow or incorrect */ + /* profile. */ + /* */ + static Bool + Conic_To( RAS_ARGS Long cx, + Long cy, + Long x, + Long y ) + { + Long y1, y2, y3, x3, ymin, ymax; + TStates state_bez; + + + ras.arc = ras.arcs; + ras.arc[2].x = ras.lastX; + ras.arc[2].y = ras.lastY; + ras.arc[1].x = cx; ras.arc[1].y = cy; + ras.arc[0].x = x; ras.arc[0].y = y; + + do + { + y1 = ras.arc[2].y; + y2 = ras.arc[1].y; + y3 = ras.arc[0].y; + x3 = ras.arc[0].x; + + /* first, categorize the Bezier arc */ + + if ( y1 <= y3 ) + { + ymin = y1; + ymax = y3; + } + else + { + ymin = y3; + ymax = y1; + } + + if ( y2 < ymin || y2 > ymax ) + { + /* this arc has no given direction, split it! */ + Split_Conic( ras.arc ); + ras.arc += 2; + } + else if ( y1 == y3 ) + { + /* this arc is flat, ignore it and pop it from the Bezier stack */ + ras.arc -= 2; + } + else + { + /* the arc is y-monotonous, either ascending or descending */ + /* detect a change of direction */ + state_bez = y1 < y3 ? Ascending_State : Descending_State; + if ( ras.state != state_bez ) + { + /* finalize current profile if any */ + if ( ras.state != Unknown_State && + End_Profile( RAS_VAR ) ) + goto Fail; + + /* create a new profile */ + if ( New_Profile( RAS_VARS state_bez ) ) + goto Fail; + } + + /* now call the appropriate routine */ + if ( state_bez == Ascending_State ) + { + if ( Bezier_Up( RAS_VARS 2, Split_Conic, ras.minY, ras.maxY ) ) + goto Fail; + } + else + if ( Bezier_Down( RAS_VARS 2, Split_Conic, ras.minY, ras.maxY ) ) + goto Fail; + } + + } while ( ras.arc >= ras.arcs ); + + ras.lastX = x3; + ras.lastY = y3; + + return SUCCESS; + + Fail: + return FAILURE; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Cubic_To */ + /* */ + /* */ + /* Injects a new cubic arc and adjusts the profile list. */ + /* */ + /* */ + /* cx1 :: The x-coordinate of the arc's first new control point. */ + /* */ + /* cy1 :: The y-coordinate of the arc's first new control point. */ + /* */ + /* cx2 :: The x-coordinate of the arc's second new control point. */ + /* */ + /* cy2 :: The y-coordinate of the arc's second new control point. */ + /* */ + /* x :: The x-coordinate of the arc's end point (its start point is */ + /* stored in `lastX'). */ + /* */ + /* y :: The y-coordinate of the arc's end point (its start point is */ + /* stored in `lastY'). */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on render pool overflow or incorrect */ + /* profile. */ + /* */ + static Bool + Cubic_To( RAS_ARGS Long cx1, + Long cy1, + Long cx2, + Long cy2, + Long x, + Long y ) + { + Long y1, y2, y3, y4, x4, ymin1, ymax1, ymin2, ymax2; + TStates state_bez; + + + ras.arc = ras.arcs; + ras.arc[3].x = ras.lastX; + ras.arc[3].y = ras.lastY; + ras.arc[2].x = cx1; ras.arc[2].y = cy1; + ras.arc[1].x = cx2; ras.arc[1].y = cy2; + ras.arc[0].x = x; ras.arc[0].y = y; + + do + { + y1 = ras.arc[3].y; + y2 = ras.arc[2].y; + y3 = ras.arc[1].y; + y4 = ras.arc[0].y; + x4 = ras.arc[0].x; + + /* first, categorize the Bezier arc */ + + if ( y1 <= y4 ) + { + ymin1 = y1; + ymax1 = y4; + } + else + { + ymin1 = y4; + ymax1 = y1; + } + + if ( y2 <= y3 ) + { + ymin2 = y2; + ymax2 = y3; + } + else + { + ymin2 = y3; + ymax2 = y2; + } + + if ( ymin2 < ymin1 || ymax2 > ymax1 ) + { + /* this arc has no given direction, split it! */ + Split_Cubic( ras.arc ); + ras.arc += 3; + } + else if ( y1 == y4 ) + { + /* this arc is flat, ignore it and pop it from the Bezier stack */ + ras.arc -= 3; + } + else + { + state_bez = ( y1 <= y4 ) ? Ascending_State : Descending_State; + + /* detect a change of direction */ + if ( ras.state != state_bez ) + { + if ( ras.state != Unknown_State && + End_Profile( RAS_VAR ) ) + goto Fail; + + if ( New_Profile( RAS_VARS state_bez ) ) + goto Fail; + } + + /* compute intersections */ + if ( state_bez == Ascending_State ) + { + if ( Bezier_Up( RAS_VARS 3, Split_Cubic, ras.minY, ras.maxY ) ) + goto Fail; + } + else + if ( Bezier_Down( RAS_VARS 3, Split_Cubic, ras.minY, ras.maxY ) ) + goto Fail; + } + + } while ( ras.arc >= ras.arcs ); + + ras.lastX = x4; + ras.lastY = y4; + + return SUCCESS; + + Fail: + return FAILURE; + } + + +#undef SWAP_ +#define SWAP_( x, y ) do \ + { \ + Long swap = x; \ + \ + \ + x = y; \ + y = swap; \ + } while ( 0 ) + + + /*************************************************************************/ + /* */ + /* */ + /* Decompose_Curve */ + /* */ + /* */ + /* Scans the outline arrays in order to emit individual segments and */ + /* Beziers by calling Line_To() and Bezier_To(). It handles all */ + /* weird cases, like when the first point is off the curve, or when */ + /* there are simply no `on' points in the contour! */ + /* */ + /* */ + /* first :: The index of the first point in the contour. */ + /* */ + /* last :: The index of the last point in the contour. */ + /* */ + /* flipped :: If set, flip the direction of the curve. */ + /* */ + /* */ + /* SUCCESS on success, FAILURE on error. */ + /* */ + static Bool + Decompose_Curve( RAS_ARGS UShort first, + UShort last, + int flipped ) + { + FT_Vector v_last; + FT_Vector v_control; + FT_Vector v_start; + + FT_Vector* points; + FT_Vector* point; + FT_Vector* limit; + char* tags; + + unsigned tag; /* current point's state */ + + + points = ras.outline.points; + limit = points + last; + + v_start.x = SCALED( points[first].x ); + v_start.y = SCALED( points[first].y ); + v_last.x = SCALED( points[last].x ); + v_last.y = SCALED( points[last].y ); + + if ( flipped ) + { + SWAP_( v_start.x, v_start.y ); + SWAP_( v_last.x, v_last.y ); + } + + v_control = v_start; + + point = points + first; + tags = ras.outline.tags + first; + tag = FT_CURVE_TAG( tags[0] ); + + /* A contour cannot start with a cubic control point! */ + if ( tag == FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + /* check first point to determine origin */ + if ( tag == FT_CURVE_TAG_CONIC ) + { + /* first point is conic control. Yes, this happens. */ + if ( FT_CURVE_TAG( ras.outline.tags[last] ) == FT_CURVE_TAG_ON ) + { + /* start at last point if it is on the curve */ + v_start = v_last; + limit--; + } + else + { + /* if both first and last points are conic, */ + /* start at their middle and record its position */ + /* for closure */ + v_start.x = ( v_start.x + v_last.x ) / 2; + v_start.y = ( v_start.y + v_last.y ) / 2; + + v_last = v_start; + } + point--; + tags--; + } + + ras.lastX = v_start.x; + ras.lastY = v_start.y; + + while ( point < limit ) + { + point++; + tags++; + + tag = FT_CURVE_TAG( tags[0] ); + + switch ( tag ) + { + case FT_CURVE_TAG_ON: /* emit a single line_to */ + { + Long x, y; + + + x = SCALED( point->x ); + y = SCALED( point->y ); + if ( flipped ) + SWAP_( x, y ); + + if ( Line_To( RAS_VARS x, y ) ) + goto Fail; + continue; + } + + case FT_CURVE_TAG_CONIC: /* consume conic arcs */ + v_control.x = SCALED( point[0].x ); + v_control.y = SCALED( point[0].y ); + + if ( flipped ) + SWAP_( v_control.x, v_control.y ); + + Do_Conic: + if ( point < limit ) + { + FT_Vector v_middle; + Long x, y; + + + point++; + tags++; + tag = FT_CURVE_TAG( tags[0] ); + + x = SCALED( point[0].x ); + y = SCALED( point[0].y ); + + if ( flipped ) + SWAP_( x, y ); + + if ( tag == FT_CURVE_TAG_ON ) + { + if ( Conic_To( RAS_VARS v_control.x, v_control.y, x, y ) ) + goto Fail; + continue; + } + + if ( tag != FT_CURVE_TAG_CONIC ) + goto Invalid_Outline; + + v_middle.x = ( v_control.x + x ) / 2; + v_middle.y = ( v_control.y + y ) / 2; + + if ( Conic_To( RAS_VARS v_control.x, v_control.y, + v_middle.x, v_middle.y ) ) + goto Fail; + + v_control.x = x; + v_control.y = y; + + goto Do_Conic; + } + + if ( Conic_To( RAS_VARS v_control.x, v_control.y, + v_start.x, v_start.y ) ) + goto Fail; + + goto Close; + + default: /* FT_CURVE_TAG_CUBIC */ + { + Long x1, y1, x2, y2, x3, y3; + + + if ( point + 1 > limit || + FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + point += 2; + tags += 2; + + x1 = SCALED( point[-2].x ); + y1 = SCALED( point[-2].y ); + x2 = SCALED( point[-1].x ); + y2 = SCALED( point[-1].y ); + x3 = SCALED( point[ 0].x ); + y3 = SCALED( point[ 0].y ); + + if ( flipped ) + { + SWAP_( x1, y1 ); + SWAP_( x2, y2 ); + SWAP_( x3, y3 ); + } + + if ( point <= limit ) + { + if ( Cubic_To( RAS_VARS x1, y1, x2, y2, x3, y3 ) ) + goto Fail; + continue; + } + + if ( Cubic_To( RAS_VARS x1, y1, x2, y2, v_start.x, v_start.y ) ) + goto Fail; + goto Close; + } + } + } + + /* close the contour with a line segment */ + if ( Line_To( RAS_VARS v_start.x, v_start.y ) ) + goto Fail; + + Close: + return SUCCESS; + + Invalid_Outline: + ras.error = Raster_Err_Invalid; + + Fail: + return FAILURE; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Convert_Glyph */ + /* */ + /* */ + /* Converts a glyph into a series of segments and arcs and makes a */ + /* profiles list with them. */ + /* */ + /* */ + /* flipped :: If set, flip the direction of curve. */ + /* */ + /* */ + /* SUCCESS on success, FAILURE if any error was encountered during */ + /* rendering. */ + /* */ + static Bool + Convert_Glyph( RAS_ARGS int flipped ) + { + int i; + unsigned start; + + PProfile lastProfile; + + + ras.fProfile = NULL; + ras.joint = FALSE; + ras.fresh = FALSE; + + ras.maxBuff = ras.sizeBuff - AlignProfileSize; + + ras.numTurns = 0; + + ras.cProfile = (PProfile)ras.top; + ras.cProfile->offset = ras.top; + ras.num_Profs = 0; + + start = 0; + + for ( i = 0; i < ras.outline.n_contours; i++ ) + { + ras.state = Unknown_State; + ras.gProfile = NULL; + + if ( Decompose_Curve( RAS_VARS (unsigned short)start, + ras.outline.contours[i], + flipped ) ) + return FAILURE; + + start = ras.outline.contours[i] + 1; + + /* We must now see whether the extreme arcs join or not */ + if ( FRAC( ras.lastY ) == 0 && + ras.lastY >= ras.minY && + ras.lastY <= ras.maxY ) + if ( ras.gProfile && ras.gProfile->flow == ras.cProfile->flow ) + ras.top--; + /* Note that ras.gProfile can be nil if the contour was too small */ + /* to be drawn. */ + + lastProfile = ras.cProfile; + if ( End_Profile( RAS_VAR ) ) + return FAILURE; + + /* close the `next profile in contour' linked list */ + if ( ras.gProfile ) + lastProfile->next = ras.gProfile; + } + + if ( Finalize_Profile_Table( RAS_VAR ) ) + return FAILURE; + + return (Bool)( ras.top < ras.maxBuff ? SUCCESS : FAILURE ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /** **/ + /** SCAN-LINE SWEEPS AND DRAWING **/ + /** **/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Init_Linked */ + /* */ + /* Initializes an empty linked list. */ + /* */ + static void + Init_Linked( TProfileList* l ) + { + *l = NULL; + } + + + /*************************************************************************/ + /* */ + /* InsNew */ + /* */ + /* Inserts a new profile in a linked list. */ + /* */ + static void + InsNew( PProfileList list, + PProfile profile ) + { + PProfile *old, current; + Long x; + + + old = list; + current = *old; + x = profile->X; + + while ( current ) + { + if ( x < current->X ) + break; + old = ¤t->link; + current = *old; + } + + profile->link = current; + *old = profile; + } + + + /*************************************************************************/ + /* */ + /* DelOld */ + /* */ + /* Removes an old profile from a linked list. */ + /* */ + static void + DelOld( PProfileList list, + PProfile profile ) + { + PProfile *old, current; + + + old = list; + current = *old; + + while ( current ) + { + if ( current == profile ) + { + *old = current->link; + return; + } + + old = ¤t->link; + current = *old; + } + + /* we should never get there, unless the profile was not part of */ + /* the list. */ + } + + + /*************************************************************************/ + /* */ + /* Sort */ + /* */ + /* Sorts a trace list. In 95%, the list is already sorted. We need */ + /* an algorithm which is fast in this case. Bubble sort is enough */ + /* and simple. */ + /* */ + static void + Sort( PProfileList list ) + { + PProfile *old, current, next; + + + /* First, set the new X coordinate of each profile */ + current = *list; + while ( current ) + { + current->X = *current->offset; + current->offset += current->flow; + current->height--; + current = current->link; + } + + /* Then sort them */ + old = list; + current = *old; + + if ( !current ) + return; + + next = current->link; + + while ( next ) + { + if ( current->X <= next->X ) + { + old = ¤t->link; + current = *old; + + if ( !current ) + return; + } + else + { + *old = next; + current->link = next->link; + next->link = current; + + old = list; + current = *old; + } + + next = current->link; + } + } + + + /*************************************************************************/ + /* */ + /* Vertical Sweep Procedure Set */ + /* */ + /* These four routines are used during the vertical black/white sweep */ + /* phase by the generic Draw_Sweep() function. */ + /* */ + /*************************************************************************/ + + static void + Vertical_Sweep_Init( RAS_ARGS Short* min, + Short* max ) + { + Long pitch = ras.target.pitch; + + FT_UNUSED( max ); + + + ras.traceIncr = (Short)-pitch; + ras.traceOfs = -*min * pitch; + if ( pitch > 0 ) + ras.traceOfs += ( ras.target.rows - 1 ) * pitch; + + ras.gray_min_x = 0; + ras.gray_max_x = 0; + } + + + static void + Vertical_Sweep_Span( RAS_ARGS Short y, + FT_F26Dot6 x1, + FT_F26Dot6 x2, + PProfile left, + PProfile right ) + { + Long e1, e2; + int c1, c2; + Byte f1, f2; + Byte* target; + + FT_UNUSED( y ); + FT_UNUSED( left ); + FT_UNUSED( right ); + + + /* Drop-out control */ + + e1 = TRUNC( CEILING( x1 ) ); + + if ( x2 - x1 - ras.precision <= ras.precision_jitter ) + e2 = e1; + else + e2 = TRUNC( FLOOR( x2 ) ); + + if ( e2 >= 0 && e1 < ras.bWidth ) + { + if ( e1 < 0 ) + e1 = 0; + if ( e2 >= ras.bWidth ) + e2 = ras.bWidth - 1; + + c1 = (Short)( e1 >> 3 ); + c2 = (Short)( e2 >> 3 ); + + f1 = (Byte) ( 0xFF >> ( e1 & 7 ) ); + f2 = (Byte) ~( 0x7F >> ( e2 & 7 ) ); + + if ( ras.gray_min_x > c1 ) ras.gray_min_x = (short)c1; + if ( ras.gray_max_x < c2 ) ras.gray_max_x = (short)c2; + + target = ras.bTarget + ras.traceOfs + c1; + c2 -= c1; + + if ( c2 > 0 ) + { + target[0] |= f1; + + /* memset() is slower than the following code on many platforms. */ + /* This is due to the fact that, in the vast majority of cases, */ + /* the span length in bytes is relatively small. */ + c2--; + while ( c2 > 0 ) + { + *(++target) = 0xFF; + c2--; + } + target[1] |= f2; + } + else + *target |= ( f1 & f2 ); + } + } + + + static void + Vertical_Sweep_Drop( RAS_ARGS Short y, + FT_F26Dot6 x1, + FT_F26Dot6 x2, + PProfile left, + PProfile right ) + { + Long e1, e2; + Short c1, f1; + + + /* Drop-out control */ + + e1 = CEILING( x1 ); + e2 = FLOOR ( x2 ); + + if ( e1 > e2 ) + { + if ( e1 == e2 + ras.precision ) + { + switch ( ras.dropOutControl ) + { + case 1: + e1 = e2; + break; + + case 4: + e1 = CEILING( (x1 + x2 + 1) / 2 ); + break; + + case 2: + case 5: + /* Drop-out Control Rule #4 */ + + /* The spec is not very clear regarding rule #4. It */ + /* presents a method that is way too costly to implement */ + /* while the general idea seems to get rid of `stubs'. */ + /* */ + /* Here, we only get rid of stubs recognized if: */ + /* */ + /* upper stub: */ + /* */ + /* - P_Left and P_Right are in the same contour */ + /* - P_Right is the successor of P_Left in that contour */ + /* - y is the top of P_Left and P_Right */ + /* */ + /* lower stub: */ + /* */ + /* - P_Left and P_Right are in the same contour */ + /* - P_Left is the successor of P_Right in that contour */ + /* - y is the bottom of P_Left */ + /* */ + + /* FIXXXME: uncommenting this line solves the disappearing */ + /* bit problem in the `7' of verdana 10pts, but */ + /* makes a new one in the `C' of arial 14pts */ + +#if 0 + if ( x2 - x1 < ras.precision_half ) +#endif + { + /* upper stub test */ + if ( left->next == right && left->height <= 0 ) + return; + + /* lower stub test */ + if ( right->next == left && left->start == y ) + return; + } + + /* check that the rightmost pixel isn't set */ + + e1 = TRUNC( e1 ); + + c1 = (Short)( e1 >> 3 ); + f1 = (Short)( e1 & 7 ); + + if ( e1 >= 0 && e1 < ras.bWidth && + ras.bTarget[ras.traceOfs + c1] & ( 0x80 >> f1 ) ) + return; + + if ( ras.dropOutControl == 2 ) + e1 = e2; + else + e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); + + break; + + default: + return; /* unsupported mode */ + } + } + else + return; + } + + e1 = TRUNC( e1 ); + + if ( e1 >= 0 && e1 < ras.bWidth ) + { + c1 = (Short)( e1 >> 3 ); + f1 = (Short)( e1 & 7 ); + + if ( ras.gray_min_x > c1 ) ras.gray_min_x = c1; + if ( ras.gray_max_x < c1 ) ras.gray_max_x = c1; + + ras.bTarget[ras.traceOfs + c1] |= (char)( 0x80 >> f1 ); + } + } + + + static void + Vertical_Sweep_Step( RAS_ARG ) + { + ras.traceOfs += ras.traceIncr; + } + + + /***********************************************************************/ + /* */ + /* Horizontal Sweep Procedure Set */ + /* */ + /* These four routines are used during the horizontal black/white */ + /* sweep phase by the generic Draw_Sweep() function. */ + /* */ + /***********************************************************************/ + + static void + Horizontal_Sweep_Init( RAS_ARGS Short* min, + Short* max ) + { + /* nothing, really */ + FT_UNUSED_RASTER; + FT_UNUSED( min ); + FT_UNUSED( max ); + } + + + static void + Horizontal_Sweep_Span( RAS_ARGS Short y, + FT_F26Dot6 x1, + FT_F26Dot6 x2, + PProfile left, + PProfile right ) + { + Long e1, e2; + PByte bits; + Byte f1; + + FT_UNUSED( left ); + FT_UNUSED( right ); + + + if ( x2 - x1 < ras.precision ) + { + e1 = CEILING( x1 ); + e2 = FLOOR ( x2 ); + + if ( e1 == e2 ) + { + bits = ras.bTarget + ( y >> 3 ); + f1 = (Byte)( 0x80 >> ( y & 7 ) ); + + e1 = TRUNC( e1 ); + + if ( e1 >= 0 && e1 < ras.target.rows ) + { + PByte p; + + + p = bits - e1*ras.target.pitch; + if ( ras.target.pitch > 0 ) + p += ( ras.target.rows - 1 ) * ras.target.pitch; + + p[0] |= f1; + } + } + } + } + + + static void + Horizontal_Sweep_Drop( RAS_ARGS Short y, + FT_F26Dot6 x1, + FT_F26Dot6 x2, + PProfile left, + PProfile right ) + { + Long e1, e2; + PByte bits; + Byte f1; + + + /* During the horizontal sweep, we only take care of drop-outs */ + + e1 = CEILING( x1 ); + e2 = FLOOR ( x2 ); + + if ( e1 > e2 ) + { + if ( e1 == e2 + ras.precision ) + { + switch ( ras.dropOutControl ) + { + case 1: + e1 = e2; + break; + + case 4: + e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); + break; + + case 2: + case 5: + + /* Drop-out Control Rule #4 */ + + /* The spec is not very clear regarding rule #4. It */ + /* presents a method that is way too costly to implement */ + /* while the general idea seems to get rid of `stubs'. */ + /* */ + + /* rightmost stub test */ + if ( left->next == right && left->height <= 0 ) + return; + + /* leftmost stub test */ + if ( right->next == left && left->start == y ) + return; + + /* check that the rightmost pixel isn't set */ + + e1 = TRUNC( e1 ); + + bits = ras.bTarget + ( y >> 3 ); + f1 = (Byte)( 0x80 >> ( y & 7 ) ); + + bits -= e1 * ras.target.pitch; + if ( ras.target.pitch > 0 ) + bits += ( ras.target.rows - 1 ) * ras.target.pitch; + + if ( e1 >= 0 && + e1 < ras.target.rows && + *bits & f1 ) + return; + + if ( ras.dropOutControl == 2 ) + e1 = e2; + else + e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); + + break; + + default: + return; /* unsupported mode */ + } + } + else + return; + } + + bits = ras.bTarget + ( y >> 3 ); + f1 = (Byte)( 0x80 >> ( y & 7 ) ); + + e1 = TRUNC( e1 ); + + if ( e1 >= 0 && e1 < ras.target.rows ) + { + bits -= e1 * ras.target.pitch; + if ( ras.target.pitch > 0 ) + bits += ( ras.target.rows - 1 ) * ras.target.pitch; + + bits[0] |= f1; + } + } + + + static void + Horizontal_Sweep_Step( RAS_ARG ) + { + /* Nothing, really */ + FT_UNUSED_RASTER; + } + + +#ifdef FT_RASTER_OPTION_ANTI_ALIASING + + + /*************************************************************************/ + /* */ + /* Vertical Gray Sweep Procedure Set */ + /* */ + /* These two routines are used during the vertical gray-levels sweep */ + /* phase by the generic Draw_Sweep() function. */ + /* */ + /* NOTES */ + /* */ + /* - The target pixmap's width *must* be a multiple of 4. */ + /* */ + /* - You have to use the function Vertical_Sweep_Span() for the gray */ + /* span call. */ + /* */ + /*************************************************************************/ + + static void + Vertical_Gray_Sweep_Init( RAS_ARGS Short* min, + Short* max ) + { + Long pitch, byte_len; + + + *min = *min & -2; + *max = ( *max + 3 ) & -2; + + ras.traceOfs = 0; + pitch = ras.target.pitch; + byte_len = -pitch; + ras.traceIncr = (Short)byte_len; + ras.traceG = ( *min / 2 ) * byte_len; + + if ( pitch > 0 ) + { + ras.traceG += ( ras.target.rows - 1 ) * pitch; + byte_len = -byte_len; + } + + ras.gray_min_x = (Short)byte_len; + ras.gray_max_x = -(Short)byte_len; + } + + + static void + Vertical_Gray_Sweep_Step( RAS_ARG ) + { + Int c1, c2; + PByte pix, bit, bit2; + char* count = (char*)count_table; + Byte* grays; + + + ras.traceOfs += ras.gray_width; + + if ( ras.traceOfs > ras.gray_width ) + { + pix = ras.gTarget + ras.traceG + ras.gray_min_x * 4; + grays = ras.grays; + + if ( ras.gray_max_x >= 0 ) + { + Long last_pixel = ras.target.width - 1; + Int last_cell = last_pixel >> 2; + Int last_bit = last_pixel & 3; + Bool over = 0; + + + if ( ras.gray_max_x >= last_cell && last_bit != 3 ) + { + ras.gray_max_x = last_cell - 1; + over = 1; + } + + if ( ras.gray_min_x < 0 ) + ras.gray_min_x = 0; + + bit = ras.bTarget + ras.gray_min_x; + bit2 = bit + ras.gray_width; + + c1 = ras.gray_max_x - ras.gray_min_x; + + while ( c1 >= 0 ) + { + c2 = count[*bit] + count[*bit2]; + + if ( c2 ) + { + pix[0] = grays[(c2 >> 12) & 0x000F]; + pix[1] = grays[(c2 >> 8 ) & 0x000F]; + pix[2] = grays[(c2 >> 4 ) & 0x000F]; + pix[3] = grays[ c2 & 0x000F]; + + *bit = 0; + *bit2 = 0; + } + + bit++; + bit2++; + pix += 4; + c1--; + } + + if ( over ) + { + c2 = count[*bit] + count[*bit2]; + if ( c2 ) + { + switch ( last_bit ) + { + case 2: + pix[2] = grays[(c2 >> 4 ) & 0x000F]; + case 1: + pix[1] = grays[(c2 >> 8 ) & 0x000F]; + default: + pix[0] = grays[(c2 >> 12) & 0x000F]; + } + + *bit = 0; + *bit2 = 0; + } + } + } + + ras.traceOfs = 0; + ras.traceG += ras.traceIncr; + + ras.gray_min_x = 32000; + ras.gray_max_x = -32000; + } + } + + + static void + Horizontal_Gray_Sweep_Span( RAS_ARGS Short y, + FT_F26Dot6 x1, + FT_F26Dot6 x2, + PProfile left, + PProfile right ) + { + /* nothing, really */ + FT_UNUSED_RASTER; + FT_UNUSED( y ); + FT_UNUSED( x1 ); + FT_UNUSED( x2 ); + FT_UNUSED( left ); + FT_UNUSED( right ); + } + + + static void + Horizontal_Gray_Sweep_Drop( RAS_ARGS Short y, + FT_F26Dot6 x1, + FT_F26Dot6 x2, + PProfile left, + PProfile right ) + { + Long e1, e2; + PByte pixel; + Byte color; + + + /* During the horizontal sweep, we only take care of drop-outs */ + e1 = CEILING( x1 ); + e2 = FLOOR ( x2 ); + + if ( e1 > e2 ) + { + if ( e1 == e2 + ras.precision ) + { + switch ( ras.dropOutControl ) + { + case 1: + e1 = e2; + break; + + case 4: + e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); + break; + + case 2: + case 5: + + /* Drop-out Control Rule #4 */ + + /* The spec is not very clear regarding rule #4. It */ + /* presents a method that is way too costly to implement */ + /* while the general idea seems to get rid of `stubs'. */ + /* */ + + /* rightmost stub test */ + if ( left->next == right && left->height <= 0 ) + return; + + /* leftmost stub test */ + if ( right->next == left && left->start == y ) + return; + + if ( ras.dropOutControl == 2 ) + e1 = e2; + else + e1 = CEILING( ( x1 + x2 + 1 ) / 2 ); + + break; + + default: + return; /* unsupported mode */ + } + } + else + return; + } + + if ( e1 >= 0 ) + { + if ( x2 - x1 >= ras.precision_half ) + color = ras.grays[2]; + else + color = ras.grays[1]; + + e1 = TRUNC( e1 ) / 2; + if ( e1 < ras.target.rows ) + { + pixel = ras.gTarget - e1 * ras.target.pitch + y / 2; + if ( ras.target.pitch > 0 ) + pixel += ( ras.target.rows - 1 ) * ras.target.pitch; + + if ( pixel[0] == ras.grays[0] ) + pixel[0] = color; + } + } + } + + +#endif /* FT_RASTER_OPTION_ANTI_ALIASING */ + + + /*************************************************************************/ + /* */ + /* Generic Sweep Drawing routine */ + /* */ + /*************************************************************************/ + + static Bool + Draw_Sweep( RAS_ARG ) + { + Short y, y_change, y_height; + + PProfile P, Q, P_Left, P_Right; + + Short min_Y, max_Y, top, bottom, dropouts; + + Long x1, x2, xs, e1, e2; + + TProfileList waiting; + TProfileList draw_left, draw_right; + + + /* Init empty linked lists */ + + Init_Linked( &waiting ); + + Init_Linked( &draw_left ); + Init_Linked( &draw_right ); + + /* first, compute min and max Y */ + + P = ras.fProfile; + max_Y = (Short)TRUNC( ras.minY ); + min_Y = (Short)TRUNC( ras.maxY ); + + while ( P ) + { + Q = P->link; + + bottom = (Short)P->start; + top = (Short)( P->start + P->height - 1 ); + + if ( min_Y > bottom ) min_Y = bottom; + if ( max_Y < top ) max_Y = top; + + P->X = 0; + InsNew( &waiting, P ); + + P = Q; + } + + /* Check the Y-turns */ + if ( ras.numTurns == 0 ) + { + ras.error = Raster_Err_Invalid; + return FAILURE; + } + + /* Now inits the sweep */ + + ras.Proc_Sweep_Init( RAS_VARS &min_Y, &max_Y ); + + /* Then compute the distance of each profile from min_Y */ + + P = waiting; + + while ( P ) + { + P->countL = (UShort)( P->start - min_Y ); + P = P->link; + } + + /* Let's go */ + + y = min_Y; + y_height = 0; + + if ( ras.numTurns > 0 && + ras.sizeBuff[-ras.numTurns] == min_Y ) + ras.numTurns--; + + while ( ras.numTurns > 0 ) + { + /* look in the waiting list for new activations */ + + P = waiting; + + while ( P ) + { + Q = P->link; + P->countL -= y_height; + if ( P->countL == 0 ) + { + DelOld( &waiting, P ); + + switch ( P->flow ) + { + case Flow_Up: + InsNew( &draw_left, P ); + break; + + case Flow_Down: + InsNew( &draw_right, P ); + break; + } + } + + P = Q; + } + + /* Sort the drawing lists */ + + Sort( &draw_left ); + Sort( &draw_right ); + + y_change = (Short)ras.sizeBuff[-ras.numTurns--]; + y_height = (Short)( y_change - y ); + + while ( y < y_change ) + { + /* Let's trace */ + + dropouts = 0; + + P_Left = draw_left; + P_Right = draw_right; + + while ( P_Left ) + { + x1 = P_Left ->X; + x2 = P_Right->X; + + if ( x1 > x2 ) + { + xs = x1; + x1 = x2; + x2 = xs; + } + + if ( x2 - x1 <= ras.precision ) + { + e1 = FLOOR( x1 ); + e2 = CEILING( x2 ); + + if ( ras.dropOutControl != 0 && + ( e1 > e2 || e2 == e1 + ras.precision ) ) + { + /* a drop out was detected */ + + P_Left ->X = x1; + P_Right->X = x2; + + /* mark profile for drop-out processing */ + P_Left->countL = 1; + dropouts++; + + goto Skip_To_Next; + } + } + + ras.Proc_Sweep_Span( RAS_VARS y, x1, x2, P_Left, P_Right ); + + Skip_To_Next: + + P_Left = P_Left->link; + P_Right = P_Right->link; + } + + /* now perform the dropouts _after_ the span drawing -- */ + /* drop-outs processing has been moved out of the loop */ + /* for performance tuning */ + if ( dropouts > 0 ) + goto Scan_DropOuts; + + Next_Line: + + ras.Proc_Sweep_Step( RAS_VAR ); + + y++; + + if ( y < y_change ) + { + Sort( &draw_left ); + Sort( &draw_right ); + } + } + + /* Now finalize the profiles that needs it */ + + P = draw_left; + while ( P ) + { + Q = P->link; + if ( P->height == 0 ) + DelOld( &draw_left, P ); + P = Q; + } + + P = draw_right; + while ( P ) + { + Q = P->link; + if ( P->height == 0 ) + DelOld( &draw_right, P ); + P = Q; + } + } + + /* for gray-scaling, flushes the bitmap scanline cache */ + while ( y <= max_Y ) + { + ras.Proc_Sweep_Step( RAS_VAR ); + y++; + } + + return SUCCESS; + + Scan_DropOuts: + + P_Left = draw_left; + P_Right = draw_right; + + while ( P_Left ) + { + if ( P_Left->countL ) + { + P_Left->countL = 0; +#if 0 + dropouts--; /* -- this is useful when debugging only */ +#endif + ras.Proc_Sweep_Drop( RAS_VARS y, + P_Left->X, + P_Right->X, + P_Left, + P_Right ); + } + + P_Left = P_Left->link; + P_Right = P_Right->link; + } + + goto Next_Line; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Render_Single_Pass */ + /* */ + /* */ + /* Performs one sweep with sub-banding. */ + /* */ + /* */ + /* flipped :: If set, flip the direction of the outline. */ + /* */ + /* */ + /* Renderer error code. */ + /* */ + static int + Render_Single_Pass( RAS_ARGS Bool flipped ) + { + Short i, j, k; + + + while ( ras.band_top >= 0 ) + { + ras.maxY = (Long)ras.band_stack[ras.band_top].y_max * ras.precision; + ras.minY = (Long)ras.band_stack[ras.band_top].y_min * ras.precision; + + ras.top = ras.buff; + + ras.error = Raster_Err_None; + + if ( Convert_Glyph( RAS_VARS flipped ) ) + { + if ( ras.error != Raster_Err_Overflow ) + return FAILURE; + + ras.error = Raster_Err_None; + + /* sub-banding */ + +#ifdef DEBUG_RASTER + ClearBand( RAS_VARS TRUNC( ras.minY ), TRUNC( ras.maxY ) ); +#endif + + i = ras.band_stack[ras.band_top].y_min; + j = ras.band_stack[ras.band_top].y_max; + + k = (Short)( ( i + j ) / 2 ); + + if ( ras.band_top >= 7 || k < i ) + { + ras.band_top = 0; + ras.error = Raster_Err_Invalid; + + return ras.error; + } + + ras.band_stack[ras.band_top + 1].y_min = k; + ras.band_stack[ras.band_top + 1].y_max = j; + + ras.band_stack[ras.band_top].y_max = (Short)( k - 1 ); + + ras.band_top++; + } + else + { + if ( ras.fProfile ) + if ( Draw_Sweep( RAS_VAR ) ) + return ras.error; + ras.band_top--; + } + } + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Render_Glyph */ + /* */ + /* */ + /* Renders a glyph in a bitmap. Sub-banding if needed. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + Render_Glyph( RAS_ARG ) + { + FT_Error error; + + + Set_High_Precision( RAS_VARS ras.outline.flags & + FT_OUTLINE_HIGH_PRECISION ); + ras.scale_shift = ras.precision_shift; + /* Drop-out mode 2 is hard-coded since this is the only mode used */ + /* on Windows platforms. Using other modes, as specified by the */ + /* font, results in misplaced pixels. */ + ras.dropOutControl = 2; + ras.second_pass = (FT_Byte)( !( ras.outline.flags & + FT_OUTLINE_SINGLE_PASS ) ); + + /* Vertical Sweep */ + ras.Proc_Sweep_Init = Vertical_Sweep_Init; + ras.Proc_Sweep_Span = Vertical_Sweep_Span; + ras.Proc_Sweep_Drop = Vertical_Sweep_Drop; + ras.Proc_Sweep_Step = Vertical_Sweep_Step; + + ras.band_top = 0; + ras.band_stack[0].y_min = 0; + ras.band_stack[0].y_max = (short)( ras.target.rows - 1 ); + + ras.bWidth = (unsigned short)ras.target.width; + ras.bTarget = (Byte*)ras.target.buffer; + + if ( ( error = Render_Single_Pass( RAS_VARS 0 ) ) != 0 ) + return error; + + /* Horizontal Sweep */ + if ( ras.second_pass && ras.dropOutControl != 0 ) + { + ras.Proc_Sweep_Init = Horizontal_Sweep_Init; + ras.Proc_Sweep_Span = Horizontal_Sweep_Span; + ras.Proc_Sweep_Drop = Horizontal_Sweep_Drop; + ras.Proc_Sweep_Step = Horizontal_Sweep_Step; + + ras.band_top = 0; + ras.band_stack[0].y_min = 0; + ras.band_stack[0].y_max = (short)( ras.target.width - 1 ); + + if ( ( error = Render_Single_Pass( RAS_VARS 1 ) ) != 0 ) + return error; + } + + return Raster_Err_None; + } + + +#ifdef FT_RASTER_OPTION_ANTI_ALIASING + + + /*************************************************************************/ + /* */ + /* */ + /* Render_Gray_Glyph */ + /* */ + /* */ + /* Renders a glyph with grayscaling. Sub-banding if needed. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + Render_Gray_Glyph( RAS_ARG ) + { + Long pixel_width; + FT_Error error; + + + Set_High_Precision( RAS_VARS ras.outline.flags & + FT_OUTLINE_HIGH_PRECISION ); + ras.scale_shift = ras.precision_shift + 1; + /* Drop-out mode 2 is hard-coded since this is the only mode used */ + /* on Windows platforms. Using other modes, as specified by the */ + /* font, results in misplaced pixels. */ + ras.dropOutControl = 2; + ras.second_pass = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS ); + + /* Vertical Sweep */ + + ras.band_top = 0; + ras.band_stack[0].y_min = 0; + ras.band_stack[0].y_max = 2 * ras.target.rows - 1; + + ras.bWidth = ras.gray_width; + pixel_width = 2 * ( ( ras.target.width + 3 ) >> 2 ); + + if ( ras.bWidth > pixel_width ) + ras.bWidth = pixel_width; + + ras.bWidth = ras.bWidth * 8; + ras.bTarget = (Byte*)ras.gray_lines; + ras.gTarget = (Byte*)ras.target.buffer; + + ras.Proc_Sweep_Init = Vertical_Gray_Sweep_Init; + ras.Proc_Sweep_Span = Vertical_Sweep_Span; + ras.Proc_Sweep_Drop = Vertical_Sweep_Drop; + ras.Proc_Sweep_Step = Vertical_Gray_Sweep_Step; + + error = Render_Single_Pass( RAS_VARS 0 ); + if ( error ) + return error; + + /* Horizontal Sweep */ + if ( ras.second_pass && ras.dropOutControl != 0 ) + { + ras.Proc_Sweep_Init = Horizontal_Sweep_Init; + ras.Proc_Sweep_Span = Horizontal_Gray_Sweep_Span; + ras.Proc_Sweep_Drop = Horizontal_Gray_Sweep_Drop; + ras.Proc_Sweep_Step = Horizontal_Sweep_Step; + + ras.band_top = 0; + ras.band_stack[0].y_min = 0; + ras.band_stack[0].y_max = ras.target.width * 2 - 1; + + error = Render_Single_Pass( RAS_VARS 1 ); + if ( error ) + return error; + } + + return Raster_Err_None; + } + +#else /* !FT_RASTER_OPTION_ANTI_ALIASING */ + + FT_LOCAL_DEF( FT_Error ) + Render_Gray_Glyph( RAS_ARG ) + { + FT_UNUSED_RASTER; + + return Raster_Err_Unsupported; + } + +#endif /* !FT_RASTER_OPTION_ANTI_ALIASING */ + + + static void + ft_black_init( PRaster raster ) + { + FT_UNUSED( raster ); + +#ifdef FT_RASTER_OPTION_ANTI_ALIASING + FT_UInt n; + + + /* set default 5-levels gray palette */ + for ( n = 0; n < 5; n++ ) + raster->grays[n] = n * 255 / 4; + + raster->gray_width = RASTER_GRAY_LINES / 2; + +#endif + } + + + /**** RASTER OBJECT CREATION: In standalone mode, we simply use *****/ + /**** a static object. *****/ + + +#ifdef _STANDALONE_ + + + static int + ft_black_new( void* memory, + FT_Raster *araster ) + { + static TRaster the_raster; + + + *araster = (FT_Raster)&the_raster; + FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) ); + ft_black_init( &the_raster ); + + return 0; + } + + + static void + ft_black_done( FT_Raster raster ) + { + /* nothing */ + FT_UNUSED( raster ); + } + + +#else /* _STANDALONE_ */ + + + static int + ft_black_new( FT_Memory memory, + PRaster *araster ) + { + FT_Error error; + PRaster raster; + + + *araster = 0; + if ( !FT_NEW( raster ) ) + { + raster->memory = memory; + ft_black_init( raster ); + + *araster = raster; + } + + return error; + } + + + static void + ft_black_done( PRaster raster ) + { + FT_Memory memory = (FT_Memory)raster->memory; + FT_FREE( raster ); + } + + +#endif /* _STANDALONE_ */ + + + static void + ft_black_reset( PRaster raster, + char* pool_base, + long pool_size ) + { + if ( raster ) + { + if ( pool_base && pool_size >= (long)sizeof(TWorker) + 2048 ) + { + PWorker worker = (PWorker)pool_base; + + + raster->buffer = pool_base + ( (sizeof ( *worker ) + 7 ) & ~7 ); + raster->buffer_size = ( ( pool_base + pool_size ) - + (char*)raster->buffer ) / sizeof ( Long ); + raster->worker = worker; + } + else + { + raster->buffer = NULL; + raster->buffer_size = 0; + raster->worker = NULL; + } + } + } + + + static void + ft_black_set_mode( PRaster raster, + unsigned long mode, + const char* palette ) + { +#ifdef FT_RASTER_OPTION_ANTI_ALIASING + + if ( mode == FT_MAKE_TAG( 'p', 'a', 'l', '5' ) ) + { + /* set 5-levels gray palette */ + raster->grays[0] = palette[0]; + raster->grays[1] = palette[1]; + raster->grays[2] = palette[2]; + raster->grays[3] = palette[3]; + raster->grays[4] = palette[4]; + } + +#else + + FT_UNUSED( raster ); + FT_UNUSED( mode ); + FT_UNUSED( palette ); + +#endif + } + + + static int + ft_black_render( PRaster raster, + const FT_Raster_Params* params ) + { + const FT_Outline* outline = (const FT_Outline*)params->source; + const FT_Bitmap* target_map = params->target; + PWorker worker; + + + if ( !raster || !raster->buffer || !raster->buffer_size ) + return Raster_Err_Not_Ini; + + /* return immediately if the outline is empty */ + if ( outline->n_points == 0 || outline->n_contours <= 0 ) + return Raster_Err_None; + + if ( !outline || !outline->contours || !outline->points ) + return Raster_Err_Invalid; + + if ( outline->n_points != outline->contours[outline->n_contours - 1] + 1 ) + return Raster_Err_Invalid; + + worker = raster->worker; + + /* this version of the raster does not support direct rendering, sorry */ + if ( params->flags & FT_RASTER_FLAG_DIRECT ) + return Raster_Err_Unsupported; + + if ( !target_map || !target_map->buffer ) + return Raster_Err_Invalid; + + ras.outline = *outline; + ras.target = *target_map; + + worker->buff = (PLong) raster->buffer; + worker->sizeBuff = worker->buff + + raster->buffer_size / sizeof ( Long ); +#ifdef FT_RASTER_OPTION_ANTI_ALIASING + worker->grays = raster->grays; + worker->gray_width = raster->gray_width; +#endif + + return ( ( params->flags & FT_RASTER_FLAG_AA ) + ? Render_Gray_Glyph( RAS_VAR ) + : Render_Glyph( RAS_VAR ) ); + } + + + const FT_Raster_Funcs ft_standard_raster = + { + FT_GLYPH_FORMAT_OUTLINE, + (FT_Raster_New_Func) ft_black_new, + (FT_Raster_Reset_Func) ft_black_reset, + (FT_Raster_Set_Mode_Func)ft_black_set_mode, + (FT_Raster_Render_Func) ft_black_render, + (FT_Raster_Done_Func) ft_black_done + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/raster/ftraster.h b/reactos/dll/3rdparty/freetype/src/raster/ftraster.h index 80fe46debaf..b9c872d5e16 100644 --- a/reactos/dll/3rdparty/freetype/src/raster/ftraster.h +++ b/reactos/dll/3rdparty/freetype/src/raster/ftraster.h @@ -1,46 +1,46 @@ -/***************************************************************************/ -/* */ -/* ftraster.h */ -/* */ -/* The FreeType glyph rasterizer (specification). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used */ -/* modified and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTRASTER_H__ -#define __FTRASTER_H__ - - -#include -#include FT_CONFIG_CONFIG_H -#include FT_IMAGE_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* Uncomment the following line if you are using ftraster.c as a */ - /* standalone module, fully independent of FreeType. */ - /* */ -/* #define _STANDALONE_ */ - - FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster; - - -FT_END_HEADER - -#endif /* __FTRASTER_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftraster.h */ +/* */ +/* The FreeType glyph rasterizer (specification). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used */ +/* modified and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTRASTER_H__ +#define __FTRASTER_H__ + + +#include +#include FT_CONFIG_CONFIG_H +#include FT_IMAGE_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* Uncomment the following line if you are using ftraster.c as a */ + /* standalone module, fully independent of FreeType. */ + /* */ +/* #define _STANDALONE_ */ + + FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster; + + +FT_END_HEADER + +#endif /* __FTRASTER_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/raster/ftrend1.c b/reactos/dll/3rdparty/freetype/src/raster/ftrend1.c index 3cc8d07413b..afc8f9a0a12 100644 --- a/reactos/dll/3rdparty/freetype/src/raster/ftrend1.c +++ b/reactos/dll/3rdparty/freetype/src/raster/ftrend1.c @@ -1,273 +1,273 @@ -/***************************************************************************/ -/* */ -/* ftrend1.c */ -/* */ -/* The FreeType glyph rasterizer interface (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_OBJECTS_H -#include FT_OUTLINE_H -#include "ftrend1.h" -#include "ftraster.h" - -#include "rasterrs.h" - - - /* initialize renderer -- init its raster */ - static FT_Error - ft_raster1_init( FT_Renderer render ) - { - FT_Library library = FT_MODULE_LIBRARY( render ); - - - render->clazz->raster_class->raster_reset( render->raster, - library->raster_pool, - library->raster_pool_size ); - - return Raster_Err_Ok; - } - - - /* set render-specific mode */ - static FT_Error - ft_raster1_set_mode( FT_Renderer render, - FT_ULong mode_tag, - FT_Pointer data ) - { - /* we simply pass it to the raster */ - return render->clazz->raster_class->raster_set_mode( render->raster, - mode_tag, - data ); - } - - - /* transform a given glyph image */ - static FT_Error - ft_raster1_transform( FT_Renderer render, - FT_GlyphSlot slot, - const FT_Matrix* matrix, - const FT_Vector* delta ) - { - FT_Error error = Raster_Err_Ok; - - - if ( slot->format != render->glyph_format ) - { - error = Raster_Err_Invalid_Argument; - goto Exit; - } - - if ( matrix ) - FT_Outline_Transform( &slot->outline, matrix ); - - if ( delta ) - FT_Outline_Translate( &slot->outline, delta->x, delta->y ); - - Exit: - return error; - } - - - /* return the glyph's control box */ - static void - ft_raster1_get_cbox( FT_Renderer render, - FT_GlyphSlot slot, - FT_BBox* cbox ) - { - FT_MEM_ZERO( cbox, sizeof ( *cbox ) ); - - if ( slot->format == render->glyph_format ) - FT_Outline_Get_CBox( &slot->outline, cbox ); - } - - - /* convert a slot's glyph image into a bitmap */ - static FT_Error - ft_raster1_render( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin ) - { - FT_Error error; - FT_Outline* outline; - FT_BBox cbox; - FT_UInt width, height, pitch; - FT_Bitmap* bitmap; - FT_Memory memory; - - FT_Raster_Params params; - - - /* check glyph image format */ - if ( slot->format != render->glyph_format ) - { - error = Raster_Err_Invalid_Argument; - goto Exit; - } - - /* check rendering mode */ - if ( mode != FT_RENDER_MODE_MONO ) - { - /* raster1 is only capable of producing monochrome bitmaps */ - if ( render->clazz == &ft_raster1_renderer_class ) - return Raster_Err_Cannot_Render_Glyph; - } - else - { - /* raster5 is only capable of producing 5-gray-levels bitmaps */ - if ( render->clazz == &ft_raster5_renderer_class ) - return Raster_Err_Cannot_Render_Glyph; - } - - outline = &slot->outline; - - /* translate the outline to the new origin if needed */ - if ( origin ) - FT_Outline_Translate( outline, origin->x, origin->y ); - - /* compute the control box, and grid fit it */ - FT_Outline_Get_CBox( outline, &cbox ); - - cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); - cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); - - width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); - height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); - bitmap = &slot->bitmap; - memory = render->root.memory; - - /* release old bitmap buffer */ - if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) - { - FT_FREE( bitmap->buffer ); - slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; - } - - /* allocate new one, depends on pixel format */ - if ( !( mode & FT_RENDER_MODE_MONO ) ) - { - /* we pad to 32 bits, only for backwards compatibility with FT 1.x */ - pitch = FT_PAD_CEIL( width, 4 ); - bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; - bitmap->num_grays = 256; - } - else - { - pitch = ( ( width + 15 ) >> 4 ) << 1; - bitmap->pixel_mode = FT_PIXEL_MODE_MONO; - } - - bitmap->width = width; - bitmap->rows = height; - bitmap->pitch = pitch; - - if ( FT_ALLOC_MULT( bitmap->buffer, pitch, height ) ) - goto Exit; - - slot->internal->flags |= FT_GLYPH_OWN_BITMAP; - - /* translate outline to render it into the bitmap */ - FT_Outline_Translate( outline, -cbox.xMin, -cbox.yMin ); - - /* set up parameters */ - params.target = bitmap; - params.source = outline; - params.flags = 0; - - if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY ) - params.flags |= FT_RASTER_FLAG_AA; - - /* render outline into the bitmap */ - error = render->raster_render( render->raster, ¶ms ); - - FT_Outline_Translate( outline, cbox.xMin, cbox.yMin ); - - if ( error ) - goto Exit; - - slot->format = FT_GLYPH_FORMAT_BITMAP; - slot->bitmap_left = (FT_Int)( cbox.xMin >> 6 ); - slot->bitmap_top = (FT_Int)( cbox.yMax >> 6 ); - - Exit: - return error; - } - - - FT_CALLBACK_TABLE_DEF - const FT_Renderer_Class ft_raster1_renderer_class = - { - { - FT_MODULE_RENDERER, - sizeof( FT_RendererRec ), - - "raster1", - 0x10000L, - 0x20000L, - - 0, /* module specific interface */ - - (FT_Module_Constructor)ft_raster1_init, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 - }, - - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Renderer_RenderFunc) ft_raster1_render, - (FT_Renderer_TransformFunc)ft_raster1_transform, - (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, - (FT_Renderer_SetModeFunc) ft_raster1_set_mode, - - (FT_Raster_Funcs*) &ft_standard_raster - }; - - - /* This renderer is _NOT_ part of the default modules; you will need */ - /* to register it by hand in your application. It should only be */ - /* used for backwards-compatibility with FT 1.x anyway. */ - /* */ - FT_CALLBACK_TABLE_DEF - const FT_Renderer_Class ft_raster5_renderer_class = - { - { - FT_MODULE_RENDERER, - sizeof( FT_RendererRec ), - - "raster5", - 0x10000L, - 0x20000L, - - 0, /* module specific interface */ - - (FT_Module_Constructor)ft_raster1_init, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 - }, - - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Renderer_RenderFunc) ft_raster1_render, - (FT_Renderer_TransformFunc)ft_raster1_transform, - (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, - (FT_Renderer_SetModeFunc) ft_raster1_set_mode, - - (FT_Raster_Funcs*) &ft_standard_raster - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* ftrend1.c */ +/* */ +/* The FreeType glyph rasterizer interface (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_OBJECTS_H +#include FT_OUTLINE_H +#include "ftrend1.h" +#include "ftraster.h" + +#include "rasterrs.h" + + + /* initialize renderer -- init its raster */ + static FT_Error + ft_raster1_init( FT_Renderer render ) + { + FT_Library library = FT_MODULE_LIBRARY( render ); + + + render->clazz->raster_class->raster_reset( render->raster, + library->raster_pool, + library->raster_pool_size ); + + return Raster_Err_Ok; + } + + + /* set render-specific mode */ + static FT_Error + ft_raster1_set_mode( FT_Renderer render, + FT_ULong mode_tag, + FT_Pointer data ) + { + /* we simply pass it to the raster */ + return render->clazz->raster_class->raster_set_mode( render->raster, + mode_tag, + data ); + } + + + /* transform a given glyph image */ + static FT_Error + ft_raster1_transform( FT_Renderer render, + FT_GlyphSlot slot, + const FT_Matrix* matrix, + const FT_Vector* delta ) + { + FT_Error error = Raster_Err_Ok; + + + if ( slot->format != render->glyph_format ) + { + error = Raster_Err_Invalid_Argument; + goto Exit; + } + + if ( matrix ) + FT_Outline_Transform( &slot->outline, matrix ); + + if ( delta ) + FT_Outline_Translate( &slot->outline, delta->x, delta->y ); + + Exit: + return error; + } + + + /* return the glyph's control box */ + static void + ft_raster1_get_cbox( FT_Renderer render, + FT_GlyphSlot slot, + FT_BBox* cbox ) + { + FT_MEM_ZERO( cbox, sizeof ( *cbox ) ); + + if ( slot->format == render->glyph_format ) + FT_Outline_Get_CBox( &slot->outline, cbox ); + } + + + /* convert a slot's glyph image into a bitmap */ + static FT_Error + ft_raster1_render( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) + { + FT_Error error; + FT_Outline* outline; + FT_BBox cbox; + FT_UInt width, height, pitch; + FT_Bitmap* bitmap; + FT_Memory memory; + + FT_Raster_Params params; + + + /* check glyph image format */ + if ( slot->format != render->glyph_format ) + { + error = Raster_Err_Invalid_Argument; + goto Exit; + } + + /* check rendering mode */ + if ( mode != FT_RENDER_MODE_MONO ) + { + /* raster1 is only capable of producing monochrome bitmaps */ + if ( render->clazz == &ft_raster1_renderer_class ) + return Raster_Err_Cannot_Render_Glyph; + } + else + { + /* raster5 is only capable of producing 5-gray-levels bitmaps */ + if ( render->clazz == &ft_raster5_renderer_class ) + return Raster_Err_Cannot_Render_Glyph; + } + + outline = &slot->outline; + + /* translate the outline to the new origin if needed */ + if ( origin ) + FT_Outline_Translate( outline, origin->x, origin->y ); + + /* compute the control box, and grid fit it */ + FT_Outline_Get_CBox( outline, &cbox ); + + cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); + cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); + cbox.xMax = FT_PIX_CEIL( cbox.xMax ); + cbox.yMax = FT_PIX_CEIL( cbox.yMax ); + + width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); + height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); + bitmap = &slot->bitmap; + memory = render->root.memory; + + /* release old bitmap buffer */ + if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) + { + FT_FREE( bitmap->buffer ); + slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; + } + + /* allocate new one, depends on pixel format */ + if ( !( mode & FT_RENDER_MODE_MONO ) ) + { + /* we pad to 32 bits, only for backwards compatibility with FT 1.x */ + pitch = FT_PAD_CEIL( width, 4 ); + bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; + bitmap->num_grays = 256; + } + else + { + pitch = ( ( width + 15 ) >> 4 ) << 1; + bitmap->pixel_mode = FT_PIXEL_MODE_MONO; + } + + bitmap->width = width; + bitmap->rows = height; + bitmap->pitch = pitch; + + if ( FT_ALLOC_MULT( bitmap->buffer, pitch, height ) ) + goto Exit; + + slot->internal->flags |= FT_GLYPH_OWN_BITMAP; + + /* translate outline to render it into the bitmap */ + FT_Outline_Translate( outline, -cbox.xMin, -cbox.yMin ); + + /* set up parameters */ + params.target = bitmap; + params.source = outline; + params.flags = 0; + + if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY ) + params.flags |= FT_RASTER_FLAG_AA; + + /* render outline into the bitmap */ + error = render->raster_render( render->raster, ¶ms ); + + FT_Outline_Translate( outline, cbox.xMin, cbox.yMin ); + + if ( error ) + goto Exit; + + slot->format = FT_GLYPH_FORMAT_BITMAP; + slot->bitmap_left = (FT_Int)( cbox.xMin >> 6 ); + slot->bitmap_top = (FT_Int)( cbox.yMax >> 6 ); + + Exit: + return error; + } + + + FT_CALLBACK_TABLE_DEF + const FT_Renderer_Class ft_raster1_renderer_class = + { + { + FT_MODULE_RENDERER, + sizeof( FT_RendererRec ), + + "raster1", + 0x10000L, + 0x20000L, + + 0, /* module specific interface */ + + (FT_Module_Constructor)ft_raster1_init, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Renderer_RenderFunc) ft_raster1_render, + (FT_Renderer_TransformFunc)ft_raster1_transform, + (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, + (FT_Renderer_SetModeFunc) ft_raster1_set_mode, + + (FT_Raster_Funcs*) &ft_standard_raster + }; + + + /* This renderer is _NOT_ part of the default modules; you will need */ + /* to register it by hand in your application. It should only be */ + /* used for backwards-compatibility with FT 1.x anyway. */ + /* */ + FT_CALLBACK_TABLE_DEF + const FT_Renderer_Class ft_raster5_renderer_class = + { + { + FT_MODULE_RENDERER, + sizeof( FT_RendererRec ), + + "raster5", + 0x10000L, + 0x20000L, + + 0, /* module specific interface */ + + (FT_Module_Constructor)ft_raster1_init, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Renderer_RenderFunc) ft_raster1_render, + (FT_Renderer_TransformFunc)ft_raster1_transform, + (FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, + (FT_Renderer_SetModeFunc) ft_raster1_set_mode, + + (FT_Raster_Funcs*) &ft_standard_raster + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/raster/ftrend1.h b/reactos/dll/3rdparty/freetype/src/raster/ftrend1.h index 76e9a5f581e..5c1daec17bd 100644 --- a/reactos/dll/3rdparty/freetype/src/raster/ftrend1.h +++ b/reactos/dll/3rdparty/freetype/src/raster/ftrend1.h @@ -1,44 +1,44 @@ -/***************************************************************************/ -/* */ -/* ftrend1.h */ -/* */ -/* The FreeType glyph rasterizer interface (specification). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTREND1_H__ -#define __FTREND1_H__ - - -#include -#include FT_RENDER_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster1_renderer_class; - - /* this renderer is _NOT_ part of the default modules, you'll need */ - /* to register it by hand in your application. It should only be */ - /* used for backwards-compatibility with FT 1.x anyway. */ - /* */ - FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster5_renderer_class; - - -FT_END_HEADER - -#endif /* __FTREND1_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftrend1.h */ +/* */ +/* The FreeType glyph rasterizer interface (specification). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTREND1_H__ +#define __FTREND1_H__ + + +#include +#include FT_RENDER_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster1_renderer_class; + + /* this renderer is _NOT_ part of the default modules, you'll need */ + /* to register it by hand in your application. It should only be */ + /* used for backwards-compatibility with FT 1.x anyway. */ + /* */ + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster5_renderer_class; + + +FT_END_HEADER + +#endif /* __FTREND1_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/raster/raster.c b/reactos/dll/3rdparty/freetype/src/raster/raster.c index f13a67a209d..44d30e98c67 100644 --- a/reactos/dll/3rdparty/freetype/src/raster/raster.c +++ b/reactos/dll/3rdparty/freetype/src/raster/raster.c @@ -1,26 +1,26 @@ -/***************************************************************************/ -/* */ -/* raster.c */ -/* */ -/* FreeType monochrome rasterer module component (body only). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "ftraster.c" -#include "ftrend1.c" - - -/* END */ +/***************************************************************************/ +/* */ +/* raster.c */ +/* */ +/* FreeType monochrome rasterer module component (body only). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "ftraster.c" +#include "ftrend1.c" + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/raster/rasterrs.h b/reactos/dll/3rdparty/freetype/src/raster/rasterrs.h index 5df9a7ab1ed..eb5f381b157 100644 --- a/reactos/dll/3rdparty/freetype/src/raster/rasterrs.h +++ b/reactos/dll/3rdparty/freetype/src/raster/rasterrs.h @@ -1,41 +1,41 @@ -/***************************************************************************/ -/* */ -/* rasterrs.h */ -/* */ -/* monochrome renderer error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the monochrome renderer error enumeration */ - /* constants. */ - /* */ - /*************************************************************************/ - -#ifndef __RASTERRS_H__ -#define __RASTERRS_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX Raster_Err_ -#define FT_ERR_BASE FT_Mod_Err_Raster - -#include FT_ERRORS_H - -#endif /* __RASTERRS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* rasterrs.h */ +/* */ +/* monochrome renderer error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the monochrome renderer error enumeration */ + /* constants. */ + /* */ + /*************************************************************************/ + +#ifndef __RASTERRS_H__ +#define __RASTERRS_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX Raster_Err_ +#define FT_ERR_BASE FT_Mod_Err_Raster + +#include FT_ERRORS_H + +#endif /* __RASTERRS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.c b/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.c index 5ba22a6c51c..16687fcbdd9 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.c @@ -1,618 +1,618 @@ -/***************************************************************************/ -/* */ -/* sfdriver.c */ -/* */ -/* High-level SFNT driver interface (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_OBJECTS_H - -#include "sfdriver.h" -#include "ttload.h" -#include "sfobjs.h" - -#include "sferrors.h" - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS -#include "ttsbit.h" -#endif - -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES -#include "ttpost.h" -#endif - -#ifdef TT_CONFIG_OPTION_BDF -#include "ttbdf.h" -#include FT_SERVICE_BDF_H -#endif - -#include "ttcmap.h" -#include "ttkern.h" -#include "ttmtx.h" - -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_SFNT_H -#include FT_SERVICE_TT_CMAP_H - - - /* - * SFNT TABLE SERVICE - * - */ - - static void* - get_sfnt_table( TT_Face face, - FT_Sfnt_Tag tag ) - { - void* table; - - - switch ( tag ) - { - case ft_sfnt_head: - table = &face->header; - break; - - case ft_sfnt_hhea: - table = &face->horizontal; - break; - - case ft_sfnt_vhea: - table = face->vertical_info ? &face->vertical : 0; - break; - - case ft_sfnt_os2: - table = face->os2.version == 0xFFFFU ? 0 : &face->os2; - break; - - case ft_sfnt_post: - table = &face->postscript; - break; - - case ft_sfnt_maxp: - table = &face->max_profile; - break; - - case ft_sfnt_pclt: - table = face->pclt.Version ? &face->pclt : 0; - break; - - default: - table = 0; - } - - return table; - } - - - static FT_Error - sfnt_table_info( TT_Face face, - FT_UInt idx, - FT_ULong *tag, - FT_ULong *length ) - { - if ( !tag || !length ) - return SFNT_Err_Invalid_Argument; - - if ( idx >= face->num_tables ) - return SFNT_Err_Table_Missing; - - *tag = face->dir_tables[idx].Tag; - *length = face->dir_tables[idx].Length; - - return SFNT_Err_Ok; - } - - - static const FT_Service_SFNT_TableRec sfnt_service_sfnt_table = - { - (FT_SFNT_TableLoadFunc)tt_face_load_any, - (FT_SFNT_TableGetFunc) get_sfnt_table, - (FT_SFNT_TableInfoFunc)sfnt_table_info - }; - - -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - - /* - * GLYPH DICT SERVICE - * - */ - - static FT_Error - sfnt_get_glyph_name( TT_Face face, - FT_UInt glyph_index, - FT_Pointer buffer, - FT_UInt buffer_max ) - { - FT_String* gname; - FT_Error error; - - - error = tt_face_get_ps_name( face, glyph_index, &gname ); - if ( !error ) - FT_STRCPYN( buffer, gname, buffer_max ); - - return error; - } - - - static const FT_Service_GlyphDictRec sfnt_service_glyph_dict = - { - (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)NULL - }; - -#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ - - - /* - * POSTSCRIPT NAME SERVICE - * - */ - - static const char* - sfnt_get_ps_name( TT_Face face ) - { - FT_Int n, found_win, found_apple; - const char* result = NULL; - - - /* shouldn't happen, but just in case to avoid memory leaks */ - if ( face->postscript_name ) - return face->postscript_name; - - /* scan the name table to see whether we have a Postscript name here, */ - /* either in Macintosh or Windows platform encodings */ - found_win = -1; - found_apple = -1; - - for ( n = 0; n < face->num_names; n++ ) - { - TT_NameEntryRec* name = face->name_table.names + n; - - - if ( name->nameID == 6 && name->stringLength > 0 ) - { - if ( name->platformID == 3 && - name->encodingID == 1 && - name->languageID == 0x409 ) - found_win = n; - - if ( name->platformID == 1 && - name->encodingID == 0 && - name->languageID == 0 ) - found_apple = n; - } - } - - if ( found_win != -1 ) - { - FT_Memory memory = face->root.memory; - TT_NameEntryRec* name = face->name_table.names + found_win; - FT_UInt len = name->stringLength / 2; - FT_Error error = SFNT_Err_Ok; - - FT_UNUSED( error ); - - - if ( !FT_ALLOC( result, name->stringLength + 1 ) ) - { - FT_Stream stream = face->name_table.stream; - FT_String* r = (FT_String*)result; - FT_Byte* p = (FT_Byte*)name->string; - - - if ( FT_STREAM_SEEK( name->stringOffset ) || - FT_FRAME_ENTER( name->stringLength ) ) - { - FT_FREE( result ); - name->stringLength = 0; - name->stringOffset = 0; - FT_FREE( name->string ); - - goto Exit; - } - - p = (FT_Byte*)stream->cursor; - - for ( ; len > 0; len--, p += 2 ) - { - if ( p[0] == 0 && p[1] >= 32 && p[1] < 128 ) - *r++ = p[1]; - } - *r = '\0'; - - FT_FRAME_EXIT(); - } - goto Exit; - } - - if ( found_apple != -1 ) - { - FT_Memory memory = face->root.memory; - TT_NameEntryRec* name = face->name_table.names + found_apple; - FT_UInt len = name->stringLength; - FT_Error error = SFNT_Err_Ok; - - FT_UNUSED( error ); - - - if ( !FT_ALLOC( result, len + 1 ) ) - { - FT_Stream stream = face->name_table.stream; - - - if ( FT_STREAM_SEEK( name->stringOffset ) || - FT_STREAM_READ( result, len ) ) - { - name->stringOffset = 0; - name->stringLength = 0; - FT_FREE( name->string ); - FT_FREE( result ); - goto Exit; - } - ((char*)result)[len] = '\0'; - } - } - - Exit: - face->postscript_name = result; - return result; - } - - static const FT_Service_PsFontNameRec sfnt_service_ps_name = - { - (FT_PsName_GetFunc)sfnt_get_ps_name - }; - - - /* - * TT CMAP INFO - */ - static const FT_Service_TTCMapsRec tt_service_get_cmap_info = - { - (TT_CMap_Info_GetFunc)tt_get_cmap_info - }; - - -#ifdef TT_CONFIG_OPTION_BDF - - static FT_Error - sfnt_get_charset_id( TT_Face face, - const char* *acharset_encoding, - const char* *acharset_registry ) - { - BDF_PropertyRec encoding, registry; - FT_Error error; - - - /* XXX: I don't know whether this is correct, since - * tt_face_find_bdf_prop only returns something correct if we have - * previously selected a size that is listed in the BDF table. - * Should we change the BDF table format to include single offsets - * for `CHARSET_REGISTRY' and `CHARSET_ENCODING'? - */ - error = tt_face_find_bdf_prop( face, "CHARSET_REGISTRY", ®istry ); - if ( !error ) - { - error = tt_face_find_bdf_prop( face, "CHARSET_ENCODING", &encoding ); - if ( !error ) - { - if ( registry.type == BDF_PROPERTY_TYPE_ATOM && - encoding.type == BDF_PROPERTY_TYPE_ATOM ) - { - *acharset_encoding = encoding.u.atom; - *acharset_registry = registry.u.atom; - } - else - error = FT_Err_Invalid_Argument; - } - } - - return error; - } - - - static const FT_Service_BDFRec sfnt_service_bdf = - { - (FT_BDF_GetCharsetIdFunc) sfnt_get_charset_id, - (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop, - }; - -#endif /* TT_CONFIG_OPTION_BDF */ - - - /* - * SERVICE LIST - */ - - static const FT_ServiceDescRec sfnt_services[] = - { - { FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table }, - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name }, -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - { FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict }, -#endif -#ifdef TT_CONFIG_OPTION_BDF - { FT_SERVICE_ID_BDF, &sfnt_service_bdf }, -#endif - { FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info }, - - { NULL, NULL } - }; - - - FT_CALLBACK_DEF( FT_Module_Interface ) - sfnt_get_interface( FT_Module module, - const char* module_interface ) - { - FT_UNUSED( module ); - - return ft_service_list_lookup( sfnt_services, module_interface ); - } - - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - FT_CALLBACK_DEF( FT_Error ) - tt_face_load_sfnt_header_stub( TT_Face face, - FT_Stream stream, - FT_Long face_index, - SFNT_Header header ) - { - FT_UNUSED( face ); - FT_UNUSED( stream ); - FT_UNUSED( face_index ); - FT_UNUSED( header ); - - return FT_Err_Unimplemented_Feature; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_face_load_directory_stub( TT_Face face, - FT_Stream stream, - SFNT_Header header ) - { - FT_UNUSED( face ); - FT_UNUSED( stream ); - FT_UNUSED( header ); - - return FT_Err_Unimplemented_Feature; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_face_load_hdmx_stub( TT_Face face, - FT_Stream stream ) - { - FT_UNUSED( face ); - FT_UNUSED( stream ); - - return FT_Err_Unimplemented_Feature; - } - - - FT_CALLBACK_DEF( void ) - tt_face_free_hdmx_stub( TT_Face face ) - { - FT_UNUSED( face ); - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_face_set_sbit_strike_stub( TT_Face face, - FT_UInt x_ppem, - FT_UInt y_ppem, - FT_ULong* astrike_index ) - { - /* - * We simply forge a FT_Size_Request and call the real function - * that does all the work. - * - * This stub might be called by libXfont in the X.Org Xserver, - * compiled against version 2.1.8 or newer. - */ - - FT_Size_RequestRec req; - - - req.type = FT_SIZE_REQUEST_TYPE_NOMINAL; - req.width = (FT_F26Dot6)x_ppem; - req.height = (FT_F26Dot6)y_ppem; - req.horiResolution = 0; - req.vertResolution = 0; - - *astrike_index = 0x7FFFFFFFUL; - - return tt_face_set_sbit_strike( face, &req, astrike_index ); - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_face_load_sbit_stub( TT_Face face, - FT_Stream stream ) - { - FT_UNUSED( face ); - FT_UNUSED( stream ); - - /* - * This function was originally implemented to load the sbit table. - * However, it has been replaced by `tt_face_load_eblc', and this stub - * is only there for some rogue clients which would want to call it - * directly (which doesn't make much sense). - */ - return FT_Err_Unimplemented_Feature; - } - - - FT_CALLBACK_DEF( void ) - tt_face_free_sbit_stub( TT_Face face ) - { - /* nothing to do in this stub */ - FT_UNUSED( face ); - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_face_load_charmap_stub( TT_Face face, - void* cmap, - FT_Stream input ) - { - FT_UNUSED( face ); - FT_UNUSED( cmap ); - FT_UNUSED( input ); - - return FT_Err_Unimplemented_Feature; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_face_free_charmap_stub( TT_Face face, - void* cmap ) - { - FT_UNUSED( face ); - FT_UNUSED( cmap ); - - return 0; - } - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - - static - const SFNT_Interface sfnt_interface = - { - tt_face_goto_table, - - sfnt_init_face, - sfnt_load_face, - sfnt_done_face, - sfnt_get_interface, - - tt_face_load_any, - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - tt_face_load_sfnt_header_stub, - tt_face_load_directory_stub, -#endif - - tt_face_load_head, - tt_face_load_hhea, - tt_face_load_cmap, - tt_face_load_maxp, - tt_face_load_os2, - tt_face_load_post, - - tt_face_load_name, - tt_face_free_name, - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - tt_face_load_hdmx_stub, - tt_face_free_hdmx_stub, -#endif - - tt_face_load_kern, - tt_face_load_gasp, - tt_face_load_pclt, - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - /* see `ttload.h' */ - tt_face_load_bhed, -#else - 0, -#endif - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - tt_face_set_sbit_strike_stub, - tt_face_load_sbit_stub, - - tt_find_sbit_image, - tt_load_sbit_metrics, -#endif - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - tt_face_load_sbit_image, -#else - 0, -#endif - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - tt_face_free_sbit_stub, -#endif - -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - /* see `ttpost.h' */ - tt_face_get_ps_name, - tt_face_free_ps_names, -#else - 0, - 0, -#endif - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - tt_face_load_charmap_stub, - tt_face_free_charmap_stub, -#endif - - /* since version 2.1.8 */ - - tt_face_get_kerning, - - /* since version 2.2 */ - - tt_face_load_font_dir, - tt_face_load_hmtx, - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - /* see `ttsbit.h' and `sfnt.h' */ - tt_face_load_eblc, - tt_face_free_eblc, - - tt_face_set_sbit_strike, - tt_face_load_strike_metrics, -#else - 0, - 0, - 0, - 0, -#endif - - tt_face_get_metrics - }; - - - FT_CALLBACK_TABLE_DEF - const FT_Module_Class sfnt_module_class = - { - 0, /* not a font driver or renderer */ - sizeof( FT_ModuleRec ), - - "sfnt", /* driver name */ - 0x10000L, /* driver version 1.0 */ - 0x20000L, /* driver requires FreeType 2.0 or higher */ - - (const void*)&sfnt_interface, /* module specific interface */ - - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) sfnt_get_interface - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* sfdriver.c */ +/* */ +/* High-level SFNT driver interface (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_OBJECTS_H + +#include "sfdriver.h" +#include "ttload.h" +#include "sfobjs.h" + +#include "sferrors.h" + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +#include "ttsbit.h" +#endif + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES +#include "ttpost.h" +#endif + +#ifdef TT_CONFIG_OPTION_BDF +#include "ttbdf.h" +#include FT_SERVICE_BDF_H +#endif + +#include "ttcmap.h" +#include "ttkern.h" +#include "ttmtx.h" + +#include FT_SERVICE_GLYPH_DICT_H +#include FT_SERVICE_POSTSCRIPT_NAME_H +#include FT_SERVICE_SFNT_H +#include FT_SERVICE_TT_CMAP_H + + + /* + * SFNT TABLE SERVICE + * + */ + + static void* + get_sfnt_table( TT_Face face, + FT_Sfnt_Tag tag ) + { + void* table; + + + switch ( tag ) + { + case ft_sfnt_head: + table = &face->header; + break; + + case ft_sfnt_hhea: + table = &face->horizontal; + break; + + case ft_sfnt_vhea: + table = face->vertical_info ? &face->vertical : 0; + break; + + case ft_sfnt_os2: + table = face->os2.version == 0xFFFFU ? 0 : &face->os2; + break; + + case ft_sfnt_post: + table = &face->postscript; + break; + + case ft_sfnt_maxp: + table = &face->max_profile; + break; + + case ft_sfnt_pclt: + table = face->pclt.Version ? &face->pclt : 0; + break; + + default: + table = 0; + } + + return table; + } + + + static FT_Error + sfnt_table_info( TT_Face face, + FT_UInt idx, + FT_ULong *tag, + FT_ULong *length ) + { + if ( !tag || !length ) + return SFNT_Err_Invalid_Argument; + + if ( idx >= face->num_tables ) + return SFNT_Err_Table_Missing; + + *tag = face->dir_tables[idx].Tag; + *length = face->dir_tables[idx].Length; + + return SFNT_Err_Ok; + } + + + static const FT_Service_SFNT_TableRec sfnt_service_sfnt_table = + { + (FT_SFNT_TableLoadFunc)tt_face_load_any, + (FT_SFNT_TableGetFunc) get_sfnt_table, + (FT_SFNT_TableInfoFunc)sfnt_table_info + }; + + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES + + /* + * GLYPH DICT SERVICE + * + */ + + static FT_Error + sfnt_get_glyph_name( TT_Face face, + FT_UInt glyph_index, + FT_Pointer buffer, + FT_UInt buffer_max ) + { + FT_String* gname; + FT_Error error; + + + error = tt_face_get_ps_name( face, glyph_index, &gname ); + if ( !error ) + FT_STRCPYN( buffer, gname, buffer_max ); + + return error; + } + + + static const FT_Service_GlyphDictRec sfnt_service_glyph_dict = + { + (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, + (FT_GlyphDict_NameIndexFunc)NULL + }; + +#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ + + + /* + * POSTSCRIPT NAME SERVICE + * + */ + + static const char* + sfnt_get_ps_name( TT_Face face ) + { + FT_Int n, found_win, found_apple; + const char* result = NULL; + + + /* shouldn't happen, but just in case to avoid memory leaks */ + if ( face->postscript_name ) + return face->postscript_name; + + /* scan the name table to see whether we have a Postscript name here, */ + /* either in Macintosh or Windows platform encodings */ + found_win = -1; + found_apple = -1; + + for ( n = 0; n < face->num_names; n++ ) + { + TT_NameEntryRec* name = face->name_table.names + n; + + + if ( name->nameID == 6 && name->stringLength > 0 ) + { + if ( name->platformID == 3 && + name->encodingID == 1 && + name->languageID == 0x409 ) + found_win = n; + + if ( name->platformID == 1 && + name->encodingID == 0 && + name->languageID == 0 ) + found_apple = n; + } + } + + if ( found_win != -1 ) + { + FT_Memory memory = face->root.memory; + TT_NameEntryRec* name = face->name_table.names + found_win; + FT_UInt len = name->stringLength / 2; + FT_Error error = SFNT_Err_Ok; + + FT_UNUSED( error ); + + + if ( !FT_ALLOC( result, name->stringLength + 1 ) ) + { + FT_Stream stream = face->name_table.stream; + FT_String* r = (FT_String*)result; + FT_Byte* p = (FT_Byte*)name->string; + + + if ( FT_STREAM_SEEK( name->stringOffset ) || + FT_FRAME_ENTER( name->stringLength ) ) + { + FT_FREE( result ); + name->stringLength = 0; + name->stringOffset = 0; + FT_FREE( name->string ); + + goto Exit; + } + + p = (FT_Byte*)stream->cursor; + + for ( ; len > 0; len--, p += 2 ) + { + if ( p[0] == 0 && p[1] >= 32 && p[1] < 128 ) + *r++ = p[1]; + } + *r = '\0'; + + FT_FRAME_EXIT(); + } + goto Exit; + } + + if ( found_apple != -1 ) + { + FT_Memory memory = face->root.memory; + TT_NameEntryRec* name = face->name_table.names + found_apple; + FT_UInt len = name->stringLength; + FT_Error error = SFNT_Err_Ok; + + FT_UNUSED( error ); + + + if ( !FT_ALLOC( result, len + 1 ) ) + { + FT_Stream stream = face->name_table.stream; + + + if ( FT_STREAM_SEEK( name->stringOffset ) || + FT_STREAM_READ( result, len ) ) + { + name->stringOffset = 0; + name->stringLength = 0; + FT_FREE( name->string ); + FT_FREE( result ); + goto Exit; + } + ((char*)result)[len] = '\0'; + } + } + + Exit: + face->postscript_name = result; + return result; + } + + static const FT_Service_PsFontNameRec sfnt_service_ps_name = + { + (FT_PsName_GetFunc)sfnt_get_ps_name + }; + + + /* + * TT CMAP INFO + */ + static const FT_Service_TTCMapsRec tt_service_get_cmap_info = + { + (TT_CMap_Info_GetFunc)tt_get_cmap_info + }; + + +#ifdef TT_CONFIG_OPTION_BDF + + static FT_Error + sfnt_get_charset_id( TT_Face face, + const char* *acharset_encoding, + const char* *acharset_registry ) + { + BDF_PropertyRec encoding, registry; + FT_Error error; + + + /* XXX: I don't know whether this is correct, since + * tt_face_find_bdf_prop only returns something correct if we have + * previously selected a size that is listed in the BDF table. + * Should we change the BDF table format to include single offsets + * for `CHARSET_REGISTRY' and `CHARSET_ENCODING'? + */ + error = tt_face_find_bdf_prop( face, "CHARSET_REGISTRY", ®istry ); + if ( !error ) + { + error = tt_face_find_bdf_prop( face, "CHARSET_ENCODING", &encoding ); + if ( !error ) + { + if ( registry.type == BDF_PROPERTY_TYPE_ATOM && + encoding.type == BDF_PROPERTY_TYPE_ATOM ) + { + *acharset_encoding = encoding.u.atom; + *acharset_registry = registry.u.atom; + } + else + error = FT_Err_Invalid_Argument; + } + } + + return error; + } + + + static const FT_Service_BDFRec sfnt_service_bdf = + { + (FT_BDF_GetCharsetIdFunc) sfnt_get_charset_id, + (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop, + }; + +#endif /* TT_CONFIG_OPTION_BDF */ + + + /* + * SERVICE LIST + */ + + static const FT_ServiceDescRec sfnt_services[] = + { + { FT_SERVICE_ID_SFNT_TABLE, &sfnt_service_sfnt_table }, + { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name }, +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES + { FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict }, +#endif +#ifdef TT_CONFIG_OPTION_BDF + { FT_SERVICE_ID_BDF, &sfnt_service_bdf }, +#endif + { FT_SERVICE_ID_TT_CMAP, &tt_service_get_cmap_info }, + + { NULL, NULL } + }; + + + FT_CALLBACK_DEF( FT_Module_Interface ) + sfnt_get_interface( FT_Module module, + const char* module_interface ) + { + FT_UNUSED( module ); + + return ft_service_list_lookup( sfnt_services, module_interface ); + } + + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + + FT_CALLBACK_DEF( FT_Error ) + tt_face_load_sfnt_header_stub( TT_Face face, + FT_Stream stream, + FT_Long face_index, + SFNT_Header header ) + { + FT_UNUSED( face ); + FT_UNUSED( stream ); + FT_UNUSED( face_index ); + FT_UNUSED( header ); + + return FT_Err_Unimplemented_Feature; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_face_load_directory_stub( TT_Face face, + FT_Stream stream, + SFNT_Header header ) + { + FT_UNUSED( face ); + FT_UNUSED( stream ); + FT_UNUSED( header ); + + return FT_Err_Unimplemented_Feature; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_face_load_hdmx_stub( TT_Face face, + FT_Stream stream ) + { + FT_UNUSED( face ); + FT_UNUSED( stream ); + + return FT_Err_Unimplemented_Feature; + } + + + FT_CALLBACK_DEF( void ) + tt_face_free_hdmx_stub( TT_Face face ) + { + FT_UNUSED( face ); + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_face_set_sbit_strike_stub( TT_Face face, + FT_UInt x_ppem, + FT_UInt y_ppem, + FT_ULong* astrike_index ) + { + /* + * We simply forge a FT_Size_Request and call the real function + * that does all the work. + * + * This stub might be called by libXfont in the X.Org Xserver, + * compiled against version 2.1.8 or newer. + */ + + FT_Size_RequestRec req; + + + req.type = FT_SIZE_REQUEST_TYPE_NOMINAL; + req.width = (FT_F26Dot6)x_ppem; + req.height = (FT_F26Dot6)y_ppem; + req.horiResolution = 0; + req.vertResolution = 0; + + *astrike_index = 0x7FFFFFFFUL; + + return tt_face_set_sbit_strike( face, &req, astrike_index ); + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_face_load_sbit_stub( TT_Face face, + FT_Stream stream ) + { + FT_UNUSED( face ); + FT_UNUSED( stream ); + + /* + * This function was originally implemented to load the sbit table. + * However, it has been replaced by `tt_face_load_eblc', and this stub + * is only there for some rogue clients which would want to call it + * directly (which doesn't make much sense). + */ + return FT_Err_Unimplemented_Feature; + } + + + FT_CALLBACK_DEF( void ) + tt_face_free_sbit_stub( TT_Face face ) + { + /* nothing to do in this stub */ + FT_UNUSED( face ); + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_face_load_charmap_stub( TT_Face face, + void* cmap, + FT_Stream input ) + { + FT_UNUSED( face ); + FT_UNUSED( cmap ); + FT_UNUSED( input ); + + return FT_Err_Unimplemented_Feature; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_face_free_charmap_stub( TT_Face face, + void* cmap ) + { + FT_UNUSED( face ); + FT_UNUSED( cmap ); + + return 0; + } + +#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ + + + static + const SFNT_Interface sfnt_interface = + { + tt_face_goto_table, + + sfnt_init_face, + sfnt_load_face, + sfnt_done_face, + sfnt_get_interface, + + tt_face_load_any, + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + tt_face_load_sfnt_header_stub, + tt_face_load_directory_stub, +#endif + + tt_face_load_head, + tt_face_load_hhea, + tt_face_load_cmap, + tt_face_load_maxp, + tt_face_load_os2, + tt_face_load_post, + + tt_face_load_name, + tt_face_free_name, + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + tt_face_load_hdmx_stub, + tt_face_free_hdmx_stub, +#endif + + tt_face_load_kern, + tt_face_load_gasp, + tt_face_load_pclt, + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + /* see `ttload.h' */ + tt_face_load_bhed, +#else + 0, +#endif + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + tt_face_set_sbit_strike_stub, + tt_face_load_sbit_stub, + + tt_find_sbit_image, + tt_load_sbit_metrics, +#endif + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + tt_face_load_sbit_image, +#else + 0, +#endif + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + tt_face_free_sbit_stub, +#endif + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES + /* see `ttpost.h' */ + tt_face_get_ps_name, + tt_face_free_ps_names, +#else + 0, + 0, +#endif + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + tt_face_load_charmap_stub, + tt_face_free_charmap_stub, +#endif + + /* since version 2.1.8 */ + + tt_face_get_kerning, + + /* since version 2.2 */ + + tt_face_load_font_dir, + tt_face_load_hmtx, + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + /* see `ttsbit.h' and `sfnt.h' */ + tt_face_load_eblc, + tt_face_free_eblc, + + tt_face_set_sbit_strike, + tt_face_load_strike_metrics, +#else + 0, + 0, + 0, + 0, +#endif + + tt_face_get_metrics + }; + + + FT_CALLBACK_TABLE_DEF + const FT_Module_Class sfnt_module_class = + { + 0, /* not a font driver or renderer */ + sizeof( FT_ModuleRec ), + + "sfnt", /* driver name */ + 0x10000L, /* driver version 1.0 */ + 0x20000L, /* driver requires FreeType 2.0 or higher */ + + (const void*)&sfnt_interface, /* module specific interface */ + + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) sfnt_get_interface + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.h b/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.h index 92db79694d0..3eff56fecca 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/sfdriver.h @@ -1,38 +1,38 @@ -/***************************************************************************/ -/* */ -/* sfdriver.h */ -/* */ -/* High-level SFNT driver interface (specification). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SFDRIVER_H__ -#define __SFDRIVER_H__ - - -#include -#include FT_MODULE_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Module_Class ) sfnt_module_class; - - -FT_END_HEADER - -#endif /* __SFDRIVER_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* sfdriver.h */ +/* */ +/* High-level SFNT driver interface (specification). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __SFDRIVER_H__ +#define __SFDRIVER_H__ + + +#include +#include FT_MODULE_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Module_Class ) sfnt_module_class; + + +FT_END_HEADER + +#endif /* __SFDRIVER_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/sferrors.h b/reactos/dll/3rdparty/freetype/src/sfnt/sferrors.h index 27f90de285f..0ac5e0552df 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/sferrors.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/sferrors.h @@ -1,41 +1,41 @@ -/***************************************************************************/ -/* */ -/* sferrors.h */ -/* */ -/* SFNT error codes (specification only). */ -/* */ -/* Copyright 2001, 2004 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the SFNT error enumeration constants. */ - /* */ - /*************************************************************************/ - -#ifndef __SFERRORS_H__ -#define __SFERRORS_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX SFNT_Err_ -#define FT_ERR_BASE FT_Mod_Err_SFNT - -#define FT_KEEP_ERR_PREFIX - -#include FT_ERRORS_H - -#endif /* __SFERRORS_H__ */ - -/* END */ +/***************************************************************************/ +/* */ +/* sferrors.h */ +/* */ +/* SFNT error codes (specification only). */ +/* */ +/* Copyright 2001, 2004 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the SFNT error enumeration constants. */ + /* */ + /*************************************************************************/ + +#ifndef __SFERRORS_H__ +#define __SFERRORS_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX SFNT_Err_ +#define FT_ERR_BASE FT_Mod_Err_SFNT + +#define FT_KEEP_ERR_PREFIX + +#include FT_ERRORS_H + +#endif /* __SFERRORS_H__ */ + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/sfnt.c b/reactos/dll/3rdparty/freetype/src/sfnt/sfnt.c index 45a820b718d..f667fe8d6eb 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/sfnt.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/sfnt.c @@ -1,41 +1,41 @@ -/***************************************************************************/ -/* */ -/* sfnt.c */ -/* */ -/* Single object library component. */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "ttload.c" -#include "ttmtx.c" -#include "ttcmap.c" -#include "ttkern.c" -#include "sfobjs.c" -#include "sfdriver.c" - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS -#include "ttsbit.c" -#endif - -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES -#include "ttpost.c" -#endif - -#ifdef TT_CONFIG_OPTION_BDF -#include "ttbdf.c" -#endif - -/* END */ +/***************************************************************************/ +/* */ +/* sfnt.c */ +/* */ +/* Single object library component. */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "ttload.c" +#include "ttmtx.c" +#include "ttcmap.c" +#include "ttkern.c" +#include "sfobjs.c" +#include "sfdriver.c" + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +#include "ttsbit.c" +#endif + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES +#include "ttpost.c" +#endif + +#ifdef TT_CONFIG_OPTION_BDF +#include "ttbdf.c" +#endif + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.c b/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.c index cc901100d1d..2da26442679 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.c @@ -1,1070 +1,1070 @@ -/***************************************************************************/ -/* */ -/* sfobjs.c */ -/* */ -/* SFNT object management (base). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include "sfobjs.h" -#include "ttload.h" -#include "ttcmap.h" -#include "ttkern.h" -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_DEBUG_H -#include FT_TRUETYPE_IDS_H -#include FT_TRUETYPE_TAGS_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include "sferrors.h" - -#ifdef TT_CONFIG_OPTION_BDF -#include "ttbdf.h" -#endif - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_sfobjs - - - - /* convert a UTF-16 name entry to ASCII */ - static FT_String* - tt_name_entry_ascii_from_utf16( TT_NameEntry entry, - FT_Memory memory ) - { - FT_String* string; - FT_UInt len, code, n; - FT_Byte* read = (FT_Byte*)entry->string; - FT_Error error; - - - len = (FT_UInt)entry->stringLength / 2; - - if ( FT_NEW_ARRAY( string, len + 1 ) ) - return NULL; - - for ( n = 0; n < len; n++ ) - { - code = FT_NEXT_USHORT( read ); - if ( code < 32 || code > 127 ) - code = '?'; - - string[n] = (char)code; - } - - string[len] = 0; - - return string; - } - - - /* convert an Apple Roman or symbol name entry to ASCII */ - static FT_String* - tt_name_entry_ascii_from_other( TT_NameEntry entry, - FT_Memory memory ) - { - FT_String* string; - FT_UInt len, code, n; - FT_Byte* read = (FT_Byte*)entry->string; - FT_Error error; - - - len = (FT_UInt)entry->stringLength; - - if ( FT_NEW_ARRAY( string, len + 1 ) ) - return NULL; - - for ( n = 0; n < len; n++ ) - { - code = *read++; - if ( code < 32 || code > 127 ) - code = '?'; - - string[n] = (char)code; - } - - string[len] = 0; - - return string; - } - - - typedef FT_String* (*TT_NameEntry_ConvertFunc)( TT_NameEntry entry, - FT_Memory memory ); - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_get_name */ - /* */ - /* */ - /* Returns a given ENGLISH name record in ASCII. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* nameid :: The name id of the name record to return. */ - /* */ - /* */ - /* Character string. NULL if no name is present. */ - /* */ - static FT_String* - tt_face_get_name( TT_Face face, - FT_UShort nameid ) - { - FT_Memory memory = face->root.memory; - FT_String* result = NULL; - FT_UShort n; - TT_NameEntryRec* rec; - FT_Int found_apple = -1; - FT_Int found_apple_roman = -1; - FT_Int found_apple_english = -1; - FT_Int found_win = -1; - FT_Int found_unicode = -1; - - FT_Bool is_english = 0; - - TT_NameEntry_ConvertFunc convert; - - - rec = face->name_table.names; - for ( n = 0; n < face->num_names; n++, rec++ ) - { - /* According to the OpenType 1.3 specification, only Microsoft or */ - /* Apple platform IDs might be used in the `name' table. The */ - /* `Unicode' platform is reserved for the `cmap' table, and the */ - /* `Iso' one is deprecated. */ - /* */ - /* However, the Apple TrueType specification doesn't say the same */ - /* thing and goes to suggest that all Unicode `name' table entries */ - /* should be coded in UTF-16 (in big-endian format I suppose). */ - /* */ - if ( rec->nameID == nameid && rec->stringLength > 0 ) - { - switch ( rec->platformID ) - { - case TT_PLATFORM_APPLE_UNICODE: - case TT_PLATFORM_ISO: - /* there is `languageID' to check there. We should use this */ - /* field only as a last solution when nothing else is */ - /* available. */ - /* */ - found_unicode = n; - break; - - case TT_PLATFORM_MACINTOSH: - /* This is a bit special because some fonts will use either */ - /* an English language id, or a Roman encoding id, to indicate */ - /* the English version of its font name. */ - /* */ - if ( rec->languageID == TT_MAC_LANGID_ENGLISH ) - found_apple_english = n; - else if ( rec->encodingID == TT_MAC_ID_ROMAN ) - found_apple_roman = n; - break; - - case TT_PLATFORM_MICROSOFT: - /* we only take a non-English name when there is nothing */ - /* else available in the font */ - /* */ - if ( found_win == -1 || ( rec->languageID & 0x3FF ) == 0x009 ) - { - switch ( rec->encodingID ) - { - case TT_MS_ID_SYMBOL_CS: - case TT_MS_ID_UNICODE_CS: - case TT_MS_ID_UCS_4: - is_english = FT_BOOL( ( rec->languageID & 0x3FF ) == 0x009 ); - found_win = n; - break; - - default: - ; - } - } - break; - - default: - ; - } - } - } - - found_apple = found_apple_roman; - if ( found_apple_english >= 0 ) - found_apple = found_apple_english; - - /* some fonts contain invalid Unicode or Macintosh formatted entries; */ - /* we will thus favor names encoded in Windows formats if available */ - /* (provided it is an English name) */ - /* */ - convert = NULL; - if ( found_win >= 0 && !( found_apple >= 0 && !is_english ) ) - { - rec = face->name_table.names + found_win; - switch ( rec->encodingID ) - { - /* all Unicode strings are encoded using UTF-16BE */ - case TT_MS_ID_UNICODE_CS: - case TT_MS_ID_SYMBOL_CS: - convert = tt_name_entry_ascii_from_utf16; - break; - - case TT_MS_ID_UCS_4: - /* Apparently, if this value is found in a name table entry, it is */ - /* documented as `full Unicode repertoire'. Experience with the */ - /* MsGothic font shipped with Windows Vista shows that this really */ - /* means UTF-16 encoded names (UCS-4 values are only used within */ - /* charmaps). */ - convert = tt_name_entry_ascii_from_utf16; - break; - - default: - ; - } - } - else if ( found_apple >= 0 ) - { - rec = face->name_table.names + found_apple; - convert = tt_name_entry_ascii_from_other; - } - else if ( found_unicode >= 0 ) - { - rec = face->name_table.names + found_unicode; - convert = tt_name_entry_ascii_from_utf16; - } - - if ( rec && convert ) - { - if ( rec->string == NULL ) - { - FT_Error error = SFNT_Err_Ok; - FT_Stream stream = face->name_table.stream; - - FT_UNUSED( error ); - - - if ( FT_QNEW_ARRAY ( rec->string, rec->stringLength ) || - FT_STREAM_SEEK( rec->stringOffset ) || - FT_STREAM_READ( rec->string, rec->stringLength ) ) - { - FT_FREE( rec->string ); - rec->stringLength = 0; - result = NULL; - goto Exit; - } - } - - result = convert( rec, memory ); - } - - Exit: - return result; - } - - - static FT_Encoding - sfnt_find_encoding( int platform_id, - int encoding_id ) - { - typedef struct TEncoding - { - int platform_id; - int encoding_id; - FT_Encoding encoding; - - } TEncoding; - - static - const TEncoding tt_encodings[] = - { - { TT_PLATFORM_ISO, -1, FT_ENCODING_UNICODE }, - - { TT_PLATFORM_APPLE_UNICODE, -1, FT_ENCODING_UNICODE }, - - { TT_PLATFORM_MACINTOSH, TT_MAC_ID_ROMAN, FT_ENCODING_APPLE_ROMAN }, - - { TT_PLATFORM_MICROSOFT, TT_MS_ID_SYMBOL_CS, FT_ENCODING_MS_SYMBOL }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_UCS_4, FT_ENCODING_UNICODE }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, FT_ENCODING_UNICODE }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_SJIS, FT_ENCODING_SJIS }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_GB2312, FT_ENCODING_GB2312 }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_BIG_5, FT_ENCODING_BIG5 }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_WANSUNG, FT_ENCODING_WANSUNG }, - { TT_PLATFORM_MICROSOFT, TT_MS_ID_JOHAB, FT_ENCODING_JOHAB } - }; - - const TEncoding *cur, *limit; - - - cur = tt_encodings; - limit = cur + sizeof ( tt_encodings ) / sizeof ( tt_encodings[0] ); - - for ( ; cur < limit; cur++ ) - { - if ( cur->platform_id == platform_id ) - { - if ( cur->encoding_id == encoding_id || - cur->encoding_id == -1 ) - return cur->encoding; - } - } - - return FT_ENCODING_NONE; - } - - - /* Fill in face->ttc_header. If the font is not a TTC, it is */ - /* synthesized into a TTC with one offset table. */ - static FT_Error - sfnt_open_font( FT_Stream stream, - TT_Face face ) - { - FT_Memory memory = stream->memory; - FT_Error error; - FT_ULong tag, offset; - - static const FT_Frame_Field ttc_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TTC_HeaderRec - - FT_FRAME_START( 8 ), - FT_FRAME_LONG( version ), - FT_FRAME_LONG( count ), - FT_FRAME_END - }; - - - face->ttc_header.tag = 0; - face->ttc_header.version = 0; - face->ttc_header.count = 0; - - offset = FT_STREAM_POS(); - - if ( FT_READ_ULONG( tag ) ) - return error; - - if ( tag != 0x00010000UL && - tag != TTAG_ttcf && - tag != FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) && - tag != TTAG_true && - tag != 0x00020000UL ) - return SFNT_Err_Unknown_File_Format; - - face->ttc_header.tag = TTAG_ttcf; - - if ( tag == TTAG_ttcf ) - { - FT_Int n; - - - FT_TRACE3(( "sfnt_open_font: file is a collection\n" )); - - if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) ) - return error; - - /* now read the offsets of each font in the file */ - if ( FT_NEW_ARRAY( face->ttc_header.offsets, face->ttc_header.count ) ) - return error; - - if ( FT_FRAME_ENTER( face->ttc_header.count * 4L ) ) - return error; - - for ( n = 0; n < face->ttc_header.count; n++ ) - face->ttc_header.offsets[n] = FT_GET_ULONG(); - - FT_FRAME_EXIT(); - } - else - { - FT_TRACE3(( "sfnt_open_font: synthesize TTC\n" )); - - face->ttc_header.version = 1 << 16; - face->ttc_header.count = 1; - - if ( FT_NEW( face->ttc_header.offsets) ) - return error; - - face->ttc_header.offsets[0] = offset; - } - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - sfnt_init_face( FT_Stream stream, - TT_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - FT_Error error; - FT_Library library = face->root.driver->root.library; - SFNT_Service sfnt; - - - /* for now, parameters are unused */ - FT_UNUSED( num_params ); - FT_UNUSED( params ); - - - sfnt = (SFNT_Service)face->sfnt; - if ( !sfnt ) - { - sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); - if ( !sfnt ) - return SFNT_Err_Invalid_File_Format; - - face->sfnt = sfnt; - face->goto_table = sfnt->goto_table; - } - - FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS ); - - error = sfnt_open_font( stream, face ); - if ( error ) - return error; - - FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index )); - - if ( face_index < 0 ) - face_index = 0; - - if ( face_index >= face->ttc_header.count ) - return SFNT_Err_Bad_Argument; - - if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) ) - return error; - - /* check that we have a valid TrueType file */ - error = sfnt->load_font_dir( face, stream ); - if ( error ) - return error; - - face->root.num_faces = face->ttc_header.count; - - return error; - } - - -#define LOAD_( x ) \ - do { \ - FT_TRACE2(( "`" #x "' " )); \ - FT_TRACE3(( "-->\n" )); \ - \ - error = sfnt->load_##x( face, stream ); \ - \ - FT_TRACE2(( "%s\n", ( !error ) \ - ? "loaded" \ - : ( error == SFNT_Err_Table_Missing ) \ - ? "missing" \ - : "failed to load" )); \ - FT_TRACE3(( "\n" )); \ - } while ( 0 ) - -#define LOADM_( x, vertical ) \ - do { \ - FT_TRACE2(( "`%s" #x "' ", \ - vertical ? "vertical " : "" )); \ - FT_TRACE3(( "-->\n" )); \ - \ - error = sfnt->load_##x( face, stream, vertical ); \ - \ - FT_TRACE2(( "%s\n", ( !error ) \ - ? "loaded" \ - : ( error == SFNT_Err_Table_Missing ) \ - ? "missing" \ - : "failed to load" )); \ - FT_TRACE3(( "\n" )); \ - } while ( 0 ) - - - FT_LOCAL_DEF( FT_Error ) - sfnt_load_face( FT_Stream stream, - TT_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - FT_Error error, psnames_error; - FT_Bool has_outline; - FT_Bool is_apple_sbit; - - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - FT_UNUSED( face_index ); - FT_UNUSED( num_params ); - FT_UNUSED( params ); - - - /* Load tables */ - - /* We now support two SFNT-based bitmapped font formats. They */ - /* are recognized easily as they do not include a `glyf' */ - /* table. */ - /* */ - /* The first format comes from Apple, and uses a table named */ - /* `bhed' instead of `head' to store the font header (using */ - /* the same format). It also doesn't include horizontal and */ - /* vertical metrics tables (i.e. `hhea' and `vhea' tables are */ - /* missing). */ - /* */ - /* The other format comes from Microsoft, and is used with */ - /* WinCE/PocketPC. It looks like a standard TTF, except that */ - /* it doesn't contain outlines. */ - /* */ - - FT_TRACE2(( "sfnt_load_face: %08p\n\n", face )); - - /* do we have outlines in there? */ -#ifdef FT_CONFIG_OPTION_INCREMENTAL - has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 || - tt_face_lookup_table( face, TTAG_glyf ) != 0 || - tt_face_lookup_table( face, TTAG_CFF ) != 0 ); -#else - has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 || - tt_face_lookup_table( face, TTAG_CFF ) != 0 ); -#endif - - is_apple_sbit = 0; - - /* if this font doesn't contain outlines, we try to load */ - /* a `bhed' table */ - if ( !has_outline && sfnt->load_bhed ) - { - LOAD_( bhed ); - is_apple_sbit = FT_BOOL( !error ); - } - - /* load the font header (`head' table) if this isn't an Apple */ - /* sbit font file */ - if ( !is_apple_sbit ) - { - LOAD_( head ); - if ( error ) - goto Exit; - } - - if ( face->header.Units_Per_EM == 0 ) - { - error = SFNT_Err_Invalid_Table; - - goto Exit; - } - - /* the following tables are often not present in embedded TrueType */ - /* fonts within PDF documents, so don't check for them. */ - LOAD_( maxp ); - LOAD_( cmap ); - - /* the following tables are optional in PCL fonts -- */ - /* don't check for errors */ - LOAD_( name ); - LOAD_( post ); - psnames_error = error; - - /* do not load the metrics headers and tables if this is an Apple */ - /* sbit font file */ - if ( !is_apple_sbit ) - { - /* load the `hhea' and `hmtx' tables */ - LOADM_( hhea, 0 ); - if ( !error ) - { - LOADM_( hmtx, 0 ); - if ( error == SFNT_Err_Table_Missing ) - { - error = SFNT_Err_Hmtx_Table_Missing; - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - /* If this is an incrementally loaded font and there are */ - /* overriding metrics, tolerate a missing `hmtx' table. */ - if ( face->root.internal->incremental_interface && - face->root.internal->incremental_interface->funcs-> - get_glyph_metrics ) - { - face->horizontal.number_Of_HMetrics = 0; - error = SFNT_Err_Ok; - } -#endif - } - } - else if ( error == SFNT_Err_Table_Missing ) - { - /* No `hhea' table necessary for SFNT Mac fonts. */ - if ( face->format_tag == TTAG_true ) - { - FT_TRACE2(( "This is an SFNT Mac font.\n" )); - has_outline = 0; - error = SFNT_Err_Ok; - } - else - { - error = SFNT_Err_Horiz_Header_Missing; - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - /* If this is an incrementally loaded font and there are */ - /* overriding metrics, tolerate a missing `hhea' table. */ - if ( face->root.internal->incremental_interface && - face->root.internal->incremental_interface->funcs-> - get_glyph_metrics ) - { - face->horizontal.number_Of_HMetrics = 0; - error = SFNT_Err_Ok; - } -#endif - - } - } - - if ( error ) - goto Exit; - - /* try to load the `vhea' and `vmtx' tables */ - LOADM_( hhea, 1 ); - if ( !error ) - { - LOADM_( hmtx, 1 ); - if ( !error ) - face->vertical_info = 1; - } - - if ( error && error != SFNT_Err_Table_Missing ) - goto Exit; - - LOAD_( os2 ); - if ( error ) - { - if ( error != SFNT_Err_Table_Missing ) - goto Exit; - - face->os2.version = 0xFFFFU; - } - - } - - /* the optional tables */ - - /* embedded bitmap support. */ - if ( sfnt->load_eblc ) - { - LOAD_( eblc ); - if ( error ) - { - /* return an error if this font file has no outlines */ - if ( error == SFNT_Err_Table_Missing && has_outline ) - error = SFNT_Err_Ok; - else - goto Exit; - } - } - - LOAD_( pclt ); - if ( error ) - { - if ( error != SFNT_Err_Table_Missing ) - goto Exit; - - face->pclt.Version = 0; - } - - /* consider the kerning and gasp tables as optional */ - LOAD_( gasp ); - LOAD_( kern ); - - error = SFNT_Err_Ok; - - face->root.num_glyphs = face->max_profile.numGlyphs; - - face->root.family_name = tt_face_get_name( face, - TT_NAME_ID_PREFERRED_FAMILY ); - if ( !face->root.family_name ) - face->root.family_name = tt_face_get_name( face, - TT_NAME_ID_FONT_FAMILY ); - - face->root.style_name = tt_face_get_name( face, - TT_NAME_ID_PREFERRED_SUBFAMILY ); - if ( !face->root.style_name ) - face->root.style_name = tt_face_get_name( face, - TT_NAME_ID_FONT_SUBFAMILY ); - - /* now set up root fields */ - { - FT_Face root = &face->root; - FT_Int32 flags = root->face_flags; - - - /*********************************************************************/ - /* */ - /* Compute face flags. */ - /* */ - if ( has_outline == TRUE ) - flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */ - - /* The sfnt driver only supports bitmap fonts natively, thus we */ - /* don't set FT_FACE_FLAG_HINTER. */ - flags |= FT_FACE_FLAG_SFNT | /* SFNT file format */ - FT_FACE_FLAG_HORIZONTAL; /* horizontal data */ - -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - if ( psnames_error == SFNT_Err_Ok && - face->postscript.FormatType != 0x00030000L ) - flags |= FT_FACE_FLAG_GLYPH_NAMES; -#endif - - /* fixed width font? */ - if ( face->postscript.isFixedPitch ) - flags |= FT_FACE_FLAG_FIXED_WIDTH; - - /* vertical information? */ - if ( face->vertical_info ) - flags |= FT_FACE_FLAG_VERTICAL; - - /* kerning available ? */ - if ( TT_FACE_HAS_KERNING( face ) ) - flags |= FT_FACE_FLAG_KERNING; - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - /* Don't bother to load the tables unless somebody asks for them. */ - /* No need to do work which will (probably) not be used. */ - if ( tt_face_lookup_table( face, TTAG_glyf ) != 0 && - tt_face_lookup_table( face, TTAG_fvar ) != 0 && - tt_face_lookup_table( face, TTAG_gvar ) != 0 ) - flags |= FT_FACE_FLAG_MULTIPLE_MASTERS; -#endif - - root->face_flags = flags; - - /*********************************************************************/ - /* */ - /* Compute style flags. */ - /* */ - flags = 0; - if ( has_outline == TRUE && face->os2.version != 0xFFFFU ) - { - /* we have an OS/2 table; use the `fsSelection' field */ - if ( face->os2.fsSelection & 1 ) - flags |= FT_STYLE_FLAG_ITALIC; - - if ( face->os2.fsSelection & 32 ) - flags |= FT_STYLE_FLAG_BOLD; - } - else - { - /* this is an old Mac font, use the header field */ - if ( face->header.Mac_Style & 1 ) - flags |= FT_STYLE_FLAG_BOLD; - - if ( face->header.Mac_Style & 2 ) - flags |= FT_STYLE_FLAG_ITALIC; - } - - root->style_flags = flags; - - /*********************************************************************/ - /* */ - /* Polish the charmaps. */ - /* */ - /* Try to set the charmap encoding according to the platform & */ - /* encoding ID of each charmap. */ - /* */ - - tt_face_build_cmaps( face ); /* ignore errors */ - - - /* set the encoding fields */ - { - FT_Int m; - - - for ( m = 0; m < root->num_charmaps; m++ ) - { - FT_CharMap charmap = root->charmaps[m]; - - - charmap->encoding = sfnt_find_encoding( charmap->platform_id, - charmap->encoding_id ); - -#if 0 - if ( root->charmap == NULL && - charmap->encoding == FT_ENCODING_UNICODE ) - { - /* set 'root->charmap' to the first Unicode encoding we find */ - root->charmap = charmap; - } -#endif - } - } - - - /*********************************************************************/ - /* */ - /* Set up metrics. */ - /* */ - if ( has_outline == TRUE ) - { - /* XXX What about if outline header is missing */ - /* (e.g. sfnt wrapped bitmap)? */ - root->bbox.xMin = face->header.xMin; - root->bbox.yMin = face->header.yMin; - root->bbox.xMax = face->header.xMax; - root->bbox.yMax = face->header.yMax; - root->units_per_EM = face->header.Units_Per_EM; - - - /* XXX: Computing the ascender/descender/height is very different */ - /* from what the specification tells you. Apparently, we */ - /* must be careful because */ - /* */ - /* - not all fonts have an OS/2 table; in this case, we take */ - /* the values in the horizontal header. However, these */ - /* values very often are not reliable. */ - /* */ - /* - otherwise, the correct typographic values are in the */ - /* sTypoAscender, sTypoDescender & sTypoLineGap fields. */ - /* */ - /* However, certain fonts have these fields set to 0. */ - /* Rather, they have usWinAscent & usWinDescent correctly */ - /* set (but with different values). */ - /* */ - /* As an example, Arial Narrow is implemented through four */ - /* files ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */ - /* */ - /* Strangely, all fonts have the same values in their */ - /* sTypoXXX fields, except ARIALNB which sets them to 0. */ - /* */ - /* On the other hand, they all have different */ - /* usWinAscent/Descent values -- as a conclusion, the OS/2 */ - /* table cannot be used to compute the text height reliably! */ - /* */ - - /* The ascender/descender/height are computed from the OS/2 table */ - /* when found. Otherwise, they're taken from the horizontal */ - /* header. */ - /* */ - - root->ascender = face->horizontal.Ascender; - root->descender = face->horizontal.Descender; - - root->height = (FT_Short)( root->ascender - root->descender + - face->horizontal.Line_Gap ); - -#if 0 - /* if the line_gap is 0, we add an extra 15% to the text height -- */ - /* this computation is based on various versions of Times New Roman */ - if ( face->horizontal.Line_Gap == 0 ) - root->height = (FT_Short)( ( root->height * 115 + 50 ) / 100 ); -#endif - -#if 0 - - /* some fonts have the OS/2 "sTypoAscender", "sTypoDescender" & */ - /* "sTypoLineGap" fields set to 0, like ARIALNB.TTF */ - if ( face->os2.version != 0xFFFFU && root->ascender ) - { - FT_Int height; - - - root->ascender = face->os2.sTypoAscender; - root->descender = -face->os2.sTypoDescender; - - height = root->ascender + root->descender + face->os2.sTypoLineGap; - if ( height > root->height ) - root->height = height; - } - -#endif /* 0 */ - - root->max_advance_width = face->horizontal.advance_Width_Max; - - root->max_advance_height = (FT_Short)( face->vertical_info - ? face->vertical.advance_Height_Max - : root->height ); - - root->underline_position = face->postscript.underlinePosition; - root->underline_thickness = face->postscript.underlineThickness; - } - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - /* - * Now allocate the root array of FT_Bitmap_Size records and - * populate them. Unfortunately, it isn't possible to indicate bit - * depths in the FT_Bitmap_Size record. This is a design error. - */ - { - FT_UInt i, count; - - -#if !defined FT_CONFIG_OPTION_OLD_INTERNALS - count = face->sbit_num_strikes; -#else - count = (FT_UInt)face->num_sbit_strikes; -#endif - - if ( count > 0 ) - { - FT_Memory memory = face->root.stream->memory; - FT_UShort em_size = face->header.Units_Per_EM; - FT_Short avgwidth = face->os2.xAvgCharWidth; - FT_Size_Metrics metrics; - - - if ( em_size == 0 || face->os2.version == 0xFFFFU ) - { - avgwidth = 0; - em_size = 1; - } - - if ( FT_NEW_ARRAY( root->available_sizes, count ) ) - goto Exit; - - for ( i = 0; i < count; i++ ) - { - FT_Bitmap_Size* bsize = root->available_sizes + i; - - - error = sfnt->load_strike_metrics( face, i, &metrics ); - if ( error ) - goto Exit; - - bsize->height = (FT_Short)( metrics.height >> 6 ); - bsize->width = (FT_Short)( - ( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size ); - - bsize->x_ppem = metrics.x_ppem << 6; - bsize->y_ppem = metrics.y_ppem << 6; - - /* assume 72dpi */ - bsize->size = metrics.y_ppem << 6; - } - - root->face_flags |= FT_FACE_FLAG_FIXED_SIZES; - root->num_fixed_sizes = (FT_Int)count; - } - } - -#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - - } - - Exit: - FT_TRACE2(( "sfnt_load_face: done\n" )); - - return error; - } - - -#undef LOAD_ -#undef LOADM_ - - - FT_LOCAL_DEF( void ) - sfnt_done_face( TT_Face face ) - { - FT_Memory memory = face->root.memory; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - - if ( sfnt ) - { - /* destroy the postscript names table if it is loaded */ - if ( sfnt->free_psnames ) - sfnt->free_psnames( face ); - - /* destroy the embedded bitmaps table if it is loaded */ - if ( sfnt->free_eblc ) - sfnt->free_eblc( face ); - } - -#ifdef TT_CONFIG_OPTION_BDF - /* freeing the embedded BDF properties */ - tt_face_free_bdf_props( face ); -#endif - - /* freeing the kerning table */ - tt_face_done_kern( face ); - - /* freeing the collection table */ - FT_FREE( face->ttc_header.offsets ); - face->ttc_header.count = 0; - - /* freeing table directory */ - FT_FREE( face->dir_tables ); - face->num_tables = 0; - - { - FT_Stream stream = FT_FACE_STREAM( face ); - - - /* simply release the 'cmap' table frame */ - FT_FRAME_RELEASE( face->cmap_table ); - face->cmap_size = 0; - } - - /* freeing the horizontal metrics */ -#if !defined FT_CONFIG_OPTION_OLD_INTERNALS - { - FT_Stream stream = FT_FACE_STREAM( face ); - - - FT_FRAME_RELEASE( face->horz_metrics ); - FT_FRAME_RELEASE( face->vert_metrics ); - face->horz_metrics_size = 0; - face->vert_metrics_size = 0; - } -#else - FT_FREE( face->horizontal.long_metrics ); - FT_FREE( face->horizontal.short_metrics ); -#endif - - /* freeing the vertical ones, if any */ - if ( face->vertical_info ) - { - FT_FREE( face->vertical.long_metrics ); - FT_FREE( face->vertical.short_metrics ); - face->vertical_info = 0; - } - - /* freeing the gasp table */ - FT_FREE( face->gasp.gaspRanges ); - face->gasp.numRanges = 0; - - /* freeing the name table */ - sfnt->free_name( face ); - - /* freeing family and style name */ - FT_FREE( face->root.family_name ); - FT_FREE( face->root.style_name ); - - /* freeing sbit size table */ - FT_FREE( face->root.available_sizes ); - face->root.num_fixed_sizes = 0; - - FT_FREE( face->postscript_name ); - - face->sfnt = 0; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* sfobjs.c */ +/* */ +/* SFNT object management (base). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include "sfobjs.h" +#include "ttload.h" +#include "ttcmap.h" +#include "ttkern.h" +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_DEBUG_H +#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_TAGS_H +#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include "sferrors.h" + +#ifdef TT_CONFIG_OPTION_BDF +#include "ttbdf.h" +#endif + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_sfobjs + + + + /* convert a UTF-16 name entry to ASCII */ + static FT_String* + tt_name_entry_ascii_from_utf16( TT_NameEntry entry, + FT_Memory memory ) + { + FT_String* string; + FT_UInt len, code, n; + FT_Byte* read = (FT_Byte*)entry->string; + FT_Error error; + + + len = (FT_UInt)entry->stringLength / 2; + + if ( FT_NEW_ARRAY( string, len + 1 ) ) + return NULL; + + for ( n = 0; n < len; n++ ) + { + code = FT_NEXT_USHORT( read ); + if ( code < 32 || code > 127 ) + code = '?'; + + string[n] = (char)code; + } + + string[len] = 0; + + return string; + } + + + /* convert an Apple Roman or symbol name entry to ASCII */ + static FT_String* + tt_name_entry_ascii_from_other( TT_NameEntry entry, + FT_Memory memory ) + { + FT_String* string; + FT_UInt len, code, n; + FT_Byte* read = (FT_Byte*)entry->string; + FT_Error error; + + + len = (FT_UInt)entry->stringLength; + + if ( FT_NEW_ARRAY( string, len + 1 ) ) + return NULL; + + for ( n = 0; n < len; n++ ) + { + code = *read++; + if ( code < 32 || code > 127 ) + code = '?'; + + string[n] = (char)code; + } + + string[len] = 0; + + return string; + } + + + typedef FT_String* (*TT_NameEntry_ConvertFunc)( TT_NameEntry entry, + FT_Memory memory ); + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_get_name */ + /* */ + /* */ + /* Returns a given ENGLISH name record in ASCII. */ + /* */ + /* */ + /* face :: A handle to the source face object. */ + /* */ + /* nameid :: The name id of the name record to return. */ + /* */ + /* */ + /* Character string. NULL if no name is present. */ + /* */ + static FT_String* + tt_face_get_name( TT_Face face, + FT_UShort nameid ) + { + FT_Memory memory = face->root.memory; + FT_String* result = NULL; + FT_UShort n; + TT_NameEntryRec* rec; + FT_Int found_apple = -1; + FT_Int found_apple_roman = -1; + FT_Int found_apple_english = -1; + FT_Int found_win = -1; + FT_Int found_unicode = -1; + + FT_Bool is_english = 0; + + TT_NameEntry_ConvertFunc convert; + + + rec = face->name_table.names; + for ( n = 0; n < face->num_names; n++, rec++ ) + { + /* According to the OpenType 1.3 specification, only Microsoft or */ + /* Apple platform IDs might be used in the `name' table. The */ + /* `Unicode' platform is reserved for the `cmap' table, and the */ + /* `Iso' one is deprecated. */ + /* */ + /* However, the Apple TrueType specification doesn't say the same */ + /* thing and goes to suggest that all Unicode `name' table entries */ + /* should be coded in UTF-16 (in big-endian format I suppose). */ + /* */ + if ( rec->nameID == nameid && rec->stringLength > 0 ) + { + switch ( rec->platformID ) + { + case TT_PLATFORM_APPLE_UNICODE: + case TT_PLATFORM_ISO: + /* there is `languageID' to check there. We should use this */ + /* field only as a last solution when nothing else is */ + /* available. */ + /* */ + found_unicode = n; + break; + + case TT_PLATFORM_MACINTOSH: + /* This is a bit special because some fonts will use either */ + /* an English language id, or a Roman encoding id, to indicate */ + /* the English version of its font name. */ + /* */ + if ( rec->languageID == TT_MAC_LANGID_ENGLISH ) + found_apple_english = n; + else if ( rec->encodingID == TT_MAC_ID_ROMAN ) + found_apple_roman = n; + break; + + case TT_PLATFORM_MICROSOFT: + /* we only take a non-English name when there is nothing */ + /* else available in the font */ + /* */ + if ( found_win == -1 || ( rec->languageID & 0x3FF ) == 0x009 ) + { + switch ( rec->encodingID ) + { + case TT_MS_ID_SYMBOL_CS: + case TT_MS_ID_UNICODE_CS: + case TT_MS_ID_UCS_4: + is_english = FT_BOOL( ( rec->languageID & 0x3FF ) == 0x009 ); + found_win = n; + break; + + default: + ; + } + } + break; + + default: + ; + } + } + } + + found_apple = found_apple_roman; + if ( found_apple_english >= 0 ) + found_apple = found_apple_english; + + /* some fonts contain invalid Unicode or Macintosh formatted entries; */ + /* we will thus favor names encoded in Windows formats if available */ + /* (provided it is an English name) */ + /* */ + convert = NULL; + if ( found_win >= 0 && !( found_apple >= 0 && !is_english ) ) + { + rec = face->name_table.names + found_win; + switch ( rec->encodingID ) + { + /* all Unicode strings are encoded using UTF-16BE */ + case TT_MS_ID_UNICODE_CS: + case TT_MS_ID_SYMBOL_CS: + convert = tt_name_entry_ascii_from_utf16; + break; + + case TT_MS_ID_UCS_4: + /* Apparently, if this value is found in a name table entry, it is */ + /* documented as `full Unicode repertoire'. Experience with the */ + /* MsGothic font shipped with Windows Vista shows that this really */ + /* means UTF-16 encoded names (UCS-4 values are only used within */ + /* charmaps). */ + convert = tt_name_entry_ascii_from_utf16; + break; + + default: + ; + } + } + else if ( found_apple >= 0 ) + { + rec = face->name_table.names + found_apple; + convert = tt_name_entry_ascii_from_other; + } + else if ( found_unicode >= 0 ) + { + rec = face->name_table.names + found_unicode; + convert = tt_name_entry_ascii_from_utf16; + } + + if ( rec && convert ) + { + if ( rec->string == NULL ) + { + FT_Error error = SFNT_Err_Ok; + FT_Stream stream = face->name_table.stream; + + FT_UNUSED( error ); + + + if ( FT_QNEW_ARRAY ( rec->string, rec->stringLength ) || + FT_STREAM_SEEK( rec->stringOffset ) || + FT_STREAM_READ( rec->string, rec->stringLength ) ) + { + FT_FREE( rec->string ); + rec->stringLength = 0; + result = NULL; + goto Exit; + } + } + + result = convert( rec, memory ); + } + + Exit: + return result; + } + + + static FT_Encoding + sfnt_find_encoding( int platform_id, + int encoding_id ) + { + typedef struct TEncoding + { + int platform_id; + int encoding_id; + FT_Encoding encoding; + + } TEncoding; + + static + const TEncoding tt_encodings[] = + { + { TT_PLATFORM_ISO, -1, FT_ENCODING_UNICODE }, + + { TT_PLATFORM_APPLE_UNICODE, -1, FT_ENCODING_UNICODE }, + + { TT_PLATFORM_MACINTOSH, TT_MAC_ID_ROMAN, FT_ENCODING_APPLE_ROMAN }, + + { TT_PLATFORM_MICROSOFT, TT_MS_ID_SYMBOL_CS, FT_ENCODING_MS_SYMBOL }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_UCS_4, FT_ENCODING_UNICODE }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, FT_ENCODING_UNICODE }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_SJIS, FT_ENCODING_SJIS }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_GB2312, FT_ENCODING_GB2312 }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_BIG_5, FT_ENCODING_BIG5 }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_WANSUNG, FT_ENCODING_WANSUNG }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_JOHAB, FT_ENCODING_JOHAB } + }; + + const TEncoding *cur, *limit; + + + cur = tt_encodings; + limit = cur + sizeof ( tt_encodings ) / sizeof ( tt_encodings[0] ); + + for ( ; cur < limit; cur++ ) + { + if ( cur->platform_id == platform_id ) + { + if ( cur->encoding_id == encoding_id || + cur->encoding_id == -1 ) + return cur->encoding; + } + } + + return FT_ENCODING_NONE; + } + + + /* Fill in face->ttc_header. If the font is not a TTC, it is */ + /* synthesized into a TTC with one offset table. */ + static FT_Error + sfnt_open_font( FT_Stream stream, + TT_Face face ) + { + FT_Memory memory = stream->memory; + FT_Error error; + FT_ULong tag, offset; + + static const FT_Frame_Field ttc_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TTC_HeaderRec + + FT_FRAME_START( 8 ), + FT_FRAME_LONG( version ), + FT_FRAME_LONG( count ), + FT_FRAME_END + }; + + + face->ttc_header.tag = 0; + face->ttc_header.version = 0; + face->ttc_header.count = 0; + + offset = FT_STREAM_POS(); + + if ( FT_READ_ULONG( tag ) ) + return error; + + if ( tag != 0x00010000UL && + tag != TTAG_ttcf && + tag != FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) && + tag != TTAG_true && + tag != 0x00020000UL ) + return SFNT_Err_Unknown_File_Format; + + face->ttc_header.tag = TTAG_ttcf; + + if ( tag == TTAG_ttcf ) + { + FT_Int n; + + + FT_TRACE3(( "sfnt_open_font: file is a collection\n" )); + + if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) ) + return error; + + /* now read the offsets of each font in the file */ + if ( FT_NEW_ARRAY( face->ttc_header.offsets, face->ttc_header.count ) ) + return error; + + if ( FT_FRAME_ENTER( face->ttc_header.count * 4L ) ) + return error; + + for ( n = 0; n < face->ttc_header.count; n++ ) + face->ttc_header.offsets[n] = FT_GET_ULONG(); + + FT_FRAME_EXIT(); + } + else + { + FT_TRACE3(( "sfnt_open_font: synthesize TTC\n" )); + + face->ttc_header.version = 1 << 16; + face->ttc_header.count = 1; + + if ( FT_NEW( face->ttc_header.offsets) ) + return error; + + face->ttc_header.offsets[0] = offset; + } + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + sfnt_init_face( FT_Stream stream, + TT_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error; + FT_Library library = face->root.driver->root.library; + SFNT_Service sfnt; + + + /* for now, parameters are unused */ + FT_UNUSED( num_params ); + FT_UNUSED( params ); + + + sfnt = (SFNT_Service)face->sfnt; + if ( !sfnt ) + { + sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); + if ( !sfnt ) + return SFNT_Err_Invalid_File_Format; + + face->sfnt = sfnt; + face->goto_table = sfnt->goto_table; + } + + FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS ); + + error = sfnt_open_font( stream, face ); + if ( error ) + return error; + + FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index )); + + if ( face_index < 0 ) + face_index = 0; + + if ( face_index >= face->ttc_header.count ) + return SFNT_Err_Bad_Argument; + + if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) ) + return error; + + /* check that we have a valid TrueType file */ + error = sfnt->load_font_dir( face, stream ); + if ( error ) + return error; + + face->root.num_faces = face->ttc_header.count; + + return error; + } + + +#define LOAD_( x ) \ + do { \ + FT_TRACE2(( "`" #x "' " )); \ + FT_TRACE3(( "-->\n" )); \ + \ + error = sfnt->load_##x( face, stream ); \ + \ + FT_TRACE2(( "%s\n", ( !error ) \ + ? "loaded" \ + : ( error == SFNT_Err_Table_Missing ) \ + ? "missing" \ + : "failed to load" )); \ + FT_TRACE3(( "\n" )); \ + } while ( 0 ) + +#define LOADM_( x, vertical ) \ + do { \ + FT_TRACE2(( "`%s" #x "' ", \ + vertical ? "vertical " : "" )); \ + FT_TRACE3(( "-->\n" )); \ + \ + error = sfnt->load_##x( face, stream, vertical ); \ + \ + FT_TRACE2(( "%s\n", ( !error ) \ + ? "loaded" \ + : ( error == SFNT_Err_Table_Missing ) \ + ? "missing" \ + : "failed to load" )); \ + FT_TRACE3(( "\n" )); \ + } while ( 0 ) + + + FT_LOCAL_DEF( FT_Error ) + sfnt_load_face( FT_Stream stream, + TT_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error, psnames_error; + FT_Bool has_outline; + FT_Bool is_apple_sbit; + + SFNT_Service sfnt = (SFNT_Service)face->sfnt; + + FT_UNUSED( face_index ); + FT_UNUSED( num_params ); + FT_UNUSED( params ); + + + /* Load tables */ + + /* We now support two SFNT-based bitmapped font formats. They */ + /* are recognized easily as they do not include a `glyf' */ + /* table. */ + /* */ + /* The first format comes from Apple, and uses a table named */ + /* `bhed' instead of `head' to store the font header (using */ + /* the same format). It also doesn't include horizontal and */ + /* vertical metrics tables (i.e. `hhea' and `vhea' tables are */ + /* missing). */ + /* */ + /* The other format comes from Microsoft, and is used with */ + /* WinCE/PocketPC. It looks like a standard TTF, except that */ + /* it doesn't contain outlines. */ + /* */ + + FT_TRACE2(( "sfnt_load_face: %08p\n\n", face )); + + /* do we have outlines in there? */ +#ifdef FT_CONFIG_OPTION_INCREMENTAL + has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 || + tt_face_lookup_table( face, TTAG_glyf ) != 0 || + tt_face_lookup_table( face, TTAG_CFF ) != 0 ); +#else + has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 || + tt_face_lookup_table( face, TTAG_CFF ) != 0 ); +#endif + + is_apple_sbit = 0; + + /* if this font doesn't contain outlines, we try to load */ + /* a `bhed' table */ + if ( !has_outline && sfnt->load_bhed ) + { + LOAD_( bhed ); + is_apple_sbit = FT_BOOL( !error ); + } + + /* load the font header (`head' table) if this isn't an Apple */ + /* sbit font file */ + if ( !is_apple_sbit ) + { + LOAD_( head ); + if ( error ) + goto Exit; + } + + if ( face->header.Units_Per_EM == 0 ) + { + error = SFNT_Err_Invalid_Table; + + goto Exit; + } + + /* the following tables are often not present in embedded TrueType */ + /* fonts within PDF documents, so don't check for them. */ + LOAD_( maxp ); + LOAD_( cmap ); + + /* the following tables are optional in PCL fonts -- */ + /* don't check for errors */ + LOAD_( name ); + LOAD_( post ); + psnames_error = error; + + /* do not load the metrics headers and tables if this is an Apple */ + /* sbit font file */ + if ( !is_apple_sbit ) + { + /* load the `hhea' and `hmtx' tables */ + LOADM_( hhea, 0 ); + if ( !error ) + { + LOADM_( hmtx, 0 ); + if ( error == SFNT_Err_Table_Missing ) + { + error = SFNT_Err_Hmtx_Table_Missing; + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + /* If this is an incrementally loaded font and there are */ + /* overriding metrics, tolerate a missing `hmtx' table. */ + if ( face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs-> + get_glyph_metrics ) + { + face->horizontal.number_Of_HMetrics = 0; + error = SFNT_Err_Ok; + } +#endif + } + } + else if ( error == SFNT_Err_Table_Missing ) + { + /* No `hhea' table necessary for SFNT Mac fonts. */ + if ( face->format_tag == TTAG_true ) + { + FT_TRACE2(( "This is an SFNT Mac font.\n" )); + has_outline = 0; + error = SFNT_Err_Ok; + } + else + { + error = SFNT_Err_Horiz_Header_Missing; + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + /* If this is an incrementally loaded font and there are */ + /* overriding metrics, tolerate a missing `hhea' table. */ + if ( face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs-> + get_glyph_metrics ) + { + face->horizontal.number_Of_HMetrics = 0; + error = SFNT_Err_Ok; + } +#endif + + } + } + + if ( error ) + goto Exit; + + /* try to load the `vhea' and `vmtx' tables */ + LOADM_( hhea, 1 ); + if ( !error ) + { + LOADM_( hmtx, 1 ); + if ( !error ) + face->vertical_info = 1; + } + + if ( error && error != SFNT_Err_Table_Missing ) + goto Exit; + + LOAD_( os2 ); + if ( error ) + { + if ( error != SFNT_Err_Table_Missing ) + goto Exit; + + face->os2.version = 0xFFFFU; + } + + } + + /* the optional tables */ + + /* embedded bitmap support. */ + if ( sfnt->load_eblc ) + { + LOAD_( eblc ); + if ( error ) + { + /* return an error if this font file has no outlines */ + if ( error == SFNT_Err_Table_Missing && has_outline ) + error = SFNT_Err_Ok; + else + goto Exit; + } + } + + LOAD_( pclt ); + if ( error ) + { + if ( error != SFNT_Err_Table_Missing ) + goto Exit; + + face->pclt.Version = 0; + } + + /* consider the kerning and gasp tables as optional */ + LOAD_( gasp ); + LOAD_( kern ); + + error = SFNT_Err_Ok; + + face->root.num_glyphs = face->max_profile.numGlyphs; + + face->root.family_name = tt_face_get_name( face, + TT_NAME_ID_PREFERRED_FAMILY ); + if ( !face->root.family_name ) + face->root.family_name = tt_face_get_name( face, + TT_NAME_ID_FONT_FAMILY ); + + face->root.style_name = tt_face_get_name( face, + TT_NAME_ID_PREFERRED_SUBFAMILY ); + if ( !face->root.style_name ) + face->root.style_name = tt_face_get_name( face, + TT_NAME_ID_FONT_SUBFAMILY ); + + /* now set up root fields */ + { + FT_Face root = &face->root; + FT_Int32 flags = root->face_flags; + + + /*********************************************************************/ + /* */ + /* Compute face flags. */ + /* */ + if ( has_outline == TRUE ) + flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */ + + /* The sfnt driver only supports bitmap fonts natively, thus we */ + /* don't set FT_FACE_FLAG_HINTER. */ + flags |= FT_FACE_FLAG_SFNT | /* SFNT file format */ + FT_FACE_FLAG_HORIZONTAL; /* horizontal data */ + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES + if ( psnames_error == SFNT_Err_Ok && + face->postscript.FormatType != 0x00030000L ) + flags |= FT_FACE_FLAG_GLYPH_NAMES; +#endif + + /* fixed width font? */ + if ( face->postscript.isFixedPitch ) + flags |= FT_FACE_FLAG_FIXED_WIDTH; + + /* vertical information? */ + if ( face->vertical_info ) + flags |= FT_FACE_FLAG_VERTICAL; + + /* kerning available ? */ + if ( TT_FACE_HAS_KERNING( face ) ) + flags |= FT_FACE_FLAG_KERNING; + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + /* Don't bother to load the tables unless somebody asks for them. */ + /* No need to do work which will (probably) not be used. */ + if ( tt_face_lookup_table( face, TTAG_glyf ) != 0 && + tt_face_lookup_table( face, TTAG_fvar ) != 0 && + tt_face_lookup_table( face, TTAG_gvar ) != 0 ) + flags |= FT_FACE_FLAG_MULTIPLE_MASTERS; +#endif + + root->face_flags = flags; + + /*********************************************************************/ + /* */ + /* Compute style flags. */ + /* */ + flags = 0; + if ( has_outline == TRUE && face->os2.version != 0xFFFFU ) + { + /* we have an OS/2 table; use the `fsSelection' field */ + if ( face->os2.fsSelection & 1 ) + flags |= FT_STYLE_FLAG_ITALIC; + + if ( face->os2.fsSelection & 32 ) + flags |= FT_STYLE_FLAG_BOLD; + } + else + { + /* this is an old Mac font, use the header field */ + if ( face->header.Mac_Style & 1 ) + flags |= FT_STYLE_FLAG_BOLD; + + if ( face->header.Mac_Style & 2 ) + flags |= FT_STYLE_FLAG_ITALIC; + } + + root->style_flags = flags; + + /*********************************************************************/ + /* */ + /* Polish the charmaps. */ + /* */ + /* Try to set the charmap encoding according to the platform & */ + /* encoding ID of each charmap. */ + /* */ + + tt_face_build_cmaps( face ); /* ignore errors */ + + + /* set the encoding fields */ + { + FT_Int m; + + + for ( m = 0; m < root->num_charmaps; m++ ) + { + FT_CharMap charmap = root->charmaps[m]; + + + charmap->encoding = sfnt_find_encoding( charmap->platform_id, + charmap->encoding_id ); + +#if 0 + if ( root->charmap == NULL && + charmap->encoding == FT_ENCODING_UNICODE ) + { + /* set 'root->charmap' to the first Unicode encoding we find */ + root->charmap = charmap; + } +#endif + } + } + + + /*********************************************************************/ + /* */ + /* Set up metrics. */ + /* */ + if ( has_outline == TRUE ) + { + /* XXX What about if outline header is missing */ + /* (e.g. sfnt wrapped bitmap)? */ + root->bbox.xMin = face->header.xMin; + root->bbox.yMin = face->header.yMin; + root->bbox.xMax = face->header.xMax; + root->bbox.yMax = face->header.yMax; + root->units_per_EM = face->header.Units_Per_EM; + + + /* XXX: Computing the ascender/descender/height is very different */ + /* from what the specification tells you. Apparently, we */ + /* must be careful because */ + /* */ + /* - not all fonts have an OS/2 table; in this case, we take */ + /* the values in the horizontal header. However, these */ + /* values very often are not reliable. */ + /* */ + /* - otherwise, the correct typographic values are in the */ + /* sTypoAscender, sTypoDescender & sTypoLineGap fields. */ + /* */ + /* However, certain fonts have these fields set to 0. */ + /* Rather, they have usWinAscent & usWinDescent correctly */ + /* set (but with different values). */ + /* */ + /* As an example, Arial Narrow is implemented through four */ + /* files ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */ + /* */ + /* Strangely, all fonts have the same values in their */ + /* sTypoXXX fields, except ARIALNB which sets them to 0. */ + /* */ + /* On the other hand, they all have different */ + /* usWinAscent/Descent values -- as a conclusion, the OS/2 */ + /* table cannot be used to compute the text height reliably! */ + /* */ + + /* The ascender/descender/height are computed from the OS/2 table */ + /* when found. Otherwise, they're taken from the horizontal */ + /* header. */ + /* */ + + root->ascender = face->horizontal.Ascender; + root->descender = face->horizontal.Descender; + + root->height = (FT_Short)( root->ascender - root->descender + + face->horizontal.Line_Gap ); + +#if 0 + /* if the line_gap is 0, we add an extra 15% to the text height -- */ + /* this computation is based on various versions of Times New Roman */ + if ( face->horizontal.Line_Gap == 0 ) + root->height = (FT_Short)( ( root->height * 115 + 50 ) / 100 ); +#endif + +#if 0 + + /* some fonts have the OS/2 "sTypoAscender", "sTypoDescender" & */ + /* "sTypoLineGap" fields set to 0, like ARIALNB.TTF */ + if ( face->os2.version != 0xFFFFU && root->ascender ) + { + FT_Int height; + + + root->ascender = face->os2.sTypoAscender; + root->descender = -face->os2.sTypoDescender; + + height = root->ascender + root->descender + face->os2.sTypoLineGap; + if ( height > root->height ) + root->height = height; + } + +#endif /* 0 */ + + root->max_advance_width = face->horizontal.advance_Width_Max; + + root->max_advance_height = (FT_Short)( face->vertical_info + ? face->vertical.advance_Height_Max + : root->height ); + + root->underline_position = face->postscript.underlinePosition; + root->underline_thickness = face->postscript.underlineThickness; + } + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + /* + * Now allocate the root array of FT_Bitmap_Size records and + * populate them. Unfortunately, it isn't possible to indicate bit + * depths in the FT_Bitmap_Size record. This is a design error. + */ + { + FT_UInt i, count; + + +#if !defined FT_CONFIG_OPTION_OLD_INTERNALS + count = face->sbit_num_strikes; +#else + count = (FT_UInt)face->num_sbit_strikes; +#endif + + if ( count > 0 ) + { + FT_Memory memory = face->root.stream->memory; + FT_UShort em_size = face->header.Units_Per_EM; + FT_Short avgwidth = face->os2.xAvgCharWidth; + FT_Size_Metrics metrics; + + + if ( em_size == 0 || face->os2.version == 0xFFFFU ) + { + avgwidth = 0; + em_size = 1; + } + + if ( FT_NEW_ARRAY( root->available_sizes, count ) ) + goto Exit; + + for ( i = 0; i < count; i++ ) + { + FT_Bitmap_Size* bsize = root->available_sizes + i; + + + error = sfnt->load_strike_metrics( face, i, &metrics ); + if ( error ) + goto Exit; + + bsize->height = (FT_Short)( metrics.height >> 6 ); + bsize->width = (FT_Short)( + ( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size ); + + bsize->x_ppem = metrics.x_ppem << 6; + bsize->y_ppem = metrics.y_ppem << 6; + + /* assume 72dpi */ + bsize->size = metrics.y_ppem << 6; + } + + root->face_flags |= FT_FACE_FLAG_FIXED_SIZES; + root->num_fixed_sizes = (FT_Int)count; + } + } + +#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + } + + Exit: + FT_TRACE2(( "sfnt_load_face: done\n" )); + + return error; + } + + +#undef LOAD_ +#undef LOADM_ + + + FT_LOCAL_DEF( void ) + sfnt_done_face( TT_Face face ) + { + FT_Memory memory = face->root.memory; + SFNT_Service sfnt = (SFNT_Service)face->sfnt; + + + if ( sfnt ) + { + /* destroy the postscript names table if it is loaded */ + if ( sfnt->free_psnames ) + sfnt->free_psnames( face ); + + /* destroy the embedded bitmaps table if it is loaded */ + if ( sfnt->free_eblc ) + sfnt->free_eblc( face ); + } + +#ifdef TT_CONFIG_OPTION_BDF + /* freeing the embedded BDF properties */ + tt_face_free_bdf_props( face ); +#endif + + /* freeing the kerning table */ + tt_face_done_kern( face ); + + /* freeing the collection table */ + FT_FREE( face->ttc_header.offsets ); + face->ttc_header.count = 0; + + /* freeing table directory */ + FT_FREE( face->dir_tables ); + face->num_tables = 0; + + { + FT_Stream stream = FT_FACE_STREAM( face ); + + + /* simply release the 'cmap' table frame */ + FT_FRAME_RELEASE( face->cmap_table ); + face->cmap_size = 0; + } + + /* freeing the horizontal metrics */ +#if !defined FT_CONFIG_OPTION_OLD_INTERNALS + { + FT_Stream stream = FT_FACE_STREAM( face ); + + + FT_FRAME_RELEASE( face->horz_metrics ); + FT_FRAME_RELEASE( face->vert_metrics ); + face->horz_metrics_size = 0; + face->vert_metrics_size = 0; + } +#else + FT_FREE( face->horizontal.long_metrics ); + FT_FREE( face->horizontal.short_metrics ); +#endif + + /* freeing the vertical ones, if any */ + if ( face->vertical_info ) + { + FT_FREE( face->vertical.long_metrics ); + FT_FREE( face->vertical.short_metrics ); + face->vertical_info = 0; + } + + /* freeing the gasp table */ + FT_FREE( face->gasp.gaspRanges ); + face->gasp.numRanges = 0; + + /* freeing the name table */ + sfnt->free_name( face ); + + /* freeing family and style name */ + FT_FREE( face->root.family_name ); + FT_FREE( face->root.style_name ); + + /* freeing sbit size table */ + FT_FREE( face->root.available_sizes ); + face->root.num_fixed_sizes = 0; + + FT_FREE( face->postscript_name ); + + face->sfnt = 0; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.h b/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.h index 6241c93b392..70622b4a6c0 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/sfobjs.h @@ -1,54 +1,54 @@ -/***************************************************************************/ -/* */ -/* sfobjs.h */ -/* */ -/* SFNT object management (specification). */ -/* */ -/* Copyright 1996-2001, 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __SFOBJS_H__ -#define __SFOBJS_H__ - - -#include -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_OBJECTS_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - sfnt_init_face( FT_Stream stream, - TT_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ); - - FT_LOCAL( FT_Error ) - sfnt_load_face( FT_Stream stream, - TT_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ); - - FT_LOCAL( void ) - sfnt_done_face( TT_Face face ); - - -FT_END_HEADER - -#endif /* __SFDRIVER_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* sfobjs.h */ +/* */ +/* SFNT object management (specification). */ +/* */ +/* Copyright 1996-2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __SFOBJS_H__ +#define __SFOBJS_H__ + + +#include +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_OBJECTS_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + sfnt_init_face( FT_Stream stream, + TT_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); + + FT_LOCAL( FT_Error ) + sfnt_load_face( FT_Stream stream, + TT_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); + + FT_LOCAL( void ) + sfnt_done_face( TT_Face face ); + + +FT_END_HEADER + +#endif /* __SFDRIVER_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.c index 6c95387adb8..224bda9cba0 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.c @@ -1,250 +1,250 @@ -/***************************************************************************/ -/* */ -/* ttbdf.c */ -/* */ -/* TrueType and OpenType embedded BDF properties (body). */ -/* */ -/* Copyright 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include "ttbdf.h" - -#include "sferrors.h" - - -#ifdef TT_CONFIG_OPTION_BDF - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttbdf - - - FT_LOCAL_DEF( void ) - tt_face_free_bdf_props( TT_Face face ) - { - TT_BDF bdf = &face->bdf; - - - if ( bdf->loaded ) - { - FT_Stream stream = FT_FACE(face)->stream; - - - if ( bdf->table != NULL ) - FT_FRAME_RELEASE( bdf->table ); - - bdf->table_end = NULL; - bdf->strings = NULL; - bdf->strings_size = 0; - } - } - - - static FT_Error - tt_face_load_bdf_props( TT_Face face, - FT_Stream stream ) - { - TT_BDF bdf = &face->bdf; - FT_ULong length; - FT_Error error; - - - FT_ZERO( bdf ); - - error = tt_face_goto_table( face, TTAG_BDF, stream, &length ); - if ( error || - length < 8 || - FT_FRAME_EXTRACT( length, bdf->table ) ) - { - error = FT_Err_Invalid_Table; - goto Exit; - } - - bdf->table_end = bdf->table + length; - - { - FT_Byte* p = bdf->table; - FT_UInt version = FT_NEXT_USHORT( p ); - FT_UInt num_strikes = FT_NEXT_USHORT( p ); - FT_UInt32 strings = FT_NEXT_ULONG ( p ); - FT_UInt count; - FT_Byte* strike; - - - if ( version != 0x0001 || - strings < 8 || - ( strings - 8 ) / 4 < num_strikes || - strings + 1 > length ) - { - goto BadTable; - } - - bdf->num_strikes = num_strikes; - bdf->strings = bdf->table + strings; - bdf->strings_size = length - strings; - - count = bdf->num_strikes; - p = bdf->table + 8; - strike = p + count * 4; - - - for ( ; count > 0; count-- ) - { - FT_UInt num_items = FT_PEEK_USHORT( p + 2 ); - - /* - * We don't need to check the value sets themselves, since this - * is done later. - */ - strike += 10 * num_items; - - p += 4; - } - - if ( strike > bdf->strings ) - goto BadTable; - } - - bdf->loaded = 1; - - Exit: - return error; - - BadTable: - FT_FRAME_RELEASE( bdf->table ); - FT_ZERO( bdf ); - error = FT_Err_Invalid_Table; - goto Exit; - } - - - FT_LOCAL_DEF( FT_Error ) - tt_face_find_bdf_prop( TT_Face face, - const char* property_name, - BDF_PropertyRec *aprop ) - { - TT_BDF bdf = &face->bdf; - FT_Size size = FT_FACE(face)->size; - FT_Error error = 0; - FT_Byte* p; - FT_UInt count; - FT_Byte* strike; - FT_UInt property_len; - - - aprop->type = BDF_PROPERTY_TYPE_NONE; - - if ( bdf->loaded == 0 ) - { - error = tt_face_load_bdf_props( face, FT_FACE( face )->stream ); - if ( error ) - goto Exit; - } - - count = bdf->num_strikes; - p = bdf->table + 8; - strike = p + 4 * count; - - error = FT_Err_Invalid_Argument; - - if ( size == NULL || property_name == NULL ) - goto Exit; - - property_len = ft_strlen( property_name ); - if ( property_len == 0 ) - goto Exit; - - for ( ; count > 0; count-- ) - { - FT_UInt _ppem = FT_NEXT_USHORT( p ); - FT_UInt _count = FT_NEXT_USHORT( p ); - - if ( _ppem == size->metrics.y_ppem ) - { - count = _count; - goto FoundStrike; - } - - strike += 10 * _count; - } - goto Exit; - - FoundStrike: - p = strike; - for ( ; count > 0; count-- ) - { - FT_UInt type = FT_PEEK_USHORT( p + 4 ); - - if ( ( type & 0x10 ) != 0 ) - { - FT_UInt32 name_offset = FT_PEEK_ULONG( p ); - FT_UInt32 value = FT_PEEK_ULONG( p + 6 ); - - /* be a bit paranoid for invalid entries here */ - if ( name_offset < bdf->strings_size && - property_len < bdf->strings_size - name_offset && - ft_strncmp( property_name, - (const char*)bdf->strings + name_offset, - bdf->strings_size - name_offset ) == 0 ) - { - switch ( type & 0x0F ) - { - case 0x00: /* string */ - case 0x01: /* atoms */ - /* check that the content is really 0-terminated */ - if ( value < bdf->strings_size && - ft_memchr( bdf->strings + value, 0, bdf->strings_size ) ) - { - aprop->type = BDF_PROPERTY_TYPE_ATOM; - aprop->u.atom = (const char*)bdf->strings + value; - error = 0; - goto Exit; - } - break; - - case 0x02: - aprop->type = BDF_PROPERTY_TYPE_INTEGER; - aprop->u.integer = (FT_Int32)value; - error = 0; - goto Exit; - - case 0x03: - aprop->type = BDF_PROPERTY_TYPE_CARDINAL; - aprop->u.cardinal = value; - error = 0; - goto Exit; - - default: - ; - } - } - } - p += 10; - } - - Exit: - return error; - } - -#endif /* TT_CONFIG_OPTION_BDF */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttbdf.c */ +/* */ +/* TrueType and OpenType embedded BDF properties (body). */ +/* */ +/* Copyright 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H +#include "ttbdf.h" + +#include "sferrors.h" + + +#ifdef TT_CONFIG_OPTION_BDF + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttbdf + + + FT_LOCAL_DEF( void ) + tt_face_free_bdf_props( TT_Face face ) + { + TT_BDF bdf = &face->bdf; + + + if ( bdf->loaded ) + { + FT_Stream stream = FT_FACE(face)->stream; + + + if ( bdf->table != NULL ) + FT_FRAME_RELEASE( bdf->table ); + + bdf->table_end = NULL; + bdf->strings = NULL; + bdf->strings_size = 0; + } + } + + + static FT_Error + tt_face_load_bdf_props( TT_Face face, + FT_Stream stream ) + { + TT_BDF bdf = &face->bdf; + FT_ULong length; + FT_Error error; + + + FT_ZERO( bdf ); + + error = tt_face_goto_table( face, TTAG_BDF, stream, &length ); + if ( error || + length < 8 || + FT_FRAME_EXTRACT( length, bdf->table ) ) + { + error = FT_Err_Invalid_Table; + goto Exit; + } + + bdf->table_end = bdf->table + length; + + { + FT_Byte* p = bdf->table; + FT_UInt version = FT_NEXT_USHORT( p ); + FT_UInt num_strikes = FT_NEXT_USHORT( p ); + FT_UInt32 strings = FT_NEXT_ULONG ( p ); + FT_UInt count; + FT_Byte* strike; + + + if ( version != 0x0001 || + strings < 8 || + ( strings - 8 ) / 4 < num_strikes || + strings + 1 > length ) + { + goto BadTable; + } + + bdf->num_strikes = num_strikes; + bdf->strings = bdf->table + strings; + bdf->strings_size = length - strings; + + count = bdf->num_strikes; + p = bdf->table + 8; + strike = p + count * 4; + + + for ( ; count > 0; count-- ) + { + FT_UInt num_items = FT_PEEK_USHORT( p + 2 ); + + /* + * We don't need to check the value sets themselves, since this + * is done later. + */ + strike += 10 * num_items; + + p += 4; + } + + if ( strike > bdf->strings ) + goto BadTable; + } + + bdf->loaded = 1; + + Exit: + return error; + + BadTable: + FT_FRAME_RELEASE( bdf->table ); + FT_ZERO( bdf ); + error = FT_Err_Invalid_Table; + goto Exit; + } + + + FT_LOCAL_DEF( FT_Error ) + tt_face_find_bdf_prop( TT_Face face, + const char* property_name, + BDF_PropertyRec *aprop ) + { + TT_BDF bdf = &face->bdf; + FT_Size size = FT_FACE(face)->size; + FT_Error error = 0; + FT_Byte* p; + FT_UInt count; + FT_Byte* strike; + FT_UInt property_len; + + + aprop->type = BDF_PROPERTY_TYPE_NONE; + + if ( bdf->loaded == 0 ) + { + error = tt_face_load_bdf_props( face, FT_FACE( face )->stream ); + if ( error ) + goto Exit; + } + + count = bdf->num_strikes; + p = bdf->table + 8; + strike = p + 4 * count; + + error = FT_Err_Invalid_Argument; + + if ( size == NULL || property_name == NULL ) + goto Exit; + + property_len = ft_strlen( property_name ); + if ( property_len == 0 ) + goto Exit; + + for ( ; count > 0; count-- ) + { + FT_UInt _ppem = FT_NEXT_USHORT( p ); + FT_UInt _count = FT_NEXT_USHORT( p ); + + if ( _ppem == size->metrics.y_ppem ) + { + count = _count; + goto FoundStrike; + } + + strike += 10 * _count; + } + goto Exit; + + FoundStrike: + p = strike; + for ( ; count > 0; count-- ) + { + FT_UInt type = FT_PEEK_USHORT( p + 4 ); + + if ( ( type & 0x10 ) != 0 ) + { + FT_UInt32 name_offset = FT_PEEK_ULONG( p ); + FT_UInt32 value = FT_PEEK_ULONG( p + 6 ); + + /* be a bit paranoid for invalid entries here */ + if ( name_offset < bdf->strings_size && + property_len < bdf->strings_size - name_offset && + ft_strncmp( property_name, + (const char*)bdf->strings + name_offset, + bdf->strings_size - name_offset ) == 0 ) + { + switch ( type & 0x0F ) + { + case 0x00: /* string */ + case 0x01: /* atoms */ + /* check that the content is really 0-terminated */ + if ( value < bdf->strings_size && + ft_memchr( bdf->strings + value, 0, bdf->strings_size ) ) + { + aprop->type = BDF_PROPERTY_TYPE_ATOM; + aprop->u.atom = (const char*)bdf->strings + value; + error = 0; + goto Exit; + } + break; + + case 0x02: + aprop->type = BDF_PROPERTY_TYPE_INTEGER; + aprop->u.integer = (FT_Int32)value; + error = 0; + goto Exit; + + case 0x03: + aprop->type = BDF_PROPERTY_TYPE_CARDINAL; + aprop->u.cardinal = value; + error = 0; + goto Exit; + + default: + ; + } + } + } + p += 10; + } + + Exit: + return error; + } + +#endif /* TT_CONFIG_OPTION_BDF */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.h b/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.h index 48a10d6e9b3..65da1e0d113 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttbdf.h @@ -1,46 +1,46 @@ -/***************************************************************************/ -/* */ -/* ttbdf.h */ -/* */ -/* TrueType and OpenType embedded BDF properties (specification). */ -/* */ -/* Copyright 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTBDF_H__ -#define __TTBDF_H__ - - -#include -#include "ttload.h" -#include FT_BDF_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( void ) - tt_face_free_bdf_props( TT_Face face ); - - - FT_LOCAL( FT_Error ) - tt_face_find_bdf_prop( TT_Face face, - const char* property_name, - BDF_PropertyRec *aprop ); - - -FT_END_HEADER - -#endif /* __TTBDF_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttbdf.h */ +/* */ +/* TrueType and OpenType embedded BDF properties (specification). */ +/* */ +/* Copyright 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTBDF_H__ +#define __TTBDF_H__ + + +#include +#include "ttload.h" +#include FT_BDF_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( void ) + tt_face_free_bdf_props( TT_Face face ); + + + FT_LOCAL( FT_Error ) + tt_face_find_bdf_prop( TT_Face face, + const char* property_name, + BDF_PropertyRec *aprop ); + + +FT_END_HEADER + +#endif /* __TTBDF_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.c index 854d567d1af..71fda6bbca4 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.c @@ -1,2356 +1,2356 @@ -/***************************************************************************/ -/* */ -/* ttcmap.c */ -/* */ -/* TrueType character mapping table (cmap) support (body). */ -/* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H - -#include "sferrors.h" /* must come before FT_INTERNAL_VALIDATE_H */ - -#include FT_INTERNAL_VALIDATE_H -#include FT_INTERNAL_STREAM_H -#include "ttload.h" -#include "ttcmap.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttcmap - - -#define TT_PEEK_SHORT FT_PEEK_SHORT -#define TT_PEEK_USHORT FT_PEEK_USHORT -#define TT_PEEK_LONG FT_PEEK_LONG -#define TT_PEEK_ULONG FT_PEEK_ULONG - -#define TT_NEXT_SHORT FT_NEXT_SHORT -#define TT_NEXT_USHORT FT_NEXT_USHORT -#define TT_NEXT_LONG FT_NEXT_LONG -#define TT_NEXT_ULONG FT_NEXT_ULONG - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap_init( TT_CMap cmap, - FT_Byte* table ) - { - cmap->data = table; - return SFNT_Err_Ok; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FORMAT 0 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* TABLE OVERVIEW */ - /* -------------- */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* format 0 USHORT must be 0 */ - /* length 2 USHORT table length in bytes */ - /* language 4 USHORT Mac language code */ - /* glyph_ids 6 BYTE[256] array of glyph indices */ - /* 262 */ - /* */ - -#ifdef TT_CONFIG_CMAP_FORMAT_0 - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap0_validate( FT_Byte* table, - FT_Validator valid ) - { - FT_Byte* p = table + 2; - FT_UInt length = TT_NEXT_USHORT( p ); - - - if ( table + length > valid->limit || length < 262 ) - FT_INVALID_TOO_SHORT; - - /* check glyph indices whenever necessary */ - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - FT_UInt n, idx; - - - p = table + 6; - for ( n = 0; n < 256; n++ ) - { - idx = *p++; - if ( idx >= TT_VALID_GLYPH_COUNT( valid ) ) - FT_INVALID_GLYPH_ID; - } - } - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap0_char_index( TT_CMap cmap, - FT_UInt32 char_code ) - { - FT_Byte* table = cmap->data; - - - return char_code < 256 ? table[6 + char_code] : 0; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap0_char_next( TT_CMap cmap, - FT_UInt32 *pchar_code ) - { - FT_Byte* table = cmap->data; - FT_UInt32 charcode = *pchar_code; - FT_UInt32 result = 0; - FT_UInt gindex = 0; - - - table += 6; /* go to glyph ids */ - while ( ++charcode < 256 ) - { - gindex = table[charcode]; - if ( gindex != 0 ) - { - result = charcode; - break; - } - } - - *pchar_code = result; - return gindex; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap0_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->format = 0; - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const TT_CMap_ClassRec tt_cmap0_class_rec = - { - { - sizeof ( TT_CMapRec ), - - (FT_CMap_InitFunc) tt_cmap_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)tt_cmap0_char_index, - (FT_CMap_CharNextFunc) tt_cmap0_char_next - }, - 0, - (TT_CMap_ValidateFunc) tt_cmap0_validate, - (TT_CMap_Info_GetFunc) tt_cmap0_get_info - }; - -#endif /* TT_CONFIG_CMAP_FORMAT_0 */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FORMAT 2 *****/ - /***** *****/ - /***** This is used for certain CJK encodings that encode text in a *****/ - /***** mixed 8/16 bits encoding along the following lines: *****/ - /***** *****/ - /***** * Certain byte values correspond to an 8-bit character code *****/ - /***** (typically in the range 0..127 for ASCII compatibility). *****/ - /***** *****/ - /***** * Certain byte values signal the first byte of a 2-byte *****/ - /***** character code (but these values are also valid as the *****/ - /***** second byte of a 2-byte character). *****/ - /***** *****/ - /***** The following charmap lookup and iteration functions all *****/ - /***** assume that the value "charcode" correspond to following: *****/ - /***** *****/ - /***** - For one byte characters, "charcode" is simply the *****/ - /***** character code. *****/ - /***** *****/ - /***** - For two byte characters, "charcode" is the 2-byte *****/ - /***** character code in big endian format. More exactly: *****/ - /***** *****/ - /***** (charcode >> 8) is the first byte value *****/ - /***** (charcode & 0xFF) is the second byte value *****/ - /***** *****/ - /***** Note that not all values of "charcode" are valid according *****/ - /***** to these rules, and the function moderately check the *****/ - /***** arguments. *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* TABLE OVERVIEW */ - /* -------------- */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* format 0 USHORT must be 2 */ - /* length 2 USHORT table length in bytes */ - /* language 4 USHORT Mac language code */ - /* keys 6 USHORT[256] sub-header keys */ - /* subs 518 SUBHEAD[NSUBS] sub-headers array */ - /* glyph_ids 518+NSUB*8 USHORT[] glyph id array */ - /* */ - /* The `keys' table is used to map charcode high-bytes to sub-headers. */ - /* The value of `NSUBS' is the number of sub-headers defined in the */ - /* table and is computed by finding the maximum of the `keys' table. */ - /* */ - /* Note that for any n, `keys[n]' is a byte offset within the `subs' */ - /* table, i.e., it is the corresponding sub-header index multiplied */ - /* by 8. */ - /* */ - /* Each sub-header has the following format: */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* first 0 USHORT first valid low-byte */ - /* count 2 USHORT number of valid low-bytes */ - /* delta 4 SHORT see below */ - /* offset 6 USHORT see below */ - /* */ - /* A sub-header defines, for each high-byte, the range of valid */ - /* low-bytes within the charmap. Note that the range defined by `first' */ - /* and `count' must be completely included in the interval [0..255] */ - /* according to the specification. */ - /* */ - /* If a character code is contained within a given sub-header, then */ - /* mapping it to a glyph index is done as follows: */ - /* */ - /* * The value of `offset' is read. This is a _byte_ distance from the */ - /* location of the `offset' field itself into a slice of the */ - /* `glyph_ids' table. Let's call it `slice' (it's a USHORT[] too). */ - /* */ - /* * The value `slice[char.lo - first]' is read. If it is 0, there is */ - /* no glyph for the charcode. Otherwise, the value of `delta' is */ - /* added to it (modulo 65536) to form a new glyph index. */ - /* */ - /* It is up to the validation routine to check that all offsets fall */ - /* within the glyph ids table (and not within the `subs' table itself or */ - /* outside of the CMap). */ - /* */ - -#ifdef TT_CONFIG_CMAP_FORMAT_2 - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap2_validate( FT_Byte* table, - FT_Validator valid ) - { - FT_Byte* p = table + 2; /* skip format */ - FT_UInt length = TT_PEEK_USHORT( p ); - FT_UInt n, max_subs; - FT_Byte* keys; /* keys table */ - FT_Byte* subs; /* sub-headers */ - FT_Byte* glyph_ids; /* glyph id array */ - - - if ( table + length > valid->limit || length < 6 + 512 ) - FT_INVALID_TOO_SHORT; - - keys = table + 6; - - /* parse keys to compute sub-headers count */ - p = keys; - max_subs = 0; - for ( n = 0; n < 256; n++ ) - { - FT_UInt idx = TT_NEXT_USHORT( p ); - - - /* value must be multiple of 8 */ - if ( valid->level >= FT_VALIDATE_PARANOID && ( idx & 7 ) != 0 ) - FT_INVALID_DATA; - - idx >>= 3; - - if ( idx > max_subs ) - max_subs = idx; - } - - FT_ASSERT( p == table + 518 ); - - subs = p; - glyph_ids = subs + (max_subs + 1) * 8; - if ( glyph_ids > valid->limit ) - FT_INVALID_TOO_SHORT; - - /* parse sub-headers */ - for ( n = 0; n <= max_subs; n++ ) - { - FT_UInt first_code, code_count, offset; - FT_Int delta; - FT_Byte* ids; - - - first_code = TT_NEXT_USHORT( p ); - code_count = TT_NEXT_USHORT( p ); - delta = TT_NEXT_SHORT( p ); - offset = TT_NEXT_USHORT( p ); - - /* check range within 0..255 */ - if ( valid->level >= FT_VALIDATE_PARANOID ) - { - if ( first_code >= 256 || first_code + code_count > 256 ) - FT_INVALID_DATA; - } - - /* check offset */ - if ( offset != 0 ) - { - ids = p - 2 + offset; - if ( ids < glyph_ids || ids + code_count*2 > table + length ) - FT_INVALID_OFFSET; - - /* check glyph ids */ - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - FT_Byte* limit = p + code_count * 2; - FT_UInt idx; - - - for ( ; p < limit; ) - { - idx = TT_NEXT_USHORT( p ); - if ( idx != 0 ) - { - idx = ( idx + delta ) & 0xFFFFU; - if ( idx >= TT_VALID_GLYPH_COUNT( valid ) ) - FT_INVALID_GLYPH_ID; - } - } - } - } - } - - return SFNT_Err_Ok; - } - - - /* return sub header corresponding to a given character code */ - /* NULL on invalid charcode */ - static FT_Byte* - tt_cmap2_get_subheader( FT_Byte* table, - FT_UInt32 char_code ) - { - FT_Byte* result = NULL; - - - if ( char_code < 0x10000UL ) - { - FT_UInt char_lo = (FT_UInt)( char_code & 0xFF ); - FT_UInt char_hi = (FT_UInt)( char_code >> 8 ); - FT_Byte* p = table + 6; /* keys table */ - FT_Byte* subs = table + 518; /* subheaders table */ - FT_Byte* sub; - - - if ( char_hi == 0 ) - { - /* an 8-bit character code -- we use subHeader 0 in this case */ - /* to test whether the character code is in the charmap */ - /* */ - sub = subs; /* jump to first sub-header */ - - /* check that the sub-header for this byte is 0, which */ - /* indicates that it's really a valid one-byte value */ - /* Otherwise, return 0 */ - /* */ - p += char_lo * 2; - if ( TT_PEEK_USHORT( p ) != 0 ) - goto Exit; - } - else - { - /* a 16-bit character code */ - - /* jump to key entry */ - p += char_hi * 2; - /* jump to sub-header */ - sub = subs + ( FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 8 ) ); - - /* check that the high byte isn't a valid one-byte value */ - if ( sub == subs ) - goto Exit; - } - result = sub; - } - Exit: - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap2_char_index( TT_CMap cmap, - FT_UInt32 char_code ) - { - FT_Byte* table = cmap->data; - FT_UInt result = 0; - FT_Byte* subheader; - - - subheader = tt_cmap2_get_subheader( table, char_code ); - if ( subheader ) - { - FT_Byte* p = subheader; - FT_UInt idx = (FT_UInt)(char_code & 0xFF); - FT_UInt start, count; - FT_Int delta; - FT_UInt offset; - - - start = TT_NEXT_USHORT( p ); - count = TT_NEXT_USHORT( p ); - delta = TT_NEXT_SHORT ( p ); - offset = TT_PEEK_USHORT( p ); - - idx -= start; - if ( idx < count && offset != 0 ) - { - p += offset + 2 * idx; - idx = TT_PEEK_USHORT( p ); - - if ( idx != 0 ) - result = (FT_UInt)( idx + delta ) & 0xFFFFU; - } - } - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap2_char_next( TT_CMap cmap, - FT_UInt32 *pcharcode ) - { - FT_Byte* table = cmap->data; - FT_UInt gindex = 0; - FT_UInt32 result = 0; - FT_UInt32 charcode = *pcharcode + 1; - FT_Byte* subheader; - - - while ( charcode < 0x10000UL ) - { - subheader = tt_cmap2_get_subheader( table, charcode ); - if ( subheader ) - { - FT_Byte* p = subheader; - FT_UInt start = TT_NEXT_USHORT( p ); - FT_UInt count = TT_NEXT_USHORT( p ); - FT_Int delta = TT_NEXT_SHORT ( p ); - FT_UInt offset = TT_PEEK_USHORT( p ); - FT_UInt char_lo = (FT_UInt)( charcode & 0xFF ); - FT_UInt pos, idx; - - - if ( offset == 0 ) - goto Next_SubHeader; - - if ( char_lo < start ) - { - char_lo = start; - pos = 0; - } - else - pos = (FT_UInt)( char_lo - start ); - - p += offset + pos * 2; - charcode = FT_PAD_FLOOR( charcode, 256 ) + char_lo; - - for ( ; pos < count; pos++, charcode++ ) - { - idx = TT_NEXT_USHORT( p ); - - if ( idx != 0 ) - { - gindex = ( idx + delta ) & 0xFFFFU; - if ( gindex != 0 ) - { - result = charcode; - goto Exit; - } - } - } - } - - /* jump to next sub-header, i.e. higher byte value */ - Next_SubHeader: - charcode = FT_PAD_FLOOR( charcode, 256 ) + 256; - } - - Exit: - *pcharcode = result; - - return gindex; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap2_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->format = 2; - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const TT_CMap_ClassRec tt_cmap2_class_rec = - { - { - sizeof ( TT_CMapRec ), - - (FT_CMap_InitFunc) tt_cmap_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)tt_cmap2_char_index, - (FT_CMap_CharNextFunc) tt_cmap2_char_next - }, - 2, - (TT_CMap_ValidateFunc) tt_cmap2_validate, - (TT_CMap_Info_GetFunc) tt_cmap2_get_info - }; - -#endif /* TT_CONFIG_CMAP_FORMAT_2 */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FORMAT 4 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* TABLE OVERVIEW */ - /* -------------- */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* format 0 USHORT must be 4 */ - /* length 2 USHORT table length */ - /* in bytes */ - /* language 4 USHORT Mac language code */ - /* */ - /* segCountX2 6 USHORT 2*NUM_SEGS */ - /* searchRange 8 USHORT 2*(1 << LOG_SEGS) */ - /* entrySelector 10 USHORT LOG_SEGS */ - /* rangeShift 12 USHORT segCountX2 - */ - /* searchRange */ - /* */ - /* endCount 14 USHORT[NUM_SEGS] end charcode for */ - /* each segment; last */ - /* is 0xFFFF */ - /* */ - /* pad 14+NUM_SEGS*2 USHORT padding */ - /* */ - /* startCount 16+NUM_SEGS*2 USHORT[NUM_SEGS] first charcode for */ - /* each segment */ - /* */ - /* idDelta 16+NUM_SEGS*4 SHORT[NUM_SEGS] delta for each */ - /* segment */ - /* idOffset 16+NUM_SEGS*6 SHORT[NUM_SEGS] range offset for */ - /* each segment; can be */ - /* zero */ - /* */ - /* glyphIds 16+NUM_SEGS*8 USHORT[] array of glyph id */ - /* ranges */ - /* */ - /* Character codes are modelled by a series of ordered (increasing) */ - /* intervals called segments. Each segment has start and end codes, */ - /* provided by the `startCount' and `endCount' arrays. Segments must */ - /* not be overlapping and the last segment should always contain the */ - /* `0xFFFF' endCount. */ - /* */ - /* The fields `searchRange', `entrySelector' and `rangeShift' are better */ - /* ignored (they are traces of over-engineering in the TrueType */ - /* specification). */ - /* */ - /* Each segment also has a signed `delta', as well as an optional offset */ - /* within the `glyphIds' table. */ - /* */ - /* If a segment's idOffset is 0, the glyph index corresponding to any */ - /* charcode within the segment is obtained by adding the value of */ - /* `idDelta' directly to the charcode, modulo 65536. */ - /* */ - /* Otherwise, a glyph index is taken from the glyph ids sub-array for */ - /* the segment, and the value of `idDelta' is added to it. */ - /* */ - /* */ - /* Finally, note that certain fonts contain invalid charmaps that */ - /* contain end=0xFFFF, start=0xFFFF, delta=0x0001, offset=0xFFFF at the */ - /* of their charmaps (e.g. opens___.ttf which comes with OpenOffice.org) */ - /* we need special code to deal with them correctly... */ - /* */ - -#ifdef TT_CONFIG_CMAP_FORMAT_4 - - typedef struct TT_CMap4Rec_ - { - TT_CMapRec cmap; - FT_UInt32 cur_charcode; /* current charcode */ - FT_UInt cur_gindex; /* current glyph index */ - - FT_UInt num_ranges; - FT_UInt cur_range; - FT_UInt cur_start; - FT_UInt cur_end; - FT_Int cur_delta; - FT_Byte* cur_values; - - } TT_CMap4Rec, *TT_CMap4; - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap4_init( TT_CMap4 cmap, - FT_Byte* table ) - { - FT_Byte* p; - - - cmap->cmap.data = table; - - p = table + 6; - cmap->num_ranges = FT_PEEK_USHORT( p ) >> 1; - cmap->cur_charcode = 0xFFFFFFFFUL; - cmap->cur_gindex = 0; - - return SFNT_Err_Ok; - } - - - static FT_Int - tt_cmap4_set_range( TT_CMap4 cmap, - FT_UInt range_index ) - { - FT_Byte* table = cmap->cmap.data; - FT_Byte* p; - FT_UInt num_ranges = cmap->num_ranges; - - - while ( range_index < num_ranges ) - { - FT_UInt offset; - - - p = table + 14 + range_index * 2; - cmap->cur_end = FT_PEEK_USHORT( p ); - - p += 2 + num_ranges * 2; - cmap->cur_start = FT_PEEK_USHORT( p ); - - p += num_ranges * 2; - cmap->cur_delta = FT_PEEK_SHORT( p ); - - p += num_ranges * 2; - offset = FT_PEEK_USHORT( p ); - - if ( offset != 0xFFFFU ) - { - cmap->cur_values = offset ? p + offset : NULL; - cmap->cur_range = range_index; - return 0; - } - - /* we skip empty segments */ - range_index++; - } - - return -1; - } - - - /* search the index of the charcode next to cmap->cur_charcode; */ - /* caller should call tt_cmap4_set_range with proper range */ - /* before calling this function */ - /* */ - static void - tt_cmap4_next( TT_CMap4 cmap ) - { - FT_UInt charcode; - - - if ( cmap->cur_charcode >= 0xFFFFUL ) - goto Fail; - - charcode = cmap->cur_charcode + 1; - - if ( charcode < cmap->cur_start ) - charcode = cmap->cur_start; - - for ( ;; ) - { - FT_Byte* values = cmap->cur_values; - FT_UInt end = cmap->cur_end; - FT_Int delta = cmap->cur_delta; - - - if ( charcode <= end ) - { - if ( values ) - { - FT_Byte* p = values + 2 * ( charcode - cmap->cur_start ); - - - do - { - FT_UInt gindex = FT_NEXT_USHORT( p ); - - - if ( gindex != 0 ) - { - gindex = (FT_UInt)( ( gindex + delta ) & 0xFFFFU ); - if ( gindex != 0 ) - { - cmap->cur_charcode = charcode; - cmap->cur_gindex = gindex; - return; - } - } - } while ( ++charcode <= end ); - } - else - { - do - { - FT_UInt gindex = (FT_UInt)( ( charcode + delta ) & 0xFFFFU ); - - - if ( gindex != 0 ) - { - cmap->cur_charcode = charcode; - cmap->cur_gindex = gindex; - return; - } - } while ( ++charcode <= end ); - } - } - - /* we need to find another range */ - if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 ) - break; - - if ( charcode < cmap->cur_start ) - charcode = cmap->cur_start; - } - - Fail: - cmap->cur_charcode = 0xFFFFFFFFUL; - cmap->cur_gindex = 0; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap4_validate( FT_Byte* table, - FT_Validator valid ) - { - FT_Byte* p = table + 2; /* skip format */ - FT_UInt length = TT_NEXT_USHORT( p ); - FT_Byte *ends, *starts, *offsets, *deltas, *glyph_ids; - FT_UInt num_segs; - FT_Error error = SFNT_Err_Ok; - - - if ( length < 16 ) - FT_INVALID_TOO_SHORT; - - /* in certain fonts, the `length' field is invalid and goes */ - /* out of bound. We try to correct this here... */ - if ( table + length > valid->limit ) - { - if ( valid->level >= FT_VALIDATE_TIGHT ) - FT_INVALID_TOO_SHORT; - - length = (FT_UInt)( valid->limit - table ); - } - - p = table + 6; - num_segs = TT_NEXT_USHORT( p ); /* read segCountX2 */ - - if ( valid->level >= FT_VALIDATE_PARANOID ) - { - /* check that we have an even value here */ - if ( num_segs & 1 ) - FT_INVALID_DATA; - } - - num_segs /= 2; - - if ( length < 16 + num_segs * 2 * 4 ) - FT_INVALID_TOO_SHORT; - - /* check the search parameters - even though we never use them */ - /* */ - if ( valid->level >= FT_VALIDATE_PARANOID ) - { - /* check the values of 'searchRange', 'entrySelector', 'rangeShift' */ - FT_UInt search_range = TT_NEXT_USHORT( p ); - FT_UInt entry_selector = TT_NEXT_USHORT( p ); - FT_UInt range_shift = TT_NEXT_USHORT( p ); - - - if ( ( search_range | range_shift ) & 1 ) /* must be even values */ - FT_INVALID_DATA; - - search_range /= 2; - range_shift /= 2; - - /* `search range' is the greatest power of 2 that is <= num_segs */ - - if ( search_range > num_segs || - search_range * 2 < num_segs || - search_range + range_shift != num_segs || - search_range != ( 1U << entry_selector ) ) - FT_INVALID_DATA; - } - - ends = table + 14; - starts = table + 16 + num_segs * 2; - deltas = starts + num_segs * 2; - offsets = deltas + num_segs * 2; - glyph_ids = offsets + num_segs * 2; - - /* check last segment, its end count must be FFFF */ - if ( valid->level >= FT_VALIDATE_PARANOID ) - { - p = ends + ( num_segs - 1 ) * 2; - if ( TT_PEEK_USHORT( p ) != 0xFFFFU ) - FT_INVALID_DATA; - } - - { - FT_UInt start, end, offset, n; - FT_UInt last_start = 0, last_end = 0; - FT_Int delta; - FT_Byte* p_start = starts; - FT_Byte* p_end = ends; - FT_Byte* p_delta = deltas; - FT_Byte* p_offset = offsets; - - - for ( n = 0; n < num_segs; n++ ) - { - p = p_offset; - start = TT_NEXT_USHORT( p_start ); - end = TT_NEXT_USHORT( p_end ); - delta = TT_NEXT_SHORT( p_delta ); - offset = TT_NEXT_USHORT( p_offset ); - - if ( start > end ) - FT_INVALID_DATA; - - /* this test should be performed at default validation level; */ - /* unfortunately, some popular Asian fonts present overlapping */ - /* ranges in their charmaps */ - /* */ - if ( start <= last_end && n > 0 ) - { - if ( valid->level >= FT_VALIDATE_TIGHT ) - FT_INVALID_DATA; - else - { - /* allow overlapping segments, provided their start points */ - /* and end points, respectively, are in ascending order. */ - /* */ - if ( last_start > start || last_end > end ) - error |= TT_CMAP_FLAG_UNSORTED; - else - error |= TT_CMAP_FLAG_OVERLAPPING; - } - } - - if ( offset && offset != 0xFFFFU ) - { - p += offset; /* start of glyph id array */ - - /* check that we point within the glyph ids table only */ - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - if ( p < glyph_ids || - p + ( end - start + 1 ) * 2 > table + length ) - FT_INVALID_DATA; - } - else - { - if ( p < glyph_ids || - p + ( end - start + 1 ) * 2 > valid->limit ) - FT_INVALID_DATA; - } - - /* check glyph indices within the segment range */ - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - FT_UInt i, idx; - - - for ( i = start; i < end; i++ ) - { - idx = FT_NEXT_USHORT( p ); - if ( idx != 0 ) - { - idx = (FT_UInt)( idx + delta ) & 0xFFFFU; - - if ( idx >= TT_VALID_GLYPH_COUNT( valid ) ) - FT_INVALID_GLYPH_ID; - } - } - } - } - else if ( offset == 0xFFFFU ) - { - /* Some fonts (erroneously?) use a range offset of 0xFFFF */ - /* to mean missing glyph in cmap table */ - /* */ - if ( valid->level >= FT_VALIDATE_PARANOID || - n != num_segs - 1 || - !( start == 0xFFFFU && end == 0xFFFFU && delta == 0x1U ) ) - FT_INVALID_DATA; - } - - last_start = start; - last_end = end; - } - } - - return error; - } - - - static FT_UInt - tt_cmap4_char_map_linear( TT_CMap cmap, - FT_UInt* pcharcode, - FT_Bool next ) - { - FT_UInt num_segs2, start, end, offset; - FT_Int delta; - FT_UInt i, num_segs; - FT_UInt32 charcode = *pcharcode; - FT_UInt gindex = 0; - FT_Byte* p; - - - p = cmap->data + 6; - num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); - - num_segs = num_segs2 >> 1; - - if ( !num_segs ) - return 0; - - if ( next ) - charcode++; - - /* linear search */ - for ( ; charcode <= 0xFFFFU; charcode++ ) - { - FT_Byte* q; - - - p = cmap->data + 14; /* ends table */ - q = cmap->data + 16 + num_segs2; /* starts table */ - - for ( i = 0; i < num_segs; i++ ) - { - end = TT_NEXT_USHORT( p ); - start = TT_NEXT_USHORT( q ); - - if ( charcode >= start && charcode <= end ) - { - p = q - 2 + num_segs2; - delta = TT_PEEK_SHORT( p ); - p += num_segs2; - offset = TT_PEEK_USHORT( p ); - - if ( offset == 0xFFFFU ) - continue; - - if ( offset ) - { - p += offset + ( charcode - start ) * 2; - gindex = TT_PEEK_USHORT( p ); - if ( gindex != 0 ) - gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU; - } - else - gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU; - - break; - } - } - - if ( !next || gindex ) - break; - } - - if ( next && gindex ) - *pcharcode = charcode; - - return gindex; - } - - - static FT_UInt - tt_cmap4_char_map_binary( TT_CMap cmap, - FT_UInt* pcharcode, - FT_Bool next ) - { - FT_UInt num_segs2, start, end, offset; - FT_Int delta; - FT_UInt max, min, mid, num_segs; - FT_UInt charcode = *pcharcode; - FT_UInt gindex = 0; - FT_Byte* p; - - - p = cmap->data + 6; - num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); - - if ( !num_segs2 ) - return 0; - - num_segs = num_segs2 >> 1; - - /* make compiler happy */ - mid = num_segs; - end = 0xFFFFU; - - if ( next ) - charcode++; - - min = 0; - max = num_segs; - - /* binary search */ - while ( min < max ) - { - mid = ( min + max ) >> 1; - p = cmap->data + 14 + mid * 2; - end = TT_PEEK_USHORT( p ); - p += 2 + num_segs2; - start = TT_PEEK_USHORT( p ); - - if ( charcode < start ) - max = mid; - else if ( charcode > end ) - min = mid + 1; - else - { - p += num_segs2; - delta = TT_PEEK_SHORT( p ); - p += num_segs2; - offset = TT_PEEK_USHORT( p ); - - /* search the first segment containing `charcode' */ - if ( cmap->flags & TT_CMAP_FLAG_OVERLAPPING ) - { - FT_UInt i; - - - /* call the current segment `max' */ - max = mid; - - if ( offset == 0xFFFFU ) - mid = max + 1; - - /* search in segments before the current segment */ - for ( i = max ; i > 0; i-- ) - { - FT_UInt prev_end; - FT_Byte* old_p; - - - old_p = p; - p = cmap->data + 14 + ( i - 1 ) * 2; - prev_end = TT_PEEK_USHORT( p ); - - if ( charcode > prev_end ) - { - p = old_p; - break; - } - - end = prev_end; - p += 2 + num_segs2; - start = TT_PEEK_USHORT( p ); - p += num_segs2; - delta = TT_PEEK_SHORT( p ); - p += num_segs2; - offset = TT_PEEK_USHORT( p ); - - if ( offset != 0xFFFFU ) - mid = i - 1; - } - - /* no luck */ - if ( mid == max + 1 ) - { - if ( i != max ) - { - p = cmap->data + 14 + max * 2; - end = TT_PEEK_USHORT( p ); - p += 2 + num_segs2; - start = TT_PEEK_USHORT( p ); - p += num_segs2; - delta = TT_PEEK_SHORT( p ); - p += num_segs2; - offset = TT_PEEK_USHORT( p ); - } - - mid = max; - - /* search in segments after the current segment */ - for ( i = max + 1; i < num_segs; i++ ) - { - FT_UInt next_end, next_start; - - - p = cmap->data + 14 + i * 2; - next_end = TT_PEEK_USHORT( p ); - p += 2 + num_segs2; - next_start = TT_PEEK_USHORT( p ); - - if ( charcode < next_start ) - break; - - end = next_end; - start = next_start; - p += num_segs2; - delta = TT_PEEK_SHORT( p ); - p += num_segs2; - offset = TT_PEEK_USHORT( p ); - - if ( offset != 0xFFFFU ) - mid = i; - } - i--; - - /* still no luck */ - if ( mid == max ) - { - mid = i; - - break; - } - } - - /* end, start, delta, and offset are for the i'th segment */ - if ( mid != i ) - { - p = cmap->data + 14 + mid * 2; - end = TT_PEEK_USHORT( p ); - p += 2 + num_segs2; - start = TT_PEEK_USHORT( p ); - p += num_segs2; - delta = TT_PEEK_SHORT( p ); - p += num_segs2; - offset = TT_PEEK_USHORT( p ); - } - } - else - { - if ( offset == 0xFFFFU ) - break; - } - - if ( offset ) - { - p += offset + ( charcode - start ) * 2; - gindex = TT_PEEK_USHORT( p ); - if ( gindex != 0 ) - gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU; - } - else - gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU; - - break; - } - } - - if ( next ) - { - TT_CMap4 cmap4 = (TT_CMap4)cmap; - - - /* if `charcode' is not in any segment, then `mid' is */ - /* the segment nearest to `charcode' */ - /* */ - - if ( charcode > end ) - { - mid++; - if ( mid == num_segs ) - return 0; - } - - if ( tt_cmap4_set_range( cmap4, mid ) ) - { - if ( gindex ) - *pcharcode = charcode; - } - else - { - cmap4->cur_charcode = charcode; - - if ( gindex ) - cmap4->cur_gindex = gindex; - else - { - cmap4->cur_charcode = charcode; - tt_cmap4_next( cmap4 ); - gindex = cmap4->cur_gindex; - } - - if ( gindex ) - *pcharcode = cmap4->cur_charcode; - } - } - - return gindex; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap4_char_index( TT_CMap cmap, - FT_UInt32 char_code ) - { - if ( char_code >= 0x10000UL ) - return 0; - - if ( cmap->flags & TT_CMAP_FLAG_UNSORTED ) - return tt_cmap4_char_map_linear( cmap, &char_code, 0 ); - else - return tt_cmap4_char_map_binary( cmap, &char_code, 0 ); - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap4_char_next( TT_CMap cmap, - FT_UInt32 *pchar_code ) - { - FT_UInt gindex; - - - if ( *pchar_code >= 0xFFFFU ) - return 0; - - if ( cmap->flags & TT_CMAP_FLAG_UNSORTED ) - gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 ); - else - { - TT_CMap4 cmap4 = (TT_CMap4)cmap; - - - /* no need to search */ - if ( *pchar_code == cmap4->cur_charcode ) - { - tt_cmap4_next( cmap4 ); - gindex = cmap4->cur_gindex; - if ( gindex ) - *pchar_code = cmap4->cur_charcode; - } - else - gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 ); - } - - return gindex; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap4_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->format = 4; - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const TT_CMap_ClassRec tt_cmap4_class_rec = - { - { - sizeof ( TT_CMap4Rec ), - (FT_CMap_InitFunc) tt_cmap4_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)tt_cmap4_char_index, - (FT_CMap_CharNextFunc) tt_cmap4_char_next - }, - 4, - (TT_CMap_ValidateFunc) tt_cmap4_validate, - (TT_CMap_Info_GetFunc) tt_cmap4_get_info - }; - -#endif /* TT_CONFIG_CMAP_FORMAT_4 */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FORMAT 6 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* TABLE OVERVIEW */ - /* -------------- */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* format 0 USHORT must be 4 */ - /* length 2 USHORT table length in bytes */ - /* language 4 USHORT Mac language code */ - /* */ - /* first 6 USHORT first segment code */ - /* count 8 USHORT segment size in chars */ - /* glyphIds 10 USHORT[count] glyph ids */ - /* */ - /* A very simplified segment mapping. */ - /* */ - -#ifdef TT_CONFIG_CMAP_FORMAT_6 - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap6_validate( FT_Byte* table, - FT_Validator valid ) - { - FT_Byte* p; - FT_UInt length, count; - - - if ( table + 10 > valid->limit ) - FT_INVALID_TOO_SHORT; - - p = table + 2; - length = TT_NEXT_USHORT( p ); - - p = table + 8; /* skip language and start index */ - count = TT_NEXT_USHORT( p ); - - if ( table + length > valid->limit || length < 10 + count * 2 ) - FT_INVALID_TOO_SHORT; - - /* check glyph indices */ - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - FT_UInt gindex; - - - for ( ; count > 0; count-- ) - { - gindex = TT_NEXT_USHORT( p ); - if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) ) - FT_INVALID_GLYPH_ID; - } - } - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap6_char_index( TT_CMap cmap, - FT_UInt32 char_code ) - { - FT_Byte* table = cmap->data; - FT_UInt result = 0; - FT_Byte* p = table + 6; - FT_UInt start = TT_NEXT_USHORT( p ); - FT_UInt count = TT_NEXT_USHORT( p ); - FT_UInt idx = (FT_UInt)( char_code - start ); - - - if ( idx < count ) - { - p += 2 * idx; - result = TT_PEEK_USHORT( p ); - } - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap6_char_next( TT_CMap cmap, - FT_UInt32 *pchar_code ) - { - FT_Byte* table = cmap->data; - FT_UInt32 result = 0; - FT_UInt32 char_code = *pchar_code + 1; - FT_UInt gindex = 0; - - FT_Byte* p = table + 6; - FT_UInt start = TT_NEXT_USHORT( p ); - FT_UInt count = TT_NEXT_USHORT( p ); - FT_UInt idx; - - - if ( char_code >= 0x10000UL ) - goto Exit; - - if ( char_code < start ) - char_code = start; - - idx = (FT_UInt)( char_code - start ); - p += 2 * idx; - - for ( ; idx < count; idx++ ) - { - gindex = TT_NEXT_USHORT( p ); - if ( gindex != 0 ) - { - result = char_code; - break; - } - char_code++; - } - - Exit: - *pchar_code = result; - return gindex; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap6_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 4; - - - cmap_info->format = 6; - cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const TT_CMap_ClassRec tt_cmap6_class_rec = - { - { - sizeof ( TT_CMapRec ), - - (FT_CMap_InitFunc) tt_cmap_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)tt_cmap6_char_index, - (FT_CMap_CharNextFunc) tt_cmap6_char_next - }, - 6, - (TT_CMap_ValidateFunc) tt_cmap6_validate, - (TT_CMap_Info_GetFunc) tt_cmap6_get_info - }; - -#endif /* TT_CONFIG_CMAP_FORMAT_6 */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FORMAT 8 *****/ - /***** *****/ - /***** It's hard to completely understand what the OpenType spec *****/ - /***** says about this format, but here is my conclusion. *****/ - /***** *****/ - /***** The purpose of this format is to easily map UTF-16 text to *****/ - /***** glyph indices. Basically, the `char_code' must be in one of *****/ - /***** the following formats: *****/ - /***** *****/ - /***** - A 16-bit value that isn't part of the Unicode Surrogates *****/ - /***** Area (i.e. U+D800-U+DFFF). *****/ - /***** *****/ - /***** - A 32-bit value, made of two surrogate values, i.e.. if *****/ - /***** `char_code = (char_hi << 16) | char_lo', then both *****/ - /***** `char_hi' and `char_lo' must be in the Surrogates Area. *****/ - /***** Area. *****/ - /***** *****/ - /***** The 'is32' table embedded in the charmap indicates whether a *****/ - /***** given 16-bit value is in the surrogates area or not. *****/ - /***** *****/ - /***** So, for any given `char_code', we can assert the following: *****/ - /***** *****/ - /***** If `char_hi == 0' then we must have `is32[char_lo] == 0'. *****/ - /***** *****/ - /***** If `char_hi != 0' then we must have both *****/ - /***** `is32[char_hi] != 0' and `is32[char_lo] != 0'. *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* TABLE OVERVIEW */ - /* -------------- */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* format 0 USHORT must be 8 */ - /* reserved 2 USHORT reserved */ - /* length 4 ULONG length in bytes */ - /* language 8 ULONG Mac language code */ - /* is32 12 BYTE[8192] 32-bitness bitmap */ - /* count 8204 ULONG number of groups */ - /* */ - /* This header is followed by 'count' groups of the following format: */ - /* */ - /* start 0 ULONG first charcode */ - /* end 4 ULONG last charcode */ - /* startId 8 ULONG start glyph id for the group */ - /* */ - -#ifdef TT_CONFIG_CMAP_FORMAT_8 - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap8_validate( FT_Byte* table, - FT_Validator valid ) - { - FT_Byte* p = table + 4; - FT_Byte* is32; - FT_UInt32 length; - FT_UInt32 num_groups; - - - if ( table + 16 + 8192 > valid->limit ) - FT_INVALID_TOO_SHORT; - - length = TT_NEXT_ULONG( p ); - if ( table + length > valid->limit || length < 8208 ) - FT_INVALID_TOO_SHORT; - - is32 = table + 12; - p = is32 + 8192; /* skip `is32' array */ - num_groups = TT_NEXT_ULONG( p ); - - if ( p + num_groups * 12 > valid->limit ) - FT_INVALID_TOO_SHORT; - - /* check groups, they must be in increasing order */ - { - FT_UInt32 n, start, end, start_id, count, last = 0; - - - for ( n = 0; n < num_groups; n++ ) - { - FT_UInt hi, lo; - - - start = TT_NEXT_ULONG( p ); - end = TT_NEXT_ULONG( p ); - start_id = TT_NEXT_ULONG( p ); - - if ( start > end ) - FT_INVALID_DATA; - - if ( n > 0 && start <= last ) - FT_INVALID_DATA; - - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ) - FT_INVALID_GLYPH_ID; - - count = (FT_UInt32)( end - start + 1 ); - - if ( start & ~0xFFFFU ) - { - /* start_hi != 0; check that is32[i] is 1 for each i in */ - /* the `hi' and `lo' of the range [start..end] */ - for ( ; count > 0; count--, start++ ) - { - hi = (FT_UInt)( start >> 16 ); - lo = (FT_UInt)( start & 0xFFFFU ); - - if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 ) - FT_INVALID_DATA; - - if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 ) - FT_INVALID_DATA; - } - } - else - { - /* start_hi == 0; check that is32[i] is 0 for each i in */ - /* the range [start..end] */ - - /* end_hi cannot be != 0! */ - if ( end & ~0xFFFFU ) - FT_INVALID_DATA; - - for ( ; count > 0; count--, start++ ) - { - lo = (FT_UInt)( start & 0xFFFFU ); - - if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 ) - FT_INVALID_DATA; - } - } - } - - last = end; - } - } - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap8_char_index( TT_CMap cmap, - FT_UInt32 char_code ) - { - FT_Byte* table = cmap->data; - FT_UInt result = 0; - FT_Byte* p = table + 8204; - FT_UInt32 num_groups = TT_NEXT_ULONG( p ); - FT_UInt32 start, end, start_id; - - - for ( ; num_groups > 0; num_groups-- ) - { - start = TT_NEXT_ULONG( p ); - end = TT_NEXT_ULONG( p ); - start_id = TT_NEXT_ULONG( p ); - - if ( char_code < start ) - break; - - if ( char_code <= end ) - { - result = (FT_UInt)( start_id + char_code - start ); - break; - } - } - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap8_char_next( TT_CMap cmap, - FT_UInt32 *pchar_code ) - { - FT_UInt32 result = 0; - FT_UInt32 char_code = *pchar_code + 1; - FT_UInt gindex = 0; - FT_Byte* table = cmap->data; - FT_Byte* p = table + 8204; - FT_UInt32 num_groups = TT_NEXT_ULONG( p ); - FT_UInt32 start, end, start_id; - - - p = table + 8208; - - for ( ; num_groups > 0; num_groups-- ) - { - start = TT_NEXT_ULONG( p ); - end = TT_NEXT_ULONG( p ); - start_id = TT_NEXT_ULONG( p ); - - if ( char_code < start ) - char_code = start; - - if ( char_code <= end ) - { - gindex = (FT_UInt)( char_code - start + start_id ); - if ( gindex != 0 ) - { - result = char_code; - goto Exit; - } - } - } - - Exit: - *pchar_code = result; - return gindex; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap8_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 8; - - - cmap_info->format = 8; - cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const TT_CMap_ClassRec tt_cmap8_class_rec = - { - { - sizeof ( TT_CMapRec ), - - (FT_CMap_InitFunc) tt_cmap_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)tt_cmap8_char_index, - (FT_CMap_CharNextFunc) tt_cmap8_char_next - }, - 8, - (TT_CMap_ValidateFunc) tt_cmap8_validate, - (TT_CMap_Info_GetFunc) tt_cmap8_get_info - }; - -#endif /* TT_CONFIG_CMAP_FORMAT_8 */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FORMAT 10 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* TABLE OVERVIEW */ - /* -------------- */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* format 0 USHORT must be 10 */ - /* reserved 2 USHORT reserved */ - /* length 4 ULONG length in bytes */ - /* language 8 ULONG Mac language code */ - /* */ - /* start 12 ULONG first char in range */ - /* count 16 ULONG number of chars in range */ - /* glyphIds 20 USHORT[count] glyph indices covered */ - /* */ - -#ifdef TT_CONFIG_CMAP_FORMAT_10 - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap10_validate( FT_Byte* table, - FT_Validator valid ) - { - FT_Byte* p = table + 4; - FT_ULong length, count; - - - if ( table + 20 > valid->limit ) - FT_INVALID_TOO_SHORT; - - length = TT_NEXT_ULONG( p ); - p = table + 16; - count = TT_NEXT_ULONG( p ); - - if ( table + length > valid->limit || length < 20 + count * 2 ) - FT_INVALID_TOO_SHORT; - - /* check glyph indices */ - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - FT_UInt gindex; - - - for ( ; count > 0; count-- ) - { - gindex = TT_NEXT_USHORT( p ); - if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) ) - FT_INVALID_GLYPH_ID; - } - } - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap10_char_index( TT_CMap cmap, - FT_UInt32 char_code ) - { - FT_Byte* table = cmap->data; - FT_UInt result = 0; - FT_Byte* p = table + 12; - FT_UInt32 start = TT_NEXT_ULONG( p ); - FT_UInt32 count = TT_NEXT_ULONG( p ); - FT_UInt32 idx = (FT_ULong)( char_code - start ); - - - if ( idx < count ) - { - p += 2 * idx; - result = TT_PEEK_USHORT( p ); - } - return result; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap10_char_next( TT_CMap cmap, - FT_UInt32 *pchar_code ) - { - FT_Byte* table = cmap->data; - FT_UInt32 char_code = *pchar_code + 1; - FT_UInt gindex = 0; - FT_Byte* p = table + 12; - FT_UInt32 start = TT_NEXT_ULONG( p ); - FT_UInt32 count = TT_NEXT_ULONG( p ); - FT_UInt32 idx; - - - if ( char_code < start ) - char_code = start; - - idx = (FT_UInt32)( char_code - start ); - p += 2 * idx; - - for ( ; idx < count; idx++ ) - { - gindex = TT_NEXT_USHORT( p ); - if ( gindex != 0 ) - break; - char_code++; - } - - *pchar_code = char_code; - return gindex; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap10_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 8; - - - cmap_info->format = 10; - cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const TT_CMap_ClassRec tt_cmap10_class_rec = - { - { - sizeof ( TT_CMapRec ), - - (FT_CMap_InitFunc) tt_cmap_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)tt_cmap10_char_index, - (FT_CMap_CharNextFunc) tt_cmap10_char_next - }, - 10, - (TT_CMap_ValidateFunc) tt_cmap10_validate, - (TT_CMap_Info_GetFunc) tt_cmap10_get_info - }; - -#endif /* TT_CONFIG_CMAP_FORMAT_10 */ - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** FORMAT 12 *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* TABLE OVERVIEW */ - /* -------------- */ - /* */ - /* NAME OFFSET TYPE DESCRIPTION */ - /* */ - /* format 0 USHORT must be 12 */ - /* reserved 2 USHORT reserved */ - /* length 4 ULONG length in bytes */ - /* language 8 ULONG Mac language code */ - /* count 12 ULONG number of groups */ - /* 16 */ - /* */ - /* This header is followed by `count' groups of the following format: */ - /* */ - /* start 0 ULONG first charcode */ - /* end 4 ULONG last charcode */ - /* startId 8 ULONG start glyph id for the group */ - /* */ - -#ifdef TT_CONFIG_CMAP_FORMAT_12 - - typedef struct TT_CMap12Rec_ - { - TT_CMapRec cmap; - FT_Bool valid; - FT_ULong cur_charcode; - FT_UInt cur_gindex; - FT_ULong cur_group; - FT_ULong num_groups; - - } TT_CMap12Rec, *TT_CMap12; - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap12_init( TT_CMap12 cmap, - FT_Byte* table ) - { - cmap->cmap.data = table; - - table += 12; - cmap->num_groups = FT_PEEK_ULONG( table ); - - cmap->valid = 0; - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap12_validate( FT_Byte* table, - FT_Validator valid ) - { - FT_Byte* p; - FT_ULong length; - FT_ULong num_groups; - - - if ( table + 16 > valid->limit ) - FT_INVALID_TOO_SHORT; - - p = table + 4; - length = TT_NEXT_ULONG( p ); - - p = table + 12; - num_groups = TT_NEXT_ULONG( p ); - - if ( table + length > valid->limit || length < 16 + 12 * num_groups ) - FT_INVALID_TOO_SHORT; - - /* check groups, they must be in increasing order */ - { - FT_ULong n, start, end, start_id, last = 0; - - - for ( n = 0; n < num_groups; n++ ) - { - start = TT_NEXT_ULONG( p ); - end = TT_NEXT_ULONG( p ); - start_id = TT_NEXT_ULONG( p ); - - if ( start > end ) - FT_INVALID_DATA; - - if ( n > 0 && start <= last ) - FT_INVALID_DATA; - - if ( valid->level >= FT_VALIDATE_TIGHT ) - { - if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ) - FT_INVALID_GLYPH_ID; - } - - last = end; - } - } - - return SFNT_Err_Ok; - } - - - /* search the index of the charcode next to cmap->cur_charcode */ - /* cmap->cur_group should be set up properly by caller */ - /* */ - static void - tt_cmap12_next( TT_CMap12 cmap ) - { - FT_Byte* p; - FT_ULong start, end, start_id, char_code; - FT_ULong n; - FT_UInt gindex; - - - if ( cmap->cur_charcode >= 0xFFFFFFFFUL ) - goto Fail; - - char_code = cmap->cur_charcode + 1; - - n = cmap->cur_group; - - for ( n = cmap->cur_group; n < cmap->num_groups; n++ ) - { - p = cmap->cmap.data + 16 + 12 * n; - start = TT_NEXT_ULONG( p ); - end = TT_NEXT_ULONG( p ); - start_id = TT_PEEK_ULONG( p ); - - if ( char_code < start ) - char_code = start; - - for ( ; char_code <= end; char_code++ ) - { - gindex = (FT_UInt)( start_id + char_code - start ); - - if ( gindex ) - { - cmap->cur_charcode = char_code;; - cmap->cur_gindex = gindex; - cmap->cur_group = n; - - return; - } - } - } - - Fail: - cmap->valid = 0; - } - - - static FT_UInt - tt_cmap12_char_map_binary( TT_CMap cmap, - FT_UInt32* pchar_code, - FT_Bool next ) - { - FT_UInt gindex = 0; - FT_Byte* p = cmap->data + 12; - FT_UInt32 num_groups = TT_PEEK_ULONG( p ); - FT_UInt32 char_code = *pchar_code; - FT_UInt32 start, end, start_id; - FT_UInt32 max, min, mid; - - - if ( !num_groups ) - return 0; - - /* make compiler happy */ - mid = num_groups; - end = 0xFFFFFFFFUL; - - if ( next ) - char_code++; - - min = 0; - max = num_groups; - - /* binary search */ - while ( min < max ) - { - mid = ( min + max ) >> 1; - p = cmap->data + 16 + 12 * mid; - - start = TT_NEXT_ULONG( p ); - end = TT_NEXT_ULONG( p ); - - if ( char_code < start ) - max = mid; - else if ( char_code > end ) - min = mid + 1; - else - { - start_id = TT_PEEK_ULONG( p ); - gindex = (FT_UInt)( start_id + char_code - start ); - - break; - } - } - - if ( next ) - { - TT_CMap12 cmap12 = (TT_CMap12)cmap; - - - /* if `char_code' is not in any group, then `mid' is */ - /* the group nearest to `char_code' */ - /* */ - - if ( char_code > end ) - { - mid++; - if ( mid == num_groups ) - return 0; - } - - cmap12->valid = 1; - cmap12->cur_charcode = char_code; - cmap12->cur_group = mid; - - if ( !gindex ) - { - tt_cmap12_next( cmap12 ); - - if ( cmap12->valid ) - gindex = cmap12->cur_gindex; - } - else - cmap12->cur_gindex = gindex; - - if ( gindex ) - *pchar_code = cmap12->cur_charcode; - } - - return gindex; - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap12_char_index( TT_CMap cmap, - FT_UInt32 char_code ) - { - return tt_cmap12_char_map_binary( cmap, &char_code, 0 ); - } - - - FT_CALLBACK_DEF( FT_UInt ) - tt_cmap12_char_next( TT_CMap cmap, - FT_UInt32 *pchar_code ) - { - TT_CMap12 cmap12 = (TT_CMap12)cmap; - FT_ULong gindex; - - - if ( cmap12->cur_charcode >= 0xFFFFFFFFUL ) - return 0; - - /* no need to search */ - if ( cmap12->valid && cmap12->cur_charcode == *pchar_code ) - { - tt_cmap12_next( cmap12 ); - if ( cmap12->valid ) - { - gindex = cmap12->cur_gindex; - if ( gindex ) - *pchar_code = cmap12->cur_charcode; - } - else - gindex = 0; - } - else - gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 ); - - return gindex; - } - - - FT_CALLBACK_DEF( FT_Error ) - tt_cmap12_get_info( TT_CMap cmap, - TT_CMapInfo *cmap_info ) - { - FT_Byte* p = cmap->data + 8; - - - cmap_info->format = 12; - cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); - - return SFNT_Err_Ok; - } - - - FT_CALLBACK_TABLE_DEF - const TT_CMap_ClassRec tt_cmap12_class_rec = - { - { - sizeof ( TT_CMap12Rec ), - - (FT_CMap_InitFunc) tt_cmap12_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)tt_cmap12_char_index, - (FT_CMap_CharNextFunc) tt_cmap12_char_next - }, - 12, - (TT_CMap_ValidateFunc) tt_cmap12_validate, - (TT_CMap_Info_GetFunc) tt_cmap12_get_info - }; - - -#endif /* TT_CONFIG_CMAP_FORMAT_12 */ - - - static const TT_CMap_Class tt_cmap_classes[] = - { -#ifdef TT_CONFIG_CMAP_FORMAT_0 - &tt_cmap0_class_rec, -#endif - -#ifdef TT_CONFIG_CMAP_FORMAT_2 - &tt_cmap2_class_rec, -#endif - -#ifdef TT_CONFIG_CMAP_FORMAT_4 - &tt_cmap4_class_rec, -#endif - -#ifdef TT_CONFIG_CMAP_FORMAT_6 - &tt_cmap6_class_rec, -#endif - -#ifdef TT_CONFIG_CMAP_FORMAT_8 - &tt_cmap8_class_rec, -#endif - -#ifdef TT_CONFIG_CMAP_FORMAT_10 - &tt_cmap10_class_rec, -#endif - -#ifdef TT_CONFIG_CMAP_FORMAT_12 - &tt_cmap12_class_rec, -#endif - - NULL, - }; - - - /* parse the `cmap' table and build the corresponding TT_CMap objects */ - /* in the current face */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_build_cmaps( TT_Face face ) - { - FT_Byte* table = face->cmap_table; - FT_Byte* limit = table + face->cmap_size; - FT_UInt volatile num_cmaps; - FT_Byte* volatile p = table; - - - if ( p + 4 > limit ) - return SFNT_Err_Invalid_Table; - - /* only recognize format 0 */ - if ( TT_NEXT_USHORT( p ) != 0 ) - { - p -= 2; - FT_ERROR(( "tt_face_build_cmaps: unsupported `cmap' table format = %d\n", - TT_PEEK_USHORT( p ) )); - return SFNT_Err_Invalid_Table; - } - - num_cmaps = TT_NEXT_USHORT( p ); - - for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) - { - FT_CharMapRec charmap; - FT_UInt32 offset; - - - charmap.platform_id = TT_NEXT_USHORT( p ); - charmap.encoding_id = TT_NEXT_USHORT( p ); - charmap.face = FT_FACE( face ); - charmap.encoding = FT_ENCODING_NONE; /* will be filled later */ - offset = TT_NEXT_ULONG( p ); - - if ( offset && offset <= face->cmap_size - 2 ) - { - FT_Byte* volatile cmap = table + offset; - volatile FT_UInt format = TT_PEEK_USHORT( cmap ); - const TT_CMap_Class* volatile pclazz = tt_cmap_classes; - TT_CMap_Class volatile clazz; - - - for ( ; *pclazz; pclazz++ ) - { - clazz = *pclazz; - if ( clazz->format == format ) - { - volatile TT_ValidatorRec valid; - volatile FT_Error error = SFNT_Err_Ok; - - - ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit, - FT_VALIDATE_DEFAULT ); - - valid.num_glyphs = (FT_UInt)face->max_profile.numGlyphs; - - if ( ft_setjmp( - *((ft_jmp_buf*)&FT_VALIDATOR( &valid )->jump_buffer) ) == 0 ) - { - /* validate this cmap sub-table */ - error = clazz->validate( cmap, FT_VALIDATOR( &valid ) ); - } - - if ( valid.validator.error == 0 ) - { - FT_CMap ttcmap; - - - if ( !FT_CMap_New( (FT_CMap_Class)clazz, - cmap, &charmap, &ttcmap ) ) - { - /* it is simpler to directly set `flags' than adding */ - /* a parameter to FT_CMap_New */ - ((TT_CMap)ttcmap)->flags = (FT_Int)error; - } - } - else - { - FT_ERROR(( "tt_face_build_cmaps:" )); - FT_ERROR(( " broken cmap sub-table ignored!\n" )); - } - break; - } - } - } - } - - return SFNT_Err_Ok; - } - - - FT_LOCAL( FT_Error ) - tt_get_cmap_info( FT_CharMap charmap, - TT_CMapInfo *cmap_info ) - { - FT_CMap cmap = (FT_CMap)charmap; - TT_CMap_Class clazz = (TT_CMap_Class)cmap->clazz; - - - return clazz->get_cmap_info( charmap, cmap_info ); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* ttcmap.c */ +/* */ +/* TrueType character mapping table (cmap) support (body). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H + +#include "sferrors.h" /* must come before FT_INTERNAL_VALIDATE_H */ + +#include FT_INTERNAL_VALIDATE_H +#include FT_INTERNAL_STREAM_H +#include "ttload.h" +#include "ttcmap.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttcmap + + +#define TT_PEEK_SHORT FT_PEEK_SHORT +#define TT_PEEK_USHORT FT_PEEK_USHORT +#define TT_PEEK_LONG FT_PEEK_LONG +#define TT_PEEK_ULONG FT_PEEK_ULONG + +#define TT_NEXT_SHORT FT_NEXT_SHORT +#define TT_NEXT_USHORT FT_NEXT_USHORT +#define TT_NEXT_LONG FT_NEXT_LONG +#define TT_NEXT_ULONG FT_NEXT_ULONG + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap_init( TT_CMap cmap, + FT_Byte* table ) + { + cmap->data = table; + return SFNT_Err_Ok; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FORMAT 0 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* TABLE OVERVIEW */ + /* -------------- */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* format 0 USHORT must be 0 */ + /* length 2 USHORT table length in bytes */ + /* language 4 USHORT Mac language code */ + /* glyph_ids 6 BYTE[256] array of glyph indices */ + /* 262 */ + /* */ + +#ifdef TT_CONFIG_CMAP_FORMAT_0 + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap0_validate( FT_Byte* table, + FT_Validator valid ) + { + FT_Byte* p = table + 2; + FT_UInt length = TT_NEXT_USHORT( p ); + + + if ( table + length > valid->limit || length < 262 ) + FT_INVALID_TOO_SHORT; + + /* check glyph indices whenever necessary */ + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + FT_UInt n, idx; + + + p = table + 6; + for ( n = 0; n < 256; n++ ) + { + idx = *p++; + if ( idx >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_INVALID_GLYPH_ID; + } + } + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap0_char_index( TT_CMap cmap, + FT_UInt32 char_code ) + { + FT_Byte* table = cmap->data; + + + return char_code < 256 ? table[6 + char_code] : 0; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap0_char_next( TT_CMap cmap, + FT_UInt32 *pchar_code ) + { + FT_Byte* table = cmap->data; + FT_UInt32 charcode = *pchar_code; + FT_UInt32 result = 0; + FT_UInt gindex = 0; + + + table += 6; /* go to glyph ids */ + while ( ++charcode < 256 ) + { + gindex = table[charcode]; + if ( gindex != 0 ) + { + result = charcode; + break; + } + } + + *pchar_code = result; + return gindex; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap0_get_info( TT_CMap cmap, + TT_CMapInfo *cmap_info ) + { + FT_Byte* p = cmap->data + 4; + + + cmap_info->format = 0; + cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const TT_CMap_ClassRec tt_cmap0_class_rec = + { + { + sizeof ( TT_CMapRec ), + + (FT_CMap_InitFunc) tt_cmap_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)tt_cmap0_char_index, + (FT_CMap_CharNextFunc) tt_cmap0_char_next + }, + 0, + (TT_CMap_ValidateFunc) tt_cmap0_validate, + (TT_CMap_Info_GetFunc) tt_cmap0_get_info + }; + +#endif /* TT_CONFIG_CMAP_FORMAT_0 */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FORMAT 2 *****/ + /***** *****/ + /***** This is used for certain CJK encodings that encode text in a *****/ + /***** mixed 8/16 bits encoding along the following lines: *****/ + /***** *****/ + /***** * Certain byte values correspond to an 8-bit character code *****/ + /***** (typically in the range 0..127 for ASCII compatibility). *****/ + /***** *****/ + /***** * Certain byte values signal the first byte of a 2-byte *****/ + /***** character code (but these values are also valid as the *****/ + /***** second byte of a 2-byte character). *****/ + /***** *****/ + /***** The following charmap lookup and iteration functions all *****/ + /***** assume that the value "charcode" correspond to following: *****/ + /***** *****/ + /***** - For one byte characters, "charcode" is simply the *****/ + /***** character code. *****/ + /***** *****/ + /***** - For two byte characters, "charcode" is the 2-byte *****/ + /***** character code in big endian format. More exactly: *****/ + /***** *****/ + /***** (charcode >> 8) is the first byte value *****/ + /***** (charcode & 0xFF) is the second byte value *****/ + /***** *****/ + /***** Note that not all values of "charcode" are valid according *****/ + /***** to these rules, and the function moderately check the *****/ + /***** arguments. *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* TABLE OVERVIEW */ + /* -------------- */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* format 0 USHORT must be 2 */ + /* length 2 USHORT table length in bytes */ + /* language 4 USHORT Mac language code */ + /* keys 6 USHORT[256] sub-header keys */ + /* subs 518 SUBHEAD[NSUBS] sub-headers array */ + /* glyph_ids 518+NSUB*8 USHORT[] glyph id array */ + /* */ + /* The `keys' table is used to map charcode high-bytes to sub-headers. */ + /* The value of `NSUBS' is the number of sub-headers defined in the */ + /* table and is computed by finding the maximum of the `keys' table. */ + /* */ + /* Note that for any n, `keys[n]' is a byte offset within the `subs' */ + /* table, i.e., it is the corresponding sub-header index multiplied */ + /* by 8. */ + /* */ + /* Each sub-header has the following format: */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* first 0 USHORT first valid low-byte */ + /* count 2 USHORT number of valid low-bytes */ + /* delta 4 SHORT see below */ + /* offset 6 USHORT see below */ + /* */ + /* A sub-header defines, for each high-byte, the range of valid */ + /* low-bytes within the charmap. Note that the range defined by `first' */ + /* and `count' must be completely included in the interval [0..255] */ + /* according to the specification. */ + /* */ + /* If a character code is contained within a given sub-header, then */ + /* mapping it to a glyph index is done as follows: */ + /* */ + /* * The value of `offset' is read. This is a _byte_ distance from the */ + /* location of the `offset' field itself into a slice of the */ + /* `glyph_ids' table. Let's call it `slice' (it's a USHORT[] too). */ + /* */ + /* * The value `slice[char.lo - first]' is read. If it is 0, there is */ + /* no glyph for the charcode. Otherwise, the value of `delta' is */ + /* added to it (modulo 65536) to form a new glyph index. */ + /* */ + /* It is up to the validation routine to check that all offsets fall */ + /* within the glyph ids table (and not within the `subs' table itself or */ + /* outside of the CMap). */ + /* */ + +#ifdef TT_CONFIG_CMAP_FORMAT_2 + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap2_validate( FT_Byte* table, + FT_Validator valid ) + { + FT_Byte* p = table + 2; /* skip format */ + FT_UInt length = TT_PEEK_USHORT( p ); + FT_UInt n, max_subs; + FT_Byte* keys; /* keys table */ + FT_Byte* subs; /* sub-headers */ + FT_Byte* glyph_ids; /* glyph id array */ + + + if ( table + length > valid->limit || length < 6 + 512 ) + FT_INVALID_TOO_SHORT; + + keys = table + 6; + + /* parse keys to compute sub-headers count */ + p = keys; + max_subs = 0; + for ( n = 0; n < 256; n++ ) + { + FT_UInt idx = TT_NEXT_USHORT( p ); + + + /* value must be multiple of 8 */ + if ( valid->level >= FT_VALIDATE_PARANOID && ( idx & 7 ) != 0 ) + FT_INVALID_DATA; + + idx >>= 3; + + if ( idx > max_subs ) + max_subs = idx; + } + + FT_ASSERT( p == table + 518 ); + + subs = p; + glyph_ids = subs + (max_subs + 1) * 8; + if ( glyph_ids > valid->limit ) + FT_INVALID_TOO_SHORT; + + /* parse sub-headers */ + for ( n = 0; n <= max_subs; n++ ) + { + FT_UInt first_code, code_count, offset; + FT_Int delta; + FT_Byte* ids; + + + first_code = TT_NEXT_USHORT( p ); + code_count = TT_NEXT_USHORT( p ); + delta = TT_NEXT_SHORT( p ); + offset = TT_NEXT_USHORT( p ); + + /* check range within 0..255 */ + if ( valid->level >= FT_VALIDATE_PARANOID ) + { + if ( first_code >= 256 || first_code + code_count > 256 ) + FT_INVALID_DATA; + } + + /* check offset */ + if ( offset != 0 ) + { + ids = p - 2 + offset; + if ( ids < glyph_ids || ids + code_count*2 > table + length ) + FT_INVALID_OFFSET; + + /* check glyph ids */ + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + FT_Byte* limit = p + code_count * 2; + FT_UInt idx; + + + for ( ; p < limit; ) + { + idx = TT_NEXT_USHORT( p ); + if ( idx != 0 ) + { + idx = ( idx + delta ) & 0xFFFFU; + if ( idx >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_INVALID_GLYPH_ID; + } + } + } + } + } + + return SFNT_Err_Ok; + } + + + /* return sub header corresponding to a given character code */ + /* NULL on invalid charcode */ + static FT_Byte* + tt_cmap2_get_subheader( FT_Byte* table, + FT_UInt32 char_code ) + { + FT_Byte* result = NULL; + + + if ( char_code < 0x10000UL ) + { + FT_UInt char_lo = (FT_UInt)( char_code & 0xFF ); + FT_UInt char_hi = (FT_UInt)( char_code >> 8 ); + FT_Byte* p = table + 6; /* keys table */ + FT_Byte* subs = table + 518; /* subheaders table */ + FT_Byte* sub; + + + if ( char_hi == 0 ) + { + /* an 8-bit character code -- we use subHeader 0 in this case */ + /* to test whether the character code is in the charmap */ + /* */ + sub = subs; /* jump to first sub-header */ + + /* check that the sub-header for this byte is 0, which */ + /* indicates that it's really a valid one-byte value */ + /* Otherwise, return 0 */ + /* */ + p += char_lo * 2; + if ( TT_PEEK_USHORT( p ) != 0 ) + goto Exit; + } + else + { + /* a 16-bit character code */ + + /* jump to key entry */ + p += char_hi * 2; + /* jump to sub-header */ + sub = subs + ( FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 8 ) ); + + /* check that the high byte isn't a valid one-byte value */ + if ( sub == subs ) + goto Exit; + } + result = sub; + } + Exit: + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap2_char_index( TT_CMap cmap, + FT_UInt32 char_code ) + { + FT_Byte* table = cmap->data; + FT_UInt result = 0; + FT_Byte* subheader; + + + subheader = tt_cmap2_get_subheader( table, char_code ); + if ( subheader ) + { + FT_Byte* p = subheader; + FT_UInt idx = (FT_UInt)(char_code & 0xFF); + FT_UInt start, count; + FT_Int delta; + FT_UInt offset; + + + start = TT_NEXT_USHORT( p ); + count = TT_NEXT_USHORT( p ); + delta = TT_NEXT_SHORT ( p ); + offset = TT_PEEK_USHORT( p ); + + idx -= start; + if ( idx < count && offset != 0 ) + { + p += offset + 2 * idx; + idx = TT_PEEK_USHORT( p ); + + if ( idx != 0 ) + result = (FT_UInt)( idx + delta ) & 0xFFFFU; + } + } + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap2_char_next( TT_CMap cmap, + FT_UInt32 *pcharcode ) + { + FT_Byte* table = cmap->data; + FT_UInt gindex = 0; + FT_UInt32 result = 0; + FT_UInt32 charcode = *pcharcode + 1; + FT_Byte* subheader; + + + while ( charcode < 0x10000UL ) + { + subheader = tt_cmap2_get_subheader( table, charcode ); + if ( subheader ) + { + FT_Byte* p = subheader; + FT_UInt start = TT_NEXT_USHORT( p ); + FT_UInt count = TT_NEXT_USHORT( p ); + FT_Int delta = TT_NEXT_SHORT ( p ); + FT_UInt offset = TT_PEEK_USHORT( p ); + FT_UInt char_lo = (FT_UInt)( charcode & 0xFF ); + FT_UInt pos, idx; + + + if ( offset == 0 ) + goto Next_SubHeader; + + if ( char_lo < start ) + { + char_lo = start; + pos = 0; + } + else + pos = (FT_UInt)( char_lo - start ); + + p += offset + pos * 2; + charcode = FT_PAD_FLOOR( charcode, 256 ) + char_lo; + + for ( ; pos < count; pos++, charcode++ ) + { + idx = TT_NEXT_USHORT( p ); + + if ( idx != 0 ) + { + gindex = ( idx + delta ) & 0xFFFFU; + if ( gindex != 0 ) + { + result = charcode; + goto Exit; + } + } + } + } + + /* jump to next sub-header, i.e. higher byte value */ + Next_SubHeader: + charcode = FT_PAD_FLOOR( charcode, 256 ) + 256; + } + + Exit: + *pcharcode = result; + + return gindex; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap2_get_info( TT_CMap cmap, + TT_CMapInfo *cmap_info ) + { + FT_Byte* p = cmap->data + 4; + + + cmap_info->format = 2; + cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const TT_CMap_ClassRec tt_cmap2_class_rec = + { + { + sizeof ( TT_CMapRec ), + + (FT_CMap_InitFunc) tt_cmap_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)tt_cmap2_char_index, + (FT_CMap_CharNextFunc) tt_cmap2_char_next + }, + 2, + (TT_CMap_ValidateFunc) tt_cmap2_validate, + (TT_CMap_Info_GetFunc) tt_cmap2_get_info + }; + +#endif /* TT_CONFIG_CMAP_FORMAT_2 */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FORMAT 4 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* TABLE OVERVIEW */ + /* -------------- */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* format 0 USHORT must be 4 */ + /* length 2 USHORT table length */ + /* in bytes */ + /* language 4 USHORT Mac language code */ + /* */ + /* segCountX2 6 USHORT 2*NUM_SEGS */ + /* searchRange 8 USHORT 2*(1 << LOG_SEGS) */ + /* entrySelector 10 USHORT LOG_SEGS */ + /* rangeShift 12 USHORT segCountX2 - */ + /* searchRange */ + /* */ + /* endCount 14 USHORT[NUM_SEGS] end charcode for */ + /* each segment; last */ + /* is 0xFFFF */ + /* */ + /* pad 14+NUM_SEGS*2 USHORT padding */ + /* */ + /* startCount 16+NUM_SEGS*2 USHORT[NUM_SEGS] first charcode for */ + /* each segment */ + /* */ + /* idDelta 16+NUM_SEGS*4 SHORT[NUM_SEGS] delta for each */ + /* segment */ + /* idOffset 16+NUM_SEGS*6 SHORT[NUM_SEGS] range offset for */ + /* each segment; can be */ + /* zero */ + /* */ + /* glyphIds 16+NUM_SEGS*8 USHORT[] array of glyph id */ + /* ranges */ + /* */ + /* Character codes are modelled by a series of ordered (increasing) */ + /* intervals called segments. Each segment has start and end codes, */ + /* provided by the `startCount' and `endCount' arrays. Segments must */ + /* not be overlapping and the last segment should always contain the */ + /* `0xFFFF' endCount. */ + /* */ + /* The fields `searchRange', `entrySelector' and `rangeShift' are better */ + /* ignored (they are traces of over-engineering in the TrueType */ + /* specification). */ + /* */ + /* Each segment also has a signed `delta', as well as an optional offset */ + /* within the `glyphIds' table. */ + /* */ + /* If a segment's idOffset is 0, the glyph index corresponding to any */ + /* charcode within the segment is obtained by adding the value of */ + /* `idDelta' directly to the charcode, modulo 65536. */ + /* */ + /* Otherwise, a glyph index is taken from the glyph ids sub-array for */ + /* the segment, and the value of `idDelta' is added to it. */ + /* */ + /* */ + /* Finally, note that certain fonts contain invalid charmaps that */ + /* contain end=0xFFFF, start=0xFFFF, delta=0x0001, offset=0xFFFF at the */ + /* of their charmaps (e.g. opens___.ttf which comes with OpenOffice.org) */ + /* we need special code to deal with them correctly... */ + /* */ + +#ifdef TT_CONFIG_CMAP_FORMAT_4 + + typedef struct TT_CMap4Rec_ + { + TT_CMapRec cmap; + FT_UInt32 cur_charcode; /* current charcode */ + FT_UInt cur_gindex; /* current glyph index */ + + FT_UInt num_ranges; + FT_UInt cur_range; + FT_UInt cur_start; + FT_UInt cur_end; + FT_Int cur_delta; + FT_Byte* cur_values; + + } TT_CMap4Rec, *TT_CMap4; + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap4_init( TT_CMap4 cmap, + FT_Byte* table ) + { + FT_Byte* p; + + + cmap->cmap.data = table; + + p = table + 6; + cmap->num_ranges = FT_PEEK_USHORT( p ) >> 1; + cmap->cur_charcode = 0xFFFFFFFFUL; + cmap->cur_gindex = 0; + + return SFNT_Err_Ok; + } + + + static FT_Int + tt_cmap4_set_range( TT_CMap4 cmap, + FT_UInt range_index ) + { + FT_Byte* table = cmap->cmap.data; + FT_Byte* p; + FT_UInt num_ranges = cmap->num_ranges; + + + while ( range_index < num_ranges ) + { + FT_UInt offset; + + + p = table + 14 + range_index * 2; + cmap->cur_end = FT_PEEK_USHORT( p ); + + p += 2 + num_ranges * 2; + cmap->cur_start = FT_PEEK_USHORT( p ); + + p += num_ranges * 2; + cmap->cur_delta = FT_PEEK_SHORT( p ); + + p += num_ranges * 2; + offset = FT_PEEK_USHORT( p ); + + if ( offset != 0xFFFFU ) + { + cmap->cur_values = offset ? p + offset : NULL; + cmap->cur_range = range_index; + return 0; + } + + /* we skip empty segments */ + range_index++; + } + + return -1; + } + + + /* search the index of the charcode next to cmap->cur_charcode; */ + /* caller should call tt_cmap4_set_range with proper range */ + /* before calling this function */ + /* */ + static void + tt_cmap4_next( TT_CMap4 cmap ) + { + FT_UInt charcode; + + + if ( cmap->cur_charcode >= 0xFFFFUL ) + goto Fail; + + charcode = cmap->cur_charcode + 1; + + if ( charcode < cmap->cur_start ) + charcode = cmap->cur_start; + + for ( ;; ) + { + FT_Byte* values = cmap->cur_values; + FT_UInt end = cmap->cur_end; + FT_Int delta = cmap->cur_delta; + + + if ( charcode <= end ) + { + if ( values ) + { + FT_Byte* p = values + 2 * ( charcode - cmap->cur_start ); + + + do + { + FT_UInt gindex = FT_NEXT_USHORT( p ); + + + if ( gindex != 0 ) + { + gindex = (FT_UInt)( ( gindex + delta ) & 0xFFFFU ); + if ( gindex != 0 ) + { + cmap->cur_charcode = charcode; + cmap->cur_gindex = gindex; + return; + } + } + } while ( ++charcode <= end ); + } + else + { + do + { + FT_UInt gindex = (FT_UInt)( ( charcode + delta ) & 0xFFFFU ); + + + if ( gindex != 0 ) + { + cmap->cur_charcode = charcode; + cmap->cur_gindex = gindex; + return; + } + } while ( ++charcode <= end ); + } + } + + /* we need to find another range */ + if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 ) + break; + + if ( charcode < cmap->cur_start ) + charcode = cmap->cur_start; + } + + Fail: + cmap->cur_charcode = 0xFFFFFFFFUL; + cmap->cur_gindex = 0; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap4_validate( FT_Byte* table, + FT_Validator valid ) + { + FT_Byte* p = table + 2; /* skip format */ + FT_UInt length = TT_NEXT_USHORT( p ); + FT_Byte *ends, *starts, *offsets, *deltas, *glyph_ids; + FT_UInt num_segs; + FT_Error error = SFNT_Err_Ok; + + + if ( length < 16 ) + FT_INVALID_TOO_SHORT; + + /* in certain fonts, the `length' field is invalid and goes */ + /* out of bound. We try to correct this here... */ + if ( table + length > valid->limit ) + { + if ( valid->level >= FT_VALIDATE_TIGHT ) + FT_INVALID_TOO_SHORT; + + length = (FT_UInt)( valid->limit - table ); + } + + p = table + 6; + num_segs = TT_NEXT_USHORT( p ); /* read segCountX2 */ + + if ( valid->level >= FT_VALIDATE_PARANOID ) + { + /* check that we have an even value here */ + if ( num_segs & 1 ) + FT_INVALID_DATA; + } + + num_segs /= 2; + + if ( length < 16 + num_segs * 2 * 4 ) + FT_INVALID_TOO_SHORT; + + /* check the search parameters - even though we never use them */ + /* */ + if ( valid->level >= FT_VALIDATE_PARANOID ) + { + /* check the values of 'searchRange', 'entrySelector', 'rangeShift' */ + FT_UInt search_range = TT_NEXT_USHORT( p ); + FT_UInt entry_selector = TT_NEXT_USHORT( p ); + FT_UInt range_shift = TT_NEXT_USHORT( p ); + + + if ( ( search_range | range_shift ) & 1 ) /* must be even values */ + FT_INVALID_DATA; + + search_range /= 2; + range_shift /= 2; + + /* `search range' is the greatest power of 2 that is <= num_segs */ + + if ( search_range > num_segs || + search_range * 2 < num_segs || + search_range + range_shift != num_segs || + search_range != ( 1U << entry_selector ) ) + FT_INVALID_DATA; + } + + ends = table + 14; + starts = table + 16 + num_segs * 2; + deltas = starts + num_segs * 2; + offsets = deltas + num_segs * 2; + glyph_ids = offsets + num_segs * 2; + + /* check last segment, its end count must be FFFF */ + if ( valid->level >= FT_VALIDATE_PARANOID ) + { + p = ends + ( num_segs - 1 ) * 2; + if ( TT_PEEK_USHORT( p ) != 0xFFFFU ) + FT_INVALID_DATA; + } + + { + FT_UInt start, end, offset, n; + FT_UInt last_start = 0, last_end = 0; + FT_Int delta; + FT_Byte* p_start = starts; + FT_Byte* p_end = ends; + FT_Byte* p_delta = deltas; + FT_Byte* p_offset = offsets; + + + for ( n = 0; n < num_segs; n++ ) + { + p = p_offset; + start = TT_NEXT_USHORT( p_start ); + end = TT_NEXT_USHORT( p_end ); + delta = TT_NEXT_SHORT( p_delta ); + offset = TT_NEXT_USHORT( p_offset ); + + if ( start > end ) + FT_INVALID_DATA; + + /* this test should be performed at default validation level; */ + /* unfortunately, some popular Asian fonts present overlapping */ + /* ranges in their charmaps */ + /* */ + if ( start <= last_end && n > 0 ) + { + if ( valid->level >= FT_VALIDATE_TIGHT ) + FT_INVALID_DATA; + else + { + /* allow overlapping segments, provided their start points */ + /* and end points, respectively, are in ascending order. */ + /* */ + if ( last_start > start || last_end > end ) + error |= TT_CMAP_FLAG_UNSORTED; + else + error |= TT_CMAP_FLAG_OVERLAPPING; + } + } + + if ( offset && offset != 0xFFFFU ) + { + p += offset; /* start of glyph id array */ + + /* check that we point within the glyph ids table only */ + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + if ( p < glyph_ids || + p + ( end - start + 1 ) * 2 > table + length ) + FT_INVALID_DATA; + } + else + { + if ( p < glyph_ids || + p + ( end - start + 1 ) * 2 > valid->limit ) + FT_INVALID_DATA; + } + + /* check glyph indices within the segment range */ + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + FT_UInt i, idx; + + + for ( i = start; i < end; i++ ) + { + idx = FT_NEXT_USHORT( p ); + if ( idx != 0 ) + { + idx = (FT_UInt)( idx + delta ) & 0xFFFFU; + + if ( idx >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_INVALID_GLYPH_ID; + } + } + } + } + else if ( offset == 0xFFFFU ) + { + /* Some fonts (erroneously?) use a range offset of 0xFFFF */ + /* to mean missing glyph in cmap table */ + /* */ + if ( valid->level >= FT_VALIDATE_PARANOID || + n != num_segs - 1 || + !( start == 0xFFFFU && end == 0xFFFFU && delta == 0x1U ) ) + FT_INVALID_DATA; + } + + last_start = start; + last_end = end; + } + } + + return error; + } + + + static FT_UInt + tt_cmap4_char_map_linear( TT_CMap cmap, + FT_UInt* pcharcode, + FT_Bool next ) + { + FT_UInt num_segs2, start, end, offset; + FT_Int delta; + FT_UInt i, num_segs; + FT_UInt32 charcode = *pcharcode; + FT_UInt gindex = 0; + FT_Byte* p; + + + p = cmap->data + 6; + num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); + + num_segs = num_segs2 >> 1; + + if ( !num_segs ) + return 0; + + if ( next ) + charcode++; + + /* linear search */ + for ( ; charcode <= 0xFFFFU; charcode++ ) + { + FT_Byte* q; + + + p = cmap->data + 14; /* ends table */ + q = cmap->data + 16 + num_segs2; /* starts table */ + + for ( i = 0; i < num_segs; i++ ) + { + end = TT_NEXT_USHORT( p ); + start = TT_NEXT_USHORT( q ); + + if ( charcode >= start && charcode <= end ) + { + p = q - 2 + num_segs2; + delta = TT_PEEK_SHORT( p ); + p += num_segs2; + offset = TT_PEEK_USHORT( p ); + + if ( offset == 0xFFFFU ) + continue; + + if ( offset ) + { + p += offset + ( charcode - start ) * 2; + gindex = TT_PEEK_USHORT( p ); + if ( gindex != 0 ) + gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU; + } + else + gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU; + + break; + } + } + + if ( !next || gindex ) + break; + } + + if ( next && gindex ) + *pcharcode = charcode; + + return gindex; + } + + + static FT_UInt + tt_cmap4_char_map_binary( TT_CMap cmap, + FT_UInt* pcharcode, + FT_Bool next ) + { + FT_UInt num_segs2, start, end, offset; + FT_Int delta; + FT_UInt max, min, mid, num_segs; + FT_UInt charcode = *pcharcode; + FT_UInt gindex = 0; + FT_Byte* p; + + + p = cmap->data + 6; + num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); + + if ( !num_segs2 ) + return 0; + + num_segs = num_segs2 >> 1; + + /* make compiler happy */ + mid = num_segs; + end = 0xFFFFU; + + if ( next ) + charcode++; + + min = 0; + max = num_segs; + + /* binary search */ + while ( min < max ) + { + mid = ( min + max ) >> 1; + p = cmap->data + 14 + mid * 2; + end = TT_PEEK_USHORT( p ); + p += 2 + num_segs2; + start = TT_PEEK_USHORT( p ); + + if ( charcode < start ) + max = mid; + else if ( charcode > end ) + min = mid + 1; + else + { + p += num_segs2; + delta = TT_PEEK_SHORT( p ); + p += num_segs2; + offset = TT_PEEK_USHORT( p ); + + /* search the first segment containing `charcode' */ + if ( cmap->flags & TT_CMAP_FLAG_OVERLAPPING ) + { + FT_UInt i; + + + /* call the current segment `max' */ + max = mid; + + if ( offset == 0xFFFFU ) + mid = max + 1; + + /* search in segments before the current segment */ + for ( i = max ; i > 0; i-- ) + { + FT_UInt prev_end; + FT_Byte* old_p; + + + old_p = p; + p = cmap->data + 14 + ( i - 1 ) * 2; + prev_end = TT_PEEK_USHORT( p ); + + if ( charcode > prev_end ) + { + p = old_p; + break; + } + + end = prev_end; + p += 2 + num_segs2; + start = TT_PEEK_USHORT( p ); + p += num_segs2; + delta = TT_PEEK_SHORT( p ); + p += num_segs2; + offset = TT_PEEK_USHORT( p ); + + if ( offset != 0xFFFFU ) + mid = i - 1; + } + + /* no luck */ + if ( mid == max + 1 ) + { + if ( i != max ) + { + p = cmap->data + 14 + max * 2; + end = TT_PEEK_USHORT( p ); + p += 2 + num_segs2; + start = TT_PEEK_USHORT( p ); + p += num_segs2; + delta = TT_PEEK_SHORT( p ); + p += num_segs2; + offset = TT_PEEK_USHORT( p ); + } + + mid = max; + + /* search in segments after the current segment */ + for ( i = max + 1; i < num_segs; i++ ) + { + FT_UInt next_end, next_start; + + + p = cmap->data + 14 + i * 2; + next_end = TT_PEEK_USHORT( p ); + p += 2 + num_segs2; + next_start = TT_PEEK_USHORT( p ); + + if ( charcode < next_start ) + break; + + end = next_end; + start = next_start; + p += num_segs2; + delta = TT_PEEK_SHORT( p ); + p += num_segs2; + offset = TT_PEEK_USHORT( p ); + + if ( offset != 0xFFFFU ) + mid = i; + } + i--; + + /* still no luck */ + if ( mid == max ) + { + mid = i; + + break; + } + } + + /* end, start, delta, and offset are for the i'th segment */ + if ( mid != i ) + { + p = cmap->data + 14 + mid * 2; + end = TT_PEEK_USHORT( p ); + p += 2 + num_segs2; + start = TT_PEEK_USHORT( p ); + p += num_segs2; + delta = TT_PEEK_SHORT( p ); + p += num_segs2; + offset = TT_PEEK_USHORT( p ); + } + } + else + { + if ( offset == 0xFFFFU ) + break; + } + + if ( offset ) + { + p += offset + ( charcode - start ) * 2; + gindex = TT_PEEK_USHORT( p ); + if ( gindex != 0 ) + gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU; + } + else + gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU; + + break; + } + } + + if ( next ) + { + TT_CMap4 cmap4 = (TT_CMap4)cmap; + + + /* if `charcode' is not in any segment, then `mid' is */ + /* the segment nearest to `charcode' */ + /* */ + + if ( charcode > end ) + { + mid++; + if ( mid == num_segs ) + return 0; + } + + if ( tt_cmap4_set_range( cmap4, mid ) ) + { + if ( gindex ) + *pcharcode = charcode; + } + else + { + cmap4->cur_charcode = charcode; + + if ( gindex ) + cmap4->cur_gindex = gindex; + else + { + cmap4->cur_charcode = charcode; + tt_cmap4_next( cmap4 ); + gindex = cmap4->cur_gindex; + } + + if ( gindex ) + *pcharcode = cmap4->cur_charcode; + } + } + + return gindex; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap4_char_index( TT_CMap cmap, + FT_UInt32 char_code ) + { + if ( char_code >= 0x10000UL ) + return 0; + + if ( cmap->flags & TT_CMAP_FLAG_UNSORTED ) + return tt_cmap4_char_map_linear( cmap, &char_code, 0 ); + else + return tt_cmap4_char_map_binary( cmap, &char_code, 0 ); + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap4_char_next( TT_CMap cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt gindex; + + + if ( *pchar_code >= 0xFFFFU ) + return 0; + + if ( cmap->flags & TT_CMAP_FLAG_UNSORTED ) + gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 ); + else + { + TT_CMap4 cmap4 = (TT_CMap4)cmap; + + + /* no need to search */ + if ( *pchar_code == cmap4->cur_charcode ) + { + tt_cmap4_next( cmap4 ); + gindex = cmap4->cur_gindex; + if ( gindex ) + *pchar_code = cmap4->cur_charcode; + } + else + gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 ); + } + + return gindex; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap4_get_info( TT_CMap cmap, + TT_CMapInfo *cmap_info ) + { + FT_Byte* p = cmap->data + 4; + + + cmap_info->format = 4; + cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const TT_CMap_ClassRec tt_cmap4_class_rec = + { + { + sizeof ( TT_CMap4Rec ), + (FT_CMap_InitFunc) tt_cmap4_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)tt_cmap4_char_index, + (FT_CMap_CharNextFunc) tt_cmap4_char_next + }, + 4, + (TT_CMap_ValidateFunc) tt_cmap4_validate, + (TT_CMap_Info_GetFunc) tt_cmap4_get_info + }; + +#endif /* TT_CONFIG_CMAP_FORMAT_4 */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FORMAT 6 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* TABLE OVERVIEW */ + /* -------------- */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* format 0 USHORT must be 4 */ + /* length 2 USHORT table length in bytes */ + /* language 4 USHORT Mac language code */ + /* */ + /* first 6 USHORT first segment code */ + /* count 8 USHORT segment size in chars */ + /* glyphIds 10 USHORT[count] glyph ids */ + /* */ + /* A very simplified segment mapping. */ + /* */ + +#ifdef TT_CONFIG_CMAP_FORMAT_6 + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap6_validate( FT_Byte* table, + FT_Validator valid ) + { + FT_Byte* p; + FT_UInt length, count; + + + if ( table + 10 > valid->limit ) + FT_INVALID_TOO_SHORT; + + p = table + 2; + length = TT_NEXT_USHORT( p ); + + p = table + 8; /* skip language and start index */ + count = TT_NEXT_USHORT( p ); + + if ( table + length > valid->limit || length < 10 + count * 2 ) + FT_INVALID_TOO_SHORT; + + /* check glyph indices */ + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + FT_UInt gindex; + + + for ( ; count > 0; count-- ) + { + gindex = TT_NEXT_USHORT( p ); + if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_INVALID_GLYPH_ID; + } + } + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap6_char_index( TT_CMap cmap, + FT_UInt32 char_code ) + { + FT_Byte* table = cmap->data; + FT_UInt result = 0; + FT_Byte* p = table + 6; + FT_UInt start = TT_NEXT_USHORT( p ); + FT_UInt count = TT_NEXT_USHORT( p ); + FT_UInt idx = (FT_UInt)( char_code - start ); + + + if ( idx < count ) + { + p += 2 * idx; + result = TT_PEEK_USHORT( p ); + } + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap6_char_next( TT_CMap cmap, + FT_UInt32 *pchar_code ) + { + FT_Byte* table = cmap->data; + FT_UInt32 result = 0; + FT_UInt32 char_code = *pchar_code + 1; + FT_UInt gindex = 0; + + FT_Byte* p = table + 6; + FT_UInt start = TT_NEXT_USHORT( p ); + FT_UInt count = TT_NEXT_USHORT( p ); + FT_UInt idx; + + + if ( char_code >= 0x10000UL ) + goto Exit; + + if ( char_code < start ) + char_code = start; + + idx = (FT_UInt)( char_code - start ); + p += 2 * idx; + + for ( ; idx < count; idx++ ) + { + gindex = TT_NEXT_USHORT( p ); + if ( gindex != 0 ) + { + result = char_code; + break; + } + char_code++; + } + + Exit: + *pchar_code = result; + return gindex; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap6_get_info( TT_CMap cmap, + TT_CMapInfo *cmap_info ) + { + FT_Byte* p = cmap->data + 4; + + + cmap_info->format = 6; + cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p ); + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const TT_CMap_ClassRec tt_cmap6_class_rec = + { + { + sizeof ( TT_CMapRec ), + + (FT_CMap_InitFunc) tt_cmap_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)tt_cmap6_char_index, + (FT_CMap_CharNextFunc) tt_cmap6_char_next + }, + 6, + (TT_CMap_ValidateFunc) tt_cmap6_validate, + (TT_CMap_Info_GetFunc) tt_cmap6_get_info + }; + +#endif /* TT_CONFIG_CMAP_FORMAT_6 */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FORMAT 8 *****/ + /***** *****/ + /***** It's hard to completely understand what the OpenType spec *****/ + /***** says about this format, but here is my conclusion. *****/ + /***** *****/ + /***** The purpose of this format is to easily map UTF-16 text to *****/ + /***** glyph indices. Basically, the `char_code' must be in one of *****/ + /***** the following formats: *****/ + /***** *****/ + /***** - A 16-bit value that isn't part of the Unicode Surrogates *****/ + /***** Area (i.e. U+D800-U+DFFF). *****/ + /***** *****/ + /***** - A 32-bit value, made of two surrogate values, i.e.. if *****/ + /***** `char_code = (char_hi << 16) | char_lo', then both *****/ + /***** `char_hi' and `char_lo' must be in the Surrogates Area. *****/ + /***** Area. *****/ + /***** *****/ + /***** The 'is32' table embedded in the charmap indicates whether a *****/ + /***** given 16-bit value is in the surrogates area or not. *****/ + /***** *****/ + /***** So, for any given `char_code', we can assert the following: *****/ + /***** *****/ + /***** If `char_hi == 0' then we must have `is32[char_lo] == 0'. *****/ + /***** *****/ + /***** If `char_hi != 0' then we must have both *****/ + /***** `is32[char_hi] != 0' and `is32[char_lo] != 0'. *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* TABLE OVERVIEW */ + /* -------------- */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* format 0 USHORT must be 8 */ + /* reserved 2 USHORT reserved */ + /* length 4 ULONG length in bytes */ + /* language 8 ULONG Mac language code */ + /* is32 12 BYTE[8192] 32-bitness bitmap */ + /* count 8204 ULONG number of groups */ + /* */ + /* This header is followed by 'count' groups of the following format: */ + /* */ + /* start 0 ULONG first charcode */ + /* end 4 ULONG last charcode */ + /* startId 8 ULONG start glyph id for the group */ + /* */ + +#ifdef TT_CONFIG_CMAP_FORMAT_8 + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap8_validate( FT_Byte* table, + FT_Validator valid ) + { + FT_Byte* p = table + 4; + FT_Byte* is32; + FT_UInt32 length; + FT_UInt32 num_groups; + + + if ( table + 16 + 8192 > valid->limit ) + FT_INVALID_TOO_SHORT; + + length = TT_NEXT_ULONG( p ); + if ( table + length > valid->limit || length < 8208 ) + FT_INVALID_TOO_SHORT; + + is32 = table + 12; + p = is32 + 8192; /* skip `is32' array */ + num_groups = TT_NEXT_ULONG( p ); + + if ( p + num_groups * 12 > valid->limit ) + FT_INVALID_TOO_SHORT; + + /* check groups, they must be in increasing order */ + { + FT_UInt32 n, start, end, start_id, count, last = 0; + + + for ( n = 0; n < num_groups; n++ ) + { + FT_UInt hi, lo; + + + start = TT_NEXT_ULONG( p ); + end = TT_NEXT_ULONG( p ); + start_id = TT_NEXT_ULONG( p ); + + if ( start > end ) + FT_INVALID_DATA; + + if ( n > 0 && start <= last ) + FT_INVALID_DATA; + + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_INVALID_GLYPH_ID; + + count = (FT_UInt32)( end - start + 1 ); + + if ( start & ~0xFFFFU ) + { + /* start_hi != 0; check that is32[i] is 1 for each i in */ + /* the `hi' and `lo' of the range [start..end] */ + for ( ; count > 0; count--, start++ ) + { + hi = (FT_UInt)( start >> 16 ); + lo = (FT_UInt)( start & 0xFFFFU ); + + if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 ) + FT_INVALID_DATA; + + if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 ) + FT_INVALID_DATA; + } + } + else + { + /* start_hi == 0; check that is32[i] is 0 for each i in */ + /* the range [start..end] */ + + /* end_hi cannot be != 0! */ + if ( end & ~0xFFFFU ) + FT_INVALID_DATA; + + for ( ; count > 0; count--, start++ ) + { + lo = (FT_UInt)( start & 0xFFFFU ); + + if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 ) + FT_INVALID_DATA; + } + } + } + + last = end; + } + } + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap8_char_index( TT_CMap cmap, + FT_UInt32 char_code ) + { + FT_Byte* table = cmap->data; + FT_UInt result = 0; + FT_Byte* p = table + 8204; + FT_UInt32 num_groups = TT_NEXT_ULONG( p ); + FT_UInt32 start, end, start_id; + + + for ( ; num_groups > 0; num_groups-- ) + { + start = TT_NEXT_ULONG( p ); + end = TT_NEXT_ULONG( p ); + start_id = TT_NEXT_ULONG( p ); + + if ( char_code < start ) + break; + + if ( char_code <= end ) + { + result = (FT_UInt)( start_id + char_code - start ); + break; + } + } + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap8_char_next( TT_CMap cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt32 result = 0; + FT_UInt32 char_code = *pchar_code + 1; + FT_UInt gindex = 0; + FT_Byte* table = cmap->data; + FT_Byte* p = table + 8204; + FT_UInt32 num_groups = TT_NEXT_ULONG( p ); + FT_UInt32 start, end, start_id; + + + p = table + 8208; + + for ( ; num_groups > 0; num_groups-- ) + { + start = TT_NEXT_ULONG( p ); + end = TT_NEXT_ULONG( p ); + start_id = TT_NEXT_ULONG( p ); + + if ( char_code < start ) + char_code = start; + + if ( char_code <= end ) + { + gindex = (FT_UInt)( char_code - start + start_id ); + if ( gindex != 0 ) + { + result = char_code; + goto Exit; + } + } + } + + Exit: + *pchar_code = result; + return gindex; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap8_get_info( TT_CMap cmap, + TT_CMapInfo *cmap_info ) + { + FT_Byte* p = cmap->data + 8; + + + cmap_info->format = 8; + cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const TT_CMap_ClassRec tt_cmap8_class_rec = + { + { + sizeof ( TT_CMapRec ), + + (FT_CMap_InitFunc) tt_cmap_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)tt_cmap8_char_index, + (FT_CMap_CharNextFunc) tt_cmap8_char_next + }, + 8, + (TT_CMap_ValidateFunc) tt_cmap8_validate, + (TT_CMap_Info_GetFunc) tt_cmap8_get_info + }; + +#endif /* TT_CONFIG_CMAP_FORMAT_8 */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FORMAT 10 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* TABLE OVERVIEW */ + /* -------------- */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* format 0 USHORT must be 10 */ + /* reserved 2 USHORT reserved */ + /* length 4 ULONG length in bytes */ + /* language 8 ULONG Mac language code */ + /* */ + /* start 12 ULONG first char in range */ + /* count 16 ULONG number of chars in range */ + /* glyphIds 20 USHORT[count] glyph indices covered */ + /* */ + +#ifdef TT_CONFIG_CMAP_FORMAT_10 + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap10_validate( FT_Byte* table, + FT_Validator valid ) + { + FT_Byte* p = table + 4; + FT_ULong length, count; + + + if ( table + 20 > valid->limit ) + FT_INVALID_TOO_SHORT; + + length = TT_NEXT_ULONG( p ); + p = table + 16; + count = TT_NEXT_ULONG( p ); + + if ( table + length > valid->limit || length < 20 + count * 2 ) + FT_INVALID_TOO_SHORT; + + /* check glyph indices */ + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + FT_UInt gindex; + + + for ( ; count > 0; count-- ) + { + gindex = TT_NEXT_USHORT( p ); + if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_INVALID_GLYPH_ID; + } + } + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap10_char_index( TT_CMap cmap, + FT_UInt32 char_code ) + { + FT_Byte* table = cmap->data; + FT_UInt result = 0; + FT_Byte* p = table + 12; + FT_UInt32 start = TT_NEXT_ULONG( p ); + FT_UInt32 count = TT_NEXT_ULONG( p ); + FT_UInt32 idx = (FT_ULong)( char_code - start ); + + + if ( idx < count ) + { + p += 2 * idx; + result = TT_PEEK_USHORT( p ); + } + return result; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap10_char_next( TT_CMap cmap, + FT_UInt32 *pchar_code ) + { + FT_Byte* table = cmap->data; + FT_UInt32 char_code = *pchar_code + 1; + FT_UInt gindex = 0; + FT_Byte* p = table + 12; + FT_UInt32 start = TT_NEXT_ULONG( p ); + FT_UInt32 count = TT_NEXT_ULONG( p ); + FT_UInt32 idx; + + + if ( char_code < start ) + char_code = start; + + idx = (FT_UInt32)( char_code - start ); + p += 2 * idx; + + for ( ; idx < count; idx++ ) + { + gindex = TT_NEXT_USHORT( p ); + if ( gindex != 0 ) + break; + char_code++; + } + + *pchar_code = char_code; + return gindex; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap10_get_info( TT_CMap cmap, + TT_CMapInfo *cmap_info ) + { + FT_Byte* p = cmap->data + 8; + + + cmap_info->format = 10; + cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const TT_CMap_ClassRec tt_cmap10_class_rec = + { + { + sizeof ( TT_CMapRec ), + + (FT_CMap_InitFunc) tt_cmap_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)tt_cmap10_char_index, + (FT_CMap_CharNextFunc) tt_cmap10_char_next + }, + 10, + (TT_CMap_ValidateFunc) tt_cmap10_validate, + (TT_CMap_Info_GetFunc) tt_cmap10_get_info + }; + +#endif /* TT_CONFIG_CMAP_FORMAT_10 */ + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** FORMAT 12 *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* TABLE OVERVIEW */ + /* -------------- */ + /* */ + /* NAME OFFSET TYPE DESCRIPTION */ + /* */ + /* format 0 USHORT must be 12 */ + /* reserved 2 USHORT reserved */ + /* length 4 ULONG length in bytes */ + /* language 8 ULONG Mac language code */ + /* count 12 ULONG number of groups */ + /* 16 */ + /* */ + /* This header is followed by `count' groups of the following format: */ + /* */ + /* start 0 ULONG first charcode */ + /* end 4 ULONG last charcode */ + /* startId 8 ULONG start glyph id for the group */ + /* */ + +#ifdef TT_CONFIG_CMAP_FORMAT_12 + + typedef struct TT_CMap12Rec_ + { + TT_CMapRec cmap; + FT_Bool valid; + FT_ULong cur_charcode; + FT_UInt cur_gindex; + FT_ULong cur_group; + FT_ULong num_groups; + + } TT_CMap12Rec, *TT_CMap12; + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap12_init( TT_CMap12 cmap, + FT_Byte* table ) + { + cmap->cmap.data = table; + + table += 12; + cmap->num_groups = FT_PEEK_ULONG( table ); + + cmap->valid = 0; + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap12_validate( FT_Byte* table, + FT_Validator valid ) + { + FT_Byte* p; + FT_ULong length; + FT_ULong num_groups; + + + if ( table + 16 > valid->limit ) + FT_INVALID_TOO_SHORT; + + p = table + 4; + length = TT_NEXT_ULONG( p ); + + p = table + 12; + num_groups = TT_NEXT_ULONG( p ); + + if ( table + length > valid->limit || length < 16 + 12 * num_groups ) + FT_INVALID_TOO_SHORT; + + /* check groups, they must be in increasing order */ + { + FT_ULong n, start, end, start_id, last = 0; + + + for ( n = 0; n < num_groups; n++ ) + { + start = TT_NEXT_ULONG( p ); + end = TT_NEXT_ULONG( p ); + start_id = TT_NEXT_ULONG( p ); + + if ( start > end ) + FT_INVALID_DATA; + + if ( n > 0 && start <= last ) + FT_INVALID_DATA; + + if ( valid->level >= FT_VALIDATE_TIGHT ) + { + if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_INVALID_GLYPH_ID; + } + + last = end; + } + } + + return SFNT_Err_Ok; + } + + + /* search the index of the charcode next to cmap->cur_charcode */ + /* cmap->cur_group should be set up properly by caller */ + /* */ + static void + tt_cmap12_next( TT_CMap12 cmap ) + { + FT_Byte* p; + FT_ULong start, end, start_id, char_code; + FT_ULong n; + FT_UInt gindex; + + + if ( cmap->cur_charcode >= 0xFFFFFFFFUL ) + goto Fail; + + char_code = cmap->cur_charcode + 1; + + n = cmap->cur_group; + + for ( n = cmap->cur_group; n < cmap->num_groups; n++ ) + { + p = cmap->cmap.data + 16 + 12 * n; + start = TT_NEXT_ULONG( p ); + end = TT_NEXT_ULONG( p ); + start_id = TT_PEEK_ULONG( p ); + + if ( char_code < start ) + char_code = start; + + for ( ; char_code <= end; char_code++ ) + { + gindex = (FT_UInt)( start_id + char_code - start ); + + if ( gindex ) + { + cmap->cur_charcode = char_code;; + cmap->cur_gindex = gindex; + cmap->cur_group = n; + + return; + } + } + } + + Fail: + cmap->valid = 0; + } + + + static FT_UInt + tt_cmap12_char_map_binary( TT_CMap cmap, + FT_UInt32* pchar_code, + FT_Bool next ) + { + FT_UInt gindex = 0; + FT_Byte* p = cmap->data + 12; + FT_UInt32 num_groups = TT_PEEK_ULONG( p ); + FT_UInt32 char_code = *pchar_code; + FT_UInt32 start, end, start_id; + FT_UInt32 max, min, mid; + + + if ( !num_groups ) + return 0; + + /* make compiler happy */ + mid = num_groups; + end = 0xFFFFFFFFUL; + + if ( next ) + char_code++; + + min = 0; + max = num_groups; + + /* binary search */ + while ( min < max ) + { + mid = ( min + max ) >> 1; + p = cmap->data + 16 + 12 * mid; + + start = TT_NEXT_ULONG( p ); + end = TT_NEXT_ULONG( p ); + + if ( char_code < start ) + max = mid; + else if ( char_code > end ) + min = mid + 1; + else + { + start_id = TT_PEEK_ULONG( p ); + gindex = (FT_UInt)( start_id + char_code - start ); + + break; + } + } + + if ( next ) + { + TT_CMap12 cmap12 = (TT_CMap12)cmap; + + + /* if `char_code' is not in any group, then `mid' is */ + /* the group nearest to `char_code' */ + /* */ + + if ( char_code > end ) + { + mid++; + if ( mid == num_groups ) + return 0; + } + + cmap12->valid = 1; + cmap12->cur_charcode = char_code; + cmap12->cur_group = mid; + + if ( !gindex ) + { + tt_cmap12_next( cmap12 ); + + if ( cmap12->valid ) + gindex = cmap12->cur_gindex; + } + else + cmap12->cur_gindex = gindex; + + if ( gindex ) + *pchar_code = cmap12->cur_charcode; + } + + return gindex; + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap12_char_index( TT_CMap cmap, + FT_UInt32 char_code ) + { + return tt_cmap12_char_map_binary( cmap, &char_code, 0 ); + } + + + FT_CALLBACK_DEF( FT_UInt ) + tt_cmap12_char_next( TT_CMap cmap, + FT_UInt32 *pchar_code ) + { + TT_CMap12 cmap12 = (TT_CMap12)cmap; + FT_ULong gindex; + + + if ( cmap12->cur_charcode >= 0xFFFFFFFFUL ) + return 0; + + /* no need to search */ + if ( cmap12->valid && cmap12->cur_charcode == *pchar_code ) + { + tt_cmap12_next( cmap12 ); + if ( cmap12->valid ) + { + gindex = cmap12->cur_gindex; + if ( gindex ) + *pchar_code = cmap12->cur_charcode; + } + else + gindex = 0; + } + else + gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 ); + + return gindex; + } + + + FT_CALLBACK_DEF( FT_Error ) + tt_cmap12_get_info( TT_CMap cmap, + TT_CMapInfo *cmap_info ) + { + FT_Byte* p = cmap->data + 8; + + + cmap_info->format = 12; + cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p ); + + return SFNT_Err_Ok; + } + + + FT_CALLBACK_TABLE_DEF + const TT_CMap_ClassRec tt_cmap12_class_rec = + { + { + sizeof ( TT_CMap12Rec ), + + (FT_CMap_InitFunc) tt_cmap12_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)tt_cmap12_char_index, + (FT_CMap_CharNextFunc) tt_cmap12_char_next + }, + 12, + (TT_CMap_ValidateFunc) tt_cmap12_validate, + (TT_CMap_Info_GetFunc) tt_cmap12_get_info + }; + + +#endif /* TT_CONFIG_CMAP_FORMAT_12 */ + + + static const TT_CMap_Class tt_cmap_classes[] = + { +#ifdef TT_CONFIG_CMAP_FORMAT_0 + &tt_cmap0_class_rec, +#endif + +#ifdef TT_CONFIG_CMAP_FORMAT_2 + &tt_cmap2_class_rec, +#endif + +#ifdef TT_CONFIG_CMAP_FORMAT_4 + &tt_cmap4_class_rec, +#endif + +#ifdef TT_CONFIG_CMAP_FORMAT_6 + &tt_cmap6_class_rec, +#endif + +#ifdef TT_CONFIG_CMAP_FORMAT_8 + &tt_cmap8_class_rec, +#endif + +#ifdef TT_CONFIG_CMAP_FORMAT_10 + &tt_cmap10_class_rec, +#endif + +#ifdef TT_CONFIG_CMAP_FORMAT_12 + &tt_cmap12_class_rec, +#endif + + NULL, + }; + + + /* parse the `cmap' table and build the corresponding TT_CMap objects */ + /* in the current face */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_build_cmaps( TT_Face face ) + { + FT_Byte* table = face->cmap_table; + FT_Byte* limit = table + face->cmap_size; + FT_UInt volatile num_cmaps; + FT_Byte* volatile p = table; + + + if ( p + 4 > limit ) + return SFNT_Err_Invalid_Table; + + /* only recognize format 0 */ + if ( TT_NEXT_USHORT( p ) != 0 ) + { + p -= 2; + FT_ERROR(( "tt_face_build_cmaps: unsupported `cmap' table format = %d\n", + TT_PEEK_USHORT( p ) )); + return SFNT_Err_Invalid_Table; + } + + num_cmaps = TT_NEXT_USHORT( p ); + + for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) + { + FT_CharMapRec charmap; + FT_UInt32 offset; + + + charmap.platform_id = TT_NEXT_USHORT( p ); + charmap.encoding_id = TT_NEXT_USHORT( p ); + charmap.face = FT_FACE( face ); + charmap.encoding = FT_ENCODING_NONE; /* will be filled later */ + offset = TT_NEXT_ULONG( p ); + + if ( offset && offset <= face->cmap_size - 2 ) + { + FT_Byte* volatile cmap = table + offset; + volatile FT_UInt format = TT_PEEK_USHORT( cmap ); + const TT_CMap_Class* volatile pclazz = tt_cmap_classes; + TT_CMap_Class volatile clazz; + + + for ( ; *pclazz; pclazz++ ) + { + clazz = *pclazz; + if ( clazz->format == format ) + { + volatile TT_ValidatorRec valid; + volatile FT_Error error = SFNT_Err_Ok; + + + ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit, + FT_VALIDATE_DEFAULT ); + + valid.num_glyphs = (FT_UInt)face->max_profile.numGlyphs; + + if ( ft_setjmp( + *((ft_jmp_buf*)&FT_VALIDATOR( &valid )->jump_buffer) ) == 0 ) + { + /* validate this cmap sub-table */ + error = clazz->validate( cmap, FT_VALIDATOR( &valid ) ); + } + + if ( valid.validator.error == 0 ) + { + FT_CMap ttcmap; + + + if ( !FT_CMap_New( (FT_CMap_Class)clazz, + cmap, &charmap, &ttcmap ) ) + { + /* it is simpler to directly set `flags' than adding */ + /* a parameter to FT_CMap_New */ + ((TT_CMap)ttcmap)->flags = (FT_Int)error; + } + } + else + { + FT_ERROR(( "tt_face_build_cmaps:" )); + FT_ERROR(( " broken cmap sub-table ignored!\n" )); + } + break; + } + } + } + } + + return SFNT_Err_Ok; + } + + + FT_LOCAL( FT_Error ) + tt_get_cmap_info( FT_CharMap charmap, + TT_CMapInfo *cmap_info ) + { + FT_CMap cmap = (FT_CMap)charmap; + TT_CMap_Class clazz = (TT_CMap_Class)cmap->clazz; + + + return clazz->get_cmap_info( charmap, cmap_info ); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.h b/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.h index a10a3e2502c..73a341ffa6c 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttcmap.h @@ -1,85 +1,85 @@ -/***************************************************************************/ -/* */ -/* ttcmap.h */ -/* */ -/* TrueType character mapping table (cmap) support (specification). */ -/* */ -/* Copyright 2002, 2003, 2004, 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTCMAP_H__ -#define __TTCMAP_H__ - - -#include -#include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_INTERNAL_VALIDATE_H -#include FT_SERVICE_TT_CMAP_H - -FT_BEGIN_HEADER - - -#define TT_CMAP_FLAG_UNSORTED 1 -#define TT_CMAP_FLAG_OVERLAPPING 2 - - typedef struct TT_CMapRec_ - { - FT_CMapRec cmap; - FT_Byte* data; /* pointer to in-memory cmap table */ - FT_Int flags; /* for format 4 only */ - - } TT_CMapRec, *TT_CMap; - - typedef const struct TT_CMap_ClassRec_* TT_CMap_Class; - - - typedef FT_Error - (*TT_CMap_ValidateFunc)( FT_Byte* data, - FT_Validator valid ); - - typedef struct TT_CMap_ClassRec_ - { - FT_CMap_ClassRec clazz; - FT_UInt format; - TT_CMap_ValidateFunc validate; - TT_CMap_Info_GetFunc get_cmap_info; - - } TT_CMap_ClassRec; - - - typedef struct TT_ValidatorRec_ - { - FT_ValidatorRec validator; - FT_UInt num_glyphs; - - } TT_ValidatorRec, *TT_Validator; - - -#define TT_VALIDATOR( x ) ((TT_Validator)( x )) -#define TT_VALID_GLYPH_COUNT( x ) TT_VALIDATOR( x )->num_glyphs - - - FT_LOCAL( FT_Error ) - tt_face_build_cmaps( TT_Face face ); - - /* used in tt-cmaps service */ - FT_LOCAL( FT_Error ) - tt_get_cmap_info( FT_CharMap charmap, - TT_CMapInfo *cmap_info ); - - -FT_END_HEADER - -#endif /* __TTCMAP_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttcmap.h */ +/* */ +/* TrueType character mapping table (cmap) support (specification). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTCMAP_H__ +#define __TTCMAP_H__ + + +#include +#include FT_INTERNAL_TRUETYPE_TYPES_H +#include FT_INTERNAL_VALIDATE_H +#include FT_SERVICE_TT_CMAP_H + +FT_BEGIN_HEADER + + +#define TT_CMAP_FLAG_UNSORTED 1 +#define TT_CMAP_FLAG_OVERLAPPING 2 + + typedef struct TT_CMapRec_ + { + FT_CMapRec cmap; + FT_Byte* data; /* pointer to in-memory cmap table */ + FT_Int flags; /* for format 4 only */ + + } TT_CMapRec, *TT_CMap; + + typedef const struct TT_CMap_ClassRec_* TT_CMap_Class; + + + typedef FT_Error + (*TT_CMap_ValidateFunc)( FT_Byte* data, + FT_Validator valid ); + + typedef struct TT_CMap_ClassRec_ + { + FT_CMap_ClassRec clazz; + FT_UInt format; + TT_CMap_ValidateFunc validate; + TT_CMap_Info_GetFunc get_cmap_info; + + } TT_CMap_ClassRec; + + + typedef struct TT_ValidatorRec_ + { + FT_ValidatorRec validator; + FT_UInt num_glyphs; + + } TT_ValidatorRec, *TT_Validator; + + +#define TT_VALIDATOR( x ) ((TT_Validator)( x )) +#define TT_VALID_GLYPH_COUNT( x ) TT_VALIDATOR( x )->num_glyphs + + + FT_LOCAL( FT_Error ) + tt_face_build_cmaps( TT_Face face ); + + /* used in tt-cmaps service */ + FT_LOCAL( FT_Error ) + tt_get_cmap_info( FT_CharMap charmap, + TT_CMapInfo *cmap_info ); + + +FT_END_HEADER + +#endif /* __TTCMAP_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.c index 28e52c333e8..a3248625680 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.c @@ -1,292 +1,292 @@ -/***************************************************************************/ -/* */ -/* ttkern.c */ -/* */ -/* Load the basic TrueType kerning table. This doesn't handle */ -/* kerning data within the GPOS table at the moment. */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include "ttkern.h" -#include "ttload.h" - -#include "sferrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttkern - - -#undef TT_KERN_INDEX -#define TT_KERN_INDEX( g1, g2 ) ( ( (FT_ULong)(g1) << 16 ) | (g2) ) - - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_kern( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - FT_ULong table_size; - FT_Byte* p; - FT_Byte* p_limit; - FT_UInt nn, num_tables; - FT_UInt32 avail = 0, ordered = 0; - - - /* the kern table is optional; exit silently if it is missing */ - error = face->goto_table( face, TTAG_kern, stream, &table_size ); - if ( error ) - goto Exit; - - if ( table_size < 4 ) /* the case of a malformed table */ - { - FT_ERROR(( "kerning table is too small - ignored\n" )); - error = SFNT_Err_Table_Missing; - goto Exit; - } - - if ( FT_FRAME_EXTRACT( table_size, face->kern_table ) ) - { - FT_ERROR(( "could not extract kerning table\n" )); - goto Exit; - } - - face->kern_table_size = table_size; - - p = face->kern_table; - p_limit = p + table_size; - - p += 2; /* skip version */ - num_tables = FT_NEXT_USHORT( p ); - - if ( num_tables > 32 ) /* we only support up to 32 sub-tables */ - num_tables = 32; - - for ( nn = 0; nn < num_tables; nn++ ) - { - FT_UInt num_pairs, length, coverage; - FT_Byte* p_next; - FT_UInt32 mask = 1UL << nn; - - - if ( p + 6 > p_limit ) - break; - - p_next = p; - - p += 2; /* skip version */ - length = FT_NEXT_USHORT( p ); - coverage = FT_NEXT_USHORT( p ); - - if ( length <= 6 ) - break; - - p_next += length; - - /* only use horizontal kerning tables */ - if ( ( coverage & ~8 ) != 0x0001 || - p + 8 > p_limit ) - goto NextTable; - - num_pairs = FT_NEXT_USHORT( p ); - p += 6; - - if ( p + 6 * num_pairs > p_limit ) - goto NextTable; - - avail |= mask; - - /* - * Now check whether the pairs in this table are ordered. - * We then can use binary search. - */ - if ( num_pairs > 0 ) - { - FT_UInt count; - FT_UInt old_pair; - - - old_pair = FT_NEXT_ULONG( p ); - p += 2; - - for ( count = num_pairs - 1; count > 0; count-- ) - { - FT_UInt32 cur_pair; - - - cur_pair = FT_NEXT_ULONG( p ); - if ( cur_pair <= old_pair ) - break; - - p += 2; - old_pair = cur_pair; - } - - if ( count == 0 ) - ordered |= mask; - } - - NextTable: - p = p_next; - } - - face->num_kern_tables = nn; - face->kern_avail_bits = avail; - face->kern_order_bits = ordered; - - Exit: - return error; - } - - - FT_LOCAL_DEF( void ) - tt_face_done_kern( TT_Face face ) - { - FT_Stream stream = face->root.stream; - - - FT_FRAME_RELEASE( face->kern_table ); - face->kern_table_size = 0; - face->num_kern_tables = 0; - face->kern_avail_bits = 0; - face->kern_order_bits = 0; - } - - - FT_LOCAL_DEF( FT_Int ) - tt_face_get_kerning( TT_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph ) - { - FT_Int result = 0; - FT_UInt count, mask = 1; - FT_Byte* p = face->kern_table; - - - p += 4; - mask = 0x0001; - - for ( count = face->num_kern_tables; count > 0; count--, mask <<= 1 ) - { - FT_Byte* base = p; - FT_Byte* next = base; - FT_UInt version = FT_NEXT_USHORT( p ); - FT_UInt length = FT_NEXT_USHORT( p ); - FT_UInt coverage = FT_NEXT_USHORT( p ); - FT_Int value = 0; - - FT_UNUSED( version ); - - - next = base + length; - - if ( ( face->kern_avail_bits & mask ) == 0 ) - goto NextTable; - - if ( p + 8 > next ) - goto NextTable; - - switch ( coverage >> 8 ) - { - case 0: - { - FT_UInt num_pairs = FT_NEXT_USHORT( p ); - FT_ULong key0 = TT_KERN_INDEX( left_glyph, right_glyph ); - - - p += 6; - - if ( face->kern_order_bits & mask ) /* binary search */ - { - FT_UInt min = 0; - FT_UInt max = num_pairs; - - - while ( min < max ) - { - FT_UInt mid = ( min + max ) >> 1; - FT_Byte* q = p + 6 * mid; - FT_ULong key; - - - key = FT_NEXT_ULONG( q ); - - if ( key == key0 ) - { - value = FT_PEEK_SHORT( q ); - goto Found; - } - if ( key < key0 ) - min = mid + 1; - else - max = mid; - } - } - else /* linear search */ - { - FT_UInt count2; - - - for ( count2 = num_pairs; count2 > 0; count2-- ) - { - FT_ULong key = FT_NEXT_ULONG( p ); - - - if ( key == key0 ) - { - value = FT_PEEK_SHORT( p ); - goto Found; - } - p += 2; - } - } - } - break; - - /* - * We don't support format 2 because we haven't seen a single font - * using it in real life... - */ - - default: - ; - } - - goto NextTable; - - Found: - if ( coverage & 8 ) /* override or add */ - result = value; - else - result += value; - - NextTable: - p = next; - } - - return result; - } - -#undef TT_KERN_INDEX - -/* END */ +/***************************************************************************/ +/* */ +/* ttkern.c */ +/* */ +/* Load the basic TrueType kerning table. This doesn't handle */ +/* kerning data within the GPOS table at the moment. */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H +#include "ttkern.h" +#include "ttload.h" + +#include "sferrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttkern + + +#undef TT_KERN_INDEX +#define TT_KERN_INDEX( g1, g2 ) ( ( (FT_ULong)(g1) << 16 ) | (g2) ) + + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_kern( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + FT_ULong table_size; + FT_Byte* p; + FT_Byte* p_limit; + FT_UInt nn, num_tables; + FT_UInt32 avail = 0, ordered = 0; + + + /* the kern table is optional; exit silently if it is missing */ + error = face->goto_table( face, TTAG_kern, stream, &table_size ); + if ( error ) + goto Exit; + + if ( table_size < 4 ) /* the case of a malformed table */ + { + FT_ERROR(( "kerning table is too small - ignored\n" )); + error = SFNT_Err_Table_Missing; + goto Exit; + } + + if ( FT_FRAME_EXTRACT( table_size, face->kern_table ) ) + { + FT_ERROR(( "could not extract kerning table\n" )); + goto Exit; + } + + face->kern_table_size = table_size; + + p = face->kern_table; + p_limit = p + table_size; + + p += 2; /* skip version */ + num_tables = FT_NEXT_USHORT( p ); + + if ( num_tables > 32 ) /* we only support up to 32 sub-tables */ + num_tables = 32; + + for ( nn = 0; nn < num_tables; nn++ ) + { + FT_UInt num_pairs, length, coverage; + FT_Byte* p_next; + FT_UInt32 mask = 1UL << nn; + + + if ( p + 6 > p_limit ) + break; + + p_next = p; + + p += 2; /* skip version */ + length = FT_NEXT_USHORT( p ); + coverage = FT_NEXT_USHORT( p ); + + if ( length <= 6 ) + break; + + p_next += length; + + /* only use horizontal kerning tables */ + if ( ( coverage & ~8 ) != 0x0001 || + p + 8 > p_limit ) + goto NextTable; + + num_pairs = FT_NEXT_USHORT( p ); + p += 6; + + if ( p + 6 * num_pairs > p_limit ) + goto NextTable; + + avail |= mask; + + /* + * Now check whether the pairs in this table are ordered. + * We then can use binary search. + */ + if ( num_pairs > 0 ) + { + FT_UInt count; + FT_UInt old_pair; + + + old_pair = FT_NEXT_ULONG( p ); + p += 2; + + for ( count = num_pairs - 1; count > 0; count-- ) + { + FT_UInt32 cur_pair; + + + cur_pair = FT_NEXT_ULONG( p ); + if ( cur_pair <= old_pair ) + break; + + p += 2; + old_pair = cur_pair; + } + + if ( count == 0 ) + ordered |= mask; + } + + NextTable: + p = p_next; + } + + face->num_kern_tables = nn; + face->kern_avail_bits = avail; + face->kern_order_bits = ordered; + + Exit: + return error; + } + + + FT_LOCAL_DEF( void ) + tt_face_done_kern( TT_Face face ) + { + FT_Stream stream = face->root.stream; + + + FT_FRAME_RELEASE( face->kern_table ); + face->kern_table_size = 0; + face->num_kern_tables = 0; + face->kern_avail_bits = 0; + face->kern_order_bits = 0; + } + + + FT_LOCAL_DEF( FT_Int ) + tt_face_get_kerning( TT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph ) + { + FT_Int result = 0; + FT_UInt count, mask = 1; + FT_Byte* p = face->kern_table; + + + p += 4; + mask = 0x0001; + + for ( count = face->num_kern_tables; count > 0; count--, mask <<= 1 ) + { + FT_Byte* base = p; + FT_Byte* next = base; + FT_UInt version = FT_NEXT_USHORT( p ); + FT_UInt length = FT_NEXT_USHORT( p ); + FT_UInt coverage = FT_NEXT_USHORT( p ); + FT_Int value = 0; + + FT_UNUSED( version ); + + + next = base + length; + + if ( ( face->kern_avail_bits & mask ) == 0 ) + goto NextTable; + + if ( p + 8 > next ) + goto NextTable; + + switch ( coverage >> 8 ) + { + case 0: + { + FT_UInt num_pairs = FT_NEXT_USHORT( p ); + FT_ULong key0 = TT_KERN_INDEX( left_glyph, right_glyph ); + + + p += 6; + + if ( face->kern_order_bits & mask ) /* binary search */ + { + FT_UInt min = 0; + FT_UInt max = num_pairs; + + + while ( min < max ) + { + FT_UInt mid = ( min + max ) >> 1; + FT_Byte* q = p + 6 * mid; + FT_ULong key; + + + key = FT_NEXT_ULONG( q ); + + if ( key == key0 ) + { + value = FT_PEEK_SHORT( q ); + goto Found; + } + if ( key < key0 ) + min = mid + 1; + else + max = mid; + } + } + else /* linear search */ + { + FT_UInt count2; + + + for ( count2 = num_pairs; count2 > 0; count2-- ) + { + FT_ULong key = FT_NEXT_ULONG( p ); + + + if ( key == key0 ) + { + value = FT_PEEK_SHORT( p ); + goto Found; + } + p += 2; + } + } + } + break; + + /* + * We don't support format 2 because we haven't seen a single font + * using it in real life... + */ + + default: + ; + } + + goto NextTable; + + Found: + if ( coverage & 8 ) /* override or add */ + result = value; + else + result += value; + + NextTable: + p = next; + } + + return result; + } + +#undef TT_KERN_INDEX + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.h b/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.h index df1da9b273e..f429d53c3c1 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttkern.h @@ -1,52 +1,52 @@ -/***************************************************************************/ -/* */ -/* ttkern.h */ -/* */ -/* Load the basic TrueType kerning table. This doesn't handle */ -/* kerning data within the GPOS table at the moment. */ -/* */ -/* Copyright 1996-2001, 2002, 2005, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTKERN_H__ -#define __TTKERN_H__ - - -#include -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_TRUETYPE_TYPES_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - tt_face_load_kern( TT_Face face, - FT_Stream stream ); - - FT_LOCAL( void ) - tt_face_done_kern( TT_Face face ); - - FT_LOCAL( FT_Int ) - tt_face_get_kerning( TT_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph ); - -#define TT_FACE_HAS_KERNING( face ) ( (face)->kern_avail_bits != 0 ) - - -FT_END_HEADER - -#endif /* __TTKERN_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttkern.h */ +/* */ +/* Load the basic TrueType kerning table. This doesn't handle */ +/* kerning data within the GPOS table at the moment. */ +/* */ +/* Copyright 1996-2001, 2002, 2005, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTKERN_H__ +#define __TTKERN_H__ + + +#include +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + tt_face_load_kern( TT_Face face, + FT_Stream stream ); + + FT_LOCAL( void ) + tt_face_done_kern( TT_Face face ); + + FT_LOCAL( FT_Int ) + tt_face_get_kerning( TT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph ); + +#define TT_FACE_HAS_KERNING( face ) ( (face)->kern_avail_bits != 0 ) + + +FT_END_HEADER + +#endif /* __TTKERN_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttload.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttload.c index abe0278a253..b52919feed6 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttload.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttload.c @@ -1,1176 +1,1176 @@ -/***************************************************************************/ -/* */ -/* ttload.c */ -/* */ -/* Load the basic TrueType tables, i.e., tables that can be either in */ -/* TTF or OTF fonts (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include "ttload.h" - -#include "sferrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttload - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_lookup_table */ - /* */ - /* */ - /* Looks for a TrueType table by name. */ - /* */ - /* */ - /* face :: A face object handle. */ - /* */ - /* tag :: The searched tag. */ - /* */ - /* */ - /* A pointer to the table directory entry. 0 if not found. */ - /* */ - FT_LOCAL_DEF( TT_Table ) - tt_face_lookup_table( TT_Face face, - FT_ULong tag ) - { - TT_Table entry; - TT_Table limit; - - - FT_TRACE4(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ", - face, - (FT_Char)( tag >> 24 ), - (FT_Char)( tag >> 16 ), - (FT_Char)( tag >> 8 ), - (FT_Char)( tag ) )); - - entry = face->dir_tables; - limit = entry + face->num_tables; - - for ( ; entry < limit; entry++ ) - { - /* For compatibility with Windows, we consider 0-length */ - /* tables the same as missing tables. */ - if ( entry->Tag == tag && entry->Length != 0 ) - { - FT_TRACE4(( "found table.\n" )); - return entry; - } - } - - FT_TRACE4(( "could not find table!\n" )); - return 0; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_goto_table */ - /* */ - /* */ - /* Looks for a TrueType table by name, then seek a stream to it. */ - /* */ - /* */ - /* face :: A face object handle. */ - /* */ - /* tag :: The searched tag. */ - /* */ - /* stream :: The stream to seek when the table is found. */ - /* */ - /* */ - /* length :: The length of the table if found, undefined otherwise. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_goto_table( TT_Face face, - FT_ULong tag, - FT_Stream stream, - FT_ULong* length ) - { - TT_Table table; - FT_Error error; - - - table = tt_face_lookup_table( face, tag ); - if ( table ) - { - if ( length ) - *length = table->Length; - - if ( FT_STREAM_SEEK( table->Offset ) ) - goto Exit; - } - else - error = SFNT_Err_Table_Missing; - - Exit: - return error; - } - - - /* Here, we */ - /* */ - /* - check that `num_tables' is valid */ - /* - look for a `head' table, check its size, and parse it to check */ - /* whether its `magic' field is correctly set */ - /* */ - /* When checking directory entries, ignore the tables `glyx' and `locx' */ - /* which are hacked-out versions of `glyf' and `loca' in some PostScript */ - /* Type 42 fonts, and which are generally invalid. */ - /* */ - static FT_Error - check_table_dir( SFNT_Header sfnt, - FT_Stream stream ) - { - FT_Error error; - FT_UInt nn; - FT_UInt has_head = 0, has_sing = 0, has_meta = 0; - FT_ULong offset = sfnt->offset + 12; - - const FT_ULong glyx_tag = FT_MAKE_TAG( 'g', 'l', 'y', 'x' ); - const FT_ULong locx_tag = FT_MAKE_TAG( 'l', 'o', 'c', 'x' ); - - static const FT_Frame_Field table_dir_entry_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_TableRec - - FT_FRAME_START( 16 ), - FT_FRAME_ULONG( Tag ), - FT_FRAME_ULONG( CheckSum ), - FT_FRAME_ULONG( Offset ), - FT_FRAME_ULONG( Length ), - FT_FRAME_END - }; - - - if ( sfnt->num_tables == 0 || - offset + sfnt->num_tables * 16 > stream->size ) - return SFNT_Err_Unknown_File_Format; - - if ( FT_STREAM_SEEK( offset ) ) - return error; - - for ( nn = 0; nn < sfnt->num_tables; nn++ ) - { - TT_TableRec table; - - - if ( FT_STREAM_READ_FIELDS( table_dir_entry_fields, &table ) ) - return error; - - if ( table.Offset + table.Length > stream->size && - table.Tag != glyx_tag && - table.Tag != locx_tag ) - return SFNT_Err_Unknown_File_Format; - - if ( table.Tag == TTAG_head || table.Tag == TTAG_bhed ) - { - FT_UInt32 magic; - - -#ifndef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - if ( table.Tag == TTAG_head ) -#endif - has_head = 1; - - /* - * The table length should be 0x36, but certain font tools make it - * 0x38, so we will just check that it is greater. - * - * Note that according to the specification, the table must be - * padded to 32-bit lengths, but this doesn't apply to the value of - * its `Length' field! - * - */ - if ( table.Length < 0x36 ) - return SFNT_Err_Unknown_File_Format; - - if ( FT_STREAM_SEEK( table.Offset + 12 ) || - FT_READ_ULONG( magic ) ) - return error; - - if ( magic != 0x5F0F3CF5UL ) - return SFNT_Err_Unknown_File_Format; - - if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) ) - return error; - } - else if ( table.Tag == TTAG_SING ) - has_sing = 1; - else if ( table.Tag == TTAG_META ) - has_meta = 1; - } - - /* if `sing' and `meta' tables are present, there is no `head' table */ - if ( has_head || ( has_sing && has_meta ) ) - return SFNT_Err_Ok; - else - return SFNT_Err_Unknown_File_Format; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_font_dir */ - /* */ - /* */ - /* Loads the header of a SFNT font file. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* sfnt :: The SFNT header. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* The stream cursor must be at the beginning of the font directory. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_font_dir( TT_Face face, - FT_Stream stream ) - { - SFNT_HeaderRec sfnt; - FT_Error error; - FT_Memory memory = stream->memory; - TT_TableRec* entry; - TT_TableRec* limit; - - static const FT_Frame_Field offset_table_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE SFNT_HeaderRec - - FT_FRAME_START( 8 ), - FT_FRAME_USHORT( num_tables ), - FT_FRAME_USHORT( search_range ), - FT_FRAME_USHORT( entry_selector ), - FT_FRAME_USHORT( range_shift ), - FT_FRAME_END - }; - - - FT_TRACE2(( "tt_face_load_font_dir: %08p\n", face )); - - /* read the offset table */ - - sfnt.offset = FT_STREAM_POS(); - - if ( FT_READ_ULONG( sfnt.format_tag ) || - FT_STREAM_READ_FIELDS( offset_table_fields, &sfnt ) ) - return error; - - /* many fonts don't have these fields set correctly */ -#if 0 - if ( sfnt.search_range != 1 << ( sfnt.entry_selector + 4 ) || - sfnt.search_range + sfnt.range_shift != sfnt.num_tables << 4 ) - return SFNT_Err_Unknown_File_Format; -#endif - - /* load the table directory */ - - FT_TRACE2(( "-- Tables count: %12u\n", sfnt.num_tables )); - FT_TRACE2(( "-- Format version: %08lx\n", sfnt.format_tag )); - - /* check first */ - error = check_table_dir( &sfnt, stream ); - if ( error ) - { - FT_TRACE2(( "tt_face_load_font_dir: invalid table directory!\n" )); - - return error; - } - - face->num_tables = sfnt.num_tables; - face->format_tag = sfnt.format_tag; - - if ( FT_QNEW_ARRAY( face->dir_tables, face->num_tables ) ) - return error; - - if ( FT_STREAM_SEEK( sfnt.offset + 12 ) || - FT_FRAME_ENTER( face->num_tables * 16L ) ) - return error; - - entry = face->dir_tables; - limit = entry + face->num_tables; - - for ( ; entry < limit; entry++ ) - { - entry->Tag = FT_GET_TAG4(); - entry->CheckSum = FT_GET_ULONG(); - entry->Offset = FT_GET_LONG(); - entry->Length = FT_GET_LONG(); - - FT_TRACE2(( " %c%c%c%c - %08lx - %08lx\n", - (FT_Char)( entry->Tag >> 24 ), - (FT_Char)( entry->Tag >> 16 ), - (FT_Char)( entry->Tag >> 8 ), - (FT_Char)( entry->Tag ), - entry->Offset, - entry->Length )); - } - - FT_FRAME_EXIT(); - - FT_TRACE2(( "table directory loaded\n\n" )); - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_any */ - /* */ - /* */ - /* Loads any font table into client memory. */ - /* */ - /* */ - /* face :: The face object to look for. */ - /* */ - /* tag :: The tag of table to load. Use the value 0 if you want */ - /* to access the whole font file, else set this parameter */ - /* to a valid TrueType table tag that you can forge with */ - /* the MAKE_TT_TAG macro. */ - /* */ - /* offset :: The starting offset in the table (or the file if */ - /* tag == 0). */ - /* */ - /* length :: The address of the decision variable: */ - /* */ - /* If length == NULL: */ - /* Loads the whole table. Returns an error if */ - /* `offset' == 0! */ - /* */ - /* If *length == 0: */ - /* Exits immediately; returning the length of the given */ - /* table or of the font file, depending on the value of */ - /* `tag'. */ - /* */ - /* If *length != 0: */ - /* Loads the next `length' bytes of table or font, */ - /* starting at offset `offset' (in table or font too). */ - /* */ - /* */ - /* buffer :: The address of target buffer. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_any( TT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ) - { - FT_Error error; - FT_Stream stream; - TT_Table table; - FT_ULong size; - - - if ( tag != 0 ) - { - /* look for tag in font directory */ - table = tt_face_lookup_table( face, tag ); - if ( !table ) - { - error = SFNT_Err_Table_Missing; - goto Exit; - } - - offset += table->Offset; - size = table->Length; - } - else - /* tag == 0 -- the user wants to access the font file directly */ - size = face->root.stream->size; - - if ( length && *length == 0 ) - { - *length = size; - - return SFNT_Err_Ok; - } - - if ( length ) - size = *length; - - stream = face->root.stream; - /* the `if' is syntactic sugar for picky compilers */ - if ( FT_STREAM_READ_AT( offset, buffer, size ) ) - goto Exit; - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_generic_header */ - /* */ - /* */ - /* Loads the TrueType table `head' or `bhed'. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - tt_face_load_generic_header( TT_Face face, - FT_Stream stream, - FT_ULong tag ) - { - FT_Error error; - TT_Header* header; - - static const FT_Frame_Field header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_Header - - FT_FRAME_START( 54 ), - FT_FRAME_ULONG ( Table_Version ), - FT_FRAME_ULONG ( Font_Revision ), - FT_FRAME_LONG ( CheckSum_Adjust ), - FT_FRAME_LONG ( Magic_Number ), - FT_FRAME_USHORT( Flags ), - FT_FRAME_USHORT( Units_Per_EM ), - FT_FRAME_LONG ( Created[0] ), - FT_FRAME_LONG ( Created[1] ), - FT_FRAME_LONG ( Modified[0] ), - FT_FRAME_LONG ( Modified[1] ), - FT_FRAME_SHORT ( xMin ), - FT_FRAME_SHORT ( yMin ), - FT_FRAME_SHORT ( xMax ), - FT_FRAME_SHORT ( yMax ), - FT_FRAME_USHORT( Mac_Style ), - FT_FRAME_USHORT( Lowest_Rec_PPEM ), - FT_FRAME_SHORT ( Font_Direction ), - FT_FRAME_SHORT ( Index_To_Loc_Format ), - FT_FRAME_SHORT ( Glyph_Data_Format ), - FT_FRAME_END - }; - - - error = face->goto_table( face, tag, stream, 0 ); - if ( error ) - goto Exit; - - header = &face->header; - - if ( FT_STREAM_READ_FIELDS( header_fields, header ) ) - goto Exit; - - FT_TRACE3(( "Units per EM: %4u\n", header->Units_Per_EM )); - FT_TRACE3(( "IndexToLoc: %4d\n", header->Index_To_Loc_Format )); - - Exit: - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_head( TT_Face face, - FT_Stream stream ) - { - return tt_face_load_generic_header( face, stream, TTAG_head ); - } - - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_bhed( TT_Face face, - FT_Stream stream ) - { - return tt_face_load_generic_header( face, stream, TTAG_bhed ); - } - -#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_max_profile */ - /* */ - /* */ - /* Loads the maximum profile into a face object. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_maxp( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - TT_MaxProfile* maxProfile = &face->max_profile; - - const FT_Frame_Field maxp_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_MaxProfile - - FT_FRAME_START( 6 ), - FT_FRAME_LONG ( version ), - FT_FRAME_USHORT( numGlyphs ), - FT_FRAME_END - }; - - const FT_Frame_Field maxp_fields_extra[] = - { - FT_FRAME_START( 26 ), - FT_FRAME_USHORT( maxPoints ), - FT_FRAME_USHORT( maxContours ), - FT_FRAME_USHORT( maxCompositePoints ), - FT_FRAME_USHORT( maxCompositeContours ), - FT_FRAME_USHORT( maxZones ), - FT_FRAME_USHORT( maxTwilightPoints ), - FT_FRAME_USHORT( maxStorage ), - FT_FRAME_USHORT( maxFunctionDefs ), - FT_FRAME_USHORT( maxInstructionDefs ), - FT_FRAME_USHORT( maxStackElements ), - FT_FRAME_USHORT( maxSizeOfInstructions ), - FT_FRAME_USHORT( maxComponentElements ), - FT_FRAME_USHORT( maxComponentDepth ), - FT_FRAME_END - }; - - - error = face->goto_table( face, TTAG_maxp, stream, 0 ); - if ( error ) - goto Exit; - - if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) ) - goto Exit; - - maxProfile->maxPoints = 0; - maxProfile->maxContours = 0; - maxProfile->maxCompositePoints = 0; - maxProfile->maxCompositeContours = 0; - maxProfile->maxZones = 0; - maxProfile->maxTwilightPoints = 0; - maxProfile->maxStorage = 0; - maxProfile->maxFunctionDefs = 0; - maxProfile->maxInstructionDefs = 0; - maxProfile->maxStackElements = 0; - maxProfile->maxSizeOfInstructions = 0; - maxProfile->maxComponentElements = 0; - maxProfile->maxComponentDepth = 0; - - if ( maxProfile->version >= 0x10000L ) - { - if ( FT_STREAM_READ_FIELDS( maxp_fields_extra, maxProfile ) ) - goto Exit; - - /* XXX: an adjustment that is necessary to load certain */ - /* broken fonts like `Keystrokes MT' :-( */ - /* */ - /* We allocate 64 function entries by default when */ - /* the maxFunctionDefs field is null. */ - - if ( maxProfile->maxFunctionDefs == 0 ) - maxProfile->maxFunctionDefs = 64; - } - - FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs )); - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_names */ - /* */ - /* */ - /* Loads the name records. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_name( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - FT_Memory memory = stream->memory; - FT_ULong table_pos, table_len; - FT_ULong storage_start, storage_limit; - FT_UInt count; - TT_NameTable table; - - static const FT_Frame_Field name_table_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_NameTableRec - - FT_FRAME_START( 6 ), - FT_FRAME_USHORT( format ), - FT_FRAME_USHORT( numNameRecords ), - FT_FRAME_USHORT( storageOffset ), - FT_FRAME_END - }; - - static const FT_Frame_Field name_record_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_NameEntryRec - - /* no FT_FRAME_START */ - FT_FRAME_USHORT( platformID ), - FT_FRAME_USHORT( encodingID ), - FT_FRAME_USHORT( languageID ), - FT_FRAME_USHORT( nameID ), - FT_FRAME_USHORT( stringLength ), - FT_FRAME_USHORT( stringOffset ), - FT_FRAME_END - }; - - - table = &face->name_table; - table->stream = stream; - - error = face->goto_table( face, TTAG_name, stream, &table_len ); - if ( error ) - goto Exit; - - table_pos = FT_STREAM_POS(); - - - if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) ) - goto Exit; - - /* Some popular Asian fonts have an invalid `storageOffset' value */ - /* (it should be at least "6 + 12*num_names"). However, the string */ - /* offsets, computed as "storageOffset + entry->stringOffset", are */ - /* valid pointers within the name table... */ - /* */ - /* We thus can't check `storageOffset' right now. */ - /* */ - storage_start = table_pos + 6 + 12*table->numNameRecords; - storage_limit = table_pos + table_len; - - if ( storage_start > storage_limit ) - { - FT_ERROR(( "invalid `name' table\n" )); - error = SFNT_Err_Name_Table_Missing; - goto Exit; - } - - /* Allocate the array of name records. */ - count = table->numNameRecords; - table->numNameRecords = 0; - - if ( FT_NEW_ARRAY( table->names, count ) || - FT_FRAME_ENTER( count * 12 ) ) - goto Exit; - - /* Load the name records and determine how much storage is needed */ - /* to hold the strings themselves. */ - { - TT_NameEntryRec* entry = table->names; - - - for ( ; count > 0; count-- ) - { - if ( FT_STREAM_READ_FIELDS( name_record_fields, entry ) ) - continue; - - /* check that the name is not empty */ - if ( entry->stringLength == 0 ) - continue; - - /* check that the name string is within the table */ - entry->stringOffset += table_pos + table->storageOffset; - if ( entry->stringOffset < storage_start || - entry->stringOffset + entry->stringLength > storage_limit ) - { - /* invalid entry - ignore it */ - entry->stringOffset = 0; - entry->stringLength = 0; - continue; - } - - entry++; - } - - table->numNameRecords = (FT_UInt)( entry - table->names ); - } - - FT_FRAME_EXIT(); - - /* everything went well, update face->num_names */ - face->num_names = (FT_UShort) table->numNameRecords; - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_free_names */ - /* */ - /* */ - /* Frees the name records. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - FT_LOCAL_DEF( void ) - tt_face_free_name( TT_Face face ) - { - FT_Memory memory = face->root.driver->root.memory; - TT_NameTable table = &face->name_table; - TT_NameEntry entry = table->names; - FT_UInt count = table->numNameRecords; - - - if ( table->names ) - { - for ( ; count > 0; count--, entry++ ) - { - FT_FREE( entry->string ); - entry->stringLength = 0; - } - - /* free strings table */ - FT_FREE( table->names ); - } - - table->numNameRecords = 0; - table->format = 0; - table->storageOffset = 0; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_cmap */ - /* */ - /* */ - /* Loads the cmap directory in a face object. The cmaps themselves */ - /* are loaded on demand in the `ttcmap.c' module. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_cmap( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - - - error = face->goto_table( face, TTAG_cmap, stream, &face->cmap_size ); - if ( error ) - goto Exit; - - if ( FT_FRAME_EXTRACT( face->cmap_size, face->cmap_table ) ) - face->cmap_size = 0; - - Exit: - return error; - } - - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_os2 */ - /* */ - /* */ - /* Loads the OS2 table. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_os2( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - TT_OS2* os2; - - const FT_Frame_Field os2_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_OS2 - - FT_FRAME_START( 78 ), - FT_FRAME_USHORT( version ), - FT_FRAME_SHORT ( xAvgCharWidth ), - FT_FRAME_USHORT( usWeightClass ), - FT_FRAME_USHORT( usWidthClass ), - FT_FRAME_SHORT ( fsType ), - FT_FRAME_SHORT ( ySubscriptXSize ), - FT_FRAME_SHORT ( ySubscriptYSize ), - FT_FRAME_SHORT ( ySubscriptXOffset ), - FT_FRAME_SHORT ( ySubscriptYOffset ), - FT_FRAME_SHORT ( ySuperscriptXSize ), - FT_FRAME_SHORT ( ySuperscriptYSize ), - FT_FRAME_SHORT ( ySuperscriptXOffset ), - FT_FRAME_SHORT ( ySuperscriptYOffset ), - FT_FRAME_SHORT ( yStrikeoutSize ), - FT_FRAME_SHORT ( yStrikeoutPosition ), - FT_FRAME_SHORT ( sFamilyClass ), - FT_FRAME_BYTE ( panose[0] ), - FT_FRAME_BYTE ( panose[1] ), - FT_FRAME_BYTE ( panose[2] ), - FT_FRAME_BYTE ( panose[3] ), - FT_FRAME_BYTE ( panose[4] ), - FT_FRAME_BYTE ( panose[5] ), - FT_FRAME_BYTE ( panose[6] ), - FT_FRAME_BYTE ( panose[7] ), - FT_FRAME_BYTE ( panose[8] ), - FT_FRAME_BYTE ( panose[9] ), - FT_FRAME_ULONG ( ulUnicodeRange1 ), - FT_FRAME_ULONG ( ulUnicodeRange2 ), - FT_FRAME_ULONG ( ulUnicodeRange3 ), - FT_FRAME_ULONG ( ulUnicodeRange4 ), - FT_FRAME_BYTE ( achVendID[0] ), - FT_FRAME_BYTE ( achVendID[1] ), - FT_FRAME_BYTE ( achVendID[2] ), - FT_FRAME_BYTE ( achVendID[3] ), - - FT_FRAME_USHORT( fsSelection ), - FT_FRAME_USHORT( usFirstCharIndex ), - FT_FRAME_USHORT( usLastCharIndex ), - FT_FRAME_SHORT ( sTypoAscender ), - FT_FRAME_SHORT ( sTypoDescender ), - FT_FRAME_SHORT ( sTypoLineGap ), - FT_FRAME_USHORT( usWinAscent ), - FT_FRAME_USHORT( usWinDescent ), - FT_FRAME_END - }; - - const FT_Frame_Field os2_fields_extra[] = - { - FT_FRAME_START( 8 ), - FT_FRAME_ULONG( ulCodePageRange1 ), - FT_FRAME_ULONG( ulCodePageRange2 ), - FT_FRAME_END - }; - - const FT_Frame_Field os2_fields_extra2[] = - { - FT_FRAME_START( 10 ), - FT_FRAME_SHORT ( sxHeight ), - FT_FRAME_SHORT ( sCapHeight ), - FT_FRAME_USHORT( usDefaultChar ), - FT_FRAME_USHORT( usBreakChar ), - FT_FRAME_USHORT( usMaxContext ), - FT_FRAME_END - }; - - - /* We now support old Mac fonts where the OS/2 table doesn't */ - /* exist. Simply put, we set the `version' field to 0xFFFF */ - /* and test this value each time we need to access the table. */ - error = face->goto_table( face, TTAG_OS2, stream, 0 ); - if ( error ) - goto Exit; - - os2 = &face->os2; - - if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) ) - goto Exit; - - os2->ulCodePageRange1 = 0; - os2->ulCodePageRange2 = 0; - os2->sxHeight = 0; - os2->sCapHeight = 0; - os2->usDefaultChar = 0; - os2->usBreakChar = 0; - os2->usMaxContext = 0; - - if ( os2->version >= 0x0001 ) - { - /* only version 1 tables */ - if ( FT_STREAM_READ_FIELDS( os2_fields_extra, os2 ) ) - goto Exit; - - if ( os2->version >= 0x0002 ) - { - /* only version 2 tables */ - if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) ) - goto Exit; - } - } - - FT_TRACE3(( "sTypoAscender: %4d\n", os2->sTypoAscender )); - FT_TRACE3(( "sTypoDescender: %4d\n", os2->sTypoDescender )); - FT_TRACE3(( "usWinAscent: %4u\n", os2->usWinAscent )); - FT_TRACE3(( "usWinDescent: %4u\n", os2->usWinDescent )); - FT_TRACE3(( "fsSelection: 0x%2x\n", os2->fsSelection )); - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_postscript */ - /* */ - /* */ - /* Loads the Postscript table. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_post( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - TT_Postscript* post = &face->postscript; - - static const FT_Frame_Field post_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_Postscript - - FT_FRAME_START( 32 ), - FT_FRAME_ULONG( FormatType ), - FT_FRAME_ULONG( italicAngle ), - FT_FRAME_SHORT( underlinePosition ), - FT_FRAME_SHORT( underlineThickness ), - FT_FRAME_ULONG( isFixedPitch ), - FT_FRAME_ULONG( minMemType42 ), - FT_FRAME_ULONG( maxMemType42 ), - FT_FRAME_ULONG( minMemType1 ), - FT_FRAME_ULONG( maxMemType1 ), - FT_FRAME_END - }; - - - error = face->goto_table( face, TTAG_post, stream, 0 ); - if ( error ) - return error; - - if ( FT_STREAM_READ_FIELDS( post_fields, post ) ) - return error; - - /* we don't load the glyph names, we do that in another */ - /* module (ttpost). */ - - FT_TRACE3(( "FormatType: 0x%x\n", post->FormatType )); - FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch - ? " yes" : " no" )); - - return SFNT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_pclt */ - /* */ - /* */ - /* Loads the PCL 5 Table. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_pclt( TT_Face face, - FT_Stream stream ) - { - static const FT_Frame_Field pclt_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_PCLT - - FT_FRAME_START( 54 ), - FT_FRAME_ULONG ( Version ), - FT_FRAME_ULONG ( FontNumber ), - FT_FRAME_USHORT( Pitch ), - FT_FRAME_USHORT( xHeight ), - FT_FRAME_USHORT( Style ), - FT_FRAME_USHORT( TypeFamily ), - FT_FRAME_USHORT( CapHeight ), - FT_FRAME_BYTES ( TypeFace, 16 ), - FT_FRAME_BYTES ( CharacterComplement, 8 ), - FT_FRAME_BYTES ( FileName, 6 ), - FT_FRAME_CHAR ( StrokeWeight ), - FT_FRAME_CHAR ( WidthType ), - FT_FRAME_BYTE ( SerifStyle ), - FT_FRAME_BYTE ( Reserved ), - FT_FRAME_END - }; - - FT_Error error; - TT_PCLT* pclt = &face->pclt; - - - /* optional table */ - error = face->goto_table( face, TTAG_PCLT, stream, 0 ); - if ( error ) - goto Exit; - - if ( FT_STREAM_READ_FIELDS( pclt_fields, pclt ) ) - goto Exit; - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_gasp */ - /* */ - /* */ - /* Loads the `gasp' table into a face object. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_gasp( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - FT_Memory memory = stream->memory; - - FT_UInt j,num_ranges; - TT_GaspRange gaspranges; - - - /* the gasp table is optional */ - error = face->goto_table( face, TTAG_gasp, stream, 0 ); - if ( error ) - goto Exit; - - if ( FT_FRAME_ENTER( 4L ) ) - goto Exit; - - face->gasp.version = FT_GET_USHORT(); - face->gasp.numRanges = FT_GET_USHORT(); - - FT_FRAME_EXIT(); - - /* only support versions 0 and 1 of the table */ - if ( face->gasp.version >= 2 ) - { - face->gasp.numRanges = 0; - error = SFNT_Err_Invalid_Table; - goto Exit; - } - - num_ranges = face->gasp.numRanges; - FT_TRACE3(( "numRanges: %u\n", num_ranges )); - - if ( FT_QNEW_ARRAY( gaspranges, num_ranges ) || - FT_FRAME_ENTER( num_ranges * 4L ) ) - goto Exit; - - face->gasp.gaspRanges = gaspranges; - - for ( j = 0; j < num_ranges; j++ ) - { - gaspranges[j].maxPPEM = FT_GET_USHORT(); - gaspranges[j].gaspFlag = FT_GET_USHORT(); - - FT_TRACE3(( "gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\n", - j, - gaspranges[j].maxPPEM, - gaspranges[j].gaspFlag )); - } - - FT_FRAME_EXIT(); - - Exit: - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* ttload.c */ +/* */ +/* Load the basic TrueType tables, i.e., tables that can be either in */ +/* TTF or OTF fonts (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H +#include "ttload.h" + +#include "sferrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttload + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_lookup_table */ + /* */ + /* */ + /* Looks for a TrueType table by name. */ + /* */ + /* */ + /* face :: A face object handle. */ + /* */ + /* tag :: The searched tag. */ + /* */ + /* */ + /* A pointer to the table directory entry. 0 if not found. */ + /* */ + FT_LOCAL_DEF( TT_Table ) + tt_face_lookup_table( TT_Face face, + FT_ULong tag ) + { + TT_Table entry; + TT_Table limit; + + + FT_TRACE4(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ", + face, + (FT_Char)( tag >> 24 ), + (FT_Char)( tag >> 16 ), + (FT_Char)( tag >> 8 ), + (FT_Char)( tag ) )); + + entry = face->dir_tables; + limit = entry + face->num_tables; + + for ( ; entry < limit; entry++ ) + { + /* For compatibility with Windows, we consider 0-length */ + /* tables the same as missing tables. */ + if ( entry->Tag == tag && entry->Length != 0 ) + { + FT_TRACE4(( "found table.\n" )); + return entry; + } + } + + FT_TRACE4(( "could not find table!\n" )); + return 0; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_goto_table */ + /* */ + /* */ + /* Looks for a TrueType table by name, then seek a stream to it. */ + /* */ + /* */ + /* face :: A face object handle. */ + /* */ + /* tag :: The searched tag. */ + /* */ + /* stream :: The stream to seek when the table is found. */ + /* */ + /* */ + /* length :: The length of the table if found, undefined otherwise. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_goto_table( TT_Face face, + FT_ULong tag, + FT_Stream stream, + FT_ULong* length ) + { + TT_Table table; + FT_Error error; + + + table = tt_face_lookup_table( face, tag ); + if ( table ) + { + if ( length ) + *length = table->Length; + + if ( FT_STREAM_SEEK( table->Offset ) ) + goto Exit; + } + else + error = SFNT_Err_Table_Missing; + + Exit: + return error; + } + + + /* Here, we */ + /* */ + /* - check that `num_tables' is valid */ + /* - look for a `head' table, check its size, and parse it to check */ + /* whether its `magic' field is correctly set */ + /* */ + /* When checking directory entries, ignore the tables `glyx' and `locx' */ + /* which are hacked-out versions of `glyf' and `loca' in some PostScript */ + /* Type 42 fonts, and which are generally invalid. */ + /* */ + static FT_Error + check_table_dir( SFNT_Header sfnt, + FT_Stream stream ) + { + FT_Error error; + FT_UInt nn; + FT_UInt has_head = 0, has_sing = 0, has_meta = 0; + FT_ULong offset = sfnt->offset + 12; + + const FT_ULong glyx_tag = FT_MAKE_TAG( 'g', 'l', 'y', 'x' ); + const FT_ULong locx_tag = FT_MAKE_TAG( 'l', 'o', 'c', 'x' ); + + static const FT_Frame_Field table_dir_entry_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_TableRec + + FT_FRAME_START( 16 ), + FT_FRAME_ULONG( Tag ), + FT_FRAME_ULONG( CheckSum ), + FT_FRAME_ULONG( Offset ), + FT_FRAME_ULONG( Length ), + FT_FRAME_END + }; + + + if ( sfnt->num_tables == 0 || + offset + sfnt->num_tables * 16 > stream->size ) + return SFNT_Err_Unknown_File_Format; + + if ( FT_STREAM_SEEK( offset ) ) + return error; + + for ( nn = 0; nn < sfnt->num_tables; nn++ ) + { + TT_TableRec table; + + + if ( FT_STREAM_READ_FIELDS( table_dir_entry_fields, &table ) ) + return error; + + if ( table.Offset + table.Length > stream->size && + table.Tag != glyx_tag && + table.Tag != locx_tag ) + return SFNT_Err_Unknown_File_Format; + + if ( table.Tag == TTAG_head || table.Tag == TTAG_bhed ) + { + FT_UInt32 magic; + + +#ifndef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + if ( table.Tag == TTAG_head ) +#endif + has_head = 1; + + /* + * The table length should be 0x36, but certain font tools make it + * 0x38, so we will just check that it is greater. + * + * Note that according to the specification, the table must be + * padded to 32-bit lengths, but this doesn't apply to the value of + * its `Length' field! + * + */ + if ( table.Length < 0x36 ) + return SFNT_Err_Unknown_File_Format; + + if ( FT_STREAM_SEEK( table.Offset + 12 ) || + FT_READ_ULONG( magic ) ) + return error; + + if ( magic != 0x5F0F3CF5UL ) + return SFNT_Err_Unknown_File_Format; + + if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) ) + return error; + } + else if ( table.Tag == TTAG_SING ) + has_sing = 1; + else if ( table.Tag == TTAG_META ) + has_meta = 1; + } + + /* if `sing' and `meta' tables are present, there is no `head' table */ + if ( has_head || ( has_sing && has_meta ) ) + return SFNT_Err_Ok; + else + return SFNT_Err_Unknown_File_Format; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_font_dir */ + /* */ + /* */ + /* Loads the header of a SFNT font file. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* sfnt :: The SFNT header. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* The stream cursor must be at the beginning of the font directory. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_font_dir( TT_Face face, + FT_Stream stream ) + { + SFNT_HeaderRec sfnt; + FT_Error error; + FT_Memory memory = stream->memory; + TT_TableRec* entry; + TT_TableRec* limit; + + static const FT_Frame_Field offset_table_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE SFNT_HeaderRec + + FT_FRAME_START( 8 ), + FT_FRAME_USHORT( num_tables ), + FT_FRAME_USHORT( search_range ), + FT_FRAME_USHORT( entry_selector ), + FT_FRAME_USHORT( range_shift ), + FT_FRAME_END + }; + + + FT_TRACE2(( "tt_face_load_font_dir: %08p\n", face )); + + /* read the offset table */ + + sfnt.offset = FT_STREAM_POS(); + + if ( FT_READ_ULONG( sfnt.format_tag ) || + FT_STREAM_READ_FIELDS( offset_table_fields, &sfnt ) ) + return error; + + /* many fonts don't have these fields set correctly */ +#if 0 + if ( sfnt.search_range != 1 << ( sfnt.entry_selector + 4 ) || + sfnt.search_range + sfnt.range_shift != sfnt.num_tables << 4 ) + return SFNT_Err_Unknown_File_Format; +#endif + + /* load the table directory */ + + FT_TRACE2(( "-- Tables count: %12u\n", sfnt.num_tables )); + FT_TRACE2(( "-- Format version: %08lx\n", sfnt.format_tag )); + + /* check first */ + error = check_table_dir( &sfnt, stream ); + if ( error ) + { + FT_TRACE2(( "tt_face_load_font_dir: invalid table directory!\n" )); + + return error; + } + + face->num_tables = sfnt.num_tables; + face->format_tag = sfnt.format_tag; + + if ( FT_QNEW_ARRAY( face->dir_tables, face->num_tables ) ) + return error; + + if ( FT_STREAM_SEEK( sfnt.offset + 12 ) || + FT_FRAME_ENTER( face->num_tables * 16L ) ) + return error; + + entry = face->dir_tables; + limit = entry + face->num_tables; + + for ( ; entry < limit; entry++ ) + { + entry->Tag = FT_GET_TAG4(); + entry->CheckSum = FT_GET_ULONG(); + entry->Offset = FT_GET_LONG(); + entry->Length = FT_GET_LONG(); + + FT_TRACE2(( " %c%c%c%c - %08lx - %08lx\n", + (FT_Char)( entry->Tag >> 24 ), + (FT_Char)( entry->Tag >> 16 ), + (FT_Char)( entry->Tag >> 8 ), + (FT_Char)( entry->Tag ), + entry->Offset, + entry->Length )); + } + + FT_FRAME_EXIT(); + + FT_TRACE2(( "table directory loaded\n\n" )); + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_any */ + /* */ + /* */ + /* Loads any font table into client memory. */ + /* */ + /* */ + /* face :: The face object to look for. */ + /* */ + /* tag :: The tag of table to load. Use the value 0 if you want */ + /* to access the whole font file, else set this parameter */ + /* to a valid TrueType table tag that you can forge with */ + /* the MAKE_TT_TAG macro. */ + /* */ + /* offset :: The starting offset in the table (or the file if */ + /* tag == 0). */ + /* */ + /* length :: The address of the decision variable: */ + /* */ + /* If length == NULL: */ + /* Loads the whole table. Returns an error if */ + /* `offset' == 0! */ + /* */ + /* If *length == 0: */ + /* Exits immediately; returning the length of the given */ + /* table or of the font file, depending on the value of */ + /* `tag'. */ + /* */ + /* If *length != 0: */ + /* Loads the next `length' bytes of table or font, */ + /* starting at offset `offset' (in table or font too). */ + /* */ + /* */ + /* buffer :: The address of target buffer. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_any( TT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ) + { + FT_Error error; + FT_Stream stream; + TT_Table table; + FT_ULong size; + + + if ( tag != 0 ) + { + /* look for tag in font directory */ + table = tt_face_lookup_table( face, tag ); + if ( !table ) + { + error = SFNT_Err_Table_Missing; + goto Exit; + } + + offset += table->Offset; + size = table->Length; + } + else + /* tag == 0 -- the user wants to access the font file directly */ + size = face->root.stream->size; + + if ( length && *length == 0 ) + { + *length = size; + + return SFNT_Err_Ok; + } + + if ( length ) + size = *length; + + stream = face->root.stream; + /* the `if' is syntactic sugar for picky compilers */ + if ( FT_STREAM_READ_AT( offset, buffer, size ) ) + goto Exit; + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_generic_header */ + /* */ + /* */ + /* Loads the TrueType table `head' or `bhed'. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + tt_face_load_generic_header( TT_Face face, + FT_Stream stream, + FT_ULong tag ) + { + FT_Error error; + TT_Header* header; + + static const FT_Frame_Field header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_Header + + FT_FRAME_START( 54 ), + FT_FRAME_ULONG ( Table_Version ), + FT_FRAME_ULONG ( Font_Revision ), + FT_FRAME_LONG ( CheckSum_Adjust ), + FT_FRAME_LONG ( Magic_Number ), + FT_FRAME_USHORT( Flags ), + FT_FRAME_USHORT( Units_Per_EM ), + FT_FRAME_LONG ( Created[0] ), + FT_FRAME_LONG ( Created[1] ), + FT_FRAME_LONG ( Modified[0] ), + FT_FRAME_LONG ( Modified[1] ), + FT_FRAME_SHORT ( xMin ), + FT_FRAME_SHORT ( yMin ), + FT_FRAME_SHORT ( xMax ), + FT_FRAME_SHORT ( yMax ), + FT_FRAME_USHORT( Mac_Style ), + FT_FRAME_USHORT( Lowest_Rec_PPEM ), + FT_FRAME_SHORT ( Font_Direction ), + FT_FRAME_SHORT ( Index_To_Loc_Format ), + FT_FRAME_SHORT ( Glyph_Data_Format ), + FT_FRAME_END + }; + + + error = face->goto_table( face, tag, stream, 0 ); + if ( error ) + goto Exit; + + header = &face->header; + + if ( FT_STREAM_READ_FIELDS( header_fields, header ) ) + goto Exit; + + FT_TRACE3(( "Units per EM: %4u\n", header->Units_Per_EM )); + FT_TRACE3(( "IndexToLoc: %4d\n", header->Index_To_Loc_Format )); + + Exit: + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_head( TT_Face face, + FT_Stream stream ) + { + return tt_face_load_generic_header( face, stream, TTAG_head ); + } + + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_bhed( TT_Face face, + FT_Stream stream ) + { + return tt_face_load_generic_header( face, stream, TTAG_bhed ); + } + +#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_max_profile */ + /* */ + /* */ + /* Loads the maximum profile into a face object. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_maxp( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + TT_MaxProfile* maxProfile = &face->max_profile; + + const FT_Frame_Field maxp_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_MaxProfile + + FT_FRAME_START( 6 ), + FT_FRAME_LONG ( version ), + FT_FRAME_USHORT( numGlyphs ), + FT_FRAME_END + }; + + const FT_Frame_Field maxp_fields_extra[] = + { + FT_FRAME_START( 26 ), + FT_FRAME_USHORT( maxPoints ), + FT_FRAME_USHORT( maxContours ), + FT_FRAME_USHORT( maxCompositePoints ), + FT_FRAME_USHORT( maxCompositeContours ), + FT_FRAME_USHORT( maxZones ), + FT_FRAME_USHORT( maxTwilightPoints ), + FT_FRAME_USHORT( maxStorage ), + FT_FRAME_USHORT( maxFunctionDefs ), + FT_FRAME_USHORT( maxInstructionDefs ), + FT_FRAME_USHORT( maxStackElements ), + FT_FRAME_USHORT( maxSizeOfInstructions ), + FT_FRAME_USHORT( maxComponentElements ), + FT_FRAME_USHORT( maxComponentDepth ), + FT_FRAME_END + }; + + + error = face->goto_table( face, TTAG_maxp, stream, 0 ); + if ( error ) + goto Exit; + + if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) ) + goto Exit; + + maxProfile->maxPoints = 0; + maxProfile->maxContours = 0; + maxProfile->maxCompositePoints = 0; + maxProfile->maxCompositeContours = 0; + maxProfile->maxZones = 0; + maxProfile->maxTwilightPoints = 0; + maxProfile->maxStorage = 0; + maxProfile->maxFunctionDefs = 0; + maxProfile->maxInstructionDefs = 0; + maxProfile->maxStackElements = 0; + maxProfile->maxSizeOfInstructions = 0; + maxProfile->maxComponentElements = 0; + maxProfile->maxComponentDepth = 0; + + if ( maxProfile->version >= 0x10000L ) + { + if ( FT_STREAM_READ_FIELDS( maxp_fields_extra, maxProfile ) ) + goto Exit; + + /* XXX: an adjustment that is necessary to load certain */ + /* broken fonts like `Keystrokes MT' :-( */ + /* */ + /* We allocate 64 function entries by default when */ + /* the maxFunctionDefs field is null. */ + + if ( maxProfile->maxFunctionDefs == 0 ) + maxProfile->maxFunctionDefs = 64; + } + + FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs )); + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_names */ + /* */ + /* */ + /* Loads the name records. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_name( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + FT_Memory memory = stream->memory; + FT_ULong table_pos, table_len; + FT_ULong storage_start, storage_limit; + FT_UInt count; + TT_NameTable table; + + static const FT_Frame_Field name_table_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_NameTableRec + + FT_FRAME_START( 6 ), + FT_FRAME_USHORT( format ), + FT_FRAME_USHORT( numNameRecords ), + FT_FRAME_USHORT( storageOffset ), + FT_FRAME_END + }; + + static const FT_Frame_Field name_record_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_NameEntryRec + + /* no FT_FRAME_START */ + FT_FRAME_USHORT( platformID ), + FT_FRAME_USHORT( encodingID ), + FT_FRAME_USHORT( languageID ), + FT_FRAME_USHORT( nameID ), + FT_FRAME_USHORT( stringLength ), + FT_FRAME_USHORT( stringOffset ), + FT_FRAME_END + }; + + + table = &face->name_table; + table->stream = stream; + + error = face->goto_table( face, TTAG_name, stream, &table_len ); + if ( error ) + goto Exit; + + table_pos = FT_STREAM_POS(); + + + if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) ) + goto Exit; + + /* Some popular Asian fonts have an invalid `storageOffset' value */ + /* (it should be at least "6 + 12*num_names"). However, the string */ + /* offsets, computed as "storageOffset + entry->stringOffset", are */ + /* valid pointers within the name table... */ + /* */ + /* We thus can't check `storageOffset' right now. */ + /* */ + storage_start = table_pos + 6 + 12*table->numNameRecords; + storage_limit = table_pos + table_len; + + if ( storage_start > storage_limit ) + { + FT_ERROR(( "invalid `name' table\n" )); + error = SFNT_Err_Name_Table_Missing; + goto Exit; + } + + /* Allocate the array of name records. */ + count = table->numNameRecords; + table->numNameRecords = 0; + + if ( FT_NEW_ARRAY( table->names, count ) || + FT_FRAME_ENTER( count * 12 ) ) + goto Exit; + + /* Load the name records and determine how much storage is needed */ + /* to hold the strings themselves. */ + { + TT_NameEntryRec* entry = table->names; + + + for ( ; count > 0; count-- ) + { + if ( FT_STREAM_READ_FIELDS( name_record_fields, entry ) ) + continue; + + /* check that the name is not empty */ + if ( entry->stringLength == 0 ) + continue; + + /* check that the name string is within the table */ + entry->stringOffset += table_pos + table->storageOffset; + if ( entry->stringOffset < storage_start || + entry->stringOffset + entry->stringLength > storage_limit ) + { + /* invalid entry - ignore it */ + entry->stringOffset = 0; + entry->stringLength = 0; + continue; + } + + entry++; + } + + table->numNameRecords = (FT_UInt)( entry - table->names ); + } + + FT_FRAME_EXIT(); + + /* everything went well, update face->num_names */ + face->num_names = (FT_UShort) table->numNameRecords; + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_free_names */ + /* */ + /* */ + /* Frees the name records. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + FT_LOCAL_DEF( void ) + tt_face_free_name( TT_Face face ) + { + FT_Memory memory = face->root.driver->root.memory; + TT_NameTable table = &face->name_table; + TT_NameEntry entry = table->names; + FT_UInt count = table->numNameRecords; + + + if ( table->names ) + { + for ( ; count > 0; count--, entry++ ) + { + FT_FREE( entry->string ); + entry->stringLength = 0; + } + + /* free strings table */ + FT_FREE( table->names ); + } + + table->numNameRecords = 0; + table->format = 0; + table->storageOffset = 0; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_cmap */ + /* */ + /* */ + /* Loads the cmap directory in a face object. The cmaps themselves */ + /* are loaded on demand in the `ttcmap.c' module. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_cmap( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + + + error = face->goto_table( face, TTAG_cmap, stream, &face->cmap_size ); + if ( error ) + goto Exit; + + if ( FT_FRAME_EXTRACT( face->cmap_size, face->cmap_table ) ) + face->cmap_size = 0; + + Exit: + return error; + } + + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_os2 */ + /* */ + /* */ + /* Loads the OS2 table. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_os2( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + TT_OS2* os2; + + const FT_Frame_Field os2_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_OS2 + + FT_FRAME_START( 78 ), + FT_FRAME_USHORT( version ), + FT_FRAME_SHORT ( xAvgCharWidth ), + FT_FRAME_USHORT( usWeightClass ), + FT_FRAME_USHORT( usWidthClass ), + FT_FRAME_SHORT ( fsType ), + FT_FRAME_SHORT ( ySubscriptXSize ), + FT_FRAME_SHORT ( ySubscriptYSize ), + FT_FRAME_SHORT ( ySubscriptXOffset ), + FT_FRAME_SHORT ( ySubscriptYOffset ), + FT_FRAME_SHORT ( ySuperscriptXSize ), + FT_FRAME_SHORT ( ySuperscriptYSize ), + FT_FRAME_SHORT ( ySuperscriptXOffset ), + FT_FRAME_SHORT ( ySuperscriptYOffset ), + FT_FRAME_SHORT ( yStrikeoutSize ), + FT_FRAME_SHORT ( yStrikeoutPosition ), + FT_FRAME_SHORT ( sFamilyClass ), + FT_FRAME_BYTE ( panose[0] ), + FT_FRAME_BYTE ( panose[1] ), + FT_FRAME_BYTE ( panose[2] ), + FT_FRAME_BYTE ( panose[3] ), + FT_FRAME_BYTE ( panose[4] ), + FT_FRAME_BYTE ( panose[5] ), + FT_FRAME_BYTE ( panose[6] ), + FT_FRAME_BYTE ( panose[7] ), + FT_FRAME_BYTE ( panose[8] ), + FT_FRAME_BYTE ( panose[9] ), + FT_FRAME_ULONG ( ulUnicodeRange1 ), + FT_FRAME_ULONG ( ulUnicodeRange2 ), + FT_FRAME_ULONG ( ulUnicodeRange3 ), + FT_FRAME_ULONG ( ulUnicodeRange4 ), + FT_FRAME_BYTE ( achVendID[0] ), + FT_FRAME_BYTE ( achVendID[1] ), + FT_FRAME_BYTE ( achVendID[2] ), + FT_FRAME_BYTE ( achVendID[3] ), + + FT_FRAME_USHORT( fsSelection ), + FT_FRAME_USHORT( usFirstCharIndex ), + FT_FRAME_USHORT( usLastCharIndex ), + FT_FRAME_SHORT ( sTypoAscender ), + FT_FRAME_SHORT ( sTypoDescender ), + FT_FRAME_SHORT ( sTypoLineGap ), + FT_FRAME_USHORT( usWinAscent ), + FT_FRAME_USHORT( usWinDescent ), + FT_FRAME_END + }; + + const FT_Frame_Field os2_fields_extra[] = + { + FT_FRAME_START( 8 ), + FT_FRAME_ULONG( ulCodePageRange1 ), + FT_FRAME_ULONG( ulCodePageRange2 ), + FT_FRAME_END + }; + + const FT_Frame_Field os2_fields_extra2[] = + { + FT_FRAME_START( 10 ), + FT_FRAME_SHORT ( sxHeight ), + FT_FRAME_SHORT ( sCapHeight ), + FT_FRAME_USHORT( usDefaultChar ), + FT_FRAME_USHORT( usBreakChar ), + FT_FRAME_USHORT( usMaxContext ), + FT_FRAME_END + }; + + + /* We now support old Mac fonts where the OS/2 table doesn't */ + /* exist. Simply put, we set the `version' field to 0xFFFF */ + /* and test this value each time we need to access the table. */ + error = face->goto_table( face, TTAG_OS2, stream, 0 ); + if ( error ) + goto Exit; + + os2 = &face->os2; + + if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) ) + goto Exit; + + os2->ulCodePageRange1 = 0; + os2->ulCodePageRange2 = 0; + os2->sxHeight = 0; + os2->sCapHeight = 0; + os2->usDefaultChar = 0; + os2->usBreakChar = 0; + os2->usMaxContext = 0; + + if ( os2->version >= 0x0001 ) + { + /* only version 1 tables */ + if ( FT_STREAM_READ_FIELDS( os2_fields_extra, os2 ) ) + goto Exit; + + if ( os2->version >= 0x0002 ) + { + /* only version 2 tables */ + if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) ) + goto Exit; + } + } + + FT_TRACE3(( "sTypoAscender: %4d\n", os2->sTypoAscender )); + FT_TRACE3(( "sTypoDescender: %4d\n", os2->sTypoDescender )); + FT_TRACE3(( "usWinAscent: %4u\n", os2->usWinAscent )); + FT_TRACE3(( "usWinDescent: %4u\n", os2->usWinDescent )); + FT_TRACE3(( "fsSelection: 0x%2x\n", os2->fsSelection )); + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_postscript */ + /* */ + /* */ + /* Loads the Postscript table. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_post( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + TT_Postscript* post = &face->postscript; + + static const FT_Frame_Field post_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_Postscript + + FT_FRAME_START( 32 ), + FT_FRAME_ULONG( FormatType ), + FT_FRAME_ULONG( italicAngle ), + FT_FRAME_SHORT( underlinePosition ), + FT_FRAME_SHORT( underlineThickness ), + FT_FRAME_ULONG( isFixedPitch ), + FT_FRAME_ULONG( minMemType42 ), + FT_FRAME_ULONG( maxMemType42 ), + FT_FRAME_ULONG( minMemType1 ), + FT_FRAME_ULONG( maxMemType1 ), + FT_FRAME_END + }; + + + error = face->goto_table( face, TTAG_post, stream, 0 ); + if ( error ) + return error; + + if ( FT_STREAM_READ_FIELDS( post_fields, post ) ) + return error; + + /* we don't load the glyph names, we do that in another */ + /* module (ttpost). */ + + FT_TRACE3(( "FormatType: 0x%x\n", post->FormatType )); + FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch + ? " yes" : " no" )); + + return SFNT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_pclt */ + /* */ + /* */ + /* Loads the PCL 5 Table. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_pclt( TT_Face face, + FT_Stream stream ) + { + static const FT_Frame_Field pclt_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_PCLT + + FT_FRAME_START( 54 ), + FT_FRAME_ULONG ( Version ), + FT_FRAME_ULONG ( FontNumber ), + FT_FRAME_USHORT( Pitch ), + FT_FRAME_USHORT( xHeight ), + FT_FRAME_USHORT( Style ), + FT_FRAME_USHORT( TypeFamily ), + FT_FRAME_USHORT( CapHeight ), + FT_FRAME_BYTES ( TypeFace, 16 ), + FT_FRAME_BYTES ( CharacterComplement, 8 ), + FT_FRAME_BYTES ( FileName, 6 ), + FT_FRAME_CHAR ( StrokeWeight ), + FT_FRAME_CHAR ( WidthType ), + FT_FRAME_BYTE ( SerifStyle ), + FT_FRAME_BYTE ( Reserved ), + FT_FRAME_END + }; + + FT_Error error; + TT_PCLT* pclt = &face->pclt; + + + /* optional table */ + error = face->goto_table( face, TTAG_PCLT, stream, 0 ); + if ( error ) + goto Exit; + + if ( FT_STREAM_READ_FIELDS( pclt_fields, pclt ) ) + goto Exit; + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_gasp */ + /* */ + /* */ + /* Loads the `gasp' table into a face object. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_gasp( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + FT_Memory memory = stream->memory; + + FT_UInt j,num_ranges; + TT_GaspRange gaspranges; + + + /* the gasp table is optional */ + error = face->goto_table( face, TTAG_gasp, stream, 0 ); + if ( error ) + goto Exit; + + if ( FT_FRAME_ENTER( 4L ) ) + goto Exit; + + face->gasp.version = FT_GET_USHORT(); + face->gasp.numRanges = FT_GET_USHORT(); + + FT_FRAME_EXIT(); + + /* only support versions 0 and 1 of the table */ + if ( face->gasp.version >= 2 ) + { + face->gasp.numRanges = 0; + error = SFNT_Err_Invalid_Table; + goto Exit; + } + + num_ranges = face->gasp.numRanges; + FT_TRACE3(( "numRanges: %u\n", num_ranges )); + + if ( FT_QNEW_ARRAY( gaspranges, num_ranges ) || + FT_FRAME_ENTER( num_ranges * 4L ) ) + goto Exit; + + face->gasp.gaspRanges = gaspranges; + + for ( j = 0; j < num_ranges; j++ ) + { + gaspranges[j].maxPPEM = FT_GET_USHORT(); + gaspranges[j].gaspFlag = FT_GET_USHORT(); + + FT_TRACE3(( "gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\n", + j, + gaspranges[j].maxPPEM, + gaspranges[j].gaspFlag )); + } + + FT_FRAME_EXIT(); + + Exit: + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttload.h b/reactos/dll/3rdparty/freetype/src/sfnt/ttload.h index 49a1aee1633..c493cb6e8f7 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttload.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttload.h @@ -1,112 +1,112 @@ -/***************************************************************************/ -/* */ -/* ttload.h */ -/* */ -/* Load the basic TrueType tables, i.e., tables that can be either in */ -/* TTF or OTF fonts (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTLOAD_H__ -#define __TTLOAD_H__ - - -#include -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_TRUETYPE_TYPES_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( TT_Table ) - tt_face_lookup_table( TT_Face face, - FT_ULong tag ); - - FT_LOCAL( FT_Error ) - tt_face_goto_table( TT_Face face, - FT_ULong tag, - FT_Stream stream, - FT_ULong* length ); - - - FT_LOCAL( FT_Error ) - tt_face_load_font_dir( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_any( TT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ); - - - FT_LOCAL( FT_Error ) - tt_face_load_head( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_cmap( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_maxp( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_name( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_os2( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_post( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_pclt( TT_Face face, - FT_Stream stream ); - - FT_LOCAL( void ) - tt_face_free_name( TT_Face face ); - - - FT_LOCAL( FT_Error ) - tt_face_load_gasp( TT_Face face, - FT_Stream stream ); - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - FT_LOCAL( FT_Error ) - tt_face_load_bhed( TT_Face face, - FT_Stream stream ); - -#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - - -FT_END_HEADER - -#endif /* __TTLOAD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttload.h */ +/* */ +/* Load the basic TrueType tables, i.e., tables that can be either in */ +/* TTF or OTF fonts (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTLOAD_H__ +#define __TTLOAD_H__ + + +#include +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( TT_Table ) + tt_face_lookup_table( TT_Face face, + FT_ULong tag ); + + FT_LOCAL( FT_Error ) + tt_face_goto_table( TT_Face face, + FT_ULong tag, + FT_Stream stream, + FT_ULong* length ); + + + FT_LOCAL( FT_Error ) + tt_face_load_font_dir( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_any( TT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); + + + FT_LOCAL( FT_Error ) + tt_face_load_head( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_cmap( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_maxp( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_name( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_os2( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_post( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_pclt( TT_Face face, + FT_Stream stream ); + + FT_LOCAL( void ) + tt_face_free_name( TT_Face face ); + + + FT_LOCAL( FT_Error ) + tt_face_load_gasp( TT_Face face, + FT_Stream stream ); + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + FT_LOCAL( FT_Error ) + tt_face_load_bhed( TT_Face face, + FT_Stream stream ); + +#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + +FT_END_HEADER + +#endif /* __TTLOAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.c index 286bd0c311c..b3381b737dd 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.c @@ -1,465 +1,465 @@ -/***************************************************************************/ -/* */ -/* ttmtx.c */ -/* */ -/* Load the metrics tables common to TTF and OTF fonts (body). */ -/* */ -/* Copyright 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include "ttmtx.h" - -#include "sferrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttmtx - - - /* - * Unfortunately, we can't enable our memory optimizations if - * FT_CONFIG_OPTION_OLD_INTERNALS is defined. This is because at least - * one rogue client (libXfont in the X.Org XServer) is directly accessing - * the metrics. - */ - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_hmtx */ - /* */ - /* */ - /* Load the `hmtx' or `vmtx' table into a face object. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* vertical :: A boolean flag. If set, load `vmtx'. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ -#if !defined FT_CONFIG_OPTION_OLD_INTERNALS - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_hmtx( TT_Face face, - FT_Stream stream, - FT_Bool vertical ) - { - FT_Error error; - FT_ULong tag, table_size; - FT_ULong* ptable_offset; - FT_ULong* ptable_size; - - - if ( vertical ) - { - tag = TTAG_vmtx; - ptable_offset = &face->vert_metrics_offset; - ptable_size = &face->vert_metrics_size; - } - else - { - tag = TTAG_hmtx; - ptable_offset = &face->horz_metrics_offset; - ptable_size = &face->horz_metrics_size; - } - - error = face->goto_table( face, tag, stream, &table_size ); - if ( error ) - goto Fail; - - *ptable_size = table_size; - *ptable_offset = FT_STREAM_POS(); - - Fail: - return error; - } - -#else /* !OPTIMIZE_MEMORY || OLD_INTERNALS */ - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_hmtx( TT_Face face, - FT_Stream stream, - FT_Bool vertical ) - { - FT_Error error; - FT_Memory memory = stream->memory; - - FT_ULong table_len; - FT_Long num_shorts, num_longs, num_shorts_checked; - - TT_LongMetrics* longs; - TT_ShortMetrics** shorts; - FT_Byte* p; - - - if ( vertical ) - { - void* lm = &face->vertical.long_metrics; - void** sm = &face->vertical.short_metrics; - - - error = face->goto_table( face, TTAG_vmtx, stream, &table_len ); - if ( error ) - goto Fail; - - num_longs = face->vertical.number_Of_VMetrics; - if ( (FT_ULong)num_longs > table_len / 4 ) - num_longs = (FT_Long)( table_len / 4 ); - - face->vertical.number_Of_VMetrics = 0; - - longs = (TT_LongMetrics*)lm; - shorts = (TT_ShortMetrics**)sm; - } - else - { - void* lm = &face->horizontal.long_metrics; - void** sm = &face->horizontal.short_metrics; - - - error = face->goto_table( face, TTAG_hmtx, stream, &table_len ); - if ( error ) - goto Fail; - - num_longs = face->horizontal.number_Of_HMetrics; - if ( (FT_ULong)num_longs > table_len / 4 ) - num_longs = (FT_Long)( table_len / 4 ); - - face->horizontal.number_Of_HMetrics = 0; - - longs = (TT_LongMetrics*)lm; - shorts = (TT_ShortMetrics**)sm; - } - - /* never trust derived values */ - - num_shorts = face->max_profile.numGlyphs - num_longs; - num_shorts_checked = ( table_len - num_longs * 4L ) / 2; - - if ( num_shorts < 0 ) - { - FT_ERROR(( "%cmtx has more metrics than glyphs.\n" )); - - /* Adobe simply ignores this problem. So we shall do the same. */ -#if 0 - error = vertical ? SFNT_Err_Invalid_Vert_Metrics - : SFNT_Err_Invalid_Horiz_Metrics; - goto Exit; -#else - num_shorts = 0; -#endif - } - - if ( FT_QNEW_ARRAY( *longs, num_longs ) || - FT_QNEW_ARRAY( *shorts, num_shorts ) ) - goto Fail; - - if ( FT_FRAME_ENTER( table_len ) ) - goto Fail; - - p = stream->cursor; - - { - TT_LongMetrics cur = *longs; - TT_LongMetrics limit = cur + num_longs; - - - for ( ; cur < limit; cur++ ) - { - cur->advance = FT_NEXT_USHORT( p ); - cur->bearing = FT_NEXT_SHORT( p ); - } - } - - /* do we have an inconsistent number of metric values? */ - { - TT_ShortMetrics* cur = *shorts; - TT_ShortMetrics* limit = cur + - FT_MIN( num_shorts, num_shorts_checked ); - - - for ( ; cur < limit; cur++ ) - *cur = FT_NEXT_SHORT( p ); - - /* We fill up the missing left side bearings with the */ - /* last valid value. Since this will occur for buggy CJK */ - /* fonts usually only, nothing serious will happen. */ - if ( num_shorts > num_shorts_checked && num_shorts_checked > 0 ) - { - FT_Short val = (*shorts)[num_shorts_checked - 1]; - - - limit = *shorts + num_shorts; - for ( ; cur < limit; cur++ ) - *cur = val; - } - } - - FT_FRAME_EXIT(); - - if ( vertical ) - face->vertical.number_Of_VMetrics = (FT_UShort)num_longs; - else - face->horizontal.number_Of_HMetrics = (FT_UShort)num_longs; - - Fail: - return error; - } - -#endif /* !OPTIMIZE_MEMORY || OLD_INTERNALS */ - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_hhea */ - /* */ - /* */ - /* Load the `hhea' or 'vhea' table into a face object. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* vertical :: A boolean flag. If set, load `vhea'. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_hhea( TT_Face face, - FT_Stream stream, - FT_Bool vertical ) - { - FT_Error error; - TT_HoriHeader* header; - - const FT_Frame_Field metrics_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_HoriHeader - - FT_FRAME_START( 36 ), - FT_FRAME_ULONG ( Version ), - FT_FRAME_SHORT ( Ascender ), - FT_FRAME_SHORT ( Descender ), - FT_FRAME_SHORT ( Line_Gap ), - FT_FRAME_USHORT( advance_Width_Max ), - FT_FRAME_SHORT ( min_Left_Side_Bearing ), - FT_FRAME_SHORT ( min_Right_Side_Bearing ), - FT_FRAME_SHORT ( xMax_Extent ), - FT_FRAME_SHORT ( caret_Slope_Rise ), - FT_FRAME_SHORT ( caret_Slope_Run ), - FT_FRAME_SHORT ( caret_Offset ), - FT_FRAME_SHORT ( Reserved[0] ), - FT_FRAME_SHORT ( Reserved[1] ), - FT_FRAME_SHORT ( Reserved[2] ), - FT_FRAME_SHORT ( Reserved[3] ), - FT_FRAME_SHORT ( metric_Data_Format ), - FT_FRAME_USHORT( number_Of_HMetrics ), - FT_FRAME_END - }; - - - if ( vertical ) - { - void *v = &face->vertical; - - - error = face->goto_table( face, TTAG_vhea, stream, 0 ); - if ( error ) - goto Fail; - - header = (TT_HoriHeader*)v; - } - else - { - error = face->goto_table( face, TTAG_hhea, stream, 0 ); - if ( error ) - goto Fail; - - header = &face->horizontal; - } - - if ( FT_STREAM_READ_FIELDS( metrics_header_fields, header ) ) - goto Fail; - - FT_TRACE3(( "Ascender: %5d\n", header->Ascender )); - FT_TRACE3(( "Descender: %5d\n", header->Descender )); - FT_TRACE3(( "number_Of_Metrics: %5u\n", header->number_Of_HMetrics )); - - header->long_metrics = NULL; - header->short_metrics = NULL; - - Fail: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_get_metrics */ - /* */ - /* */ - /* Returns the horizontal or vertical metrics in font units for a */ - /* given glyph. The metrics are the left side bearing (resp. top */ - /* side bearing) and advance width (resp. advance height). */ - /* */ - /* */ - /* header :: A pointer to either the horizontal or vertical metrics */ - /* structure. */ - /* */ - /* idx :: The glyph index. */ - /* */ - /* */ - /* bearing :: The bearing, either left side or top side. */ - /* */ - /* advance :: The advance width resp. advance height. */ - /* */ -#if !defined FT_CONFIG_OPTION_OLD_INTERNALS - - FT_LOCAL_DEF( FT_Error ) - tt_face_get_metrics( TT_Face face, - FT_Bool vertical, - FT_UInt gindex, - FT_Short *abearing, - FT_UShort *aadvance ) - { - FT_Error error; - FT_Stream stream = face->root.stream; - TT_HoriHeader* header; - FT_ULong table_pos, table_size, table_end; - FT_UShort k; - - - if ( vertical ) - { - void* v = &face->vertical; - - - header = (TT_HoriHeader*)v; - table_pos = face->vert_metrics_offset; - table_size = face->vert_metrics_size; - } - else - { - header = &face->horizontal; - table_pos = face->horz_metrics_offset; - table_size = face->horz_metrics_size; - } - - table_end = table_pos + table_size; - - k = header->number_Of_HMetrics; - - if ( k > 0 ) - { - if ( gindex < (FT_UInt)k ) - { - table_pos += 4 * gindex; - if ( table_pos + 4 > table_end ) - goto NoData; - - if ( FT_STREAM_SEEK( table_pos ) || - FT_READ_USHORT( *aadvance ) || - FT_READ_SHORT( *abearing ) ) - goto NoData; - } - else - { - table_pos += 4 * ( k - 1 ); - if ( table_pos + 4 > table_end ) - goto NoData; - - if ( FT_STREAM_SEEK( table_pos ) || - FT_READ_USHORT( *aadvance ) ) - goto NoData; - - table_pos += 4 + 2 * ( gindex - k ); - if ( table_pos + 2 > table_end ) - *abearing = 0; - else - { - if ( !FT_STREAM_SEEK( table_pos ) ) - (void)FT_READ_SHORT( *abearing ); - } - } - } - else - { - NoData: - *abearing = 0; - *aadvance = 0; - } - - return SFNT_Err_Ok; - } - -#else /* OLD_INTERNALS */ - - FT_LOCAL_DEF( FT_Error ) - tt_face_get_metrics( TT_Face face, - FT_Bool vertical, - FT_UInt gindex, - FT_Short* abearing, - FT_UShort* aadvance ) - { - void* v = &face->vertical; - void* h = &face->horizontal; - TT_HoriHeader* header = vertical ? (TT_HoriHeader*)v : h; - TT_LongMetrics longs_m; - FT_UShort k = header->number_Of_HMetrics; - - - if ( k == 0 || - !header->long_metrics || - gindex >= (FT_UInt)face->max_profile.numGlyphs ) - { - *abearing = *aadvance = 0; - return SFNT_Err_Ok; - } - - if ( gindex < (FT_UInt)k ) - { - longs_m = (TT_LongMetrics)header->long_metrics + gindex; - *abearing = longs_m->bearing; - *aadvance = longs_m->advance; - } - else - { - *abearing = ((TT_ShortMetrics*)header->short_metrics)[gindex - k]; - *aadvance = ((TT_LongMetrics)header->long_metrics)[k - 1].advance; - } - - return SFNT_Err_Ok; - } - -#endif /* !OPTIMIZE_MEMORY || OLD_INTERNALS */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttmtx.c */ +/* */ +/* Load the metrics tables common to TTF and OTF fonts (body). */ +/* */ +/* Copyright 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H +#include "ttmtx.h" + +#include "sferrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttmtx + + + /* + * Unfortunately, we can't enable our memory optimizations if + * FT_CONFIG_OPTION_OLD_INTERNALS is defined. This is because at least + * one rogue client (libXfont in the X.Org XServer) is directly accessing + * the metrics. + */ + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_hmtx */ + /* */ + /* */ + /* Load the `hmtx' or `vmtx' table into a face object. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* vertical :: A boolean flag. If set, load `vmtx'. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ +#if !defined FT_CONFIG_OPTION_OLD_INTERNALS + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_hmtx( TT_Face face, + FT_Stream stream, + FT_Bool vertical ) + { + FT_Error error; + FT_ULong tag, table_size; + FT_ULong* ptable_offset; + FT_ULong* ptable_size; + + + if ( vertical ) + { + tag = TTAG_vmtx; + ptable_offset = &face->vert_metrics_offset; + ptable_size = &face->vert_metrics_size; + } + else + { + tag = TTAG_hmtx; + ptable_offset = &face->horz_metrics_offset; + ptable_size = &face->horz_metrics_size; + } + + error = face->goto_table( face, tag, stream, &table_size ); + if ( error ) + goto Fail; + + *ptable_size = table_size; + *ptable_offset = FT_STREAM_POS(); + + Fail: + return error; + } + +#else /* !OPTIMIZE_MEMORY || OLD_INTERNALS */ + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_hmtx( TT_Face face, + FT_Stream stream, + FT_Bool vertical ) + { + FT_Error error; + FT_Memory memory = stream->memory; + + FT_ULong table_len; + FT_Long num_shorts, num_longs, num_shorts_checked; + + TT_LongMetrics* longs; + TT_ShortMetrics** shorts; + FT_Byte* p; + + + if ( vertical ) + { + void* lm = &face->vertical.long_metrics; + void** sm = &face->vertical.short_metrics; + + + error = face->goto_table( face, TTAG_vmtx, stream, &table_len ); + if ( error ) + goto Fail; + + num_longs = face->vertical.number_Of_VMetrics; + if ( (FT_ULong)num_longs > table_len / 4 ) + num_longs = (FT_Long)( table_len / 4 ); + + face->vertical.number_Of_VMetrics = 0; + + longs = (TT_LongMetrics*)lm; + shorts = (TT_ShortMetrics**)sm; + } + else + { + void* lm = &face->horizontal.long_metrics; + void** sm = &face->horizontal.short_metrics; + + + error = face->goto_table( face, TTAG_hmtx, stream, &table_len ); + if ( error ) + goto Fail; + + num_longs = face->horizontal.number_Of_HMetrics; + if ( (FT_ULong)num_longs > table_len / 4 ) + num_longs = (FT_Long)( table_len / 4 ); + + face->horizontal.number_Of_HMetrics = 0; + + longs = (TT_LongMetrics*)lm; + shorts = (TT_ShortMetrics**)sm; + } + + /* never trust derived values */ + + num_shorts = face->max_profile.numGlyphs - num_longs; + num_shorts_checked = ( table_len - num_longs * 4L ) / 2; + + if ( num_shorts < 0 ) + { + FT_ERROR(( "%cmtx has more metrics than glyphs.\n" )); + + /* Adobe simply ignores this problem. So we shall do the same. */ +#if 0 + error = vertical ? SFNT_Err_Invalid_Vert_Metrics + : SFNT_Err_Invalid_Horiz_Metrics; + goto Exit; +#else + num_shorts = 0; +#endif + } + + if ( FT_QNEW_ARRAY( *longs, num_longs ) || + FT_QNEW_ARRAY( *shorts, num_shorts ) ) + goto Fail; + + if ( FT_FRAME_ENTER( table_len ) ) + goto Fail; + + p = stream->cursor; + + { + TT_LongMetrics cur = *longs; + TT_LongMetrics limit = cur + num_longs; + + + for ( ; cur < limit; cur++ ) + { + cur->advance = FT_NEXT_USHORT( p ); + cur->bearing = FT_NEXT_SHORT( p ); + } + } + + /* do we have an inconsistent number of metric values? */ + { + TT_ShortMetrics* cur = *shorts; + TT_ShortMetrics* limit = cur + + FT_MIN( num_shorts, num_shorts_checked ); + + + for ( ; cur < limit; cur++ ) + *cur = FT_NEXT_SHORT( p ); + + /* We fill up the missing left side bearings with the */ + /* last valid value. Since this will occur for buggy CJK */ + /* fonts usually only, nothing serious will happen. */ + if ( num_shorts > num_shorts_checked && num_shorts_checked > 0 ) + { + FT_Short val = (*shorts)[num_shorts_checked - 1]; + + + limit = *shorts + num_shorts; + for ( ; cur < limit; cur++ ) + *cur = val; + } + } + + FT_FRAME_EXIT(); + + if ( vertical ) + face->vertical.number_Of_VMetrics = (FT_UShort)num_longs; + else + face->horizontal.number_Of_HMetrics = (FT_UShort)num_longs; + + Fail: + return error; + } + +#endif /* !OPTIMIZE_MEMORY || OLD_INTERNALS */ + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_hhea */ + /* */ + /* */ + /* Load the `hhea' or 'vhea' table into a face object. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* vertical :: A boolean flag. If set, load `vhea'. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_hhea( TT_Face face, + FT_Stream stream, + FT_Bool vertical ) + { + FT_Error error; + TT_HoriHeader* header; + + const FT_Frame_Field metrics_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_HoriHeader + + FT_FRAME_START( 36 ), + FT_FRAME_ULONG ( Version ), + FT_FRAME_SHORT ( Ascender ), + FT_FRAME_SHORT ( Descender ), + FT_FRAME_SHORT ( Line_Gap ), + FT_FRAME_USHORT( advance_Width_Max ), + FT_FRAME_SHORT ( min_Left_Side_Bearing ), + FT_FRAME_SHORT ( min_Right_Side_Bearing ), + FT_FRAME_SHORT ( xMax_Extent ), + FT_FRAME_SHORT ( caret_Slope_Rise ), + FT_FRAME_SHORT ( caret_Slope_Run ), + FT_FRAME_SHORT ( caret_Offset ), + FT_FRAME_SHORT ( Reserved[0] ), + FT_FRAME_SHORT ( Reserved[1] ), + FT_FRAME_SHORT ( Reserved[2] ), + FT_FRAME_SHORT ( Reserved[3] ), + FT_FRAME_SHORT ( metric_Data_Format ), + FT_FRAME_USHORT( number_Of_HMetrics ), + FT_FRAME_END + }; + + + if ( vertical ) + { + void *v = &face->vertical; + + + error = face->goto_table( face, TTAG_vhea, stream, 0 ); + if ( error ) + goto Fail; + + header = (TT_HoriHeader*)v; + } + else + { + error = face->goto_table( face, TTAG_hhea, stream, 0 ); + if ( error ) + goto Fail; + + header = &face->horizontal; + } + + if ( FT_STREAM_READ_FIELDS( metrics_header_fields, header ) ) + goto Fail; + + FT_TRACE3(( "Ascender: %5d\n", header->Ascender )); + FT_TRACE3(( "Descender: %5d\n", header->Descender )); + FT_TRACE3(( "number_Of_Metrics: %5u\n", header->number_Of_HMetrics )); + + header->long_metrics = NULL; + header->short_metrics = NULL; + + Fail: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_get_metrics */ + /* */ + /* */ + /* Returns the horizontal or vertical metrics in font units for a */ + /* given glyph. The metrics are the left side bearing (resp. top */ + /* side bearing) and advance width (resp. advance height). */ + /* */ + /* */ + /* header :: A pointer to either the horizontal or vertical metrics */ + /* structure. */ + /* */ + /* idx :: The glyph index. */ + /* */ + /* */ + /* bearing :: The bearing, either left side or top side. */ + /* */ + /* advance :: The advance width resp. advance height. */ + /* */ +#if !defined FT_CONFIG_OPTION_OLD_INTERNALS + + FT_LOCAL_DEF( FT_Error ) + tt_face_get_metrics( TT_Face face, + FT_Bool vertical, + FT_UInt gindex, + FT_Short *abearing, + FT_UShort *aadvance ) + { + FT_Error error; + FT_Stream stream = face->root.stream; + TT_HoriHeader* header; + FT_ULong table_pos, table_size, table_end; + FT_UShort k; + + + if ( vertical ) + { + void* v = &face->vertical; + + + header = (TT_HoriHeader*)v; + table_pos = face->vert_metrics_offset; + table_size = face->vert_metrics_size; + } + else + { + header = &face->horizontal; + table_pos = face->horz_metrics_offset; + table_size = face->horz_metrics_size; + } + + table_end = table_pos + table_size; + + k = header->number_Of_HMetrics; + + if ( k > 0 ) + { + if ( gindex < (FT_UInt)k ) + { + table_pos += 4 * gindex; + if ( table_pos + 4 > table_end ) + goto NoData; + + if ( FT_STREAM_SEEK( table_pos ) || + FT_READ_USHORT( *aadvance ) || + FT_READ_SHORT( *abearing ) ) + goto NoData; + } + else + { + table_pos += 4 * ( k - 1 ); + if ( table_pos + 4 > table_end ) + goto NoData; + + if ( FT_STREAM_SEEK( table_pos ) || + FT_READ_USHORT( *aadvance ) ) + goto NoData; + + table_pos += 4 + 2 * ( gindex - k ); + if ( table_pos + 2 > table_end ) + *abearing = 0; + else + { + if ( !FT_STREAM_SEEK( table_pos ) ) + (void)FT_READ_SHORT( *abearing ); + } + } + } + else + { + NoData: + *abearing = 0; + *aadvance = 0; + } + + return SFNT_Err_Ok; + } + +#else /* OLD_INTERNALS */ + + FT_LOCAL_DEF( FT_Error ) + tt_face_get_metrics( TT_Face face, + FT_Bool vertical, + FT_UInt gindex, + FT_Short* abearing, + FT_UShort* aadvance ) + { + void* v = &face->vertical; + void* h = &face->horizontal; + TT_HoriHeader* header = vertical ? (TT_HoriHeader*)v : h; + TT_LongMetrics longs_m; + FT_UShort k = header->number_Of_HMetrics; + + + if ( k == 0 || + !header->long_metrics || + gindex >= (FT_UInt)face->max_profile.numGlyphs ) + { + *abearing = *aadvance = 0; + return SFNT_Err_Ok; + } + + if ( gindex < (FT_UInt)k ) + { + longs_m = (TT_LongMetrics)header->long_metrics + gindex; + *abearing = longs_m->bearing; + *aadvance = longs_m->advance; + } + else + { + *abearing = ((TT_ShortMetrics*)header->short_metrics)[gindex - k]; + *aadvance = ((TT_LongMetrics)header->long_metrics)[k - 1].advance; + } + + return SFNT_Err_Ok; + } + +#endif /* !OPTIMIZE_MEMORY || OLD_INTERNALS */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.h b/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.h index 8b91a113d85..8881516a039 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttmtx.h @@ -1,55 +1,55 @@ -/***************************************************************************/ -/* */ -/* ttmtx.h */ -/* */ -/* Load the metrics tables common to TTF and OTF fonts (specification). */ -/* */ -/* Copyright 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTMTX_H__ -#define __TTMTX_H__ - - -#include -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_TRUETYPE_TYPES_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - tt_face_load_hhea( TT_Face face, - FT_Stream stream, - FT_Bool vertical ); - - - FT_LOCAL( FT_Error ) - tt_face_load_hmtx( TT_Face face, - FT_Stream stream, - FT_Bool vertical ); - - - FT_LOCAL( FT_Error ) - tt_face_get_metrics( TT_Face face, - FT_Bool vertical, - FT_UInt gindex, - FT_Short* abearing, - FT_UShort* aadvance ); - -FT_END_HEADER - -#endif /* __TTMTX_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttmtx.h */ +/* */ +/* Load the metrics tables common to TTF and OTF fonts (specification). */ +/* */ +/* Copyright 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTMTX_H__ +#define __TTMTX_H__ + + +#include +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + tt_face_load_hhea( TT_Face face, + FT_Stream stream, + FT_Bool vertical ); + + + FT_LOCAL( FT_Error ) + tt_face_load_hmtx( TT_Face face, + FT_Stream stream, + FT_Bool vertical ); + + + FT_LOCAL( FT_Error ) + tt_face_get_metrics( TT_Face face, + FT_Bool vertical, + FT_UInt gindex, + FT_Short* abearing, + FT_UShort* aadvance ); + +FT_END_HEADER + +#endif /* __TTMTX_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.c index 1e6163646dc..edbc99d7d2d 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.c @@ -1,521 +1,521 @@ -/***************************************************************************/ -/* */ -/* ttpost.c */ -/* */ -/* Postcript name table processing for TrueType and OpenType fonts */ -/* (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - /*************************************************************************/ - /* */ - /* The post table is not completely loaded by the core engine. This */ - /* file loads the missing PS glyph names and implements an API to access */ - /* them. */ - /* */ - /*************************************************************************/ - - -#include -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include "ttpost.h" -#include "ttload.h" - -#include "sferrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttpost - - - /* If this configuration macro is defined, we rely on the `PSNames' */ - /* module to grab the glyph names. */ - -#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES - - -#include FT_SERVICE_POSTSCRIPT_CMAPS_H - -#define MAC_NAME( x ) ( (FT_String*)psnames->macintosh_name( x ) ) - - -#else /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ - - - /* Otherwise, we ignore the `PSNames' module, and provide our own */ - /* table of Mac names. Thus, it is possible to build a version of */ - /* FreeType without the Type 1 driver & PSNames module. */ - -#define MAC_NAME( x ) tt_post_default_names[x] - - /* the 258 default Mac PS glyph names */ - - static const FT_String* tt_post_default_names[258] = - { - /* 0 */ - ".notdef", ".null", "CR", "space", "exclam", - "quotedbl", "numbersign", "dollar", "percent", "ampersand", - /* 10 */ - "quotesingle", "parenleft", "parenright", "asterisk", "plus", - "comma", "hyphen", "period", "slash", "zero", - /* 20 */ - "one", "two", "three", "four", "five", - "six", "seven", "eight", "nine", "colon", - /* 30 */ - "semicolon", "less", "equal", "greater", "question", - "at", "A", "B", "C", "D", - /* 40 */ - "E", "F", "G", "H", "I", - "J", "K", "L", "M", "N", - /* 50 */ - "O", "P", "Q", "R", "S", - "T", "U", "V", "W", "X", - /* 60 */ - "Y", "Z", "bracketleft", "backslash", "bracketright", - "asciicircum", "underscore", "grave", "a", "b", - /* 70 */ - "c", "d", "e", "f", "g", - "h", "i", "j", "k", "l", - /* 80 */ - "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", - /* 90 */ - "w", "x", "y", "z", "braceleft", - "bar", "braceright", "asciitilde", "Adieresis", "Aring", - /* 100 */ - "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", - "aacute", "agrave", "acircumflex", "adieresis", "atilde", - /* 110 */ - "aring", "ccedilla", "eacute", "egrave", "ecircumflex", - "edieresis", "iacute", "igrave", "icircumflex", "idieresis", - /* 120 */ - "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", - "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", - /* 130 */ - "dagger", "degree", "cent", "sterling", "section", - "bullet", "paragraph", "germandbls", "registered", "copyright", - /* 140 */ - "trademark", "acute", "dieresis", "notequal", "AE", - "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", - /* 150 */ - "yen", "mu", "partialdiff", "summation", "product", - "pi", "integral", "ordfeminine", "ordmasculine", "Omega", - /* 160 */ - "ae", "oslash", "questiondown", "exclamdown", "logicalnot", - "radical", "florin", "approxequal", "Delta", "guillemotleft", - /* 170 */ - "guillemotright", "ellipsis", "nbspace", "Agrave", "Atilde", - "Otilde", "OE", "oe", "endash", "emdash", - /* 180 */ - "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", - "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", - /* 190 */ - "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", - "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", - /* 200 */ - "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", - "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", - /* 210 */ - "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", - "dotlessi", "circumflex", "tilde", "macron", "breve", - /* 220 */ - "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", - "caron", "Lslash", "lslash", "Scaron", "scaron", - /* 230 */ - "Zcaron", "zcaron", "brokenbar", "Eth", "eth", - "Yacute", "yacute", "Thorn", "thorn", "minus", - /* 240 */ - "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", - "onequarter", "threequarters", "franc", "Gbreve", "gbreve", - /* 250 */ - "Idot", "Scedilla", "scedilla", "Cacute", "cacute", - "Ccaron", "ccaron", "dmacron", - }; - - -#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ - - - static FT_Error - load_format_20( TT_Face face, - FT_Stream stream ) - { - FT_Memory memory = stream->memory; - FT_Error error; - - FT_Int num_glyphs; - FT_UShort num_names; - - FT_UShort* glyph_indices = 0; - FT_Char** name_strings = 0; - - - if ( FT_READ_USHORT( num_glyphs ) ) - goto Exit; - - /* UNDOCUMENTED! The number of glyphs in this table can be smaller */ - /* than the value in the maxp table (cf. cyberbit.ttf). */ - - /* There already exist fonts which have more than 32768 glyph names */ - /* in this table, so the test for this threshold has been dropped. */ - - if ( num_glyphs > face->max_profile.numGlyphs ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - /* load the indices */ - { - FT_Int n; - - - if ( FT_NEW_ARRAY ( glyph_indices, num_glyphs ) || - FT_FRAME_ENTER( num_glyphs * 2L ) ) - goto Fail; - - for ( n = 0; n < num_glyphs; n++ ) - glyph_indices[n] = FT_GET_USHORT(); - - FT_FRAME_EXIT(); - } - - /* compute number of names stored in table */ - { - FT_Int n; - - - num_names = 0; - - for ( n = 0; n < num_glyphs; n++ ) - { - FT_Int idx; - - - idx = glyph_indices[n]; - if ( idx >= 258 ) - { - idx -= 257; - if ( idx > num_names ) - num_names = (FT_UShort)idx; - } - } - } - - /* now load the name strings */ - { - FT_UShort n; - - - if ( FT_NEW_ARRAY( name_strings, num_names ) ) - goto Fail; - - for ( n = 0; n < num_names; n++ ) - { - FT_UInt len; - - - if ( FT_READ_BYTE ( len ) || - FT_NEW_ARRAY( name_strings[n], len + 1 ) || - FT_STREAM_READ ( name_strings[n], len ) ) - goto Fail1; - - name_strings[n][len] = '\0'; - } - } - - /* all right, set table fields and exit successfully */ - { - TT_Post_20 table = &face->postscript_names.names.format_20; - - - table->num_glyphs = (FT_UShort)num_glyphs; - table->num_names = (FT_UShort)num_names; - table->glyph_indices = glyph_indices; - table->glyph_names = name_strings; - } - return SFNT_Err_Ok; - - Fail1: - { - FT_UShort n; - - - for ( n = 0; n < num_names; n++ ) - FT_FREE( name_strings[n] ); - } - - Fail: - FT_FREE( name_strings ); - FT_FREE( glyph_indices ); - - Exit: - return error; - } - - - static FT_Error - load_format_25( TT_Face face, - FT_Stream stream ) - { - FT_Memory memory = stream->memory; - FT_Error error; - - FT_Int num_glyphs; - FT_Char* offset_table = 0; - - - /* UNDOCUMENTED! This value appears only in the Apple TT specs. */ - if ( FT_READ_USHORT( num_glyphs ) ) - goto Exit; - - /* check the number of glyphs */ - if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - if ( FT_NEW_ARRAY( offset_table, num_glyphs ) || - FT_STREAM_READ( offset_table, num_glyphs ) ) - goto Fail; - - /* now check the offset table */ - { - FT_Int n; - - - for ( n = 0; n < num_glyphs; n++ ) - { - FT_Long idx = (FT_Long)n + offset_table[n]; - - - if ( idx < 0 || idx > num_glyphs ) - { - error = SFNT_Err_Invalid_File_Format; - goto Fail; - } - } - } - - /* OK, set table fields and exit successfully */ - { - TT_Post_25 table = &face->postscript_names.names.format_25; - - - table->num_glyphs = (FT_UShort)num_glyphs; - table->offsets = offset_table; - } - - return SFNT_Err_Ok; - - Fail: - FT_FREE( offset_table ); - - Exit: - return error; - } - - - static FT_Error - load_post_names( TT_Face face ) - { - FT_Stream stream; - FT_Error error; - FT_Fixed format; - - - /* get a stream for the face's resource */ - stream = face->root.stream; - - /* seek to the beginning of the PS names table */ - error = face->goto_table( face, TTAG_post, stream, 0 ); - if ( error ) - goto Exit; - - format = face->postscript.FormatType; - - /* go to beginning of subtable */ - if ( FT_STREAM_SKIP( 32 ) ) - goto Exit; - - /* now read postscript table */ - if ( format == 0x00020000L ) - error = load_format_20( face, stream ); - else if ( format == 0x00028000L ) - error = load_format_25( face, stream ); - else - error = SFNT_Err_Invalid_File_Format; - - face->postscript_names.loaded = 1; - - Exit: - return error; - } - - - FT_LOCAL_DEF( void ) - tt_face_free_ps_names( TT_Face face ) - { - FT_Memory memory = face->root.memory; - TT_Post_Names names = &face->postscript_names; - FT_Fixed format; - - - if ( names->loaded ) - { - format = face->postscript.FormatType; - - if ( format == 0x00020000L ) - { - TT_Post_20 table = &names->names.format_20; - FT_UShort n; - - - FT_FREE( table->glyph_indices ); - table->num_glyphs = 0; - - for ( n = 0; n < table->num_names; n++ ) - FT_FREE( table->glyph_names[n] ); - - FT_FREE( table->glyph_names ); - table->num_names = 0; - } - else if ( format == 0x00028000L ) - { - TT_Post_25 table = &names->names.format_25; - - - FT_FREE( table->offsets ); - table->num_glyphs = 0; - } - } - names->loaded = 0; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_get_ps_name */ - /* */ - /* */ - /* Gets the PostScript glyph name of a glyph. */ - /* */ - /* */ - /* face :: A handle to the parent face. */ - /* */ - /* idx :: The glyph index. */ - /* */ - /* PSname :: The address of a string pointer. Will be NULL in case */ - /* of error, otherwise it is a pointer to the glyph name. */ - /* */ - /* You must not modify the returned string! */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_get_ps_name( TT_Face face, - FT_UInt idx, - FT_String** PSname ) - { - FT_Error error; - TT_Post_Names names; - FT_Fixed format; - -#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES - FT_Service_PsCMaps psnames; -#endif - - - if ( !face ) - return SFNT_Err_Invalid_Face_Handle; - - if ( idx >= (FT_UInt)face->max_profile.numGlyphs ) - return SFNT_Err_Invalid_Glyph_Index; - -#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES - psnames = (FT_Service_PsCMaps)face->psnames; - if ( !psnames ) - return SFNT_Err_Unimplemented_Feature; -#endif - - names = &face->postscript_names; - - /* `.notdef' by default */ - *PSname = MAC_NAME( 0 ); - - format = face->postscript.FormatType; - - if ( format == 0x00010000L ) - { - if ( idx < 258 ) /* paranoid checking */ - *PSname = MAC_NAME( idx ); - } - else if ( format == 0x00020000L ) - { - TT_Post_20 table = &names->names.format_20; - - - if ( !names->loaded ) - { - error = load_post_names( face ); - if ( error ) - goto End; - } - - if ( idx < (FT_UInt)table->num_glyphs ) - { - FT_UShort name_index = table->glyph_indices[idx]; - - - if ( name_index < 258 ) - *PSname = MAC_NAME( name_index ); - else - *PSname = (FT_String*)table->glyph_names[name_index - 258]; - } - } - else if ( format == 0x00028000L ) - { - TT_Post_25 table = &names->names.format_25; - - - if ( !names->loaded ) - { - error = load_post_names( face ); - if ( error ) - goto End; - } - - if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */ - { - idx += table->offsets[idx]; - *PSname = MAC_NAME( idx ); - } - } - - /* nothing to do for format == 0x00030000L */ - - End: - return SFNT_Err_Ok; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* ttpost.c */ +/* */ +/* Postcript name table processing for TrueType and OpenType fonts */ +/* (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + /*************************************************************************/ + /* */ + /* The post table is not completely loaded by the core engine. This */ + /* file loads the missing PS glyph names and implements an API to access */ + /* them. */ + /* */ + /*************************************************************************/ + + +#include +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H +#include "ttpost.h" +#include "ttload.h" + +#include "sferrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttpost + + + /* If this configuration macro is defined, we rely on the `PSNames' */ + /* module to grab the glyph names. */ + +#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES + + +#include FT_SERVICE_POSTSCRIPT_CMAPS_H + +#define MAC_NAME( x ) ( (FT_String*)psnames->macintosh_name( x ) ) + + +#else /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ + + + /* Otherwise, we ignore the `PSNames' module, and provide our own */ + /* table of Mac names. Thus, it is possible to build a version of */ + /* FreeType without the Type 1 driver & PSNames module. */ + +#define MAC_NAME( x ) tt_post_default_names[x] + + /* the 258 default Mac PS glyph names */ + + static const FT_String* tt_post_default_names[258] = + { + /* 0 */ + ".notdef", ".null", "CR", "space", "exclam", + "quotedbl", "numbersign", "dollar", "percent", "ampersand", + /* 10 */ + "quotesingle", "parenleft", "parenright", "asterisk", "plus", + "comma", "hyphen", "period", "slash", "zero", + /* 20 */ + "one", "two", "three", "four", "five", + "six", "seven", "eight", "nine", "colon", + /* 30 */ + "semicolon", "less", "equal", "greater", "question", + "at", "A", "B", "C", "D", + /* 40 */ + "E", "F", "G", "H", "I", + "J", "K", "L", "M", "N", + /* 50 */ + "O", "P", "Q", "R", "S", + "T", "U", "V", "W", "X", + /* 60 */ + "Y", "Z", "bracketleft", "backslash", "bracketright", + "asciicircum", "underscore", "grave", "a", "b", + /* 70 */ + "c", "d", "e", "f", "g", + "h", "i", "j", "k", "l", + /* 80 */ + "m", "n", "o", "p", "q", + "r", "s", "t", "u", "v", + /* 90 */ + "w", "x", "y", "z", "braceleft", + "bar", "braceright", "asciitilde", "Adieresis", "Aring", + /* 100 */ + "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", + "aacute", "agrave", "acircumflex", "adieresis", "atilde", + /* 110 */ + "aring", "ccedilla", "eacute", "egrave", "ecircumflex", + "edieresis", "iacute", "igrave", "icircumflex", "idieresis", + /* 120 */ + "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", + "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", + /* 130 */ + "dagger", "degree", "cent", "sterling", "section", + "bullet", "paragraph", "germandbls", "registered", "copyright", + /* 140 */ + "trademark", "acute", "dieresis", "notequal", "AE", + "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", + /* 150 */ + "yen", "mu", "partialdiff", "summation", "product", + "pi", "integral", "ordfeminine", "ordmasculine", "Omega", + /* 160 */ + "ae", "oslash", "questiondown", "exclamdown", "logicalnot", + "radical", "florin", "approxequal", "Delta", "guillemotleft", + /* 170 */ + "guillemotright", "ellipsis", "nbspace", "Agrave", "Atilde", + "Otilde", "OE", "oe", "endash", "emdash", + /* 180 */ + "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", + "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", + /* 190 */ + "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", + "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", + /* 200 */ + "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", + "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", + /* 210 */ + "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", + "dotlessi", "circumflex", "tilde", "macron", "breve", + /* 220 */ + "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", + "caron", "Lslash", "lslash", "Scaron", "scaron", + /* 230 */ + "Zcaron", "zcaron", "brokenbar", "Eth", "eth", + "Yacute", "yacute", "Thorn", "thorn", "minus", + /* 240 */ + "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", + "onequarter", "threequarters", "franc", "Gbreve", "gbreve", + /* 250 */ + "Idot", "Scedilla", "scedilla", "Cacute", "cacute", + "Ccaron", "ccaron", "dmacron", + }; + + +#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ + + + static FT_Error + load_format_20( TT_Face face, + FT_Stream stream ) + { + FT_Memory memory = stream->memory; + FT_Error error; + + FT_Int num_glyphs; + FT_UShort num_names; + + FT_UShort* glyph_indices = 0; + FT_Char** name_strings = 0; + + + if ( FT_READ_USHORT( num_glyphs ) ) + goto Exit; + + /* UNDOCUMENTED! The number of glyphs in this table can be smaller */ + /* than the value in the maxp table (cf. cyberbit.ttf). */ + + /* There already exist fonts which have more than 32768 glyph names */ + /* in this table, so the test for this threshold has been dropped. */ + + if ( num_glyphs > face->max_profile.numGlyphs ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + /* load the indices */ + { + FT_Int n; + + + if ( FT_NEW_ARRAY ( glyph_indices, num_glyphs ) || + FT_FRAME_ENTER( num_glyphs * 2L ) ) + goto Fail; + + for ( n = 0; n < num_glyphs; n++ ) + glyph_indices[n] = FT_GET_USHORT(); + + FT_FRAME_EXIT(); + } + + /* compute number of names stored in table */ + { + FT_Int n; + + + num_names = 0; + + for ( n = 0; n < num_glyphs; n++ ) + { + FT_Int idx; + + + idx = glyph_indices[n]; + if ( idx >= 258 ) + { + idx -= 257; + if ( idx > num_names ) + num_names = (FT_UShort)idx; + } + } + } + + /* now load the name strings */ + { + FT_UShort n; + + + if ( FT_NEW_ARRAY( name_strings, num_names ) ) + goto Fail; + + for ( n = 0; n < num_names; n++ ) + { + FT_UInt len; + + + if ( FT_READ_BYTE ( len ) || + FT_NEW_ARRAY( name_strings[n], len + 1 ) || + FT_STREAM_READ ( name_strings[n], len ) ) + goto Fail1; + + name_strings[n][len] = '\0'; + } + } + + /* all right, set table fields and exit successfully */ + { + TT_Post_20 table = &face->postscript_names.names.format_20; + + + table->num_glyphs = (FT_UShort)num_glyphs; + table->num_names = (FT_UShort)num_names; + table->glyph_indices = glyph_indices; + table->glyph_names = name_strings; + } + return SFNT_Err_Ok; + + Fail1: + { + FT_UShort n; + + + for ( n = 0; n < num_names; n++ ) + FT_FREE( name_strings[n] ); + } + + Fail: + FT_FREE( name_strings ); + FT_FREE( glyph_indices ); + + Exit: + return error; + } + + + static FT_Error + load_format_25( TT_Face face, + FT_Stream stream ) + { + FT_Memory memory = stream->memory; + FT_Error error; + + FT_Int num_glyphs; + FT_Char* offset_table = 0; + + + /* UNDOCUMENTED! This value appears only in the Apple TT specs. */ + if ( FT_READ_USHORT( num_glyphs ) ) + goto Exit; + + /* check the number of glyphs */ + if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + if ( FT_NEW_ARRAY( offset_table, num_glyphs ) || + FT_STREAM_READ( offset_table, num_glyphs ) ) + goto Fail; + + /* now check the offset table */ + { + FT_Int n; + + + for ( n = 0; n < num_glyphs; n++ ) + { + FT_Long idx = (FT_Long)n + offset_table[n]; + + + if ( idx < 0 || idx > num_glyphs ) + { + error = SFNT_Err_Invalid_File_Format; + goto Fail; + } + } + } + + /* OK, set table fields and exit successfully */ + { + TT_Post_25 table = &face->postscript_names.names.format_25; + + + table->num_glyphs = (FT_UShort)num_glyphs; + table->offsets = offset_table; + } + + return SFNT_Err_Ok; + + Fail: + FT_FREE( offset_table ); + + Exit: + return error; + } + + + static FT_Error + load_post_names( TT_Face face ) + { + FT_Stream stream; + FT_Error error; + FT_Fixed format; + + + /* get a stream for the face's resource */ + stream = face->root.stream; + + /* seek to the beginning of the PS names table */ + error = face->goto_table( face, TTAG_post, stream, 0 ); + if ( error ) + goto Exit; + + format = face->postscript.FormatType; + + /* go to beginning of subtable */ + if ( FT_STREAM_SKIP( 32 ) ) + goto Exit; + + /* now read postscript table */ + if ( format == 0x00020000L ) + error = load_format_20( face, stream ); + else if ( format == 0x00028000L ) + error = load_format_25( face, stream ); + else + error = SFNT_Err_Invalid_File_Format; + + face->postscript_names.loaded = 1; + + Exit: + return error; + } + + + FT_LOCAL_DEF( void ) + tt_face_free_ps_names( TT_Face face ) + { + FT_Memory memory = face->root.memory; + TT_Post_Names names = &face->postscript_names; + FT_Fixed format; + + + if ( names->loaded ) + { + format = face->postscript.FormatType; + + if ( format == 0x00020000L ) + { + TT_Post_20 table = &names->names.format_20; + FT_UShort n; + + + FT_FREE( table->glyph_indices ); + table->num_glyphs = 0; + + for ( n = 0; n < table->num_names; n++ ) + FT_FREE( table->glyph_names[n] ); + + FT_FREE( table->glyph_names ); + table->num_names = 0; + } + else if ( format == 0x00028000L ) + { + TT_Post_25 table = &names->names.format_25; + + + FT_FREE( table->offsets ); + table->num_glyphs = 0; + } + } + names->loaded = 0; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_get_ps_name */ + /* */ + /* */ + /* Gets the PostScript glyph name of a glyph. */ + /* */ + /* */ + /* face :: A handle to the parent face. */ + /* */ + /* idx :: The glyph index. */ + /* */ + /* PSname :: The address of a string pointer. Will be NULL in case */ + /* of error, otherwise it is a pointer to the glyph name. */ + /* */ + /* You must not modify the returned string! */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_get_ps_name( TT_Face face, + FT_UInt idx, + FT_String** PSname ) + { + FT_Error error; + TT_Post_Names names; + FT_Fixed format; + +#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES + FT_Service_PsCMaps psnames; +#endif + + + if ( !face ) + return SFNT_Err_Invalid_Face_Handle; + + if ( idx >= (FT_UInt)face->max_profile.numGlyphs ) + return SFNT_Err_Invalid_Glyph_Index; + +#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES + psnames = (FT_Service_PsCMaps)face->psnames; + if ( !psnames ) + return SFNT_Err_Unimplemented_Feature; +#endif + + names = &face->postscript_names; + + /* `.notdef' by default */ + *PSname = MAC_NAME( 0 ); + + format = face->postscript.FormatType; + + if ( format == 0x00010000L ) + { + if ( idx < 258 ) /* paranoid checking */ + *PSname = MAC_NAME( idx ); + } + else if ( format == 0x00020000L ) + { + TT_Post_20 table = &names->names.format_20; + + + if ( !names->loaded ) + { + error = load_post_names( face ); + if ( error ) + goto End; + } + + if ( idx < (FT_UInt)table->num_glyphs ) + { + FT_UShort name_index = table->glyph_indices[idx]; + + + if ( name_index < 258 ) + *PSname = MAC_NAME( name_index ); + else + *PSname = (FT_String*)table->glyph_names[name_index - 258]; + } + } + else if ( format == 0x00028000L ) + { + TT_Post_25 table = &names->names.format_25; + + + if ( !names->loaded ) + { + error = load_post_names( face ); + if ( error ) + goto End; + } + + if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */ + { + idx += table->offsets[idx]; + *PSname = MAC_NAME( idx ); + } + } + + /* nothing to do for format == 0x00030000L */ + + End: + return SFNT_Err_Ok; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.h b/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.h index 6f06d75a719..8156f4ccf5a 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttpost.h @@ -1,46 +1,46 @@ -/***************************************************************************/ -/* */ -/* ttpost.h */ -/* */ -/* Postcript name table processing for TrueType and OpenType fonts */ -/* (specification). */ -/* */ -/* Copyright 1996-2001, 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTPOST_H__ -#define __TTPOST_H__ - - -#include -#include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_TRUETYPE_TYPES_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - tt_face_get_ps_name( TT_Face face, - FT_UInt idx, - FT_String** PSname ); - - FT_LOCAL( void ) - tt_face_free_ps_names( TT_Face face ); - - -FT_END_HEADER - -#endif /* __TTPOST_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttpost.h */ +/* */ +/* Postcript name table processing for TrueType and OpenType fonts */ +/* (specification). */ +/* */ +/* Copyright 1996-2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTPOST_H__ +#define __TTPOST_H__ + + +#include +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + tt_face_get_ps_name( TT_Face face, + FT_UInt idx, + FT_String** PSname ); + + FT_LOCAL( void ) + tt_face_free_ps_names( TT_Face face ); + + +FT_END_HEADER + +#endif /* __TTPOST_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.c index eff49dadd9a..cc30127357c 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.c @@ -1,1501 +1,1501 @@ -/***************************************************************************/ -/* */ -/* ttsbit.c */ -/* */ -/* TrueType and OpenType embedded bitmap support (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H - - /* - * Alas, the memory-optimized sbit loader can't be used when implementing - * the `old internals' hack - */ -#if !defined FT_CONFIG_OPTION_OLD_INTERNALS - -#include "ttsbit0.c" - -#else /* !FT_CONFIG_OPTION_OLD_INTERNALS */ - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include "ttsbit.h" - -#include "sferrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttsbit - - - /*************************************************************************/ - /* */ - /* */ - /* blit_sbit */ - /* */ - /* */ - /* Blits a bitmap from an input stream into a given target. Supports */ - /* x and y offsets as well as byte padded lines. */ - /* */ - /* */ - /* target :: The target bitmap/pixmap. */ - /* */ - /* source :: The input packed bitmap data. */ - /* */ - /* line_bits :: The number of bits per line. */ - /* */ - /* byte_padded :: A flag which is true if lines are byte-padded. */ - /* */ - /* x_offset :: The horizontal offset. */ - /* */ - /* y_offset :: The vertical offset. */ - /* */ - /* */ - /* IMPORTANT: The x and y offsets are relative to the top corner of */ - /* the target bitmap (unlike the normal TrueType */ - /* convention). A positive y offset indicates a downwards */ - /* direction! */ - /* */ - static void - blit_sbit( FT_Bitmap* target, - FT_Byte* source, - FT_Int line_bits, - FT_Bool byte_padded, - FT_Int x_offset, - FT_Int y_offset ) - { - FT_Byte* line_buff; - FT_Int line_incr; - FT_Int height; - - FT_UShort acc; - FT_UInt loaded; - - - /* first of all, compute starting write position */ - line_incr = target->pitch; - line_buff = target->buffer; - - if ( line_incr < 0 ) - line_buff -= line_incr * ( target->rows - 1 ); - - line_buff += ( x_offset >> 3 ) + y_offset * line_incr; - - /***********************************************************************/ - /* */ - /* We use the extra-classic `accumulator' trick to extract the bits */ - /* from the source byte stream. */ - /* */ - /* Namely, the variable `acc' is a 16-bit accumulator containing the */ - /* last `loaded' bits from the input stream. The bits are shifted to */ - /* the upmost position in `acc'. */ - /* */ - /***********************************************************************/ - - acc = 0; /* clear accumulator */ - loaded = 0; /* no bits were loaded */ - - for ( height = target->rows; height > 0; height-- ) - { - FT_Byte* cur = line_buff; /* current write cursor */ - FT_Int count = line_bits; /* # of bits to extract per line */ - FT_Byte shift = (FT_Byte)( x_offset & 7 ); /* current write shift */ - FT_Byte space = (FT_Byte)( 8 - shift ); - - - /* first of all, read individual source bytes */ - if ( count >= 8 ) - { - count -= 8; - { - do - { - FT_Byte val; - - - /* ensure that there are at least 8 bits in the accumulator */ - if ( loaded < 8 ) - { - acc |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded )); - loaded += 8; - } - - /* now write one byte */ - val = (FT_Byte)( acc >> 8 ); - if ( shift ) - { - cur[0] |= (FT_Byte)( val >> shift ); - cur[1] |= (FT_Byte)( val << space ); - } - else - cur[0] |= val; - - cur++; - acc <<= 8; /* remove bits from accumulator */ - loaded -= 8; - count -= 8; - - } while ( count >= 0 ); - } - - /* restore `count' to correct value */ - count += 8; - } - - /* now write remaining bits (count < 8) */ - if ( count > 0 ) - { - FT_Byte val; - - - /* ensure that there are at least `count' bits in the accumulator */ - if ( (FT_Int)loaded < count ) - { - acc |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded )); - loaded += 8; - } - - /* now write remaining bits */ - val = (FT_Byte)( ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ) ); - cur[0] |= (FT_Byte)( val >> shift ); - - if ( count > space ) - cur[1] |= (FT_Byte)( val << space ); - - acc <<= count; - loaded -= count; - } - - /* now, skip to next line */ - if ( byte_padded ) - { - acc = 0; - loaded = 0; /* clear accumulator on byte-padded lines */ - } - - line_buff += line_incr; - } - } - - - static const FT_Frame_Field sbit_metrics_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_SBit_MetricsRec - - FT_FRAME_START( 8 ), - FT_FRAME_BYTE( height ), - FT_FRAME_BYTE( width ), - - FT_FRAME_CHAR( horiBearingX ), - FT_FRAME_CHAR( horiBearingY ), - FT_FRAME_BYTE( horiAdvance ), - - FT_FRAME_CHAR( vertBearingX ), - FT_FRAME_CHAR( vertBearingY ), - FT_FRAME_BYTE( vertAdvance ), - FT_FRAME_END - }; - - - /*************************************************************************/ - /* */ - /* */ - /* Load_SBit_Const_Metrics */ - /* */ - /* */ - /* Loads the metrics for `EBLC' index tables format 2 and 5. */ - /* */ - /* */ - /* range :: The target range. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Load_SBit_Const_Metrics( TT_SBit_Range range, - FT_Stream stream ) - { - FT_Error error; - - - if ( FT_READ_ULONG( range->image_size ) ) - return error; - - return FT_STREAM_READ_FIELDS( sbit_metrics_fields, &range->metrics ); - } - - - /*************************************************************************/ - /* */ - /* */ - /* Load_SBit_Range_Codes */ - /* */ - /* */ - /* Loads the range codes for `EBLC' index tables format 4 and 5. */ - /* */ - /* */ - /* range :: The target range. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* load_offsets :: A flag whether to load the glyph offset table. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Load_SBit_Range_Codes( TT_SBit_Range range, - FT_Stream stream, - FT_Bool load_offsets ) - { - FT_Error error; - FT_ULong count, n, size; - FT_Memory memory = stream->memory; - - - if ( FT_READ_ULONG( count ) ) - goto Exit; - - range->num_glyphs = count; - - /* Allocate glyph offsets table if needed */ - if ( load_offsets ) - { - if ( FT_NEW_ARRAY( range->glyph_offsets, count ) ) - goto Exit; - - size = count * 4L; - } - else - size = count * 2L; - - /* Allocate glyph codes table and access frame */ - if ( FT_NEW_ARRAY ( range->glyph_codes, count ) || - FT_FRAME_ENTER( size ) ) - goto Exit; - - for ( n = 0; n < count; n++ ) - { - range->glyph_codes[n] = FT_GET_USHORT(); - - if ( load_offsets ) - range->glyph_offsets[n] = (FT_ULong)range->image_offset + - FT_GET_USHORT(); - } - - FT_FRAME_EXIT(); - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Load_SBit_Range */ - /* */ - /* */ - /* Loads a given `EBLC' index/range table. */ - /* */ - /* */ - /* range :: The target range. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Load_SBit_Range( TT_SBit_Range range, - FT_Stream stream ) - { - FT_Error error; - FT_Memory memory = stream->memory; - - - switch( range->index_format ) - { - case 1: /* variable metrics with 4-byte offsets */ - case 3: /* variable metrics with 2-byte offsets */ - { - FT_ULong num_glyphs, n; - FT_Int size_elem; - FT_Bool large = FT_BOOL( range->index_format == 1 ); - - - - if ( range->last_glyph < range->first_glyph ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - num_glyphs = range->last_glyph - range->first_glyph + 1L; - range->num_glyphs = num_glyphs; - num_glyphs++; /* XXX: BEWARE - see spec */ - - size_elem = large ? 4 : 2; - - if ( FT_NEW_ARRAY( range->glyph_offsets, num_glyphs ) || - FT_FRAME_ENTER( num_glyphs * size_elem ) ) - goto Exit; - - for ( n = 0; n < num_glyphs; n++ ) - range->glyph_offsets[n] = (FT_ULong)( range->image_offset + - ( large ? FT_GET_ULONG() - : FT_GET_USHORT() ) ); - FT_FRAME_EXIT(); - } - break; - - case 2: /* all glyphs have identical metrics */ - error = Load_SBit_Const_Metrics( range, stream ); - break; - - case 4: - error = Load_SBit_Range_Codes( range, stream, 1 ); - break; - - case 5: - error = Load_SBit_Const_Metrics( range, stream ) || - Load_SBit_Range_Codes( range, stream, 0 ); - break; - - default: - error = SFNT_Err_Invalid_File_Format; - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_eblc */ - /* */ - /* */ - /* Loads the table of embedded bitmap sizes for this face. */ - /* */ - /* */ - /* face :: The target face object. */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_eblc( TT_Face face, - FT_Stream stream ) - { - FT_Error error = 0; - FT_Memory memory = stream->memory; - FT_Fixed version; - FT_ULong num_strikes; - FT_ULong table_base; - - static const FT_Frame_Field sbit_line_metrics_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_SBit_LineMetricsRec - - /* no FT_FRAME_START */ - FT_FRAME_CHAR( ascender ), - FT_FRAME_CHAR( descender ), - FT_FRAME_BYTE( max_width ), - - FT_FRAME_CHAR( caret_slope_numerator ), - FT_FRAME_CHAR( caret_slope_denominator ), - FT_FRAME_CHAR( caret_offset ), - - FT_FRAME_CHAR( min_origin_SB ), - FT_FRAME_CHAR( min_advance_SB ), - FT_FRAME_CHAR( max_before_BL ), - FT_FRAME_CHAR( min_after_BL ), - FT_FRAME_CHAR( pads[0] ), - FT_FRAME_CHAR( pads[1] ), - FT_FRAME_END - }; - - static const FT_Frame_Field strike_start_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_SBit_StrikeRec - - /* no FT_FRAME_START */ - FT_FRAME_ULONG( ranges_offset ), - FT_FRAME_SKIP_LONG, - FT_FRAME_ULONG( num_ranges ), - FT_FRAME_ULONG( color_ref ), - FT_FRAME_END - }; - - static const FT_Frame_Field strike_end_fields[] = - { - /* no FT_FRAME_START */ - FT_FRAME_USHORT( start_glyph ), - FT_FRAME_USHORT( end_glyph ), - FT_FRAME_BYTE ( x_ppem ), - FT_FRAME_BYTE ( y_ppem ), - FT_FRAME_BYTE ( bit_depth ), - FT_FRAME_CHAR ( flags ), - FT_FRAME_END - }; - - - face->num_sbit_strikes = 0; - - /* this table is optional */ - error = face->goto_table( face, TTAG_EBLC, stream, 0 ); - if ( error ) - error = face->goto_table( face, TTAG_bloc, stream, 0 ); - if ( error ) - goto Exit; - - table_base = FT_STREAM_POS(); - if ( FT_FRAME_ENTER( 8L ) ) - goto Exit; - - version = FT_GET_LONG(); - num_strikes = FT_GET_ULONG(); - - FT_FRAME_EXIT(); - - /* check version number and strike count */ - if ( version != 0x00020000L || - num_strikes >= 0x10000L ) - { - FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version!\n" )); - error = SFNT_Err_Invalid_File_Format; - - goto Exit; - } - - /* allocate the strikes table */ - if ( FT_NEW_ARRAY( face->sbit_strikes, num_strikes ) ) - goto Exit; - - face->num_sbit_strikes = num_strikes; - - /* now read each strike table separately */ - { - TT_SBit_Strike strike = face->sbit_strikes; - FT_ULong count = num_strikes; - - - if ( FT_FRAME_ENTER( 48L * num_strikes ) ) - goto Exit; - - while ( count > 0 ) - { - if ( FT_STREAM_READ_FIELDS( strike_start_fields, strike ) || - FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->hori ) || - FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->vert ) || - FT_STREAM_READ_FIELDS( strike_end_fields, strike ) ) - break; - - count--; - strike++; - } - - FT_FRAME_EXIT(); - } - - /* allocate the index ranges for each strike table */ - { - TT_SBit_Strike strike = face->sbit_strikes; - FT_ULong count = num_strikes; - - - while ( count > 0 ) - { - TT_SBit_Range range; - FT_ULong count2 = strike->num_ranges; - - - /* read each range */ - if ( FT_STREAM_SEEK( table_base + strike->ranges_offset ) || - FT_FRAME_ENTER( strike->num_ranges * 8L ) ) - goto Exit; - - if ( FT_NEW_ARRAY( strike->sbit_ranges, strike->num_ranges ) ) - goto Exit; - - range = strike->sbit_ranges; - while ( count2 > 0 ) - { - range->first_glyph = FT_GET_USHORT(); - range->last_glyph = FT_GET_USHORT(); - range->table_offset = table_base + strike->ranges_offset + - FT_GET_ULONG(); - count2--; - range++; - } - - FT_FRAME_EXIT(); - - /* Now, read each index table */ - count2 = strike->num_ranges; - range = strike->sbit_ranges; - while ( count2 > 0 ) - { - /* Read the header */ - if ( FT_STREAM_SEEK( range->table_offset ) || - FT_FRAME_ENTER( 8L ) ) - goto Exit; - - range->index_format = FT_GET_USHORT(); - range->image_format = FT_GET_USHORT(); - range->image_offset = FT_GET_ULONG(); - - FT_FRAME_EXIT(); - - error = Load_SBit_Range( range, stream ); - if ( error ) - goto Exit; - - count2--; - range++; - } - - count--; - strike++; - } - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_free_eblc */ - /* */ - /* */ - /* Releases the embedded bitmap tables. */ - /* */ - /* */ - /* face :: The target face object. */ - /* */ - FT_LOCAL_DEF( void ) - tt_face_free_eblc( TT_Face face ) - { - FT_Memory memory = face->root.memory; - TT_SBit_Strike strike = face->sbit_strikes; - TT_SBit_Strike strike_limit = strike + face->num_sbit_strikes; - - - if ( strike ) - { - for ( ; strike < strike_limit; strike++ ) - { - TT_SBit_Range range = strike->sbit_ranges; - TT_SBit_Range range_limit = range + strike->num_ranges; - - - if ( range ) - { - for ( ; range < range_limit; range++ ) - { - /* release the glyph offsets and codes tables */ - /* where appropriate */ - FT_FREE( range->glyph_offsets ); - FT_FREE( range->glyph_codes ); - } - } - FT_FREE( strike->sbit_ranges ); - strike->num_ranges = 0; - } - FT_FREE( face->sbit_strikes ); - } - face->num_sbit_strikes = 0; - } - - - FT_LOCAL_DEF( FT_Error ) - tt_face_set_sbit_strike( TT_Face face, - FT_Size_Request req, - FT_ULong* astrike_index ) - { - return FT_Match_Size( (FT_Face)face, req, 0, astrike_index ); - } - - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_strike_metrics( TT_Face face, - FT_ULong strike_index, - FT_Size_Metrics* metrics ) - { - TT_SBit_Strike strike; - - - if ( strike_index >= face->num_sbit_strikes ) - return SFNT_Err_Invalid_Argument; - - strike = face->sbit_strikes + strike_index; - - metrics->x_ppem = strike->x_ppem; - metrics->y_ppem = strike->y_ppem; - - metrics->ascender = strike->hori.ascender << 6; - metrics->descender = strike->hori.descender << 6; - - /* XXX: Is this correct? */ - metrics->max_advance = ( strike->hori.min_origin_SB + - strike->hori.max_width + - strike->hori.min_advance_SB ) << 6; - - metrics->height = metrics->ascender - metrics->descender; - - return SFNT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* find_sbit_range */ - /* */ - /* */ - /* Scans a given strike's ranges and return, for a given glyph */ - /* index, the corresponding sbit range, and `EBDT' offset. */ - /* */ - /* */ - /* glyph_index :: The glyph index. */ - /* */ - /* strike :: The source/current sbit strike. */ - /* */ - /* */ - /* arange :: The sbit range containing the glyph index. */ - /* */ - /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */ - /* */ - /* */ - /* FreeType error code. 0 means the glyph index was found. */ - /* */ - static FT_Error - find_sbit_range( FT_UInt glyph_index, - TT_SBit_Strike strike, - TT_SBit_Range *arange, - FT_ULong *aglyph_offset ) - { - TT_SBit_RangeRec *range, *range_limit; - - - /* check whether the glyph index is within this strike's */ - /* glyph range */ - if ( glyph_index < (FT_UInt)strike->start_glyph || - glyph_index > (FT_UInt)strike->end_glyph ) - goto Fail; - - /* scan all ranges in strike */ - range = strike->sbit_ranges; - range_limit = range + strike->num_ranges; - if ( !range ) - goto Fail; - - for ( ; range < range_limit; range++ ) - { - if ( glyph_index >= (FT_UInt)range->first_glyph && - glyph_index <= (FT_UInt)range->last_glyph ) - { - FT_UShort delta = (FT_UShort)( glyph_index - range->first_glyph ); - - - switch ( range->index_format ) - { - case 1: - case 3: - *aglyph_offset = range->glyph_offsets[delta]; - break; - - case 2: - *aglyph_offset = range->image_offset + - range->image_size * delta; - break; - - case 4: - case 5: - { - FT_ULong n; - - - for ( n = 0; n < range->num_glyphs; n++ ) - { - if ( (FT_UInt)range->glyph_codes[n] == glyph_index ) - { - if ( range->index_format == 4 ) - *aglyph_offset = range->glyph_offsets[n]; - else - *aglyph_offset = range->image_offset + - n * range->image_size; - goto Found; - } - } - } - - /* fall-through */ - default: - goto Fail; - } - - Found: - /* return successfully! */ - *arange = range; - return 0; - } - } - - Fail: - *arange = 0; - *aglyph_offset = 0; - - return SFNT_Err_Invalid_Argument; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_find_sbit_image */ - /* */ - /* */ - /* Checks whether an embedded bitmap (an `sbit') exists for a given */ - /* glyph, at a given strike. */ - /* */ - /* */ - /* face :: The target face object. */ - /* */ - /* glyph_index :: The glyph index. */ - /* */ - /* strike_index :: The current strike index. */ - /* */ - /* */ - /* arange :: The SBit range containing the glyph index. */ - /* */ - /* astrike :: The SBit strike containing the glyph index. */ - /* */ - /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */ - /* */ - /* */ - /* FreeType error code. 0 means success. Returns */ - /* SFNT_Err_Invalid_Argument if no sbit exists for the requested */ - /* glyph. */ - /* */ - FT_LOCAL( FT_Error ) - tt_find_sbit_image( TT_Face face, - FT_UInt glyph_index, - FT_ULong strike_index, - TT_SBit_Range *arange, - TT_SBit_Strike *astrike, - FT_ULong *aglyph_offset ) - { - FT_Error error; - TT_SBit_Strike strike; - - - if ( !face->sbit_strikes || - ( face->num_sbit_strikes <= strike_index ) ) - goto Fail; - - strike = &face->sbit_strikes[strike_index]; - - error = find_sbit_range( glyph_index, strike, - arange, aglyph_offset ); - if ( error ) - goto Fail; - - *astrike = strike; - - return SFNT_Err_Ok; - - Fail: - /* no embedded bitmap for this glyph in face */ - *arange = 0; - *astrike = 0; - *aglyph_offset = 0; - - return SFNT_Err_Invalid_Argument; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_load_sbit_metrics */ - /* */ - /* */ - /* Gets the big metrics for a given SBit. */ - /* */ - /* */ - /* stream :: The input stream. */ - /* */ - /* range :: The SBit range containing the glyph. */ - /* */ - /* */ - /* big_metrics :: A big SBit metrics structure for the glyph. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* The stream cursor must be positioned at the glyph's offset within */ - /* the `EBDT' table before the call. */ - /* */ - /* If the image format uses variable metrics, the stream cursor is */ - /* positioned just after the metrics header in the `EBDT' table on */ - /* function exit. */ - /* */ - FT_LOCAL( FT_Error ) - tt_load_sbit_metrics( FT_Stream stream, - TT_SBit_Range range, - TT_SBit_Metrics metrics ) - { - FT_Error error = SFNT_Err_Ok; - - - switch ( range->image_format ) - { - case 1: - case 2: - case 8: - /* variable small metrics */ - { - TT_SBit_SmallMetricsRec smetrics; - - static const FT_Frame_Field sbit_small_metrics_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_SBit_SmallMetricsRec - - FT_FRAME_START( 5 ), - FT_FRAME_BYTE( height ), - FT_FRAME_BYTE( width ), - FT_FRAME_CHAR( bearingX ), - FT_FRAME_CHAR( bearingY ), - FT_FRAME_BYTE( advance ), - FT_FRAME_END - }; - - - /* read small metrics */ - if ( FT_STREAM_READ_FIELDS( sbit_small_metrics_fields, &smetrics ) ) - goto Exit; - - /* convert it to a big metrics */ - metrics->height = smetrics.height; - metrics->width = smetrics.width; - metrics->horiBearingX = smetrics.bearingX; - metrics->horiBearingY = smetrics.bearingY; - metrics->horiAdvance = smetrics.advance; - - /* these metrics are made up at a higher level when */ - /* needed. */ - metrics->vertBearingX = 0; - metrics->vertBearingY = 0; - metrics->vertAdvance = 0; - } - break; - - case 6: - case 7: - case 9: - /* variable big metrics */ - if ( FT_STREAM_READ_FIELDS( sbit_metrics_fields, metrics ) ) - goto Exit; - break; - - case 5: - default: /* constant metrics */ - if ( range->index_format == 2 || range->index_format == 5 ) - *metrics = range->metrics; - else - return SFNT_Err_Invalid_File_Format; - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* crop_bitmap */ - /* */ - /* */ - /* Crops a bitmap to its tightest bounding box, and adjusts its */ - /* metrics. */ - /* */ - /* */ - /* map :: The bitmap. */ - /* */ - /* metrics :: The corresponding metrics structure. */ - /* */ - static void - crop_bitmap( FT_Bitmap* map, - TT_SBit_Metrics metrics ) - { - /***********************************************************************/ - /* */ - /* In this situation, some bounding boxes of embedded bitmaps are too */ - /* large. We need to crop it to a reasonable size. */ - /* */ - /* --------- */ - /* | | ----- */ - /* | *** | |***| */ - /* | * | | * | */ - /* | * | ------> | * | */ - /* | * | | * | */ - /* | * | | * | */ - /* | *** | |***| */ - /* --------- ----- */ - /* */ - /***********************************************************************/ - - FT_Int rows, count; - FT_Long line_len; - FT_Byte* line; - - - /***********************************************************************/ - /* */ - /* first of all, check the top-most lines of the bitmap, and remove */ - /* them if they're empty. */ - /* */ - { - line = (FT_Byte*)map->buffer; - rows = map->rows; - line_len = map->pitch; - - - for ( count = 0; count < rows; count++ ) - { - FT_Byte* cur = line; - FT_Byte* limit = line + line_len; - - - for ( ; cur < limit; cur++ ) - if ( cur[0] ) - goto Found_Top; - - /* the current line was empty - skip to next one */ - line = limit; - } - - Found_Top: - /* check that we have at least one filled line */ - if ( count >= rows ) - goto Empty_Bitmap; - - /* now, crop the empty upper lines */ - if ( count > 0 ) - { - line = (FT_Byte*)map->buffer; - - FT_MEM_MOVE( line, line + count * line_len, - ( rows - count ) * line_len ); - - metrics->height = (FT_Byte)( metrics->height - count ); - metrics->horiBearingY = (FT_Char)( metrics->horiBearingY - count ); - metrics->vertBearingY = (FT_Char)( metrics->vertBearingY - count ); - - map->rows -= count; - rows -= count; - } - } - - /***********************************************************************/ - /* */ - /* second, crop the lower lines */ - /* */ - { - line = (FT_Byte*)map->buffer + ( rows - 1 ) * line_len; - - for ( count = 0; count < rows; count++ ) - { - FT_Byte* cur = line; - FT_Byte* limit = line + line_len; - - - for ( ; cur < limit; cur++ ) - if ( cur[0] ) - goto Found_Bottom; - - /* the current line was empty - skip to previous one */ - line -= line_len; - } - - Found_Bottom: - if ( count > 0 ) - { - metrics->height = (FT_Byte)( metrics->height - count ); - rows -= count; - map->rows -= count; - } - } - - /***********************************************************************/ - /* */ - /* third, get rid of the space on the left side of the glyph */ - /* */ - do - { - FT_Byte* limit; - - - line = (FT_Byte*)map->buffer; - limit = line + rows * line_len; - - for ( ; line < limit; line += line_len ) - if ( line[0] & 0x80 ) - goto Found_Left; - - /* shift the whole glyph one pixel to the left */ - line = (FT_Byte*)map->buffer; - limit = line + rows * line_len; - - for ( ; line < limit; line += line_len ) - { - FT_Int n, width = map->width; - FT_Byte old; - FT_Byte* cur = line; - - - old = (FT_Byte)(cur[0] << 1); - for ( n = 8; n < width; n += 8 ) - { - FT_Byte val; - - - val = cur[1]; - cur[0] = (FT_Byte)( old | ( val >> 7 ) ); - old = (FT_Byte)( val << 1 ); - cur++; - } - cur[0] = old; - } - - map->width--; - metrics->horiBearingX++; - metrics->vertBearingX++; - metrics->width--; - - } while ( map->width > 0 ); - - Found_Left: - - /***********************************************************************/ - /* */ - /* finally, crop the bitmap width to get rid of the space on the right */ - /* side of the glyph. */ - /* */ - do - { - FT_Int right = map->width - 1; - FT_Byte* limit; - FT_Byte mask; - - - line = (FT_Byte*)map->buffer + ( right >> 3 ); - limit = line + rows * line_len; - mask = (FT_Byte)( 0x80 >> ( right & 7 ) ); - - for ( ; line < limit; line += line_len ) - if ( line[0] & mask ) - goto Found_Right; - - /* crop the whole glyph to the right */ - map->width--; - metrics->width--; - - } while ( map->width > 0 ); - - Found_Right: - /* all right, the bitmap was cropped */ - return; - - Empty_Bitmap: - map->width = 0; - map->rows = 0; - map->pitch = 0; - map->pixel_mode = FT_PIXEL_MODE_MONO; - } - - - static FT_Error - Load_SBit_Single( FT_Bitmap* map, - FT_Int x_offset, - FT_Int y_offset, - FT_Int pix_bits, - FT_UShort image_format, - TT_SBit_Metrics metrics, - FT_Stream stream ) - { - FT_Error error; - - - /* check that the source bitmap fits into the target pixmap */ - if ( x_offset < 0 || x_offset + metrics->width > map->width || - y_offset < 0 || y_offset + metrics->height > map->rows ) - { - error = SFNT_Err_Invalid_Argument; - - goto Exit; - } - - { - FT_Int glyph_width = metrics->width; - FT_Int glyph_height = metrics->height; - FT_Int glyph_size; - FT_Int line_bits = pix_bits * glyph_width; - FT_Bool pad_bytes = 0; - - - /* compute size of glyph image */ - switch ( image_format ) - { - case 1: /* byte-padded formats */ - case 6: - { - FT_Int line_length; - - - switch ( pix_bits ) - { - case 1: - line_length = ( glyph_width + 7 ) >> 3; - break; - case 2: - line_length = ( glyph_width + 3 ) >> 2; - break; - case 4: - line_length = ( glyph_width + 1 ) >> 1; - break; - default: - line_length = glyph_width; - } - - glyph_size = glyph_height * line_length; - pad_bytes = 1; - } - break; - - case 2: - case 5: - case 7: - line_bits = glyph_width * pix_bits; - glyph_size = ( glyph_height * line_bits + 7 ) >> 3; - break; - - default: /* invalid format */ - return SFNT_Err_Invalid_File_Format; - } - - /* Now read data and draw glyph into target pixmap */ - if ( FT_FRAME_ENTER( glyph_size ) ) - goto Exit; - - /* don't forget to multiply `x_offset' by `map->pix_bits' as */ - /* the sbit blitter doesn't make a difference between pixmap */ - /* depths. */ - blit_sbit( map, (FT_Byte*)stream->cursor, line_bits, pad_bytes, - x_offset * pix_bits, y_offset ); - - FT_FRAME_EXIT(); - } - - Exit: - return error; - } - - - static FT_Error - Load_SBit_Image( TT_SBit_Strike strike, - TT_SBit_Range range, - FT_ULong ebdt_pos, - FT_ULong glyph_offset, - FT_GlyphSlot slot, - FT_Int x_offset, - FT_Int y_offset, - FT_Stream stream, - TT_SBit_Metrics metrics, - FT_Int depth ) - { - FT_Memory memory = stream->memory; - FT_Bitmap* map = &slot->bitmap; - FT_Error error; - - - /* place stream at beginning of glyph data and read metrics */ - if ( FT_STREAM_SEEK( ebdt_pos + glyph_offset ) ) - goto Exit; - - error = tt_load_sbit_metrics( stream, range, metrics ); - if ( error ) - goto Exit; - - /* This function is recursive. At the top-level call, we */ - /* compute the dimensions of the higher-level glyph to */ - /* allocate the final pixmap buffer. */ - if ( depth == 0 ) - { - FT_Long size; - - - map->width = metrics->width; - map->rows = metrics->height; - - switch ( strike->bit_depth ) - { - case 1: - map->pixel_mode = FT_PIXEL_MODE_MONO; - map->pitch = ( map->width + 7 ) >> 3; - break; - - case 2: - map->pixel_mode = FT_PIXEL_MODE_GRAY2; - map->pitch = ( map->width + 3 ) >> 2; - break; - - case 4: - map->pixel_mode = FT_PIXEL_MODE_GRAY4; - map->pitch = ( map->width + 1 ) >> 1; - break; - - case 8: - map->pixel_mode = FT_PIXEL_MODE_GRAY; - map->pitch = map->width; - break; - - default: - return SFNT_Err_Invalid_File_Format; - } - - size = map->rows * map->pitch; - - /* check that there is no empty image */ - if ( size == 0 ) - goto Exit; /* exit successfully! */ - - error = ft_glyphslot_alloc_bitmap( slot, size ); - if (error) - goto Exit; - } - - switch ( range->image_format ) - { - case 1: /* single sbit image - load it */ - case 2: - case 5: - case 6: - case 7: - return Load_SBit_Single( map, x_offset, y_offset, strike->bit_depth, - range->image_format, metrics, stream ); - - case 8: /* compound format */ - FT_Stream_Skip( stream, 1L ); - /* fallthrough */ - - case 9: - break; - - default: /* invalid image format */ - return SFNT_Err_Invalid_File_Format; - } - - /* All right, we have a compound format. First of all, read */ - /* the array of elements. */ - { - TT_SBit_Component components; - TT_SBit_Component comp; - FT_UShort num_components, count; - - - if ( FT_READ_USHORT( num_components ) || - FT_NEW_ARRAY( components, num_components ) ) - goto Exit; - - count = num_components; - - if ( FT_FRAME_ENTER( 4L * num_components ) ) - goto Fail_Memory; - - for ( comp = components; count > 0; count--, comp++ ) - { - comp->glyph_code = FT_GET_USHORT(); - comp->x_offset = FT_GET_CHAR(); - comp->y_offset = FT_GET_CHAR(); - } - - FT_FRAME_EXIT(); - - /* Now recursively load each element glyph */ - count = num_components; - comp = components; - for ( ; count > 0; count--, comp++ ) - { - TT_SBit_Range elem_range; - TT_SBit_MetricsRec elem_metrics; - FT_ULong elem_offset; - - - /* find the range for this element */ - error = find_sbit_range( comp->glyph_code, - strike, - &elem_range, - &elem_offset ); - if ( error ) - goto Fail_Memory; - - /* now load the element, recursively */ - error = Load_SBit_Image( strike, - elem_range, - ebdt_pos, - elem_offset, - slot, - x_offset + comp->x_offset, - y_offset + comp->y_offset, - stream, - &elem_metrics, - depth + 1 ); - if ( error ) - goto Fail_Memory; - } - - Fail_Memory: - FT_FREE( components ); - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_sbit_image */ - /* */ - /* */ - /* Loads a given glyph sbit image from the font resource. This also */ - /* returns its metrics. */ - /* */ - /* */ - /* face :: The target face object. */ - /* */ - /* strike_index :: The current strike index. */ - /* */ - /* glyph_index :: The current glyph index. */ - /* */ - /* load_flags :: The glyph load flags (the code checks for the flag */ - /* FT_LOAD_CROP_BITMAP). */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* map :: The target pixmap. */ - /* */ - /* metrics :: A big sbit metrics structure for the glyph image. */ - /* */ - /* */ - /* FreeType error code. 0 means success. Returns an error if no */ - /* glyph sbit exists for the index. */ - /* */ - /* */ - /* The `map.buffer' field is always freed before the glyph is loaded. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_sbit_image( TT_Face face, - FT_ULong strike_index, - FT_UInt glyph_index, - FT_UInt load_flags, - FT_Stream stream, - FT_Bitmap *map, - TT_SBit_MetricsRec *metrics ) - { - FT_Error error; - FT_ULong ebdt_pos, glyph_offset; - - TT_SBit_Strike strike; - TT_SBit_Range range; - - - /* Check whether there is a glyph sbit for the current index */ - error = tt_find_sbit_image( face, glyph_index, strike_index, - &range, &strike, &glyph_offset ); - if ( error ) - goto Exit; - - /* now, find the location of the `EBDT' table in */ - /* the font file */ - error = face->goto_table( face, TTAG_EBDT, stream, 0 ); - if ( error ) - error = face->goto_table( face, TTAG_bdat, stream, 0 ); - if ( error ) - goto Exit; - - ebdt_pos = FT_STREAM_POS(); - - error = Load_SBit_Image( strike, range, ebdt_pos, glyph_offset, - face->root.glyph, 0, 0, stream, metrics, 0 ); - if ( error ) - goto Exit; - - /* setup vertical metrics if needed */ - if ( strike->flags & 1 ) - { - /* in case of a horizontal strike only */ - FT_Int advance; - - - advance = strike->hori.ascender - strike->hori.descender; - - /* some heuristic values */ - - metrics->vertBearingX = (FT_Char)(-metrics->width / 2 ); - metrics->vertBearingY = (FT_Char)( ( advance - metrics->height ) / 2 ); - metrics->vertAdvance = (FT_Char)( advance * 12 / 10 ); - } - - /* Crop the bitmap now, unless specified otherwise */ - if ( load_flags & FT_LOAD_CROP_BITMAP ) - crop_bitmap( map, metrics ); - - Exit: - return error; - } - -#endif /* !FT_CONFIG_OPTION_OLD_INTERNALS */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttsbit.c */ +/* */ +/* TrueType and OpenType embedded bitmap support (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H + + /* + * Alas, the memory-optimized sbit loader can't be used when implementing + * the `old internals' hack + */ +#if !defined FT_CONFIG_OPTION_OLD_INTERNALS + +#include "ttsbit0.c" + +#else /* !FT_CONFIG_OPTION_OLD_INTERNALS */ + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H +#include "ttsbit.h" + +#include "sferrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttsbit + + + /*************************************************************************/ + /* */ + /* */ + /* blit_sbit */ + /* */ + /* */ + /* Blits a bitmap from an input stream into a given target. Supports */ + /* x and y offsets as well as byte padded lines. */ + /* */ + /* */ + /* target :: The target bitmap/pixmap. */ + /* */ + /* source :: The input packed bitmap data. */ + /* */ + /* line_bits :: The number of bits per line. */ + /* */ + /* byte_padded :: A flag which is true if lines are byte-padded. */ + /* */ + /* x_offset :: The horizontal offset. */ + /* */ + /* y_offset :: The vertical offset. */ + /* */ + /* */ + /* IMPORTANT: The x and y offsets are relative to the top corner of */ + /* the target bitmap (unlike the normal TrueType */ + /* convention). A positive y offset indicates a downwards */ + /* direction! */ + /* */ + static void + blit_sbit( FT_Bitmap* target, + FT_Byte* source, + FT_Int line_bits, + FT_Bool byte_padded, + FT_Int x_offset, + FT_Int y_offset ) + { + FT_Byte* line_buff; + FT_Int line_incr; + FT_Int height; + + FT_UShort acc; + FT_UInt loaded; + + + /* first of all, compute starting write position */ + line_incr = target->pitch; + line_buff = target->buffer; + + if ( line_incr < 0 ) + line_buff -= line_incr * ( target->rows - 1 ); + + line_buff += ( x_offset >> 3 ) + y_offset * line_incr; + + /***********************************************************************/ + /* */ + /* We use the extra-classic `accumulator' trick to extract the bits */ + /* from the source byte stream. */ + /* */ + /* Namely, the variable `acc' is a 16-bit accumulator containing the */ + /* last `loaded' bits from the input stream. The bits are shifted to */ + /* the upmost position in `acc'. */ + /* */ + /***********************************************************************/ + + acc = 0; /* clear accumulator */ + loaded = 0; /* no bits were loaded */ + + for ( height = target->rows; height > 0; height-- ) + { + FT_Byte* cur = line_buff; /* current write cursor */ + FT_Int count = line_bits; /* # of bits to extract per line */ + FT_Byte shift = (FT_Byte)( x_offset & 7 ); /* current write shift */ + FT_Byte space = (FT_Byte)( 8 - shift ); + + + /* first of all, read individual source bytes */ + if ( count >= 8 ) + { + count -= 8; + { + do + { + FT_Byte val; + + + /* ensure that there are at least 8 bits in the accumulator */ + if ( loaded < 8 ) + { + acc |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded )); + loaded += 8; + } + + /* now write one byte */ + val = (FT_Byte)( acc >> 8 ); + if ( shift ) + { + cur[0] |= (FT_Byte)( val >> shift ); + cur[1] |= (FT_Byte)( val << space ); + } + else + cur[0] |= val; + + cur++; + acc <<= 8; /* remove bits from accumulator */ + loaded -= 8; + count -= 8; + + } while ( count >= 0 ); + } + + /* restore `count' to correct value */ + count += 8; + } + + /* now write remaining bits (count < 8) */ + if ( count > 0 ) + { + FT_Byte val; + + + /* ensure that there are at least `count' bits in the accumulator */ + if ( (FT_Int)loaded < count ) + { + acc |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded )); + loaded += 8; + } + + /* now write remaining bits */ + val = (FT_Byte)( ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ) ); + cur[0] |= (FT_Byte)( val >> shift ); + + if ( count > space ) + cur[1] |= (FT_Byte)( val << space ); + + acc <<= count; + loaded -= count; + } + + /* now, skip to next line */ + if ( byte_padded ) + { + acc = 0; + loaded = 0; /* clear accumulator on byte-padded lines */ + } + + line_buff += line_incr; + } + } + + + static const FT_Frame_Field sbit_metrics_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_SBit_MetricsRec + + FT_FRAME_START( 8 ), + FT_FRAME_BYTE( height ), + FT_FRAME_BYTE( width ), + + FT_FRAME_CHAR( horiBearingX ), + FT_FRAME_CHAR( horiBearingY ), + FT_FRAME_BYTE( horiAdvance ), + + FT_FRAME_CHAR( vertBearingX ), + FT_FRAME_CHAR( vertBearingY ), + FT_FRAME_BYTE( vertAdvance ), + FT_FRAME_END + }; + + + /*************************************************************************/ + /* */ + /* */ + /* Load_SBit_Const_Metrics */ + /* */ + /* */ + /* Loads the metrics for `EBLC' index tables format 2 and 5. */ + /* */ + /* */ + /* range :: The target range. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + Load_SBit_Const_Metrics( TT_SBit_Range range, + FT_Stream stream ) + { + FT_Error error; + + + if ( FT_READ_ULONG( range->image_size ) ) + return error; + + return FT_STREAM_READ_FIELDS( sbit_metrics_fields, &range->metrics ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* Load_SBit_Range_Codes */ + /* */ + /* */ + /* Loads the range codes for `EBLC' index tables format 4 and 5. */ + /* */ + /* */ + /* range :: The target range. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* load_offsets :: A flag whether to load the glyph offset table. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + Load_SBit_Range_Codes( TT_SBit_Range range, + FT_Stream stream, + FT_Bool load_offsets ) + { + FT_Error error; + FT_ULong count, n, size; + FT_Memory memory = stream->memory; + + + if ( FT_READ_ULONG( count ) ) + goto Exit; + + range->num_glyphs = count; + + /* Allocate glyph offsets table if needed */ + if ( load_offsets ) + { + if ( FT_NEW_ARRAY( range->glyph_offsets, count ) ) + goto Exit; + + size = count * 4L; + } + else + size = count * 2L; + + /* Allocate glyph codes table and access frame */ + if ( FT_NEW_ARRAY ( range->glyph_codes, count ) || + FT_FRAME_ENTER( size ) ) + goto Exit; + + for ( n = 0; n < count; n++ ) + { + range->glyph_codes[n] = FT_GET_USHORT(); + + if ( load_offsets ) + range->glyph_offsets[n] = (FT_ULong)range->image_offset + + FT_GET_USHORT(); + } + + FT_FRAME_EXIT(); + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Load_SBit_Range */ + /* */ + /* */ + /* Loads a given `EBLC' index/range table. */ + /* */ + /* */ + /* range :: The target range. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + Load_SBit_Range( TT_SBit_Range range, + FT_Stream stream ) + { + FT_Error error; + FT_Memory memory = stream->memory; + + + switch( range->index_format ) + { + case 1: /* variable metrics with 4-byte offsets */ + case 3: /* variable metrics with 2-byte offsets */ + { + FT_ULong num_glyphs, n; + FT_Int size_elem; + FT_Bool large = FT_BOOL( range->index_format == 1 ); + + + + if ( range->last_glyph < range->first_glyph ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + num_glyphs = range->last_glyph - range->first_glyph + 1L; + range->num_glyphs = num_glyphs; + num_glyphs++; /* XXX: BEWARE - see spec */ + + size_elem = large ? 4 : 2; + + if ( FT_NEW_ARRAY( range->glyph_offsets, num_glyphs ) || + FT_FRAME_ENTER( num_glyphs * size_elem ) ) + goto Exit; + + for ( n = 0; n < num_glyphs; n++ ) + range->glyph_offsets[n] = (FT_ULong)( range->image_offset + + ( large ? FT_GET_ULONG() + : FT_GET_USHORT() ) ); + FT_FRAME_EXIT(); + } + break; + + case 2: /* all glyphs have identical metrics */ + error = Load_SBit_Const_Metrics( range, stream ); + break; + + case 4: + error = Load_SBit_Range_Codes( range, stream, 1 ); + break; + + case 5: + error = Load_SBit_Const_Metrics( range, stream ) || + Load_SBit_Range_Codes( range, stream, 0 ); + break; + + default: + error = SFNT_Err_Invalid_File_Format; + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_eblc */ + /* */ + /* */ + /* Loads the table of embedded bitmap sizes for this face. */ + /* */ + /* */ + /* face :: The target face object. */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_eblc( TT_Face face, + FT_Stream stream ) + { + FT_Error error = 0; + FT_Memory memory = stream->memory; + FT_Fixed version; + FT_ULong num_strikes; + FT_ULong table_base; + + static const FT_Frame_Field sbit_line_metrics_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_SBit_LineMetricsRec + + /* no FT_FRAME_START */ + FT_FRAME_CHAR( ascender ), + FT_FRAME_CHAR( descender ), + FT_FRAME_BYTE( max_width ), + + FT_FRAME_CHAR( caret_slope_numerator ), + FT_FRAME_CHAR( caret_slope_denominator ), + FT_FRAME_CHAR( caret_offset ), + + FT_FRAME_CHAR( min_origin_SB ), + FT_FRAME_CHAR( min_advance_SB ), + FT_FRAME_CHAR( max_before_BL ), + FT_FRAME_CHAR( min_after_BL ), + FT_FRAME_CHAR( pads[0] ), + FT_FRAME_CHAR( pads[1] ), + FT_FRAME_END + }; + + static const FT_Frame_Field strike_start_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_SBit_StrikeRec + + /* no FT_FRAME_START */ + FT_FRAME_ULONG( ranges_offset ), + FT_FRAME_SKIP_LONG, + FT_FRAME_ULONG( num_ranges ), + FT_FRAME_ULONG( color_ref ), + FT_FRAME_END + }; + + static const FT_Frame_Field strike_end_fields[] = + { + /* no FT_FRAME_START */ + FT_FRAME_USHORT( start_glyph ), + FT_FRAME_USHORT( end_glyph ), + FT_FRAME_BYTE ( x_ppem ), + FT_FRAME_BYTE ( y_ppem ), + FT_FRAME_BYTE ( bit_depth ), + FT_FRAME_CHAR ( flags ), + FT_FRAME_END + }; + + + face->num_sbit_strikes = 0; + + /* this table is optional */ + error = face->goto_table( face, TTAG_EBLC, stream, 0 ); + if ( error ) + error = face->goto_table( face, TTAG_bloc, stream, 0 ); + if ( error ) + goto Exit; + + table_base = FT_STREAM_POS(); + if ( FT_FRAME_ENTER( 8L ) ) + goto Exit; + + version = FT_GET_LONG(); + num_strikes = FT_GET_ULONG(); + + FT_FRAME_EXIT(); + + /* check version number and strike count */ + if ( version != 0x00020000L || + num_strikes >= 0x10000L ) + { + FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version!\n" )); + error = SFNT_Err_Invalid_File_Format; + + goto Exit; + } + + /* allocate the strikes table */ + if ( FT_NEW_ARRAY( face->sbit_strikes, num_strikes ) ) + goto Exit; + + face->num_sbit_strikes = num_strikes; + + /* now read each strike table separately */ + { + TT_SBit_Strike strike = face->sbit_strikes; + FT_ULong count = num_strikes; + + + if ( FT_FRAME_ENTER( 48L * num_strikes ) ) + goto Exit; + + while ( count > 0 ) + { + if ( FT_STREAM_READ_FIELDS( strike_start_fields, strike ) || + FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->hori ) || + FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->vert ) || + FT_STREAM_READ_FIELDS( strike_end_fields, strike ) ) + break; + + count--; + strike++; + } + + FT_FRAME_EXIT(); + } + + /* allocate the index ranges for each strike table */ + { + TT_SBit_Strike strike = face->sbit_strikes; + FT_ULong count = num_strikes; + + + while ( count > 0 ) + { + TT_SBit_Range range; + FT_ULong count2 = strike->num_ranges; + + + /* read each range */ + if ( FT_STREAM_SEEK( table_base + strike->ranges_offset ) || + FT_FRAME_ENTER( strike->num_ranges * 8L ) ) + goto Exit; + + if ( FT_NEW_ARRAY( strike->sbit_ranges, strike->num_ranges ) ) + goto Exit; + + range = strike->sbit_ranges; + while ( count2 > 0 ) + { + range->first_glyph = FT_GET_USHORT(); + range->last_glyph = FT_GET_USHORT(); + range->table_offset = table_base + strike->ranges_offset + + FT_GET_ULONG(); + count2--; + range++; + } + + FT_FRAME_EXIT(); + + /* Now, read each index table */ + count2 = strike->num_ranges; + range = strike->sbit_ranges; + while ( count2 > 0 ) + { + /* Read the header */ + if ( FT_STREAM_SEEK( range->table_offset ) || + FT_FRAME_ENTER( 8L ) ) + goto Exit; + + range->index_format = FT_GET_USHORT(); + range->image_format = FT_GET_USHORT(); + range->image_offset = FT_GET_ULONG(); + + FT_FRAME_EXIT(); + + error = Load_SBit_Range( range, stream ); + if ( error ) + goto Exit; + + count2--; + range++; + } + + count--; + strike++; + } + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_free_eblc */ + /* */ + /* */ + /* Releases the embedded bitmap tables. */ + /* */ + /* */ + /* face :: The target face object. */ + /* */ + FT_LOCAL_DEF( void ) + tt_face_free_eblc( TT_Face face ) + { + FT_Memory memory = face->root.memory; + TT_SBit_Strike strike = face->sbit_strikes; + TT_SBit_Strike strike_limit = strike + face->num_sbit_strikes; + + + if ( strike ) + { + for ( ; strike < strike_limit; strike++ ) + { + TT_SBit_Range range = strike->sbit_ranges; + TT_SBit_Range range_limit = range + strike->num_ranges; + + + if ( range ) + { + for ( ; range < range_limit; range++ ) + { + /* release the glyph offsets and codes tables */ + /* where appropriate */ + FT_FREE( range->glyph_offsets ); + FT_FREE( range->glyph_codes ); + } + } + FT_FREE( strike->sbit_ranges ); + strike->num_ranges = 0; + } + FT_FREE( face->sbit_strikes ); + } + face->num_sbit_strikes = 0; + } + + + FT_LOCAL_DEF( FT_Error ) + tt_face_set_sbit_strike( TT_Face face, + FT_Size_Request req, + FT_ULong* astrike_index ) + { + return FT_Match_Size( (FT_Face)face, req, 0, astrike_index ); + } + + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_strike_metrics( TT_Face face, + FT_ULong strike_index, + FT_Size_Metrics* metrics ) + { + TT_SBit_Strike strike; + + + if ( strike_index >= face->num_sbit_strikes ) + return SFNT_Err_Invalid_Argument; + + strike = face->sbit_strikes + strike_index; + + metrics->x_ppem = strike->x_ppem; + metrics->y_ppem = strike->y_ppem; + + metrics->ascender = strike->hori.ascender << 6; + metrics->descender = strike->hori.descender << 6; + + /* XXX: Is this correct? */ + metrics->max_advance = ( strike->hori.min_origin_SB + + strike->hori.max_width + + strike->hori.min_advance_SB ) << 6; + + metrics->height = metrics->ascender - metrics->descender; + + return SFNT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* find_sbit_range */ + /* */ + /* */ + /* Scans a given strike's ranges and return, for a given glyph */ + /* index, the corresponding sbit range, and `EBDT' offset. */ + /* */ + /* */ + /* glyph_index :: The glyph index. */ + /* */ + /* strike :: The source/current sbit strike. */ + /* */ + /* */ + /* arange :: The sbit range containing the glyph index. */ + /* */ + /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */ + /* */ + /* */ + /* FreeType error code. 0 means the glyph index was found. */ + /* */ + static FT_Error + find_sbit_range( FT_UInt glyph_index, + TT_SBit_Strike strike, + TT_SBit_Range *arange, + FT_ULong *aglyph_offset ) + { + TT_SBit_RangeRec *range, *range_limit; + + + /* check whether the glyph index is within this strike's */ + /* glyph range */ + if ( glyph_index < (FT_UInt)strike->start_glyph || + glyph_index > (FT_UInt)strike->end_glyph ) + goto Fail; + + /* scan all ranges in strike */ + range = strike->sbit_ranges; + range_limit = range + strike->num_ranges; + if ( !range ) + goto Fail; + + for ( ; range < range_limit; range++ ) + { + if ( glyph_index >= (FT_UInt)range->first_glyph && + glyph_index <= (FT_UInt)range->last_glyph ) + { + FT_UShort delta = (FT_UShort)( glyph_index - range->first_glyph ); + + + switch ( range->index_format ) + { + case 1: + case 3: + *aglyph_offset = range->glyph_offsets[delta]; + break; + + case 2: + *aglyph_offset = range->image_offset + + range->image_size * delta; + break; + + case 4: + case 5: + { + FT_ULong n; + + + for ( n = 0; n < range->num_glyphs; n++ ) + { + if ( (FT_UInt)range->glyph_codes[n] == glyph_index ) + { + if ( range->index_format == 4 ) + *aglyph_offset = range->glyph_offsets[n]; + else + *aglyph_offset = range->image_offset + + n * range->image_size; + goto Found; + } + } + } + + /* fall-through */ + default: + goto Fail; + } + + Found: + /* return successfully! */ + *arange = range; + return 0; + } + } + + Fail: + *arange = 0; + *aglyph_offset = 0; + + return SFNT_Err_Invalid_Argument; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_find_sbit_image */ + /* */ + /* */ + /* Checks whether an embedded bitmap (an `sbit') exists for a given */ + /* glyph, at a given strike. */ + /* */ + /* */ + /* face :: The target face object. */ + /* */ + /* glyph_index :: The glyph index. */ + /* */ + /* strike_index :: The current strike index. */ + /* */ + /* */ + /* arange :: The SBit range containing the glyph index. */ + /* */ + /* astrike :: The SBit strike containing the glyph index. */ + /* */ + /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */ + /* */ + /* */ + /* FreeType error code. 0 means success. Returns */ + /* SFNT_Err_Invalid_Argument if no sbit exists for the requested */ + /* glyph. */ + /* */ + FT_LOCAL( FT_Error ) + tt_find_sbit_image( TT_Face face, + FT_UInt glyph_index, + FT_ULong strike_index, + TT_SBit_Range *arange, + TT_SBit_Strike *astrike, + FT_ULong *aglyph_offset ) + { + FT_Error error; + TT_SBit_Strike strike; + + + if ( !face->sbit_strikes || + ( face->num_sbit_strikes <= strike_index ) ) + goto Fail; + + strike = &face->sbit_strikes[strike_index]; + + error = find_sbit_range( glyph_index, strike, + arange, aglyph_offset ); + if ( error ) + goto Fail; + + *astrike = strike; + + return SFNT_Err_Ok; + + Fail: + /* no embedded bitmap for this glyph in face */ + *arange = 0; + *astrike = 0; + *aglyph_offset = 0; + + return SFNT_Err_Invalid_Argument; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_load_sbit_metrics */ + /* */ + /* */ + /* Gets the big metrics for a given SBit. */ + /* */ + /* */ + /* stream :: The input stream. */ + /* */ + /* range :: The SBit range containing the glyph. */ + /* */ + /* */ + /* big_metrics :: A big SBit metrics structure for the glyph. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* The stream cursor must be positioned at the glyph's offset within */ + /* the `EBDT' table before the call. */ + /* */ + /* If the image format uses variable metrics, the stream cursor is */ + /* positioned just after the metrics header in the `EBDT' table on */ + /* function exit. */ + /* */ + FT_LOCAL( FT_Error ) + tt_load_sbit_metrics( FT_Stream stream, + TT_SBit_Range range, + TT_SBit_Metrics metrics ) + { + FT_Error error = SFNT_Err_Ok; + + + switch ( range->image_format ) + { + case 1: + case 2: + case 8: + /* variable small metrics */ + { + TT_SBit_SmallMetricsRec smetrics; + + static const FT_Frame_Field sbit_small_metrics_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_SBit_SmallMetricsRec + + FT_FRAME_START( 5 ), + FT_FRAME_BYTE( height ), + FT_FRAME_BYTE( width ), + FT_FRAME_CHAR( bearingX ), + FT_FRAME_CHAR( bearingY ), + FT_FRAME_BYTE( advance ), + FT_FRAME_END + }; + + + /* read small metrics */ + if ( FT_STREAM_READ_FIELDS( sbit_small_metrics_fields, &smetrics ) ) + goto Exit; + + /* convert it to a big metrics */ + metrics->height = smetrics.height; + metrics->width = smetrics.width; + metrics->horiBearingX = smetrics.bearingX; + metrics->horiBearingY = smetrics.bearingY; + metrics->horiAdvance = smetrics.advance; + + /* these metrics are made up at a higher level when */ + /* needed. */ + metrics->vertBearingX = 0; + metrics->vertBearingY = 0; + metrics->vertAdvance = 0; + } + break; + + case 6: + case 7: + case 9: + /* variable big metrics */ + if ( FT_STREAM_READ_FIELDS( sbit_metrics_fields, metrics ) ) + goto Exit; + break; + + case 5: + default: /* constant metrics */ + if ( range->index_format == 2 || range->index_format == 5 ) + *metrics = range->metrics; + else + return SFNT_Err_Invalid_File_Format; + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* crop_bitmap */ + /* */ + /* */ + /* Crops a bitmap to its tightest bounding box, and adjusts its */ + /* metrics. */ + /* */ + /* */ + /* map :: The bitmap. */ + /* */ + /* metrics :: The corresponding metrics structure. */ + /* */ + static void + crop_bitmap( FT_Bitmap* map, + TT_SBit_Metrics metrics ) + { + /***********************************************************************/ + /* */ + /* In this situation, some bounding boxes of embedded bitmaps are too */ + /* large. We need to crop it to a reasonable size. */ + /* */ + /* --------- */ + /* | | ----- */ + /* | *** | |***| */ + /* | * | | * | */ + /* | * | ------> | * | */ + /* | * | | * | */ + /* | * | | * | */ + /* | *** | |***| */ + /* --------- ----- */ + /* */ + /***********************************************************************/ + + FT_Int rows, count; + FT_Long line_len; + FT_Byte* line; + + + /***********************************************************************/ + /* */ + /* first of all, check the top-most lines of the bitmap, and remove */ + /* them if they're empty. */ + /* */ + { + line = (FT_Byte*)map->buffer; + rows = map->rows; + line_len = map->pitch; + + + for ( count = 0; count < rows; count++ ) + { + FT_Byte* cur = line; + FT_Byte* limit = line + line_len; + + + for ( ; cur < limit; cur++ ) + if ( cur[0] ) + goto Found_Top; + + /* the current line was empty - skip to next one */ + line = limit; + } + + Found_Top: + /* check that we have at least one filled line */ + if ( count >= rows ) + goto Empty_Bitmap; + + /* now, crop the empty upper lines */ + if ( count > 0 ) + { + line = (FT_Byte*)map->buffer; + + FT_MEM_MOVE( line, line + count * line_len, + ( rows - count ) * line_len ); + + metrics->height = (FT_Byte)( metrics->height - count ); + metrics->horiBearingY = (FT_Char)( metrics->horiBearingY - count ); + metrics->vertBearingY = (FT_Char)( metrics->vertBearingY - count ); + + map->rows -= count; + rows -= count; + } + } + + /***********************************************************************/ + /* */ + /* second, crop the lower lines */ + /* */ + { + line = (FT_Byte*)map->buffer + ( rows - 1 ) * line_len; + + for ( count = 0; count < rows; count++ ) + { + FT_Byte* cur = line; + FT_Byte* limit = line + line_len; + + + for ( ; cur < limit; cur++ ) + if ( cur[0] ) + goto Found_Bottom; + + /* the current line was empty - skip to previous one */ + line -= line_len; + } + + Found_Bottom: + if ( count > 0 ) + { + metrics->height = (FT_Byte)( metrics->height - count ); + rows -= count; + map->rows -= count; + } + } + + /***********************************************************************/ + /* */ + /* third, get rid of the space on the left side of the glyph */ + /* */ + do + { + FT_Byte* limit; + + + line = (FT_Byte*)map->buffer; + limit = line + rows * line_len; + + for ( ; line < limit; line += line_len ) + if ( line[0] & 0x80 ) + goto Found_Left; + + /* shift the whole glyph one pixel to the left */ + line = (FT_Byte*)map->buffer; + limit = line + rows * line_len; + + for ( ; line < limit; line += line_len ) + { + FT_Int n, width = map->width; + FT_Byte old; + FT_Byte* cur = line; + + + old = (FT_Byte)(cur[0] << 1); + for ( n = 8; n < width; n += 8 ) + { + FT_Byte val; + + + val = cur[1]; + cur[0] = (FT_Byte)( old | ( val >> 7 ) ); + old = (FT_Byte)( val << 1 ); + cur++; + } + cur[0] = old; + } + + map->width--; + metrics->horiBearingX++; + metrics->vertBearingX++; + metrics->width--; + + } while ( map->width > 0 ); + + Found_Left: + + /***********************************************************************/ + /* */ + /* finally, crop the bitmap width to get rid of the space on the right */ + /* side of the glyph. */ + /* */ + do + { + FT_Int right = map->width - 1; + FT_Byte* limit; + FT_Byte mask; + + + line = (FT_Byte*)map->buffer + ( right >> 3 ); + limit = line + rows * line_len; + mask = (FT_Byte)( 0x80 >> ( right & 7 ) ); + + for ( ; line < limit; line += line_len ) + if ( line[0] & mask ) + goto Found_Right; + + /* crop the whole glyph to the right */ + map->width--; + metrics->width--; + + } while ( map->width > 0 ); + + Found_Right: + /* all right, the bitmap was cropped */ + return; + + Empty_Bitmap: + map->width = 0; + map->rows = 0; + map->pitch = 0; + map->pixel_mode = FT_PIXEL_MODE_MONO; + } + + + static FT_Error + Load_SBit_Single( FT_Bitmap* map, + FT_Int x_offset, + FT_Int y_offset, + FT_Int pix_bits, + FT_UShort image_format, + TT_SBit_Metrics metrics, + FT_Stream stream ) + { + FT_Error error; + + + /* check that the source bitmap fits into the target pixmap */ + if ( x_offset < 0 || x_offset + metrics->width > map->width || + y_offset < 0 || y_offset + metrics->height > map->rows ) + { + error = SFNT_Err_Invalid_Argument; + + goto Exit; + } + + { + FT_Int glyph_width = metrics->width; + FT_Int glyph_height = metrics->height; + FT_Int glyph_size; + FT_Int line_bits = pix_bits * glyph_width; + FT_Bool pad_bytes = 0; + + + /* compute size of glyph image */ + switch ( image_format ) + { + case 1: /* byte-padded formats */ + case 6: + { + FT_Int line_length; + + + switch ( pix_bits ) + { + case 1: + line_length = ( glyph_width + 7 ) >> 3; + break; + case 2: + line_length = ( glyph_width + 3 ) >> 2; + break; + case 4: + line_length = ( glyph_width + 1 ) >> 1; + break; + default: + line_length = glyph_width; + } + + glyph_size = glyph_height * line_length; + pad_bytes = 1; + } + break; + + case 2: + case 5: + case 7: + line_bits = glyph_width * pix_bits; + glyph_size = ( glyph_height * line_bits + 7 ) >> 3; + break; + + default: /* invalid format */ + return SFNT_Err_Invalid_File_Format; + } + + /* Now read data and draw glyph into target pixmap */ + if ( FT_FRAME_ENTER( glyph_size ) ) + goto Exit; + + /* don't forget to multiply `x_offset' by `map->pix_bits' as */ + /* the sbit blitter doesn't make a difference between pixmap */ + /* depths. */ + blit_sbit( map, (FT_Byte*)stream->cursor, line_bits, pad_bytes, + x_offset * pix_bits, y_offset ); + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + + + static FT_Error + Load_SBit_Image( TT_SBit_Strike strike, + TT_SBit_Range range, + FT_ULong ebdt_pos, + FT_ULong glyph_offset, + FT_GlyphSlot slot, + FT_Int x_offset, + FT_Int y_offset, + FT_Stream stream, + TT_SBit_Metrics metrics, + FT_Int depth ) + { + FT_Memory memory = stream->memory; + FT_Bitmap* map = &slot->bitmap; + FT_Error error; + + + /* place stream at beginning of glyph data and read metrics */ + if ( FT_STREAM_SEEK( ebdt_pos + glyph_offset ) ) + goto Exit; + + error = tt_load_sbit_metrics( stream, range, metrics ); + if ( error ) + goto Exit; + + /* This function is recursive. At the top-level call, we */ + /* compute the dimensions of the higher-level glyph to */ + /* allocate the final pixmap buffer. */ + if ( depth == 0 ) + { + FT_Long size; + + + map->width = metrics->width; + map->rows = metrics->height; + + switch ( strike->bit_depth ) + { + case 1: + map->pixel_mode = FT_PIXEL_MODE_MONO; + map->pitch = ( map->width + 7 ) >> 3; + break; + + case 2: + map->pixel_mode = FT_PIXEL_MODE_GRAY2; + map->pitch = ( map->width + 3 ) >> 2; + break; + + case 4: + map->pixel_mode = FT_PIXEL_MODE_GRAY4; + map->pitch = ( map->width + 1 ) >> 1; + break; + + case 8: + map->pixel_mode = FT_PIXEL_MODE_GRAY; + map->pitch = map->width; + break; + + default: + return SFNT_Err_Invalid_File_Format; + } + + size = map->rows * map->pitch; + + /* check that there is no empty image */ + if ( size == 0 ) + goto Exit; /* exit successfully! */ + + error = ft_glyphslot_alloc_bitmap( slot, size ); + if (error) + goto Exit; + } + + switch ( range->image_format ) + { + case 1: /* single sbit image - load it */ + case 2: + case 5: + case 6: + case 7: + return Load_SBit_Single( map, x_offset, y_offset, strike->bit_depth, + range->image_format, metrics, stream ); + + case 8: /* compound format */ + FT_Stream_Skip( stream, 1L ); + /* fallthrough */ + + case 9: + break; + + default: /* invalid image format */ + return SFNT_Err_Invalid_File_Format; + } + + /* All right, we have a compound format. First of all, read */ + /* the array of elements. */ + { + TT_SBit_Component components; + TT_SBit_Component comp; + FT_UShort num_components, count; + + + if ( FT_READ_USHORT( num_components ) || + FT_NEW_ARRAY( components, num_components ) ) + goto Exit; + + count = num_components; + + if ( FT_FRAME_ENTER( 4L * num_components ) ) + goto Fail_Memory; + + for ( comp = components; count > 0; count--, comp++ ) + { + comp->glyph_code = FT_GET_USHORT(); + comp->x_offset = FT_GET_CHAR(); + comp->y_offset = FT_GET_CHAR(); + } + + FT_FRAME_EXIT(); + + /* Now recursively load each element glyph */ + count = num_components; + comp = components; + for ( ; count > 0; count--, comp++ ) + { + TT_SBit_Range elem_range; + TT_SBit_MetricsRec elem_metrics; + FT_ULong elem_offset; + + + /* find the range for this element */ + error = find_sbit_range( comp->glyph_code, + strike, + &elem_range, + &elem_offset ); + if ( error ) + goto Fail_Memory; + + /* now load the element, recursively */ + error = Load_SBit_Image( strike, + elem_range, + ebdt_pos, + elem_offset, + slot, + x_offset + comp->x_offset, + y_offset + comp->y_offset, + stream, + &elem_metrics, + depth + 1 ); + if ( error ) + goto Fail_Memory; + } + + Fail_Memory: + FT_FREE( components ); + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_sbit_image */ + /* */ + /* */ + /* Loads a given glyph sbit image from the font resource. This also */ + /* returns its metrics. */ + /* */ + /* */ + /* face :: The target face object. */ + /* */ + /* strike_index :: The current strike index. */ + /* */ + /* glyph_index :: The current glyph index. */ + /* */ + /* load_flags :: The glyph load flags (the code checks for the flag */ + /* FT_LOAD_CROP_BITMAP). */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* map :: The target pixmap. */ + /* */ + /* metrics :: A big sbit metrics structure for the glyph image. */ + /* */ + /* */ + /* FreeType error code. 0 means success. Returns an error if no */ + /* glyph sbit exists for the index. */ + /* */ + /* */ + /* The `map.buffer' field is always freed before the glyph is loaded. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_sbit_image( TT_Face face, + FT_ULong strike_index, + FT_UInt glyph_index, + FT_UInt load_flags, + FT_Stream stream, + FT_Bitmap *map, + TT_SBit_MetricsRec *metrics ) + { + FT_Error error; + FT_ULong ebdt_pos, glyph_offset; + + TT_SBit_Strike strike; + TT_SBit_Range range; + + + /* Check whether there is a glyph sbit for the current index */ + error = tt_find_sbit_image( face, glyph_index, strike_index, + &range, &strike, &glyph_offset ); + if ( error ) + goto Exit; + + /* now, find the location of the `EBDT' table in */ + /* the font file */ + error = face->goto_table( face, TTAG_EBDT, stream, 0 ); + if ( error ) + error = face->goto_table( face, TTAG_bdat, stream, 0 ); + if ( error ) + goto Exit; + + ebdt_pos = FT_STREAM_POS(); + + error = Load_SBit_Image( strike, range, ebdt_pos, glyph_offset, + face->root.glyph, 0, 0, stream, metrics, 0 ); + if ( error ) + goto Exit; + + /* setup vertical metrics if needed */ + if ( strike->flags & 1 ) + { + /* in case of a horizontal strike only */ + FT_Int advance; + + + advance = strike->hori.ascender - strike->hori.descender; + + /* some heuristic values */ + + metrics->vertBearingX = (FT_Char)(-metrics->width / 2 ); + metrics->vertBearingY = (FT_Char)( ( advance - metrics->height ) / 2 ); + metrics->vertAdvance = (FT_Char)( advance * 12 / 10 ); + } + + /* Crop the bitmap now, unless specified otherwise */ + if ( load_flags & FT_LOAD_CROP_BITMAP ) + crop_bitmap( map, metrics ); + + Exit: + return error; + } + +#endif /* !FT_CONFIG_OPTION_OLD_INTERNALS */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.h b/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.h index c6067c0e3e6..f14b2913462 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.h +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit.h @@ -1,79 +1,79 @@ -/***************************************************************************/ -/* */ -/* ttsbit.h */ -/* */ -/* TrueType and OpenType embedded bitmap support (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTSBIT_H__ -#define __TTSBIT_H__ - - -#include -#include "ttload.h" - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - tt_face_load_eblc( TT_Face face, - FT_Stream stream ); - - FT_LOCAL( void ) - tt_face_free_eblc( TT_Face face ); - - - FT_LOCAL( FT_Error ) - tt_face_set_sbit_strike( TT_Face face, - FT_Size_Request req, - FT_ULong* astrike_index ); - - FT_LOCAL( FT_Error ) - tt_face_load_strike_metrics( TT_Face face, - FT_ULong strike_index, - FT_Size_Metrics* metrics ); - -#if defined FT_CONFIG_OPTION_OLD_INTERNALS - FT_LOCAL( FT_Error ) - tt_find_sbit_image( TT_Face face, - FT_UInt glyph_index, - FT_ULong strike_index, - TT_SBit_Range *arange, - TT_SBit_Strike *astrike, - FT_ULong *aglyph_offset ); - - FT_LOCAL( FT_Error ) - tt_load_sbit_metrics( FT_Stream stream, - TT_SBit_Range range, - TT_SBit_Metrics metrics ); - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - FT_LOCAL( FT_Error ) - tt_face_load_sbit_image( TT_Face face, - FT_ULong strike_index, - FT_UInt glyph_index, - FT_UInt load_flags, - FT_Stream stream, - FT_Bitmap *map, - TT_SBit_MetricsRec *metrics ); - - -FT_END_HEADER - -#endif /* __TTSBIT_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttsbit.h */ +/* */ +/* TrueType and OpenType embedded bitmap support (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTSBIT_H__ +#define __TTSBIT_H__ + + +#include +#include "ttload.h" + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + tt_face_load_eblc( TT_Face face, + FT_Stream stream ); + + FT_LOCAL( void ) + tt_face_free_eblc( TT_Face face ); + + + FT_LOCAL( FT_Error ) + tt_face_set_sbit_strike( TT_Face face, + FT_Size_Request req, + FT_ULong* astrike_index ); + + FT_LOCAL( FT_Error ) + tt_face_load_strike_metrics( TT_Face face, + FT_ULong strike_index, + FT_Size_Metrics* metrics ); + +#if defined FT_CONFIG_OPTION_OLD_INTERNALS + FT_LOCAL( FT_Error ) + tt_find_sbit_image( TT_Face face, + FT_UInt glyph_index, + FT_ULong strike_index, + TT_SBit_Range *arange, + TT_SBit_Strike *astrike, + FT_ULong *aglyph_offset ); + + FT_LOCAL( FT_Error ) + tt_load_sbit_metrics( FT_Stream stream, + TT_SBit_Range range, + TT_SBit_Metrics metrics ); + +#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ + + FT_LOCAL( FT_Error ) + tt_face_load_sbit_image( TT_Face face, + FT_ULong strike_index, + FT_UInt glyph_index, + FT_UInt load_flags, + FT_Stream stream, + FT_Bitmap *map, + TT_SBit_MetricsRec *metrics ); + + +FT_END_HEADER + +#endif /* __TTSBIT_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit0.c b/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit0.c index f8adc64a735..593a42819c7 100644 --- a/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit0.c +++ b/reactos/dll/3rdparty/freetype/src/sfnt/ttsbit0.c @@ -1,996 +1,996 @@ -/***************************************************************************/ -/* */ -/* ttsbit0.c */ -/* */ -/* TrueType and OpenType embedded bitmap support (body). */ -/* This is a heap-optimized version. */ -/* */ -/* Copyright 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -/* This file is included by ttsbit.c */ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include "ttsbit.h" - -#include "sferrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttsbit - - - static const FT_Frame_Field tt_sbit_line_metrics_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_SBit_LineMetricsRec - - /* no FT_FRAME_START */ - FT_FRAME_CHAR( ascender ), - FT_FRAME_CHAR( descender ), - FT_FRAME_BYTE( max_width ), - - FT_FRAME_CHAR( caret_slope_numerator ), - FT_FRAME_CHAR( caret_slope_denominator ), - FT_FRAME_CHAR( caret_offset ), - - FT_FRAME_CHAR( min_origin_SB ), - FT_FRAME_CHAR( min_advance_SB ), - FT_FRAME_CHAR( max_before_BL ), - FT_FRAME_CHAR( min_after_BL ), - FT_FRAME_CHAR( pads[0] ), - FT_FRAME_CHAR( pads[1] ), - FT_FRAME_END - }; - - static const FT_Frame_Field tt_strike_start_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE TT_SBit_StrikeRec - - /* no FT_FRAME_START */ - FT_FRAME_ULONG( ranges_offset ), - FT_FRAME_SKIP_LONG, - FT_FRAME_ULONG( num_ranges ), - FT_FRAME_ULONG( color_ref ), - FT_FRAME_END - }; - - static const FT_Frame_Field tt_strike_end_fields[] = - { - /* no FT_FRAME_START */ - FT_FRAME_USHORT( start_glyph ), - FT_FRAME_USHORT( end_glyph ), - FT_FRAME_BYTE ( x_ppem ), - FT_FRAME_BYTE ( y_ppem ), - FT_FRAME_BYTE ( bit_depth ), - FT_FRAME_CHAR ( flags ), - FT_FRAME_END - }; - - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_eblc( TT_Face face, - FT_Stream stream ) - { - FT_Error error = SFNT_Err_Ok; - FT_Fixed version; - FT_ULong num_strikes, table_size; - FT_Byte* p; - FT_Byte* p_limit; - FT_UInt count; - - - face->sbit_num_strikes = 0; - - /* this table is optional */ - error = face->goto_table( face, TTAG_EBLC, stream, &table_size ); - if ( error ) - error = face->goto_table( face, TTAG_bloc, stream, &table_size ); - if ( error ) - goto Exit; - - if ( table_size < 8 ) - { - FT_ERROR(( "%s: table too short!\n", "tt_face_load_sbit_strikes" )); - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) ) - goto Exit; - - face->sbit_table_size = table_size; - - p = face->sbit_table; - p_limit = p + table_size; - - version = FT_NEXT_ULONG( p ); - num_strikes = FT_NEXT_ULONG( p ); - - if ( version != 0x00020000UL || num_strikes >= 0x10000UL ) - { - FT_ERROR(( "%s: invalid table version!\n", - "tt_face_load_sbit_strikes" )); - error = SFNT_Err_Invalid_File_Format; - goto Fail; - } - - /* - * Count the number of strikes available in the table. We are a bit - * paranoid there and don't trust the data. - */ - count = (FT_UInt)num_strikes; - if ( 8 + 48UL * count > table_size ) - count = (FT_UInt)( ( p_limit - p ) / 48 ); - - face->sbit_num_strikes = count; - - FT_TRACE3(( "sbit_num_strikes: %u\n", count )); - Exit: - return error; - - Fail: - FT_FRAME_RELEASE( face->sbit_table ); - face->sbit_table_size = 0; - goto Exit; - } - - - FT_LOCAL_DEF( void ) - tt_face_free_eblc( TT_Face face ) - { - FT_Stream stream = face->root.stream; - - - FT_FRAME_RELEASE( face->sbit_table ); - face->sbit_table_size = 0; - face->sbit_num_strikes = 0; - } - - - FT_LOCAL_DEF( FT_Error ) - tt_face_set_sbit_strike( TT_Face face, - FT_Size_Request req, - FT_ULong* astrike_index ) - { - return FT_Match_Size( (FT_Face)face, req, 0, astrike_index ); - } - - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_strike_metrics( TT_Face face, - FT_ULong strike_index, - FT_Size_Metrics* metrics ) - { - FT_Byte* strike; - - - if ( strike_index >= (FT_ULong)face->sbit_num_strikes ) - return SFNT_Err_Invalid_Argument; - - strike = face->sbit_table + 8 + strike_index * 48; - - metrics->x_ppem = (FT_UShort)strike[44]; - metrics->y_ppem = (FT_UShort)strike[45]; - - metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */ - metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */ - metrics->height = metrics->ascender - metrics->descender; - - /* XXX: Is this correct? */ - metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */ - strike[18] + /* max_width */ - (FT_Char)strike[23] /* min_advance_SB */ - ) << 6; - - return SFNT_Err_Ok; - } - - - typedef struct - { - TT_Face face; - FT_Stream stream; - FT_Bitmap* bitmap; - TT_SBit_Metrics metrics; - FT_Bool metrics_loaded; - FT_Bool bitmap_allocated; - FT_Byte bit_depth; - - FT_ULong ebdt_start; - FT_ULong ebdt_size; - - FT_ULong strike_index_array; - FT_ULong strike_index_count; - FT_Byte* eblc_base; - FT_Byte* eblc_limit; - - } TT_SBitDecoderRec, *TT_SBitDecoder; - - - static FT_Error - tt_sbit_decoder_init( TT_SBitDecoder decoder, - TT_Face face, - FT_ULong strike_index, - TT_SBit_MetricsRec* metrics ) - { - FT_Error error; - FT_Stream stream = face->root.stream; - FT_ULong ebdt_size; - - - error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size ); - if ( error ) - error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size ); - if ( error ) - goto Exit; - - decoder->face = face; - decoder->stream = stream; - decoder->bitmap = &face->root.glyph->bitmap; - decoder->metrics = metrics; - - decoder->metrics_loaded = 0; - decoder->bitmap_allocated = 0; - - decoder->ebdt_start = FT_STREAM_POS(); - decoder->ebdt_size = ebdt_size; - - decoder->eblc_base = face->sbit_table; - decoder->eblc_limit = face->sbit_table + face->sbit_table_size; - - /* now find the strike corresponding to the index */ - { - FT_Byte* p; - - - if ( 8 + 48 * strike_index + 3 * 4 + 34 + 1 > face->sbit_table_size ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - p = decoder->eblc_base + 8 + 48 * strike_index; - - decoder->strike_index_array = FT_NEXT_ULONG( p ); - p += 4; - decoder->strike_index_count = FT_NEXT_ULONG( p ); - p += 34; - decoder->bit_depth = *p; - - if ( decoder->strike_index_array > face->sbit_table_size || - decoder->strike_index_array + 8 * decoder->strike_index_count > - face->sbit_table_size ) - error = SFNT_Err_Invalid_File_Format; - } - - Exit: - return error; - } - - - static void - tt_sbit_decoder_done( TT_SBitDecoder decoder ) - { - FT_UNUSED( decoder ); - } - - - static FT_Error - tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder decoder ) - { - FT_Error error = SFNT_Err_Ok; - FT_UInt width, height; - FT_Bitmap* map = decoder->bitmap; - FT_Long size; - - - if ( !decoder->metrics_loaded ) - { - error = SFNT_Err_Invalid_Argument; - goto Exit; - } - - width = decoder->metrics->width; - height = decoder->metrics->height; - - map->width = (int)width; - map->rows = (int)height; - - switch ( decoder->bit_depth ) - { - case 1: - map->pixel_mode = FT_PIXEL_MODE_MONO; - map->pitch = ( map->width + 7 ) >> 3; - break; - - case 2: - map->pixel_mode = FT_PIXEL_MODE_GRAY2; - map->pitch = ( map->width + 3 ) >> 2; - break; - - case 4: - map->pixel_mode = FT_PIXEL_MODE_GRAY4; - map->pitch = ( map->width + 1 ) >> 1; - break; - - case 8: - map->pixel_mode = FT_PIXEL_MODE_GRAY; - map->pitch = map->width; - break; - - default: - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - size = map->rows * map->pitch; - - /* check that there is no empty image */ - if ( size == 0 ) - goto Exit; /* exit successfully! */ - - error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size ); - if ( error ) - goto Exit; - - decoder->bitmap_allocated = 1; - - Exit: - return error; - } - - - static FT_Error - tt_sbit_decoder_load_metrics( TT_SBitDecoder decoder, - FT_Byte* *pp, - FT_Byte* limit, - FT_Bool big ) - { - FT_Byte* p = *pp; - TT_SBit_Metrics metrics = decoder->metrics; - - - if ( p + 5 > limit ) - goto Fail; - - if ( !decoder->metrics_loaded ) - { - metrics->height = p[0]; - metrics->width = p[1]; - metrics->horiBearingX = (FT_Char)p[2]; - metrics->horiBearingY = (FT_Char)p[3]; - metrics->horiAdvance = p[4]; - } - - p += 5; - if ( big ) - { - if ( p + 3 > limit ) - goto Fail; - - if ( !decoder->metrics_loaded ) - { - metrics->vertBearingX = (FT_Char)p[0]; - metrics->vertBearingY = (FT_Char)p[1]; - metrics->vertAdvance = p[2]; - } - - p += 3; - } - - decoder->metrics_loaded = 1; - *pp = p; - return 0; - - Fail: - return SFNT_Err_Invalid_Argument; - } - - - /* forward declaration */ - static FT_Error - tt_sbit_decoder_load_image( TT_SBitDecoder decoder, - FT_UInt glyph_index, - FT_Int x_pos, - FT_Int y_pos ); - - typedef FT_Error (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder decoder, - FT_Byte* p, - FT_Byte* plimit, - FT_Int x_pos, - FT_Int y_pos ); - - - static FT_Error - tt_sbit_decoder_load_byte_aligned( TT_SBitDecoder decoder, - FT_Byte* p, - FT_Byte* limit, - FT_Int x_pos, - FT_Int y_pos ) - { - FT_Error error = SFNT_Err_Ok; - FT_Byte* line; - FT_Int bit_height, bit_width, pitch, width, height, h; - FT_Bitmap* bitmap; - - - if ( !decoder->bitmap_allocated ) - { - error = tt_sbit_decoder_alloc_bitmap( decoder ); - if ( error ) - goto Exit; - } - - /* check that we can write the glyph into the bitmap */ - bitmap = decoder->bitmap; - bit_width = bitmap->width; - bit_height = bitmap->rows; - pitch = bitmap->pitch; - line = bitmap->buffer; - - width = decoder->metrics->width; - height = decoder->metrics->height; - - if ( x_pos < 0 || x_pos + width > bit_width || - y_pos < 0 || y_pos + height > bit_height ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - if ( p + ( ( width + 7 ) >> 3 ) * height > limit ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - /* now do the blit */ - line += y_pos * pitch + ( x_pos >> 3 ); - x_pos &= 7; - - if ( x_pos == 0 ) /* the easy one */ - { - for ( h = height; h > 0; h--, line += pitch ) - { - FT_Byte* write = line; - FT_Int w; - - - for ( w = width; w >= 8; w -= 8 ) - { - write[0] = (FT_Byte)( write[0] | *p++ ); - write += 1; - } - - if ( w > 0 ) - write[0] = (FT_Byte)( write[0] | ( *p++ & ( 0xFF00U >> w ) ) ); - } - } - else /* x_pos > 0 */ - { - for ( h = height; h > 0; h--, line += pitch ) - { - FT_Byte* write = line; - FT_Int w; - FT_UInt wval = 0; - - - for ( w = width; w >= 8; w -= 8 ) - { - wval = (FT_UInt)( wval | *p++ ); - write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) ); - write += 1; - wval <<= 8; - } - - if ( w > 0 ) - wval = (FT_UInt)( wval | ( *p++ & ( 0xFF00U >> w ) ) ); - - /* all bits read and there are ( x_pos + w ) bits to be written */ - - write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) ); - - if ( x_pos + w > 8 ) - { - write++; - wval <<= 8; - write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) ); - } - } - } - - Exit: - return error; - } - - - static FT_Error - tt_sbit_decoder_load_bit_aligned( TT_SBitDecoder decoder, - FT_Byte* p, - FT_Byte* limit, - FT_Int x_pos, - FT_Int y_pos ) - { - FT_Error error = SFNT_Err_Ok; - FT_Byte* line; - FT_Int bit_height, bit_width, pitch, width, height, h, nbits; - FT_Bitmap* bitmap; - FT_UShort rval; - - - if ( !decoder->bitmap_allocated ) - { - error = tt_sbit_decoder_alloc_bitmap( decoder ); - if ( error ) - goto Exit; - } - - /* check that we can write the glyph into the bitmap */ - bitmap = decoder->bitmap; - bit_width = bitmap->width; - bit_height = bitmap->rows; - pitch = bitmap->pitch; - line = bitmap->buffer; - - width = decoder->metrics->width; - height = decoder->metrics->height; - - if ( x_pos < 0 || x_pos + width > bit_width || - y_pos < 0 || y_pos + height > bit_height ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - if ( p + ( ( width * height + 7 ) >> 3 ) > limit ) - { - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - /* now do the blit */ - line += y_pos * pitch + ( x_pos >> 3 ); - x_pos &= 7; - - /* the higher byte of `rval' is used as a buffer */ - rval = 0; - nbits = 0; - - for ( h = height; h > 0; h--, line += pitch ) - { - FT_Byte* write = line; - FT_Int w = width; - - - if ( x_pos ) - { - w = ( width < 8 - x_pos ) ? width : 8 - x_pos; - - if ( nbits < w ) - { - rval |= *p++; - nbits += 8 - w; - } - else - { - rval >>= 8; - nbits -= w; - } - - *write++ |= ( ( rval >> nbits ) & 0xFF ) & ~( 0xFF << w ); - rval <<= 8; - - w = width - w; - } - - for ( ; w >= 8; w -= 8 ) - { - rval |= *p++; - *write++ |= ( rval >> nbits ) & 0xFF; - - rval <<= 8; - } - - if ( w > 0 ) - { - if ( nbits < w ) - { - rval |= *p++; - *write |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w ); - nbits += 8 - w; - - rval <<= 8; - } - else - { - *write |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w ); - nbits -= w; - } - } - } - - Exit: - return error; - } - - - static FT_Error - tt_sbit_decoder_load_compound( TT_SBitDecoder decoder, - FT_Byte* p, - FT_Byte* limit, - FT_Int x_pos, - FT_Int y_pos ) - { - FT_Error error = SFNT_Err_Ok; - FT_UInt num_components, nn; - - - if ( p + 2 > limit ) - goto Fail; - - num_components = FT_NEXT_USHORT( p ); - if ( p + 4 * num_components > limit ) - goto Fail; - - for ( nn = 0; nn < num_components; nn++ ) - { - FT_UInt gindex = FT_NEXT_USHORT( p ); - FT_Byte dx = FT_NEXT_BYTE( p ); - FT_Byte dy = FT_NEXT_BYTE( p ); - - - /* NB: a recursive call */ - error = tt_sbit_decoder_load_image( decoder, gindex, - x_pos + dx, y_pos + dy ); - if ( error ) - break; - } - - Exit: - return error; - - Fail: - error = SFNT_Err_Invalid_File_Format; - goto Exit; - } - - - static FT_Error - tt_sbit_decoder_load_bitmap( TT_SBitDecoder decoder, - FT_UInt glyph_format, - FT_ULong glyph_start, - FT_ULong glyph_size, - FT_Int x_pos, - FT_Int y_pos ) - { - FT_Error error; - FT_Stream stream = decoder->stream; - FT_Byte* p; - FT_Byte* p_limit; - FT_Byte* data; - - - /* seek into the EBDT table now */ - if ( glyph_start + glyph_size > decoder->ebdt_size ) - { - error = SFNT_Err_Invalid_Argument; - goto Exit; - } - - if ( FT_STREAM_SEEK( decoder->ebdt_start + glyph_start ) || - FT_FRAME_EXTRACT( glyph_size, data ) ) - goto Exit; - - p = data; - p_limit = p + glyph_size; - - /* read the data, depending on the glyph format */ - switch ( glyph_format ) - { - case 1: - case 2: - case 8: - error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 0 ); - break; - - case 6: - case 7: - case 9: - error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ); - break; - - default: - error = SFNT_Err_Ok; - } - - if ( error ) - goto Fail; - - { - TT_SBitDecoder_LoadFunc loader; - - - switch ( glyph_format ) - { - case 1: - case 6: - loader = tt_sbit_decoder_load_byte_aligned; - break; - - case 2: - case 5: - case 7: - loader = tt_sbit_decoder_load_bit_aligned; - break; - - case 8: - if ( p + 1 > p_limit ) - goto Fail; - - p += 1; /* skip padding */ - /* fall-through */ - - case 9: - loader = tt_sbit_decoder_load_compound; - break; - - default: - goto Fail; - } - - error = loader( decoder, p, p_limit, x_pos, y_pos ); - } - - Fail: - FT_FRAME_RELEASE( data ); - - Exit: - return error; - } - - - static FT_Error - tt_sbit_decoder_load_image( TT_SBitDecoder decoder, - FT_UInt glyph_index, - FT_Int x_pos, - FT_Int y_pos ) - { - /* - * First, we find the correct strike range that applies to this - * glyph index. - */ - - FT_Byte* p = decoder->eblc_base + decoder->strike_index_array; - FT_Byte* p_limit = decoder->eblc_limit; - FT_ULong num_ranges = decoder->strike_index_count; - FT_UInt start, end, index_format, image_format; - FT_ULong image_start = 0, image_end = 0, image_offset; - - - for ( ; num_ranges > 0; num_ranges-- ) - { - start = FT_NEXT_USHORT( p ); - end = FT_NEXT_USHORT( p ); - - if ( glyph_index >= start && glyph_index <= end ) - goto FoundRange; - - p += 4; /* ignore index offset */ - } - goto NoBitmap; - - FoundRange: - image_offset = FT_NEXT_ULONG( p ); - - /* overflow check */ - if ( decoder->eblc_base + decoder->strike_index_array + image_offset < - decoder->eblc_base ) - goto Failure; - - p = decoder->eblc_base + decoder->strike_index_array + image_offset; - if ( p + 8 > p_limit ) - goto NoBitmap; - - /* now find the glyph's location and extend within the ebdt table */ - index_format = FT_NEXT_USHORT( p ); - image_format = FT_NEXT_USHORT( p ); - image_offset = FT_NEXT_ULONG ( p ); - - switch ( index_format ) - { - case 1: /* 4-byte offsets relative to `image_offset' */ - { - p += 4 * ( glyph_index - start ); - if ( p + 8 > p_limit ) - goto NoBitmap; - - image_start = FT_NEXT_ULONG( p ); - image_end = FT_NEXT_ULONG( p ); - - if ( image_start == image_end ) /* missing glyph */ - goto NoBitmap; - } - break; - - case 2: /* big metrics, constant image size */ - { - FT_ULong image_size; - - - if ( p + 12 > p_limit ) - goto NoBitmap; - - image_size = FT_NEXT_ULONG( p ); - - if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) ) - goto NoBitmap; - - image_start = image_size * ( glyph_index - start ); - image_end = image_start + image_size; - } - break; - - case 3: /* 2-byte offsets relative to 'image_offset' */ - { - p += 2 * ( glyph_index - start ); - if ( p + 4 > p_limit ) - goto NoBitmap; - - image_start = FT_NEXT_USHORT( p ); - image_end = FT_NEXT_USHORT( p ); - - if ( image_start == image_end ) /* missing glyph */ - goto NoBitmap; - } - break; - - case 4: /* sparse glyph array with (glyph,offset) pairs */ - { - FT_ULong mm, num_glyphs; - - - if ( p + 4 > p_limit ) - goto NoBitmap; - - num_glyphs = FT_NEXT_ULONG( p ); - - /* overflow check */ - if ( p + ( num_glyphs + 1 ) * 4 < p ) - goto Failure; - - if ( p + ( num_glyphs + 1 ) * 4 > p_limit ) - goto NoBitmap; - - for ( mm = 0; mm < num_glyphs; mm++ ) - { - FT_UInt gindex = FT_NEXT_USHORT( p ); - - - if ( gindex == glyph_index ) - { - image_start = FT_NEXT_USHORT( p ); - p += 2; - image_end = FT_PEEK_USHORT( p ); - break; - } - p += 2; - } - - if ( mm >= num_glyphs ) - goto NoBitmap; - } - break; - - case 5: /* constant metrics with sparse glyph codes */ - { - FT_ULong image_size, mm, num_glyphs; - - - if ( p + 16 > p_limit ) - goto NoBitmap; - - image_size = FT_NEXT_ULONG( p ); - - if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) ) - goto NoBitmap; - - num_glyphs = FT_NEXT_ULONG( p ); - - /* overflow check */ - if ( p + 2 * num_glyphs < p ) - goto Failure; - - if ( p + 2 * num_glyphs > p_limit ) - goto NoBitmap; - - for ( mm = 0; mm < num_glyphs; mm++ ) - { - FT_UInt gindex = FT_NEXT_USHORT( p ); - - - if ( gindex == glyph_index ) - break; - } - - if ( mm >= num_glyphs ) - goto NoBitmap; - - image_start = image_size * mm; - image_end = image_start + image_size; - } - break; - - default: - goto NoBitmap; - } - - if ( image_start > image_end ) - goto NoBitmap; - - image_end -= image_start; - image_start = image_offset + image_start; - - return tt_sbit_decoder_load_bitmap( decoder, - image_format, - image_start, - image_end, - x_pos, - y_pos ); - - Failure: - return SFNT_Err_Invalid_Table; - - NoBitmap: - return SFNT_Err_Invalid_Argument; - } - - - FT_LOCAL( FT_Error ) - tt_face_load_sbit_image( TT_Face face, - FT_ULong strike_index, - FT_UInt glyph_index, - FT_UInt load_flags, - FT_Stream stream, - FT_Bitmap *map, - TT_SBit_MetricsRec *metrics ) - { - TT_SBitDecoderRec decoder[1]; - FT_Error error; - - FT_UNUSED( load_flags ); - FT_UNUSED( stream ); - FT_UNUSED( map ); - - - error = tt_sbit_decoder_init( decoder, face, strike_index, metrics ); - if ( !error ) - { - error = tt_sbit_decoder_load_image( decoder, glyph_index, 0, 0 ); - tt_sbit_decoder_done( decoder ); - } - - return error; - } - -/* EOF */ +/***************************************************************************/ +/* */ +/* ttsbit0.c */ +/* */ +/* TrueType and OpenType embedded bitmap support (body). */ +/* This is a heap-optimized version. */ +/* */ +/* Copyright 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +/* This file is included by ttsbit.c */ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H +#include "ttsbit.h" + +#include "sferrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttsbit + + + static const FT_Frame_Field tt_sbit_line_metrics_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_SBit_LineMetricsRec + + /* no FT_FRAME_START */ + FT_FRAME_CHAR( ascender ), + FT_FRAME_CHAR( descender ), + FT_FRAME_BYTE( max_width ), + + FT_FRAME_CHAR( caret_slope_numerator ), + FT_FRAME_CHAR( caret_slope_denominator ), + FT_FRAME_CHAR( caret_offset ), + + FT_FRAME_CHAR( min_origin_SB ), + FT_FRAME_CHAR( min_advance_SB ), + FT_FRAME_CHAR( max_before_BL ), + FT_FRAME_CHAR( min_after_BL ), + FT_FRAME_CHAR( pads[0] ), + FT_FRAME_CHAR( pads[1] ), + FT_FRAME_END + }; + + static const FT_Frame_Field tt_strike_start_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE TT_SBit_StrikeRec + + /* no FT_FRAME_START */ + FT_FRAME_ULONG( ranges_offset ), + FT_FRAME_SKIP_LONG, + FT_FRAME_ULONG( num_ranges ), + FT_FRAME_ULONG( color_ref ), + FT_FRAME_END + }; + + static const FT_Frame_Field tt_strike_end_fields[] = + { + /* no FT_FRAME_START */ + FT_FRAME_USHORT( start_glyph ), + FT_FRAME_USHORT( end_glyph ), + FT_FRAME_BYTE ( x_ppem ), + FT_FRAME_BYTE ( y_ppem ), + FT_FRAME_BYTE ( bit_depth ), + FT_FRAME_CHAR ( flags ), + FT_FRAME_END + }; + + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_eblc( TT_Face face, + FT_Stream stream ) + { + FT_Error error = SFNT_Err_Ok; + FT_Fixed version; + FT_ULong num_strikes, table_size; + FT_Byte* p; + FT_Byte* p_limit; + FT_UInt count; + + + face->sbit_num_strikes = 0; + + /* this table is optional */ + error = face->goto_table( face, TTAG_EBLC, stream, &table_size ); + if ( error ) + error = face->goto_table( face, TTAG_bloc, stream, &table_size ); + if ( error ) + goto Exit; + + if ( table_size < 8 ) + { + FT_ERROR(( "%s: table too short!\n", "tt_face_load_sbit_strikes" )); + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) ) + goto Exit; + + face->sbit_table_size = table_size; + + p = face->sbit_table; + p_limit = p + table_size; + + version = FT_NEXT_ULONG( p ); + num_strikes = FT_NEXT_ULONG( p ); + + if ( version != 0x00020000UL || num_strikes >= 0x10000UL ) + { + FT_ERROR(( "%s: invalid table version!\n", + "tt_face_load_sbit_strikes" )); + error = SFNT_Err_Invalid_File_Format; + goto Fail; + } + + /* + * Count the number of strikes available in the table. We are a bit + * paranoid there and don't trust the data. + */ + count = (FT_UInt)num_strikes; + if ( 8 + 48UL * count > table_size ) + count = (FT_UInt)( ( p_limit - p ) / 48 ); + + face->sbit_num_strikes = count; + + FT_TRACE3(( "sbit_num_strikes: %u\n", count )); + Exit: + return error; + + Fail: + FT_FRAME_RELEASE( face->sbit_table ); + face->sbit_table_size = 0; + goto Exit; + } + + + FT_LOCAL_DEF( void ) + tt_face_free_eblc( TT_Face face ) + { + FT_Stream stream = face->root.stream; + + + FT_FRAME_RELEASE( face->sbit_table ); + face->sbit_table_size = 0; + face->sbit_num_strikes = 0; + } + + + FT_LOCAL_DEF( FT_Error ) + tt_face_set_sbit_strike( TT_Face face, + FT_Size_Request req, + FT_ULong* astrike_index ) + { + return FT_Match_Size( (FT_Face)face, req, 0, astrike_index ); + } + + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_strike_metrics( TT_Face face, + FT_ULong strike_index, + FT_Size_Metrics* metrics ) + { + FT_Byte* strike; + + + if ( strike_index >= (FT_ULong)face->sbit_num_strikes ) + return SFNT_Err_Invalid_Argument; + + strike = face->sbit_table + 8 + strike_index * 48; + + metrics->x_ppem = (FT_UShort)strike[44]; + metrics->y_ppem = (FT_UShort)strike[45]; + + metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */ + metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */ + metrics->height = metrics->ascender - metrics->descender; + + /* XXX: Is this correct? */ + metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */ + strike[18] + /* max_width */ + (FT_Char)strike[23] /* min_advance_SB */ + ) << 6; + + return SFNT_Err_Ok; + } + + + typedef struct + { + TT_Face face; + FT_Stream stream; + FT_Bitmap* bitmap; + TT_SBit_Metrics metrics; + FT_Bool metrics_loaded; + FT_Bool bitmap_allocated; + FT_Byte bit_depth; + + FT_ULong ebdt_start; + FT_ULong ebdt_size; + + FT_ULong strike_index_array; + FT_ULong strike_index_count; + FT_Byte* eblc_base; + FT_Byte* eblc_limit; + + } TT_SBitDecoderRec, *TT_SBitDecoder; + + + static FT_Error + tt_sbit_decoder_init( TT_SBitDecoder decoder, + TT_Face face, + FT_ULong strike_index, + TT_SBit_MetricsRec* metrics ) + { + FT_Error error; + FT_Stream stream = face->root.stream; + FT_ULong ebdt_size; + + + error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size ); + if ( error ) + error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size ); + if ( error ) + goto Exit; + + decoder->face = face; + decoder->stream = stream; + decoder->bitmap = &face->root.glyph->bitmap; + decoder->metrics = metrics; + + decoder->metrics_loaded = 0; + decoder->bitmap_allocated = 0; + + decoder->ebdt_start = FT_STREAM_POS(); + decoder->ebdt_size = ebdt_size; + + decoder->eblc_base = face->sbit_table; + decoder->eblc_limit = face->sbit_table + face->sbit_table_size; + + /* now find the strike corresponding to the index */ + { + FT_Byte* p; + + + if ( 8 + 48 * strike_index + 3 * 4 + 34 + 1 > face->sbit_table_size ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + p = decoder->eblc_base + 8 + 48 * strike_index; + + decoder->strike_index_array = FT_NEXT_ULONG( p ); + p += 4; + decoder->strike_index_count = FT_NEXT_ULONG( p ); + p += 34; + decoder->bit_depth = *p; + + if ( decoder->strike_index_array > face->sbit_table_size || + decoder->strike_index_array + 8 * decoder->strike_index_count > + face->sbit_table_size ) + error = SFNT_Err_Invalid_File_Format; + } + + Exit: + return error; + } + + + static void + tt_sbit_decoder_done( TT_SBitDecoder decoder ) + { + FT_UNUSED( decoder ); + } + + + static FT_Error + tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder decoder ) + { + FT_Error error = SFNT_Err_Ok; + FT_UInt width, height; + FT_Bitmap* map = decoder->bitmap; + FT_Long size; + + + if ( !decoder->metrics_loaded ) + { + error = SFNT_Err_Invalid_Argument; + goto Exit; + } + + width = decoder->metrics->width; + height = decoder->metrics->height; + + map->width = (int)width; + map->rows = (int)height; + + switch ( decoder->bit_depth ) + { + case 1: + map->pixel_mode = FT_PIXEL_MODE_MONO; + map->pitch = ( map->width + 7 ) >> 3; + break; + + case 2: + map->pixel_mode = FT_PIXEL_MODE_GRAY2; + map->pitch = ( map->width + 3 ) >> 2; + break; + + case 4: + map->pixel_mode = FT_PIXEL_MODE_GRAY4; + map->pitch = ( map->width + 1 ) >> 1; + break; + + case 8: + map->pixel_mode = FT_PIXEL_MODE_GRAY; + map->pitch = map->width; + break; + + default: + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + size = map->rows * map->pitch; + + /* check that there is no empty image */ + if ( size == 0 ) + goto Exit; /* exit successfully! */ + + error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size ); + if ( error ) + goto Exit; + + decoder->bitmap_allocated = 1; + + Exit: + return error; + } + + + static FT_Error + tt_sbit_decoder_load_metrics( TT_SBitDecoder decoder, + FT_Byte* *pp, + FT_Byte* limit, + FT_Bool big ) + { + FT_Byte* p = *pp; + TT_SBit_Metrics metrics = decoder->metrics; + + + if ( p + 5 > limit ) + goto Fail; + + if ( !decoder->metrics_loaded ) + { + metrics->height = p[0]; + metrics->width = p[1]; + metrics->horiBearingX = (FT_Char)p[2]; + metrics->horiBearingY = (FT_Char)p[3]; + metrics->horiAdvance = p[4]; + } + + p += 5; + if ( big ) + { + if ( p + 3 > limit ) + goto Fail; + + if ( !decoder->metrics_loaded ) + { + metrics->vertBearingX = (FT_Char)p[0]; + metrics->vertBearingY = (FT_Char)p[1]; + metrics->vertAdvance = p[2]; + } + + p += 3; + } + + decoder->metrics_loaded = 1; + *pp = p; + return 0; + + Fail: + return SFNT_Err_Invalid_Argument; + } + + + /* forward declaration */ + static FT_Error + tt_sbit_decoder_load_image( TT_SBitDecoder decoder, + FT_UInt glyph_index, + FT_Int x_pos, + FT_Int y_pos ); + + typedef FT_Error (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder decoder, + FT_Byte* p, + FT_Byte* plimit, + FT_Int x_pos, + FT_Int y_pos ); + + + static FT_Error + tt_sbit_decoder_load_byte_aligned( TT_SBitDecoder decoder, + FT_Byte* p, + FT_Byte* limit, + FT_Int x_pos, + FT_Int y_pos ) + { + FT_Error error = SFNT_Err_Ok; + FT_Byte* line; + FT_Int bit_height, bit_width, pitch, width, height, h; + FT_Bitmap* bitmap; + + + if ( !decoder->bitmap_allocated ) + { + error = tt_sbit_decoder_alloc_bitmap( decoder ); + if ( error ) + goto Exit; + } + + /* check that we can write the glyph into the bitmap */ + bitmap = decoder->bitmap; + bit_width = bitmap->width; + bit_height = bitmap->rows; + pitch = bitmap->pitch; + line = bitmap->buffer; + + width = decoder->metrics->width; + height = decoder->metrics->height; + + if ( x_pos < 0 || x_pos + width > bit_width || + y_pos < 0 || y_pos + height > bit_height ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + if ( p + ( ( width + 7 ) >> 3 ) * height > limit ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + /* now do the blit */ + line += y_pos * pitch + ( x_pos >> 3 ); + x_pos &= 7; + + if ( x_pos == 0 ) /* the easy one */ + { + for ( h = height; h > 0; h--, line += pitch ) + { + FT_Byte* write = line; + FT_Int w; + + + for ( w = width; w >= 8; w -= 8 ) + { + write[0] = (FT_Byte)( write[0] | *p++ ); + write += 1; + } + + if ( w > 0 ) + write[0] = (FT_Byte)( write[0] | ( *p++ & ( 0xFF00U >> w ) ) ); + } + } + else /* x_pos > 0 */ + { + for ( h = height; h > 0; h--, line += pitch ) + { + FT_Byte* write = line; + FT_Int w; + FT_UInt wval = 0; + + + for ( w = width; w >= 8; w -= 8 ) + { + wval = (FT_UInt)( wval | *p++ ); + write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) ); + write += 1; + wval <<= 8; + } + + if ( w > 0 ) + wval = (FT_UInt)( wval | ( *p++ & ( 0xFF00U >> w ) ) ); + + /* all bits read and there are ( x_pos + w ) bits to be written */ + + write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) ); + + if ( x_pos + w > 8 ) + { + write++; + wval <<= 8; + write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) ); + } + } + } + + Exit: + return error; + } + + + static FT_Error + tt_sbit_decoder_load_bit_aligned( TT_SBitDecoder decoder, + FT_Byte* p, + FT_Byte* limit, + FT_Int x_pos, + FT_Int y_pos ) + { + FT_Error error = SFNT_Err_Ok; + FT_Byte* line; + FT_Int bit_height, bit_width, pitch, width, height, h, nbits; + FT_Bitmap* bitmap; + FT_UShort rval; + + + if ( !decoder->bitmap_allocated ) + { + error = tt_sbit_decoder_alloc_bitmap( decoder ); + if ( error ) + goto Exit; + } + + /* check that we can write the glyph into the bitmap */ + bitmap = decoder->bitmap; + bit_width = bitmap->width; + bit_height = bitmap->rows; + pitch = bitmap->pitch; + line = bitmap->buffer; + + width = decoder->metrics->width; + height = decoder->metrics->height; + + if ( x_pos < 0 || x_pos + width > bit_width || + y_pos < 0 || y_pos + height > bit_height ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + if ( p + ( ( width * height + 7 ) >> 3 ) > limit ) + { + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + /* now do the blit */ + line += y_pos * pitch + ( x_pos >> 3 ); + x_pos &= 7; + + /* the higher byte of `rval' is used as a buffer */ + rval = 0; + nbits = 0; + + for ( h = height; h > 0; h--, line += pitch ) + { + FT_Byte* write = line; + FT_Int w = width; + + + if ( x_pos ) + { + w = ( width < 8 - x_pos ) ? width : 8 - x_pos; + + if ( nbits < w ) + { + rval |= *p++; + nbits += 8 - w; + } + else + { + rval >>= 8; + nbits -= w; + } + + *write++ |= ( ( rval >> nbits ) & 0xFF ) & ~( 0xFF << w ); + rval <<= 8; + + w = width - w; + } + + for ( ; w >= 8; w -= 8 ) + { + rval |= *p++; + *write++ |= ( rval >> nbits ) & 0xFF; + + rval <<= 8; + } + + if ( w > 0 ) + { + if ( nbits < w ) + { + rval |= *p++; + *write |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w ); + nbits += 8 - w; + + rval <<= 8; + } + else + { + *write |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w ); + nbits -= w; + } + } + } + + Exit: + return error; + } + + + static FT_Error + tt_sbit_decoder_load_compound( TT_SBitDecoder decoder, + FT_Byte* p, + FT_Byte* limit, + FT_Int x_pos, + FT_Int y_pos ) + { + FT_Error error = SFNT_Err_Ok; + FT_UInt num_components, nn; + + + if ( p + 2 > limit ) + goto Fail; + + num_components = FT_NEXT_USHORT( p ); + if ( p + 4 * num_components > limit ) + goto Fail; + + for ( nn = 0; nn < num_components; nn++ ) + { + FT_UInt gindex = FT_NEXT_USHORT( p ); + FT_Byte dx = FT_NEXT_BYTE( p ); + FT_Byte dy = FT_NEXT_BYTE( p ); + + + /* NB: a recursive call */ + error = tt_sbit_decoder_load_image( decoder, gindex, + x_pos + dx, y_pos + dy ); + if ( error ) + break; + } + + Exit: + return error; + + Fail: + error = SFNT_Err_Invalid_File_Format; + goto Exit; + } + + + static FT_Error + tt_sbit_decoder_load_bitmap( TT_SBitDecoder decoder, + FT_UInt glyph_format, + FT_ULong glyph_start, + FT_ULong glyph_size, + FT_Int x_pos, + FT_Int y_pos ) + { + FT_Error error; + FT_Stream stream = decoder->stream; + FT_Byte* p; + FT_Byte* p_limit; + FT_Byte* data; + + + /* seek into the EBDT table now */ + if ( glyph_start + glyph_size > decoder->ebdt_size ) + { + error = SFNT_Err_Invalid_Argument; + goto Exit; + } + + if ( FT_STREAM_SEEK( decoder->ebdt_start + glyph_start ) || + FT_FRAME_EXTRACT( glyph_size, data ) ) + goto Exit; + + p = data; + p_limit = p + glyph_size; + + /* read the data, depending on the glyph format */ + switch ( glyph_format ) + { + case 1: + case 2: + case 8: + error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 0 ); + break; + + case 6: + case 7: + case 9: + error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ); + break; + + default: + error = SFNT_Err_Ok; + } + + if ( error ) + goto Fail; + + { + TT_SBitDecoder_LoadFunc loader; + + + switch ( glyph_format ) + { + case 1: + case 6: + loader = tt_sbit_decoder_load_byte_aligned; + break; + + case 2: + case 5: + case 7: + loader = tt_sbit_decoder_load_bit_aligned; + break; + + case 8: + if ( p + 1 > p_limit ) + goto Fail; + + p += 1; /* skip padding */ + /* fall-through */ + + case 9: + loader = tt_sbit_decoder_load_compound; + break; + + default: + goto Fail; + } + + error = loader( decoder, p, p_limit, x_pos, y_pos ); + } + + Fail: + FT_FRAME_RELEASE( data ); + + Exit: + return error; + } + + + static FT_Error + tt_sbit_decoder_load_image( TT_SBitDecoder decoder, + FT_UInt glyph_index, + FT_Int x_pos, + FT_Int y_pos ) + { + /* + * First, we find the correct strike range that applies to this + * glyph index. + */ + + FT_Byte* p = decoder->eblc_base + decoder->strike_index_array; + FT_Byte* p_limit = decoder->eblc_limit; + FT_ULong num_ranges = decoder->strike_index_count; + FT_UInt start, end, index_format, image_format; + FT_ULong image_start = 0, image_end = 0, image_offset; + + + for ( ; num_ranges > 0; num_ranges-- ) + { + start = FT_NEXT_USHORT( p ); + end = FT_NEXT_USHORT( p ); + + if ( glyph_index >= start && glyph_index <= end ) + goto FoundRange; + + p += 4; /* ignore index offset */ + } + goto NoBitmap; + + FoundRange: + image_offset = FT_NEXT_ULONG( p ); + + /* overflow check */ + if ( decoder->eblc_base + decoder->strike_index_array + image_offset < + decoder->eblc_base ) + goto Failure; + + p = decoder->eblc_base + decoder->strike_index_array + image_offset; + if ( p + 8 > p_limit ) + goto NoBitmap; + + /* now find the glyph's location and extend within the ebdt table */ + index_format = FT_NEXT_USHORT( p ); + image_format = FT_NEXT_USHORT( p ); + image_offset = FT_NEXT_ULONG ( p ); + + switch ( index_format ) + { + case 1: /* 4-byte offsets relative to `image_offset' */ + { + p += 4 * ( glyph_index - start ); + if ( p + 8 > p_limit ) + goto NoBitmap; + + image_start = FT_NEXT_ULONG( p ); + image_end = FT_NEXT_ULONG( p ); + + if ( image_start == image_end ) /* missing glyph */ + goto NoBitmap; + } + break; + + case 2: /* big metrics, constant image size */ + { + FT_ULong image_size; + + + if ( p + 12 > p_limit ) + goto NoBitmap; + + image_size = FT_NEXT_ULONG( p ); + + if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) ) + goto NoBitmap; + + image_start = image_size * ( glyph_index - start ); + image_end = image_start + image_size; + } + break; + + case 3: /* 2-byte offsets relative to 'image_offset' */ + { + p += 2 * ( glyph_index - start ); + if ( p + 4 > p_limit ) + goto NoBitmap; + + image_start = FT_NEXT_USHORT( p ); + image_end = FT_NEXT_USHORT( p ); + + if ( image_start == image_end ) /* missing glyph */ + goto NoBitmap; + } + break; + + case 4: /* sparse glyph array with (glyph,offset) pairs */ + { + FT_ULong mm, num_glyphs; + + + if ( p + 4 > p_limit ) + goto NoBitmap; + + num_glyphs = FT_NEXT_ULONG( p ); + + /* overflow check */ + if ( p + ( num_glyphs + 1 ) * 4 < p ) + goto Failure; + + if ( p + ( num_glyphs + 1 ) * 4 > p_limit ) + goto NoBitmap; + + for ( mm = 0; mm < num_glyphs; mm++ ) + { + FT_UInt gindex = FT_NEXT_USHORT( p ); + + + if ( gindex == glyph_index ) + { + image_start = FT_NEXT_USHORT( p ); + p += 2; + image_end = FT_PEEK_USHORT( p ); + break; + } + p += 2; + } + + if ( mm >= num_glyphs ) + goto NoBitmap; + } + break; + + case 5: /* constant metrics with sparse glyph codes */ + { + FT_ULong image_size, mm, num_glyphs; + + + if ( p + 16 > p_limit ) + goto NoBitmap; + + image_size = FT_NEXT_ULONG( p ); + + if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) ) + goto NoBitmap; + + num_glyphs = FT_NEXT_ULONG( p ); + + /* overflow check */ + if ( p + 2 * num_glyphs < p ) + goto Failure; + + if ( p + 2 * num_glyphs > p_limit ) + goto NoBitmap; + + for ( mm = 0; mm < num_glyphs; mm++ ) + { + FT_UInt gindex = FT_NEXT_USHORT( p ); + + + if ( gindex == glyph_index ) + break; + } + + if ( mm >= num_glyphs ) + goto NoBitmap; + + image_start = image_size * mm; + image_end = image_start + image_size; + } + break; + + default: + goto NoBitmap; + } + + if ( image_start > image_end ) + goto NoBitmap; + + image_end -= image_start; + image_start = image_offset + image_start; + + return tt_sbit_decoder_load_bitmap( decoder, + image_format, + image_start, + image_end, + x_pos, + y_pos ); + + Failure: + return SFNT_Err_Invalid_Table; + + NoBitmap: + return SFNT_Err_Invalid_Argument; + } + + + FT_LOCAL( FT_Error ) + tt_face_load_sbit_image( TT_Face face, + FT_ULong strike_index, + FT_UInt glyph_index, + FT_UInt load_flags, + FT_Stream stream, + FT_Bitmap *map, + TT_SBit_MetricsRec *metrics ) + { + TT_SBitDecoderRec decoder[1]; + FT_Error error; + + FT_UNUSED( load_flags ); + FT_UNUSED( stream ); + FT_UNUSED( map ); + + + error = tt_sbit_decoder_init( decoder, face, strike_index, metrics ); + if ( !error ) + { + error = tt_sbit_decoder_load_image( decoder, glyph_index, 0, 0 ); + tt_sbit_decoder_done( decoder ); + } + + return error; + } + +/* EOF */ diff --git a/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.c b/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.c index 5a4a544e5a5..d58ab870fdf 100644 --- a/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.c +++ b/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.c @@ -1,1983 +1,1983 @@ -/***************************************************************************/ -/* */ -/* ftgrays.c */ -/* */ -/* A new `perfect' anti-aliasing renderer (body). */ -/* */ -/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - /*************************************************************************/ - /* */ - /* This file can be compiled without the rest of the FreeType engine, by */ - /* defining the _STANDALONE_ macro when compiling it. You also need to */ - /* put the files `ftgrays.h' and `ftimage.h' into the current */ - /* compilation directory. Typically, you could do something like */ - /* */ - /* - copy `src/smooth/ftgrays.c' (this file) to your current directory */ - /* */ - /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */ - /* same directory */ - /* */ - /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */ - /* */ - /* cc -c -D_STANDALONE_ ftgrays.c */ - /* */ - /* The renderer can be initialized with a call to */ - /* `ft_gray_raster.raster_new'; an anti-aliased bitmap can be generated */ - /* with a call to `ft_gray_raster.raster_render'. */ - /* */ - /* See the comments and documentation in the file `ftimage.h' for more */ - /* details on how the raster works. */ - /* */ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* This is a new anti-aliasing scan-converter for FreeType 2. The */ - /* algorithm used here is _very_ different from the one in the standard */ - /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */ - /* coverage of the outline on each pixel cell. */ - /* */ - /* It is based on ideas that I initially found in Raph Levien's */ - /* excellent LibArt graphics library (see http://www.levien.com/libart */ - /* for more information, though the web pages do not tell anything */ - /* about the renderer; you'll have to dive into the source code to */ - /* understand how it works). */ - /* */ - /* Note, however, that this is a _very_ different implementation */ - /* compared to Raph's. Coverage information is stored in a very */ - /* different way, and I don't use sorted vector paths. Also, it doesn't */ - /* use floating point values. */ - /* */ - /* This renderer has the following advantages: */ - /* */ - /* - It doesn't need an intermediate bitmap. Instead, one can supply a */ - /* callback function that will be called by the renderer to draw gray */ - /* spans on any target surface. You can thus do direct composition on */ - /* any kind of bitmap, provided that you give the renderer the right */ - /* callback. */ - /* */ - /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */ - /* each pixel cell. */ - /* */ - /* - It performs a single pass on the outline (the `standard' FT2 */ - /* renderer makes two passes). */ - /* */ - /* - It can easily be modified to render to _any_ number of gray levels */ - /* cheaply. */ - /* */ - /* - For small (< 20) pixel sizes, it is faster than the standard */ - /* renderer. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_smooth - - - - -#ifdef _STANDALONE_ - -#include /* for ft_memcpy() */ -#include -#include -#define FT_UINT_MAX UINT_MAX - -#define ft_memset memset - -#define ft_setjmp setjmp -#define ft_longjmp longjmp -#define ft_jmp_buf jmp_buf - - -#define ErrRaster_Invalid_Mode -2 -#define ErrRaster_Invalid_Outline -1 -#define ErrRaster_Invalid_Argument -3 -#define ErrRaster_Memory_Overflow -4 - -#define FT_BEGIN_HEADER -#define FT_END_HEADER - -#include "ftimage.h" -#include "ftgrays.h" - - /* This macro is used to indicate that a function parameter is unused. */ - /* Its purpose is simply to reduce compiler warnings. Note also that */ - /* simply defining it as `(void)x' doesn't avoid warnings with certain */ - /* ANSI compilers (e.g. LCC). */ -#define FT_UNUSED( x ) (x) = (x) - - /* Disable the tracing mechanism for simplicity -- developers can */ - /* activate it easily by redefining these two macros. */ -#ifndef FT_ERROR -#define FT_ERROR( x ) do ; while ( 0 ) /* nothing */ -#endif - -#ifndef FT_TRACE -#define FT_TRACE( x ) do ; while ( 0 ) /* nothing */ -#endif - -#else /* !_STANDALONE_ */ - -#include -#include "ftgrays.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_OUTLINE_H - -#include "ftsmerrs.h" - -#define ErrRaster_Invalid_Mode Smooth_Err_Cannot_Render_Glyph -#define ErrRaster_Invalid_Outline Smooth_Err_Invalid_Outline -#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory -#define ErrRaster_Invalid_Argument Smooth_Err_Bad_Argument - -#endif /* !_STANDALONE_ */ - - -#ifndef FT_MEM_SET -#define FT_MEM_SET( d, s, c ) ft_memset( d, s, c ) -#endif - -#ifndef FT_MEM_ZERO -#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count ) -#endif - - /* define this to dump debugging information */ -#define xxxDEBUG_GRAYS - - - /* as usual, for the speed hungry :-) */ - -#ifndef FT_STATIC_RASTER - - -#define RAS_ARG PWorker worker -#define RAS_ARG_ PWorker worker, - -#define RAS_VAR worker -#define RAS_VAR_ worker, - -#define ras (*worker) - - -#else /* FT_STATIC_RASTER */ - - -#define RAS_ARG /* empty */ -#define RAS_ARG_ /* empty */ -#define RAS_VAR /* empty */ -#define RAS_VAR_ /* empty */ - - static TWorker ras; - - -#endif /* FT_STATIC_RASTER */ - - - /* must be at least 6 bits! */ -#define PIXEL_BITS 8 - -#define ONE_PIXEL ( 1L << PIXEL_BITS ) -#define PIXEL_MASK ( -1L << PIXEL_BITS ) -#define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) ) -#define SUBPIXELS( x ) ( (TPos)(x) << PIXEL_BITS ) -#define FLOOR( x ) ( (x) & -ONE_PIXEL ) -#define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL ) -#define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL ) - -#if PIXEL_BITS >= 6 -#define UPSCALE( x ) ( (x) << ( PIXEL_BITS - 6 ) ) -#define DOWNSCALE( x ) ( (x) >> ( PIXEL_BITS - 6 ) ) -#else -#define UPSCALE( x ) ( (x) >> ( 6 - PIXEL_BITS ) ) -#define DOWNSCALE( x ) ( (x) << ( 6 - PIXEL_BITS ) ) -#endif - - - /*************************************************************************/ - /* */ - /* TYPE DEFINITIONS */ - /* */ - - /* don't change the following types to FT_Int or FT_Pos, since we might */ - /* need to define them to "float" or "double" when experimenting with */ - /* new algorithms */ - - typedef int TCoord; /* integer scanline/pixel coordinate */ - typedef long TPos; /* sub-pixel coordinate */ - - /* determine the type used to store cell areas. This normally takes at */ - /* least PIXEL_BITS*2 + 1 bits. On 16-bit systems, we need to use */ - /* `long' instead of `int', otherwise bad things happen */ - -#if PIXEL_BITS <= 7 - - typedef int TArea; - -#else /* PIXEL_BITS >= 8 */ - - /* approximately determine the size of integers using an ANSI-C header */ -#if FT_UINT_MAX == 0xFFFFU - typedef long TArea; -#else - typedef int TArea; -#endif - -#endif /* PIXEL_BITS >= 8 */ - - - /* maximal number of gray spans in a call to the span callback */ -#define FT_MAX_GRAY_SPANS 32 - - - typedef struct TCell_* PCell; - - typedef struct TCell_ - { - int x; - int cover; - TArea area; - PCell next; - - } TCell; - - - typedef struct TWorker_ - { - TCoord ex, ey; - TPos min_ex, max_ex; - TPos min_ey, max_ey; - TPos count_ex, count_ey; - - TArea area; - int cover; - int invalid; - - PCell cells; - int max_cells; - int num_cells; - - TCoord cx, cy; - TPos x, y; - - TPos last_ey; - - FT_Vector bez_stack[32 * 3 + 1]; - int lev_stack[32]; - - FT_Outline outline; - FT_Bitmap target; - FT_BBox clip_box; - - FT_Span gray_spans[FT_MAX_GRAY_SPANS]; - int num_gray_spans; - - FT_Raster_Span_Func render_span; - void* render_span_data; - int span_y; - - int band_size; - int band_shoot; - int conic_level; - int cubic_level; - - ft_jmp_buf jump_buffer; - - void* buffer; - long buffer_size; - - PCell* ycells; - int ycount; - - } TWorker, *PWorker; - - - typedef struct TRaster_ - { - void* buffer; - long buffer_size; - int band_size; - void* memory; - PWorker worker; - - } TRaster, *PRaster; - - - - /*************************************************************************/ - /* */ - /* Initialize the cells table. */ - /* */ - static void - gray_init_cells( RAS_ARG_ void* buffer, - long byte_size ) - { - ras.buffer = buffer; - ras.buffer_size = byte_size; - - ras.ycells = (PCell*) buffer; - ras.cells = NULL; - ras.max_cells = 0; - ras.num_cells = 0; - ras.area = 0; - ras.cover = 0; - ras.invalid = 1; - } - - - /*************************************************************************/ - /* */ - /* Compute the outline bounding box. */ - /* */ - static void - gray_compute_cbox( RAS_ARG ) - { - FT_Outline* outline = &ras.outline; - FT_Vector* vec = outline->points; - FT_Vector* limit = vec + outline->n_points; - - - if ( outline->n_points <= 0 ) - { - ras.min_ex = ras.max_ex = 0; - ras.min_ey = ras.max_ey = 0; - return; - } - - ras.min_ex = ras.max_ex = vec->x; - ras.min_ey = ras.max_ey = vec->y; - - vec++; - - for ( ; vec < limit; vec++ ) - { - TPos x = vec->x; - TPos y = vec->y; - - - if ( x < ras.min_ex ) ras.min_ex = x; - if ( x > ras.max_ex ) ras.max_ex = x; - if ( y < ras.min_ey ) ras.min_ey = y; - if ( y > ras.max_ey ) ras.max_ey = y; - } - - /* truncate the bounding box to integer pixels */ - ras.min_ex = ras.min_ex >> 6; - ras.min_ey = ras.min_ey >> 6; - ras.max_ex = ( ras.max_ex + 63 ) >> 6; - ras.max_ey = ( ras.max_ey + 63 ) >> 6; - } - - - /*************************************************************************/ - /* */ - /* Record the current cell in the table. */ - /* */ - static PCell - gray_find_cell( RAS_ARG ) - { - PCell *pcell, cell; - int x = ras.ex; - - - if ( x > ras.max_ex ) - x = ras.max_ex; - - pcell = &ras.ycells[ras.ey]; - for (;;) - { - cell = *pcell; - if ( cell == NULL || cell->x > x ) - break; - - if ( cell->x == x ) - goto Exit; - - pcell = &cell->next; - } - - if ( ras.num_cells >= ras.max_cells ) - ft_longjmp( ras.jump_buffer, 1 ); - - cell = ras.cells + ras.num_cells++; - cell->x = x; - cell->area = 0; - cell->cover = 0; - - cell->next = *pcell; - *pcell = cell; - - Exit: - return cell; - } - - - static void - gray_record_cell( RAS_ARG ) - { - if ( !ras.invalid && ( ras.area | ras.cover ) ) - { - PCell cell = gray_find_cell( RAS_VAR ); - - - cell->area += ras.area; - cell->cover += ras.cover; - } - } - - - /*************************************************************************/ - /* */ - /* Set the current cell to a new position. */ - /* */ - static void - gray_set_cell( RAS_ARG_ TCoord ex, - TCoord ey ) - { - /* Move the cell pointer to a new position. We set the `invalid' */ - /* flag to indicate that the cell isn't part of those we're interested */ - /* in during the render phase. This means that: */ - /* */ - /* . the new vertical position must be within min_ey..max_ey-1. */ - /* . the new horizontal position must be strictly less than max_ex */ - /* */ - /* Note that if a cell is to the left of the clipping region, it is */ - /* actually set to the (min_ex-1) horizontal position. */ - - /* All cells that are on the left of the clipping region go to the */ - /* min_ex - 1 horizontal position. */ - ey -= ras.min_ey; - - if ( ex > ras.max_ex ) - ex = ras.max_ex; - - ex -= ras.min_ex; - if ( ex < 0 ) - ex = -1; - - /* are we moving to a different cell ? */ - if ( ex != ras.ex || ey != ras.ey ) - { - /* record the current one if it is valid */ - if ( !ras.invalid ) - gray_record_cell( RAS_VAR ); - - ras.area = 0; - ras.cover = 0; - } - - ras.ex = ex; - ras.ey = ey; - ras.invalid = ( (unsigned)ey >= (unsigned)ras.count_ey || - ex >= ras.count_ex ); - } - - - /*************************************************************************/ - /* */ - /* Start a new contour at a given cell. */ - /* */ - static void - gray_start_cell( RAS_ARG_ TCoord ex, - TCoord ey ) - { - if ( ex > ras.max_ex ) - ex = (TCoord)( ras.max_ex ); - - if ( ex < ras.min_ex ) - ex = (TCoord)( ras.min_ex - 1 ); - - ras.area = 0; - ras.cover = 0; - ras.ex = ex - ras.min_ex; - ras.ey = ey - ras.min_ey; - ras.last_ey = SUBPIXELS( ey ); - ras.invalid = 0; - - gray_set_cell( RAS_VAR_ ex, ey ); - } - - - /*************************************************************************/ - /* */ - /* Render a scanline as one or more cells. */ - /* */ - static void - gray_render_scanline( RAS_ARG_ TCoord ey, - TPos x1, - TCoord y1, - TPos x2, - TCoord y2 ) - { - TCoord ex1, ex2, fx1, fx2, delta; - long p, first, dx; - int incr, lift, mod, rem; - - - dx = x2 - x1; - - ex1 = TRUNC( x1 ); - ex2 = TRUNC( x2 ); - fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) ); - fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) ); - - /* trivial case. Happens often */ - if ( y1 == y2 ) - { - gray_set_cell( RAS_VAR_ ex2, ey ); - return; - } - - /* everything is located in a single cell. That is easy! */ - /* */ - if ( ex1 == ex2 ) - { - delta = y2 - y1; - ras.area += (TArea)( fx1 + fx2 ) * delta; - ras.cover += delta; - return; - } - - /* ok, we'll have to render a run of adjacent cells on the same */ - /* scanline... */ - /* */ - p = ( ONE_PIXEL - fx1 ) * ( y2 - y1 ); - first = ONE_PIXEL; - incr = 1; - - if ( dx < 0 ) - { - p = fx1 * ( y2 - y1 ); - first = 0; - incr = -1; - dx = -dx; - } - - delta = (TCoord)( p / dx ); - mod = (TCoord)( p % dx ); - if ( mod < 0 ) - { - delta--; - mod += (TCoord)dx; - } - - ras.area += (TArea)( fx1 + first ) * delta; - ras.cover += delta; - - ex1 += incr; - gray_set_cell( RAS_VAR_ ex1, ey ); - y1 += delta; - - if ( ex1 != ex2 ) - { - p = ONE_PIXEL * ( y2 - y1 + delta ); - lift = (TCoord)( p / dx ); - rem = (TCoord)( p % dx ); - if ( rem < 0 ) - { - lift--; - rem += (TCoord)dx; - } - - mod -= (int)dx; - - while ( ex1 != ex2 ) - { - delta = lift; - mod += rem; - if ( mod >= 0 ) - { - mod -= (TCoord)dx; - delta++; - } - - ras.area += (TArea)ONE_PIXEL * delta; - ras.cover += delta; - y1 += delta; - ex1 += incr; - gray_set_cell( RAS_VAR_ ex1, ey ); - } - } - - delta = y2 - y1; - ras.area += (TArea)( fx2 + ONE_PIXEL - first ) * delta; - ras.cover += delta; - } - - - /*************************************************************************/ - /* */ - /* Render a given line as a series of scanlines. */ - /* */ - static void - gray_render_line( RAS_ARG_ TPos to_x, - TPos to_y ) - { - TCoord ey1, ey2, fy1, fy2; - TPos dx, dy, x, x2; - long p, first; - int delta, rem, mod, lift, incr; - - - ey1 = TRUNC( ras.last_ey ); - ey2 = TRUNC( to_y ); /* if (ey2 >= ras.max_ey) ey2 = ras.max_ey-1; */ - fy1 = (TCoord)( ras.y - ras.last_ey ); - fy2 = (TCoord)( to_y - SUBPIXELS( ey2 ) ); - - dx = to_x - ras.x; - dy = to_y - ras.y; - - /* XXX: we should do something about the trivial case where dx == 0, */ - /* as it happens very often! */ - - /* perform vertical clipping */ - { - TCoord min, max; - - - min = ey1; - max = ey2; - if ( ey1 > ey2 ) - { - min = ey2; - max = ey1; - } - if ( min >= ras.max_ey || max < ras.min_ey ) - goto End; - } - - /* everything is on a single scanline */ - if ( ey1 == ey2 ) - { - gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, to_x, fy2 ); - goto End; - } - - /* vertical line - avoid calling gray_render_scanline */ - incr = 1; - - if ( dx == 0 ) - { - TCoord ex = TRUNC( ras.x ); - TCoord two_fx = (TCoord)( ( ras.x - SUBPIXELS( ex ) ) << 1 ); - TPos area; - - - first = ONE_PIXEL; - if ( dy < 0 ) - { - first = 0; - incr = -1; - } - - delta = (int)( first - fy1 ); - ras.area += (TArea)two_fx * delta; - ras.cover += delta; - ey1 += incr; - - gray_set_cell( &ras, ex, ey1 ); - - delta = (int)( first + first - ONE_PIXEL ); - area = (TArea)two_fx * delta; - while ( ey1 != ey2 ) - { - ras.area += area; - ras.cover += delta; - ey1 += incr; - - gray_set_cell( &ras, ex, ey1 ); - } - - delta = (int)( fy2 - ONE_PIXEL + first ); - ras.area += (TArea)two_fx * delta; - ras.cover += delta; - - goto End; - } - - /* ok, we have to render several scanlines */ - p = ( ONE_PIXEL - fy1 ) * dx; - first = ONE_PIXEL; - incr = 1; - - if ( dy < 0 ) - { - p = fy1 * dx; - first = 0; - incr = -1; - dy = -dy; - } - - delta = (int)( p / dy ); - mod = (int)( p % dy ); - if ( mod < 0 ) - { - delta--; - mod += (TCoord)dy; - } - - x = ras.x + delta; - gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, (TCoord)first ); - - ey1 += incr; - gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 ); - - if ( ey1 != ey2 ) - { - p = ONE_PIXEL * dx; - lift = (int)( p / dy ); - rem = (int)( p % dy ); - if ( rem < 0 ) - { - lift--; - rem += (int)dy; - } - mod -= (int)dy; - - while ( ey1 != ey2 ) - { - delta = lift; - mod += rem; - if ( mod >= 0 ) - { - mod -= (int)dy; - delta++; - } - - x2 = x + delta; - gray_render_scanline( RAS_VAR_ ey1, x, - (TCoord)( ONE_PIXEL - first ), x2, - (TCoord)first ); - x = x2; - - ey1 += incr; - gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 ); - } - } - - gray_render_scanline( RAS_VAR_ ey1, x, - (TCoord)( ONE_PIXEL - first ), to_x, - fy2 ); - - End: - ras.x = to_x; - ras.y = to_y; - ras.last_ey = SUBPIXELS( ey2 ); - } - - - static void - gray_split_conic( FT_Vector* base ) - { - TPos a, b; - - - base[4].x = base[2].x; - b = base[1].x; - a = base[3].x = ( base[2].x + b ) / 2; - b = base[1].x = ( base[0].x + b ) / 2; - base[2].x = ( a + b ) / 2; - - base[4].y = base[2].y; - b = base[1].y; - a = base[3].y = ( base[2].y + b ) / 2; - b = base[1].y = ( base[0].y + b ) / 2; - base[2].y = ( a + b ) / 2; - } - - - static void - gray_render_conic( RAS_ARG_ const FT_Vector* control, - const FT_Vector* to ) - { - TPos dx, dy; - int top, level; - int* levels; - FT_Vector* arc; - - - dx = DOWNSCALE( ras.x ) + to->x - ( control->x << 1 ); - if ( dx < 0 ) - dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - ( control->y << 1 ); - if ( dy < 0 ) - dy = -dy; - if ( dx < dy ) - dx = dy; - - level = 1; - dx = dx / ras.conic_level; - while ( dx > 0 ) - { - dx >>= 2; - level++; - } - - /* a shortcut to speed things up */ - if ( level <= 1 ) - { - /* we compute the mid-point directly in order to avoid */ - /* calling gray_split_conic() */ - TPos to_x, to_y, mid_x, mid_y; - - - to_x = UPSCALE( to->x ); - to_y = UPSCALE( to->y ); - mid_x = ( ras.x + to_x + 2 * UPSCALE( control->x ) ) / 4; - mid_y = ( ras.y + to_y + 2 * UPSCALE( control->y ) ) / 4; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - - return; - } - - arc = ras.bez_stack; - levels = ras.lev_stack; - top = 0; - levels[0] = level; - - arc[0].x = UPSCALE( to->x ); - arc[0].y = UPSCALE( to->y ); - arc[1].x = UPSCALE( control->x ); - arc[1].y = UPSCALE( control->y ); - arc[2].x = ras.x; - arc[2].y = ras.y; - - while ( top >= 0 ) - { - level = levels[top]; - if ( level > 1 ) - { - /* check that the arc crosses the current band */ - TPos min, max, y; - - - min = max = arc[0].y; - - y = arc[1].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - - y = arc[2].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - - if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) - goto Draw; - - gray_split_conic( arc ); - arc += 2; - top++; - levels[top] = levels[top - 1] = level - 1; - continue; - } - - Draw: - { - TPos to_x, to_y, mid_x, mid_y; - - - to_x = arc[0].x; - to_y = arc[0].y; - mid_x = ( ras.x + to_x + 2 * arc[1].x ) / 4; - mid_y = ( ras.y + to_y + 2 * arc[1].y ) / 4; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - - top--; - arc -= 2; - } - } - - return; - } - - - static void - gray_split_cubic( FT_Vector* base ) - { - TPos a, b, c, d; - - - base[6].x = base[3].x; - c = base[1].x; - d = base[2].x; - base[1].x = a = ( base[0].x + c ) / 2; - base[5].x = b = ( base[3].x + d ) / 2; - c = ( c + d ) / 2; - base[2].x = a = ( a + c ) / 2; - base[4].x = b = ( b + c ) / 2; - base[3].x = ( a + b ) / 2; - - base[6].y = base[3].y; - c = base[1].y; - d = base[2].y; - base[1].y = a = ( base[0].y + c ) / 2; - base[5].y = b = ( base[3].y + d ) / 2; - c = ( c + d ) / 2; - base[2].y = a = ( a + c ) / 2; - base[4].y = b = ( b + c ) / 2; - base[3].y = ( a + b ) / 2; - } - - - static void - gray_render_cubic( RAS_ARG_ const FT_Vector* control1, - const FT_Vector* control2, - const FT_Vector* to ) - { - TPos dx, dy, da, db; - int top, level; - int* levels; - FT_Vector* arc; - - - dx = DOWNSCALE( ras.x ) + to->x - ( control1->x << 1 ); - if ( dx < 0 ) - dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - ( control1->y << 1 ); - if ( dy < 0 ) - dy = -dy; - if ( dx < dy ) - dx = dy; - da = dx; - - dx = DOWNSCALE( ras.x ) + to->x - 3 * ( control1->x + control2->x ); - if ( dx < 0 ) - dx = -dx; - dy = DOWNSCALE( ras.y ) + to->y - 3 * ( control1->x + control2->y ); - if ( dy < 0 ) - dy = -dy; - if ( dx < dy ) - dx = dy; - db = dx; - - level = 1; - da = da / ras.cubic_level; - db = db / ras.conic_level; - while ( da > 0 || db > 0 ) - { - da >>= 2; - db >>= 3; - level++; - } - - if ( level <= 1 ) - { - TPos to_x, to_y, mid_x, mid_y; - - - to_x = UPSCALE( to->x ); - to_y = UPSCALE( to->y ); - mid_x = ( ras.x + to_x + - 3 * UPSCALE( control1->x + control2->x ) ) / 8; - mid_y = ( ras.y + to_y + - 3 * UPSCALE( control1->y + control2->y ) ) / 8; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - return; - } - - arc = ras.bez_stack; - arc[0].x = UPSCALE( to->x ); - arc[0].y = UPSCALE( to->y ); - arc[1].x = UPSCALE( control2->x ); - arc[1].y = UPSCALE( control2->y ); - arc[2].x = UPSCALE( control1->x ); - arc[2].y = UPSCALE( control1->y ); - arc[3].x = ras.x; - arc[3].y = ras.y; - - levels = ras.lev_stack; - top = 0; - levels[0] = level; - - while ( top >= 0 ) - { - level = levels[top]; - if ( level > 1 ) - { - /* check that the arc crosses the current band */ - TPos min, max, y; - - - min = max = arc[0].y; - y = arc[1].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - y = arc[2].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - y = arc[3].y; - if ( y < min ) min = y; - if ( y > max ) max = y; - if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < 0 ) - goto Draw; - gray_split_cubic( arc ); - arc += 3; - top ++; - levels[top] = levels[top - 1] = level - 1; - continue; - } - - Draw: - { - TPos to_x, to_y, mid_x, mid_y; - - - to_x = arc[0].x; - to_y = arc[0].y; - mid_x = ( ras.x + to_x + 3 * ( arc[1].x + arc[2].x ) ) / 8; - mid_y = ( ras.y + to_y + 3 * ( arc[1].y + arc[2].y ) ) / 8; - - gray_render_line( RAS_VAR_ mid_x, mid_y ); - gray_render_line( RAS_VAR_ to_x, to_y ); - top --; - arc -= 3; - } - } - - return; - } - - - - static int - gray_move_to( const FT_Vector* to, - PWorker worker ) - { - TPos x, y; - - - /* record current cell, if any */ - gray_record_cell( worker ); - - /* start to a new position */ - x = UPSCALE( to->x ); - y = UPSCALE( to->y ); - - gray_start_cell( worker, TRUNC( x ), TRUNC( y ) ); - - worker->x = x; - worker->y = y; - return 0; - } - - - static int - gray_line_to( const FT_Vector* to, - PWorker worker ) - { - gray_render_line( worker, UPSCALE( to->x ), UPSCALE( to->y ) ); - return 0; - } - - - static int - gray_conic_to( const FT_Vector* control, - const FT_Vector* to, - PWorker worker ) - { - gray_render_conic( worker, control, to ); - return 0; - } - - - static int - gray_cubic_to( const FT_Vector* control1, - const FT_Vector* control2, - const FT_Vector* to, - PWorker worker ) - { - gray_render_cubic( worker, control1, control2, to ); - return 0; - } - - - static void - gray_render_span( int y, - int count, - const FT_Span* spans, - PWorker worker ) - { - unsigned char* p; - FT_Bitmap* map = &worker->target; - - - /* first of all, compute the scanline offset */ - p = (unsigned char*)map->buffer - y * map->pitch; - if ( map->pitch >= 0 ) - p += ( map->rows - 1 ) * map->pitch; - - for ( ; count > 0; count--, spans++ ) - { - unsigned char coverage = spans->coverage; - - - if ( coverage ) - { - /* For small-spans it is faster to do it by ourselves than - * calling `memset'. This is mainly due to the cost of the - * function call. - */ - if ( spans->len >= 8 ) - FT_MEM_SET( p + spans->x, (unsigned char)coverage, spans->len ); - else - { - unsigned char* q = p + spans->x; - - - switch ( spans->len ) - { - case 7: *q++ = (unsigned char)coverage; - case 6: *q++ = (unsigned char)coverage; - case 5: *q++ = (unsigned char)coverage; - case 4: *q++ = (unsigned char)coverage; - case 3: *q++ = (unsigned char)coverage; - case 2: *q++ = (unsigned char)coverage; - case 1: *q = (unsigned char)coverage; - default: - ; - } - } - } - } - } - - - static void - gray_hline( RAS_ARG_ TCoord x, - TCoord y, - TPos area, - int acount ) - { - FT_Span* span; - int count; - int coverage; - - - /* compute the coverage line's coverage, depending on the */ - /* outline fill rule */ - /* */ - /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2) */ - /* */ - coverage = (int)( area >> ( PIXEL_BITS * 2 + 1 - 8 ) ); - /* use range 0..256 */ - if ( coverage < 0 ) - coverage = -coverage; - - if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) - { - coverage &= 511; - - if ( coverage > 256 ) - coverage = 512 - coverage; - else if ( coverage == 256 ) - coverage = 255; - } - else - { - /* normal non-zero winding rule */ - if ( coverage >= 256 ) - coverage = 255; - } - - y += (TCoord)ras.min_ey; - x += (TCoord)ras.min_ex; - - /* FT_Span.x is a 16-bit short, so limit our coordinates appropriately */ - if ( x >= 32768 ) - x = 32767; - - if ( coverage ) - { - /* see whether we can add this span to the current list */ - count = ras.num_gray_spans; - span = ras.gray_spans + count - 1; - if ( count > 0 && - ras.span_y == y && - (int)span->x + span->len == (int)x && - span->coverage == coverage ) - { - span->len = (unsigned short)( span->len + acount ); - return; - } - - if ( ras.span_y != y || count >= FT_MAX_GRAY_SPANS ) - { - if ( ras.render_span && count > 0 ) - ras.render_span( ras.span_y, count, ras.gray_spans, - ras.render_span_data ); - /* ras.render_span( span->y, ras.gray_spans, count ); */ - -#ifdef DEBUG_GRAYS - - if ( ras.span_y >= 0 ) - { - int n; - - - fprintf( stderr, "y=%3d ", ras.span_y ); - span = ras.gray_spans; - for ( n = 0; n < count; n++, span++ ) - fprintf( stderr, "[%d..%d]:%02x ", - span->x, span->x + span->len - 1, span->coverage ); - fprintf( stderr, "\n" ); - } - -#endif /* DEBUG_GRAYS */ - - ras.num_gray_spans = 0; - ras.span_y = y; - - count = 0; - span = ras.gray_spans; - } - else - span++; - - /* add a gray span to the current list */ - span->x = (short)x; - span->len = (unsigned short)acount; - span->coverage = (unsigned char)coverage; - - ras.num_gray_spans++; - } - } - - -#ifdef DEBUG_GRAYS - - /* to be called while in the debugger */ - gray_dump_cells( RAS_ARG ) - { - int yindex; - - - for ( yindex = 0; yindex < ras.ycount; yindex++ ) - { - PCell cell; - - - printf( "%3d:", yindex ); - - for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next ) - printf( " (%3d, c:%4d, a:%6d)", cell->x, cell->cover, cell->area ); - printf( "\n" ); - } - } - -#endif /* DEBUG_GRAYS */ - - - static void - gray_sweep( RAS_ARG_ const FT_Bitmap* target ) - { - int yindex; - - FT_UNUSED( target ); - - - if ( ras.num_cells == 0 ) - return; - - ras.num_gray_spans = 0; - - for ( yindex = 0; yindex < ras.ycount; yindex++ ) - { - PCell cell = ras.ycells[yindex]; - TCoord cover = 0; - TCoord x = 0; - - - for ( ; cell != NULL; cell = cell->next ) - { - TArea area; - - - if ( cell->x > x && cover != 0 ) - gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ), - cell->x - x ); - - cover += cell->cover; - area = cover * ( ONE_PIXEL * 2 ) - cell->area; - - if ( area != 0 && cell->x >= 0 ) - gray_hline( RAS_VAR_ cell->x, yindex, area, 1 ); - - x = cell->x + 1; - } - - if ( cover != 0 ) - gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ), - ras.count_ex - x ); - } - - if ( ras.render_span && ras.num_gray_spans > 0 ) - ras.render_span( ras.span_y, ras.num_gray_spans, - ras.gray_spans, ras.render_span_data ); - } - - -#ifdef _STANDALONE_ - - /*************************************************************************/ - /* */ - /* The following function should only compile in stand_alone mode, */ - /* i.e., when building this component without the rest of FreeType. */ - /* */ - /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* */ - /* FT_Outline_Decompose */ - /* */ - /* */ - /* Walks over an outline's structure to decompose it into individual */ - /* segments and Bezier arcs. This function is also able to emit */ - /* `move to' and `close to' operations to indicate the start and end */ - /* of new contours in the outline. */ - /* */ - /* */ - /* outline :: A pointer to the source target. */ - /* */ - /* func_interface :: A table of `emitters', i.e,. function pointers */ - /* called during decomposition to indicate path */ - /* operations. */ - /* */ - /* user :: A typeless pointer which is passed to each */ - /* emitter during the decomposition. It can be */ - /* used to store the state during the */ - /* decomposition. */ - /* */ - /* */ - /* Error code. 0 means success. */ - /* */ - static - int FT_Outline_Decompose( const FT_Outline* outline, - const FT_Outline_Funcs* func_interface, - void* user ) - { -#undef SCALED -#if 0 -#define SCALED( x ) ( ( (x) << shift ) - delta ) -#else -#define SCALED( x ) (x) -#endif - - FT_Vector v_last; - FT_Vector v_control; - FT_Vector v_start; - - FT_Vector* point; - FT_Vector* limit; - char* tags; - - int n; /* index of contour in outline */ - int first; /* index of first point in contour */ - int error; - char tag; /* current point's state */ - -#if 0 - int shift = func_interface->shift; - TPos delta = func_interface->delta; -#endif - - - first = 0; - - for ( n = 0; n < outline->n_contours; n++ ) - { - int last; /* index of last point in contour */ - - - last = outline->contours[n]; - limit = outline->points + last; - - v_start = outline->points[first]; - v_last = outline->points[last]; - - v_start.x = SCALED( v_start.x ); - v_start.y = SCALED( v_start.y ); - - v_last.x = SCALED( v_last.x ); - v_last.y = SCALED( v_last.y ); - - v_control = v_start; - - point = outline->points + first; - tags = outline->tags + first; - tag = FT_CURVE_TAG( tags[0] ); - - /* A contour cannot start with a cubic control point! */ - if ( tag == FT_CURVE_TAG_CUBIC ) - goto Invalid_Outline; - - /* check first point to determine origin */ - if ( tag == FT_CURVE_TAG_CONIC ) - { - /* first point is conic control. Yes, this happens. */ - if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON ) - { - /* start at last point if it is on the curve */ - v_start = v_last; - limit--; - } - else - { - /* if both first and last points are conic, */ - /* start at their middle and record its position */ - /* for closure */ - v_start.x = ( v_start.x + v_last.x ) / 2; - v_start.y = ( v_start.y + v_last.y ) / 2; - - v_last = v_start; - } - point--; - tags--; - } - - error = func_interface->move_to( &v_start, user ); - if ( error ) - goto Exit; - - while ( point < limit ) - { - point++; - tags++; - - tag = FT_CURVE_TAG( tags[0] ); - switch ( tag ) - { - case FT_CURVE_TAG_ON: /* emit a single line_to */ - { - FT_Vector vec; - - - vec.x = SCALED( point->x ); - vec.y = SCALED( point->y ); - - error = func_interface->line_to( &vec, user ); - if ( error ) - goto Exit; - continue; - } - - case FT_CURVE_TAG_CONIC: /* consume conic arcs */ - { - v_control.x = SCALED( point->x ); - v_control.y = SCALED( point->y ); - - Do_Conic: - if ( point < limit ) - { - FT_Vector vec; - FT_Vector v_middle; - - - point++; - tags++; - tag = FT_CURVE_TAG( tags[0] ); - - vec.x = SCALED( point->x ); - vec.y = SCALED( point->y ); - - if ( tag == FT_CURVE_TAG_ON ) - { - error = func_interface->conic_to( &v_control, &vec, - user ); - if ( error ) - goto Exit; - continue; - } - - if ( tag != FT_CURVE_TAG_CONIC ) - goto Invalid_Outline; - - v_middle.x = ( v_control.x + vec.x ) / 2; - v_middle.y = ( v_control.y + vec.y ) / 2; - - error = func_interface->conic_to( &v_control, &v_middle, - user ); - if ( error ) - goto Exit; - - v_control = vec; - goto Do_Conic; - } - - error = func_interface->conic_to( &v_control, &v_start, - user ); - goto Close; - } - - default: /* FT_CURVE_TAG_CUBIC */ - { - FT_Vector vec1, vec2; - - - if ( point + 1 > limit || - FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) - goto Invalid_Outline; - - point += 2; - tags += 2; - - vec1.x = SCALED( point[-2].x ); - vec1.y = SCALED( point[-2].y ); - - vec2.x = SCALED( point[-1].x ); - vec2.y = SCALED( point[-1].y ); - - if ( point <= limit ) - { - FT_Vector vec; - - - vec.x = SCALED( point->x ); - vec.y = SCALED( point->y ); - - error = func_interface->cubic_to( &vec1, &vec2, &vec, user ); - if ( error ) - goto Exit; - continue; - } - - error = func_interface->cubic_to( &vec1, &vec2, &v_start, user ); - goto Close; - } - } - } - - /* close the contour with a line segment */ - error = func_interface->line_to( &v_start, user ); - - Close: - if ( error ) - goto Exit; - - first = last + 1; - } - - return 0; - - Exit: - return error; - - Invalid_Outline: - return ErrRaster_Invalid_Outline; - } - -#endif /* _STANDALONE_ */ - - - typedef struct TBand_ - { - TPos min, max; - - } TBand; - - - static int - gray_convert_glyph_inner( RAS_ARG ) - { - static - const FT_Outline_Funcs func_interface = - { - (FT_Outline_MoveTo_Func) gray_move_to, - (FT_Outline_LineTo_Func) gray_line_to, - (FT_Outline_ConicTo_Func)gray_conic_to, - (FT_Outline_CubicTo_Func)gray_cubic_to, - 0, - 0 - }; - - volatile int error = 0; - - if ( ft_setjmp( ras.jump_buffer ) == 0 ) - { - error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras ); - gray_record_cell( RAS_VAR ); - } - else - { - error = ErrRaster_Memory_Overflow; - } - - return error; - } - - - static int - gray_convert_glyph( RAS_ARG ) - { - TBand bands[40]; - TBand* volatile band; - int volatile n, num_bands; - TPos volatile min, max, max_y; - FT_BBox* clip; - - - /* Set up state in the raster object */ - gray_compute_cbox( RAS_VAR ); - - /* clip to target bitmap, exit if nothing to do */ - clip = &ras.clip_box; - - if ( ras.max_ex <= clip->xMin || ras.min_ex >= clip->xMax || - ras.max_ey <= clip->yMin || ras.min_ey >= clip->yMax ) - return 0; - - if ( ras.min_ex < clip->xMin ) ras.min_ex = clip->xMin; - if ( ras.min_ey < clip->yMin ) ras.min_ey = clip->yMin; - - if ( ras.max_ex > clip->xMax ) ras.max_ex = clip->xMax; - if ( ras.max_ey > clip->yMax ) ras.max_ey = clip->yMax; - - ras.count_ex = ras.max_ex - ras.min_ex; - ras.count_ey = ras.max_ey - ras.min_ey; - - /* simple heuristic used to speed-up the bezier decomposition -- see */ - /* the code in gray_render_conic() and gray_render_cubic() for more */ - /* details */ - ras.conic_level = 32; - ras.cubic_level = 16; - - { - int level = 0; - - - if ( ras.count_ex > 24 || ras.count_ey > 24 ) - level++; - if ( ras.count_ex > 120 || ras.count_ey > 120 ) - level++; - - ras.conic_level <<= level; - ras.cubic_level <<= level; - } - - /* setup vertical bands */ - num_bands = (int)( ( ras.max_ey - ras.min_ey ) / ras.band_size ); - if ( num_bands == 0 ) num_bands = 1; - if ( num_bands >= 39 ) num_bands = 39; - - ras.band_shoot = 0; - - min = ras.min_ey; - max_y = ras.max_ey; - - for ( n = 0; n < num_bands; n++, min = max ) - { - max = min + ras.band_size; - if ( n == num_bands - 1 || max > max_y ) - max = max_y; - - bands[0].min = min; - bands[0].max = max; - band = bands; - - while ( band >= bands ) - { - TPos bottom, top, middle; - int error; - - { - PCell cells_max; - int yindex; - long cell_start, cell_end, cell_mod; - - - ras.ycells = (PCell*)ras.buffer; - ras.ycount = band->max - band->min; - - cell_start = sizeof ( PCell ) * ras.ycount; - cell_mod = cell_start % sizeof ( TCell ); - if ( cell_mod > 0 ) - cell_start += sizeof ( TCell ) - cell_mod; - - cell_end = ras.buffer_size; - cell_end -= cell_end % sizeof( TCell ); - - cells_max = (PCell)( (char*)ras.buffer + cell_end ); - ras.cells = (PCell)( (char*)ras.buffer + cell_start ); - if ( ras.cells >= cells_max ) - goto ReduceBands; - - ras.max_cells = cells_max - ras.cells; - if ( ras.max_cells < 2 ) - goto ReduceBands; - - for ( yindex = 0; yindex < ras.ycount; yindex++ ) - ras.ycells[yindex] = NULL; - } - - ras.num_cells = 0; - ras.invalid = 1; - ras.min_ey = band->min; - ras.max_ey = band->max; - ras.count_ey = band->max - band->min; - - error = gray_convert_glyph_inner( RAS_VAR ); - - if ( !error ) - { - gray_sweep( RAS_VAR_ &ras.target ); - band--; - continue; - } - else if ( error != ErrRaster_Memory_Overflow ) - return 1; - - ReduceBands: - /* render pool overflow; we will reduce the render band by half */ - bottom = band->min; - top = band->max; - middle = bottom + ( ( top - bottom ) >> 1 ); - - /* This is too complex for a single scanline; there must */ - /* be some problems. */ - if ( middle == bottom ) - { -#ifdef DEBUG_GRAYS - fprintf( stderr, "Rotten glyph!\n" ); -#endif - return 1; - } - - if ( bottom-top >= ras.band_size ) - ras.band_shoot++; - - band[1].min = bottom; - band[1].max = middle; - band[0].min = middle; - band[0].max = top; - band++; - } - } - - if ( ras.band_shoot > 8 && ras.band_size > 16 ) - ras.band_size = ras.band_size / 2; - - return 0; - } - - - static int - gray_raster_render( PRaster raster, - const FT_Raster_Params* params ) - { - const FT_Outline* outline = (const FT_Outline*)params->source; - const FT_Bitmap* target_map = params->target; - PWorker worker; - - - if ( !raster || !raster->buffer || !raster->buffer_size ) - return ErrRaster_Invalid_Argument; - - /* return immediately if the outline is empty */ - if ( outline->n_points == 0 || outline->n_contours <= 0 ) - return 0; - - if ( !outline || !outline->contours || !outline->points ) - return ErrRaster_Invalid_Outline; - - if ( outline->n_points != - outline->contours[outline->n_contours - 1] + 1 ) - return ErrRaster_Invalid_Outline; - - worker = raster->worker; - - /* if direct mode is not set, we must have a target bitmap */ - if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 ) - { - if ( !target_map ) - return ErrRaster_Invalid_Argument; - - /* nothing to do */ - if ( !target_map->width || !target_map->rows ) - return 0; - - if ( !target_map->buffer ) - return ErrRaster_Invalid_Argument; - } - - /* this version does not support monochrome rendering */ - if ( !( params->flags & FT_RASTER_FLAG_AA ) ) - return ErrRaster_Invalid_Mode; - - /* compute clipping box */ - if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 ) - { - /* compute clip box from target pixmap */ - ras.clip_box.xMin = 0; - ras.clip_box.yMin = 0; - ras.clip_box.xMax = target_map->width; - ras.clip_box.yMax = target_map->rows; - } - else if ( params->flags & FT_RASTER_FLAG_CLIP ) - { - ras.clip_box = params->clip_box; - } - else - { - ras.clip_box.xMin = -32768L; - ras.clip_box.yMin = -32768L; - ras.clip_box.xMax = 32767L; - ras.clip_box.yMax = 32767L; - } - - gray_init_cells( worker, raster->buffer, raster->buffer_size ); - - ras.outline = *outline; - ras.num_cells = 0; - ras.invalid = 1; - ras.band_size = raster->band_size; - ras.num_gray_spans = 0; - - if ( target_map ) - ras.target = *target_map; - - ras.render_span = (FT_Raster_Span_Func)gray_render_span; - ras.render_span_data = &ras; - - if ( params->flags & FT_RASTER_FLAG_DIRECT ) - { - ras.render_span = (FT_Raster_Span_Func)params->gray_spans; - ras.render_span_data = params->user; - } - - return gray_convert_glyph( worker ); - } - - - /**** RASTER OBJECT CREATION: In standalone mode, we simply use *****/ - /**** a static object. *****/ - -#ifdef _STANDALONE_ - - static int - gray_raster_new( void* memory, - FT_Raster* araster ) - { - static TRaster the_raster; - - FT_UNUSED( memory ); - - - *araster = (FT_Raster)&the_raster; - FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) ); - - return 0; - } - - - static void - gray_raster_done( FT_Raster raster ) - { - /* nothing */ - FT_UNUSED( raster ); - } - -#else /* _STANDALONE_ */ - - static int - gray_raster_new( FT_Memory memory, - FT_Raster* araster ) - { - FT_Error error; - PRaster raster; - - - *araster = 0; - if ( !FT_ALLOC( raster, sizeof ( TRaster ) ) ) - { - raster->memory = memory; - *araster = (FT_Raster)raster; - } - - return error; - } - - - static void - gray_raster_done( FT_Raster raster ) - { - FT_Memory memory = (FT_Memory)((PRaster)raster)->memory; - - - FT_FREE( raster ); - } - -#endif /* _STANDALONE_ */ - - - static void - gray_raster_reset( FT_Raster raster, - char* pool_base, - long pool_size ) - { - PRaster rast = (PRaster)raster; - - - if ( raster ) - { - if ( pool_base && pool_size >= (long)sizeof ( TWorker ) + 2048 ) - { - PWorker worker = (PWorker)pool_base; - - - rast->worker = worker; - rast->buffer = pool_base + - ( ( sizeof ( TWorker ) + sizeof ( TCell ) - 1 ) & - ~( sizeof ( TCell ) - 1 ) ); - rast->buffer_size = (long)( ( pool_base + pool_size ) - - (char*)rast->buffer ) & - ~( sizeof ( TCell ) - 1 ); - rast->band_size = (int)( rast->buffer_size / - ( sizeof ( TCell ) * 8 ) ); - } - else - { - rast->buffer = NULL; - rast->buffer_size = 0; - rast->worker = NULL; - } - } - } - - - const FT_Raster_Funcs ft_grays_raster = - { - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Raster_New_Func) gray_raster_new, - (FT_Raster_Reset_Func) gray_raster_reset, - (FT_Raster_Set_Mode_Func)0, - (FT_Raster_Render_Func) gray_raster_render, - (FT_Raster_Done_Func) gray_raster_done - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* ftgrays.c */ +/* */ +/* A new `perfect' anti-aliasing renderer (body). */ +/* */ +/* Copyright 2000-2001, 2002, 2003, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + /*************************************************************************/ + /* */ + /* This file can be compiled without the rest of the FreeType engine, by */ + /* defining the _STANDALONE_ macro when compiling it. You also need to */ + /* put the files `ftgrays.h' and `ftimage.h' into the current */ + /* compilation directory. Typically, you could do something like */ + /* */ + /* - copy `src/smooth/ftgrays.c' (this file) to your current directory */ + /* */ + /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */ + /* same directory */ + /* */ + /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */ + /* */ + /* cc -c -D_STANDALONE_ ftgrays.c */ + /* */ + /* The renderer can be initialized with a call to */ + /* `ft_gray_raster.raster_new'; an anti-aliased bitmap can be generated */ + /* with a call to `ft_gray_raster.raster_render'. */ + /* */ + /* See the comments and documentation in the file `ftimage.h' for more */ + /* details on how the raster works. */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* This is a new anti-aliasing scan-converter for FreeType 2. The */ + /* algorithm used here is _very_ different from the one in the standard */ + /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */ + /* coverage of the outline on each pixel cell. */ + /* */ + /* It is based on ideas that I initially found in Raph Levien's */ + /* excellent LibArt graphics library (see http://www.levien.com/libart */ + /* for more information, though the web pages do not tell anything */ + /* about the renderer; you'll have to dive into the source code to */ + /* understand how it works). */ + /* */ + /* Note, however, that this is a _very_ different implementation */ + /* compared to Raph's. Coverage information is stored in a very */ + /* different way, and I don't use sorted vector paths. Also, it doesn't */ + /* use floating point values. */ + /* */ + /* This renderer has the following advantages: */ + /* */ + /* - It doesn't need an intermediate bitmap. Instead, one can supply a */ + /* callback function that will be called by the renderer to draw gray */ + /* spans on any target surface. You can thus do direct composition on */ + /* any kind of bitmap, provided that you give the renderer the right */ + /* callback. */ + /* */ + /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */ + /* each pixel cell. */ + /* */ + /* - It performs a single pass on the outline (the `standard' FT2 */ + /* renderer makes two passes). */ + /* */ + /* - It can easily be modified to render to _any_ number of gray levels */ + /* cheaply. */ + /* */ + /* - For small (< 20) pixel sizes, it is faster than the standard */ + /* renderer. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_smooth + + + + +#ifdef _STANDALONE_ + +#include /* for ft_memcpy() */ +#include +#include +#define FT_UINT_MAX UINT_MAX + +#define ft_memset memset + +#define ft_setjmp setjmp +#define ft_longjmp longjmp +#define ft_jmp_buf jmp_buf + + +#define ErrRaster_Invalid_Mode -2 +#define ErrRaster_Invalid_Outline -1 +#define ErrRaster_Invalid_Argument -3 +#define ErrRaster_Memory_Overflow -4 + +#define FT_BEGIN_HEADER +#define FT_END_HEADER + +#include "ftimage.h" +#include "ftgrays.h" + + /* This macro is used to indicate that a function parameter is unused. */ + /* Its purpose is simply to reduce compiler warnings. Note also that */ + /* simply defining it as `(void)x' doesn't avoid warnings with certain */ + /* ANSI compilers (e.g. LCC). */ +#define FT_UNUSED( x ) (x) = (x) + + /* Disable the tracing mechanism for simplicity -- developers can */ + /* activate it easily by redefining these two macros. */ +#ifndef FT_ERROR +#define FT_ERROR( x ) do ; while ( 0 ) /* nothing */ +#endif + +#ifndef FT_TRACE +#define FT_TRACE( x ) do ; while ( 0 ) /* nothing */ +#endif + +#else /* !_STANDALONE_ */ + +#include +#include "ftgrays.h" +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_OUTLINE_H + +#include "ftsmerrs.h" + +#define ErrRaster_Invalid_Mode Smooth_Err_Cannot_Render_Glyph +#define ErrRaster_Invalid_Outline Smooth_Err_Invalid_Outline +#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory +#define ErrRaster_Invalid_Argument Smooth_Err_Bad_Argument + +#endif /* !_STANDALONE_ */ + + +#ifndef FT_MEM_SET +#define FT_MEM_SET( d, s, c ) ft_memset( d, s, c ) +#endif + +#ifndef FT_MEM_ZERO +#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count ) +#endif + + /* define this to dump debugging information */ +#define xxxDEBUG_GRAYS + + + /* as usual, for the speed hungry :-) */ + +#ifndef FT_STATIC_RASTER + + +#define RAS_ARG PWorker worker +#define RAS_ARG_ PWorker worker, + +#define RAS_VAR worker +#define RAS_VAR_ worker, + +#define ras (*worker) + + +#else /* FT_STATIC_RASTER */ + + +#define RAS_ARG /* empty */ +#define RAS_ARG_ /* empty */ +#define RAS_VAR /* empty */ +#define RAS_VAR_ /* empty */ + + static TWorker ras; + + +#endif /* FT_STATIC_RASTER */ + + + /* must be at least 6 bits! */ +#define PIXEL_BITS 8 + +#define ONE_PIXEL ( 1L << PIXEL_BITS ) +#define PIXEL_MASK ( -1L << PIXEL_BITS ) +#define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) ) +#define SUBPIXELS( x ) ( (TPos)(x) << PIXEL_BITS ) +#define FLOOR( x ) ( (x) & -ONE_PIXEL ) +#define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL ) +#define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL ) + +#if PIXEL_BITS >= 6 +#define UPSCALE( x ) ( (x) << ( PIXEL_BITS - 6 ) ) +#define DOWNSCALE( x ) ( (x) >> ( PIXEL_BITS - 6 ) ) +#else +#define UPSCALE( x ) ( (x) >> ( 6 - PIXEL_BITS ) ) +#define DOWNSCALE( x ) ( (x) << ( 6 - PIXEL_BITS ) ) +#endif + + + /*************************************************************************/ + /* */ + /* TYPE DEFINITIONS */ + /* */ + + /* don't change the following types to FT_Int or FT_Pos, since we might */ + /* need to define them to "float" or "double" when experimenting with */ + /* new algorithms */ + + typedef int TCoord; /* integer scanline/pixel coordinate */ + typedef long TPos; /* sub-pixel coordinate */ + + /* determine the type used to store cell areas. This normally takes at */ + /* least PIXEL_BITS*2 + 1 bits. On 16-bit systems, we need to use */ + /* `long' instead of `int', otherwise bad things happen */ + +#if PIXEL_BITS <= 7 + + typedef int TArea; + +#else /* PIXEL_BITS >= 8 */ + + /* approximately determine the size of integers using an ANSI-C header */ +#if FT_UINT_MAX == 0xFFFFU + typedef long TArea; +#else + typedef int TArea; +#endif + +#endif /* PIXEL_BITS >= 8 */ + + + /* maximal number of gray spans in a call to the span callback */ +#define FT_MAX_GRAY_SPANS 32 + + + typedef struct TCell_* PCell; + + typedef struct TCell_ + { + int x; + int cover; + TArea area; + PCell next; + + } TCell; + + + typedef struct TWorker_ + { + TCoord ex, ey; + TPos min_ex, max_ex; + TPos min_ey, max_ey; + TPos count_ex, count_ey; + + TArea area; + int cover; + int invalid; + + PCell cells; + int max_cells; + int num_cells; + + TCoord cx, cy; + TPos x, y; + + TPos last_ey; + + FT_Vector bez_stack[32 * 3 + 1]; + int lev_stack[32]; + + FT_Outline outline; + FT_Bitmap target; + FT_BBox clip_box; + + FT_Span gray_spans[FT_MAX_GRAY_SPANS]; + int num_gray_spans; + + FT_Raster_Span_Func render_span; + void* render_span_data; + int span_y; + + int band_size; + int band_shoot; + int conic_level; + int cubic_level; + + ft_jmp_buf jump_buffer; + + void* buffer; + long buffer_size; + + PCell* ycells; + int ycount; + + } TWorker, *PWorker; + + + typedef struct TRaster_ + { + void* buffer; + long buffer_size; + int band_size; + void* memory; + PWorker worker; + + } TRaster, *PRaster; + + + + /*************************************************************************/ + /* */ + /* Initialize the cells table. */ + /* */ + static void + gray_init_cells( RAS_ARG_ void* buffer, + long byte_size ) + { + ras.buffer = buffer; + ras.buffer_size = byte_size; + + ras.ycells = (PCell*) buffer; + ras.cells = NULL; + ras.max_cells = 0; + ras.num_cells = 0; + ras.area = 0; + ras.cover = 0; + ras.invalid = 1; + } + + + /*************************************************************************/ + /* */ + /* Compute the outline bounding box. */ + /* */ + static void + gray_compute_cbox( RAS_ARG ) + { + FT_Outline* outline = &ras.outline; + FT_Vector* vec = outline->points; + FT_Vector* limit = vec + outline->n_points; + + + if ( outline->n_points <= 0 ) + { + ras.min_ex = ras.max_ex = 0; + ras.min_ey = ras.max_ey = 0; + return; + } + + ras.min_ex = ras.max_ex = vec->x; + ras.min_ey = ras.max_ey = vec->y; + + vec++; + + for ( ; vec < limit; vec++ ) + { + TPos x = vec->x; + TPos y = vec->y; + + + if ( x < ras.min_ex ) ras.min_ex = x; + if ( x > ras.max_ex ) ras.max_ex = x; + if ( y < ras.min_ey ) ras.min_ey = y; + if ( y > ras.max_ey ) ras.max_ey = y; + } + + /* truncate the bounding box to integer pixels */ + ras.min_ex = ras.min_ex >> 6; + ras.min_ey = ras.min_ey >> 6; + ras.max_ex = ( ras.max_ex + 63 ) >> 6; + ras.max_ey = ( ras.max_ey + 63 ) >> 6; + } + + + /*************************************************************************/ + /* */ + /* Record the current cell in the table. */ + /* */ + static PCell + gray_find_cell( RAS_ARG ) + { + PCell *pcell, cell; + int x = ras.ex; + + + if ( x > ras.max_ex ) + x = ras.max_ex; + + pcell = &ras.ycells[ras.ey]; + for (;;) + { + cell = *pcell; + if ( cell == NULL || cell->x > x ) + break; + + if ( cell->x == x ) + goto Exit; + + pcell = &cell->next; + } + + if ( ras.num_cells >= ras.max_cells ) + ft_longjmp( ras.jump_buffer, 1 ); + + cell = ras.cells + ras.num_cells++; + cell->x = x; + cell->area = 0; + cell->cover = 0; + + cell->next = *pcell; + *pcell = cell; + + Exit: + return cell; + } + + + static void + gray_record_cell( RAS_ARG ) + { + if ( !ras.invalid && ( ras.area | ras.cover ) ) + { + PCell cell = gray_find_cell( RAS_VAR ); + + + cell->area += ras.area; + cell->cover += ras.cover; + } + } + + + /*************************************************************************/ + /* */ + /* Set the current cell to a new position. */ + /* */ + static void + gray_set_cell( RAS_ARG_ TCoord ex, + TCoord ey ) + { + /* Move the cell pointer to a new position. We set the `invalid' */ + /* flag to indicate that the cell isn't part of those we're interested */ + /* in during the render phase. This means that: */ + /* */ + /* . the new vertical position must be within min_ey..max_ey-1. */ + /* . the new horizontal position must be strictly less than max_ex */ + /* */ + /* Note that if a cell is to the left of the clipping region, it is */ + /* actually set to the (min_ex-1) horizontal position. */ + + /* All cells that are on the left of the clipping region go to the */ + /* min_ex - 1 horizontal position. */ + ey -= ras.min_ey; + + if ( ex > ras.max_ex ) + ex = ras.max_ex; + + ex -= ras.min_ex; + if ( ex < 0 ) + ex = -1; + + /* are we moving to a different cell ? */ + if ( ex != ras.ex || ey != ras.ey ) + { + /* record the current one if it is valid */ + if ( !ras.invalid ) + gray_record_cell( RAS_VAR ); + + ras.area = 0; + ras.cover = 0; + } + + ras.ex = ex; + ras.ey = ey; + ras.invalid = ( (unsigned)ey >= (unsigned)ras.count_ey || + ex >= ras.count_ex ); + } + + + /*************************************************************************/ + /* */ + /* Start a new contour at a given cell. */ + /* */ + static void + gray_start_cell( RAS_ARG_ TCoord ex, + TCoord ey ) + { + if ( ex > ras.max_ex ) + ex = (TCoord)( ras.max_ex ); + + if ( ex < ras.min_ex ) + ex = (TCoord)( ras.min_ex - 1 ); + + ras.area = 0; + ras.cover = 0; + ras.ex = ex - ras.min_ex; + ras.ey = ey - ras.min_ey; + ras.last_ey = SUBPIXELS( ey ); + ras.invalid = 0; + + gray_set_cell( RAS_VAR_ ex, ey ); + } + + + /*************************************************************************/ + /* */ + /* Render a scanline as one or more cells. */ + /* */ + static void + gray_render_scanline( RAS_ARG_ TCoord ey, + TPos x1, + TCoord y1, + TPos x2, + TCoord y2 ) + { + TCoord ex1, ex2, fx1, fx2, delta; + long p, first, dx; + int incr, lift, mod, rem; + + + dx = x2 - x1; + + ex1 = TRUNC( x1 ); + ex2 = TRUNC( x2 ); + fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) ); + fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) ); + + /* trivial case. Happens often */ + if ( y1 == y2 ) + { + gray_set_cell( RAS_VAR_ ex2, ey ); + return; + } + + /* everything is located in a single cell. That is easy! */ + /* */ + if ( ex1 == ex2 ) + { + delta = y2 - y1; + ras.area += (TArea)( fx1 + fx2 ) * delta; + ras.cover += delta; + return; + } + + /* ok, we'll have to render a run of adjacent cells on the same */ + /* scanline... */ + /* */ + p = ( ONE_PIXEL - fx1 ) * ( y2 - y1 ); + first = ONE_PIXEL; + incr = 1; + + if ( dx < 0 ) + { + p = fx1 * ( y2 - y1 ); + first = 0; + incr = -1; + dx = -dx; + } + + delta = (TCoord)( p / dx ); + mod = (TCoord)( p % dx ); + if ( mod < 0 ) + { + delta--; + mod += (TCoord)dx; + } + + ras.area += (TArea)( fx1 + first ) * delta; + ras.cover += delta; + + ex1 += incr; + gray_set_cell( RAS_VAR_ ex1, ey ); + y1 += delta; + + if ( ex1 != ex2 ) + { + p = ONE_PIXEL * ( y2 - y1 + delta ); + lift = (TCoord)( p / dx ); + rem = (TCoord)( p % dx ); + if ( rem < 0 ) + { + lift--; + rem += (TCoord)dx; + } + + mod -= (int)dx; + + while ( ex1 != ex2 ) + { + delta = lift; + mod += rem; + if ( mod >= 0 ) + { + mod -= (TCoord)dx; + delta++; + } + + ras.area += (TArea)ONE_PIXEL * delta; + ras.cover += delta; + y1 += delta; + ex1 += incr; + gray_set_cell( RAS_VAR_ ex1, ey ); + } + } + + delta = y2 - y1; + ras.area += (TArea)( fx2 + ONE_PIXEL - first ) * delta; + ras.cover += delta; + } + + + /*************************************************************************/ + /* */ + /* Render a given line as a series of scanlines. */ + /* */ + static void + gray_render_line( RAS_ARG_ TPos to_x, + TPos to_y ) + { + TCoord ey1, ey2, fy1, fy2; + TPos dx, dy, x, x2; + long p, first; + int delta, rem, mod, lift, incr; + + + ey1 = TRUNC( ras.last_ey ); + ey2 = TRUNC( to_y ); /* if (ey2 >= ras.max_ey) ey2 = ras.max_ey-1; */ + fy1 = (TCoord)( ras.y - ras.last_ey ); + fy2 = (TCoord)( to_y - SUBPIXELS( ey2 ) ); + + dx = to_x - ras.x; + dy = to_y - ras.y; + + /* XXX: we should do something about the trivial case where dx == 0, */ + /* as it happens very often! */ + + /* perform vertical clipping */ + { + TCoord min, max; + + + min = ey1; + max = ey2; + if ( ey1 > ey2 ) + { + min = ey2; + max = ey1; + } + if ( min >= ras.max_ey || max < ras.min_ey ) + goto End; + } + + /* everything is on a single scanline */ + if ( ey1 == ey2 ) + { + gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, to_x, fy2 ); + goto End; + } + + /* vertical line - avoid calling gray_render_scanline */ + incr = 1; + + if ( dx == 0 ) + { + TCoord ex = TRUNC( ras.x ); + TCoord two_fx = (TCoord)( ( ras.x - SUBPIXELS( ex ) ) << 1 ); + TPos area; + + + first = ONE_PIXEL; + if ( dy < 0 ) + { + first = 0; + incr = -1; + } + + delta = (int)( first - fy1 ); + ras.area += (TArea)two_fx * delta; + ras.cover += delta; + ey1 += incr; + + gray_set_cell( &ras, ex, ey1 ); + + delta = (int)( first + first - ONE_PIXEL ); + area = (TArea)two_fx * delta; + while ( ey1 != ey2 ) + { + ras.area += area; + ras.cover += delta; + ey1 += incr; + + gray_set_cell( &ras, ex, ey1 ); + } + + delta = (int)( fy2 - ONE_PIXEL + first ); + ras.area += (TArea)two_fx * delta; + ras.cover += delta; + + goto End; + } + + /* ok, we have to render several scanlines */ + p = ( ONE_PIXEL - fy1 ) * dx; + first = ONE_PIXEL; + incr = 1; + + if ( dy < 0 ) + { + p = fy1 * dx; + first = 0; + incr = -1; + dy = -dy; + } + + delta = (int)( p / dy ); + mod = (int)( p % dy ); + if ( mod < 0 ) + { + delta--; + mod += (TCoord)dy; + } + + x = ras.x + delta; + gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, (TCoord)first ); + + ey1 += incr; + gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 ); + + if ( ey1 != ey2 ) + { + p = ONE_PIXEL * dx; + lift = (int)( p / dy ); + rem = (int)( p % dy ); + if ( rem < 0 ) + { + lift--; + rem += (int)dy; + } + mod -= (int)dy; + + while ( ey1 != ey2 ) + { + delta = lift; + mod += rem; + if ( mod >= 0 ) + { + mod -= (int)dy; + delta++; + } + + x2 = x + delta; + gray_render_scanline( RAS_VAR_ ey1, x, + (TCoord)( ONE_PIXEL - first ), x2, + (TCoord)first ); + x = x2; + + ey1 += incr; + gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 ); + } + } + + gray_render_scanline( RAS_VAR_ ey1, x, + (TCoord)( ONE_PIXEL - first ), to_x, + fy2 ); + + End: + ras.x = to_x; + ras.y = to_y; + ras.last_ey = SUBPIXELS( ey2 ); + } + + + static void + gray_split_conic( FT_Vector* base ) + { + TPos a, b; + + + base[4].x = base[2].x; + b = base[1].x; + a = base[3].x = ( base[2].x + b ) / 2; + b = base[1].x = ( base[0].x + b ) / 2; + base[2].x = ( a + b ) / 2; + + base[4].y = base[2].y; + b = base[1].y; + a = base[3].y = ( base[2].y + b ) / 2; + b = base[1].y = ( base[0].y + b ) / 2; + base[2].y = ( a + b ) / 2; + } + + + static void + gray_render_conic( RAS_ARG_ const FT_Vector* control, + const FT_Vector* to ) + { + TPos dx, dy; + int top, level; + int* levels; + FT_Vector* arc; + + + dx = DOWNSCALE( ras.x ) + to->x - ( control->x << 1 ); + if ( dx < 0 ) + dx = -dx; + dy = DOWNSCALE( ras.y ) + to->y - ( control->y << 1 ); + if ( dy < 0 ) + dy = -dy; + if ( dx < dy ) + dx = dy; + + level = 1; + dx = dx / ras.conic_level; + while ( dx > 0 ) + { + dx >>= 2; + level++; + } + + /* a shortcut to speed things up */ + if ( level <= 1 ) + { + /* we compute the mid-point directly in order to avoid */ + /* calling gray_split_conic() */ + TPos to_x, to_y, mid_x, mid_y; + + + to_x = UPSCALE( to->x ); + to_y = UPSCALE( to->y ); + mid_x = ( ras.x + to_x + 2 * UPSCALE( control->x ) ) / 4; + mid_y = ( ras.y + to_y + 2 * UPSCALE( control->y ) ) / 4; + + gray_render_line( RAS_VAR_ mid_x, mid_y ); + gray_render_line( RAS_VAR_ to_x, to_y ); + + return; + } + + arc = ras.bez_stack; + levels = ras.lev_stack; + top = 0; + levels[0] = level; + + arc[0].x = UPSCALE( to->x ); + arc[0].y = UPSCALE( to->y ); + arc[1].x = UPSCALE( control->x ); + arc[1].y = UPSCALE( control->y ); + arc[2].x = ras.x; + arc[2].y = ras.y; + + while ( top >= 0 ) + { + level = levels[top]; + if ( level > 1 ) + { + /* check that the arc crosses the current band */ + TPos min, max, y; + + + min = max = arc[0].y; + + y = arc[1].y; + if ( y < min ) min = y; + if ( y > max ) max = y; + + y = arc[2].y; + if ( y < min ) min = y; + if ( y > max ) max = y; + + if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) + goto Draw; + + gray_split_conic( arc ); + arc += 2; + top++; + levels[top] = levels[top - 1] = level - 1; + continue; + } + + Draw: + { + TPos to_x, to_y, mid_x, mid_y; + + + to_x = arc[0].x; + to_y = arc[0].y; + mid_x = ( ras.x + to_x + 2 * arc[1].x ) / 4; + mid_y = ( ras.y + to_y + 2 * arc[1].y ) / 4; + + gray_render_line( RAS_VAR_ mid_x, mid_y ); + gray_render_line( RAS_VAR_ to_x, to_y ); + + top--; + arc -= 2; + } + } + + return; + } + + + static void + gray_split_cubic( FT_Vector* base ) + { + TPos a, b, c, d; + + + base[6].x = base[3].x; + c = base[1].x; + d = base[2].x; + base[1].x = a = ( base[0].x + c ) / 2; + base[5].x = b = ( base[3].x + d ) / 2; + c = ( c + d ) / 2; + base[2].x = a = ( a + c ) / 2; + base[4].x = b = ( b + c ) / 2; + base[3].x = ( a + b ) / 2; + + base[6].y = base[3].y; + c = base[1].y; + d = base[2].y; + base[1].y = a = ( base[0].y + c ) / 2; + base[5].y = b = ( base[3].y + d ) / 2; + c = ( c + d ) / 2; + base[2].y = a = ( a + c ) / 2; + base[4].y = b = ( b + c ) / 2; + base[3].y = ( a + b ) / 2; + } + + + static void + gray_render_cubic( RAS_ARG_ const FT_Vector* control1, + const FT_Vector* control2, + const FT_Vector* to ) + { + TPos dx, dy, da, db; + int top, level; + int* levels; + FT_Vector* arc; + + + dx = DOWNSCALE( ras.x ) + to->x - ( control1->x << 1 ); + if ( dx < 0 ) + dx = -dx; + dy = DOWNSCALE( ras.y ) + to->y - ( control1->y << 1 ); + if ( dy < 0 ) + dy = -dy; + if ( dx < dy ) + dx = dy; + da = dx; + + dx = DOWNSCALE( ras.x ) + to->x - 3 * ( control1->x + control2->x ); + if ( dx < 0 ) + dx = -dx; + dy = DOWNSCALE( ras.y ) + to->y - 3 * ( control1->x + control2->y ); + if ( dy < 0 ) + dy = -dy; + if ( dx < dy ) + dx = dy; + db = dx; + + level = 1; + da = da / ras.cubic_level; + db = db / ras.conic_level; + while ( da > 0 || db > 0 ) + { + da >>= 2; + db >>= 3; + level++; + } + + if ( level <= 1 ) + { + TPos to_x, to_y, mid_x, mid_y; + + + to_x = UPSCALE( to->x ); + to_y = UPSCALE( to->y ); + mid_x = ( ras.x + to_x + + 3 * UPSCALE( control1->x + control2->x ) ) / 8; + mid_y = ( ras.y + to_y + + 3 * UPSCALE( control1->y + control2->y ) ) / 8; + + gray_render_line( RAS_VAR_ mid_x, mid_y ); + gray_render_line( RAS_VAR_ to_x, to_y ); + return; + } + + arc = ras.bez_stack; + arc[0].x = UPSCALE( to->x ); + arc[0].y = UPSCALE( to->y ); + arc[1].x = UPSCALE( control2->x ); + arc[1].y = UPSCALE( control2->y ); + arc[2].x = UPSCALE( control1->x ); + arc[2].y = UPSCALE( control1->y ); + arc[3].x = ras.x; + arc[3].y = ras.y; + + levels = ras.lev_stack; + top = 0; + levels[0] = level; + + while ( top >= 0 ) + { + level = levels[top]; + if ( level > 1 ) + { + /* check that the arc crosses the current band */ + TPos min, max, y; + + + min = max = arc[0].y; + y = arc[1].y; + if ( y < min ) min = y; + if ( y > max ) max = y; + y = arc[2].y; + if ( y < min ) min = y; + if ( y > max ) max = y; + y = arc[3].y; + if ( y < min ) min = y; + if ( y > max ) max = y; + if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < 0 ) + goto Draw; + gray_split_cubic( arc ); + arc += 3; + top ++; + levels[top] = levels[top - 1] = level - 1; + continue; + } + + Draw: + { + TPos to_x, to_y, mid_x, mid_y; + + + to_x = arc[0].x; + to_y = arc[0].y; + mid_x = ( ras.x + to_x + 3 * ( arc[1].x + arc[2].x ) ) / 8; + mid_y = ( ras.y + to_y + 3 * ( arc[1].y + arc[2].y ) ) / 8; + + gray_render_line( RAS_VAR_ mid_x, mid_y ); + gray_render_line( RAS_VAR_ to_x, to_y ); + top --; + arc -= 3; + } + } + + return; + } + + + + static int + gray_move_to( const FT_Vector* to, + PWorker worker ) + { + TPos x, y; + + + /* record current cell, if any */ + gray_record_cell( worker ); + + /* start to a new position */ + x = UPSCALE( to->x ); + y = UPSCALE( to->y ); + + gray_start_cell( worker, TRUNC( x ), TRUNC( y ) ); + + worker->x = x; + worker->y = y; + return 0; + } + + + static int + gray_line_to( const FT_Vector* to, + PWorker worker ) + { + gray_render_line( worker, UPSCALE( to->x ), UPSCALE( to->y ) ); + return 0; + } + + + static int + gray_conic_to( const FT_Vector* control, + const FT_Vector* to, + PWorker worker ) + { + gray_render_conic( worker, control, to ); + return 0; + } + + + static int + gray_cubic_to( const FT_Vector* control1, + const FT_Vector* control2, + const FT_Vector* to, + PWorker worker ) + { + gray_render_cubic( worker, control1, control2, to ); + return 0; + } + + + static void + gray_render_span( int y, + int count, + const FT_Span* spans, + PWorker worker ) + { + unsigned char* p; + FT_Bitmap* map = &worker->target; + + + /* first of all, compute the scanline offset */ + p = (unsigned char*)map->buffer - y * map->pitch; + if ( map->pitch >= 0 ) + p += ( map->rows - 1 ) * map->pitch; + + for ( ; count > 0; count--, spans++ ) + { + unsigned char coverage = spans->coverage; + + + if ( coverage ) + { + /* For small-spans it is faster to do it by ourselves than + * calling `memset'. This is mainly due to the cost of the + * function call. + */ + if ( spans->len >= 8 ) + FT_MEM_SET( p + spans->x, (unsigned char)coverage, spans->len ); + else + { + unsigned char* q = p + spans->x; + + + switch ( spans->len ) + { + case 7: *q++ = (unsigned char)coverage; + case 6: *q++ = (unsigned char)coverage; + case 5: *q++ = (unsigned char)coverage; + case 4: *q++ = (unsigned char)coverage; + case 3: *q++ = (unsigned char)coverage; + case 2: *q++ = (unsigned char)coverage; + case 1: *q = (unsigned char)coverage; + default: + ; + } + } + } + } + } + + + static void + gray_hline( RAS_ARG_ TCoord x, + TCoord y, + TPos area, + int acount ) + { + FT_Span* span; + int count; + int coverage; + + + /* compute the coverage line's coverage, depending on the */ + /* outline fill rule */ + /* */ + /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2) */ + /* */ + coverage = (int)( area >> ( PIXEL_BITS * 2 + 1 - 8 ) ); + /* use range 0..256 */ + if ( coverage < 0 ) + coverage = -coverage; + + if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) + { + coverage &= 511; + + if ( coverage > 256 ) + coverage = 512 - coverage; + else if ( coverage == 256 ) + coverage = 255; + } + else + { + /* normal non-zero winding rule */ + if ( coverage >= 256 ) + coverage = 255; + } + + y += (TCoord)ras.min_ey; + x += (TCoord)ras.min_ex; + + /* FT_Span.x is a 16-bit short, so limit our coordinates appropriately */ + if ( x >= 32768 ) + x = 32767; + + if ( coverage ) + { + /* see whether we can add this span to the current list */ + count = ras.num_gray_spans; + span = ras.gray_spans + count - 1; + if ( count > 0 && + ras.span_y == y && + (int)span->x + span->len == (int)x && + span->coverage == coverage ) + { + span->len = (unsigned short)( span->len + acount ); + return; + } + + if ( ras.span_y != y || count >= FT_MAX_GRAY_SPANS ) + { + if ( ras.render_span && count > 0 ) + ras.render_span( ras.span_y, count, ras.gray_spans, + ras.render_span_data ); + /* ras.render_span( span->y, ras.gray_spans, count ); */ + +#ifdef DEBUG_GRAYS + + if ( ras.span_y >= 0 ) + { + int n; + + + fprintf( stderr, "y=%3d ", ras.span_y ); + span = ras.gray_spans; + for ( n = 0; n < count; n++, span++ ) + fprintf( stderr, "[%d..%d]:%02x ", + span->x, span->x + span->len - 1, span->coverage ); + fprintf( stderr, "\n" ); + } + +#endif /* DEBUG_GRAYS */ + + ras.num_gray_spans = 0; + ras.span_y = y; + + count = 0; + span = ras.gray_spans; + } + else + span++; + + /* add a gray span to the current list */ + span->x = (short)x; + span->len = (unsigned short)acount; + span->coverage = (unsigned char)coverage; + + ras.num_gray_spans++; + } + } + + +#ifdef DEBUG_GRAYS + + /* to be called while in the debugger */ + gray_dump_cells( RAS_ARG ) + { + int yindex; + + + for ( yindex = 0; yindex < ras.ycount; yindex++ ) + { + PCell cell; + + + printf( "%3d:", yindex ); + + for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next ) + printf( " (%3d, c:%4d, a:%6d)", cell->x, cell->cover, cell->area ); + printf( "\n" ); + } + } + +#endif /* DEBUG_GRAYS */ + + + static void + gray_sweep( RAS_ARG_ const FT_Bitmap* target ) + { + int yindex; + + FT_UNUSED( target ); + + + if ( ras.num_cells == 0 ) + return; + + ras.num_gray_spans = 0; + + for ( yindex = 0; yindex < ras.ycount; yindex++ ) + { + PCell cell = ras.ycells[yindex]; + TCoord cover = 0; + TCoord x = 0; + + + for ( ; cell != NULL; cell = cell->next ) + { + TArea area; + + + if ( cell->x > x && cover != 0 ) + gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ), + cell->x - x ); + + cover += cell->cover; + area = cover * ( ONE_PIXEL * 2 ) - cell->area; + + if ( area != 0 && cell->x >= 0 ) + gray_hline( RAS_VAR_ cell->x, yindex, area, 1 ); + + x = cell->x + 1; + } + + if ( cover != 0 ) + gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ), + ras.count_ex - x ); + } + + if ( ras.render_span && ras.num_gray_spans > 0 ) + ras.render_span( ras.span_y, ras.num_gray_spans, + ras.gray_spans, ras.render_span_data ); + } + + +#ifdef _STANDALONE_ + + /*************************************************************************/ + /* */ + /* The following function should only compile in stand_alone mode, */ + /* i.e., when building this component without the rest of FreeType. */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* */ + /* FT_Outline_Decompose */ + /* */ + /* */ + /* Walks over an outline's structure to decompose it into individual */ + /* segments and Bezier arcs. This function is also able to emit */ + /* `move to' and `close to' operations to indicate the start and end */ + /* of new contours in the outline. */ + /* */ + /* */ + /* outline :: A pointer to the source target. */ + /* */ + /* func_interface :: A table of `emitters', i.e,. function pointers */ + /* called during decomposition to indicate path */ + /* operations. */ + /* */ + /* user :: A typeless pointer which is passed to each */ + /* emitter during the decomposition. It can be */ + /* used to store the state during the */ + /* decomposition. */ + /* */ + /* */ + /* Error code. 0 means success. */ + /* */ + static + int FT_Outline_Decompose( const FT_Outline* outline, + const FT_Outline_Funcs* func_interface, + void* user ) + { +#undef SCALED +#if 0 +#define SCALED( x ) ( ( (x) << shift ) - delta ) +#else +#define SCALED( x ) (x) +#endif + + FT_Vector v_last; + FT_Vector v_control; + FT_Vector v_start; + + FT_Vector* point; + FT_Vector* limit; + char* tags; + + int n; /* index of contour in outline */ + int first; /* index of first point in contour */ + int error; + char tag; /* current point's state */ + +#if 0 + int shift = func_interface->shift; + TPos delta = func_interface->delta; +#endif + + + first = 0; + + for ( n = 0; n < outline->n_contours; n++ ) + { + int last; /* index of last point in contour */ + + + last = outline->contours[n]; + limit = outline->points + last; + + v_start = outline->points[first]; + v_last = outline->points[last]; + + v_start.x = SCALED( v_start.x ); + v_start.y = SCALED( v_start.y ); + + v_last.x = SCALED( v_last.x ); + v_last.y = SCALED( v_last.y ); + + v_control = v_start; + + point = outline->points + first; + tags = outline->tags + first; + tag = FT_CURVE_TAG( tags[0] ); + + /* A contour cannot start with a cubic control point! */ + if ( tag == FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + /* check first point to determine origin */ + if ( tag == FT_CURVE_TAG_CONIC ) + { + /* first point is conic control. Yes, this happens. */ + if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON ) + { + /* start at last point if it is on the curve */ + v_start = v_last; + limit--; + } + else + { + /* if both first and last points are conic, */ + /* start at their middle and record its position */ + /* for closure */ + v_start.x = ( v_start.x + v_last.x ) / 2; + v_start.y = ( v_start.y + v_last.y ) / 2; + + v_last = v_start; + } + point--; + tags--; + } + + error = func_interface->move_to( &v_start, user ); + if ( error ) + goto Exit; + + while ( point < limit ) + { + point++; + tags++; + + tag = FT_CURVE_TAG( tags[0] ); + switch ( tag ) + { + case FT_CURVE_TAG_ON: /* emit a single line_to */ + { + FT_Vector vec; + + + vec.x = SCALED( point->x ); + vec.y = SCALED( point->y ); + + error = func_interface->line_to( &vec, user ); + if ( error ) + goto Exit; + continue; + } + + case FT_CURVE_TAG_CONIC: /* consume conic arcs */ + { + v_control.x = SCALED( point->x ); + v_control.y = SCALED( point->y ); + + Do_Conic: + if ( point < limit ) + { + FT_Vector vec; + FT_Vector v_middle; + + + point++; + tags++; + tag = FT_CURVE_TAG( tags[0] ); + + vec.x = SCALED( point->x ); + vec.y = SCALED( point->y ); + + if ( tag == FT_CURVE_TAG_ON ) + { + error = func_interface->conic_to( &v_control, &vec, + user ); + if ( error ) + goto Exit; + continue; + } + + if ( tag != FT_CURVE_TAG_CONIC ) + goto Invalid_Outline; + + v_middle.x = ( v_control.x + vec.x ) / 2; + v_middle.y = ( v_control.y + vec.y ) / 2; + + error = func_interface->conic_to( &v_control, &v_middle, + user ); + if ( error ) + goto Exit; + + v_control = vec; + goto Do_Conic; + } + + error = func_interface->conic_to( &v_control, &v_start, + user ); + goto Close; + } + + default: /* FT_CURVE_TAG_CUBIC */ + { + FT_Vector vec1, vec2; + + + if ( point + 1 > limit || + FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) + goto Invalid_Outline; + + point += 2; + tags += 2; + + vec1.x = SCALED( point[-2].x ); + vec1.y = SCALED( point[-2].y ); + + vec2.x = SCALED( point[-1].x ); + vec2.y = SCALED( point[-1].y ); + + if ( point <= limit ) + { + FT_Vector vec; + + + vec.x = SCALED( point->x ); + vec.y = SCALED( point->y ); + + error = func_interface->cubic_to( &vec1, &vec2, &vec, user ); + if ( error ) + goto Exit; + continue; + } + + error = func_interface->cubic_to( &vec1, &vec2, &v_start, user ); + goto Close; + } + } + } + + /* close the contour with a line segment */ + error = func_interface->line_to( &v_start, user ); + + Close: + if ( error ) + goto Exit; + + first = last + 1; + } + + return 0; + + Exit: + return error; + + Invalid_Outline: + return ErrRaster_Invalid_Outline; + } + +#endif /* _STANDALONE_ */ + + + typedef struct TBand_ + { + TPos min, max; + + } TBand; + + + static int + gray_convert_glyph_inner( RAS_ARG ) + { + static + const FT_Outline_Funcs func_interface = + { + (FT_Outline_MoveTo_Func) gray_move_to, + (FT_Outline_LineTo_Func) gray_line_to, + (FT_Outline_ConicTo_Func)gray_conic_to, + (FT_Outline_CubicTo_Func)gray_cubic_to, + 0, + 0 + }; + + volatile int error = 0; + + if ( ft_setjmp( ras.jump_buffer ) == 0 ) + { + error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras ); + gray_record_cell( RAS_VAR ); + } + else + { + error = ErrRaster_Memory_Overflow; + } + + return error; + } + + + static int + gray_convert_glyph( RAS_ARG ) + { + TBand bands[40]; + TBand* volatile band; + int volatile n, num_bands; + TPos volatile min, max, max_y; + FT_BBox* clip; + + + /* Set up state in the raster object */ + gray_compute_cbox( RAS_VAR ); + + /* clip to target bitmap, exit if nothing to do */ + clip = &ras.clip_box; + + if ( ras.max_ex <= clip->xMin || ras.min_ex >= clip->xMax || + ras.max_ey <= clip->yMin || ras.min_ey >= clip->yMax ) + return 0; + + if ( ras.min_ex < clip->xMin ) ras.min_ex = clip->xMin; + if ( ras.min_ey < clip->yMin ) ras.min_ey = clip->yMin; + + if ( ras.max_ex > clip->xMax ) ras.max_ex = clip->xMax; + if ( ras.max_ey > clip->yMax ) ras.max_ey = clip->yMax; + + ras.count_ex = ras.max_ex - ras.min_ex; + ras.count_ey = ras.max_ey - ras.min_ey; + + /* simple heuristic used to speed-up the bezier decomposition -- see */ + /* the code in gray_render_conic() and gray_render_cubic() for more */ + /* details */ + ras.conic_level = 32; + ras.cubic_level = 16; + + { + int level = 0; + + + if ( ras.count_ex > 24 || ras.count_ey > 24 ) + level++; + if ( ras.count_ex > 120 || ras.count_ey > 120 ) + level++; + + ras.conic_level <<= level; + ras.cubic_level <<= level; + } + + /* setup vertical bands */ + num_bands = (int)( ( ras.max_ey - ras.min_ey ) / ras.band_size ); + if ( num_bands == 0 ) num_bands = 1; + if ( num_bands >= 39 ) num_bands = 39; + + ras.band_shoot = 0; + + min = ras.min_ey; + max_y = ras.max_ey; + + for ( n = 0; n < num_bands; n++, min = max ) + { + max = min + ras.band_size; + if ( n == num_bands - 1 || max > max_y ) + max = max_y; + + bands[0].min = min; + bands[0].max = max; + band = bands; + + while ( band >= bands ) + { + TPos bottom, top, middle; + int error; + + { + PCell cells_max; + int yindex; + long cell_start, cell_end, cell_mod; + + + ras.ycells = (PCell*)ras.buffer; + ras.ycount = band->max - band->min; + + cell_start = sizeof ( PCell ) * ras.ycount; + cell_mod = cell_start % sizeof ( TCell ); + if ( cell_mod > 0 ) + cell_start += sizeof ( TCell ) - cell_mod; + + cell_end = ras.buffer_size; + cell_end -= cell_end % sizeof( TCell ); + + cells_max = (PCell)( (char*)ras.buffer + cell_end ); + ras.cells = (PCell)( (char*)ras.buffer + cell_start ); + if ( ras.cells >= cells_max ) + goto ReduceBands; + + ras.max_cells = cells_max - ras.cells; + if ( ras.max_cells < 2 ) + goto ReduceBands; + + for ( yindex = 0; yindex < ras.ycount; yindex++ ) + ras.ycells[yindex] = NULL; + } + + ras.num_cells = 0; + ras.invalid = 1; + ras.min_ey = band->min; + ras.max_ey = band->max; + ras.count_ey = band->max - band->min; + + error = gray_convert_glyph_inner( RAS_VAR ); + + if ( !error ) + { + gray_sweep( RAS_VAR_ &ras.target ); + band--; + continue; + } + else if ( error != ErrRaster_Memory_Overflow ) + return 1; + + ReduceBands: + /* render pool overflow; we will reduce the render band by half */ + bottom = band->min; + top = band->max; + middle = bottom + ( ( top - bottom ) >> 1 ); + + /* This is too complex for a single scanline; there must */ + /* be some problems. */ + if ( middle == bottom ) + { +#ifdef DEBUG_GRAYS + fprintf( stderr, "Rotten glyph!\n" ); +#endif + return 1; + } + + if ( bottom-top >= ras.band_size ) + ras.band_shoot++; + + band[1].min = bottom; + band[1].max = middle; + band[0].min = middle; + band[0].max = top; + band++; + } + } + + if ( ras.band_shoot > 8 && ras.band_size > 16 ) + ras.band_size = ras.band_size / 2; + + return 0; + } + + + static int + gray_raster_render( PRaster raster, + const FT_Raster_Params* params ) + { + const FT_Outline* outline = (const FT_Outline*)params->source; + const FT_Bitmap* target_map = params->target; + PWorker worker; + + + if ( !raster || !raster->buffer || !raster->buffer_size ) + return ErrRaster_Invalid_Argument; + + /* return immediately if the outline is empty */ + if ( outline->n_points == 0 || outline->n_contours <= 0 ) + return 0; + + if ( !outline || !outline->contours || !outline->points ) + return ErrRaster_Invalid_Outline; + + if ( outline->n_points != + outline->contours[outline->n_contours - 1] + 1 ) + return ErrRaster_Invalid_Outline; + + worker = raster->worker; + + /* if direct mode is not set, we must have a target bitmap */ + if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 ) + { + if ( !target_map ) + return ErrRaster_Invalid_Argument; + + /* nothing to do */ + if ( !target_map->width || !target_map->rows ) + return 0; + + if ( !target_map->buffer ) + return ErrRaster_Invalid_Argument; + } + + /* this version does not support monochrome rendering */ + if ( !( params->flags & FT_RASTER_FLAG_AA ) ) + return ErrRaster_Invalid_Mode; + + /* compute clipping box */ + if ( ( params->flags & FT_RASTER_FLAG_DIRECT ) == 0 ) + { + /* compute clip box from target pixmap */ + ras.clip_box.xMin = 0; + ras.clip_box.yMin = 0; + ras.clip_box.xMax = target_map->width; + ras.clip_box.yMax = target_map->rows; + } + else if ( params->flags & FT_RASTER_FLAG_CLIP ) + { + ras.clip_box = params->clip_box; + } + else + { + ras.clip_box.xMin = -32768L; + ras.clip_box.yMin = -32768L; + ras.clip_box.xMax = 32767L; + ras.clip_box.yMax = 32767L; + } + + gray_init_cells( worker, raster->buffer, raster->buffer_size ); + + ras.outline = *outline; + ras.num_cells = 0; + ras.invalid = 1; + ras.band_size = raster->band_size; + ras.num_gray_spans = 0; + + if ( target_map ) + ras.target = *target_map; + + ras.render_span = (FT_Raster_Span_Func)gray_render_span; + ras.render_span_data = &ras; + + if ( params->flags & FT_RASTER_FLAG_DIRECT ) + { + ras.render_span = (FT_Raster_Span_Func)params->gray_spans; + ras.render_span_data = params->user; + } + + return gray_convert_glyph( worker ); + } + + + /**** RASTER OBJECT CREATION: In standalone mode, we simply use *****/ + /**** a static object. *****/ + +#ifdef _STANDALONE_ + + static int + gray_raster_new( void* memory, + FT_Raster* araster ) + { + static TRaster the_raster; + + FT_UNUSED( memory ); + + + *araster = (FT_Raster)&the_raster; + FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) ); + + return 0; + } + + + static void + gray_raster_done( FT_Raster raster ) + { + /* nothing */ + FT_UNUSED( raster ); + } + +#else /* _STANDALONE_ */ + + static int + gray_raster_new( FT_Memory memory, + FT_Raster* araster ) + { + FT_Error error; + PRaster raster; + + + *araster = 0; + if ( !FT_ALLOC( raster, sizeof ( TRaster ) ) ) + { + raster->memory = memory; + *araster = (FT_Raster)raster; + } + + return error; + } + + + static void + gray_raster_done( FT_Raster raster ) + { + FT_Memory memory = (FT_Memory)((PRaster)raster)->memory; + + + FT_FREE( raster ); + } + +#endif /* _STANDALONE_ */ + + + static void + gray_raster_reset( FT_Raster raster, + char* pool_base, + long pool_size ) + { + PRaster rast = (PRaster)raster; + + + if ( raster ) + { + if ( pool_base && pool_size >= (long)sizeof ( TWorker ) + 2048 ) + { + PWorker worker = (PWorker)pool_base; + + + rast->worker = worker; + rast->buffer = pool_base + + ( ( sizeof ( TWorker ) + sizeof ( TCell ) - 1 ) & + ~( sizeof ( TCell ) - 1 ) ); + rast->buffer_size = (long)( ( pool_base + pool_size ) - + (char*)rast->buffer ) & + ~( sizeof ( TCell ) - 1 ); + rast->band_size = (int)( rast->buffer_size / + ( sizeof ( TCell ) * 8 ) ); + } + else + { + rast->buffer = NULL; + rast->buffer_size = 0; + rast->worker = NULL; + } + } + } + + + const FT_Raster_Funcs ft_grays_raster = + { + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Raster_New_Func) gray_raster_new, + (FT_Raster_Reset_Func) gray_raster_reset, + (FT_Raster_Set_Mode_Func)0, + (FT_Raster_Render_Func) gray_raster_render, + (FT_Raster_Done_Func) gray_raster_done + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.h b/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.h index 2d409543dce..121ad49f4fa 100644 --- a/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.h +++ b/reactos/dll/3rdparty/freetype/src/smooth/ftgrays.h @@ -1,57 +1,57 @@ -/***************************************************************************/ -/* */ -/* ftgrays.h */ -/* */ -/* FreeType smooth renderer declaration */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTGRAYS_H__ -#define __FTGRAYS_H__ - -#ifdef __cplusplus - extern "C" { -#endif - - -#ifdef _STANDALONE_ -#include "ftimage.h" -#else -#include -#include FT_IMAGE_H -#endif - - - /*************************************************************************/ - /* */ - /* To make ftgrays.h independent from configuration files we check */ - /* whether FT_EXPORT_VAR has been defined already. */ - /* */ - /* On some systems and compilers (Win32 mostly), an extra keyword is */ - /* necessary to compile the library as a DLL. */ - /* */ -#ifndef FT_EXPORT_VAR -#define FT_EXPORT_VAR( x ) extern x -#endif - - FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; - - -#ifdef __cplusplus - } -#endif - -#endif /* __FTGRAYS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftgrays.h */ +/* */ +/* FreeType smooth renderer declaration */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTGRAYS_H__ +#define __FTGRAYS_H__ + +#ifdef __cplusplus + extern "C" { +#endif + + +#ifdef _STANDALONE_ +#include "ftimage.h" +#else +#include +#include FT_IMAGE_H +#endif + + + /*************************************************************************/ + /* */ + /* To make ftgrays.h independent from configuration files we check */ + /* whether FT_EXPORT_VAR has been defined already. */ + /* */ + /* On some systems and compilers (Win32 mostly), an extra keyword is */ + /* necessary to compile the library as a DLL. */ + /* */ +#ifndef FT_EXPORT_VAR +#define FT_EXPORT_VAR( x ) extern x +#endif + + FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; + + +#ifdef __cplusplus + } +#endif + +#endif /* __FTGRAYS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/smooth/ftsmerrs.h b/reactos/dll/3rdparty/freetype/src/smooth/ftsmerrs.h index 0c2a2ecd90b..d5a96b15834 100644 --- a/reactos/dll/3rdparty/freetype/src/smooth/ftsmerrs.h +++ b/reactos/dll/3rdparty/freetype/src/smooth/ftsmerrs.h @@ -1,41 +1,41 @@ -/***************************************************************************/ -/* */ -/* ftsmerrs.h */ -/* */ -/* smooth renderer error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the smooth renderer error enumeration */ - /* constants. */ - /* */ - /*************************************************************************/ - -#ifndef __FTSMERRS_H__ -#define __FTSMERRS_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX Smooth_Err_ -#define FT_ERR_BASE FT_Mod_Err_Smooth - -#include FT_ERRORS_H - -#endif /* __FTSMERRS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftsmerrs.h */ +/* */ +/* smooth renderer error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the smooth renderer error enumeration */ + /* constants. */ + /* */ + /*************************************************************************/ + +#ifndef __FTSMERRS_H__ +#define __FTSMERRS_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX Smooth_Err_ +#define FT_ERR_BASE FT_Mod_Err_Smooth + +#include FT_ERRORS_H + +#endif /* __FTSMERRS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.c b/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.c index 85d04eb458e..688aa2eb654 100644 --- a/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.c +++ b/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.c @@ -1,467 +1,467 @@ -/***************************************************************************/ -/* */ -/* ftsmooth.c */ -/* */ -/* Anti-aliasing renderer interface (body). */ -/* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_OBJECTS_H -#include FT_OUTLINE_H -#include "ftsmooth.h" -#include "ftgrays.h" - -#include "ftsmerrs.h" - - - /* initialize renderer -- init its raster */ - static FT_Error - ft_smooth_init( FT_Renderer render ) - { - FT_Library library = FT_MODULE_LIBRARY( render ); - - - render->clazz->raster_class->raster_reset( render->raster, - library->raster_pool, - library->raster_pool_size ); - - return 0; - } - - - /* sets render-specific mode */ - static FT_Error - ft_smooth_set_mode( FT_Renderer render, - FT_ULong mode_tag, - FT_Pointer data ) - { - /* we simply pass it to the raster */ - return render->clazz->raster_class->raster_set_mode( render->raster, - mode_tag, - data ); - } - - /* transform a given glyph image */ - static FT_Error - ft_smooth_transform( FT_Renderer render, - FT_GlyphSlot slot, - const FT_Matrix* matrix, - const FT_Vector* delta ) - { - FT_Error error = Smooth_Err_Ok; - - - if ( slot->format != render->glyph_format ) - { - error = Smooth_Err_Invalid_Argument; - goto Exit; - } - - if ( matrix ) - FT_Outline_Transform( &slot->outline, matrix ); - - if ( delta ) - FT_Outline_Translate( &slot->outline, delta->x, delta->y ); - - Exit: - return error; - } - - - /* return the glyph's control box */ - static void - ft_smooth_get_cbox( FT_Renderer render, - FT_GlyphSlot slot, - FT_BBox* cbox ) - { - FT_MEM_ZERO( cbox, sizeof ( *cbox ) ); - - if ( slot->format == render->glyph_format ) - FT_Outline_Get_CBox( &slot->outline, cbox ); - } - - - /* convert a slot's glyph image into a bitmap */ - static FT_Error - ft_smooth_render_generic( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin, - FT_Render_Mode required_mode ) - { - FT_Error error; - FT_Outline* outline = NULL; - FT_BBox cbox; - FT_UInt width, height, height_org, width_org, pitch; - FT_Bitmap* bitmap; - FT_Memory memory; - FT_Int hmul = mode == FT_RENDER_MODE_LCD; - FT_Int vmul = mode == FT_RENDER_MODE_LCD_V; - FT_Pos x_shift, y_shift, x_left, y_top; - - FT_Raster_Params params; - - - /* check glyph image format */ - if ( slot->format != render->glyph_format ) - { - error = Smooth_Err_Invalid_Argument; - goto Exit; - } - - /* check mode */ - if ( mode != required_mode ) - return Smooth_Err_Cannot_Render_Glyph; - - outline = &slot->outline; - - /* translate the outline to the new origin if needed */ - if ( origin ) - FT_Outline_Translate( outline, origin->x, origin->y ); - - /* compute the control box, and grid fit it */ - FT_Outline_Get_CBox( outline, &cbox ); - - cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); - cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); - - width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); - height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); - bitmap = &slot->bitmap; - memory = render->root.memory; - - width_org = width; - height_org = height; - - /* release old bitmap buffer */ - if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) - { - FT_FREE( bitmap->buffer ); - slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; - } - - /* allocate new one, depends on pixel format */ - pitch = width; - if ( hmul ) - { - width = width * 3; - pitch = FT_PAD_CEIL( width, 4 ); - } - - if ( vmul ) - height *= 3; - - x_shift = (FT_Int) cbox.xMin; - y_shift = (FT_Int) cbox.yMin; - x_left = (FT_Int)( cbox.xMin >> 6 ); - y_top = (FT_Int)( cbox.yMax >> 6 ); - -#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING - - if ( slot->library->lcd_filter_func ) - { - FT_Int extra = slot->library->lcd_extra; - - - if ( hmul ) - { - x_shift -= 64 * ( extra >> 1 ); - width += 3 * extra; - pitch = FT_PAD_CEIL( width, 4 ); - x_left -= extra >> 1; - } - - if ( vmul ) - { - y_shift -= 64 * ( extra >> 1 ); - height += 3 * extra; - y_top += extra >> 1; - } - } - -#endif - - bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; - bitmap->num_grays = 256; - bitmap->width = width; - bitmap->rows = height; - bitmap->pitch = pitch; - - /* translate outline to render it into the bitmap */ - FT_Outline_Translate( outline, -x_shift, -y_shift ); - - if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) ) - goto Exit; - - slot->internal->flags |= FT_GLYPH_OWN_BITMAP; - - /* set up parameters */ - params.target = bitmap; - params.source = outline; - params.flags = FT_RASTER_FLAG_AA; - -#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING - - /* implode outline if needed */ - { - FT_Vector* points = outline->points; - FT_Vector* points_end = points + outline->n_points; - FT_Vector* vec; - - - if ( hmul ) - for ( vec = points; vec < points_end; vec++ ) - vec->x *= 3; - - if ( vmul ) - for ( vec = points; vec < points_end; vec++ ) - vec->y *= 3; - } - - /* render outline into the bitmap */ - error = render->raster_render( render->raster, ¶ms ); - - /* deflate outline if needed */ - { - FT_Vector* points = outline->points; - FT_Vector* points_end = points + outline->n_points; - FT_Vector* vec; - - - if ( hmul ) - for ( vec = points; vec < points_end; vec++ ) - vec->x /= 3; - - if ( vmul ) - for ( vec = points; vec < points_end; vec++ ) - vec->y /= 3; - } - - if ( slot->library->lcd_filter_func ) - slot->library->lcd_filter_func( bitmap, mode, slot->library ); - -#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ - - /* render outline into bitmap */ - error = render->raster_render( render->raster, ¶ms ); - - /* expand it horizontally */ - if ( hmul ) - { - FT_Byte* line = bitmap->buffer; - FT_UInt hh; - - - for ( hh = height_org; hh > 0; hh--, line += pitch ) - { - FT_UInt xx; - FT_Byte* end = line + width; - - - for ( xx = width_org; xx > 0; xx-- ) - { - FT_UInt pixel = line[xx-1]; - - - end[-3] = (FT_Byte)pixel; - end[-2] = (FT_Byte)pixel; - end[-1] = (FT_Byte)pixel; - end -= 3; - } - } - } - - /* expand it vertically */ - if ( vmul ) - { - FT_Byte* read = bitmap->buffer + ( height - height_org ) * pitch; - FT_Byte* write = bitmap->buffer; - FT_UInt hh; - - - for ( hh = height_org; hh > 0; hh-- ) - { - memcpy( write, read, pitch ); - write += pitch; - - memcpy( write, read, pitch ); - write += pitch; - - memcpy( write, read, pitch ); - write += pitch; - read += pitch; - } - } - -#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ - - FT_Outline_Translate( outline, x_shift, y_shift ); - - if ( error ) - goto Exit; - - slot->format = FT_GLYPH_FORMAT_BITMAP; - slot->bitmap_left = x_left; - slot->bitmap_top = y_top; - - Exit: - if ( outline && origin ) - FT_Outline_Translate( outline, -origin->x, -origin->y ); - - return error; - } - - - /* convert a slot's glyph image into a bitmap */ - static FT_Error - ft_smooth_render( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin ) - { - if ( mode == FT_RENDER_MODE_LIGHT ) - mode = FT_RENDER_MODE_NORMAL; - - return ft_smooth_render_generic( render, slot, mode, origin, - FT_RENDER_MODE_NORMAL ); - } - - - /* convert a slot's glyph image into a horizontal LCD bitmap */ - static FT_Error - ft_smooth_render_lcd( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin ) - { - FT_Error error; - - error = ft_smooth_render_generic( render, slot, mode, origin, - FT_RENDER_MODE_LCD ); - if ( !error ) - slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD; - - return error; - } - - - /* convert a slot's glyph image into a vertical LCD bitmap */ - static FT_Error - ft_smooth_render_lcd_v( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin ) - { - FT_Error error; - - error = ft_smooth_render_generic( render, slot, mode, origin, - FT_RENDER_MODE_LCD_V ); - if ( !error ) - slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD_V; - - return error; - } - - - FT_CALLBACK_TABLE_DEF - const FT_Renderer_Class ft_smooth_renderer_class = - { - { - FT_MODULE_RENDERER, - sizeof( FT_RendererRec ), - - "smooth", - 0x10000L, - 0x20000L, - - 0, /* module specific interface */ - - (FT_Module_Constructor)ft_smooth_init, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 - }, - - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Renderer_RenderFunc) ft_smooth_render, - (FT_Renderer_TransformFunc)ft_smooth_transform, - (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, - (FT_Renderer_SetModeFunc) ft_smooth_set_mode, - - (FT_Raster_Funcs*) &ft_grays_raster - }; - - - FT_CALLBACK_TABLE_DEF - const FT_Renderer_Class ft_smooth_lcd_renderer_class = - { - { - FT_MODULE_RENDERER, - sizeof( FT_RendererRec ), - - "smooth-lcd", - 0x10000L, - 0x20000L, - - 0, /* module specific interface */ - - (FT_Module_Constructor)ft_smooth_init, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 - }, - - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Renderer_RenderFunc) ft_smooth_render_lcd, - (FT_Renderer_TransformFunc)ft_smooth_transform, - (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, - (FT_Renderer_SetModeFunc) ft_smooth_set_mode, - - (FT_Raster_Funcs*) &ft_grays_raster - }; - - - - FT_CALLBACK_TABLE_DEF - const FT_Renderer_Class ft_smooth_lcdv_renderer_class = - { - { - FT_MODULE_RENDERER, - sizeof( FT_RendererRec ), - - "smooth-lcdv", - 0x10000L, - 0x20000L, - - 0, /* module specific interface */ - - (FT_Module_Constructor)ft_smooth_init, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 - }, - - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Renderer_RenderFunc) ft_smooth_render_lcd_v, - (FT_Renderer_TransformFunc)ft_smooth_transform, - (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, - (FT_Renderer_SetModeFunc) ft_smooth_set_mode, - - (FT_Raster_Funcs*) &ft_grays_raster - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* ftsmooth.c */ +/* */ +/* Anti-aliasing renderer interface (body). */ +/* */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_OBJECTS_H +#include FT_OUTLINE_H +#include "ftsmooth.h" +#include "ftgrays.h" + +#include "ftsmerrs.h" + + + /* initialize renderer -- init its raster */ + static FT_Error + ft_smooth_init( FT_Renderer render ) + { + FT_Library library = FT_MODULE_LIBRARY( render ); + + + render->clazz->raster_class->raster_reset( render->raster, + library->raster_pool, + library->raster_pool_size ); + + return 0; + } + + + /* sets render-specific mode */ + static FT_Error + ft_smooth_set_mode( FT_Renderer render, + FT_ULong mode_tag, + FT_Pointer data ) + { + /* we simply pass it to the raster */ + return render->clazz->raster_class->raster_set_mode( render->raster, + mode_tag, + data ); + } + + /* transform a given glyph image */ + static FT_Error + ft_smooth_transform( FT_Renderer render, + FT_GlyphSlot slot, + const FT_Matrix* matrix, + const FT_Vector* delta ) + { + FT_Error error = Smooth_Err_Ok; + + + if ( slot->format != render->glyph_format ) + { + error = Smooth_Err_Invalid_Argument; + goto Exit; + } + + if ( matrix ) + FT_Outline_Transform( &slot->outline, matrix ); + + if ( delta ) + FT_Outline_Translate( &slot->outline, delta->x, delta->y ); + + Exit: + return error; + } + + + /* return the glyph's control box */ + static void + ft_smooth_get_cbox( FT_Renderer render, + FT_GlyphSlot slot, + FT_BBox* cbox ) + { + FT_MEM_ZERO( cbox, sizeof ( *cbox ) ); + + if ( slot->format == render->glyph_format ) + FT_Outline_Get_CBox( &slot->outline, cbox ); + } + + + /* convert a slot's glyph image into a bitmap */ + static FT_Error + ft_smooth_render_generic( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin, + FT_Render_Mode required_mode ) + { + FT_Error error; + FT_Outline* outline = NULL; + FT_BBox cbox; + FT_UInt width, height, height_org, width_org, pitch; + FT_Bitmap* bitmap; + FT_Memory memory; + FT_Int hmul = mode == FT_RENDER_MODE_LCD; + FT_Int vmul = mode == FT_RENDER_MODE_LCD_V; + FT_Pos x_shift, y_shift, x_left, y_top; + + FT_Raster_Params params; + + + /* check glyph image format */ + if ( slot->format != render->glyph_format ) + { + error = Smooth_Err_Invalid_Argument; + goto Exit; + } + + /* check mode */ + if ( mode != required_mode ) + return Smooth_Err_Cannot_Render_Glyph; + + outline = &slot->outline; + + /* translate the outline to the new origin if needed */ + if ( origin ) + FT_Outline_Translate( outline, origin->x, origin->y ); + + /* compute the control box, and grid fit it */ + FT_Outline_Get_CBox( outline, &cbox ); + + cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); + cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); + cbox.xMax = FT_PIX_CEIL( cbox.xMax ); + cbox.yMax = FT_PIX_CEIL( cbox.yMax ); + + width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 ); + height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 ); + bitmap = &slot->bitmap; + memory = render->root.memory; + + width_org = width; + height_org = height; + + /* release old bitmap buffer */ + if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) + { + FT_FREE( bitmap->buffer ); + slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; + } + + /* allocate new one, depends on pixel format */ + pitch = width; + if ( hmul ) + { + width = width * 3; + pitch = FT_PAD_CEIL( width, 4 ); + } + + if ( vmul ) + height *= 3; + + x_shift = (FT_Int) cbox.xMin; + y_shift = (FT_Int) cbox.yMin; + x_left = (FT_Int)( cbox.xMin >> 6 ); + y_top = (FT_Int)( cbox.yMax >> 6 ); + +#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + if ( slot->library->lcd_filter_func ) + { + FT_Int extra = slot->library->lcd_extra; + + + if ( hmul ) + { + x_shift -= 64 * ( extra >> 1 ); + width += 3 * extra; + pitch = FT_PAD_CEIL( width, 4 ); + x_left -= extra >> 1; + } + + if ( vmul ) + { + y_shift -= 64 * ( extra >> 1 ); + height += 3 * extra; + y_top += extra >> 1; + } + } + +#endif + + bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; + bitmap->num_grays = 256; + bitmap->width = width; + bitmap->rows = height; + bitmap->pitch = pitch; + + /* translate outline to render it into the bitmap */ + FT_Outline_Translate( outline, -x_shift, -y_shift ); + + if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) ) + goto Exit; + + slot->internal->flags |= FT_GLYPH_OWN_BITMAP; + + /* set up parameters */ + params.target = bitmap; + params.source = outline; + params.flags = FT_RASTER_FLAG_AA; + +#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + /* implode outline if needed */ + { + FT_Vector* points = outline->points; + FT_Vector* points_end = points + outline->n_points; + FT_Vector* vec; + + + if ( hmul ) + for ( vec = points; vec < points_end; vec++ ) + vec->x *= 3; + + if ( vmul ) + for ( vec = points; vec < points_end; vec++ ) + vec->y *= 3; + } + + /* render outline into the bitmap */ + error = render->raster_render( render->raster, ¶ms ); + + /* deflate outline if needed */ + { + FT_Vector* points = outline->points; + FT_Vector* points_end = points + outline->n_points; + FT_Vector* vec; + + + if ( hmul ) + for ( vec = points; vec < points_end; vec++ ) + vec->x /= 3; + + if ( vmul ) + for ( vec = points; vec < points_end; vec++ ) + vec->y /= 3; + } + + if ( slot->library->lcd_filter_func ) + slot->library->lcd_filter_func( bitmap, mode, slot->library ); + +#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ + + /* render outline into bitmap */ + error = render->raster_render( render->raster, ¶ms ); + + /* expand it horizontally */ + if ( hmul ) + { + FT_Byte* line = bitmap->buffer; + FT_UInt hh; + + + for ( hh = height_org; hh > 0; hh--, line += pitch ) + { + FT_UInt xx; + FT_Byte* end = line + width; + + + for ( xx = width_org; xx > 0; xx-- ) + { + FT_UInt pixel = line[xx-1]; + + + end[-3] = (FT_Byte)pixel; + end[-2] = (FT_Byte)pixel; + end[-1] = (FT_Byte)pixel; + end -= 3; + } + } + } + + /* expand it vertically */ + if ( vmul ) + { + FT_Byte* read = bitmap->buffer + ( height - height_org ) * pitch; + FT_Byte* write = bitmap->buffer; + FT_UInt hh; + + + for ( hh = height_org; hh > 0; hh-- ) + { + memcpy( write, read, pitch ); + write += pitch; + + memcpy( write, read, pitch ); + write += pitch; + + memcpy( write, read, pitch ); + write += pitch; + read += pitch; + } + } + +#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ + + FT_Outline_Translate( outline, x_shift, y_shift ); + + if ( error ) + goto Exit; + + slot->format = FT_GLYPH_FORMAT_BITMAP; + slot->bitmap_left = x_left; + slot->bitmap_top = y_top; + + Exit: + if ( outline && origin ) + FT_Outline_Translate( outline, -origin->x, -origin->y ); + + return error; + } + + + /* convert a slot's glyph image into a bitmap */ + static FT_Error + ft_smooth_render( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) + { + if ( mode == FT_RENDER_MODE_LIGHT ) + mode = FT_RENDER_MODE_NORMAL; + + return ft_smooth_render_generic( render, slot, mode, origin, + FT_RENDER_MODE_NORMAL ); + } + + + /* convert a slot's glyph image into a horizontal LCD bitmap */ + static FT_Error + ft_smooth_render_lcd( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) + { + FT_Error error; + + error = ft_smooth_render_generic( render, slot, mode, origin, + FT_RENDER_MODE_LCD ); + if ( !error ) + slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD; + + return error; + } + + + /* convert a slot's glyph image into a vertical LCD bitmap */ + static FT_Error + ft_smooth_render_lcd_v( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) + { + FT_Error error; + + error = ft_smooth_render_generic( render, slot, mode, origin, + FT_RENDER_MODE_LCD_V ); + if ( !error ) + slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD_V; + + return error; + } + + + FT_CALLBACK_TABLE_DEF + const FT_Renderer_Class ft_smooth_renderer_class = + { + { + FT_MODULE_RENDERER, + sizeof( FT_RendererRec ), + + "smooth", + 0x10000L, + 0x20000L, + + 0, /* module specific interface */ + + (FT_Module_Constructor)ft_smooth_init, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Renderer_RenderFunc) ft_smooth_render, + (FT_Renderer_TransformFunc)ft_smooth_transform, + (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, + (FT_Renderer_SetModeFunc) ft_smooth_set_mode, + + (FT_Raster_Funcs*) &ft_grays_raster + }; + + + FT_CALLBACK_TABLE_DEF + const FT_Renderer_Class ft_smooth_lcd_renderer_class = + { + { + FT_MODULE_RENDERER, + sizeof( FT_RendererRec ), + + "smooth-lcd", + 0x10000L, + 0x20000L, + + 0, /* module specific interface */ + + (FT_Module_Constructor)ft_smooth_init, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Renderer_RenderFunc) ft_smooth_render_lcd, + (FT_Renderer_TransformFunc)ft_smooth_transform, + (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, + (FT_Renderer_SetModeFunc) ft_smooth_set_mode, + + (FT_Raster_Funcs*) &ft_grays_raster + }; + + + + FT_CALLBACK_TABLE_DEF + const FT_Renderer_Class ft_smooth_lcdv_renderer_class = + { + { + FT_MODULE_RENDERER, + sizeof( FT_RendererRec ), + + "smooth-lcdv", + 0x10000L, + 0x20000L, + + 0, /* module specific interface */ + + (FT_Module_Constructor)ft_smooth_init, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + FT_GLYPH_FORMAT_OUTLINE, + + (FT_Renderer_RenderFunc) ft_smooth_render_lcd_v, + (FT_Renderer_TransformFunc)ft_smooth_transform, + (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, + (FT_Renderer_SetModeFunc) ft_smooth_set_mode, + + (FT_Raster_Funcs*) &ft_grays_raster + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.h b/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.h index 62cced44873..9f4dbf07ce8 100644 --- a/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.h +++ b/reactos/dll/3rdparty/freetype/src/smooth/ftsmooth.h @@ -1,49 +1,49 @@ -/***************************************************************************/ -/* */ -/* ftsmooth.h */ -/* */ -/* Anti-aliasing renderer interface (specification). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTSMOOTH_H__ -#define __FTSMOOTH_H__ - - -#include -#include FT_RENDER_H - - -FT_BEGIN_HEADER - - -#ifndef FT_CONFIG_OPTION_NO_STD_RASTER - FT_EXPORT_VAR( const FT_Renderer_Class ) ft_std_renderer_class; -#endif - -#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER - FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class; - - FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_renderer_class; - - FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_v_renderer_class; -#endif - - - -FT_END_HEADER - -#endif /* __FTSMOOTH_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ftsmooth.h */ +/* */ +/* Anti-aliasing renderer interface (specification). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTSMOOTH_H__ +#define __FTSMOOTH_H__ + + +#include +#include FT_RENDER_H + + +FT_BEGIN_HEADER + + +#ifndef FT_CONFIG_OPTION_NO_STD_RASTER + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_std_renderer_class; +#endif + +#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class; + + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_renderer_class; + + FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_lcd_v_renderer_class; +#endif + + + +FT_END_HEADER + +#endif /* __FTSMOOTH_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/smooth/smooth.c b/reactos/dll/3rdparty/freetype/src/smooth/smooth.c index ff6be3e4007..19ba6b4072e 100644 --- a/reactos/dll/3rdparty/freetype/src/smooth/smooth.c +++ b/reactos/dll/3rdparty/freetype/src/smooth/smooth.c @@ -1,26 +1,26 @@ -/***************************************************************************/ -/* */ -/* smooth.c */ -/* */ -/* FreeType anti-aliasing rasterer module component (body only). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "ftgrays.c" -#include "ftsmooth.c" - - -/* END */ +/***************************************************************************/ +/* */ +/* smooth.c */ +/* */ +/* FreeType anti-aliasing rasterer module component (body only). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "ftgrays.c" +#include "ftsmooth.c" + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/tools/apinames.c b/reactos/dll/3rdparty/freetype/src/tools/apinames.c index f08919bee6c..64bb7fda8b9 100644 --- a/reactos/dll/3rdparty/freetype/src/tools/apinames.c +++ b/reactos/dll/3rdparty/freetype/src/tools/apinames.c @@ -1,443 +1,443 @@ -/* - * This little program is used to parse the FreeType headers and - * find the declaration of all public APIs. This is easy, because - * they all look like the following: - * - * FT_EXPORT( return_type ) - * function_name( function arguments ); - * - * You must pass the list of header files as arguments. Wildcards are - * accepted if you are using GCC for compilation (and probably by - * other compilers too). - * - * Author: David Turner, 2005, 2006 - * - * This code is explicitly placed into the public domain. - * - */ - -#include -#include -#include -#include - -#define PROGRAM_NAME "apinames" -#define PROGRAM_VERSION "0.1" - -#define LINEBUFF_SIZE 1024 - -typedef enum -{ - OUTPUT_LIST = 0, /* output the list of names, one per line */ - OUTPUT_WINDOWS_DEF, /* output a Windows .DEF file for Visual C++ or Mingw */ - OUTPUT_BORLAND_DEF, /* output a Windows .DEF file for Borland C++ */ - OUTPUT_WATCOM_LBC /* output a Watcom Linker Command File */ - -} OutputFormat; - - -static void -panic( const char* message ) -{ - fprintf( stderr, "PANIC: %s\n", message ); - exit(2); -} - - -typedef struct -{ - char* name; - unsigned int hash; - -} NameRec, *Name; - -static Name the_names; -static int num_names; -static int max_names; - -static void -names_add( const char* name, - const char* end ) -{ - int nn, len, h; - Name nm; - - if ( end <= name ) - return; - - /* compute hash value */ - len = (int)(end - name); - h = 0; - for ( nn = 0; nn < len; nn++ ) - h = h*33 + name[nn]; - - /* check for an pre-existing name */ - for ( nn = 0; nn < num_names; nn++ ) - { - nm = the_names + nn; - - if ( (int)nm->hash == h && - memcmp( name, nm->name, len ) == 0 && - nm->name[len] == 0 ) - return; - } - - /* add new name */ - if ( num_names >= max_names ) - { - max_names += (max_names >> 1) + 4; - the_names = (NameRec*)realloc( the_names, sizeof(the_names[0])*max_names ); - if ( the_names == NULL ) - panic( "not enough memory" ); - } - nm = &the_names[num_names++]; - - nm->hash = h; - nm->name = (char*)malloc( len+1 ); - if ( nm->name == NULL ) - panic( "not enough memory" ); - - memcpy( nm->name, name, len ); - nm->name[len] = 0; -} - - -static int -name_compare( const void* name1, - const void* name2 ) -{ - Name n1 = (Name)name1; - Name n2 = (Name)name2; - - return strcmp( n1->name, n2->name ); -} - -static void -names_sort( void ) -{ - qsort( the_names, (size_t)num_names, sizeof(the_names[0]), name_compare ); -} - - -static void -names_dump( FILE* out, - OutputFormat format, - const char* dll_name ) -{ - int nn; - - switch ( format ) - { - case OUTPUT_WINDOWS_DEF: - if ( dll_name ) - fprintf( out, "LIBRARY %s\n", dll_name ); - - fprintf( out, "DESCRIPTION FreeType 2 DLL\n" ); - fprintf( out, "EXPORTS\n" ); - for ( nn = 0; nn < num_names; nn++ ) - fprintf( out, " %s\n", the_names[nn].name ); - break; - - case OUTPUT_BORLAND_DEF: - if ( dll_name ) - fprintf( out, "LIBRARY %s\n", dll_name ); - - fprintf( out, "DESCRIPTION FreeType 2 DLL\n" ); - fprintf( out, "EXPORTS\n" ); - for ( nn = 0; nn < num_names; nn++ ) - fprintf( out, " _%s\n", the_names[nn].name ); - break; - - case OUTPUT_WATCOM_LBC: - { - /* we must omit the .dll suffix from the library name */ - char temp[512]; - char* dot; - - if ( dll_name == NULL ) - { - fprintf( stderr, - "you must provide a DLL name with the -d option !!\n" ); - exit(4); - } - - dot = strchr( dll_name, '.' ); - if ( dot != NULL ) - { - int len = (dot - dll_name); - if ( len > (int)(sizeof(temp)-1) ) - len = sizeof(temp)-1; - - memcpy( temp, dll_name, len ); - temp[len] = 0; - - dll_name = (const char*)temp; - } - - for ( nn = 0; nn < num_names; nn++ ) - fprintf( out, "++_%s.%s.%s\n", the_names[nn].name, dll_name, - the_names[nn].name ); - } - break; - - default: /* LIST */ - for ( nn = 0; nn < num_names; nn++ ) - fprintf( out, "%s\n", the_names[nn].name ); - } -} - - - - -/* states of the line parser */ - -typedef enum -{ - STATE_START = 0, /* waiting for FT_EXPORT keyword and return type */ - STATE_TYPE /* type was read, waiting for function name */ - -} State; - -static int -read_header_file( FILE* file, int verbose ) -{ - static char buff[ LINEBUFF_SIZE+1 ]; - State state = STATE_START; - - while ( !feof( file ) ) - { - char* p; - - if ( !fgets( buff, LINEBUFF_SIZE, file ) ) - break; - - p = buff; - - while ( *p && (*p == ' ' || *p == '\\') ) /* skip leading whitespace */ - p++; - - if ( *p == '\n' || *p == '\r' ) /* skip empty lines */ - continue; - - switch ( state ) - { - case STATE_START: - { - if ( memcmp( p, "FT_EXPORT(", 10 ) != 0 ) - break; - - p += 10; - for (;;) - { - if ( *p == 0 || *p == '\n' || *p == '\r' ) - goto NextLine; - - if ( *p == ')' ) - { - p++; - break; - } - - p++; - } - - state = STATE_TYPE; - - /* sometimes, the name is just after the FT_EXPORT(...), so - * skip whitespace, and fall-through if we find an alphanumeric - * character - */ - while ( *p == ' ' || *p == '\t' ) - p++; - - if ( !isalpha(*p) ) - break; - } - /* fall-through */ - - case STATE_TYPE: - { - char* name = p; - - while ( isalnum(*p) || *p == '_' ) - p++; - - if ( p > name ) - { - if ( verbose ) - fprintf( stderr, ">>> %.*s\n", p-name, name ); - - names_add( name, p ); - } - - state = STATE_START; - } - break; - - default: - ; - } - - NextLine: - ; - } - - return 0; -} - - -static void -usage( void ) -{ - static const char* const format = - "%s %s: extract FreeType API names from header files\n\n" - "this program is used to extract the list of public FreeType API\n" - "functions. It receives the list of header files as argument and\n" - "generates a sorted list of unique identifiers\n\n" - - "usage: %s header1 [options] [header2 ...]\n\n" - - "options: - : parse the content of stdin, ignore arguments\n" - " -v : verbose mode, output sent to standard error\n" - " -oFILE : write output to FILE instead of standard output\n" - " -dNAME : indicate DLL file name, 'freetype.dll' by default\n" - " -w : output .DEF file for Visual C++ and Mingw\n" - " -wB : output .DEF file for Borland C++\n" - " -wW : output Watcom Linker Response File\n" - "\n"; - - fprintf( stderr, - format, - PROGRAM_NAME, - PROGRAM_VERSION, - PROGRAM_NAME - ); - exit(1); -} - - -int main( int argc, const char* const* argv ) -{ - int from_stdin = 0; - int verbose = 0; - OutputFormat format = OUTPUT_LIST; /* the default */ - FILE* out = stdout; - const char* library_name = NULL; - - if ( argc < 2 ) - usage(); - - /* '-' used as a single argument means read source file from stdin */ - while ( argc > 1 && argv[1][0] == '-' ) - { - const char* arg = argv[1]; - - switch ( arg[1] ) - { - case 'v': - verbose = 1; - break; - - case 'o': - if ( arg[2] == 0 ) - { - if ( argc < 2 ) - usage(); - - arg = argv[2]; - argv++; - argc--; - } - else - arg += 2; - - out = fopen( arg, "wt" ); - if ( out == NULL ) - { - fprintf( stderr, "could not open '%s' for writing\n", argv[2] ); - exit(3); - } - break; - - case 'd': - if ( arg[2] == 0 ) - { - if ( argc < 2 ) - usage(); - - arg = argv[2]; - argv++; - argc--; - } - else - arg += 2; - - library_name = arg; - break; - - case 'w': - format = OUTPUT_WINDOWS_DEF; - switch ( arg[2] ) - { - case 'B': - format = OUTPUT_BORLAND_DEF; - break; - - case 'W': - format = OUTPUT_WATCOM_LBC; - break; - - case 0: - break; - - default: - usage(); - } - break; - - case 0: - from_stdin = 1; - break; - - default: - usage(); - } - - argc--; - argv++; - } - - if ( from_stdin ) - { - read_header_file( stdin, verbose ); - } - else - { - for ( --argc, argv++; argc > 0; argc--, argv++ ) - { - FILE* file = fopen( argv[0], "rb" ); - - if ( file == NULL ) - fprintf( stderr, "unable to open '%s'\n", argv[0] ); - else - { - if ( verbose ) - fprintf( stderr, "opening '%s'\n", argv[0] ); - - read_header_file( file, verbose ); - fclose( file ); - } - } - } - - if ( num_names == 0 ) - panic( "could not find exported functions !!\n" ); - - names_sort(); - names_dump( out, format, library_name ); - - if ( out != stdout ) - fclose( out ); - - return 0; -} +/* + * This little program is used to parse the FreeType headers and + * find the declaration of all public APIs. This is easy, because + * they all look like the following: + * + * FT_EXPORT( return_type ) + * function_name( function arguments ); + * + * You must pass the list of header files as arguments. Wildcards are + * accepted if you are using GCC for compilation (and probably by + * other compilers too). + * + * Author: David Turner, 2005, 2006 + * + * This code is explicitly placed into the public domain. + * + */ + +#include +#include +#include +#include + +#define PROGRAM_NAME "apinames" +#define PROGRAM_VERSION "0.1" + +#define LINEBUFF_SIZE 1024 + +typedef enum +{ + OUTPUT_LIST = 0, /* output the list of names, one per line */ + OUTPUT_WINDOWS_DEF, /* output a Windows .DEF file for Visual C++ or Mingw */ + OUTPUT_BORLAND_DEF, /* output a Windows .DEF file for Borland C++ */ + OUTPUT_WATCOM_LBC /* output a Watcom Linker Command File */ + +} OutputFormat; + + +static void +panic( const char* message ) +{ + fprintf( stderr, "PANIC: %s\n", message ); + exit(2); +} + + +typedef struct +{ + char* name; + unsigned int hash; + +} NameRec, *Name; + +static Name the_names; +static int num_names; +static int max_names; + +static void +names_add( const char* name, + const char* end ) +{ + int nn, len, h; + Name nm; + + if ( end <= name ) + return; + + /* compute hash value */ + len = (int)(end - name); + h = 0; + for ( nn = 0; nn < len; nn++ ) + h = h*33 + name[nn]; + + /* check for an pre-existing name */ + for ( nn = 0; nn < num_names; nn++ ) + { + nm = the_names + nn; + + if ( (int)nm->hash == h && + memcmp( name, nm->name, len ) == 0 && + nm->name[len] == 0 ) + return; + } + + /* add new name */ + if ( num_names >= max_names ) + { + max_names += (max_names >> 1) + 4; + the_names = (NameRec*)realloc( the_names, sizeof(the_names[0])*max_names ); + if ( the_names == NULL ) + panic( "not enough memory" ); + } + nm = &the_names[num_names++]; + + nm->hash = h; + nm->name = (char*)malloc( len+1 ); + if ( nm->name == NULL ) + panic( "not enough memory" ); + + memcpy( nm->name, name, len ); + nm->name[len] = 0; +} + + +static int +name_compare( const void* name1, + const void* name2 ) +{ + Name n1 = (Name)name1; + Name n2 = (Name)name2; + + return strcmp( n1->name, n2->name ); +} + +static void +names_sort( void ) +{ + qsort( the_names, (size_t)num_names, sizeof(the_names[0]), name_compare ); +} + + +static void +names_dump( FILE* out, + OutputFormat format, + const char* dll_name ) +{ + int nn; + + switch ( format ) + { + case OUTPUT_WINDOWS_DEF: + if ( dll_name ) + fprintf( out, "LIBRARY %s\n", dll_name ); + + fprintf( out, "DESCRIPTION FreeType 2 DLL\n" ); + fprintf( out, "EXPORTS\n" ); + for ( nn = 0; nn < num_names; nn++ ) + fprintf( out, " %s\n", the_names[nn].name ); + break; + + case OUTPUT_BORLAND_DEF: + if ( dll_name ) + fprintf( out, "LIBRARY %s\n", dll_name ); + + fprintf( out, "DESCRIPTION FreeType 2 DLL\n" ); + fprintf( out, "EXPORTS\n" ); + for ( nn = 0; nn < num_names; nn++ ) + fprintf( out, " _%s\n", the_names[nn].name ); + break; + + case OUTPUT_WATCOM_LBC: + { + /* we must omit the .dll suffix from the library name */ + char temp[512]; + char* dot; + + if ( dll_name == NULL ) + { + fprintf( stderr, + "you must provide a DLL name with the -d option !!\n" ); + exit(4); + } + + dot = strchr( dll_name, '.' ); + if ( dot != NULL ) + { + int len = (dot - dll_name); + if ( len > (int)(sizeof(temp)-1) ) + len = sizeof(temp)-1; + + memcpy( temp, dll_name, len ); + temp[len] = 0; + + dll_name = (const char*)temp; + } + + for ( nn = 0; nn < num_names; nn++ ) + fprintf( out, "++_%s.%s.%s\n", the_names[nn].name, dll_name, + the_names[nn].name ); + } + break; + + default: /* LIST */ + for ( nn = 0; nn < num_names; nn++ ) + fprintf( out, "%s\n", the_names[nn].name ); + } +} + + + + +/* states of the line parser */ + +typedef enum +{ + STATE_START = 0, /* waiting for FT_EXPORT keyword and return type */ + STATE_TYPE /* type was read, waiting for function name */ + +} State; + +static int +read_header_file( FILE* file, int verbose ) +{ + static char buff[ LINEBUFF_SIZE+1 ]; + State state = STATE_START; + + while ( !feof( file ) ) + { + char* p; + + if ( !fgets( buff, LINEBUFF_SIZE, file ) ) + break; + + p = buff; + + while ( *p && (*p == ' ' || *p == '\\') ) /* skip leading whitespace */ + p++; + + if ( *p == '\n' || *p == '\r' ) /* skip empty lines */ + continue; + + switch ( state ) + { + case STATE_START: + { + if ( memcmp( p, "FT_EXPORT(", 10 ) != 0 ) + break; + + p += 10; + for (;;) + { + if ( *p == 0 || *p == '\n' || *p == '\r' ) + goto NextLine; + + if ( *p == ')' ) + { + p++; + break; + } + + p++; + } + + state = STATE_TYPE; + + /* sometimes, the name is just after the FT_EXPORT(...), so + * skip whitespace, and fall-through if we find an alphanumeric + * character + */ + while ( *p == ' ' || *p == '\t' ) + p++; + + if ( !isalpha(*p) ) + break; + } + /* fall-through */ + + case STATE_TYPE: + { + char* name = p; + + while ( isalnum(*p) || *p == '_' ) + p++; + + if ( p > name ) + { + if ( verbose ) + fprintf( stderr, ">>> %.*s\n", p-name, name ); + + names_add( name, p ); + } + + state = STATE_START; + } + break; + + default: + ; + } + + NextLine: + ; + } + + return 0; +} + + +static void +usage( void ) +{ + static const char* const format = + "%s %s: extract FreeType API names from header files\n\n" + "this program is used to extract the list of public FreeType API\n" + "functions. It receives the list of header files as argument and\n" + "generates a sorted list of unique identifiers\n\n" + + "usage: %s header1 [options] [header2 ...]\n\n" + + "options: - : parse the content of stdin, ignore arguments\n" + " -v : verbose mode, output sent to standard error\n" + " -oFILE : write output to FILE instead of standard output\n" + " -dNAME : indicate DLL file name, 'freetype.dll' by default\n" + " -w : output .DEF file for Visual C++ and Mingw\n" + " -wB : output .DEF file for Borland C++\n" + " -wW : output Watcom Linker Response File\n" + "\n"; + + fprintf( stderr, + format, + PROGRAM_NAME, + PROGRAM_VERSION, + PROGRAM_NAME + ); + exit(1); +} + + +int main( int argc, const char* const* argv ) +{ + int from_stdin = 0; + int verbose = 0; + OutputFormat format = OUTPUT_LIST; /* the default */ + FILE* out = stdout; + const char* library_name = NULL; + + if ( argc < 2 ) + usage(); + + /* '-' used as a single argument means read source file from stdin */ + while ( argc > 1 && argv[1][0] == '-' ) + { + const char* arg = argv[1]; + + switch ( arg[1] ) + { + case 'v': + verbose = 1; + break; + + case 'o': + if ( arg[2] == 0 ) + { + if ( argc < 2 ) + usage(); + + arg = argv[2]; + argv++; + argc--; + } + else + arg += 2; + + out = fopen( arg, "wt" ); + if ( out == NULL ) + { + fprintf( stderr, "could not open '%s' for writing\n", argv[2] ); + exit(3); + } + break; + + case 'd': + if ( arg[2] == 0 ) + { + if ( argc < 2 ) + usage(); + + arg = argv[2]; + argv++; + argc--; + } + else + arg += 2; + + library_name = arg; + break; + + case 'w': + format = OUTPUT_WINDOWS_DEF; + switch ( arg[2] ) + { + case 'B': + format = OUTPUT_BORLAND_DEF; + break; + + case 'W': + format = OUTPUT_WATCOM_LBC; + break; + + case 0: + break; + + default: + usage(); + } + break; + + case 0: + from_stdin = 1; + break; + + default: + usage(); + } + + argc--; + argv++; + } + + if ( from_stdin ) + { + read_header_file( stdin, verbose ); + } + else + { + for ( --argc, argv++; argc > 0; argc--, argv++ ) + { + FILE* file = fopen( argv[0], "rb" ); + + if ( file == NULL ) + fprintf( stderr, "unable to open '%s'\n", argv[0] ); + else + { + if ( verbose ) + fprintf( stderr, "opening '%s'\n", argv[0] ); + + read_header_file( file, verbose ); + fclose( file ); + } + } + } + + if ( num_names == 0 ) + panic( "could not find exported functions !!\n" ); + + names_sort(); + names_dump( out, format, library_name ); + + if ( out != stdout ) + fclose( out ); + + return 0; +} diff --git a/reactos/dll/3rdparty/freetype/src/tools/test_afm.c b/reactos/dll/3rdparty/freetype/src/tools/test_afm.c index d53cb332562..d815c66b8da 100644 --- a/reactos/dll/3rdparty/freetype/src/tools/test_afm.c +++ b/reactos/dll/3rdparty/freetype/src/tools/test_afm.c @@ -1,157 +1,157 @@ -/* - * gcc -DFT2_BUILD_LIBRARY -I../../include -o test_afm test_afm.c \ - * -L../../objs/.libs -lfreetype -lz -static - */ -#include -#include FT_FREETYPE_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H - - void dump_fontinfo( AFM_FontInfo fi ) - { - FT_Int i; - - - printf( "This AFM is for %sCID font.\n\n", - ( fi->IsCIDFont ) ? "" : "non-" ); - - printf( "FontBBox: %.2f %.2f %.2f %.2f\n", fi->FontBBox.xMin / 65536., - fi->FontBBox.yMin / 65536., - fi->FontBBox.xMax / 65536., - fi->FontBBox.yMax / 65536. ); - printf( "Ascender: %.2f\n", fi->Ascender / 65536. ); - printf( "Descender: %.2f\n\n", fi->Descender / 65536. ); - - if ( fi->NumTrackKern ) - printf( "There are %d sets of track kernings:\n", - fi->NumTrackKern ); - else - printf( "There is no track kerning.\n" ); - - for ( i = 0; i < fi->NumTrackKern; i++ ) - { - AFM_TrackKern tk = fi->TrackKerns + i; - - - printf( "\t%2d: %5.2f %5.2f %5.2f %5.2f\n", tk->degree, - tk->min_ptsize / 65536., - tk->min_kern / 65536., - tk->max_ptsize / 65536., - tk->max_kern / 65536. ); - } - - printf( "\n" ); - - if ( fi->NumKernPair ) - printf( "There are %d kerning pairs:\n", - fi->NumKernPair ); - else - printf( "There is no kerning pair.\n" ); - - for ( i = 0; i < fi->NumKernPair; i++ ) - { - AFM_KernPair kp = fi->KernPairs + i; - - - printf( "\t%3d + %3d => (%4d, %4d)\n", kp->index1, - kp->index2, - kp->x, - kp->y ); - } - - } - - int - dummy_get_index( const char* name, - FT_UInt len, - void* user_data ) - { - if ( len ) - return name[0]; - else - return 0; - } - - FT_Error - parse_afm( FT_Library library, - FT_Stream stream, - AFM_FontInfo fi ) - { - PSAux_Service psaux; - AFM_ParserRec parser; - FT_Error error = FT_Err_Ok; - - - psaux = (PSAux_Service)FT_Get_Module_Interface( library, "psaux" ); - if ( !psaux || !psaux->afm_parser_funcs ) - return -1; - - error = FT_Stream_EnterFrame( stream, stream->size ); - if ( error ) - return error; - - error = psaux->afm_parser_funcs->init( &parser, - library->memory, - stream->cursor, - stream->limit ); - if ( error ) - return error; - - parser.FontInfo = fi; - parser.get_index = dummy_get_index; - - error = psaux->afm_parser_funcs->parse( &parser ); - - psaux->afm_parser_funcs->done( &parser ); - - return error; - } - - - int main( int argc, - char** argv ) - { - FT_Library library; - FT_StreamRec stream; - FT_Error error = FT_Err_Ok; - AFM_FontInfoRec fi; - - - if ( argc < 2 ) - return FT_Err_Invalid_Argument; - - error = FT_Init_FreeType( &library ); - if ( error ) - return error; - - FT_ZERO( &stream ); - error = FT_Stream_Open( &stream, argv[1] ); - if ( error ) - goto Exit; - stream.memory = library->memory; - - FT_ZERO( &fi ); - error = parse_afm( library, &stream, &fi ); - - if ( !error ) - { - FT_Memory memory = library->memory; - - - dump_fontinfo( &fi ); - - if ( fi.KernPairs ) - FT_FREE( fi.KernPairs ); - if ( fi.TrackKerns ) - FT_FREE( fi.TrackKerns ); - } - else - printf( "parse error\n" ); - - FT_Stream_Close( &stream ); - - Exit: - FT_Done_FreeType( library ); - - return error; - } +/* + * gcc -DFT2_BUILD_LIBRARY -I../../include -o test_afm test_afm.c \ + * -L../../objs/.libs -lfreetype -lz -static + */ +#include +#include FT_FREETYPE_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + void dump_fontinfo( AFM_FontInfo fi ) + { + FT_Int i; + + + printf( "This AFM is for %sCID font.\n\n", + ( fi->IsCIDFont ) ? "" : "non-" ); + + printf( "FontBBox: %.2f %.2f %.2f %.2f\n", fi->FontBBox.xMin / 65536., + fi->FontBBox.yMin / 65536., + fi->FontBBox.xMax / 65536., + fi->FontBBox.yMax / 65536. ); + printf( "Ascender: %.2f\n", fi->Ascender / 65536. ); + printf( "Descender: %.2f\n\n", fi->Descender / 65536. ); + + if ( fi->NumTrackKern ) + printf( "There are %d sets of track kernings:\n", + fi->NumTrackKern ); + else + printf( "There is no track kerning.\n" ); + + for ( i = 0; i < fi->NumTrackKern; i++ ) + { + AFM_TrackKern tk = fi->TrackKerns + i; + + + printf( "\t%2d: %5.2f %5.2f %5.2f %5.2f\n", tk->degree, + tk->min_ptsize / 65536., + tk->min_kern / 65536., + tk->max_ptsize / 65536., + tk->max_kern / 65536. ); + } + + printf( "\n" ); + + if ( fi->NumKernPair ) + printf( "There are %d kerning pairs:\n", + fi->NumKernPair ); + else + printf( "There is no kerning pair.\n" ); + + for ( i = 0; i < fi->NumKernPair; i++ ) + { + AFM_KernPair kp = fi->KernPairs + i; + + + printf( "\t%3d + %3d => (%4d, %4d)\n", kp->index1, + kp->index2, + kp->x, + kp->y ); + } + + } + + int + dummy_get_index( const char* name, + FT_UInt len, + void* user_data ) + { + if ( len ) + return name[0]; + else + return 0; + } + + FT_Error + parse_afm( FT_Library library, + FT_Stream stream, + AFM_FontInfo fi ) + { + PSAux_Service psaux; + AFM_ParserRec parser; + FT_Error error = FT_Err_Ok; + + + psaux = (PSAux_Service)FT_Get_Module_Interface( library, "psaux" ); + if ( !psaux || !psaux->afm_parser_funcs ) + return -1; + + error = FT_Stream_EnterFrame( stream, stream->size ); + if ( error ) + return error; + + error = psaux->afm_parser_funcs->init( &parser, + library->memory, + stream->cursor, + stream->limit ); + if ( error ) + return error; + + parser.FontInfo = fi; + parser.get_index = dummy_get_index; + + error = psaux->afm_parser_funcs->parse( &parser ); + + psaux->afm_parser_funcs->done( &parser ); + + return error; + } + + + int main( int argc, + char** argv ) + { + FT_Library library; + FT_StreamRec stream; + FT_Error error = FT_Err_Ok; + AFM_FontInfoRec fi; + + + if ( argc < 2 ) + return FT_Err_Invalid_Argument; + + error = FT_Init_FreeType( &library ); + if ( error ) + return error; + + FT_ZERO( &stream ); + error = FT_Stream_Open( &stream, argv[1] ); + if ( error ) + goto Exit; + stream.memory = library->memory; + + FT_ZERO( &fi ); + error = parse_afm( library, &stream, &fi ); + + if ( !error ) + { + FT_Memory memory = library->memory; + + + dump_fontinfo( &fi ); + + if ( fi.KernPairs ) + FT_FREE( fi.KernPairs ); + if ( fi.TrackKerns ) + FT_FREE( fi.TrackKerns ); + } + else + printf( "parse error\n" ); + + FT_Stream_Close( &stream ); + + Exit: + FT_Done_FreeType( library ); + + return error; + } diff --git a/reactos/dll/3rdparty/freetype/src/tools/test_bbox.c b/reactos/dll/3rdparty/freetype/src/tools/test_bbox.c index e085c5b3d6c..5a76a647f5d 100644 --- a/reactos/dll/3rdparty/freetype/src/tools/test_bbox.c +++ b/reactos/dll/3rdparty/freetype/src/tools/test_bbox.c @@ -1,160 +1,160 @@ -#include -#include FT_FREETYPE_H -#include FT_BBOX_H - - -#include /* for clock() */ - -/* SunOS 4.1.* does not define CLOCKS_PER_SEC, so include */ -/* to get the HZ macro which is the equivalent. */ -#if defined(__sun__) && !defined(SVR4) && !defined(__SVR4) -#include -#define CLOCKS_PER_SEC HZ -#endif - - static long - get_time( void ) - { - return clock() * 10000L / CLOCKS_PER_SEC; - } - - - - - /* test bbox computations */ - -#define XSCALE 65536 -#define XX(x) ((FT_Pos)(x*XSCALE)) -#define XVEC(x,y) { XX(x), XX(y) } -#define XVAL(x) ((x)/(1.0*XSCALE)) - - /* dummy outline #1 */ - static FT_Vector dummy_vec_1[4] = - { -#if 1 - XVEC( 408.9111, 535.3164 ), - XVEC( 455.8887, 634.396 ), - XVEC( -37.8765, 786.2207 ), - XVEC( 164.6074, 535.3164 ) -#else - { (FT_Int32)0x0198E93DL , (FT_Int32)0x021750FFL }, /* 408.9111, 535.3164 */ - { (FT_Int32)0x01C7E312L , (FT_Int32)0x027A6560L }, /* 455.8887, 634.3960 */ - { (FT_Int32)0xFFDA1F9EL , (FT_Int32)0x0312387FL }, /* -37.8765, 786.2207 */ - { (FT_Int32)0x00A49B7EL , (FT_Int32)0x021750FFL } /* 164.6074, 535.3164 */ -#endif - }; - - static char dummy_tag_1[4] = - { - FT_CURVE_TAG_ON, - FT_CURVE_TAG_CUBIC, - FT_CURVE_TAG_CUBIC, - FT_CURVE_TAG_ON - }; - - static short dummy_contour_1[1] = - { - 3 - }; - - static FT_Outline dummy_outline_1 = - { - 1, - 4, - dummy_vec_1, - dummy_tag_1, - dummy_contour_1, - 0 - }; - - - /* dummy outline #2 */ - static FT_Vector dummy_vec_2[4] = - { - XVEC( 100.0, 100.0 ), - XVEC( 100.0, 200.0 ), - XVEC( 200.0, 200.0 ), - XVEC( 200.0, 133.0 ) - }; - - static FT_Outline dummy_outline_2 = - { - 1, - 4, - dummy_vec_2, - dummy_tag_1, - dummy_contour_1, - 0 - }; - - - static void - dump_outline( FT_Outline* outline ) - { - FT_BBox bbox; - - /* compute and display cbox */ - FT_Outline_Get_CBox( outline, &bbox ); - printf( "cbox = [%.2f %.2f %.2f %.2f]\n", - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - - /* compute and display bbox */ - FT_Outline_Get_BBox( outline, &bbox ); - printf( "bbox = [%.2f %.2f %.2f %.2f]\n", - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - } - - - - static void - profile_outline( FT_Outline* outline, - long repeat ) - { - FT_BBox bbox; - long count; - long time0; - - time0 = get_time(); - for ( count = repeat; count > 0; count-- ) - FT_Outline_Get_CBox( outline, &bbox ); - - time0 = get_time() - time0; - printf( "time = %5.2f cbox = [%.2f %.2f %.2f %.2f]\n", - ((double)time0/10000.0), - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - - - time0 = get_time(); - for ( count = repeat; count > 0; count-- ) - FT_Outline_Get_BBox( outline, &bbox ); - - time0 = get_time() - time0; - printf( "time = %5.2f bbox = [%.2f %.2f %.2f %.2f]\n", - ((double)time0/10000.0), - XVAL( bbox.xMin ), - XVAL( bbox.yMin ), - XVAL( bbox.xMax ), - XVAL( bbox.yMax ) ); - } - -#define REPEAT 100000L - - int main( int argc, char** argv ) - { - printf( "outline #1\n" ); - profile_outline( &dummy_outline_1, REPEAT ); - - printf( "outline #2\n" ); - profile_outline( &dummy_outline_2, REPEAT ); - return 0; - } - +#include +#include FT_FREETYPE_H +#include FT_BBOX_H + + +#include /* for clock() */ + +/* SunOS 4.1.* does not define CLOCKS_PER_SEC, so include */ +/* to get the HZ macro which is the equivalent. */ +#if defined(__sun__) && !defined(SVR4) && !defined(__SVR4) +#include +#define CLOCKS_PER_SEC HZ +#endif + + static long + get_time( void ) + { + return clock() * 10000L / CLOCKS_PER_SEC; + } + + + + + /* test bbox computations */ + +#define XSCALE 65536 +#define XX(x) ((FT_Pos)(x*XSCALE)) +#define XVEC(x,y) { XX(x), XX(y) } +#define XVAL(x) ((x)/(1.0*XSCALE)) + + /* dummy outline #1 */ + static FT_Vector dummy_vec_1[4] = + { +#if 1 + XVEC( 408.9111, 535.3164 ), + XVEC( 455.8887, 634.396 ), + XVEC( -37.8765, 786.2207 ), + XVEC( 164.6074, 535.3164 ) +#else + { (FT_Int32)0x0198E93DL , (FT_Int32)0x021750FFL }, /* 408.9111, 535.3164 */ + { (FT_Int32)0x01C7E312L , (FT_Int32)0x027A6560L }, /* 455.8887, 634.3960 */ + { (FT_Int32)0xFFDA1F9EL , (FT_Int32)0x0312387FL }, /* -37.8765, 786.2207 */ + { (FT_Int32)0x00A49B7EL , (FT_Int32)0x021750FFL } /* 164.6074, 535.3164 */ +#endif + }; + + static char dummy_tag_1[4] = + { + FT_CURVE_TAG_ON, + FT_CURVE_TAG_CUBIC, + FT_CURVE_TAG_CUBIC, + FT_CURVE_TAG_ON + }; + + static short dummy_contour_1[1] = + { + 3 + }; + + static FT_Outline dummy_outline_1 = + { + 1, + 4, + dummy_vec_1, + dummy_tag_1, + dummy_contour_1, + 0 + }; + + + /* dummy outline #2 */ + static FT_Vector dummy_vec_2[4] = + { + XVEC( 100.0, 100.0 ), + XVEC( 100.0, 200.0 ), + XVEC( 200.0, 200.0 ), + XVEC( 200.0, 133.0 ) + }; + + static FT_Outline dummy_outline_2 = + { + 1, + 4, + dummy_vec_2, + dummy_tag_1, + dummy_contour_1, + 0 + }; + + + static void + dump_outline( FT_Outline* outline ) + { + FT_BBox bbox; + + /* compute and display cbox */ + FT_Outline_Get_CBox( outline, &bbox ); + printf( "cbox = [%.2f %.2f %.2f %.2f]\n", + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + + /* compute and display bbox */ + FT_Outline_Get_BBox( outline, &bbox ); + printf( "bbox = [%.2f %.2f %.2f %.2f]\n", + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + } + + + + static void + profile_outline( FT_Outline* outline, + long repeat ) + { + FT_BBox bbox; + long count; + long time0; + + time0 = get_time(); + for ( count = repeat; count > 0; count-- ) + FT_Outline_Get_CBox( outline, &bbox ); + + time0 = get_time() - time0; + printf( "time = %5.2f cbox = [%.2f %.2f %.2f %.2f]\n", + ((double)time0/10000.0), + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + + + time0 = get_time(); + for ( count = repeat; count > 0; count-- ) + FT_Outline_Get_BBox( outline, &bbox ); + + time0 = get_time() - time0; + printf( "time = %5.2f bbox = [%.2f %.2f %.2f %.2f]\n", + ((double)time0/10000.0), + XVAL( bbox.xMin ), + XVAL( bbox.yMin ), + XVAL( bbox.xMax ), + XVAL( bbox.yMax ) ); + } + +#define REPEAT 100000L + + int main( int argc, char** argv ) + { + printf( "outline #1\n" ); + profile_outline( &dummy_outline_1, REPEAT ); + + printf( "outline #2\n" ); + profile_outline( &dummy_outline_2, REPEAT ); + return 0; + } + diff --git a/reactos/dll/3rdparty/freetype/src/tools/test_trig.c b/reactos/dll/3rdparty/freetype/src/tools/test_trig.c index 8c8a544aa9b..4b5111dea4f 100644 --- a/reactos/dll/3rdparty/freetype/src/tools/test_trig.c +++ b/reactos/dll/3rdparty/freetype/src/tools/test_trig.c @@ -1,236 +1,236 @@ -#include -#include FT_FREETYPE_H -#include FT_TRIGONOMETRY_H - -#include -#include - -#define PI 3.14159265358979323846 -#define SPI (PI/FT_ANGLE_PI) - -/* the precision in 16.16 fixed float points of the checks. Expect */ -/* between 2 and 5 noise LSB bits during operations, due to */ -/* rounding errors.. */ -#define THRESHOLD 64 - - static error = 0; - - static void - test_cos( void ) - { - FT_Fixed f1, f2; - double d1, d2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - f1 = FT_Cos(i); - d1 = f1/65536.0; - d2 = cos( i*SPI ); - f2 = (FT_Fixed)(d2*65536.0); - - if ( abs( f2-f1 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Cos[%3d] = %.7f cos[%3d] = %.7f\n", - (i >> 16), f1/65536.0, (i >> 16), d2 ); - } - } - } - - - - static void - test_sin( void ) - { - FT_Fixed f1, f2; - double d1, d2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - f1 = FT_Sin(i); - d1 = f1/65536.0; - d2 = sin( i*SPI ); - f2 = (FT_Fixed)(d2*65536.0); - - if ( abs( f2-f1 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Sin[%3d] = %.7f sin[%3d] = %.7f\n", - (i >> 16), f1/65536.0, (i >> 16), d2 ); - } - } - } - - - static void - test_tan( void ) - { - FT_Fixed f1, f2; - double d1, d2; - int i; - - for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 ) - { - f1 = FT_Tan(i); - d1 = f1/65536.0; - d2 = tan( i*SPI ); - f2 = (FT_Fixed)(d2*65536.0); - - if ( abs( f2-f1 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Tan[%3d] = %.7f tan[%3d] = %.7f\n", - (i >> 16), f1/65536.0, (i >> 16), d2 ); - } - } - } - - - static void - test_atan2( void ) - { - FT_Fixed c2, s2; - double l, a, c1, s1; - int i, j; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - l = 5.0; - a = i*SPI; - - c1 = l * cos(a); - s1 = l * sin(a); - - c2 = (FT_Fixed)(c1*65536.0); - s2 = (FT_Fixed)(s1*65536.0); - - j = FT_Atan2( c2, s2 ); - if ( j < 0 ) - j += FT_ANGLE_2PI; - - if ( abs( i - j ) > 1 ) - { - printf( "FT_Atan2( %.7f, %.7f ) = %.5f, atan = %.5f\n", - c2/65536.0, s2/65536.0, j/65536.0, i/65536.0 ); - } - } - } - - static void - test_unit( void ) - { - FT_Vector v; - double a, c1, s1; - FT_Fixed c2, s2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - FT_Vector_Unit( &v, i ); - a = ( i*SPI ); - c1 = cos(a); - s1 = sin(a); - c2 = (FT_Fixed)(c1*65536.0); - s2 = (FT_Fixed)(s1*65536.0); - - if ( abs( v.x-c2 ) > THRESHOLD || - abs( v.y-s2 ) > THRESHOLD ) - { - error = 1; - printf( "FT_Vector_Unit[%3d] = ( %.7f, %.7f ) vec = ( %.7f, %.7f )\n", - (i >> 16), - v.x/65536.0, v.y/65536.0, - c1, s1 ); - } - } - } - - - static void - test_length( void ) - { - FT_Vector v; - FT_Fixed l, l2; - int i; - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - l = (FT_Fixed)(500.0*65536.0); - v.x = (FT_Fixed)( l * cos( i*SPI ) ); - v.y = (FT_Fixed)( l * sin( i*SPI ) ); - l2 = FT_Vector_Length( &v ); - - if ( abs( l2-l ) > THRESHOLD ) - { - error = 1; - printf( "FT_Length( %.7f, %.7f ) = %.5f, length = %.5f\n", - v.x/65536.0, v.y/65536.0, l2/65536.0, l/65536.0 ); - } - } - } - - - static void - test_rotate( void ) - { - FT_Fixed c2, s2, c4, s4; - FT_Vector v; - double l, ra, a, c1, s1, cra, sra, c3, s3; - int i, j, rotate; - - for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 ) - { - ra = rotate*SPI; - cra = cos( ra ); - sra = sin( ra ); - - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) - { - l = 500.0; - a = i*SPI; - - c1 = l * cos(a); - s1 = l * sin(a); - - v.x = c2 = (FT_Fixed)(c1*65536.0); - v.y = s2 = (FT_Fixed)(s1*65536.0); - - FT_Vector_Rotate( &v, rotate ); - - c3 = c1 * cra - s1 * sra; - s3 = c1 * sra + s1 * cra; - - c4 = (FT_Fixed)(c3*65536.0); - s4 = (FT_Fixed)(s3*65536.0); - - if ( abs( c4 - v.x ) > THRESHOLD || - abs( s4 - v.y ) > THRESHOLD ) - { - error = 1; - printf( "FT_Rotate( (%.7f,%.7f), %.5f ) = ( %.7f, %.7f ), rot = ( %.7f, %.7f )\n", - c1, s1, ra, - c2/65536.0, s2/65536.0, - c4/65536.0, s4/65536.0 ); - } - } - } - } - - - int main( void ) - { - test_cos(); - test_sin(); - test_tan(); - test_atan2(); - test_unit(); - test_length(); - test_rotate(); - - if (!error) - printf( "trigonometry test ok !\n" ); - - return !error; - } +#include +#include FT_FREETYPE_H +#include FT_TRIGONOMETRY_H + +#include +#include + +#define PI 3.14159265358979323846 +#define SPI (PI/FT_ANGLE_PI) + +/* the precision in 16.16 fixed float points of the checks. Expect */ +/* between 2 and 5 noise LSB bits during operations, due to */ +/* rounding errors.. */ +#define THRESHOLD 64 + + static error = 0; + + static void + test_cos( void ) + { + FT_Fixed f1, f2; + double d1, d2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + f1 = FT_Cos(i); + d1 = f1/65536.0; + d2 = cos( i*SPI ); + f2 = (FT_Fixed)(d2*65536.0); + + if ( abs( f2-f1 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Cos[%3d] = %.7f cos[%3d] = %.7f\n", + (i >> 16), f1/65536.0, (i >> 16), d2 ); + } + } + } + + + + static void + test_sin( void ) + { + FT_Fixed f1, f2; + double d1, d2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + f1 = FT_Sin(i); + d1 = f1/65536.0; + d2 = sin( i*SPI ); + f2 = (FT_Fixed)(d2*65536.0); + + if ( abs( f2-f1 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Sin[%3d] = %.7f sin[%3d] = %.7f\n", + (i >> 16), f1/65536.0, (i >> 16), d2 ); + } + } + } + + + static void + test_tan( void ) + { + FT_Fixed f1, f2; + double d1, d2; + int i; + + for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 ) + { + f1 = FT_Tan(i); + d1 = f1/65536.0; + d2 = tan( i*SPI ); + f2 = (FT_Fixed)(d2*65536.0); + + if ( abs( f2-f1 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Tan[%3d] = %.7f tan[%3d] = %.7f\n", + (i >> 16), f1/65536.0, (i >> 16), d2 ); + } + } + } + + + static void + test_atan2( void ) + { + FT_Fixed c2, s2; + double l, a, c1, s1; + int i, j; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + l = 5.0; + a = i*SPI; + + c1 = l * cos(a); + s1 = l * sin(a); + + c2 = (FT_Fixed)(c1*65536.0); + s2 = (FT_Fixed)(s1*65536.0); + + j = FT_Atan2( c2, s2 ); + if ( j < 0 ) + j += FT_ANGLE_2PI; + + if ( abs( i - j ) > 1 ) + { + printf( "FT_Atan2( %.7f, %.7f ) = %.5f, atan = %.5f\n", + c2/65536.0, s2/65536.0, j/65536.0, i/65536.0 ); + } + } + } + + static void + test_unit( void ) + { + FT_Vector v; + double a, c1, s1; + FT_Fixed c2, s2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + FT_Vector_Unit( &v, i ); + a = ( i*SPI ); + c1 = cos(a); + s1 = sin(a); + c2 = (FT_Fixed)(c1*65536.0); + s2 = (FT_Fixed)(s1*65536.0); + + if ( abs( v.x-c2 ) > THRESHOLD || + abs( v.y-s2 ) > THRESHOLD ) + { + error = 1; + printf( "FT_Vector_Unit[%3d] = ( %.7f, %.7f ) vec = ( %.7f, %.7f )\n", + (i >> 16), + v.x/65536.0, v.y/65536.0, + c1, s1 ); + } + } + } + + + static void + test_length( void ) + { + FT_Vector v; + FT_Fixed l, l2; + int i; + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + l = (FT_Fixed)(500.0*65536.0); + v.x = (FT_Fixed)( l * cos( i*SPI ) ); + v.y = (FT_Fixed)( l * sin( i*SPI ) ); + l2 = FT_Vector_Length( &v ); + + if ( abs( l2-l ) > THRESHOLD ) + { + error = 1; + printf( "FT_Length( %.7f, %.7f ) = %.5f, length = %.5f\n", + v.x/65536.0, v.y/65536.0, l2/65536.0, l/65536.0 ); + } + } + } + + + static void + test_rotate( void ) + { + FT_Fixed c2, s2, c4, s4; + FT_Vector v; + double l, ra, a, c1, s1, cra, sra, c3, s3; + int i, j, rotate; + + for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 ) + { + ra = rotate*SPI; + cra = cos( ra ); + sra = sin( ra ); + + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + { + l = 500.0; + a = i*SPI; + + c1 = l * cos(a); + s1 = l * sin(a); + + v.x = c2 = (FT_Fixed)(c1*65536.0); + v.y = s2 = (FT_Fixed)(s1*65536.0); + + FT_Vector_Rotate( &v, rotate ); + + c3 = c1 * cra - s1 * sra; + s3 = c1 * sra + s1 * cra; + + c4 = (FT_Fixed)(c3*65536.0); + s4 = (FT_Fixed)(s3*65536.0); + + if ( abs( c4 - v.x ) > THRESHOLD || + abs( s4 - v.y ) > THRESHOLD ) + { + error = 1; + printf( "FT_Rotate( (%.7f,%.7f), %.5f ) = ( %.7f, %.7f ), rot = ( %.7f, %.7f )\n", + c1, s1, ra, + c2/65536.0, s2/65536.0, + c4/65536.0, s4/65536.0 ); + } + } + } + } + + + int main( void ) + { + test_cos(); + test_sin(); + test_tan(); + test_atan2(); + test_unit(); + test_length(); + test_rotate(); + + if (!error) + printf( "trigonometry test ok !\n" ); + + return !error; + } diff --git a/reactos/dll/3rdparty/freetype/src/truetype/truetype.c b/reactos/dll/3rdparty/freetype/src/truetype/truetype.c index b36473a72df..2d6db62840f 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/truetype.c +++ b/reactos/dll/3rdparty/freetype/src/truetype/truetype.c @@ -1,36 +1,36 @@ -/***************************************************************************/ -/* */ -/* truetype.c */ -/* */ -/* FreeType TrueType driver component (body only). */ -/* */ -/* Copyright 1996-2001, 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "ttdriver.c" /* driver interface */ -#include "ttpload.c" /* tables loader */ -#include "ttgload.c" /* glyph loader */ -#include "ttobjs.c" /* object manager */ - -#ifdef TT_USE_BYTECODE_INTERPRETER -#include "ttinterp.c" -#endif - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include "ttgxvar.c" /* gx distortable font */ -#endif - - -/* END */ +/***************************************************************************/ +/* */ +/* truetype.c */ +/* */ +/* FreeType TrueType driver component (body only). */ +/* */ +/* Copyright 1996-2001, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "ttdriver.c" /* driver interface */ +#include "ttpload.c" /* tables loader */ +#include "ttgload.c" /* glyph loader */ +#include "ttobjs.c" /* object manager */ + +#ifdef TT_USE_BYTECODE_INTERPRETER +#include "ttinterp.c" +#endif + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#include "ttgxvar.c" /* gx distortable font */ +#endif + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.c b/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.c index c2cf45298a5..d02e7e2fe43 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.c +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.c @@ -1,418 +1,418 @@ -/***************************************************************************/ -/* */ -/* ttdriver.c */ -/* */ -/* TrueType font driver implementation (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_TRUETYPE_IDS_H -#include FT_SERVICE_XFREE86_NAME_H - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_MULTIPLE_MASTERS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H -#endif - -#include FT_SERVICE_TRUETYPE_ENGINE_H -#include FT_SERVICE_TRUETYPE_GLYF_H - -#include "ttdriver.h" -#include "ttgload.h" -#include "ttpload.h" - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include "ttgxvar.h" -#endif - -#include "tterrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttdriver - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** F A C E S ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - -#undef PAIR_TAG -#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \ - (FT_ULong)right ) - - - /*************************************************************************/ - /* */ - /* */ - /* tt_get_kerning */ - /* */ - /* */ - /* A driver method used to return the kerning vector between two */ - /* glyphs of the same face. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* left_glyph :: The index of the left glyph in the kern pair. */ - /* */ - /* right_glyph :: The index of the right glyph in the kern pair. */ - /* */ - /* */ - /* kerning :: The kerning vector. This is in font units for */ - /* scalable formats, and in pixels for fixed-sizes */ - /* formats. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only horizontal layouts (left-to-right & right-to-left) are */ - /* supported by this function. Other layouts, or more sophisticated */ - /* kernings, are out of scope of this method (the basic driver */ - /* interface is meant to be simple). */ - /* */ - /* They can be implemented by format-specific interfaces. */ - /* */ - static FT_Error - tt_get_kerning( FT_Face ttface, /* TT_Face */ - FT_UInt left_glyph, - FT_UInt right_glyph, - FT_Vector* kerning ) - { - TT_Face face = (TT_Face)ttface; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - - kerning->x = 0; - kerning->y = 0; - - if ( sfnt ) - kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph ); - - return 0; - } - - -#undef PAIR_TAG - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** S I Z E S ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - static FT_Error - tt_size_select( FT_Size size, - FT_ULong strike_index ) - { - TT_Face ttface = (TT_Face)size->face; - TT_Size ttsize = (TT_Size)size; - FT_Error error = TT_Err_Ok; - - - ttsize->strike_index = strike_index; - - if ( FT_IS_SCALABLE( size->face ) ) - { - /* use the scaled metrics, even when tt_size_reset fails */ - FT_Select_Metrics( size->face, strike_index ); - - tt_size_reset( ttsize ); - } - else - { - SFNT_Service sfnt = (SFNT_Service) ttface->sfnt; - FT_Size_Metrics* metrics = &size->metrics; - - - error = sfnt->load_strike_metrics( ttface, strike_index, metrics ); - if ( error ) - ttsize->strike_index = 0xFFFFFFFFUL; - } - - return error; - } - -#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - - - static FT_Error - tt_size_request( FT_Size size, - FT_Size_Request req ) - { - TT_Size ttsize = (TT_Size)size; - FT_Error error = TT_Err_Ok; - - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - if ( FT_HAS_FIXED_SIZES( size->face ) ) - { - TT_Face ttface = (TT_Face)size->face; - SFNT_Service sfnt = (SFNT_Service) ttface->sfnt; - FT_ULong strike_index; - - - error = sfnt->set_sbit_strike( ttface, req, &strike_index ); - - if ( error ) - ttsize->strike_index = 0xFFFFFFFFUL; - else - return tt_size_select( size, strike_index ); - } - -#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - - FT_Request_Metrics( size->face, req ); - - if ( FT_IS_SCALABLE( size->face ) ) - error = tt_size_reset( ttsize ); - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Load_Glyph */ - /* */ - /* */ - /* A driver method used to load a glyph within a given glyph slot. */ - /* */ - /* */ - /* slot :: A handle to the target slot object where the glyph */ - /* will be loaded. */ - /* */ - /* size :: A handle to the source face size at which the glyph */ - /* must be scaled, loaded, etc. */ - /* */ - /* glyph_index :: The index of the glyph in the font file. */ - /* */ - /* load_flags :: A flag indicating what to load for this glyph. The */ - /* FTLOAD_??? constants can be used to control the */ - /* glyph loading process (e.g., whether the outline */ - /* should be scaled, whether to load bitmaps or not, */ - /* whether to hint the outline, etc). */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Load_Glyph( FT_GlyphSlot ttslot, /* TT_GlyphSlot */ - FT_Size ttsize, /* TT_Size */ - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - TT_GlyphSlot slot = (TT_GlyphSlot)ttslot; - TT_Size size = (TT_Size)ttsize; - FT_Face face = ttslot->face; - FT_Error error; - - - if ( !slot ) - return TT_Err_Invalid_Slot_Handle; - - if ( !size ) - return TT_Err_Invalid_Size_Handle; - - if ( !face || glyph_index >= (FT_UInt)face->num_glyphs ) - return TT_Err_Invalid_Argument; - - if ( load_flags & ( FT_LOAD_NO_RECURSE | FT_LOAD_NO_SCALE ) ) - { - load_flags |= FT_LOAD_NO_HINTING | - FT_LOAD_NO_BITMAP | - FT_LOAD_NO_SCALE; - } - - /* now load the glyph outline if necessary */ - error = TT_Load_Glyph( size, slot, glyph_index, load_flags ); - - /* force drop-out mode to 2 - irrelevant now */ - /* slot->outline.dropout_mode = 2; */ - - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /**** ****/ - /**** ****/ - /**** D R I V E R I N T E R F A C E ****/ - /**** ****/ - /**** ****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - static const FT_Service_MultiMastersRec tt_service_gx_multi_masters = - { - (FT_Get_MM_Func) NULL, - (FT_Set_MM_Design_Func) NULL, - (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, - (FT_Get_MM_Var_Func) TT_Get_MM_Var, - (FT_Set_Var_Design_Func)TT_Set_Var_Design - }; -#endif - - static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine = - { -#ifdef TT_USE_BYTECODE_INTERPRETER - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - FT_TRUETYPE_ENGINE_TYPE_UNPATENTED -#else - FT_TRUETYPE_ENGINE_TYPE_PATENTED -#endif - -#else /* !TT_USE_BYTECODE_INTERPRETER */ - - FT_TRUETYPE_ENGINE_TYPE_NONE - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - }; - - static const FT_Service_TTGlyfRec tt_service_truetype_glyf = - { - (TT_Glyf_GetLocationFunc)tt_face_get_location - }; - - static const FT_ServiceDescRec tt_services[] = - { - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE }, -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - { FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters }, -#endif - { FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine }, - { FT_SERVICE_ID_TT_GLYF, &tt_service_truetype_glyf }, - { NULL, NULL } - }; - - - FT_CALLBACK_DEF( FT_Module_Interface ) - tt_get_interface( FT_Module driver, /* TT_Driver */ - const char* tt_interface ) - { - FT_Module_Interface result; - FT_Module sfntd; - SFNT_Service sfnt; - - - result = ft_service_list_lookup( tt_services, tt_interface ); - if ( result != NULL ) - return result; - - /* only return the default interface from the SFNT module */ - sfntd = FT_Get_Module( driver->library, "sfnt" ); - if ( sfntd ) - { - sfnt = (SFNT_Service)( sfntd->clazz->module_interface ); - if ( sfnt ) - return sfnt->get_interface( driver, tt_interface ); - } - - return 0; - } - - - /* The FT_DriverInterface structure is defined in ftdriver.h. */ - - FT_CALLBACK_TABLE_DEF - const FT_Driver_ClassRec tt_driver_class = - { - { - FT_MODULE_FONT_DRIVER | - FT_MODULE_DRIVER_SCALABLE | -#ifdef TT_USE_BYTECODE_INTERPRETER - FT_MODULE_DRIVER_HAS_HINTER, -#else - 0, -#endif - - sizeof ( TT_DriverRec ), - - "truetype", /* driver name */ - 0x10000L, /* driver version == 1.0 */ - 0x20000L, /* driver requires FreeType 2.0 or above */ - - (void*)0, /* driver specific interface */ - - tt_driver_init, - tt_driver_done, - tt_get_interface, - }, - - sizeof ( TT_FaceRec ), - sizeof ( TT_SizeRec ), - sizeof ( FT_GlyphSlotRec ), - - tt_face_init, - tt_face_done, - tt_size_init, - tt_size_done, - tt_slot_init, - 0, /* FT_Slot_DoneFunc */ - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif - Load_Glyph, - - tt_get_kerning, - 0, /* FT_Face_AttachFunc */ - 0, /* FT_Face_GetAdvancesFunc */ - - tt_size_request, -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - tt_size_select -#else - 0 /* FT_Size_SelectFunc */ -#endif - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* ttdriver.c */ +/* */ +/* TrueType font driver implementation (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_TRUETYPE_IDS_H +#include FT_SERVICE_XFREE86_NAME_H + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#include FT_MULTIPLE_MASTERS_H +#include FT_SERVICE_MULTIPLE_MASTERS_H +#endif + +#include FT_SERVICE_TRUETYPE_ENGINE_H +#include FT_SERVICE_TRUETYPE_GLYF_H + +#include "ttdriver.h" +#include "ttgload.h" +#include "ttpload.h" + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#include "ttgxvar.h" +#endif + +#include "tterrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttdriver + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** F A C E S ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + +#undef PAIR_TAG +#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \ + (FT_ULong)right ) + + + /*************************************************************************/ + /* */ + /* */ + /* tt_get_kerning */ + /* */ + /* */ + /* A driver method used to return the kerning vector between two */ + /* glyphs of the same face. */ + /* */ + /* */ + /* face :: A handle to the source face object. */ + /* */ + /* left_glyph :: The index of the left glyph in the kern pair. */ + /* */ + /* right_glyph :: The index of the right glyph in the kern pair. */ + /* */ + /* */ + /* kerning :: The kerning vector. This is in font units for */ + /* scalable formats, and in pixels for fixed-sizes */ + /* formats. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* Only horizontal layouts (left-to-right & right-to-left) are */ + /* supported by this function. Other layouts, or more sophisticated */ + /* kernings, are out of scope of this method (the basic driver */ + /* interface is meant to be simple). */ + /* */ + /* They can be implemented by format-specific interfaces. */ + /* */ + static FT_Error + tt_get_kerning( FT_Face ttface, /* TT_Face */ + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) + { + TT_Face face = (TT_Face)ttface; + SFNT_Service sfnt = (SFNT_Service)face->sfnt; + + + kerning->x = 0; + kerning->y = 0; + + if ( sfnt ) + kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph ); + + return 0; + } + + +#undef PAIR_TAG + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** S I Z E S ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + static FT_Error + tt_size_select( FT_Size size, + FT_ULong strike_index ) + { + TT_Face ttface = (TT_Face)size->face; + TT_Size ttsize = (TT_Size)size; + FT_Error error = TT_Err_Ok; + + + ttsize->strike_index = strike_index; + + if ( FT_IS_SCALABLE( size->face ) ) + { + /* use the scaled metrics, even when tt_size_reset fails */ + FT_Select_Metrics( size->face, strike_index ); + + tt_size_reset( ttsize ); + } + else + { + SFNT_Service sfnt = (SFNT_Service) ttface->sfnt; + FT_Size_Metrics* metrics = &size->metrics; + + + error = sfnt->load_strike_metrics( ttface, strike_index, metrics ); + if ( error ) + ttsize->strike_index = 0xFFFFFFFFUL; + } + + return error; + } + +#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + + static FT_Error + tt_size_request( FT_Size size, + FT_Size_Request req ) + { + TT_Size ttsize = (TT_Size)size; + FT_Error error = TT_Err_Ok; + + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + if ( FT_HAS_FIXED_SIZES( size->face ) ) + { + TT_Face ttface = (TT_Face)size->face; + SFNT_Service sfnt = (SFNT_Service) ttface->sfnt; + FT_ULong strike_index; + + + error = sfnt->set_sbit_strike( ttface, req, &strike_index ); + + if ( error ) + ttsize->strike_index = 0xFFFFFFFFUL; + else + return tt_size_select( size, strike_index ); + } + +#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + FT_Request_Metrics( size->face, req ); + + if ( FT_IS_SCALABLE( size->face ) ) + error = tt_size_reset( ttsize ); + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Load_Glyph */ + /* */ + /* */ + /* A driver method used to load a glyph within a given glyph slot. */ + /* */ + /* */ + /* slot :: A handle to the target slot object where the glyph */ + /* will be loaded. */ + /* */ + /* size :: A handle to the source face size at which the glyph */ + /* must be scaled, loaded, etc. */ + /* */ + /* glyph_index :: The index of the glyph in the font file. */ + /* */ + /* load_flags :: A flag indicating what to load for this glyph. The */ + /* FTLOAD_??? constants can be used to control the */ + /* glyph loading process (e.g., whether the outline */ + /* should be scaled, whether to load bitmaps or not, */ + /* whether to hint the outline, etc). */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + Load_Glyph( FT_GlyphSlot ttslot, /* TT_GlyphSlot */ + FT_Size ttsize, /* TT_Size */ + FT_UInt glyph_index, + FT_Int32 load_flags ) + { + TT_GlyphSlot slot = (TT_GlyphSlot)ttslot; + TT_Size size = (TT_Size)ttsize; + FT_Face face = ttslot->face; + FT_Error error; + + + if ( !slot ) + return TT_Err_Invalid_Slot_Handle; + + if ( !size ) + return TT_Err_Invalid_Size_Handle; + + if ( !face || glyph_index >= (FT_UInt)face->num_glyphs ) + return TT_Err_Invalid_Argument; + + if ( load_flags & ( FT_LOAD_NO_RECURSE | FT_LOAD_NO_SCALE ) ) + { + load_flags |= FT_LOAD_NO_HINTING | + FT_LOAD_NO_BITMAP | + FT_LOAD_NO_SCALE; + } + + /* now load the glyph outline if necessary */ + error = TT_Load_Glyph( size, slot, glyph_index, load_flags ); + + /* force drop-out mode to 2 - irrelevant now */ + /* slot->outline.dropout_mode = 2; */ + + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** D R I V E R I N T E R F A C E ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + static const FT_Service_MultiMastersRec tt_service_gx_multi_masters = + { + (FT_Get_MM_Func) NULL, + (FT_Set_MM_Design_Func) NULL, + (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, + (FT_Get_MM_Var_Func) TT_Get_MM_Var, + (FT_Set_Var_Design_Func)TT_Set_Var_Design + }; +#endif + + static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine = + { +#ifdef TT_USE_BYTECODE_INTERPRETER + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + FT_TRUETYPE_ENGINE_TYPE_UNPATENTED +#else + FT_TRUETYPE_ENGINE_TYPE_PATENTED +#endif + +#else /* !TT_USE_BYTECODE_INTERPRETER */ + + FT_TRUETYPE_ENGINE_TYPE_NONE + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + }; + + static const FT_Service_TTGlyfRec tt_service_truetype_glyf = + { + (TT_Glyf_GetLocationFunc)tt_face_get_location + }; + + static const FT_ServiceDescRec tt_services[] = + { + { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE }, +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + { FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters }, +#endif + { FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine }, + { FT_SERVICE_ID_TT_GLYF, &tt_service_truetype_glyf }, + { NULL, NULL } + }; + + + FT_CALLBACK_DEF( FT_Module_Interface ) + tt_get_interface( FT_Module driver, /* TT_Driver */ + const char* tt_interface ) + { + FT_Module_Interface result; + FT_Module sfntd; + SFNT_Service sfnt; + + + result = ft_service_list_lookup( tt_services, tt_interface ); + if ( result != NULL ) + return result; + + /* only return the default interface from the SFNT module */ + sfntd = FT_Get_Module( driver->library, "sfnt" ); + if ( sfntd ) + { + sfnt = (SFNT_Service)( sfntd->clazz->module_interface ); + if ( sfnt ) + return sfnt->get_interface( driver, tt_interface ); + } + + return 0; + } + + + /* The FT_DriverInterface structure is defined in ftdriver.h. */ + + FT_CALLBACK_TABLE_DEF + const FT_Driver_ClassRec tt_driver_class = + { + { + FT_MODULE_FONT_DRIVER | + FT_MODULE_DRIVER_SCALABLE | +#ifdef TT_USE_BYTECODE_INTERPRETER + FT_MODULE_DRIVER_HAS_HINTER, +#else + 0, +#endif + + sizeof ( TT_DriverRec ), + + "truetype", /* driver name */ + 0x10000L, /* driver version == 1.0 */ + 0x20000L, /* driver requires FreeType 2.0 or above */ + + (void*)0, /* driver specific interface */ + + tt_driver_init, + tt_driver_done, + tt_get_interface, + }, + + sizeof ( TT_FaceRec ), + sizeof ( TT_SizeRec ), + sizeof ( FT_GlyphSlotRec ), + + tt_face_init, + tt_face_done, + tt_size_init, + tt_size_done, + tt_slot_init, + 0, /* FT_Slot_DoneFunc */ + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + ft_stub_set_char_sizes, + ft_stub_set_pixel_sizes, +#endif + Load_Glyph, + + tt_get_kerning, + 0, /* FT_Face_AttachFunc */ + 0, /* FT_Face_GetAdvancesFunc */ + + tt_size_request, +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + tt_size_select +#else + 0 /* FT_Size_SelectFunc */ +#endif + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.h b/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.h index f6f26e4b59a..d73c4c67b6d 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.h +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttdriver.h @@ -1,38 +1,38 @@ -/***************************************************************************/ -/* */ -/* ttdriver.h */ -/* */ -/* High-level TrueType driver interface (specification). */ -/* */ -/* Copyright 1996-2001, 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTDRIVER_H__ -#define __TTDRIVER_H__ - - -#include -#include FT_INTERNAL_DRIVER_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Driver_ClassRec ) tt_driver_class; - - -FT_END_HEADER - -#endif /* __TTDRIVER_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttdriver.h */ +/* */ +/* High-level TrueType driver interface (specification). */ +/* */ +/* Copyright 1996-2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTDRIVER_H__ +#define __TTDRIVER_H__ + + +#include +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Driver_ClassRec ) tt_driver_class; + + +FT_END_HEADER + +#endif /* __TTDRIVER_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/tterrors.h b/reactos/dll/3rdparty/freetype/src/truetype/tterrors.h index d317c70e0eb..9ed5b33fcff 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/tterrors.h +++ b/reactos/dll/3rdparty/freetype/src/truetype/tterrors.h @@ -1,40 +1,40 @@ -/***************************************************************************/ -/* */ -/* tterrors.h */ -/* */ -/* TrueType error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the TrueType error enumeration */ - /* constants. */ - /* */ - /*************************************************************************/ - -#ifndef __TTERRORS_H__ -#define __TTERRORS_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX TT_Err_ -#define FT_ERR_BASE FT_Mod_Err_TrueType - -#include FT_ERRORS_H - -#endif /* __TTERRORS_H__ */ - -/* END */ +/***************************************************************************/ +/* */ +/* tterrors.h */ +/* */ +/* TrueType error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the TrueType error enumeration */ + /* constants. */ + /* */ + /*************************************************************************/ + +#ifndef __TTERRORS_H__ +#define __TTERRORS_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX TT_Err_ +#define FT_ERR_BASE FT_Mod_Err_TrueType + +#include FT_ERRORS_H + +#endif /* __TTERRORS_H__ */ + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttgload.c b/reactos/dll/3rdparty/freetype/src/truetype/ttgload.c index ae476a41711..88635393d83 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttgload.c +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttgload.c @@ -1,1957 +1,1957 @@ -/***************************************************************************/ -/* */ -/* ttgload.c */ -/* */ -/* TrueType Glyph Loader (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_TRUETYPE_TAGS_H -#include FT_OUTLINE_H - -#include "ttgload.h" -#include "ttpload.h" - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include "ttgxvar.h" -#endif - -#include "tterrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttgload - - - /*************************************************************************/ - /* */ - /* Composite font flags. */ - /* */ -#define ARGS_ARE_WORDS 0x0001 -#define ARGS_ARE_XY_VALUES 0x0002 -#define ROUND_XY_TO_GRID 0x0004 -#define WE_HAVE_A_SCALE 0x0008 -/* reserved 0x0010 */ -#define MORE_COMPONENTS 0x0020 -#define WE_HAVE_AN_XY_SCALE 0x0040 -#define WE_HAVE_A_2X2 0x0080 -#define WE_HAVE_INSTR 0x0100 -#define USE_MY_METRICS 0x0200 -#define OVERLAP_COMPOUND 0x0400 -#define SCALED_COMPONENT_OFFSET 0x0800 -#define UNSCALED_COMPONENT_OFFSET 0x1000 - - - /*************************************************************************/ - /* */ - /* Returns the horizontal metrics in font units for a given glyph. If */ - /* `check' is true, take care of monospaced fonts by returning the */ - /* advance width maximum. */ - /* */ - static void - Get_HMetrics( TT_Face face, - FT_UInt idx, - FT_Bool check, - FT_Short* lsb, - FT_UShort* aw ) - { - ( (SFNT_Service)face->sfnt )->get_metrics( face, 0, idx, lsb, aw ); - - if ( check && face->postscript.isFixedPitch ) - *aw = face->horizontal.advance_Width_Max; - } - - - /*************************************************************************/ - /* */ - /* Returns the vertical metrics in font units for a given glyph. */ - /* Greg Hitchcock from Microsoft told us that if there were no `vmtx' */ - /* table, typoAscender/Descender from the `OS/2' table would be used */ - /* instead, and if there were no `OS/2' table, use ascender/descender */ - /* from the `hhea' table. But that is not what Microsoft's rasterizer */ - /* apparently does: It uses the ppem value as the advance height, and */ - /* sets the top side bearing to be zero. */ - /* */ - /* The monospace `check' is probably not meaningful here, but we leave */ - /* it in for a consistent interface. */ - /* */ - static void - Get_VMetrics( TT_Face face, - FT_UInt idx, - FT_Bool check, - FT_Short* tsb, - FT_UShort* ah ) - { - FT_UNUSED( check ); - - if ( face->vertical_info ) - ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, idx, tsb, ah ); - -#if 1 /* Empirically determined, at variance with what MS said */ - - else - { - *tsb = 0; - *ah = face->root.units_per_EM; - } - -#else /* This is what MS said to do. It isn't what they do, however. */ - - else if ( face->os2.version != 0xFFFFU ) - { - *tsb = face->os2.sTypoAscender; - *ah = face->os2.sTypoAscender - face->os2.sTypoDescender; - } - else - { - *tsb = face->horizontal.Ascender; - *ah = face->horizontal.Ascender - face->horizontal.Descender; - } - -#endif - - } - - - /*************************************************************************/ - /* */ - /* Translates an array of coordinates. */ - /* */ - static void - translate_array( FT_UInt n, - FT_Vector* coords, - FT_Pos delta_x, - FT_Pos delta_y ) - { - FT_UInt k; - - - if ( delta_x ) - for ( k = 0; k < n; k++ ) - coords[k].x += delta_x; - - if ( delta_y ) - for ( k = 0; k < n; k++ ) - coords[k].y += delta_y; - } - - -#undef IS_HINTED -#define IS_HINTED( flags ) ( ( flags & FT_LOAD_NO_HINTING ) == 0 ) - - - /*************************************************************************/ - /* */ - /* The following functions are used by default with TrueType fonts. */ - /* However, they can be replaced by alternatives if we need to support */ - /* TrueType-compressed formats (like MicroType) in the future. */ - /* */ - /*************************************************************************/ - - FT_CALLBACK_DEF( FT_Error ) - TT_Access_Glyph_Frame( TT_Loader loader, - FT_UInt glyph_index, - FT_ULong offset, - FT_UInt byte_count ) - { - FT_Error error; - FT_Stream stream = loader->stream; - - /* for non-debug mode */ - FT_UNUSED( glyph_index ); - - - FT_TRACE5(( "Glyph %ld\n", glyph_index )); - - /* the following line sets the `error' variable through macros! */ - if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( byte_count ) ) - return error; - - loader->cursor = stream->cursor; - loader->limit = stream->limit; - - return TT_Err_Ok; - } - - - FT_CALLBACK_DEF( void ) - TT_Forget_Glyph_Frame( TT_Loader loader ) - { - FT_Stream stream = loader->stream; - - - FT_FRAME_EXIT(); - } - - - FT_CALLBACK_DEF( FT_Error ) - TT_Load_Glyph_Header( TT_Loader loader ) - { - FT_Byte* p = loader->cursor; - FT_Byte* limit = loader->limit; - - - if ( p + 10 > limit ) - return TT_Err_Invalid_Outline; - - loader->n_contours = FT_NEXT_SHORT( p ); - - loader->bbox.xMin = FT_NEXT_SHORT( p ); - loader->bbox.yMin = FT_NEXT_SHORT( p ); - loader->bbox.xMax = FT_NEXT_SHORT( p ); - loader->bbox.yMax = FT_NEXT_SHORT( p ); - - FT_TRACE5(( " # of contours: %d\n", loader->n_contours )); - FT_TRACE5(( " xMin: %4d xMax: %4d\n", loader->bbox.xMin, - loader->bbox.xMax )); - FT_TRACE5(( " yMin: %4d yMax: %4d\n", loader->bbox.yMin, - loader->bbox.yMax )); - loader->cursor = p; - - return TT_Err_Ok; - } - - - FT_CALLBACK_DEF( FT_Error ) - TT_Load_Simple_Glyph( TT_Loader load ) - { - FT_Error error; - FT_Byte* p = load->cursor; - FT_Byte* limit = load->limit; - FT_GlyphLoader gloader = load->gloader; - FT_Int n_contours = load->n_contours; - FT_Outline* outline; - TT_Face face = (TT_Face)load->face; - FT_UShort n_ins; - FT_Int n_points; - - FT_Byte *flag, *flag_limit; - FT_Byte c, count; - FT_Vector *vec, *vec_limit; - FT_Pos x; - FT_Short *cont, *cont_limit, prev_cont; - FT_Int xy_size = 0; - - - /* check that we can add the contours to the glyph */ - error = FT_GLYPHLOADER_CHECK_POINTS( gloader, 0, n_contours ); - if ( error ) - goto Fail; - - /* reading the contours' endpoints & number of points */ - cont = gloader->current.outline.contours; - cont_limit = cont + n_contours; - - /* check space for contours array + instructions count */ - if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit ) - goto Invalid_Outline; - - cont[0] = prev_cont = FT_NEXT_USHORT( p ); - for ( cont++; cont < cont_limit; cont++ ) - { - cont[0] = FT_NEXT_USHORT( p ); - if ( cont[0] <= prev_cont ) - { - /* unordered contours: this is invalid */ - error = FT_Err_Invalid_Table; - goto Fail; - } - prev_cont = cont[0]; - } - - n_points = 0; - if ( n_contours > 0 ) - { - n_points = cont[-1] + 1; - if ( n_points < 0 ) - goto Invalid_Outline; - } - - /* note that we will add four phantom points later */ - error = FT_GLYPHLOADER_CHECK_POINTS( gloader, n_points + 4, 0 ); - if ( error ) - goto Fail; - - /* we'd better check the contours table right now */ - outline = &gloader->current.outline; - - for ( cont = outline->contours + 1; cont < cont_limit; cont++ ) - if ( cont[-1] >= cont[0] ) - goto Invalid_Outline; - - /* reading the bytecode instructions */ - load->glyph->control_len = 0; - load->glyph->control_data = 0; - - if ( p + 2 > limit ) - goto Invalid_Outline; - - n_ins = FT_NEXT_USHORT( p ); - - FT_TRACE5(( " Instructions size: %u\n", n_ins )); - - if ( n_ins > face->max_profile.maxSizeOfInstructions ) - { - FT_TRACE0(( "TT_Load_Simple_Glyph: Too many instructions (%d)\n", - n_ins )); - error = TT_Err_Too_Many_Hints; - goto Fail; - } - - if ( ( limit - p ) < n_ins ) - { - FT_TRACE0(( "TT_Load_Simple_Glyph: Instruction count mismatch!\n" )); - error = TT_Err_Too_Many_Hints; - goto Fail; - } - -#ifdef TT_USE_BYTECODE_INTERPRETER - - if ( IS_HINTED( load->load_flags ) ) - { - load->glyph->control_len = n_ins; - load->glyph->control_data = load->exec->glyphIns; - - FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins ); - } - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - p += n_ins; - - /* reading the point tags */ - flag = (FT_Byte*)outline->tags; - flag_limit = flag + n_points; - - FT_ASSERT( flag != NULL ); - - while ( flag < flag_limit ) - { - if ( p + 1 > limit ) - goto Invalid_Outline; - - *flag++ = c = FT_NEXT_BYTE( p ); - if ( c & 8 ) - { - if ( p + 1 > limit ) - goto Invalid_Outline; - - count = FT_NEXT_BYTE( p ); - if ( flag + (FT_Int)count > flag_limit ) - goto Invalid_Outline; - - for ( ; count > 0; count-- ) - *flag++ = c; - } - } - - /* reading the X coordinates */ - - vec = outline->points; - vec_limit = vec + n_points; - flag = (FT_Byte*)outline->tags; - x = 0; - - if ( p + xy_size > limit ) - goto Invalid_Outline; - - for ( ; vec < vec_limit; vec++, flag++ ) - { - FT_Pos y = 0; - FT_Byte f = *flag; - - - if ( f & 2 ) - { - if ( p + 1 > limit ) - goto Invalid_Outline; - - y = (FT_Pos)FT_NEXT_BYTE( p ); - if ( ( f & 16 ) == 0 ) - y = -y; - } - else if ( ( f & 16 ) == 0 ) - { - if ( p + 2 > limit ) - goto Invalid_Outline; - - y = (FT_Pos)FT_NEXT_SHORT( p ); - } - - x += y; - vec->x = x; - *flag = f & ~( 2 | 16 ); - } - - /* reading the Y coordinates */ - - vec = gloader->current.outline.points; - vec_limit = vec + n_points; - flag = (FT_Byte*)outline->tags; - x = 0; - - for ( ; vec < vec_limit; vec++, flag++ ) - { - FT_Pos y = 0; - FT_Byte f = *flag; - - - if ( f & 4 ) - { - if ( p + 1 > limit ) - goto Invalid_Outline; - - y = (FT_Pos)FT_NEXT_BYTE( p ); - if ( ( f & 32 ) == 0 ) - y = -y; - } - else if ( ( f & 32 ) == 0 ) - { - if ( p + 2 > limit ) - goto Invalid_Outline; - - y = (FT_Pos)FT_NEXT_SHORT( p ); - } - - x += y; - vec->y = x; - *flag = f & FT_CURVE_TAG_ON; - } - - outline->n_points = (FT_UShort)n_points; - outline->n_contours = (FT_Short) n_contours; - - load->cursor = p; - - Fail: - return error; - - Invalid_Outline: - error = TT_Err_Invalid_Outline; - goto Fail; - } - - - FT_CALLBACK_DEF( FT_Error ) - TT_Load_Composite_Glyph( TT_Loader loader ) - { - FT_Error error; - FT_Byte* p = loader->cursor; - FT_Byte* limit = loader->limit; - FT_GlyphLoader gloader = loader->gloader; - FT_SubGlyph subglyph; - FT_UInt num_subglyphs; - - - num_subglyphs = 0; - - do - { - FT_Fixed xx, xy, yy, yx; - FT_UInt count; - - - /* check that we can load a new subglyph */ - error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs + 1 ); - if ( error ) - goto Fail; - - /* check space */ - if ( p + 4 > limit ) - goto Invalid_Composite; - - subglyph = gloader->current.subglyphs + num_subglyphs; - - subglyph->arg1 = subglyph->arg2 = 0; - - subglyph->flags = FT_NEXT_USHORT( p ); - subglyph->index = FT_NEXT_USHORT( p ); - - /* check space */ - count = 2; - if ( subglyph->flags & ARGS_ARE_WORDS ) - count += 2; - if ( subglyph->flags & WE_HAVE_A_SCALE ) - count += 2; - else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE ) - count += 4; - else if ( subglyph->flags & WE_HAVE_A_2X2 ) - count += 8; - - if ( p + count > limit ) - goto Invalid_Composite; - - /* read arguments */ - if ( subglyph->flags & ARGS_ARE_WORDS ) - { - subglyph->arg1 = FT_NEXT_SHORT( p ); - subglyph->arg2 = FT_NEXT_SHORT( p ); - } - else - { - subglyph->arg1 = FT_NEXT_CHAR( p ); - subglyph->arg2 = FT_NEXT_CHAR( p ); - } - - /* read transform */ - xx = yy = 0x10000L; - xy = yx = 0; - - if ( subglyph->flags & WE_HAVE_A_SCALE ) - { - xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; - yy = xx; - } - else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE ) - { - xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; - yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; - } - else if ( subglyph->flags & WE_HAVE_A_2X2 ) - { - xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; - yx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; - xy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; - yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; - } - - subglyph->transform.xx = xx; - subglyph->transform.xy = xy; - subglyph->transform.yx = yx; - subglyph->transform.yy = yy; - - num_subglyphs++; - - } while ( subglyph->flags & MORE_COMPONENTS ); - - gloader->current.num_subglyphs = num_subglyphs; - -#ifdef TT_USE_BYTECODE_INTERPRETER - - { - FT_Stream stream = loader->stream; - - - /* we must undo the FT_FRAME_ENTER in order to point to the */ - /* composite instructions, if we find some. */ - /* we will process them later... */ - /* */ - loader->ins_pos = (FT_ULong)( FT_STREAM_POS() + - p - limit ); - } - -#endif - - loader->cursor = p; - - Fail: - return error; - - Invalid_Composite: - error = TT_Err_Invalid_Composite; - goto Fail; - } - - - FT_LOCAL_DEF( void ) - TT_Init_Glyph_Loading( TT_Face face ) - { - face->access_glyph_frame = TT_Access_Glyph_Frame; - face->read_glyph_header = TT_Load_Glyph_Header; - face->read_simple_glyph = TT_Load_Simple_Glyph; - face->read_composite_glyph = TT_Load_Composite_Glyph; - face->forget_glyph_frame = TT_Forget_Glyph_Frame; - } - - - static void - tt_prepare_zone( TT_GlyphZone zone, - FT_GlyphLoad load, - FT_UInt start_point, - FT_UInt start_contour ) - { - zone->n_points = (FT_UShort)( load->outline.n_points - start_point ); - zone->n_contours = (FT_Short) ( load->outline.n_contours - - start_contour ); - zone->org = load->extra_points + start_point; - zone->cur = load->outline.points + start_point; - zone->orus = load->extra_points2 + start_point; - zone->tags = (FT_Byte*)load->outline.tags + start_point; - zone->contours = (FT_UShort*)load->outline.contours + start_contour; - zone->first_point = (FT_UShort)start_point; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Hint_Glyph */ - /* */ - /* */ - /* Hint the glyph using the zone prepared by the caller. Note that */ - /* the zone is supposed to include four phantom points. */ - /* */ - static FT_Error - TT_Hint_Glyph( TT_Loader loader, - FT_Bool is_composite ) - { - TT_GlyphZone zone = &loader->zone; - FT_Pos origin; - -#ifdef TT_USE_BYTECODE_INTERPRETER - FT_UInt n_ins; -#else - FT_UNUSED( is_composite ); -#endif - - -#ifdef TT_USE_BYTECODE_INTERPRETER - n_ins = loader->glyph->control_len; -#endif - - origin = zone->cur[zone->n_points - 4].x; - origin = FT_PIX_ROUND( origin ) - origin; - if ( origin ) - translate_array( zone->n_points, zone->cur, origin, 0 ); - -#ifdef TT_USE_BYTECODE_INTERPRETER - /* save original point position in org */ - if ( n_ins > 0 ) - FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points ); -#endif - - /* round pp2 and pp4 */ - zone->cur[zone->n_points - 3].x = - FT_PIX_ROUND( zone->cur[zone->n_points - 3].x ); - zone->cur[zone->n_points - 1].y = - FT_PIX_ROUND( zone->cur[zone->n_points - 1].y ); - -#ifdef TT_USE_BYTECODE_INTERPRETER - - if ( n_ins > 0 ) - { - FT_Bool debug; - FT_Error error; - - - error = TT_Set_CodeRange( loader->exec, tt_coderange_glyph, - loader->exec->glyphIns, n_ins ); - if ( error ) - return error; - - loader->exec->is_composite = is_composite; - loader->exec->pts = *zone; - - debug = FT_BOOL( !( loader->load_flags & FT_LOAD_NO_SCALE ) && - ((TT_Size)loader->size)->debug ); - - error = TT_Run_Context( loader->exec, debug ); - if ( error && loader->exec->pedantic_hinting ) - return error; - } - -#endif - - /* save glyph phantom points */ - if ( !loader->preserve_pps ) - { - loader->pp1 = zone->cur[zone->n_points - 4]; - loader->pp2 = zone->cur[zone->n_points - 3]; - loader->pp3 = zone->cur[zone->n_points - 2]; - loader->pp4 = zone->cur[zone->n_points - 1]; - } - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Process_Simple_Glyph */ - /* */ - /* */ - /* Once a simple glyph has been loaded, it needs to be processed. */ - /* Usually, this means scaling and hinting through bytecode */ - /* interpretation. */ - /* */ - static FT_Error - TT_Process_Simple_Glyph( TT_Loader loader ) - { - FT_GlyphLoader gloader = loader->gloader; - FT_Error error = TT_Err_Ok; - FT_Outline* outline; - FT_UInt n_points; - - - outline = &gloader->current.outline; - n_points = outline->n_points; - - /* set phantom points */ - - outline->points[n_points ] = loader->pp1; - outline->points[n_points + 1] = loader->pp2; - outline->points[n_points + 2] = loader->pp3; - outline->points[n_points + 3] = loader->pp4; - - outline->tags[n_points ] = 0; - outline->tags[n_points + 1] = 0; - outline->tags[n_points + 2] = 0; - outline->tags[n_points + 3] = 0; - - n_points += 4; - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - - if ( ((TT_Face)loader->face)->doblend ) - { - /* Deltas apply to the unscaled data. */ - FT_Vector* deltas; - FT_Memory memory = loader->face->memory; - FT_UInt i; - - - error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face), - loader->glyph_index, - &deltas, - n_points ); - if ( error ) - return error; - - for ( i = 0; i < n_points; ++i ) - { - outline->points[i].x += deltas[i].x; - outline->points[i].y += deltas[i].y; - } - - FT_FREE( deltas ); - } - -#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ - - if ( IS_HINTED( loader->load_flags ) ) - { - tt_prepare_zone( &loader->zone, &gloader->current, 0, 0 ); - - FT_ARRAY_COPY( loader->zone.orus, loader->zone.cur, - loader->zone.n_points + 4 ); - } - - /* scale the glyph */ - if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) - { - FT_Vector* vec = outline->points; - FT_Vector* limit = outline->points + n_points; - FT_Fixed x_scale = ((TT_Size)loader->size)->metrics.x_scale; - FT_Fixed y_scale = ((TT_Size)loader->size)->metrics.y_scale; - - - for ( ; vec < limit; vec++ ) - { - vec->x = FT_MulFix( vec->x, x_scale ); - vec->y = FT_MulFix( vec->y, y_scale ); - } - - loader->pp1 = outline->points[n_points - 4]; - loader->pp2 = outline->points[n_points - 3]; - loader->pp3 = outline->points[n_points - 2]; - loader->pp4 = outline->points[n_points - 1]; - } - - if ( IS_HINTED( loader->load_flags ) ) - { - loader->zone.n_points += 4; - - error = TT_Hint_Glyph( loader, 0 ); - } - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Process_Composite_Component */ - /* */ - /* */ - /* Once a composite component has been loaded, it needs to be */ - /* processed. Usually, this means transforming and translating. */ - /* */ - static FT_Error - TT_Process_Composite_Component( TT_Loader loader, - FT_SubGlyph subglyph, - FT_UInt start_point, - FT_UInt num_base_points ) - { - FT_GlyphLoader gloader = loader->gloader; - FT_Vector* base_vec = gloader->base.outline.points; - FT_UInt num_points = gloader->base.outline.n_points; - FT_Bool have_scale; - FT_Pos x, y; - - - have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE | - WE_HAVE_AN_XY_SCALE | - WE_HAVE_A_2X2 ) ); - - /* perform the transform required for this subglyph */ - if ( have_scale ) - { - FT_UInt i; - - - for ( i = num_base_points; i < num_points; i++ ) - FT_Vector_Transform( base_vec + i, &subglyph->transform ); - } - - /* get offset */ - if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) ) - { - FT_UInt k = subglyph->arg1; - FT_UInt l = subglyph->arg2; - FT_Vector* p1; - FT_Vector* p2; - - - /* match l-th point of the newly loaded component to the k-th point */ - /* of the previously loaded components. */ - - /* change to the point numbers used by our outline */ - k += start_point; - l += num_base_points; - if ( k >= num_base_points || - l >= num_points ) - return TT_Err_Invalid_Composite; - - p1 = gloader->base.outline.points + k; - p2 = gloader->base.outline.points + l; - - x = p1->x - p2->x; - y = p1->y - p2->y; - } - else - { - x = subglyph->arg1; - y = subglyph->arg2; - - if ( !x && !y ) - return TT_Err_Ok; - - /* Use a default value dependent on */ - /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED. This is useful for old TT */ - /* fonts which don't set the xxx_COMPONENT_OFFSET bit. */ - - if ( have_scale && -#ifdef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED - !( subglyph->flags & UNSCALED_COMPONENT_OFFSET ) ) -#else - ( subglyph->flags & SCALED_COMPONENT_OFFSET ) ) -#endif - { - -#if 0 - - /*************************************************************************/ - /* */ - /* This algorithm is what Apple documents. But it doesn't work. */ - /* */ - int a = subglyph->transform.xx > 0 ? subglyph->transform.xx - : -subglyph->transform.xx; - int b = subglyph->transform.yx > 0 ? subglyph->transform.yx - : -subglyph->transform.yx; - int c = subglyph->transform.xy > 0 ? subglyph->transform.xy - : -subglyph->transform.xy; - int d = subglyph->transform.yy > 0 ? subglyph->transform.yy - : -subglyph->transform.yy; - int m = a > b ? a : b; - int n = c > d ? c : d; - - - if ( a - b <= 33 && a - b >= -33 ) - m *= 2; - if ( c - d <= 33 && c - d >= -33 ) - n *= 2; - x = FT_MulFix( x, m ); - y = FT_MulFix( y, n ); - -#else /* 0 */ - - /*************************************************************************/ - /* */ - /* This algorithm is a guess and works much better than the above. */ - /* */ - FT_Fixed mac_xscale = FT_SqrtFixed( - FT_MulFix( subglyph->transform.xx, - subglyph->transform.xx ) + - FT_MulFix( subglyph->transform.xy, - subglyph->transform.xy ) ); - FT_Fixed mac_yscale = FT_SqrtFixed( - FT_MulFix( subglyph->transform.yy, - subglyph->transform.yy ) + - FT_MulFix( subglyph->transform.yx, - subglyph->transform.yx ) ); - - - x = FT_MulFix( x, mac_xscale ); - y = FT_MulFix( y, mac_yscale ); - -#endif /* 0 */ - - } - - if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) ) - { - FT_Fixed x_scale = ((TT_Size)loader->size)->metrics.x_scale; - FT_Fixed y_scale = ((TT_Size)loader->size)->metrics.y_scale; - - - x = FT_MulFix( x, x_scale ); - y = FT_MulFix( y, y_scale ); - - if ( subglyph->flags & ROUND_XY_TO_GRID ) - { - x = FT_PIX_ROUND( x ); - y = FT_PIX_ROUND( y ); - } - } - } - - if ( x || y ) - translate_array( num_points - num_base_points, - base_vec + num_base_points, - x, y ); - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Process_Composite_Glyph */ - /* */ - /* */ - /* This is slightly different from TT_Process_Simple_Glyph, in that */ - /* its sole purpose is to hint the glyph. Thus this function is */ - /* only available when bytecode interpreter is enabled. */ - /* */ - static FT_Error - TT_Process_Composite_Glyph( TT_Loader loader, - FT_UInt start_point, - FT_UInt start_contour ) - { - FT_Error error; - FT_Outline* outline; - FT_UInt i; - - - outline = &loader->gloader->base.outline; - - /* make room for phantom points */ - error = FT_GLYPHLOADER_CHECK_POINTS( loader->gloader, - outline->n_points + 4, - 0 ); - if ( error ) - return error; - - outline->points[outline->n_points ] = loader->pp1; - outline->points[outline->n_points + 1] = loader->pp2; - outline->points[outline->n_points + 2] = loader->pp3; - outline->points[outline->n_points + 3] = loader->pp4; - - outline->tags[outline->n_points ] = 0; - outline->tags[outline->n_points + 1] = 0; - outline->tags[outline->n_points + 2] = 0; - outline->tags[outline->n_points + 3] = 0; - -#ifdef TT_USE_BYTECODE_INTERPRETER - - { - FT_Stream stream = loader->stream; - FT_UShort n_ins; - - - /* TT_Load_Composite_Glyph only gives us the offset of instructions */ - /* so we read them here */ - if ( FT_STREAM_SEEK( loader->ins_pos ) || - FT_READ_USHORT( n_ins ) ) - return error; - - FT_TRACE5(( " Instructions size = %d\n", n_ins )); - - /* check it */ - if ( n_ins > ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions ) - { - FT_TRACE0(( "TT_Process_Composite_Glyph: Too many instructions (%d)\n", - n_ins )); - - return TT_Err_Too_Many_Hints; - } - else if ( n_ins == 0 ) - return TT_Err_Ok; - - if ( FT_STREAM_READ( loader->exec->glyphIns, n_ins ) ) - return error; - - loader->glyph->control_data = loader->exec->glyphIns; - loader->glyph->control_len = n_ins; - } - -#endif - - tt_prepare_zone( &loader->zone, &loader->gloader->base, - start_point, start_contour ); - - /* Some points are likely touched during execution of */ - /* instructions on components. So let's untouch them. */ - for ( i = start_point; i < loader->zone.n_points; i++ ) - loader->zone.tags[i] &= ~( FT_CURVE_TAG_TOUCH_X | - FT_CURVE_TAG_TOUCH_Y ); - - loader->zone.n_points += 4; - - return TT_Hint_Glyph( loader, 1 ); - } - - - /* Calculate the four phantom points. */ - /* The first two stand for horizontal origin and advance. */ - /* The last two stand for vertical origin and advance. */ -#define TT_LOADER_SET_PP( loader ) \ - do { \ - (loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \ - (loader)->pp1.y = 0; \ - (loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \ - (loader)->pp2.y = 0; \ - (loader)->pp3.x = 0; \ - (loader)->pp3.y = (loader)->top_bearing + (loader)->bbox.yMax; \ - (loader)->pp4.x = 0; \ - (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance; \ - } while ( 0 ) - - - /*************************************************************************/ - /* */ - /* */ - /* load_truetype_glyph */ - /* */ - /* */ - /* Loads a given truetype glyph. Handles composites and uses a */ - /* TT_Loader object. */ - /* */ - static FT_Error - load_truetype_glyph( TT_Loader loader, - FT_UInt glyph_index, - FT_UInt recurse_count ) - { - FT_Error error; - FT_Fixed x_scale, y_scale; - FT_ULong offset; - TT_Face face = (TT_Face)loader->face; - FT_GlyphLoader gloader = loader->gloader; - FT_Bool opened_frame = 0; - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - FT_Vector* deltas = NULL; -#endif - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - FT_StreamRec inc_stream; - FT_Data glyph_data; - FT_Bool glyph_data_loaded = 0; -#endif - - - if ( recurse_count > face->max_profile.maxComponentDepth ) - { - error = TT_Err_Invalid_Composite; - goto Exit; - } - - /* check glyph index */ - if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) - { - error = TT_Err_Invalid_Glyph_Index; - goto Exit; - } - - loader->glyph_index = glyph_index; - - if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) - { - x_scale = ((TT_Size)loader->size)->metrics.x_scale; - y_scale = ((TT_Size)loader->size)->metrics.y_scale; - } - else - { - x_scale = 0x10000L; - y_scale = 0x10000L; - } - - /* get metrics, horizontal and vertical */ - { - FT_Short left_bearing = 0, top_bearing = 0; - FT_UShort advance_width = 0, advance_height = 0; - - - Get_HMetrics( face, glyph_index, - (FT_Bool)!( loader->load_flags & - FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), - &left_bearing, - &advance_width ); - Get_VMetrics( face, glyph_index, - (FT_Bool)!( loader->load_flags & - FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), - &top_bearing, - &advance_height ); - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - /* If this is an incrementally loaded font see if there are */ - /* overriding metrics for this glyph. */ - if ( face->root.internal->incremental_interface && - face->root.internal->incremental_interface->funcs->get_glyph_metrics ) - { - FT_Incremental_MetricsRec metrics; - - - metrics.bearing_x = left_bearing; - metrics.bearing_y = 0; - metrics.advance = advance_width; - error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( - face->root.internal->incremental_interface->object, - glyph_index, FALSE, &metrics ); - if ( error ) - goto Exit; - left_bearing = (FT_Short)metrics.bearing_x; - advance_width = (FT_UShort)metrics.advance; - -#if 0 - - /* GWW: Do I do the same for vertical metrics? */ - metrics.bearing_x = 0; - metrics.bearing_y = top_bearing; - metrics.advance = advance_height; - error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( - face->root.internal->incremental_interface->object, - glyph_index, TRUE, &metrics ); - if ( error ) - goto Exit; - top_bearing = (FT_Short)metrics.bearing_y; - advance_height = (FT_UShort)metrics.advance; - -#endif /* 0 */ - - } - -#endif /* FT_CONFIG_OPTION_INCREMENTAL */ - - loader->left_bearing = left_bearing; - loader->advance = advance_width; - loader->top_bearing = top_bearing; - loader->vadvance = advance_height; - - if ( !loader->linear_def ) - { - loader->linear_def = 1; - loader->linear = advance_width; - } - } - - /* Set `offset' to the start of the glyph relative to the start of */ - /* the `glyf' table, and `byte_len' to the length of the glyph in */ - /* bytes. */ - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - /* If we are loading glyph data via the incremental interface, set */ - /* the loader stream to a memory stream reading the data returned */ - /* by the interface. */ - if ( face->root.internal->incremental_interface ) - { - error = face->root.internal->incremental_interface->funcs->get_glyph_data( - face->root.internal->incremental_interface->object, - glyph_index, &glyph_data ); - if ( error ) - goto Exit; - - glyph_data_loaded = 1; - offset = 0; - loader->byte_len = glyph_data.length; - - FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) ); - FT_Stream_OpenMemory( &inc_stream, - glyph_data.pointer, glyph_data.length ); - - loader->stream = &inc_stream; - } - else - -#endif /* FT_CONFIG_OPTION_INCREMENTAL */ - - offset = tt_face_get_location( face, glyph_index, - (FT_UInt*)&loader->byte_len ); - - if ( loader->byte_len == 0 ) - { - /* as described by Frederic Loyer, these are spaces or */ - /* the unknown glyph. */ - loader->bbox.xMin = 0; - loader->bbox.xMax = 0; - loader->bbox.yMin = 0; - loader->bbox.yMax = 0; - - TT_LOADER_SET_PP( loader ); - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - - if ( ((TT_Face)(loader->face))->doblend ) - { - /* this must be done before scaling */ - FT_Memory memory = loader->face->memory; - - - error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face), - glyph_index, &deltas, 4 ); - if ( error ) - goto Exit; - - loader->pp1.x += deltas[0].x; loader->pp1.y += deltas[0].y; - loader->pp2.x += deltas[1].x; loader->pp2.y += deltas[1].y; - loader->pp3.x += deltas[2].x; loader->pp3.y += deltas[2].y; - loader->pp4.x += deltas[3].x; loader->pp4.y += deltas[3].y; - - FT_FREE( deltas ); - } - -#endif - - if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) - { - loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale ); - loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale ); - loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale ); - loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale ); - } - - error = TT_Err_Ok; - goto Exit; - } - - error = face->access_glyph_frame( loader, glyph_index, - loader->glyf_offset + offset, - loader->byte_len ); - if ( error ) - goto Exit; - - opened_frame = 1; - - /* read first glyph header */ - error = face->read_glyph_header( loader ); - if ( error ) - goto Exit; - - TT_LOADER_SET_PP( loader ); - - /***********************************************************************/ - /***********************************************************************/ - /***********************************************************************/ - - /* if it is a simple glyph, load it */ - - if ( loader->n_contours >= 0 ) - { - error = face->read_simple_glyph( loader ); - if ( error ) - goto Exit; - - /* all data have been read */ - face->forget_glyph_frame( loader ); - opened_frame = 0; - - error = TT_Process_Simple_Glyph( loader ); - if ( error ) - goto Exit; - - FT_GlyphLoader_Add( gloader ); - } - - /***********************************************************************/ - /***********************************************************************/ - /***********************************************************************/ - - /* otherwise, load a composite! */ - else if ( loader->n_contours == -1 ) - { - FT_UInt start_point; - FT_UInt start_contour; - FT_ULong ins_pos; /* position of composite instructions, if any */ - - - start_point = gloader->base.outline.n_points; - start_contour = gloader->base.outline.n_contours; - - /* for each subglyph, read composite header */ - error = face->read_composite_glyph( loader ); - if ( error ) - goto Exit; - - /* store the offset of instructions */ - ins_pos = loader->ins_pos; - - /* all data we need are read */ - face->forget_glyph_frame( loader ); - opened_frame = 0; - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - - if ( face->doblend ) - { - FT_Int i, limit; - FT_SubGlyph subglyph; - FT_Memory memory = face->root.memory; - - - /* this provides additional offsets */ - /* for each component's translation */ - - if ( ( error = TT_Vary_Get_Glyph_Deltas( - face, - glyph_index, - &deltas, - gloader->current.num_subglyphs + 4 )) != 0 ) - goto Exit; - - subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs; - limit = gloader->current.num_subglyphs; - - for ( i = 0; i < limit; ++i, ++subglyph ) - { - if ( subglyph->flags & ARGS_ARE_XY_VALUES ) - { - subglyph->arg1 += deltas[i].x; - subglyph->arg2 += deltas[i].y; - } - } - - loader->pp1.x += deltas[i + 0].x; loader->pp1.y += deltas[i + 0].y; - loader->pp2.x += deltas[i + 1].x; loader->pp2.y += deltas[i + 1].y; - loader->pp3.x += deltas[i + 2].x; loader->pp3.y += deltas[i + 2].y; - loader->pp4.x += deltas[i + 3].x; loader->pp4.y += deltas[i + 3].y; - - FT_FREE( deltas ); - } - -#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ - - if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) - { - loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale ); - loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale ); - loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale ); - loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale ); - } - - /* if the flag FT_LOAD_NO_RECURSE is set, we return the subglyph */ - /* `as is' in the glyph slot (the client application will be */ - /* responsible for interpreting these data)... */ - if ( loader->load_flags & FT_LOAD_NO_RECURSE ) - { - FT_GlyphLoader_Add( gloader ); - loader->glyph->format = FT_GLYPH_FORMAT_COMPOSITE; - - goto Exit; - } - - /*********************************************************************/ - /*********************************************************************/ - /*********************************************************************/ - - { - FT_UInt n, num_base_points; - FT_SubGlyph subglyph = 0; - - FT_UInt num_points = start_point; - FT_UInt num_subglyphs = gloader->current.num_subglyphs; - FT_UInt num_base_subgs = gloader->base.num_subglyphs; - - FT_Stream old_stream = loader->stream; - - TT_GraphicsState saved_GS; - - - if ( loader->exec ) - saved_GS = loader->exec->GS; - - FT_GlyphLoader_Add( gloader ); - - /* read each subglyph independently */ - for ( n = 0; n < num_subglyphs; n++ ) - { - FT_Vector pp[4]; - - - /* reinitialize graphics state */ - if ( loader->exec ) - loader->exec->GS = saved_GS; - - /* Each time we call load_truetype_glyph in this loop, the */ - /* value of `gloader.base.subglyphs' can change due to table */ - /* reallocations. We thus need to recompute the subglyph */ - /* pointer on each iteration. */ - subglyph = gloader->base.subglyphs + num_base_subgs + n; - - pp[0] = loader->pp1; - pp[1] = loader->pp2; - pp[2] = loader->pp3; - pp[3] = loader->pp4; - - num_base_points = gloader->base.outline.n_points; - - error = load_truetype_glyph( loader, subglyph->index, - recurse_count + 1 ); - if ( error ) - goto Exit; - - /* restore subglyph pointer */ - subglyph = gloader->base.subglyphs + num_base_subgs + n; - - if ( !( subglyph->flags & USE_MY_METRICS ) ) - { - loader->pp1 = pp[0]; - loader->pp2 = pp[1]; - loader->pp3 = pp[2]; - loader->pp4 = pp[3]; - } - - num_points = gloader->base.outline.n_points; - - if ( num_points == num_base_points ) - continue; - - /* gloader->base.outline consists of three parts: */ - /* 0 -(1)-> start_point -(2)-> num_base_points -(3)-> n_points. */ - /* */ - /* (1): exists from the beginning */ - /* (2): components that have been loaded so far */ - /* (3): the newly loaded component */ - TT_Process_Composite_Component( loader, subglyph, start_point, - num_base_points ); - } - - loader->stream = old_stream; - - /* process the glyph */ - loader->ins_pos = ins_pos; - if ( IS_HINTED( loader->load_flags ) && - -#ifdef TT_USE_BYTECODE_INTERPRETER - - subglyph->flags & WE_HAVE_INSTR && - -#endif - - num_points > start_point ) - TT_Process_Composite_Glyph( loader, start_point, start_contour ); - - } - } - else - { - /* invalid composite count (negative but not -1) */ - error = TT_Err_Invalid_Outline; - goto Exit; - } - - /***********************************************************************/ - /***********************************************************************/ - /***********************************************************************/ - - Exit: - - if ( opened_frame ) - face->forget_glyph_frame( loader ); - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - if ( glyph_data_loaded ) - face->root.internal->incremental_interface->funcs->free_glyph_data( - face->root.internal->incremental_interface->object, - &glyph_data ); - -#endif - - return error; - } - - - static FT_Error - compute_glyph_metrics( TT_Loader loader, - FT_UInt glyph_index ) - { - FT_BBox bbox; - TT_Face face = (TT_Face)loader->face; - FT_Fixed y_scale; - TT_GlyphSlot glyph = loader->glyph; - TT_Size size = (TT_Size)loader->size; - - - y_scale = 0x10000L; - if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) - y_scale = size->root.metrics.y_scale; - - if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE ) - FT_Outline_Get_CBox( &glyph->outline, &bbox ); - else - bbox = loader->bbox; - - /* get the device-independent horizontal advance; it is scaled later */ - /* by the base layer. */ - { - FT_Pos advance = loader->linear; - - - /* the flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH was introduced to */ - /* correctly support DynaLab fonts, which have an incorrect */ - /* `advance_Width_Max' field! It is used, to my knowledge, */ - /* exclusively in the X-TrueType font server. */ - /* */ - if ( face->postscript.isFixedPitch && - ( loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) == 0 ) - advance = face->horizontal.advance_Width_Max; - - /* we need to return the advance in font units in linearHoriAdvance, */ - /* it will be scaled later by the base layer. */ - glyph->linearHoriAdvance = advance; - } - - glyph->metrics.horiBearingX = bbox.xMin; - glyph->metrics.horiBearingY = bbox.yMax; - glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x; - - /* Now take care of vertical metrics. In the case where there is */ - /* no vertical information within the font (relatively common), make */ - /* up some metrics by `hand'... */ - - { - FT_Pos top; /* scaled vertical top side bearing */ - FT_Pos advance; /* scaled vertical advance height */ - - - /* Get the unscaled top bearing and advance height. */ - if ( face->vertical_info && - face->vertical.number_Of_VMetrics > 0 ) - { - top = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax, - y_scale ); - - if ( loader->pp3.y <= loader->pp4.y ) - advance = 0; - else - advance = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y, - y_scale ); - } - else - { - FT_Pos height; - - - /* XXX Compute top side bearing and advance height in */ - /* Get_VMetrics instead of here. */ - - /* NOTE: The OS/2 values are the only `portable' ones, */ - /* which is why we use them, if there is an OS/2 */ - /* table in the font. Otherwise, we use the */ - /* values defined in the horizontal header. */ - - height = (FT_Short)FT_DivFix( bbox.yMax - bbox.yMin, - y_scale ); - if ( face->os2.version != 0xFFFFU ) - advance = (FT_Pos)( face->os2.sTypoAscender - - face->os2.sTypoDescender ); - else - advance = (FT_Pos)( face->horizontal.Ascender - - face->horizontal.Descender ); - - top = ( advance - height ) / 2; - } - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - { - FT_Incremental_InterfaceRec* incr; - FT_Incremental_MetricsRec metrics; - FT_Error error; - - - incr = face->root.internal->incremental_interface; - - /* If this is an incrementally loaded font see if there are */ - /* overriding metrics for this glyph. */ - if ( incr && incr->funcs->get_glyph_metrics ) - { - metrics.bearing_x = 0; - metrics.bearing_y = top; - metrics.advance = advance; - - error = incr->funcs->get_glyph_metrics( incr->object, - glyph_index, - TRUE, - &metrics ); - if ( error ) - return error; - - top = metrics.bearing_y; - advance = metrics.advance; - } - } - - /* GWW: Do vertical metrics get loaded incrementally too? */ - -#endif /* FT_CONFIG_OPTION_INCREMENTAL */ - - glyph->linearVertAdvance = advance; - - /* scale the metrics */ - if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) ) - { - top = FT_MulFix( top, y_scale ); - advance = FT_MulFix( advance, y_scale ); - } - - /* XXX: for now, we have no better algorithm for the lsb, but it */ - /* should work fine. */ - /* */ - glyph->metrics.vertBearingX = ( bbox.xMin - bbox.xMax ) / 2; - glyph->metrics.vertBearingY = top; - glyph->metrics.vertAdvance = advance; - } - - /* adjust advance width to the value contained in the hdmx table */ - if ( !face->postscript.isFixedPitch && - IS_HINTED( loader->load_flags ) ) - { - FT_Byte* widthp; - - - widthp = tt_face_get_device_metrics( face, - size->root.metrics.x_ppem, - glyph_index ); - - if ( widthp ) - glyph->metrics.horiAdvance = *widthp << 6; - } - - /* set glyph dimensions */ - glyph->metrics.width = bbox.xMax - bbox.xMin; - glyph->metrics.height = bbox.yMax - bbox.yMin; - - return 0; - } - - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - static FT_Error - load_sbit_image( TT_Size size, - TT_GlyphSlot glyph, - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - TT_Face face; - SFNT_Service sfnt; - FT_Stream stream; - FT_Error error; - TT_SBit_MetricsRec metrics; - - - face = (TT_Face)glyph->face; - sfnt = (SFNT_Service)face->sfnt; - stream = face->root.stream; - - error = sfnt->load_sbit_image( face, - size->strike_index, - glyph_index, - (FT_Int)load_flags, - stream, - &glyph->bitmap, - &metrics ); - if ( !error ) - { - glyph->outline.n_points = 0; - glyph->outline.n_contours = 0; - - glyph->metrics.width = (FT_Pos)metrics.width << 6; - glyph->metrics.height = (FT_Pos)metrics.height << 6; - - glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6; - glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6; - glyph->metrics.horiAdvance = (FT_Pos)metrics.horiAdvance << 6; - - glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6; - glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6; - glyph->metrics.vertAdvance = (FT_Pos)metrics.vertAdvance << 6; - - glyph->format = FT_GLYPH_FORMAT_BITMAP; - if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) - { - glyph->bitmap_left = metrics.vertBearingX; - glyph->bitmap_top = metrics.vertBearingY; - } - else - { - glyph->bitmap_left = metrics.horiBearingX; - glyph->bitmap_top = metrics.horiBearingY; - } - } - - return error; - } - -#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - - - static FT_Error - tt_loader_init( TT_Loader loader, - TT_Size size, - TT_GlyphSlot glyph, - FT_Int32 load_flags ) - { - TT_Face face; - FT_Stream stream; - - - face = (TT_Face)glyph->face; - stream = face->root.stream; - - FT_MEM_ZERO( loader, sizeof ( TT_LoaderRec ) ); - -#ifdef TT_USE_BYTECODE_INTERPRETER - - /* load execution context */ - if ( IS_HINTED( load_flags ) ) - { - TT_ExecContext exec; - FT_Bool grayscale; - - - if ( !size->cvt_ready ) - { - FT_Error error = tt_size_ready_bytecode( size ); - if ( error ) - return error; - } - - /* query new execution context */ - exec = size->debug ? size->context - : ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; - if ( !exec ) - return TT_Err_Could_Not_Find_Context; - - grayscale = - FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_RENDER_MODE_MONO ); - - TT_Load_Context( exec, face, size ); - - /* a change from mono to grayscale rendering (and vice versa) */ - /* requires a re-execution of the CVT program */ - if ( grayscale != exec->grayscale ) - { - FT_UInt i; - - - exec->grayscale = grayscale; - - for ( i = 0; i < size->cvt_size; i++ ) - size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); - tt_size_run_prep( size ); - } - - /* see whether the cvt program has disabled hinting */ - if ( exec->GS.instruct_control & 1 ) - load_flags |= FT_LOAD_NO_HINTING; - - /* load default graphics state -- if needed */ - if ( exec->GS.instruct_control & 2 ) - exec->GS = tt_default_graphics_state; - - exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); - loader->exec = exec; - loader->instructions = exec->glyphIns; - } - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - /* seek to the beginning of the glyph table -- for Type 42 fonts */ - /* the table might be accessed from a Postscript stream or something */ - /* else... */ - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - if ( face->root.internal->incremental_interface ) - loader->glyf_offset = 0; - else - -#endif - - { - FT_Error error = face->goto_table( face, TTAG_glyf, stream, 0 ); - - - if ( error ) - { - FT_ERROR(( "TT_Load_Glyph: could not access glyph table\n" )); - return error; - } - loader->glyf_offset = FT_STREAM_POS(); - } - - /* get face's glyph loader */ - { - FT_GlyphLoader gloader = glyph->internal->loader; - - - FT_GlyphLoader_Rewind( gloader ); - loader->gloader = gloader; - } - - loader->load_flags = load_flags; - - loader->face = (FT_Face)face; - loader->size = (FT_Size)size; - loader->glyph = (FT_GlyphSlot)glyph; - loader->stream = stream; - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Load_Glyph */ - /* */ - /* */ - /* A function used to load a single glyph within a given glyph slot, */ - /* for a given size. */ - /* */ - /* */ - /* glyph :: A handle to a target slot object where the glyph */ - /* will be loaded. */ - /* */ - /* size :: A handle to the source face size at which the glyph */ - /* must be scaled/loaded. */ - /* */ - /* glyph_index :: The index of the glyph in the font file. */ - /* */ - /* load_flags :: A flag indicating what to load for this glyph. The */ - /* FT_LOAD_XXX constants can be used to control the */ - /* glyph loading process (e.g., whether the outline */ - /* should be scaled, whether to load bitmaps or not, */ - /* whether to hint the outline, etc). */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Load_Glyph( TT_Size size, - TT_GlyphSlot glyph, - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - TT_Face face; - FT_Error error; - TT_LoaderRec loader; - - - face = (TT_Face)glyph->face; - error = TT_Err_Ok; - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS - - /* try to load embedded bitmap if any */ - /* */ - /* XXX: The convention should be emphasized in */ - /* the documents because it can be confusing. */ - if ( size->strike_index != 0xFFFFFFFFUL && - ( load_flags & FT_LOAD_NO_BITMAP ) == 0 ) - { - error = load_sbit_image( size, glyph, glyph_index, load_flags ); - if ( !error ) - return TT_Err_Ok; - } - -#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ - - /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */ - if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid ) - return TT_Err_Invalid_Size_Handle; - - if ( load_flags & FT_LOAD_SBITS_ONLY ) - return TT_Err_Invalid_Argument; - - error = tt_loader_init( &loader, size, glyph, load_flags ); - if ( error ) - return error; - - glyph->format = FT_GLYPH_FORMAT_OUTLINE; - glyph->num_subglyphs = 0; - glyph->outline.flags = 0; - - /* main loading loop */ - error = load_truetype_glyph( &loader, glyph_index, 0 ); - if ( !error ) - { - if ( glyph->format == FT_GLYPH_FORMAT_COMPOSITE ) - { - glyph->num_subglyphs = loader.gloader->base.num_subglyphs; - glyph->subglyphs = loader.gloader->base.subglyphs; - } - else - { - glyph->outline = loader.gloader->base.outline; - glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS; - - /* In case bit 1 of the `flags' field in the `head' table isn't */ - /* set, translate array so that (0,0) is the glyph's origin. */ - if ( ( face->header.Flags & 2 ) == 0 && loader.pp1.x ) - FT_Outline_Translate( &glyph->outline, -loader.pp1.x, 0 ); - } - - compute_glyph_metrics( &loader, glyph_index ); - } - - /* Set the `high precision' bit flag. */ - /* This is _critical_ to get correct output for monochrome */ - /* TrueType glyphs at all sizes using the bytecode interpreter. */ - /* */ - if ( !( load_flags & FT_LOAD_NO_SCALE ) && - size->root.metrics.y_ppem < 24 ) - glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; - - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* ttgload.c */ +/* */ +/* TrueType Glyph Loader (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_TRUETYPE_TAGS_H +#include FT_OUTLINE_H + +#include "ttgload.h" +#include "ttpload.h" + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#include "ttgxvar.h" +#endif + +#include "tterrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttgload + + + /*************************************************************************/ + /* */ + /* Composite font flags. */ + /* */ +#define ARGS_ARE_WORDS 0x0001 +#define ARGS_ARE_XY_VALUES 0x0002 +#define ROUND_XY_TO_GRID 0x0004 +#define WE_HAVE_A_SCALE 0x0008 +/* reserved 0x0010 */ +#define MORE_COMPONENTS 0x0020 +#define WE_HAVE_AN_XY_SCALE 0x0040 +#define WE_HAVE_A_2X2 0x0080 +#define WE_HAVE_INSTR 0x0100 +#define USE_MY_METRICS 0x0200 +#define OVERLAP_COMPOUND 0x0400 +#define SCALED_COMPONENT_OFFSET 0x0800 +#define UNSCALED_COMPONENT_OFFSET 0x1000 + + + /*************************************************************************/ + /* */ + /* Returns the horizontal metrics in font units for a given glyph. If */ + /* `check' is true, take care of monospaced fonts by returning the */ + /* advance width maximum. */ + /* */ + static void + Get_HMetrics( TT_Face face, + FT_UInt idx, + FT_Bool check, + FT_Short* lsb, + FT_UShort* aw ) + { + ( (SFNT_Service)face->sfnt )->get_metrics( face, 0, idx, lsb, aw ); + + if ( check && face->postscript.isFixedPitch ) + *aw = face->horizontal.advance_Width_Max; + } + + + /*************************************************************************/ + /* */ + /* Returns the vertical metrics in font units for a given glyph. */ + /* Greg Hitchcock from Microsoft told us that if there were no `vmtx' */ + /* table, typoAscender/Descender from the `OS/2' table would be used */ + /* instead, and if there were no `OS/2' table, use ascender/descender */ + /* from the `hhea' table. But that is not what Microsoft's rasterizer */ + /* apparently does: It uses the ppem value as the advance height, and */ + /* sets the top side bearing to be zero. */ + /* */ + /* The monospace `check' is probably not meaningful here, but we leave */ + /* it in for a consistent interface. */ + /* */ + static void + Get_VMetrics( TT_Face face, + FT_UInt idx, + FT_Bool check, + FT_Short* tsb, + FT_UShort* ah ) + { + FT_UNUSED( check ); + + if ( face->vertical_info ) + ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, idx, tsb, ah ); + +#if 1 /* Empirically determined, at variance with what MS said */ + + else + { + *tsb = 0; + *ah = face->root.units_per_EM; + } + +#else /* This is what MS said to do. It isn't what they do, however. */ + + else if ( face->os2.version != 0xFFFFU ) + { + *tsb = face->os2.sTypoAscender; + *ah = face->os2.sTypoAscender - face->os2.sTypoDescender; + } + else + { + *tsb = face->horizontal.Ascender; + *ah = face->horizontal.Ascender - face->horizontal.Descender; + } + +#endif + + } + + + /*************************************************************************/ + /* */ + /* Translates an array of coordinates. */ + /* */ + static void + translate_array( FT_UInt n, + FT_Vector* coords, + FT_Pos delta_x, + FT_Pos delta_y ) + { + FT_UInt k; + + + if ( delta_x ) + for ( k = 0; k < n; k++ ) + coords[k].x += delta_x; + + if ( delta_y ) + for ( k = 0; k < n; k++ ) + coords[k].y += delta_y; + } + + +#undef IS_HINTED +#define IS_HINTED( flags ) ( ( flags & FT_LOAD_NO_HINTING ) == 0 ) + + + /*************************************************************************/ + /* */ + /* The following functions are used by default with TrueType fonts. */ + /* However, they can be replaced by alternatives if we need to support */ + /* TrueType-compressed formats (like MicroType) in the future. */ + /* */ + /*************************************************************************/ + + FT_CALLBACK_DEF( FT_Error ) + TT_Access_Glyph_Frame( TT_Loader loader, + FT_UInt glyph_index, + FT_ULong offset, + FT_UInt byte_count ) + { + FT_Error error; + FT_Stream stream = loader->stream; + + /* for non-debug mode */ + FT_UNUSED( glyph_index ); + + + FT_TRACE5(( "Glyph %ld\n", glyph_index )); + + /* the following line sets the `error' variable through macros! */ + if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( byte_count ) ) + return error; + + loader->cursor = stream->cursor; + loader->limit = stream->limit; + + return TT_Err_Ok; + } + + + FT_CALLBACK_DEF( void ) + TT_Forget_Glyph_Frame( TT_Loader loader ) + { + FT_Stream stream = loader->stream; + + + FT_FRAME_EXIT(); + } + + + FT_CALLBACK_DEF( FT_Error ) + TT_Load_Glyph_Header( TT_Loader loader ) + { + FT_Byte* p = loader->cursor; + FT_Byte* limit = loader->limit; + + + if ( p + 10 > limit ) + return TT_Err_Invalid_Outline; + + loader->n_contours = FT_NEXT_SHORT( p ); + + loader->bbox.xMin = FT_NEXT_SHORT( p ); + loader->bbox.yMin = FT_NEXT_SHORT( p ); + loader->bbox.xMax = FT_NEXT_SHORT( p ); + loader->bbox.yMax = FT_NEXT_SHORT( p ); + + FT_TRACE5(( " # of contours: %d\n", loader->n_contours )); + FT_TRACE5(( " xMin: %4d xMax: %4d\n", loader->bbox.xMin, + loader->bbox.xMax )); + FT_TRACE5(( " yMin: %4d yMax: %4d\n", loader->bbox.yMin, + loader->bbox.yMax )); + loader->cursor = p; + + return TT_Err_Ok; + } + + + FT_CALLBACK_DEF( FT_Error ) + TT_Load_Simple_Glyph( TT_Loader load ) + { + FT_Error error; + FT_Byte* p = load->cursor; + FT_Byte* limit = load->limit; + FT_GlyphLoader gloader = load->gloader; + FT_Int n_contours = load->n_contours; + FT_Outline* outline; + TT_Face face = (TT_Face)load->face; + FT_UShort n_ins; + FT_Int n_points; + + FT_Byte *flag, *flag_limit; + FT_Byte c, count; + FT_Vector *vec, *vec_limit; + FT_Pos x; + FT_Short *cont, *cont_limit, prev_cont; + FT_Int xy_size = 0; + + + /* check that we can add the contours to the glyph */ + error = FT_GLYPHLOADER_CHECK_POINTS( gloader, 0, n_contours ); + if ( error ) + goto Fail; + + /* reading the contours' endpoints & number of points */ + cont = gloader->current.outline.contours; + cont_limit = cont + n_contours; + + /* check space for contours array + instructions count */ + if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit ) + goto Invalid_Outline; + + cont[0] = prev_cont = FT_NEXT_USHORT( p ); + for ( cont++; cont < cont_limit; cont++ ) + { + cont[0] = FT_NEXT_USHORT( p ); + if ( cont[0] <= prev_cont ) + { + /* unordered contours: this is invalid */ + error = FT_Err_Invalid_Table; + goto Fail; + } + prev_cont = cont[0]; + } + + n_points = 0; + if ( n_contours > 0 ) + { + n_points = cont[-1] + 1; + if ( n_points < 0 ) + goto Invalid_Outline; + } + + /* note that we will add four phantom points later */ + error = FT_GLYPHLOADER_CHECK_POINTS( gloader, n_points + 4, 0 ); + if ( error ) + goto Fail; + + /* we'd better check the contours table right now */ + outline = &gloader->current.outline; + + for ( cont = outline->contours + 1; cont < cont_limit; cont++ ) + if ( cont[-1] >= cont[0] ) + goto Invalid_Outline; + + /* reading the bytecode instructions */ + load->glyph->control_len = 0; + load->glyph->control_data = 0; + + if ( p + 2 > limit ) + goto Invalid_Outline; + + n_ins = FT_NEXT_USHORT( p ); + + FT_TRACE5(( " Instructions size: %u\n", n_ins )); + + if ( n_ins > face->max_profile.maxSizeOfInstructions ) + { + FT_TRACE0(( "TT_Load_Simple_Glyph: Too many instructions (%d)\n", + n_ins )); + error = TT_Err_Too_Many_Hints; + goto Fail; + } + + if ( ( limit - p ) < n_ins ) + { + FT_TRACE0(( "TT_Load_Simple_Glyph: Instruction count mismatch!\n" )); + error = TT_Err_Too_Many_Hints; + goto Fail; + } + +#ifdef TT_USE_BYTECODE_INTERPRETER + + if ( IS_HINTED( load->load_flags ) ) + { + load->glyph->control_len = n_ins; + load->glyph->control_data = load->exec->glyphIns; + + FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins ); + } + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + p += n_ins; + + /* reading the point tags */ + flag = (FT_Byte*)outline->tags; + flag_limit = flag + n_points; + + FT_ASSERT( flag != NULL ); + + while ( flag < flag_limit ) + { + if ( p + 1 > limit ) + goto Invalid_Outline; + + *flag++ = c = FT_NEXT_BYTE( p ); + if ( c & 8 ) + { + if ( p + 1 > limit ) + goto Invalid_Outline; + + count = FT_NEXT_BYTE( p ); + if ( flag + (FT_Int)count > flag_limit ) + goto Invalid_Outline; + + for ( ; count > 0; count-- ) + *flag++ = c; + } + } + + /* reading the X coordinates */ + + vec = outline->points; + vec_limit = vec + n_points; + flag = (FT_Byte*)outline->tags; + x = 0; + + if ( p + xy_size > limit ) + goto Invalid_Outline; + + for ( ; vec < vec_limit; vec++, flag++ ) + { + FT_Pos y = 0; + FT_Byte f = *flag; + + + if ( f & 2 ) + { + if ( p + 1 > limit ) + goto Invalid_Outline; + + y = (FT_Pos)FT_NEXT_BYTE( p ); + if ( ( f & 16 ) == 0 ) + y = -y; + } + else if ( ( f & 16 ) == 0 ) + { + if ( p + 2 > limit ) + goto Invalid_Outline; + + y = (FT_Pos)FT_NEXT_SHORT( p ); + } + + x += y; + vec->x = x; + *flag = f & ~( 2 | 16 ); + } + + /* reading the Y coordinates */ + + vec = gloader->current.outline.points; + vec_limit = vec + n_points; + flag = (FT_Byte*)outline->tags; + x = 0; + + for ( ; vec < vec_limit; vec++, flag++ ) + { + FT_Pos y = 0; + FT_Byte f = *flag; + + + if ( f & 4 ) + { + if ( p + 1 > limit ) + goto Invalid_Outline; + + y = (FT_Pos)FT_NEXT_BYTE( p ); + if ( ( f & 32 ) == 0 ) + y = -y; + } + else if ( ( f & 32 ) == 0 ) + { + if ( p + 2 > limit ) + goto Invalid_Outline; + + y = (FT_Pos)FT_NEXT_SHORT( p ); + } + + x += y; + vec->y = x; + *flag = f & FT_CURVE_TAG_ON; + } + + outline->n_points = (FT_UShort)n_points; + outline->n_contours = (FT_Short) n_contours; + + load->cursor = p; + + Fail: + return error; + + Invalid_Outline: + error = TT_Err_Invalid_Outline; + goto Fail; + } + + + FT_CALLBACK_DEF( FT_Error ) + TT_Load_Composite_Glyph( TT_Loader loader ) + { + FT_Error error; + FT_Byte* p = loader->cursor; + FT_Byte* limit = loader->limit; + FT_GlyphLoader gloader = loader->gloader; + FT_SubGlyph subglyph; + FT_UInt num_subglyphs; + + + num_subglyphs = 0; + + do + { + FT_Fixed xx, xy, yy, yx; + FT_UInt count; + + + /* check that we can load a new subglyph */ + error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs + 1 ); + if ( error ) + goto Fail; + + /* check space */ + if ( p + 4 > limit ) + goto Invalid_Composite; + + subglyph = gloader->current.subglyphs + num_subglyphs; + + subglyph->arg1 = subglyph->arg2 = 0; + + subglyph->flags = FT_NEXT_USHORT( p ); + subglyph->index = FT_NEXT_USHORT( p ); + + /* check space */ + count = 2; + if ( subglyph->flags & ARGS_ARE_WORDS ) + count += 2; + if ( subglyph->flags & WE_HAVE_A_SCALE ) + count += 2; + else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE ) + count += 4; + else if ( subglyph->flags & WE_HAVE_A_2X2 ) + count += 8; + + if ( p + count > limit ) + goto Invalid_Composite; + + /* read arguments */ + if ( subglyph->flags & ARGS_ARE_WORDS ) + { + subglyph->arg1 = FT_NEXT_SHORT( p ); + subglyph->arg2 = FT_NEXT_SHORT( p ); + } + else + { + subglyph->arg1 = FT_NEXT_CHAR( p ); + subglyph->arg2 = FT_NEXT_CHAR( p ); + } + + /* read transform */ + xx = yy = 0x10000L; + xy = yx = 0; + + if ( subglyph->flags & WE_HAVE_A_SCALE ) + { + xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; + yy = xx; + } + else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE ) + { + xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; + yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; + } + else if ( subglyph->flags & WE_HAVE_A_2X2 ) + { + xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; + yx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; + xy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; + yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2; + } + + subglyph->transform.xx = xx; + subglyph->transform.xy = xy; + subglyph->transform.yx = yx; + subglyph->transform.yy = yy; + + num_subglyphs++; + + } while ( subglyph->flags & MORE_COMPONENTS ); + + gloader->current.num_subglyphs = num_subglyphs; + +#ifdef TT_USE_BYTECODE_INTERPRETER + + { + FT_Stream stream = loader->stream; + + + /* we must undo the FT_FRAME_ENTER in order to point to the */ + /* composite instructions, if we find some. */ + /* we will process them later... */ + /* */ + loader->ins_pos = (FT_ULong)( FT_STREAM_POS() + + p - limit ); + } + +#endif + + loader->cursor = p; + + Fail: + return error; + + Invalid_Composite: + error = TT_Err_Invalid_Composite; + goto Fail; + } + + + FT_LOCAL_DEF( void ) + TT_Init_Glyph_Loading( TT_Face face ) + { + face->access_glyph_frame = TT_Access_Glyph_Frame; + face->read_glyph_header = TT_Load_Glyph_Header; + face->read_simple_glyph = TT_Load_Simple_Glyph; + face->read_composite_glyph = TT_Load_Composite_Glyph; + face->forget_glyph_frame = TT_Forget_Glyph_Frame; + } + + + static void + tt_prepare_zone( TT_GlyphZone zone, + FT_GlyphLoad load, + FT_UInt start_point, + FT_UInt start_contour ) + { + zone->n_points = (FT_UShort)( load->outline.n_points - start_point ); + zone->n_contours = (FT_Short) ( load->outline.n_contours - + start_contour ); + zone->org = load->extra_points + start_point; + zone->cur = load->outline.points + start_point; + zone->orus = load->extra_points2 + start_point; + zone->tags = (FT_Byte*)load->outline.tags + start_point; + zone->contours = (FT_UShort*)load->outline.contours + start_contour; + zone->first_point = (FT_UShort)start_point; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Hint_Glyph */ + /* */ + /* */ + /* Hint the glyph using the zone prepared by the caller. Note that */ + /* the zone is supposed to include four phantom points. */ + /* */ + static FT_Error + TT_Hint_Glyph( TT_Loader loader, + FT_Bool is_composite ) + { + TT_GlyphZone zone = &loader->zone; + FT_Pos origin; + +#ifdef TT_USE_BYTECODE_INTERPRETER + FT_UInt n_ins; +#else + FT_UNUSED( is_composite ); +#endif + + +#ifdef TT_USE_BYTECODE_INTERPRETER + n_ins = loader->glyph->control_len; +#endif + + origin = zone->cur[zone->n_points - 4].x; + origin = FT_PIX_ROUND( origin ) - origin; + if ( origin ) + translate_array( zone->n_points, zone->cur, origin, 0 ); + +#ifdef TT_USE_BYTECODE_INTERPRETER + /* save original point position in org */ + if ( n_ins > 0 ) + FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points ); +#endif + + /* round pp2 and pp4 */ + zone->cur[zone->n_points - 3].x = + FT_PIX_ROUND( zone->cur[zone->n_points - 3].x ); + zone->cur[zone->n_points - 1].y = + FT_PIX_ROUND( zone->cur[zone->n_points - 1].y ); + +#ifdef TT_USE_BYTECODE_INTERPRETER + + if ( n_ins > 0 ) + { + FT_Bool debug; + FT_Error error; + + + error = TT_Set_CodeRange( loader->exec, tt_coderange_glyph, + loader->exec->glyphIns, n_ins ); + if ( error ) + return error; + + loader->exec->is_composite = is_composite; + loader->exec->pts = *zone; + + debug = FT_BOOL( !( loader->load_flags & FT_LOAD_NO_SCALE ) && + ((TT_Size)loader->size)->debug ); + + error = TT_Run_Context( loader->exec, debug ); + if ( error && loader->exec->pedantic_hinting ) + return error; + } + +#endif + + /* save glyph phantom points */ + if ( !loader->preserve_pps ) + { + loader->pp1 = zone->cur[zone->n_points - 4]; + loader->pp2 = zone->cur[zone->n_points - 3]; + loader->pp3 = zone->cur[zone->n_points - 2]; + loader->pp4 = zone->cur[zone->n_points - 1]; + } + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Process_Simple_Glyph */ + /* */ + /* */ + /* Once a simple glyph has been loaded, it needs to be processed. */ + /* Usually, this means scaling and hinting through bytecode */ + /* interpretation. */ + /* */ + static FT_Error + TT_Process_Simple_Glyph( TT_Loader loader ) + { + FT_GlyphLoader gloader = loader->gloader; + FT_Error error = TT_Err_Ok; + FT_Outline* outline; + FT_UInt n_points; + + + outline = &gloader->current.outline; + n_points = outline->n_points; + + /* set phantom points */ + + outline->points[n_points ] = loader->pp1; + outline->points[n_points + 1] = loader->pp2; + outline->points[n_points + 2] = loader->pp3; + outline->points[n_points + 3] = loader->pp4; + + outline->tags[n_points ] = 0; + outline->tags[n_points + 1] = 0; + outline->tags[n_points + 2] = 0; + outline->tags[n_points + 3] = 0; + + n_points += 4; + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + + if ( ((TT_Face)loader->face)->doblend ) + { + /* Deltas apply to the unscaled data. */ + FT_Vector* deltas; + FT_Memory memory = loader->face->memory; + FT_UInt i; + + + error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face), + loader->glyph_index, + &deltas, + n_points ); + if ( error ) + return error; + + for ( i = 0; i < n_points; ++i ) + { + outline->points[i].x += deltas[i].x; + outline->points[i].y += deltas[i].y; + } + + FT_FREE( deltas ); + } + +#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ + + if ( IS_HINTED( loader->load_flags ) ) + { + tt_prepare_zone( &loader->zone, &gloader->current, 0, 0 ); + + FT_ARRAY_COPY( loader->zone.orus, loader->zone.cur, + loader->zone.n_points + 4 ); + } + + /* scale the glyph */ + if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) + { + FT_Vector* vec = outline->points; + FT_Vector* limit = outline->points + n_points; + FT_Fixed x_scale = ((TT_Size)loader->size)->metrics.x_scale; + FT_Fixed y_scale = ((TT_Size)loader->size)->metrics.y_scale; + + + for ( ; vec < limit; vec++ ) + { + vec->x = FT_MulFix( vec->x, x_scale ); + vec->y = FT_MulFix( vec->y, y_scale ); + } + + loader->pp1 = outline->points[n_points - 4]; + loader->pp2 = outline->points[n_points - 3]; + loader->pp3 = outline->points[n_points - 2]; + loader->pp4 = outline->points[n_points - 1]; + } + + if ( IS_HINTED( loader->load_flags ) ) + { + loader->zone.n_points += 4; + + error = TT_Hint_Glyph( loader, 0 ); + } + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Process_Composite_Component */ + /* */ + /* */ + /* Once a composite component has been loaded, it needs to be */ + /* processed. Usually, this means transforming and translating. */ + /* */ + static FT_Error + TT_Process_Composite_Component( TT_Loader loader, + FT_SubGlyph subglyph, + FT_UInt start_point, + FT_UInt num_base_points ) + { + FT_GlyphLoader gloader = loader->gloader; + FT_Vector* base_vec = gloader->base.outline.points; + FT_UInt num_points = gloader->base.outline.n_points; + FT_Bool have_scale; + FT_Pos x, y; + + + have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE | + WE_HAVE_AN_XY_SCALE | + WE_HAVE_A_2X2 ) ); + + /* perform the transform required for this subglyph */ + if ( have_scale ) + { + FT_UInt i; + + + for ( i = num_base_points; i < num_points; i++ ) + FT_Vector_Transform( base_vec + i, &subglyph->transform ); + } + + /* get offset */ + if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) ) + { + FT_UInt k = subglyph->arg1; + FT_UInt l = subglyph->arg2; + FT_Vector* p1; + FT_Vector* p2; + + + /* match l-th point of the newly loaded component to the k-th point */ + /* of the previously loaded components. */ + + /* change to the point numbers used by our outline */ + k += start_point; + l += num_base_points; + if ( k >= num_base_points || + l >= num_points ) + return TT_Err_Invalid_Composite; + + p1 = gloader->base.outline.points + k; + p2 = gloader->base.outline.points + l; + + x = p1->x - p2->x; + y = p1->y - p2->y; + } + else + { + x = subglyph->arg1; + y = subglyph->arg2; + + if ( !x && !y ) + return TT_Err_Ok; + + /* Use a default value dependent on */ + /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED. This is useful for old TT */ + /* fonts which don't set the xxx_COMPONENT_OFFSET bit. */ + + if ( have_scale && +#ifdef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED + !( subglyph->flags & UNSCALED_COMPONENT_OFFSET ) ) +#else + ( subglyph->flags & SCALED_COMPONENT_OFFSET ) ) +#endif + { + +#if 0 + + /*************************************************************************/ + /* */ + /* This algorithm is what Apple documents. But it doesn't work. */ + /* */ + int a = subglyph->transform.xx > 0 ? subglyph->transform.xx + : -subglyph->transform.xx; + int b = subglyph->transform.yx > 0 ? subglyph->transform.yx + : -subglyph->transform.yx; + int c = subglyph->transform.xy > 0 ? subglyph->transform.xy + : -subglyph->transform.xy; + int d = subglyph->transform.yy > 0 ? subglyph->transform.yy + : -subglyph->transform.yy; + int m = a > b ? a : b; + int n = c > d ? c : d; + + + if ( a - b <= 33 && a - b >= -33 ) + m *= 2; + if ( c - d <= 33 && c - d >= -33 ) + n *= 2; + x = FT_MulFix( x, m ); + y = FT_MulFix( y, n ); + +#else /* 0 */ + + /*************************************************************************/ + /* */ + /* This algorithm is a guess and works much better than the above. */ + /* */ + FT_Fixed mac_xscale = FT_SqrtFixed( + FT_MulFix( subglyph->transform.xx, + subglyph->transform.xx ) + + FT_MulFix( subglyph->transform.xy, + subglyph->transform.xy ) ); + FT_Fixed mac_yscale = FT_SqrtFixed( + FT_MulFix( subglyph->transform.yy, + subglyph->transform.yy ) + + FT_MulFix( subglyph->transform.yx, + subglyph->transform.yx ) ); + + + x = FT_MulFix( x, mac_xscale ); + y = FT_MulFix( y, mac_yscale ); + +#endif /* 0 */ + + } + + if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) ) + { + FT_Fixed x_scale = ((TT_Size)loader->size)->metrics.x_scale; + FT_Fixed y_scale = ((TT_Size)loader->size)->metrics.y_scale; + + + x = FT_MulFix( x, x_scale ); + y = FT_MulFix( y, y_scale ); + + if ( subglyph->flags & ROUND_XY_TO_GRID ) + { + x = FT_PIX_ROUND( x ); + y = FT_PIX_ROUND( y ); + } + } + } + + if ( x || y ) + translate_array( num_points - num_base_points, + base_vec + num_base_points, + x, y ); + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Process_Composite_Glyph */ + /* */ + /* */ + /* This is slightly different from TT_Process_Simple_Glyph, in that */ + /* its sole purpose is to hint the glyph. Thus this function is */ + /* only available when bytecode interpreter is enabled. */ + /* */ + static FT_Error + TT_Process_Composite_Glyph( TT_Loader loader, + FT_UInt start_point, + FT_UInt start_contour ) + { + FT_Error error; + FT_Outline* outline; + FT_UInt i; + + + outline = &loader->gloader->base.outline; + + /* make room for phantom points */ + error = FT_GLYPHLOADER_CHECK_POINTS( loader->gloader, + outline->n_points + 4, + 0 ); + if ( error ) + return error; + + outline->points[outline->n_points ] = loader->pp1; + outline->points[outline->n_points + 1] = loader->pp2; + outline->points[outline->n_points + 2] = loader->pp3; + outline->points[outline->n_points + 3] = loader->pp4; + + outline->tags[outline->n_points ] = 0; + outline->tags[outline->n_points + 1] = 0; + outline->tags[outline->n_points + 2] = 0; + outline->tags[outline->n_points + 3] = 0; + +#ifdef TT_USE_BYTECODE_INTERPRETER + + { + FT_Stream stream = loader->stream; + FT_UShort n_ins; + + + /* TT_Load_Composite_Glyph only gives us the offset of instructions */ + /* so we read them here */ + if ( FT_STREAM_SEEK( loader->ins_pos ) || + FT_READ_USHORT( n_ins ) ) + return error; + + FT_TRACE5(( " Instructions size = %d\n", n_ins )); + + /* check it */ + if ( n_ins > ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions ) + { + FT_TRACE0(( "TT_Process_Composite_Glyph: Too many instructions (%d)\n", + n_ins )); + + return TT_Err_Too_Many_Hints; + } + else if ( n_ins == 0 ) + return TT_Err_Ok; + + if ( FT_STREAM_READ( loader->exec->glyphIns, n_ins ) ) + return error; + + loader->glyph->control_data = loader->exec->glyphIns; + loader->glyph->control_len = n_ins; + } + +#endif + + tt_prepare_zone( &loader->zone, &loader->gloader->base, + start_point, start_contour ); + + /* Some points are likely touched during execution of */ + /* instructions on components. So let's untouch them. */ + for ( i = start_point; i < loader->zone.n_points; i++ ) + loader->zone.tags[i] &= ~( FT_CURVE_TAG_TOUCH_X | + FT_CURVE_TAG_TOUCH_Y ); + + loader->zone.n_points += 4; + + return TT_Hint_Glyph( loader, 1 ); + } + + + /* Calculate the four phantom points. */ + /* The first two stand for horizontal origin and advance. */ + /* The last two stand for vertical origin and advance. */ +#define TT_LOADER_SET_PP( loader ) \ + do { \ + (loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \ + (loader)->pp1.y = 0; \ + (loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \ + (loader)->pp2.y = 0; \ + (loader)->pp3.x = 0; \ + (loader)->pp3.y = (loader)->top_bearing + (loader)->bbox.yMax; \ + (loader)->pp4.x = 0; \ + (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance; \ + } while ( 0 ) + + + /*************************************************************************/ + /* */ + /* */ + /* load_truetype_glyph */ + /* */ + /* */ + /* Loads a given truetype glyph. Handles composites and uses a */ + /* TT_Loader object. */ + /* */ + static FT_Error + load_truetype_glyph( TT_Loader loader, + FT_UInt glyph_index, + FT_UInt recurse_count ) + { + FT_Error error; + FT_Fixed x_scale, y_scale; + FT_ULong offset; + TT_Face face = (TT_Face)loader->face; + FT_GlyphLoader gloader = loader->gloader; + FT_Bool opened_frame = 0; + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + FT_Vector* deltas = NULL; +#endif + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + FT_StreamRec inc_stream; + FT_Data glyph_data; + FT_Bool glyph_data_loaded = 0; +#endif + + + if ( recurse_count > face->max_profile.maxComponentDepth ) + { + error = TT_Err_Invalid_Composite; + goto Exit; + } + + /* check glyph index */ + if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) + { + error = TT_Err_Invalid_Glyph_Index; + goto Exit; + } + + loader->glyph_index = glyph_index; + + if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) + { + x_scale = ((TT_Size)loader->size)->metrics.x_scale; + y_scale = ((TT_Size)loader->size)->metrics.y_scale; + } + else + { + x_scale = 0x10000L; + y_scale = 0x10000L; + } + + /* get metrics, horizontal and vertical */ + { + FT_Short left_bearing = 0, top_bearing = 0; + FT_UShort advance_width = 0, advance_height = 0; + + + Get_HMetrics( face, glyph_index, + (FT_Bool)!( loader->load_flags & + FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), + &left_bearing, + &advance_width ); + Get_VMetrics( face, glyph_index, + (FT_Bool)!( loader->load_flags & + FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), + &top_bearing, + &advance_height ); + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* If this is an incrementally loaded font see if there are */ + /* overriding metrics for this glyph. */ + if ( face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + + + metrics.bearing_x = left_bearing; + metrics.bearing_y = 0; + metrics.advance = advance_width; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, FALSE, &metrics ); + if ( error ) + goto Exit; + left_bearing = (FT_Short)metrics.bearing_x; + advance_width = (FT_UShort)metrics.advance; + +#if 0 + + /* GWW: Do I do the same for vertical metrics? */ + metrics.bearing_x = 0; + metrics.bearing_y = top_bearing; + metrics.advance = advance_height; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, TRUE, &metrics ); + if ( error ) + goto Exit; + top_bearing = (FT_Short)metrics.bearing_y; + advance_height = (FT_UShort)metrics.advance; + +#endif /* 0 */ + + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + loader->left_bearing = left_bearing; + loader->advance = advance_width; + loader->top_bearing = top_bearing; + loader->vadvance = advance_height; + + if ( !loader->linear_def ) + { + loader->linear_def = 1; + loader->linear = advance_width; + } + } + + /* Set `offset' to the start of the glyph relative to the start of */ + /* the `glyf' table, and `byte_len' to the length of the glyph in */ + /* bytes. */ + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* If we are loading glyph data via the incremental interface, set */ + /* the loader stream to a memory stream reading the data returned */ + /* by the interface. */ + if ( face->root.internal->incremental_interface ) + { + error = face->root.internal->incremental_interface->funcs->get_glyph_data( + face->root.internal->incremental_interface->object, + glyph_index, &glyph_data ); + if ( error ) + goto Exit; + + glyph_data_loaded = 1; + offset = 0; + loader->byte_len = glyph_data.length; + + FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) ); + FT_Stream_OpenMemory( &inc_stream, + glyph_data.pointer, glyph_data.length ); + + loader->stream = &inc_stream; + } + else + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + offset = tt_face_get_location( face, glyph_index, + (FT_UInt*)&loader->byte_len ); + + if ( loader->byte_len == 0 ) + { + /* as described by Frederic Loyer, these are spaces or */ + /* the unknown glyph. */ + loader->bbox.xMin = 0; + loader->bbox.xMax = 0; + loader->bbox.yMin = 0; + loader->bbox.yMax = 0; + + TT_LOADER_SET_PP( loader ); + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + + if ( ((TT_Face)(loader->face))->doblend ) + { + /* this must be done before scaling */ + FT_Memory memory = loader->face->memory; + + + error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face), + glyph_index, &deltas, 4 ); + if ( error ) + goto Exit; + + loader->pp1.x += deltas[0].x; loader->pp1.y += deltas[0].y; + loader->pp2.x += deltas[1].x; loader->pp2.y += deltas[1].y; + loader->pp3.x += deltas[2].x; loader->pp3.y += deltas[2].y; + loader->pp4.x += deltas[3].x; loader->pp4.y += deltas[3].y; + + FT_FREE( deltas ); + } + +#endif + + if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) + { + loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale ); + loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale ); + loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale ); + loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale ); + } + + error = TT_Err_Ok; + goto Exit; + } + + error = face->access_glyph_frame( loader, glyph_index, + loader->glyf_offset + offset, + loader->byte_len ); + if ( error ) + goto Exit; + + opened_frame = 1; + + /* read first glyph header */ + error = face->read_glyph_header( loader ); + if ( error ) + goto Exit; + + TT_LOADER_SET_PP( loader ); + + /***********************************************************************/ + /***********************************************************************/ + /***********************************************************************/ + + /* if it is a simple glyph, load it */ + + if ( loader->n_contours >= 0 ) + { + error = face->read_simple_glyph( loader ); + if ( error ) + goto Exit; + + /* all data have been read */ + face->forget_glyph_frame( loader ); + opened_frame = 0; + + error = TT_Process_Simple_Glyph( loader ); + if ( error ) + goto Exit; + + FT_GlyphLoader_Add( gloader ); + } + + /***********************************************************************/ + /***********************************************************************/ + /***********************************************************************/ + + /* otherwise, load a composite! */ + else if ( loader->n_contours == -1 ) + { + FT_UInt start_point; + FT_UInt start_contour; + FT_ULong ins_pos; /* position of composite instructions, if any */ + + + start_point = gloader->base.outline.n_points; + start_contour = gloader->base.outline.n_contours; + + /* for each subglyph, read composite header */ + error = face->read_composite_glyph( loader ); + if ( error ) + goto Exit; + + /* store the offset of instructions */ + ins_pos = loader->ins_pos; + + /* all data we need are read */ + face->forget_glyph_frame( loader ); + opened_frame = 0; + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + + if ( face->doblend ) + { + FT_Int i, limit; + FT_SubGlyph subglyph; + FT_Memory memory = face->root.memory; + + + /* this provides additional offsets */ + /* for each component's translation */ + + if ( ( error = TT_Vary_Get_Glyph_Deltas( + face, + glyph_index, + &deltas, + gloader->current.num_subglyphs + 4 )) != 0 ) + goto Exit; + + subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs; + limit = gloader->current.num_subglyphs; + + for ( i = 0; i < limit; ++i, ++subglyph ) + { + if ( subglyph->flags & ARGS_ARE_XY_VALUES ) + { + subglyph->arg1 += deltas[i].x; + subglyph->arg2 += deltas[i].y; + } + } + + loader->pp1.x += deltas[i + 0].x; loader->pp1.y += deltas[i + 0].y; + loader->pp2.x += deltas[i + 1].x; loader->pp2.y += deltas[i + 1].y; + loader->pp3.x += deltas[i + 2].x; loader->pp3.y += deltas[i + 2].y; + loader->pp4.x += deltas[i + 3].x; loader->pp4.y += deltas[i + 3].y; + + FT_FREE( deltas ); + } + +#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ + + if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) + { + loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale ); + loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale ); + loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale ); + loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale ); + } + + /* if the flag FT_LOAD_NO_RECURSE is set, we return the subglyph */ + /* `as is' in the glyph slot (the client application will be */ + /* responsible for interpreting these data)... */ + if ( loader->load_flags & FT_LOAD_NO_RECURSE ) + { + FT_GlyphLoader_Add( gloader ); + loader->glyph->format = FT_GLYPH_FORMAT_COMPOSITE; + + goto Exit; + } + + /*********************************************************************/ + /*********************************************************************/ + /*********************************************************************/ + + { + FT_UInt n, num_base_points; + FT_SubGlyph subglyph = 0; + + FT_UInt num_points = start_point; + FT_UInt num_subglyphs = gloader->current.num_subglyphs; + FT_UInt num_base_subgs = gloader->base.num_subglyphs; + + FT_Stream old_stream = loader->stream; + + TT_GraphicsState saved_GS; + + + if ( loader->exec ) + saved_GS = loader->exec->GS; + + FT_GlyphLoader_Add( gloader ); + + /* read each subglyph independently */ + for ( n = 0; n < num_subglyphs; n++ ) + { + FT_Vector pp[4]; + + + /* reinitialize graphics state */ + if ( loader->exec ) + loader->exec->GS = saved_GS; + + /* Each time we call load_truetype_glyph in this loop, the */ + /* value of `gloader.base.subglyphs' can change due to table */ + /* reallocations. We thus need to recompute the subglyph */ + /* pointer on each iteration. */ + subglyph = gloader->base.subglyphs + num_base_subgs + n; + + pp[0] = loader->pp1; + pp[1] = loader->pp2; + pp[2] = loader->pp3; + pp[3] = loader->pp4; + + num_base_points = gloader->base.outline.n_points; + + error = load_truetype_glyph( loader, subglyph->index, + recurse_count + 1 ); + if ( error ) + goto Exit; + + /* restore subglyph pointer */ + subglyph = gloader->base.subglyphs + num_base_subgs + n; + + if ( !( subglyph->flags & USE_MY_METRICS ) ) + { + loader->pp1 = pp[0]; + loader->pp2 = pp[1]; + loader->pp3 = pp[2]; + loader->pp4 = pp[3]; + } + + num_points = gloader->base.outline.n_points; + + if ( num_points == num_base_points ) + continue; + + /* gloader->base.outline consists of three parts: */ + /* 0 -(1)-> start_point -(2)-> num_base_points -(3)-> n_points. */ + /* */ + /* (1): exists from the beginning */ + /* (2): components that have been loaded so far */ + /* (3): the newly loaded component */ + TT_Process_Composite_Component( loader, subglyph, start_point, + num_base_points ); + } + + loader->stream = old_stream; + + /* process the glyph */ + loader->ins_pos = ins_pos; + if ( IS_HINTED( loader->load_flags ) && + +#ifdef TT_USE_BYTECODE_INTERPRETER + + subglyph->flags & WE_HAVE_INSTR && + +#endif + + num_points > start_point ) + TT_Process_Composite_Glyph( loader, start_point, start_contour ); + + } + } + else + { + /* invalid composite count (negative but not -1) */ + error = TT_Err_Invalid_Outline; + goto Exit; + } + + /***********************************************************************/ + /***********************************************************************/ + /***********************************************************************/ + + Exit: + + if ( opened_frame ) + face->forget_glyph_frame( loader ); + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + if ( glyph_data_loaded ) + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); + +#endif + + return error; + } + + + static FT_Error + compute_glyph_metrics( TT_Loader loader, + FT_UInt glyph_index ) + { + FT_BBox bbox; + TT_Face face = (TT_Face)loader->face; + FT_Fixed y_scale; + TT_GlyphSlot glyph = loader->glyph; + TT_Size size = (TT_Size)loader->size; + + + y_scale = 0x10000L; + if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) + y_scale = size->root.metrics.y_scale; + + if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE ) + FT_Outline_Get_CBox( &glyph->outline, &bbox ); + else + bbox = loader->bbox; + + /* get the device-independent horizontal advance; it is scaled later */ + /* by the base layer. */ + { + FT_Pos advance = loader->linear; + + + /* the flag FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH was introduced to */ + /* correctly support DynaLab fonts, which have an incorrect */ + /* `advance_Width_Max' field! It is used, to my knowledge, */ + /* exclusively in the X-TrueType font server. */ + /* */ + if ( face->postscript.isFixedPitch && + ( loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) == 0 ) + advance = face->horizontal.advance_Width_Max; + + /* we need to return the advance in font units in linearHoriAdvance, */ + /* it will be scaled later by the base layer. */ + glyph->linearHoriAdvance = advance; + } + + glyph->metrics.horiBearingX = bbox.xMin; + glyph->metrics.horiBearingY = bbox.yMax; + glyph->metrics.horiAdvance = loader->pp2.x - loader->pp1.x; + + /* Now take care of vertical metrics. In the case where there is */ + /* no vertical information within the font (relatively common), make */ + /* up some metrics by `hand'... */ + + { + FT_Pos top; /* scaled vertical top side bearing */ + FT_Pos advance; /* scaled vertical advance height */ + + + /* Get the unscaled top bearing and advance height. */ + if ( face->vertical_info && + face->vertical.number_Of_VMetrics > 0 ) + { + top = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax, + y_scale ); + + if ( loader->pp3.y <= loader->pp4.y ) + advance = 0; + else + advance = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y, + y_scale ); + } + else + { + FT_Pos height; + + + /* XXX Compute top side bearing and advance height in */ + /* Get_VMetrics instead of here. */ + + /* NOTE: The OS/2 values are the only `portable' ones, */ + /* which is why we use them, if there is an OS/2 */ + /* table in the font. Otherwise, we use the */ + /* values defined in the horizontal header. */ + + height = (FT_Short)FT_DivFix( bbox.yMax - bbox.yMin, + y_scale ); + if ( face->os2.version != 0xFFFFU ) + advance = (FT_Pos)( face->os2.sTypoAscender - + face->os2.sTypoDescender ); + else + advance = (FT_Pos)( face->horizontal.Ascender - + face->horizontal.Descender ); + + top = ( advance - height ) / 2; + } + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + { + FT_Incremental_InterfaceRec* incr; + FT_Incremental_MetricsRec metrics; + FT_Error error; + + + incr = face->root.internal->incremental_interface; + + /* If this is an incrementally loaded font see if there are */ + /* overriding metrics for this glyph. */ + if ( incr && incr->funcs->get_glyph_metrics ) + { + metrics.bearing_x = 0; + metrics.bearing_y = top; + metrics.advance = advance; + + error = incr->funcs->get_glyph_metrics( incr->object, + glyph_index, + TRUE, + &metrics ); + if ( error ) + return error; + + top = metrics.bearing_y; + advance = metrics.advance; + } + } + + /* GWW: Do vertical metrics get loaded incrementally too? */ + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + glyph->linearVertAdvance = advance; + + /* scale the metrics */ + if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) ) + { + top = FT_MulFix( top, y_scale ); + advance = FT_MulFix( advance, y_scale ); + } + + /* XXX: for now, we have no better algorithm for the lsb, but it */ + /* should work fine. */ + /* */ + glyph->metrics.vertBearingX = ( bbox.xMin - bbox.xMax ) / 2; + glyph->metrics.vertBearingY = top; + glyph->metrics.vertAdvance = advance; + } + + /* adjust advance width to the value contained in the hdmx table */ + if ( !face->postscript.isFixedPitch && + IS_HINTED( loader->load_flags ) ) + { + FT_Byte* widthp; + + + widthp = tt_face_get_device_metrics( face, + size->root.metrics.x_ppem, + glyph_index ); + + if ( widthp ) + glyph->metrics.horiAdvance = *widthp << 6; + } + + /* set glyph dimensions */ + glyph->metrics.width = bbox.xMax - bbox.xMin; + glyph->metrics.height = bbox.yMax - bbox.yMin; + + return 0; + } + + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + static FT_Error + load_sbit_image( TT_Size size, + TT_GlyphSlot glyph, + FT_UInt glyph_index, + FT_Int32 load_flags ) + { + TT_Face face; + SFNT_Service sfnt; + FT_Stream stream; + FT_Error error; + TT_SBit_MetricsRec metrics; + + + face = (TT_Face)glyph->face; + sfnt = (SFNT_Service)face->sfnt; + stream = face->root.stream; + + error = sfnt->load_sbit_image( face, + size->strike_index, + glyph_index, + (FT_Int)load_flags, + stream, + &glyph->bitmap, + &metrics ); + if ( !error ) + { + glyph->outline.n_points = 0; + glyph->outline.n_contours = 0; + + glyph->metrics.width = (FT_Pos)metrics.width << 6; + glyph->metrics.height = (FT_Pos)metrics.height << 6; + + glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6; + glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6; + glyph->metrics.horiAdvance = (FT_Pos)metrics.horiAdvance << 6; + + glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6; + glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6; + glyph->metrics.vertAdvance = (FT_Pos)metrics.vertAdvance << 6; + + glyph->format = FT_GLYPH_FORMAT_BITMAP; + if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) + { + glyph->bitmap_left = metrics.vertBearingX; + glyph->bitmap_top = metrics.vertBearingY; + } + else + { + glyph->bitmap_left = metrics.horiBearingX; + glyph->bitmap_top = metrics.horiBearingY; + } + } + + return error; + } + +#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + + static FT_Error + tt_loader_init( TT_Loader loader, + TT_Size size, + TT_GlyphSlot glyph, + FT_Int32 load_flags ) + { + TT_Face face; + FT_Stream stream; + + + face = (TT_Face)glyph->face; + stream = face->root.stream; + + FT_MEM_ZERO( loader, sizeof ( TT_LoaderRec ) ); + +#ifdef TT_USE_BYTECODE_INTERPRETER + + /* load execution context */ + if ( IS_HINTED( load_flags ) ) + { + TT_ExecContext exec; + FT_Bool grayscale; + + + if ( !size->cvt_ready ) + { + FT_Error error = tt_size_ready_bytecode( size ); + if ( error ) + return error; + } + + /* query new execution context */ + exec = size->debug ? size->context + : ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; + if ( !exec ) + return TT_Err_Could_Not_Find_Context; + + grayscale = + FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) != FT_RENDER_MODE_MONO ); + + TT_Load_Context( exec, face, size ); + + /* a change from mono to grayscale rendering (and vice versa) */ + /* requires a re-execution of the CVT program */ + if ( grayscale != exec->grayscale ) + { + FT_UInt i; + + + exec->grayscale = grayscale; + + for ( i = 0; i < size->cvt_size; i++ ) + size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); + tt_size_run_prep( size ); + } + + /* see whether the cvt program has disabled hinting */ + if ( exec->GS.instruct_control & 1 ) + load_flags |= FT_LOAD_NO_HINTING; + + /* load default graphics state -- if needed */ + if ( exec->GS.instruct_control & 2 ) + exec->GS = tt_default_graphics_state; + + exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); + loader->exec = exec; + loader->instructions = exec->glyphIns; + } + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + /* seek to the beginning of the glyph table -- for Type 42 fonts */ + /* the table might be accessed from a Postscript stream or something */ + /* else... */ + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + if ( face->root.internal->incremental_interface ) + loader->glyf_offset = 0; + else + +#endif + + { + FT_Error error = face->goto_table( face, TTAG_glyf, stream, 0 ); + + + if ( error ) + { + FT_ERROR(( "TT_Load_Glyph: could not access glyph table\n" )); + return error; + } + loader->glyf_offset = FT_STREAM_POS(); + } + + /* get face's glyph loader */ + { + FT_GlyphLoader gloader = glyph->internal->loader; + + + FT_GlyphLoader_Rewind( gloader ); + loader->gloader = gloader; + } + + loader->load_flags = load_flags; + + loader->face = (FT_Face)face; + loader->size = (FT_Size)size; + loader->glyph = (FT_GlyphSlot)glyph; + loader->stream = stream; + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Load_Glyph */ + /* */ + /* */ + /* A function used to load a single glyph within a given glyph slot, */ + /* for a given size. */ + /* */ + /* */ + /* glyph :: A handle to a target slot object where the glyph */ + /* will be loaded. */ + /* */ + /* size :: A handle to the source face size at which the glyph */ + /* must be scaled/loaded. */ + /* */ + /* glyph_index :: The index of the glyph in the font file. */ + /* */ + /* load_flags :: A flag indicating what to load for this glyph. The */ + /* FT_LOAD_XXX constants can be used to control the */ + /* glyph loading process (e.g., whether the outline */ + /* should be scaled, whether to load bitmaps or not, */ + /* whether to hint the outline, etc). */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Load_Glyph( TT_Size size, + TT_GlyphSlot glyph, + FT_UInt glyph_index, + FT_Int32 load_flags ) + { + TT_Face face; + FT_Error error; + TT_LoaderRec loader; + + + face = (TT_Face)glyph->face; + error = TT_Err_Ok; + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + /* try to load embedded bitmap if any */ + /* */ + /* XXX: The convention should be emphasized in */ + /* the documents because it can be confusing. */ + if ( size->strike_index != 0xFFFFFFFFUL && + ( load_flags & FT_LOAD_NO_BITMAP ) == 0 ) + { + error = load_sbit_image( size, glyph, glyph_index, load_flags ); + if ( !error ) + return TT_Err_Ok; + } + +#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */ + if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid ) + return TT_Err_Invalid_Size_Handle; + + if ( load_flags & FT_LOAD_SBITS_ONLY ) + return TT_Err_Invalid_Argument; + + error = tt_loader_init( &loader, size, glyph, load_flags ); + if ( error ) + return error; + + glyph->format = FT_GLYPH_FORMAT_OUTLINE; + glyph->num_subglyphs = 0; + glyph->outline.flags = 0; + + /* main loading loop */ + error = load_truetype_glyph( &loader, glyph_index, 0 ); + if ( !error ) + { + if ( glyph->format == FT_GLYPH_FORMAT_COMPOSITE ) + { + glyph->num_subglyphs = loader.gloader->base.num_subglyphs; + glyph->subglyphs = loader.gloader->base.subglyphs; + } + else + { + glyph->outline = loader.gloader->base.outline; + glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS; + + /* In case bit 1 of the `flags' field in the `head' table isn't */ + /* set, translate array so that (0,0) is the glyph's origin. */ + if ( ( face->header.Flags & 2 ) == 0 && loader.pp1.x ) + FT_Outline_Translate( &glyph->outline, -loader.pp1.x, 0 ); + } + + compute_glyph_metrics( &loader, glyph_index ); + } + + /* Set the `high precision' bit flag. */ + /* This is _critical_ to get correct output for monochrome */ + /* TrueType glyphs at all sizes using the bytecode interpreter. */ + /* */ + if ( !( load_flags & FT_LOAD_NO_SCALE ) && + size->root.metrics.y_ppem < 24 ) + glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; + + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttgload.h b/reactos/dll/3rdparty/freetype/src/truetype/ttgload.h index b261e97dee0..c194de441ee 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttgload.h +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttgload.h @@ -1,49 +1,49 @@ -/***************************************************************************/ -/* */ -/* ttgload.h */ -/* */ -/* TrueType Glyph Loader (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTGLOAD_H__ -#define __TTGLOAD_H__ - - -#include -#include "ttobjs.h" - -#ifdef TT_USE_BYTECODE_INTERPRETER -#include "ttinterp.h" -#endif - - -FT_BEGIN_HEADER - - - FT_LOCAL( void ) - TT_Init_Glyph_Loading( TT_Face face ); - - FT_LOCAL( FT_Error ) - TT_Load_Glyph( TT_Size size, - TT_GlyphSlot glyph, - FT_UInt glyph_index, - FT_Int32 load_flags ); - - -FT_END_HEADER - -#endif /* __TTGLOAD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttgload.h */ +/* */ +/* TrueType Glyph Loader (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTGLOAD_H__ +#define __TTGLOAD_H__ + + +#include +#include "ttobjs.h" + +#ifdef TT_USE_BYTECODE_INTERPRETER +#include "ttinterp.h" +#endif + + +FT_BEGIN_HEADER + + + FT_LOCAL( void ) + TT_Init_Glyph_Loading( TT_Face face ); + + FT_LOCAL( FT_Error ) + TT_Load_Glyph( TT_Size size, + TT_GlyphSlot glyph, + FT_UInt glyph_index, + FT_Int32 load_flags ); + + +FT_END_HEADER + +#endif /* __TTGLOAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.c b/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.c index 0dc2c4f3e4a..430cd7ee402 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.c +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.c @@ -1,1536 +1,1536 @@ -/***************************************************************************/ -/* */ -/* ttgxvar.c */ -/* */ -/* TrueType GX Font Variation loader */ -/* */ -/* Copyright 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -/***************************************************************************/ -/* */ -/* Apple documents the `fvar', `gvar', `cvar', and `avar' tables at */ -/* */ -/* http://developer.apple.com/fonts/TTRefMan/RM06/Chap6[fgca]var.html */ -/* */ -/* The documentation for `fvar' is inconsistent. At one point it says */ -/* that `countSizePairs' should be 3, at another point 2. It should be 2. */ -/* */ -/* The documentation for `gvar' is not intelligible; `cvar' refers you to */ -/* `gvar' and is thus also incomprehensible. */ -/* */ -/* The documentation for `avar' appears correct, but Apple has no fonts */ -/* with an `avar' table, so it is hard to test. */ -/* */ -/* Many thanks to John Jenkins (at Apple) in figuring this out. */ -/* */ -/* */ -/* Apple's `kern' table has some references to tuple indices, but as there */ -/* is no indication where these indices are defined, nor how to */ -/* interpolate the kerning values (different tuples have different */ -/* classes) this issue is ignored. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_TRUETYPE_IDS_H -#include FT_TRUETYPE_TAGS_H -#include FT_MULTIPLE_MASTERS_H - -#include "ttdriver.h" -#include "ttpload.h" -#include "ttgxvar.h" - -#include "tterrors.h" - - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - - -#define FT_Stream_FTell( stream ) \ - ( (stream)->cursor - (stream)->base ) -#define FT_Stream_SeekSet( stream, off ) \ - ( (stream)->cursor = (stream)->base+(off) ) - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttgxvar - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** Internal Routines *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* The macro ALL_POINTS is used in `ft_var_readpackedpoints'. It */ - /* indicates that there is a delta for every point without needing to */ - /* enumerate all of them. */ - /* */ -#define ALL_POINTS (FT_UShort*)( -1 ) - - - enum - { - GX_PT_POINTS_ARE_WORDS = 0x80, - GX_PT_POINT_RUN_COUNT_MASK = 0x7F - }; - - - /*************************************************************************/ - /* */ - /* */ - /* ft_var_readpackedpoints */ - /* */ - /* */ - /* Read a set of points to which the following deltas will apply. */ - /* Points are packed with a run length encoding. */ - /* */ - /* */ - /* stream :: The data stream. */ - /* */ - /* */ - /* point_cnt :: The number of points read. A zero value means that */ - /* all points in the glyph will be affected, without */ - /* enumerating them individually. */ - /* */ - /* */ - /* An array of FT_UShort containing the affected points or the */ - /* special value ALL_POINTS. */ - /* */ - static FT_UShort* - ft_var_readpackedpoints( FT_Stream stream, - FT_UInt *point_cnt ) - { - FT_UShort *points; - FT_Int n; - FT_Int runcnt; - FT_Int i; - FT_Int j; - FT_Int first; - FT_Memory memory = stream->memory; - FT_Error error = TT_Err_Ok; - - FT_UNUSED( error ); - - - *point_cnt = n = FT_GET_BYTE(); - if ( n == 0 ) - return ALL_POINTS; - - if ( n & GX_PT_POINTS_ARE_WORDS ) - n = FT_GET_BYTE() | ( ( n & GX_PT_POINT_RUN_COUNT_MASK ) << 8 ); - - if ( FT_NEW_ARRAY( points, n ) ) - return NULL; - - i = 0; - while ( i < n ) - { - runcnt = FT_GET_BYTE(); - if ( runcnt & GX_PT_POINTS_ARE_WORDS ) - { - runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK; - first = points[i++] = FT_GET_USHORT(); - - /* first point not included in runcount */ - for ( j = 0; j < runcnt; ++j ) - points[i++] = (FT_UShort)( first += FT_GET_USHORT() ); - } - else - { - first = points[i++] = FT_GET_BYTE(); - - for ( j = 0; j < runcnt; ++j ) - points[i++] = (FT_UShort)( first += FT_GET_BYTE() ); - } - } - - return points; - } - - - enum - { - GX_DT_DELTAS_ARE_ZERO = 0x80, - GX_DT_DELTAS_ARE_WORDS = 0x40, - GX_DT_DELTA_RUN_COUNT_MASK = 0x3F - }; - - - /*************************************************************************/ - /* */ - /* */ - /* ft_var_readpackeddeltas */ - /* */ - /* */ - /* Read a set of deltas. These are packed slightly differently than */ - /* points. In particular there is no overall count. */ - /* */ - /* */ - /* stream :: The data stream. */ - /* */ - /* delta_cnt :: The number of to be read. */ - /* */ - /* */ - /* An array of FT_Short containing the deltas for the affected */ - /* points. (This only gets the deltas for one dimension. It will */ - /* generally be called twice, once for x, once for y. When used in */ - /* cvt table, it will only be called once.) */ - /* */ - static FT_Short* - ft_var_readpackeddeltas( FT_Stream stream, - FT_Int delta_cnt ) - { - FT_Short *deltas; - FT_Int runcnt; - FT_Int i; - FT_Int j; - FT_Memory memory = stream->memory; - FT_Error error = TT_Err_Ok; - - FT_UNUSED( error ); - - - if ( FT_NEW_ARRAY( deltas, delta_cnt ) ) - return NULL; - - i = 0; - while ( i < delta_cnt ) - { - runcnt = FT_GET_BYTE(); - if ( runcnt & GX_DT_DELTAS_ARE_ZERO ) - { - /* runcnt zeroes get added */ - for ( j = 0; - j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt; - ++j ) - deltas[i++] = 0; - } - else if ( runcnt & GX_DT_DELTAS_ARE_WORDS ) - { - /* runcnt shorts from the stack */ - for ( j = 0; - j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt; - ++j ) - deltas[i++] = FT_GET_SHORT(); - } - else - { - /* runcnt signed bytes from the stack */ - for ( j = 0; - j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt; - ++j ) - deltas[i++] = FT_GET_CHAR(); - } - - if ( j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) ) - { - /* Bad format */ - FT_FREE( deltas ); - return NULL; - } - } - - return deltas; - } - - - /*************************************************************************/ - /* */ - /* */ - /* ft_var_load_avar */ - /* */ - /* */ - /* Parse the `avar' table if present. It need not be, so we return */ - /* nothing. */ - /* */ - /* */ - /* face :: The font face. */ - /* */ - static void - ft_var_load_avar( TT_Face face ) - { - FT_Stream stream = FT_FACE_STREAM(face); - FT_Memory memory = stream->memory; - GX_Blend blend = face->blend; - GX_AVarSegment segment; - FT_Error error = TT_Err_Ok; - FT_ULong version; - FT_Long axisCount; - FT_Int i, j; - FT_ULong table_len; - - FT_UNUSED( error ); - - - blend->avar_checked = TRUE; - if ( (error = face->goto_table( face, TTAG_avar, stream, &table_len )) != 0 ) - return; - - if ( FT_FRAME_ENTER( table_len ) ) - return; - - version = FT_GET_LONG(); - axisCount = FT_GET_LONG(); - - if ( version != 0x00010000L || - axisCount != (FT_Long)blend->mmvar->num_axis ) - goto Exit; - - if ( FT_NEW_ARRAY( blend->avar_segment, axisCount ) ) - goto Exit; - - segment = &blend->avar_segment[0]; - for ( i = 0; i < axisCount; ++i, ++segment ) - { - segment->pairCount = FT_GET_USHORT(); - if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) ) - { - /* Failure. Free everything we have done so far. We must do */ - /* it right now since loading the `avar' table is optional. */ - - for ( j = i - 1; j >= 0; --j ) - FT_FREE( blend->avar_segment[j].correspondence ); - - FT_FREE( blend->avar_segment ); - blend->avar_segment = NULL; - goto Exit; - } - - for ( j = 0; j < segment->pairCount; ++j ) - { - segment->correspondence[j].fromCoord = - FT_GET_SHORT() << 2; /* convert to Fixed */ - segment->correspondence[j].toCoord = - FT_GET_SHORT()<<2; /* convert to Fixed */ - } - } - - Exit: - FT_FRAME_EXIT(); - } - - - typedef struct GX_GVar_Head_ { - FT_Long version; - FT_UShort axisCount; - FT_UShort globalCoordCount; - FT_ULong offsetToCoord; - FT_UShort glyphCount; - FT_UShort flags; - FT_ULong offsetToData; - - } GX_GVar_Head; - - - /*************************************************************************/ - /* */ - /* */ - /* ft_var_load_gvar */ - /* */ - /* */ - /* Parses the `gvar' table if present. If `fvar' is there, `gvar' */ - /* had better be there too. */ - /* */ - /* */ - /* face :: The font face. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - ft_var_load_gvar( TT_Face face ) - { - FT_Stream stream = FT_FACE_STREAM(face); - FT_Memory memory = stream->memory; - GX_Blend blend = face->blend; - FT_Error error; - FT_UInt i, j; - FT_ULong table_len; - FT_ULong gvar_start; - FT_ULong offsetToData; - GX_GVar_Head gvar_head; - - static const FT_Frame_Field gvar_fields[] = - { - -#undef FT_STRUCTURE -#define FT_STRUCTURE GX_GVar_Head - - FT_FRAME_START( 20 ), - FT_FRAME_LONG ( version ), - FT_FRAME_USHORT( axisCount ), - FT_FRAME_USHORT( globalCoordCount ), - FT_FRAME_ULONG ( offsetToCoord ), - FT_FRAME_USHORT( glyphCount ), - FT_FRAME_USHORT( flags ), - FT_FRAME_ULONG ( offsetToData ), - FT_FRAME_END - }; - - if ( (error = face->goto_table( face, TTAG_gvar, stream, &table_len )) != 0 ) - goto Exit; - - gvar_start = FT_STREAM_POS( ); - if ( FT_STREAM_READ_FIELDS( gvar_fields, &gvar_head ) ) - goto Exit; - - blend->tuplecount = gvar_head.globalCoordCount; - blend->gv_glyphcnt = gvar_head.glyphCount; - offsetToData = gvar_start + gvar_head.offsetToData; - - if ( gvar_head.version != (FT_Long)0x00010000L || - gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis ) - { - error = TT_Err_Invalid_Table; - goto Exit; - } - - if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) ) - goto Exit; - - if ( gvar_head.flags & 1 ) - { - /* long offsets (one more offset than glyphs, to mark size of last) */ - if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 4L ) ) - goto Exit; - - for ( i = 0; i <= blend->gv_glyphcnt; ++i ) - blend->glyphoffsets[i] = offsetToData + FT_GET_LONG(); - - FT_FRAME_EXIT(); - } - else - { - /* short offsets (one more offset than glyphs, to mark size of last) */ - if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 2L ) ) - goto Exit; - - for ( i = 0; i <= blend->gv_glyphcnt; ++i ) - blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2; - /* XXX: Undocumented: `*2'! */ - - FT_FRAME_EXIT(); - } - - if ( blend->tuplecount != 0 ) - { - if ( FT_NEW_ARRAY( blend->tuplecoords, - gvar_head.axisCount * blend->tuplecount ) ) - goto Exit; - - if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord ) || - FT_FRAME_ENTER( blend->tuplecount * gvar_head.axisCount * 2L ) ) - goto Exit; - - for ( i = 0; i < blend->tuplecount; ++i ) - for ( j = 0 ; j < (FT_UInt)gvar_head.axisCount; ++j ) - blend->tuplecoords[i * gvar_head.axisCount + j] = - FT_GET_SHORT() << 2; /* convert to FT_Fixed */ - - FT_FRAME_EXIT(); - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* ft_var_apply_tuple */ - /* */ - /* */ - /* Figure out whether a given tuple (design) applies to the current */ - /* blend, and if so, what is the scaling factor. */ - /* */ - /* */ - /* blend :: The current blend of the font. */ - /* */ - /* tupleIndex :: A flag saying whether this is an intermediate */ - /* tuple or not. */ - /* */ - /* tuple_coords :: The coordinates of the tuple in normalized axis */ - /* units. */ - /* */ - /* im_start_coords :: The initial coordinates where this tuple starts */ - /* to apply (for intermediate coordinates). */ - /* */ - /* im_end_coords :: The final coordinates after which this tuple no */ - /* longer applies (for intermediate coordinates). */ - /* */ - /* */ - /* An FT_Fixed value containing the scaling factor. */ - /* */ - static FT_Fixed - ft_var_apply_tuple( GX_Blend blend, - FT_UShort tupleIndex, - FT_Fixed* tuple_coords, - FT_Fixed* im_start_coords, - FT_Fixed* im_end_coords ) - { - FT_UInt i; - FT_Fixed apply; - FT_Fixed temp; - - - apply = 0x10000L; - for ( i = 0; i < blend->num_axis; ++i ) - { - if ( tuple_coords[i] == 0 ) - /* It's not clear why (for intermediate tuples) we don't need */ - /* to check against start/end -- the documentation says we don't. */ - /* Similarly, it's unclear why we don't need to scale along the */ - /* axis. */ - continue; - - else if ( blend->normalizedcoords[i] == 0 || - ( blend->normalizedcoords[i] < 0 && tuple_coords[i] > 0 ) || - ( blend->normalizedcoords[i] > 0 && tuple_coords[i] < 0 ) ) - { - apply = 0; - break; - } - - else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) ) - /* not an intermediate tuple */ - apply = FT_MulDiv( apply, - blend->normalizedcoords[i] > 0 - ? blend->normalizedcoords[i] - : -blend->normalizedcoords[i], - 0x10000L ); - - else if ( blend->normalizedcoords[i] <= im_start_coords[i] || - blend->normalizedcoords[i] >= im_end_coords[i] ) - { - apply = 0; - break; - } - - else if ( blend->normalizedcoords[i] < tuple_coords[i] ) - { - temp = FT_MulDiv( blend->normalizedcoords[i] - im_start_coords[i], - 0x10000L, - tuple_coords[i] - im_start_coords[i]); - apply = FT_MulDiv( apply, temp, 0x10000L ); - } - - else - { - temp = FT_MulDiv( im_end_coords[i] - blend->normalizedcoords[i], - 0x10000L, - im_end_coords[i] - tuple_coords[i] ); - apply = FT_MulDiv( apply, temp, 0x10000L ); - } - } - - return apply; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** MULTIPLE MASTERS SERVICE FUNCTIONS *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - typedef struct GX_FVar_Head_ { - FT_Long version; - FT_UShort offsetToData; - FT_UShort countSizePairs; - FT_UShort axisCount; - FT_UShort axisSize; - FT_UShort instanceCount; - FT_UShort instanceSize; - - } GX_FVar_Head; - - - typedef struct fvar_axis { - FT_ULong axisTag; - FT_ULong minValue; - FT_ULong defaultValue; - FT_ULong maxValue; - FT_UShort flags; - FT_UShort nameID; - - } GX_FVar_Axis; - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Get_MM_Var */ - /* */ - /* */ - /* Check that the font's `fvar' table is valid, parse it, and return */ - /* those data. */ - /* */ - /* */ - /* face :: The font face. */ - /* TT_Get_MM_Var initializes the blend structure. */ - /* */ - /* */ - /* master :: The `fvar' data (must be freed by caller). */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Get_MM_Var( TT_Face face, - FT_MM_Var* *master ) - { - FT_Stream stream = face->root.stream; - FT_Memory memory = face->root.memory; - FT_ULong table_len; - FT_Error error = TT_Err_Ok; - FT_ULong fvar_start; - FT_Int i, j; - FT_MM_Var* mmvar; - FT_Fixed* next_coords; - FT_String* next_name; - FT_Var_Axis* a; - FT_Var_Named_Style* ns; - GX_FVar_Head fvar_head; - - static const FT_Frame_Field fvar_fields[] = - { - -#undef FT_STRUCTURE -#define FT_STRUCTURE GX_FVar_Head - - FT_FRAME_START( 16 ), - FT_FRAME_LONG ( version ), - FT_FRAME_USHORT( offsetToData ), - FT_FRAME_USHORT( countSizePairs ), - FT_FRAME_USHORT( axisCount ), - FT_FRAME_USHORT( axisSize ), - FT_FRAME_USHORT( instanceCount ), - FT_FRAME_USHORT( instanceSize ), - FT_FRAME_END - }; - - static const FT_Frame_Field fvaraxis_fields[] = - { - -#undef FT_STRUCTURE -#define FT_STRUCTURE GX_FVar_Axis - - FT_FRAME_START( 20 ), - FT_FRAME_ULONG ( axisTag ), - FT_FRAME_ULONG ( minValue ), - FT_FRAME_ULONG ( defaultValue ), - FT_FRAME_ULONG ( maxValue ), - FT_FRAME_USHORT( flags ), - FT_FRAME_USHORT( nameID ), - FT_FRAME_END - }; - - - if ( face->blend == NULL ) - { - /* both `fvar' and `gvar' must be present */ - if ( (error = face->goto_table( face, TTAG_gvar, - stream, &table_len )) != 0 ) - goto Exit; - - if ( (error = face->goto_table( face, TTAG_fvar, - stream, &table_len )) != 0 ) - goto Exit; - - fvar_start = FT_STREAM_POS( ); - - if ( FT_STREAM_READ_FIELDS( fvar_fields, &fvar_head ) ) - goto Exit; - - if ( fvar_head.version != (FT_Long)0x00010000L || - fvar_head.countSizePairs != 2 || - fvar_head.axisSize != 20 || - fvar_head.instanceSize != 4 + 4 * fvar_head.axisCount || - fvar_head.offsetToData + fvar_head.axisCount * 20U + - fvar_head.instanceCount * fvar_head.instanceSize > table_len ) - { - error = TT_Err_Invalid_Table; - goto Exit; - } - - if ( FT_NEW( face->blend ) ) - goto Exit; - - /* XXX: TODO - check for overflows */ - face->blend->mmvar_len = - sizeof ( FT_MM_Var ) + - fvar_head.axisCount * sizeof ( FT_Var_Axis ) + - fvar_head.instanceCount * sizeof ( FT_Var_Named_Style ) + - fvar_head.instanceCount * fvar_head.axisCount * sizeof ( FT_Fixed ) + - 5 * fvar_head.axisCount; - - if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) ) - goto Exit; - face->blend->mmvar = mmvar; - - mmvar->num_axis = - fvar_head.axisCount; - mmvar->num_designs = - (FT_UInt)-1; /* meaningless in this context; each glyph */ - /* may have a different number of designs */ - /* (or tuples, as called by Apple) */ - mmvar->num_namedstyles = - fvar_head.instanceCount; - mmvar->axis = - (FT_Var_Axis*)&(mmvar[1]); - mmvar->namedstyle = - (FT_Var_Named_Style*)&(mmvar->axis[fvar_head.axisCount]); - - next_coords = - (FT_Fixed*)&(mmvar->namedstyle[fvar_head.instanceCount]); - for ( i = 0; i < fvar_head.instanceCount; ++i ) - { - mmvar->namedstyle[i].coords = next_coords; - next_coords += fvar_head.axisCount; - } - - next_name = (FT_String*)next_coords; - for ( i = 0; i < fvar_head.axisCount; ++i ) - { - mmvar->axis[i].name = next_name; - next_name += 5; - } - - if ( FT_STREAM_SEEK( fvar_start + fvar_head.offsetToData ) ) - goto Exit; - - a = mmvar->axis; - for ( i = 0; i < fvar_head.axisCount; ++i ) - { - GX_FVar_Axis axis_rec; - - - if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) ) - goto Exit; - a->tag = axis_rec.axisTag; - a->minimum = axis_rec.minValue; /* A Fixed */ - a->def = axis_rec.defaultValue; /* A Fixed */ - a->maximum = axis_rec.maxValue; /* A Fixed */ - a->strid = axis_rec.nameID; - - a->name[0] = (FT_String)( a->tag >> 24 ); - a->name[1] = (FT_String)( ( a->tag >> 16 ) & 0xFF ); - a->name[2] = (FT_String)( ( a->tag >> 8 ) & 0xFF ); - a->name[3] = (FT_String)( ( a->tag ) & 0xFF ); - a->name[4] = 0; - - ++a; - } - - ns = mmvar->namedstyle; - for ( i = 0; i < fvar_head.instanceCount; ++i ) - { - if ( FT_FRAME_ENTER( 4L + 4L * fvar_head.axisCount ) ) - goto Exit; - - ns->strid = FT_GET_USHORT(); - (void) /* flags = */ FT_GET_USHORT(); - - for ( j = 0; j < fvar_head.axisCount; ++j ) - ns->coords[j] = FT_GET_ULONG(); /* A Fixed */ - - FT_FRAME_EXIT(); - } - } - - if ( master != NULL ) - { - FT_UInt n; - - - if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) ) - goto Exit; - FT_MEM_COPY( mmvar, face->blend->mmvar, face->blend->mmvar_len ); - - mmvar->axis = - (FT_Var_Axis*)&(mmvar[1]); - mmvar->namedstyle = - (FT_Var_Named_Style*)&(mmvar->axis[mmvar->num_axis]); - next_coords = - (FT_Fixed*)&(mmvar->namedstyle[mmvar->num_namedstyles]); - - for ( n = 0; n < mmvar->num_namedstyles; ++n ) - { - mmvar->namedstyle[n].coords = next_coords; - next_coords += mmvar->num_axis; - } - - a = mmvar->axis; - next_name = (FT_String*)next_coords; - for ( n = 0; n < mmvar->num_axis; ++n ) - { - a->name = next_name; - - /* standard PostScript names for some standard apple tags */ - if ( a->tag == TTAG_wght ) - a->name = (char *)"Weight"; - else if ( a->tag == TTAG_wdth ) - a->name = (char *)"Width"; - else if ( a->tag == TTAG_opsz ) - a->name = (char *)"OpticalSize"; - else if ( a->tag == TTAG_slnt ) - a->name = (char *)"Slant"; - - next_name += 5; - ++a; - } - - *master = mmvar; - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Set_MM_Blend */ - /* */ - /* */ - /* Set the blend (normalized) coordinates for this instance of the */ - /* font. Check that the `gvar' table is reasonable and does some */ - /* initial preparation. */ - /* */ - /* */ - /* face :: The font. */ - /* Initialize the blend structure with `gvar' data. */ - /* */ - /* */ - /* num_coords :: Must be the axis count of the font. */ - /* */ - /* coords :: An array of num_coords, each between [-1,1]. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Set_MM_Blend( TT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ) - { - FT_Error error = TT_Err_Ok; - GX_Blend blend; - FT_MM_Var* mmvar; - FT_UInt i; - FT_Memory memory = face->root.memory; - - enum - { - mcvt_retain, - mcvt_modify, - mcvt_load - - } manageCvt; - - - face->doblend = FALSE; - - if ( face->blend == NULL ) - { - if ( (error = TT_Get_MM_Var( face, NULL)) != 0 ) - goto Exit; - } - - blend = face->blend; - mmvar = blend->mmvar; - - if ( num_coords != mmvar->num_axis ) - { - error = TT_Err_Invalid_Argument; - goto Exit; - } - - for ( i = 0; i < num_coords; ++i ) - if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L ) - { - error = TT_Err_Invalid_Argument; - goto Exit; - } - - if ( blend->glyphoffsets == NULL ) - if ( (error = ft_var_load_gvar( face )) != 0 ) - goto Exit; - - if ( blend->normalizedcoords == NULL ) - { - if ( FT_NEW_ARRAY( blend->normalizedcoords, num_coords ) ) - goto Exit; - - manageCvt = mcvt_modify; - - /* If we have not set the blend coordinates before this, then the */ - /* cvt table will still be what we read from the `cvt ' table and */ - /* we don't need to reload it. We may need to change it though... */ - } - else - { - for ( i = 0; - i < num_coords && blend->normalizedcoords[i] == coords[i]; - ++i ); - if ( i == num_coords ) - manageCvt = mcvt_retain; - else - manageCvt = mcvt_load; - - /* If we don't change the blend coords then we don't need to do */ - /* anything to the cvt table. It will be correct. Otherwise we */ - /* no longer have the original cvt (it was modified when we set */ - /* the blend last time), so we must reload and then modify it. */ - } - - blend->num_axis = num_coords; - FT_MEM_COPY( blend->normalizedcoords, - coords, - num_coords * sizeof ( FT_Fixed ) ); - - face->doblend = TRUE; - - if ( face->cvt != NULL ) - { - switch ( manageCvt ) - { - case mcvt_load: - /* The cvt table has been loaded already; every time we change the */ - /* blend we may need to reload and remodify the cvt table. */ - FT_FREE( face->cvt ); - face->cvt = NULL; - - tt_face_load_cvt( face, face->root.stream ); - break; - - case mcvt_modify: - /* The original cvt table is in memory. All we need to do is */ - /* apply the `cvar' table (if any). */ - tt_face_vary_cvt( face, face->root.stream ); - break; - - case mcvt_retain: - /* The cvt table is correct for this set of coordinates. */ - break; - } - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Set_Var_Design */ - /* */ - /* */ - /* Set the coordinates for the instance, measured in the user */ - /* coordinate system. Parse the `avar' table (if present) to convert */ - /* from user to normalized coordinates. */ - /* */ - /* */ - /* face :: The font face. */ - /* Initialize the blend struct with `gvar' data. */ - /* */ - /* */ - /* num_coords :: This must be the axis count of the font. */ - /* */ - /* coords :: A coordinate array with `num_coords' elements. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Set_Var_Design( TT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ) - { - FT_Error error = TT_Err_Ok; - FT_Fixed* normalized = NULL; - GX_Blend blend; - FT_MM_Var* mmvar; - FT_UInt i, j; - FT_Var_Axis* a; - GX_AVarSegment av; - FT_Memory memory = face->root.memory; - - - if ( face->blend == NULL ) - { - if ( (error = TT_Get_MM_Var( face, NULL )) != 0 ) - goto Exit; - } - - blend = face->blend; - mmvar = blend->mmvar; - - if ( num_coords != mmvar->num_axis ) - { - error = TT_Err_Invalid_Argument; - goto Exit; - } - - /* Axis normalization is a two stage process. First we normalize */ - /* based on the [min,def,max] values for the axis to be [-1,0,1]. */ - /* Then, if there's an `avar' table, we renormalize this range. */ - - if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) ) - goto Exit; - - a = mmvar->axis; - for ( i = 0; i < mmvar->num_axis; ++i, ++a ) - { - if ( coords[i] > a->maximum || coords[i] < a->minimum ) - { - error = TT_Err_Invalid_Argument; - goto Exit; - } - - if ( coords[i] < a->def ) - { - normalized[i] = -FT_MulDiv( coords[i] - a->def, - 0x10000L, - a->minimum - a->def ); - } - else if ( a->maximum == a->def ) - normalized[i] = 0; - else - { - normalized[i] = FT_MulDiv( coords[i] - a->def, - 0x10000L, - a->maximum - a->def ); - } - } - - if ( !blend->avar_checked ) - ft_var_load_avar( face ); - - if ( blend->avar_segment != NULL ) - { - av = blend->avar_segment; - for ( i = 0; i < mmvar->num_axis; ++i, ++av ) - { - for ( j = 1; j < (FT_UInt)av->pairCount; ++j ) - if ( normalized[i] < av->correspondence[j].fromCoord ) - { - normalized[i] = - FT_MulDiv( - FT_MulDiv( - normalized[i] - av->correspondence[j - 1].fromCoord, - 0x10000L, - av->correspondence[j].fromCoord - - av->correspondence[j - 1].fromCoord ), - av->correspondence[j].toCoord - - av->correspondence[j - 1].toCoord, - 0x10000L ) + - av->correspondence[j - 1].toCoord; - break; - } - } - } - - error = TT_Set_MM_Blend( face, num_coords, normalized ); - - Exit: - FT_FREE( normalized ); - return error; - } - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** GX VAR PARSING ROUTINES *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_vary_cvt */ - /* */ - /* */ - /* Modify the loaded cvt table according to the `cvar' table and the */ - /* font's blend. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* Most errors are ignored. It is perfectly valid not to have a */ - /* `cvar' table even if there is a `gvar' and `fvar' table. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_vary_cvt( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - FT_Memory memory = stream->memory; - FT_ULong table_start; - FT_ULong table_len; - FT_UInt tupleCount; - FT_ULong offsetToData; - FT_ULong here; - FT_UInt i, j; - FT_Fixed* tuple_coords = NULL; - FT_Fixed* im_start_coords = NULL; - FT_Fixed* im_end_coords = NULL; - GX_Blend blend = face->blend; - FT_UInt point_count; - FT_UShort* localpoints; - FT_Short* deltas; - - - FT_TRACE2(( "CVAR " )); - - if ( blend == NULL ) - { - FT_TRACE2(( "no blend specified!\n" )); - - error = TT_Err_Ok; - goto Exit; - } - - if ( face->cvt == NULL ) - { - FT_TRACE2(( "no `cvt ' table!\n" )); - - error = TT_Err_Ok; - goto Exit; - } - - error = face->goto_table( face, TTAG_cvar, stream, &table_len ); - if ( error ) - { - FT_TRACE2(( "is missing!\n" )); - - error = TT_Err_Ok; - goto Exit; - } - - if ( FT_FRAME_ENTER( table_len ) ) - { - error = TT_Err_Ok; - goto Exit; - } - - table_start = FT_Stream_FTell( stream ); - if ( FT_GET_LONG() != 0x00010000L ) - { - FT_TRACE2(( "bad table version!\n" )); - - error = TT_Err_Ok; - goto FExit; - } - - if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_start_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_end_coords, blend->num_axis ) ) - goto FExit; - - tupleCount = FT_GET_USHORT(); - offsetToData = table_start + FT_GET_USHORT(); - - /* The documentation implies there are flags packed into the */ - /* tuplecount, but John Jenkins says that shared points don't apply */ - /* to `cvar', and no other flags are defined. */ - - for ( i = 0; i < ( tupleCount & 0xFFF ); ++i ) - { - FT_UInt tupleDataSize; - FT_UInt tupleIndex; - FT_Fixed apply; - - - tupleDataSize = FT_GET_USHORT(); - tupleIndex = FT_GET_USHORT(); - - /* There is no provision here for a global tuple coordinate section, */ - /* so John says. There are no tuple indices, just embedded tuples. */ - - if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) - { - for ( j = 0; j < blend->num_axis; ++j ) - tuple_coords[j] = FT_GET_SHORT() << 2; /* convert from */ - /* short frac to fixed */ - } - else - { - /* skip this tuple; it makes no sense */ - - if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) - for ( j = 0; j < 2 * blend->num_axis; ++j ) - (void)FT_GET_SHORT(); - - offsetToData += tupleDataSize; - continue; - } - - if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) - { - for ( j = 0; j < blend->num_axis; ++j ) - im_start_coords[j] = FT_GET_SHORT() << 2; - for ( j = 0; j < blend->num_axis; ++j ) - im_end_coords[j] = FT_GET_SHORT() << 2; - } - - apply = ft_var_apply_tuple( blend, - (FT_UShort)tupleIndex, - tuple_coords, - im_start_coords, - im_end_coords ); - if ( /* tuple isn't active for our blend */ - apply == 0 || - /* global points not allowed, */ - /* if they aren't local, makes no sense */ - !( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS ) ) - { - offsetToData += tupleDataSize; - continue; - } - - here = FT_Stream_FTell( stream ); - - FT_Stream_SeekSet( stream, offsetToData ); - - localpoints = ft_var_readpackedpoints( stream, &point_count ); - deltas = ft_var_readpackeddeltas( stream, - point_count == 0 ? face->cvt_size - : point_count ); - if ( localpoints == NULL || deltas == NULL ) - /* failure, ignore it */; - - else if ( localpoints == ALL_POINTS ) - { - /* this means that there are deltas for every entry in cvt */ - for ( j = 0; j < face->cvt_size; ++j ) - face->cvt[j] = (FT_Short)( face->cvt[j] + - FT_MulFix( deltas[j], apply ) ); - } - - else - { - for ( j = 0; j < point_count; ++j ) - { - int pindex = localpoints[j]; - - face->cvt[pindex] = (FT_Short)( face->cvt[pindex] + - FT_MulFix( deltas[j], apply ) ); - } - } - - if ( localpoints != ALL_POINTS ) - FT_FREE( localpoints ); - FT_FREE( deltas ); - - offsetToData += tupleDataSize; - - FT_Stream_SeekSet( stream, here ); - } - - FExit: - FT_FRAME_EXIT(); - - Exit: - FT_FREE( tuple_coords ); - FT_FREE( im_start_coords ); - FT_FREE( im_end_coords ); - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Vary_Get_Glyph_Deltas */ - /* */ - /* */ - /* Load the appropriate deltas for the current glyph. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* glyph_index :: The index of the glyph being modified. */ - /* */ - /* n_points :: The number of the points in the glyph, including */ - /* phantom points. */ - /* */ - /* */ - /* deltas :: The array of points to change. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Vary_Get_Glyph_Deltas( TT_Face face, - FT_UInt glyph_index, - FT_Vector* *deltas, - FT_UInt n_points ) - { - FT_Stream stream = face->root.stream; - FT_Memory memory = stream->memory; - GX_Blend blend = face->blend; - FT_Vector* delta_xy; - - FT_Error error; - FT_ULong glyph_start; - FT_UInt tupleCount; - FT_ULong offsetToData; - FT_ULong here; - FT_UInt i, j; - FT_Fixed* tuple_coords = NULL; - FT_Fixed* im_start_coords = NULL; - FT_Fixed* im_end_coords = NULL; - FT_UInt point_count, spoint_count = 0; - FT_UShort* sharedpoints = NULL; - FT_UShort* localpoints = NULL; - FT_UShort* points; - FT_Short *deltas_x, *deltas_y; - - - if ( !face->doblend || blend == NULL ) - return TT_Err_Invalid_Argument; - - /* to be freed by the caller */ - if ( FT_NEW_ARRAY( delta_xy, n_points ) ) - goto Exit; - *deltas = delta_xy; - - if ( glyph_index >= blend->gv_glyphcnt || - blend->glyphoffsets[glyph_index] == - blend->glyphoffsets[glyph_index + 1] ) - return TT_Err_Ok; /* no variation data for this glyph */ - - if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] ) || - FT_FRAME_ENTER( blend->glyphoffsets[glyph_index + 1] - - blend->glyphoffsets[glyph_index] ) ) - goto Fail1; - - glyph_start = FT_Stream_FTell( stream ); - - /* each set of glyph variation data is formatted similarly to `cvar' */ - /* (except we get shared points and global tuples) */ - - if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_start_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_end_coords, blend->num_axis ) ) - goto Fail2; - - tupleCount = FT_GET_USHORT(); - offsetToData = glyph_start + FT_GET_USHORT(); - - if ( tupleCount & GX_TC_TUPLES_SHARE_POINT_NUMBERS ) - { - here = FT_Stream_FTell( stream ); - - FT_Stream_SeekSet( stream, offsetToData ); - - sharedpoints = ft_var_readpackedpoints( stream, &spoint_count ); - offsetToData = FT_Stream_FTell( stream ); - - FT_Stream_SeekSet( stream, here ); - } - - for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); ++i ) - { - FT_UInt tupleDataSize; - FT_UInt tupleIndex; - FT_Fixed apply; - - - tupleDataSize = FT_GET_USHORT(); - tupleIndex = FT_GET_USHORT(); - - if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) - { - for ( j = 0; j < blend->num_axis; ++j ) - tuple_coords[j] = FT_GET_SHORT() << 2; /* convert from */ - /* short frac to fixed */ - } - else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) - { - error = TT_Err_Invalid_Table; - goto Fail3; - } - else - { - FT_MEM_COPY( - tuple_coords, - &blend->tuplecoords[(tupleIndex & 0xFFF) * blend->num_axis], - blend->num_axis * sizeof ( FT_Fixed ) ); - } - - if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) - { - for ( j = 0; j < blend->num_axis; ++j ) - im_start_coords[j] = FT_GET_SHORT() << 2; - for ( j = 0; j < blend->num_axis; ++j ) - im_end_coords[j] = FT_GET_SHORT() << 2; - } - - apply = ft_var_apply_tuple( blend, - (FT_UShort)tupleIndex, - tuple_coords, - im_start_coords, - im_end_coords ); - - if ( apply == 0 ) /* tuple isn't active for our blend */ - { - offsetToData += tupleDataSize; - continue; - } - - here = FT_Stream_FTell( stream ); - - if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS ) - { - FT_Stream_SeekSet( stream, offsetToData ); - - localpoints = ft_var_readpackedpoints( stream, &point_count ); - points = localpoints; - } - else - { - points = sharedpoints; - point_count = spoint_count; - } - - deltas_x = ft_var_readpackeddeltas( stream, - point_count == 0 ? n_points - : point_count ); - deltas_y = ft_var_readpackeddeltas( stream, - point_count == 0 ? n_points - : point_count ); - - if ( points == NULL || deltas_y == NULL || deltas_x == NULL ) - ; /* failure, ignore it */ - - else if ( points == ALL_POINTS ) - { - /* this means that there are deltas for every point in the glyph */ - for ( j = 0; j < n_points; ++j ) - { - delta_xy[j].x += FT_MulFix( deltas_x[j], apply ); - delta_xy[j].y += FT_MulFix( deltas_y[j], apply ); - } - } - - else - { - for ( j = 0; j < point_count; ++j ) - { - delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply ); - delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply ); - } - } - - if ( localpoints != ALL_POINTS ) - FT_FREE( localpoints ); - FT_FREE( deltas_x ); - FT_FREE( deltas_y ); - - offsetToData += tupleDataSize; - - FT_Stream_SeekSet( stream, here ); - } - - Fail3: - FT_FREE( tuple_coords ); - FT_FREE( im_start_coords ); - FT_FREE( im_end_coords ); - - Fail2: - FT_FRAME_EXIT(); - - Fail1: - if ( error ) - { - FT_FREE( delta_xy ); - *deltas = NULL; - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_done_blend */ - /* */ - /* */ - /* Frees the blend internal data structure. */ - /* */ - FT_LOCAL_DEF( void ) - tt_done_blend( FT_Memory memory, - GX_Blend blend ) - { - if ( blend != NULL ) - { - FT_UInt i; - - - FT_FREE( blend->normalizedcoords ); - FT_FREE( blend->mmvar ); - - if ( blend->avar_segment != NULL ) - { - for ( i = 0; i < blend->num_axis; ++i ) - FT_FREE( blend->avar_segment[i].correspondence ); - FT_FREE( blend->avar_segment ); - } - - FT_FREE( blend->tuplecoords ); - FT_FREE( blend->glyphoffsets ); - FT_FREE( blend ); - } - } - -#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttgxvar.c */ +/* */ +/* TrueType GX Font Variation loader */ +/* */ +/* Copyright 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* Apple documents the `fvar', `gvar', `cvar', and `avar' tables at */ +/* */ +/* http://developer.apple.com/fonts/TTRefMan/RM06/Chap6[fgca]var.html */ +/* */ +/* The documentation for `fvar' is inconsistent. At one point it says */ +/* that `countSizePairs' should be 3, at another point 2. It should be 2. */ +/* */ +/* The documentation for `gvar' is not intelligible; `cvar' refers you to */ +/* `gvar' and is thus also incomprehensible. */ +/* */ +/* The documentation for `avar' appears correct, but Apple has no fonts */ +/* with an `avar' table, so it is hard to test. */ +/* */ +/* Many thanks to John Jenkins (at Apple) in figuring this out. */ +/* */ +/* */ +/* Apple's `kern' table has some references to tuple indices, but as there */ +/* is no indication where these indices are defined, nor how to */ +/* interpolate the kerning values (different tuples have different */ +/* classes) this issue is ignored. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_TAGS_H +#include FT_MULTIPLE_MASTERS_H + +#include "ttdriver.h" +#include "ttpload.h" +#include "ttgxvar.h" + +#include "tterrors.h" + + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + + +#define FT_Stream_FTell( stream ) \ + ( (stream)->cursor - (stream)->base ) +#define FT_Stream_SeekSet( stream, off ) \ + ( (stream)->cursor = (stream)->base+(off) ) + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttgxvar + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** Internal Routines *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* The macro ALL_POINTS is used in `ft_var_readpackedpoints'. It */ + /* indicates that there is a delta for every point without needing to */ + /* enumerate all of them. */ + /* */ +#define ALL_POINTS (FT_UShort*)( -1 ) + + + enum + { + GX_PT_POINTS_ARE_WORDS = 0x80, + GX_PT_POINT_RUN_COUNT_MASK = 0x7F + }; + + + /*************************************************************************/ + /* */ + /* */ + /* ft_var_readpackedpoints */ + /* */ + /* */ + /* Read a set of points to which the following deltas will apply. */ + /* Points are packed with a run length encoding. */ + /* */ + /* */ + /* stream :: The data stream. */ + /* */ + /* */ + /* point_cnt :: The number of points read. A zero value means that */ + /* all points in the glyph will be affected, without */ + /* enumerating them individually. */ + /* */ + /* */ + /* An array of FT_UShort containing the affected points or the */ + /* special value ALL_POINTS. */ + /* */ + static FT_UShort* + ft_var_readpackedpoints( FT_Stream stream, + FT_UInt *point_cnt ) + { + FT_UShort *points; + FT_Int n; + FT_Int runcnt; + FT_Int i; + FT_Int j; + FT_Int first; + FT_Memory memory = stream->memory; + FT_Error error = TT_Err_Ok; + + FT_UNUSED( error ); + + + *point_cnt = n = FT_GET_BYTE(); + if ( n == 0 ) + return ALL_POINTS; + + if ( n & GX_PT_POINTS_ARE_WORDS ) + n = FT_GET_BYTE() | ( ( n & GX_PT_POINT_RUN_COUNT_MASK ) << 8 ); + + if ( FT_NEW_ARRAY( points, n ) ) + return NULL; + + i = 0; + while ( i < n ) + { + runcnt = FT_GET_BYTE(); + if ( runcnt & GX_PT_POINTS_ARE_WORDS ) + { + runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK; + first = points[i++] = FT_GET_USHORT(); + + /* first point not included in runcount */ + for ( j = 0; j < runcnt; ++j ) + points[i++] = (FT_UShort)( first += FT_GET_USHORT() ); + } + else + { + first = points[i++] = FT_GET_BYTE(); + + for ( j = 0; j < runcnt; ++j ) + points[i++] = (FT_UShort)( first += FT_GET_BYTE() ); + } + } + + return points; + } + + + enum + { + GX_DT_DELTAS_ARE_ZERO = 0x80, + GX_DT_DELTAS_ARE_WORDS = 0x40, + GX_DT_DELTA_RUN_COUNT_MASK = 0x3F + }; + + + /*************************************************************************/ + /* */ + /* */ + /* ft_var_readpackeddeltas */ + /* */ + /* */ + /* Read a set of deltas. These are packed slightly differently than */ + /* points. In particular there is no overall count. */ + /* */ + /* */ + /* stream :: The data stream. */ + /* */ + /* delta_cnt :: The number of to be read. */ + /* */ + /* */ + /* An array of FT_Short containing the deltas for the affected */ + /* points. (This only gets the deltas for one dimension. It will */ + /* generally be called twice, once for x, once for y. When used in */ + /* cvt table, it will only be called once.) */ + /* */ + static FT_Short* + ft_var_readpackeddeltas( FT_Stream stream, + FT_Int delta_cnt ) + { + FT_Short *deltas; + FT_Int runcnt; + FT_Int i; + FT_Int j; + FT_Memory memory = stream->memory; + FT_Error error = TT_Err_Ok; + + FT_UNUSED( error ); + + + if ( FT_NEW_ARRAY( deltas, delta_cnt ) ) + return NULL; + + i = 0; + while ( i < delta_cnt ) + { + runcnt = FT_GET_BYTE(); + if ( runcnt & GX_DT_DELTAS_ARE_ZERO ) + { + /* runcnt zeroes get added */ + for ( j = 0; + j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt; + ++j ) + deltas[i++] = 0; + } + else if ( runcnt & GX_DT_DELTAS_ARE_WORDS ) + { + /* runcnt shorts from the stack */ + for ( j = 0; + j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt; + ++j ) + deltas[i++] = FT_GET_SHORT(); + } + else + { + /* runcnt signed bytes from the stack */ + for ( j = 0; + j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt; + ++j ) + deltas[i++] = FT_GET_CHAR(); + } + + if ( j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) ) + { + /* Bad format */ + FT_FREE( deltas ); + return NULL; + } + } + + return deltas; + } + + + /*************************************************************************/ + /* */ + /* */ + /* ft_var_load_avar */ + /* */ + /* */ + /* Parse the `avar' table if present. It need not be, so we return */ + /* nothing. */ + /* */ + /* */ + /* face :: The font face. */ + /* */ + static void + ft_var_load_avar( TT_Face face ) + { + FT_Stream stream = FT_FACE_STREAM(face); + FT_Memory memory = stream->memory; + GX_Blend blend = face->blend; + GX_AVarSegment segment; + FT_Error error = TT_Err_Ok; + FT_ULong version; + FT_Long axisCount; + FT_Int i, j; + FT_ULong table_len; + + FT_UNUSED( error ); + + + blend->avar_checked = TRUE; + if ( (error = face->goto_table( face, TTAG_avar, stream, &table_len )) != 0 ) + return; + + if ( FT_FRAME_ENTER( table_len ) ) + return; + + version = FT_GET_LONG(); + axisCount = FT_GET_LONG(); + + if ( version != 0x00010000L || + axisCount != (FT_Long)blend->mmvar->num_axis ) + goto Exit; + + if ( FT_NEW_ARRAY( blend->avar_segment, axisCount ) ) + goto Exit; + + segment = &blend->avar_segment[0]; + for ( i = 0; i < axisCount; ++i, ++segment ) + { + segment->pairCount = FT_GET_USHORT(); + if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) ) + { + /* Failure. Free everything we have done so far. We must do */ + /* it right now since loading the `avar' table is optional. */ + + for ( j = i - 1; j >= 0; --j ) + FT_FREE( blend->avar_segment[j].correspondence ); + + FT_FREE( blend->avar_segment ); + blend->avar_segment = NULL; + goto Exit; + } + + for ( j = 0; j < segment->pairCount; ++j ) + { + segment->correspondence[j].fromCoord = + FT_GET_SHORT() << 2; /* convert to Fixed */ + segment->correspondence[j].toCoord = + FT_GET_SHORT()<<2; /* convert to Fixed */ + } + } + + Exit: + FT_FRAME_EXIT(); + } + + + typedef struct GX_GVar_Head_ { + FT_Long version; + FT_UShort axisCount; + FT_UShort globalCoordCount; + FT_ULong offsetToCoord; + FT_UShort glyphCount; + FT_UShort flags; + FT_ULong offsetToData; + + } GX_GVar_Head; + + + /*************************************************************************/ + /* */ + /* */ + /* ft_var_load_gvar */ + /* */ + /* */ + /* Parses the `gvar' table if present. If `fvar' is there, `gvar' */ + /* had better be there too. */ + /* */ + /* */ + /* face :: The font face. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + ft_var_load_gvar( TT_Face face ) + { + FT_Stream stream = FT_FACE_STREAM(face); + FT_Memory memory = stream->memory; + GX_Blend blend = face->blend; + FT_Error error; + FT_UInt i, j; + FT_ULong table_len; + FT_ULong gvar_start; + FT_ULong offsetToData; + GX_GVar_Head gvar_head; + + static const FT_Frame_Field gvar_fields[] = + { + +#undef FT_STRUCTURE +#define FT_STRUCTURE GX_GVar_Head + + FT_FRAME_START( 20 ), + FT_FRAME_LONG ( version ), + FT_FRAME_USHORT( axisCount ), + FT_FRAME_USHORT( globalCoordCount ), + FT_FRAME_ULONG ( offsetToCoord ), + FT_FRAME_USHORT( glyphCount ), + FT_FRAME_USHORT( flags ), + FT_FRAME_ULONG ( offsetToData ), + FT_FRAME_END + }; + + if ( (error = face->goto_table( face, TTAG_gvar, stream, &table_len )) != 0 ) + goto Exit; + + gvar_start = FT_STREAM_POS( ); + if ( FT_STREAM_READ_FIELDS( gvar_fields, &gvar_head ) ) + goto Exit; + + blend->tuplecount = gvar_head.globalCoordCount; + blend->gv_glyphcnt = gvar_head.glyphCount; + offsetToData = gvar_start + gvar_head.offsetToData; + + if ( gvar_head.version != (FT_Long)0x00010000L || + gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis ) + { + error = TT_Err_Invalid_Table; + goto Exit; + } + + if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) ) + goto Exit; + + if ( gvar_head.flags & 1 ) + { + /* long offsets (one more offset than glyphs, to mark size of last) */ + if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 4L ) ) + goto Exit; + + for ( i = 0; i <= blend->gv_glyphcnt; ++i ) + blend->glyphoffsets[i] = offsetToData + FT_GET_LONG(); + + FT_FRAME_EXIT(); + } + else + { + /* short offsets (one more offset than glyphs, to mark size of last) */ + if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 2L ) ) + goto Exit; + + for ( i = 0; i <= blend->gv_glyphcnt; ++i ) + blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2; + /* XXX: Undocumented: `*2'! */ + + FT_FRAME_EXIT(); + } + + if ( blend->tuplecount != 0 ) + { + if ( FT_NEW_ARRAY( blend->tuplecoords, + gvar_head.axisCount * blend->tuplecount ) ) + goto Exit; + + if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord ) || + FT_FRAME_ENTER( blend->tuplecount * gvar_head.axisCount * 2L ) ) + goto Exit; + + for ( i = 0; i < blend->tuplecount; ++i ) + for ( j = 0 ; j < (FT_UInt)gvar_head.axisCount; ++j ) + blend->tuplecoords[i * gvar_head.axisCount + j] = + FT_GET_SHORT() << 2; /* convert to FT_Fixed */ + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* ft_var_apply_tuple */ + /* */ + /* */ + /* Figure out whether a given tuple (design) applies to the current */ + /* blend, and if so, what is the scaling factor. */ + /* */ + /* */ + /* blend :: The current blend of the font. */ + /* */ + /* tupleIndex :: A flag saying whether this is an intermediate */ + /* tuple or not. */ + /* */ + /* tuple_coords :: The coordinates of the tuple in normalized axis */ + /* units. */ + /* */ + /* im_start_coords :: The initial coordinates where this tuple starts */ + /* to apply (for intermediate coordinates). */ + /* */ + /* im_end_coords :: The final coordinates after which this tuple no */ + /* longer applies (for intermediate coordinates). */ + /* */ + /* */ + /* An FT_Fixed value containing the scaling factor. */ + /* */ + static FT_Fixed + ft_var_apply_tuple( GX_Blend blend, + FT_UShort tupleIndex, + FT_Fixed* tuple_coords, + FT_Fixed* im_start_coords, + FT_Fixed* im_end_coords ) + { + FT_UInt i; + FT_Fixed apply; + FT_Fixed temp; + + + apply = 0x10000L; + for ( i = 0; i < blend->num_axis; ++i ) + { + if ( tuple_coords[i] == 0 ) + /* It's not clear why (for intermediate tuples) we don't need */ + /* to check against start/end -- the documentation says we don't. */ + /* Similarly, it's unclear why we don't need to scale along the */ + /* axis. */ + continue; + + else if ( blend->normalizedcoords[i] == 0 || + ( blend->normalizedcoords[i] < 0 && tuple_coords[i] > 0 ) || + ( blend->normalizedcoords[i] > 0 && tuple_coords[i] < 0 ) ) + { + apply = 0; + break; + } + + else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) ) + /* not an intermediate tuple */ + apply = FT_MulDiv( apply, + blend->normalizedcoords[i] > 0 + ? blend->normalizedcoords[i] + : -blend->normalizedcoords[i], + 0x10000L ); + + else if ( blend->normalizedcoords[i] <= im_start_coords[i] || + blend->normalizedcoords[i] >= im_end_coords[i] ) + { + apply = 0; + break; + } + + else if ( blend->normalizedcoords[i] < tuple_coords[i] ) + { + temp = FT_MulDiv( blend->normalizedcoords[i] - im_start_coords[i], + 0x10000L, + tuple_coords[i] - im_start_coords[i]); + apply = FT_MulDiv( apply, temp, 0x10000L ); + } + + else + { + temp = FT_MulDiv( im_end_coords[i] - blend->normalizedcoords[i], + 0x10000L, + im_end_coords[i] - tuple_coords[i] ); + apply = FT_MulDiv( apply, temp, 0x10000L ); + } + } + + return apply; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** MULTIPLE MASTERS SERVICE FUNCTIONS *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + typedef struct GX_FVar_Head_ { + FT_Long version; + FT_UShort offsetToData; + FT_UShort countSizePairs; + FT_UShort axisCount; + FT_UShort axisSize; + FT_UShort instanceCount; + FT_UShort instanceSize; + + } GX_FVar_Head; + + + typedef struct fvar_axis { + FT_ULong axisTag; + FT_ULong minValue; + FT_ULong defaultValue; + FT_ULong maxValue; + FT_UShort flags; + FT_UShort nameID; + + } GX_FVar_Axis; + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Get_MM_Var */ + /* */ + /* */ + /* Check that the font's `fvar' table is valid, parse it, and return */ + /* those data. */ + /* */ + /* */ + /* face :: The font face. */ + /* TT_Get_MM_Var initializes the blend structure. */ + /* */ + /* */ + /* master :: The `fvar' data (must be freed by caller). */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Get_MM_Var( TT_Face face, + FT_MM_Var* *master ) + { + FT_Stream stream = face->root.stream; + FT_Memory memory = face->root.memory; + FT_ULong table_len; + FT_Error error = TT_Err_Ok; + FT_ULong fvar_start; + FT_Int i, j; + FT_MM_Var* mmvar; + FT_Fixed* next_coords; + FT_String* next_name; + FT_Var_Axis* a; + FT_Var_Named_Style* ns; + GX_FVar_Head fvar_head; + + static const FT_Frame_Field fvar_fields[] = + { + +#undef FT_STRUCTURE +#define FT_STRUCTURE GX_FVar_Head + + FT_FRAME_START( 16 ), + FT_FRAME_LONG ( version ), + FT_FRAME_USHORT( offsetToData ), + FT_FRAME_USHORT( countSizePairs ), + FT_FRAME_USHORT( axisCount ), + FT_FRAME_USHORT( axisSize ), + FT_FRAME_USHORT( instanceCount ), + FT_FRAME_USHORT( instanceSize ), + FT_FRAME_END + }; + + static const FT_Frame_Field fvaraxis_fields[] = + { + +#undef FT_STRUCTURE +#define FT_STRUCTURE GX_FVar_Axis + + FT_FRAME_START( 20 ), + FT_FRAME_ULONG ( axisTag ), + FT_FRAME_ULONG ( minValue ), + FT_FRAME_ULONG ( defaultValue ), + FT_FRAME_ULONG ( maxValue ), + FT_FRAME_USHORT( flags ), + FT_FRAME_USHORT( nameID ), + FT_FRAME_END + }; + + + if ( face->blend == NULL ) + { + /* both `fvar' and `gvar' must be present */ + if ( (error = face->goto_table( face, TTAG_gvar, + stream, &table_len )) != 0 ) + goto Exit; + + if ( (error = face->goto_table( face, TTAG_fvar, + stream, &table_len )) != 0 ) + goto Exit; + + fvar_start = FT_STREAM_POS( ); + + if ( FT_STREAM_READ_FIELDS( fvar_fields, &fvar_head ) ) + goto Exit; + + if ( fvar_head.version != (FT_Long)0x00010000L || + fvar_head.countSizePairs != 2 || + fvar_head.axisSize != 20 || + fvar_head.instanceSize != 4 + 4 * fvar_head.axisCount || + fvar_head.offsetToData + fvar_head.axisCount * 20U + + fvar_head.instanceCount * fvar_head.instanceSize > table_len ) + { + error = TT_Err_Invalid_Table; + goto Exit; + } + + if ( FT_NEW( face->blend ) ) + goto Exit; + + /* XXX: TODO - check for overflows */ + face->blend->mmvar_len = + sizeof ( FT_MM_Var ) + + fvar_head.axisCount * sizeof ( FT_Var_Axis ) + + fvar_head.instanceCount * sizeof ( FT_Var_Named_Style ) + + fvar_head.instanceCount * fvar_head.axisCount * sizeof ( FT_Fixed ) + + 5 * fvar_head.axisCount; + + if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) ) + goto Exit; + face->blend->mmvar = mmvar; + + mmvar->num_axis = + fvar_head.axisCount; + mmvar->num_designs = + (FT_UInt)-1; /* meaningless in this context; each glyph */ + /* may have a different number of designs */ + /* (or tuples, as called by Apple) */ + mmvar->num_namedstyles = + fvar_head.instanceCount; + mmvar->axis = + (FT_Var_Axis*)&(mmvar[1]); + mmvar->namedstyle = + (FT_Var_Named_Style*)&(mmvar->axis[fvar_head.axisCount]); + + next_coords = + (FT_Fixed*)&(mmvar->namedstyle[fvar_head.instanceCount]); + for ( i = 0; i < fvar_head.instanceCount; ++i ) + { + mmvar->namedstyle[i].coords = next_coords; + next_coords += fvar_head.axisCount; + } + + next_name = (FT_String*)next_coords; + for ( i = 0; i < fvar_head.axisCount; ++i ) + { + mmvar->axis[i].name = next_name; + next_name += 5; + } + + if ( FT_STREAM_SEEK( fvar_start + fvar_head.offsetToData ) ) + goto Exit; + + a = mmvar->axis; + for ( i = 0; i < fvar_head.axisCount; ++i ) + { + GX_FVar_Axis axis_rec; + + + if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) ) + goto Exit; + a->tag = axis_rec.axisTag; + a->minimum = axis_rec.minValue; /* A Fixed */ + a->def = axis_rec.defaultValue; /* A Fixed */ + a->maximum = axis_rec.maxValue; /* A Fixed */ + a->strid = axis_rec.nameID; + + a->name[0] = (FT_String)( a->tag >> 24 ); + a->name[1] = (FT_String)( ( a->tag >> 16 ) & 0xFF ); + a->name[2] = (FT_String)( ( a->tag >> 8 ) & 0xFF ); + a->name[3] = (FT_String)( ( a->tag ) & 0xFF ); + a->name[4] = 0; + + ++a; + } + + ns = mmvar->namedstyle; + for ( i = 0; i < fvar_head.instanceCount; ++i ) + { + if ( FT_FRAME_ENTER( 4L + 4L * fvar_head.axisCount ) ) + goto Exit; + + ns->strid = FT_GET_USHORT(); + (void) /* flags = */ FT_GET_USHORT(); + + for ( j = 0; j < fvar_head.axisCount; ++j ) + ns->coords[j] = FT_GET_ULONG(); /* A Fixed */ + + FT_FRAME_EXIT(); + } + } + + if ( master != NULL ) + { + FT_UInt n; + + + if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) ) + goto Exit; + FT_MEM_COPY( mmvar, face->blend->mmvar, face->blend->mmvar_len ); + + mmvar->axis = + (FT_Var_Axis*)&(mmvar[1]); + mmvar->namedstyle = + (FT_Var_Named_Style*)&(mmvar->axis[mmvar->num_axis]); + next_coords = + (FT_Fixed*)&(mmvar->namedstyle[mmvar->num_namedstyles]); + + for ( n = 0; n < mmvar->num_namedstyles; ++n ) + { + mmvar->namedstyle[n].coords = next_coords; + next_coords += mmvar->num_axis; + } + + a = mmvar->axis; + next_name = (FT_String*)next_coords; + for ( n = 0; n < mmvar->num_axis; ++n ) + { + a->name = next_name; + + /* standard PostScript names for some standard apple tags */ + if ( a->tag == TTAG_wght ) + a->name = (char *)"Weight"; + else if ( a->tag == TTAG_wdth ) + a->name = (char *)"Width"; + else if ( a->tag == TTAG_opsz ) + a->name = (char *)"OpticalSize"; + else if ( a->tag == TTAG_slnt ) + a->name = (char *)"Slant"; + + next_name += 5; + ++a; + } + + *master = mmvar; + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Set_MM_Blend */ + /* */ + /* */ + /* Set the blend (normalized) coordinates for this instance of the */ + /* font. Check that the `gvar' table is reasonable and does some */ + /* initial preparation. */ + /* */ + /* */ + /* face :: The font. */ + /* Initialize the blend structure with `gvar' data. */ + /* */ + /* */ + /* num_coords :: Must be the axis count of the font. */ + /* */ + /* coords :: An array of num_coords, each between [-1,1]. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Set_MM_Blend( TT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ) + { + FT_Error error = TT_Err_Ok; + GX_Blend blend; + FT_MM_Var* mmvar; + FT_UInt i; + FT_Memory memory = face->root.memory; + + enum + { + mcvt_retain, + mcvt_modify, + mcvt_load + + } manageCvt; + + + face->doblend = FALSE; + + if ( face->blend == NULL ) + { + if ( (error = TT_Get_MM_Var( face, NULL)) != 0 ) + goto Exit; + } + + blend = face->blend; + mmvar = blend->mmvar; + + if ( num_coords != mmvar->num_axis ) + { + error = TT_Err_Invalid_Argument; + goto Exit; + } + + for ( i = 0; i < num_coords; ++i ) + if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L ) + { + error = TT_Err_Invalid_Argument; + goto Exit; + } + + if ( blend->glyphoffsets == NULL ) + if ( (error = ft_var_load_gvar( face )) != 0 ) + goto Exit; + + if ( blend->normalizedcoords == NULL ) + { + if ( FT_NEW_ARRAY( blend->normalizedcoords, num_coords ) ) + goto Exit; + + manageCvt = mcvt_modify; + + /* If we have not set the blend coordinates before this, then the */ + /* cvt table will still be what we read from the `cvt ' table and */ + /* we don't need to reload it. We may need to change it though... */ + } + else + { + for ( i = 0; + i < num_coords && blend->normalizedcoords[i] == coords[i]; + ++i ); + if ( i == num_coords ) + manageCvt = mcvt_retain; + else + manageCvt = mcvt_load; + + /* If we don't change the blend coords then we don't need to do */ + /* anything to the cvt table. It will be correct. Otherwise we */ + /* no longer have the original cvt (it was modified when we set */ + /* the blend last time), so we must reload and then modify it. */ + } + + blend->num_axis = num_coords; + FT_MEM_COPY( blend->normalizedcoords, + coords, + num_coords * sizeof ( FT_Fixed ) ); + + face->doblend = TRUE; + + if ( face->cvt != NULL ) + { + switch ( manageCvt ) + { + case mcvt_load: + /* The cvt table has been loaded already; every time we change the */ + /* blend we may need to reload and remodify the cvt table. */ + FT_FREE( face->cvt ); + face->cvt = NULL; + + tt_face_load_cvt( face, face->root.stream ); + break; + + case mcvt_modify: + /* The original cvt table is in memory. All we need to do is */ + /* apply the `cvar' table (if any). */ + tt_face_vary_cvt( face, face->root.stream ); + break; + + case mcvt_retain: + /* The cvt table is correct for this set of coordinates. */ + break; + } + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Set_Var_Design */ + /* */ + /* */ + /* Set the coordinates for the instance, measured in the user */ + /* coordinate system. Parse the `avar' table (if present) to convert */ + /* from user to normalized coordinates. */ + /* */ + /* */ + /* face :: The font face. */ + /* Initialize the blend struct with `gvar' data. */ + /* */ + /* */ + /* num_coords :: This must be the axis count of the font. */ + /* */ + /* coords :: A coordinate array with `num_coords' elements. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Set_Var_Design( TT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ) + { + FT_Error error = TT_Err_Ok; + FT_Fixed* normalized = NULL; + GX_Blend blend; + FT_MM_Var* mmvar; + FT_UInt i, j; + FT_Var_Axis* a; + GX_AVarSegment av; + FT_Memory memory = face->root.memory; + + + if ( face->blend == NULL ) + { + if ( (error = TT_Get_MM_Var( face, NULL )) != 0 ) + goto Exit; + } + + blend = face->blend; + mmvar = blend->mmvar; + + if ( num_coords != mmvar->num_axis ) + { + error = TT_Err_Invalid_Argument; + goto Exit; + } + + /* Axis normalization is a two stage process. First we normalize */ + /* based on the [min,def,max] values for the axis to be [-1,0,1]. */ + /* Then, if there's an `avar' table, we renormalize this range. */ + + if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) ) + goto Exit; + + a = mmvar->axis; + for ( i = 0; i < mmvar->num_axis; ++i, ++a ) + { + if ( coords[i] > a->maximum || coords[i] < a->minimum ) + { + error = TT_Err_Invalid_Argument; + goto Exit; + } + + if ( coords[i] < a->def ) + { + normalized[i] = -FT_MulDiv( coords[i] - a->def, + 0x10000L, + a->minimum - a->def ); + } + else if ( a->maximum == a->def ) + normalized[i] = 0; + else + { + normalized[i] = FT_MulDiv( coords[i] - a->def, + 0x10000L, + a->maximum - a->def ); + } + } + + if ( !blend->avar_checked ) + ft_var_load_avar( face ); + + if ( blend->avar_segment != NULL ) + { + av = blend->avar_segment; + for ( i = 0; i < mmvar->num_axis; ++i, ++av ) + { + for ( j = 1; j < (FT_UInt)av->pairCount; ++j ) + if ( normalized[i] < av->correspondence[j].fromCoord ) + { + normalized[i] = + FT_MulDiv( + FT_MulDiv( + normalized[i] - av->correspondence[j - 1].fromCoord, + 0x10000L, + av->correspondence[j].fromCoord - + av->correspondence[j - 1].fromCoord ), + av->correspondence[j].toCoord - + av->correspondence[j - 1].toCoord, + 0x10000L ) + + av->correspondence[j - 1].toCoord; + break; + } + } + } + + error = TT_Set_MM_Blend( face, num_coords, normalized ); + + Exit: + FT_FREE( normalized ); + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** GX VAR PARSING ROUTINES *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_vary_cvt */ + /* */ + /* */ + /* Modify the loaded cvt table according to the `cvar' table and the */ + /* font's blend. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* Most errors are ignored. It is perfectly valid not to have a */ + /* `cvar' table even if there is a `gvar' and `fvar' table. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_vary_cvt( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + FT_Memory memory = stream->memory; + FT_ULong table_start; + FT_ULong table_len; + FT_UInt tupleCount; + FT_ULong offsetToData; + FT_ULong here; + FT_UInt i, j; + FT_Fixed* tuple_coords = NULL; + FT_Fixed* im_start_coords = NULL; + FT_Fixed* im_end_coords = NULL; + GX_Blend blend = face->blend; + FT_UInt point_count; + FT_UShort* localpoints; + FT_Short* deltas; + + + FT_TRACE2(( "CVAR " )); + + if ( blend == NULL ) + { + FT_TRACE2(( "no blend specified!\n" )); + + error = TT_Err_Ok; + goto Exit; + } + + if ( face->cvt == NULL ) + { + FT_TRACE2(( "no `cvt ' table!\n" )); + + error = TT_Err_Ok; + goto Exit; + } + + error = face->goto_table( face, TTAG_cvar, stream, &table_len ); + if ( error ) + { + FT_TRACE2(( "is missing!\n" )); + + error = TT_Err_Ok; + goto Exit; + } + + if ( FT_FRAME_ENTER( table_len ) ) + { + error = TT_Err_Ok; + goto Exit; + } + + table_start = FT_Stream_FTell( stream ); + if ( FT_GET_LONG() != 0x00010000L ) + { + FT_TRACE2(( "bad table version!\n" )); + + error = TT_Err_Ok; + goto FExit; + } + + if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) || + FT_NEW_ARRAY( im_start_coords, blend->num_axis ) || + FT_NEW_ARRAY( im_end_coords, blend->num_axis ) ) + goto FExit; + + tupleCount = FT_GET_USHORT(); + offsetToData = table_start + FT_GET_USHORT(); + + /* The documentation implies there are flags packed into the */ + /* tuplecount, but John Jenkins says that shared points don't apply */ + /* to `cvar', and no other flags are defined. */ + + for ( i = 0; i < ( tupleCount & 0xFFF ); ++i ) + { + FT_UInt tupleDataSize; + FT_UInt tupleIndex; + FT_Fixed apply; + + + tupleDataSize = FT_GET_USHORT(); + tupleIndex = FT_GET_USHORT(); + + /* There is no provision here for a global tuple coordinate section, */ + /* so John says. There are no tuple indices, just embedded tuples. */ + + if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) + { + for ( j = 0; j < blend->num_axis; ++j ) + tuple_coords[j] = FT_GET_SHORT() << 2; /* convert from */ + /* short frac to fixed */ + } + else + { + /* skip this tuple; it makes no sense */ + + if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) + for ( j = 0; j < 2 * blend->num_axis; ++j ) + (void)FT_GET_SHORT(); + + offsetToData += tupleDataSize; + continue; + } + + if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) + { + for ( j = 0; j < blend->num_axis; ++j ) + im_start_coords[j] = FT_GET_SHORT() << 2; + for ( j = 0; j < blend->num_axis; ++j ) + im_end_coords[j] = FT_GET_SHORT() << 2; + } + + apply = ft_var_apply_tuple( blend, + (FT_UShort)tupleIndex, + tuple_coords, + im_start_coords, + im_end_coords ); + if ( /* tuple isn't active for our blend */ + apply == 0 || + /* global points not allowed, */ + /* if they aren't local, makes no sense */ + !( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS ) ) + { + offsetToData += tupleDataSize; + continue; + } + + here = FT_Stream_FTell( stream ); + + FT_Stream_SeekSet( stream, offsetToData ); + + localpoints = ft_var_readpackedpoints( stream, &point_count ); + deltas = ft_var_readpackeddeltas( stream, + point_count == 0 ? face->cvt_size + : point_count ); + if ( localpoints == NULL || deltas == NULL ) + /* failure, ignore it */; + + else if ( localpoints == ALL_POINTS ) + { + /* this means that there are deltas for every entry in cvt */ + for ( j = 0; j < face->cvt_size; ++j ) + face->cvt[j] = (FT_Short)( face->cvt[j] + + FT_MulFix( deltas[j], apply ) ); + } + + else + { + for ( j = 0; j < point_count; ++j ) + { + int pindex = localpoints[j]; + + face->cvt[pindex] = (FT_Short)( face->cvt[pindex] + + FT_MulFix( deltas[j], apply ) ); + } + } + + if ( localpoints != ALL_POINTS ) + FT_FREE( localpoints ); + FT_FREE( deltas ); + + offsetToData += tupleDataSize; + + FT_Stream_SeekSet( stream, here ); + } + + FExit: + FT_FRAME_EXIT(); + + Exit: + FT_FREE( tuple_coords ); + FT_FREE( im_start_coords ); + FT_FREE( im_end_coords ); + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Vary_Get_Glyph_Deltas */ + /* */ + /* */ + /* Load the appropriate deltas for the current glyph. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* glyph_index :: The index of the glyph being modified. */ + /* */ + /* n_points :: The number of the points in the glyph, including */ + /* phantom points. */ + /* */ + /* */ + /* deltas :: The array of points to change. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Vary_Get_Glyph_Deltas( TT_Face face, + FT_UInt glyph_index, + FT_Vector* *deltas, + FT_UInt n_points ) + { + FT_Stream stream = face->root.stream; + FT_Memory memory = stream->memory; + GX_Blend blend = face->blend; + FT_Vector* delta_xy; + + FT_Error error; + FT_ULong glyph_start; + FT_UInt tupleCount; + FT_ULong offsetToData; + FT_ULong here; + FT_UInt i, j; + FT_Fixed* tuple_coords = NULL; + FT_Fixed* im_start_coords = NULL; + FT_Fixed* im_end_coords = NULL; + FT_UInt point_count, spoint_count = 0; + FT_UShort* sharedpoints = NULL; + FT_UShort* localpoints = NULL; + FT_UShort* points; + FT_Short *deltas_x, *deltas_y; + + + if ( !face->doblend || blend == NULL ) + return TT_Err_Invalid_Argument; + + /* to be freed by the caller */ + if ( FT_NEW_ARRAY( delta_xy, n_points ) ) + goto Exit; + *deltas = delta_xy; + + if ( glyph_index >= blend->gv_glyphcnt || + blend->glyphoffsets[glyph_index] == + blend->glyphoffsets[glyph_index + 1] ) + return TT_Err_Ok; /* no variation data for this glyph */ + + if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] ) || + FT_FRAME_ENTER( blend->glyphoffsets[glyph_index + 1] - + blend->glyphoffsets[glyph_index] ) ) + goto Fail1; + + glyph_start = FT_Stream_FTell( stream ); + + /* each set of glyph variation data is formatted similarly to `cvar' */ + /* (except we get shared points and global tuples) */ + + if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) || + FT_NEW_ARRAY( im_start_coords, blend->num_axis ) || + FT_NEW_ARRAY( im_end_coords, blend->num_axis ) ) + goto Fail2; + + tupleCount = FT_GET_USHORT(); + offsetToData = glyph_start + FT_GET_USHORT(); + + if ( tupleCount & GX_TC_TUPLES_SHARE_POINT_NUMBERS ) + { + here = FT_Stream_FTell( stream ); + + FT_Stream_SeekSet( stream, offsetToData ); + + sharedpoints = ft_var_readpackedpoints( stream, &spoint_count ); + offsetToData = FT_Stream_FTell( stream ); + + FT_Stream_SeekSet( stream, here ); + } + + for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); ++i ) + { + FT_UInt tupleDataSize; + FT_UInt tupleIndex; + FT_Fixed apply; + + + tupleDataSize = FT_GET_USHORT(); + tupleIndex = FT_GET_USHORT(); + + if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) + { + for ( j = 0; j < blend->num_axis; ++j ) + tuple_coords[j] = FT_GET_SHORT() << 2; /* convert from */ + /* short frac to fixed */ + } + else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) + { + error = TT_Err_Invalid_Table; + goto Fail3; + } + else + { + FT_MEM_COPY( + tuple_coords, + &blend->tuplecoords[(tupleIndex & 0xFFF) * blend->num_axis], + blend->num_axis * sizeof ( FT_Fixed ) ); + } + + if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) + { + for ( j = 0; j < blend->num_axis; ++j ) + im_start_coords[j] = FT_GET_SHORT() << 2; + for ( j = 0; j < blend->num_axis; ++j ) + im_end_coords[j] = FT_GET_SHORT() << 2; + } + + apply = ft_var_apply_tuple( blend, + (FT_UShort)tupleIndex, + tuple_coords, + im_start_coords, + im_end_coords ); + + if ( apply == 0 ) /* tuple isn't active for our blend */ + { + offsetToData += tupleDataSize; + continue; + } + + here = FT_Stream_FTell( stream ); + + if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS ) + { + FT_Stream_SeekSet( stream, offsetToData ); + + localpoints = ft_var_readpackedpoints( stream, &point_count ); + points = localpoints; + } + else + { + points = sharedpoints; + point_count = spoint_count; + } + + deltas_x = ft_var_readpackeddeltas( stream, + point_count == 0 ? n_points + : point_count ); + deltas_y = ft_var_readpackeddeltas( stream, + point_count == 0 ? n_points + : point_count ); + + if ( points == NULL || deltas_y == NULL || deltas_x == NULL ) + ; /* failure, ignore it */ + + else if ( points == ALL_POINTS ) + { + /* this means that there are deltas for every point in the glyph */ + for ( j = 0; j < n_points; ++j ) + { + delta_xy[j].x += FT_MulFix( deltas_x[j], apply ); + delta_xy[j].y += FT_MulFix( deltas_y[j], apply ); + } + } + + else + { + for ( j = 0; j < point_count; ++j ) + { + delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply ); + delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply ); + } + } + + if ( localpoints != ALL_POINTS ) + FT_FREE( localpoints ); + FT_FREE( deltas_x ); + FT_FREE( deltas_y ); + + offsetToData += tupleDataSize; + + FT_Stream_SeekSet( stream, here ); + } + + Fail3: + FT_FREE( tuple_coords ); + FT_FREE( im_start_coords ); + FT_FREE( im_end_coords ); + + Fail2: + FT_FRAME_EXIT(); + + Fail1: + if ( error ) + { + FT_FREE( delta_xy ); + *deltas = NULL; + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_done_blend */ + /* */ + /* */ + /* Frees the blend internal data structure. */ + /* */ + FT_LOCAL_DEF( void ) + tt_done_blend( FT_Memory memory, + GX_Blend blend ) + { + if ( blend != NULL ) + { + FT_UInt i; + + + FT_FREE( blend->normalizedcoords ); + FT_FREE( blend->mmvar ); + + if ( blend->avar_segment != NULL ) + { + for ( i = 0; i < blend->num_axis; ++i ) + FT_FREE( blend->avar_segment[i].correspondence ); + FT_FREE( blend->avar_segment ); + } + + FT_FREE( blend->tuplecoords ); + FT_FREE( blend->glyphoffsets ); + FT_FREE( blend ); + } + } + +#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.h b/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.h index 706cb4d369b..710ee444022 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.h +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttgxvar.h @@ -1,182 +1,182 @@ -/***************************************************************************/ -/* */ -/* ttgxvar.h */ -/* */ -/* TrueType GX Font Variation loader (specification) */ -/* */ -/* Copyright 2004 by */ -/* David Turner, Robert Wilhelm, Werner Lemberg and George Williams. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTGXVAR_H__ -#define __TTGXVAR_H__ - - -#include -#include "ttobjs.h" - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* */ - /* GX_AVarCorrespondenceRec */ - /* */ - /* */ - /* A data structure representing `shortFracCorrespondence' in `avar' */ - /* table according to the specifications from Apple. */ - /* */ - typedef struct GX_AVarCorrespondenceRec_ - { - FT_Fixed fromCoord; - FT_Fixed toCoord; - - } GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence; - - - /*************************************************************************/ - /* */ - /* */ - /* GX_AVarRec */ - /* */ - /* */ - /* Data from the segment field of `avar' table. */ - /* There is one of these for each axis. */ - /* */ - typedef struct GX_AVarSegmentRec_ - { - FT_UShort pairCount; - GX_AVarCorrespondence correspondence; /* array with pairCount entries */ - - } GX_AVarSegmentRec, *GX_AVarSegment; - - - /*************************************************************************/ - /* */ - /* */ - /* GX_BlendRec */ - /* */ - /* */ - /* Data for interpolating a font from a distortable font specified */ - /* by the GX *var tables ([fgca]var). */ - /* */ - /* */ - /* num_axis :: The number of axes along which interpolation */ - /* may happen */ - /* */ - /* normalizedcoords :: A normalized value (between [-1,1]) indicating */ - /* the contribution along each axis to the final */ - /* interpolated font. */ - /* */ - typedef struct GX_BlendRec_ - { - FT_UInt num_axis; - FT_Fixed* normalizedcoords; - - FT_MM_Var* mmvar; - FT_Int mmvar_len; - - FT_Bool avar_checked; - GX_AVarSegment avar_segment; - - FT_UInt tuplecount; /* shared tuples in `gvar' */ - FT_Fixed* tuplecoords; /* tuplecoords[tuplecount][num_axis] */ - - FT_UInt gv_glyphcnt; - FT_ULong* glyphoffsets; - - } GX_BlendRec; - - - /*************************************************************************/ - /* */ - /* */ - /* GX_TupleCountFlags */ - /* */ - /* */ - /* Flags used within the `TupleCount' field of the `gvar' table. */ - /* */ - typedef enum GX_TupleCountFlags_ - { - GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000, - GX_TC_RESERVED_TUPLE_FLAGS = 0x7000, - GX_TC_TUPLE_COUNT_MASK = 0x0FFF - - } GX_TupleCountFlags; - - - /*************************************************************************/ - /* */ - /* */ - /* GX_TupleIndexFlags */ - /* */ - /* */ - /* Flags used within the `TupleIndex' field of the `gvar' and `cvar' */ - /* tables. */ - /* */ - typedef enum GX_TupleIndexFlags_ - { - GX_TI_EMBEDDED_TUPLE_COORD = 0x8000, - GX_TI_INTERMEDIATE_TUPLE = 0x4000, - GX_TI_PRIVATE_POINT_NUMBERS = 0x2000, - GX_TI_RESERVED_TUPLE_FLAG = 0x1000, - GX_TI_TUPLE_INDEX_MASK = 0x0FFF - - } GX_TupleIndexFlags; - - -#define TTAG_wght FT_MAKE_TAG( 'w', 'g', 'h', 't' ) -#define TTAG_wdth FT_MAKE_TAG( 'w', 'd', 't', 'h' ) -#define TTAG_opsz FT_MAKE_TAG( 'o', 'p', 's', 'z' ) -#define TTAG_slnt FT_MAKE_TAG( 's', 'l', 'n', 't' ) - - - FT_LOCAL( FT_Error ) - TT_Set_MM_Blend( TT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - FT_LOCAL( FT_Error ) - TT_Set_Var_Design( TT_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - FT_LOCAL( FT_Error ) - TT_Get_MM_Var( TT_Face face, - FT_MM_Var* *master ); - - - FT_LOCAL( FT_Error ) - tt_face_vary_cvt( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - TT_Vary_Get_Glyph_Deltas( TT_Face face, - FT_UInt glyph_index, - FT_Vector* *deltas, - FT_UInt n_points ); - - - FT_LOCAL( void ) - tt_done_blend( FT_Memory memory, - GX_Blend blend ); - - -FT_END_HEADER - - -#endif /* __TTGXVAR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttgxvar.h */ +/* */ +/* TrueType GX Font Variation loader (specification) */ +/* */ +/* Copyright 2004 by */ +/* David Turner, Robert Wilhelm, Werner Lemberg and George Williams. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTGXVAR_H__ +#define __TTGXVAR_H__ + + +#include +#include "ttobjs.h" + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* */ + /* GX_AVarCorrespondenceRec */ + /* */ + /* */ + /* A data structure representing `shortFracCorrespondence' in `avar' */ + /* table according to the specifications from Apple. */ + /* */ + typedef struct GX_AVarCorrespondenceRec_ + { + FT_Fixed fromCoord; + FT_Fixed toCoord; + + } GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence; + + + /*************************************************************************/ + /* */ + /* */ + /* GX_AVarRec */ + /* */ + /* */ + /* Data from the segment field of `avar' table. */ + /* There is one of these for each axis. */ + /* */ + typedef struct GX_AVarSegmentRec_ + { + FT_UShort pairCount; + GX_AVarCorrespondence correspondence; /* array with pairCount entries */ + + } GX_AVarSegmentRec, *GX_AVarSegment; + + + /*************************************************************************/ + /* */ + /* */ + /* GX_BlendRec */ + /* */ + /* */ + /* Data for interpolating a font from a distortable font specified */ + /* by the GX *var tables ([fgca]var). */ + /* */ + /* */ + /* num_axis :: The number of axes along which interpolation */ + /* may happen */ + /* */ + /* normalizedcoords :: A normalized value (between [-1,1]) indicating */ + /* the contribution along each axis to the final */ + /* interpolated font. */ + /* */ + typedef struct GX_BlendRec_ + { + FT_UInt num_axis; + FT_Fixed* normalizedcoords; + + FT_MM_Var* mmvar; + FT_Int mmvar_len; + + FT_Bool avar_checked; + GX_AVarSegment avar_segment; + + FT_UInt tuplecount; /* shared tuples in `gvar' */ + FT_Fixed* tuplecoords; /* tuplecoords[tuplecount][num_axis] */ + + FT_UInt gv_glyphcnt; + FT_ULong* glyphoffsets; + + } GX_BlendRec; + + + /*************************************************************************/ + /* */ + /* */ + /* GX_TupleCountFlags */ + /* */ + /* */ + /* Flags used within the `TupleCount' field of the `gvar' table. */ + /* */ + typedef enum GX_TupleCountFlags_ + { + GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000, + GX_TC_RESERVED_TUPLE_FLAGS = 0x7000, + GX_TC_TUPLE_COUNT_MASK = 0x0FFF + + } GX_TupleCountFlags; + + + /*************************************************************************/ + /* */ + /* */ + /* GX_TupleIndexFlags */ + /* */ + /* */ + /* Flags used within the `TupleIndex' field of the `gvar' and `cvar' */ + /* tables. */ + /* */ + typedef enum GX_TupleIndexFlags_ + { + GX_TI_EMBEDDED_TUPLE_COORD = 0x8000, + GX_TI_INTERMEDIATE_TUPLE = 0x4000, + GX_TI_PRIVATE_POINT_NUMBERS = 0x2000, + GX_TI_RESERVED_TUPLE_FLAG = 0x1000, + GX_TI_TUPLE_INDEX_MASK = 0x0FFF + + } GX_TupleIndexFlags; + + +#define TTAG_wght FT_MAKE_TAG( 'w', 'g', 'h', 't' ) +#define TTAG_wdth FT_MAKE_TAG( 'w', 'd', 't', 'h' ) +#define TTAG_opsz FT_MAKE_TAG( 'o', 'p', 's', 'z' ) +#define TTAG_slnt FT_MAKE_TAG( 's', 'l', 'n', 't' ) + + + FT_LOCAL( FT_Error ) + TT_Set_MM_Blend( TT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); + + FT_LOCAL( FT_Error ) + TT_Set_Var_Design( TT_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); + + FT_LOCAL( FT_Error ) + TT_Get_MM_Var( TT_Face face, + FT_MM_Var* *master ); + + + FT_LOCAL( FT_Error ) + tt_face_vary_cvt( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + TT_Vary_Get_Glyph_Deltas( TT_Face face, + FT_UInt glyph_index, + FT_Vector* *deltas, + FT_UInt n_points ); + + + FT_LOCAL( void ) + tt_done_blend( FT_Memory memory, + GX_Blend blend ); + + +FT_END_HEADER + + +#endif /* __TTGXVAR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.c b/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.c index 85c8529ac73..78488f269e5 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.c +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.c @@ -1,7809 +1,7809 @@ -/***************************************************************************/ -/* */ -/* ttinterp.c */ -/* */ -/* TrueType bytecode interpreter (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_TRIGONOMETRY_H -#include FT_SYSTEM_H - -#include "ttinterp.h" - -#include "tterrors.h" - - -#ifdef TT_USE_BYTECODE_INTERPRETER - - -#define TT_MULFIX FT_MulFix -#define TT_MULDIV FT_MulDiv -#define TT_MULDIV_NO_ROUND FT_MulDiv_No_Round - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttinterp - - /*************************************************************************/ - /* */ - /* In order to detect infinite loops in the code, we set up a counter */ - /* within the run loop. A single stroke of interpretation is now */ - /* limited to a maximal number of opcodes defined below. */ - /* */ -#define MAX_RUNNABLE_OPCODES 1000000L - - - /*************************************************************************/ - /* */ - /* There are two kinds of implementations: */ - /* */ - /* a. static implementation */ - /* */ - /* The current execution context is a static variable, which fields */ - /* are accessed directly by the interpreter during execution. The */ - /* context is named `cur'. */ - /* */ - /* This version is non-reentrant, of course. */ - /* */ - /* b. indirect implementation */ - /* */ - /* The current execution context is passed to _each_ function as its */ - /* first argument, and each field is thus accessed indirectly. */ - /* */ - /* This version is fully re-entrant. */ - /* */ - /* The idea is that an indirect implementation may be slower to execute */ - /* on low-end processors that are used in some systems (like 386s or */ - /* even 486s). */ - /* */ - /* As a consequence, the indirect implementation is now the default, as */ - /* its performance costs can be considered negligible in our context. */ - /* Note, however, that we kept the same source with macros because: */ - /* */ - /* - The code is kept very close in design to the Pascal code used for */ - /* development. */ - /* */ - /* - It's much more readable that way! */ - /* */ - /* - It's still open to experimentation and tuning. */ - /* */ - /*************************************************************************/ - - -#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */ - -#define CUR (*exc) /* see ttobjs.h */ - - /*************************************************************************/ - /* */ - /* This macro is used whenever `exec' is unused in a function, to avoid */ - /* stupid warnings from pedantic compilers. */ - /* */ -#define FT_UNUSED_EXEC FT_UNUSED( exc ) - -#else /* static implementation */ - -#define CUR cur - -#define FT_UNUSED_EXEC int __dummy = __dummy - - static - TT_ExecContextRec cur; /* static exec. context variable */ - - /* apparently, we have a _lot_ of direct indexing when accessing */ - /* the static `cur', which makes the code bigger (due to all the */ - /* four bytes addresses). */ - -#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */ - - - /*************************************************************************/ - /* */ - /* The instruction argument stack. */ - /* */ -#define INS_ARG EXEC_OP_ FT_Long* args /* see ttobjs.h for EXEC_OP_ */ - - - /*************************************************************************/ - /* */ - /* This macro is used whenever `args' is unused in a function, to avoid */ - /* stupid warnings from pedantic compilers. */ - /* */ -#define FT_UNUSED_ARG FT_UNUSED_EXEC; FT_UNUSED( args ) - - - /*************************************************************************/ - /* */ - /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to */ - /* increase readability of the code. */ - /* */ - /*************************************************************************/ - - -#define SKIP_Code() \ - SkipCode( EXEC_ARG ) - -#define GET_ShortIns() \ - GetShortIns( EXEC_ARG ) - -#define NORMalize( x, y, v ) \ - Normalize( EXEC_ARG_ x, y, v ) - -#define SET_SuperRound( scale, flags ) \ - SetSuperRound( EXEC_ARG_ scale, flags ) - -#define ROUND_None( d, c ) \ - Round_None( EXEC_ARG_ d, c ) - -#define INS_Goto_CodeRange( range, ip ) \ - Ins_Goto_CodeRange( EXEC_ARG_ range, ip ) - -#define CUR_Func_move( z, p, d ) \ - CUR.func_move( EXEC_ARG_ z, p, d ) - -#define CUR_Func_move_orig( z, p, d ) \ - CUR.func_move_orig( EXEC_ARG_ z, p, d ) - -#define CUR_Func_round( d, c ) \ - CUR.func_round( EXEC_ARG_ d, c ) - -#define CUR_Func_read_cvt( index ) \ - CUR.func_read_cvt( EXEC_ARG_ index ) - -#define CUR_Func_write_cvt( index, val ) \ - CUR.func_write_cvt( EXEC_ARG_ index, val ) - -#define CUR_Func_move_cvt( index, val ) \ - CUR.func_move_cvt( EXEC_ARG_ index, val ) - -#define CURRENT_Ratio() \ - Current_Ratio( EXEC_ARG ) - -#define CURRENT_Ppem() \ - Current_Ppem( EXEC_ARG ) - -#define CUR_Ppem() \ - Cur_PPEM( EXEC_ARG ) - -#define INS_SxVTL( a, b, c, d ) \ - Ins_SxVTL( EXEC_ARG_ a, b, c, d ) - -#define COMPUTE_Funcs() \ - Compute_Funcs( EXEC_ARG ) - -#define COMPUTE_Round( a ) \ - Compute_Round( EXEC_ARG_ a ) - -#define COMPUTE_Point_Displacement( a, b, c, d ) \ - Compute_Point_Displacement( EXEC_ARG_ a, b, c, d ) - -#define MOVE_Zp2_Point( a, b, c, t ) \ - Move_Zp2_Point( EXEC_ARG_ a, b, c, t ) - - -#define CUR_Func_project( v1, v2 ) \ - CUR.func_project( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y ) - -#define CUR_Func_dualproj( v1, v2 ) \ - CUR.func_dualproj( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y ) - -#define CUR_fast_project( v ) \ - CUR.func_project( EXEC_ARG_ (v)->x, (v)->y ) - -#define CUR_fast_dualproj( v ) \ - CUR.func_dualproj( EXEC_ARG_ (v)->x, (v)->y ) - - - /*************************************************************************/ - /* */ - /* Instruction dispatch function, as used by the interpreter. */ - /* */ - typedef void (*TInstruction_Function)( INS_ARG ); - - - /*************************************************************************/ - /* */ - /* A simple bounds-checking macro. */ - /* */ -#define BOUNDS( x, n ) ( (FT_UInt)(x) >= (FT_UInt)(n) ) - -#undef SUCCESS -#define SUCCESS 0 - -#undef FAILURE -#define FAILURE 1 - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING -#define GUESS_VECTOR( V ) \ - if ( CUR.face->unpatented_hinting ) \ - { \ - CUR.GS.V.x = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0x4000 : 0 ); \ - CUR.GS.V.y = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0 : 0x4000 ); \ - } -#else -#define GUESS_VECTOR( V ) -#endif - - /*************************************************************************/ - /* */ - /* CODERANGE FUNCTIONS */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Goto_CodeRange */ - /* */ - /* */ - /* Switches to a new code range (updates the code related elements in */ - /* `exec', and `IP'). */ - /* */ - /* */ - /* range :: The new execution code range. */ - /* */ - /* IP :: The new IP in the new code range. */ - /* */ - /* */ - /* exec :: The target execution context. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Goto_CodeRange( TT_ExecContext exec, - FT_Int range, - FT_Long IP ) - { - TT_CodeRange* coderange; - - - FT_ASSERT( range >= 1 && range <= 3 ); - - coderange = &exec->codeRangeTable[range - 1]; - - FT_ASSERT( coderange->base != NULL ); - - /* NOTE: Because the last instruction of a program may be a CALL */ - /* which will return to the first byte *after* the code */ - /* range, we test for IP <= Size instead of IP < Size. */ - /* */ - FT_ASSERT( (FT_ULong)IP <= coderange->size ); - - exec->code = coderange->base; - exec->codeSize = coderange->size; - exec->IP = IP; - exec->curRange = range; - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Set_CodeRange */ - /* */ - /* */ - /* Sets a code range. */ - /* */ - /* */ - /* range :: The code range index. */ - /* */ - /* base :: The new code base. */ - /* */ - /* length :: The range size in bytes. */ - /* */ - /* */ - /* exec :: The target execution context. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Set_CodeRange( TT_ExecContext exec, - FT_Int range, - void* base, - FT_Long length ) - { - FT_ASSERT( range >= 1 && range <= 3 ); - - exec->codeRangeTable[range - 1].base = (FT_Byte*)base; - exec->codeRangeTable[range - 1].size = length; - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Clear_CodeRange */ - /* */ - /* */ - /* Clears a code range. */ - /* */ - /* */ - /* range :: The code range index. */ - /* */ - /* */ - /* exec :: The target execution context. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Does not set the Error variable. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Clear_CodeRange( TT_ExecContext exec, - FT_Int range ) - { - FT_ASSERT( range >= 1 && range <= 3 ); - - exec->codeRangeTable[range - 1].base = NULL; - exec->codeRangeTable[range - 1].size = 0; - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* EXECUTION CONTEXT ROUTINES */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Done_Context */ - /* */ - /* */ - /* Destroys a given context. */ - /* */ - /* */ - /* exec :: A handle to the target execution context. */ - /* */ - /* memory :: A handle to the parent memory object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only the glyph loader and debugger should call this function. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Done_Context( TT_ExecContext exec ) - { - FT_Memory memory = exec->memory; - - - /* points zone */ - exec->maxPoints = 0; - exec->maxContours = 0; - - /* free stack */ - FT_FREE( exec->stack ); - exec->stackSize = 0; - - /* free call stack */ - FT_FREE( exec->callStack ); - exec->callSize = 0; - exec->callTop = 0; - - /* free glyph code range */ - FT_FREE( exec->glyphIns ); - exec->glyphSize = 0; - - exec->size = NULL; - exec->face = NULL; - - FT_FREE( exec ); - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Init_Context */ - /* */ - /* */ - /* Initializes a context object. */ - /* */ - /* */ - /* memory :: A handle to the parent memory object. */ - /* */ - /* */ - /* exec :: A handle to the target execution context. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Init_Context( TT_ExecContext exec, - FT_Memory memory ) - { - FT_Error error; - - - FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec )); - - exec->memory = memory; - exec->callSize = 32; - - if ( FT_NEW_ARRAY( exec->callStack, exec->callSize ) ) - goto Fail_Memory; - - /* all values in the context are set to 0 already, but this is */ - /* here as a remainder */ - exec->maxPoints = 0; - exec->maxContours = 0; - - exec->stackSize = 0; - exec->glyphSize = 0; - - exec->stack = NULL; - exec->glyphIns = NULL; - - exec->face = NULL; - exec->size = NULL; - - return TT_Err_Ok; - - Fail_Memory: - FT_ERROR(( "Init_Context: not enough memory for 0x%08lx\n", - (FT_Long)exec )); - TT_Done_Context( exec ); - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Update_Max */ - /* */ - /* */ - /* Checks the size of a buffer and reallocates it if necessary. */ - /* */ - /* */ - /* memory :: A handle to the parent memory object. */ - /* */ - /* multiplier :: The size in bytes of each element in the buffer. */ - /* */ - /* new_max :: The new capacity (size) of the buffer. */ - /* */ - /* */ - /* size :: The address of the buffer's current size expressed */ - /* in elements. */ - /* */ - /* buff :: The address of the buffer base pointer. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - static FT_Error - Update_Max( FT_Memory memory, - FT_ULong* size, - FT_Long multiplier, - void* _pbuff, - FT_ULong new_max ) - { - FT_Error error; - void** pbuff = (void**)_pbuff; - - - if ( *size < new_max ) - { - if ( FT_REALLOC( *pbuff, *size * multiplier, new_max * multiplier ) ) - return error; - *size = new_max; - } - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Load_Context */ - /* */ - /* */ - /* Prepare an execution context for glyph hinting. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* size :: A handle to the source size object. */ - /* */ - /* */ - /* exec :: A handle to the target execution context. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only the glyph loader and debugger should call this function. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Load_Context( TT_ExecContext exec, - TT_Face face, - TT_Size size ) - { - FT_Int i; - FT_ULong tmp; - TT_MaxProfile* maxp; - FT_Error error; - - - exec->face = face; - maxp = &face->max_profile; - exec->size = size; - - if ( size ) - { - exec->numFDefs = size->num_function_defs; - exec->maxFDefs = size->max_function_defs; - exec->numIDefs = size->num_instruction_defs; - exec->maxIDefs = size->max_instruction_defs; - exec->FDefs = size->function_defs; - exec->IDefs = size->instruction_defs; - exec->tt_metrics = size->ttmetrics; - exec->metrics = size->metrics; - - exec->maxFunc = size->max_func; - exec->maxIns = size->max_ins; - - for ( i = 0; i < TT_MAX_CODE_RANGES; i++ ) - exec->codeRangeTable[i] = size->codeRangeTable[i]; - - /* set graphics state */ - exec->GS = size->GS; - - exec->cvtSize = size->cvt_size; - exec->cvt = size->cvt; - - exec->storeSize = size->storage_size; - exec->storage = size->storage; - - exec->twilight = size->twilight; - } - - /* XXX: We reserve a little more elements on the stack to deal safely */ - /* with broken fonts like arialbs, courbs, timesbs, etc. */ - tmp = exec->stackSize; - error = Update_Max( exec->memory, - &tmp, - sizeof ( FT_F26Dot6 ), - (void*)&exec->stack, - maxp->maxStackElements + 32 ); - exec->stackSize = (FT_UInt)tmp; - if ( error ) - return error; - - tmp = exec->glyphSize; - error = Update_Max( exec->memory, - &tmp, - sizeof ( FT_Byte ), - (void*)&exec->glyphIns, - maxp->maxSizeOfInstructions ); - exec->glyphSize = (FT_UShort)tmp; - if ( error ) - return error; - - exec->pts.n_points = 0; - exec->pts.n_contours = 0; - - exec->zp1 = exec->pts; - exec->zp2 = exec->pts; - exec->zp0 = exec->pts; - - exec->instruction_trap = FALSE; - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Save_Context */ - /* */ - /* */ - /* Saves the code ranges in a `size' object. */ - /* */ - /* */ - /* exec :: A handle to the source execution context. */ - /* */ - /* */ - /* size :: A handle to the target size object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only the glyph loader and debugger should call this function. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Save_Context( TT_ExecContext exec, - TT_Size size ) - { - FT_Int i; - - - /* XXXX: Will probably disappear soon with all the code range */ - /* management, which is now rather obsolete. */ - /* */ - size->num_function_defs = exec->numFDefs; - size->num_instruction_defs = exec->numIDefs; - - size->max_func = exec->maxFunc; - size->max_ins = exec->maxIns; - - for ( i = 0; i < TT_MAX_CODE_RANGES; i++ ) - size->codeRangeTable[i] = exec->codeRangeTable[i]; - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Run_Context */ - /* */ - /* */ - /* Executes one or more instructions in the execution context. */ - /* */ - /* */ - /* debug :: A Boolean flag. If set, the function sets some internal */ - /* variables and returns immediately, otherwise TT_RunIns() */ - /* is called. */ - /* */ - /* This is commented out currently. */ - /* */ - /* */ - /* exec :: A handle to the target execution context. */ - /* */ - /* */ - /* TrueTyoe error code. 0 means success. */ - /* */ - /* */ - /* Only the glyph loader and debugger should call this function. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - TT_Run_Context( TT_ExecContext exec, - FT_Bool debug ) - { - FT_Error error; - - - if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) ) - != TT_Err_Ok ) - return error; - - exec->zp0 = exec->pts; - exec->zp1 = exec->pts; - exec->zp2 = exec->pts; - - exec->GS.gep0 = 1; - exec->GS.gep1 = 1; - exec->GS.gep2 = 1; - - exec->GS.projVector.x = 0x4000; - exec->GS.projVector.y = 0x0000; - - exec->GS.freeVector = exec->GS.projVector; - exec->GS.dualVector = exec->GS.projVector; - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - exec->GS.both_x_axis = TRUE; -#endif - - exec->GS.round_state = 1; - exec->GS.loop = 1; - - /* some glyphs leave something on the stack. so we clean it */ - /* before a new execution. */ - exec->top = 0; - exec->callTop = 0; - -#if 1 - FT_UNUSED( debug ); - - return exec->face->interpreter( exec ); -#else - if ( !debug ) - return TT_RunIns( exec ); - else - return TT_Err_Ok; -#endif - } - - - const TT_GraphicsState tt_default_graphics_state = - { - 0, 0, 0, - { 0x4000, 0 }, - { 0x4000, 0 }, - { 0x4000, 0 }, - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - TRUE, -#endif - - 1, 64, 1, - TRUE, 68, 0, 0, 9, 3, - 0, FALSE, 2, 1, 1, 1 - }; - - - /* documentation is in ttinterp.h */ - - FT_EXPORT_DEF( TT_ExecContext ) - TT_New_Context( TT_Driver driver ) - { - TT_ExecContext exec; - FT_Memory memory; - - - memory = driver->root.root.memory; - exec = driver->context; - - if ( !driver->context ) - { - FT_Error error; - - - /* allocate object */ - if ( FT_NEW( exec ) ) - goto Exit; - - /* initialize it */ - error = Init_Context( exec, memory ); - if ( error ) - goto Fail; - - /* store it into the driver */ - driver->context = exec; - } - - Exit: - return driver->context; - - Fail: - FT_FREE( exec ); - - return 0; - } - - - /*************************************************************************/ - /* */ - /* Before an opcode is executed, the interpreter verifies that there are */ - /* enough arguments on the stack, with the help of the `Pop_Push_Count' */ - /* table. */ - /* */ - /* For each opcode, the first column gives the number of arguments that */ - /* are popped from the stack; the second one gives the number of those */ - /* that are pushed in result. */ - /* */ - /* Opcodes which have a varying number of parameters in the data stream */ - /* (NPUSHB, NPUSHW) are handled specially; they have a negative value in */ - /* the `opcode_length' table, and the value in `Pop_Push_Count' is set */ - /* to zero. */ - /* */ - /*************************************************************************/ - - -#undef PACK -#define PACK( x, y ) ( ( x << 4 ) | y ) - - - static - const FT_Byte Pop_Push_Count[256] = - { - /* opcodes are gathered in groups of 16 */ - /* please keep the spaces as they are */ - - /* SVTCA y */ PACK( 0, 0 ), - /* SVTCA x */ PACK( 0, 0 ), - /* SPvTCA y */ PACK( 0, 0 ), - /* SPvTCA x */ PACK( 0, 0 ), - /* SFvTCA y */ PACK( 0, 0 ), - /* SFvTCA x */ PACK( 0, 0 ), - /* SPvTL // */ PACK( 2, 0 ), - /* SPvTL + */ PACK( 2, 0 ), - /* SFvTL // */ PACK( 2, 0 ), - /* SFvTL + */ PACK( 2, 0 ), - /* SPvFS */ PACK( 2, 0 ), - /* SFvFS */ PACK( 2, 0 ), - /* GPV */ PACK( 0, 2 ), - /* GFV */ PACK( 0, 2 ), - /* SFvTPv */ PACK( 0, 0 ), - /* ISECT */ PACK( 5, 0 ), - - /* SRP0 */ PACK( 1, 0 ), - /* SRP1 */ PACK( 1, 0 ), - /* SRP2 */ PACK( 1, 0 ), - /* SZP0 */ PACK( 1, 0 ), - /* SZP1 */ PACK( 1, 0 ), - /* SZP2 */ PACK( 1, 0 ), - /* SZPS */ PACK( 1, 0 ), - /* SLOOP */ PACK( 1, 0 ), - /* RTG */ PACK( 0, 0 ), - /* RTHG */ PACK( 0, 0 ), - /* SMD */ PACK( 1, 0 ), - /* ELSE */ PACK( 0, 0 ), - /* JMPR */ PACK( 1, 0 ), - /* SCvTCi */ PACK( 1, 0 ), - /* SSwCi */ PACK( 1, 0 ), - /* SSW */ PACK( 1, 0 ), - - /* DUP */ PACK( 1, 2 ), - /* POP */ PACK( 1, 0 ), - /* CLEAR */ PACK( 0, 0 ), - /* SWAP */ PACK( 2, 2 ), - /* DEPTH */ PACK( 0, 1 ), - /* CINDEX */ PACK( 1, 1 ), - /* MINDEX */ PACK( 1, 0 ), - /* AlignPTS */ PACK( 2, 0 ), - /* INS_$28 */ PACK( 0, 0 ), - /* UTP */ PACK( 1, 0 ), - /* LOOPCALL */ PACK( 2, 0 ), - /* CALL */ PACK( 1, 0 ), - /* FDEF */ PACK( 1, 0 ), - /* ENDF */ PACK( 0, 0 ), - /* MDAP[0] */ PACK( 1, 0 ), - /* MDAP[1] */ PACK( 1, 0 ), - - /* IUP[0] */ PACK( 0, 0 ), - /* IUP[1] */ PACK( 0, 0 ), - /* SHP[0] */ PACK( 0, 0 ), - /* SHP[1] */ PACK( 0, 0 ), - /* SHC[0] */ PACK( 1, 0 ), - /* SHC[1] */ PACK( 1, 0 ), - /* SHZ[0] */ PACK( 1, 0 ), - /* SHZ[1] */ PACK( 1, 0 ), - /* SHPIX */ PACK( 1, 0 ), - /* IP */ PACK( 0, 0 ), - /* MSIRP[0] */ PACK( 2, 0 ), - /* MSIRP[1] */ PACK( 2, 0 ), - /* AlignRP */ PACK( 0, 0 ), - /* RTDG */ PACK( 0, 0 ), - /* MIAP[0] */ PACK( 2, 0 ), - /* MIAP[1] */ PACK( 2, 0 ), - - /* NPushB */ PACK( 0, 0 ), - /* NPushW */ PACK( 0, 0 ), - /* WS */ PACK( 2, 0 ), - /* RS */ PACK( 1, 1 ), - /* WCvtP */ PACK( 2, 0 ), - /* RCvt */ PACK( 1, 1 ), - /* GC[0] */ PACK( 1, 1 ), - /* GC[1] */ PACK( 1, 1 ), - /* SCFS */ PACK( 2, 0 ), - /* MD[0] */ PACK( 2, 1 ), - /* MD[1] */ PACK( 2, 1 ), - /* MPPEM */ PACK( 0, 1 ), - /* MPS */ PACK( 0, 1 ), - /* FlipON */ PACK( 0, 0 ), - /* FlipOFF */ PACK( 0, 0 ), - /* DEBUG */ PACK( 1, 0 ), - - /* LT */ PACK( 2, 1 ), - /* LTEQ */ PACK( 2, 1 ), - /* GT */ PACK( 2, 1 ), - /* GTEQ */ PACK( 2, 1 ), - /* EQ */ PACK( 2, 1 ), - /* NEQ */ PACK( 2, 1 ), - /* ODD */ PACK( 1, 1 ), - /* EVEN */ PACK( 1, 1 ), - /* IF */ PACK( 1, 0 ), - /* EIF */ PACK( 0, 0 ), - /* AND */ PACK( 2, 1 ), - /* OR */ PACK( 2, 1 ), - /* NOT */ PACK( 1, 1 ), - /* DeltaP1 */ PACK( 1, 0 ), - /* SDB */ PACK( 1, 0 ), - /* SDS */ PACK( 1, 0 ), - - /* ADD */ PACK( 2, 1 ), - /* SUB */ PACK( 2, 1 ), - /* DIV */ PACK( 2, 1 ), - /* MUL */ PACK( 2, 1 ), - /* ABS */ PACK( 1, 1 ), - /* NEG */ PACK( 1, 1 ), - /* FLOOR */ PACK( 1, 1 ), - /* CEILING */ PACK( 1, 1 ), - /* ROUND[0] */ PACK( 1, 1 ), - /* ROUND[1] */ PACK( 1, 1 ), - /* ROUND[2] */ PACK( 1, 1 ), - /* ROUND[3] */ PACK( 1, 1 ), - /* NROUND[0] */ PACK( 1, 1 ), - /* NROUND[1] */ PACK( 1, 1 ), - /* NROUND[2] */ PACK( 1, 1 ), - /* NROUND[3] */ PACK( 1, 1 ), - - /* WCvtF */ PACK( 2, 0 ), - /* DeltaP2 */ PACK( 1, 0 ), - /* DeltaP3 */ PACK( 1, 0 ), - /* DeltaCn[0] */ PACK( 1, 0 ), - /* DeltaCn[1] */ PACK( 1, 0 ), - /* DeltaCn[2] */ PACK( 1, 0 ), - /* SROUND */ PACK( 1, 0 ), - /* S45Round */ PACK( 1, 0 ), - /* JROT */ PACK( 2, 0 ), - /* JROF */ PACK( 2, 0 ), - /* ROFF */ PACK( 0, 0 ), - /* INS_$7B */ PACK( 0, 0 ), - /* RUTG */ PACK( 0, 0 ), - /* RDTG */ PACK( 0, 0 ), - /* SANGW */ PACK( 1, 0 ), - /* AA */ PACK( 1, 0 ), - - /* FlipPT */ PACK( 0, 0 ), - /* FlipRgON */ PACK( 2, 0 ), - /* FlipRgOFF */ PACK( 2, 0 ), - /* INS_$83 */ PACK( 0, 0 ), - /* INS_$84 */ PACK( 0, 0 ), - /* ScanCTRL */ PACK( 1, 0 ), - /* SDVPTL[0] */ PACK( 2, 0 ), - /* SDVPTL[1] */ PACK( 2, 0 ), - /* GetINFO */ PACK( 1, 1 ), - /* IDEF */ PACK( 1, 0 ), - /* ROLL */ PACK( 3, 3 ), - /* MAX */ PACK( 2, 1 ), - /* MIN */ PACK( 2, 1 ), - /* ScanTYPE */ PACK( 1, 0 ), - /* InstCTRL */ PACK( 2, 0 ), - /* INS_$8F */ PACK( 0, 0 ), - - /* INS_$90 */ PACK( 0, 0 ), - /* INS_$91 */ PACK( 0, 0 ), - /* INS_$92 */ PACK( 0, 0 ), - /* INS_$93 */ PACK( 0, 0 ), - /* INS_$94 */ PACK( 0, 0 ), - /* INS_$95 */ PACK( 0, 0 ), - /* INS_$96 */ PACK( 0, 0 ), - /* INS_$97 */ PACK( 0, 0 ), - /* INS_$98 */ PACK( 0, 0 ), - /* INS_$99 */ PACK( 0, 0 ), - /* INS_$9A */ PACK( 0, 0 ), - /* INS_$9B */ PACK( 0, 0 ), - /* INS_$9C */ PACK( 0, 0 ), - /* INS_$9D */ PACK( 0, 0 ), - /* INS_$9E */ PACK( 0, 0 ), - /* INS_$9F */ PACK( 0, 0 ), - - /* INS_$A0 */ PACK( 0, 0 ), - /* INS_$A1 */ PACK( 0, 0 ), - /* INS_$A2 */ PACK( 0, 0 ), - /* INS_$A3 */ PACK( 0, 0 ), - /* INS_$A4 */ PACK( 0, 0 ), - /* INS_$A5 */ PACK( 0, 0 ), - /* INS_$A6 */ PACK( 0, 0 ), - /* INS_$A7 */ PACK( 0, 0 ), - /* INS_$A8 */ PACK( 0, 0 ), - /* INS_$A9 */ PACK( 0, 0 ), - /* INS_$AA */ PACK( 0, 0 ), - /* INS_$AB */ PACK( 0, 0 ), - /* INS_$AC */ PACK( 0, 0 ), - /* INS_$AD */ PACK( 0, 0 ), - /* INS_$AE */ PACK( 0, 0 ), - /* INS_$AF */ PACK( 0, 0 ), - - /* PushB[0] */ PACK( 0, 1 ), - /* PushB[1] */ PACK( 0, 2 ), - /* PushB[2] */ PACK( 0, 3 ), - /* PushB[3] */ PACK( 0, 4 ), - /* PushB[4] */ PACK( 0, 5 ), - /* PushB[5] */ PACK( 0, 6 ), - /* PushB[6] */ PACK( 0, 7 ), - /* PushB[7] */ PACK( 0, 8 ), - /* PushW[0] */ PACK( 0, 1 ), - /* PushW[1] */ PACK( 0, 2 ), - /* PushW[2] */ PACK( 0, 3 ), - /* PushW[3] */ PACK( 0, 4 ), - /* PushW[4] */ PACK( 0, 5 ), - /* PushW[5] */ PACK( 0, 6 ), - /* PushW[6] */ PACK( 0, 7 ), - /* PushW[7] */ PACK( 0, 8 ), - - /* MDRP[00] */ PACK( 1, 0 ), - /* MDRP[01] */ PACK( 1, 0 ), - /* MDRP[02] */ PACK( 1, 0 ), - /* MDRP[03] */ PACK( 1, 0 ), - /* MDRP[04] */ PACK( 1, 0 ), - /* MDRP[05] */ PACK( 1, 0 ), - /* MDRP[06] */ PACK( 1, 0 ), - /* MDRP[07] */ PACK( 1, 0 ), - /* MDRP[08] */ PACK( 1, 0 ), - /* MDRP[09] */ PACK( 1, 0 ), - /* MDRP[10] */ PACK( 1, 0 ), - /* MDRP[11] */ PACK( 1, 0 ), - /* MDRP[12] */ PACK( 1, 0 ), - /* MDRP[13] */ PACK( 1, 0 ), - /* MDRP[14] */ PACK( 1, 0 ), - /* MDRP[15] */ PACK( 1, 0 ), - - /* MDRP[16] */ PACK( 1, 0 ), - /* MDRP[17] */ PACK( 1, 0 ), - /* MDRP[18] */ PACK( 1, 0 ), - /* MDRP[19] */ PACK( 1, 0 ), - /* MDRP[20] */ PACK( 1, 0 ), - /* MDRP[21] */ PACK( 1, 0 ), - /* MDRP[22] */ PACK( 1, 0 ), - /* MDRP[23] */ PACK( 1, 0 ), - /* MDRP[24] */ PACK( 1, 0 ), - /* MDRP[25] */ PACK( 1, 0 ), - /* MDRP[26] */ PACK( 1, 0 ), - /* MDRP[27] */ PACK( 1, 0 ), - /* MDRP[28] */ PACK( 1, 0 ), - /* MDRP[29] */ PACK( 1, 0 ), - /* MDRP[30] */ PACK( 1, 0 ), - /* MDRP[31] */ PACK( 1, 0 ), - - /* MIRP[00] */ PACK( 2, 0 ), - /* MIRP[01] */ PACK( 2, 0 ), - /* MIRP[02] */ PACK( 2, 0 ), - /* MIRP[03] */ PACK( 2, 0 ), - /* MIRP[04] */ PACK( 2, 0 ), - /* MIRP[05] */ PACK( 2, 0 ), - /* MIRP[06] */ PACK( 2, 0 ), - /* MIRP[07] */ PACK( 2, 0 ), - /* MIRP[08] */ PACK( 2, 0 ), - /* MIRP[09] */ PACK( 2, 0 ), - /* MIRP[10] */ PACK( 2, 0 ), - /* MIRP[11] */ PACK( 2, 0 ), - /* MIRP[12] */ PACK( 2, 0 ), - /* MIRP[13] */ PACK( 2, 0 ), - /* MIRP[14] */ PACK( 2, 0 ), - /* MIRP[15] */ PACK( 2, 0 ), - - /* MIRP[16] */ PACK( 2, 0 ), - /* MIRP[17] */ PACK( 2, 0 ), - /* MIRP[18] */ PACK( 2, 0 ), - /* MIRP[19] */ PACK( 2, 0 ), - /* MIRP[20] */ PACK( 2, 0 ), - /* MIRP[21] */ PACK( 2, 0 ), - /* MIRP[22] */ PACK( 2, 0 ), - /* MIRP[23] */ PACK( 2, 0 ), - /* MIRP[24] */ PACK( 2, 0 ), - /* MIRP[25] */ PACK( 2, 0 ), - /* MIRP[26] */ PACK( 2, 0 ), - /* MIRP[27] */ PACK( 2, 0 ), - /* MIRP[28] */ PACK( 2, 0 ), - /* MIRP[29] */ PACK( 2, 0 ), - /* MIRP[30] */ PACK( 2, 0 ), - /* MIRP[31] */ PACK( 2, 0 ) - }; - - - static - const FT_Char opcode_length[256] = - { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - -1,-2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 3, 5, 7, 9, 11,13,15,17, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - }; - -#undef PACK - -#if 1 - - static FT_Int32 - TT_MulFix14( FT_Int32 a, - FT_Int b ) - { - FT_Int32 sign; - FT_UInt32 ah, al, mid, lo, hi; - - - sign = a ^ b; - - if ( a < 0 ) - a = -a; - if ( b < 0 ) - b = -b; - - ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU ); - al = (FT_UInt32)( a & 0xFFFFU ); - - lo = al * b; - mid = ah * b; - hi = mid >> 16; - mid = ( mid << 16 ) + ( 1 << 13 ); /* rounding */ - lo += mid; - if ( lo < mid ) - hi += 1; - - mid = ( lo >> 14 ) | ( hi << 18 ); - - return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid; - } - -#else - - /* compute (a*b)/2^14 with maximal accuracy and rounding */ - static FT_Int32 - TT_MulFix14( FT_Int32 a, - FT_Int b ) - { - FT_Int32 m, s, hi; - FT_UInt32 l, lo; - - - /* compute ax*bx as 64-bit value */ - l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); - m = ( a >> 16 ) * b; - - lo = l + (FT_UInt32)( m << 16 ); - hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); - - /* divide the result by 2^14 with rounding */ - s = hi >> 31; - l = lo + (FT_UInt32)s; - hi += s + ( l < lo ); - lo = l; - - l = lo + 0x2000U; - hi += l < lo; - - return ( hi << 18 ) | ( l >> 14 ); - } -#endif - - - /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */ - static FT_Int32 - TT_DotFix14( FT_Int32 ax, - FT_Int32 ay, - FT_Int bx, - FT_Int by ) - { - FT_Int32 m, s, hi1, hi2, hi; - FT_UInt32 l, lo1, lo2, lo; - - - /* compute ax*bx as 64-bit value */ - l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx ); - m = ( ax >> 16 ) * bx; - - lo1 = l + (FT_UInt32)( m << 16 ); - hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l ); - - /* compute ay*by as 64-bit value */ - l = (FT_UInt32)( ( ay & 0xFFFFU ) * by ); - m = ( ay >> 16 ) * by; - - lo2 = l + (FT_UInt32)( m << 16 ); - hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l ); - - /* add them */ - lo = lo1 + lo2; - hi = hi1 + hi2 + ( lo < lo1 ); - - /* divide the result by 2^14 with rounding */ - s = hi >> 31; - l = lo + (FT_UInt32)s; - hi += s + ( l < lo ); - lo = l; - - l = lo + 0x2000U; - hi += ( l < lo ); - - return ( hi << 18 ) | ( l >> 14 ); - } - - - /* return length of given vector */ - -#if 0 - - static FT_Int32 - TT_VecLen( FT_Int32 x, - FT_Int32 y ) - { - FT_Int32 m, hi1, hi2, hi; - FT_UInt32 l, lo1, lo2, lo; - - - /* compute x*x as 64-bit value */ - lo = (FT_UInt32)( x & 0xFFFFU ); - hi = x >> 16; - - l = lo * lo; - m = hi * lo; - hi = hi * hi; - - lo1 = l + (FT_UInt32)( m << 17 ); - hi1 = hi + ( m >> 15 ) + ( lo1 < l ); - - /* compute y*y as 64-bit value */ - lo = (FT_UInt32)( y & 0xFFFFU ); - hi = y >> 16; - - l = lo * lo; - m = hi * lo; - hi = hi * hi; - - lo2 = l + (FT_UInt32)( m << 17 ); - hi2 = hi + ( m >> 15 ) + ( lo2 < l ); - - /* add them to get 'x*x+y*y' as 64-bit value */ - lo = lo1 + lo2; - hi = hi1 + hi2 + ( lo < lo1 ); - - /* compute the square root of this value */ - { - FT_UInt32 root, rem, test_div; - FT_Int count; - - - root = 0; - - { - rem = 0; - count = 32; - do - { - rem = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 ); - hi = ( hi << 2 ) | ( lo >> 30 ); - lo <<= 2; - root <<= 1; - test_div = ( root << 1 ) + 1; - - if ( rem >= test_div ) - { - rem -= test_div; - root += 1; - } - } while ( --count ); - } - - return (FT_Int32)root; - } - } - -#else - - /* this version uses FT_Vector_Length which computes the same value */ - /* much, much faster.. */ - /* */ - static FT_F26Dot6 - TT_VecLen( FT_F26Dot6 X, - FT_F26Dot6 Y ) - { - FT_Vector v; - - - v.x = X; - v.y = Y; - - return FT_Vector_Length( &v ); - } - -#endif - - - /*************************************************************************/ - /* */ - /* */ - /* Current_Ratio */ - /* */ - /* */ - /* Returns the current aspect ratio scaling factor depending on the */ - /* projection vector's state and device resolutions. */ - /* */ - /* */ - /* The aspect ratio in 16.16 format, always <= 1.0 . */ - /* */ - static FT_Long - Current_Ratio( EXEC_OP ) - { - if ( !CUR.tt_metrics.ratio ) - { -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - if ( CUR.face->unpatented_hinting ) - { - if ( CUR.GS.both_x_axis ) - CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio; - else - CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio; - } - else -#endif - { - if ( CUR.GS.projVector.y == 0 ) - CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio; - - else if ( CUR.GS.projVector.x == 0 ) - CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio; - - else - { - FT_Long x, y; - - - x = TT_MULDIV( CUR.GS.projVector.x, - CUR.tt_metrics.x_ratio, 0x4000 ); - y = TT_MULDIV( CUR.GS.projVector.y, - CUR.tt_metrics.y_ratio, 0x4000 ); - CUR.tt_metrics.ratio = TT_VecLen( x, y ); - } - } - } - return CUR.tt_metrics.ratio; - } - - - static FT_Long - Current_Ppem( EXEC_OP ) - { - return TT_MULFIX( CUR.tt_metrics.ppem, CURRENT_Ratio() ); - } - - - /*************************************************************************/ - /* */ - /* Functions related to the control value table (CVT). */ - /* */ - /*************************************************************************/ - - - FT_CALLBACK_DEF( FT_F26Dot6 ) - Read_CVT( EXEC_OP_ FT_ULong idx ) - { - return CUR.cvt[idx]; - } - - - FT_CALLBACK_DEF( FT_F26Dot6 ) - Read_CVT_Stretched( EXEC_OP_ FT_ULong idx ) - { - return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() ); - } - - - FT_CALLBACK_DEF( void ) - Write_CVT( EXEC_OP_ FT_ULong idx, - FT_F26Dot6 value ) - { - CUR.cvt[idx] = value; - } - - - FT_CALLBACK_DEF( void ) - Write_CVT_Stretched( EXEC_OP_ FT_ULong idx, - FT_F26Dot6 value ) - { - CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() ); - } - - - FT_CALLBACK_DEF( void ) - Move_CVT( EXEC_OP_ FT_ULong idx, - FT_F26Dot6 value ) - { - CUR.cvt[idx] += value; - } - - - FT_CALLBACK_DEF( void ) - Move_CVT_Stretched( EXEC_OP_ FT_ULong idx, - FT_F26Dot6 value ) - { - CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() ); - } - - - /*************************************************************************/ - /* */ - /* */ - /* GetShortIns */ - /* */ - /* */ - /* Returns a short integer taken from the instruction stream at */ - /* address IP. */ - /* */ - /* */ - /* Short read at code[IP]. */ - /* */ - /* */ - /* This one could become a macro. */ - /* */ - static FT_Short - GetShortIns( EXEC_OP ) - { - /* Reading a byte stream so there is no endianess (DaveP) */ - CUR.IP += 2; - return (FT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) + - CUR.code[CUR.IP - 1] ); - } - - - /*************************************************************************/ - /* */ - /* */ - /* Ins_Goto_CodeRange */ - /* */ - /* */ - /* Goes to a certain code range in the instruction stream. */ - /* */ - /* */ - /* aRange :: The index of the code range. */ - /* */ - /* aIP :: The new IP address in the code range. */ - /* */ - /* */ - /* SUCCESS or FAILURE. */ - /* */ - static FT_Bool - Ins_Goto_CodeRange( EXEC_OP_ FT_Int aRange, - FT_ULong aIP ) - { - TT_CodeRange* range; - - - if ( aRange < 1 || aRange > 3 ) - { - CUR.error = TT_Err_Bad_Argument; - return FAILURE; - } - - range = &CUR.codeRangeTable[aRange - 1]; - - if ( range->base == NULL ) /* invalid coderange */ - { - CUR.error = TT_Err_Invalid_CodeRange; - return FAILURE; - } - - /* NOTE: Because the last instruction of a program may be a CALL */ - /* which will return to the first byte *after* the code */ - /* range, we test for AIP <= Size, instead of AIP < Size. */ - - if ( aIP > range->size ) - { - CUR.error = TT_Err_Code_Overflow; - return FAILURE; - } - - CUR.code = range->base; - CUR.codeSize = range->size; - CUR.IP = aIP; - CUR.curRange = aRange; - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Direct_Move */ - /* */ - /* */ - /* Moves a point by a given distance along the freedom vector. The */ - /* point will be `touched'. */ - /* */ - /* */ - /* point :: The index of the point to move. */ - /* */ - /* distance :: The distance to apply. */ - /* */ - /* */ - /* zone :: The affected glyph zone. */ - /* */ - static void - Direct_Move( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_F26Dot6 v; - - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - FT_ASSERT( !CUR.face->unpatented_hinting ); -#endif - - v = CUR.GS.freeVector.x; - - if ( v != 0 ) - { - zone->cur[point].x += TT_MULDIV( distance, - v * 0x10000L, - CUR.F_dot_P ); - - zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; - } - - v = CUR.GS.freeVector.y; - - if ( v != 0 ) - { - zone->cur[point].y += TT_MULDIV( distance, - v * 0x10000L, - CUR.F_dot_P ); - - zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; - } - } - - - /*************************************************************************/ - /* */ - /* */ - /* Direct_Move_Orig */ - /* */ - /* */ - /* Moves the *original* position of a point by a given distance along */ - /* the freedom vector. Obviously, the point will not be `touched'. */ - /* */ - /* */ - /* point :: The index of the point to move. */ - /* */ - /* distance :: The distance to apply. */ - /* */ - /* */ - /* zone :: The affected glyph zone. */ - /* */ - static void - Direct_Move_Orig( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_F26Dot6 v; - - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - FT_ASSERT( !CUR.face->unpatented_hinting ); -#endif - - v = CUR.GS.freeVector.x; - - if ( v != 0 ) - zone->org[point].x += TT_MULDIV( distance, - v * 0x10000L, - CUR.F_dot_P ); - - v = CUR.GS.freeVector.y; - - if ( v != 0 ) - zone->org[point].y += TT_MULDIV( distance, - v * 0x10000L, - CUR.F_dot_P ); - } - - - /*************************************************************************/ - /* */ - /* Special versions of Direct_Move() */ - /* */ - /* The following versions are used whenever both vectors are both */ - /* along one of the coordinate unit vectors, i.e. in 90% of the cases. */ - /* */ - /*************************************************************************/ - - - static void - Direct_Move_X( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_UNUSED_EXEC; - - zone->cur[point].x += distance; - zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; - } - - - static void - Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_UNUSED_EXEC; - - zone->cur[point].y += distance; - zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; - } - - - /*************************************************************************/ - /* */ - /* Special versions of Direct_Move_Orig() */ - /* */ - /* The following versions are used whenever both vectors are both */ - /* along one of the coordinate unit vectors, i.e. in 90% of the cases. */ - /* */ - /*************************************************************************/ - - - static void - Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_UNUSED_EXEC; - - zone->org[point].x += distance; - } - - - static void - Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) - { - FT_UNUSED_EXEC; - - zone->org[point].y += distance; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_None */ - /* */ - /* */ - /* Does not round, but adds engine compensation. */ - /* */ - /* */ - /* distance :: The distance (not) to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* The compensated distance. */ - /* */ - /* */ - /* The TrueType specification says very few about the relationship */ - /* between rounding and engine compensation. However, it seems from */ - /* the description of super round that we should add the compensation */ - /* before rounding. */ - /* */ - static FT_F26Dot6 - Round_None( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - FT_UNUSED_EXEC; - - - if ( distance >= 0 ) - { - val = distance + compensation; - if ( distance && val < 0 ) - val = 0; - } - else { - val = distance - compensation; - if ( val > 0 ) - val = 0; - } - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_To_Grid */ - /* */ - /* */ - /* Rounds value to grid after adding engine compensation. */ - /* */ - /* */ - /* distance :: The distance to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* Rounded distance. */ - /* */ - static FT_F26Dot6 - Round_To_Grid( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - FT_UNUSED_EXEC; - - - if ( distance >= 0 ) - { - val = distance + compensation + 32; - if ( distance && val > 0 ) - val &= ~63; - else - val = 0; - } - else - { - val = -FT_PIX_ROUND( compensation - distance ); - if ( val > 0 ) - val = 0; - } - - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_To_Half_Grid */ - /* */ - /* */ - /* Rounds value to half grid after adding engine compensation. */ - /* */ - /* */ - /* distance :: The distance to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* Rounded distance. */ - /* */ - static FT_F26Dot6 - Round_To_Half_Grid( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - FT_UNUSED_EXEC; - - - if ( distance >= 0 ) - { - val = FT_PIX_FLOOR( distance + compensation ) + 32; - if ( distance && val < 0 ) - val = 0; - } - else - { - val = -( FT_PIX_FLOOR( compensation - distance ) + 32 ); - if ( val > 0 ) - val = 0; - } - - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_Down_To_Grid */ - /* */ - /* */ - /* Rounds value down to grid after adding engine compensation. */ - /* */ - /* */ - /* distance :: The distance to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* Rounded distance. */ - /* */ - static FT_F26Dot6 - Round_Down_To_Grid( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - FT_UNUSED_EXEC; - - - if ( distance >= 0 ) - { - val = distance + compensation; - if ( distance && val > 0 ) - val &= ~63; - else - val = 0; - } - else - { - val = -( ( compensation - distance ) & -64 ); - if ( val > 0 ) - val = 0; - } - - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_Up_To_Grid */ - /* */ - /* */ - /* Rounds value up to grid after adding engine compensation. */ - /* */ - /* */ - /* distance :: The distance to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* Rounded distance. */ - /* */ - static FT_F26Dot6 - Round_Up_To_Grid( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - FT_UNUSED_EXEC; - - - if ( distance >= 0 ) - { - val = distance + compensation + 63; - if ( distance && val > 0 ) - val &= ~63; - else - val = 0; - } - else - { - val = - FT_PIX_CEIL( compensation - distance ); - if ( val > 0 ) - val = 0; - } - - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_To_Double_Grid */ - /* */ - /* */ - /* Rounds value to double grid after adding engine compensation. */ - /* */ - /* */ - /* distance :: The distance to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* Rounded distance. */ - /* */ - static FT_F26Dot6 - Round_To_Double_Grid( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - FT_UNUSED_EXEC; - - - if ( distance >= 0 ) - { - val = distance + compensation + 16; - if ( distance && val > 0 ) - val &= ~31; - else - val = 0; - } - else - { - val = -FT_PAD_ROUND( compensation - distance, 32 ); - if ( val > 0 ) - val = 0; - } - - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_Super */ - /* */ - /* */ - /* Super-rounds value to grid after adding engine compensation. */ - /* */ - /* */ - /* distance :: The distance to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* Rounded distance. */ - /* */ - /* */ - /* The TrueType specification says very few about the relationship */ - /* between rounding and engine compensation. However, it seems from */ - /* the description of super round that we should add the compensation */ - /* before rounding. */ - /* */ - static FT_F26Dot6 - Round_Super( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - - if ( distance >= 0 ) - { - val = ( distance - CUR.phase + CUR.threshold + compensation ) & - -CUR.period; - if ( distance && val < 0 ) - val = 0; - val += CUR.phase; - } - else - { - val = -( ( CUR.threshold - CUR.phase - distance + compensation ) & - -CUR.period ); - if ( val > 0 ) - val = 0; - val -= CUR.phase; - } - - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Round_Super_45 */ - /* */ - /* */ - /* Super-rounds value to grid after adding engine compensation. */ - /* */ - /* */ - /* distance :: The distance to round. */ - /* */ - /* compensation :: The engine compensation. */ - /* */ - /* */ - /* Rounded distance. */ - /* */ - /* */ - /* There is a separate function for Round_Super_45() as we may need */ - /* greater precision. */ - /* */ - static FT_F26Dot6 - Round_Super_45( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ) - { - FT_F26Dot6 val; - - - if ( distance >= 0 ) - { - val = ( ( distance - CUR.phase + CUR.threshold + compensation ) / - CUR.period ) * CUR.period; - if ( distance && val < 0 ) - val = 0; - val += CUR.phase; - } - else - { - val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) / - CUR.period ) * CUR.period ); - if ( val > 0 ) - val = 0; - val -= CUR.phase; - } - - return val; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Compute_Round */ - /* */ - /* */ - /* Sets the rounding mode. */ - /* */ - /* */ - /* round_mode :: The rounding mode to be used. */ - /* */ - static void - Compute_Round( EXEC_OP_ FT_Byte round_mode ) - { - switch ( round_mode ) - { - case TT_Round_Off: - CUR.func_round = (TT_Round_Func)Round_None; - break; - - case TT_Round_To_Grid: - CUR.func_round = (TT_Round_Func)Round_To_Grid; - break; - - case TT_Round_Up_To_Grid: - CUR.func_round = (TT_Round_Func)Round_Up_To_Grid; - break; - - case TT_Round_Down_To_Grid: - CUR.func_round = (TT_Round_Func)Round_Down_To_Grid; - break; - - case TT_Round_To_Half_Grid: - CUR.func_round = (TT_Round_Func)Round_To_Half_Grid; - break; - - case TT_Round_To_Double_Grid: - CUR.func_round = (TT_Round_Func)Round_To_Double_Grid; - break; - - case TT_Round_Super: - CUR.func_round = (TT_Round_Func)Round_Super; - break; - - case TT_Round_Super_45: - CUR.func_round = (TT_Round_Func)Round_Super_45; - break; - } - } - - - /*************************************************************************/ - /* */ - /* */ - /* SetSuperRound */ - /* */ - /* */ - /* Sets Super Round parameters. */ - /* */ - /* */ - /* GridPeriod :: Grid period */ - /* selector :: SROUND opcode */ - /* */ - static void - SetSuperRound( EXEC_OP_ FT_F26Dot6 GridPeriod, - FT_Long selector ) - { - switch ( (FT_Int)( selector & 0xC0 ) ) - { - case 0: - CUR.period = GridPeriod / 2; - break; - - case 0x40: - CUR.period = GridPeriod; - break; - - case 0x80: - CUR.period = GridPeriod * 2; - break; - - /* This opcode is reserved, but... */ - - case 0xC0: - CUR.period = GridPeriod; - break; - } - - switch ( (FT_Int)( selector & 0x30 ) ) - { - case 0: - CUR.phase = 0; - break; - - case 0x10: - CUR.phase = CUR.period / 4; - break; - - case 0x20: - CUR.phase = CUR.period / 2; - break; - - case 0x30: - CUR.phase = CUR.period * 3 / 4; - break; - } - - if ( ( selector & 0x0F ) == 0 ) - CUR.threshold = CUR.period - 1; - else - CUR.threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8; - - CUR.period /= 256; - CUR.phase /= 256; - CUR.threshold /= 256; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Project */ - /* */ - /* */ - /* Computes the projection of vector given by (v2-v1) along the */ - /* current projection vector. */ - /* */ - /* */ - /* v1 :: First input vector. */ - /* v2 :: Second input vector. */ - /* */ - /* */ - /* The distance in F26dot6 format. */ - /* */ - static FT_F26Dot6 - Project( EXEC_OP_ FT_Pos dx, - FT_Pos dy ) - { -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - FT_ASSERT( !CUR.face->unpatented_hinting ); -#endif - - return TT_DotFix14( dx, dy, - CUR.GS.projVector.x, - CUR.GS.projVector.y ); - } - - - /*************************************************************************/ - /* */ - /* */ - /* Dual_Project */ - /* */ - /* */ - /* Computes the projection of the vector given by (v2-v1) along the */ - /* current dual vector. */ - /* */ - /* */ - /* v1 :: First input vector. */ - /* v2 :: Second input vector. */ - /* */ - /* */ - /* The distance in F26dot6 format. */ - /* */ - static FT_F26Dot6 - Dual_Project( EXEC_OP_ FT_Pos dx, - FT_Pos dy ) - { - return TT_DotFix14( dx, dy, - CUR.GS.dualVector.x, - CUR.GS.dualVector.y ); - } - - - /*************************************************************************/ - /* */ - /* */ - /* Project_x */ - /* */ - /* */ - /* Computes the projection of the vector given by (v2-v1) along the */ - /* horizontal axis. */ - /* */ - /* */ - /* v1 :: First input vector. */ - /* v2 :: Second input vector. */ - /* */ - /* */ - /* The distance in F26dot6 format. */ - /* */ - static FT_F26Dot6 - Project_x( EXEC_OP_ FT_Pos dx, - FT_Pos dy ) - { - FT_UNUSED_EXEC; - FT_UNUSED( dy ); - - return dx; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Project_y */ - /* */ - /* */ - /* Computes the projection of the vector given by (v2-v1) along the */ - /* vertical axis. */ - /* */ - /* */ - /* v1 :: First input vector. */ - /* v2 :: Second input vector. */ - /* */ - /* */ - /* The distance in F26dot6 format. */ - /* */ - static FT_F26Dot6 - Project_y( EXEC_OP_ FT_Pos dx, - FT_Pos dy ) - { - FT_UNUSED_EXEC; - FT_UNUSED( dx ); - - return dy; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Compute_Funcs */ - /* */ - /* */ - /* Computes the projection and movement function pointers according */ - /* to the current graphics state. */ - /* */ - static void - Compute_Funcs( EXEC_OP ) - { -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - if ( CUR.face->unpatented_hinting ) - { - /* If both vectors point rightwards along the x axis, set */ - /* `both-x-axis' true, otherwise set it false. The x values only */ - /* need be tested because the vector has been normalised to a unit */ - /* vector of length 0x4000 = unity. */ - CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 && - CUR.GS.freeVector.x == 0x4000 ); - - /* Throw away projection and freedom vector information */ - /* because the patents don't allow them to be stored. */ - /* The relevant US Patents are 5155805 and 5325479. */ - CUR.GS.projVector.x = 0; - CUR.GS.projVector.y = 0; - CUR.GS.freeVector.x = 0; - CUR.GS.freeVector.y = 0; - - if ( CUR.GS.both_x_axis ) - { - CUR.func_project = Project_x; - CUR.func_move = Direct_Move_X; - CUR.func_move_orig = Direct_Move_Orig_X; - } - else - { - CUR.func_project = Project_y; - CUR.func_move = Direct_Move_Y; - CUR.func_move_orig = Direct_Move_Orig_Y; - } - - if ( CUR.GS.dualVector.x == 0x4000 ) - CUR.func_dualproj = Project_x; - else - { - if ( CUR.GS.dualVector.y == 0x4000 ) - CUR.func_dualproj = Project_y; - else - CUR.func_dualproj = Dual_Project; - } - - /* Force recalculation of cached aspect ratio */ - CUR.tt_metrics.ratio = 0; - - return; - } -#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */ - - if ( CUR.GS.freeVector.x == 0x4000 ) - CUR.F_dot_P = CUR.GS.projVector.x * 0x10000L; - else - { - if ( CUR.GS.freeVector.y == 0x4000 ) - CUR.F_dot_P = CUR.GS.projVector.y * 0x10000L; - else - CUR.F_dot_P = (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 + - (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4; - } - - if ( CUR.GS.projVector.x == 0x4000 ) - CUR.func_project = (TT_Project_Func)Project_x; - else - { - if ( CUR.GS.projVector.y == 0x4000 ) - CUR.func_project = (TT_Project_Func)Project_y; - else - CUR.func_project = (TT_Project_Func)Project; - } - - if ( CUR.GS.dualVector.x == 0x4000 ) - CUR.func_dualproj = (TT_Project_Func)Project_x; - else - { - if ( CUR.GS.dualVector.y == 0x4000 ) - CUR.func_dualproj = (TT_Project_Func)Project_y; - else - CUR.func_dualproj = (TT_Project_Func)Dual_Project; - } - - CUR.func_move = (TT_Move_Func)Direct_Move; - CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig; - - if ( CUR.F_dot_P == 0x40000000L ) - { - if ( CUR.GS.freeVector.x == 0x4000 ) - { - CUR.func_move = (TT_Move_Func)Direct_Move_X; - CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; - } - else - { - if ( CUR.GS.freeVector.y == 0x4000 ) - { - CUR.func_move = (TT_Move_Func)Direct_Move_Y; - CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; - } - } - } - - /* at small sizes, F_dot_P can become too small, resulting */ - /* in overflows and `spikes' in a number of glyphs like `w'. */ - - if ( FT_ABS( CUR.F_dot_P ) < 0x4000000L ) - CUR.F_dot_P = 0x40000000L; - - /* Disable cached aspect ratio */ - CUR.tt_metrics.ratio = 0; - } - - - /*************************************************************************/ - /* */ - /* */ - /* Normalize */ - /* */ - /* */ - /* Norms a vector. */ - /* */ - /* */ - /* Vx :: The horizontal input vector coordinate. */ - /* Vy :: The vertical input vector coordinate. */ - /* */ - /* */ - /* R :: The normed unit vector. */ - /* */ - /* */ - /* Returns FAILURE if a vector parameter is zero. */ - /* */ - /* */ - /* In case Vx and Vy are both zero, Normalize() returns SUCCESS, and */ - /* R is undefined. */ - /* */ - - - static FT_Bool - Normalize( EXEC_OP_ FT_F26Dot6 Vx, - FT_F26Dot6 Vy, - FT_UnitVector* R ) - { - FT_F26Dot6 W; - FT_Bool S1, S2; - - FT_UNUSED_EXEC; - - - if ( FT_ABS( Vx ) < 0x10000L && FT_ABS( Vy ) < 0x10000L ) - { - Vx *= 0x100; - Vy *= 0x100; - - W = TT_VecLen( Vx, Vy ); - - if ( W == 0 ) - { - /* XXX: UNDOCUMENTED! It seems that it is possible to try */ - /* to normalize the vector (0,0). Return immediately. */ - return SUCCESS; - } - - R->x = (FT_F2Dot14)FT_MulDiv( Vx, 0x4000L, W ); - R->y = (FT_F2Dot14)FT_MulDiv( Vy, 0x4000L, W ); - - return SUCCESS; - } - - W = TT_VecLen( Vx, Vy ); - - Vx = FT_MulDiv( Vx, 0x4000L, W ); - Vy = FT_MulDiv( Vy, 0x4000L, W ); - - W = Vx * Vx + Vy * Vy; - - /* Now, we want that Sqrt( W ) = 0x4000 */ - /* Or 0x10000000 <= W < 0x10004000 */ - - if ( Vx < 0 ) - { - Vx = -Vx; - S1 = TRUE; - } - else - S1 = FALSE; - - if ( Vy < 0 ) - { - Vy = -Vy; - S2 = TRUE; - } - else - S2 = FALSE; - - while ( W < 0x10000000L ) - { - /* We need to increase W by a minimal amount */ - if ( Vx < Vy ) - Vx++; - else - Vy++; - - W = Vx * Vx + Vy * Vy; - } - - while ( W >= 0x10004000L ) - { - /* We need to decrease W by a minimal amount */ - if ( Vx < Vy ) - Vx--; - else - Vy--; - - W = Vx * Vx + Vy * Vy; - } - - /* Note that in various cases, we can only */ - /* compute a Sqrt(W) of 0x3FFF, eg. Vx = Vy */ - - if ( S1 ) - Vx = -Vx; - - if ( S2 ) - Vy = -Vy; - - R->x = (FT_F2Dot14)Vx; /* Type conversion */ - R->y = (FT_F2Dot14)Vy; /* Type conversion */ - - return SUCCESS; - } - - - /*************************************************************************/ - /* */ - /* Here we start with the implementation of the various opcodes. */ - /* */ - /*************************************************************************/ - - - static FT_Bool - Ins_SxVTL( EXEC_OP_ FT_UShort aIdx1, - FT_UShort aIdx2, - FT_Int aOpc, - FT_UnitVector* Vec ) - { - FT_Long A, B, C; - FT_Vector* p1; - FT_Vector* p2; - - - if ( BOUNDS( aIdx1, CUR.zp2.n_points ) || - BOUNDS( aIdx2, CUR.zp1.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return FAILURE; - } - - p1 = CUR.zp1.cur + aIdx2; - p2 = CUR.zp2.cur + aIdx1; - - A = p1->x - p2->x; - B = p1->y - p2->y; - - if ( ( aOpc & 1 ) != 0 ) - { - C = B; /* counter clockwise rotation */ - B = A; - A = -C; - } - - NORMalize( A, B, Vec ); - - return SUCCESS; - } - - - /* When not using the big switch statements, the interpreter uses a */ - /* call table defined later below in this source. Each opcode must */ - /* thus have a corresponding function, even trivial ones. */ - /* */ - /* They are all defined there. */ - -#define DO_SVTCA \ - { \ - FT_Short A, B; \ - \ - \ - A = (FT_Short)( CUR.opcode & 1 ) << 14; \ - B = A ^ (FT_Short)0x4000; \ - \ - CUR.GS.freeVector.x = A; \ - CUR.GS.projVector.x = A; \ - CUR.GS.dualVector.x = A; \ - \ - CUR.GS.freeVector.y = B; \ - CUR.GS.projVector.y = B; \ - CUR.GS.dualVector.y = B; \ - \ - COMPUTE_Funcs(); \ - } - - -#define DO_SPVTCA \ - { \ - FT_Short A, B; \ - \ - \ - A = (FT_Short)( CUR.opcode & 1 ) << 14; \ - B = A ^ (FT_Short)0x4000; \ - \ - CUR.GS.projVector.x = A; \ - CUR.GS.dualVector.x = A; \ - \ - CUR.GS.projVector.y = B; \ - CUR.GS.dualVector.y = B; \ - \ - GUESS_VECTOR( freeVector ); \ - \ - COMPUTE_Funcs(); \ - } - - -#define DO_SFVTCA \ - { \ - FT_Short A, B; \ - \ - \ - A = (FT_Short)( CUR.opcode & 1 ) << 14; \ - B = A ^ (FT_Short)0x4000; \ - \ - CUR.GS.freeVector.x = A; \ - CUR.GS.freeVector.y = B; \ - \ - GUESS_VECTOR( projVector ); \ - \ - COMPUTE_Funcs(); \ - } - - -#define DO_SPVTL \ - if ( INS_SxVTL( (FT_UShort)args[1], \ - (FT_UShort)args[0], \ - CUR.opcode, \ - &CUR.GS.projVector ) == SUCCESS ) \ - { \ - CUR.GS.dualVector = CUR.GS.projVector; \ - GUESS_VECTOR( freeVector ); \ - COMPUTE_Funcs(); \ - } - - -#define DO_SFVTL \ - if ( INS_SxVTL( (FT_UShort)args[1], \ - (FT_UShort)args[0], \ - CUR.opcode, \ - &CUR.GS.freeVector ) == SUCCESS ) \ - { \ - GUESS_VECTOR( projVector ); \ - COMPUTE_Funcs(); \ - } - - -#define DO_SFVTPV \ - GUESS_VECTOR( projVector ); \ - CUR.GS.freeVector = CUR.GS.projVector; \ - COMPUTE_Funcs(); - - -#define DO_SPVFS \ - { \ - FT_Short S; \ - FT_Long X, Y; \ - \ - \ - /* Only use low 16bits, then sign extend */ \ - S = (FT_Short)args[1]; \ - Y = (FT_Long)S; \ - S = (FT_Short)args[0]; \ - X = (FT_Long)S; \ - \ - NORMalize( X, Y, &CUR.GS.projVector ); \ - \ - CUR.GS.dualVector = CUR.GS.projVector; \ - GUESS_VECTOR( freeVector ); \ - COMPUTE_Funcs(); \ - } - - -#define DO_SFVFS \ - { \ - FT_Short S; \ - FT_Long X, Y; \ - \ - \ - /* Only use low 16bits, then sign extend */ \ - S = (FT_Short)args[1]; \ - Y = (FT_Long)S; \ - S = (FT_Short)args[0]; \ - X = S; \ - \ - NORMalize( X, Y, &CUR.GS.freeVector ); \ - GUESS_VECTOR( projVector ); \ - COMPUTE_Funcs(); \ - } - - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING -#define DO_GPV \ - if ( CUR.face->unpatented_hinting ) \ - { \ - args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \ - args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \ - } \ - else \ - { \ - args[0] = CUR.GS.projVector.x; \ - args[1] = CUR.GS.projVector.y; \ - } -#else -#define DO_GPV \ - args[0] = CUR.GS.projVector.x; \ - args[1] = CUR.GS.projVector.y; -#endif - - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING -#define DO_GFV \ - if ( CUR.face->unpatented_hinting ) \ - { \ - args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \ - args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \ - } \ - else \ - { \ - args[0] = CUR.GS.freeVector.x; \ - args[1] = CUR.GS.freeVector.y; \ - } -#else -#define DO_GFV \ - args[0] = CUR.GS.freeVector.x; \ - args[1] = CUR.GS.freeVector.y; -#endif - - -#define DO_SRP0 \ - CUR.GS.rp0 = (FT_UShort)args[0]; - - -#define DO_SRP1 \ - CUR.GS.rp1 = (FT_UShort)args[0]; - - -#define DO_SRP2 \ - CUR.GS.rp2 = (FT_UShort)args[0]; - - -#define DO_RTHG \ - CUR.GS.round_state = TT_Round_To_Half_Grid; \ - CUR.func_round = (TT_Round_Func)Round_To_Half_Grid; - - -#define DO_RTG \ - CUR.GS.round_state = TT_Round_To_Grid; \ - CUR.func_round = (TT_Round_Func)Round_To_Grid; - - -#define DO_RTDG \ - CUR.GS.round_state = TT_Round_To_Double_Grid; \ - CUR.func_round = (TT_Round_Func)Round_To_Double_Grid; - - -#define DO_RUTG \ - CUR.GS.round_state = TT_Round_Up_To_Grid; \ - CUR.func_round = (TT_Round_Func)Round_Up_To_Grid; - - -#define DO_RDTG \ - CUR.GS.round_state = TT_Round_Down_To_Grid; \ - CUR.func_round = (TT_Round_Func)Round_Down_To_Grid; - - -#define DO_ROFF \ - CUR.GS.round_state = TT_Round_Off; \ - CUR.func_round = (TT_Round_Func)Round_None; - - -#define DO_SROUND \ - SET_SuperRound( 0x4000, args[0] ); \ - CUR.GS.round_state = TT_Round_Super; \ - CUR.func_round = (TT_Round_Func)Round_Super; - - -#define DO_S45ROUND \ - SET_SuperRound( 0x2D41, args[0] ); \ - CUR.GS.round_state = TT_Round_Super_45; \ - CUR.func_round = (TT_Round_Func)Round_Super_45; - - -#define DO_SLOOP \ - if ( args[0] < 0 ) \ - CUR.error = TT_Err_Bad_Argument; \ - else \ - CUR.GS.loop = args[0]; - - -#define DO_SMD \ - CUR.GS.minimum_distance = args[0]; - - -#define DO_SCVTCI \ - CUR.GS.control_value_cutin = (FT_F26Dot6)args[0]; - - -#define DO_SSWCI \ - CUR.GS.single_width_cutin = (FT_F26Dot6)args[0]; - - - /* XXX: UNDOCUMENTED! or bug in the Windows engine? */ - /* */ - /* It seems that the value that is read here is */ - /* expressed in 16.16 format rather than in font */ - /* units. */ - /* */ -#define DO_SSW \ - CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 ); - - -#define DO_FLIPON \ - CUR.GS.auto_flip = TRUE; - - -#define DO_FLIPOFF \ - CUR.GS.auto_flip = FALSE; - - -#define DO_SDB \ - CUR.GS.delta_base = (FT_Short)args[0]; - - -#define DO_SDS \ - CUR.GS.delta_shift = (FT_Short)args[0]; - - -#define DO_MD /* nothing */ - - -#define DO_MPPEM \ - args[0] = CURRENT_Ppem(); - - - /* Note: The pointSize should be irrelevant in a given font program; */ - /* we thus decide to return only the ppem. */ -#if 0 - -#define DO_MPS \ - args[0] = CUR.metrics.pointSize; - -#else - -#define DO_MPS \ - args[0] = CURRENT_Ppem(); - -#endif /* 0 */ - - -#define DO_DUP \ - args[1] = args[0]; - - -#define DO_CLEAR \ - CUR.new_top = 0; - - -#define DO_SWAP \ - { \ - FT_Long L; \ - \ - \ - L = args[0]; \ - args[0] = args[1]; \ - args[1] = L; \ - } - - -#define DO_DEPTH \ - args[0] = CUR.top; - - -#define DO_CINDEX \ - { \ - FT_Long L; \ - \ - \ - L = args[0]; \ - \ - if ( L <= 0 || L > CUR.args ) \ - CUR.error = TT_Err_Invalid_Reference; \ - else \ - args[0] = CUR.stack[CUR.args - L]; \ - } - - -#define DO_JROT \ - if ( args[1] != 0 ) \ - { \ - CUR.IP += args[0]; \ - CUR.step_ins = FALSE; \ - } - - -#define DO_JMPR \ - CUR.IP += args[0]; \ - CUR.step_ins = FALSE; - - -#define DO_JROF \ - if ( args[1] == 0 ) \ - { \ - CUR.IP += args[0]; \ - CUR.step_ins = FALSE; \ - } - - -#define DO_LT \ - args[0] = ( args[0] < args[1] ); - - -#define DO_LTEQ \ - args[0] = ( args[0] <= args[1] ); - - -#define DO_GT \ - args[0] = ( args[0] > args[1] ); - - -#define DO_GTEQ \ - args[0] = ( args[0] >= args[1] ); - - -#define DO_EQ \ - args[0] = ( args[0] == args[1] ); - - -#define DO_NEQ \ - args[0] = ( args[0] != args[1] ); - - -#define DO_ODD \ - args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 64 ); - - -#define DO_EVEN \ - args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 0 ); - - -#define DO_AND \ - args[0] = ( args[0] && args[1] ); - - -#define DO_OR \ - args[0] = ( args[0] || args[1] ); - - -#define DO_NOT \ - args[0] = !args[0]; - - -#define DO_ADD \ - args[0] += args[1]; - - -#define DO_SUB \ - args[0] -= args[1]; - - -#define DO_DIV \ - if ( args[1] == 0 ) \ - CUR.error = TT_Err_Divide_By_Zero; \ - else \ - args[0] = TT_MULDIV_NO_ROUND( args[0], 64L, args[1] ); - - -#define DO_MUL \ - args[0] = TT_MULDIV( args[0], args[1], 64L ); - - -#define DO_ABS \ - args[0] = FT_ABS( args[0] ); - - -#define DO_NEG \ - args[0] = -args[0]; - - -#define DO_FLOOR \ - args[0] = FT_PIX_FLOOR( args[0] ); - - -#define DO_CEILING \ - args[0] = FT_PIX_CEIL( args[0] ); - - -#define DO_RS \ - { \ - FT_ULong I = (FT_ULong)args[0]; \ - \ - \ - if ( BOUNDS( I, CUR.storeSize ) ) \ - { \ - if ( CUR.pedantic_hinting ) \ - { \ - ARRAY_BOUND_ERROR; \ - } \ - else \ - args[0] = 0; \ - } \ - else \ - args[0] = CUR.storage[I]; \ - } - - -#define DO_WS \ - { \ - FT_ULong I = (FT_ULong)args[0]; \ - \ - \ - if ( BOUNDS( I, CUR.storeSize ) ) \ - { \ - if ( CUR.pedantic_hinting ) \ - { \ - ARRAY_BOUND_ERROR; \ - } \ - } \ - else \ - CUR.storage[I] = args[1]; \ - } - - -#define DO_RCVT \ - { \ - FT_ULong I = (FT_ULong)args[0]; \ - \ - \ - if ( BOUNDS( I, CUR.cvtSize ) ) \ - { \ - if ( CUR.pedantic_hinting ) \ - { \ - ARRAY_BOUND_ERROR; \ - } \ - else \ - args[0] = 0; \ - } \ - else \ - args[0] = CUR_Func_read_cvt( I ); \ - } - - -#define DO_WCVTP \ - { \ - FT_ULong I = (FT_ULong)args[0]; \ - \ - \ - if ( BOUNDS( I, CUR.cvtSize ) ) \ - { \ - if ( CUR.pedantic_hinting ) \ - { \ - ARRAY_BOUND_ERROR; \ - } \ - } \ - else \ - CUR_Func_write_cvt( I, args[1] ); \ - } - - -#define DO_WCVTF \ - { \ - FT_ULong I = (FT_ULong)args[0]; \ - \ - \ - if ( BOUNDS( I, CUR.cvtSize ) ) \ - { \ - if ( CUR.pedantic_hinting ) \ - { \ - ARRAY_BOUND_ERROR; \ - } \ - } \ - else \ - CUR.cvt[I] = TT_MULFIX( args[1], CUR.tt_metrics.scale ); \ - } - - -#define DO_DEBUG \ - CUR.error = TT_Err_Debug_OpCode; - - -#define DO_ROUND \ - args[0] = CUR_Func_round( \ - args[0], \ - CUR.tt_metrics.compensations[CUR.opcode - 0x68] ); - - -#define DO_NROUND \ - args[0] = ROUND_None( args[0], \ - CUR.tt_metrics.compensations[CUR.opcode - 0x6C] ); - - -#define DO_MAX \ - if ( args[1] > args[0] ) \ - args[0] = args[1]; - - -#define DO_MIN \ - if ( args[1] < args[0] ) \ - args[0] = args[1]; - - -#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH - - -#undef ARRAY_BOUND_ERROR -#define ARRAY_BOUND_ERROR \ - { \ - CUR.error = TT_Err_Invalid_Reference; \ - return; \ - } - - - /*************************************************************************/ - /* */ - /* SVTCA[a]: Set (F and P) Vectors to Coordinate Axis */ - /* Opcode range: 0x00-0x01 */ - /* Stack: --> */ - /* */ - static void - Ins_SVTCA( INS_ARG ) - { - DO_SVTCA - } - - - /*************************************************************************/ - /* */ - /* SPVTCA[a]: Set PVector to Coordinate Axis */ - /* Opcode range: 0x02-0x03 */ - /* Stack: --> */ - /* */ - static void - Ins_SPVTCA( INS_ARG ) - { - DO_SPVTCA - } - - - /*************************************************************************/ - /* */ - /* SFVTCA[a]: Set FVector to Coordinate Axis */ - /* Opcode range: 0x04-0x05 */ - /* Stack: --> */ - /* */ - static void - Ins_SFVTCA( INS_ARG ) - { - DO_SFVTCA - } - - - /*************************************************************************/ - /* */ - /* SPVTL[a]: Set PVector To Line */ - /* Opcode range: 0x06-0x07 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_SPVTL( INS_ARG ) - { - DO_SPVTL - } - - - /*************************************************************************/ - /* */ - /* SFVTL[a]: Set FVector To Line */ - /* Opcode range: 0x08-0x09 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_SFVTL( INS_ARG ) - { - DO_SFVTL - } - - - /*************************************************************************/ - /* */ - /* SFVTPV[]: Set FVector To PVector */ - /* Opcode range: 0x0E */ - /* Stack: --> */ - /* */ - static void - Ins_SFVTPV( INS_ARG ) - { - DO_SFVTPV - } - - - /*************************************************************************/ - /* */ - /* SPVFS[]: Set PVector From Stack */ - /* Opcode range: 0x0A */ - /* Stack: f2.14 f2.14 --> */ - /* */ - static void - Ins_SPVFS( INS_ARG ) - { - DO_SPVFS - } - - - /*************************************************************************/ - /* */ - /* SFVFS[]: Set FVector From Stack */ - /* Opcode range: 0x0B */ - /* Stack: f2.14 f2.14 --> */ - /* */ - static void - Ins_SFVFS( INS_ARG ) - { - DO_SFVFS - } - - - /*************************************************************************/ - /* */ - /* GPV[]: Get Projection Vector */ - /* Opcode range: 0x0C */ - /* Stack: ef2.14 --> ef2.14 */ - /* */ - static void - Ins_GPV( INS_ARG ) - { - DO_GPV - } - - - /*************************************************************************/ - /* GFV[]: Get Freedom Vector */ - /* Opcode range: 0x0D */ - /* Stack: ef2.14 --> ef2.14 */ - /* */ - static void - Ins_GFV( INS_ARG ) - { - DO_GFV - } - - - /*************************************************************************/ - /* */ - /* SRP0[]: Set Reference Point 0 */ - /* Opcode range: 0x10 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SRP0( INS_ARG ) - { - DO_SRP0 - } - - - /*************************************************************************/ - /* */ - /* SRP1[]: Set Reference Point 1 */ - /* Opcode range: 0x11 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SRP1( INS_ARG ) - { - DO_SRP1 - } - - - /*************************************************************************/ - /* */ - /* SRP2[]: Set Reference Point 2 */ - /* Opcode range: 0x12 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SRP2( INS_ARG ) - { - DO_SRP2 - } - - - /*************************************************************************/ - /* */ - /* RTHG[]: Round To Half Grid */ - /* Opcode range: 0x19 */ - /* Stack: --> */ - /* */ - static void - Ins_RTHG( INS_ARG ) - { - DO_RTHG - } - - - /*************************************************************************/ - /* */ - /* RTG[]: Round To Grid */ - /* Opcode range: 0x18 */ - /* Stack: --> */ - /* */ - static void - Ins_RTG( INS_ARG ) - { - DO_RTG - } - - - /*************************************************************************/ - /* RTDG[]: Round To Double Grid */ - /* Opcode range: 0x3D */ - /* Stack: --> */ - /* */ - static void - Ins_RTDG( INS_ARG ) - { - DO_RTDG - } - - - /*************************************************************************/ - /* RUTG[]: Round Up To Grid */ - /* Opcode range: 0x7C */ - /* Stack: --> */ - /* */ - static void - Ins_RUTG( INS_ARG ) - { - DO_RUTG - } - - - /*************************************************************************/ - /* */ - /* RDTG[]: Round Down To Grid */ - /* Opcode range: 0x7D */ - /* Stack: --> */ - /* */ - static void - Ins_RDTG( INS_ARG ) - { - DO_RDTG - } - - - /*************************************************************************/ - /* */ - /* ROFF[]: Round OFF */ - /* Opcode range: 0x7A */ - /* Stack: --> */ - /* */ - static void - Ins_ROFF( INS_ARG ) - { - DO_ROFF - } - - - /*************************************************************************/ - /* */ - /* SROUND[]: Super ROUND */ - /* Opcode range: 0x76 */ - /* Stack: Eint8 --> */ - /* */ - static void - Ins_SROUND( INS_ARG ) - { - DO_SROUND - } - - - /*************************************************************************/ - /* */ - /* S45ROUND[]: Super ROUND 45 degrees */ - /* Opcode range: 0x77 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_S45ROUND( INS_ARG ) - { - DO_S45ROUND - } - - - /*************************************************************************/ - /* */ - /* SLOOP[]: Set LOOP variable */ - /* Opcode range: 0x17 */ - /* Stack: int32? --> */ - /* */ - static void - Ins_SLOOP( INS_ARG ) - { - DO_SLOOP - } - - - /*************************************************************************/ - /* */ - /* SMD[]: Set Minimum Distance */ - /* Opcode range: 0x1A */ - /* Stack: f26.6 --> */ - /* */ - static void - Ins_SMD( INS_ARG ) - { - DO_SMD - } - - - /*************************************************************************/ - /* */ - /* SCVTCI[]: Set Control Value Table Cut In */ - /* Opcode range: 0x1D */ - /* Stack: f26.6 --> */ - /* */ - static void - Ins_SCVTCI( INS_ARG ) - { - DO_SCVTCI - } - - - /*************************************************************************/ - /* */ - /* SSWCI[]: Set Single Width Cut In */ - /* Opcode range: 0x1E */ - /* Stack: f26.6 --> */ - /* */ - static void - Ins_SSWCI( INS_ARG ) - { - DO_SSWCI - } - - - /*************************************************************************/ - /* */ - /* SSW[]: Set Single Width */ - /* Opcode range: 0x1F */ - /* Stack: int32? --> */ - /* */ - static void - Ins_SSW( INS_ARG ) - { - DO_SSW - } - - - /*************************************************************************/ - /* */ - /* FLIPON[]: Set auto-FLIP to ON */ - /* Opcode range: 0x4D */ - /* Stack: --> */ - /* */ - static void - Ins_FLIPON( INS_ARG ) - { - DO_FLIPON - } - - - /*************************************************************************/ - /* */ - /* FLIPOFF[]: Set auto-FLIP to OFF */ - /* Opcode range: 0x4E */ - /* Stack: --> */ - /* */ - static void - Ins_FLIPOFF( INS_ARG ) - { - DO_FLIPOFF - } - - - /*************************************************************************/ - /* */ - /* SANGW[]: Set ANGle Weight */ - /* Opcode range: 0x7E */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SANGW( INS_ARG ) - { - /* instruction not supported anymore */ - } - - - /*************************************************************************/ - /* */ - /* SDB[]: Set Delta Base */ - /* Opcode range: 0x5E */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SDB( INS_ARG ) - { - DO_SDB - } - - - /*************************************************************************/ - /* */ - /* SDS[]: Set Delta Shift */ - /* Opcode range: 0x5F */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SDS( INS_ARG ) - { - DO_SDS - } - - - /*************************************************************************/ - /* */ - /* MPPEM[]: Measure Pixel Per EM */ - /* Opcode range: 0x4B */ - /* Stack: --> Euint16 */ - /* */ - static void - Ins_MPPEM( INS_ARG ) - { - DO_MPPEM - } - - - /*************************************************************************/ - /* */ - /* MPS[]: Measure Point Size */ - /* Opcode range: 0x4C */ - /* Stack: --> Euint16 */ - /* */ - static void - Ins_MPS( INS_ARG ) - { - DO_MPS - } - - - /*************************************************************************/ - /* */ - /* DUP[]: DUPlicate the top stack's element */ - /* Opcode range: 0x20 */ - /* Stack: StkElt --> StkElt StkElt */ - /* */ - static void - Ins_DUP( INS_ARG ) - { - DO_DUP - } - - - /*************************************************************************/ - /* */ - /* POP[]: POP the stack's top element */ - /* Opcode range: 0x21 */ - /* Stack: StkElt --> */ - /* */ - static void - Ins_POP( INS_ARG ) - { - /* nothing to do */ - } - - - /*************************************************************************/ - /* */ - /* CLEAR[]: CLEAR the entire stack */ - /* Opcode range: 0x22 */ - /* Stack: StkElt... --> */ - /* */ - static void - Ins_CLEAR( INS_ARG ) - { - DO_CLEAR - } - - - /*************************************************************************/ - /* */ - /* SWAP[]: SWAP the stack's top two elements */ - /* Opcode range: 0x23 */ - /* Stack: 2 * StkElt --> 2 * StkElt */ - /* */ - static void - Ins_SWAP( INS_ARG ) - { - DO_SWAP - } - - - /*************************************************************************/ - /* */ - /* DEPTH[]: return the stack DEPTH */ - /* Opcode range: 0x24 */ - /* Stack: --> uint32 */ - /* */ - static void - Ins_DEPTH( INS_ARG ) - { - DO_DEPTH - } - - - /*************************************************************************/ - /* */ - /* CINDEX[]: Copy INDEXed element */ - /* Opcode range: 0x25 */ - /* Stack: int32 --> StkElt */ - /* */ - static void - Ins_CINDEX( INS_ARG ) - { - DO_CINDEX - } - - - /*************************************************************************/ - /* */ - /* EIF[]: End IF */ - /* Opcode range: 0x59 */ - /* Stack: --> */ - /* */ - static void - Ins_EIF( INS_ARG ) - { - /* nothing to do */ - } - - - /*************************************************************************/ - /* */ - /* JROT[]: Jump Relative On True */ - /* Opcode range: 0x78 */ - /* Stack: StkElt int32 --> */ - /* */ - static void - Ins_JROT( INS_ARG ) - { - DO_JROT - } - - - /*************************************************************************/ - /* */ - /* JMPR[]: JuMP Relative */ - /* Opcode range: 0x1C */ - /* Stack: int32 --> */ - /* */ - static void - Ins_JMPR( INS_ARG ) - { - DO_JMPR - } - - - /*************************************************************************/ - /* */ - /* JROF[]: Jump Relative On False */ - /* Opcode range: 0x79 */ - /* Stack: StkElt int32 --> */ - /* */ - static void - Ins_JROF( INS_ARG ) - { - DO_JROF - } - - - /*************************************************************************/ - /* */ - /* LT[]: Less Than */ - /* Opcode range: 0x50 */ - /* Stack: int32? int32? --> bool */ - /* */ - static void - Ins_LT( INS_ARG ) - { - DO_LT - } - - - /*************************************************************************/ - /* */ - /* LTEQ[]: Less Than or EQual */ - /* Opcode range: 0x51 */ - /* Stack: int32? int32? --> bool */ - /* */ - static void - Ins_LTEQ( INS_ARG ) - { - DO_LTEQ - } - - - /*************************************************************************/ - /* */ - /* GT[]: Greater Than */ - /* Opcode range: 0x52 */ - /* Stack: int32? int32? --> bool */ - /* */ - static void - Ins_GT( INS_ARG ) - { - DO_GT - } - - - /*************************************************************************/ - /* */ - /* GTEQ[]: Greater Than or EQual */ - /* Opcode range: 0x53 */ - /* Stack: int32? int32? --> bool */ - /* */ - static void - Ins_GTEQ( INS_ARG ) - { - DO_GTEQ - } - - - /*************************************************************************/ - /* */ - /* EQ[]: EQual */ - /* Opcode range: 0x54 */ - /* Stack: StkElt StkElt --> bool */ - /* */ - static void - Ins_EQ( INS_ARG ) - { - DO_EQ - } - - - /*************************************************************************/ - /* */ - /* NEQ[]: Not EQual */ - /* Opcode range: 0x55 */ - /* Stack: StkElt StkElt --> bool */ - /* */ - static void - Ins_NEQ( INS_ARG ) - { - DO_NEQ - } - - - /*************************************************************************/ - /* */ - /* ODD[]: Is ODD */ - /* Opcode range: 0x56 */ - /* Stack: f26.6 --> bool */ - /* */ - static void - Ins_ODD( INS_ARG ) - { - DO_ODD - } - - - /*************************************************************************/ - /* */ - /* EVEN[]: Is EVEN */ - /* Opcode range: 0x57 */ - /* Stack: f26.6 --> bool */ - /* */ - static void - Ins_EVEN( INS_ARG ) - { - DO_EVEN - } - - - /*************************************************************************/ - /* */ - /* AND[]: logical AND */ - /* Opcode range: 0x5A */ - /* Stack: uint32 uint32 --> uint32 */ - /* */ - static void - Ins_AND( INS_ARG ) - { - DO_AND - } - - - /*************************************************************************/ - /* */ - /* OR[]: logical OR */ - /* Opcode range: 0x5B */ - /* Stack: uint32 uint32 --> uint32 */ - /* */ - static void - Ins_OR( INS_ARG ) - { - DO_OR - } - - - /*************************************************************************/ - /* */ - /* NOT[]: logical NOT */ - /* Opcode range: 0x5C */ - /* Stack: StkElt --> uint32 */ - /* */ - static void - Ins_NOT( INS_ARG ) - { - DO_NOT - } - - - /*************************************************************************/ - /* */ - /* ADD[]: ADD */ - /* Opcode range: 0x60 */ - /* Stack: f26.6 f26.6 --> f26.6 */ - /* */ - static void - Ins_ADD( INS_ARG ) - { - DO_ADD - } - - - /*************************************************************************/ - /* */ - /* SUB[]: SUBtract */ - /* Opcode range: 0x61 */ - /* Stack: f26.6 f26.6 --> f26.6 */ - /* */ - static void - Ins_SUB( INS_ARG ) - { - DO_SUB - } - - - /*************************************************************************/ - /* */ - /* DIV[]: DIVide */ - /* Opcode range: 0x62 */ - /* Stack: f26.6 f26.6 --> f26.6 */ - /* */ - static void - Ins_DIV( INS_ARG ) - { - DO_DIV - } - - - /*************************************************************************/ - /* */ - /* MUL[]: MULtiply */ - /* Opcode range: 0x63 */ - /* Stack: f26.6 f26.6 --> f26.6 */ - /* */ - static void - Ins_MUL( INS_ARG ) - { - DO_MUL - } - - - /*************************************************************************/ - /* */ - /* ABS[]: ABSolute value */ - /* Opcode range: 0x64 */ - /* Stack: f26.6 --> f26.6 */ - /* */ - static void - Ins_ABS( INS_ARG ) - { - DO_ABS - } - - - /*************************************************************************/ - /* */ - /* NEG[]: NEGate */ - /* Opcode range: 0x65 */ - /* Stack: f26.6 --> f26.6 */ - /* */ - static void - Ins_NEG( INS_ARG ) - { - DO_NEG - } - - - /*************************************************************************/ - /* */ - /* FLOOR[]: FLOOR */ - /* Opcode range: 0x66 */ - /* Stack: f26.6 --> f26.6 */ - /* */ - static void - Ins_FLOOR( INS_ARG ) - { - DO_FLOOR - } - - - /*************************************************************************/ - /* */ - /* CEILING[]: CEILING */ - /* Opcode range: 0x67 */ - /* Stack: f26.6 --> f26.6 */ - /* */ - static void - Ins_CEILING( INS_ARG ) - { - DO_CEILING - } - - - /*************************************************************************/ - /* */ - /* RS[]: Read Store */ - /* Opcode range: 0x43 */ - /* Stack: uint32 --> uint32 */ - /* */ - static void - Ins_RS( INS_ARG ) - { - DO_RS - } - - - /*************************************************************************/ - /* */ - /* WS[]: Write Store */ - /* Opcode range: 0x42 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_WS( INS_ARG ) - { - DO_WS - } - - - /*************************************************************************/ - /* */ - /* WCVTP[]: Write CVT in Pixel units */ - /* Opcode range: 0x44 */ - /* Stack: f26.6 uint32 --> */ - /* */ - static void - Ins_WCVTP( INS_ARG ) - { - DO_WCVTP - } - - - /*************************************************************************/ - /* */ - /* WCVTF[]: Write CVT in Funits */ - /* Opcode range: 0x70 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_WCVTF( INS_ARG ) - { - DO_WCVTF - } - - - /*************************************************************************/ - /* */ - /* RCVT[]: Read CVT */ - /* Opcode range: 0x45 */ - /* Stack: uint32 --> f26.6 */ - /* */ - static void - Ins_RCVT( INS_ARG ) - { - DO_RCVT - } - - - /*************************************************************************/ - /* */ - /* AA[]: Adjust Angle */ - /* Opcode range: 0x7F */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_AA( INS_ARG ) - { - /* intentionally no longer supported */ - } - - - /*************************************************************************/ - /* */ - /* DEBUG[]: DEBUG. Unsupported. */ - /* Opcode range: 0x4F */ - /* Stack: uint32 --> */ - /* */ - /* Note: The original instruction pops a value from the stack. */ - /* */ - static void - Ins_DEBUG( INS_ARG ) - { - DO_DEBUG - } - - - /*************************************************************************/ - /* */ - /* ROUND[ab]: ROUND value */ - /* Opcode range: 0x68-0x6B */ - /* Stack: f26.6 --> f26.6 */ - /* */ - static void - Ins_ROUND( INS_ARG ) - { - DO_ROUND - } - - - /*************************************************************************/ - /* */ - /* NROUND[ab]: No ROUNDing of value */ - /* Opcode range: 0x6C-0x6F */ - /* Stack: f26.6 --> f26.6 */ - /* */ - static void - Ins_NROUND( INS_ARG ) - { - DO_NROUND - } - - - /*************************************************************************/ - /* */ - /* MAX[]: MAXimum */ - /* Opcode range: 0x68 */ - /* Stack: int32? int32? --> int32 */ - /* */ - static void - Ins_MAX( INS_ARG ) - { - DO_MAX - } - - - /*************************************************************************/ - /* */ - /* MIN[]: MINimum */ - /* Opcode range: 0x69 */ - /* Stack: int32? int32? --> int32 */ - /* */ - static void - Ins_MIN( INS_ARG ) - { - DO_MIN - } - - -#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */ - - - /*************************************************************************/ - /* */ - /* The following functions are called as is within the switch statement. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* MINDEX[]: Move INDEXed element */ - /* Opcode range: 0x26 */ - /* Stack: int32? --> StkElt */ - /* */ - static void - Ins_MINDEX( INS_ARG ) - { - FT_Long L, K; - - - L = args[0]; - - if ( L <= 0 || L > CUR.args ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - - K = CUR.stack[CUR.args - L]; - - FT_ARRAY_MOVE( &CUR.stack[CUR.args - L ], - &CUR.stack[CUR.args - L + 1], - ( L - 1 ) ); - - CUR.stack[CUR.args - 1] = K; - } - - - /*************************************************************************/ - /* */ - /* ROLL[]: ROLL top three elements */ - /* Opcode range: 0x8A */ - /* Stack: 3 * StkElt --> 3 * StkElt */ - /* */ - static void - Ins_ROLL( INS_ARG ) - { - FT_Long A, B, C; - - FT_UNUSED_EXEC; - - - A = args[2]; - B = args[1]; - C = args[0]; - - args[2] = C; - args[1] = A; - args[0] = B; - } - - - /*************************************************************************/ - /* */ - /* MANAGING THE FLOW OF CONTROL */ - /* */ - /* Instructions appear in the specification's order. */ - /* */ - /*************************************************************************/ - - - static FT_Bool - SkipCode( EXEC_OP ) - { - CUR.IP += CUR.length; - - if ( CUR.IP < CUR.codeSize ) - { - CUR.opcode = CUR.code[CUR.IP]; - - CUR.length = opcode_length[CUR.opcode]; - if ( CUR.length < 0 ) - { - if ( CUR.IP + 1 > CUR.codeSize ) - goto Fail_Overflow; - CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1]; - } - - if ( CUR.IP + CUR.length <= CUR.codeSize ) - return SUCCESS; - } - - Fail_Overflow: - CUR.error = TT_Err_Code_Overflow; - return FAILURE; - } - - - /*************************************************************************/ - /* */ - /* IF[]: IF test */ - /* Opcode range: 0x58 */ - /* Stack: StkElt --> */ - /* */ - static void - Ins_IF( INS_ARG ) - { - FT_Int nIfs; - FT_Bool Out; - - - if ( args[0] != 0 ) - return; - - nIfs = 1; - Out = 0; - - do - { - if ( SKIP_Code() == FAILURE ) - return; - - switch ( CUR.opcode ) - { - case 0x58: /* IF */ - nIfs++; - break; - - case 0x1B: /* ELSE */ - Out = FT_BOOL( nIfs == 1 ); - break; - - case 0x59: /* EIF */ - nIfs--; - Out = FT_BOOL( nIfs == 0 ); - break; - } - } while ( Out == 0 ); - } - - - /*************************************************************************/ - /* */ - /* ELSE[]: ELSE */ - /* Opcode range: 0x1B */ - /* Stack: --> */ - /* */ - static void - Ins_ELSE( INS_ARG ) - { - FT_Int nIfs; - - FT_UNUSED_ARG; - - - nIfs = 1; - - do - { - if ( SKIP_Code() == FAILURE ) - return; - - switch ( CUR.opcode ) - { - case 0x58: /* IF */ - nIfs++; - break; - - case 0x59: /* EIF */ - nIfs--; - break; - } - } while ( nIfs != 0 ); - } - - - /*************************************************************************/ - /* */ - /* DEFINING AND USING FUNCTIONS AND INSTRUCTIONS */ - /* */ - /* Instructions appear in the specification's order. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* FDEF[]: Function DEFinition */ - /* Opcode range: 0x2C */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_FDEF( INS_ARG ) - { - FT_ULong n; - TT_DefRecord* rec; - TT_DefRecord* limit; - - - /* some font programs are broken enough to redefine functions! */ - /* We will then parse the current table. */ - - rec = CUR.FDefs; - limit = rec + CUR.numFDefs; - n = args[0]; - - for ( ; rec < limit; rec++ ) - { - if ( rec->opc == n ) - break; - } - - if ( rec == limit ) - { - /* check that there is enough room for new functions */ - if ( CUR.numFDefs >= CUR.maxFDefs ) - { - CUR.error = TT_Err_Too_Many_Function_Defs; - return; - } - CUR.numFDefs++; - } - - rec->range = CUR.curRange; - rec->opc = n; - rec->start = CUR.IP + 1; - rec->active = TRUE; - - if ( n > CUR.maxFunc ) - CUR.maxFunc = n; - - /* Now skip the whole function definition. */ - /* We don't allow nested IDEFS & FDEFs. */ - - while ( SKIP_Code() == SUCCESS ) - { - switch ( CUR.opcode ) - { - case 0x89: /* IDEF */ - case 0x2C: /* FDEF */ - CUR.error = TT_Err_Nested_DEFS; - return; - - case 0x2D: /* ENDF */ - return; - } - } - } - - - /*************************************************************************/ - /* */ - /* ENDF[]: END Function definition */ - /* Opcode range: 0x2D */ - /* Stack: --> */ - /* */ - static void - Ins_ENDF( INS_ARG ) - { - TT_CallRec* pRec; - - FT_UNUSED_ARG; - - - if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */ - { - CUR.error = TT_Err_ENDF_In_Exec_Stream; - return; - } - - CUR.callTop--; - - pRec = &CUR.callStack[CUR.callTop]; - - pRec->Cur_Count--; - - CUR.step_ins = FALSE; - - if ( pRec->Cur_Count > 0 ) - { - CUR.callTop++; - CUR.IP = pRec->Cur_Restart; - } - else - /* Loop through the current function */ - INS_Goto_CodeRange( pRec->Caller_Range, - pRec->Caller_IP ); - - /* Exit the current call frame. */ - - /* NOTE: If the last instruction of a program is a */ - /* CALL or LOOPCALL, the return address is */ - /* always out of the code range. This is a */ - /* valid address, and it is why we do not test */ - /* the result of Ins_Goto_CodeRange() here! */ - } - - - /*************************************************************************/ - /* */ - /* CALL[]: CALL function */ - /* Opcode range: 0x2B */ - /* Stack: uint32? --> */ - /* */ - static void - Ins_CALL( INS_ARG ) - { - FT_ULong F; - TT_CallRec* pCrec; - TT_DefRecord* def; - - - /* first of all, check the index */ - - F = args[0]; - if ( BOUNDS( F, CUR.maxFunc + 1 ) ) - goto Fail; - - /* Except for some old Apple fonts, all functions in a TrueType */ - /* font are defined in increasing order, starting from 0. This */ - /* means that we normally have */ - /* */ - /* CUR.maxFunc+1 == CUR.numFDefs */ - /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */ - /* */ - /* If this isn't true, we need to look up the function table. */ - - def = CUR.FDefs + F; - if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F ) - { - /* look up the FDefs table */ - TT_DefRecord* limit; - - - def = CUR.FDefs; - limit = def + CUR.numFDefs; - - while ( def < limit && def->opc != F ) - def++; - - if ( def == limit ) - goto Fail; - } - - /* check that the function is active */ - if ( !def->active ) - goto Fail; - - /* check the call stack */ - if ( CUR.callTop >= CUR.callSize ) - { - CUR.error = TT_Err_Stack_Overflow; - return; - } - - pCrec = CUR.callStack + CUR.callTop; - - pCrec->Caller_Range = CUR.curRange; - pCrec->Caller_IP = CUR.IP + 1; - pCrec->Cur_Count = 1; - pCrec->Cur_Restart = def->start; - - CUR.callTop++; - - INS_Goto_CodeRange( def->range, - def->start ); - - CUR.step_ins = FALSE; - return; - - Fail: - CUR.error = TT_Err_Invalid_Reference; - } - - - /*************************************************************************/ - /* */ - /* LOOPCALL[]: LOOP and CALL function */ - /* Opcode range: 0x2A */ - /* Stack: uint32? Eint16? --> */ - /* */ - static void - Ins_LOOPCALL( INS_ARG ) - { - FT_ULong F; - TT_CallRec* pCrec; - TT_DefRecord* def; - - - /* first of all, check the index */ - F = args[1]; - if ( BOUNDS( F, CUR.maxFunc + 1 ) ) - goto Fail; - - /* Except for some old Apple fonts, all functions in a TrueType */ - /* font are defined in increasing order, starting from 0. This */ - /* means that we normally have */ - /* */ - /* CUR.maxFunc+1 == CUR.numFDefs */ - /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */ - /* */ - /* If this isn't true, we need to look up the function table. */ - - def = CUR.FDefs + F; - if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F ) - { - /* look up the FDefs table */ - TT_DefRecord* limit; - - - def = CUR.FDefs; - limit = def + CUR.numFDefs; - - while ( def < limit && def->opc != F ) - def++; - - if ( def == limit ) - goto Fail; - } - - /* check that the function is active */ - if ( !def->active ) - goto Fail; - - /* check stack */ - if ( CUR.callTop >= CUR.callSize ) - { - CUR.error = TT_Err_Stack_Overflow; - return; - } - - if ( args[0] > 0 ) - { - pCrec = CUR.callStack + CUR.callTop; - - pCrec->Caller_Range = CUR.curRange; - pCrec->Caller_IP = CUR.IP + 1; - pCrec->Cur_Count = (FT_Int)args[0]; - pCrec->Cur_Restart = def->start; - - CUR.callTop++; - - INS_Goto_CodeRange( def->range, def->start ); - - CUR.step_ins = FALSE; - } - return; - - Fail: - CUR.error = TT_Err_Invalid_Reference; - } - - - /*************************************************************************/ - /* */ - /* IDEF[]: Instruction DEFinition */ - /* Opcode range: 0x89 */ - /* Stack: Eint8 --> */ - /* */ - static void - Ins_IDEF( INS_ARG ) - { - TT_DefRecord* def; - TT_DefRecord* limit; - - - /* First of all, look for the same function in our table */ - - def = CUR.IDefs; - limit = def + CUR.numIDefs; - - for ( ; def < limit; def++ ) - if ( def->opc == (FT_ULong)args[0] ) - break; - - if ( def == limit ) - { - /* check that there is enough room for a new instruction */ - if ( CUR.numIDefs >= CUR.maxIDefs ) - { - CUR.error = TT_Err_Too_Many_Instruction_Defs; - return; - } - CUR.numIDefs++; - } - - def->opc = args[0]; - def->start = CUR.IP+1; - def->range = CUR.curRange; - def->active = TRUE; - - if ( (FT_ULong)args[0] > CUR.maxIns ) - CUR.maxIns = args[0]; - - /* Now skip the whole function definition. */ - /* We don't allow nested IDEFs & FDEFs. */ - - while ( SKIP_Code() == SUCCESS ) - { - switch ( CUR.opcode ) - { - case 0x89: /* IDEF */ - case 0x2C: /* FDEF */ - CUR.error = TT_Err_Nested_DEFS; - return; - case 0x2D: /* ENDF */ - return; - } - } - } - - - /*************************************************************************/ - /* */ - /* PUSHING DATA ONTO THE INTERPRETER STACK */ - /* */ - /* Instructions appear in the specification's order. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* NPUSHB[]: PUSH N Bytes */ - /* Opcode range: 0x40 */ - /* Stack: --> uint32... */ - /* */ - static void - Ins_NPUSHB( INS_ARG ) - { - FT_UShort L, K; - - - L = (FT_UShort)CUR.code[CUR.IP + 1]; - - if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) - { - CUR.error = TT_Err_Stack_Overflow; - return; - } - - for ( K = 1; K <= L; K++ ) - args[K - 1] = CUR.code[CUR.IP + K + 1]; - - CUR.new_top += L; - } - - - /*************************************************************************/ - /* */ - /* NPUSHW[]: PUSH N Words */ - /* Opcode range: 0x41 */ - /* Stack: --> int32... */ - /* */ - static void - Ins_NPUSHW( INS_ARG ) - { - FT_UShort L, K; - - - L = (FT_UShort)CUR.code[CUR.IP + 1]; - - if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) - { - CUR.error = TT_Err_Stack_Overflow; - return; - } - - CUR.IP += 2; - - for ( K = 0; K < L; K++ ) - args[K] = GET_ShortIns(); - - CUR.step_ins = FALSE; - CUR.new_top += L; - } - - - /*************************************************************************/ - /* */ - /* PUSHB[abc]: PUSH Bytes */ - /* Opcode range: 0xB0-0xB7 */ - /* Stack: --> uint32... */ - /* */ - static void - Ins_PUSHB( INS_ARG ) - { - FT_UShort L, K; - - - L = (FT_UShort)( CUR.opcode - 0xB0 + 1 ); - - if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) - { - CUR.error = TT_Err_Stack_Overflow; - return; - } - - for ( K = 1; K <= L; K++ ) - args[K - 1] = CUR.code[CUR.IP + K]; - } - - - /*************************************************************************/ - /* */ - /* PUSHW[abc]: PUSH Words */ - /* Opcode range: 0xB8-0xBF */ - /* Stack: --> int32... */ - /* */ - static void - Ins_PUSHW( INS_ARG ) - { - FT_UShort L, K; - - - L = (FT_UShort)( CUR.opcode - 0xB8 + 1 ); - - if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) - { - CUR.error = TT_Err_Stack_Overflow; - return; - } - - CUR.IP++; - - for ( K = 0; K < L; K++ ) - args[K] = GET_ShortIns(); - - CUR.step_ins = FALSE; - } - - - /*************************************************************************/ - /* */ - /* MANAGING THE GRAPHICS STATE */ - /* */ - /* Instructions appear in the specs' order. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* GC[a]: Get Coordinate projected onto */ - /* Opcode range: 0x46-0x47 */ - /* Stack: uint32 --> f26.6 */ - /* */ - /* BULLSHIT: Measures from the original glyph must be taken along the */ - /* dual projection vector! */ - /* */ - static void - Ins_GC( INS_ARG ) - { - FT_ULong L; - FT_F26Dot6 R; - - - L = (FT_ULong)args[0]; - - if ( BOUNDS( L, CUR.zp2.n_points ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - else - R = 0; - } - else - { - if ( CUR.opcode & 1 ) - R = CUR_fast_dualproj( &CUR.zp2.org[L] ); - else - R = CUR_fast_project( &CUR.zp2.cur[L] ); - } - - args[0] = R; - } - - - /*************************************************************************/ - /* */ - /* SCFS[]: Set Coordinate From Stack */ - /* Opcode range: 0x48 */ - /* Stack: f26.6 uint32 --> */ - /* */ - /* Formula: */ - /* */ - /* OA := OA + ( value - OA.p )/( f.p ) * f */ - /* */ - static void - Ins_SCFS( INS_ARG ) - { - FT_Long K; - FT_UShort L; - - - L = (FT_UShort)args[0]; - - if ( BOUNDS( L, CUR.zp2.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - K = CUR_fast_project( &CUR.zp2.cur[L] ); - - CUR_Func_move( &CUR.zp2, L, args[1] - K ); - - /* not part of the specs, but here for safety */ - - if ( CUR.GS.gep2 == 0 ) - CUR.zp2.org[L] = CUR.zp2.cur[L]; - } - - - /*************************************************************************/ - /* */ - /* MD[a]: Measure Distance */ - /* Opcode range: 0x49-0x4A */ - /* Stack: uint32 uint32 --> f26.6 */ - /* */ - /* BULLSHIT: Measure taken in the original glyph must be along the dual */ - /* projection vector. */ - /* */ - /* Second BULLSHIT: Flag attributes are inverted! */ - /* 0 => measure distance in original outline */ - /* 1 => measure distance in grid-fitted outline */ - /* */ - /* Third one: `zp0 - zp1', and not `zp2 - zp1! */ - /* */ - static void - Ins_MD( INS_ARG ) - { - FT_UShort K, L; - FT_F26Dot6 D; - - - K = (FT_UShort)args[1]; - L = (FT_UShort)args[0]; - - if( BOUNDS( L, CUR.zp0.n_points ) || - BOUNDS( K, CUR.zp1.n_points ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - D = 0; - } - else - { - if ( CUR.opcode & 1 ) - D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K ); - else - D = CUR_Func_dualproj( CUR.zp0.org + L, CUR.zp1.org + K ); - } - - args[0] = D; - } - - - /*************************************************************************/ - /* */ - /* SDPVTL[a]: Set Dual PVector to Line */ - /* Opcode range: 0x86-0x87 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_SDPVTL( INS_ARG ) - { - FT_Long A, B, C; - FT_UShort p1, p2; /* was FT_Int in pas type ERROR */ - - - p1 = (FT_UShort)args[1]; - p2 = (FT_UShort)args[0]; - - if ( BOUNDS( p2, CUR.zp1.n_points ) || - BOUNDS( p1, CUR.zp2.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - { - FT_Vector* v1 = CUR.zp1.org + p2; - FT_Vector* v2 = CUR.zp2.org + p1; - - - A = v1->x - v2->x; - B = v1->y - v2->y; - } - - if ( ( CUR.opcode & 1 ) != 0 ) - { - C = B; /* counter clockwise rotation */ - B = A; - A = -C; - } - - NORMalize( A, B, &CUR.GS.dualVector ); - - { - FT_Vector* v1 = CUR.zp1.cur + p2; - FT_Vector* v2 = CUR.zp2.cur + p1; - - - A = v1->x - v2->x; - B = v1->y - v2->y; - } - - if ( ( CUR.opcode & 1 ) != 0 ) - { - C = B; /* counter clockwise rotation */ - B = A; - A = -C; - } - - NORMalize( A, B, &CUR.GS.projVector ); - - GUESS_VECTOR( freeVector ); - - COMPUTE_Funcs(); - } - - - /*************************************************************************/ - /* */ - /* SZP0[]: Set Zone Pointer 0 */ - /* Opcode range: 0x13 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SZP0( INS_ARG ) - { - switch ( (FT_Int)args[0] ) - { - case 0: - CUR.zp0 = CUR.twilight; - break; - - case 1: - CUR.zp0 = CUR.pts; - break; - - default: - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - CUR.GS.gep0 = (FT_UShort)args[0]; - } - - - /*************************************************************************/ - /* */ - /* SZP1[]: Set Zone Pointer 1 */ - /* Opcode range: 0x14 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SZP1( INS_ARG ) - { - switch ( (FT_Int)args[0] ) - { - case 0: - CUR.zp1 = CUR.twilight; - break; - - case 1: - CUR.zp1 = CUR.pts; - break; - - default: - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - CUR.GS.gep1 = (FT_UShort)args[0]; - } - - - /*************************************************************************/ - /* */ - /* SZP2[]: Set Zone Pointer 2 */ - /* Opcode range: 0x15 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SZP2( INS_ARG ) - { - switch ( (FT_Int)args[0] ) - { - case 0: - CUR.zp2 = CUR.twilight; - break; - - case 1: - CUR.zp2 = CUR.pts; - break; - - default: - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - CUR.GS.gep2 = (FT_UShort)args[0]; - } - - - /*************************************************************************/ - /* */ - /* SZPS[]: Set Zone PointerS */ - /* Opcode range: 0x16 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SZPS( INS_ARG ) - { - switch ( (FT_Int)args[0] ) - { - case 0: - CUR.zp0 = CUR.twilight; - break; - - case 1: - CUR.zp0 = CUR.pts; - break; - - default: - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - CUR.zp1 = CUR.zp0; - CUR.zp2 = CUR.zp0; - - CUR.GS.gep0 = (FT_UShort)args[0]; - CUR.GS.gep1 = (FT_UShort)args[0]; - CUR.GS.gep2 = (FT_UShort)args[0]; - } - - - /*************************************************************************/ - /* */ - /* INSTCTRL[]: INSTruction ConTRoL */ - /* Opcode range: 0x8e */ - /* Stack: int32 int32 --> */ - /* */ - static void - Ins_INSTCTRL( INS_ARG ) - { - FT_Long K, L; - - - K = args[1]; - L = args[0]; - - if ( K < 1 || K > 2 ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - if ( L != 0 ) - L = K; - - CUR.GS.instruct_control = FT_BOOL( - ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L ); - } - - - /*************************************************************************/ - /* */ - /* SCANCTRL[]: SCAN ConTRoL */ - /* Opcode range: 0x85 */ - /* Stack: uint32? --> */ - /* */ - static void - Ins_SCANCTRL( INS_ARG ) - { - FT_Int A; - - - /* Get Threshold */ - A = (FT_Int)( args[0] & 0xFF ); - - if ( A == 0xFF ) - { - CUR.GS.scan_control = TRUE; - return; - } - else if ( A == 0 ) - { - CUR.GS.scan_control = FALSE; - return; - } - - A *= 64; - -#if 0 - if ( ( args[0] & 0x100 ) != 0 && CUR.metrics.pointSize <= A ) - CUR.GS.scan_control = TRUE; -#endif - - if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated ) - CUR.GS.scan_control = TRUE; - - if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched ) - CUR.GS.scan_control = TRUE; - -#if 0 - if ( ( args[0] & 0x800 ) != 0 && CUR.metrics.pointSize > A ) - CUR.GS.scan_control = FALSE; -#endif - - if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated ) - CUR.GS.scan_control = FALSE; - - if ( ( args[0] & 0x2000 ) != 0 && CUR.tt_metrics.stretched ) - CUR.GS.scan_control = FALSE; - } - - - /*************************************************************************/ - /* */ - /* SCANTYPE[]: SCAN TYPE */ - /* Opcode range: 0x8D */ - /* Stack: uint32? --> */ - /* */ - static void - Ins_SCANTYPE( INS_ARG ) - { - /* for compatibility with future enhancements, */ - /* we must ignore new modes */ - - if ( args[0] >= 0 && args[0] <= 5 ) - { - if ( args[0] == 3 ) - args[0] = 2; - - CUR.GS.scan_type = (FT_Int)args[0]; - } - } - - - /*************************************************************************/ - /* */ - /* MANAGING OUTLINES */ - /* */ - /* Instructions appear in the specification's order. */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* FLIPPT[]: FLIP PoinT */ - /* Opcode range: 0x80 */ - /* Stack: uint32... --> */ - /* */ - static void - Ins_FLIPPT( INS_ARG ) - { - FT_UShort point; - - FT_UNUSED_ARG; - - - if ( CUR.top < CUR.GS.loop ) - { - CUR.error = TT_Err_Too_Few_Arguments; - return; - } - - while ( CUR.GS.loop > 0 ) - { - CUR.args--; - - point = (FT_UShort)CUR.stack[CUR.args]; - - if ( BOUNDS( point, CUR.pts.n_points ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - } - else - CUR.pts.tags[point] ^= FT_CURVE_TAG_ON; - - CUR.GS.loop--; - } - - CUR.GS.loop = 1; - CUR.new_top = CUR.args; - } - - - /*************************************************************************/ - /* */ - /* FLIPRGON[]: FLIP RanGe ON */ - /* Opcode range: 0x81 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_FLIPRGON( INS_ARG ) - { - FT_UShort I, K, L; - - - K = (FT_UShort)args[1]; - L = (FT_UShort)args[0]; - - if ( BOUNDS( K, CUR.pts.n_points ) || - BOUNDS( L, CUR.pts.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - for ( I = L; I <= K; I++ ) - CUR.pts.tags[I] |= FT_CURVE_TAG_ON; - } - - - /*************************************************************************/ - /* */ - /* FLIPRGOFF: FLIP RanGe OFF */ - /* Opcode range: 0x82 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_FLIPRGOFF( INS_ARG ) - { - FT_UShort I, K, L; - - - K = (FT_UShort)args[1]; - L = (FT_UShort)args[0]; - - if ( BOUNDS( K, CUR.pts.n_points ) || - BOUNDS( L, CUR.pts.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - for ( I = L; I <= K; I++ ) - CUR.pts.tags[I] &= ~FT_CURVE_TAG_ON; - } - - - static FT_Bool - Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x, - FT_F26Dot6* y, - TT_GlyphZone zone, - FT_UShort* refp ) - { - TT_GlyphZoneRec zp; - FT_UShort p; - FT_F26Dot6 d; - - - if ( CUR.opcode & 1 ) - { - zp = CUR.zp0; - p = CUR.GS.rp1; - } - else - { - zp = CUR.zp1; - p = CUR.GS.rp2; - } - - if ( BOUNDS( p, zp.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - *refp = 0; - return FAILURE; - } - - *zone = zp; - *refp = p; - - d = CUR_Func_project( zp.cur + p, zp.org + p ); - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - if ( CUR.face->unpatented_hinting ) - { - if ( CUR.GS.both_x_axis ) - { - *x = d; - *y = 0; - } - else - { - *x = 0; - *y = d; - } - } - else -#endif - { - *x = TT_MULDIV( d, - (FT_Long)CUR.GS.freeVector.x * 0x10000L, - CUR.F_dot_P ); - *y = TT_MULDIV( d, - (FT_Long)CUR.GS.freeVector.y * 0x10000L, - CUR.F_dot_P ); - } - - return SUCCESS; - } - - - static void - Move_Zp2_Point( EXEC_OP_ FT_UShort point, - FT_F26Dot6 dx, - FT_F26Dot6 dy, - FT_Bool touch ) - { -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - if ( CUR.face->unpatented_hinting ) - { - if ( CUR.GS.both_x_axis ) - { - CUR.zp2.cur[point].x += dx; - if ( touch ) - CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X; - } - else - { - CUR.zp2.cur[point].y += dy; - if ( touch ) - CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y; - } - return; - } -#endif - - if ( CUR.GS.freeVector.x != 0 ) - { - CUR.zp2.cur[point].x += dx; - if ( touch ) - CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X; - } - - if ( CUR.GS.freeVector.y != 0 ) - { - CUR.zp2.cur[point].y += dy; - if ( touch ) - CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y; - } - } - - - /*************************************************************************/ - /* */ - /* SHP[a]: SHift Point by the last point */ - /* Opcode range: 0x32-0x33 */ - /* Stack: uint32... --> */ - /* */ - static void - Ins_SHP( INS_ARG ) - { - TT_GlyphZoneRec zp; - FT_UShort refp; - - FT_F26Dot6 dx, - dy; - FT_UShort point; - - FT_UNUSED_ARG; - - - if ( CUR.top < CUR.GS.loop ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - - if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) ) - return; - - while ( CUR.GS.loop > 0 ) - { - CUR.args--; - point = (FT_UShort)CUR.stack[CUR.args]; - - if ( BOUNDS( point, CUR.zp2.n_points ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - } - else - /* XXX: UNDOCUMENTED! SHP touches the points */ - MOVE_Zp2_Point( point, dx, dy, TRUE ); - - CUR.GS.loop--; - } - - CUR.GS.loop = 1; - CUR.new_top = CUR.args; - } - - - /*************************************************************************/ - /* */ - /* SHC[a]: SHift Contour */ - /* Opcode range: 0x34-35 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SHC( INS_ARG ) - { - TT_GlyphZoneRec zp; - FT_UShort refp; - FT_F26Dot6 dx, - dy; - - FT_Short contour; - FT_UShort first_point, last_point, i; - - - contour = (FT_UShort)args[0]; - - if ( BOUNDS( contour, CUR.pts.n_contours ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) ) - return; - - if ( contour == 0 ) - first_point = 0; - else - first_point = (FT_UShort)( CUR.pts.contours[contour - 1] + 1 - - CUR.pts.first_point ); - - last_point = (FT_UShort)( CUR.pts.contours[contour] - - CUR.pts.first_point ); - - /* XXX: this is probably wrong... at least it prevents memory */ - /* corruption when zp2 is the twilight zone */ - if ( last_point > CUR.zp2.n_points ) - { - if ( CUR.zp2.n_points > 0 ) - last_point = (FT_UShort)(CUR.zp2.n_points - 1); - else - last_point = 0; - } - - /* XXX: UNDOCUMENTED! SHC touches the points */ - for ( i = first_point; i <= last_point; i++ ) - { - if ( zp.cur != CUR.zp2.cur || refp != i ) - MOVE_Zp2_Point( i, dx, dy, TRUE ); - } - } - - - /*************************************************************************/ - /* */ - /* SHZ[a]: SHift Zone */ - /* Opcode range: 0x36-37 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_SHZ( INS_ARG ) - { - TT_GlyphZoneRec zp; - FT_UShort refp; - FT_F26Dot6 dx, - dy; - - FT_UShort last_point, i; - - - if ( BOUNDS( args[0], 2 ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) ) - return; - - /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points. */ - /* Twilight zone has no contours, so use `n_points'. */ - /* Normal zone's `n_points' includes phantoms, so must */ - /* use end of last contour. */ - if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) - last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); - else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) - last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); - else - last_point = 0; - - /* XXX: UNDOCUMENTED! SHZ doesn't touch the points */ - for ( i = 0; i <= last_point; i++ ) - { - if ( zp.cur != CUR.zp2.cur || refp != i ) - MOVE_Zp2_Point( i, dx, dy, FALSE ); - } - } - - - /*************************************************************************/ - /* */ - /* SHPIX[]: SHift points by a PIXel amount */ - /* Opcode range: 0x38 */ - /* Stack: f26.6 uint32... --> */ - /* */ - static void - Ins_SHPIX( INS_ARG ) - { - FT_F26Dot6 dx, dy; - FT_UShort point; - - - if ( CUR.top < CUR.GS.loop + 1 ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - if ( CUR.face->unpatented_hinting ) - { - if ( CUR.GS.both_x_axis ) - { - dx = TT_MulFix14( args[0], 0x4000 ); - dy = 0; - } - else - { - dx = 0; - dy = TT_MulFix14( args[0], 0x4000 ); - } - } - else -#endif - { - dx = TT_MulFix14( args[0], CUR.GS.freeVector.x ); - dy = TT_MulFix14( args[0], CUR.GS.freeVector.y ); - } - - while ( CUR.GS.loop > 0 ) - { - CUR.args--; - - point = (FT_UShort)CUR.stack[CUR.args]; - - if ( BOUNDS( point, CUR.zp2.n_points ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - } - else - MOVE_Zp2_Point( point, dx, dy, TRUE ); - - CUR.GS.loop--; - } - - CUR.GS.loop = 1; - CUR.new_top = CUR.args; - } - - - /*************************************************************************/ - /* */ - /* MSIRP[a]: Move Stack Indirect Relative Position */ - /* Opcode range: 0x3A-0x3B */ - /* Stack: f26.6 uint32 --> */ - /* */ - static void - Ins_MSIRP( INS_ARG ) - { - FT_UShort point; - FT_F26Dot6 distance; - - - point = (FT_UShort)args[0]; - - if ( BOUNDS( point, CUR.zp1.n_points ) || - BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - /* XXX: UNDOCUMENTED! behaviour */ - if ( CUR.GS.gep1 == 0 ) /* if the point that is to be moved */ - /* is in twilight zone */ - { - CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0]; - CUR_Func_move_orig( &CUR.zp1, point, args[1] ); - CUR.zp1.cur[point] = CUR.zp1.org[point]; - } - - distance = CUR_Func_project( CUR.zp1.cur + point, - CUR.zp0.cur + CUR.GS.rp0 ); - - CUR_Func_move( &CUR.zp1, point, args[1] - distance ); - - CUR.GS.rp1 = CUR.GS.rp0; - CUR.GS.rp2 = point; - - if ( ( CUR.opcode & 1 ) != 0 ) - CUR.GS.rp0 = point; - } - - - /*************************************************************************/ - /* */ - /* MDAP[a]: Move Direct Absolute Point */ - /* Opcode range: 0x2E-0x2F */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_MDAP( INS_ARG ) - { - FT_UShort point; - FT_F26Dot6 cur_dist, - distance; - - - point = (FT_UShort)args[0]; - - if ( BOUNDS( point, CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - /* XXX: Is there some undocumented feature while in the */ - /* twilight zone? ? */ - if ( ( CUR.opcode & 1 ) != 0 ) - { - cur_dist = CUR_fast_project( &CUR.zp0.cur[point] ); - distance = CUR_Func_round( cur_dist, - CUR.tt_metrics.compensations[0] ) - cur_dist; - } - else - distance = 0; - - CUR_Func_move( &CUR.zp0, point, distance ); - - CUR.GS.rp0 = point; - CUR.GS.rp1 = point; - } - - - /*************************************************************************/ - /* */ - /* MIAP[a]: Move Indirect Absolute Point */ - /* Opcode range: 0x3E-0x3F */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_MIAP( INS_ARG ) - { - FT_ULong cvtEntry; - FT_UShort point; - FT_F26Dot6 distance, - org_dist; - - - cvtEntry = (FT_ULong)args[1]; - point = (FT_UShort)args[0]; - - if ( BOUNDS( point, CUR.zp0.n_points ) || - BOUNDS( cvtEntry, CUR.cvtSize ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - /* XXX: UNDOCUMENTED! */ - /* */ - /* The behaviour of an MIAP instruction is quite */ - /* different when used in the twilight zone. */ - /* */ - /* First, no control value cut-in test is performed */ - /* as it would fail anyway. Second, the original */ - /* point, i.e. (org_x,org_y) of zp0.point, is set */ - /* to the absolute, unrounded distance found in */ - /* the CVT. */ - /* */ - /* This is used in the CVT programs of the Microsoft */ - /* fonts Arial, Times, etc., in order to re-adjust */ - /* some key font heights. It allows the use of the */ - /* IP instruction in the twilight zone, which */ - /* otherwise would be `illegal' according to the */ - /* specification. */ - /* */ - /* We implement it with a special sequence for the */ - /* twilight zone. This is a bad hack, but it seems */ - /* to work. */ - - distance = CUR_Func_read_cvt( cvtEntry ); - - if ( CUR.GS.gep0 == 0 ) /* If in twilight zone */ - { - CUR.zp0.org[point].x = TT_MulFix14( distance, CUR.GS.freeVector.x ); - CUR.zp0.org[point].y = TT_MulFix14( distance, CUR.GS.freeVector.y ), - CUR.zp0.cur[point] = CUR.zp0.org[point]; - } - - org_dist = CUR_fast_project( &CUR.zp0.cur[point] ); - - if ( ( CUR.opcode & 1 ) != 0 ) /* rounding and control cutin flag */ - { - if ( FT_ABS( distance - org_dist ) > CUR.GS.control_value_cutin ) - distance = org_dist; - - distance = CUR_Func_round( distance, CUR.tt_metrics.compensations[0] ); - } - - CUR_Func_move( &CUR.zp0, point, distance - org_dist ); - - CUR.GS.rp0 = point; - CUR.GS.rp1 = point; - } - - - /*************************************************************************/ - /* */ - /* MDRP[abcde]: Move Direct Relative Point */ - /* Opcode range: 0xC0-0xDF */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_MDRP( INS_ARG ) - { - FT_UShort point; - FT_F26Dot6 org_dist, distance; - - - point = (FT_UShort)args[0]; - - if ( BOUNDS( point, CUR.zp1.n_points ) || - BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - /* XXX: Is there some undocumented feature while in the */ - /* twilight zone? */ - - /* XXX: UNDOCUMENTED: twilight zone special case */ - - if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 ) - { - FT_Vector* vec1 = &CUR.zp1.org[point]; - FT_Vector* vec2 = &CUR.zp0.org[CUR.GS.rp0]; - - - org_dist = CUR_Func_dualproj( vec1, vec2 ); - } - else - { - FT_Vector* vec1 = &CUR.zp1.orus[point]; - FT_Vector* vec2 = &CUR.zp0.orus[CUR.GS.rp0]; - - - if ( CUR.metrics.x_scale == CUR.metrics.y_scale ) - { - /* this should be faster */ - org_dist = CUR_Func_dualproj( vec1, vec2 ); - org_dist = TT_MULFIX( org_dist, CUR.metrics.x_scale ); - } - else - { - FT_Vector vec; - - - vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale ); - vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale ); - - org_dist = CUR_fast_dualproj( &vec ); - } - } - - /* single width cut-in test */ - - if ( FT_ABS( org_dist - CUR.GS.single_width_value ) < - CUR.GS.single_width_cutin ) - { - if ( org_dist >= 0 ) - org_dist = CUR.GS.single_width_value; - else - org_dist = -CUR.GS.single_width_value; - } - - /* round flag */ - - if ( ( CUR.opcode & 4 ) != 0 ) - distance = CUR_Func_round( - org_dist, - CUR.tt_metrics.compensations[CUR.opcode & 3] ); - else - distance = ROUND_None( - org_dist, - CUR.tt_metrics.compensations[CUR.opcode & 3] ); - - /* minimum distance flag */ - - if ( ( CUR.opcode & 8 ) != 0 ) - { - if ( org_dist >= 0 ) - { - if ( distance < CUR.GS.minimum_distance ) - distance = CUR.GS.minimum_distance; - } - else - { - if ( distance > -CUR.GS.minimum_distance ) - distance = -CUR.GS.minimum_distance; - } - } - - /* now move the point */ - - org_dist = CUR_Func_project( CUR.zp1.cur + point, - CUR.zp0.cur + CUR.GS.rp0 ); - - CUR_Func_move( &CUR.zp1, point, distance - org_dist ); - - CUR.GS.rp1 = CUR.GS.rp0; - CUR.GS.rp2 = point; - - if ( ( CUR.opcode & 16 ) != 0 ) - CUR.GS.rp0 = point; - } - - - /*************************************************************************/ - /* */ - /* MIRP[abcde]: Move Indirect Relative Point */ - /* Opcode range: 0xE0-0xFF */ - /* Stack: int32? uint32 --> */ - /* */ - static void - Ins_MIRP( INS_ARG ) - { - FT_UShort point; - FT_ULong cvtEntry; - - FT_F26Dot6 cvt_dist, - distance, - cur_dist, - org_dist; - - - point = (FT_UShort)args[0]; - cvtEntry = (FT_ULong)( args[1] + 1 ); - - /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ - - if ( BOUNDS( point, CUR.zp1.n_points ) || - BOUNDS( cvtEntry, CUR.cvtSize + 1 ) || - BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - if ( !cvtEntry ) - cvt_dist = 0; - else - cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 ); - - /* single width test */ - - if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) < - CUR.GS.single_width_cutin ) - { - if ( cvt_dist >= 0 ) - cvt_dist = CUR.GS.single_width_value; - else - cvt_dist = -CUR.GS.single_width_value; - } - - /* XXX: UNDOCUMENTED! -- twilight zone */ - - if ( CUR.GS.gep1 == 0 ) - { - CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x + - TT_MulFix14( cvt_dist, CUR.GS.freeVector.x ); - - CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y + - TT_MulFix14( cvt_dist, CUR.GS.freeVector.y ); - - CUR.zp1.cur[point] = CUR.zp0.cur[point]; - } - - org_dist = CUR_Func_dualproj( &CUR.zp1.org[point], - &CUR.zp0.org[CUR.GS.rp0] ); - cur_dist = CUR_Func_project ( &CUR.zp1.cur[point], - &CUR.zp0.cur[CUR.GS.rp0] ); - - /* auto-flip test */ - - if ( CUR.GS.auto_flip ) - { - if ( ( org_dist ^ cvt_dist ) < 0 ) - cvt_dist = -cvt_dist; - } - - /* control value cutin and round */ - - if ( ( CUR.opcode & 4 ) != 0 ) - { - /* XXX: UNDOCUMENTED! Only perform cut-in test when both points */ - /* refer to the same zone. */ - - if ( CUR.GS.gep0 == CUR.GS.gep1 ) - if ( FT_ABS( cvt_dist - org_dist ) >= CUR.GS.control_value_cutin ) - cvt_dist = org_dist; - - distance = CUR_Func_round( - cvt_dist, - CUR.tt_metrics.compensations[CUR.opcode & 3] ); - } - else - distance = ROUND_None( - cvt_dist, - CUR.tt_metrics.compensations[CUR.opcode & 3] ); - - /* minimum distance test */ - - if ( ( CUR.opcode & 8 ) != 0 ) - { - if ( org_dist >= 0 ) - { - if ( distance < CUR.GS.minimum_distance ) - distance = CUR.GS.minimum_distance; - } - else - { - if ( distance > -CUR.GS.minimum_distance ) - distance = -CUR.GS.minimum_distance; - } - } - - CUR_Func_move( &CUR.zp1, point, distance - cur_dist ); - - CUR.GS.rp1 = CUR.GS.rp0; - - if ( ( CUR.opcode & 16 ) != 0 ) - CUR.GS.rp0 = point; - - /* XXX: UNDOCUMENTED! */ - CUR.GS.rp2 = point; - } - - - /*************************************************************************/ - /* */ - /* ALIGNRP[]: ALIGN Relative Point */ - /* Opcode range: 0x3C */ - /* Stack: uint32 uint32... --> */ - /* */ - static void - Ins_ALIGNRP( INS_ARG ) - { - FT_UShort point; - FT_F26Dot6 distance; - - FT_UNUSED_ARG; - - - if ( CUR.top < CUR.GS.loop || - BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - while ( CUR.GS.loop > 0 ) - { - CUR.args--; - - point = (FT_UShort)CUR.stack[CUR.args]; - - if ( BOUNDS( point, CUR.zp1.n_points ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - } - else - { - distance = CUR_Func_project( CUR.zp1.cur + point, - CUR.zp0.cur + CUR.GS.rp0 ); - - CUR_Func_move( &CUR.zp1, point, -distance ); - } - - CUR.GS.loop--; - } - - CUR.GS.loop = 1; - CUR.new_top = CUR.args; - } - - - /*************************************************************************/ - /* */ - /* ISECT[]: moves point to InterSECTion */ - /* Opcode range: 0x0F */ - /* Stack: 5 * uint32 --> */ - /* */ - static void - Ins_ISECT( INS_ARG ) - { - FT_UShort point, - a0, a1, - b0, b1; - - FT_F26Dot6 discriminant; - - FT_F26Dot6 dx, dy, - dax, day, - dbx, dby; - - FT_F26Dot6 val; - - FT_Vector R; - - - point = (FT_UShort)args[0]; - - a0 = (FT_UShort)args[1]; - a1 = (FT_UShort)args[2]; - b0 = (FT_UShort)args[3]; - b1 = (FT_UShort)args[4]; - - if ( BOUNDS( b0, CUR.zp0.n_points ) || - BOUNDS( b1, CUR.zp0.n_points ) || - BOUNDS( a0, CUR.zp1.n_points ) || - BOUNDS( a1, CUR.zp1.n_points ) || - BOUNDS( point, CUR.zp2.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x; - dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y; - - dax = CUR.zp1.cur[a1].x - CUR.zp1.cur[a0].x; - day = CUR.zp1.cur[a1].y - CUR.zp1.cur[a0].y; - - dx = CUR.zp0.cur[b0].x - CUR.zp1.cur[a0].x; - dy = CUR.zp0.cur[b0].y - CUR.zp1.cur[a0].y; - - CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH; - - discriminant = TT_MULDIV( dax, -dby, 0x40 ) + - TT_MULDIV( day, dbx, 0x40 ); - - if ( FT_ABS( discriminant ) >= 0x40 ) - { - val = TT_MULDIV( dx, -dby, 0x40 ) + TT_MULDIV( dy, dbx, 0x40 ); - - R.x = TT_MULDIV( val, dax, discriminant ); - R.y = TT_MULDIV( val, day, discriminant ); - - CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x; - CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y; - } - else - { - /* else, take the middle of the middles of A and B */ - - CUR.zp2.cur[point].x = ( CUR.zp1.cur[a0].x + - CUR.zp1.cur[a1].x + - CUR.zp0.cur[b0].x + - CUR.zp0.cur[b1].x ) / 4; - CUR.zp2.cur[point].y = ( CUR.zp1.cur[a0].y + - CUR.zp1.cur[a1].y + - CUR.zp0.cur[b0].y + - CUR.zp0.cur[b1].y ) / 4; - } - } - - - /*************************************************************************/ - /* */ - /* ALIGNPTS[]: ALIGN PoinTS */ - /* Opcode range: 0x27 */ - /* Stack: uint32 uint32 --> */ - /* */ - static void - Ins_ALIGNPTS( INS_ARG ) - { - FT_UShort p1, p2; - FT_F26Dot6 distance; - - - p1 = (FT_UShort)args[0]; - p2 = (FT_UShort)args[1]; - - if ( BOUNDS( args[0], CUR.zp1.n_points ) || - BOUNDS( args[1], CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - distance = CUR_Func_project( CUR.zp0.cur + p2, - CUR.zp1.cur + p1 ) / 2; - - CUR_Func_move( &CUR.zp1, p1, distance ); - CUR_Func_move( &CUR.zp0, p2, -distance ); - } - - - /*************************************************************************/ - /* */ - /* IP[]: Interpolate Point */ - /* Opcode range: 0x39 */ - /* Stack: uint32... --> */ - /* */ - - /* SOMETIMES, DUMBER CODE IS BETTER CODE */ - - static void - Ins_IP( INS_ARG ) - { - FT_F26Dot6 old_range, cur_range; - FT_Vector* orus_base; - FT_Vector* cur_base; - FT_Int twilight; - - FT_UNUSED_ARG; - - - if ( CUR.top < CUR.GS.loop ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - - /* - * We need to deal in a special way with the twilight zone. - * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0), - * for every n. - */ - twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0; - - if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - if ( twilight ) - orus_base = &CUR.zp0.org[CUR.GS.rp1]; - else - orus_base = &CUR.zp0.orus[CUR.GS.rp1]; - - cur_base = &CUR.zp0.cur[CUR.GS.rp1]; - - /* XXX: There are some glyphs in some braindead but popular */ - /* fonts out there (e.g. [aeu]grave in monotype.ttf) */ - /* calling IP[] with bad values of rp[12]. */ - /* Do something sane when this odd thing happens. */ - if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) || - BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) ) - { - old_range = 0; - cur_range = 0; - } - else - { - if ( twilight ) - old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2], - orus_base ); - else - old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2], - orus_base ); - - cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base ); - } - - for ( ; CUR.GS.loop > 0; --CUR.GS.loop ) - { - FT_UInt point = (FT_UInt)CUR.stack[--CUR.args]; - FT_F26Dot6 org_dist, cur_dist, new_dist; - - - /* check point bounds */ - if ( BOUNDS( point, CUR.zp2.n_points ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - continue; - } - - if ( twilight ) - org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base ); - else - org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base ); - - cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base ); - new_dist = ( old_range != 0 ) - ? TT_MULDIV( org_dist, cur_range, old_range ) - : cur_dist; - - CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist ); - } - CUR.GS.loop = 1; - CUR.new_top = CUR.args; - } - - - /*************************************************************************/ - /* */ - /* UTP[a]: UnTouch Point */ - /* Opcode range: 0x29 */ - /* Stack: uint32 --> */ - /* */ - static void - Ins_UTP( INS_ARG ) - { - FT_UShort point; - FT_Byte mask; - - - point = (FT_UShort)args[0]; - - if ( BOUNDS( point, CUR.zp0.n_points ) ) - { - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - return; - } - - mask = 0xFF; - - if ( CUR.GS.freeVector.x != 0 ) - mask &= ~FT_CURVE_TAG_TOUCH_X; - - if ( CUR.GS.freeVector.y != 0 ) - mask &= ~FT_CURVE_TAG_TOUCH_Y; - - CUR.zp0.tags[point] &= mask; - } - - - /* Local variables for Ins_IUP: */ - typedef struct - { - FT_Vector* orgs; /* original and current coordinate */ - FT_Vector* curs; /* arrays */ - FT_Vector* orus; - FT_UInt max_points; - - } IUP_WorkerRec, *IUP_Worker; - - - static void - _iup_worker_shift( IUP_Worker worker, - FT_UInt p1, - FT_UInt p2, - FT_UInt p ) - { - FT_UInt i; - FT_F26Dot6 dx; - - - dx = worker->curs[p].x - worker->orgs[p].x; - if ( dx != 0 ) - { - for ( i = p1; i < p; i++ ) - worker->curs[i].x += dx; - - for ( i = p + 1; i <= p2; i++ ) - worker->curs[i].x += dx; - } - } - - - static void - _iup_worker_interpolate( IUP_Worker worker, - FT_UInt p1, - FT_UInt p2, - FT_UInt ref1, - FT_UInt ref2 ) - { - FT_UInt i; - FT_F26Dot6 orus1, orus2, org1, org2, delta1, delta2; - - - if ( p1 > p2 ) - return; - - if ( BOUNDS( ref1, worker->max_points ) || - BOUNDS( ref2, worker->max_points ) ) - return; - - orus1 = worker->orus[ref1].x; - orus2 = worker->orus[ref2].x; - - if ( orus1 > orus2 ) - { - FT_F26Dot6 tmp_o; - FT_UInt tmp_r; - - - tmp_o = orus1; - orus1 = orus2; - orus2 = tmp_o; - - tmp_r = ref1; - ref1 = ref2; - ref2 = tmp_r; - } - - org1 = worker->orgs[ref1].x; - org2 = worker->orgs[ref2].x; - delta1 = worker->curs[ref1].x - org1; - delta2 = worker->curs[ref2].x - org2; - - if ( orus1 == orus2 ) - { - /* simple shift of untouched points */ - for ( i = p1; i <= p2; i++ ) - { - FT_F26Dot6 x = worker->orgs[i].x; - - - if ( x <= org1 ) - x += delta1; - else - x += delta2; - - worker->curs[i].x = x; - } - } - else - { - FT_Fixed scale = 0; - FT_Bool scale_valid = 0; - - - /* interpolation */ - for ( i = p1; i <= p2; i++ ) - { - FT_F26Dot6 x = worker->orgs[i].x; - - - if ( x <= org1 ) - x += delta1; - - else if ( x >= org2 ) - x += delta2; - - else - { - if ( !scale_valid ) - { - scale_valid = 1; - scale = TT_MULDIV( org2 + delta2 - ( org1 + delta1 ), - 0x10000, orus2 - orus1 ); - } - - x = ( org1 + delta1 ) + - TT_MULFIX( worker->orus[i].x - orus1, scale ); - } - worker->curs[i].x = x; - } - } - } - - - /*************************************************************************/ - /* */ - /* IUP[a]: Interpolate Untouched Points */ - /* Opcode range: 0x30-0x31 */ - /* Stack: --> */ - /* */ - static void - Ins_IUP( INS_ARG ) - { - IUP_WorkerRec V; - FT_Byte mask; - - FT_UInt first_point; /* first point of contour */ - FT_UInt end_point; /* end point (last+1) of contour */ - - FT_UInt first_touched; /* first touched point in contour */ - FT_UInt cur_touched; /* current touched point in contour */ - - FT_UInt point; /* current point */ - FT_Short contour; /* current contour */ - - FT_UNUSED_ARG; - - - /* ignore empty outlines */ - if ( CUR.pts.n_contours == 0 ) - return; - - if ( CUR.opcode & 1 ) - { - mask = FT_CURVE_TAG_TOUCH_X; - V.orgs = CUR.pts.org; - V.curs = CUR.pts.cur; - V.orus = CUR.pts.orus; - } - else - { - mask = FT_CURVE_TAG_TOUCH_Y; - V.orgs = (FT_Vector*)( (FT_Pos*)CUR.pts.org + 1 ); - V.curs = (FT_Vector*)( (FT_Pos*)CUR.pts.cur + 1 ); - V.orus = (FT_Vector*)( (FT_Pos*)CUR.pts.orus + 1 ); - } - V.max_points = CUR.pts.n_points; - - contour = 0; - point = 0; - - do - { - end_point = CUR.pts.contours[contour] - CUR.pts.first_point; - first_point = point; - - while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) - point++; - - if ( point <= end_point ) - { - first_touched = point; - cur_touched = point; - - point++; - - while ( point <= end_point ) - { - if ( ( CUR.pts.tags[point] & mask ) != 0 ) - { - if ( point > 0 ) - _iup_worker_interpolate( &V, - cur_touched + 1, - point - 1, - cur_touched, - point ); - cur_touched = point; - } - - point++; - } - - if ( cur_touched == first_touched ) - _iup_worker_shift( &V, first_point, end_point, cur_touched ); - else - { - _iup_worker_interpolate( &V, - (FT_UShort)( cur_touched + 1 ), - end_point, - cur_touched, - first_touched ); - - if ( first_touched > 0 ) - _iup_worker_interpolate( &V, - first_point, - first_touched - 1, - cur_touched, - first_touched ); - } - } - contour++; - } while ( contour < CUR.pts.n_contours ); - } - - - /*************************************************************************/ - /* */ - /* DELTAPn[]: DELTA exceptions P1, P2, P3 */ - /* Opcode range: 0x5D,0x71,0x72 */ - /* Stack: uint32 (2 * uint32)... --> */ - /* */ - static void - Ins_DELTAP( INS_ARG ) - { - FT_ULong k, nump; - FT_UShort A; - FT_ULong C; - FT_Long B; - - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - /* Delta hinting is covered by US Patent 5159668. */ - if ( CUR.face->unpatented_hinting ) - { - FT_Long n = args[0] * 2; - - - if ( CUR.args < n ) - { - CUR.error = TT_Err_Too_Few_Arguments; - return; - } - - CUR.args -= n; - CUR.new_top = CUR.args; - return; - } -#endif - - nump = (FT_ULong)args[0]; /* some points theoretically may occur more - than once, thus UShort isn't enough */ - - for ( k = 1; k <= nump; k++ ) - { - if ( CUR.args < 2 ) - { - CUR.error = TT_Err_Too_Few_Arguments; - return; - } - - CUR.args -= 2; - - A = (FT_UShort)CUR.stack[CUR.args + 1]; - B = CUR.stack[CUR.args]; - - /* XXX: Because some popular fonts contain some invalid DeltaP */ - /* instructions, we simply ignore them when the stacked */ - /* point reference is off limit, rather than returning an */ - /* error. As a delta instruction doesn't change a glyph */ - /* in great ways, this shouldn't be a problem. */ - - if ( !BOUNDS( A, CUR.zp0.n_points ) ) - { - C = ( (FT_ULong)B & 0xF0 ) >> 4; - - switch ( CUR.opcode ) - { - case 0x5D: - break; - - case 0x71: - C += 16; - break; - - case 0x72: - C += 32; - break; - } - - C += CUR.GS.delta_base; - - if ( CURRENT_Ppem() == (FT_Long)C ) - { - B = ( (FT_ULong)B & 0xF ) - 8; - if ( B >= 0 ) - B++; - B = B * 64 / ( 1L << CUR.GS.delta_shift ); - - CUR_Func_move( &CUR.zp0, A, B ); - } - } - else - if ( CUR.pedantic_hinting ) - CUR.error = TT_Err_Invalid_Reference; - } - - CUR.new_top = CUR.args; - } - - - /*************************************************************************/ - /* */ - /* DELTACn[]: DELTA exceptions C1, C2, C3 */ - /* Opcode range: 0x73,0x74,0x75 */ - /* Stack: uint32 (2 * uint32)... --> */ - /* */ - static void - Ins_DELTAC( INS_ARG ) - { - FT_ULong nump, k; - FT_ULong A, C; - FT_Long B; - - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - /* Delta hinting is covered by US Patent 5159668. */ - if ( CUR.face->unpatented_hinting ) - { - FT_Long n = args[0] * 2; - - - if ( CUR.args < n ) - { - CUR.error = TT_Err_Too_Few_Arguments; - return; - } - - CUR.args -= n; - CUR.new_top = CUR.args; - return; - } -#endif - - nump = (FT_ULong)args[0]; - - for ( k = 1; k <= nump; k++ ) - { - if ( CUR.args < 2 ) - { - CUR.error = TT_Err_Too_Few_Arguments; - return; - } - - CUR.args -= 2; - - A = (FT_ULong)CUR.stack[CUR.args + 1]; - B = CUR.stack[CUR.args]; - - if ( BOUNDS( A, CUR.cvtSize ) ) - { - if ( CUR.pedantic_hinting ) - { - CUR.error = TT_Err_Invalid_Reference; - return; - } - } - else - { - C = ( (FT_ULong)B & 0xF0 ) >> 4; - - switch ( CUR.opcode ) - { - case 0x73: - break; - - case 0x74: - C += 16; - break; - - case 0x75: - C += 32; - break; - } - - C += CUR.GS.delta_base; - - if ( CURRENT_Ppem() == (FT_Long)C ) - { - B = ( (FT_ULong)B & 0xF ) - 8; - if ( B >= 0 ) - B++; - B = B * 64 / ( 1L << CUR.GS.delta_shift ); - - CUR_Func_move_cvt( A, B ); - } - } - } - - CUR.new_top = CUR.args; - } - - - /*************************************************************************/ - /* */ - /* MISC. INSTRUCTIONS */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* GETINFO[]: GET INFOrmation */ - /* Opcode range: 0x88 */ - /* Stack: uint32 --> uint32 */ - /* */ - static void - Ins_GETINFO( INS_ARG ) - { - FT_Long K; - - - K = 0; - - /* We return MS rasterizer version 1.7 for the font scaler. */ - if ( ( args[0] & 1 ) != 0 ) - K = 35; - - /* Has the glyph been rotated? */ - if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated ) - K |= 0x80; - - /* Has the glyph been stretched? */ - if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched ) - K |= 1 << 8; - - /* Are we hinting for grayscale? */ - if ( ( args[0] & 32 ) != 0 && CUR.grayscale ) - K |= 1 << 12; - - args[0] = K; - } - - - static void - Ins_UNKNOWN( INS_ARG ) - { - TT_DefRecord* def = CUR.IDefs; - TT_DefRecord* limit = def + CUR.numIDefs; - - FT_UNUSED_ARG; - - - for ( ; def < limit; def++ ) - { - if ( (FT_Byte)def->opc == CUR.opcode && def->active ) - { - TT_CallRec* call; - - - if ( CUR.callTop >= CUR.callSize ) - { - CUR.error = TT_Err_Stack_Overflow; - return; - } - - call = CUR.callStack + CUR.callTop++; - - call->Caller_Range = CUR.curRange; - call->Caller_IP = CUR.IP+1; - call->Cur_Count = 1; - call->Cur_Restart = def->start; - - INS_Goto_CodeRange( def->range, def->start ); - - CUR.step_ins = FALSE; - return; - } - } - - CUR.error = TT_Err_Invalid_Opcode; - } - - -#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH - - - static - TInstruction_Function Instruct_Dispatch[256] = - { - /* Opcodes are gathered in groups of 16. */ - /* Please keep the spaces as they are. */ - - /* SVTCA y */ Ins_SVTCA, - /* SVTCA x */ Ins_SVTCA, - /* SPvTCA y */ Ins_SPVTCA, - /* SPvTCA x */ Ins_SPVTCA, - /* SFvTCA y */ Ins_SFVTCA, - /* SFvTCA x */ Ins_SFVTCA, - /* SPvTL // */ Ins_SPVTL, - /* SPvTL + */ Ins_SPVTL, - /* SFvTL // */ Ins_SFVTL, - /* SFvTL + */ Ins_SFVTL, - /* SPvFS */ Ins_SPVFS, - /* SFvFS */ Ins_SFVFS, - /* GPV */ Ins_GPV, - /* GFV */ Ins_GFV, - /* SFvTPv */ Ins_SFVTPV, - /* ISECT */ Ins_ISECT, - - /* SRP0 */ Ins_SRP0, - /* SRP1 */ Ins_SRP1, - /* SRP2 */ Ins_SRP2, - /* SZP0 */ Ins_SZP0, - /* SZP1 */ Ins_SZP1, - /* SZP2 */ Ins_SZP2, - /* SZPS */ Ins_SZPS, - /* SLOOP */ Ins_SLOOP, - /* RTG */ Ins_RTG, - /* RTHG */ Ins_RTHG, - /* SMD */ Ins_SMD, - /* ELSE */ Ins_ELSE, - /* JMPR */ Ins_JMPR, - /* SCvTCi */ Ins_SCVTCI, - /* SSwCi */ Ins_SSWCI, - /* SSW */ Ins_SSW, - - /* DUP */ Ins_DUP, - /* POP */ Ins_POP, - /* CLEAR */ Ins_CLEAR, - /* SWAP */ Ins_SWAP, - /* DEPTH */ Ins_DEPTH, - /* CINDEX */ Ins_CINDEX, - /* MINDEX */ Ins_MINDEX, - /* AlignPTS */ Ins_ALIGNPTS, - /* INS_0x28 */ Ins_UNKNOWN, - /* UTP */ Ins_UTP, - /* LOOPCALL */ Ins_LOOPCALL, - /* CALL */ Ins_CALL, - /* FDEF */ Ins_FDEF, - /* ENDF */ Ins_ENDF, - /* MDAP[0] */ Ins_MDAP, - /* MDAP[1] */ Ins_MDAP, - - /* IUP[0] */ Ins_IUP, - /* IUP[1] */ Ins_IUP, - /* SHP[0] */ Ins_SHP, - /* SHP[1] */ Ins_SHP, - /* SHC[0] */ Ins_SHC, - /* SHC[1] */ Ins_SHC, - /* SHZ[0] */ Ins_SHZ, - /* SHZ[1] */ Ins_SHZ, - /* SHPIX */ Ins_SHPIX, - /* IP */ Ins_IP, - /* MSIRP[0] */ Ins_MSIRP, - /* MSIRP[1] */ Ins_MSIRP, - /* AlignRP */ Ins_ALIGNRP, - /* RTDG */ Ins_RTDG, - /* MIAP[0] */ Ins_MIAP, - /* MIAP[1] */ Ins_MIAP, - - /* NPushB */ Ins_NPUSHB, - /* NPushW */ Ins_NPUSHW, - /* WS */ Ins_WS, - /* RS */ Ins_RS, - /* WCvtP */ Ins_WCVTP, - /* RCvt */ Ins_RCVT, - /* GC[0] */ Ins_GC, - /* GC[1] */ Ins_GC, - /* SCFS */ Ins_SCFS, - /* MD[0] */ Ins_MD, - /* MD[1] */ Ins_MD, - /* MPPEM */ Ins_MPPEM, - /* MPS */ Ins_MPS, - /* FlipON */ Ins_FLIPON, - /* FlipOFF */ Ins_FLIPOFF, - /* DEBUG */ Ins_DEBUG, - - /* LT */ Ins_LT, - /* LTEQ */ Ins_LTEQ, - /* GT */ Ins_GT, - /* GTEQ */ Ins_GTEQ, - /* EQ */ Ins_EQ, - /* NEQ */ Ins_NEQ, - /* ODD */ Ins_ODD, - /* EVEN */ Ins_EVEN, - /* IF */ Ins_IF, - /* EIF */ Ins_EIF, - /* AND */ Ins_AND, - /* OR */ Ins_OR, - /* NOT */ Ins_NOT, - /* DeltaP1 */ Ins_DELTAP, - /* SDB */ Ins_SDB, - /* SDS */ Ins_SDS, - - /* ADD */ Ins_ADD, - /* SUB */ Ins_SUB, - /* DIV */ Ins_DIV, - /* MUL */ Ins_MUL, - /* ABS */ Ins_ABS, - /* NEG */ Ins_NEG, - /* FLOOR */ Ins_FLOOR, - /* CEILING */ Ins_CEILING, - /* ROUND[0] */ Ins_ROUND, - /* ROUND[1] */ Ins_ROUND, - /* ROUND[2] */ Ins_ROUND, - /* ROUND[3] */ Ins_ROUND, - /* NROUND[0] */ Ins_NROUND, - /* NROUND[1] */ Ins_NROUND, - /* NROUND[2] */ Ins_NROUND, - /* NROUND[3] */ Ins_NROUND, - - /* WCvtF */ Ins_WCVTF, - /* DeltaP2 */ Ins_DELTAP, - /* DeltaP3 */ Ins_DELTAP, - /* DeltaCn[0] */ Ins_DELTAC, - /* DeltaCn[1] */ Ins_DELTAC, - /* DeltaCn[2] */ Ins_DELTAC, - /* SROUND */ Ins_SROUND, - /* S45Round */ Ins_S45ROUND, - /* JROT */ Ins_JROT, - /* JROF */ Ins_JROF, - /* ROFF */ Ins_ROFF, - /* INS_0x7B */ Ins_UNKNOWN, - /* RUTG */ Ins_RUTG, - /* RDTG */ Ins_RDTG, - /* SANGW */ Ins_SANGW, - /* AA */ Ins_AA, - - /* FlipPT */ Ins_FLIPPT, - /* FlipRgON */ Ins_FLIPRGON, - /* FlipRgOFF */ Ins_FLIPRGOFF, - /* INS_0x83 */ Ins_UNKNOWN, - /* INS_0x84 */ Ins_UNKNOWN, - /* ScanCTRL */ Ins_SCANCTRL, - /* SDPVTL[0] */ Ins_SDPVTL, - /* SDPVTL[1] */ Ins_SDPVTL, - /* GetINFO */ Ins_GETINFO, - /* IDEF */ Ins_IDEF, - /* ROLL */ Ins_ROLL, - /* MAX */ Ins_MAX, - /* MIN */ Ins_MIN, - /* ScanTYPE */ Ins_SCANTYPE, - /* InstCTRL */ Ins_INSTCTRL, - /* INS_0x8F */ Ins_UNKNOWN, - - /* INS_0x90 */ Ins_UNKNOWN, - /* INS_0x91 */ Ins_UNKNOWN, - /* INS_0x92 */ Ins_UNKNOWN, - /* INS_0x93 */ Ins_UNKNOWN, - /* INS_0x94 */ Ins_UNKNOWN, - /* INS_0x95 */ Ins_UNKNOWN, - /* INS_0x96 */ Ins_UNKNOWN, - /* INS_0x97 */ Ins_UNKNOWN, - /* INS_0x98 */ Ins_UNKNOWN, - /* INS_0x99 */ Ins_UNKNOWN, - /* INS_0x9A */ Ins_UNKNOWN, - /* INS_0x9B */ Ins_UNKNOWN, - /* INS_0x9C */ Ins_UNKNOWN, - /* INS_0x9D */ Ins_UNKNOWN, - /* INS_0x9E */ Ins_UNKNOWN, - /* INS_0x9F */ Ins_UNKNOWN, - - /* INS_0xA0 */ Ins_UNKNOWN, - /* INS_0xA1 */ Ins_UNKNOWN, - /* INS_0xA2 */ Ins_UNKNOWN, - /* INS_0xA3 */ Ins_UNKNOWN, - /* INS_0xA4 */ Ins_UNKNOWN, - /* INS_0xA5 */ Ins_UNKNOWN, - /* INS_0xA6 */ Ins_UNKNOWN, - /* INS_0xA7 */ Ins_UNKNOWN, - /* INS_0xA8 */ Ins_UNKNOWN, - /* INS_0xA9 */ Ins_UNKNOWN, - /* INS_0xAA */ Ins_UNKNOWN, - /* INS_0xAB */ Ins_UNKNOWN, - /* INS_0xAC */ Ins_UNKNOWN, - /* INS_0xAD */ Ins_UNKNOWN, - /* INS_0xAE */ Ins_UNKNOWN, - /* INS_0xAF */ Ins_UNKNOWN, - - /* PushB[0] */ Ins_PUSHB, - /* PushB[1] */ Ins_PUSHB, - /* PushB[2] */ Ins_PUSHB, - /* PushB[3] */ Ins_PUSHB, - /* PushB[4] */ Ins_PUSHB, - /* PushB[5] */ Ins_PUSHB, - /* PushB[6] */ Ins_PUSHB, - /* PushB[7] */ Ins_PUSHB, - /* PushW[0] */ Ins_PUSHW, - /* PushW[1] */ Ins_PUSHW, - /* PushW[2] */ Ins_PUSHW, - /* PushW[3] */ Ins_PUSHW, - /* PushW[4] */ Ins_PUSHW, - /* PushW[5] */ Ins_PUSHW, - /* PushW[6] */ Ins_PUSHW, - /* PushW[7] */ Ins_PUSHW, - - /* MDRP[00] */ Ins_MDRP, - /* MDRP[01] */ Ins_MDRP, - /* MDRP[02] */ Ins_MDRP, - /* MDRP[03] */ Ins_MDRP, - /* MDRP[04] */ Ins_MDRP, - /* MDRP[05] */ Ins_MDRP, - /* MDRP[06] */ Ins_MDRP, - /* MDRP[07] */ Ins_MDRP, - /* MDRP[08] */ Ins_MDRP, - /* MDRP[09] */ Ins_MDRP, - /* MDRP[10] */ Ins_MDRP, - /* MDRP[11] */ Ins_MDRP, - /* MDRP[12] */ Ins_MDRP, - /* MDRP[13] */ Ins_MDRP, - /* MDRP[14] */ Ins_MDRP, - /* MDRP[15] */ Ins_MDRP, - - /* MDRP[16] */ Ins_MDRP, - /* MDRP[17] */ Ins_MDRP, - /* MDRP[18] */ Ins_MDRP, - /* MDRP[19] */ Ins_MDRP, - /* MDRP[20] */ Ins_MDRP, - /* MDRP[21] */ Ins_MDRP, - /* MDRP[22] */ Ins_MDRP, - /* MDRP[23] */ Ins_MDRP, - /* MDRP[24] */ Ins_MDRP, - /* MDRP[25] */ Ins_MDRP, - /* MDRP[26] */ Ins_MDRP, - /* MDRP[27] */ Ins_MDRP, - /* MDRP[28] */ Ins_MDRP, - /* MDRP[29] */ Ins_MDRP, - /* MDRP[30] */ Ins_MDRP, - /* MDRP[31] */ Ins_MDRP, - - /* MIRP[00] */ Ins_MIRP, - /* MIRP[01] */ Ins_MIRP, - /* MIRP[02] */ Ins_MIRP, - /* MIRP[03] */ Ins_MIRP, - /* MIRP[04] */ Ins_MIRP, - /* MIRP[05] */ Ins_MIRP, - /* MIRP[06] */ Ins_MIRP, - /* MIRP[07] */ Ins_MIRP, - /* MIRP[08] */ Ins_MIRP, - /* MIRP[09] */ Ins_MIRP, - /* MIRP[10] */ Ins_MIRP, - /* MIRP[11] */ Ins_MIRP, - /* MIRP[12] */ Ins_MIRP, - /* MIRP[13] */ Ins_MIRP, - /* MIRP[14] */ Ins_MIRP, - /* MIRP[15] */ Ins_MIRP, - - /* MIRP[16] */ Ins_MIRP, - /* MIRP[17] */ Ins_MIRP, - /* MIRP[18] */ Ins_MIRP, - /* MIRP[19] */ Ins_MIRP, - /* MIRP[20] */ Ins_MIRP, - /* MIRP[21] */ Ins_MIRP, - /* MIRP[22] */ Ins_MIRP, - /* MIRP[23] */ Ins_MIRP, - /* MIRP[24] */ Ins_MIRP, - /* MIRP[25] */ Ins_MIRP, - /* MIRP[26] */ Ins_MIRP, - /* MIRP[27] */ Ins_MIRP, - /* MIRP[28] */ Ins_MIRP, - /* MIRP[29] */ Ins_MIRP, - /* MIRP[30] */ Ins_MIRP, - /* MIRP[31] */ Ins_MIRP - }; - - -#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */ - - - /*************************************************************************/ - /* */ - /* RUN */ - /* */ - /* This function executes a run of opcodes. It will exit in the */ - /* following cases: */ - /* */ - /* - Errors (in which case it returns FALSE). */ - /* */ - /* - Reaching the end of the main code range (returns TRUE). */ - /* Reaching the end of a code range within a function call is an */ - /* error. */ - /* */ - /* - After executing one single opcode, if the flag `Instruction_Trap' */ - /* is set to TRUE (returns TRUE). */ - /* */ - /* On exit with TRUE, test IP < CodeSize to know whether it comes from */ - /* an instruction trap or a normal termination. */ - /* */ - /* */ - /* Note: The documented DEBUG opcode pops a value from the stack. This */ - /* behaviour is unsupported; here a DEBUG opcode is always an */ - /* error. */ - /* */ - /* */ - /* THIS IS THE INTERPRETER'S MAIN LOOP. */ - /* */ - /* Instructions appear in the specification's order. */ - /* */ - /*************************************************************************/ - - - /* documentation is in ttinterp.h */ - - FT_EXPORT_DEF( FT_Error ) - TT_RunIns( TT_ExecContext exc ) - { - FT_Long ins_counter = 0; /* executed instructions counter */ - - -#ifdef TT_CONFIG_OPTION_STATIC_RASTER - cur = *exc; -#endif - - /* set CVT functions */ - CUR.tt_metrics.ratio = 0; - if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem ) - { - /* non-square pixels, use the stretched routines */ - CUR.func_read_cvt = Read_CVT_Stretched; - CUR.func_write_cvt = Write_CVT_Stretched; - CUR.func_move_cvt = Move_CVT_Stretched; - } - else - { - /* square pixels, use normal routines */ - CUR.func_read_cvt = Read_CVT; - CUR.func_write_cvt = Write_CVT; - CUR.func_move_cvt = Move_CVT; - } - - COMPUTE_Funcs(); - COMPUTE_Round( (FT_Byte)exc->GS.round_state ); - - do - { - CUR.opcode = CUR.code[CUR.IP]; - - if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 ) - { - if ( CUR.IP + 1 > CUR.codeSize ) - goto LErrorCodeOverflow_; - - CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1]; - } - - if ( CUR.IP + CUR.length > CUR.codeSize ) - goto LErrorCodeOverflow_; - - /* First, let's check for empty stack and overflow */ - CUR.args = CUR.top - ( Pop_Push_Count[CUR.opcode] >> 4 ); - - /* `args' is the top of the stack once arguments have been popped. */ - /* One can also interpret it as the index of the last argument. */ - if ( CUR.args < 0 ) - { - CUR.error = TT_Err_Too_Few_Arguments; - goto LErrorLabel_; - } - - CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 ); - - /* `new_top' is the new top of the stack, after the instruction's */ - /* execution. `top' will be set to `new_top' after the `switch' */ - /* statement. */ - if ( CUR.new_top > CUR.stackSize ) - { - CUR.error = TT_Err_Stack_Overflow; - goto LErrorLabel_; - } - - CUR.step_ins = TRUE; - CUR.error = TT_Err_Ok; - -#ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH - - { - FT_Long* args = CUR.stack + CUR.args; - FT_Byte opcode = CUR.opcode; - - -#undef ARRAY_BOUND_ERROR -#define ARRAY_BOUND_ERROR goto Set_Invalid_Ref - - - switch ( opcode ) - { - case 0x00: /* SVTCA y */ - case 0x01: /* SVTCA x */ - case 0x02: /* SPvTCA y */ - case 0x03: /* SPvTCA x */ - case 0x04: /* SFvTCA y */ - case 0x05: /* SFvTCA x */ - { - FT_Short AA, BB; - - - AA = (FT_Short)( ( opcode & 1 ) << 14 ); - BB = (FT_Short)( AA ^ 0x4000 ); - - if ( opcode < 4 ) - { - CUR.GS.projVector.x = AA; - CUR.GS.projVector.y = BB; - - CUR.GS.dualVector.x = AA; - CUR.GS.dualVector.y = BB; - } - else - { - GUESS_VECTOR( projVector ); - } - - if ( ( opcode & 2 ) == 0 ) - { - CUR.GS.freeVector.x = AA; - CUR.GS.freeVector.y = BB; - } - else - { - GUESS_VECTOR( freeVector ); - } - - COMPUTE_Funcs(); - } - break; - - case 0x06: /* SPvTL // */ - case 0x07: /* SPvTL + */ - DO_SPVTL - break; - - case 0x08: /* SFvTL // */ - case 0x09: /* SFvTL + */ - DO_SFVTL - break; - - case 0x0A: /* SPvFS */ - DO_SPVFS - break; - - case 0x0B: /* SFvFS */ - DO_SFVFS - break; - - case 0x0C: /* GPV */ - DO_GPV - break; - - case 0x0D: /* GFV */ - DO_GFV - break; - - case 0x0E: /* SFvTPv */ - DO_SFVTPV - break; - - case 0x0F: /* ISECT */ - Ins_ISECT( EXEC_ARG_ args ); - break; - - case 0x10: /* SRP0 */ - DO_SRP0 - break; - - case 0x11: /* SRP1 */ - DO_SRP1 - break; - - case 0x12: /* SRP2 */ - DO_SRP2 - break; - - case 0x13: /* SZP0 */ - Ins_SZP0( EXEC_ARG_ args ); - break; - - case 0x14: /* SZP1 */ - Ins_SZP1( EXEC_ARG_ args ); - break; - - case 0x15: /* SZP2 */ - Ins_SZP2( EXEC_ARG_ args ); - break; - - case 0x16: /* SZPS */ - Ins_SZPS( EXEC_ARG_ args ); - break; - - case 0x17: /* SLOOP */ - DO_SLOOP - break; - - case 0x18: /* RTG */ - DO_RTG - break; - - case 0x19: /* RTHG */ - DO_RTHG - break; - - case 0x1A: /* SMD */ - DO_SMD - break; - - case 0x1B: /* ELSE */ - Ins_ELSE( EXEC_ARG_ args ); - break; - - case 0x1C: /* JMPR */ - DO_JMPR - break; - - case 0x1D: /* SCVTCI */ - DO_SCVTCI - break; - - case 0x1E: /* SSWCI */ - DO_SSWCI - break; - - case 0x1F: /* SSW */ - DO_SSW - break; - - case 0x20: /* DUP */ - DO_DUP - break; - - case 0x21: /* POP */ - /* nothing :-) */ - break; - - case 0x22: /* CLEAR */ - DO_CLEAR - break; - - case 0x23: /* SWAP */ - DO_SWAP - break; - - case 0x24: /* DEPTH */ - DO_DEPTH - break; - - case 0x25: /* CINDEX */ - DO_CINDEX - break; - - case 0x26: /* MINDEX */ - Ins_MINDEX( EXEC_ARG_ args ); - break; - - case 0x27: /* ALIGNPTS */ - Ins_ALIGNPTS( EXEC_ARG_ args ); - break; - - case 0x28: /* ???? */ - Ins_UNKNOWN( EXEC_ARG_ args ); - break; - - case 0x29: /* UTP */ - Ins_UTP( EXEC_ARG_ args ); - break; - - case 0x2A: /* LOOPCALL */ - Ins_LOOPCALL( EXEC_ARG_ args ); - break; - - case 0x2B: /* CALL */ - Ins_CALL( EXEC_ARG_ args ); - break; - - case 0x2C: /* FDEF */ - Ins_FDEF( EXEC_ARG_ args ); - break; - - case 0x2D: /* ENDF */ - Ins_ENDF( EXEC_ARG_ args ); - break; - - case 0x2E: /* MDAP */ - case 0x2F: /* MDAP */ - Ins_MDAP( EXEC_ARG_ args ); - break; - - - case 0x30: /* IUP */ - case 0x31: /* IUP */ - Ins_IUP( EXEC_ARG_ args ); - break; - - case 0x32: /* SHP */ - case 0x33: /* SHP */ - Ins_SHP( EXEC_ARG_ args ); - break; - - case 0x34: /* SHC */ - case 0x35: /* SHC */ - Ins_SHC( EXEC_ARG_ args ); - break; - - case 0x36: /* SHZ */ - case 0x37: /* SHZ */ - Ins_SHZ( EXEC_ARG_ args ); - break; - - case 0x38: /* SHPIX */ - Ins_SHPIX( EXEC_ARG_ args ); - break; - - case 0x39: /* IP */ - Ins_IP( EXEC_ARG_ args ); - break; - - case 0x3A: /* MSIRP */ - case 0x3B: /* MSIRP */ - Ins_MSIRP( EXEC_ARG_ args ); - break; - - case 0x3C: /* AlignRP */ - Ins_ALIGNRP( EXEC_ARG_ args ); - break; - - case 0x3D: /* RTDG */ - DO_RTDG - break; - - case 0x3E: /* MIAP */ - case 0x3F: /* MIAP */ - Ins_MIAP( EXEC_ARG_ args ); - break; - - case 0x40: /* NPUSHB */ - Ins_NPUSHB( EXEC_ARG_ args ); - break; - - case 0x41: /* NPUSHW */ - Ins_NPUSHW( EXEC_ARG_ args ); - break; - - case 0x42: /* WS */ - DO_WS - break; - - Set_Invalid_Ref: - CUR.error = TT_Err_Invalid_Reference; - break; - - case 0x43: /* RS */ - DO_RS - break; - - case 0x44: /* WCVTP */ - DO_WCVTP - break; - - case 0x45: /* RCVT */ - DO_RCVT - break; - - case 0x46: /* GC */ - case 0x47: /* GC */ - Ins_GC( EXEC_ARG_ args ); - break; - - case 0x48: /* SCFS */ - Ins_SCFS( EXEC_ARG_ args ); - break; - - case 0x49: /* MD */ - case 0x4A: /* MD */ - Ins_MD( EXEC_ARG_ args ); - break; - - case 0x4B: /* MPPEM */ - DO_MPPEM - break; - - case 0x4C: /* MPS */ - DO_MPS - break; - - case 0x4D: /* FLIPON */ - DO_FLIPON - break; - - case 0x4E: /* FLIPOFF */ - DO_FLIPOFF - break; - - case 0x4F: /* DEBUG */ - DO_DEBUG - break; - - case 0x50: /* LT */ - DO_LT - break; - - case 0x51: /* LTEQ */ - DO_LTEQ - break; - - case 0x52: /* GT */ - DO_GT - break; - - case 0x53: /* GTEQ */ - DO_GTEQ - break; - - case 0x54: /* EQ */ - DO_EQ - break; - - case 0x55: /* NEQ */ - DO_NEQ - break; - - case 0x56: /* ODD */ - DO_ODD - break; - - case 0x57: /* EVEN */ - DO_EVEN - break; - - case 0x58: /* IF */ - Ins_IF( EXEC_ARG_ args ); - break; - - case 0x59: /* EIF */ - /* do nothing */ - break; - - case 0x5A: /* AND */ - DO_AND - break; - - case 0x5B: /* OR */ - DO_OR - break; - - case 0x5C: /* NOT */ - DO_NOT - break; - - case 0x5D: /* DELTAP1 */ - Ins_DELTAP( EXEC_ARG_ args ); - break; - - case 0x5E: /* SDB */ - DO_SDB - break; - - case 0x5F: /* SDS */ - DO_SDS - break; - - case 0x60: /* ADD */ - DO_ADD - break; - - case 0x61: /* SUB */ - DO_SUB - break; - - case 0x62: /* DIV */ - DO_DIV - break; - - case 0x63: /* MUL */ - DO_MUL - break; - - case 0x64: /* ABS */ - DO_ABS - break; - - case 0x65: /* NEG */ - DO_NEG - break; - - case 0x66: /* FLOOR */ - DO_FLOOR - break; - - case 0x67: /* CEILING */ - DO_CEILING - break; - - case 0x68: /* ROUND */ - case 0x69: /* ROUND */ - case 0x6A: /* ROUND */ - case 0x6B: /* ROUND */ - DO_ROUND - break; - - case 0x6C: /* NROUND */ - case 0x6D: /* NROUND */ - case 0x6E: /* NRRUND */ - case 0x6F: /* NROUND */ - DO_NROUND - break; - - case 0x70: /* WCVTF */ - DO_WCVTF - break; - - case 0x71: /* DELTAP2 */ - case 0x72: /* DELTAP3 */ - Ins_DELTAP( EXEC_ARG_ args ); - break; - - case 0x73: /* DELTAC0 */ - case 0x74: /* DELTAC1 */ - case 0x75: /* DELTAC2 */ - Ins_DELTAC( EXEC_ARG_ args ); - break; - - case 0x76: /* SROUND */ - DO_SROUND - break; - - case 0x77: /* S45Round */ - DO_S45ROUND - break; - - case 0x78: /* JROT */ - DO_JROT - break; - - case 0x79: /* JROF */ - DO_JROF - break; - - case 0x7A: /* ROFF */ - DO_ROFF - break; - - case 0x7B: /* ???? */ - Ins_UNKNOWN( EXEC_ARG_ args ); - break; - - case 0x7C: /* RUTG */ - DO_RUTG - break; - - case 0x7D: /* RDTG */ - DO_RDTG - break; - - case 0x7E: /* SANGW */ - case 0x7F: /* AA */ - /* nothing - obsolete */ - break; - - case 0x80: /* FLIPPT */ - Ins_FLIPPT( EXEC_ARG_ args ); - break; - - case 0x81: /* FLIPRGON */ - Ins_FLIPRGON( EXEC_ARG_ args ); - break; - - case 0x82: /* FLIPRGOFF */ - Ins_FLIPRGOFF( EXEC_ARG_ args ); - break; - - case 0x83: /* UNKNOWN */ - case 0x84: /* UNKNOWN */ - Ins_UNKNOWN( EXEC_ARG_ args ); - break; - - case 0x85: /* SCANCTRL */ - Ins_SCANCTRL( EXEC_ARG_ args ); - break; - - case 0x86: /* SDPVTL */ - case 0x87: /* SDPVTL */ - Ins_SDPVTL( EXEC_ARG_ args ); - break; - - case 0x88: /* GETINFO */ - Ins_GETINFO( EXEC_ARG_ args ); - break; - - case 0x89: /* IDEF */ - Ins_IDEF( EXEC_ARG_ args ); - break; - - case 0x8A: /* ROLL */ - Ins_ROLL( EXEC_ARG_ args ); - break; - - case 0x8B: /* MAX */ - DO_MAX - break; - - case 0x8C: /* MIN */ - DO_MIN - break; - - case 0x8D: /* SCANTYPE */ - Ins_SCANTYPE( EXEC_ARG_ args ); - break; - - case 0x8E: /* INSTCTRL */ - Ins_INSTCTRL( EXEC_ARG_ args ); - break; - - case 0x8F: - Ins_UNKNOWN( EXEC_ARG_ args ); - break; - - default: - if ( opcode >= 0xE0 ) - Ins_MIRP( EXEC_ARG_ args ); - else if ( opcode >= 0xC0 ) - Ins_MDRP( EXEC_ARG_ args ); - else if ( opcode >= 0xB8 ) - Ins_PUSHW( EXEC_ARG_ args ); - else if ( opcode >= 0xB0 ) - Ins_PUSHB( EXEC_ARG_ args ); - else - Ins_UNKNOWN( EXEC_ARG_ args ); - } - - } - -#else - - Instruct_Dispatch[CUR.opcode]( EXEC_ARG_ &CUR.stack[CUR.args] ); - -#endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */ - - if ( CUR.error != TT_Err_Ok ) - { - switch ( CUR.error ) - { - case TT_Err_Invalid_Opcode: /* looking for redefined instructions */ - { - TT_DefRecord* def = CUR.IDefs; - TT_DefRecord* limit = def + CUR.numIDefs; - - - for ( ; def < limit; def++ ) - { - if ( def->active && CUR.opcode == (FT_Byte)def->opc ) - { - TT_CallRec* callrec; - - - if ( CUR.callTop >= CUR.callSize ) - { - CUR.error = TT_Err_Invalid_Reference; - goto LErrorLabel_; - } - - callrec = &CUR.callStack[CUR.callTop]; - - callrec->Caller_Range = CUR.curRange; - callrec->Caller_IP = CUR.IP + 1; - callrec->Cur_Count = 1; - callrec->Cur_Restart = def->start; - - if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE ) - goto LErrorLabel_; - - goto LSuiteLabel_; - } - } - } - - CUR.error = TT_Err_Invalid_Opcode; - goto LErrorLabel_; - -#if 0 - break; /* Unreachable code warning suppression. */ - /* Leave to remind in case a later change the editor */ - /* to consider break; */ -#endif - - default: - goto LErrorLabel_; - -#if 0 - break; -#endif - } - } - - CUR.top = CUR.new_top; - - if ( CUR.step_ins ) - CUR.IP += CUR.length; - - /* increment instruction counter and check if we didn't */ - /* run this program for too long (e.g. infinite loops). */ - if ( ++ins_counter > MAX_RUNNABLE_OPCODES ) - return TT_Err_Execution_Too_Long; - - LSuiteLabel_: - if ( CUR.IP >= CUR.codeSize ) - { - if ( CUR.callTop > 0 ) - { - CUR.error = TT_Err_Code_Overflow; - goto LErrorLabel_; - } - else - goto LNo_Error_; - } - } while ( !CUR.instruction_trap ); - - LNo_Error_: - -#ifdef TT_CONFIG_OPTION_STATIC_RASTER - *exc = cur; -#endif - - return TT_Err_Ok; - - LErrorCodeOverflow_: - CUR.error = TT_Err_Code_Overflow; - - LErrorLabel_: - -#ifdef TT_CONFIG_OPTION_STATIC_RASTER - *exc = cur; -#endif - - return CUR.error; - } - - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttinterp.c */ +/* */ +/* TrueType bytecode interpreter (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_TRIGONOMETRY_H +#include FT_SYSTEM_H + +#include "ttinterp.h" + +#include "tterrors.h" + + +#ifdef TT_USE_BYTECODE_INTERPRETER + + +#define TT_MULFIX FT_MulFix +#define TT_MULDIV FT_MulDiv +#define TT_MULDIV_NO_ROUND FT_MulDiv_No_Round + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttinterp + + /*************************************************************************/ + /* */ + /* In order to detect infinite loops in the code, we set up a counter */ + /* within the run loop. A single stroke of interpretation is now */ + /* limited to a maximal number of opcodes defined below. */ + /* */ +#define MAX_RUNNABLE_OPCODES 1000000L + + + /*************************************************************************/ + /* */ + /* There are two kinds of implementations: */ + /* */ + /* a. static implementation */ + /* */ + /* The current execution context is a static variable, which fields */ + /* are accessed directly by the interpreter during execution. The */ + /* context is named `cur'. */ + /* */ + /* This version is non-reentrant, of course. */ + /* */ + /* b. indirect implementation */ + /* */ + /* The current execution context is passed to _each_ function as its */ + /* first argument, and each field is thus accessed indirectly. */ + /* */ + /* This version is fully re-entrant. */ + /* */ + /* The idea is that an indirect implementation may be slower to execute */ + /* on low-end processors that are used in some systems (like 386s or */ + /* even 486s). */ + /* */ + /* As a consequence, the indirect implementation is now the default, as */ + /* its performance costs can be considered negligible in our context. */ + /* Note, however, that we kept the same source with macros because: */ + /* */ + /* - The code is kept very close in design to the Pascal code used for */ + /* development. */ + /* */ + /* - It's much more readable that way! */ + /* */ + /* - It's still open to experimentation and tuning. */ + /* */ + /*************************************************************************/ + + +#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */ + +#define CUR (*exc) /* see ttobjs.h */ + + /*************************************************************************/ + /* */ + /* This macro is used whenever `exec' is unused in a function, to avoid */ + /* stupid warnings from pedantic compilers. */ + /* */ +#define FT_UNUSED_EXEC FT_UNUSED( exc ) + +#else /* static implementation */ + +#define CUR cur + +#define FT_UNUSED_EXEC int __dummy = __dummy + + static + TT_ExecContextRec cur; /* static exec. context variable */ + + /* apparently, we have a _lot_ of direct indexing when accessing */ + /* the static `cur', which makes the code bigger (due to all the */ + /* four bytes addresses). */ + +#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */ + + + /*************************************************************************/ + /* */ + /* The instruction argument stack. */ + /* */ +#define INS_ARG EXEC_OP_ FT_Long* args /* see ttobjs.h for EXEC_OP_ */ + + + /*************************************************************************/ + /* */ + /* This macro is used whenever `args' is unused in a function, to avoid */ + /* stupid warnings from pedantic compilers. */ + /* */ +#define FT_UNUSED_ARG FT_UNUSED_EXEC; FT_UNUSED( args ) + + + /*************************************************************************/ + /* */ + /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to */ + /* increase readability of the code. */ + /* */ + /*************************************************************************/ + + +#define SKIP_Code() \ + SkipCode( EXEC_ARG ) + +#define GET_ShortIns() \ + GetShortIns( EXEC_ARG ) + +#define NORMalize( x, y, v ) \ + Normalize( EXEC_ARG_ x, y, v ) + +#define SET_SuperRound( scale, flags ) \ + SetSuperRound( EXEC_ARG_ scale, flags ) + +#define ROUND_None( d, c ) \ + Round_None( EXEC_ARG_ d, c ) + +#define INS_Goto_CodeRange( range, ip ) \ + Ins_Goto_CodeRange( EXEC_ARG_ range, ip ) + +#define CUR_Func_move( z, p, d ) \ + CUR.func_move( EXEC_ARG_ z, p, d ) + +#define CUR_Func_move_orig( z, p, d ) \ + CUR.func_move_orig( EXEC_ARG_ z, p, d ) + +#define CUR_Func_round( d, c ) \ + CUR.func_round( EXEC_ARG_ d, c ) + +#define CUR_Func_read_cvt( index ) \ + CUR.func_read_cvt( EXEC_ARG_ index ) + +#define CUR_Func_write_cvt( index, val ) \ + CUR.func_write_cvt( EXEC_ARG_ index, val ) + +#define CUR_Func_move_cvt( index, val ) \ + CUR.func_move_cvt( EXEC_ARG_ index, val ) + +#define CURRENT_Ratio() \ + Current_Ratio( EXEC_ARG ) + +#define CURRENT_Ppem() \ + Current_Ppem( EXEC_ARG ) + +#define CUR_Ppem() \ + Cur_PPEM( EXEC_ARG ) + +#define INS_SxVTL( a, b, c, d ) \ + Ins_SxVTL( EXEC_ARG_ a, b, c, d ) + +#define COMPUTE_Funcs() \ + Compute_Funcs( EXEC_ARG ) + +#define COMPUTE_Round( a ) \ + Compute_Round( EXEC_ARG_ a ) + +#define COMPUTE_Point_Displacement( a, b, c, d ) \ + Compute_Point_Displacement( EXEC_ARG_ a, b, c, d ) + +#define MOVE_Zp2_Point( a, b, c, t ) \ + Move_Zp2_Point( EXEC_ARG_ a, b, c, t ) + + +#define CUR_Func_project( v1, v2 ) \ + CUR.func_project( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y ) + +#define CUR_Func_dualproj( v1, v2 ) \ + CUR.func_dualproj( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y ) + +#define CUR_fast_project( v ) \ + CUR.func_project( EXEC_ARG_ (v)->x, (v)->y ) + +#define CUR_fast_dualproj( v ) \ + CUR.func_dualproj( EXEC_ARG_ (v)->x, (v)->y ) + + + /*************************************************************************/ + /* */ + /* Instruction dispatch function, as used by the interpreter. */ + /* */ + typedef void (*TInstruction_Function)( INS_ARG ); + + + /*************************************************************************/ + /* */ + /* A simple bounds-checking macro. */ + /* */ +#define BOUNDS( x, n ) ( (FT_UInt)(x) >= (FT_UInt)(n) ) + +#undef SUCCESS +#define SUCCESS 0 + +#undef FAILURE +#define FAILURE 1 + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING +#define GUESS_VECTOR( V ) \ + if ( CUR.face->unpatented_hinting ) \ + { \ + CUR.GS.V.x = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0x4000 : 0 ); \ + CUR.GS.V.y = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0 : 0x4000 ); \ + } +#else +#define GUESS_VECTOR( V ) +#endif + + /*************************************************************************/ + /* */ + /* CODERANGE FUNCTIONS */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Goto_CodeRange */ + /* */ + /* */ + /* Switches to a new code range (updates the code related elements in */ + /* `exec', and `IP'). */ + /* */ + /* */ + /* range :: The new execution code range. */ + /* */ + /* IP :: The new IP in the new code range. */ + /* */ + /* */ + /* exec :: The target execution context. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Goto_CodeRange( TT_ExecContext exec, + FT_Int range, + FT_Long IP ) + { + TT_CodeRange* coderange; + + + FT_ASSERT( range >= 1 && range <= 3 ); + + coderange = &exec->codeRangeTable[range - 1]; + + FT_ASSERT( coderange->base != NULL ); + + /* NOTE: Because the last instruction of a program may be a CALL */ + /* which will return to the first byte *after* the code */ + /* range, we test for IP <= Size instead of IP < Size. */ + /* */ + FT_ASSERT( (FT_ULong)IP <= coderange->size ); + + exec->code = coderange->base; + exec->codeSize = coderange->size; + exec->IP = IP; + exec->curRange = range; + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Set_CodeRange */ + /* */ + /* */ + /* Sets a code range. */ + /* */ + /* */ + /* range :: The code range index. */ + /* */ + /* base :: The new code base. */ + /* */ + /* length :: The range size in bytes. */ + /* */ + /* */ + /* exec :: The target execution context. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Set_CodeRange( TT_ExecContext exec, + FT_Int range, + void* base, + FT_Long length ) + { + FT_ASSERT( range >= 1 && range <= 3 ); + + exec->codeRangeTable[range - 1].base = (FT_Byte*)base; + exec->codeRangeTable[range - 1].size = length; + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Clear_CodeRange */ + /* */ + /* */ + /* Clears a code range. */ + /* */ + /* */ + /* range :: The code range index. */ + /* */ + /* */ + /* exec :: The target execution context. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* Does not set the Error variable. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Clear_CodeRange( TT_ExecContext exec, + FT_Int range ) + { + FT_ASSERT( range >= 1 && range <= 3 ); + + exec->codeRangeTable[range - 1].base = NULL; + exec->codeRangeTable[range - 1].size = 0; + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* EXECUTION CONTEXT ROUTINES */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Done_Context */ + /* */ + /* */ + /* Destroys a given context. */ + /* */ + /* */ + /* exec :: A handle to the target execution context. */ + /* */ + /* memory :: A handle to the parent memory object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* Only the glyph loader and debugger should call this function. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Done_Context( TT_ExecContext exec ) + { + FT_Memory memory = exec->memory; + + + /* points zone */ + exec->maxPoints = 0; + exec->maxContours = 0; + + /* free stack */ + FT_FREE( exec->stack ); + exec->stackSize = 0; + + /* free call stack */ + FT_FREE( exec->callStack ); + exec->callSize = 0; + exec->callTop = 0; + + /* free glyph code range */ + FT_FREE( exec->glyphIns ); + exec->glyphSize = 0; + + exec->size = NULL; + exec->face = NULL; + + FT_FREE( exec ); + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Init_Context */ + /* */ + /* */ + /* Initializes a context object. */ + /* */ + /* */ + /* memory :: A handle to the parent memory object. */ + /* */ + /* */ + /* exec :: A handle to the target execution context. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + Init_Context( TT_ExecContext exec, + FT_Memory memory ) + { + FT_Error error; + + + FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec )); + + exec->memory = memory; + exec->callSize = 32; + + if ( FT_NEW_ARRAY( exec->callStack, exec->callSize ) ) + goto Fail_Memory; + + /* all values in the context are set to 0 already, but this is */ + /* here as a remainder */ + exec->maxPoints = 0; + exec->maxContours = 0; + + exec->stackSize = 0; + exec->glyphSize = 0; + + exec->stack = NULL; + exec->glyphIns = NULL; + + exec->face = NULL; + exec->size = NULL; + + return TT_Err_Ok; + + Fail_Memory: + FT_ERROR(( "Init_Context: not enough memory for 0x%08lx\n", + (FT_Long)exec )); + TT_Done_Context( exec ); + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Update_Max */ + /* */ + /* */ + /* Checks the size of a buffer and reallocates it if necessary. */ + /* */ + /* */ + /* memory :: A handle to the parent memory object. */ + /* */ + /* multiplier :: The size in bytes of each element in the buffer. */ + /* */ + /* new_max :: The new capacity (size) of the buffer. */ + /* */ + /* */ + /* size :: The address of the buffer's current size expressed */ + /* in elements. */ + /* */ + /* buff :: The address of the buffer base pointer. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + static FT_Error + Update_Max( FT_Memory memory, + FT_ULong* size, + FT_Long multiplier, + void* _pbuff, + FT_ULong new_max ) + { + FT_Error error; + void** pbuff = (void**)_pbuff; + + + if ( *size < new_max ) + { + if ( FT_REALLOC( *pbuff, *size * multiplier, new_max * multiplier ) ) + return error; + *size = new_max; + } + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Load_Context */ + /* */ + /* */ + /* Prepare an execution context for glyph hinting. */ + /* */ + /* */ + /* face :: A handle to the source face object. */ + /* */ + /* size :: A handle to the source size object. */ + /* */ + /* */ + /* exec :: A handle to the target execution context. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* Only the glyph loader and debugger should call this function. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Load_Context( TT_ExecContext exec, + TT_Face face, + TT_Size size ) + { + FT_Int i; + FT_ULong tmp; + TT_MaxProfile* maxp; + FT_Error error; + + + exec->face = face; + maxp = &face->max_profile; + exec->size = size; + + if ( size ) + { + exec->numFDefs = size->num_function_defs; + exec->maxFDefs = size->max_function_defs; + exec->numIDefs = size->num_instruction_defs; + exec->maxIDefs = size->max_instruction_defs; + exec->FDefs = size->function_defs; + exec->IDefs = size->instruction_defs; + exec->tt_metrics = size->ttmetrics; + exec->metrics = size->metrics; + + exec->maxFunc = size->max_func; + exec->maxIns = size->max_ins; + + for ( i = 0; i < TT_MAX_CODE_RANGES; i++ ) + exec->codeRangeTable[i] = size->codeRangeTable[i]; + + /* set graphics state */ + exec->GS = size->GS; + + exec->cvtSize = size->cvt_size; + exec->cvt = size->cvt; + + exec->storeSize = size->storage_size; + exec->storage = size->storage; + + exec->twilight = size->twilight; + } + + /* XXX: We reserve a little more elements on the stack to deal safely */ + /* with broken fonts like arialbs, courbs, timesbs, etc. */ + tmp = exec->stackSize; + error = Update_Max( exec->memory, + &tmp, + sizeof ( FT_F26Dot6 ), + (void*)&exec->stack, + maxp->maxStackElements + 32 ); + exec->stackSize = (FT_UInt)tmp; + if ( error ) + return error; + + tmp = exec->glyphSize; + error = Update_Max( exec->memory, + &tmp, + sizeof ( FT_Byte ), + (void*)&exec->glyphIns, + maxp->maxSizeOfInstructions ); + exec->glyphSize = (FT_UShort)tmp; + if ( error ) + return error; + + exec->pts.n_points = 0; + exec->pts.n_contours = 0; + + exec->zp1 = exec->pts; + exec->zp2 = exec->pts; + exec->zp0 = exec->pts; + + exec->instruction_trap = FALSE; + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Save_Context */ + /* */ + /* */ + /* Saves the code ranges in a `size' object. */ + /* */ + /* */ + /* exec :: A handle to the source execution context. */ + /* */ + /* */ + /* size :: A handle to the target size object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* Only the glyph loader and debugger should call this function. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Save_Context( TT_ExecContext exec, + TT_Size size ) + { + FT_Int i; + + + /* XXXX: Will probably disappear soon with all the code range */ + /* management, which is now rather obsolete. */ + /* */ + size->num_function_defs = exec->numFDefs; + size->num_instruction_defs = exec->numIDefs; + + size->max_func = exec->maxFunc; + size->max_ins = exec->maxIns; + + for ( i = 0; i < TT_MAX_CODE_RANGES; i++ ) + size->codeRangeTable[i] = exec->codeRangeTable[i]; + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Run_Context */ + /* */ + /* */ + /* Executes one or more instructions in the execution context. */ + /* */ + /* */ + /* debug :: A Boolean flag. If set, the function sets some internal */ + /* variables and returns immediately, otherwise TT_RunIns() */ + /* is called. */ + /* */ + /* This is commented out currently. */ + /* */ + /* */ + /* exec :: A handle to the target execution context. */ + /* */ + /* */ + /* TrueTyoe error code. 0 means success. */ + /* */ + /* */ + /* Only the glyph loader and debugger should call this function. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + TT_Run_Context( TT_ExecContext exec, + FT_Bool debug ) + { + FT_Error error; + + + if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) ) + != TT_Err_Ok ) + return error; + + exec->zp0 = exec->pts; + exec->zp1 = exec->pts; + exec->zp2 = exec->pts; + + exec->GS.gep0 = 1; + exec->GS.gep1 = 1; + exec->GS.gep2 = 1; + + exec->GS.projVector.x = 0x4000; + exec->GS.projVector.y = 0x0000; + + exec->GS.freeVector = exec->GS.projVector; + exec->GS.dualVector = exec->GS.projVector; + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + exec->GS.both_x_axis = TRUE; +#endif + + exec->GS.round_state = 1; + exec->GS.loop = 1; + + /* some glyphs leave something on the stack. so we clean it */ + /* before a new execution. */ + exec->top = 0; + exec->callTop = 0; + +#if 1 + FT_UNUSED( debug ); + + return exec->face->interpreter( exec ); +#else + if ( !debug ) + return TT_RunIns( exec ); + else + return TT_Err_Ok; +#endif + } + + + const TT_GraphicsState tt_default_graphics_state = + { + 0, 0, 0, + { 0x4000, 0 }, + { 0x4000, 0 }, + { 0x4000, 0 }, + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + TRUE, +#endif + + 1, 64, 1, + TRUE, 68, 0, 0, 9, 3, + 0, FALSE, 2, 1, 1, 1 + }; + + + /* documentation is in ttinterp.h */ + + FT_EXPORT_DEF( TT_ExecContext ) + TT_New_Context( TT_Driver driver ) + { + TT_ExecContext exec; + FT_Memory memory; + + + memory = driver->root.root.memory; + exec = driver->context; + + if ( !driver->context ) + { + FT_Error error; + + + /* allocate object */ + if ( FT_NEW( exec ) ) + goto Exit; + + /* initialize it */ + error = Init_Context( exec, memory ); + if ( error ) + goto Fail; + + /* store it into the driver */ + driver->context = exec; + } + + Exit: + return driver->context; + + Fail: + FT_FREE( exec ); + + return 0; + } + + + /*************************************************************************/ + /* */ + /* Before an opcode is executed, the interpreter verifies that there are */ + /* enough arguments on the stack, with the help of the `Pop_Push_Count' */ + /* table. */ + /* */ + /* For each opcode, the first column gives the number of arguments that */ + /* are popped from the stack; the second one gives the number of those */ + /* that are pushed in result. */ + /* */ + /* Opcodes which have a varying number of parameters in the data stream */ + /* (NPUSHB, NPUSHW) are handled specially; they have a negative value in */ + /* the `opcode_length' table, and the value in `Pop_Push_Count' is set */ + /* to zero. */ + /* */ + /*************************************************************************/ + + +#undef PACK +#define PACK( x, y ) ( ( x << 4 ) | y ) + + + static + const FT_Byte Pop_Push_Count[256] = + { + /* opcodes are gathered in groups of 16 */ + /* please keep the spaces as they are */ + + /* SVTCA y */ PACK( 0, 0 ), + /* SVTCA x */ PACK( 0, 0 ), + /* SPvTCA y */ PACK( 0, 0 ), + /* SPvTCA x */ PACK( 0, 0 ), + /* SFvTCA y */ PACK( 0, 0 ), + /* SFvTCA x */ PACK( 0, 0 ), + /* SPvTL // */ PACK( 2, 0 ), + /* SPvTL + */ PACK( 2, 0 ), + /* SFvTL // */ PACK( 2, 0 ), + /* SFvTL + */ PACK( 2, 0 ), + /* SPvFS */ PACK( 2, 0 ), + /* SFvFS */ PACK( 2, 0 ), + /* GPV */ PACK( 0, 2 ), + /* GFV */ PACK( 0, 2 ), + /* SFvTPv */ PACK( 0, 0 ), + /* ISECT */ PACK( 5, 0 ), + + /* SRP0 */ PACK( 1, 0 ), + /* SRP1 */ PACK( 1, 0 ), + /* SRP2 */ PACK( 1, 0 ), + /* SZP0 */ PACK( 1, 0 ), + /* SZP1 */ PACK( 1, 0 ), + /* SZP2 */ PACK( 1, 0 ), + /* SZPS */ PACK( 1, 0 ), + /* SLOOP */ PACK( 1, 0 ), + /* RTG */ PACK( 0, 0 ), + /* RTHG */ PACK( 0, 0 ), + /* SMD */ PACK( 1, 0 ), + /* ELSE */ PACK( 0, 0 ), + /* JMPR */ PACK( 1, 0 ), + /* SCvTCi */ PACK( 1, 0 ), + /* SSwCi */ PACK( 1, 0 ), + /* SSW */ PACK( 1, 0 ), + + /* DUP */ PACK( 1, 2 ), + /* POP */ PACK( 1, 0 ), + /* CLEAR */ PACK( 0, 0 ), + /* SWAP */ PACK( 2, 2 ), + /* DEPTH */ PACK( 0, 1 ), + /* CINDEX */ PACK( 1, 1 ), + /* MINDEX */ PACK( 1, 0 ), + /* AlignPTS */ PACK( 2, 0 ), + /* INS_$28 */ PACK( 0, 0 ), + /* UTP */ PACK( 1, 0 ), + /* LOOPCALL */ PACK( 2, 0 ), + /* CALL */ PACK( 1, 0 ), + /* FDEF */ PACK( 1, 0 ), + /* ENDF */ PACK( 0, 0 ), + /* MDAP[0] */ PACK( 1, 0 ), + /* MDAP[1] */ PACK( 1, 0 ), + + /* IUP[0] */ PACK( 0, 0 ), + /* IUP[1] */ PACK( 0, 0 ), + /* SHP[0] */ PACK( 0, 0 ), + /* SHP[1] */ PACK( 0, 0 ), + /* SHC[0] */ PACK( 1, 0 ), + /* SHC[1] */ PACK( 1, 0 ), + /* SHZ[0] */ PACK( 1, 0 ), + /* SHZ[1] */ PACK( 1, 0 ), + /* SHPIX */ PACK( 1, 0 ), + /* IP */ PACK( 0, 0 ), + /* MSIRP[0] */ PACK( 2, 0 ), + /* MSIRP[1] */ PACK( 2, 0 ), + /* AlignRP */ PACK( 0, 0 ), + /* RTDG */ PACK( 0, 0 ), + /* MIAP[0] */ PACK( 2, 0 ), + /* MIAP[1] */ PACK( 2, 0 ), + + /* NPushB */ PACK( 0, 0 ), + /* NPushW */ PACK( 0, 0 ), + /* WS */ PACK( 2, 0 ), + /* RS */ PACK( 1, 1 ), + /* WCvtP */ PACK( 2, 0 ), + /* RCvt */ PACK( 1, 1 ), + /* GC[0] */ PACK( 1, 1 ), + /* GC[1] */ PACK( 1, 1 ), + /* SCFS */ PACK( 2, 0 ), + /* MD[0] */ PACK( 2, 1 ), + /* MD[1] */ PACK( 2, 1 ), + /* MPPEM */ PACK( 0, 1 ), + /* MPS */ PACK( 0, 1 ), + /* FlipON */ PACK( 0, 0 ), + /* FlipOFF */ PACK( 0, 0 ), + /* DEBUG */ PACK( 1, 0 ), + + /* LT */ PACK( 2, 1 ), + /* LTEQ */ PACK( 2, 1 ), + /* GT */ PACK( 2, 1 ), + /* GTEQ */ PACK( 2, 1 ), + /* EQ */ PACK( 2, 1 ), + /* NEQ */ PACK( 2, 1 ), + /* ODD */ PACK( 1, 1 ), + /* EVEN */ PACK( 1, 1 ), + /* IF */ PACK( 1, 0 ), + /* EIF */ PACK( 0, 0 ), + /* AND */ PACK( 2, 1 ), + /* OR */ PACK( 2, 1 ), + /* NOT */ PACK( 1, 1 ), + /* DeltaP1 */ PACK( 1, 0 ), + /* SDB */ PACK( 1, 0 ), + /* SDS */ PACK( 1, 0 ), + + /* ADD */ PACK( 2, 1 ), + /* SUB */ PACK( 2, 1 ), + /* DIV */ PACK( 2, 1 ), + /* MUL */ PACK( 2, 1 ), + /* ABS */ PACK( 1, 1 ), + /* NEG */ PACK( 1, 1 ), + /* FLOOR */ PACK( 1, 1 ), + /* CEILING */ PACK( 1, 1 ), + /* ROUND[0] */ PACK( 1, 1 ), + /* ROUND[1] */ PACK( 1, 1 ), + /* ROUND[2] */ PACK( 1, 1 ), + /* ROUND[3] */ PACK( 1, 1 ), + /* NROUND[0] */ PACK( 1, 1 ), + /* NROUND[1] */ PACK( 1, 1 ), + /* NROUND[2] */ PACK( 1, 1 ), + /* NROUND[3] */ PACK( 1, 1 ), + + /* WCvtF */ PACK( 2, 0 ), + /* DeltaP2 */ PACK( 1, 0 ), + /* DeltaP3 */ PACK( 1, 0 ), + /* DeltaCn[0] */ PACK( 1, 0 ), + /* DeltaCn[1] */ PACK( 1, 0 ), + /* DeltaCn[2] */ PACK( 1, 0 ), + /* SROUND */ PACK( 1, 0 ), + /* S45Round */ PACK( 1, 0 ), + /* JROT */ PACK( 2, 0 ), + /* JROF */ PACK( 2, 0 ), + /* ROFF */ PACK( 0, 0 ), + /* INS_$7B */ PACK( 0, 0 ), + /* RUTG */ PACK( 0, 0 ), + /* RDTG */ PACK( 0, 0 ), + /* SANGW */ PACK( 1, 0 ), + /* AA */ PACK( 1, 0 ), + + /* FlipPT */ PACK( 0, 0 ), + /* FlipRgON */ PACK( 2, 0 ), + /* FlipRgOFF */ PACK( 2, 0 ), + /* INS_$83 */ PACK( 0, 0 ), + /* INS_$84 */ PACK( 0, 0 ), + /* ScanCTRL */ PACK( 1, 0 ), + /* SDVPTL[0] */ PACK( 2, 0 ), + /* SDVPTL[1] */ PACK( 2, 0 ), + /* GetINFO */ PACK( 1, 1 ), + /* IDEF */ PACK( 1, 0 ), + /* ROLL */ PACK( 3, 3 ), + /* MAX */ PACK( 2, 1 ), + /* MIN */ PACK( 2, 1 ), + /* ScanTYPE */ PACK( 1, 0 ), + /* InstCTRL */ PACK( 2, 0 ), + /* INS_$8F */ PACK( 0, 0 ), + + /* INS_$90 */ PACK( 0, 0 ), + /* INS_$91 */ PACK( 0, 0 ), + /* INS_$92 */ PACK( 0, 0 ), + /* INS_$93 */ PACK( 0, 0 ), + /* INS_$94 */ PACK( 0, 0 ), + /* INS_$95 */ PACK( 0, 0 ), + /* INS_$96 */ PACK( 0, 0 ), + /* INS_$97 */ PACK( 0, 0 ), + /* INS_$98 */ PACK( 0, 0 ), + /* INS_$99 */ PACK( 0, 0 ), + /* INS_$9A */ PACK( 0, 0 ), + /* INS_$9B */ PACK( 0, 0 ), + /* INS_$9C */ PACK( 0, 0 ), + /* INS_$9D */ PACK( 0, 0 ), + /* INS_$9E */ PACK( 0, 0 ), + /* INS_$9F */ PACK( 0, 0 ), + + /* INS_$A0 */ PACK( 0, 0 ), + /* INS_$A1 */ PACK( 0, 0 ), + /* INS_$A2 */ PACK( 0, 0 ), + /* INS_$A3 */ PACK( 0, 0 ), + /* INS_$A4 */ PACK( 0, 0 ), + /* INS_$A5 */ PACK( 0, 0 ), + /* INS_$A6 */ PACK( 0, 0 ), + /* INS_$A7 */ PACK( 0, 0 ), + /* INS_$A8 */ PACK( 0, 0 ), + /* INS_$A9 */ PACK( 0, 0 ), + /* INS_$AA */ PACK( 0, 0 ), + /* INS_$AB */ PACK( 0, 0 ), + /* INS_$AC */ PACK( 0, 0 ), + /* INS_$AD */ PACK( 0, 0 ), + /* INS_$AE */ PACK( 0, 0 ), + /* INS_$AF */ PACK( 0, 0 ), + + /* PushB[0] */ PACK( 0, 1 ), + /* PushB[1] */ PACK( 0, 2 ), + /* PushB[2] */ PACK( 0, 3 ), + /* PushB[3] */ PACK( 0, 4 ), + /* PushB[4] */ PACK( 0, 5 ), + /* PushB[5] */ PACK( 0, 6 ), + /* PushB[6] */ PACK( 0, 7 ), + /* PushB[7] */ PACK( 0, 8 ), + /* PushW[0] */ PACK( 0, 1 ), + /* PushW[1] */ PACK( 0, 2 ), + /* PushW[2] */ PACK( 0, 3 ), + /* PushW[3] */ PACK( 0, 4 ), + /* PushW[4] */ PACK( 0, 5 ), + /* PushW[5] */ PACK( 0, 6 ), + /* PushW[6] */ PACK( 0, 7 ), + /* PushW[7] */ PACK( 0, 8 ), + + /* MDRP[00] */ PACK( 1, 0 ), + /* MDRP[01] */ PACK( 1, 0 ), + /* MDRP[02] */ PACK( 1, 0 ), + /* MDRP[03] */ PACK( 1, 0 ), + /* MDRP[04] */ PACK( 1, 0 ), + /* MDRP[05] */ PACK( 1, 0 ), + /* MDRP[06] */ PACK( 1, 0 ), + /* MDRP[07] */ PACK( 1, 0 ), + /* MDRP[08] */ PACK( 1, 0 ), + /* MDRP[09] */ PACK( 1, 0 ), + /* MDRP[10] */ PACK( 1, 0 ), + /* MDRP[11] */ PACK( 1, 0 ), + /* MDRP[12] */ PACK( 1, 0 ), + /* MDRP[13] */ PACK( 1, 0 ), + /* MDRP[14] */ PACK( 1, 0 ), + /* MDRP[15] */ PACK( 1, 0 ), + + /* MDRP[16] */ PACK( 1, 0 ), + /* MDRP[17] */ PACK( 1, 0 ), + /* MDRP[18] */ PACK( 1, 0 ), + /* MDRP[19] */ PACK( 1, 0 ), + /* MDRP[20] */ PACK( 1, 0 ), + /* MDRP[21] */ PACK( 1, 0 ), + /* MDRP[22] */ PACK( 1, 0 ), + /* MDRP[23] */ PACK( 1, 0 ), + /* MDRP[24] */ PACK( 1, 0 ), + /* MDRP[25] */ PACK( 1, 0 ), + /* MDRP[26] */ PACK( 1, 0 ), + /* MDRP[27] */ PACK( 1, 0 ), + /* MDRP[28] */ PACK( 1, 0 ), + /* MDRP[29] */ PACK( 1, 0 ), + /* MDRP[30] */ PACK( 1, 0 ), + /* MDRP[31] */ PACK( 1, 0 ), + + /* MIRP[00] */ PACK( 2, 0 ), + /* MIRP[01] */ PACK( 2, 0 ), + /* MIRP[02] */ PACK( 2, 0 ), + /* MIRP[03] */ PACK( 2, 0 ), + /* MIRP[04] */ PACK( 2, 0 ), + /* MIRP[05] */ PACK( 2, 0 ), + /* MIRP[06] */ PACK( 2, 0 ), + /* MIRP[07] */ PACK( 2, 0 ), + /* MIRP[08] */ PACK( 2, 0 ), + /* MIRP[09] */ PACK( 2, 0 ), + /* MIRP[10] */ PACK( 2, 0 ), + /* MIRP[11] */ PACK( 2, 0 ), + /* MIRP[12] */ PACK( 2, 0 ), + /* MIRP[13] */ PACK( 2, 0 ), + /* MIRP[14] */ PACK( 2, 0 ), + /* MIRP[15] */ PACK( 2, 0 ), + + /* MIRP[16] */ PACK( 2, 0 ), + /* MIRP[17] */ PACK( 2, 0 ), + /* MIRP[18] */ PACK( 2, 0 ), + /* MIRP[19] */ PACK( 2, 0 ), + /* MIRP[20] */ PACK( 2, 0 ), + /* MIRP[21] */ PACK( 2, 0 ), + /* MIRP[22] */ PACK( 2, 0 ), + /* MIRP[23] */ PACK( 2, 0 ), + /* MIRP[24] */ PACK( 2, 0 ), + /* MIRP[25] */ PACK( 2, 0 ), + /* MIRP[26] */ PACK( 2, 0 ), + /* MIRP[27] */ PACK( 2, 0 ), + /* MIRP[28] */ PACK( 2, 0 ), + /* MIRP[29] */ PACK( 2, 0 ), + /* MIRP[30] */ PACK( 2, 0 ), + /* MIRP[31] */ PACK( 2, 0 ) + }; + + + static + const FT_Char opcode_length[256] = + { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + -1,-2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 3, 5, 7, 9, 11,13,15,17, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + }; + +#undef PACK + +#if 1 + + static FT_Int32 + TT_MulFix14( FT_Int32 a, + FT_Int b ) + { + FT_Int32 sign; + FT_UInt32 ah, al, mid, lo, hi; + + + sign = a ^ b; + + if ( a < 0 ) + a = -a; + if ( b < 0 ) + b = -b; + + ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU ); + al = (FT_UInt32)( a & 0xFFFFU ); + + lo = al * b; + mid = ah * b; + hi = mid >> 16; + mid = ( mid << 16 ) + ( 1 << 13 ); /* rounding */ + lo += mid; + if ( lo < mid ) + hi += 1; + + mid = ( lo >> 14 ) | ( hi << 18 ); + + return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid; + } + +#else + + /* compute (a*b)/2^14 with maximal accuracy and rounding */ + static FT_Int32 + TT_MulFix14( FT_Int32 a, + FT_Int b ) + { + FT_Int32 m, s, hi; + FT_UInt32 l, lo; + + + /* compute ax*bx as 64-bit value */ + l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); + m = ( a >> 16 ) * b; + + lo = l + (FT_UInt32)( m << 16 ); + hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); + + /* divide the result by 2^14 with rounding */ + s = hi >> 31; + l = lo + (FT_UInt32)s; + hi += s + ( l < lo ); + lo = l; + + l = lo + 0x2000U; + hi += l < lo; + + return ( hi << 18 ) | ( l >> 14 ); + } +#endif + + + /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */ + static FT_Int32 + TT_DotFix14( FT_Int32 ax, + FT_Int32 ay, + FT_Int bx, + FT_Int by ) + { + FT_Int32 m, s, hi1, hi2, hi; + FT_UInt32 l, lo1, lo2, lo; + + + /* compute ax*bx as 64-bit value */ + l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx ); + m = ( ax >> 16 ) * bx; + + lo1 = l + (FT_UInt32)( m << 16 ); + hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l ); + + /* compute ay*by as 64-bit value */ + l = (FT_UInt32)( ( ay & 0xFFFFU ) * by ); + m = ( ay >> 16 ) * by; + + lo2 = l + (FT_UInt32)( m << 16 ); + hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l ); + + /* add them */ + lo = lo1 + lo2; + hi = hi1 + hi2 + ( lo < lo1 ); + + /* divide the result by 2^14 with rounding */ + s = hi >> 31; + l = lo + (FT_UInt32)s; + hi += s + ( l < lo ); + lo = l; + + l = lo + 0x2000U; + hi += ( l < lo ); + + return ( hi << 18 ) | ( l >> 14 ); + } + + + /* return length of given vector */ + +#if 0 + + static FT_Int32 + TT_VecLen( FT_Int32 x, + FT_Int32 y ) + { + FT_Int32 m, hi1, hi2, hi; + FT_UInt32 l, lo1, lo2, lo; + + + /* compute x*x as 64-bit value */ + lo = (FT_UInt32)( x & 0xFFFFU ); + hi = x >> 16; + + l = lo * lo; + m = hi * lo; + hi = hi * hi; + + lo1 = l + (FT_UInt32)( m << 17 ); + hi1 = hi + ( m >> 15 ) + ( lo1 < l ); + + /* compute y*y as 64-bit value */ + lo = (FT_UInt32)( y & 0xFFFFU ); + hi = y >> 16; + + l = lo * lo; + m = hi * lo; + hi = hi * hi; + + lo2 = l + (FT_UInt32)( m << 17 ); + hi2 = hi + ( m >> 15 ) + ( lo2 < l ); + + /* add them to get 'x*x+y*y' as 64-bit value */ + lo = lo1 + lo2; + hi = hi1 + hi2 + ( lo < lo1 ); + + /* compute the square root of this value */ + { + FT_UInt32 root, rem, test_div; + FT_Int count; + + + root = 0; + + { + rem = 0; + count = 32; + do + { + rem = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 ); + hi = ( hi << 2 ) | ( lo >> 30 ); + lo <<= 2; + root <<= 1; + test_div = ( root << 1 ) + 1; + + if ( rem >= test_div ) + { + rem -= test_div; + root += 1; + } + } while ( --count ); + } + + return (FT_Int32)root; + } + } + +#else + + /* this version uses FT_Vector_Length which computes the same value */ + /* much, much faster.. */ + /* */ + static FT_F26Dot6 + TT_VecLen( FT_F26Dot6 X, + FT_F26Dot6 Y ) + { + FT_Vector v; + + + v.x = X; + v.y = Y; + + return FT_Vector_Length( &v ); + } + +#endif + + + /*************************************************************************/ + /* */ + /* */ + /* Current_Ratio */ + /* */ + /* */ + /* Returns the current aspect ratio scaling factor depending on the */ + /* projection vector's state and device resolutions. */ + /* */ + /* */ + /* The aspect ratio in 16.16 format, always <= 1.0 . */ + /* */ + static FT_Long + Current_Ratio( EXEC_OP ) + { + if ( !CUR.tt_metrics.ratio ) + { +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + if ( CUR.face->unpatented_hinting ) + { + if ( CUR.GS.both_x_axis ) + CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio; + else + CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio; + } + else +#endif + { + if ( CUR.GS.projVector.y == 0 ) + CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio; + + else if ( CUR.GS.projVector.x == 0 ) + CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio; + + else + { + FT_Long x, y; + + + x = TT_MULDIV( CUR.GS.projVector.x, + CUR.tt_metrics.x_ratio, 0x4000 ); + y = TT_MULDIV( CUR.GS.projVector.y, + CUR.tt_metrics.y_ratio, 0x4000 ); + CUR.tt_metrics.ratio = TT_VecLen( x, y ); + } + } + } + return CUR.tt_metrics.ratio; + } + + + static FT_Long + Current_Ppem( EXEC_OP ) + { + return TT_MULFIX( CUR.tt_metrics.ppem, CURRENT_Ratio() ); + } + + + /*************************************************************************/ + /* */ + /* Functions related to the control value table (CVT). */ + /* */ + /*************************************************************************/ + + + FT_CALLBACK_DEF( FT_F26Dot6 ) + Read_CVT( EXEC_OP_ FT_ULong idx ) + { + return CUR.cvt[idx]; + } + + + FT_CALLBACK_DEF( FT_F26Dot6 ) + Read_CVT_Stretched( EXEC_OP_ FT_ULong idx ) + { + return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() ); + } + + + FT_CALLBACK_DEF( void ) + Write_CVT( EXEC_OP_ FT_ULong idx, + FT_F26Dot6 value ) + { + CUR.cvt[idx] = value; + } + + + FT_CALLBACK_DEF( void ) + Write_CVT_Stretched( EXEC_OP_ FT_ULong idx, + FT_F26Dot6 value ) + { + CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() ); + } + + + FT_CALLBACK_DEF( void ) + Move_CVT( EXEC_OP_ FT_ULong idx, + FT_F26Dot6 value ) + { + CUR.cvt[idx] += value; + } + + + FT_CALLBACK_DEF( void ) + Move_CVT_Stretched( EXEC_OP_ FT_ULong idx, + FT_F26Dot6 value ) + { + CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* GetShortIns */ + /* */ + /* */ + /* Returns a short integer taken from the instruction stream at */ + /* address IP. */ + /* */ + /* */ + /* Short read at code[IP]. */ + /* */ + /* */ + /* This one could become a macro. */ + /* */ + static FT_Short + GetShortIns( EXEC_OP ) + { + /* Reading a byte stream so there is no endianess (DaveP) */ + CUR.IP += 2; + return (FT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) + + CUR.code[CUR.IP - 1] ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* Ins_Goto_CodeRange */ + /* */ + /* */ + /* Goes to a certain code range in the instruction stream. */ + /* */ + /* */ + /* aRange :: The index of the code range. */ + /* */ + /* aIP :: The new IP address in the code range. */ + /* */ + /* */ + /* SUCCESS or FAILURE. */ + /* */ + static FT_Bool + Ins_Goto_CodeRange( EXEC_OP_ FT_Int aRange, + FT_ULong aIP ) + { + TT_CodeRange* range; + + + if ( aRange < 1 || aRange > 3 ) + { + CUR.error = TT_Err_Bad_Argument; + return FAILURE; + } + + range = &CUR.codeRangeTable[aRange - 1]; + + if ( range->base == NULL ) /* invalid coderange */ + { + CUR.error = TT_Err_Invalid_CodeRange; + return FAILURE; + } + + /* NOTE: Because the last instruction of a program may be a CALL */ + /* which will return to the first byte *after* the code */ + /* range, we test for AIP <= Size, instead of AIP < Size. */ + + if ( aIP > range->size ) + { + CUR.error = TT_Err_Code_Overflow; + return FAILURE; + } + + CUR.code = range->base; + CUR.codeSize = range->size; + CUR.IP = aIP; + CUR.curRange = aRange; + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Direct_Move */ + /* */ + /* */ + /* Moves a point by a given distance along the freedom vector. The */ + /* point will be `touched'. */ + /* */ + /* */ + /* point :: The index of the point to move. */ + /* */ + /* distance :: The distance to apply. */ + /* */ + /* */ + /* zone :: The affected glyph zone. */ + /* */ + static void + Direct_Move( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) + { + FT_F26Dot6 v; + + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + FT_ASSERT( !CUR.face->unpatented_hinting ); +#endif + + v = CUR.GS.freeVector.x; + + if ( v != 0 ) + { + zone->cur[point].x += TT_MULDIV( distance, + v * 0x10000L, + CUR.F_dot_P ); + + zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; + } + + v = CUR.GS.freeVector.y; + + if ( v != 0 ) + { + zone->cur[point].y += TT_MULDIV( distance, + v * 0x10000L, + CUR.F_dot_P ); + + zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; + } + } + + + /*************************************************************************/ + /* */ + /* */ + /* Direct_Move_Orig */ + /* */ + /* */ + /* Moves the *original* position of a point by a given distance along */ + /* the freedom vector. Obviously, the point will not be `touched'. */ + /* */ + /* */ + /* point :: The index of the point to move. */ + /* */ + /* distance :: The distance to apply. */ + /* */ + /* */ + /* zone :: The affected glyph zone. */ + /* */ + static void + Direct_Move_Orig( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) + { + FT_F26Dot6 v; + + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + FT_ASSERT( !CUR.face->unpatented_hinting ); +#endif + + v = CUR.GS.freeVector.x; + + if ( v != 0 ) + zone->org[point].x += TT_MULDIV( distance, + v * 0x10000L, + CUR.F_dot_P ); + + v = CUR.GS.freeVector.y; + + if ( v != 0 ) + zone->org[point].y += TT_MULDIV( distance, + v * 0x10000L, + CUR.F_dot_P ); + } + + + /*************************************************************************/ + /* */ + /* Special versions of Direct_Move() */ + /* */ + /* The following versions are used whenever both vectors are both */ + /* along one of the coordinate unit vectors, i.e. in 90% of the cases. */ + /* */ + /*************************************************************************/ + + + static void + Direct_Move_X( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) + { + FT_UNUSED_EXEC; + + zone->cur[point].x += distance; + zone->tags[point] |= FT_CURVE_TAG_TOUCH_X; + } + + + static void + Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) + { + FT_UNUSED_EXEC; + + zone->cur[point].y += distance; + zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y; + } + + + /*************************************************************************/ + /* */ + /* Special versions of Direct_Move_Orig() */ + /* */ + /* The following versions are used whenever both vectors are both */ + /* along one of the coordinate unit vectors, i.e. in 90% of the cases. */ + /* */ + /*************************************************************************/ + + + static void + Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) + { + FT_UNUSED_EXEC; + + zone->org[point].x += distance; + } + + + static void + Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) + { + FT_UNUSED_EXEC; + + zone->org[point].y += distance; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_None */ + /* */ + /* */ + /* Does not round, but adds engine compensation. */ + /* */ + /* */ + /* distance :: The distance (not) to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* The compensated distance. */ + /* */ + /* */ + /* The TrueType specification says very few about the relationship */ + /* between rounding and engine compensation. However, it seems from */ + /* the description of super round that we should add the compensation */ + /* before rounding. */ + /* */ + static FT_F26Dot6 + Round_None( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + FT_UNUSED_EXEC; + + + if ( distance >= 0 ) + { + val = distance + compensation; + if ( distance && val < 0 ) + val = 0; + } + else { + val = distance - compensation; + if ( val > 0 ) + val = 0; + } + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_To_Grid */ + /* */ + /* */ + /* Rounds value to grid after adding engine compensation. */ + /* */ + /* */ + /* distance :: The distance to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* Rounded distance. */ + /* */ + static FT_F26Dot6 + Round_To_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + FT_UNUSED_EXEC; + + + if ( distance >= 0 ) + { + val = distance + compensation + 32; + if ( distance && val > 0 ) + val &= ~63; + else + val = 0; + } + else + { + val = -FT_PIX_ROUND( compensation - distance ); + if ( val > 0 ) + val = 0; + } + + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_To_Half_Grid */ + /* */ + /* */ + /* Rounds value to half grid after adding engine compensation. */ + /* */ + /* */ + /* distance :: The distance to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* Rounded distance. */ + /* */ + static FT_F26Dot6 + Round_To_Half_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + FT_UNUSED_EXEC; + + + if ( distance >= 0 ) + { + val = FT_PIX_FLOOR( distance + compensation ) + 32; + if ( distance && val < 0 ) + val = 0; + } + else + { + val = -( FT_PIX_FLOOR( compensation - distance ) + 32 ); + if ( val > 0 ) + val = 0; + } + + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_Down_To_Grid */ + /* */ + /* */ + /* Rounds value down to grid after adding engine compensation. */ + /* */ + /* */ + /* distance :: The distance to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* Rounded distance. */ + /* */ + static FT_F26Dot6 + Round_Down_To_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + FT_UNUSED_EXEC; + + + if ( distance >= 0 ) + { + val = distance + compensation; + if ( distance && val > 0 ) + val &= ~63; + else + val = 0; + } + else + { + val = -( ( compensation - distance ) & -64 ); + if ( val > 0 ) + val = 0; + } + + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_Up_To_Grid */ + /* */ + /* */ + /* Rounds value up to grid after adding engine compensation. */ + /* */ + /* */ + /* distance :: The distance to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* Rounded distance. */ + /* */ + static FT_F26Dot6 + Round_Up_To_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + FT_UNUSED_EXEC; + + + if ( distance >= 0 ) + { + val = distance + compensation + 63; + if ( distance && val > 0 ) + val &= ~63; + else + val = 0; + } + else + { + val = - FT_PIX_CEIL( compensation - distance ); + if ( val > 0 ) + val = 0; + } + + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_To_Double_Grid */ + /* */ + /* */ + /* Rounds value to double grid after adding engine compensation. */ + /* */ + /* */ + /* distance :: The distance to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* Rounded distance. */ + /* */ + static FT_F26Dot6 + Round_To_Double_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + FT_UNUSED_EXEC; + + + if ( distance >= 0 ) + { + val = distance + compensation + 16; + if ( distance && val > 0 ) + val &= ~31; + else + val = 0; + } + else + { + val = -FT_PAD_ROUND( compensation - distance, 32 ); + if ( val > 0 ) + val = 0; + } + + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_Super */ + /* */ + /* */ + /* Super-rounds value to grid after adding engine compensation. */ + /* */ + /* */ + /* distance :: The distance to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* Rounded distance. */ + /* */ + /* */ + /* The TrueType specification says very few about the relationship */ + /* between rounding and engine compensation. However, it seems from */ + /* the description of super round that we should add the compensation */ + /* before rounding. */ + /* */ + static FT_F26Dot6 + Round_Super( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + + if ( distance >= 0 ) + { + val = ( distance - CUR.phase + CUR.threshold + compensation ) & + -CUR.period; + if ( distance && val < 0 ) + val = 0; + val += CUR.phase; + } + else + { + val = -( ( CUR.threshold - CUR.phase - distance + compensation ) & + -CUR.period ); + if ( val > 0 ) + val = 0; + val -= CUR.phase; + } + + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Round_Super_45 */ + /* */ + /* */ + /* Super-rounds value to grid after adding engine compensation. */ + /* */ + /* */ + /* distance :: The distance to round. */ + /* */ + /* compensation :: The engine compensation. */ + /* */ + /* */ + /* Rounded distance. */ + /* */ + /* */ + /* There is a separate function for Round_Super_45() as we may need */ + /* greater precision. */ + /* */ + static FT_F26Dot6 + Round_Super_45( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) + { + FT_F26Dot6 val; + + + if ( distance >= 0 ) + { + val = ( ( distance - CUR.phase + CUR.threshold + compensation ) / + CUR.period ) * CUR.period; + if ( distance && val < 0 ) + val = 0; + val += CUR.phase; + } + else + { + val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) / + CUR.period ) * CUR.period ); + if ( val > 0 ) + val = 0; + val -= CUR.phase; + } + + return val; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Compute_Round */ + /* */ + /* */ + /* Sets the rounding mode. */ + /* */ + /* */ + /* round_mode :: The rounding mode to be used. */ + /* */ + static void + Compute_Round( EXEC_OP_ FT_Byte round_mode ) + { + switch ( round_mode ) + { + case TT_Round_Off: + CUR.func_round = (TT_Round_Func)Round_None; + break; + + case TT_Round_To_Grid: + CUR.func_round = (TT_Round_Func)Round_To_Grid; + break; + + case TT_Round_Up_To_Grid: + CUR.func_round = (TT_Round_Func)Round_Up_To_Grid; + break; + + case TT_Round_Down_To_Grid: + CUR.func_round = (TT_Round_Func)Round_Down_To_Grid; + break; + + case TT_Round_To_Half_Grid: + CUR.func_round = (TT_Round_Func)Round_To_Half_Grid; + break; + + case TT_Round_To_Double_Grid: + CUR.func_round = (TT_Round_Func)Round_To_Double_Grid; + break; + + case TT_Round_Super: + CUR.func_round = (TT_Round_Func)Round_Super; + break; + + case TT_Round_Super_45: + CUR.func_round = (TT_Round_Func)Round_Super_45; + break; + } + } + + + /*************************************************************************/ + /* */ + /* */ + /* SetSuperRound */ + /* */ + /* */ + /* Sets Super Round parameters. */ + /* */ + /* */ + /* GridPeriod :: Grid period */ + /* selector :: SROUND opcode */ + /* */ + static void + SetSuperRound( EXEC_OP_ FT_F26Dot6 GridPeriod, + FT_Long selector ) + { + switch ( (FT_Int)( selector & 0xC0 ) ) + { + case 0: + CUR.period = GridPeriod / 2; + break; + + case 0x40: + CUR.period = GridPeriod; + break; + + case 0x80: + CUR.period = GridPeriod * 2; + break; + + /* This opcode is reserved, but... */ + + case 0xC0: + CUR.period = GridPeriod; + break; + } + + switch ( (FT_Int)( selector & 0x30 ) ) + { + case 0: + CUR.phase = 0; + break; + + case 0x10: + CUR.phase = CUR.period / 4; + break; + + case 0x20: + CUR.phase = CUR.period / 2; + break; + + case 0x30: + CUR.phase = CUR.period * 3 / 4; + break; + } + + if ( ( selector & 0x0F ) == 0 ) + CUR.threshold = CUR.period - 1; + else + CUR.threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8; + + CUR.period /= 256; + CUR.phase /= 256; + CUR.threshold /= 256; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Project */ + /* */ + /* */ + /* Computes the projection of vector given by (v2-v1) along the */ + /* current projection vector. */ + /* */ + /* */ + /* v1 :: First input vector. */ + /* v2 :: Second input vector. */ + /* */ + /* */ + /* The distance in F26dot6 format. */ + /* */ + static FT_F26Dot6 + Project( EXEC_OP_ FT_Pos dx, + FT_Pos dy ) + { +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + FT_ASSERT( !CUR.face->unpatented_hinting ); +#endif + + return TT_DotFix14( dx, dy, + CUR.GS.projVector.x, + CUR.GS.projVector.y ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* Dual_Project */ + /* */ + /* */ + /* Computes the projection of the vector given by (v2-v1) along the */ + /* current dual vector. */ + /* */ + /* */ + /* v1 :: First input vector. */ + /* v2 :: Second input vector. */ + /* */ + /* */ + /* The distance in F26dot6 format. */ + /* */ + static FT_F26Dot6 + Dual_Project( EXEC_OP_ FT_Pos dx, + FT_Pos dy ) + { + return TT_DotFix14( dx, dy, + CUR.GS.dualVector.x, + CUR.GS.dualVector.y ); + } + + + /*************************************************************************/ + /* */ + /* */ + /* Project_x */ + /* */ + /* */ + /* Computes the projection of the vector given by (v2-v1) along the */ + /* horizontal axis. */ + /* */ + /* */ + /* v1 :: First input vector. */ + /* v2 :: Second input vector. */ + /* */ + /* */ + /* The distance in F26dot6 format. */ + /* */ + static FT_F26Dot6 + Project_x( EXEC_OP_ FT_Pos dx, + FT_Pos dy ) + { + FT_UNUSED_EXEC; + FT_UNUSED( dy ); + + return dx; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Project_y */ + /* */ + /* */ + /* Computes the projection of the vector given by (v2-v1) along the */ + /* vertical axis. */ + /* */ + /* */ + /* v1 :: First input vector. */ + /* v2 :: Second input vector. */ + /* */ + /* */ + /* The distance in F26dot6 format. */ + /* */ + static FT_F26Dot6 + Project_y( EXEC_OP_ FT_Pos dx, + FT_Pos dy ) + { + FT_UNUSED_EXEC; + FT_UNUSED( dx ); + + return dy; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Compute_Funcs */ + /* */ + /* */ + /* Computes the projection and movement function pointers according */ + /* to the current graphics state. */ + /* */ + static void + Compute_Funcs( EXEC_OP ) + { +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + if ( CUR.face->unpatented_hinting ) + { + /* If both vectors point rightwards along the x axis, set */ + /* `both-x-axis' true, otherwise set it false. The x values only */ + /* need be tested because the vector has been normalised to a unit */ + /* vector of length 0x4000 = unity. */ + CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 && + CUR.GS.freeVector.x == 0x4000 ); + + /* Throw away projection and freedom vector information */ + /* because the patents don't allow them to be stored. */ + /* The relevant US Patents are 5155805 and 5325479. */ + CUR.GS.projVector.x = 0; + CUR.GS.projVector.y = 0; + CUR.GS.freeVector.x = 0; + CUR.GS.freeVector.y = 0; + + if ( CUR.GS.both_x_axis ) + { + CUR.func_project = Project_x; + CUR.func_move = Direct_Move_X; + CUR.func_move_orig = Direct_Move_Orig_X; + } + else + { + CUR.func_project = Project_y; + CUR.func_move = Direct_Move_Y; + CUR.func_move_orig = Direct_Move_Orig_Y; + } + + if ( CUR.GS.dualVector.x == 0x4000 ) + CUR.func_dualproj = Project_x; + else + { + if ( CUR.GS.dualVector.y == 0x4000 ) + CUR.func_dualproj = Project_y; + else + CUR.func_dualproj = Dual_Project; + } + + /* Force recalculation of cached aspect ratio */ + CUR.tt_metrics.ratio = 0; + + return; + } +#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */ + + if ( CUR.GS.freeVector.x == 0x4000 ) + CUR.F_dot_P = CUR.GS.projVector.x * 0x10000L; + else + { + if ( CUR.GS.freeVector.y == 0x4000 ) + CUR.F_dot_P = CUR.GS.projVector.y * 0x10000L; + else + CUR.F_dot_P = (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 + + (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4; + } + + if ( CUR.GS.projVector.x == 0x4000 ) + CUR.func_project = (TT_Project_Func)Project_x; + else + { + if ( CUR.GS.projVector.y == 0x4000 ) + CUR.func_project = (TT_Project_Func)Project_y; + else + CUR.func_project = (TT_Project_Func)Project; + } + + if ( CUR.GS.dualVector.x == 0x4000 ) + CUR.func_dualproj = (TT_Project_Func)Project_x; + else + { + if ( CUR.GS.dualVector.y == 0x4000 ) + CUR.func_dualproj = (TT_Project_Func)Project_y; + else + CUR.func_dualproj = (TT_Project_Func)Dual_Project; + } + + CUR.func_move = (TT_Move_Func)Direct_Move; + CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig; + + if ( CUR.F_dot_P == 0x40000000L ) + { + if ( CUR.GS.freeVector.x == 0x4000 ) + { + CUR.func_move = (TT_Move_Func)Direct_Move_X; + CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; + } + else + { + if ( CUR.GS.freeVector.y == 0x4000 ) + { + CUR.func_move = (TT_Move_Func)Direct_Move_Y; + CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; + } + } + } + + /* at small sizes, F_dot_P can become too small, resulting */ + /* in overflows and `spikes' in a number of glyphs like `w'. */ + + if ( FT_ABS( CUR.F_dot_P ) < 0x4000000L ) + CUR.F_dot_P = 0x40000000L; + + /* Disable cached aspect ratio */ + CUR.tt_metrics.ratio = 0; + } + + + /*************************************************************************/ + /* */ + /* */ + /* Normalize */ + /* */ + /* */ + /* Norms a vector. */ + /* */ + /* */ + /* Vx :: The horizontal input vector coordinate. */ + /* Vy :: The vertical input vector coordinate. */ + /* */ + /* */ + /* R :: The normed unit vector. */ + /* */ + /* */ + /* Returns FAILURE if a vector parameter is zero. */ + /* */ + /* */ + /* In case Vx and Vy are both zero, Normalize() returns SUCCESS, and */ + /* R is undefined. */ + /* */ + + + static FT_Bool + Normalize( EXEC_OP_ FT_F26Dot6 Vx, + FT_F26Dot6 Vy, + FT_UnitVector* R ) + { + FT_F26Dot6 W; + FT_Bool S1, S2; + + FT_UNUSED_EXEC; + + + if ( FT_ABS( Vx ) < 0x10000L && FT_ABS( Vy ) < 0x10000L ) + { + Vx *= 0x100; + Vy *= 0x100; + + W = TT_VecLen( Vx, Vy ); + + if ( W == 0 ) + { + /* XXX: UNDOCUMENTED! It seems that it is possible to try */ + /* to normalize the vector (0,0). Return immediately. */ + return SUCCESS; + } + + R->x = (FT_F2Dot14)FT_MulDiv( Vx, 0x4000L, W ); + R->y = (FT_F2Dot14)FT_MulDiv( Vy, 0x4000L, W ); + + return SUCCESS; + } + + W = TT_VecLen( Vx, Vy ); + + Vx = FT_MulDiv( Vx, 0x4000L, W ); + Vy = FT_MulDiv( Vy, 0x4000L, W ); + + W = Vx * Vx + Vy * Vy; + + /* Now, we want that Sqrt( W ) = 0x4000 */ + /* Or 0x10000000 <= W < 0x10004000 */ + + if ( Vx < 0 ) + { + Vx = -Vx; + S1 = TRUE; + } + else + S1 = FALSE; + + if ( Vy < 0 ) + { + Vy = -Vy; + S2 = TRUE; + } + else + S2 = FALSE; + + while ( W < 0x10000000L ) + { + /* We need to increase W by a minimal amount */ + if ( Vx < Vy ) + Vx++; + else + Vy++; + + W = Vx * Vx + Vy * Vy; + } + + while ( W >= 0x10004000L ) + { + /* We need to decrease W by a minimal amount */ + if ( Vx < Vy ) + Vx--; + else + Vy--; + + W = Vx * Vx + Vy * Vy; + } + + /* Note that in various cases, we can only */ + /* compute a Sqrt(W) of 0x3FFF, eg. Vx = Vy */ + + if ( S1 ) + Vx = -Vx; + + if ( S2 ) + Vy = -Vy; + + R->x = (FT_F2Dot14)Vx; /* Type conversion */ + R->y = (FT_F2Dot14)Vy; /* Type conversion */ + + return SUCCESS; + } + + + /*************************************************************************/ + /* */ + /* Here we start with the implementation of the various opcodes. */ + /* */ + /*************************************************************************/ + + + static FT_Bool + Ins_SxVTL( EXEC_OP_ FT_UShort aIdx1, + FT_UShort aIdx2, + FT_Int aOpc, + FT_UnitVector* Vec ) + { + FT_Long A, B, C; + FT_Vector* p1; + FT_Vector* p2; + + + if ( BOUNDS( aIdx1, CUR.zp2.n_points ) || + BOUNDS( aIdx2, CUR.zp1.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return FAILURE; + } + + p1 = CUR.zp1.cur + aIdx2; + p2 = CUR.zp2.cur + aIdx1; + + A = p1->x - p2->x; + B = p1->y - p2->y; + + if ( ( aOpc & 1 ) != 0 ) + { + C = B; /* counter clockwise rotation */ + B = A; + A = -C; + } + + NORMalize( A, B, Vec ); + + return SUCCESS; + } + + + /* When not using the big switch statements, the interpreter uses a */ + /* call table defined later below in this source. Each opcode must */ + /* thus have a corresponding function, even trivial ones. */ + /* */ + /* They are all defined there. */ + +#define DO_SVTCA \ + { \ + FT_Short A, B; \ + \ + \ + A = (FT_Short)( CUR.opcode & 1 ) << 14; \ + B = A ^ (FT_Short)0x4000; \ + \ + CUR.GS.freeVector.x = A; \ + CUR.GS.projVector.x = A; \ + CUR.GS.dualVector.x = A; \ + \ + CUR.GS.freeVector.y = B; \ + CUR.GS.projVector.y = B; \ + CUR.GS.dualVector.y = B; \ + \ + COMPUTE_Funcs(); \ + } + + +#define DO_SPVTCA \ + { \ + FT_Short A, B; \ + \ + \ + A = (FT_Short)( CUR.opcode & 1 ) << 14; \ + B = A ^ (FT_Short)0x4000; \ + \ + CUR.GS.projVector.x = A; \ + CUR.GS.dualVector.x = A; \ + \ + CUR.GS.projVector.y = B; \ + CUR.GS.dualVector.y = B; \ + \ + GUESS_VECTOR( freeVector ); \ + \ + COMPUTE_Funcs(); \ + } + + +#define DO_SFVTCA \ + { \ + FT_Short A, B; \ + \ + \ + A = (FT_Short)( CUR.opcode & 1 ) << 14; \ + B = A ^ (FT_Short)0x4000; \ + \ + CUR.GS.freeVector.x = A; \ + CUR.GS.freeVector.y = B; \ + \ + GUESS_VECTOR( projVector ); \ + \ + COMPUTE_Funcs(); \ + } + + +#define DO_SPVTL \ + if ( INS_SxVTL( (FT_UShort)args[1], \ + (FT_UShort)args[0], \ + CUR.opcode, \ + &CUR.GS.projVector ) == SUCCESS ) \ + { \ + CUR.GS.dualVector = CUR.GS.projVector; \ + GUESS_VECTOR( freeVector ); \ + COMPUTE_Funcs(); \ + } + + +#define DO_SFVTL \ + if ( INS_SxVTL( (FT_UShort)args[1], \ + (FT_UShort)args[0], \ + CUR.opcode, \ + &CUR.GS.freeVector ) == SUCCESS ) \ + { \ + GUESS_VECTOR( projVector ); \ + COMPUTE_Funcs(); \ + } + + +#define DO_SFVTPV \ + GUESS_VECTOR( projVector ); \ + CUR.GS.freeVector = CUR.GS.projVector; \ + COMPUTE_Funcs(); + + +#define DO_SPVFS \ + { \ + FT_Short S; \ + FT_Long X, Y; \ + \ + \ + /* Only use low 16bits, then sign extend */ \ + S = (FT_Short)args[1]; \ + Y = (FT_Long)S; \ + S = (FT_Short)args[0]; \ + X = (FT_Long)S; \ + \ + NORMalize( X, Y, &CUR.GS.projVector ); \ + \ + CUR.GS.dualVector = CUR.GS.projVector; \ + GUESS_VECTOR( freeVector ); \ + COMPUTE_Funcs(); \ + } + + +#define DO_SFVFS \ + { \ + FT_Short S; \ + FT_Long X, Y; \ + \ + \ + /* Only use low 16bits, then sign extend */ \ + S = (FT_Short)args[1]; \ + Y = (FT_Long)S; \ + S = (FT_Short)args[0]; \ + X = S; \ + \ + NORMalize( X, Y, &CUR.GS.freeVector ); \ + GUESS_VECTOR( projVector ); \ + COMPUTE_Funcs(); \ + } + + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING +#define DO_GPV \ + if ( CUR.face->unpatented_hinting ) \ + { \ + args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \ + args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \ + } \ + else \ + { \ + args[0] = CUR.GS.projVector.x; \ + args[1] = CUR.GS.projVector.y; \ + } +#else +#define DO_GPV \ + args[0] = CUR.GS.projVector.x; \ + args[1] = CUR.GS.projVector.y; +#endif + + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING +#define DO_GFV \ + if ( CUR.face->unpatented_hinting ) \ + { \ + args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \ + args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \ + } \ + else \ + { \ + args[0] = CUR.GS.freeVector.x; \ + args[1] = CUR.GS.freeVector.y; \ + } +#else +#define DO_GFV \ + args[0] = CUR.GS.freeVector.x; \ + args[1] = CUR.GS.freeVector.y; +#endif + + +#define DO_SRP0 \ + CUR.GS.rp0 = (FT_UShort)args[0]; + + +#define DO_SRP1 \ + CUR.GS.rp1 = (FT_UShort)args[0]; + + +#define DO_SRP2 \ + CUR.GS.rp2 = (FT_UShort)args[0]; + + +#define DO_RTHG \ + CUR.GS.round_state = TT_Round_To_Half_Grid; \ + CUR.func_round = (TT_Round_Func)Round_To_Half_Grid; + + +#define DO_RTG \ + CUR.GS.round_state = TT_Round_To_Grid; \ + CUR.func_round = (TT_Round_Func)Round_To_Grid; + + +#define DO_RTDG \ + CUR.GS.round_state = TT_Round_To_Double_Grid; \ + CUR.func_round = (TT_Round_Func)Round_To_Double_Grid; + + +#define DO_RUTG \ + CUR.GS.round_state = TT_Round_Up_To_Grid; \ + CUR.func_round = (TT_Round_Func)Round_Up_To_Grid; + + +#define DO_RDTG \ + CUR.GS.round_state = TT_Round_Down_To_Grid; \ + CUR.func_round = (TT_Round_Func)Round_Down_To_Grid; + + +#define DO_ROFF \ + CUR.GS.round_state = TT_Round_Off; \ + CUR.func_round = (TT_Round_Func)Round_None; + + +#define DO_SROUND \ + SET_SuperRound( 0x4000, args[0] ); \ + CUR.GS.round_state = TT_Round_Super; \ + CUR.func_round = (TT_Round_Func)Round_Super; + + +#define DO_S45ROUND \ + SET_SuperRound( 0x2D41, args[0] ); \ + CUR.GS.round_state = TT_Round_Super_45; \ + CUR.func_round = (TT_Round_Func)Round_Super_45; + + +#define DO_SLOOP \ + if ( args[0] < 0 ) \ + CUR.error = TT_Err_Bad_Argument; \ + else \ + CUR.GS.loop = args[0]; + + +#define DO_SMD \ + CUR.GS.minimum_distance = args[0]; + + +#define DO_SCVTCI \ + CUR.GS.control_value_cutin = (FT_F26Dot6)args[0]; + + +#define DO_SSWCI \ + CUR.GS.single_width_cutin = (FT_F26Dot6)args[0]; + + + /* XXX: UNDOCUMENTED! or bug in the Windows engine? */ + /* */ + /* It seems that the value that is read here is */ + /* expressed in 16.16 format rather than in font */ + /* units. */ + /* */ +#define DO_SSW \ + CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 ); + + +#define DO_FLIPON \ + CUR.GS.auto_flip = TRUE; + + +#define DO_FLIPOFF \ + CUR.GS.auto_flip = FALSE; + + +#define DO_SDB \ + CUR.GS.delta_base = (FT_Short)args[0]; + + +#define DO_SDS \ + CUR.GS.delta_shift = (FT_Short)args[0]; + + +#define DO_MD /* nothing */ + + +#define DO_MPPEM \ + args[0] = CURRENT_Ppem(); + + + /* Note: The pointSize should be irrelevant in a given font program; */ + /* we thus decide to return only the ppem. */ +#if 0 + +#define DO_MPS \ + args[0] = CUR.metrics.pointSize; + +#else + +#define DO_MPS \ + args[0] = CURRENT_Ppem(); + +#endif /* 0 */ + + +#define DO_DUP \ + args[1] = args[0]; + + +#define DO_CLEAR \ + CUR.new_top = 0; + + +#define DO_SWAP \ + { \ + FT_Long L; \ + \ + \ + L = args[0]; \ + args[0] = args[1]; \ + args[1] = L; \ + } + + +#define DO_DEPTH \ + args[0] = CUR.top; + + +#define DO_CINDEX \ + { \ + FT_Long L; \ + \ + \ + L = args[0]; \ + \ + if ( L <= 0 || L > CUR.args ) \ + CUR.error = TT_Err_Invalid_Reference; \ + else \ + args[0] = CUR.stack[CUR.args - L]; \ + } + + +#define DO_JROT \ + if ( args[1] != 0 ) \ + { \ + CUR.IP += args[0]; \ + CUR.step_ins = FALSE; \ + } + + +#define DO_JMPR \ + CUR.IP += args[0]; \ + CUR.step_ins = FALSE; + + +#define DO_JROF \ + if ( args[1] == 0 ) \ + { \ + CUR.IP += args[0]; \ + CUR.step_ins = FALSE; \ + } + + +#define DO_LT \ + args[0] = ( args[0] < args[1] ); + + +#define DO_LTEQ \ + args[0] = ( args[0] <= args[1] ); + + +#define DO_GT \ + args[0] = ( args[0] > args[1] ); + + +#define DO_GTEQ \ + args[0] = ( args[0] >= args[1] ); + + +#define DO_EQ \ + args[0] = ( args[0] == args[1] ); + + +#define DO_NEQ \ + args[0] = ( args[0] != args[1] ); + + +#define DO_ODD \ + args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 64 ); + + +#define DO_EVEN \ + args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 0 ); + + +#define DO_AND \ + args[0] = ( args[0] && args[1] ); + + +#define DO_OR \ + args[0] = ( args[0] || args[1] ); + + +#define DO_NOT \ + args[0] = !args[0]; + + +#define DO_ADD \ + args[0] += args[1]; + + +#define DO_SUB \ + args[0] -= args[1]; + + +#define DO_DIV \ + if ( args[1] == 0 ) \ + CUR.error = TT_Err_Divide_By_Zero; \ + else \ + args[0] = TT_MULDIV_NO_ROUND( args[0], 64L, args[1] ); + + +#define DO_MUL \ + args[0] = TT_MULDIV( args[0], args[1], 64L ); + + +#define DO_ABS \ + args[0] = FT_ABS( args[0] ); + + +#define DO_NEG \ + args[0] = -args[0]; + + +#define DO_FLOOR \ + args[0] = FT_PIX_FLOOR( args[0] ); + + +#define DO_CEILING \ + args[0] = FT_PIX_CEIL( args[0] ); + + +#define DO_RS \ + { \ + FT_ULong I = (FT_ULong)args[0]; \ + \ + \ + if ( BOUNDS( I, CUR.storeSize ) ) \ + { \ + if ( CUR.pedantic_hinting ) \ + { \ + ARRAY_BOUND_ERROR; \ + } \ + else \ + args[0] = 0; \ + } \ + else \ + args[0] = CUR.storage[I]; \ + } + + +#define DO_WS \ + { \ + FT_ULong I = (FT_ULong)args[0]; \ + \ + \ + if ( BOUNDS( I, CUR.storeSize ) ) \ + { \ + if ( CUR.pedantic_hinting ) \ + { \ + ARRAY_BOUND_ERROR; \ + } \ + } \ + else \ + CUR.storage[I] = args[1]; \ + } + + +#define DO_RCVT \ + { \ + FT_ULong I = (FT_ULong)args[0]; \ + \ + \ + if ( BOUNDS( I, CUR.cvtSize ) ) \ + { \ + if ( CUR.pedantic_hinting ) \ + { \ + ARRAY_BOUND_ERROR; \ + } \ + else \ + args[0] = 0; \ + } \ + else \ + args[0] = CUR_Func_read_cvt( I ); \ + } + + +#define DO_WCVTP \ + { \ + FT_ULong I = (FT_ULong)args[0]; \ + \ + \ + if ( BOUNDS( I, CUR.cvtSize ) ) \ + { \ + if ( CUR.pedantic_hinting ) \ + { \ + ARRAY_BOUND_ERROR; \ + } \ + } \ + else \ + CUR_Func_write_cvt( I, args[1] ); \ + } + + +#define DO_WCVTF \ + { \ + FT_ULong I = (FT_ULong)args[0]; \ + \ + \ + if ( BOUNDS( I, CUR.cvtSize ) ) \ + { \ + if ( CUR.pedantic_hinting ) \ + { \ + ARRAY_BOUND_ERROR; \ + } \ + } \ + else \ + CUR.cvt[I] = TT_MULFIX( args[1], CUR.tt_metrics.scale ); \ + } + + +#define DO_DEBUG \ + CUR.error = TT_Err_Debug_OpCode; + + +#define DO_ROUND \ + args[0] = CUR_Func_round( \ + args[0], \ + CUR.tt_metrics.compensations[CUR.opcode - 0x68] ); + + +#define DO_NROUND \ + args[0] = ROUND_None( args[0], \ + CUR.tt_metrics.compensations[CUR.opcode - 0x6C] ); + + +#define DO_MAX \ + if ( args[1] > args[0] ) \ + args[0] = args[1]; + + +#define DO_MIN \ + if ( args[1] < args[0] ) \ + args[0] = args[1]; + + +#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH + + +#undef ARRAY_BOUND_ERROR +#define ARRAY_BOUND_ERROR \ + { \ + CUR.error = TT_Err_Invalid_Reference; \ + return; \ + } + + + /*************************************************************************/ + /* */ + /* SVTCA[a]: Set (F and P) Vectors to Coordinate Axis */ + /* Opcode range: 0x00-0x01 */ + /* Stack: --> */ + /* */ + static void + Ins_SVTCA( INS_ARG ) + { + DO_SVTCA + } + + + /*************************************************************************/ + /* */ + /* SPVTCA[a]: Set PVector to Coordinate Axis */ + /* Opcode range: 0x02-0x03 */ + /* Stack: --> */ + /* */ + static void + Ins_SPVTCA( INS_ARG ) + { + DO_SPVTCA + } + + + /*************************************************************************/ + /* */ + /* SFVTCA[a]: Set FVector to Coordinate Axis */ + /* Opcode range: 0x04-0x05 */ + /* Stack: --> */ + /* */ + static void + Ins_SFVTCA( INS_ARG ) + { + DO_SFVTCA + } + + + /*************************************************************************/ + /* */ + /* SPVTL[a]: Set PVector To Line */ + /* Opcode range: 0x06-0x07 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_SPVTL( INS_ARG ) + { + DO_SPVTL + } + + + /*************************************************************************/ + /* */ + /* SFVTL[a]: Set FVector To Line */ + /* Opcode range: 0x08-0x09 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_SFVTL( INS_ARG ) + { + DO_SFVTL + } + + + /*************************************************************************/ + /* */ + /* SFVTPV[]: Set FVector To PVector */ + /* Opcode range: 0x0E */ + /* Stack: --> */ + /* */ + static void + Ins_SFVTPV( INS_ARG ) + { + DO_SFVTPV + } + + + /*************************************************************************/ + /* */ + /* SPVFS[]: Set PVector From Stack */ + /* Opcode range: 0x0A */ + /* Stack: f2.14 f2.14 --> */ + /* */ + static void + Ins_SPVFS( INS_ARG ) + { + DO_SPVFS + } + + + /*************************************************************************/ + /* */ + /* SFVFS[]: Set FVector From Stack */ + /* Opcode range: 0x0B */ + /* Stack: f2.14 f2.14 --> */ + /* */ + static void + Ins_SFVFS( INS_ARG ) + { + DO_SFVFS + } + + + /*************************************************************************/ + /* */ + /* GPV[]: Get Projection Vector */ + /* Opcode range: 0x0C */ + /* Stack: ef2.14 --> ef2.14 */ + /* */ + static void + Ins_GPV( INS_ARG ) + { + DO_GPV + } + + + /*************************************************************************/ + /* GFV[]: Get Freedom Vector */ + /* Opcode range: 0x0D */ + /* Stack: ef2.14 --> ef2.14 */ + /* */ + static void + Ins_GFV( INS_ARG ) + { + DO_GFV + } + + + /*************************************************************************/ + /* */ + /* SRP0[]: Set Reference Point 0 */ + /* Opcode range: 0x10 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SRP0( INS_ARG ) + { + DO_SRP0 + } + + + /*************************************************************************/ + /* */ + /* SRP1[]: Set Reference Point 1 */ + /* Opcode range: 0x11 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SRP1( INS_ARG ) + { + DO_SRP1 + } + + + /*************************************************************************/ + /* */ + /* SRP2[]: Set Reference Point 2 */ + /* Opcode range: 0x12 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SRP2( INS_ARG ) + { + DO_SRP2 + } + + + /*************************************************************************/ + /* */ + /* RTHG[]: Round To Half Grid */ + /* Opcode range: 0x19 */ + /* Stack: --> */ + /* */ + static void + Ins_RTHG( INS_ARG ) + { + DO_RTHG + } + + + /*************************************************************************/ + /* */ + /* RTG[]: Round To Grid */ + /* Opcode range: 0x18 */ + /* Stack: --> */ + /* */ + static void + Ins_RTG( INS_ARG ) + { + DO_RTG + } + + + /*************************************************************************/ + /* RTDG[]: Round To Double Grid */ + /* Opcode range: 0x3D */ + /* Stack: --> */ + /* */ + static void + Ins_RTDG( INS_ARG ) + { + DO_RTDG + } + + + /*************************************************************************/ + /* RUTG[]: Round Up To Grid */ + /* Opcode range: 0x7C */ + /* Stack: --> */ + /* */ + static void + Ins_RUTG( INS_ARG ) + { + DO_RUTG + } + + + /*************************************************************************/ + /* */ + /* RDTG[]: Round Down To Grid */ + /* Opcode range: 0x7D */ + /* Stack: --> */ + /* */ + static void + Ins_RDTG( INS_ARG ) + { + DO_RDTG + } + + + /*************************************************************************/ + /* */ + /* ROFF[]: Round OFF */ + /* Opcode range: 0x7A */ + /* Stack: --> */ + /* */ + static void + Ins_ROFF( INS_ARG ) + { + DO_ROFF + } + + + /*************************************************************************/ + /* */ + /* SROUND[]: Super ROUND */ + /* Opcode range: 0x76 */ + /* Stack: Eint8 --> */ + /* */ + static void + Ins_SROUND( INS_ARG ) + { + DO_SROUND + } + + + /*************************************************************************/ + /* */ + /* S45ROUND[]: Super ROUND 45 degrees */ + /* Opcode range: 0x77 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_S45ROUND( INS_ARG ) + { + DO_S45ROUND + } + + + /*************************************************************************/ + /* */ + /* SLOOP[]: Set LOOP variable */ + /* Opcode range: 0x17 */ + /* Stack: int32? --> */ + /* */ + static void + Ins_SLOOP( INS_ARG ) + { + DO_SLOOP + } + + + /*************************************************************************/ + /* */ + /* SMD[]: Set Minimum Distance */ + /* Opcode range: 0x1A */ + /* Stack: f26.6 --> */ + /* */ + static void + Ins_SMD( INS_ARG ) + { + DO_SMD + } + + + /*************************************************************************/ + /* */ + /* SCVTCI[]: Set Control Value Table Cut In */ + /* Opcode range: 0x1D */ + /* Stack: f26.6 --> */ + /* */ + static void + Ins_SCVTCI( INS_ARG ) + { + DO_SCVTCI + } + + + /*************************************************************************/ + /* */ + /* SSWCI[]: Set Single Width Cut In */ + /* Opcode range: 0x1E */ + /* Stack: f26.6 --> */ + /* */ + static void + Ins_SSWCI( INS_ARG ) + { + DO_SSWCI + } + + + /*************************************************************************/ + /* */ + /* SSW[]: Set Single Width */ + /* Opcode range: 0x1F */ + /* Stack: int32? --> */ + /* */ + static void + Ins_SSW( INS_ARG ) + { + DO_SSW + } + + + /*************************************************************************/ + /* */ + /* FLIPON[]: Set auto-FLIP to ON */ + /* Opcode range: 0x4D */ + /* Stack: --> */ + /* */ + static void + Ins_FLIPON( INS_ARG ) + { + DO_FLIPON + } + + + /*************************************************************************/ + /* */ + /* FLIPOFF[]: Set auto-FLIP to OFF */ + /* Opcode range: 0x4E */ + /* Stack: --> */ + /* */ + static void + Ins_FLIPOFF( INS_ARG ) + { + DO_FLIPOFF + } + + + /*************************************************************************/ + /* */ + /* SANGW[]: Set ANGle Weight */ + /* Opcode range: 0x7E */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SANGW( INS_ARG ) + { + /* instruction not supported anymore */ + } + + + /*************************************************************************/ + /* */ + /* SDB[]: Set Delta Base */ + /* Opcode range: 0x5E */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SDB( INS_ARG ) + { + DO_SDB + } + + + /*************************************************************************/ + /* */ + /* SDS[]: Set Delta Shift */ + /* Opcode range: 0x5F */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SDS( INS_ARG ) + { + DO_SDS + } + + + /*************************************************************************/ + /* */ + /* MPPEM[]: Measure Pixel Per EM */ + /* Opcode range: 0x4B */ + /* Stack: --> Euint16 */ + /* */ + static void + Ins_MPPEM( INS_ARG ) + { + DO_MPPEM + } + + + /*************************************************************************/ + /* */ + /* MPS[]: Measure Point Size */ + /* Opcode range: 0x4C */ + /* Stack: --> Euint16 */ + /* */ + static void + Ins_MPS( INS_ARG ) + { + DO_MPS + } + + + /*************************************************************************/ + /* */ + /* DUP[]: DUPlicate the top stack's element */ + /* Opcode range: 0x20 */ + /* Stack: StkElt --> StkElt StkElt */ + /* */ + static void + Ins_DUP( INS_ARG ) + { + DO_DUP + } + + + /*************************************************************************/ + /* */ + /* POP[]: POP the stack's top element */ + /* Opcode range: 0x21 */ + /* Stack: StkElt --> */ + /* */ + static void + Ins_POP( INS_ARG ) + { + /* nothing to do */ + } + + + /*************************************************************************/ + /* */ + /* CLEAR[]: CLEAR the entire stack */ + /* Opcode range: 0x22 */ + /* Stack: StkElt... --> */ + /* */ + static void + Ins_CLEAR( INS_ARG ) + { + DO_CLEAR + } + + + /*************************************************************************/ + /* */ + /* SWAP[]: SWAP the stack's top two elements */ + /* Opcode range: 0x23 */ + /* Stack: 2 * StkElt --> 2 * StkElt */ + /* */ + static void + Ins_SWAP( INS_ARG ) + { + DO_SWAP + } + + + /*************************************************************************/ + /* */ + /* DEPTH[]: return the stack DEPTH */ + /* Opcode range: 0x24 */ + /* Stack: --> uint32 */ + /* */ + static void + Ins_DEPTH( INS_ARG ) + { + DO_DEPTH + } + + + /*************************************************************************/ + /* */ + /* CINDEX[]: Copy INDEXed element */ + /* Opcode range: 0x25 */ + /* Stack: int32 --> StkElt */ + /* */ + static void + Ins_CINDEX( INS_ARG ) + { + DO_CINDEX + } + + + /*************************************************************************/ + /* */ + /* EIF[]: End IF */ + /* Opcode range: 0x59 */ + /* Stack: --> */ + /* */ + static void + Ins_EIF( INS_ARG ) + { + /* nothing to do */ + } + + + /*************************************************************************/ + /* */ + /* JROT[]: Jump Relative On True */ + /* Opcode range: 0x78 */ + /* Stack: StkElt int32 --> */ + /* */ + static void + Ins_JROT( INS_ARG ) + { + DO_JROT + } + + + /*************************************************************************/ + /* */ + /* JMPR[]: JuMP Relative */ + /* Opcode range: 0x1C */ + /* Stack: int32 --> */ + /* */ + static void + Ins_JMPR( INS_ARG ) + { + DO_JMPR + } + + + /*************************************************************************/ + /* */ + /* JROF[]: Jump Relative On False */ + /* Opcode range: 0x79 */ + /* Stack: StkElt int32 --> */ + /* */ + static void + Ins_JROF( INS_ARG ) + { + DO_JROF + } + + + /*************************************************************************/ + /* */ + /* LT[]: Less Than */ + /* Opcode range: 0x50 */ + /* Stack: int32? int32? --> bool */ + /* */ + static void + Ins_LT( INS_ARG ) + { + DO_LT + } + + + /*************************************************************************/ + /* */ + /* LTEQ[]: Less Than or EQual */ + /* Opcode range: 0x51 */ + /* Stack: int32? int32? --> bool */ + /* */ + static void + Ins_LTEQ( INS_ARG ) + { + DO_LTEQ + } + + + /*************************************************************************/ + /* */ + /* GT[]: Greater Than */ + /* Opcode range: 0x52 */ + /* Stack: int32? int32? --> bool */ + /* */ + static void + Ins_GT( INS_ARG ) + { + DO_GT + } + + + /*************************************************************************/ + /* */ + /* GTEQ[]: Greater Than or EQual */ + /* Opcode range: 0x53 */ + /* Stack: int32? int32? --> bool */ + /* */ + static void + Ins_GTEQ( INS_ARG ) + { + DO_GTEQ + } + + + /*************************************************************************/ + /* */ + /* EQ[]: EQual */ + /* Opcode range: 0x54 */ + /* Stack: StkElt StkElt --> bool */ + /* */ + static void + Ins_EQ( INS_ARG ) + { + DO_EQ + } + + + /*************************************************************************/ + /* */ + /* NEQ[]: Not EQual */ + /* Opcode range: 0x55 */ + /* Stack: StkElt StkElt --> bool */ + /* */ + static void + Ins_NEQ( INS_ARG ) + { + DO_NEQ + } + + + /*************************************************************************/ + /* */ + /* ODD[]: Is ODD */ + /* Opcode range: 0x56 */ + /* Stack: f26.6 --> bool */ + /* */ + static void + Ins_ODD( INS_ARG ) + { + DO_ODD + } + + + /*************************************************************************/ + /* */ + /* EVEN[]: Is EVEN */ + /* Opcode range: 0x57 */ + /* Stack: f26.6 --> bool */ + /* */ + static void + Ins_EVEN( INS_ARG ) + { + DO_EVEN + } + + + /*************************************************************************/ + /* */ + /* AND[]: logical AND */ + /* Opcode range: 0x5A */ + /* Stack: uint32 uint32 --> uint32 */ + /* */ + static void + Ins_AND( INS_ARG ) + { + DO_AND + } + + + /*************************************************************************/ + /* */ + /* OR[]: logical OR */ + /* Opcode range: 0x5B */ + /* Stack: uint32 uint32 --> uint32 */ + /* */ + static void + Ins_OR( INS_ARG ) + { + DO_OR + } + + + /*************************************************************************/ + /* */ + /* NOT[]: logical NOT */ + /* Opcode range: 0x5C */ + /* Stack: StkElt --> uint32 */ + /* */ + static void + Ins_NOT( INS_ARG ) + { + DO_NOT + } + + + /*************************************************************************/ + /* */ + /* ADD[]: ADD */ + /* Opcode range: 0x60 */ + /* Stack: f26.6 f26.6 --> f26.6 */ + /* */ + static void + Ins_ADD( INS_ARG ) + { + DO_ADD + } + + + /*************************************************************************/ + /* */ + /* SUB[]: SUBtract */ + /* Opcode range: 0x61 */ + /* Stack: f26.6 f26.6 --> f26.6 */ + /* */ + static void + Ins_SUB( INS_ARG ) + { + DO_SUB + } + + + /*************************************************************************/ + /* */ + /* DIV[]: DIVide */ + /* Opcode range: 0x62 */ + /* Stack: f26.6 f26.6 --> f26.6 */ + /* */ + static void + Ins_DIV( INS_ARG ) + { + DO_DIV + } + + + /*************************************************************************/ + /* */ + /* MUL[]: MULtiply */ + /* Opcode range: 0x63 */ + /* Stack: f26.6 f26.6 --> f26.6 */ + /* */ + static void + Ins_MUL( INS_ARG ) + { + DO_MUL + } + + + /*************************************************************************/ + /* */ + /* ABS[]: ABSolute value */ + /* Opcode range: 0x64 */ + /* Stack: f26.6 --> f26.6 */ + /* */ + static void + Ins_ABS( INS_ARG ) + { + DO_ABS + } + + + /*************************************************************************/ + /* */ + /* NEG[]: NEGate */ + /* Opcode range: 0x65 */ + /* Stack: f26.6 --> f26.6 */ + /* */ + static void + Ins_NEG( INS_ARG ) + { + DO_NEG + } + + + /*************************************************************************/ + /* */ + /* FLOOR[]: FLOOR */ + /* Opcode range: 0x66 */ + /* Stack: f26.6 --> f26.6 */ + /* */ + static void + Ins_FLOOR( INS_ARG ) + { + DO_FLOOR + } + + + /*************************************************************************/ + /* */ + /* CEILING[]: CEILING */ + /* Opcode range: 0x67 */ + /* Stack: f26.6 --> f26.6 */ + /* */ + static void + Ins_CEILING( INS_ARG ) + { + DO_CEILING + } + + + /*************************************************************************/ + /* */ + /* RS[]: Read Store */ + /* Opcode range: 0x43 */ + /* Stack: uint32 --> uint32 */ + /* */ + static void + Ins_RS( INS_ARG ) + { + DO_RS + } + + + /*************************************************************************/ + /* */ + /* WS[]: Write Store */ + /* Opcode range: 0x42 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_WS( INS_ARG ) + { + DO_WS + } + + + /*************************************************************************/ + /* */ + /* WCVTP[]: Write CVT in Pixel units */ + /* Opcode range: 0x44 */ + /* Stack: f26.6 uint32 --> */ + /* */ + static void + Ins_WCVTP( INS_ARG ) + { + DO_WCVTP + } + + + /*************************************************************************/ + /* */ + /* WCVTF[]: Write CVT in Funits */ + /* Opcode range: 0x70 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_WCVTF( INS_ARG ) + { + DO_WCVTF + } + + + /*************************************************************************/ + /* */ + /* RCVT[]: Read CVT */ + /* Opcode range: 0x45 */ + /* Stack: uint32 --> f26.6 */ + /* */ + static void + Ins_RCVT( INS_ARG ) + { + DO_RCVT + } + + + /*************************************************************************/ + /* */ + /* AA[]: Adjust Angle */ + /* Opcode range: 0x7F */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_AA( INS_ARG ) + { + /* intentionally no longer supported */ + } + + + /*************************************************************************/ + /* */ + /* DEBUG[]: DEBUG. Unsupported. */ + /* Opcode range: 0x4F */ + /* Stack: uint32 --> */ + /* */ + /* Note: The original instruction pops a value from the stack. */ + /* */ + static void + Ins_DEBUG( INS_ARG ) + { + DO_DEBUG + } + + + /*************************************************************************/ + /* */ + /* ROUND[ab]: ROUND value */ + /* Opcode range: 0x68-0x6B */ + /* Stack: f26.6 --> f26.6 */ + /* */ + static void + Ins_ROUND( INS_ARG ) + { + DO_ROUND + } + + + /*************************************************************************/ + /* */ + /* NROUND[ab]: No ROUNDing of value */ + /* Opcode range: 0x6C-0x6F */ + /* Stack: f26.6 --> f26.6 */ + /* */ + static void + Ins_NROUND( INS_ARG ) + { + DO_NROUND + } + + + /*************************************************************************/ + /* */ + /* MAX[]: MAXimum */ + /* Opcode range: 0x68 */ + /* Stack: int32? int32? --> int32 */ + /* */ + static void + Ins_MAX( INS_ARG ) + { + DO_MAX + } + + + /*************************************************************************/ + /* */ + /* MIN[]: MINimum */ + /* Opcode range: 0x69 */ + /* Stack: int32? int32? --> int32 */ + /* */ + static void + Ins_MIN( INS_ARG ) + { + DO_MIN + } + + +#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */ + + + /*************************************************************************/ + /* */ + /* The following functions are called as is within the switch statement. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* MINDEX[]: Move INDEXed element */ + /* Opcode range: 0x26 */ + /* Stack: int32? --> StkElt */ + /* */ + static void + Ins_MINDEX( INS_ARG ) + { + FT_Long L, K; + + + L = args[0]; + + if ( L <= 0 || L > CUR.args ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + + K = CUR.stack[CUR.args - L]; + + FT_ARRAY_MOVE( &CUR.stack[CUR.args - L ], + &CUR.stack[CUR.args - L + 1], + ( L - 1 ) ); + + CUR.stack[CUR.args - 1] = K; + } + + + /*************************************************************************/ + /* */ + /* ROLL[]: ROLL top three elements */ + /* Opcode range: 0x8A */ + /* Stack: 3 * StkElt --> 3 * StkElt */ + /* */ + static void + Ins_ROLL( INS_ARG ) + { + FT_Long A, B, C; + + FT_UNUSED_EXEC; + + + A = args[2]; + B = args[1]; + C = args[0]; + + args[2] = C; + args[1] = A; + args[0] = B; + } + + + /*************************************************************************/ + /* */ + /* MANAGING THE FLOW OF CONTROL */ + /* */ + /* Instructions appear in the specification's order. */ + /* */ + /*************************************************************************/ + + + static FT_Bool + SkipCode( EXEC_OP ) + { + CUR.IP += CUR.length; + + if ( CUR.IP < CUR.codeSize ) + { + CUR.opcode = CUR.code[CUR.IP]; + + CUR.length = opcode_length[CUR.opcode]; + if ( CUR.length < 0 ) + { + if ( CUR.IP + 1 > CUR.codeSize ) + goto Fail_Overflow; + CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1]; + } + + if ( CUR.IP + CUR.length <= CUR.codeSize ) + return SUCCESS; + } + + Fail_Overflow: + CUR.error = TT_Err_Code_Overflow; + return FAILURE; + } + + + /*************************************************************************/ + /* */ + /* IF[]: IF test */ + /* Opcode range: 0x58 */ + /* Stack: StkElt --> */ + /* */ + static void + Ins_IF( INS_ARG ) + { + FT_Int nIfs; + FT_Bool Out; + + + if ( args[0] != 0 ) + return; + + nIfs = 1; + Out = 0; + + do + { + if ( SKIP_Code() == FAILURE ) + return; + + switch ( CUR.opcode ) + { + case 0x58: /* IF */ + nIfs++; + break; + + case 0x1B: /* ELSE */ + Out = FT_BOOL( nIfs == 1 ); + break; + + case 0x59: /* EIF */ + nIfs--; + Out = FT_BOOL( nIfs == 0 ); + break; + } + } while ( Out == 0 ); + } + + + /*************************************************************************/ + /* */ + /* ELSE[]: ELSE */ + /* Opcode range: 0x1B */ + /* Stack: --> */ + /* */ + static void + Ins_ELSE( INS_ARG ) + { + FT_Int nIfs; + + FT_UNUSED_ARG; + + + nIfs = 1; + + do + { + if ( SKIP_Code() == FAILURE ) + return; + + switch ( CUR.opcode ) + { + case 0x58: /* IF */ + nIfs++; + break; + + case 0x59: /* EIF */ + nIfs--; + break; + } + } while ( nIfs != 0 ); + } + + + /*************************************************************************/ + /* */ + /* DEFINING AND USING FUNCTIONS AND INSTRUCTIONS */ + /* */ + /* Instructions appear in the specification's order. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* FDEF[]: Function DEFinition */ + /* Opcode range: 0x2C */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_FDEF( INS_ARG ) + { + FT_ULong n; + TT_DefRecord* rec; + TT_DefRecord* limit; + + + /* some font programs are broken enough to redefine functions! */ + /* We will then parse the current table. */ + + rec = CUR.FDefs; + limit = rec + CUR.numFDefs; + n = args[0]; + + for ( ; rec < limit; rec++ ) + { + if ( rec->opc == n ) + break; + } + + if ( rec == limit ) + { + /* check that there is enough room for new functions */ + if ( CUR.numFDefs >= CUR.maxFDefs ) + { + CUR.error = TT_Err_Too_Many_Function_Defs; + return; + } + CUR.numFDefs++; + } + + rec->range = CUR.curRange; + rec->opc = n; + rec->start = CUR.IP + 1; + rec->active = TRUE; + + if ( n > CUR.maxFunc ) + CUR.maxFunc = n; + + /* Now skip the whole function definition. */ + /* We don't allow nested IDEFS & FDEFs. */ + + while ( SKIP_Code() == SUCCESS ) + { + switch ( CUR.opcode ) + { + case 0x89: /* IDEF */ + case 0x2C: /* FDEF */ + CUR.error = TT_Err_Nested_DEFS; + return; + + case 0x2D: /* ENDF */ + return; + } + } + } + + + /*************************************************************************/ + /* */ + /* ENDF[]: END Function definition */ + /* Opcode range: 0x2D */ + /* Stack: --> */ + /* */ + static void + Ins_ENDF( INS_ARG ) + { + TT_CallRec* pRec; + + FT_UNUSED_ARG; + + + if ( CUR.callTop <= 0 ) /* We encountered an ENDF without a call */ + { + CUR.error = TT_Err_ENDF_In_Exec_Stream; + return; + } + + CUR.callTop--; + + pRec = &CUR.callStack[CUR.callTop]; + + pRec->Cur_Count--; + + CUR.step_ins = FALSE; + + if ( pRec->Cur_Count > 0 ) + { + CUR.callTop++; + CUR.IP = pRec->Cur_Restart; + } + else + /* Loop through the current function */ + INS_Goto_CodeRange( pRec->Caller_Range, + pRec->Caller_IP ); + + /* Exit the current call frame. */ + + /* NOTE: If the last instruction of a program is a */ + /* CALL or LOOPCALL, the return address is */ + /* always out of the code range. This is a */ + /* valid address, and it is why we do not test */ + /* the result of Ins_Goto_CodeRange() here! */ + } + + + /*************************************************************************/ + /* */ + /* CALL[]: CALL function */ + /* Opcode range: 0x2B */ + /* Stack: uint32? --> */ + /* */ + static void + Ins_CALL( INS_ARG ) + { + FT_ULong F; + TT_CallRec* pCrec; + TT_DefRecord* def; + + + /* first of all, check the index */ + + F = args[0]; + if ( BOUNDS( F, CUR.maxFunc + 1 ) ) + goto Fail; + + /* Except for some old Apple fonts, all functions in a TrueType */ + /* font are defined in increasing order, starting from 0. This */ + /* means that we normally have */ + /* */ + /* CUR.maxFunc+1 == CUR.numFDefs */ + /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */ + /* */ + /* If this isn't true, we need to look up the function table. */ + + def = CUR.FDefs + F; + if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F ) + { + /* look up the FDefs table */ + TT_DefRecord* limit; + + + def = CUR.FDefs; + limit = def + CUR.numFDefs; + + while ( def < limit && def->opc != F ) + def++; + + if ( def == limit ) + goto Fail; + } + + /* check that the function is active */ + if ( !def->active ) + goto Fail; + + /* check the call stack */ + if ( CUR.callTop >= CUR.callSize ) + { + CUR.error = TT_Err_Stack_Overflow; + return; + } + + pCrec = CUR.callStack + CUR.callTop; + + pCrec->Caller_Range = CUR.curRange; + pCrec->Caller_IP = CUR.IP + 1; + pCrec->Cur_Count = 1; + pCrec->Cur_Restart = def->start; + + CUR.callTop++; + + INS_Goto_CodeRange( def->range, + def->start ); + + CUR.step_ins = FALSE; + return; + + Fail: + CUR.error = TT_Err_Invalid_Reference; + } + + + /*************************************************************************/ + /* */ + /* LOOPCALL[]: LOOP and CALL function */ + /* Opcode range: 0x2A */ + /* Stack: uint32? Eint16? --> */ + /* */ + static void + Ins_LOOPCALL( INS_ARG ) + { + FT_ULong F; + TT_CallRec* pCrec; + TT_DefRecord* def; + + + /* first of all, check the index */ + F = args[1]; + if ( BOUNDS( F, CUR.maxFunc + 1 ) ) + goto Fail; + + /* Except for some old Apple fonts, all functions in a TrueType */ + /* font are defined in increasing order, starting from 0. This */ + /* means that we normally have */ + /* */ + /* CUR.maxFunc+1 == CUR.numFDefs */ + /* CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc */ + /* */ + /* If this isn't true, we need to look up the function table. */ + + def = CUR.FDefs + F; + if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F ) + { + /* look up the FDefs table */ + TT_DefRecord* limit; + + + def = CUR.FDefs; + limit = def + CUR.numFDefs; + + while ( def < limit && def->opc != F ) + def++; + + if ( def == limit ) + goto Fail; + } + + /* check that the function is active */ + if ( !def->active ) + goto Fail; + + /* check stack */ + if ( CUR.callTop >= CUR.callSize ) + { + CUR.error = TT_Err_Stack_Overflow; + return; + } + + if ( args[0] > 0 ) + { + pCrec = CUR.callStack + CUR.callTop; + + pCrec->Caller_Range = CUR.curRange; + pCrec->Caller_IP = CUR.IP + 1; + pCrec->Cur_Count = (FT_Int)args[0]; + pCrec->Cur_Restart = def->start; + + CUR.callTop++; + + INS_Goto_CodeRange( def->range, def->start ); + + CUR.step_ins = FALSE; + } + return; + + Fail: + CUR.error = TT_Err_Invalid_Reference; + } + + + /*************************************************************************/ + /* */ + /* IDEF[]: Instruction DEFinition */ + /* Opcode range: 0x89 */ + /* Stack: Eint8 --> */ + /* */ + static void + Ins_IDEF( INS_ARG ) + { + TT_DefRecord* def; + TT_DefRecord* limit; + + + /* First of all, look for the same function in our table */ + + def = CUR.IDefs; + limit = def + CUR.numIDefs; + + for ( ; def < limit; def++ ) + if ( def->opc == (FT_ULong)args[0] ) + break; + + if ( def == limit ) + { + /* check that there is enough room for a new instruction */ + if ( CUR.numIDefs >= CUR.maxIDefs ) + { + CUR.error = TT_Err_Too_Many_Instruction_Defs; + return; + } + CUR.numIDefs++; + } + + def->opc = args[0]; + def->start = CUR.IP+1; + def->range = CUR.curRange; + def->active = TRUE; + + if ( (FT_ULong)args[0] > CUR.maxIns ) + CUR.maxIns = args[0]; + + /* Now skip the whole function definition. */ + /* We don't allow nested IDEFs & FDEFs. */ + + while ( SKIP_Code() == SUCCESS ) + { + switch ( CUR.opcode ) + { + case 0x89: /* IDEF */ + case 0x2C: /* FDEF */ + CUR.error = TT_Err_Nested_DEFS; + return; + case 0x2D: /* ENDF */ + return; + } + } + } + + + /*************************************************************************/ + /* */ + /* PUSHING DATA ONTO THE INTERPRETER STACK */ + /* */ + /* Instructions appear in the specification's order. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* NPUSHB[]: PUSH N Bytes */ + /* Opcode range: 0x40 */ + /* Stack: --> uint32... */ + /* */ + static void + Ins_NPUSHB( INS_ARG ) + { + FT_UShort L, K; + + + L = (FT_UShort)CUR.code[CUR.IP + 1]; + + if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) + { + CUR.error = TT_Err_Stack_Overflow; + return; + } + + for ( K = 1; K <= L; K++ ) + args[K - 1] = CUR.code[CUR.IP + K + 1]; + + CUR.new_top += L; + } + + + /*************************************************************************/ + /* */ + /* NPUSHW[]: PUSH N Words */ + /* Opcode range: 0x41 */ + /* Stack: --> int32... */ + /* */ + static void + Ins_NPUSHW( INS_ARG ) + { + FT_UShort L, K; + + + L = (FT_UShort)CUR.code[CUR.IP + 1]; + + if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) + { + CUR.error = TT_Err_Stack_Overflow; + return; + } + + CUR.IP += 2; + + for ( K = 0; K < L; K++ ) + args[K] = GET_ShortIns(); + + CUR.step_ins = FALSE; + CUR.new_top += L; + } + + + /*************************************************************************/ + /* */ + /* PUSHB[abc]: PUSH Bytes */ + /* Opcode range: 0xB0-0xB7 */ + /* Stack: --> uint32... */ + /* */ + static void + Ins_PUSHB( INS_ARG ) + { + FT_UShort L, K; + + + L = (FT_UShort)( CUR.opcode - 0xB0 + 1 ); + + if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) + { + CUR.error = TT_Err_Stack_Overflow; + return; + } + + for ( K = 1; K <= L; K++ ) + args[K - 1] = CUR.code[CUR.IP + K]; + } + + + /*************************************************************************/ + /* */ + /* PUSHW[abc]: PUSH Words */ + /* Opcode range: 0xB8-0xBF */ + /* Stack: --> int32... */ + /* */ + static void + Ins_PUSHW( INS_ARG ) + { + FT_UShort L, K; + + + L = (FT_UShort)( CUR.opcode - 0xB8 + 1 ); + + if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) + { + CUR.error = TT_Err_Stack_Overflow; + return; + } + + CUR.IP++; + + for ( K = 0; K < L; K++ ) + args[K] = GET_ShortIns(); + + CUR.step_ins = FALSE; + } + + + /*************************************************************************/ + /* */ + /* MANAGING THE GRAPHICS STATE */ + /* */ + /* Instructions appear in the specs' order. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* GC[a]: Get Coordinate projected onto */ + /* Opcode range: 0x46-0x47 */ + /* Stack: uint32 --> f26.6 */ + /* */ + /* BULLSHIT: Measures from the original glyph must be taken along the */ + /* dual projection vector! */ + /* */ + static void + Ins_GC( INS_ARG ) + { + FT_ULong L; + FT_F26Dot6 R; + + + L = (FT_ULong)args[0]; + + if ( BOUNDS( L, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + else + R = 0; + } + else + { + if ( CUR.opcode & 1 ) + R = CUR_fast_dualproj( &CUR.zp2.org[L] ); + else + R = CUR_fast_project( &CUR.zp2.cur[L] ); + } + + args[0] = R; + } + + + /*************************************************************************/ + /* */ + /* SCFS[]: Set Coordinate From Stack */ + /* Opcode range: 0x48 */ + /* Stack: f26.6 uint32 --> */ + /* */ + /* Formula: */ + /* */ + /* OA := OA + ( value - OA.p )/( f.p ) * f */ + /* */ + static void + Ins_SCFS( INS_ARG ) + { + FT_Long K; + FT_UShort L; + + + L = (FT_UShort)args[0]; + + if ( BOUNDS( L, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + K = CUR_fast_project( &CUR.zp2.cur[L] ); + + CUR_Func_move( &CUR.zp2, L, args[1] - K ); + + /* not part of the specs, but here for safety */ + + if ( CUR.GS.gep2 == 0 ) + CUR.zp2.org[L] = CUR.zp2.cur[L]; + } + + + /*************************************************************************/ + /* */ + /* MD[a]: Measure Distance */ + /* Opcode range: 0x49-0x4A */ + /* Stack: uint32 uint32 --> f26.6 */ + /* */ + /* BULLSHIT: Measure taken in the original glyph must be along the dual */ + /* projection vector. */ + /* */ + /* Second BULLSHIT: Flag attributes are inverted! */ + /* 0 => measure distance in original outline */ + /* 1 => measure distance in grid-fitted outline */ + /* */ + /* Third one: `zp0 - zp1', and not `zp2 - zp1! */ + /* */ + static void + Ins_MD( INS_ARG ) + { + FT_UShort K, L; + FT_F26Dot6 D; + + + K = (FT_UShort)args[1]; + L = (FT_UShort)args[0]; + + if( BOUNDS( L, CUR.zp0.n_points ) || + BOUNDS( K, CUR.zp1.n_points ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + D = 0; + } + else + { + if ( CUR.opcode & 1 ) + D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K ); + else + D = CUR_Func_dualproj( CUR.zp0.org + L, CUR.zp1.org + K ); + } + + args[0] = D; + } + + + /*************************************************************************/ + /* */ + /* SDPVTL[a]: Set Dual PVector to Line */ + /* Opcode range: 0x86-0x87 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_SDPVTL( INS_ARG ) + { + FT_Long A, B, C; + FT_UShort p1, p2; /* was FT_Int in pas type ERROR */ + + + p1 = (FT_UShort)args[1]; + p2 = (FT_UShort)args[0]; + + if ( BOUNDS( p2, CUR.zp1.n_points ) || + BOUNDS( p1, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + { + FT_Vector* v1 = CUR.zp1.org + p2; + FT_Vector* v2 = CUR.zp2.org + p1; + + + A = v1->x - v2->x; + B = v1->y - v2->y; + } + + if ( ( CUR.opcode & 1 ) != 0 ) + { + C = B; /* counter clockwise rotation */ + B = A; + A = -C; + } + + NORMalize( A, B, &CUR.GS.dualVector ); + + { + FT_Vector* v1 = CUR.zp1.cur + p2; + FT_Vector* v2 = CUR.zp2.cur + p1; + + + A = v1->x - v2->x; + B = v1->y - v2->y; + } + + if ( ( CUR.opcode & 1 ) != 0 ) + { + C = B; /* counter clockwise rotation */ + B = A; + A = -C; + } + + NORMalize( A, B, &CUR.GS.projVector ); + + GUESS_VECTOR( freeVector ); + + COMPUTE_Funcs(); + } + + + /*************************************************************************/ + /* */ + /* SZP0[]: Set Zone Pointer 0 */ + /* Opcode range: 0x13 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SZP0( INS_ARG ) + { + switch ( (FT_Int)args[0] ) + { + case 0: + CUR.zp0 = CUR.twilight; + break; + + case 1: + CUR.zp0 = CUR.pts; + break; + + default: + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + CUR.GS.gep0 = (FT_UShort)args[0]; + } + + + /*************************************************************************/ + /* */ + /* SZP1[]: Set Zone Pointer 1 */ + /* Opcode range: 0x14 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SZP1( INS_ARG ) + { + switch ( (FT_Int)args[0] ) + { + case 0: + CUR.zp1 = CUR.twilight; + break; + + case 1: + CUR.zp1 = CUR.pts; + break; + + default: + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + CUR.GS.gep1 = (FT_UShort)args[0]; + } + + + /*************************************************************************/ + /* */ + /* SZP2[]: Set Zone Pointer 2 */ + /* Opcode range: 0x15 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SZP2( INS_ARG ) + { + switch ( (FT_Int)args[0] ) + { + case 0: + CUR.zp2 = CUR.twilight; + break; + + case 1: + CUR.zp2 = CUR.pts; + break; + + default: + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + CUR.GS.gep2 = (FT_UShort)args[0]; + } + + + /*************************************************************************/ + /* */ + /* SZPS[]: Set Zone PointerS */ + /* Opcode range: 0x16 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SZPS( INS_ARG ) + { + switch ( (FT_Int)args[0] ) + { + case 0: + CUR.zp0 = CUR.twilight; + break; + + case 1: + CUR.zp0 = CUR.pts; + break; + + default: + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + CUR.zp1 = CUR.zp0; + CUR.zp2 = CUR.zp0; + + CUR.GS.gep0 = (FT_UShort)args[0]; + CUR.GS.gep1 = (FT_UShort)args[0]; + CUR.GS.gep2 = (FT_UShort)args[0]; + } + + + /*************************************************************************/ + /* */ + /* INSTCTRL[]: INSTruction ConTRoL */ + /* Opcode range: 0x8e */ + /* Stack: int32 int32 --> */ + /* */ + static void + Ins_INSTCTRL( INS_ARG ) + { + FT_Long K, L; + + + K = args[1]; + L = args[0]; + + if ( K < 1 || K > 2 ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + if ( L != 0 ) + L = K; + + CUR.GS.instruct_control = FT_BOOL( + ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L ); + } + + + /*************************************************************************/ + /* */ + /* SCANCTRL[]: SCAN ConTRoL */ + /* Opcode range: 0x85 */ + /* Stack: uint32? --> */ + /* */ + static void + Ins_SCANCTRL( INS_ARG ) + { + FT_Int A; + + + /* Get Threshold */ + A = (FT_Int)( args[0] & 0xFF ); + + if ( A == 0xFF ) + { + CUR.GS.scan_control = TRUE; + return; + } + else if ( A == 0 ) + { + CUR.GS.scan_control = FALSE; + return; + } + + A *= 64; + +#if 0 + if ( ( args[0] & 0x100 ) != 0 && CUR.metrics.pointSize <= A ) + CUR.GS.scan_control = TRUE; +#endif + + if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated ) + CUR.GS.scan_control = TRUE; + + if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched ) + CUR.GS.scan_control = TRUE; + +#if 0 + if ( ( args[0] & 0x800 ) != 0 && CUR.metrics.pointSize > A ) + CUR.GS.scan_control = FALSE; +#endif + + if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated ) + CUR.GS.scan_control = FALSE; + + if ( ( args[0] & 0x2000 ) != 0 && CUR.tt_metrics.stretched ) + CUR.GS.scan_control = FALSE; + } + + + /*************************************************************************/ + /* */ + /* SCANTYPE[]: SCAN TYPE */ + /* Opcode range: 0x8D */ + /* Stack: uint32? --> */ + /* */ + static void + Ins_SCANTYPE( INS_ARG ) + { + /* for compatibility with future enhancements, */ + /* we must ignore new modes */ + + if ( args[0] >= 0 && args[0] <= 5 ) + { + if ( args[0] == 3 ) + args[0] = 2; + + CUR.GS.scan_type = (FT_Int)args[0]; + } + } + + + /*************************************************************************/ + /* */ + /* MANAGING OUTLINES */ + /* */ + /* Instructions appear in the specification's order. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* FLIPPT[]: FLIP PoinT */ + /* Opcode range: 0x80 */ + /* Stack: uint32... --> */ + /* */ + static void + Ins_FLIPPT( INS_ARG ) + { + FT_UShort point; + + FT_UNUSED_ARG; + + + if ( CUR.top < CUR.GS.loop ) + { + CUR.error = TT_Err_Too_Few_Arguments; + return; + } + + while ( CUR.GS.loop > 0 ) + { + CUR.args--; + + point = (FT_UShort)CUR.stack[CUR.args]; + + if ( BOUNDS( point, CUR.pts.n_points ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + } + else + CUR.pts.tags[point] ^= FT_CURVE_TAG_ON; + + CUR.GS.loop--; + } + + CUR.GS.loop = 1; + CUR.new_top = CUR.args; + } + + + /*************************************************************************/ + /* */ + /* FLIPRGON[]: FLIP RanGe ON */ + /* Opcode range: 0x81 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_FLIPRGON( INS_ARG ) + { + FT_UShort I, K, L; + + + K = (FT_UShort)args[1]; + L = (FT_UShort)args[0]; + + if ( BOUNDS( K, CUR.pts.n_points ) || + BOUNDS( L, CUR.pts.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + for ( I = L; I <= K; I++ ) + CUR.pts.tags[I] |= FT_CURVE_TAG_ON; + } + + + /*************************************************************************/ + /* */ + /* FLIPRGOFF: FLIP RanGe OFF */ + /* Opcode range: 0x82 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_FLIPRGOFF( INS_ARG ) + { + FT_UShort I, K, L; + + + K = (FT_UShort)args[1]; + L = (FT_UShort)args[0]; + + if ( BOUNDS( K, CUR.pts.n_points ) || + BOUNDS( L, CUR.pts.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + for ( I = L; I <= K; I++ ) + CUR.pts.tags[I] &= ~FT_CURVE_TAG_ON; + } + + + static FT_Bool + Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x, + FT_F26Dot6* y, + TT_GlyphZone zone, + FT_UShort* refp ) + { + TT_GlyphZoneRec zp; + FT_UShort p; + FT_F26Dot6 d; + + + if ( CUR.opcode & 1 ) + { + zp = CUR.zp0; + p = CUR.GS.rp1; + } + else + { + zp = CUR.zp1; + p = CUR.GS.rp2; + } + + if ( BOUNDS( p, zp.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + *refp = 0; + return FAILURE; + } + + *zone = zp; + *refp = p; + + d = CUR_Func_project( zp.cur + p, zp.org + p ); + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + if ( CUR.face->unpatented_hinting ) + { + if ( CUR.GS.both_x_axis ) + { + *x = d; + *y = 0; + } + else + { + *x = 0; + *y = d; + } + } + else +#endif + { + *x = TT_MULDIV( d, + (FT_Long)CUR.GS.freeVector.x * 0x10000L, + CUR.F_dot_P ); + *y = TT_MULDIV( d, + (FT_Long)CUR.GS.freeVector.y * 0x10000L, + CUR.F_dot_P ); + } + + return SUCCESS; + } + + + static void + Move_Zp2_Point( EXEC_OP_ FT_UShort point, + FT_F26Dot6 dx, + FT_F26Dot6 dy, + FT_Bool touch ) + { +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + if ( CUR.face->unpatented_hinting ) + { + if ( CUR.GS.both_x_axis ) + { + CUR.zp2.cur[point].x += dx; + if ( touch ) + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X; + } + else + { + CUR.zp2.cur[point].y += dy; + if ( touch ) + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y; + } + return; + } +#endif + + if ( CUR.GS.freeVector.x != 0 ) + { + CUR.zp2.cur[point].x += dx; + if ( touch ) + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X; + } + + if ( CUR.GS.freeVector.y != 0 ) + { + CUR.zp2.cur[point].y += dy; + if ( touch ) + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y; + } + } + + + /*************************************************************************/ + /* */ + /* SHP[a]: SHift Point by the last point */ + /* Opcode range: 0x32-0x33 */ + /* Stack: uint32... --> */ + /* */ + static void + Ins_SHP( INS_ARG ) + { + TT_GlyphZoneRec zp; + FT_UShort refp; + + FT_F26Dot6 dx, + dy; + FT_UShort point; + + FT_UNUSED_ARG; + + + if ( CUR.top < CUR.GS.loop ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + + if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) ) + return; + + while ( CUR.GS.loop > 0 ) + { + CUR.args--; + point = (FT_UShort)CUR.stack[CUR.args]; + + if ( BOUNDS( point, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + } + else + /* XXX: UNDOCUMENTED! SHP touches the points */ + MOVE_Zp2_Point( point, dx, dy, TRUE ); + + CUR.GS.loop--; + } + + CUR.GS.loop = 1; + CUR.new_top = CUR.args; + } + + + /*************************************************************************/ + /* */ + /* SHC[a]: SHift Contour */ + /* Opcode range: 0x34-35 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SHC( INS_ARG ) + { + TT_GlyphZoneRec zp; + FT_UShort refp; + FT_F26Dot6 dx, + dy; + + FT_Short contour; + FT_UShort first_point, last_point, i; + + + contour = (FT_UShort)args[0]; + + if ( BOUNDS( contour, CUR.pts.n_contours ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) ) + return; + + if ( contour == 0 ) + first_point = 0; + else + first_point = (FT_UShort)( CUR.pts.contours[contour - 1] + 1 - + CUR.pts.first_point ); + + last_point = (FT_UShort)( CUR.pts.contours[contour] - + CUR.pts.first_point ); + + /* XXX: this is probably wrong... at least it prevents memory */ + /* corruption when zp2 is the twilight zone */ + if ( last_point > CUR.zp2.n_points ) + { + if ( CUR.zp2.n_points > 0 ) + last_point = (FT_UShort)(CUR.zp2.n_points - 1); + else + last_point = 0; + } + + /* XXX: UNDOCUMENTED! SHC touches the points */ + for ( i = first_point; i <= last_point; i++ ) + { + if ( zp.cur != CUR.zp2.cur || refp != i ) + MOVE_Zp2_Point( i, dx, dy, TRUE ); + } + } + + + /*************************************************************************/ + /* */ + /* SHZ[a]: SHift Zone */ + /* Opcode range: 0x36-37 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_SHZ( INS_ARG ) + { + TT_GlyphZoneRec zp; + FT_UShort refp; + FT_F26Dot6 dx, + dy; + + FT_UShort last_point, i; + + + if ( BOUNDS( args[0], 2 ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) ) + return; + + /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points. */ + /* Twilight zone has no contours, so use `n_points'. */ + /* Normal zone's `n_points' includes phantoms, so must */ + /* use end of last contour. */ + if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 ) + last_point = (FT_UShort)( CUR.zp2.n_points - 1 ); + else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 ) + last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] ); + else + last_point = 0; + + /* XXX: UNDOCUMENTED! SHZ doesn't touch the points */ + for ( i = 0; i <= last_point; i++ ) + { + if ( zp.cur != CUR.zp2.cur || refp != i ) + MOVE_Zp2_Point( i, dx, dy, FALSE ); + } + } + + + /*************************************************************************/ + /* */ + /* SHPIX[]: SHift points by a PIXel amount */ + /* Opcode range: 0x38 */ + /* Stack: f26.6 uint32... --> */ + /* */ + static void + Ins_SHPIX( INS_ARG ) + { + FT_F26Dot6 dx, dy; + FT_UShort point; + + + if ( CUR.top < CUR.GS.loop + 1 ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + if ( CUR.face->unpatented_hinting ) + { + if ( CUR.GS.both_x_axis ) + { + dx = TT_MulFix14( args[0], 0x4000 ); + dy = 0; + } + else + { + dx = 0; + dy = TT_MulFix14( args[0], 0x4000 ); + } + } + else +#endif + { + dx = TT_MulFix14( args[0], CUR.GS.freeVector.x ); + dy = TT_MulFix14( args[0], CUR.GS.freeVector.y ); + } + + while ( CUR.GS.loop > 0 ) + { + CUR.args--; + + point = (FT_UShort)CUR.stack[CUR.args]; + + if ( BOUNDS( point, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + } + else + MOVE_Zp2_Point( point, dx, dy, TRUE ); + + CUR.GS.loop--; + } + + CUR.GS.loop = 1; + CUR.new_top = CUR.args; + } + + + /*************************************************************************/ + /* */ + /* MSIRP[a]: Move Stack Indirect Relative Position */ + /* Opcode range: 0x3A-0x3B */ + /* Stack: f26.6 uint32 --> */ + /* */ + static void + Ins_MSIRP( INS_ARG ) + { + FT_UShort point; + FT_F26Dot6 distance; + + + point = (FT_UShort)args[0]; + + if ( BOUNDS( point, CUR.zp1.n_points ) || + BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + /* XXX: UNDOCUMENTED! behaviour */ + if ( CUR.GS.gep1 == 0 ) /* if the point that is to be moved */ + /* is in twilight zone */ + { + CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0]; + CUR_Func_move_orig( &CUR.zp1, point, args[1] ); + CUR.zp1.cur[point] = CUR.zp1.org[point]; + } + + distance = CUR_Func_project( CUR.zp1.cur + point, + CUR.zp0.cur + CUR.GS.rp0 ); + + CUR_Func_move( &CUR.zp1, point, args[1] - distance ); + + CUR.GS.rp1 = CUR.GS.rp0; + CUR.GS.rp2 = point; + + if ( ( CUR.opcode & 1 ) != 0 ) + CUR.GS.rp0 = point; + } + + + /*************************************************************************/ + /* */ + /* MDAP[a]: Move Direct Absolute Point */ + /* Opcode range: 0x2E-0x2F */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_MDAP( INS_ARG ) + { + FT_UShort point; + FT_F26Dot6 cur_dist, + distance; + + + point = (FT_UShort)args[0]; + + if ( BOUNDS( point, CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + /* XXX: Is there some undocumented feature while in the */ + /* twilight zone? ? */ + if ( ( CUR.opcode & 1 ) != 0 ) + { + cur_dist = CUR_fast_project( &CUR.zp0.cur[point] ); + distance = CUR_Func_round( cur_dist, + CUR.tt_metrics.compensations[0] ) - cur_dist; + } + else + distance = 0; + + CUR_Func_move( &CUR.zp0, point, distance ); + + CUR.GS.rp0 = point; + CUR.GS.rp1 = point; + } + + + /*************************************************************************/ + /* */ + /* MIAP[a]: Move Indirect Absolute Point */ + /* Opcode range: 0x3E-0x3F */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_MIAP( INS_ARG ) + { + FT_ULong cvtEntry; + FT_UShort point; + FT_F26Dot6 distance, + org_dist; + + + cvtEntry = (FT_ULong)args[1]; + point = (FT_UShort)args[0]; + + if ( BOUNDS( point, CUR.zp0.n_points ) || + BOUNDS( cvtEntry, CUR.cvtSize ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + /* XXX: UNDOCUMENTED! */ + /* */ + /* The behaviour of an MIAP instruction is quite */ + /* different when used in the twilight zone. */ + /* */ + /* First, no control value cut-in test is performed */ + /* as it would fail anyway. Second, the original */ + /* point, i.e. (org_x,org_y) of zp0.point, is set */ + /* to the absolute, unrounded distance found in */ + /* the CVT. */ + /* */ + /* This is used in the CVT programs of the Microsoft */ + /* fonts Arial, Times, etc., in order to re-adjust */ + /* some key font heights. It allows the use of the */ + /* IP instruction in the twilight zone, which */ + /* otherwise would be `illegal' according to the */ + /* specification. */ + /* */ + /* We implement it with a special sequence for the */ + /* twilight zone. This is a bad hack, but it seems */ + /* to work. */ + + distance = CUR_Func_read_cvt( cvtEntry ); + + if ( CUR.GS.gep0 == 0 ) /* If in twilight zone */ + { + CUR.zp0.org[point].x = TT_MulFix14( distance, CUR.GS.freeVector.x ); + CUR.zp0.org[point].y = TT_MulFix14( distance, CUR.GS.freeVector.y ), + CUR.zp0.cur[point] = CUR.zp0.org[point]; + } + + org_dist = CUR_fast_project( &CUR.zp0.cur[point] ); + + if ( ( CUR.opcode & 1 ) != 0 ) /* rounding and control cutin flag */ + { + if ( FT_ABS( distance - org_dist ) > CUR.GS.control_value_cutin ) + distance = org_dist; + + distance = CUR_Func_round( distance, CUR.tt_metrics.compensations[0] ); + } + + CUR_Func_move( &CUR.zp0, point, distance - org_dist ); + + CUR.GS.rp0 = point; + CUR.GS.rp1 = point; + } + + + /*************************************************************************/ + /* */ + /* MDRP[abcde]: Move Direct Relative Point */ + /* Opcode range: 0xC0-0xDF */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_MDRP( INS_ARG ) + { + FT_UShort point; + FT_F26Dot6 org_dist, distance; + + + point = (FT_UShort)args[0]; + + if ( BOUNDS( point, CUR.zp1.n_points ) || + BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + /* XXX: Is there some undocumented feature while in the */ + /* twilight zone? */ + + /* XXX: UNDOCUMENTED: twilight zone special case */ + + if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 ) + { + FT_Vector* vec1 = &CUR.zp1.org[point]; + FT_Vector* vec2 = &CUR.zp0.org[CUR.GS.rp0]; + + + org_dist = CUR_Func_dualproj( vec1, vec2 ); + } + else + { + FT_Vector* vec1 = &CUR.zp1.orus[point]; + FT_Vector* vec2 = &CUR.zp0.orus[CUR.GS.rp0]; + + + if ( CUR.metrics.x_scale == CUR.metrics.y_scale ) + { + /* this should be faster */ + org_dist = CUR_Func_dualproj( vec1, vec2 ); + org_dist = TT_MULFIX( org_dist, CUR.metrics.x_scale ); + } + else + { + FT_Vector vec; + + + vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale ); + vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale ); + + org_dist = CUR_fast_dualproj( &vec ); + } + } + + /* single width cut-in test */ + + if ( FT_ABS( org_dist - CUR.GS.single_width_value ) < + CUR.GS.single_width_cutin ) + { + if ( org_dist >= 0 ) + org_dist = CUR.GS.single_width_value; + else + org_dist = -CUR.GS.single_width_value; + } + + /* round flag */ + + if ( ( CUR.opcode & 4 ) != 0 ) + distance = CUR_Func_round( + org_dist, + CUR.tt_metrics.compensations[CUR.opcode & 3] ); + else + distance = ROUND_None( + org_dist, + CUR.tt_metrics.compensations[CUR.opcode & 3] ); + + /* minimum distance flag */ + + if ( ( CUR.opcode & 8 ) != 0 ) + { + if ( org_dist >= 0 ) + { + if ( distance < CUR.GS.minimum_distance ) + distance = CUR.GS.minimum_distance; + } + else + { + if ( distance > -CUR.GS.minimum_distance ) + distance = -CUR.GS.minimum_distance; + } + } + + /* now move the point */ + + org_dist = CUR_Func_project( CUR.zp1.cur + point, + CUR.zp0.cur + CUR.GS.rp0 ); + + CUR_Func_move( &CUR.zp1, point, distance - org_dist ); + + CUR.GS.rp1 = CUR.GS.rp0; + CUR.GS.rp2 = point; + + if ( ( CUR.opcode & 16 ) != 0 ) + CUR.GS.rp0 = point; + } + + + /*************************************************************************/ + /* */ + /* MIRP[abcde]: Move Indirect Relative Point */ + /* Opcode range: 0xE0-0xFF */ + /* Stack: int32? uint32 --> */ + /* */ + static void + Ins_MIRP( INS_ARG ) + { + FT_UShort point; + FT_ULong cvtEntry; + + FT_F26Dot6 cvt_dist, + distance, + cur_dist, + org_dist; + + + point = (FT_UShort)args[0]; + cvtEntry = (FT_ULong)( args[1] + 1 ); + + /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ + + if ( BOUNDS( point, CUR.zp1.n_points ) || + BOUNDS( cvtEntry, CUR.cvtSize + 1 ) || + BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + if ( !cvtEntry ) + cvt_dist = 0; + else + cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 ); + + /* single width test */ + + if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) < + CUR.GS.single_width_cutin ) + { + if ( cvt_dist >= 0 ) + cvt_dist = CUR.GS.single_width_value; + else + cvt_dist = -CUR.GS.single_width_value; + } + + /* XXX: UNDOCUMENTED! -- twilight zone */ + + if ( CUR.GS.gep1 == 0 ) + { + CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x + + TT_MulFix14( cvt_dist, CUR.GS.freeVector.x ); + + CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y + + TT_MulFix14( cvt_dist, CUR.GS.freeVector.y ); + + CUR.zp1.cur[point] = CUR.zp0.cur[point]; + } + + org_dist = CUR_Func_dualproj( &CUR.zp1.org[point], + &CUR.zp0.org[CUR.GS.rp0] ); + cur_dist = CUR_Func_project ( &CUR.zp1.cur[point], + &CUR.zp0.cur[CUR.GS.rp0] ); + + /* auto-flip test */ + + if ( CUR.GS.auto_flip ) + { + if ( ( org_dist ^ cvt_dist ) < 0 ) + cvt_dist = -cvt_dist; + } + + /* control value cutin and round */ + + if ( ( CUR.opcode & 4 ) != 0 ) + { + /* XXX: UNDOCUMENTED! Only perform cut-in test when both points */ + /* refer to the same zone. */ + + if ( CUR.GS.gep0 == CUR.GS.gep1 ) + if ( FT_ABS( cvt_dist - org_dist ) >= CUR.GS.control_value_cutin ) + cvt_dist = org_dist; + + distance = CUR_Func_round( + cvt_dist, + CUR.tt_metrics.compensations[CUR.opcode & 3] ); + } + else + distance = ROUND_None( + cvt_dist, + CUR.tt_metrics.compensations[CUR.opcode & 3] ); + + /* minimum distance test */ + + if ( ( CUR.opcode & 8 ) != 0 ) + { + if ( org_dist >= 0 ) + { + if ( distance < CUR.GS.minimum_distance ) + distance = CUR.GS.minimum_distance; + } + else + { + if ( distance > -CUR.GS.minimum_distance ) + distance = -CUR.GS.minimum_distance; + } + } + + CUR_Func_move( &CUR.zp1, point, distance - cur_dist ); + + CUR.GS.rp1 = CUR.GS.rp0; + + if ( ( CUR.opcode & 16 ) != 0 ) + CUR.GS.rp0 = point; + + /* XXX: UNDOCUMENTED! */ + CUR.GS.rp2 = point; + } + + + /*************************************************************************/ + /* */ + /* ALIGNRP[]: ALIGN Relative Point */ + /* Opcode range: 0x3C */ + /* Stack: uint32 uint32... --> */ + /* */ + static void + Ins_ALIGNRP( INS_ARG ) + { + FT_UShort point; + FT_F26Dot6 distance; + + FT_UNUSED_ARG; + + + if ( CUR.top < CUR.GS.loop || + BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + while ( CUR.GS.loop > 0 ) + { + CUR.args--; + + point = (FT_UShort)CUR.stack[CUR.args]; + + if ( BOUNDS( point, CUR.zp1.n_points ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + } + else + { + distance = CUR_Func_project( CUR.zp1.cur + point, + CUR.zp0.cur + CUR.GS.rp0 ); + + CUR_Func_move( &CUR.zp1, point, -distance ); + } + + CUR.GS.loop--; + } + + CUR.GS.loop = 1; + CUR.new_top = CUR.args; + } + + + /*************************************************************************/ + /* */ + /* ISECT[]: moves point to InterSECTion */ + /* Opcode range: 0x0F */ + /* Stack: 5 * uint32 --> */ + /* */ + static void + Ins_ISECT( INS_ARG ) + { + FT_UShort point, + a0, a1, + b0, b1; + + FT_F26Dot6 discriminant; + + FT_F26Dot6 dx, dy, + dax, day, + dbx, dby; + + FT_F26Dot6 val; + + FT_Vector R; + + + point = (FT_UShort)args[0]; + + a0 = (FT_UShort)args[1]; + a1 = (FT_UShort)args[2]; + b0 = (FT_UShort)args[3]; + b1 = (FT_UShort)args[4]; + + if ( BOUNDS( b0, CUR.zp0.n_points ) || + BOUNDS( b1, CUR.zp0.n_points ) || + BOUNDS( a0, CUR.zp1.n_points ) || + BOUNDS( a1, CUR.zp1.n_points ) || + BOUNDS( point, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x; + dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y; + + dax = CUR.zp1.cur[a1].x - CUR.zp1.cur[a0].x; + day = CUR.zp1.cur[a1].y - CUR.zp1.cur[a0].y; + + dx = CUR.zp0.cur[b0].x - CUR.zp1.cur[a0].x; + dy = CUR.zp0.cur[b0].y - CUR.zp1.cur[a0].y; + + CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH; + + discriminant = TT_MULDIV( dax, -dby, 0x40 ) + + TT_MULDIV( day, dbx, 0x40 ); + + if ( FT_ABS( discriminant ) >= 0x40 ) + { + val = TT_MULDIV( dx, -dby, 0x40 ) + TT_MULDIV( dy, dbx, 0x40 ); + + R.x = TT_MULDIV( val, dax, discriminant ); + R.y = TT_MULDIV( val, day, discriminant ); + + CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x; + CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y; + } + else + { + /* else, take the middle of the middles of A and B */ + + CUR.zp2.cur[point].x = ( CUR.zp1.cur[a0].x + + CUR.zp1.cur[a1].x + + CUR.zp0.cur[b0].x + + CUR.zp0.cur[b1].x ) / 4; + CUR.zp2.cur[point].y = ( CUR.zp1.cur[a0].y + + CUR.zp1.cur[a1].y + + CUR.zp0.cur[b0].y + + CUR.zp0.cur[b1].y ) / 4; + } + } + + + /*************************************************************************/ + /* */ + /* ALIGNPTS[]: ALIGN PoinTS */ + /* Opcode range: 0x27 */ + /* Stack: uint32 uint32 --> */ + /* */ + static void + Ins_ALIGNPTS( INS_ARG ) + { + FT_UShort p1, p2; + FT_F26Dot6 distance; + + + p1 = (FT_UShort)args[0]; + p2 = (FT_UShort)args[1]; + + if ( BOUNDS( args[0], CUR.zp1.n_points ) || + BOUNDS( args[1], CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + distance = CUR_Func_project( CUR.zp0.cur + p2, + CUR.zp1.cur + p1 ) / 2; + + CUR_Func_move( &CUR.zp1, p1, distance ); + CUR_Func_move( &CUR.zp0, p2, -distance ); + } + + + /*************************************************************************/ + /* */ + /* IP[]: Interpolate Point */ + /* Opcode range: 0x39 */ + /* Stack: uint32... --> */ + /* */ + + /* SOMETIMES, DUMBER CODE IS BETTER CODE */ + + static void + Ins_IP( INS_ARG ) + { + FT_F26Dot6 old_range, cur_range; + FT_Vector* orus_base; + FT_Vector* cur_base; + FT_Int twilight; + + FT_UNUSED_ARG; + + + if ( CUR.top < CUR.GS.loop ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + + /* + * We need to deal in a special way with the twilight zone. + * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0), + * for every n. + */ + twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0; + + if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + if ( twilight ) + orus_base = &CUR.zp0.org[CUR.GS.rp1]; + else + orus_base = &CUR.zp0.orus[CUR.GS.rp1]; + + cur_base = &CUR.zp0.cur[CUR.GS.rp1]; + + /* XXX: There are some glyphs in some braindead but popular */ + /* fonts out there (e.g. [aeu]grave in monotype.ttf) */ + /* calling IP[] with bad values of rp[12]. */ + /* Do something sane when this odd thing happens. */ + if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) || + BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) ) + { + old_range = 0; + cur_range = 0; + } + else + { + if ( twilight ) + old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2], + orus_base ); + else + old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2], + orus_base ); + + cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base ); + } + + for ( ; CUR.GS.loop > 0; --CUR.GS.loop ) + { + FT_UInt point = (FT_UInt)CUR.stack[--CUR.args]; + FT_F26Dot6 org_dist, cur_dist, new_dist; + + + /* check point bounds */ + if ( BOUNDS( point, CUR.zp2.n_points ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + continue; + } + + if ( twilight ) + org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base ); + else + org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base ); + + cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base ); + new_dist = ( old_range != 0 ) + ? TT_MULDIV( org_dist, cur_range, old_range ) + : cur_dist; + + CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist ); + } + CUR.GS.loop = 1; + CUR.new_top = CUR.args; + } + + + /*************************************************************************/ + /* */ + /* UTP[a]: UnTouch Point */ + /* Opcode range: 0x29 */ + /* Stack: uint32 --> */ + /* */ + static void + Ins_UTP( INS_ARG ) + { + FT_UShort point; + FT_Byte mask; + + + point = (FT_UShort)args[0]; + + if ( BOUNDS( point, CUR.zp0.n_points ) ) + { + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + return; + } + + mask = 0xFF; + + if ( CUR.GS.freeVector.x != 0 ) + mask &= ~FT_CURVE_TAG_TOUCH_X; + + if ( CUR.GS.freeVector.y != 0 ) + mask &= ~FT_CURVE_TAG_TOUCH_Y; + + CUR.zp0.tags[point] &= mask; + } + + + /* Local variables for Ins_IUP: */ + typedef struct + { + FT_Vector* orgs; /* original and current coordinate */ + FT_Vector* curs; /* arrays */ + FT_Vector* orus; + FT_UInt max_points; + + } IUP_WorkerRec, *IUP_Worker; + + + static void + _iup_worker_shift( IUP_Worker worker, + FT_UInt p1, + FT_UInt p2, + FT_UInt p ) + { + FT_UInt i; + FT_F26Dot6 dx; + + + dx = worker->curs[p].x - worker->orgs[p].x; + if ( dx != 0 ) + { + for ( i = p1; i < p; i++ ) + worker->curs[i].x += dx; + + for ( i = p + 1; i <= p2; i++ ) + worker->curs[i].x += dx; + } + } + + + static void + _iup_worker_interpolate( IUP_Worker worker, + FT_UInt p1, + FT_UInt p2, + FT_UInt ref1, + FT_UInt ref2 ) + { + FT_UInt i; + FT_F26Dot6 orus1, orus2, org1, org2, delta1, delta2; + + + if ( p1 > p2 ) + return; + + if ( BOUNDS( ref1, worker->max_points ) || + BOUNDS( ref2, worker->max_points ) ) + return; + + orus1 = worker->orus[ref1].x; + orus2 = worker->orus[ref2].x; + + if ( orus1 > orus2 ) + { + FT_F26Dot6 tmp_o; + FT_UInt tmp_r; + + + tmp_o = orus1; + orus1 = orus2; + orus2 = tmp_o; + + tmp_r = ref1; + ref1 = ref2; + ref2 = tmp_r; + } + + org1 = worker->orgs[ref1].x; + org2 = worker->orgs[ref2].x; + delta1 = worker->curs[ref1].x - org1; + delta2 = worker->curs[ref2].x - org2; + + if ( orus1 == orus2 ) + { + /* simple shift of untouched points */ + for ( i = p1; i <= p2; i++ ) + { + FT_F26Dot6 x = worker->orgs[i].x; + + + if ( x <= org1 ) + x += delta1; + else + x += delta2; + + worker->curs[i].x = x; + } + } + else + { + FT_Fixed scale = 0; + FT_Bool scale_valid = 0; + + + /* interpolation */ + for ( i = p1; i <= p2; i++ ) + { + FT_F26Dot6 x = worker->orgs[i].x; + + + if ( x <= org1 ) + x += delta1; + + else if ( x >= org2 ) + x += delta2; + + else + { + if ( !scale_valid ) + { + scale_valid = 1; + scale = TT_MULDIV( org2 + delta2 - ( org1 + delta1 ), + 0x10000, orus2 - orus1 ); + } + + x = ( org1 + delta1 ) + + TT_MULFIX( worker->orus[i].x - orus1, scale ); + } + worker->curs[i].x = x; + } + } + } + + + /*************************************************************************/ + /* */ + /* IUP[a]: Interpolate Untouched Points */ + /* Opcode range: 0x30-0x31 */ + /* Stack: --> */ + /* */ + static void + Ins_IUP( INS_ARG ) + { + IUP_WorkerRec V; + FT_Byte mask; + + FT_UInt first_point; /* first point of contour */ + FT_UInt end_point; /* end point (last+1) of contour */ + + FT_UInt first_touched; /* first touched point in contour */ + FT_UInt cur_touched; /* current touched point in contour */ + + FT_UInt point; /* current point */ + FT_Short contour; /* current contour */ + + FT_UNUSED_ARG; + + + /* ignore empty outlines */ + if ( CUR.pts.n_contours == 0 ) + return; + + if ( CUR.opcode & 1 ) + { + mask = FT_CURVE_TAG_TOUCH_X; + V.orgs = CUR.pts.org; + V.curs = CUR.pts.cur; + V.orus = CUR.pts.orus; + } + else + { + mask = FT_CURVE_TAG_TOUCH_Y; + V.orgs = (FT_Vector*)( (FT_Pos*)CUR.pts.org + 1 ); + V.curs = (FT_Vector*)( (FT_Pos*)CUR.pts.cur + 1 ); + V.orus = (FT_Vector*)( (FT_Pos*)CUR.pts.orus + 1 ); + } + V.max_points = CUR.pts.n_points; + + contour = 0; + point = 0; + + do + { + end_point = CUR.pts.contours[contour] - CUR.pts.first_point; + first_point = point; + + while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 ) + point++; + + if ( point <= end_point ) + { + first_touched = point; + cur_touched = point; + + point++; + + while ( point <= end_point ) + { + if ( ( CUR.pts.tags[point] & mask ) != 0 ) + { + if ( point > 0 ) + _iup_worker_interpolate( &V, + cur_touched + 1, + point - 1, + cur_touched, + point ); + cur_touched = point; + } + + point++; + } + + if ( cur_touched == first_touched ) + _iup_worker_shift( &V, first_point, end_point, cur_touched ); + else + { + _iup_worker_interpolate( &V, + (FT_UShort)( cur_touched + 1 ), + end_point, + cur_touched, + first_touched ); + + if ( first_touched > 0 ) + _iup_worker_interpolate( &V, + first_point, + first_touched - 1, + cur_touched, + first_touched ); + } + } + contour++; + } while ( contour < CUR.pts.n_contours ); + } + + + /*************************************************************************/ + /* */ + /* DELTAPn[]: DELTA exceptions P1, P2, P3 */ + /* Opcode range: 0x5D,0x71,0x72 */ + /* Stack: uint32 (2 * uint32)... --> */ + /* */ + static void + Ins_DELTAP( INS_ARG ) + { + FT_ULong k, nump; + FT_UShort A; + FT_ULong C; + FT_Long B; + + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + /* Delta hinting is covered by US Patent 5159668. */ + if ( CUR.face->unpatented_hinting ) + { + FT_Long n = args[0] * 2; + + + if ( CUR.args < n ) + { + CUR.error = TT_Err_Too_Few_Arguments; + return; + } + + CUR.args -= n; + CUR.new_top = CUR.args; + return; + } +#endif + + nump = (FT_ULong)args[0]; /* some points theoretically may occur more + than once, thus UShort isn't enough */ + + for ( k = 1; k <= nump; k++ ) + { + if ( CUR.args < 2 ) + { + CUR.error = TT_Err_Too_Few_Arguments; + return; + } + + CUR.args -= 2; + + A = (FT_UShort)CUR.stack[CUR.args + 1]; + B = CUR.stack[CUR.args]; + + /* XXX: Because some popular fonts contain some invalid DeltaP */ + /* instructions, we simply ignore them when the stacked */ + /* point reference is off limit, rather than returning an */ + /* error. As a delta instruction doesn't change a glyph */ + /* in great ways, this shouldn't be a problem. */ + + if ( !BOUNDS( A, CUR.zp0.n_points ) ) + { + C = ( (FT_ULong)B & 0xF0 ) >> 4; + + switch ( CUR.opcode ) + { + case 0x5D: + break; + + case 0x71: + C += 16; + break; + + case 0x72: + C += 32; + break; + } + + C += CUR.GS.delta_base; + + if ( CURRENT_Ppem() == (FT_Long)C ) + { + B = ( (FT_ULong)B & 0xF ) - 8; + if ( B >= 0 ) + B++; + B = B * 64 / ( 1L << CUR.GS.delta_shift ); + + CUR_Func_move( &CUR.zp0, A, B ); + } + } + else + if ( CUR.pedantic_hinting ) + CUR.error = TT_Err_Invalid_Reference; + } + + CUR.new_top = CUR.args; + } + + + /*************************************************************************/ + /* */ + /* DELTACn[]: DELTA exceptions C1, C2, C3 */ + /* Opcode range: 0x73,0x74,0x75 */ + /* Stack: uint32 (2 * uint32)... --> */ + /* */ + static void + Ins_DELTAC( INS_ARG ) + { + FT_ULong nump, k; + FT_ULong A, C; + FT_Long B; + + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + /* Delta hinting is covered by US Patent 5159668. */ + if ( CUR.face->unpatented_hinting ) + { + FT_Long n = args[0] * 2; + + + if ( CUR.args < n ) + { + CUR.error = TT_Err_Too_Few_Arguments; + return; + } + + CUR.args -= n; + CUR.new_top = CUR.args; + return; + } +#endif + + nump = (FT_ULong)args[0]; + + for ( k = 1; k <= nump; k++ ) + { + if ( CUR.args < 2 ) + { + CUR.error = TT_Err_Too_Few_Arguments; + return; + } + + CUR.args -= 2; + + A = (FT_ULong)CUR.stack[CUR.args + 1]; + B = CUR.stack[CUR.args]; + + if ( BOUNDS( A, CUR.cvtSize ) ) + { + if ( CUR.pedantic_hinting ) + { + CUR.error = TT_Err_Invalid_Reference; + return; + } + } + else + { + C = ( (FT_ULong)B & 0xF0 ) >> 4; + + switch ( CUR.opcode ) + { + case 0x73: + break; + + case 0x74: + C += 16; + break; + + case 0x75: + C += 32; + break; + } + + C += CUR.GS.delta_base; + + if ( CURRENT_Ppem() == (FT_Long)C ) + { + B = ( (FT_ULong)B & 0xF ) - 8; + if ( B >= 0 ) + B++; + B = B * 64 / ( 1L << CUR.GS.delta_shift ); + + CUR_Func_move_cvt( A, B ); + } + } + } + + CUR.new_top = CUR.args; + } + + + /*************************************************************************/ + /* */ + /* MISC. INSTRUCTIONS */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* GETINFO[]: GET INFOrmation */ + /* Opcode range: 0x88 */ + /* Stack: uint32 --> uint32 */ + /* */ + static void + Ins_GETINFO( INS_ARG ) + { + FT_Long K; + + + K = 0; + + /* We return MS rasterizer version 1.7 for the font scaler. */ + if ( ( args[0] & 1 ) != 0 ) + K = 35; + + /* Has the glyph been rotated? */ + if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated ) + K |= 0x80; + + /* Has the glyph been stretched? */ + if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched ) + K |= 1 << 8; + + /* Are we hinting for grayscale? */ + if ( ( args[0] & 32 ) != 0 && CUR.grayscale ) + K |= 1 << 12; + + args[0] = K; + } + + + static void + Ins_UNKNOWN( INS_ARG ) + { + TT_DefRecord* def = CUR.IDefs; + TT_DefRecord* limit = def + CUR.numIDefs; + + FT_UNUSED_ARG; + + + for ( ; def < limit; def++ ) + { + if ( (FT_Byte)def->opc == CUR.opcode && def->active ) + { + TT_CallRec* call; + + + if ( CUR.callTop >= CUR.callSize ) + { + CUR.error = TT_Err_Stack_Overflow; + return; + } + + call = CUR.callStack + CUR.callTop++; + + call->Caller_Range = CUR.curRange; + call->Caller_IP = CUR.IP+1; + call->Cur_Count = 1; + call->Cur_Restart = def->start; + + INS_Goto_CodeRange( def->range, def->start ); + + CUR.step_ins = FALSE; + return; + } + } + + CUR.error = TT_Err_Invalid_Opcode; + } + + +#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH + + + static + TInstruction_Function Instruct_Dispatch[256] = + { + /* Opcodes are gathered in groups of 16. */ + /* Please keep the spaces as they are. */ + + /* SVTCA y */ Ins_SVTCA, + /* SVTCA x */ Ins_SVTCA, + /* SPvTCA y */ Ins_SPVTCA, + /* SPvTCA x */ Ins_SPVTCA, + /* SFvTCA y */ Ins_SFVTCA, + /* SFvTCA x */ Ins_SFVTCA, + /* SPvTL // */ Ins_SPVTL, + /* SPvTL + */ Ins_SPVTL, + /* SFvTL // */ Ins_SFVTL, + /* SFvTL + */ Ins_SFVTL, + /* SPvFS */ Ins_SPVFS, + /* SFvFS */ Ins_SFVFS, + /* GPV */ Ins_GPV, + /* GFV */ Ins_GFV, + /* SFvTPv */ Ins_SFVTPV, + /* ISECT */ Ins_ISECT, + + /* SRP0 */ Ins_SRP0, + /* SRP1 */ Ins_SRP1, + /* SRP2 */ Ins_SRP2, + /* SZP0 */ Ins_SZP0, + /* SZP1 */ Ins_SZP1, + /* SZP2 */ Ins_SZP2, + /* SZPS */ Ins_SZPS, + /* SLOOP */ Ins_SLOOP, + /* RTG */ Ins_RTG, + /* RTHG */ Ins_RTHG, + /* SMD */ Ins_SMD, + /* ELSE */ Ins_ELSE, + /* JMPR */ Ins_JMPR, + /* SCvTCi */ Ins_SCVTCI, + /* SSwCi */ Ins_SSWCI, + /* SSW */ Ins_SSW, + + /* DUP */ Ins_DUP, + /* POP */ Ins_POP, + /* CLEAR */ Ins_CLEAR, + /* SWAP */ Ins_SWAP, + /* DEPTH */ Ins_DEPTH, + /* CINDEX */ Ins_CINDEX, + /* MINDEX */ Ins_MINDEX, + /* AlignPTS */ Ins_ALIGNPTS, + /* INS_0x28 */ Ins_UNKNOWN, + /* UTP */ Ins_UTP, + /* LOOPCALL */ Ins_LOOPCALL, + /* CALL */ Ins_CALL, + /* FDEF */ Ins_FDEF, + /* ENDF */ Ins_ENDF, + /* MDAP[0] */ Ins_MDAP, + /* MDAP[1] */ Ins_MDAP, + + /* IUP[0] */ Ins_IUP, + /* IUP[1] */ Ins_IUP, + /* SHP[0] */ Ins_SHP, + /* SHP[1] */ Ins_SHP, + /* SHC[0] */ Ins_SHC, + /* SHC[1] */ Ins_SHC, + /* SHZ[0] */ Ins_SHZ, + /* SHZ[1] */ Ins_SHZ, + /* SHPIX */ Ins_SHPIX, + /* IP */ Ins_IP, + /* MSIRP[0] */ Ins_MSIRP, + /* MSIRP[1] */ Ins_MSIRP, + /* AlignRP */ Ins_ALIGNRP, + /* RTDG */ Ins_RTDG, + /* MIAP[0] */ Ins_MIAP, + /* MIAP[1] */ Ins_MIAP, + + /* NPushB */ Ins_NPUSHB, + /* NPushW */ Ins_NPUSHW, + /* WS */ Ins_WS, + /* RS */ Ins_RS, + /* WCvtP */ Ins_WCVTP, + /* RCvt */ Ins_RCVT, + /* GC[0] */ Ins_GC, + /* GC[1] */ Ins_GC, + /* SCFS */ Ins_SCFS, + /* MD[0] */ Ins_MD, + /* MD[1] */ Ins_MD, + /* MPPEM */ Ins_MPPEM, + /* MPS */ Ins_MPS, + /* FlipON */ Ins_FLIPON, + /* FlipOFF */ Ins_FLIPOFF, + /* DEBUG */ Ins_DEBUG, + + /* LT */ Ins_LT, + /* LTEQ */ Ins_LTEQ, + /* GT */ Ins_GT, + /* GTEQ */ Ins_GTEQ, + /* EQ */ Ins_EQ, + /* NEQ */ Ins_NEQ, + /* ODD */ Ins_ODD, + /* EVEN */ Ins_EVEN, + /* IF */ Ins_IF, + /* EIF */ Ins_EIF, + /* AND */ Ins_AND, + /* OR */ Ins_OR, + /* NOT */ Ins_NOT, + /* DeltaP1 */ Ins_DELTAP, + /* SDB */ Ins_SDB, + /* SDS */ Ins_SDS, + + /* ADD */ Ins_ADD, + /* SUB */ Ins_SUB, + /* DIV */ Ins_DIV, + /* MUL */ Ins_MUL, + /* ABS */ Ins_ABS, + /* NEG */ Ins_NEG, + /* FLOOR */ Ins_FLOOR, + /* CEILING */ Ins_CEILING, + /* ROUND[0] */ Ins_ROUND, + /* ROUND[1] */ Ins_ROUND, + /* ROUND[2] */ Ins_ROUND, + /* ROUND[3] */ Ins_ROUND, + /* NROUND[0] */ Ins_NROUND, + /* NROUND[1] */ Ins_NROUND, + /* NROUND[2] */ Ins_NROUND, + /* NROUND[3] */ Ins_NROUND, + + /* WCvtF */ Ins_WCVTF, + /* DeltaP2 */ Ins_DELTAP, + /* DeltaP3 */ Ins_DELTAP, + /* DeltaCn[0] */ Ins_DELTAC, + /* DeltaCn[1] */ Ins_DELTAC, + /* DeltaCn[2] */ Ins_DELTAC, + /* SROUND */ Ins_SROUND, + /* S45Round */ Ins_S45ROUND, + /* JROT */ Ins_JROT, + /* JROF */ Ins_JROF, + /* ROFF */ Ins_ROFF, + /* INS_0x7B */ Ins_UNKNOWN, + /* RUTG */ Ins_RUTG, + /* RDTG */ Ins_RDTG, + /* SANGW */ Ins_SANGW, + /* AA */ Ins_AA, + + /* FlipPT */ Ins_FLIPPT, + /* FlipRgON */ Ins_FLIPRGON, + /* FlipRgOFF */ Ins_FLIPRGOFF, + /* INS_0x83 */ Ins_UNKNOWN, + /* INS_0x84 */ Ins_UNKNOWN, + /* ScanCTRL */ Ins_SCANCTRL, + /* SDPVTL[0] */ Ins_SDPVTL, + /* SDPVTL[1] */ Ins_SDPVTL, + /* GetINFO */ Ins_GETINFO, + /* IDEF */ Ins_IDEF, + /* ROLL */ Ins_ROLL, + /* MAX */ Ins_MAX, + /* MIN */ Ins_MIN, + /* ScanTYPE */ Ins_SCANTYPE, + /* InstCTRL */ Ins_INSTCTRL, + /* INS_0x8F */ Ins_UNKNOWN, + + /* INS_0x90 */ Ins_UNKNOWN, + /* INS_0x91 */ Ins_UNKNOWN, + /* INS_0x92 */ Ins_UNKNOWN, + /* INS_0x93 */ Ins_UNKNOWN, + /* INS_0x94 */ Ins_UNKNOWN, + /* INS_0x95 */ Ins_UNKNOWN, + /* INS_0x96 */ Ins_UNKNOWN, + /* INS_0x97 */ Ins_UNKNOWN, + /* INS_0x98 */ Ins_UNKNOWN, + /* INS_0x99 */ Ins_UNKNOWN, + /* INS_0x9A */ Ins_UNKNOWN, + /* INS_0x9B */ Ins_UNKNOWN, + /* INS_0x9C */ Ins_UNKNOWN, + /* INS_0x9D */ Ins_UNKNOWN, + /* INS_0x9E */ Ins_UNKNOWN, + /* INS_0x9F */ Ins_UNKNOWN, + + /* INS_0xA0 */ Ins_UNKNOWN, + /* INS_0xA1 */ Ins_UNKNOWN, + /* INS_0xA2 */ Ins_UNKNOWN, + /* INS_0xA3 */ Ins_UNKNOWN, + /* INS_0xA4 */ Ins_UNKNOWN, + /* INS_0xA5 */ Ins_UNKNOWN, + /* INS_0xA6 */ Ins_UNKNOWN, + /* INS_0xA7 */ Ins_UNKNOWN, + /* INS_0xA8 */ Ins_UNKNOWN, + /* INS_0xA9 */ Ins_UNKNOWN, + /* INS_0xAA */ Ins_UNKNOWN, + /* INS_0xAB */ Ins_UNKNOWN, + /* INS_0xAC */ Ins_UNKNOWN, + /* INS_0xAD */ Ins_UNKNOWN, + /* INS_0xAE */ Ins_UNKNOWN, + /* INS_0xAF */ Ins_UNKNOWN, + + /* PushB[0] */ Ins_PUSHB, + /* PushB[1] */ Ins_PUSHB, + /* PushB[2] */ Ins_PUSHB, + /* PushB[3] */ Ins_PUSHB, + /* PushB[4] */ Ins_PUSHB, + /* PushB[5] */ Ins_PUSHB, + /* PushB[6] */ Ins_PUSHB, + /* PushB[7] */ Ins_PUSHB, + /* PushW[0] */ Ins_PUSHW, + /* PushW[1] */ Ins_PUSHW, + /* PushW[2] */ Ins_PUSHW, + /* PushW[3] */ Ins_PUSHW, + /* PushW[4] */ Ins_PUSHW, + /* PushW[5] */ Ins_PUSHW, + /* PushW[6] */ Ins_PUSHW, + /* PushW[7] */ Ins_PUSHW, + + /* MDRP[00] */ Ins_MDRP, + /* MDRP[01] */ Ins_MDRP, + /* MDRP[02] */ Ins_MDRP, + /* MDRP[03] */ Ins_MDRP, + /* MDRP[04] */ Ins_MDRP, + /* MDRP[05] */ Ins_MDRP, + /* MDRP[06] */ Ins_MDRP, + /* MDRP[07] */ Ins_MDRP, + /* MDRP[08] */ Ins_MDRP, + /* MDRP[09] */ Ins_MDRP, + /* MDRP[10] */ Ins_MDRP, + /* MDRP[11] */ Ins_MDRP, + /* MDRP[12] */ Ins_MDRP, + /* MDRP[13] */ Ins_MDRP, + /* MDRP[14] */ Ins_MDRP, + /* MDRP[15] */ Ins_MDRP, + + /* MDRP[16] */ Ins_MDRP, + /* MDRP[17] */ Ins_MDRP, + /* MDRP[18] */ Ins_MDRP, + /* MDRP[19] */ Ins_MDRP, + /* MDRP[20] */ Ins_MDRP, + /* MDRP[21] */ Ins_MDRP, + /* MDRP[22] */ Ins_MDRP, + /* MDRP[23] */ Ins_MDRP, + /* MDRP[24] */ Ins_MDRP, + /* MDRP[25] */ Ins_MDRP, + /* MDRP[26] */ Ins_MDRP, + /* MDRP[27] */ Ins_MDRP, + /* MDRP[28] */ Ins_MDRP, + /* MDRP[29] */ Ins_MDRP, + /* MDRP[30] */ Ins_MDRP, + /* MDRP[31] */ Ins_MDRP, + + /* MIRP[00] */ Ins_MIRP, + /* MIRP[01] */ Ins_MIRP, + /* MIRP[02] */ Ins_MIRP, + /* MIRP[03] */ Ins_MIRP, + /* MIRP[04] */ Ins_MIRP, + /* MIRP[05] */ Ins_MIRP, + /* MIRP[06] */ Ins_MIRP, + /* MIRP[07] */ Ins_MIRP, + /* MIRP[08] */ Ins_MIRP, + /* MIRP[09] */ Ins_MIRP, + /* MIRP[10] */ Ins_MIRP, + /* MIRP[11] */ Ins_MIRP, + /* MIRP[12] */ Ins_MIRP, + /* MIRP[13] */ Ins_MIRP, + /* MIRP[14] */ Ins_MIRP, + /* MIRP[15] */ Ins_MIRP, + + /* MIRP[16] */ Ins_MIRP, + /* MIRP[17] */ Ins_MIRP, + /* MIRP[18] */ Ins_MIRP, + /* MIRP[19] */ Ins_MIRP, + /* MIRP[20] */ Ins_MIRP, + /* MIRP[21] */ Ins_MIRP, + /* MIRP[22] */ Ins_MIRP, + /* MIRP[23] */ Ins_MIRP, + /* MIRP[24] */ Ins_MIRP, + /* MIRP[25] */ Ins_MIRP, + /* MIRP[26] */ Ins_MIRP, + /* MIRP[27] */ Ins_MIRP, + /* MIRP[28] */ Ins_MIRP, + /* MIRP[29] */ Ins_MIRP, + /* MIRP[30] */ Ins_MIRP, + /* MIRP[31] */ Ins_MIRP + }; + + +#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */ + + + /*************************************************************************/ + /* */ + /* RUN */ + /* */ + /* This function executes a run of opcodes. It will exit in the */ + /* following cases: */ + /* */ + /* - Errors (in which case it returns FALSE). */ + /* */ + /* - Reaching the end of the main code range (returns TRUE). */ + /* Reaching the end of a code range within a function call is an */ + /* error. */ + /* */ + /* - After executing one single opcode, if the flag `Instruction_Trap' */ + /* is set to TRUE (returns TRUE). */ + /* */ + /* On exit with TRUE, test IP < CodeSize to know whether it comes from */ + /* an instruction trap or a normal termination. */ + /* */ + /* */ + /* Note: The documented DEBUG opcode pops a value from the stack. This */ + /* behaviour is unsupported; here a DEBUG opcode is always an */ + /* error. */ + /* */ + /* */ + /* THIS IS THE INTERPRETER'S MAIN LOOP. */ + /* */ + /* Instructions appear in the specification's order. */ + /* */ + /*************************************************************************/ + + + /* documentation is in ttinterp.h */ + + FT_EXPORT_DEF( FT_Error ) + TT_RunIns( TT_ExecContext exc ) + { + FT_Long ins_counter = 0; /* executed instructions counter */ + + +#ifdef TT_CONFIG_OPTION_STATIC_RASTER + cur = *exc; +#endif + + /* set CVT functions */ + CUR.tt_metrics.ratio = 0; + if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem ) + { + /* non-square pixels, use the stretched routines */ + CUR.func_read_cvt = Read_CVT_Stretched; + CUR.func_write_cvt = Write_CVT_Stretched; + CUR.func_move_cvt = Move_CVT_Stretched; + } + else + { + /* square pixels, use normal routines */ + CUR.func_read_cvt = Read_CVT; + CUR.func_write_cvt = Write_CVT; + CUR.func_move_cvt = Move_CVT; + } + + COMPUTE_Funcs(); + COMPUTE_Round( (FT_Byte)exc->GS.round_state ); + + do + { + CUR.opcode = CUR.code[CUR.IP]; + + if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 ) + { + if ( CUR.IP + 1 > CUR.codeSize ) + goto LErrorCodeOverflow_; + + CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1]; + } + + if ( CUR.IP + CUR.length > CUR.codeSize ) + goto LErrorCodeOverflow_; + + /* First, let's check for empty stack and overflow */ + CUR.args = CUR.top - ( Pop_Push_Count[CUR.opcode] >> 4 ); + + /* `args' is the top of the stack once arguments have been popped. */ + /* One can also interpret it as the index of the last argument. */ + if ( CUR.args < 0 ) + { + CUR.error = TT_Err_Too_Few_Arguments; + goto LErrorLabel_; + } + + CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 ); + + /* `new_top' is the new top of the stack, after the instruction's */ + /* execution. `top' will be set to `new_top' after the `switch' */ + /* statement. */ + if ( CUR.new_top > CUR.stackSize ) + { + CUR.error = TT_Err_Stack_Overflow; + goto LErrorLabel_; + } + + CUR.step_ins = TRUE; + CUR.error = TT_Err_Ok; + +#ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH + + { + FT_Long* args = CUR.stack + CUR.args; + FT_Byte opcode = CUR.opcode; + + +#undef ARRAY_BOUND_ERROR +#define ARRAY_BOUND_ERROR goto Set_Invalid_Ref + + + switch ( opcode ) + { + case 0x00: /* SVTCA y */ + case 0x01: /* SVTCA x */ + case 0x02: /* SPvTCA y */ + case 0x03: /* SPvTCA x */ + case 0x04: /* SFvTCA y */ + case 0x05: /* SFvTCA x */ + { + FT_Short AA, BB; + + + AA = (FT_Short)( ( opcode & 1 ) << 14 ); + BB = (FT_Short)( AA ^ 0x4000 ); + + if ( opcode < 4 ) + { + CUR.GS.projVector.x = AA; + CUR.GS.projVector.y = BB; + + CUR.GS.dualVector.x = AA; + CUR.GS.dualVector.y = BB; + } + else + { + GUESS_VECTOR( projVector ); + } + + if ( ( opcode & 2 ) == 0 ) + { + CUR.GS.freeVector.x = AA; + CUR.GS.freeVector.y = BB; + } + else + { + GUESS_VECTOR( freeVector ); + } + + COMPUTE_Funcs(); + } + break; + + case 0x06: /* SPvTL // */ + case 0x07: /* SPvTL + */ + DO_SPVTL + break; + + case 0x08: /* SFvTL // */ + case 0x09: /* SFvTL + */ + DO_SFVTL + break; + + case 0x0A: /* SPvFS */ + DO_SPVFS + break; + + case 0x0B: /* SFvFS */ + DO_SFVFS + break; + + case 0x0C: /* GPV */ + DO_GPV + break; + + case 0x0D: /* GFV */ + DO_GFV + break; + + case 0x0E: /* SFvTPv */ + DO_SFVTPV + break; + + case 0x0F: /* ISECT */ + Ins_ISECT( EXEC_ARG_ args ); + break; + + case 0x10: /* SRP0 */ + DO_SRP0 + break; + + case 0x11: /* SRP1 */ + DO_SRP1 + break; + + case 0x12: /* SRP2 */ + DO_SRP2 + break; + + case 0x13: /* SZP0 */ + Ins_SZP0( EXEC_ARG_ args ); + break; + + case 0x14: /* SZP1 */ + Ins_SZP1( EXEC_ARG_ args ); + break; + + case 0x15: /* SZP2 */ + Ins_SZP2( EXEC_ARG_ args ); + break; + + case 0x16: /* SZPS */ + Ins_SZPS( EXEC_ARG_ args ); + break; + + case 0x17: /* SLOOP */ + DO_SLOOP + break; + + case 0x18: /* RTG */ + DO_RTG + break; + + case 0x19: /* RTHG */ + DO_RTHG + break; + + case 0x1A: /* SMD */ + DO_SMD + break; + + case 0x1B: /* ELSE */ + Ins_ELSE( EXEC_ARG_ args ); + break; + + case 0x1C: /* JMPR */ + DO_JMPR + break; + + case 0x1D: /* SCVTCI */ + DO_SCVTCI + break; + + case 0x1E: /* SSWCI */ + DO_SSWCI + break; + + case 0x1F: /* SSW */ + DO_SSW + break; + + case 0x20: /* DUP */ + DO_DUP + break; + + case 0x21: /* POP */ + /* nothing :-) */ + break; + + case 0x22: /* CLEAR */ + DO_CLEAR + break; + + case 0x23: /* SWAP */ + DO_SWAP + break; + + case 0x24: /* DEPTH */ + DO_DEPTH + break; + + case 0x25: /* CINDEX */ + DO_CINDEX + break; + + case 0x26: /* MINDEX */ + Ins_MINDEX( EXEC_ARG_ args ); + break; + + case 0x27: /* ALIGNPTS */ + Ins_ALIGNPTS( EXEC_ARG_ args ); + break; + + case 0x28: /* ???? */ + Ins_UNKNOWN( EXEC_ARG_ args ); + break; + + case 0x29: /* UTP */ + Ins_UTP( EXEC_ARG_ args ); + break; + + case 0x2A: /* LOOPCALL */ + Ins_LOOPCALL( EXEC_ARG_ args ); + break; + + case 0x2B: /* CALL */ + Ins_CALL( EXEC_ARG_ args ); + break; + + case 0x2C: /* FDEF */ + Ins_FDEF( EXEC_ARG_ args ); + break; + + case 0x2D: /* ENDF */ + Ins_ENDF( EXEC_ARG_ args ); + break; + + case 0x2E: /* MDAP */ + case 0x2F: /* MDAP */ + Ins_MDAP( EXEC_ARG_ args ); + break; + + + case 0x30: /* IUP */ + case 0x31: /* IUP */ + Ins_IUP( EXEC_ARG_ args ); + break; + + case 0x32: /* SHP */ + case 0x33: /* SHP */ + Ins_SHP( EXEC_ARG_ args ); + break; + + case 0x34: /* SHC */ + case 0x35: /* SHC */ + Ins_SHC( EXEC_ARG_ args ); + break; + + case 0x36: /* SHZ */ + case 0x37: /* SHZ */ + Ins_SHZ( EXEC_ARG_ args ); + break; + + case 0x38: /* SHPIX */ + Ins_SHPIX( EXEC_ARG_ args ); + break; + + case 0x39: /* IP */ + Ins_IP( EXEC_ARG_ args ); + break; + + case 0x3A: /* MSIRP */ + case 0x3B: /* MSIRP */ + Ins_MSIRP( EXEC_ARG_ args ); + break; + + case 0x3C: /* AlignRP */ + Ins_ALIGNRP( EXEC_ARG_ args ); + break; + + case 0x3D: /* RTDG */ + DO_RTDG + break; + + case 0x3E: /* MIAP */ + case 0x3F: /* MIAP */ + Ins_MIAP( EXEC_ARG_ args ); + break; + + case 0x40: /* NPUSHB */ + Ins_NPUSHB( EXEC_ARG_ args ); + break; + + case 0x41: /* NPUSHW */ + Ins_NPUSHW( EXEC_ARG_ args ); + break; + + case 0x42: /* WS */ + DO_WS + break; + + Set_Invalid_Ref: + CUR.error = TT_Err_Invalid_Reference; + break; + + case 0x43: /* RS */ + DO_RS + break; + + case 0x44: /* WCVTP */ + DO_WCVTP + break; + + case 0x45: /* RCVT */ + DO_RCVT + break; + + case 0x46: /* GC */ + case 0x47: /* GC */ + Ins_GC( EXEC_ARG_ args ); + break; + + case 0x48: /* SCFS */ + Ins_SCFS( EXEC_ARG_ args ); + break; + + case 0x49: /* MD */ + case 0x4A: /* MD */ + Ins_MD( EXEC_ARG_ args ); + break; + + case 0x4B: /* MPPEM */ + DO_MPPEM + break; + + case 0x4C: /* MPS */ + DO_MPS + break; + + case 0x4D: /* FLIPON */ + DO_FLIPON + break; + + case 0x4E: /* FLIPOFF */ + DO_FLIPOFF + break; + + case 0x4F: /* DEBUG */ + DO_DEBUG + break; + + case 0x50: /* LT */ + DO_LT + break; + + case 0x51: /* LTEQ */ + DO_LTEQ + break; + + case 0x52: /* GT */ + DO_GT + break; + + case 0x53: /* GTEQ */ + DO_GTEQ + break; + + case 0x54: /* EQ */ + DO_EQ + break; + + case 0x55: /* NEQ */ + DO_NEQ + break; + + case 0x56: /* ODD */ + DO_ODD + break; + + case 0x57: /* EVEN */ + DO_EVEN + break; + + case 0x58: /* IF */ + Ins_IF( EXEC_ARG_ args ); + break; + + case 0x59: /* EIF */ + /* do nothing */ + break; + + case 0x5A: /* AND */ + DO_AND + break; + + case 0x5B: /* OR */ + DO_OR + break; + + case 0x5C: /* NOT */ + DO_NOT + break; + + case 0x5D: /* DELTAP1 */ + Ins_DELTAP( EXEC_ARG_ args ); + break; + + case 0x5E: /* SDB */ + DO_SDB + break; + + case 0x5F: /* SDS */ + DO_SDS + break; + + case 0x60: /* ADD */ + DO_ADD + break; + + case 0x61: /* SUB */ + DO_SUB + break; + + case 0x62: /* DIV */ + DO_DIV + break; + + case 0x63: /* MUL */ + DO_MUL + break; + + case 0x64: /* ABS */ + DO_ABS + break; + + case 0x65: /* NEG */ + DO_NEG + break; + + case 0x66: /* FLOOR */ + DO_FLOOR + break; + + case 0x67: /* CEILING */ + DO_CEILING + break; + + case 0x68: /* ROUND */ + case 0x69: /* ROUND */ + case 0x6A: /* ROUND */ + case 0x6B: /* ROUND */ + DO_ROUND + break; + + case 0x6C: /* NROUND */ + case 0x6D: /* NROUND */ + case 0x6E: /* NRRUND */ + case 0x6F: /* NROUND */ + DO_NROUND + break; + + case 0x70: /* WCVTF */ + DO_WCVTF + break; + + case 0x71: /* DELTAP2 */ + case 0x72: /* DELTAP3 */ + Ins_DELTAP( EXEC_ARG_ args ); + break; + + case 0x73: /* DELTAC0 */ + case 0x74: /* DELTAC1 */ + case 0x75: /* DELTAC2 */ + Ins_DELTAC( EXEC_ARG_ args ); + break; + + case 0x76: /* SROUND */ + DO_SROUND + break; + + case 0x77: /* S45Round */ + DO_S45ROUND + break; + + case 0x78: /* JROT */ + DO_JROT + break; + + case 0x79: /* JROF */ + DO_JROF + break; + + case 0x7A: /* ROFF */ + DO_ROFF + break; + + case 0x7B: /* ???? */ + Ins_UNKNOWN( EXEC_ARG_ args ); + break; + + case 0x7C: /* RUTG */ + DO_RUTG + break; + + case 0x7D: /* RDTG */ + DO_RDTG + break; + + case 0x7E: /* SANGW */ + case 0x7F: /* AA */ + /* nothing - obsolete */ + break; + + case 0x80: /* FLIPPT */ + Ins_FLIPPT( EXEC_ARG_ args ); + break; + + case 0x81: /* FLIPRGON */ + Ins_FLIPRGON( EXEC_ARG_ args ); + break; + + case 0x82: /* FLIPRGOFF */ + Ins_FLIPRGOFF( EXEC_ARG_ args ); + break; + + case 0x83: /* UNKNOWN */ + case 0x84: /* UNKNOWN */ + Ins_UNKNOWN( EXEC_ARG_ args ); + break; + + case 0x85: /* SCANCTRL */ + Ins_SCANCTRL( EXEC_ARG_ args ); + break; + + case 0x86: /* SDPVTL */ + case 0x87: /* SDPVTL */ + Ins_SDPVTL( EXEC_ARG_ args ); + break; + + case 0x88: /* GETINFO */ + Ins_GETINFO( EXEC_ARG_ args ); + break; + + case 0x89: /* IDEF */ + Ins_IDEF( EXEC_ARG_ args ); + break; + + case 0x8A: /* ROLL */ + Ins_ROLL( EXEC_ARG_ args ); + break; + + case 0x8B: /* MAX */ + DO_MAX + break; + + case 0x8C: /* MIN */ + DO_MIN + break; + + case 0x8D: /* SCANTYPE */ + Ins_SCANTYPE( EXEC_ARG_ args ); + break; + + case 0x8E: /* INSTCTRL */ + Ins_INSTCTRL( EXEC_ARG_ args ); + break; + + case 0x8F: + Ins_UNKNOWN( EXEC_ARG_ args ); + break; + + default: + if ( opcode >= 0xE0 ) + Ins_MIRP( EXEC_ARG_ args ); + else if ( opcode >= 0xC0 ) + Ins_MDRP( EXEC_ARG_ args ); + else if ( opcode >= 0xB8 ) + Ins_PUSHW( EXEC_ARG_ args ); + else if ( opcode >= 0xB0 ) + Ins_PUSHB( EXEC_ARG_ args ); + else + Ins_UNKNOWN( EXEC_ARG_ args ); + } + + } + +#else + + Instruct_Dispatch[CUR.opcode]( EXEC_ARG_ &CUR.stack[CUR.args] ); + +#endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */ + + if ( CUR.error != TT_Err_Ok ) + { + switch ( CUR.error ) + { + case TT_Err_Invalid_Opcode: /* looking for redefined instructions */ + { + TT_DefRecord* def = CUR.IDefs; + TT_DefRecord* limit = def + CUR.numIDefs; + + + for ( ; def < limit; def++ ) + { + if ( def->active && CUR.opcode == (FT_Byte)def->opc ) + { + TT_CallRec* callrec; + + + if ( CUR.callTop >= CUR.callSize ) + { + CUR.error = TT_Err_Invalid_Reference; + goto LErrorLabel_; + } + + callrec = &CUR.callStack[CUR.callTop]; + + callrec->Caller_Range = CUR.curRange; + callrec->Caller_IP = CUR.IP + 1; + callrec->Cur_Count = 1; + callrec->Cur_Restart = def->start; + + if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE ) + goto LErrorLabel_; + + goto LSuiteLabel_; + } + } + } + + CUR.error = TT_Err_Invalid_Opcode; + goto LErrorLabel_; + +#if 0 + break; /* Unreachable code warning suppression. */ + /* Leave to remind in case a later change the editor */ + /* to consider break; */ +#endif + + default: + goto LErrorLabel_; + +#if 0 + break; +#endif + } + } + + CUR.top = CUR.new_top; + + if ( CUR.step_ins ) + CUR.IP += CUR.length; + + /* increment instruction counter and check if we didn't */ + /* run this program for too long (e.g. infinite loops). */ + if ( ++ins_counter > MAX_RUNNABLE_OPCODES ) + return TT_Err_Execution_Too_Long; + + LSuiteLabel_: + if ( CUR.IP >= CUR.codeSize ) + { + if ( CUR.callTop > 0 ) + { + CUR.error = TT_Err_Code_Overflow; + goto LErrorLabel_; + } + else + goto LNo_Error_; + } + } while ( !CUR.instruction_trap ); + + LNo_Error_: + +#ifdef TT_CONFIG_OPTION_STATIC_RASTER + *exc = cur; +#endif + + return TT_Err_Ok; + + LErrorCodeOverflow_: + CUR.error = TT_Err_Code_Overflow; + + LErrorLabel_: + +#ifdef TT_CONFIG_OPTION_STATIC_RASTER + *exc = cur; +#endif + + return CUR.error; + } + + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.h b/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.h index 07a8972cb3d..7c1b092dea5 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.h +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttinterp.h @@ -1,311 +1,311 @@ -/***************************************************************************/ -/* */ -/* ttinterp.h */ -/* */ -/* TrueType bytecode interpreter (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTINTERP_H__ -#define __TTINTERP_H__ - -#include -#include "ttobjs.h" - - -FT_BEGIN_HEADER - - -#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */ - -#define EXEC_OP_ TT_ExecContext exc, -#define EXEC_OP TT_ExecContext exc -#define EXEC_ARG_ exc, -#define EXEC_ARG exc - -#else /* static implementation */ - -#define EXEC_OP_ /* void */ -#define EXEC_OP /* void */ -#define EXEC_ARG_ /* void */ -#define EXEC_ARG /* void */ - -#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */ - - - /*************************************************************************/ - /* */ - /* Rounding mode constants. */ - /* */ -#define TT_Round_Off 5 -#define TT_Round_To_Half_Grid 0 -#define TT_Round_To_Grid 1 -#define TT_Round_To_Double_Grid 2 -#define TT_Round_Up_To_Grid 4 -#define TT_Round_Down_To_Grid 3 -#define TT_Round_Super 6 -#define TT_Round_Super_45 7 - - - /*************************************************************************/ - /* */ - /* Function types used by the interpreter, depending on various modes */ - /* (e.g. the rounding mode, whether to render a vertical or horizontal */ - /* line etc). */ - /* */ - /*************************************************************************/ - - /* Rounding function */ - typedef FT_F26Dot6 - (*TT_Round_Func)( EXEC_OP_ FT_F26Dot6 distance, - FT_F26Dot6 compensation ); - - /* Point displacement along the freedom vector routine */ - typedef void - (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ); - - /* Distance projection along one of the projection vectors */ - typedef FT_F26Dot6 - (*TT_Project_Func)( EXEC_OP_ FT_Pos dx, - FT_Pos dy ); - - /* reading a cvt value. Take care of non-square pixels if necessary */ - typedef FT_F26Dot6 - (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx ); - - /* setting or moving a cvt value. Take care of non-square pixels */ - /* if necessary */ - typedef void - (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx, - FT_F26Dot6 value ); - - - /*************************************************************************/ - /* */ - /* This structure defines a call record, used to manage function calls. */ - /* */ - typedef struct TT_CallRec_ - { - FT_Int Caller_Range; - FT_Long Caller_IP; - FT_Long Cur_Count; - FT_Long Cur_Restart; - - } TT_CallRec, *TT_CallStack; - - - /*************************************************************************/ - /* */ - /* The main structure for the interpreter which collects all necessary */ - /* variables and states. */ - /* */ - typedef struct TT_ExecContextRec_ - { - TT_Face face; - TT_Size size; - FT_Memory memory; - - /* instructions state */ - - FT_Error error; /* last execution error */ - - FT_Long top; /* top of exec. stack */ - - FT_UInt stackSize; /* size of exec. stack */ - FT_Long* stack; /* current exec. stack */ - - FT_Long args; - FT_UInt new_top; /* new top after exec. */ - - TT_GlyphZoneRec zp0, /* zone records */ - zp1, - zp2, - pts, - twilight; - - FT_Size_Metrics metrics; - TT_Size_Metrics tt_metrics; /* size metrics */ - - TT_GraphicsState GS; /* current graphics state */ - - FT_Int curRange; /* current code range number */ - FT_Byte* code; /* current code range */ - FT_Long IP; /* current instruction pointer */ - FT_Long codeSize; /* size of current range */ - - FT_Byte opcode; /* current opcode */ - FT_Int length; /* length of current opcode */ - - FT_Bool step_ins; /* true if the interpreter must */ - /* increment IP after ins. exec */ - FT_Long cvtSize; - FT_Long* cvt; - - FT_UInt glyphSize; /* glyph instructions buffer size */ - FT_Byte* glyphIns; /* glyph instructions buffer */ - - FT_UInt numFDefs; /* number of function defs */ - FT_UInt maxFDefs; /* maximum number of function defs */ - TT_DefArray FDefs; /* table of FDefs entries */ - - FT_UInt numIDefs; /* number of instruction defs */ - FT_UInt maxIDefs; /* maximum number of ins defs */ - TT_DefArray IDefs; /* table of IDefs entries */ - - FT_UInt maxFunc; /* maximum function index */ - FT_UInt maxIns; /* maximum instruction index */ - - FT_Int callTop, /* top of call stack during execution */ - callSize; /* size of call stack */ - TT_CallStack callStack; /* call stack */ - - FT_UShort maxPoints; /* capacity of this context's `pts' */ - FT_Short maxContours; /* record, expressed in points and */ - /* contours. */ - - TT_CodeRangeTable codeRangeTable; /* table of valid code ranges */ - /* useful for the debugger */ - - FT_UShort storeSize; /* size of current storage */ - FT_Long* storage; /* storage area */ - - FT_F26Dot6 period; /* values used for the */ - FT_F26Dot6 phase; /* `SuperRounding' */ - FT_F26Dot6 threshold; - -#if 0 - /* this seems to be unused */ - FT_Int cur_ppem; /* ppem along the current proj vector */ -#endif - - FT_Bool instruction_trap; /* If `True', the interpreter will */ - /* exit after each instruction */ - - TT_GraphicsState default_GS; /* graphics state resulting from */ - /* the prep program */ - FT_Bool is_composite; /* true if the glyph is composite */ - FT_Bool pedantic_hinting; /* true if pedantic interpretation */ - - /* latest interpreter additions */ - - FT_Long F_dot_P; /* dot product of freedom and projection */ - /* vectors */ - TT_Round_Func func_round; /* current rounding function */ - - TT_Project_Func func_project, /* current projection function */ - func_dualproj, /* current dual proj. function */ - func_freeProj; /* current freedom proj. func */ - - TT_Move_Func func_move; /* current point move function */ - TT_Move_Func func_move_orig; /* move original position function */ - - TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ - TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ - TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ - - FT_Bool grayscale; /* are we hinting for grayscale? */ - - } TT_ExecContextRec; - - - extern const TT_GraphicsState tt_default_graphics_state; - - - FT_LOCAL( FT_Error ) - TT_Goto_CodeRange( TT_ExecContext exec, - FT_Int range, - FT_Long IP ); - - FT_LOCAL( FT_Error ) - TT_Set_CodeRange( TT_ExecContext exec, - FT_Int range, - void* base, - FT_Long length ); - - FT_LOCAL( FT_Error ) - TT_Clear_CodeRange( TT_ExecContext exec, - FT_Int range ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_New_Context */ - /* */ - /* */ - /* Queries the face context for a given font. Note that there is */ - /* now a _single_ execution context in the TrueType driver which is */ - /* shared among faces. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* */ - /* A handle to the execution context. Initialized for `face'. */ - /* */ - /* */ - /* Only the glyph loader and debugger should call this function. */ - /* */ - FT_EXPORT( TT_ExecContext ) - TT_New_Context( TT_Driver driver ); - - FT_LOCAL( FT_Error ) - TT_Done_Context( TT_ExecContext exec ); - - FT_LOCAL( FT_Error ) - TT_Load_Context( TT_ExecContext exec, - TT_Face face, - TT_Size size ); - - FT_LOCAL( FT_Error ) - TT_Save_Context( TT_ExecContext exec, - TT_Size ins ); - - FT_LOCAL( FT_Error ) - TT_Run_Context( TT_ExecContext exec, - FT_Bool debug ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_RunIns */ - /* */ - /* */ - /* Executes one or more instruction in the execution context. This */ - /* is the main function of the TrueType opcode interpreter. */ - /* */ - /* */ - /* exec :: A handle to the target execution context. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only the object manager and debugger should call this function. */ - /* */ - /* This function is publicly exported because it is directly */ - /* invoked by the TrueType debugger. */ - /* */ - FT_EXPORT( FT_Error ) - TT_RunIns( TT_ExecContext exec ); - - -FT_END_HEADER - -#endif /* __TTINTERP_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttinterp.h */ +/* */ +/* TrueType bytecode interpreter (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTINTERP_H__ +#define __TTINTERP_H__ + +#include +#include "ttobjs.h" + + +FT_BEGIN_HEADER + + +#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */ + +#define EXEC_OP_ TT_ExecContext exc, +#define EXEC_OP TT_ExecContext exc +#define EXEC_ARG_ exc, +#define EXEC_ARG exc + +#else /* static implementation */ + +#define EXEC_OP_ /* void */ +#define EXEC_OP /* void */ +#define EXEC_ARG_ /* void */ +#define EXEC_ARG /* void */ + +#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */ + + + /*************************************************************************/ + /* */ + /* Rounding mode constants. */ + /* */ +#define TT_Round_Off 5 +#define TT_Round_To_Half_Grid 0 +#define TT_Round_To_Grid 1 +#define TT_Round_To_Double_Grid 2 +#define TT_Round_Up_To_Grid 4 +#define TT_Round_Down_To_Grid 3 +#define TT_Round_Super 6 +#define TT_Round_Super_45 7 + + + /*************************************************************************/ + /* */ + /* Function types used by the interpreter, depending on various modes */ + /* (e.g. the rounding mode, whether to render a vertical or horizontal */ + /* line etc). */ + /* */ + /*************************************************************************/ + + /* Rounding function */ + typedef FT_F26Dot6 + (*TT_Round_Func)( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ); + + /* Point displacement along the freedom vector routine */ + typedef void + (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ); + + /* Distance projection along one of the projection vectors */ + typedef FT_F26Dot6 + (*TT_Project_Func)( EXEC_OP_ FT_Pos dx, + FT_Pos dy ); + + /* reading a cvt value. Take care of non-square pixels if necessary */ + typedef FT_F26Dot6 + (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx ); + + /* setting or moving a cvt value. Take care of non-square pixels */ + /* if necessary */ + typedef void + (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx, + FT_F26Dot6 value ); + + + /*************************************************************************/ + /* */ + /* This structure defines a call record, used to manage function calls. */ + /* */ + typedef struct TT_CallRec_ + { + FT_Int Caller_Range; + FT_Long Caller_IP; + FT_Long Cur_Count; + FT_Long Cur_Restart; + + } TT_CallRec, *TT_CallStack; + + + /*************************************************************************/ + /* */ + /* The main structure for the interpreter which collects all necessary */ + /* variables and states. */ + /* */ + typedef struct TT_ExecContextRec_ + { + TT_Face face; + TT_Size size; + FT_Memory memory; + + /* instructions state */ + + FT_Error error; /* last execution error */ + + FT_Long top; /* top of exec. stack */ + + FT_UInt stackSize; /* size of exec. stack */ + FT_Long* stack; /* current exec. stack */ + + FT_Long args; + FT_UInt new_top; /* new top after exec. */ + + TT_GlyphZoneRec zp0, /* zone records */ + zp1, + zp2, + pts, + twilight; + + FT_Size_Metrics metrics; + TT_Size_Metrics tt_metrics; /* size metrics */ + + TT_GraphicsState GS; /* current graphics state */ + + FT_Int curRange; /* current code range number */ + FT_Byte* code; /* current code range */ + FT_Long IP; /* current instruction pointer */ + FT_Long codeSize; /* size of current range */ + + FT_Byte opcode; /* current opcode */ + FT_Int length; /* length of current opcode */ + + FT_Bool step_ins; /* true if the interpreter must */ + /* increment IP after ins. exec */ + FT_Long cvtSize; + FT_Long* cvt; + + FT_UInt glyphSize; /* glyph instructions buffer size */ + FT_Byte* glyphIns; /* glyph instructions buffer */ + + FT_UInt numFDefs; /* number of function defs */ + FT_UInt maxFDefs; /* maximum number of function defs */ + TT_DefArray FDefs; /* table of FDefs entries */ + + FT_UInt numIDefs; /* number of instruction defs */ + FT_UInt maxIDefs; /* maximum number of ins defs */ + TT_DefArray IDefs; /* table of IDefs entries */ + + FT_UInt maxFunc; /* maximum function index */ + FT_UInt maxIns; /* maximum instruction index */ + + FT_Int callTop, /* top of call stack during execution */ + callSize; /* size of call stack */ + TT_CallStack callStack; /* call stack */ + + FT_UShort maxPoints; /* capacity of this context's `pts' */ + FT_Short maxContours; /* record, expressed in points and */ + /* contours. */ + + TT_CodeRangeTable codeRangeTable; /* table of valid code ranges */ + /* useful for the debugger */ + + FT_UShort storeSize; /* size of current storage */ + FT_Long* storage; /* storage area */ + + FT_F26Dot6 period; /* values used for the */ + FT_F26Dot6 phase; /* `SuperRounding' */ + FT_F26Dot6 threshold; + +#if 0 + /* this seems to be unused */ + FT_Int cur_ppem; /* ppem along the current proj vector */ +#endif + + FT_Bool instruction_trap; /* If `True', the interpreter will */ + /* exit after each instruction */ + + TT_GraphicsState default_GS; /* graphics state resulting from */ + /* the prep program */ + FT_Bool is_composite; /* true if the glyph is composite */ + FT_Bool pedantic_hinting; /* true if pedantic interpretation */ + + /* latest interpreter additions */ + + FT_Long F_dot_P; /* dot product of freedom and projection */ + /* vectors */ + TT_Round_Func func_round; /* current rounding function */ + + TT_Project_Func func_project, /* current projection function */ + func_dualproj, /* current dual proj. function */ + func_freeProj; /* current freedom proj. func */ + + TT_Move_Func func_move; /* current point move function */ + TT_Move_Func func_move_orig; /* move original position function */ + + TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ + TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ + TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ + + FT_Bool grayscale; /* are we hinting for grayscale? */ + + } TT_ExecContextRec; + + + extern const TT_GraphicsState tt_default_graphics_state; + + + FT_LOCAL( FT_Error ) + TT_Goto_CodeRange( TT_ExecContext exec, + FT_Int range, + FT_Long IP ); + + FT_LOCAL( FT_Error ) + TT_Set_CodeRange( TT_ExecContext exec, + FT_Int range, + void* base, + FT_Long length ); + + FT_LOCAL( FT_Error ) + TT_Clear_CodeRange( TT_ExecContext exec, + FT_Int range ); + + + /*************************************************************************/ + /* */ + /* */ + /* TT_New_Context */ + /* */ + /* */ + /* Queries the face context for a given font. Note that there is */ + /* now a _single_ execution context in the TrueType driver which is */ + /* shared among faces. */ + /* */ + /* */ + /* face :: A handle to the source face object. */ + /* */ + /* */ + /* A handle to the execution context. Initialized for `face'. */ + /* */ + /* */ + /* Only the glyph loader and debugger should call this function. */ + /* */ + FT_EXPORT( TT_ExecContext ) + TT_New_Context( TT_Driver driver ); + + FT_LOCAL( FT_Error ) + TT_Done_Context( TT_ExecContext exec ); + + FT_LOCAL( FT_Error ) + TT_Load_Context( TT_ExecContext exec, + TT_Face face, + TT_Size size ); + + FT_LOCAL( FT_Error ) + TT_Save_Context( TT_ExecContext exec, + TT_Size ins ); + + FT_LOCAL( FT_Error ) + TT_Run_Context( TT_ExecContext exec, + FT_Bool debug ); + + + /*************************************************************************/ + /* */ + /* */ + /* TT_RunIns */ + /* */ + /* */ + /* Executes one or more instruction in the execution context. This */ + /* is the main function of the TrueType opcode interpreter. */ + /* */ + /* */ + /* exec :: A handle to the target execution context. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* Only the object manager and debugger should call this function. */ + /* */ + /* This function is publicly exported because it is directly */ + /* invoked by the TrueType debugger. */ + /* */ + FT_EXPORT( FT_Error ) + TT_RunIns( TT_ExecContext exec ); + + +FT_END_HEADER + +#endif /* __TTINTERP_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.c b/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.c index 0294a1b7e66..b1e465229e5 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.c +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.c @@ -1,937 +1,937 @@ -/***************************************************************************/ -/* */ -/* ttobjs.c */ -/* */ -/* Objects manager (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_IDS_H -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_SFNT_H - -#include "ttgload.h" -#include "ttpload.h" - -#include "tterrors.h" - -#ifdef TT_USE_BYTECODE_INTERPRETER -#include "ttinterp.h" -#endif - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING -#include FT_TRUETYPE_UNPATENTED_H -#endif - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include "ttgxvar.h" -#endif - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttobjs - - -#ifdef TT_USE_BYTECODE_INTERPRETER - - /*************************************************************************/ - /* */ - /* GLYPH ZONE FUNCTIONS */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* tt_glyphzone_done */ - /* */ - /* */ - /* Deallocate a glyph zone. */ - /* */ - /* */ - /* zone :: A pointer to the target glyph zone. */ - /* */ - FT_LOCAL_DEF( void ) - tt_glyphzone_done( TT_GlyphZone zone ) - { - FT_Memory memory = zone->memory; - - - if ( memory ) - { - FT_FREE( zone->contours ); - FT_FREE( zone->tags ); - FT_FREE( zone->cur ); - FT_FREE( zone->org ); - FT_FREE( zone->orus ); - - zone->max_points = zone->n_points = 0; - zone->max_contours = zone->n_contours = 0; - zone->memory = NULL; - } - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_glyphzone_new */ - /* */ - /* */ - /* Allocate a new glyph zone. */ - /* */ - /* */ - /* memory :: A handle to the current memory object. */ - /* */ - /* maxPoints :: The capacity of glyph zone in points. */ - /* */ - /* maxContours :: The capacity of glyph zone in contours. */ - /* */ - /* */ - /* zone :: A pointer to the target glyph zone record. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_glyphzone_new( FT_Memory memory, - FT_UShort maxPoints, - FT_Short maxContours, - TT_GlyphZone zone ) - { - FT_Error error; - - - FT_MEM_ZERO( zone, sizeof ( *zone ) ); - zone->memory = memory; - - if ( FT_NEW_ARRAY( zone->org, maxPoints ) || - FT_NEW_ARRAY( zone->cur, maxPoints ) || - FT_NEW_ARRAY( zone->orus, maxPoints ) || - FT_NEW_ARRAY( zone->tags, maxPoints ) || - FT_NEW_ARRAY( zone->contours, maxContours ) ) - { - tt_glyphzone_done( zone ); - } - else - { - zone->max_points = maxPoints; - zone->max_contours = maxContours; - } - - return error; - } -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_init */ - /* */ - /* */ - /* Initialize a given TrueType face object. */ - /* */ - /* */ - /* stream :: The source font stream. */ - /* */ - /* face_index :: The index of the font face in the resource. */ - /* */ - /* num_params :: Number of additional generic parameters. Ignored. */ - /* */ - /* params :: Additional generic parameters. Ignored. */ - /* */ - /* */ - /* face :: The newly built face object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_init( FT_Stream stream, - FT_Face ttface, /* TT_Face */ - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - FT_Error error; - FT_Library library; - SFNT_Service sfnt; - TT_Face face = (TT_Face)ttface; - - - library = face->root.driver->root.library; - sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); - if ( !sfnt ) - goto Bad_Format; - - /* create input stream from resource */ - if ( FT_STREAM_SEEK( 0 ) ) - goto Exit; - - /* check that we have a valid TrueType file */ - error = sfnt->init_face( stream, face, face_index, num_params, params ); - if ( error ) - goto Exit; - - /* We must also be able to accept Mac/GX fonts, as well as OT ones. */ - /* The 0x00020000 tag is completely undocumented; some fonts from */ - /* Arphic made for Chinese Windows 3.1 have this. */ - if ( face->format_tag != 0x00010000L && /* MS fonts */ - face->format_tag != 0x00020000L && /* CJK fonts for Win 3.1 */ - face->format_tag != TTAG_true ) /* Mac fonts */ - { - FT_TRACE2(( "[not a valid TTF font]\n" )); - goto Bad_Format; - } - -#ifdef TT_USE_BYTECODE_INTERPRETER - face->root.face_flags |= FT_FACE_FLAG_HINTER; -#endif - - /* If we are performing a simple font format check, exit immediately. */ - if ( face_index < 0 ) - return TT_Err_Ok; - - /* Load font directory */ - error = sfnt->load_face( stream, face, face_index, num_params, params ); - if ( error ) - goto Exit; - - error = tt_face_load_hdmx( face, stream ); - if ( error ) - goto Exit; - - if ( face->root.face_flags & FT_FACE_FLAG_SCALABLE ) - { - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - if ( !face->root.internal->incremental_interface ) - error = tt_face_load_loca( face, stream ); - if ( !error ) - error = tt_face_load_cvt( face, stream ) || - tt_face_load_fpgm( face, stream ) || - tt_face_load_prep( face, stream ); - -#else - - if ( !error ) - error = tt_face_load_loca( face, stream ) || - tt_face_load_cvt( face, stream ) || - tt_face_load_fpgm( face, stream ) || - tt_face_load_prep( face, stream ); - -#endif - - } - -#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \ - !defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER ) - - { - FT_Bool unpatented_hinting; - int i; - - - /* Determine whether unpatented hinting is to be used for this face. */ - unpatented_hinting = FT_BOOL - ( library->debug_hooks[FT_DEBUG_HOOK_UNPATENTED_HINTING] != NULL ); - - for ( i = 0; i < num_params && !face->unpatented_hinting; i++ ) - if ( params[i].tag == FT_PARAM_TAG_UNPATENTED_HINTING ) - unpatented_hinting = TRUE; - - /* Compare the face with a list of well-known `tricky' fonts. */ - /* This list shall be expanded as we find more of them. */ - if ( !unpatented_hinting ) - { - static const char* const trick_names[] = - { - "DFKaiSho-SB", /* dfkaisb.ttf */ - "DFKai-SB", /* kaiu.ttf */ - "HuaTianSongTi?", /* htst3.ttf */ - "MingLiU", /* mingliu.ttf & mingliu.ttc */ - "PMingLiU", /* mingliu.ttc */ - "MingLi43", /* mingli.ttf */ - NULL - }; - int nn; - - - /* Note that we only check the face name at the moment; it might */ - /* be worth to do more checks for a few special cases. */ - for ( nn = 0; trick_names[nn] != NULL; nn++ ) - { - if ( ttface->family_name && - ft_strstr( ttface->family_name, trick_names[nn] ) ) - { - unpatented_hinting = 1; - break; - } - } - } - - ttface->internal->ignore_unpatented_hinter = - FT_BOOL( !unpatented_hinting ); - } - -#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING && - !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ - - /* initialize standard glyph loading routines */ - TT_Init_Glyph_Loading( face ); - - Exit: - return error; - - Bad_Format: - error = TT_Err_Unknown_File_Format; - goto Exit; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_done */ - /* */ - /* */ - /* Finalize a given face object. */ - /* */ - /* */ - /* face :: A pointer to the face object to destroy. */ - /* */ - FT_LOCAL_DEF( void ) - tt_face_done( FT_Face ttface ) /* TT_Face */ - { - TT_Face face = (TT_Face)ttface; - FT_Memory memory = face->root.memory; - FT_Stream stream = face->root.stream; - - SFNT_Service sfnt = (SFNT_Service)face->sfnt; - - - /* for `extended TrueType formats' (i.e. compressed versions) */ - if ( face->extra.finalizer ) - face->extra.finalizer( face->extra.data ); - - if ( sfnt ) - sfnt->done_face( face ); - - /* freeing the locations table */ - tt_face_done_loca( face ); - - tt_face_free_hdmx( face ); - - /* freeing the CVT */ - FT_FREE( face->cvt ); - face->cvt_size = 0; - - /* freeing the programs */ - FT_FRAME_RELEASE( face->font_program ); - FT_FRAME_RELEASE( face->cvt_program ); - face->font_program_size = 0; - face->cvt_program_size = 0; - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - tt_done_blend( memory, face->blend ); - face->blend = NULL; -#endif - } - - - /*************************************************************************/ - /* */ - /* SIZE FUNCTIONS */ - /* */ - /*************************************************************************/ - -#ifdef TT_USE_BYTECODE_INTERPRETER - - /*************************************************************************/ - /* */ - /* */ - /* tt_size_run_fpgm */ - /* */ - /* */ - /* Run the font program. */ - /* */ - /* */ - /* size :: A handle to the size object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_size_run_fpgm( TT_Size size ) - { - TT_Face face = (TT_Face)size->root.face; - TT_ExecContext exec; - FT_Error error; - - - /* debugging instances have their own context */ - if ( size->debug ) - exec = size->context; - else - exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; - - if ( !exec ) - return TT_Err_Could_Not_Find_Context; - - TT_Load_Context( exec, face, size ); - - exec->callTop = 0; - exec->top = 0; - - exec->period = 64; - exec->phase = 0; - exec->threshold = 0; - - exec->instruction_trap = FALSE; - exec->F_dot_P = 0x10000L; - - { - FT_Size_Metrics* metrics = &exec->metrics; - TT_Size_Metrics* tt_metrics = &exec->tt_metrics; - - - metrics->x_ppem = 0; - metrics->y_ppem = 0; - metrics->x_scale = 0; - metrics->y_scale = 0; - - tt_metrics->ppem = 0; - tt_metrics->scale = 0; - tt_metrics->ratio = 0x10000L; - } - - /* allow font program execution */ - TT_Set_CodeRange( exec, - tt_coderange_font, - face->font_program, - face->font_program_size ); - - /* disable CVT and glyph programs coderange */ - TT_Clear_CodeRange( exec, tt_coderange_cvt ); - TT_Clear_CodeRange( exec, tt_coderange_glyph ); - - if ( face->font_program_size > 0 ) - { - error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); - - if ( !error ) - error = face->interpreter( exec ); - } - else - error = TT_Err_Ok; - - if ( !error ) - TT_Save_Context( exec, size ); - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_size_run_prep */ - /* */ - /* */ - /* Run the control value program. */ - /* */ - /* */ - /* size :: A handle to the size object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_size_run_prep( TT_Size size ) - { - TT_Face face = (TT_Face)size->root.face; - TT_ExecContext exec; - FT_Error error; - - - /* debugging instances have their own context */ - if ( size->debug ) - exec = size->context; - else - exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; - - if ( !exec ) - return TT_Err_Could_Not_Find_Context; - - TT_Load_Context( exec, face, size ); - - exec->callTop = 0; - exec->top = 0; - - exec->instruction_trap = FALSE; - - TT_Set_CodeRange( exec, - tt_coderange_cvt, - face->cvt_program, - face->cvt_program_size ); - - TT_Clear_CodeRange( exec, tt_coderange_glyph ); - - if ( face->cvt_program_size > 0 ) - { - error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); - - if ( !error && !size->debug ) - error = face->interpreter( exec ); - } - else - error = TT_Err_Ok; - - /* save as default graphics state */ - size->GS = exec->GS; - - TT_Save_Context( exec, size ); - - return error; - } - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - -#ifdef TT_USE_BYTECODE_INTERPRETER - - static void - tt_size_done_bytecode( FT_Size ftsize ) - { - TT_Size size = (TT_Size)ftsize; - TT_Face face = (TT_Face)ftsize->face; - FT_Memory memory = face->root.memory; - - - if ( size->debug ) - { - /* the debug context must be deleted by the debugger itself */ - size->context = NULL; - size->debug = FALSE; - } - - FT_FREE( size->cvt ); - size->cvt_size = 0; - - /* free storage area */ - FT_FREE( size->storage ); - size->storage_size = 0; - - /* twilight zone */ - tt_glyphzone_done( &size->twilight ); - - FT_FREE( size->function_defs ); - FT_FREE( size->instruction_defs ); - - size->num_function_defs = 0; - size->max_function_defs = 0; - size->num_instruction_defs = 0; - size->max_instruction_defs = 0; - - size->max_func = 0; - size->max_ins = 0; - - size->bytecode_ready = 0; - size->cvt_ready = 0; - } - - - /* Initialize bytecode-related fields in the size object. */ - /* We do this only if bytecode interpretation is really needed. */ - static FT_Error - tt_size_init_bytecode( FT_Size ftsize ) - { - FT_Error error; - TT_Size size = (TT_Size)ftsize; - TT_Face face = (TT_Face)ftsize->face; - FT_Memory memory = face->root.memory; - FT_Int i; - - FT_UShort n_twilight; - TT_MaxProfile* maxp = &face->max_profile; - - - size->bytecode_ready = 1; - size->cvt_ready = 0; - - size->max_function_defs = maxp->maxFunctionDefs; - size->max_instruction_defs = maxp->maxInstructionDefs; - - size->num_function_defs = 0; - size->num_instruction_defs = 0; - - size->max_func = 0; - size->max_ins = 0; - - size->cvt_size = face->cvt_size; - size->storage_size = maxp->maxStorage; - - /* Set default metrics */ - { - FT_Size_Metrics* metrics = &size->metrics; - TT_Size_Metrics* metrics2 = &size->ttmetrics; - - metrics->x_ppem = 0; - metrics->y_ppem = 0; - - metrics2->rotated = FALSE; - metrics2->stretched = FALSE; - - /* set default compensation (all 0) */ - for ( i = 0; i < 4; i++ ) - metrics2->compensations[i] = 0; - } - - /* allocate function defs, instruction defs, cvt, and storage area */ - if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) || - FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) || - FT_NEW_ARRAY( size->cvt, size->cvt_size ) || - FT_NEW_ARRAY( size->storage, size->storage_size ) ) - goto Exit; - - /* reserve twilight zone */ - n_twilight = maxp->maxTwilightPoints; - - /* there are 4 phantom points (do we need this?) */ - n_twilight += 4; - - error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight ); - if ( error ) - goto Exit; - - size->twilight.n_points = n_twilight; - - size->GS = tt_default_graphics_state; - - /* set `face->interpreter' according to the debug hook present */ - { - FT_Library library = face->root.driver->root.library; - - - face->interpreter = (TT_Interpreter) - library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE]; - if ( !face->interpreter ) - face->interpreter = (TT_Interpreter)TT_RunIns; - } - - /* Fine, now run the font program! */ - error = tt_size_run_fpgm( size ); - - Exit: - if ( error ) - tt_size_done_bytecode( ftsize ); - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - tt_size_ready_bytecode( TT_Size size ) - { - FT_Error error = TT_Err_Ok; - - - if ( !size->bytecode_ready ) - { - error = tt_size_init_bytecode( (FT_Size)size ); - if ( error ) - goto Exit; - } - - /* rescale CVT when needed */ - if ( !size->cvt_ready ) - { - FT_UInt i; - TT_Face face = (TT_Face) size->root.face; - - - /* Scale the cvt values to the new ppem. */ - /* We use by default the y ppem to scale the CVT. */ - for ( i = 0; i < size->cvt_size; i++ ) - size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); - - /* all twilight points are originally zero */ - for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ ) - { - size->twilight.org[i].x = 0; - size->twilight.org[i].y = 0; - size->twilight.cur[i].x = 0; - size->twilight.cur[i].y = 0; - } - - /* clear storage area */ - for ( i = 0; i < (FT_UInt)size->storage_size; i++ ) - size->storage[i] = 0; - - size->GS = tt_default_graphics_state; - - error = tt_size_run_prep( size ); - if ( !error ) - size->cvt_ready = 1; - } - Exit: - return error; - } - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - - /*************************************************************************/ - /* */ - /* */ - /* tt_size_init */ - /* */ - /* */ - /* Initialize a new TrueType size object. */ - /* */ - /* */ - /* size :: A handle to the size object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_size_init( FT_Size ttsize ) /* TT_Size */ - { - TT_Size size = (TT_Size)ttsize; - FT_Error error = TT_Err_Ok; - -#ifdef TT_USE_BYTECODE_INTERPRETER - size->bytecode_ready = 0; - size->cvt_ready = 0; -#endif - - size->ttmetrics.valid = FALSE; - size->strike_index = 0xFFFFFFFFUL; - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_size_done */ - /* */ - /* */ - /* The TrueType size object finalizer. */ - /* */ - /* */ - /* size :: A handle to the target size object. */ - /* */ - FT_LOCAL_DEF( void ) - tt_size_done( FT_Size ttsize ) /* TT_Size */ - { - TT_Size size = (TT_Size)ttsize; - - -#ifdef TT_USE_BYTECODE_INTERPRETER - if ( size->bytecode_ready ) - tt_size_done_bytecode( ttsize ); -#endif - - size->ttmetrics.valid = FALSE; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_size_reset */ - /* */ - /* */ - /* Reset a TrueType size when resolutions and character dimensions */ - /* have been changed. */ - /* */ - /* */ - /* size :: A handle to the target size object. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_size_reset( TT_Size size ) - { - TT_Face face; - FT_Error error = TT_Err_Ok; - FT_Size_Metrics* metrics; - - - size->ttmetrics.valid = FALSE; - - face = (TT_Face)size->root.face; - - metrics = &size->metrics; - - /* copy the result from base layer */ - *metrics = size->root.metrics; - - if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 ) - return TT_Err_Invalid_PPem; - - /* This bit flag, if set, indicates that the ppems must be */ - /* rounded to integers. Nearly all TrueType fonts have this bit */ - /* set, as hinting won't work really well otherwise. */ - /* */ - if ( face->header.Flags & 8 ) - { - metrics->x_scale = FT_DivFix( metrics->x_ppem << 6, - face->root.units_per_EM ); - metrics->y_scale = FT_DivFix( metrics->y_ppem << 6, - face->root.units_per_EM ); - - metrics->ascender = - FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) ); - metrics->descender = - FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) ); - metrics->height = - FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) ); - metrics->max_advance = - FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width, - metrics->x_scale ) ); - } - - /* compute new transformation */ - if ( metrics->x_ppem >= metrics->y_ppem ) - { - size->ttmetrics.scale = metrics->x_scale; - size->ttmetrics.ppem = metrics->x_ppem; - size->ttmetrics.x_ratio = 0x10000L; - size->ttmetrics.y_ratio = FT_MulDiv( metrics->y_ppem, - 0x10000L, - metrics->x_ppem ); - } - else - { - size->ttmetrics.scale = metrics->y_scale; - size->ttmetrics.ppem = metrics->y_ppem; - size->ttmetrics.x_ratio = FT_MulDiv( metrics->x_ppem, - 0x10000L, - metrics->y_ppem ); - size->ttmetrics.y_ratio = 0x10000L; - } - -#ifdef TT_USE_BYTECODE_INTERPRETER - size->cvt_ready = 0; -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - if ( !error ) - size->ttmetrics.valid = TRUE; - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_driver_init */ - /* */ - /* */ - /* Initialize a given TrueType driver object. */ - /* */ - /* */ - /* driver :: A handle to the target driver object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_driver_init( FT_Module ttdriver ) /* TT_Driver */ - { - -#ifdef TT_USE_BYTECODE_INTERPRETER - - TT_Driver driver = (TT_Driver)ttdriver; - - - if ( !TT_New_Context( driver ) ) - return TT_Err_Could_Not_Find_Context; - -#else - - FT_UNUSED( ttdriver ); - -#endif - - return TT_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_driver_done */ - /* */ - /* */ - /* Finalize a given TrueType driver. */ - /* */ - /* */ - /* driver :: A handle to the target TrueType driver. */ - /* */ - FT_LOCAL_DEF( void ) - tt_driver_done( FT_Module ttdriver ) /* TT_Driver */ - { -#ifdef TT_USE_BYTECODE_INTERPRETER - TT_Driver driver = (TT_Driver)ttdriver; - - - /* destroy the execution context */ - if ( driver->context ) - { - TT_Done_Context( driver->context ); - driver->context = NULL; - } -#else - FT_UNUSED( ttdriver ); -#endif - - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_slot_init */ - /* */ - /* */ - /* Initialize a new slot object. */ - /* */ - /* */ - /* slot :: A handle to the slot object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_slot_init( FT_GlyphSlot slot ) - { - return FT_GlyphLoader_CreateExtra( slot->internal->loader ); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* ttobjs.c */ +/* */ +/* Objects manager (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_TAGS_H +#include FT_INTERNAL_SFNT_H + +#include "ttgload.h" +#include "ttpload.h" + +#include "tterrors.h" + +#ifdef TT_USE_BYTECODE_INTERPRETER +#include "ttinterp.h" +#endif + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING +#include FT_TRUETYPE_UNPATENTED_H +#endif + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#include "ttgxvar.h" +#endif + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttobjs + + +#ifdef TT_USE_BYTECODE_INTERPRETER + + /*************************************************************************/ + /* */ + /* GLYPH ZONE FUNCTIONS */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* tt_glyphzone_done */ + /* */ + /* */ + /* Deallocate a glyph zone. */ + /* */ + /* */ + /* zone :: A pointer to the target glyph zone. */ + /* */ + FT_LOCAL_DEF( void ) + tt_glyphzone_done( TT_GlyphZone zone ) + { + FT_Memory memory = zone->memory; + + + if ( memory ) + { + FT_FREE( zone->contours ); + FT_FREE( zone->tags ); + FT_FREE( zone->cur ); + FT_FREE( zone->org ); + FT_FREE( zone->orus ); + + zone->max_points = zone->n_points = 0; + zone->max_contours = zone->n_contours = 0; + zone->memory = NULL; + } + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_glyphzone_new */ + /* */ + /* */ + /* Allocate a new glyph zone. */ + /* */ + /* */ + /* memory :: A handle to the current memory object. */ + /* */ + /* maxPoints :: The capacity of glyph zone in points. */ + /* */ + /* maxContours :: The capacity of glyph zone in contours. */ + /* */ + /* */ + /* zone :: A pointer to the target glyph zone record. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_glyphzone_new( FT_Memory memory, + FT_UShort maxPoints, + FT_Short maxContours, + TT_GlyphZone zone ) + { + FT_Error error; + + + FT_MEM_ZERO( zone, sizeof ( *zone ) ); + zone->memory = memory; + + if ( FT_NEW_ARRAY( zone->org, maxPoints ) || + FT_NEW_ARRAY( zone->cur, maxPoints ) || + FT_NEW_ARRAY( zone->orus, maxPoints ) || + FT_NEW_ARRAY( zone->tags, maxPoints ) || + FT_NEW_ARRAY( zone->contours, maxContours ) ) + { + tt_glyphzone_done( zone ); + } + else + { + zone->max_points = maxPoints; + zone->max_contours = maxContours; + } + + return error; + } +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_init */ + /* */ + /* */ + /* Initialize a given TrueType face object. */ + /* */ + /* */ + /* stream :: The source font stream. */ + /* */ + /* face_index :: The index of the font face in the resource. */ + /* */ + /* num_params :: Number of additional generic parameters. Ignored. */ + /* */ + /* params :: Additional generic parameters. Ignored. */ + /* */ + /* */ + /* face :: The newly built face object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_init( FT_Stream stream, + FT_Face ttface, /* TT_Face */ + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error; + FT_Library library; + SFNT_Service sfnt; + TT_Face face = (TT_Face)ttface; + + + library = face->root.driver->root.library; + sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); + if ( !sfnt ) + goto Bad_Format; + + /* create input stream from resource */ + if ( FT_STREAM_SEEK( 0 ) ) + goto Exit; + + /* check that we have a valid TrueType file */ + error = sfnt->init_face( stream, face, face_index, num_params, params ); + if ( error ) + goto Exit; + + /* We must also be able to accept Mac/GX fonts, as well as OT ones. */ + /* The 0x00020000 tag is completely undocumented; some fonts from */ + /* Arphic made for Chinese Windows 3.1 have this. */ + if ( face->format_tag != 0x00010000L && /* MS fonts */ + face->format_tag != 0x00020000L && /* CJK fonts for Win 3.1 */ + face->format_tag != TTAG_true ) /* Mac fonts */ + { + FT_TRACE2(( "[not a valid TTF font]\n" )); + goto Bad_Format; + } + +#ifdef TT_USE_BYTECODE_INTERPRETER + face->root.face_flags |= FT_FACE_FLAG_HINTER; +#endif + + /* If we are performing a simple font format check, exit immediately. */ + if ( face_index < 0 ) + return TT_Err_Ok; + + /* Load font directory */ + error = sfnt->load_face( stream, face, face_index, num_params, params ); + if ( error ) + goto Exit; + + error = tt_face_load_hdmx( face, stream ); + if ( error ) + goto Exit; + + if ( face->root.face_flags & FT_FACE_FLAG_SCALABLE ) + { + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + if ( !face->root.internal->incremental_interface ) + error = tt_face_load_loca( face, stream ); + if ( !error ) + error = tt_face_load_cvt( face, stream ) || + tt_face_load_fpgm( face, stream ) || + tt_face_load_prep( face, stream ); + +#else + + if ( !error ) + error = tt_face_load_loca( face, stream ) || + tt_face_load_cvt( face, stream ) || + tt_face_load_fpgm( face, stream ) || + tt_face_load_prep( face, stream ); + +#endif + + } + +#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \ + !defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER ) + + { + FT_Bool unpatented_hinting; + int i; + + + /* Determine whether unpatented hinting is to be used for this face. */ + unpatented_hinting = FT_BOOL + ( library->debug_hooks[FT_DEBUG_HOOK_UNPATENTED_HINTING] != NULL ); + + for ( i = 0; i < num_params && !face->unpatented_hinting; i++ ) + if ( params[i].tag == FT_PARAM_TAG_UNPATENTED_HINTING ) + unpatented_hinting = TRUE; + + /* Compare the face with a list of well-known `tricky' fonts. */ + /* This list shall be expanded as we find more of them. */ + if ( !unpatented_hinting ) + { + static const char* const trick_names[] = + { + "DFKaiSho-SB", /* dfkaisb.ttf */ + "DFKai-SB", /* kaiu.ttf */ + "HuaTianSongTi?", /* htst3.ttf */ + "MingLiU", /* mingliu.ttf & mingliu.ttc */ + "PMingLiU", /* mingliu.ttc */ + "MingLi43", /* mingli.ttf */ + NULL + }; + int nn; + + + /* Note that we only check the face name at the moment; it might */ + /* be worth to do more checks for a few special cases. */ + for ( nn = 0; trick_names[nn] != NULL; nn++ ) + { + if ( ttface->family_name && + ft_strstr( ttface->family_name, trick_names[nn] ) ) + { + unpatented_hinting = 1; + break; + } + } + } + + ttface->internal->ignore_unpatented_hinter = + FT_BOOL( !unpatented_hinting ); + } + +#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING && + !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ + + /* initialize standard glyph loading routines */ + TT_Init_Glyph_Loading( face ); + + Exit: + return error; + + Bad_Format: + error = TT_Err_Unknown_File_Format; + goto Exit; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_done */ + /* */ + /* */ + /* Finalize a given face object. */ + /* */ + /* */ + /* face :: A pointer to the face object to destroy. */ + /* */ + FT_LOCAL_DEF( void ) + tt_face_done( FT_Face ttface ) /* TT_Face */ + { + TT_Face face = (TT_Face)ttface; + FT_Memory memory = face->root.memory; + FT_Stream stream = face->root.stream; + + SFNT_Service sfnt = (SFNT_Service)face->sfnt; + + + /* for `extended TrueType formats' (i.e. compressed versions) */ + if ( face->extra.finalizer ) + face->extra.finalizer( face->extra.data ); + + if ( sfnt ) + sfnt->done_face( face ); + + /* freeing the locations table */ + tt_face_done_loca( face ); + + tt_face_free_hdmx( face ); + + /* freeing the CVT */ + FT_FREE( face->cvt ); + face->cvt_size = 0; + + /* freeing the programs */ + FT_FRAME_RELEASE( face->font_program ); + FT_FRAME_RELEASE( face->cvt_program ); + face->font_program_size = 0; + face->cvt_program_size = 0; + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + tt_done_blend( memory, face->blend ); + face->blend = NULL; +#endif + } + + + /*************************************************************************/ + /* */ + /* SIZE FUNCTIONS */ + /* */ + /*************************************************************************/ + +#ifdef TT_USE_BYTECODE_INTERPRETER + + /*************************************************************************/ + /* */ + /* */ + /* tt_size_run_fpgm */ + /* */ + /* */ + /* Run the font program. */ + /* */ + /* */ + /* size :: A handle to the size object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_size_run_fpgm( TT_Size size ) + { + TT_Face face = (TT_Face)size->root.face; + TT_ExecContext exec; + FT_Error error; + + + /* debugging instances have their own context */ + if ( size->debug ) + exec = size->context; + else + exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; + + if ( !exec ) + return TT_Err_Could_Not_Find_Context; + + TT_Load_Context( exec, face, size ); + + exec->callTop = 0; + exec->top = 0; + + exec->period = 64; + exec->phase = 0; + exec->threshold = 0; + + exec->instruction_trap = FALSE; + exec->F_dot_P = 0x10000L; + + { + FT_Size_Metrics* metrics = &exec->metrics; + TT_Size_Metrics* tt_metrics = &exec->tt_metrics; + + + metrics->x_ppem = 0; + metrics->y_ppem = 0; + metrics->x_scale = 0; + metrics->y_scale = 0; + + tt_metrics->ppem = 0; + tt_metrics->scale = 0; + tt_metrics->ratio = 0x10000L; + } + + /* allow font program execution */ + TT_Set_CodeRange( exec, + tt_coderange_font, + face->font_program, + face->font_program_size ); + + /* disable CVT and glyph programs coderange */ + TT_Clear_CodeRange( exec, tt_coderange_cvt ); + TT_Clear_CodeRange( exec, tt_coderange_glyph ); + + if ( face->font_program_size > 0 ) + { + error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); + + if ( !error ) + error = face->interpreter( exec ); + } + else + error = TT_Err_Ok; + + if ( !error ) + TT_Save_Context( exec, size ); + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_size_run_prep */ + /* */ + /* */ + /* Run the control value program. */ + /* */ + /* */ + /* size :: A handle to the size object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_size_run_prep( TT_Size size ) + { + TT_Face face = (TT_Face)size->root.face; + TT_ExecContext exec; + FT_Error error; + + + /* debugging instances have their own context */ + if ( size->debug ) + exec = size->context; + else + exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; + + if ( !exec ) + return TT_Err_Could_Not_Find_Context; + + TT_Load_Context( exec, face, size ); + + exec->callTop = 0; + exec->top = 0; + + exec->instruction_trap = FALSE; + + TT_Set_CodeRange( exec, + tt_coderange_cvt, + face->cvt_program, + face->cvt_program_size ); + + TT_Clear_CodeRange( exec, tt_coderange_glyph ); + + if ( face->cvt_program_size > 0 ) + { + error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); + + if ( !error && !size->debug ) + error = face->interpreter( exec ); + } + else + error = TT_Err_Ok; + + /* save as default graphics state */ + size->GS = exec->GS; + + TT_Save_Context( exec, size ); + + return error; + } + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + +#ifdef TT_USE_BYTECODE_INTERPRETER + + static void + tt_size_done_bytecode( FT_Size ftsize ) + { + TT_Size size = (TT_Size)ftsize; + TT_Face face = (TT_Face)ftsize->face; + FT_Memory memory = face->root.memory; + + + if ( size->debug ) + { + /* the debug context must be deleted by the debugger itself */ + size->context = NULL; + size->debug = FALSE; + } + + FT_FREE( size->cvt ); + size->cvt_size = 0; + + /* free storage area */ + FT_FREE( size->storage ); + size->storage_size = 0; + + /* twilight zone */ + tt_glyphzone_done( &size->twilight ); + + FT_FREE( size->function_defs ); + FT_FREE( size->instruction_defs ); + + size->num_function_defs = 0; + size->max_function_defs = 0; + size->num_instruction_defs = 0; + size->max_instruction_defs = 0; + + size->max_func = 0; + size->max_ins = 0; + + size->bytecode_ready = 0; + size->cvt_ready = 0; + } + + + /* Initialize bytecode-related fields in the size object. */ + /* We do this only if bytecode interpretation is really needed. */ + static FT_Error + tt_size_init_bytecode( FT_Size ftsize ) + { + FT_Error error; + TT_Size size = (TT_Size)ftsize; + TT_Face face = (TT_Face)ftsize->face; + FT_Memory memory = face->root.memory; + FT_Int i; + + FT_UShort n_twilight; + TT_MaxProfile* maxp = &face->max_profile; + + + size->bytecode_ready = 1; + size->cvt_ready = 0; + + size->max_function_defs = maxp->maxFunctionDefs; + size->max_instruction_defs = maxp->maxInstructionDefs; + + size->num_function_defs = 0; + size->num_instruction_defs = 0; + + size->max_func = 0; + size->max_ins = 0; + + size->cvt_size = face->cvt_size; + size->storage_size = maxp->maxStorage; + + /* Set default metrics */ + { + FT_Size_Metrics* metrics = &size->metrics; + TT_Size_Metrics* metrics2 = &size->ttmetrics; + + metrics->x_ppem = 0; + metrics->y_ppem = 0; + + metrics2->rotated = FALSE; + metrics2->stretched = FALSE; + + /* set default compensation (all 0) */ + for ( i = 0; i < 4; i++ ) + metrics2->compensations[i] = 0; + } + + /* allocate function defs, instruction defs, cvt, and storage area */ + if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) || + FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) || + FT_NEW_ARRAY( size->cvt, size->cvt_size ) || + FT_NEW_ARRAY( size->storage, size->storage_size ) ) + goto Exit; + + /* reserve twilight zone */ + n_twilight = maxp->maxTwilightPoints; + + /* there are 4 phantom points (do we need this?) */ + n_twilight += 4; + + error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight ); + if ( error ) + goto Exit; + + size->twilight.n_points = n_twilight; + + size->GS = tt_default_graphics_state; + + /* set `face->interpreter' according to the debug hook present */ + { + FT_Library library = face->root.driver->root.library; + + + face->interpreter = (TT_Interpreter) + library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE]; + if ( !face->interpreter ) + face->interpreter = (TT_Interpreter)TT_RunIns; + } + + /* Fine, now run the font program! */ + error = tt_size_run_fpgm( size ); + + Exit: + if ( error ) + tt_size_done_bytecode( ftsize ); + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + tt_size_ready_bytecode( TT_Size size ) + { + FT_Error error = TT_Err_Ok; + + + if ( !size->bytecode_ready ) + { + error = tt_size_init_bytecode( (FT_Size)size ); + if ( error ) + goto Exit; + } + + /* rescale CVT when needed */ + if ( !size->cvt_ready ) + { + FT_UInt i; + TT_Face face = (TT_Face) size->root.face; + + + /* Scale the cvt values to the new ppem. */ + /* We use by default the y ppem to scale the CVT. */ + for ( i = 0; i < size->cvt_size; i++ ) + size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); + + /* all twilight points are originally zero */ + for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ ) + { + size->twilight.org[i].x = 0; + size->twilight.org[i].y = 0; + size->twilight.cur[i].x = 0; + size->twilight.cur[i].y = 0; + } + + /* clear storage area */ + for ( i = 0; i < (FT_UInt)size->storage_size; i++ ) + size->storage[i] = 0; + + size->GS = tt_default_graphics_state; + + error = tt_size_run_prep( size ); + if ( !error ) + size->cvt_ready = 1; + } + Exit: + return error; + } + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + + /*************************************************************************/ + /* */ + /* */ + /* tt_size_init */ + /* */ + /* */ + /* Initialize a new TrueType size object. */ + /* */ + /* */ + /* size :: A handle to the size object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_size_init( FT_Size ttsize ) /* TT_Size */ + { + TT_Size size = (TT_Size)ttsize; + FT_Error error = TT_Err_Ok; + +#ifdef TT_USE_BYTECODE_INTERPRETER + size->bytecode_ready = 0; + size->cvt_ready = 0; +#endif + + size->ttmetrics.valid = FALSE; + size->strike_index = 0xFFFFFFFFUL; + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_size_done */ + /* */ + /* */ + /* The TrueType size object finalizer. */ + /* */ + /* */ + /* size :: A handle to the target size object. */ + /* */ + FT_LOCAL_DEF( void ) + tt_size_done( FT_Size ttsize ) /* TT_Size */ + { + TT_Size size = (TT_Size)ttsize; + + +#ifdef TT_USE_BYTECODE_INTERPRETER + if ( size->bytecode_ready ) + tt_size_done_bytecode( ttsize ); +#endif + + size->ttmetrics.valid = FALSE; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_size_reset */ + /* */ + /* */ + /* Reset a TrueType size when resolutions and character dimensions */ + /* have been changed. */ + /* */ + /* */ + /* size :: A handle to the target size object. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_size_reset( TT_Size size ) + { + TT_Face face; + FT_Error error = TT_Err_Ok; + FT_Size_Metrics* metrics; + + + size->ttmetrics.valid = FALSE; + + face = (TT_Face)size->root.face; + + metrics = &size->metrics; + + /* copy the result from base layer */ + *metrics = size->root.metrics; + + if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 ) + return TT_Err_Invalid_PPem; + + /* This bit flag, if set, indicates that the ppems must be */ + /* rounded to integers. Nearly all TrueType fonts have this bit */ + /* set, as hinting won't work really well otherwise. */ + /* */ + if ( face->header.Flags & 8 ) + { + metrics->x_scale = FT_DivFix( metrics->x_ppem << 6, + face->root.units_per_EM ); + metrics->y_scale = FT_DivFix( metrics->y_ppem << 6, + face->root.units_per_EM ); + + metrics->ascender = + FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) ); + metrics->descender = + FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) ); + metrics->height = + FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) ); + metrics->max_advance = + FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width, + metrics->x_scale ) ); + } + + /* compute new transformation */ + if ( metrics->x_ppem >= metrics->y_ppem ) + { + size->ttmetrics.scale = metrics->x_scale; + size->ttmetrics.ppem = metrics->x_ppem; + size->ttmetrics.x_ratio = 0x10000L; + size->ttmetrics.y_ratio = FT_MulDiv( metrics->y_ppem, + 0x10000L, + metrics->x_ppem ); + } + else + { + size->ttmetrics.scale = metrics->y_scale; + size->ttmetrics.ppem = metrics->y_ppem; + size->ttmetrics.x_ratio = FT_MulDiv( metrics->x_ppem, + 0x10000L, + metrics->y_ppem ); + size->ttmetrics.y_ratio = 0x10000L; + } + +#ifdef TT_USE_BYTECODE_INTERPRETER + size->cvt_ready = 0; +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + if ( !error ) + size->ttmetrics.valid = TRUE; + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_driver_init */ + /* */ + /* */ + /* Initialize a given TrueType driver object. */ + /* */ + /* */ + /* driver :: A handle to the target driver object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_driver_init( FT_Module ttdriver ) /* TT_Driver */ + { + +#ifdef TT_USE_BYTECODE_INTERPRETER + + TT_Driver driver = (TT_Driver)ttdriver; + + + if ( !TT_New_Context( driver ) ) + return TT_Err_Could_Not_Find_Context; + +#else + + FT_UNUSED( ttdriver ); + +#endif + + return TT_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_driver_done */ + /* */ + /* */ + /* Finalize a given TrueType driver. */ + /* */ + /* */ + /* driver :: A handle to the target TrueType driver. */ + /* */ + FT_LOCAL_DEF( void ) + tt_driver_done( FT_Module ttdriver ) /* TT_Driver */ + { +#ifdef TT_USE_BYTECODE_INTERPRETER + TT_Driver driver = (TT_Driver)ttdriver; + + + /* destroy the execution context */ + if ( driver->context ) + { + TT_Done_Context( driver->context ); + driver->context = NULL; + } +#else + FT_UNUSED( ttdriver ); +#endif + + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_slot_init */ + /* */ + /* */ + /* Initialize a new slot object. */ + /* */ + /* */ + /* slot :: A handle to the slot object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_slot_init( FT_GlyphSlot slot ) + { + return FT_GlyphLoader_CreateExtra( slot->internal->loader ); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.h b/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.h index 6971013af90..730021883cf 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.h +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttobjs.h @@ -1,459 +1,459 @@ -/***************************************************************************/ -/* */ -/* ttobjs.h */ -/* */ -/* Objects manager (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTOBJS_H__ -#define __TTOBJS_H__ - - -#include -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_TRUETYPE_TYPES_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Driver */ - /* */ - /* */ - /* A handle to a TrueType driver object. */ - /* */ - typedef struct TT_DriverRec_* TT_Driver; - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Instance */ - /* */ - /* */ - /* A handle to a TrueType size object. */ - /* */ - typedef struct TT_SizeRec_* TT_Size; - - - /*************************************************************************/ - /* */ - /* */ - /* TT_GlyphSlot */ - /* */ - /* */ - /* A handle to a TrueType glyph slot object. */ - /* */ - /* */ - /* This is a direct typedef of FT_GlyphSlot, as there is nothing */ - /* specific about the TrueType glyph slot. */ - /* */ - typedef FT_GlyphSlot TT_GlyphSlot; - - - /*************************************************************************/ - /* */ - /* */ - /* TT_GraphicsState */ - /* */ - /* */ - /* The TrueType graphics state used during bytecode interpretation. */ - /* */ - typedef struct TT_GraphicsState_ - { - FT_UShort rp0; - FT_UShort rp1; - FT_UShort rp2; - - FT_UnitVector dualVector; - FT_UnitVector projVector; - FT_UnitVector freeVector; - -#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING - FT_Bool both_x_axis; -#endif - - FT_Long loop; - FT_F26Dot6 minimum_distance; - FT_Int round_state; - - FT_Bool auto_flip; - FT_F26Dot6 control_value_cutin; - FT_F26Dot6 single_width_cutin; - FT_F26Dot6 single_width_value; - FT_Short delta_base; - FT_Short delta_shift; - - FT_Byte instruct_control; - FT_Bool scan_control; - FT_Int scan_type; - - FT_UShort gep0; - FT_UShort gep1; - FT_UShort gep2; - - } TT_GraphicsState; - - -#ifdef TT_USE_BYTECODE_INTERPRETER - - FT_LOCAL( void ) - tt_glyphzone_done( TT_GlyphZone zone ); - - FT_LOCAL( FT_Error ) - tt_glyphzone_new( FT_Memory memory, - FT_UShort maxPoints, - FT_Short maxContours, - TT_GlyphZone zone ); - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - - - /*************************************************************************/ - /* */ - /* EXECUTION SUBTABLES */ - /* */ - /* These sub-tables relate to instruction execution. */ - /* */ - /*************************************************************************/ - - -#define TT_MAX_CODE_RANGES 3 - - - /*************************************************************************/ - /* */ - /* There can only be 3 active code ranges at once: */ - /* - the Font Program */ - /* - the CVT Program */ - /* - a glyph's instructions set */ - /* */ - typedef enum TT_CodeRange_Tag_ - { - tt_coderange_none = 0, - tt_coderange_font, - tt_coderange_cvt, - tt_coderange_glyph - - } TT_CodeRange_Tag; - - - typedef struct TT_CodeRange_ - { - FT_Byte* base; - FT_ULong size; - - } TT_CodeRange; - - typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES]; - - - /*************************************************************************/ - /* */ - /* Defines a function/instruction definition record. */ - /* */ - typedef struct TT_DefRecord_ - { - FT_Int range; /* in which code range is it located? */ - FT_Long start; /* where does it start? */ - FT_UInt opc; /* function #, or instruction code */ - FT_Bool active; /* is it active? */ - - } TT_DefRecord, *TT_DefArray; - - - /*************************************************************************/ - /* */ - /* Subglyph transformation record. */ - /* */ - typedef struct TT_Transform_ - { - FT_Fixed xx, xy; /* transformation matrix coefficients */ - FT_Fixed yx, yy; - FT_F26Dot6 ox, oy; /* offsets */ - - } TT_Transform; - - - /*************************************************************************/ - /* */ - /* Subglyph loading record. Used to load composite components. */ - /* */ - typedef struct TT_SubglyphRec_ - { - FT_Long index; /* subglyph index; initialized with -1 */ - FT_Bool is_scaled; /* is the subglyph scaled? */ - FT_Bool is_hinted; /* should it be hinted? */ - FT_Bool preserve_pps; /* preserve phantom points? */ - - FT_Long file_offset; - - FT_BBox bbox; - FT_Pos left_bearing; - FT_Pos advance; - - TT_GlyphZoneRec zone; - - FT_Long arg1; /* first argument */ - FT_Long arg2; /* second argument */ - - FT_UShort element_flag; /* current load element flag */ - - TT_Transform transform; /* transformation matrix */ - - FT_Vector pp1, pp2; /* phantom points (horizontal) */ - FT_Vector pp3, pp4; /* phantom points (vertical) */ - - } TT_SubGlyphRec, *TT_SubGlyph_Stack; - - - /*************************************************************************/ - /* */ - /* A note regarding non-squared pixels: */ - /* */ - /* (This text will probably go into some docs at some time; for now, it */ - /* is kept here to explain some definitions in the TIns_Metrics */ - /* record). */ - /* */ - /* The CVT is a one-dimensional array containing values that control */ - /* certain important characteristics in a font, like the height of all */ - /* capitals, all lowercase letter, default spacing or stem width/height. */ - /* */ - /* These values are found in FUnits in the font file, and must be scaled */ - /* to pixel coordinates before being used by the CVT and glyph programs. */ - /* Unfortunately, when using distinct x and y resolutions (or distinct x */ - /* and y pointsizes), there are two possible scalings. */ - /* */ - /* A first try was to implement a `lazy' scheme where all values were */ - /* scaled when first used. However, while some values are always used */ - /* in the same direction, some others are used under many different */ - /* circumstances and orientations. */ - /* */ - /* I have found a simpler way to do the same, and it even seems to work */ - /* in most of the cases: */ - /* */ - /* - All CVT values are scaled to the maximum ppem size. */ - /* */ - /* - When performing a read or write in the CVT, a ratio factor is used */ - /* to perform adequate scaling. Example: */ - /* */ - /* x_ppem = 14 */ - /* y_ppem = 10 */ - /* */ - /* We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt */ - /* entries are scaled to it. */ - /* */ - /* x_ratio = 1.0 */ - /* y_ratio = y_ppem/ppem (< 1.0) */ - /* */ - /* We compute the current ratio like: */ - /* */ - /* - If projVector is horizontal, */ - /* ratio = x_ratio = 1.0 */ - /* */ - /* - if projVector is vertical, */ - /* ratio = y_ratio */ - /* */ - /* - else, */ - /* ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 ) */ - /* */ - /* Reading a cvt value returns */ - /* ratio * cvt[index] */ - /* */ - /* Writing a cvt value in pixels: */ - /* cvt[index] / ratio */ - /* */ - /* The current ppem is simply */ - /* ratio * ppem */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* Metrics used by the TrueType size and context objects. */ - /* */ - typedef struct TT_Size_Metrics_ - { - /* for non-square pixels */ - FT_Long x_ratio; - FT_Long y_ratio; - - FT_UShort ppem; /* maximum ppem size */ - FT_Long ratio; /* current ratio */ - FT_Fixed scale; - - FT_F26Dot6 compensations[4]; /* device-specific compensations */ - - FT_Bool valid; - - FT_Bool rotated; /* `is the glyph rotated?'-flag */ - FT_Bool stretched; /* `is the glyph stretched?'-flag */ - - } TT_Size_Metrics; - - - /*************************************************************************/ - /* */ - /* TrueType size class. */ - /* */ - typedef struct TT_SizeRec_ - { - FT_SizeRec root; - - /* we have our own copy of metrics so that we can modify */ - /* it without affecting auto-hinting (when used) */ - FT_Size_Metrics metrics; - - TT_Size_Metrics ttmetrics; - - FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */ - -#ifdef TT_USE_BYTECODE_INTERPRETER - - FT_UInt num_function_defs; /* number of function definitions */ - FT_UInt max_function_defs; - TT_DefArray function_defs; /* table of function definitions */ - - FT_UInt num_instruction_defs; /* number of ins. definitions */ - FT_UInt max_instruction_defs; - TT_DefArray instruction_defs; /* table of ins. definitions */ - - FT_UInt max_func; - FT_UInt max_ins; - - TT_CodeRangeTable codeRangeTable; - - TT_GraphicsState GS; - - FT_ULong cvt_size; /* the scaled control value table */ - FT_Long* cvt; - - FT_UShort storage_size; /* The storage area is now part of */ - FT_Long* storage; /* the instance */ - - TT_GlyphZoneRec twilight; /* The instance's twilight zone */ - - /* debugging variables */ - - /* When using the debugger, we must keep the */ - /* execution context tied to the instance */ - /* object rather than asking it on demand. */ - - FT_Bool debug; - TT_ExecContext context; - - FT_Bool bytecode_ready; - FT_Bool cvt_ready; - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - } TT_SizeRec; - - - /*************************************************************************/ - /* */ - /* TrueType driver class. */ - /* */ - typedef struct TT_DriverRec_ - { - FT_DriverRec root; - TT_ExecContext context; /* execution context */ - TT_GlyphZoneRec zone; /* glyph loader points zone */ - - void* extension_component; - - } TT_DriverRec; - - - /* Note: All of the functions below (except tt_size_reset()) are used */ - /* as function pointers in a FT_Driver_ClassRec. Therefore their */ - /* parameters are of types FT_Face, FT_Size, etc., rather than TT_Face, */ - /* TT_Size, etc., so that the compiler can confirm that the types and */ - /* number of parameters are correct. In all cases the FT_xxx types are */ - /* cast to their TT_xxx counterparts inside the functions since FreeType */ - /* will always use the TT driver to create them. */ - - - /*************************************************************************/ - /* */ - /* Face functions */ - /* */ - FT_LOCAL( FT_Error ) - tt_face_init( FT_Stream stream, - FT_Face ttface, /* TT_Face */ - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ); - - FT_LOCAL( void ) - tt_face_done( FT_Face ttface ); /* TT_Face */ - - - /*************************************************************************/ - /* */ - /* Size functions */ - /* */ - FT_LOCAL( FT_Error ) - tt_size_init( FT_Size ttsize ); /* TT_Size */ - - FT_LOCAL( void ) - tt_size_done( FT_Size ttsize ); /* TT_Size */ - -#ifdef TT_USE_BYTECODE_INTERPRETER - - FT_LOCAL( FT_Error ) - tt_size_run_fpgm( TT_Size size ); - - FT_LOCAL( FT_Error ) - tt_size_run_prep( TT_Size size ); - - FT_LOCAL( FT_Error ) - tt_size_ready_bytecode( TT_Size size ); - -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - FT_LOCAL( FT_Error ) - tt_size_reset( TT_Size size ); - - - /*************************************************************************/ - /* */ - /* Driver functions */ - /* */ - FT_LOCAL( FT_Error ) - tt_driver_init( FT_Module ttdriver ); /* TT_Driver */ - - FT_LOCAL( void ) - tt_driver_done( FT_Module ttdriver ); /* TT_Driver */ - - - /*************************************************************************/ - /* */ - /* Slot functions */ - /* */ - FT_LOCAL( FT_Error ) - tt_slot_init( FT_GlyphSlot slot ); - - -FT_END_HEADER - -#endif /* __TTOBJS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttobjs.h */ +/* */ +/* Objects manager (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTOBJS_H__ +#define __TTOBJS_H__ + + +#include +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Driver */ + /* */ + /* */ + /* A handle to a TrueType driver object. */ + /* */ + typedef struct TT_DriverRec_* TT_Driver; + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Instance */ + /* */ + /* */ + /* A handle to a TrueType size object. */ + /* */ + typedef struct TT_SizeRec_* TT_Size; + + + /*************************************************************************/ + /* */ + /* */ + /* TT_GlyphSlot */ + /* */ + /* */ + /* A handle to a TrueType glyph slot object. */ + /* */ + /* */ + /* This is a direct typedef of FT_GlyphSlot, as there is nothing */ + /* specific about the TrueType glyph slot. */ + /* */ + typedef FT_GlyphSlot TT_GlyphSlot; + + + /*************************************************************************/ + /* */ + /* */ + /* TT_GraphicsState */ + /* */ + /* */ + /* The TrueType graphics state used during bytecode interpretation. */ + /* */ + typedef struct TT_GraphicsState_ + { + FT_UShort rp0; + FT_UShort rp1; + FT_UShort rp2; + + FT_UnitVector dualVector; + FT_UnitVector projVector; + FT_UnitVector freeVector; + +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING + FT_Bool both_x_axis; +#endif + + FT_Long loop; + FT_F26Dot6 minimum_distance; + FT_Int round_state; + + FT_Bool auto_flip; + FT_F26Dot6 control_value_cutin; + FT_F26Dot6 single_width_cutin; + FT_F26Dot6 single_width_value; + FT_Short delta_base; + FT_Short delta_shift; + + FT_Byte instruct_control; + FT_Bool scan_control; + FT_Int scan_type; + + FT_UShort gep0; + FT_UShort gep1; + FT_UShort gep2; + + } TT_GraphicsState; + + +#ifdef TT_USE_BYTECODE_INTERPRETER + + FT_LOCAL( void ) + tt_glyphzone_done( TT_GlyphZone zone ); + + FT_LOCAL( FT_Error ) + tt_glyphzone_new( FT_Memory memory, + FT_UShort maxPoints, + FT_Short maxContours, + TT_GlyphZone zone ); + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + + + /*************************************************************************/ + /* */ + /* EXECUTION SUBTABLES */ + /* */ + /* These sub-tables relate to instruction execution. */ + /* */ + /*************************************************************************/ + + +#define TT_MAX_CODE_RANGES 3 + + + /*************************************************************************/ + /* */ + /* There can only be 3 active code ranges at once: */ + /* - the Font Program */ + /* - the CVT Program */ + /* - a glyph's instructions set */ + /* */ + typedef enum TT_CodeRange_Tag_ + { + tt_coderange_none = 0, + tt_coderange_font, + tt_coderange_cvt, + tt_coderange_glyph + + } TT_CodeRange_Tag; + + + typedef struct TT_CodeRange_ + { + FT_Byte* base; + FT_ULong size; + + } TT_CodeRange; + + typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES]; + + + /*************************************************************************/ + /* */ + /* Defines a function/instruction definition record. */ + /* */ + typedef struct TT_DefRecord_ + { + FT_Int range; /* in which code range is it located? */ + FT_Long start; /* where does it start? */ + FT_UInt opc; /* function #, or instruction code */ + FT_Bool active; /* is it active? */ + + } TT_DefRecord, *TT_DefArray; + + + /*************************************************************************/ + /* */ + /* Subglyph transformation record. */ + /* */ + typedef struct TT_Transform_ + { + FT_Fixed xx, xy; /* transformation matrix coefficients */ + FT_Fixed yx, yy; + FT_F26Dot6 ox, oy; /* offsets */ + + } TT_Transform; + + + /*************************************************************************/ + /* */ + /* Subglyph loading record. Used to load composite components. */ + /* */ + typedef struct TT_SubglyphRec_ + { + FT_Long index; /* subglyph index; initialized with -1 */ + FT_Bool is_scaled; /* is the subglyph scaled? */ + FT_Bool is_hinted; /* should it be hinted? */ + FT_Bool preserve_pps; /* preserve phantom points? */ + + FT_Long file_offset; + + FT_BBox bbox; + FT_Pos left_bearing; + FT_Pos advance; + + TT_GlyphZoneRec zone; + + FT_Long arg1; /* first argument */ + FT_Long arg2; /* second argument */ + + FT_UShort element_flag; /* current load element flag */ + + TT_Transform transform; /* transformation matrix */ + + FT_Vector pp1, pp2; /* phantom points (horizontal) */ + FT_Vector pp3, pp4; /* phantom points (vertical) */ + + } TT_SubGlyphRec, *TT_SubGlyph_Stack; + + + /*************************************************************************/ + /* */ + /* A note regarding non-squared pixels: */ + /* */ + /* (This text will probably go into some docs at some time; for now, it */ + /* is kept here to explain some definitions in the TIns_Metrics */ + /* record). */ + /* */ + /* The CVT is a one-dimensional array containing values that control */ + /* certain important characteristics in a font, like the height of all */ + /* capitals, all lowercase letter, default spacing or stem width/height. */ + /* */ + /* These values are found in FUnits in the font file, and must be scaled */ + /* to pixel coordinates before being used by the CVT and glyph programs. */ + /* Unfortunately, when using distinct x and y resolutions (or distinct x */ + /* and y pointsizes), there are two possible scalings. */ + /* */ + /* A first try was to implement a `lazy' scheme where all values were */ + /* scaled when first used. However, while some values are always used */ + /* in the same direction, some others are used under many different */ + /* circumstances and orientations. */ + /* */ + /* I have found a simpler way to do the same, and it even seems to work */ + /* in most of the cases: */ + /* */ + /* - All CVT values are scaled to the maximum ppem size. */ + /* */ + /* - When performing a read or write in the CVT, a ratio factor is used */ + /* to perform adequate scaling. Example: */ + /* */ + /* x_ppem = 14 */ + /* y_ppem = 10 */ + /* */ + /* We choose ppem = x_ppem = 14 as the CVT scaling size. All cvt */ + /* entries are scaled to it. */ + /* */ + /* x_ratio = 1.0 */ + /* y_ratio = y_ppem/ppem (< 1.0) */ + /* */ + /* We compute the current ratio like: */ + /* */ + /* - If projVector is horizontal, */ + /* ratio = x_ratio = 1.0 */ + /* */ + /* - if projVector is vertical, */ + /* ratio = y_ratio */ + /* */ + /* - else, */ + /* ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 ) */ + /* */ + /* Reading a cvt value returns */ + /* ratio * cvt[index] */ + /* */ + /* Writing a cvt value in pixels: */ + /* cvt[index] / ratio */ + /* */ + /* The current ppem is simply */ + /* ratio * ppem */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Metrics used by the TrueType size and context objects. */ + /* */ + typedef struct TT_Size_Metrics_ + { + /* for non-square pixels */ + FT_Long x_ratio; + FT_Long y_ratio; + + FT_UShort ppem; /* maximum ppem size */ + FT_Long ratio; /* current ratio */ + FT_Fixed scale; + + FT_F26Dot6 compensations[4]; /* device-specific compensations */ + + FT_Bool valid; + + FT_Bool rotated; /* `is the glyph rotated?'-flag */ + FT_Bool stretched; /* `is the glyph stretched?'-flag */ + + } TT_Size_Metrics; + + + /*************************************************************************/ + /* */ + /* TrueType size class. */ + /* */ + typedef struct TT_SizeRec_ + { + FT_SizeRec root; + + /* we have our own copy of metrics so that we can modify */ + /* it without affecting auto-hinting (when used) */ + FT_Size_Metrics metrics; + + TT_Size_Metrics ttmetrics; + + FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */ + +#ifdef TT_USE_BYTECODE_INTERPRETER + + FT_UInt num_function_defs; /* number of function definitions */ + FT_UInt max_function_defs; + TT_DefArray function_defs; /* table of function definitions */ + + FT_UInt num_instruction_defs; /* number of ins. definitions */ + FT_UInt max_instruction_defs; + TT_DefArray instruction_defs; /* table of ins. definitions */ + + FT_UInt max_func; + FT_UInt max_ins; + + TT_CodeRangeTable codeRangeTable; + + TT_GraphicsState GS; + + FT_ULong cvt_size; /* the scaled control value table */ + FT_Long* cvt; + + FT_UShort storage_size; /* The storage area is now part of */ + FT_Long* storage; /* the instance */ + + TT_GlyphZoneRec twilight; /* The instance's twilight zone */ + + /* debugging variables */ + + /* When using the debugger, we must keep the */ + /* execution context tied to the instance */ + /* object rather than asking it on demand. */ + + FT_Bool debug; + TT_ExecContext context; + + FT_Bool bytecode_ready; + FT_Bool cvt_ready; + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + } TT_SizeRec; + + + /*************************************************************************/ + /* */ + /* TrueType driver class. */ + /* */ + typedef struct TT_DriverRec_ + { + FT_DriverRec root; + TT_ExecContext context; /* execution context */ + TT_GlyphZoneRec zone; /* glyph loader points zone */ + + void* extension_component; + + } TT_DriverRec; + + + /* Note: All of the functions below (except tt_size_reset()) are used */ + /* as function pointers in a FT_Driver_ClassRec. Therefore their */ + /* parameters are of types FT_Face, FT_Size, etc., rather than TT_Face, */ + /* TT_Size, etc., so that the compiler can confirm that the types and */ + /* number of parameters are correct. In all cases the FT_xxx types are */ + /* cast to their TT_xxx counterparts inside the functions since FreeType */ + /* will always use the TT driver to create them. */ + + + /*************************************************************************/ + /* */ + /* Face functions */ + /* */ + FT_LOCAL( FT_Error ) + tt_face_init( FT_Stream stream, + FT_Face ttface, /* TT_Face */ + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); + + FT_LOCAL( void ) + tt_face_done( FT_Face ttface ); /* TT_Face */ + + + /*************************************************************************/ + /* */ + /* Size functions */ + /* */ + FT_LOCAL( FT_Error ) + tt_size_init( FT_Size ttsize ); /* TT_Size */ + + FT_LOCAL( void ) + tt_size_done( FT_Size ttsize ); /* TT_Size */ + +#ifdef TT_USE_BYTECODE_INTERPRETER + + FT_LOCAL( FT_Error ) + tt_size_run_fpgm( TT_Size size ); + + FT_LOCAL( FT_Error ) + tt_size_run_prep( TT_Size size ); + + FT_LOCAL( FT_Error ) + tt_size_ready_bytecode( TT_Size size ); + +#endif /* TT_USE_BYTECODE_INTERPRETER */ + + FT_LOCAL( FT_Error ) + tt_size_reset( TT_Size size ); + + + /*************************************************************************/ + /* */ + /* Driver functions */ + /* */ + FT_LOCAL( FT_Error ) + tt_driver_init( FT_Module ttdriver ); /* TT_Driver */ + + FT_LOCAL( void ) + tt_driver_done( FT_Module ttdriver ); /* TT_Driver */ + + + /*************************************************************************/ + /* */ + /* Slot functions */ + /* */ + FT_LOCAL( FT_Error ) + tt_slot_init( FT_GlyphSlot slot ); + + +FT_END_HEADER + +#endif /* __TTOBJS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttpload.c b/reactos/dll/3rdparty/freetype/src/truetype/ttpload.c index 9d3381bf056..233d114d369 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttpload.c +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttpload.c @@ -1,523 +1,523 @@ -/***************************************************************************/ -/* */ -/* ttpload.c */ -/* */ -/* TrueType-specific tables loader (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H - -#include "ttpload.h" - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include "ttgxvar.h" -#endif - -#include "tterrors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_ttpload - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_loca */ - /* */ - /* */ - /* Load the locations table. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* */ - /* stream :: The input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_loca( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - FT_ULong table_len; - - - /* we need the size of the `glyf' table for malformed `loca' tables */ - error = face->goto_table( face, TTAG_glyf, stream, &face->glyf_len ); - if ( error ) - goto Exit; - - FT_TRACE2(( "Locations " )); - error = face->goto_table( face, TTAG_loca, stream, &table_len ); - if ( error ) - { - error = TT_Err_Locations_Missing; - goto Exit; - } - - if ( face->header.Index_To_Loc_Format != 0 ) - { - if ( table_len >= 0x40000L ) - { - FT_TRACE2(( "table too large!\n" )); - error = TT_Err_Invalid_Table; - goto Exit; - } - face->num_locations = (FT_UInt)( table_len >> 2 ); - } - else - { - if ( table_len >= 0x20000L ) - { - FT_TRACE2(( "table too large!\n" )); - error = TT_Err_Invalid_Table; - goto Exit; - } - face->num_locations = (FT_UInt)( table_len >> 1 ); - } - - /* - * Extract the frame. We don't need to decompress it since - * we are able to parse it directly. - */ - if ( FT_FRAME_EXTRACT( table_len, face->glyph_locations ) ) - goto Exit; - - FT_TRACE2(( "loaded\n" )); - - Exit: - return error; - } - - - FT_LOCAL_DEF( FT_ULong ) - tt_face_get_location( TT_Face face, - FT_UInt gindex, - FT_UInt *asize ) - { - FT_ULong pos1, pos2; - FT_Byte* p; - FT_Byte* p_limit; - - - pos1 = pos2 = 0; - - if ( gindex < face->num_locations ) - { - if ( face->header.Index_To_Loc_Format != 0 ) - { - p = face->glyph_locations + gindex * 4; - p_limit = face->glyph_locations + face->num_locations * 4; - - pos1 = FT_NEXT_ULONG( p ); - pos2 = pos1; - - if ( p + 4 <= p_limit ) - pos2 = FT_NEXT_ULONG( p ); - } - else - { - p = face->glyph_locations + gindex * 2; - p_limit = face->glyph_locations + face->num_locations * 2; - - pos1 = FT_NEXT_USHORT( p ); - pos2 = pos1; - - if ( p + 2 <= p_limit ) - pos2 = FT_NEXT_USHORT( p ); - - pos1 <<= 1; - pos2 <<= 1; - } - } - - /* It isn't mentioned explicitly that the `loca' table must be */ - /* ordered, but implicitly it refers to the length of an entry */ - /* as the difference between the current and the next position. */ - /* Anyway, there do exist (malformed) fonts which don't obey */ - /* this rule, so we are only able to provide an upper bound for */ - /* the size. */ - if ( pos2 >= pos1 ) - *asize = (FT_UInt)( pos2 - pos1 ); - else - *asize = (FT_UInt)( face->glyf_len - pos1 ); - - return pos1; - } - - - FT_LOCAL_DEF( void ) - tt_face_done_loca( TT_Face face ) - { - FT_Stream stream = face->root.stream; - - - FT_FRAME_RELEASE( face->glyph_locations ); - face->num_locations = 0; - } - - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_cvt */ - /* */ - /* */ - /* Load the control value table into a face object. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_cvt( TT_Face face, - FT_Stream stream ) - { -#ifdef TT_USE_BYTECODE_INTERPRETER - - FT_Error error; - FT_Memory memory = stream->memory; - FT_ULong table_len; - - - FT_TRACE2(( "CVT " )); - - error = face->goto_table( face, TTAG_cvt, stream, &table_len ); - if ( error ) - { - FT_TRACE2(( "is missing!\n" )); - - face->cvt_size = 0; - face->cvt = NULL; - error = TT_Err_Ok; - - goto Exit; - } - - face->cvt_size = table_len / 2; - - if ( FT_NEW_ARRAY( face->cvt, face->cvt_size ) ) - goto Exit; - - if ( FT_FRAME_ENTER( face->cvt_size * 2L ) ) - goto Exit; - - { - FT_Short* cur = face->cvt; - FT_Short* limit = cur + face->cvt_size; - - - for ( ; cur < limit; cur++ ) - *cur = FT_GET_SHORT(); - } - - FT_FRAME_EXIT(); - FT_TRACE2(( "loaded\n" )); - -#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - if ( face->doblend ) - error = tt_face_vary_cvt( face, stream ); -#endif - - Exit: - return error; - -#else /* !TT_USE_BYTECODE_INTERPRETER */ - - FT_UNUSED( face ); - FT_UNUSED( stream ); - - return TT_Err_Ok; - -#endif - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_fpgm */ - /* */ - /* */ - /* Load the font program. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_fpgm( TT_Face face, - FT_Stream stream ) - { -#ifdef TT_USE_BYTECODE_INTERPRETER - - FT_Error error; - FT_ULong table_len; - - - FT_TRACE2(( "Font program " )); - - /* The font program is optional */ - error = face->goto_table( face, TTAG_fpgm, stream, &table_len ); - if ( error ) - { - face->font_program = NULL; - face->font_program_size = 0; - error = TT_Err_Ok; - - FT_TRACE2(( "is missing!\n" )); - } - else - { - face->font_program_size = table_len; - if ( FT_FRAME_EXTRACT( table_len, face->font_program ) ) - goto Exit; - - FT_TRACE2(( "loaded, %12d bytes\n", face->font_program_size )); - } - - Exit: - return error; - -#else /* !TT_USE_BYTECODE_INTERPRETER */ - - FT_UNUSED( face ); - FT_UNUSED( stream ); - - return TT_Err_Ok; - -#endif - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_prep */ - /* */ - /* */ - /* Load the cvt program. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - tt_face_load_prep( TT_Face face, - FT_Stream stream ) - { -#ifdef TT_USE_BYTECODE_INTERPRETER - - FT_Error error; - FT_ULong table_len; - - - FT_TRACE2(( "Prep program " )); - - error = face->goto_table( face, TTAG_prep, stream, &table_len ); - if ( error ) - { - face->cvt_program = NULL; - face->cvt_program_size = 0; - error = TT_Err_Ok; - - FT_TRACE2(( "is missing!\n" )); - } - else - { - face->cvt_program_size = table_len; - if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) ) - goto Exit; - - FT_TRACE2(( "loaded, %12d bytes\n", face->cvt_program_size )); - } - - Exit: - return error; - -#else /* !TT_USE_BYTECODE_INTERPRETER */ - - FT_UNUSED( face ); - FT_UNUSED( stream ); - - return TT_Err_Ok; - -#endif - } - - - /*************************************************************************/ - /* */ - /* */ - /* tt_face_load_hdmx */ - /* */ - /* */ - /* Load the `hdmx' table into the face object. */ - /* */ - /* */ - /* face :: A handle to the target face object. */ - /* */ - /* stream :: A handle to the input stream. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - - FT_LOCAL_DEF( FT_Error ) - tt_face_load_hdmx( TT_Face face, - FT_Stream stream ) - { - FT_Error error; - FT_Memory memory = stream->memory; - FT_UInt version, nn, num_records; - FT_ULong table_size, record_size; - FT_Byte* p; - FT_Byte* limit; - - - /* this table is optional */ - error = face->goto_table( face, TTAG_hdmx, stream, &table_size ); - if ( error || table_size < 8 ) - return TT_Err_Ok; - - if ( FT_FRAME_EXTRACT( table_size, face->hdmx_table ) ) - goto Exit; - - p = face->hdmx_table; - limit = p + table_size; - - version = FT_NEXT_USHORT( p ); - num_records = FT_NEXT_USHORT( p ); - record_size = FT_NEXT_ULONG( p ); - - /* The maximum number of bytes in an hdmx device record is the */ - /* maximum number of glyphs + 2; this is 0xFFFF + 2; this is */ - /* the reason why `record_size' is a long (which we read as */ - /* unsigned long for convenience). In practice, two bytes */ - /* sufficient to hold the size value. */ - /* */ - /* There are at least two fonts, HANNOM-A and HANNOM-B version */ - /* 2.0 (2005), which get this wrong: The upper two bytes of */ - /* the size value are set to 0xFF instead of 0x00. We catch */ - /* and fix this. */ - - if ( record_size >= 0xFFFF0000UL ) - record_size &= 0xFFFFU; - - /* The limit for `num_records' is a heuristic value. */ - - if ( version != 0 || num_records > 255 || record_size > 0x10001L ) - { - error = TT_Err_Invalid_File_Format; - goto Fail; - } - - if ( FT_NEW_ARRAY( face->hdmx_record_sizes, num_records ) ) - goto Fail; - - for ( nn = 0; nn < num_records; nn++ ) - { - if ( p + record_size > limit ) - break; - - face->hdmx_record_sizes[nn] = p[0]; - p += record_size; - } - - face->hdmx_record_count = nn; - face->hdmx_table_size = table_size; - face->hdmx_record_size = record_size; - - Exit: - return error; - - Fail: - FT_FRAME_RELEASE( face->hdmx_table ); - face->hdmx_table_size = 0; - goto Exit; - } - - - FT_LOCAL_DEF( void ) - tt_face_free_hdmx( TT_Face face ) - { - FT_Stream stream = face->root.stream; - FT_Memory memory = stream->memory; - - - FT_FREE( face->hdmx_record_sizes ); - FT_FRAME_RELEASE( face->hdmx_table ); - } - - - /*************************************************************************/ - /* */ - /* Return the advance width table for a given pixel size if it is found */ - /* in the font's `hdmx' table (if any). */ - /* */ - FT_LOCAL_DEF( FT_Byte* ) - tt_face_get_device_metrics( TT_Face face, - FT_UInt ppem, - FT_UInt gindex ) - { - FT_UInt nn; - FT_Byte* result = NULL; - FT_ULong record_size = face->hdmx_record_size; - FT_Byte* record = face->hdmx_table + 8; - - - for ( nn = 0; nn < face->hdmx_record_count; nn++ ) - if ( face->hdmx_record_sizes[nn] == ppem ) - { - gindex += 2; - if ( gindex < record_size ) - result = record + nn * record_size + gindex; - break; - } - - return result; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* ttpload.c */ +/* */ +/* TrueType-specific tables loader (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H + +#include "ttpload.h" + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#include "ttgxvar.h" +#endif + +#include "tterrors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_ttpload + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_loca */ + /* */ + /* */ + /* Load the locations table. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* */ + /* stream :: The input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_loca( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + FT_ULong table_len; + + + /* we need the size of the `glyf' table for malformed `loca' tables */ + error = face->goto_table( face, TTAG_glyf, stream, &face->glyf_len ); + if ( error ) + goto Exit; + + FT_TRACE2(( "Locations " )); + error = face->goto_table( face, TTAG_loca, stream, &table_len ); + if ( error ) + { + error = TT_Err_Locations_Missing; + goto Exit; + } + + if ( face->header.Index_To_Loc_Format != 0 ) + { + if ( table_len >= 0x40000L ) + { + FT_TRACE2(( "table too large!\n" )); + error = TT_Err_Invalid_Table; + goto Exit; + } + face->num_locations = (FT_UInt)( table_len >> 2 ); + } + else + { + if ( table_len >= 0x20000L ) + { + FT_TRACE2(( "table too large!\n" )); + error = TT_Err_Invalid_Table; + goto Exit; + } + face->num_locations = (FT_UInt)( table_len >> 1 ); + } + + /* + * Extract the frame. We don't need to decompress it since + * we are able to parse it directly. + */ + if ( FT_FRAME_EXTRACT( table_len, face->glyph_locations ) ) + goto Exit; + + FT_TRACE2(( "loaded\n" )); + + Exit: + return error; + } + + + FT_LOCAL_DEF( FT_ULong ) + tt_face_get_location( TT_Face face, + FT_UInt gindex, + FT_UInt *asize ) + { + FT_ULong pos1, pos2; + FT_Byte* p; + FT_Byte* p_limit; + + + pos1 = pos2 = 0; + + if ( gindex < face->num_locations ) + { + if ( face->header.Index_To_Loc_Format != 0 ) + { + p = face->glyph_locations + gindex * 4; + p_limit = face->glyph_locations + face->num_locations * 4; + + pos1 = FT_NEXT_ULONG( p ); + pos2 = pos1; + + if ( p + 4 <= p_limit ) + pos2 = FT_NEXT_ULONG( p ); + } + else + { + p = face->glyph_locations + gindex * 2; + p_limit = face->glyph_locations + face->num_locations * 2; + + pos1 = FT_NEXT_USHORT( p ); + pos2 = pos1; + + if ( p + 2 <= p_limit ) + pos2 = FT_NEXT_USHORT( p ); + + pos1 <<= 1; + pos2 <<= 1; + } + } + + /* It isn't mentioned explicitly that the `loca' table must be */ + /* ordered, but implicitly it refers to the length of an entry */ + /* as the difference between the current and the next position. */ + /* Anyway, there do exist (malformed) fonts which don't obey */ + /* this rule, so we are only able to provide an upper bound for */ + /* the size. */ + if ( pos2 >= pos1 ) + *asize = (FT_UInt)( pos2 - pos1 ); + else + *asize = (FT_UInt)( face->glyf_len - pos1 ); + + return pos1; + } + + + FT_LOCAL_DEF( void ) + tt_face_done_loca( TT_Face face ) + { + FT_Stream stream = face->root.stream; + + + FT_FRAME_RELEASE( face->glyph_locations ); + face->num_locations = 0; + } + + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_cvt */ + /* */ + /* */ + /* Load the control value table into a face object. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_cvt( TT_Face face, + FT_Stream stream ) + { +#ifdef TT_USE_BYTECODE_INTERPRETER + + FT_Error error; + FT_Memory memory = stream->memory; + FT_ULong table_len; + + + FT_TRACE2(( "CVT " )); + + error = face->goto_table( face, TTAG_cvt, stream, &table_len ); + if ( error ) + { + FT_TRACE2(( "is missing!\n" )); + + face->cvt_size = 0; + face->cvt = NULL; + error = TT_Err_Ok; + + goto Exit; + } + + face->cvt_size = table_len / 2; + + if ( FT_NEW_ARRAY( face->cvt, face->cvt_size ) ) + goto Exit; + + if ( FT_FRAME_ENTER( face->cvt_size * 2L ) ) + goto Exit; + + { + FT_Short* cur = face->cvt; + FT_Short* limit = cur + face->cvt_size; + + + for ( ; cur < limit; cur++ ) + *cur = FT_GET_SHORT(); + } + + FT_FRAME_EXIT(); + FT_TRACE2(( "loaded\n" )); + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + if ( face->doblend ) + error = tt_face_vary_cvt( face, stream ); +#endif + + Exit: + return error; + +#else /* !TT_USE_BYTECODE_INTERPRETER */ + + FT_UNUSED( face ); + FT_UNUSED( stream ); + + return TT_Err_Ok; + +#endif + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_fpgm */ + /* */ + /* */ + /* Load the font program. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_fpgm( TT_Face face, + FT_Stream stream ) + { +#ifdef TT_USE_BYTECODE_INTERPRETER + + FT_Error error; + FT_ULong table_len; + + + FT_TRACE2(( "Font program " )); + + /* The font program is optional */ + error = face->goto_table( face, TTAG_fpgm, stream, &table_len ); + if ( error ) + { + face->font_program = NULL; + face->font_program_size = 0; + error = TT_Err_Ok; + + FT_TRACE2(( "is missing!\n" )); + } + else + { + face->font_program_size = table_len; + if ( FT_FRAME_EXTRACT( table_len, face->font_program ) ) + goto Exit; + + FT_TRACE2(( "loaded, %12d bytes\n", face->font_program_size )); + } + + Exit: + return error; + +#else /* !TT_USE_BYTECODE_INTERPRETER */ + + FT_UNUSED( face ); + FT_UNUSED( stream ); + + return TT_Err_Ok; + +#endif + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_prep */ + /* */ + /* */ + /* Load the cvt program. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + tt_face_load_prep( TT_Face face, + FT_Stream stream ) + { +#ifdef TT_USE_BYTECODE_INTERPRETER + + FT_Error error; + FT_ULong table_len; + + + FT_TRACE2(( "Prep program " )); + + error = face->goto_table( face, TTAG_prep, stream, &table_len ); + if ( error ) + { + face->cvt_program = NULL; + face->cvt_program_size = 0; + error = TT_Err_Ok; + + FT_TRACE2(( "is missing!\n" )); + } + else + { + face->cvt_program_size = table_len; + if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) ) + goto Exit; + + FT_TRACE2(( "loaded, %12d bytes\n", face->cvt_program_size )); + } + + Exit: + return error; + +#else /* !TT_USE_BYTECODE_INTERPRETER */ + + FT_UNUSED( face ); + FT_UNUSED( stream ); + + return TT_Err_Ok; + +#endif + } + + + /*************************************************************************/ + /* */ + /* */ + /* tt_face_load_hdmx */ + /* */ + /* */ + /* Load the `hdmx' table into the face object. */ + /* */ + /* */ + /* face :: A handle to the target face object. */ + /* */ + /* stream :: A handle to the input stream. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_hdmx( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + FT_Memory memory = stream->memory; + FT_UInt version, nn, num_records; + FT_ULong table_size, record_size; + FT_Byte* p; + FT_Byte* limit; + + + /* this table is optional */ + error = face->goto_table( face, TTAG_hdmx, stream, &table_size ); + if ( error || table_size < 8 ) + return TT_Err_Ok; + + if ( FT_FRAME_EXTRACT( table_size, face->hdmx_table ) ) + goto Exit; + + p = face->hdmx_table; + limit = p + table_size; + + version = FT_NEXT_USHORT( p ); + num_records = FT_NEXT_USHORT( p ); + record_size = FT_NEXT_ULONG( p ); + + /* The maximum number of bytes in an hdmx device record is the */ + /* maximum number of glyphs + 2; this is 0xFFFF + 2; this is */ + /* the reason why `record_size' is a long (which we read as */ + /* unsigned long for convenience). In practice, two bytes */ + /* sufficient to hold the size value. */ + /* */ + /* There are at least two fonts, HANNOM-A and HANNOM-B version */ + /* 2.0 (2005), which get this wrong: The upper two bytes of */ + /* the size value are set to 0xFF instead of 0x00. We catch */ + /* and fix this. */ + + if ( record_size >= 0xFFFF0000UL ) + record_size &= 0xFFFFU; + + /* The limit for `num_records' is a heuristic value. */ + + if ( version != 0 || num_records > 255 || record_size > 0x10001L ) + { + error = TT_Err_Invalid_File_Format; + goto Fail; + } + + if ( FT_NEW_ARRAY( face->hdmx_record_sizes, num_records ) ) + goto Fail; + + for ( nn = 0; nn < num_records; nn++ ) + { + if ( p + record_size > limit ) + break; + + face->hdmx_record_sizes[nn] = p[0]; + p += record_size; + } + + face->hdmx_record_count = nn; + face->hdmx_table_size = table_size; + face->hdmx_record_size = record_size; + + Exit: + return error; + + Fail: + FT_FRAME_RELEASE( face->hdmx_table ); + face->hdmx_table_size = 0; + goto Exit; + } + + + FT_LOCAL_DEF( void ) + tt_face_free_hdmx( TT_Face face ) + { + FT_Stream stream = face->root.stream; + FT_Memory memory = stream->memory; + + + FT_FREE( face->hdmx_record_sizes ); + FT_FRAME_RELEASE( face->hdmx_table ); + } + + + /*************************************************************************/ + /* */ + /* Return the advance width table for a given pixel size if it is found */ + /* in the font's `hdmx' table (if any). */ + /* */ + FT_LOCAL_DEF( FT_Byte* ) + tt_face_get_device_metrics( TT_Face face, + FT_UInt ppem, + FT_UInt gindex ) + { + FT_UInt nn; + FT_Byte* result = NULL; + FT_ULong record_size = face->hdmx_record_size; + FT_Byte* record = face->hdmx_table + 8; + + + for ( nn = 0; nn < face->hdmx_record_count; nn++ ) + if ( face->hdmx_record_sizes[nn] == ppem ) + { + gindex += 2; + if ( gindex < record_size ) + result = record + nn * record_size + gindex; + break; + } + + return result; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/truetype/ttpload.h b/reactos/dll/3rdparty/freetype/src/truetype/ttpload.h index f61ac079ce0..9459eabd706 100644 --- a/reactos/dll/3rdparty/freetype/src/truetype/ttpload.h +++ b/reactos/dll/3rdparty/freetype/src/truetype/ttpload.h @@ -1,75 +1,75 @@ -/***************************************************************************/ -/* */ -/* ttpload.h */ -/* */ -/* TrueType-specific tables loader (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __TTPLOAD_H__ -#define __TTPLOAD_H__ - - -#include -#include FT_INTERNAL_TRUETYPE_TYPES_H - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - tt_face_load_loca( TT_Face face, - FT_Stream stream ); - - FT_LOCAL( FT_ULong ) - tt_face_get_location( TT_Face face, - FT_UInt gindex, - FT_UInt *asize ); - - FT_LOCAL( void ) - tt_face_done_loca( TT_Face face ); - - FT_LOCAL( FT_Error ) - tt_face_load_cvt( TT_Face face, - FT_Stream stream ); - - FT_LOCAL( FT_Error ) - tt_face_load_fpgm( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_prep( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( FT_Error ) - tt_face_load_hdmx( TT_Face face, - FT_Stream stream ); - - - FT_LOCAL( void ) - tt_face_free_hdmx( TT_Face face ); - - - FT_LOCAL( FT_Byte* ) - tt_face_get_device_metrics( TT_Face face, - FT_UInt ppem, - FT_UInt gindex ); - -FT_END_HEADER - -#endif /* __TTPLOAD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* ttpload.h */ +/* */ +/* TrueType-specific tables loader (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __TTPLOAD_H__ +#define __TTPLOAD_H__ + + +#include +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + tt_face_load_loca( TT_Face face, + FT_Stream stream ); + + FT_LOCAL( FT_ULong ) + tt_face_get_location( TT_Face face, + FT_UInt gindex, + FT_UInt *asize ); + + FT_LOCAL( void ) + tt_face_done_loca( TT_Face face ); + + FT_LOCAL( FT_Error ) + tt_face_load_cvt( TT_Face face, + FT_Stream stream ); + + FT_LOCAL( FT_Error ) + tt_face_load_fpgm( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_prep( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( FT_Error ) + tt_face_load_hdmx( TT_Face face, + FT_Stream stream ); + + + FT_LOCAL( void ) + tt_face_free_hdmx( TT_Face face ); + + + FT_LOCAL( FT_Byte* ) + tt_face_get_device_metrics( TT_Face face, + FT_UInt ppem, + FT_UInt gindex ); + +FT_END_HEADER + +#endif /* __TTPLOAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1afm.c b/reactos/dll/3rdparty/freetype/src/type1/t1afm.c index b81a8df83ab..7bc64df43e9 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1afm.c +++ b/reactos/dll/3rdparty/freetype/src/type1/t1afm.c @@ -1,385 +1,385 @@ -/***************************************************************************/ -/* */ -/* t1afm.c */ -/* */ -/* AFM support for Type 1 fonts (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include "t1afm.h" -#include "t1errors.h" -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1afm - - - FT_LOCAL_DEF( void ) - T1_Done_Metrics( FT_Memory memory, - AFM_FontInfo fi ) - { - FT_FREE( fi->KernPairs ); - fi->NumKernPair = 0; - - FT_FREE( fi->TrackKerns ); - fi->NumTrackKern = 0; - - FT_FREE( fi ); - } - - - /* read a glyph name and return the equivalent glyph index */ - static FT_Int - t1_get_index( const char* name, - FT_UInt len, - void* user_data ) - { - T1_Font type1 = (T1_Font)user_data; - FT_Int n; - - - for ( n = 0; n < type1->num_glyphs; n++ ) - { - char* gname = (char*)type1->glyph_names[n]; - - - if ( gname && gname[0] == name[0] && - ft_strlen( gname ) == len && - ft_strncmp( gname, name, len ) == 0 ) - return n; - } - - return 0; - } - - -#undef KERN_INDEX -#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)(g1) << 16 ) | (g2) ) - - - /* compare two kerning pairs */ - FT_CALLBACK_DEF( int ) - compare_kern_pairs( const void* a, - const void* b ) - { - AFM_KernPair pair1 = (AFM_KernPair)a; - AFM_KernPair pair2 = (AFM_KernPair)b; - - FT_ULong index1 = KERN_INDEX( pair1->index1, pair1->index2 ); - FT_ULong index2 = KERN_INDEX( pair2->index1, pair2->index2 ); - - - return (int)( index1 - index2 ); - } - - - /* parse a PFM file -- for now, only read the kerning pairs */ - static FT_Error - T1_Read_PFM( FT_Face t1_face, - FT_Stream stream, - AFM_FontInfo fi ) - { - FT_Error error = T1_Err_Ok; - FT_Memory memory = stream->memory; - FT_Byte* start; - FT_Byte* limit; - FT_Byte* p; - AFM_KernPair kp; - FT_Int width_table_length; - FT_CharMap oldcharmap; - FT_CharMap charmap; - FT_Int n; - - - start = (FT_Byte*)stream->cursor; - limit = (FT_Byte*)stream->limit; - p = start; - - /* Figure out how long the width table is. */ - /* This info is a little-endian short at offset 99. */ - p = start + 99; - if ( p + 2 > limit ) - { - error = T1_Err_Unknown_File_Format; - goto Exit; - } - width_table_length = FT_PEEK_USHORT_LE( p ); - - p += 18 + width_table_length; - if ( p + 0x12 > limit || FT_PEEK_USHORT_LE( p ) < 0x12 ) - /* extension table is probably optional */ - goto Exit; - - /* Kerning offset is 14 bytes from start of extensions table. */ - p += 14; - p = start + FT_PEEK_ULONG_LE( p ); - - if ( p == start ) - /* zero offset means no table */ - goto Exit; - - if ( p + 2 > limit ) - { - error = T1_Err_Unknown_File_Format; - goto Exit; - } - - fi->NumKernPair = FT_PEEK_USHORT_LE( p ); - p += 2; - if ( p + 4 * fi->NumKernPair > limit ) - { - error = T1_Err_Unknown_File_Format; - goto Exit; - } - - /* Actually, kerning pairs are simply optional! */ - if ( fi->NumKernPair == 0 ) - goto Exit; - - /* allocate the pairs */ - if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) ) - goto Exit; - - /* now, read each kern pair */ - kp = fi->KernPairs; - limit = p + 4 * fi->NumKernPair; - - /* PFM kerning data are stored by encoding rather than glyph index, */ - /* so find the PostScript charmap of this font and install it */ - /* temporarily. If we find no PostScript charmap, then just use */ - /* the default and hope it is the right one. */ - oldcharmap = t1_face->charmap; - charmap = NULL; - - for ( n = 0; n < t1_face->num_charmaps; n++ ) - { - charmap = t1_face->charmaps[n]; - /* check against PostScript pseudo platform */ - if ( charmap->platform_id == 7 ) - { - error = FT_Set_Charmap( t1_face, charmap ); - if ( error ) - goto Exit; - break; - } - } - - /* Kerning info is stored as: */ - /* */ - /* encoding of first glyph (1 byte) */ - /* encoding of second glyph (1 byte) */ - /* offset (little-endian short) */ - for ( ; p < limit ; p += 4 ) - { - kp->index1 = FT_Get_Char_Index( t1_face, p[0] ); - kp->index2 = FT_Get_Char_Index( t1_face, p[1] ); - - kp->x = (FT_Int)FT_PEEK_SHORT_LE(p + 2); - kp->y = 0; - - kp++; - } - - if ( oldcharmap != NULL ) - error = FT_Set_Charmap( t1_face, oldcharmap ); - if ( error ) - goto Exit; - - /* now, sort the kern pairs according to their glyph indices */ - ft_qsort( fi->KernPairs, fi->NumKernPair, sizeof ( AFM_KernPairRec ), - compare_kern_pairs ); - - Exit: - if ( error ) - { - FT_FREE( fi->KernPairs ); - fi->NumKernPair = 0; - } - - return error; - } - - - /* parse a metrics file -- either AFM or PFM depending on what */ - /* it turns out to be */ - FT_LOCAL_DEF( FT_Error ) - T1_Read_Metrics( FT_Face t1_face, - FT_Stream stream ) - { - PSAux_Service psaux; - FT_Memory memory = stream->memory; - AFM_ParserRec parser; - AFM_FontInfo fi; - FT_Error error = T1_Err_Unknown_File_Format; - T1_Font t1_font = &( (T1_Face)t1_face )->type1; - - - if ( FT_NEW( fi ) || - FT_FRAME_ENTER( stream->size ) ) - goto Exit; - - fi->FontBBox = t1_font->font_bbox; - fi->Ascender = t1_font->font_bbox.yMax; - fi->Descender = t1_font->font_bbox.yMin; - - psaux = (PSAux_Service)( (T1_Face)t1_face )->psaux; - if ( psaux && psaux->afm_parser_funcs ) - { - error = psaux->afm_parser_funcs->init( &parser, - stream->memory, - stream->cursor, - stream->limit ); - - if ( !error ) - { - parser.FontInfo = fi; - parser.get_index = t1_get_index; - parser.user_data = t1_font; - - error = psaux->afm_parser_funcs->parse( &parser ); - psaux->afm_parser_funcs->done( &parser ); - } - } - - if ( error == T1_Err_Unknown_File_Format ) - { - FT_Byte* start = stream->cursor; - - - /* MS Windows allows versions up to 0x3FF without complaining */ - if ( stream->size > 6 && - start[1] < 4 && - FT_PEEK_ULONG_LE( start + 2 ) == stream->size ) - error = T1_Read_PFM( t1_face, stream, fi ); - } - - if ( !error ) - { - t1_font->font_bbox = fi->FontBBox; - - t1_face->bbox.xMin = fi->FontBBox.xMin >> 16; - t1_face->bbox.yMin = fi->FontBBox.yMin >> 16; - t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFFU ) >> 16; - t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFFU ) >> 16; - - t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000U ) >> 16 ); - t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000U ) >> 16 ); - - if ( fi->NumKernPair ) - { - t1_face->face_flags |= FT_FACE_FLAG_KERNING; - ( (T1_Face)t1_face )->afm_data = fi; - fi = NULL; - } - } - - FT_FRAME_EXIT(); - - Exit: - if ( fi != NULL ) - T1_Done_Metrics( memory, fi ); - - return error; - } - - - /* find the kerning for a given glyph pair */ - FT_LOCAL_DEF( void ) - T1_Get_Kerning( AFM_FontInfo fi, - FT_UInt glyph1, - FT_UInt glyph2, - FT_Vector* kerning ) - { - AFM_KernPair min, mid, max; - FT_ULong idx = KERN_INDEX( glyph1, glyph2 ); - - - /* simple binary search */ - min = fi->KernPairs; - max = min + fi->NumKernPair - 1; - - while ( min <= max ) - { - FT_ULong midi; - - - mid = min + ( max - min ) / 2; - midi = KERN_INDEX( mid->index1, mid->index2 ); - - if ( midi == idx ) - { - kerning->x = mid->x; - kerning->y = mid->y; - - return; - } - - if ( midi < idx ) - min = mid + 1; - else - max = mid - 1; - } - - kerning->x = 0; - kerning->y = 0; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Get_Track_Kerning( FT_Face face, - FT_Fixed ptsize, - FT_Int degree, - FT_Fixed* kerning ) - { - AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data; - FT_Int i; - - - if ( !fi ) - return T1_Err_Invalid_Argument; - - for ( i = 0; i < fi->NumTrackKern; i++ ) - { - AFM_TrackKern tk = fi->TrackKerns + i; - - - if ( tk->degree != degree ) - continue; - - if ( ptsize < tk->min_ptsize ) - *kerning = tk->min_kern; - else if ( ptsize > tk->max_ptsize ) - *kerning = tk->max_kern; - else - { - *kerning = FT_MulDiv( ptsize - tk->min_ptsize, - tk->max_kern - tk->min_kern, - tk->max_ptsize - tk->min_ptsize ) + - tk->min_kern; - } - } - - return T1_Err_Ok; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t1afm.c */ +/* */ +/* AFM support for Type 1 fonts (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include "t1afm.h" +#include "t1errors.h" +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t1afm + + + FT_LOCAL_DEF( void ) + T1_Done_Metrics( FT_Memory memory, + AFM_FontInfo fi ) + { + FT_FREE( fi->KernPairs ); + fi->NumKernPair = 0; + + FT_FREE( fi->TrackKerns ); + fi->NumTrackKern = 0; + + FT_FREE( fi ); + } + + + /* read a glyph name and return the equivalent glyph index */ + static FT_Int + t1_get_index( const char* name, + FT_UInt len, + void* user_data ) + { + T1_Font type1 = (T1_Font)user_data; + FT_Int n; + + + for ( n = 0; n < type1->num_glyphs; n++ ) + { + char* gname = (char*)type1->glyph_names[n]; + + + if ( gname && gname[0] == name[0] && + ft_strlen( gname ) == len && + ft_strncmp( gname, name, len ) == 0 ) + return n; + } + + return 0; + } + + +#undef KERN_INDEX +#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)(g1) << 16 ) | (g2) ) + + + /* compare two kerning pairs */ + FT_CALLBACK_DEF( int ) + compare_kern_pairs( const void* a, + const void* b ) + { + AFM_KernPair pair1 = (AFM_KernPair)a; + AFM_KernPair pair2 = (AFM_KernPair)b; + + FT_ULong index1 = KERN_INDEX( pair1->index1, pair1->index2 ); + FT_ULong index2 = KERN_INDEX( pair2->index1, pair2->index2 ); + + + return (int)( index1 - index2 ); + } + + + /* parse a PFM file -- for now, only read the kerning pairs */ + static FT_Error + T1_Read_PFM( FT_Face t1_face, + FT_Stream stream, + AFM_FontInfo fi ) + { + FT_Error error = T1_Err_Ok; + FT_Memory memory = stream->memory; + FT_Byte* start; + FT_Byte* limit; + FT_Byte* p; + AFM_KernPair kp; + FT_Int width_table_length; + FT_CharMap oldcharmap; + FT_CharMap charmap; + FT_Int n; + + + start = (FT_Byte*)stream->cursor; + limit = (FT_Byte*)stream->limit; + p = start; + + /* Figure out how long the width table is. */ + /* This info is a little-endian short at offset 99. */ + p = start + 99; + if ( p + 2 > limit ) + { + error = T1_Err_Unknown_File_Format; + goto Exit; + } + width_table_length = FT_PEEK_USHORT_LE( p ); + + p += 18 + width_table_length; + if ( p + 0x12 > limit || FT_PEEK_USHORT_LE( p ) < 0x12 ) + /* extension table is probably optional */ + goto Exit; + + /* Kerning offset is 14 bytes from start of extensions table. */ + p += 14; + p = start + FT_PEEK_ULONG_LE( p ); + + if ( p == start ) + /* zero offset means no table */ + goto Exit; + + if ( p + 2 > limit ) + { + error = T1_Err_Unknown_File_Format; + goto Exit; + } + + fi->NumKernPair = FT_PEEK_USHORT_LE( p ); + p += 2; + if ( p + 4 * fi->NumKernPair > limit ) + { + error = T1_Err_Unknown_File_Format; + goto Exit; + } + + /* Actually, kerning pairs are simply optional! */ + if ( fi->NumKernPair == 0 ) + goto Exit; + + /* allocate the pairs */ + if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) ) + goto Exit; + + /* now, read each kern pair */ + kp = fi->KernPairs; + limit = p + 4 * fi->NumKernPair; + + /* PFM kerning data are stored by encoding rather than glyph index, */ + /* so find the PostScript charmap of this font and install it */ + /* temporarily. If we find no PostScript charmap, then just use */ + /* the default and hope it is the right one. */ + oldcharmap = t1_face->charmap; + charmap = NULL; + + for ( n = 0; n < t1_face->num_charmaps; n++ ) + { + charmap = t1_face->charmaps[n]; + /* check against PostScript pseudo platform */ + if ( charmap->platform_id == 7 ) + { + error = FT_Set_Charmap( t1_face, charmap ); + if ( error ) + goto Exit; + break; + } + } + + /* Kerning info is stored as: */ + /* */ + /* encoding of first glyph (1 byte) */ + /* encoding of second glyph (1 byte) */ + /* offset (little-endian short) */ + for ( ; p < limit ; p += 4 ) + { + kp->index1 = FT_Get_Char_Index( t1_face, p[0] ); + kp->index2 = FT_Get_Char_Index( t1_face, p[1] ); + + kp->x = (FT_Int)FT_PEEK_SHORT_LE(p + 2); + kp->y = 0; + + kp++; + } + + if ( oldcharmap != NULL ) + error = FT_Set_Charmap( t1_face, oldcharmap ); + if ( error ) + goto Exit; + + /* now, sort the kern pairs according to their glyph indices */ + ft_qsort( fi->KernPairs, fi->NumKernPair, sizeof ( AFM_KernPairRec ), + compare_kern_pairs ); + + Exit: + if ( error ) + { + FT_FREE( fi->KernPairs ); + fi->NumKernPair = 0; + } + + return error; + } + + + /* parse a metrics file -- either AFM or PFM depending on what */ + /* it turns out to be */ + FT_LOCAL_DEF( FT_Error ) + T1_Read_Metrics( FT_Face t1_face, + FT_Stream stream ) + { + PSAux_Service psaux; + FT_Memory memory = stream->memory; + AFM_ParserRec parser; + AFM_FontInfo fi; + FT_Error error = T1_Err_Unknown_File_Format; + T1_Font t1_font = &( (T1_Face)t1_face )->type1; + + + if ( FT_NEW( fi ) || + FT_FRAME_ENTER( stream->size ) ) + goto Exit; + + fi->FontBBox = t1_font->font_bbox; + fi->Ascender = t1_font->font_bbox.yMax; + fi->Descender = t1_font->font_bbox.yMin; + + psaux = (PSAux_Service)( (T1_Face)t1_face )->psaux; + if ( psaux && psaux->afm_parser_funcs ) + { + error = psaux->afm_parser_funcs->init( &parser, + stream->memory, + stream->cursor, + stream->limit ); + + if ( !error ) + { + parser.FontInfo = fi; + parser.get_index = t1_get_index; + parser.user_data = t1_font; + + error = psaux->afm_parser_funcs->parse( &parser ); + psaux->afm_parser_funcs->done( &parser ); + } + } + + if ( error == T1_Err_Unknown_File_Format ) + { + FT_Byte* start = stream->cursor; + + + /* MS Windows allows versions up to 0x3FF without complaining */ + if ( stream->size > 6 && + start[1] < 4 && + FT_PEEK_ULONG_LE( start + 2 ) == stream->size ) + error = T1_Read_PFM( t1_face, stream, fi ); + } + + if ( !error ) + { + t1_font->font_bbox = fi->FontBBox; + + t1_face->bbox.xMin = fi->FontBBox.xMin >> 16; + t1_face->bbox.yMin = fi->FontBBox.yMin >> 16; + t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFFU ) >> 16; + t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFFU ) >> 16; + + t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000U ) >> 16 ); + t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000U ) >> 16 ); + + if ( fi->NumKernPair ) + { + t1_face->face_flags |= FT_FACE_FLAG_KERNING; + ( (T1_Face)t1_face )->afm_data = fi; + fi = NULL; + } + } + + FT_FRAME_EXIT(); + + Exit: + if ( fi != NULL ) + T1_Done_Metrics( memory, fi ); + + return error; + } + + + /* find the kerning for a given glyph pair */ + FT_LOCAL_DEF( void ) + T1_Get_Kerning( AFM_FontInfo fi, + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ) + { + AFM_KernPair min, mid, max; + FT_ULong idx = KERN_INDEX( glyph1, glyph2 ); + + + /* simple binary search */ + min = fi->KernPairs; + max = min + fi->NumKernPair - 1; + + while ( min <= max ) + { + FT_ULong midi; + + + mid = min + ( max - min ) / 2; + midi = KERN_INDEX( mid->index1, mid->index2 ); + + if ( midi == idx ) + { + kerning->x = mid->x; + kerning->y = mid->y; + + return; + } + + if ( midi < idx ) + min = mid + 1; + else + max = mid - 1; + } + + kerning->x = 0; + kerning->y = 0; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Get_Track_Kerning( FT_Face face, + FT_Fixed ptsize, + FT_Int degree, + FT_Fixed* kerning ) + { + AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data; + FT_Int i; + + + if ( !fi ) + return T1_Err_Invalid_Argument; + + for ( i = 0; i < fi->NumTrackKern; i++ ) + { + AFM_TrackKern tk = fi->TrackKerns + i; + + + if ( tk->degree != degree ) + continue; + + if ( ptsize < tk->min_ptsize ) + *kerning = tk->min_kern; + else if ( ptsize > tk->max_ptsize ) + *kerning = tk->max_kern; + else + { + *kerning = FT_MulDiv( ptsize - tk->min_ptsize, + tk->max_kern - tk->min_kern, + tk->max_ptsize - tk->min_ptsize ) + + tk->min_kern; + } + } + + return T1_Err_Ok; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1afm.h b/reactos/dll/3rdparty/freetype/src/type1/t1afm.h index 8eb1764de70..9bc1ecf6267 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1afm.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1afm.h @@ -1,54 +1,54 @@ -/***************************************************************************/ -/* */ -/* t1afm.h */ -/* */ -/* AFM support for Type 1 fonts (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1AFM_H__ -#define __T1AFM_H__ - -#include -#include "t1objs.h" -#include FT_INTERNAL_TYPE1_TYPES_H - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - T1_Read_Metrics( FT_Face face, - FT_Stream stream ); - - FT_LOCAL( void ) - T1_Done_Metrics( FT_Memory memory, - AFM_FontInfo fi ); - - FT_LOCAL( void ) - T1_Get_Kerning( AFM_FontInfo fi, - FT_UInt glyph1, - FT_UInt glyph2, - FT_Vector* kerning ); - - FT_LOCAL( FT_Error ) - T1_Get_Track_Kerning( FT_Face face, - FT_Fixed ptsize, - FT_Int degree, - FT_Fixed* kerning ); - -FT_END_HEADER - -#endif /* __T1AFM_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1afm.h */ +/* */ +/* AFM support for Type 1 fonts (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1AFM_H__ +#define __T1AFM_H__ + +#include +#include "t1objs.h" +#include FT_INTERNAL_TYPE1_TYPES_H + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + T1_Read_Metrics( FT_Face face, + FT_Stream stream ); + + FT_LOCAL( void ) + T1_Done_Metrics( FT_Memory memory, + AFM_FontInfo fi ); + + FT_LOCAL( void ) + T1_Get_Kerning( AFM_FontInfo fi, + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ); + + FT_LOCAL( FT_Error ) + T1_Get_Track_Kerning( FT_Face face, + FT_Fixed ptsize, + FT_Int degree, + FT_Fixed* kerning ); + +FT_END_HEADER + +#endif /* __T1AFM_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1driver.c b/reactos/dll/3rdparty/freetype/src/type1/t1driver.c index 3ca21dc1783..20246c33a4c 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1driver.c +++ b/reactos/dll/3rdparty/freetype/src/type1/t1driver.c @@ -1,313 +1,313 @@ -/***************************************************************************/ -/* */ -/* t1driver.c */ -/* */ -/* Type 1 driver interface (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include "t1driver.h" -#include "t1gload.h" -#include "t1load.h" - -#include "t1errors.h" - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include "t1afm.h" -#endif - -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H - -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_XFREE86_NAME_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_SERVICE_POSTSCRIPT_INFO_H -#include FT_SERVICE_KERNING_H - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1driver - - /* - * GLYPH DICT SERVICE - * - */ - - static FT_Error - t1_get_glyph_name( T1_Face face, - FT_UInt glyph_index, - FT_Pointer buffer, - FT_UInt buffer_max ) - { - FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max ); - - return T1_Err_Ok; - } - - - static FT_UInt - t1_get_name_index( T1_Face face, - FT_String* glyph_name ) - { - FT_Int i; - FT_String* gname; - - - for ( i = 0; i < face->type1.num_glyphs; i++ ) - { - gname = face->type1.glyph_names[i]; - - if ( !ft_strcmp( glyph_name, gname ) ) - return (FT_UInt)i; - } - - return 0; - } - - static const FT_Service_GlyphDictRec t1_service_glyph_dict = - { - (FT_GlyphDict_GetNameFunc) t1_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)t1_get_name_index - }; - - - /* - * POSTSCRIPT NAME SERVICE - * - */ - - static const char* - t1_get_ps_name( T1_Face face ) - { - return (const char*) face->type1.font_name; - } - - static const FT_Service_PsFontNameRec t1_service_ps_name = - { - (FT_PsName_GetFunc)t1_get_ps_name - }; - - - /* - * MULTIPLE MASTERS SERVICE - * - */ - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - static const FT_Service_MultiMastersRec t1_service_multi_masters = - { - (FT_Get_MM_Func) T1_Get_Multi_Master, - (FT_Set_MM_Design_Func) T1_Set_MM_Design, - (FT_Set_MM_Blend_Func) T1_Set_MM_Blend, - (FT_Get_MM_Var_Func) T1_Get_MM_Var, - (FT_Set_Var_Design_Func)T1_Set_Var_Design - }; -#endif - - - /* - * POSTSCRIPT INFO SERVICE - * - */ - - static FT_Error - t1_ps_get_font_info( FT_Face face, - PS_FontInfoRec* afont_info ) - { - *afont_info = ((T1_Face)face)->type1.font_info; - return 0; - } - - - static FT_Int - t1_ps_has_glyph_names( FT_Face face ) - { - FT_UNUSED( face ); - return 1; - } - - - static FT_Error - t1_ps_get_font_private( FT_Face face, - PS_PrivateRec* afont_private ) - { - *afont_private = ((T1_Face)face)->type1.private_dict; - return 0; - } - - - static const FT_Service_PsInfoRec t1_service_ps_info = - { - (PS_GetFontInfoFunc) t1_ps_get_font_info, - (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names, - (PS_GetFontPrivateFunc)t1_ps_get_font_private, - }; - -#ifndef T1_CONFIG_OPTION_NO_AFM - static const FT_Service_KerningRec t1_service_kerning = - { - T1_Get_Track_Kerning, - }; -#endif - - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec t1_services[] = - { - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name }, - { FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_1 }, - { FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info }, - -#ifndef T1_CONFIG_OPTION_NO_AFM - { FT_SERVICE_ID_KERNING, &t1_service_kerning }, -#endif - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - { FT_SERVICE_ID_MULTI_MASTERS, &t1_service_multi_masters }, -#endif - { NULL, NULL } - }; - - - static FT_Module_Interface - Get_Interface( FT_Driver driver, - const FT_String* t1_interface ) - { - FT_UNUSED( driver ); - - return ft_service_list_lookup( t1_services, t1_interface ); - } - - -#ifndef T1_CONFIG_OPTION_NO_AFM - - /*************************************************************************/ - /* */ - /* */ - /* Get_Kerning */ - /* */ - /* */ - /* A driver method used to return the kerning vector between two */ - /* glyphs of the same face. */ - /* */ - /* */ - /* face :: A handle to the source face object. */ - /* */ - /* left_glyph :: The index of the left glyph in the kern pair. */ - /* */ - /* right_glyph :: The index of the right glyph in the kern pair. */ - /* */ - /* */ - /* kerning :: The kerning vector. This is in font units for */ - /* scalable formats, and in pixels for fixed-sizes */ - /* formats. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Only horizontal layouts (left-to-right & right-to-left) are */ - /* supported by this function. Other layouts, or more sophisticated */ - /* kernings are out of scope of this method (the basic driver */ - /* interface is meant to be simple). */ - /* */ - /* They can be implemented by format-specific interfaces. */ - /* */ - static FT_Error - Get_Kerning( T1_Face face, - FT_UInt left_glyph, - FT_UInt right_glyph, - FT_Vector* kerning ) - { - kerning->x = 0; - kerning->y = 0; - - if ( face->afm_data ) - T1_Get_Kerning( (AFM_FontInfo)face->afm_data, - left_glyph, - right_glyph, - kerning ); - - return T1_Err_Ok; - } - - -#endif /* T1_CONFIG_OPTION_NO_AFM */ - - - FT_CALLBACK_TABLE_DEF - const FT_Driver_ClassRec t1_driver_class = - { - { - FT_MODULE_FONT_DRIVER | - FT_MODULE_DRIVER_SCALABLE | - FT_MODULE_DRIVER_HAS_HINTER, - - sizeof( FT_DriverRec ), - - "type1", - 0x10000L, - 0x20000L, - - 0, /* format interface */ - - (FT_Module_Constructor)T1_Driver_Init, - (FT_Module_Destructor) T1_Driver_Done, - (FT_Module_Requester) Get_Interface, - }, - - sizeof( T1_FaceRec ), - sizeof( T1_SizeRec ), - sizeof( T1_GlyphSlotRec ), - - (FT_Face_InitFunc) T1_Face_Init, - (FT_Face_DoneFunc) T1_Face_Done, - (FT_Size_InitFunc) T1_Size_Init, - (FT_Size_DoneFunc) T1_Size_Done, - (FT_Slot_InitFunc) T1_GlyphSlot_Init, - (FT_Slot_DoneFunc) T1_GlyphSlot_Done, - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif - (FT_Slot_LoadFunc) T1_Load_Glyph, - -#ifdef T1_CONFIG_OPTION_NO_AFM - (FT_Face_GetKerningFunc) 0, - (FT_Face_AttachFunc) 0, -#else - (FT_Face_GetKerningFunc) Get_Kerning, - (FT_Face_AttachFunc) T1_Read_Metrics, -#endif - (FT_Face_GetAdvancesFunc) 0, - (FT_Size_RequestFunc) T1_Size_Request, - (FT_Size_SelectFunc) 0 - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* t1driver.c */ +/* */ +/* Type 1 driver interface (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include "t1driver.h" +#include "t1gload.h" +#include "t1load.h" + +#include "t1errors.h" + +#ifndef T1_CONFIG_OPTION_NO_AFM +#include "t1afm.h" +#endif + +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H + +#include FT_SERVICE_MULTIPLE_MASTERS_H +#include FT_SERVICE_GLYPH_DICT_H +#include FT_SERVICE_XFREE86_NAME_H +#include FT_SERVICE_POSTSCRIPT_NAME_H +#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_SERVICE_POSTSCRIPT_INFO_H +#include FT_SERVICE_KERNING_H + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t1driver + + /* + * GLYPH DICT SERVICE + * + */ + + static FT_Error + t1_get_glyph_name( T1_Face face, + FT_UInt glyph_index, + FT_Pointer buffer, + FT_UInt buffer_max ) + { + FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max ); + + return T1_Err_Ok; + } + + + static FT_UInt + t1_get_name_index( T1_Face face, + FT_String* glyph_name ) + { + FT_Int i; + FT_String* gname; + + + for ( i = 0; i < face->type1.num_glyphs; i++ ) + { + gname = face->type1.glyph_names[i]; + + if ( !ft_strcmp( glyph_name, gname ) ) + return (FT_UInt)i; + } + + return 0; + } + + static const FT_Service_GlyphDictRec t1_service_glyph_dict = + { + (FT_GlyphDict_GetNameFunc) t1_get_glyph_name, + (FT_GlyphDict_NameIndexFunc)t1_get_name_index + }; + + + /* + * POSTSCRIPT NAME SERVICE + * + */ + + static const char* + t1_get_ps_name( T1_Face face ) + { + return (const char*) face->type1.font_name; + } + + static const FT_Service_PsFontNameRec t1_service_ps_name = + { + (FT_PsName_GetFunc)t1_get_ps_name + }; + + + /* + * MULTIPLE MASTERS SERVICE + * + */ + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + static const FT_Service_MultiMastersRec t1_service_multi_masters = + { + (FT_Get_MM_Func) T1_Get_Multi_Master, + (FT_Set_MM_Design_Func) T1_Set_MM_Design, + (FT_Set_MM_Blend_Func) T1_Set_MM_Blend, + (FT_Get_MM_Var_Func) T1_Get_MM_Var, + (FT_Set_Var_Design_Func)T1_Set_Var_Design + }; +#endif + + + /* + * POSTSCRIPT INFO SERVICE + * + */ + + static FT_Error + t1_ps_get_font_info( FT_Face face, + PS_FontInfoRec* afont_info ) + { + *afont_info = ((T1_Face)face)->type1.font_info; + return 0; + } + + + static FT_Int + t1_ps_has_glyph_names( FT_Face face ) + { + FT_UNUSED( face ); + return 1; + } + + + static FT_Error + t1_ps_get_font_private( FT_Face face, + PS_PrivateRec* afont_private ) + { + *afont_private = ((T1_Face)face)->type1.private_dict; + return 0; + } + + + static const FT_Service_PsInfoRec t1_service_ps_info = + { + (PS_GetFontInfoFunc) t1_ps_get_font_info, + (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names, + (PS_GetFontPrivateFunc)t1_ps_get_font_private, + }; + +#ifndef T1_CONFIG_OPTION_NO_AFM + static const FT_Service_KerningRec t1_service_kerning = + { + T1_Get_Track_Kerning, + }; +#endif + + /* + * SERVICE LIST + * + */ + + static const FT_ServiceDescRec t1_services[] = + { + { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name }, + { FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict }, + { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_1 }, + { FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info }, + +#ifndef T1_CONFIG_OPTION_NO_AFM + { FT_SERVICE_ID_KERNING, &t1_service_kerning }, +#endif + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + { FT_SERVICE_ID_MULTI_MASTERS, &t1_service_multi_masters }, +#endif + { NULL, NULL } + }; + + + static FT_Module_Interface + Get_Interface( FT_Driver driver, + const FT_String* t1_interface ) + { + FT_UNUSED( driver ); + + return ft_service_list_lookup( t1_services, t1_interface ); + } + + +#ifndef T1_CONFIG_OPTION_NO_AFM + + /*************************************************************************/ + /* */ + /* */ + /* Get_Kerning */ + /* */ + /* */ + /* A driver method used to return the kerning vector between two */ + /* glyphs of the same face. */ + /* */ + /* */ + /* face :: A handle to the source face object. */ + /* */ + /* left_glyph :: The index of the left glyph in the kern pair. */ + /* */ + /* right_glyph :: The index of the right glyph in the kern pair. */ + /* */ + /* */ + /* kerning :: The kerning vector. This is in font units for */ + /* scalable formats, and in pixels for fixed-sizes */ + /* formats. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* Only horizontal layouts (left-to-right & right-to-left) are */ + /* supported by this function. Other layouts, or more sophisticated */ + /* kernings are out of scope of this method (the basic driver */ + /* interface is meant to be simple). */ + /* */ + /* They can be implemented by format-specific interfaces. */ + /* */ + static FT_Error + Get_Kerning( T1_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) + { + kerning->x = 0; + kerning->y = 0; + + if ( face->afm_data ) + T1_Get_Kerning( (AFM_FontInfo)face->afm_data, + left_glyph, + right_glyph, + kerning ); + + return T1_Err_Ok; + } + + +#endif /* T1_CONFIG_OPTION_NO_AFM */ + + + FT_CALLBACK_TABLE_DEF + const FT_Driver_ClassRec t1_driver_class = + { + { + FT_MODULE_FONT_DRIVER | + FT_MODULE_DRIVER_SCALABLE | + FT_MODULE_DRIVER_HAS_HINTER, + + sizeof( FT_DriverRec ), + + "type1", + 0x10000L, + 0x20000L, + + 0, /* format interface */ + + (FT_Module_Constructor)T1_Driver_Init, + (FT_Module_Destructor) T1_Driver_Done, + (FT_Module_Requester) Get_Interface, + }, + + sizeof( T1_FaceRec ), + sizeof( T1_SizeRec ), + sizeof( T1_GlyphSlotRec ), + + (FT_Face_InitFunc) T1_Face_Init, + (FT_Face_DoneFunc) T1_Face_Done, + (FT_Size_InitFunc) T1_Size_Init, + (FT_Size_DoneFunc) T1_Size_Done, + (FT_Slot_InitFunc) T1_GlyphSlot_Init, + (FT_Slot_DoneFunc) T1_GlyphSlot_Done, + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + ft_stub_set_char_sizes, + ft_stub_set_pixel_sizes, +#endif + (FT_Slot_LoadFunc) T1_Load_Glyph, + +#ifdef T1_CONFIG_OPTION_NO_AFM + (FT_Face_GetKerningFunc) 0, + (FT_Face_AttachFunc) 0, +#else + (FT_Face_GetKerningFunc) Get_Kerning, + (FT_Face_AttachFunc) T1_Read_Metrics, +#endif + (FT_Face_GetAdvancesFunc) 0, + (FT_Size_RequestFunc) T1_Size_Request, + (FT_Size_SelectFunc) 0 + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1driver.h b/reactos/dll/3rdparty/freetype/src/type1/t1driver.h index ad429440de9..a65011ce7bf 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1driver.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1driver.h @@ -1,38 +1,38 @@ -/***************************************************************************/ -/* */ -/* t1driver.h */ -/* */ -/* High-level Type 1 driver interface (specification). */ -/* */ -/* Copyright 1996-2001, 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1DRIVER_H__ -#define __T1DRIVER_H__ - - -#include -#include FT_INTERNAL_DRIVER_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Driver_ClassRec ) t1_driver_class; - - -FT_END_HEADER - -#endif /* __T1DRIVER_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1driver.h */ +/* */ +/* High-level Type 1 driver interface (specification). */ +/* */ +/* Copyright 1996-2001, 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1DRIVER_H__ +#define __T1DRIVER_H__ + + +#include +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Driver_ClassRec ) t1_driver_class; + + +FT_END_HEADER + +#endif /* __T1DRIVER_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1errors.h b/reactos/dll/3rdparty/freetype/src/type1/t1errors.h index 81221c343d1..14495223411 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1errors.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1errors.h @@ -1,40 +1,40 @@ -/***************************************************************************/ -/* */ -/* t1errors.h */ -/* */ -/* Type 1 error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the Type 1 error enumeration constants. */ - /* */ - /*************************************************************************/ - -#ifndef __T1ERRORS_H__ -#define __T1ERRORS_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX T1_Err_ -#define FT_ERR_BASE FT_Mod_Err_Type1 - -#include FT_ERRORS_H - -#endif /* __T1ERRORS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1errors.h */ +/* */ +/* Type 1 error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the Type 1 error enumeration constants. */ + /* */ + /*************************************************************************/ + +#ifndef __T1ERRORS_H__ +#define __T1ERRORS_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX T1_Err_ +#define FT_ERR_BASE FT_Mod_Err_Type1 + +#include FT_ERRORS_H + +#endif /* __T1ERRORS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1gload.c b/reactos/dll/3rdparty/freetype/src/type1/t1gload.c index e08a4289742..e6c2b263458 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1gload.c +++ b/reactos/dll/3rdparty/freetype/src/type1/t1gload.c @@ -1,422 +1,422 @@ -/***************************************************************************/ -/* */ -/* t1gload.c */ -/* */ -/* Type 1 Glyph Loader (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include "t1gload.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_OUTLINE_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H - -#include "t1errors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1gload - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /********** *********/ - /********** COMPUTE THE MAXIMUM ADVANCE WIDTH *********/ - /********** *********/ - /********** The following code is in charge of computing *********/ - /********** the maximum advance width of the font. It *********/ - /********** quickly processes each glyph charstring to *********/ - /********** extract the value from either a `sbw' or `seac' *********/ - /********** operator. *********/ - /********** *********/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - FT_LOCAL_DEF( FT_Error ) - T1_Parse_Glyph_And_Get_Char_String( T1_Decoder decoder, - FT_UInt glyph_index, - FT_Data* char_string ) - { - T1_Face face = (T1_Face)decoder->builder.face; - T1_Font type1 = &face->type1; - FT_Error error = T1_Err_Ok; - - - decoder->font_matrix = type1->font_matrix; - decoder->font_offset = type1->font_offset; - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - /* For incremental fonts get the character data using the */ - /* callback function. */ - if ( face->root.internal->incremental_interface ) - error = face->root.internal->incremental_interface->funcs->get_glyph_data( - face->root.internal->incremental_interface->object, - glyph_index, char_string ); - else - -#endif /* FT_CONFIG_OPTION_INCREMENTAL */ - - /* For ordinary fonts get the character data stored in the face record. */ - { - char_string->pointer = type1->charstrings[glyph_index]; - char_string->length = (FT_Int)type1->charstrings_len[glyph_index]; - } - - if ( !error ) - error = decoder->funcs.parse_charstrings( - decoder, (FT_Byte*)char_string->pointer, - char_string->length ); - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - /* Incremental fonts can optionally override the metrics. */ - if ( !error && face->root.internal->incremental_interface && - face->root.internal->incremental_interface->funcs->get_glyph_metrics ) - { - FT_Incremental_MetricsRec metrics; - - - metrics.bearing_x = decoder->builder.left_bearing.x; - metrics.bearing_y = decoder->builder.left_bearing.y; - metrics.advance = decoder->builder.advance.x; - error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( - face->root.internal->incremental_interface->object, - glyph_index, FALSE, &metrics ); - decoder->builder.left_bearing.x = metrics.bearing_x; - decoder->builder.left_bearing.y = metrics.bearing_y; - decoder->builder.advance.x = metrics.advance; - decoder->builder.advance.y = 0; - } - -#endif /* FT_CONFIG_OPTION_INCREMENTAL */ - - return error; - } - - - FT_CALLBACK_DEF( FT_Error ) - T1_Parse_Glyph( T1_Decoder decoder, - FT_UInt glyph_index ) - { - FT_Data glyph_data; - FT_Error error = T1_Parse_Glyph_And_Get_Char_String( - decoder, glyph_index, &glyph_data ); - - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - - if ( !error ) - { - T1_Face face = (T1_Face)decoder->builder.face; - - - if ( face->root.internal->incremental_interface ) - face->root.internal->incremental_interface->funcs->free_glyph_data( - face->root.internal->incremental_interface->object, - &glyph_data ); - } - -#endif /* FT_CONFIG_OPTION_INCREMENTAL */ - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Compute_Max_Advance( T1_Face face, - FT_Pos* max_advance ) - { - FT_Error error; - T1_DecoderRec decoder; - FT_Int glyph_index; - T1_Font type1 = &face->type1; - PSAux_Service psaux = (PSAux_Service)face->psaux; - - - FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); - - *max_advance = 0; - - /* initialize load decoder */ - error = psaux->t1_decoder_funcs->init( &decoder, - (FT_Face)face, - 0, /* size */ - 0, /* glyph slot */ - (FT_Byte**)type1->glyph_names, - face->blend, - 0, - FT_RENDER_MODE_NORMAL, - T1_Parse_Glyph ); - if ( error ) - return error; - - decoder.builder.metrics_only = 1; - decoder.builder.load_points = 0; - - decoder.num_subrs = type1->num_subrs; - decoder.subrs = type1->subrs; - decoder.subrs_len = type1->subrs_len; - - decoder.buildchar = face->buildchar; - decoder.len_buildchar = face->len_buildchar; - - *max_advance = 0; - - /* for each glyph, parse the glyph charstring and extract */ - /* the advance width */ - for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ ) - { - /* now get load the unscaled outline */ - error = T1_Parse_Glyph( &decoder, glyph_index ); - if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance ) - *max_advance = decoder.builder.advance.x; - - /* ignore the error if one occurred - skip to next glyph */ - } - - psaux->t1_decoder_funcs->done( &decoder ); - - return T1_Err_Ok; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Load_Glyph( T1_GlyphSlot glyph, - T1_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - FT_Error error; - T1_DecoderRec decoder; - T1_Face face = (T1_Face)glyph->root.face; - FT_Bool hinting; - T1_Font type1 = &face->type1; - PSAux_Service psaux = (PSAux_Service)face->psaux; - const T1_Decoder_Funcs decoder_funcs = psaux->t1_decoder_funcs; - - FT_Matrix font_matrix; - FT_Vector font_offset; - FT_Data glyph_data; - FT_Bool must_finish_decoder = FALSE; -#ifdef FT_CONFIG_OPTION_INCREMENTAL - FT_Bool glyph_data_loaded = 0; -#endif - - - if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) - { - error = T1_Err_Invalid_Argument; - goto Exit; - } - - FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); - - if ( load_flags & FT_LOAD_NO_RECURSE ) - load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; - - glyph->x_scale = size->root.metrics.x_scale; - glyph->y_scale = size->root.metrics.y_scale; - - glyph->root.outline.n_points = 0; - glyph->root.outline.n_contours = 0; - - hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 && - ( load_flags & FT_LOAD_NO_HINTING ) == 0 ); - - glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; - - error = decoder_funcs->init( &decoder, - (FT_Face)face, - (FT_Size)size, - (FT_GlyphSlot)glyph, - (FT_Byte**)type1->glyph_names, - face->blend, - FT_BOOL( hinting ), - FT_LOAD_TARGET_MODE( load_flags ), - T1_Parse_Glyph ); - if ( error ) - goto Exit; - - must_finish_decoder = TRUE; - - decoder.builder.no_recurse = FT_BOOL( - ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ); - - decoder.num_subrs = type1->num_subrs; - decoder.subrs = type1->subrs; - decoder.subrs_len = type1->subrs_len; - - decoder.buildchar = face->buildchar; - decoder.len_buildchar = face->len_buildchar; - - /* now load the unscaled outline */ - error = T1_Parse_Glyph_And_Get_Char_String( &decoder, glyph_index, - &glyph_data ); - if ( error ) - goto Exit; -#ifdef FT_CONFIG_OPTION_INCREMENTAL - glyph_data_loaded = 1; -#endif - - font_matrix = decoder.font_matrix; - font_offset = decoder.font_offset; - - /* save new glyph tables */ - decoder_funcs->done( &decoder ); - - must_finish_decoder = FALSE; - - /* now, set the metrics -- this is rather simple, as */ - /* the left side bearing is the xMin, and the top side */ - /* bearing the yMax */ - if ( !error ) - { - glyph->root.outline.flags &= FT_OUTLINE_OWNER; - glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL; - - /* for composite glyphs, return only left side bearing and */ - /* advance width */ - if ( load_flags & FT_LOAD_NO_RECURSE ) - { - FT_Slot_Internal internal = glyph->root.internal; - - - glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x; - glyph->root.metrics.horiAdvance = decoder.builder.advance.x; - internal->glyph_matrix = font_matrix; - internal->glyph_delta = font_offset; - internal->glyph_transformed = 1; - } - else - { - FT_BBox cbox; - FT_Glyph_Metrics* metrics = &glyph->root.metrics; - FT_Vector advance; - - - /* copy the _unscaled_ advance width */ - metrics->horiAdvance = decoder.builder.advance.x; - glyph->root.linearHoriAdvance = decoder.builder.advance.x; - glyph->root.internal->glyph_transformed = 0; - - /* make up vertical ones */ - metrics->vertAdvance = ( face->type1.font_bbox.yMax - - face->type1.font_bbox.yMin ) >> 16; - glyph->root.linearVertAdvance = metrics->vertAdvance; - - glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; - - if ( size && size->root.metrics.y_ppem < 24 ) - glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION; - -#if 1 - /* apply the font matrix, if any */ - if ( font_matrix.xx != 0x10000L || font_matrix.yy != font_matrix.xx || - font_matrix.xy != 0 || font_matrix.yx != 0 ) - FT_Outline_Transform( &glyph->root.outline, &font_matrix ); - - if ( font_offset.x || font_offset.y ) - FT_Outline_Translate( &glyph->root.outline, - font_offset.x, - font_offset.y ); - - advance.x = metrics->horiAdvance; - advance.y = 0; - FT_Vector_Transform( &advance, &font_matrix ); - metrics->horiAdvance = advance.x + font_offset.x; - advance.x = 0; - advance.y = metrics->vertAdvance; - FT_Vector_Transform( &advance, &font_matrix ); - metrics->vertAdvance = advance.y + font_offset.y; -#endif - - if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ) - { - /* scale the outline and the metrics */ - FT_Int n; - FT_Outline* cur = decoder.builder.base; - FT_Vector* vec = cur->points; - FT_Fixed x_scale = glyph->x_scale; - FT_Fixed y_scale = glyph->y_scale; - - - /* First of all, scale the points, if we are not hinting */ - if ( !hinting || ! decoder.builder.hints_funcs ) - for ( n = cur->n_points; n > 0; n--, vec++ ) - { - vec->x = FT_MulFix( vec->x, x_scale ); - vec->y = FT_MulFix( vec->y, y_scale ); - } - - /* Then scale the metrics */ - metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); - metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); - } - - /* compute the other metrics */ - FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); - - metrics->width = cbox.xMax - cbox.xMin; - metrics->height = cbox.yMax - cbox.yMin; - - metrics->horiBearingX = cbox.xMin; - metrics->horiBearingY = cbox.yMax; - - /* make up vertical ones */ - ft_synthesize_vertical_metrics( metrics, - metrics->vertAdvance ); - } - - /* Set control data to the glyph charstrings. Note that this is */ - /* _not_ zero-terminated. */ - glyph->root.control_data = (FT_Byte*)glyph_data.pointer; - glyph->root.control_len = glyph_data.length; - } - - - Exit: - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - if ( glyph_data_loaded && face->root.internal->incremental_interface ) - { - face->root.internal->incremental_interface->funcs->free_glyph_data( - face->root.internal->incremental_interface->object, - &glyph_data ); - - /* Set the control data to null - it is no longer available if */ - /* loaded incrementally. */ - glyph->root.control_data = 0; - glyph->root.control_len = 0; - } -#endif - - if ( must_finish_decoder ) - decoder_funcs->done( &decoder ); - - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t1gload.c */ +/* */ +/* Type 1 Glyph Loader (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include "t1gload.h" +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_OUTLINE_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H + +#include "t1errors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t1gload + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /********** *********/ + /********** COMPUTE THE MAXIMUM ADVANCE WIDTH *********/ + /********** *********/ + /********** The following code is in charge of computing *********/ + /********** the maximum advance width of the font. It *********/ + /********** quickly processes each glyph charstring to *********/ + /********** extract the value from either a `sbw' or `seac' *********/ + /********** operator. *********/ + /********** *********/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_LOCAL_DEF( FT_Error ) + T1_Parse_Glyph_And_Get_Char_String( T1_Decoder decoder, + FT_UInt glyph_index, + FT_Data* char_string ) + { + T1_Face face = (T1_Face)decoder->builder.face; + T1_Font type1 = &face->type1; + FT_Error error = T1_Err_Ok; + + + decoder->font_matrix = type1->font_matrix; + decoder->font_offset = type1->font_offset; + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* For incremental fonts get the character data using the */ + /* callback function. */ + if ( face->root.internal->incremental_interface ) + error = face->root.internal->incremental_interface->funcs->get_glyph_data( + face->root.internal->incremental_interface->object, + glyph_index, char_string ); + else + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + /* For ordinary fonts get the character data stored in the face record. */ + { + char_string->pointer = type1->charstrings[glyph_index]; + char_string->length = (FT_Int)type1->charstrings_len[glyph_index]; + } + + if ( !error ) + error = decoder->funcs.parse_charstrings( + decoder, (FT_Byte*)char_string->pointer, + char_string->length ); + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + /* Incremental fonts can optionally override the metrics. */ + if ( !error && face->root.internal->incremental_interface && + face->root.internal->incremental_interface->funcs->get_glyph_metrics ) + { + FT_Incremental_MetricsRec metrics; + + + metrics.bearing_x = decoder->builder.left_bearing.x; + metrics.bearing_y = decoder->builder.left_bearing.y; + metrics.advance = decoder->builder.advance.x; + error = face->root.internal->incremental_interface->funcs->get_glyph_metrics( + face->root.internal->incremental_interface->object, + glyph_index, FALSE, &metrics ); + decoder->builder.left_bearing.x = metrics.bearing_x; + decoder->builder.left_bearing.y = metrics.bearing_y; + decoder->builder.advance.x = metrics.advance; + decoder->builder.advance.y = 0; + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + return error; + } + + + FT_CALLBACK_DEF( FT_Error ) + T1_Parse_Glyph( T1_Decoder decoder, + FT_UInt glyph_index ) + { + FT_Data glyph_data; + FT_Error error = T1_Parse_Glyph_And_Get_Char_String( + decoder, glyph_index, &glyph_data ); + + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + + if ( !error ) + { + T1_Face face = (T1_Face)decoder->builder.face; + + + if ( face->root.internal->incremental_interface ) + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); + } + +#endif /* FT_CONFIG_OPTION_INCREMENTAL */ + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Compute_Max_Advance( T1_Face face, + FT_Pos* max_advance ) + { + FT_Error error; + T1_DecoderRec decoder; + FT_Int glyph_index; + T1_Font type1 = &face->type1; + PSAux_Service psaux = (PSAux_Service)face->psaux; + + + FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); + + *max_advance = 0; + + /* initialize load decoder */ + error = psaux->t1_decoder_funcs->init( &decoder, + (FT_Face)face, + 0, /* size */ + 0, /* glyph slot */ + (FT_Byte**)type1->glyph_names, + face->blend, + 0, + FT_RENDER_MODE_NORMAL, + T1_Parse_Glyph ); + if ( error ) + return error; + + decoder.builder.metrics_only = 1; + decoder.builder.load_points = 0; + + decoder.num_subrs = type1->num_subrs; + decoder.subrs = type1->subrs; + decoder.subrs_len = type1->subrs_len; + + decoder.buildchar = face->buildchar; + decoder.len_buildchar = face->len_buildchar; + + *max_advance = 0; + + /* for each glyph, parse the glyph charstring and extract */ + /* the advance width */ + for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ ) + { + /* now get load the unscaled outline */ + error = T1_Parse_Glyph( &decoder, glyph_index ); + if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance ) + *max_advance = decoder.builder.advance.x; + + /* ignore the error if one occurred - skip to next glyph */ + } + + psaux->t1_decoder_funcs->done( &decoder ); + + return T1_Err_Ok; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Load_Glyph( T1_GlyphSlot glyph, + T1_Size size, + FT_UInt glyph_index, + FT_Int32 load_flags ) + { + FT_Error error; + T1_DecoderRec decoder; + T1_Face face = (T1_Face)glyph->root.face; + FT_Bool hinting; + T1_Font type1 = &face->type1; + PSAux_Service psaux = (PSAux_Service)face->psaux; + const T1_Decoder_Funcs decoder_funcs = psaux->t1_decoder_funcs; + + FT_Matrix font_matrix; + FT_Vector font_offset; + FT_Data glyph_data; + FT_Bool must_finish_decoder = FALSE; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + FT_Bool glyph_data_loaded = 0; +#endif + + + if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) + { + error = T1_Err_Invalid_Argument; + goto Exit; + } + + FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); + + if ( load_flags & FT_LOAD_NO_RECURSE ) + load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; + + glyph->x_scale = size->root.metrics.x_scale; + glyph->y_scale = size->root.metrics.y_scale; + + glyph->root.outline.n_points = 0; + glyph->root.outline.n_contours = 0; + + hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 && + ( load_flags & FT_LOAD_NO_HINTING ) == 0 ); + + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; + + error = decoder_funcs->init( &decoder, + (FT_Face)face, + (FT_Size)size, + (FT_GlyphSlot)glyph, + (FT_Byte**)type1->glyph_names, + face->blend, + FT_BOOL( hinting ), + FT_LOAD_TARGET_MODE( load_flags ), + T1_Parse_Glyph ); + if ( error ) + goto Exit; + + must_finish_decoder = TRUE; + + decoder.builder.no_recurse = FT_BOOL( + ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ); + + decoder.num_subrs = type1->num_subrs; + decoder.subrs = type1->subrs; + decoder.subrs_len = type1->subrs_len; + + decoder.buildchar = face->buildchar; + decoder.len_buildchar = face->len_buildchar; + + /* now load the unscaled outline */ + error = T1_Parse_Glyph_And_Get_Char_String( &decoder, glyph_index, + &glyph_data ); + if ( error ) + goto Exit; +#ifdef FT_CONFIG_OPTION_INCREMENTAL + glyph_data_loaded = 1; +#endif + + font_matrix = decoder.font_matrix; + font_offset = decoder.font_offset; + + /* save new glyph tables */ + decoder_funcs->done( &decoder ); + + must_finish_decoder = FALSE; + + /* now, set the metrics -- this is rather simple, as */ + /* the left side bearing is the xMin, and the top side */ + /* bearing the yMax */ + if ( !error ) + { + glyph->root.outline.flags &= FT_OUTLINE_OWNER; + glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL; + + /* for composite glyphs, return only left side bearing and */ + /* advance width */ + if ( load_flags & FT_LOAD_NO_RECURSE ) + { + FT_Slot_Internal internal = glyph->root.internal; + + + glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x; + glyph->root.metrics.horiAdvance = decoder.builder.advance.x; + internal->glyph_matrix = font_matrix; + internal->glyph_delta = font_offset; + internal->glyph_transformed = 1; + } + else + { + FT_BBox cbox; + FT_Glyph_Metrics* metrics = &glyph->root.metrics; + FT_Vector advance; + + + /* copy the _unscaled_ advance width */ + metrics->horiAdvance = decoder.builder.advance.x; + glyph->root.linearHoriAdvance = decoder.builder.advance.x; + glyph->root.internal->glyph_transformed = 0; + + /* make up vertical ones */ + metrics->vertAdvance = ( face->type1.font_bbox.yMax - + face->type1.font_bbox.yMin ) >> 16; + glyph->root.linearVertAdvance = metrics->vertAdvance; + + glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; + + if ( size && size->root.metrics.y_ppem < 24 ) + glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION; + +#if 1 + /* apply the font matrix, if any */ + if ( font_matrix.xx != 0x10000L || font_matrix.yy != font_matrix.xx || + font_matrix.xy != 0 || font_matrix.yx != 0 ) + FT_Outline_Transform( &glyph->root.outline, &font_matrix ); + + if ( font_offset.x || font_offset.y ) + FT_Outline_Translate( &glyph->root.outline, + font_offset.x, + font_offset.y ); + + advance.x = metrics->horiAdvance; + advance.y = 0; + FT_Vector_Transform( &advance, &font_matrix ); + metrics->horiAdvance = advance.x + font_offset.x; + advance.x = 0; + advance.y = metrics->vertAdvance; + FT_Vector_Transform( &advance, &font_matrix ); + metrics->vertAdvance = advance.y + font_offset.y; +#endif + + if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ) + { + /* scale the outline and the metrics */ + FT_Int n; + FT_Outline* cur = decoder.builder.base; + FT_Vector* vec = cur->points; + FT_Fixed x_scale = glyph->x_scale; + FT_Fixed y_scale = glyph->y_scale; + + + /* First of all, scale the points, if we are not hinting */ + if ( !hinting || ! decoder.builder.hints_funcs ) + for ( n = cur->n_points; n > 0; n--, vec++ ) + { + vec->x = FT_MulFix( vec->x, x_scale ); + vec->y = FT_MulFix( vec->y, y_scale ); + } + + /* Then scale the metrics */ + metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); + metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); + } + + /* compute the other metrics */ + FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); + + metrics->width = cbox.xMax - cbox.xMin; + metrics->height = cbox.yMax - cbox.yMin; + + metrics->horiBearingX = cbox.xMin; + metrics->horiBearingY = cbox.yMax; + + /* make up vertical ones */ + ft_synthesize_vertical_metrics( metrics, + metrics->vertAdvance ); + } + + /* Set control data to the glyph charstrings. Note that this is */ + /* _not_ zero-terminated. */ + glyph->root.control_data = (FT_Byte*)glyph_data.pointer; + glyph->root.control_len = glyph_data.length; + } + + + Exit: + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + if ( glyph_data_loaded && face->root.internal->incremental_interface ) + { + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); + + /* Set the control data to null - it is no longer available if */ + /* loaded incrementally. */ + glyph->root.control_data = 0; + glyph->root.control_len = 0; + } +#endif + + if ( must_finish_decoder ) + decoder_funcs->done( &decoder ); + + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1gload.h b/reactos/dll/3rdparty/freetype/src/type1/t1gload.h index de87896dc0e..7e957eeb633 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1gload.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1gload.h @@ -1,46 +1,46 @@ -/***************************************************************************/ -/* */ -/* t1gload.h */ -/* */ -/* Type 1 Glyph Loader (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1GLOAD_H__ -#define __T1GLOAD_H__ - - -#include -#include "t1objs.h" - - -FT_BEGIN_HEADER - - - FT_LOCAL( FT_Error ) - T1_Compute_Max_Advance( T1_Face face, - FT_Pos* max_advance ); - - FT_LOCAL( FT_Error ) - T1_Load_Glyph( T1_GlyphSlot glyph, - T1_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ); - - -FT_END_HEADER - -#endif /* __T1GLOAD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1gload.h */ +/* */ +/* Type 1 Glyph Loader (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1GLOAD_H__ +#define __T1GLOAD_H__ + + +#include +#include "t1objs.h" + + +FT_BEGIN_HEADER + + + FT_LOCAL( FT_Error ) + T1_Compute_Max_Advance( T1_Face face, + FT_Pos* max_advance ); + + FT_LOCAL( FT_Error ) + T1_Load_Glyph( T1_GlyphSlot glyph, + T1_Size size, + FT_UInt glyph_index, + FT_Int32 load_flags ); + + +FT_END_HEADER + +#endif /* __T1GLOAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1load.c b/reactos/dll/3rdparty/freetype/src/type1/t1load.c index 55177eed438..1ce0658936f 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1load.c +++ b/reactos/dll/3rdparty/freetype/src/type1/t1load.c @@ -1,2221 +1,2221 @@ -/***************************************************************************/ -/* */ -/* t1load.c */ -/* */ -/* Type 1 font loader (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This is the new and improved Type 1 data loader for FreeType 2. The */ - /* old loader has several problems: it is slow, complex, difficult to */ - /* maintain, and contains incredible hacks to make it accept some */ - /* ill-formed Type 1 fonts without hiccup-ing. Moreover, about 5% of */ - /* the Type 1 fonts on my machine still aren't loaded correctly by it. */ - /* */ - /* This version is much simpler, much faster and also easier to read and */ - /* maintain by a great order of magnitude. The idea behind it is to */ - /* _not_ try to read the Type 1 token stream with a state machine (i.e. */ - /* a Postscript-like interpreter) but rather to perform simple pattern */ - /* matching. */ - /* */ - /* Indeed, nearly all data definitions follow a simple pattern like */ - /* */ - /* ... /Field ... */ - /* */ - /* where can be a number, a boolean, a string, or an array of */ - /* numbers. There are a few exceptions, namely the encoding, font name, */ - /* charstrings, and subrs; they are handled with a special pattern */ - /* matching routine. */ - /* */ - /* All other common cases are handled very simply. The matching rules */ - /* are defined in the file `t1tokens.h' through the use of several */ - /* macros calls PARSE_XXX. This file is included twice here; the first */ - /* time to generate parsing callback functions, the second time to */ - /* generate a table of keywords (with pointers to the associated */ - /* callback functions). */ - /* */ - /* The function `parse_dict' simply scans *linearly* a given dictionary */ - /* (either the top-level or private one) and calls the appropriate */ - /* callback when it encounters an immediate keyword. */ - /* */ - /* This is by far the fastest way one can find to parse and read all */ - /* data. */ - /* */ - /* This led to tremendous code size reduction. Note that later, the */ - /* glyph loader will also be _greatly_ simplified, and the automatic */ - /* hinter will replace the clumsy `t1hinter'. */ - /* */ - /*************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_CONFIG_CONFIG_H -#include FT_MULTIPLE_MASTERS_H -#include FT_INTERNAL_TYPE1_TYPES_H - -#include "t1load.h" -#include "t1errors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1load - - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** MULTIPLE MASTERS SUPPORT *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static FT_Error - t1_allocate_blend( T1_Face face, - FT_UInt num_designs, - FT_UInt num_axis ) - { - PS_Blend blend; - FT_Memory memory = face->root.memory; - FT_Error error = T1_Err_Ok; - - - blend = face->blend; - if ( !blend ) - { - if ( FT_NEW( blend ) ) - goto Exit; - - blend->num_default_design_vector = 0; - - face->blend = blend; - } - - /* allocate design data if needed */ - if ( num_designs > 0 ) - { - if ( blend->num_designs == 0 ) - { - FT_UInt nn; - - - /* allocate the blend `private' and `font_info' dictionaries */ - if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs ) || - FT_NEW_ARRAY( blend->privates[1], num_designs ) || - FT_NEW_ARRAY( blend->bboxes[1], num_designs ) || - FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) ) - goto Exit; - - blend->default_weight_vector = blend->weight_vector + num_designs; - - blend->font_infos[0] = &face->type1.font_info; - blend->privates [0] = &face->type1.private_dict; - blend->bboxes [0] = &face->type1.font_bbox; - - for ( nn = 2; nn <= num_designs; nn++ ) - { - blend->privates[nn] = blend->privates [nn - 1] + 1; - blend->font_infos[nn] = blend->font_infos[nn - 1] + 1; - blend->bboxes[nn] = blend->bboxes [nn - 1] + 1; - } - - blend->num_designs = num_designs; - } - else if ( blend->num_designs != num_designs ) - goto Fail; - } - - /* allocate axis data if needed */ - if ( num_axis > 0 ) - { - if ( blend->num_axis != 0 && blend->num_axis != num_axis ) - goto Fail; - - blend->num_axis = num_axis; - } - - /* allocate the blend design pos table if needed */ - num_designs = blend->num_designs; - num_axis = blend->num_axis; - if ( num_designs && num_axis && blend->design_pos[0] == 0 ) - { - FT_UInt n; - - - if ( FT_NEW_ARRAY( blend->design_pos[0], num_designs * num_axis ) ) - goto Exit; - - for ( n = 1; n < num_designs; n++ ) - blend->design_pos[n] = blend->design_pos[0] + num_axis * n; - } - - Exit: - return error; - - Fail: - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Get_Multi_Master( T1_Face face, - FT_Multi_Master* master ) - { - PS_Blend blend = face->blend; - FT_UInt n; - FT_Error error; - - - error = T1_Err_Invalid_Argument; - - if ( blend ) - { - master->num_axis = blend->num_axis; - master->num_designs = blend->num_designs; - - for ( n = 0; n < blend->num_axis; n++ ) - { - FT_MM_Axis* axis = master->axis + n; - PS_DesignMap map = blend->design_map + n; - - - axis->name = blend->axis_names[n]; - axis->minimum = map->design_points[0]; - axis->maximum = map->design_points[map->num_points - 1]; - } - - error = T1_Err_Ok; - } - - return error; - } - - -#define FT_INT_TO_FIXED( a ) ( (a) << 16 ) -#define FT_FIXED_TO_INT( a ) ( FT_RoundFix( a ) >> 16 ) - - - /*************************************************************************/ - /* */ - /* Given a normalized (blend) coordinate, figure out the design */ - /* coordinate appropriate for that value. */ - /* */ - FT_LOCAL_DEF( FT_Fixed ) - mm_axis_unmap( PS_DesignMap axismap, - FT_Fixed ncv ) - { - int j; - - - if ( ncv <= axismap->blend_points[0] ) - return axismap->design_points[0]; - - for ( j = 1; j < axismap->num_points; ++j ) - { - if ( ncv <= axismap->blend_points[j] ) - { - FT_Fixed t = FT_MulDiv( ncv - axismap->blend_points[j - 1], - 0x10000L, - axismap->blend_points[j] - - axismap->blend_points[j - 1] ); - - - return axismap->design_points[j - 1] + - FT_MulDiv( t, - axismap->design_points[j] - - axismap->design_points[j - 1], - 1L ); - } - } - - return axismap->design_points[axismap->num_points - 1]; - } - - - /*************************************************************************/ - /* */ - /* Given a vector of weights, one for each design, figure out the */ - /* normalized axis coordinates which gave rise to those weights. */ - /* */ - FT_LOCAL_DEF( void ) - mm_weights_unmap( FT_Fixed* weights, - FT_Fixed* axiscoords, - FT_UInt axis_count ) - { - FT_ASSERT( axis_count <= T1_MAX_MM_AXIS ); - - if ( axis_count == 1 ) - axiscoords[0] = weights[1]; - - else if ( axis_count == 2 ) - { - axiscoords[0] = weights[3] + weights[1]; - axiscoords[1] = weights[3] + weights[2]; - } - - else if ( axis_count == 3 ) - { - axiscoords[0] = weights[7] + weights[5] + weights[3] + weights[1]; - axiscoords[1] = weights[7] + weights[6] + weights[3] + weights[2]; - axiscoords[2] = weights[7] + weights[6] + weights[5] + weights[4]; - } - - else - { - axiscoords[0] = weights[15] + weights[13] + weights[11] + weights[9] + - weights[7] + weights[5] + weights[3] + weights[1]; - axiscoords[1] = weights[15] + weights[14] + weights[11] + weights[10] + - weights[7] + weights[6] + weights[3] + weights[2]; - axiscoords[2] = weights[15] + weights[14] + weights[13] + weights[12] + - weights[7] + weights[6] + weights[5] + weights[4]; - axiscoords[3] = weights[15] + weights[14] + weights[13] + weights[12] + - weights[11] + weights[10] + weights[9] + weights[8]; - } - } - - - /*************************************************************************/ - /* */ - /* Just a wrapper around T1_Get_Multi_Master to support the different */ - /* arguments needed by the GX var distortable fonts. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - T1_Get_MM_Var( T1_Face face, - FT_MM_Var* *master ) - { - FT_Memory memory = face->root.memory; - FT_MM_Var *mmvar; - FT_Multi_Master mmaster; - FT_Error error; - FT_UInt i; - FT_Fixed axiscoords[T1_MAX_MM_AXIS]; - PS_Blend blend = face->blend; - - - error = T1_Get_Multi_Master( face, &mmaster ); - if ( error ) - goto Exit; - if ( FT_ALLOC( mmvar, - sizeof ( FT_MM_Var ) + - mmaster.num_axis * sizeof ( FT_Var_Axis ) ) ) - goto Exit; - - mmvar->num_axis = mmaster.num_axis; - mmvar->num_designs = mmaster.num_designs; - mmvar->num_namedstyles = (FT_UInt)-1; /* Does not apply */ - mmvar->axis = (FT_Var_Axis*)&mmvar[1]; - /* Point to axes after MM_Var struct */ - mmvar->namedstyle = NULL; - - for ( i = 0 ; i < mmaster.num_axis; ++i ) - { - mmvar->axis[i].name = mmaster.axis[i].name; - mmvar->axis[i].minimum = FT_INT_TO_FIXED( mmaster.axis[i].minimum); - mmvar->axis[i].maximum = FT_INT_TO_FIXED( mmaster.axis[i].maximum); - mmvar->axis[i].def = ( mmvar->axis[i].minimum + - mmvar->axis[i].maximum ) / 2; - /* Does not apply. But this value is in range */ - mmvar->axis[i].strid = 0xFFFFFFFFUL; /* Does not apply */ - mmvar->axis[i].tag = 0xFFFFFFFFUL; /* Does not apply */ - - if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 ) - mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' ); - else if ( ft_strcmp( mmvar->axis[i].name, "Width" ) == 0 ) - mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'd', 't', 'h' ); - else if ( ft_strcmp( mmvar->axis[i].name, "OpticalSize" ) == 0 ) - mmvar->axis[i].tag = FT_MAKE_TAG( 'o', 'p', 's', 'z' ); - } - - if ( blend->num_designs == 1U << blend->num_axis ) - { - mm_weights_unmap( blend->default_weight_vector, - axiscoords, - blend->num_axis ); - - for ( i = 0; i < mmaster.num_axis; ++i ) - mmvar->axis[i].def = - FT_INT_TO_FIXED( mm_axis_unmap( &blend->design_map[i], - axiscoords[i] ) ); - } - - *master = mmvar; - - Exit: - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Set_MM_Blend( T1_Face face, - FT_UInt num_coords, - FT_Fixed* coords ) - { - PS_Blend blend = face->blend; - FT_Error error; - FT_UInt n, m; - - - error = T1_Err_Invalid_Argument; - - if ( blend && blend->num_axis == num_coords ) - { - /* recompute the weight vector from the blend coordinates */ - error = T1_Err_Ok; - - for ( n = 0; n < blend->num_designs; n++ ) - { - FT_Fixed result = 0x10000L; /* 1.0 fixed */ - - - for ( m = 0; m < blend->num_axis; m++ ) - { - FT_Fixed factor; - - - /* get current blend axis position */ - factor = coords[m]; - if ( factor < 0 ) factor = 0; - if ( factor > 0x10000L ) factor = 0x10000L; - - if ( ( n & ( 1 << m ) ) == 0 ) - factor = 0x10000L - factor; - - result = FT_MulFix( result, factor ); - } - blend->weight_vector[n] = result; - } - - error = T1_Err_Ok; - } - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Set_MM_Design( T1_Face face, - FT_UInt num_coords, - FT_Long* coords ) - { - PS_Blend blend = face->blend; - FT_Error error; - FT_UInt n, p; - - - error = T1_Err_Invalid_Argument; - if ( blend && blend->num_axis == num_coords ) - { - /* compute the blend coordinates through the blend design map */ - FT_Fixed final_blends[T1_MAX_MM_DESIGNS]; - - - for ( n = 0; n < blend->num_axis; n++ ) - { - FT_Long design = coords[n]; - FT_Fixed the_blend; - PS_DesignMap map = blend->design_map + n; - FT_Long* designs = map->design_points; - FT_Fixed* blends = map->blend_points; - FT_Int before = -1, after = -1; - - - for ( p = 0; p < (FT_UInt)map->num_points; p++ ) - { - FT_Long p_design = designs[p]; - - - /* exact match? */ - if ( design == p_design ) - { - the_blend = blends[p]; - goto Found; - } - - if ( design < p_design ) - { - after = p; - break; - } - - before = p; - } - - /* now interpolate if necessary */ - if ( before < 0 ) - the_blend = blends[0]; - - else if ( after < 0 ) - the_blend = blends[map->num_points - 1]; - - else - the_blend = FT_MulDiv( design - designs[before], - blends [after] - blends [before], - designs[after] - designs[before] ); - - Found: - final_blends[n] = the_blend; - } - - error = T1_Set_MM_Blend( face, num_coords, final_blends ); - } - - return error; - } - - - /*************************************************************************/ - /* */ - /* Just a wrapper around T1_Set_MM_Design to support the different */ - /* arguments needed by the GX var distortable fonts. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - T1_Set_Var_Design( T1_Face face, - FT_UInt num_coords, - FT_Fixed* coords ) - { - FT_Long lcoords[4]; /* maximum axis count is 4 */ - FT_UInt i; - FT_Error error; - - - error = T1_Err_Invalid_Argument; - if ( num_coords <= 4 && num_coords > 0 ) - { - for ( i = 0; i < num_coords; ++i ) - lcoords[i] = FT_FIXED_TO_INT( coords[i] ); - error = T1_Set_MM_Design( face, num_coords, lcoords ); - } - - return error; - } - - - FT_LOCAL_DEF( void ) - T1_Done_Blend( T1_Face face ) - { - FT_Memory memory = face->root.memory; - PS_Blend blend = face->blend; - - - if ( blend ) - { - FT_UInt num_designs = blend->num_designs; - FT_UInt num_axis = blend->num_axis; - FT_UInt n; - - - /* release design pos table */ - FT_FREE( blend->design_pos[0] ); - for ( n = 1; n < num_designs; n++ ) - blend->design_pos[n] = 0; - - /* release blend `private' and `font info' dictionaries */ - FT_FREE( blend->privates[1] ); - FT_FREE( blend->font_infos[1] ); - FT_FREE( blend->bboxes[1] ); - - for ( n = 0; n < num_designs; n++ ) - { - blend->privates [n] = 0; - blend->font_infos[n] = 0; - blend->bboxes [n] = 0; - } - - /* release weight vectors */ - FT_FREE( blend->weight_vector ); - blend->default_weight_vector = 0; - - /* release axis names */ - for ( n = 0; n < num_axis; n++ ) - FT_FREE( blend->axis_names[n] ); - - /* release design map */ - for ( n = 0; n < num_axis; n++ ) - { - PS_DesignMap dmap = blend->design_map + n; - - - FT_FREE( dmap->design_points ); - dmap->num_points = 0; - } - - FT_FREE( face->blend ); - } - } - - - static void - parse_blend_axis_types( T1_Face face, - T1_Loader loader ) - { - T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; - FT_Int n, num_axis; - FT_Error error = T1_Err_Ok; - PS_Blend blend; - FT_Memory memory; - - - /* take an array of objects */ - T1_ToTokenArray( &loader->parser, axis_tokens, - T1_MAX_MM_AXIS, &num_axis ); - if ( num_axis < 0 ) - { - error = T1_Err_Ignore; - goto Exit; - } - if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS ) - { - FT_ERROR(( "parse_blend_axis_types: incorrect number of axes: %d\n", - num_axis )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - /* allocate blend if necessary */ - error = t1_allocate_blend( face, 0, (FT_UInt)num_axis ); - if ( error ) - goto Exit; - - blend = face->blend; - memory = face->root.memory; - - /* each token is an immediate containing the name of the axis */ - for ( n = 0; n < num_axis; n++ ) - { - T1_Token token = axis_tokens + n; - FT_Byte* name; - FT_PtrDist len; - - - /* skip first slash, if any */ - if ( token->start[0] == '/' ) - token->start++; - - len = token->limit - token->start; - if ( len == 0 ) - { - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - if ( FT_ALLOC( blend->axis_names[n], len + 1 ) ) - goto Exit; - - name = (FT_Byte*)blend->axis_names[n]; - FT_MEM_COPY( name, token->start, len ); - name[len] = 0; - } - - Exit: - loader->parser.root.error = error; - } - - - static void - parse_blend_design_positions( T1_Face face, - T1_Loader loader ) - { - T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; - FT_Int num_designs; - FT_Int num_axis; - T1_Parser parser = &loader->parser; - - FT_Error error = T1_Err_Ok; - PS_Blend blend; - - - /* get the array of design tokens -- compute number of designs */ - T1_ToTokenArray( parser, design_tokens, - T1_MAX_MM_DESIGNS, &num_designs ); - if ( num_designs < 0 ) - { - error = T1_Err_Ignore; - goto Exit; - } - if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS ) - { - FT_ERROR(( "parse_blend_design_positions:" )); - FT_ERROR(( " incorrect number of designs: %d\n", - num_designs )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - { - FT_Byte* old_cursor = parser->root.cursor; - FT_Byte* old_limit = parser->root.limit; - FT_Int n; - - - blend = face->blend; - num_axis = 0; /* make compiler happy */ - - for ( n = 0; n < num_designs; n++ ) - { - T1_TokenRec axis_tokens[T1_MAX_MM_DESIGNS]; - T1_Token token; - FT_Int axis, n_axis; - - - /* read axis/coordinates tokens */ - token = design_tokens + n; - parser->root.cursor = token->start; - parser->root.limit = token->limit; - T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &n_axis ); - - if ( n == 0 ) - { - num_axis = n_axis; - error = t1_allocate_blend( face, num_designs, num_axis ); - if ( error ) - goto Exit; - blend = face->blend; - } - else if ( n_axis != num_axis ) - { - FT_ERROR(( "parse_blend_design_positions: incorrect table\n" )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - /* now read each axis token into the design position */ - for ( axis = 0; axis < n_axis; axis++ ) - { - T1_Token token2 = axis_tokens + axis; - - - parser->root.cursor = token2->start; - parser->root.limit = token2->limit; - blend->design_pos[n][axis] = T1_ToFixed( parser, 0 ); - } - } - - loader->parser.root.cursor = old_cursor; - loader->parser.root.limit = old_limit; - } - - Exit: - loader->parser.root.error = error; - } - - - static void - parse_blend_design_map( T1_Face face, - T1_Loader loader ) - { - FT_Error error = T1_Err_Ok; - T1_Parser parser = &loader->parser; - PS_Blend blend; - T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; - FT_Int n, num_axis; - FT_Byte* old_cursor; - FT_Byte* old_limit; - FT_Memory memory = face->root.memory; - - - T1_ToTokenArray( parser, axis_tokens, - T1_MAX_MM_AXIS, &num_axis ); - if ( num_axis < 0 ) - { - error = T1_Err_Ignore; - goto Exit; - } - if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS ) - { - FT_ERROR(( "parse_blend_design_map: incorrect number of axes: %d\n", - num_axis )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - old_cursor = parser->root.cursor; - old_limit = parser->root.limit; - - error = t1_allocate_blend( face, 0, num_axis ); - if ( error ) - goto Exit; - blend = face->blend; - - /* now read each axis design map */ - for ( n = 0; n < num_axis; n++ ) - { - PS_DesignMap map = blend->design_map + n; - T1_Token axis_token; - T1_TokenRec point_tokens[T1_MAX_MM_MAP_POINTS]; - FT_Int p, num_points; - - - axis_token = axis_tokens + n; - - parser->root.cursor = axis_token->start; - parser->root.limit = axis_token->limit; - T1_ToTokenArray( parser, point_tokens, - T1_MAX_MM_MAP_POINTS, &num_points ); - - if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS ) - { - FT_ERROR(( "parse_blend_design_map: incorrect table\n" )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - /* allocate design map data */ - if ( FT_NEW_ARRAY( map->design_points, num_points * 2 ) ) - goto Exit; - map->blend_points = map->design_points + num_points; - map->num_points = (FT_Byte)num_points; - - for ( p = 0; p < num_points; p++ ) - { - T1_Token point_token; - - - point_token = point_tokens + p; - - /* don't include delimiting brackets */ - parser->root.cursor = point_token->start + 1; - parser->root.limit = point_token->limit - 1; - - map->design_points[p] = T1_ToInt( parser ); - map->blend_points [p] = T1_ToFixed( parser, 0 ); - } - } - - parser->root.cursor = old_cursor; - parser->root.limit = old_limit; - - Exit: - parser->root.error = error; - } - - - static void - parse_weight_vector( T1_Face face, - T1_Loader loader ) - { - T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; - FT_Int num_designs; - FT_Error error = T1_Err_Ok; - T1_Parser parser = &loader->parser; - PS_Blend blend = face->blend; - T1_Token token; - FT_Int n; - FT_Byte* old_cursor; - FT_Byte* old_limit; - - - T1_ToTokenArray( parser, design_tokens, - T1_MAX_MM_DESIGNS, &num_designs ); - if ( num_designs < 0 ) - { - error = T1_Err_Ignore; - goto Exit; - } - if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS ) - { - FT_ERROR(( "parse_weight_vector:" )); - FT_ERROR(( " incorrect number of designs: %d\n", - num_designs )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - if ( !blend || !blend->num_designs ) - { - error = t1_allocate_blend( face, num_designs, 0 ); - if ( error ) - goto Exit; - blend = face->blend; - } - else if ( blend->num_designs != (FT_UInt)num_designs ) - { - FT_ERROR(( "parse_weight_vector:" - " /BlendDesignPosition and /WeightVector have\n" )); - FT_ERROR(( " " - " different number of elements!\n" )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - old_cursor = parser->root.cursor; - old_limit = parser->root.limit; - - for ( n = 0; n < num_designs; n++ ) - { - token = design_tokens + n; - parser->root.cursor = token->start; - parser->root.limit = token->limit; - - blend->default_weight_vector[n] = - blend->weight_vector[n] = T1_ToFixed( parser, 0 ); - } - - parser->root.cursor = old_cursor; - parser->root.limit = old_limit; - - Exit: - parser->root.error = error; - } - - - /* e.g., /BuildCharArray [0 0 0 0 0 0 0 0] def */ - /* we're only interested in the number of array elements */ - static void - parse_buildchar( T1_Face face, - T1_Loader loader ) - { - face->len_buildchar = T1_ToFixedArray( &loader->parser, 0, NULL, 0 ); - - return; - } - - -#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */ - - - - - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** TYPE 1 SYMBOL PARSING *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - - static FT_Error - t1_load_keyword( T1_Face face, - T1_Loader loader, - const T1_Field field ) - { - FT_Error error; - void* dummy_object; - void** objects; - FT_UInt max_objects; - PS_Blend blend = face->blend; - - - /* if the keyword has a dedicated callback, call it */ - if ( field->type == T1_FIELD_TYPE_CALLBACK ) - { - field->reader( (FT_Face)face, loader ); - error = loader->parser.root.error; - goto Exit; - } - - /* now, the keyword is either a simple field, or a table of fields; */ - /* we are now going to take care of it */ - switch ( field->location ) - { - case T1_FIELD_LOCATION_FONT_INFO: - dummy_object = &face->type1.font_info; - objects = &dummy_object; - max_objects = 0; - - if ( blend ) - { - objects = (void**)blend->font_infos; - max_objects = blend->num_designs; - } - break; - - case T1_FIELD_LOCATION_PRIVATE: - dummy_object = &face->type1.private_dict; - objects = &dummy_object; - max_objects = 0; - - if ( blend ) - { - objects = (void**)blend->privates; - max_objects = blend->num_designs; - } - break; - - case T1_FIELD_LOCATION_BBOX: - dummy_object = &face->type1.font_bbox; - objects = &dummy_object; - max_objects = 0; - - if ( blend ) - { - objects = (void**)blend->bboxes; - max_objects = blend->num_designs; - } - break; - - case T1_FIELD_LOCATION_LOADER: - dummy_object = loader; - objects = &dummy_object; - max_objects = 0; - break; - - case T1_FIELD_LOCATION_FACE: - dummy_object = face; - objects = &dummy_object; - max_objects = 0; - break; - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - case T1_FIELD_LOCATION_BLEND: - dummy_object = face->blend; - objects = &dummy_object; - max_objects = 0; - break; -#endif - - default: - dummy_object = &face->type1; - objects = &dummy_object; - max_objects = 0; - } - - if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY || - field->type == T1_FIELD_TYPE_FIXED_ARRAY ) - error = T1_Load_Field_Table( &loader->parser, field, - objects, max_objects, 0 ); - else - error = T1_Load_Field( &loader->parser, field, - objects, max_objects, 0 ); - - Exit: - return error; - } - - - static void - parse_private( T1_Face face, - T1_Loader loader ) - { - FT_UNUSED( face ); - - loader->keywords_encountered |= T1_PRIVATE; - } - - - static int - read_binary_data( T1_Parser parser, - FT_Long* size, - FT_Byte** base ) - { - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; - - - /* the binary data has one of the following formats */ - /* */ - /* `size' [white*] RD white ....... ND */ - /* `size' [white*] -| white ....... |- */ - /* */ - - T1_Skip_Spaces( parser ); - - cur = parser->root.cursor; - - if ( cur < limit && ft_isdigit( *cur ) ) - { - *size = T1_ToInt( parser ); - - T1_Skip_PS_Token( parser ); /* `RD' or `-|' or something else */ - - /* there is only one whitespace char after the */ - /* `RD' or `-|' token */ - *base = parser->root.cursor + 1; - - parser->root.cursor += *size + 1; - return !parser->root.error; - } - - FT_ERROR(( "read_binary_data: invalid size field\n" )); - parser->root.error = T1_Err_Invalid_File_Format; - return 0; - } - - - /* We now define the routines to handle the `/Encoding', `/Subrs', */ - /* and `/CharStrings' dictionaries. */ - - static void - parse_font_matrix( T1_Face face, - T1_Loader loader ) - { - T1_Parser parser = &loader->parser; - FT_Matrix* matrix = &face->type1.font_matrix; - FT_Vector* offset = &face->type1.font_offset; - FT_Face root = (FT_Face)&face->root; - FT_Fixed temp[6]; - FT_Fixed temp_scale; - FT_Int result; - - - result = T1_ToFixedArray( parser, 6, temp, 3 ); - - if ( result < 0 ) - { - parser->root.error = T1_Err_Invalid_File_Format; - return; - } - - temp_scale = FT_ABS( temp[3] ); - - if ( temp_scale == 0 ) - { - FT_ERROR(( "parse_font_matrix: invalid font matrix\n" )); - parser->root.error = T1_Err_Invalid_File_Format; - return; - } - - /* Set Units per EM based on FontMatrix values. We set the value to */ - /* 1000 / temp_scale, because temp_scale was already multiplied by */ - /* 1000 (in t1_tofixed, from psobjs.c). */ - - root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L, - temp_scale ) >> 16 ); - - /* we need to scale the values by 1.0/temp_scale */ - if ( temp_scale != 0x10000L ) - { - temp[0] = FT_DivFix( temp[0], temp_scale ); - temp[1] = FT_DivFix( temp[1], temp_scale ); - temp[2] = FT_DivFix( temp[2], temp_scale ); - temp[4] = FT_DivFix( temp[4], temp_scale ); - temp[5] = FT_DivFix( temp[5], temp_scale ); - temp[3] = 0x10000L; - } - - matrix->xx = temp[0]; - matrix->yx = temp[1]; - matrix->xy = temp[2]; - matrix->yy = temp[3]; - - /* note that the offsets must be expressed in integer font units */ - offset->x = temp[4] >> 16; - offset->y = temp[5] >> 16; - } - - - static void - parse_encoding( T1_Face face, - T1_Loader loader ) - { - T1_Parser parser = &loader->parser; - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; - - PSAux_Service psaux = (PSAux_Service)face->psaux; - - - T1_Skip_Spaces( parser ); - cur = parser->root.cursor; - if ( cur >= limit ) - { - FT_ERROR(( "parse_encoding: out of bounds!\n" )); - parser->root.error = T1_Err_Invalid_File_Format; - return; - } - - /* if we have a number or `[', the encoding is an array, */ - /* and we must load it now */ - if ( ft_isdigit( *cur ) || *cur == '[' ) - { - T1_Encoding encode = &face->type1.encoding; - FT_Int count, n; - PS_Table char_table = &loader->encoding_table; - FT_Memory memory = parser->root.memory; - FT_Error error; - FT_Bool only_immediates = 0; - - - /* read the number of entries in the encoding; should be 256 */ - if ( *cur == '[' ) - { - count = 256; - only_immediates = 1; - parser->root.cursor++; - } - else - count = (FT_Int)T1_ToInt( parser ); - - T1_Skip_Spaces( parser ); - if ( parser->root.cursor >= limit ) - return; - - /* we use a T1_Table to store our charnames */ - loader->num_chars = encode->num_chars = count; - if ( FT_NEW_ARRAY( encode->char_index, count ) || - FT_NEW_ARRAY( encode->char_name, count ) || - FT_SET_ERROR( psaux->ps_table_funcs->init( - char_table, count, memory ) ) ) - { - parser->root.error = error; - return; - } - - /* We need to `zero' out encoding_table.elements */ - for ( n = 0; n < count; n++ ) - { - char* notdef = (char *)".notdef"; - - - T1_Add_Table( char_table, n, notdef, 8 ); - } - - /* Now we need to read records of the form */ - /* */ - /* ... charcode /charname ... */ - /* */ - /* for each entry in our table. */ - /* */ - /* We simply look for a number followed by an immediate */ - /* name. Note that this ignores correctly the sequence */ - /* that is often seen in type1 fonts: */ - /* */ - /* 0 1 255 { 1 index exch /.notdef put } for dup */ - /* */ - /* used to clean the encoding array before anything else. */ - /* */ - /* Alternatively, if the array is directly given as */ - /* */ - /* /Encoding [ ... ] */ - /* */ - /* we only read immediates. */ - - n = 0; - T1_Skip_Spaces( parser ); - - while ( parser->root.cursor < limit ) - { - cur = parser->root.cursor; - - /* we stop when we encounter a `def' or `]' */ - if ( *cur == 'd' && cur + 3 < limit ) - { - if ( cur[1] == 'e' && - cur[2] == 'f' && - IS_PS_DELIM( cur[3] ) ) - { - FT_TRACE6(( "encoding end\n" )); - cur += 3; - break; - } - } - if ( *cur == ']' ) - { - FT_TRACE6(( "encoding end\n" )); - cur++; - break; - } - - /* check whether we've found an entry */ - if ( ft_isdigit( *cur ) || only_immediates ) - { - FT_Int charcode; - - - if ( only_immediates ) - charcode = n; - else - { - charcode = (FT_Int)T1_ToInt( parser ); - T1_Skip_Spaces( parser ); - } - - cur = parser->root.cursor; - - if ( *cur == '/' && cur + 2 < limit && n < count ) - { - FT_PtrDist len; - - - cur++; - - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - - len = parser->root.cursor - cur; - - parser->root.error = T1_Add_Table( char_table, charcode, - cur, len + 1 ); - if ( parser->root.error ) - return; - char_table->elements[charcode][len] = '\0'; - - n++; - } - } - else - { - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - } - - T1_Skip_Spaces( parser ); - } - - face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; - parser->root.cursor = cur; - } - - /* Otherwise, we should have either `StandardEncoding', */ - /* `ExpertEncoding', or `ISOLatin1Encoding' */ - else - { - if ( cur + 17 < limit && - ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 ) - face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD; - - else if ( cur + 15 < limit && - ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 ) - face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT; - - else if ( cur + 18 < limit && - ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 ) - face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; - - else - parser->root.error = T1_Err_Ignore; - } - } - - - static void - parse_subrs( T1_Face face, - T1_Loader loader ) - { - T1_Parser parser = &loader->parser; - PS_Table table = &loader->subrs; - FT_Memory memory = parser->root.memory; - FT_Error error; - FT_Int n, num_subrs; - - PSAux_Service psaux = (PSAux_Service)face->psaux; - - - T1_Skip_Spaces( parser ); - - /* test for empty array */ - if ( parser->root.cursor < parser->root.limit && - *parser->root.cursor == '[' ) - { - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - if ( parser->root.cursor >= parser->root.limit || - *parser->root.cursor != ']' ) - parser->root.error = T1_Err_Invalid_File_Format; - return; - } - - num_subrs = (FT_Int)T1_ToInt( parser ); - - /* position the parser right before the `dup' of the first subr */ - T1_Skip_PS_Token( parser ); /* `array' */ - if ( parser->root.error ) - return; - T1_Skip_Spaces( parser ); - - /* initialize subrs array -- with synthetic fonts it is possible */ - /* we get here twice */ - if ( !loader->num_subrs ) - { - error = psaux->ps_table_funcs->init( table, num_subrs, memory ); - if ( error ) - goto Fail; - } - - /* the format is simple: */ - /* */ - /* `index' + binary data */ - /* */ - for ( n = 0; n < num_subrs; n++ ) - { - FT_Long idx, size; - FT_Byte* base; - - - /* If the next token isn't `dup', we are also done. This */ - /* happens when there are `holes' in the Subrs array. */ - if ( ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 ) - break; - - T1_Skip_PS_Token( parser ); /* `dup' */ - - idx = T1_ToInt( parser ); - - if ( !read_binary_data( parser, &size, &base ) ) - return; - - /* The binary string is followed by one token, e.g. `NP' */ - /* (bound to `noaccess put') or by two separate tokens: */ - /* `noaccess' & `put'. We position the parser right */ - /* before the next `dup', if any. */ - T1_Skip_PS_Token( parser ); /* `NP' or `|' or `noaccess' */ - if ( parser->root.error ) - return; - T1_Skip_Spaces ( parser ); - - if ( ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 ) - { - T1_Skip_PS_Token( parser ); /* skip `put' */ - T1_Skip_Spaces ( parser ); - } - - /* with synthetic fonts it is possible we get here twice */ - if ( loader->num_subrs ) - continue; - - /* some fonts use a value of -1 for lenIV to indicate that */ - /* the charstrings are unencoded */ - /* */ - /* thanks to Tom Kacvinsky for pointing this out */ - /* */ - if ( face->type1.private_dict.lenIV >= 0 ) - { - FT_Byte* temp; - - - if ( size <= face->type1.private_dict.lenIV ) - { - error = T1_Err_Invalid_File_Format; - goto Fail; - } - - /* t1_decrypt() shouldn't write to base -- make temporary copy */ - if ( FT_ALLOC( temp, size ) ) - goto Fail; - FT_MEM_COPY( temp, base, size ); - psaux->t1_decrypt( temp, size, 4330 ); - size -= face->type1.private_dict.lenIV; - error = T1_Add_Table( table, (FT_Int)idx, - temp + face->type1.private_dict.lenIV, size ); - FT_FREE( temp ); - } - else - error = T1_Add_Table( table, (FT_Int)idx, base, size ); - if ( error ) - goto Fail; - } - - if ( !loader->num_subrs ) - loader->num_subrs = num_subrs; - - return; - - Fail: - parser->root.error = error; - } - - -#define TABLE_EXTEND 5 - - - static void - parse_charstrings( T1_Face face, - T1_Loader loader ) - { - T1_Parser parser = &loader->parser; - PS_Table code_table = &loader->charstrings; - PS_Table name_table = &loader->glyph_names; - PS_Table swap_table = &loader->swap_table; - FT_Memory memory = parser->root.memory; - FT_Error error; - - PSAux_Service psaux = (PSAux_Service)face->psaux; - - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; - FT_Int n, num_glyphs; - FT_UInt notdef_index = 0; - FT_Byte notdef_found = 0; - - - num_glyphs = (FT_Int)T1_ToInt( parser ); - /* some fonts like Optima-Oblique not only define the /CharStrings */ - /* array but access it also */ - if ( num_glyphs == 0 || parser->root.error ) - return; - - /* initialize tables, leaving space for addition of .notdef, */ - /* if necessary, and a few other glyphs to handle buggy */ - /* fonts which have more glyphs than specified. */ - - /* for some non-standard fonts like `Optima' which provides */ - /* different outlines depending on the resolution it is */ - /* possible to get here twice */ - if ( !loader->num_glyphs ) - { - error = psaux->ps_table_funcs->init( - code_table, num_glyphs + 1 + TABLE_EXTEND, memory ); - if ( error ) - goto Fail; - - error = psaux->ps_table_funcs->init( - name_table, num_glyphs + 1 + TABLE_EXTEND, memory ); - if ( error ) - goto Fail; - - /* Initialize table for swapping index notdef_index and */ - /* index 0 names and codes (if necessary). */ - - error = psaux->ps_table_funcs->init( swap_table, 4, memory ); - if ( error ) - goto Fail; - } - - n = 0; - - for (;;) - { - FT_Long size; - FT_Byte* base; - - - /* the format is simple: */ - /* `/glyphname' + binary data */ - - T1_Skip_Spaces( parser ); - - cur = parser->root.cursor; - if ( cur >= limit ) - break; - - /* we stop when we find a `def' or `end' keyword */ - if ( cur + 3 < limit && IS_PS_DELIM( cur[3] ) ) - { - if ( cur[0] == 'd' && - cur[1] == 'e' && - cur[2] == 'f' ) - { - /* There are fonts which have this: */ - /* */ - /* /CharStrings 118 dict def */ - /* Private begin */ - /* CharStrings begin */ - /* ... */ - /* */ - /* To catch this we ignore `def' if */ - /* no charstring has actually been */ - /* seen. */ - if ( n ) - break; - } - - if ( cur[0] == 'e' && - cur[1] == 'n' && - cur[2] == 'd' ) - break; - } - - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - - if ( *cur == '/' ) - { - FT_PtrDist len; - - - if ( cur + 1 >= limit ) - { - error = T1_Err_Invalid_File_Format; - goto Fail; - } - - cur++; /* skip `/' */ - len = parser->root.cursor - cur; - - if ( !read_binary_data( parser, &size, &base ) ) - return; - - /* for some non-standard fonts like `Optima' which provides */ - /* different outlines depending on the resolution it is */ - /* possible to get here twice */ - if ( loader->num_glyphs ) - continue; - - error = T1_Add_Table( name_table, n, cur, len + 1 ); - if ( error ) - goto Fail; - - /* add a trailing zero to the name table */ - name_table->elements[n][len] = '\0'; - - /* record index of /.notdef */ - if ( *cur == '.' && - ft_strcmp( ".notdef", - (const char*)(name_table->elements[n]) ) == 0 ) - { - notdef_index = n; - notdef_found = 1; - } - - if ( face->type1.private_dict.lenIV >= 0 && - n < num_glyphs + TABLE_EXTEND ) - { - FT_Byte* temp; - - - if ( size <= face->type1.private_dict.lenIV ) - { - error = T1_Err_Invalid_File_Format; - goto Fail; - } - - /* t1_decrypt() shouldn't write to base -- make temporary copy */ - if ( FT_ALLOC( temp, size ) ) - goto Fail; - FT_MEM_COPY( temp, base, size ); - psaux->t1_decrypt( temp, size, 4330 ); - size -= face->type1.private_dict.lenIV; - error = T1_Add_Table( code_table, n, - temp + face->type1.private_dict.lenIV, size ); - FT_FREE( temp ); - } - else - error = T1_Add_Table( code_table, n, base, size ); - if ( error ) - goto Fail; - - n++; - } - } - - if ( loader->num_glyphs ) - return; - else - loader->num_glyphs = n; - - /* if /.notdef is found but does not occupy index 0, do our magic. */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)name_table->elements[0] ) && - notdef_found ) - { - /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ - /* name and code entries to swap_table. Then place notdef_index */ - /* name and code entries into swap_table. Then swap name and code */ - /* entries at indices notdef_index and 0 using values stored in */ - /* swap_table. */ - - /* Index 0 name */ - error = T1_Add_Table( swap_table, 0, - name_table->elements[0], - name_table->lengths [0] ); - if ( error ) - goto Fail; - - /* Index 0 code */ - error = T1_Add_Table( swap_table, 1, - code_table->elements[0], - code_table->lengths [0] ); - if ( error ) - goto Fail; - - /* Index notdef_index name */ - error = T1_Add_Table( swap_table, 2, - name_table->elements[notdef_index], - name_table->lengths [notdef_index] ); - if ( error ) - goto Fail; - - /* Index notdef_index code */ - error = T1_Add_Table( swap_table, 3, - code_table->elements[notdef_index], - code_table->lengths [notdef_index] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, notdef_index, - swap_table->elements[0], - swap_table->lengths [0] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, notdef_index, - swap_table->elements[1], - swap_table->lengths [1] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, 0, - swap_table->elements[2], - swap_table->lengths [2] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, 0, - swap_table->elements[3], - swap_table->lengths [3] ); - if ( error ) - goto Fail; - - } - else if ( !notdef_found ) - { - /* notdef_index is already 0, or /.notdef is undefined in */ - /* charstrings dictionary. Worry about /.notdef undefined. */ - /* We take index 0 and add it to the end of the table(s) */ - /* and add our own /.notdef glyph to index 0. */ - - /* 0 333 hsbw endchar */ - FT_Byte notdef_glyph[] = {0x8B, 0xF7, 0xE1, 0x0D, 0x0E}; - char* notdef_name = (char *)".notdef"; - - - error = T1_Add_Table( swap_table, 0, - name_table->elements[0], - name_table->lengths [0] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( swap_table, 1, - code_table->elements[0], - code_table->lengths [0] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, 0, notdef_name, 8 ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, 0, notdef_glyph, 5 ); - - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, n, - swap_table->elements[0], - swap_table->lengths [0] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, n, - swap_table->elements[1], - swap_table->lengths [1] ); - if ( error ) - goto Fail; - - /* we added a glyph. */ - loader->num_glyphs = n + 1; - } - - return; - - Fail: - parser->root.error = error; - } - - - /*************************************************************************/ - /* */ - /* Define the token field static variables. This is a set of */ - /* T1_FieldRec variables. */ - /* */ - /*************************************************************************/ - - - static - const T1_FieldRec t1_keywords[] = - { - -#include "t1tokens.h" - - /* now add the special functions... */ - T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_CALLBACK( "Encoding", parse_encoding, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_CALLBACK( "Subrs", parse_subrs, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_CALLBACK( "CharStrings", parse_charstrings, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_CALLBACK( "Private", parse_private, - T1_FIELD_DICT_FONTDICT ) - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - T1_FIELD_CALLBACK( "BlendDesignPositions", parse_blend_design_positions, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_CALLBACK( "BlendDesignMap", parse_blend_design_map, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_CALLBACK( "BlendAxisTypes", parse_blend_axis_types, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_CALLBACK( "WeightVector", parse_weight_vector, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_CALLBACK( "BuildCharArray", parse_buildchar, - T1_FIELD_DICT_PRIVATE ) -#endif - - { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 } - }; - - -#define T1_FIELD_COUNT \ - ( sizeof ( t1_keywords ) / sizeof ( t1_keywords[0] ) ) - - - static FT_Error - parse_dict( T1_Face face, - T1_Loader loader, - FT_Byte* base, - FT_Long size ) - { - T1_Parser parser = &loader->parser; - FT_Byte *limit, *start_binary = NULL; - FT_Bool have_integer = 0; - - - parser->root.cursor = base; - parser->root.limit = base + size; - parser->root.error = T1_Err_Ok; - - limit = parser->root.limit; - - T1_Skip_Spaces( parser ); - - while ( parser->root.cursor < limit ) - { - FT_Byte* cur; - - - cur = parser->root.cursor; - - /* look for `eexec' */ - if ( IS_PS_TOKEN( cur, limit, "eexec" ) ) - break; - - /* look for `closefile' which ends the eexec section */ - else if ( IS_PS_TOKEN( cur, limit, "closefile" ) ) - break; - - /* in a synthetic font the base font starts after a */ - /* `FontDictionary' token that is placed after a Private dict */ - else if ( IS_PS_TOKEN( cur, limit, "FontDirectory" ) ) - { - if ( loader->keywords_encountered & T1_PRIVATE ) - loader->keywords_encountered |= - T1_FONTDIR_AFTER_PRIVATE; - parser->root.cursor += 13; - } - - /* check whether we have an integer */ - else if ( ft_isdigit( *cur ) ) - { - start_binary = cur; - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; - have_integer = 1; - } - - /* in valid Type 1 fonts we don't see `RD' or `-|' directly */ - /* since those tokens are handled by parse_subrs and */ - /* parse_charstrings */ - else if ( *cur == 'R' && cur + 6 < limit && *(cur + 1) == 'D' && - have_integer ) - { - FT_Long s; - FT_Byte* b; - - - parser->root.cursor = start_binary; - if ( !read_binary_data( parser, &s, &b ) ) - return T1_Err_Invalid_File_Format; - have_integer = 0; - } - - else if ( *cur == '-' && cur + 6 < limit && *(cur + 1) == '|' && - have_integer ) - { - FT_Long s; - FT_Byte* b; - - - parser->root.cursor = start_binary; - if ( !read_binary_data( parser, &s, &b ) ) - return T1_Err_Invalid_File_Format; - have_integer = 0; - } - - /* look for immediates */ - else if ( *cur == '/' && cur + 2 < limit ) - { - FT_PtrDist len; - - - cur++; - - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; - - len = parser->root.cursor - cur; - - if ( len > 0 && len < 22 && parser->root.cursor < limit ) - { - /* now compare the immediate name to the keyword table */ - T1_Field keyword = (T1_Field)t1_keywords; - - - for (;;) - { - FT_Byte* name; - - - name = (FT_Byte*)keyword->ident; - if ( !name ) - break; - - if ( cur[0] == name[0] && - len == (FT_PtrDist)ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) - { - /* We found it -- run the parsing callback! */ - /* We record every instance of every field */ - /* (until we reach the base font of a */ - /* synthetic font) to deal adequately with */ - /* multiple master fonts; this is also */ - /* necessary because later PostScript */ - /* definitions override earlier ones. */ - - /* Once we encounter `FontDirectory' after */ - /* `/Private', we know that this is a synthetic */ - /* font; except for `/CharStrings' we are not */ - /* interested in anything that follows this */ - /* `FontDirectory'. */ - - /* MM fonts have more than one /Private token at */ - /* the top level; let's hope that all the junk */ - /* that follows the first /Private token is not */ - /* interesting to us. */ - - /* According to Adobe Tech Note #5175 (CID-Keyed */ - /* Font Installation for ATM Software) a `begin' */ - /* must be followed by exactly one `end', and */ - /* `begin' -- `end' pairs must be accurately */ - /* paired. We could use this to distinguish */ - /* between the global Private and the Private */ - /* dict that is a member of the Blend dict. */ - - const FT_UInt dict = - ( loader->keywords_encountered & T1_PRIVATE ) - ? T1_FIELD_DICT_PRIVATE - : T1_FIELD_DICT_FONTDICT; - - if ( !( dict & keyword->dict ) ) - { - FT_TRACE1(( "parse_dict: found %s but ignoring it " - "since it is in the wrong dictionary\n", - keyword->ident )); - break; - } - - if ( !( loader->keywords_encountered & - T1_FONTDIR_AFTER_PRIVATE ) || - ft_strcmp( (const char*)name, "CharStrings" ) == 0 ) - { - parser->root.error = t1_load_keyword( face, - loader, - keyword ); - if ( parser->root.error != T1_Err_Ok ) - { - if ( FT_ERROR_BASE( parser->root.error ) == FT_Err_Ignore ) - parser->root.error = T1_Err_Ok; - else - return parser->root.error; - } - } - break; - } - - keyword++; - } - } - - have_integer = 0; - } - else - { - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; - have_integer = 0; - } - - T1_Skip_Spaces( parser ); - } - - Exit: - return parser->root.error; - } - - - static void - t1_init_loader( T1_Loader loader, - T1_Face face ) - { - FT_UNUSED( face ); - - FT_MEM_ZERO( loader, sizeof ( *loader ) ); - loader->num_glyphs = 0; - loader->num_chars = 0; - - /* initialize the tables -- simply set their `init' field to 0 */ - loader->encoding_table.init = 0; - loader->charstrings.init = 0; - loader->glyph_names.init = 0; - loader->subrs.init = 0; - loader->swap_table.init = 0; - loader->fontdata = 0; - loader->keywords_encountered = 0; - } - - - static void - t1_done_loader( T1_Loader loader ) - { - T1_Parser parser = &loader->parser; - - - /* finalize tables */ - T1_Release_Table( &loader->encoding_table ); - T1_Release_Table( &loader->charstrings ); - T1_Release_Table( &loader->glyph_names ); - T1_Release_Table( &loader->swap_table ); - T1_Release_Table( &loader->subrs ); - - /* finalize parser */ - T1_Finalize_Parser( parser ); - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Open_Face( T1_Face face ) - { - T1_LoaderRec loader; - T1_Parser parser; - T1_Font type1 = &face->type1; - PS_Private priv = &type1->private_dict; - FT_Error error; - - PSAux_Service psaux = (PSAux_Service)face->psaux; - - - t1_init_loader( &loader, face ); - - /* default values */ - face->ndv_idx = -1; - face->cdv_idx = -1; - face->len_buildchar = 0; - - priv->blue_shift = 7; - priv->blue_fuzz = 1; - priv->lenIV = 4; - priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L ); - priv->blue_scale = (FT_Fixed)( 0.039625 * 0x10000L * 1000 ); - - parser = &loader.parser; - error = T1_New_Parser( parser, - face->root.stream, - face->root.memory, - psaux ); - if ( error ) - goto Exit; - - error = parse_dict( face, &loader, - parser->base_dict, parser->base_len ); - if ( error ) - goto Exit; - - error = T1_Get_Private_Dict( parser, psaux ); - if ( error ) - goto Exit; - - error = parse_dict( face, &loader, - parser->private_dict, parser->private_len ); - if ( error ) - goto Exit; - - /* ensure even-ness of `num_blue_values' */ - priv->num_blue_values &= ~1; - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - - if ( face->blend && - face->blend->num_default_design_vector != 0 && - face->blend->num_default_design_vector != face->blend->num_axis ) - { - /* we don't use it currently so just warn, reset, and ignore */ - FT_ERROR(( "T1_Open_Face(): /DesignVector contains %u entries " - "while there are %u axes.\n", - face->blend->num_default_design_vector, - face->blend->num_axis )); - - face->blend->num_default_design_vector = 0; - } - - /* the following can happen for MM instances; we then treat the */ - /* font as a normal PS font */ - if ( face->blend && - ( !face->blend->num_designs || !face->blend->num_axis ) ) - T1_Done_Blend( face ); - - /* another safety check */ - if ( face->blend ) - { - FT_UInt i; - - - for ( i = 0; i < face->blend->num_axis; i++ ) - if ( !face->blend->design_map[i].num_points ) - { - T1_Done_Blend( face ); - break; - } - } - - if ( face->blend ) - { - if ( face->len_buildchar > 0 ) - { - FT_Memory memory = face->root.memory; - - - if ( FT_NEW_ARRAY( face->buildchar, face->len_buildchar ) ) - { - FT_ERROR(( "T1_Open_Face: cannot allocate BuildCharArray\n" )); - face->len_buildchar = 0; - goto Exit; - } - } - } - -#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */ - - /* now, propagate the subrs, charstrings, and glyphnames tables */ - /* to the Type1 data */ - type1->num_glyphs = loader.num_glyphs; - - if ( loader.subrs.init ) - { - loader.subrs.init = 0; - type1->num_subrs = loader.num_subrs; - type1->subrs_block = loader.subrs.block; - type1->subrs = loader.subrs.elements; - type1->subrs_len = loader.subrs.lengths; - } - -#ifdef FT_CONFIG_OPTION_INCREMENTAL - if ( !face->root.internal->incremental_interface ) -#endif - if ( !loader.charstrings.init ) - { - FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face!\n" )); - error = T1_Err_Invalid_File_Format; - } - - loader.charstrings.init = 0; - type1->charstrings_block = loader.charstrings.block; - type1->charstrings = loader.charstrings.elements; - type1->charstrings_len = loader.charstrings.lengths; - - /* we copy the glyph names `block' and `elements' fields; */ - /* the `lengths' field must be released later */ - type1->glyph_names_block = loader.glyph_names.block; - type1->glyph_names = (FT_String**)loader.glyph_names.elements; - loader.glyph_names.block = 0; - loader.glyph_names.elements = 0; - - /* we must now build type1.encoding when we have a custom array */ - if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) - { - FT_Int charcode, idx, min_char, max_char; - FT_Byte* char_name; - FT_Byte* glyph_name; - - - /* OK, we do the following: for each element in the encoding */ - /* table, look up the index of the glyph having the same name */ - /* the index is then stored in type1.encoding.char_index, and */ - /* a the name to type1.encoding.char_name */ - - min_char = +32000; - max_char = -32000; - - charcode = 0; - for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) - { - type1->encoding.char_index[charcode] = 0; - type1->encoding.char_name [charcode] = (char *)".notdef"; - - char_name = loader.encoding_table.elements[charcode]; - if ( char_name ) - for ( idx = 0; idx < type1->num_glyphs; idx++ ) - { - glyph_name = (FT_Byte*)type1->glyph_names[idx]; - if ( ft_strcmp( (const char*)char_name, - (const char*)glyph_name ) == 0 ) - { - type1->encoding.char_index[charcode] = (FT_UShort)idx; - type1->encoding.char_name [charcode] = (char*)glyph_name; - - /* Change min/max encoded char only if glyph name is */ - /* not /.notdef */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)glyph_name ) != 0 ) - { - if ( charcode < min_char ) - min_char = charcode; - if ( charcode > max_char ) - max_char = charcode; - } - break; - } - } - } - - /* - * Yes, this happens: Certain PDF-embedded fonts have only a - * `.notdef' glyph defined! - */ - - if ( min_char > max_char ) - { - min_char = 0; - max_char = loader.encoding_table.max_elems; - } - - type1->encoding.code_first = min_char; - type1->encoding.code_last = max_char; - type1->encoding.num_chars = loader.num_chars; - } - - Exit: - t1_done_loader( &loader ); - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t1load.c */ +/* */ +/* Type 1 font loader (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This is the new and improved Type 1 data loader for FreeType 2. The */ + /* old loader has several problems: it is slow, complex, difficult to */ + /* maintain, and contains incredible hacks to make it accept some */ + /* ill-formed Type 1 fonts without hiccup-ing. Moreover, about 5% of */ + /* the Type 1 fonts on my machine still aren't loaded correctly by it. */ + /* */ + /* This version is much simpler, much faster and also easier to read and */ + /* maintain by a great order of magnitude. The idea behind it is to */ + /* _not_ try to read the Type 1 token stream with a state machine (i.e. */ + /* a Postscript-like interpreter) but rather to perform simple pattern */ + /* matching. */ + /* */ + /* Indeed, nearly all data definitions follow a simple pattern like */ + /* */ + /* ... /Field ... */ + /* */ + /* where can be a number, a boolean, a string, or an array of */ + /* numbers. There are a few exceptions, namely the encoding, font name, */ + /* charstrings, and subrs; they are handled with a special pattern */ + /* matching routine. */ + /* */ + /* All other common cases are handled very simply. The matching rules */ + /* are defined in the file `t1tokens.h' through the use of several */ + /* macros calls PARSE_XXX. This file is included twice here; the first */ + /* time to generate parsing callback functions, the second time to */ + /* generate a table of keywords (with pointers to the associated */ + /* callback functions). */ + /* */ + /* The function `parse_dict' simply scans *linearly* a given dictionary */ + /* (either the top-level or private one) and calls the appropriate */ + /* callback when it encounters an immediate keyword. */ + /* */ + /* This is by far the fastest way one can find to parse and read all */ + /* data. */ + /* */ + /* This led to tremendous code size reduction. Note that later, the */ + /* glyph loader will also be _greatly_ simplified, and the automatic */ + /* hinter will replace the clumsy `t1hinter'. */ + /* */ + /*************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_CONFIG_CONFIG_H +#include FT_MULTIPLE_MASTERS_H +#include FT_INTERNAL_TYPE1_TYPES_H + +#include "t1load.h" +#include "t1errors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t1load + + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** MULTIPLE MASTERS SUPPORT *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static FT_Error + t1_allocate_blend( T1_Face face, + FT_UInt num_designs, + FT_UInt num_axis ) + { + PS_Blend blend; + FT_Memory memory = face->root.memory; + FT_Error error = T1_Err_Ok; + + + blend = face->blend; + if ( !blend ) + { + if ( FT_NEW( blend ) ) + goto Exit; + + blend->num_default_design_vector = 0; + + face->blend = blend; + } + + /* allocate design data if needed */ + if ( num_designs > 0 ) + { + if ( blend->num_designs == 0 ) + { + FT_UInt nn; + + + /* allocate the blend `private' and `font_info' dictionaries */ + if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs ) || + FT_NEW_ARRAY( blend->privates[1], num_designs ) || + FT_NEW_ARRAY( blend->bboxes[1], num_designs ) || + FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) ) + goto Exit; + + blend->default_weight_vector = blend->weight_vector + num_designs; + + blend->font_infos[0] = &face->type1.font_info; + blend->privates [0] = &face->type1.private_dict; + blend->bboxes [0] = &face->type1.font_bbox; + + for ( nn = 2; nn <= num_designs; nn++ ) + { + blend->privates[nn] = blend->privates [nn - 1] + 1; + blend->font_infos[nn] = blend->font_infos[nn - 1] + 1; + blend->bboxes[nn] = blend->bboxes [nn - 1] + 1; + } + + blend->num_designs = num_designs; + } + else if ( blend->num_designs != num_designs ) + goto Fail; + } + + /* allocate axis data if needed */ + if ( num_axis > 0 ) + { + if ( blend->num_axis != 0 && blend->num_axis != num_axis ) + goto Fail; + + blend->num_axis = num_axis; + } + + /* allocate the blend design pos table if needed */ + num_designs = blend->num_designs; + num_axis = blend->num_axis; + if ( num_designs && num_axis && blend->design_pos[0] == 0 ) + { + FT_UInt n; + + + if ( FT_NEW_ARRAY( blend->design_pos[0], num_designs * num_axis ) ) + goto Exit; + + for ( n = 1; n < num_designs; n++ ) + blend->design_pos[n] = blend->design_pos[0] + num_axis * n; + } + + Exit: + return error; + + Fail: + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Get_Multi_Master( T1_Face face, + FT_Multi_Master* master ) + { + PS_Blend blend = face->blend; + FT_UInt n; + FT_Error error; + + + error = T1_Err_Invalid_Argument; + + if ( blend ) + { + master->num_axis = blend->num_axis; + master->num_designs = blend->num_designs; + + for ( n = 0; n < blend->num_axis; n++ ) + { + FT_MM_Axis* axis = master->axis + n; + PS_DesignMap map = blend->design_map + n; + + + axis->name = blend->axis_names[n]; + axis->minimum = map->design_points[0]; + axis->maximum = map->design_points[map->num_points - 1]; + } + + error = T1_Err_Ok; + } + + return error; + } + + +#define FT_INT_TO_FIXED( a ) ( (a) << 16 ) +#define FT_FIXED_TO_INT( a ) ( FT_RoundFix( a ) >> 16 ) + + + /*************************************************************************/ + /* */ + /* Given a normalized (blend) coordinate, figure out the design */ + /* coordinate appropriate for that value. */ + /* */ + FT_LOCAL_DEF( FT_Fixed ) + mm_axis_unmap( PS_DesignMap axismap, + FT_Fixed ncv ) + { + int j; + + + if ( ncv <= axismap->blend_points[0] ) + return axismap->design_points[0]; + + for ( j = 1; j < axismap->num_points; ++j ) + { + if ( ncv <= axismap->blend_points[j] ) + { + FT_Fixed t = FT_MulDiv( ncv - axismap->blend_points[j - 1], + 0x10000L, + axismap->blend_points[j] - + axismap->blend_points[j - 1] ); + + + return axismap->design_points[j - 1] + + FT_MulDiv( t, + axismap->design_points[j] - + axismap->design_points[j - 1], + 1L ); + } + } + + return axismap->design_points[axismap->num_points - 1]; + } + + + /*************************************************************************/ + /* */ + /* Given a vector of weights, one for each design, figure out the */ + /* normalized axis coordinates which gave rise to those weights. */ + /* */ + FT_LOCAL_DEF( void ) + mm_weights_unmap( FT_Fixed* weights, + FT_Fixed* axiscoords, + FT_UInt axis_count ) + { + FT_ASSERT( axis_count <= T1_MAX_MM_AXIS ); + + if ( axis_count == 1 ) + axiscoords[0] = weights[1]; + + else if ( axis_count == 2 ) + { + axiscoords[0] = weights[3] + weights[1]; + axiscoords[1] = weights[3] + weights[2]; + } + + else if ( axis_count == 3 ) + { + axiscoords[0] = weights[7] + weights[5] + weights[3] + weights[1]; + axiscoords[1] = weights[7] + weights[6] + weights[3] + weights[2]; + axiscoords[2] = weights[7] + weights[6] + weights[5] + weights[4]; + } + + else + { + axiscoords[0] = weights[15] + weights[13] + weights[11] + weights[9] + + weights[7] + weights[5] + weights[3] + weights[1]; + axiscoords[1] = weights[15] + weights[14] + weights[11] + weights[10] + + weights[7] + weights[6] + weights[3] + weights[2]; + axiscoords[2] = weights[15] + weights[14] + weights[13] + weights[12] + + weights[7] + weights[6] + weights[5] + weights[4]; + axiscoords[3] = weights[15] + weights[14] + weights[13] + weights[12] + + weights[11] + weights[10] + weights[9] + weights[8]; + } + } + + + /*************************************************************************/ + /* */ + /* Just a wrapper around T1_Get_Multi_Master to support the different */ + /* arguments needed by the GX var distortable fonts. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + T1_Get_MM_Var( T1_Face face, + FT_MM_Var* *master ) + { + FT_Memory memory = face->root.memory; + FT_MM_Var *mmvar; + FT_Multi_Master mmaster; + FT_Error error; + FT_UInt i; + FT_Fixed axiscoords[T1_MAX_MM_AXIS]; + PS_Blend blend = face->blend; + + + error = T1_Get_Multi_Master( face, &mmaster ); + if ( error ) + goto Exit; + if ( FT_ALLOC( mmvar, + sizeof ( FT_MM_Var ) + + mmaster.num_axis * sizeof ( FT_Var_Axis ) ) ) + goto Exit; + + mmvar->num_axis = mmaster.num_axis; + mmvar->num_designs = mmaster.num_designs; + mmvar->num_namedstyles = (FT_UInt)-1; /* Does not apply */ + mmvar->axis = (FT_Var_Axis*)&mmvar[1]; + /* Point to axes after MM_Var struct */ + mmvar->namedstyle = NULL; + + for ( i = 0 ; i < mmaster.num_axis; ++i ) + { + mmvar->axis[i].name = mmaster.axis[i].name; + mmvar->axis[i].minimum = FT_INT_TO_FIXED( mmaster.axis[i].minimum); + mmvar->axis[i].maximum = FT_INT_TO_FIXED( mmaster.axis[i].maximum); + mmvar->axis[i].def = ( mmvar->axis[i].minimum + + mmvar->axis[i].maximum ) / 2; + /* Does not apply. But this value is in range */ + mmvar->axis[i].strid = 0xFFFFFFFFUL; /* Does not apply */ + mmvar->axis[i].tag = 0xFFFFFFFFUL; /* Does not apply */ + + if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 ) + mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' ); + else if ( ft_strcmp( mmvar->axis[i].name, "Width" ) == 0 ) + mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'd', 't', 'h' ); + else if ( ft_strcmp( mmvar->axis[i].name, "OpticalSize" ) == 0 ) + mmvar->axis[i].tag = FT_MAKE_TAG( 'o', 'p', 's', 'z' ); + } + + if ( blend->num_designs == 1U << blend->num_axis ) + { + mm_weights_unmap( blend->default_weight_vector, + axiscoords, + blend->num_axis ); + + for ( i = 0; i < mmaster.num_axis; ++i ) + mmvar->axis[i].def = + FT_INT_TO_FIXED( mm_axis_unmap( &blend->design_map[i], + axiscoords[i] ) ); + } + + *master = mmvar; + + Exit: + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Set_MM_Blend( T1_Face face, + FT_UInt num_coords, + FT_Fixed* coords ) + { + PS_Blend blend = face->blend; + FT_Error error; + FT_UInt n, m; + + + error = T1_Err_Invalid_Argument; + + if ( blend && blend->num_axis == num_coords ) + { + /* recompute the weight vector from the blend coordinates */ + error = T1_Err_Ok; + + for ( n = 0; n < blend->num_designs; n++ ) + { + FT_Fixed result = 0x10000L; /* 1.0 fixed */ + + + for ( m = 0; m < blend->num_axis; m++ ) + { + FT_Fixed factor; + + + /* get current blend axis position */ + factor = coords[m]; + if ( factor < 0 ) factor = 0; + if ( factor > 0x10000L ) factor = 0x10000L; + + if ( ( n & ( 1 << m ) ) == 0 ) + factor = 0x10000L - factor; + + result = FT_MulFix( result, factor ); + } + blend->weight_vector[n] = result; + } + + error = T1_Err_Ok; + } + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Set_MM_Design( T1_Face face, + FT_UInt num_coords, + FT_Long* coords ) + { + PS_Blend blend = face->blend; + FT_Error error; + FT_UInt n, p; + + + error = T1_Err_Invalid_Argument; + if ( blend && blend->num_axis == num_coords ) + { + /* compute the blend coordinates through the blend design map */ + FT_Fixed final_blends[T1_MAX_MM_DESIGNS]; + + + for ( n = 0; n < blend->num_axis; n++ ) + { + FT_Long design = coords[n]; + FT_Fixed the_blend; + PS_DesignMap map = blend->design_map + n; + FT_Long* designs = map->design_points; + FT_Fixed* blends = map->blend_points; + FT_Int before = -1, after = -1; + + + for ( p = 0; p < (FT_UInt)map->num_points; p++ ) + { + FT_Long p_design = designs[p]; + + + /* exact match? */ + if ( design == p_design ) + { + the_blend = blends[p]; + goto Found; + } + + if ( design < p_design ) + { + after = p; + break; + } + + before = p; + } + + /* now interpolate if necessary */ + if ( before < 0 ) + the_blend = blends[0]; + + else if ( after < 0 ) + the_blend = blends[map->num_points - 1]; + + else + the_blend = FT_MulDiv( design - designs[before], + blends [after] - blends [before], + designs[after] - designs[before] ); + + Found: + final_blends[n] = the_blend; + } + + error = T1_Set_MM_Blend( face, num_coords, final_blends ); + } + + return error; + } + + + /*************************************************************************/ + /* */ + /* Just a wrapper around T1_Set_MM_Design to support the different */ + /* arguments needed by the GX var distortable fonts. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + T1_Set_Var_Design( T1_Face face, + FT_UInt num_coords, + FT_Fixed* coords ) + { + FT_Long lcoords[4]; /* maximum axis count is 4 */ + FT_UInt i; + FT_Error error; + + + error = T1_Err_Invalid_Argument; + if ( num_coords <= 4 && num_coords > 0 ) + { + for ( i = 0; i < num_coords; ++i ) + lcoords[i] = FT_FIXED_TO_INT( coords[i] ); + error = T1_Set_MM_Design( face, num_coords, lcoords ); + } + + return error; + } + + + FT_LOCAL_DEF( void ) + T1_Done_Blend( T1_Face face ) + { + FT_Memory memory = face->root.memory; + PS_Blend blend = face->blend; + + + if ( blend ) + { + FT_UInt num_designs = blend->num_designs; + FT_UInt num_axis = blend->num_axis; + FT_UInt n; + + + /* release design pos table */ + FT_FREE( blend->design_pos[0] ); + for ( n = 1; n < num_designs; n++ ) + blend->design_pos[n] = 0; + + /* release blend `private' and `font info' dictionaries */ + FT_FREE( blend->privates[1] ); + FT_FREE( blend->font_infos[1] ); + FT_FREE( blend->bboxes[1] ); + + for ( n = 0; n < num_designs; n++ ) + { + blend->privates [n] = 0; + blend->font_infos[n] = 0; + blend->bboxes [n] = 0; + } + + /* release weight vectors */ + FT_FREE( blend->weight_vector ); + blend->default_weight_vector = 0; + + /* release axis names */ + for ( n = 0; n < num_axis; n++ ) + FT_FREE( blend->axis_names[n] ); + + /* release design map */ + for ( n = 0; n < num_axis; n++ ) + { + PS_DesignMap dmap = blend->design_map + n; + + + FT_FREE( dmap->design_points ); + dmap->num_points = 0; + } + + FT_FREE( face->blend ); + } + } + + + static void + parse_blend_axis_types( T1_Face face, + T1_Loader loader ) + { + T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; + FT_Int n, num_axis; + FT_Error error = T1_Err_Ok; + PS_Blend blend; + FT_Memory memory; + + + /* take an array of objects */ + T1_ToTokenArray( &loader->parser, axis_tokens, + T1_MAX_MM_AXIS, &num_axis ); + if ( num_axis < 0 ) + { + error = T1_Err_Ignore; + goto Exit; + } + if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS ) + { + FT_ERROR(( "parse_blend_axis_types: incorrect number of axes: %d\n", + num_axis )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + /* allocate blend if necessary */ + error = t1_allocate_blend( face, 0, (FT_UInt)num_axis ); + if ( error ) + goto Exit; + + blend = face->blend; + memory = face->root.memory; + + /* each token is an immediate containing the name of the axis */ + for ( n = 0; n < num_axis; n++ ) + { + T1_Token token = axis_tokens + n; + FT_Byte* name; + FT_PtrDist len; + + + /* skip first slash, if any */ + if ( token->start[0] == '/' ) + token->start++; + + len = token->limit - token->start; + if ( len == 0 ) + { + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + if ( FT_ALLOC( blend->axis_names[n], len + 1 ) ) + goto Exit; + + name = (FT_Byte*)blend->axis_names[n]; + FT_MEM_COPY( name, token->start, len ); + name[len] = 0; + } + + Exit: + loader->parser.root.error = error; + } + + + static void + parse_blend_design_positions( T1_Face face, + T1_Loader loader ) + { + T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; + FT_Int num_designs; + FT_Int num_axis; + T1_Parser parser = &loader->parser; + + FT_Error error = T1_Err_Ok; + PS_Blend blend; + + + /* get the array of design tokens -- compute number of designs */ + T1_ToTokenArray( parser, design_tokens, + T1_MAX_MM_DESIGNS, &num_designs ); + if ( num_designs < 0 ) + { + error = T1_Err_Ignore; + goto Exit; + } + if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS ) + { + FT_ERROR(( "parse_blend_design_positions:" )); + FT_ERROR(( " incorrect number of designs: %d\n", + num_designs )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + { + FT_Byte* old_cursor = parser->root.cursor; + FT_Byte* old_limit = parser->root.limit; + FT_Int n; + + + blend = face->blend; + num_axis = 0; /* make compiler happy */ + + for ( n = 0; n < num_designs; n++ ) + { + T1_TokenRec axis_tokens[T1_MAX_MM_DESIGNS]; + T1_Token token; + FT_Int axis, n_axis; + + + /* read axis/coordinates tokens */ + token = design_tokens + n; + parser->root.cursor = token->start; + parser->root.limit = token->limit; + T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &n_axis ); + + if ( n == 0 ) + { + num_axis = n_axis; + error = t1_allocate_blend( face, num_designs, num_axis ); + if ( error ) + goto Exit; + blend = face->blend; + } + else if ( n_axis != num_axis ) + { + FT_ERROR(( "parse_blend_design_positions: incorrect table\n" )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + /* now read each axis token into the design position */ + for ( axis = 0; axis < n_axis; axis++ ) + { + T1_Token token2 = axis_tokens + axis; + + + parser->root.cursor = token2->start; + parser->root.limit = token2->limit; + blend->design_pos[n][axis] = T1_ToFixed( parser, 0 ); + } + } + + loader->parser.root.cursor = old_cursor; + loader->parser.root.limit = old_limit; + } + + Exit: + loader->parser.root.error = error; + } + + + static void + parse_blend_design_map( T1_Face face, + T1_Loader loader ) + { + FT_Error error = T1_Err_Ok; + T1_Parser parser = &loader->parser; + PS_Blend blend; + T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; + FT_Int n, num_axis; + FT_Byte* old_cursor; + FT_Byte* old_limit; + FT_Memory memory = face->root.memory; + + + T1_ToTokenArray( parser, axis_tokens, + T1_MAX_MM_AXIS, &num_axis ); + if ( num_axis < 0 ) + { + error = T1_Err_Ignore; + goto Exit; + } + if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS ) + { + FT_ERROR(( "parse_blend_design_map: incorrect number of axes: %d\n", + num_axis )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + old_cursor = parser->root.cursor; + old_limit = parser->root.limit; + + error = t1_allocate_blend( face, 0, num_axis ); + if ( error ) + goto Exit; + blend = face->blend; + + /* now read each axis design map */ + for ( n = 0; n < num_axis; n++ ) + { + PS_DesignMap map = blend->design_map + n; + T1_Token axis_token; + T1_TokenRec point_tokens[T1_MAX_MM_MAP_POINTS]; + FT_Int p, num_points; + + + axis_token = axis_tokens + n; + + parser->root.cursor = axis_token->start; + parser->root.limit = axis_token->limit; + T1_ToTokenArray( parser, point_tokens, + T1_MAX_MM_MAP_POINTS, &num_points ); + + if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS ) + { + FT_ERROR(( "parse_blend_design_map: incorrect table\n" )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + /* allocate design map data */ + if ( FT_NEW_ARRAY( map->design_points, num_points * 2 ) ) + goto Exit; + map->blend_points = map->design_points + num_points; + map->num_points = (FT_Byte)num_points; + + for ( p = 0; p < num_points; p++ ) + { + T1_Token point_token; + + + point_token = point_tokens + p; + + /* don't include delimiting brackets */ + parser->root.cursor = point_token->start + 1; + parser->root.limit = point_token->limit - 1; + + map->design_points[p] = T1_ToInt( parser ); + map->blend_points [p] = T1_ToFixed( parser, 0 ); + } + } + + parser->root.cursor = old_cursor; + parser->root.limit = old_limit; + + Exit: + parser->root.error = error; + } + + + static void + parse_weight_vector( T1_Face face, + T1_Loader loader ) + { + T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; + FT_Int num_designs; + FT_Error error = T1_Err_Ok; + T1_Parser parser = &loader->parser; + PS_Blend blend = face->blend; + T1_Token token; + FT_Int n; + FT_Byte* old_cursor; + FT_Byte* old_limit; + + + T1_ToTokenArray( parser, design_tokens, + T1_MAX_MM_DESIGNS, &num_designs ); + if ( num_designs < 0 ) + { + error = T1_Err_Ignore; + goto Exit; + } + if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS ) + { + FT_ERROR(( "parse_weight_vector:" )); + FT_ERROR(( " incorrect number of designs: %d\n", + num_designs )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + if ( !blend || !blend->num_designs ) + { + error = t1_allocate_blend( face, num_designs, 0 ); + if ( error ) + goto Exit; + blend = face->blend; + } + else if ( blend->num_designs != (FT_UInt)num_designs ) + { + FT_ERROR(( "parse_weight_vector:" + " /BlendDesignPosition and /WeightVector have\n" )); + FT_ERROR(( " " + " different number of elements!\n" )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + old_cursor = parser->root.cursor; + old_limit = parser->root.limit; + + for ( n = 0; n < num_designs; n++ ) + { + token = design_tokens + n; + parser->root.cursor = token->start; + parser->root.limit = token->limit; + + blend->default_weight_vector[n] = + blend->weight_vector[n] = T1_ToFixed( parser, 0 ); + } + + parser->root.cursor = old_cursor; + parser->root.limit = old_limit; + + Exit: + parser->root.error = error; + } + + + /* e.g., /BuildCharArray [0 0 0 0 0 0 0 0] def */ + /* we're only interested in the number of array elements */ + static void + parse_buildchar( T1_Face face, + T1_Loader loader ) + { + face->len_buildchar = T1_ToFixedArray( &loader->parser, 0, NULL, 0 ); + + return; + } + + +#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */ + + + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** TYPE 1 SYMBOL PARSING *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + static FT_Error + t1_load_keyword( T1_Face face, + T1_Loader loader, + const T1_Field field ) + { + FT_Error error; + void* dummy_object; + void** objects; + FT_UInt max_objects; + PS_Blend blend = face->blend; + + + /* if the keyword has a dedicated callback, call it */ + if ( field->type == T1_FIELD_TYPE_CALLBACK ) + { + field->reader( (FT_Face)face, loader ); + error = loader->parser.root.error; + goto Exit; + } + + /* now, the keyword is either a simple field, or a table of fields; */ + /* we are now going to take care of it */ + switch ( field->location ) + { + case T1_FIELD_LOCATION_FONT_INFO: + dummy_object = &face->type1.font_info; + objects = &dummy_object; + max_objects = 0; + + if ( blend ) + { + objects = (void**)blend->font_infos; + max_objects = blend->num_designs; + } + break; + + case T1_FIELD_LOCATION_PRIVATE: + dummy_object = &face->type1.private_dict; + objects = &dummy_object; + max_objects = 0; + + if ( blend ) + { + objects = (void**)blend->privates; + max_objects = blend->num_designs; + } + break; + + case T1_FIELD_LOCATION_BBOX: + dummy_object = &face->type1.font_bbox; + objects = &dummy_object; + max_objects = 0; + + if ( blend ) + { + objects = (void**)blend->bboxes; + max_objects = blend->num_designs; + } + break; + + case T1_FIELD_LOCATION_LOADER: + dummy_object = loader; + objects = &dummy_object; + max_objects = 0; + break; + + case T1_FIELD_LOCATION_FACE: + dummy_object = face; + objects = &dummy_object; + max_objects = 0; + break; + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + case T1_FIELD_LOCATION_BLEND: + dummy_object = face->blend; + objects = &dummy_object; + max_objects = 0; + break; +#endif + + default: + dummy_object = &face->type1; + objects = &dummy_object; + max_objects = 0; + } + + if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY || + field->type == T1_FIELD_TYPE_FIXED_ARRAY ) + error = T1_Load_Field_Table( &loader->parser, field, + objects, max_objects, 0 ); + else + error = T1_Load_Field( &loader->parser, field, + objects, max_objects, 0 ); + + Exit: + return error; + } + + + static void + parse_private( T1_Face face, + T1_Loader loader ) + { + FT_UNUSED( face ); + + loader->keywords_encountered |= T1_PRIVATE; + } + + + static int + read_binary_data( T1_Parser parser, + FT_Long* size, + FT_Byte** base ) + { + FT_Byte* cur; + FT_Byte* limit = parser->root.limit; + + + /* the binary data has one of the following formats */ + /* */ + /* `size' [white*] RD white ....... ND */ + /* `size' [white*] -| white ....... |- */ + /* */ + + T1_Skip_Spaces( parser ); + + cur = parser->root.cursor; + + if ( cur < limit && ft_isdigit( *cur ) ) + { + *size = T1_ToInt( parser ); + + T1_Skip_PS_Token( parser ); /* `RD' or `-|' or something else */ + + /* there is only one whitespace char after the */ + /* `RD' or `-|' token */ + *base = parser->root.cursor + 1; + + parser->root.cursor += *size + 1; + return !parser->root.error; + } + + FT_ERROR(( "read_binary_data: invalid size field\n" )); + parser->root.error = T1_Err_Invalid_File_Format; + return 0; + } + + + /* We now define the routines to handle the `/Encoding', `/Subrs', */ + /* and `/CharStrings' dictionaries. */ + + static void + parse_font_matrix( T1_Face face, + T1_Loader loader ) + { + T1_Parser parser = &loader->parser; + FT_Matrix* matrix = &face->type1.font_matrix; + FT_Vector* offset = &face->type1.font_offset; + FT_Face root = (FT_Face)&face->root; + FT_Fixed temp[6]; + FT_Fixed temp_scale; + FT_Int result; + + + result = T1_ToFixedArray( parser, 6, temp, 3 ); + + if ( result < 0 ) + { + parser->root.error = T1_Err_Invalid_File_Format; + return; + } + + temp_scale = FT_ABS( temp[3] ); + + if ( temp_scale == 0 ) + { + FT_ERROR(( "parse_font_matrix: invalid font matrix\n" )); + parser->root.error = T1_Err_Invalid_File_Format; + return; + } + + /* Set Units per EM based on FontMatrix values. We set the value to */ + /* 1000 / temp_scale, because temp_scale was already multiplied by */ + /* 1000 (in t1_tofixed, from psobjs.c). */ + + root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L, + temp_scale ) >> 16 ); + + /* we need to scale the values by 1.0/temp_scale */ + if ( temp_scale != 0x10000L ) + { + temp[0] = FT_DivFix( temp[0], temp_scale ); + temp[1] = FT_DivFix( temp[1], temp_scale ); + temp[2] = FT_DivFix( temp[2], temp_scale ); + temp[4] = FT_DivFix( temp[4], temp_scale ); + temp[5] = FT_DivFix( temp[5], temp_scale ); + temp[3] = 0x10000L; + } + + matrix->xx = temp[0]; + matrix->yx = temp[1]; + matrix->xy = temp[2]; + matrix->yy = temp[3]; + + /* note that the offsets must be expressed in integer font units */ + offset->x = temp[4] >> 16; + offset->y = temp[5] >> 16; + } + + + static void + parse_encoding( T1_Face face, + T1_Loader loader ) + { + T1_Parser parser = &loader->parser; + FT_Byte* cur; + FT_Byte* limit = parser->root.limit; + + PSAux_Service psaux = (PSAux_Service)face->psaux; + + + T1_Skip_Spaces( parser ); + cur = parser->root.cursor; + if ( cur >= limit ) + { + FT_ERROR(( "parse_encoding: out of bounds!\n" )); + parser->root.error = T1_Err_Invalid_File_Format; + return; + } + + /* if we have a number or `[', the encoding is an array, */ + /* and we must load it now */ + if ( ft_isdigit( *cur ) || *cur == '[' ) + { + T1_Encoding encode = &face->type1.encoding; + FT_Int count, n; + PS_Table char_table = &loader->encoding_table; + FT_Memory memory = parser->root.memory; + FT_Error error; + FT_Bool only_immediates = 0; + + + /* read the number of entries in the encoding; should be 256 */ + if ( *cur == '[' ) + { + count = 256; + only_immediates = 1; + parser->root.cursor++; + } + else + count = (FT_Int)T1_ToInt( parser ); + + T1_Skip_Spaces( parser ); + if ( parser->root.cursor >= limit ) + return; + + /* we use a T1_Table to store our charnames */ + loader->num_chars = encode->num_chars = count; + if ( FT_NEW_ARRAY( encode->char_index, count ) || + FT_NEW_ARRAY( encode->char_name, count ) || + FT_SET_ERROR( psaux->ps_table_funcs->init( + char_table, count, memory ) ) ) + { + parser->root.error = error; + return; + } + + /* We need to `zero' out encoding_table.elements */ + for ( n = 0; n < count; n++ ) + { + char* notdef = (char *)".notdef"; + + + T1_Add_Table( char_table, n, notdef, 8 ); + } + + /* Now we need to read records of the form */ + /* */ + /* ... charcode /charname ... */ + /* */ + /* for each entry in our table. */ + /* */ + /* We simply look for a number followed by an immediate */ + /* name. Note that this ignores correctly the sequence */ + /* that is often seen in type1 fonts: */ + /* */ + /* 0 1 255 { 1 index exch /.notdef put } for dup */ + /* */ + /* used to clean the encoding array before anything else. */ + /* */ + /* Alternatively, if the array is directly given as */ + /* */ + /* /Encoding [ ... ] */ + /* */ + /* we only read immediates. */ + + n = 0; + T1_Skip_Spaces( parser ); + + while ( parser->root.cursor < limit ) + { + cur = parser->root.cursor; + + /* we stop when we encounter a `def' or `]' */ + if ( *cur == 'd' && cur + 3 < limit ) + { + if ( cur[1] == 'e' && + cur[2] == 'f' && + IS_PS_DELIM( cur[3] ) ) + { + FT_TRACE6(( "encoding end\n" )); + cur += 3; + break; + } + } + if ( *cur == ']' ) + { + FT_TRACE6(( "encoding end\n" )); + cur++; + break; + } + + /* check whether we've found an entry */ + if ( ft_isdigit( *cur ) || only_immediates ) + { + FT_Int charcode; + + + if ( only_immediates ) + charcode = n; + else + { + charcode = (FT_Int)T1_ToInt( parser ); + T1_Skip_Spaces( parser ); + } + + cur = parser->root.cursor; + + if ( *cur == '/' && cur + 2 < limit && n < count ) + { + FT_PtrDist len; + + + cur++; + + parser->root.cursor = cur; + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + + len = parser->root.cursor - cur; + + parser->root.error = T1_Add_Table( char_table, charcode, + cur, len + 1 ); + if ( parser->root.error ) + return; + char_table->elements[charcode][len] = '\0'; + + n++; + } + } + else + { + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + } + + T1_Skip_Spaces( parser ); + } + + face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; + parser->root.cursor = cur; + } + + /* Otherwise, we should have either `StandardEncoding', */ + /* `ExpertEncoding', or `ISOLatin1Encoding' */ + else + { + if ( cur + 17 < limit && + ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 ) + face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD; + + else if ( cur + 15 < limit && + ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 ) + face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT; + + else if ( cur + 18 < limit && + ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 ) + face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; + + else + parser->root.error = T1_Err_Ignore; + } + } + + + static void + parse_subrs( T1_Face face, + T1_Loader loader ) + { + T1_Parser parser = &loader->parser; + PS_Table table = &loader->subrs; + FT_Memory memory = parser->root.memory; + FT_Error error; + FT_Int n, num_subrs; + + PSAux_Service psaux = (PSAux_Service)face->psaux; + + + T1_Skip_Spaces( parser ); + + /* test for empty array */ + if ( parser->root.cursor < parser->root.limit && + *parser->root.cursor == '[' ) + { + T1_Skip_PS_Token( parser ); + T1_Skip_Spaces ( parser ); + if ( parser->root.cursor >= parser->root.limit || + *parser->root.cursor != ']' ) + parser->root.error = T1_Err_Invalid_File_Format; + return; + } + + num_subrs = (FT_Int)T1_ToInt( parser ); + + /* position the parser right before the `dup' of the first subr */ + T1_Skip_PS_Token( parser ); /* `array' */ + if ( parser->root.error ) + return; + T1_Skip_Spaces( parser ); + + /* initialize subrs array -- with synthetic fonts it is possible */ + /* we get here twice */ + if ( !loader->num_subrs ) + { + error = psaux->ps_table_funcs->init( table, num_subrs, memory ); + if ( error ) + goto Fail; + } + + /* the format is simple: */ + /* */ + /* `index' + binary data */ + /* */ + for ( n = 0; n < num_subrs; n++ ) + { + FT_Long idx, size; + FT_Byte* base; + + + /* If the next token isn't `dup', we are also done. This */ + /* happens when there are `holes' in the Subrs array. */ + if ( ft_strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 ) + break; + + T1_Skip_PS_Token( parser ); /* `dup' */ + + idx = T1_ToInt( parser ); + + if ( !read_binary_data( parser, &size, &base ) ) + return; + + /* The binary string is followed by one token, e.g. `NP' */ + /* (bound to `noaccess put') or by two separate tokens: */ + /* `noaccess' & `put'. We position the parser right */ + /* before the next `dup', if any. */ + T1_Skip_PS_Token( parser ); /* `NP' or `|' or `noaccess' */ + if ( parser->root.error ) + return; + T1_Skip_Spaces ( parser ); + + if ( ft_strncmp( (char*)parser->root.cursor, "put", 3 ) == 0 ) + { + T1_Skip_PS_Token( parser ); /* skip `put' */ + T1_Skip_Spaces ( parser ); + } + + /* with synthetic fonts it is possible we get here twice */ + if ( loader->num_subrs ) + continue; + + /* some fonts use a value of -1 for lenIV to indicate that */ + /* the charstrings are unencoded */ + /* */ + /* thanks to Tom Kacvinsky for pointing this out */ + /* */ + if ( face->type1.private_dict.lenIV >= 0 ) + { + FT_Byte* temp; + + + if ( size <= face->type1.private_dict.lenIV ) + { + error = T1_Err_Invalid_File_Format; + goto Fail; + } + + /* t1_decrypt() shouldn't write to base -- make temporary copy */ + if ( FT_ALLOC( temp, size ) ) + goto Fail; + FT_MEM_COPY( temp, base, size ); + psaux->t1_decrypt( temp, size, 4330 ); + size -= face->type1.private_dict.lenIV; + error = T1_Add_Table( table, (FT_Int)idx, + temp + face->type1.private_dict.lenIV, size ); + FT_FREE( temp ); + } + else + error = T1_Add_Table( table, (FT_Int)idx, base, size ); + if ( error ) + goto Fail; + } + + if ( !loader->num_subrs ) + loader->num_subrs = num_subrs; + + return; + + Fail: + parser->root.error = error; + } + + +#define TABLE_EXTEND 5 + + + static void + parse_charstrings( T1_Face face, + T1_Loader loader ) + { + T1_Parser parser = &loader->parser; + PS_Table code_table = &loader->charstrings; + PS_Table name_table = &loader->glyph_names; + PS_Table swap_table = &loader->swap_table; + FT_Memory memory = parser->root.memory; + FT_Error error; + + PSAux_Service psaux = (PSAux_Service)face->psaux; + + FT_Byte* cur; + FT_Byte* limit = parser->root.limit; + FT_Int n, num_glyphs; + FT_UInt notdef_index = 0; + FT_Byte notdef_found = 0; + + + num_glyphs = (FT_Int)T1_ToInt( parser ); + /* some fonts like Optima-Oblique not only define the /CharStrings */ + /* array but access it also */ + if ( num_glyphs == 0 || parser->root.error ) + return; + + /* initialize tables, leaving space for addition of .notdef, */ + /* if necessary, and a few other glyphs to handle buggy */ + /* fonts which have more glyphs than specified. */ + + /* for some non-standard fonts like `Optima' which provides */ + /* different outlines depending on the resolution it is */ + /* possible to get here twice */ + if ( !loader->num_glyphs ) + { + error = psaux->ps_table_funcs->init( + code_table, num_glyphs + 1 + TABLE_EXTEND, memory ); + if ( error ) + goto Fail; + + error = psaux->ps_table_funcs->init( + name_table, num_glyphs + 1 + TABLE_EXTEND, memory ); + if ( error ) + goto Fail; + + /* Initialize table for swapping index notdef_index and */ + /* index 0 names and codes (if necessary). */ + + error = psaux->ps_table_funcs->init( swap_table, 4, memory ); + if ( error ) + goto Fail; + } + + n = 0; + + for (;;) + { + FT_Long size; + FT_Byte* base; + + + /* the format is simple: */ + /* `/glyphname' + binary data */ + + T1_Skip_Spaces( parser ); + + cur = parser->root.cursor; + if ( cur >= limit ) + break; + + /* we stop when we find a `def' or `end' keyword */ + if ( cur + 3 < limit && IS_PS_DELIM( cur[3] ) ) + { + if ( cur[0] == 'd' && + cur[1] == 'e' && + cur[2] == 'f' ) + { + /* There are fonts which have this: */ + /* */ + /* /CharStrings 118 dict def */ + /* Private begin */ + /* CharStrings begin */ + /* ... */ + /* */ + /* To catch this we ignore `def' if */ + /* no charstring has actually been */ + /* seen. */ + if ( n ) + break; + } + + if ( cur[0] == 'e' && + cur[1] == 'n' && + cur[2] == 'd' ) + break; + } + + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + + if ( *cur == '/' ) + { + FT_PtrDist len; + + + if ( cur + 1 >= limit ) + { + error = T1_Err_Invalid_File_Format; + goto Fail; + } + + cur++; /* skip `/' */ + len = parser->root.cursor - cur; + + if ( !read_binary_data( parser, &size, &base ) ) + return; + + /* for some non-standard fonts like `Optima' which provides */ + /* different outlines depending on the resolution it is */ + /* possible to get here twice */ + if ( loader->num_glyphs ) + continue; + + error = T1_Add_Table( name_table, n, cur, len + 1 ); + if ( error ) + goto Fail; + + /* add a trailing zero to the name table */ + name_table->elements[n][len] = '\0'; + + /* record index of /.notdef */ + if ( *cur == '.' && + ft_strcmp( ".notdef", + (const char*)(name_table->elements[n]) ) == 0 ) + { + notdef_index = n; + notdef_found = 1; + } + + if ( face->type1.private_dict.lenIV >= 0 && + n < num_glyphs + TABLE_EXTEND ) + { + FT_Byte* temp; + + + if ( size <= face->type1.private_dict.lenIV ) + { + error = T1_Err_Invalid_File_Format; + goto Fail; + } + + /* t1_decrypt() shouldn't write to base -- make temporary copy */ + if ( FT_ALLOC( temp, size ) ) + goto Fail; + FT_MEM_COPY( temp, base, size ); + psaux->t1_decrypt( temp, size, 4330 ); + size -= face->type1.private_dict.lenIV; + error = T1_Add_Table( code_table, n, + temp + face->type1.private_dict.lenIV, size ); + FT_FREE( temp ); + } + else + error = T1_Add_Table( code_table, n, base, size ); + if ( error ) + goto Fail; + + n++; + } + } + + if ( loader->num_glyphs ) + return; + else + loader->num_glyphs = n; + + /* if /.notdef is found but does not occupy index 0, do our magic. */ + if ( ft_strcmp( (const char*)".notdef", + (const char*)name_table->elements[0] ) && + notdef_found ) + { + /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ + /* name and code entries to swap_table. Then place notdef_index */ + /* name and code entries into swap_table. Then swap name and code */ + /* entries at indices notdef_index and 0 using values stored in */ + /* swap_table. */ + + /* Index 0 name */ + error = T1_Add_Table( swap_table, 0, + name_table->elements[0], + name_table->lengths [0] ); + if ( error ) + goto Fail; + + /* Index 0 code */ + error = T1_Add_Table( swap_table, 1, + code_table->elements[0], + code_table->lengths [0] ); + if ( error ) + goto Fail; + + /* Index notdef_index name */ + error = T1_Add_Table( swap_table, 2, + name_table->elements[notdef_index], + name_table->lengths [notdef_index] ); + if ( error ) + goto Fail; + + /* Index notdef_index code */ + error = T1_Add_Table( swap_table, 3, + code_table->elements[notdef_index], + code_table->lengths [notdef_index] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( name_table, notdef_index, + swap_table->elements[0], + swap_table->lengths [0] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( code_table, notdef_index, + swap_table->elements[1], + swap_table->lengths [1] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( name_table, 0, + swap_table->elements[2], + swap_table->lengths [2] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( code_table, 0, + swap_table->elements[3], + swap_table->lengths [3] ); + if ( error ) + goto Fail; + + } + else if ( !notdef_found ) + { + /* notdef_index is already 0, or /.notdef is undefined in */ + /* charstrings dictionary. Worry about /.notdef undefined. */ + /* We take index 0 and add it to the end of the table(s) */ + /* and add our own /.notdef glyph to index 0. */ + + /* 0 333 hsbw endchar */ + FT_Byte notdef_glyph[] = {0x8B, 0xF7, 0xE1, 0x0D, 0x0E}; + char* notdef_name = (char *)".notdef"; + + + error = T1_Add_Table( swap_table, 0, + name_table->elements[0], + name_table->lengths [0] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( swap_table, 1, + code_table->elements[0], + code_table->lengths [0] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( name_table, 0, notdef_name, 8 ); + if ( error ) + goto Fail; + + error = T1_Add_Table( code_table, 0, notdef_glyph, 5 ); + + if ( error ) + goto Fail; + + error = T1_Add_Table( name_table, n, + swap_table->elements[0], + swap_table->lengths [0] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( code_table, n, + swap_table->elements[1], + swap_table->lengths [1] ); + if ( error ) + goto Fail; + + /* we added a glyph. */ + loader->num_glyphs = n + 1; + } + + return; + + Fail: + parser->root.error = error; + } + + + /*************************************************************************/ + /* */ + /* Define the token field static variables. This is a set of */ + /* T1_FieldRec variables. */ + /* */ + /*************************************************************************/ + + + static + const T1_FieldRec t1_keywords[] = + { + +#include "t1tokens.h" + + /* now add the special functions... */ + T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_CALLBACK( "Encoding", parse_encoding, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_CALLBACK( "Subrs", parse_subrs, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_CALLBACK( "CharStrings", parse_charstrings, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_CALLBACK( "Private", parse_private, + T1_FIELD_DICT_FONTDICT ) + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + T1_FIELD_CALLBACK( "BlendDesignPositions", parse_blend_design_positions, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_CALLBACK( "BlendDesignMap", parse_blend_design_map, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_CALLBACK( "BlendAxisTypes", parse_blend_axis_types, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_CALLBACK( "WeightVector", parse_weight_vector, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_CALLBACK( "BuildCharArray", parse_buildchar, + T1_FIELD_DICT_PRIVATE ) +#endif + + { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 } + }; + + +#define T1_FIELD_COUNT \ + ( sizeof ( t1_keywords ) / sizeof ( t1_keywords[0] ) ) + + + static FT_Error + parse_dict( T1_Face face, + T1_Loader loader, + FT_Byte* base, + FT_Long size ) + { + T1_Parser parser = &loader->parser; + FT_Byte *limit, *start_binary = NULL; + FT_Bool have_integer = 0; + + + parser->root.cursor = base; + parser->root.limit = base + size; + parser->root.error = T1_Err_Ok; + + limit = parser->root.limit; + + T1_Skip_Spaces( parser ); + + while ( parser->root.cursor < limit ) + { + FT_Byte* cur; + + + cur = parser->root.cursor; + + /* look for `eexec' */ + if ( IS_PS_TOKEN( cur, limit, "eexec" ) ) + break; + + /* look for `closefile' which ends the eexec section */ + else if ( IS_PS_TOKEN( cur, limit, "closefile" ) ) + break; + + /* in a synthetic font the base font starts after a */ + /* `FontDictionary' token that is placed after a Private dict */ + else if ( IS_PS_TOKEN( cur, limit, "FontDirectory" ) ) + { + if ( loader->keywords_encountered & T1_PRIVATE ) + loader->keywords_encountered |= + T1_FONTDIR_AFTER_PRIVATE; + parser->root.cursor += 13; + } + + /* check whether we have an integer */ + else if ( ft_isdigit( *cur ) ) + { + start_binary = cur; + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + goto Exit; + have_integer = 1; + } + + /* in valid Type 1 fonts we don't see `RD' or `-|' directly */ + /* since those tokens are handled by parse_subrs and */ + /* parse_charstrings */ + else if ( *cur == 'R' && cur + 6 < limit && *(cur + 1) == 'D' && + have_integer ) + { + FT_Long s; + FT_Byte* b; + + + parser->root.cursor = start_binary; + if ( !read_binary_data( parser, &s, &b ) ) + return T1_Err_Invalid_File_Format; + have_integer = 0; + } + + else if ( *cur == '-' && cur + 6 < limit && *(cur + 1) == '|' && + have_integer ) + { + FT_Long s; + FT_Byte* b; + + + parser->root.cursor = start_binary; + if ( !read_binary_data( parser, &s, &b ) ) + return T1_Err_Invalid_File_Format; + have_integer = 0; + } + + /* look for immediates */ + else if ( *cur == '/' && cur + 2 < limit ) + { + FT_PtrDist len; + + + cur++; + + parser->root.cursor = cur; + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + goto Exit; + + len = parser->root.cursor - cur; + + if ( len > 0 && len < 22 && parser->root.cursor < limit ) + { + /* now compare the immediate name to the keyword table */ + T1_Field keyword = (T1_Field)t1_keywords; + + + for (;;) + { + FT_Byte* name; + + + name = (FT_Byte*)keyword->ident; + if ( !name ) + break; + + if ( cur[0] == name[0] && + len == (FT_PtrDist)ft_strlen( (const char *)name ) && + ft_memcmp( cur, name, len ) == 0 ) + { + /* We found it -- run the parsing callback! */ + /* We record every instance of every field */ + /* (until we reach the base font of a */ + /* synthetic font) to deal adequately with */ + /* multiple master fonts; this is also */ + /* necessary because later PostScript */ + /* definitions override earlier ones. */ + + /* Once we encounter `FontDirectory' after */ + /* `/Private', we know that this is a synthetic */ + /* font; except for `/CharStrings' we are not */ + /* interested in anything that follows this */ + /* `FontDirectory'. */ + + /* MM fonts have more than one /Private token at */ + /* the top level; let's hope that all the junk */ + /* that follows the first /Private token is not */ + /* interesting to us. */ + + /* According to Adobe Tech Note #5175 (CID-Keyed */ + /* Font Installation for ATM Software) a `begin' */ + /* must be followed by exactly one `end', and */ + /* `begin' -- `end' pairs must be accurately */ + /* paired. We could use this to distinguish */ + /* between the global Private and the Private */ + /* dict that is a member of the Blend dict. */ + + const FT_UInt dict = + ( loader->keywords_encountered & T1_PRIVATE ) + ? T1_FIELD_DICT_PRIVATE + : T1_FIELD_DICT_FONTDICT; + + if ( !( dict & keyword->dict ) ) + { + FT_TRACE1(( "parse_dict: found %s but ignoring it " + "since it is in the wrong dictionary\n", + keyword->ident )); + break; + } + + if ( !( loader->keywords_encountered & + T1_FONTDIR_AFTER_PRIVATE ) || + ft_strcmp( (const char*)name, "CharStrings" ) == 0 ) + { + parser->root.error = t1_load_keyword( face, + loader, + keyword ); + if ( parser->root.error != T1_Err_Ok ) + { + if ( FT_ERROR_BASE( parser->root.error ) == FT_Err_Ignore ) + parser->root.error = T1_Err_Ok; + else + return parser->root.error; + } + } + break; + } + + keyword++; + } + } + + have_integer = 0; + } + else + { + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + goto Exit; + have_integer = 0; + } + + T1_Skip_Spaces( parser ); + } + + Exit: + return parser->root.error; + } + + + static void + t1_init_loader( T1_Loader loader, + T1_Face face ) + { + FT_UNUSED( face ); + + FT_MEM_ZERO( loader, sizeof ( *loader ) ); + loader->num_glyphs = 0; + loader->num_chars = 0; + + /* initialize the tables -- simply set their `init' field to 0 */ + loader->encoding_table.init = 0; + loader->charstrings.init = 0; + loader->glyph_names.init = 0; + loader->subrs.init = 0; + loader->swap_table.init = 0; + loader->fontdata = 0; + loader->keywords_encountered = 0; + } + + + static void + t1_done_loader( T1_Loader loader ) + { + T1_Parser parser = &loader->parser; + + + /* finalize tables */ + T1_Release_Table( &loader->encoding_table ); + T1_Release_Table( &loader->charstrings ); + T1_Release_Table( &loader->glyph_names ); + T1_Release_Table( &loader->swap_table ); + T1_Release_Table( &loader->subrs ); + + /* finalize parser */ + T1_Finalize_Parser( parser ); + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Open_Face( T1_Face face ) + { + T1_LoaderRec loader; + T1_Parser parser; + T1_Font type1 = &face->type1; + PS_Private priv = &type1->private_dict; + FT_Error error; + + PSAux_Service psaux = (PSAux_Service)face->psaux; + + + t1_init_loader( &loader, face ); + + /* default values */ + face->ndv_idx = -1; + face->cdv_idx = -1; + face->len_buildchar = 0; + + priv->blue_shift = 7; + priv->blue_fuzz = 1; + priv->lenIV = 4; + priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L ); + priv->blue_scale = (FT_Fixed)( 0.039625 * 0x10000L * 1000 ); + + parser = &loader.parser; + error = T1_New_Parser( parser, + face->root.stream, + face->root.memory, + psaux ); + if ( error ) + goto Exit; + + error = parse_dict( face, &loader, + parser->base_dict, parser->base_len ); + if ( error ) + goto Exit; + + error = T1_Get_Private_Dict( parser, psaux ); + if ( error ) + goto Exit; + + error = parse_dict( face, &loader, + parser->private_dict, parser->private_len ); + if ( error ) + goto Exit; + + /* ensure even-ness of `num_blue_values' */ + priv->num_blue_values &= ~1; + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + + if ( face->blend && + face->blend->num_default_design_vector != 0 && + face->blend->num_default_design_vector != face->blend->num_axis ) + { + /* we don't use it currently so just warn, reset, and ignore */ + FT_ERROR(( "T1_Open_Face(): /DesignVector contains %u entries " + "while there are %u axes.\n", + face->blend->num_default_design_vector, + face->blend->num_axis )); + + face->blend->num_default_design_vector = 0; + } + + /* the following can happen for MM instances; we then treat the */ + /* font as a normal PS font */ + if ( face->blend && + ( !face->blend->num_designs || !face->blend->num_axis ) ) + T1_Done_Blend( face ); + + /* another safety check */ + if ( face->blend ) + { + FT_UInt i; + + + for ( i = 0; i < face->blend->num_axis; i++ ) + if ( !face->blend->design_map[i].num_points ) + { + T1_Done_Blend( face ); + break; + } + } + + if ( face->blend ) + { + if ( face->len_buildchar > 0 ) + { + FT_Memory memory = face->root.memory; + + + if ( FT_NEW_ARRAY( face->buildchar, face->len_buildchar ) ) + { + FT_ERROR(( "T1_Open_Face: cannot allocate BuildCharArray\n" )); + face->len_buildchar = 0; + goto Exit; + } + } + } + +#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */ + + /* now, propagate the subrs, charstrings, and glyphnames tables */ + /* to the Type1 data */ + type1->num_glyphs = loader.num_glyphs; + + if ( loader.subrs.init ) + { + loader.subrs.init = 0; + type1->num_subrs = loader.num_subrs; + type1->subrs_block = loader.subrs.block; + type1->subrs = loader.subrs.elements; + type1->subrs_len = loader.subrs.lengths; + } + +#ifdef FT_CONFIG_OPTION_INCREMENTAL + if ( !face->root.internal->incremental_interface ) +#endif + if ( !loader.charstrings.init ) + { + FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face!\n" )); + error = T1_Err_Invalid_File_Format; + } + + loader.charstrings.init = 0; + type1->charstrings_block = loader.charstrings.block; + type1->charstrings = loader.charstrings.elements; + type1->charstrings_len = loader.charstrings.lengths; + + /* we copy the glyph names `block' and `elements' fields; */ + /* the `lengths' field must be released later */ + type1->glyph_names_block = loader.glyph_names.block; + type1->glyph_names = (FT_String**)loader.glyph_names.elements; + loader.glyph_names.block = 0; + loader.glyph_names.elements = 0; + + /* we must now build type1.encoding when we have a custom array */ + if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) + { + FT_Int charcode, idx, min_char, max_char; + FT_Byte* char_name; + FT_Byte* glyph_name; + + + /* OK, we do the following: for each element in the encoding */ + /* table, look up the index of the glyph having the same name */ + /* the index is then stored in type1.encoding.char_index, and */ + /* a the name to type1.encoding.char_name */ + + min_char = +32000; + max_char = -32000; + + charcode = 0; + for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) + { + type1->encoding.char_index[charcode] = 0; + type1->encoding.char_name [charcode] = (char *)".notdef"; + + char_name = loader.encoding_table.elements[charcode]; + if ( char_name ) + for ( idx = 0; idx < type1->num_glyphs; idx++ ) + { + glyph_name = (FT_Byte*)type1->glyph_names[idx]; + if ( ft_strcmp( (const char*)char_name, + (const char*)glyph_name ) == 0 ) + { + type1->encoding.char_index[charcode] = (FT_UShort)idx; + type1->encoding.char_name [charcode] = (char*)glyph_name; + + /* Change min/max encoded char only if glyph name is */ + /* not /.notdef */ + if ( ft_strcmp( (const char*)".notdef", + (const char*)glyph_name ) != 0 ) + { + if ( charcode < min_char ) + min_char = charcode; + if ( charcode > max_char ) + max_char = charcode; + } + break; + } + } + } + + /* + * Yes, this happens: Certain PDF-embedded fonts have only a + * `.notdef' glyph defined! + */ + + if ( min_char > max_char ) + { + min_char = 0; + max_char = loader.encoding_table.max_elems; + } + + type1->encoding.code_first = min_char; + type1->encoding.code_last = max_char; + type1->encoding.num_chars = loader.num_chars; + } + + Exit: + t1_done_loader( &loader ); + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1load.h b/reactos/dll/3rdparty/freetype/src/type1/t1load.h index 546fc33530b..ccddfb36482 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1load.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1load.h @@ -1,102 +1,102 @@ -/***************************************************************************/ -/* */ -/* t1load.h */ -/* */ -/* Type 1 font loader (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2004, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1LOAD_H__ -#define __T1LOAD_H__ - - -#include -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_MULTIPLE_MASTERS_H - -#include "t1parse.h" - - -FT_BEGIN_HEADER - - - typedef struct T1_Loader_ - { - T1_ParserRec parser; /* parser used to read the stream */ - - FT_Int num_chars; /* number of characters in encoding */ - PS_TableRec encoding_table; /* PS_Table used to store the */ - /* encoding character names */ - - FT_Int num_glyphs; - PS_TableRec glyph_names; - PS_TableRec charstrings; - PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */ - - FT_Int num_subrs; - PS_TableRec subrs; - FT_Bool fontdata; - - FT_UInt keywords_encountered; /* T1_LOADER_ENCOUNTERED_XXX */ - - } T1_LoaderRec, *T1_Loader; - - - /* treatment of some keywords differs depending on whether */ - /* they precede or follow certain other keywords */ - -#define T1_PRIVATE ( 1 << 0 ) -#define T1_FONTDIR_AFTER_PRIVATE ( 1 << 1 ) - - - FT_LOCAL( FT_Error ) - T1_Open_Face( T1_Face face ); - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - - FT_LOCAL( FT_Error ) - T1_Get_Multi_Master( T1_Face face, - FT_Multi_Master* master ); - - FT_LOCAL_DEF( FT_Error ) - T1_Get_MM_Var( T1_Face face, - FT_MM_Var* *master ); - - FT_LOCAL( FT_Error ) - T1_Set_MM_Blend( T1_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - FT_LOCAL( FT_Error ) - T1_Set_MM_Design( T1_Face face, - FT_UInt num_coords, - FT_Long* coords ); - - FT_LOCAL_DEF( FT_Error ) - T1_Set_Var_Design( T1_Face face, - FT_UInt num_coords, - FT_Fixed* coords ); - - FT_LOCAL( void ) - T1_Done_Blend( T1_Face face ); - -#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */ - - -FT_END_HEADER - -#endif /* __T1LOAD_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1load.h */ +/* */ +/* Type 1 font loader (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1LOAD_H__ +#define __T1LOAD_H__ + + +#include +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_MULTIPLE_MASTERS_H + +#include "t1parse.h" + + +FT_BEGIN_HEADER + + + typedef struct T1_Loader_ + { + T1_ParserRec parser; /* parser used to read the stream */ + + FT_Int num_chars; /* number of characters in encoding */ + PS_TableRec encoding_table; /* PS_Table used to store the */ + /* encoding character names */ + + FT_Int num_glyphs; + PS_TableRec glyph_names; + PS_TableRec charstrings; + PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */ + + FT_Int num_subrs; + PS_TableRec subrs; + FT_Bool fontdata; + + FT_UInt keywords_encountered; /* T1_LOADER_ENCOUNTERED_XXX */ + + } T1_LoaderRec, *T1_Loader; + + + /* treatment of some keywords differs depending on whether */ + /* they precede or follow certain other keywords */ + +#define T1_PRIVATE ( 1 << 0 ) +#define T1_FONTDIR_AFTER_PRIVATE ( 1 << 1 ) + + + FT_LOCAL( FT_Error ) + T1_Open_Face( T1_Face face ); + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + + FT_LOCAL( FT_Error ) + T1_Get_Multi_Master( T1_Face face, + FT_Multi_Master* master ); + + FT_LOCAL_DEF( FT_Error ) + T1_Get_MM_Var( T1_Face face, + FT_MM_Var* *master ); + + FT_LOCAL( FT_Error ) + T1_Set_MM_Blend( T1_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); + + FT_LOCAL( FT_Error ) + T1_Set_MM_Design( T1_Face face, + FT_UInt num_coords, + FT_Long* coords ); + + FT_LOCAL_DEF( FT_Error ) + T1_Set_Var_Design( T1_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); + + FT_LOCAL( void ) + T1_Done_Blend( T1_Face face ); + +#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */ + + +FT_END_HEADER + +#endif /* __T1LOAD_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1objs.c b/reactos/dll/3rdparty/freetype/src/type1/t1objs.c index 3d08336c600..41537810cbf 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1objs.c +++ b/reactos/dll/3rdparty/freetype/src/type1/t1objs.c @@ -1,566 +1,566 @@ -/***************************************************************************/ -/* */ -/* t1objs.c */ -/* */ -/* Type 1 objects manager (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_IDS_H - -#include "t1gload.h" -#include "t1load.h" - -#include "t1errors.h" - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include "t1afm.h" -#endif - -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1objs - - - /*************************************************************************/ - /* */ - /* SIZE FUNCTIONS */ - /* */ - /* note that we store the global hints in the size's "internal" root */ - /* field */ - /* */ - /*************************************************************************/ - - - static PSH_Globals_Funcs - T1_Size_Get_Globals_Funcs( T1_Size size ) - { - T1_Face face = (T1_Face)size->root.face; - PSHinter_Service pshinter = (PSHinter_Service)face->pshinter; - FT_Module module; - - - module = FT_Get_Module( size->root.face->driver->root.library, - "pshinter" ); - return ( module && pshinter && pshinter->get_globals_funcs ) - ? pshinter->get_globals_funcs( module ) - : 0 ; - } - - - FT_LOCAL_DEF( void ) - T1_Size_Done( T1_Size size ) - { - if ( size->root.internal ) - { - PSH_Globals_Funcs funcs; - - - funcs = T1_Size_Get_Globals_Funcs( size ); - if ( funcs ) - funcs->destroy( (PSH_Globals)size->root.internal ); - - size->root.internal = 0; - } - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Size_Init( T1_Size size ) - { - FT_Error error = 0; - PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); - - - if ( funcs ) - { - PSH_Globals globals; - T1_Face face = (T1_Face)size->root.face; - - - error = funcs->create( size->root.face->memory, - &face->type1.private_dict, &globals ); - if ( !error ) - size->root.internal = (FT_Size_Internal)(void*)globals; - } - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Size_Request( T1_Size size, - FT_Size_Request req ) - { - PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); - - - FT_Request_Metrics( size->root.face, req ); - - if ( funcs ) - funcs->set_scale( (PSH_Globals)size->root.internal, - size->root.metrics.x_scale, - size->root.metrics.y_scale, - 0, 0 ); - - return T1_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* SLOT FUNCTIONS */ - /* */ - /*************************************************************************/ - - FT_LOCAL_DEF( void ) - T1_GlyphSlot_Done( T1_GlyphSlot slot ) - { - slot->root.internal->glyph_hints = 0; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_GlyphSlot_Init( T1_GlyphSlot slot ) - { - T1_Face face; - PSHinter_Service pshinter; - - - face = (T1_Face)slot->root.face; - pshinter = (PSHinter_Service)face->pshinter; - - if ( pshinter ) - { - FT_Module module; - - - module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" ); - if (module) - { - T1_Hints_Funcs funcs; - - funcs = pshinter->get_t1_funcs( module ); - slot->root.internal->glyph_hints = (void*)funcs; - } - } - return 0; - } - - - /*************************************************************************/ - /* */ - /* FACE FUNCTIONS */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* T1_Face_Done */ - /* */ - /* */ - /* The face object destructor. */ - /* */ - /* */ - /* face :: A typeless pointer to the face object to destroy. */ - /* */ - FT_LOCAL_DEF( void ) - T1_Face_Done( T1_Face face ) - { - if ( face ) - { - FT_Memory memory = face->root.memory; - T1_Font type1 = &face->type1; - - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - /* release multiple masters information */ - FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); - - if ( face->buildchar ) - { - FT_FREE( face->buildchar ); - - face->buildchar = NULL; - face->len_buildchar = 0; - } - - T1_Done_Blend( face ); - face->blend = 0; -#endif - - /* release font info strings */ - { - PS_FontInfo info = &type1->font_info; - - - FT_FREE( info->version ); - FT_FREE( info->notice ); - FT_FREE( info->full_name ); - FT_FREE( info->family_name ); - FT_FREE( info->weight ); - } - - /* release top dictionary */ - FT_FREE( type1->charstrings_len ); - FT_FREE( type1->charstrings ); - FT_FREE( type1->glyph_names ); - - FT_FREE( type1->subrs ); - FT_FREE( type1->subrs_len ); - - FT_FREE( type1->subrs_block ); - FT_FREE( type1->charstrings_block ); - FT_FREE( type1->glyph_names_block ); - - FT_FREE( type1->encoding.char_index ); - FT_FREE( type1->encoding.char_name ); - FT_FREE( type1->font_name ); - -#ifndef T1_CONFIG_OPTION_NO_AFM - /* release afm data if present */ - if ( face->afm_data ) - T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data ); -#endif - - /* release unicode map, if any */ -#if 0 - FT_FREE( face->unicode_map_rec.maps ); - face->unicode_map_rec.num_maps = 0; - face->unicode_map = NULL; -#endif - - face->root.family_name = 0; - face->root.style_name = 0; - } - } - - - /*************************************************************************/ - /* */ - /* */ - /* T1_Face_Init */ - /* */ - /* */ - /* The face object constructor. */ - /* */ - /* */ - /* stream :: input stream where to load font data. */ - /* */ - /* face_index :: The index of the font face in the resource. */ - /* */ - /* num_params :: Number of additional generic parameters. Ignored. */ - /* */ - /* params :: Additional generic parameters. Ignored. */ - /* */ - /* */ - /* face :: The face record to build. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - T1_Face_Init( FT_Stream stream, - T1_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - FT_Error error; - FT_Service_PsCMaps psnames; - PSAux_Service psaux; - T1_Font type1 = &face->type1; - PS_FontInfo info = &type1->font_info; - - FT_UNUSED( num_params ); - FT_UNUSED( params ); - FT_UNUSED( face_index ); - FT_UNUSED( stream ); - - - face->root.num_faces = 1; - - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); - face->psnames = psnames; - - face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), - "psaux" ); - psaux = (PSAux_Service)face->psaux; - - face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), - "pshinter" ); - - /* open the tokenizer; this will also check the font format */ - error = T1_Open_Face( face ); - if ( error ) - goto Exit; - - /* if we just wanted to check the format, leave successfully now */ - if ( face_index < 0 ) - goto Exit; - - /* check the face index */ - if ( face_index != 0 ) - { - FT_ERROR(( "T1_Face_Init: invalid face index\n" )); - error = T1_Err_Invalid_Argument; - goto Exit; - } - - /* now load the font program into the face object */ - - /* initialize the face object fields */ - - /* set up root face fields */ - { - FT_Face root = (FT_Face)&face->root; - - - root->num_glyphs = type1->num_glyphs; - root->face_index = face_index; - - root->face_flags = FT_FACE_FLAG_SCALABLE | - FT_FACE_FLAG_HORIZONTAL | - FT_FACE_FLAG_GLYPH_NAMES | - FT_FACE_FLAG_HINTER; - - if ( info->is_fixed_pitch ) - root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; - - if ( face->blend ) - root->face_flags |= FT_FACE_FLAG_MULTIPLE_MASTERS; - - /* XXX: TODO -- add kerning with .afm support */ - - /* get style name -- be careful, some broken fonts only */ - /* have a `/FontName' dictionary entry! */ - root->family_name = info->family_name; - /* assume "Regular" style if we don't know better */ - root->style_name = (char *)"Regular"; - if ( root->family_name ) - { - char* full = info->full_name; - char* family = root->family_name; - - - if ( full ) - { - while ( *full ) - { - if ( *full == *family ) - { - family++; - full++; - } - else - { - if ( *full == ' ' || *full == '-' ) - full++; - else if ( *family == ' ' || *family == '-' ) - family++; - else - { - if ( !*family ) - root->style_name = full; - break; - } - } - } - } - } - else - { - /* do we have a `/FontName'? */ - if ( type1->font_name ) - root->family_name = type1->font_name; - } - - /* compute style flags */ - root->style_flags = 0; - if ( info->italic_angle ) - root->style_flags |= FT_STYLE_FLAG_ITALIC; - if ( info->weight ) - { - if ( !ft_strcmp( info->weight, "Bold" ) || - !ft_strcmp( info->weight, "Black" ) ) - root->style_flags |= FT_STYLE_FLAG_BOLD; - } - - /* no embedded bitmap support */ - root->num_fixed_sizes = 0; - root->available_sizes = 0; - - root->bbox.xMin = type1->font_bbox.xMin >> 16; - root->bbox.yMin = type1->font_bbox.yMin >> 16; - root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFFU ) >> 16; - root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFFU ) >> 16; - - /* Set units_per_EM if we didn't set it in parse_font_matrix. */ - if ( !root->units_per_EM ) - root->units_per_EM = 1000; - - root->ascender = (FT_Short)( root->bbox.yMax ); - root->descender = (FT_Short)( root->bbox.yMin ); - - root->height = (FT_Short)( ( root->units_per_EM * 12 ) / 10 ); - if ( root->height < root->ascender - root->descender ) - root->height = (FT_Short)( root->ascender - root->descender ); - - /* now compute the maximum advance width */ - root->max_advance_width = - (FT_Short)( root->bbox.xMax ); - { - FT_Pos max_advance; - - - error = T1_Compute_Max_Advance( face, &max_advance ); - - /* in case of error, keep the standard width */ - if ( !error ) - root->max_advance_width = (FT_Short)max_advance; - else - error = 0; /* clear error */ - } - - root->max_advance_height = root->height; - - root->underline_position = (FT_Short)info->underline_position; - root->underline_thickness = (FT_Short)info->underline_thickness; - } - - { - FT_Face root = &face->root; - - - if ( psnames && psaux ) - { - FT_CharMapRec charmap; - T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes; - FT_CMap_Class clazz; - - - charmap.face = root; - - /* first of all, try to synthetize a Unicode charmap */ - charmap.platform_id = 3; - charmap.encoding_id = 1; - charmap.encoding = FT_ENCODING_UNICODE; - - FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); - - /* now, generate an Adobe Standard encoding when appropriate */ - charmap.platform_id = 7; - clazz = NULL; - - switch ( type1->encoding_type ) - { - case T1_ENCODING_TYPE_STANDARD: - charmap.encoding = FT_ENCODING_ADOBE_STANDARD; - charmap.encoding_id = TT_ADOBE_ID_STANDARD; - clazz = cmap_classes->standard; - break; - - case T1_ENCODING_TYPE_EXPERT: - charmap.encoding = FT_ENCODING_ADOBE_EXPERT; - charmap.encoding_id = TT_ADOBE_ID_EXPERT; - clazz = cmap_classes->expert; - break; - - case T1_ENCODING_TYPE_ARRAY: - charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; - charmap.encoding_id = TT_ADOBE_ID_CUSTOM; - clazz = cmap_classes->custom; - break; - - case T1_ENCODING_TYPE_ISOLATIN1: - charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; - charmap.encoding_id = TT_ADOBE_ID_LATIN_1; - clazz = cmap_classes->unicode; - break; - - default: - ; - } - - if ( clazz ) - FT_CMap_New( clazz, NULL, &charmap, NULL ); - -#if 0 - /* Select default charmap */ - if (root->num_charmaps) - root->charmap = root->charmaps[0]; -#endif - } - } - - Exit: - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* T1_Driver_Init */ - /* */ - /* */ - /* Initializes a given Type 1 driver object. */ - /* */ - /* */ - /* driver :: A handle to the target driver object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - T1_Driver_Init( T1_Driver driver ) - { - FT_UNUSED( driver ); - - return T1_Err_Ok; - } - - - /*************************************************************************/ - /* */ - /* */ - /* T1_Driver_Done */ - /* */ - /* */ - /* Finalizes a given Type 1 driver. */ - /* */ - /* */ - /* driver :: A handle to the target Type 1 driver. */ - /* */ - FT_LOCAL_DEF( void ) - T1_Driver_Done( T1_Driver driver ) - { - FT_UNUSED( driver ); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t1objs.c */ +/* */ +/* Type 1 objects manager (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_IDS_H + +#include "t1gload.h" +#include "t1load.h" + +#include "t1errors.h" + +#ifndef T1_CONFIG_OPTION_NO_AFM +#include "t1afm.h" +#endif + +#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t1objs + + + /*************************************************************************/ + /* */ + /* SIZE FUNCTIONS */ + /* */ + /* note that we store the global hints in the size's "internal" root */ + /* field */ + /* */ + /*************************************************************************/ + + + static PSH_Globals_Funcs + T1_Size_Get_Globals_Funcs( T1_Size size ) + { + T1_Face face = (T1_Face)size->root.face; + PSHinter_Service pshinter = (PSHinter_Service)face->pshinter; + FT_Module module; + + + module = FT_Get_Module( size->root.face->driver->root.library, + "pshinter" ); + return ( module && pshinter && pshinter->get_globals_funcs ) + ? pshinter->get_globals_funcs( module ) + : 0 ; + } + + + FT_LOCAL_DEF( void ) + T1_Size_Done( T1_Size size ) + { + if ( size->root.internal ) + { + PSH_Globals_Funcs funcs; + + + funcs = T1_Size_Get_Globals_Funcs( size ); + if ( funcs ) + funcs->destroy( (PSH_Globals)size->root.internal ); + + size->root.internal = 0; + } + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Size_Init( T1_Size size ) + { + FT_Error error = 0; + PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); + + + if ( funcs ) + { + PSH_Globals globals; + T1_Face face = (T1_Face)size->root.face; + + + error = funcs->create( size->root.face->memory, + &face->type1.private_dict, &globals ); + if ( !error ) + size->root.internal = (FT_Size_Internal)(void*)globals; + } + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Size_Request( T1_Size size, + FT_Size_Request req ) + { + PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); + + + FT_Request_Metrics( size->root.face, req ); + + if ( funcs ) + funcs->set_scale( (PSH_Globals)size->root.internal, + size->root.metrics.x_scale, + size->root.metrics.y_scale, + 0, 0 ); + + return T1_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* SLOT FUNCTIONS */ + /* */ + /*************************************************************************/ + + FT_LOCAL_DEF( void ) + T1_GlyphSlot_Done( T1_GlyphSlot slot ) + { + slot->root.internal->glyph_hints = 0; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_GlyphSlot_Init( T1_GlyphSlot slot ) + { + T1_Face face; + PSHinter_Service pshinter; + + + face = (T1_Face)slot->root.face; + pshinter = (PSHinter_Service)face->pshinter; + + if ( pshinter ) + { + FT_Module module; + + + module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" ); + if (module) + { + T1_Hints_Funcs funcs; + + funcs = pshinter->get_t1_funcs( module ); + slot->root.internal->glyph_hints = (void*)funcs; + } + } + return 0; + } + + + /*************************************************************************/ + /* */ + /* FACE FUNCTIONS */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* T1_Face_Done */ + /* */ + /* */ + /* The face object destructor. */ + /* */ + /* */ + /* face :: A typeless pointer to the face object to destroy. */ + /* */ + FT_LOCAL_DEF( void ) + T1_Face_Done( T1_Face face ) + { + if ( face ) + { + FT_Memory memory = face->root.memory; + T1_Font type1 = &face->type1; + + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + /* release multiple masters information */ + FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); + + if ( face->buildchar ) + { + FT_FREE( face->buildchar ); + + face->buildchar = NULL; + face->len_buildchar = 0; + } + + T1_Done_Blend( face ); + face->blend = 0; +#endif + + /* release font info strings */ + { + PS_FontInfo info = &type1->font_info; + + + FT_FREE( info->version ); + FT_FREE( info->notice ); + FT_FREE( info->full_name ); + FT_FREE( info->family_name ); + FT_FREE( info->weight ); + } + + /* release top dictionary */ + FT_FREE( type1->charstrings_len ); + FT_FREE( type1->charstrings ); + FT_FREE( type1->glyph_names ); + + FT_FREE( type1->subrs ); + FT_FREE( type1->subrs_len ); + + FT_FREE( type1->subrs_block ); + FT_FREE( type1->charstrings_block ); + FT_FREE( type1->glyph_names_block ); + + FT_FREE( type1->encoding.char_index ); + FT_FREE( type1->encoding.char_name ); + FT_FREE( type1->font_name ); + +#ifndef T1_CONFIG_OPTION_NO_AFM + /* release afm data if present */ + if ( face->afm_data ) + T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data ); +#endif + + /* release unicode map, if any */ +#if 0 + FT_FREE( face->unicode_map_rec.maps ); + face->unicode_map_rec.num_maps = 0; + face->unicode_map = NULL; +#endif + + face->root.family_name = 0; + face->root.style_name = 0; + } + } + + + /*************************************************************************/ + /* */ + /* */ + /* T1_Face_Init */ + /* */ + /* */ + /* The face object constructor. */ + /* */ + /* */ + /* stream :: input stream where to load font data. */ + /* */ + /* face_index :: The index of the font face in the resource. */ + /* */ + /* num_params :: Number of additional generic parameters. Ignored. */ + /* */ + /* params :: Additional generic parameters. Ignored. */ + /* */ + /* */ + /* face :: The face record to build. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + T1_Face_Init( FT_Stream stream, + T1_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error; + FT_Service_PsCMaps psnames; + PSAux_Service psaux; + T1_Font type1 = &face->type1; + PS_FontInfo info = &type1->font_info; + + FT_UNUSED( num_params ); + FT_UNUSED( params ); + FT_UNUSED( face_index ); + FT_UNUSED( stream ); + + + face->root.num_faces = 1; + + FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); + face->psnames = psnames; + + face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), + "psaux" ); + psaux = (PSAux_Service)face->psaux; + + face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), + "pshinter" ); + + /* open the tokenizer; this will also check the font format */ + error = T1_Open_Face( face ); + if ( error ) + goto Exit; + + /* if we just wanted to check the format, leave successfully now */ + if ( face_index < 0 ) + goto Exit; + + /* check the face index */ + if ( face_index != 0 ) + { + FT_ERROR(( "T1_Face_Init: invalid face index\n" )); + error = T1_Err_Invalid_Argument; + goto Exit; + } + + /* now load the font program into the face object */ + + /* initialize the face object fields */ + + /* set up root face fields */ + { + FT_Face root = (FT_Face)&face->root; + + + root->num_glyphs = type1->num_glyphs; + root->face_index = face_index; + + root->face_flags = FT_FACE_FLAG_SCALABLE | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_GLYPH_NAMES | + FT_FACE_FLAG_HINTER; + + if ( info->is_fixed_pitch ) + root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + + if ( face->blend ) + root->face_flags |= FT_FACE_FLAG_MULTIPLE_MASTERS; + + /* XXX: TODO -- add kerning with .afm support */ + + /* get style name -- be careful, some broken fonts only */ + /* have a `/FontName' dictionary entry! */ + root->family_name = info->family_name; + /* assume "Regular" style if we don't know better */ + root->style_name = (char *)"Regular"; + if ( root->family_name ) + { + char* full = info->full_name; + char* family = root->family_name; + + + if ( full ) + { + while ( *full ) + { + if ( *full == *family ) + { + family++; + full++; + } + else + { + if ( *full == ' ' || *full == '-' ) + full++; + else if ( *family == ' ' || *family == '-' ) + family++; + else + { + if ( !*family ) + root->style_name = full; + break; + } + } + } + } + } + else + { + /* do we have a `/FontName'? */ + if ( type1->font_name ) + root->family_name = type1->font_name; + } + + /* compute style flags */ + root->style_flags = 0; + if ( info->italic_angle ) + root->style_flags |= FT_STYLE_FLAG_ITALIC; + if ( info->weight ) + { + if ( !ft_strcmp( info->weight, "Bold" ) || + !ft_strcmp( info->weight, "Black" ) ) + root->style_flags |= FT_STYLE_FLAG_BOLD; + } + + /* no embedded bitmap support */ + root->num_fixed_sizes = 0; + root->available_sizes = 0; + + root->bbox.xMin = type1->font_bbox.xMin >> 16; + root->bbox.yMin = type1->font_bbox.yMin >> 16; + root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFFU ) >> 16; + root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFFU ) >> 16; + + /* Set units_per_EM if we didn't set it in parse_font_matrix. */ + if ( !root->units_per_EM ) + root->units_per_EM = 1000; + + root->ascender = (FT_Short)( root->bbox.yMax ); + root->descender = (FT_Short)( root->bbox.yMin ); + + root->height = (FT_Short)( ( root->units_per_EM * 12 ) / 10 ); + if ( root->height < root->ascender - root->descender ) + root->height = (FT_Short)( root->ascender - root->descender ); + + /* now compute the maximum advance width */ + root->max_advance_width = + (FT_Short)( root->bbox.xMax ); + { + FT_Pos max_advance; + + + error = T1_Compute_Max_Advance( face, &max_advance ); + + /* in case of error, keep the standard width */ + if ( !error ) + root->max_advance_width = (FT_Short)max_advance; + else + error = 0; /* clear error */ + } + + root->max_advance_height = root->height; + + root->underline_position = (FT_Short)info->underline_position; + root->underline_thickness = (FT_Short)info->underline_thickness; + } + + { + FT_Face root = &face->root; + + + if ( psnames && psaux ) + { + FT_CharMapRec charmap; + T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes; + FT_CMap_Class clazz; + + + charmap.face = root; + + /* first of all, try to synthetize a Unicode charmap */ + charmap.platform_id = 3; + charmap.encoding_id = 1; + charmap.encoding = FT_ENCODING_UNICODE; + + FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); + + /* now, generate an Adobe Standard encoding when appropriate */ + charmap.platform_id = 7; + clazz = NULL; + + switch ( type1->encoding_type ) + { + case T1_ENCODING_TYPE_STANDARD: + charmap.encoding = FT_ENCODING_ADOBE_STANDARD; + charmap.encoding_id = TT_ADOBE_ID_STANDARD; + clazz = cmap_classes->standard; + break; + + case T1_ENCODING_TYPE_EXPERT: + charmap.encoding = FT_ENCODING_ADOBE_EXPERT; + charmap.encoding_id = TT_ADOBE_ID_EXPERT; + clazz = cmap_classes->expert; + break; + + case T1_ENCODING_TYPE_ARRAY: + charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; + charmap.encoding_id = TT_ADOBE_ID_CUSTOM; + clazz = cmap_classes->custom; + break; + + case T1_ENCODING_TYPE_ISOLATIN1: + charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; + charmap.encoding_id = TT_ADOBE_ID_LATIN_1; + clazz = cmap_classes->unicode; + break; + + default: + ; + } + + if ( clazz ) + FT_CMap_New( clazz, NULL, &charmap, NULL ); + +#if 0 + /* Select default charmap */ + if (root->num_charmaps) + root->charmap = root->charmaps[0]; +#endif + } + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* T1_Driver_Init */ + /* */ + /* */ + /* Initializes a given Type 1 driver object. */ + /* */ + /* */ + /* driver :: A handle to the target driver object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + T1_Driver_Init( T1_Driver driver ) + { + FT_UNUSED( driver ); + + return T1_Err_Ok; + } + + + /*************************************************************************/ + /* */ + /* */ + /* T1_Driver_Done */ + /* */ + /* */ + /* Finalizes a given Type 1 driver. */ + /* */ + /* */ + /* driver :: A handle to the target Type 1 driver. */ + /* */ + FT_LOCAL_DEF( void ) + T1_Driver_Done( T1_Driver driver ) + { + FT_UNUSED( driver ); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1objs.h b/reactos/dll/3rdparty/freetype/src/type1/t1objs.h index e5e90293d7e..3ea6ff2f2c5 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1objs.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1objs.h @@ -1,171 +1,171 @@ -/***************************************************************************/ -/* */ -/* t1objs.h */ -/* */ -/* Type 1 objects manager (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1OBJS_H__ -#define __T1OBJS_H__ - - -#include -#include FT_INTERNAL_OBJECTS_H -#include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_TYPE1_TYPES_H - - -FT_BEGIN_HEADER - - - /* The following structures must be defined by the hinter */ - typedef struct T1_Size_Hints_ T1_Size_Hints; - typedef struct T1_Glyph_Hints_ T1_Glyph_Hints; - - - /*************************************************************************/ - /* */ - /* */ - /* T1_Driver */ - /* */ - /* */ - /* A handle to a Type 1 driver object. */ - /* */ - typedef struct T1_DriverRec_ *T1_Driver; - - - /*************************************************************************/ - /* */ - /* */ - /* T1_Size */ - /* */ - /* */ - /* A handle to a Type 1 size object. */ - /* */ - typedef struct T1_SizeRec_* T1_Size; - - - /*************************************************************************/ - /* */ - /* */ - /* T1_GlyphSlot */ - /* */ - /* */ - /* A handle to a Type 1 glyph slot object. */ - /* */ - typedef struct T1_GlyphSlotRec_* T1_GlyphSlot; - - - /*************************************************************************/ - /* */ - /* */ - /* T1_CharMap */ - /* */ - /* */ - /* A handle to a Type 1 character mapping object. */ - /* */ - /* */ - /* The Type 1 format doesn't use a charmap but an encoding table. */ - /* The driver is responsible for making up charmap objects */ - /* corresponding to these tables. */ - /* */ - typedef struct T1_CharMapRec_* T1_CharMap; - - - /*************************************************************************/ - /* */ - /* HERE BEGINS THE TYPE1 SPECIFIC STUFF */ - /* */ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* */ - /* T1_SizeRec */ - /* */ - /* */ - /* Type 1 size record. */ - /* */ - typedef struct T1_SizeRec_ - { - FT_SizeRec root; - - } T1_SizeRec; - - - FT_LOCAL( void ) - T1_Size_Done( T1_Size size ); - - FT_LOCAL( FT_Error ) - T1_Size_Request( T1_Size size, - FT_Size_Request req ); - - FT_LOCAL( FT_Error ) - T1_Size_Init( T1_Size size ); - - - /*************************************************************************/ - /* */ - /* */ - /* T1_GlyphSlotRec */ - /* */ - /* */ - /* Type 1 glyph slot record. */ - /* */ - typedef struct T1_GlyphSlotRec_ - { - FT_GlyphSlotRec root; - - FT_Bool hint; - FT_Bool scaled; - - FT_Int max_points; - FT_Int max_contours; - - FT_Fixed x_scale; - FT_Fixed y_scale; - - } T1_GlyphSlotRec; - - - FT_LOCAL( FT_Error ) - T1_Face_Init( FT_Stream stream, - T1_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ); - - FT_LOCAL( void ) - T1_Face_Done( T1_Face face ); - - FT_LOCAL( FT_Error ) - T1_GlyphSlot_Init( T1_GlyphSlot slot ); - - FT_LOCAL( void ) - T1_GlyphSlot_Done( T1_GlyphSlot slot ); - - FT_LOCAL( FT_Error ) - T1_Driver_Init( T1_Driver driver ); - - FT_LOCAL( void ) - T1_Driver_Done( T1_Driver driver ); - - -FT_END_HEADER - -#endif /* __T1OBJS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1objs.h */ +/* */ +/* Type 1 objects manager (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1OBJS_H__ +#define __T1OBJS_H__ + + +#include +#include FT_INTERNAL_OBJECTS_H +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_TYPE1_TYPES_H + + +FT_BEGIN_HEADER + + + /* The following structures must be defined by the hinter */ + typedef struct T1_Size_Hints_ T1_Size_Hints; + typedef struct T1_Glyph_Hints_ T1_Glyph_Hints; + + + /*************************************************************************/ + /* */ + /* */ + /* T1_Driver */ + /* */ + /* */ + /* A handle to a Type 1 driver object. */ + /* */ + typedef struct T1_DriverRec_ *T1_Driver; + + + /*************************************************************************/ + /* */ + /* */ + /* T1_Size */ + /* */ + /* */ + /* A handle to a Type 1 size object. */ + /* */ + typedef struct T1_SizeRec_* T1_Size; + + + /*************************************************************************/ + /* */ + /* */ + /* T1_GlyphSlot */ + /* */ + /* */ + /* A handle to a Type 1 glyph slot object. */ + /* */ + typedef struct T1_GlyphSlotRec_* T1_GlyphSlot; + + + /*************************************************************************/ + /* */ + /* */ + /* T1_CharMap */ + /* */ + /* */ + /* A handle to a Type 1 character mapping object. */ + /* */ + /* */ + /* The Type 1 format doesn't use a charmap but an encoding table. */ + /* The driver is responsible for making up charmap objects */ + /* corresponding to these tables. */ + /* */ + typedef struct T1_CharMapRec_* T1_CharMap; + + + /*************************************************************************/ + /* */ + /* HERE BEGINS THE TYPE1 SPECIFIC STUFF */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* */ + /* T1_SizeRec */ + /* */ + /* */ + /* Type 1 size record. */ + /* */ + typedef struct T1_SizeRec_ + { + FT_SizeRec root; + + } T1_SizeRec; + + + FT_LOCAL( void ) + T1_Size_Done( T1_Size size ); + + FT_LOCAL( FT_Error ) + T1_Size_Request( T1_Size size, + FT_Size_Request req ); + + FT_LOCAL( FT_Error ) + T1_Size_Init( T1_Size size ); + + + /*************************************************************************/ + /* */ + /* */ + /* T1_GlyphSlotRec */ + /* */ + /* */ + /* Type 1 glyph slot record. */ + /* */ + typedef struct T1_GlyphSlotRec_ + { + FT_GlyphSlotRec root; + + FT_Bool hint; + FT_Bool scaled; + + FT_Int max_points; + FT_Int max_contours; + + FT_Fixed x_scale; + FT_Fixed y_scale; + + } T1_GlyphSlotRec; + + + FT_LOCAL( FT_Error ) + T1_Face_Init( FT_Stream stream, + T1_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); + + FT_LOCAL( void ) + T1_Face_Done( T1_Face face ); + + FT_LOCAL( FT_Error ) + T1_GlyphSlot_Init( T1_GlyphSlot slot ); + + FT_LOCAL( void ) + T1_GlyphSlot_Done( T1_GlyphSlot slot ); + + FT_LOCAL( FT_Error ) + T1_Driver_Init( T1_Driver driver ); + + FT_LOCAL( void ) + T1_Driver_Done( T1_Driver driver ); + + +FT_END_HEADER + +#endif /* __T1OBJS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1parse.c b/reactos/dll/3rdparty/freetype/src/type1/t1parse.c index 1b252c74833..be935dd6985 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1parse.c +++ b/reactos/dll/3rdparty/freetype/src/type1/t1parse.c @@ -1,479 +1,479 @@ -/***************************************************************************/ -/* */ -/* t1parse.c */ -/* */ -/* Type 1 parser (body). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* The Type 1 parser is in charge of the following: */ - /* */ - /* - provide an implementation of a growing sequence of objects called */ - /* a `T1_Table' (used to build various tables needed by the loader). */ - /* */ - /* - opening .pfb and .pfa files to extract their top-level and private */ - /* dictionaries. */ - /* */ - /* - read numbers, arrays & strings from any dictionary. */ - /* */ - /* See `t1load.c' to see how data is loaded from the font file. */ - /* */ - /*************************************************************************/ - - -#include -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H - -#include "t1parse.h" - -#include "t1errors.h" - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t1parse - - - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** INPUT STREAM PARSER *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - static FT_Error - read_pfb_tag( FT_Stream stream, - FT_UShort *atag, - FT_Long *asize ) - { - FT_Error error; - FT_UShort tag; - FT_Long size; - - - *atag = 0; - *asize = 0; - - if ( !FT_READ_USHORT( tag ) ) - { - if ( tag == 0x8001U || tag == 0x8002U ) - { - if ( !FT_READ_LONG_LE( size ) ) - *asize = size; - } - - *atag = tag; - } - - return error; - } - - - static FT_Error - check_type1_format( FT_Stream stream, - const char* header_string, - size_t header_length ) - { - FT_Error error; - FT_UShort tag; - FT_Long size; - - - if ( FT_STREAM_SEEK( 0 ) ) - goto Exit; - - error = read_pfb_tag( stream, &tag, &size ); - if ( error ) - goto Exit; - - if ( tag != 0x8001U && FT_STREAM_SEEK( 0 ) ) - goto Exit; - - if ( !FT_FRAME_ENTER( header_length ) ) - { - error = 0; - - if ( ft_memcmp( stream->cursor, header_string, header_length ) != 0 ) - error = T1_Err_Unknown_File_Format; - - FT_FRAME_EXIT(); - } - - Exit: - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - T1_New_Parser( T1_Parser parser, - FT_Stream stream, - FT_Memory memory, - PSAux_Service psaux ) - { - FT_Error error; - FT_UShort tag; - FT_Long size; - - - psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory ); - - parser->stream = stream; - parser->base_len = 0; - parser->base_dict = 0; - parser->private_len = 0; - parser->private_dict = 0; - parser->in_pfb = 0; - parser->in_memory = 0; - parser->single_block = 0; - - /* check the header format */ - error = check_type1_format( stream, "%!PS-AdobeFont", 14 ); - if ( error ) - { - if ( error != T1_Err_Unknown_File_Format ) - goto Exit; - - error = check_type1_format( stream, "%!FontType", 10 ); - if ( error ) - { - FT_TRACE2(( "[not a Type1 font]\n" )); - goto Exit; - } - } - - /******************************************************************/ - /* */ - /* Here a short summary of what is going on: */ - /* */ - /* When creating a new Type 1 parser, we try to locate and load */ - /* the base dictionary if this is possible (i.e. for PFB */ - /* files). Otherwise, we load the whole font into memory. */ - /* */ - /* When `loading' the base dictionary, we only setup pointers */ - /* in the case of a memory-based stream. Otherwise, we */ - /* allocate and load the base dictionary in it. */ - /* */ - /* parser->in_pfb is set if we are in a binary (".pfb") font. */ - /* parser->in_memory is set if we have a memory stream. */ - /* */ - - /* try to compute the size of the base dictionary; */ - /* look for a Postscript binary file tag, i.e 0x8001 */ - if ( FT_STREAM_SEEK( 0L ) ) - goto Exit; - - error = read_pfb_tag( stream, &tag, &size ); - if ( error ) - goto Exit; - - if ( tag != 0x8001U ) - { - /* assume that this is a PFA file for now; an error will */ - /* be produced later when more things are checked */ - if ( FT_STREAM_SEEK( 0L ) ) - goto Exit; - size = stream->size; - } - else - parser->in_pfb = 1; - - /* now, try to load `size' bytes of the `base' dictionary we */ - /* found previously */ - - /* if it is a memory-based resource, set up pointers */ - if ( !stream->read ) - { - parser->base_dict = (FT_Byte*)stream->base + stream->pos; - parser->base_len = size; - parser->in_memory = 1; - - /* check that the `size' field is valid */ - if ( FT_STREAM_SKIP( size ) ) - goto Exit; - } - else - { - /* read segment in memory - this is clumsy, but so does the format */ - if ( FT_ALLOC( parser->base_dict, size ) || - FT_STREAM_READ( parser->base_dict, size ) ) - goto Exit; - parser->base_len = size; - } - - parser->root.base = parser->base_dict; - parser->root.cursor = parser->base_dict; - parser->root.limit = parser->root.cursor + parser->base_len; - - Exit: - if ( error && !parser->in_memory ) - FT_FREE( parser->base_dict ); - - return error; - } - - - FT_LOCAL_DEF( void ) - T1_Finalize_Parser( T1_Parser parser ) - { - FT_Memory memory = parser->root.memory; - - - /* always free the private dictionary */ - FT_FREE( parser->private_dict ); - - /* free the base dictionary only when we have a disk stream */ - if ( !parser->in_memory ) - FT_FREE( parser->base_dict ); - - parser->root.funcs.done( &parser->root ); - } - - - FT_LOCAL_DEF( FT_Error ) - T1_Get_Private_Dict( T1_Parser parser, - PSAux_Service psaux ) - { - FT_Stream stream = parser->stream; - FT_Memory memory = parser->root.memory; - FT_Error error = T1_Err_Ok; - FT_Long size; - - - if ( parser->in_pfb ) - { - /* in the case of the PFB format, the private dictionary can be */ - /* made of several segments. We thus first read the number of */ - /* segments to compute the total size of the private dictionary */ - /* then re-read them into memory. */ - FT_Long start_pos = FT_STREAM_POS(); - FT_UShort tag; - - - parser->private_len = 0; - for (;;) - { - error = read_pfb_tag( stream, &tag, &size ); - if ( error ) - goto Fail; - - if ( tag != 0x8002U ) - break; - - parser->private_len += size; - - if ( FT_STREAM_SKIP( size ) ) - goto Fail; - } - - /* Check that we have a private dictionary there */ - /* and allocate private dictionary buffer */ - if ( parser->private_len == 0 ) - { - FT_ERROR(( "T1_Get_Private_Dict:" )); - FT_ERROR(( " invalid private dictionary section\n" )); - error = T1_Err_Invalid_File_Format; - goto Fail; - } - - if ( FT_STREAM_SEEK( start_pos ) || - FT_ALLOC( parser->private_dict, parser->private_len ) ) - goto Fail; - - parser->private_len = 0; - for (;;) - { - error = read_pfb_tag( stream, &tag, &size ); - if ( error || tag != 0x8002U ) - { - error = T1_Err_Ok; - break; - } - - if ( FT_STREAM_READ( parser->private_dict + parser->private_len, - size ) ) - goto Fail; - - parser->private_len += size; - } - } - else - { - /* We have already `loaded' the whole PFA font file into memory; */ - /* if this is a memory resource, allocate a new block to hold */ - /* the private dict. Otherwise, simply overwrite into the base */ - /* dictionary block in the heap. */ - - /* first of all, look at the `eexec' keyword */ - FT_Byte* cur = parser->base_dict; - FT_Byte* limit = cur + parser->base_len; - FT_Byte c; - - - Again: - for (;;) - { - c = cur[0]; - if ( c == 'e' && cur + 9 < limit ) /* 9 = 5 letters for `eexec' + */ - /* newline + 4 chars */ - { - if ( cur[1] == 'e' && - cur[2] == 'x' && - cur[3] == 'e' && - cur[4] == 'c' ) - break; - } - cur++; - if ( cur >= limit ) - { - FT_ERROR(( "T1_Get_Private_Dict:" )); - FT_ERROR(( " could not find `eexec' keyword\n" )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - } - - /* check whether `eexec' was real -- it could be in a comment */ - /* or string (as e.g. in u003043t.gsf from ghostscript) */ - - parser->root.cursor = parser->base_dict; - parser->root.limit = cur + 9; - - cur = parser->root.cursor; - limit = parser->root.limit; - - while ( cur < limit ) - { - if ( *cur == 'e' && ft_strncmp( (char*)cur, "eexec", 5 ) == 0 ) - goto Found; - - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - break; - T1_Skip_Spaces ( parser ); - cur = parser->root.cursor; - } - - /* we haven't found the correct `eexec'; go back and continue */ - /* searching */ - - cur = limit; - limit = parser->base_dict + parser->base_len; - goto Again; - - /* now determine where to write the _encrypted_ binary private */ - /* dictionary. We overwrite the base dictionary for disk-based */ - /* resources and allocate a new block otherwise */ - - Found: - parser->root.limit = parser->base_dict + parser->base_len; - - T1_Skip_PS_Token( parser ); - cur = parser->root.cursor; - if ( *cur == '\r' ) - { - cur++; - if ( *cur == '\n' ) - cur++; - } - else if ( *cur == '\n' ) - cur++; - else - { - FT_ERROR(( "T1_Get_Private_Dict:" )); - FT_ERROR(( " `eexec' not properly terminated\n" )); - error = T1_Err_Invalid_File_Format; - goto Exit; - } - - size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) ); - - if ( parser->in_memory ) - { - /* note that we allocate one more byte to put a terminating `0' */ - if ( FT_ALLOC( parser->private_dict, size + 1 ) ) - goto Fail; - parser->private_len = size; - } - else - { - parser->single_block = 1; - parser->private_dict = parser->base_dict; - parser->private_len = size; - parser->base_dict = 0; - parser->base_len = 0; - } - - /* now determine whether the private dictionary is encoded in binary */ - /* or hexadecimal ASCII format -- decode it accordingly */ - - /* we need to access the next 4 bytes (after the final \r following */ - /* the `eexec' keyword); if they all are hexadecimal digits, then */ - /* we have a case of ASCII storage */ - - if ( ft_isxdigit( cur[0] ) && ft_isxdigit( cur[1] ) && - ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) ) - { - /* ASCII hexadecimal encoding */ - FT_Long len; - - - parser->root.cursor = cur; - (void)psaux->ps_parser_funcs->to_bytes( &parser->root, - parser->private_dict, - parser->private_len, - &len, - 0 ); - parser->private_len = len; - - /* put a safeguard */ - parser->private_dict[len] = '\0'; - } - else - /* binary encoding -- copy the private dict */ - FT_MEM_MOVE( parser->private_dict, cur, size ); - } - - /* we now decrypt the encoded binary private dictionary */ - psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U ); - - /* replace the four random bytes at the beginning with whitespace */ - parser->private_dict[0] = ' '; - parser->private_dict[1] = ' '; - parser->private_dict[2] = ' '; - parser->private_dict[3] = ' '; - - parser->root.base = parser->private_dict; - parser->root.cursor = parser->private_dict; - parser->root.limit = parser->root.cursor + parser->private_len; - - Fail: - Exit: - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t1parse.c */ +/* */ +/* Type 1 parser (body). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* The Type 1 parser is in charge of the following: */ + /* */ + /* - provide an implementation of a growing sequence of objects called */ + /* a `T1_Table' (used to build various tables needed by the loader). */ + /* */ + /* - opening .pfb and .pfa files to extract their top-level and private */ + /* dictionaries. */ + /* */ + /* - read numbers, arrays & strings from any dictionary. */ + /* */ + /* See `t1load.c' to see how data is loaded from the font file. */ + /* */ + /*************************************************************************/ + + +#include +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H + +#include "t1parse.h" + +#include "t1errors.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t1parse + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** INPUT STREAM PARSER *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + static FT_Error + read_pfb_tag( FT_Stream stream, + FT_UShort *atag, + FT_Long *asize ) + { + FT_Error error; + FT_UShort tag; + FT_Long size; + + + *atag = 0; + *asize = 0; + + if ( !FT_READ_USHORT( tag ) ) + { + if ( tag == 0x8001U || tag == 0x8002U ) + { + if ( !FT_READ_LONG_LE( size ) ) + *asize = size; + } + + *atag = tag; + } + + return error; + } + + + static FT_Error + check_type1_format( FT_Stream stream, + const char* header_string, + size_t header_length ) + { + FT_Error error; + FT_UShort tag; + FT_Long size; + + + if ( FT_STREAM_SEEK( 0 ) ) + goto Exit; + + error = read_pfb_tag( stream, &tag, &size ); + if ( error ) + goto Exit; + + if ( tag != 0x8001U && FT_STREAM_SEEK( 0 ) ) + goto Exit; + + if ( !FT_FRAME_ENTER( header_length ) ) + { + error = 0; + + if ( ft_memcmp( stream->cursor, header_string, header_length ) != 0 ) + error = T1_Err_Unknown_File_Format; + + FT_FRAME_EXIT(); + } + + Exit: + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + T1_New_Parser( T1_Parser parser, + FT_Stream stream, + FT_Memory memory, + PSAux_Service psaux ) + { + FT_Error error; + FT_UShort tag; + FT_Long size; + + + psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory ); + + parser->stream = stream; + parser->base_len = 0; + parser->base_dict = 0; + parser->private_len = 0; + parser->private_dict = 0; + parser->in_pfb = 0; + parser->in_memory = 0; + parser->single_block = 0; + + /* check the header format */ + error = check_type1_format( stream, "%!PS-AdobeFont", 14 ); + if ( error ) + { + if ( error != T1_Err_Unknown_File_Format ) + goto Exit; + + error = check_type1_format( stream, "%!FontType", 10 ); + if ( error ) + { + FT_TRACE2(( "[not a Type1 font]\n" )); + goto Exit; + } + } + + /******************************************************************/ + /* */ + /* Here a short summary of what is going on: */ + /* */ + /* When creating a new Type 1 parser, we try to locate and load */ + /* the base dictionary if this is possible (i.e. for PFB */ + /* files). Otherwise, we load the whole font into memory. */ + /* */ + /* When `loading' the base dictionary, we only setup pointers */ + /* in the case of a memory-based stream. Otherwise, we */ + /* allocate and load the base dictionary in it. */ + /* */ + /* parser->in_pfb is set if we are in a binary (".pfb") font. */ + /* parser->in_memory is set if we have a memory stream. */ + /* */ + + /* try to compute the size of the base dictionary; */ + /* look for a Postscript binary file tag, i.e 0x8001 */ + if ( FT_STREAM_SEEK( 0L ) ) + goto Exit; + + error = read_pfb_tag( stream, &tag, &size ); + if ( error ) + goto Exit; + + if ( tag != 0x8001U ) + { + /* assume that this is a PFA file for now; an error will */ + /* be produced later when more things are checked */ + if ( FT_STREAM_SEEK( 0L ) ) + goto Exit; + size = stream->size; + } + else + parser->in_pfb = 1; + + /* now, try to load `size' bytes of the `base' dictionary we */ + /* found previously */ + + /* if it is a memory-based resource, set up pointers */ + if ( !stream->read ) + { + parser->base_dict = (FT_Byte*)stream->base + stream->pos; + parser->base_len = size; + parser->in_memory = 1; + + /* check that the `size' field is valid */ + if ( FT_STREAM_SKIP( size ) ) + goto Exit; + } + else + { + /* read segment in memory - this is clumsy, but so does the format */ + if ( FT_ALLOC( parser->base_dict, size ) || + FT_STREAM_READ( parser->base_dict, size ) ) + goto Exit; + parser->base_len = size; + } + + parser->root.base = parser->base_dict; + parser->root.cursor = parser->base_dict; + parser->root.limit = parser->root.cursor + parser->base_len; + + Exit: + if ( error && !parser->in_memory ) + FT_FREE( parser->base_dict ); + + return error; + } + + + FT_LOCAL_DEF( void ) + T1_Finalize_Parser( T1_Parser parser ) + { + FT_Memory memory = parser->root.memory; + + + /* always free the private dictionary */ + FT_FREE( parser->private_dict ); + + /* free the base dictionary only when we have a disk stream */ + if ( !parser->in_memory ) + FT_FREE( parser->base_dict ); + + parser->root.funcs.done( &parser->root ); + } + + + FT_LOCAL_DEF( FT_Error ) + T1_Get_Private_Dict( T1_Parser parser, + PSAux_Service psaux ) + { + FT_Stream stream = parser->stream; + FT_Memory memory = parser->root.memory; + FT_Error error = T1_Err_Ok; + FT_Long size; + + + if ( parser->in_pfb ) + { + /* in the case of the PFB format, the private dictionary can be */ + /* made of several segments. We thus first read the number of */ + /* segments to compute the total size of the private dictionary */ + /* then re-read them into memory. */ + FT_Long start_pos = FT_STREAM_POS(); + FT_UShort tag; + + + parser->private_len = 0; + for (;;) + { + error = read_pfb_tag( stream, &tag, &size ); + if ( error ) + goto Fail; + + if ( tag != 0x8002U ) + break; + + parser->private_len += size; + + if ( FT_STREAM_SKIP( size ) ) + goto Fail; + } + + /* Check that we have a private dictionary there */ + /* and allocate private dictionary buffer */ + if ( parser->private_len == 0 ) + { + FT_ERROR(( "T1_Get_Private_Dict:" )); + FT_ERROR(( " invalid private dictionary section\n" )); + error = T1_Err_Invalid_File_Format; + goto Fail; + } + + if ( FT_STREAM_SEEK( start_pos ) || + FT_ALLOC( parser->private_dict, parser->private_len ) ) + goto Fail; + + parser->private_len = 0; + for (;;) + { + error = read_pfb_tag( stream, &tag, &size ); + if ( error || tag != 0x8002U ) + { + error = T1_Err_Ok; + break; + } + + if ( FT_STREAM_READ( parser->private_dict + parser->private_len, + size ) ) + goto Fail; + + parser->private_len += size; + } + } + else + { + /* We have already `loaded' the whole PFA font file into memory; */ + /* if this is a memory resource, allocate a new block to hold */ + /* the private dict. Otherwise, simply overwrite into the base */ + /* dictionary block in the heap. */ + + /* first of all, look at the `eexec' keyword */ + FT_Byte* cur = parser->base_dict; + FT_Byte* limit = cur + parser->base_len; + FT_Byte c; + + + Again: + for (;;) + { + c = cur[0]; + if ( c == 'e' && cur + 9 < limit ) /* 9 = 5 letters for `eexec' + */ + /* newline + 4 chars */ + { + if ( cur[1] == 'e' && + cur[2] == 'x' && + cur[3] == 'e' && + cur[4] == 'c' ) + break; + } + cur++; + if ( cur >= limit ) + { + FT_ERROR(( "T1_Get_Private_Dict:" )); + FT_ERROR(( " could not find `eexec' keyword\n" )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + } + + /* check whether `eexec' was real -- it could be in a comment */ + /* or string (as e.g. in u003043t.gsf from ghostscript) */ + + parser->root.cursor = parser->base_dict; + parser->root.limit = cur + 9; + + cur = parser->root.cursor; + limit = parser->root.limit; + + while ( cur < limit ) + { + if ( *cur == 'e' && ft_strncmp( (char*)cur, "eexec", 5 ) == 0 ) + goto Found; + + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + break; + T1_Skip_Spaces ( parser ); + cur = parser->root.cursor; + } + + /* we haven't found the correct `eexec'; go back and continue */ + /* searching */ + + cur = limit; + limit = parser->base_dict + parser->base_len; + goto Again; + + /* now determine where to write the _encrypted_ binary private */ + /* dictionary. We overwrite the base dictionary for disk-based */ + /* resources and allocate a new block otherwise */ + + Found: + parser->root.limit = parser->base_dict + parser->base_len; + + T1_Skip_PS_Token( parser ); + cur = parser->root.cursor; + if ( *cur == '\r' ) + { + cur++; + if ( *cur == '\n' ) + cur++; + } + else if ( *cur == '\n' ) + cur++; + else + { + FT_ERROR(( "T1_Get_Private_Dict:" )); + FT_ERROR(( " `eexec' not properly terminated\n" )); + error = T1_Err_Invalid_File_Format; + goto Exit; + } + + size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) ); + + if ( parser->in_memory ) + { + /* note that we allocate one more byte to put a terminating `0' */ + if ( FT_ALLOC( parser->private_dict, size + 1 ) ) + goto Fail; + parser->private_len = size; + } + else + { + parser->single_block = 1; + parser->private_dict = parser->base_dict; + parser->private_len = size; + parser->base_dict = 0; + parser->base_len = 0; + } + + /* now determine whether the private dictionary is encoded in binary */ + /* or hexadecimal ASCII format -- decode it accordingly */ + + /* we need to access the next 4 bytes (after the final \r following */ + /* the `eexec' keyword); if they all are hexadecimal digits, then */ + /* we have a case of ASCII storage */ + + if ( ft_isxdigit( cur[0] ) && ft_isxdigit( cur[1] ) && + ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) ) + { + /* ASCII hexadecimal encoding */ + FT_Long len; + + + parser->root.cursor = cur; + (void)psaux->ps_parser_funcs->to_bytes( &parser->root, + parser->private_dict, + parser->private_len, + &len, + 0 ); + parser->private_len = len; + + /* put a safeguard */ + parser->private_dict[len] = '\0'; + } + else + /* binary encoding -- copy the private dict */ + FT_MEM_MOVE( parser->private_dict, cur, size ); + } + + /* we now decrypt the encoded binary private dictionary */ + psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U ); + + /* replace the four random bytes at the beginning with whitespace */ + parser->private_dict[0] = ' '; + parser->private_dict[1] = ' '; + parser->private_dict[2] = ' '; + parser->private_dict[3] = ' '; + + parser->root.base = parser->private_dict; + parser->root.cursor = parser->private_dict; + parser->root.limit = parser->root.cursor + parser->private_len; + + Fail: + Exit: + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1parse.h b/reactos/dll/3rdparty/freetype/src/type1/t1parse.h index 6fa4ca624a2..5089851757e 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1parse.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1parse.h @@ -1,135 +1,135 @@ -/***************************************************************************/ -/* */ -/* t1parse.h */ -/* */ -/* Type 1 parser (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1PARSE_H__ -#define __T1PARSE_H__ - - -#include -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_STREAM_H - - -FT_BEGIN_HEADER - - - /*************************************************************************/ - /* */ - /* */ - /* T1_ParserRec */ - /* */ - /* */ - /* A PS_ParserRec is an object used to parse a Type 1 fonts very */ - /* quickly. */ - /* */ - /* */ - /* root :: The root parser. */ - /* */ - /* stream :: The current input stream. */ - /* */ - /* base_dict :: A pointer to the top-level dictionary. */ - /* */ - /* base_len :: The length in bytes of the top dictionary. */ - /* */ - /* private_dict :: A pointer to the private dictionary. */ - /* */ - /* private_len :: The length in bytes of the private dictionary. */ - /* */ - /* in_pfb :: A boolean. Indicates that we are handling a PFB */ - /* file. */ - /* */ - /* in_memory :: A boolean. Indicates a memory-based stream. */ - /* */ - /* single_block :: A boolean. Indicates that the private dictionary */ - /* is stored in lieu of the base dictionary. */ - /* */ - typedef struct T1_ParserRec_ - { - PS_ParserRec root; - FT_Stream stream; - - FT_Byte* base_dict; - FT_Long base_len; - - FT_Byte* private_dict; - FT_Long private_len; - - FT_Bool in_pfb; - FT_Bool in_memory; - FT_Bool single_block; - - } T1_ParserRec, *T1_Parser; - - -#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l ) -#define T1_Done_Table( p ) \ - do \ - { \ - if ( (p)->funcs.done ) \ - (p)->funcs.done( p ); \ - } while ( 0 ) -#define T1_Release_Table( p ) \ - do \ - { \ - if ( (p)->funcs.release ) \ - (p)->funcs.release( p ); \ - } while ( 0 ) - - -#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) -#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root ) - -#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root ) -#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) - -#define T1_ToCoordArray( p, m, c ) \ - (p)->root.funcs.to_coord_array( &(p)->root, m, c ) -#define T1_ToFixedArray( p, m, f, t ) \ - (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) -#define T1_ToToken( p, t ) \ - (p)->root.funcs.to_token( &(p)->root, t ) -#define T1_ToTokenArray( p, t, m, c ) \ - (p)->root.funcs.to_token_array( &(p)->root, t, m, c ) - -#define T1_Load_Field( p, f, o, m, pf ) \ - (p)->root.funcs.load_field( &(p)->root, f, o, m, pf ) - -#define T1_Load_Field_Table( p, f, o, m, pf ) \ - (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf ) - - - FT_LOCAL( FT_Error ) - T1_New_Parser( T1_Parser parser, - FT_Stream stream, - FT_Memory memory, - PSAux_Service psaux ); - - FT_LOCAL( FT_Error ) - T1_Get_Private_Dict( T1_Parser parser, - PSAux_Service psaux ); - - FT_LOCAL( void ) - T1_Finalize_Parser( T1_Parser parser ); - - -FT_END_HEADER - -#endif /* __T1PARSE_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1parse.h */ +/* */ +/* Type 1 parser (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T1PARSE_H__ +#define __T1PARSE_H__ + + +#include +#include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_STREAM_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* */ + /* T1_ParserRec */ + /* */ + /* */ + /* A PS_ParserRec is an object used to parse a Type 1 fonts very */ + /* quickly. */ + /* */ + /* */ + /* root :: The root parser. */ + /* */ + /* stream :: The current input stream. */ + /* */ + /* base_dict :: A pointer to the top-level dictionary. */ + /* */ + /* base_len :: The length in bytes of the top dictionary. */ + /* */ + /* private_dict :: A pointer to the private dictionary. */ + /* */ + /* private_len :: The length in bytes of the private dictionary. */ + /* */ + /* in_pfb :: A boolean. Indicates that we are handling a PFB */ + /* file. */ + /* */ + /* in_memory :: A boolean. Indicates a memory-based stream. */ + /* */ + /* single_block :: A boolean. Indicates that the private dictionary */ + /* is stored in lieu of the base dictionary. */ + /* */ + typedef struct T1_ParserRec_ + { + PS_ParserRec root; + FT_Stream stream; + + FT_Byte* base_dict; + FT_Long base_len; + + FT_Byte* private_dict; + FT_Long private_len; + + FT_Bool in_pfb; + FT_Bool in_memory; + FT_Bool single_block; + + } T1_ParserRec, *T1_Parser; + + +#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l ) +#define T1_Done_Table( p ) \ + do \ + { \ + if ( (p)->funcs.done ) \ + (p)->funcs.done( p ); \ + } while ( 0 ) +#define T1_Release_Table( p ) \ + do \ + { \ + if ( (p)->funcs.release ) \ + (p)->funcs.release( p ); \ + } while ( 0 ) + + +#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) +#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root ) + +#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root ) +#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) + +#define T1_ToCoordArray( p, m, c ) \ + (p)->root.funcs.to_coord_array( &(p)->root, m, c ) +#define T1_ToFixedArray( p, m, f, t ) \ + (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) +#define T1_ToToken( p, t ) \ + (p)->root.funcs.to_token( &(p)->root, t ) +#define T1_ToTokenArray( p, t, m, c ) \ + (p)->root.funcs.to_token_array( &(p)->root, t, m, c ) + +#define T1_Load_Field( p, f, o, m, pf ) \ + (p)->root.funcs.load_field( &(p)->root, f, o, m, pf ) + +#define T1_Load_Field_Table( p, f, o, m, pf ) \ + (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf ) + + + FT_LOCAL( FT_Error ) + T1_New_Parser( T1_Parser parser, + FT_Stream stream, + FT_Memory memory, + PSAux_Service psaux ); + + FT_LOCAL( FT_Error ) + T1_Get_Private_Dict( T1_Parser parser, + PSAux_Service psaux ); + + FT_LOCAL( void ) + T1_Finalize_Parser( T1_Parser parser ); + + +FT_END_HEADER + +#endif /* __T1PARSE_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/t1tokens.h b/reactos/dll/3rdparty/freetype/src/type1/t1tokens.h index 788c811b049..5d29d0e7e76 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/t1tokens.h +++ b/reactos/dll/3rdparty/freetype/src/type1/t1tokens.h @@ -1,134 +1,134 @@ -/***************************************************************************/ -/* */ -/* t1tokens.h */ -/* */ -/* Type 1 tokenizer (specification). */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#undef FT_STRUCTURE -#define FT_STRUCTURE PS_FontInfoRec -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_FONT_INFO - - T1_FIELD_STRING( "version", version, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_STRING( "Notice", notice, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_STRING( "FullName", full_name, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_STRING( "FamilyName", family_name, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_STRING( "Weight", weight, - T1_FIELD_DICT_FONTDICT ) - - /* we use pointers to detect modifications made by synthetic fonts */ - T1_FIELD_NUM ( "ItalicAngle", italic_angle, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_NUM ( "UnderlinePosition", underline_position, - T1_FIELD_DICT_FONTDICT ) - T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, - T1_FIELD_DICT_FONTDICT ) - - -#undef FT_STRUCTURE -#define FT_STRUCTURE PS_PrivateRec -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_PRIVATE - - T1_FIELD_NUM ( "UniqueID", unique_id, - T1_FIELD_DICT_FONTDICT | T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM ( "lenIV", lenIV, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM ( "LanguageGroup", language_group, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM ( "password", password, - T1_FIELD_DICT_PRIVATE ) - - T1_FIELD_FIXED_1000( "BlueScale", blue_scale, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM ( "BlueShift", blue_shift, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM ( "BlueFuzz", blue_fuzz, - T1_FIELD_DICT_PRIVATE ) - - T1_FIELD_NUM_TABLE ( "BlueValues", blue_values, 14, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM_TABLE ( "OtherBlues", other_blues, 10, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM_TABLE ( "FamilyBlues", family_blues, 14, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM_TABLE ( "FamilyOtherBlues", family_other_blues, 10, - T1_FIELD_DICT_PRIVATE ) - - T1_FIELD_NUM_TABLE2( "StdHW", standard_width, 1, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM_TABLE2( "StdVW", standard_height, 1, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM_TABLE2( "MinFeature", min_feature, 2, - T1_FIELD_DICT_PRIVATE ) - - T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12, - T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12, - T1_FIELD_DICT_PRIVATE ) - - T1_FIELD_FIXED ( "ExpansionFactor", expansion_factor, - T1_FIELD_DICT_PRIVATE ) - - -#undef FT_STRUCTURE -#define FT_STRUCTURE T1_FontRec -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_FONT_DICT - - T1_FIELD_KEY ( "FontName", font_name, T1_FIELD_DICT_FONTDICT ) - T1_FIELD_NUM ( "PaintType", paint_type, T1_FIELD_DICT_FONTDICT ) - T1_FIELD_NUM ( "FontType", font_type, T1_FIELD_DICT_FONTDICT ) - T1_FIELD_FIXED( "StrokeWidth", stroke_width, T1_FIELD_DICT_FONTDICT ) - - -#undef FT_STRUCTURE -#define FT_STRUCTURE FT_BBox -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_BBOX - - T1_FIELD_BBOX( "FontBBox", xMin, T1_FIELD_DICT_FONTDICT ) - - -#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT - -#undef FT_STRUCTURE -#define FT_STRUCTURE T1_FaceRec -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_FACE - - T1_FIELD_NUM( "NDV", ndv_idx, T1_FIELD_DICT_PRIVATE ) - T1_FIELD_NUM( "CDV", cdv_idx, T1_FIELD_DICT_PRIVATE ) - - -#undef FT_STRUCTURE -#define FT_STRUCTURE PS_BlendRec -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_BLEND - - T1_FIELD_NUM_TABLE( "DesignVector", default_design_vector, - T1_MAX_MM_DESIGNS, T1_FIELD_DICT_FONTDICT ) - - -#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t1tokens.h */ +/* */ +/* Type 1 tokenizer (specification). */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#undef FT_STRUCTURE +#define FT_STRUCTURE PS_FontInfoRec +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_FONT_INFO + + T1_FIELD_STRING( "version", version, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_STRING( "Notice", notice, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_STRING( "FullName", full_name, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_STRING( "FamilyName", family_name, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_STRING( "Weight", weight, + T1_FIELD_DICT_FONTDICT ) + + /* we use pointers to detect modifications made by synthetic fonts */ + T1_FIELD_NUM ( "ItalicAngle", italic_angle, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_NUM ( "UnderlinePosition", underline_position, + T1_FIELD_DICT_FONTDICT ) + T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, + T1_FIELD_DICT_FONTDICT ) + + +#undef FT_STRUCTURE +#define FT_STRUCTURE PS_PrivateRec +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_PRIVATE + + T1_FIELD_NUM ( "UniqueID", unique_id, + T1_FIELD_DICT_FONTDICT | T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM ( "lenIV", lenIV, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM ( "LanguageGroup", language_group, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM ( "password", password, + T1_FIELD_DICT_PRIVATE ) + + T1_FIELD_FIXED_1000( "BlueScale", blue_scale, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM ( "BlueShift", blue_shift, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM ( "BlueFuzz", blue_fuzz, + T1_FIELD_DICT_PRIVATE ) + + T1_FIELD_NUM_TABLE ( "BlueValues", blue_values, 14, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM_TABLE ( "OtherBlues", other_blues, 10, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM_TABLE ( "FamilyBlues", family_blues, 14, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM_TABLE ( "FamilyOtherBlues", family_other_blues, 10, + T1_FIELD_DICT_PRIVATE ) + + T1_FIELD_NUM_TABLE2( "StdHW", standard_width, 1, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM_TABLE2( "StdVW", standard_height, 1, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM_TABLE2( "MinFeature", min_feature, 2, + T1_FIELD_DICT_PRIVATE ) + + T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12, + T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12, + T1_FIELD_DICT_PRIVATE ) + + T1_FIELD_FIXED ( "ExpansionFactor", expansion_factor, + T1_FIELD_DICT_PRIVATE ) + + +#undef FT_STRUCTURE +#define FT_STRUCTURE T1_FontRec +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_FONT_DICT + + T1_FIELD_KEY ( "FontName", font_name, T1_FIELD_DICT_FONTDICT ) + T1_FIELD_NUM ( "PaintType", paint_type, T1_FIELD_DICT_FONTDICT ) + T1_FIELD_NUM ( "FontType", font_type, T1_FIELD_DICT_FONTDICT ) + T1_FIELD_FIXED( "StrokeWidth", stroke_width, T1_FIELD_DICT_FONTDICT ) + + +#undef FT_STRUCTURE +#define FT_STRUCTURE FT_BBox +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_BBOX + + T1_FIELD_BBOX( "FontBBox", xMin, T1_FIELD_DICT_FONTDICT ) + + +#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT + +#undef FT_STRUCTURE +#define FT_STRUCTURE T1_FaceRec +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_FACE + + T1_FIELD_NUM( "NDV", ndv_idx, T1_FIELD_DICT_PRIVATE ) + T1_FIELD_NUM( "CDV", cdv_idx, T1_FIELD_DICT_PRIVATE ) + + +#undef FT_STRUCTURE +#define FT_STRUCTURE PS_BlendRec +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_BLEND + + T1_FIELD_NUM_TABLE( "DesignVector", default_design_vector, + T1_MAX_MM_DESIGNS, T1_FIELD_DICT_FONTDICT ) + + +#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type1/type1.c b/reactos/dll/3rdparty/freetype/src/type1/type1.c index ccc12be1038..8e7fed267f5 100644 --- a/reactos/dll/3rdparty/freetype/src/type1/type1.c +++ b/reactos/dll/3rdparty/freetype/src/type1/type1.c @@ -1,33 +1,33 @@ -/***************************************************************************/ -/* */ -/* type1.c */ -/* */ -/* FreeType Type 1 driver component (body only). */ -/* */ -/* Copyright 1996-2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "t1parse.c" -#include "t1load.c" -#include "t1objs.c" -#include "t1driver.c" -#include "t1gload.c" - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include "t1afm.c" -#endif - - -/* END */ +/***************************************************************************/ +/* */ +/* type1.c */ +/* */ +/* FreeType Type 1 driver component (body only). */ +/* */ +/* Copyright 1996-2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "t1parse.c" +#include "t1load.c" +#include "t1objs.c" +#include "t1driver.c" +#include "t1gload.c" + +#ifndef T1_CONFIG_OPTION_NO_AFM +#include "t1afm.c" +#endif + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42drivr.c b/reactos/dll/3rdparty/freetype/src/type42/t42drivr.c index a6e4cf4b651..a78b79b74f7 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42drivr.c +++ b/reactos/dll/3rdparty/freetype/src/type42/t42drivr.c @@ -1,232 +1,232 @@ -/***************************************************************************/ -/* */ -/* t42drivr.c */ -/* */ -/* High-level Type 42 driver interface (body). */ -/* */ -/* Copyright 2002, 2003, 2004, 2006, 2007 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This driver implements Type42 fonts as described in the */ - /* Technical Note #5012 from Adobe, with these limitations: */ - /* */ - /* 1) CID Fonts are not currently supported. */ - /* 2) Incremental fonts making use of the GlyphDirectory keyword */ - /* will be loaded, but the rendering will be using the TrueType */ - /* tables. */ - /* 3) As for Type1 fonts, CDevProc is not supported. */ - /* 4) The Metrics dictionary is not supported. */ - /* 5) AFM metrics are not supported. */ - /* */ - /* In other words, this driver supports Type42 fonts derived from */ - /* TrueType fonts in a non-CID manner, as done by usual conversion */ - /* programs. */ - /* */ - /*************************************************************************/ - - -#include "t42drivr.h" -#include "t42objs.h" -#include "t42error.h" -#include FT_INTERNAL_DEBUG_H - -#include FT_SERVICE_XFREE86_NAME_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_POSTSCRIPT_INFO_H - -#undef FT_COMPONENT -#define FT_COMPONENT trace_t42 - - - /* - * - * GLYPH DICT SERVICE - * - */ - - static FT_Error - t42_get_glyph_name( T42_Face face, - FT_UInt glyph_index, - FT_Pointer buffer, - FT_UInt buffer_max ) - { - FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max ); - - return T42_Err_Ok; - } - - - static FT_UInt - t42_get_name_index( T42_Face face, - FT_String* glyph_name ) - { - FT_Int i; - FT_String* gname; - - - for ( i = 0; i < face->type1.num_glyphs; i++ ) - { - gname = face->type1.glyph_names[i]; - - if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) ) - return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] ); - } - - return 0; - } - - - static const FT_Service_GlyphDictRec t42_service_glyph_dict = - { - (FT_GlyphDict_GetNameFunc) t42_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)t42_get_name_index - }; - - - /* - * - * POSTSCRIPT NAME SERVICE - * - */ - - static const char* - t42_get_ps_font_name( T42_Face face ) - { - return (const char*)face->type1.font_name; - } - - - static const FT_Service_PsFontNameRec t42_service_ps_font_name = - { - (FT_PsName_GetFunc)t42_get_ps_font_name - }; - - - /* - * - * POSTSCRIPT INFO SERVICE - * - */ - - static FT_Error - t42_ps_get_font_info( FT_Face face, - PS_FontInfoRec* afont_info ) - { - *afont_info = ((T42_Face)face)->type1.font_info; - return T42_Err_Ok; - } - - - static FT_Int - t42_ps_has_glyph_names( FT_Face face ) - { - FT_UNUSED( face ); - return 1; - } - - - static FT_Error - t42_ps_get_font_private( FT_Face face, - PS_PrivateRec* afont_private ) - { - *afont_private = ((T42_Face)face)->type1.private_dict; - return T42_Err_Ok; - } - - - static const FT_Service_PsInfoRec t42_service_ps_info = - { - (PS_GetFontInfoFunc) t42_ps_get_font_info, - (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names, - (PS_GetFontPrivateFunc)t42_ps_get_font_private - }; - - - /* - * - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec t42_services[] = - { - { FT_SERVICE_ID_GLYPH_DICT, &t42_service_glyph_dict }, - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name }, - { FT_SERVICE_ID_POSTSCRIPT_INFO, &t42_service_ps_info }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_42 }, - { NULL, NULL } - }; - - - static FT_Module_Interface - T42_Get_Interface( FT_Driver driver, - const FT_String* t42_interface ) - { - FT_UNUSED( driver ); - - return ft_service_list_lookup( t42_services, t42_interface ); - } - - - const FT_Driver_ClassRec t42_driver_class = - { - { - FT_MODULE_FONT_DRIVER | - FT_MODULE_DRIVER_SCALABLE | -#ifdef TT_USE_BYTECODE_INTERPRETER - FT_MODULE_DRIVER_HAS_HINTER, -#else - 0, -#endif - - sizeof ( T42_DriverRec ), - - "type42", - 0x10000L, - 0x20000L, - - 0, /* format interface */ - - (FT_Module_Constructor)T42_Driver_Init, - (FT_Module_Destructor) T42_Driver_Done, - (FT_Module_Requester) T42_Get_Interface, - }, - - sizeof ( T42_FaceRec ), - sizeof ( T42_SizeRec ), - sizeof ( T42_GlyphSlotRec ), - - (FT_Face_InitFunc) T42_Face_Init, - (FT_Face_DoneFunc) T42_Face_Done, - (FT_Size_InitFunc) T42_Size_Init, - (FT_Size_DoneFunc) T42_Size_Done, - (FT_Slot_InitFunc) T42_GlyphSlot_Init, - (FT_Slot_DoneFunc) T42_GlyphSlot_Done, - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif - (FT_Slot_LoadFunc) T42_GlyphSlot_Load, - - (FT_Face_GetKerningFunc) 0, - (FT_Face_AttachFunc) 0, - - (FT_Face_GetAdvancesFunc) 0, - (FT_Size_RequestFunc) T42_Size_Request, - (FT_Size_SelectFunc) T42_Size_Select - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* t42drivr.c */ +/* */ +/* High-level Type 42 driver interface (body). */ +/* */ +/* Copyright 2002, 2003, 2004, 2006, 2007 by Roberto Alameda. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This driver implements Type42 fonts as described in the */ + /* Technical Note #5012 from Adobe, with these limitations: */ + /* */ + /* 1) CID Fonts are not currently supported. */ + /* 2) Incremental fonts making use of the GlyphDirectory keyword */ + /* will be loaded, but the rendering will be using the TrueType */ + /* tables. */ + /* 3) As for Type1 fonts, CDevProc is not supported. */ + /* 4) The Metrics dictionary is not supported. */ + /* 5) AFM metrics are not supported. */ + /* */ + /* In other words, this driver supports Type42 fonts derived from */ + /* TrueType fonts in a non-CID manner, as done by usual conversion */ + /* programs. */ + /* */ + /*************************************************************************/ + + +#include "t42drivr.h" +#include "t42objs.h" +#include "t42error.h" +#include FT_INTERNAL_DEBUG_H + +#include FT_SERVICE_XFREE86_NAME_H +#include FT_SERVICE_GLYPH_DICT_H +#include FT_SERVICE_POSTSCRIPT_NAME_H +#include FT_SERVICE_POSTSCRIPT_INFO_H + +#undef FT_COMPONENT +#define FT_COMPONENT trace_t42 + + + /* + * + * GLYPH DICT SERVICE + * + */ + + static FT_Error + t42_get_glyph_name( T42_Face face, + FT_UInt glyph_index, + FT_Pointer buffer, + FT_UInt buffer_max ) + { + FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max ); + + return T42_Err_Ok; + } + + + static FT_UInt + t42_get_name_index( T42_Face face, + FT_String* glyph_name ) + { + FT_Int i; + FT_String* gname; + + + for ( i = 0; i < face->type1.num_glyphs; i++ ) + { + gname = face->type1.glyph_names[i]; + + if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) ) + return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] ); + } + + return 0; + } + + + static const FT_Service_GlyphDictRec t42_service_glyph_dict = + { + (FT_GlyphDict_GetNameFunc) t42_get_glyph_name, + (FT_GlyphDict_NameIndexFunc)t42_get_name_index + }; + + + /* + * + * POSTSCRIPT NAME SERVICE + * + */ + + static const char* + t42_get_ps_font_name( T42_Face face ) + { + return (const char*)face->type1.font_name; + } + + + static const FT_Service_PsFontNameRec t42_service_ps_font_name = + { + (FT_PsName_GetFunc)t42_get_ps_font_name + }; + + + /* + * + * POSTSCRIPT INFO SERVICE + * + */ + + static FT_Error + t42_ps_get_font_info( FT_Face face, + PS_FontInfoRec* afont_info ) + { + *afont_info = ((T42_Face)face)->type1.font_info; + return T42_Err_Ok; + } + + + static FT_Int + t42_ps_has_glyph_names( FT_Face face ) + { + FT_UNUSED( face ); + return 1; + } + + + static FT_Error + t42_ps_get_font_private( FT_Face face, + PS_PrivateRec* afont_private ) + { + *afont_private = ((T42_Face)face)->type1.private_dict; + return T42_Err_Ok; + } + + + static const FT_Service_PsInfoRec t42_service_ps_info = + { + (PS_GetFontInfoFunc) t42_ps_get_font_info, + (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names, + (PS_GetFontPrivateFunc)t42_ps_get_font_private + }; + + + /* + * + * SERVICE LIST + * + */ + + static const FT_ServiceDescRec t42_services[] = + { + { FT_SERVICE_ID_GLYPH_DICT, &t42_service_glyph_dict }, + { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name }, + { FT_SERVICE_ID_POSTSCRIPT_INFO, &t42_service_ps_info }, + { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_42 }, + { NULL, NULL } + }; + + + static FT_Module_Interface + T42_Get_Interface( FT_Driver driver, + const FT_String* t42_interface ) + { + FT_UNUSED( driver ); + + return ft_service_list_lookup( t42_services, t42_interface ); + } + + + const FT_Driver_ClassRec t42_driver_class = + { + { + FT_MODULE_FONT_DRIVER | + FT_MODULE_DRIVER_SCALABLE | +#ifdef TT_USE_BYTECODE_INTERPRETER + FT_MODULE_DRIVER_HAS_HINTER, +#else + 0, +#endif + + sizeof ( T42_DriverRec ), + + "type42", + 0x10000L, + 0x20000L, + + 0, /* format interface */ + + (FT_Module_Constructor)T42_Driver_Init, + (FT_Module_Destructor) T42_Driver_Done, + (FT_Module_Requester) T42_Get_Interface, + }, + + sizeof ( T42_FaceRec ), + sizeof ( T42_SizeRec ), + sizeof ( T42_GlyphSlotRec ), + + (FT_Face_InitFunc) T42_Face_Init, + (FT_Face_DoneFunc) T42_Face_Done, + (FT_Size_InitFunc) T42_Size_Init, + (FT_Size_DoneFunc) T42_Size_Done, + (FT_Slot_InitFunc) T42_GlyphSlot_Init, + (FT_Slot_DoneFunc) T42_GlyphSlot_Done, + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + ft_stub_set_char_sizes, + ft_stub_set_pixel_sizes, +#endif + (FT_Slot_LoadFunc) T42_GlyphSlot_Load, + + (FT_Face_GetKerningFunc) 0, + (FT_Face_AttachFunc) 0, + + (FT_Face_GetAdvancesFunc) 0, + (FT_Size_RequestFunc) T42_Size_Request, + (FT_Size_SelectFunc) T42_Size_Select + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42drivr.h b/reactos/dll/3rdparty/freetype/src/type42/t42drivr.h index 98b7410b670..15b68cc7226 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42drivr.h +++ b/reactos/dll/3rdparty/freetype/src/type42/t42drivr.h @@ -1,38 +1,38 @@ -/***************************************************************************/ -/* */ -/* t42drivr.h */ -/* */ -/* High-level Type 42 driver interface (specification). */ -/* */ -/* Copyright 2002 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T42DRIVR_H__ -#define __T42DRIVR_H__ - - -#include -#include FT_INTERNAL_DRIVER_H - - -FT_BEGIN_HEADER - - - FT_EXPORT_VAR( const FT_Driver_ClassRec ) t42_driver_class; - - -FT_END_HEADER - - -#endif /* __T42DRIVR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t42drivr.h */ +/* */ +/* High-level Type 42 driver interface (specification). */ +/* */ +/* Copyright 2002 by Roberto Alameda. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T42DRIVR_H__ +#define __T42DRIVR_H__ + + +#include +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER + + + FT_EXPORT_VAR( const FT_Driver_ClassRec ) t42_driver_class; + + +FT_END_HEADER + + +#endif /* __T42DRIVR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42error.h b/reactos/dll/3rdparty/freetype/src/type42/t42error.h index b230910012f..33f9896284e 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42error.h +++ b/reactos/dll/3rdparty/freetype/src/type42/t42error.h @@ -1,40 +1,40 @@ -/***************************************************************************/ -/* */ -/* t42error.h */ -/* */ -/* Type 42 error codes (specification only). */ -/* */ -/* Copyright 2002, 2003 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the Type 42 error enumeration constants. */ - /* */ - /*************************************************************************/ - -#ifndef __T42ERROR_H__ -#define __T42ERROR_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX T42_Err_ -#define FT_ERR_BASE FT_Mod_Err_Type42 - -#include FT_ERRORS_H - -#endif /* __T42ERROR_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t42error.h */ +/* */ +/* Type 42 error codes (specification only). */ +/* */ +/* Copyright 2002, 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the Type 42 error enumeration constants. */ + /* */ + /*************************************************************************/ + +#ifndef __T42ERROR_H__ +#define __T42ERROR_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX T42_Err_ +#define FT_ERR_BASE FT_Mod_Err_Type42 + +#include FT_ERRORS_H + +#endif /* __T42ERROR_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42objs.c b/reactos/dll/3rdparty/freetype/src/type42/t42objs.c index db04fde367a..6f5f1b0694f 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42objs.c +++ b/reactos/dll/3rdparty/freetype/src/type42/t42objs.c @@ -1,647 +1,647 @@ -/***************************************************************************/ -/* */ -/* t42objs.c */ -/* */ -/* Type 42 objects manager (body). */ -/* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "t42objs.h" -#include "t42parse.h" -#include "t42error.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_LIST_H - - -#undef FT_COMPONENT -#define FT_COMPONENT trace_t42 - - - static FT_Error - T42_Open_Face( T42_Face face ) - { - T42_LoaderRec loader; - T42_Parser parser; - T1_Font type1 = &face->type1; - FT_Memory memory = face->root.memory; - FT_Error error; - - PSAux_Service psaux = (PSAux_Service)face->psaux; - - - t42_loader_init( &loader, face ); - - parser = &loader.parser; - - if ( FT_ALLOC( face->ttf_data, 12 ) ) - goto Exit; - - error = t42_parser_init( parser, - face->root.stream, - memory, - psaux); - if ( error ) - goto Exit; - - error = t42_parse_dict( face, &loader, - parser->base_dict, parser->base_len ); - if ( error ) - goto Exit; - - if ( type1->font_type != 42 ) - { - error = T42_Err_Unknown_File_Format; - goto Exit; - } - - /* now, propagate the charstrings and glyphnames tables */ - /* to the Type1 data */ - type1->num_glyphs = loader.num_glyphs; - - if ( !loader.charstrings.init ) - { - FT_ERROR(( "T42_Open_Face: no charstrings array in face!\n" )); - error = T42_Err_Invalid_File_Format; - } - - loader.charstrings.init = 0; - type1->charstrings_block = loader.charstrings.block; - type1->charstrings = loader.charstrings.elements; - type1->charstrings_len = loader.charstrings.lengths; - - /* we copy the glyph names `block' and `elements' fields; */ - /* the `lengths' field must be released later */ - type1->glyph_names_block = loader.glyph_names.block; - type1->glyph_names = (FT_String**)loader.glyph_names.elements; - loader.glyph_names.block = 0; - loader.glyph_names.elements = 0; - - /* we must now build type1.encoding when we have a custom array */ - if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) - { - FT_Int charcode, idx, min_char, max_char; - FT_Byte* char_name; - FT_Byte* glyph_name; - - - /* OK, we do the following: for each element in the encoding */ - /* table, look up the index of the glyph having the same name */ - /* as defined in the CharStrings array. */ - /* The index is then stored in type1.encoding.char_index, and */ - /* the name in type1.encoding.char_name */ - - min_char = +32000; - max_char = -32000; - - charcode = 0; - for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) - { - type1->encoding.char_index[charcode] = 0; - type1->encoding.char_name [charcode] = (char *)".notdef"; - - char_name = loader.encoding_table.elements[charcode]; - if ( char_name ) - for ( idx = 0; idx < type1->num_glyphs; idx++ ) - { - glyph_name = (FT_Byte*)type1->glyph_names[idx]; - if ( ft_strcmp( (const char*)char_name, - (const char*)glyph_name ) == 0 ) - { - type1->encoding.char_index[charcode] = (FT_UShort)idx; - type1->encoding.char_name [charcode] = (char*)glyph_name; - - /* Change min/max encoded char only if glyph name is */ - /* not /.notdef */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)glyph_name ) != 0 ) - { - if ( charcode < min_char ) - min_char = charcode; - if ( charcode > max_char ) - max_char = charcode; - } - break; - } - } - } - type1->encoding.code_first = min_char; - type1->encoding.code_last = max_char; - type1->encoding.num_chars = loader.num_chars; - } - - Exit: - t42_loader_done( &loader ); - return error; - } - - - /***************** Driver Functions *************/ - - - FT_LOCAL_DEF( FT_Error ) - T42_Face_Init( FT_Stream stream, - T42_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - FT_Error error; - FT_Service_PsCMaps psnames; - PSAux_Service psaux; - FT_Face root = (FT_Face)&face->root; - T1_Font type1 = &face->type1; - PS_FontInfo info = &type1->font_info; - - FT_UNUSED( num_params ); - FT_UNUSED( params ); - FT_UNUSED( face_index ); - FT_UNUSED( stream ); - - - face->ttf_face = NULL; - face->root.num_faces = 1; - - FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); - face->psnames = psnames; - - face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), - "psaux" ); - psaux = (PSAux_Service)face->psaux; - - /* open the tokenizer, this will also check the font format */ - error = T42_Open_Face( face ); - if ( error ) - goto Exit; - - /* if we just wanted to check the format, leave successfully now */ - if ( face_index < 0 ) - goto Exit; - - /* check the face index */ - if ( face_index != 0 ) - { - FT_ERROR(( "T42_Face_Init: invalid face index\n" )); - error = T42_Err_Invalid_Argument; - goto Exit; - } - - /* Now load the font program into the face object */ - - /* Init the face object fields */ - /* Now set up root face fields */ - - root->num_glyphs = type1->num_glyphs; - root->num_charmaps = 0; - root->face_index = face_index; - - root->face_flags = FT_FACE_FLAG_SCALABLE | - FT_FACE_FLAG_HORIZONTAL | - FT_FACE_FLAG_GLYPH_NAMES; - - if ( info->is_fixed_pitch ) - root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; - - /* We only set this flag if we have the patented bytecode interpreter. */ - /* There are no known `tricky' Type42 fonts that could be loaded with */ - /* the unpatented interpreter. */ -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - root->face_flags |= FT_FACE_FLAG_HINTER; -#endif - - /* XXX: TODO -- add kerning with .afm support */ - - /* get style name -- be careful, some broken fonts only */ - /* have a `/FontName' dictionary entry! */ - root->family_name = info->family_name; - /* assume "Regular" style if we don't know better */ - root->style_name = (char *)"Regular"; - if ( root->family_name ) - { - char* full = info->full_name; - char* family = root->family_name; - - - if ( full ) - { - while ( *full ) - { - if ( *full == *family ) - { - family++; - full++; - } - else - { - if ( *full == ' ' || *full == '-' ) - full++; - else if ( *family == ' ' || *family == '-' ) - family++; - else - { - if ( !*family ) - root->style_name = full; - break; - } - } - } - } - } - else - { - /* do we have a `/FontName'? */ - if ( type1->font_name ) - root->family_name = type1->font_name; - } - - /* no embedded bitmap support */ - root->num_fixed_sizes = 0; - root->available_sizes = 0; - - /* Load the TTF font embedded in the T42 font */ - { - FT_Open_Args args; - - - args.flags = FT_OPEN_MEMORY; - args.memory_base = face->ttf_data; - args.memory_size = face->ttf_size; - - if ( num_params ) - { - args.flags |= FT_OPEN_PARAMS; - args.num_params = num_params; - args.params = params; - } - - error = FT_Open_Face( FT_FACE_LIBRARY( face ), - &args, 0, &face->ttf_face ); - } - - if ( error ) - goto Exit; - - FT_Done_Size( face->ttf_face->size ); - - /* Ignore info in FontInfo dictionary and use the info from the */ - /* loaded TTF font. The PostScript interpreter also ignores it. */ - root->bbox = face->ttf_face->bbox; - root->units_per_EM = face->ttf_face->units_per_EM; - - root->ascender = face->ttf_face->ascender; - root->descender = face->ttf_face->descender; - root->height = face->ttf_face->height; - - root->max_advance_width = face->ttf_face->max_advance_width; - root->max_advance_height = face->ttf_face->max_advance_height; - - root->underline_position = (FT_Short)info->underline_position; - root->underline_thickness = (FT_Short)info->underline_thickness; - - /* compute style flags */ - root->style_flags = 0; - if ( info->italic_angle ) - root->style_flags |= FT_STYLE_FLAG_ITALIC; - - if ( face->ttf_face->style_flags & FT_STYLE_FLAG_BOLD ) - root->style_flags |= FT_STYLE_FLAG_BOLD; - - if ( face->ttf_face->face_flags & FT_FACE_FLAG_VERTICAL ) - root->face_flags |= FT_FACE_FLAG_VERTICAL; - - { - if ( psnames && psaux ) - { - FT_CharMapRec charmap; - T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes; - FT_CMap_Class clazz; - - - charmap.face = root; - - /* first of all, try to synthetize a Unicode charmap */ - charmap.platform_id = 3; - charmap.encoding_id = 1; - charmap.encoding = FT_ENCODING_UNICODE; - - FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); - - /* now, generate an Adobe Standard encoding when appropriate */ - charmap.platform_id = 7; - clazz = NULL; - - switch ( type1->encoding_type ) - { - case T1_ENCODING_TYPE_STANDARD: - charmap.encoding = FT_ENCODING_ADOBE_STANDARD; - charmap.encoding_id = 0; - clazz = cmap_classes->standard; - break; - - case T1_ENCODING_TYPE_EXPERT: - charmap.encoding = FT_ENCODING_ADOBE_EXPERT; - charmap.encoding_id = 1; - clazz = cmap_classes->expert; - break; - - case T1_ENCODING_TYPE_ARRAY: - charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; - charmap.encoding_id = 2; - clazz = cmap_classes->custom; - break; - - case T1_ENCODING_TYPE_ISOLATIN1: - charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; - charmap.encoding_id = 3; - clazz = cmap_classes->unicode; - break; - - default: - ; - } - - if ( clazz ) - FT_CMap_New( clazz, NULL, &charmap, NULL ); - -#if 0 - /* Select default charmap */ - if ( root->num_charmaps ) - root->charmap = root->charmaps[0]; -#endif - } - } - Exit: - return error; - } - - - FT_LOCAL_DEF( void ) - T42_Face_Done( T42_Face face ) - { - T1_Font type1; - PS_FontInfo info; - FT_Memory memory; - - - if ( face ) - { - type1 = &face->type1; - info = &type1->font_info; - memory = face->root.memory; - - /* delete internal ttf face prior to freeing face->ttf_data */ - if ( face->ttf_face ) - FT_Done_Face( face->ttf_face ); - - /* release font info strings */ - FT_FREE( info->version ); - FT_FREE( info->notice ); - FT_FREE( info->full_name ); - FT_FREE( info->family_name ); - FT_FREE( info->weight ); - - /* release top dictionary */ - FT_FREE( type1->charstrings_len ); - FT_FREE( type1->charstrings ); - FT_FREE( type1->glyph_names ); - - FT_FREE( type1->charstrings_block ); - FT_FREE( type1->glyph_names_block ); - - FT_FREE( type1->encoding.char_index ); - FT_FREE( type1->encoding.char_name ); - FT_FREE( type1->font_name ); - - FT_FREE( face->ttf_data ); - -#if 0 - /* release afm data if present */ - if ( face->afm_data ) - T1_Done_AFM( memory, (T1_AFM*)face->afm_data ); -#endif - - /* release unicode map, if any */ - FT_FREE( face->unicode_map.maps ); - face->unicode_map.num_maps = 0; - - face->root.family_name = 0; - face->root.style_name = 0; - } - } - - - /*************************************************************************/ - /* */ - /* */ - /* T42_Driver_Init */ - /* */ - /* */ - /* Initializes a given Type 42 driver object. */ - /* */ - /* */ - /* driver :: A handle to the target driver object. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) - T42_Driver_Init( T42_Driver driver ) - { - FT_Module ttmodule; - - - ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" ); - driver->ttclazz = (FT_Driver_Class)ttmodule->clazz; - - return T42_Err_Ok; - } - - - FT_LOCAL_DEF( void ) - T42_Driver_Done( T42_Driver driver ) - { - FT_UNUSED( driver ); - } - - - FT_LOCAL_DEF( FT_Error ) - T42_Size_Init( T42_Size size ) - { - FT_Face face = size->root.face; - T42_Face t42face = (T42_Face)face; - FT_Size ttsize; - FT_Error error = T42_Err_Ok; - - - error = FT_New_Size( t42face->ttf_face, &ttsize ); - size->ttsize = ttsize; - - FT_Activate_Size( ttsize ); - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - T42_Size_Request( T42_Size size, - FT_Size_Request req ) - { - T42_Face face = (T42_Face)size->root.face; - FT_Error error; - - - FT_Activate_Size( size->ttsize ); - - error = FT_Request_Size( face->ttf_face, req ); - if ( !error ) - ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; - - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - T42_Size_Select( T42_Size size, - FT_ULong strike_index ) - { - T42_Face face = (T42_Face)size->root.face; - FT_Error error; - - - FT_Activate_Size( size->ttsize ); - - error = FT_Select_Size( face->ttf_face, strike_index ); - if ( !error ) - ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; - - return error; - - } - - - FT_LOCAL_DEF( void ) - T42_Size_Done( T42_Size size ) - { - FT_Face face = size->root.face; - T42_Face t42face = (T42_Face)face; - FT_ListNode node; - - - node = FT_List_Find( &t42face->ttf_face->sizes_list, size->ttsize ); - if ( node ) - { - FT_Done_Size( size->ttsize ); - size->ttsize = NULL; - } - } - - - FT_LOCAL_DEF( FT_Error ) - T42_GlyphSlot_Init( T42_GlyphSlot slot ) - { - FT_Face face = slot->root.face; - T42_Face t42face = (T42_Face)face; - FT_GlyphSlot ttslot; - FT_Error error = T42_Err_Ok; - - - if ( face->glyph == NULL ) - { - /* First glyph slot for this face */ - slot->ttslot = t42face->ttf_face->glyph; - } - else - { - error = FT_New_GlyphSlot( t42face->ttf_face, &ttslot ); - slot->ttslot = ttslot; - } - - return error; - } - - - FT_LOCAL_DEF( void ) - T42_GlyphSlot_Done( T42_GlyphSlot slot ) - { - FT_Done_GlyphSlot( slot->ttslot ); - } - - - static void - t42_glyphslot_clear( FT_GlyphSlot slot ) - { - /* free bitmap if needed */ - ft_glyphslot_free_bitmap( slot ); - - /* clear all public fields in the glyph slot */ - FT_ZERO( &slot->metrics ); - FT_ZERO( &slot->outline ); - FT_ZERO( &slot->bitmap ); - - slot->bitmap_left = 0; - slot->bitmap_top = 0; - slot->num_subglyphs = 0; - slot->subglyphs = 0; - slot->control_data = 0; - slot->control_len = 0; - slot->other = 0; - slot->format = FT_GLYPH_FORMAT_NONE; - - slot->linearHoriAdvance = 0; - slot->linearVertAdvance = 0; - } - - - FT_LOCAL_DEF( FT_Error ) - T42_GlyphSlot_Load( FT_GlyphSlot glyph, - FT_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - FT_Error error; - T42_GlyphSlot t42slot = (T42_GlyphSlot)glyph; - T42_Size t42size = (T42_Size)size; - FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz; - - - t42_glyphslot_clear( t42slot->ttslot ); - error = ttclazz->load_glyph( t42slot->ttslot, - t42size->ttsize, - glyph_index, - load_flags | FT_LOAD_NO_BITMAP ); - - if ( !error ) - { - glyph->metrics = t42slot->ttslot->metrics; - - glyph->linearHoriAdvance = t42slot->ttslot->linearHoriAdvance; - glyph->linearVertAdvance = t42slot->ttslot->linearVertAdvance; - - glyph->format = t42slot->ttslot->format; - glyph->outline = t42slot->ttslot->outline; - - glyph->bitmap = t42slot->ttslot->bitmap; - glyph->bitmap_left = t42slot->ttslot->bitmap_left; - glyph->bitmap_top = t42slot->ttslot->bitmap_top; - - glyph->num_subglyphs = t42slot->ttslot->num_subglyphs; - glyph->subglyphs = t42slot->ttslot->subglyphs; - - glyph->control_data = t42slot->ttslot->control_data; - glyph->control_len = t42slot->ttslot->control_len; - } - - return error; - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t42objs.c */ +/* */ +/* Type 42 objects manager (body). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by Roberto Alameda. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "t42objs.h" +#include "t42parse.h" +#include "t42error.h" +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_LIST_H + + +#undef FT_COMPONENT +#define FT_COMPONENT trace_t42 + + + static FT_Error + T42_Open_Face( T42_Face face ) + { + T42_LoaderRec loader; + T42_Parser parser; + T1_Font type1 = &face->type1; + FT_Memory memory = face->root.memory; + FT_Error error; + + PSAux_Service psaux = (PSAux_Service)face->psaux; + + + t42_loader_init( &loader, face ); + + parser = &loader.parser; + + if ( FT_ALLOC( face->ttf_data, 12 ) ) + goto Exit; + + error = t42_parser_init( parser, + face->root.stream, + memory, + psaux); + if ( error ) + goto Exit; + + error = t42_parse_dict( face, &loader, + parser->base_dict, parser->base_len ); + if ( error ) + goto Exit; + + if ( type1->font_type != 42 ) + { + error = T42_Err_Unknown_File_Format; + goto Exit; + } + + /* now, propagate the charstrings and glyphnames tables */ + /* to the Type1 data */ + type1->num_glyphs = loader.num_glyphs; + + if ( !loader.charstrings.init ) + { + FT_ERROR(( "T42_Open_Face: no charstrings array in face!\n" )); + error = T42_Err_Invalid_File_Format; + } + + loader.charstrings.init = 0; + type1->charstrings_block = loader.charstrings.block; + type1->charstrings = loader.charstrings.elements; + type1->charstrings_len = loader.charstrings.lengths; + + /* we copy the glyph names `block' and `elements' fields; */ + /* the `lengths' field must be released later */ + type1->glyph_names_block = loader.glyph_names.block; + type1->glyph_names = (FT_String**)loader.glyph_names.elements; + loader.glyph_names.block = 0; + loader.glyph_names.elements = 0; + + /* we must now build type1.encoding when we have a custom array */ + if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) + { + FT_Int charcode, idx, min_char, max_char; + FT_Byte* char_name; + FT_Byte* glyph_name; + + + /* OK, we do the following: for each element in the encoding */ + /* table, look up the index of the glyph having the same name */ + /* as defined in the CharStrings array. */ + /* The index is then stored in type1.encoding.char_index, and */ + /* the name in type1.encoding.char_name */ + + min_char = +32000; + max_char = -32000; + + charcode = 0; + for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) + { + type1->encoding.char_index[charcode] = 0; + type1->encoding.char_name [charcode] = (char *)".notdef"; + + char_name = loader.encoding_table.elements[charcode]; + if ( char_name ) + for ( idx = 0; idx < type1->num_glyphs; idx++ ) + { + glyph_name = (FT_Byte*)type1->glyph_names[idx]; + if ( ft_strcmp( (const char*)char_name, + (const char*)glyph_name ) == 0 ) + { + type1->encoding.char_index[charcode] = (FT_UShort)idx; + type1->encoding.char_name [charcode] = (char*)glyph_name; + + /* Change min/max encoded char only if glyph name is */ + /* not /.notdef */ + if ( ft_strcmp( (const char*)".notdef", + (const char*)glyph_name ) != 0 ) + { + if ( charcode < min_char ) + min_char = charcode; + if ( charcode > max_char ) + max_char = charcode; + } + break; + } + } + } + type1->encoding.code_first = min_char; + type1->encoding.code_last = max_char; + type1->encoding.num_chars = loader.num_chars; + } + + Exit: + t42_loader_done( &loader ); + return error; + } + + + /***************** Driver Functions *************/ + + + FT_LOCAL_DEF( FT_Error ) + T42_Face_Init( FT_Stream stream, + T42_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error; + FT_Service_PsCMaps psnames; + PSAux_Service psaux; + FT_Face root = (FT_Face)&face->root; + T1_Font type1 = &face->type1; + PS_FontInfo info = &type1->font_info; + + FT_UNUSED( num_params ); + FT_UNUSED( params ); + FT_UNUSED( face_index ); + FT_UNUSED( stream ); + + + face->ttf_face = NULL; + face->root.num_faces = 1; + + FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); + face->psnames = psnames; + + face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), + "psaux" ); + psaux = (PSAux_Service)face->psaux; + + /* open the tokenizer, this will also check the font format */ + error = T42_Open_Face( face ); + if ( error ) + goto Exit; + + /* if we just wanted to check the format, leave successfully now */ + if ( face_index < 0 ) + goto Exit; + + /* check the face index */ + if ( face_index != 0 ) + { + FT_ERROR(( "T42_Face_Init: invalid face index\n" )); + error = T42_Err_Invalid_Argument; + goto Exit; + } + + /* Now load the font program into the face object */ + + /* Init the face object fields */ + /* Now set up root face fields */ + + root->num_glyphs = type1->num_glyphs; + root->num_charmaps = 0; + root->face_index = face_index; + + root->face_flags = FT_FACE_FLAG_SCALABLE | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_GLYPH_NAMES; + + if ( info->is_fixed_pitch ) + root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + + /* We only set this flag if we have the patented bytecode interpreter. */ + /* There are no known `tricky' Type42 fonts that could be loaded with */ + /* the unpatented interpreter. */ +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + root->face_flags |= FT_FACE_FLAG_HINTER; +#endif + + /* XXX: TODO -- add kerning with .afm support */ + + /* get style name -- be careful, some broken fonts only */ + /* have a `/FontName' dictionary entry! */ + root->family_name = info->family_name; + /* assume "Regular" style if we don't know better */ + root->style_name = (char *)"Regular"; + if ( root->family_name ) + { + char* full = info->full_name; + char* family = root->family_name; + + + if ( full ) + { + while ( *full ) + { + if ( *full == *family ) + { + family++; + full++; + } + else + { + if ( *full == ' ' || *full == '-' ) + full++; + else if ( *family == ' ' || *family == '-' ) + family++; + else + { + if ( !*family ) + root->style_name = full; + break; + } + } + } + } + } + else + { + /* do we have a `/FontName'? */ + if ( type1->font_name ) + root->family_name = type1->font_name; + } + + /* no embedded bitmap support */ + root->num_fixed_sizes = 0; + root->available_sizes = 0; + + /* Load the TTF font embedded in the T42 font */ + { + FT_Open_Args args; + + + args.flags = FT_OPEN_MEMORY; + args.memory_base = face->ttf_data; + args.memory_size = face->ttf_size; + + if ( num_params ) + { + args.flags |= FT_OPEN_PARAMS; + args.num_params = num_params; + args.params = params; + } + + error = FT_Open_Face( FT_FACE_LIBRARY( face ), + &args, 0, &face->ttf_face ); + } + + if ( error ) + goto Exit; + + FT_Done_Size( face->ttf_face->size ); + + /* Ignore info in FontInfo dictionary and use the info from the */ + /* loaded TTF font. The PostScript interpreter also ignores it. */ + root->bbox = face->ttf_face->bbox; + root->units_per_EM = face->ttf_face->units_per_EM; + + root->ascender = face->ttf_face->ascender; + root->descender = face->ttf_face->descender; + root->height = face->ttf_face->height; + + root->max_advance_width = face->ttf_face->max_advance_width; + root->max_advance_height = face->ttf_face->max_advance_height; + + root->underline_position = (FT_Short)info->underline_position; + root->underline_thickness = (FT_Short)info->underline_thickness; + + /* compute style flags */ + root->style_flags = 0; + if ( info->italic_angle ) + root->style_flags |= FT_STYLE_FLAG_ITALIC; + + if ( face->ttf_face->style_flags & FT_STYLE_FLAG_BOLD ) + root->style_flags |= FT_STYLE_FLAG_BOLD; + + if ( face->ttf_face->face_flags & FT_FACE_FLAG_VERTICAL ) + root->face_flags |= FT_FACE_FLAG_VERTICAL; + + { + if ( psnames && psaux ) + { + FT_CharMapRec charmap; + T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes; + FT_CMap_Class clazz; + + + charmap.face = root; + + /* first of all, try to synthetize a Unicode charmap */ + charmap.platform_id = 3; + charmap.encoding_id = 1; + charmap.encoding = FT_ENCODING_UNICODE; + + FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); + + /* now, generate an Adobe Standard encoding when appropriate */ + charmap.platform_id = 7; + clazz = NULL; + + switch ( type1->encoding_type ) + { + case T1_ENCODING_TYPE_STANDARD: + charmap.encoding = FT_ENCODING_ADOBE_STANDARD; + charmap.encoding_id = 0; + clazz = cmap_classes->standard; + break; + + case T1_ENCODING_TYPE_EXPERT: + charmap.encoding = FT_ENCODING_ADOBE_EXPERT; + charmap.encoding_id = 1; + clazz = cmap_classes->expert; + break; + + case T1_ENCODING_TYPE_ARRAY: + charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; + charmap.encoding_id = 2; + clazz = cmap_classes->custom; + break; + + case T1_ENCODING_TYPE_ISOLATIN1: + charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; + charmap.encoding_id = 3; + clazz = cmap_classes->unicode; + break; + + default: + ; + } + + if ( clazz ) + FT_CMap_New( clazz, NULL, &charmap, NULL ); + +#if 0 + /* Select default charmap */ + if ( root->num_charmaps ) + root->charmap = root->charmaps[0]; +#endif + } + } + Exit: + return error; + } + + + FT_LOCAL_DEF( void ) + T42_Face_Done( T42_Face face ) + { + T1_Font type1; + PS_FontInfo info; + FT_Memory memory; + + + if ( face ) + { + type1 = &face->type1; + info = &type1->font_info; + memory = face->root.memory; + + /* delete internal ttf face prior to freeing face->ttf_data */ + if ( face->ttf_face ) + FT_Done_Face( face->ttf_face ); + + /* release font info strings */ + FT_FREE( info->version ); + FT_FREE( info->notice ); + FT_FREE( info->full_name ); + FT_FREE( info->family_name ); + FT_FREE( info->weight ); + + /* release top dictionary */ + FT_FREE( type1->charstrings_len ); + FT_FREE( type1->charstrings ); + FT_FREE( type1->glyph_names ); + + FT_FREE( type1->charstrings_block ); + FT_FREE( type1->glyph_names_block ); + + FT_FREE( type1->encoding.char_index ); + FT_FREE( type1->encoding.char_name ); + FT_FREE( type1->font_name ); + + FT_FREE( face->ttf_data ); + +#if 0 + /* release afm data if present */ + if ( face->afm_data ) + T1_Done_AFM( memory, (T1_AFM*)face->afm_data ); +#endif + + /* release unicode map, if any */ + FT_FREE( face->unicode_map.maps ); + face->unicode_map.num_maps = 0; + + face->root.family_name = 0; + face->root.style_name = 0; + } + } + + + /*************************************************************************/ + /* */ + /* */ + /* T42_Driver_Init */ + /* */ + /* */ + /* Initializes a given Type 42 driver object. */ + /* */ + /* */ + /* driver :: A handle to the target driver object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF( FT_Error ) + T42_Driver_Init( T42_Driver driver ) + { + FT_Module ttmodule; + + + ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" ); + driver->ttclazz = (FT_Driver_Class)ttmodule->clazz; + + return T42_Err_Ok; + } + + + FT_LOCAL_DEF( void ) + T42_Driver_Done( T42_Driver driver ) + { + FT_UNUSED( driver ); + } + + + FT_LOCAL_DEF( FT_Error ) + T42_Size_Init( T42_Size size ) + { + FT_Face face = size->root.face; + T42_Face t42face = (T42_Face)face; + FT_Size ttsize; + FT_Error error = T42_Err_Ok; + + + error = FT_New_Size( t42face->ttf_face, &ttsize ); + size->ttsize = ttsize; + + FT_Activate_Size( ttsize ); + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + T42_Size_Request( T42_Size size, + FT_Size_Request req ) + { + T42_Face face = (T42_Face)size->root.face; + FT_Error error; + + + FT_Activate_Size( size->ttsize ); + + error = FT_Request_Size( face->ttf_face, req ); + if ( !error ) + ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; + + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + T42_Size_Select( T42_Size size, + FT_ULong strike_index ) + { + T42_Face face = (T42_Face)size->root.face; + FT_Error error; + + + FT_Activate_Size( size->ttsize ); + + error = FT_Select_Size( face->ttf_face, strike_index ); + if ( !error ) + ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; + + return error; + + } + + + FT_LOCAL_DEF( void ) + T42_Size_Done( T42_Size size ) + { + FT_Face face = size->root.face; + T42_Face t42face = (T42_Face)face; + FT_ListNode node; + + + node = FT_List_Find( &t42face->ttf_face->sizes_list, size->ttsize ); + if ( node ) + { + FT_Done_Size( size->ttsize ); + size->ttsize = NULL; + } + } + + + FT_LOCAL_DEF( FT_Error ) + T42_GlyphSlot_Init( T42_GlyphSlot slot ) + { + FT_Face face = slot->root.face; + T42_Face t42face = (T42_Face)face; + FT_GlyphSlot ttslot; + FT_Error error = T42_Err_Ok; + + + if ( face->glyph == NULL ) + { + /* First glyph slot for this face */ + slot->ttslot = t42face->ttf_face->glyph; + } + else + { + error = FT_New_GlyphSlot( t42face->ttf_face, &ttslot ); + slot->ttslot = ttslot; + } + + return error; + } + + + FT_LOCAL_DEF( void ) + T42_GlyphSlot_Done( T42_GlyphSlot slot ) + { + FT_Done_GlyphSlot( slot->ttslot ); + } + + + static void + t42_glyphslot_clear( FT_GlyphSlot slot ) + { + /* free bitmap if needed */ + ft_glyphslot_free_bitmap( slot ); + + /* clear all public fields in the glyph slot */ + FT_ZERO( &slot->metrics ); + FT_ZERO( &slot->outline ); + FT_ZERO( &slot->bitmap ); + + slot->bitmap_left = 0; + slot->bitmap_top = 0; + slot->num_subglyphs = 0; + slot->subglyphs = 0; + slot->control_data = 0; + slot->control_len = 0; + slot->other = 0; + slot->format = FT_GLYPH_FORMAT_NONE; + + slot->linearHoriAdvance = 0; + slot->linearVertAdvance = 0; + } + + + FT_LOCAL_DEF( FT_Error ) + T42_GlyphSlot_Load( FT_GlyphSlot glyph, + FT_Size size, + FT_UInt glyph_index, + FT_Int32 load_flags ) + { + FT_Error error; + T42_GlyphSlot t42slot = (T42_GlyphSlot)glyph; + T42_Size t42size = (T42_Size)size; + FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz; + + + t42_glyphslot_clear( t42slot->ttslot ); + error = ttclazz->load_glyph( t42slot->ttslot, + t42size->ttsize, + glyph_index, + load_flags | FT_LOAD_NO_BITMAP ); + + if ( !error ) + { + glyph->metrics = t42slot->ttslot->metrics; + + glyph->linearHoriAdvance = t42slot->ttslot->linearHoriAdvance; + glyph->linearVertAdvance = t42slot->ttslot->linearVertAdvance; + + glyph->format = t42slot->ttslot->format; + glyph->outline = t42slot->ttslot->outline; + + glyph->bitmap = t42slot->ttslot->bitmap; + glyph->bitmap_left = t42slot->ttslot->bitmap_left; + glyph->bitmap_top = t42slot->ttslot->bitmap_top; + + glyph->num_subglyphs = t42slot->ttslot->num_subglyphs; + glyph->subglyphs = t42slot->ttslot->subglyphs; + + glyph->control_data = t42slot->ttslot->control_data; + glyph->control_len = t42slot->ttslot->control_len; + } + + return error; + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42objs.h b/reactos/dll/3rdparty/freetype/src/type42/t42objs.h index 289dedcc69b..3420361282f 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42objs.h +++ b/reactos/dll/3rdparty/freetype/src/type42/t42objs.h @@ -1,124 +1,124 @@ -/***************************************************************************/ -/* */ -/* t42objs.h */ -/* */ -/* Type 42 objects manager (specification). */ -/* */ -/* Copyright 2002, 2003, 2006, 2007 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T42OBJS_H__ -#define __T42OBJS_H__ - -#include -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_TYPE1_TYPES_H -#include "t42types.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DRIVER_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H - - -FT_BEGIN_HEADER - - - /* Type42 size */ - typedef struct T42_SizeRec_ - { - FT_SizeRec root; - FT_Size ttsize; - - } T42_SizeRec, *T42_Size; - - - /* Type42 slot */ - typedef struct T42_GlyphSlotRec_ - { - FT_GlyphSlotRec root; - FT_GlyphSlot ttslot; - - } T42_GlyphSlotRec, *T42_GlyphSlot; - - - /* Type 42 driver */ - typedef struct T42_DriverRec_ - { - FT_DriverRec root; - FT_Driver_Class ttclazz; - void* extension_component; - - } T42_DriverRec, *T42_Driver; - - - /* */ - - - FT_LOCAL( FT_Error ) - T42_Face_Init( FT_Stream stream, - T42_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ); - - - FT_LOCAL( void ) - T42_Face_Done( T42_Face face ); - - - FT_LOCAL( FT_Error ) - T42_Size_Init( T42_Size size ); - - - FT_LOCAL( FT_Error ) - T42_Size_Request( T42_Size size, - FT_Size_Request req ); - - - FT_LOCAL( FT_Error ) - T42_Size_Select( T42_Size size, - FT_ULong strike_index ); - - - FT_LOCAL( void ) - T42_Size_Done( T42_Size size ); - - - FT_LOCAL( FT_Error ) - T42_GlyphSlot_Init( T42_GlyphSlot slot ); - - - FT_LOCAL( FT_Error ) - T42_GlyphSlot_Load( FT_GlyphSlot glyph, - FT_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ); - - FT_LOCAL( void ) - T42_GlyphSlot_Done( T42_GlyphSlot slot ); - - - FT_LOCAL( FT_Error ) - T42_Driver_Init( T42_Driver driver ); - - FT_LOCAL( void ) - T42_Driver_Done( T42_Driver driver ); - - /* */ - -FT_END_HEADER - - -#endif /* __T42OBJS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t42objs.h */ +/* */ +/* Type 42 objects manager (specification). */ +/* */ +/* Copyright 2002, 2003, 2006, 2007 by Roberto Alameda. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T42OBJS_H__ +#define __T42OBJS_H__ + +#include +#include FT_FREETYPE_H +#include FT_TYPE1_TABLES_H +#include FT_INTERNAL_TYPE1_TYPES_H +#include "t42types.h" +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DRIVER_H +#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include FT_INTERNAL_POSTSCRIPT_HINTS_H + + +FT_BEGIN_HEADER + + + /* Type42 size */ + typedef struct T42_SizeRec_ + { + FT_SizeRec root; + FT_Size ttsize; + + } T42_SizeRec, *T42_Size; + + + /* Type42 slot */ + typedef struct T42_GlyphSlotRec_ + { + FT_GlyphSlotRec root; + FT_GlyphSlot ttslot; + + } T42_GlyphSlotRec, *T42_GlyphSlot; + + + /* Type 42 driver */ + typedef struct T42_DriverRec_ + { + FT_DriverRec root; + FT_Driver_Class ttclazz; + void* extension_component; + + } T42_DriverRec, *T42_Driver; + + + /* */ + + + FT_LOCAL( FT_Error ) + T42_Face_Init( FT_Stream stream, + T42_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); + + + FT_LOCAL( void ) + T42_Face_Done( T42_Face face ); + + + FT_LOCAL( FT_Error ) + T42_Size_Init( T42_Size size ); + + + FT_LOCAL( FT_Error ) + T42_Size_Request( T42_Size size, + FT_Size_Request req ); + + + FT_LOCAL( FT_Error ) + T42_Size_Select( T42_Size size, + FT_ULong strike_index ); + + + FT_LOCAL( void ) + T42_Size_Done( T42_Size size ); + + + FT_LOCAL( FT_Error ) + T42_GlyphSlot_Init( T42_GlyphSlot slot ); + + + FT_LOCAL( FT_Error ) + T42_GlyphSlot_Load( FT_GlyphSlot glyph, + FT_Size size, + FT_UInt glyph_index, + FT_Int32 load_flags ); + + FT_LOCAL( void ) + T42_GlyphSlot_Done( T42_GlyphSlot slot ); + + + FT_LOCAL( FT_Error ) + T42_Driver_Init( T42_Driver driver ); + + FT_LOCAL( void ) + T42_Driver_Done( T42_Driver driver ); + + /* */ + +FT_END_HEADER + + +#endif /* __T42OBJS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42parse.c b/reactos/dll/3rdparty/freetype/src/type42/t42parse.c index 7148379644f..23d798286c4 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42parse.c +++ b/reactos/dll/3rdparty/freetype/src/type42/t42parse.c @@ -1,1167 +1,1167 @@ -/***************************************************************************/ -/* */ -/* t42parse.c */ -/* */ -/* Type 42 font parser (body). */ -/* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include "t42parse.h" -#include "t42error.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_LIST_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H - - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_t42 - - - static void - t42_parse_font_matrix( T42_Face face, - T42_Loader loader ); - static void - t42_parse_encoding( T42_Face face, - T42_Loader loader ); - - static void - t42_parse_charstrings( T42_Face face, - T42_Loader loader ); - - static void - t42_parse_sfnts( T42_Face face, - T42_Loader loader ); - - - /* as Type42 fonts have no Private dict, */ - /* we set the last argument of T1_FIELD_XXX to 0 */ - static const - T1_FieldRec t42_keywords[] = { - -#undef FT_STRUCTURE -#define FT_STRUCTURE T1_FontInfo -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_FONT_INFO - - T1_FIELD_STRING( "version", version, 0 ) - T1_FIELD_STRING( "Notice", notice, 0 ) - T1_FIELD_STRING( "FullName", full_name, 0 ) - T1_FIELD_STRING( "FamilyName", family_name, 0 ) - T1_FIELD_STRING( "Weight", weight, 0 ) - T1_FIELD_NUM ( "ItalicAngle", italic_angle, 0 ) - T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 ) - T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 ) - T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 ) - -#undef FT_STRUCTURE -#define FT_STRUCTURE T1_FontRec -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_FONT_DICT - - T1_FIELD_KEY ( "FontName", font_name, 0 ) - T1_FIELD_NUM ( "PaintType", paint_type, 0 ) - T1_FIELD_NUM ( "FontType", font_type, 0 ) - T1_FIELD_FIXED( "StrokeWidth", stroke_width, 0 ) - -#undef FT_STRUCTURE -#define FT_STRUCTURE FT_BBox -#undef T1CODE -#define T1CODE T1_FIELD_LOCATION_BBOX - - T1_FIELD_BBOX("FontBBox", xMin, 0 ) - - T1_FIELD_CALLBACK( "FontMatrix", t42_parse_font_matrix, 0 ) - T1_FIELD_CALLBACK( "Encoding", t42_parse_encoding, 0 ) - T1_FIELD_CALLBACK( "CharStrings", t42_parse_charstrings, 0 ) - T1_FIELD_CALLBACK( "sfnts", t42_parse_sfnts, 0 ) - - { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 } - }; - - -#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l ) -#define T1_Done_Table( p ) \ - do \ - { \ - if ( (p)->funcs.done ) \ - (p)->funcs.done( p ); \ - } while ( 0 ) -#define T1_Release_Table( p ) \ - do \ - { \ - if ( (p)->funcs.release ) \ - (p)->funcs.release( p ); \ - } while ( 0 ) - -#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) -#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root ) - -#define T1_ToInt( p ) \ - (p)->root.funcs.to_int( &(p)->root ) -#define T1_ToBytes( p, b, m, n, d ) \ - (p)->root.funcs.to_bytes( &(p)->root, b, m, n, d ) - -#define T1_ToFixedArray( p, m, f, t ) \ - (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) -#define T1_ToToken( p, t ) \ - (p)->root.funcs.to_token( &(p)->root, t ) - -#define T1_Load_Field( p, f, o, m, pf ) \ - (p)->root.funcs.load_field( &(p)->root, f, o, m, pf ) -#define T1_Load_Field_Table( p, f, o, m, pf ) \ - (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf ) - - - /********************* Parsing Functions ******************/ - - FT_LOCAL_DEF( FT_Error ) - t42_parser_init( T42_Parser parser, - FT_Stream stream, - FT_Memory memory, - PSAux_Service psaux ) - { - FT_Error error = T42_Err_Ok; - FT_Long size; - - - psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory ); - - parser->stream = stream; - parser->base_len = 0; - parser->base_dict = 0; - parser->in_memory = 0; - - /*******************************************************************/ - /* */ - /* Here a short summary of what is going on: */ - /* */ - /* When creating a new Type 42 parser, we try to locate and load */ - /* the base dictionary, loading the whole font into memory. */ - /* */ - /* When `loading' the base dictionary, we only set up pointers */ - /* in the case of a memory-based stream. Otherwise, we allocate */ - /* and load the base dictionary in it. */ - /* */ - /* parser->in_memory is set if we have a memory stream. */ - /* */ - - if ( FT_STREAM_SEEK( 0L ) || - FT_FRAME_ENTER( 17 ) ) - goto Exit; - - if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 ) - { - FT_TRACE2(( "not a Type42 font\n" )); - error = T42_Err_Unknown_File_Format; - } - - FT_FRAME_EXIT(); - - if ( error || FT_STREAM_SEEK( 0 ) ) - goto Exit; - - size = stream->size; - - /* now, try to load `size' bytes of the `base' dictionary we */ - /* found previously */ - - /* if it is a memory-based resource, set up pointers */ - if ( !stream->read ) - { - parser->base_dict = (FT_Byte*)stream->base + stream->pos; - parser->base_len = size; - parser->in_memory = 1; - - /* check that the `size' field is valid */ - if ( FT_STREAM_SKIP( size ) ) - goto Exit; - } - else - { - /* read segment in memory */ - if ( FT_ALLOC( parser->base_dict, size ) || - FT_STREAM_READ( parser->base_dict, size ) ) - goto Exit; - - parser->base_len = size; - } - - parser->root.base = parser->base_dict; - parser->root.cursor = parser->base_dict; - parser->root.limit = parser->root.cursor + parser->base_len; - - Exit: - if ( error && !parser->in_memory ) - FT_FREE( parser->base_dict ); - - return error; - } - - - FT_LOCAL_DEF( void ) - t42_parser_done( T42_Parser parser ) - { - FT_Memory memory = parser->root.memory; - - - /* free the base dictionary only when we have a disk stream */ - if ( !parser->in_memory ) - FT_FREE( parser->base_dict ); - - parser->root.funcs.done( &parser->root ); - } - - - static int - t42_is_space( FT_Byte c ) - { - return ( c == ' ' || c == '\t' || - c == '\r' || c == '\n' || c == '\f' || - c == '\0' ); - } - - - static void - t42_parse_font_matrix( T42_Face face, - T42_Loader loader ) - { - T42_Parser parser = &loader->parser; - FT_Matrix* matrix = &face->type1.font_matrix; - FT_Vector* offset = &face->type1.font_offset; - FT_Face root = (FT_Face)&face->root; - FT_Fixed temp[6]; - FT_Fixed temp_scale; - - - (void)T1_ToFixedArray( parser, 6, temp, 3 ); - - temp_scale = FT_ABS( temp[3] ); - - /* Set Units per EM based on FontMatrix values. We set the value to */ - /* 1000 / temp_scale, because temp_scale was already multiplied by */ - /* 1000 (in t1_tofixed, from psobjs.c). */ - - root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L, - temp_scale ) >> 16 ); - - /* we need to scale the values by 1.0/temp_scale */ - if ( temp_scale != 0x10000L ) { - temp[0] = FT_DivFix( temp[0], temp_scale ); - temp[1] = FT_DivFix( temp[1], temp_scale ); - temp[2] = FT_DivFix( temp[2], temp_scale ); - temp[4] = FT_DivFix( temp[4], temp_scale ); - temp[5] = FT_DivFix( temp[5], temp_scale ); - temp[3] = 0x10000L; - } - - matrix->xx = temp[0]; - matrix->yx = temp[1]; - matrix->xy = temp[2]; - matrix->yy = temp[3]; - - /* note that the offsets must be expressed in integer font units */ - offset->x = temp[4] >> 16; - offset->y = temp[5] >> 16; - } - - - static void - t42_parse_encoding( T42_Face face, - T42_Loader loader ) - { - T42_Parser parser = &loader->parser; - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; - - PSAux_Service psaux = (PSAux_Service)face->psaux; - - - T1_Skip_Spaces( parser ); - cur = parser->root.cursor; - if ( cur >= limit ) - { - FT_ERROR(( "t42_parse_encoding: out of bounds!\n" )); - parser->root.error = T42_Err_Invalid_File_Format; - return; - } - - /* if we have a number or `[', the encoding is an array, */ - /* and we must load it now */ - if ( ft_isdigit( *cur ) || *cur == '[' ) - { - T1_Encoding encode = &face->type1.encoding; - FT_UInt count, n; - PS_Table char_table = &loader->encoding_table; - FT_Memory memory = parser->root.memory; - FT_Error error; - FT_Bool only_immediates = 0; - - - /* read the number of entries in the encoding; should be 256 */ - if ( *cur == '[' ) - { - count = 256; - only_immediates = 1; - parser->root.cursor++; - } - else - count = (FT_UInt)T1_ToInt( parser ); - - T1_Skip_Spaces( parser ); - if ( parser->root.cursor >= limit ) - return; - - /* we use a T1_Table to store our charnames */ - loader->num_chars = encode->num_chars = count; - if ( FT_NEW_ARRAY( encode->char_index, count ) || - FT_NEW_ARRAY( encode->char_name, count ) || - FT_SET_ERROR( psaux->ps_table_funcs->init( - char_table, count, memory ) ) ) - { - parser->root.error = error; - return; - } - - /* We need to `zero' out encoding_table.elements */ - for ( n = 0; n < count; n++ ) - { - char* notdef = (char *)".notdef"; - - - T1_Add_Table( char_table, n, notdef, 8 ); - } - - /* Now we need to read records of the form */ - /* */ - /* ... charcode /charname ... */ - /* */ - /* for each entry in our table. */ - /* */ - /* We simply look for a number followed by an immediate */ - /* name. Note that this ignores correctly the sequence */ - /* that is often seen in type42 fonts: */ - /* */ - /* 0 1 255 { 1 index exch /.notdef put } for dup */ - /* */ - /* used to clean the encoding array before anything else. */ - /* */ - /* Alternatively, if the array is directly given as */ - /* */ - /* /Encoding [ ... ] */ - /* */ - /* we only read immediates. */ - - n = 0; - T1_Skip_Spaces( parser ); - - while ( parser->root.cursor < limit ) - { - cur = parser->root.cursor; - - /* we stop when we encounter `def' or `]' */ - if ( *cur == 'd' && cur + 3 < limit ) - { - if ( cur[1] == 'e' && - cur[2] == 'f' && - t42_is_space( cur[3] ) ) - { - FT_TRACE6(( "encoding end\n" )); - cur += 3; - break; - } - } - if ( *cur == ']' ) - { - FT_TRACE6(( "encoding end\n" )); - cur++; - break; - } - - /* check whether we have found an entry */ - if ( ft_isdigit( *cur ) || only_immediates ) - { - FT_Int charcode; - - - if ( only_immediates ) - charcode = n; - else - { - charcode = (FT_Int)T1_ToInt( parser ); - T1_Skip_Spaces( parser ); - } - - cur = parser->root.cursor; - - if ( *cur == '/' && cur + 2 < limit && n < count ) - { - FT_PtrDist len; - - - cur++; - - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - - len = parser->root.cursor - cur; - - parser->root.error = T1_Add_Table( char_table, charcode, - cur, len + 1 ); - if ( parser->root.error ) - return; - char_table->elements[charcode][len] = '\0'; - - n++; - } - } - else - { - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - } - - T1_Skip_Spaces( parser ); - } - - face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; - parser->root.cursor = cur; - } - - /* Otherwise, we should have either `StandardEncoding', */ - /* `ExpertEncoding', or `ISOLatin1Encoding' */ - else - { - if ( cur + 17 < limit && - ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 ) - face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD; - - else if ( cur + 15 < limit && - ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 ) - face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT; - - else if ( cur + 18 < limit && - ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 ) - face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; - - else - { - FT_ERROR(( "t42_parse_encoding: invalid token!\n" )); - parser->root.error = T42_Err_Invalid_File_Format; - } - } - } - - - typedef enum - { - BEFORE_START, - BEFORE_TABLE_DIR, - OTHER_TABLES - - } T42_Load_Status; - - - static void - t42_parse_sfnts( T42_Face face, - T42_Loader loader ) - { - T42_Parser parser = &loader->parser; - FT_Memory memory = parser->root.memory; - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; - FT_Error error; - FT_Int num_tables = 0; - FT_ULong count, ttf_size = 0; - - FT_Long n, string_size, old_string_size, real_size; - FT_Byte* string_buf = NULL; - FT_Bool allocated = 0; - - T42_Load_Status status; - - - /* The format is */ - /* */ - /* /sfnts [ ... ] def */ - /* */ - /* or */ - /* */ - /* /sfnts [ */ - /* RD */ - /* RD */ - /* ... */ - /* ] def */ - /* */ - /* with exactly one space after the `RD' token. */ - - T1_Skip_Spaces( parser ); - - if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' ) - { - FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - T1_Skip_Spaces( parser ); - status = BEFORE_START; - string_size = 0; - old_string_size = 0; - count = 0; - - while ( parser->root.cursor < limit ) - { - cur = parser->root.cursor; - - if ( *cur == ']' ) - { - parser->root.cursor++; - goto Exit; - } - - else if ( *cur == '<' ) - { - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; - - /* don't include delimiters */ - string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 ); - if ( FT_REALLOC( string_buf, old_string_size, string_size ) ) - goto Fail; - - allocated = 1; - - parser->root.cursor = cur; - (void)T1_ToBytes( parser, string_buf, string_size, &real_size, 1 ); - old_string_size = string_size; - string_size = real_size; - } - - else if ( ft_isdigit( *cur ) ) - { - if ( allocated ) - { - FT_ERROR(( "t42_parse_sfnts: " - "can't handle mixed binary and hex strings!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - string_size = T1_ToInt( parser ); - - T1_Skip_PS_Token( parser ); /* `RD' */ - if ( parser->root.error ) - return; - - string_buf = parser->root.cursor + 1; /* one space after `RD' */ - - parser->root.cursor += string_size + 1; - if ( parser->root.cursor >= limit ) - { - FT_ERROR(( "t42_parse_sfnts: too many binary data!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - } - - if ( !string_buf ) - { - FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - /* A string can have a trailing zero byte for padding. Ignore it. */ - if ( string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) ) - string_size--; - - if ( !string_size ) - { - FT_ERROR(( "t42_parse_sfnts: invalid string!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - for ( n = 0; n < string_size; n++ ) - { - switch ( status ) - { - case BEFORE_START: - /* load offset table, 12 bytes */ - if ( count < 12 ) - { - face->ttf_data[count++] = string_buf[n]; - continue; - } - else - { - num_tables = 16 * face->ttf_data[4] + face->ttf_data[5]; - status = BEFORE_TABLE_DIR; - ttf_size = 12 + 16 * num_tables; - - if ( FT_REALLOC( face->ttf_data, 12, ttf_size ) ) - goto Fail; - } - /* fall through */ - - case BEFORE_TABLE_DIR: - /* the offset table is read; read the table directory */ - if ( count < ttf_size ) - { - face->ttf_data[count++] = string_buf[n]; - continue; - } - else - { - int i; - FT_ULong len; - - - for ( i = 0; i < num_tables; i++ ) - { - FT_Byte* p = face->ttf_data + 12 + 16 * i + 12; - - - len = FT_PEEK_ULONG( p ); - - /* Pad to a 4-byte boundary length */ - ttf_size += ( len + 3 ) & ~3; - } - - status = OTHER_TABLES; - face->ttf_size = ttf_size; - - /* there are no more than 256 tables, so no size check here */ - if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables, - ttf_size + 1 ) ) - goto Fail; - } - /* fall through */ - - case OTHER_TABLES: - /* all other tables are just copied */ - if ( count >= ttf_size ) - { - FT_ERROR(( "t42_parse_sfnts: too many binary data!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - face->ttf_data[count++] = string_buf[n]; - } - } - - T1_Skip_Spaces( parser ); - } - - /* if control reaches this point, the format was not valid */ - error = T42_Err_Invalid_File_Format; - - Fail: - parser->root.error = error; - - Exit: - if ( allocated ) - FT_FREE( string_buf ); - } - - - static void - t42_parse_charstrings( T42_Face face, - T42_Loader loader ) - { - T42_Parser parser = &loader->parser; - PS_Table code_table = &loader->charstrings; - PS_Table name_table = &loader->glyph_names; - PS_Table swap_table = &loader->swap_table; - FT_Memory memory = parser->root.memory; - FT_Error error; - - PSAux_Service psaux = (PSAux_Service)face->psaux; - - FT_Byte* cur; - FT_Byte* limit = parser->root.limit; - FT_UInt n; - FT_UInt notdef_index = 0; - FT_Byte notdef_found = 0; - - - T1_Skip_Spaces( parser ); - - if ( parser->root.cursor >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - if ( ft_isdigit( *parser->root.cursor ) ) - { - loader->num_glyphs = (FT_UInt)T1_ToInt( parser ); - if ( parser->root.error ) - return; - } - else if ( *parser->root.cursor == '<' ) - { - /* We have `<< ... >>'. Count the number of `/' in the dictionary */ - /* to get its size. */ - FT_UInt count = 0; - - - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - T1_Skip_Spaces( parser ); - cur = parser->root.cursor; - - while ( parser->root.cursor < limit ) - { - if ( *parser->root.cursor == '/' ) - count++; - else if ( *parser->root.cursor == '>' ) - { - loader->num_glyphs = count; - parser->root.cursor = cur; /* rewind */ - break; - } - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - T1_Skip_Spaces( parser ); - } - } - else - { - FT_ERROR(( "t42_parse_charstrings: invalid token!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - if ( parser->root.cursor >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - /* initialize tables */ - - error = psaux->ps_table_funcs->init( code_table, - loader->num_glyphs, - memory ); - if ( error ) - goto Fail; - - error = psaux->ps_table_funcs->init( name_table, - loader->num_glyphs, - memory ); - if ( error ) - goto Fail; - - /* Initialize table for swapping index notdef_index and */ - /* index 0 names and codes (if necessary). */ - - error = psaux->ps_table_funcs->init( swap_table, 4, memory ); - if ( error ) - goto Fail; - - n = 0; - - for (;;) - { - /* The format is simple: */ - /* `/glyphname' + index [+ def] */ - - T1_Skip_Spaces( parser ); - - cur = parser->root.cursor; - if ( cur >= limit ) - break; - - /* We stop when we find an `end' keyword or '>' */ - if ( *cur == 'e' && - cur + 3 < limit && - cur[1] == 'n' && - cur[2] == 'd' && - t42_is_space( cur[3] ) ) - break; - if ( *cur == '>' ) - break; - - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - return; - - if ( *cur == '/' ) - { - FT_PtrDist len; - - - if ( cur + 1 >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - cur++; /* skip `/' */ - len = parser->root.cursor - cur; - - error = T1_Add_Table( name_table, n, cur, len + 1 ); - if ( error ) - goto Fail; - - /* add a trailing zero to the name table */ - name_table->elements[n][len] = '\0'; - - /* record index of /.notdef */ - if ( *cur == '.' && - ft_strcmp( ".notdef", - (const char*)(name_table->elements[n]) ) == 0 ) - { - notdef_index = n; - notdef_found = 1; - } - - T1_Skip_Spaces( parser ); - - cur = parser->root.cursor; - - (void)T1_ToInt( parser ); - if ( parser->root.cursor >= limit ) - { - FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - len = parser->root.cursor - cur; - - error = T1_Add_Table( code_table, n, cur, len + 1 ); - if ( error ) - goto Fail; - - code_table->elements[n][len] = '\0'; - - n++; - if ( n >= loader->num_glyphs ) - break; - } - } - - loader->num_glyphs = n; - - if ( !notdef_found ) - { - FT_ERROR(( "t42_parse_charstrings: no /.notdef glyph!\n" )); - error = T42_Err_Invalid_File_Format; - goto Fail; - } - - /* if /.notdef does not occupy index 0, do our magic. */ - if ( ft_strcmp( (const char*)".notdef", - (const char*)name_table->elements[0] ) ) - { - /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ - /* name and code entries to swap_table. Then place notdef_index */ - /* name and code entries into swap_table. Then swap name and code */ - /* entries at indices notdef_index and 0 using values stored in */ - /* swap_table. */ - - /* Index 0 name */ - error = T1_Add_Table( swap_table, 0, - name_table->elements[0], - name_table->lengths [0] ); - if ( error ) - goto Fail; - - /* Index 0 code */ - error = T1_Add_Table( swap_table, 1, - code_table->elements[0], - code_table->lengths [0] ); - if ( error ) - goto Fail; - - /* Index notdef_index name */ - error = T1_Add_Table( swap_table, 2, - name_table->elements[notdef_index], - name_table->lengths [notdef_index] ); - if ( error ) - goto Fail; - - /* Index notdef_index code */ - error = T1_Add_Table( swap_table, 3, - code_table->elements[notdef_index], - code_table->lengths [notdef_index] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, notdef_index, - swap_table->elements[0], - swap_table->lengths [0] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, notdef_index, - swap_table->elements[1], - swap_table->lengths [1] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( name_table, 0, - swap_table->elements[2], - swap_table->lengths [2] ); - if ( error ) - goto Fail; - - error = T1_Add_Table( code_table, 0, - swap_table->elements[3], - swap_table->lengths [3] ); - if ( error ) - goto Fail; - - } - - return; - - Fail: - parser->root.error = error; - } - - - static FT_Error - t42_load_keyword( T42_Face face, - T42_Loader loader, - T1_Field field ) - { - FT_Error error; - void* dummy_object; - void** objects; - FT_UInt max_objects = 0; - - - /* if the keyword has a dedicated callback, call it */ - if ( field->type == T1_FIELD_TYPE_CALLBACK ) - { - field->reader( (FT_Face)face, loader ); - error = loader->parser.root.error; - goto Exit; - } - - /* now the keyword is either a simple field or a table of fields; */ - /* we are now going to take care of it */ - - switch ( field->location ) - { - case T1_FIELD_LOCATION_FONT_INFO: - dummy_object = &face->type1.font_info; - break; - - case T1_FIELD_LOCATION_BBOX: - dummy_object = &face->type1.font_bbox; - break; - - default: - dummy_object = &face->type1; - } - - objects = &dummy_object; - - if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY || - field->type == T1_FIELD_TYPE_FIXED_ARRAY ) - error = T1_Load_Field_Table( &loader->parser, field, - objects, max_objects, 0 ); - else - error = T1_Load_Field( &loader->parser, field, - objects, max_objects, 0 ); - - Exit: - return error; - } - - - FT_LOCAL_DEF( FT_Error ) - t42_parse_dict( T42_Face face, - T42_Loader loader, - FT_Byte* base, - FT_Long size ) - { - T42_Parser parser = &loader->parser; - FT_Byte* limit; - FT_Int n_keywords = (FT_Int)( sizeof ( t42_keywords ) / - sizeof ( t42_keywords[0] ) ); - - - parser->root.cursor = base; - parser->root.limit = base + size; - parser->root.error = T42_Err_Ok; - - limit = parser->root.limit; - - T1_Skip_Spaces( parser ); - - while ( parser->root.cursor < limit ) - { - FT_Byte* cur; - - - cur = parser->root.cursor; - - /* look for `FontDirectory' which causes problems for some fonts */ - if ( *cur == 'F' && cur + 25 < limit && - ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 ) - { - FT_Byte* cur2; - - - /* skip the `FontDirectory' keyword */ - T1_Skip_PS_Token( parser ); - T1_Skip_Spaces ( parser ); - cur = cur2 = parser->root.cursor; - - /* look up the `known' keyword */ - while ( cur < limit ) - { - if ( *cur == 'k' && cur + 5 < limit && - ft_strncmp( (char*)cur, "known", 5 ) == 0 ) - break; - - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; - T1_Skip_Spaces ( parser ); - cur = parser->root.cursor; - } - - if ( cur < limit ) - { - T1_TokenRec token; - - - /* skip the `known' keyword and the token following it */ - T1_Skip_PS_Token( parser ); - T1_ToToken( parser, &token ); - - /* if the last token was an array, skip it! */ - if ( token.type == T1_TOKEN_TYPE_ARRAY ) - cur2 = parser->root.cursor; - } - parser->root.cursor = cur2; - } - - /* look for immediates */ - else if ( *cur == '/' && cur + 2 < limit ) - { - FT_PtrDist len; - - - cur++; - - parser->root.cursor = cur; - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; - - len = parser->root.cursor - cur; - - if ( len > 0 && len < 22 && parser->root.cursor < limit ) - { - int i; - - - /* now compare the immediate name to the keyword table */ - - /* loop through all known keywords */ - for ( i = 0; i < n_keywords; i++ ) - { - T1_Field keyword = (T1_Field)&t42_keywords[i]; - FT_Byte *name = (FT_Byte*)keyword->ident; - - - if ( !name ) - continue; - - if ( cur[0] == name[0] && - len == (FT_PtrDist)ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) - { - /* we found it -- run the parsing callback! */ - parser->root.error = t42_load_keyword( face, - loader, - keyword ); - if ( parser->root.error ) - return parser->root.error; - break; - } - } - } - } - else - { - T1_Skip_PS_Token( parser ); - if ( parser->root.error ) - goto Exit; - } - - T1_Skip_Spaces( parser ); - } - - Exit: - return parser->root.error; - } - - - FT_LOCAL_DEF( void ) - t42_loader_init( T42_Loader loader, - T42_Face face ) - { - FT_UNUSED( face ); - - FT_MEM_ZERO( loader, sizeof ( *loader ) ); - loader->num_glyphs = 0; - loader->num_chars = 0; - - /* initialize the tables -- simply set their `init' field to 0 */ - loader->encoding_table.init = 0; - loader->charstrings.init = 0; - loader->glyph_names.init = 0; - } - - - FT_LOCAL_DEF( void ) - t42_loader_done( T42_Loader loader ) - { - T42_Parser parser = &loader->parser; - - - /* finalize tables */ - T1_Release_Table( &loader->encoding_table ); - T1_Release_Table( &loader->charstrings ); - T1_Release_Table( &loader->glyph_names ); - T1_Release_Table( &loader->swap_table ); - - /* finalize parser */ - t42_parser_done( parser ); - } - - -/* END */ +/***************************************************************************/ +/* */ +/* t42parse.c */ +/* */ +/* Type 42 font parser (body). */ +/* */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by Roberto Alameda. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "t42parse.h" +#include "t42error.h" +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_LIST_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_t42 + + + static void + t42_parse_font_matrix( T42_Face face, + T42_Loader loader ); + static void + t42_parse_encoding( T42_Face face, + T42_Loader loader ); + + static void + t42_parse_charstrings( T42_Face face, + T42_Loader loader ); + + static void + t42_parse_sfnts( T42_Face face, + T42_Loader loader ); + + + /* as Type42 fonts have no Private dict, */ + /* we set the last argument of T1_FIELD_XXX to 0 */ + static const + T1_FieldRec t42_keywords[] = { + +#undef FT_STRUCTURE +#define FT_STRUCTURE T1_FontInfo +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_FONT_INFO + + T1_FIELD_STRING( "version", version, 0 ) + T1_FIELD_STRING( "Notice", notice, 0 ) + T1_FIELD_STRING( "FullName", full_name, 0 ) + T1_FIELD_STRING( "FamilyName", family_name, 0 ) + T1_FIELD_STRING( "Weight", weight, 0 ) + T1_FIELD_NUM ( "ItalicAngle", italic_angle, 0 ) + T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 ) + T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 ) + T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 ) + +#undef FT_STRUCTURE +#define FT_STRUCTURE T1_FontRec +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_FONT_DICT + + T1_FIELD_KEY ( "FontName", font_name, 0 ) + T1_FIELD_NUM ( "PaintType", paint_type, 0 ) + T1_FIELD_NUM ( "FontType", font_type, 0 ) + T1_FIELD_FIXED( "StrokeWidth", stroke_width, 0 ) + +#undef FT_STRUCTURE +#define FT_STRUCTURE FT_BBox +#undef T1CODE +#define T1CODE T1_FIELD_LOCATION_BBOX + + T1_FIELD_BBOX("FontBBox", xMin, 0 ) + + T1_FIELD_CALLBACK( "FontMatrix", t42_parse_font_matrix, 0 ) + T1_FIELD_CALLBACK( "Encoding", t42_parse_encoding, 0 ) + T1_FIELD_CALLBACK( "CharStrings", t42_parse_charstrings, 0 ) + T1_FIELD_CALLBACK( "sfnts", t42_parse_sfnts, 0 ) + + { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 } + }; + + +#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l ) +#define T1_Done_Table( p ) \ + do \ + { \ + if ( (p)->funcs.done ) \ + (p)->funcs.done( p ); \ + } while ( 0 ) +#define T1_Release_Table( p ) \ + do \ + { \ + if ( (p)->funcs.release ) \ + (p)->funcs.release( p ); \ + } while ( 0 ) + +#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root ) +#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root ) + +#define T1_ToInt( p ) \ + (p)->root.funcs.to_int( &(p)->root ) +#define T1_ToBytes( p, b, m, n, d ) \ + (p)->root.funcs.to_bytes( &(p)->root, b, m, n, d ) + +#define T1_ToFixedArray( p, m, f, t ) \ + (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) +#define T1_ToToken( p, t ) \ + (p)->root.funcs.to_token( &(p)->root, t ) + +#define T1_Load_Field( p, f, o, m, pf ) \ + (p)->root.funcs.load_field( &(p)->root, f, o, m, pf ) +#define T1_Load_Field_Table( p, f, o, m, pf ) \ + (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf ) + + + /********************* Parsing Functions ******************/ + + FT_LOCAL_DEF( FT_Error ) + t42_parser_init( T42_Parser parser, + FT_Stream stream, + FT_Memory memory, + PSAux_Service psaux ) + { + FT_Error error = T42_Err_Ok; + FT_Long size; + + + psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory ); + + parser->stream = stream; + parser->base_len = 0; + parser->base_dict = 0; + parser->in_memory = 0; + + /*******************************************************************/ + /* */ + /* Here a short summary of what is going on: */ + /* */ + /* When creating a new Type 42 parser, we try to locate and load */ + /* the base dictionary, loading the whole font into memory. */ + /* */ + /* When `loading' the base dictionary, we only set up pointers */ + /* in the case of a memory-based stream. Otherwise, we allocate */ + /* and load the base dictionary in it. */ + /* */ + /* parser->in_memory is set if we have a memory stream. */ + /* */ + + if ( FT_STREAM_SEEK( 0L ) || + FT_FRAME_ENTER( 17 ) ) + goto Exit; + + if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 ) + { + FT_TRACE2(( "not a Type42 font\n" )); + error = T42_Err_Unknown_File_Format; + } + + FT_FRAME_EXIT(); + + if ( error || FT_STREAM_SEEK( 0 ) ) + goto Exit; + + size = stream->size; + + /* now, try to load `size' bytes of the `base' dictionary we */ + /* found previously */ + + /* if it is a memory-based resource, set up pointers */ + if ( !stream->read ) + { + parser->base_dict = (FT_Byte*)stream->base + stream->pos; + parser->base_len = size; + parser->in_memory = 1; + + /* check that the `size' field is valid */ + if ( FT_STREAM_SKIP( size ) ) + goto Exit; + } + else + { + /* read segment in memory */ + if ( FT_ALLOC( parser->base_dict, size ) || + FT_STREAM_READ( parser->base_dict, size ) ) + goto Exit; + + parser->base_len = size; + } + + parser->root.base = parser->base_dict; + parser->root.cursor = parser->base_dict; + parser->root.limit = parser->root.cursor + parser->base_len; + + Exit: + if ( error && !parser->in_memory ) + FT_FREE( parser->base_dict ); + + return error; + } + + + FT_LOCAL_DEF( void ) + t42_parser_done( T42_Parser parser ) + { + FT_Memory memory = parser->root.memory; + + + /* free the base dictionary only when we have a disk stream */ + if ( !parser->in_memory ) + FT_FREE( parser->base_dict ); + + parser->root.funcs.done( &parser->root ); + } + + + static int + t42_is_space( FT_Byte c ) + { + return ( c == ' ' || c == '\t' || + c == '\r' || c == '\n' || c == '\f' || + c == '\0' ); + } + + + static void + t42_parse_font_matrix( T42_Face face, + T42_Loader loader ) + { + T42_Parser parser = &loader->parser; + FT_Matrix* matrix = &face->type1.font_matrix; + FT_Vector* offset = &face->type1.font_offset; + FT_Face root = (FT_Face)&face->root; + FT_Fixed temp[6]; + FT_Fixed temp_scale; + + + (void)T1_ToFixedArray( parser, 6, temp, 3 ); + + temp_scale = FT_ABS( temp[3] ); + + /* Set Units per EM based on FontMatrix values. We set the value to */ + /* 1000 / temp_scale, because temp_scale was already multiplied by */ + /* 1000 (in t1_tofixed, from psobjs.c). */ + + root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L, + temp_scale ) >> 16 ); + + /* we need to scale the values by 1.0/temp_scale */ + if ( temp_scale != 0x10000L ) { + temp[0] = FT_DivFix( temp[0], temp_scale ); + temp[1] = FT_DivFix( temp[1], temp_scale ); + temp[2] = FT_DivFix( temp[2], temp_scale ); + temp[4] = FT_DivFix( temp[4], temp_scale ); + temp[5] = FT_DivFix( temp[5], temp_scale ); + temp[3] = 0x10000L; + } + + matrix->xx = temp[0]; + matrix->yx = temp[1]; + matrix->xy = temp[2]; + matrix->yy = temp[3]; + + /* note that the offsets must be expressed in integer font units */ + offset->x = temp[4] >> 16; + offset->y = temp[5] >> 16; + } + + + static void + t42_parse_encoding( T42_Face face, + T42_Loader loader ) + { + T42_Parser parser = &loader->parser; + FT_Byte* cur; + FT_Byte* limit = parser->root.limit; + + PSAux_Service psaux = (PSAux_Service)face->psaux; + + + T1_Skip_Spaces( parser ); + cur = parser->root.cursor; + if ( cur >= limit ) + { + FT_ERROR(( "t42_parse_encoding: out of bounds!\n" )); + parser->root.error = T42_Err_Invalid_File_Format; + return; + } + + /* if we have a number or `[', the encoding is an array, */ + /* and we must load it now */ + if ( ft_isdigit( *cur ) || *cur == '[' ) + { + T1_Encoding encode = &face->type1.encoding; + FT_UInt count, n; + PS_Table char_table = &loader->encoding_table; + FT_Memory memory = parser->root.memory; + FT_Error error; + FT_Bool only_immediates = 0; + + + /* read the number of entries in the encoding; should be 256 */ + if ( *cur == '[' ) + { + count = 256; + only_immediates = 1; + parser->root.cursor++; + } + else + count = (FT_UInt)T1_ToInt( parser ); + + T1_Skip_Spaces( parser ); + if ( parser->root.cursor >= limit ) + return; + + /* we use a T1_Table to store our charnames */ + loader->num_chars = encode->num_chars = count; + if ( FT_NEW_ARRAY( encode->char_index, count ) || + FT_NEW_ARRAY( encode->char_name, count ) || + FT_SET_ERROR( psaux->ps_table_funcs->init( + char_table, count, memory ) ) ) + { + parser->root.error = error; + return; + } + + /* We need to `zero' out encoding_table.elements */ + for ( n = 0; n < count; n++ ) + { + char* notdef = (char *)".notdef"; + + + T1_Add_Table( char_table, n, notdef, 8 ); + } + + /* Now we need to read records of the form */ + /* */ + /* ... charcode /charname ... */ + /* */ + /* for each entry in our table. */ + /* */ + /* We simply look for a number followed by an immediate */ + /* name. Note that this ignores correctly the sequence */ + /* that is often seen in type42 fonts: */ + /* */ + /* 0 1 255 { 1 index exch /.notdef put } for dup */ + /* */ + /* used to clean the encoding array before anything else. */ + /* */ + /* Alternatively, if the array is directly given as */ + /* */ + /* /Encoding [ ... ] */ + /* */ + /* we only read immediates. */ + + n = 0; + T1_Skip_Spaces( parser ); + + while ( parser->root.cursor < limit ) + { + cur = parser->root.cursor; + + /* we stop when we encounter `def' or `]' */ + if ( *cur == 'd' && cur + 3 < limit ) + { + if ( cur[1] == 'e' && + cur[2] == 'f' && + t42_is_space( cur[3] ) ) + { + FT_TRACE6(( "encoding end\n" )); + cur += 3; + break; + } + } + if ( *cur == ']' ) + { + FT_TRACE6(( "encoding end\n" )); + cur++; + break; + } + + /* check whether we have found an entry */ + if ( ft_isdigit( *cur ) || only_immediates ) + { + FT_Int charcode; + + + if ( only_immediates ) + charcode = n; + else + { + charcode = (FT_Int)T1_ToInt( parser ); + T1_Skip_Spaces( parser ); + } + + cur = parser->root.cursor; + + if ( *cur == '/' && cur + 2 < limit && n < count ) + { + FT_PtrDist len; + + + cur++; + + parser->root.cursor = cur; + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + + len = parser->root.cursor - cur; + + parser->root.error = T1_Add_Table( char_table, charcode, + cur, len + 1 ); + if ( parser->root.error ) + return; + char_table->elements[charcode][len] = '\0'; + + n++; + } + } + else + { + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + } + + T1_Skip_Spaces( parser ); + } + + face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; + parser->root.cursor = cur; + } + + /* Otherwise, we should have either `StandardEncoding', */ + /* `ExpertEncoding', or `ISOLatin1Encoding' */ + else + { + if ( cur + 17 < limit && + ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 ) + face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD; + + else if ( cur + 15 < limit && + ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 ) + face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT; + + else if ( cur + 18 < limit && + ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 ) + face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; + + else + { + FT_ERROR(( "t42_parse_encoding: invalid token!\n" )); + parser->root.error = T42_Err_Invalid_File_Format; + } + } + } + + + typedef enum + { + BEFORE_START, + BEFORE_TABLE_DIR, + OTHER_TABLES + + } T42_Load_Status; + + + static void + t42_parse_sfnts( T42_Face face, + T42_Loader loader ) + { + T42_Parser parser = &loader->parser; + FT_Memory memory = parser->root.memory; + FT_Byte* cur; + FT_Byte* limit = parser->root.limit; + FT_Error error; + FT_Int num_tables = 0; + FT_ULong count, ttf_size = 0; + + FT_Long n, string_size, old_string_size, real_size; + FT_Byte* string_buf = NULL; + FT_Bool allocated = 0; + + T42_Load_Status status; + + + /* The format is */ + /* */ + /* /sfnts [ ... ] def */ + /* */ + /* or */ + /* */ + /* /sfnts [ */ + /* RD */ + /* RD */ + /* ... */ + /* ] def */ + /* */ + /* with exactly one space after the `RD' token. */ + + T1_Skip_Spaces( parser ); + + if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' ) + { + FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + T1_Skip_Spaces( parser ); + status = BEFORE_START; + string_size = 0; + old_string_size = 0; + count = 0; + + while ( parser->root.cursor < limit ) + { + cur = parser->root.cursor; + + if ( *cur == ']' ) + { + parser->root.cursor++; + goto Exit; + } + + else if ( *cur == '<' ) + { + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + goto Exit; + + /* don't include delimiters */ + string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 ); + if ( FT_REALLOC( string_buf, old_string_size, string_size ) ) + goto Fail; + + allocated = 1; + + parser->root.cursor = cur; + (void)T1_ToBytes( parser, string_buf, string_size, &real_size, 1 ); + old_string_size = string_size; + string_size = real_size; + } + + else if ( ft_isdigit( *cur ) ) + { + if ( allocated ) + { + FT_ERROR(( "t42_parse_sfnts: " + "can't handle mixed binary and hex strings!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + string_size = T1_ToInt( parser ); + + T1_Skip_PS_Token( parser ); /* `RD' */ + if ( parser->root.error ) + return; + + string_buf = parser->root.cursor + 1; /* one space after `RD' */ + + parser->root.cursor += string_size + 1; + if ( parser->root.cursor >= limit ) + { + FT_ERROR(( "t42_parse_sfnts: too many binary data!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + } + + if ( !string_buf ) + { + FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + /* A string can have a trailing zero byte for padding. Ignore it. */ + if ( string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) ) + string_size--; + + if ( !string_size ) + { + FT_ERROR(( "t42_parse_sfnts: invalid string!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + for ( n = 0; n < string_size; n++ ) + { + switch ( status ) + { + case BEFORE_START: + /* load offset table, 12 bytes */ + if ( count < 12 ) + { + face->ttf_data[count++] = string_buf[n]; + continue; + } + else + { + num_tables = 16 * face->ttf_data[4] + face->ttf_data[5]; + status = BEFORE_TABLE_DIR; + ttf_size = 12 + 16 * num_tables; + + if ( FT_REALLOC( face->ttf_data, 12, ttf_size ) ) + goto Fail; + } + /* fall through */ + + case BEFORE_TABLE_DIR: + /* the offset table is read; read the table directory */ + if ( count < ttf_size ) + { + face->ttf_data[count++] = string_buf[n]; + continue; + } + else + { + int i; + FT_ULong len; + + + for ( i = 0; i < num_tables; i++ ) + { + FT_Byte* p = face->ttf_data + 12 + 16 * i + 12; + + + len = FT_PEEK_ULONG( p ); + + /* Pad to a 4-byte boundary length */ + ttf_size += ( len + 3 ) & ~3; + } + + status = OTHER_TABLES; + face->ttf_size = ttf_size; + + /* there are no more than 256 tables, so no size check here */ + if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables, + ttf_size + 1 ) ) + goto Fail; + } + /* fall through */ + + case OTHER_TABLES: + /* all other tables are just copied */ + if ( count >= ttf_size ) + { + FT_ERROR(( "t42_parse_sfnts: too many binary data!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + face->ttf_data[count++] = string_buf[n]; + } + } + + T1_Skip_Spaces( parser ); + } + + /* if control reaches this point, the format was not valid */ + error = T42_Err_Invalid_File_Format; + + Fail: + parser->root.error = error; + + Exit: + if ( allocated ) + FT_FREE( string_buf ); + } + + + static void + t42_parse_charstrings( T42_Face face, + T42_Loader loader ) + { + T42_Parser parser = &loader->parser; + PS_Table code_table = &loader->charstrings; + PS_Table name_table = &loader->glyph_names; + PS_Table swap_table = &loader->swap_table; + FT_Memory memory = parser->root.memory; + FT_Error error; + + PSAux_Service psaux = (PSAux_Service)face->psaux; + + FT_Byte* cur; + FT_Byte* limit = parser->root.limit; + FT_UInt n; + FT_UInt notdef_index = 0; + FT_Byte notdef_found = 0; + + + T1_Skip_Spaces( parser ); + + if ( parser->root.cursor >= limit ) + { + FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + if ( ft_isdigit( *parser->root.cursor ) ) + { + loader->num_glyphs = (FT_UInt)T1_ToInt( parser ); + if ( parser->root.error ) + return; + } + else if ( *parser->root.cursor == '<' ) + { + /* We have `<< ... >>'. Count the number of `/' in the dictionary */ + /* to get its size. */ + FT_UInt count = 0; + + + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + T1_Skip_Spaces( parser ); + cur = parser->root.cursor; + + while ( parser->root.cursor < limit ) + { + if ( *parser->root.cursor == '/' ) + count++; + else if ( *parser->root.cursor == '>' ) + { + loader->num_glyphs = count; + parser->root.cursor = cur; /* rewind */ + break; + } + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + T1_Skip_Spaces( parser ); + } + } + else + { + FT_ERROR(( "t42_parse_charstrings: invalid token!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + if ( parser->root.cursor >= limit ) + { + FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + /* initialize tables */ + + error = psaux->ps_table_funcs->init( code_table, + loader->num_glyphs, + memory ); + if ( error ) + goto Fail; + + error = psaux->ps_table_funcs->init( name_table, + loader->num_glyphs, + memory ); + if ( error ) + goto Fail; + + /* Initialize table for swapping index notdef_index and */ + /* index 0 names and codes (if necessary). */ + + error = psaux->ps_table_funcs->init( swap_table, 4, memory ); + if ( error ) + goto Fail; + + n = 0; + + for (;;) + { + /* The format is simple: */ + /* `/glyphname' + index [+ def] */ + + T1_Skip_Spaces( parser ); + + cur = parser->root.cursor; + if ( cur >= limit ) + break; + + /* We stop when we find an `end' keyword or '>' */ + if ( *cur == 'e' && + cur + 3 < limit && + cur[1] == 'n' && + cur[2] == 'd' && + t42_is_space( cur[3] ) ) + break; + if ( *cur == '>' ) + break; + + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + return; + + if ( *cur == '/' ) + { + FT_PtrDist len; + + + if ( cur + 1 >= limit ) + { + FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + cur++; /* skip `/' */ + len = parser->root.cursor - cur; + + error = T1_Add_Table( name_table, n, cur, len + 1 ); + if ( error ) + goto Fail; + + /* add a trailing zero to the name table */ + name_table->elements[n][len] = '\0'; + + /* record index of /.notdef */ + if ( *cur == '.' && + ft_strcmp( ".notdef", + (const char*)(name_table->elements[n]) ) == 0 ) + { + notdef_index = n; + notdef_found = 1; + } + + T1_Skip_Spaces( parser ); + + cur = parser->root.cursor; + + (void)T1_ToInt( parser ); + if ( parser->root.cursor >= limit ) + { + FT_ERROR(( "t42_parse_charstrings: out of bounds!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + len = parser->root.cursor - cur; + + error = T1_Add_Table( code_table, n, cur, len + 1 ); + if ( error ) + goto Fail; + + code_table->elements[n][len] = '\0'; + + n++; + if ( n >= loader->num_glyphs ) + break; + } + } + + loader->num_glyphs = n; + + if ( !notdef_found ) + { + FT_ERROR(( "t42_parse_charstrings: no /.notdef glyph!\n" )); + error = T42_Err_Invalid_File_Format; + goto Fail; + } + + /* if /.notdef does not occupy index 0, do our magic. */ + if ( ft_strcmp( (const char*)".notdef", + (const char*)name_table->elements[0] ) ) + { + /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */ + /* name and code entries to swap_table. Then place notdef_index */ + /* name and code entries into swap_table. Then swap name and code */ + /* entries at indices notdef_index and 0 using values stored in */ + /* swap_table. */ + + /* Index 0 name */ + error = T1_Add_Table( swap_table, 0, + name_table->elements[0], + name_table->lengths [0] ); + if ( error ) + goto Fail; + + /* Index 0 code */ + error = T1_Add_Table( swap_table, 1, + code_table->elements[0], + code_table->lengths [0] ); + if ( error ) + goto Fail; + + /* Index notdef_index name */ + error = T1_Add_Table( swap_table, 2, + name_table->elements[notdef_index], + name_table->lengths [notdef_index] ); + if ( error ) + goto Fail; + + /* Index notdef_index code */ + error = T1_Add_Table( swap_table, 3, + code_table->elements[notdef_index], + code_table->lengths [notdef_index] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( name_table, notdef_index, + swap_table->elements[0], + swap_table->lengths [0] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( code_table, notdef_index, + swap_table->elements[1], + swap_table->lengths [1] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( name_table, 0, + swap_table->elements[2], + swap_table->lengths [2] ); + if ( error ) + goto Fail; + + error = T1_Add_Table( code_table, 0, + swap_table->elements[3], + swap_table->lengths [3] ); + if ( error ) + goto Fail; + + } + + return; + + Fail: + parser->root.error = error; + } + + + static FT_Error + t42_load_keyword( T42_Face face, + T42_Loader loader, + T1_Field field ) + { + FT_Error error; + void* dummy_object; + void** objects; + FT_UInt max_objects = 0; + + + /* if the keyword has a dedicated callback, call it */ + if ( field->type == T1_FIELD_TYPE_CALLBACK ) + { + field->reader( (FT_Face)face, loader ); + error = loader->parser.root.error; + goto Exit; + } + + /* now the keyword is either a simple field or a table of fields; */ + /* we are now going to take care of it */ + + switch ( field->location ) + { + case T1_FIELD_LOCATION_FONT_INFO: + dummy_object = &face->type1.font_info; + break; + + case T1_FIELD_LOCATION_BBOX: + dummy_object = &face->type1.font_bbox; + break; + + default: + dummy_object = &face->type1; + } + + objects = &dummy_object; + + if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY || + field->type == T1_FIELD_TYPE_FIXED_ARRAY ) + error = T1_Load_Field_Table( &loader->parser, field, + objects, max_objects, 0 ); + else + error = T1_Load_Field( &loader->parser, field, + objects, max_objects, 0 ); + + Exit: + return error; + } + + + FT_LOCAL_DEF( FT_Error ) + t42_parse_dict( T42_Face face, + T42_Loader loader, + FT_Byte* base, + FT_Long size ) + { + T42_Parser parser = &loader->parser; + FT_Byte* limit; + FT_Int n_keywords = (FT_Int)( sizeof ( t42_keywords ) / + sizeof ( t42_keywords[0] ) ); + + + parser->root.cursor = base; + parser->root.limit = base + size; + parser->root.error = T42_Err_Ok; + + limit = parser->root.limit; + + T1_Skip_Spaces( parser ); + + while ( parser->root.cursor < limit ) + { + FT_Byte* cur; + + + cur = parser->root.cursor; + + /* look for `FontDirectory' which causes problems for some fonts */ + if ( *cur == 'F' && cur + 25 < limit && + ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 ) + { + FT_Byte* cur2; + + + /* skip the `FontDirectory' keyword */ + T1_Skip_PS_Token( parser ); + T1_Skip_Spaces ( parser ); + cur = cur2 = parser->root.cursor; + + /* look up the `known' keyword */ + while ( cur < limit ) + { + if ( *cur == 'k' && cur + 5 < limit && + ft_strncmp( (char*)cur, "known", 5 ) == 0 ) + break; + + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + goto Exit; + T1_Skip_Spaces ( parser ); + cur = parser->root.cursor; + } + + if ( cur < limit ) + { + T1_TokenRec token; + + + /* skip the `known' keyword and the token following it */ + T1_Skip_PS_Token( parser ); + T1_ToToken( parser, &token ); + + /* if the last token was an array, skip it! */ + if ( token.type == T1_TOKEN_TYPE_ARRAY ) + cur2 = parser->root.cursor; + } + parser->root.cursor = cur2; + } + + /* look for immediates */ + else if ( *cur == '/' && cur + 2 < limit ) + { + FT_PtrDist len; + + + cur++; + + parser->root.cursor = cur; + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + goto Exit; + + len = parser->root.cursor - cur; + + if ( len > 0 && len < 22 && parser->root.cursor < limit ) + { + int i; + + + /* now compare the immediate name to the keyword table */ + + /* loop through all known keywords */ + for ( i = 0; i < n_keywords; i++ ) + { + T1_Field keyword = (T1_Field)&t42_keywords[i]; + FT_Byte *name = (FT_Byte*)keyword->ident; + + + if ( !name ) + continue; + + if ( cur[0] == name[0] && + len == (FT_PtrDist)ft_strlen( (const char *)name ) && + ft_memcmp( cur, name, len ) == 0 ) + { + /* we found it -- run the parsing callback! */ + parser->root.error = t42_load_keyword( face, + loader, + keyword ); + if ( parser->root.error ) + return parser->root.error; + break; + } + } + } + } + else + { + T1_Skip_PS_Token( parser ); + if ( parser->root.error ) + goto Exit; + } + + T1_Skip_Spaces( parser ); + } + + Exit: + return parser->root.error; + } + + + FT_LOCAL_DEF( void ) + t42_loader_init( T42_Loader loader, + T42_Face face ) + { + FT_UNUSED( face ); + + FT_MEM_ZERO( loader, sizeof ( *loader ) ); + loader->num_glyphs = 0; + loader->num_chars = 0; + + /* initialize the tables -- simply set their `init' field to 0 */ + loader->encoding_table.init = 0; + loader->charstrings.init = 0; + loader->glyph_names.init = 0; + } + + + FT_LOCAL_DEF( void ) + t42_loader_done( T42_Loader loader ) + { + T42_Parser parser = &loader->parser; + + + /* finalize tables */ + T1_Release_Table( &loader->encoding_table ); + T1_Release_Table( &loader->charstrings ); + T1_Release_Table( &loader->glyph_names ); + T1_Release_Table( &loader->swap_table ); + + /* finalize parser */ + t42_parser_done( parser ); + } + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42parse.h b/reactos/dll/3rdparty/freetype/src/type42/t42parse.h index f77ec4af4f4..61653a58fec 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42parse.h +++ b/reactos/dll/3rdparty/freetype/src/type42/t42parse.h @@ -1,90 +1,90 @@ -/***************************************************************************/ -/* */ -/* t42parse.h */ -/* */ -/* Type 42 font parser (specification). */ -/* */ -/* Copyright 2002, 2003 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T42PARSE_H__ -#define __T42PARSE_H__ - - -#include "t42objs.h" -#include FT_INTERNAL_POSTSCRIPT_AUX_H - - -FT_BEGIN_HEADER - - typedef struct T42_ParserRec_ - { - PS_ParserRec root; - FT_Stream stream; - - FT_Byte* base_dict; - FT_Long base_len; - - FT_Bool in_memory; - - } T42_ParserRec, *T42_Parser; - - - typedef struct T42_Loader_ - { - T42_ParserRec parser; /* parser used to read the stream */ - - FT_UInt num_chars; /* number of characters in encoding */ - PS_TableRec encoding_table; /* PS_Table used to store the */ - /* encoding character names */ - - FT_UInt num_glyphs; - PS_TableRec glyph_names; - PS_TableRec charstrings; - PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */ - - } T42_LoaderRec, *T42_Loader; - - - FT_LOCAL( FT_Error ) - t42_parser_init( T42_Parser parser, - FT_Stream stream, - FT_Memory memory, - PSAux_Service psaux ); - - FT_LOCAL( void ) - t42_parser_done( T42_Parser parser ); - - - FT_LOCAL( FT_Error ) - t42_parse_dict( T42_Face face, - T42_Loader loader, - FT_Byte* base, - FT_Long size ); - - - FT_LOCAL( void ) - t42_loader_init( T42_Loader loader, - T42_Face face ); - - FT_LOCAL( void ) - t42_loader_done( T42_Loader loader ); - - - /* */ - -FT_END_HEADER - - -#endif /* __T42PARSE_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t42parse.h */ +/* */ +/* Type 42 font parser (specification). */ +/* */ +/* Copyright 2002, 2003 by Roberto Alameda. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T42PARSE_H__ +#define __T42PARSE_H__ + + +#include "t42objs.h" +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + +FT_BEGIN_HEADER + + typedef struct T42_ParserRec_ + { + PS_ParserRec root; + FT_Stream stream; + + FT_Byte* base_dict; + FT_Long base_len; + + FT_Bool in_memory; + + } T42_ParserRec, *T42_Parser; + + + typedef struct T42_Loader_ + { + T42_ParserRec parser; /* parser used to read the stream */ + + FT_UInt num_chars; /* number of characters in encoding */ + PS_TableRec encoding_table; /* PS_Table used to store the */ + /* encoding character names */ + + FT_UInt num_glyphs; + PS_TableRec glyph_names; + PS_TableRec charstrings; + PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */ + + } T42_LoaderRec, *T42_Loader; + + + FT_LOCAL( FT_Error ) + t42_parser_init( T42_Parser parser, + FT_Stream stream, + FT_Memory memory, + PSAux_Service psaux ); + + FT_LOCAL( void ) + t42_parser_done( T42_Parser parser ); + + + FT_LOCAL( FT_Error ) + t42_parse_dict( T42_Face face, + T42_Loader loader, + FT_Byte* base, + FT_Long size ); + + + FT_LOCAL( void ) + t42_loader_init( T42_Loader loader, + T42_Face face ); + + FT_LOCAL( void ) + t42_loader_done( T42_Loader loader ); + + + /* */ + +FT_END_HEADER + + +#endif /* __T42PARSE_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/t42types.h b/reactos/dll/3rdparty/freetype/src/type42/t42types.h index 6626b04458a..8147c750210 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/t42types.h +++ b/reactos/dll/3rdparty/freetype/src/type42/t42types.h @@ -1,54 +1,54 @@ -/***************************************************************************/ -/* */ -/* t42types.h */ -/* */ -/* Type 42 font data types (specification only). */ -/* */ -/* Copyright 2002, 2003, 2006 by Roberto Alameda. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T42TYPES_H__ -#define __T42TYPES_H__ - - -#include -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H - - -FT_BEGIN_HEADER - - - typedef struct T42_FaceRec_ - { - FT_FaceRec root; - T1_FontRec type1; - const void* psnames; - const void* psaux; - const void* afm_data; - FT_Byte* ttf_data; - FT_ULong ttf_size; - FT_Face ttf_face; - FT_CharMapRec charmaprecs[2]; - FT_CharMap charmaps[2]; - PS_UnicodesRec unicode_map; - - } T42_FaceRec, *T42_Face; - - -FT_END_HEADER - -#endif /* __T1TYPES_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* t42types.h */ +/* */ +/* Type 42 font data types (specification only). */ +/* */ +/* Copyright 2002, 2003, 2006 by Roberto Alameda. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __T42TYPES_H__ +#define __T42TYPES_H__ + + +#include +#include FT_FREETYPE_H +#include FT_TYPE1_TABLES_H +#include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_POSTSCRIPT_HINTS_H + + +FT_BEGIN_HEADER + + + typedef struct T42_FaceRec_ + { + FT_FaceRec root; + T1_FontRec type1; + const void* psnames; + const void* psaux; + const void* afm_data; + FT_Byte* ttf_data; + FT_ULong ttf_size; + FT_Face ttf_face; + FT_CharMapRec charmaprecs[2]; + FT_CharMap charmaps[2]; + PS_UnicodesRec unicode_map; + + } T42_FaceRec, *T42_Face; + + +FT_END_HEADER + +#endif /* __T1TYPES_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/type42/type42.c b/reactos/dll/3rdparty/freetype/src/type42/type42.c index d13df56b10c..3fe4820c177 100644 --- a/reactos/dll/3rdparty/freetype/src/type42/type42.c +++ b/reactos/dll/3rdparty/freetype/src/type42/type42.c @@ -1,25 +1,25 @@ -/***************************************************************************/ -/* */ -/* type42.c */ -/* */ -/* FreeType Type 42 driver component. */ -/* */ -/* Copyright 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - -#define FT_MAKE_OPTION_SINGLE_OBJECT - -#include -#include "t42objs.c" -#include "t42parse.c" -#include "t42drivr.c" - -/* END */ +/***************************************************************************/ +/* */ +/* type42.c */ +/* */ +/* FreeType Type 42 driver component. */ +/* */ +/* Copyright 2002 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#define FT_MAKE_OPTION_SINGLE_OBJECT + +#include +#include "t42objs.c" +#include "t42parse.c" +#include "t42drivr.c" + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/winfonts/fnterrs.h b/reactos/dll/3rdparty/freetype/src/winfonts/fnterrs.h index ea80909715d..8ab0a1ac90e 100644 --- a/reactos/dll/3rdparty/freetype/src/winfonts/fnterrs.h +++ b/reactos/dll/3rdparty/freetype/src/winfonts/fnterrs.h @@ -1,41 +1,41 @@ -/***************************************************************************/ -/* */ -/* fnterrs.h */ -/* */ -/* Win FNT/FON error codes (specification only). */ -/* */ -/* Copyright 2001 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - - /*************************************************************************/ - /* */ - /* This file is used to define the Windows FNT/FON error enumeration */ - /* constants. */ - /* */ - /*************************************************************************/ - -#ifndef __FNTERRS_H__ -#define __FNTERRS_H__ - -#include FT_MODULE_ERRORS_H - -#undef __FTERRORS_H__ - -#define FT_ERR_PREFIX FNT_Err_ -#define FT_ERR_BASE FT_Mod_Err_Winfonts - -#include FT_ERRORS_H - -#endif /* __FNTERRS_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* fnterrs.h */ +/* */ +/* Win FNT/FON error codes (specification only). */ +/* */ +/* Copyright 2001 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file is used to define the Windows FNT/FON error enumeration */ + /* constants. */ + /* */ + /*************************************************************************/ + +#ifndef __FNTERRS_H__ +#define __FNTERRS_H__ + +#include FT_MODULE_ERRORS_H + +#undef __FTERRORS_H__ + +#define FT_ERR_PREFIX FNT_Err_ +#define FT_ERR_BASE FT_Mod_Err_Winfonts + +#include FT_ERRORS_H + +#endif /* __FNTERRS_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.c b/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.c index 4aa974410f3..d1482d3c512 100644 --- a/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.c +++ b/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.c @@ -1,1122 +1,1122 @@ -/***************************************************************************/ -/* */ -/* winfnt.c */ -/* */ -/* FreeType font driver for Windows FNT/FON files */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* Copyright 2003 Huw D M Davies for Codeweavers */ -/* Copyright 2007 Dmitry Timoshkov for Codeweavers */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#include -#include FT_WINFONTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H - -#include "winfnt.h" -#include "fnterrs.h" -#include FT_SERVICE_WINFNT_H -#include FT_SERVICE_XFREE86_NAME_H - - /*************************************************************************/ - /* */ - /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ - /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ - /* messages during execution. */ - /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_winfnt - - - static const FT_Frame_Field winmz_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinMZ_HeaderRec - - FT_FRAME_START( 64 ), - FT_FRAME_USHORT_LE ( magic ), - FT_FRAME_SKIP_BYTES( 29 * 2 ), - FT_FRAME_ULONG_LE ( lfanew ), - FT_FRAME_END - }; - - static const FT_Frame_Field winne_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinNE_HeaderRec - - FT_FRAME_START( 40 ), - FT_FRAME_USHORT_LE ( magic ), - FT_FRAME_SKIP_BYTES( 34 ), - FT_FRAME_USHORT_LE ( resource_tab_offset ), - FT_FRAME_USHORT_LE ( rname_tab_offset ), - FT_FRAME_END - }; - - static const FT_Frame_Field winpe32_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinPE32_HeaderRec - - FT_FRAME_START( 248 ), - FT_FRAME_ULONG_LE ( magic ), /* PE00 */ - FT_FRAME_USHORT_LE ( machine ), /* 0x014c - i386 */ - FT_FRAME_USHORT_LE ( number_of_sections ), - FT_FRAME_SKIP_BYTES( 12 ), - FT_FRAME_USHORT_LE ( size_of_optional_header ), - FT_FRAME_SKIP_BYTES( 2 ), - FT_FRAME_USHORT_LE ( magic32 ), /* 0x10b */ - FT_FRAME_SKIP_BYTES( 110 ), - FT_FRAME_ULONG_LE ( rsrc_virtual_address ), - FT_FRAME_ULONG_LE ( rsrc_size ), - FT_FRAME_SKIP_BYTES( 104 ), - FT_FRAME_END - }; - - static const FT_Frame_Field winpe32_section_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinPE32_SectionRec - - FT_FRAME_START( 40 ), - FT_FRAME_BYTES ( name, 8 ), - FT_FRAME_SKIP_BYTES( 4 ), - FT_FRAME_ULONG_LE ( virtual_address ), - FT_FRAME_ULONG_LE ( size_of_raw_data ), - FT_FRAME_ULONG_LE ( pointer_to_raw_data ), - FT_FRAME_SKIP_BYTES( 16 ), - FT_FRAME_END - }; - - static const FT_Frame_Field winpe_rsrc_dir_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinPE_RsrcDirRec - - FT_FRAME_START( 16 ), - FT_FRAME_ULONG_LE ( characteristics ), - FT_FRAME_ULONG_LE ( time_date_stamp ), - FT_FRAME_USHORT_LE( major_version ), - FT_FRAME_USHORT_LE( minor_version ), - FT_FRAME_USHORT_LE( number_of_named_entries ), - FT_FRAME_USHORT_LE( number_of_id_entries ), - FT_FRAME_END - }; - - static const FT_Frame_Field winpe_rsrc_dir_entry_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinPE_RsrcDirEntryRec - - FT_FRAME_START( 8 ), - FT_FRAME_ULONG_LE( name ), - FT_FRAME_ULONG_LE( offset ), - FT_FRAME_END - }; - - static const FT_Frame_Field winpe_rsrc_data_entry_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE WinPE_RsrcDataEntryRec - - FT_FRAME_START( 16 ), - FT_FRAME_ULONG_LE( offset_to_data ), - FT_FRAME_ULONG_LE( size ), - FT_FRAME_ULONG_LE( code_page ), - FT_FRAME_ULONG_LE( reserved ), - FT_FRAME_END - }; - - static const FT_Frame_Field winfnt_header_fields[] = - { -#undef FT_STRUCTURE -#define FT_STRUCTURE FT_WinFNT_HeaderRec - - FT_FRAME_START( 148 ), - FT_FRAME_USHORT_LE( version ), - FT_FRAME_ULONG_LE ( file_size ), - FT_FRAME_BYTES ( copyright, 60 ), - FT_FRAME_USHORT_LE( file_type ), - FT_FRAME_USHORT_LE( nominal_point_size ), - FT_FRAME_USHORT_LE( vertical_resolution ), - FT_FRAME_USHORT_LE( horizontal_resolution ), - FT_FRAME_USHORT_LE( ascent ), - FT_FRAME_USHORT_LE( internal_leading ), - FT_FRAME_USHORT_LE( external_leading ), - FT_FRAME_BYTE ( italic ), - FT_FRAME_BYTE ( underline ), - FT_FRAME_BYTE ( strike_out ), - FT_FRAME_USHORT_LE( weight ), - FT_FRAME_BYTE ( charset ), - FT_FRAME_USHORT_LE( pixel_width ), - FT_FRAME_USHORT_LE( pixel_height ), - FT_FRAME_BYTE ( pitch_and_family ), - FT_FRAME_USHORT_LE( avg_width ), - FT_FRAME_USHORT_LE( max_width ), - FT_FRAME_BYTE ( first_char ), - FT_FRAME_BYTE ( last_char ), - FT_FRAME_BYTE ( default_char ), - FT_FRAME_BYTE ( break_char ), - FT_FRAME_USHORT_LE( bytes_per_row ), - FT_FRAME_ULONG_LE ( device_offset ), - FT_FRAME_ULONG_LE ( face_name_offset ), - FT_FRAME_ULONG_LE ( bits_pointer ), - FT_FRAME_ULONG_LE ( bits_offset ), - FT_FRAME_BYTE ( reserved ), - FT_FRAME_ULONG_LE ( flags ), - FT_FRAME_USHORT_LE( A_space ), - FT_FRAME_USHORT_LE( B_space ), - FT_FRAME_USHORT_LE( C_space ), - FT_FRAME_ULONG_LE ( color_table_offset ), - FT_FRAME_BYTES ( reserved1, 16 ), - FT_FRAME_END - }; - - - static void - fnt_font_done( FNT_Face face ) - { - FT_Memory memory = FT_FACE( face )->memory; - FT_Stream stream = FT_FACE( face )->stream; - FNT_Font font = face->font; - - - if ( !font ) - return; - - if ( font->fnt_frame ) - FT_FRAME_RELEASE( font->fnt_frame ); - FT_FREE( font->family_name ); - - FT_FREE( font ); - face->font = 0; - } - - - static FT_Error - fnt_font_load( FNT_Font font, - FT_Stream stream ) - { - FT_Error error; - FT_WinFNT_Header header = &font->header; - FT_Bool new_format; - FT_UInt size; - - - /* first of all, read the FNT header */ - if ( FT_STREAM_SEEK( font->offset ) || - FT_STREAM_READ_FIELDS( winfnt_header_fields, header ) ) - goto Exit; - - /* check header */ - if ( header->version != 0x200 && - header->version != 0x300 ) - { - FT_TRACE2(( "[not a valid FNT file]\n" )); - error = FNT_Err_Unknown_File_Format; - goto Exit; - } - - new_format = FT_BOOL( font->header.version == 0x300 ); - size = new_format ? 148 : 118; - - if ( header->file_size < size ) - { - FT_TRACE2(( "[not a valid FNT file]\n" )); - error = FNT_Err_Unknown_File_Format; - goto Exit; - } - - /* Version 2 doesn't have these fields */ - if ( header->version == 0x200 ) - { - header->flags = 0; - header->A_space = 0; - header->B_space = 0; - header->C_space = 0; - - header->color_table_offset = 0; - } - - if ( header->file_type & 1 ) - { - FT_TRACE2(( "[can't handle vector FNT fonts]\n" )); - error = FNT_Err_Unknown_File_Format; - goto Exit; - } - - /* this is a FNT file/table; extract its frame */ - if ( FT_STREAM_SEEK( font->offset ) || - FT_FRAME_EXTRACT( header->file_size, font->fnt_frame ) ) - goto Exit; - - Exit: - return error; - } - - - static FT_Error - fnt_face_get_dll_font( FNT_Face face, - FT_Int face_index ) - { - FT_Error error; - FT_Stream stream = FT_FACE( face )->stream; - FT_Memory memory = FT_FACE( face )->memory; - WinMZ_HeaderRec mz_header; - - - face->font = 0; - - /* does it begin with an MZ header? */ - if ( FT_STREAM_SEEK( 0 ) || - FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) ) - goto Exit; - - error = FNT_Err_Unknown_File_Format; - if ( mz_header.magic == WINFNT_MZ_MAGIC ) - { - /* yes, now look for an NE header in the file */ - WinNE_HeaderRec ne_header; - - - FT_TRACE2(( "MZ signature found\n" )); - - if ( FT_STREAM_SEEK( mz_header.lfanew ) || - FT_STREAM_READ_FIELDS( winne_header_fields, &ne_header ) ) - goto Exit; - - error = FNT_Err_Unknown_File_Format; - if ( ne_header.magic == WINFNT_NE_MAGIC ) - { - /* good, now look into the resource table for each FNT resource */ - FT_ULong res_offset = mz_header.lfanew + - ne_header.resource_tab_offset; - FT_UShort size_shift; - FT_UShort font_count = 0; - FT_ULong font_offset = 0; - - - FT_TRACE2(( "NE signature found\n" )); - - if ( FT_STREAM_SEEK( res_offset ) || - FT_FRAME_ENTER( ne_header.rname_tab_offset - - ne_header.resource_tab_offset ) ) - goto Exit; - - size_shift = FT_GET_USHORT_LE(); - - for (;;) - { - FT_UShort type_id, count; - - - type_id = FT_GET_USHORT_LE(); - if ( !type_id ) - break; - - count = FT_GET_USHORT_LE(); - - if ( type_id == 0x8008U ) - { - font_count = count; - font_offset = (FT_ULong)( FT_STREAM_POS() + 4 + - ( stream->cursor - stream->limit ) ); - break; - } - - stream->cursor += 4 + count * 12; - } - - FT_FRAME_EXIT(); - - if ( !font_count || !font_offset ) - { - FT_TRACE2(( "this file doesn't contain any FNT resources!\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - /* loading `winfnt_header_fields' needs at least 118 bytes; */ - /* use this as a rough measure to check the expected font size */ - if ( font_count * 118UL > stream->size ) - { - FT_TRACE2(( "invalid number of faces\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - face->root.num_faces = font_count; - - if ( face_index >= font_count ) - { - error = FNT_Err_Bad_Argument; - goto Exit; - } - - if ( FT_NEW( face->font ) ) - goto Exit; - - if ( FT_STREAM_SEEK( font_offset + face_index * 12 ) || - FT_FRAME_ENTER( 12 ) ) - goto Fail; - - face->font->offset = (FT_ULong)FT_GET_USHORT_LE() << size_shift; - face->font->fnt_size = (FT_ULong)FT_GET_USHORT_LE() << size_shift; - - stream->cursor += 8; - - FT_FRAME_EXIT(); - - error = fnt_font_load( face->font, stream ); - } - else if ( ne_header.magic == WINFNT_PE_MAGIC ) - { - WinPE32_HeaderRec pe32_header; - WinPE32_SectionRec pe32_section; - WinPE_RsrcDirRec root_dir, name_dir, lang_dir; - WinPE_RsrcDirEntryRec dir_entry1, dir_entry2, dir_entry3; - WinPE_RsrcDataEntryRec data_entry; - - FT_Long root_dir_offset, name_dir_offset, lang_dir_offset; - FT_UShort i, j, k; - - - FT_TRACE2(( "PE signature found\n" )); - - if ( FT_STREAM_SEEK( mz_header.lfanew ) || - FT_STREAM_READ_FIELDS( winpe32_header_fields, &pe32_header ) ) - goto Exit; - - FT_TRACE2(( "magic %04lx, machine %02x, number_of_sections %u, " - "size_of_optional_header %02x\n" - "magic32 %02x, rsrc_virtual_address %04lx, " - "rsrc_size %04lx\n", - pe32_header.magic, pe32_header.machine, - pe32_header.number_of_sections, - pe32_header.size_of_optional_header, - pe32_header.magic32, pe32_header.rsrc_virtual_address, - pe32_header.rsrc_size )); - - if ( pe32_header.magic != WINFNT_PE_MAGIC /* check full signature */ || - pe32_header.machine != 0x014c /* i386 */ || - pe32_header.size_of_optional_header != 0xe0 /* FIXME */ || - pe32_header.magic32 != 0x10b ) - { - FT_TRACE2(( "this file has an invalid PE header\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - face->root.num_faces = 0; - - for ( i = 0; i < pe32_header.number_of_sections; i++ ) - { - if ( FT_STREAM_READ_FIELDS( winpe32_section_fields, - &pe32_section ) ) - goto Exit; - - FT_TRACE2(( "name %.8s, va %04lx, size %04lx, offset %04lx\n", - pe32_section.name, pe32_section.virtual_address, - pe32_section.size_of_raw_data, - pe32_section.pointer_to_raw_data )); - - if ( pe32_header.rsrc_virtual_address == - pe32_section.virtual_address ) - goto Found_rsrc_section; - } - - FT_TRACE2(( "this file doesn't contain any resources\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - - Found_rsrc_section: - FT_TRACE2(( "found resources section %.8s\n", pe32_section.name )); - - if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data ) || - FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &root_dir ) ) - goto Exit; - - root_dir_offset = pe32_section.pointer_to_raw_data; - - for ( i = 0; i < root_dir.number_of_named_entries + - root_dir.number_of_id_entries; i++ ) - { - if ( FT_STREAM_SEEK( root_dir_offset + 16 + i * 8 ) || - FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields, - &dir_entry1 ) ) - goto Exit; - - if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ ) - { - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - dir_entry1.offset &= ~0x80000000UL; - - name_dir_offset = pe32_section.pointer_to_raw_data + - dir_entry1.offset; - - if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data + - dir_entry1.offset ) || - FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &name_dir ) ) - goto Exit; - - for ( j = 0; j < name_dir.number_of_named_entries + - name_dir.number_of_id_entries; j++ ) - { - if ( FT_STREAM_SEEK( name_dir_offset + 16 + j * 8 ) || - FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields, - &dir_entry2 ) ) - goto Exit; - - if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ ) - { - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - dir_entry2.offset &= ~0x80000000UL; - - lang_dir_offset = pe32_section.pointer_to_raw_data + - dir_entry2.offset; - - if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data + - dir_entry2.offset ) || - FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &lang_dir ) ) - goto Exit; - - for ( k = 0; k < lang_dir.number_of_named_entries + - lang_dir.number_of_id_entries; k++ ) - { - if ( FT_STREAM_SEEK( lang_dir_offset + 16 + k * 8 ) || - FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields, - &dir_entry3 ) ) - goto Exit; - - if ( dir_entry2.offset & 0x80000000UL /* DataIsDirectory */ ) - { - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - if ( dir_entry1.name == 8 /* RT_FONT */ ) - { - if ( FT_STREAM_SEEK( root_dir_offset + dir_entry3.offset ) || - FT_STREAM_READ_FIELDS( winpe_rsrc_data_entry_fields, - &data_entry ) ) - goto Exit; - - FT_TRACE2(( "found font #%lu, offset %04lx, " - "size %04lx, cp %lu\n", - dir_entry2.name, - pe32_section.pointer_to_raw_data + - data_entry.offset_to_data - - pe32_section.virtual_address, - data_entry.size, data_entry.code_page )); - - if ( face_index == face->root.num_faces ) - { - if ( FT_NEW( face->font ) ) - goto Exit; - - face->font->offset = pe32_section.pointer_to_raw_data + - data_entry.offset_to_data - - pe32_section.virtual_address; - face->font->fnt_size = data_entry.size; - - error = fnt_font_load( face->font, stream ); - if ( error ) - { - FT_TRACE2(( "font #%lu load error %d\n", - dir_entry2.name, error )); - goto Fail; - } - else - FT_TRACE2(( "font #%lu successfully loaded\n", - dir_entry2.name )); - } - - face->root.num_faces++; - } - } - } - } - } - - if ( !face->root.num_faces ) - { - FT_TRACE2(( "this file doesn't contain any RT_FONT resources\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - if ( face_index >= face->root.num_faces ) - { - error = FNT_Err_Bad_Argument; - goto Exit; - } - } - - Fail: - if ( error ) - fnt_font_done( face ); - - Exit: - return error; - } - - - typedef struct FNT_CMapRec_ - { - FT_CMapRec cmap; - FT_UInt32 first; - FT_UInt32 count; - - } FNT_CMapRec, *FNT_CMap; - - - static FT_Error - fnt_cmap_init( FNT_CMap cmap ) - { - FNT_Face face = (FNT_Face)FT_CMAP_FACE( cmap ); - FNT_Font font = face->font; - - - cmap->first = (FT_UInt32) font->header.first_char; - cmap->count = (FT_UInt32)( font->header.last_char - cmap->first + 1 ); - - return 0; - } - - - static FT_UInt - fnt_cmap_char_index( FNT_CMap cmap, - FT_UInt32 char_code ) - { - FT_UInt gindex = 0; - - - char_code -= cmap->first; - if ( char_code < cmap->count ) - gindex = char_code + 1; /* we artificially increase the glyph index; */ - /* FNT_Load_Glyph reverts to the right one */ - return gindex; - } - - - static FT_UInt - fnt_cmap_char_next( FNT_CMap cmap, - FT_UInt32 *pchar_code ) - { - FT_UInt gindex = 0; - FT_UInt32 result = 0; - FT_UInt32 char_code = *pchar_code + 1; - - - if ( char_code <= cmap->first ) - { - result = cmap->first; - gindex = 1; - } - else - { - char_code -= cmap->first; - if ( char_code < cmap->count ) - { - result = cmap->first + char_code; - gindex = char_code + 1; - } - } - - *pchar_code = result; - return gindex; - } - - - static const FT_CMap_ClassRec fnt_cmap_class_rec = - { - sizeof ( FNT_CMapRec ), - - (FT_CMap_InitFunc) fnt_cmap_init, - (FT_CMap_DoneFunc) NULL, - (FT_CMap_CharIndexFunc)fnt_cmap_char_index, - (FT_CMap_CharNextFunc) fnt_cmap_char_next - }; - - static FT_CMap_Class const fnt_cmap_class = &fnt_cmap_class_rec; - - - static void - FNT_Face_Done( FNT_Face face ) - { - if ( face ) - { - FT_Memory memory = FT_FACE_MEMORY( face ); - - - fnt_font_done( face ); - - FT_FREE( face->root.available_sizes ); - face->root.num_fixed_sizes = 0; - } - } - - - static FT_Error - FNT_Face_Init( FT_Stream stream, - FNT_Face face, - FT_Int face_index, - FT_Int num_params, - FT_Parameter* params ) - { - FT_Error error; - FT_Memory memory = FT_FACE_MEMORY( face ); - - FT_UNUSED( num_params ); - FT_UNUSED( params ); - - - /* try to load font from a DLL */ - error = fnt_face_get_dll_font( face, face_index ); - if ( error == FNT_Err_Unknown_File_Format ) - { - /* this didn't work; try to load a single FNT font */ - FNT_Font font; - - - if ( face_index > 0 ) - { - error = FNT_Err_Bad_Argument; - goto Exit; - } - - if ( FT_NEW( face->font ) ) - goto Exit; - - face->root.num_faces = 1; - - font = face->font; - font->offset = 0; - font->fnt_size = stream->size; - - error = fnt_font_load( font, stream ); - } - - if ( error ) - goto Fail; - - /* we now need to fill the root FT_Face fields */ - /* with relevant information */ - { - FT_Face root = FT_FACE( face ); - FNT_Font font = face->font; - FT_PtrDist family_size; - - - root->face_flags = FT_FACE_FLAG_FIXED_SIZES | - FT_FACE_FLAG_HORIZONTAL; - - if ( font->header.avg_width == font->header.max_width ) - root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; - - if ( font->header.italic ) - root->style_flags |= FT_STYLE_FLAG_ITALIC; - - if ( font->header.weight >= 800 ) - root->style_flags |= FT_STYLE_FLAG_BOLD; - - /* set up the `fixed_sizes' array */ - if ( FT_NEW_ARRAY( root->available_sizes, 1 ) ) - goto Fail; - - root->num_fixed_sizes = 1; - - { - FT_Bitmap_Size* bsize = root->available_sizes; - FT_UShort x_res, y_res; - - - bsize->width = font->header.avg_width; - bsize->height = (FT_Short)( - font->header.pixel_height + font->header.external_leading ); - bsize->size = font->header.nominal_point_size << 6; - - x_res = font->header.horizontal_resolution; - if ( !x_res ) - x_res = 72; - - y_res = font->header.vertical_resolution; - if ( !y_res ) - y_res = 72; - - bsize->y_ppem = FT_MulDiv( bsize->size, y_res, 72 ); - bsize->y_ppem = FT_PIX_ROUND( bsize->y_ppem ); - - /* - * this reads: - * - * the nominal height is larger than the bbox's height - * - * => nominal_point_size contains incorrect value; - * use pixel_height as the nominal height - */ - if ( bsize->y_ppem > font->header.pixel_height << 6 ) - { - FT_TRACE2(( "use pixel_height as the nominal height\n" )); - - bsize->y_ppem = font->header.pixel_height << 6; - bsize->size = FT_MulDiv( bsize->y_ppem, 72, y_res ); - } - - bsize->x_ppem = FT_MulDiv( bsize->size, x_res, 72 ); - bsize->x_ppem = FT_PIX_ROUND( bsize->x_ppem ); - } - - { - FT_CharMapRec charmap; - - - charmap.encoding = FT_ENCODING_NONE; - charmap.platform_id = 0; - charmap.encoding_id = 0; - charmap.face = root; - - if ( font->header.charset == FT_WinFNT_ID_MAC ) - { - charmap.encoding = FT_ENCODING_APPLE_ROMAN; - charmap.platform_id = 1; -/* charmap.encoding_id = 0; */ - } - - error = FT_CMap_New( fnt_cmap_class, - NULL, - &charmap, - NULL ); - if ( error ) - goto Fail; - - /* Select default charmap */ - if ( root->num_charmaps ) - root->charmap = root->charmaps[0]; - } - - /* setup remaining flags */ - - /* reserve one slot for the .notdef glyph at index 0 */ - root->num_glyphs = font->header.last_char - - font->header.first_char + 1 + 1; - - if ( font->header.face_name_offset >= font->header.file_size ) - { - FT_TRACE2(( "invalid family name offset!\n" )); - error = FNT_Err_Invalid_File_Format; - goto Fail; - } - family_size = font->header.file_size - font->header.face_name_offset; - /* Some broken fonts don't delimit the face name with a final */ - /* NULL byte -- the frame is erroneously one byte too small. */ - /* We thus allocate one more byte, setting it explicitly to */ - /* zero. */ - if ( FT_ALLOC( font->family_name, family_size + 1 ) ) - goto Fail; - - FT_MEM_COPY( font->family_name, - font->fnt_frame + font->header.face_name_offset, - family_size ); - - font->family_name[family_size] = '\0'; - - if ( FT_REALLOC( font->family_name, - family_size, - ft_strlen( font->family_name ) + 1 ) ) - goto Fail; - - root->family_name = font->family_name; - root->style_name = (char *)"Regular"; - - if ( root->style_flags & FT_STYLE_FLAG_BOLD ) - { - if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) - root->style_name = (char *)"Bold Italic"; - else - root->style_name = (char *)"Bold"; - } - else if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) - root->style_name = (char *)"Italic"; - } - goto Exit; - - Fail: - FNT_Face_Done( face ); - - Exit: - return error; - } - - - static FT_Error - FNT_Size_Select( FT_Size size ) - { - FNT_Face face = (FNT_Face)size->face; - FT_WinFNT_Header header = &face->font->header; - - - FT_Select_Metrics( size->face, 0 ); - - size->metrics.ascender = header->ascent * 64; - size->metrics.descender = -( header->pixel_height - - header->ascent ) * 64; - size->metrics.max_advance = header->max_width * 64; - - return FNT_Err_Ok; - } - - - static FT_Error - FNT_Size_Request( FT_Size size, - FT_Size_Request req ) - { - FNT_Face face = (FNT_Face)size->face; - FT_WinFNT_Header header = &face->font->header; - FT_Bitmap_Size* bsize = size->face->available_sizes; - FT_Error error = FNT_Err_Invalid_Pixel_Size; - FT_Long height; - - - height = FT_REQUEST_HEIGHT( req ); - height = ( height + 32 ) >> 6; - - switch ( req->type ) - { - case FT_SIZE_REQUEST_TYPE_NOMINAL: - if ( height == ( bsize->y_ppem + 32 ) >> 6 ) - error = FNT_Err_Ok; - break; - - case FT_SIZE_REQUEST_TYPE_REAL_DIM: - if ( height == header->pixel_height ) - error = FNT_Err_Ok; - break; - - default: - error = FNT_Err_Unimplemented_Feature; - break; - } - - if ( error ) - return error; - else - return FNT_Size_Select( size ); - } - - - static FT_Error - FNT_Load_Glyph( FT_GlyphSlot slot, - FT_Size size, - FT_UInt glyph_index, - FT_Int32 load_flags ) - { - FNT_Face face = (FNT_Face)FT_SIZE_FACE( size ); - FNT_Font font = face->font; - FT_Error error = FNT_Err_Ok; - FT_Byte* p; - FT_Int len; - FT_Bitmap* bitmap = &slot->bitmap; - FT_ULong offset; - FT_Bool new_format; - - FT_UNUSED( load_flags ); - - - if ( !face || !font || - glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) ) - { - error = FNT_Err_Invalid_Argument; - goto Exit; - } - - if ( glyph_index > 0 ) - glyph_index--; /* revert to real index */ - else - glyph_index = font->header.default_char; /* the .notdef glyph */ - - new_format = FT_BOOL( font->header.version == 0x300 ); - len = new_format ? 6 : 4; - - /* jump to glyph entry */ - p = font->fnt_frame + ( new_format ? 148 : 118 ) + len * glyph_index; - - bitmap->width = FT_NEXT_SHORT_LE( p ); - - if ( new_format ) - offset = FT_NEXT_ULONG_LE( p ); - else - offset = FT_NEXT_USHORT_LE( p ); - - if ( offset >= font->header.file_size ) - { - FT_TRACE2(( "invalid FNT offset!\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - /* jump to glyph data */ - p = font->fnt_frame + /* font->header.bits_offset */ + offset; - - /* allocate and build bitmap */ - { - FT_Memory memory = FT_FACE_MEMORY( slot->face ); - FT_Int pitch = ( bitmap->width + 7 ) >> 3; - FT_Byte* column; - FT_Byte* write; - - - bitmap->pitch = pitch; - bitmap->rows = font->header.pixel_height; - bitmap->pixel_mode = FT_PIXEL_MODE_MONO; - - if ( offset + pitch * bitmap->rows >= font->header.file_size ) - { - FT_TRACE2(( "invalid bitmap width\n" )); - error = FNT_Err_Invalid_File_Format; - goto Exit; - } - - /* note: since glyphs are stored in columns and not in rows we */ - /* can't use ft_glyphslot_set_bitmap */ - if ( FT_ALLOC_MULT( bitmap->buffer, pitch, bitmap->rows ) ) - goto Exit; - - column = (FT_Byte*)bitmap->buffer; - - for ( ; pitch > 0; pitch--, column++ ) - { - FT_Byte* limit = p + bitmap->rows; - - - for ( write = column; p < limit; p++, write += bitmap->pitch ) - *write = *p; - } - } - - slot->internal->flags = FT_GLYPH_OWN_BITMAP; - slot->bitmap_left = 0; - slot->bitmap_top = font->header.ascent; - slot->format = FT_GLYPH_FORMAT_BITMAP; - - /* now set up metrics */ - slot->metrics.width = bitmap->width << 6; - slot->metrics.height = bitmap->rows << 6; - slot->metrics.horiAdvance = bitmap->width << 6; - slot->metrics.horiBearingX = 0; - slot->metrics.horiBearingY = slot->bitmap_top << 6; - - ft_synthesize_vertical_metrics( &slot->metrics, - bitmap->rows << 6 ); - - Exit: - return error; - } - - - static FT_Error - winfnt_get_header( FT_Face face, - FT_WinFNT_HeaderRec *aheader ) - { - FNT_Font font = ((FNT_Face)face)->font; - - - *aheader = font->header; - - return 0; - } - - - static const FT_Service_WinFntRec winfnt_service_rec = - { - winfnt_get_header - }; - - /* - * SERVICE LIST - * - */ - - static const FT_ServiceDescRec winfnt_services[] = - { - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_WINFNT }, - { FT_SERVICE_ID_WINFNT, &winfnt_service_rec }, - { NULL, NULL } - }; - - - static FT_Module_Interface - winfnt_get_service( FT_Driver driver, - const FT_String* service_id ) - { - FT_UNUSED( driver ); - - return ft_service_list_lookup( winfnt_services, service_id ); - } - - - - - FT_CALLBACK_TABLE_DEF - const FT_Driver_ClassRec winfnt_driver_class = - { - { - FT_MODULE_FONT_DRIVER | - FT_MODULE_DRIVER_NO_OUTLINES, - sizeof ( FT_DriverRec ), - - "winfonts", - 0x10000L, - 0x20000L, - - 0, - - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) winfnt_get_service - }, - - sizeof( FNT_FaceRec ), - sizeof( FT_SizeRec ), - sizeof( FT_GlyphSlotRec ), - - (FT_Face_InitFunc) FNT_Face_Init, - (FT_Face_DoneFunc) FNT_Face_Done, - (FT_Size_InitFunc) 0, - (FT_Size_DoneFunc) 0, - (FT_Slot_InitFunc) 0, - (FT_Slot_DoneFunc) 0, - -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif - (FT_Slot_LoadFunc) FNT_Load_Glyph, - - (FT_Face_GetKerningFunc) 0, - (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, - - (FT_Size_RequestFunc) FNT_Size_Request, - (FT_Size_SelectFunc) FNT_Size_Select - }; - - -/* END */ +/***************************************************************************/ +/* */ +/* winfnt.c */ +/* */ +/* FreeType font driver for Windows FNT/FON files */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* Copyright 2003 Huw D M Davies for Codeweavers */ +/* Copyright 2007 Dmitry Timoshkov for Codeweavers */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include +#include FT_WINFONTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_OBJECTS_H + +#include "winfnt.h" +#include "fnterrs.h" +#include FT_SERVICE_WINFNT_H +#include FT_SERVICE_XFREE86_NAME_H + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_winfnt + + + static const FT_Frame_Field winmz_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WinMZ_HeaderRec + + FT_FRAME_START( 64 ), + FT_FRAME_USHORT_LE ( magic ), + FT_FRAME_SKIP_BYTES( 29 * 2 ), + FT_FRAME_ULONG_LE ( lfanew ), + FT_FRAME_END + }; + + static const FT_Frame_Field winne_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WinNE_HeaderRec + + FT_FRAME_START( 40 ), + FT_FRAME_USHORT_LE ( magic ), + FT_FRAME_SKIP_BYTES( 34 ), + FT_FRAME_USHORT_LE ( resource_tab_offset ), + FT_FRAME_USHORT_LE ( rname_tab_offset ), + FT_FRAME_END + }; + + static const FT_Frame_Field winpe32_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WinPE32_HeaderRec + + FT_FRAME_START( 248 ), + FT_FRAME_ULONG_LE ( magic ), /* PE00 */ + FT_FRAME_USHORT_LE ( machine ), /* 0x014c - i386 */ + FT_FRAME_USHORT_LE ( number_of_sections ), + FT_FRAME_SKIP_BYTES( 12 ), + FT_FRAME_USHORT_LE ( size_of_optional_header ), + FT_FRAME_SKIP_BYTES( 2 ), + FT_FRAME_USHORT_LE ( magic32 ), /* 0x10b */ + FT_FRAME_SKIP_BYTES( 110 ), + FT_FRAME_ULONG_LE ( rsrc_virtual_address ), + FT_FRAME_ULONG_LE ( rsrc_size ), + FT_FRAME_SKIP_BYTES( 104 ), + FT_FRAME_END + }; + + static const FT_Frame_Field winpe32_section_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WinPE32_SectionRec + + FT_FRAME_START( 40 ), + FT_FRAME_BYTES ( name, 8 ), + FT_FRAME_SKIP_BYTES( 4 ), + FT_FRAME_ULONG_LE ( virtual_address ), + FT_FRAME_ULONG_LE ( size_of_raw_data ), + FT_FRAME_ULONG_LE ( pointer_to_raw_data ), + FT_FRAME_SKIP_BYTES( 16 ), + FT_FRAME_END + }; + + static const FT_Frame_Field winpe_rsrc_dir_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WinPE_RsrcDirRec + + FT_FRAME_START( 16 ), + FT_FRAME_ULONG_LE ( characteristics ), + FT_FRAME_ULONG_LE ( time_date_stamp ), + FT_FRAME_USHORT_LE( major_version ), + FT_FRAME_USHORT_LE( minor_version ), + FT_FRAME_USHORT_LE( number_of_named_entries ), + FT_FRAME_USHORT_LE( number_of_id_entries ), + FT_FRAME_END + }; + + static const FT_Frame_Field winpe_rsrc_dir_entry_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WinPE_RsrcDirEntryRec + + FT_FRAME_START( 8 ), + FT_FRAME_ULONG_LE( name ), + FT_FRAME_ULONG_LE( offset ), + FT_FRAME_END + }; + + static const FT_Frame_Field winpe_rsrc_data_entry_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WinPE_RsrcDataEntryRec + + FT_FRAME_START( 16 ), + FT_FRAME_ULONG_LE( offset_to_data ), + FT_FRAME_ULONG_LE( size ), + FT_FRAME_ULONG_LE( code_page ), + FT_FRAME_ULONG_LE( reserved ), + FT_FRAME_END + }; + + static const FT_Frame_Field winfnt_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE FT_WinFNT_HeaderRec + + FT_FRAME_START( 148 ), + FT_FRAME_USHORT_LE( version ), + FT_FRAME_ULONG_LE ( file_size ), + FT_FRAME_BYTES ( copyright, 60 ), + FT_FRAME_USHORT_LE( file_type ), + FT_FRAME_USHORT_LE( nominal_point_size ), + FT_FRAME_USHORT_LE( vertical_resolution ), + FT_FRAME_USHORT_LE( horizontal_resolution ), + FT_FRAME_USHORT_LE( ascent ), + FT_FRAME_USHORT_LE( internal_leading ), + FT_FRAME_USHORT_LE( external_leading ), + FT_FRAME_BYTE ( italic ), + FT_FRAME_BYTE ( underline ), + FT_FRAME_BYTE ( strike_out ), + FT_FRAME_USHORT_LE( weight ), + FT_FRAME_BYTE ( charset ), + FT_FRAME_USHORT_LE( pixel_width ), + FT_FRAME_USHORT_LE( pixel_height ), + FT_FRAME_BYTE ( pitch_and_family ), + FT_FRAME_USHORT_LE( avg_width ), + FT_FRAME_USHORT_LE( max_width ), + FT_FRAME_BYTE ( first_char ), + FT_FRAME_BYTE ( last_char ), + FT_FRAME_BYTE ( default_char ), + FT_FRAME_BYTE ( break_char ), + FT_FRAME_USHORT_LE( bytes_per_row ), + FT_FRAME_ULONG_LE ( device_offset ), + FT_FRAME_ULONG_LE ( face_name_offset ), + FT_FRAME_ULONG_LE ( bits_pointer ), + FT_FRAME_ULONG_LE ( bits_offset ), + FT_FRAME_BYTE ( reserved ), + FT_FRAME_ULONG_LE ( flags ), + FT_FRAME_USHORT_LE( A_space ), + FT_FRAME_USHORT_LE( B_space ), + FT_FRAME_USHORT_LE( C_space ), + FT_FRAME_ULONG_LE ( color_table_offset ), + FT_FRAME_BYTES ( reserved1, 16 ), + FT_FRAME_END + }; + + + static void + fnt_font_done( FNT_Face face ) + { + FT_Memory memory = FT_FACE( face )->memory; + FT_Stream stream = FT_FACE( face )->stream; + FNT_Font font = face->font; + + + if ( !font ) + return; + + if ( font->fnt_frame ) + FT_FRAME_RELEASE( font->fnt_frame ); + FT_FREE( font->family_name ); + + FT_FREE( font ); + face->font = 0; + } + + + static FT_Error + fnt_font_load( FNT_Font font, + FT_Stream stream ) + { + FT_Error error; + FT_WinFNT_Header header = &font->header; + FT_Bool new_format; + FT_UInt size; + + + /* first of all, read the FNT header */ + if ( FT_STREAM_SEEK( font->offset ) || + FT_STREAM_READ_FIELDS( winfnt_header_fields, header ) ) + goto Exit; + + /* check header */ + if ( header->version != 0x200 && + header->version != 0x300 ) + { + FT_TRACE2(( "[not a valid FNT file]\n" )); + error = FNT_Err_Unknown_File_Format; + goto Exit; + } + + new_format = FT_BOOL( font->header.version == 0x300 ); + size = new_format ? 148 : 118; + + if ( header->file_size < size ) + { + FT_TRACE2(( "[not a valid FNT file]\n" )); + error = FNT_Err_Unknown_File_Format; + goto Exit; + } + + /* Version 2 doesn't have these fields */ + if ( header->version == 0x200 ) + { + header->flags = 0; + header->A_space = 0; + header->B_space = 0; + header->C_space = 0; + + header->color_table_offset = 0; + } + + if ( header->file_type & 1 ) + { + FT_TRACE2(( "[can't handle vector FNT fonts]\n" )); + error = FNT_Err_Unknown_File_Format; + goto Exit; + } + + /* this is a FNT file/table; extract its frame */ + if ( FT_STREAM_SEEK( font->offset ) || + FT_FRAME_EXTRACT( header->file_size, font->fnt_frame ) ) + goto Exit; + + Exit: + return error; + } + + + static FT_Error + fnt_face_get_dll_font( FNT_Face face, + FT_Int face_index ) + { + FT_Error error; + FT_Stream stream = FT_FACE( face )->stream; + FT_Memory memory = FT_FACE( face )->memory; + WinMZ_HeaderRec mz_header; + + + face->font = 0; + + /* does it begin with an MZ header? */ + if ( FT_STREAM_SEEK( 0 ) || + FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) ) + goto Exit; + + error = FNT_Err_Unknown_File_Format; + if ( mz_header.magic == WINFNT_MZ_MAGIC ) + { + /* yes, now look for an NE header in the file */ + WinNE_HeaderRec ne_header; + + + FT_TRACE2(( "MZ signature found\n" )); + + if ( FT_STREAM_SEEK( mz_header.lfanew ) || + FT_STREAM_READ_FIELDS( winne_header_fields, &ne_header ) ) + goto Exit; + + error = FNT_Err_Unknown_File_Format; + if ( ne_header.magic == WINFNT_NE_MAGIC ) + { + /* good, now look into the resource table for each FNT resource */ + FT_ULong res_offset = mz_header.lfanew + + ne_header.resource_tab_offset; + FT_UShort size_shift; + FT_UShort font_count = 0; + FT_ULong font_offset = 0; + + + FT_TRACE2(( "NE signature found\n" )); + + if ( FT_STREAM_SEEK( res_offset ) || + FT_FRAME_ENTER( ne_header.rname_tab_offset - + ne_header.resource_tab_offset ) ) + goto Exit; + + size_shift = FT_GET_USHORT_LE(); + + for (;;) + { + FT_UShort type_id, count; + + + type_id = FT_GET_USHORT_LE(); + if ( !type_id ) + break; + + count = FT_GET_USHORT_LE(); + + if ( type_id == 0x8008U ) + { + font_count = count; + font_offset = (FT_ULong)( FT_STREAM_POS() + 4 + + ( stream->cursor - stream->limit ) ); + break; + } + + stream->cursor += 4 + count * 12; + } + + FT_FRAME_EXIT(); + + if ( !font_count || !font_offset ) + { + FT_TRACE2(( "this file doesn't contain any FNT resources!\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + /* loading `winfnt_header_fields' needs at least 118 bytes; */ + /* use this as a rough measure to check the expected font size */ + if ( font_count * 118UL > stream->size ) + { + FT_TRACE2(( "invalid number of faces\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + face->root.num_faces = font_count; + + if ( face_index >= font_count ) + { + error = FNT_Err_Bad_Argument; + goto Exit; + } + + if ( FT_NEW( face->font ) ) + goto Exit; + + if ( FT_STREAM_SEEK( font_offset + face_index * 12 ) || + FT_FRAME_ENTER( 12 ) ) + goto Fail; + + face->font->offset = (FT_ULong)FT_GET_USHORT_LE() << size_shift; + face->font->fnt_size = (FT_ULong)FT_GET_USHORT_LE() << size_shift; + + stream->cursor += 8; + + FT_FRAME_EXIT(); + + error = fnt_font_load( face->font, stream ); + } + else if ( ne_header.magic == WINFNT_PE_MAGIC ) + { + WinPE32_HeaderRec pe32_header; + WinPE32_SectionRec pe32_section; + WinPE_RsrcDirRec root_dir, name_dir, lang_dir; + WinPE_RsrcDirEntryRec dir_entry1, dir_entry2, dir_entry3; + WinPE_RsrcDataEntryRec data_entry; + + FT_Long root_dir_offset, name_dir_offset, lang_dir_offset; + FT_UShort i, j, k; + + + FT_TRACE2(( "PE signature found\n" )); + + if ( FT_STREAM_SEEK( mz_header.lfanew ) || + FT_STREAM_READ_FIELDS( winpe32_header_fields, &pe32_header ) ) + goto Exit; + + FT_TRACE2(( "magic %04lx, machine %02x, number_of_sections %u, " + "size_of_optional_header %02x\n" + "magic32 %02x, rsrc_virtual_address %04lx, " + "rsrc_size %04lx\n", + pe32_header.magic, pe32_header.machine, + pe32_header.number_of_sections, + pe32_header.size_of_optional_header, + pe32_header.magic32, pe32_header.rsrc_virtual_address, + pe32_header.rsrc_size )); + + if ( pe32_header.magic != WINFNT_PE_MAGIC /* check full signature */ || + pe32_header.machine != 0x014c /* i386 */ || + pe32_header.size_of_optional_header != 0xe0 /* FIXME */ || + pe32_header.magic32 != 0x10b ) + { + FT_TRACE2(( "this file has an invalid PE header\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + face->root.num_faces = 0; + + for ( i = 0; i < pe32_header.number_of_sections; i++ ) + { + if ( FT_STREAM_READ_FIELDS( winpe32_section_fields, + &pe32_section ) ) + goto Exit; + + FT_TRACE2(( "name %.8s, va %04lx, size %04lx, offset %04lx\n", + pe32_section.name, pe32_section.virtual_address, + pe32_section.size_of_raw_data, + pe32_section.pointer_to_raw_data )); + + if ( pe32_header.rsrc_virtual_address == + pe32_section.virtual_address ) + goto Found_rsrc_section; + } + + FT_TRACE2(( "this file doesn't contain any resources\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + + Found_rsrc_section: + FT_TRACE2(( "found resources section %.8s\n", pe32_section.name )); + + if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data ) || + FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &root_dir ) ) + goto Exit; + + root_dir_offset = pe32_section.pointer_to_raw_data; + + for ( i = 0; i < root_dir.number_of_named_entries + + root_dir.number_of_id_entries; i++ ) + { + if ( FT_STREAM_SEEK( root_dir_offset + 16 + i * 8 ) || + FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields, + &dir_entry1 ) ) + goto Exit; + + if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ ) + { + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + dir_entry1.offset &= ~0x80000000UL; + + name_dir_offset = pe32_section.pointer_to_raw_data + + dir_entry1.offset; + + if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data + + dir_entry1.offset ) || + FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &name_dir ) ) + goto Exit; + + for ( j = 0; j < name_dir.number_of_named_entries + + name_dir.number_of_id_entries; j++ ) + { + if ( FT_STREAM_SEEK( name_dir_offset + 16 + j * 8 ) || + FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields, + &dir_entry2 ) ) + goto Exit; + + if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ ) + { + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + dir_entry2.offset &= ~0x80000000UL; + + lang_dir_offset = pe32_section.pointer_to_raw_data + + dir_entry2.offset; + + if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data + + dir_entry2.offset ) || + FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &lang_dir ) ) + goto Exit; + + for ( k = 0; k < lang_dir.number_of_named_entries + + lang_dir.number_of_id_entries; k++ ) + { + if ( FT_STREAM_SEEK( lang_dir_offset + 16 + k * 8 ) || + FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields, + &dir_entry3 ) ) + goto Exit; + + if ( dir_entry2.offset & 0x80000000UL /* DataIsDirectory */ ) + { + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + if ( dir_entry1.name == 8 /* RT_FONT */ ) + { + if ( FT_STREAM_SEEK( root_dir_offset + dir_entry3.offset ) || + FT_STREAM_READ_FIELDS( winpe_rsrc_data_entry_fields, + &data_entry ) ) + goto Exit; + + FT_TRACE2(( "found font #%lu, offset %04lx, " + "size %04lx, cp %lu\n", + dir_entry2.name, + pe32_section.pointer_to_raw_data + + data_entry.offset_to_data - + pe32_section.virtual_address, + data_entry.size, data_entry.code_page )); + + if ( face_index == face->root.num_faces ) + { + if ( FT_NEW( face->font ) ) + goto Exit; + + face->font->offset = pe32_section.pointer_to_raw_data + + data_entry.offset_to_data - + pe32_section.virtual_address; + face->font->fnt_size = data_entry.size; + + error = fnt_font_load( face->font, stream ); + if ( error ) + { + FT_TRACE2(( "font #%lu load error %d\n", + dir_entry2.name, error )); + goto Fail; + } + else + FT_TRACE2(( "font #%lu successfully loaded\n", + dir_entry2.name )); + } + + face->root.num_faces++; + } + } + } + } + } + + if ( !face->root.num_faces ) + { + FT_TRACE2(( "this file doesn't contain any RT_FONT resources\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + if ( face_index >= face->root.num_faces ) + { + error = FNT_Err_Bad_Argument; + goto Exit; + } + } + + Fail: + if ( error ) + fnt_font_done( face ); + + Exit: + return error; + } + + + typedef struct FNT_CMapRec_ + { + FT_CMapRec cmap; + FT_UInt32 first; + FT_UInt32 count; + + } FNT_CMapRec, *FNT_CMap; + + + static FT_Error + fnt_cmap_init( FNT_CMap cmap ) + { + FNT_Face face = (FNT_Face)FT_CMAP_FACE( cmap ); + FNT_Font font = face->font; + + + cmap->first = (FT_UInt32) font->header.first_char; + cmap->count = (FT_UInt32)( font->header.last_char - cmap->first + 1 ); + + return 0; + } + + + static FT_UInt + fnt_cmap_char_index( FNT_CMap cmap, + FT_UInt32 char_code ) + { + FT_UInt gindex = 0; + + + char_code -= cmap->first; + if ( char_code < cmap->count ) + gindex = char_code + 1; /* we artificially increase the glyph index; */ + /* FNT_Load_Glyph reverts to the right one */ + return gindex; + } + + + static FT_UInt + fnt_cmap_char_next( FNT_CMap cmap, + FT_UInt32 *pchar_code ) + { + FT_UInt gindex = 0; + FT_UInt32 result = 0; + FT_UInt32 char_code = *pchar_code + 1; + + + if ( char_code <= cmap->first ) + { + result = cmap->first; + gindex = 1; + } + else + { + char_code -= cmap->first; + if ( char_code < cmap->count ) + { + result = cmap->first + char_code; + gindex = char_code + 1; + } + } + + *pchar_code = result; + return gindex; + } + + + static const FT_CMap_ClassRec fnt_cmap_class_rec = + { + sizeof ( FNT_CMapRec ), + + (FT_CMap_InitFunc) fnt_cmap_init, + (FT_CMap_DoneFunc) NULL, + (FT_CMap_CharIndexFunc)fnt_cmap_char_index, + (FT_CMap_CharNextFunc) fnt_cmap_char_next + }; + + static FT_CMap_Class const fnt_cmap_class = &fnt_cmap_class_rec; + + + static void + FNT_Face_Done( FNT_Face face ) + { + if ( face ) + { + FT_Memory memory = FT_FACE_MEMORY( face ); + + + fnt_font_done( face ); + + FT_FREE( face->root.available_sizes ); + face->root.num_fixed_sizes = 0; + } + } + + + static FT_Error + FNT_Face_Init( FT_Stream stream, + FNT_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error; + FT_Memory memory = FT_FACE_MEMORY( face ); + + FT_UNUSED( num_params ); + FT_UNUSED( params ); + + + /* try to load font from a DLL */ + error = fnt_face_get_dll_font( face, face_index ); + if ( error == FNT_Err_Unknown_File_Format ) + { + /* this didn't work; try to load a single FNT font */ + FNT_Font font; + + + if ( face_index > 0 ) + { + error = FNT_Err_Bad_Argument; + goto Exit; + } + + if ( FT_NEW( face->font ) ) + goto Exit; + + face->root.num_faces = 1; + + font = face->font; + font->offset = 0; + font->fnt_size = stream->size; + + error = fnt_font_load( font, stream ); + } + + if ( error ) + goto Fail; + + /* we now need to fill the root FT_Face fields */ + /* with relevant information */ + { + FT_Face root = FT_FACE( face ); + FNT_Font font = face->font; + FT_PtrDist family_size; + + + root->face_flags = FT_FACE_FLAG_FIXED_SIZES | + FT_FACE_FLAG_HORIZONTAL; + + if ( font->header.avg_width == font->header.max_width ) + root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + + if ( font->header.italic ) + root->style_flags |= FT_STYLE_FLAG_ITALIC; + + if ( font->header.weight >= 800 ) + root->style_flags |= FT_STYLE_FLAG_BOLD; + + /* set up the `fixed_sizes' array */ + if ( FT_NEW_ARRAY( root->available_sizes, 1 ) ) + goto Fail; + + root->num_fixed_sizes = 1; + + { + FT_Bitmap_Size* bsize = root->available_sizes; + FT_UShort x_res, y_res; + + + bsize->width = font->header.avg_width; + bsize->height = (FT_Short)( + font->header.pixel_height + font->header.external_leading ); + bsize->size = font->header.nominal_point_size << 6; + + x_res = font->header.horizontal_resolution; + if ( !x_res ) + x_res = 72; + + y_res = font->header.vertical_resolution; + if ( !y_res ) + y_res = 72; + + bsize->y_ppem = FT_MulDiv( bsize->size, y_res, 72 ); + bsize->y_ppem = FT_PIX_ROUND( bsize->y_ppem ); + + /* + * this reads: + * + * the nominal height is larger than the bbox's height + * + * => nominal_point_size contains incorrect value; + * use pixel_height as the nominal height + */ + if ( bsize->y_ppem > font->header.pixel_height << 6 ) + { + FT_TRACE2(( "use pixel_height as the nominal height\n" )); + + bsize->y_ppem = font->header.pixel_height << 6; + bsize->size = FT_MulDiv( bsize->y_ppem, 72, y_res ); + } + + bsize->x_ppem = FT_MulDiv( bsize->size, x_res, 72 ); + bsize->x_ppem = FT_PIX_ROUND( bsize->x_ppem ); + } + + { + FT_CharMapRec charmap; + + + charmap.encoding = FT_ENCODING_NONE; + charmap.platform_id = 0; + charmap.encoding_id = 0; + charmap.face = root; + + if ( font->header.charset == FT_WinFNT_ID_MAC ) + { + charmap.encoding = FT_ENCODING_APPLE_ROMAN; + charmap.platform_id = 1; +/* charmap.encoding_id = 0; */ + } + + error = FT_CMap_New( fnt_cmap_class, + NULL, + &charmap, + NULL ); + if ( error ) + goto Fail; + + /* Select default charmap */ + if ( root->num_charmaps ) + root->charmap = root->charmaps[0]; + } + + /* setup remaining flags */ + + /* reserve one slot for the .notdef glyph at index 0 */ + root->num_glyphs = font->header.last_char - + font->header.first_char + 1 + 1; + + if ( font->header.face_name_offset >= font->header.file_size ) + { + FT_TRACE2(( "invalid family name offset!\n" )); + error = FNT_Err_Invalid_File_Format; + goto Fail; + } + family_size = font->header.file_size - font->header.face_name_offset; + /* Some broken fonts don't delimit the face name with a final */ + /* NULL byte -- the frame is erroneously one byte too small. */ + /* We thus allocate one more byte, setting it explicitly to */ + /* zero. */ + if ( FT_ALLOC( font->family_name, family_size + 1 ) ) + goto Fail; + + FT_MEM_COPY( font->family_name, + font->fnt_frame + font->header.face_name_offset, + family_size ); + + font->family_name[family_size] = '\0'; + + if ( FT_REALLOC( font->family_name, + family_size, + ft_strlen( font->family_name ) + 1 ) ) + goto Fail; + + root->family_name = font->family_name; + root->style_name = (char *)"Regular"; + + if ( root->style_flags & FT_STYLE_FLAG_BOLD ) + { + if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Bold Italic"; + else + root->style_name = (char *)"Bold"; + } + else if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Italic"; + } + goto Exit; + + Fail: + FNT_Face_Done( face ); + + Exit: + return error; + } + + + static FT_Error + FNT_Size_Select( FT_Size size ) + { + FNT_Face face = (FNT_Face)size->face; + FT_WinFNT_Header header = &face->font->header; + + + FT_Select_Metrics( size->face, 0 ); + + size->metrics.ascender = header->ascent * 64; + size->metrics.descender = -( header->pixel_height - + header->ascent ) * 64; + size->metrics.max_advance = header->max_width * 64; + + return FNT_Err_Ok; + } + + + static FT_Error + FNT_Size_Request( FT_Size size, + FT_Size_Request req ) + { + FNT_Face face = (FNT_Face)size->face; + FT_WinFNT_Header header = &face->font->header; + FT_Bitmap_Size* bsize = size->face->available_sizes; + FT_Error error = FNT_Err_Invalid_Pixel_Size; + FT_Long height; + + + height = FT_REQUEST_HEIGHT( req ); + height = ( height + 32 ) >> 6; + + switch ( req->type ) + { + case FT_SIZE_REQUEST_TYPE_NOMINAL: + if ( height == ( bsize->y_ppem + 32 ) >> 6 ) + error = FNT_Err_Ok; + break; + + case FT_SIZE_REQUEST_TYPE_REAL_DIM: + if ( height == header->pixel_height ) + error = FNT_Err_Ok; + break; + + default: + error = FNT_Err_Unimplemented_Feature; + break; + } + + if ( error ) + return error; + else + return FNT_Size_Select( size ); + } + + + static FT_Error + FNT_Load_Glyph( FT_GlyphSlot slot, + FT_Size size, + FT_UInt glyph_index, + FT_Int32 load_flags ) + { + FNT_Face face = (FNT_Face)FT_SIZE_FACE( size ); + FNT_Font font = face->font; + FT_Error error = FNT_Err_Ok; + FT_Byte* p; + FT_Int len; + FT_Bitmap* bitmap = &slot->bitmap; + FT_ULong offset; + FT_Bool new_format; + + FT_UNUSED( load_flags ); + + + if ( !face || !font || + glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) ) + { + error = FNT_Err_Invalid_Argument; + goto Exit; + } + + if ( glyph_index > 0 ) + glyph_index--; /* revert to real index */ + else + glyph_index = font->header.default_char; /* the .notdef glyph */ + + new_format = FT_BOOL( font->header.version == 0x300 ); + len = new_format ? 6 : 4; + + /* jump to glyph entry */ + p = font->fnt_frame + ( new_format ? 148 : 118 ) + len * glyph_index; + + bitmap->width = FT_NEXT_SHORT_LE( p ); + + if ( new_format ) + offset = FT_NEXT_ULONG_LE( p ); + else + offset = FT_NEXT_USHORT_LE( p ); + + if ( offset >= font->header.file_size ) + { + FT_TRACE2(( "invalid FNT offset!\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + /* jump to glyph data */ + p = font->fnt_frame + /* font->header.bits_offset */ + offset; + + /* allocate and build bitmap */ + { + FT_Memory memory = FT_FACE_MEMORY( slot->face ); + FT_Int pitch = ( bitmap->width + 7 ) >> 3; + FT_Byte* column; + FT_Byte* write; + + + bitmap->pitch = pitch; + bitmap->rows = font->header.pixel_height; + bitmap->pixel_mode = FT_PIXEL_MODE_MONO; + + if ( offset + pitch * bitmap->rows >= font->header.file_size ) + { + FT_TRACE2(( "invalid bitmap width\n" )); + error = FNT_Err_Invalid_File_Format; + goto Exit; + } + + /* note: since glyphs are stored in columns and not in rows we */ + /* can't use ft_glyphslot_set_bitmap */ + if ( FT_ALLOC_MULT( bitmap->buffer, pitch, bitmap->rows ) ) + goto Exit; + + column = (FT_Byte*)bitmap->buffer; + + for ( ; pitch > 0; pitch--, column++ ) + { + FT_Byte* limit = p + bitmap->rows; + + + for ( write = column; p < limit; p++, write += bitmap->pitch ) + *write = *p; + } + } + + slot->internal->flags = FT_GLYPH_OWN_BITMAP; + slot->bitmap_left = 0; + slot->bitmap_top = font->header.ascent; + slot->format = FT_GLYPH_FORMAT_BITMAP; + + /* now set up metrics */ + slot->metrics.width = bitmap->width << 6; + slot->metrics.height = bitmap->rows << 6; + slot->metrics.horiAdvance = bitmap->width << 6; + slot->metrics.horiBearingX = 0; + slot->metrics.horiBearingY = slot->bitmap_top << 6; + + ft_synthesize_vertical_metrics( &slot->metrics, + bitmap->rows << 6 ); + + Exit: + return error; + } + + + static FT_Error + winfnt_get_header( FT_Face face, + FT_WinFNT_HeaderRec *aheader ) + { + FNT_Font font = ((FNT_Face)face)->font; + + + *aheader = font->header; + + return 0; + } + + + static const FT_Service_WinFntRec winfnt_service_rec = + { + winfnt_get_header + }; + + /* + * SERVICE LIST + * + */ + + static const FT_ServiceDescRec winfnt_services[] = + { + { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_WINFNT }, + { FT_SERVICE_ID_WINFNT, &winfnt_service_rec }, + { NULL, NULL } + }; + + + static FT_Module_Interface + winfnt_get_service( FT_Driver driver, + const FT_String* service_id ) + { + FT_UNUSED( driver ); + + return ft_service_list_lookup( winfnt_services, service_id ); + } + + + + + FT_CALLBACK_TABLE_DEF + const FT_Driver_ClassRec winfnt_driver_class = + { + { + FT_MODULE_FONT_DRIVER | + FT_MODULE_DRIVER_NO_OUTLINES, + sizeof ( FT_DriverRec ), + + "winfonts", + 0x10000L, + 0x20000L, + + 0, + + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) winfnt_get_service + }, + + sizeof( FNT_FaceRec ), + sizeof( FT_SizeRec ), + sizeof( FT_GlyphSlotRec ), + + (FT_Face_InitFunc) FNT_Face_Init, + (FT_Face_DoneFunc) FNT_Face_Done, + (FT_Size_InitFunc) 0, + (FT_Size_DoneFunc) 0, + (FT_Slot_InitFunc) 0, + (FT_Slot_DoneFunc) 0, + +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS + ft_stub_set_char_sizes, + ft_stub_set_pixel_sizes, +#endif + (FT_Slot_LoadFunc) FNT_Load_Glyph, + + (FT_Face_GetKerningFunc) 0, + (FT_Face_AttachFunc) 0, + (FT_Face_GetAdvancesFunc) 0, + + (FT_Size_RequestFunc) FNT_Size_Request, + (FT_Size_SelectFunc) FNT_Size_Select + }; + + +/* END */ diff --git a/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.h b/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.h index ca75c9501a2..94370104872 100644 --- a/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.h +++ b/reactos/dll/3rdparty/freetype/src/winfonts/winfnt.h @@ -1,167 +1,167 @@ -/***************************************************************************/ -/* */ -/* winfnt.h */ -/* */ -/* FreeType font driver for Windows FNT/FON files */ -/* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2007 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* Copyright 2007 Dmitry Timoshkov for Codeweavers */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __WINFNT_H__ -#define __WINFNT_H__ - - -#include -#include FT_WINFONTS_H -#include FT_INTERNAL_DRIVER_H - - -FT_BEGIN_HEADER - - typedef struct WinMZ_HeaderRec_ - { - FT_UShort magic; - /* skipped content */ - FT_UShort lfanew; - - } WinMZ_HeaderRec; - - - typedef struct WinNE_HeaderRec_ - { - FT_UShort magic; - /* skipped content */ - FT_UShort resource_tab_offset; - FT_UShort rname_tab_offset; - - } WinNE_HeaderRec; - - - typedef struct WinPE32_HeaderRec_ - { - FT_ULong magic; - FT_UShort machine; - FT_UShort number_of_sections; - /* skipped content */ - FT_UShort size_of_optional_header; - /* skipped content */ - FT_UShort magic32; - /* skipped content */ - FT_ULong rsrc_virtual_address; - FT_ULong rsrc_size; - /* skipped content */ - - } WinPE32_HeaderRec; - - - typedef struct WinPE32_SectionRec_ - { - FT_Byte name[8]; - /* skipped content */ - FT_ULong virtual_address; - FT_ULong size_of_raw_data; - FT_ULong pointer_to_raw_data; - /* skipped content */ - - } WinPE32_SectionRec; - - - typedef struct WinPE_RsrcDirRec_ - { - FT_ULong characteristics; - FT_ULong time_date_stamp; - FT_UShort major_version; - FT_UShort minor_version; - FT_UShort number_of_named_entries; - FT_UShort number_of_id_entries; - - } WinPE_RsrcDirRec; - - - typedef struct WinPE_RsrcDirEntryRec_ - { - FT_ULong name; - FT_ULong offset; - - } WinPE_RsrcDirEntryRec; - - - typedef struct WinPE_RsrcDataEntryRec_ - { - FT_ULong offset_to_data; - FT_ULong size; - FT_ULong code_page; - FT_ULong reserved; - - } WinPE_RsrcDataEntryRec; - - - typedef struct WinNameInfoRec_ - { - FT_UShort offset; - FT_UShort length; - FT_UShort flags; - FT_UShort id; - FT_UShort handle; - FT_UShort usage; - - } WinNameInfoRec; - - - typedef struct WinResourceInfoRec_ - { - FT_UShort type_id; - FT_UShort count; - - } WinResourceInfoRec; - - -#define WINFNT_MZ_MAGIC 0x5A4D -#define WINFNT_NE_MAGIC 0x454E -#define WINFNT_PE_MAGIC 0x4550 - - - typedef struct FNT_FontRec_ - { - FT_ULong offset; - - FT_WinFNT_HeaderRec header; - - FT_Byte* fnt_frame; - FT_ULong fnt_size; - FT_String* family_name; - - } FNT_FontRec, *FNT_Font; - - - typedef struct FNT_FaceRec_ - { - FT_FaceRec root; - FNT_Font font; - - FT_CharMap charmap_handle; - FT_CharMapRec charmap; /* a single charmap per face */ - - } FNT_FaceRec, *FNT_Face; - - - FT_EXPORT_VAR( const FT_Driver_ClassRec ) winfnt_driver_class; - - -FT_END_HEADER - - -#endif /* __WINFNT_H__ */ - - -/* END */ +/***************************************************************************/ +/* */ +/* winfnt.h */ +/* */ +/* FreeType font driver for Windows FNT/FON files */ +/* */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* Copyright 2007 Dmitry Timoshkov for Codeweavers */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __WINFNT_H__ +#define __WINFNT_H__ + + +#include +#include FT_WINFONTS_H +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER + + typedef struct WinMZ_HeaderRec_ + { + FT_UShort magic; + /* skipped content */ + FT_UShort lfanew; + + } WinMZ_HeaderRec; + + + typedef struct WinNE_HeaderRec_ + { + FT_UShort magic; + /* skipped content */ + FT_UShort resource_tab_offset; + FT_UShort rname_tab_offset; + + } WinNE_HeaderRec; + + + typedef struct WinPE32_HeaderRec_ + { + FT_ULong magic; + FT_UShort machine; + FT_UShort number_of_sections; + /* skipped content */ + FT_UShort size_of_optional_header; + /* skipped content */ + FT_UShort magic32; + /* skipped content */ + FT_ULong rsrc_virtual_address; + FT_ULong rsrc_size; + /* skipped content */ + + } WinPE32_HeaderRec; + + + typedef struct WinPE32_SectionRec_ + { + FT_Byte name[8]; + /* skipped content */ + FT_ULong virtual_address; + FT_ULong size_of_raw_data; + FT_ULong pointer_to_raw_data; + /* skipped content */ + + } WinPE32_SectionRec; + + + typedef struct WinPE_RsrcDirRec_ + { + FT_ULong characteristics; + FT_ULong time_date_stamp; + FT_UShort major_version; + FT_UShort minor_version; + FT_UShort number_of_named_entries; + FT_UShort number_of_id_entries; + + } WinPE_RsrcDirRec; + + + typedef struct WinPE_RsrcDirEntryRec_ + { + FT_ULong name; + FT_ULong offset; + + } WinPE_RsrcDirEntryRec; + + + typedef struct WinPE_RsrcDataEntryRec_ + { + FT_ULong offset_to_data; + FT_ULong size; + FT_ULong code_page; + FT_ULong reserved; + + } WinPE_RsrcDataEntryRec; + + + typedef struct WinNameInfoRec_ + { + FT_UShort offset; + FT_UShort length; + FT_UShort flags; + FT_UShort id; + FT_UShort handle; + FT_UShort usage; + + } WinNameInfoRec; + + + typedef struct WinResourceInfoRec_ + { + FT_UShort type_id; + FT_UShort count; + + } WinResourceInfoRec; + + +#define WINFNT_MZ_MAGIC 0x5A4D +#define WINFNT_NE_MAGIC 0x454E +#define WINFNT_PE_MAGIC 0x4550 + + + typedef struct FNT_FontRec_ + { + FT_ULong offset; + + FT_WinFNT_HeaderRec header; + + FT_Byte* fnt_frame; + FT_ULong fnt_size; + FT_String* family_name; + + } FNT_FontRec, *FNT_Font; + + + typedef struct FNT_FaceRec_ + { + FT_FaceRec root; + FNT_Font font; + + FT_CharMap charmap_handle; + FT_CharMapRec charmap; /* a single charmap per face */ + + } FNT_FaceRec, *FNT_Face; + + + FT_EXPORT_VAR( const FT_Driver_ClassRec ) winfnt_driver_class; + + +FT_END_HEADER + + +#endif /* __WINFNT_H__ */ + + +/* END */ diff --git a/reactos/dll/3rdparty/mesa32/include/GL/amesa.h b/reactos/dll/3rdparty/mesa32/include/GL/amesa.h index 852d34cf4f5..84c9d1c676a 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/amesa.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/amesa.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 3.3 - * + * * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/include/GL/directfbgl.h b/reactos/dll/3rdparty/mesa32/include/GL/directfbgl.h index 984c4b14279..00c742309e3 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/directfbgl.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/directfbgl.h @@ -37,7 +37,7 @@ typedef struct { int depth_size; int stencil_size; int aux_buffers; - + int red_size; int green_size; int blue_size; diff --git a/reactos/dll/3rdparty/mesa32/include/GL/dmesa.h b/reactos/dll/3rdparty/mesa32/include/GL/dmesa.h index e67b3426f93..a418098742c 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/dmesa.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/dmesa.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.1 - * + * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/include/GL/ggimesa.h b/reactos/dll/3rdparty/mesa32/include/GL/ggimesa.h index 90e0b422225..879f9e31f19 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/ggimesa.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/ggimesa.h @@ -33,7 +33,7 @@ extern "C" { #include #include "GL/gl.h" - + typedef struct ggi_mesa_context *ggi_mesa_context_t; /* diff --git a/reactos/dll/3rdparty/mesa32/include/GL/gl.h b/reactos/dll/3rdparty/mesa32/include/GL/gl.h index 1ea97f39078..d0c103855b9 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/gl.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/gl.h @@ -34,7 +34,7 @@ /********************************************************************** * Begin system-specific stuff. Do not do any of this when building * for SciTech SNAP, as this is all done before this header file is - * included. + * included. */ #if !defined(__SCITECH_SNAP__) diff --git a/reactos/dll/3rdparty/mesa32/include/GL/glext.h b/reactos/dll/3rdparty/mesa32/include/GL/glext.h index 7bb8e6e7cc7..9d96731cb2a 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/glext.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/glext.h @@ -13,21 +13,21 @@ extern "C" { ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: This software was created using the ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has ** not been independently verified as being compliant with the OpenGL(R) diff --git a/reactos/dll/3rdparty/mesa32/include/GL/glu.h b/reactos/dll/3rdparty/mesa32/include/GL/glu.h index c0bac75a8cc..09a2b91222f 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/glu.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/glu.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: This software was created using the ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has ** not been independently verified as being compliant with the OpenGL(R) diff --git a/reactos/dll/3rdparty/mesa32/include/GL/glx.h b/reactos/dll/3rdparty/mesa32/include/GL/glx.h index ab0467c1886..eff65f3c352 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/glx.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/glx.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.3 - * + * * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -472,7 +472,7 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); /* * ???. GLX_MESA_agp_offset - */ + */ #ifndef GLX_MESA_agp_offset #define GLX_MESA_agp_offset 1 @@ -484,7 +484,7 @@ typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer); /* * ???. GLX_MESA_allocate_memory - */ + */ #ifndef GLX_MESA_allocate_memory #define GLX_MESA_allocate_memory 1 diff --git a/reactos/dll/3rdparty/mesa32/include/GL/glxext.h b/reactos/dll/3rdparty/mesa32/include/GL/glxext.h index 589d1ef363e..8a56277d837 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/glxext.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/glxext.h @@ -13,21 +13,21 @@ extern "C" { ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: This software was created using the ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has ** not been independently verified as being compliant with the OpenGL(R) @@ -337,7 +337,7 @@ typedef struct { #if defined(__arch64__) typedef long int int64_t; #else -typedef long long int int64_t; +typedef long long int int64_t; #endif /* __arch64__ */ #endif /* __STDC__ */ #elif defined(__UNIXOS2__) || defined(__SOL64__) diff --git a/reactos/dll/3rdparty/mesa32/include/GL/internal/dri_interface.h b/reactos/dll/3rdparty/mesa32/include/GL/internal/dri_interface.h index e63415db026..012c56f15f1 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/internal/dri_interface.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/internal/dri_interface.h @@ -30,7 +30,7 @@ * between a DRI driver and driver loader. Currently, the most common driver * loader is the XFree86 libGL.so. However, other loaders do exist, and in * the future the server-side libglx.a will also be a loader. - * + * * \author Kevin E. Martin * \author Ian Romanick */ @@ -122,7 +122,7 @@ extern const char __driConfigOptions[]; /** * Stored version of some component (i.e., server-side DRI module, kernel-side * DRM, etc.). - * + * * \todo * There are several data structures that explicitly store a major version, * minor version, and patch level. These structures should be modified to @@ -173,7 +173,7 @@ struct __DRIinterfaceMethodsRec { /*@{*/ /** * Determine if the specified window ID still exists. - * + * * \note * Implementations may assume that the driver will only pass an ID into * this function that actually corresponds to a window. On @@ -230,7 +230,7 @@ struct __DRIinterfaceMethodsRec { /** * Get the media stream counter (MSC) rate. - * + * * Matching the definition in GLX_OML_sync_control, this function returns * the rate of the "media stream counter". In practical terms, this is * the frame refresh rate of the display. @@ -240,11 +240,11 @@ struct __DRIinterfaceMethodsRec { /*@}*/ }; - + /** * Framebuffer information record. Used by libGL to communicate information * about the framebuffer to the driver's \c __driCreateNewScreen function. - * + * * In XFree86, most of this information is derrived from data returned by * calling \c XF86DRIGetDeviceInfo. * @@ -303,13 +303,13 @@ struct __DRIscreenRec { /** * Get the number of vertical refreshes since some point in time before * this function was first called (i.e., system start up). - * + * * \since Internal API version 20030317. */ int (*getMSC)( void *screenPrivate, int64_t *msc ); /** - * Opaque pointer that points back to the containing + * Opaque pointer that points back to the containing * \c __GLXscreenConfigs. This data structure is shared with DRI drivers * but \c __GLXscreenConfigs is not. However, they are needed by some GLX * functions called by DRI drivers. @@ -327,9 +327,9 @@ struct __DRIscreenRec { void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); - + void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer); - + GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer); /*@}*/ @@ -430,7 +430,7 @@ struct __DRIdrawableRec { * the next time (MSC % divisor) is equal to remainder. If divisor is * zero, the function will return as soon as MSC is greater than or equal * to target_msc. - * + * * \since Internal API version 20030317. */ int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv, @@ -443,7 +443,7 @@ struct __DRIdrawableRec { * if that has already passed, waits until (MSC % divisor) is equal * to remainder. If divisor is zero, the swap will happen as soon as * MSC is greater than or equal to target_msc. - * + * * \since Internal API version 20030317. */ int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate, @@ -452,14 +452,14 @@ struct __DRIdrawableRec { /** * Enable or disable frame usage tracking. - * + * * \since Internal API version 20030317. */ int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable); /** * Retrieve frame usage information. - * + * * \since Internal API version 20030317. */ int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, diff --git a/reactos/dll/3rdparty/mesa32/include/GL/internal/glcore.h b/reactos/dll/3rdparty/mesa32/include/GL/internal/glcore.h index 48748d91e8f..99c2e08ca4f 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/internal/glcore.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/internal/glcore.h @@ -10,21 +10,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -100,7 +100,7 @@ typedef struct __GLcontextModesRec { /* GLX */ GLint visualID; - GLint visualType; /**< One of the GLX X visual types. (i.e., + GLint visualType; /**< One of the GLX X visual types. (i.e., * \c GLX_TRUE_COLOR, etc.) */ @@ -222,16 +222,16 @@ struct __GLdrawableRegionRec { /* what Resize routines return if resize resorted to fallback case */ #define __GL_BUFFER_FALLBACK 0x10 -typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, +typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits); -typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, +typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits, __GLbufFallbackInitFn back); /* ** A drawable buffer ** -** This data structure describes the context side of a drawable. +** This data structure describes the context side of a drawable. ** ** According to the spec there could be multiple contexts bound to the same ** drawable at the same time (from different threads). In order to avoid @@ -285,7 +285,7 @@ struct __GLdrawableBufferRec { /* imported */ GLboolean (*resize)(__GLdrawableBuffer *buf, - GLint x, GLint y, GLuint width, GLuint height, + GLint x, GLint y, GLuint width, GLuint height, __GLdrawablePrivate *glPriv, GLuint bufferMask); void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); @@ -377,13 +377,13 @@ struct __GLdrawablePrivateRec { void *(*realloc)(void *oldAddr, size_t newSize); void (*free)(void *addr); - GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, + GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, GLint x, GLint y, GLsizei width, GLsizei height); - void (*setClipRect)(__GLdrawablePrivate *glPriv, + void (*setClipRect)(__GLdrawablePrivate *glPriv, GLint x, GLint y, GLsizei width, GLsizei height); void (*updateClipRegion)(__GLdrawablePrivate *glPriv); GLboolean (*resize)(__GLdrawablePrivate *glPriv); - void (*getDrawableSize)(__GLdrawablePrivate *glPriv, + void (*getDrawableSize)(__GLdrawablePrivate *glPriv, GLint *x, GLint *y, GLuint *width, GLuint *height); void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc); diff --git a/reactos/dll/3rdparty/mesa32/include/GL/internal/sarea.h b/reactos/dll/3rdparty/mesa32/include/GL/internal/sarea.h index 77c16e0efe2..f3d9f20db5d 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/internal/sarea.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/internal/sarea.h @@ -1,8 +1,8 @@ /* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ /** - * \file sarea.h + * \file sarea.h * SAREA definitions. - * + * * \author Kevin E. Martin * \author Jens Owen * \author Rickard E. (Rik) Faith @@ -12,7 +12,7 @@ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -20,11 +20,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. diff --git a/reactos/dll/3rdparty/mesa32/include/GL/osmesa.h b/reactos/dll/3rdparty/mesa32/include/GL/osmesa.h index ef645905c4d..9f7ffff0788 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/osmesa.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/osmesa.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.3 - * + * * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/include/GL/uglglutshapes.h b/reactos/dll/3rdparty/mesa32/include/GL/uglglutshapes.h index 28192de2d52..800812cb267 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/uglglutshapes.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/uglglutshapes.h @@ -13,7 +13,7 @@ extern "C" { #endif -#include +#include void glutWireSphere (GLdouble radius, GLint slices, GLint stacks); void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks); diff --git a/reactos/dll/3rdparty/mesa32/include/GL/uglmesa.h b/reactos/dll/3rdparty/mesa32/include/GL/uglmesa.h index 7ef5843504e..5fb3afdae55 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/uglmesa.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/uglmesa.h @@ -28,7 +28,7 @@ /* * Author: - * Stephane Raimbault + * Stephane Raimbault */ #ifndef UGLMESA_H @@ -58,13 +58,13 @@ extern "C" { * - HARD 0000 0100 * WINDML 0001 0000 * - * + * */ #define UGL_MESA_SINGLE 0x01 #define UGL_MESA_DOUBLE 0x06 #define UGL_MESA_DOUBLE_SOFTWARE 0x02 #define UGL_MESA_DOUBLE_HARDWARE 0x04 - + #define UGL_MESA_WINDML_EXCLUSIVE 0x10 #define UGL_MESA_FULLSCREEN_WIDTH 0x0 @@ -73,16 +73,16 @@ extern "C" { /* * uglMesaPixelStore() parameters: */ - + #define UGL_MESA_ROW_LENGTH 0x20 #define UGL_MESA_Y_UP 0x21 -/* +/* * Accepted by uglMesaGetIntegerv: */ #define UGL_MESA_LEFT_X 0x01 -#define UGL_MESA_TOP_Y 0x02 +#define UGL_MESA_TOP_Y 0x02 #define UGL_MESA_WIDTH 0x03 #define UGL_MESA_HEIGHT 0x04 #define UGL_MESA_DISPLAY_WIDTH 0x05 @@ -97,13 +97,13 @@ extern "C" { #define UGL_MESA_DOUBLE_BUFFER 0x0E #define UGL_MESA_DOUBLE_BUFFER_SOFTWARE 0x0F #define UGL_MESA_DOUBLE_BUFFER_HARDWARE 0x10 - + /* * typedefs */ typedef struct uglMesaContext * UGL_MESA_CONTEXT; - + UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum mode, UGL_MESA_CONTEXT share_list); @@ -146,7 +146,7 @@ GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height, GLboolean uglMesaSetColor (GLubyte index, GLfloat red, GLfloat green, GLfloat blue); - + #ifdef __cplusplus } #endif diff --git a/reactos/dll/3rdparty/mesa32/include/GL/vms_x_fix.h b/reactos/dll/3rdparty/mesa32/include/GL/vms_x_fix.h index db754f65563..d4099b43413 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/vms_x_fix.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/vms_x_fix.h @@ -11,7 +11,7 @@ #ifndef VMS_X_FIX #define VMS_X_FIX -#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE +#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE #define XAllocClassHint XALLOCCLASSHINT #define XAllocColor XALLOCCOLOR #define XAllocColorCells XALLOCCOLORCELLS diff --git a/reactos/dll/3rdparty/mesa32/include/GL/wmesa.h b/reactos/dll/3rdparty/mesa32/include/GL/wmesa.h index 0a6e8b64246..34661e5ec74 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/wmesa.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/wmesa.h @@ -27,13 +27,13 @@ * *************************************************************** * WMesa * - * version 2.3 * + * version 2.3 * * * * By * * Li Wei * * Institute of Artificial Intelligence & Robotics * * Xi'an Jiaotong University * - * Email: liwei@aiar.xjtu.edu.cn * + * Email: liwei@aiar.xjtu.edu.cn * * Web page: http://sun.aiar.xjtu.edu.cn * * * * July 7th, 1997 * diff --git a/reactos/dll/3rdparty/mesa32/include/GL/xmesa.h b/reactos/dll/3rdparty/mesa32/include/GL/xmesa.h index ab813b23baa..da764daafa4 100644 --- a/reactos/dll/3rdparty/mesa32/include/GL/xmesa.h +++ b/reactos/dll/3rdparty/mesa32/include/GL/xmesa.h @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 4.1 - * + * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/include/GLView.h b/reactos/dll/3rdparty/mesa32/include/GLView.h index 8d9d25bb1cb..38e3b7fe865 100644 --- a/reactos/dll/3rdparty/mesa32/include/GLView.h +++ b/reactos/dll/3rdparty/mesa32/include/GLView.h @@ -12,7 +12,7 @@ #include #define BGL_RGB 0 -#define BGL_INDEX 1 +#define BGL_INDEX 1 #define BGL_SINGLE 0 #define BGL_DOUBLE 2 #define BGL_DIRECT 0 @@ -50,14 +50,14 @@ virtual ~BGLView(); status_t CopyPixelsOut(BPoint source, BBitmap *dest); status_t CopyPixelsIn(BBitmap *source, BPoint dest); virtual void ErrorCallback(unsigned long errorCode); // Mesa's GLenum is uint where Be's ones was ulong! - + virtual void Draw(BRect updateRect); virtual void AttachedToWindow(); virtual void AllAttached(); virtual void DetachedFromWindow(); virtual void AllDetached(); - + virtual void FrameResized(float width, float height); virtual status_t Perform(perform_code d, void *arg); @@ -82,17 +82,17 @@ virtual status_t GetSupportedSuites(BMessage *data); void EnableDirectMode( bool enabled ); void * getGC() { return m_gc; } - + private: virtual void _ReservedGLView1(); -virtual void _ReservedGLView2(); -virtual void _ReservedGLView3(); -virtual void _ReservedGLView4(); -virtual void _ReservedGLView5(); -virtual void _ReservedGLView6(); -virtual void _ReservedGLView7(); -virtual void _ReservedGLView8(); +virtual void _ReservedGLView2(); +virtual void _ReservedGLView3(); +virtual void _ReservedGLView4(); +virtual void _ReservedGLView5(); +virtual void _ReservedGLView6(); +virtual void _ReservedGLView7(); +virtual void _ReservedGLView8(); BGLView(const BGLView &); BGLView &operator=(const BGLView &); @@ -100,7 +100,7 @@ virtual void _ReservedGLView8(); void dither_front(); bool confirm_dither(); void draw(BRect r); - + void * m_gc; uint32 m_options; uint32 m_ditherCount; @@ -115,7 +115,7 @@ virtual void _ReservedGLView8(); uint64 _reserved[8]; /* Direct Window stuff */ -private: +private: void drawScanline( int x1, int x2, int y, void *data ); static void scanlineHandler(struct rasStateRec *state, GLint x1, GLint x2); @@ -167,7 +167,7 @@ private: virtual void _ReservedGLScreen5(); virtual void _ReservedGLScreen6(); virtual void _ReservedGLScreen7(); - virtual void _ReservedGLScreen8(); + virtual void _ReservedGLScreen8(); BGLScreen(const BGLScreen &); BGLScreen &operator=(const BGLScreen &); @@ -175,10 +175,10 @@ private: void * m_gc; long m_options; BLocker m_drawLock; - + int32 m_colorSpace; uint32 m_screen_mode; - + uint64 _reserved[7]; }; diff --git a/reactos/dll/3rdparty/mesa32/src/array_cache/ac_import.c b/reactos/dll/3rdparty/mesa32/src/array_cache/ac_import.c index 416b2e793c9..47440bd0cd0 100644 --- a/reactos/dll/3rdparty/mesa32/src/array_cache/ac_import.c +++ b/reactos/dll/3rdparty/mesa32/src/array_cache/ac_import.c @@ -213,7 +213,7 @@ import( const GLcontext *ctx, { const ACcontext *ac = AC_CONTEXT(ctx); - if (destType == 0) + if (destType == 0) destType = from->Type; switch (destType) { @@ -229,7 +229,7 @@ import( const GLcontext *ctx, to->StrideB = 4 * sizeof(GLfloat); to->Type = GL_FLOAT; break; - + case GL_UNSIGNED_BYTE: _math_trans_4ub( (GLubyte (*)[4]) to->Ptr, from->Ptr, @@ -255,7 +255,7 @@ import( const GLcontext *ctx, to->StrideB = 4 * sizeof(GLushort); to->Type = GL_UNSIGNED_SHORT; break; - + default: _mesa_problem(ctx, "Unexpected dest format in import()"); break; @@ -361,7 +361,7 @@ import_color( GLcontext *ctx, GLenum type, GLuint stride ) (void) stride; import( ctx, type, to, from ); - + ac->IsCached.Color = GL_TRUE; } diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/common/driverfuncs.c b/reactos/dll/3rdparty/mesa32/src/drivers/common/driverfuncs.c index 4a8ea31a48f..de1705b7b4d 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/common/driverfuncs.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/common/driverfuncs.c @@ -106,8 +106,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; driver->NewTextureImage = _mesa_new_texture_image; - driver->FreeTexImageData = _mesa_free_texture_image_data; - driver->TextureMemCpy = _mesa_memcpy; + driver->FreeTexImageData = _mesa_free_texture_image_data; + driver->TextureMemCpy = _mesa_memcpy; driver->IsTextureResident = NULL; driver->PrioritizeTexture = NULL; driver->ActiveTexture = NULL; @@ -190,7 +190,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->GetFloatv = NULL; driver->GetIntegerv = NULL; driver->GetPointerv = NULL; - + #if FEATURE_ARB_vertex_buffer_object driver->NewBufferObject = _mesa_new_buffer_object; driver->DeleteBuffer = _mesa_delete_buffer_object; diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/mesa.def b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/mesa.def index 7b67c5ccb99..177e58a193f 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/mesa.def +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/mesa.def @@ -12,7 +12,7 @@ VERSION 6.0 ; ; The linker exports STDCALL entry points with ; 'decorated' names; e.g., _glBegin@0, where the -; trailing number is the number of bytes of +; trailing number is the number of bytes of ; parameter data pushed onto the stack. The ; callee is responsible for popping this data ; off the stack, usually via a RETF n instruction. diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wgl.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wgl.c index 2d3f696fb55..703555c06d2 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wgl.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wgl.c @@ -23,7 +23,7 @@ * Some things originated from the 3Dfx WGL functions */ -/* +/* * This file contains the implementation of the wgl* functions for * Mesa on Windows. Since these functions are provided by Windows in * GDI/OpenGL, we must supply our versions that work with Mesa here. @@ -55,71 +55,52 @@ struct __pixelformat__ pfd[] = { #if 0 /* Double Buffer, alpha */ - { - { + { + { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, PFD_TYPE_RGBA, - 24, - 8, 0, - 8, 8, - 8, 16, + 24, + 8, 0, + 8, 8, + 8, 16, 8, 24, - 0, 0, 0, 0, 0, - 16, 8, - 0, 0, 0, - 0, 0, 0 + 0, 0, 0, 0, 0, + 16, 8, + 0, 0, 0, + 0, 0, 0 }, GL_TRUE }, /* Single Buffer, alpha */ - { - { + { + { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| PFD_GENERIC_FORMAT, PFD_TYPE_RGBA, - 24, - 8, 0, - 8, 8, - 8, 16, + 24, + 8, 0, + 8, 8, + 8, 16, 8, 24, - 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 8, - 0, 0, 0, + 0, 0, 0, 0, 0, 0 }, GL_FALSE }, #endif /* Double Buffer, no alpha */ - { - { + { + { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, PFD_TYPE_RGBA, - 24, - 8, 0, - 8, 8, - 8, 16, - 0, 0, - 0, 0, 0, 0, 0, - 16, 8, - 0, 0, 0, - 0, 0, 0 - }, - GL_TRUE - }, - /* Single Buffer, no alpha */ - { - { - sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| - PFD_GENERIC_FORMAT, - PFD_TYPE_RGBA, - 24, + 24, 8, 0, 8, 8, 8, 16, @@ -127,7 +108,26 @@ struct __pixelformat__ pfd[] = 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, - 0, 0, 0 + 0, 0, 0 + }, + GL_TRUE + }, + /* Single Buffer, no alpha */ + { + { + sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL| + PFD_GENERIC_FORMAT, + PFD_TYPE_RGBA, + 24, + 8, 0, + 8, 8, + 8, 16, + 0, 0, + 0, 0, 0, 0, 0, + 16, 8, + 0, 0, 0, + 0, 0, 0 }, GL_FALSE }, @@ -169,10 +169,10 @@ WINGDIAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) } for( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) { if ( wgl_ctx[i].ctx == NULL ) { - wgl_ctx[i].ctx = + wgl_ctx[i].ctx = WMesaCreateContext(hWnd, NULL, GL_TRUE, - pfd[curPFD-1].doubleBuffered, - pfd[curPFD-1].pfd.cAlphaBits ? + pfd[curPFD-1].doubleBuffered, + pfd[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE); if (wgl_ctx[i].ctx == NULL) break; @@ -221,13 +221,13 @@ WINGDIAPI HDC GLAPIENTRY wglGetCurrentDC(VOID) WINGDIAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc,HGLRC hglrc) { int i; - + if (!hdc || !hglrc) { WMesaMakeCurrent(NULL); ctx_current = -1; return TRUE; } - + for ( i = 0; i < MESAWGL_CTX_MAX_COUNT; i++ ) { if ( wgl_ctx[i].ctx == (PWMC) hglrc ) { wgl_ctx[i].hdc = hdc; @@ -241,12 +241,12 @@ WINGDIAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc,HGLRC hglrc) WINGDIAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, - CONST + CONST PIXELFORMATDESCRIPTOR *ppfd) { int i,best = -1,bestdelta = 0x7FFFFFFF,delta; (void) hdc; - + if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) { SetLastError(0); @@ -273,12 +273,12 @@ WINGDIAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, continue; if( !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) && - ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != + ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != (pfd[i].pfd.dwFlags & PFD_DOUBLEBUFFER))) continue; if( !(ppfd->dwFlags & PFD_STEREO_DONTCARE) && - ((ppfd->dwFlags & PFD_STEREO) != + ((ppfd->dwFlags & PFD_STEREO) != (pfd[i].pfd.dwFlags & PFD_STEREO))) continue; if(ppfd->iPixelType != pfd[i].pfd.iPixelType) @@ -307,10 +307,10 @@ WINGDIAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc, LPPIXELFORMATDESCRIPTOR ppfd) { (void) hdc; - + if(ppfd == NULL) return(npfd); - if(iPixelFormat < 1 || iPixelFormat > npfd || + if(iPixelFormat < 1 || iPixelFormat > npfd || nBytes != sizeof(PIXELFORMATDESCRIPTOR)) { SetLastError(0); @@ -325,7 +325,7 @@ WINGDIAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc); if (p) return p; - + SetLastError(0); return(NULL); } @@ -344,8 +344,8 @@ WINGDIAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, PIXELFORMATDESCRIPTOR *ppfd) { (void) hdc; - - if(iPixelFormat < 1 || iPixelFormat > npfd || + + if(iPixelFormat < 1 || iPixelFormat > npfd || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) { SetLastError(0); return(FALSE); @@ -359,7 +359,7 @@ WINGDIAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc) (void) hdc; if (ctx_current < 0) return FALSE; - + if(wgl_ctx[ctx_current].ctx == NULL) { SetLastError(0); return(FALSE); @@ -385,31 +385,31 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase) { #define VERIFY(a) a - + TEXTMETRIC metric; BITMAPINFO *dibInfo; HDC bitDevice; COLORREF tempColor; int i; - + VERIFY(GetTextMetrics(fontDevice, &metric)); - + dibInfo = (BITMAPINFO *) calloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD), 1); dibInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); dibInfo->bmiHeader.biPlanes = 1; dibInfo->bmiHeader.biBitCount = 1; dibInfo->bmiHeader.biCompression = BI_RGB; - + bitDevice = CreateCompatibleDC(fontDevice); - + // Swap fore and back colors so the bitmap has the right polarity tempColor = GetBkColor(bitDevice); SetBkColor(bitDevice, GetTextColor(bitDevice)); SetTextColor(bitDevice, tempColor); - + // Place chars based on base line VERIFY(SetTextAlign(bitDevice, TA_BASELINE) != GDI_ERROR ? 1 : 0); - + for(i = 0; i < (int)numChars; i++) { SIZE size; char curChar; @@ -417,38 +417,38 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, HBITMAP bitObject; HGDIOBJ origBmap; unsigned char *bmap; - + curChar = i + firstChar; - + // Find how high/wide this character is VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); - + // Create the output bitmap charWidth = size.cx; charHeight = size.cy; // Round up to the next multiple of 32 bits - bmapWidth = ((charWidth + 31) / 32) * 32; + bmapWidth = ((charWidth + 31) / 32) * 32; bmapHeight = charHeight; bitObject = CreateCompatibleBitmap(bitDevice, bmapWidth, bmapHeight); //VERIFY(bitObject); - + // Assign the output bitmap to the device origBmap = SelectObject(bitDevice, bitObject); (void) VERIFY(origBmap); - + VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); - + // Use our source font on the device VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT))); - + // Draw the character VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1)); - + // Unselect our bmap object VERIFY(SelectObject(bitDevice, origBmap)); - + // Convert the display dependant representation to a 1 bit deep DIB numBytes = (bmapWidth * bmapHeight) / 8; bmap = malloc(numBytes); @@ -458,7 +458,7 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, dibInfo, DIB_RGB_COLORS); //VERIFY(res); - + // Create the GL object glNewList(i + listBase, GL_COMPILE); glBitmap(bmapWidth, bmapHeight, 0.0, metric.tmDescent, @@ -466,19 +466,19 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, bmap); glEndList(); // CheckGL(); - + // Destroy the bmap object DeleteObject(bitObject); - + // Deallocate the bitmap data free(bmap); } - + // Destroy the DC VERIFY(DeleteDC(bitDevice)); - + free(dibInfo); - + return TRUE; #undef VERIFY } @@ -494,19 +494,19 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, LPSTR lpBits; MAT2 mat; int success = TRUE; - + if (count == 0) return FALSE; - + font_list = listBase; - + mat.eM11 = FixedFromDouble(1); mat.eM12 = FixedFromDouble(0); mat.eM21 = FixedFromDouble(0); mat.eM22 = FixedFromDouble(-1); - + memset(&gm,0,sizeof(gm)); - + /* ** If we can't get the glyph outline, it may be because this is a fixed ** font. Try processing it that way. @@ -515,17 +515,17 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, == GDI_ERROR ) { return wglUseFontBitmaps_FX( hdc, first, count, listBase ); } - + /* ** Otherwise process all desired characters. */ for (i = 0; i < (int)count; i++) { DWORD err; - + glNewList( font_list+i, GL_COMPILE ); - + /* allocate space for the bitmap/outline */ - size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, + size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat); if (size == GDI_ERROR) { glEndList( ); @@ -533,11 +533,11 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, success = FALSE; continue; } - + hBits = GlobalAlloc(GHND, size+1); lpBits = GlobalLock(hBits); - - err = + + err = GetGlyphOutline(hdc, /* handle to device context */ first + i, /* character to query */ GGO_BITMAP, /* format of data to return */ @@ -547,29 +547,29 @@ WINGDIAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, &mat /* pointer to transformation */ /* matrix structure */ ); - + if (err == GDI_ERROR) { GlobalUnlock(hBits); GlobalFree(hBits); - + glEndList( ); err = GetLastError(); success = FALSE; continue; } - + glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY, -gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.y, gm.gmCellIncX,gm.gmCellIncY, (const GLubyte * )lpBits); - + GlobalUnlock(hBits); GlobalFree(hBits); - + glEndList( ); } - + return success; } @@ -647,7 +647,7 @@ WINGDIAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc, UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd) { - (void) hdc; (void) iPixelFormat; (void) iLayerPlane; + (void) hdc; (void) iPixelFormat; (void) iLayerPlane; (void) nBytes; (void) plpd; SetLastError(0); return(FALSE); @@ -659,7 +659,7 @@ WINGDIAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc, int cEntries, CONST COLORREF *pcr) { - (void) hdc; (void) iLayerPlane; (void) iStart; + (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr; SetLastError(0); return(0); diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c index 3f785a3a215..553e1c3b235 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesa.c @@ -29,7 +29,7 @@ static PWMC Current = NULL; */ static const GLubyte *wmesa_get_string(GLcontext *ctx, GLenum name) { - return (name == GL_RENDERER) ? + return (name == GL_RENDERER) ? (GLubyte *) "Mesa Windows GDI Driver" : NULL; } @@ -41,7 +41,7 @@ static void wmSetPixelFormat(PWMC pwc, HDC hDC) pwc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); // TEMP - only 16 and 32 bit targets are supported now - assert(pwc->cColorBits == 16 || + assert(pwc->cColorBits == 16 || pwc->cColorBits == 32); switch(pwc->cColorBits){ @@ -84,13 +84,13 @@ BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) pbmi->bmiHeader.biYPelsPerMeter = 0; pbmi->bmiHeader.biClrUsed = 0; pbmi->bmiHeader.biClrImportant = 0; - + pwc->cColorBits = pbmi->bmiHeader.biBitCount; pwc->ScanWidth = (lxSize * (pwc->cColorBits / 8) + 3) & ~3; - + hic = CreateIC("display", NULL, NULL, NULL); pwc->dib.hDC = CreateCompatibleDC(hic); - + pwc->hbmDIB = CreateDIBSection(hic, &pwc->bmi, DIB_RGB_COLORS, @@ -98,7 +98,7 @@ BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) 0, 0); pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); - + DeleteDC(hic); wmSetPixelFormat(pwc, pwc->hDC); @@ -114,8 +114,8 @@ static void wmDeleteBackingStore(PWMC pwc) } } -static void wmesa_get_buffer_size(GLframebuffer *buffer, - GLuint *width, +static void wmesa_get_buffer_size(GLframebuffer *buffer, + GLuint *width, GLuint *height ) { *width = Current->width; @@ -158,7 +158,7 @@ static void clear_index(GLcontext* ctx, GLuint index) static void clear_color(GLcontext* ctx, const GLfloat color[4]) { GLubyte col[3]; - UINT bytesPerPixel = Current->cColorBits / 8; + UINT bytesPerPixel = Current->cColorBits / 8; CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); @@ -166,25 +166,25 @@ static void clear_color(GLcontext* ctx, const GLfloat color[4]) Current->clearColorRef = RGB(col[0], col[1], col[2]); DeleteObject(Current->clearPen); DeleteObject(Current->clearBrush); - Current->clearPen = CreatePen(PS_SOLID, 1, Current->clearColorRef); - Current->clearBrush = CreateSolidBrush(Current->clearColorRef); + Current->clearPen = CreatePen(PS_SOLID, 1, Current->clearColorRef); + Current->clearBrush = CreateSolidBrush(Current->clearColorRef); } -/* - * Clear the specified region of the color buffer using the clear color - * or index as specified by one of the two functions above. - * - * This procedure clears either the front and/or the back COLOR buffers. - * Only the "left" buffer is cleared since we are not stereo. - * Clearing of the other non-color buffers is left to the swrast. - */ +/* + * Clear the specified region of the color buffer using the clear color + * or index as specified by one of the two functions above. + * + * This procedure clears either the front and/or the back COLOR buffers. + * Only the "left" buffer is cleared since we are not stereo. + * Clearing of the other non-color buffers is left to the swrast. + */ -static void clear(GLcontext* ctx, - GLbitfield mask, - GLboolean all, - GLint x, GLint y, - GLint width, GLint height) +static void clear(GLcontext* ctx, + GLbitfield mask, + GLboolean all, + GLint x, GLint y, + GLint width, GLint height) { int done = 0; @@ -194,49 +194,49 @@ static void clear(GLcontext* ctx, ctx->Color.ColorMask[1] != 0xff || ctx->Color.ColorMask[2] != 0xff || ctx->Color.ColorMask[3] != 0xff) { - _swrast_Clear(ctx, mask, all, x, y, width, height); + _swrast_Clear(ctx, mask, all, x, y, width, height); return; } /* 'all' means clear the entire window */ - if (all) { - x = y = 0; - width = Current->width; - height = Current->height; - } + if (all) { + x = y = 0; + width = Current->width; + height = Current->height; + } /* Back buffer */ - if (mask & BUFFER_BIT_BACK_LEFT) { - - int i, rowSize; - UINT bytesPerPixel = Current->cColorBits / 8; + if (mask & BUFFER_BIT_BACK_LEFT) { + + int i, rowSize; + UINT bytesPerPixel = Current->cColorBits / 8; LPBYTE lpb, clearRow; LPWORD lpw; - BYTE bColor; - WORD wColor; - BYTE r, g, b; - DWORD dwColor; - LPDWORD lpdw; - + BYTE bColor; + WORD wColor; + BYTE r, g, b; + DWORD dwColor; + LPDWORD lpdw; + /* Try for a fast clear - clearing entire buffer with a single * byte value. */ if (all) { /* entire buffer */ /* Now check for an easy clear value */ switch (bytesPerPixel) { case 1: - bColor = BGR8(GetRValue(Current->clearColorRef), - GetGValue(Current->clearColorRef), + bColor = BGR8(GetRValue(Current->clearColorRef), + GetGValue(Current->clearColorRef), GetBValue(Current->clearColorRef)); - memset(Current->pbPixels, bColor, + memset(Current->pbPixels, bColor, Current->ScanWidth * height); done = 1; break; case 2: - wColor = BGR16(GetRValue(Current->clearColorRef), - GetGValue(Current->clearColorRef), - GetBValue(Current->clearColorRef)); + wColor = BGR16(GetRValue(Current->clearColorRef), + GetGValue(Current->clearColorRef), + GetBValue(Current->clearColorRef)); if (((wColor >> 8) & 0xff) == (wColor & 0xff)) { - memset(Current->pbPixels, wColor & 0xff, + memset(Current->pbPixels, wColor & 0xff, Current->ScanWidth * height); done = 1; } @@ -244,12 +244,12 @@ static void clear(GLcontext* ctx, case 3: /* fall through */ case 4: - if (GetRValue(Current->clearColorRef) == + if (GetRValue(Current->clearColorRef) == GetGValue(Current->clearColorRef) && - GetRValue(Current->clearColorRef) == + GetRValue(Current->clearColorRef) == GetBValue(Current->clearColorRef)) { - memset(Current->pbPixels, - GetRValue(Current->clearColorRef), + memset(Current->pbPixels, + GetRValue(Current->clearColorRef), Current->ScanWidth * height); done = 1; } @@ -262,80 +262,80 @@ static void clear(GLcontext* ctx, if (!done) { /* Need to clear a row at a time. Begin by setting the first * row in the area to be cleared to the clear color. */ - - clearRow = Current->pbPixels + + + clearRow = Current->pbPixels + Current->ScanWidth * FLIP(y) + - bytesPerPixel * x; + bytesPerPixel * x; switch (bytesPerPixel) { case 1: lpb = clearRow; - bColor = BGR8(GetRValue(Current->clearColorRef), - GetGValue(Current->clearColorRef), + bColor = BGR8(GetRValue(Current->clearColorRef), + GetGValue(Current->clearColorRef), GetBValue(Current->clearColorRef)); memset(lpb, bColor, width); break; case 2: lpw = (LPWORD)clearRow; - wColor = BGR16(GetRValue(Current->clearColorRef), - GetGValue(Current->clearColorRef), - GetBValue(Current->clearColorRef)); + wColor = BGR16(GetRValue(Current->clearColorRef), + GetGValue(Current->clearColorRef), + GetBValue(Current->clearColorRef)); for (i=0; iclearColorRef); - g = GetGValue(Current->clearColorRef); - b = GetBValue(Current->clearColorRef); + r = GetRValue(Current->clearColorRef); + g = GetGValue(Current->clearColorRef); + b = GetBValue(Current->clearColorRef); for (i=0; iclearColorRef), - GetGValue(Current->clearColorRef), - GetBValue(Current->clearColorRef)); + case 4: + lpdw = (LPDWORD)clearRow; + dwColor = BGR32(GetRValue(Current->clearColorRef), + GetGValue(Current->clearColorRef), + GetBValue(Current->clearColorRef)); for (i=0; iScanWidth; rowSize = width * bytesPerPixel; - for (i=1; iScanWidth; - } + for (i=1; iScanWidth; + } } /* not done */ mask &= ~BUFFER_BIT_BACK_LEFT; - } /* back buffer */ + } /* back buffer */ /* front buffer */ - if (mask & BUFFER_BIT_FRONT_LEFT) { - HDC DC = Current->hDC; - HPEN Old_Pen = SelectObject(DC, Current->clearPen); + if (mask & BUFFER_BIT_FRONT_LEFT) { + HDC DC = Current->hDC; + HPEN Old_Pen = SelectObject(DC, Current->clearPen); HBRUSH Old_Brush = SelectObject(DC, Current->clearBrush); Rectangle(DC, x, FLIP(y), x + width + 1, FLIP(y) - height + 1); - SelectObject(DC, Old_Pen); - SelectObject(DC, Old_Brush); + SelectObject(DC, Old_Pen); + SelectObject(DC, Old_Brush); mask &= ~BUFFER_BIT_FRONT_LEFT; - } /* front buffer */ - - /* Call swrast if there is anything left to clear (like DEPTH) */ - if (mask) - _swrast_Clear(ctx, mask, all, x, y, width, height); - -} + } /* front buffer */ + + /* Call swrast if there is anything left to clear (like DEPTH) */ + if (mask) + _swrast_Clear(ctx, mask, all, x, y, width, height); + +} /**********************************************************************/ @@ -347,65 +347,65 @@ static void clear(GLcontext* ctx, /* These are slow, but work with all non-indexed visual types */ /* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_single(const GLcontext* ctx, - struct gl_renderbuffer *rb, +static void write_rgba_span_single(const GLcontext* ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { PWMC pwc = Current; GLuint i; - + (void) ctx; y=FLIP(y); if (mask) { for (i=0; ihDC, x+i, y, RGB(rgba[i][RCOMP], rgba[i][GCOMP], + SetPixel(pwc->hDC, x+i, y, RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); } else { for (i=0; ihDC, x+i, y, RGB(rgba[i][RCOMP], rgba[i][GCOMP], + SetPixel(pwc->hDC, x+i, y, RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); } - + } /* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span_single(const GLcontext* ctx, - struct gl_renderbuffer *rb, +static void write_rgb_span_single(const GLcontext* ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], + const GLubyte rgb[][3], const GLubyte mask[] ) { PWMC pwc = Current; GLuint i; - + (void) ctx; y=FLIP(y); if (mask) { for (i=0; ihDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], + SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); } else { for (i=0; ihDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], + SetPixel(pwc->hDC, x+i, y, RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); } - + } /* * Write a horizontal span of pixels with a boolean mask. The current color * is used for all pixels. */ -static void write_mono_rgba_span_single(const GLcontext* ctx, +static void write_mono_rgba_span_single(const GLcontext* ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLchan color[4], + const GLchan color[4], const GLubyte mask[]) { GLuint i; @@ -427,11 +427,11 @@ static void write_mono_rgba_span_single(const GLcontext* ctx, } /* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels_single(const GLcontext* ctx, +static void write_rgba_pixels_single(const GLcontext* ctx, struct gl_renderbuffer *rb, - GLuint n, + GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { GLuint i; @@ -439,8 +439,8 @@ static void write_rgba_pixels_single(const GLcontext* ctx, (void) ctx; for (i=0; ihDC, x[i], FLIP(y[i]), - RGB(rgba[i][RCOMP], rgba[i][GCOMP], + SetPixel(pwc->hDC, x[i], FLIP(y[i]), + RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); } @@ -450,7 +450,7 @@ static void write_rgba_pixels_single(const GLcontext* ctx, * Write an array of pixels with a boolean mask. The current color * is used for all pixels. */ -static void write_mono_rgba_pixels_single(const GLcontext* ctx, +static void write_mono_rgba_pixels_single(const GLcontext* ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], @@ -468,7 +468,7 @@ static void write_mono_rgba_pixels_single(const GLcontext* ctx, } /* Read a horizontal span of color pixels. */ -static void read_rgba_span_single(const GLcontext* ctx, +static void read_rgba_span_single(const GLcontext* ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ) @@ -487,7 +487,7 @@ static void read_rgba_span_single(const GLcontext* ctx, /* Read an array of color pixels. */ -static void read_rgba_pixels_single(const GLcontext* ctx, +static void read_rgba_pixels_single(const GLcontext* ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4]) @@ -515,10 +515,10 @@ LPDWORD lpdw = ((LPDWORD)((pwc)->pbPixels + (pwc)->ScanWidth * (y)) + (x)); \ /* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_32(const GLcontext* ctx, - struct gl_renderbuffer *rb, +static void write_rgba_span_32(const GLcontext* ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { PWMC pwc = Current; @@ -526,28 +526,28 @@ static void write_rgba_span_32(const GLcontext* ctx, LPDWORD lpdw; (void) ctx; - + y=FLIP(y); lpdw = ((LPDWORD)(pwc->pbPixels + pwc->ScanWidth * y)) + x; if (mask) { for (i=0; ipbPixels + pwc->ScanWidth * y)) + x; if (mask) { for (i=0; ipbPixels + pwc->ScanWidth * y)) + x; for (i=0; ipbPixels + (pwc)->ScanWidth * (y)) + (x)); \ /* Write a horizontal span of RGBA color pixels with a boolean mask. */ -static void write_rgba_span_16(const GLcontext* ctx, - struct gl_renderbuffer *rb, +static void write_rgba_span_16(const GLcontext* ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], + const GLubyte rgba[][4], const GLubyte mask[] ) { PWMC pwc = Current; @@ -701,28 +701,28 @@ static void write_rgba_span_16(const GLcontext* ctx, LPWORD lpw; (void) ctx; - + y=FLIP(y); lpw = ((LPWORD)(pwc->pbPixels + pwc->ScanWidth * y)) + x; if (mask) { for (i=0; ipbPixels + pwc->ScanWidth * y)) + x; if (mask) { for (i=0; ipbPixels + pwc->ScanWidth * y)) + x; for (i=0; iwidth != width || Current->height != height) { @@ -954,7 +954,7 @@ static void wmesa_update_state(GLcontext *ctx, GLuint new_state) /***** WMESA Functions *****/ /**********************************************************************/ -WMesaContext WMesaCreateContext(HWND hWnd, +WMesaContext WMesaCreateContext(HWND hWnd, HPALETTE* Pal, GLboolean rgb_flag, GLboolean db_flag, @@ -966,7 +966,7 @@ WMesaContext WMesaCreateContext(HWND hWnd, struct gl_renderbuffer *rb; (void) Pal; - + /* Indexed mode not supported */ if (!rgb_flag) return NULL; @@ -974,23 +974,23 @@ WMesaContext WMesaCreateContext(HWND hWnd, c = CALLOC_STRUCT(wmesa_context); if (!c) return NULL; - + c->Window = hWnd; c->hDC = GetDC(hWnd); GetClientRect(c->Window, &CR); c->width = CR.right; c->height = CR.bottom; - c->clearPen = CreatePen(PS_SOLID, 1, 0); - c->clearBrush = CreateSolidBrush(0); + c->clearPen = CreatePen(PS_SOLID, 1, 0); + c->clearBrush = CreateSolidBrush(0); /* Create back buffer if double buffered */ if (db_flag) { - c->db_flag = 1; + c->db_flag = 1; wmCreateBackingStore(c, c->width, c->height); - + } - + c->gl_visual = _mesa_create_visual(rgb_flag, db_flag, /* db_flag */ GL_FALSE, /* stereo */ @@ -1002,7 +1002,7 @@ WMesaContext WMesaCreateContext(HWND hWnd, 16,16,16, /* accum RGB */ alpha_flag ? 16 : 0, /* accum A */ 1); - + if (!c->gl_visual) { _mesa_free(c); return NULL; @@ -1031,13 +1031,13 @@ WMesaContext WMesaCreateContext(HWND hWnd, _mesa_free(c); return NULL; } - + _mesa_enable_sw_extensions(c->gl_ctx); _mesa_enable_1_3_extensions(c->gl_ctx); _mesa_enable_1_4_extensions(c->gl_ctx); _mesa_enable_1_5_extensions(c->gl_ctx); _mesa_enable_2_0_extensions(c->gl_ctx); - + c->gl_buffer = _mesa_create_framebuffer(c->gl_visual); if (!c->gl_buffer) { _mesa_destroy_visual(c->gl_visual); @@ -1045,7 +1045,7 @@ WMesaContext WMesaCreateContext(HWND hWnd, _mesa_free(c); return NULL; } - + rb = CALLOC_STRUCT(gl_renderbuffer); if (!rb) { @@ -1057,7 +1057,7 @@ WMesaContext WMesaCreateContext(HWND hWnd, } _mesa_init_renderbuffer(rb, (GLuint)0); - + rb->_BaseFormat = GL_RGBA; rb->InternalFormat = GL_RGBA; rb->DataType = CHAN_TYPE; @@ -1105,7 +1105,7 @@ WMesaContext WMesaCreateContext(HWND hWnd, c->gl_visual->depthBits > 0, c->gl_visual->stencilBits > 0, c->gl_visual->accumRedBits > 0, - alpha_flag, + alpha_flag, GL_FALSE); /* Initialize the software rasterizer and helper modules. */ @@ -1119,9 +1119,9 @@ WMesaContext WMesaCreateContext(HWND hWnd, _mesa_free(c); return NULL; } - + _swsetup_Wakeup(c->gl_ctx); - + TNL_CONTEXT(c->gl_ctx)->Driver.RunPipeline = _tnl_run_pipeline; return c; @@ -1134,9 +1134,9 @@ void WMesaDestroyContext( void ) WMesaMakeCurrent(NULL); ReleaseDC(c->Window, c->hDC); - DeleteObject(c->clearPen); - DeleteObject(c->clearBrush); - + DeleteObject(c->clearPen); + DeleteObject(c->clearBrush); + if (c->db_flag) wmDeleteBackingStore(c); @@ -1144,7 +1144,7 @@ void WMesaDestroyContext( void ) _tnl_DestroyContext(c->gl_ctx); _ac_DestroyContext(c->gl_ctx); _swrast_DestroyContext(c->gl_ctx); - + _mesa_destroy_visual(c->gl_visual); _mesa_destroy_framebuffer(c->gl_buffer); _mesa_free_context_data(c->gl_ctx); @@ -1158,7 +1158,7 @@ void WMesaMakeCurrent(WMesaContext c) /* return if already current */ if (Current == c) return; - + if ((Current = c) != 0) _mesa_make_current(c->gl_ctx, c->gl_buffer, c->gl_buffer); } @@ -1167,13 +1167,13 @@ void WMesaMakeCurrent(WMesaContext c) void WMesaSwapBuffers( void ) { GET_CURRENT_CONTEXT(ctx); - + /* If we're swapping the buffer associated with the current context * we have to flush any pending rendering commands first. */ if (Current && Current->gl_ctx == ctx) _mesa_notifySwapBuffers(ctx); - + if (Current->db_flag) wmesa_flush(ctx); } diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesadef.h b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesadef.h index 9aa0ab20b79..86d8cd50743 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesadef.h +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gdi/wmesadef.h @@ -12,7 +12,7 @@ typedef struct wmesa_context{ GLcontext *gl_ctx; /* The core GL/Mesa context */ GLvisual *gl_visual; /* Describes the buffers */ GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers*/ - + HWND Window; HDC hDC; COLORREF clearColorRef; diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglcontext.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglcontext.c index 5dafe14518d..e8397d30e37 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglcontext.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglcontext.c @@ -823,13 +823,13 @@ BOOL dglCreateContextBuffers( // Test for Fullscreen if (bHaveWin95) { // Problems with fullscreen on Win2K/XP - if ((GetSystemMetrics(SM_CXSCREEN) == lpCtx->dwWidth) && + if ((GetSystemMetrics(SM_CXSCREEN) == lpCtx->dwWidth) && (GetSystemMetrics(SM_CYSCREEN) == lpCtx->dwHeight)) { // Workaround for some apps that crash when going fullscreen. //lpCtx->bFullscreen = TRUE; } - + } #ifdef _USE_GLD3_WGL @@ -1458,7 +1458,7 @@ SkipPrimaryCreate: _swsetup_CreateContext( lpCtx->glCtx ); _gldDriver.InitialiseMesa(lpCtx); - + lpCtx->glCtx->imports.warning = _gld_mesa_warning; lpCtx->glCtx->imports.fatal = _gld_mesa_fatal; diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglglobals.h b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglglobals.h index 995f1cd5e48..9d82904711e 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglglobals.h +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglglobals.h @@ -81,7 +81,7 @@ typedef struct { BOOL bPrimary; // Is ddraw device the Primary device? BOOL bHardware; // Is the d3d driver a Hardware driver? #ifndef _USE_GLD3_WGL - GUID ddGuid; // GUID of the ddraw device + GUID ddGuid; // GUID of the ddraw device GUID d3dGuid; // GUID of the direct3d driver #endif // _USE_GLD3_WGL // BOOL bFullscreen; // Force fullscreen - only useful for primary adaptors. diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglpf.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglpf.c index 4cd4d0334ac..36b1d7f5bbc 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglpf.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglpf.c @@ -301,7 +301,7 @@ void dglBuildPixelFormatList() hRes = DirectDrawCreate(NULL, &lpDD1, NULL); else hRes = DirectDrawCreate(&glb.ddGuid, &lpDD1, NULL); - + if (FAILED(hRes)) { ddlogError(DDLOG_ERROR, "dglBPFL: DirectDrawCreate failed", hRes); return; @@ -501,7 +501,7 @@ void dglBuildPixelFormatList() strcat(buf, cat); /* should find transparent pixel from LAYERPLANEDESCRIPTOR */ - sprintf(cat, " . "); + sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, "%2d ", lpPF->pfd.cColorBits); @@ -509,7 +509,7 @@ void dglBuildPixelFormatList() /* bReserved field indicates number of over/underlays */ if(lpPF->pfd.bReserved) sprintf(cat, " %d ", lpPF->pfd.bReserved); - else sprintf(cat, " . "); + else sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, " %c ", lpPF->pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : 'c'); @@ -521,38 +521,38 @@ void dglBuildPixelFormatList() sprintf(cat, " %c ", lpPF->pfd.dwFlags & PFD_STEREO ? 'y' : '.'); strcat(buf, cat); - if(lpPF->pfd.cRedBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + if(lpPF->pfd.cRedBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cRedBits); else sprintf(cat, " . "); strcat(buf, cat); - if(lpPF->pfd.cGreenBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + if(lpPF->pfd.cGreenBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - if(lpPF->pfd.cBlueBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + if(lpPF->pfd.cBlueBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - - if(lpPF->pfd.cAlphaBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) + + if(lpPF->pfd.cAlphaBits && lpPF->pfd.iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", lpPF->pfd.cAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAuxBuffers) sprintf(cat, "%2d ", lpPF->pfd.cAuxBuffers); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cDepthBits) sprintf(cat, "%2d ", lpPF->pfd.cDepthBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cStencilBits) sprintf(cat, "%2d ", lpPF->pfd.cStencilBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAccumRedBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumRedBits); else sprintf(cat, " . "); strcat(buf, cat); @@ -560,15 +560,15 @@ void dglBuildPixelFormatList() if(lpPF->pfd.cAccumGreenBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAccumBlueBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(lpPF->pfd.cAccumAlphaBits) sprintf(cat, "%2d ", lpPF->pfd.cAccumAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + /* no multisample in Win32 */ sprintf(cat, " . .\n"); strcat(buf, cat); diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglwgl.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglwgl.c index 74ecb01a5b0..df0696c63d2 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglwgl.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dglwgl.c @@ -298,7 +298,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( char buf[128]; char cat[8]; - DWORD dwAllFlags = + DWORD dwAllFlags = PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | @@ -345,7 +345,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( strcat(buf, cat); /* should find transparent pixel from LAYERPLANEDESCRIPTOR */ - sprintf(cat, " . "); + sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, "%2d ", ppfd->cColorBits); @@ -353,7 +353,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( /* bReserved field indicates number of over/underlays */ if(ppfd->bReserved) sprintf(cat, " %d ", ppfd->bReserved); - else sprintf(cat, " . "); + else sprintf(cat, " . "); strcat(buf, cat); sprintf(cat, " %c ", ppfd->iPixelType == PFD_TYPE_RGBA ? 'r' : 'c'); @@ -365,38 +365,38 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( sprintf(cat, " %c ", ppfd->dwFlags & PFD_STEREO ? 'y' : '.'); strcat(buf, cat); - if(ppfd->cRedBits && ppfd->iPixelType == PFD_TYPE_RGBA) + if(ppfd->cRedBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cRedBits); else sprintf(cat, " . "); strcat(buf, cat); - if(ppfd->cGreenBits && ppfd->iPixelType == PFD_TYPE_RGBA) + if(ppfd->cGreenBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - if(ppfd->cBlueBits && ppfd->iPixelType == PFD_TYPE_RGBA) + if(ppfd->cBlueBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - - if(ppfd->cAlphaBits && ppfd->iPixelType == PFD_TYPE_RGBA) + + if(ppfd->cAlphaBits && ppfd->iPixelType == PFD_TYPE_RGBA) sprintf(cat, "%2d ", ppfd->cAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAuxBuffers) sprintf(cat, "%2d ", ppfd->cAuxBuffers); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cDepthBits) sprintf(cat, "%2d ", ppfd->cDepthBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cStencilBits) sprintf(cat, "%2d ", ppfd->cStencilBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAccumRedBits) sprintf(cat, "%2d ", ppfd->cAccumRedBits); else sprintf(cat, " . "); strcat(buf, cat); @@ -404,15 +404,15 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( if(ppfd->cAccumGreenBits) sprintf(cat, "%2d ", ppfd->cAccumGreenBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAccumBlueBits) sprintf(cat, "%2d ", ppfd->cAccumBlueBits); else sprintf(cat, " . "); strcat(buf, cat); - + if(ppfd->cAccumAlphaBits) sprintf(cat, "%2d ", ppfd->cAccumAlphaBits); else sprintf(cat, " . "); strcat(buf, cat); - + /* no multisample in Win32 */ sprintf(cat, " . .\n"); strcat(buf, cat); @@ -435,7 +435,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( // Mask illegal flags and continue dwFlags = dwFlags & dwAllFlags; } - + switch (ppfd->iPixelType) { case PFD_TYPE_RGBA: case PFD_TYPE_COLORINDEX: @@ -445,7 +445,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( ddlogMessage(DDLOG_WARN, "ChoosePixelFormat: bad pixel type\n"); return 0; } - + switch (ppfd->iLayerType) { case PFD_MAIN_PLANE: case PFD_OVERLAY_PLANE: @@ -456,15 +456,15 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( ddlogMessage(DDLOG_WARN, "ChoosePixelFormat: bad layer type\n"); return 0; } - + numPixelFormats = glb.nPixelFormatCount; - + /* loop through candidate pixel format descriptors */ for (i=0; iiLayerType != ppfdCandidate.iLayerType) { continue; } - + if (((dwFlags ^ ppfdCandidate.dwFlags) & dwFlags) & (PFD_DRAW_TO_WINDOW | PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | PFD_SUPPORT_OPENGL)) { continue; } - + if (!(dwFlags & PFD_DOUBLEBUFFER_DONTCARE)) { if ((dwFlags & PFD_DOUBLEBUFFER) != (ppfdCandidate.dwFlags & PFD_DOUBLEBUFFER)) @@ -490,7 +490,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( continue; } } - + // if (!(dwFlags & PFD_STEREO_DONTCARE)) { if ((dwFlags & PFD_STEREO) != (ppfdCandidate.dwFlags & PFD_STEREO)) @@ -498,21 +498,21 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( continue; } // } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAlphaBits && !ppfdCandidate.cAlphaBits) { continue; } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAccumBits && !ppfdCandidate.cAccumBits) { continue; } - + if (ppfd->cDepthBits && !ppfdCandidate.cDepthBits) { continue; } - + if (ppfd->cStencilBits && !ppfdCandidate.cStencilBits) { continue; } @@ -520,7 +520,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( if (ppfd->cAuxBuffers && !ppfdCandidate.cAuxBuffers) { continue; } - + /* ** See if candidate is better than the previous best choice */ @@ -529,7 +529,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if ((ppfd->cColorBits > ppfdBest.cColorBits && ppfdCandidate.cColorBits > ppfdBest.cColorBits) || (ppfd->cColorBits <= ppfdCandidate.cColorBits && @@ -539,7 +539,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAlphaBits && ppfdCandidate.cAlphaBits > ppfdBest.cAlphaBits) @@ -548,7 +548,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->iPixelType==PFD_TYPE_RGBA && ppfd->cAccumBits && ppfdCandidate.cAccumBits > ppfdBest.cAccumBits) @@ -557,7 +557,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if ((ppfd->cDepthBits > ppfdBest.cDepthBits && ppfdCandidate.cDepthBits > ppfdBest.cDepthBits) || (ppfd->cDepthBits <= ppfdCandidate.cDepthBits && @@ -567,7 +567,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->cStencilBits && ppfdCandidate.cStencilBits > ppfdBest.cStencilBits) { @@ -575,7 +575,7 @@ int APIENTRY _GLD_WGL_EXPORT(ChoosePixelFormat)( bestIndex = i; continue; } - + if (ppfd->cAuxBuffers && ppfdCandidate.cAuxBuffers > ppfdBest.cAuxBuffers) { @@ -1783,12 +1783,12 @@ void * __wglRealloc( size_t newSize) { void *newPtr = NULL; - + if (newSize != 0) { newPtr = (void *) GlobalAlloc(GPTR, newSize); if (oldPtr && newPtr) { DWORD oldSize = GlobalSize(oldPtr); - + memcpy(newPtr, oldPtr, (oldSize <= newSize ? oldSize : newSize)); GlobalFree(oldPtr); } @@ -1927,7 +1927,7 @@ BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesA)( __wglFree(glyphBuf); return FALSE; /*WGL_STATUS_FAILURE*/ } - + glyphMetricsFloat->gmfBlackBoxX = (FLOAT) glyphMetrics.gmBlackBoxX * ScaleFactor; glyphMetricsFloat->gmfBlackBoxY = @@ -1940,7 +1940,7 @@ BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesA)( (FLOAT) glyphMetrics.gmCellIncX * ScaleFactor; glyphMetricsFloat->gmfCellIncY = (FLOAT) glyphMetrics.gmCellIncY * ScaleFactor; - + /* * Turn the glyph into a display list: */ @@ -1984,7 +1984,7 @@ BOOL APIENTRY _GLD_WGL_EXPORT(UseFontOutlinesA)( * * Gets metrics for the current font and creates an equivalent font * scaled to the design units of the font. - * + * *****************************************************************************/ static HFONT @@ -1996,7 +1996,7 @@ CreateHighResolutionFont(HDC hDC) LOGFONT logFont; otmSize = GetOutlineTextMetrics(hDC, 0, NULL); - if (otmSize == 0) + if (otmSize == 0) return NULL; otm = (OUTLINETEXTMETRIC *) __wglMalloc(otmSize); @@ -2004,14 +2004,14 @@ CreateHighResolutionFont(HDC hDC) return NULL; otm->otmSize = otmSize; - if (GetOutlineTextMetrics(hDC, otmSize, otm) == 0) + if (GetOutlineTextMetrics(hDC, otmSize, otm) == 0) return NULL; - + fontHeight = otm->otmTextMetrics.tmHeight - otm->otmTextMetrics.tmInternalLeading; fontWidth = otm->otmTextMetrics.tmAveCharWidth; fontUnits = (LONG) otm->otmEMSquare; - + ScaleFactor = 1.0F / (FLOAT) fontUnits; logFont.lfHeight = - ((LONG) fontUnits); @@ -2045,7 +2045,7 @@ CreateHighResolutionFont(HDC hDC) /***************************************************************************** * MakeDisplayListFromGlyph - * + * * Converts the outline of a glyph to an OpenGL display list. * * Return value is nonzero for success, zero for failure. @@ -2071,7 +2071,7 @@ MakeDisplayListFromGlyph( IN DWORD listName, chordalDeviation, extrusion, format); - + _GLD_glTranslatef(glyphMetricsFloat->gmfCellIncX, glyphMetricsFloat->gmfCellIncY, 0.0F); @@ -2084,7 +2084,7 @@ MakeDisplayListFromGlyph( IN DWORD listName, /***************************************************************************** * DrawGlyph - * + * * Converts the outline of a glyph to OpenGL drawing primitives, tessellating * as needed, and then draws the glyph. Tessellation of the quadratic splines * in the outline is controlled by "chordalDeviation", and the drawing @@ -2153,7 +2153,7 @@ DrawGlyph( IN UCHAR* glyphBuf, double v[3]; FLOAT *save_p = p; GLfloat z_value; - + /* * This is the hard case. We have to set up a tessellator * to convert the outlines into a set of polygonal @@ -2183,7 +2183,7 @@ DrawGlyph( IN UCHAR* glyphBuf, for (loop = (DWORD) *p++; loop; --loop) { gluTessBeginContourProc(tess); - + for (point = (DWORD) *p++; point; --point) { v[0] = p[0]; @@ -2253,7 +2253,7 @@ DrawGlyph( IN UCHAR* glyphBuf, count = (DWORD) *p++; gluTessBeginContourProc(tess); - + for (point = 0; point < count; point++) { vert = p + ((count-point-1)<<1); @@ -2290,7 +2290,7 @@ exit: /***************************************************************************** * LoadGLUTesselator * - * Maps the glu32.dll module and gets function pointers for the + * Maps the glu32.dll module and gets function pointers for the * tesselator functions. *****************************************************************************/ @@ -2333,31 +2333,31 @@ LoadGLUTesselator(void) if ((gluNewTessProc = (gluNewTessProto) GetProcAddress(gluModuleHandle, "gluNewTess")) == NULL) return FALSE; - + if ((gluDeleteTessProc = (gluDeleteTessProto) GetProcAddress(gluModuleHandle, "gluDeleteTess")) == NULL) return FALSE; - + if ((gluTessBeginPolygonProc = (gluTessBeginPolygonProto) GetProcAddress(gluModuleHandle, "gluTessBeginPolygon")) == NULL) return FALSE; - + if ((gluTessBeginContourProc = (gluTessBeginContourProto) GetProcAddress(gluModuleHandle, "gluTessBeginContour")) == NULL) return FALSE; - + if ((gluTessVertexProc = (gluTessVertexProto) GetProcAddress(gluModuleHandle, "gluTessVertex")) == NULL) return FALSE; - + if ((gluTessEndContourProc = (gluTessEndContourProto) GetProcAddress(gluModuleHandle, "gluTessEndContour")) == NULL) return FALSE; - + if ((gluTessEndPolygonProc = (gluTessEndPolygonProto) GetProcAddress(gluModuleHandle, "gluTessEndPolygon")) == NULL) return FALSE; - + if ((gluTessPropertyProc = (gluTessPropertyProto) GetProcAddress(gluModuleHandle, "gluTessProperty")) == NULL) return FALSE; @@ -2365,7 +2365,7 @@ LoadGLUTesselator(void) if ((gluTessNormalProc = (gluTessNormalProto) GetProcAddress(gluModuleHandle, "gluTessNormal")) == NULL) return FALSE; - + if ((gluTessCallbackProc = (gluTessCallbackProto) GetProcAddress(gluModuleHandle, "gluTessCallback")) == NULL) return FALSE; @@ -2397,7 +2397,7 @@ UnloadGLUTesselator(void) * * Used by tessellator to handle output vertexes. *****************************************************************************/ - + static void CALLBACK TessVertexOut(FLOAT p[3]) { @@ -2426,7 +2426,7 @@ TessVertexOutData(FLOAT p[3], GLfloat z) * Used by tessellator to handle self-intersecting contours and degenerate * geometry. *****************************************************************************/ - + static void CALLBACK TessCombine(double coords[3], void* vertex_data[4], @@ -2447,7 +2447,7 @@ TessCombine(double coords[3], * * Saves the last tessellator error code in the global TessErrorOccurred. *****************************************************************************/ - + static void CALLBACK TessError(GLenum error) { @@ -2458,7 +2458,7 @@ TessError(GLenum error) /***************************************************************************** * MakeLinesFromGlyph - * + * * Converts the outline of a glyph from the TTPOLYGON format to a simple * array of floating-point values containing one or more loops. * @@ -2755,7 +2755,7 @@ MakeLinesFromArc( IN FLOAT x0, midPointX, midPointY, vertexCountIndex, chordalDeviationSquared); - + MakeLinesFromArc( midPointX, midPointY, x12, y12, x2, y2, @@ -2832,7 +2832,7 @@ AppendToLineBuf(FLOAT value) if (LineBufIndex >= LineBufSize) { FLOAT* f; - + f = (FLOAT*) __wglRealloc(LineBuf, (LineBufSize += LINE_BUF_QUANT) * sizeof(FLOAT)); if (!f) diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dll_main.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dll_main.c index 1d7ac64f498..f32d8b0a6d2 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dll_main.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/dll_main.c @@ -390,7 +390,7 @@ BOOL dllReadRegistry( if (bRegistryError || !bSuccess) return FALSE; else - + return TRUE; #undef REG_READ_DWORD diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_dispatch.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_dispatch.c index e05d767e302..40024c5b5f9 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_dispatch.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_dispatch.c @@ -49,7 +49,7 @@ #endif #if 0 -// Altered these to get the dispatch table from +// Altered these to get the dispatch table from // the current context of the calling thread. #define DISPATCH(FUNC, ARGS, MESSAGE) \ GET_CURRENT_CONTEXT(gc); \ diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_driver.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_driver.c index f7c575614b4..df64b41a0a7 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_driver.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/gldirect/gld_driver.c @@ -257,7 +257,7 @@ BOOL gldInitDriverPointers( _gldDriver.GetDisplayMode = gldGetDisplayMode_MesaSW; return TRUE; } - + if ((dwDriver == GLDS_DRIVER_REF) || (dwDriver == GLDS_DRIVER_HAL)) { // Direct3D driver, either HW or SW _gldDriver.CreateDrawable = gldCreateDrawable_DX; diff --git a/reactos/dll/3rdparty/mesa32/src/drivers/windows/icd/icd.c b/reactos/dll/3rdparty/mesa32/src/drivers/windows/icd/icd.c index 4bc6176b1a9..f88f0fec4a6 100644 --- a/reactos/dll/3rdparty/mesa32/src/drivers/windows/icd/icd.c +++ b/reactos/dll/3rdparty/mesa32/src/drivers/windows/icd/icd.c @@ -156,7 +156,7 @@ WGLAPI HGLRC GLAPIENTRY DrvCreateContext(HDC hdc) if ( wgl_ctx[i].ctx == NULL ) { wgl_ctx[i].ctx = WMesaCreateContext( hWnd, NULL, GL_TRUE, - pix[curPFD-1].doubleBuffered, + pix[curPFD-1].doubleBuffered, pix[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE); if (wgl_ctx[i].ctx == NULL) break; diff --git a/reactos/dll/3rdparty/mesa32/src/glapi/dispatch.h b/reactos/dll/3rdparty/mesa32/src/glapi/dispatch.h index 9a456b5409d..981f13ca9f3 100644 --- a/reactos/dll/3rdparty/mesa32/src/glapi/dispatch.h +++ b/reactos/dll/3rdparty/mesa32/src/glapi/dispatch.h @@ -3,18 +3,18 @@ /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/src/glapi/glapi.c b/reactos/dll/3rdparty/mesa32/src/glapi/glapi.c index 39eb9b91bd8..5433b4b341e 100644 --- a/reactos/dll/3rdparty/mesa32/src/glapi/glapi.c +++ b/reactos/dll/3rdparty/mesa32/src/glapi/glapi.c @@ -156,7 +156,7 @@ static GLint NoOpUnused(void) * thread, perhaps running on a different processor, is clearing it. Because * of that, \c ThreadSafe, which can only ever be changed to \c GL_TRUE, is * used to determine whether or not the application is multithreaded. - * + * * In the TLS case, the variables \c _glapi_Dispatch and \c _glapi_Context are * hardcoded to \c NULL. Instead the TLS variables \c _glapi_tls_Dispatch and * \c _glapi_tls_Context are used. Having \c _glapi_Dispatch and @@ -186,7 +186,7 @@ static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ #endif /* defined(THREADS) */ -PUBLIC struct _glapi_table *_glapi_Dispatch = +PUBLIC struct _glapi_table *_glapi_Dispatch = (struct _glapi_table *) __glapi_noop_table; PUBLIC void *_glapi_Context = NULL; @@ -415,7 +415,7 @@ get_static_proc_address(const char *funcName) const glprocs_table_t * const f = find_entry( funcName ); if ( f != NULL ) { - return (_glapi_proc) (gl_dispatch_functions_start + return (_glapi_proc) (gl_dispatch_functions_start + (X86_DISPATCH_FUNCTION_SIZE * f->Offset)); } else { @@ -511,7 +511,7 @@ struct _glapi_function { /** * Pointer to the dispatch stub for the named function. - * + * * \todo * The semantic of this field should be changed slightly. Currently, it * is always expected to be non-\c NULL. However, it would be better to @@ -544,7 +544,7 @@ generate_entrypoint(GLuint functionOffset) * at offset 32 is the first one where the offset in the * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. */ - const GLubyte * const template_func = gl_dispatch_functions_start + const GLubyte * const template_func = gl_dispatch_functions_start + (X86_DISPATCH_FUNCTION_SIZE * 32); GLubyte * const code = (GLubyte *) malloc( X86_DISPATCH_FUNCTION_SIZE ); @@ -621,7 +621,7 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) #if defined(USE_X86_ASM) GLubyte * const code = (GLubyte *) entrypoint; - + #if X86_DISPATCH_FUNCTION_SIZE == 32 *((unsigned int *)(code + 11)) = 4 * offset; *((unsigned int *)(code + 22)) = 4 * offset; @@ -666,9 +666,9 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) * calls \c _glapi_add_dispatch we'll put in the proper offset. If that * never happens, and the user calls this function, he'll segfault. That's * what you get when you try calling a GL function that doesn't really exist. - * + * * \param funcName Name of the function to create an entry-point for. - * + * * \sa _glapi_add_entrypoint */ @@ -676,7 +676,7 @@ static struct _glapi_function * add_function_name( const char * funcName ) { struct _glapi_function * entry = NULL; - + if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { _glapi_proc entrypoint = generate_entrypoint(~0); if (entrypoint != NULL) { @@ -696,7 +696,7 @@ add_function_name( const char * funcName ) /** * Fill-in the dispatch stub for the named function. - * + * * This function is intended to be called by a hardware driver. When called, * a dispatch stub may be created created for the function. A pointer to this * dispatch function will be returned by glXGetProcAddress. @@ -734,7 +734,7 @@ add_function_name( const char * funcName ) * \todo * Determine if code should be added to reject function names that start with * 'glX'. - * + * * \bug * Add code to compare \c parameter_signature with the parameter signature of * a static function. In order to do that, we need to find a way to \b get @@ -770,8 +770,8 @@ _glapi_add_dispatch( const char * const * function_names, if (!function_names[i] || function_names[i][0] != 'g' || function_names[i][1] != 'l') return GL_FALSE; #endif - - + + /* Determine if the named function already exists. If the function does * exist, it must have the same parameter signature as the function * being added. @@ -790,8 +790,8 @@ _glapi_add_dispatch( const char * const * function_names, is_static[i] = GL_TRUE; offset = new_offset; } - - + + for ( j = 0 ; j < NumExtEntryPoints ; j++ ) { if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { /* The offset may be ~0 if the function name was added by @@ -799,7 +799,7 @@ _glapi_add_dispatch( const char * const * function_names, */ if (ExtEntryTable[j].dispatch_offset != ~0) { - if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) + if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) != 0) { return -1; } @@ -810,7 +810,7 @@ _glapi_add_dispatch( const char * const * function_names, offset = ExtEntryTable[j].dispatch_offset; } - + entry[i] = & ExtEntryTable[j]; break; } @@ -841,7 +841,7 @@ _glapi_add_dispatch( const char * const * function_names, entry[i]->dispatch_offset = offset; } } - + return offset; } @@ -1038,8 +1038,8 @@ _glapi_check_table(const struct _glapi_table *table) /** * Perform platform-specific GL API entry-point fixups. - * - * + * + * */ static void init_glapi_relocs( void ) diff --git a/reactos/dll/3rdparty/mesa32/src/glapi/glapioffsets.h b/reactos/dll/3rdparty/mesa32/src/glapi/glapioffsets.h index 9e266450e9e..483e0dc87c4 100644 --- a/reactos/dll/3rdparty/mesa32/src/glapi/glapioffsets.h +++ b/reactos/dll/3rdparty/mesa32/src/glapi/glapioffsets.h @@ -4,18 +4,18 @@ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/src/glapi/glapitable.h b/reactos/dll/3rdparty/mesa32/src/glapi/glapitable.h index b4c70bdaae9..6eafa63e051 100644 --- a/reactos/dll/3rdparty/mesa32/src/glapi/glapitable.h +++ b/reactos/dll/3rdparty/mesa32/src/glapi/glapitable.h @@ -4,18 +4,18 @@ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/src/glapi/glapitemp.h b/reactos/dll/3rdparty/mesa32/src/glapi/glapitemp.h index 70bb05ec6ce..60c27400a50 100644 --- a/reactos/dll/3rdparty/mesa32/src/glapi/glapitemp.h +++ b/reactos/dll/3rdparty/mesa32/src/glapi/glapitemp.h @@ -4,18 +4,18 @@ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/src/glapi/glprocs.h b/reactos/dll/3rdparty/mesa32/src/glapi/glprocs.h index 596a3e4cf9a..6764afd40e1 100644 --- a/reactos/dll/3rdparty/mesa32/src/glapi/glprocs.h +++ b/reactos/dll/3rdparty/mesa32/src/glapi/glprocs.h @@ -4,18 +4,18 @@ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * (C) Copyright IBM Corporation 2004 * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/src/main/accum.c b/reactos/dll/3rdparty/mesa32/src/main/accum.c index 2f7375bd3a0..5191a5bca0f 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/accum.c +++ b/reactos/dll/3rdparty/mesa32/src/main/accum.c @@ -102,7 +102,7 @@ _mesa_Accum( GLenum op, GLfloat value ) -void +void _mesa_init_accum( GLcontext *ctx ) { /* Accumulate buffer group */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/accum.h b/reactos/dll/3rdparty/mesa32/src/main/accum.h index ce92688a5b9..3ad262b36d8 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/accum.h +++ b/reactos/dll/3rdparty/mesa32/src/main/accum.h @@ -1,7 +1,7 @@ /** * \file accum.h * Accumulation buffer operations. - * + * * \if subset * (No-op) * @@ -49,7 +49,7 @@ _mesa_Accum( GLenum op, GLfloat value ); extern void GLAPIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); -extern void +extern void _mesa_init_accum( GLcontext *ctx ); #else diff --git a/reactos/dll/3rdparty/mesa32/src/main/api_arrayelt.c b/reactos/dll/3rdparty/mesa32/src/main/api_arrayelt.c index 41adc1d1d29..adf41f0e1f0 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/api_arrayelt.c +++ b/reactos/dll/3rdparty/mesa32/src/main/api_arrayelt.c @@ -784,7 +784,7 @@ void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) const GLubyte *src = aa->array->BufferObj->Data + (uintptr_t) aa->array->Ptr + elt * aa->array->StrideB; - CALL_by_offset( disp, (array_func), aa->offset, + CALL_by_offset( disp, (array_func), aa->offset, ((const void *) src) ); } } diff --git a/reactos/dll/3rdparty/mesa32/src/main/api_loopback.c b/reactos/dll/3rdparty/mesa32/src/main/api_loopback.c index db30059e61d..0075eb4972e 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/api_loopback.c +++ b/reactos/dll/3rdparty/mesa32/src/main/api_loopback.c @@ -756,14 +756,14 @@ loopback_MultiTexCoord3svARB(GLenum target, const GLshort *v) static void GLAPIENTRY loopback_MultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) { - MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t, + MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t, (GLfloat) r, (GLfloat) q ); } static void GLAPIENTRY loopback_MultiTexCoord4dvARB(GLenum target, const GLdouble *v) { - MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1], + MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3] ); } @@ -1125,7 +1125,7 @@ loopback_VertexAttrib3dvNV(GLuint index, const GLdouble *v) static void GLAPIENTRY loopback_VertexAttrib4svNV(GLuint index, const GLshort *v) { - ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], + ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]); } @@ -1340,7 +1340,7 @@ loopback_VertexAttrib3dvARB(GLuint index, const GLdouble *v) static void GLAPIENTRY loopback_VertexAttrib4svARB(GLuint index, const GLshort *v) { - ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], + ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat)v[3]); } @@ -1482,7 +1482,7 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f); SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f); SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f); - + SET_Indexd(dest, loopback_Indexd); SET_Indexi(dest, loopback_Indexi); SET_Indexs(dest, loopback_Indexs); diff --git a/reactos/dll/3rdparty/mesa32/src/main/api_noop.c b/reactos/dll/3rdparty/mesa32/src/main/api_noop.c index f42f166ae31..2cd3cbd8014 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/api_noop.c +++ b/reactos/dll/3rdparty/mesa32/src/main/api_noop.c @@ -581,9 +581,9 @@ void GLAPIENTRY _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat default: nr = 4 ; break; } - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) + for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<Attrib[i], nr, params ); + COPY_SZ_4V( mat->Attrib[i], nr, params ); _mesa_update_material( ctx, bitmask ); } @@ -793,7 +793,7 @@ void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) /* No effect if vertex maps disabled. */ - if (!ctx->Eval.Map1Vertex4 && + if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3 && !(ctx->VertexProgram._Enabled && ctx->Eval.Map1Attrib[VERT_ATTRIB_POS])) return; @@ -828,7 +828,7 @@ void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, /* No effect if vertex maps disabled. */ - if (!ctx->Eval.Map2Vertex4 && + if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3 && !(ctx->VertexProgram._Enabled && ctx->Eval.Map2Attrib[VERT_ATTRIB_POS])) return; @@ -883,7 +883,7 @@ void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, /* Build a vertexformat full of things to use outside begin/end pairs. - * + * * TODO -- build a whole dispatch table for this purpose, and likewise * for inside begin/end. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/api_noop.h b/reactos/dll/3rdparty/mesa32/src/main/api_noop.h index 56d930e3b04..c0ccb66e25b 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/api_noop.h +++ b/reactos/dll/3rdparty/mesa32/src/main/api_noop.h @@ -121,7 +121,7 @@ extern void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a ); extern void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ); -extern void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, +extern void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); extern void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 ); diff --git a/reactos/dll/3rdparty/mesa32/src/main/attrib.c b/reactos/dll/3rdparty/mesa32/src/main/attrib.c index 28456942cba..4afe8d7d709 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/attrib.c +++ b/reactos/dll/3rdparty/mesa32/src/main/attrib.c @@ -947,7 +947,7 @@ _mesa_PopAttrib(void) /* per-light state */ if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - + for (i = 0; i < MAX_LIGHTS; i++) { GLenum lgt = (GLenum) (GL_LIGHT0 + i); const struct gl_light *l = &light->Light[i]; @@ -962,11 +962,11 @@ _mesa_PopAttrib(void) _mesa_Lightfv( lgt, GL_SPOT_DIRECTION, tmp ); _mesa_Lightfv( lgt, GL_SPOT_EXPONENT, &l->SpotExponent ); _mesa_Lightfv( lgt, GL_SPOT_CUTOFF, &l->SpotCutoff ); - _mesa_Lightfv( lgt, GL_CONSTANT_ATTENUATION, + _mesa_Lightfv( lgt, GL_CONSTANT_ATTENUATION, &l->ConstantAttenuation ); - _mesa_Lightfv( lgt, GL_LINEAR_ATTENUATION, + _mesa_Lightfv( lgt, GL_LINEAR_ATTENUATION, &l->LinearAttenuation ); - _mesa_Lightfv( lgt, GL_QUADRATIC_ATTENUATION, + _mesa_Lightfv( lgt, GL_QUADRATIC_ATTENUATION, &l->QuadraticAttenuation ); } /* light model */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/attrib.h b/reactos/dll/3rdparty/mesa32/src/main/attrib.h index 09d75196b23..8b56a8a67e6 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/attrib.h +++ b/reactos/dll/3rdparty/mesa32/src/main/attrib.h @@ -1,7 +1,7 @@ /** * \file attrib.h * Attribute stacks. - * + * * \if subset * (No-op) * @@ -55,7 +55,7 @@ _mesa_PushClientAttrib( GLbitfield mask ); extern void GLAPIENTRY _mesa_PopClientAttrib( void ); -extern void +extern void _mesa_init_attrib( GLcontext *ctx ); #else diff --git a/reactos/dll/3rdparty/mesa32/src/main/blend.c b/reactos/dll/3rdparty/mesa32/src/main/blend.c index 61b2b17c0c3..85a28371158 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/blend.c +++ b/reactos/dll/3rdparty/mesa32/src/main/blend.c @@ -378,7 +378,7 @@ _mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) * \param func alpha comparison function. * \param ref reference value. * - * Verifies the parameters and updates gl_colorbuffer_attrib. + * Verifies the parameters and updates gl_colorbuffer_attrib. * On a change, flushes the vertices and notifies the driver via * dd_function_table::AlphaFunc callback. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/blend.h b/reactos/dll/3rdparty/mesa32/src/main/blend.h index d6c03d903f4..4161953bbb2 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/blend.h +++ b/reactos/dll/3rdparty/mesa32/src/main/blend.h @@ -72,7 +72,7 @@ extern void GLAPIENTRY _mesa_ColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); -extern void +extern void _mesa_init_color( GLcontext * ctx ); #endif diff --git a/reactos/dll/3rdparty/mesa32/src/main/bufferobj.c b/reactos/dll/3rdparty/mesa32/src/main/bufferobj.c index a1d4c0190a1..46beb089934 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/bufferobj.c +++ b/reactos/dll/3rdparty/mesa32/src/main/bufferobj.c @@ -96,7 +96,7 @@ buffer_object_get_target( GLcontext *ctx, GLenum target, const char * str ) * \sa glBufferSubDataARB, glGetBufferSubDataARB */ static struct gl_buffer_object * -buffer_object_subdata_range_good( GLcontext * ctx, GLenum target, +buffer_object_subdata_range_good( GLcontext * ctx, GLenum target, GLintptrARB offset, GLsizeiptrARB size, const char * str ) { @@ -135,7 +135,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target, /** * Allocate and initialize a new buffer object. - * + * * This function is intended to be called via * \c dd_function_table::NewBufferObject. */ @@ -154,7 +154,7 @@ _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) /** * Delete a buffer object. - * + * * This function is intended to be called via * \c dd_function_table::DeleteBuffer. */ @@ -505,7 +505,7 @@ _mesa_BindBufferARB(GLenum target, GLuint buffer) } newBufObj->RefCount++; } - + switch (target) { case GL_ARRAY_BUFFER_ARB: ctx->Array.ArrayBufferObj = newBufObj; @@ -542,7 +542,7 @@ _mesa_BindBufferARB(GLenum target, GLuint buffer) /** * Delete a set of buffer objects. - * + * * \param n Number of buffer objects to delete. * \param ids Array of \c n buffer object IDs. */ @@ -654,7 +654,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) /** * Generate a set of unique buffer object IDs and store them in \c buffer. - * + * * \param n Number of IDs to generate. * \param buffer Array of \c n locations to store the IDs. */ @@ -703,9 +703,9 @@ _mesa_GenBuffersARB(GLsizei n, GLuint *buffer) /** * Determine if ID is the name of a buffer object. - * + * * \param id ID of the potential buffer object. - * \return \c GL_TRUE if \c id is the name of a buffer object, + * \return \c GL_TRUE if \c id is the name of a buffer object, * \c GL_FALSE otherwise. */ GLboolean GLAPIENTRY @@ -761,11 +761,11 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, _mesa_error(ctx, GL_INVALID_OPERATION, "glBufferDataARB" ); return; } - + if (bufObj->Pointer) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBufferDataARB(buffer is mapped)" ); return; - } + } ASSERT(ctx->Driver.BufferData); diff --git a/reactos/dll/3rdparty/mesa32/src/main/buffers.c b/reactos/dll/3rdparty/mesa32/src/main/buffers.c index 58435e0edef..d6468de3470 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/buffers.c +++ b/reactos/dll/3rdparty/mesa32/src/main/buffers.c @@ -102,14 +102,14 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) /** * Clear buffers. - * + * * \param mask bit-mask indicating the buffers to be cleared. * * Flushes the vertices and verifies the parameter. If __GLcontextRec::NewState * is set then calls _mesa_update_state() to update gl_frame_buffer::_Xmin, * etc. If the rasterization mode is set to GL_RENDER then requests the driver * to clear the buffers, via the dd_function_table::Clear callback. - */ + */ void GLAPIENTRY _mesa_Clear( GLbitfield mask ) { @@ -409,7 +409,7 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) || _mesa_bitcount(destMask[output]) > 1) { _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)"); return; - } + } destMask[output] &= supportedMask; if (destMask[output] == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, diff --git a/reactos/dll/3rdparty/mesa32/src/main/buffers.h b/reactos/dll/3rdparty/mesa32/src/main/buffers.h index 0c7f68ee79e..e5bbed01ab8 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/buffers.h +++ b/reactos/dll/3rdparty/mesa32/src/main/buffers.h @@ -68,10 +68,10 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ); extern void GLAPIENTRY _mesa_SampleCoverageARB(GLclampf value, GLboolean invert); -extern void +extern void _mesa_init_scissor(GLcontext *ctx); -extern void +extern void _mesa_init_multisample(GLcontext *ctx); diff --git a/reactos/dll/3rdparty/mesa32/src/main/clip.c b/reactos/dll/3rdparty/mesa32/src/main/clip.c index 43ef55ee3b5..8ed71c267df 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/clip.c +++ b/reactos/dll/3rdparty/mesa32/src/main/clip.c @@ -116,7 +116,7 @@ _mesa_GetClipPlane( GLenum plane, GLdouble *equation ) equation[3] = (GLdouble) ctx->Transform.EyeUserPlane[p][3]; } -void GLAPIENTRY +void GLAPIENTRY _mesa_CullParameterfvEXT (GLenum cap, GLfloat *v) { GET_CURRENT_CONTEXT(ctx); @@ -126,8 +126,8 @@ _mesa_CullParameterfvEXT (GLenum cap, GLfloat *v) case GL_CULL_VERTEX_EYE_POSITION_EXT: FLUSH_VERTICES(ctx, _NEW_TRANSFORM); COPY_4FV(ctx->Transform.CullEyePos, v); - - _mesa_transform_vector( ctx->Transform.CullObjPos, + + _mesa_transform_vector( ctx->Transform.CullObjPos, ctx->Transform.CullEyePos, ctx->ModelviewMatrixStack.Top->inv ); break; @@ -136,7 +136,7 @@ _mesa_CullParameterfvEXT (GLenum cap, GLfloat *v) FLUSH_VERTICES(ctx, _NEW_TRANSFORM); COPY_4FV(ctx->Transform.CullObjPos, v); - _mesa_transform_vector( ctx->Transform.CullEyePos, + _mesa_transform_vector( ctx->Transform.CullEyePos, ctx->Transform.CullObjPos, ctx->ModelviewMatrixStack.Top->m ); break; @@ -145,11 +145,11 @@ _mesa_CullParameterfvEXT (GLenum cap, GLfloat *v) } } -void GLAPIENTRY +void GLAPIENTRY _mesa_CullParameterdvEXT (GLenum cap, GLdouble *v) { GLfloat f[4]; - + f[0] = (GLfloat)v[0]; f[1] = (GLfloat)v[1]; f[2] = (GLfloat)v[2]; diff --git a/reactos/dll/3rdparty/mesa32/src/main/clip.h b/reactos/dll/3rdparty/mesa32/src/main/clip.h index d53afb45bdf..aea63ef6307 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/clip.h +++ b/reactos/dll/3rdparty/mesa32/src/main/clip.h @@ -33,16 +33,16 @@ #include "mtypes.h" -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_ClipPlane( GLenum plane, const GLdouble *equation ); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetClipPlane( GLenum plane, GLdouble *equation ); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_CullParameterfvEXT (GLenum cap, GLfloat *v); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_CullParameterdvEXT (GLenum cap, GLdouble *v); diff --git a/reactos/dll/3rdparty/mesa32/src/main/colortab.h b/reactos/dll/3rdparty/mesa32/src/main/colortab.h index 4bd16210a0b..cbfdb213507 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/colortab.h +++ b/reactos/dll/3rdparty/mesa32/src/main/colortab.h @@ -1,7 +1,7 @@ /** * \file colortab.h * Color tables. - * + * * \if subset * (No-op) * @@ -85,10 +85,10 @@ _mesa_init_colortable( struct gl_color_table *table ); extern void _mesa_free_colortable_data( struct gl_color_table *table ); -extern void +extern void _mesa_init_colortables( GLcontext *ctx ); -extern void +extern void _mesa_free_colortables_data( GLcontext *ctx ); #else diff --git a/reactos/dll/3rdparty/mesa32/src/main/config.h b/reactos/dll/3rdparty/mesa32/src/main/config.h index de2bae9cb0d..1af4988434e 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/config.h +++ b/reactos/dll/3rdparty/mesa32/src/main/config.h @@ -126,8 +126,8 @@ #define MAX_TEXTURE_IMAGE_UNITS 8 /*@}*/ -/** - * Maximum viewport/image width. Must accomodate all texture sizes too. +/** + * Maximum viewport/image width. Must accomodate all texture sizes too. */ #define MAX_WIDTH 4096 /** Maximum viewport/image height */ @@ -240,7 +240,7 @@ #define ACCUM_BITS 16 /** - * Bits per depth buffer value. + * Bits per depth buffer value. * * Any reasonable value up to 31 will work. 32 doesn't work because of integer * overflow problems in the rasterizer code. @@ -272,7 +272,7 @@ /* * Color channel component order - * + * * \note Changes will almost certainly cause problems at this time. */ #define RCOMP 0 @@ -310,7 +310,7 @@ /** - * Maximum number of temporary vertices required for clipping. + * Maximum number of temporary vertices required for clipping. * * Used in array_cache and tnl modules. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/context.c b/reactos/dll/3rdparty/mesa32/src/main/context.c index 25a3f6a37d4..77f6dba0257 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/context.c +++ b/reactos/dll/3rdparty/mesa32/src/main/context.c @@ -162,10 +162,10 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ); /** * Destroy context callback. - * + * * \param gc context. * \return GL_TRUE on success, or GL_FALSE on failure. - * + * * \ifnot subset * Called by window system/device driver (via __GLexports::destroyCurrent) when * the rendering context is to be destroyed. @@ -185,7 +185,7 @@ _mesa_destroyContext(__GLcontext *gc) /** * Unbind context callback. - * + * * \param gc context. * \return GL_TRUE on success, or GL_FALSE on failure. * @@ -206,7 +206,7 @@ _mesa_loseCurrent(__GLcontext *gc) /** * Bind context callback. - * + * * \param gc context. * \return GL_TRUE on success, or GL_FALSE on failure. * @@ -227,7 +227,7 @@ _mesa_makeCurrent(__GLcontext *gc) /** * Share context callback. - * + * * \param gc context. * \param gcShare shared context. * \return GL_TRUE on success, or GL_FALSE on failure. @@ -304,8 +304,8 @@ _mesa_notifyResize(__GLcontext *gc) * Window/buffer destruction notification callback. * * \param gc GL context. - * - * Called when the context's window/buffer is going to be destroyed. + * + * Called when the context's window/buffer is going to be destroyed. * * No-op */ @@ -318,7 +318,7 @@ _mesa_notifyDestroy(__GLcontext *gc) /** * Swap buffers notification callback. - * + * * \param gc GL context. * * Called by window system just before swapping buffers. @@ -354,11 +354,11 @@ _mesa_endDispatchOverride(__GLcontext *gc) /** * \ifnot subset - * Setup the exports. + * Setup the exports. * * The window system will call these functions when it needs Mesa to do * something. - * + * * \note Device drivers should override these functions! For example, * the Xlib driver should plug in the XMesa*-style functions into this * structure. The XMesa-style functions should then call the _mesa_* @@ -368,7 +368,7 @@ _mesa_endDispatchOverride(__GLcontext *gc) * * \if subset * No-op. - * + * * \endif */ static void @@ -438,7 +438,7 @@ __glCoreNopDispatch(void) /** * Allocates a GLvisual structure and initializes it via * _mesa_initialize_visual(). - * + * * \param rgbFlag GL_TRUE for RGB(A) mode, GL_FALSE for Color Index mode. * \param dbFlag double buffering * \param stereoFlag stereo buffer @@ -454,7 +454,7 @@ __glCoreNopDispatch(void) * \param blueBits same as above. * \param alphaBits same as above. * \param numSamples not really used. - * + * * \return pointer to new GLvisual or NULL if requested parameters can't be * met. * @@ -577,7 +577,7 @@ _mesa_initialize_visual( GLvisual *vis, * Destroy a visual and free its memory. * * \param vis visual. - * + * * Frees the visual structure. */ void @@ -805,7 +805,7 @@ alloc_shared_state( GLcontext *ctx ) * * \param ctx GL context. * \param ss shared state pointer. - * + * * Frees the display lists, the texture objects (calling the driver texture * deletion callback to free its private data) and the vertex programs, as well * as their hash tables. @@ -924,7 +924,7 @@ _mesa_init_current( GLcontext *ctx ) * Use defaults from config.h. The device drivers will often override * some of these values (such as number of texture units). */ -static void +static void _mesa_init_constants( GLcontext *ctx ) { assert(ctx); @@ -1130,7 +1130,7 @@ alloc_dispatch_table(void) * Note that the driver needs to pass in its dd_function_table here since * we need to at least call driverFunctions->NewTextureObject to create the * default texture objects. - * + * * Called by _mesa_create_context(). * * Performs the imports and exports callback tables initialization, and @@ -1217,7 +1217,7 @@ _mesa_initialize_context( GLcontext *ctx, _mesa_init_dlist_table(ctx->Save); _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); /* Neutral tnl module stuff */ - _mesa_init_exec_vtxfmt( ctx ); + _mesa_init_exec_vtxfmt( ctx ); ctx->TnlModule.Current = NULL; ctx->TnlModule.SwapCount = 0; #endif @@ -1240,7 +1240,7 @@ _mesa_initialize_context( GLcontext *ctx, * \param driverFunctions points to the dd_function_table into which the * driver has plugged in all its special functions. * \param driverCtx points to the device driver's private context state - * + * * \return pointer to a new __GLcontextRec or NULL if error. */ GLcontext * @@ -1272,7 +1272,7 @@ _mesa_create_context( const GLvisual *visual, /** * Free the data associated with the given context. - * + * * But doesn't free the GLcontext struct itself. * * \sa _mesa_initialize_context() and init_attrib_groups(). @@ -1321,7 +1321,7 @@ _mesa_free_context_data( GLcontext *ctx ) * Destroy a GLcontext structure. * * \param ctx GL context. - * + * * Calls _mesa_free_context_data() and frees the GLcontext structure itself. */ void @@ -1337,7 +1337,7 @@ _mesa_destroy_context( GLcontext *ctx ) #if _HAVE_FULL_GL /** * Copy attribute groups from one context to another. - * + * * \param src source context * \param dst destination context * \param mask bitwise OR of GL_*_BIT flags @@ -1461,7 +1461,7 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) * by checking visual attributes. * \return GL_TRUE if compatible, GL_FALSE otherwise. */ -static GLboolean +static GLboolean check_compatible(const GLcontext *ctx, const GLframebuffer *buffer) { const GLvisual *ctxvis = &ctx->Visual; @@ -1505,11 +1505,11 @@ check_compatible(const GLcontext *ctx, const GLframebuffer *buffer) * context. * \param drawBuffer draw framebuffer. * \param readBuffer read framebuffer. - * + * * Check that the context's and framebuffer's visuals are compatible, returning * immediately otherwise. Sets the glapi current context via * _glapi_set_context(). If \p newCtx is not NULL, associates \p drawBuffer and - * \p readBuffer with it and calls dd_function_table::ResizeBuffers if the buffers size has changed. + * \p readBuffer with it and calls dd_function_table::ResizeBuffers if the buffers size has changed. * Calls dd_function_table::MakeCurrent callback if defined. * * When a context is bound by the first time and the \c MESA_INFO environment @@ -1648,9 +1648,9 @@ _mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare) /** * Get current context for the calling thread. - * + * * \return pointer to the current GL context. - * + * * Calls _glapi_get_context(). This isn't the fastest way to get the current * context. If you need speed, see the #GET_CURRENT_CONTEXT macro in context.h. */ @@ -1665,7 +1665,7 @@ _mesa_get_current_context( void ) * * It'll either be the immediate-mode execute dispatcher or the display list * compile dispatcher. - * + * * \param ctx GL context. * * \return pointer to dispatch_table. @@ -1691,7 +1691,7 @@ _mesa_get_dispatch(GLcontext *ctx) * * \param ctx GL context. * \param error error code. - * + * * Records the given error code and call the driver's dd_function_table::Error * function if defined. * diff --git a/reactos/dll/3rdparty/mesa32/src/main/context.h b/reactos/dll/3rdparty/mesa32/src/main/context.h index 8b7e7c9952b..5aaed4436d7 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/context.h +++ b/reactos/dll/3rdparty/mesa32/src/main/context.h @@ -56,7 +56,7 @@ /**********************************************************************/ /** \name Create/destroy a GLvisual. */ /*@{*/ - + extern GLvisual * _mesa_create_visual( GLboolean rgbFlag, GLboolean dbFlag, @@ -251,7 +251,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair, with return value. - * + * * \param ctx GL context. * \param retval value to return value in case the assertion fails. */ @@ -266,7 +266,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair. - * + * * \param ctx GL context. */ #define ASSERT_OUTSIDE_BEGIN_END(ctx) \ @@ -280,7 +280,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices. - * + * * \param ctx GL context. */ #define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx) \ @@ -292,7 +292,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices, with return value. - * + * * \param ctx GL context. * \param retval value to return value in case the assertion fails. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/convolve.c b/reactos/dll/3rdparty/mesa32/src/main/convolve.c index 6b97c7f56cd..8763bf068c3 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/convolve.c +++ b/reactos/dll/3rdparty/mesa32/src/main/convolve.c @@ -476,19 +476,19 @@ _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) break; case GL_CONVOLUTION_FILTER_SCALE: /* COPY_4V(ctx->Pixel.ConvolutionFilterScale[c], params); */ - /* need cast to prevent compiler warnings */ - ctx->Pixel.ConvolutionFilterScale[c][0] = (GLfloat) params[0]; - ctx->Pixel.ConvolutionFilterScale[c][1] = (GLfloat) params[1]; - ctx->Pixel.ConvolutionFilterScale[c][2] = (GLfloat) params[2]; - ctx->Pixel.ConvolutionFilterScale[c][3] = (GLfloat) params[3]; + /* need cast to prevent compiler warnings */ + ctx->Pixel.ConvolutionFilterScale[c][0] = (GLfloat) params[0]; + ctx->Pixel.ConvolutionFilterScale[c][1] = (GLfloat) params[1]; + ctx->Pixel.ConvolutionFilterScale[c][2] = (GLfloat) params[2]; + ctx->Pixel.ConvolutionFilterScale[c][3] = (GLfloat) params[3]; break; case GL_CONVOLUTION_FILTER_BIAS: /* COPY_4V(ctx->Pixel.ConvolutionFilterBias[c], params); */ - /* need cast to prevent compiler warnings */ - ctx->Pixel.ConvolutionFilterBias[c][0] = (GLfloat) params[0]; - ctx->Pixel.ConvolutionFilterBias[c][1] = (GLfloat) params[1]; - ctx->Pixel.ConvolutionFilterBias[c][2] = (GLfloat) params[2]; - ctx->Pixel.ConvolutionFilterBias[c][3] = (GLfloat) params[3]; + /* need cast to prevent compiler warnings */ + ctx->Pixel.ConvolutionFilterBias[c][0] = (GLfloat) params[0]; + ctx->Pixel.ConvolutionFilterBias[c][1] = (GLfloat) params[1]; + ctx->Pixel.ConvolutionFilterBias[c][2] = (GLfloat) params[2]; + ctx->Pixel.ConvolutionFilterBias[c][3] = (GLfloat) params[3]; break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(pname)"); @@ -522,7 +522,7 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi return; } - ctx->Driver.CopyConvolutionFilter1D( ctx, target, + ctx->Driver.CopyConvolutionFilter1D( ctx, target, internalFormat, x, y, width); } @@ -554,7 +554,7 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi return; } - ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, + ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, width, height ); } diff --git a/reactos/dll/3rdparty/mesa32/src/main/dd.h b/reactos/dll/3rdparty/mesa32/src/main/dd.h index e4c103c55e4..3f75e14e6f5 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/dd.h +++ b/reactos/dll/3rdparty/mesa32/src/main/dd.h @@ -59,7 +59,7 @@ struct dd_function_table { const GLubyte * (*GetString)( GLcontext *ctx, GLenum name ); /** - * Notify the driver after Mesa has made some internal state changes. + * Notify the driver after Mesa has made some internal state changes. * * This is in addition to any state change callbacks Mesa may already have * made. @@ -81,7 +81,7 @@ struct dd_function_table { GLuint width, GLuint height); /** - * Called whenever an error is generated. + * Called whenever an error is generated. * * __GLcontextRec::ErrorValue contains the error value. */ @@ -104,7 +104,7 @@ struct dd_function_table { * which buffers need to be cleared. * \param all if true then clear the whole buffer, else clear only the * region defined by (x, y, width, height). - * + * * This function must obey the glColorMask(), glIndexMask() and * glStencilMask() settings! * Software Mesa can do masked clears if the device driver can't. @@ -151,7 +151,7 @@ struct dd_function_table { GLvoid *dest ); /** - * Do a glCopyPixels(). + * Do a glCopyPixels(). * * This function must respect all rasterization state, glPixelTransfer(), * glPixelZoom(), etc. @@ -161,7 +161,7 @@ struct dd_function_table { GLint dstx, GLint dsty, GLenum type ); /** - * This is called by glBitmap(). + * This is called by glBitmap(). * * Works the same as dd_function_table::DrawPixels, above. */ @@ -171,7 +171,7 @@ struct dd_function_table { const GLubyte *bitmap ); /*@}*/ - + /** * \name Texture image functions */ @@ -179,7 +179,7 @@ struct dd_function_table { /** * Choose texture format. - * + * * This is called by the \c _mesa_store_tex[sub]image[123]d() fallback * functions. The driver should examine \p internalFormat and return a * pointer to an appropriate gl_texture_format. @@ -189,7 +189,7 @@ struct dd_function_table { /** * Called by glTexImage1D(). - * + * * \param target user specified. * \param format user specified. * \param type user specified. @@ -198,7 +198,7 @@ struct dd_function_table { * \param texObj is the target texture object. * \param texImage is the target texture image. It will have the texture \p * width, \p height, \p depth, \p border and \p internalFormat information. - * + * * \p retainInternalCopy is returned by this function and indicates whether * core Mesa should keep an internal copy of the texture image. * @@ -214,7 +214,7 @@ struct dd_function_table { /** * Called by glTexImage2D(). - * + * * \sa dd_function_table::TexImage1D. */ void (*TexImage2D)( GLcontext *ctx, GLenum target, GLint level, @@ -224,10 +224,10 @@ struct dd_function_table { const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage ); - + /** * Called by glTexImage3D(). - * + * * \sa dd_function_table::TexImage1D. */ void (*TexImage3D)( GLcontext *ctx, GLenum target, GLint level, @@ -266,7 +266,7 @@ struct dd_function_table { const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage ); - + /** * Called by glTexSubImage2D(). * @@ -280,7 +280,7 @@ struct dd_function_table { const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage ); - + /** * Called by glTexSubImage3D(). * @@ -305,7 +305,7 @@ struct dd_function_table { /** * Called by glCopyTexImage1D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexImage1D)( GLcontext *ctx, GLenum target, GLint level, @@ -314,7 +314,7 @@ struct dd_function_table { /** * Called by glCopyTexImage2D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexImage2D)( GLcontext *ctx, GLenum target, GLint level, @@ -323,7 +323,7 @@ struct dd_function_table { /** * Called by glCopyTexSubImage1D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexSubImage1D)( GLcontext *ctx, GLenum target, GLint level, @@ -331,7 +331,7 @@ struct dd_function_table { GLint x, GLint y, GLsizei width ); /** * Called by glCopyTexSubImage2D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexSubImage2D)( GLcontext *ctx, GLenum target, GLint level, @@ -340,7 +340,7 @@ struct dd_function_table { GLsizei width, GLsizei height ); /** * Called by glCopyTexSubImage3D(). - * + * * Drivers should use a fallback routine from texstore.c if needed. */ void (*CopyTexSubImage3D)( GLcontext *ctx, GLenum target, GLint level, @@ -350,7 +350,7 @@ struct dd_function_table { /** * Called by glTexImage[123]D when user specifies a proxy texture - * target. + * target. * * \return GL_TRUE if the proxy test passes, or GL_FALSE if the test fails. */ @@ -361,7 +361,7 @@ struct dd_function_table { GLint depth, GLint border); /*@}*/ - + /** * \name Compressed texture functions */ @@ -378,7 +378,7 @@ struct dd_function_table { * \param texObj is the target texture object. * \param texImage is the target texture image. It will have the texture \p * width, \p height, \p depth, \p border and \p internalFormat information. - * + * * \a retainInternalCopy is returned by this function and indicates whether * core Mesa should keep an internal copy of the texture image. */ @@ -414,7 +414,7 @@ struct dd_function_table { /** * Called by glCompressedTexSubImage1D(). - * + * * \param target user specified. * \param level user specified. * \param xoffset user specified. @@ -497,7 +497,7 @@ struct dd_function_table { struct gl_texture_object * (*NewTextureObject)( GLcontext *ctx, GLuint name, GLenum target ); /** - * Called when a texture object is about to be deallocated. + * Called when a texture object is about to be deallocated. * * Driver should delete the gl_texture_object object and anything * hanging off of it. @@ -509,7 +509,7 @@ struct dd_function_table { */ struct gl_texture_image * (*NewTextureImage)( GLcontext *ctx ); - /** + /** * Called to free tImage->Data. */ void (*FreeTexImageData)( GLcontext *ctx, struct gl_texture_image *tImage ); @@ -520,7 +520,7 @@ struct dd_function_table { * that knows for sure how the texture memory is allocated - via * the above callbacks. There is then an argument that the driver * knows what memcpy paths might be fast. Typically this is invoked with - * + * * to -- a pointer into texture memory allocated by NewTextureImage() above. * from -- a pointer into client memory or a mesa temporary. * sz -- nr bytes to copy. @@ -546,7 +546,7 @@ struct dd_function_table { /** * Called when the texture's color lookup table is changed. - * + * * If \p tObj is NULL then the shared texture palette * gl_texture_object::Palette is to be updated. */ @@ -554,7 +554,7 @@ struct dd_function_table { struct gl_texture_object *tObj ); /*@}*/ - + /** * \name Imaging functionality */ @@ -587,17 +587,17 @@ struct dd_function_table { /** Allocate a new program */ struct program * (*NewProgram)(GLcontext *ctx, GLenum target, GLuint id); /** Delete a program */ - void (*DeleteProgram)(GLcontext *ctx, struct program *prog); + void (*DeleteProgram)(GLcontext *ctx, struct program *prog); /** Notify driver that a program string has been specified. */ - void (*ProgramStringNotify)(GLcontext *ctx, GLenum target, + void (*ProgramStringNotify)(GLcontext *ctx, GLenum target, struct program *prog); - + /** Query if program can be loaded onto hardware */ - GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target, + GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target, struct program *prog); - + /*@}*/ @@ -747,7 +747,7 @@ struct dd_function_table { /*@}*/ - /** + /** * \name State-query functions * * Return GL_TRUE if query was completed, GL_FALSE otherwise. @@ -764,7 +764,7 @@ struct dd_function_table { /** Return the value or values of a selected parameter */ GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result); /*@}*/ - + /** * \name Vertex/pixel buffer object functions @@ -776,7 +776,7 @@ struct dd_function_table { struct gl_buffer_object * (*NewBufferObject)( GLcontext *ctx, GLuint buffer, GLenum target ); - + void (*DeleteBuffer)( GLcontext *ctx, struct gl_buffer_object *obj ); void (*BufferData)( GLcontext *ctx, GLenum target, GLsizeiptrARB size, @@ -806,7 +806,7 @@ struct dd_function_table { /*@{*/ struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name); struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name); - void (*FramebufferRenderbuffer)(GLcontext *ctx, + void (*FramebufferRenderbuffer)(GLcontext *ctx, struct gl_renderbuffer_attachment *att, struct gl_renderbuffer *rb); void (*RenderbufferTexture)(GLcontext *ctx, @@ -829,7 +829,7 @@ struct dd_function_table { GLuint NeedValidate; /** - * Validate the current T&L module. + * Validate the current T&L module. * * This is called directly after UpdateState() when a state change that has * occurred matches the dd_function_table::NeedValidate bitmask above. This @@ -847,14 +847,14 @@ struct dd_function_table { #define PRIM_UNKNOWN GL_POLYGON+3 /** - * Set by the driver-supplied T&L engine. + * Set by the driver-supplied T&L engine. * * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd(). */ GLuint CurrentExecPrimitive; /** - * Current state of an in-progress compilation. + * Current state of an in-progress compilation. * * May take on any of the additional values PRIM_OUTSIDE_BEGIN_END, * PRIM_INSIDE_UNKNOWN_PRIM or PRIM_UNKNOWN defined above. @@ -925,7 +925,7 @@ struct dd_function_table { * * Notify the T&L component before and after calling a display list. */ - void (*BeginCallList)( GLcontext *ctx, + void (*BeginCallList)( GLcontext *ctx, struct mesa_display_list *dlist ); /** * Called by glEndCallList(). diff --git a/reactos/dll/3rdparty/mesa32/src/main/debug.c b/reactos/dll/3rdparty/mesa32/src/main/debug.c index edc32b1f94d..fbf60155d9f 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/debug.c +++ b/reactos/dll/3rdparty/mesa32/src/main/debug.c @@ -150,39 +150,39 @@ void _mesa_print_info( void ) static void add_debug_flags( const char *debug ) { #ifdef MESA_DEBUG - if (_mesa_strstr(debug, "varray")) + if (_mesa_strstr(debug, "varray")) MESA_VERBOSE |= VERBOSE_VARRAY; - if (_mesa_strstr(debug, "tex")) + if (_mesa_strstr(debug, "tex")) MESA_VERBOSE |= VERBOSE_TEXTURE; - if (_mesa_strstr(debug, "imm")) + if (_mesa_strstr(debug, "imm")) MESA_VERBOSE |= VERBOSE_IMMEDIATE; - if (_mesa_strstr(debug, "pipe")) + if (_mesa_strstr(debug, "pipe")) MESA_VERBOSE |= VERBOSE_PIPELINE; - if (_mesa_strstr(debug, "driver")) + if (_mesa_strstr(debug, "driver")) MESA_VERBOSE |= VERBOSE_DRIVER; - if (_mesa_strstr(debug, "state")) + if (_mesa_strstr(debug, "state")) MESA_VERBOSE |= VERBOSE_STATE; - if (_mesa_strstr(debug, "api")) + if (_mesa_strstr(debug, "api")) MESA_VERBOSE |= VERBOSE_API; - if (_mesa_strstr(debug, "list")) + if (_mesa_strstr(debug, "list")) MESA_VERBOSE |= VERBOSE_DISPLAY_LIST; - if (_mesa_strstr(debug, "lighting")) + if (_mesa_strstr(debug, "lighting")) MESA_VERBOSE |= VERBOSE_LIGHTING; - if (_mesa_strstr(debug, "disassem")) + if (_mesa_strstr(debug, "disassem")) MESA_VERBOSE |= VERBOSE_DISASSEM; - + /* Debug flag: */ - if (_mesa_strstr(debug, "flush")) + if (_mesa_strstr(debug, "flush")) MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; #else (void) debug; @@ -190,7 +190,7 @@ static void add_debug_flags( const char *debug ) } -void +void _mesa_init_debug( GLcontext *ctx ) { char *c; diff --git a/reactos/dll/3rdparty/mesa32/src/main/debug.h b/reactos/dll/3rdparty/mesa32/src/main/debug.h index 94d99c384bd..ed271705768 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/debug.h +++ b/reactos/dll/3rdparty/mesa32/src/main/debug.h @@ -25,7 +25,7 @@ /** * \file debug.h * Debugging functions. - * + * * \if subset * (No-op) * diff --git a/reactos/dll/3rdparty/mesa32/src/main/depth.h b/reactos/dll/3rdparty/mesa32/src/main/depth.h index dcc0b4637a7..740bda248f5 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/depth.h +++ b/reactos/dll/3rdparty/mesa32/src/main/depth.h @@ -49,7 +49,7 @@ _mesa_DepthMask( GLboolean flag ); extern void GLAPIENTRY _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ); -extern void +extern void _mesa_init_depth( GLcontext * ctx ); #else diff --git a/reactos/dll/3rdparty/mesa32/src/main/dlist.c b/reactos/dll/3rdparty/mesa32/src/main/dlist.c index 7bd11c31af5..ce385c5c284 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/dlist.c +++ b/reactos/dll/3rdparty/mesa32/src/main/dlist.c @@ -108,7 +108,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair, with return value. - * + * * \param ctx GL context. * \param retval value to return value in case the assertion fails. */ @@ -124,7 +124,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair. - * + * * \param ctx GL context. */ #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \ @@ -139,7 +139,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices. - * + * * \param ctx GL context. */ #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \ @@ -151,7 +151,7 @@ do { \ /** * Macro to assert that the API call was made outside the * glBegin()/glEnd() pair and flush the vertices, with return value. - * + * * \param ctx GL context. * \param retval value to return value in case the assertion fails. */ @@ -328,7 +328,7 @@ typedef enum { OPCODE_STENCIL_FUNC_SEPARATE, OPCODE_STENCIL_OP_SEPARATE, OPCODE_STENCIL_MASK_SEPARATE, - + /* Vertex attributes -- fallback for when optimized display * list build isn't active. */ @@ -441,7 +441,7 @@ void _mesa_destroy_list( GLcontext *ctx, GLuint list ) dlist = (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList, list); if (!dlist) return; - + n = block = dlist->node; done = block ? GL_FALSE : GL_TRUE; @@ -1074,7 +1074,7 @@ static void GLAPIENTRY save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfact n[4].e = dfactorA; } if (ctx->ExecuteFlag) { - CALL_BlendFuncSeparateEXT(ctx->Exec, + CALL_BlendFuncSeparateEXT(ctx->Exec, (sfactorRGB, dfactorRGB, sfactorA, dfactorA)); } } @@ -1109,7 +1109,7 @@ void GLAPIENTRY _mesa_save_CallList( GLuint list ) if (n) { n[1].ui = list; } - + /* After this, we don't know what begin/end state we're in: */ ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; @@ -4805,7 +4805,7 @@ save_BindFragmentShaderATI(GLuint id) { GET_CURRENT_CONTEXT(ctx); Node *n; - + n = ALLOC_INSTRUCTION( ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); if (n) { n[1].ui = id; @@ -4820,7 +4820,7 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value) { GET_CURRENT_CONTEXT(ctx); Node *n; - + n = ALLOC_INSTRUCTION( ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); if (n) { n[1].ui = dst; @@ -5173,7 +5173,7 @@ static void GLAPIENTRY save_Materialfv( GLenum face, GLenum pname, const GLfloat { GLuint bitmask = _mesa_material_bitmask( ctx, face, pname, ~0, NULL ); - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) + for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<ListState.ActiveMaterialSize[i] = args; COPY_SZ_4V( ctx->ListState.CurrentMaterial[i], args, param ); @@ -5447,7 +5447,7 @@ static void GLAPIENTRY save_VertexAttrib1fNV( GLuint index, GLfloat x ) if (index < VERT_ATTRIB_MAX) save_Attr1fNV( index, x ); else - enum_error(); + enum_error(); } static void GLAPIENTRY save_VertexAttrib1fvNV( GLuint index, const GLfloat *v ) @@ -5474,7 +5474,7 @@ static void GLAPIENTRY save_VertexAttrib2fvNV( GLuint index, const GLfloat *v ) enum_error(); } -static void GLAPIENTRY save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y, +static void GLAPIENTRY save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y, GLfloat z ) { if (index < VERT_ATTRIB_MAX) @@ -5517,7 +5517,7 @@ save_VertexAttrib1fARB( GLuint index, GLfloat x ) if (index < VERT_ATTRIB_MAX) save_Attr1fARB( index, x ); else - enum_error(); + enum_error(); } static void GLAPIENTRY @@ -6389,11 +6389,11 @@ execute_list( GLcontext *ctx, GLuint list ) case OPCODE_BIND_FRAGMENT_SHADER_ATI: CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i)); break; - case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI: + case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI: { GLfloat values[4]; GLuint i, dst = n[1].ui; - + for (i = 0; i < 4; i++) values[i] = n[1+i].f; CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, values)); @@ -6410,20 +6410,20 @@ execute_list( GLcontext *ctx, GLuint list ) * on. With x86_64 becoming common, this will start to * matter more. */ - if (sizeof(Node)==sizeof(GLfloat)) + if (sizeof(Node)==sizeof(GLfloat)) CALL_VertexAttrib2fvNV(ctx->Exec, (n[1].e, &n[2].f)); else CALL_VertexAttrib2fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f)); break; case OPCODE_ATTR_3F_NV: - if (sizeof(Node)==sizeof(GLfloat)) + if (sizeof(Node)==sizeof(GLfloat)) CALL_VertexAttrib3fvNV(ctx->Exec, (n[1].e, &n[2].f)); else CALL_VertexAttrib3fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f, n[4].f)); break; case OPCODE_ATTR_4F_NV: - if (sizeof(Node)==sizeof(GLfloat)) + if (sizeof(Node)==sizeof(GLfloat)) CALL_VertexAttrib4fvNV(ctx->Exec, (n[1].e, &n[2].f)); else CALL_VertexAttrib4fNV(ctx->Exec, (n[1].e, n[2].f, n[3].f, @@ -6439,27 +6439,27 @@ execute_list( GLcontext *ctx, GLuint list ) * on. With x86_64 becoming common, this will start to * matter more. */ - if (sizeof(Node)==sizeof(GLfloat)) + if (sizeof(Node)==sizeof(GLfloat)) CALL_VertexAttrib2fvARB(ctx->Exec, (n[1].e, &n[2].f)); else CALL_VertexAttrib2fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f)); break; case OPCODE_ATTR_3F_ARB: - if (sizeof(Node)==sizeof(GLfloat)) + if (sizeof(Node)==sizeof(GLfloat)) CALL_VertexAttrib3fvARB(ctx->Exec, (n[1].e, &n[2].f)); else CALL_VertexAttrib3fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f, n[4].f)); break; case OPCODE_ATTR_4F_ARB: - if (sizeof(Node)==sizeof(GLfloat)) + if (sizeof(Node)==sizeof(GLfloat)) CALL_VertexAttrib4fvARB(ctx->Exec, (n[1].e, &n[2].f)); else CALL_VertexAttrib4fARB(ctx->Exec, (n[1].e, n[2].f, n[3].f, n[4].f, n[5].f)); break; case OPCODE_MATERIAL: - if (sizeof(Node)==sizeof(GLfloat)) + if (sizeof(Node)==sizeof(GLfloat)) CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, &n[3].f)); else { GLfloat f[4]; @@ -6665,7 +6665,7 @@ _mesa_NewList( GLuint list, GLenum mode ) for (i = 0; i < MAT_ATTRIB_MAX; i++) ctx->ListState.ActiveMaterialSize[i] = 0; - + ctx->ListState.ActiveIndex = 0; ctx->ListState.ActiveEdgeFlag = 0; @@ -6679,7 +6679,7 @@ _mesa_NewList( GLuint list, GLenum mode ) /* - * End definition of current display list. + * End definition of current display list. */ void GLAPIENTRY _mesa_EndList( void ) @@ -8062,7 +8062,7 @@ static void GLAPIENTRY print_list( GLcontext *ctx, GLuint list ) return; n = dlist->node; - + _mesa_printf("START-LIST %u, address %p\n", list, (void*)n ); done = n ? GL_FALSE : GL_TRUE; diff --git a/reactos/dll/3rdparty/mesa32/src/main/drawpix.c b/reactos/dll/3rdparty/mesa32/src/main/drawpix.c index 4f7e24a1ec4..d938935456e 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/drawpix.c +++ b/reactos/dll/3rdparty/mesa32/src/main/drawpix.c @@ -139,7 +139,7 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, else if (ctx->RenderMode == GL_FEEDBACK) { FLUSH_CURRENT( ctx, 0 ); FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN ); - _mesa_feedback_vertex( ctx, + _mesa_feedback_vertex( ctx, ctx->Current.RasterPos, ctx->Current.RasterColor, ctx->Current.RasterIndex, @@ -236,7 +236,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height, _mesa_feedback_vertex( ctx, ctx->Current.RasterPos, ctx->Current.RasterColor, - ctx->Current.RasterIndex, + ctx->Current.RasterIndex, ctx->Current.RasterTexCoords[0] ); } else { diff --git a/reactos/dll/3rdparty/mesa32/src/main/enable.c b/reactos/dll/3rdparty/mesa32/src/main/enable.c index 67fd083ca82..f25b5ac27b4 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/enable.c +++ b/reactos/dll/3rdparty/mesa32/src/main/enable.c @@ -270,7 +270,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) } else { ctx->Transform.ClipPlanesEnabled &= ~(1 << p); - } + } } break; #endif @@ -362,7 +362,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; else ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; - + break; case GL_LINE_SMOOTH: if (ctx->Line.SmoothFlag == state) @@ -857,7 +857,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap); if (ctx->VertexProgram.Enabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.Enabled = state; break; case GL_VERTEX_PROGRAM_POINT_SIZE_NV: @@ -871,7 +871,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap); if (ctx->VertexProgram.TwoSideEnabled == state) return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); + FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.TwoSideEnabled = state; break; case GL_MAP1_VERTEX_ATTRIB0_4_NV: diff --git a/reactos/dll/3rdparty/mesa32/src/main/enums.c b/reactos/dll/3rdparty/mesa32/src/main/enums.c index 837618cd74a..d0e4cf56e72 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/enums.c +++ b/reactos/dll/3rdparty/mesa32/src/main/enums.c @@ -3,18 +3,18 @@ /* * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL @@ -34,7 +34,7 @@ typedef struct { int n; } enum_elt; -static const char enum_string_table[] = +static const char enum_string_table[] = "GL_2D\0" "GL_2_BYTES\0" "GL_3D\0" diff --git a/reactos/dll/3rdparty/mesa32/src/main/enums.h b/reactos/dll/3rdparty/mesa32/src/main/enums.h index 7e8d4ee94fc..7347668d4f0 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/enums.h +++ b/reactos/dll/3rdparty/mesa32/src/main/enums.h @@ -1,7 +1,7 @@ /** * \file enums.h * Enumeration name/number lookup functions. - * + * * \if subset * (No-op) * diff --git a/reactos/dll/3rdparty/mesa32/src/main/eval.c b/reactos/dll/3rdparty/mesa32/src/main/eval.c index 3f89f9c1eae..7e6ef5b0e01 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/eval.c +++ b/reactos/dll/3rdparty/mesa32/src/main/eval.c @@ -533,7 +533,7 @@ _mesa_Map2d( GLenum target, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points ) { - map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder, + map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder, (GLfloat) v1, (GLfloat) v2, vstride, vorder, points, GL_DOUBLE); } @@ -792,7 +792,7 @@ void GLAPIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { - _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2, + _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2, vn, (GLfloat) v1, (GLfloat) v2 ); } @@ -821,7 +821,7 @@ init_1d_map( struct gl_1d_map *map, int n, const float *initial ) /** - * Initialize a 2-D evaluator map + * Initialize a 2-D evaluator map */ static void init_2d_map( struct gl_2d_map *map, int n, const float *initial ) diff --git a/reactos/dll/3rdparty/mesa32/src/main/eval.h b/reactos/dll/3rdparty/mesa32/src/main/eval.h index b3ff0a96f82..5b14875a48b 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/eval.h +++ b/reactos/dll/3rdparty/mesa32/src/main/eval.h @@ -1,7 +1,7 @@ /** * \file eval.h * Eval operations. - * + * * \if subset * (No-op) * diff --git a/reactos/dll/3rdparty/mesa32/src/main/execmem.c b/reactos/dll/3rdparty/mesa32/src/main/execmem.c index a6b110ae7ea..be2192310bb 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/execmem.c +++ b/reactos/dll/3rdparty/mesa32/src/main/execmem.c @@ -61,10 +61,10 @@ init_heap(void) { if (!exec_heap) exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); - + if (!exec_mem) - exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, - PROT_EXEC | PROT_READ | PROT_WRITE, + exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, + PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); } @@ -88,19 +88,19 @@ _mesa_exec_malloc(GLuint size) addr = exec_mem + block->ofs; _glthread_UNLOCK_MUTEX(exec_mutex); - + return addr; } - -void + +void _mesa_exec_free(void *addr) { _glthread_LOCK_MUTEX(exec_mutex); if (exec_heap) { PMemBlock block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem); - + if (block) mmFreeMem(block); } @@ -121,8 +121,8 @@ _mesa_exec_malloc(GLuint size) return _mesa_malloc( size ); } - -void + +void _mesa_exec_free(void *addr) { _mesa_free(addr); diff --git a/reactos/dll/3rdparty/mesa32/src/main/extensions.h b/reactos/dll/3rdparty/mesa32/src/main/extensions.h index 9d843a8b6b6..250071d394f 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/extensions.h +++ b/reactos/dll/3rdparty/mesa32/src/main/extensions.h @@ -1,7 +1,7 @@ /** * \file extensions.h * Extension handling. - * + * * \if subset * (No-op) * diff --git a/reactos/dll/3rdparty/mesa32/src/main/feedback.c b/reactos/dll/3rdparty/mesa32/src/main/feedback.c index 48c2ccbff30..0182df127f0 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/feedback.c +++ b/reactos/dll/3rdparty/mesa32/src/main/feedback.c @@ -172,14 +172,14 @@ void _mesa_feedback_vertex( GLcontext *ctx, /** * Establish a buffer for selection mode values. - * + * * \param size buffer size. * \param buffer buffer. * * \sa glSelectBuffer(). - * + * * \note this function can't be put in a display list. - * + * * Verifies we're not in selection mode, flushes the vertices and initialize * the fields in __GLcontextRec::Select with the given buffer. */ @@ -194,7 +194,7 @@ _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) return; /* KW: added return */ } - FLUSH_VERTICES(ctx, _NEW_RENDERMODE); + FLUSH_VERTICES(ctx, _NEW_RENDERMODE); ctx->Select.Buffer = buffer; ctx->Select.BufferSize = size; ctx->Select.BufferCount = 0; @@ -206,7 +206,7 @@ _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) /** * Write a value of a record into the selection buffer. - * + * * \param CTX GL context. * \param V value. * @@ -248,7 +248,7 @@ void _mesa_update_hitflag( GLcontext *ctx, GLfloat z ) * * Write the hit record, i.e., the number of names in the stack, the minimum and * maximum depth values and the number of names in the name stack at the time - * of the event. Resets the hit flag. + * of the event. Resets the hit flag. * * \sa gl_selection. */ @@ -422,7 +422,7 @@ _mesa_PopName( void ) * \note this function can't be put in a display list. * * \sa glRenderMode(). - * + * * Flushes the vertices and do the necessary cleanup according to the previous * rasterization mode, such as writing the hit record or resent the select * buffer index when exiting the select mode. Updates diff --git a/reactos/dll/3rdparty/mesa32/src/main/fog.h b/reactos/dll/3rdparty/mesa32/src/main/fog.h index a14d19cdb39..90b6a123216 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/fog.h +++ b/reactos/dll/3rdparty/mesa32/src/main/fog.h @@ -1,7 +1,7 @@ /** * \file fog.h * Fog operations. - * + * * \if subset * (No-op) * diff --git a/reactos/dll/3rdparty/mesa32/src/main/framebuffer.h b/reactos/dll/3rdparty/mesa32/src/main/framebuffer.h index 11b002877c9..51074602dee 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/framebuffer.h +++ b/reactos/dll/3rdparty/mesa32/src/main/framebuffer.h @@ -55,7 +55,7 @@ extern void _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *b, GLuint width, GLuint height); -extern void +extern void _mesa_update_draw_buffer_bounds(GLcontext *ctx); extern void diff --git a/reactos/dll/3rdparty/mesa32/src/main/get.c b/reactos/dll/3rdparty/mesa32/src/main/get.c index f5b98196746..2fa1e672b5b 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/get.c +++ b/reactos/dll/3rdparty/mesa32/src/main/get.c @@ -35,14 +35,14 @@ "glGet" str "v(0x%x)", (int) PNAME); \ return; \ } - + #define CHECK2(E1, E2, str, PNAME) \ if (!ctx->Extensions.E1 && !ctx->Extensions.E2) { \ _mesa_error(ctx, GL_INVALID_VALUE, \ "glGet" str "v(0x%x)", (int) PNAME); \ return; \ } - + #define CHECK_EXTENSION_B(EXTNAME, PNAME) \ CHECK1(EXTNAME, "Boolean", PNAME ) @@ -5639,7 +5639,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) values[i] = magic; _mesa_GetFloatv(pname, values); - + for (i = 0; i < 16 && values[i] != magic; i++) params[i] = (GLdouble) values[i]; } diff --git a/reactos/dll/3rdparty/mesa32/src/main/glheader.h b/reactos/dll/3rdparty/mesa32/src/main/glheader.h index 446a0218981..99b904ee39c 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/glheader.h +++ b/reactos/dll/3rdparty/mesa32/src/main/glheader.h @@ -75,7 +75,7 @@ #include #if _MSC_VER == 1200 typedef UINT_PTR uintptr_t; -#endif +#endif #if defined(__MINGW32__) #include #endif @@ -122,7 +122,7 @@ typedef UINT_PTR uintptr_t; /* XXX why is this here? * It should probaby be somewhere in src/mesa/drivers/windows/ */ -#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP) +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP) # define WGL_FONT_LINES 0 # define WGL_FONT_POLYGONS 1 #ifndef _GNU_H_WINDOWS32_FUNCTIONS @@ -234,7 +234,7 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC /* If we build the library with gcc's -fvisibility=hidden flag, we'll * use the PUBLIC macro to mark functions that are to be exported. * - * We also need to define a USED attribute, so the optimizer doesn't + * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 @@ -255,7 +255,7 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC #if defined(BUILD_FOR_SNAP) && defined(CHECKED) -# define ASSERT(X) _CHECK(X) +# define ASSERT(X) _CHECK(X) #elif defined(DEBUG) # define ASSERT(X) assert(X) #else diff --git a/reactos/dll/3rdparty/mesa32/src/main/hash.c b/reactos/dll/3rdparty/mesa32/src/main/hash.c index 74ab57df0ac..f6efaff38a1 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/hash.c +++ b/reactos/dll/3rdparty/mesa32/src/main/hash.c @@ -1,10 +1,10 @@ /** * \file hash.c - * Generic hash table. + * Generic hash table. * * Used for display lists, texture objects, vertex/fragment programs, * buffer objects, etc. The hash functions are thread-safe. - * + * * \note key=0 is illegal. * * \author Brian Paul @@ -47,7 +47,7 @@ /** - * An entry in the hash table. + * An entry in the hash table. * * This struct is private to this file. */ @@ -58,7 +58,7 @@ struct HashEntry { }; /** - * The hash table data structure. + * The hash table data structure. * * This is an opaque types (it's not defined in hash.h file). */ @@ -71,7 +71,7 @@ struct _mesa_HashTable { /** * Create a new hash table. - * + * * \return pointer to a new, empty hash table. */ struct _mesa_HashTable * @@ -115,10 +115,10 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table) /** * Lookup an entry in the hash table. - * + * * \param table the hash table. * \param key the key. - * + * * \return pointer to user's data or NULL if key not in table */ void * @@ -144,9 +144,9 @@ _mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key) /** - * Insert a key/pointer pair into the hash table. + * Insert a key/pointer pair into the hash table. * If an entry with this key already exists we'll replace the existing entry. - * + * * \param table the hash table. * \param key the key (not zero). * \param data pointer to user data. @@ -192,7 +192,7 @@ _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data) /** * Remove an entry from the hash table. - * + * * \param table the hash table. * \param key key of entry to remove. * @@ -237,12 +237,12 @@ _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key) /** * Get the key of the "first" entry in the hash table. - * + * * This is used in the course of deleting all display lists when * a context is destroyed. - * + * * \param table the hash table - * + * * \return key for the "first" entry in the hash table. * * While holding the lock, walks through all table positions until finding @@ -315,7 +315,7 @@ _mesa_HashNextEntry(const struct _mesa_HashTable *table, GLuint key) /** * Dump contents of hash table for debugging. - * + * * \param table the hash table. */ void @@ -336,10 +336,10 @@ _mesa_HashPrint(const struct _mesa_HashTable *table) /** * Find a block of adjacent unused hash keys. - * + * * \param table the hash table. * \param numKeys number of keys needed. - * + * * \return Starting key of free block or 0 if failure. * * If there are enough free keys between the maximum key existing in the table diff --git a/reactos/dll/3rdparty/mesa32/src/main/hash.h b/reactos/dll/3rdparty/mesa32/src/main/hash.h index 3cbe668e9ae..9ea8e73a80d 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/hash.h +++ b/reactos/dll/3rdparty/mesa32/src/main/hash.h @@ -1,6 +1,6 @@ /** * \file hash.h - * Generic hash table. + * Generic hash table. */ /* diff --git a/reactos/dll/3rdparty/mesa32/src/main/hint.h b/reactos/dll/3rdparty/mesa32/src/main/hint.h index bfc3887107d..e18f1fb0027 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/hint.h +++ b/reactos/dll/3rdparty/mesa32/src/main/hint.h @@ -1,7 +1,7 @@ /** * \file hint.h * Hints operations. - * + * * \if subset * (No-op) * @@ -44,7 +44,7 @@ extern void GLAPIENTRY _mesa_Hint( GLenum target, GLenum mode ); -extern void +extern void _mesa_init_hint( GLcontext * ctx ); #else diff --git a/reactos/dll/3rdparty/mesa32/src/main/histogram.h b/reactos/dll/3rdparty/mesa32/src/main/histogram.h index 974447231dd..286745702bb 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/histogram.h +++ b/reactos/dll/3rdparty/mesa32/src/main/histogram.h @@ -1,7 +1,7 @@ /** * \file histogram.h * Histogram. - * + * * \if subset * (No-op) * @@ -41,34 +41,34 @@ #if _HAVE_FULL_GL -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_ResetHistogram(GLenum target); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_ResetMinmax(GLenum target); extern void diff --git a/reactos/dll/3rdparty/mesa32/src/main/image.c b/reactos/dll/3rdparty/mesa32/src/main/image.c index 12f8352c2d2..deb83dfc996 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/image.c +++ b/reactos/dll/3rdparty/mesa32/src/main/image.c @@ -201,7 +201,7 @@ GLint _mesa_sizeof_packed_type( GLenum type ) return sizeof(GLuint); case GL_UNSIGNED_SHORT_8_8_MESA: case GL_UNSIGNED_SHORT_8_8_REV_MESA: - return sizeof(GLushort); + return sizeof(GLushort); default: return -1; } @@ -465,7 +465,7 @@ _mesa_is_legal_format_and_type( GLcontext *ctx, GLenum format, GLenum type ) * \param img which image in the volume (0 for 1D or 2D images) * \param row row of pixel in the image (0 for 1D images) * \param column column of pixel in the image - * + * * \return address of pixel on success, or NULL on error. * * \sa gl_pixelstore_attrib. @@ -621,7 +621,7 @@ _mesa_image_address3d( const struct gl_pixelstore_attrib *packing, * \param width image width. * \param format pixel format. * \param type pixel data type. - * + * * \return the stride in bytes for the given parameters. * * Computes the number of bytes per pixel and row and compensates for alignment. diff --git a/reactos/dll/3rdparty/mesa32/src/main/imports.c b/reactos/dll/3rdparty/mesa32/src/main/imports.c index fec0d338448..f688b49edf8 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/imports.c +++ b/reactos/dll/3rdparty/mesa32/src/main/imports.c @@ -1,7 +1,7 @@ /** * \file imports.c * Standard C library function wrappers. - * + * * Imports are services which the device driver or window system or * operating system provides to the core renderer. The core renderer (Mesa) * will call these functions in order to do memory allocation, simple I/O, @@ -115,7 +115,7 @@ _mesa_free(void *ptr) * * \param bytes number of bytes to allocate. * \param alignment alignment (must be greater than zero). - * + * * Allocates extra memory to accommodate rounding up the address for * alignment and to record the real malloc address. * @@ -544,7 +544,7 @@ _mesa_float_to_half(float val) const int flt_s = (flt >> 31) & 0x1; int s, e, m = 0; GLhalfARB result; - + /* sign bit */ s = flt_s; @@ -820,7 +820,7 @@ _mesa_sprintf( char *str, const char *fmt, ... ) { int r; va_list args; - va_start( args, fmt ); + va_start( args, fmt ); va_end( args ); #if defined(XFree86LOADER) && defined(IN_MODULE) r = xf86vsprintf( str, fmt, args ); @@ -837,7 +837,7 @@ _mesa_printf( const char *fmtString, ... ) { char s[MAXSTRING]; va_list args; - va_start( args, fmtString ); + va_start( args, fmtString ); vsnprintf(s, MAXSTRING, fmtString, args); va_end( args ); #if defined(XFree86LOADER) && defined(IN_MODULE) @@ -859,7 +859,7 @@ _mesa_printf( const char *fmtString, ... ) * * \param ctx GL context. * \param fmtString printf() alike format string. - * + * * If debugging is enabled (either at compile-time via the DEBUG macro, or * run-time via the MESA_DEBUG environment variable), prints the warning to * stderr, either via fprintf() or xf86printf(). @@ -871,7 +871,7 @@ _mesa_warning( GLcontext *ctx, const char *fmtString, ... ) char str[MAXSTRING]; va_list args; (void) ctx; - va_start( args, fmtString ); + va_start( args, fmtString ); (void) vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); #ifdef DEBUG @@ -904,7 +904,7 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) char str[MAXSTRING]; (void) ctx; - va_start( args, fmtString ); + va_start( args, fmtString ); vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); @@ -922,13 +922,13 @@ _mesa_problem( const GLcontext *ctx, const char *fmtString, ... ) * * If in debug mode, print error message. * Also, record the error code by calling _mesa_record_error(). - * + * * \param ctx the GL context. * \param error the error value. * \param fmtString printf() style format string, followed by optional args - * + * * If debugging is enabled (either at compile-time via the DEBUG macro, or - * run-time via the MESA_DEBUG environment variable), interperts the error code and + * run-time via the MESA_DEBUG environment variable), interperts the error code and * prints the error message via _mesa_debug(). */ void @@ -956,7 +956,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) char where[MAXSTRING]; const char *errstr; - va_start( args, fmtString ); + va_start( args, fmtString ); vsnprintf( where, MAXSTRING, fmtString, args ); va_end( args ); @@ -993,14 +993,14 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) } _mesa_record_error(ctx, error); -} +} /** * Report debug information. - * + * * \param ctx GL context. * \param fmtString printf() alike format string. - * + * * Prints the message to stderr, either via fprintf() or xf86printf(). */ void @@ -1100,7 +1100,7 @@ default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) int r; va_list args; (void) gc; - va_start( args, fmt ); + va_start( args, fmt ); r = vsprintf( str, fmt, args ); va_end( args ); return r; @@ -1129,14 +1129,14 @@ default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) int r; va_list args; (void) gc; - va_start( args, fmt ); + va_start( args, fmt ); r = vfprintf( (FILE *) stream, fmt, args ); va_end( args ); return r; } /** - * \todo this really is driver-specific and can't be here + * \todo this really is driver-specific and can't be here */ static __GLdrawablePrivate * default_GetDrawablePrivate(__GLcontext *gc) @@ -1150,12 +1150,12 @@ default_GetDrawablePrivate(__GLcontext *gc) /** * Initialize a __GLimports object to point to the functions in this - * file. + * file. * * This is to be called from device drivers. - * + * * Also, do some one-time initializations. - * + * * \param imports the object to initialize. * \param driverCtx pointer to device driver-specific data. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/imports.h b/reactos/dll/3rdparty/mesa32/src/main/imports.h index 2ee66d9ac9b..acf312ad5bf 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/imports.h +++ b/reactos/dll/3rdparty/mesa32/src/main/imports.h @@ -663,7 +663,7 @@ _mesa_align_free( void *ptr ); extern void * _mesa_exec_malloc( GLuint size ); -extern void +extern void _mesa_exec_free( void *addr ); extern void * diff --git a/reactos/dll/3rdparty/mesa32/src/main/light.c b/reactos/dll/3rdparty/mesa32/src/main/light.c index 98934f39820..aa67b580a79 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/light.c +++ b/reactos/dll/3rdparty/mesa32/src/main/light.c @@ -532,7 +532,7 @@ _mesa_copy_materials( struct gl_material *dst, { int i; - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) + for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<Attrib[i], src->Attrib[i] ); } @@ -547,7 +547,7 @@ _mesa_update_material( GLcontext *ctx, GLuint bitmask ) struct gl_light *light, *list = &ctx->Light.EnabledList; GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - if (MESA_VERBOSE&VERBOSE_IMMEDIATE) + if (MESA_VERBOSE&VERBOSE_IMMEDIATE) _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask); if (!bitmask) @@ -556,14 +556,14 @@ _mesa_update_material( GLcontext *ctx, GLuint bitmask ) /* update material ambience */ if (bitmask & MAT_BIT_FRONT_AMBIENT) { foreach (light, list) { - SCALE_3V( light->_MatAmbient[0], light->Ambient, + SCALE_3V( light->_MatAmbient[0], light->Ambient, mat[MAT_ATTRIB_FRONT_AMBIENT]); } } if (bitmask & MAT_BIT_BACK_AMBIENT) { foreach (light, list) { - SCALE_3V( light->_MatAmbient[1], light->Ambient, + SCALE_3V( light->_MatAmbient[1], light->Ambient, mat[MAT_ATTRIB_BACK_AMBIENT]); } } @@ -584,14 +584,14 @@ _mesa_update_material( GLcontext *ctx, GLuint bitmask ) /* update material diffuse values */ if (bitmask & MAT_BIT_FRONT_DIFFUSE) { foreach (light, list) { - SCALE_3V( light->_MatDiffuse[0], light->Diffuse, + SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat[MAT_ATTRIB_FRONT_DIFFUSE] ); } } if (bitmask & MAT_BIT_BACK_DIFFUSE) { foreach (light, list) { - SCALE_3V( light->_MatDiffuse[1], light->Diffuse, + SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat[MAT_ATTRIB_BACK_DIFFUSE] ); } } @@ -599,7 +599,7 @@ _mesa_update_material( GLcontext *ctx, GLuint bitmask ) /* update material specular values */ if (bitmask & MAT_BIT_FRONT_SPECULAR) { foreach (light, list) { - SCALE_3V( light->_MatSpecular[0], light->Specular, + SCALE_3V( light->_MatSpecular[0], light->Specular, mat[MAT_ATTRIB_FRONT_SPECULAR]); } } @@ -633,7 +633,7 @@ _mesa_update_color_material( GLcontext *ctx, const GLfloat color[4] ) struct gl_material *mat = &ctx->Light.Material; int i; - for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) + for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<Attrib[i], color ); @@ -937,7 +937,7 @@ _mesa_validate_all_lighting_tables( GLcontext *ctx ) { GLuint i; GLfloat shininess; - + shininess = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0]; if (!ctx->_ShineTable[0] || ctx->_ShineTable[0]->shininess != shininess) validate_shine_table( ctx, 0, shininess ); @@ -998,20 +998,20 @@ _mesa_update_lighting( GLcontext *ctx ) */ if (ctx->Visual.rgbMode) { if (ctx->Light.Model.TwoSide) - _mesa_update_material( ctx, + _mesa_update_material( ctx, MAT_BIT_FRONT_EMISSION | MAT_BIT_FRONT_AMBIENT | - MAT_BIT_FRONT_DIFFUSE | + MAT_BIT_FRONT_DIFFUSE | MAT_BIT_FRONT_SPECULAR | MAT_BIT_BACK_EMISSION | MAT_BIT_BACK_AMBIENT | - MAT_BIT_BACK_DIFFUSE | + MAT_BIT_BACK_DIFFUSE | MAT_BIT_BACK_SPECULAR); else - _mesa_update_material( ctx, + _mesa_update_material( ctx, MAT_BIT_FRONT_EMISSION | MAT_BIT_FRONT_AMBIENT | - MAT_BIT_FRONT_DIFFUSE | + MAT_BIT_FRONT_DIFFUSE | MAT_BIT_FRONT_SPECULAR); } else { @@ -1189,7 +1189,7 @@ _mesa_allow_light_in_model( GLcontext *ctx, GLboolean flag ) * Initialize the n-th light data structure. * * \param l pointer to the gl_light structure to be initialized. - * \param n number of the light. + * \param n number of the light. * \note The defaults for light 0 are different than the other lights. */ static void @@ -1236,7 +1236,7 @@ init_lightmodel( struct gl_lightmodel *lm ) /** * Initialize the material data structure. - * + * * \param m pointer to the gl_material structure to be initialized. */ static void @@ -1248,7 +1248,7 @@ init_material( struct gl_material *m ) ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_EMISSION], 0.0F, 0.0F, 0.0F, 1.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_SHININESS], 0.0F, 0.0F, 0.0F, 0.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_FRONT_INDEXES], 0.0F, 1.0F, 1.0F, 0.0F ); - + ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_AMBIENT], 0.2F, 0.2F, 0.2F, 1.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_DIFFUSE], 0.8F, 0.8F, 0.8F, 1.0F ); ASSIGN_4V( m->Attrib[MAT_ATTRIB_BACK_SPECULAR], 0.0F, 0.0F, 0.0F, 1.0F ); diff --git a/reactos/dll/3rdparty/mesa32/src/main/lines.c b/reactos/dll/3rdparty/mesa32/src/main/lines.c index c30d9ac109e..289c070e6eb 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/lines.c +++ b/reactos/dll/3rdparty/mesa32/src/main/lines.c @@ -86,7 +86,7 @@ _mesa_LineWidth( GLfloat width ) * * \param factor pattern scale factor. * \param pattern bit pattern. - * + * * \sa glLineStipple(). * * Updates gl_line_attrib::StippleFactor and gl_line_attrib::StipplePattern. On diff --git a/reactos/dll/3rdparty/mesa32/src/main/lines.h b/reactos/dll/3rdparty/mesa32/src/main/lines.h index 5a47e9858d5..f8b46529fd3 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/lines.h +++ b/reactos/dll/3rdparty/mesa32/src/main/lines.h @@ -42,7 +42,7 @@ _mesa_LineWidth( GLfloat width ); extern void GLAPIENTRY _mesa_LineStipple( GLint factor, GLushort pattern ); -extern void GLAPIENTRY +extern void GLAPIENTRY _mesa_init_line( GLcontext * ctx ); #endif diff --git a/reactos/dll/3rdparty/mesa32/src/main/matrix.c b/reactos/dll/3rdparty/mesa32/src/main/matrix.c index f4ec9735630..971df729faa 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/matrix.c +++ b/reactos/dll/3rdparty/mesa32/src/main/matrix.c @@ -80,8 +80,8 @@ _mesa_Frustum( GLdouble left, GLdouble right, } _math_matrix_frustum( ctx->CurrentStack->Top, - (GLfloat) left, (GLfloat) right, - (GLfloat) bottom, (GLfloat) top, + (GLfloat) left, (GLfloat) right, + (GLfloat) bottom, (GLfloat) top, (GLfloat) nearval, (GLfloat) farval ); ctx->NewState |= ctx->CurrentStack->DirtyFlag; } @@ -124,8 +124,8 @@ _mesa_Ortho( GLdouble left, GLdouble right, } _math_matrix_ortho( ctx->CurrentStack->Top, - (GLfloat) left, (GLfloat) right, - (GLfloat) bottom, (GLfloat) top, + (GLfloat) left, (GLfloat) right, + (GLfloat) bottom, (GLfloat) top, (GLfloat) nearval, (GLfloat) farval ); ctx->NewState |= ctx->CurrentStack->DirtyFlag; } @@ -217,7 +217,7 @@ _mesa_MatrixMode( GLenum mode ) * Push the current matrix stack. * * \sa glPushMatrix(). - * + * * Verifies the current matrix stack is not full, and duplicates the top-most * matrix in the stack. Marks __GLcontextRec::NewState with the stack dirty * flag. @@ -257,7 +257,7 @@ _mesa_PushMatrix( void ) * Pop the current matrix stack. * * \sa glPopMatrix(). - * + * * Flushes the vertices, verifies the current matrix stack is not empty, and * moves the stack head down. Marks __GLcontextRec::NewState with the dirty * stack flag. @@ -444,7 +444,7 @@ _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) ctx->NewState |= ctx->CurrentStack->DirtyFlag; } - + #if _HAVE_FULL_GL void GLAPIENTRY _mesa_LoadMatrixd( const GLdouble *m ) @@ -534,7 +534,7 @@ _mesa_MultTransposeMatrixdARB( const GLdouble *m ) /** * Set the viewport. - * + * * \param x, y coordinates of the lower-left corner of the viewport rectangle. * \param width width of the viewport rectangle. * \param height height of the viewport rectangle. @@ -555,7 +555,7 @@ _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) /** * Set new viewport parameters and update derived state (the _WindowMap * matrix). Usually called from _mesa_Viewport(). - * + * * \param ctx GL context. * \param x, y coordinates of the lower left corner of the viewport rectangle. * \param width width of the viewport rectangle. @@ -674,7 +674,7 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval ) * * Calls _math_matrix_analyse() with the top-matrix of the projection matrix * stack, and recomputes user clip positions if necessary. - * + * * \note This routine references __GLcontextRec::Tranform attribute values to * compute userclip positions in clip space, but is only called on * _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values up to @@ -738,10 +738,10 @@ void _mesa_update_modelview_project( GLcontext *ctx, GLuint new_state ) { if (new_state & _NEW_MODELVIEW) { _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - + /* Bring cull position uptodate. */ - TRANSFORM_POINT3( ctx->Transform.CullObjPos, + TRANSFORM_POINT3( ctx->Transform.CullObjPos, ctx->ModelviewMatrixStack.Top->inv, ctx->Transform.CullEyePos ); } @@ -770,7 +770,7 @@ void _mesa_update_modelview_project( GLcontext *ctx, GLuint new_state ) * \param stack matrix stack. * \param maxDepth maximum stack depth. * \param dirtyFlag dirty flag. - * + * * Allocates an array of \p maxDepth elements for the matrix stack and calls * _math_matrix_ctr() and _math_matrix_alloc_inv() for each element to * initialize it. @@ -795,9 +795,9 @@ init_matrix_stack( struct matrix_stack *stack, /** * Free matrix stack. - * + * * \param stack matrix stack. - * + * * Calls _math_matrix_dtr() for each element of the matrix stack and * frees the array. */ @@ -843,7 +843,7 @@ void _mesa_init_matrix( GLcontext * ctx ) init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH, _NEW_TEXTURE_MATRIX); for (i = 0; i < MAX_PROGRAM_MATRICES; i++) - init_matrix_stack(&ctx->ProgramMatrixStack[i], + init_matrix_stack(&ctx->ProgramMatrixStack[i], MAX_PROGRAM_MATRIX_STACK_DEPTH, _NEW_TRACK_MATRIX); ctx->CurrentStack = &ctx->ModelviewMatrixStack; @@ -854,7 +854,7 @@ void _mesa_init_matrix( GLcontext * ctx ) /** * Free the context matrix data. - * + * * \param ctx GL context. * * Frees each of the matrix stacks and the combined modelview-projection @@ -877,7 +877,7 @@ void _mesa_free_matrix_data( GLcontext *ctx ) } -/** +/** * Initialize the context transform attribute group. * * \param ctx GL context. @@ -903,11 +903,11 @@ void _mesa_init_transform( GLcontext *ctx ) } -/** +/** * Initialize the context viewport attribute group. * * \param ctx GL context. - * + * * \todo Move this to a new file with other 'viewport' routines. */ void _mesa_init_viewport( GLcontext *ctx ) @@ -928,11 +928,11 @@ void _mesa_init_viewport( GLcontext *ctx ) } -/** +/** * Free the context viewport attribute group data. * * \param ctx GL context. - * + * * \todo Move this to a new file with other 'viewport' routines. */ void _mesa_free_viewport_data( GLcontext *ctx ) diff --git a/reactos/dll/3rdparty/mesa32/src/main/matrix.h b/reactos/dll/3rdparty/mesa32/src/main/matrix.h index 38769867a75..8188950cb83 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/matrix.h +++ b/reactos/dll/3rdparty/mesa32/src/main/matrix.h @@ -102,29 +102,29 @@ _mesa_MultTransposeMatrixdARB( const GLdouble *m ); extern void GLAPIENTRY _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ); -extern void +extern void _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ); extern void GLAPIENTRY _mesa_DepthRange( GLclampd nearval, GLclampd farval ); -extern void +extern void _mesa_init_matrix( GLcontext * ctx ); -extern void +extern void _mesa_init_transform( GLcontext *ctx ); -extern void +extern void _mesa_init_viewport( GLcontext *ctx ); extern void _mesa_free_matrix_data( GLcontext *ctx ); -extern void +extern void _mesa_free_viewport_data( GLcontext *ctx ); -extern void +extern void _mesa_update_modelview_project( GLcontext *ctx, GLuint newstate ); diff --git a/reactos/dll/3rdparty/mesa32/src/main/mm.c b/reactos/dll/3rdparty/mesa32/src/main/mm.c index e4c96821732..d7e8cb6f32a 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/mm.c +++ b/reactos/dll/3rdparty/mesa32/src/main/mm.c @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ @@ -49,7 +49,7 @@ memHeap_t * mmInit(int ofs, int size) { PMemBlock blocks; - + if (size <= 0) { return NULL; } @@ -67,8 +67,8 @@ mmInit(int ofs, int size) static TMemBlock * -SliceBlock(TMemBlock *p, - int startofs, int size, +SliceBlock(TMemBlock *p, + int startofs, int size, int reserved, int alignment) { TMemBlock *newblock; @@ -145,7 +145,7 @@ mmFindBlock(memHeap_t *heap, int start) TMemBlock *p = (TMemBlock *)heap; while (p) { - if (p->ofs == start && p->free) + if (p->ofs == start && p->free) return p; p = p->next; diff --git a/reactos/dll/3rdparty/mesa32/src/main/mm.h b/reactos/dll/3rdparty/mesa32/src/main/mm.h index 33c986b4c7d..9cfa2089d5c 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/mm.h +++ b/reactos/dll/3rdparty/mesa32/src/main/mm.h @@ -15,9 +15,9 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @@ -69,7 +69,7 @@ mmOffset(PMemBlock b) -/** +/** * input: total size in bytes * return: a heap pointer if OK, NULL if error */ @@ -85,7 +85,7 @@ extern memHeap_t *mmInit(int ofs, int size); * startSearch = linear offset from start of heap to begin search * return: pointer to the allocated block, 0 if error */ -extern PMemBlock mmAllocMem(memHeap_t *heap, int size, int align2, +extern PMemBlock mmAllocMem(memHeap_t *heap, int size, int align2, int startSearch); /** diff --git a/reactos/dll/3rdparty/mesa32/src/main/mtypes.h b/reactos/dll/3rdparty/mesa32/src/main/mtypes.h index 2a0bbd94211..baf085b1edb 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/mtypes.h +++ b/reactos/dll/3rdparty/mesa32/src/main/mtypes.h @@ -91,7 +91,7 @@ * * \note Must be 32-bits! */ -typedef GLuint GLdepth; +typedef GLuint GLdepth; /** @@ -346,11 +346,11 @@ struct gl_color_table * \name Bit flags used for updating material values. */ /*@{*/ -#define MAT_ATTRIB_FRONT_AMBIENT 0 +#define MAT_ATTRIB_FRONT_AMBIENT 0 #define MAT_ATTRIB_BACK_AMBIENT 1 -#define MAT_ATTRIB_FRONT_DIFFUSE 2 +#define MAT_ATTRIB_FRONT_DIFFUSE 2 #define MAT_ATTRIB_BACK_DIFFUSE 3 -#define MAT_ATTRIB_FRONT_SPECULAR 4 +#define MAT_ATTRIB_FRONT_SPECULAR 4 #define MAT_ATTRIB_BACK_SPECULAR 5 #define MAT_ATTRIB_FRONT_EMISSION 6 #define MAT_ATTRIB_BACK_EMISSION 7 @@ -360,12 +360,12 @@ struct gl_color_table #define MAT_ATTRIB_BACK_INDEXES 11 #define MAT_ATTRIB_MAX 12 -#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f)) -#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f)) -#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f)) -#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f)) +#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f)) +#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f)) +#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f)) +#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f)) #define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f)) -#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f)) +#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f)) #define MAT_INDEX_AMBIENT 0 #define MAT_INDEX_DIFFUSE 1 @@ -439,7 +439,7 @@ struct gl_light GLfloat QuadraticAttenuation; GLboolean Enabled; /**< On/off flag */ - /** + /** * \name Derived fields */ /*@{*/ @@ -505,7 +505,7 @@ struct gl_colorbuffer_attrib GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */ - /** + /** * \name alpha testing */ /*@{*/ @@ -514,7 +514,7 @@ struct gl_colorbuffer_attrib GLclampf AlphaRef; /**< Alpha reference value */ /*@}*/ - /** + /** * \name Blending */ /*@{*/ @@ -528,7 +528,7 @@ struct gl_colorbuffer_attrib GLfloat BlendColor[4]; /**< Blending color */ /*@}*/ - /** + /** * \name Logic op */ /*@{*/ @@ -558,8 +558,8 @@ struct gl_current_attrib /*@}*/ /** - * \name Values are always valid. - * + * \name Values are always valid. + * * \note BTW, note how similar this set of attributes is to the SWvertex * data type in the software rasterizer... */ @@ -676,7 +676,7 @@ struct gl_enable_attrib struct gl_eval_attrib { /** - * \name Enable bits + * \name Enable bits */ /*@{*/ GLboolean Map1Color4; @@ -701,7 +701,7 @@ struct gl_eval_attrib GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ GLboolean AutoNormal; /*@}*/ - + /** * \name Map Grid endpoints and divisions and calculated du values */ @@ -732,9 +732,9 @@ struct gl_fog_attrib }; -/** +/** * Hint attribute group (GL_HINT_BIT). - * + * * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE. */ struct gl_hint_attrib @@ -827,11 +827,11 @@ struct gl_light_attrib struct gl_light EnabledList; /**< List sentinel */ - /** - * Derived state for optimizations: + /** + * Derived state for optimizations: */ /*@{*/ - GLboolean _NeedEyeCoords; + GLboolean _NeedEyeCoords; GLboolean _NeedVertices; /**< Use fast shader? */ GLuint _Flags; /**< LIGHT_* flags, see above */ GLfloat _BaseColor[2][3]; @@ -1130,7 +1130,7 @@ struct gl_stencil_attrib * extract RGBA, color indexes and depth components out of 1D, 2D and 3D * texture images. These functions help to isolate us from the gritty * details of all the various texture image encodings. - * + * * \param texImage texture image. * \param col texel column. * \param row texel row. @@ -1174,7 +1174,7 @@ typedef GLboolean (*StoreTexImageFunc)(GLcontext *ctx, GLuint dims, /** - * Texture format record + * Texture format record */ struct gl_texture_format { @@ -1337,7 +1337,7 @@ struct gl_texture_object /** * Texture combine environment state. - * + * * \todo * If GL_NV_texture_env_combine4 is ever supported, the arrays in this * structure will need to be expanded for 4 elements. @@ -1373,7 +1373,7 @@ struct gl_texture_unit /** \name Tex coord generation mode * Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */ /*@{*/ - GLenum GenModeS; + GLenum GenModeS; GLenum GenModeT; GLenum GenModeR; GLenum GenModeQ; @@ -1393,8 +1393,8 @@ struct gl_texture_unit GLfloat EyePlaneQ[4]; GLfloat LodBias; /**< for biasing mipmap levels */ - /** - * \name GL_EXT_texture_env_combine + /** + * \name GL_EXT_texture_env_combine */ struct gl_tex_env_combine_state Combine; @@ -1443,7 +1443,7 @@ struct texenvprog_cache { struct gl_texture_attrib { /** - * name multitexture + * name multitexture */ /**@{*/ GLuint CurrentUnit; /**< Active texture unit */ @@ -1465,7 +1465,7 @@ struct gl_texture_attrib /** GL_EXT_shared_texture_palette */ GLboolean SharedPalette; struct gl_color_table Palette; - + /** Cached texenv fragment programs */ struct texenvprog_cache *env_fp_cache; }; @@ -1664,7 +1664,7 @@ struct gl_2d_map */ struct gl_evaluators { - /** + /** * \name 1-D maps */ /*@{*/ @@ -1680,8 +1680,8 @@ struct gl_evaluators struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */ /*@}*/ - /** - * \name 2-D maps + /** + * \name 2-D maps */ /*@{*/ struct gl_2d_map Map2Vertex3; @@ -2213,7 +2213,7 @@ struct gl_framebuffer */ struct gl_constants { - GLint MaxTextureLevels; /**< Maximum number of allowed mipmap levels. */ + GLint MaxTextureLevels; /**< Maximum number of allowed mipmap levels. */ GLint Max3DTextureLevels; /**< Maximum number of allowed mipmap levels for 3D texture targets. */ GLint MaxCubeTextureLevels; /**< Maximum number of allowed mipmap levels for GL_ARB_texture_cube_map */ GLint MaxTextureRectSize; /* GL_NV_texture_rectangle */ @@ -2279,7 +2279,7 @@ struct gl_extensions { /** * \name Flags to quickly test if certain extensions are available. - * + * * Not every extension needs to have such a flag, but it's encouraged. */ /*@{*/ @@ -2411,7 +2411,7 @@ struct matrix_stack /** - * \name Bits for image transfer operations + * \name Bits for image transfer operations * * \sa __GLcontextRec::ImageTransferState. */ @@ -2447,7 +2447,7 @@ struct matrix_stack /** - * \name Bits to indicate what state has changed. + * \name Bits to indicate what state has changed. * * 4 unused flags. */ @@ -2485,7 +2485,7 @@ struct matrix_stack /** - * \name Bits to track array state changes + * \name Bits to track array state changes * * Also used to summarize array enabled. */ @@ -2517,7 +2517,7 @@ struct matrix_stack /** * \name A bunch of flags that we think might be useful to drivers. - * + * * Set in the __GLcontextRec::_TriangleCaps bitfield. */ /*@{*/ @@ -2597,7 +2597,7 @@ struct gl_tnl_module const GLvertexformat *Current; /** - * \name Record of functions swapped out. + * \name Record of functions swapped out. * On restore, only need to swap these functions back in. */ /*@{*/ @@ -2613,7 +2613,7 @@ struct gl_tnl_module * worthwhile adding a tnl private structure just to hold this one bit * of information: */ -#define MESA_DLIST_DANGLING_REFS 0x1 +#define MESA_DLIST_DANGLING_REFS 0x1 /* Provide a location where information about a display list can be * collected. Could be extended with driverPrivate structures, @@ -2645,13 +2645,13 @@ struct mesa_list_state GLubyte ActiveAttribSize[VERT_ATTRIB_MAX]; GLfloat CurrentAttrib[VERT_ATTRIB_MAX][4]; - + GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX]; GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4]; GLubyte ActiveIndex; GLfloat CurrentIndex; - + GLubyte ActiveEdgeFlag; GLboolean CurrentEdgeFlag; }; @@ -2670,7 +2670,7 @@ struct mesa_list_state struct __GLcontextRec { /** - * \name OS related interfaces. + * \name OS related interfaces. * * These \b must be the first members of this structure, because they are * exposed to the outside world (i.e. GLX extension). @@ -2736,7 +2736,7 @@ struct __GLcontextRec /*@}*/ /** \name Renderer attribute groups - * + * * We define a struct for each attribute group to make pushing and popping * attributes easy. Also it's a good organization. */ @@ -2828,7 +2828,7 @@ struct __GLcontextRec GLfloat _EyeZDir[3]; GLfloat _ModelViewInvScale; GLuint _NeedEyeCoords; - GLuint _ForceEyeCoords; + GLuint _ForceEyeCoords; GLboolean _RotateMode; GLenum _CurrentProgram; /* currently executing program */ @@ -2867,7 +2867,7 @@ struct __GLcontextRec struct gl_tnl_module TnlModule; /** - * \name Hooks for module contexts. + * \name Hooks for module contexts. * * These will eventually live in the driver or elsewhere. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/pixel.h b/reactos/dll/3rdparty/mesa32/src/main/pixel.h index 9eef0cff5af..6ae3cab10c2 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/pixel.h +++ b/reactos/dll/3rdparty/mesa32/src/main/pixel.h @@ -142,10 +142,10 @@ _mesa_chan_to_float_span(const GLcontext *ctx, GLuint n, CONST GLchan rgba[][4], GLfloat rgbaf[][4]); -extern void +extern void _mesa_update_pixel( GLcontext *ctx, GLuint newstate ); -extern void +extern void _mesa_init_pixel( GLcontext * ctx ); /*@}*/ diff --git a/reactos/dll/3rdparty/mesa32/src/main/points.h b/reactos/dll/3rdparty/mesa32/src/main/points.h index 56acd9ee574..425432bceb3 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/points.h +++ b/reactos/dll/3rdparty/mesa32/src/main/points.h @@ -53,7 +53,7 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params ); extern void _mesa_update_point(GLcontext *ctx); -extern void +extern void _mesa_init_point( GLcontext * ctx ); diff --git a/reactos/dll/3rdparty/mesa32/src/main/polygon.c b/reactos/dll/3rdparty/mesa32/src/main/polygon.c index b771408cf36..627bf7d826d 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/polygon.c +++ b/reactos/dll/3rdparty/mesa32/src/main/polygon.c @@ -76,7 +76,7 @@ _mesa_CullFace( GLenum mode ) /** - * Define front- and back-facing + * Define front- and back-facing * * \param mode orientation of front-facing polygons. * @@ -119,8 +119,8 @@ _mesa_FrontFace( GLenum mode ) * \param face the polygons which \p mode applies to. * \param mode how polygons should be rasterized. * - * \sa glPolygonMode(). - * + * \sa glPolygonMode(). + * * Verifies the parameters and updates gl_polygon_attrib::FrontMode and * gl_polygon_attrib::BackMode. On change flushes the vertices and notifies the * driver via the dd_function_table::PolygonMode callback. diff --git a/reactos/dll/3rdparty/mesa32/src/main/polygon.h b/reactos/dll/3rdparty/mesa32/src/main/polygon.h index 2550ed16877..1bdd107e528 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/polygon.h +++ b/reactos/dll/3rdparty/mesa32/src/main/polygon.h @@ -60,10 +60,10 @@ _mesa_PolygonStipple( const GLubyte *mask ); extern void GLAPIENTRY _mesa_GetPolygonStipple( GLubyte *mask ); -extern void +extern void _mesa_update_polygon( GLcontext *ctx ); -extern void +extern void _mesa_init_polygon( GLcontext * ctx ); #endif diff --git a/reactos/dll/3rdparty/mesa32/src/main/rastpos.c b/reactos/dll/3rdparty/mesa32/src/main/rastpos.c index 507eb9f9843..9a77a82cd22 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/rastpos.c +++ b/reactos/dll/3rdparty/mesa32/src/main/rastpos.c @@ -46,7 +46,7 @@ * Clip a point against the view volume. * * \param v vertex vector describing the point to clip. - * + * * \return zero if outside view volume, or one if inside. */ static GLuint @@ -67,7 +67,7 @@ viewclip_point( const GLfloat v[] ) * Clip a point against the far/near Z clipping planes. * * \param v vertex vector describing the point to clip. - * + * * \return zero if outside view volume, or one if inside. */ static GLuint @@ -84,10 +84,10 @@ viewclip_point_z( const GLfloat v[] ) /** * Clip a point against the user clipping planes. - * + * * \param ctx GL context. * \param v vertex vector describing the point to clip. - * + * * \return zero if the point was clipped, or one otherwise. */ static GLuint @@ -139,7 +139,7 @@ shade_rastpos(GLcontext *ctx, _mesa_validate_all_lighting_tables( ctx ); COPY_3V(diffuseColor, base[0]); - diffuseColor[3] = CLAMP( + diffuseColor[3] = CLAMP( ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F ); ASSIGN_4V(specularColor, 0.0, 0.0, 0.0, 0.0); @@ -395,13 +395,13 @@ compute_texgen(GLcontext *ctx, const GLfloat vObj[4], const GLfloat vEye[4], * * All glRasterPos command call this function to update the current * raster position. - * + * * \param ctx GL context. * \param x x coordinate for the raster position. * \param y y coordinate for the raster position. * \param z z coordinate for the raster position. * \param w w coordinate for the raster position. - * + * * \sa Called by _mesa_RasterPos4f(). * * Flushes the vertices, transforms and clips the vertex coordinates, and @@ -675,7 +675,7 @@ _mesa_RasterPos3sv(const GLshort *v) void GLAPIENTRY _mesa_RasterPos4dv(const GLdouble *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } @@ -690,7 +690,7 @@ _mesa_RasterPos4fv(const GLfloat *v) void GLAPIENTRY _mesa_RasterPos4iv(const GLint *v) { - _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + _mesa_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } @@ -907,7 +907,7 @@ _mesa_WindowPos3svMESA(const GLshort *v) void GLAPIENTRY _mesa_WindowPos4dvMESA(const GLdouble *v) { - window_pos4f((GLfloat) v[0], (GLfloat) v[1], + window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } @@ -920,7 +920,7 @@ _mesa_WindowPos4fvMESA(const GLfloat *v) void GLAPIENTRY _mesa_WindowPos4ivMESA(const GLint *v) { - window_pos4f((GLfloat) v[0], (GLfloat) v[1], + window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } diff --git a/reactos/dll/3rdparty/mesa32/src/main/rastpos.h b/reactos/dll/3rdparty/mesa32/src/main/rastpos.h index 363f86ad87b..9e22b62a61b 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/rastpos.h +++ b/reactos/dll/3rdparty/mesa32/src/main/rastpos.h @@ -185,7 +185,7 @@ _mesa_WindowPos4ivMESA(const GLint *v); extern void GLAPIENTRY _mesa_WindowPos4svMESA(const GLshort *v); -extern void +extern void _mesa_init_rastpos( GLcontext * ctx ); /*@}*/ diff --git a/reactos/dll/3rdparty/mesa32/src/main/renderbuffer.c b/reactos/dll/3rdparty/mesa32/src/main/renderbuffer.c index 42e94a31fe5..0b49aaf582c 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/renderbuffer.c +++ b/reactos/dll/3rdparty/mesa32/src/main/renderbuffer.c @@ -277,7 +277,7 @@ put_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } } - + static void put_mono_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, @@ -303,7 +303,7 @@ put_mono_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, } } } - + /********************************************************************** * Functions for buffers of 1 X GLuint values. diff --git a/reactos/dll/3rdparty/mesa32/src/main/simple_list.h b/reactos/dll/3rdparty/mesa32/src/main/simple_list.h index 63475f6f740..448093d898c 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/simple_list.h +++ b/reactos/dll/3rdparty/mesa32/src/main/simple_list.h @@ -4,7 +4,7 @@ * * Intended to work with a list sentinal which is created as an empty * list. Insert & delete are O(1). - * + * * \author * (C) 1997, Keith Whitwell */ @@ -149,19 +149,19 @@ do { \ /** * Test whether element is at end of the list. - * + * * \param list list. * \param elem element. - * + * * \return non-zero if element is at end of list, or zero otherwise. */ #define at_end(list, elem) ((elem) == (list)) /** * Test if a list is empty. - * + * * \param list list. - * + * * \return non-zero if list empty, or zero otherwise. */ #define is_empty_list(list) ((list)->next == (list)) @@ -183,7 +183,7 @@ do { \ * * Same as #foreach but lets you unlink the current value during a list * traversal. Useful for freeing a list, element by element. - * + * * \param ptr pointer to the current element. * \param t temporary pointer. * \param list list. diff --git a/reactos/dll/3rdparty/mesa32/src/main/state.c b/reactos/dll/3rdparty/mesa32/src/main/state.c index 9ab2c5fb8a9..9cd5bb064dd 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/state.c +++ b/reactos/dll/3rdparty/mesa32/src/main/state.c @@ -26,7 +26,7 @@ /** * \file state.c * State management. - * + * * This file manages recalculation of derived values in the __GLcontextRec. * Also, this is where we initialize the API dispatch table. */ @@ -712,7 +712,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) /* ARB 37. GL_ARB_draw_buffers */ SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB); - + #if FEATURE_ARB_shader_objects SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); SET_GetHandleARB(exec, _mesa_GetHandleARB); @@ -936,7 +936,7 @@ update_program(GLcontext *ctx) && ctx->FragmentProgram.Current->Instructions; ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled && ctx->ATIFragmentShader.Current->Instructions; - + ctx->FragmentProgram._Current = ctx->FragmentProgram.Current; ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled; @@ -959,7 +959,7 @@ update_program(GLcontext *ctx) * * Calls dd_function_table::UpdateState to perform any internal state * management necessary. - * + * * \sa _mesa_update_modelview_project(), _mesa_update_texture(), * _mesa_update_buffer_bounds(), _mesa_update_polygon(), * _mesa_update_lighting() and _mesa_update_tnl_spaces(). @@ -1019,7 +1019,7 @@ _mesa_update_state( GLcontext *ctx ) * If the lighting space hasn't changed, may still need to recompute * light positions & normal transforms for other reasons. */ - if (new_state & _MESA_NEW_NEED_EYE_COORDS) + if (new_state & _MESA_NEW_NEED_EYE_COORDS) _mesa_update_tnl_spaces( ctx, new_state ); /* diff --git a/reactos/dll/3rdparty/mesa32/src/main/stencil.c b/reactos/dll/3rdparty/mesa32/src/main/stencil.c index dfda4aa8fda..c5b574f79c2 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/stencil.c +++ b/reactos/dll/3rdparty/mesa32/src/main/stencil.c @@ -159,9 +159,9 @@ _mesa_StencilMask( GLuint mask ) * \param zfail action to take when stencil test passes, but the depth test fails. * \param zpass action to take when stencil test passes and the depth test * passes (or depth testing is not enabled). - * + * * \sa glStencilOp(). - * + * * Verifies the parameters and updates the respective fields in * __GLcontextRec::Stencil. On change flushes the vertices and notifies the * driver via the dd_function_table::StencilOp callback. diff --git a/reactos/dll/3rdparty/mesa32/src/main/stencil.h b/reactos/dll/3rdparty/mesa32/src/main/stencil.h index ec2927cfd20..0f7d9d85f19 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/stencil.h +++ b/reactos/dll/3rdparty/mesa32/src/main/stencil.h @@ -67,7 +67,7 @@ extern void GLAPIENTRY _mesa_StencilMaskSeparate(GLenum face, GLuint mask); -extern void +extern void _mesa_init_stencil( GLcontext * ctx ); #endif diff --git a/reactos/dll/3rdparty/mesa32/src/main/texcompress_fxt1.c b/reactos/dll/3rdparty/mesa32/src/main/texcompress_fxt1.c index d5e2c790f60..9ed6a8284f7 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texcompress_fxt1.c +++ b/reactos/dll/3rdparty/mesa32/src/main/texcompress_fxt1.c @@ -833,7 +833,7 @@ fxt1_quantize_ALPHA1 (GLuint *cc, lolo <<= 2; lolo |= texel; } - + cc[0] = lolo; } @@ -1208,7 +1208,7 @@ fxt1_quantize_MIXED0 (GLuint *cc, } lolo = ~lolo; } - + cc[0] = lolo; } diff --git a/reactos/dll/3rdparty/mesa32/src/main/texenvprogram.c b/reactos/dll/3rdparty/mesa32/src/main/texenvprogram.c index 4cb97469a58..27a81a9d310 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texenvprogram.c +++ b/reactos/dll/3rdparty/mesa32/src/main/texenvprogram.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ #include "glheader.h" @@ -185,18 +185,18 @@ static struct state_key *make_state_key( GLcontext *ctx ) { struct state_key *key = CALLOC_STRUCT(state_key); GLuint i, j; - + for (i=0;iTexture.Unit[i]; - + if (!texUnit->_ReallyEnabled) continue; key->unit[i].enabled = 1; key->enabled_units |= (1<unit[i].source_index = - translate_tex_src_bit(texUnit->_ReallyEnabled); + key->unit[i].source_index = + translate_tex_src_bit(texUnit->_ReallyEnabled); key->unit[i].NumArgsRGB = texUnit->_CurrentCombine->_NumArgsRGB; key->unit[i].NumArgsA = texUnit->_CurrentCombine->_NumArgsA; @@ -205,7 +205,7 @@ static struct state_key *make_state_key( GLcontext *ctx ) translate_mode(texUnit->_CurrentCombine->ModeRGB); key->unit[i].ModeA = translate_mode(texUnit->_CurrentCombine->ModeA); - + key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB; key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftRGB; @@ -220,7 +220,7 @@ static struct state_key *make_state_key( GLcontext *ctx ) translate_source(texUnit->_CurrentCombine->SourceA[j]); } } - + if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) key->separate_specular = 1; @@ -228,12 +228,12 @@ static struct state_key *make_state_key( GLcontext *ctx ) key->fog_enabled = 1; key->fog_mode = translate_fog_mode(ctx->Fog.Mode); } - + return key; } /* Use uregs to represent registers internally, translate to Mesa's - * expected formats on emit. + * expected formats on emit. * * NOTE: These are passed by value extensively in this file rather * than as usual by pointer reference. If this disturbs you, try @@ -254,7 +254,7 @@ struct ureg { GLuint pad:5; }; -const static struct ureg undef = { +const static struct ureg undef = { ~0, ~0, 0, @@ -286,12 +286,12 @@ struct texenv_fragment_program { GLboolean error; - struct ureg src_texture[MAX_TEXTURE_UNITS]; + struct ureg src_texture[MAX_TEXTURE_UNITS]; /* Reg containing each texture unit's sampled texture color, * else undef. */ - struct ureg src_previous; /* Reg containing color from previous + struct ureg src_previous; /* Reg containing color from previous * stage. May need to be decl'd. */ @@ -347,7 +347,7 @@ static GLboolean is_undef( struct ureg reg ) static struct ureg get_temp( struct texenv_fragment_program *p ) { int bit; - + /* First try and reuse temps which have been used already: */ bit = ffs( ~p->temp_in_use & p->alu_temps ); @@ -369,7 +369,7 @@ static struct ureg get_temp( struct texenv_fragment_program *p ) static struct ureg get_tex_temp( struct texenv_fragment_program *p ) { int bit; - + /* First try to find availble temp not previously used (to avoid * starting a new texture indirection). According to the spec, the * ~p->temps_output isn't necessary, but will keep it there for @@ -379,7 +379,7 @@ static struct ureg get_tex_temp( struct texenv_fragment_program *p ) /* Then any unused temporary: */ - if (!bit) + if (!bit) bit = ffs( ~p->temp_in_use ); if (!bit) { @@ -406,7 +406,7 @@ static void release_temps( struct texenv_fragment_program *p ) } -static struct ureg register_param6( struct texenv_fragment_program *p, +static struct ureg register_param6( struct texenv_fragment_program *p, GLint s0, GLint s1, GLint s2, @@ -473,14 +473,14 @@ emit_op(struct texenv_fragment_program *p, { GLuint nr = p->program->Base.NumInstructions++; struct fp_instruction *inst = &p->program->Instructions[nr]; - + memset(inst, 0, sizeof(*inst)); inst->Opcode = op; - + emit_arg( &inst->SrcReg[0], src0 ); emit_arg( &inst->SrcReg[1], src1 ); emit_arg( &inst->SrcReg[2], src2 ); - + inst->Saturate = saturate; emit_dst( &inst->DstReg, dest, mask ); @@ -492,7 +492,7 @@ emit_op(struct texenv_fragment_program *p, return inst; } - + static struct ureg emit_arith( struct texenv_fragment_program *p, GLuint op, @@ -504,7 +504,7 @@ static struct ureg emit_arith( struct texenv_fragment_program *p, struct ureg src2 ) { emit_op(p, op, dest, mask, saturate, src0, src1, src2); - + /* Accounting for indirection tracking: */ if (src0.file == PROGRAM_TEMPORARY) @@ -518,7 +518,7 @@ static struct ureg emit_arith( struct texenv_fragment_program *p, if (dest.file == PROGRAM_TEMPORARY) p->alu_temps |= 1 << dest.idx; - + p->program->NumAluInstructions++; return dest; } @@ -531,13 +531,13 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, GLuint tex_idx, struct ureg coord ) { - struct fp_instruction *inst = emit_op( p, op, - dest, destmask, + struct fp_instruction *inst = emit_op( p, op, + dest, destmask, 0, /* don't saturate? */ coord, /* arg 0? */ undef, undef); - + inst->TexSrcIdx = tex_idx; inst->TexSrcUnit = tex_unit; @@ -559,7 +559,7 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, } -static struct ureg register_const4f( struct texenv_fragment_program *p, +static struct ureg register_const4f( struct texenv_fragment_program *p, GLfloat s0, GLfloat s1, GLfloat s2, @@ -585,21 +585,21 @@ static struct ureg register_const4f( struct texenv_fragment_program *p, static struct ureg get_one( struct texenv_fragment_program *p ) { - if (is_undef(p->one)) + if (is_undef(p->one)) p->one = register_scalar_const(p, 1.0); return p->one; } static struct ureg get_half( struct texenv_fragment_program *p ) { - if (is_undef(p->half)) + if (is_undef(p->half)) p->one = register_scalar_const(p, 0.5); return p->half; } static struct ureg get_zero( struct texenv_fragment_program *p ) { - if (is_undef(p->zero)) + if (is_undef(p->zero)) p->one = register_scalar_const(p, 0.0); return p->zero; } @@ -614,11 +614,11 @@ static void program_error( struct texenv_fragment_program *p, const char *msg ) p->error = 1; } -static struct ureg get_source( struct texenv_fragment_program *p, +static struct ureg get_source( struct texenv_fragment_program *p, GLuint src, GLuint unit ) { switch (src) { - case SRC_TEXTURE: + case SRC_TEXTURE: assert(!is_undef(p->src_texture[unit])); return p->src_texture[unit]; @@ -629,7 +629,7 @@ static struct ureg get_source( struct texenv_fragment_program *p, case SRC_TEXTURE4: case SRC_TEXTURE5: case SRC_TEXTURE6: - case SRC_TEXTURE7: + case SRC_TEXTURE7: assert(!is_undef(p->src_texture[src - SRC_TEXTURE0])); return p->src_texture[src - SRC_TEXTURE0]; @@ -648,10 +648,10 @@ static struct ureg get_source( struct texenv_fragment_program *p, } } -static struct ureg emit_combine_source( struct texenv_fragment_program *p, +static struct ureg emit_combine_source( struct texenv_fragment_program *p, GLuint mask, GLuint unit, - GLuint source, + GLuint source, GLuint operand ) { struct ureg arg, src, one; @@ -659,7 +659,7 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, src = get_source(p, source, unit); switch (operand) { - case OPR_ONE_MINUS_SRC_COLOR: + case OPR_ONE_MINUS_SRC_COLOR: /* Get unused tmp, * Emit tmp = 1.0 - arg.xyzw */ @@ -667,12 +667,12 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, one = get_one( p ); return emit_arith( p, FP_OPCODE_SUB, arg, mask, 0, one, src, undef); - case OPR_SRC_ALPHA: + case OPR_SRC_ALPHA: if (mask == WRITEMASK_W) return src; else return swizzle1( src, W ); - case OPR_ONE_MINUS_SRC_ALPHA: + case OPR_ONE_MINUS_SRC_ALPHA: /* Get unused tmp, * Emit tmp = 1.0 - arg.wwww */ @@ -684,7 +684,7 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, return get_zero(p); case OPR_ONE: return get_one(p); - case OPR_SRC_COLOR: + case OPR_SRC_COLOR: default: return src; } @@ -695,29 +695,29 @@ static GLboolean args_match( struct state_key *key, GLuint unit ) int i, nr = key->unit[unit].NumArgsRGB; for (i = 0 ; i < nr ; i++) { - if (key->unit[unit].OptA[i].Source != key->unit[unit].OptRGB[i].Source) + if (key->unit[unit].OptA[i].Source != key->unit[unit].OptRGB[i].Source) return GL_FALSE; switch(key->unit[unit].OptA[i].Operand) { - case OPR_SRC_ALPHA: + case OPR_SRC_ALPHA: switch(key->unit[unit].OptRGB[i].Operand) { - case OPR_SRC_COLOR: - case OPR_SRC_ALPHA: + case OPR_SRC_COLOR: + case OPR_SRC_ALPHA: break; default: return GL_FALSE; } break; - case OPR_ONE_MINUS_SRC_ALPHA: + case OPR_ONE_MINUS_SRC_ALPHA: switch(key->unit[unit].OptRGB[i].Operand) { - case OPR_ONE_MINUS_SRC_COLOR: - case OPR_ONE_MINUS_SRC_ALPHA: + case OPR_ONE_MINUS_SRC_COLOR: + case OPR_ONE_MINUS_SRC_ALPHA: break; default: return GL_FALSE; } break; - default: + default: return GL_FALSE; /* impossible */ } } @@ -742,16 +742,16 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, src[i] = emit_combine_source( p, mask, unit, opt[i].Source, opt[i].Operand ); switch (mode) { - case MODE_REPLACE: + case MODE_REPLACE: if (mask == WRITEMASK_XYZW && !saturate) return src[0]; else return emit_arith( p, FP_OPCODE_MOV, dest, mask, saturate, src[0], undef, undef ); - case MODE_MODULATE: + case MODE_MODULATE: return emit_arith( p, FP_OPCODE_MUL, dest, mask, saturate, src[0], src[1], undef ); - case MODE_ADD: - return emit_arith( p, FP_OPCODE_ADD, dest, mask, saturate, + case MODE_ADD: + return emit_arith( p, FP_OPCODE_ADD, dest, mask, saturate, src[0], src[1], undef ); case MODE_ADD_SIGNED: /* tmp = arg0 + arg1 @@ -761,16 +761,16 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, emit_arith( p, FP_OPCODE_ADD, tmp, mask, 0, src[0], src[1], undef ); emit_arith( p, FP_OPCODE_SUB, dest, mask, saturate, tmp, half, undef ); return dest; - case MODE_INTERPOLATE: + case MODE_INTERPOLATE: /* Arg0 * (Arg2) + Arg1 * (1-Arg2) -- note arguments are reordered: */ return emit_arith( p, FP_OPCODE_LRP, dest, mask, saturate, src[2], src[0], src[1] ); - case MODE_SUBTRACT: + case MODE_SUBTRACT: return emit_arith( p, FP_OPCODE_SUB, dest, mask, saturate, src[0], src[1], undef ); case MODE_DOT3_RGBA: - case MODE_DOT3_RGBA_EXT: + case MODE_DOT3_RGBA_EXT: case MODE_DOT3_RGB_EXT: case MODE_DOT3_RGB: { struct ureg tmp0 = get_temp( p ); @@ -781,15 +781,15 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, /* tmp0 = 2*src0 - 1 * tmp1 = 2*src1 - 1 * - * dst = tmp0 dot3 tmp1 + * dst = tmp0 dot3 tmp1 */ - emit_arith( p, FP_OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0, + emit_arith( p, FP_OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0, two, src[0], neg1); if (memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0) tmp1 = tmp0; else - emit_arith( p, FP_OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0, + emit_arith( p, FP_OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0, two, src[1], neg1); emit_arith( p, FP_OPCODE_DP3, dest, mask, saturate, tmp0, tmp1, undef); return dest; @@ -810,7 +810,7 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, /* Arg0 * Arg2 - Arg1 */ emit_arith( p, FP_OPCODE_MAD, dest, mask, 0, src[0], src[2], negate(src[1]) ); return dest; - default: + default: return src[0]; } } @@ -827,7 +827,7 @@ static struct ureg emit_texenv( struct texenv_fragment_program *p, int unit ) if (!key->unit[unit].enabled) { return get_source(p, SRC_PREVIOUS, 0); } - + switch (key->unit[unit].ModeRGB) { case MODE_DOT3_RGB_EXT: alpha_shift = key->unit[unit].ScaleShiftA; @@ -842,7 +842,7 @@ static struct ureg emit_texenv( struct texenv_fragment_program *p, int unit ) alpha_shift = key->unit[unit].ScaleShiftA; break; } - + /* If this is the very last calculation, emit direct to output reg: */ if (key->separate_specular || @@ -895,13 +895,13 @@ static struct ureg emit_texenv( struct texenv_fragment_program *p, int unit ) shift = register_scalar_const(p, 1<src_texture[unit] = emit_texld( p, FP_OPCODE_TXP, - tmp, WRITEMASK_XYZW, + tmp, WRITEMASK_XYZW, unit, dim, texcoord ); } } -static GLboolean load_texenv_source( struct texenv_fragment_program *p, +static GLboolean load_texenv_source( struct texenv_fragment_program *p, GLuint src, GLuint unit ) { switch (src) { - case SRC_TEXTURE: + case SRC_TEXTURE: load_texture(p, unit); break; @@ -943,16 +943,16 @@ static GLboolean load_texenv_source( struct texenv_fragment_program *p, case SRC_TEXTURE4: case SRC_TEXTURE5: case SRC_TEXTURE6: - case SRC_TEXTURE7: - if (!p->state->unit[src - SRC_TEXTURE0].enabled) + case SRC_TEXTURE7: + if (!p->state->unit[src - SRC_TEXTURE0].enabled) return GL_FALSE; load_texture(p, src - SRC_TEXTURE0); break; - + default: break; } - + return GL_TRUE; } @@ -1051,7 +1051,7 @@ static void create_new_program(struct state_key *key, GLcontext *ctx, } else p.program->FogOption = GL_NONE; - if (p.program->NumTexIndirections > ctx->Const.MaxFragmentProgramTexIndirections) + if (p.program->NumTexIndirections > ctx->Const.MaxFragmentProgramTexIndirections) program_error(&p, "Exceeded max nr indirect texture lookups"); if (p.program->NumTexInstructions > ctx->Const.MaxFragmentProgramTexInstructions) @@ -1065,7 +1065,7 @@ static void create_new_program(struct state_key *key, GLcontext *ctx, */ if (ctx->Driver.ProgramStringNotify || DISASSEM) { if (ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB, + ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB, &p.program->Base ); if (DISASSEM) { @@ -1073,7 +1073,7 @@ static void create_new_program(struct state_key *key, GLcontext *ctx, p.program->Instructions); _mesa_printf("\n"); } - + } } @@ -1123,24 +1123,24 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) { struct state_key *key; GLuint hash; - + if (ctx->FragmentProgram._Enabled) return; - + key = make_state_key(ctx); hash = hash_key(key); ctx->FragmentProgram._Current = ctx->_TexEnvProgram = (struct fragment_program *) search_cache(ctx->Texture.env_fp_cache, hash, key, sizeof(*key)); - + if (!ctx->_TexEnvProgram) { if (0) _mesa_printf("Building new texenv proggy for key %x\n", hash); - - ctx->FragmentProgram._Current = ctx->_TexEnvProgram = - (struct fragment_program *) + + ctx->FragmentProgram._Current = ctx->_TexEnvProgram = + (struct fragment_program *) ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); - + create_new_program(key, ctx, ctx->_TexEnvProgram); cache_item(&ctx->Texture.env_fp_cache, hash, key, ctx->_TexEnvProgram); @@ -1148,7 +1148,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) FREE(key); if (0) _mesa_printf("Found existing texenv program for key %x\n", hash); } - + } void _mesa_TexEnvProgramCacheDestroy( GLcontext *ctx ) diff --git a/reactos/dll/3rdparty/mesa32/src/main/texformat.c b/reactos/dll/3rdparty/mesa32/src/main/texformat.c index 878a10bb7cb..d18ba42ac01 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texformat.c +++ b/reactos/dll/3rdparty/mesa32/src/main/texformat.c @@ -1089,7 +1089,7 @@ const struct gl_texture_format _mesa_null_texformat = { * * \return a pointer to a gl_texture_format object which describes the * choosen texture format, or NULL on failure. - * + * * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers * will typically override this function with a specialized version. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/texformat.h b/reactos/dll/3rdparty/mesa32/src/main/texformat.h index 35522d62189..bf0e5c874f1 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texformat.h +++ b/reactos/dll/3rdparty/mesa32/src/main/texformat.h @@ -46,8 +46,8 @@ * function in texstore.c used for auto mipmap generation. */ enum _format { - /** - * \name Hardware-friendly formats. + /** + * \name Hardware-friendly formats. * * Drivers can override the default formats and convert texture images to * one of these as required. The driver's diff --git a/reactos/dll/3rdparty/mesa32/src/main/texformat_tmp.h b/reactos/dll/3rdparty/mesa32/src/main/texformat_tmp.h index 20214520c75..485b4d08771 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texformat_tmp.h +++ b/reactos/dll/3rdparty/mesa32/src/main/texformat_tmp.h @@ -27,16 +27,16 @@ /** * \file texformat_tmp.h * Texel fetch functions template. - * + * * This template file is used by texformat.c to generate texel fetch functions - * for 1-D, 2-D and 3-D texture images. + * for 1-D, 2-D and 3-D texture images. * * It should be expanded by defining \p DIM as the number texture dimensions * (1, 2 or 3). According to the value of \p DIM a series of macros is defined * for the texel lookup in the gl_texture_image::Data. - * + * * \sa texformat.c and FetchTexel. - * + * * \author Gareth Hughes * \author Brian Paul */ @@ -261,8 +261,8 @@ static void FETCH(f_luminance_alpha)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLchan *src = CHAN_ADDR( texImage, i, j, k, 2 ); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = CHAN_TO_FLOAT(src[0]); texel[ACOMP] = CHAN_TO_FLOAT(src[1]); } @@ -296,9 +296,9 @@ static void FETCH(f_intensity)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLchan *src = CHAN_ADDR( texImage, i, j, k, 1 ); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = texel[ACOMP] = CHAN_TO_FLOAT(src[0]); } @@ -1281,8 +1281,8 @@ static void FETCH(al88)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { const GLushort s = *USHORT_ADDR( texImage, i, j, k ); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = UBYTE_TO_CHAN( s & 0xff ); texel[ACOMP] = UBYTE_TO_CHAN( s >> 8 ); } @@ -1292,8 +1292,8 @@ static void FETCH(f_al88)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort s = *USHORT_ADDR( texImage, i, j, k ); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); } @@ -1316,8 +1316,8 @@ static void FETCH(al88_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { const GLushort s = *USHORT_ADDR( texImage, i, j, k ); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = UBYTE_TO_CHAN( s >> 8 ); texel[ACOMP] = UBYTE_TO_CHAN( s & 0xff ); } @@ -1327,8 +1327,8 @@ static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort s = *USHORT_ADDR( texImage, i, j, k ); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); } @@ -1401,8 +1401,8 @@ static void FETCH(f_a8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = 0.0; texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); } @@ -1436,8 +1436,8 @@ static void FETCH(f_l8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); - texel[RCOMP] = - texel[GCOMP] = + texel[RCOMP] = + texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); texel[ACOMP] = 1.0F; } @@ -1471,9 +1471,9 @@ static void FETCH(f_i8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); } diff --git a/reactos/dll/3rdparty/mesa32/src/main/teximage.c b/reactos/dll/3rdparty/mesa32/src/main/teximage.c index d4d023acda3..b637a80a81c 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/teximage.c +++ b/reactos/dll/3rdparty/mesa32/src/main/teximage.c @@ -273,7 +273,7 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) ; /* fallthrough */ } } - + if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: @@ -497,9 +497,9 @@ is_ycbcr_format(GLenum format) /** * Test if it is a supported compressed format. - * + * * \param internalFormat the internal format token provided by the user. - * + * * \ret GL_TRUE if \p internalFormat is a supported compressed format, or * GL_FALSE otherwise. * @@ -531,12 +531,12 @@ is_compressed_format(GLcontext *ctx, GLenum internalFormat) /** * Store a gl_texture_image pointer in a gl_texture_object structure * according to the target and level parameters. - * + * * \param tObj texture object. * \param target texture target. * \param level image level. * \param texImage texture image. - * + * * This was basically prompted by the introduction of cube maps. */ void @@ -559,7 +559,7 @@ _mesa_set_tex_image(struct gl_texture_object *tObj, case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: { - GLuint face = ((GLuint) target - + GLuint face = ((GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X); tObj->Image[face][level] = texImage; } @@ -579,7 +579,7 @@ _mesa_set_tex_image(struct gl_texture_object *tObj, /** * Allocate a texture image structure. - * + * * Called via ctx->Driver.NewTextureImage() unless overriden by a device * driver. * @@ -659,7 +659,7 @@ is_proxy_target(GLenum target) * \param target texture target. * * \return pointer to the texture object on success, or NULL on failure. - * + * * \sa gl_texture_unit. */ struct gl_texture_object * @@ -741,9 +741,9 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: if (ctx->Extensions.ARB_texture_cube_map) { - GLuint face = ((GLuint) target - + GLuint face = ((GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X); return texUnit->CurrentCubeMap->Image[face][level]; } @@ -904,7 +904,7 @@ _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level) * * \param ctx GL context. * \param target texture target. - * + * * \return the maximum number of allowed mipmap levels for the given * texture target, or zero if passed a bad target. * @@ -997,7 +997,7 @@ make_null_texture(GLint width, GLint height, GLint depth, GLenum format) /** * Reset the fields of a gl_texture_image struct to zero. - * + * * \param img texture image structure. * * This is called when a proxy texture test fails, we set all the @@ -1205,7 +1205,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, /** * Test the glTexImage[123]D() parameters for errors. - * + * * \param ctx GL context. * \param target texture target given by the user. * \param level image level given by the user. @@ -1217,7 +1217,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, * \param height image height given by the user. * \param depth image depth given by the user. * \param border image border given by the user. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. * * Verifies each of the parameters against the constants specified in @@ -1455,7 +1455,7 @@ texture_error_check( GLcontext *ctx, GLenum target, /** * Test glTexSubImage[123]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. @@ -1468,7 +1468,7 @@ texture_error_check( GLcontext *ctx, GLenum target, * \param width image width given by the user. * \param height image height given by the user. * \param depth image depth given by the user. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. * * Verifies each of the parameters against the constants specified in @@ -1623,12 +1623,12 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%D(width)", dimensions); return GL_TRUE; - } + } if ((height & 3) && (GLuint) height != texImage->Height) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexSubImage%D(width)", dimensions); return GL_TRUE; - } + } } return GL_FALSE; @@ -1637,7 +1637,7 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, /** * Test glCopyTexImage[12]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. @@ -1647,9 +1647,9 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, * \param height image height given by the user. * \param depth image depth given by the user. * \param border texture border. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * + * * Verifies each of the parameters against the constants specified in * __GLcontextRec::Const and the supported extensions, and according to the * OpenGL specification. @@ -1775,7 +1775,7 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, /** * Test glCopyTexImage[12]D() parameters for errors. - * + * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. @@ -1785,9 +1785,9 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, * \param zoffset sub-image z offset given by the user. * \param width image width given by the user. * \param height image height given by the user. - * + * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * + * * Verifies each of the parameters against the constants specified in * __GLcontextRec::Const and the supported extensions, and according to the * OpenGL specification. @@ -1915,12 +1915,12 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, _mesa_error(ctx, GL_INVALID_VALUE, "glCopyTexSubImage%D(width)", dimensions); return GL_TRUE; - } + } if ((height & 3) != 0 && (GLuint) height != teximage->Height) { _mesa_error(ctx, GL_INVALID_VALUE, "glCopyTexSubImage%D(height)", dimensions); return GL_TRUE; - } + } } if (teximage->IntFormat == GL_YCBCR_MESA) { @@ -3166,7 +3166,7 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)"); return; } - + if (width == 0) return; /* no-op, not an error */ @@ -3217,7 +3217,7 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)"); return; } - + if (width == 0 || height == 0) return; /* no-op, not an error */ @@ -3268,7 +3268,7 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)"); return; } - + if (width == 0 || height == 0 || depth == 0) return; /* no-op, not an error */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/teximage.h b/reactos/dll/3rdparty/mesa32/src/main/teximage.h index 45c851e5c88..4c4d589ff44 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/teximage.h +++ b/reactos/dll/3rdparty/mesa32/src/main/teximage.h @@ -58,7 +58,7 @@ _mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *teximage ); extern void -_mesa_free_texture_image_data( GLcontext *ctx, +_mesa_free_texture_image_data( GLcontext *ctx, struct gl_texture_image *texImage ); diff --git a/reactos/dll/3rdparty/mesa32/src/main/texobj.c b/reactos/dll/3rdparty/mesa32/src/main/texobj.c index 5594cd9382b..331ac1cc1d1 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texobj.c +++ b/reactos/dll/3rdparty/mesa32/src/main/texobj.c @@ -51,7 +51,7 @@ * * Called via ctx->Driver.NewTextureObject, unless overridden by a device * driver. - * + * * \param shared the shared GL state structure to contain the texture object * \param name integer name for the texture object * \param target either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, @@ -203,7 +203,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, /** - * Report why a texture object is incomplete. + * Report why a texture object is incomplete. * * \param t texture object. * \param why string describing why it's incomplete. @@ -485,7 +485,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, return; } /* check that all six images have same size */ - if (t->Image[face][i]->Width2!=width || + if (t->Image[face][i]->Width2!=width || t->Image[face][i]->Height2!=height) { t->Complete = GL_FALSE; incomplete(t, "CubeMap Image[n][i] bad size"); @@ -534,7 +534,7 @@ _glthread_DECLARE_STATIC_MUTEX(GenTexturesLock); * While holding the GenTexturesLock lock, calls _mesa_HashFindFreeKeyBlock() * to find a block of free texture IDs which are stored in \p textures. * Corresponding empty texture objects are also generated. - */ + */ void GLAPIENTRY _mesa_GenTextures( GLsizei n, GLuint *textures ) { @@ -681,10 +681,10 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) /** * Bind a named texture to a texturing target. - * + * * \param target texture target. * \param texName texture name. - * + * * \sa glBindTexture(). * * Determines the old texture object bound and returns immediately if rebinding @@ -864,13 +864,13 @@ _mesa_BindTexture( GLenum target, GLuint texName ) /** * Set texture priorities. - * + * * \param n number of textures. * \param texName texture names. * \param priorities corresponding texture priorities. - * + * * \sa glPrioritizeTextures(). - * + * * Looks up each texture in the hash, clamps the corresponding priority between * 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture. */ @@ -907,13 +907,13 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, /** * See if textures are loaded in texture memory. - * + * * \param n number of textures to query. * \param texName array with the texture names. * \param residences array which will hold the residence status. * - * \return GL_TRUE if all textures are resident and \p residences is left unchanged, - * + * \return GL_TRUE if all textures are resident and \p residences is left unchanged, + * * \sa glAreTexturesResident(). * * Looks up each texture in the hash and calls @@ -964,7 +964,7 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName, residences[i] = GL_FALSE; } } - + return allResident; } @@ -975,7 +975,7 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName, * * \return GL_TRUE if texture name corresponds to a texture, or GL_FALSE * otherwise. - * + * * \sa glIsTexture(). * * Calls _mesa_HashLookup(). diff --git a/reactos/dll/3rdparty/mesa32/src/main/texstate.c b/reactos/dll/3rdparty/mesa32/src/main/texstate.c index 8ac41a27729..6f3257df0fb 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texstate.c +++ b/reactos/dll/3rdparty/mesa32/src/main/texstate.c @@ -22,7 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/** +/** * \file texstate.c * * Texture state handling. @@ -173,7 +173,7 @@ _mesa_print_texunit_state( GLcontext *ctx, GLuint unit ) /** * Convert "classic" texture environment to ARB_texture_env_combine style * environments. - * + * * \param state texture_env_combine state vector to be filled-in. * \param mode Classic texture environment mode (i.e., \c GL_REPLACE, * \c GL_BLEND, \c GL_DECAL, etc.). @@ -204,7 +204,7 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, case GL_YCBCR_MESA: state->SourceA[0] = GL_PREVIOUS; break; - + default: _mesa_problem(NULL, "Invalid texBaseFormat in calculate_derived_texenv"); return; @@ -216,7 +216,7 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, mode_rgb = (texBaseFormat == GL_ALPHA) ? GL_REPLACE : mode; mode_a = mode; break; - + case GL_DECAL: mode_rgb = GL_INTERPOLATE; mode_a = GL_REPLACE; @@ -280,7 +280,7 @@ calculate_derived_texenv( struct gl_tex_env_combine_state *state, "Invalid texture env mode in calculate_derived_texenv"); return; } - + state->ModeRGB = (state->SourceRGB[0] != GL_PREVIOUS) ? mode_rgb : GL_REPLACE; state->ModeA = (state->SourceA[0] != GL_PREVIOUS) @@ -1203,7 +1203,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) /* Texture Parameters */ /**********************************************************************/ -static GLboolean +static GLboolean _mesa_validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum eparam) { @@ -2922,8 +2922,8 @@ update_texture_state( GLcontext *ctx ) { GLuint unit; - ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are - * actual changes. + ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are + * actual changes. */ ctx->Texture._EnabledUnits = 0; @@ -3130,11 +3130,11 @@ void _mesa_update_texture( GLcontext *ctx, GLuint new_state ) /** * Allocate the proxy textures for the given context. - * + * * \param ctx the context to allocate proxies for. - * + * * \return GL_TRUE on success, or GL_FALSE on failure - * + * * If run out of memory part way through the allocations, clean up and return * GL_FALSE. */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/texstate.h b/reactos/dll/3rdparty/mesa32/src/main/texstate.h index 7cc3d2c19ce..75fb486321e 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texstate.h +++ b/reactos/dll/3rdparty/mesa32/src/main/texstate.h @@ -178,13 +178,13 @@ _mesa_GetPixelTexGenParameterivSGIS(GLenum target, GLint *value); */ /*@{*/ -extern void +extern void _mesa_update_texture( GLcontext *ctx, GLuint new_state ); extern GLboolean _mesa_init_texture( GLcontext *ctx ); -extern void +extern void _mesa_free_texture_data( GLcontext *ctx ); /*@}*/ diff --git a/reactos/dll/3rdparty/mesa32/src/main/texstore.c b/reactos/dll/3rdparty/mesa32/src/main/texstore.c index af1bbf57e0c..055ad0008cf 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/texstore.c +++ b/reactos/dll/3rdparty/mesa32/src/main/texstore.c @@ -165,7 +165,7 @@ compute_component_mapping(GLenum logicalBaseFormat, GLenum textureBaseFormat, _mesa_problem(NULL, "Unexpected logicalBaseFormat"); map[0] = map[1] = 0; break; - } + } } @@ -556,7 +556,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, * \param count number of pixels to copy/swizzle. */ static void -swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, +swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, GLuint srcComponents, const GLubyte *map, GLuint count) { GLubyte tmp[8]; @@ -568,8 +568,8 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, switch (dstComponents) { case 4: for (i = 0; i < count; i++) { - COPY_4UBV(tmp, src); - src += srcComponents; + COPY_4UBV(tmp, src); + src += srcComponents; dst[0] = tmp[map[0]]; dst[1] = tmp[map[1]]; dst[2] = tmp[map[2]]; @@ -579,8 +579,8 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, break; case 3: for (i = 0; i < count; i++) { - COPY_4UBV(tmp, src); - src += srcComponents; + COPY_4UBV(tmp, src); + src += srcComponents; dst[0] = tmp[map[0]]; dst[1] = tmp[map[1]]; dst[2] = tmp[map[2]]; @@ -589,8 +589,8 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, break; case 2: for (i = 0; i < count; i++) { - COPY_4UBV(tmp, src); - src += srcComponents; + COPY_4UBV(tmp, src); + src += srcComponents; dst[0] = tmp[map[0]]; dst[1] = tmp[map[1]]; dst += 2; @@ -604,7 +604,7 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src, * Transfer a GLubyte texture image with component swizzling. */ static void -_mesa_swizzle_ubyte_image(GLcontext *ctx, +_mesa_swizzle_ubyte_image(GLcontext *ctx, GLuint dimensions, GLenum srcFormat, const GLubyte *dstmap, GLint dstComponents, @@ -645,7 +645,7 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, if (srcRowStride == srcWidth * srcComponents && (srcImageStride == srcWidth * srcHeight * srcComponents || srcDepth == 1)) { - swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map, + swizzle_copy(dstImage, dstComponents, srcImage, srcComponents, map, srcWidth * srcHeight * srcDepth); } else { @@ -730,7 +730,7 @@ memcpy_texture(GLcontext *ctx, * _mesa_texformat_luminance * _mesa_texformat_luminance_alpha * _mesa_texformat_intensity - * + * * \param dims either 1 or 2 or 3 * \param baseInternalFormat user-specified base internal format * \param dstFormat destination Mesa texture format @@ -1077,7 +1077,7 @@ _mesa_texstore_rgba8888(STORE_PARAMS) #if 0 else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - srcType == GL_UNSIGNED_BYTE && + srcType == GL_UNSIGNED_BYTE && dstFormat == &_mesa_texformat_rgba8888 && littleEndian && /* Three texture formats involved: srcFormat, @@ -1097,14 +1097,14 @@ _mesa_texstore_rgba8888(STORE_PARAMS) dstmap[2] = 1; dstmap[1] = 2; dstmap[0] = 3; - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, dstmap, 4, dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageStride, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); + srcPacking); } #endif else { @@ -1257,7 +1257,7 @@ _mesa_texstore_argb8888(STORE_PARAMS) else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && dstFormat == &_mesa_texformat_argb8888 && - srcType == GL_UNSIGNED_BYTE && + srcType == GL_UNSIGNED_BYTE && littleEndian && /* Three texture formats involved: srcFormat, * baseInternalFormat and destFormat (GL_RGBA). Only two @@ -1275,14 +1275,14 @@ _mesa_texstore_argb8888(STORE_PARAMS) dstmap[2] = 0; /* red */ dstmap[1] = 1; /* green */ dstmap[0] = 2; /* blue */ - + _mesa_swizzle_ubyte_image(ctx, dims, srcFormat, dstmap, 4, dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageStride, srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); + srcPacking); } else { /* general path */ diff --git a/reactos/dll/3rdparty/mesa32/src/main/varray.c b/reactos/dll/3rdparty/mesa32/src/main/varray.c index 6781b698150..4eda4a84563 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/varray.c +++ b/reactos/dll/3rdparty/mesa32/src/main/varray.c @@ -921,7 +921,7 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, /***** Initialization *****/ /**********************************************************************/ -void +void _mesa_init_varray( GLcontext * ctx ) { GLuint i; diff --git a/reactos/dll/3rdparty/mesa32/src/main/vtxfmt.h b/reactos/dll/3rdparty/mesa32/src/main/vtxfmt.h index 76f108e0232..eca2d474a2c 100644 --- a/reactos/dll/3rdparty/mesa32/src/main/vtxfmt.h +++ b/reactos/dll/3rdparty/mesa32/src/main/vtxfmt.h @@ -1,6 +1,6 @@ /** * \file vtxfmt.h - * + * * \author Keith Whitwell * \author Gareth Hughes */ diff --git a/reactos/dll/3rdparty/mesa32/src/math/m_debug_util.h b/reactos/dll/3rdparty/mesa32/src/math/m_debug_util.h index 1b7d742a80b..b5c53b78876 100644 --- a/reactos/dll/3rdparty/mesa32/src/math/m_debug_util.h +++ b/reactos/dll/3rdparty/mesa32/src/math/m_debug_util.h @@ -191,7 +191,7 @@ extern char *mesa_profile; unsigned int a,d; \ __asm__ volatile("rdtsc" : "=a" (a), "=d" (d)); \ (val) = ((unsigned long)a) | (((unsigned long)d)<<32); \ -} while(0) +} while(0) /* Copied from i386 PIII version */ #define INIT_COUNTER() \ @@ -306,9 +306,9 @@ enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 }; #elif defined(__MSC__) # define ALIGN16(type, array) type array __declspec(align(16)) /* GH: Does this work? */ #elif defined(__WATCOMC__) -# define ALIGN16(type, array) /* Watcom does not support this */ +# define ALIGN16(type, array) /* Watcom does not support this */ #elif defined(__xlC__) -# define ALIGN16(type, array) type __align (16) array +# define ALIGN16(type, array) type __align (16) array #else # warning "ALIGN16 will not 16-byte align!\n" # define ALIGN16 diff --git a/reactos/dll/3rdparty/mesa32/src/math/m_matrix.c b/reactos/dll/3rdparty/mesa32/src/math/m_matrix.c index 408db9b9631..30363be6dab 100644 --- a/reactos/dll/3rdparty/mesa32/src/math/m_matrix.c +++ b/reactos/dll/3rdparty/mesa32/src/math/m_matrix.c @@ -101,15 +101,15 @@ /*@}*/ -/** +/** * Test geometry related matrix flags. - * + * * \param mat a pointer to a GLmatrix structure. * \param a flags mask. * * \returns non-zero if all geometry related matrix flags are contained within * the mask, or zero otherwise. - */ + */ #define TEST_MAT_FLAGS(mat, a) \ ((MAT_FLAGS_GEOMETRY & (~(a)) & ((mat)->flags) ) == 0) @@ -159,7 +159,7 @@ static GLfloat Identity[16] = { * \warning Is assumed that \p product != \p b. \p product == \p a is allowed. * * \note KW: 4*16 = 64 multiplications - * + * * \author This \c matmul was contributed by Thomas Malik */ static void matmul4( GLfloat *product, const GLfloat *a, const GLfloat *b ) @@ -209,7 +209,7 @@ static void matmul34( GLfloat *product, const GLfloat *a, const GLfloat *b ) * matrix, and that will receive the product result. * \param m right multiplication matrix array. * \param flags flags of the matrix \p m. - * + * * Joins both flags and marks the type and inverse as dirty. Calls matmul34() * if both matrices are 3D, or matmul4() otherwise. */ @@ -229,7 +229,7 @@ static void matrix_multf( GLmatrix *mat, const GLfloat *m, GLuint flags ) * \param dest destination matrix. * \param a left matrix. * \param b right matrix. - * + * * Joins both flags and marks the type and inverse as dirty. Calls matmul34() * if both matrices are 3D, or matmul4() otherwise. */ @@ -252,7 +252,7 @@ _math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ) * * \param dest left and destination matrix. * \param m right matrix array. - * + * * Marks the matrix flags with general flag, and type and inverse dirty flags. * Calls matmul4() for the multiplication. */ @@ -291,7 +291,7 @@ static void print_matrix_floats( const GLfloat m[16] ) /** * Dumps the contents of a GLmatrix structure. - * + * * \param m pointer to the GLmatrix structure. */ void @@ -321,10 +321,10 @@ _math_matrix_print( const GLmatrix *m ) * \param m matrix array. * \param c column of the desired element. * \param r row of the desired element. - * + * * \return value of the desired element. * - * Calculate the linear storage index of the element and references it. + * Calculate the linear storage index of the element and references it. */ #define MAT(m,r,c) (m)[(c)*4+(r)] @@ -342,12 +342,12 @@ _math_matrix_print( const GLmatrix *m ) /** * Compute inverse of 4x4 transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). - * + * * \author * Code contributed by Jacques Leroy jle@star.be * @@ -470,10 +470,10 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) /** * Compute inverse of a general 3d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * \author Adapted from graphics gems II. @@ -544,10 +544,10 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat ) /** * Compute inverse of a 3d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * If the matrix is not an angle preserving matrix then calls @@ -627,10 +627,10 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) /** * Compute inverse of an identity transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return always GL_TRUE. * * Simply copies Identity into GLmatrix::inv. @@ -643,13 +643,13 @@ static GLboolean invert_matrix_identity( GLmatrix *mat ) /** * Compute inverse of a no-rotation 3d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * - * Calculates the + * Calculates the */ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) { @@ -675,10 +675,10 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) /** * Compute inverse of a no-rotation 2d transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * Calculates the inverse matrix by applying the inverse scaling and @@ -759,10 +759,10 @@ static inv_mat_func inv_mat_tab[7] = { /** * Compute inverse of a transformation matrix. - * + * * \param mat pointer to a GLmatrix structure. The matrix inverse will be * stored in the GLmatrix::inv attribute. - * + * * \return GL_TRUE for success, GL_FALSE for failure (\p singular matrix). * * Calls the matrix inversion function in inv_mat_tab corresponding to the @@ -1200,10 +1200,10 @@ _math_matrix_set_identity( GLmatrix *mat ) #define SQ(x) ((x)*(x)) /** - * Determine type and flags from scratch. + * Determine type and flags from scratch. * * \param mat matrix. - * + * * This is expensive enough to only want to do it once. */ static void analyse_from_scratch( GLmatrix *mat ) @@ -1316,7 +1316,7 @@ static void analyse_from_scratch( GLmatrix *mat ) /** * Analyze a matrix given that its flags are accurate. - * + * * This is the more common operation, hopefully. */ static void analyse_from_flags( GLmatrix *mat ) @@ -1461,7 +1461,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) /** * Loads a matrix array into GLmatrix. - * + * * \param m matrix array. * \param mat matrix. * diff --git a/reactos/dll/3rdparty/mesa32/src/ppc/common_ppc.c b/reactos/dll/3rdparty/mesa32/src/ppc/common_ppc.c index 13526df78c9..abc4e875580 100644 --- a/reactos/dll/3rdparty/mesa32/src/ppc/common_ppc.c +++ b/reactos/dll/3rdparty/mesa32/src/ppc/common_ppc.c @@ -44,7 +44,7 @@ unsigned long _mesa_ppc_cpu_features = 0; * Detect CPU features and install optimized transform and lighting routines. * Currently, CPU features are only detected. The optimized routines have * yet to be written. - * + * * \bug * This routine is highly specific to Linux kernel 2.6. I'm still waiting * to hear back from the glibc folk on how to do this "right". @@ -80,7 +80,7 @@ void _mesa_init_all_ppc_transform_asm( void ) fclose( f ); } - + # ifndef USE_VMX_ASM _mesa_ppc_cpu_features &= ~PPC_FEATURES_HAS_ALTIVEC; # endif diff --git a/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.c b/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.c index e139072c303..65c191ca828 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.c @@ -628,7 +628,7 @@ parse_string_without_adding (GLubyte ** inst, struct arb_program *Program) { GLubyte *i = *inst; (void) Program; - + *inst += _mesa_strlen ((char *) i) + 1; return (char *) i; @@ -688,10 +688,10 @@ parse_integer (GLubyte ** inst, struct arb_program *Program) } /** - Accumulate this string of digits, and return them as + Accumulate this string of digits, and return them as a large integer represented in floating point (for range). If scale is not NULL, also accumulates a power-of-ten - integer scale factor that represents the number of digits + integer scale factor that represents the number of digits in the string. */ static GLdouble @@ -735,7 +735,7 @@ parse_float (GLubyte ** inst, struct arb_program *Program) whole = parse_float_string(inst, Program, 0); fraction = parse_float_string(inst, Program, &fracScale); - + /* Parse signed exponent */ exponent = parse_integer(inst, Program); /* This is the exponent */ @@ -1607,7 +1607,7 @@ parse_result_binding (GLcontext * ctx, GLubyte ** inst, GLuint * binding, case FRAGMENT_RESULT_COLOR: /* for frag programs, this is FRAGMENT_RESULT_COLOR */ if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - /* This gets result of the color buffer we're supposed to + /* This gets result of the color buffer we're supposed to * draw into */ parse_output_color_num(ctx, inst, Program, &out_color); @@ -2692,13 +2692,13 @@ parse_fp_vector_src_reg (GLcontext * ctx, GLubyte ** inst, } -static GLuint +static GLuint parse_fp_dst_reg(GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, struct arb_program *Program, struct fp_dst_register *reg ) { GLint file, idx, mask; - + if (parse_masked_dst_reg (ctx, inst, vc_head, Program, &file, &idx, &mask)) return 1; @@ -3121,7 +3121,7 @@ parse_fp_instruction (GLcontext * ctx, GLubyte ** inst, return 0; } -static GLuint +static GLuint parse_vp_dst_reg(GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, struct arb_program *Program, struct vp_dst_register *reg ) diff --git a/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.h b/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.h index 52db0440447..88f6640dc70 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/arbprogparse.h @@ -40,7 +40,7 @@ struct arb_program { struct program Base; - struct program_parameter_list *Parameters; + struct program_parameter_list *Parameters; GLuint InputsRead; GLuint OutputsWritten; @@ -48,7 +48,7 @@ struct arb_program GLuint MajorVersion; GLuint MinorVersion; - /* ARB_vertex_program specifics */ + /* ARB_vertex_program specifics */ struct vp_instruction *VPInstructions; /* Options currently recognized by the parser */ @@ -61,14 +61,14 @@ struct arb_program /* ARB_fragment_program specifics */ struct fp_instruction *FPInstructions; - GLuint TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; - GLuint NumAluInstructions; + GLuint TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; + GLuint NumAluInstructions; GLuint NumTexInstructions; GLuint NumTexIndirections; }; -extern GLuint -_mesa_parse_arb_program( GLcontext *ctx, const GLubyte *str, GLsizei len, +extern GLuint +_mesa_parse_arb_program( GLcontext *ctx, const GLubyte *str, GLsizei len, struct arb_program *Program ); - + #endif diff --git a/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.c b/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.c index 43baab4b0fd..c087c6fcb74 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.c @@ -205,7 +205,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, } _mesa_parse_arb_vertex_program(ctx, target, (const GLubyte *) string, len, prog); - + if (ctx->Driver.ProgramStringNotify) ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base ); } @@ -233,7 +233,7 @@ void GLAPIENTRY _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, + _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } @@ -242,8 +242,8 @@ void GLAPIENTRY _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble *params) { - _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0], - (GLfloat) params[1], (GLfloat) params[2], + _mesa_ProgramEnvParameter4fARB(target, index, (GLfloat) params[0], + (GLfloat) params[1], (GLfloat) params[2], (GLfloat) params[3]); } @@ -307,7 +307,7 @@ _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index, void GLAPIENTRY -_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, +_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -404,7 +404,7 @@ _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_ProgramLocalParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, + _mesa_ProgramLocalParameter4fARB(target, index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } @@ -628,7 +628,7 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) *params = ctx->Const.MaxFragmentProgramEnvParams; break; case GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB: - if (ctx->Driver.IsProgramNative) + if (ctx->Driver.IsProgramNative) *params = ctx->Driver.IsProgramNative( ctx, target, prog ); else *params = GL_TRUE; diff --git a/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.h b/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.h index e1b99ab686f..dfcb7ec28ed 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/arbprogram.h @@ -103,7 +103,7 @@ _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index, extern void GLAPIENTRY -_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, +_mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat *params); @@ -113,7 +113,7 @@ _mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, extern void GLAPIENTRY -_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, +_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); diff --git a/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.c b/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.c index 92e3bb352e0..d4fc0bdd58c 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.c @@ -171,7 +171,7 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, retval = _mesa_parse_arb_program(ctx, str, len, &ap); - /* Parse error. Allocate a dummy program and return */ + /* Parse error. Allocate a dummy program and return */ if (retval) { program->Instructions = (struct vp_instruction *) @@ -180,7 +180,7 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, return; } - /* copy the relvant contents of the arb_program struct into the + /* copy the relvant contents of the arb_program struct into the * fragment_program struct */ program->Base.String = ap.Base.String; @@ -193,7 +193,7 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, program->IsPositionInvariant = ap.HintPositionInvariant; program->InputsRead = ap.InputsRead; program->OutputsWritten = ap.OutputsWritten; - program->Parameters = ap.Parameters; + program->Parameters = ap.Parameters; program->Instructions = ap.VPInstructions; diff --git a/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.h b/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.h index f2ac1570be0..d8985b3ea9b 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/arbvertparse.h @@ -30,7 +30,7 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, const GLubyte * str, GLsizei len, struct vertex_program *program); -extern void +extern void _mesa_debug_vp_inst(GLint num, struct vp_instruction *vp); #endif diff --git a/reactos/dll/3rdparty/mesa32/src/shader/atifragshader.c b/reactos/dll/3rdparty/mesa32/src/shader/atifragshader.c index d8df8f518b6..b767741955c 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/atifragshader.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/atifragshader.c @@ -70,7 +70,7 @@ create_dst_mod_str(GLuint mod) return ret_str; } -static char *atifs_ops[] = {"ColorFragmentOp1ATI", "ColorFragmentOp2ATI", "ColorFragmentOp3ATI", +static char *atifs_ops[] = {"ColorFragmentOp1ATI", "ColorFragmentOp2ATI", "ColorFragmentOp3ATI", "AlphaFragmentOp1ATI", "AlphaFragmentOp2ATI", "AlphaFragmentOp3ATI" }; static void debug_op(GLint optype, GLuint arg_count, GLenum op, GLuint dst, @@ -82,14 +82,14 @@ static void debug_op(GLint optype, GLuint arg_count, GLenum op, GLuint dst, char *op_name; op_name = atifs_ops[(arg_count-1)+(optype?3:0)]; - + fprintf(stderr, "%s(%s, %s", op_name, _mesa_lookup_enum_by_nr(op), _mesa_lookup_enum_by_nr(dst)); if (!optype) fprintf(stderr, ", %d", dstMask); - + fprintf(stderr, ", %s", create_dst_mod_str(dstMod)); - + fprintf(stderr, ", %s, %s, %d", _mesa_lookup_enum_by_nr(arg1), _mesa_lookup_enum_by_nr(arg1Rep), arg1Mod); if (arg_count>1) @@ -261,7 +261,7 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle) new_inst(curProg); ci = curProg->Base.NumInstructions - 1; - /* some validation + /* some validation if ((swizzle != GL_SWIZZLE_STR_ATI) || (swizzle != GL_SWIZZLE_STQ_ATI) || (swizzle != GL_SWIZZLE_STR_DR_ATI) || @@ -360,7 +360,7 @@ _mesa_FragmentOpXATI(GLint optype, GLuint arg_count, GLenum op, GLuint dst, curI->DstReg[optype].Index = dst; curI->DstReg[optype].dstMod = dstMod; curI->DstReg[optype].dstMask = dstMask; - + #if MESA_DEBUG_ATI_FS debug_op(optype, arg_count, op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod); #endif diff --git a/reactos/dll/3rdparty/mesa32/src/shader/grammar/grammar.c b/reactos/dll/3rdparty/mesa32/src/shader/grammar/grammar.c index 0b767c02cd3..11ce2c99a59 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/grammar/grammar.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/grammar/grammar.c @@ -93,7 +93,7 @@ Character range specifier is in the form: '' - '' If specifier is a character range, it evaluates to true if character in the stream is greater - or equal to and less or equal to . In that situation + or equal to and less or equal to . In that situation the stream pointer is advanced to point to next character in the stream. All C-style escape sequences are supported although trigraph sequences are not. The comparisions are performed on 8-bit unsigned integers. diff --git a/reactos/dll/3rdparty/mesa32/src/shader/nvfragparse.c b/reactos/dll/3rdparty/mesa32/src/shader/nvfragparse.c index cd1aa35bf0c..9adffe016ee 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/nvfragparse.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/nvfragparse.c @@ -579,7 +579,7 @@ Parse_TextureImageId(struct parse_state *parseState, if (!Parse_Token(parseState, imageSrc)) RETURN_ERROR; - + if (imageSrc[0] != 'T' || imageSrc[1] != 'E' || imageSrc[2] != 'X') { @@ -1033,7 +1033,7 @@ Parse_VectorSrc(struct parse_state *parseState, RETURN_ERROR2("Undefined constant or parameter: ", ident); } srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; } else if (IsDigit(token[0]) || token[0] == '-' || token[0] == '+' || token[0] == '.'){ /* literal scalar constant */ @@ -1054,7 +1054,7 @@ Parse_VectorSrc(struct parse_state *parseState, RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values); srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; } else { RETURN_ERROR2("Invalid source register name", token); @@ -1144,7 +1144,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState, RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values); srcReg->File = PROGRAM_NAMED_PARAM; - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; } else if (IsDigit(token[0])) { /* scalar literal */ @@ -1153,7 +1153,7 @@ Parse_ScalarSrcReg(struct parse_state *parseState, if (!Parse_ScalarConstant(parseState, values)) RETURN_ERROR; paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values); - srcReg->Index = paramIndex; + srcReg->Index = paramIndex; srcReg->File = PROGRAM_NAMED_PARAM; needSuffix = GL_FALSE; } diff --git a/reactos/dll/3rdparty/mesa32/src/shader/nvfragprog.h b/reactos/dll/3rdparty/mesa32/src/shader/nvfragprog.h index a7149cfdb94..1fc17239271 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/nvfragprog.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/nvfragprog.h @@ -149,7 +149,7 @@ struct fp_dst_register struct fp_instruction { GLuint Opcode:6; - GLuint Saturate:1; + GLuint Saturate:1; GLuint UpdateCondRegister:1; /* NV */ GLuint Precision:2; /* NV: unused/unneeded? */ GLuint TexSrcUnit:4; /* texture unit for TEX, TXD, TXP instructions */ diff --git a/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.c b/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.c index 4b893017649..22f74aa6284 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.c @@ -78,7 +78,7 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) _mesa_error(ctx, GL_INVALID_OPERATION, "glExecuteProgramNV"); return; } - + _mesa_init_vp_per_vertex_registers(ctx); _mesa_init_vp_per_primitive_registers(ctx); COPY_4V(ctx->VertexProgram.Inputs[VERT_ATTRIB_POS], params); @@ -569,7 +569,7 @@ void GLAPIENTRY _mesa_ProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_ProgramParameter4fNV(target, index, + _mesa_ProgramParameter4fNV(target, index, (GLfloat)x, (GLfloat)y, (GLfloat)z, (GLfloat)w); } @@ -583,7 +583,7 @@ _mesa_ProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble *params) { _mesa_ProgramParameter4fNV(target, index, - (GLfloat)params[0], (GLfloat)params[1], + (GLfloat)params[0], (GLfloat)params[1], (GLfloat)params[2], (GLfloat)params[3]); } @@ -806,7 +806,7 @@ void GLAPIENTRY _mesa_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - _mesa_ProgramNamedParameter4fNV(id, len, name, (GLfloat)x, (GLfloat)y, + _mesa_ProgramNamedParameter4fNV(id, len, name, (GLfloat)x, (GLfloat)y, (GLfloat)z, (GLfloat)w); } diff --git a/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.h b/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.h index dcea7727e04..887c958e171 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/nvprogram.h @@ -33,7 +33,7 @@ extern void GLAPIENTRY _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params); -extern GLboolean GLAPIENTRY +extern GLboolean GLAPIENTRY _mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, GLboolean *residences); extern void GLAPIENTRY diff --git a/reactos/dll/3rdparty/mesa32/src/shader/nvvertexec.c b/reactos/dll/3rdparty/mesa32/src/shader/nvvertexec.c index 725e3ec9cd5..9f6ef25ee21 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/nvvertexec.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/nvvertexec.c @@ -232,7 +232,7 @@ get_register_pointer( const struct vp_src_register *source, { if (source->RelAddr) { const GLint reg = source->Index + state->AddressReg[0]; - ASSERT( (source->File == PROGRAM_ENV_PARAM) || + ASSERT( (source->File == PROGRAM_ENV_PARAM) || (source->File == PROGRAM_STATE_VAR) ); if (reg < 0 || reg > MAX_NV_VERTEX_PROGRAM_PARAMS) return ZeroVec; @@ -390,8 +390,8 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) * position and the MVP matrix and stick it into the output pos slot */ if (ctx->VertexProgram.Current->IsPositionInvariant) { - TRANSFORM_POINT( ctx->VertexProgram.Outputs[0], - ctx->_ModelProjectMatrix.m, + TRANSFORM_POINT( ctx->VertexProgram.Outputs[0], + ctx->_ModelProjectMatrix.m, ctx->VertexProgram.Inputs[0]); /* XXX: This could go elsewhere */ diff --git a/reactos/dll/3rdparty/mesa32/src/shader/program.c b/reactos/dll/3rdparty/mesa32/src/shader/program.c index 0ccc741dd0c..8285138502c 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/program.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/program.c @@ -210,7 +210,7 @@ struct program * _mesa_init_fragment_program( GLcontext *ctx, struct fragment_program *prog, GLenum target, GLuint id) { - if (prog) + if (prog) return _mesa_init_program_struct( ctx, &prog->Base, target, id ); else return NULL; @@ -224,7 +224,7 @@ struct program * _mesa_init_vertex_program( GLcontext *ctx, struct vertex_program *prog, GLenum target, GLuint id) { - if (prog) + if (prog) return _mesa_init_program_struct( ctx, &prog->Base, target, id ); else return NULL; @@ -238,7 +238,7 @@ _mesa_init_ati_fragment_shader( GLcontext *ctx, struct ati_fragment_shader *prog, GLenum target, GLuint id ) { - if (prog) + if (prog) return _mesa_init_program_struct( ctx, &prog->Base, target, id ); else return NULL; @@ -252,7 +252,7 @@ _mesa_init_ati_fragment_shader( GLcontext *ctx, * ctx->Driver.NewProgram. May be overridden (ie. replaced) by a * device driver function to implement OO deriviation with additional * types not understood by this function. - * + * * \param ctx context * \param id program id/number * \param target program target/type @@ -400,7 +400,7 @@ add_parameter(struct program_parameter_list *paramList, tmp = paramList->ParameterValues; paramList->ParameterValues = ALIGN_MALLOC(paramList->Size * 4 * sizeof(GLfloat), 16); if (tmp) { - _mesa_memcpy(paramList->ParameterValues, tmp, + _mesa_memcpy(paramList->ParameterValues, tmp, n * 4 * sizeof(GLfloat)); ALIGN_FREE(tmp); } @@ -416,7 +416,7 @@ add_parameter(struct program_parameter_list *paramList, else { paramList->NumParameters = n + 1; - _mesa_memset(¶mList->Parameters[n], 0, + _mesa_memset(¶mList->Parameters[n], 0, sizeof(struct program_parameter)); paramList->Parameters[n].Name = name ? _mesa_strdup(name) : NULL; @@ -485,7 +485,7 @@ _mesa_add_state_reference(struct program_parameter_list *paramList, GLint a, idx; idx = add_parameter(paramList, NULL, NULL, STATE); - + for (a=0; a<6; a++) paramList->Parameters[idx].StateIndexes[a] = (enum state_index) stateTokens[a]; @@ -648,9 +648,9 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], case STATE_HALF: { GLfloat eye_z[] = {0, 0, 1}; - + /* Compute infinite half angle vector: - * half-vector = light_position + (0, 0, 1) + * half-vector = light_position + (0, 0, 1) * and then normalize. w = 0 * * light.EyePosition.w should be 0 for infinite lights. @@ -658,7 +658,7 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], ADD_3V(value, eye_z, ctx->Light.Light[ln].EyePosition); NORMALIZE_3FV(value); value[3] = 0; - } + } return; case STATE_POSITION_NORMALIZED: COPY_4V(value, ctx->Light.Light[ln].EyePosition); @@ -766,11 +766,11 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], } } case STATE_TEXENV_COLOR: - { + { /* state[1] is the texture unit */ const GLuint unit = (GLuint) state[1]; COPY_4V(value, ctx->Texture.Unit[unit].EnvColor); - } + } return; case STATE_FOG_COLOR: COPY_4V(value, ctx->Fog.Color); @@ -887,7 +887,7 @@ _mesa_fetch_state(GLcontext *ctx, const enum state_index state[], } } return; - + case STATE_VERTEX_PROGRAM: { /* state[1] = {STATE_ENV, STATE_LOCAL} */ @@ -944,7 +944,7 @@ _mesa_load_state_parameters(GLcontext *ctx, for (i = 0; i < paramList->NumParameters; i++) { if (paramList->Parameters[i].Type == STATE) { - _mesa_fetch_state(ctx, + _mesa_fetch_state(ctx, paramList->Parameters[i].StateIndexes, paramList->ParameterValues[i]); } @@ -1072,7 +1072,7 @@ _mesa_BindProgram(GLenum target, GLuint id) * \note Not compiled into display lists. * \note Called by both glDeleteProgramsNV and glDeleteProgramsARB. */ -void GLAPIENTRY +void GLAPIENTRY _mesa_DeletePrograms(GLsizei n, const GLuint *ids) { GLint i; diff --git a/reactos/dll/3rdparty/mesa32/src/shader/program.h b/reactos/dll/3rdparty/mesa32/src/shader/program.h index 87590ceea9a..6797061da27 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/program.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/program.h @@ -96,13 +96,13 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, GLint *line, GLint *col); -extern struct program * -_mesa_init_vertex_program(GLcontext *ctx, - struct vertex_program *prog, +extern struct program * +_mesa_init_vertex_program(GLcontext *ctx, + struct vertex_program *prog, GLenum target, GLuint id); -extern struct program * -_mesa_init_fragment_program(GLcontext *ctx, +extern struct program * +_mesa_init_fragment_program(GLcontext *ctx, struct fragment_program *prog, GLenum target, GLuint id); @@ -158,7 +158,7 @@ enum state_index { STATE_SPECULAR, STATE_EMISSION, STATE_SHININESS, - STATE_HALF, + STATE_HALF, STATE_POSITION, STATE_ATTENUATION, @@ -174,7 +174,7 @@ enum state_index { STATE_TEXGEN_OBJECT_Q, STATE_TEXENV_COLOR, - + STATE_DEPTH_RANGE, STATE_VERTEX_PROGRAM, @@ -191,7 +191,7 @@ enum state_index { /* - * Named program parameters + * Named program parameters * Used for NV_fragment_program "DEFINE"d constants and "DECLARE"d parameters, * and ARB_fragment_program global state references. For the later, Name * might be "state.light[0].diffuse", for example. diff --git a/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.c b/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.c index ac8ff1af487..f9ea2e11551 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.c @@ -676,7 +676,7 @@ _mesa_get_object_parameter (GLhandleARB obj, GLenum pname, GLvoid *params, GLboo /* set default values */ *integral = GL_TRUE; /* indicates param type, TRUE: GLint, FALSE: GLfloat */ - *size = 1; /* param array size */ + *size = 1; /* param array size */ switch (pname) { diff --git a/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.h b/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.h index 7f0f0706a01..c2a7a15091e 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects.h @@ -1,168 +1,168 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 2004-2005 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef SHADEROBJECTS_H -#define SHADEROBJECTS_H - -#include "mtypes.h" - -#if FEATURE_ARB_shader_objects - -extern void GLAPIENTRY -_mesa_DeleteObjectARB(GLhandleARB obj); - -extern GLhandleARB GLAPIENTRY -_mesa_GetHandleARB(GLenum pname); - -extern void GLAPIENTRY -_mesa_DetachObjectARB (GLhandleARB, GLhandleARB); - -extern GLhandleARB GLAPIENTRY -_mesa_CreateShaderObjectARB (GLenum); - -extern void GLAPIENTRY -_mesa_ShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); - -extern void GLAPIENTRY -_mesa_CompileShaderARB (GLhandleARB); - -extern GLhandleARB GLAPIENTRY -_mesa_CreateProgramObjectARB (void); - -extern void GLAPIENTRY -_mesa_AttachObjectARB (GLhandleARB, GLhandleARB); - -extern void GLAPIENTRY -_mesa_LinkProgramARB (GLhandleARB); - -extern void GLAPIENTRY -_mesa_UseProgramObjectARB (GLhandleARB); - -extern void GLAPIENTRY -_mesa_ValidateProgramARB (GLhandleARB); - -extern void GLAPIENTRY -_mesa_Uniform1fARB (GLint, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform2fARB (GLint, GLfloat, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform3fARB (GLint, GLfloat, GLfloat, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); - -extern void GLAPIENTRY -_mesa_Uniform1iARB (GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform2iARB (GLint, GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform3iARB (GLint, GLint, GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform4iARB (GLint, GLint, GLint, GLint, GLint); - -extern void GLAPIENTRY -_mesa_Uniform1fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform2fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform3fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform4fvARB (GLint, GLsizei, const GLfloat *); - -extern void GLAPIENTRY -_mesa_Uniform1ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_Uniform2ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_Uniform3ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_Uniform4ivARB (GLint, GLsizei, const GLint *); - -extern void GLAPIENTRY -_mesa_UniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); - -extern void GLAPIENTRY -_mesa_UniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); - -extern void GLAPIENTRY -_mesa_UniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); - -extern void GLAPIENTRY -_mesa_GetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); - -extern void GLAPIENTRY -_mesa_GetObjectParameterivARB (GLhandleARB, GLenum, GLint *); - -extern void GLAPIENTRY -_mesa_GetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); - -extern GLint GLAPIENTRY -_mesa_GetUniformLocationARB (GLhandleARB, const GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetUniformfvARB (GLhandleARB, GLint, GLfloat *); - -extern void GLAPIENTRY -_mesa_GetUniformivARB (GLhandleARB, GLint, GLint *); - -extern void GLAPIENTRY -_mesa_GetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); - -#if FEATURE_ARB_vertex_shader - -extern void GLAPIENTRY -_mesa_BindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); - -extern void GLAPIENTRY -_mesa_GetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); - -extern GLint GLAPIENTRY +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 2004-2005 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef SHADEROBJECTS_H +#define SHADEROBJECTS_H + +#include "mtypes.h" + +#if FEATURE_ARB_shader_objects + +extern void GLAPIENTRY +_mesa_DeleteObjectARB(GLhandleARB obj); + +extern GLhandleARB GLAPIENTRY +_mesa_GetHandleARB(GLenum pname); + +extern void GLAPIENTRY +_mesa_DetachObjectARB (GLhandleARB, GLhandleARB); + +extern GLhandleARB GLAPIENTRY +_mesa_CreateShaderObjectARB (GLenum); + +extern void GLAPIENTRY +_mesa_ShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); + +extern void GLAPIENTRY +_mesa_CompileShaderARB (GLhandleARB); + +extern GLhandleARB GLAPIENTRY +_mesa_CreateProgramObjectARB (void); + +extern void GLAPIENTRY +_mesa_AttachObjectARB (GLhandleARB, GLhandleARB); + +extern void GLAPIENTRY +_mesa_LinkProgramARB (GLhandleARB); + +extern void GLAPIENTRY +_mesa_UseProgramObjectARB (GLhandleARB); + +extern void GLAPIENTRY +_mesa_ValidateProgramARB (GLhandleARB); + +extern void GLAPIENTRY +_mesa_Uniform1fARB (GLint, GLfloat); + +extern void GLAPIENTRY +_mesa_Uniform2fARB (GLint, GLfloat, GLfloat); + +extern void GLAPIENTRY +_mesa_Uniform3fARB (GLint, GLfloat, GLfloat, GLfloat); + +extern void GLAPIENTRY +_mesa_Uniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); + +extern void GLAPIENTRY +_mesa_Uniform1iARB (GLint, GLint); + +extern void GLAPIENTRY +_mesa_Uniform2iARB (GLint, GLint, GLint); + +extern void GLAPIENTRY +_mesa_Uniform3iARB (GLint, GLint, GLint, GLint); + +extern void GLAPIENTRY +_mesa_Uniform4iARB (GLint, GLint, GLint, GLint, GLint); + +extern void GLAPIENTRY +_mesa_Uniform1fvARB (GLint, GLsizei, const GLfloat *); + +extern void GLAPIENTRY +_mesa_Uniform2fvARB (GLint, GLsizei, const GLfloat *); + +extern void GLAPIENTRY +_mesa_Uniform3fvARB (GLint, GLsizei, const GLfloat *); + +extern void GLAPIENTRY +_mesa_Uniform4fvARB (GLint, GLsizei, const GLfloat *); + +extern void GLAPIENTRY +_mesa_Uniform1ivARB (GLint, GLsizei, const GLint *); + +extern void GLAPIENTRY +_mesa_Uniform2ivARB (GLint, GLsizei, const GLint *); + +extern void GLAPIENTRY +_mesa_Uniform3ivARB (GLint, GLsizei, const GLint *); + +extern void GLAPIENTRY +_mesa_Uniform4ivARB (GLint, GLsizei, const GLint *); + +extern void GLAPIENTRY +_mesa_UniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); + +extern void GLAPIENTRY +_mesa_UniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); + +extern void GLAPIENTRY +_mesa_UniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); + +extern void GLAPIENTRY +_mesa_GetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); + +extern void GLAPIENTRY +_mesa_GetObjectParameterivARB (GLhandleARB, GLenum, GLint *); + +extern void GLAPIENTRY +_mesa_GetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); + +extern void GLAPIENTRY +_mesa_GetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); + +extern GLint GLAPIENTRY +_mesa_GetUniformLocationARB (GLhandleARB, const GLcharARB *); + +extern void GLAPIENTRY +_mesa_GetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); + +extern void GLAPIENTRY +_mesa_GetUniformfvARB (GLhandleARB, GLint, GLfloat *); + +extern void GLAPIENTRY +_mesa_GetUniformivARB (GLhandleARB, GLint, GLint *); + +extern void GLAPIENTRY +_mesa_GetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); + +#if FEATURE_ARB_vertex_shader + +extern void GLAPIENTRY +_mesa_BindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); + +extern void GLAPIENTRY +_mesa_GetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); + +extern GLint GLAPIENTRY _mesa_GetAttribLocationARB (GLhandleARB, const GLcharARB *); -#endif - -extern void -_mesa_init_shaderobjects (GLcontext *ctx); - -#endif - -#endif +#endif + +extern void +_mesa_init_shaderobjects (GLcontext *ctx); + +#endif + +#endif diff --git a/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects_3dlabs.c b/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects_3dlabs.c index 112ff050607..6bc98f07750 100755 --- a/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects_3dlabs.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/shaderobjects_3dlabs.c @@ -1029,7 +1029,7 @@ _mesa_3dlabs_create_shader_object (GLenum shaderType) GLhandleARB _mesa_3dlabs_create_program_object (void) { - struct gl2_program_impl *x = (struct gl2_program_impl *) + struct gl2_program_impl *x = (struct gl2_program_impl *) _mesa_malloc (sizeof (struct gl2_program_impl)); if (x != NULL) diff --git a/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_compile.h b/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_compile.h index d78c66f00b3..9f2d99580db 100644 --- a/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_compile.h +++ b/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_compile.h @@ -237,7 +237,7 @@ typedef enum slang_unit_type_ slang_unit_fragment_builtin, slang_unit_vertex_builtin } slang_unit_type; - + typedef struct slang_translation_unit_ { slang_variable_scope globals; diff --git a/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_execute.c b/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_execute.c index 3e142af2873..34752eb19fb 100755 --- a/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_execute.c +++ b/reactos/dll/3rdparty/mesa32/src/shader/slang/slang_execute.c @@ -37,7 +37,7 @@ static void dump_instruction (FILE *f, slang_assembly *a, unsigned int i) { fprintf (f, "%.5u:\t", i); - + switch (a->type) { case slang_asm_none: diff --git a/reactos/dll/3rdparty/mesa32/src/sparc/sparc.c b/reactos/dll/3rdparty/mesa32/src/sparc/sparc.c index b7fe360d2c6..62aea28e6fc 100644 --- a/reactos/dll/3rdparty/mesa32/src/sparc/sparc.c +++ b/reactos/dll/3rdparty/mesa32/src/sparc/sparc.c @@ -1,19 +1,19 @@ /* * Mesa 3-D graphics library * Version: 6.3 - * + * * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/src/sparc/sparc.h b/reactos/dll/3rdparty/mesa32/src/sparc/sparc.h index 55ab12122d8..2dbd125e655 100644 --- a/reactos/dll/3rdparty/mesa32/src/sparc/sparc.h +++ b/reactos/dll/3rdparty/mesa32/src/sparc/sparc.h @@ -3,19 +3,19 @@ /* * Mesa 3-D graphics library * Version: 3.1 - * + * * Copyright (C) 1999 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_aaline.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_aaline.c index 39c51a50f71..d2ecc3d3b68 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_aaline.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_aaline.c @@ -347,7 +347,7 @@ compute_coveragei(const struct LineInfo *info, typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line, int ix, int iy); - + /* @@ -533,7 +533,7 @@ _swrast_choose_aa_line_function(GLcontext *ctx) if (ctx->Texture._EnabledCoordUnits != 0) { if (ctx->Texture._EnabledCoordUnits > 1) { /* Multitextured! */ - if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || + if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || ctx->Fog.ColorSumEnabled) swrast->Line = aa_multitex_spec_line; else diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_aatritemp.h b/reactos/dll/3rdparty/mesa32/src/swrast/s_aatritemp.h index 16e26d3f8a5..bde9465a6db 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_aatritemp.h +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_aatritemp.h @@ -50,9 +50,9 @@ GLfloat yMin, yMax; GLboolean ltor; GLfloat majDx, majDy; /* major (i.e. long) edge dx and dy */ - + struct sw_span span; - + #ifdef DO_Z GLfloat zPlane[4]; #endif @@ -82,8 +82,8 @@ GLfloat texHeight[MAX_TEXTURE_COORD_UNITS]; #endif GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign; - - + + INIT_SPAN(span, GL_POLYGON, 0, 0, SPAN_COVERAGE); /* determine bottom to top order of vertices */ @@ -339,10 +339,10 @@ count++; coverage = compute_coveragef(pMin, pMid, pMax, ix, iy); } - + if (ix <= startX) continue; - + span.x = startX; span.y = iy; span.end = (GLuint) ix - (GLuint) startX; @@ -367,7 +367,7 @@ GLint ix, left, startX = (GLint) (x + xAdj); GLuint count, n; GLfloat coverage = 0.0F; - + /* make sure we're not past the window edge */ if (startX >= ctx->DrawBuffer->_Xmax) { startX = ctx->DrawBuffer->_Xmax - 1; @@ -380,7 +380,7 @@ break; startX--; } - + /* enter interior of triangle */ ix = startX; count = 0; @@ -445,7 +445,7 @@ count++; coverage = compute_coveragef(pMin, pMax, pMid, ix, iy); } - + if (startX <= ix) continue; diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_blend.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_blend.c index d94ff3923cf..c917e69050d 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_blend.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_blend.c @@ -147,7 +147,7 @@ blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], const GLint r = DIV255((rgba[i][RCOMP] - dest[i][RCOMP]) * t) + dest[i][RCOMP]; const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP]; const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP]; - const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; + const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; #undef DIV255 #elif CHAN_BITS == 16 diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_buffers.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_buffers.c index 7af9d9d5134..27959f254c8 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_buffers.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_buffers.c @@ -119,7 +119,7 @@ clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) ASSERT(ctx->Color.ColorMask[0] && ctx->Color.ColorMask[1] && ctx->Color.ColorMask[2] && - ctx->Color.ColorMask[3]); + ctx->Color.ColorMask[3]); ASSERT(rb->PutMonoRow); @@ -212,9 +212,9 @@ clear_color_buffers(GLcontext *ctx) GLuint i; if (ctx->Visual.rgbMode) { - if (ctx->Color.ColorMask[0] && - ctx->Color.ColorMask[1] && - ctx->Color.ColorMask[2] && + if (ctx->Color.ColorMask[0] && + ctx->Color.ColorMask[1] && + ctx->Color.ColorMask[2] && ctx->Color.ColorMask[3]) { masking = GL_FALSE; } diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_context.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_context.c index 5c57b42d6cb..d2c3cc7bf2f 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_context.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_context.c @@ -699,7 +699,7 @@ _swrast_render_start( GLcontext *ctx ) swrast->Driver.SpanRenderStart( ctx ); swrast->PointSpan.end = 0; } - + void _swrast_render_finish( GLcontext *ctx ) { diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_context.h b/reactos/dll/3rdparty/mesa32/src/swrast/s_context.h index 5f5efdc22ae..2d8c6d9ffe4 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_context.h +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_context.h @@ -72,7 +72,7 @@ /** - * \struct span_arrays + * \struct span_arrays * \brief Arrays of fragment values. * * These will either be computed from the x/xStep values above or @@ -396,14 +396,14 @@ _swrast_validate_derived( GLcontext *ctx ); -extern void +extern void _swrast_translate_program( GLcontext *ctx ); -extern GLboolean +extern GLboolean _swrast_execute_codegen_program(GLcontext *ctx, - const struct fragment_program *program, + const struct fragment_program *program, GLuint maxInst, - struct fp_machine *machine, + struct fp_machine *machine, const struct sw_span *span, GLuint column ); diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_copypix.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_copypix.c index 05dc1d911ce..b71334ff461 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_copypix.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_copypix.c @@ -247,7 +247,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.x = destx; span.y = dy; span.end = width; - _swrast_write_zoomed_rgba_span(ctx, &span, + _swrast_write_zoomed_rgba_span(ctx, &span, (CONST GLchan (*)[4])span.array->rgba, desty, 0); } @@ -645,7 +645,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, span.end = width; if (ctx->Visual.rgbMode) { if (zoom) - _swrast_write_zoomed_rgba_span( ctx, &span, + _swrast_write_zoomed_rgba_span( ctx, &span, (const GLchan (*)[4])span.array->rgba, desty, 0 ); else _swrast_write_rgba_span(ctx, &span); @@ -773,7 +773,7 @@ _swrast_CopyPixels( GLcontext *ctx, { SWcontext *swrast = SWRAST_CONTEXT(ctx); RENDER_START(swrast,ctx); - + if (swrast->NewState) _swrast_validate_derived( ctx ); diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_depth.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_depth.c index b9d7d894938..6a95b6992c3 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_depth.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_depth.c @@ -516,7 +516,7 @@ depth_test_span( GLcontext *ctx, struct sw_span *span) ASSERT((span->arrayMask & SPAN_XY) == 0); ASSERT(span->arrayMask & SPAN_Z); - + if (rb->GetPointer(ctx, rb, 0, 0)) { /* Directly access buffer */ if (ctx->DrawBuffer->Visual.depthBits <= 16) { diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_drawpix.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_drawpix.c index 6204d351753..051031b8cf8 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_drawpix.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_drawpix.c @@ -60,7 +60,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, if (!ctx->Current.RasterPosValid) { return GL_TRUE; /* no-op */ } - + if (swrast->_RasterMask & MULTI_DRAW_BIT) return GL_FALSE; @@ -227,7 +227,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, span.x = destX; span.y = destY; span.end = drawWidth; - _swrast_write_zoomed_rgb_span(ctx, &span, + _swrast_write_zoomed_rgb_span(ctx, &span, (CONST GLchan (*)[3]) src, zoomY0, 0); src += rowLength * 3; destY++; @@ -491,7 +491,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y, span.x = spanX; span.y = spanY; span.end = spanEnd; - + if (zoom) _swrast_write_zoomed_index_span(ctx, &span, y, skipPixels); else diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_fog.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_fog.c index 0af9cd8f284..7de2882a9d9 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_fog.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_fog.c @@ -61,7 +61,7 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z) return f; default: _mesa_problem(ctx, "Bad fog mode in _swrast_z_to_fogfactor"); - return 0.0; + return 0.0; } } diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_fragprog_to_c.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_fragprog_to_c.c index 1953e8c73cc..294d1c1f71b 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_fragprog_to_c.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_fragprog_to_c.c @@ -69,9 +69,9 @@ #define UREG_CHANNEL_W_NEGATE_SHIFT 11 #define UREG_CHANNEL_W_SHIFT 8 #define UREG_CHANNEL_ZERO_NEGATE_MBZ 5 -#define UREG_CHANNEL_ZERO_SHIFT 4 +#define UREG_CHANNEL_ZERO_SHIFT 4 #define UREG_CHANNEL_ONE_NEGATE_MBZ 1 -#define UREG_CHANNEL_ONE_SHIFT 0 +#define UREG_CHANNEL_ONE_SHIFT 0 #define UREG_BAD 0xffffffff /* not a valid ureg */ @@ -110,12 +110,12 @@ static INLINE int is_swizzled( int reg ) { - return ((reg & UREG_XYZW_CHANNEL_MASK) != + return ((reg & UREG_XYZW_CHANNEL_MASK) != (UREG(0,0) & UREG_XYZW_CHANNEL_MASK)); } -/* One neat thing about the UREG representation: +/* One neat thing about the UREG representation: */ static INLINE int swizzle( int reg, int x, int y, int z, int w ) { @@ -126,7 +126,7 @@ static INLINE int swizzle( int reg, int x, int y, int z, int w ) CHANNEL_SRC( GET_CHANNEL_SRC( reg, w ), 3 )); } -/* Another neat thing about the UREG representation: +/* Another neat thing about the UREG representation: */ static INLINE int negate( int reg, int x, int y, int z, int w ) { @@ -147,7 +147,7 @@ static GLuint src_reg_file( GLuint file ) case PROGRAM_ENV_PARAM: return UREG_TYPE_ENV_CONST; case PROGRAM_STATE_VAR: return UREG_TYPE_STATE_CONST; - case PROGRAM_NAMED_PARAM: return UREG_TYPE_PARAM; + case PROGRAM_NAMED_PARAM: return UREG_TYPE_PARAM; default: return UREG_BAD; } } @@ -157,13 +157,13 @@ static void emit( struct fragment_program *p, ... ) { va_list ap; - va_start( ap, fmt ); + va_start( ap, fmt ); if (p->c_strlen < sizeof(p->c_str)) - p->c_strlen += vsnprintf( p->c_str + p->c_strlen, + p->c_strlen += vsnprintf( p->c_str + p->c_strlen, sizeof(p->c_str) - p->c_strlen, fmt, ap ); - + va_end( ap ); } @@ -188,7 +188,7 @@ static GLuint src_vector( const struct fp_src_register *source ) src = UREG( src_reg_file( source->File ), source->Index ); - src = swizzle(src, + src = swizzle(src, _X + source->Swizzle[0], _X + source->Swizzle[1], _X + source->Swizzle[2], @@ -207,7 +207,7 @@ static void print_header( struct fragment_program *p ) /* Mesa's program_parameter struct: */ - emit(p, + emit(p, "struct program_parameter\n" "{\n" " const char *Name;\n" @@ -262,7 +262,7 @@ static void print_footer( struct fragment_program *p ) emit(p, "}\n"); } -static void print_dest_reg( struct fragment_program *p, +static void print_dest_reg( struct fragment_program *p, const struct fp_instruction *inst ) { switch (inst->DstReg.File) { @@ -299,7 +299,7 @@ static void print_reg( struct fragment_program *p, case UREG_TYPE_STATE_CONST: emit(p, "state_param"); break; case UREG_TYPE_PARAM: emit(p, "local_param"); break; }; - + emit(p, "[%d]", GET_UREG_NR(arg)); if (GET_UREG_TYPE(arg) == UREG_TYPE_STATE_CONST) { @@ -339,7 +339,7 @@ static void print_arg( struct fragment_program *p, case _Y: emit(p, "[1]"); break; case _Z: emit(p, "[2]"); break; case _W: emit(p, "[3]"); break; - } + } } @@ -360,8 +360,8 @@ static void print_expression( struct fragment_program *p, print_arg( p, deref(reg, i) ); fmt += 2; } - else { - emit_char(p, *fmt); + else { + emit_char(p, *fmt); fmt++; } } @@ -408,8 +408,8 @@ static void do_tex( struct fragment_program *p, GLuint i; GLboolean need_tex = GL_FALSE, need_result = GL_FALSE; - for (i = 0; i < 4; i++) - if (!inst->DstReg.WriteMask[i]) + for (i = 0; i < 4; i++) + if (!inst->DstReg.WriteMask[i]) need_result = GL_TRUE; if (is_swizzled(arg)) @@ -454,7 +454,7 @@ static void saturate( struct fragment_program *p, print_dest(p, inst, i); emit(p, ");\n"); } - + static void assign_single( GLuint i, struct fragment_program *p, const struct fp_instruction *inst, @@ -462,7 +462,7 @@ static void assign_single( GLuint i, ... ) { va_list ap; - va_start( ap, fmt ); + va_start( ap, fmt ); if (inst->DstReg.WriteMask[i]) { emit(p, " "); @@ -483,7 +483,7 @@ static void assign4( struct fragment_program *p, { GLuint i; va_list ap; - va_start( ap, fmt ); + va_start( ap, fmt ); for (i = 0; i < 4; i++) if (inst->DstReg.WriteMask[i]) { @@ -516,7 +516,7 @@ static void assign4_replicate( struct fragment_program *p, if (!ok) return; - va_start( ap, fmt ); + va_start( ap, fmt ); emit(p, " "); @@ -536,7 +536,7 @@ static void assign4_replicate( struct fragment_program *p, emit(p, ";\n"); } } - + @@ -590,8 +590,8 @@ static void translate_program( struct fragment_program *p ) GLuint src[3], i; GLuint nr = nr_args( inst->Opcode ); - - for (i = 0; i < nr; i++) + + for (i = 0; i < nr; i++) src[i] = src_vector( &inst->SrcReg[i] ); /* Print the original program instruction string */ @@ -607,15 +607,15 @@ static void translate_program( struct fragment_program *p ) } switch (inst->Opcode) { - case FP_OPCODE_ABS: + case FP_OPCODE_ABS: assign4(p, inst, "fabsf(%s)", src[0]); break; - case FP_OPCODE_ADD: + case FP_OPCODE_ADD: assign4(p, inst, "%s + %s", src[0], src[1]); break; - case FP_OPCODE_CMP: + case FP_OPCODE_CMP: assign4(p, inst, "%s < 0.0F ? %s : %s", src[0], src[1], src[2]); break; @@ -623,9 +623,9 @@ static void translate_program( struct fragment_program *p ) assign4_replicate(p, inst, "COS(%s)", src[0]); break; - case FP_OPCODE_DP3: - assign4_replicate(p, inst, - "%s*%s + %s*%s + %s*%s", + case FP_OPCODE_DP3: + assign4_replicate(p, inst, + "%s*%s + %s*%s + %s*%s", deref(src[0],_X), deref(src[1],_X), deref(src[0],_Y), @@ -634,9 +634,9 @@ static void translate_program( struct fragment_program *p ) deref(src[1],_Z)); break; - case FP_OPCODE_DP4: - assign4_replicate(p, inst, - "%s*%s + %s*%s + %s*%s + %s*%s", + case FP_OPCODE_DP4: + assign4_replicate(p, inst, + "%s*%s + %s*%s + %s*%s + %s*%s", deref(src[0],_X), deref(src[1],_X), deref(src[0],_Y), @@ -645,9 +645,9 @@ static void translate_program( struct fragment_program *p ) deref(src[1],_Z)); break; - case FP_OPCODE_DPH: - assign4_replicate(p, inst, - "%s*%s + %s*%s + %s*%s + %s", + case FP_OPCODE_DPH: + assign4_replicate(p, inst, + "%s*%s + %s*%s + %s*%s + %s", deref(src[0],_X), deref(src[1],_X), deref(src[0],_Y), @@ -655,7 +655,7 @@ static void translate_program( struct fragment_program *p ) deref(src[1],_Z)); break; - case FP_OPCODE_DST: + case FP_OPCODE_DST: /* result[0] = 1 * 1; * result[1] = a[1] * b[1]; * result[2] = a[2] * 1; @@ -663,22 +663,22 @@ static void translate_program( struct fragment_program *p ) */ assign_single(0, p, inst, "1.0"); - assign_single(1, p, inst, "%s * %s", + assign_single(1, p, inst, "%s * %s", deref(src[0], _Y), deref(src[1], _Y)); assign_single(2, p, inst, "%s", deref(src[0], _Z)); assign_single(3, p, inst, "%s", deref(src[1], _W)); break; - case FP_OPCODE_EX2: + case FP_OPCODE_EX2: assign4_replicate(p, inst, "powf(2.0, %s)", src[0]); break; - case FP_OPCODE_FLR: + case FP_OPCODE_FLR: assign4_replicate(p, inst, "floorf(%s)", src[0]); break; - case FP_OPCODE_FRC: + case FP_OPCODE_FRC: assign4_replicate(p, inst, "%s - floorf(%s)", src[0], src[0]); break; @@ -686,11 +686,11 @@ static void translate_program( struct fragment_program *p ) do_tex_kill(p, inst, src[0]); break; - case FP_OPCODE_LG2: + case FP_OPCODE_LG2: assign4_replicate(p, inst, "LOG2(%s)", src[0]); break; - case FP_OPCODE_LIT: + case FP_OPCODE_LIT: assign_single(0, p, inst, "1.0"); assign_single(1, p, inst, "MIN2(%s, 0)", deref(src[0], _X)); assign_single(2, p, inst, "(%s > 0.0) ? expf(%s * MIN2(%s, 0)) : 0.0", @@ -700,9 +700,9 @@ static void translate_program( struct fragment_program *p ) assign_single(3, p, inst, "1.0"); break; - case FP_OPCODE_LRP: - assign4(p, inst, - "%s * %s + (1.0 - %s) * %s", + case FP_OPCODE_LRP: + assign4(p, inst, + "%s * %s + (1.0 - %s) * %s", src[0], src[1], src[0], src[2]); break; @@ -714,30 +714,30 @@ static void translate_program( struct fragment_program *p ) assign4(p, inst, "MAX2(%s, %s)", src[0], src[1]); break; - case FP_OPCODE_MIN: + case FP_OPCODE_MIN: assign4(p, inst, "MIN2(%s, %s)", src[0], src[1]); break; - case FP_OPCODE_MOV: + case FP_OPCODE_MOV: assign4(p, inst, "%s", src[0]); break; - case FP_OPCODE_MUL: + case FP_OPCODE_MUL: assign4(p, inst, "%s * %s", src[0], src[1]); break; - case FP_OPCODE_POW: + case FP_OPCODE_POW: assign4_replicate(p, inst, "powf(%s, %s)", src[0], src[1]); break; - case FP_OPCODE_RCP: + case FP_OPCODE_RCP: assign4_replicate(p, inst, "1.0/%s", src[0]); break; - case FP_OPCODE_RSQ: + case FP_OPCODE_RSQ: assign4_replicate(p, inst, "_mesa_inv_sqrtf(%s)", src[0]); break; - + case FP_OPCODE_SCS: if (inst->DstReg.WriteMask[0]) { assign_single(0, p, inst, "cosf(%s)", deref(src[0], _X)); @@ -748,7 +748,7 @@ static void translate_program( struct fragment_program *p ) } break; - case FP_OPCODE_SGE: + case FP_OPCODE_SGE: assign4(p, inst, "%s >= %s ? 1.0 : 0.0", src[0], src[1]); break; @@ -756,11 +756,11 @@ static void translate_program( struct fragment_program *p ) assign4_replicate(p, inst, "sinf(%s)", src[0]); break; - case FP_OPCODE_SLT: + case FP_OPCODE_SLT: assign4(p, inst, "%s < %s ? 1.0 : 0.0", src[0], src[1]); break; - case FP_OPCODE_SUB: + case FP_OPCODE_SUB: assign4(p, inst, "%s - %s", src[0], src[1]); break; @@ -768,7 +768,7 @@ static void translate_program( struct fragment_program *p ) assign4(p, inst, "%s", src[0]); break; - case FP_OPCODE_TEX: + case FP_OPCODE_TEX: do_tex(p, inst, "TEX", inst->TexSrcUnit, src[0]); break; @@ -787,7 +787,7 @@ static void translate_program( struct fragment_program *p ) * result.z = src[0].x * src[1].y - src[0].y * src[1].x; * result.w = undef; */ - assign4(p, inst, + assign4(p, inst, "%s * %s - %s * %s", swizzle(src[0], _Y, _Z, _X, _ONE), swizzle(src[1], _Z, _X, _Y, _ONE), diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_imaging.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_imaging.c index 5c79a7ba95e..f4905519347 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_imaging.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_imaging.c @@ -24,7 +24,7 @@ /* KW: Moved these here to remove knowledge of swrast from core mesa. * Should probably pull the entire software implementation of these - * extensions into either swrast or a sister module. + * extensions into either swrast or a sister module. */ #include "s_context.h" @@ -34,7 +34,7 @@ void -_swrast_CopyColorTable( GLcontext *ctx, +_swrast_CopyColorTable( GLcontext *ctx, GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { @@ -107,8 +107,8 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, +_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, GLsizei width) { SWcontext *swrast = SWRAST_CONTEXT(ctx); @@ -128,7 +128,7 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, /* read the data from framebuffer */ _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, width, x, y, (GLchan (*)[4]) rgba ); - + RENDER_FINISH( swrast, ctx ); /* Restore reading from draw buffer (the default) */ @@ -148,8 +148,8 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, +_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { SWcontext *swrast = SWRAST_CONTEXT(ctx); @@ -167,7 +167,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, _swrast_use_read_buffer(ctx); RENDER_START(swrast,ctx); - + /* read pixels from framebuffer */ for (i = 0; i < height; i++) { _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, @@ -209,5 +209,5 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, ctx->Unpack.BufferObj = bufferSave; ctx->Unpack = packSave; /* restore pixel packing params */ - ctx->NewState |= _NEW_PACKUNPACK; + ctx->NewState |= _NEW_PACKUNPACK; } diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_linetemp.h b/reactos/dll/3rdparty/mesa32/src/swrast/s_linetemp.h index af7aeabf629..b86ed6fa819 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_linetemp.h +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_linetemp.h @@ -113,10 +113,10 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) vert0->win[0], vert0->win[1], vert0->win[2], vert1->win[0], vert1->win[1], vert1->win[2]); printf(" (%d, %d, %d) -> (%d, %d, %d)\n", - vert0->color[0], vert0->color[1], vert0->color[2], + vert0->color[0], vert0->color[1], vert0->color[2], vert1->color[0], vert1->color[1], vert1->color[2]); printf(" (%d, %d, %d) -> (%d, %d, %d)\n", - vert0->specular[0], vert0->specular[1], vert0->specular[2], + vert0->specular[0], vert0->specular[1], vert0->specular[2], vert1->specular[0], vert1->specular[1], vert1->specular[2]); */ diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_nvfragprog.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_nvfragprog.c index 33266cae821..7a829b1184c 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_nvfragprog.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_nvfragprog.c @@ -705,7 +705,7 @@ execute_program( GLcontext *ctx, GLfloat a[4], b[4], result[4]; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - result[0] = result[1] = result[2] = result[3] = + result[0] = result[1] = result[2] = result[3] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; store_vector4( inst, machine, result ); #if DEBUG_FRAG @@ -719,7 +719,7 @@ execute_program( GLcontext *ctx, GLfloat a[4], b[4], result[4]; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - result[0] = result[1] = result[2] = result[3] = + result[0] = result[1] = result[2] = result[3] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; store_vector4( inst, machine, result ); #if DEBUG_FRAG @@ -733,7 +733,7 @@ execute_program( GLcontext *ctx, GLfloat a[4], b[4], result[4]; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - result[0] = result[1] = result[2] = result[3] = + result[0] = result[1] = result[2] = result[3] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + b[3]; store_vector4( inst, machine, result ); } @@ -866,7 +866,7 @@ execute_program( GLcontext *ctx, store_vector4( inst, machine, result ); #if DEBUG_FRAG printf("MAX (%g %g %g %g) = (%g %g %g %g), (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], + result[0], result[1], result[2], result[3], a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); #endif @@ -907,7 +907,7 @@ execute_program( GLcontext *ctx, store_vector4( inst, machine, result ); #if DEBUG_FRAG printf("MUL (%g %g %g %g) = (%g %g %g %g) * (%g %g %g %g)\n", - result[0], result[1], result[2], result[3], + result[0], result[1], result[2], result[3], a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); #endif @@ -1089,7 +1089,7 @@ execute_program( GLcontext *ctx, { GLfloat a[4], result[4]; fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); - result[0] = result[1] = result[2] = + result[0] = result[1] = result[2] = result[3] = (GLfloat)_mesa_sin(a[0]); store_vector4( inst, machine, result ); } @@ -1189,7 +1189,7 @@ execute_program( GLcontext *ctx, * implement normal GL semantics through the fragment * shader. */ - fetch_texel( ctx, texcoord, + fetch_texel( ctx, texcoord, span->array->lambda[inst->TexSrcUnit][column], inst->TexSrcUnit, color ); store_vector4( inst, machine, color ); @@ -1245,7 +1245,7 @@ execute_program( GLcontext *ctx, * still be calculated normally for TEX & TXP though, * not set to zero. */ - fetch_texel( ctx, texcoord, + fetch_texel( ctx, texcoord, span->array->lambda[inst->TexSrcUnit][column], inst->TexSrcUnit, color ); store_vector4( inst, machine, color ); @@ -1448,7 +1448,7 @@ _swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span ) if (program->Parameters) { _mesa_load_state_parameters(ctx, program->Parameters); - } + } for (i = 0; i < span->end; i++) { if (span->array->mask[i]) { diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_span.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_span.c index 68944e3ecf2..17d4c3849cb 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_span.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_span.c @@ -313,7 +313,7 @@ _swrast_span_interpolate_z( const GLcontext *ctx, struct sw_span *span ) if (ctx->Visual.depthBits <= 16) { GLfixed zval = span->z; - GLdepth *z = span->array->z; + GLdepth *z = span->array->z; for (i = 0; i < n; i++) { z[i] = FixedToInt(zval); zval += span->zStep; @@ -944,7 +944,7 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) } if (span->arrayMask & SPAN_XY) { - rb->PutMonoValues(ctx, rb, span->end, span->array->x, + rb->PutMonoValues(ctx, rb, span->end, span->array->x, span->array->y, value, span->array->mask); } else { diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_stencil.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_stencil.c index ea4d844b1ea..9ef541f4fad 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_stencil.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_stencil.c @@ -499,9 +499,9 @@ stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face) if (!rb->GetPointer(ctx, rb, 0, 0)) { rb->PutRow(ctx, rb, n, x, y, stencil, mask); } - + span->writeAll = GL_FALSE; - + return GL_TRUE; /* one or more fragments passed both tests */ } @@ -1210,7 +1210,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) GLint i; for (i = 0; i < height; i++) { rb->PutMonoRow(ctx, rb, width, x, y + i, &clear8, NULL); - } + } } } } diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_tcc.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_tcc.c index 550a2aabdb3..bae2c882884 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_tcc.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_tcc.c @@ -47,11 +47,11 @@ #include -typedef int (*cfunc)( void *ctx, - const GLfloat (*local_param)[4], - const GLfloat (*env_param)[4], - const struct program_parameter *state_param, - const GLfloat (*interp)[4], +typedef int (*cfunc)( void *ctx, + const GLfloat (*local_param)[4], + const GLfloat (*env_param)[4], + const struct program_parameter *state_param, + const GLfloat (*interp)[4], GLfloat (*outputs)[4]); @@ -115,11 +115,11 @@ static cfunc codegen( TCCState *s, const char *prog, const char *fname ) { unsigned long val; - if (s) + if (s) tcc_delete(s); - + s = tcc_new(); - if (!s) + if (!s) return 0; tcc_set_output_type(s, TCC_OUTPUT_MEMORY); @@ -151,13 +151,13 @@ _swrast_execute_codegen_program( GLcontext *ctx, GLuint column ) { if (program != current_program) { - + _swrast_translate_program( ctx ); fprintf(stderr, "%s: compiling:\n%s\n", __FUNCTION__, program->c_str); current_program = program; - current_func = codegen( current_tcc_state, program->c_str, + current_func = codegen( current_tcc_state, program->c_str, "run_program" ); } @@ -165,7 +165,7 @@ _swrast_execute_codegen_program( GLcontext *ctx, return current_func( ctx, program->Base.LocalParams, - (const GLfloat (*)[4])ctx->FragmentProgram.Parameters, + (const GLfloat (*)[4])ctx->FragmentProgram.Parameters, program->Parameters->Parameters, (const GLfloat (*)[4])machine->Inputs, machine->Outputs ); diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_texture.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_texture.c index c75d826d2c1..bf9c218ffb2 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_texture.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_texture.c @@ -982,7 +982,7 @@ sample_2d_linear_repeat(GLcontext *ctx, GLfloat u, v; (void) ctx; (void) tObj; - + ASSERT(tObj->WrapS == GL_REPEAT); ASSERT(tObj->WrapT == GL_REPEAT); ASSERT(img->Border == 0); @@ -1199,7 +1199,7 @@ sample_linear_2d( GLcontext *ctx, GLuint texUnit, * Optimized 2-D texture sampling: * S and T wrap mode == GL_REPEAT * GL_NEAREST min/mag filter - * No border, + * No border, * RowStride == Width, * Format = GL_RGB */ @@ -2845,7 +2845,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, * \param n number of fragments to process (span width) * \param primary_rgba incoming fragment color array * \param texelBuffer pointer to texel colors for all texture units - * + * * \param rgba incoming colors, which get modified here */ static INLINE void @@ -3486,7 +3486,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, #if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) - arg1[i][ACOMP]) * Amult; #else - GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) + GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - ((GLint) arg1[i][ACOMP] << CHAN_BITS)) >> shift; rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/s_triangle.c b/reactos/dll/3rdparty/mesa32/src/swrast/s_triangle.c index 16dea94778d..0628981f6c3 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/s_triangle.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast/s_triangle.c @@ -779,7 +779,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, } break; } - + ASSERT(span->arrayMask & SPAN_RGBA); _swrast_write_rgba_span(ctx, span); @@ -861,7 +861,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, #endif /* CHAN_BITS != GL_FLOAT */ - + /* diff --git a/reactos/dll/3rdparty/mesa32/src/swrast/swrast.h b/reactos/dll/3rdparty/mesa32/src/swrast/swrast.h index 90123e51324..976bf313fd4 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast/swrast.h +++ b/reactos/dll/3rdparty/mesa32/src/swrast/swrast.h @@ -37,7 +37,7 @@ /** * \struct SWvertex * \brief Data-structure to handle vertices in the software rasterizer. - * + * * The software rasterizer now uses this format for vertices. Thus a * 'RasterSetup' stage or other translation is required between the * tnl module and the swrast rasterization functions. This serves to @@ -203,22 +203,22 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ); /* * Imaging fallbacks (a better solution should be found, perhaps - * moving all the imaging fallback code to a new module) + * moving all the imaging fallback code to a new module) */ extern void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, +_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height); extern void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, +_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, GLsizei width); extern void _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); extern void -_swrast_CopyColorTable( GLcontext *ctx, +_swrast_CopyColorTable( GLcontext *ctx, GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); @@ -257,7 +257,7 @@ _swrast_copy_texsubimage3d(GLcontext *ctx, /* The driver interface for the software rasterizer. - * Unless otherwise noted, all functions are mandatory. + * Unless otherwise noted, all functions are mandatory. */ struct swrast_device_driver { #if OLD_RENDERBUFFER diff --git a/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_context.c b/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_context.c index c63646ca977..b4fa624ab89 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_context.c +++ b/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_context.c @@ -55,7 +55,7 @@ _swsetup_CreateContext( GLcontext *ctx ) swsetup->NewState = ~0; _swsetup_trifuncs_init( ctx ); - _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, + _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, sizeof(SWvertex) ); @@ -125,16 +125,16 @@ _swsetup_RenderStart( GLcontext *ctx ) int i, e = 0; EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, win ); - + if (index & _TNL_BIT_COLOR0) EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); if (index & _TNL_BIT_COLOR1) EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4CHAN_4F_RGBA, specular); - if (index & _TNL_BIT_FOG) + if (index & _TNL_BIT_FOG) EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, fog); - + if (index & _TNL_BITS_TEX_ANY) { for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { if (index & _TNL_BIT_TEX(i)) { @@ -142,17 +142,17 @@ _swsetup_RenderStart( GLcontext *ctx ) } } } - - if (index & _TNL_BIT_INDEX) + + if (index & _TNL_BIT_INDEX) EMIT_ATTR( _TNL_ATTRIB_INDEX, EMIT_1F, index ); - + if (index & _TNL_BIT_POINTSIZE) EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, pointSize ); - + _tnl_install_attrs( ctx, map, e, ctx->Viewport._WindowMap.m, - sizeof(SWvertex) ); - + sizeof(SWvertex) ); + swsetup->last_index = index; } @@ -214,7 +214,7 @@ _swsetup_Wakeup( GLcontext *ctx ) /* Populate a swrast SWvertex from an attrib-style vertex. */ -void +void _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) { const GLfloat *m = ctx->Viewport._WindowMap.m; @@ -231,7 +231,7 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0+i, dest->texcoord[i] ); - + _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, tmp ); UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); diff --git a/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_tritmp.h b/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_tritmp.h index 61c9b2817e6..4f0bf971dc3 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_tritmp.h +++ b/reactos/dll/3rdparty/mesa32/src/swrast_setup/ss_tritmp.h @@ -104,7 +104,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) saved_index[0] = v[0]->index; saved_index[1] = v[1]->index; saved_index[2] = v[2]->index; - + SS_IND(v[0]->index, (GLuint) vbindex[e0]); SS_IND(v[1]->index, (GLuint) vbindex[e1]); SS_IND(v[2]->index, (GLuint) vbindex[e2]); diff --git a/reactos/dll/3rdparty/mesa32/src/swrast_setup/swrast_setup.h b/reactos/dll/3rdparty/mesa32/src/swrast_setup/swrast_setup.h index 5dcbe2675b4..ed34d442788 100644 --- a/reactos/dll/3rdparty/mesa32/src/swrast_setup/swrast_setup.h +++ b/reactos/dll/3rdparty/mesa32/src/swrast_setup/swrast_setup.h @@ -32,7 +32,7 @@ * * The internals of the implementation are private, but can be hooked * into tnl at any time (except between RenderStart/RenderEnd) by - * calling _swsetup_Wakeup(). + * calling _swsetup_Wakeup(). */ #ifndef SWRAST_SETUP_H @@ -55,7 +55,7 @@ _swsetup_Wakeup( GLcontext *ctx ); /* Helper function to translate a hardware vertex (as understood by * the tnl/t_vertex.c code) to a swrast vertex. */ -extern void +extern void _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ); #endif diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_array_api.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_array_api.c index 1ad77c5a99b..14dfc2c4813 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_array_api.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_array_api.c @@ -54,7 +54,7 @@ static void fallback_drawarrays( GLcontext *ctx, GLenum mode, GLint start, assert(ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1); CALL_Begin(GET_DISPATCH(), (mode)); - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) CALL_ArrayElement(GET_DISPATCH(), ( start + i )); CALL_End(GET_DISPATCH(), ()); } @@ -91,7 +91,7 @@ static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode, TNLcontext *tnl = TNL_CONTEXT(ctx); struct tnl_prim prim; FLUSH_CURRENT( ctx, 0 ); - + _tnl_vb_bind_arrays( ctx, 0, max_index ); tnl->vb.Primitive = &prim; @@ -116,10 +116,10 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) GET_CURRENT_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint thresh = (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) ? 30 : 10; - + if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(NULL, "_tnl_DrawArrays %d %d\n", start, count); - + _mesa_debug(NULL, "_tnl_DrawArrays %d %d\n", start, count); + /* Check arguments, etc. */ if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) @@ -132,10 +132,10 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) * using the immediate interface). */ fallback_drawarrays( ctx, mode, start, count ); - } + } else if (start >= (GLint) ctx->Array.LockFirst && start + count <= (GLint)(ctx->Array.LockFirst + ctx->Array.LockCount)) { - + struct tnl_prim prim; /* Locked primitives which can fit in a single vertex buffer: @@ -144,7 +144,7 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) /* Locked drawarrays. Reuse any previously transformed data. */ - _tnl_vb_bind_arrays( ctx, ctx->Array.LockFirst, + _tnl_vb_bind_arrays( ctx, ctx->Array.LockFirst, ctx->Array.LockFirst + ctx->Array.LockCount ); tnl->vb.Primitive = &prim; @@ -154,7 +154,7 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) tnl->vb.PrimitiveCount = 1; tnl->Driver.RunPipeline( ctx ); - } + } else { int bufsz = 256; /* Use a small buffer for cache goodness */ int j, nr; @@ -205,7 +205,7 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) default: /* Primitives requiring a copied vertex (fan-like primitives) * must use the slow path if they cannot fit in a single - * vertex buffer. + * vertex buffer. */ if (count <= (GLint) ctx->Const.MaxArrayLockSize) { bufsz = ctx->Const.MaxArrayLockSize; @@ -265,7 +265,7 @@ _tnl_DrawRangeElements(GLenum mode, GLuint *ui_indices; if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(NULL, "_tnl_DrawRangeElements %d %d %d\n", start, end, count); + _mesa_debug(NULL, "_tnl_DrawRangeElements %d %d %d\n", start, end, count); if (ctx->Array.ElementArrayBufferObj->Name) { /* use indices in the buffer object */ @@ -297,7 +297,7 @@ _tnl_DrawRangeElements(GLenum mode, * at the whole locked range. */ - if (start == 0 && ctx->Array.LockFirst == 0 && + if (start == 0 && ctx->Array.LockFirst == 0 && end < (ctx->Array.LockFirst + ctx->Array.LockCount)) _tnl_draw_range_elements( ctx, mode, ctx->Array.LockCount, @@ -332,7 +332,7 @@ _tnl_DrawElements(GLenum mode, GLsizei count, GLenum type, GLuint *ui_indices; if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(NULL, "_tnl_DrawElements %d\n", count); + _mesa_debug(NULL, "_tnl_DrawElements %d\n", count); /* Check arguments, etc. */ if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) @@ -395,7 +395,7 @@ void _tnl_array_init( GLcontext *ctx ) /* Setup vector pointers that will be used to bind arrays to VB's. */ _mesa_vector4f_init( &tmp->Obj, 0, NULL); - _mesa_vector4f_init( &tmp->Normal, 0, NULL); + _mesa_vector4f_init( &tmp->Normal, 0, NULL); _mesa_vector4f_init( &tmp->FogCoord, 0, NULL); _mesa_vector4f_init( &tmp->Index, 0, NULL); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_array_import.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_array_import.c index 7cc834ffa23..b409ba1d767 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_array_import.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_array_import.c @@ -116,7 +116,7 @@ static void _tnl_import_secondarycolor( GLcontext *ctx, struct tnl_vertex_arrays *inputs = &TNL_CONTEXT(ctx)->array_inputs; const GLubyte *data; - tmp = _ac_import_secondarycolor(ctx, + tmp = _ac_import_secondarycolor(ctx, GL_FLOAT, stride ? 4*sizeof(GLfloat) : 0, 4, @@ -245,7 +245,7 @@ static void _tnl_constant_attrib( TNLcontext *tnl, tmp->Attribs[i].count = 1; tmp->Attribs[i].data = (GLfloat (*)[4]) tnl->vtx.current[i]; tmp->Attribs[i].start = tnl->vtx.current[i]; - tmp->Attribs[i].size = 4; + tmp->Attribs[i].size = 4; tmp->Attribs[i].stride = 0; tnl->vb.AttribPtr[i] = &tmp->Attribs[i]; } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_context.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_context.c index dab0eb61b0f..1114f58e21b 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_context.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_context.c @@ -97,9 +97,9 @@ _tnl_CreateContext( GLcontext *ctx ) _tnl_array_init( ctx ); _tnl_vtx_init( ctx ); - if (ctx->_MaintainTnlProgram) + if (ctx->_MaintainTnlProgram) _tnl_install_pipeline( ctx, _tnl_vp_pipeline ); - else + else _tnl_install_pipeline( ctx, _tnl_default_pipeline ); /* Initialize the arrayelt helper @@ -181,13 +181,13 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) else { tnl->render_inputs |= (_TNL_BIT_POS|_TNL_BIT_INDEX); } - + if (ctx->Fog.Enabled || (ctx->FragmentProgram._Active && ctx->FragmentProgram._Current->FogOption != GL_NONE)) tnl->render_inputs |= _TNL_BIT_FOG; - if (ctx->Polygon.FrontMode != GL_FILL || + if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) tnl->render_inputs |= _TNL_BIT_EDGEFLAG; @@ -221,7 +221,7 @@ _tnl_wakeup_exec( GLcontext *ctx ) _tnl_InvalidateState( ctx, ~0 ); if (ctx->Light.ColorMaterialEnabled) { - _mesa_update_color_material( ctx, + _mesa_update_color_material( ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0] ); } } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_context.h b/reactos/dll/3rdparty/mesa32/src/tnl/t_context.h index cdaa252e8fc..900de20bea4 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_context.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_context.h @@ -120,9 +120,9 @@ enum { _TNL_ATTRIB_MAT_FRONT_SHININESS = 24, _TNL_ATTRIB_MAT_BACK_SHININESS = 25, _TNL_ATTRIB_MAT_FRONT_INDEXES = 26, - _TNL_ATTRIB_MAT_BACK_INDEXES = 27, - _TNL_ATTRIB_INDEX = 28, - _TNL_ATTRIB_EDGEFLAG = 29, + _TNL_ATTRIB_MAT_BACK_INDEXES = 27, + _TNL_ATTRIB_INDEX = 28, + _TNL_ATTRIB_EDGEFLAG = 29, _TNL_ATTRIB_POINTSIZE = 30, _TNL_ATTRIB_MAX = 31 } ; @@ -208,7 +208,7 @@ enum { #define PRIM_WEAK 0x40 #define PRIM_MODE_MASK 0x0f -/* +/* */ struct tnl_prim { GLuint mode; @@ -264,7 +264,7 @@ struct _tnl_dynfn_generators { struct _tnl_dynfn *(*Attribute[4])( GLcontext *ctx, int key ); }; -#define _TNL_MAX_ATTR_CODEGEN 16 +#define _TNL_MAX_ATTR_CODEGEN 16 /* The assembly of vertices in immediate mode is separated from @@ -322,7 +322,7 @@ struct tnl_vertex_list { GLuint count; GLuint wrap_count; /* number of copied vertices at start */ GLboolean have_materials; /* bit of a hack - quick check for materials */ - GLboolean dangling_attr_ref; /* current attr implicitly referenced + GLboolean dangling_attr_ref; /* current attr implicitly referenced outside the list */ GLfloat *normal_lengths; @@ -380,7 +380,7 @@ struct tnl_save { GLuint opcode_vertex_list; struct tnl_copied_vtx copied; - + GLfloat CurrentFloatEdgeFlag; GLfloat *current[_TNL_ATTRIB_MAX]; /* points into ctx->ListState */ @@ -427,7 +427,7 @@ struct vertex_buffer /* Pointers to current data. */ - GLuint *Elts; + GLuint *Elts; GLvector4f *ObjPtr; /* _TNL_BIT_POS */ GLvector4f *EyePtr; /* _TNL_BIT_POS */ GLvector4f *ClipPtr; /* _TNL_BIT_POS */ @@ -445,8 +445,8 @@ struct vertex_buffer GLvector4f *PointSizePtr; /* _TNL_BIT_POS */ GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ - struct tnl_prim *Primitive; - GLuint PrimitiveCount; + struct tnl_prim *Primitive; + GLuint PrimitiveCount; /* Inputs to the vertex program stage */ GLvector4f *AttribPtr[_TNL_ATTRIB_MAX]; /* GL_NV_vertex_program */ @@ -495,10 +495,10 @@ struct tnl_pipeline_stage /** Contains the array of all pipeline stages. - * The default values are defined at the end of t_pipeline.c + * The default values are defined at the end of t_pipeline.c */ struct tnl_pipeline { - + GLuint last_attrib_stride[_TNL_ATTRIB_MAX]; GLuint last_attrib_size[_TNL_ATTRIB_MAX]; GLuint input_changes; @@ -511,16 +511,16 @@ struct tnl_pipeline { struct tnl_clipspace; struct tnl_clipspace_attr; -typedef void (*tnl_extract_func)( const struct tnl_clipspace_attr *a, - GLfloat *out, +typedef void (*tnl_extract_func)( const struct tnl_clipspace_attr *a, + GLfloat *out, const GLubyte *v ); -typedef void (*tnl_insert_func)( const struct tnl_clipspace_attr *a, - GLubyte *v, +typedef void (*tnl_insert_func)( const struct tnl_clipspace_attr *a, + GLubyte *v, const GLfloat *in ); -typedef void (*tnl_emit_func)( GLcontext *ctx, - GLuint count, +typedef void (*tnl_emit_func)( GLcontext *ctx, + GLuint count, GLubyte *dest ); @@ -586,7 +586,7 @@ struct tnl_clipspace_fastpath { struct tnl_clipspace { GLboolean need_extras; - + GLuint new_inputs; GLubyte *vertex_buf; @@ -603,13 +603,13 @@ struct tnl_clipspace /* Parameters and constants for codegen: */ GLboolean need_viewport; - GLfloat vp_scale[4]; + GLfloat vp_scale[4]; GLfloat vp_xlate[4]; GLfloat chan_scale[4]; GLfloat identity[4]; struct tnl_clipspace_fastpath *fastpath; - + void (*codegen_emit)( GLcontext *ctx ); }; @@ -632,7 +632,7 @@ struct tnl_device_driver void (*RunPipeline)(GLcontext *ctx); /* Replaces PipelineStart/PipelineFinish -- intended to allow * drivers to wrap _tnl_run_pipeline() with code to validate state - * and grab/release hardware locks. + * and grab/release hardware locks. */ void (*NotifyMaterialChange)(GLcontext *ctx); @@ -713,7 +713,7 @@ struct tnl_device_driver * * This function is called only from _tnl_render_stage in tnl/t_render.c. */ - + GLboolean (*Multipass)( GLcontext *ctx, GLuint passno ); /* Driver may request additional render passes by returning GL_TRUE @@ -726,7 +726,7 @@ struct tnl_device_driver */ } Render; }; - + /** * Context state for T&L context. @@ -740,7 +740,7 @@ typedef struct /* Execute: */ struct tnl_vtx vtx; - + /* Compile: */ struct tnl_save save; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.c index 61bfed290e9..98ae13bd821 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.c @@ -80,7 +80,7 @@ static GLuint check_input_changes( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint i; - + for (i = 0; i < _TNL_ATTRIB_EDGEFLAG; i++) { if (tnl->vb.AttribPtr[i]->size != tnl->pipeline.last_attrib_size[i] || tnl->vb.AttribPtr[i]->stride != tnl->pipeline.last_attrib_stride[i]) { @@ -98,7 +98,7 @@ static GLuint check_output_changes( GLcontext *ctx ) { #if 0 TNLcontext *tnl = TNL_CONTEXT(ctx); - + for (i = 0; i < VERT_RESULT_MAX; i++) { if (tnl->vb.ResultPtr[i]->size != tnl->last_result_size[i] || tnl->vb.ResultPtr[i]->stride != tnl->last_result_stride[i]) { @@ -108,9 +108,9 @@ static GLuint check_output_changes( GLcontext *ctx ) } } - if (tnl->pipeline.output_changes) + if (tnl->pipeline.output_changes) tnl->Driver.NotifyOutputChanges( ctx, tnl->pipeline.output_changes ); - + return tnl->pipeline.output_changes; #else return ~0; @@ -139,10 +139,10 @@ void _tnl_run_pipeline( GLcontext *ctx ) if (s->validate) s->validate( ctx, s ); } - + tnl->pipeline.new_state = 0; tnl->pipeline.input_changes = 0; - + /* Pipeline can only change its output in response to either a * statechange or an input size/stride change. No other changes * are allowed. @@ -205,10 +205,10 @@ const struct tnl_pipeline_stage *_tnl_default_pipeline[] = { &_tnl_point_attenuation_stage, #if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) &_tnl_arb_vertex_program_stage, - &_tnl_vertex_program_stage, + &_tnl_vertex_program_stage, #endif &_tnl_render_stage, - NULL + NULL }; const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = { diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.h b/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.h index 6c7a0814c56..0c839ff903e 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_pipeline.h @@ -67,7 +67,7 @@ extern const struct tnl_pipeline_stage *_tnl_vp_pipeline[]; extern tnl_render_func _tnl_render_tab_elts[]; extern tnl_render_func _tnl_render_tab_verts[]; -extern void _tnl_RenderClippedPolygon( GLcontext *ctx, +extern void _tnl_RenderClippedPolygon( GLcontext *ctx, const GLuint *elts, GLuint n ); extern void _tnl_RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_save_api.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_save_api.c index 9788468d508..3b43ce67de5 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_save_api.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_save_api.c @@ -42,7 +42,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * example by building a list that consists of one very long primitive * (eg Begin(Triangles), 1000 vertices, End), and calling that list * from inside a different begin/end object (Begin(Lines), CallList, - * End). + * End). * * In that case the code will have to replay the list as individual * commands through the Exec dispatch table, or fix up the copied @@ -61,7 +61,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * * The list compiler currently doesn't attempt to compile lists * containing EvalCoord or EvalPoint commands. On encountering one of - * these, compilation falls back to opcodes. + * these, compilation falls back to opcodes. * * This could be improved to fallback only when a mix of EvalCoord and * Vertex commands are issued within a single primitive. @@ -83,7 +83,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. * NOTE: Old 'parity' issue is gone, but copying can still be * wrong-footed on replay. */ -static GLuint _save_copy_vertices( GLcontext *ctx, +static GLuint _save_copy_vertices( GLcontext *ctx, const struct tnl_vertex_list *node ) { TNLcontext *tnl = TNL_CONTEXT( ctx ); @@ -96,7 +96,7 @@ static GLuint _save_copy_vertices( GLcontext *ctx, if (prim->mode & PRIM_END) return 0; - + switch( prim->mode & PRIM_MODE_MASK ) { case GL_POINTS: @@ -117,7 +117,7 @@ static GLuint _save_copy_vertices( GLcontext *ctx, _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_LINE_STRIP: - if (nr == 0) + if (nr == 0) return 0; else { _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); @@ -126,7 +126,7 @@ static GLuint _save_copy_vertices( GLcontext *ctx, case GL_LINE_LOOP: case GL_TRIANGLE_FAN: case GL_POLYGON: - if (nr == 0) + if (nr == 0) return 0; else if (nr == 1) { _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); @@ -168,13 +168,13 @@ build_normal_lengths( struct tnl_vertex_list *node ) /* Find the normal of the first vertex: */ - for (i = 0 ; i < _TNL_ATTRIB_NORMAL ; i++) + for (i = 0 ; i < _TNL_ATTRIB_NORMAL ; i++) n += node->attrsz[i]; for (i = 0 ; i < count ; i++, n += stride) { len[i] = LEN_3FV( n ); if (len[i] > 0.0F) len[i] = 1.0F / len[i]; - } + } } static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx ) @@ -200,12 +200,12 @@ static void _save_reset_counters( GLcontext *ctx ) TNLcontext *tnl = TNL_CONTEXT(ctx); tnl->save.prim = tnl->save.prim_store->buffer + tnl->save.prim_store->used; - tnl->save.buffer = (tnl->save.vertex_store->buffer + + tnl->save.buffer = (tnl->save.vertex_store->buffer + tnl->save.vertex_store->used); if (tnl->save.vertex_size) - tnl->save.initial_counter = ((SAVE_BUFFER_SIZE - - tnl->save.vertex_store->used) / + tnl->save.initial_counter = ((SAVE_BUFFER_SIZE - + tnl->save.vertex_store->used) / tnl->save.vertex_size); else tnl->save.initial_counter = 0; @@ -264,7 +264,7 @@ static void _save_compile_vertex_list( GLcontext *ctx ) /* Maybe calculate normal lengths: */ - if (tnl->CalcDListNormalLengths && + if (tnl->CalcDListNormalLengths && node->attrsz[_TNL_ATTRIB_NORMAL] == 3 && !(ctx->ListState.CurrentList->flags & MESA_DLIST_DANGLING_REFS)) build_normal_lengths( node ); @@ -276,26 +276,26 @@ static void _save_compile_vertex_list( GLcontext *ctx ) /* Decide whether the storage structs are full, or can be used for * the next vertex lists as well. */ - if (tnl->save.vertex_store->used > + if (tnl->save.vertex_store->used > SAVE_BUFFER_SIZE - 16 * (tnl->save.vertex_size + 4)) { - tnl->save.vertex_store->refcount--; + tnl->save.vertex_store->refcount--; assert(tnl->save.vertex_store->refcount != 0); tnl->save.vertex_store = alloc_vertex_store( ctx ); tnl->save.vbptr = tnl->save.vertex_store->buffer; - } + } if (tnl->save.prim_store->used > SAVE_PRIM_SIZE - 6) { - tnl->save.prim_store->refcount--; + tnl->save.prim_store->refcount--; assert(tnl->save.prim_store->refcount != 0); tnl->save.prim_store = alloc_prim_store( ctx ); - } + } /* Reset our structures for the next run of vertices: */ _save_reset_counters( ctx ); - /* Copy duplicated vertices + /* Copy duplicated vertices */ tnl->save.copied.nr = _save_copy_vertices( ctx, node ); @@ -322,10 +322,10 @@ static void _save_wrap_buffers( GLcontext *ctx ) /* Close off in-progress primitive. */ - tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) - + tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) - tnl->save.prim[i].start); mode = tnl->save.prim[i].mode & ~(PRIM_BEGIN|PRIM_END); - + /* store the copied vertices, and allocate a new list. */ _save_compile_vertex_list( ctx ); @@ -341,7 +341,7 @@ static void _save_wrap_buffers( GLcontext *ctx ) /* Called only when buffers are wrapped as the result of filling the - * vertex_store struct. + * vertex_store struct. */ static void _save_wrap_filled_vertex( GLcontext *ctx ) { @@ -352,7 +352,7 @@ static void _save_wrap_filled_vertex( GLcontext *ctx ) /* Emit a glEnd to close off the last vertex list. */ _save_wrap_buffers( ctx ); - + /* Copy stored stored vertices to start of new list. */ assert(tnl->save.counter > tnl->save.copied.nr); @@ -368,27 +368,27 @@ static void _save_wrap_filled_vertex( GLcontext *ctx ) static void _save_copy_to_current( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint i; for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++) { if (tnl->save.attrsz[i]) { tnl->save.currentsz[i][0] = tnl->save.attrsz[i]; - COPY_CLEAN_4V(tnl->save.current[i], - tnl->save.attrsz[i], + COPY_CLEAN_4V(tnl->save.current[i], + tnl->save.attrsz[i], tnl->save.attrptr[i]); } } - /* Edgeflag requires special treatment: + /* Edgeflag requires special treatment: * * TODO: change edgeflag to GLfloat in Mesa. */ if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) { ctx->ListState.ActiveEdgeFlag = 1; - tnl->save.CurrentFloatEdgeFlag = + tnl->save.CurrentFloatEdgeFlag = tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0]; - ctx->ListState.CurrentEdgeFlag = + ctx->ListState.CurrentEdgeFlag = (tnl->save.CurrentFloatEdgeFlag == 1.0); } } @@ -396,10 +396,10 @@ static void _save_copy_to_current( GLcontext *ctx ) static void _save_copy_from_current( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLint i; - for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++) + for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++) switch (tnl->save.attrsz[i]) { case 4: tnl->save.attrptr[i][3] = tnl->save.current[i][3]; case 3: tnl->save.attrptr[i][2] = tnl->save.current[i][2]; @@ -420,8 +420,8 @@ static void _save_copy_from_current( GLcontext *ctx ) /* Flush existing data, set new attrib size, replay copied vertices. - */ -static void _save_upgrade_vertex( GLcontext *ctx, + */ +static void _save_upgrade_vertex( GLcontext *ctx, GLuint attr, GLuint newsz ) { @@ -433,14 +433,14 @@ static void _save_upgrade_vertex( GLcontext *ctx, /* Store the current run of vertices, and emit a GL_END. Emit a * BEGIN in the new buffer. */ - if (tnl->save.initial_counter != tnl->save.counter) + if (tnl->save.initial_counter != tnl->save.counter) _save_wrap_buffers( ctx ); else assert( tnl->save.copied.nr == 0 ); /* Do a COPY_TO_CURRENT to ensure back-copying works for the case * when the attribute already exists in the vertex and is having - * its size increased. + * its size increased. */ _save_copy_to_current( ctx ); @@ -450,7 +450,7 @@ static void _save_upgrade_vertex( GLcontext *ctx, tnl->save.attrsz[attr] = newsz; tnl->save.vertex_size += newsz - oldsz; - tnl->save.counter = ((SAVE_BUFFER_SIZE - tnl->save.vertex_store->used) / + tnl->save.counter = ((SAVE_BUFFER_SIZE - tnl->save.vertex_store->used) / tnl->save.vertex_size); if (tnl->save.counter > ctx->Const.MaxArrayLockSize ) tnl->save.counter = ctx->Const.MaxArrayLockSize; @@ -463,7 +463,7 @@ static void _save_upgrade_vertex( GLcontext *ctx, tnl->save.attrptr[i] = tmp; tmp += tnl->save.attrsz[i]; } - else + else tnl->save.attrptr[i] = NULL; /* will not be dereferenced. */ } @@ -540,16 +540,16 @@ static void _save_upgrade_vertex( GLcontext *ctx, /* Helper function for 'CHOOSE' macro. Do what's necessary when an * entrypoint is called for the first time. */ -static void do_choose( GLuint attr, GLuint sz, +static void do_choose( GLuint attr, GLuint sz, void (*attr_func)( const GLfloat *), void (*choose1)( const GLfloat *), void (*choose2)( const GLfloat *), void (*choose3)( const GLfloat *), void (*choose4)( const GLfloat *), const GLfloat *v ) -{ - GET_CURRENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); +{ + GET_CURRENT_CONTEXT( ctx ); + TNLcontext *tnl = TNL_CONTEXT(ctx); static GLfloat id[4] = { 0, 0, 0, 1 }; int i; @@ -567,7 +567,7 @@ static void do_choose( GLuint attr, GLuint sz, tnl->save.attrptr[attr][i-1] = id[i-1]; } - /* Reset any active pointers for this attribute + /* Reset any active pointers for this attribute */ tnl->save.tabfv[attr][0] = choose1; tnl->save.tabfv[attr][1] = choose2; @@ -642,7 +642,7 @@ static void save_init_##ATTR( TNLcontext *tnl ) \ tnl->save.tabfv[ATTR][2] = save_choose_##ATTR##_3; \ tnl->save.tabfv[ATTR][3] = save_choose_##ATTR##_4; \ } - + #define ATTRS( ATTRIB ) \ ATTRFV( ATTRIB, 1 ) \ ATTRFV( ATTRIB, 2 ) \ @@ -698,14 +698,14 @@ static void _save_reset_vertex( GLcontext *ctx ) save_init_13( tnl ); save_init_14( tnl ); save_init_15( tnl ); - + for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) tnl->save.attrsz[i] = 0; - + tnl->save.vertex_size = 0; tnl->save.have_materials = 0; - _save_reset_counters( ctx ); + _save_reset_counters( ctx ); } @@ -939,7 +939,7 @@ static void GLAPIENTRY _save_VertexAttrib1fNV( GLuint index, GLfloat x ) if (index < VERT_ATTRIB_MAX) DISPATCH_ATTR1F( index, x ); else - enum_error(); + enum_error(); } static void GLAPIENTRY _save_VertexAttrib1fvNV( GLuint index, const GLfloat *v ) @@ -966,7 +966,7 @@ static void GLAPIENTRY _save_VertexAttrib2fvNV( GLuint index, const GLfloat *v ) enum_error(); } -static void GLAPIENTRY _save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y, +static void GLAPIENTRY _save_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y, GLfloat z ) { if (index < VERT_ATTRIB_MAX) @@ -1007,7 +1007,7 @@ _save_VertexAttrib1fARB( GLuint index, GLfloat x ) if (index < VERT_ATTRIB_MAX) DISPATCH_ATTR1F( index, x ); else - enum_error(); + enum_error(); } static void GLAPIENTRY @@ -1074,11 +1074,11 @@ _save_VertexAttrib4fvARB( GLuint index, const GLfloat *v ) } -/* Materials: - * +/* Materials: + * * These are treated as per-vertex attributes, at indices above where * the NV_vertex_program leaves off. There are a lot of good things - * about treating materials this way. + * about treating materials this way. * * However: I don't want to double the number of generated functions * just to cope with this, so I unroll the 'C' varients of CHOOSE and @@ -1114,12 +1114,12 @@ do { \ /* NOTE: Have to remove/deal-with colormaterial crossovers, probably - * later on - in the meantime just store everything. + * later on - in the meantime just store everything. */ -static void GLAPIENTRY _save_Materialfv( GLenum face, GLenum pname, +static void GLAPIENTRY _save_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); switch (pname) { @@ -1273,7 +1273,7 @@ static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v */ static GLboolean _save_NotifyBegin( GLcontext *ctx, GLenum mode ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); if (1) { GLuint i = tnl->save.prim_count++; @@ -1281,13 +1281,13 @@ static GLboolean _save_NotifyBegin( GLcontext *ctx, GLenum mode ) assert(i < tnl->save.prim_max); tnl->save.prim[i].mode = mode | PRIM_BEGIN; tnl->save.prim[i].start = tnl->save.initial_counter - tnl->save.counter; - tnl->save.prim[i].count = 0; + tnl->save.prim[i].count = 0; - _mesa_install_save_vtxfmt( ctx, &tnl->save_vtxfmt ); + _mesa_install_save_vtxfmt( ctx, &tnl->save_vtxfmt ); ctx->Driver.SaveNeedFlush = 1; return GL_TRUE; } - else + else return GL_FALSE; } @@ -1295,13 +1295,13 @@ static GLboolean _save_NotifyBegin( GLcontext *ctx, GLenum mode ) static void GLAPIENTRY _save_End( void ) { - GET_CURRENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); + GET_CURRENT_CONTEXT( ctx ); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLint i = tnl->save.prim_count - 1; ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; tnl->save.prim[i].mode |= PRIM_END; - tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) - + tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) - tnl->save.prim[i].start); if (i == (GLint) tnl->save.prim_max - 1) { @@ -1312,7 +1312,7 @@ static void GLAPIENTRY _save_End( void ) /* Swap out this vertex format while outside begin/end. Any color, * etc. received between here and the next begin will be compiled * as opcodes. - */ + */ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); } @@ -1516,9 +1516,9 @@ static void _save_vtxfmt_init( GLcontext *ctx ) vfmt->VertexAttrib3fvARB = _save_VertexAttrib3fvARB; vfmt->VertexAttrib4fARB = _save_VertexAttrib4fARB; vfmt->VertexAttrib4fvARB = _save_VertexAttrib4fvARB; - + /* This will all require us to fallback to saving the list as opcodes: - */ + */ vfmt->CallList = _save_CallList; /* inside begin/end */ vfmt->CallLists = _save_CallLists; /* inside begin/end */ vfmt->EvalCoord1f = _save_EvalCoord1f; @@ -1531,7 +1531,7 @@ static void _save_vtxfmt_init( GLcontext *ctx ) /* These are all errors as we at least know we are in some sort of * begin/end pair: */ - vfmt->EvalMesh1 = _save_EvalMesh1; + vfmt->EvalMesh1 = _save_EvalMesh1; vfmt->EvalMesh2 = _save_EvalMesh2; vfmt->Begin = _save_Begin; vfmt->Rectf = _save_Rectf; @@ -1553,9 +1553,9 @@ void _tnl_SaveFlushVertices( GLcontext *ctx ) return; if (tnl->save.initial_counter != tnl->save.counter || - tnl->save.prim_count) + tnl->save.prim_count) _save_compile_vertex_list( ctx ); - + _save_copy_to_current( ctx ); _save_reset_vertex( ctx ); ctx->Driver.SaveNeedFlush = 0; @@ -1574,7 +1574,7 @@ void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) tnl->save.vertex_store = alloc_vertex_store( ctx ); tnl->save.vbptr = tnl->save.vertex_store->buffer; } - + _save_reset_vertex( ctx ); ctx->Driver.SaveNeedFlush = 0; } @@ -1584,7 +1584,7 @@ void _tnl_EndList( GLcontext *ctx ) (void) ctx; assert(TNL_CONTEXT(ctx)->save.vertex_size == 0); } - + void _tnl_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist ) { TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -1595,7 +1595,7 @@ void _tnl_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist ) void _tnl_EndCallList( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); - + if (ctx->ListState.CallDepth == 1) tnl->save.replay_flags = 0; } @@ -1631,9 +1631,9 @@ static void _tnl_print_vertex_list( GLcontext *ctx, void *data ) for (i = 0 ; i < node->prim_count ; i++) { struct tnl_prim *prim = &node->prim[i]; _mesa_debug(NULL, " prim %d: %s %d..%d %s %s\n", - i, + i, _mesa_lookup_enum_by_nr(prim->mode & PRIM_MODE_MASK), - prim->start, + prim->start, prim->start + prim->count, (prim->mode & PRIM_BEGIN) ? "BEGIN" : "(wrap)", (prim->mode & PRIM_END) ? "END" : "(wrap)"); @@ -1641,7 +1641,7 @@ static void _tnl_print_vertex_list( GLcontext *ctx, void *data ) } -static void _save_current_init( GLcontext *ctx ) +static void _save_current_init( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); GLint i; @@ -1691,7 +1691,7 @@ void _tnl_save_init( GLcontext *ctx ) _save_vtxfmt_init( ctx ); _save_current_init( ctx ); - /* Hook our array functions into the outside-begin-end vtxfmt in + /* Hook our array functions into the outside-begin-end vtxfmt in * ctx->ListState. */ ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_save_loopback.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_save_loopback.c index 7b2e4a43203..f7379193c5c 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_save_loopback.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_save_loopback.c @@ -39,13 +39,13 @@ /* If someone compiles a display list like: * glBegin(Triangles) - * glVertex() + * glVertex() * ... lots of vertices ... * glEnd() * - * or: + * or: * glDrawArrays(...) - * + * * and then tries to execute it like this: * * glBegin(Lines) @@ -54,12 +54,12 @@ * * it will wind up in here, as the vertex copying used when wrapping * buffers in list compilation (Triangles) won't be right for how the - * list is being executed (as Lines). + * list is being executed (as Lines). * * This could be avoided by not compiling as vertex_lists until after * the first glEnd() has been seen. However, that would miss an * important category of display lists, for the sake of a degenerate - * usage. + * usage. * * Further, replaying degenerately-called lists in this fashion is * probably still faster than the replay using opcodes. @@ -246,7 +246,7 @@ static void loopback_prim( GLcontext *ctx, la[k].func( ctx, la[k].target, tmp ); tmp += la[k].sz; } - + /* Fire the vertex */ la[0].func( ctx, VERT_ATTRIB_POS, data ); @@ -270,7 +270,7 @@ static void loopback_weak_prim( GLcontext *ctx, const struct tnl_vertex_list *list, GLuint i, const struct loopback_attr *la, GLuint nr ) { - if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) + if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) loopback_prim( ctx, list, i, la, nr ); else { struct tnl_prim *prim = &list->prim[i]; @@ -306,8 +306,8 @@ void _tnl_loopback_vertex_list( GLcontext *ctx, } } - for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT ; - i <= _TNL_ATTRIB_MAT_BACK_INDEXES ; + for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT ; + i <= _TNL_ATTRIB_MAT_BACK_INDEXES ; i++) { if (list->attrsz[i]) { la[nr].target = i; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_save_playback.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_save_playback.c index 995964c9614..de4fe58cd83 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_save_playback.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_save_playback.c @@ -45,7 +45,7 @@ static INLINE GLint get_size( const GLfloat *f ) } -/* Some nasty stuff still hanging on here. +/* Some nasty stuff still hanging on here. * * TODO - remove VB->ColorPtr, etc and just use the AttrPtr's. */ @@ -86,17 +86,17 @@ static void _tnl_bind_vertex_list( GLcontext *ctx, } } - + /* Copy edgeflag to a contiguous array */ if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) { if (node->attrsz[_TNL_ATTRIB_EDGEFLAG]) { - VB->EdgeFlag = _tnl_translate_edgeflag( ctx, data, + VB->EdgeFlag = _tnl_translate_edgeflag( ctx, data, node->count, node->vertex_size ); data++; } - else + else VB->EdgeFlag = _tnl_import_current_edgeflag( ctx, node->count ); } @@ -120,7 +120,7 @@ static void _tnl_bind_vertex_list( GLcontext *ctx, static void _playback_copy_to_current( GLcontext *ctx, const struct tnl_vertex_list *node ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); const GLfloat *data; GLuint i; @@ -193,7 +193,7 @@ void _tnl_playback_vertex_list( GLcontext *ctx, void *data ) _tnl_loopback_vertex_list( ctx, node ); return; } - + if (ctx->NewState) _mesa_update_state( ctx ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.c index 5cee3d78dc3..c3d86a401b7 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.c @@ -76,7 +76,7 @@ static GLfloat RoughApproxLog2(GLfloat t) } static GLfloat RoughApproxExp2(GLfloat t) -{ +{ #if 0 fi_type fi; fi.i = (GLint) t; @@ -101,7 +101,7 @@ static GLfloat ApproxLog2(GLfloat t) } static GLfloat ApproxExp2(GLfloat t) -{ +{ return (GLfloat) _mesa_pow(2.0, t); } @@ -121,7 +121,7 @@ static GLfloat rough_approx_log2_0_1(GLfloat x) /** * Perform a reduced swizzle: */ -static void do_RSW( struct arb_vp_machine *m, union instruction op ) +static void do_RSW( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.rsw.dst]; const GLfloat *arg0 = m->File[op.rsw.file0][op.rsw.idx0]; @@ -132,7 +132,7 @@ static void do_RSW( struct arb_vp_machine *m, union instruction op ) result[1] = arg0[GET_RSW(swz, 1)]; result[2] = arg0[GET_RSW(swz, 2)]; result[3] = arg0[GET_RSW(swz, 3)]; - + if (neg) { if (neg & 0x1) result[0] = -result[0]; if (neg & 0x2) result[1] = -result[1]; @@ -155,7 +155,7 @@ static void do_MSK( struct arb_vp_machine *m, union instruction op ) { GLfloat *dst = m->File[0][op.msk.dst]; const GLfloat *arg = m->File[op.msk.file][op.msk.idx]; - + if (op.msk.mask & 0x1) dst[0] = arg[0]; if (op.msk.mask & 0x2) dst[1] = arg[1]; if (op.msk.mask & 0x4) dst[2] = arg[2]; @@ -166,8 +166,8 @@ static void do_MSK( struct arb_vp_machine *m, union instruction op ) static void do_PRT( struct arb_vp_machine *m, union instruction op ) { const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - - _mesa_printf("%d: %f %f %f %f\n", m->vtx_nr, + + _mesa_printf("%d: %f %f %f %f\n", m->vtx_nr, arg0[0], arg0[1], arg0[2], arg0[3]); } @@ -177,7 +177,7 @@ static void do_PRT( struct arb_vp_machine *m, union instruction op ) * internal registers and ignore write masks and swizzling issues. */ -static void do_ABS( struct arb_vp_machine *m, union instruction op ) +static void do_ABS( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -207,8 +207,8 @@ static void do_DP3( struct arb_vp_machine *m, union instruction op ) const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - result[0] = (arg0[0] * arg1[0] + - arg0[1] * arg1[1] + + result[0] = (arg0[0] * arg1[0] + + arg0[1] * arg1[1] + arg0[2] * arg1[2]); PUFF(result); @@ -222,9 +222,9 @@ static void do_DP4( struct arb_vp_machine *m, union instruction op ) const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - result[0] = (arg0[0] * arg1[0] + - arg0[1] * arg1[1] + - arg0[2] * arg1[2] + + result[0] = (arg0[0] * arg1[0] + + arg0[1] * arg1[1] + + arg0[2] * arg1[2] + arg0[3] * arg1[3]); PUFF(result); @@ -236,11 +236,11 @@ static void do_DPH( struct arb_vp_machine *m, union instruction op ) const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; const GLfloat *arg1 = m->File[op.alu.file1][op.alu.idx1]; - result[0] = (arg0[0] * arg1[0] + - arg0[1] * arg1[1] + - arg0[2] * arg1[2] + + result[0] = (arg0[0] * arg1[0] + + arg0[1] * arg1[1] + + arg0[2] * arg1[2] + 1.0 * arg1[3]); - + PUFF(result); } @@ -259,7 +259,7 @@ static void do_DST( struct arb_vp_machine *m, union instruction op ) /* Intended to be high precision: */ -static void do_EX2( struct arb_vp_machine *m, union instruction op ) +static void do_EX2( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -285,7 +285,7 @@ static void do_EXP( struct arb_vp_machine *m, union instruction op ) result[3] = 1.0F; } -static void do_FLR( struct arb_vp_machine *m, union instruction op ) +static void do_FLR( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -296,7 +296,7 @@ static void do_FLR( struct arb_vp_machine *m, union instruction op ) result[3] = FLOORF(arg0[3]); } -static void do_FRC( struct arb_vp_machine *m, union instruction op ) +static void do_FRC( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -309,7 +309,7 @@ static void do_FRC( struct arb_vp_machine *m, union instruction op ) /* High precision log base 2: */ -static void do_LG2( struct arb_vp_machine *m, union instruction op ) +static void do_LG2( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -410,7 +410,7 @@ static void do_MUL( struct arb_vp_machine *m, union instruction op ) /* Intended to be "high" precision */ -static void do_POW( struct arb_vp_machine *m, union instruction op ) +static void do_POW( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -437,7 +437,7 @@ static void do_RCP( struct arb_vp_machine *m, union instruction op ) GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; - result[0] = 1.0F / arg0[0]; + result[0] = 1.0F / arg0[0]; PUFF(result); } @@ -476,7 +476,7 @@ static void do_SLT( struct arb_vp_machine *m, union instruction op ) result[3] = (arg0[3] < arg1[3]) ? 1.0F : 0.0F; } -static void do_SUB( struct arb_vp_machine *m, union instruction op ) +static void do_SUB( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -489,7 +489,7 @@ static void do_SUB( struct arb_vp_machine *m, union instruction op ) } -static void do_XPD( struct arb_vp_machine *m, union instruction op ) +static void do_XPD( struct arb_vp_machine *m, union instruction op ) { GLfloat *result = m->File[0][op.alu.dst]; const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0]; @@ -500,7 +500,7 @@ static void do_XPD( struct arb_vp_machine *m, union instruction op ) result[2] = arg0[0] * arg1[1] - arg0[1] * arg1[0]; } -static void do_NOP( struct arb_vp_machine *m, union instruction op ) +static void do_NOP( struct arb_vp_machine *m, union instruction op ) { } @@ -525,7 +525,7 @@ static void print_reg( GLuint file, GLuint reg ) }; if (file == 0) { - if (reg == REG_RES) + if (reg == REG_RES) _mesa_printf("RES"); else if (reg >= REG_ARG0 && reg <= REG_ARG1) _mesa_printf("ARG%d", reg - REG_ARG0); @@ -542,7 +542,7 @@ static void print_reg( GLuint file, GLuint reg ) else _mesa_printf("REG%d", reg); } - else + else _mesa_printf("%s:%d", reg_file[file], reg); } @@ -560,7 +560,7 @@ static void print_RSW( union instruction op, const struct opcode_info *info ) _mesa_printf("."); for (i = 0; i < 4; i++, swz >>= 2) { const char *cswz = "xyzw"; - if (neg & (1<File, src->Index, src->RelAddr, arg ); union instruction rsw, noop; - - /* Emit any necessary swizzling. + + /* Emit any necessary swizzling. */ rsw.dword = 0; rsw.rsw.neg = src->Negate ? WRITEMASK_XYZW : 0; @@ -815,7 +815,7 @@ static GLuint cvp_choose_result( struct compilation *cp, } /* Optimization: When writing (with a writemask) to an undefined - * value for the first time, the writemask may be ignored. + * value for the first time, the writemask may be ignored. */ if (mask != WRITEMASK_XYZW && (cp->reg_active & (1 << idx))) { fixup->msk.opcode = MSK; @@ -833,10 +833,10 @@ static GLuint cvp_choose_result( struct compilation *cp, } } -static struct reg cvp_emit_rsw( struct compilation *cp, +static struct reg cvp_emit_rsw( struct compilation *cp, GLuint dst, struct reg src, - GLuint neg, + GLuint neg, GLuint swz, GLboolean force) { @@ -850,7 +850,7 @@ static struct reg cvp_emit_rsw( struct compilation *cp, op->rsw.idx0 = src.idx; op->rsw.neg = neg; op->rsw.swz = swz; - + retval.file = FILE_REG; retval.idx = dst; return retval; @@ -863,7 +863,7 @@ static struct reg cvp_emit_rsw( struct compilation *cp, op->alu.dst = dst; op->alu.file0 = src.file; op->alu.idx0 = src.idx; - + retval.file = FILE_REG; retval.idx = dst; return retval; @@ -892,7 +892,7 @@ static void cvp_emit_inst( struct compilation *cp, */ case VP_OPCODE_MAD: result = cvp_choose_result( cp, &inst->DstReg, &fixup ); - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) reg[i] = cvp_emit_arg( cp, &inst->SrcReg[i], REG_ARG0+i ); op = cvp_next_instruction(cp); @@ -959,7 +959,7 @@ static void cvp_emit_inst( struct compilation *cp, if (mask == WRITEMASK_XYZW) { cvp_emit_rsw(cp, result, reg[0], neg0, swz0, GL_TRUE); - + } else if (mask == 0) { cvp_emit_rsw(cp, result, reg[1], neg1, swz1, GL_TRUE); @@ -988,7 +988,7 @@ static void cvp_emit_inst( struct compilation *cp, default: result = cvp_choose_result( cp, &inst->DstReg, &fixup ); - for (i = 0; i < info->nr_args; i++) + for (i = 0; i < info->nr_args; i++) reg[i] = cvp_emit_arg( cp, &inst->SrcReg[i], REG_ARG0 + i ); op = cvp_next_instruction(cp); @@ -1002,7 +1002,7 @@ static void cvp_emit_inst( struct compilation *cp, if (result == REG_RES) { op = cvp_next_instruction(cp); op->dword = fixup.dword; - } + } break; } } @@ -1018,14 +1018,14 @@ static void free_tnl_data( struct vertex_program *program ) static void compile_vertex_program( struct vertex_program *program, GLboolean try_codegen ) -{ +{ struct compilation cp; struct tnl_compiled_program *p = CALLOC_STRUCT(tnl_compiled_program); GLuint i; - if (program->TnlData) + if (program->TnlData) free_tnl_data( program ); - + program->TnlData = p; /* Initialize cp. Note that ctx and VB aren't used in compilation @@ -1052,7 +1052,7 @@ static void compile_vertex_program( struct vertex_program *program, } _mesa_printf("\n\n"); } - + #ifdef USE_SSE_ASM if (try_codegen) _tnl_sse_codegen_vertex_program(p); @@ -1086,7 +1086,7 @@ static void userclip( GLcontext *ctx, GLuint count = clip->count; for (nr = 0, i = 0 ; i < count ; i++) { - GLfloat dp = (coord[0] * a + + GLfloat dp = (coord[0] * a + coord[1] * b + coord[2] * c + coord[3] * d); @@ -1174,8 +1174,8 @@ static INLINE void call_func( struct tnl_compiled_program *p, } /** - * Execute the given vertex program. - * + * Execute the given vertex program. + * * TODO: Integrate the t_vertex.c code here, to build machine vertices * directly at this point. * @@ -1194,12 +1194,12 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) GLuint i, j, outputs; if (!program || program->IsNVProgram) - return GL_TRUE; + return GL_TRUE; if (program->Parameters) { _mesa_load_state_parameters(ctx, program->Parameters); - } - + } + p = (struct tnl_compiled_program *)program->TnlData; assert(p); @@ -1215,7 +1215,7 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) m->input[j].size = m->VB->AttribPtr[i]->size; ASSIGN_4V(m->File[0][REG_IN0 + i], 0, 0, 0, 1); } - } + } for (i = 0; i < 15; i++) { if (program->OutputsWritten & (1<output[j].idx = i; m->output[j].data = (GLfloat *)m->attribs[i].data; } - } + } /* Run the actual program: @@ -1246,7 +1246,7 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) } else { for (j = 0; j < p->nr_instructions; j++) { - union instruction inst = p->instructions[j]; + union instruction inst = p->instructions[j]; opcode_func[inst.alu.opcode]( m, inst ); } } @@ -1335,7 +1335,7 @@ static void validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage ) { struct arb_vp_machine *m = ARB_VP_MACHINE(stage); - struct vertex_program *program = + struct vertex_program *program = (ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : 0); if (!program && ctx->_MaintainTnlProgram) { @@ -1345,7 +1345,7 @@ validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage ) if (program) { if (!program->TnlData) compile_vertex_program( program, m->try_codegen ); - + /* Grab the state GL state and put into registers: */ m->File[FILE_LOCAL_PARAM] = program->Base.LocalParams; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.h b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.h index 02cd432825c..408558441e1 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram.h @@ -176,7 +176,7 @@ struct arb_vp_machine { struct tnl_compiled_program { union instruction instructions[1024]; GLint nr_instructions; - void (*compiled_func)( struct arb_vp_machine * ); /**< codegen'd program */ + void (*compiled_func)( struct arb_vp_machine * ); /**< codegen'd program */ }; void _tnl_program_string_change( struct vertex_program * ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram_sse.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram_sse.c index 330d30efb92..fe1cfadf713 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram_sse.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_arbprogram_sse.c @@ -79,7 +79,7 @@ do { \ struct compilation { struct x86_function func; - struct tnl_compiled_program *p; + struct tnl_compiled_program *p; GLuint insn_counter; struct { @@ -105,7 +105,7 @@ static INLINE GLboolean eq( struct x86_reg a, a.mod == b.mod && a.disp == b.disp); } - + static GLint get_offset( const void *a, const void *b ) { return (const char *)b - (const char *)a; @@ -131,7 +131,7 @@ static struct x86_reg get_reg_ptr(GLuint file, return x86_make_disp(reg, 16 * idx); } - + static void spill( struct compilation *cp, GLuint idx ) { @@ -148,13 +148,13 @@ static struct x86_reg get_xmm_reg( struct compilation *cp ) GLuint i; GLuint oldest = 0; - for (i = 0; i < 8; i++) + for (i = 0; i < 8; i++) if (cp->xmm[i].last_used < cp->xmm[oldest].last_used) oldest = i; /* Need to write out the old value? */ - if (cp->xmm[oldest].dirty) + if (cp->xmm[oldest].dirty) spill(cp, oldest); assert(cp->xmm[oldest].last_used != cp->insn_counter); @@ -165,12 +165,12 @@ static struct x86_reg get_xmm_reg( struct compilation *cp ) return x86_make_reg(file_XMM, oldest); } -static void invalidate_xmm( struct compilation *cp, +static void invalidate_xmm( struct compilation *cp, GLuint file, GLuint idx ) { GLuint i; - /* Invalidate any old copy of this register in XMM0-7. + /* Invalidate any old copy of this register in XMM0-7. */ for (i = 0; i < 8; i++) { if (cp->xmm[i].file == file && cp->xmm[i].idx == idx) { @@ -181,11 +181,11 @@ static void invalidate_xmm( struct compilation *cp, } } } - + /* Return an XMM reg to receive the results of an operation. */ -static struct x86_reg get_dst_xmm_reg( struct compilation *cp, +static struct x86_reg get_dst_xmm_reg( struct compilation *cp, GLuint file, GLuint idx ) { struct x86_reg reg; @@ -199,13 +199,13 @@ static struct x86_reg get_dst_xmm_reg( struct compilation *cp, cp->xmm[reg.idx].file = file; cp->xmm[reg.idx].idx = idx; cp->xmm[reg.idx].dirty = 1; - return reg; + return reg; } /* As above, but return a pointer. Note - this pointer may alias * those returned by get_arg_ptr(). */ -static struct x86_reg get_dst_ptr( struct compilation *cp, +static struct x86_reg get_dst_ptr( struct compilation *cp, GLuint file, GLuint idx ) { /* Invalidate any old copy of this register in XMM0-7. Don't reuse @@ -246,9 +246,9 @@ static struct x86_reg get_arg_ptr( struct compilation *cp, GLuint file, GLuint i * XMM regs, write it out to memory. */ for (i = 0; i < 8; i++) { - if (cp->xmm[i].file == file && + if (cp->xmm[i].file == file && cp->xmm[i].idx == idx && - cp->xmm[i].dirty) + cp->xmm[i].dirty) spill(cp, i); } @@ -267,7 +267,7 @@ static void emit_pshufd( struct compilation *cp, cp->func.fn = 0; } else { - if (!eq(dst, arg0)) + if (!eq(dst, arg0)) sse_movups(&cp->func, dst, arg0); sse_shufps(&cp->func, dst, dst, shuf); @@ -287,9 +287,9 @@ static void set_fpu_round_neg_inf( struct compilation *cp ) } -/* Perform a reduced swizzle. +/* Perform a reduced swizzle. */ -static GLboolean emit_RSW( struct compilation *cp, union instruction op ) +static GLboolean emit_RSW( struct compilation *cp, union instruction op ) { struct x86_reg arg0 = get_arg(cp, op.rsw.file0, op.rsw.idx0); struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.rsw.dst); @@ -297,7 +297,7 @@ static GLboolean emit_RSW( struct compilation *cp, union instruction op ) GLuint neg = op.rsw.neg; emit_pshufd(cp, dst, arg0, swz); - + if (neg) { struct x86_reg negs = get_arg(cp, FILE_REG, REG_SWZ); struct x86_reg tmp = get_xmm_reg(cp); @@ -305,7 +305,7 @@ static GLboolean emit_RSW( struct compilation *cp, union instruction op ) * Use neg as arg to pshufd * Multiply */ - emit_pshufd(cp, tmp, negs, + emit_pshufd(cp, tmp, negs, SHUF((neg & 1) ? 1 : 0, (neg & 2) ? 1 : 0, (neg & 4) ? 1 : 0, @@ -380,14 +380,14 @@ static GLboolean emit_MSK2( struct compilation *cp, union instruction op ) struct x86_reg arg0 = get_arg(cp, op.msk.file, op.msk.arg); struct x86_reg arg1 = get_arg(cp, FILE_REG, op.msk.dst); /* NOTE! */ struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.msk.dst); - - /* make full width bitmask in tmp + + /* make full width bitmask in tmp * dst = ~tmp * tmp &= arg0 * dst &= arg1 * dst |= tmp */ - emit_pshufd(cp, tmp, get_arg(cp, FILE_REG, REG_NEGS), + emit_pshufd(cp, tmp, get_arg(cp, FILE_REG, REG_NEGS), SHUF((op.msk.mask & 1) ? 2 : 0, (op.msk.mask & 2) ? 2 : 0, (op.msk.mask & 4) ? 2 : 0, @@ -411,7 +411,7 @@ static GLboolean emit_MSK( struct compilation *cp, union instruction op ) struct x86_reg arg = get_arg(cp, op.msk.file, op.msk.idx); struct x86_reg dst0 = get_arg(cp, FILE_REG, op.msk.dst); /* NOTE! */ struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.msk.dst); - + /* Note that dst and dst0 refer to the same program variable, but * will definitely be different XMM registers. We're effectively * treating this as a 2 argument SEL now, just one of which happens @@ -441,18 +441,18 @@ static GLboolean emit_MSK( struct compilation *cp, union instruction op ) sse_shufps(&cp->func, dst, arg, SHUF(X, Y, Z, W)); return GL_TRUE; - case WRITEMASK_ZW: + case WRITEMASK_ZW: sse_movups(&cp->func, dst, arg); sse_shufps(&cp->func, dst, dst0, SHUF(X, Y, Z, W)); return GL_TRUE; - case WRITEMASK_YZW: + case WRITEMASK_YZW: if (dst0.file == file_XMM) { sse_movups(&cp->func, dst, arg); sse_movss(&cp->func, dst, dst0); } else { - struct x86_reg tmp = get_xmm_reg(cp); + struct x86_reg tmp = get_xmm_reg(cp); sse_movups(&cp->func, dst, arg); sse_movss(&cp->func, tmp, dst0); sse_movss(&cp->func, dst, tmp); @@ -463,11 +463,11 @@ static GLboolean emit_MSK( struct compilation *cp, union instruction op ) emit_shuf_copy1(cp, dst, arg, dst0, SHUF(Y,X,Z,W)); return GL_TRUE; - case WRITEMASK_Z: + case WRITEMASK_Z: emit_shuf_copy1(cp, dst, arg, dst0, SHUF(Z,Y,X,W)); return GL_TRUE; - case WRITEMASK_W: + case WRITEMASK_W: emit_shuf_copy1(cp, dst, arg, dst0, SHUF(W,Y,Z,X)); return GL_TRUE; @@ -475,10 +475,10 @@ static GLboolean emit_MSK( struct compilation *cp, union instruction op ) emit_shuf_copy2(cp, dst, arg, dst0, SHUF(X,Z,Y,W)); return GL_TRUE; - case WRITEMASK_XW: + case WRITEMASK_XW: emit_shuf_copy2(cp, dst, arg, dst0, SHUF(X,W,Z,Y)); - case WRITEMASK_YZ: + case WRITEMASK_YZ: emit_shuf_copy2(cp, dst, arg, dst0, SHUF(Z,Y,X,W)); return GL_TRUE; @@ -490,17 +490,17 @@ static GLboolean emit_MSK( struct compilation *cp, union instruction op ) emit_shuf_copy1(cp, dst, dst0, arg, SHUF(Y,X,Z,W)); return GL_TRUE; - case WRITEMASK_XYW: + case WRITEMASK_XYW: emit_shuf_copy1(cp, dst, dst0, arg, SHUF(Z,Y,X,W)); return GL_TRUE; - case WRITEMASK_XYZ: + case WRITEMASK_XYZ: emit_shuf_copy1(cp, dst, dst0, arg, SHUF(W,Y,Z,X)); return GL_TRUE; case WRITEMASK_XYZW: sse_movups(&cp->func, dst, arg); - return GL_TRUE; + return GL_TRUE; default: assert(0); @@ -521,7 +521,7 @@ static GLboolean emit_PRT( struct compilation *cp, union instruction op ) * and ignore write masks and swizzling issues. */ -static GLboolean emit_ABS( struct compilation *cp, union instruction op ) +static GLboolean emit_ABS( struct compilation *cp, union instruction op ) { struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); @@ -552,13 +552,13 @@ static GLboolean emit_DP3( struct compilation *cp, union instruction op ) struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg tmp = get_xmm_reg(cp); + struct x86_reg tmp = get_xmm_reg(cp); sse_movups(&cp->func, dst, arg0); sse_mulps(&cp->func, dst, arg1); - + /* Now the hard bit: sum the first 3 values: - */ + */ sse_movhlps(&cp->func, tmp, dst); sse_addss(&cp->func, dst, tmp); /* a*x+c*z, b*y, ?, ? */ emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); @@ -574,13 +574,13 @@ static GLboolean emit_DP4( struct compilation *cp, union instruction op ) struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); - struct x86_reg tmp = get_xmm_reg(cp); + struct x86_reg tmp = get_xmm_reg(cp); sse_movups(&cp->func, dst, arg0); sse_mulps(&cp->func, dst, arg1); - + /* Now the hard bit: sum the values: - */ + */ sse_movhlps(&cp->func, tmp, dst); sse_addps(&cp->func, dst, tmp); /* a*x+c*z, b*y+d*w, a*x+c*z, b*y+d*w */ emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); @@ -591,19 +591,19 @@ static GLboolean emit_DP4( struct compilation *cp, union instruction op ) static GLboolean emit_DPH( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); + struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); + struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); struct x86_reg ones = get_reg_ptr(FILE_REG, REG_ONES); - struct x86_reg tmp = get_xmm_reg(cp); + struct x86_reg tmp = get_xmm_reg(cp); emit_pshufd(cp, dst, arg0, SHUF(W,X,Y,Z)); sse_movss(&cp->func, dst, ones); emit_pshufd(cp, dst, dst, SHUF(W,X,Y,Z)); sse_mulps(&cp->func, dst, arg1); - + /* Now the hard bit: sum the values (from DP4): - */ + */ sse_movhlps(&cp->func, tmp, dst); sse_addps(&cp->func, dst, tmp); /* a*x+c*z, b*y+d*w, a*x+c*z, b*y+d*w */ emit_pshufd(cp, tmp, dst, SHUF(Y,X,W,Z)); @@ -615,9 +615,9 @@ static GLboolean emit_DPH( struct compilation *cp, union instruction op ) #if 0 static GLboolean emit_DST( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg_ptr(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg arg1 = get_arg_ptr(cp, op.alu.file1, op.alu.idx1); + struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); /* dst[0] = 1.0 * 1.0F; */ /* dst[1] = arg0[1] * arg1[1]; */ @@ -627,13 +627,13 @@ static GLboolean emit_DST( struct compilation *cp, union instruction op ) /* Would rather do some of this with integer regs, but: * 1) No proper support for immediate values yet * 2) I'd need to push/pop somewhere to get a free reg. - */ + */ x87_fld1(&cp->func); x87_fstp(&cp->func, dst); /* would rather do an immediate store... */ x87_fld(&cp->func, x86_make_disp(arg0, 4)); x87_fmul(&cp->func, x86_make_disp(arg1, 4)); x87_fstp(&cp->func, x86_make_disp(dst, 4)); - + if (!eq(arg0, dst)) { x86_fld(&cp->func, x86_make_disp(arg0, 8)); x86_stp(&cp->func, x86_make_disp(dst, 8)); @@ -642,16 +642,16 @@ static GLboolean emit_DST( struct compilation *cp, union instruction op ) if (!eq(arg1, dst)) { x86_fld(&cp->func, x86_make_disp(arg0, 12)); x86_stp(&cp->func, x86_make_disp(dst, 12)); - } + } return GL_TRUE; } #else static GLboolean emit_DST( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); + struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); + struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); struct x86_reg tmp = get_xmm_reg(cp); struct x86_reg ones = get_reg_ptr(FILE_REG, REG_ONES); @@ -668,10 +668,10 @@ static GLboolean emit_DST( struct compilation *cp, union instruction op ) } #endif -static GLboolean emit_LG2( struct compilation *cp, union instruction op ) +static GLboolean emit_LG2( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); x87_fld1(&cp->func); /* 1 */ x87_fld(&cp->func, arg0); /* a0 1 */ @@ -680,33 +680,33 @@ static GLboolean emit_LG2( struct compilation *cp, union instruction op ) x87_fst(&cp->func, x86_make_disp(dst, 4)); x87_fst(&cp->func, x86_make_disp(dst, 8)); x87_fstp(&cp->func, x86_make_disp(dst, 12)); - + return GL_TRUE; } -static GLboolean emit_EX2( struct compilation *cp, union instruction op ) +static GLboolean emit_EX2( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); /* CAUTION: dst may alias arg0! */ - x87_fld(&cp->func, arg0); + x87_fld(&cp->func, arg0); emit_x87_ex2(cp); - x87_fst(&cp->func, x86_make_disp(dst, 0)); - x87_fst(&cp->func, x86_make_disp(dst, 4)); - x87_fst(&cp->func, x86_make_disp(dst, 8)); - x87_fst(&cp->func, x86_make_disp(dst, 12)); + x87_fst(&cp->func, x86_make_disp(dst, 0)); + x87_fst(&cp->func, x86_make_disp(dst, 4)); + x87_fst(&cp->func, x86_make_disp(dst, 8)); + x87_fst(&cp->func, x86_make_disp(dst, 12)); return GL_TRUE; } static GLboolean emit_EXP( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); struct x86_reg st0 = x86_make_reg(file_x87, 0); struct x86_reg st1 = x86_make_reg(file_x87, 1); struct x86_reg st3 = x86_make_reg(file_x87, 3); @@ -735,8 +735,8 @@ static GLboolean emit_EXP( struct compilation *cp, union instruction op ) x87_fld1(&cp->func); /* 1 (2^frac(a))-1 2^flr(a)*/ x87_faddp(&cp->func, st1); /* 2^frac(a) 2^flr(a) */ x87_fmulp(&cp->func, st1); /* 2^a */ - x87_fst(&cp->func, x86_make_disp(dst, 8)); - + x87_fst(&cp->func, x86_make_disp(dst, 8)); + /* dst[0] = 2^floor(tmp); */ @@ -748,12 +748,12 @@ static GLboolean emit_EXP( struct compilation *cp, union instruction op ) static GLboolean emit_LOG( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); struct x86_reg st0 = x86_make_reg(file_x87, 0); struct x86_reg st1 = x86_make_reg(file_x87, 1); struct x86_reg st2 = x86_make_reg(file_x87, 2); - + /* CAUTION: dst may alias arg0! */ x87_fld(&cp->func, arg0); /* arg0.x */ @@ -771,22 +771,22 @@ static GLboolean emit_LOG( struct compilation *cp, union instruction op ) x87_fstp(&cp->func, dst); /* m */ x87_fadd(&cp->func, st0, st0); /* 2m */ - x87_fstp(&cp->func, x86_make_disp(dst, 4)); + x87_fstp(&cp->func, x86_make_disp(dst, 4)); return GL_TRUE; } -static GLboolean emit_FLR( struct compilation *cp, union instruction op ) +static GLboolean emit_FLR( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); int i; set_fpu_round_neg_inf( cp ); for (i = 0; i < 4; i++) { - x87_fld(&cp->func, x86_make_disp(arg0, i*4)); - x87_fprndint( &cp->func ); + x87_fld(&cp->func, x86_make_disp(arg0, i*4)); + x87_fprndint( &cp->func ); x87_fstp(&cp->func, x86_make_disp(dst, i*4)); } @@ -794,10 +794,10 @@ static GLboolean emit_FLR( struct compilation *cp, union instruction op ) return GL_TRUE; } -static GLboolean emit_FRC( struct compilation *cp, union instruction op ) +static GLboolean emit_FRC( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); struct x86_reg st0 = x86_make_reg(file_x87, 0); struct x86_reg st1 = x86_make_reg(file_x87, 1); int i; @@ -808,7 +808,7 @@ static GLboolean emit_FRC( struct compilation *cp, union instruction op ) * here: */ for (i = 0; i < 4; i++) { - x87_fld(&cp->func, x86_make_disp(arg0, i*4)); + x87_fld(&cp->func, x86_make_disp(arg0, i*4)); x87_fld(&cp->func, st0); /* a a */ x87_fprndint( &cp->func ); /* flr(a) a */ x87_fsubrp(&cp->func, st1); /* frc(a) */ @@ -823,8 +823,8 @@ static GLboolean emit_FRC( struct compilation *cp, union instruction op ) static GLboolean emit_LIT( struct compilation *cp, union instruction op ) { #if 1 - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); struct x86_reg lit = get_arg(cp, FILE_REG, REG_LIT); struct x86_reg tmp = get_xmm_reg(cp); struct x86_reg st1 = x86_make_reg(file_x87, 1); @@ -837,29 +837,29 @@ static GLboolean emit_LIT( struct compilation *cp, union instruction op ) x87_fld(&cp->func, x86_make_disp(arg0, 12)); /* a3 */ x87_fld(&cp->func, x86_make_disp(arg0, 4)); /* a1 a3 */ x87_fld(&cp->func, x86_make_disp(arg0, 0)); /* a0 a1 a3 */ - + /* Intialize dst: */ sse_movaps(&cp->func, tmp, lit); sse_movaps(&cp->func, dst, tmp); - + /* Check arg0[0]: */ x87_fldz(&cp->func); /* 0 a0 a1 a3 */ x87_fucomp(&cp->func, st1); /* a0 a1 a3 */ x87_fnstsw(&cp->func, regEAX); x86_sahf(&cp->func); - fixup1 = x86_jcc_forward(&cp->func, cc_AE); - + fixup1 = x86_jcc_forward(&cp->func, cc_AE); + x87_fstp(&cp->func, x86_make_disp(dst, 4)); /* a1 a3 */ /* Check arg0[1]: - */ + */ x87_fldz(&cp->func); /* 0 a1 a3 */ x87_fucomp(&cp->func, st1); /* a1 a3 */ x87_fnstsw(&cp->func, regEAX); x86_sahf(&cp->func); - fixup2 = x86_jcc_forward(&cp->func, cc_AE); + fixup2 = x86_jcc_forward(&cp->func, cc_AE); /* Compute pow(a1, a3) */ @@ -868,16 +868,16 @@ static GLboolean emit_LIT( struct compilation *cp, union instruction op ) emit_x87_ex2( cp ); /* 2^(a3*log2(a1)) */ x87_fstp(&cp->func, x86_make_disp(dst, 8)); - + /* Land jumps: */ x86_fixup_fwd_jump(&cp->func, fixup1); x86_fixup_fwd_jump(&cp->func, fixup2); #else - struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); + struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); struct x86_reg ones = get_reg_ptr(FILE_REG, REG_LIT); sse_movups(&cp->func, dst, ones); -#endif +#endif return GL_TRUE; } @@ -927,10 +927,10 @@ static GLboolean emit_MUL( struct compilation *cp, union instruction op ) } -static GLboolean emit_POW( struct compilation *cp, union instruction op ) +static GLboolean emit_POW( struct compilation *cp, union instruction op ) { - struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); - struct x86_reg arg1 = get_arg_ptr(cp, op.alu.file1, op.alu.idx1); + struct x86_reg arg0 = get_arg_ptr(cp, op.alu.file0, op.alu.idx0); + struct x86_reg arg1 = get_arg_ptr(cp, op.alu.file1, op.alu.idx1); struct x86_reg dst = get_dst_ptr(cp, FILE_REG, op.alu.dst); x87_fld(&cp->func, arg1); /* a1 */ @@ -939,11 +939,11 @@ static GLboolean emit_POW( struct compilation *cp, union instruction op ) emit_x87_ex2( cp ); /* 2^(a1*log2(a0)) */ - x87_fst(&cp->func, x86_make_disp(dst, 0)); - x87_fst(&cp->func, x86_make_disp(dst, 4)); - x87_fst(&cp->func, x86_make_disp(dst, 8)); - x87_fstp(&cp->func, x86_make_disp(dst, 12)); - + x87_fst(&cp->func, x86_make_disp(dst, 0)); + x87_fst(&cp->func, x86_make_disp(dst, 4)); + x87_fst(&cp->func, x86_make_disp(dst, 8)); + x87_fstp(&cp->func, x86_make_disp(dst, 12)); + return GL_TRUE; } @@ -1019,14 +1019,14 @@ static GLboolean emit_SLT( struct compilation *cp, union instruction op ) struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); struct x86_reg dst = get_dst_xmm_reg(cp, FILE_REG, op.alu.dst); struct x86_reg ones = get_reg_ptr(FILE_REG, REG_ONES); - + sse_movups(&cp->func, dst, arg0); sse_cmpps(&cp->func, dst, arg1, cc_LessThan); sse_andps(&cp->func, dst, ones); return GL_TRUE; } -static GLboolean emit_SUB( struct compilation *cp, union instruction op ) +static GLboolean emit_SUB( struct compilation *cp, union instruction op ) { struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); @@ -1038,7 +1038,7 @@ static GLboolean emit_SUB( struct compilation *cp, union instruction op ) } -static GLboolean emit_XPD( struct compilation *cp, union instruction op ) +static GLboolean emit_XPD( struct compilation *cp, union instruction op ) { struct x86_reg arg0 = get_arg(cp, op.alu.file0, op.alu.idx0); struct x86_reg arg1 = get_arg(cp, op.alu.file1, op.alu.idx1); @@ -1066,13 +1066,13 @@ static GLboolean emit_XPD( struct compilation *cp, union instruction op ) return GL_TRUE; } -static GLboolean emit_NOP( struct compilation *cp, union instruction op ) +static GLboolean emit_NOP( struct compilation *cp, union instruction op ) { return GL_TRUE; } -static GLboolean (* const emit_func[])(struct compilation *, union instruction) = +static GLboolean (* const emit_func[])(struct compilation *, union instruction) = { emit_ABS, emit_ADD, @@ -1122,16 +1122,16 @@ static GLboolean build_vertex_program( struct compilation *cp ) x86_push(&cp->func, regEBX); - x86_mov(&cp->func, regEDX, x86_fn_arg(&cp->func, 1)); + x86_mov(&cp->func, regEDX, x86_fn_arg(&cp->func, 1)); x86_mov(&cp->func, regEBX, x86_make_disp(regEDX, get_offset(m, m->File + FILE_REG))); x86_mov(&cp->func, regECX, x86_make_disp(regEDX, get_offset(m, m->File + FILE_STATE_PARAM))); for (j = 0; j < cp->p->nr_instructions; j++) { - union instruction inst = cp->p->instructions[j]; + union instruction inst = cp->p->instructions[j]; cp->insn_counter = j+1; /* avoid zero */ - + if (DISASSEM) { - _mesa_printf("%p: ", cp->func.csr); + _mesa_printf("%p: ", cp->func.csr); _tnl_disassem_vba_insn( inst ); } cp->func.fn = NULL; @@ -1144,10 +1144,10 @@ static GLboolean build_vertex_program( struct compilation *cp ) /* TODO: only for outputs: */ for (j = 0; j < 8; j++) { - if (cp->xmm[j].dirty) + if (cp->xmm[j].dirty) spill(cp, j); } - + /* Exit mmx state? */ @@ -1168,8 +1168,8 @@ static GLboolean build_vertex_program( struct compilation *cp ) } /** - * Execute the given vertex program. - * + * Execute the given vertex program. + * * TODO: Integrate the t_vertex.c code here, to build machine vertices * directly at this point. * @@ -1180,7 +1180,7 @@ GLboolean _tnl_sse_codegen_vertex_program(struct tnl_compiled_program *p) { struct compilation cp; - + memset(&cp, 0, sizeof(cp)); cp.p = p; cp.have_sse2 = 1; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_cull.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_cull.c index 3f12945707f..7452ba112d1 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_cull.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_cull.c @@ -58,14 +58,14 @@ static GLboolean run_cull_stage( GLcontext *ctx, GLuint i; if (ctx->VertexProgram._Enabled || - !ctx->Transform.CullVertexFlag) + !ctx->Transform.CullVertexFlag) return GL_TRUE; VB->ClipOrMask &= ~CLIP_CULL_BIT; VB->ClipAndMask |= CLIP_CULL_BIT; for (i = 0 ; i < count ; i++) { - GLfloat dp = (norm[0] * a + + GLfloat dp = (norm[0] * a + norm[1] * b + norm[2] * c); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_light.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_light.c index 1deab4d43a6..bf03a1968ec 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_light.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_light.c @@ -96,7 +96,7 @@ update_materials(GLcontext *ctx, struct light_stage_data *store) /* increment src vertex color pointer */ STRIDE_F(store->mat[i].ptr, store->mat[i].stride); } - + /* recompute derived light/material values */ _mesa_update_material( ctx, store->mat_bitmask ); /* XXX we should only call this if we're tracking/changing the specular @@ -115,7 +115,7 @@ prepare_materials(GLcontext *ctx, struct vertex_buffer *VB, struct light_stage_data *store) { GLuint i; - + store->mat_count = 0; store->mat_bitmask = 0; @@ -194,7 +194,7 @@ static void init_lighting_tables( void ) } -static GLboolean run_lighting( GLcontext *ctx, +static GLboolean run_lighting( GLcontext *ctx, struct tnl_pipeline_stage *stage ) { struct light_stage_data *store = LIGHT_STAGE_DATA(stage); @@ -223,7 +223,7 @@ static GLboolean run_lighting( GLcontext *ctx, */ _mesa_vector4f_clean_elem(&store->Input, VB->Count, 2); } - + if (input->size <= 1) { /* Clean y. */ @@ -232,7 +232,7 @@ static GLboolean run_lighting( GLcontext *ctx, input = &store->Input; } - + idx = 0; if (prepare_materials( ctx, VB, store )) @@ -242,7 +242,7 @@ static GLboolean run_lighting( GLcontext *ctx, idx |= LIGHT_TWOSIDE; /* The individual functions know about replaying side-effects - * vs. full re-execution. + * vs. full re-execution. */ store->light_func_tab[idx]( ctx, VB, stage, input ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_program.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_program.c index d77f5424c14..87c1f6caad2 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_program.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_program.c @@ -163,7 +163,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->attribs[VERT_RESULT_PSIZ]; for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = + VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = &store->attribs[VERT_RESULT_TEX0 + i]; } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_render.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_render.c index 8c92ac0db9e..ab8b72cd991 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_render.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_render.c @@ -299,8 +299,8 @@ static GLboolean run_render( GLcontext *ctx, clip_render_tab_elts[GL_TRIANGLES] = clip_elt_triangles; } else { - tab = (VB->Elts ? - tnl->Driver.Render.PrimTabElts : + tab = (VB->Elts ? + tnl->Driver.Render.PrimTabElts : tnl->Driver.Render.PrimTabVerts); } @@ -316,9 +316,9 @@ static GLboolean run_render( GLcontext *ctx, assert((prim & PRIM_MODE_MASK) < GL_POLYGON+1); - if (MESA_VERBOSE & VERBOSE_PRIMS) - _mesa_debug(NULL, "MESA prim %s %d..%d\n", - _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK), + if (MESA_VERBOSE & VERBOSE_PRIMS) + _mesa_debug(NULL, "MESA prim %s %d..%d\n", + _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK), start, start+length); if (length) diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texgen.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texgen.c index 1af8e2ba484..1e536171073 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texgen.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texgen.c @@ -265,7 +265,7 @@ static void texgen_reflection_map_nv( GLcontext *ctx, out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3; out->count = VB->Count; out->size = MAX2(in->size, 3); - if (in->size == 4) + if (in->size == 4) _mesa_copy_tab[0x8]( out, in ); } @@ -294,7 +294,7 @@ static void texgen_normal_map_nv( GLcontext *ctx, out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_3; out->count = count; out->size = MAX2(in->size, 3); - if (in->size == 4) + if (in->size == 4) _mesa_copy_tab[0x8]( out, in ); } @@ -488,7 +488,7 @@ static GLboolean run_texgen_stage( GLcontext *ctx, struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage); GLuint i; - if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled) + if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled) return GL_TRUE; for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) { @@ -498,7 +498,7 @@ static GLboolean run_texgen_stage( GLcontext *ctx, store->TexgenFunc[i]( ctx, store, i ); - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = + VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = &store->texcoord[i]; } } @@ -513,7 +513,7 @@ static void validate_texgen_stage( GLcontext *ctx, struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage); GLuint i; - if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled) + if (!ctx->Texture._TexGenEnabled || ctx->VertexProgram._Enabled) return; for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) { diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texmat.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texmat.c index 23475303853..5ff4b9d8ebd 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texmat.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_texmat.c @@ -61,7 +61,7 @@ static GLboolean run_texmat_stage( GLcontext *ctx, struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; GLuint i; - if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Enabled) + if (!ctx->Texture._TexMatEnabled || ctx->VertexProgram._Enabled) return GL_TRUE; /* ENABLE_TEXMAT implies that the texture matrix is not the @@ -73,7 +73,7 @@ static GLboolean run_texmat_stage( GLcontext *ctx, ctx->TextureMatrixStack[i].Top, VB->TexCoordPtr[i]); - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = + VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = &store->texcoord[i]; } } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_vertex.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_vertex.c index b3defaad05e..30cb8310a9c 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_vertex.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vb_vertex.c @@ -126,7 +126,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - if (ctx->VertexProgram._Enabled) + if (ctx->VertexProgram._Enabled) return GL_TRUE; if (ctx->_NeedEyeCoords) { @@ -148,7 +148,7 @@ static GLboolean run_vertex_stage( GLcontext *ctx, /* Drivers expect this to be clean to element 4... */ switch (VB->ClipPtr->size) { - case 1: + case 1: /* impossible */ case 2: _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.c index bed3cf1879c..2d3c862a1b8 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.c @@ -42,24 +42,24 @@ static GLboolean match_fastpath( struct tnl_clipspace *vtx, { GLuint j; - if (vtx->attr_count != fp->attr_count) + if (vtx->attr_count != fp->attr_count) return GL_FALSE; - for (j = 0; j < vtx->attr_count; j++) + for (j = 0; j < vtx->attr_count; j++) if (vtx->attr[j].format != fp->attr[j].format || vtx->attr[j].inputsize != fp->attr[j].size || - vtx->attr[j].vertoffset != fp->attr[j].offset) + vtx->attr[j].vertoffset != fp->attr[j].offset) return GL_FALSE; - + if (fp->match_strides) { if (vtx->vertex_size != fp->vertex_size) return GL_FALSE; - for (j = 0; j < vtx->attr_count; j++) - if (vtx->attr[j].inputstride != fp->attr[j].stride) + for (j = 0; j < vtx->attr_count; j++) + if (vtx->attr[j].inputstride != fp->attr[j].stride) return GL_FALSE; } - + return GL_TRUE; } @@ -121,7 +121,7 @@ static void choose_emit_func( GLcontext *ctx, GLuint count, GLubyte *dest) } vtx->emit = NULL; - + /* Does this match an existing (hardwired, codegen or known-bad) * fastpath? */ @@ -156,7 +156,7 @@ static void choose_interp_func( GLcontext *ctx, { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - if (vtx->need_extras && + if (vtx->need_extras && (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { vtx->interp = _tnl_generic_interp_extras; } else { @@ -171,7 +171,7 @@ static void choose_copy_pv_func( GLcontext *ctx, GLuint edst, GLuint esrc ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - if (vtx->need_extras && + if (vtx->need_extras && (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { vtx->copy_pv = _tnl_generic_copy_pv_extras; } else { @@ -277,7 +277,7 @@ static void invalidate_funcs( struct tnl_clipspace *vtx ) } GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, - GLuint nr, const GLfloat *vp, + GLuint nr, const GLfloat *vp, GLuint unpacked_size ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); @@ -298,8 +298,8 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, const GLuint format = map[i].format; if (format == EMIT_PAD) { if (DBG) - _mesa_printf("%d: pad %d, offset %d\n", i, - map[i].offset, offset); + _mesa_printf("%d: pad %d, offset %d\n", i, + map[i].offset, offset); offset += map[i].offset; @@ -307,7 +307,7 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, else { GLuint tmpoffset; - if (unpacked_size) + if (unpacked_size) tmpoffset = map[i].offset; else tmpoffset = offset; @@ -327,11 +327,11 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, vtx->attr[j].vertoffset = tmpoffset; } - + if (DBG) - _mesa_printf("%d: %s, vp %p, offset %d\n", i, + _mesa_printf("%d: %s, vp %p, offset %d\n", i, _tnl_format_info[format].name, (void *)vp, - vtx->attr[j].vertoffset); + vtx->attr[j].vertoffset); offset += _tnl_format_info[format].attrsize; j++; @@ -374,7 +374,7 @@ static void update_input_ptrs( GLcontext *ctx, GLuint start ) struct tnl_clipspace_attr *a = vtx->attr; const GLuint count = vtx->attr_count; GLuint j; - + for (j = 0; j < count; j++) { GLvector4f *vptr = VB->AttribPtr[a[j].attrib]; @@ -385,7 +385,7 @@ static void update_input_ptrs( GLcontext *ctx, GLuint start ) a[j].inputptr = ((GLubyte *)vptr->data) + start * vptr->stride; } - + if (a->vp) { vtx->vp_scale[0] = a->vp[MAT_SX]; vtx->vp_scale[1] = a->vp[MAT_SY]; @@ -404,10 +404,10 @@ void _tnl_build_vertices( GLcontext *ctx, GLuint end, GLuint newinputs ) { - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - update_input_ptrs( ctx, start ); - vtx->emit( ctx, end - start, - (GLubyte *)(vtx->vertex_buf + + struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); + update_input_ptrs( ctx, start ); + vtx->emit( ctx, end - start, + (GLubyte *)(vtx->vertex_buf + start * vtx->vertex_size)); } @@ -425,16 +425,16 @@ void *_tnl_emit_vertices_to_buffer( GLcontext *ctx, /* Note: dest should not be adjusted for non-zero 'start' values: */ - vtx->emit( ctx, end - start, dest ); + vtx->emit( ctx, end - start, dest ); return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start)); } -void _tnl_init_vertices( GLcontext *ctx, +void _tnl_init_vertices( GLcontext *ctx, GLuint vb_size, GLuint max_vertex_size ) { - struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); + struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); _tnl_install_attrs( ctx, NULL, 0, NULL, 0 ); @@ -490,13 +490,13 @@ void _tnl_free_vertices( GLcontext *ctx ) ALIGN_FREE(vtx->vertex_buf); vtx->vertex_buf = NULL; } - + for (fp = vtx->fastpath ; fp ; fp = tmp) { tmp = fp->next; FREE(fp->attr); FREE((void *)fp->func); FREE(fp); } - + vtx->fastpath = NULL; } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.h b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.h index fda8f151d3e..362988843ff 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex.h @@ -32,7 +32,7 @@ #include "t_context.h" /* New mechanism to specify hardware vertices so that tnl can build - * and manipulate them directly. + * and manipulate them directly. */ @@ -97,7 +97,7 @@ extern void _tnl_get_attr( GLcontext *ctx, const void *vertex, GLenum attrib, /* Complementary to the above. */ -extern void _tnl_set_attr( GLcontext *ctx, void *vout, GLenum attrib, +extern void _tnl_set_attr( GLcontext *ctx, void *vout, GLenum attrib, const GLfloat *src ); @@ -110,7 +110,7 @@ extern GLuint _tnl_install_attrs( GLcontext *ctx, extern void _tnl_free_vertices( GLcontext *ctx ); -extern void _tnl_init_vertices( GLcontext *ctx, +extern void _tnl_init_vertices( GLcontext *ctx, GLuint vb_size, GLuint max_vertex_size ); @@ -141,7 +141,7 @@ void _tnl_register_fastpath( struct tnl_clipspace *vtx, /* t_vertex_generic.c -- Internal functions for t_vertex.c */ -void _tnl_generic_copy_pv_extras( GLcontext *ctx, +void _tnl_generic_copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ); void _tnl_generic_interp_extras( GLcontext *ctx, diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_generic.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_generic.c index 3f944580538..84d6ed8808b 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_generic.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_generic.c @@ -45,7 +45,7 @@ static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[5] * in[1] + vp[13]; out[2] = vp[10] * in[2] + vp[14]; @@ -57,7 +57,7 @@ static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[5] * in[1] + vp[13]; out[2] = vp[10] * in[2] + vp[14]; @@ -69,7 +69,7 @@ static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[5] * in[1] + vp[13]; out[2] = vp[14]; @@ -81,7 +81,7 @@ static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[13]; out[2] = vp[14]; @@ -93,7 +93,7 @@ static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[5] * in[1] + vp[13]; out[2] = vp[10] * in[2] + vp[14]; @@ -104,7 +104,7 @@ static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[5] * in[1] + vp[13]; out[2] = vp[10] * in[2] + vp[14]; @@ -115,7 +115,7 @@ static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[13]; out[2] = vp[14]; @@ -126,7 +126,7 @@ static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[5] * in[1] + vp[13]; } @@ -136,7 +136,7 @@ static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLu { GLfloat *out = (GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[13]; } @@ -150,7 +150,7 @@ static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; @@ -161,7 +161,7 @@ static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; @@ -172,7 +172,7 @@ static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = 0; @@ -183,7 +183,7 @@ static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = 0; out[2] = 0; @@ -194,7 +194,7 @@ static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[3]; @@ -210,7 +210,7 @@ static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; @@ -220,7 +220,7 @@ static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = 0; @@ -230,7 +230,7 @@ static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = 0; out[2] = 0; @@ -241,7 +241,7 @@ static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = in[1]; } @@ -250,7 +250,7 @@ static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, { GLfloat *out = (GLfloat *)(v); (void) a; - + out[0] = in[0]; out[1] = 0; } @@ -268,51 +268,51 @@ static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, (void) a; (void) v; (void) in; } -static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); - UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]); } -static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); - UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); c[3] = CHAN_MAX; } -static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); - UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); c[2] = 0; c[3] = CHAN_MAX; } -static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLchan *c = (GLchan *)v; (void) a; - UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); c[1] = 0; c[2] = 0; c[3] = CHAN_MAX; } -static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -322,7 +322,7 @@ static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); } -static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -332,7 +332,7 @@ static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -342,7 +342,7 @@ static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -352,7 +352,7 @@ static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -362,7 +362,7 @@ static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); } -static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -372,7 +372,7 @@ static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -382,7 +382,7 @@ static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -392,7 +392,7 @@ static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLu v[3] = 0xff; } -static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -402,7 +402,7 @@ static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); } -static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -412,7 +412,7 @@ static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -422,7 +422,7 @@ static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -432,7 +432,7 @@ static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -442,7 +442,7 @@ static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLu UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); } -static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -452,7 +452,7 @@ static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -462,7 +462,7 @@ static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -472,7 +472,7 @@ static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLu v[0] = 0xff; } -static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -481,7 +481,7 @@ static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLub UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); } -static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -490,7 +490,7 @@ static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLub v[2] = 0; } -static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -499,7 +499,7 @@ static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLub v[2] = 0; } -static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -508,7 +508,7 @@ static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLub UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); } -static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -517,7 +517,7 @@ static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLub v[0] = 0; } -static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -527,7 +527,7 @@ static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLub } -static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, +static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; @@ -538,16 +538,16 @@ static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte /*********************************************************************** * Functions to perform the reverse operations to the above, for * swrast translation and clip-interpolation. - * + * * Currently always extracts a full 4 floats. */ -static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; const GLfloat * const vp = a->vp; - + /* Although included for completeness, the position coordinate is * usually handled differently during clipping. */ @@ -557,12 +557,12 @@ static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou out[3] = in[3]; } -static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = (in[0] - vp[12]) / vp[0]; out[1] = (in[1] - vp[13]) / vp[5]; out[2] = (in[2] - vp[14]) / vp[10]; @@ -570,12 +570,12 @@ static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou } -static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; const GLfloat * const vp = a->vp; - + out[0] = (in[0] - vp[12]) / vp[0]; out[1] = (in[1] - vp[13]) / vp[5]; out[2] = 0; @@ -587,7 +587,7 @@ static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; @@ -598,7 +598,7 @@ static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, co { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = 0; @@ -610,7 +610,7 @@ static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; @@ -622,7 +622,7 @@ static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = in[1]; out[2] = 0; @@ -633,14 +633,14 @@ static void extract_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const { const GLfloat *in = (const GLfloat *)v; (void) a; - + out[0] = in[0]; out[1] = 0; out[2] = 0; out[3] = 1; } -static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { GLchan *c = (GLchan *)v; @@ -652,7 +652,7 @@ static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat * out[3] = CHAN_TO_FLOAT(c[3]); } -static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -662,7 +662,7 @@ static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *ou out[3] = UBYTE_TO_FLOAT(v[3]); } -static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -672,7 +672,7 @@ static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *ou out[3] = UBYTE_TO_FLOAT(v[3]); } -static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -682,7 +682,7 @@ static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *ou out[2] = UBYTE_TO_FLOAT(v[3]); } -static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -692,7 +692,7 @@ static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *ou out[0] = UBYTE_TO_FLOAT(v[3]); } -static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -702,7 +702,7 @@ static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out out[3] = 1; } -static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out, +static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { (void) a; @@ -722,7 +722,7 @@ static void extract_1ub_1f( const struct tnl_clipspace_attr *a, GLfloat *out, co } -const struct tnl_format_info _tnl_format_info[EMIT_MAX] = +const struct tnl_format_info _tnl_format_info[EMIT_MAX] = { { "1f", extract_1f, @@ -759,12 +759,12 @@ const struct tnl_format_info _tnl_format_info[EMIT_MAX] = { "4f_viewport", extract_4f_viewport, { insert_4f_viewport_1, insert_4f_viewport_2, insert_4f_viewport_3, - insert_4f_viewport_4 }, + insert_4f_viewport_4 }, 4 * sizeof(GLfloat) }, { "3f_xyw", extract_3f_xyw, - { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err, + { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_4 }, 3 * sizeof(GLfloat) }, @@ -787,7 +787,7 @@ const struct tnl_format_info _tnl_format_info[EMIT_MAX] = { "4ub_4f_rgba", extract_4ub_4f_rgba, - { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3, + { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3, insert_4ub_4f_rgba_4 }, 4 * sizeof(GLubyte) }, @@ -824,7 +824,7 @@ const struct tnl_format_info _tnl_format_info[EMIT_MAX] = - + /*********************************************************************** * Hardwired fastpaths for emitting whole vertices or groups of * vertices @@ -866,16 +866,16 @@ static void NAME( GLcontext *ctx, \ } \ } - + #define EMIT2(F0, F1, NAME) EMIT5(2, F0, F1, insert_null, \ insert_null, insert_null, NAME) #define EMIT3(F0, F1, F2, NAME) EMIT5(3, F0, F1, F2, insert_null, \ insert_null, NAME) - + #define EMIT4(F0, F1, F2, F3, NAME) EMIT5(4, F0, F1, F2, F3, \ insert_null, NAME) - + EMIT2(insert_3f_viewport_3, insert_4ub_4f_rgba_4, emit_viewport3_rgba4) EMIT2(insert_3f_viewport_3, insert_4ub_4f_bgra_4, emit_viewport3_bgra4) @@ -904,14 +904,14 @@ void _tnl_generate_hardwired_emit( GLcontext *ctx ) switch (vtx->attr_count) { case 2: if (vtx->attr[0].emit == insert_3f_viewport_3) { - if (vtx->attr[1].emit == insert_4ub_4f_bgra_4) + if (vtx->attr[1].emit == insert_4ub_4f_bgra_4) func = emit_viewport3_bgra4; - else if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) + else if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) func = emit_viewport3_rgba4; } else if (vtx->attr[0].emit == insert_3f_3 && vtx->attr[1].emit == insert_4ub_4f_rgba_4) { - func = emit_xyz3_rgba4; + func = emit_xyz3_rgba4; } break; case 3: @@ -919,7 +919,7 @@ void _tnl_generate_hardwired_emit( GLcontext *ctx ) if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) { if (vtx->attr[0].emit == insert_4f_viewport_4) func = emit_viewport4_rgba4_st2; - else if (vtx->attr[0].emit == insert_4f_4) + else if (vtx->attr[0].emit == insert_4f_4) func = emit_xyzw4_rgba4_st2; } else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 && @@ -933,7 +933,7 @@ void _tnl_generate_hardwired_emit( GLcontext *ctx ) if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) { if (vtx->attr[0].emit == insert_4f_viewport_4) func = emit_viewport4_rgba4_st2_st2; - else if (vtx->attr[0].emit == insert_4f_4) + else if (vtx->attr[0].emit == insert_4f_4) func = emit_xyzw4_rgba4_st2_st2; } else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 && @@ -1008,7 +1008,7 @@ void _tnl_generic_interp( GLcontext *ctx, for (j = 1; j < attr_count; j++) { GLfloat fin[4], fout[4], fdst[4]; - + a[j].extract( &a[j], fin, vin + a[j].vertoffset ); a[j].extract( &a[j], fout, vout + a[j].vertoffset ); @@ -1072,13 +1072,13 @@ void _tnl_generic_interp_extras( GLcontext *ctx, if (VB->SecondaryColorPtr[1]) { assert(VB->SecondaryColorPtr[1]->stride == 4 * sizeof(GLfloat)); - + INTERP_3F( t, VB->SecondaryColorPtr[1]->data[dst], VB->SecondaryColorPtr[1]->data[out], VB->SecondaryColorPtr[1]->data[in] ); } - + if (VB->IndexPtr[1]) { VB->IndexPtr[1]->data[dst][0] = LINTERP( t, VB->IndexPtr[1]->data[out][0], @@ -1092,7 +1092,7 @@ void _tnl_generic_interp_extras( GLcontext *ctx, _tnl_generic_interp(ctx, t, dst, out, in, force_boundary); } -void _tnl_generic_copy_pv_extras( GLcontext *ctx, +void _tnl_generic_copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; @@ -1100,12 +1100,12 @@ void _tnl_generic_copy_pv_extras( GLcontext *ctx, /* See above comment: */ if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) { - COPY_4FV( VB->ColorPtr[1]->data[dst], + COPY_4FV( VB->ColorPtr[1]->data[dst], VB->ColorPtr[1]->data[src] ); } if (VB->SecondaryColorPtr[1]) { - COPY_4FV( VB->SecondaryColorPtr[1]->data[dst], + COPY_4FV( VB->SecondaryColorPtr[1]->data[dst], VB->SecondaryColorPtr[1]->data[src] ); } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_sse.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_sse.c index 13dc2f4d534..82248fbf7e2 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_sse.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vertex_sse.c @@ -52,7 +52,7 @@ struct x86_program { GLboolean inputs_safe; GLboolean outputs_safe; GLboolean have_sse2; - + struct x86_reg identity; struct x86_reg chan0; }; @@ -63,14 +63,14 @@ static struct x86_reg get_identity( struct x86_program *p ) return p->identity; } -static void emit_load4f_4( struct x86_program *p, +static void emit_load4f_4( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movups(&p->func, dest, arg0); } -static void emit_load4f_3( struct x86_program *p, +static void emit_load4f_3( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -87,7 +87,7 @@ static void emit_load4f_3( struct x86_program *p, sse_movlps(&p->func, dest, arg0); } -static void emit_load4f_2( struct x86_program *p, +static void emit_load4f_2( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -97,7 +97,7 @@ static void emit_load4f_2( struct x86_program *p, sse_movlps(&p->func, dest, arg0); } -static void emit_load4f_1( struct x86_program *p, +static void emit_load4f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -108,7 +108,7 @@ static void emit_load4f_1( struct x86_program *p, -static void emit_load3f_3( struct x86_program *p, +static void emit_load3f_3( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -117,11 +117,11 @@ static void emit_load3f_3( struct x86_program *p, */ if (p->inputs_safe) { sse_movups(&p->func, dest, arg0); - } + } else { /* c 0 0 0 * c c c c - * a b c c + * a b c c */ sse_movss(&p->func, dest, x86_make_disp(arg0, 8)); sse_shufps(&p->func, dest, dest, SHUF(X,X,X,X)); @@ -129,63 +129,63 @@ static void emit_load3f_3( struct x86_program *p, } } -static void emit_load3f_2( struct x86_program *p, +static void emit_load3f_2( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { emit_load4f_2(p, dest, arg0); } -static void emit_load3f_1( struct x86_program *p, +static void emit_load3f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { emit_load4f_1(p, dest, arg0); } -static void emit_load2f_2( struct x86_program *p, +static void emit_load2f_2( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movlps(&p->func, dest, arg0); } -static void emit_load2f_1( struct x86_program *p, +static void emit_load2f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { emit_load4f_1(p, dest, arg0); } -static void emit_load1f_1( struct x86_program *p, +static void emit_load1f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movss(&p->func, dest, arg0); } -static void (*load[4][4])( struct x86_program *p, +static void (*load[4][4])( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) = { - { emit_load1f_1, - emit_load1f_1, - emit_load1f_1, + { emit_load1f_1, + emit_load1f_1, + emit_load1f_1, emit_load1f_1 }, - { emit_load2f_1, - emit_load2f_2, - emit_load2f_2, + { emit_load2f_1, + emit_load2f_2, + emit_load2f_2, emit_load2f_2 }, - { emit_load3f_1, - emit_load3f_2, - emit_load3f_3, + { emit_load3f_1, + emit_load3f_2, + emit_load3f_3, emit_load3f_3 }, - { emit_load4f_1, - emit_load4f_2, - emit_load4f_3, - emit_load4f_4 } + { emit_load4f_1, + emit_load4f_2, + emit_load4f_3, + emit_load4f_4 } }; static void emit_load( struct x86_program *p, @@ -197,14 +197,14 @@ static void emit_load( struct x86_program *p, load[sz-1][src_sz-1](p, dest, src); } -static void emit_store4f( struct x86_program *p, +static void emit_store4f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movups(&p->func, dest, arg0); } -static void emit_store3f( struct x86_program *p, +static void emit_store3f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -223,14 +223,14 @@ static void emit_store3f( struct x86_program *p, } } -static void emit_store2f( struct x86_program *p, +static void emit_store2f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { sse_movlps(&p->func, dest, arg0); } -static void emit_store1f( struct x86_program *p, +static void emit_store1f( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { @@ -238,14 +238,14 @@ static void emit_store1f( struct x86_program *p, } -static void (*store[4])( struct x86_program *p, +static void (*store[4])( struct x86_program *p, struct x86_reg dest, - struct x86_reg arg0 ) = + struct x86_reg arg0 ) = { - emit_store1f, - emit_store2f, - emit_store3f, - emit_store4f + emit_store1f, + emit_store2f, + emit_store3f, + emit_store4f }; static void emit_store( struct x86_program *p, @@ -318,8 +318,8 @@ static void update_src_ptr( struct x86_program *p, * pull the stride value from memory each time). */ x86_lea(&p->func, srcREG, x86_make_disp(srcREG, a->inputstride)); - - /* save new value of a[j].inputptr + + /* save new value of a[j].inputptr */ x86_mov(&p->func, ptr_to_src, srcREG); } @@ -329,8 +329,8 @@ static void update_src_ptr( struct x86_program *p, /* Lots of hardcoding * * EAX -- pointer to current output vertex - * ECX -- pointer to current attribute - * + * ECX -- pointer to current attribute + * */ static GLboolean build_vertex_emit( struct x86_program *p ) { @@ -349,7 +349,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) GLubyte *fixup, *label; x86_init_func(&p->func); - + /* Push a few regs? */ x86_push(&p->func, countEBP); @@ -363,7 +363,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) x86_cmp(&p->func, countEBP, srcECX); fixup = x86_jcc_forward(&p->func, cc_E); - /* Initialize destination register. + /* Initialize destination register. */ x86_mov(&p->func, vertexEAX, x86_fn_arg(&p->func, 3)); @@ -373,7 +373,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) x86_mov(&p->func, vtxESI, x86_make_disp(vtxESI, get_offset(ctx, &ctx->swtnl_context))); vtxESI = x86_make_disp(vtxESI, get_offset(tnl, &tnl->clipspace)); - + /* Possibly load vp0, vp1 for viewport calcs: */ if (vtx->need_viewport) { @@ -444,7 +444,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) emit_store(p, dest, 4, temp); update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_2F_VIEWPORT: + case EMIT_2F_VIEWPORT: get_src_ptr(p, srcECX, vtxESI, a); emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize); sse_mulps(&p->func, temp, vp0); @@ -452,7 +452,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) emit_store(p, dest, 2, temp); update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_3F_VIEWPORT: + case EMIT_3F_VIEWPORT: get_src_ptr(p, srcECX, vtxESI, a); emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize); sse_mulps(&p->func, temp, vp0); @@ -460,7 +460,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) emit_store(p, dest, 3, temp); update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_4F_VIEWPORT: + case EMIT_4F_VIEWPORT: get_src_ptr(p, srcECX, vtxESI, a); emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize); sse_mulps(&p->func, temp, vp0); @@ -476,7 +476,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) update_src_ptr(p, srcECX, vtxESI, a); break; - case EMIT_1UB_1F: + case EMIT_1UB_1F: /* Test for PAD3 + 1UB: */ if (j > 0 && @@ -590,7 +590,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) _mesa_printf("unknown a[%d].format %d\n", j, a->format); return GL_FALSE; /* catch any new opcodes */ } - + /* Increment j by at least 1 - may have been incremented above also: */ j++; @@ -603,7 +603,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) /* decr count, loop if not zero */ x86_dec(&p->func, countEBP); - x86_test(&p->func, countEBP, countEBP); + x86_test(&p->func, countEBP, countEBP); x86_jcc(&p->func, cc_NZ, label); /* Exit mmx state? @@ -630,7 +630,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) void _tnl_generate_sse_emit( GLcontext *ctx ) { struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); - struct x86_program p; + struct x86_program p; if (!cpu_has_xmm) { vtx->codegen_emit = NULL; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vp_build.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vp_build.c index e62c5b374c2..09627c30f5e 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vp_build.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vp_build.c @@ -62,7 +62,7 @@ struct state_key { unsigned light_enabled:1; unsigned light_eyepos3_is_zero:1; unsigned light_spotcutoff_is_180:1; - unsigned light_attenuated:1; + unsigned light_attenuated:1; unsigned texunit_really_enabled:1; unsigned texmat_enabled:1; unsigned texgen_enabled:4; @@ -136,8 +136,8 @@ static struct state_key *make_state_key( GLcontext *ctx ) key->light_color_material_mask = ctx->Light.ColorMaterialBitmask; } - for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT ; i < _TNL_ATTRIB_INDEX ; i++) - if (VB->AttribPtr[i]->stride) + for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT ; i < _TNL_ATTRIB_INDEX ; i++) + if (VB->AttribPtr[i]->stride) key->light_material_mask |= 1<<(i-_TNL_ATTRIB_MAT_FRONT_AMBIENT); for (i = 0; i < MAX_LIGHTS; i++) { @@ -148,7 +148,7 @@ static struct state_key *make_state_key( GLcontext *ctx ) if (light->EyePosition[3] == 0.0) key->unit[i].light_eyepos3_is_zero = 1; - + if (light->SpotCutoff == 180.0) key->unit[i].light_spotcutoff_is_180 = 1; @@ -186,39 +186,39 @@ static struct state_key *make_state_key( GLcontext *ctx ) ctx->Texture._TexMatEnabled || ctx->Texture._EnabledUnits) key->texture_enabled_global = 1; - + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; if (texUnit->_ReallyEnabled) key->unit[i].texunit_really_enabled = 1; - if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) + if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) key->unit[i].texmat_enabled = 1; - + if (texUnit->TexGenEnabled) { key->unit[i].texgen_enabled = 1; - - key->unit[i].texgen_mode0 = + + key->unit[i].texgen_mode0 = translate_texgen( texUnit->TexGenEnabled & (1<<0), texUnit->GenModeS ); - key->unit[i].texgen_mode1 = + key->unit[i].texgen_mode1 = translate_texgen( texUnit->TexGenEnabled & (1<<1), texUnit->GenModeT ); - key->unit[i].texgen_mode2 = + key->unit[i].texgen_mode2 = translate_texgen( texUnit->TexGenEnabled & (1<<2), texUnit->GenModeR ); - key->unit[i].texgen_mode3 = + key->unit[i].texgen_mode3 = translate_texgen( texUnit->TexGenEnabled & (1<<3), texUnit->GenModeQ ); } } - + return key; } - + /* Very useful debugging tool - produces annotated listing of * generated program with line/function references for each * instruction back into this file: @@ -234,7 +234,7 @@ static struct state_key *make_state_key( GLcontext *ctx ) #define MAX_INSN 200 /* Use uregs to represent registers internally, translate to Mesa's - * expected formats on emit. + * expected formats on emit. * * NOTE: These are passed by value extensively in this file rather * than as usual by pointer reference. If this disturbs you, try @@ -257,10 +257,10 @@ struct ureg { struct tnl_program { const struct state_key *state; struct vertex_program *program; - + GLuint temp_in_use; GLuint temp_reserved; - + struct ureg eye_position; struct ureg eye_position_normalized; struct ureg eye_normal; @@ -271,7 +271,7 @@ struct tnl_program { }; -const static struct ureg undef = { +const static struct ureg undef = { ~0, ~0, 0, @@ -306,7 +306,7 @@ static struct ureg negate( struct ureg reg ) { reg.negate ^= 1; return reg; -} +} static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) @@ -370,7 +370,7 @@ static struct ureg register_output( struct tnl_program *p, GLuint output ) return make_ureg(PROGRAM_OUTPUT, output); } -static struct ureg register_const4f( struct tnl_program *p, +static struct ureg register_const4f( struct tnl_program *p, GLfloat s0, GLfloat s1, GLfloat s2, @@ -398,13 +398,13 @@ static GLboolean is_undef( struct ureg reg ) static struct ureg get_identity_param( struct tnl_program *p ) { - if (is_undef(p->identity)) + if (is_undef(p->identity)) p->identity = register_const4f(p, 0,0,0,1); return p->identity; } -static struct ureg register_param6( struct tnl_program *p, +static struct ureg register_param6( struct tnl_program *p, GLint s0, GLint s1, GLint s2, @@ -445,7 +445,7 @@ static void register_matrix_param6( struct tnl_program *p, /* This is a bit sad as the support is there to pull the whole * matrix out in one go: */ - for (i = 0; i <= s4 - s3; i++) + for (i = 0; i <= s4 - s3; i++) matrix[i] = register_param6( p, s0, s1, s2, i, i, s5 ); } @@ -467,7 +467,7 @@ static void emit_dst( struct vp_dst_register *dst, dst->File = reg.file; dst->Index = reg.idx; /* allow zero as a shorthand for xyzw */ - dst->WriteMask = mask ? mask : WRITEMASK_XYZW; + dst->WriteMask = mask ? mask : WRITEMASK_XYZW; dst->pad = 0; } @@ -476,12 +476,12 @@ static void debug_insn( struct vp_instruction *inst, const char *fn, { if (DISASSEM) { static const char *last_fn; - + if (fn != last_fn) { last_fn = fn; _mesa_printf("%s:\n", fn); } - + _mesa_printf("%d:\t", line); _mesa_debug_vp_inst(1, inst); } @@ -500,19 +500,19 @@ static void emit_op3fn(struct tnl_program *p, { GLuint nr = p->program->Base.NumInstructions++; struct vp_instruction *inst = &p->program->Instructions[nr]; - + if (p->program->Base.NumInstructions > MAX_INSN) { _mesa_problem(0, "Out of instructions in emit_op3fn\n"); return; } - - inst->Opcode = op; + + inst->Opcode = op; inst->StringPos = 0; inst->Data = 0; - + emit_arg( &inst->SrcReg[0], src0 ); emit_arg( &inst->SrcReg[1], src1 ); - emit_arg( &inst->SrcReg[2], src2 ); + emit_arg( &inst->SrcReg[2], src2 ); emit_dst( &inst->DstReg, dest, mask ); @@ -532,7 +532,7 @@ static void emit_op3fn(struct tnl_program *p, static struct ureg make_temp( struct tnl_program *p, struct ureg reg ) { - if (reg.file == PROGRAM_TEMPORARY && + if (reg.file == PROGRAM_TEMPORARY && !(p->temp_reserved & (1<eye_position)) { - struct ureg pos = register_input( p, VERT_ATTRIB_POS ); + struct ureg pos = register_input( p, VERT_ATTRIB_POS ); struct ureg modelview[4]; p->eye_position = reserve_temp(p); if (PREFER_DP4) { - register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3, + register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3, STATE_MATRIX, modelview ); emit_matrix_transform_vec4(p, p->eye_position, modelview, pos); } else { - register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3, + register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3, STATE_MATRIX_TRANSPOSE, modelview ); emit_transpose_matrix_transform_vec4(p, p->eye_position, modelview, pos); } } - + return p->eye_position; } @@ -646,7 +646,7 @@ static struct ureg get_eye_position_normalized( struct tnl_program *p ) p->eye_position_normalized = reserve_temp(p); emit_normalize_vec3(p, p->eye_position_normalized, eye); } - + return p->eye_position_normalized; } @@ -675,7 +675,7 @@ static struct ureg get_eye_normal( struct tnl_program *p ) struct ureg rescale = register_param2(p, STATE_INTERNAL, STATE_NORMAL_SCALE); - emit_op2( p, VP_OPCODE_MUL, p->eye_normal, 0, normal, + emit_op2( p, VP_OPCODE_MUL, p->eye_normal, 0, normal, swizzle1(rescale, X)); } } @@ -687,17 +687,17 @@ static struct ureg get_eye_normal( struct tnl_program *p ) static void build_hpos( struct tnl_program *p ) { - struct ureg pos = register_input( p, VERT_ATTRIB_POS ); + struct ureg pos = register_input( p, VERT_ATTRIB_POS ); struct ureg hpos = register_output( p, VERT_RESULT_HPOS ); struct ureg mvp[4]; if (PREFER_DP4) { - register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3, + register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3, STATE_MATRIX, mvp ); emit_matrix_transform_vec4( p, hpos, mvp, pos ); } else { - register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3, + register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3, STATE_MATRIX_TRANSPOSE, mvp ); emit_transpose_matrix_transform_vec4( p, hpos, mvp, pos ); } @@ -706,7 +706,7 @@ static void build_hpos( struct tnl_program *p ) static GLuint material_attrib( GLuint side, GLuint property ) { - return ((property - STATE_AMBIENT) * 2 + + return ((property - STATE_AMBIENT) * 2 + side); } @@ -716,7 +716,7 @@ static void set_material_flags( struct tnl_program *p ) p->materials = 0; if (p->state->light_color_material) { - p->materials = + p->materials = p->color_materials = p->state->light_color_material_mask; } @@ -724,14 +724,14 @@ static void set_material_flags( struct tnl_program *p ) } -static struct ureg get_material( struct tnl_program *p, GLuint side, +static struct ureg get_material( struct tnl_program *p, GLuint side, GLuint property ) { GLuint attrib = material_attrib(side, property); if (p->color_materials & (1<materials & (1<materials & (1<materials & (1<state->unit[i].light_attenuated) { /* 1/d,d,d,1/d */ - emit_op1(p, VP_OPCODE_RCP, dist, WRITEMASK_YZ, dist); + emit_op1(p, VP_OPCODE_RCP, dist, WRITEMASK_YZ, dist); /* 1,d,d*d,1/d */ - emit_op2(p, VP_OPCODE_MUL, dist, WRITEMASK_XZ, dist, swizzle1(dist,Y)); + emit_op2(p, VP_OPCODE_MUL, dist, WRITEMASK_XZ, dist, swizzle1(dist,Y)); /* 1/dist-atten */ - emit_op2(p, VP_OPCODE_DP3, dist, 0, attenuation, dist); + emit_op2(p, VP_OPCODE_DP3, dist, 0, attenuation, dist); if (!p->state->unit[i].light_spotcutoff_is_180) { /* dist-atten */ - emit_op1(p, VP_OPCODE_RCP, dist, 0, dist); + emit_op1(p, VP_OPCODE_RCP, dist, 0, dist); /* spot-atten * dist-atten */ - emit_op2(p, VP_OPCODE_MUL, att, 0, dist, att); + emit_op2(p, VP_OPCODE_MUL, att, 0, dist, att); } else { /* dist-atten */ - emit_op1(p, VP_OPCODE_RCP, att, 0, dist); + emit_op1(p, VP_OPCODE_RCP, att, 0, dist); } } return att; } - + @@ -856,10 +856,10 @@ static void build_lighting( struct tnl_program *p ) struct ureg _bfc0 = undef, _bfc1 = undef; GLuint i; - for (i = 0; i < MAX_LIGHTS; i++) + for (i = 0; i < MAX_LIGHTS; i++) if (p->state->unit[i].light_enabled) nr_lights++; - + set_material_flags(p); { @@ -877,7 +877,7 @@ static void build_lighting( struct tnl_program *p ) if (twoside) { struct ureg shininess = get_material(p, 1, STATE_SHININESS); - emit_op1(p, VP_OPCODE_MOV, dots, WRITEMASK_Z, + emit_op1(p, VP_OPCODE_MOV, dots, WRITEMASK_Z, negate(swizzle1(shininess,X))); release_temp(p, shininess); @@ -905,12 +905,12 @@ static void build_lighting( struct tnl_program *p ) struct ureg res0 = register_output( p, VERT_RESULT_BFC0 ); emit_op1(p, VP_OPCODE_MOV, res0, 0, _bfc0); } - + if (twoside && separate) { struct ureg res1 = register_output( p, VERT_RESULT_BFC1 ); emit_op1(p, VP_OPCODE_MOV, res1, 0, _bfc1); } - + if (nr_lights == 0) { release_temps(p); return; @@ -921,29 +921,29 @@ static void build_lighting( struct tnl_program *p ) if (p->state->unit[i].light_enabled) { struct ureg half = undef; struct ureg att = undef, VPpli = undef; - + count++; if (p->state->unit[i].light_eyepos3_is_zero) { /* Can used precomputed constants in this case. * Attenuation never applies to infinite lights. */ - VPpli = register_param3(p, STATE_LIGHT, i, - STATE_POSITION_NORMALIZED); + VPpli = register_param3(p, STATE_LIGHT, i, + STATE_POSITION_NORMALIZED); half = register_param3(p, STATE_LIGHT, i, STATE_HALF); - } + } else { - struct ureg Ppli = register_param3(p, STATE_LIGHT, i, - STATE_POSITION); + struct ureg Ppli = register_param3(p, STATE_LIGHT, i, + STATE_POSITION); struct ureg V = get_eye_position(p); struct ureg dist = get_temp(p); - VPpli = get_temp(p); + VPpli = get_temp(p); half = get_temp(p); - + /* Calulate VPpli vector */ - emit_op2(p, VP_OPCODE_SUB, VPpli, 0, Ppli, V); + emit_op2(p, VP_OPCODE_SUB, VPpli, 0, Ppli, V); /* Normalize VPpli. The dist value also used in * attenuation below. @@ -954,13 +954,13 @@ static void build_lighting( struct tnl_program *p ) /* Calculate attenuation: - */ + */ if (!p->state->unit[i].light_spotcutoff_is_180 || p->state->unit[i].light_attenuated) { att = calculate_light_attenuation(p, i, VPpli, dist); } - - + + /* Calculate viewer direction, or use infinite viewer: */ if (p->state->light_local_viewer) { @@ -968,7 +968,7 @@ static void build_lighting( struct tnl_program *p ) emit_op2(p, VP_OPCODE_SUB, half, 0, VPpli, eye_hat); } else { - struct ureg z_dir = swizzle(get_identity_param(p),X,Y,W,Z); + struct ureg z_dir = swizzle(get_identity_param(p),X,Y,W,Z); emit_op2(p, VP_OPCODE_ADD, half, 0, VPpli, z_dir); } @@ -982,7 +982,7 @@ static void build_lighting( struct tnl_program *p ) emit_op2(p, VP_OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli); emit_op2(p, VP_OPCODE_DP3, dots, WRITEMASK_Y, normal, half); - + /* Front face lighting: */ { @@ -993,11 +993,11 @@ static void build_lighting( struct tnl_program *p ) GLuint mask0, mask1; emit_op1(p, VP_OPCODE_LIT, lit, 0, dots); - - if (!is_undef(att)) + + if (!is_undef(att)) emit_op2(p, VP_OPCODE_MUL, lit, 0, lit, att); - - + + if (count == nr_lights) { if (separate) { mask0 = WRITEMASK_XYZ; @@ -1021,7 +1021,7 @@ static void build_lighting( struct tnl_program *p ) emit_op3(p, VP_OPCODE_MAD, _col0, 0, swizzle1(lit,X), ambient, _col0); emit_op3(p, VP_OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _col0); emit_op3(p, VP_OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _col1); - + release_temp(p, ambient); release_temp(p, diffuse); release_temp(p, specular); @@ -1035,10 +1035,10 @@ static void build_lighting( struct tnl_program *p ) struct ureg specular = get_lightprod(p, i, 1, STATE_SPECULAR); struct ureg res0, res1; GLuint mask0, mask1; - + emit_op1(p, VP_OPCODE_LIT, lit, 0, negate(swizzle(dots,X,Y,W,Z))); - if (!is_undef(att)) + if (!is_undef(att)) emit_op2(p, VP_OPCODE_MUL, lit, 0, lit, att); if (count == nr_lights) { @@ -1084,7 +1084,7 @@ static void build_fog( struct tnl_program *p ) { struct ureg fog = register_output(p, VERT_RESULT_FOGC); struct ureg input; - + if (p->state->fog_source_is_depth) { input = swizzle1(get_eye_position(p), Z); } @@ -1099,37 +1099,37 @@ static void build_fog( struct tnl_program *p ) switch (p->state->fog_mode) { case FOG_LINEAR: { struct ureg id = get_identity_param(p); - emit_op2(p, VP_OPCODE_SUB, tmp, 0, swizzle1(params,Z), input); - emit_op2(p, VP_OPCODE_MUL, tmp, 0, tmp, swizzle1(params,W)); + emit_op2(p, VP_OPCODE_SUB, tmp, 0, swizzle1(params,Z), input); + emit_op2(p, VP_OPCODE_MUL, tmp, 0, tmp, swizzle1(params,W)); emit_op2(p, VP_OPCODE_MAX, tmp, 0, tmp, swizzle1(id,X)); /* saturate */ emit_op2(p, VP_OPCODE_MIN, fog, WRITEMASK_X, tmp, swizzle1(id,W)); break; } case FOG_EXP: - emit_op1(p, VP_OPCODE_ABS, tmp, 0, input); - emit_op2(p, VP_OPCODE_MUL, tmp, 0, tmp, swizzle1(params,X)); - emit_op2(p, VP_OPCODE_POW, fog, WRITEMASK_X, - register_const1f(p, M_E), negate(tmp)); + emit_op1(p, VP_OPCODE_ABS, tmp, 0, input); + emit_op2(p, VP_OPCODE_MUL, tmp, 0, tmp, swizzle1(params,X)); + emit_op2(p, VP_OPCODE_POW, fog, WRITEMASK_X, + register_const1f(p, M_E), negate(tmp)); break; case FOG_EXP2: - emit_op2(p, VP_OPCODE_MUL, tmp, 0, input, swizzle1(params,X)); - emit_op2(p, VP_OPCODE_MUL, tmp, 0, tmp, tmp); - emit_op2(p, VP_OPCODE_POW, fog, WRITEMASK_X, - register_const1f(p, M_E), negate(tmp)); + emit_op2(p, VP_OPCODE_MUL, tmp, 0, input, swizzle1(params,X)); + emit_op2(p, VP_OPCODE_MUL, tmp, 0, tmp, tmp); + emit_op2(p, VP_OPCODE_POW, fog, WRITEMASK_X, + register_const1f(p, M_E), negate(tmp)); break; } - + release_temp(p, tmp); } else { - /* results = incoming fog coords (compute fog per-fragment later) + /* results = incoming fog coords (compute fog per-fragment later) * * KW: Is it really necessary to do anything in this case? */ emit_op1(p, VP_OPCODE_MOV, fog, WRITEMASK_X, input); } } - + static void build_reflect_texgen( struct tnl_program *p, struct ureg dest, GLuint writemask ) @@ -1139,9 +1139,9 @@ static void build_reflect_texgen( struct tnl_program *p, struct ureg tmp = get_temp(p); /* n.u */ - emit_op2(p, VP_OPCODE_DP3, tmp, 0, normal, eye_hat); + emit_op2(p, VP_OPCODE_DP3, tmp, 0, normal, eye_hat); /* 2n.u */ - emit_op2(p, VP_OPCODE_ADD, tmp, 0, tmp, tmp); + emit_op2(p, VP_OPCODE_ADD, tmp, 0, tmp, tmp); /* (-2n.u)n + u */ emit_op3(p, VP_OPCODE_MAD, dest, writemask, negate(tmp), normal, eye_hat); } @@ -1167,22 +1167,22 @@ static void build_sphere_texgen( struct tnl_program *p, */ /* n.u */ - emit_op2(p, VP_OPCODE_DP3, tmp, 0, normal, eye_hat); + emit_op2(p, VP_OPCODE_DP3, tmp, 0, normal, eye_hat); /* 2n.u */ - emit_op2(p, VP_OPCODE_ADD, tmp, 0, tmp, tmp); + emit_op2(p, VP_OPCODE_ADD, tmp, 0, tmp, tmp); /* (-2n.u)n + u */ - emit_op3(p, VP_OPCODE_MAD, r, 0, negate(tmp), normal, eye_hat); + emit_op3(p, VP_OPCODE_MAD, r, 0, negate(tmp), normal, eye_hat); /* r + 0,0,1 */ - emit_op2(p, VP_OPCODE_ADD, tmp, 0, r, swizzle(id,X,Y,W,Z)); + emit_op2(p, VP_OPCODE_ADD, tmp, 0, r, swizzle(id,X,Y,W,Z)); /* rx^2 + ry^2 + (rz+1)^2 */ - emit_op2(p, VP_OPCODE_DP3, tmp, 0, tmp, tmp); + emit_op2(p, VP_OPCODE_DP3, tmp, 0, tmp, tmp); /* 2/m */ - emit_op1(p, VP_OPCODE_RSQ, tmp, 0, tmp); + emit_op1(p, VP_OPCODE_RSQ, tmp, 0, tmp); /* 1/m */ - emit_op2(p, VP_OPCODE_MUL, inv_m, 0, tmp, half); + emit_op2(p, VP_OPCODE_MUL, inv_m, 0, tmp, half); /* r/m + 1/2 */ - emit_op3(p, VP_OPCODE_MAD, dest, writemask, r, inv_m, half); - + emit_op3(p, VP_OPCODE_MAD, dest, writemask, r, inv_m, half); + release_temp(p, tmp); release_temp(p, r); release_temp(p, inv_m); @@ -1206,8 +1206,8 @@ static void build_texture_transform( struct tnl_program *p ) GLuint reflect_mask = 0; GLuint normal_mask = 0; GLuint modes[4]; - - if (texmat_enabled) + + if (texmat_enabled) out_texgen = get_temp(p); else out_texgen = out; @@ -1221,31 +1221,31 @@ static void build_texture_transform( struct tnl_program *p ) switch (modes[j]) { case TXG_OBJ_LINEAR: { struct ureg obj = register_input(p, VERT_ATTRIB_POS); - struct ureg plane = + struct ureg plane = register_param3(p, STATE_TEXGEN, i, STATE_TEXGEN_OBJECT_S + j); - emit_op2(p, VP_OPCODE_DP4, out_texgen, WRITEMASK_X << j, + emit_op2(p, VP_OPCODE_DP4, out_texgen, WRITEMASK_X << j, obj, plane ); break; } case TXG_EYE_LINEAR: { struct ureg eye = get_eye_position(p); - struct ureg plane = - register_param3(p, STATE_TEXGEN, i, + struct ureg plane = + register_param3(p, STATE_TEXGEN, i, STATE_TEXGEN_EYE_S + j); - emit_op2(p, VP_OPCODE_DP4, out_texgen, WRITEMASK_X << j, + emit_op2(p, VP_OPCODE_DP4, out_texgen, WRITEMASK_X << j, eye, plane ); break; } - case TXG_SPHERE_MAP: + case TXG_SPHERE_MAP: sphere_mask |= WRITEMASK_X << j; break; case TXG_REFLECTION_MAP: reflect_mask |= WRITEMASK_X << j; break; - case TXG_NORMAL_MAP: + case TXG_NORMAL_MAP: normal_mask |= WRITEMASK_X << j; break; case TXG_NONE: @@ -1254,7 +1254,7 @@ static void build_texture_transform( struct tnl_program *p ) } - + if (sphere_mask) { build_sphere_texgen(p, out_texgen, sphere_mask); } @@ -1276,26 +1276,26 @@ static void build_texture_transform( struct tnl_program *p ) if (texmat_enabled) { struct ureg texmat[4]; - struct ureg in = (!is_undef(out_texgen) ? - out_texgen : + struct ureg in = (!is_undef(out_texgen) ? + out_texgen : register_input(p, VERT_ATTRIB_TEX0+i)); if (PREFER_DP4) { - register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i, + register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i, 0, 3, STATE_MATRIX, texmat ); emit_matrix_transform_vec4( p, out, texmat, in ); } else { - register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i, + register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i, 0, 3, STATE_MATRIX_TRANSPOSE, texmat ); emit_transpose_matrix_transform_vec4( p, out, texmat, in ); } } release_temps(p); - } + } else if (p->state->unit[i].texunit_really_enabled) { /* KW: _ReallyEnabled isn't sufficient? Need to know whether - * this texture unit is referenced by the fragment shader. + * this texture unit is referenced by the fragment shader. */ emit_passthrough(p, VERT_ATTRIB_TEX0+i, VERT_RESULT_TEX0+i); } @@ -1313,7 +1313,7 @@ static void build_pointsize( struct tnl_program *p ) struct ureg out = register_output(p, VERT_RESULT_PSIZ); struct ureg ut = get_temp(p); - /* 1, -Z, Z * Z, 1 */ + /* 1, -Z, Z * Z, 1 */ emit_op1(p, VP_OPCODE_MOV, ut, 0, swizzle1(get_identity_param(p), W)); emit_op2(p, VP_OPCODE_MUL, ut, WRITEMASK_YZ, ut, negate(swizzle1(eye, Z))); emit_op2(p, VP_OPCODE_MUL, ut, WRITEMASK_Z, ut, negate(swizzle1(eye, Z))); @@ -1323,10 +1323,10 @@ static void build_pointsize( struct tnl_program *p ) emit_op2(p, VP_OPCODE_DP3, ut, 0, ut, state_attenuation); /* 1 / factor */ - emit_op1(p, VP_OPCODE_RCP, ut, 0, ut ); + emit_op1(p, VP_OPCODE_RCP, ut, 0, ut ); /* out = pointSize / factor */ - emit_op2(p, VP_OPCODE_MUL, out, WRITEMASK_X, ut, state_size); + emit_op2(p, VP_OPCODE_MUL, out, WRITEMASK_X, ut, state_size); release_temp(p, ut); } @@ -1379,7 +1379,7 @@ create_new_program( const struct state_key *key, p.eye_normal = undef; p.identity = undef; p.temp_in_use = 0; - + if (max_temps >= sizeof(int) * 8) p.temp_reserved = 0; else @@ -1457,7 +1457,7 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) */ ctx->_TnlProgram = (struct vertex_program *) search_cache( tnl->vp_cache, hash, key, sizeof(*key) ); - + /* OK, we'll have to build a new one: */ if (!ctx->_TnlProgram) { @@ -1465,16 +1465,16 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) _mesa_printf("Build new TNL program\n"); ctx->_TnlProgram = (struct vertex_program *) - ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); + ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); - create_new_program( key, ctx->_TnlProgram, + create_new_program( key, ctx->_TnlProgram, ctx->Const.MaxVertexProgramTemps ); cache_item(&tnl->vp_cache, hash, key, ctx->_TnlProgram ); } else { FREE(key); - if (0) + if (0) _mesa_printf("Found existing TNL program for key %x\n", hash); } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.c index fa9e04ad336..07fc33cfa26 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.c @@ -52,12 +52,12 @@ static tnl_attrfv_func generic_attr_func[_TNL_MAX_ATTR_CODEGEN][4]; /* Close off the last primitive, execute the buffer, restart the - * primitive. + * primitive. */ static void _tnl_wrap_buffers( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); - + if (tnl->vtx.prim_count == 0) { tnl->vtx.copied.nr = 0; @@ -71,8 +71,8 @@ static void _tnl_wrap_buffers( GLcontext *ctx ) if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { GLint i = tnl->vtx.prim_count - 1; assert(i >= 0); - tnl->vtx.prim[i].count = ((tnl->vtx.initial_counter - - tnl->vtx.counter) - + tnl->vtx.prim[i].count = ((tnl->vtx.initial_counter - + tnl->vtx.counter) - tnl->vtx.prim[i].start); } @@ -96,7 +96,7 @@ static void _tnl_wrap_buffers( GLcontext *ctx ) tnl->vtx.prim[0].start = 0; tnl->vtx.prim[0].count = 0; tnl->vtx.prim_count++; - + if (tnl->vtx.copied.nr == last_count) tnl->vtx.prim[0].mode |= last_prim & PRIM_BEGIN; } @@ -119,13 +119,13 @@ void GLAPIENTRY _tnl_wrap_filled_vertex( GLcontext *ctx ) * to tnl->copied. */ _tnl_wrap_buffers( ctx ); - - /* Copy stored stored vertices to start of new list. + + /* Copy stored stored vertices to start of new list. */ assert(tnl->vtx.counter > tnl->vtx.copied.nr); for (i = 0 ; i < tnl->vtx.copied.nr ; i++) { - _mesa_memcpy( tnl->vtx.vbptr, data, + _mesa_memcpy( tnl->vtx.vbptr, data, tnl->vtx.vertex_size * sizeof(GLfloat)); tnl->vtx.vbptr += tnl->vtx.vertex_size; data += tnl->vtx.vertex_size; @@ -141,7 +141,7 @@ void GLAPIENTRY _tnl_wrap_filled_vertex( GLcontext *ctx ) */ static void _tnl_copy_to_current( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint i; for (i = _TNL_ATTRIB_POS+1 ; i < _TNL_ATTRIB_INDEX ; i++) { @@ -149,8 +149,8 @@ static void _tnl_copy_to_current( GLcontext *ctx ) /* Note: the tnl->vtx.current[i] pointers points to * the ctx->Current fields. The first 16 or so, anyway. */ - COPY_CLEAN_4V(tnl->vtx.current[i], - tnl->vtx.attrsz[i], + COPY_CLEAN_4V(tnl->vtx.current[i], + tnl->vtx.attrsz[i], tnl->vtx.attrptr[i]); } } @@ -165,36 +165,36 @@ static void _tnl_copy_to_current( GLcontext *ctx ) /* Edgeflag requires additional treatment: */ if (tnl->vtx.attrsz[_TNL_ATTRIB_EDGEFLAG]) { - ctx->Current.EdgeFlag = + ctx->Current.EdgeFlag = (tnl->vtx.CurrentFloatEdgeFlag == 1.0); } /* Colormaterial -- this kindof sucks. */ if (ctx->Light.ColorMaterialEnabled) { - _mesa_update_color_material(ctx, + _mesa_update_color_material(ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); } if (tnl->vtx.have_materials) { tnl->Driver.NotifyMaterialChange( ctx ); } - + ctx->Driver.NeedFlush &= ~FLUSH_UPDATE_CURRENT; } static void _tnl_copy_from_current( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLint i; /* Edgeflag requires additional treatment: */ - tnl->vtx.CurrentFloatEdgeFlag = + tnl->vtx.CurrentFloatEdgeFlag = (GLfloat)ctx->Current.EdgeFlag; - - for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_MAX ; i++) + + for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_MAX ; i++) switch (tnl->vtx.attrsz[i]) { case 4: tnl->vtx.attrptr[i][3] = tnl->vtx.current[i][3]; case 3: tnl->vtx.attrptr[i][2] = tnl->vtx.current[i][2]; @@ -208,12 +208,12 @@ static void _tnl_copy_from_current( GLcontext *ctx ) /* Flush existing data, set new attrib size, replay copied vertices. - */ -static void _tnl_wrap_upgrade_vertex( GLcontext *ctx, + */ +static void _tnl_wrap_upgrade_vertex( GLcontext *ctx, GLuint attr, GLuint newsz ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint oldsz; GLuint i; GLfloat *tmp; @@ -227,7 +227,7 @@ static void _tnl_wrap_upgrade_vertex( GLcontext *ctx, /* Do a COPY_TO_CURRENT to ensure back-copying works for the case * when the attribute already exists in the vertex and is having - * its size increased. + * its size increased. */ _tnl_copy_to_current( ctx ); @@ -236,7 +236,7 @@ static void _tnl_wrap_upgrade_vertex( GLcontext *ctx, * begin/end so that they don't bloat the vertices. */ if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END && - tnl->vtx.attrsz[attr] == 0 && + tnl->vtx.attrsz[attr] == 0 && lastcount > 8 && tnl->vtx.vertex_size) { reset_attrfv( tnl ); @@ -261,7 +261,7 @@ static void _tnl_wrap_upgrade_vertex( GLcontext *ctx, tnl->vtx.attrptr[i] = tmp; tmp += tnl->vtx.attrsz[i]; } - else + else tnl->vtx.attrptr[i] = NULL; /* will not be dereferenced */ } @@ -312,7 +312,7 @@ static void _tnl_wrap_upgrade_vertex( GLcontext *ctx, * codegen. Might be a reasonable place to try & detect attributes * in the vertex which aren't being submitted any more. */ - for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) + for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) if (tnl->vtx.attrsz[i]) { GLuint j = tnl->vtx.attrsz[i] - 1; @@ -347,9 +347,9 @@ static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) * vtxfmt on each flush (otherwise flags won't get reset * afterwards). */ - if (attr == 0) + if (attr == 0) ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; - else + else ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; } @@ -360,7 +360,7 @@ static struct _tnl_dynfn *lookup( struct _tnl_dynfn *l, GLuint key ) struct _tnl_dynfn *f; foreach( f, l ) { - if (f->key == key) + if (f->key == key) return f; } @@ -370,7 +370,7 @@ static struct _tnl_dynfn *lookup( struct _tnl_dynfn *l, GLuint key ) static tnl_attrfv_func do_codegen( GLcontext *ctx, GLuint attr, GLuint sz ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); struct _tnl_dynfn *dfn = NULL; if (attr == 0) { @@ -390,7 +390,7 @@ static tnl_attrfv_func do_codegen( GLcontext *ctx, GLuint attr, GLuint sz ) dfn = tnl->vtx.gen.Attribute[sz-1]( ctx, key ); } - if (dfn) + if (dfn) return *(tnl_attrfv_func *) &dfn->code; else return NULL; @@ -403,21 +403,21 @@ static tnl_attrfv_func do_codegen( GLcontext *ctx, GLuint attr, GLuint sz ) */ static tnl_attrfv_func do_choose( GLuint attr, GLuint sz ) -{ - GET_CURRENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); +{ + GET_CURRENT_CONTEXT( ctx ); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint oldsz = tnl->vtx.attrsz[attr]; assert(attr < _TNL_MAX_ATTR_CODEGEN); if (oldsz != sz) { - /* Reset any active pointers for this attribute + /* Reset any active pointers for this attribute */ if (oldsz) tnl->vtx.tabfv[attr][oldsz-1] = choose[attr][oldsz-1]; - + _tnl_fixup_vertex( ctx, attr, sz ); - + } @@ -482,15 +482,15 @@ static void error_attrib( const GLfloat *unused ) GET_CURRENT_CONTEXT( ctx ); (void) unused; _mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" ); -} +} static void reset_attrfv( TNLcontext *tnl ) -{ +{ GLuint i; - for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) + for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) if (tnl->vtx.attrsz[i]) { GLint j = tnl->vtx.attrsz[i] - 1; tnl->vtx.attrsz[i] = 0; @@ -506,14 +506,14 @@ static void reset_attrfv( TNLcontext *tnl ) tnl->vtx.vertex_size = 0; tnl->vtx.have_materials = 0; } - -/* Materials: - * + +/* Materials: + * * These are treated as per-vertex attributes, at indices above where * the NV_vertex_program leaves off. There are a lot of good things - * about treating materials this way. + * about treating materials this way. * * However: I don't want to double the number of generated functions * just to cope with this, so I unroll the 'C' varients of CHOOSE and @@ -549,10 +549,10 @@ do { \ /* Colormaterial is dealt with later on. */ -static void GLAPIENTRY _tnl_Materialfv( GLenum face, GLenum pname, +static void GLAPIENTRY _tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); switch (face) { @@ -560,7 +560,7 @@ static void GLAPIENTRY _tnl_Materialfv( GLenum face, GLenum pname, case GL_BACK: case GL_FRONT_AND_BACK: break; - + default: _mesa_error( ctx, GL_INVALID_ENUM, "glMaterialfv" ); return; @@ -600,7 +600,7 @@ static void GLAPIENTRY _tnl_Materialfv( GLenum face, GLenum pname, static void GLAPIENTRY _tnl_EdgeFlag( GLboolean b ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); GLfloat f = (GLfloat)b; @@ -609,7 +609,7 @@ static void GLAPIENTRY _tnl_EdgeFlag( GLboolean b ) static void GLAPIENTRY _tnl_EdgeFlagv( const GLboolean *v ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); GLfloat f = (GLfloat)v[0]; @@ -618,7 +618,7 @@ static void GLAPIENTRY _tnl_EdgeFlagv( const GLboolean *v ) static void GLAPIENTRY _tnl_Indexf( GLfloat f ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); OTHER_ATTR( _TNL_ATTRIB_INDEX, 1, &f ); @@ -626,7 +626,7 @@ static void GLAPIENTRY _tnl_Indexf( GLfloat f ) static void GLAPIENTRY _tnl_Indexfv( const GLfloat *v ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); OTHER_ATTR( _TNL_ATTRIB_INDEX, 1, v ); @@ -642,18 +642,18 @@ static void GLAPIENTRY _tnl_EvalCoord1f( GLfloat u ) /* TODO: use a CHOOSE() function for this: */ { GLint i; - if (tnl->vtx.eval.new_state) + if (tnl->vtx.eval.new_state) _tnl_update_eval( ctx ); for (i = 0 ; i <= _TNL_ATTRIB_INDEX ; i++) { - if (tnl->vtx.eval.map1[i].map) + if (tnl->vtx.eval.map1[i].map) if (tnl->vtx.attrsz[i] != tnl->vtx.eval.map1[i].sz) _tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map1[i].sz ); } } - _mesa_memcpy( tnl->vtx.copied.buffer, tnl->vtx.vertex, + _mesa_memcpy( tnl->vtx.copied.buffer, tnl->vtx.vertex, tnl->vtx.vertex_size * sizeof(GLfloat)); _tnl_do_EvalCoord1f( ctx, u ); @@ -670,26 +670,26 @@ static void GLAPIENTRY _tnl_EvalCoord2f( GLfloat u, GLfloat v ) /* TODO: use a CHOOSE() function for this: */ { GLint i; - if (tnl->vtx.eval.new_state) + if (tnl->vtx.eval.new_state) _tnl_update_eval( ctx ); for (i = 0 ; i <= _TNL_ATTRIB_INDEX ; i++) { - if (tnl->vtx.eval.map2[i].map) + if (tnl->vtx.eval.map2[i].map) if (tnl->vtx.attrsz[i] != tnl->vtx.eval.map2[i].sz) _tnl_fixup_vertex( ctx, i, tnl->vtx.eval.map2[i].sz ); } - if (ctx->Eval.AutoNormal) + if (ctx->Eval.AutoNormal) if (tnl->vtx.attrsz[_TNL_ATTRIB_NORMAL] != 3) _tnl_fixup_vertex( ctx, _TNL_ATTRIB_NORMAL, 3 ); } - _mesa_memcpy( tnl->vtx.copied.buffer, tnl->vtx.vertex, + _mesa_memcpy( tnl->vtx.copied.buffer, tnl->vtx.vertex, tnl->vtx.vertex_size * sizeof(GLfloat)); _tnl_do_EvalCoord2f( ctx, u, v ); - _mesa_memcpy( tnl->vtx.vertex, tnl->vtx.copied.buffer, + _mesa_memcpy( tnl->vtx.vertex, tnl->vtx.copied.buffer, tnl->vtx.vertex_size * sizeof(GLfloat)); } @@ -717,9 +717,9 @@ static void GLAPIENTRY _tnl_EvalPoint1( GLint i ) static void GLAPIENTRY _tnl_EvalPoint2( GLint i, GLint j ) { GET_CURRENT_CONTEXT( ctx ); - GLfloat du = ((ctx->Eval.MapGrid2u2 - ctx->Eval.MapGrid2u1) / + GLfloat du = ((ctx->Eval.MapGrid2u2 - ctx->Eval.MapGrid2u1) / (GLfloat) ctx->Eval.MapGrid2un); - GLfloat dv = ((ctx->Eval.MapGrid2v2 - ctx->Eval.MapGrid2v1) / + GLfloat dv = ((ctx->Eval.MapGrid2v2 - ctx->Eval.MapGrid2v1) / (GLfloat) ctx->Eval.MapGrid2vn); GLfloat u = i * du + ctx->Eval.MapGrid2u1; GLfloat v = j * dv + ctx->Eval.MapGrid2v1; @@ -733,10 +733,10 @@ static void GLAPIENTRY _tnl_EvalPoint2( GLint i, GLint j ) */ static void GLAPIENTRY _tnl_Begin( GLenum mode ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); int i; if (ctx->NewState) { @@ -749,7 +749,7 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode ) return; } - if (!(tnl->Driver.NotifyBegin && + if (!(tnl->Driver.NotifyBegin && tnl->Driver.NotifyBegin( ctx, mode ))) CALL_Begin(ctx->Exec, (mode)); return; @@ -758,7 +758,7 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode ) /* Heuristic: attempt to isolate attributes occuring outside * begin/end pairs. */ - if (tnl->vtx.vertex_size && !tnl->vtx.attrsz[0]) + if (tnl->vtx.vertex_size && !tnl->vtx.attrsz[0]) _tnl_FlushVertices( ctx, ~0 ); i = tnl->vtx.prim_count++; @@ -768,21 +768,21 @@ static void GLAPIENTRY _tnl_Begin( GLenum mode ) ctx->Driver.CurrentExecPrimitive = mode; } - else + else _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" ); - + } static void GLAPIENTRY _tnl_End( void ) { - GET_CURRENT_CONTEXT( ctx ); + GET_CURRENT_CONTEXT( ctx ); if (ctx->Driver.CurrentExecPrimitive != GL_POLYGON+1) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); int idx = tnl->vtx.initial_counter - tnl->vtx.counter; int i = tnl->vtx.prim_count - 1; - tnl->vtx.prim[i].mode |= PRIM_END; + tnl->vtx.prim[i].mode |= PRIM_END; tnl->vtx.prim[i].count = idx - tnl->vtx.prim[i].start; ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; @@ -791,15 +791,15 @@ static void GLAPIENTRY _tnl_End( void ) * carried over (or not) between adjacent primitives. */ #if 0 - if (tnl->vtx.prim_count == TNL_MAX_PRIM) + if (tnl->vtx.prim_count == TNL_MAX_PRIM) _tnl_FlushVertices( ctx, ~0 ); #else if (tnl->vtx.prim_count == TNL_MAX_PRIM) - _tnl_flush_vtx( ctx ); + _tnl_flush_vtx( ctx ); #endif } - else + else _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" ); } @@ -853,18 +853,18 @@ void _tnl_FlushVertices( GLcontext *ctx, GLuint flags ) } -static void _tnl_current_init( GLcontext *ctx ) +static void _tnl_current_init( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); GLint i; /* setup the pointers for the typical 16 vertex attributes */ - for (i = 0; i < VERT_ATTRIB_MAX; i++) + for (i = 0; i < VERT_ATTRIB_MAX; i++) tnl->vtx.current[i] = ctx->Current.Attrib[i]; /* setup pointers for the 12 material attributes */ for (i = 0; i < MAT_ATTRIB_MAX; i++) - tnl->vtx.current[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = + tnl->vtx.current[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = ctx->Light.Material.Attrib[i]; tnl->vtx.current[_TNL_ATTRIB_INDEX] = &ctx->Current.Index; @@ -879,11 +879,11 @@ static struct _tnl_dynfn *no_codegen( GLcontext *ctx, int key ) void _tnl_vtx_init( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); struct tnl_vertex_arrays *tmp = &tnl->vtx_inputs; GLuint i; static int firsttime = 1; - + if (firsttime) { firsttime = 0; @@ -945,7 +945,7 @@ void _tnl_vtx_init( GLcontext *ctx ) memcpy( tnl->vtx.tabfv, choose, sizeof(choose) ); - for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) + for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++) tnl->vtx.attrsz[i] = 0; tnl->vtx.vertex_size = 0; @@ -965,12 +965,12 @@ static void free_funcs( struct _tnl_dynfn *l ) void _tnl_vtx_destroy( GLcontext *ctx ) { - TNLcontext *tnl = TNL_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint i; for (i = 0; i < 4; i++) { free_funcs( &tnl->vtx.cache.Vertex[i] ); - free_funcs( &tnl->vtx.cache.Attribute[i] ); + free_funcs( &tnl->vtx.cache.Attribute[i] ); } } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.h b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.h index 9818c082b80..9859c3806c6 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_api.h @@ -58,8 +58,8 @@ extern void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v ); extern void _tnl_do_EvalCoord1f(GLcontext* ctx, GLfloat u); extern void _tnl_update_eval( GLcontext *ctx ); -extern GLboolean *_tnl_translate_edgeflag( GLcontext *ctx, - const GLfloat *data, +extern GLboolean *_tnl_translate_edgeflag( GLcontext *ctx, + const GLfloat *data, GLuint count, GLuint stride ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_eval.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_eval.c index d948e700b0d..5af27daa4c1 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_eval.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_eval.c @@ -34,33 +34,33 @@ #include "dispatch.h" -static void clear_active_eval1( TNLcontext *tnl, GLuint attr ) +static void clear_active_eval1( TNLcontext *tnl, GLuint attr ) { tnl->vtx.eval.map1[attr].map = NULL; } -static void clear_active_eval2( TNLcontext *tnl, GLuint attr ) +static void clear_active_eval2( TNLcontext *tnl, GLuint attr ) { tnl->vtx.eval.map2[attr].map = NULL; } -static void set_active_eval1( TNLcontext *tnl, GLuint attr, GLuint dim, +static void set_active_eval1( TNLcontext *tnl, GLuint attr, GLuint dim, struct gl_1d_map *map ) { if (!tnl->vtx.eval.map1[attr].map) { tnl->vtx.eval.map1[attr].map = map; tnl->vtx.eval.map1[attr].sz = dim; } -} +} -static void set_active_eval2( TNLcontext *tnl, GLuint attr, GLuint dim, +static void set_active_eval2( TNLcontext *tnl, GLuint attr, GLuint dim, struct gl_2d_map *map ) { if (!tnl->vtx.eval.map2[attr].map) { tnl->vtx.eval.map2[attr].map = map; tnl->vtx.eval.map2[attr].sz = dim; } -} +} void _tnl_update_eval( GLcontext *ctx ) { @@ -76,52 +76,52 @@ void _tnl_update_eval( GLcontext *ctx ) if (ctx->VertexProgram._Enabled) { for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - if (ctx->Eval.Map1Attrib[attr]) + if (ctx->Eval.Map1Attrib[attr]) set_active_eval1( tnl, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); - if (ctx->Eval.Map2Attrib[attr]) + if (ctx->Eval.Map2Attrib[attr]) set_active_eval2( tnl, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); } } - if (ctx->Eval.Map1Color4) + if (ctx->Eval.Map1Color4) set_active_eval1( tnl, VERT_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); - - if (ctx->Eval.Map2Color4) + + if (ctx->Eval.Map2Color4) set_active_eval2( tnl, VERT_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map2Color4 ); - if (ctx->Eval.Map1TextureCoord4) + if (ctx->Eval.Map1TextureCoord4) set_active_eval1( tnl, VERT_ATTRIB_TEX0, 4, &ctx->EvalMap.Map1Texture4 ); - else if (ctx->Eval.Map1TextureCoord3) + else if (ctx->Eval.Map1TextureCoord3) set_active_eval1( tnl, VERT_ATTRIB_TEX0, 3, &ctx->EvalMap.Map1Texture3 ); - else if (ctx->Eval.Map1TextureCoord2) + else if (ctx->Eval.Map1TextureCoord2) set_active_eval1( tnl, VERT_ATTRIB_TEX0, 2, &ctx->EvalMap.Map1Texture2 ); - else if (ctx->Eval.Map1TextureCoord1) + else if (ctx->Eval.Map1TextureCoord1) set_active_eval1( tnl, VERT_ATTRIB_TEX0, 1, &ctx->EvalMap.Map1Texture1 ); - if (ctx->Eval.Map2TextureCoord4) + if (ctx->Eval.Map2TextureCoord4) set_active_eval2( tnl, VERT_ATTRIB_TEX0, 4, &ctx->EvalMap.Map2Texture4 ); - else if (ctx->Eval.Map2TextureCoord3) + else if (ctx->Eval.Map2TextureCoord3) set_active_eval2( tnl, VERT_ATTRIB_TEX0, 3, &ctx->EvalMap.Map2Texture3 ); - else if (ctx->Eval.Map2TextureCoord2) + else if (ctx->Eval.Map2TextureCoord2) set_active_eval2( tnl, VERT_ATTRIB_TEX0, 2, &ctx->EvalMap.Map2Texture2 ); - else if (ctx->Eval.Map2TextureCoord1) + else if (ctx->Eval.Map2TextureCoord1) set_active_eval2( tnl, VERT_ATTRIB_TEX0, 1, &ctx->EvalMap.Map2Texture1 ); - if (ctx->Eval.Map1Normal) + if (ctx->Eval.Map1Normal) set_active_eval1( tnl, VERT_ATTRIB_NORMAL, 3, &ctx->EvalMap.Map1Normal ); - if (ctx->Eval.Map2Normal) + if (ctx->Eval.Map2Normal) set_active_eval2( tnl, VERT_ATTRIB_NORMAL, 3, &ctx->EvalMap.Map2Normal ); - if (ctx->Eval.Map1Vertex4) + if (ctx->Eval.Map1Vertex4) set_active_eval1( tnl, VERT_ATTRIB_POS, 4, &ctx->EvalMap.Map1Vertex4 ); - else if (ctx->Eval.Map1Vertex3) + else if (ctx->Eval.Map1Vertex3) set_active_eval1( tnl, VERT_ATTRIB_POS, 3, &ctx->EvalMap.Map1Vertex3 ); - if (ctx->Eval.Map2Vertex4) + if (ctx->Eval.Map2Vertex4) set_active_eval2( tnl, VERT_ATTRIB_POS, 4, &ctx->EvalMap.Map2Vertex4 ); - else if (ctx->Eval.Map2Vertex3) + else if (ctx->Eval.Map2Vertex3) set_active_eval2( tnl, VERT_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 ); tnl->vtx.eval.new_state = 0; @@ -142,8 +142,8 @@ void _tnl_do_EvalCoord1f(GLcontext* ctx, GLfloat u) ASSIGN_4V(data, 0, 0, 0, 1); - _math_horner_bezier_curve(map->Points, data, uu, - tnl->vtx.eval.map1[attr].sz, + _math_horner_bezier_curve(map->Points, data, uu, + tnl->vtx.eval.map1[attr].sz, map->Order); COPY_SZ_4V( tnl->vtx.attrptr[attr], @@ -161,21 +161,21 @@ void _tnl_do_EvalCoord1f(GLcontext* ctx, GLfloat u) ASSIGN_4V(vertex, 0, 0, 0, 1); - _math_horner_bezier_curve(map->Points, vertex, uu, - tnl->vtx.eval.map1[0].sz, + _math_horner_bezier_curve(map->Points, vertex, uu, + tnl->vtx.eval.map1[0].sz, map->Order); - if (tnl->vtx.eval.map1[0].sz == 4) + if (tnl->vtx.eval.map1[0].sz == 4) CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); else - CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); + CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); } } void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v ) -{ +{ TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint attr; @@ -188,10 +188,10 @@ void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v ) ASSIGN_4V(data, 0, 0, 0, 1); - _math_horner_bezier_surf(map->Points, - data, - uu, vv, - tnl->vtx.eval.map2[attr].sz, + _math_horner_bezier_surf(map->Points, + data, + uu, vv, + tnl->vtx.eval.map2[attr].sz, map->Uorder, map->Vorder); COPY_SZ_4V( tnl->vtx.attrptr[attr], @@ -214,7 +214,7 @@ void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v ) GLfloat normal[4]; GLfloat du[4], dv[4]; - _math_de_casteljau_surf(map->Points, vertex, du, dv, uu, vv, + _math_de_casteljau_surf(map->Points, vertex, du, dv, uu, vv, tnl->vtx.eval.map2[0].sz, map->Uorder, map->Vorder); @@ -222,7 +222,7 @@ void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v ) du[0] = du[0]*vertex[3] - du[3]*vertex[0]; du[1] = du[1]*vertex[3] - du[3]*vertex[1]; du[2] = du[2]*vertex[3] - du[3]*vertex[2]; - + dv[0] = dv[0]*vertex[3] - dv[3]*vertex[0]; dv[1] = dv[1]*vertex[3] - dv[3]*vertex[1]; dv[2] = dv[2]*vertex[3] - dv[3]*vertex[2]; @@ -239,15 +239,15 @@ void _tnl_do_EvalCoord2f( GLcontext* ctx, GLfloat u, GLfloat v ) } else { - _math_horner_bezier_surf(map->Points, vertex, uu, vv, + _math_horner_bezier_surf(map->Points, vertex, uu, vv, tnl->vtx.eval.map2[0].sz, map->Uorder, map->Vorder); } - if (tnl->vtx.attrsz[0] == 4) + if (tnl->vtx.attrsz[0] == 4) CALL_Vertex4fv(GET_DISPATCH(), ( vertex )); else - CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); + CALL_Vertex3fv(GET_DISPATCH(), ( vertex )); } } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_exec.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_exec.c index ef609781c51..9e139d38ef5 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_exec.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_exec.c @@ -50,9 +50,9 @@ static void _tnl_print_vtx( GLcontext *ctx ) for (i = 0 ; i < tnl->vtx.prim_count ; i++) { struct tnl_prim *prim = &tnl->vtx.prim[i]; _mesa_debug(NULL, " prim %d: %s %d..%d %s %s\n", - i, + i, _mesa_lookup_enum_by_nr(prim->mode & PRIM_MODE_MASK), - prim->start, + prim->start, prim->start + prim->count, (prim->mode & PRIM_BEGIN) ? "BEGIN" : "(wrap)", (prim->mode & PRIM_END) ? "END" : "(wrap)"); @@ -66,9 +66,9 @@ GLboolean *_tnl_translate_edgeflag( GLcontext *ctx, const GLfloat *data, GLboolean *ef = tnl->vtx.edgeflag_tmp; GLuint i; - if (!ef) + if (!ef) ef = tnl->vtx.edgeflag_tmp = (GLboolean *) MALLOC( tnl->vb.Size ); - + for (i = 0 ; i < count ; i++, data += stride) ef[i] = (data[0] == 1.0); @@ -84,7 +84,7 @@ GLboolean *_tnl_import_current_edgeflag( GLcontext *ctx, GLboolean tmp = ctx->Current.EdgeFlag; GLuint i; - if (!ef) + if (!ef) ef = tnl->vtx.edgeflag_tmp = (GLboolean *) MALLOC( tnl->vb.Size ); for (i = 0 ; i < count ; i++) @@ -100,7 +100,7 @@ static INLINE GLint get_size( const GLfloat *f ) return 2; } -/* Some nasty stuff still hanging on here. +/* Some nasty stuff still hanging on here. * * TODO - remove VB->NormalPtr, etc and just use the AttrPtr's. */ @@ -148,7 +148,7 @@ static void _tnl_vb_bind_vtx( GLcontext *ctx ) } } - + /* Copy and translate EdgeFlag to a contiguous array of GLbooleans */ if (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL) { @@ -157,7 +157,7 @@ static void _tnl_vb_bind_vtx( GLcontext *ctx ) tnl->vtx.vertex_size ); data++; } - else + else VB->EdgeFlag = _tnl_import_current_edgeflag( ctx, count ); } @@ -190,8 +190,8 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx ) GLuint ovf, i; GLuint sz = tnl->vtx.vertex_size; GLfloat *dst = tnl->vtx.copied.buffer; - GLfloat *src = (tnl->vtx.buffer + - tnl->vtx.prim[tnl->vtx.prim_count-1].start * + GLfloat *src = (tnl->vtx.buffer + + tnl->vtx.prim[tnl->vtx.prim_count-1].start * tnl->vtx.vertex_size); @@ -215,7 +215,7 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx ) _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case GL_LINE_STRIP: - if (nr == 0) + if (nr == 0) return 0; else { _mesa_memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) ); @@ -224,7 +224,7 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx ) case GL_LINE_LOOP: case GL_TRIANGLE_FAN: case GL_POLYGON: - if (nr == 0) + if (nr == 0) return 0; else if (nr == 1) { _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) ); @@ -266,12 +266,12 @@ void _tnl_flush_vtx( GLcontext *ctx ) if (tnl->vtx.prim_count && vertex_count) { - tnl->vtx.copied.nr = _tnl_copy_vertices( ctx ); + tnl->vtx.copied.nr = _tnl_copy_vertices( ctx ); if (tnl->vtx.copied.nr != vertex_count) { if (ctx->NewState) _mesa_update_state( ctx ); - + _tnl_vb_bind_vtx( ctx ); tnl->Driver.RunPipeline( ctx ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_generic.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_generic.c index 0422fcd45dc..5bb80af8740 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_generic.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_generic.c @@ -43,7 +43,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* Versions of all the entrypoints for situations where codegen isn't - * available. + * available. * * Note: Only one size for each attribute may be active at once. * Eg. if Color3f is installed/active, then Color4f may not be, even @@ -94,7 +94,7 @@ static void attrib_##ATTR##_##N( const GLfloat *v ) \ ATTRFV( ATTRIB, 1 ) \ ATTRFV( ATTRIB, 2 ) \ ATTRFV( ATTRIB, 3 ) \ - ATTRFV( ATTRIB, 4 ) + ATTRFV( ATTRIB, 4 ) ATTRS( 0 ) ATTRS( 1 ) @@ -201,7 +201,7 @@ static void GLAPIENTRY _tnl_Vertex3fv( const GLfloat *v ) DISPATCH_ATTR3FV( _TNL_ATTRIB_POS, v ); } -static void GLAPIENTRY _tnl_Vertex4f( GLfloat x, GLfloat y, GLfloat z, +static void GLAPIENTRY _tnl_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { DISPATCH_ATTR4F( _TNL_ATTRIB_POS, x, y, z, w ); @@ -283,7 +283,7 @@ static void GLAPIENTRY _tnl_Color3fv( const GLfloat *v ) DISPATCH_ATTR3FV( _TNL_ATTRIB_COLOR0, v ); } -static void GLAPIENTRY _tnl_Color4f( GLfloat x, GLfloat y, GLfloat z, +static void GLAPIENTRY _tnl_Color4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { DISPATCH_ATTR4F( _TNL_ATTRIB_COLOR0, x, y, z, w ); @@ -294,7 +294,7 @@ static void GLAPIENTRY _tnl_Color4fv( const GLfloat *v ) DISPATCH_ATTR4FV( _TNL_ATTRIB_COLOR0, v ); } -static void GLAPIENTRY _tnl_SecondaryColor3fEXT( GLfloat x, GLfloat y, +static void GLAPIENTRY _tnl_SecondaryColor3fEXT( GLfloat x, GLfloat y, GLfloat z ) { DISPATCH_ATTR3F( _TNL_ATTRIB_COLOR1, x, y, z ); @@ -318,35 +318,35 @@ static void GLAPIENTRY _tnl_MultiTexCoord1fv( GLenum target, DISPATCH_ATTR1FV( attr, v ); } -static void GLAPIENTRY _tnl_MultiTexCoord2f( GLenum target, GLfloat x, +static void GLAPIENTRY _tnl_MultiTexCoord2f( GLenum target, GLfloat x, GLfloat y ) { GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; DISPATCH_ATTR2F( attr, x, y ); } -static void GLAPIENTRY _tnl_MultiTexCoord2fv( GLenum target, +static void GLAPIENTRY _tnl_MultiTexCoord2fv( GLenum target, const GLfloat *v ) { GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; DISPATCH_ATTR2FV( attr, v ); } -static void GLAPIENTRY _tnl_MultiTexCoord3f( GLenum target, GLfloat x, +static void GLAPIENTRY _tnl_MultiTexCoord3f( GLenum target, GLfloat x, GLfloat y, GLfloat z) { GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; DISPATCH_ATTR3F( attr, x, y, z ); } -static void GLAPIENTRY _tnl_MultiTexCoord3fv( GLenum target, +static void GLAPIENTRY _tnl_MultiTexCoord3fv( GLenum target, const GLfloat *v ) { GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; DISPATCH_ATTR3FV( attr, v ); } -static void GLAPIENTRY _tnl_MultiTexCoord4f( GLenum target, GLfloat x, +static void GLAPIENTRY _tnl_MultiTexCoord4f( GLenum target, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { @@ -354,7 +354,7 @@ static void GLAPIENTRY _tnl_MultiTexCoord4f( GLenum target, GLfloat x, DISPATCH_ATTR4F( attr, x, y, z, w ); } -static void GLAPIENTRY _tnl_MultiTexCoord4fv( GLenum target, +static void GLAPIENTRY _tnl_MultiTexCoord4fv( GLenum target, const GLfloat *v ) { GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0; @@ -368,14 +368,14 @@ static void GLAPIENTRY _tnl_VertexAttrib1fNV( GLuint index, GLfloat x ) DISPATCH_ATTR1F( index, x ); } -static void GLAPIENTRY _tnl_VertexAttrib1fvNV( GLuint index, +static void GLAPIENTRY _tnl_VertexAttrib1fvNV( GLuint index, const GLfloat *v ) { if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; DISPATCH_ATTR1FV( index, v ); } -static void GLAPIENTRY _tnl_VertexAttrib2fNV( GLuint index, GLfloat x, +static void GLAPIENTRY _tnl_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y ) { if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; @@ -411,7 +411,7 @@ static void GLAPIENTRY _tnl_VertexAttrib4fNV( GLuint index, GLfloat x, DISPATCH_ATTR4F( index, x, y, z, w ); } -static void GLAPIENTRY _tnl_VertexAttrib4fvNV( GLuint index, +static void GLAPIENTRY _tnl_VertexAttrib4fvNV( GLuint index, const GLfloat *v ) { if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; @@ -429,14 +429,14 @@ static void GLAPIENTRY _tnl_VertexAttrib1fARB( GLuint index, GLfloat x ) DISPATCH_ATTR1F( index, x ); } -static void GLAPIENTRY _tnl_VertexAttrib1fvARB( GLuint index, +static void GLAPIENTRY _tnl_VertexAttrib1fvARB( GLuint index, const GLfloat *v ) { if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; DISPATCH_ATTR1FV( index, v ); } -static void GLAPIENTRY _tnl_VertexAttrib2fARB( GLuint index, GLfloat x, +static void GLAPIENTRY _tnl_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y ) { if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; @@ -472,7 +472,7 @@ static void GLAPIENTRY _tnl_VertexAttrib4fARB( GLuint index, GLfloat x, DISPATCH_ATTR4F( index, x, y, z, w ); } -static void GLAPIENTRY _tnl_VertexAttrib4fvARB( GLuint index, +static void GLAPIENTRY _tnl_VertexAttrib4fvARB( GLuint index, const GLfloat *v ) { if (index >= VERT_ATTRIB_MAX) index = ERROR_ATTRIB; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_x86.c b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_x86.c index 38cdad451c7..29dc1ba8467 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_x86.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl/t_vtx_x86.c @@ -215,7 +215,7 @@ static struct _tnl_dynfn *makeX86Attribute1fv( GLcontext *ctx, int dest ) TNLcontext *tnl = TNL_CONTEXT(ctx); DFN ( _tnl_x86_Attribute1fv, tnl->vtx.cache.Attribute[1-1], dest ); - FIXUP(dfn->code, 0, 0, dest); + FIXUP(dfn->code, 0, 0, dest); return dfn; } @@ -225,8 +225,8 @@ static struct _tnl_dynfn *makeX86Attribute2fv( GLcontext *ctx, int dest ) TNLcontext *tnl = TNL_CONTEXT(ctx); DFN ( _tnl_x86_Attribute2fv, tnl->vtx.cache.Attribute[2-1], dest ); - FIXUP(dfn->code, 0, 0, dest); - FIXUP(dfn->code, 0, 1, 4+dest); + FIXUP(dfn->code, 0, 0, dest); + FIXUP(dfn->code, 0, 1, 4+dest); return dfn; } @@ -236,8 +236,8 @@ static struct _tnl_dynfn *makeX86Attribute3fv( GLcontext *ctx, int dest ) TNLcontext *tnl = TNL_CONTEXT(ctx); DFN ( _tnl_x86_Attribute3fv, tnl->vtx.cache.Attribute[3-1], dest ); - FIXUP(dfn->code, 0, 0, dest); - FIXUP(dfn->code, 0, 1, 4+dest); + FIXUP(dfn->code, 0, 0, dest); + FIXUP(dfn->code, 0, 1, 4+dest); FIXUP(dfn->code, 0, 2, 8+dest); return dfn; @@ -248,8 +248,8 @@ static struct _tnl_dynfn *makeX86Attribute4fv( GLcontext *ctx, int dest ) TNLcontext *tnl = TNL_CONTEXT(ctx); DFN ( _tnl_x86_Attribute4fv, tnl->vtx.cache.Attribute[4-1], dest ); - FIXUP(dfn->code, 0, 0, dest); - FIXUP(dfn->code, 0, 1, 4+dest); + FIXUP(dfn->code, 0, 0, dest); + FIXUP(dfn->code, 0, 1, 4+dest); FIXUP(dfn->code, 0, 2, 8+dest); FIXUP(dfn->code, 0, 3, 12+dest); @@ -360,7 +360,7 @@ void _tnl_x86choosers( tnl_attrfv_func (*choose)[4], } } -#else +#else void _tnl_InitX86Codegen( struct _tnl_dynfn_generators *gen ) { diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_primtmp.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_primtmp.h index 97dca3fd421..abafdfc6d9a 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_primtmp.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_primtmp.h @@ -27,7 +27,7 @@ * Gareth Hughes */ -/* Template for immediate mode vertices. +/* Template for immediate mode vertices. * * Probably instantiate once for each vertex format used: * - TINY_VERTICES @@ -74,10 +74,10 @@ static void TAG(flush_line_1)( GLcontext *ctx, TNL_VERTEX *v0 ) TNL_VERTEX *v1 = v0 - 1; ACTIVE_VERTEX = IMM_VERTICES( 0 ); FLUSH_VERTEX = TAG(flush_line_0); - if (FALLBACK_OR_CLIPPING) - CLIP_OR_DRAW_LINE( ctx, v1, v0 ); + if (FALLBACK_OR_CLIPPING) + CLIP_OR_DRAW_LINE( ctx, v1, v0 ); else - DRAW_LINE( ctx, v1, v0 ); + DRAW_LINE( ctx, v1, v0 ); } @@ -167,10 +167,10 @@ static void TAG(flush_line_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) else if (EXTEND_PRIM( 1 )) { EMIT_VERTEX( v0 ); } else { - BEGIN_PRIM( GL_LINE_STRIP, 2 ); + BEGIN_PRIM( GL_LINE_STRIP, 2 ); EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); - } + EMIT_VERTEX( v0 ); + } } static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) @@ -186,10 +186,10 @@ static void TAG(flush_line_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) else if (EXTEND_PRIM( 1 )) { EMIT_VERTEX( v0 ); } else { - BEGIN_PRIM( GL_LINE_STRIP, 2 ); + BEGIN_PRIM( GL_LINE_STRIP, 2 ); EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); - } + EMIT_VERTEX( v0 ); + } } @@ -234,7 +234,7 @@ static void TAG(flush_triangle_2)( GLcontext *ctx, TNL_VERTEX *v0 ) FLUSH_VERTEX = TAG(flush_triangle_0); /* nothing gained by trying to emit as hw primitives -- that - * happens normally in this case. + * happens normally in this case. */ if (FALLBACK_OR_CLIPPING) CLIP_OR_DRAW_TRI( ctx, v2, v1, v0 ); @@ -281,7 +281,7 @@ static void TAG(flush_tri_strip_1)( GLcontext *ctx, TNL_VERTEX *v0 ) EMIT_VERTEX( v2 ); \ EMIT_VERTEX( v1 ); \ EMIT_VERTEX( v0 ); \ - } + } static void TAG(flush_tri_strip_2)( GLcontext *ctx, TNL_VERTEX *v0 ) { @@ -354,7 +354,7 @@ static void TAG(flush_tri_fan_1)( GLcontext *ctx, TNL_VERTEX *v0 ) EMIT_VERTEX( v2 ); \ EMIT_VERTEX( v1 ); \ EMIT_VERTEX( v0 ); \ - } + } static void TAG(flush_tri_fan_2)( GLcontext *ctx, TNL_VERTEX *v0 ) { @@ -420,8 +420,8 @@ static void TAG(flush_quad_3)( GLcontext *ctx, TNL_VERTEX *v0 ) EXTEND_PRIM_NF( GL_QUADS, 4 ); EMIT_VERTEX( v3 ); EMIT_VERTEX( v2 ); - EMIT_VERTEX( v1 ); - EMIT_VERTEX( v0 ); + EMIT_VERTEX( v1 ); + EMIT_VERTEX( v0 ); } } @@ -520,7 +520,7 @@ static void TAG(flush_poly_1)( GLcontext *ctx, TNL_VERTEX *v0 ) EMIT_VERTEX( v2 ); \ EMIT_VERTEX( v1 ); \ EMIT_VERTEX( v0 ); \ - } + } static void TAG(flush_poly_2)( GLcontext *ctx, TNL_VERTEX *v0 ) { diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vapi.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vapi.h index 95e93b1c839..796f2625e5c 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vapi.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vapi.h @@ -52,7 +52,7 @@ do { VERTEX_CLIP(2) = m[10] * oz + m[14] * ow; VERTEX_CLIP(3) = ow; w = ow; - } + } else { ASSERT (DO_IDENTITY_MATRIX); VERTEX_CLIP(0) = ox; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vb.c b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vb.c index 0c4462f556f..faf0978bed7 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vb.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vb.c @@ -165,7 +165,7 @@ static void TAG(clip_draw_triangle)( GLcontext *ctx, POLY_CLIP( CLIP_FAR_BIT, 0, 0, -1, 1 ); POLY_CLIP( CLIP_NEAR_BIT, 0, 0, 1, 1 ); - if ((ctx->_TriangleCaps & DD_FLATSHADE) && v2 != inlist[0]) + if ((ctx->_TriangleCaps & DD_FLATSHADE) && v2 != inlist[0]) COPY_PV( ctx, inlist[0], v2 ); out = inlist[in]; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vbtmp.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vbtmp.h index 2f76553cff9..83f071b6de0 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vbtmp.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/imm/t_dd_imm_vbtmp.h @@ -79,14 +79,14 @@ static void TAG(emit_vfmt)( GLcontext *ctx, VERTEX *v ) if (DO_PTEX) { if (HAVE_PTEX_VERTICES) { v->pv.q0 = tc[3]; - } + } else { float rhw = 1.0 / tc[3]; v->v.w *= tc[3]; v->v.u0 *= rhw; v->v.v0 *= rhw; - } - } + } + } } if (DO_TEX1) { GLfloat *tc = ctx->Current.Texture[1]; @@ -94,12 +94,12 @@ static void TAG(emit_vfmt)( GLcontext *ctx, VERTEX *v ) v->pv.u1 = tc[0]; v->pv.v1 = tc[1]; v->pv.q1 = tc[3]; - } + } else { v->v.u1 = tc[0]; v->v.v1 = tc[1]; } - } + } else if (DO_PTEX) { *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ } @@ -109,24 +109,24 @@ static void TAG(emit_vfmt)( GLcontext *ctx, VERTEX *v ) v->pv.u2 = tc[0]; v->pv.v2 = tc[1]; v->pv.q2 = tc[3]; - } + } else { v->v.u2 = tc[0]; v->v.v2 = tc[1]; } - } + } if (DO_TEX3) { GLfloat *tc = ctx->Current.Texture[3]; if (DO_PTEX) { v->pv.u3 = tc[0]; v->pv.v3 = tc[1]; v->pv.q3 = tc[3]; - } + } else { v->v.u3 = tc[0]; v->v.v3 = tc[1]; } - } + } } @@ -241,7 +241,7 @@ static void TAG(interp)( GLcontext *ctx, static __inline void TAG(copy_pv)( GLcontext *ctx, - TNL_VERTEX *dst, + TNL_VERTEX *dst, TNL_VERTEX *src ) { if (DO_TEX0 || DO_TEX1 || !HAVE_TINY_VERTICES) { diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp.h index d274ead2c27..dc6347405b4 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp.h @@ -82,7 +82,7 @@ static void *TAG(emit_elts)( GLcontext *ctx, GLuint *elts, GLuint nr, EMIT_TWO_ELTS( 0, elts[0], elts[1] ); INCR_ELTS( 2 ); } - + if (i < nr) { EMIT_ELT( 0, elts[0] ); INCR_ELTS( 1 ); @@ -92,7 +92,7 @@ static void *TAG(emit_elts)( GLcontext *ctx, GLuint *elts, GLuint nr, } #endif -static __inline void *TAG(emit_verts)( GLcontext *ctx, GLuint start, +static __inline void *TAG(emit_verts)( GLcontext *ctx, GLuint start, GLuint count, void *buf ) { return EMIT_VERTS(ctx, start, count, buf); @@ -189,7 +189,7 @@ static void TAG(render_line_strip_verts)( GLcontext *ctx, TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) ); currentsz = dmasz; } - + FLUSH(); } else { @@ -232,8 +232,8 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx, nr = MIN2( currentsz, count - j ); if (j + nr >= count && - start < count - 1 && - (flags & PRIM_END)) + start < count - 1 && + (flags & PRIM_END)) { void *tmp; tmp = ALLOC_VERTS(nr+1); @@ -439,7 +439,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx, FLUSH(); - } else if (HAVE_TRI_STRIPS && + } else if (HAVE_TRI_STRIPS && (ctx->_TriangleCaps & DD_FLATSHADE) && TNL_CONTEXT(ctx)->vb.ColorPtr[0]->stride) { if (HAVE_ELTS) { @@ -811,8 +811,8 @@ static void TAG(render_line_loop_elts)( GLcontext *ctx, nr = MIN2( currentsz, count - j ); if (j + nr >= count && - start < count - 1 && - (flags & PRIM_END)) + start < count - 1 && + (flags & PRIM_END)) { void *tmp; tmp = ALLOC_ELTS(nr+1); @@ -1207,7 +1207,7 @@ static GLboolean TAG(validate_render)( GLcontext *ctx, if (HAVE_POLYGONS) { ok = GL_TRUE; } - else + else ok = (HAVE_TRI_FANS && !(ctx->_TriangleCaps & DD_FLATSHADE)); break; case GL_QUAD_STRIP: @@ -1216,7 +1216,7 @@ static GLboolean TAG(validate_render)( GLcontext *ctx, } else if (HAVE_QUAD_STRIPS) { ok = GL_TRUE; - } else if (HAVE_TRI_STRIPS && + } else if (HAVE_TRI_STRIPS && (ctx->_TriangleCaps & DD_FLATSHADE) && VB->ColorPtr[0]->stride != 0) { if (HAVE_ELTS) { @@ -1226,7 +1226,7 @@ static GLboolean TAG(validate_render)( GLcontext *ctx, ok = GL_FALSE; } } - else + else ok = HAVE_TRI_STRIPS; break; case GL_QUADS: @@ -1242,7 +1242,7 @@ static GLboolean TAG(validate_render)( GLcontext *ctx, default: break; } - + if (!ok) { /* fprintf(stderr, "not ok %s\n", _mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK)); */ return GL_FALSE; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp2.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp2.h index b762221b1a8..d0cc059d50c 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp2.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_dmatmp2.h @@ -69,7 +69,7 @@ do { \ /**********************************************************************/ -static ELT_TYPE *TAG(emit_elts)( GLcontext *ctx, +static ELT_TYPE *TAG(emit_elts)( GLcontext *ctx, ELT_TYPE *dest, GLuint *elts, GLuint nr ) { @@ -84,11 +84,11 @@ static ELT_TYPE *TAG(emit_elts)( GLcontext *ctx, EMIT_ELT( dest, 0, elts[0] ); dest += 1; } - + return dest; } -static ELT_TYPE *TAG(emit_consecutive_elts)( GLcontext *ctx, +static ELT_TYPE *TAG(emit_consecutive_elts)( GLcontext *ctx, ELT_TYPE *dest, GLuint start, GLuint nr ) { @@ -141,7 +141,7 @@ static void TAG(render_lines_verts)( GLcontext *ctx, RESET_STIPPLE(); AUTO_STIPPLE( GL_TRUE ); } - + EMIT_PRIM( ctx, GL_LINES, HW_LINES, start, count ); if ((flags & PRIM_END) && ctx->Line.StippleFlag) @@ -165,7 +165,7 @@ static void TAG(render_line_strip_verts)( GLcontext *ctx, if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_LINES )) - { + { int dmasz = GET_MAX_HW_ELTS(); GLuint j, nr; @@ -182,7 +182,7 @@ static void TAG(render_line_strip_verts)( GLcontext *ctx, nr = MIN2( dmasz, count - j ); dest = ALLOC_ELTS( (nr-1)*2 ); - + for ( i = j ; i+1 < j+nr ; i+=1 ) { EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) ); dest += 2; @@ -247,10 +247,10 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx, /* Emit 1 more line into space alloced above */ if (j + 1 >= count) { - EMIT_TWO_ELTS( dest, 0, (j), (start) ); - dest += 2; + EMIT_TWO_ELTS( dest, 0, (j), (start) ); + dest += 2; } - + CLOSE_ELTS(); } } @@ -275,7 +275,7 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx, j += nr; CLOSE_ELTS(); } - } + } } } else { TAG(render_line_strip_verts)( ctx, j, count, flags ); @@ -316,7 +316,7 @@ static void TAG(render_tri_strip_verts)( GLcontext *ctx, return; if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) - { + { int dmasz = GET_MAX_HW_ELTS(); int parity = 0; GLuint j, nr; @@ -334,7 +334,7 @@ static void TAG(render_tri_strip_verts)( GLcontext *ctx, nr = MIN2( dmasz, count - j ); dest = ALLOC_ELTS( (nr-2)*3 ); - + for ( i = j ; i+2 < j+nr ; i++, parity^=1 ) { EMIT_ELT( dest, 0, (i+0+parity) ); EMIT_ELT( dest, 1, (i+1-parity) ); @@ -357,11 +357,11 @@ static void TAG(render_tri_fan_verts)( GLcontext *ctx, LOCAL_VARS; if (0) fprintf(stderr, "%s\n", __FUNCTION__); - if (start+2 >= count) + if (start+2 >= count) return; if (PREFER_DISCRETE_ELT_PRIM( count-start, HW_TRIANGLES )) - { + { int dmasz = GET_MAX_HW_ELTS(); GLuint j, nr; @@ -375,14 +375,14 @@ static void TAG(render_tri_fan_verts)( GLcontext *ctx, nr = MIN2( dmasz, count - j ); dest = ALLOC_ELTS( (nr-1)*3 ); - + for ( i = j ; i+1 < j+nr ; i++ ) { EMIT_ELT( dest, 0, (start) ); EMIT_ELT( dest, 1, (i) ); EMIT_ELT( dest, 2, (i+1) ); dest += 3; } - + CLOSE_ELTS(); } } @@ -400,7 +400,7 @@ static void TAG(render_poly_verts)( GLcontext *ctx, LOCAL_VARS; if (0) fprintf(stderr, "%s\n", __FUNCTION__); - if (start+2 >= count) + if (start+2 >= count) return; EMIT_PRIM( ctx, GL_POLYGON, HW_POLYGON, start, count ); @@ -416,12 +416,12 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx, count -= (count-start) & 1; - if (start+3 >= count) + if (start+3 >= count) return; if (HAVE_QUAD_STRIPS) { EMIT_PRIM( ctx, GL_QUAD_STRIP, HW_QUAD_STRIP, start, count ); - } + } else if (ctx->_TriangleCaps & DD_FLATSHADE) { LOCAL_VARS; int dmasz = GET_MAX_HW_ELTS(); @@ -440,7 +440,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx, nr = MIN2( dmasz, count - j ); quads = (nr/2)-1; dest = ALLOC_ELTS( quads*6 ); - + for ( i = j ; i < j+quads*2 ; i+=2 ) { EMIT_TWO_ELTS( dest, 0, (i+0), (i+1) ); EMIT_TWO_ELTS( dest, 2, (i+2), (i+1) ); @@ -466,15 +466,15 @@ static void TAG(render_quads_verts)( GLcontext *ctx, if (0) fprintf(stderr, "%s\n", __FUNCTION__); count -= (count-start)%4; - if (start+3 >= count) + if (start+3 >= count) return; if (HAVE_QUADS) { EMIT_PRIM( ctx, GL_QUADS, HW_QUADS, start, count ); - } + } else { /* Hardware doesn't have a quad primitive type -- simulate it - * using indexed vertices and the triangle primitive: + * using indexed vertices and the triangle primitive: */ LOCAL_VARS; int dmasz = GET_MAX_HW_ELTS(); @@ -643,11 +643,11 @@ static void TAG(render_line_loop_elts)( GLcontext *ctx, else j = start + 1; - + if (flags & PRIM_END) { if (start+1 >= count) return; - } + } else { if (j+1 >= count) return; @@ -658,7 +658,7 @@ static void TAG(render_line_loop_elts)( GLcontext *ctx, if ((flags & PRIM_BEGIN) && ctx->Line.StippleFlag) RESET_STIPPLE(); - + /* Ensure last vertex doesn't wrap: */ dmasz--; diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_triemit.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_triemit.h index f5979ee9a75..8cc5105086b 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_triemit.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_triemit.h @@ -1,9 +1,9 @@ #ifndef DO_DEBUG_VERTS #define DO_DEBUG_VERTS 0 -#endif +#endif #ifndef PRINT_VERTEX -#define PRINT_VERTEX(x) +#define PRINT_VERTEX(x) #endif #if defined(USE_X86_ASM) @@ -52,7 +52,7 @@ static __inline void TAG(quad)( CTX_ARG, PRINT_VERTEX(v2); PRINT_VERTEX(v3); } - + COPY_DWORDS( j, vb, vertsize, v0 ); COPY_DWORDS( j, vb, vertsize, v1 ); COPY_DWORDS( j, vb, vertsize, v2 ); @@ -76,7 +76,7 @@ static __inline void TAG(quad)( CTX_ARG, PRINT_VERTEX(v2); PRINT_VERTEX(v3); } - + COPY_DWORDS( j, vb, vertsize, v0 ); COPY_DWORDS( j, vb, vertsize, v1 ); COPY_DWORDS( j, vb, vertsize, v3 ); diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_tritmp.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_tritmp.h index 0bf32ff3443..f1a660712c6 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_tritmp.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_tritmp.h @@ -211,14 +211,14 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (VB->ColorPtr[1]->stride) { ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLfloat)); - if (!DO_FLAT) { + if (!DO_FLAT) { VERT_SET_RGBA( v[0], vbcolor[e0] ); VERT_SET_RGBA( v[1], vbcolor[e1] ); } VERT_SET_RGBA( v[2], vbcolor[e2] ); } else { - if (!DO_FLAT) { + if (!DO_FLAT) { VERT_SET_RGBA( v[0], vbcolor[0] ); VERT_SET_RGBA( v[1], vbcolor[0] ); } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vb.c b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vb.c index edd78f7acfc..055ff6d58fe 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vb.c +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vb.c @@ -48,7 +48,7 @@ */ static void copy_pv_rgba4_spec5( GLcontext *ctx, GLuint edst, GLuint esrc ) { - LOCALVARS + LOCALVARS GLubyte *verts = GET_VERTEX_STORE(); GLuint size = GET_VERTEX_SIZE(); GLuint *dst = (GLuint *)(verts + (edst * size)); @@ -262,7 +262,7 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v ) v->pv.v1, v->pv.q1); break; -#endif +#endif default: fprintf(stderr, "???\n"); break; @@ -274,12 +274,12 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v ) /* Interpolate the elements of the VB not included in typical hardware - * vertices. + * vertices. * * NOTE: All these arrays are guarenteed by tnl to be writeable and * have good stride. */ -#ifndef INTERP_QUALIFIER +#ifndef INTERP_QUALIFIER #define INTERP_QUALIFIER static #endif @@ -317,18 +317,18 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx, INTERP_VERTEX(ctx, t, dst, out, in, force_boundary); } -INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx, +INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx, GLuint dst, GLuint src ) { LOCALVARS struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), + COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->ColorPtr[1], src) ); if (VB->SecondaryColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), + COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->SecondaryColorPtr[1], src) ); } } diff --git a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vbtmp.h b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vbtmp.h index 92dd8931c33..fe9adec357f 100644 --- a/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vbtmp.h +++ b/reactos/dll/3rdparty/mesa32/src/tnl_dd/t_dd_vbtmp.h @@ -60,7 +60,7 @@ * unsigned char ub4[4][16]; * } * - + * VERTEX: hw vertex type as above * VERTEX_COLOR: hw color struct type in VERTEX * @@ -104,8 +104,8 @@ #endif #if (HAVE_HW_DIVIDE && !HAVE_PTEX_VERTICES) -#error "can't cope with this combination" -#endif +#error "can't cope with this combination" +#endif #ifndef LOCALVARS #define LOCALVARS @@ -179,7 +179,7 @@ static void TAG(emit)( GLcontext *ctx, const GLuint t0 = GET_TEXSOURCE(0); tc0_stride = VB->TexCoordPtr[t0]->stride; tc0 = VB->TexCoordPtr[t0]->data; - if (DO_PTEX) + if (DO_PTEX) tc0_size = VB->TexCoordPtr[t0]->size; } @@ -217,13 +217,13 @@ static void TAG(emit)( GLcontext *ctx, STRIDE_4F(coord, start * coord_stride); if (DO_TEX0) STRIDE_4F(tc0, start * tc0_stride); - if (DO_TEX1) + if (DO_TEX1) STRIDE_4F(tc1, start * tc1_stride); - if (DO_TEX2) + if (DO_TEX2) STRIDE_4F(tc2, start * tc2_stride); - if (DO_TEX3) + if (DO_TEX3) STRIDE_4F(tc3, start * tc3_stride); - if (DO_RGBA) + if (DO_RGBA) STRIDE_4F(col, start * col_stride); if (DO_SPEC) STRIDE_4F(spec, start * spec_stride); @@ -267,35 +267,35 @@ static void TAG(emit)( GLcontext *ctx, v->v.v0 = tc0[0][1]; if (DO_PTEX) { if (HAVE_PTEX_VERTICES) { - if (tc0_size == 4) + if (tc0_size == 4) v->pv.q0 = tc0[0][3]; else v->pv.q0 = 1.0; - } + } else if (tc0_size == 4) { float rhw = 1.0 / tc0[0][3]; v->v.w *= tc0[0][3]; v->v.u0 *= rhw; v->v.v0 *= rhw; - } - } + } + } STRIDE_4F(tc0, tc0_stride); } if (DO_TEX1) { if (DO_PTEX) { v->pv.u1 = tc1[0][0]; v->pv.v1 = tc1[0][1]; - if (tc1_size == 4) + if (tc1_size == 4) v->pv.q1 = tc1[0][3]; else v->pv.q1 = 1.0; - } + } else { v->v.u1 = tc1[0][0]; v->v.v1 = tc1[0][1]; } STRIDE_4F(tc1, tc1_stride); - } + } else if (DO_PTEX) { *(GLuint *)&v->pv.q1 = 0; /* avoid culling on radeon */ } @@ -303,32 +303,32 @@ static void TAG(emit)( GLcontext *ctx, if (DO_PTEX) { v->pv.u2 = tc2[0][0]; v->pv.v2 = tc2[0][1]; - if (tc2_size == 4) + if (tc2_size == 4) v->pv.q2 = tc2[0][3]; else v->pv.q2 = 1.0; - } + } else { v->v.u2 = tc2[0][0]; v->v.v2 = tc2[0][1]; } STRIDE_4F(tc2, tc2_stride); - } + } if (DO_TEX3) { if (DO_PTEX) { v->pv.u3 = tc3[0][0]; v->pv.v3 = tc3[0][1]; - if (tc3_size == 4) + if (tc3_size == 4) v->pv.q3 = tc3[0][3]; else v->pv.q3 = 1.0; - } + } else { v->v.u3 = tc3[0][0]; v->v.v3 = tc3[0][1]; } STRIDE_4F(tc3, tc3_stride); - } + } } } @@ -421,7 +421,7 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) if (DO_PTEX) return GL_TRUE; - + if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) || @@ -504,7 +504,7 @@ static void TAG(interp)( GLcontext *ctx, VIEWPORT_Z( dst->v.z, dstclip[2] * w ); } - if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || + if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) || DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 || DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) { diff --git a/reactos/dll/3rdparty/mesa32/src/x86-64/x86-64.c b/reactos/dll/3rdparty/mesa32/src/x86-64/x86-64.c index e70bc66274d..3fc7d2b0e0e 100644 --- a/reactos/dll/3rdparty/mesa32/src/x86-64/x86-64.c +++ b/reactos/dll/3rdparty/mesa32/src/x86-64/x86-64.c @@ -104,7 +104,7 @@ void _mesa_init_all_x86_64_transform_asm(void) _mesa_transform_tab[4][MATRIX_2D] = _mesa_x86_64_transform_points4_2d; */ - + #ifdef DEBUG _math_test_all_transform_functions("x86_64"); _math_test_all_cliptest_functions("x86_64"); diff --git a/reactos/dll/3rdparty/mesa32/src/x86/common_x86.c b/reactos/dll/3rdparty/mesa32/src/x86/common_x86.c index 0ff7fd51a6d..3aee423238c 100644 --- a/reactos/dll/3rdparty/mesa32/src/x86/common_x86.c +++ b/reactos/dll/3rdparty/mesa32/src/x86/common_x86.c @@ -270,10 +270,10 @@ static void check_os_sse_support( void ) } #elif defined(WIN32) LPTOP_LEVEL_EXCEPTION_FILTER oldFilter; - + /* Install our ExceptionFilter */ oldFilter = SetUnhandledExceptionFilter( ExceptionFilter ); - + if ( cpu_has_xmm ) { message( "Testing OS support for SSE... " ); @@ -397,7 +397,7 @@ void _mesa_init_all_x86_transform_asm( void ) } } - + if ( _mesa_getenv( "MESA_NO_ASM" ) ) { _mesa_x86_cpu_features = 0; } diff --git a/reactos/dll/3rdparty/mesa32/src/x86/mmx_blendtmp.h b/reactos/dll/3rdparty/mesa32/src/x86/mmx_blendtmp.h index c2fdeb62b3b..fc6ec184171 100644 --- a/reactos/dll/3rdparty/mesa32/src/x86/mmx_blendtmp.h +++ b/reactos/dll/3rdparty/mesa32/src/x86/mmx_blendtmp.h @@ -5,11 +5,11 @@ /* * void _mesa_mmx_blend( GLcontext *ctx, - * GLuint n, + * GLuint n, * const GLubyte mask[], - * GLchan rgba[][4], + * GLchan rgba[][4], * CONST GLchan dest[][4] ) - * + * */ ALIGNTEXT16 GLOBL GLNAME( TAG(_mesa_mmx_blend) ) @@ -31,7 +31,7 @@ GLNAME( TAG(_mesa_mmx_blend) ): MOV_L ( REGOFF(24, EBP), ESI ) /* dest */ INIT - + TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */ JZ ( LLTAG(GMB_align_end) ) @@ -40,7 +40,7 @@ GLNAME( TAG(_mesa_mmx_blend) ): /* runin */ #define ONE(x) x -#define TWO(x) +#define TWO(x) MAIN ( EDI, ESI ) #undef ONE #undef TWO @@ -50,7 +50,7 @@ LLTAG(GMB_align_continue): DEC_L ( ECX ) /* n -= 1 */ INC_L ( EBX ) /* mask += 1 */ ADD_L ( CONST(4), EDI ) /* rgba += 1 */ - ADD_L ( CONST(4), ESI ) /* dest += 1 */ + ADD_L ( CONST(4), ESI ) /* dest += 1 */ LLTAG(GMB_align_end): @@ -76,7 +76,7 @@ LLTAG(GMB_loop_continue): DEC_L ( ECX ) /* n -= 2 */ ADD_L ( CONST(2), EBX ) /* mask += 2 */ ADD_L ( CONST(8), EDI ) /* rgba += 2 */ - ADD_L ( CONST(8), ESI ) /* dest += 2 */ + ADD_L ( CONST(8), ESI ) /* dest += 2 */ CMP_L ( CONST(2), ECX ) JAE ( LLTAG(GMB_loop_begin) ) diff --git a/reactos/dll/3rdparty/mesa32/src/x86/read_rgba_span_x86.h b/reactos/dll/3rdparty/mesa32/src/x86/read_rgba_span_x86.h index 564b1bb0f9e..3b9d5fb6536 100644 --- a/reactos/dll/3rdparty/mesa32/src/x86/read_rgba_span_x86.h +++ b/reactos/dll/3rdparty/mesa32/src/x86/read_rgba_span_x86.h @@ -21,7 +21,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ - + /** * \file read_rgba_span_x86.h * diff --git a/reactos/dll/3rdparty/mesa32/src/x86/rtasm/x86sse.c b/reactos/dll/3rdparty/mesa32/src/x86/rtasm/x86sse.c index 0c9ffe25fa2..af32f9da1cb 100644 --- a/reactos/dll/3rdparty/mesa32/src/x86/rtasm/x86sse.c +++ b/reactos/dll/3rdparty/mesa32/src/x86/rtasm/x86sse.c @@ -59,18 +59,18 @@ static void emit_3ub_fn( struct x86_function *p, GLubyte b0, GLubyte b1, GLubyte /* Build a modRM byte + possible displacement. No treatment of SIB * indexing. BZZT - no way to encode an absolute address. */ -static void emit_modrm( struct x86_function *p, - struct x86_reg reg, +static void emit_modrm( struct x86_function *p, + struct x86_reg reg, struct x86_reg regmem ) { GLubyte val = 0; - + assert(reg.mod == mod_REG); - + val |= regmem.mod << 6; /* mod field */ val |= reg.idx << 3; /* reg field */ val |= regmem.idx; /* r/m field */ - + emit_1ub_fn(p, val, 0); /* Oh-oh we've stumbled into the SIB thing. @@ -111,11 +111,11 @@ static void emit_modrm_noreg( struct x86_function *p, * the arguments presented. */ static void emit_op_modrm( struct x86_function *p, - GLubyte op_dst_is_reg, + GLubyte op_dst_is_reg, GLubyte op_dst_is_mem, struct x86_reg dst, struct x86_reg src ) -{ +{ switch (dst.mod) { case mod_REG: emit_1ub_fn(p, op_dst_is_reg, 0); @@ -202,7 +202,7 @@ void x86_jcc( struct x86_function *p, GLubyte *label ) { GLint offset = label - (x86_get_label(p) + 2); - + if (offset <= 127 && offset >= -128) { emit_1ub(p, 0x70 + cc); emit_1b(p, (GLbyte) offset); @@ -455,7 +455,7 @@ void sse_cvtps2pi( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_XMM || src.mod != mod_REG)); p->need_emms = 1; @@ -471,21 +471,21 @@ void sse_cvtps2pi( struct x86_function *p, void sse_shufps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - GLubyte shuf) + GLubyte shuf) { emit_2ub(p, X86_TWOB, 0xC6); emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); + emit_1ub(p, shuf); } void sse_cmpps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - GLubyte cc) + GLubyte cc) { emit_2ub(p, X86_TWOB, 0xC2); emit_modrm(p, dest, arg0); - emit_1ub(p, cc); + emit_1ub(p, cc); } /*********************************************************************** @@ -498,11 +498,11 @@ void sse_cmpps( struct x86_function *p, void sse2_pshufd( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - GLubyte shuf) + GLubyte shuf) { emit_3ub(p, 0x66, X86_TWOB, 0x70); emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); + emit_1ub(p, shuf); } void sse2_cvtps2dq( struct x86_function *p, @@ -627,9 +627,9 @@ static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86 assert(dst.file == file_x87); if (arg.file == file_x87) { - if (dst.idx == 0) + if (dst.idx == 0) emit_2ub(p, dst0ub0, dst0ub1+arg.idx); - else if (arg.idx == 0) + else if (arg.idx == 0) emit_2ub(p, arg0ub0, arg0ub1+arg.idx); else assert(0); @@ -645,7 +645,7 @@ static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xc8, 0xdc, 0xc8, 4); @@ -653,7 +653,7 @@ void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xe0, 0xdc, 0xe8, 4); @@ -661,7 +661,7 @@ void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xe8, 0xdc, 0xe0, 5); @@ -669,7 +669,7 @@ void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xc0, 0xdc, 0xc0, 0); @@ -677,7 +677,7 @@ void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xf0, 0xdc, 0xf8, 6); @@ -685,7 +685,7 @@ void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) { - x87_arith_op(p, dst, arg, + x87_arith_op(p, dst, arg, 0xd8, 0xf8, 0xdc, 0xf0, 7); @@ -822,7 +822,7 @@ void x87_fyl2x( struct x86_function *p ) /* st1 = st1 * log2(st0 + 1.0); * pop_stack; * - * A fast operation, with restrictions: -.29 < st0 < .29 + * A fast operation, with restrictions: -.29 < st0 < .29 */ void x87_fyl2xp1( struct x86_function *p ) { @@ -832,7 +832,7 @@ void x87_fyl2xp1( struct x86_function *p ) void x87_fld( struct x86_function *p, struct x86_reg arg ) { - if (arg.file == file_x87) + if (arg.file == file_x87) emit_2ub(p, 0xd9, 0xc0 + arg.idx); else { emit_1ub(p, 0xd9); @@ -842,7 +842,7 @@ void x87_fld( struct x86_function *p, struct x86_reg arg ) void x87_fst( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd0 + dst.idx); else { emit_1ub(p, 0xd9); @@ -852,7 +852,7 @@ void x87_fst( struct x86_function *p, struct x86_reg dst ) void x87_fstp( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xdd, 0xd8 + dst.idx); else { emit_1ub(p, 0xd9); @@ -862,7 +862,7 @@ void x87_fstp( struct x86_function *p, struct x86_reg dst ) void x87_fcom( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd0 + dst.idx); else { emit_1ub(p, 0xd8); @@ -872,7 +872,7 @@ void x87_fcom( struct x86_function *p, struct x86_reg dst ) void x87_fcomp( struct x86_function *p, struct x86_reg dst ) { - if (dst.file == file_x87) + if (dst.file == file_x87) emit_2ub(p, 0xd8, 0xd8 + dst.idx); else { emit_1ub(p, 0xd8); @@ -886,7 +886,7 @@ void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) assert(dst.file == file_REG32); if (dst.idx == reg_AX && - dst.mod == mod_REG) + dst.mod == mod_REG) emit_2ub(p, 0xdf, 0xe0); else { emit_1ub(p, 0xdd); @@ -912,7 +912,7 @@ void mmx_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_MMX || src.mod != mod_REG)); p->need_emms = 1; @@ -925,7 +925,7 @@ void mmx_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ) { - assert(dst.file == file_MMX && + assert(dst.file == file_MMX && (src.file == file_MMX || src.mod != mod_REG)); p->need_emms = 1; @@ -964,7 +964,7 @@ void mmx_movq( struct x86_function *p, struct x86_reg x86_fn_arg( struct x86_function *p, GLuint arg ) { - return x86_make_disp(x86_make_reg(file_REG32, reg_SP), + return x86_make_disp(x86_make_reg(file_REG32, reg_SP), p->stack_offset + arg * 4); /* ??? */ } diff --git a/reactos/dll/cpl/access/lang/cs-CZ.rc b/reactos/dll/cpl/access/lang/cs-CZ.rc index 24c774950ef..1f5aba5d6e5 100644 --- a/reactos/dll/cpl/access/lang/cs-CZ.rc +++ b/reactos/dll/cpl/access/lang/cs-CZ.rc @@ -46,7 +46,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Zobrazení" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Funkce Vysoký kontrast",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Vyberte tuto možnost pokud chcete, aby Reactos používal barvy a písma urèené pro snadnou èitelnost.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Použít funkci Vysoký kontrast",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/de-DE.rc b/reactos/dll/cpl/access/lang/de-DE.rc index 36c457fc21c..33b476cae51 100644 --- a/reactos/dll/cpl/access/lang/de-DE.rc +++ b/reactos/dll/cpl/access/lang/de-DE.rc @@ -49,7 +49,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Anzeige" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Hoher Kontrast",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Aktivieren Sie diese Option, damit ReactOS Farben und Schrift besonders leserlich darstellt.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Hohen Kontrast aktivieren",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/en-US.rc b/reactos/dll/cpl/access/lang/en-US.rc index 6c8f2bdef44..74e90062b4b 100644 --- a/reactos/dll/cpl/access/lang/en-US.rc +++ b/reactos/dll/cpl/access/lang/en-US.rc @@ -46,7 +46,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Display" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "High Contrast",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Use this option if you want Reactos to use colors and fonts designed for easy reading.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Use High Contrast",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/es-ES.rc b/reactos/dll/cpl/access/lang/es-ES.rc index f1846aa22a6..c09e04f4b30 100644 --- a/reactos/dll/cpl/access/lang/es-ES.rc +++ b/reactos/dll/cpl/access/lang/es-ES.rc @@ -49,7 +49,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Despliegue" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Alto Contraste",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Use esta opción si desea que Reactos use colores y letras deseñadas para lectura fácil.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Usar Alto Contraste",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/fr-FR.rc b/reactos/dll/cpl/access/lang/fr-FR.rc index a87f31dc381..642c1a59640 100644 --- a/reactos/dll/cpl/access/lang/fr-FR.rc +++ b/reactos/dll/cpl/access/lang/fr-FR.rc @@ -48,7 +48,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Affichage" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Contraste élevé",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Utilisez cette option si vous voulez que ReactOS utilise les couleurs et les polices conçues pour une lecture facilitée.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Utiliser un contraste élevé",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/hu-HU.rc b/reactos/dll/cpl/access/lang/hu-HU.rc index 5036b330c0e..3b5e760c202 100644 --- a/reactos/dll/cpl/access/lang/hu-HU.rc +++ b/reactos/dll/cpl/access/lang/hu-HU.rc @@ -47,7 +47,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Képernyõ" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Nagy kontraszt",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Ha azt szeretné, hogy a Reactos olyan színeket használjon, amelyek a könnyû olvasást teszik lehetõvé, akkor válassza ki ezt a lehetõséget.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Nagy kontraszt használata",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/id-ID.rc b/reactos/dll/cpl/access/lang/id-ID.rc index d7a17ed8b67..eb97f5ca50c 100644 --- a/reactos/dll/cpl/access/lang/id-ID.rc +++ b/reactos/dll/cpl/access/lang/id-ID.rc @@ -48,7 +48,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Tampilan" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Kontras Tinggi",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Gunakan opsi ini jika anda ingin Reactos untuk memakai warna dan font yang didesain guna memudahkan pembacaan.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Gunakan Kontras Tinggi",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/it-IT.rc b/reactos/dll/cpl/access/lang/it-IT.rc index f7d16d07fb9..7d9d6959073 100644 --- a/reactos/dll/cpl/access/lang/it-IT.rc +++ b/reactos/dll/cpl/access/lang/it-IT.rc @@ -46,7 +46,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Video" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Alto contrasto",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Usa questa opzione se devono essere usati colori e font che migliorano la leggibilità.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Usa Alto contrasto",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/ja-JP.rc b/reactos/dll/cpl/access/lang/ja-JP.rc index d5598821e05..c71eca706b3 100644 --- a/reactos/dll/cpl/access/lang/ja-JP.rc +++ b/reactos/dll/cpl/access/lang/ja-JP.rc @@ -46,7 +46,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "‰æ–Ê" FONT 9, "MS UI Gothic", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "ƒnƒCƒRƒ“ƒgƒ‰ƒXƒg",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "‚±‚Ì‹@”\\‚ðŽg‚¤‚ÆA‰æ–Ê•\\Ž¦‚É“Ç‚Ý‚â‚·‚¢”zF‚ƃtƒHƒ“ƒg‚ðŽg‚¢‚Ü‚·B",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "ƒnƒCƒRƒ“ƒgƒ‰ƒXƒg‚ðŽg‚¤(&U)",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/nl-NL.rc b/reactos/dll/cpl/access/lang/nl-NL.rc index 29271525d9b..77c9f7eb88a 100644 --- a/reactos/dll/cpl/access/lang/nl-NL.rc +++ b/reactos/dll/cpl/access/lang/nl-NL.rc @@ -48,7 +48,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Weergave" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Hoog Contrast",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "U kunt deze optie gebruiken als u wilt dat Reactos kleuren en lettertypen zodanig instelt dat deze gemakkelijk te lezen zijn.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Hoog contrast gebruiken",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/pl-PL.rc b/reactos/dll/cpl/access/lang/pl-PL.rc index 385607f32c7..61060a8094c 100644 --- a/reactos/dll/cpl/access/lang/pl-PL.rc +++ b/reactos/dll/cpl/access/lang/pl-PL.rc @@ -49,7 +49,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Ekran" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Wysoki Kontrast",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "U¿yj tej funkcji, jeœli chcesz, ¿eby Reactos u¿ywa³ kolorów i czcionek zaprojektowanych do ³atwego czytania",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&U¿yj funkcji Wysoki Kontrast",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/ru-RU.rc b/reactos/dll/cpl/access/lang/ru-RU.rc index cc5cf5d4541..e2f9a7e8c62 100644 --- a/reactos/dll/cpl/access/lang/ru-RU.rc +++ b/reactos/dll/cpl/access/lang/ru-RU.rc @@ -46,7 +46,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Ýêðàí" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Âûñîêàÿ êîíòðàñòíîñòü",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Îñîáî ïîäîáðàííûå ñî÷åòàíèÿ öâåòîâ è øðèôòîâ, îáëåã÷àþùèå âîñïðèÿòèå.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Âûñîêàÿ êîíòðàñòíîñòü",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/access/lang/uk-UA.rc b/reactos/dll/cpl/access/lang/uk-UA.rc index 13b52bf66c3..73d0dc365e8 100644 --- a/reactos/dll/cpl/access/lang/uk-UA.rc +++ b/reactos/dll/cpl/access/lang/uk-UA.rc @@ -54,7 +54,7 @@ IDD_PROPPAGEDISPLAY DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Åêðàí" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Âèñîêà êîíòðàñòí³ñòü",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Âèêîðèñòàííÿ ñèñòåìè êîëüîð³â ³ øðèôò³â, ÿê³ ïîëåêøóþòü çîðîâå ñïðèéíÿòòÿ òåêñòó.",-1,PROPSHEETPADDING(2),LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(4),LABELLINE(3) AUTOCHECKBOX "&Âèñîêà êîíòðàñòí³ñòü",IDC_CONTRAST_BOX,PROPSHEETPADDING(2),LABELLINE(5)+2,PROPSHEETWIDTH-PROPSHEETPADDING(20),14 diff --git a/reactos/dll/cpl/appwiz/add.c b/reactos/dll/cpl/appwiz/add.c index a47beda6ebb..33bdd89e016 100644 --- a/reactos/dll/cpl/appwiz/add.c +++ b/reactos/dll/cpl/appwiz/add.c @@ -46,14 +46,14 @@ LaunchDownload(HWND hwndDlg) STARTUPINFO si; PROCESS_INFORMATION pi; TCHAR Buf[MAX_PATH]; - + ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); - + if(!GetSystemDirectory(Buf,MAX_PATH)) return FALSE; lstrcat((LPTSTR)Buf, L"\\downloader.exe"); - + if(CreateProcess(NULL,Buf,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi)) { CloseHandle(pi.hProcess); diff --git a/reactos/dll/cpl/appwiz/appwiz.c b/reactos/dll/cpl/appwiz/appwiz.c index dc52163471c..47c63d9807d 100644 --- a/reactos/dll/cpl/appwiz/appwiz.c +++ b/reactos/dll/cpl/appwiz/appwiz.c @@ -39,7 +39,7 @@ HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet} }; diff --git a/reactos/dll/cpl/appwiz/createlink.c b/reactos/dll/cpl/appwiz/createlink.c index cac6757f0a0..f38f947a5c9 100644 --- a/reactos/dll/cpl/appwiz/createlink.c +++ b/reactos/dll/cpl/appwiz/createlink.c @@ -13,7 +13,7 @@ #include "appwiz.h" -BOOL +BOOL CreateShortcut(PCREATE_LINK_CONTEXT pContext) { IShellLinkW *pShellLink; @@ -30,7 +30,7 @@ CreateShortcut(PCREATE_LINK_CONTEXT pContext) pShellLink->lpVtbl->SetPath(pShellLink, pContext->szTarget); pShellLink->lpVtbl->SetDescription(pShellLink, pContext->szDescription); pShellLink->lpVtbl->SetWorkingDirectory(pShellLink, pContext->szWorkingDirectory); - + hr = pShellLink->lpVtbl->QueryInterface(pShellLink, &IID_IPersistFile, (void**)&pPersistFile); if (hr != S_OK) { @@ -59,7 +59,7 @@ WelcomeDlgProc(HWND hwndDlg, LPPSHNOTIFY lppsn; WCHAR szPath[MAX_PATH]; WCHAR szDesc[100]; - BROWSEINFOW brws; + BROWSEINFOW brws; LPITEMIDLIST pidllist; switch(uMsg) @@ -116,7 +116,7 @@ WelcomeDlgProc(HWND hwndDlg, { szDesc[0] = L'\0'; szPath[0] = L'\0'; - if (LoadStringW(hApplet, IDS_CREATE_SHORTCUT, szDesc, 100) < 100 && + if (LoadStringW(hApplet, IDS_CREATE_SHORTCUT, szDesc, 100) < 100 && LoadStringW(hApplet, IDS_ERROR_NOT_FOUND, szPath, MAX_PATH) < MAX_PATH) { WCHAR szError[MAX_PATH + 100]; diff --git a/reactos/dll/cpl/appwiz/lang/en-US.rc b/reactos/dll/cpl/appwiz/lang/en-US.rc index a3bf8615245..542fdc0dffe 100644 --- a/reactos/dll/cpl/appwiz/lang/en-US.rc +++ b/reactos/dll/cpl/appwiz/lang/en-US.rc @@ -22,7 +22,7 @@ IDD_PROPPAGEINSTALL DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Change or Remove Programs" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN ICON IDI_CPLSYSTEM,-1,PROPSHEETPADDING,6,16,16 LTEXT "The following Software can be automatically removed. To remove a program or to modify its installed components, select it from the list and click Modify/Remove.",-1,36,7,PROPSHEETWIDTH-48,22 LTEXT "Find:",-1,PROPSHEETPADDING,33,30,8 @@ -148,7 +148,7 @@ BEGIN PUSHBUTTON "&Close", IDCANCEL, 212, 198, 50, 14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Add/Remove Programs" IDS_CPLSYSTEMDESCRIPTION "Sets up programs and creates shortcuts." diff --git a/reactos/dll/cpl/appwiz/remove.c b/reactos/dll/cpl/appwiz/remove.c index 8eb4fcf0ad8..832e770187d 100644 --- a/reactos/dll/cpl/appwiz/remove.c +++ b/reactos/dll/cpl/appwiz/remove.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* +/* * * PROJECT: ReactOS Software Control Panel * FILE: dll/cpl/appwiz/remove.c @@ -63,12 +63,12 @@ CallInformation(HWND hwndDlg, HWND infDlg, UINT Control) INT nIndex; HKEY hKey; TCHAR Buf[256],Title[256]; - + nIndex = (INT)SendMessage(GetDlgItem(infDlg, Control),LVM_GETNEXTITEM,-1,LVNI_FOCUSED); if (nIndex != -1) { LVITEM item; - + ZeroMemory(&item, sizeof(LVITEM)); item.mask = LVIF_PARAM; item.iItem = nIndex; @@ -85,7 +85,7 @@ CallInformation(HWND hwndDlg, HWND infDlg, UINT Control) MB_ICONSTOP); return; } - + (void)GetInfoItem(hwndDlg, hKey, L"RegOwner", IDS_INFO_REGOWNER); (void)GetInfoItem(hwndDlg, hKey, L"ProductID", IDS_INFO_PRODUCTID); (void)GetInfoItem(hwndDlg, hKey, L"Publisher", IDS_INFO_PUBLISHER); @@ -110,12 +110,12 @@ CallUninstall(HWND hwndDlg, UINT Control, UINT RemBtn, UINT InfoBtn, BOOL isUpda TCHAR pszUninstallString[MAX_PATH]; DWORD dwSize; TCHAR Buf[256],Title[256]; - + nIndex = (INT)SendMessage(GetDlgItem(hwndDlg, Control),LVM_GETNEXTITEM,-1,LVNI_FOCUSED); if (nIndex != -1) { LVITEM item; - + ZeroMemory(&item, sizeof(LVITEM)); item.mask = LVIF_PARAM; item.iItem = nIndex; @@ -183,7 +183,7 @@ AddItemToList(HWND hwndDlg, LPARAM hSubKey, LPTSTR pszDisplayName, INT ItemIndex LV_ITEM listItem; int ColorDepth; DEVMODE pDevMode; - + /* Icon drawing mode */ pDevMode.dmSize = sizeof(DEVMODE); pDevMode.dmDriverExtra = 0; @@ -207,9 +207,9 @@ AddItemToList(HWND hwndDlg, LPARAM hSubKey, LPTSTR pszDisplayName, INT ItemIndex hIcon = LoadImage(hApplet,MAKEINTRESOURCE(IDI_CPLSYSTEM),IMAGE_ICON,32,32,LR_DEFAULTCOLOR); ImageList_AddIcon(hImgListLarge,hIcon); DestroyIcon(hIcon); - + hList = GetDlgItem(hwndDlg, Control); - + ZeroMemory(&listItem, sizeof(LV_ITEM)); listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; listItem.pszText = (LPTSTR)pszDisplayName; @@ -217,7 +217,7 @@ AddItemToList(HWND hwndDlg, LPARAM hSubKey, LPTSTR pszDisplayName, INT ItemIndex listItem.iItem = (int)ItemIndex; listItem.iImage = index; (void)ListView_InsertItem(hList, &listItem); - + (void)ListView_SetImageList(hList,hImgListSmall,LVSIL_SMALL); (void)ListView_SetImageList(hList,hImgListLarge,LVSIL_NORMAL); } @@ -226,7 +226,7 @@ VOID SetNoneAppMsg(HWND hwndDlg, BOOL IsUpdates) { TCHAR Buf[256]; - + if (IsUpdates) { LoadString(hApplet, IDS_NONE_UPD, Buf, sizeof(Buf) / sizeof(TCHAR)); @@ -332,9 +332,9 @@ FillSoftwareList(HWND hwndDlg, BOOL bShowUpdates, UINT Control) } RegCloseKey(hKey); - + if (!IsAdd) SetNoneAppMsg(hwndDlg, bShowUpdates); - + } VOID @@ -343,7 +343,7 @@ AddItemsToViewControl(HWND hwndDlg, UINT Control) TCHAR Buf[256]; int Index; HWND hList; - + hList = GetDlgItem(hwndDlg, Control); // Large Icons LoadString(hApplet, IDS_LARGEICONS, Buf, sizeof(Buf) / sizeof(TCHAR)); @@ -375,7 +375,7 @@ AddItemsToViewControl(HWND hwndDlg, UINT Control) CB_SETITEMDATA, Index, (LPARAM)Index); - + // Select string SendMessage(hList, CB_SELECTSTRING, @@ -393,21 +393,21 @@ FindItems(HWND hwndDlg, UINT ListControl, UINT EditControl, UINT RemBtn, UINT In size_t i; LV_ITEM listItem; BOOL comp = TRUE; - + hList = GetDlgItem(hwndDlg, ListControl); hEdit = GetDlgItem(hwndDlg, EditControl); - + SendMessage(hEdit, WM_GETTEXT, 128, (LPARAM)szText); - + ZeroMemory(&listItem, sizeof(LV_ITEM)); listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; listItem.pszText = (LPTSTR)szText; listItem.iImage = -1; Index = ListView_InsertItem(hList, &listItem); - + SendMessage(hList, LVM_DELETEITEM, Index, 0); ListView_GetItemText(hList, Index, 0, (LPTSTR)szItemText, 1024); - + for (i = 0; i < _tcslen(szText); i++) { if (szText[i] != szItemText[i]) comp = FALSE; @@ -454,9 +454,9 @@ ShowPopupMenu(HWND hwndDlg, UINT ResMenu, INT xPos, INT yPos, UINT Control) POINT pt; RECT lvRect; HMENU hMenu; - + GetCursorPos(&pt); - + GetWindowRect(GetDlgItem(hwndDlg, Control), &lvRect); if (PtInRect(&lvRect, pt)) { @@ -597,6 +597,6 @@ RemovePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) } break; } - + return FALSE; } diff --git a/reactos/dll/cpl/appwiz/rossetup.c b/reactos/dll/cpl/appwiz/rossetup.c index 28e45f5ad73..8f2e5314f29 100644 --- a/reactos/dll/cpl/appwiz/rossetup.c +++ b/reactos/dll/cpl/appwiz/rossetup.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* +/* * * PROJECT: ReactOS Software Control Panel * FILE: dll/cpl/appwiz/rossetup.c diff --git a/reactos/dll/cpl/appwiz/updates.c b/reactos/dll/cpl/appwiz/updates.c index b9167d4be27..e7b3927b0a2 100644 --- a/reactos/dll/cpl/appwiz/updates.c +++ b/reactos/dll/cpl/appwiz/updates.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* +/* * * PROJECT: ReactOS Software Control Panel * FILE: dll/cpl/appwiz/updates.c diff --git a/reactos/dll/cpl/desk/advappdlg.c b/reactos/dll/cpl/desk/advappdlg.c index 348e2e73aea..34ba5bf7933 100644 --- a/reactos/dll/cpl/desk/advappdlg.c +++ b/reactos/dll/cpl/desk/advappdlg.c @@ -4,9 +4,9 @@ * PROJECT: ReactOS Display Control Panel * FILE: dll/cpl/desk/advappdlg.c * PURPOSE: Advanced appearance dialog - * + * * PROGRAMMER: Timo Kreuzer (timo[dot]kreuzer[at]web[dot]de) - * + * */ #include "desk.h" @@ -80,13 +80,13 @@ InitColorButtons(HWND hwndDlg, GLOBALS* g) for (i = 0; i <= 2; i++) { /* Create a DC to draw on */ - hdcCompat = CreateCompatibleDC(hdcColorButton); + hdcCompat = CreateCompatibleDC(hdcColorButton); /* Create the button image */ g->hbmpColor[i] = CreateCompatibleBitmap(hdcColorButton, 36, 15); /* Select the button image to the DC */ - hgdiTemp = SelectObject(hdcCompat, g->hbmpColor[i]); + hgdiTemp = SelectObject(hdcCompat, g->hbmpColor[i]); /* Draw the buttons background color */ rect.left = 0; diff --git a/reactos/dll/cpl/desk/advmon.c b/reactos/dll/cpl/desk/advmon.c index dc935b55e79..182d5c89c23 100644 --- a/reactos/dll/cpl/desk/advmon.c +++ b/reactos/dll/cpl/desk/advmon.c @@ -1,4 +1,4 @@ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Display Control Panel * FILE: dll/cpl/desk/advmon.c diff --git a/reactos/dll/cpl/desk/appearance.c b/reactos/dll/cpl/desk/appearance.c index 90a3822934b..f46c9919f83 100644 --- a/reactos/dll/cpl/desk/appearance.c +++ b/reactos/dll/cpl/desk/appearance.c @@ -4,7 +4,7 @@ * PROJECT: ReactOS Display Control Panel * FILE: lib/cpl/desk/appearance.c * PURPOSE: Appearance property page - * + * * PROGRAMMERS: Trevor McCort (lycan359@gmail.com) * Timo Kreuzer (timo[dot]kreuzer[at]web[dot]de */ @@ -17,7 +17,7 @@ /* This const assigns the color and metric numbers to the elements from the elements list */ /* Size 1 (width) Size 2 (height) Color 1 Color 2 Font Fontcolor */ -const ASSIGNMENT g_Assignment[NUM_ELEMENTS] = +const ASSIGNMENT g_Assignment[NUM_ELEMENTS] = { {-1, -1, COLOR_DESKTOP, -1, -1, -1}, /* -Desktop */ {SIZE_CAPTION_Y, -1, COLOR_INACTIVECAPTION, COLOR_GRADIENTINACTIVECAPTION, FONT_CAPTION, -1}, /* inactive window caption */ {SIZE_BORDER_X, SIZE_BORDER_Y, COLOR_INACTIVEBORDER, -1, -1, -1}, /* inactive window border */ @@ -42,7 +42,7 @@ const ASSIGNMENT g_Assignment[NUM_ELEMENTS] = {SIZE_ICON_X, SIZE_ICON_Y, -1, -1, FONT_ICON, -1}}; /* symbol */ /* This is the list of names for the colors stored in the registry */ -const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH] = +const TCHAR g_RegColorNames[NUM_COLORS][MAX_COLORNAMELENGTH] = {TEXT("Scrollbar"), /* 00 = COLOR_SCROLLBAR */ TEXT("Background"), /* 01 = COLOR_DESKTOP */ TEXT("ActiveTitle"), /* 02 = COLOR_ACTIVECAPTION */ @@ -140,7 +140,7 @@ LoadThemeFromReg(GLOBALS* g, INT iPreset) DWORD dwType, dwLength; BOOL Ret = FALSE; - if(RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Appearance\\New Schemes"), + if(RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Appearance\\New Schemes"), 0, KEY_READ, &hkNewSchemes) == ERROR_SUCCESS) { if(RegOpenKeyEx(hkNewSchemes, g->ThemeTemplates[iPreset].strKeyName, 0, KEY_READ, &hkScheme) == ERROR_SUCCESS) @@ -228,7 +228,7 @@ ApplyTheme(GLOBALS* g) g->crCOLOR_BTNSHADOW = g->Theme.crColor[COLOR_BTNSHADOW]; g->crCOLOR_BTNHIGHLIGHT = g->Theme.crColor[COLOR_BTNHIGHLIGHT]; lfButtonFont = g->Theme.lfFont[FONT_DIALOG]; - + /* Create new font for bold button */ lfButtonFont.lfWeight = FW_BOLD; lfButtonFont.lfItalic = FALSE; @@ -275,7 +275,7 @@ ApplyTheme(GLOBALS* g) RegCloseKey(hKey); } - + /* Apply the fonts */ NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0); @@ -359,7 +359,7 @@ AppearancePage_OnInit(HWND hwndDlg, GLOBALS *g) LoadCurrentTheme(g); /* Fill color schemes combo */ - Result = RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Appearance\\New Schemes"), + Result = RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Control Panel\\Appearance\\New Schemes"), 0, KEY_READ, &hkNewSchemes); if (Result != ERROR_SUCCESS) { diff --git a/reactos/dll/cpl/desk/background.c b/reactos/dll/cpl/desk/background.c index 849288cff0c..345c2cb0b52 100644 --- a/reactos/dll/cpl/desk/background.c +++ b/reactos/dll/cpl/desk/background.c @@ -171,7 +171,7 @@ AddListViewItems(HWND hwndDlg, PGLOBAL_DATA pGlobalData) _tcscat(filename, TEXT("\\")); _tcscat(filename, fd.cFileName); - + /* Don't add any hidden bitmaps. Also don't add current wallpaper once more. */ if (((fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) == 0) && (_tcscmp(wallpaperFilename, filename) != 0)) { diff --git a/reactos/dll/cpl/desk/classinst.c b/reactos/dll/cpl/desk/classinst.c index 60035246293..69503bacac7 100644 --- a/reactos/dll/cpl/desk/classinst.c +++ b/reactos/dll/cpl/desk/classinst.c @@ -119,7 +119,7 @@ DisplayClassInstaller( } rc = RegCreateKeyEx( hDriverKey, L"Settings", - 0, NULL, REG_OPTION_NON_VOLATILE, + 0, NULL, REG_OPTION_NON_VOLATILE, #if _WIN32_WINNT >= 0x502 KEY_READ | KEY_WRITE, #else diff --git a/reactos/dll/cpl/desk/desk.c b/reactos/dll/cpl/desk/desk.c index eebdec11d41..34f0abcd026 100644 --- a/reactos/dll/cpl/desk/desk.c +++ b/reactos/dll/cpl/desk/desk.c @@ -4,7 +4,7 @@ * PROJECT: ReactOS Display Control Panel * FILE: lib/cpl/desk/desk.c * PURPOSE: ReactOS Display Control Panel - * + * * PROGRAMMERS: Trevor McCort (lycan359@gmail.com) */ @@ -24,7 +24,7 @@ UINT CALLBACK SettingsPageCallbackProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE pps HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { { IDC_DESK_ICON, diff --git a/reactos/dll/cpl/desk/dibitmap.c b/reactos/dll/cpl/desk/dibitmap.c index 659fbabf7ca..56a9255f802 100644 --- a/reactos/dll/cpl/desk/dibitmap.c +++ b/reactos/dll/cpl/desk/dibitmap.c @@ -4,7 +4,7 @@ * PROJECT: ReactOS Display Control Panel * FILE: lib/cpl/desk/dibitmap.c * PURPOSE: DIB loading - * + * * PROGRAMMERS: Trevor McCort (lycan359@gmail.com) */ diff --git a/reactos/dll/cpl/desk/lang/cs-CZ.rc b/reactos/dll/cpl/desk/lang/cs-CZ.rc index 4f82f82ab3a..6dd348360f8 100644 --- a/reactos/dll/cpl/desk/lang/cs-CZ.rc +++ b/reactos/dll/cpl/desk/lang/cs-CZ.rc @@ -7,7 +7,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "",IDC_BACKGROUND_PREVIEW,"Static",SS_OWNERDRAW, 70, 10, 105, 70,WS_EX_STATICEDGE - CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT | + CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP,7,99,173,71 LTEXT "Vyberte obrázek, který chcete použít jako pozadí:", @@ -15,7 +15,7 @@ BEGIN PUSHBUTTON "&Vybrat...",IDC_BROWSE_BUTTON,187,135,50,14 PUSHBUTTON "&Barva...",IDC_COLOR_BUTTON,187,155,50,14 LTEXT "Umístìní:",IDC_STATIC,187,98,36,8 - COMBOBOX IDC_PLACEMENT_COMBO,187,108,50,90,CBS_DROPDOWNLIST | + COMBOBOX IDC_PLACEMENT_COMBO,187,108,50,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -111,7 +111,7 @@ BEGIN LTEXT "Vìtší",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Poèet barev",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 diff --git a/reactos/dll/cpl/desk/lang/de-DE.rc b/reactos/dll/cpl/desk/lang/de-DE.rc index 7fc641d3c48..2f9580eebcd 100644 --- a/reactos/dll/cpl/desk/lang/de-DE.rc +++ b/reactos/dll/cpl/desk/lang/de-DE.rc @@ -10,7 +10,7 @@ BEGIN CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 8, 114, 174, 78 - LTEXT "Hintergrundbild:", + LTEXT "Hintergrundbild:", IDC_STATIC, 8, 103, 180, 9 PUSHBUTTON "&Durchsuchen...", IDC_BROWSE_BUTTON, 188, 114, 55, 15 PUSHBUTTON "&Farbe...", IDC_COLOR_BUTTON, 188, 177, 55, 15 @@ -110,7 +110,7 @@ BEGIN LTEXT "Hoch",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Farbqualität",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 diff --git a/reactos/dll/cpl/desk/lang/el-GR.rc b/reactos/dll/cpl/desk/lang/el-GR.rc index 372440cd1e9..a9bc11ad24f 100644 --- a/reactos/dll/cpl/desk/lang/el-GR.rc +++ b/reactos/dll/cpl/desk/lang/el-GR.rc @@ -7,7 +7,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_BACKGROUND_PREVIEW, "Static", SS_OWNERDRAW, 70, 10, 105, 70, WS_EX_STATICEDGE - CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | + CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 99, 173, 71 LTEXT "ÅðéëÝîôå ìéá åéêüíá ùò ôáðåôóáñßá:", @@ -110,7 +110,7 @@ BEGIN LTEXT "Ðåñéóóüôåñï",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&×ñþìáôá",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 @@ -150,7 +150,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Display" IDS_CPLDESCRIPTION "Ðáñáìåôñïðïéåß ôçí åðéöÜíåéá åñãáóßáò êáé ôçí ðñïöýëáîç ïèüíçò." diff --git a/reactos/dll/cpl/desk/lang/fr-FR.rc b/reactos/dll/cpl/desk/lang/fr-FR.rc index 5a7d94359b0..59d8fc9cca6 100644 --- a/reactos/dll/cpl/desk/lang/fr-FR.rc +++ b/reactos/dll/cpl/desk/lang/fr-FR.rc @@ -10,7 +10,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_BACKGROUND_PREVIEW,"Static", SS_OWNERDRAW, 70, 10, 105, 70, WS_EX_STATICEDGE - CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | + CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 99, 173, 71 LTEXT "Sélectionnez une image à utiliser comme fond d'écran:", @@ -113,7 +113,7 @@ BEGIN LTEXT "Plus",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Couleurs",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 @@ -156,7 +156,7 @@ END STRINGTABLE BEGIN IDS_CPLNAME "Affichage" - IDS_CPLDESCRIPTION "Personalise l'affichage du bureau et de l'écran de veille." + IDS_CPLDESCRIPTION "Personalise l'affichage du bureau et de l'écran de veille." IDS_NONE "(Aucun)" IDS_CENTER "Centre" IDS_STRETCH "Étirer" diff --git a/reactos/dll/cpl/desk/lang/hu-HU.rc b/reactos/dll/cpl/desk/lang/hu-HU.rc index d3452e2c4f8..4caae42f070 100644 --- a/reactos/dll/cpl/desk/lang/hu-HU.rc +++ b/reactos/dll/cpl/desk/lang/hu-HU.rc @@ -151,7 +151,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Képernyõ" IDS_CPLDESCRIPTION "A képernyõ és a képernyõvédõ tulajdonságainak testreszabása." diff --git a/reactos/dll/cpl/desk/lang/it-IT.rc b/reactos/dll/cpl/desk/lang/it-IT.rc index b06a566fc5a..f9c6256192f 100644 --- a/reactos/dll/cpl/desk/lang/it-IT.rc +++ b/reactos/dll/cpl/desk/lang/it-IT.rc @@ -110,7 +110,7 @@ BEGIN LTEXT "Max",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Colori",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 @@ -150,7 +150,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Visualizzazione" IDS_CPLDESCRIPTION "Adatta la visualizzazione del desktop e dello screen saver." diff --git a/reactos/dll/cpl/desk/lang/ja-JP.rc b/reactos/dll/cpl/desk/lang/ja-JP.rc index 9bb8f9f5d64..25a2389fb90 100644 --- a/reactos/dll/cpl/desk/lang/ja-JP.rc +++ b/reactos/dll/cpl/desk/lang/ja-JP.rc @@ -7,7 +7,7 @@ FONT 9, "MS UI Gothic" BEGIN CONTROL "", IDC_BACKGROUND_PREVIEW, "Static", SS_OWNERDRAW, 70, 10, 105, 70,WS_EX_STATICEDGE - CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | + CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 139, 173, 71 LTEXT "ƒfƒXƒNƒgƒbƒv‚Ì•ÇŽ†‚Æ‚µ‚ÄŽg‚¤‰æ‘œ‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢:", @@ -110,7 +110,7 @@ BEGIN LTEXT "L‚¢",1816,93,170,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,190,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "F(&C)",1817,125,160,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,170,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,170,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,188,103,9 @@ -150,7 +150,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "‰æ–Ê" IDS_CPLDESCRIPTION "ƒfƒXƒNƒgƒbƒv‰æ–Ê‚âƒXƒNƒŠ[ƒ“ ƒZ[ƒo[‚ðƒJƒXƒ^ƒ}ƒCƒY‚µ‚Ü‚·B" diff --git a/reactos/dll/cpl/desk/lang/nl-NL.rc b/reactos/dll/cpl/desk/lang/nl-NL.rc index e915c19b9cb..95b6f65cd99 100644 --- a/reactos/dll/cpl/desk/lang/nl-NL.rc +++ b/reactos/dll/cpl/desk/lang/nl-NL.rc @@ -9,7 +9,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_BACKGROUND_PREVIEW, "Static",SS_OWNERDRAW, 70, 10, 105, 70, WS_EX_STATICEDGE - CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | + CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 99, 173, 71 LTEXT "Kies een afbeelding als bureaublad achtergrond:", @@ -90,7 +90,7 @@ BEGIN CHECKBOX "", IDC_ADVAPPEARANCE_FONTCOLOR_B, 184, 200, 28, 13, BS_PUSHLIKE | BS_BITMAP AUTOCHECKBOX "B", IDC_ADVAPPEARANCE_FONTBOLD, 216, 200, 14, 13, BS_PUSHLIKE - AUTOCHECKBOX "I ", IDC_ADVAPPEARANCE_FONTITALIC, 230, 200, 14, 13, BS_PUSHLIKE + AUTOCHECKBOX "I ", IDC_ADVAPPEARANCE_FONTITALIC, 230, 200, 14, 13, BS_PUSHLIKE PUSHBUTTON "Annuleren", IDCANCEL, 191, 220, 50, 14 DEFPUSHBUTTON "OK", IDOK, 137, 220, 50, 14 @@ -112,7 +112,7 @@ BEGIN LTEXT "Meer",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Kleuren",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 @@ -152,7 +152,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Beelscherm" IDS_CPLDESCRIPTION "Past het beeldscherm en schermbeveiliging aan." diff --git a/reactos/dll/cpl/desk/lang/pl-PL.rc b/reactos/dll/cpl/desk/lang/pl-PL.rc index 69dda731973..3b01fe7a4da 100644 --- a/reactos/dll/cpl/desk/lang/pl-PL.rc +++ b/reactos/dll/cpl/desk/lang/pl-PL.rc @@ -13,7 +13,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_BACKGROUND_PREVIEW, "Static", SS_OWNERDRAW, 70, 10, 105, 70, WS_EX_STATICEDGE - CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | + CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 7, 99, 173, 71 LTEXT "Wybierz obraz do u¿ycia jako tapeta pulpitu:", @@ -116,7 +116,7 @@ BEGIN LTEXT "Wiêcej",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Jakoœæ kolorów",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 @@ -156,7 +156,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Ekran" IDS_CPLDESCRIPTION "Dostosowuje wygl¹d pulpitu oraz wygaszacze." diff --git a/reactos/dll/cpl/desk/lang/ru-RU.rc b/reactos/dll/cpl/desk/lang/ru-RU.rc index 4c91fe0b8e1..c66107ff159 100644 --- a/reactos/dll/cpl/desk/lang/ru-RU.rc +++ b/reactos/dll/cpl/desk/lang/ru-RU.rc @@ -7,7 +7,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_BACKGROUND_PREVIEW, "Static", SS_OWNERDRAW, 70, 10, 105, 70, WS_EX_STATICEDGE - CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | + CONTROL "", IDC_BACKGROUND_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 8, 114, 174, 78 LTEXT "Âûáåðèòå èçîáðàæåíèå äëÿ ðàáî÷åãî ñòîëà:", @@ -150,7 +150,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Ýêðàí" IDS_CPLDESCRIPTION "Âûáåðèòå äèñïëåé ðàáî÷åãî ñòîëà è çàñòàâêó." diff --git a/reactos/dll/cpl/desk/lang/sv-SE.rc b/reactos/dll/cpl/desk/lang/sv-SE.rc index 5865fa52129..92dd1fb4d3e 100644 --- a/reactos/dll/cpl/desk/lang/sv-SE.rc +++ b/reactos/dll/cpl/desk/lang/sv-SE.rc @@ -1,4 +1,4 @@ -/* Swedish resources by David Nordenberg +/* Swedish resources by David Nordenberg Updated 2005-07-09 by Andreas Bjerkeholt */ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL @@ -10,7 +10,7 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "",IDC_BACKGROUND_PREVIEW,"Static",SS_OWNERDRAW, 70, 10, 105, 70,WS_EX_STATICEDGE - CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT | + CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP,7,99,173,71 LTEXT "Välj en bild du vill ha som skrivbordsunderlägg:", @@ -18,7 +18,7 @@ BEGIN PUSHBUTTON "&Bläddra...",IDC_BROWSE_BUTTON,187,135,50,14 PUSHBUTTON "&Färg...",IDC_COLOR_BUTTON,187,155,50,14 LTEXT "Placering:",IDC_STATIC,187,98,36,8 - COMBOBOX IDC_PLACEMENT_COMBO,187,108,50,90,CBS_DROPDOWNLIST | + COMBOBOX IDC_PLACEMENT_COMBO,187,108,50,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -91,9 +91,9 @@ BEGIN CHECKBOX "", IDC_ADVAPPEARANCE_FONTCOLOR_B, 184, 200, 28, 13, BS_PUSHLIKE | BS_BITMAP AUTOCHECKBOX "B", IDC_ADVAPPEARANCE_FONTBOLD, 216, 200, 14, 13, BS_PUSHLIKE - AUTOCHECKBOX "I ", IDC_ADVAPPEARANCE_FONTITALIC, 230, 200, 14, 13, BS_PUSHLIKE + AUTOCHECKBOX "I ", IDC_ADVAPPEARANCE_FONTITALIC, 230, 200, 14, 13, BS_PUSHLIKE - PUSHBUTTON "Cancel", IDCANCEL, 191, 220, 50, 14 + PUSHBUTTON "Cancel", IDCANCEL, 191, 220, 50, 14 DEFPUSHBUTTON "OK", IDOK, 137, 220, 50, 14 END @@ -113,7 +113,7 @@ BEGIN LTEXT "Högre",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10,NOT WS_GROUP | SS_CENTER GROUPBOX "&Färger",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,138,103,9 @@ -153,7 +153,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s and %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Bildskärm" IDS_CPLDESCRIPTION "Ändrar skrivbordsunderlägg och skärmsläckare." diff --git a/reactos/dll/cpl/desk/lang/uk-UA.rc b/reactos/dll/cpl/desk/lang/uk-UA.rc index 0eef7c46244..5cab1235c17 100644 --- a/reactos/dll/cpl/desk/lang/uk-UA.rc +++ b/reactos/dll/cpl/desk/lang/uk-UA.rc @@ -118,7 +118,7 @@ BEGIN LTEXT "Á³ëüøå",1816,93,130,21,8,NOT WS_GROUP LTEXT "",IDC_SETTINGS_RESOLUTION_TEXT,10,150,100,10, NOT WS_GROUP | SS_CENTER GROUPBOX "&ßê³ñòü êîëüîðîïåðåäà÷³",1817,125,120,115,43 - COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_SETTINGS_BPP,131,130,103,80,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",1813,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN, 131,148,103,9 @@ -158,7 +158,7 @@ BEGIN IDS_ADVANCEDTITLEFMT "%s ³ %s" END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Åêðàí" IDS_CPLDESCRIPTION "Âèáåð³òü â³äîáðàæåííÿ ðîáî÷îãî ñòîëó é çáåð³ãà÷à åêðàíó." diff --git a/reactos/dll/cpl/desk/screensaver.c b/reactos/dll/cpl/desk/screensaver.c index 1230830cc57..c24cf78620c 100644 --- a/reactos/dll/cpl/desk/screensaver.c +++ b/reactos/dll/cpl/desk/screensaver.c @@ -1,9 +1,9 @@ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Display Control Panel * FILE: dll/cpl/desk/screensaver.c * PURPOSE: Screen saver property page - * + * * PROGRAMMERS: Trevor McCort (lycan359@gmail.com) * Ged Murphy (gedmurphy@reactos.org) */ @@ -57,7 +57,7 @@ GetCurrentScreenSaverValue(LPTSTR lpValue) BufSize); if (lpBuf) { - Ret = RegQueryValueEx(hKey, + Ret = RegQueryValueEx(hKey, lpValue, 0, &Type, @@ -69,7 +69,7 @@ GetCurrentScreenSaverValue(LPTSTR lpValue) } RegCloseKey(hKey); - + return lpBuf; } @@ -118,7 +118,7 @@ SetScreenSaverPreviewBox(HWND hwndDlg, PGLOBAL_DATA pGlobalData) if (pGlobalData->Selection > 0) { - _stprintf(szCmdline, + _stprintf(szCmdline, _T("%s /p %u"), pGlobalData->ScreenSaverItems[pGlobalData->Selection].szFilename, hPreview); @@ -127,15 +127,15 @@ SetScreenSaverPreviewBox(HWND hwndDlg, PGLOBAL_DATA pGlobalData) si.cb = sizeof(si); ZeroMemory(&pGlobalData->PrevWindowPi, sizeof(pGlobalData->PrevWindowPi)); - if (!CreateProcess(NULL, - szCmdline, - NULL, - NULL, - FALSE, - 0, - NULL, - NULL, - &si, + if (!CreateProcess(NULL, + szCmdline, + NULL, + NULL, + FALSE, + 0, + NULL, + NULL, + &si, &pGlobalData->PrevWindowPi)) { pGlobalData->PrevWindowPi.hThread = pGlobalData->PrevWindowPi.hProcess = NULL; @@ -157,7 +157,7 @@ WaitForSettingsDialog(HWND hwndDlg, 0, 0, PM_REMOVE)) - { + { if (msg.message == WM_QUIT) return FALSE; @@ -176,7 +176,7 @@ WaitForSettingsDialog(HWND hwndDlg, if (Ret == (WAIT_OBJECT_0)) { return TRUE; - } + } } } @@ -195,7 +195,7 @@ ScreensaverConfig(HWND hwndDlg, PGLOBAL_DATA pGlobalData) if (pGlobalData->Selection < 1) return; - _stprintf(szCmdline, + _stprintf(szCmdline, _T("%s /c:%u"), pGlobalData->ScreenSaverItems[pGlobalData->Selection].szFilename, hwndDlg); @@ -252,7 +252,7 @@ ScreensaverPreview(HWND hwndDlg, PGLOBAL_DATA pGlobalData) pGlobalData->PrevWindowPi.hThread = pGlobalData->PrevWindowPi.hProcess = NULL; } - _stprintf(szCmdline, + _stprintf(szCmdline, _T("%s /s"), pGlobalData->ScreenSaverItems[pGlobalData->Selection].szFilename); @@ -421,10 +421,10 @@ SetScreenSaver(HWND hwndDlg, PGLOBAL_DATA pGlobalData) { HKEY regKey; - if (RegOpenKeyEx(HKEY_CURRENT_USER, + if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Desktop"), - 0, - KEY_ALL_ACCESS, + 0, + KEY_ALL_ACCESS, ®Key) == ERROR_SUCCESS) { INT Time; @@ -435,7 +435,7 @@ SetScreenSaver(HWND hwndDlg, PGLOBAL_DATA pGlobalData) /* set the screensaver */ if (pGlobalData->ScreenSaverItems[pGlobalData->Selection].bIsScreenSaver) { - RegSetValueEx(regKey, + RegSetValueEx(regKey, _T("SCRNSAVE.EXE"), 0, REG_SZ, @@ -449,7 +449,7 @@ SetScreenSaver(HWND hwndDlg, PGLOBAL_DATA pGlobalData) } /* set the screensaver time delay */ - Time = GetDlgItemInt(hwndDlg, + Time = GetDlgItemInt(hwndDlg, IDC_SCREENS_TIMEDELAY, &bRet, FALSE); @@ -485,15 +485,15 @@ SetScreenSaver(HWND hwndDlg, PGLOBAL_DATA pGlobalData) } -static BOOL +static BOOL OnInitDialog(HWND hwndDlg, PGLOBAL_DATA pGlobalData) { LPTSTR lpCurSs; HWND hwndSSCombo = GetDlgItem(hwndDlg, IDC_SCREENS_LIST); INT Num; - pGlobalData = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, + pGlobalData = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA)); if (!pGlobalData) { @@ -537,7 +537,7 @@ OnInitDialog(HWND hwndDlg, PGLOBAL_DATA pGlobalData) if (bFound) { - Num = SendMessage(hwndSSCombo, + Num = SendMessage(hwndSSCombo, CB_FINDSTRINGEXACT, -1, (LPARAM)pGlobalData->ScreenSaverItems[i].szDisplayName); @@ -651,7 +651,7 @@ ScreenSaverPageProc(HWND hwndDlg, } break; } - + case IDC_SCREENS_TIMEDELAY: { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); diff --git a/reactos/dll/cpl/hdwwiz/hdwwiz.c b/reactos/dll/cpl/hdwwiz/hdwwiz.c index 23e2e6df09b..d8907c422d6 100644 --- a/reactos/dll/cpl/hdwwiz/hdwwiz.c +++ b/reactos/dll/cpl/hdwwiz/hdwwiz.c @@ -37,7 +37,7 @@ static LONG APIENTRY Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam); HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[] = +APPLET Applets[] = { {IDI_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, Applet} }; diff --git a/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc b/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc index 87bb07402cc..2bc79793ba2 100644 --- a/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc +++ b/reactos/dll/cpl/hdwwiz/lang/nl-NL.rc @@ -4,4 +4,4 @@ STRINGTABLE BEGIN IDS_CPLNAME "Hardware toevoegen" IDS_CPLDESCRIPTION "Voeg hardware toe aan uw computer." -END +END diff --git a/reactos/dll/cpl/input/add.c b/reactos/dll/cpl/input/add.c index 29b98f9dea4..85bc3e7d5bb 100644 --- a/reactos/dll/cpl/input/add.c +++ b/reactos/dll/cpl/input/add.c @@ -54,7 +54,7 @@ VOID CreateLangStruct(VOID) { UINT Count; TCHAR Layout[256]; - + for(Count = 0; Count < END_LAYOUT - BEGIN_LAYOUT; Count++) { LoadString(hApplet, @@ -103,7 +103,7 @@ CreateLanguagesList(HWND hWnd) IDS_SELECTED_LANGUAGE, LangSel, sizeof(LangSel) / sizeof(TCHAR)); - + SendMessage(hLanguageList, CB_SELECTSTRING, (WPARAM) -1, @@ -115,7 +115,7 @@ VOID SelectCurrentLayout(HWND hWnd) { TCHAR Layout[256]; - + LoadString(hApplet, IDS_SELECTED_LAYOUT, Layout, @@ -153,7 +153,7 @@ AddDlgProc(HWND hDlg, } break; case IDOK: - + break; case IDCANCEL: EndDialog(hDlg,LOWORD(wParam)); diff --git a/reactos/dll/cpl/input/advanced.c b/reactos/dll/cpl/input/advanced.c index 9ba1e4b3eca..959b4aea0a0 100644 --- a/reactos/dll/cpl/input/advanced.c +++ b/reactos/dll/cpl/input/advanced.c @@ -49,7 +49,7 @@ AdvancedPageProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) switch(uMsg) { case WM_INITDIALOG: - + break; case WM_COMMAND: switch (LOWORD(wParam)) diff --git a/reactos/dll/cpl/input/changekeyseq.c b/reactos/dll/cpl/input/changekeyseq.c index 0c43339dc12..37409bbee6e 100644 --- a/reactos/dll/cpl/input/changekeyseq.c +++ b/reactos/dll/cpl/input/changekeyseq.c @@ -51,14 +51,14 @@ ChangeKeySeqDlgProc(HWND hDlg, { case WM_INITDIALOG: { - + } case WM_COMMAND: { switch (LOWORD(wParam)) { case IDOK: - + break; case IDCANCEL: EndDialog(hDlg,LOWORD(wParam)); diff --git a/reactos/dll/cpl/input/input.c b/reactos/dll/cpl/input/input.c index 6e55d93ed0c..2f4b681ecf0 100644 --- a/reactos/dll/cpl/input/input.c +++ b/reactos/dll/cpl/input/input.c @@ -45,7 +45,7 @@ LONG CALLBACK SystemApplet(VOID); HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet} }; diff --git a/reactos/dll/cpl/input/inputlangprop.c b/reactos/dll/cpl/input/inputlangprop.c index b1ccb69aa98..f732914ba4b 100644 --- a/reactos/dll/cpl/input/inputlangprop.c +++ b/reactos/dll/cpl/input/inputlangprop.c @@ -44,7 +44,7 @@ VOID SelectKeyboardLayout(HWND hWnd) { TCHAR Layout[256]; - + SendMessage(hWnd, CB_SELECTSTRING, (WPARAM) -1, @@ -71,7 +71,7 @@ InputLangPropDlgProc(HWND hDlg, switch (LOWORD(wParam)) { case IDOK: - + break; case IDCANCEL: EndDialog(hDlg,LOWORD(wParam)); diff --git a/reactos/dll/cpl/input/keysettings.c b/reactos/dll/cpl/input/keysettings.c index 719c495c1f4..f30c30bcb84 100644 --- a/reactos/dll/cpl/input/keysettings.c +++ b/reactos/dll/cpl/input/keysettings.c @@ -51,7 +51,7 @@ KeySettingsDlgProc(HWND hDlg, { case WM_INITDIALOG: { - + } case WM_COMMAND: { @@ -64,7 +64,7 @@ KeySettingsDlgProc(HWND hDlg, ChangeKeySeqDlgProc); break; case IDOK: - + break; case IDCANCEL: EndDialog(hDlg,LOWORD(wParam)); diff --git a/reactos/dll/cpl/input/lang/de-DE.rc b/reactos/dll/cpl/input/lang/de-DE.rc index 3b95b479741..b5fdb2f614b 100644 --- a/reactos/dll/cpl/input/lang/de-DE.rc +++ b/reactos/dll/cpl/input/lang/de-DE.rc @@ -229,7 +229,7 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON "Cancel", IDCANCEL, 212, 47, 50, 14 } -STRINGTABLE +STRINGTABLE BEGIN //Selected language on "Add Input language" IDS_SELECTED_LANGUAGE "English (United States)" diff --git a/reactos/dll/cpl/input/lang/en-US.rc b/reactos/dll/cpl/input/lang/en-US.rc index e1212c421f4..34ebc1a1072 100644 --- a/reactos/dll/cpl/input/lang/en-US.rc +++ b/reactos/dll/cpl/input/lang/en-US.rc @@ -229,13 +229,13 @@ BEGIN PUSHBUTTON "Cancel", IDCANCEL, 169, 53, 52, 14 END -STRINGTABLE +STRINGTABLE BEGIN //Selected language on "Add Input language" IDS_SELECTED_LANGUAGE "English (United States)" //Selected keyboard layout on "Add Input language" IDS_SELECTED_LAYOUT, "United States-Dvorak" - + IDS_CPLSYSTEMNAME "Text Services and Input Languages" IDS_CPLSYSTEMDESCRIPTION "Customizes settings for text input of languages." IDS_US_LAYOUT, "US" diff --git a/reactos/dll/cpl/input/lang/fr-FR.rc b/reactos/dll/cpl/input/lang/fr-FR.rc index d9415a3026f..2c8324c8ab8 100644 --- a/reactos/dll/cpl/input/lang/fr-FR.rc +++ b/reactos/dll/cpl/input/lang/fr-FR.rc @@ -231,7 +231,7 @@ FONT 8, "MS Shell Dlg" /* FIXME : To improve/complete */ /* FIXME : À améliorer/compléter */ -STRINGTABLE +STRINGTABLE BEGIN //Selected language on "Add Input language" IDS_SELECTED_LANGUAGE "Anglais (États-Unis)" diff --git a/reactos/dll/cpl/input/lang/uk-UA.rc b/reactos/dll/cpl/input/lang/uk-UA.rc index 9cf3bd9aa11..a9e47b01d4c 100644 --- a/reactos/dll/cpl/input/lang/uk-UA.rc +++ b/reactos/dll/cpl/input/lang/uk-UA.rc @@ -237,7 +237,7 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 212, 47, 50, 14 } -STRINGTABLE +STRINGTABLE BEGIN //Selected language on "Add Input language" ("Äîäàâàííÿ ìîâè ââîäó") IDS_SELECTED_LANGUAGE "English (United States)" diff --git a/reactos/dll/cpl/input/langbar.c b/reactos/dll/cpl/input/langbar.c index 643173bab88..1f56efe5f26 100644 --- a/reactos/dll/cpl/input/langbar.c +++ b/reactos/dll/cpl/input/langbar.c @@ -51,14 +51,14 @@ LangBarDlgProc(HWND hDlg, { case WM_INITDIALOG: { - + } case WM_COMMAND: { switch (LOWORD(wParam)) { case IDOK: - + break; case IDCANCEL: EndDialog(hDlg,LOWORD(wParam)); diff --git a/reactos/dll/cpl/input/misc.c b/reactos/dll/cpl/input/misc.c index a7f2ee490d0..a2364b572a1 100644 --- a/reactos/dll/cpl/input/misc.c +++ b/reactos/dll/cpl/input/misc.c @@ -25,7 +25,7 @@ * UPDATE HISTORY: * 06-09-2007 Created */ - + #include #include #include @@ -38,14 +38,14 @@ #include "resource.h" #include "input.h" - + VOID CreateKeyboardLayoutList(HWND hWnd) { TCHAR Layout[256]; int Index; UINT loIndex; - + for ( loIndex = BEGIN_LAYOUT; loIndex <= END_LAYOUT; loIndex++ ) { LoadString(hApplet, diff --git a/reactos/dll/cpl/input/settings.c b/reactos/dll/cpl/input/settings.c index 74593565601..b6ebe605012 100644 --- a/reactos/dll/cpl/input/settings.c +++ b/reactos/dll/cpl/input/settings.c @@ -57,17 +57,17 @@ CreateDefaultLangList(HWND hWnd) return FALSE; } RegQueryInfoKey(hKey,NULL,NULL,NULL,NULL,NULL,NULL,&cValues,NULL,NULL,NULL,NULL); - + if (cValues) { - for (Count = 0; Count < cValues; Count++) - { - szCount[0] = '\0'; + for (Count = 0; Count < cValues; Count++) + { + szCount[0] = '\0'; lRet = RegEnumValue(hKey,Count,(LPTSTR)szCount,&dwBufCLen,NULL,NULL,NULL,NULL); - - sprintf(szCount,"%d",Count + 1); + + sprintf(szCount,"%d",Count + 1); RegQueryValueEx(hKey,(LPTSTR)szCount,NULL,NULL,(LPBYTE)szPreload,&dwBufLen); - + Lcid = wcstoul((LPTSTR)szPreload, NULL, 16); GetLocaleInfo(Lcid, LOCALE_SLANGUAGE, (LPTSTR)Lang, sizeof(Lang)); @@ -85,9 +85,9 @@ CreateDefaultLangList(HWND hWnd) } } - + RegCloseKey(hKey); - + return TRUE; } diff --git a/reactos/dll/cpl/intl/date.c b/reactos/dll/cpl/intl/date.c index 810fa7f87a1..fb932946f20 100644 --- a/reactos/dll/cpl/intl/date.c +++ b/reactos/dll/cpl/intl/date.c @@ -168,7 +168,7 @@ SetShortDateFormat(HWND hwndDlg, LCID lcid) _T("Error"), MB_OK | MB_ICONERROR); return FALSE; } - + } if (OpenApostFlg) @@ -226,7 +226,7 @@ SetLongDateFormat(HWND hwndDlg, LCID lcid) _T("Error"), MB_OK | MB_ICONERROR); return FALSE; } - + } if (OpenApostFlg) diff --git a/reactos/dll/cpl/intl/intl.c b/reactos/dll/cpl/intl/intl.c index 16a2cf379df..fe6b2c75b3d 100644 --- a/reactos/dll/cpl/intl/intl.c +++ b/reactos/dll/cpl/intl/intl.c @@ -46,7 +46,7 @@ DWORD UnattendLCID = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { {IDC_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, Applet} }; @@ -91,7 +91,7 @@ OpenSetupInf(VOID) } lpSwitch[len-1] = _T('\0'); - + hSetupInf = SetupOpenInfFile(&lpSwitch[4], NULL, INF_STYLE_OLDNT, @@ -124,7 +124,7 @@ ParseSetupInf(VOID) SetupCloseInfFile(hSetupInf); return; } - + UnattendLCID = _tcstoul(szBuffer, NULL, 16); IsUnattendedSetupEnabled = 1; SetupCloseInfFile(hSetupInf); @@ -164,7 +164,7 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) /* Control Panel Callback */ -LONG APIENTRY +LONG APIENTRY CPlApplet(HWND hwndCpl, UINT uMsg, LPARAM lParam1, diff --git a/reactos/dll/cpl/intl/intl.h b/reactos/dll/cpl/intl/intl.h index d9741b16a3b..78f898d7f3c 100644 --- a/reactos/dll/cpl/intl/intl.h +++ b/reactos/dll/cpl/intl/intl.h @@ -31,7 +31,7 @@ LanguagesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - + /* advanced.c */ INT_PTR CALLBACK AdvancedPageProc(HWND hwndDlg, diff --git a/reactos/dll/cpl/intl/lang/bg-BG.rc b/reactos/dll/cpl/intl/lang/bg-BG.rc index 38dbf000547..dc1cdc16bca 100644 --- a/reactos/dll/cpl/intl/lang/bg-BG.rc +++ b/reactos/dll/cpl/intl/lang/bg-BG.rc @@ -13,7 +13,7 @@ BEGIN COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "Íà&ãëàñÿâàíå...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Îáðàçöè:", -1, 14, 73, 70, 10 - LTEXT "×èñëà:", -1, 16, 86, 48, 10 + LTEXT "×èñëà:", -1, 16, 86, 48, 10 LTEXT "Ïàðè:", -1, 16, 101, 48, 10 LTEXT "Âðåìå:", -1, 16, 116, 48, 10 LTEXT "Êðàòêà äàòà:", -1, 16, 131, 48, 10 diff --git a/reactos/dll/cpl/intl/lang/de-DE.rc b/reactos/dll/cpl/intl/lang/de-DE.rc index 381d705a6b5..c389c7800ea 100644 --- a/reactos/dll/cpl/intl/lang/de-DE.rc +++ b/reactos/dll/cpl/intl/lang/de-DE.rc @@ -11,7 +11,7 @@ BEGIN COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "&Anpassen...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Beispiele", -1, 14, 73, 70, 10 - LTEXT "Zahl:", -1, 16, 86, 48, 10 + LTEXT "Zahl:", -1, 16, 86, 48, 10 LTEXT "Währung:", -1, 16, 101, 48, 10 LTEXT "Zeit:", -1, 16, 116, 48, 10 LTEXT "Kurzes Datum:", -1, 16, 131, 48, 10 diff --git a/reactos/dll/cpl/intl/lang/en-US.rc b/reactos/dll/cpl/intl/lang/en-US.rc index a3a3e6bf7b4..fe0cbd9c243 100644 --- a/reactos/dll/cpl/intl/lang/en-US.rc +++ b/reactos/dll/cpl/intl/lang/en-US.rc @@ -13,7 +13,7 @@ BEGIN COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "Customi&ze...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Samples", -1, 14, 73, 70, 10 - LTEXT "Number:", -1, 16, 86, 48, 10 + LTEXT "Number:", -1, 16, 86, 48, 10 LTEXT "Monetary:", -1, 16, 101, 48, 10 LTEXT "Time:", -1, 16, 116, 48, 10 LTEXT "Short date:", -1, 16, 131, 48, 10 diff --git a/reactos/dll/cpl/intl/lang/es-ES.rc b/reactos/dll/cpl/intl/lang/es-ES.rc index 107e966a7a0..4001738f29e 100644 --- a/reactos/dll/cpl/intl/lang/es-ES.rc +++ b/reactos/dll/cpl/intl/lang/es-ES.rc @@ -74,7 +74,7 @@ BEGIN LTEXT "Formato de Notación del Tiempo\n\n\ h = hora m = minuto s = segundo t = am ó pm\n\n\ h = 12 houras H = 24 houras\n\ - hh, mm, ss = cero inicial h, m, s = sin cero inicial", + hh, mm, ss = cero inicial h, m, s = sin cero inicial", -1, 13, 133, 214, 47, WS_CHILD |WS_VISIBLE | WS_GROUP END diff --git a/reactos/dll/cpl/intl/lang/fr-FR.rc b/reactos/dll/cpl/intl/lang/fr-FR.rc index dbe1727b58d..c5c21289695 100644 --- a/reactos/dll/cpl/intl/lang/fr-FR.rc +++ b/reactos/dll/cpl/intl/lang/fr-FR.rc @@ -14,7 +14,7 @@ BEGIN COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "Personnaliser...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Exemples", -1, 14, 73, 70, 10 - LTEXT "Nombre:", -1, 16, 86, 48, 10 + LTEXT "Nombre:", -1, 16, 86, 48, 10 LTEXT "Monnaie:", -1, 16, 101, 48, 10 LTEXT "Heure:", -1, 16, 116, 48, 10 LTEXT "Date courte:", -1, 16, 131, 48, 10 diff --git a/reactos/dll/cpl/intl/lang/it-IT.rc b/reactos/dll/cpl/intl/lang/it-IT.rc index 626eb98d41a..96a94a96447 100644 --- a/reactos/dll/cpl/intl/lang/it-IT.rc +++ b/reactos/dll/cpl/intl/lang/it-IT.rc @@ -14,7 +14,7 @@ BEGIN COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "&Personalizza...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Esempi", -1, 14, 73, 70, 10 - LTEXT "Numero:", -1, 16, 86, 48, 10 + LTEXT "Numero:", -1, 16, 86, 48, 10 LTEXT "Valuta:", -1, 16, 101, 48, 10 LTEXT "Ota:", -1, 16, 116, 48, 10 LTEXT "Data breve:", -1, 16, 131, 48, 10 diff --git a/reactos/dll/cpl/intl/lang/ru-RU.rc b/reactos/dll/cpl/intl/lang/ru-RU.rc index a6ce4e2ec66..febbb481143 100644 --- a/reactos/dll/cpl/intl/lang/ru-RU.rc +++ b/reactos/dll/cpl/intl/lang/ru-RU.rc @@ -11,7 +11,7 @@ BEGIN COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "Íàñòðî&éêà...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Îáðàçöû", -1, 14, 73, 70, 10 - LTEXT "×èñëî:", -1, 16, 86, 48, 10 + LTEXT "×èñëî:", -1, 16, 86, 48, 10 LTEXT "Ñóììà äåíåã:", -1, 16, 101, 48, 10 LTEXT "Âðåìÿ:", -1, 16, 116, 48, 10 LTEXT "Êîðîòêàÿ äàòà:", -1, 16, 131, 55, 10 @@ -23,7 +23,7 @@ BEGIN EDITTEXT IDC_FULLTIMESAMPLE_EDIT, 89, 146, 140, 12, ES_READONLY | WS_CHILD | WS_VISIBLE | WS_GROUP GROUPBOX "Ãåîãðàôè÷åñêîãî ðàñïîëîæåíèå", -1, 5, 172, 234, 55 LTEXT "&Óêàæèòå âàøå ðàñïîëîæåíèå äëÿ òîãî, ÷òîáû ñëóæáû ìîãëè ñíàáæàòü âàñ ìåñòíîé èíôîðìàöèåé, íàïðèìåð, íîâîñòÿìè è ñâîäêàìè ïîãîäû:", -1, 14, 184, 210, 24 - COMBOBOX IDC_LOCATION_COMBO, 14, 207, 217, 40, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_LOCATION_COMBO, 14, 207, 217, 40, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SORT END diff --git a/reactos/dll/cpl/intl/lang/sv-SE.rc b/reactos/dll/cpl/intl/lang/sv-SE.rc index 5146f10c2e3..678d727c7c5 100644 --- a/reactos/dll/cpl/intl/lang/sv-SE.rc +++ b/reactos/dll/cpl/intl/lang/sv-SE.rc @@ -8,7 +8,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Generellt" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Primärt språk", -1, 8, 11, 228, 74 + GROUPBOX "Primärt språk", -1, 8, 11, 228, 74 ICON IDC_FLAGS, IDC_ICON1, 12, 26, 21, 20, SS_ICON LTEXT "Välj det språk och den region du vill använda:", -1, 38, 25, 193, 22 COMBOBOX IDC_LANGUAGELIST, 39, 49, 191, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL diff --git a/reactos/dll/cpl/intl/lang/uk-UA.rc b/reactos/dll/cpl/intl/lang/uk-UA.rc index 9bab6958ec1..53154eca7c8 100644 --- a/reactos/dll/cpl/intl/lang/uk-UA.rc +++ b/reactos/dll/cpl/intl/lang/uk-UA.rc @@ -19,7 +19,7 @@ BEGIN COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "Íàñòðî&éêà...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Çðàçêè", -1, 14, 73, 70, 10 - LTEXT "×èñëî:", -1, 16, 86, 48, 10 + LTEXT "×èñëî:", -1, 16, 86, 48, 10 LTEXT "Ñóìà ãðîøåé:", -1, 16, 101, 48, 10 LTEXT "×àñ:", -1, 16, 116, 48, 10 LTEXT "Êîðîòêà äàòà:", -1, 16, 131, 48, 10 @@ -31,7 +31,7 @@ BEGIN EDITTEXT IDC_FULLTIMESAMPLE_EDIT, 89, 146, 140, 12, ES_READONLY | WS_CHILD | WS_VISIBLE | WS_GROUP GROUPBOX "Ãåîãðàô³÷íå ðîçòàøóâàííÿ", -1, 5, 172, 234, 55 LTEXT "Óêàæ³òü âàøå ïîòî÷íå ðîçòàøóâàííÿ, ùîá ñëóæáè ìîãëè íàäàâàòè âàì ì³ñöåâó ³íôîðìàö³þ, íàïðèêëàä, íîâèíè òà ïðîãíîç ïîãîäè", -1, 14, 184, 210, 24 - COMBOBOX IDC_LOCATION_COMBO, 14, 207, 217, 40, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + COMBOBOX IDC_LOCATION_COMBO, 14, 207, 217, 40, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SORT END diff --git a/reactos/dll/cpl/liccpa/lang/de-DE.rc b/reactos/dll/cpl/liccpa/lang/de-DE.rc index bf6c85642cd..98d1a0babd8 100644 --- a/reactos/dll/cpl/liccpa/lang/de-DE.rc +++ b/reactos/dll/cpl/liccpa/lang/de-DE.rc @@ -21,7 +21,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "Lizenz Manager" IDS_CPLDESCRIPTION_1 "Lizenz Manager" diff --git a/reactos/dll/cpl/liccpa/lang/en-US.rc b/reactos/dll/cpl/liccpa/lang/en-US.rc index f0df53f265d..d76c89f3599 100644 --- a/reactos/dll/cpl/liccpa/lang/en-US.rc +++ b/reactos/dll/cpl/liccpa/lang/en-US.rc @@ -19,7 +19,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "License Manager" IDS_CPLDESCRIPTION_1 "License Manager" diff --git a/reactos/dll/cpl/liccpa/lang/es-ES.rc b/reactos/dll/cpl/liccpa/lang/es-ES.rc index cf89a50baef..f688fdfc90e 100644 --- a/reactos/dll/cpl/liccpa/lang/es-ES.rc +++ b/reactos/dll/cpl/liccpa/lang/es-ES.rc @@ -19,7 +19,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "License Manager" IDS_CPLDESCRIPTION_1 "License Manager" diff --git a/reactos/dll/cpl/liccpa/lang/id-ID.rc b/reactos/dll/cpl/liccpa/lang/id-ID.rc index df7b13ecde7..1e972d42767 100644 --- a/reactos/dll/cpl/liccpa/lang/id-ID.rc +++ b/reactos/dll/cpl/liccpa/lang/id-ID.rc @@ -19,7 +19,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "Manajer Lisensi" IDS_CPLDESCRIPTION_1 "Manajer Lisensi" diff --git a/reactos/dll/cpl/liccpa/lang/it-IT.rc b/reactos/dll/cpl/liccpa/lang/it-IT.rc index 6472f96e9de..656a1b40e7c 100644 --- a/reactos/dll/cpl/liccpa/lang/it-IT.rc +++ b/reactos/dll/cpl/liccpa/lang/it-IT.rc @@ -20,7 +20,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "Gestione licenze" IDS_CPLDESCRIPTION_1 "Gestione licenze" diff --git a/reactos/dll/cpl/liccpa/lang/ja-JP.rc b/reactos/dll/cpl/liccpa/lang/ja-JP.rc index 2dd9c0bf95b..556047aa191 100644 --- a/reactos/dll/cpl/liccpa/lang/ja-JP.rc +++ b/reactos/dll/cpl/liccpa/lang/ja-JP.rc @@ -19,7 +19,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "ƒ‰ƒCƒZƒ“ƒX ƒ}ƒl[ƒWƒƒ" IDS_CPLDESCRIPTION_1 "ƒ‰ƒCƒZƒ“ƒX ƒ}ƒl[ƒWƒƒ" diff --git a/reactos/dll/cpl/liccpa/lang/pl-PL.rc b/reactos/dll/cpl/liccpa/lang/pl-PL.rc index 4cacb5fff46..1b3abd01237 100644 --- a/reactos/dll/cpl/liccpa/lang/pl-PL.rc +++ b/reactos/dll/cpl/liccpa/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translated by xrogers -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_PROPPAGE1 DIALOG DISCARDABLE 20, 40, 315, 104 @@ -24,7 +24,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "Mened¿er licencji" IDS_CPLDESCRIPTION_1 "Mened¿er licencji" diff --git a/reactos/dll/cpl/liccpa/lang/ru-RU.rc b/reactos/dll/cpl/liccpa/lang/ru-RU.rc index f685061a1ff..c91189de382 100644 --- a/reactos/dll/cpl/liccpa/lang/ru-RU.rc +++ b/reactos/dll/cpl/liccpa/lang/ru-RU.rc @@ -19,7 +19,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "Ìåíåäæåð ëèöåíçèé" IDS_CPLDESCRIPTION_1 "Ìåíåäæåð ëèöåíçèé" diff --git a/reactos/dll/cpl/liccpa/lang/uk-UA.rc b/reactos/dll/cpl/liccpa/lang/uk-UA.rc index 90af3870923..e42b003df46 100644 --- a/reactos/dll/cpl/liccpa/lang/uk-UA.rc +++ b/reactos/dll/cpl/liccpa/lang/uk-UA.rc @@ -27,7 +27,7 @@ BEGIN CONTROL "", 114, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 187, 39, 32, 12 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME_1 "Ìåíåäæåð ë³öåíç³é" IDS_CPLDESCRIPTION_1 "Ìåíåäæåð ë³öåíç³é" diff --git a/reactos/dll/cpl/liccpa/liccpa.c b/reactos/dll/cpl/liccpa/liccpa.c index a5b94383af4..f3502c76d8b 100644 --- a/reactos/dll/cpl/liccpa/liccpa.c +++ b/reactos/dll/cpl/liccpa/liccpa.c @@ -4,7 +4,7 @@ * PROJECT: ReactOS License Manager * FILE: dll/cpl/liccpa/liccpa.c * PURPOSE: License Manager GUI - * + * * PROGRAMMERS: Steven Edwards (steven_ed4153@yahoo.com) * * NOTES: diff --git a/reactos/dll/cpl/main/lang/cs-CZ.rc b/reactos/dll/cpl/main/lang/cs-CZ.rc index 09bd6858d4f..8df18fc7d0a 100644 --- a/reactos/dll/cpl/main/lang/cs-CZ.rc +++ b/reactos/dll/cpl/main/lang/cs-CZ.rc @@ -63,7 +63,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Funkce ClickLock", -1, 5, 150, 230, 70 CHECKBOX "&Zapnout funkci ClickLock", IDC_CHECK_CLICK_LOCK, 10, 160, 100, 20 - PUSHBUTTON "&Nastavení...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Nastavení...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Funkce ClickLock Vám umožní oznaèení nebo pøetažení bez držení tlaèítka myši. Krátkým stisknutím tlaèítka funkci zapnete, další stisknutí funkci vypne.", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/es-ES.rc b/reactos/dll/cpl/main/lang/es-ES.rc index b7e3d57a7cd..aa031c879c6 100644 --- a/reactos/dll/cpl/main/lang/es-ES.rc +++ b/reactos/dll/cpl/main/lang/es-ES.rc @@ -63,7 +63,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "ClickLock", -1, 5, 150, 230, 70 CHECKBOX "&Turn on ClickLock", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Settings...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Settings...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Enables you to highlight or drag without holding down the mouse button. To set, briefly press the mouse button. To release, click the mouse button again", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/fr-FR.rc b/reactos/dll/cpl/main/lang/fr-FR.rc index 5d77a3160db..22ca5e9ed41 100644 --- a/reactos/dll/cpl/main/lang/fr-FR.rc +++ b/reactos/dll/cpl/main/lang/fr-FR.rc @@ -63,7 +63,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Verrouillage clic", -1, 5, 150, 230, 70 CHECKBOX "&Activer le Verrouillage clic", IDC_CHECK_CLICK_LOCK, 10, 160, 95, 20 - PUSHBUTTON "&Paramètres...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 15 + PUSHBUTTON "&Paramètres...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 15 LTEXT "Vous permet de sélectionner ou de déplacer sans maintenir le bouton de la souris enfoncé. Pour activer, presser le bouton brièvement. Pour désactiver, presser de nouveau le bouton.", -1, 10, 180, 200, 30 END diff --git a/reactos/dll/cpl/main/lang/hu-HU.rc b/reactos/dll/cpl/main/lang/hu-HU.rc index 28c47db21d9..4c52b886ccb 100644 --- a/reactos/dll/cpl/main/lang/hu-HU.rc +++ b/reactos/dll/cpl/main/lang/hu-HU.rc @@ -63,7 +63,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "ClickLock", -1, 5, 150, 230, 70 CHECKBOX "&Turn on ClickLock", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Settings...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Settings...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Enables you to highlight or drag without holding down the mouse button. To set, briefly press the mouse button. To release, click the mouse button again", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/id-ID.rc b/reactos/dll/cpl/main/lang/id-ID.rc index da2e86088a5..e5806692dbf 100644 --- a/reactos/dll/cpl/main/lang/id-ID.rc +++ b/reactos/dll/cpl/main/lang/id-ID.rc @@ -63,7 +63,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Kunci Klik", -1, 5, 150, 230, 70 CHECKBOX "&Hidupkan KunciKlik", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Setelan...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Setelan...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Membolehkan anda untuk menerangi atau menggeser tanpa menekan tombol mouse. Untuk menyetel, cukup tekan tombol mouse. Untuk melepaskan, klik tombol mouse lagi", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/it-IT.rc b/reactos/dll/cpl/main/lang/it-IT.rc index b7c7cab8e32..7b3cd0d0259 100644 --- a/reactos/dll/cpl/main/lang/it-IT.rc +++ b/reactos/dll/cpl/main/lang/it-IT.rc @@ -65,7 +65,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Blocca clic", -1, 5, 150, 230, 70 CHECKBOX "&Abilita Blocca Clic", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Impostazioni...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Impostazioni...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Permette di selezionare e trascinare senza tenere premuto il tasto del mouse. Per attivare premere brevemente il tasto del mouse. Per disattivare, cliccare di nuovo", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/ja-JP.rc b/reactos/dll/cpl/main/lang/ja-JP.rc index ea529aa6c25..3d2d1b65fc1 100644 --- a/reactos/dll/cpl/main/lang/ja-JP.rc +++ b/reactos/dll/cpl/main/lang/ja-JP.rc @@ -63,7 +63,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "ClickLock", -1, 5, 150, 230, 70 CHECKBOX "&Turn on ClickLock", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Settings...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Settings...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Enables you to highlight or drag without holding down the mouse button. To set, briefly press the mouse button. To release, click the mouse button again", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/nl-NL.rc b/reactos/dll/cpl/main/lang/nl-NL.rc index dc65ecffeec..41eb9c9c770 100644 --- a/reactos/dll/cpl/main/lang/nl-NL.rc +++ b/reactos/dll/cpl/main/lang/nl-NL.rc @@ -64,7 +64,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Klikvergrendeling", -1, 5, 150, 230, 70 CHECKBOX "Klikvergren&deling inschakelen", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Instellingen...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Instellingen...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Hiermee kunt u selecteren en slepen zonder de muisknop ingedrukt te houden. Druk kort op de muisknop om in te schakelen. Druk nogmaals op de muisknop om weer uit te schakelen.", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/pl-PL.rc b/reactos/dll/cpl/main/lang/pl-PL.rc index 4b552e2329e..1c486d28f05 100644 --- a/reactos/dll/cpl/main/lang/pl-PL.rc +++ b/reactos/dll/cpl/main/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translation by xrogers - * xxrogers@users.sourceforge.net - * https://sourceforge.net/projects/reactospl - */ + * xxrogers@users.sourceforge.net + * https://sourceforge.net/projects/reactospl + */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -69,7 +69,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Blokada Klikniêcia", -1, 5, 150, 230, 70 CHECKBOX "&W³¹cz funkcjê Blokada Klikniêcia", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Ustawienia...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Ustawienia...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Umo¿liwia podœwietlanie lub przeci¹ganie bez przytrzymywania naciœniêtego przycisku myszy. Aby ustawiæ, naciœnij na krótko przycisk myszy. Aby zwolniæ, kliknij przycisk myszy ponownie.", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/lang/ru-RU.rc b/reactos/dll/cpl/main/lang/ru-RU.rc index 257dc3e4ef6..27d38fa8573 100644 --- a/reactos/dll/cpl/main/lang/ru-RU.rc +++ b/reactos/dll/cpl/main/lang/ru-RU.rc @@ -63,7 +63,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Çàëèïàíèå êíîïêè ìûøè", -1, 5, 150, 230, 70 CHECKBOX "&Âêëþ÷èòü çàëèïàíèå", IDC_CHECK_CLICK_LOCK, 10, 160, 84, 20 - PUSHBUTTON "&Ïàðàìåòðû...", IDC_BUTTON_CLICK_LOCK, 170, 160, 55, 14 + PUSHBUTTON "&Ïàðàìåòðû...", IDC_BUTTON_CLICK_LOCK, 170, 160, 55, 14 LTEXT "Ïîçâîëÿåò âûïîëíÿòü âûäåëåíèå è ïåðåòàñêèâàíèå áåç óäåðæèâàíèÿ êíîïêè íàæàòîé. Äëÿ âêëþ÷åíèÿ íåíàäîëãî çàäåðæèòå êíîïêó ìûøè â íàæàòîì ïîëîæåíèè. Äëÿ îñâîáîæäåíèÿ ñíîâà ñäåëàéòå ùåë÷îê.", -1, 10, 180, 200, 30 END diff --git a/reactos/dll/cpl/main/lang/uk-UA.rc b/reactos/dll/cpl/main/lang/uk-UA.rc index 1bb44c8a8b3..730e6c0c5b5 100644 --- a/reactos/dll/cpl/main/lang/uk-UA.rc +++ b/reactos/dll/cpl/main/lang/uk-UA.rc @@ -71,7 +71,7 @@ BEGIN CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_ICON | SS_NOTIFY | SS_CENTERIMAGE | WS_VISIBLE, 165, 85, 65, 57, WS_EX_STATICEDGE GROUPBOX "Çàëèïàííÿ êíîïêè ìèø³", -1, 5, 150, 230, 70 CHECKBOX "&Óâ³ìêíóòè çàëèïàííÿ", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 - PUSHBUTTON "&Ïàðàìåòðè...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + PUSHBUTTON "&Ïàðàìåòðè...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 LTEXT "Äîçâîëÿº âèêîíóâàòè âèä³ëåííÿ é ïåðåòÿãóâàííÿ, íå óòðèìóþ÷è êíîïêó ìèø³ íàòèñíóòîþ. Ùîá óâ³ìêíóòè öåé ðåæèì, íåíàäîâãî íàòèñí³òü êíîïêó ìèø³. Ùîá âèìêíóòè öåé ðåæèì, íàòèñí³òü êíîïêó ìèø³ ùå ðàç.", -1, 10, 180, 190, 30 END diff --git a/reactos/dll/cpl/main/main.c b/reactos/dll/cpl/main/main.c index 928f07719ec..bf1eee2e0fd 100644 --- a/reactos/dll/cpl/main/main.c +++ b/reactos/dll/cpl/main/main.c @@ -43,7 +43,7 @@ HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { {IDC_CPLICON_1, IDS_CPLNAME_1, IDS_CPLDESCRIPTION_1, MouseApplet}, {IDC_CPLICON_2, IDS_CPLNAME_2, IDS_CPLDESCRIPTION_2, KeyboardApplet} diff --git a/reactos/dll/cpl/mmsys/lang/cs-CZ.rc b/reactos/dll/cpl/mmsys/lang/cs-CZ.rc index 324acb7fc57..ed8fa59a816 100644 --- a/reactos/dll/cpl/mmsys/lang/cs-CZ.rc +++ b/reactos/dll/cpl/mmsys/lang/cs-CZ.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Zvuky a zvuková zaøízení" IDS_CPLDESCRIPTION "Upraví zvukové schéma Vašeho poèítaèe, nebo nastaví reproduktory a nahrávací zaøízení." diff --git a/reactos/dll/cpl/mmsys/lang/de-DE.rc b/reactos/dll/cpl/mmsys/lang/de-DE.rc index 0d228c268dc..f4afeb80719 100644 --- a/reactos/dll/cpl/mmsys/lang/de-DE.rc +++ b/reactos/dll/cpl/mmsys/lang/de-DE.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Sound und Audio Geräte" IDS_CPLDESCRIPTION "Ändert das Sound-Schema Ihres Computers, oder konfiguriert die Einstellungen für Ihre Lautsprecher und Aufnahmegeräte." diff --git a/reactos/dll/cpl/mmsys/lang/el-GR.rc b/reactos/dll/cpl/mmsys/lang/el-GR.rc index b0c97d75296..f3ba2ae8fd9 100644 --- a/reactos/dll/cpl/mmsys/lang/el-GR.rc +++ b/reactos/dll/cpl/mmsys/lang/el-GR.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "ÓõóêåõÝò Þ÷ïõ" IDS_CPLDESCRIPTION "ÁëëÜæåé ôï ó÷Þìá Þ÷ïõ ôïõ õðïëïãéóôÞ Þ ôñïðïðïéåß ôéò ñõèìßóåéò ãéá ôá ç÷åßá êáé ôéò óõóêåõÝò åããñáöÞò Þ÷ïõ." diff --git a/reactos/dll/cpl/mmsys/lang/en-US.rc b/reactos/dll/cpl/mmsys/lang/en-US.rc index 015378a6237..e6876fdf520 100644 --- a/reactos/dll/cpl/mmsys/lang/en-US.rc +++ b/reactos/dll/cpl/mmsys/lang/en-US.rc @@ -96,7 +96,7 @@ BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Sound and Audio Devices" IDS_CPLDESCRIPTION "Changes the sound scheme for your computer, or configure the settings for your speakers and recording devices." diff --git a/reactos/dll/cpl/mmsys/lang/es-ES.rc b/reactos/dll/cpl/mmsys/lang/es-ES.rc index c1e11b25520..be3ba714d50 100644 --- a/reactos/dll/cpl/mmsys/lang/es-ES.rc +++ b/reactos/dll/cpl/mmsys/lang/es-ES.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Dispositivos de Audio y Sonido" IDS_CPLDESCRIPTION "Cambia el esquema de sonidos de su computadora, o configura las propiedades de sus bocinas y dispositivos de grabación." diff --git a/reactos/dll/cpl/mmsys/lang/fr-FR.rc b/reactos/dll/cpl/mmsys/lang/fr-FR.rc index c5565315de8..f71ca16ad64 100644 --- a/reactos/dll/cpl/mmsys/lang/fr-FR.rc +++ b/reactos/dll/cpl/mmsys/lang/fr-FR.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Son et périphériques audio" IDS_CPLDESCRIPTION "Change le modèle de sons de votre ordinateur, ou configure les paramètres de vos hauts-parleurs et de vos périphériques d'enregistrement." diff --git a/reactos/dll/cpl/mmsys/lang/it-IT.rc b/reactos/dll/cpl/mmsys/lang/it-IT.rc index c81c220b666..45900a7fc9f 100644 --- a/reactos/dll/cpl/mmsys/lang/it-IT.rc +++ b/reactos/dll/cpl/mmsys/lang/it-IT.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Suoni e Dispositivi audio" IDS_CPLDESCRIPTION "Cambia lo schema dei suoni per il tuo computer o configura le impostazioni per gli altoparlanti e i dispositivi di registrazione." diff --git a/reactos/dll/cpl/mmsys/lang/nl-NL.rc b/reactos/dll/cpl/mmsys/lang/nl-NL.rc index e2d3218dd52..8621bf67e40 100644 --- a/reactos/dll/cpl/mmsys/lang/nl-NL.rc +++ b/reactos/dll/cpl/mmsys/lang/nl-NL.rc @@ -101,4 +101,4 @@ BEGIN IDS_CPLDESCRIPTION "Verander het geluidsschema van uw computer of configureer de aanwezige geluidsapparatuur." IDS_NO_SOUND "(None)" END - + diff --git a/reactos/dll/cpl/mmsys/lang/pl-PL.rc b/reactos/dll/cpl/mmsys/lang/pl-PL.rc index 267ece20a86..35aee797bb4 100644 --- a/reactos/dll/cpl/mmsys/lang/pl-PL.rc +++ b/reactos/dll/cpl/mmsys/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translated by xrogers -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_VOLUME DIALOGEX 0, 0, 246, 228 @@ -100,7 +100,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "DŸwiêk i urz¹dzenia audio" IDS_CPLDESCRIPTION "Zmieñ schemat dŸwiêkowy dla tego komputera lub skonfiguruj ustawienia g³oœników i urz¹dzeñ nagrywaj¹cych." diff --git a/reactos/dll/cpl/mmsys/lang/pt-BR.rc b/reactos/dll/cpl/mmsys/lang/pt-BR.rc index 1dfd9e92656..679a999d8c0 100644 --- a/reactos/dll/cpl/mmsys/lang/pt-BR.rc +++ b/reactos/dll/cpl/mmsys/lang/pt-BR.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Sons e dispositivos de audio" IDS_CPLDESCRIPTION "Altera o esquema de som para o seu computador ou define as configurações para os auto-falantes e dispositivos de gravação." diff --git a/reactos/dll/cpl/mmsys/lang/ru-RU.rc b/reactos/dll/cpl/mmsys/lang/ru-RU.rc index 99a68f975e1..6c40bea134f 100644 --- a/reactos/dll/cpl/mmsys/lang/ru-RU.rc +++ b/reactos/dll/cpl/mmsys/lang/ru-RU.rc @@ -95,7 +95,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Çâóê è àóäèîóñòðîéñòâà" IDS_CPLDESCRIPTION "Èçìåíåíèå çâóêîâûõ ñõåì âàøåãî êîìïüþòåðà, íàñòðîéêà êîëîíîê è çàïèñûâàþùèõ óñòðîéñòâ." diff --git a/reactos/dll/cpl/mmsys/lang/uk-UA.rc b/reactos/dll/cpl/mmsys/lang/uk-UA.rc index 5ac547a8891..16dd3b15258 100644 --- a/reactos/dll/cpl/mmsys/lang/uk-UA.rc +++ b/reactos/dll/cpl/mmsys/lang/uk-UA.rc @@ -103,7 +103,7 @@ FONT 8, "MS Shell Dlg" BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLNAME "Çâóêîâ³ ³ àóä³î ïðèñòðî¿" IDS_CPLDESCRIPTION "Çì³íà çâóêîâèõ ñõåì âàøîãî êîìï'þòåðà, íàñòðîþâàííÿ êîëîíîê ³ çàïèñóþ÷èõ ïðèñòðî¿â." diff --git a/reactos/dll/cpl/mmsys/mmsys.c b/reactos/dll/cpl/mmsys/mmsys.c index 9b376321a5f..f0eb4b00db0 100644 --- a/reactos/dll/cpl/mmsys/mmsys.c +++ b/reactos/dll/cpl/mmsys/mmsys.c @@ -55,7 +55,7 @@ DeviceCreateHardwarePageEx(HWND hWndParent, HINSTANCE hApplet = 0; /* Applets */ -const APPLET Applets[NUM_APPLETS] = +const APPLET Applets[NUM_APPLETS] = { {IDI_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, MmSysApplet}, }; diff --git a/reactos/dll/cpl/mmsys/mmsys.h b/reactos/dll/cpl/mmsys/mmsys.h index 13de70c0239..20960b7bea7 100644 --- a/reactos/dll/cpl/mmsys/mmsys.h +++ b/reactos/dll/cpl/mmsys/mmsys.h @@ -15,8 +15,8 @@ extern HINSTANCE hApplet; #define DRVM_MAPPER 0x2000 -#define DRVM_MAPPER_PREFERRED_GET (DRVM_MAPPER+21) -#define DRVM_MAPPER_PREFERRED_SET (DRVM_MAPPER+22) +#define DRVM_MAPPER_PREFERRED_GET (DRVM_MAPPER+21) +#define DRVM_MAPPER_PREFERRED_SET (DRVM_MAPPER+22) /* main.c */ diff --git a/reactos/dll/cpl/mmsys/sounds.c b/reactos/dll/cpl/mmsys/sounds.c index 04552d55010..099c65fcc67 100644 --- a/reactos/dll/cpl/mmsys/sounds.c +++ b/reactos/dll/cpl/mmsys/sounds.c @@ -133,7 +133,7 @@ LoadEventLabels() KEY_READ, &hSubKey) != ERROR_SUCCESS) { - return FALSE; + return FALSE; } dwCurKey = 0; @@ -189,7 +189,7 @@ AddSoundProfile(HWND hwndDlg, HKEY hKey, TCHAR * szSubKey, BOOL SetDefault) TCHAR szValue[MAX_PATH]; DWORD dwValue, dwResult; - if (RegOpenKeyEx(hKey, + if (RegOpenKeyEx(hKey, szSubKey, 0, KEY_READ, @@ -257,9 +257,9 @@ EnumerateSoundProfiles(HWND hwndDlg, HKEY hKey) KEY_READ, &hSubKey) != ERROR_SUCCESS) { - return FALSE; + return FALSE; } - + dwNumSchemes = 0; dwCurKey = 0; do @@ -293,7 +293,7 @@ PSOUND_SCHEME_CONTEXT FindSoundProfile(HWND hwndDlg, TCHAR * szName) { LRESULT lCount, lIndex, lResult; PSOUND_SCHEME_CONTEXT pScheme; - + lCount = SendDlgItemMessage(hwndDlg, IDC_SOUND_SCHEME, CB_GETCOUNT, (WPARAM)0, (LPARAM)0); if (lCount == CB_ERR) { @@ -382,7 +382,7 @@ ImportSoundLabel(HWND hwndDlg, HKEY hKey, TCHAR * szProfile, TCHAR * szLabelName pAppContext = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APP_CONTEXT)); Create = TRUE; } - + if (!pAppContext) { @@ -414,7 +414,7 @@ ImportSoundLabel(HWND hwndDlg, HKEY hKey, TCHAR * szProfile, TCHAR * szLabelName _tcscpy(pLabelContext->szName, szLabelName); pLabelContext->Next = pAppContext->LabelContext; pAppContext->LabelContext = pLabelContext; - + if (Create) { _tcscpy(pAppContext->szName, szAppName); @@ -635,7 +635,7 @@ LoadSoundProfiles(HWND hwndDlg) KEY_READ, &hSubKey) != ERROR_SUCCESS) { - return FALSE; + return FALSE; } dwNumSchemes = EnumerateSoundProfiles(hwndDlg, hSubKey); @@ -644,7 +644,7 @@ LoadSoundProfiles(HWND hwndDlg) if (dwNumSchemes) { //MessageBox(hwndDlg, _T("importing sound profiles..."), NULL, MB_OK); - ImportSoundProfiles(hwndDlg, hSubKey); + ImportSoundProfiles(hwndDlg, hSubKey); } RegCloseKey(hSubKey); return FALSE; @@ -659,7 +659,7 @@ LoadSoundFiles(HWND hwndDlg) HANDLE hFile; LRESULT lResult; UINT length; - + length = GetWindowsDirectory(szPath, sizeof(szPath) / sizeof(TCHAR)); if (length == 0 || length > (sizeof(szPath) / sizeof(TCHAR))) { @@ -756,7 +756,7 @@ ShowSoundScheme(HWND hwndDlg) PLABEL_CONTEXT pLabelContext = pAppContext->LabelContext; if (pLabelContext) { -#if 0 +#if 0 ZeroMemory(&listItem, sizeof(LV_ITEM)); listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; listItem.pszText = pAppContext->szDesc; @@ -865,7 +865,7 @@ SoundsDlgProc(HWND hwndDlg, SendDlgItemMessage(hwndDlg, IDC_SOUND_LIST, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)szValue); /// /// should store in current member - /// + /// _tcscpy(pLabelContext->szValue, szValue); if (_tcslen(szValue) && lIndex != 0) { diff --git a/reactos/dll/cpl/mmsys/volume.c b/reactos/dll/cpl/mmsys/volume.c index 160d10f89f1..b8516ce5a7e 100644 --- a/reactos/dll/cpl/mmsys/volume.c +++ b/reactos/dll/cpl/mmsys/volume.c @@ -78,7 +78,7 @@ InitVolumeControls(HWND hwndDlg) } SendDlgItemMessage(hwndDlg, IDC_DEVICE_NAME, WM_SETTEXT, (WPARAM)0, (LPARAM)woc.szPname); - + if (!(woc.dwSupport & WAVECAPS_VOLUME)) { /// the device does not support volume changes diff --git a/reactos/dll/cpl/ncpa/lang/bg-BG.rc b/reactos/dll/cpl/ncpa/lang/bg-BG.rc index 7643194328d..cd6febf9c08 100644 --- a/reactos/dll/cpl/ncpa/lang/bg-BG.rc +++ b/reactos/dll/cpl/ncpa/lang/bg-BG.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP àäðåñ:", -1, 22, 34, 80, 8 LTEXT "Ìðåæîâà ìàñêà:", -1, 22, 48, 80, 8 LTEXT "Ðàçïðåäåëèòåë (gateway):", -1, 22, 62, 80, 8 - + RTEXT "Íåíàëè÷íî", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Ïîäðîáíîñòè...", IDC_DETAILS, 22, 76, 62, 14 END @@ -101,7 +101,7 @@ BEGIN PUSHBUTTON "&Advanced", IDC_ADVANCED, 186, 209, 50, 14, WS_DISABLED | WS_TABSTOP END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Ìðåæîâè ñâîéñòâà" IDS_CPLSYSTEMDESCRIPTION "Íàñòðîéêà íà ìðåæàòà." @@ -113,7 +113,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Ðú÷íî íàñòðîåíî" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Ãðåøêà" IDS_ENTER_VALID_IPADDRESS "Òðÿáâà äà âúâåäåòå ïðàâèëåí IP àäðåñ" diff --git a/reactos/dll/cpl/ncpa/lang/cs-CZ.rc b/reactos/dll/cpl/ncpa/lang/cs-CZ.rc index 5c4f3d4df55..146db07889e 100644 --- a/reactos/dll/cpl/ncpa/lang/cs-CZ.rc +++ b/reactos/dll/cpl/ncpa/lang/cs-CZ.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP address:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Default gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN } -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Síová nastavení" IDS_CPLSYSTEMDESCRIPTION "Konigurace síových adaptérù a pøipojení" @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/da-DK.rc b/reactos/dll/cpl/ncpa/lang/da-DK.rc index 80f3f4ffa39..99b86487e9e 100644 --- a/reactos/dll/cpl/ncpa/lang/da-DK.rc +++ b/reactos/dll/cpl/ncpa/lang/da-DK.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP address:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Default gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN } -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Netværks Indstillinger" IDS_CPLSYSTEMDESCRIPTION "Tilpas dine Netværks Indstillinger." @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/de-DE.rc b/reactos/dll/cpl/ncpa/lang/de-DE.rc index 9f7244300ae..cf709d637eb 100644 --- a/reactos/dll/cpl/ncpa/lang/de-DE.rc +++ b/reactos/dll/cpl/ncpa/lang/de-DE.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP-Adresse:", -1, 22, 34, 80, 8 LTEXT "Subnetzmaske:", -1, 22, 48, 80, 8 LTEXT "Standardgateway:", -1, 22, 62, 80, 8 - + RTEXT "Nicht verfügbar", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -113,7 +113,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manuell konfiguriert" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Fehler" IDS_ENTER_VALID_IPADDRESS "Sie müssen eine gültige IP-Adresse angeben" diff --git a/reactos/dll/cpl/ncpa/lang/el-GR.rc b/reactos/dll/cpl/ncpa/lang/el-GR.rc index 41a82883fb3..eba362c2855 100644 --- a/reactos/dll/cpl/ncpa/lang/el-GR.rc +++ b/reactos/dll/cpl/ncpa/lang/el-GR.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "Äéåýèõíóç IP:", -1, 22, 34, 80, 8 LTEXT "Subnet Mask:", -1, 22, 48, 80, 8 LTEXT "Default Gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -101,7 +101,7 @@ BEGIN PUSHBUTTON "&Ãéá Ðñï÷ùñçìÝíïõò", IDC_ADVANCED, 186, 209, 50, 14, WS_DISABLED | WS_TABSTOP END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Éäéüôçôåò Äéêôýïõ" IDS_CPLSYSTEMDESCRIPTION "Ðáñáìåôñïðïéåß ôéò éäéüôçôåò äéêôýïõ." @@ -113,7 +113,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Ïñßóôçêå ÷åéñïêßíçôá" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "ÓöÜëìá" IDS_ENTER_VALID_IPADDRESS "ÐñÝðåé íá åéóÜãåôå ìéá Ýãêõñç äéåýèõíóç IP" diff --git a/reactos/dll/cpl/ncpa/lang/en-US.rc b/reactos/dll/cpl/ncpa/lang/en-US.rc index 06c212d1ecc..9b3f646cb44 100644 --- a/reactos/dll/cpl/ncpa/lang/en-US.rc +++ b/reactos/dll/cpl/ncpa/lang/en-US.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP Address:", -1, 22, 34, 80, 8 LTEXT "Subnet Mask:", -1, 22, 48, 80, 8 LTEXT "Default Gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -101,7 +101,7 @@ BEGIN PUSHBUTTON "&Advanced", IDC_ADVANCED, 186, 209, 50, 14, WS_DISABLED | WS_TABSTOP END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Network Properties" IDS_CPLSYSTEMDESCRIPTION "Customizes network settings." @@ -113,7 +113,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/es-ES.rc b/reactos/dll/cpl/ncpa/lang/es-ES.rc index 3dde557857f..d092b24cfac 100644 --- a/reactos/dll/cpl/ncpa/lang/es-ES.rc +++ b/reactos/dll/cpl/ncpa/lang/es-ES.rc @@ -71,12 +71,12 @@ BEGIN LTEXT "Dirección IP:", -1, 22, 34, 80, 8 LTEXT "Máscara de subred:", -1, 22, 48, 80, 8 LTEXT "Puerta de enlace pred:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Detalles...", IDC_DETAILS, 22, 76, 62, 14 END @@ -107,7 +107,7 @@ BEGIN } -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Propiedades de Red" IDS_CPLSYSTEMDESCRIPTION "Cambia las opciones de la red." @@ -119,7 +119,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/fr-FR.rc b/reactos/dll/cpl/ncpa/lang/fr-FR.rc index cdff6e0cd88..3b809993462 100644 --- a/reactos/dll/cpl/ncpa/lang/fr-FR.rc +++ b/reactos/dll/cpl/ncpa/lang/fr-FR.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "Adresse IP:", -1, 22, 34, 80, 8 LTEXT "Masque sous-réseau:", -1, 22, 48, 80, 8 LTEXT "Passerelle par défaut:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Détails...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Propriétés réseau" IDS_CPLSYSTEMDESCRIPTION "Modifie les paramètres réseau." @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Configurée manuellement" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Erreur" IDS_ENTER_VALID_IPADDRESS "Vous devez entrer une adresse IP valide" diff --git a/reactos/dll/cpl/ncpa/lang/hu-HU.rc b/reactos/dll/cpl/ncpa/lang/hu-HU.rc index ac9cfcf2a2a..b0813ce3620 100644 --- a/reactos/dll/cpl/ncpa/lang/hu-HU.rc +++ b/reactos/dll/cpl/ncpa/lang/hu-HU.rc @@ -68,12 +68,12 @@ BEGIN LTEXT "IP address:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Default gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -103,7 +103,7 @@ BEGIN } -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Hálózati beállítások" IDS_CPLSYSTEMDESCRIPTION "A hálózati kapcsolatok beállításai." @@ -115,7 +115,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/id-ID.rc b/reactos/dll/cpl/ncpa/lang/id-ID.rc index 4885c2c272f..eedf21061a6 100644 --- a/reactos/dll/cpl/ncpa/lang/id-ID.rc +++ b/reactos/dll/cpl/ncpa/lang/id-ID.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "Alamat IP:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Gateway standar:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Detil...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Properti Jaringan" IDS_CPLSYSTEMDESCRIPTION "Mengkustomisasi setelan jaringan." @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Salah" IDS_ENTER_VALID_IPADDRESS "Anda harus memasukkan alamat IP yang benar" diff --git a/reactos/dll/cpl/ncpa/lang/it-IT.rc b/reactos/dll/cpl/ncpa/lang/it-IT.rc index 0e0a346293c..3a5d112060d 100644 --- a/reactos/dll/cpl/ncpa/lang/it-IT.rc +++ b/reactos/dll/cpl/ncpa/lang/it-IT.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "Indirizzo IP:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Default gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Dettagli...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Proprietà" IDS_CPLSYSTEMDESCRIPTION "Personalizza le impostazioni di rete." @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Configurato manualmente" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Errore" IDS_ENTER_VALID_IPADDRESS "Devi indicare un indirizzo IP valido" diff --git a/reactos/dll/cpl/ncpa/lang/ja-JP.rc b/reactos/dll/cpl/ncpa/lang/ja-JP.rc index f718fb4d879..8f92d6211d7 100644 --- a/reactos/dll/cpl/ncpa/lang/ja-JP.rc +++ b/reactos/dll/cpl/ncpa/lang/ja-JP.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP address:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Default gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN } -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "ƒlƒbƒgƒ[ƒNÚ‘±" IDS_CPLSYSTEMDESCRIPTION "ƒlƒbƒgƒ[ƒN‚ÌÝ’è‚ð•ÏX‚µ‚Ü‚·B" @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/nl-NL.rc b/reactos/dll/cpl/ncpa/lang/nl-NL.rc index b5608d1f5cd..526c4e511a2 100644 --- a/reactos/dll/cpl/ncpa/lang/nl-NL.rc +++ b/reactos/dll/cpl/ncpa/lang/nl-NL.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP address:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Default gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN } -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Netwerk Eigenschappen" IDS_CPLSYSTEMDESCRIPTION "Netwerk instellingen aanpassen." @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/pl-PL.rc b/reactos/dll/cpl/ncpa/lang/pl-PL.rc index 1c5e7150d07..aa9bc91ad0d 100644 --- a/reactos/dll/cpl/ncpa/lang/pl-PL.rc +++ b/reactos/dll/cpl/ncpa/lang/pl-PL.rc @@ -69,12 +69,12 @@ BEGIN LTEXT "Adres IP:", -1, 22, 34, 80, 8 LTEXT "Maska podsieci:", -1, 22, 48, 80, 8 LTEXT "Domyœlna brama:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Szczegó³y...", IDC_DETAILS, 22, 76, 62, 14 END @@ -104,13 +104,13 @@ BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Ustawienia sieciowe" IDS_CPLSYSTEMDESCRIPTION "Zmiany ustawieñ sieci." END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "B³¹d" IDS_ENTER_VALID_IPADDRESS "Musisz wpisaæ poprawny adres IP" diff --git a/reactos/dll/cpl/ncpa/lang/ru-RU.rc b/reactos/dll/cpl/ncpa/lang/ru-RU.rc index a927653a18c..e6baf9a53eb 100644 --- a/reactos/dll/cpl/ncpa/lang/ru-RU.rc +++ b/reactos/dll/cpl/ncpa/lang/ru-RU.rc @@ -67,12 +67,12 @@ BEGIN LTEXT "IP àäðåñ:", -1, 22, 34, 80, 8 LTEXT "Ìàñêà ïîäñåòè:", -1, 22, 48, 80, 8 LTEXT "Øëþç ïî óìîë÷àíèþ:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Äîïîëíèòåëüíî...", IDC_DETAILS, 22, 76, 62, 14 END @@ -102,7 +102,7 @@ BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Ñåòåâûå íàñòðîéêè" IDS_CPLSYSTEMDESCRIPTION "Óñòàíàâëèâàåò íàñòðîéêè ñåòè." @@ -114,7 +114,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Íàñòðîåí âðó÷íóþ" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Îøèáêà" IDS_ENTER_VALID_IPADDRESS "Ââåäèòå ïðàâèëüíûé IP-àäðåñ" diff --git a/reactos/dll/cpl/ncpa/lang/sv-SE.rc b/reactos/dll/cpl/ncpa/lang/sv-SE.rc index e3c6919292f..d294ca19640 100644 --- a/reactos/dll/cpl/ncpa/lang/sv-SE.rc +++ b/reactos/dll/cpl/ncpa/lang/sv-SE.rc @@ -69,12 +69,12 @@ BEGIN LTEXT "IP address:", -1, 22, 34, 80, 8 LTEXT "SubNet mask:", -1, 22, 48, 80, 8 LTEXT "Default gateway:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END @@ -104,7 +104,7 @@ BEGIN } -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Nätverksanslutningar" IDS_CPLSYSTEMDESCRIPTION "Konfigurerar nätverksinställningar." @@ -116,7 +116,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Manually configured" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Error" IDS_ENTER_VALID_IPADDRESS "You must enter a valid IP address" diff --git a/reactos/dll/cpl/ncpa/lang/uk-UA.rc b/reactos/dll/cpl/ncpa/lang/uk-UA.rc index 300fd64c971..a627517f24c 100644 --- a/reactos/dll/cpl/ncpa/lang/uk-UA.rc +++ b/reactos/dll/cpl/ncpa/lang/uk-UA.rc @@ -75,12 +75,12 @@ BEGIN LTEXT "IP-àäðåñà:", -1, 22, 34, 80, 8 LTEXT "Ìàñêà ï³äìåðåæ³:", -1, 22, 48, 80, 8 LTEXT "Îñíîâíèé øëþç:", -1, 22, 62, 80, 8 - + RTEXT "N/A", IDC_DETAILSTYPE, 122, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSGATEWAY, 122, 62, 80, 8 - + PUSHBUTTON "&Ñêëàä...", IDC_DETAILS, 22, 76, 62, 14 END @@ -110,7 +110,7 @@ BEGIN END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Íàñòðîéêè ìåðåæ³" IDS_CPLSYSTEMDESCRIPTION "Âñòàíîâëþº íàñòðîéêè ìåðåæ³." @@ -122,7 +122,7 @@ BEGIN IDS_ASSIGNED_MANUAL "Íàëàøòîâàíî âðó÷íó" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ERROR "Ïîìèëêà" IDS_ENTER_VALID_IPADDRESS "Âè ìàºòå ââåñòè ïðàâèëüíó IP-àäðåñó" diff --git a/reactos/dll/cpl/ncpa/tcpip_properties.c b/reactos/dll/cpl/ncpa/tcpip_properties.c index 65b49d12b57..d6d7c6bd99d 100644 --- a/reactos/dll/cpl/ncpa/tcpip_properties.c +++ b/reactos/dll/cpl/ncpa/tcpip_properties.c @@ -63,10 +63,10 @@ DWORD APIENTRY DhcpNotifyConfigChange(LPWSTR ServerName, LPWSTR AdapterName, static void ManualDNS(HWND Dlg, BOOL Enabled, UINT uCmd) { - PTCPIP_PROPERTIES_DATA DlgData = + PTCPIP_PROPERTIES_DATA DlgData = (PTCPIP_PROPERTIES_DATA) GetWindowLongPtrW(Dlg, GWL_USERDATA); - if (! DlgData->OldDhcpEnabled && + if (! DlgData->OldDhcpEnabled && (uCmd == IDC_USEDHCP || uCmd == IDC_NODHCP)) { if (INADDR_NONE != DlgData->OldIpAddress) { SendDlgItemMessage(Dlg, IDC_IPADDR, IPM_SETADDRESS, 0, @@ -82,7 +82,7 @@ ManualDNS(HWND Dlg, BOOL Enabled, UINT uCmd) { } } - if (INADDR_NONE != DlgData->OldDns1 && + if (INADDR_NONE != DlgData->OldDns1 && (uCmd == IDC_FIXEDDNS || uCmd == IDC_AUTODNS || IDC_NODHCP)) { SendDlgItemMessage(Dlg, IDC_DNS1, IPM_SETADDRESS, 0, ntohl(DlgData->OldDns1)); @@ -101,7 +101,7 @@ ManualDNS(HWND Dlg, BOOL Enabled, UINT uCmd) { if (! Enabled) { SendDlgItemMessage(Dlg, IDC_DNS1, IPM_CLEARADDRESS, 0, 0); SendDlgItemMessage(Dlg, IDC_DNS2, IPM_CLEARADDRESS, 0, 0); - + } } @@ -139,7 +139,7 @@ ShowError(HWND Parent, UINT MsgId) } static -BOOL GetAddressFromField( HWND hwndDlg, UINT CtlId, +BOOL GetAddressFromField( HWND hwndDlg, UINT CtlId, DWORD *dwIPAddr, const char **AddressString ) { LRESULT lResult; @@ -147,10 +147,10 @@ BOOL GetAddressFromField( HWND hwndDlg, UINT CtlId, *AddressString = NULL; - lResult = SendMessage(GetDlgItem(hwndDlg, CtlId), IPM_GETADDRESS, 0, + lResult = SendMessage(GetDlgItem(hwndDlg, CtlId), IPM_GETADDRESS, 0, (ULONG_PTR)dwIPAddr); if( lResult != 4 ) return FALSE; - + *dwIPAddr = htonl(*dwIPAddr); inIPAddr.s_addr = *dwIPAddr; *AddressString = inet_ntoa(inIPAddr); @@ -520,7 +520,7 @@ DisplayTCPIPProperties(HWND hParent, IP_ADAPTER_INFO *pInfo) _tcscat(tpszCaption, suffix); } } - + if (! LoadDataFromInfo(&DlgData, pInfo)) { ShowError(hParent, IDS_CANNOT_LOAD_CONFIG); diff --git a/reactos/dll/cpl/powercfg/alarms.c b/reactos/dll/cpl/powercfg/alarms.c index af4c3cc9a94..07748b769e1 100644 --- a/reactos/dll/cpl/powercfg/alarms.c +++ b/reactos/dll/cpl/powercfg/alarms.c @@ -68,7 +68,7 @@ BOOLEAN Ala_InitData(HWND hwndDlg) BM_SETCHECK, (gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].Enable ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); - + if (LoadString(hApplet, IDS_PROCENT, szTemp, MAX_PATH)) { _stprintf(szBatteryLevel,szTemp,gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel); @@ -87,7 +87,7 @@ BOOLEAN Ala_InitData(HWND hwndDlg) TBM_SETPOS, (WPARAM)TRUE, (LPARAM)gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].BatteryLevel); - + if (LoadString(hApplet, gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.Action+IDS_PowerActionNone1, szAction, MAX_PATH)) { SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMAKTION1),szAction); @@ -95,11 +95,11 @@ BOOLEAN Ala_InitData(HWND hwndDlg) memset(szMessage, 0x0, sizeof(szMessage)); LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH); - + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT) { if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_LOW].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) - { + { if (LoadString(hApplet, IDS_SOUND, szSound, MAX_PATH) && LoadString(hApplet, IDS_TEXT, szText, MAX_PATH)) { _stprintf(szMessage,_T("%s, %s"),szSound,szText); @@ -125,7 +125,7 @@ BOOLEAN Ala_InitData(HWND hwndDlg) } SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMMSG1),szMessage); - + if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH)) { SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMPROG1),szProgram); @@ -162,7 +162,7 @@ BOOLEAN Ala_InitData(HWND hwndDlg) memset(szMessage, 0x0, sizeof(szMessage)); LoadString(hApplet, IDS_NOACTION, szMessage, MAX_PATH); - + if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_TEXT) { if (LOWORD(gGPP.user.DischargePolicy[DISCHARGE_POLICY_CRITICAL].PowerPolicy.EventCode) & POWER_LEVEL_USER_NOTIFY_SOUND) @@ -192,7 +192,7 @@ BOOLEAN Ala_InitData(HWND hwndDlg) } SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMMSG2),szMessage); - + if (LoadString(hApplet, IDS_PowerActionNone2, szProgram, MAX_PATH)) { SetWindowText(GetDlgItem(hwndDlg, IDC_ALARMPROG2),szProgram); diff --git a/reactos/dll/cpl/powercfg/hibernate.c b/reactos/dll/cpl/powercfg/hibernate.c index ac89fc2797c..5615667deed 100644 --- a/reactos/dll/cpl/powercfg/hibernate.c +++ b/reactos/dll/cpl/powercfg/hibernate.c @@ -142,7 +142,7 @@ void Hib_InitDialog(HWND hwndDlg) } if (TotalNumberOfFreeBytes.QuadPart < msex.ullTotalPhys && !PowerCaps.HiberFilePresent) { - EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), FALSE); ShowWindow(GetDlgItem(hwndDlg, IDC_TOLESSFREESPACE), TRUE); } else @@ -156,7 +156,7 @@ void Hib_InitDialog(HWND hwndDlg) INT_PTR Hib_SaveData(HWND hwndDlg) { BOOLEAN bHibernate; - + bHibernate = (BOOLEAN)SendMessage(GetDlgItem(hwndDlg, IDC_HIBERNATEFILE), BM_GETCHECK, (WPARAM)0, diff --git a/reactos/dll/cpl/powercfg/lang/bg-BG.rc b/reactos/dll/cpl/powercfg/lang/bg-BG.rc index 7565bceca82..f24e5f90bd2 100644 --- a/reactos/dll/cpl/powercfg/lang/bg-BG.rc +++ b/reactos/dll/cpl/powercfg/lang/bg-BG.rc @@ -44,7 +44,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "íåèçâåñòíî",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Äåéñòâèå ïðè &òðåâîãà...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "íåèçâåñòíî",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "&Äåéñòâèå ïðè òðåâîãà...",-1,20,170,70,15,WS_DISABLED @@ -80,21 +80,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Èçáåðåòå åíåðãîñïåñòÿâàùè íàñòðîéêè.",-1,30,5,205,20 GROUPBOX "Âúçìîæíîñòè",-1,5,35,225,55 - CONTROL "Âèíàãè èìà çíà÷å â çàäà÷íàòà ëåíòà",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "Âèíàãè èìà çíà÷å â çàäà÷íàòà ëåíòà",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Èñêàíå íà ïàðîëà ïðè èçëèçàíå îò îç÷àêâàíå",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Èñêàíå íà ïàðîëà ïðè èçëèçàíå îò îç÷àêâàíå",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "&Çàòúìíÿâàíå íà åêðàíà ïðè ðàáîòà îò áàòåðèè.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Çàòúìíÿâàíå íà åêðàíà ïðè ðàáîòà îò áàòåðèè.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Êëàâèøè çà çàõðàíâàíå",-1,5,100,230,105 LTEXT "&Ïðè çàòâàðÿíå íà êàïàêà íà ïðåíîñèìèÿ ìè êîìïþòúð:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ï&ðè íàòèñêàíå íà êîï÷åòî çà èçêëþ÷âàíå íà êîìïþòúðà:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ïð&è íàòèñêàíå íà êîï÷åòî çà ïðèñïèâàíå íà êîìïþòàðà:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "Êîãàòî êîìïþòúðúò âè çàñïè, òîé ñúõðàíÿâà ñúäúðæàíèåòî íà ïàìåòòà ñè íà òâúðäèÿ äèñê, à êîãàòî ñå ñúáóäè ãî âðúùà îáðàòíî.", -1,35,5,195,35 GROUPBOX "Çàñïèâàíå",-1,5,45,235,25 - CONTROL "Âêëþ÷âàíå íà çà&ñïèâàíåòî",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "Âêëþ÷âàíå íà çà&ñïèâàíåòî",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Äèñêîâî ìÿñòî çà çàñïèâàíå",-1,5,80,240,60 LTEXT "Ñâîáîäíèî äèñêîâî ìÿñòî:",-1,10,90,155,10 diff --git a/reactos/dll/cpl/powercfg/lang/cs-CZ.rc b/reactos/dll/cpl/powercfg/lang/cs-CZ.rc index 40d6b4c88c4..d46a33dd541 100644 --- a/reactos/dll/cpl/powercfg/lang/cs-CZ.rc +++ b/reactos/dll/cpl/powercfg/lang/cs-CZ.rc @@ -44,7 +44,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "unknown",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Alar&m Action...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "unknown",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Alar&m Action...",-1,20,170,70,15,WS_DISABLED @@ -80,21 +80,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Vyberte, které nastavení snížené spotøeby chcete použít.",-1,30,5,205,20 GROUPBOX "Možnosti",-1,5,35,225,55 - CONTROL "Vždy zobrazovat &ikonu na hlavním panelu",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "Vždy zobrazovat &ikonu na hlavním panelu",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "Dotázat se na &heslo pøi pøechodu z úsporného režimu",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "Dotázat se na &heslo pøi pøechodu z úsporného režimu",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "&Snížit jas displeje pøi chodu na baterie.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Snížit jas displeje pøi chodu na baterie.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Tlaèítka napájení",-1,5,100,230,105 LTEXT "&Pøi sklopení displeje pøenosného poèítaèe:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Pøi stisknutí tlaèítka &napájení:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Pøi stisknutí tlaèítka režimu &spánku:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "Pokud Váš poèítaè pøejde do režimu spánku, uloží obsah své pamìti na pevný disk a vypne se. Po opìtovném spuštìní se vrátí do pùvodního stavu.", -1,35,5,195,35 GROUPBOX "Režim spánku",-1,5,45,235,25 - CONTROL "Zapnout funkci režim &spánku",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "Zapnout funkci režim &spánku",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Místo na disku potøebné pro režim spánku",-1,5,80,240,60 LTEXT "Volné místo:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/de-DE.rc b/reactos/dll/cpl/powercfg/lang/de-DE.rc index f82c2fb861b..a4b0a6c5549 100644 --- a/reactos/dll/cpl/powercfg/lang/de-DE.rc +++ b/reactos/dll/cpl/powercfg/lang/de-DE.rc @@ -44,7 +44,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "Unbekannt",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Alar&m Action...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "Unbekannt",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Alar&m Action...",-1,20,170,70,15,WS_DISABLED @@ -80,21 +80,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Wählen Sie die Energiesparoptionen aus, die Sie verwenden möchten.",-1,30,5,205,20 GROUPBOX "Optionen",-1,5,35,225,55 - CONTROL "&Symbol in der Taskleiste anzeigen",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "&Symbol in der Taskleiste anzeigen",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Kennwort beim Reaktivieren aus dem Standbymodus anfordern",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Kennwort beim Reaktivieren aus dem Standbymodus anfordern",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,210,10 - CONTROL "&Helligkeit der Anzeige beim Batteriebetrieb verringern",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Helligkeit der Anzeige beim Batteriebetrieb verringern",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Netzschaltervorgänge",-1,5,100,230,105 LTEXT "Beim Schließen des &Laptops:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Beim Drücken des &Netzschalters am Computer:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Beim Drücken des Schalters für den &Ruhezustand am Computer:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "Wenn der Computer in den Ruhezustand wechselt, wird der Inhalt des Arbeitsspeichers gespeichert und der Computer heruntergefahren. Wenn er wieder gestartet wird, kehrt er zum vorherigen Zustand zurück.", -1,35,5,195,35 GROUPBOX "Ruhezustand",-1,5,45,235,25 - CONTROL "&Ruhezustand aktivieren",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "&Ruhezustand aktivieren",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Speicherplatz für den Ruhezustand",-1,5,80,240,60 LTEXT "Freier Speicherplatz:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/en-US.rc b/reactos/dll/cpl/powercfg/lang/en-US.rc index ee499917773..078d0836360 100644 --- a/reactos/dll/cpl/powercfg/lang/en-US.rc +++ b/reactos/dll/cpl/powercfg/lang/en-US.rc @@ -44,7 +44,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "unknown",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Alar&m Action...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "unknown",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Alar&m Action...",-1,20,170,70,15,WS_DISABLED @@ -80,21 +80,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Select the power-saving settings you want to use.",-1,30,5,205,20 GROUPBOX "Options",-1,5,35,225,55 - CONTROL "Alway&s show icon on the taskbar",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "Alway&s show icon on the taskbar",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Prompt for password when computer resumes from standby",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Prompt for password when computer resumes from standby",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "&Dim display when running on batteries.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Dim display when running on batteries.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Power buttons",-1,5,100,230,105 LTEXT "&When I close the lid of my portable computer:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Wh&en I press the power button on my computer:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Whe&n I press the sleep button on my computer:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "When your computer hibernates, it stores whatever it has in memory on your hard disk and then shuts down. When your computer comes out of hibernation, it returns to its previous state. ", -1,35,5,195,35 GROUPBOX "Hibernate",-1,5,45,235,25 - CONTROL "Enable &hibernation",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "Enable &hibernation",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Disk space for hibernation",-1,5,80,240,60 LTEXT "Free disk space:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/fr-FR.rc b/reactos/dll/cpl/powercfg/lang/fr-FR.rc index 860ceadda42..63ba2ed60ac 100644 --- a/reactos/dll/cpl/powercfg/lang/fr-FR.rc +++ b/reactos/dll/cpl/powercfg/lang/fr-FR.rc @@ -44,7 +44,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "Inconnu",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Action d'alarme...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "Inconnu",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Action d'alarme...",-1,20,170,70,15,WS_DISABLED @@ -82,19 +82,19 @@ BEGIN GROUPBOX "Options",-1,5,35,225,55 CONTROL "Toujours &afficher l'icone sur la barre des taches",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Demander un mot de passe pour sortir de la mise en veille",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Demander un mot de passe pour sortir de la mise en veille",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "&Luminosité faible quand l'ordinateur est sur piles.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Luminosité faible quand l'ordinateur est sur piles.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Boutons d'alimentation",-1,5,100,230,105 LTEXT "&Quand je ferme le couvercle de mon portable:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Quand j'appuie sur le bouton Power de l'ordinateur:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Quand j'appuie sur le bouton Sleep de l'ordinateur:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "Quand votre ordinateur se met en veille, il enregistre tout ce qu'il a en memoire sur le disque dur et s'arrête. Quand votre ordinateur sort de la mise en veille, il reprend son état précédent. ", -1,35,5,195,35 GROUPBOX "Mise en veille",-1,5,45,235,25 - CONTROL "Activer la mise en veille",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "Activer la mise en veille",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Espace disque pour la mise en veille",-1,5,80,240,60 LTEXT "Espace disque libre:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/id-ID.rc b/reactos/dll/cpl/powercfg/lang/id-ID.rc index ca8b4f5fcdd..e0de11bd629 100644 --- a/reactos/dll/cpl/powercfg/lang/id-ID.rc +++ b/reactos/dll/cpl/powercfg/lang/id-ID.rc @@ -44,7 +44,7 @@ BEGIN "Tombol",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "tidak dikenal",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Aksi Alar&m...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Tombol",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "tidak dikenal",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Aksi Alar&m...",-1,20,170,70,15,WS_DISABLED @@ -80,21 +80,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Pilih setelan hemat-tenaga yang ingin anda pakai.",-1,30,5,205,20 GROUPBOX "Opsi",-1,5,35,225,55 - CONTROL "Selalu menampilkan ikon pada taskbar",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "Selalu menampilkan ikon pada taskbar",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Prompt kata sandi saat komputer melanjutkan dari standby",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Prompt kata sandi saat komputer melanjutkan dari standby",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "&Dim tampilan ketika berjalan dengan baterai.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Dim tampilan ketika berjalan dengan baterai.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Tombol tenaga",-1,5,100,230,105 LTEXT "&Ketika Saya menutup lid komputer portabel saya:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "K&etika Saya menekan tombol tenaga pada komputer saya:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ke&tika Saya menekan tombol tidur pada komputer saya:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "Ketika komputer anda hibernasi, ia menyimpan apapun yang ada di memori pada hard disk anda dan kemudian mematikan komputer. Ketika komputer anda keluar dari hibernasi, ia kembali ke keadaan sebelumnya. ", -1,35,5,195,35 GROUPBOX "Hibernasi",-1,5,45,235,25 - CONTROL "Hidupkan &hibernasi",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "Hidupkan &hibernasi",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Ruang disk untuk hibernasi",-1,5,80,240,60 LTEXT "Ruang bebas disk:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/it-IT.rc b/reactos/dll/cpl/powercfg/lang/it-IT.rc index a284641963f..97a5d5b4a97 100644 --- a/reactos/dll/cpl/powercfg/lang/it-IT.rc +++ b/reactos/dll/cpl/powercfg/lang/it-IT.rc @@ -9,7 +9,7 @@ BEGIN LTEXT "Scegliere lo schema di gestione dell'energia con le impostazioni piu' appropriate per questo computer. La modifica delle impostazioni seguenti altera lo schema selezionato.", -1,40,8,194,36 GROUPBOX "Schema di gestione dell'energia",-1,8,48,240,48 - COMBOBOX IDC_ENERGYLIST,15,61,224,92,CBS_DROPDOWNLIST | + COMBOBOX IDC_ENERGYLIST,15,61,224,92,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Salva come...",-1,101,76,75,15,WS_DISABLED PUSHBUTTON "&Cancella",-1,181,76,55,15,WS_DISABLED @@ -20,24 +20,24 @@ BEGIN LTEXT "Alimentato\ra batterie",IDC_SDC,192,112,45,15 ICON IDI_DC,IDC_IDC,168,112,21,20 LTEXT "Spegni il &monitor:",IDC_MONITOR,16,143,80,10 - COMBOBOX IDC_MONITORACLIST,101,141,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_MONITORACLIST,101,141,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_MONITORDCLIST,176,141,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_MONITORDCLIST,176,141,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Spegni i d&ischi fissi:",IDC_DISK,16,158,80,10 - COMBOBOX IDC_DISKACLIST,101,156,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_DISKACLIST,101,156,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_DISKDCLIST,176,156,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_DISKDCLIST,176,156,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Standby:",IDC_STANDBY,16,178,80,10 - COMBOBOX IDC_STANDBYACLIST,101,176,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_STANDBYACLIST,101,176,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_STANDBYDCLIST,176,176,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_STANDBYDCLIST,176,176,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Sospensione:",IDC_HYBERNATE,16,193,80,10 - COMBOBOX IDC_HYBERNATEACLIST,101,191,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_HYBERNATEACLIST,101,191,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_HYBERNATEDCLIST,176,191,65,150,CBS_DROPDOWNLIST | + COMBOBOX IDC_HYBERNATEDCLIST,176,191,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END @@ -89,26 +89,26 @@ BEGIN -1,30,5,205,20 GROUPBOX "Opzioni",-1,5,35,225,55 CONTROL "Mostra sempre l'icona nella barra dei task", - IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 CONTROL "Chiedi la password al ripristino dallo standby", IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, 15,55,200,10 CONTROL "Attenua il video durante il funzionamento a batteria.", - IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Pulsanti di gestione",-1,5,100,230,105 LTEXT "Quando chiudo lo schermo del computer portatile:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Quando premo il pulsante di alimentazione del computer:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Quando premo il pulsante di sospensione del computer:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END diff --git a/reactos/dll/cpl/powercfg/lang/nl-NL.rc b/reactos/dll/cpl/powercfg/lang/nl-NL.rc index c2b484ba6df..a1c92dbe7bf 100644 --- a/reactos/dll/cpl/powercfg/lang/nl-NL.rc +++ b/reactos/dll/cpl/powercfg/lang/nl-NL.rc @@ -44,7 +44,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "Onbekend",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Alar&m Action...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "Onbekend",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Alar&m Action...",-1,20,170,70,15,WS_DISABLED @@ -80,21 +80,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Selecteer de energiebesparende instellingen die u wilt gebruiken.",-1,30,5,205,20 GROUPBOX "Opties",-1,5,35,225,55 - CONTROL "&Pictogram altijd in het systeemvak weergeven",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "&Pictogram altijd in het systeemvak weergeven",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Wachtwoord vragen als de computer uit stand-by wordt gehaald",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Wachtwoord vragen als de computer uit stand-by wordt gehaald",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "&Beeldscherm dimmen als de computer op batterijen werkt.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Beeldscherm dimmen als de computer op batterijen werkt.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Energie knoppen",-1,5,100,230,105 LTEXT "W&anneer ik het deksel van mijn computer sluit:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Wanneer ik de aan/&uit-schakelaar van de computer indruk:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Wanneer ik de slaap&knop van de computer indruk:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "Als de computer in de slaapstand gaat, wordt de hele inhoud van het geheugen op schijf opgeslagen, waarna de computer wordt afgesloten. Zodra de computer uit de slaapstand komt, wordt de oude situatie hersteld.", -1,35,5,195,35 GROUPBOX "Slaapstand",-1,5,45,235,25 - CONTROL "&Slaapstand inschakelen",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "&Slaapstand inschakelen",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Schijfruimte voor slaapstand",-1,5,80,240,60 LTEXT "Beschikbare schijfruimte:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/pl-PL.rc b/reactos/dll/cpl/powercfg/lang/pl-PL.rc index 75fad26cc65..0b37462dd94 100644 --- a/reactos/dll/cpl/powercfg/lang/pl-PL.rc +++ b/reactos/dll/cpl/powercfg/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/** +/** * translated by aart3k * aart3k@gmail.com - * https://sourceforge.net/projects/reactospl - */ + * https://sourceforge.net/projects/reactospl + */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_PROPPAGEPOWERSHEMES DIALOGEX 0, 0, 250, 220 @@ -47,7 +47,7 @@ BEGIN "Przycisk",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "nieznany",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Dzia³anie &alarmu...",-1,20,70,70,15,WS_DISABLED @@ -63,7 +63,7 @@ BEGIN "Przycisk",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "nieznany",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Dzia³anie &alarmu...",-1,20,170,70,15,WS_DISABLED @@ -83,7 +83,7 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Wybierz, których ustawieñ oszczêdzania energii chcesz u¿ywaæ.",-1,30,5,205,20 GROUPBOX "Opcje",-1,5,35,225,55 - CONTROL "&Zawsze pokazuj ikonê w zasobniku systemowym",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "&Zawsze pokazuj ikonê w zasobniku systemowym",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 CONTROL "Zapytaj o &has³o kiedy komputer powraca ze stanu czuwania",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 @@ -91,13 +91,13 @@ BEGIN WS_TABSTOP,15,65,200,10 GROUPBOX "Przyciski zasilania",-1,5,100,230,105 LTEXT "&Kiedy zamykam mój komputer przenoœny:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "K&iedy naciskam wy³¹cznik mojego komputera:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ki&edy naciskam przycisk uœpienia:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -110,7 +110,7 @@ BEGIN LTEXT "Kiedy Twój komputer przechodzi w stan hibernacji ca³a zawartoœæ pamiêci jest zrzucana na dysk twardy i komputer jest wy³¹czany. Kiedy komputer budzi siê z hibernacji, powraca on do poprzedniego stanu. ", -1,35,5,195,35 GROUPBOX "Hibernacja",-1,5,45,235,25 - CONTROL "W³¹cz &hibernacjê",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "W³¹cz &hibernacjê",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Przestrzeñ dyskowa dla hibernacji",-1,5,80,240,60 LTEXT "Wolna przestrzeñ dyskowa:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/ru-RU.rc b/reactos/dll/cpl/powercfg/lang/ru-RU.rc index 5d42f6a3b0c..803cdc49d19 100644 --- a/reactos/dll/cpl/powercfg/lang/ru-RU.rc +++ b/reactos/dll/cpl/powercfg/lang/ru-RU.rc @@ -44,7 +44,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "Íåò äàííûõ",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Ä&åéñòâèå...",-1,20,70,70,15,WS_DISABLED @@ -60,7 +60,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "Íåò äàííûõ",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Äå&éñòâèå...",-1,20,170,70,15,WS_DISABLED @@ -80,21 +80,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,32,32 LTEXT "Âûáåðèòå æåëàåìûå ïàðàìåòðû ýíåðãîñáåðåæåíèÿ.",-1,37,5,205,20 GROUPBOX "Ïàðàìåòðû",-1,5,35,225,55 - CONTROL "&Âñåãäà îòîáðàæàòü çíà÷îê íà ïàíåëè çàäà÷",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "&Âñåãäà îòîáðàæàòü çíà÷îê íà ïàíåëè çàäà÷",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,48,200,10 - CONTROL "&Çàïðàøèâàòü ïàðîëü ïðè âûõîäå èç æäóùåãî ðåæèìà",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Çàïðàøèâàòü ïàðîëü ïðè âûõîäå èç æäóùåãî ðåæèìà",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,60,200,10 - CONTROL "&Ñíèçèòü ÿðêîñòü ìîíèòîðà ïðè ðàáîòå îò áàòàðåé",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Ñíèçèòü ÿðêîñòü ìîíèòîðà ïðè ðàáîòå îò áàòàðåé",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,72,200,10 GROUPBOX "Êíîïêè ïèòàíèÿ",-1,5,100,230,105 LTEXT "&Ïðè çàêðûòèè êðûøêè ïåðåíîñíîãî êîìïüþòåðà:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ïðè &íàæàòèè êíîïêè âêëþ÷åíèÿ ïèòàíèÿ êîìïüþòåðà:", IDC_SPOWERBUTTON,10,140,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ïðè íàæàòèè &êíîïêè ïåðåõîäà â ñïÿùèé ðåæèì:", IDC_SSLEEPBUTTON,10,170,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -107,7 +107,7 @@ BEGIN LTEXT "Ïðè ïåðåõîäå â ñïÿùèé ðåæèì êîìïüþòåð ïåðåíîñèò ñîäåðæèìîå îïåðàòèâíîé ïàìÿòè íà äèñê è âûêëþ÷àåòñÿ. Ïðè âûõîäå èç ñïÿùåãî ðåæèìà êîìïüþòåð âîçâðàùàåòñÿ â ïðåæíåå ñîñòîÿíèå.", -1,37,5,195,35 GROUPBOX "Ñïÿùèé ðåæèì",-1,5,57,235,25 - CONTROL "&Ðàçðåøèòü ïåðåõîä â ñïÿùèé ðåæèì",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "&Ðàçðåøèòü ïåðåõîä â ñïÿùèé ðåæèì",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,67,210,10 GROUPBOX "Ìåñòî íà äèñêå äëÿ ïåðåõîäà â ñïÿùèé ðåæèì",-1,5,92,240,60 LTEXT "Ñâîáîäíî ìåñòà íà äèñêå:",-1,10,102,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/th-TH.rc b/reactos/dll/cpl/powercfg/lang/th-TH.rc index 2537e39d353..b7799d216ee 100644 --- a/reactos/dll/cpl/powercfg/lang/th-TH.rc +++ b/reactos/dll/cpl/powercfg/lang/th-TH.rc @@ -42,7 +42,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "unknown",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "Alar&m Action...",-1,20,70,70,15,WS_DISABLED @@ -58,7 +58,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "unknown",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "Alar&m Action...",-1,20,170,70,15,WS_DISABLED @@ -78,21 +78,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Select the power-saving settings you want to use.",-1,30,5,205,20 GROUPBOX "Options",-1,5,35,225,55 - CONTROL "Alway&s show icon on the taskbar",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "Alway&s show icon on the taskbar",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Prompt for password when computer resumes from standby",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Prompt for password when computer resumes from standby",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "&Dim display when running on batteries.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "&Dim display when running on batteries.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Power buttons",-1,5,100,230,105 LTEXT "&When I close the lid of my portable computer:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Wh&en I press the power button on my computer:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Whe&n I press the sleep button on my computer:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -105,7 +105,7 @@ BEGIN LTEXT "When your computer hibernates, it stores whatever it has in memory on your hard disk and then shuts down. When your computer comes out of hibernation, it returns to its previous state. ", -1,35,5,195,35 GROUPBOX "Hibernate",-1,5,45,235,25 - CONTROL "Enable &hibernation",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "Enable &hibernation",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "Disk space for hibernation",-1,5,80,240,60 LTEXT "Free disk space:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/lang/uk-UA.rc b/reactos/dll/cpl/powercfg/lang/uk-UA.rc index 337f25505c1..e01f484c66c 100644 --- a/reactos/dll/cpl/powercfg/lang/uk-UA.rc +++ b/reactos/dll/cpl/powercfg/lang/uk-UA.rc @@ -50,7 +50,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,180,15 LTEXT "íåìຠäàíèõ",IDC_ALARMVALUE1,200,25,40,10 LTEXT "0%",-1,20,40,15,15 - CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR1,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,40,170,15 LTEXT "100%",-1,215,40,25,10 PUSHBUTTON "&ijÿ...",-1,20,70,70,15,WS_DISABLED @@ -66,7 +66,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,125,180,15 LTEXT "íåìຠäàíèõ",IDC_ALARMVALUE2,200,125,40,10 LTEXT "0%",-1,20,140,15,15 - CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | + CONTROL "Slider1",IDC_ALARMBAR2,"msctls_trackbar32",TBS_HORZ | TBS_AUTOTICKS | WS_TABSTOP,30,140,170,15 LTEXT "100%",-1,215,140,25,10 PUSHBUTTON "&ijÿ...",-1,20,170,70,15,WS_DISABLED @@ -86,21 +86,21 @@ BEGIN ICON IDI_ACDC,IDI_ACDC,5,5,20,20 LTEXT "Âèáåð³òü áàæàí³ ïàðàìåòðè åíåðãîçáåðåæåííÿ.",-1,30,5,205,20 GROUPBOX "Ïàðàìåòðè",-1,5,35,225,55 - CONTROL "Çà&âæäè ïîêàçóâàòè çíà÷îê íà ïàíåë³ çàâäàíü",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | + CONTROL "Çà&âæäè ïîêàçóâàòè çíà÷îê íà ïàíåë³ çàâäàíü",IDC_SYSTRAYBATTERYMETER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,45,200,10 - CONTROL "&Çàïèòóâàòè ïàðîëü ïðè âèõîä³ ç ðåæèìó î÷³êóâàííÿ",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | + CONTROL "&Çàïèòóâàòè ïàðîëü ïðè âèõîä³ ç ðåæèìó î÷³êóâàííÿ",IDC_PASSWORDLOGON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,55,200,10 - CONTROL "Ç&ìåíøèòè ÿñêðàâ³ñòü ìîí³òîðà â ðàç³ æèâëåííÿ â³ä áàòàðåé.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | + CONTROL "Ç&ìåíøèòè ÿñêðàâ³ñòü ìîí³òîðà â ðàç³ æèâëåííÿ â³ä áàòàðåé.",IDC_VIDEODIMDISPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,65,200,10 GROUPBOX "Êíîïêè æèâëåííÿ",-1,5,100,230,105 LTEXT "&Ïðè çàêðèòò³ êðèøêè &ïîðòàòèâíîãî êîìï'þòåðà:", IDC_SLIDCLOSE,10,110,210,10 - COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_LIDCLOSE,10,120,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ïðè íàò&èñíåíí³ âèìèêà÷à æèâëåííÿ íà ìîºìó êîìï'þòåð³:", IDC_SPOWERBUTTON,10,135,210,10 - COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_POWERBUTTON,10,150,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Ïðè íàòè&ñíåíí³ êíîïêè ïåðåõîäó äî ñïëÿ÷îãî ðåæèìó:", IDC_SSLEEPBUTTON,10,165,210,10 - COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | + COMBOBOX IDC_SLEEPBUTTON,10,180,220,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END @@ -113,7 +113,7 @@ BEGIN LTEXT "Êîëè êîìï'þòåð ïåðåõîäèòü äî ñïëÿ÷îãî ðåæèìó, óâåñü âì³ñò ïàì'ÿò³ çàïèñóºòüñÿ íà æîðñòêèé äèñê ³ ðîáîòà çàâåðøóºòüñÿ. Âèõîäÿ÷è ç³ ñïëÿ÷îãî ðåæèìó, êîìï'þòåð ïîâåðòàºòüñÿ äî ïîïåðåäíüîãî ñòàíó. ", -1,35,5,195,35 GROUPBOX "Ñïëÿ÷èé ðåæèì",-1,5,45,235,25 - CONTROL "Äîçâîëèòè ñïëÿ÷èé &ðåæèì",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | + CONTROL "Äîçâîëèòè ñïëÿ÷èé &ðåæèì",IDC_HIBERNATEFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,55,210,10 GROUPBOX "̳ñöå íà äèñêó äëÿ ñïëÿ÷îãî ðåæèìó",-1,5,80,240,60 LTEXT "Äîñòóïíî íà äèñêó:",-1,10,90,100,10 diff --git a/reactos/dll/cpl/powercfg/powercfg.c b/reactos/dll/cpl/powercfg/powercfg.c index 9e57ae1d957..95ddcd2d163 100644 --- a/reactos/dll/cpl/powercfg/powercfg.c +++ b/reactos/dll/cpl/powercfg/powercfg.c @@ -31,7 +31,7 @@ GLOBAL_POWER_POLICY gGPP; TCHAR langSel[255]; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { {IDC_CPLICON_1, IDS_CPLNAME_1, IDS_CPLDESCRIPTION_1, Applet1} }; @@ -101,7 +101,7 @@ PropSheetProc( return FALSE; } break; - + case PSCB_INITIALIZED: break; } @@ -110,7 +110,7 @@ PropSheetProc( /* First Applet */ static LONG APIENTRY -Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) +Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { HPROPSHEETPAGE hpsp[MAX_POWER_PAGES]; PROPSHEETHEADER psh; @@ -118,7 +118,7 @@ Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) TCHAR Caption[1024]; SYSTEM_POWER_CAPABILITIES spc; LONG ret; - + UNREFERENCED_PARAMETER(hwnd); UNREFERENCED_PARAMETER(uMsg); UNREFERENCED_PARAMETER(wParam); @@ -126,7 +126,7 @@ Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) memset(Caption, 0x0, sizeof(Caption)); LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR)); - + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE; @@ -138,7 +138,7 @@ Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) psh.nStartPage = 0; psh.phpage = hpsp; psh.pfnCallback = PropSheetProc; - + InitPropSheetPage(&psh, IDD_PROPPAGEPOWERSHEMES, (DLGPROC) powershemesProc); if (GetPwrCapabilities(&spc)) { @@ -172,7 +172,7 @@ CPlApplet( LPARAM lParam2) { int i = (int)lParam1; - + switch(uMsg) { case CPL_INIT: diff --git a/reactos/dll/cpl/powercfg/powershemes.c b/reactos/dll/cpl/powercfg/powershemes.c index 62cbf24d333..4c8662bc7cc 100644 --- a/reactos/dll/cpl/powercfg/powershemes.c +++ b/reactos/dll/cpl/powercfg/powershemes.c @@ -199,10 +199,10 @@ BOOLEAN Pos_InitData() ShowWindow(GetDlgItem(hPos, IDC_STANDBYDCLIST),FALSE); ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST),FALSE); ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), spc.HiberFilePresent); - + } else - { + { ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEDCLIST), spc.HiberFilePresent); ShowWindow(GetDlgItem(hPos, IDC_HYBERNATEACLIST), FALSE); } @@ -274,10 +274,10 @@ BOOLEAN CreateEnergyList(HWND hwnd) SYSTEM_POWER_CAPABILITIES spc; hList = hwnd; - + if (!GetActivePwrScheme(&aps)) return FALSE; - + if (!ReadGlobalPwrPolicy(&gGPP)) return FALSE; diff --git a/reactos/dll/cpl/sysdm/environment.c b/reactos/dll/cpl/sysdm/environment.c index 92dad3ab52c..9caebc10570 100644 --- a/reactos/dll/cpl/sysdm/environment.c +++ b/reactos/dll/cpl/sysdm/environment.c @@ -95,7 +95,7 @@ EditVariableDlgProc(HWND hwndDlg, } EndDialog(hwndDlg, 1); return TRUE; - + case IDCANCEL: EndDialog(hwndDlg, 0); return TRUE; @@ -327,9 +327,9 @@ OnNewVariable(HWND hwndDlg, if (VarData->lpCookedValue != NULL) GlobalFree(VarData->lpCookedValue); - + GlobalFree(VarData); - } + } else { if(VarData->lpName != NULL && (VarData->lpCookedValue || VarData->lpRawValue)) @@ -416,12 +416,12 @@ OnDeleteVariable(HWND hwndDlg, if (VarData->lpCookedValue != NULL) GlobalFree(VarData->lpCookedValue); - + GlobalFree(VarData); lvi.lParam = 0; } } - + (void)ListView_DeleteItem(hwndListView, iItem); } } @@ -584,7 +584,7 @@ EnvironmentDlgProc(HWND hwndDlg, return TRUE; } break; - + case WM_NOTIFY: { NMHDR *phdr; @@ -605,7 +605,7 @@ EnvironmentDlgProc(HWND hwndDlg, } break; } - + return FALSE; } diff --git a/reactos/dll/cpl/sysdm/general.c b/reactos/dll/cpl/sysdm/general.c index 519cd02f580..ea733fce90f 100644 --- a/reactos/dll/cpl/sysdm/general.c +++ b/reactos/dll/cpl/sysdm/general.c @@ -125,7 +125,7 @@ SetProcNameString(HWND hwnd, TCHAR szBuf[31]; TCHAR* szLastSpace; INT LastSpace = 0; - + if (RegQueryValueEx(hKey, Value, NULL, @@ -135,7 +135,7 @@ SetProcNameString(HWND hwnd, { lpBuf = HeapAlloc(GetProcessHeap(), 0, - BufSize); + BufSize); if (!lpBuf) return 0; if (RegQueryValueEx(hKey, @@ -268,13 +268,13 @@ GetSystemInformation(HWND hwnd) _T("VendorIdentifier"), CurMachineLine); CurMachineLine++; - + CurMachineLine += SetProcNameString(hwnd, hKey, _T("ProcessorNameString"), CurMachineLine, CurMachineLine + 1); - + SetProcSpeed(hwnd, hKey, _T("~MHz"), diff --git a/reactos/dll/cpl/sysdm/lang/cs-CZ.rc b/reactos/dll/cpl/sysdm/lang/cs-CZ.rc index 9f5bd7e2ae6..1b081b2e254 100644 --- a/reactos/dll/cpl/sysdm/lang/cs-CZ.rc +++ b/reactos/dll/cpl/sysdm/lang/cs-CZ.rc @@ -10,13 +10,13 @@ BEGIN LTEXT "Operaèní systém",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Verze "REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + LTEXT "Poèítaè",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY END @@ -24,7 +24,7 @@ IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hardware" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Prùvodce hardwarem",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Prùvodce hardwarem pomáhá pøi instalaci, odstranìní, opravì, odpojení, vysunutí a konfiguraci hardwaru.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON @@ -33,7 +33,7 @@ BEGIN GROUPBOX "Správce zaøízení",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON LTEXT "Správce zaøízení zobrazuje veškerý hardware nainstalovaný ve Vašem poèítaèi. Spávce zaøízení použijte v pøípadì, že chcete zmìnit vlastnosti hardware.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - + PUSHBUTTON "&Správce zaøízení...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 GROUPBOX "Hardwarové profily",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) @@ -51,7 +51,7 @@ BEGIN LTEXT "Uživatelské profily obsahují informace vztahující se k pøihlášení. Na každém poèítaèi mohou být použity rozdílné profily, nebo mohou být nastaveny tzv. cestovní profily, které lze pøenášet libovolnì mezi rùznými poèítaèi.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) LTEXT "Profily uložené v tomto poèítaèi:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - + PUSHBUTTON "Odstranit",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Zmìnit typ...",IDC_USERPROFILE_CHANGE,(PROPSHEETWIDTH/2)-30,LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Kopírovat...",IDC_USERPROFILE_COPY,PROPSHEETWIDTH-PROPSHEETPADDING(1)-60,LABELLINE(20),60,LABELLINE(1)+2 @@ -109,13 +109,13 @@ BEGIN EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL LTEXT "&Hodnota promìnné:",-1,7,32,50,8 EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - + DEFPUSHBUTTON "OK",IDOK,116,50,50,14,WS_GROUP PUSHBUTTON "Storno",IDCANCEL,170,50,50,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Systém" IDS_CPLSYSTEMDESCRIPTION "Zobrazuje informace o Vašem poèítaèi, mìní rùzné systémové promìnné a hardwarové vlastnosti." diff --git a/reactos/dll/cpl/sysdm/lang/da-DK.rc b/reactos/dll/cpl/sysdm/lang/da-DK.rc index 20b2e3422d8..cbbace3e6d8 100644 --- a/reactos/dll/cpl/sysdm/lang/da-DK.rc +++ b/reactos/dll/cpl/sysdm/lang/da-DK.rc @@ -8,13 +8,13 @@ BEGIN LTEXT "Operativsystem:",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Version: "REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + LTEXT "Computer:",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Processor Forhandler:",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Processor Navn:",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Processor Hastighed:",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Hukommelse:",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY END @@ -22,7 +22,7 @@ IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hardware" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Hardware Guide",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Hardware Guiden hjælper dig med at Installer, Afinstaller, Reparerer, Afmontere, Fjerne, og konfigurer din hardware.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON @@ -31,7 +31,7 @@ BEGIN GROUPBOX "Enhedshåntering",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON LTEXT "Enhedshåntering viser alle dine hardware enheder installeret på din computer. Brug Enhedshåntering til at skifte indstillinger for alle Hardware Enheder.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - + PUSHBUTTON "&Enhedshåntering...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 GROUPBOX "Hardware Profiler",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) @@ -49,7 +49,7 @@ BEGIN LTEXT "Bruger Profiler indeholde skrivebords indstillinger og andre informationer relateret til dit login. En Anden bruger profil bliver oprette på alle computere du logger på, eller du kan vælge en Roaming profil some er den samme på alle computer du logger på.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) LTEXT "Bruger Profiler gemt på denne computer:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - + PUSHBUTTON "&Slet",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Skift &Type...",IDC_USERPROFILE_CHANGE,95,LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "&Kopiere Til...",IDC_USERPROFILE_COPY,180,LABELLINE(20),60,LABELLINE(1)+2 @@ -107,13 +107,13 @@ BEGIN EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL LTEXT "&Indhold:",-1,7,32,50,8 EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - + DEFPUSHBUTTON "OK",IDOK,116,50,50,14,WS_GROUP PUSHBUTTON "Fortryd",IDCANCEL,170,50,50,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "System Indstillinger" IDS_CPLSYSTEMDESCRIPTION "Se mere information omkring din computer, og skift diverse system og hardware indstillinger." diff --git a/reactos/dll/cpl/sysdm/lang/es-ES.rc b/reactos/dll/cpl/sysdm/lang/es-ES.rc index e720daca793..3e5a0777d54 100644 --- a/reactos/dll/cpl/sysdm/lang/es-ES.rc +++ b/reactos/dll/cpl/sysdm/lang/es-ES.rc @@ -1,4 +1,4 @@ -// Spanish language resource file +// Spanish language resource file // React Operating System 2005 // Samuel Serapión Vega @@ -14,13 +14,13 @@ BEGIN LTEXT "Sistema Operativo",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Versión "REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + LTEXT "Computadora",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY END @@ -28,7 +28,7 @@ IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hardware" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Asistente de Hardware",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "El asistente de hardware the ayuda instalar, desinstalar, reparar, desconectar, expulsar, y configurar tu hardware.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON @@ -37,7 +37,7 @@ BEGIN GROUPBOX "Administrador de Dispositivos",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON LTEXT "The Device Manager lists all the hardware devices installed on your computer. Use the Device Manager to change the properties of any device.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - + PUSHBUTTON "&Administrador de Dispositivos...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 GROUPBOX "Perfiles de Hardware",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) @@ -55,7 +55,7 @@ BEGIN LTEXT "Los perfiles de usuarios archivan el escritorio y otra información relacionada a tu login. Un perfil diferente puede ser creado en cada computadora que utilize, o puede seleccionar un perfil movil que es igual en cada computadora que utilize.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) LTEXT "Perfiles archivados en esta computadora:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - + PUSHBUTTON "Borrar",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Cambiar tipo...",IDC_USERPROFILE_CHANGE,(PROPSHEETWIDTH/2)-30,LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Copiar a...",IDC_USERPROFILE_COPY,PROPSHEETWIDTH-PROPSHEETPADDING(1)-60,LABELLINE(20),60,LABELLINE(1)+2 @@ -113,13 +113,13 @@ BEGIN EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL LTEXT "Valor Variable:",-1,7,32,50,8 EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - + DEFPUSHBUTTON "Aceptar",IDOK,116,50,50,14,WS_GROUP PUSHBUTTON "Cancelar",IDCANCEL,170,50,50,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Systema" IDS_CPLSYSTEMDESCRIPTION "Ver información de su Computadora y cambiar varias opciones del systema." diff --git a/reactos/dll/cpl/sysdm/lang/hu-HU.rc b/reactos/dll/cpl/sysdm/lang/hu-HU.rc index 2215e90d07f..fea1b4910ab 100644 --- a/reactos/dll/cpl/sysdm/lang/hu-HU.rc +++ b/reactos/dll/cpl/sysdm/lang/hu-HU.rc @@ -11,13 +11,13 @@ BEGIN LTEXT "Operációs rendszer",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Verzió "REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + LTEXT "Számítógép",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY END @@ -25,7 +25,7 @@ IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hardver" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Hardver varázsló",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "A Hardver varázsló segíti Önt hardvereszközei telepítésénél, eltávolításánál, kijavításánál, leválasztásánál, kiadásánál, beállításánál.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON @@ -34,7 +34,7 @@ BEGIN GROUPBOX "Eszközkezelõ",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON LTEXT "Az Eszközkezelõ felsorolja az összes hardverelemet, amelyek telepítve vannak az Ön számítógépén. Az Eszközkezelõben bármelyik eszköz beállításait megváltoztathatja.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - + PUSHBUTTON "&Eszközkezelõ...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 GROUPBOX "Hardver profilok",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) @@ -52,7 +52,7 @@ BEGIN LTEXT "A felhasználói profilok tárolják személyes adatait, és az asztala beállításait. Minden számítógépen létrehozhat különbözõ profilokat, vagy kiválaszthat egy vándor profilt, amely mindegyik gépen egyforma beállításokat fog eredményezni, ahol csak használja.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) LTEXT "A számítógépen tárolt profilok:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - + PUSHBUTTON "Törlés",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Típus megváltoztatása...",IDC_USERPROFILE_CHANGE,(PROPSHEETWIDTH/2)-30,LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Másolás...",IDC_USERPROFILE_COPY,PROPSHEETWIDTH-PROPSHEETPADDING(1)-60,LABELLINE(20),60,LABELLINE(1)+2 @@ -110,13 +110,13 @@ BEGIN EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL LTEXT "Vál&tozó értéke:",-1,7,32,50,8 EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - + DEFPUSHBUTTON "Rendben",IDOK,116,50,50,14,WS_GROUP PUSHBUTTON "Mégsem",IDCANCEL,170,50,50,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Rendszer" IDS_CPLSYSTEMDESCRIPTION "A számítógéppel kapcsolatos információk megjelenítése, különbözõ rendszer és hardver beállítások módosítása." diff --git a/reactos/dll/cpl/sysdm/lang/ja-JP.rc b/reactos/dll/cpl/sysdm/lang/ja-JP.rc index efade75a07e..bf13b0986c1 100644 --- a/reactos/dll/cpl/sysdm/lang/ja-JP.rc +++ b/reactos/dll/cpl/sysdm/lang/ja-JP.rc @@ -10,13 +10,13 @@ BEGIN LTEXT "ƒVƒXƒeƒ€",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Version "REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + LTEXT "ƒRƒ“ƒsƒ…[ƒ^",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY END @@ -24,7 +24,7 @@ IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "ƒn[ƒhƒEƒFƒA" FONT 9, "MS UI Gothic", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "ƒn[ƒhƒEƒFƒA ƒEƒBƒU[ƒh",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "ƒn[ƒhƒEƒFƒA ƒEƒBƒU[ƒh‚ðŽg‚Á‚ÄAƒn[ƒhƒEƒFƒA‚̃Cƒ“ƒXƒg[ƒ‹AƒAƒ“ƒCƒ“ƒXƒg[ƒ‹AC•œAŽæ‚èŠO‚µA‚¨‚æ‚Ñݒ肪‚Å‚«‚Ü‚·B",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON @@ -33,7 +33,7 @@ BEGIN GROUPBOX "ƒfƒoƒCƒX ƒ}ƒl[ƒWƒƒ",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON LTEXT "ƒfƒoƒCƒX ƒ}ƒl[ƒWƒƒ‚ÍAƒRƒ“ƒsƒ…[ƒ^‚ɃCƒ“ƒXƒg[ƒ‹‚³‚ê‚Ä‚¢‚é‚·‚ׂẴn[ƒhƒEƒFƒA ƒfƒoƒCƒX‚ðˆê——•\\Ž¦‚µ‚Ü‚·B‚Ü‚½AƒfƒoƒCƒX ƒ}ƒl[ƒWƒƒ‚ðŽg‚Á‚ÄAŠeƒfƒoƒCƒX‚̃vƒƒpƒeƒB‚ð•ÏX‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - + PUSHBUTTON "ƒfƒoƒCƒX ƒ}ƒl[ƒWƒƒ(&D)...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 GROUPBOX "ƒn[ƒhƒEƒFƒA ƒvƒƒtƒ@ƒCƒ‹",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) @@ -51,7 +51,7 @@ BEGIN LTEXT "ƒ†[ƒU[ ƒvƒƒtƒ@ƒCƒ‹‚É‚ÍAƒfƒXƒNƒgƒbƒv‚ÌÝ’è‚ƃƒOƒCƒ“‚ÉŠÖ‚·‚éî•ñ‚ªŠÜ‚Ü‚ê‚Ü‚·Bƒ†[ƒU[‚ÍAŽg—p‚·‚éƒRƒ“ƒsƒ…[ƒ^‚²‚ƂɈقȂéƒvƒƒtƒ@ƒCƒ‹‚ð쬂·‚é‚©A‚·‚ׂẴRƒ“ƒsƒ…[ƒ^‚Å“¯‚¶ˆÚ“®ƒvƒƒtƒ@ƒCƒ‹‚ð‘I‘ð‚·‚é‚±‚Æ‚ª‚Å‚«‚Ü‚·B",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) LTEXT "‚±‚̃Rƒ“ƒsƒ…[ƒ^‚ÉŠi”[‚³‚ê‚Ä‚¢‚éƒvƒƒtƒ@ƒCƒ‹:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - + PUSHBUTTON "íœ",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Ží—Þ‚Ì•ÏX...",IDC_USERPROFILE_CHANGE,(PROPSHEETWIDTH/2)-30,LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "ƒRƒs[æ...",IDC_USERPROFILE_COPY,PROPSHEETWIDTH-PROPSHEETPADDING(1)-60,LABELLINE(20),60,LABELLINE(1)+2 @@ -109,13 +109,13 @@ BEGIN EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL LTEXT "•Ï”’l(&V):",-1,7,32,50,8 EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - + DEFPUSHBUTTON "OK",IDOK,116,50,50,14,WS_GROUP PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹",IDCANCEL,170,50,50,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "ƒVƒXƒeƒ€" IDS_CPLSYSTEMDESCRIPTION "ƒVƒXƒeƒ€‚ÌŠî–{î•ñ‚ð•\\Ž¦‚µAƒVƒXƒeƒ€‚âƒn[ƒhƒEƒFƒA‚Ì—lX‚ÈÝ’è‚ð•ÏX‚µ‚Ü‚·B" diff --git a/reactos/dll/cpl/sysdm/lang/nl-NL.rc b/reactos/dll/cpl/sysdm/lang/nl-NL.rc index a3c9ba0378b..f757183b068 100644 --- a/reactos/dll/cpl/sysdm/lang/nl-NL.rc +++ b/reactos/dll/cpl/sysdm/lang/nl-NL.rc @@ -10,13 +10,13 @@ BEGIN LTEXT "Besturingssysteem",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Versie "REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + LTEXT "Computer",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY END @@ -24,7 +24,7 @@ IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hardware" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Wizard Hardware",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Met de wizard Hardware kunt u hardware installeren, verwijderen, repareren ontkoppelen,uitwerpen en configureren.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON @@ -33,7 +33,7 @@ BEGIN GROUPBOX "Apparaatbeheer",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON LTEXT "Apparaatbeheer geeft een overzicht van alle hardware die op de computer is geïnstalleerd. U kunt in Apparaatbeheer tevens de eigenschappen van elk apparaat wijzigen.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - + PUSHBUTTON "&Apparaatbeheer...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 GROUPBOX "Hardwareprofielen",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) @@ -51,7 +51,7 @@ BEGIN LTEXT "In gebruikersprofielen liggen instellingen voor het bureaublad en andere informatie over uw gebruikerssessie opgeslagen. U kunt op elke computer die u gebruikt een ander profiel maken, of kiezen voor een zwevend profiel dat op elke computer die u gebruikt hetzelfde is.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) LTEXT "&Profielen die op deze computer zijn opgeslagen:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - + PUSHBUTTON "&Verwijderen",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Type &wijzigen...",IDC_USERPROFILE_CHANGE,(PROPSHEETWIDTH/2)-30,LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "&Kopiëren naar...",IDC_USERPROFILE_COPY,PROPSHEETWIDTH-PROPSHEETPADDING(1)-60,LABELLINE(20),60,LABELLINE(1)+2 @@ -109,13 +109,13 @@ BEGIN EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL LTEXT "waarde van variabele:",-1,7,32,50,8 EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - + DEFPUSHBUTTON "OK",IDOK,116,50,50,14,WS_GROUP PUSHBUTTON "Annuleren",IDCANCEL,170,50,50,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Systeem" IDS_CPLSYSTEMDESCRIPTION "Systeeminformatie weergeven en omgevingsinstellingen wijzigen." diff --git a/reactos/dll/cpl/sysdm/lang/pl-PL.rc b/reactos/dll/cpl/sysdm/lang/pl-PL.rc index 903f8568989..90cbd071fc7 100644 --- a/reactos/dll/cpl/sysdm/lang/pl-PL.rc +++ b/reactos/dll/cpl/sysdm/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translated by xrogers -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_PROPPAGEGENERAL DIALOGEX 0, 0, 256, 218 @@ -182,7 +182,7 @@ FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN LTEXT "&Dysk [Etykieta woluminu]", IDC_STATIC, 12, 5, 96, 9 LTEXT "Rozmiar pliku stronicowania (MB)", IDC_STATIC, 115, 5, 96, 9 - LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS + LISTBOX IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS GROUPBOX "Rozmiar pliku stronicowania dla wybranego dysku", IDC_DRIVEGROUP, 10, 70, 204, 104 LTEXT "Dysk:", IDC_STATIC, 20, 80, 20, 8 LTEXT "", IDC_DRIVE, 88, 81, 100, 9 diff --git a/reactos/dll/cpl/sysdm/lang/sv-SE.rc b/reactos/dll/cpl/sysdm/lang/sv-SE.rc index 1f1d0028c68..0743dda26b2 100644 --- a/reactos/dll/cpl/sysdm/lang/sv-SE.rc +++ b/reactos/dll/cpl/sysdm/lang/sv-SE.rc @@ -12,13 +12,13 @@ BEGIN LTEXT "Operativsystem",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "Version"REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + LTEXT "Dator",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 LTEXT "",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - + EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY END @@ -26,7 +26,7 @@ IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hårdvara" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN +BEGIN GROUPBOX "Guiden anslut ny hårdvara",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) LTEXT "Guiden anslut ny hårdvara hjälper dig att installera, avinstallera, reparera, koppla ur, mata ut och konfigurera din hårdvara.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON @@ -35,7 +35,7 @@ BEGIN GROUPBOX "Enhetshanteraren",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON LTEXT "Enhetshanteraren visar all hårdvara i din dator.. Använd enhetshanteraren för att ändra egenskaper på dina enheter.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - + PUSHBUTTON "&Enhetshanteraren...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 GROUPBOX "Hårdvaruprofiler",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) @@ -53,7 +53,7 @@ BEGIN LTEXT "Användarprofiler innehåller skrivbordsinställningar och annan information om ditt konto. Olika profiler kan skapas på varje dator du använder eller så kan du välja en central profil som är likadan på alla datorer du använder.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) LTEXT "Användarprofiler på datorn:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - + PUSHBUTTON "Ta bort",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Ändra typ...",IDC_USERPROFILE_CHANGE,95,LABELLINE(20),60,LABELLINE(1)+2 PUSHBUTTON "Kopiera till...",IDC_USERPROFILE_COPY,180,LABELLINE(20),60,LABELLINE(1)+2 @@ -111,13 +111,13 @@ BEGIN EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL LTEXT "Variabelvärde:",-1,7,32,50,8 EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - + DEFPUSHBUTTON "OK",IDOK,116,50,50,14,WS_GROUP PUSHBUTTON "Avbryt",IDCANCEL,170,50,50,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "System" IDS_CPLSYSTEMDESCRIPTION "Se information om din dator och ändra olika system- och hårdvaruinställningar." diff --git a/reactos/dll/cpl/sysdm/startrec.c b/reactos/dll/cpl/sysdm/startrec.c index 9082db68510..8686b40cb8d 100644 --- a/reactos/dll/cpl/sysdm/startrec.c +++ b/reactos/dll/cpl/sysdm/startrec.c @@ -114,7 +114,7 @@ PBOOTRECORD ReadFreeldrSection(HINF hInf, TCHAR * szSectionName) if (!_tcsnicmp(szValue, _T("ReactOS"), 7)) { //FIXME store as enum - pRecord->BootType = 1; + pRecord->BootType = 1; } else { @@ -177,14 +177,14 @@ int LoadFreeldrSettings(HINF hInf, HWND hwndDlg) } - if (!SetupGetIntField(&InfContext, + if (!SetupGetIntField(&InfContext, 1, (PINT)&TimeOut)) { /* failed to retrieve timeout */ return FALSE; } - + if (!SetupFindFirstLine(hInf, _T("Operating Systems"), NULL, @@ -276,8 +276,8 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg) do { - if (!SetupGetStringField(&InfContext, - 0, + if (!SetupGetStringField(&InfContext, + 0, szName, sizeof(szName) / sizeof(TCHAR), &LineLength)) @@ -285,8 +285,8 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg) return FALSE; } - if (!SetupGetStringField(&InfContext, - 1, + if (!SetupGetStringField(&InfContext, + 1, szValue, sizeof(szValue) / sizeof(TCHAR), &LineLength)) @@ -298,7 +298,7 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg) { TimeOut = _ttoi(szValue); } - + if (!_tcsnicmp(szName, _T("default"), 7)) { _tcscpy(szDefaultOS, szValue); @@ -317,8 +317,8 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg) do { - if (!SetupGetStringField(&InfContext, - 0, + if (!SetupGetStringField(&InfContext, + 0, szName, sizeof(szName) / sizeof(TCHAR), &LineLength)) @@ -326,8 +326,8 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg) return FALSE; } - if (!SetupGetStringField(&InfContext, - 1, + if (!SetupGetStringField(&InfContext, + 1, szValue, sizeof(szValue) / sizeof(TCHAR), &LineLength)) @@ -335,8 +335,8 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg) return FALSE; } - SetupGetStringField(&InfContext, - 2, + SetupGetStringField(&InfContext, + 2, szOptions, sizeof(szOptions) / sizeof(TCHAR), &LineLength); @@ -410,18 +410,18 @@ LRESULT LoadOSList(HWND hwndDlg) DWORD dwBufSize; TCHAR *szSystemDrive; HINF hInf; - + dwBufSize = GetSystemDrive(&szSystemDrive); if (!dwBufSize) return FALSE; - + _tcscpy(m_szFreeldrIni, szSystemDrive); _tcscat(m_szFreeldrIni, _T("\\freeldr.ini")); if (PathFileExists(m_szFreeldrIni)) { /* freeldr.ini exists */ - hInf = SetupOpenInfFile(m_szFreeldrIni, + hInf = SetupOpenInfFile(m_szFreeldrIni, NULL, INF_STYLE_OLDNT, NULL); @@ -442,7 +442,7 @@ LRESULT LoadOSList(HWND hwndDlg) if (PathFileExists(m_szFreeldrIni)) { /* load boot.ini settings */ - hInf = SetupOpenInfFile(m_szFreeldrIni, + hInf = SetupOpenInfFile(m_szFreeldrIni, NULL, INF_STYLE_OLDNT, NULL); @@ -664,7 +664,7 @@ StartRecDlgProc(HWND hwndDlg, // DeleteBootRecords(hwndDlg); // LoadOSList(hwndDlg); break; - } + } case IDOK: { /* save timeout */ diff --git a/reactos/dll/cpl/timedate/lang/cs-CZ.rc b/reactos/dll/cpl/timedate/lang/cs-CZ.rc index d039419abd4..261b3ca9e08 100644 --- a/reactos/dll/cpl/timedate/lang/cs-CZ.rc +++ b/reactos/dll/cpl/timedate/lang/cs-CZ.rc @@ -8,7 +8,7 @@ BEGIN GROUPBOX "&Datum", -1, 4, 2, 122, 125 COMBOBOX IDC_MONTHCB, 11, 17, 50, 120, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP EDITTEXT IDC_YEARTEXT,65, 17, 55, 12, ES_LEFT | WS_GROUP | ES_READONLY - CONTROL "", IDC_YEAR, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_NOTHOUSANDS | + CONTROL "", IDC_YEAR, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_NOTHOUSANDS | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 120, 17, 50, 12 CONTROL "", IDC_MONTHCALENDAR, "MonthCalWnd", @@ -20,7 +20,7 @@ BEGIN 144, 105, 90, 12 LTEXT "", IDC_TIMEZONE, 6, 132, 242, 11 CONTROL "", IDC_CLOCKWND, "ClockWndClass", - WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 + WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 END diff --git a/reactos/dll/cpl/timedate/lang/el-GR.rc b/reactos/dll/cpl/timedate/lang/el-GR.rc index 2d61b1afb6c..ea0f727945d 100644 --- a/reactos/dll/cpl/timedate/lang/el-GR.rc +++ b/reactos/dll/cpl/timedate/lang/el-GR.rc @@ -8,7 +8,7 @@ BEGIN GROUPBOX "&Çìåñïìçíßá", -1, 4, 2, 122, 125 COMBOBOX IDC_MONTHCB, 11, 17, 50, 120, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP EDITTEXT IDC_YEARTEXT,65, 17, 55, 12, ES_LEFT | WS_GROUP | ES_READONLY - CONTROL "", IDC_YEAR, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_NOTHOUSANDS | + CONTROL "", IDC_YEAR, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_NOTHOUSANDS | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 120, 17, 50, 12 @@ -21,7 +21,7 @@ BEGIN 144, 105, 90, 12 LTEXT "", IDC_TIMEZONE, 6, 132, 242, 11 CONTROL "", IDC_CLOCKWND, "ClockWndClass", - WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 + WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 END diff --git a/reactos/dll/cpl/timedate/lang/es-ES.rc b/reactos/dll/cpl/timedate/lang/es-ES.rc index 05af3459488..abaebb8d9fa 100644 --- a/reactos/dll/cpl/timedate/lang/es-ES.rc +++ b/reactos/dll/cpl/timedate/lang/es-ES.rc @@ -20,7 +20,7 @@ BEGIN 144, 105, 90, 12 LTEXT "", IDC_TIMEZONE, 6, 132, 242, 11 CONTROL "", IDC_CLOCKWND, "ClockWndClass", - WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 + WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 END diff --git a/reactos/dll/cpl/timedate/lang/hu-HU.rc b/reactos/dll/cpl/timedate/lang/hu-HU.rc index dc1cd550a6f..a595e5073a3 100644 --- a/reactos/dll/cpl/timedate/lang/hu-HU.rc +++ b/reactos/dll/cpl/timedate/lang/hu-HU.rc @@ -22,7 +22,7 @@ BEGIN 144, 105, 90, 12 LTEXT "", IDC_TIMEZONE, 6, 132, 242, 11 CONTROL "", IDC_CLOCKWND, "ClockWndClass", - WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 + WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 END diff --git a/reactos/dll/cpl/timedate/lang/ja-JP.rc b/reactos/dll/cpl/timedate/lang/ja-JP.rc index 13decd6f517..78a55614ca7 100644 --- a/reactos/dll/cpl/timedate/lang/ja-JP.rc +++ b/reactos/dll/cpl/timedate/lang/ja-JP.rc @@ -21,7 +21,7 @@ BEGIN 144, 105, 90, 12 LTEXT "", IDC_TIMEZONE, 4, 136, 241, 8 CONTROL "", IDC_CLOCKWND, "ClockWndClass", - WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 + WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 END diff --git a/reactos/dll/cpl/timedate/lang/nl-NL.rc b/reactos/dll/cpl/timedate/lang/nl-NL.rc index 20e45fc289d..ab1fe975be6 100644 --- a/reactos/dll/cpl/timedate/lang/nl-NL.rc +++ b/reactos/dll/cpl/timedate/lang/nl-NL.rc @@ -20,7 +20,7 @@ BEGIN 144, 105, 90, 12 LTEXT "", IDC_TIMEZONE, 6, 132, 242, 11 CONTROL "", IDC_CLOCKWND, "ClockWndClass", - WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 + WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 END diff --git a/reactos/dll/cpl/timedate/lang/sk-SK.rc b/reactos/dll/cpl/timedate/lang/sk-SK.rc index ee4c4ccd9ac..f3ade9519c2 100644 --- a/reactos/dll/cpl/timedate/lang/sk-SK.rc +++ b/reactos/dll/cpl/timedate/lang/sk-SK.rc @@ -15,7 +15,7 @@ BEGIN GROUPBOX "&Dátum", -1, 4, 2, 122, 125 COMBOBOX IDC_MONTHCB, 11, 17, 50, 120, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP EDITTEXT IDC_YEARTEXT,65, 17, 55, 12, ES_LEFT | WS_GROUP | ES_READONLY - CONTROL "", IDC_YEAR, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_NOTHOUSANDS | + CONTROL "", IDC_YEAR, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_NOTHOUSANDS | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 120, 17, 50, 12 CONTROL "", IDC_MONTHCALENDAR, "MonthCalWnd", @@ -27,7 +27,7 @@ BEGIN 144, 105, 90, 12 LTEXT "", IDC_TIMEZONE, 6, 132, 242, 11 CONTROL "", IDC_CLOCKWND, "ClockWndClass", - WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 + WS_CHILD | WS_VISIBLE, 138, 12, 102, 89 END diff --git a/reactos/dll/cpl/timedate/ntpclient.c b/reactos/dll/cpl/timedate/ntpclient.c index df44f1c3a70..f2ed06cae0f 100644 --- a/reactos/dll/cpl/timedate/ntpclient.c +++ b/reactos/dll/cpl/timedate/ntpclient.c @@ -134,7 +134,7 @@ RecieveData(PINFO pInfo) } -ULONG +ULONG GetServerTime(LPWSTR lpAddress) { PINFO pInfo; @@ -143,7 +143,7 @@ GetServerTime(LPWSTR lpAddress) ULONG ulTime = 0; pInfo = (PINFO)HeapAlloc(GetProcessHeap(), - 0, + 0, sizeof(INFO)); lpAddr = (LPSTR)HeapAlloc(GetProcessHeap(), 0, diff --git a/reactos/dll/cpl/timedate/timedate.c b/reactos/dll/cpl/timedate/timedate.c index f35deb4c6d3..b6263bd198e 100644 --- a/reactos/dll/cpl/timedate/timedate.c +++ b/reactos/dll/cpl/timedate/timedate.c @@ -81,7 +81,7 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); - if (RegisterMonthCalControl(hApplet) && + if (RegisterMonthCalControl(hApplet) && RegisterClockControl()) { LoadStringW(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(WCHAR)); diff --git a/reactos/dll/cpl/usrmgr/usrmgr.c b/reactos/dll/cpl/usrmgr/usrmgr.c index e43fd8d1764..992441e1c58 100644 --- a/reactos/dll/cpl/usrmgr/usrmgr.c +++ b/reactos/dll/cpl/usrmgr/usrmgr.c @@ -17,7 +17,7 @@ static LONG APIENTRY UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lP HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { { IDC_USRMGR_ICON, diff --git a/reactos/dll/directx/d3d8/d3d8.c b/reactos/dll/directx/d3d8/d3d8.c index ee1ed978478..bcaec14f40d 100644 --- a/reactos/dll/directx/d3d8/d3d8.c +++ b/reactos/dll/directx/d3d8/d3d8.c @@ -30,12 +30,12 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserve { switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: + case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } - + return TRUE; } diff --git a/reactos/dll/directx/d3d8thk/d3d8thk.rbuild b/reactos/dll/directx/d3d8thk/d3d8thk.rbuild index e62f46d954b..e702d069c86 100644 --- a/reactos/dll/directx/d3d8thk/d3d8thk.rbuild +++ b/reactos/dll/directx/d3d8thk/d3d8thk.rbuild @@ -2,6 +2,6 @@ - gdi32 + gdi32 d3d8thk.rc diff --git a/reactos/dll/directx/d3d9/d3d9.c b/reactos/dll/directx/d3d9/d3d9.c index dbc6fb35759..bb579e11a3a 100644 --- a/reactos/dll/directx/d3d9/d3d9.c +++ b/reactos/dll/directx/d3d9/d3d9.c @@ -43,12 +43,12 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserve { switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: + case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } - + return TRUE; } diff --git a/reactos/dll/directx/ddraw/Clipper/clipper_main.c b/reactos/dll/directx/ddraw/Clipper/clipper_main.c index 0779c206d57..b69a514f6b9 100644 --- a/reactos/dll/directx/ddraw/Clipper/clipper_main.c +++ b/reactos/dll/directx/ddraw/Clipper/clipper_main.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/clipper/clipper_stubs.c - * PURPOSE: IDirectDrawClipper Implementation + * PURPOSE: IDirectDrawClipper Implementation * PROGRAMMER: Maarten Bosma * */ @@ -20,9 +20,9 @@ DirectDrawClipper_QueryInterface (LPDIRECTDRAWCLIPPER iface, return E_NOINTERFACE; } -HRESULT WINAPI -DirectDrawClipper_Initialize (LPDIRECTDRAWCLIPPER iface, - LPDIRECTDRAW lpDD, DWORD dwFlags) +HRESULT WINAPI +DirectDrawClipper_Initialize (LPDIRECTDRAWCLIPPER iface, + LPDIRECTDRAW lpDD, DWORD dwFlags) { LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface; LPDDRAWI_DIRECTDRAW_INT DDraw = (LPDDRAWI_DIRECTDRAW_INT)lpDD; @@ -51,8 +51,8 @@ DirectDrawClipper_Initialize (LPDIRECTDRAWCLIPPER iface, return DD_OK; } -ULONG WINAPI -DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) +ULONG WINAPI +DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) { LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface; if(!This) @@ -72,7 +72,7 @@ DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) return This->dwIntRefCnt; } -ULONG WINAPI +ULONG WINAPI DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface) { LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface; @@ -91,10 +91,10 @@ DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface) return This->dwIntRefCnt; } -HRESULT WINAPI -DirectDrawClipper_SetHwnd( LPDIRECTDRAWCLIPPER iface, - DWORD dwFlags, - HWND hWnd) +HRESULT WINAPI +DirectDrawClipper_SetHwnd( LPDIRECTDRAWCLIPPER iface, + DWORD dwFlags, + HWND hWnd) { LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface; @@ -112,9 +112,9 @@ DirectDrawClipper_SetHwnd( LPDIRECTDRAWCLIPPER iface, return DD_OK; } -HRESULT WINAPI -DirectDrawClipper_GetHWnd( LPDIRECTDRAWCLIPPER iface, - HWND* hWndPtr) +HRESULT WINAPI +DirectDrawClipper_GetHWnd( LPDIRECTDRAWCLIPPER iface, + HWND* hWndPtr) { LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface; diff --git a/reactos/dll/directx/ddraw/Clipper/clipper_stubs.c b/reactos/dll/directx/ddraw/Clipper/clipper_stubs.c index 758971230bb..a5dab44ab77 100644 --- a/reactos/dll/directx/ddraw/Clipper/clipper_stubs.c +++ b/reactos/dll/directx/ddraw/Clipper/clipper_stubs.c @@ -3,36 +3,36 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/clipper/clipper_stubs.c - * PURPOSE: IDirectDrawClipper Implementation + * PURPOSE: IDirectDrawClipper Implementation * PROGRAMMER: Maarten Bosma * */ #include "rosdraw.h" -HRESULT WINAPI -DirectDrawClipper_GetClipList( LPDIRECTDRAWCLIPPER iface, - LPRECT lpRect, +HRESULT WINAPI +DirectDrawClipper_GetClipList( LPDIRECTDRAWCLIPPER iface, + LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI +HRESULT WINAPI DirectDrawClipper_SetClipList( LPDIRECTDRAWCLIPPER iface, LPRGNDATA lprgn, - DWORD dwFlag) + DWORD dwFlag) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI -DirectDrawClipper_IsClipListChanged( LPDIRECTDRAWCLIPPER iface, - BOOL* lpbChanged) +HRESULT WINAPI +DirectDrawClipper_IsClipListChanged( LPDIRECTDRAWCLIPPER iface, + BOOL* lpbChanged) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } diff --git a/reactos/dll/directx/ddraw/Color/color_stubs.c b/reactos/dll/directx/ddraw/Color/color_stubs.c index 31113fc11fb..8bd2a8b79db 100644 --- a/reactos/dll/directx/ddraw/Color/color_stubs.c +++ b/reactos/dll/directx/ddraw/Color/color_stubs.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/color/color.c - * PURPOSE: IDirectDrawColorControl Implementation + * PURPOSE: IDirectDrawColorControl Implementation * PROGRAMMER: Maarten Bosma * */ @@ -12,10 +12,10 @@ ULONG WINAPI DirectDrawColorControl_AddRef( LPDIRECTDRAWCOLORCONTROL iface) -{ +{ DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } ULONG WINAPI @@ -24,28 +24,28 @@ DirectDrawColorControl_Release( LPDIRECTDRAWCOLORCONTROL iface) LPDDRAWI_DDCOLORCONTROL_INT This = (LPDDRAWI_DDCOLORCONTROL_INT)iface; DX_WINDBG_trace(); - /* FIXME - This is not right exiame how it should be done + /* FIXME + This is not right exiame how it should be done */ DX_STUB_str("FIXME This is not right exiame how it should be done\n"); return This->dwIntRefCnt; } HRESULT WINAPI -DirectDrawColorControl_QueryInterface( LPDIRECTDRAWCOLORCONTROL iface, - REFIID riid, - LPVOID* ppvObj) +DirectDrawColorControl_QueryInterface( LPDIRECTDRAWCOLORCONTROL iface, + REFIID riid, + LPVOID* ppvObj) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI -DirectDrawColorControl_GetColorControls( LPDIRECTDRAWCOLORCONTROL iface, +DirectDrawColorControl_GetColorControls( LPDIRECTDRAWCOLORCONTROL iface, LPDDCOLORCONTROL lpColorControl) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI @@ -53,7 +53,7 @@ DirectDrawColorControl_SetColorControls( LPDIRECTDRAWCOLORCONTROL iface, LPDDCOLORCONTROL lpColorControl) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable = diff --git a/reactos/dll/directx/ddraw/Ddraw/GetCaps.c b/reactos/dll/directx/ddraw/Ddraw/GetCaps.c index 0a1ccddf1c3..07ff6a0887a 100644 --- a/reactos/dll/directx/ddraw/Ddraw/GetCaps.c +++ b/reactos/dll/directx/ddraw/Ddraw/GetCaps.c @@ -10,7 +10,7 @@ /* TODO * lpddNLVHELCaps and lpddNLVCaps - * Thouse two can be null or inviald in lpGBL + * Thouse two can be null or inviald in lpGBL * we need add code in startup to detect if we have lpddNLVCaps set * ms HEL does not support lpddNLVHELCaps shall we do that ? * ms HEL does not support dwVidMemTotal and dwVidMemFree shall we implement a emulate of them ? @@ -91,7 +91,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, { LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pDriverCaps; - /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c + /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) { memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); @@ -117,7 +117,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, { LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pDriverCaps; - /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c + /* FIXME This->lpLcl->lpGbl->lpddNLVCaps are not set in startup.c if (This->lpLcl->lpGbl->lpddNLVCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) { memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVCaps, sizeof(DDNONLOCALVIDMEMCAPS)); @@ -199,7 +199,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, { LPDDCAPS_DX5 myCaps = (LPDDCAPS_DX5) pHELCaps; - /* FIXME This->lpLcl->lpGbl->lpddNLVHELCaps are not set in startup.c + /* FIXME This->lpLcl->lpGbl->lpddNLVHELCaps are not set in startup.c if (This->lpLcl->lpGbl->lpddNLVHELCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) { memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVHELCaps, sizeof(DDNONLOCALVIDMEMCAPS)); @@ -225,7 +225,7 @@ Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps, { LPDDCAPS_DX7 myCaps = (LPDDCAPS_DX7) pHELCaps; - /* FIXME This->lpLcl->lpGbl->lpddNLVHELCaps are not set in startup.c + /* FIXME This->lpLcl->lpGbl->lpddNLVHELCaps are not set in startup.c if (This->lpLcl->lpGbl->lpddNLVHELCaps->dwSize == sizeof(DDNONLOCALVIDMEMCAPS)) { memcpy(&myCaps->dwNLVBCaps, This->lpLcl->lpGbl->lpddNLVHELCaps, sizeof(DDNONLOCALVIDMEMCAPS)); diff --git a/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c b/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c index 64f0b8bba7e..3b17c05cb21 100644 --- a/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c +++ b/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c @@ -9,7 +9,7 @@ */ /* TODO - * We need adding digtial signarture detections for the drivers + * We need adding digtial signarture detections for the drivers * and count out which level the signtature driver got, the value * shall be save to pDDDI->dwWHQLLevel, But I do not known how todo * this part yet, That is only missing feature in this functions @@ -150,7 +150,7 @@ Main_DirectDraw_GetDeviceIdentifier7(LPDDRAWI_DIRECTDRAW_INT This, /* Count out the guidDeviceIdentifier */ memcpy(&pDDDI->guidDeviceIdentifier, &CLSID_DirectDraw,sizeof(GUID)); - + pDDDI->guidDeviceIdentifier.Data1 ^= pDDDI->dwVendorId; lpdata = (long *)&pDDDI->guidDeviceIdentifier.Data2; @@ -163,8 +163,8 @@ Main_DirectDraw_GetDeviceIdentifier7(LPDDRAWI_DIRECTDRAW_INT This, *lpdata = (*lpdata ^ pDDDI->dwRevision) ^ pDDDI->liDriverVersion.HighPart; /* FIXME pDDDI->dwWHQLLevel - * we leave this with no informations, I do not known - * if program care for it, I mark this api done, and + * we leave this with no informations, I do not known + * if program care for it, I mark this api done, and * tested, no bugs was found in it */ pDDDI->dwWHQLLevel = 0; diff --git a/reactos/dll/directx/ddraw/Ddraw/callbacks_dd_hel.c b/reactos/dll/directx/ddraw/Ddraw/callbacks_dd_hel.c index d608bb86e0d..8592543152c 100644 --- a/reactos/dll/directx/ddraw/Ddraw/callbacks_dd_hel.c +++ b/reactos/dll/directx/ddraw/Ddraw/callbacks_dd_hel.c @@ -15,9 +15,9 @@ extern DDPIXELFORMAT pixelformats[]; extern DWORD pixelformatsCount; /* - * Direct Draw Callbacks + * Direct Draw Callbacks */ - + DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver) { DX_STUB; @@ -44,7 +44,7 @@ DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode) DevMode.dmSize = (WORD)sizeof(DEVMODE); DevMode.dmDriverExtra = 0; - SetMode->ddRVal = DDERR_UNSUPPORTEDMODE; + SetMode->ddRVal = DDERR_UNSUPPORTEDMODE; if (EnumDisplaySettingsEx(NULL, SetMode->dwModeIndex, &DevMode, 0 ) != 0) { @@ -53,7 +53,7 @@ DWORD CALLBACK HelDdSetMode(LPDDHAL_SETMODEDATA SetMode) if (ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { DX_STUB_str("FAIL"); - SetMode->ddRVal = DDERR_UNSUPPORTEDMODE; + SetMode->ddRVal = DDERR_UNSUPPORTEDMODE; } else { @@ -90,7 +90,7 @@ DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiv DX_WINDBG_trace(); DX_STUB_str("Not implement yet, return DD_OK for not bsod\n"); lpSetExclusiveMode->ddRVal = DD_OK; - + return DDHAL_DRIVER_HANDLED; } diff --git a/reactos/dll/directx/ddraw/Ddraw/ddraw.h b/reactos/dll/directx/ddraw/Ddraw/ddraw.h index 52791866e27..0fc9ddba016 100644 --- a/reactos/dll/directx/ddraw/Ddraw/ddraw.h +++ b/reactos/dll/directx/ddraw/Ddraw/ddraw.h @@ -30,7 +30,7 @@ Main_DirectDraw_CreatePalette( LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN pUnkOuter); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_CreateSurface4( LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pDDSD, @@ -43,7 +43,7 @@ Main_DirectDraw_DuplicateSurface( LPDIRECTDRAWSURFACE7 src, LPDIRECTDRAWSURFACE7* dst); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_EnumDisplayModes( LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags, @@ -137,16 +137,16 @@ Main_DirectDraw_GetAvailableVidMem4( LPDWORD dwTotal, LPDWORD dwFree); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC( LPDDRAWI_DIRECTDRAW_INT This, HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDDRAWI_DIRECTDRAW_INT This); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDDRAWI_DIRECTDRAW_INT This); HRESULT WINAPI @@ -155,7 +155,7 @@ Main_DirectDraw_GetDeviceIdentifier7( LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_StartModeTest( LPDDRAWI_DIRECTDRAW_INT This, LPSIZE pModes, diff --git a/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c b/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c index f99eb38c395..c7247a6c888 100644 --- a/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c +++ b/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c @@ -14,7 +14,7 @@ /* PSEH for SEH Support */ #include -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags, LPDDSURFACEDESC2 pDDSD, LPVOID pContext, LPDDENUMMODESCALLBACK2 pCallback) { @@ -27,7 +27,7 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags, _SEH_TRY { - if + if ((!IsBadReadPtr(pCallback,sizeof(LPDDENUMMODESCALLBACK2))) || (!IsBadWritePtr(pCallback,sizeof(LPDDENUMMODESCALLBACK2))) || (!IsBadReadPtr(pDDSD,sizeof(DDSURFACEDESC2))) || @@ -43,7 +43,7 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags, while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE) { - DDSURFACEDESC2 SurfaceDesc; + DDSURFACEDESC2 SurfaceDesc; iMode++; @@ -57,11 +57,11 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags, SurfaceDesc.ddpfPixelFormat.dwSize = sizeof (DDPIXELFORMAT); SurfaceDesc.ddpfPixelFormat.dwFlags = DDPF_RGB; // FIXME: get these - /* - SurfaceDesc.ddpfPixelFormat.dwRBitMask = - SurfaceDesc.ddpfPixelFormat.dwGBitMask = - SurfaceDesc.ddpfPixelFormat.dwBBitMask = - SurfaceDesc.ddpfPixelFormat.dwRGBAlphaBitMask = + /* + SurfaceDesc.ddpfPixelFormat.dwRBitMask = + SurfaceDesc.ddpfPixelFormat.dwGBitMask = + SurfaceDesc.ddpfPixelFormat.dwBBitMask = + SurfaceDesc.ddpfPixelFormat.dwRGBAlphaBitMask = */ SurfaceDesc.ddpfPixelFormat.dwRGBBitCount = DevMode.dmBitsPerPel; @@ -123,10 +123,10 @@ Main_DirectDraw_SetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, DWORD dwWidth, DWO } else { - if ((!dwHeight || This->lpLcl->lpGbl->vmiData.dwDisplayHeight == dwHeight) && - (!dwWidth || This->lpLcl->lpGbl->vmiData.dwDisplayWidth == dwWidth) && + if ((!dwHeight || This->lpLcl->lpGbl->vmiData.dwDisplayHeight == dwHeight) && + (!dwWidth || This->lpLcl->lpGbl->vmiData.dwDisplayWidth == dwWidth) && (!dwBPP || This->lpLcl->lpGbl->vmiData.ddpfDisplay.dwRGBBitCount == dwBPP) && - (!dwRefreshRate || This->lpLcl->lpGbl->dwMonitorFrequency == dwRefreshRate)) + (!dwRefreshRate || This->lpLcl->lpGbl->dwMonitorFrequency == dwRefreshRate)) { ret = DD_OK; // nothing to do here for us } @@ -137,13 +137,13 @@ Main_DirectDraw_SetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, DWORD dwWidth, DWO DEVMODE DevMode; DevMode.dmFields = 0; - if (dwHeight) + if (dwHeight) DevMode.dmFields |= DM_PELSHEIGHT; - if (dwWidth) + if (dwWidth) DevMode.dmFields |= DM_PELSWIDTH; - if (dwBPP) + if (dwBPP) DevMode.dmFields |= DM_BITSPERPEL; - if (dwRefreshRate) + if (dwRefreshRate) DevMode.dmFields |= DM_DISPLAYFREQUENCY; DevMode.dmPelsHeight = dwHeight; @@ -194,7 +194,7 @@ Main_DirectDraw_RestoreDisplayMode (LPDDRAWI_DIRECTDRAW_INT This) // Update Interals - + This->lpLcl->lpGbl->hDD = This->lpLcl->hDD; DdReenableDirectDrawObject(This->lpLcl->lpGbl, &ModeChanged); StartDirectDraw((LPDIRECTDRAW)This, 0, TRUE); diff --git a/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c b/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c index 11c3ac46f03..5a98584f65c 100644 --- a/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c +++ b/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c @@ -9,7 +9,7 @@ */ /* TODO - * add warper functions for dx 1 - 6 + * add warper functions for dx 1 - 6 * map the DirectDraw4_Vtable, DirectDraw2_Vtable, DirectDraw_Vtable * table to right version of the functions */ @@ -222,10 +222,10 @@ Main_DirectDraw_Initialize (LPDDRAWI_DIRECTDRAW_INT This, LPGUID lpGUID) return DDERR_ALREADYINITIALIZED; } -/* +/* * Main_DirectDraw_Compact * ms say this one is not implement but it return DDERR_NOEXCLUSIVEMODE - * when no exclusive owner are set in corpativelevel + * when no exclusive owner are set in corpativelevel */ HRESULT WINAPI Main_DirectDraw_Compact(LPDDRAWI_DIRECTDRAW_INT This) @@ -250,7 +250,7 @@ Main_DirectDraw_Compact(LPDDRAWI_DIRECTDRAW_INT This) return retVal; } -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS ddscaps, LPDWORD dwTotal, LPDWORD dwFree) { DDSCAPS2 myddscaps; @@ -272,7 +272,7 @@ Main_DirectDraw_GetAvailableVidMem(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS ddsca return retValue; } -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS2 ddscaps, LPDWORD dwTotal, LPDWORD dwFree) { @@ -297,7 +297,7 @@ Main_DirectDraw_GetAvailableVidMem4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS2 dds _SEH_LEAVE; } - if ( ddscaps->dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX | DDSCAPS_FLIP | + if ( ddscaps->dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX | DDSCAPS_FLIP | DDSCAPS_FRONTBUFFER | DDSCAPS_PALETTE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_VISIBLE | DDSCAPS_WRITEONLY | DDSCAPS_OWNDC)) { @@ -305,10 +305,10 @@ Main_DirectDraw_GetAvailableVidMem4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS2 dds _SEH_LEAVE; } - + /* ddscaps->dwCaps2 & 0x01 - this flag is outdate and are - set to 0 in ms dxsdk the name of + this flag is outdate and are + set to 0 in ms dxsdk the name of this flag is DDSCAPS2_HARDWAREDEINTERLACE */ @@ -359,7 +359,7 @@ Main_DirectDraw_GetAvailableVidMem4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS2 dds if (dwFree) *dwFree = memdata.dwFree; - + retVal = memdata.ddRVal; } } @@ -379,7 +379,7 @@ Main_DirectDraw_GetFourCCCodes(LPDDRAWI_DIRECTDRAW_INT This, LPDWORD lpNumCodes, DX_WINDBG_trace(); - + // EnterCriticalSection(&ddcs); _SEH_TRY @@ -422,17 +422,17 @@ Main_DirectDraw_GetFourCCCodes(LPDDRAWI_DIRECTDRAW_INT This, LPDWORD lpNumCodes, } -/* - * We can optain the version of the directdraw object by compare the - * vtl table pointer from iface we do not need pass which version +/* + * We can optain the version of the directdraw object by compare the + * vtl table pointer from iface we do not need pass which version * we whant to use * * Main_DirectDraw_CreateSurface is dead at moment we do only support - * directdraw 7 at moment + * directdraw 7 at moment */ /* For DirectDraw 1 - 3 */ -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC pDDSD, LPDIRECTDRAWSURFACE *ppSurf, IUnknown *pUnkOuter) { @@ -468,7 +468,7 @@ Main_DirectDraw_CreateSurface (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC pDD /* For DirectDraw 4 - 7 */ -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_CreateSurface4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pDDSD, LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter) { diff --git a/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c b/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c index 2dd375e6e55..5872527e978 100644 --- a/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c +++ b/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c @@ -30,7 +30,7 @@ Main_DirectDraw_SetCooperativeLevel (LPDDRAWI_DIRECTDRAW_INT This, HWND hwnd, DW _SEH_LEAVE; } - // FIXME test if 0x20 exists as a flag and what thuse it do + // FIXME test if 0x20 exists as a flag and what thuse it do if ( cooplevel & (~(DDSCL_FPUPRESERVE | DDSCL_FPUSETUP | DDSCL_MULTITHREADED | DDSCL_CREATEDEVICEWINDOW | DDSCL_SETDEVICEWINDOW | DDSCL_SETFOCUSWINDOW | DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_NORMAL | DDSCL_NOWINDOWCHANGES | DDSCL_ALLOWREBOOT | DDSCL_FULLSCREEN))) @@ -56,7 +56,7 @@ Main_DirectDraw_SetCooperativeLevel (LPDDRAWI_DIRECTDRAW_INT This, HWND hwnd, DW { retVal = DDERR_INVALIDPARAMS; _SEH_LEAVE; - } + } if ((cooplevel & DDSCL_ALLOWMODEX) && (!(cooplevel & DDSCL_FULLSCREEN))) { @@ -123,7 +123,7 @@ Main_DirectDraw_SetCooperativeLevel (LPDDRAWI_DIRECTDRAW_INT This, HWND hwnd, DW This->lpLcl->dwLocalFlags = DDRAWILCL_SETCOOPCALLED | DDRAWILCL_DIRECTDRAW7 | DDRAWILCL_HOOKEDHWND | DDRAWILCL_HASEXCLUSIVEMODE | DDRAWILCL_ISFULLSCREEN | DDRAWILCL_ACTIVEYES | DDRAWILCL_CURSORCLIPPED; - + if (cooplevel & DDSCL_ALLOWMODEX) { This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags | DDRAWILCL_ALLOWMODEX; @@ -150,7 +150,7 @@ Main_DirectDraw_SetCooperativeLevel (LPDDRAWI_DIRECTDRAW_INT This, HWND hwnd, DW ///* Handle those levels first which set various hwnds */ //if(cooplevel & DDSCL_SETFOCUSWINDOW) //{ - // + // // if(This->lpLcl->dwLocalFlags & DDRAWILCL_SETCOOPCALLED) // { diff --git a/reactos/dll/directx/ddraw/Gamma/gamma_stubs.c b/reactos/dll/directx/ddraw/Gamma/gamma_stubs.c index abdc7f09449..c691b4ff27b 100644 --- a/reactos/dll/directx/ddraw/Gamma/gamma_stubs.c +++ b/reactos/dll/directx/ddraw/Gamma/gamma_stubs.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/gamma/gamma_stubs.c - * PURPOSE: IDirectDrawGamma Implementation + * PURPOSE: IDirectDrawGamma Implementation * PROGRAMMER: Maarten Bosma * */ @@ -12,27 +12,27 @@ ULONG WINAPI DirectDrawGammaControl_AddRef( LPDIRECTDRAWGAMMACONTROL iface) -{ +{ DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } ULONG WINAPI DirectDrawGammaControl_Release( LPDIRECTDRAWGAMMACONTROL iface) -{ +{ LPDDRAWI_DDGAMMACONTROL_INT This = (LPDDRAWI_DDGAMMACONTROL_INT)iface; DX_WINDBG_trace(); - /* FIXME - This is not right exiame how it should be done + /* FIXME + This is not right exiame how it should be done */ DX_STUB_str("FIXME This is not right exiame how it should be done\n"); return This->dwIntRefCnt; } HRESULT WINAPI -DirectDrawGammaControl_QueryInterface( LPDIRECTDRAWGAMMACONTROL iface, +DirectDrawGammaControl_QueryInterface( LPDIRECTDRAWGAMMACONTROL iface, REFIID riid, LPVOID *ppObj) { @@ -41,21 +41,21 @@ DirectDrawGammaControl_QueryInterface( LPDIRECTDRAWGAMMACONTROL iface, } HRESULT WINAPI -DirectDrawGammaControl_GetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, - DWORD dwFlags, +DirectDrawGammaControl_GetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, + DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI -DirectDrawGammaControl_SetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, - DWORD dwFlags, +DirectDrawGammaControl_SetGammaRamp( LPDIRECTDRAWGAMMACONTROL iface, + DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable = diff --git a/reactos/dll/directx/ddraw/Kernel/kernel_stubs.c b/reactos/dll/directx/ddraw/Kernel/kernel_stubs.c index e5f0563924d..96e8b7419f1 100644 --- a/reactos/dll/directx/ddraw/Kernel/kernel_stubs.c +++ b/reactos/dll/directx/ddraw/Kernel/kernel_stubs.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/kernel/kernel_stubs.c - * PURPOSE: IDirectDrawKernel and IDirectDrawSurfaceKernel Implementation + * PURPOSE: IDirectDrawKernel and IDirectDrawSurfaceKernel Implementation * PROGRAMMER: Maarten Bosma * */ @@ -13,52 +13,52 @@ /***** IDirectDrawKernel ****/ -ULONG WINAPI +ULONG WINAPI DirectDrawKernel_AddRef ( LPDIRECTDRAWKERNEL iface) -{ - DX_WINDBG_trace(); - - DX_STUB; -} - -ULONG WINAPI -DirectDrawKernel_Release ( LPDIRECTDRAWKERNEL iface) -{ +{ DX_WINDBG_trace(); DX_STUB; } -HRESULT WINAPI -DirectDrawKernel_QueryInterface ( LPDIRECTDRAWKERNEL iface, - REFIID riid, +ULONG WINAPI +DirectDrawKernel_Release ( LPDIRECTDRAWKERNEL iface) +{ + DX_WINDBG_trace(); + + DX_STUB; +} + +HRESULT WINAPI +DirectDrawKernel_QueryInterface ( LPDIRECTDRAWKERNEL iface, + REFIID riid, LPVOID* ppvObj) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI -DirectDrawKernel_GetKernelHandle ( LPDIRECTDRAWKERNEL iface, +HRESULT WINAPI +DirectDrawKernel_GetKernelHandle ( LPDIRECTDRAWKERNEL iface, ULONG* handle) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI +HRESULT WINAPI DirectDrawKernel_ReleaseKernelHandle ( LPDIRECTDRAWKERNEL iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -ULONG WINAPI +ULONG WINAPI DDSurfaceKernel_AddRef ( LPDIRECTDRAWSURFACEKERNEL iface) -{ +{ LPDDRAWI_DDKERNELSURFACE_INT This = (LPDDRAWI_DDKERNELSURFACE_INT)iface; - + DX_WINDBG_trace(); if (iface!=NULL) @@ -74,41 +74,41 @@ DDSurfaceKernel_AddRef ( LPDIRECTDRAWSURFACEKERNEL iface) return This->dwIntRefCnt; } -ULONG WINAPI +ULONG WINAPI DDSurfaceKernel_Release ( LPDIRECTDRAWSURFACEKERNEL iface) -{ +{ LPDDRAWI_DDKERNELSURFACE_INT This = (LPDDRAWI_DDKERNELSURFACE_INT)iface; DX_WINDBG_trace(); - /* FIXME - This is not right exiame how it should be done + /* FIXME + This is not right exiame how it should be done */ DX_STUB_str("FIXME This is not right exiame how it should be done\n"); return This->dwIntRefCnt; } -HRESULT WINAPI -DDSurfaceKernel_QueryInterface ( LPDIRECTDRAWSURFACEKERNEL iface, - REFIID riid, +HRESULT WINAPI +DDSurfaceKernel_QueryInterface ( LPDIRECTDRAWSURFACEKERNEL iface, + REFIID riid, LPVOID* ppvObj) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI -DDSurfaceKernel_GetKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface, +HRESULT WINAPI +DDSurfaceKernel_GetKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface, ULONG* handle) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI +HRESULT WINAPI DDSurfaceKernel_ReleaseKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } diff --git a/reactos/dll/directx/ddraw/Palette/palette_stubs.c b/reactos/dll/directx/ddraw/Palette/palette_stubs.c index fe6a81ef813..c88cefa8a6f 100644 --- a/reactos/dll/directx/ddraw/Palette/palette_stubs.c +++ b/reactos/dll/directx/ddraw/Palette/palette_stubs.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/palette/palette_stubs.c - * PURPOSE: IDirectDrawPalette Implementation + * PURPOSE: IDirectDrawPalette Implementation * PROGRAMMER: Maarten Bosma * */ @@ -12,32 +12,32 @@ ULONG WINAPI DirectDrawPalette_Release( LPDIRECTDRAWPALETTE iface) -{ +{ DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -ULONG WINAPI -DirectDrawPalette_AddRef( LPDIRECTDRAWPALETTE iface) -{ +ULONG WINAPI +DirectDrawPalette_AddRef( LPDIRECTDRAWPALETTE iface) +{ DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI DirectDrawPalette_Initialize( LPDIRECTDRAWPALETTE iface, - LPDIRECTDRAW ddraw, + LPDIRECTDRAW ddraw, DWORD dwFlags, LPPALETTEENTRY palent) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI -DirectDrawPalette_GetEntries( LPDIRECTDRAWPALETTE iface, +DirectDrawPalette_GetEntries( LPDIRECTDRAWPALETTE iface, DWORD dwFlags, DWORD dwStart, DWORD dwCount, LPPALETTEENTRY palent) @@ -47,7 +47,7 @@ DirectDrawPalette_GetEntries( LPDIRECTDRAWPALETTE iface, } HRESULT WINAPI -DirectDrawPalette_SetEntries( LPDIRECTDRAWPALETTE iface, +DirectDrawPalette_SetEntries( LPDIRECTDRAWPALETTE iface, DWORD dwFlags, DWORD dwStart, DWORD dwCount, @@ -57,7 +57,7 @@ DirectDrawPalette_SetEntries( LPDIRECTDRAWPALETTE iface, DX_STUB; } HRESULT WINAPI -DirectDrawPalette_GetCaps( LPDIRECTDRAWPALETTE iface, +DirectDrawPalette_GetCaps( LPDIRECTDRAWPALETTE iface, LPDWORD lpdwCaps) { DX_WINDBG_trace(); @@ -66,7 +66,7 @@ DirectDrawPalette_GetCaps( LPDIRECTDRAWPALETTE iface, HRESULT WINAPI DirectDrawPalette_QueryInterface( LPDIRECTDRAWPALETTE iface, - REFIID refiid, + REFIID refiid, LPVOID *obj) { DX_WINDBG_trace(); diff --git a/reactos/dll/directx/ddraw/Surface/callbacks_surf_hel.c b/reactos/dll/directx/ddraw/Surface/callbacks_surf_hel.c index 60bdc452189..c8a0800b4cc 100644 --- a/reactos/dll/directx/ddraw/Surface/callbacks_surf_hel.c +++ b/reactos/dll/directx/ddraw/Surface/callbacks_surf_hel.c @@ -48,9 +48,9 @@ DWORD CALLBACK HelDdSurfLock(LPDDHAL_LOCKDATA lpLockData) DWORD CALLBACK HelDdSurfreserved4(DWORD *lpPtr) { - /* + /* This api is not doucment by MS So I leave it - as stub. + as stub. */ DX_STUB; diff --git a/reactos/dll/directx/ddraw/Surface/createsurface.c b/reactos/dll/directx/ddraw/Surface/createsurface.c index dbff95aae34..1844f0637d1 100644 --- a/reactos/dll/directx/ddraw/Surface/createsurface.c +++ b/reactos/dll/directx/ddraw/Surface/createsurface.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/surface/createsurface.c - * PURPOSE: IDirectDrawSurface7 Creation + * PURPOSE: IDirectDrawSurface7 Creation * PROGRAMMER: Magnus Olsen * */ @@ -14,13 +14,13 @@ /* - * all param have been checked if they are vaild before they are call to - * Internal_CreateSurface, if not please fix the code in the functions - * call to Internal_CreateSurface, ppSurf,pDDSD,pDDraw are being vaildate in + * all param have been checked if they are vaild before they are call to + * Internal_CreateSurface, if not please fix the code in the functions + * call to Internal_CreateSurface, ppSurf,pDDSD,pDDraw are being vaildate in * Internal_CreateSurface */ -HRESULT +HRESULT Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD, LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter) { @@ -55,13 +55,13 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD, return DDERR_INVALIDPARAMS; } - if(!(pDDSD->dwFlags & DDSD_HEIGHT) && !(pDDSD->dwFlags & DDSD_HEIGHT) + if(!(pDDSD->dwFlags & DDSD_HEIGHT) && !(pDDSD->dwFlags & DDSD_HEIGHT) && !(pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) { return DDERR_INVALIDPARAMS; } - else if(pDDSD->dwFlags & DDSD_HEIGHT && pDDSD->dwFlags & DDSD_HEIGHT + else if(pDDSD->dwFlags & DDSD_HEIGHT && pDDSD->dwFlags & DDSD_HEIGHT && pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) { return DDERR_INVALIDPARAMS; @@ -129,7 +129,7 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD, return DDERR_OUTOFMEMORY; } - /* setup a list only one we really need is slist_lcl + /* setup a list only one we really need is slist_lcl rest of slist shall be release before a return */ slist_int[count] = ThisSurfInt; @@ -203,7 +203,7 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD, mDdCanCreateSurface.lpDDSurfaceDesc = (LPDDSURFACEDESC) pDDSD; mDdCanCreateSurface.ddRVal = DDERR_GENERIC; - if (mDdCanCreateSurface.CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) + if (mDdCanCreateSurface.CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) { DX_STUB_str("mDdCanCreateSurface DDHAL_DRIVER_NOTHANDLED fail"); return DDERR_NOTINITIALIZED; @@ -227,7 +227,7 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD, return DDERR_NOTINITIALIZED; } - if (mDdCreateSurface.ddRVal != DD_OK) + if (mDdCreateSurface.ddRVal != DD_OK) { return mDdCreateSurface.ddRVal; } diff --git a/reactos/dll/directx/ddraw/Surface/surface_main.c b/reactos/dll/directx/ddraw/Surface/surface_main.c index 8c0dbc59fa0..c1048d93363 100644 --- a/reactos/dll/directx/ddraw/Surface/surface_main.c +++ b/reactos/dll/directx/ddraw/Surface/surface_main.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/surface/surface_main.c - * PURPOSE: IDirectDrawSurface7 Implementation + * PURPOSE: IDirectDrawSurface7 Implementation * PROGRAMMER: Magnus Olsen, Maarten Bosma * */ @@ -11,12 +11,12 @@ #include "rosdraw.h" -/* FIXME adding hal and hel stub - DestroySurface; +/* FIXME adding hal and hel stub + DestroySurface; SetClipList; - AddAttachedSurface; + AddAttachedSurface; GetFlipStatus; - SetOverlayPosition; + SetOverlayPosition; SetPalette; */ @@ -43,7 +43,7 @@ ULONG WINAPI Main_DDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface) } } return This->dwIntRefCnt; - + } HRESULT WINAPI @@ -63,8 +63,8 @@ ULONG WINAPI Main_DDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface) { LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; - /* FIXME - This is not right exiame how it should be done + /* FIXME + This is not right exiame how it should be done */ DX_STUB_str("FIXME This is not right exiame how it should be done\n"); return This->dwIntRefCnt; @@ -72,7 +72,7 @@ ULONG WINAPI Main_DDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface) HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, LPDIRECTDRAWSURFACE7 src, LPRECT rsrc, DWORD dwFlags, LPDDBLTFX lpbltfx) -{ +{ LPDDRAWI_DDRAWSURFACE_INT ThisDest = (LPDDRAWI_DDRAWSURFACE_INT)iface; LPDDRAWI_DDRAWSURFACE_INT ThisSrc = (LPDDRAWI_DDRAWSURFACE_INT)src; @@ -80,7 +80,7 @@ HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, DX_WINDBG_trace(); - if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HALDDSurface.dwFlags + if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT) != DDHAL_SURFCB32_BLT) { return DDERR_GENERIC; @@ -88,17 +88,17 @@ HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, ZeroMemory(&mDdBlt, sizeof(DDHAL_BLTDATA)); ZeroMemory(&mDdBlt.bltFX, sizeof(DDBLTFX)); - - if (!DdResetVisrgn( ThisDest->lpLcl->lpSurfMore->slist[0], NULL)) + + if (!DdResetVisrgn( ThisDest->lpLcl->lpSurfMore->slist[0], NULL)) { - DX_STUB_str("DdResetVisrgn failed"); - } + DX_STUB_str("DdResetVisrgn failed"); + } mDdBlt.lpDD = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->lpGbl; mDdBlt.Blt = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->lpGbl->lpDDCBtmp->HALDDSurface.Blt; mDdBlt.lpDDDestSurface = ThisDest->lpLcl->lpSurfMore->slist[0]; - ThisDest->lpLcl->lpSurfMore->slist[0]->hDC = + ThisDest->lpLcl->lpSurfMore->slist[0]->hDC = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->hDC; /* Setup Src */ @@ -106,7 +106,7 @@ HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, { mDdBlt.lpDDSrcSurface = ThisSrc->lpLcl->lpSurfMore->slist[0]; - ThisSrc->lpLcl->lpSurfMore->slist[0]->hDC = + ThisSrc->lpLcl->lpSurfMore->slist[0]->hDC = ThisSrc->lpLcl->lpSurfMore->lpDD_lcl->hDC; if (rsrc != NULL) @@ -115,22 +115,22 @@ HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, } else { - if(!GetWindowRect((HWND)ThisSrc->lpLcl->lpSurfMore->lpDD_lcl->hWnd, + if(!GetWindowRect((HWND)ThisSrc->lpLcl->lpSurfMore->lpDD_lcl->hWnd, (RECT *)&mDdBlt.rSrc)) - { - DX_STUB_str("GetWindowRect failed"); - } + { + DX_STUB_str("GetWindowRect failed"); + } } - /* FIXME - * compare so we do not write to far + /* FIXME + * compare so we do not write to far * ThisDest->lpLcl->lpGbl->wWidth; <- surface max width * ThisDest->lpLcl->lpGbl->wHeight <- surface max heght * ThisDest->lpLcl->lpGbl->lPitch <- surface bpp */ - + } - + /* Setup dest */ if (rdst != NULL) { @@ -138,22 +138,22 @@ HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, } else { - if(!GetWindowRect((HWND)ThisDest->lpLcl->lpSurfMore->lpDD_lcl->hWnd, + if(!GetWindowRect((HWND)ThisDest->lpLcl->lpSurfMore->lpDD_lcl->hWnd, (RECT *)&mDdBlt.rDest)) - { - DX_STUB_str("GetWindowRect failed"); - } - + { + DX_STUB_str("GetWindowRect failed"); + } + } - /* FIXME - * compare so we do not write to far + /* FIXME + * compare so we do not write to far * ThisDest->lpLcl->lpGbl->wWidth; <- surface max width * ThisDest->lpLcl->lpGbl->wHeight <- surface max heght * ThisDest->lpLcl->lpGbl->lPitch <- surface bpp */ - + /* setup bltFX */ if (lpbltfx != NULL) { @@ -163,32 +163,32 @@ HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, /* setup value that are not config yet */ mDdBlt.dwFlags = dwFlags; mDdBlt.IsClipped = FALSE; - mDdBlt.bltFX.dwSize = sizeof(DDBLTFX); + mDdBlt.bltFX.dwSize = sizeof(DDBLTFX); - /* FIXME + /* FIXME BltData.dwRectCnt BltData.dwROPFlags - BltData.IsClipped - BltData.prDestRects + BltData.IsClipped + BltData.prDestRects BltData.rOrigDest - BltData.rOrigSrc - BltData.ddRVal + BltData.rOrigSrc + BltData.ddRVal */ - + if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED) { - DX_STUB_str("mDdBlt DDHAL_DRIVER_HANDLED"); + DX_STUB_str("mDdBlt DDHAL_DRIVER_HANDLED"); return DDERR_NOBLTHW; } - return mDdBlt.ddRVal; + return mDdBlt.ddRVal; } HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2 pDDSD, DWORD flags, HANDLE events) -{ +{ LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; DDHAL_LOCKDATA mdLock; @@ -203,33 +203,33 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect, } else { - mdLock.bHasRect = FALSE; + mdLock.bHasRect = FALSE; } - + //This->lpLcl->lpSurfMore->slist[0]->hDC = This->lpLcl->lpSurfMore->lpDD_lcl->hDC; mdLock.ddRVal = DDERR_NOTPALETTIZED; mdLock.Lock = This->lpLcl->lpSurfMore->lpDD_lcl->lpDDCB->HALDDSurface.Lock; mdLock.dwFlags = flags; mdLock.lpDDSurface = This->lpLcl->lpSurfMore->slist[0]; - mdLock.lpDD = This->lpLcl->lpSurfMore->lpDD_lcl->lpGbl; + mdLock.lpDD = This->lpLcl->lpSurfMore->lpDD_lcl->lpGbl; mdLock.lpSurfData = NULL; - - if (!DdResetVisrgn(This->lpLcl->lpSurfMore->slist[0], NULL)) + + if (!DdResetVisrgn(This->lpLcl->lpSurfMore->slist[0], NULL)) { DX_STUB_str("Here DdResetVisrgn lock"); return DDERR_UNSUPPORTED; } - + if (mdLock.Lock(&mdLock)!= DDHAL_DRIVER_HANDLED) { DX_STUB_str("Here DDHAL_DRIVER_HANDLED lock"); return DDERR_UNSUPPORTED; - } - - // FIXME ??? is this right ?? + } + + // FIXME ??? is this right ?? if (pDDSD != NULL) { @@ -251,8 +251,8 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect, //} - pDDSD->lpSurface = (LPVOID) mdLock.lpSurfData; - + pDDSD->lpSurface = (LPVOID) mdLock.lpSurfData; + pDDSD->dwHeight =This->lpLcl->lpGbl->wHeight; pDDSD->dwWidth = This->lpLcl->lpGbl->wWidth; @@ -270,12 +270,12 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect, HRESULT WINAPI Main_DDrawSurface_Unlock (LPDIRECTDRAWSURFACE7 iface, LPRECT pRect) -{ +{ LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; - DDHAL_UNLOCKDATA mdUnLock; + DDHAL_UNLOCKDATA mdUnLock; DX_WINDBG_trace(); - + if (!This->lpLcl->lpSurfMore->lpDD_lcl->lpDDCB->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_UNLOCK) { DX_STUB_str("DDERR_UNSUPPORTED"); @@ -287,8 +287,8 @@ HRESULT WINAPI Main_DDrawSurface_Unlock (LPDIRECTDRAWSURFACE7 iface, LPRECT pRec mdUnLock.lpDDSurface = This->lpLcl->lpSurfMore->slist[0]; mdUnLock.Unlock = This->lpLcl->lpSurfMore->lpDD_lcl->lpDDCB->HALDDSurface.Unlock; - if (!DdResetVisrgn( mdUnLock.lpDDSurface, NULL)) - { + if (!DdResetVisrgn( mdUnLock.lpDDSurface, NULL)) + { DX_STUB_str("DDERR_UNSUPPORTED"); return DDERR_UNSUPPORTED; } @@ -306,8 +306,8 @@ HRESULT WINAPI Main_DDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWSURFACE7 pAttach) { - - // LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; + + // LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; // LPDDRAWI_DDRAWSURFACE_INT That = (LPDDRAWI_DDRAWSURFACE_INT)pAttach; DX_WINDBG_trace(); @@ -327,19 +327,19 @@ Main_DDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface, DX_WINDBG_trace(); *ppSurface = (LPDIRECTDRAWSURFACE7) This->lpLcl->lpGbl->lpDD->dsList; - + return DD_OK; } HRESULT WINAPI Main_DDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags) -{ +{ LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; DX_WINDBG_trace(); - if (!This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_FLIP) + if (!This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_FLIP) { return DDERR_GENERIC; } @@ -349,27 +349,27 @@ Main_DDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags) HRESULT WINAPI Main_DDrawSurface_GetCaps(LPDIRECTDRAWSURFACE7 iface, LPDDSCAPS2 pCaps) -{ +{ LPDDRAWI_DDRAWSURFACE_INT This; DX_WINDBG_trace(); if (iface == NULL) { - return DDERR_INVALIDOBJECT; + return DDERR_INVALIDOBJECT; } if (pCaps == NULL) { - return DDERR_INVALIDPARAMS; + return DDERR_INVALIDPARAMS; } - This = (LPDDRAWI_DDRAWSURFACE_INT)iface; - + This = (LPDDRAWI_DDRAWSURFACE_INT)iface; + RtlZeroMemory(pCaps,sizeof(DDSCAPS2)); pCaps->dwCaps = This->lpLcl->ddsCaps.dwCaps; - + return DD_OK; } @@ -383,12 +383,12 @@ Main_DDrawSurface_GetClipper(LPDIRECTDRAWSURFACE7 iface, if (This == NULL) { - return DDERR_INVALIDOBJECT; + return DDERR_INVALIDOBJECT; } if (ppClipper == NULL) { - return DDERR_INVALIDPARAMS; + return DDERR_INVALIDPARAMS; } if (This->lpLcl->lp16DDClipper == NULL) @@ -398,7 +398,7 @@ Main_DDrawSurface_GetClipper(LPDIRECTDRAWSURFACE7 iface, *ppClipper = (LPDIRECTDRAWCLIPPER)This->lpLcl->lp16DDClipper; - return DD_OK; + return DD_OK; } HRESULT WINAPI @@ -411,14 +411,14 @@ Main_DDrawSurface_SetClipper (LPDIRECTDRAWSURFACE7 iface, if (This == NULL) { - return DDERR_INVALIDOBJECT; + return DDERR_INVALIDOBJECT; } if(pDDClipper == NULL) { if(!This->lpLcl->lp16DDClipper) return DDERR_NOCLIPPERATTACHED; - + DirectDrawClipper_Release((LPDIRECTDRAWCLIPPER)This->lpLcl->lp16DDClipper); This->lpLcl->lp16DDClipper = NULL; return DD_OK; @@ -441,15 +441,15 @@ Main_DDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface, HDC *phDC) if (iface == NULL) { - return DDERR_INVALIDOBJECT; + return DDERR_INVALIDOBJECT; } if (phDC == NULL) { - return DDERR_INVALIDPARAMS; + return DDERR_INVALIDPARAMS; } - This = (LPDDRAWI_DDRAWSURFACE_INT)iface; + This = (LPDDRAWI_DDRAWSURFACE_INT)iface; *phDC = (HDC)This->lpLcl->lpSurfMore->lpDD_lcl->hDC; @@ -464,11 +464,11 @@ Main_DDrawSurface_GetPixelFormat(LPDIRECTDRAWSURFACE7 iface, HRESULT retVale = DDERR_INVALIDPARAMS; DX_WINDBG_trace(); - + if (pDDPixelFormat != NULL) { if (This->lpLcl->dwFlags & DDRAWISURF_HASPIXELFORMAT) - { + { memcpy(pDDPixelFormat,&This->lpLcl->lpGbl->ddpfSurface,sizeof(DDPIXELFORMAT)); } else @@ -486,32 +486,32 @@ HRESULT WINAPI Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD) { - DWORD dwSize; - + DWORD dwSize; + LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; DX_WINDBG_trace(); dwSize = pDDSD->dwSize; - + if ((dwSize != sizeof(DDSURFACEDESC)) && - (dwSize != sizeof(DDSURFACEDESC2))) - { + (dwSize != sizeof(DDSURFACEDESC2))) + { return DDERR_GENERIC; } - + ZeroMemory(pDDSD,dwSize); if (dwSize == sizeof(DDSURFACEDESC)) { - LPDDSURFACEDESC lpDS = (LPDDSURFACEDESC) pDDSD; + LPDDSURFACEDESC lpDS = (LPDDSURFACEDESC) pDDSD; memcpy(&lpDS->ddckCKDestBlt, &This->lpLcl->ddckCKDestBlt, sizeof(DDCOLORKEY)); memcpy(&lpDS->ddckCKDestOverlay, &This->lpLcl->ddckCKDestOverlay, sizeof(DDCOLORKEY)); memcpy(&lpDS->ddckCKSrcBlt, &This->lpLcl->ddckCKSrcBlt, sizeof(DDCOLORKEY)); - memcpy(&lpDS->ddckCKSrcOverlay, &This->lpLcl->ddckCKSrcOverlay, sizeof(DDCOLORKEY)); + memcpy(&lpDS->ddckCKSrcOverlay, &This->lpLcl->ddckCKSrcOverlay, sizeof(DDCOLORKEY)); memcpy(&lpDS->ddpfPixelFormat, &This->lpLcl->lpGbl->ddpfSurface, sizeof(DDPIXELFORMAT)); memcpy(&lpDS->ddsCaps, &This->lpLcl->ddsCaps, sizeof(DDSCAPS)); - + lpDS->dwAlphaBitDepth = This->lpLcl->dwAlpha; lpDS->dwBackBufferCount = This->lpLcl->dwBackBufferCount; @@ -521,12 +521,12 @@ Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, lpDS->dwHeight = This->lpLcl->lpGbl->wHeight; lpDS->dwWidth = This->lpLcl->lpGbl->wWidth; - /* This two are a union in lpDS and in This->lpLcl->lpGbl - so I comment out lPitch + /* This two are a union in lpDS and in This->lpLcl->lpGbl + so I comment out lPitch lpDS->lPitch = This->lpLcl->lpGbl->lPitch; */ - lpDS->dwLinearSize = This->lpLcl->lpGbl->dwLinearSize; - + lpDS->dwLinearSize = This->lpLcl->lpGbl->dwLinearSize; + /* This tree are a union */ //lpDS->dwMipMapCount @@ -534,26 +534,26 @@ Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, //lpDS->dwZBufferBitDepth /* Unknown */ - // lpDS->dwReserved - // lpDS->lpSurface + // lpDS->dwReserved + // lpDS->lpSurface } else { memcpy(&pDDSD->ddckCKDestBlt, &This->lpLcl->ddckCKDestBlt, sizeof(DDCOLORKEY)); - + /* pDDSD->dwEmptyFaceColor is a union to ddckCKDestOverlay */ memcpy(&pDDSD->ddckCKDestOverlay, &This->lpLcl->ddckCKDestOverlay, sizeof(DDCOLORKEY)); memcpy(&pDDSD->ddckCKSrcBlt, &This->lpLcl->ddckCKSrcBlt, sizeof(DDCOLORKEY)); - memcpy(&pDDSD->ddckCKSrcOverlay, &This->lpLcl->ddckCKSrcOverlay, sizeof(DDCOLORKEY)); + memcpy(&pDDSD->ddckCKSrcOverlay, &This->lpLcl->ddckCKSrcOverlay, sizeof(DDCOLORKEY)); /* pDDSD->dwFVF is a union to ddpfPixelFormat */ memcpy(&pDDSD->ddpfPixelFormat, &This->lpLcl->lpGbl->ddpfSurface, sizeof(DDPIXELFORMAT)); memcpy(&pDDSD->ddsCaps, &This->lpLcl->ddsCaps, sizeof(DDSCAPS)); - + pDDSD->dwAlphaBitDepth = This->lpLcl->dwAlpha; pDDSD->dwBackBufferCount = This->lpLcl->dwBackBufferCount; @@ -564,82 +564,82 @@ Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, pDDSD->dwHeight = This->lpLcl->lpGbl->wHeight; pDDSD->dwWidth = This->lpLcl->lpGbl->wWidth; - /* This two are a union in lpDS and in This->lpLcl->lpGbl - so I comment out lPitch + /* This two are a union in lpDS and in This->lpLcl->lpGbl + so I comment out lPitch lpDS->lPitch = This->lpLcl->lpGbl->lPitch; */ - pDDSD->dwLinearSize = This->lpLcl->lpGbl->dwLinearSize; + pDDSD->dwLinearSize = This->lpLcl->lpGbl->dwLinearSize; /* This tree are a union */ // pDDSD->dwMipMapCount - // pDDSD->dwRefreshRate + // pDDSD->dwRefreshRate // pDDSD->dwSrcVBHandle - + /* Unknown */ - // lpDS->dwReserved - // lpDS->lpSurface - // pDDSD->dwTextureStage + // lpDS->dwReserved + // lpDS->lpSurface + // pDDSD->dwTextureStage } - + return DD_OK; } HRESULT WINAPI Main_DDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface, HDC hDC) -{ +{ LPDDRAWI_DDRAWSURFACE_INT This; DX_WINDBG_trace(); if (iface == NULL) { - return DDERR_INVALIDOBJECT; + return DDERR_INVALIDOBJECT; } if (hDC == NULL) { - return DDERR_INVALIDPARAMS; + return DDERR_INVALIDPARAMS; } - This = (LPDDRAWI_DDRAWSURFACE_INT)iface; - + This = (LPDDRAWI_DDRAWSURFACE_INT)iface; + /* FIXME check if surface exits or not */ - + if ((HDC)This->lpLcl->hDC == NULL) { - return DDERR_GENERIC; + return DDERR_GENERIC; } - + return DD_OK; } HRESULT WINAPI Main_DDrawSurface_SetColorKey (LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags, LPDDCOLORKEY pCKey) -{ +{ LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; - + DDHAL_SETCOLORKEYDATA ColorKeyData; DX_WINDBG_trace(); ColorKeyData.ddRVal = DDERR_COLORKEYNOTSET; - if (This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_SETCOLORKEY) + if (This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_SETCOLORKEY) { - + ColorKeyData.lpDD = This->lpLcl->lpGbl->lpDD; ColorKeyData.SetColorKey = This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.SetColorKey; - //ColorKeyData.lpDDSurface = &This->lpLcl->hDDSurface; - ColorKeyData.dwFlags = dwFlags; - /* FIXME - ColorKeyData.ckNew = ? + //ColorKeyData.lpDDSurface = &This->lpLcl->hDDSurface; + ColorKeyData.dwFlags = dwFlags; + /* FIXME + ColorKeyData.ckNew = ? add / move dwFlags to This->lpLcl->dwFlags ?? */ if (ColorKeyData.SetColorKey(&ColorKeyData) == DDHAL_DRIVER_HANDLED ) - { + { return ColorKeyData.ddRVal; } } @@ -652,19 +652,19 @@ HRESULT WINAPI Main_DDrawSurface_SetOverlayPosition (LPDIRECTDRAWSURFACE7 iface, LONG X, LONG Y) { LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; - + DDHAL_SETOVERLAYPOSITIONDATA OverLayPositionData; DX_WINDBG_trace(); OverLayPositionData.ddRVal = DDERR_COLORKEYNOTSET; - if (This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_SETOVERLAYPOSITION) + if (This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_SETOVERLAYPOSITION) { - + OverLayPositionData.lpDD = This->lpLcl->lpGbl->lpDD; OverLayPositionData.SetOverlayPosition = This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.SetOverlayPosition; - + //OverLayPositionData.lpDDSrcSurface = This->lpLcl->lpSurfaceOverlaying->lpLcl->hDDSurface; //OverLayPositionData.lpDDDestSurface = This->lpLcl->hDDSurface; @@ -672,12 +672,12 @@ Main_DDrawSurface_SetOverlayPosition (LPDIRECTDRAWSURFACE7 iface, LONG X, LONG Y OverLayPositionData.lYPos = Y; - /* FIXME + /* FIXME Should X and Y be save ?? */ if (OverLayPositionData.SetOverlayPosition(&OverLayPositionData) == DDHAL_DRIVER_HANDLED ) - { + { return OverLayPositionData.ddRVal; } } diff --git a/reactos/dll/directx/ddraw/Surface/surface_stubs.c b/reactos/dll/directx/ddraw/Surface/surface_stubs.c index a06e16437ba..6fdf1c90b70 100644 --- a/reactos/dll/directx/ddraw/Surface/surface_stubs.c +++ b/reactos/dll/directx/ddraw/Surface/surface_stubs.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/surface/surface_stubs.c - * PURPOSE: IDirectDrawSurface7 Implementation + * PURPOSE: IDirectDrawSurface7 Implementation * PROGRAMMER: Magnus Olsen, Maarten Bosma * */ @@ -77,7 +77,7 @@ Main_DDrawSurface_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE7 iface, { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI @@ -93,10 +93,10 @@ Main_DDrawSurface_EnumOverlayZOrders(LPDIRECTDRAWSURFACE7 iface, HRESULT WINAPI Main_DDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags) -{ +{ DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI @@ -112,7 +112,7 @@ Main_DDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags, { //LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; - DX_WINDBG_trace(); + DX_WINDBG_trace(); DX_STUB; } @@ -192,7 +192,7 @@ Main_DDrawSurface_IsLost(LPDIRECTDRAWSURFACE7 iface) //DX_STUB; DX_STUB_str("not implement return not lost\n"); - return DD_OK; + return DD_OK; } HRESULT WINAPI @@ -256,12 +256,12 @@ Main_DDrawSurface_UpdateOverlay (LPDIRECTDRAWSURFACE7 iface, HRESULT WINAPI Main_DDrawSurface_UpdateOverlayDisplay (LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags) -{ +{ LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface; DX_WINDBG_trace(); - if (!This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_UPDATEOVERLAY) + if (!This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_UPDATEOVERLAY) { return DDERR_GENERIC; } diff --git a/reactos/dll/directx/ddraw/Videoport/videoport_stubs.c b/reactos/dll/directx/ddraw/Videoport/videoport_stubs.c index 620ebf34579..be3aedbe8cd 100644 --- a/reactos/dll/directx/ddraw/Videoport/videoport_stubs.c +++ b/reactos/dll/directx/ddraw/Videoport/videoport_stubs.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS DirectX * FILE: ddraw/videoport/videoport_stubs.c - * PURPOSE: IDirectDrawVideoPort, DDVideoPortContainer and IDirectDrawVideoPortNotify Implementation + * PURPOSE: IDirectDrawVideoPort, DDVideoPortContainer and IDirectDrawVideoPortNotify Implementation * PROGRAMMER: Maarten Bosma * */ @@ -11,215 +11,215 @@ #include "rosdraw.h" -/************* IDirectDrawVideoPort *************/ +/************* IDirectDrawVideoPort *************/ -HRESULT WINAPI +HRESULT WINAPI Main_DirectDrawVideoPort_QueryInterface (LPDIRECTDRAWVIDEOPORT iface, REFIID riid, LPVOID* ppvObj) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -ULONG WINAPI -Main_DirectDrawVideoPort_AddRef (LPDIRECTDRAWVIDEOPORT iface) +ULONG WINAPI +Main_DirectDrawVideoPort_AddRef (LPDIRECTDRAWVIDEOPORT iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -ULONG WINAPI +ULONG WINAPI Main_DirectDrawVideoPort_Release (LPDIRECTDRAWVIDEOPORT iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI +HRESULT WINAPI Main_DirectDrawVideoPort_Flip (LPDIRECTDRAWVIDEOPORT iface, LPDIRECTDRAWSURFACE lpDDSurface, DWORD dwFlags) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI -Main_DirectDrawVideoPort_GetBandwidthInfo (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpddpfFormat, DWORD dwWidth, +HRESULT WINAPI +Main_DirectDrawVideoPort_GetBandwidthInfo (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpddpfFormat, DWORD dwWidth, DWORD dwHeight, DWORD dwFlags, LPDDVIDEOPORTBANDWIDTH lpBandwidth) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI +HRESULT WINAPI Main_DirectDrawVideoPort_GetColorControls (LPDIRECTDRAWVIDEOPORT iface, LPDDCOLORCONTROL lpColorControl) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI Main_DirectDrawVideoPort_GetInputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDWORD lpNumFormats, +HRESULT WINAPI Main_DirectDrawVideoPort_GetInputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDWORD lpNumFormats, LPDDPIXELFORMAT lpFormats, DWORD dwFlags) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI Main_DirectDrawVideoPort_GetOutputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpInputFormat, +HRESULT WINAPI Main_DirectDrawVideoPort_GetOutputFormats (LPDIRECTDRAWVIDEOPORT iface, LPDDPIXELFORMAT lpInputFormat, LPDWORD lpNumFormats, LPDDPIXELFORMAT lpFormats, DWORD dwFlags) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DirectDrawVideoPort_GetFieldPolarity (LPDIRECTDRAWVIDEOPORT iface, LPBOOL lpbFieldPolarity) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DirectDrawVideoPort_GetVideoLine (LPDIRECTDRAWVIDEOPORT This, LPDWORD lpdwLine) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DirectDrawVideoPort_GetVideoSignalStatus (LPDIRECTDRAWVIDEOPORT iface, LPDWORD lpdwStatus) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DirectDrawVideoPort_SetColorControls (LPDIRECTDRAWVIDEOPORT iface, LPDDCOLORCONTROL lpColorControl) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI Main_DirectDrawVideoPort_SetTargetSurface (LPDIRECTDRAWVIDEOPORT iface, LPDIRECTDRAWSURFACE lpDDSurface, +HRESULT WINAPI Main_DirectDrawVideoPort_SetTargetSurface (LPDIRECTDRAWVIDEOPORT iface, LPDIRECTDRAWSURFACE lpDDSurface, DWORD dwFlags) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DirectDrawVideoPort_StartVideo (LPDIRECTDRAWVIDEOPORT iface, LPDDVIDEOPORTINFO dwFlags) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DirectDrawVideoPort_StopVideo (LPDIRECTDRAWVIDEOPORT iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DirectDrawVideoPort_UpdateVideo (LPDIRECTDRAWVIDEOPORT iface, LPDDVIDEOPORTINFO dwFlags) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI Main_DirectDrawVideoPort_WaitForSync (LPDIRECTDRAWVIDEOPORT iface, DWORD dwFlags, DWORD dwLine, +HRESULT WINAPI Main_DirectDrawVideoPort_WaitForSync (LPDIRECTDRAWVIDEOPORT iface, DWORD dwFlags, DWORD dwLine, DWORD dwTimeout) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -/************* IDDVideoPortContainer *************/ +/************* IDDVideoPortContainer *************/ HRESULT WINAPI Main_DDVideoPortContainer_QueryInterface (LPDDVIDEOPORTCONTAINER iface, REFIID riid, LPVOID* ppvObj) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -ULONG WINAPI Main_DDVideoPortContainer_AddRef (LPDDVIDEOPORTCONTAINER iface) +ULONG WINAPI Main_DDVideoPortContainer_AddRef (LPDDVIDEOPORTCONTAINER iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } ULONG WINAPI Main_DDVideoPortContainer_Release (LPDDVIDEOPORTCONTAINER iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI Main_DDVideoPortContainer_CreateVideoPort (LPDDVIDEOPORTCONTAINER iface, DWORD dwFlags, LPDDVIDEOPORTDESC pPortDesc, +HRESULT WINAPI Main_DDVideoPortContainer_CreateVideoPort (LPDDVIDEOPORTCONTAINER iface, DWORD dwFlags, LPDDVIDEOPORTDESC pPortDesc, LPDIRECTDRAWVIDEOPORT* DDVideoPort, IUnknown* pUnkOuter) { DX_WINDBG_trace(); - DX_STUB; -} + DX_STUB; +} -HRESULT WINAPI -Main_DDVideoPortContainer_EnumVideoPorts (LPDDVIDEOPORTCONTAINER iface, - DWORD dwFlags, - LPDDVIDEOPORTCAPS pCaps, - LPVOID pContext, +HRESULT WINAPI +Main_DDVideoPortContainer_EnumVideoPorts (LPDDVIDEOPORTCONTAINER iface, + DWORD dwFlags, + LPDDVIDEOPORTCAPS pCaps, + LPVOID pContext, LPDDENUMVIDEOCALLBACK pEnumVideoCallback) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI -Main_DDVideoPortContainer_GetVideoPortConnectInfo (LPDDVIDEOPORTCONTAINER iface, - DWORD PortId, DWORD* pNumEntries, +HRESULT WINAPI +Main_DDVideoPortContainer_GetVideoPortConnectInfo (LPDDVIDEOPORTCONTAINER iface, + DWORD PortId, DWORD* pNumEntries, LPDDVIDEOPORTCONNECT pConnectInfo) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -HRESULT WINAPI -Main_DDVideoPortContainer_QueryVideoPortStatus (LPDDVIDEOPORTCONTAINER iface, - DWORD PortId, +HRESULT WINAPI +Main_DDVideoPortContainer_QueryVideoPortStatus (LPDDVIDEOPORTCONTAINER iface, + DWORD PortId, LPDDVIDEOPORTSTATUS pStatus) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -/************* IDirectDrawVideoPortNotify *************/ +/************* IDirectDrawVideoPortNotify *************/ -HRESULT WINAPI -Main_DDVideoPortNotify_QueryInterface (LPDIRECTDRAWVIDEOPORTNOTIFY iface, REFIID +HRESULT WINAPI +Main_DDVideoPortNotify_QueryInterface (LPDIRECTDRAWVIDEOPORTNOTIFY iface, REFIID riid, LPVOID* ppvObj) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -ULONG WINAPI +ULONG WINAPI Main_DDVideoPortNotify_AddRef (LPDIRECTDRAWVIDEOPORTNOTIFY iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } -ULONG WINAPI +ULONG WINAPI Main_DDVideoPortNotify_Release (LPDIRECTDRAWVIDEOPORTNOTIFY iface) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DDVideoPortNotify_AcquireNotification (LPDIRECTDRAWVIDEOPORTNOTIFY iface, HANDLE* h, LPDDVIDEOPORTNOTIFY pVideoPortNotify) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } HRESULT WINAPI Main_DDVideoPortNotify_ReleaseNotification (LPDIRECTDRAWVIDEOPORTNOTIFY iface, HANDLE h) { DX_WINDBG_trace(); - DX_STUB; + DX_STUB; } IDirectDrawVideoPortVtbl DirectDrawVideoPort_Vtable = @@ -227,19 +227,19 @@ IDirectDrawVideoPortVtbl DirectDrawVideoPort_Vtable = Main_DirectDrawVideoPort_QueryInterface, Main_DirectDrawVideoPort_AddRef, Main_DirectDrawVideoPort_Release, - Main_DirectDrawVideoPort_Flip, - Main_DirectDrawVideoPort_GetBandwidthInfo, - Main_DirectDrawVideoPort_GetColorControls, - Main_DirectDrawVideoPort_GetInputFormats, - Main_DirectDrawVideoPort_GetOutputFormats, - Main_DirectDrawVideoPort_GetFieldPolarity, + Main_DirectDrawVideoPort_Flip, + Main_DirectDrawVideoPort_GetBandwidthInfo, + Main_DirectDrawVideoPort_GetColorControls, + Main_DirectDrawVideoPort_GetInputFormats, + Main_DirectDrawVideoPort_GetOutputFormats, + Main_DirectDrawVideoPort_GetFieldPolarity, Main_DirectDrawVideoPort_GetVideoLine, - Main_DirectDrawVideoPort_GetVideoSignalStatus, - Main_DirectDrawVideoPort_SetColorControls, - Main_DirectDrawVideoPort_SetTargetSurface, - Main_DirectDrawVideoPort_StartVideo, - Main_DirectDrawVideoPort_StopVideo, - Main_DirectDrawVideoPort_UpdateVideo, + Main_DirectDrawVideoPort_GetVideoSignalStatus, + Main_DirectDrawVideoPort_SetColorControls, + Main_DirectDrawVideoPort_SetTargetSurface, + Main_DirectDrawVideoPort_StartVideo, + Main_DirectDrawVideoPort_StopVideo, + Main_DirectDrawVideoPort_UpdateVideo, Main_DirectDrawVideoPort_WaitForSync }; @@ -260,5 +260,5 @@ IDirectDrawVideoPortNotifyVtbl DDVideoPortNotify_Vtable = Main_DDVideoPortNotify_AddRef, Main_DDVideoPortNotify_Release, Main_DDVideoPortNotify_AcquireNotification, - Main_DDVideoPortNotify_ReleaseNotification + Main_DDVideoPortNotify_ReleaseNotification }; diff --git a/reactos/dll/directx/ddraw/Vtable/DirectDraw2_Vtable.c b/reactos/dll/directx/ddraw/Vtable/DirectDraw2_Vtable.c index 30dcc6a38c8..78dfcee1490 100644 --- a/reactos/dll/directx/ddraw/Vtable/DirectDraw2_Vtable.c +++ b/reactos/dll/directx/ddraw/Vtable/DirectDraw2_Vtable.c @@ -45,7 +45,7 @@ Main_DirectDraw_CreatePalette( LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN pUnkOuter); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_CreateSurface( LPDIRECTDRAW2 iface, LPDDSURFACEDESC pDDSD, @@ -58,7 +58,7 @@ Main_DirectDraw_DuplicateSurface( LPDIRECTDRAWSURFACE2 src, LPDIRECTDRAWSURFACE2* dst); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_EnumDisplayModes( LPDIRECTDRAW2 iface, DWORD dwFlags, diff --git a/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c b/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c index bfdb7a69780..faf416c133d 100644 --- a/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c +++ b/reactos/dll/directx/ddraw/Vtable/DirectDraw4_Vtable.c @@ -45,7 +45,7 @@ Main_DirectDraw_CreatePalette( LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN pUnkOuter); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_CreateSurface4( LPDIRECTDRAW4 iface, LPDDSURFACEDESC2 pDDSD, @@ -58,7 +58,7 @@ Main_DirectDraw_DuplicateSurface( LPDIRECTDRAWSURFACE4 src, LPDIRECTDRAWSURFACE4* dst); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_EnumDisplayModes( LPDIRECTDRAW4 iface, DWORD dwFlags, @@ -152,16 +152,16 @@ Main_DirectDraw_GetAvailableVidMem4( LPDWORD dwTotal, LPDWORD dwFree); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC( LPDIRECTDRAW4 iface, HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW4 iface); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW4 iface); HRESULT WINAPI diff --git a/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c b/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c index 4940f0da798..37633fdc462 100644 --- a/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c +++ b/reactos/dll/directx/ddraw/Vtable/DirectDraw7_Vtable.c @@ -49,7 +49,7 @@ Main_DirectDraw_CreatePalette( LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN pUnkOuter); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_CreateSurface4( LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD, @@ -62,7 +62,7 @@ Main_DirectDraw_DuplicateSurface( LPDIRECTDRAWSURFACE7 src, LPDIRECTDRAWSURFACE7* dst); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_EnumDisplayModes( LPDIRECTDRAW7 iface, DWORD dwFlags, @@ -156,16 +156,16 @@ Main_DirectDraw_GetAvailableVidMem4( LPDWORD dwTotal, LPDWORD dwFree); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC( LPDIRECTDRAW7 iface, HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW7 iface); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface); HRESULT WINAPI @@ -174,7 +174,7 @@ Main_DirectDraw_GetDeviceIdentifier7( LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_StartModeTest( LPDIRECTDRAW7 iface, LPSIZE pModes, diff --git a/reactos/dll/directx/ddraw/Vtable/DirectDraw_Vtable.c b/reactos/dll/directx/ddraw/Vtable/DirectDraw_Vtable.c index 43e14cdf859..110b0c568e6 100644 --- a/reactos/dll/directx/ddraw/Vtable/DirectDraw_Vtable.c +++ b/reactos/dll/directx/ddraw/Vtable/DirectDraw_Vtable.c @@ -45,7 +45,7 @@ Main_DirectDraw_CreatePalette( LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN pUnkOuter); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_CreateSurface( LPDIRECTDRAW iface, LPDDSURFACEDESC pDDSD, @@ -58,7 +58,7 @@ Main_DirectDraw_DuplicateSurface( LPDIRECTDRAWSURFACE src, LPDIRECTDRAWSURFACE *dst); -HRESULT WINAPI +HRESULT WINAPI Main_DirectDraw_EnumDisplayModes( LPDIRECTDRAW iface, DWORD dwFlags, diff --git a/reactos/dll/directx/ddraw/cleanup.c b/reactos/dll/directx/ddraw/cleanup.c index 0a7c839bdd0..5e55ff3dfae 100644 --- a/reactos/dll/directx/ddraw/cleanup.c +++ b/reactos/dll/directx/ddraw/cleanup.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: lib/ddraw/ddraw.c - * PURPOSE: DirectDraw Library + * PURPOSE: DirectDraw Library * PROGRAMMER: Magnus Olsen (greatlrd) * */ @@ -12,8 +12,8 @@ #include "rosdraw.h" #include "d3dhal.h" -VOID -Cleanup(LPDDRAWI_DIRECTDRAW_INT This) +VOID +Cleanup(LPDDRAWI_DIRECTDRAW_INT This) { DX_WINDBG_trace(); @@ -34,7 +34,7 @@ Cleanup(LPDDRAWI_DIRECTDRAW_INT This) DdDeleteDirectDrawObject(&ddgbl); - /* + /* are it any more I forget to release ? */ diff --git a/reactos/dll/directx/ddraw/main.c b/reactos/dll/directx/ddraw/main.c index c0bee0bb7fb..9d08ea07839 100644 --- a/reactos/dll/directx/ddraw/main.c +++ b/reactos/dll/directx/ddraw/main.c @@ -4,7 +4,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: lib/ddraw/ddraw.c - * PURPOSE: DirectDraw Library + * PURPOSE: DirectDraw Library * PROGRAMMER: Magnus Olsen (greatlrd) * */ @@ -40,7 +40,7 @@ CRITICAL_SECTION ddcs; * @remarks None. * *--*/ -HRESULT WINAPI DirectDrawCreateClipper (DWORD dwFlags, +HRESULT WINAPI DirectDrawCreateClipper (DWORD dwFlags, LPDIRECTDRAWCLIPPER* lplpDDClipper, LPUNKNOWN pUnkOuter) { DX_WINDBG_trace(); @@ -60,7 +60,7 @@ HRESULT WINAPI DirectDrawCreateClipper (DWORD dwFlags, * . * * @param pUnkOuter -* Alwas set to NULL other wise will DirectDrawCreate fail it return +* Alwas set to NULL other wise will DirectDrawCreate fail it return * errror code CLASS_E_NOAGGREGATION * * @return . @@ -69,15 +69,15 @@ HRESULT WINAPI DirectDrawCreateClipper (DWORD dwFlags, * *--*/ -HRESULT -WINAPI -DirectDrawCreate (LPGUID lpGUID, - LPDIRECTDRAW* lplpDD, - LPUNKNOWN pUnkOuter) -{ +HRESULT +WINAPI +DirectDrawCreate (LPGUID lpGUID, + LPDIRECTDRAW* lplpDD, + LPUNKNOWN pUnkOuter) +{ HRESULT retVal = DDERR_GENERIC; - /* - remove this when UML digram are in place + /* + remove this when UML digram are in place this api is finish and is working as it should */ @@ -87,7 +87,7 @@ DirectDrawCreate (LPGUID lpGUID, /* check see if pUnkOuter is null or not */ if (pUnkOuter) { - retVal = CLASS_E_NOAGGREGATION; + retVal = CLASS_E_NOAGGREGATION; } else { @@ -114,7 +114,7 @@ DirectDrawCreate (LPGUID lpGUID, * . * * @param pUnkOuter -* Alwas set to NULL other wise will DirectDrawCreateEx fail it return +* Alwas set to NULL other wise will DirectDrawCreateEx fail it return * errror code CLASS_E_NOAGGREGATION * * @return . @@ -122,16 +122,16 @@ DirectDrawCreate (LPGUID lpGUID, * @remarks None. * *--*/ -HRESULT -WINAPI +HRESULT +WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID* lplpDD, - REFIID id, + REFIID id, LPUNKNOWN pUnkOuter) { HRESULT retVal = DDERR_GENERIC; - /* - remove this when UML digram are in place + /* + remove this when UML digram are in place this api is finish and is working as it should */ DX_WINDBG_trace(); @@ -142,9 +142,9 @@ DirectDrawCreateEx(LPGUID lpGUID, if (pUnkOuter) { /* we are using same error code as MS*/ - retVal = CLASS_E_NOAGGREGATION; + retVal = CLASS_E_NOAGGREGATION; }/* Is it a DirectDraw 7 Request or not */ - else if (!IsEqualGUID(id, &IID_IDirectDraw7)) + else if (!IsEqualGUID(id, &IID_IDirectDraw7)) { retVal = DDERR_INVALIDPARAMS; } @@ -164,13 +164,13 @@ DirectDrawCreateEx(LPGUID lpGUID, } /* - * UNIMPLEMENT + * UNIMPLEMENT */ -HRESULT -WINAPI +HRESULT +WINAPI DirectDrawEnumerateA( - LPDDENUMCALLBACKA lpCallback, + LPDDENUMCALLBACKA lpCallback, LPVOID lpContext) { DX_STUB; @@ -178,36 +178,36 @@ DirectDrawEnumerateA( /* - * UNIMPLEMENT + * UNIMPLEMENT */ -HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW lpCallback, +HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW lpCallback, LPVOID lpContext) { DX_STUB; } /* - * UNIMPLEMENT + * UNIMPLEMENT */ -HRESULT -WINAPI -DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, - LPVOID lpContext, +HRESULT +WINAPI +DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, + LPVOID lpContext, DWORD dwFlags) { DX_STUB; } /* - * UNIMPLEMENT + * UNIMPLEMENT */ -HRESULT -WINAPI -DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, - LPVOID lpContext, +HRESULT +WINAPI +DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, + LPVOID lpContext, DWORD dwFlags) { DX_STUB; @@ -217,14 +217,14 @@ DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ Display_d/hh/Display_d/d3d_21ac30ea-9803-401e-b541-6b08af79653d.xml.asp - for more info about this command + for more info about this command - summuer the msdn + summuer the msdn The buffer start with D3DHAL_DP2COMMAND struct afer that it follow either one struct or no struct at at all example for command D3DDP2OP_VIEWPORTINFO - then lpCmd will look like this + then lpCmd will look like this ---------------------------------------- | struct | Pos | ---------------------------------------- @@ -233,12 +233,12 @@ DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, | D3DHAL_DP2VIEWPORTINFO | 0x04 - xxxx | --------------------------------------- - to calc end of the lpCmd buffer in this exmaple + to calc end of the lpCmd buffer in this exmaple D3DHAL_DP2COMMAND->wStateCount * sizeof(D3DHAL_DP2VIEWPORTINFO); - now you got number of bytes but we need add the size of D3DHAL_DP2COMMAND - to get this right. the end should be + now you got number of bytes but we need add the size of D3DHAL_DP2COMMAND + to get this right. the end should be sizeof(D3DHAL_DP2COMMAND) + ( D3DHAL_DP2COMMAND->wStateCount * sizeof(D3DHAL_DP2VIEWPORTINFO)); - to get the xxxx end positions. + to get the xxxx end positions. */ /*++ @@ -247,7 +247,7 @@ DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, * The D3DParseUnknownCommand routine . * * @param lpCmd -* Is a typcast to LPD3DHAL_DP2COMMAND struct +* Is a typcast to LPD3DHAL_DP2COMMAND struct * typedef struct _D3DHAL_DP2COMMAND * { * BYTE bCommand; @@ -258,13 +258,13 @@ DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, * WORD wStateCount; * }; * } D3DHAL_DP2COMMAND, *LPD3DHAL_DP2COMMAND; -* -* lpCmd->bCommand +* +* lpCmd->bCommand * only accpect D3DDP2OP_VIEWPORTINFO, and undocument command 0x0D * rest of the command will be return error code for. * Command 0x0D -* dp2command->bReserved +* dp2command->bReserved * is how big struect we got in wStateCount or how many wStateCount we got * do not known more about it, no info in msdn about it either. * @@ -276,24 +276,24 @@ DirectDrawEnumerateExW(LPDDENUMCALLBACKEXW lpCallback, * * @return . * -* @remarks - +* @remarks + * *--*/ -HRESULT WINAPI -D3DParseUnknownCommand( LPVOID lpCmd, +HRESULT WINAPI +D3DParseUnknownCommand( LPVOID lpCmd, LPVOID *lpRetCmd) { DWORD retCode = DD_OK; LPD3DHAL_DP2COMMAND dp2command = lpCmd; - + /* prevent it crash if null pointer are being sent */ if ( (lpCmd == NULL) || (lpRetCmd == NULL) ) { return E_FAIL; } - + *lpRetCmd = lpCmd; switch (dp2command->bCommand) @@ -311,43 +311,43 @@ D3DParseUnknownCommand( LPVOID lpCmd, *(PBYTE)lpRetCmd += ((dp2command->wStateCount * dp2command->bReserved) + sizeof(D3DHAL_DP2COMMAND)); break; - + /* set the error code */ default: - + if ( (dp2command->bCommand <= D3DDP2OP_INDEXEDTRIANGLELIST) || // dp2command->bCommand <= with 0 to 3 (dp2command->bCommand == D3DDP2OP_RENDERSTATE) || // dp2command->bCommand == with 8 (dp2command->bCommand >= D3DDP2OP_LINELIST) ) // dp2command->bCommand >= with 15 to 255 { /* set error code for command 0 to 3, 8 and 15 to 255 */ - retCode = E_FAIL; + retCode = E_FAIL; } else { /* set error code for 4 - 7, 9 - 12, 14 */ - retCode = D3DERR_COMMAND_UNPARSED; + retCode = D3DERR_COMMAND_UNPARSED; } - + } return retCode; } -VOID -WINAPI +VOID +WINAPI AcquireDDThreadLock() { EnterCriticalSection(&ddcs); } -VOID -WINAPI +VOID +WINAPI ReleaseDDThreadLock() { LeaveCriticalSection(&ddcs); } -BOOL APIENTRY +BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { BOOL retStatus; @@ -362,7 +362,7 @@ DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) //DisableThreadLibraryCalls( hModule ); //InitializeCriticalSection( &ddcs ); //EnterCriticalSection( &ddcs ); - //LeaveCriticalSection( &ddcs ); + //LeaveCriticalSection( &ddcs ); retStatus = FALSE; break; diff --git a/reactos/dll/directx/ddraw/rosdraw.h b/reactos/dll/directx/ddraw/rosdraw.h index e390bb27485..af0e58912d0 100644 --- a/reactos/dll/directx/ddraw/rosdraw.h +++ b/reactos/dll/directx/ddraw/rosdraw.h @@ -34,21 +34,21 @@ extern IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable; extern IDirectDrawKernelVtbl DirectDrawKernel_Vtable; extern IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable; -/* Start up direct hal or hel - * iface = a pointer to the com object - * pGUID = guid hardware acclations or software acclation this can be NULL - * reenable = FALSE if we whant create a new directdraw com +/* Start up direct hal or hel + * iface = a pointer to the com object + * pGUID = guid hardware acclations or software acclation this can be NULL + * reenable = FALSE if we whant create a new directdraw com * = TRUE if we really whant rebuild the whole com interface (not in use) */ -HRESULT WINAPI +HRESULT WINAPI StartDirectDraw( LPDIRECTDRAW iface, LPGUID pGUID, BOOL reenable); -/* iface = a pointer to the com object - * reenable = FALSE / TRUE rebuld dx hal interface, this is need if we doing a mode change +/* iface = a pointer to the com object + * reenable = FALSE / TRUE rebuld dx hal interface, this is need if we doing a mode change */ HRESULT WINAPI @@ -56,8 +56,8 @@ StartDirectDrawHal( LPDIRECTDRAW iface, BOOL reenable); -/* iface = a pointer to the com object - * reenable = FALSE / TRUE rebuld dx hel interface, this is need if we doing a mode change +/* iface = a pointer to the com object + * reenable = FALSE / TRUE rebuld dx hel interface, this is need if we doing a mode change */ HRESULT WINAPI @@ -74,10 +74,10 @@ Create_DirectDraw ( HRESULT WINAPI ReCreateDirectDraw(LPDIRECTDRAW iface); -HRESULT +HRESULT Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, - LPDDSURFACEDESC2 pDDSD, + LPDDSURFACEDESC2 pDDSD, LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter); diff --git a/reactos/dll/directx/ddraw/startup.c b/reactos/dll/directx/ddraw/startup.c index 89f900fd198..03693684d46 100644 --- a/reactos/dll/directx/ddraw/startup.c +++ b/reactos/dll/directx/ddraw/startup.c @@ -219,8 +219,8 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable) } } - /* Windows handler are by set of SetCooperLevel - * so do not set it + /* Windows handler are by set of SetCooperLevel + * so do not set it */ if (reenable == FALSE) @@ -516,7 +516,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable) if (mHALInfo.ddCaps.dwNumFourCCCodes > 0 ) { - + DxHeapMemAlloc(mpFourCC, sizeof(DWORD) * (mHALInfo.ddCaps.dwNumFourCCCodes + 2)); if (mpFourCC == NULL) @@ -577,7 +577,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable) } memcpy(&ddgbl.vmiData, &mHALInfo.vmiData,sizeof(VIDMEMINFO)); - + memcpy(&ddgbl.ddCaps, &mHALInfo.ddCaps,sizeof(DDCORECAPS)); @@ -593,7 +593,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable) /* FIXME D3D setup mD3dCallbacks and mD3dDriverData */ - + if (mHALInfo.dwFlags & DDHALINFO_GETDRIVERINFOSET) @@ -615,8 +615,8 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable) RtlZeroMemory(&DdGetDriverInfo, sizeof(DDHAL_GETDRIVERINFODATA)); DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA); DdGetDriverInfo.guidInfo = GUID_Miscellaneous2Callbacks; - - /* FIXME + + /* FIXME DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->HALDDMiscellaneous; DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUS2CALLBACKS); @@ -628,7 +628,7 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable) // FIXME Close DX fristcall and second call return DD_FALSE; } - DD_MISCELLANEOUS2CALLBACKS + DD_MISCELLANEOUS2CALLBACKS { DWORD dwSize; DWORD dwFlags; diff --git a/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c b/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c index 4e0faf0f4e2..f0547be34fd 100644 --- a/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c +++ b/reactos/dll/directx/ddraw/thunks/ddraw_thunk.c @@ -33,7 +33,7 @@ ULONG WINAPI ThunkDirectDraw_AddRef(LPDIRECTDRAW iface) { DX_WINDBG_trace(); - + return Main_DirectDraw_AddRef((LPDIRECTDRAW7) iface); } @@ -58,7 +58,7 @@ ThunkDirectDraw_Release(LPDIRECTDRAW iface) { DX_WINDBG_trace(); - return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface); + return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface); } ULONG WINAPI @@ -66,7 +66,7 @@ ThunkDirectDraw2_Release(LPDIRECTDRAW2 iface) { DX_WINDBG_trace(); - return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface); + return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface); } ULONG WINAPI @@ -74,7 +74,7 @@ ThunkDirectDraw4_Release(LPDIRECTDRAW4 iface) { DX_WINDBG_trace(); - return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface); + return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface); } HRESULT WINAPI @@ -103,10 +103,10 @@ ThunkDirectDraw4_Compact(LPDIRECTDRAW4 iface) HRESULT WINAPI ThunkDirectDraw_CreateClipper(LPDIRECTDRAW iface,DWORD dwFlags,LPDIRECTDRAWCLIPPER *ppClipper,IUnknown *pUnkOuter) -{ +{ DX_WINDBG_trace(); - return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter); + return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter); } HRESULT WINAPI @@ -114,7 +114,7 @@ ThunkDirectDraw2_CreateClipper(LPDIRECTDRAW2 iface,DWORD dwFlags,LPDIRECTDRAWCLI { DX_WINDBG_trace(); - return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter); + return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter); } HRESULT WINAPI @@ -122,7 +122,7 @@ ThunkDirectDraw4_CreateClipper(LPDIRECTDRAW4 iface,DWORD dwFlags,LPDIRECTDRAWCLI { DX_WINDBG_trace(); - return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter); + return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter); } HRESULT WINAPI @@ -148,7 +148,7 @@ ThunkDirectDraw2_CreatePalette(LPDIRECTDRAW2 iface, DWORD dwFlags, } HRESULT WINAPI -ThunkDirectDraw4_CreatePalette(LPDIRECTDRAW4 iface, DWORD dwFlags, LPPALETTEENTRY pEntries, +ThunkDirectDraw4_CreatePalette(LPDIRECTDRAW4 iface, DWORD dwFlags, LPPALETTEENTRY pEntries, LPDIRECTDRAWPALETTE *ppPalette, IUnknown *pUnkOuter) { DX_WINDBG_trace(); @@ -161,28 +161,28 @@ ThunkDirectDraw_CreateSurface(LPDIRECTDRAW iface, LPDDSURFACEDESC pDDSD, LPDIRECTDRAWSURFACE *ppSurf, IUnknown *pUnkOuter) { - HRESULT retValue = DDERR_GENERIC; + HRESULT retValue = DDERR_GENERIC; LPDDRAWI_DDRAWSURFACE_INT That; DX_WINDBG_trace(); - + if (pDDSD != NULL) { DDSURFACEDESC2 pDDSD2; ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, &pDDSD2, - (LPDIRECTDRAWSURFACE7 *) ppSurf, pUnkOuter); + retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, &pDDSD2, + (LPDIRECTDRAWSURFACE7 *) ppSurf, pUnkOuter); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, NULL, + retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, NULL, (LPDIRECTDRAWSURFACE7 *) ppSurf, pUnkOuter); } - + That = (LPDDRAWI_DDRAWSURFACE_INT) *ppSurf; That->lpVtbl = &DirectDrawSurface3_VTable; @@ -193,25 +193,25 @@ HRESULT WINAPI ThunkDirectDraw2_CreateSurface(LPDIRECTDRAW2 iface, LPDDSURFACEDESC pDDSD, LPDIRECTDRAWSURFACE *ppSurface, IUnknown *pUnkOuter) { - HRESULT retValue = DDERR_GENERIC; + HRESULT retValue = DDERR_GENERIC; LPDDRAWI_DDRAWSURFACE_INT That; DX_WINDBG_trace(); - + if (pDDSD != NULL) { DDSURFACEDESC2 pDDSD2; ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, &pDDSD2, - (LPDIRECTDRAWSURFACE7 *) ppSurface, pUnkOuter); + retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, &pDDSD2, + (LPDIRECTDRAWSURFACE7 *) ppSurface, pUnkOuter); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, NULL, + retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, NULL, (LPDIRECTDRAWSURFACE7 *) ppSurface, pUnkOuter); } @@ -225,19 +225,19 @@ HRESULT WINAPI ThunkDirectDraw4_CreateSurface(LPDIRECTDRAW4 iface, LPDDSURFACEDESC2 pDDSD2, LPDIRECTDRAWSURFACE4 *ppSurface, IUnknown *pUnkOuter) { - HRESULT retValue; + HRESULT retValue; LPDDRAWI_DDRAWSURFACE_INT That; DX_WINDBG_trace(); - - retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, pDDSD2, + + retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, pDDSD2, (LPDIRECTDRAWSURFACE7 *) ppSurface, pUnkOuter); That = (LPDDRAWI_DDRAWSURFACE_INT) *ppSurface; That->lpVtbl = &DirectDrawSurface3_VTable; - return retValue; + return retValue; } HRESULT WINAPI @@ -246,7 +246,7 @@ ThunkDirectDraw_DuplicateSurface(LPDIRECTDRAW iface, LPDIRECTDRAWSURFACE src, LP DX_WINDBG_trace(); return Main_DirectDraw_DuplicateSurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7) src, - (LPDIRECTDRAWSURFACE7*) dst); + (LPDIRECTDRAWSURFACE7*) dst); } HRESULT WINAPI @@ -255,7 +255,7 @@ ThunkDirectDraw2_DuplicateSurface(LPDIRECTDRAW2 iface, LPDIRECTDRAWSURFACE src, DX_WINDBG_trace(); return Main_DirectDraw_DuplicateSurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7) src, - (LPDIRECTDRAWSURFACE7*) dst); + (LPDIRECTDRAWSURFACE7*) dst); } HRESULT WINAPI @@ -264,7 +264,7 @@ ThunkDirectDraw4_DuplicateSurface(LPDIRECTDRAW4 iface, LPDIRECTDRAWSURFACE4 src, DX_WINDBG_trace(); return Main_DirectDraw_DuplicateSurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7) src, - (LPDIRECTDRAWSURFACE7*) dst); + (LPDIRECTDRAWSURFACE7*) dst); } HRESULT WINAPI @@ -282,15 +282,15 @@ ThunkDirectDraw_EnumDisplayModes(LPDIRECTDRAW iface, DWORD dwFlags, ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, - context, (LPDDENUMMODESCALLBACK2)cb); + retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, + context, (LPDDENUMMODESCALLBACK2)cb); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, NULL, - context, (LPDDENUMMODESCALLBACK2)cb); + retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, NULL, + context, (LPDDENUMMODESCALLBACK2)cb); } return retValue; @@ -311,15 +311,15 @@ ThunkDirectDraw2_EnumDisplayModes(LPDIRECTDRAW2 iface, DWORD dwFlags, ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, - context, (LPDDENUMMODESCALLBACK2)cb); + retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, + context, (LPDDENUMMODESCALLBACK2)cb); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, NULL, - context, (LPDDENUMMODESCALLBACK2)cb); + retValue = Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, NULL, + context, (LPDDENUMMODESCALLBACK2)cb); } return retValue; @@ -332,7 +332,7 @@ ThunkDirectDraw4_EnumDisplayModes(LPDIRECTDRAW4 iface, DWORD dwFlags, { DX_WINDBG_trace(); - return Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, pDDSD, context, cb); + return Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, pDDSD, context, cb); } @@ -354,15 +354,15 @@ ThunkDirectDraw_EnumSurfaces(LPDIRECTDRAW iface, DWORD dwFlags, ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, - context, (LPDDENUMSURFACESCALLBACK7)cb); + retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, + context, (LPDDENUMSURFACESCALLBACK7)cb); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, NULL, - context, (LPDDENUMSURFACESCALLBACK7)cb); + retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, NULL, + context, (LPDDENUMSURFACESCALLBACK7)cb); } return retValue; @@ -373,7 +373,7 @@ ThunkDirectDraw2_EnumSurfaces(LPDIRECTDRAW2 iface, DWORD dwFlags, LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMSURFACESCALLBACK cb) { - HRESULT retValue = DDERR_GENERIC; + HRESULT retValue = DDERR_GENERIC; DX_WINDBG_trace(); @@ -383,15 +383,15 @@ ThunkDirectDraw2_EnumSurfaces(LPDIRECTDRAW2 iface, DWORD dwFlags, ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, - context, (LPDDENUMSURFACESCALLBACK7)cb); + retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2, + context, (LPDDENUMSURFACESCALLBACK7)cb); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, NULL, - context, (LPDDENUMSURFACESCALLBACK7)cb); + retValue = Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, NULL, + context, (LPDDENUMSURFACESCALLBACK7)cb); } return retValue; @@ -404,7 +404,7 @@ ThunkDirectDraw4_EnumSurfaces(LPDIRECTDRAW4 iface, DWORD dwFlags, { DX_WINDBG_trace(); - return Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, pDDSD, context, (LPDDENUMSURFACESCALLBACK7)cb); + return Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, pDDSD, context, (LPDDENUMSURFACESCALLBACK7)cb); } @@ -414,7 +414,7 @@ ThunkDirectDraw_FlipToGDISurface(LPDIRECTDRAW iface) { DX_WINDBG_trace(); - return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface); + return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface); } HRESULT WINAPI @@ -422,7 +422,7 @@ ThunkDirectDraw2_FlipToGDISurface(LPDIRECTDRAW2 iface) { DX_WINDBG_trace(); - return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface); + return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface); } HRESULT WINAPI @@ -430,7 +430,7 @@ ThunkDirectDraw4_FlipToGDISurface(LPDIRECTDRAW4 iface) { DX_WINDBG_trace(); - return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface); + return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface); } HRESULT WINAPI @@ -438,7 +438,7 @@ ThunkDirectDraw_GetCaps(LPDIRECTDRAW iface, LPDDCAPS pDDC1, LPDDCAPS pDDC2) { DX_WINDBG_trace(); - return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2); + return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2); } HRESULT WINAPI @@ -446,7 +446,7 @@ ThunkDirectDraw2_GetCaps(LPDIRECTDRAW2 iface, LPDDCAPS pDDC1, LPDDCAPS pDDC2) { DX_WINDBG_trace(); - return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2); + return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2); } HRESULT WINAPI @@ -454,30 +454,30 @@ ThunkDirectDraw4_GetCaps(LPDIRECTDRAW4 iface, LPDDCAPS pDDC1, LPDDCAPS pDDC2) { DX_WINDBG_trace(); - return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2); + return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2); } HRESULT WINAPI ThunkDirectDraw_GetDisplayMode(LPDIRECTDRAW iface, LPDDSURFACEDESC pDDSD) { - + HRESULT retValue = DDERR_GENERIC; DX_WINDBG_trace(); - + if (pDDSD != NULL) { DDSURFACEDESC2 pDDSD2; ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, &pDDSD2); + retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, &pDDSD2); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, NULL); + retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, NULL); } return retValue; @@ -496,13 +496,13 @@ ThunkDirectDraw2_GetDisplayMode(LPDIRECTDRAW2 iface, LPDDSURFACEDESC pDDSD) ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2)); memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC)); pDDSD2.dwSize = sizeof(DDSURFACEDESC2); - retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, &pDDSD2); + retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, &pDDSD2); memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC)); pDDSD->dwSize = sizeof(DDSURFACEDESC); } else { - retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, NULL); + retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, NULL); } return retValue; @@ -513,7 +513,7 @@ ThunkDirectDraw4_GetDisplayMode(LPDIRECTDRAW4 iface, LPDDSURFACEDESC2 pDDSD2) { DX_WINDBG_trace(); - return Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, pDDSD2); + return Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, pDDSD2); } HRESULT WINAPI @@ -643,39 +643,39 @@ HRESULT WINAPI ThunkDirectDraw_Initialize(LPDIRECTDRAW iface, LPGUID pGUID) { DX_WINDBG_trace(); - - if (iface==NULL) + + if (iface==NULL) { return DDERR_NOTINITIALIZED; } - - return DDERR_ALREADYINITIALIZED; + + return DDERR_ALREADYINITIALIZED; } HRESULT WINAPI ThunkDirectDraw2_Initialize(LPDIRECTDRAW2 iface, LPGUID pGUID) { DX_WINDBG_trace(); - - if (iface==NULL) + + if (iface==NULL) { return DDERR_NOTINITIALIZED; } - - return DDERR_ALREADYINITIALIZED; + + return DDERR_ALREADYINITIALIZED; } HRESULT WINAPI ThunkDirectDraw4_Initialize(LPDIRECTDRAW4 iface, LPGUID pGUID) { DX_WINDBG_trace(); - - if (iface==NULL) + + if (iface==NULL) { return DDERR_NOTINITIALIZED; } - - return DDERR_ALREADYINITIALIZED; + + return DDERR_ALREADYINITIALIZED; } @@ -810,17 +810,17 @@ ThunkDirectDraw4_GetDeviceIdentifier(LPDIRECTDRAW4 iface, LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags) { HRESULT retValue = DDERR_GENERIC; - + DX_WINDBG_trace(); if (pDDDI != NULL) { - - DDDEVICEIDENTIFIER2 pDDDI2; + + DDDEVICEIDENTIFIER2 pDDDI2; ZeroMemory(&pDDDI2,sizeof(DDDEVICEIDENTIFIER2)); - memcpy(&pDDDI2, pDDDI, sizeof(DDDEVICEIDENTIFIER)); + memcpy(&pDDDI2, pDDDI, sizeof(DDDEVICEIDENTIFIER)); retValue = Main_DirectDraw_GetDeviceIdentifier((LPDIRECTDRAW7) iface, &pDDDI2, dwFlags); - memcpy(pDDDI, &pDDDI2, sizeof(DDDEVICEIDENTIFIER)); + memcpy(pDDDI, &pDDDI2, sizeof(DDDEVICEIDENTIFIER)); } else { diff --git a/reactos/dll/directx/ddraw/thunks/surface_thunk.c b/reactos/dll/directx/ddraw/thunks/surface_thunk.c index ed8d36da8e6..d2c740af898 100644 --- a/reactos/dll/directx/ddraw/thunks/surface_thunk.c +++ b/reactos/dll/directx/ddraw/thunks/surface_thunk.c @@ -10,7 +10,7 @@ Thunk_DDrawSurface3_QueryInterface(LPDIRECTDRAWSURFACE3 iface, REFIID iid, { DX_WINDBG_trace(); - return Main_DDrawSurface_QueryInterface((LPDIRECTDRAWSURFACE7) iface, iid, ppObj); + return Main_DDrawSurface_QueryInterface((LPDIRECTDRAWSURFACE7) iface, iid, ppObj); } ULONG WINAPI @@ -18,7 +18,7 @@ Thunk_DDrawSurface3_AddRef(LPDIRECTDRAWSURFACE3 iface) { DX_WINDBG_trace(); - return Main_DDrawSurface_AddRef((LPDIRECTDRAWSURFACE7) iface); + return Main_DDrawSurface_AddRef((LPDIRECTDRAWSURFACE7) iface); } ULONG WINAPI @@ -26,7 +26,7 @@ Thunk_DDrawSurface3_Release(LPDIRECTDRAWSURFACE3 iface) { DX_WINDBG_trace(); - return Main_DDrawSurface_Release((LPDIRECTDRAWSURFACE7) iface); + return Main_DDrawSurface_Release((LPDIRECTDRAWSURFACE7) iface); } HRESULT WINAPI @@ -60,16 +60,16 @@ Thunk_DDrawSurface3_BltBatch(LPDIRECTDRAWSURFACE3 iface, LPDDBLTBATCH pBatch, DW { DX_WINDBG_trace(); - return Main_DDrawSurface_BltBatch((LPDIRECTDRAWSURFACE7) iface, pBatch, dwCount, dwFlags); + return Main_DDrawSurface_BltBatch((LPDIRECTDRAWSURFACE7) iface, pBatch, dwCount, dwFlags); } HRESULT WINAPI -Thunk_DDrawSurface3_BltFast(LPDIRECTDRAWSURFACE3 iface, DWORD dstx, DWORD dsty, +Thunk_DDrawSurface3_BltFast(LPDIRECTDRAWSURFACE3 iface, DWORD dstx, DWORD dsty, LPDIRECTDRAWSURFACE3 src, LPRECT rsrc, DWORD dwTrans) { DX_WINDBG_trace(); - return Main_DDrawSurface_BltFast((LPDIRECTDRAWSURFACE7) iface, dstx, dsty, + return Main_DDrawSurface_BltFast((LPDIRECTDRAWSURFACE7) iface, dstx, dsty, (LPDIRECTDRAWSURFACE7)src, rsrc, dwTrans); } @@ -78,7 +78,7 @@ Thunk_DDrawSurface3_DeleteAttachedSurface(LPDIRECTDRAWSURFACE3 iface, DWORD dwFl { DX_WINDBG_trace(); - return Main_DDrawSurface_DeleteAttachedSurface((LPDIRECTDRAWSURFACE7) iface, dwFlags, + return Main_DDrawSurface_DeleteAttachedSurface((LPDIRECTDRAWSURFACE7) iface, dwFlags, (LPDIRECTDRAWSURFACE7) pAttached); } @@ -88,10 +88,10 @@ HRESULT WINAPI Thunk_DDrawSurface3_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE3 iface, LPVOID context, LPDDENUMSURFACESCALLBACK cb) -{ +{ DX_WINDBG_trace(); - return Main_DDrawSurface_EnumAttachedSurfaces((LPDIRECTDRAWSURFACE7) iface, + return Main_DDrawSurface_EnumAttachedSurfaces((LPDIRECTDRAWSURFACE7) iface, context, (LPDDENUMSURFACESCALLBACK7)cb); } @@ -102,7 +102,7 @@ Thunk_DDrawSurface3_EnumOverlayZOrders(LPDIRECTDRAWSURFACE3 iface, { DX_WINDBG_trace(); - return Main_DDrawSurface_EnumOverlayZOrders( (LPDIRECTDRAWSURFACE7) iface, dwFlags, context, + return Main_DDrawSurface_EnumOverlayZOrders( (LPDIRECTDRAWSURFACE7) iface, dwFlags, context, (LPDDENUMSURFACESCALLBACK7) cb); } @@ -113,7 +113,7 @@ Thunk_DDrawSurface3_Flip(LPDIRECTDRAWSURFACE3 iface, DX_WINDBG_trace(); return Main_DDrawSurface_Flip( (LPDIRECTDRAWSURFACE7)iface, (LPDIRECTDRAWSURFACE7) lpDDSurfaceTargetOverride, - dwFlags); + dwFlags); } HRESULT WINAPI @@ -121,7 +121,7 @@ Thunk_DDrawSurface3_GetAttachedSurface(LPDIRECTDRAWSURFACE3 iface, LPDDSCAPS pCaps, LPDIRECTDRAWSURFACE3* ppAttached) { - DDSCAPS2 caps; + DDSCAPS2 caps; HRESULT hr = DDERR_GENERIC; DX_WINDBG_trace(); @@ -131,14 +131,14 @@ Thunk_DDrawSurface3_GetAttachedSurface(LPDIRECTDRAWSURFACE3 iface, if (pCaps != NULL) { caps.dwCaps = pCaps->dwCaps; - - hr = Main_DDrawSurface_GetAttachedSurface( (LPDIRECTDRAWSURFACE7) iface, + + hr = Main_DDrawSurface_GetAttachedSurface( (LPDIRECTDRAWSURFACE7) iface, &caps, (LPDIRECTDRAWSURFACE7 *) ppAttached); pCaps->dwCaps = caps.dwCaps; } else { - hr = Main_DDrawSurface_GetAttachedSurface( (LPDIRECTDRAWSURFACE7) iface, + hr = Main_DDrawSurface_GetAttachedSurface( (LPDIRECTDRAWSURFACE7) iface, NULL, (LPDIRECTDRAWSURFACE7 *) ppAttached); } @@ -150,7 +150,7 @@ Thunk_DDrawSurface3_GetBltStatus(LPDIRECTDRAWSURFACE3 iface, DWORD dwFlags) { DX_WINDBG_trace(); - return Main_DDrawSurface_GetBltStatus((LPDIRECTDRAWSURFACE7) iface, dwFlags); + return Main_DDrawSurface_GetBltStatus((LPDIRECTDRAWSURFACE7) iface, dwFlags); } HRESULT WINAPI @@ -162,10 +162,10 @@ Thunk_DDrawSurface3_GetCaps(LPDIRECTDRAWSURFACE3 iface, LPDDSCAPS pCaps) DX_WINDBG_trace(); ZeroMemory(&caps,sizeof(DDSCAPS2)); - + if (pCaps != NULL) { - hr = Main_DDrawSurface_GetCaps((LPDIRECTDRAWSURFACE7) iface, &caps); + hr = Main_DDrawSurface_GetCaps((LPDIRECTDRAWSURFACE7) iface, &caps); pCaps->dwCaps = caps.dwCaps; } else @@ -182,7 +182,7 @@ Thunk_DDrawSurface3_GetClipper(LPDIRECTDRAWSURFACE3 iface, { DX_WINDBG_trace(); - return Main_DDrawSurface_GetClipper((LPDIRECTDRAWSURFACE7) iface, ppClipper); + return Main_DDrawSurface_GetClipper((LPDIRECTDRAWSURFACE7) iface, ppClipper); } HRESULT WINAPI @@ -191,7 +191,7 @@ Thunk_DDrawSurface3_GetColorKey(LPDIRECTDRAWSURFACE3 iface, DWORD dwFlags, { DX_WINDBG_trace(); - return Main_DDrawSurface_GetColorKey( (LPDIRECTDRAWSURFACE7) iface, dwFlags, pCKey); + return Main_DDrawSurface_GetColorKey( (LPDIRECTDRAWSURFACE7) iface, dwFlags, pCKey); } HRESULT WINAPI @@ -224,7 +224,7 @@ Thunk_DDrawSurface3_GetPalette(LPDIRECTDRAWSURFACE3 iface, { DX_WINDBG_trace(); - return Main_DDrawSurface_GetPalette((LPDIRECTDRAWSURFACE7) iface, ppPalette); + return Main_DDrawSurface_GetPalette((LPDIRECTDRAWSURFACE7) iface, ppPalette); } HRESULT WINAPI @@ -242,7 +242,7 @@ Thunk_DDrawSurface3_GetSurfaceDesc(LPDIRECTDRAWSURFACE3 iface, { HRESULT retValue = DDERR_GENERIC; - DX_WINDBG_trace(); + DX_WINDBG_trace(); if (pDDSD != NULL) { @@ -304,7 +304,7 @@ HRESULT WINAPI Thunk_DDrawSurface3_Lock(LPDIRECTDRAWSURFACE3 iface, LPRECT pRect, LPDDSURFACEDESC pDDSD, DWORD dwFlags, HANDLE events) { - + HRESULT retValue = DDERR_GENERIC; DDSURFACEDESC2 pDDSD2; @@ -336,7 +336,7 @@ Thunk_DDrawSurface3_ReleaseDC(LPDIRECTDRAWSURFACE3 iface, HDC hDC) { DX_WINDBG_trace(); - return Main_DDrawSurface_ReleaseDC((LPDIRECTDRAWSURFACE7) iface, hDC); + return Main_DDrawSurface_ReleaseDC((LPDIRECTDRAWSURFACE7) iface, hDC); } HRESULT WINAPI @@ -344,7 +344,7 @@ Thunk_DDrawSurface3_Restore(LPDIRECTDRAWSURFACE3 iface) { DX_WINDBG_trace(); - return Main_DDrawSurface_Restore((LPDIRECTDRAWSURFACE7) iface); + return Main_DDrawSurface_Restore((LPDIRECTDRAWSURFACE7) iface); } HRESULT WINAPI @@ -378,7 +378,7 @@ Thunk_DDrawSurface3_SetPalette(LPDIRECTDRAWSURFACE3 iface, { DX_WINDBG_trace(); - return Main_DDrawSurface_SetPalette ((LPDIRECTDRAWSURFACE7) iface, pPalette); + return Main_DDrawSurface_SetPalette ((LPDIRECTDRAWSURFACE7) iface, pPalette); } /* @@ -386,8 +386,8 @@ HRESULT WINAPI Thunk_DDrawSurface3_Unlock(LPDIRECTDRAWSURFACE3 iface, LPRECT pRect) { DX_WINDBG_trace(); - - return Main_DDrawSurface_Unlock ((LPDIRECTDRAWSURFACE7) iface, pRect); + + return Main_DDrawSurface_Unlock ((LPDIRECTDRAWSURFACE7) iface, pRect); } */ HRESULT WINAPI @@ -401,10 +401,10 @@ HRESULT WINAPI Thunk_DDrawSurface3_UpdateOverlay(LPDIRECTDRAWSURFACE3 iface, LPRECT pSrcRect, LPDIRECTDRAWSURFACE3 pDstSurface, LPRECT pDstRect, DWORD dwFlags, LPDDOVERLAYFX pFX) { - + DX_WINDBG_trace(); - return Main_DDrawSurface_UpdateOverlay ( (LPDIRECTDRAWSURFACE7) iface, pSrcRect, + return Main_DDrawSurface_UpdateOverlay ( (LPDIRECTDRAWSURFACE7) iface, pSrcRect, (LPDIRECTDRAWSURFACE7) pDstSurface, pDstRect, dwFlags, pFX); } @@ -431,7 +431,7 @@ Thunk_DDrawSurface3_GetDDInterface(LPDIRECTDRAWSURFACE3 iface, LPVOID* ppDD) { DX_WINDBG_trace(); - return Main_DDrawSurface_GetDDInterface((LPDIRECTDRAWSURFACE7) iface, ppDD); + return Main_DDrawSurface_GetDDInterface((LPDIRECTDRAWSURFACE7) iface, ppDD); } HRESULT WINAPI @@ -456,7 +456,7 @@ Thunk_DDrawSurface3_SetSurfaceDesc(LPDIRECTDRAWSURFACE3 iface, { HRESULT retValue = DDERR_GENERIC; - DX_WINDBG_trace(); + DX_WINDBG_trace(); if (pDDSD != NULL) { @@ -469,10 +469,10 @@ Thunk_DDrawSurface3_SetSurfaceDesc(LPDIRECTDRAWSURFACE3 iface, pDDSD->dwSize = sizeof(DDSURFACEDESC); } else - { + { retValue = Main_DDrawSurface_SetSurfaceDesc((LPDIRECTDRAWSURFACE7) iface, NULL, dwFlags); } - + return retValue; } diff --git a/reactos/dll/directx/devenum/devenum_main.c b/reactos/dll/directx/devenum/devenum_main.c index d4880258d9d..ffdb9f20e34 100644 --- a/reactos/dll/directx/devenum/devenum_main.c +++ b/reactos/dll/directx/devenum/devenum_main.c @@ -139,7 +139,7 @@ HRESULT WINAPI DEVENUM_DllRegisterServer(void) /*** ActiveMovieFilter Categories ***/ CoInitialize(NULL); - + res = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC, &IID_IFilterMapper2, &mapvptr); if (SUCCEEDED(res)) diff --git a/reactos/dll/directx/dinput/device.c b/reactos/dll/directx/dinput/device.c index 8cca6f5ca3a..a1e40316adc 100644 --- a/reactos/dll/directx/dinput/device.c +++ b/reactos/dll/directx/dinput/device.c @@ -77,7 +77,7 @@ void _dump_EnumObjects_flags(DWORD dwFlags) { FE(DIDFT_TGLBUTTON), FE(DIDFT_POV), FE(DIDFT_COLLECTION), - FE(DIDFT_NODATA), + FE(DIDFT_NODATA), FE(DIDFT_FFACTUATOR), FE(DIDFT_FFEFFECTTRIGGER), FE(DIDFT_OUTPUT), @@ -202,7 +202,7 @@ void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) { TRACE(")\n"); TRACE(" - dwDataSize: %ld\n", df->dwDataSize); TRACE(" - dwNumObjs: %ld\n", df->dwNumObjs); - + for (i = 0; i < df->dwNumObjs; i++) { TRACE(" - Object %d:\n", i); TRACE(" * GUID: %s ('%s')\n", debugstr_guid(df->rgodf[i].pguid), _dump_dinput_GUID(df->rgodf[i].pguid)); @@ -218,7 +218,7 @@ void fill_DataFormat(void *out, const void *in, DataFormat *df) { int i; char *in_c = (char *) in; char *out_c = (char *) out; - + if (df->dt == NULL) { /* This means that the app uses Wine's internal data format */ memcpy(out, in, df->internal_format_size); @@ -231,19 +231,19 @@ void fill_DataFormat(void *out, const 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); break; @@ -255,19 +255,19 @@ void fill_DataFormat(void *out, const 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); break; @@ -292,23 +292,23 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a int *done; int index = 0; DWORD next = 0; - + ret = HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat)); - + done = HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs); memset(done, 0, sizeof(int) * asked_format->dwNumObjs); - + dt = 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 (/* Check if the application either requests any GUID and if not, it if matches * the GUID of the Wine object. */ @@ -325,9 +325,9 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a && ( /* Then if the asked type matches the one Wine provides */ wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType)) { - + done[j] = 1; - + TRACE("Matching :\n"); TRACE(" - Asked (%d) :\n", j); TRACE(" * GUID: %s ('%s')\n", @@ -336,7 +336,7 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a TRACE(" * Offset: %3ld\n", asked_format->rgodf[j].dwOfs); TRACE(" * dwType: %08lx\n", asked_format->rgodf[j].dwType); TRACE(" "); _dump_EnumObjects_flags(asked_format->rgodf[j].dwType); TRACE("\n"); - + TRACE(" - Wine (%d) :\n", i); TRACE(" * GUID: %s ('%s')\n", debugstr_guid(wine_format->rgodf[i].pguid), @@ -344,7 +344,7 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a TRACE(" * Offset: %3ld\n", wine_format->rgodf[i].dwOfs); TRACE(" * dwType: %08lx\n", wine_format->rgodf[i].dwType); TRACE(" "); _dump_EnumObjects_flags(wine_format->rgodf[i].dwType); TRACE("\n"); - + if (wine_format->rgodf[i].dwType & DIDFT_BUTTON) dt[index].size = sizeof(BYTE); else @@ -360,19 +360,19 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a } dt[index].value = 0; next = next + dt[index].size; - + if (wine_format->rgodf[i].dwOfs != dt[index].offset_out) same = 0; - + index++; break; } } - + if (j == asked_format->dwNumObjs) same = 0; } - + TRACE("Setting to default value :\n"); for (j = 0; j < asked_format->dwNumObjs; j++) { if (done[j] == 0) { @@ -383,7 +383,7 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a TRACE(" * Offset: %3ld\n", asked_format->rgodf[j].dwOfs); TRACE(" * dwType: %08lx\n", asked_format->rgodf[j].dwType); TRACE(" "); _dump_EnumObjects_flags(asked_format->rgodf[j].dwType); TRACE("\n"); - + if (asked_format->rgodf[j].dwType & DIDFT_BUTTON) dt[index].size = sizeof(BYTE); else @@ -392,11 +392,11 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a dt[index].offset_out = asked_format->rgodf[j].dwOfs; dt[index].value = 0; index++; - + same = 0; } } - + ret->internal_format_size = wine_format->dwDataSize; ret->size = index; if (same) { @@ -405,9 +405,9 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a } else { ret->dt = dt; } - + HeapFree(GetProcessHeap(), 0, done); - + return ret; } @@ -416,16 +416,16 @@ BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA lpddi, LPVOID lpvRef) device_enumobjects_AtoWcb_data* data; data = (device_enumobjects_AtoWcb_data*) lpvRef; - + memset(&ddtmp, 0, sizeof(ddtmp)); - + ddtmp.dwSize = sizeof(DIDEVICEINSTANCEW); ddtmp.guidType = lpddi->guidType; ddtmp.dwOfs = lpddi->dwOfs; ddtmp.dwType = lpddi->dwType; ddtmp.dwFlags = lpddi->dwFlags; MultiByteToWideChar(CP_ACP, 0, lpddi->tszName, -1, ddtmp.tszName, MAX_PATH); - + if (lpddi->dwSize == sizeof(DIDEVICEINSTANCEA)) { /** * if dwSize < sizeof(DIDEVICEINSTANCEA of DInput version >= 5) @@ -452,11 +452,11 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat( LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - + TRACE("(this=%p,%p)\n",This,df); - + _dump_DIDATAFORMAT(df); - + return DI_OK; } @@ -495,7 +495,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface( ) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - + TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); if (IsEqualGUID(&IID_IUnknown,riid)) { IDirectInputDevice2_AddRef(iface); @@ -531,7 +531,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface( ) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - + TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); if (IsEqualGUID(&IID_IUnknown,riid)) { IDirectInputDevice2_AddRef(iface); @@ -581,7 +581,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects( _dump_EnumObjects_flags(dwFlags); DPRINTF("\n"); } - + return DI_OK; } @@ -597,7 +597,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects( _dump_EnumObjects_flags(dwFlags); DPRINTF("\n"); } - + return DI_OK; } @@ -608,10 +608,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; } @@ -623,7 +623,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo( { FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n", iface, pdidoi, dwObj, dwHow); - + return DI_OK; } @@ -635,7 +635,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo( { FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n", iface, pdidoi, dwObj, dwHow); - + return DI_OK; } @@ -645,7 +645,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo( { FIXME("(this=%p,%p): stub!\n", iface, pdidi); - + return DI_OK; } @@ -655,7 +655,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo( { FIXME("(this=%p,%p): stub!\n", iface, pdidi); - + return DI_OK; } @@ -705,7 +705,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects( { FIXME("(this=%p,%p,%p,0x%08lx): stub!\n", iface, lpCallback, lpvRef, dwFlags); - + return DI_OK; } @@ -717,7 +717,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects( { FIXME("(this=%p,%p,%p,0x%08lx): stub!\n", iface, lpCallback, lpvRef, dwFlags); - + return DI_OK; } @@ -795,7 +795,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData( { FIXME("(this=%p,0x%08lx,%p,%p,0x%08lx): stub!\n", iface, cbObjectData, rgdod, pdwInOut, dwFlags); - + return DI_OK; } @@ -806,7 +806,7 @@ HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A DWORD dwFlags) { FIXME("(%p)->(%s,%p,%p,%08lx): stub !\n", iface, lpszFileName, pec, pvRef, dwFlags); - + return DI_OK; } @@ -817,7 +817,7 @@ HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W DWORD dwFlags) { FIXME("(%p)->(%s,%p,%p,%08lx): stub !\n", iface, debugstr_w(lpszFileName), pec, pvRef, dwFlags); - + return DI_OK; } @@ -828,7 +828,7 @@ HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A DWORD dwFlags) { FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, lpszFileName, dwEntries, rgDiFileEft, dwFlags); - + return DI_OK; } @@ -839,7 +839,7 @@ HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W DWORD dwFlags) { FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, debugstr_w(lpszFileName), dwEntries, rgDiFileEft, dwFlags); - + return DI_OK; } @@ -849,7 +849,7 @@ HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A ifa DWORD dwFlags) { FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, lpszUserName, dwFlags); - + return DI_OK; } @@ -859,7 +859,7 @@ HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W ifa DWORD dwFlags) { FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags); - + return DI_OK; } @@ -869,7 +869,7 @@ HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface DWORD dwFlags) { FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, lpszUserName, dwFlags); - + return DI_OK; } @@ -879,7 +879,7 @@ HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface DWORD dwFlags) { FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags); - + return DI_OK; } @@ -887,7 +887,7 @@ HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader) { FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader); - + return DI_OK; } @@ -895,6 +895,6 @@ HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader) { FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader); - + return DI_OK; } diff --git a/reactos/dll/directx/dinput/device_private.h b/reactos/dll/directx/dinput/device_private.h index 4f2347bcb6f..4567c85409e 100644 --- a/reactos/dll/directx/dinput/device_private.h +++ b/reactos/dll/directx/dinput/device_private.h @@ -76,7 +76,7 @@ extern void release_DataFormat(DataFormat *df) ; } /** - * Callback Data used by specific callback + * Callback Data used by specific callback * for EnumObject on 'W' interfaces */ typedef struct { @@ -127,7 +127,7 @@ extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo( LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) ; -extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, +extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow); diff --git a/reactos/dll/directx/dinput/dinput_main.c b/reactos/dll/directx/dinput/dinput_main.c index 93b0005028c..bdb3d2f462f 100644 --- a/reactos/dll/directx/dinput/dinput_main.c +++ b/reactos/dll/directx/dinput/dinput_main.c @@ -82,7 +82,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserv) */ HRESULT WINAPI DirectInputCreateEx( HINSTANCE hinst, DWORD dwVersion, REFIID riid, LPVOID *ppDI, - LPUNKNOWN punkOuter) + LPUNKNOWN punkOuter) { IDirectInputImpl* This; @@ -94,7 +94,7 @@ HRESULT WINAPI DirectInputCreateEx( This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi7avt; This->ref = 1; - This->dwVersion = dwVersion; + This->dwVersion = dwVersion; *ppDI = This; return DI_OK; @@ -106,7 +106,7 @@ HRESULT WINAPI DirectInputCreateEx( This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi7wvt; This->ref = 1; - This->dwVersion = dwVersion; + This->dwVersion = dwVersion; *ppDI = This; return DI_OK; @@ -116,7 +116,7 @@ HRESULT WINAPI DirectInputCreateEx( This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi8avt; This->ref = 1; - This->dwVersion = dwVersion; + This->dwVersion = dwVersion; *ppDI = This; return DI_OK; @@ -126,7 +126,7 @@ HRESULT WINAPI DirectInputCreateEx( This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi8wvt; This->ref = 1; - This->dwVersion = dwVersion; + This->dwVersion = dwVersion; *ppDI = This; return DI_OK; @@ -145,7 +145,7 @@ HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPU This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi7avt; This->ref = 1; - This->dwVersion = dwVersion; + This->dwVersion = dwVersion; *ppDI = (IDirectInputA*)This; return 0; @@ -161,7 +161,7 @@ HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPU This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl)); This->lpVtbl = &ddi7wvt; This->ref = 1; - This->dwVersion = dwVersion; + This->dwVersion = dwVersion; *ppDI = (IDirectInputW*)This; return 0; } @@ -212,7 +212,7 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices( IDirectInputImpl *This = (IDirectInputImpl *)iface; DIDEVICEINSTANCEA devInstance; int i, j, r; - + TRACE("(this=%p,0x%04lx '%s',%p,%p,%04lx)\n", This, dwDevType, _dump_DIDEVTYPE_value(dwDevType), lpCallback, pvRef, dwFlags); @@ -229,7 +229,7 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices( } } } - + return 0; } /****************************************************************************** @@ -237,12 +237,12 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices( */ static HRESULT WINAPI IDirectInputWImpl_EnumDevices( LPDIRECTINPUT7W iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, - LPVOID pvRef, DWORD dwFlags) + LPVOID pvRef, DWORD dwFlags) { IDirectInputImpl *This = (IDirectInputImpl *)iface; DIDEVICEINSTANCEW devInstance; int i, j, r; - + TRACE("(this=%p,0x%04lx '%s',%p,%p,%04lx)\n", This, dwDevType, _dump_DIDEVTYPE_value(dwDevType), lpCallback, pvRef, dwFlags); @@ -259,7 +259,7 @@ static HRESULT WINAPI IDirectInputWImpl_EnumDevices( } } } - + return 0; } @@ -345,7 +345,7 @@ static HRESULT WINAPI IDirectInputAImpl_CreateDevice( return ret_value; } -static HRESULT WINAPI IDirectInputWImpl_CreateDevice(LPDIRECTINPUT7A iface, +static HRESULT WINAPI IDirectInputWImpl_CreateDevice(LPDIRECTINPUT7A iface, REFGUID rguid, LPDIRECTINPUTDEVICEW* pdev, LPUNKNOWN punk) { IDirectInputImpl *This = (IDirectInputImpl *)iface; HRESULT ret_value = DIERR_DEVICENOTREG; @@ -656,7 +656,7 @@ static HRESULT WINAPI DICF_CreateInstance( return DirectInputCreateEx(0,0,riid,ppobj,pOuter); } - FIXME("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); + FIXME("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); return E_NOINTERFACE; } diff --git a/reactos/dll/directx/dinput/effect_linuxinput.c b/reactos/dll/directx/dinput/effect_linuxinput.c index 0a30d9bceea..77531965f55 100644 --- a/reactos/dll/directx/dinput/effect_linuxinput.c +++ b/reactos/dll/directx/dinput/effect_linuxinput.c @@ -91,7 +91,7 @@ static DWORD _typeFromGUID(REFGUID guid) /****************************************************************************** - * DirectInputEffect debug helpers + * DirectInputEffect debug helpers */ static void _dump_DIEFFECT_flags(DWORD dwFlags) @@ -114,7 +114,7 @@ static void _dump_DIEFFECT_flags(DWORD dwFlags) if (flags[i].mask & dwFlags) DPRINTF("%s ", flags[i].name); DPRINTF("\n"); - } + } } static void _dump_DIENVELOPE(LPDIENVELOPE env) @@ -125,7 +125,7 @@ static void _dump_DIENVELOPE(LPDIENVELOPE env) } TRACE("Envelope has attack (level: %ld time: %ld), fade (level: %ld time: %ld)\n", env->dwAttackLevel, env->dwAttackTime, env->dwFadeLevel, env->dwFadeTime); -} +} static void _dump_DICONSTANTFORCE(LPDICONSTANTFORCE frc) { @@ -164,7 +164,7 @@ static void _dump_DICUSTOMFORCE(LPDICUSTOMFORCE frc) DPRINTF("%ld ", frc->rglForceData[i]); if (i % frc->cChannels == 0) DPRINTF("\n"); - } + } } } @@ -181,17 +181,17 @@ static void _dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid) } TRACE(" - dwFlags: %ld\n", eff->dwFlags); TRACE(" "); - _dump_DIEFFECT_flags(eff->dwFlags); + _dump_DIEFFECT_flags(eff->dwFlags); TRACE(" - dwDuration: %ld\n", eff->dwDuration); TRACE(" - dwGain: %ld\n", eff->dwGain); if ((eff->dwGain > 10000) || (eff->dwGain < 0)) - WARN("dwGain is out of range (0 - 10,000)\n"); + WARN("dwGain is out of range (0 - 10,000)\n"); TRACE(" - dwTriggerButton: %ld\n", eff->dwTriggerButton); TRACE(" - dwTriggerRepeatInterval: %ld\n", eff->dwTriggerRepeatInterval); TRACE(" - cAxes: %ld\n", eff->cAxes); TRACE(" - rgdwAxes: %p\n", eff->rgdwAxes); if (TRACE_ON(dinput)) { - TRACE(" "); + TRACE(" "); for (i = 0; i < eff->cAxes; ++i) DPRINTF("%ld ", eff->rgdwAxes[i]); DPRINTF("\n"); @@ -206,11 +206,11 @@ static void _dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid) _dump_DIENVELOPE(eff->lpEnvelope); if (type == DIEFT_CONSTANTFORCE) { if (eff->cbTypeSpecificParams != sizeof(DICONSTANTFORCE)) { - WARN("Effect claims to be a constant force but the type-specific params are the wrong size!\n"); + WARN("Effect claims to be a constant force but the type-specific params are the wrong size!\n"); } else { _dump_DICONSTANTFORCE(eff->lpvTypeSpecificParams); } - } else if (type == DIEFT_PERIODIC) { + } else if (type == DIEFT_PERIODIC) { if (eff->cbTypeSpecificParams != sizeof(DIPERIODIC)) { WARN("Effect claims to be a periodic force but the type-specific params are the wrong size!\n"); } else { @@ -222,7 +222,7 @@ static void _dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid) } else { _dump_DIRAMPFORCE(eff->lpvTypeSpecificParams); } - } else if (type == DIEFT_CONDITION) { + } else if (type == DIEFT_CONDITION) { if (eff->cbTypeSpecificParams != sizeof(DICONDITION)) { WARN("Effect claims to be a condition but the type-specific params are the wrong size!\n"); } else { @@ -239,7 +239,7 @@ static void _dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid) /****************************************************************************** - * LinuxInputEffectImpl + * LinuxInputEffectImpl */ static ULONG WINAPI LinuxInputEffectImpl_AddRef( @@ -272,7 +272,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_Escape( LPDIRECTINPUTEFFECT iface, LPDIEFFESCAPE pesc) { - WARN("(this=%p,%p): invalid: no hardware-specific escape codes in this" + WARN("(this=%p,%p): invalid: no hardware-specific escape codes in this" " driver!\n", iface, pesc); return DI_OK; @@ -287,7 +287,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetEffectGuid( TRACE("(this=%p,%p)\n", This, pguid); pguid = &This->guid; - + return DI_OK; } @@ -326,7 +326,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( if (dwFlags & DIEP_AXES) { if (peff->cAxes < 2 /* linuxinput effects always use 2 axes, x and y */) diErr = DIERR_MOREDATA; - peff->cAxes = 2; + peff->cAxes = 2; if (diErr) return diErr; else { @@ -334,11 +334,11 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( peff->rgdwAxes[1] = DIJOFS_Y; } } - + if (dwFlags & DIEP_DIRECTION) { if (peff->cAxes < 2) diErr = DIERR_MOREDATA; - peff->cAxes = 2; + peff->cAxes = 2; if (diErr) return diErr; else { @@ -373,7 +373,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( peff->lpEnvelope = NULL; } else if (peff->lpEnvelope == NULL) { return DIERR_INVALIDPARAM; - } else { + } else { peff->lpEnvelope->dwAttackLevel = (env->attack_level / 33) * 10; peff->lpEnvelope->dwAttackTime = env->attack_length * 1000; peff->lpEnvelope->dwFadeLevel = (env->fade_level / 33) * 10; @@ -412,9 +412,9 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( expectedsize = sizeof(DIPERIODIC); } else if (This->effect.type == FF_CONSTANT) { expectedsize = sizeof(DICONSTANTFORCE); - } else if (This->effect.type == FF_SPRING - || This->effect.type == FF_FRICTION - || This->effect.type == FF_INERTIA + } else if (This->effect.type == FF_SPRING + || This->effect.type == FF_FRICTION + || This->effect.type == FF_INERTIA || This->effect.type == FF_DAMPER) { expectedsize = sizeof(DICONDITION) * 2; } else if (This->effect.type == FF_RAMP) { @@ -435,16 +435,16 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( } else if (This->effect.type == FF_CONSTANT) { LPDICONSTANTFORCE tsp = (LPDICONSTANTFORCE)(peff->lpvTypeSpecificParams); tsp->lMagnitude = (This->effect.u.constant.level / 33) * 10; - } else if (This->effect.type == FF_SPRING - || This->effect.type == FF_FRICTION - || This->effect.type == FF_INERTIA + } else if (This->effect.type == FF_SPRING + || This->effect.type == FF_FRICTION + || This->effect.type == FF_INERTIA || This->effect.type == FF_DAMPER) { LPDICONDITION tsp = (LPDICONDITION)(peff->lpvTypeSpecificParams); int i; for (i = 0; i < 2; ++i) { - tsp[i].lOffset = (This->effect.u.condition[i].center / 33) * 10; + tsp[i].lOffset = (This->effect.u.condition[i].center / 33) * 10; tsp[i].lPositiveCoefficient = (This->effect.u.condition[i].right_coeff / 33) * 10; - tsp[i].lNegativeCoefficient = (This->effect.u.condition[i].left_coeff / 33) * 10; + tsp[i].lNegativeCoefficient = (This->effect.u.condition[i].left_coeff / 33) * 10; tsp[i].dwPositiveSaturation = (This->effect.u.condition[i].right_saturation / 33) * 10; tsp[i].dwNegativeSaturation = (This->effect.u.condition[i].left_saturation / 33) * 10; tsp[i].lDeadBand = (This->effect.u.condition[i].deadband / 33) * 10; @@ -455,7 +455,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( tsp->lEnd = (This->effect.u.ramp.end_level / 33) * 10; } } - } + } return diErr; } @@ -530,8 +530,8 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( LPDIRECTINPUTEFFECT iface, LPCDIEFFECT peff, DWORD dwFlags) -{ - LinuxInputEffectImpl* This = (LinuxInputEffectImpl*)iface; +{ + LinuxInputEffectImpl* This = (LinuxInputEffectImpl*)iface; DWORD type = _typeFromGUID(&This->guid); HRESULT retval = DI_OK; @@ -556,7 +556,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( /* some of this may look funky, but it's 'cause the linux driver and directx have * different opinions about which way direction "0" is. directx has 0 along the x - * axis (left), linux has it along the y axis (down). */ + * axis (left), linux has it along the y axis (down). */ if (dwFlags & DIEP_DIRECTION) { if (peff->cAxes == 1) { if (peff->dwFlags & DIEFF_CARTESIAN) { @@ -601,7 +601,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( if (This->effect.type == FF_CONSTANT) env = &This->effect.u.constant.envelope; else if (This->effect.type == FF_PERIODIC) env = &This->effect.u.periodic.envelope; else if (This->effect.type == FF_RAMP) env = &This->effect.u.ramp.envelope; - else env = NULL; + else env = NULL; if (peff->lpEnvelope == NULL) { /* if this type had an envelope, reset it @@ -682,7 +682,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( for (i = 0; i < 2; ++i) { This->effect.u.condition[i].center = (int)(factor[i] * (tsp->lOffset / 10) * 32); This->effect.u.condition[i].right_coeff = (int)(factor[i] * (tsp->lPositiveCoefficient / 10) * 32); - This->effect.u.condition[i].left_coeff = (int)(factor[i] * (tsp->lNegativeCoefficient / 10) * 32); + This->effect.u.condition[i].left_coeff = (int)(factor[i] * (tsp->lNegativeCoefficient / 10) * 32); This->effect.u.condition[i].right_saturation = (int)(factor[i] * (tsp->dwPositiveSaturation / 10) * 32); This->effect.u.condition[i].left_saturation = (int)(factor[i] * (tsp->dwNegativeSaturation / 10) * 32); This->effect.u.condition[i].deadband = (int)(factor[i] * (tsp->lDeadBand / 10) * 32); @@ -702,7 +702,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( return DIERR_INVALIDPARAM; } } else { - FIXME("Custom force types are not supported\n"); + FIXME("Custom force types are not supported\n"); return DIERR_INVALIDPARAM; } } @@ -719,9 +719,9 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( retval = LinuxInputEffectImpl_Start(iface, 1, 0); if (retval != DI_OK) return retval; - + return DI_OK; -} +} static ULONG WINAPI LinuxInputEffectImpl_Release( LPDIRECTINPUTEFFECT iface) @@ -776,18 +776,18 @@ HRESULT linuxinput_create_effect( REFGUID rguid, LPDIRECTINPUTEFFECT* peff) { - LinuxInputEffectImpl* newEffect = HeapAlloc(GetProcessHeap(), + LinuxInputEffectImpl* newEffect = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LinuxInputEffectImpl)); DWORD type = _typeFromGUID(rguid); - + newEffect->lpVtbl = &LinuxInputEffectVtbl; newEffect->ref = 1; memcpy(&(newEffect->guid), rguid, sizeof(*rguid)); newEffect->fd = fd; - + /* set the type. this cannot be changed over the effect's life. */ switch (type) { - case DIEFT_PERIODIC: + case DIEFT_PERIODIC: newEffect->effect.type = FF_PERIODIC; if (IsEqualGUID(rguid, &GUID_Sine)) { newEffect->effect.u.periodic.waveform = FF_SINE; @@ -801,13 +801,13 @@ HRESULT linuxinput_create_effect( newEffect->effect.u.periodic.waveform = FF_SAW_DOWN; } break; - case DIEFT_CONSTANTFORCE: + case DIEFT_CONSTANTFORCE: newEffect->effect.type = FF_CONSTANT; break; - case DIEFT_RAMPFORCE: + case DIEFT_RAMPFORCE: newEffect->effect.type = FF_RAMP; break; - case DIEFT_CONDITION: + case DIEFT_CONDITION: if (IsEqualGUID(rguid, &GUID_Spring)) { newEffect->effect.type = FF_SPRING; } else if (IsEqualGUID(rguid, &GUID_Friction)) { @@ -831,9 +831,9 @@ HRESULT linuxinput_create_effect( /* mark as non-uploaded */ newEffect->effect.id = -1; - *peff = (LPDIRECTINPUTEFFECT)newEffect; + *peff = (LPDIRECTINPUTEFFECT)newEffect; - TRACE("Creating linux input system effect (%p) with guid %s\n", + TRACE("Creating linux input system effect (%p) with guid %s\n", *peff, _dump_dinput_GUID(rguid)); return DI_OK; @@ -853,15 +853,15 @@ HRESULT linuxinput_get_info_A( if (info->dwSize != sizeof(DIEFFECTINFOA)) return DIERR_INVALIDPARAM; info->guid = *rguid; - - info->dwEffType = type; + + info->dwEffType = type; /* the event device API does not support querying for all these things * therefore we assume that we have support for them * that's not as dangerous as it sounds, since drivers are allowed to * ignore parameters they claim to support anyway */ - info->dwEffType |= DIEFT_DEADBAND | DIEFT_FFATTACK | DIEFT_FFFADE + info->dwEffType |= DIEFT_DEADBAND | DIEFT_FFATTACK | DIEFT_FFFADE | DIEFT_POSNEGCOEFFICIENTS | DIEFT_POSNEGSATURATION - | DIEFT_SATURATION | DIEFT_STARTDELAY; + | DIEFT_SATURATION | DIEFT_STARTDELAY; /* again, assume we have support for everything */ info->dwStaticParams = DIEP_ALLPARAMS; @@ -895,14 +895,14 @@ HRESULT linuxinput_get_info_W( * ignore parameters they claim to support anyway */ info->dwEffType |= DIEFT_DEADBAND | DIEFT_FFATTACK | DIEFT_FFFADE | DIEFT_POSNEGCOEFFICIENTS | DIEFT_POSNEGSATURATION - | DIEFT_SATURATION | DIEFT_STARTDELAY; + | DIEFT_SATURATION | DIEFT_STARTDELAY; /* again, assume we have support for everything */ info->dwStaticParams = DIEP_ALLPARAMS; info->dwDynamicParams = info->dwStaticParams; /* yes, this is windows behavior (print the GUID_Name for name) */ - MultiByteToWideChar(CP_ACP, 0, _dump_dinput_GUID(rguid), -1, + MultiByteToWideChar(CP_ACP, 0, _dump_dinput_GUID(rguid), -1, (WCHAR*)&(info->tszName), MAX_PATH); return DI_OK; diff --git a/reactos/dll/directx/dinput/joystick_linuxinput.c b/reactos/dll/directx/dinput/joystick_linuxinput.c index b1c555835cb..9b494b8ee99 100644 --- a/reactos/dll/directx/dinput/joystick_linuxinput.c +++ b/reactos/dll/directx/dinput/joystick_linuxinput.c @@ -133,7 +133,7 @@ struct JoystickImpl BYTE evbits[(EV_MAX+7)/8]; BYTE absbits[(ABS_MAX+7)/8]; BYTE keybits[(KEY_MAX+7)/8]; - BYTE ffbits[(FF_MAX+7)/8]; + BYTE ffbits[(FF_MAX+7)/8]; }; /* This GUID is slightly different from the linux joystick one. Take note. */ @@ -161,7 +161,7 @@ static int joydev_have(BOOL require_ff) sprintf(buf,EVDEVPREFIX"%d",i); - if (require_ff) + if (require_ff) flags = O_RDWR; else flags = O_RDONLY; @@ -183,10 +183,10 @@ static int joydev_have(BOOL require_ff) if ((-1==ioctl(fd,EVIOCGBIT(0,sizeof(evbits)),evbits))) { perror("EVIOCGBIT 0"); close(fd); - continue; + continue; } if ( (!test_bit(evbits,EV_FF)) - || (-1==ioctl(fd,EVIOCGBIT(EV_FF,sizeof(ffbits)),ffbits)) + || (-1==ioctl(fd,EVIOCGBIT(EV_FF,sizeof(ffbits)),ffbits)) || (-1==ioctl(fd,EVIOCGEFFECTS,&num_effects)) || (num_effects <= 0)) { close(fd); @@ -310,7 +310,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm for (i=0;iwantmin[i] = -32768; newDevice->wantmax[i] = 32767; - /* TODO: + /* TODO: * direct input defines a default for the deadzone somewhere; but as long * as in map_axis the code for the dead zone is commented out its no * problem @@ -467,9 +467,9 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) return 0; for (i=0;i<64;i++) { sprintf(buf,EVDEVPREFIX"%d",i); - if (-1==(This->joyfd=open(buf,O_RDWR))) { + if (-1==(This->joyfd=open(buf,O_RDWR))) { if (-1==(This->joyfd=open(buf,O_RDONLY))) { - /* Couldn't open the device at all */ + /* Couldn't open the device at all */ if (errno==ENODEV) return DIERR_NOTFOUND; perror(buf); @@ -507,7 +507,7 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) #ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION if (!readonly && test_bit(This->evbits, EV_FF)) { if (-1!=ioctl(This->joyfd,EVIOCGBIT(EV_FF,sizeof(This->ffbits)),This->ffbits)) { - if (-1!=ioctl(This->joyfd,EVIOCGEFFECTS,&This->num_effects) + if (-1!=ioctl(This->joyfd,EVIOCGEFFECTS,&This->num_effects) && This->num_effects > 0) { This->has_ff = TRUE; TRACE("Joystick seems to be capable of force feedback.\n"); @@ -561,7 +561,7 @@ static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) This->joyfd = -1; return DI_OK; } - else + else return DI_NOEFFECT; } @@ -600,7 +600,7 @@ map_axis(JoystickImpl* This, int axis, int val) { return ret; } -/* +/* * set the current state of the js device as it would be with the middle * values on the axes */ @@ -1025,7 +1025,7 @@ static HRESULT WINAPI JoystickAImpl_GetCapabilities( buttons=0; for (i=0;ikeybits,i)) buttons++; - if (This->has_ff) + if (This->has_ff) lpDIDevCaps->dwFlags |= DIDC_FORCEFEEDBACK; lpDIDevCaps->dwAxes = axes; @@ -1295,7 +1295,7 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, return DI_OK; } -/****************************************************************************** +/****************************************************************************** * CreateEffect - Create a new FF effect with the specified params */ static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface, @@ -1315,7 +1315,7 @@ static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface, #ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION TRACE("not available (compiled w/o ff support)\n"); *ppdef = NULL; - return DI_OK; + return DI_OK; #else new = malloc(sizeof(EffectListItem)); @@ -1325,7 +1325,7 @@ static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface, retval = linuxinput_create_effect(&(This->joyfd), rguid, &(new->ref)); if (retval != DI_OK) return retval; - + if (lpeff != NULL) retval = IDirectInputEffect_SetParameters(new->ref, lpeff, 0); if (retval != DI_OK && retval != DI_DOWNLOADSKIPPED) @@ -1339,7 +1339,7 @@ static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface, return DI_OK; #endif /* HAVE_STRUCT_FF_EFFECT_DIRECTION */ -} +} /******************************************************************************* * EnumEffects - Enumerate available FF effects @@ -1357,7 +1357,7 @@ static HRESULT WINAPI JoystickAImpl_EnumEffects(LPDIRECTINPUTDEVICE8A iface, TRACE("(this=%p,%p,%ld) type=%ld fd=%d\n", This, pvRef, dwEffType, type, xfd); - dei.dwSize = sizeof(DIEFFECTINFOA); + dei.dwSize = sizeof(DIEFFECTINFOA); /* We need to return something even if we're not yet acquired */ if (xfd == -1) @@ -1391,7 +1391,7 @@ static HRESULT WINAPI JoystickAImpl_EnumEffects(LPDIRECTINPUTDEVICE8A iface, IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_SawtoothDown); (*lpCallback)(&dei, pvRef); } - } + } if ((type == DIEFT_ALL || type == DIEFT_RAMPFORCE) && test_bit(This->ffbits, FF_RAMP)) { @@ -1441,7 +1441,7 @@ static HRESULT WINAPI JoystickWImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface, TRACE("(this=%p,%p,%ld) type=%ld fd=%d\n", This, pvRef, dwEffType, type, xfd); - dei.dwSize = sizeof(DIEFFECTINFOW); + dei.dwSize = sizeof(DIEFFECTINFOW); /* We need to return something even if we're not yet acquired */ if (xfd == -1) @@ -1475,7 +1475,7 @@ static HRESULT WINAPI JoystickWImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface, IDirectInputDevice8_GetEffectInfo(iface, &dei, &GUID_SawtoothDown); (*lpCallback)(&dei, pvRef); } - } + } if ((type == DIEFT_ALL || type == DIEFT_RAMPFORCE) && test_bit(This->ffbits, FF_RAMP)) { @@ -1511,7 +1511,7 @@ static HRESULT WINAPI JoystickWImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface, } /******************************************************************************* - * GetEffectInfo - Get information about a particular effect + * GetEffectInfo - Get information about a particular effect */ static HRESULT WINAPI JoystickAImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8A iface, LPDIEFFECTINFOA pdei, @@ -1522,7 +1522,7 @@ static HRESULT WINAPI JoystickAImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8A iface, TRACE("(this=%p,%p,%s)\n", This, pdei, _dump_dinput_GUID(guid)); #ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION - return linuxinput_get_info_A(This->joyfd, guid, pdei); + return linuxinput_get_info_A(This->joyfd, guid, pdei); #else return DI_OK; #endif @@ -1533,9 +1533,9 @@ static HRESULT WINAPI JoystickWImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8W iface, REFGUID guid) { JoystickImpl* This = (JoystickImpl*)iface; - + TRACE("(this=%p,%p,%s)\n", This, pdei, _dump_dinput_GUID(guid)); - + #ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION return linuxinput_get_info_W(This->joyfd, guid, pdei); #else @@ -1544,7 +1544,7 @@ static HRESULT WINAPI JoystickWImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8W iface, } /******************************************************************************* - * GetForceFeedbackState - Get information about the device's FF state + * GetForceFeedbackState - Get information about the device's FF state */ static HRESULT WINAPI JoystickAImpl_GetForceFeedbackState( LPDIRECTINPUTDEVICE8A iface, @@ -1587,16 +1587,16 @@ static HRESULT WINAPI JoystickAImpl_SendForceFeedbackCommand( /* Stop, unload, release and free all effects */ /* This returns the device to its "bare" state */ while (This->top_effect) { - EffectListItem* temp = This->top_effect; + EffectListItem* temp = This->top_effect; IDirectInputEffect_Stop(temp->ref); IDirectInputEffect_Unload(temp->ref); IDirectInputEffect_Release(temp->ref); - This->top_effect = temp->next; + This->top_effect = temp->next; free(temp); } } else if (dwFlags == DISFFC_PAUSE || dwFlags == DISFFC_CONTINUE) { FIXME("No support for Pause or Continue in linux\n"); - } else if (dwFlags == DISFFC_SETACTUATORSOFF + } else if (dwFlags == DISFFC_SETACTUATORSOFF || dwFlags == DISFFC_SETACTUATORSON) { FIXME("No direct actuator control in linux\n"); } else { diff --git a/reactos/dll/directx/dinput/keyboard.c b/reactos/dll/directx/dinput/keyboard.c index aa6cbcbe387..f8bc71aaaa5 100644 --- a/reactos/dll/directx/dinput/keyboard.c +++ b/reactos/dll/directx/dinput/keyboard.c @@ -68,7 +68,7 @@ struct SysKeyboardImpl CRITICAL_SECTION crit; }; -static SysKeyboardImpl* current_lock = NULL; +static SysKeyboardImpl* current_lock = NULL; /* Today's acquired device * FIXME: currently this can be only one. * Maybe this should be a linked list or st. @@ -102,7 +102,7 @@ LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam ) /** returns now if not HC_ACTION */ if (code != HC_ACTION) return CallNextHookEx(keyboard_hook, code, wparam, lparam); - + { dik_code = hook->scanCode; if (hook->flags & LLKHF_EXTENDED) dik_code |= 0x80; @@ -116,31 +116,31 @@ LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam ) DInputKeyState[dik_code] = new_diks; TRACE(" setting %02X to %02X\n", dik_code, DInputKeyState[dik_code]); - + if (current_lock != NULL) { if (current_lock->hEvent) SetEvent(current_lock->hEvent); - + if (current_lock->buffer != NULL) { int n; - + EnterCriticalSection(&(current_lock->crit)); - + n = (current_lock->start + current_lock->count) % current_lock->buffersize; - + current_lock->buffer[n].dwOfs = dik_code; current_lock->buffer[n].dwData = down ? 0x80 : 0; current_lock->buffer[n].dwTimeStamp = timestamp; current_lock->buffer[n].dwSequence = current_lock->dinput->evsequence++; - + TRACE("Adding event at offset %d : %ld - %ld - %ld - %ld\n", n, current_lock->buffer[n].dwOfs, current_lock->buffer[n].dwData, current_lock->buffer[n].dwTimeStamp, current_lock->buffer[n].dwSequence); - + if (current_lock->count == current_lock->buffersize) { current_lock->start = ++current_lock->start % current_lock->buffersize; current_lock->overflow = TRUE; } else current_lock->count++; - + LeaveCriticalSection(&(current_lock->crit)); } } @@ -157,11 +157,11 @@ static GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a9644 static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version) { DWORD dwSize; DIDEVICEINSTANCEA ddi; - + dwSize = lpddi->dwSize; TRACE("%ld %p\n", dwSize, lpddi); - + memset(lpddi, 0, dwSize); memset(&ddi, 0, sizeof(ddi)); @@ -181,14 +181,14 @@ static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version) { DWORD dwSize; DIDEVICEINSTANCEW ddi; - + dwSize = lpddi->dwSize; TRACE("%ld %p\n", dwSize, lpddi); - + memset(lpddi, 0, dwSize); memset(&ddi, 0, sizeof(ddi)); - + ddi.dwSize = dwSize; ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ @@ -201,7 +201,7 @@ static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD ver memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi))); } - + static BOOL keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) { if (id != 0) @@ -211,9 +211,9 @@ static BOOL keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEI ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 0x0800)) || (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 0x0800))) { TRACE("Enumerating the Keyboard device\n"); - + fill_keyboard_dideviceinstanceA(lpddi, version); - + return TRUE; } @@ -231,7 +231,7 @@ static BOOL keyboarddev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEI TRACE("Enumerating the Keyboard device\n"); fill_keyboard_dideviceinstanceW(lpddi, version); - + return TRUE; } @@ -315,7 +315,7 @@ static ULONG WINAPI SysKeyboardAImpl_Release(LPDIRECTINPUTDEVICE8A iface) if (ref) return ref; - EnterCriticalSection(&keyboard_crit); + EnterCriticalSection(&keyboard_crit); kbd_users = InterlockedDecrement(&keyboard_users); if (0 == kbd_users) { UnhookWindowsHookEx( keyboard_hook ); @@ -417,7 +417,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( } } } - + memcpy(ptr, DInputKeyState, WINE_DINPUT_KEYBOARD_MAX_KEYS); LeaveCriticalSection(&(This->crit)); @@ -493,7 +493,7 @@ static HRESULT WINAPI SysKeyboardAImpl_EnumObjects( SysKeyboardImpl *This = (SysKeyboardImpl *)iface; DIDEVICEOBJECTINSTANCEA ddoi; int i; - + TRACE("(this=%p,%p,%p,%08lx)\n", This, lpCallback, lpvRef, dwFlags); if (TRACE_ON(dinput)) { TRACE(" - flags = "); @@ -514,7 +514,7 @@ static HRESULT WINAPI SysKeyboardAImpl_EnumObjects( _dump_OBJECTINSTANCEA(&ddoi); if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) return DI_OK; } - + return DI_OK; } @@ -550,7 +550,7 @@ static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) FIXME("Not more than one keyboard can be acquired at the same time.\n"); SysKeyboardAImpl_Unacquire(iface); } - + current_lock = This; if (This->buffersize > 0) { @@ -619,7 +619,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities( WARN("invalid parameter\n"); return DIERR_INVALIDPARAM; } - + devcaps.dwSize = lpDIDevCaps->dwSize; devcaps.dwFlags = DIDC_ATTACHED; if (This->dinput->dwVersion >= 0x0800) @@ -636,7 +636,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities( devcaps.dwFFDriverVersion = 0; memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize); - + return DI_OK; } @@ -654,7 +654,7 @@ SysKeyboardAImpl_GetObjectInfo( SysKeyboardImpl *This = (SysKeyboardImpl *)iface; DIDEVICEOBJECTINSTANCEA ddoi; DWORD dwSize = pdidoi->dwSize; - + TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow); if (dwHow == DIPH_BYID) { @@ -673,7 +673,7 @@ SysKeyboardAImpl_GetObjectInfo( /* And return our just filled device object instance structure */ memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi))); - + _dump_OBJECTINSTANCEA(pdidoi); return DI_OK; @@ -687,7 +687,7 @@ static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface SysKeyboardImpl *This = (SysKeyboardImpl *)iface; DIDEVICEOBJECTINSTANCEW ddoi; DWORD dwSize = pdidoi->dwSize; - + TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow); if (dwHow == DIPH_BYID) { @@ -706,7 +706,7 @@ static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface /* And return our just filled device object instance structure */ memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi))); - + _dump_OBJECTINSTANCEW(pdidoi); return DI_OK; @@ -728,11 +728,11 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo( } fill_keyboard_dideviceinstanceA(pdidi, This->dinput->dwVersion); - + return DI_OK; } -static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) +static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) { SysKeyboardImpl *This = (SysKeyboardImpl *)iface; TRACE("(this=%p,%p)\n", This, pdidi); @@ -743,7 +743,7 @@ static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface } fill_keyboard_dideviceinstanceW(pdidi, This->dinput->dwVersion); - + return DI_OK; } diff --git a/reactos/dll/directx/directx.rbuild b/reactos/dll/directx/directx.rbuild index 36c7cdca258..d3259e1790d 100644 --- a/reactos/dll/directx/directx.rbuild +++ b/reactos/dll/directx/directx.rbuild @@ -28,7 +28,7 @@ - + diff --git a/reactos/dll/directx/dplay/dplay.rbuild b/reactos/dll/directx/dplay/dplay.rbuild index 3da22570d73..396d05e32af 100644 --- a/reactos/dll/directx/dplay/dplay.rbuild +++ b/reactos/dll/directx/dplay/dplay.rbuild @@ -1,6 +1,6 @@ - + . include/reactos/wine diff --git a/reactos/dll/directx/dplayx/dplay.c b/reactos/dll/directx/dplayx/dplay.c index 7748156ec8d..da0cad5113f 100644 --- a/reactos/dll/directx/dplayx/dplay.c +++ b/reactos/dll/directx/dplayx/dplay.c @@ -5188,7 +5188,7 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, 'S', 'e', 'r', 'v', 'i', 'c', 'e', ' ', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 's', 0 }; static const WCHAR guidKey[] = { 'G', 'u', 'i', 'd', 0 }; static const WCHAR descW[] = { 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', 'W', 0 }; - + DWORD dwIndex; FILETIME filetime; @@ -5196,12 +5196,12 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, DWORD max_sizeOfDescriptionA = 0; WCHAR *descriptionW = NULL; DWORD max_sizeOfDescriptionW = 0; - + if (!lpEnumCallbackA && !lpEnumCallbackW) { return DPERR_INVALIDPARAMS; } - + /* Need to loop over the service providers in the registry */ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, searchSubKey, 0, KEY_READ, &hkResult) != ERROR_SUCCESS) @@ -5210,7 +5210,7 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, ERR(": no service provider key in the registry - check your Wine installation !!!\n"); return DPERR_GENERIC; } - + /* Traverse all the service providers we have available */ dwIndex = 0; while (1) @@ -5222,7 +5222,7 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, WCHAR guidKeyContent[(2 * 16) + 1 + 6 /* This corresponds to '{....-..-..-..-......}' */ ]; DWORD sizeOfGuidKeyContent = sizeof(guidKeyContent); LONG ret_value; - + ret_value = RegEnumKeyExW(hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, &filetime); if (ret_value == ERROR_NO_MORE_ITEMS) @@ -5233,14 +5233,14 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, return DPERR_EXCEPTION; } TRACE(" this time through sub-key %s.\n", debugstr_w(subKeyName)); - + /* Open the key for this service provider */ if (RegOpenKeyExW(hkResult, subKeyName, 0, KEY_READ, &hkServiceProvider) != ERROR_SUCCESS) { ERR(": could not open registry key for service provider %s.\n", debugstr_w(subKeyName)); continue; } - + /* Get the GUID from the registry */ if (RegQueryValueExW(hkServiceProvider, guidKey, NULL, NULL, (LPBYTE) guidKeyContent, &sizeOfGuidKeyContent) != ERROR_SUCCESS) @@ -5254,7 +5254,7 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, continue; } CLSIDFromString(guidKeyContent, &serviceProviderGUID ); - + /* The enumeration will return FALSE if we are not to continue. * * Note: on my windows box, major / minor version is 6 / 0 for all service providers @@ -5264,7 +5264,7 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, if (lpEnumCallbackA) { DWORD sizeOfDescription = 0; - + /* Note that this the the A case of this function, so use the A variant to get the description string */ if (RegQueryValueExA(hkServiceProvider, "DescriptionA", NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS) @@ -5281,14 +5281,14 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, descriptionA = HeapAlloc(GetProcessHeap(), 0, sizeOfDescription); RegQueryValueExA(hkServiceProvider, "DescriptionA", NULL, NULL, (LPBYTE) descriptionA, &sizeOfDescription); - + if (!lpEnumCallbackA(&serviceProviderGUID, descriptionA, 6, 0, lpContext)) goto end; } else { DWORD sizeOfDescription = 0; - + if (RegQueryValueExW(hkServiceProvider, descW, NULL, NULL, NULL, &sizeOfDescription) != ERROR_SUCCESS) { @@ -5308,14 +5308,14 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, if (!lpEnumCallbackW(&serviceProviderGUID, descriptionW, 6, 0, lpContext)) goto end; } - + dwIndex++; } end: HeapFree(GetProcessHeap(), 0, descriptionA); HeapFree(GetProcessHeap(), 0, descriptionW); - + return DP_OK; } @@ -5326,7 +5326,7 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, HRESULT WINAPI DirectPlayEnumerateA(LPDPENUMDPCALLBACKA lpEnumCallback, LPVOID lpContext ) { TRACE("(%p,%p)\n", lpEnumCallback, lpContext); - + return DirectPlayEnumerateAW(lpEnumCallback, NULL, lpContext); } @@ -5336,7 +5336,7 @@ HRESULT WINAPI DirectPlayEnumerateA(LPDPENUMDPCALLBACKA lpEnumCallback, LPVOID l HRESULT WINAPI DirectPlayEnumerateW(LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID lpContext ) { TRACE("(%p,%p)\n", lpEnumCallback, lpContext); - + return DirectPlayEnumerateAW(NULL, lpEnumCallback, lpContext); } diff --git a/reactos/dll/directx/dplayx/dplayx_global.c b/reactos/dll/directx/dplayx/dplayx_global.c index 0650c5280d9..94da5d9cc99 100644 --- a/reactos/dll/directx/dplayx/dplayx_global.c +++ b/reactos/dll/directx/dplayx/dplayx_global.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * - * NOTES: + * NOTES: * o Implementation of all things which are associated with dplay on * the computer - ie shared resources and such. Methods in this * compilation unit should not call anything out side this unit diff --git a/reactos/dll/directx/dplayx/dplayx_main.c b/reactos/dll/directx/dplayx/dplayx_main.c index 1969d0d311d..21c785fea45 100644 --- a/reactos/dll/directx/dplayx/dplayx_main.c +++ b/reactos/dll/directx/dplayx/dplayx_main.c @@ -24,13 +24,13 @@ * o DPMSGCMD_REQUESTNEWPLAYERID & DPMSGCMD_NEWPLAYERIDREPLY * Barely work. This needs to be completed for sessions to start. * o A small issue will be the fact that DirectX 6.1(ie. DirectPlay4) - * introduces a layer of functionality inside the DP objects which + * introduces a layer of functionality inside the DP objects which * provide guaranteed protocol delivery. This is even if the native * protocol, IPX or modem for instance, doesn't guarantee it. I'm going - * to leave this kind of implementation to as close to the end as - * possible. However, I will implement an abstraction layer, where - * possible, for this functionality. It will do nothing to start, but - * will require only the implementation of the guaranteness to give + * to leave this kind of implementation to as close to the end as + * possible. However, I will implement an abstraction layer, where + * possible, for this functionality. It will do nothing to start, but + * will require only the implementation of the guaranteness to give * final implementation. * * TODO: @@ -41,11 +41,11 @@ * - Change RegEnumKeyEx enumeration pattern to allow error handling and to * share registry implementation (or at least simplify). * - Add in appropriate RegCloseKey calls for all the opening we're doing... - * - Fix all the buffer sizes for registry calls. They're off by one - + * - Fix all the buffer sizes for registry calls. They're off by one - * but in a safe direction. * - Fix race condition on interface destruction * - Handles need to be correctly reference counted - * - Check if we need to deallocate any list objects when destroying + * - Check if we need to deallocate any list objects when destroying * a dplay interface * - RunApplication process spawning needs to have correct syncronization. * - Need to get inter lobby messages working. diff --git a/reactos/dll/directx/dsound/buffer.c b/reactos/dll/directx/dsound/buffer.c index 60ca6797fdf..2541b9938df 100644 --- a/reactos/dll/directx/dsound/buffer.c +++ b/reactos/dll/directx/dsound/buffer.c @@ -1023,7 +1023,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create( if (wfex->wFormatTag == WAVE_FORMAT_PCM) { alloc_size = sizeof(WAVEFORMATEX); cp_size = sizeof(PCMWAVEFORMAT); - } else + } else alloc_size = cp_size = sizeof(WAVEFORMATEX) + wfex->cbSize; dsb->pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,alloc_size); @@ -1037,8 +1037,8 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create( CopyMemory(dsb->pwfx, wfex, cp_size); if (dsbd->dwBufferBytes % dsbd->lpwfxFormat->nBlockAlign) - dsb->buflen = dsbd->dwBufferBytes + - (dsbd->lpwfxFormat->nBlockAlign - + dsb->buflen = dsbd->dwBufferBytes + + (dsbd->lpwfxFormat->nBlockAlign - (dsbd->dwBufferBytes % dsbd->lpwfxFormat->nBlockAlign)); else dsb->buflen = dsbd->dwBufferBytes; diff --git a/reactos/dll/directx/dsound/capture.c b/reactos/dll/directx/dsound/capture.c index ea7957f4544..35dbeffae67 100644 --- a/reactos/dll/directx/dsound/capture.c +++ b/reactos/dll/directx/dsound/capture.c @@ -1773,7 +1773,7 @@ DSCCF_CreateInstance( if ( IsEqualGUID( &IID_IDirectSoundCapture, riid ) ) return DSOUND_CaptureCreate8((LPDIRECTSOUNDCAPTURE*)ppobj,pOuter); - WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); + WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); return E_NOINTERFACE; } diff --git a/reactos/dll/directx/dsound/dsound.c b/reactos/dll/directx/dsound/dsound.c index bb060238db1..d1d869e1a4e 100644 --- a/reactos/dll/directx/dsound/dsound.c +++ b/reactos/dll/directx/dsound/dsound.c @@ -992,7 +992,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) device->mixlock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&device->mixlock); HeapFree(GetProcessHeap(),0,device); - TRACE("(%p) released\n", device); + TRACE("(%p) released\n", device); } return device->ref; } diff --git a/reactos/dll/directx/dsound/dsound.rbuild b/reactos/dll/directx/dsound/dsound.rbuild index be8ab064aa5..492d92b35a4 100644 --- a/reactos/dll/directx/dsound/dsound.rbuild +++ b/reactos/dll/directx/dsound/dsound.rbuild @@ -4,7 +4,7 @@ . - include/reactos/wine + include/reactos/wine 0x600 0x501 @@ -20,7 +20,7 @@ dxguid msvcrt version.rc - buffer.c + buffer.c capture.c dsound.c dsound_main.c diff --git a/reactos/dll/directx/dsound/dsound_main.c b/reactos/dll/directx/dsound/dsound_main.c index 32fdda24177..f8b763f9b9f 100644 --- a/reactos/dll/directx/dsound/dsound_main.c +++ b/reactos/dll/directx/dsound/dsound_main.c @@ -462,7 +462,7 @@ static HRESULT WINAPI DSCF_CreateInstance( if ( IsEqualIID( &IID_IDirectSound8, riid ) ) return DSOUND_Create8((LPDIRECTSOUND8*)ppobj,pOuter); - WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); + WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); return E_NOINTERFACE; } @@ -529,7 +529,7 @@ DSPCF_CreateInstance( return IKsPrivatePropertySetImpl_Create((IKsPrivatePropertySetImpl**)ppobj); } - WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); + WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); return E_NOINTERFACE; } diff --git a/reactos/dll/directx/dsound/duplex.c b/reactos/dll/directx/dsound/duplex.c index 044d764047e..8c732c52a79 100644 --- a/reactos/dll/directx/dsound/duplex.c +++ b/reactos/dll/directx/dsound/duplex.c @@ -259,7 +259,7 @@ DSFDCF_CreateInstance( return E_NOINTERFACE; } - WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); + WARN("(%p,%p,%s,%p) Interface not found!\n",This,pOuter,debugstr_guid(riid),ppobj); return E_NOINTERFACE; } diff --git a/reactos/dll/directx/dsound/dxroslayer/dxros_layer.h b/reactos/dll/directx/dsound/dxroslayer/dxros_layer.h index 3468266eae8..4ab5a5162a1 100644 --- a/reactos/dll/directx/dsound/dxroslayer/dxros_layer.h +++ b/reactos/dll/directx/dsound/dxroslayer/dxros_layer.h @@ -11,11 +11,11 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * ReactOS emulation layer betwin wine and windows api for directx + * ReactOS emulation layer betwin wine and windows api for directx * This transform wine specfiy api to native reactos/windows api - * wine have done some hack to geting dsound working. But does + * wine have done some hack to geting dsound working. But does * hack does not work on windows or reactos. It need to warp thuse - * api hack to true native api. + * api hack to true native api. * * this include file really need to be clean up. * @@ -25,7 +25,7 @@ #ifdef __REACTOS__ #include -// wine spec +// wine spec #define MAXWAVEDRIVERS 10 #define MAXMIDIDRIVERS 10 #define MAXAUXDRIVERS 10 diff --git a/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsounddesc.c b/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsounddesc.c index 90bd969a71d..caf62018f00 100644 --- a/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsounddesc.c +++ b/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsounddesc.c @@ -1,5 +1,5 @@ /* - * reactos emulation layer betwin wine and windows api for directx + * reactos emulation layer betwin wine and windows api for directx * get hardware dec * Copyright 2004 Magnus Olsen * @@ -20,7 +20,7 @@ * TODO: * soucre clean * need to rewrite almost everthing so it get all info from the hardware instead - * see todo.rtf + * see todo.rtf * * put it in own library that call dxroslayer.a * @@ -64,38 +64,38 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); DWORD dxrosdrv_drv_querydsounddescss(int type, HWAVEOUT hwo_out,HWAVEIN hwo_in, PDSDRIVERDESC pDESC) -{ +{ WAVEOUTCAPSA ac_play; WAVEINCAPSA ac_rec; DWORD msg; - - + + // type 0 = out // clear data memset(pDESC,0,sizeof(DSDRIVERDESC)); - memset((char *)pDESC->szDrvname,0,255); + memset((char *)pDESC->szDrvname,0,255); if (type==0) memset(&ac_play,0,sizeof(WAVEOUTCAPSA)); else memset(&ac_rec,0,sizeof(WAVEINCAPSA)); // get some data if (type==0) { msg = waveOutGetDevCapsA((UINT)hwo_out,&ac_play,sizeof(WAVEOUTCAPSA)); - if (ac_play.szPname==NULL) return MMSYSERR_NOTSUPPORTED; + if (ac_play.szPname==NULL) return MMSYSERR_NOTSUPPORTED; } else { msg = waveInGetDevCapsA((UINT)hwo_in,&ac_rec,sizeof(WAVEINCAPSA)); - if (ac_rec.szPname==NULL) return MMSYSERR_NOTSUPPORTED; + if (ac_rec.szPname==NULL) return MMSYSERR_NOTSUPPORTED; } if (msg!=MMSYSERR_NOERROR) return msg; - // setting up value - //pDESC->wReserved = NULL; - + // setting up value + //pDESC->wReserved = NULL; + if (type==0) { pDESC->ulDeviceNum = (ULONG)hwo_out; @@ -113,7 +113,7 @@ DWORD dxrosdrv_drv_querydsounddescss(int type, HWAVEOUT hwo_out,HWAVEIN hwo_in, DSDDESC_DONTNEEDSECONDARYLOCK; //pDesc->dnDevNode = WOutDev[This->wDevID].waveDesc.dnDevNode; pDESC->wVxdId = 0; - pDESC->wReserved = 0; + pDESC->wReserved = 0; pDESC->dwHeapType = DSDHEAP_NOHEAP; pDESC->pvDirectDrawHeap = NULL; pDESC->dwMemStartAddress = 0; @@ -126,18 +126,18 @@ DWORD dxrosdrv_drv_querydsounddescss(int type, HWAVEOUT hwo_out,HWAVEIN hwo_in, pDESC->pvReserved1 = NULL; pDESC->pvReserved2 = NULL; - + // we need to fill it right so we do not need ddraw.dll pDESC->pvDirectDrawHeap = NULL; // wine dsound does not use ddraw.dll - + // need to write dective for it pDESC->dwHeapType = DSDHEAP_NOHEAP; - // have take the value from wine audio drv - pDESC->dwFlags = DSDDESC_DOMMSYSTEMOPEN | + // have take the value from wine audio drv + pDESC->dwFlags = DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT | - DSDDESC_USESYSTEMMEMORY | + DSDDESC_USESYSTEMMEMORY | DSDDESC_DONTNEEDPRIMARYLOCK | DSDDESC_DONTNEEDSECONDARYLOCK; @@ -145,18 +145,18 @@ DWORD dxrosdrv_drv_querydsounddescss(int type, HWAVEOUT hwo_out,HWAVEIN hwo_in, //WAVEOPENDESC->DevNode need to fig. how to get it from mmdrv pDESC->dnDevNode = 0; // wine dsound are using this value - // need to fill the rest also + // need to fill the rest also // must contain the audio drv name // but how to get it ? - //memcpy((char *)pDESC->szDrvname,(char *)&"kx.sys",6); + //memcpy((char *)pDESC->szDrvname,(char *)&"kx.sys",6); + + - - pDESC->dwMemStartAddress = 0; - pDESC->dwMemAllocExtra = 0; + pDESC->dwMemAllocExtra = 0; pDESC->wVxdId = 0; - + return MMSYSERR_NOERROR; } diff --git a/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsoundiface.c b/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsoundiface.c index 3be9cc50447..93b0a663590 100644 --- a/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsoundiface.c +++ b/reactos/dll/directx/dsound/dxroslayer/dxrosdrv_querydsoundiface.c @@ -1,5 +1,5 @@ /* - * reactos emulation layer betwin wine and windows api for directx + * reactos emulation layer betwin wine and windows api for directx * * Copyright 2004 Magnus Olsen * @@ -63,10 +63,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); DWORD dxrosdrv_drv_querydsoundiface(HWAVEIN wDevID, PIDSDRIVER* drv) -{ +{ // no hardware support for dsound NT 4.0 does not support it - // but win 2000/xp drv does support hardware support of direct sound - drv = NULL; + // but win 2000/xp drv does support hardware support of direct sound + drv = NULL; // drv should be fild with hardware pointers see PIDSDRIVER struct return MMSYSERR_NOERROR; } diff --git a/reactos/dll/directx/dsound/dxroslayer/dxroslayer.c b/reactos/dll/directx/dsound/dxroslayer/dxroslayer.c index 9c382a46f2e..7ddfdf2bb56 100644 --- a/reactos/dll/directx/dsound/dxroslayer/dxroslayer.c +++ b/reactos/dll/directx/dsound/dxroslayer/dxroslayer.c @@ -14,27 +14,27 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * ReactOS emulation layer betwin wine and windows api for directx + * ReactOS emulation layer betwin wine and windows api for directx * This transform wine specfiy api to native reactos/windows api - * wine have done some hack to geting dsound working. But does + * wine have done some hack to geting dsound working. But does * hack does not work on windows or reactos. It need to warp thuse - * api hack to true native api. - * - * This layer have some weekness + * api hack to true native api. + * + * This layer have some weekness * it does not support hardware accleration of the sound card. - * it need complete implant of it here, and we need also wdm + * it need complete implant of it here, and we need also wdm * in reactos to complete dsound. for monet it is not posibile * to get all value and fill them. eg the soundcard drv name. * * Wine does get almost everthing from there sound drv, then * pass it thurg winmm, then to dsound. but windows drv does * not pass this info to the winmm. it send it on wdm instead. - * + * * Do rember this dsound is hardcode to software mode only. * the program will not notice it. it will think it is hardware. - * for the flag never report back it is in software mode. + * for the flag never report back it is in software mode. + * * - * * Copyright 2004 Magnus Olsen * */ @@ -81,17 +81,17 @@ DWORD RosWineWaveOutMessage(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwParam1, DWORD_ DWORD msg; switch (uMsg) { case DRV_QUERYDSOUNDDESC: - msg = dxrosdrv_drv_querydsounddescss(0, (HWAVEOUT)((ULONG)hwo),(HWAVEIN) 0, (PDSDRIVERDESC) dwParam1); + msg = dxrosdrv_drv_querydsounddescss(0, (HWAVEOUT)((ULONG)hwo),(HWAVEIN) 0, (PDSDRIVERDESC) dwParam1); break; case DRV_QUERYDSOUNDIFACE: msg = dxrosdrv_drv_querydsoundiface((HWAVEIN)hwo, (PIDSDRIVER*)dwParam1); break; - + default : msg = waveOutMessage(hwo, uMsg, dwParam1, dwParam2); break; - } + } return msg; } @@ -100,16 +100,16 @@ DWORD RosWineWaveInMessage(HWAVEIN hwo, UINT uMsg, DWORD_PTR dwParam1, DWORD_PT DWORD msg; switch (uMsg) { case DRV_QUERYDSOUNDDESC: - msg = dxrosdrv_drv_querydsounddescss(1, (HWAVEOUT)((ULONG)0),(HWAVEIN)((ULONG)hwo), (PDSDRIVERDESC) dwParam1); + msg = dxrosdrv_drv_querydsounddescss(1, (HWAVEOUT)((ULONG)0),(HWAVEIN)((ULONG)hwo), (PDSDRIVERDESC) dwParam1); break; - case DRV_QUERYDSOUNDIFACE: - msg = dxrosdrv_drv_querydsoundiface(hwo, (PIDSDRIVER*)dwParam1); - break; - + case DRV_QUERYDSOUNDIFACE: + msg = dxrosdrv_drv_querydsoundiface(hwo, (PIDSDRIVER*)dwParam1); + break; + default : msg = waveInMessage(hwo, uMsg, dwParam1, dwParam2); break; - } + } return msg; } diff --git a/reactos/dll/directx/dsound/dxroslayer/getguidfromstring.c b/reactos/dll/directx/dsound/dxroslayer/getguidfromstring.c index ac96bd69fbe..40b5f9389d6 100644 --- a/reactos/dll/directx/dsound/dxroslayer/getguidfromstring.c +++ b/reactos/dll/directx/dsound/dxroslayer/getguidfromstring.c @@ -1,5 +1,5 @@ /* - * ReactOS emulation layer betwin wine and windows api for directx + * ReactOS emulation layer betwin wine and windows api for directx * convort string to GUID * * Copyright 2004 Magnus Olsen @@ -21,7 +21,7 @@ * * TODO: * soucre clean - * Rewrite so it use unicode instead for asc or find how windows convert it + * Rewrite so it use unicode instead for asc or find how windows convert it */ #include "config.h" @@ -65,15 +65,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); void dxGetGuidFromString( char *in_str, GUID *guid ) -{ +{ unsigned long c=0; int i; - // this string hex converter need to be rewrite or find uhow windows convort a string + // this string hex converter need to be rewrite or find uhow windows convort a string // to GUID for (i=1;i<9;i++) - { + { if (in_str[i]>='0' && in_str[i]<='9') { c=c * 16 + (in_str[i] - 48); @@ -82,13 +82,13 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) { c=c * 16 + (in_str[i] - 55); } - } + } guid->Data1 = c; c=0; for (i=9;i<14;i++) { - if (in_str[i]>='0' && in_str[i]<='9') + if (in_str[i]>='0' && in_str[i]<='9') { c=c * 16 + (in_str[i] - 48); } @@ -104,12 +104,12 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) for (i=14;i<19;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); - else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); + else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); } guid->Data3 = (short) c; - c=0; - - for (i=20;i<22;i++) + c=0; + + for (i=20;i<22;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); @@ -117,7 +117,7 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) guid->Data4[0] = (BYTE) c; c=0; - for (i=22;i<24;i++) + for (i=22;i<24;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); @@ -125,8 +125,8 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) guid->Data4[1] = (BYTE) c; c=0; - - for (i=25;i<27;i++) + + for (i=25;i<27;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); @@ -134,15 +134,15 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) guid->Data4[2] = (BYTE) c; c=0; - for (i=27;i<29;i++) + for (i=27;i<29;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); } guid->Data4[3] = (BYTE) c; c=0; - - for (i=29;i<31;i++) + + for (i=29;i<31;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); @@ -150,7 +150,7 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) guid->Data4[4] = (BYTE) c; c=0; - for (i=31;i<33;i++) + for (i=31;i<33;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); @@ -158,7 +158,7 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) guid->Data4[5] = (BYTE) c; c=0; - for (i=33;i<35;i++) + for (i=33;i<35;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); @@ -166,11 +166,11 @@ void dxGetGuidFromString( char *in_str, GUID *guid ) guid->Data4[6] = (BYTE) c; c=0; - for (i=35;i<37;i++) + for (i=35;i<37;i++) { if (in_str[i]>='0' && in_str[i]<='9') c=c * 16 + (in_str[i] - 48); else if (in_str[i]>='A' && in_str[i]<='F') c=c * 16 + (in_str[i] - 55); } guid->Data4[7] = (BYTE) c; - c=0; + c=0; } diff --git a/reactos/dll/directx/dsound/mixer.c b/reactos/dll/directx/dsound/mixer.c index 00695461ce3..49c8b37e210 100644 --- a/reactos/dll/directx/dsound/mixer.c +++ b/reactos/dll/directx/dsound/mixer.c @@ -286,7 +286,7 @@ static void DSOUND_MixerVol(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len) INT16 *bps = (INT16 *) buf; TRACE("(%p,%p,%d)\n",dsb,buf,len); - TRACE("left = %lx, right = %lx\n", dsb->cvolpan.dwTotalLeftAmpFactor, + TRACE("left = %lx, right = %lx\n", dsb->cvolpan.dwTotalLeftAmpFactor, dsb->cvolpan.dwTotalRightAmpFactor); if ((!(dsb->dsbd.dwFlags & DSBCAPS_CTRLPAN) || (dsb->cvolpan.lPan == 0)) && @@ -425,7 +425,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO else if (field < -128) field = -128; *obuf++ = field + 128; } - + if (todo < len) { todo = len - todo; obuf = dsb->dsound->device->buffer; @@ -541,7 +541,7 @@ static void DSOUND_PhaseCancel(IDirectSoundBufferImpl *dsb, DWORD writepos, DWOR else if (field < -128) field = -128; *obuf++ = field + 128; } - + if (todo < len) { todo = len - todo; obuf = dsb->dsound->device->buffer; @@ -1136,8 +1136,8 @@ void CALLBACK DSOUND_callback(HWAVEOUT hwo, UINT msg, DWORD dwUser, DWORD dw1, D { DirectSoundDevice * device = (DirectSoundDevice*)dwUser; TRACE("(%p,%x,%lx,%lx,%lx)\n",hwo,msg,dwUser,dw1,dw2); - TRACE("entering at %ld, msg=%08x(%s)\n", GetTickCount(), msg, - msg==MM_WOM_DONE ? "MM_WOM_DONE" : msg==MM_WOM_CLOSE ? "MM_WOM_CLOSE" : + TRACE("entering at %ld, msg=%08x(%s)\n", GetTickCount(), msg, + msg==MM_WOM_DONE ? "MM_WOM_DONE" : msg==MM_WOM_CLOSE ? "MM_WOM_CLOSE" : msg==MM_WOM_OPEN ? "MM_WOM_OPEN" : "UNKNOWN"); if (msg == MM_WOM_DONE) { DWORD inq, mixq, fraglen, buflen, pwplay, playpos, mixpos; diff --git a/reactos/dll/directx/dsound/primary.c b/reactos/dll/directx/dsound/primary.c index af2f2855bf4..3ea9fb06db5 100644 --- a/reactos/dll/directx/dsound/primary.c +++ b/reactos/dll/directx/dsound/primary.c @@ -822,7 +822,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Unlock( if (!(device->drvdesc.dwFlags & DSDDESC_DONTNEEDPRIMARYLOCK) && device->hwbuf) { HRESULT hres; - + hres = IDsDriverBuffer_Unlock(device->hwbuf, p1, x1, p2, x2); if (hres != DS_OK) { WARN("IDsDriverBuffer_Unlock failed\n"); diff --git a/reactos/dll/directx/dsound/sound3d.c b/reactos/dll/directx/dsound/sound3d.c index 3505b0664c4..91879a3cb93 100644 --- a/reactos/dll/directx/dsound/sound3d.c +++ b/reactos/dll/directx/dsound/sound3d.c @@ -127,7 +127,7 @@ static inline D3DVALUE AngleBetweenVectorsDeg (LPD3DVECTOR a, LPD3DVECTOR b) angle = RadToDeg(angle); TRACE("angle between (%f,%f,%f) and (%f,%f,%f) = %f degrees\n", a->x, a->y, a->z, b->x, b->y, b->z, angle); - return angle; + return angle; } /* angle between vectors - rad version */ @@ -142,7 +142,7 @@ static inline D3DVALUE AngleBetweenVectorsRad (LPD3DVECTOR a, LPD3DVECTOR b) angle = acos(cos); TRACE("angle between (%f,%f,%f) and (%f,%f,%f) = %f radians\n", a->x, a->y, a->z, b->x, b->y, b->z, angle); - return angle; + return angle; } /* calculates vector between two points */ @@ -194,7 +194,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) /* initial buffer volume */ lVolume = dsb->ds3db_lVolume; - + switch (dsb->ds3db_ds3db.dwMode) { case DS3DMODE_DISABLE: @@ -215,29 +215,29 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) flDistance = VectorMagnitude (&dsb->ds3db_ds3db.vPosition); break; } - + if (flDistance > dsb->ds3db_ds3db.flMaxDistance) { /* some apps don't want you to hear too distant sounds... */ if (dsb->dsbd.dwFlags & DSBCAPS_MUTE3DATMAXDISTANCE) { dsb->volpan.lVolume = DSBVOLUME_MIN; - DSOUND_RecalcVolPan (&dsb->volpan); + DSOUND_RecalcVolPan (&dsb->volpan); /* i guess mixing here would be a waste of power */ return; } else flDistance = dsb->ds3db_ds3db.flMaxDistance; - } + } if (flDistance < dsb->ds3db_ds3db.flMinDistance) flDistance = dsb->ds3db_ds3db.flMinDistance; - + /* the following formula is taken from my physics book. I think it's ok for the *real* world...i hope m$ does it that way */ lVolume += 10000; /* ms likes working with negative volume...i don't */ lVolume /= 1000; /* convert hundreths of dB into B */ /* intensity level (loudness) = log10(Intensity/DefaultIntensity)...therefore */ - flIntensity = pow(10,lVolume)*DEFAULT_INTENSITY; + flIntensity = pow(10,lVolume)*DEFAULT_INTENSITY; flTemp = (flDistance/dsb->ds3db_ds3db.flMinDistance)*(flDistance/dsb->ds3db_ds3db.flMinDistance); flIntensity /= flTemp; lVolume = log10(flIntensity/DEFAULT_INTENSITY); @@ -274,7 +274,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) flAngle, dsb->ds3db_ds3db.dwInsideConeAngle/2, dsb->ds3db_ds3db.dwOutsideConeAngle/2, dsb->ds3db_ds3db.lConeOutsideVolume, lVolume); } dsb->volpan.lVolume = lVolume; - + /* panning */ if (dsb->dsound->device->ds3dl.vPosition.x == dsb->ds3db_ds3db.vPosition.x && dsb->dsound->device->ds3dl.vPosition.y == dsb->ds3db_ds3db.vPosition.y && @@ -293,7 +293,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) TRACE("panning: Angle = %f rad, lPan = %ld\n", flAngle, dsb->volpan.lPan); /* FIXME: Doppler Effect disabled since i have no idea which frequency to change and how to do it */ -#if 0 +#if 0 /* doppler shift*/ if ((VectorMagnitude(&ds3db.vVelocity) == 0) && (VectorMagnitude(&dsb->dsound->device->ds3dl.vVelocity) == 0)) { @@ -317,8 +317,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) /* FIXME: replace following line with correct frequency setting ! */ dsb->freq = flFreq; } -#endif - +#endif + /* time for remix */ DSOUND_RecalcVolPan(&dsb->volpan); } @@ -328,7 +328,7 @@ static void DSOUND_Mix3DBuffer(IDirectSoundBufferImpl *dsb) TRACE("(%p)\n",dsb); DSOUND_Calc3DBuffer(dsb); - DSOUND_ForceRemix(dsb); + DSOUND_ForceRemix(dsb); } static void WINAPI DSOUND_ChangeListener(IDirectSound3DListenerImpl *ds3dl) @@ -402,7 +402,7 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_GetAllParameters( WARN("invalid parameter: lpDs3dBuffer->dwSize = %ld < %d\n",lpDs3dBuffer->dwSize, sizeof(*lpDs3dBuffer)); return DSERR_INVALIDPARAM; } - + TRACE("returning: all parameters\n"); *lpDs3dBuffer = This->dsb->ds3db_ds3db; return DS_OK; @@ -837,7 +837,7 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_GetAllParameter( WARN("invalid parameter: lpDS3DL->dwSize = %ld < %d\n",lpDS3DL->dwSize, sizeof(*lpDS3DL)); return DSERR_INVALIDPARAM; } - + TRACE("returning: all parameters\n"); *lpDS3DL = This->dsound->device->ds3dl; return DS_OK; diff --git a/reactos/dll/directx/dxdiagn/container.c b/reactos/dll/directx/dxdiagn/container.c index aa15d1082e0..e7e9bd37604 100644 --- a/reactos/dll/directx/dxdiagn/container.c +++ b/reactos/dll/directx/dxdiagn/container.c @@ -1,6 +1,6 @@ -/* +/* * IDxDiagContainer Implementation - * + * * Copyright 2004 Raphael Junqueira * * This library is free software; you can redistribute it and/or @@ -64,7 +64,7 @@ ULONG WINAPI IDxDiagContainerImpl_Release(PDXDIAGCONTAINER iface) { } DXDIAGN_UnlockModule(); - + return refCount; } @@ -83,7 +83,7 @@ HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(PDXDIAGCONTAINER ifa IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface; IDxDiagContainerImpl_SubContainer* p = NULL; DWORD i = 0; - + TRACE("(%p, %lu, %s, %lu)\n", iface, dwIndex, debugstr_w(pwszContainer), cchContainer); if (NULL == pwszContainer) { @@ -92,10 +92,10 @@ HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(PDXDIAGCONTAINER ifa if (256 > cchContainer) { return DXDIAG_E_INSUFFICIENT_BUFFER; } - + p = This->subContainers; while (NULL != p) { - if (dwIndex == i) { + if (dwIndex == i) { if (cchContainer <= strlenW(p->contName)) { return DXDIAG_E_INSUFFICIENT_BUFFER; } @@ -104,7 +104,7 @@ HRESULT WINAPI IDxDiagContainerImpl_EnumChildContainerNames(PDXDIAGCONTAINER ifa } p = p->next; ++i; - } + } return E_INVALIDARG; } @@ -114,7 +114,7 @@ HRESULT WINAPI IDxDiagContainerImpl_GetChildContainerInternal(PDXDIAGCONTAINER i p = This->subContainers; while (NULL != p) { - if (0 == lstrcmpW(p->contName, pwszContainer)) { + if (0 == lstrcmpW(p->contName, pwszContainer)) { *ppInstance = (PDXDIAGCONTAINER)p->pCont; return S_OK; } @@ -179,7 +179,7 @@ HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface, DWORD IDxDiagContainerImpl *This = (IDxDiagContainerImpl *)iface; IDxDiagContainerImpl_Property* p = NULL; DWORD i = 0; - + FIXME("(%p, %lu, %s, %lu)\n", iface, dwIndex, debugstr_w(pwszPropName), cchPropName); if (NULL == pwszPropName) { @@ -188,10 +188,10 @@ HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface, DWORD if (256 > cchPropName) { return DXDIAG_E_INSUFFICIENT_BUFFER; } - + p = This->properties; while (NULL != p) { - if (dwIndex == i) { + if (dwIndex == i) { if (cchPropName <= lstrlenW(p->vName)) { return DXDIAG_E_INSUFFICIENT_BUFFER; } @@ -200,7 +200,7 @@ HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface, DWORD } p = p->next; ++i; - } + } return E_INVALIDARG; } @@ -215,7 +215,7 @@ HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWSTR pwsz p = This->properties; while (NULL != p) { - if (0 == lstrcmpW(p->vName, pwszPropName)) { + if (0 == lstrcmpW(p->vName, pwszPropName)) { VariantCopy(pvarProp, &p->v); return S_OK; } @@ -309,7 +309,7 @@ HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, LPVOID *ppobj) { IDxDiagContainerImpl* container; TRACE("(%p, %p)\n", debugstr_guid(riid), ppobj); - + container = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDxDiagContainerImpl)); if (NULL == container) { *ppobj = NULL; diff --git a/reactos/dll/directx/dxdiagn/dxdiag_main.c b/reactos/dll/directx/dxdiagn/dxdiag_main.c index b72f9cd464c..02ae12a53c3 100644 --- a/reactos/dll/directx/dxdiagn/dxdiag_main.c +++ b/reactos/dll/directx/dxdiagn/dxdiag_main.c @@ -1,6 +1,6 @@ -/* +/* * DXDiag - * + * * Copyright 2004 Raphael Junqueira * * This library is free software; you can redistribute it and/or @@ -32,7 +32,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { TRACE("%p,%lx,%p\n", hInstDLL, fdwReason, lpvReserved); if (fdwReason == DLL_PROCESS_ATTACH) { - DisableThreadLibraryCalls(hInstDLL); + DisableThreadLibraryCalls(hInstDLL); } return TRUE; } @@ -50,7 +50,7 @@ static HRESULT WINAPI DXDiagCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,L FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); if (ppobj == NULL) return E_POINTER; - + return E_NOINTERFACE; } @@ -69,7 +69,7 @@ static ULONG WINAPI DXDiagCF_Release(LPCLASSFACTORY iface) { static HRESULT WINAPI DXDiagCF_CreateInstance(LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj) { IClassFactoryImpl *This = (IClassFactoryImpl *)iface; TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); - + return This->pfnCreateInstanceFactory(iface, pOuter, riid, ppobj); } @@ -80,7 +80,7 @@ static HRESULT WINAPI DXDiagCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { DXDIAGN_LockModule(); else DXDIAGN_UnlockModule(); - + return S_OK; } diff --git a/reactos/dll/directx/dxdiagn/dxdiag_private.h b/reactos/dll/directx/dxdiagn/dxdiag_private.h index 86691e8cfda..f9cd9e34623 100644 --- a/reactos/dll/directx/dxdiagn/dxdiag_private.h +++ b/reactos/dll/directx/dxdiagn/dxdiag_private.h @@ -87,7 +87,7 @@ struct IDxDiagContainerImpl { const IDxDiagContainerVtbl *lpVtbl; LONG ref; /* IDxDiagContainer fields */ - IDxDiagContainerImpl_Property* properties; + IDxDiagContainerImpl_Property* properties; IDxDiagContainerImpl_SubContainer* subContainers; DWORD nProperties; DWORD nSubContainers; diff --git a/reactos/dll/directx/dxdiagn/provider.c b/reactos/dll/directx/dxdiagn/provider.c index 3e6511948ca..bf5232d8e1c 100644 --- a/reactos/dll/directx/dxdiagn/provider.c +++ b/reactos/dll/directx/dxdiagn/provider.c @@ -1,6 +1,6 @@ -/* +/* * IDxDiagProvider Implementation - * + * * Copyright 2004 Raphael Junqueira * * This library is free software; you can redistribute it and/or @@ -107,7 +107,7 @@ HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, R IDxDiagProviderImpl* provider; TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj); - + provider = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDxDiagProviderImpl)); if (NULL == provider) { *ppobj = NULL; diff --git a/reactos/dll/directx/wine/d3d8/d3d8.rbuild b/reactos/dll/directx/wine/d3d8/d3d8.rbuild index 0fc926ca03c..0956d98660e 100644 --- a/reactos/dll/directx/wine/d3d8/d3d8.rbuild +++ b/reactos/dll/directx/wine/d3d8/d3d8.rbuild @@ -1,6 +1,6 @@ - + . include/reactos/wine diff --git a/reactos/dll/directx/wine/d3d8/d3d8_main.c b/reactos/dll/directx/wine/d3d8/d3d8_main.c index 63cb47204d5..43221cd2bb8 100644 --- a/reactos/dll/directx/wine/d3d8/d3d8_main.c +++ b/reactos/dll/directx/wine/d3d8/d3d8_main.c @@ -75,11 +75,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) * ValidateVertexShader (D3D8.@) * * I've seen reserved1 and reserved2 always passed as 0's - * bool seems always passed as 0 or 1, but other values work as well.... + * bool seems always passed as 0 or 1, but other values work as well.... * toto result? */ HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto) -{ +{ HRESULT ret; FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto); @@ -91,7 +91,7 @@ HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD switch(*vertexshader) { case 0xFFFE0101: - case 0xFFFE0100: + case 0xFFFE0100: ret=S_OK; break; default: @@ -112,12 +112,12 @@ HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bo { HRESULT ret; FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto); - + if (!pixelshader) return E_FAIL; if (reserved1) - return E_FAIL; + return E_FAIL; switch(*pixelshader) { case 0xFFFF0100: diff --git a/reactos/dll/directx/wine/d3d8/d3d8_private.h b/reactos/dll/directx/wine/d3d8/d3d8_private.h index 229762b9957..be1edb03e4e 100644 --- a/reactos/dll/directx/wine/d3d8/d3d8_private.h +++ b/reactos/dll/directx/wine/d3d8/d3d8_private.h @@ -446,7 +446,7 @@ struct IDirect3DVolumeTexture8Impl /* TODO: Generate a valid GUIDs */ /* {83B073CE-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IDirect3DStateBlock8, +DEFINE_GUID(IID_IDirect3DStateBlock8, 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); DEFINE_GUID(IID_IDirect3DVertexDeclaration8, diff --git a/reactos/dll/directx/wine/d3d8/device.c b/reactos/dll/directx/wine/d3d8/device.c index 74a0d13cd28..4ef39874c60 100644 --- a/reactos/dll/directx/wine/d3d8/device.c +++ b/reactos/dll/directx/wine/d3d8/device.c @@ -463,7 +463,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface LeaveCriticalSection(&d3d8_cs); if (FAILED(hrc)) { - /* free up object */ + /* free up object */ FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This); HeapFree(GetProcessHeap(), 0, object); /* *ppTexture = NULL; */ @@ -477,8 +477,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface return hrc; } -static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, - UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, +static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, + UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture) { IDirect3DVolumeTexture8Impl *object; @@ -518,7 +518,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 return hrc; } -static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, +static HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture) { IDirect3DCubeTexture8Impl *object; @@ -634,7 +634,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateSurface(LPDIRECT3DDEVICE8 iface IDirect3DSurface8Impl *object; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; TRACE("(%p) Relay\n", This); - if(MultisampleQuality < 0) { + if(MultisampleQuality < 0) { FIXME("MultisampleQuality out of range %d, substituting 0\n", MultisampleQuality); /*FIXME: Find out what windows does with a MultisampleQuality < 0 */ MultisampleQuality=0; @@ -989,7 +989,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface, DWO IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This); - + /* Note: D3DLIGHT8 is compatible with WINED3DLIGHT */ EnterCriticalSection(&d3d8_cs); hr = IWineD3DDevice_SetLight(This->WineD3DDevice, Index, (const WINED3DLIGHT *)pLight); @@ -1413,7 +1413,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3D } static HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) { - IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; + IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This); diff --git a/reactos/dll/directx/wine/d3d8/directx.c b/reactos/dll/directx/wine/d3d8/directx.c index 54c87e68484..0a16d2a17b5 100644 --- a/reactos/dll/directx/wine/d3d8/directx.c +++ b/reactos/dll/directx/wine/d3d8/directx.c @@ -109,8 +109,8 @@ static HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier (LPDIRECT3D8 i TRACE("(%p)->(%d,%08x, %p\n", This, Adapter, Flags, pIdentifier); EnterCriticalSection(&d3d8_cs); - /* dx8 and dx9 have different structures to be filled in, with incompatible - layouts so pass in pointers to the places to be filled via an internal + /* dx8 and dx9 have different structures to be filled in, with incompatible + layouts so pass in pointers to the places to be filled via an internal structure */ adapter_id.Driver = pIdentifier->Driver; adapter_id.Description = pIdentifier->Description; @@ -203,7 +203,7 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 if return hr; } -static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, +static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) { IDirect3D8Impl *This = (IDirect3D8Impl *)iface; @@ -269,8 +269,8 @@ HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, IDirect3DSurface8Impl *d3dSurface = NULL; TRACE("(%p) call back\n", device); - res = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)device, Width, Height, - (D3DFORMAT)Format, MultiSample, Lockable, + res = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)device, Width, Height, + (D3DFORMAT)Format, MultiSample, Lockable, (IDirect3DSurface8 **)&d3dSurface); if (SUCCEEDED(res)) { @@ -365,7 +365,7 @@ HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSup IDirect3DSurface8Impl *d3dSurface = NULL; TRACE("(%p) call back\n", device); - res = IDirect3DDevice8_CreateDepthStencilSurface((IDirect3DDevice8 *)device, Width, Height, + res = IDirect3DDevice8_CreateDepthStencilSurface((IDirect3DDevice8 *)device, Width, Height, (D3DFORMAT)Format, MultiSample, (IDirect3DSurface8 **)&d3dSurface); if (SUCCEEDED(res)) { *ppSurface = d3dSurface->wineD3DSurface; diff --git a/reactos/dll/directx/wine/d3d8/stateblock.c b/reactos/dll/directx/wine/d3d8/stateblock.c index d42fb79f889..4dd0a1ef333 100644 --- a/reactos/dll/directx/wine/d3d8/stateblock.c +++ b/reactos/dll/directx/wine/d3d8/stateblock.c @@ -67,19 +67,19 @@ static ULONG WINAPI IDirect3DStateBlock8Impl_Release(IDirect3DStateBlock8 *iface /* IDirect3DStateBlock8 Interface follow: */ static HRESULT WINAPI IDirect3DStateBlock8Impl_GetDevice(IDirect3DStateBlock8 *iface, IDirect3DDevice8 **ppDevice) { IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; - TRACE("(%p) Relay\n", This); + TRACE("(%p) Relay\n", This); return IDirect3DResource8Impl_GetDevice((LPDIRECT3DRESOURCE8) This, ppDevice); } static HRESULT WINAPI IDirect3DStateBlock8Impl_Capture(IDirect3DStateBlock8 *iface) { IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; - TRACE("(%p) Relay\n", This); + TRACE("(%p) Relay\n", This); return IWineD3DStateBlock_Capture(This->wineD3DStateBlock); } static HRESULT WINAPI IDirect3DStateBlock8Impl_Apply(IDirect3DStateBlock8 *iface) { IDirect3DStateBlock8Impl *This = (IDirect3DStateBlock8Impl *)iface; - TRACE("(%p) Relay\n", This); + TRACE("(%p) Relay\n", This); return IWineD3DStateBlock_Apply(This->wineD3DStateBlock); } diff --git a/reactos/dll/directx/wine/d3d8/volume.c b/reactos/dll/directx/wine/d3d8/volume.c index bea2ea9f8bc..87fa9211740 100644 --- a/reactos/dll/directx/wine/d3d8/volume.c +++ b/reactos/dll/directx/wine/d3d8/volume.c @@ -229,10 +229,10 @@ HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT object->lpVtbl = &Direct3DVolume8_Vtbl; object->ref = 1; - hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format, + hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format, Pool, &object->wineD3DVolume, pSharedHandle, (IUnknown *)object); if (hrc != D3D_OK) { - /* free up object */ + /* free up object */ FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This); HeapFree(GetProcessHeap(), 0, object); *ppVolume = NULL; diff --git a/reactos/dll/directx/wine/wined3d/arb_program_shader.c b/reactos/dll/directx/wine/wined3d/arb_program_shader.c index 5cbadc2a528..b931a75ff80 100644 --- a/reactos/dll/directx/wine/wined3d/arb_program_shader.c +++ b/reactos/dll/directx/wine/wined3d/arb_program_shader.c @@ -41,10 +41,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_constants); * ARB_[vertex/fragment]_program helper functions follow ********************************************************/ -/** +/** * Loads floating point constants into the currently set ARB_vertex/fragment_program. * When constant_list == NULL, it will load all the constants. - * + * * @target_type should be either GL_VERTEX_PROGRAM_ARB (for vertex shaders) * or GL_FRAGMENT_PROGRAM_ARB (for pixel shaders) */ @@ -93,16 +93,16 @@ static void shader_arb_load_constantsF(IWineD3DBaseShaderImpl* This, WineD3D_GL_ /** * Loads the app-supplied constants into the currently set ARB_[vertex/fragment]_programs. - * - * We only support float constants in ARB at the moment, so don't + * + * We only support float constants in ARB at the moment, so don't * worry about the Integers or Booleans */ void shader_arb_load_constants( IWineD3DDevice* device, char usePixelShader, char useVertexShader) { - - IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device; + + IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device; IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock; WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; @@ -124,7 +124,7 @@ void shader_arb_load_constants( IWineD3DBaseShaderImpl* pshader = (IWineD3DBaseShaderImpl*) stateBlock->pixelShader; /* Load DirectX 9 float constants for pixel shader */ - shader_arb_load_constantsF(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB, + shader_arb_load_constantsF(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB, GL_LIMITS(pshader_constantsF), stateBlock->pixelShaderConstantF, &stateBlock->set_pconstantsF); @@ -150,7 +150,7 @@ void shader_generate_arb_declarations( IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; DWORD i; char pshader = shader_is_pshader_version(This->baseShader.hex_version); - unsigned max_constantsF = min(This->baseShader.limits.constant_float, + unsigned max_constantsF = min(This->baseShader.limits.constant_float, (pshader ? GL_LIMITS(pshader_constantsF) : GL_LIMITS(vshader_constantsF))); /* Temporary Output register */ diff --git a/reactos/dll/directx/wine/wined3d/baseshader.c b/reactos/dll/directx/wine/wined3d/baseshader.c index 8035abb0f40..1601acf68ac 100644 --- a/reactos/dll/directx/wine/wined3d/baseshader.c +++ b/reactos/dll/directx/wine/wined3d/baseshader.c @@ -37,7 +37,7 @@ static inline BOOL shader_is_version_token(DWORD token) { } int shader_addline( - SHADER_BUFFER* buffer, + SHADER_BUFFER* buffer, const char *format, ...) { char* base = buffer->buffer + buffer->bsize; @@ -48,7 +48,7 @@ int shader_addline( rc = vsnprintf(base, SHADER_PGMSIZE - 1 - buffer->bsize, format, args); va_end(args); - if (rc < 0 || /* C89 */ + if (rc < 0 || /* C89 */ rc > SHADER_PGMSIZE - 1 - buffer->bsize) { /* C99 */ ERR("The buffer allocated for the shader program string " @@ -90,7 +90,7 @@ const SHADER_OPCODE* shader_get_opcode( } ++i; } - FIXME("Unsupported opcode %#x(%d) masked %#x, shader version %#x\n", + FIXME("Unsupported opcode %#x(%d) masked %#x, shader version %#x\n", code, code, code & WINED3DSI_OPCODE_MASK, hex_version); return NULL; } @@ -133,10 +133,10 @@ static inline int shader_skip_opcode( } /* Read the parameters of an unrecognized opcode from the input stream - * Return the number of tokens read. - * + * Return the number of tokens read. + * * Note: This function assumes source or destination token format. - * It will not work with specially-formatted tokens like DEF or DCL, + * It will not work with specially-formatted tokens like DEF or DCL, * but hopefully those would be recognized */ int shader_skip_unrecognized( @@ -292,11 +292,11 @@ HRESULT shader_get_registers_used( WINED3DSIO_REP == curOpcode->opcode) { reg_maps->loop = 1; pToken += curOpcode->num_params; - + /* For subroutine prototypes */ } else if (WINED3DSIO_LABEL == curOpcode->opcode) { - DWORD snum = *pToken & WINED3DSP_REGNUM_MASK; + DWORD snum = *pToken & WINED3DSP_REGNUM_MASK; reg_maps->labels[snum] = 1; pToken += curOpcode->num_params; @@ -313,7 +313,7 @@ HRESULT shader_get_registers_used( int i, limit; /* Declare 1.X samplers implicitly, based on the destination reg. number */ - if (WINED3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) == 1 && + if (WINED3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) == 1 && (WINED3DSIO_TEX == curOpcode->opcode || WINED3DSIO_TEXBEM == curOpcode->opcode || WINED3DSIO_TEXBEML == curOpcode->opcode || @@ -364,10 +364,10 @@ HRESULT shader_get_registers_used( } /* This will loop over all the registers and try to - * make a bitmask of the ones we're interested in. + * make a bitmask of the ones we're interested in. * - * Relative addressing tokens are ignored, but that's - * okay, since we'll catch any address registers when + * Relative addressing tokens are ignored, but that's + * okay, since we'll catch any address registers when * they are initialized (required by spec) */ limit = (opcode_token & WINED3DSHADER_INSTRUCTION_PREDICATED)? @@ -406,7 +406,7 @@ HRESULT shader_get_registers_used( static void shader_dump_decl_usage( IWineD3DBaseShaderImpl* This, - DWORD decl, + DWORD decl, DWORD param) { DWORD regtype = shader_get_regtype(param); @@ -420,10 +420,10 @@ static void shader_dump_decl_usage( case WINED3DSTT_2D: TRACE("_2d"); break; case WINED3DSTT_CUBE: TRACE("_cube"); break; case WINED3DSTT_VOLUME: TRACE("_volume"); break; - default: TRACE("_unknown_ttype(%08x)", ttype); + default: TRACE("_unknown_ttype(%08x)", ttype); } - } else { + } else { DWORD usage = decl & WINED3DSP_DCL_USAGE_MASK; DWORD idx = (decl & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT; @@ -513,7 +513,7 @@ static void shader_dump_arr_entry( void shader_dump_param( IWineD3DBaseShader *iface, - const DWORD param, + const DWORD param, const DWORD addr_token, int input) { @@ -549,7 +549,7 @@ void shader_dump_param( else if (modifier == WINED3DSPSM_NOT) TRACE("!"); - if (modifier == WINED3DSPSM_ABS || modifier == WINED3DSPSM_ABSNEG) + if (modifier == WINED3DSPSM_ABS || modifier == WINED3DSPSM_ABSNEG) TRACE("abs("); } @@ -570,7 +570,7 @@ void shader_dump_param( break; case WINED3DSPR_TEXTURE: /* vs: case D3DSPR_ADDR */ TRACE("%c%u", (pshader? 't':'a'), reg); - break; + break; case WINED3DSPR_RASTOUT: TRACE("%s", rastout_reg_names[reg]); break; @@ -583,7 +583,7 @@ void shader_dump_param( case WINED3DSPR_ATTROUT: TRACE("oD%u", reg); break; - case WINED3DSPR_TEXCRDOUT: + case WINED3DSPR_TEXCRDOUT: /* Vertex shaders >= 3.0 use general purpose output registers * (WINED3DSPR_OUTPUT), which can include an address token */ @@ -592,7 +592,7 @@ void shader_dump_param( TRACE("o"); shader_dump_arr_entry(iface, param, addr_token, reg, input); } - else + else TRACE("oT%u", reg); break; case WINED3DSPR_CONSTINT: @@ -745,7 +745,7 @@ void shader_generate_main( /* Unknown opcode and its parameters */ if (NULL == curOpcode) { FIXME("Unrecognized opcode: token=%08x\n", hw_arg.opcode_token); - pToken += shader_skip_unrecognized(iface, pToken); + pToken += shader_skip_unrecognized(iface, pToken); /* Nothing to do */ } else if (WINED3DSIO_DCL == curOpcode->opcode || @@ -773,13 +773,13 @@ void shader_generate_main( } /* Predication token */ - if (hw_arg.opcode_token & WINED3DSHADER_INSTRUCTION_PREDICATED) + if (hw_arg.opcode_token & WINED3DSHADER_INSTRUCTION_PREDICATED) hw_arg.predicate = *pToken++; /* Other source tokens */ for (i = 0; i < (curOpcode->num_params - curOpcode->dst_token); i++) { - DWORD param, addr_token = 0; + DWORD param, addr_token = 0; pToken += shader_get_param(iface, pToken, ¶m, &addr_token); hw_arg.src[i] = param; hw_arg.src_addr[i] = addr_token; diff --git a/reactos/dll/directx/wine/wined3d/basetexture.c b/reactos/dll/directx/wine/wined3d/basetexture.c index 8df0b3e8bc3..6e4e60f03f4 100644 --- a/reactos/dll/directx/wine/wined3d/basetexture.c +++ b/reactos/dll/directx/wine/wined3d/basetexture.c @@ -259,7 +259,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) { glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); } } - + } else { /* this only happened if we've run out of openGL textures */ WARN("This texture doesn't have an openGL texture assigned to it\n"); hr = WINED3DERR_INVALIDCALL; diff --git a/reactos/dll/directx/wine/wined3d/cubetexture.c b/reactos/dll/directx/wine/wined3d/cubetexture.c index d91ee6ce9e5..92d671b7f09 100644 --- a/reactos/dll/directx/wine/wined3d/cubetexture.c +++ b/reactos/dll/directx/wine/wined3d/cubetexture.c @@ -227,8 +227,8 @@ static UINT WINAPI IWineD3DCubeTextureImpl_GetTextureDimensions(IWineD3DCubeText return GL_TEXTURE_CUBE_MAP_ARB; } -static void WINAPI IWineD3DCubeTextureImpl_ApplyStateChanges(IWineD3DCubeTexture *iface, - const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], +static void WINAPI IWineD3DCubeTextureImpl_ApplyStateChanges(IWineD3DCubeTexture *iface, + const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) { IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface; float matrix[16]; diff --git a/reactos/dll/directx/wine/wined3d/device.c b/reactos/dll/directx/wine/wined3d/device.c index 7b9d92ebae6..4ed528915f3 100644 --- a/reactos/dll/directx/wine/wined3d/device.c +++ b/reactos/dll/directx/wine/wined3d/device.c @@ -290,7 +290,7 @@ static void CreateVBO(IWineD3DVertexBufferImpl *object) { return; } -static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT Size, DWORD Usage, +static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *iface, UINT Size, DWORD Usage, DWORD FVF, WINED3DPOOL Pool, IWineD3DVertexBuffer** ppVertexBuffer, HANDLE *sharedHandle, IUnknown *parent) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; @@ -331,7 +331,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac * more. In this call we can convert dx7 buffers too. */ conv = ((FVF & WINED3DFVF_POSITION_MASK) == WINED3DFVF_XYZRHW ) || (FVF & (WINED3DFVF_DIFFUSE | WINED3DFVF_SPECULAR)); - if( GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT) && Pool != WINED3DPOOL_SYSTEMMEM && !(Usage & WINED3DUSAGE_DYNAMIC) && + if( GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT) && Pool != WINED3DPOOL_SYSTEMMEM && !(Usage & WINED3DUSAGE_DYNAMIC) && (dxVersion > 7 || !conv) ) { CreateVBO(object); } @@ -388,7 +388,7 @@ out: object->vbo = 0; } -static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface, UINT Length, DWORD Usage, +static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface, UINT Length, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, IWineD3DIndexBuffer** ppIndexBuffer, HANDLE *sharedHandle, IUnknown *parent) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; @@ -406,7 +406,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface CreateIndexBufferVBO(This, object); } - TRACE("(%p) : Len=%d, Use=%x, Format=(%u,%s), Pool=%d - Memory@%p, Iface@%p\n", This, Length, Usage, Format, + TRACE("(%p) : Len=%d, Use=%x, Format=(%u,%s), Pool=%d - Memory@%p, Iface@%p\n", This, Length, Usage, Format, debug_d3dformat(Format), Pool, object, object->resource.allocatedMemory); *ppIndexBuffer = (IWineD3DIndexBuffer *) object; @@ -434,7 +434,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, be freed due to circular dependencies */ return WINED3D_OK; } - + temp_result = allocate_shader_constants(object); if (WINED3D_OK != temp_result) return temp_result; @@ -625,24 +625,24 @@ MSDN: [in] Render targets are not lockable unless the application specifies TRUE for Lockable. Note that lockable render targets reduce performance on some graphics hardware. Discard - [in] Set this flag to TRUE to enable z-buffer discarding, and FALSE otherwise. + [in] Set this flag to TRUE to enable z-buffer discarding, and FALSE otherwise. If this flag is set, the contents of the depth stencil buffer will be invalid after calling either IDirect3DDevice9::Present or IDirect3DDevice9::SetDepthStencilSurface with a different depth surface. ******************************** */ - + static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Width, UINT Height, WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, IWineD3DSurface **ppSurface,WINED3DRESOURCETYPE Type, DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample ,DWORD MultisampleQuality, HANDLE* pSharedHandle, WINED3DSURFTYPE Impl, IUnknown *parent) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DSurfaceImpl *object; /*NOTE: impl ref allowed since this is a create function */ unsigned int Size = 1; const StaticPixelFormatDesc *tableEntry = getFormatDescEntry(Format, NULL, NULL); TRACE("(%p) Create surface\n",This); - - /** FIXME: Check ranges on the inputs are valid + + /** FIXME: Check ranges on the inputs are valid * MSDN * MultisampleQuality * [in] Quality level. The valid range is between zero and one less than the level - * returned by pQualityLevels used by IDirect3D9::CheckDeviceMultiSampleType. + * returned by pQualityLevels used by IDirect3D9::CheckDeviceMultiSampleType. * Passing a larger value returns the error WINED3DERR_INVALIDCALL. The MultisampleQuality * values of paired render targets, depth stencil surfaces, and the MultiSample type * must all match. @@ -813,7 +813,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U TRACE("Format %#x (%s), Pool %#x, ppTexture %p, pSharedHandle %p, parent %p\n", Format, debug_d3dformat(Format), Pool, ppTexture, pSharedHandle, parent); - /* TODO: It should only be possible to create textures for formats + /* TODO: It should only be possible to create textures for formats that are reported as supported */ if (WINED3DFMT_UNKNOWN >= Format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN\n", This); @@ -821,7 +821,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U } D3DCREATERESOURCEOBJECTINSTANCE(object, Texture, WINED3DRTYPE_TEXTURE, 0); - D3DINITIALIZEBASETEXTURE(object->baseTexture); + D3DINITIALIZEBASETEXTURE(object->baseTexture); object->width = Width; object->height = Height; @@ -899,7 +899,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa UINT tmpH; UINT tmpD; - /* TODO: It should only be possible to create textures for formats + /* TODO: It should only be possible to create textures for formats that are reported as supported */ if (WINED3DFMT_UNKNOWN >= Format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN\n", This); @@ -1008,7 +1008,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface HRESULT hr; unsigned int pow2EdgeLength = EdgeLength; - /* TODO: It should only be possible to create textures for formats + /* TODO: It should only be possible to create textures for formats that are reported as supported */ if (WINED3DFMT_UNKNOWN >= Format) { WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN\n", This); @@ -1776,7 +1776,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW object->parent = Parent; object->wineD3DDevice = This; object->palNumEntries = IWineD3DPaletteImpl_Size(Flags); - + object->hpal = CreatePalette((const LOGPALETTE*)&(object->palVersion)); if(!object->hpal) { @@ -3792,7 +3792,7 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo if( !doClip || ( (-rhw -eps < x) && (-rhw -eps < y) && ( -eps < z) && - (x <= rhw + eps) && (y <= rhw + eps ) && (z <= rhw + eps) && + (x <= rhw + eps) && (y <= rhw + eps ) && (z <= rhw + eps) && ( rhw > eps ) ) ) { /* "Normal" viewport transformation (not clipped) @@ -3887,7 +3887,7 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo } if (DestFVF & WINED3DFVF_DIFFUSE) { - DWORD *color_d = + DWORD *color_d = (DWORD *) (((char *) lpStrideData->u.s.diffuse.lpData) + i * lpStrideData->u.s.diffuse.dwStride); if(!color_d) { static BOOL warned = FALSE; @@ -3916,9 +3916,9 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo } } - if (DestFVF & WINED3DFVF_SPECULAR) { + if (DestFVF & WINED3DFVF_SPECULAR) { /* What's the color value in the feedback buffer? */ - DWORD *color_s = + DWORD *color_s = (DWORD *) (((char *) lpStrideData->u.s.specular.lpData) + i * lpStrideData->u.s.specular.dwStride); if(!color_s) { static BOOL warned = FALSE; @@ -3949,7 +3949,7 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo for (tex_index = 0; tex_index < numTextures; tex_index++) { float *tex_coord = - (float *) (((char *) lpStrideData->u.s.texCoords[tex_index].lpData) + + (float *) (((char *) lpStrideData->u.s.texCoords[tex_index].lpData) + i * lpStrideData->u.s.texCoords[tex_index].dwStride); if(!tex_coord) { ERR("No source texture, but destination requests one\n"); @@ -4153,7 +4153,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD oldTexture = This->updateStateBlock->textures[Stage]; if(pTexture != NULL) { - /* SetTexture isn't allowed on textures in WINED3DPOOL_SCRATCH; + /* SetTexture isn't allowed on textures in WINED3DPOOL_SCRATCH; */ if(((IWineD3DTextureImpl*)pTexture)->resource.pool == WINED3DPOOL_SCRATCH) { WARN("(%p) Attempt to set scratch texture rejected\n", pTexture); @@ -4345,11 +4345,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface) int i; ERR("(%p)\n", This); - + if (This->isRecordingState) { return WINED3DERR_INVALIDCALL; } - + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3DStateBlockImpl)); if (NULL == object ) { FIXME("(%p)Error allocating memory for stateblock\n", This); @@ -6522,7 +6522,7 @@ static void WINAPI IWineD3DDeviceImpl_RemoveResource(IWineD3DDevice *iface, IWin IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; ResourceList* resourceList = NULL; ResourceList* previousResourceList = NULL; - + TRACE("(%p) : resource %p\n", This, resource); resourceList = This->resources; diff --git a/reactos/dll/directx/wine/wined3d/directx.c b/reactos/dll/directx/wine/wined3d/directx.c index e9b2acada7d..98b350585db 100644 --- a/reactos/dll/directx/wine/wined3d/directx.c +++ b/reactos/dll/directx/wine/wined3d/directx.c @@ -453,7 +453,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { gl_info->gl_vendor = VENDOR_NVIDIA; } else if (strstr(gl_string, "ATI")) { gl_info->gl_vendor = VENDOR_ATI; - } else if (strstr(gl_string, "Intel(R)") || + } else if (strstr(gl_string, "Intel(R)") || strstr(gl_info->gl_renderer, "Intel(R)")) { gl_info->gl_vendor = VENDOR_INTEL; } else if (strstr(gl_string, "Mesa")) { @@ -842,7 +842,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { * without a full database we can return a card with similar features. Second the size of the database * can be made quite small because when you know what type of 3d functionality a card has, you know to which * GPU family the GPU must belong. Because of this you only have to check a small part of the renderer string - * to distinguishes between different models from that family. + * to distinguishes between different models from that family. */ switch (gl_info->gl_vendor) { case VENDOR_NVIDIA: @@ -914,7 +914,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { strstr(gl_info->gl_renderer, "X1300") || strstr(gl_info->gl_renderer, "X1400")) gl_info->gl_card = CARD_ATI_RADEON_X700; - /* Radeon R3xx */ + /* Radeon R3xx */ else gl_info->gl_card = CARD_ATI_RADEON_9500; /* Radeon 9500/9550/9600/9700/9800/X300/X550/X600 */ } else if(WINE_D3D8_CAPABLE(gl_info)) { @@ -942,7 +942,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { case VENDOR_MESA: case VENDOR_WINE: default: - /* Default to generic Nvidia hardware based on the supported OpenGL extensions. The choice + /* Default to generic Nvidia hardware based on the supported OpenGL extensions. The choice * for Nvidia was because the hardware and drivers they make are of good quality. This makes * them a good generic choice. */ @@ -950,7 +950,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { if(WINE_D3D9_CAPABLE(gl_info)) gl_info->gl_card = CARD_NVIDIA_GEFORCEFX_5600; else if(WINE_D3D8_CAPABLE(gl_info)) - gl_info->gl_card = CARD_NVIDIA_GEFORCE3; + gl_info->gl_card = CARD_NVIDIA_GEFORCE3; else if(WINE_D3D7_CAPABLE(gl_info)) gl_info->gl_card = CARD_NVIDIA_GEFORCE; else if(WINE_D3D6_CAPABLE(gl_info)) @@ -1403,7 +1403,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDepthStencilMatch(IWineD3D *iface, UINT return WINED3DERR_NOTAVAILABLE; } -static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, +static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT SurfaceFormat, BOOL Windowed, WINED3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) { @@ -1477,7 +1477,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter } #define GLINFO_LOCATION Adapters[Adapter].gl_info -static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, +static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT AdapterFormat, DWORD Usage, WINED3DRESOURCETYPE RType, WINED3DFORMAT CheckFormat) { IWineD3DImpl *This = (IWineD3DImpl *)iface; TRACE_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, DevType:(%u,%s), AdptFmt:(%u,%s), Use:(%u,%s,%s), ResTyp:(%x,%s), CheckFmt:(%u,%s))\n", @@ -2189,7 +2189,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, WINED3DVTXPCAPS_LOCALVIEWER | WINED3DVTXPCAPS_VERTEXFOG | WINED3DVTXPCAPS_TEXGEN; - /* FIXME: Add + /* FIXME: Add D3DVTXPCAPS_TWEENING, D3DVTXPCAPS_TEXGEN_SPHEREMAP */ *pCaps->MaxPrimitiveCount = 0xFFFFF; /* For now set 2^20-1 which is used by most >=Geforce3/Radeon8500 cards */ @@ -2271,13 +2271,13 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, *pCaps->NumSimultaneousRTs = GL_LIMITS(buffers); - + *pCaps->StretchRectFilterCaps = WINED3DPTFILTERCAPS_MINFPOINT | WINED3DPTFILTERCAPS_MAGFPOINT | WINED3DPTFILTERCAPS_MINFLINEAR | WINED3DPTFILTERCAPS_MAGFLINEAR; *pCaps->VertexTextureFilterCaps = 0; - + if(*pCaps->VertexShaderVersion == WINED3DVS_VERSION(3,0)) { /* Where possible set the caps based on OpenGL extensions and if they aren't set (in case of software rendering) use the VS 3.0 from MSDN or else if there's OpenGL spec use a hardcoded value minimum VS3.0 value. */ @@ -2292,7 +2292,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, *pCaps->VS20Caps.Caps = 0; *pCaps->VS20Caps.DynamicFlowControlDepth = WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH; *pCaps->VS20Caps.NumTemps = max(12, GLINFO_LOCATION.vs_arb_max_temps); - *pCaps->VS20Caps.StaticFlowControlDepth = 1; + *pCaps->VS20Caps.StaticFlowControlDepth = 1; *pCaps->MaxVShaderInstructionsExecuted = 65535; *pCaps->MaxVertexShader30InstructionSlots = 0; @@ -2300,16 +2300,16 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, *pCaps->VS20Caps.Caps = 0; *pCaps->VS20Caps.DynamicFlowControlDepth = 0; *pCaps->VS20Caps.NumTemps = 0; - *pCaps->VS20Caps.StaticFlowControlDepth = 0; + *pCaps->VS20Caps.StaticFlowControlDepth = 0; *pCaps->MaxVShaderInstructionsExecuted = 0; - *pCaps->MaxVertexShader30InstructionSlots = 0; + *pCaps->MaxVertexShader30InstructionSlots = 0; } if(*pCaps->PixelShaderVersion == WINED3DPS_VERSION(3,0)) { /* Where possible set the caps based on OpenGL extensions and if they aren't set (in case of software rendering) use the PS 3.0 from MSDN or else if there's OpenGL spec use a hardcoded value minimum PS 3.0 value. */ - + /* Caps is more or less undocumented on MSDN but it appears to be used for PS20Caps based on results from R9600/FX5900/Geforce6800 cards from Windows */ *pCaps->PS20Caps.Caps = WINED3DPS20CAPS_ARBITRARYSWIZZLE | WINED3DPS20CAPS_GRADIENTINSTRUCTIONS | diff --git a/reactos/dll/directx/wine/wined3d/drawprim.c b/reactos/dll/directx/wine/wined3d/drawprim.c index e6766a24b4b..5e4e98d51a6 100644 --- a/reactos/dll/directx/wine/wined3d/drawprim.c +++ b/reactos/dll/directx/wine/wined3d/drawprim.c @@ -493,7 +493,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData D3DCOLOR_B_G(diffuseColor), D3DCOLOR_B_B(diffuseColor), D3DCOLOR_B_A(diffuseColor)); - VTRACE(("glColor4ub: r,g,b,a=%lu,%lu,%lu,%lu\n", + VTRACE(("glColor4ub: r,g,b,a=%lu,%lu,%lu,%lu\n", D3DCOLOR_B_R(diffuseColor), D3DCOLOR_B_G(diffuseColor), D3DCOLOR_B_B(diffuseColor), @@ -535,9 +535,9 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData } } - VTRACE(("glSecondaryColor4ub: r,g,b=%lu,%lu,%lu\n", - D3DCOLOR_B_R(specularColor), - D3DCOLOR_B_G(specularColor), + VTRACE(("glSecondaryColor4ub: r,g,b=%lu,%lu,%lu\n", + D3DCOLOR_B_R(specularColor), + D3DCOLOR_B_G(specularColor), D3DCOLOR_B_B(specularColor))); if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { GL_EXTCALL(glSecondaryColor3ubEXT)( @@ -1110,7 +1110,7 @@ if(stridedlcl.u.s.type.VBO) { \ #ifdef SHOW_FRAME_MAKEUP { static long int primCounter = 0; - /* NOTE: set primCounter to the value reported by drawprim + /* NOTE: set primCounter to the value reported by drawprim before you want to to write frame makeup to /tmp */ if (primCounter >= 0) { WINED3DLOCKED_RECT r; diff --git a/reactos/dll/directx/wine/wined3d/glsl_shader.c b/reactos/dll/directx/wine/wined3d/glsl_shader.c index a39caf42fdf..6684ffe824b 100644 --- a/reactos/dll/directx/wine/wined3d/glsl_shader.c +++ b/reactos/dll/directx/wine/wined3d/glsl_shader.c @@ -1,7 +1,7 @@ /* * GLSL pixel and vertex shader implementation * - * Copyright 2006 Jason Green + * Copyright 2006 Jason Green * Copyright 2006-2007 Henri Verbeet * * This library is free software; you can redistribute it and/or @@ -53,7 +53,7 @@ typedef struct { /** Prints the GLSL info log which will contain error messages if they exist */ void print_glsl_info_log(WineD3D_GL_Info *gl_info, GLhandleARB obj) { - + int infologLength = 0; char *infoLog; @@ -124,7 +124,7 @@ static void shader_glsl_load_vsamplers(WineD3D_GL_Info *gl_info, IWineD3DStateBl } } -/** +/** * Loads floating point constants (aka uniforms) into the currently set GLSL program. * When constant_list == NULL, it will load all the constants. */ @@ -187,7 +187,7 @@ static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl* This, WineD3D_GL checkGLcall("glUniform4fvARB()"); } -/** +/** * Loads integer constants (aka uniforms) into the currently set GLSL program. * When @constants_set == NULL, it will load all the constants. */ @@ -198,7 +198,7 @@ static void shader_glsl_load_constantsI( unsigned max_constants, int* constants, BOOL* constants_set) { - + GLhandleARB tmp_loc; int i; char tmp_name[8]; @@ -212,7 +212,7 @@ static void shader_glsl_load_constantsI( TRACE_(d3d_constants)("Loading constants %i: %i, %i, %i, %i\n", i, constants[i*4], constants[i*4+1], constants[i*4+2], constants[i*4+3]); - /* TODO: Benchmark and see if it would be beneficial to store the + /* TODO: Benchmark and see if it would be beneficial to store the * locations of the constants to avoid looking up each time */ _snprintf(tmp_name, sizeof(tmp_name), "%s[%i]", prefix, i); tmp_loc = GL_EXTCALL(glGetUniformLocationARB(programId, tmp_name)); @@ -245,7 +245,7 @@ static void shader_glsl_load_constantsI( } } -/** +/** * Loads boolean constants (aka uniforms) into the currently set GLSL program. * When @constants_set == NULL, it will load all the constants. */ @@ -256,7 +256,7 @@ static void shader_glsl_load_constantsB( unsigned max_constants, BOOL* constants, BOOL* constants_set) { - + GLhandleARB tmp_loc; int i; char tmp_name[8]; @@ -269,7 +269,7 @@ static void shader_glsl_load_constantsB( TRACE_(d3d_constants)("Loading constants %i: %i;\n", i, constants[i*4]); - /* TODO: Benchmark and see if it would be beneficial to store the + /* TODO: Benchmark and see if it would be beneficial to store the * locations of the constants to avoid looking up each time */ _snprintf(tmp_name, sizeof(tmp_name), "%s[%i]", prefix, i); tmp_loc = GL_EXTCALL(glGetUniformLocationARB(programId, tmp_name)); @@ -310,7 +310,7 @@ void shader_glsl_load_constants( IWineD3DDevice* device, char usePixelShader, char useVertexShader) { - + IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device; IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock; WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; @@ -373,12 +373,12 @@ void shader_glsl_load_constants( /* Load DirectX 9 integer constants/uniforms for pixel shader */ shader_glsl_load_constantsI(pshader, gl_info, programId, MAX_CONST_I, - stateBlock->pixelShaderConstantI, + stateBlock->pixelShaderConstantI, stateBlock->changed.pixelShaderConstantsI); /* Load DirectX 9 boolean constants/uniforms for pixel shader */ shader_glsl_load_constantsB(pshader, gl_info, programId, MAX_CONST_B, - stateBlock->pixelShaderConstantB, + stateBlock->pixelShaderConstantB, stateBlock->changed.pixelShaderConstantsB); /* Upload the environment bump map matrix if needed. The needsbumpmat member specifies the texture stage to load the matrix from. @@ -416,7 +416,7 @@ void shader_generate_glsl_declarations( /* Declare the constants (aka uniforms) */ if (This->baseShader.limits.constant_float > 0) { - unsigned max_constantsF = min(This->baseShader.limits.constant_float, + unsigned max_constantsF = min(This->baseShader.limits.constant_float, (pshader ? GL_LIMITS(pshader_constantsF) : GL_LIMITS(vshader_constantsF))); shader_addline(buffer, "uniform vec4 %cC[%u];\n", prefix, max_constantsF); } @@ -432,7 +432,7 @@ void shader_generate_glsl_declarations( else if(reg_maps->bumpmat != -1) shader_addline(buffer, "uniform mat2 bumpenvmat;\n"); - /* Declare texture samplers */ + /* Declare texture samplers */ for (i = 0; i < This->baseShader.limits.sampler; i++) { if (reg_maps->samplers[i]) { @@ -458,7 +458,7 @@ void shader_generate_glsl_declarations( } } } - + /* Declare address variables */ for (i = 0; i < This->baseShader.limits.address; i++) { if (reg_maps->address[i]) @@ -467,7 +467,7 @@ void shader_generate_glsl_declarations( /* Declare texture coordinate temporaries and initialize them */ for (i = 0; i < This->baseShader.limits.texcoord; i++) { - if (reg_maps->texcoord[i]) + if (reg_maps->texcoord[i]) shader_addline(buffer, "vec4 T%lu = gl_TexCoord[%lu];\n", i, i); } @@ -500,7 +500,7 @@ void shader_generate_glsl_declarations( shader_addline(buffer, "int aL;\n"); shader_addline(buffer, "int tmpInt;\n"); } - + /* Temporary variables for matrix operations */ shader_addline(buffer, "vec4 tmp0;\n"); shader_addline(buffer, "vec4 tmp1;\n"); @@ -521,22 +521,22 @@ static void shader_glsl_add_src_param(SHADER_OPCODE_ARG* arg, const DWORD param, /** Used for opcode modifiers - They multiply the result by the specified amount */ static const char * const shift_glsl_tab[] = { - "", /* 0 (none) */ - "2.0 * ", /* 1 (x2) */ - "4.0 * ", /* 2 (x4) */ - "8.0 * ", /* 3 (x8) */ - "16.0 * ", /* 4 (x16) */ - "32.0 * ", /* 5 (x32) */ - "", /* 6 (x64) */ - "", /* 7 (x128) */ - "", /* 8 (d256) */ - "", /* 9 (d128) */ - "", /* 10 (d64) */ - "", /* 11 (d32) */ - "0.0625 * ", /* 12 (d16) */ - "0.125 * ", /* 13 (d8) */ - "0.25 * ", /* 14 (d4) */ - "0.5 * " /* 15 (d2) */ + "", /* 0 (none) */ + "2.0 * ", /* 1 (x2) */ + "4.0 * ", /* 2 (x4) */ + "8.0 * ", /* 3 (x8) */ + "16.0 * ", /* 4 (x16) */ + "32.0 * ", /* 5 (x32) */ + "", /* 6 (x64) */ + "", /* 7 (x128) */ + "", /* 8 (d256) */ + "", /* 9 (d128) */ + "", /* 10 (d64) */ + "", /* 11 (d32) */ + "0.0625 * ", /* 12 (d16) */ + "0.125 * ", /* 13 (d8) */ + "0.25 * ", /* 14 (d4) */ + "0.5 * " /* 15 (d2) */ }; /* Generate a GLSL parameter that does the input modifier computation and return the input register/mask to use */ @@ -547,7 +547,7 @@ static void shader_glsl_gen_modifier ( char *out_str) { out_str[0] = 0; - + if (instr == WINED3DSIO_TEXKILL) return; @@ -617,8 +617,8 @@ static void shader_glsl_get_register_name( char pshader = shader_is_pshader_version(This->baseShader.hex_version); char tmpStr[50]; - *is_color = FALSE; - + *is_color = FALSE; + switch (regtype) { case WINED3DSPR_TEMP: sprintf(tmpStr, "R%u", reg); @@ -638,7 +638,7 @@ static void shader_glsl_get_register_name( if (vshader_input_is_color((IWineD3DVertexShader*) This, reg)) *is_color = TRUE; sprintf(tmpStr, "attrib%u", reg); - } + } break; case WINED3DSPR_CONST: { @@ -647,7 +647,7 @@ static void shader_glsl_get_register_name( /* Relative addressing */ if (param & WINED3DSHADER_ADDRMODE_RELATIVE) { - /* Relative addressing on shaders 2.0+ have a relative address token, + /* Relative addressing on shaders 2.0+ have a relative address token, * prior to that, it was hard-coded as "A0.x" because there's only 1 register */ if (WINED3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) >= 2) { glsl_src_param_t rel_param; @@ -846,9 +846,9 @@ static DWORD shader_glsl_append_dst(SHADER_BUFFER *buffer, SHADER_OPCODE_ARG *ar /** Process GLSL instruction modifiers */ void shader_glsl_add_instruction_modifiers(SHADER_OPCODE_ARG* arg) { - + DWORD mask = arg->dst & WINED3DSP_DSTMOD_MASK; - + if (arg->opcode->dst_token && mask != 0) { glsl_dst_param_t dst_param; @@ -913,9 +913,9 @@ static void shader_glsl_get_sample_function(DWORD sampler_type, BOOL projected, /***************************************************************************** - * + * * Begin processing individual instruction opcodes - * + * ****************************************************************************/ /* Generate GLSL arithmetic functions (dst = src1 + src2) */ @@ -1286,13 +1286,13 @@ void shader_glsl_mad(SHADER_OPCODE_ARG* arg) { src0_param.param_str, src1_param.param_str, src2_param.param_str); } -/** Handles transforming all WINED3DSIO_M?x? opcodes for +/** Handles transforming all WINED3DSIO_M?x? opcodes for Vertex shaders to GLSL codes */ void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg) { int i; int nComponents = 0; SHADER_OPCODE_ARG tmpArg; - + memset(&tmpArg, 0, sizeof(SHADER_OPCODE_ARG)); /* Set constants for the temporary argument */ @@ -1301,8 +1301,8 @@ void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg) { tmpArg.src[0] = arg->src[0]; tmpArg.src_addr[0] = arg->src_addr[0]; tmpArg.src_addr[1] = arg->src_addr[1]; - tmpArg.reg_maps = arg->reg_maps; - + tmpArg.reg_maps = arg->reg_maps; + switch(arg->opcode->opcode) { case WINED3DSIO_M4x4: nComponents = 4; @@ -1336,7 +1336,7 @@ void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg) { } /** - The LRP instruction performs a component-wise linear interpolation + The LRP instruction performs a component-wise linear interpolation between the second and third operands using the first operand as the blend factor. Equation: (dst = src2 + src0 * (src1 - src2)) This is equivalent to mix(src2, src1, src0); @@ -1408,7 +1408,7 @@ void shader_glsl_dst(SHADER_OPCODE_ARG* arg) { /** Process the WINED3DSIO_SINCOS instruction in GLSL: * VS 2.0 requires that specific cosine and sine constants be passed to this instruction so the hardware * can handle it. But, these functions are built-in for GLSL, so we can just ignore the last 2 params. - * + * * dst.x = cos(src0.?) * dst.y = sin(src0.?) * dst.z = dst.z @@ -1450,7 +1450,7 @@ void shader_glsl_loop(SHADER_OPCODE_ARG* arg) { glsl_src_param_t src1_param; shader_glsl_add_src_param(arg, arg->src[1], arg->src_addr[1], WINED3DSP_WRITEMASK_ALL, &src1_param); - + shader_addline(arg->buffer, "for (tmpInt = 0, aL = %s.y; tmpInt < %s.x; tmpInt++, aL += %s.z) {\n", src1_param.reg_name, src1_param.reg_name, src1_param.reg_name); } @@ -1643,7 +1643,7 @@ void shader_glsl_texldl(SHADER_OPCODE_ARG* arg) { void pshader_glsl_texcoord(SHADER_OPCODE_ARG* arg) { /* FIXME: Make this work for more than just 2D textures */ - + IWineD3DPixelShaderImpl* This = (IWineD3DPixelShaderImpl*) arg->shader; SHADER_BUFFER* buffer = arg->buffer; DWORD hex_version = This->baseShader.hex_version; @@ -1841,7 +1841,7 @@ void pshader_glsl_texm3x3(SHADER_OPCODE_ARG* arg) { current_state->current_row = 0; } -/** Process the WINED3DSIO_TEXM3X3SPEC instruction in GLSL +/** Process the WINED3DSIO_TEXM3X3SPEC instruction in GLSL * Peform the final texture lookup based on the previous 2 3x3 matrix multiplies */ void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg) { @@ -1876,7 +1876,7 @@ void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg) { current_state->current_row = 0; } -/** Process the WINED3DSIO_TEXM3X3VSPEC instruction in GLSL +/** Process the WINED3DSIO_TEXM3X3VSPEC instruction in GLSL * Peform the final texture lookup based on the previous 2 3x3 matrix multiplies */ void pshader_glsl_texm3x3vspec(SHADER_OPCODE_ARG* arg) { diff --git a/reactos/dll/directx/wine/wined3d/pixelshader.c b/reactos/dll/directx/wine/wined3d/pixelshader.c index 163453bcc14..50899f03edf 100644 --- a/reactos/dll/directx/wine/wined3d/pixelshader.c +++ b/reactos/dll/directx/wine/wined3d/pixelshader.c @@ -262,7 +262,7 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = { }; static void pshader_set_limits( - IWineD3DPixelShaderImpl *This) { + IWineD3DPixelShaderImpl *This) { This->baseShader.limits.attributes = 0; This->baseShader.limits.address = 0; @@ -272,7 +272,7 @@ static void pshader_set_limits( case WINED3DPS_VERSION(1,0): case WINED3DPS_VERSION(1,1): case WINED3DPS_VERSION(1,2): - case WINED3DPS_VERSION(1,3): + case WINED3DPS_VERSION(1,3): This->baseShader.limits.temporary = 2; This->baseShader.limits.constant_float = 8; This->baseShader.limits.constant_int = 0; @@ -293,8 +293,8 @@ static void pshader_set_limits( This->baseShader.limits.packed_input = 0; This->baseShader.limits.label = 0; break; - - /* FIXME: temporaries must match D3DPSHADERCAPS2_0.NumTemps */ + + /* FIXME: temporaries must match D3DPSHADERCAPS2_0.NumTemps */ case WINED3DPS_VERSION(2,0): This->baseShader.limits.temporary = 32; This->baseShader.limits.constant_float = 32; @@ -335,7 +335,7 @@ static void pshader_set_limits( This->baseShader.limits.sampler = 16; This->baseShader.limits.packed_input = 0; This->baseShader.limits.label = 0; - FIXME("Unrecognized pixel shader version %#x\n", + FIXME("Unrecognized pixel shader version %#x\n", This->baseShader.hex_version); } } @@ -360,7 +360,7 @@ static inline VOID IWineD3DPixelShaderImpl_GenerateShader( } buffer.buffer = This->device->fixupVertexBuffer; #else - buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SHADER_PGMSIZE); + buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SHADER_PGMSIZE); #endif buffer.bsize = 0; buffer.lineNo = 0; @@ -456,7 +456,7 @@ static inline VOID IWineD3DPixelShaderImpl_GenerateShader( shader_addline(&buffer, "MOV result.color.a, TMP_COLOR.a;\n"); } - shader_addline(&buffer, "END\n"); + shader_addline(&buffer, "END\n"); /* TODO: change to resource.glObjectHandle or something like that */ GL_EXTCALL(glGenProgramsARB(1, &This->baseShader.prgId)); diff --git a/reactos/dll/directx/wine/wined3d/resource.c b/reactos/dll/directx/wine/wined3d/resource.c index 6999f060c05..0d3cf04e788 100644 --- a/reactos/dll/directx/wine/wined3d/resource.c +++ b/reactos/dll/directx/wine/wined3d/resource.c @@ -47,7 +47,7 @@ ULONG WINAPI IWineD3DResourceImpl_AddRef(IWineD3DResource *iface) { IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; ULONG ref = InterlockedIncrement(&This->resource.ref); TRACE("(%p) : AddRef increasing from %d\n", This, ref - 1); - return ref; + return ref; } ULONG WINAPI IWineD3DResourceImpl_Release(IWineD3DResource *iface) { diff --git a/reactos/dll/directx/wine/wined3d/state.c b/reactos/dll/directx/wine/wined3d/state.c index 9a768d13230..10279ce2616 100644 --- a/reactos/dll/directx/wine/wined3d/state.c +++ b/reactos/dll/directx/wine/wined3d/state.c @@ -2216,7 +2216,7 @@ static void shaderconstant(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine isStateDirty(context, STATE_PIXELSHADER)) { return; } - + device->shader_backend->shader_load_constants((IWineD3DDevice *) device, use_ps(device), use_vs(device)); } diff --git a/reactos/dll/directx/wine/wined3d/stateblock.c b/reactos/dll/directx/wine/wined3d/stateblock.c index 772bd788719..cd29351f218 100644 --- a/reactos/dll/directx/wine/wined3d/stateblock.c +++ b/reactos/dll/directx/wine/wined3d/stateblock.c @@ -30,11 +30,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); * Stateblock helper functions follow **************************************/ -/** Allocates the correct amount of space for pixel and vertex shader constants, +/** Allocates the correct amount of space for pixel and vertex shader constants, * along with their set/changed flags on the given stateblock object */ HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object) { - + IWineD3DStateBlockImpl *This = object; #define WINED3D_MEMCHECK(_object) if (NULL == _object) { FIXME("Out of memory!\n"); return E_OUTOFMEMORY; } @@ -66,7 +66,7 @@ void stateblock_savedstates_copy( IWineD3DStateBlock* iface, SAVEDSTATES* dest, SAVEDSTATES* source) { - + IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; unsigned bsize = sizeof(BOOL); @@ -104,7 +104,7 @@ void stateblock_savedstates_set( IWineD3DStateBlock* iface, SAVEDSTATES* states, BOOL value) { - + IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; unsigned bsize = sizeof(BOOL); @@ -196,7 +196,7 @@ void stateblock_copy( memcpy(Dest->vertexShaderConstantI, This->vertexShaderConstantI, sizeof(INT) * MAX_CONST_I * 4); memcpy(Dest->pixelShaderConstantB, This->pixelShaderConstantB, sizeof(BOOL) * MAX_CONST_B); memcpy(Dest->pixelShaderConstantI, This->pixelShaderConstantI, sizeof(INT) * MAX_CONST_I * 4); - + memcpy(Dest->streamStride, This->streamStride, sizeof(UINT) * MAX_STREAMS); memcpy(Dest->streamOffset, This->streamOffset, sizeof(UINT) * MAX_STREAMS); memcpy(Dest->streamSource, This->streamSource, sizeof(IWineD3DVertexBuffer*) * MAX_STREAMS); diff --git a/reactos/dll/directx/wine/wined3d/surface.c b/reactos/dll/directx/wine/wined3d/surface.c index 58b4ed61450..76076b1f9b6 100644 --- a/reactos/dll/directx/wine/wined3d/surface.c +++ b/reactos/dll/directx/wine/wined3d/surface.c @@ -988,7 +988,7 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) { case WINED3DFMT_X8R8G8B8: { - /* make sure the X byte is set to alpha on, since it + /* make sure the X byte is set to alpha on, since it could be any random value. This fixes the intro movie in Pirates! */ int size; unsigned int *data; @@ -2444,7 +2444,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DS if( !(This->resource.usage & WINED3DUSAGE_RENDERTARGET) ) return WINEDDERR_NOTFLIPPABLE; if(override) { - /* DDraw sets this for the X11 surfaces, so don't confuse the user + /* DDraw sets this for the X11 surfaces, so don't confuse the user * FIXME("(%p) Target override is not supported by now\n", This); * Additionally, it isn't really possible to support triple-buffering * properly on opengl at all @@ -3428,7 +3428,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPa IWineD3DPaletteImpl *PalImpl = (IWineD3DPaletteImpl *) Pal; TRACE("(%p)->(%p)\n", This, Pal); - if(This->palette != NULL) + if(This->palette != NULL) if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) This->palette->Flags &= ~WINEDDPCAPS_PRIMARYSURFACE; diff --git a/reactos/dll/directx/wine/wined3d/surface_gdi.c b/reactos/dll/directx/wine/wined3d/surface_gdi.c index 9f498825cdc..d92e588912f 100644 --- a/reactos/dll/directx/wine/wined3d/surface_gdi.c +++ b/reactos/dll/directx/wine/wined3d/surface_gdi.c @@ -1465,7 +1465,7 @@ const char* filename) for (y = 0; y < This->pow2Height; y++) { unsigned char *src = (unsigned char *) This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); - for (x = 0; x < This->pow2Width; x++) { + for (x = 0; x < This->pow2Width; x++) { unsigned int color; unsigned int comp; int i; diff --git a/reactos/dll/directx/wine/wined3d/vertexshader.c b/reactos/dll/directx/wine/wined3d/vertexshader.c index 1c95d65c155..2af28f60150 100644 --- a/reactos/dll/directx/wine/wined3d/vertexshader.c +++ b/reactos/dll/directx/wine/wined3d/vertexshader.c @@ -181,7 +181,7 @@ static void vshader_set_limits( This->baseShader.limits.sampler = 0; This->baseShader.limits.label = 0; break; - + case WINED3DVS_VERSION(2,0): case WINED3DVS_VERSION(2,1): This->baseShader.limits.temporary = 12; @@ -315,7 +315,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( } buffer.buffer = This->device->fixupVertexBuffer; #else - buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SHADER_PGMSIZE); + buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SHADER_PGMSIZE); #endif buffer.bsize = 0; buffer.lineNo = 0; @@ -339,7 +339,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( /* If this shader doesn't use fog copy the z coord to the fog coord so that we can use table fog */ if (!reg_maps->fog) shader_addline(&buffer, "gl_FogFragCoord = gl_Position.z;\n"); - + /* Write the final position. * * OpenGL coordinates specify the center of the pixel while d3d coords specify @@ -371,7 +371,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( /* Mesa supports only 95 constants */ if (GL_VEND(MESA) || GL_VEND(WINE)) - This->baseShader.limits.constant_float = + This->baseShader.limits.constant_float = min(95, This->baseShader.limits.constant_float); /* Base Declarations */ @@ -401,8 +401,8 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( shader_addline(&buffer, "MUL TMP_OUT.y, TMP_OUT.y, posFixup.y;\n"); shader_addline(&buffer, "MOV result.position, TMP_OUT;\n"); - - shader_addline(&buffer, "END\n"); + + shader_addline(&buffer, "END\n"); /* TODO: change to resource.glObjectHandle or something like that */ GL_EXTCALL(glGenProgramsARB(1, &This->baseShader.prgId)); @@ -436,7 +436,7 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_QueryInterface(IWineD3DVertexShad { IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *)iface; TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj); - if (IsEqualGUID(riid, &IID_IUnknown) + if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IWineD3DBase) || IsEqualGUID(riid, &IID_IWineD3DBaseShader) || IsEqualGUID(riid, &IID_IWineD3DVertexShader)) { @@ -495,7 +495,7 @@ static ULONG WINAPI IWineD3DVertexShaderImpl_Release(IWineD3DVertexShader *iface static HRESULT WINAPI IWineD3DVertexShaderImpl_GetParent(IWineD3DVertexShader *iface, IUnknown** parent){ IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *)iface; - + *parent = This->parent; IUnknown_AddRef(*parent); TRACE("(%p) : returning %p\n", This, *parent); diff --git a/reactos/dll/directx/wine/wined3d/wined3d.rbuild b/reactos/dll/directx/wine/wined3d/wined3d.rbuild index 9b57598677f..7fadc051a2f 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d.rbuild +++ b/reactos/dll/directx/wine/wined3d/wined3d.rbuild @@ -1,6 +1,6 @@ - + . include/reactos/wine diff --git a/reactos/dll/directx/wine/wined3d/wined3d_main.c b/reactos/dll/directx/wine/wined3d/wined3d_main.c index 13ab258dbb8..325e4ae4ad4 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d_main.c +++ b/reactos/dll/directx/wine/wined3d/wined3d_main.c @@ -34,7 +34,7 @@ void (*wine_tsx11_unlock_ptr)(void) = NULL; /* When updating default value here, make sure to update winecfg as well, * where appropriate. */ -wined3d_settings_t wined3d_settings = +wined3d_settings_t wined3d_settings = { VS_HW, /* Hardware by default */ PS_HW, /* Hardware by default */ diff --git a/reactos/dll/directx/wine/wined3d/wined3d_private.h b/reactos/dll/directx/wine/wined3d/wined3d_private.h index 73e83d24ace..03eec3dd181 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d_private.h +++ b/reactos/dll/directx/wine/wined3d/wined3d_private.h @@ -158,7 +158,7 @@ static WINED3DGLTYPE const glTypeLookup[WINED3DDECLTYPE_UNUSED] = { #define WINED3D_ATR_TYPESIZE(type) glTypeLookup[type].typesize /** - * Settings + * Settings */ #define VS_NONE 0 #define VS_HW 1 @@ -270,7 +270,7 @@ extern int num_lock; #define MAX_STREAMS 16 /* Maximum possible streams - used for fixed size arrays See MaxStreams in MSDN under GetDeviceCaps */ /* Maximum number of constants provided to the shaders */ -#define HIGHEST_TRANSFORMSTATE 512 +#define HIGHEST_TRANSFORMSTATE 512 /* Highest value in WINED3DTRANSFORMSTATETYPE */ #define MAX_PALETTES 256 @@ -287,7 +287,7 @@ extern int num_lock; debug_glerror(err), err, A, __FILE__, __LINE__); \ err = glGetError(); \ } while (err != GL_NO_ERROR); \ -} +} /* Trace routines / diagnostics */ /* ---------------------------- */ @@ -356,8 +356,8 @@ extern const float identity[16]; /* Trace information per-vertex: (extremely high amount of trace) */ #if 0 /* NOTE: Must be 0 in cvs */ # define VTRACE(A) TRACE A -#else -# define VTRACE(A) +#else +# define VTRACE(A) #endif /* Checking of per-vertex related GL calls */ @@ -385,21 +385,21 @@ extern const float identity[16]; the file is deleted */ # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */ # define SINGLE_FRAME_DEBUGGING -# endif +# endif /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls. - It can only be enabled when FRAME_DEBUGGING is also enabled - The contents of the back buffer are written into /tmp/backbuffer_* after each primitive + It can only be enabled when FRAME_DEBUGGING is also enabled + The contents of the back buffer are written into /tmp/backbuffer_* after each primitive array is drawn. */ -# if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */ +# if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */ # define SHOW_FRAME_MAKEUP 1 -# endif +# endif /* The following, when enabled, lets you see the makeup of the all the textures used during each of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled. - The contents of the textures assigned to each stage are written into + The contents of the textures assigned to each stage are written into /tmp/texture_*_.ppm after each primitive array is drawn. */ # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */ # define SHOW_TEXTURE_MAKEUP 0 -# endif +# endif extern BOOL isOn; extern BOOL isDumpingFrames; extern LONG primCounter; @@ -954,7 +954,7 @@ typedef struct IWineD3DTextureImpl /* IWineD3DTexture */ IWineD3DSurface *surfaces[MAX_LEVELS]; - + UINT width; UINT height; float pow2scalingFactorX; @@ -1443,7 +1443,7 @@ typedef struct IWineD3DQueryImpl { const IWineD3DQueryVtbl *lpVtbl; LONG ref; /* Note: Ref counting not required */ - + IUnknown *parent; /*TODO: replace with iface usage */ #if 0 @@ -1456,8 +1456,8 @@ typedef struct IWineD3DQueryImpl WINED3DQUERYTYPE type; /* TODO: Think about using a IUnknown instead of a void* */ void *extendedData; - - + + } IWineD3DQueryImpl; extern const IWineD3DQueryVtbl IWineD3DQuery_Vtbl; @@ -1506,7 +1506,7 @@ extern const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl; WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface); /***************************************************************************** - * Utility function prototypes + * Utility function prototypes */ /* Trace routines */ @@ -1547,9 +1547,9 @@ BOOL getDepthStencilBits(WINED3DFORMAT fmt, short *depthSize, short *stencilSize void multiply_matrix(WINED3DMATRIX *dest, const WINED3DMATRIX *src1, const WINED3DMATRIX *src2); /***************************************************************************** - * To enable calling of inherited functions, requires prototypes + * To enable calling of inherited functions, requires prototypes * - * Note: Only require classes which are subclassed, ie resource, basetexture, + * Note: Only require classes which are subclassed, ie resource, basetexture, */ /*** IUnknown methods ***/ extern HRESULT WINAPI IWineD3DResourceImpl_QueryInterface(IWineD3DResource *iface, REFIID riid, void** ppvObject); @@ -1656,7 +1656,7 @@ typedef struct shader_reg_maps { char attributes[MAX_ATTRIBS]; /* vertex */ char labels[MAX_LABELS]; /* pixel, vertex */ - /* Sampler usage tokens + /* Sampler usage tokens * Use 0 as default (bit 31 is always 1 on a valid token) */ DWORD samplers[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)]; char bumpmat; @@ -1729,21 +1729,21 @@ typedef struct SHADER_LIMITS { unsigned int label; } SHADER_LIMITS; -/** Keeps track of details for TEX_M#x# shader opcodes which need to +/** Keeps track of details for TEX_M#x# shader opcodes which need to maintain state information between multiple codes */ typedef struct SHADER_PARSE_STATE { unsigned int current_row; DWORD texcoord_w[2]; } SHADER_PARSE_STATE; -/* Base Shader utility functions. +/* Base Shader utility functions. * (may move callers into the same file in the future) */ extern int shader_addline( SHADER_BUFFER* buffer, const char* fmt, ...); extern const SHADER_OPCODE* shader_get_opcode( - IWineD3DBaseShader *iface, + IWineD3DBaseShader *iface, const DWORD code); extern void shader_delete_constant_list( @@ -2012,7 +2012,7 @@ static inline BOOL shader_is_scalar(DWORD param) { * IDirect3DVertexShader implementation structure */ typedef struct IWineD3DVertexShaderImpl { - /* IUnknown parts*/ + /* IUnknown parts*/ const IWineD3DVertexShaderVtbl *lpVtbl; LONG ref; /* Note: Ref counting not required */ diff --git a/reactos/dll/directx/wine/wined3d/wined3d_private_types.h b/reactos/dll/directx/wine/wined3d/wined3d_private_types.h index 3550910101e..387d3b238a0 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d_private_types.h +++ b/reactos/dll/directx/wine/wined3d/wined3d_private_types.h @@ -61,7 +61,7 @@ typedef enum _WINED3DSAMPLER_TEXTURE_TYPE { /** Register types **/ typedef enum _WINED3DSHADER_PARAM_REGISTER_TYPE { - WINED3DSPR_TEMP = 0, + WINED3DSPR_TEMP = 0, WINED3DSPR_INPUT = 1, WINED3DSPR_CONST = 2, WINED3DSPR_ADDR = 3, diff --git a/reactos/dll/keyboard/kbdbe/kbdbe.c b/reactos/dll/keyboard/kbdbe/kbdbe.c index eaa2efd322e..605517f2e01 100644 --- a/reactos/dll/keyboard/kbdbe/kbdbe.c +++ b/reactos/dll/keyboard/kbdbe/kbdbe.c @@ -38,7 +38,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -47,14 +47,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'A', 'Z', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', VK_OEM_4, + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'Q', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', 'M', VK_OEM_7, VK_OEM_3, + 'L', 'M', VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -63,15 +63,15 @@ ROSDATA USHORT scancode_to_vk[] = { VK_OEM_1, VK_OEM_PLUS, VK_RSHIFT, /* - 37 - */ /* Bottom Row */ - VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, + VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -87,11 +87,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -179,12 +179,12 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { '7', NOCAPS, {0xE8, '7'} }, { '8', NOCAPS, {'!', '8'} }, { VK_OEM_2, NOCAPS, {')', 0xB0} }, - + /* Specials */ { VK_OEM_COMMA, CAPS, {',', '?'} }, { VK_OEM_PERIOD, CAPS, {';', '.'} }, - - { VK_OEM_1, CAPS, {':', '/'} }, + + { VK_OEM_1, CAPS, {':', '/'} }, { VK_OEM_3, NOCAPS, {0xB2, 0xB3 } }, { VK_DECIMAL, NOCAPS, {'.', '.'} }, { VK_TAB, NOCAPS, {'\t', '\t'} }, @@ -240,7 +240,7 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { /* Normal, Shifted, Ctrl, Ctrl-Alt */ /* Legacy Ascii generators */ - { '1', NOCAPS, {'&', '1', WCH_NONE, '|' } }, + { '1', NOCAPS, {'&', '1', WCH_NONE, '|' } }, { '2', NOCAPS, {0xE9, '2', WCH_NONE, '@' } }, { '3', NOCAPS, {'"', '3', WCH_NONE, '#' } }, { '6', NOCAPS, {0xA7, '6', WCH_NONE, WCH_DEAD} }, @@ -249,7 +249,7 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { { VK_OEM_PLUS, NOCAPS, {'=', '+', WCH_NONE, WCH_DEAD} }, { VK_OEM_4, NOCAPS, {WCH_DEAD, WCH_DEAD,WCH_NONE, '[' } }, - { VK_OEM_5, CAPS, {0xB5, 0xA3, WCH_NONE, WCH_DEAD} }, + { VK_OEM_5, CAPS, {0xB5, 0xA3, WCH_NONE, WCH_DEAD} }, { VK_OEM_6, NOCAPS, {'$', '*', WCH_NONE, ']' } }, { VK_OEM_7, NOCAPS, {0xF9, '%', WCH_NONE, WCH_DEAD} }, { VK_EMPTY , NOCAPS, {0xb4, '`', '|', WCH_NONE} }, @@ -398,7 +398,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x004f, 0x00a8, 0x00d6, 0x0000) }, // O -> Ö { DEADTRANS(0x0055, 0x00a8, 0x00dc, 0x0000) }, // U -> Ü { DEADTRANS(0x0020, 0x00a8, 0x00a8, 0x0000) }, // Space -> ¨ - + /* ^ */ { DEADTRANS(0x0061, 0x005e, 0x00e2, 0x0000) }, // a -> â { DEADTRANS(0x0065, 0x005e, 0x00ea, 0x0000) }, // e -> ê @@ -409,7 +409,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x0045, 0x005e, 0x00ca, 0x0000) }, // E -> Ê { DEADTRANS(0x0049, 0x005e, 0x00ce, 0x0000) }, // I -> Î { DEADTRANS(0x004f, 0x005e, 0x00d4, 0x0000) }, // O -> Ô - { DEADTRANS(0x0055, 0x005e, 0x00db, 0x0000) }, // U -> Û + { DEADTRANS(0x0055, 0x005e, 0x00db, 0x0000) }, // U -> Û { DEADTRANS(0x0020, 0x005e, 0x005e, 0x0000) }, // Space -> ^ /* ~ */ @@ -433,7 +433,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x0049, 0x00b4, 0x00cd, 0x0000) }, // I -> Í { DEADTRANS(0x004f, 0x00b4, 0x00d3, 0x0000) }, // O -> Ó { DEADTRANS(0x0055, 0x00b4, 0x00da, 0x0000) }, // U -> Ú - { DEADTRANS(0x0059, 0x00b4, 0x00dd, 0x0000) }, // Y -> Ý + { DEADTRANS(0x0059, 0x00b4, 0x00dd, 0x0000) }, // Y -> Ý { DEADTRANS(0x0020, 0x00b4, 0x00b4, 0x0000) }, // Space -> ´ /* ` */ @@ -455,10 +455,10 @@ ROSDATA DEADKEY dead_key[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ dead_key, diff --git a/reactos/dll/keyboard/kbdbur/kbdbur.c b/reactos/dll/keyboard/kbdbur/kbdbur.c index 2c640441a63..9447e6d4ffa 100644 --- a/reactos/dll/keyboard/kbdbur/kbdbur.c +++ b/reactos/dll/keyboard/kbdbur/kbdbur.c @@ -2,7 +2,7 @@ * ReactOS Burmese keyboard layout * Copyright (C) 2007 ReactOS * License: LGPL, see: LGPL.txt - * + * */ #include @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -354,10 +354,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ NULL, diff --git a/reactos/dll/keyboard/kbdcz1/kbdcz1.c b/reactos/dll/keyboard/kbdcz1/kbdcz1.c index 3880ab97f3b..075bedcd45d 100644 --- a/reactos/dll/keyboard/kbdcz1/kbdcz1.c +++ b/reactos/dll/keyboard/kbdcz1/kbdcz1.c @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -85,11 +85,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -147,7 +147,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* normal - shift - ctrl */ /* The alphabet */ - { 'A', CAPS, {'a', 'A', 0x01} }, + { 'A', CAPS, {'a', 'A', 0x01} }, { 'B', CAPS, {'b', 'B', 0x02} }, { 'C', CAPS, {'c', 'C', 0x03} }, { 'D', CAPS, {'d', 'D', 0x04} }, @@ -198,7 +198,7 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { { VK_OEM_4, NOCAPS, {0x00fa, '/', WCH_NONE, '[' } }, // u with acute { VK_OEM_5, NOCAPS, {WCH_DEAD, 0x2018, WCH_NONE, '\\' } }, // diaeresis, left single quotation mark { VK_EMPTY, 0, {0x00a8, WCH_NONE, WCH_NONE, WCH_NONE } }, // VK_OEM_5 death - { VK_OEM_6, NOCAPS, {')', '(', WCH_NONE, ']' } }, + { VK_OEM_6, NOCAPS, {')', '(', WCH_NONE, ']' } }, { VK_OEM_3, NOCAPS, {';', WCH_DEAD, WCH_NONE, '`' } }, // ring { VK_EMPTY, 0, {WCH_NONE, 0x00b0, WCH_NONE, WCH_NONE } }, // VK_OEM_3 death { VK_OEM_COMMA, NOCAPS, {',', '?', WCH_NONE, '<' } }, @@ -386,10 +386,10 @@ ROSDATA DEADKEY_LPWSTR dead_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- */ dead_key, diff --git a/reactos/dll/keyboard/kbdda/kbdda.c b/reactos/dll/keyboard/kbdda/kbdda.c index fa9e5dbae14..c409aa29b39 100644 --- a/reactos/dll/keyboard/kbdda/kbdda.c +++ b/reactos/dll/keyboard/kbdda/kbdda.c @@ -32,7 +32,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -41,14 +41,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_6, VK_OEM_1, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, + 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, VK_LSHIFT, VK_OEM_2, /* - 2c - */ /* Third letters row */ @@ -58,15 +58,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -82,11 +82,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -182,7 +182,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_OEM_COMMA, CAPS, {',', ';'} }, { VK_OEM_PERIOD, CAPS, {'.', ':'} }, { VK_OEM_2, NOCAPS, {'\'', '*'} }, - + { VK_DECIMAL, NOCAPS, {',', ','} }, { VK_TAB, NOCAPS, {'\t', '\t'} }, { VK_ADD, NOCAPS, {'+', '+'} }, @@ -397,7 +397,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x004f, 0x00a8, 0x00d6, 0x0000) }, { DEADTRANS(0x0055, 0x00a8, 0x00dc, 0x0000) }, { DEADTRANS(0x0020, 0x00a8, 0x00a8, 0x0000) }, - + /* ^ */ { DEADTRANS(0x0061, 0x005e, 0x00e2, 0x0000) }, { DEADTRANS(0x0065, 0x005e, 0x00ea, 0x0000) }, @@ -454,10 +454,10 @@ ROSDATA DEADKEY dead_key[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ dead_key, diff --git a/reactos/dll/keyboard/kbddv/kbddv.c b/reactos/dll/keyboard/kbddv/kbddv.c index 01386730cab..f728c0ef743 100644 --- a/reactos/dll/keyboard/kbddv/kbddv.c +++ b/reactos/dll/keyboard/kbddv/kbddv.c @@ -2,7 +2,7 @@ * ReactOS USASCII Keyboard layout * Copyright (C) 2003 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, VK_OEM_7, VK_OEM_COMMA, VK_OEM_PERIOD, 'P', 'Y', 'F', 'G', - 'C', 'R', 'L', + 'C', 'R', 'L', VK_OEM_2, VK_OEM_PLUS, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'O', 'E', 'U', 'I', 'D', 'H', 'T', - 'N', 'S', VK_OEM_MINUS,VK_OEM_3, + 'N', 'S', VK_OEM_MINUS,VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -85,11 +85,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -324,10 +324,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* English doesn't have any, anyway */ NULL, diff --git a/reactos/dll/keyboard/kbdes/kbdes.c b/reactos/dll/keyboard/kbdes/kbdes.c index e06f328fb94..5838a8c8e08 100644 --- a/reactos/dll/keyboard/kbdes/kbdes.c +++ b/reactos/dll/keyboard/kbdes/kbdes.c @@ -38,142 +38,142 @@ #define KNUMP 0x800 /* Number-pad */ #define KNUMS 0xc00 /* Special + number pad */ #define KMEXT 0x300 /* Multi + ext */ - + #define SHFT_INVALID 0x0F ROSDATA USHORT scancode_to_vk[] = { -/* 00 */ VK_EMPTY, -/* 01 */ VK_ESCAPE, -/* 02 */ '1', -/* 03 */ '2', -/* 04 */ '3', -/* 05 */ '4', -/* 06 */ '5', -/* 07 */ '6', -/* 08 */ '7', -/* 09 */ '8', -/* 0a */ '9', -/* 0b */ '0', -/* 0c */ VK_OEM_4, -/* 0d */ VK_OEM_6, -/* 0e */ VK_BACK, -/* 0f */ VK_TAB, -/* 10 */ 'Q', -/* 11 */ 'W', -/* 12 */ 'E', -/* 13 */ 'R', -/* 14 */ 'T', -/* 15 */ 'Y', -/* 16 */ 'U', -/* 17 */ 'I', -/* 18 */ 'O', -/* 19 */ 'P', -/* 1a */ VK_OEM_1, -/* 1b */ VK_OEM_PLUS, +/* 00 */ VK_EMPTY, +/* 01 */ VK_ESCAPE, +/* 02 */ '1', +/* 03 */ '2', +/* 04 */ '3', +/* 05 */ '4', +/* 06 */ '5', +/* 07 */ '6', +/* 08 */ '7', +/* 09 */ '8', +/* 0a */ '9', +/* 0b */ '0', +/* 0c */ VK_OEM_4, +/* 0d */ VK_OEM_6, +/* 0e */ VK_BACK, +/* 0f */ VK_TAB, +/* 10 */ 'Q', +/* 11 */ 'W', +/* 12 */ 'E', +/* 13 */ 'R', +/* 14 */ 'T', +/* 15 */ 'Y', +/* 16 */ 'U', +/* 17 */ 'I', +/* 18 */ 'O', +/* 19 */ 'P', +/* 1a */ VK_OEM_1, +/* 1b */ VK_OEM_PLUS, /* 1c */ VK_RETURN, -/* 1d */ VK_LCONTROL, -/* 1e */ 'A', -/* 1f */ 'S', -/* 20 */ 'D', +/* 1d */ VK_LCONTROL, +/* 1e */ 'A', +/* 1f */ 'S', +/* 20 */ 'D', /* 21 */ 'F', -/* 22 */ 'G', -/* 23 */ 'H', -/* 24 */ 'J', +/* 22 */ 'G', +/* 23 */ 'H', +/* 24 */ 'J', /* 25 */ 'K', -/* 26 */ 'L', -/* 27 */ VK_OEM_3, -/* 28 */ VK_OEM_7, +/* 26 */ 'L', +/* 27 */ VK_OEM_3, +/* 28 */ VK_OEM_7, /* 29 */ VK_OEM_5, -/* 2a */ VK_LSHIFT, -/* 2b */ VK_OEM_2, -/* 2c */ 'Z', -/* 2d */ 'X', -/* 2e */ 'C', -/* 2f */ 'V', -/* 30 */ 'B', -/* 31 */ 'N', -/* 32 */ 'M', +/* 2a */ VK_LSHIFT, +/* 2b */ VK_OEM_2, +/* 2c */ 'Z', +/* 2d */ 'X', +/* 2e */ 'C', +/* 2f */ 'V', +/* 30 */ 'B', +/* 31 */ 'N', +/* 32 */ 'M', /* 33 */ VK_OEM_COMMA, -/* 34 */ VK_OEM_PERIOD, -/* 35 */ VK_OEM_MINUS, +/* 34 */ VK_OEM_PERIOD, +/* 35 */ VK_OEM_MINUS, /* 36 */ VK_RSHIFT, -/* 37 */ VK_MULTIPLY, -/* 38 */ VK_LMENU, -/* 39 */ VK_SPACE, +/* 37 */ VK_MULTIPLY, +/* 38 */ VK_LMENU, +/* 39 */ VK_SPACE, /* 3a */ VK_CAPITAL, -/* 3b */ VK_F1, -/* 3c */ VK_F2, -/* 3d */ VK_F3, -/* 3e */ VK_F4, -/* 3f */ VK_F5, +/* 3b */ VK_F1, +/* 3c */ VK_F2, +/* 3d */ VK_F3, +/* 3e */ VK_F4, +/* 3f */ VK_F5, /* 40 */ VK_F6, /* 41 */ VK_F7, /* 42 */ VK_F8, -/* 43 */ VK_F9, +/* 43 */ VK_F9, /* 44 */ VK_F10, -/* 45 */ VK_NUMLOCK | KMEXT, -/* 46 */ VK_SCROLL | KMULTI, -/* 47 */ VK_HOME | KNUMS, -/* 48 */ VK_UP | KNUMS, -/* 49 */ VK_PRIOR | KNUMS, +/* 45 */ VK_NUMLOCK | KMEXT, +/* 46 */ VK_SCROLL | KMULTI, +/* 47 */ VK_HOME | KNUMS, +/* 48 */ VK_UP | KNUMS, +/* 49 */ VK_PRIOR | KNUMS, /* 4a */ VK_SUBTRACT, /* 4b */ VK_LEFT | KNUMS, -/* 4c */ VK_CLEAR | KNUMS, -/* 4d */ VK_RIGHT | KNUMS, +/* 4c */ VK_CLEAR | KNUMS, +/* 4d */ VK_RIGHT | KNUMS, /* 4e */ VK_ADD, -/* 4f */ VK_END | KNUMS, -/* 50 */ VK_DOWN | KNUMS, -/* 51 */ VK_NEXT | KNUMS, -/* 52 */ VK_INSERT | KNUMS, -/* 53 */ VK_DELETE | KNUMS, +/* 4f */ VK_END | KNUMS, +/* 50 */ VK_DOWN | KNUMS, +/* 51 */ VK_NEXT | KNUMS, +/* 52 */ VK_INSERT | KNUMS, +/* 53 */ VK_DELETE | KNUMS, /* 54 */ VK_SNAPSHOT, -/* 55 */ VK_EMPTY, -/* 56 */ VK_OEM_102, -/* 57 */ VK_F11, +/* 55 */ VK_EMPTY, +/* 56 */ VK_OEM_102, +/* 57 */ VK_F11, /* 58 */ VK_F12, -/* 59 */ VK_EMPTY, -/* 5a */ VK_CLEAR, -/* 5b */ VK_EMPTY, -/* 5c */ VK_EMPTY, -/* 5d */ VK_EMPTY, +/* 59 */ VK_EMPTY, +/* 5a */ VK_CLEAR, +/* 5b */ VK_EMPTY, +/* 5c */ VK_EMPTY, +/* 5d */ VK_EMPTY, /* 5e */ VK_EMPTY, /* EREOF */ -/* 5f */ VK_EMPTY, -/* 60 */ VK_EMPTY, -/* 61 */ VK_EMPTY, -/* 62 */ VK_EMPTY, +/* 5f */ VK_EMPTY, +/* 60 */ VK_EMPTY, +/* 61 */ VK_EMPTY, +/* 62 */ VK_EMPTY, /* 63 */ VK_EMPTY, /* ZOOM */ -/* 64 */ VK_HELP, -/* 65 */ VK_F13, -/* 66 */ VK_F14, -/* 67 */ VK_F15, -/* 68 */ VK_F16, -/* 69 */ VK_F17, -/* 6a */ VK_F18, -/* 6b */ VK_F19, +/* 64 */ VK_HELP, +/* 65 */ VK_F13, +/* 66 */ VK_F14, +/* 67 */ VK_F15, +/* 68 */ VK_F16, +/* 69 */ VK_F17, +/* 6a */ VK_F18, +/* 6b */ VK_F19, /* 6c */ VK_F20, -/* 6d */ VK_F21, -/* 6e */ VK_F22, +/* 6d */ VK_F21, +/* 6e */ VK_F22, /* 6f */ VK_F23, -/* 70 */ VK_EMPTY, -/* 71 */ VK_EMPTY, +/* 70 */ VK_EMPTY, +/* 71 */ VK_EMPTY, /* 72 */ VK_EMPTY, /* 73 */ VK_EMPTY, -/* 74 */ VK_EMPTY, -/* 75 */ VK_EMPTY, +/* 74 */ VK_EMPTY, +/* 75 */ VK_EMPTY, /* 76 */ VK_EMPTY, /* 77 */ VK_F24, /* 78 */ VK_EMPTY, -/* 79 */ VK_EMPTY, -/* 7a */ VK_EMPTY, +/* 79 */ VK_EMPTY, +/* 7a */ VK_EMPTY, /* 7b */ VK_EMPTY, -/* 7c */ VK_EMPTY, -/* 7d */ VK_EMPTY, -/* 7e */ VK_EMPTY, -/* 7f */ VK_EMPTY, +/* 7c */ VK_EMPTY, +/* 7d */ VK_EMPTY, +/* 7e */ VK_EMPTY, +/* 7f */ VK_EMPTY, /* 80 */ VK_EMPTY, /* 00 */ 0 }; - + ROSDATA VSC_VK extcode0_to_vk[] = { { 0x10, VK_MEDIA_PREV_TRACK | KEXT }, // Pista anterior, no puedo probarlo hasta que no se implemente el sonido { 0x19, VK_MEDIA_NEXT_TRACK | KEXT }, // Pista siguiente, @@ -185,8 +185,8 @@ ROSDATA VSC_VK extcode0_to_vk[] = { { 0x2E, VK_VOLUME_DOWN | KEXT }, // Bajar volumen { 0x30, VK_VOLUME_UP | KEXT }, // Subir volumen { 0x32, VK_BROWSER_HOME | KEXT }, // Pagina de inicio del navegador de internet o abrirlo si no esta activolo - { 0x35, VK_DIVIDE | KEXT }, // Tecla - { 0x37, VK_SNAPSHOT | KEXT }, // La tecla de imprimir pantalla + { 0x35, VK_DIVIDE | KEXT }, // Tecla + { 0x37, VK_SNAPSHOT | KEXT }, // La tecla de imprimir pantalla { 0x38, VK_RMENU | KEXT }, // Tecla alt { 0x47, VK_HOME | KEXT }, // Tecla inicio { 0x48, VK_UP | KEXT }, // Cursor arriba @@ -203,7 +203,7 @@ ROSDATA VSC_VK extcode0_to_vk[] = { { 0x5D, VK_APPS | KEXT }, // Tecla menu aplicacion derecha { 0x5F, VK_SLEEP | KEXT }, // Tecla Sleep { 0x65, VK_BROWSER_SEARCH | KEXT }, // Pagina de búsqueda en el navegador de internet - { 0x66, VK_BROWSER_FAVORITES | KEXT }, // Favoritos, tengo que esperar a que el tcp/ip + { 0x66, VK_BROWSER_FAVORITES | KEXT }, // Favoritos, tengo que esperar a que el tcp/ip { 0x67, VK_BROWSER_REFRESH | KEXT }, // Refrescar el navegador de internet { 0x68, VK_BROWSER_STOP | KEXT }, // Stop en el navegador de internet { 0x69, VK_BROWSER_FORWARD | KEXT }, // Adelante en el navegador de internet @@ -220,7 +220,7 @@ ROSDATA VSC_VK extcode0_to_vk[] = { ROSDATA VSC_VK extcode1_to_vk[] = { { 0, 0 }, }; - + ROSDATA VK_TO_BIT modifier_keys[] = { { VK_SHIFT, KSHIFT }, { VK_CONTROL, KCTRL }, @@ -231,7 +231,7 @@ ROSDATA VK_TO_BIT modifier_keys[] = { ROSDATA MODIFIERS modifier_bits = { modifier_keys, 6, - { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } + { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } /* NONE, SHIFT, CTRL, CTRL+SHIFT, ALT */ }; @@ -243,14 +243,14 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* The numbers */ //Del 1 al 5 tienen tres estados { '4', NOCAPS, {'4', '$'} }, - { '5', NOCAPS, {'5', '%'} }, + { '5', NOCAPS, {'5', '%'} }, //El 6 tiene 3 estados { '7', NOCAPS, {'7', '/'} }, { '8', NOCAPS, {'8', '('} }, { '9', NOCAPS, {'9', ')'} }, { '0', NOCAPS, {'0', '='} }, { VK_OEM_3, CAPS, {0x00F1, 0x00D1} }, // ñÑ - + /* Specials */ /* Ctrl-_ generates ES */ { VK_OEM_6 ,NOCAPS, {0x00a1, 0x00bf} }, // ¡¿ @@ -258,7 +258,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_OEM_COMMA ,NOCAPS, {',', ';'} }, { VK_OEM_PERIOD ,NOCAPS, {'.', ':'} }, { VK_OEM_MINUS ,NOCAPS, {'-', '_'} }, - { VK_OEM_102 ,NOCAPS, {'<', '>'} }, + { VK_OEM_102 ,NOCAPS, {'<', '>'} }, /* Keys that do not have shift states */ { VK_TAB, NOCAPS, {'\t', '\t'} }, @@ -270,7 +270,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_SPACE, NOCAPS, {' ', ' '} }, { 0, 0 } }; - + ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Normal, Shifted, Ctrl */ @@ -316,19 +316,19 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { { '6', NOCAPS, {'6', '&', WCH_NONE, 0x00AC} }, // 6&¬ { 'E', CAPS, {'e', 'E', 0x05, 0x20AC} }, // eE€ { VK_OEM_PLUS, NOCAPS, {'+', '*', WCH_NONE, 0x005d} }, // +*] - { VK_OEM_2, NOCAPS, {0x00e7, 0x00c7, WCH_NONE, '}'} }, // çÇ} - + { VK_OEM_2, NOCAPS, {0x00e7, 0x00c7, WCH_NONE, '}'} }, // çÇ} + { VK_OEM_7, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_NONE, '{'} }, // ´¨{ { VK_EMPTY, NOCAPS, {0xB4, 0xA8, WCH_NONE, WCH_NONE} }, // ´¨{ - + { VK_OEM_1, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_NONE, 0x5B} }, // `^[ { VK_EMPTY, NOCAPS, {0x60, 0x5e, WCH_NONE, WCH_NONE} }, // `^[ - + { VK_OEM_5, NOCAPS, {0x00BA, 0x00AA, WCH_NONE, 0x005c} }, // çÇ} { 0, 0 } }; - + ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { { VK_NUMPAD0, 0, {'0'} }, @@ -497,35 +497,35 @@ ROSDATA DEADKEY_LPWSTR dead_key_names[] = { L"\x00A8" L"Dieresis", NULL }; - + /* Finally, the master table */ ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* Spanish have severals */ deadkey, - + /* Key names */ (VSC_LPWSTR *)key_names, (VSC_LPWSTR *)extended_key_names, dead_key_names, /* Dead key names */ - + /* scan code to virtual key maps */ scancode_to_vk, sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]), extcode0_to_vk, extcode1_to_vk, - + MAKELONG(0,1), /* Version 1.0 */ - + /* Ligatures -- Spanish doesn't have any */ 0, 0, diff --git a/reactos/dll/keyboard/kbdfi/kbdfi.c b/reactos/dll/keyboard/kbdfi/kbdfi.c index bbc60579947..7c5f1342c86 100644 --- a/reactos/dll/keyboard/kbdfi/kbdfi.c +++ b/reactos/dll/keyboard/kbdfi/kbdfi.c @@ -2,7 +2,7 @@ * ReactOS Finnish keyboard layout (Based on Swedish keyboard layout) * Copyright (C) 2007 ReactOS * License: LGPL, see: LGPL.txt - * + * */ #include @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_6, VK_OEM_1, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, + 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, VK_LSHIFT, VK_OEM_2, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -85,11 +85,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -445,10 +445,10 @@ ROSDATA DEADKEY dead_key[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ dead_key, diff --git a/reactos/dll/keyboard/kbdfr/kbdfr.c b/reactos/dll/keyboard/kbdfr/kbdfr.c index 8330caa5030..aa899709896 100644 --- a/reactos/dll/keyboard/kbdfr/kbdfr.c +++ b/reactos/dll/keyboard/kbdfr/kbdfr.c @@ -3,8 +3,8 @@ * Copyright (C) 2003 ReactOS * License: LGPL, see: LGPL.txt * autor: Jean-Michel Gay 2003 - * Pierre Schweitzer 2007 - * + * Pierre Schweitzer 2007 + * */ #include @@ -40,7 +40,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -49,14 +49,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'A', 'Z', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_6, VK_OEM_1, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'Q', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', 'M' , VK_OEM_3, VK_OEM_7, + 'L', 'M' , VK_OEM_3, VK_OEM_7, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -66,15 +66,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -90,11 +90,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_ZOOM, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -167,7 +167,7 @@ ROSDATA VK_TO_BIT modifier_keys[] = { ROSDATA MODIFIERS modifier_bits = { modifier_keys, 6, - { 0, 1, 2, 4,15,15,3 } + { 0, 1, 2, 4,15,15,3 } /* new: Modifier bit order, NONE, SHIFT, CTRL, ALT , ? ,? , shift+control*/ /* old: Modifier bit order, NONE, SHIFT, CTRL, ALT */ }; @@ -350,7 +350,7 @@ ROSDATA DEADKEY deadkey[] = { DEADTRANS(L'n', 0x7e, 0xf1, 0x00) }, // ñ { DEADTRANS(L'N', 0x7e, 0xd1, 0x00) }, // Ñ { DEADTRANS(L'o', 0x7e, 0xf5, 0x00) }, // õ - { DEADTRANS(L'O', 0x7e, 0xd5, 0x00) }, // Õ + { DEADTRANS(L'O', 0x7e, 0xd5, 0x00) }, // Õ { 0, 0, 0} }; @@ -441,10 +441,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ deadkey, diff --git a/reactos/dll/keyboard/kbdgr/kbdgr.c b/reactos/dll/keyboard/kbdgr/kbdgr.c index 0a3d666687b..ce00b7e432e 100644 --- a/reactos/dll/keyboard/kbdgr/kbdgr.c +++ b/reactos/dll/keyboard/kbdgr/kbdgr.c @@ -2,7 +2,7 @@ * ReactOS German ASCII Keyboard layout * Copyright (C) 2003 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -37,7 +37,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -46,14 +46,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_1, VK_OEM_PLUS, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, + 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, VK_LSHIFT, VK_OEM_2, /* - 2c - */ /* Third letters row */ @@ -63,15 +63,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -87,11 +87,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -180,10 +180,10 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Ctrl-2 generates NUL */ { '4', NOCAPS, {'4', '$'} }, { '5', NOCAPS, {'5', '%'} }, - + { VK_OEM_6, NOCAPS, {WCH_DEAD, WCH_DEAD} }, { 0xff, NOCAPS, {0xb4, '`'} }, - + /* First letter row */ { 'W', CAPS, {'w', 'W'} }, { 'R', CAPS, {'r', 'R'} }, @@ -424,10 +424,10 @@ ROSDATA DEADKEY dead_key[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ dead_key, diff --git a/reactos/dll/keyboard/kbdhe/kbdhe.c b/reactos/dll/keyboard/kbdhe/kbdhe.c index ade90c8f707..cd129e28130 100644 --- a/reactos/dll/keyboard/kbdhe/kbdhe.c +++ b/reactos/dll/keyboard/kbdhe/kbdhe.c @@ -145,7 +145,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { '9', NOCAPS, {'9', '('} }, { '0', NOCAPS, {'0', ')'} }, { 'Q', NOCAPS, {';', ':'} }, - + /* Specials */ /* Ctrl-_ generates GR */ { VK_OEM_PLUS ,NOCAPS, {'=', '+'} }, @@ -168,9 +168,9 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Normal, Shifted, Ctrl */ /* Legacy (telnet-style) ascii escapes */ - { VK_OEM_1, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_NONE} }, + { VK_OEM_1, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_NONE} }, { VK_EMPTY, NOCAPS, {';', 0x00A8, WCH_NONE} }, - { 'W', NOCAPS, {0x3C2, WCH_DEAD, WCH_NONE} }, + { 'W', NOCAPS, {0x3C2, WCH_DEAD, WCH_NONE} }, { VK_EMPTY, NOCAPS, {0x3C2, 0x385, WCH_NONE} }, { VK_OEM_4, 0, {'[', '{', 0x1b /* ESC */} }, { VK_OEM_6, 0, {']', '}', 0x1d /* GS */} }, @@ -261,9 +261,9 @@ ROSDATA DEADKEY deadkey[] = { DEADTRANS(0x3C9, L';', 0x3CE, 0x000) }, //MIKRO W { DEADTRANS(0x3A9, L';', 0x38F, 0x000) }, //MEGALO W { DEADTRANS(0x3C5, 0x00A8, 0x3CB, 0x000) }, //MIKRO Y ME DIALYTIKA - { DEADTRANS(0x3A5, 0x00A8, 0x3AB, 0x000) }, //MEGALO Y ME DIALYTIKA + { DEADTRANS(0x3A5, 0x00A8, 0x3AB, 0x000) }, //MEGALO Y ME DIALYTIKA { DEADTRANS(0x3B9, 0x00A8, 0x3CA, 0x000) }, //MIKRO I ME DIALYTIKA - { DEADTRANS(0x399, 0x00A8, 0x3AA, 0x000) }, //MEGALO I ME DIALYTIKA + { DEADTRANS(0x399, 0x00A8, 0x3AA, 0x000) }, //MEGALO I ME DIALYTIKA { DEADTRANS(0x3C5, 0x385, 0x3B0, 0x000) }, //MIKRO Y ME DIALYTIKA { DEADTRANS(0x3B9, 0x385, 0x390, 0x000) }, //MIKRO I ME DIALYTIKA { 0, 0, 0} diff --git a/reactos/dll/keyboard/kbdheb/kbdheb.c b/reactos/dll/keyboard/kbdheb/kbdheb.c index 8316becd4d3..6b3f9e61c8c 100644 --- a/reactos/dll/keyboard/kbdheb/kbdheb.c +++ b/reactos/dll/keyboard/kbdheb/kbdheb.c @@ -173,10 +173,10 @@ ROSDATA USHORT scancode_to_vk[] = VK_LMENU, // 38: lalt VK_SPACE, // 39: space VK_CAPITAL, // 3A: caps lock? - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ @@ -197,11 +197,11 @@ ROSDATA USHORT scancode_to_vk[] = /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -443,10 +443,10 @@ ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* English doesn't have any, anyway */ NULL, diff --git a/reactos/dll/keyboard/kbdhu/kbdhu.c b/reactos/dll/keyboard/kbdhu/kbdhu.c index 99e7dfd6e2a..59d3a5b5a99 100644 --- a/reactos/dll/keyboard/kbdhu/kbdhu.c +++ b/reactos/dll/keyboard/kbdhu/kbdhu.c @@ -2,7 +2,7 @@ * ReactOS HUASCII Keyboard layout * Copyright (C) 2003 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -85,11 +85,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -324,10 +324,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* English doesn't have any, anyway */ NULL, diff --git a/reactos/dll/keyboard/kbdit/kbdit.c b/reactos/dll/keyboard/kbdit/kbdit.c index 0fb9d4f0652..303749e966d 100644 --- a/reactos/dll/keyboard/kbdit/kbdit.c +++ b/reactos/dll/keyboard/kbdit/kbdit.c @@ -2,7 +2,7 @@ * ReactOS Italian Keyboard layout * Copyright (C) 2007 ReactOS * License: LGPL, see: LGPL.txt - * + * */ #include @@ -33,134 +33,134 @@ #define SHFT_INVALID 0x0F ROSDATA USHORT scancode_to_vk[] = { -/* 00 */ VK_EMPTY, -/* 01 */ VK_ESCAPE, -/* 02 */ '1', -/* 03 */ '2', -/* 04 */ '3', -/* 05 */ '4', -/* 06 */ '5', -/* 07 */ '6', -/* 08 */ '7', -/* 09 */ '8', -/* 0a */ '9', -/* 0b */ '0', -/* 0c */ VK_OEM_4, -/* 0d */ VK_OEM_6, -/* 0e */ VK_BACK, -/* 0f */ VK_TAB, -/* 10 */ 'Q', -/* 11 */ 'W', -/* 12 */ 'E', -/* 13 */ 'R', -/* 14 */ 'T', -/* 15 */ 'Y', -/* 16 */ 'U', -/* 17 */ 'I', -/* 18 */ 'O', -/* 19 */ 'P', -/* 1a */ VK_OEM_1, -/* 1b */ VK_OEM_PLUS, +/* 00 */ VK_EMPTY, +/* 01 */ VK_ESCAPE, +/* 02 */ '1', +/* 03 */ '2', +/* 04 */ '3', +/* 05 */ '4', +/* 06 */ '5', +/* 07 */ '6', +/* 08 */ '7', +/* 09 */ '8', +/* 0a */ '9', +/* 0b */ '0', +/* 0c */ VK_OEM_4, +/* 0d */ VK_OEM_6, +/* 0e */ VK_BACK, +/* 0f */ VK_TAB, +/* 10 */ 'Q', +/* 11 */ 'W', +/* 12 */ 'E', +/* 13 */ 'R', +/* 14 */ 'T', +/* 15 */ 'Y', +/* 16 */ 'U', +/* 17 */ 'I', +/* 18 */ 'O', +/* 19 */ 'P', +/* 1a */ VK_OEM_1, +/* 1b */ VK_OEM_PLUS, /* 1c */ VK_RETURN, -/* 1d */ VK_LCONTROL, -/* 1e */ 'A', -/* 1f */ 'S', -/* 20 */ 'D', +/* 1d */ VK_LCONTROL, +/* 1e */ 'A', +/* 1f */ 'S', +/* 20 */ 'D', /* 21 */ 'F', -/* 22 */ 'G', -/* 23 */ 'H', -/* 24 */ 'J', +/* 22 */ 'G', +/* 23 */ 'H', +/* 24 */ 'J', /* 25 */ 'K', -/* 26 */ 'L', -/* 27 */ VK_OEM_3, -/* 28 */ VK_OEM_7, +/* 26 */ 'L', +/* 27 */ VK_OEM_3, +/* 28 */ VK_OEM_7, /* 29 */ VK_OEM_2, -/* 2a */ VK_LSHIFT, -/* 2b */ VK_OEM_5, -/* 2c */ 'Z', -/* 2d */ 'X', -/* 2e */ 'C', -/* 2f */ 'V', -/* 30 */ 'B', -/* 31 */ 'N', -/* 32 */ 'M', +/* 2a */ VK_LSHIFT, +/* 2b */ VK_OEM_5, +/* 2c */ 'Z', +/* 2d */ 'X', +/* 2e */ 'C', +/* 2f */ 'V', +/* 30 */ 'B', +/* 31 */ 'N', +/* 32 */ 'M', /* 33 */ VK_OEM_COMMA, -/* 34 */ VK_OEM_PERIOD, -/* 35 */ VK_OEM_MINUS, +/* 34 */ VK_OEM_PERIOD, +/* 35 */ VK_OEM_MINUS, /* 36 */ VK_RSHIFT, -/* 37 */ VK_MULTIPLY, -/* 38 */ VK_LMENU, -/* 39 */ VK_SPACE, +/* 37 */ VK_MULTIPLY, +/* 38 */ VK_LMENU, +/* 39 */ VK_SPACE, /* 3a */ VK_CAPITAL, -/* 3b */ VK_F1, -/* 3c */ VK_F2, -/* 3d */ VK_F3, -/* 3e */ VK_F4, -/* 3f */ VK_F5, +/* 3b */ VK_F1, +/* 3c */ VK_F2, +/* 3d */ VK_F3, +/* 3e */ VK_F4, +/* 3f */ VK_F5, /* 40 */ VK_F6, /* 41 */ VK_F7, /* 42 */ VK_F8, -/* 43 */ VK_F9, +/* 43 */ VK_F9, /* 44 */ VK_F10, -/* 45 */ VK_NUMLOCK | KMEXT, -/* 46 */ VK_SCROLL | KMULTI, -/* 47 */ VK_HOME | KNUMS, -/* 48 */ VK_UP | KNUMS, -/* 49 */ VK_PRIOR | KNUMS, +/* 45 */ VK_NUMLOCK | KMEXT, +/* 46 */ VK_SCROLL | KMULTI, +/* 47 */ VK_HOME | KNUMS, +/* 48 */ VK_UP | KNUMS, +/* 49 */ VK_PRIOR | KNUMS, /* 4a */ VK_SUBTRACT, /* 4b */ VK_LEFT | KNUMS, -/* 4c */ VK_CLEAR | KNUMS, -/* 4d */ VK_RIGHT | KNUMS, +/* 4c */ VK_CLEAR | KNUMS, +/* 4d */ VK_RIGHT | KNUMS, /* 4e */ VK_ADD, -/* 4f */ VK_END | KNUMS, -/* 50 */ VK_DOWN | KNUMS, -/* 51 */ VK_NEXT | KNUMS, -/* 52 */ VK_INSERT | KNUMS, -/* 53 */ VK_DELETE | KNUMS, +/* 4f */ VK_END | KNUMS, +/* 50 */ VK_DOWN | KNUMS, +/* 51 */ VK_NEXT | KNUMS, +/* 52 */ VK_INSERT | KNUMS, +/* 53 */ VK_DELETE | KNUMS, /* 54 */ VK_SNAPSHOT, -/* 55 */ VK_EMPTY, -/* 56 */ VK_OEM_102, -/* 57 */ VK_F11, +/* 55 */ VK_EMPTY, +/* 56 */ VK_OEM_102, +/* 57 */ VK_F11, /* 58 */ VK_F12, -/* 59 */ VK_EMPTY, -/* 5a */ VK_CLEAR, -/* 5b */ VK_EMPTY, -/* 5c */ VK_EMPTY, -/* 5d */ VK_EMPTY, +/* 59 */ VK_EMPTY, +/* 5a */ VK_CLEAR, +/* 5b */ VK_EMPTY, +/* 5c */ VK_EMPTY, +/* 5d */ VK_EMPTY, /* 5e */ VK_EMPTY, /* EREOF */ -/* 5f */ VK_EMPTY, -/* 60 */ VK_EMPTY, -/* 61 */ VK_EMPTY, -/* 62 */ VK_EMPTY, +/* 5f */ VK_EMPTY, +/* 60 */ VK_EMPTY, +/* 61 */ VK_EMPTY, +/* 62 */ VK_EMPTY, /* 63 */ VK_EMPTY, /* ZOOM */ -/* 64 */ VK_HELP, -/* 65 */ VK_F13, -/* 66 */ VK_F14, -/* 67 */ VK_F15, -/* 68 */ VK_F16, -/* 69 */ VK_F17, -/* 6a */ VK_F18, -/* 6b */ VK_F19, +/* 64 */ VK_HELP, +/* 65 */ VK_F13, +/* 66 */ VK_F14, +/* 67 */ VK_F15, +/* 68 */ VK_F16, +/* 69 */ VK_F17, +/* 6a */ VK_F18, +/* 6b */ VK_F19, /* 6c */ VK_F20, -/* 6d */ VK_F21, -/* 6e */ VK_F22, +/* 6d */ VK_F21, +/* 6e */ VK_F22, /* 6f */ VK_F23, -/* 70 */ VK_EMPTY, -/* 71 */ VK_EMPTY, +/* 70 */ VK_EMPTY, +/* 71 */ VK_EMPTY, /* 72 */ VK_EMPTY, /* 73 */ VK_EMPTY, -/* 74 */ VK_EMPTY, -/* 75 */ VK_EMPTY, +/* 74 */ VK_EMPTY, +/* 75 */ VK_EMPTY, /* 76 */ VK_EMPTY, /* 77 */ VK_F24, /* 78 */ VK_EMPTY, -/* 79 */ VK_EMPTY, -/* 7a */ VK_EMPTY, +/* 79 */ VK_EMPTY, +/* 7a */ VK_EMPTY, /* 7b */ VK_EMPTY, -/* 7c */ VK_EMPTY, -/* 7d */ VK_EMPTY, -/* 7e */ VK_EMPTY, -/* 7f */ VK_EMPTY, +/* 7c */ VK_EMPTY, +/* 7d */ VK_EMPTY, +/* 7e */ VK_EMPTY, +/* 7f */ VK_EMPTY, /* 80 */ VK_EMPTY, /* 00 */ 0 }; @@ -183,7 +183,7 @@ ROSDATA VK_TO_BIT modifier_keys[] = { ROSDATA MODIFIERS modifier_bits = { modifier_keys, 6, - { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } + { 0, 1, 2, 4, SHFT_INVALID, SHFT_INVALID, 3 } }; #define NOCAPS 0 @@ -207,7 +207,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Ctrl-_ generates US */ { VK_OEM_2 ,NOCAPS, {'\\', '|'} }, { VK_OEM_4 ,NOCAPS, {'\'', '?'} }, - { VK_OEM_102 ,NOCAPS, {'<', '>'} }, + { VK_OEM_102 ,NOCAPS, {'<', '>'} }, { VK_OEM_COMMA ,NOCAPS, {',', ';'} }, { VK_OEM_PERIOD ,NOCAPS, {'.', ':'} }, { VK_OEM_MINUS ,NOCAPS, {'-', '_'} }, @@ -235,7 +235,7 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { { VK_OEM_6, NOCAPS, {0x00ec, '^', WCH_NONE, '~' } }, { VK_OEM_3, NOCAPS, {0x00f2, 0x00e7, WCH_NONE, '@' } },//òç { VK_OEM_7, NOCAPS, {0x00e0, 0x00b0, WCH_NONE, '#'} },//à° - + { VK_OEM_1, NOCAPS, {0x00e8, 0x00e9, '{', '['} },// èé { VK_OEM_PLUS,NOCAPS, {'+', '*', '}', ']'} }, @@ -384,10 +384,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* doesn't have any, anyway */ NULL, diff --git a/reactos/dll/keyboard/kbdja/kbdja.c b/reactos/dll/keyboard/kbdja/kbdja.c index 4d5a8955318..01e7522db32 100644 --- a/reactos/dll/keyboard/kbdja/kbdja.c +++ b/reactos/dll/keyboard/kbdja/kbdja.c @@ -2,7 +2,7 @@ * ReactOS USASCII Keyboard layout * Copyright (C) 2003 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -41,7 +41,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -50,14 +50,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', SC_27, VK_OEM_4, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', SC_40, SC_41, VK_EMPTY, + 'L', SC_40, SC_41, VK_EMPTY, VK_LSHIFT, VK_OEM_6, /* - 2c - */ /* Third letters row */ @@ -67,15 +67,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -91,11 +91,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -338,10 +338,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* English doesn't have any, anyway */ NULL, diff --git a/reactos/dll/keyboard/kbdno/kbdno.c b/reactos/dll/keyboard/kbdno/kbdno.c index 2f1bf435492..928ef902d01 100644 --- a/reactos/dll/keyboard/kbdno/kbdno.c +++ b/reactos/dll/keyboard/kbdno/kbdno.c @@ -32,7 +32,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -41,14 +41,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_6, VK_OEM_1, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, + 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, VK_LSHIFT, VK_OEM_2, /* - 2c - */ /* Third letters row */ @@ -58,15 +58,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -82,11 +82,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -169,7 +169,7 @@ ROSDATA MODIFIERS modifier_bits = { ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Normal vs Shifted */ /* The numbers */ - { VK_OEM_5, NOCAPS, {'|', 0xa7} }, /* Button to the left of 1. 0xa7=§ */ + { VK_OEM_5, NOCAPS, {'|', 0xa7} }, /* Button to the left of 1. 0xa7=§ */ { '1', NOCAPS, {'1', '!'} }, /* Ctrl-2 generates NUL */ { VK_OEM_PLUS, NOCAPS, {'+', '?'} }, @@ -182,7 +182,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_OEM_COMMA, CAPS, {',', ';'} }, { VK_OEM_PERIOD, CAPS, {'.', ':'} }, { VK_OEM_2, NOCAPS, {'\'', '*'} }, - + { VK_DECIMAL, NOCAPS, {',', ','} }, { VK_TAB, NOCAPS, {'\t', '\t'} }, { VK_ADD, NOCAPS, {'+', '+'} }, @@ -397,7 +397,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x004f, 0x00a8, 0x00d6, 0x0000) }, { DEADTRANS(0x0055, 0x00a8, 0x00dc, 0x0000) }, { DEADTRANS(0x0020, 0x00a8, 0x00a8, 0x0000) }, - + /* ^ */ { DEADTRANS(0x0061, 0x005e, 0x00e2, 0x0000) }, { DEADTRANS(0x0065, 0x005e, 0x00ea, 0x0000) }, @@ -454,10 +454,10 @@ ROSDATA DEADKEY dead_key[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ dead_key, diff --git a/reactos/dll/keyboard/kbdpl1/kbdpl1.c b/reactos/dll/keyboard/kbdpl1/kbdpl1.c index 18a8b61770c..34cb0699c30 100644 --- a/reactos/dll/keyboard/kbdpl1/kbdpl1.c +++ b/reactos/dll/keyboard/kbdpl1/kbdpl1.c @@ -3,7 +3,7 @@ * Copyright (C) 2007 ReactOS * License: LGPL, see: LGPL.txt * author: Sebastian Gasiorek - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html * @@ -40,7 +40,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -49,14 +49,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -66,15 +66,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -90,11 +90,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -337,10 +337,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ NULL, diff --git a/reactos/dll/keyboard/kbdpo/kbdpo.c b/reactos/dll/keyboard/kbdpo/kbdpo.c index 47939e4e89e..96c496b7067 100644 --- a/reactos/dll/keyboard/kbdpo/kbdpo.c +++ b/reactos/dll/keyboard/kbdpo/kbdpo.c @@ -5,7 +5,7 @@ * Based on kbdes, skbdda and skbdfr * * Made by Pedro Maia pedrom.maia@gmail.com - * + * * * http://keytouch.sourceforge.net/howto_keyboard/node4.html (Very Good) * http://www.microsoft.com/globaldev/tools/msklc.mspx (Keyboard layout file from MS) @@ -40,145 +40,145 @@ #define KNUMP 0x800 /* Number-pad */ #define KNUMS 0xc00 /* Special + number pad */ #define KMEXT 0x300 /* Multi + ext */ - + #define SHFT_INVALID 0x0F ROSDATA USHORT scancode_to_vk[] = { -/* 00 */ VK_EMPTY, -/* 01 */ VK_ESCAPE, -/* 02 */ '1', -/* 03 */ '2', -/* 04 */ '3', -/* 05 */ '4', -/* 06 */ '5', -/* 07 */ '6', -/* 08 */ '7', -/* 09 */ '8', -/* 0a */ '9', -/* 0b */ '0', -/* 0c */ VK_OEM_4, -/* 0d */ VK_OEM_6, -/* 0e */ VK_BACK, -/* 0f */ VK_TAB, -/* 10 */ 'Q', -/* 11 */ 'W', -/* 12 */ 'E', -/* 13 */ 'R', -/* 14 */ 'T', -/* 15 */ 'Y', -/* 16 */ 'U', -/* 17 */ 'I', -/* 18 */ 'O', -/* 19 */ 'P', -/* 1a */ VK_OEM_PLUS, -/* 1b */ VK_OEM_1, -/* 1c */ VK_RETURN, -/* 1d */ VK_LCONTROL, -/* 1e */ 'A', -/* 1f */ 'S', -/* 20 */ 'D', -/* 21 */ 'F', -/* 22 */ 'G', -/* 23 */ 'H', -/* 24 */ 'J', -/* 25 */ 'K', -/* 26 */ 'L', -/* 27 */ VK_OEM_3, -/* 28 */ VK_OEM_7, -/* 29 */ VK_OEM_5, -/* 2a */ VK_LSHIFT, -/* 2b */ VK_OEM_2, -/* 2c */ 'Z', -/* 2d */ 'X', -/* 2e */ 'C', -/* 2f */ 'V', -/* 30 */ 'B', -/* 31 */ 'N', -/* 32 */ 'M', -/* 33 */ VK_OEM_COMMA, -/* 34 */ VK_OEM_PERIOD, -/* 35 */ VK_OEM_MINUS, -/* 36 */ VK_RSHIFT, -/* 37 */ VK_MULTIPLY, -/* 38 */ VK_LMENU, -/* 39 */ VK_SPACE, -/* 3a */ VK_CAPITAL, -/* 3b */ VK_F1, -/* 3c */ VK_F2, -/* 3d */ VK_F3, -/* 3e */ VK_F4, -/* 3f */ VK_F5, -/* 40 */ VK_F6, -/* 41 */ VK_F7, -/* 42 */ VK_F8, -/* 43 */ VK_F9, -/* 44 */ VK_F10, -/* 45 */ VK_NUMLOCK | KMEXT, -/* 46 */ VK_SCROLL | KMULTI, -/* 47 */ VK_HOME | KNUMS, -/* 48 */ VK_UP | KNUMS, -/* 49 */ VK_PRIOR | KNUMS, -/* 4a */ VK_SUBTRACT, -/* 4b */ VK_LEFT | KNUMS, -/* 4c */ VK_CLEAR | KNUMS, -/* 4d */ VK_RIGHT | KNUMS, -/* 4e */ VK_ADD, -/* 4f */ VK_END | KNUMS, -/* 50 */ VK_DOWN | KNUMS, -/* 51 */ VK_NEXT | KNUMS, -/* 52 */ VK_INSERT | KNUMS, -/* 53 */ VK_DELETE | KNUMS, -/* 54 */ VK_SNAPSHOT, -/* 55 */ VK_EMPTY, -/* 56 */ VK_OEM_102, -/* 57 */ VK_F11, -/* 58 */ VK_F12, -/* 59 */ VK_EMPTY, -/* 5a */ VK_CLEAR, -/* 5b */ VK_EMPTY, -/* 5c */ VK_EMPTY, -/* 5d */ VK_EMPTY, +/* 00 */ VK_EMPTY, +/* 01 */ VK_ESCAPE, +/* 02 */ '1', +/* 03 */ '2', +/* 04 */ '3', +/* 05 */ '4', +/* 06 */ '5', +/* 07 */ '6', +/* 08 */ '7', +/* 09 */ '8', +/* 0a */ '9', +/* 0b */ '0', +/* 0c */ VK_OEM_4, +/* 0d */ VK_OEM_6, +/* 0e */ VK_BACK, +/* 0f */ VK_TAB, +/* 10 */ 'Q', +/* 11 */ 'W', +/* 12 */ 'E', +/* 13 */ 'R', +/* 14 */ 'T', +/* 15 */ 'Y', +/* 16 */ 'U', +/* 17 */ 'I', +/* 18 */ 'O', +/* 19 */ 'P', +/* 1a */ VK_OEM_PLUS, +/* 1b */ VK_OEM_1, +/* 1c */ VK_RETURN, +/* 1d */ VK_LCONTROL, +/* 1e */ 'A', +/* 1f */ 'S', +/* 20 */ 'D', +/* 21 */ 'F', +/* 22 */ 'G', +/* 23 */ 'H', +/* 24 */ 'J', +/* 25 */ 'K', +/* 26 */ 'L', +/* 27 */ VK_OEM_3, +/* 28 */ VK_OEM_7, +/* 29 */ VK_OEM_5, +/* 2a */ VK_LSHIFT, +/* 2b */ VK_OEM_2, +/* 2c */ 'Z', +/* 2d */ 'X', +/* 2e */ 'C', +/* 2f */ 'V', +/* 30 */ 'B', +/* 31 */ 'N', +/* 32 */ 'M', +/* 33 */ VK_OEM_COMMA, +/* 34 */ VK_OEM_PERIOD, +/* 35 */ VK_OEM_MINUS, +/* 36 */ VK_RSHIFT, +/* 37 */ VK_MULTIPLY, +/* 38 */ VK_LMENU, +/* 39 */ VK_SPACE, +/* 3a */ VK_CAPITAL, +/* 3b */ VK_F1, +/* 3c */ VK_F2, +/* 3d */ VK_F3, +/* 3e */ VK_F4, +/* 3f */ VK_F5, +/* 40 */ VK_F6, +/* 41 */ VK_F7, +/* 42 */ VK_F8, +/* 43 */ VK_F9, +/* 44 */ VK_F10, +/* 45 */ VK_NUMLOCK | KMEXT, +/* 46 */ VK_SCROLL | KMULTI, +/* 47 */ VK_HOME | KNUMS, +/* 48 */ VK_UP | KNUMS, +/* 49 */ VK_PRIOR | KNUMS, +/* 4a */ VK_SUBTRACT, +/* 4b */ VK_LEFT | KNUMS, +/* 4c */ VK_CLEAR | KNUMS, +/* 4d */ VK_RIGHT | KNUMS, +/* 4e */ VK_ADD, +/* 4f */ VK_END | KNUMS, +/* 50 */ VK_DOWN | KNUMS, +/* 51 */ VK_NEXT | KNUMS, +/* 52 */ VK_INSERT | KNUMS, +/* 53 */ VK_DELETE | KNUMS, +/* 54 */ VK_SNAPSHOT, +/* 55 */ VK_EMPTY, +/* 56 */ VK_OEM_102, +/* 57 */ VK_F11, +/* 58 */ VK_F12, +/* 59 */ VK_EMPTY, +/* 5a */ VK_CLEAR, +/* 5b */ VK_EMPTY, +/* 5c */ VK_EMPTY, +/* 5d */ VK_EMPTY, /* 5e */ VK_EMPTY, /* EREOF */ -/* 5f */ VK_EMPTY, -/* 60 */ VK_EMPTY, -/* 61 */ VK_EMPTY, -/* 62 */ VK_EMPTY, +/* 5f */ VK_EMPTY, +/* 60 */ VK_EMPTY, +/* 61 */ VK_EMPTY, +/* 62 */ VK_EMPTY, /* 63 */ VK_EMPTY, /* ZOOM */ -/* 64 */ VK_HELP, -/* 65 */ VK_F13, -/* 66 */ VK_F14, -/* 67 */ VK_F15, -/* 68 */ VK_F16, -/* 69 */ VK_F17, -/* 6a */ VK_F18, -/* 6b */ VK_F19, -/* 6c */ VK_F20, -/* 6d */ VK_F21, -/* 6e */ VK_F22, -/* 6f */ VK_F23, -/* 70 */ VK_EMPTY, -/* 71 */ VK_EMPTY, -/* 72 */ VK_EMPTY, -/* 73 */ VK_EMPTY, -/* 74 */ VK_EMPTY, -/* 75 */ VK_EMPTY, -/* 76 */ VK_EMPTY, -/* 77 */ VK_F24, -/* 78 */ VK_EMPTY, -/* 79 */ VK_EMPTY, -/* 7a */ VK_EMPTY, -/* 7b */ VK_EMPTY, -/* 7c */ VK_EMPTY, -/* 7d */ VK_EMPTY, -/* 7e */ VK_EMPTY, -/* 7f */ VK_EMPTY, -/* 80 */ VK_EMPTY, +/* 64 */ VK_HELP, +/* 65 */ VK_F13, +/* 66 */ VK_F14, +/* 67 */ VK_F15, +/* 68 */ VK_F16, +/* 69 */ VK_F17, +/* 6a */ VK_F18, +/* 6b */ VK_F19, +/* 6c */ VK_F20, +/* 6d */ VK_F21, +/* 6e */ VK_F22, +/* 6f */ VK_F23, +/* 70 */ VK_EMPTY, +/* 71 */ VK_EMPTY, +/* 72 */ VK_EMPTY, +/* 73 */ VK_EMPTY, +/* 74 */ VK_EMPTY, +/* 75 */ VK_EMPTY, +/* 76 */ VK_EMPTY, +/* 77 */ VK_F24, +/* 78 */ VK_EMPTY, +/* 79 */ VK_EMPTY, +/* 7a */ VK_EMPTY, +/* 7b */ VK_EMPTY, +/* 7c */ VK_EMPTY, +/* 7d */ VK_EMPTY, +/* 7e */ VK_EMPTY, +/* 7f */ VK_EMPTY, +/* 80 */ VK_EMPTY, /* 00 */ 0 }; - + ROSDATA VSC_VK extcode0_to_vk[] = { { 0x10, VK_MEDIA_PREV_TRACK | KEXT }, // Pista Anterior - { 0x19, VK_MEDIA_NEXT_TRACK | KEXT }, // Proxima Pista + { 0x19, VK_MEDIA_NEXT_TRACK | KEXT }, // Proxima Pista { 0x1D, VK_RCONTROL | KEXT }, // Tecla ctrl { 0x20, VK_VOLUME_MUTE | KEXT }, // Mute volume { 0x21, VK_LAUNCH_APP2 | KEXT }, // Tecla calculadora @@ -246,7 +246,7 @@ ROSDATA VSC_VK extcode1_to_vk[] = { /* Modifiers */ - + ROSDATA VK_TO_BIT modifier_keys[] = { { VK_SHIFT, KSHIFT }, { VK_CONTROL, KCTRL }, @@ -257,7 +257,7 @@ ROSDATA VK_TO_BIT modifier_keys[] = { ROSDATA MODIFIERS modifier_bits = { modifier_keys, 6, - { 0, 1<<0, 1<<1, 1<<2, SHFT_INVALID, SHFT_INVALID, 3 } + { 0, 1<<0, 1<<1, 1<<2, SHFT_INVALID, SHFT_INVALID, 3 } /* NONE, SHIFT, CTRL, ALT, MENU, SHIFT + MENU, SHIFT+CONTROL */ }; @@ -286,7 +286,7 @@ ROSDATA VK_TO_WCHARS1 keypad_numbers[] = { ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { /* Normal vs Shifted */ - + /* The alphabet */ { 'A', CAPS, {'a', 'A'} }, { 'B', CAPS, {'b', 'B'} }, @@ -318,7 +318,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { //De 2 ate 4 tem tres estados { '1', NOCAPS, {'1', '!'} }, { '5', NOCAPS, {'5', '%'} }, - { '6', NOCAPS, {'6', '&'} }, + { '6', NOCAPS, {'6', '&'} }, //De 7 ate 0 tem tres estados /* Specials */ @@ -335,7 +335,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_EMPTY, NOCAPS, { ACUTE_CHAR, GRAVE_CHAR} }, { ORDERN_SUPERSCRIPT, NOCAPS, { 0xBA, 0xAA} }, // º ª - { MATH_RELATE, NOCAPS, { '<', '>'} }, + { MATH_RELATE, NOCAPS, { '<', '>'} }, { VK_OEM_COMMA, NOCAPS, { ',', ';'} }, { VK_OEM_PERIOD, NOCAPS, { '.', ':'} }, { VK_OEM_MINUS, NOCAPS, { '-', '_'} }, @@ -352,7 +352,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { 0, 0 } }; - + ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Normal, Shifted, Ctrl */ @@ -411,7 +411,7 @@ ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[] = { ROSDATA DEADKEY deadkey[] = { - //*´* DEADKEY 00B4 + //*´* DEADKEY 00B4 { DEADTRANS(L'a', 0xb4, 0xe1, 0x00) }, // letra a com ´ { DEADTRANS(L'A', 0xb4, 0xc1, 0x00) }, // letra A com ´ { DEADTRANS(L'e', 0xb4, 0xe9, 0x00) }, // letra e com ´ @@ -577,7 +577,7 @@ ROSDATA DEADKEY_LPWSTR dead_key_names[] = { L"\x00a8" L"Trema", NULL }; - + @@ -588,28 +588,28 @@ ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* Portuguese have severals */ deadkey, - + /* Key names */ (VSC_LPWSTR *)key_names, (VSC_LPWSTR *)extended_key_names, dead_key_names, /* Dead key names */ - + /* scan code to virtual key maps */ scancode_to_vk, sizeof(scancode_to_vk) / sizeof(scancode_to_vk[0]), extcode0_to_vk, extcode1_to_vk, - + MAKELONG(0,1), /* Version 1.0 */ - + /* Ligatures -- Portuguese doesn't have any, that i'm aware */ 0, 0, diff --git a/reactos/dll/keyboard/kbdru/kbdru.c b/reactos/dll/keyboard/kbdru/kbdru.c index 765210c236f..8ad0adf0c8b 100644 --- a/reactos/dll/keyboard/kbdru/kbdru.c +++ b/reactos/dll/keyboard/kbdru/kbdru.c @@ -3,7 +3,7 @@ * Copyright (C) 2005 ReactOS * Author: Aleksey Bragin * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -38,7 +38,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -47,14 +47,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -64,15 +64,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ 0x26a, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -88,11 +88,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_OEM_WSCTRL,VK_OEM_FINISH,VK_OEM_JUMP, VK_EREOF, /* EREOF */ VK_OEM_BACKTAB, VK_OEM_AUTO, VK_EMPTY, VK_ZOOM, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_OEM_PA3, VK_EMPTY, VK_OEM_RESET, @@ -238,7 +238,7 @@ ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Legacy (telnet-style) ascii escapes */ { VK_OEM_5, NOCAPS, {0x5c, 0x2f, 0x1c} }, { VK_OEM_102, NOCAPS, {0x5c, 0x2f, 0x1c} }, - { VK_BACK, NOCAPS, {0x8, 0x8, 0x7f} }, + { VK_BACK, NOCAPS, {0x8, 0x8, 0x7f} }, { VK_ESCAPE, NOCAPS, {0x1b, 0x1b, 0x1b} }, { VK_RETURN, NOCAPS, {'\r', '\r', '\n'} }, { VK_SPACE, NOCAPS, {' ', ' ', ' '} }, @@ -365,10 +365,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks */ NULL, diff --git a/reactos/dll/keyboard/kbdsg/kbdsg.c b/reactos/dll/keyboard/kbdsg/kbdsg.c index bb0c5be0d27..c77c268e9cb 100644 --- a/reactos/dll/keyboard/kbdsg/kbdsg.c +++ b/reactos/dll/keyboard/kbdsg/kbdsg.c @@ -2,7 +2,7 @@ * ReactOS German (Switzerland) ASCII Keyboard layout * Copyright (C) 2005 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html * and http://www.unicode.org/charts/ @@ -39,7 +39,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -48,14 +48,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_1, VK_OEM_PLUS, VK_RETURN, /* - 1d - */ /* Second Letters Row */ VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, + 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, /* - 2c - */ /* Third letters row */ VK_LSHIFT, VK_OEM_2, @@ -65,15 +65,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -89,11 +89,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -191,7 +191,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { '5', NOCAPS, {'5', '%'} }, { '9', NOCAPS, {'9', ')'} }, { '0', NOCAPS, {'0', '='} }, - + /* First letter row */ { 'W', CAPS, {'w', 'W'} }, { 'R', CAPS, {'r', 'R'} }, @@ -237,7 +237,7 @@ ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { { VK_OEM_4, NOCAPS, {'\'' , '?' , WCH_DEAD} }, /* ' ? ´ */ { 0xff, NOCAPS, {WCH_NONE, WCH_NONE, 0xb4} }, { 'Q', CAPS, {'q', 'Q', '@'} }, - { 'C', CAPS, {'c', 'C', 0xa9} }, /* c C Copyright-Sign */ + { 'C', CAPS, {'c', 'C', 0xa9} }, /* c C Copyright-Sign */ { 'E', CAPS, {'e', 'E', 0x20ac} }, /* e E € */ { 'M', CAPS, {'m', 'M', 0xb5} }, /* m M mu-Sign */ { VK_OEM_102, NOCAPS, {'<', '>', '\\'} }, @@ -269,7 +269,7 @@ ROSDATA VK_TO_WCHARS5 key_to_chars_5mod[] = { { VK_OEM_6, NOCAPS, {WCH_DEAD, WCH_DEAD, WCH_DEAD, WCH_NONE, 0x00} }, /* ^ ` ~ */ { 0xff, NOCAPS, {0x5e , 0x27 , 0x7e , WCH_NONE, 0x00} }, { VK_OEM_7, KCTRL, {0xe4, 0xe0, 0x7b, 0xc4, 0xc0} }, /* ä à { Ä À */ - { VK_OEM_PLUS, NOCAPS, {WCH_DEAD, 0x21 , 0x5D , WCH_NONE, 0x00} }, /* ¨ ! ] */ + { VK_OEM_PLUS, NOCAPS, {WCH_DEAD, 0x21 , 0x5D , WCH_NONE, 0x00} }, /* ¨ ! ] */ { 0xff, NOCAPS, {0xa8 , WCH_NONE, WCH_NONE, WCH_NONE, 0x00} }, { 0, 0 } }; @@ -430,16 +430,16 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(L' ', L'`', L'`', 0x00) }, { DEADTRANS(L' ', 0xa8, 0xa8, 0x00) }, /* ¨ */ { DEADTRANS(L'a', 0xa8, 0xe4, 0x00) }, - { DEADTRANS(L'e', 0xa8, 0xeb, 0x00) }, + { DEADTRANS(L'e', 0xa8, 0xeb, 0x00) }, { DEADTRANS(L'i', 0xa8, 0xef, 0x00) }, { DEADTRANS(L'o', 0xa8, 0xf6, 0x00) }, { DEADTRANS(L'u', 0xa8, 0xfc, 0x00) }, { DEADTRANS(L'y', 0xa8, 0xff, 0x00) }, { DEADTRANS(L'A', 0xa8, 0xc4, 0x00) }, { DEADTRANS(L'E', 0xa8, 0xcb, 0x00) }, - { DEADTRANS(L'I', 0xa8, 0xcf, 0x00) }, + { DEADTRANS(L'I', 0xa8, 0xcf, 0x00) }, { DEADTRANS(L'O', 0xa8, 0xd6, 0x00) }, - { DEADTRANS(L'U', 0xa8, 0xdc, 0x00) }, + { DEADTRANS(L'U', 0xa8, 0xdc, 0x00) }, { DEADTRANS(L' ', 0x7e, 0x7e, 0x00) }, /* ~ */ { DEADTRANS(L'a', 0x7e, 0xe3, 0x00) }, { DEADTRANS(L'o', 0x7e, 0xf5, 0x00) }, @@ -454,10 +454,10 @@ ROSDATA DEADKEY dead_key[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ dead_key, diff --git a/reactos/dll/keyboard/kbdsk/kbdsk.c b/reactos/dll/keyboard/kbdsk/kbdsk.c index b4589b7fc99..70f1fba2be1 100644 --- a/reactos/dll/keyboard/kbdsk/kbdsk.c +++ b/reactos/dll/keyboard/kbdsk/kbdsk.c @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_3, VK_OEM_8, + 'L', VK_OEM_1, VK_OEM_3, VK_OEM_8, VK_LSHIFT, VK_OEM_7, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_MENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -85,11 +85,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -161,7 +161,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_EMPTY, 0, {WCH_NONE, 0x00b0} }, // VK_OEM_8 death { VK_OEM_COMMA, NOCAPS, {',', '?'} }, { VK_OEM_PERIOD, NOCAPS, {'.', ':'} }, - + /* Keys that do not have shift states */ { VK_TAB, NOCAPS, {'\t','\t'} }, { VK_ADD, NOCAPS, {'+', '+'} }, @@ -379,10 +379,10 @@ ROSDATA DEADKEY_LPWSTR dead_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- */ dead_key, diff --git a/reactos/dll/keyboard/kbdsw/kbdsw.c b/reactos/dll/keyboard/kbdsw/kbdsw.c index 2e3f1a8ef6e..e7cf00c1c56 100644 --- a/reactos/dll/keyboard/kbdsw/kbdsw.c +++ b/reactos/dll/keyboard/kbdsw/kbdsw.c @@ -2,7 +2,7 @@ * ReactOS Swedish ASCII Keyboard layout * Copyright (C) 2004 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -37,7 +37,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -46,14 +46,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_6, VK_OEM_1, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, + 'L', VK_OEM_3, VK_OEM_7, VK_OEM_5, VK_LSHIFT, VK_OEM_2, /* - 2c - */ /* Third letters row */ @@ -63,15 +63,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -87,11 +87,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -181,11 +181,11 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_OEM_4, NOCAPS, {WCH_DEAD, WCH_DEAD} }, { VK_OEM_7, CAPS, {0xe4,0xc4} }, { VK_OEM_3, CAPS, {0xf6, 0xd6} }, - + { VK_OEM_COMMA, CAPS, {',', ';'} }, { VK_OEM_PERIOD, CAPS, {'.', ':'} }, { VK_OEM_2, NOCAPS, {'\'', '*'} }, - + { VK_DECIMAL, NOCAPS, {',',','} }, { VK_TAB, NOCAPS, {'\t', '\t'} }, { VK_ADD, NOCAPS, {'+', '+'} }, @@ -241,7 +241,7 @@ ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { /* Normal, Shifted, Ctrl, Ctrl-Alt */ /* Legacy Ascii generators */ - + { '2', NOCAPS, {'2', '\"', WCH_NONE,'@'} }, { '3', NOCAPS, {'3', '#', WCH_NONE, 0x00a3} }, { '4', NOCAPS, {'4', 0xa4, WCH_NONE, '$'} }, @@ -397,7 +397,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x004f, 0x00a8, 0x00d6, 0x0000) }, { DEADTRANS(0x0055, 0x00a8, 0x00dc, 0x0000) }, { DEADTRANS(0x0020, 0x00a8, 0x00a8, 0x0000) }, - + { DEADTRANS(0x0061, 0x005e, 0x00e2, 0x0000) }, { DEADTRANS(0x0065, 0x005e, 0x00ea, 0x0000) }, { DEADTRANS(0x0069, 0x005e, 0x00ee, 0x0000) }, @@ -409,7 +409,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x004f, 0x005e, 0x00d4, 0x0000) }, { DEADTRANS(0x0055, 0x005e, 0x00db, 0x0000) }, { DEADTRANS(0x0020, 0x005e, 0x005e, 0x0000) }, - + { DEADTRANS(0x0061, 0x007e, 0x00e3, 0x0000) }, { DEADTRANS(0x006f, 0x007e, 0x00f5, 0x0000) }, { DEADTRANS(0x006e, 0x007e, 0x00f1, 0x0000) }, @@ -417,7 +417,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x004f, 0x007e, 0x00d5, 0x0000) }, { DEADTRANS(0x004e, 0x007e, 0x00d1, 0x0000) }, { DEADTRANS(0x0020, 0x007e, 0x007e, 0x0000) }, - + { DEADTRANS(0x0061, 0x00b4, 0x00e1, 0x0000) }, { DEADTRANS(0x0065, 0x00b4, 0x00e9, 0x0000) }, { DEADTRANS(0x0069, 0x00b4, 0x00ed, 0x0000) }, @@ -431,7 +431,7 @@ ROSDATA DEADKEY dead_key[] = { { DEADTRANS(0x0055, 0x00b4, 0x00da, 0x0000) }, { DEADTRANS(0x0059, 0x00b4, 0x00dd, 0x0000) }, { DEADTRANS(0x0020, 0x00b4, 0x00b4, 0x0000) }, - + { DEADTRANS(0x0061, 0x0060, 0x00e0, 0x0000) }, { DEADTRANS(0x0065, 0x0060, 0x00e8, 0x0000) }, { DEADTRANS(0x0069, 0x0060, 0x00ec, 0x0000) }, @@ -450,10 +450,10 @@ ROSDATA DEADKEY dead_key[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ dead_key, diff --git a/reactos/dll/keyboard/kbdth/kbdth.c b/reactos/dll/keyboard/kbdth/kbdth.c index 9629b194801..6f6504c825e 100644 --- a/reactos/dll/keyboard/kbdth/kbdth.c +++ b/reactos/dll/keyboard/kbdth/kbdth.c @@ -2,7 +2,7 @@ * ReactOS Thai keyboard layout (traditional) * Copyright (C) 2007 ReactOS * License: LGPL, see: LGPL.txt - * + * */ #include @@ -33,7 +33,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -42,14 +42,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -59,15 +59,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -351,10 +351,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ NULL, diff --git a/reactos/dll/keyboard/kbduk/kbduk.c b/reactos/dll/keyboard/kbduk/kbduk.c index cf4b0263884..ad5be791144 100644 --- a/reactos/dll/keyboard/kbduk/kbduk.c +++ b/reactos/dll/keyboard/kbduk/kbduk.c @@ -2,7 +2,7 @@ * ReactOS USASCII Keyboard layout * Copyright (C) 2003 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_3, VK_OEM_8, + 'L', VK_OEM_1, VK_OEM_3, VK_OEM_8, VK_LSHIFT, VK_OEM_7, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_MENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -85,11 +85,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -151,7 +151,7 @@ ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[] = { { VK_OEM_PERIOD, NOCAPS, {'.', '>'} }, { VK_OEM_2, NOCAPS, {'/', '?'} }, - + /* Keys that do not have shift states */ { VK_TAB, NOCAPS, {'\t','\t'} }, { VK_ADD, NOCAPS, {'+', '+'} }, @@ -201,7 +201,7 @@ ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[] = { { 'Z', CAPS, {'z', 'Z', 0x1a, 0x1a} }, /* Legacy Ascii generators */ - + { '6', NOCAPS, {'6', '^', WCH_NONE, 0x1e} }, { VK_OEM_MINUS, NOCAPS, {'-', '_', WCH_NONE, 0x1f} }, { VK_OEM_3, NOCAPS, {'\'', '@', WCH_NONE, 0x00} }, @@ -218,7 +218,7 @@ ROSDATA VK_TO_WCHARS5 key_to_chars_5mod[] = { ROSDATA VK_TO_WCHARS6 key_to_chars_6mod[] = { /* Normal, Shifted, Ctrl, Sh-Ctrl,Sh-Alt,Ctl-Alt,Ctl-Sh-Alt */ - + { 'E', CAPS, {'e', 'E', 0x05, 0x05, 0x00e9, 0x00c9} }, { 'U', CAPS, {'u', 'U', 0x15, 0x15, 0x00fa, 0x00da} }, { 'I', CAPS, {'i', 'I', 0x09, 0x09, 0x00ed, 0x00cd} }, @@ -341,10 +341,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* English doesn't have any, anyway */ NULL, diff --git a/reactos/dll/keyboard/kbdur/kbdur.c b/reactos/dll/keyboard/kbdur/kbdur.c index 91273e22e4c..1d04c2ed61e 100644 --- a/reactos/dll/keyboard/kbdur/kbdur.c +++ b/reactos/dll/keyboard/kbdur/kbdur.c @@ -3,7 +3,7 @@ * Copyright (C) 2005 ReactOS * Author: Artem Reznikov * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -38,7 +38,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -47,14 +47,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -64,15 +64,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ 0x26a, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -88,11 +88,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_OEM_WSCTRL,VK_OEM_FINISH,VK_OEM_JUMP, VK_EREOF, /* EREOF */ VK_OEM_BACKTAB, VK_OEM_AUTO, VK_EMPTY, VK_ZOOM, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_OEM_PA3, VK_EMPTY, VK_OEM_RESET, @@ -238,7 +238,7 @@ ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[] = { /* Legacy (telnet-style) ascii escapes */ { VK_OEM_5, NOCAPS, {0x5c, 0x2f, 0x1c} }, { VK_OEM_102, NOCAPS, {0x5c, 0x2f, 0x1c} }, - { VK_BACK, NOCAPS, {0x8, 0x8, 0x7f} }, + { VK_BACK, NOCAPS, {0x8, 0x8, 0x7f} }, { VK_ESCAPE, NOCAPS, {0x1b, 0x1b, 0x1b} }, { VK_RETURN, NOCAPS, {'\r', '\r', '\n'} }, { VK_SPACE, NOCAPS, {' ', ' ', ' '} }, @@ -366,10 +366,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks */ NULL, diff --git a/reactos/dll/keyboard/kbdus/kbdus.c b/reactos/dll/keyboard/kbdus/kbdus.c index 58667631446..50d05d8a081 100644 --- a/reactos/dll/keyboard/kbdus/kbdus.c +++ b/reactos/dll/keyboard/kbdus/kbdus.c @@ -2,7 +2,7 @@ * ReactOS USASCII Keyboard layout * Copyright (C) 2003 ReactOS * License: LGPL, see: LGPL.txt - * + * * Thanks to: http://www.barcodeman.com/altek/mule/scandoc.php * and http://win.tue.nl/~aeb/linux/kbd/scancodes-1.html */ @@ -35,7 +35,7 @@ ROSDATA USHORT scancode_to_vk[] = { /* Numbers Row */ /* - 00 - */ - /* 1 ... 2 ... 3 ... 4 ... */ + /* 1 ... 2 ... 3 ... 4 ... */ VK_EMPTY, VK_ESCAPE, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,14 +44,14 @@ ROSDATA USHORT scancode_to_vk[] = { /* First Letters Row */ VK_TAB, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', - 'I', 'O', 'P', + 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ /* Second Letters Row */ - VK_LCONTROL, + VK_LCONTROL, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', - 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, + 'L', VK_OEM_1, VK_OEM_7, VK_OEM_3, VK_LSHIFT, VK_OEM_5, /* - 2c - */ /* Third letters row */ @@ -61,15 +61,15 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 37 - */ /* Bottom Row */ VK_MULTIPLY, VK_LMENU, VK_SPACE, VK_CAPITAL, - + /* - 3b - */ /* F-Keys */ - VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, + VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* - 45 - */ /* Locks */ - VK_NUMLOCK | KMEXT, - VK_SCROLL | KMULTI, + VK_NUMLOCK | KMEXT, + VK_SCROLL | KMULTI, /* - 47 - */ /* Number-Pad */ VK_HOME | KNUMS, VK_UP | KNUMS, VK_PRIOR | KNUMS, VK_SUBTRACT, @@ -85,11 +85,11 @@ ROSDATA USHORT scancode_to_vk[] = { /* - 59 - */ VK_CLEAR, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* EREOF */ VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, VK_EMPTY, /* ZOOM */ - VK_HELP, + VK_HELP, /* - 64 - */ /* Even more F-Keys (for example, NCR keyboards from the early 90's) */ VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, - VK_F21, VK_F22, VK_F23, + VK_F21, VK_F22, VK_F23, /* - 6f - */ /* Not sure who uses these codes */ VK_EMPTY, VK_EMPTY, VK_EMPTY, @@ -324,10 +324,10 @@ ROSDATA VSC_LPWSTR extended_key_names[] = { ROSDATA KBDTABLES keyboard_layout_table = { /* modifier assignments */ &modifier_bits, - + /* character from vk tables */ vk_to_wchar_master_table, - + /* diacritical marks -- currently implemented by wine code */ /* English doesn't have any, anyway */ NULL, diff --git a/reactos/dll/ntdll/inc/ntdllp.h b/reactos/dll/ntdll/inc/ntdllp.h index 53a981547c0..5e9265f1957 100644 --- a/reactos/dll/ntdll/inc/ntdllp.h +++ b/reactos/dll/ntdll/inc/ntdllp.h @@ -23,7 +23,7 @@ PEPFUNC LdrPEStartup (PVOID ImageBase, HANDLE SectionHandle, PLDR_DATA_TABLE_ENTRY* Module, PWSTR FullDosName); -typedef BOOL +typedef BOOL (NTAPI *PDLLMAIN_FUNC)(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved); diff --git a/reactos/dll/ntdll/rtl/libsupp.c b/reactos/dll/ntdll/rtl/libsupp.c index 82d911e1aba..58a57df2fe9 100644 --- a/reactos/dll/ntdll/rtl/libsupp.c +++ b/reactos/dll/ntdll/rtl/libsupp.c @@ -137,7 +137,7 @@ RtlpAllocateMemory(UINT Bytes, ULONG Tag) { UNREFERENCED_PARAMETER(Tag); - + return RtlAllocateHeap(RtlGetProcessHeap(), 0, Bytes); @@ -150,7 +150,7 @@ RtlpFreeMemory(PVOID Mem, ULONG Tag) { UNREFERENCED_PARAMETER(Tag); - + RtlFreeHeap(RtlGetProcessHeap(), 0, Mem); @@ -290,7 +290,7 @@ VOID RtlpFreeAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) { PRTL_HANDLE_TABLE_ENTRY RtlHandleEntry; - + if (RtlIsValidIndexHandle(&AtomTable->RtlHandleTable, (ULONG)Entry->HandleIndex, &RtlHandleEntry)) @@ -305,7 +305,7 @@ RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) { ULONG HandleIndex; PRTL_HANDLE_TABLE_ENTRY RtlHandle; - + RtlHandle = RtlAllocateHandle(&AtomTable->RtlHandleTable, &HandleIndex); if (RtlHandle != NULL) @@ -327,7 +327,7 @@ RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) { /* set the valid flag, otherwise RtlFreeHandle will fail! */ AtomHandle->Handle.Flags = RTL_HANDLE_VALID; - + RtlFreeHandle(&AtomTable->RtlHandleTable, RtlHandle); } @@ -340,7 +340,7 @@ PRTL_ATOM_TABLE_ENTRY RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index) { PRTL_HANDLE_TABLE_ENTRY RtlHandle; - + if (RtlIsValidIndexHandle(&AtomTable->RtlHandleTable, Index, &RtlHandle)) @@ -349,7 +349,7 @@ RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index) return AtomHandle->AtomEntry; } - + return NULL; } diff --git a/reactos/dll/win32/acledit/acleditint.h b/reactos/dll/win32/acledit/acleditint.h index c14c7a6f12a..3b10fa5f4f3 100644 --- a/reactos/dll/win32/acledit/acleditint.h +++ b/reactos/dll/win32/acledit/acleditint.h @@ -46,9 +46,9 @@ typedef struct _ACL_EDIT_CONTROL LPWSTR lpDefaultPermissionName; } ACL_EDIT_CONTROL, *PACL_EDIT_CONTROL; -typedef DWORD (CALLBACK *PACL_CHANGE)(HWND hWnd, - HINSTANCE hInstance, - PVOID pCallbackContext, +typedef DWORD (CALLBACK *PACL_CHANGE)(HWND hWnd, + HINSTANCE hInstance, + PVOID pCallbackContext, PSECURITY_DESCRIPTOR pNewSD, PSECURITY_DESCRIPTOR pNewObjectSD, BOOL bApplyToSubContainers, diff --git a/reactos/dll/win32/acledit/stubs.c b/reactos/dll/win32/acledit/stubs.c index cde3650cafb..b679c6036aa 100644 --- a/reactos/dll/win32/acledit/stubs.c +++ b/reactos/dll/win32/acledit/stubs.c @@ -79,7 +79,7 @@ SedDiscretionaryAclEditor(HWND hWndOwner, DWORD Reserved) { UNREFERENCED_PARAMETER(hWndOwner); - UNREFERENCED_PARAMETER(hInstance); + UNREFERENCED_PARAMETER(hInstance); UNREFERENCED_PARAMETER(lpMachineName); UNREFERENCED_PARAMETER(pAclDlgControl); UNREFERENCED_PARAMETER(pAclEditControl); diff --git a/reactos/dll/win32/aclui/aclui.c b/reactos/dll/win32/aclui/aclui.c index d2d09d76895..008a97ee513 100644 --- a/reactos/dll/win32/aclui/aclui.c +++ b/reactos/dll/win32/aclui/aclui.c @@ -106,7 +106,7 @@ FreePrincipalsList(IN PSECURITY_PAGE sp, { PPRINCIPAL_LISTITEM CurItem, NextItem; PACE_ENTRY AceEntry, NextAceEntry; - + CurItem = *PrincipalsListHead; while (CurItem != NULL) { @@ -140,7 +140,7 @@ FreePrincipalsList(IN PSECURITY_PAGE sp, CurItem); CurItem = NextItem; } - + *PrincipalsListHead = NULL; } @@ -180,7 +180,7 @@ FindSidInPrincipalsListAddAce(IN PPRINCIPAL_LISTITEM PrincipalsListHead, IN PACE_HEADER AceHeader) { PPRINCIPAL_LISTITEM CurItem; - + for (CurItem = PrincipalsListHead; CurItem != NULL; CurItem = CurItem->Next) @@ -198,7 +198,7 @@ FindSidInPrincipalsListAddAce(IN PPRINCIPAL_LISTITEM PrincipalsListHead, break; } } - + return NULL; } @@ -246,13 +246,13 @@ AddPrincipalToList(IN PSECURITY_PAGE sp, AceHeader)) { DWORD SidLength; - + PrincipalLink = &sp->PrincipalsListHead; while (*PrincipalLink != NULL) { PrincipalLink = &(*PrincipalLink)->Next; } - + SidLength = GetLengthSid(Sid); /* allocate the principal */ @@ -587,7 +587,7 @@ ClearOwner: PSID Sid; PACE_HEADER AceHeader; ULONG AceIndex; - + for (AceIndex = 0; AceIndex < Dacl->AceCount; AceIndex++) @@ -630,7 +630,7 @@ UpdateControlStates(IN PSECURITY_PAGE sp) Selected != NULL); EnableWindow(sp->hAceCheckList, Selected != NULL); - + if (Selected != NULL) { LPWSTR szLabel; @@ -655,7 +655,7 @@ UpdateControlStates(IN PSECURITY_PAGE sp) else { WCHAR szPermissions[255]; - + if (LoadString(hDllInstance, IDS_PERMISSIONS, szPermissions, @@ -749,7 +749,7 @@ SecurityPageCallback(IN HWND hwnd, IN LPPROPSHEETPAGE ppsp) { PSECURITY_PAGE sp = (PSECURITY_PAGE)ppsp->lParam; - + switch (uMsg) { case PSPCB_CREATE: @@ -903,17 +903,17 @@ ResizeControls(IN PSECURITY_PAGE sp, HDWP dwp; INT nControls = 8; LVCOLUMN lvc; - + hWndAllow = GetDlgItem(sp->hWnd, IDC_LABEL_ALLOW); hWndDeny = GetDlgItem(sp->hWnd, IDC_LABEL_DENY); - + GetWindowRect(sp->hWnd, &rcWnd); cxEdge = GetSystemMetrics(SM_CXEDGE); - + /* use the left margin of the principal list view control for all control margins */ pt.x = 0; @@ -923,12 +923,12 @@ ResizeControls(IN PSECURITY_PAGE sp, &pt, 1); cxWidth = Width - (2 * pt.x); - + if (sp->ObjectInfo.dwFlags & SI_ADVANCED) { nControls += 2; } - + if ((dwp = BeginDeferWindowPos(nControls))) { /* resize the owner edit field */ @@ -1200,7 +1200,7 @@ AddSelectedPrincipal(IN IDsObjectPicker *pDsObjectPicker, { PACE_HEADER AceHeader; PSECURITY_PAGE sp = (PSECURITY_PAGE)Context; - + AceHeader = BuildDefaultPrincipalAce(sp, pSid); if (AceHeader != NULL) @@ -1255,7 +1255,7 @@ SecurityPageProc(IN HWND hwndDlg, case LVN_ITEMCHANGED: { LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam; - + if ((pnmv->uChanged & LVIF_STATE) && ((pnmv->uOldState & (LVIS_FOCUSED | LVIS_SELECTED)) || (pnmv->uNewState & (LVIS_FOCUSED | LVIS_SELECTED)))) @@ -1273,7 +1273,7 @@ SecurityPageProc(IN HWND hwndDlg, case CLN_CHANGINGITEMCHECKBOX: { PNMCHANGEITEMCHECKBOX pcicb = (PNMCHANGEITEMCHECKBOX)lParam; - + /* make sure only one of both checkboxes is only checked at the same time */ if (pcicb->Checked) @@ -1303,7 +1303,7 @@ SecurityPageProc(IN HWND hwndDlg, } break; } - + case WM_COMMAND: { switch (LOWORD(wParam)) @@ -1311,7 +1311,7 @@ SecurityPageProc(IN HWND hwndDlg, case IDC_ADD_PRINCIPAL: { HRESULT hRet; - + hRet = InitializeObjectPicker(sp->ServerName, &sp->ObjectInfo, &sp->pDsObjectPicker); @@ -1325,7 +1325,7 @@ SecurityPageProc(IN HWND hwndDlg, { MessageBox(hwndDlg, L"InvokeObjectPickerDialog failed!\n", NULL, 0); } - + /* delete the instance */ FreeObjectPicker(sp->pDsObjectPicker); } @@ -1350,7 +1350,7 @@ SecurityPageProc(IN HWND hwndDlg, } break; } - + case WM_SIZE: { ResizeControls(sp, @@ -1358,7 +1358,7 @@ SecurityPageProc(IN HWND hwndDlg, (INT)HIWORD(lParam)); break; } - + case WM_INITDIALOG: { sp = (PSECURITY_PAGE)((LPPROPSHEETPAGE)lParam)->lParam; @@ -1366,7 +1366,7 @@ SecurityPageProc(IN HWND hwndDlg, { LV_COLUMN lvc; RECT rcLvClient; - + sp->hWnd = hwndDlg; sp->hWndPrincipalsList = GetDlgItem(hwndDlg, IDC_PRINCIPALS); sp->hBtnAdd = GetDlgItem(hwndDlg, IDC_ADD_PRINCIPAL); @@ -1374,7 +1374,7 @@ SecurityPageProc(IN HWND hwndDlg, sp->hBtnAdvanced = GetDlgItem(hwndDlg, IDC_ADVANCED); sp->hAceCheckList = GetDlgItem(hwndDlg, IDC_ACE_CHECKLIST); sp->hPermissionsForLabel = GetDlgItem(hwndDlg, IDC_LABEL_PERMISSIONS_FOR); - + sp->SpecialPermCheckIndex = -1; /* save the pointer to the structure */ @@ -1419,7 +1419,7 @@ SecurityPageProc(IN HWND hwndDlg, GetClientRect(sp->hWndPrincipalsList, &rcLvClient); - + /* add a column to the list view */ lvc.mask = LVCF_FMT | LVCF_WIDTH; lvc.fmt = LVCFMT_LEFT; @@ -1427,9 +1427,9 @@ SecurityPageProc(IN HWND hwndDlg, (void)ListView_InsertColumn(sp->hWndPrincipalsList, 0, &lvc); - + ReloadPrincipalsList(sp); - + ListViewSelectItem(sp->hWndPrincipalsList, 0); @@ -1461,7 +1461,7 @@ SecurityPageProc(IN HWND hwndDlg, ShowWindow(GetDlgItem(hwndDlg, IDC_LABEL_ADVANCED), SW_HIDE); } - + /* enable quicksearch for the permissions checklist control */ SendMessage(sp->hAceCheckList, CLM_ENABLEQUICKSEARCH, @@ -1540,7 +1540,7 @@ CreateSecurityPage(IN LPSECURITYINFO psi) DPRINT("CoInitialize failed!\n"); return NULL; } - + sPage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SECURITY_PAGE)); @@ -1550,7 +1550,7 @@ CreateSecurityPage(IN LPSECURITYINFO psi) CoUninitialize(); SetLastError(ERROR_NOT_ENOUGH_MEMORY); - + DPRINT("Not enough memory to allocate a SECURITY_PAGE!\n"); return NULL; } @@ -1584,7 +1584,7 @@ CreateSecurityPage(IN LPSECURITYINFO psi) { psp.pszTitle = NULL; } - + /* NOTE: the SECURITY_PAGE structure will be freed by the property page callback! */ diff --git a/reactos/dll/win32/aclui/checklist.c b/reactos/dll/win32/aclui/checklist.c index 8c7be8f7ad6..b4a1274b9fb 100644 --- a/reactos/dll/win32/aclui/checklist.c +++ b/reactos/dll/win32/aclui/checklist.c @@ -109,22 +109,22 @@ NotifyControlParent(IN PCHECKLISTWND infoPtr, IN OUT PVOID data) { LRESULT Ret = 0; - + if (infoPtr->hNotify != NULL) { LPNMHDR pnmh = (LPNMHDR)data; - + pnmh->hwndFrom = infoPtr->hSelf; pnmh->idFrom = GetWindowLongPtr(infoPtr->hSelf, GWLP_ID); pnmh->code = code; - + Ret = SendMessage(infoPtr->hNotify, WM_NOTIFY, (WPARAM)pnmh->idFrom, (LPARAM)pnmh); } - + return Ret; } @@ -133,7 +133,7 @@ FindCheckItemByIndex(IN PCHECKLISTWND infoPtr, IN INT Index) { PCHECKITEM Item, Found = NULL; - + if (Index >= 0) { for (Item = infoPtr->CheckItemListHead; @@ -149,7 +149,7 @@ FindCheckItemByIndex(IN PCHECKLISTWND infoPtr, Index--; } } - + return Found; } @@ -182,7 +182,7 @@ CheckItemToIndex(IN PCHECKLISTWND infoPtr, { PCHECKITEM CurItem; INT Index; - + for (CurItem = infoPtr->CheckItemListHead, Index = 0; CurItem != NULL; CurItem = CurItem->Next, Index++) @@ -192,7 +192,7 @@ CheckItemToIndex(IN PCHECKLISTWND infoPtr, return Index; } } - + return -1; } @@ -202,7 +202,7 @@ FindCheckItem(IN PCHECKLISTWND infoPtr, { PCHECKITEM CurItem; SIZE_T Count = wcslen(SearchText); - + for (CurItem = infoPtr->CheckItemListHead; CurItem != NULL; CurItem = CurItem->Next) @@ -214,7 +214,7 @@ FindCheckItem(IN PCHECKLISTWND infoPtr, break; } } - + return CurItem; } @@ -235,7 +235,7 @@ FindFirstEnabledCheckBox(IN PCHECKLISTWND infoPtr, break; } } - + return CurItem; } @@ -255,7 +255,7 @@ FindLastEnabledCheckBox(IN PCHECKLISTWND infoPtr, LastEnabledItem = CurItem; } } - + if (LastEnabledItem != NULL) { /* return the Deny checkbox in case both check boxes are enabled! */ @@ -297,7 +297,7 @@ FindPreviousEnabledCheckBox(IN PCHECKLISTWND infoPtr, Item = CurItem; } } - + if (Item != NULL) { /* return the Deny checkbox in case both check boxes are enabled! */ @@ -319,11 +319,11 @@ FindNextEnabledCheckBox(IN PCHECKLISTWND infoPtr, OUT UINT *CheckBox) { PCHECKITEM Item; - + if (infoPtr->FocusedCheckItem != NULL) { Item = infoPtr->FocusedCheckItem; - + if (infoPtr->FocusedCheckItemBox != CLB_DENY && !(Item->State & CIS_DENYDISABLED)) { @@ -334,7 +334,7 @@ FindNextEnabledCheckBox(IN PCHECKLISTWND infoPtr, else { Item = Item->Next; - + while (Item != NULL) { if ((Item->State & CIS_DISABLED) != CIS_DISABLED) @@ -353,7 +353,7 @@ FindNextEnabledCheckBox(IN PCHECKLISTWND infoPtr, Item = FindFirstEnabledCheckBox(infoPtr, CheckBox); } - + return Item; } @@ -363,7 +363,7 @@ FindEnabledCheckBox(IN PCHECKLISTWND infoPtr, OUT UINT *CheckBox) { PCHECKITEM Item; - + if (ReverseSearch) { Item = FindPreviousEnabledCheckBox(infoPtr, @@ -374,7 +374,7 @@ FindEnabledCheckBox(IN PCHECKLISTWND infoPtr, Item = FindNextEnabledCheckBox(infoPtr, CheckBox); } - + return Item; } @@ -386,28 +386,28 @@ PtToCheckItemBox(IN PCHECKLISTWND infoPtr, { INT FirstVisible, Index; PCHECKITEM Item; - + FirstVisible = GetScrollPos(infoPtr->hSelf, SB_VERT); - + Index = FirstVisible + (ppt->y / infoPtr->ItemHeight); - + Item = FindCheckItemByIndex(infoPtr, Index); if (Item != NULL) { INT cx; - + cx = infoPtr->CheckBoxLeft[CLB_ALLOW] + ((infoPtr->CheckBoxLeft[CLB_DENY] - infoPtr->CheckBoxLeft[CLB_ALLOW]) / 2); *CheckBox = ((ppt->x <= cx) ? CLB_ALLOW : CLB_DENY); - + if (DirectlyInCheckBox != NULL) { INT y = ppt->y % infoPtr->ItemHeight; INT cxBox = infoPtr->ItemHeight - (2 * CI_TEXT_MARGIN_HEIGHT); - + if ((y >= CI_TEXT_MARGIN_HEIGHT && y < infoPtr->ItemHeight - CI_TEXT_MARGIN_HEIGHT) && @@ -425,7 +425,7 @@ PtToCheckItemBox(IN PCHECKLISTWND infoPtr, } } } - + return Item; } @@ -454,7 +454,7 @@ DeleteCheckItem(IN PCHECKLISTWND infoPtr, { PCHECKITEM CurItem; PCHECKITEM *PrevPtr = &infoPtr->CheckItemListHead; - + for (CurItem = infoPtr->CheckItemListHead; CurItem != NULL; CurItem = CurItem->Next) @@ -465,7 +465,7 @@ DeleteCheckItem(IN PCHECKLISTWND infoPtr, { EscapeQuickSearch(infoPtr); } - + #if SUPPORT_UXTHEME if (Item == infoPtr->HoveredCheckItem) { @@ -474,14 +474,14 @@ DeleteCheckItem(IN PCHECKLISTWND infoPtr, 0); } #endif - + if (Item == infoPtr->FocusedCheckItem) { ChangeCheckItemFocus(infoPtr, NULL, 0); } - + *PrevPtr = CurItem->Next; HeapFree(GetProcessHeap(), 0, @@ -489,10 +489,10 @@ DeleteCheckItem(IN PCHECKLISTWND infoPtr, infoPtr->CheckItemCount--; return TRUE; } - + PrevPtr = &CurItem->Next; } - + return FALSE; } @@ -518,22 +518,22 @@ AddCheckItem(IN PCHECKLISTWND infoPtr, PrevPtr = &CurItem->Next; i++; } - + Item->Next = NULL; Item->AccessMask = AccessMask; Item->State = State & CIS_MASK; wcscpy(Item->Name, Name); - + *PrevPtr = Item; infoPtr->CheckItemCount++; - + if (Index != NULL) { *Index = i; } } - + return Item; } @@ -542,7 +542,7 @@ ClearCheckBoxes(IN PCHECKLISTWND infoPtr) { PCHECKITEM CurItem; UINT nUpdated = 0; - + for (CurItem = infoPtr->CheckItemListHead; CurItem != NULL; CurItem = CurItem->Next) @@ -553,7 +553,7 @@ ClearCheckBoxes(IN PCHECKLISTWND infoPtr) nUpdated++; } } - + return nUpdated; } @@ -563,7 +563,7 @@ UpdateControl(IN PCHECKLISTWND infoPtr) RECT rcClient; SCROLLINFO ScrollInfo; INT VisibleItems; - + GetClientRect(infoPtr->hSelf, &rcClient); @@ -574,9 +574,9 @@ UpdateControl(IN PCHECKLISTWND infoPtr) ScrollInfo.nPage = ((rcClient.bottom - rcClient.top) + infoPtr->ItemHeight - 1) / infoPtr->ItemHeight; ScrollInfo.nPos = 0; ScrollInfo.nTrackPos = 0; - + VisibleItems = (rcClient.bottom - rcClient.top) / infoPtr->ItemHeight; - + if (ScrollInfo.nPage == (UINT)VisibleItems && ScrollInfo.nMax > 0) { ScrollInfo.nMax--; @@ -605,18 +605,18 @@ UpdateCheckItem(IN PCHECKLISTWND infoPtr, { VisibleFirst = GetScrollPos(infoPtr->hSelf, SB_VERT); - + if (Index >= VisibleFirst) { GetClientRect(infoPtr->hSelf, &rcClient); VisibleItems = ((rcClient.bottom - rcClient.top) + infoPtr->ItemHeight - 1) / infoPtr->ItemHeight; - + if (Index <= VisibleFirst + VisibleItems) { RECT rcUpdate; - + rcUpdate.left = rcClient.left; rcUpdate.right = rcClient.right; rcUpdate.top = (Index - VisibleFirst) * infoPtr->ItemHeight; @@ -643,7 +643,7 @@ MakeCheckItemVisible(IN PCHECKLISTWND infoPtr, { VisibleFirst = GetScrollPos(infoPtr->hSelf, SB_VERT); - + if (Index <= VisibleFirst) { NewPos = Index; @@ -663,11 +663,11 @@ MakeCheckItemVisible(IN PCHECKLISTWND infoPtr, NewPos = VisibleFirst; } } - + if (VisibleFirst != NewPos) { SCROLLINFO ScrollInfo; - + ScrollInfo.cbSize = sizeof(ScrollInfo); ScrollInfo.fMask = SIF_POS; ScrollInfo.nPos = NewPos; @@ -735,12 +735,12 @@ RetChangeControlFont(IN PCHECKLISTWND infoPtr, { HFONT hOldFont = infoPtr->hFont; infoPtr->hFont = hFont; - + if (hOldFont != hFont) { infoPtr->ItemHeight = (2 * CI_TEXT_MARGIN_HEIGHT) + GetIdealItemHeight(infoPtr); } - + if (infoPtr->ShowingCaret) { DestroyCaret(); @@ -749,7 +749,7 @@ RetChangeControlFont(IN PCHECKLISTWND infoPtr, 0, infoPtr->ItemHeight - (2 * CI_TEXT_MARGIN_HEIGHT)); } - + UpdateControl(infoPtr); return hOldFont; @@ -791,17 +791,17 @@ PaintControl(IN PCHECKLISTWND infoPtr, RECT rcClient; UINT VisibleFirstIndex = rcUpdate->top / infoPtr->ItemHeight; UINT LastTouchedIndex = rcUpdate->bottom / infoPtr->ItemHeight; - + FillRect(hDC, rcUpdate, (HBRUSH)(COLOR_WINDOW + 1)); - + GetClientRect(infoPtr->hSelf, &rcClient); - + ScrollPos = GetScrollPos(infoPtr->hSelf, SB_VERT); - + FirstItem = FindCheckItemByIndex(infoPtr, ScrollPos + VisibleFirstIndex); if (FirstItem != NULL) @@ -816,45 +816,45 @@ PaintControl(IN PCHECKLISTWND infoPtr, HRESULT hDrawResult; BOOL ItemHovered; #endif - + Enabled = IsWindowEnabled(infoPtr->hSelf); PrevEnabled = Enabled; - + ItemRect.left = 0; ItemRect.right = rcClient.right; ItemRect.top = VisibleFirstIndex * infoPtr->ItemHeight; - + TextRect.left = ItemRect.left + CI_TEXT_MARGIN_WIDTH; TextRect.right = ItemRect.right - CI_TEXT_MARGIN_WIDTH; TextRect.top = ItemRect.top + CI_TEXT_MARGIN_HEIGHT; - + SetBrushOrgEx(hDC, ItemRect.left, ItemRect.top, &hOldBrushOrg); - + OldTextColor = SetTextColor(hDC, infoPtr->TextColor[Enabled]); hOldFont = SelectObject(hDC, infoPtr->hFont); - + for (Item = FirstItem, CurrentIndex = VisibleFirstIndex; Item != NULL && CurrentIndex <= LastTouchedIndex; Item = Item->Next, CurrentIndex++) { TextRect.bottom = TextRect.top + infoPtr->ItemHeight - (2 * CI_TEXT_MARGIN_HEIGHT); ItemRect.bottom = ItemRect.top + infoPtr->ItemHeight; - + SetBrushOrgEx(hDC, ItemRect.left, ItemRect.top, NULL); - + if (Enabled && PrevEnabled != ((Item->State & CIS_DISABLED) != CIS_DISABLED)) { PrevEnabled = ((Item->State & CIS_DISABLED) != CIS_DISABLED); - + SetTextColor(hDC, infoPtr->TextColor[PrevEnabled]); } @@ -877,16 +877,16 @@ PaintControl(IN PCHECKLISTWND infoPtr, { COLORREF HighlightTextColor, HighlightBackground; RECT rcHighlight = TextRect; - + HighlightTextColor = GetSysColor(COLOR_HIGHLIGHTTEXT); HighlightBackground = GetSysColor(COLOR_HIGHLIGHT); rcHighlight.right = rcHighlight.left + TextSize.cx; - + InflateRect(&rcHighlight, 0, CI_TEXT_SELECTIONMARGIN); - + OldBkColor = SetBkColor(hDC, HighlightBackground); OldFgColor = SetTextColor(hDC, @@ -910,7 +910,7 @@ PaintControl(IN PCHECKLISTWND infoPtr, { rcHighlight.left = rcHighlight.right; rcHighlight.right = TextRect.right; - + DrawText(hDC, Item->Name + HighlightLen, -1, @@ -928,7 +928,7 @@ PaintControl(IN PCHECKLISTWND infoPtr, &TextRect, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER); } - + CheckBox.top = TextRect.top; CheckBox.bottom = TextRect.bottom; @@ -946,7 +946,7 @@ PaintControl(IN PCHECKLISTWND infoPtr, Enabled && !(Item->State & CIS_ALLOWDISABLED), (ItemHovered && infoPtr->HoveredCheckItemBox != CLB_DENY), IsPushed); - + hDrawResult = DrawThemeBackground(infoPtr->ThemeHandle, hDC, @@ -954,7 +954,7 @@ PaintControl(IN PCHECKLISTWND infoPtr, BtnState, &CheckBox, NULL); - + } else { @@ -979,7 +979,7 @@ PaintControl(IN PCHECKLISTWND infoPtr, infoPtr->FocusedCheckItemBox != CLB_DENY) { RECT rcFocus = CheckBox; - + InflateRect (&rcFocus, CI_TEXT_MARGIN_HEIGHT, CI_TEXT_MARGIN_HEIGHT); @@ -1140,7 +1140,7 @@ ChangeCheckItemHotTrack(IN PCHECKLISTWND infoPtr, { PCHECKITEM OldHotTrack = infoPtr->HoveredCheckItem; UINT OldHotTrackBox = infoPtr->HoveredCheckItemBox; - + infoPtr->HoveredCheckItem = NewHotTrack; infoPtr->HoveredCheckItemBox = NewHotTrackBox; @@ -1186,7 +1186,7 @@ ChangeCheckBox(IN PCHECKLISTWND infoPtr, { CheckItem->State = CheckData.NewState; } - + return (CheckItem->State != OldState); } @@ -1196,7 +1196,7 @@ DisplayCaret(IN PCHECKLISTWND infoPtr) if (IsWindowEnabled(infoPtr->hSelf) && !infoPtr->ShowingCaret) { infoPtr->ShowingCaret = TRUE; - + CreateCaret(infoPtr->hSelf, NULL, infoPtr->CaretWidth, @@ -1212,7 +1212,7 @@ RemoveCaret(IN PCHECKLISTWND infoPtr) if (IsWindowEnabled(infoPtr->hSelf) && infoPtr->ShowingCaret) { infoPtr->ShowingCaret = FALSE; - + HideCaret(infoPtr->hSelf); DestroyCaret(); } @@ -1238,13 +1238,13 @@ MapItemToRect(IN PCHECKLISTWND infoPtr, { RECT rcClient; INT VisibleFirst; - + GetClientRect(infoPtr->hSelf, &rcClient); - + VisibleFirst = GetScrollPos(infoPtr->hSelf, SB_VERT); - + prcItem->left = rcClient.left; prcItem->right = rcClient.right; prcItem->top = (Index - VisibleFirst) * infoPtr->ItemHeight; @@ -1273,7 +1273,7 @@ UpdateCaretPos(IN PCHECKLISTWND infoPtr) TextSize.cx = 0; TextSize.cy = 0; - + if (infoPtr->QuickSearchText[0] == L'\0' || GetTextExtentPoint32(hDC, infoPtr->QuickSearchHitItem->Name, @@ -1281,7 +1281,7 @@ UpdateCaretPos(IN PCHECKLISTWND infoPtr) &TextSize)) { RECT rcItem; - + MapItemToRect(infoPtr, infoPtr->QuickSearchHitItem, &rcItem); @@ -1306,23 +1306,23 @@ EscapeQuickSearch(IN PCHECKLISTWND infoPtr) if (infoPtr->QuickSearchEnabled && infoPtr->QuickSearchHitItem != NULL) { PCHECKITEM OldHit = infoPtr->QuickSearchHitItem; - + infoPtr->QuickSearchHitItem = NULL; infoPtr->QuickSearchText[0] = L'\0'; - + /* scroll back to the focused item */ if (infoPtr->FocusedCheckItem != NULL) { MakeCheckItemVisible(infoPtr, infoPtr->FocusedCheckItem); } - + /* repaint the old search hit item if it's still visible */ UpdateCheckItem(infoPtr, OldHit); KillQuickSearchTimers(infoPtr); - + RemoveCaret(infoPtr); } } @@ -1332,15 +1332,15 @@ ChangeSearchHit(IN PCHECKLISTWND infoPtr, IN PCHECKITEM NewHit) { PCHECKITEM OldHit = infoPtr->QuickSearchHitItem; - + infoPtr->QuickSearchHitItem = NewHit; - + if (OldHit != NewHit) { /* scroll to the new search hit */ MakeCheckItemVisible(infoPtr, NewHit); - + /* repaint the old hit if present and visible */ if (OldHit != NULL) { @@ -1353,12 +1353,12 @@ ChangeSearchHit(IN PCHECKLISTWND infoPtr, DisplayCaret(infoPtr); } } - + UpdateCaretPos(infoPtr); - + UpdateCheckItem(infoPtr, NewHit); - + /* kill the reset timer and restart the set hit focus timer */ KillTimer(infoPtr->hSelf, TIMER_ID_RESETQUICKSEARCH); @@ -1379,7 +1379,7 @@ QuickSearchFindHit(IN PCHECKLISTWND infoPtr, { BOOL Ret = FALSE; PCHECKITEM NewHit; - + switch (c) { case '\r': @@ -1400,7 +1400,7 @@ QuickSearchFindHit(IN PCHECKLISTWND infoPtr, } break; } - + case VK_BACK: { if (infoPtr->QuickSearchHitItem != NULL) @@ -1410,7 +1410,7 @@ QuickSearchFindHit(IN PCHECKLISTWND infoPtr, { /* delete the last character */ infoPtr->QuickSearchText[--SearchLen] = L'\0'; - + if (SearchLen > 0) { /* search again */ @@ -1435,7 +1435,7 @@ QuickSearchFindHit(IN PCHECKLISTWND infoPtr, } break; } - + default: { INT SearchLen = wcslen(infoPtr->QuickSearchText); @@ -1443,7 +1443,7 @@ QuickSearchFindHit(IN PCHECKLISTWND infoPtr, { infoPtr->QuickSearchText[SearchLen++] = c; infoPtr->QuickSearchText[SearchLen] = L'\0'; - + NewHit = FindCheckItem(infoPtr, infoPtr->QuickSearchText); if (NewHit != NULL) @@ -1451,7 +1451,7 @@ QuickSearchFindHit(IN PCHECKLISTWND infoPtr, /* change the search hit */ ChangeSearchHit(infoPtr, NewHit); - + Ret = TRUE; } else @@ -1465,7 +1465,7 @@ QuickSearchFindHit(IN PCHECKLISTWND infoPtr, } return Ret; } - + return FALSE; } @@ -1477,17 +1477,17 @@ CheckListWndProc(IN HWND hwnd, { PCHECKLISTWND infoPtr; LRESULT Ret; - + infoPtr = (PCHECKLISTWND)GetWindowLongPtr(hwnd, 0); - + if (infoPtr == NULL && uMsg != WM_CREATE) { goto HandleDefaultMessage; } - + Ret = 0; - + switch (uMsg) { case WM_PAINT: @@ -1495,7 +1495,7 @@ CheckListWndProc(IN HWND hwnd, HDC hdc; RECT rcUpdate; PAINTSTRUCT ps; - + if (GetUpdateRect(hwnd, &rcUpdate, FALSE)) @@ -1517,16 +1517,16 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_MOUSEMOVE: { POINT pt; BOOL InCheckBox; HWND hWndCapture = GetCapture(); - + pt.x = (LONG)LOWORD(lParam); pt.y = (LONG)HIWORD(lParam); - + #if SUPPORT_UXTHEME /* handle hovering checkboxes */ if (hWndCapture == NULL && infoPtr->ThemeHandle != NULL) @@ -1555,12 +1555,12 @@ CheckListWndProc(IN HWND hwnd, NULL, 0); } - + tme.cbSize = sizeof(tme); tme.dwFlags = TME_LEAVE; tme.hwndTrack = hwnd; tme.dwHoverTime = infoPtr->HoverTime; - + TrackMouseEvent(&tme); } #endif @@ -1570,7 +1570,7 @@ CheckListWndProc(IN HWND hwnd, PCHECKITEM PtItem; UINT PtItemBox; BOOL OldPushed; - + PtItem = PtToCheckItemBox(infoPtr, &pt, &PtItemBox, @@ -1587,14 +1587,14 @@ CheckListWndProc(IN HWND hwnd, infoPtr->FocusedCheckItemBox); } } - + break; } - + case WM_VSCROLL: { SCROLLINFO ScrollInfo; - + ScrollInfo.cbSize = sizeof(ScrollInfo); ScrollInfo.fMask = SIF_RANGE | SIF_POS; @@ -1603,7 +1603,7 @@ CheckListWndProc(IN HWND hwnd, &ScrollInfo)) { INT OldPos = ScrollInfo.nPos; - + switch (LOWORD(wParam)) { case SB_BOTTOM: @@ -1628,7 +1628,7 @@ CheckListWndProc(IN HWND hwnd, { RECT rcClient; INT ScrollLines; - + /* don't use ScrollInfo.nPage because we should only scroll down by the number of completely visible list entries. nPage however also includes the partly cropped list @@ -1639,7 +1639,7 @@ CheckListWndProc(IN HWND hwnd, ScrollLines = max(1, (rcClient.bottom - rcClient.top) / infoPtr->ItemHeight); - + if (ScrollInfo.nPos + ScrollLines <= ScrollInfo.nMax) { ScrollInfo.nPos += ScrollLines; @@ -1666,7 +1666,7 @@ CheckListWndProc(IN HWND hwnd, ScrollLines = max(1, (rcClient.bottom - rcClient.top) / infoPtr->ItemHeight); - + if (ScrollInfo.nPos >= ScrollLines) { ScrollInfo.nPos -= ScrollLines; @@ -1689,16 +1689,16 @@ CheckListWndProc(IN HWND hwnd, ScrollInfo.nPos = 0; break; } - + if (OldPos != ScrollInfo.nPos) { ScrollInfo.fMask = SIF_POS; - + ScrollInfo.nPos = SetScrollInfo(hwnd, SB_VERT, &ScrollInfo, TRUE); - + if (OldPos != ScrollInfo.nPos) { ScrollWindowEx(hwnd, @@ -1719,7 +1719,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case CLM_ADDITEM: { INT Index = -1; @@ -1739,7 +1739,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case CLM_DELITEM: { PCHECKITEM Item = FindCheckItemByIndex(infoPtr, @@ -1759,7 +1759,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case CLM_SETITEMSTATE: { PCHECKITEM Item = FindCheckItemByIndex(infoPtr, @@ -1768,7 +1768,7 @@ CheckListWndProc(IN HWND hwnd, { DWORD OldState = Item->State; Item->State = (DWORD)lParam & CIS_MASK; - + if (Item->State != OldState) { /* revert the focus if the currently focused item is about @@ -1798,20 +1798,20 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case CLM_GETITEMCOUNT: { Ret = infoPtr->CheckItemCount; break; } - + case CLM_CLEAR: { ClearCheckItems(infoPtr); UpdateControl(infoPtr); break; } - + case CLM_SETCHECKBOXCOLUMN: { infoPtr->CheckBoxLeft[wParam != CLB_DENY] = (INT)lParam; @@ -1819,13 +1819,13 @@ CheckListWndProc(IN HWND hwnd, Ret = 1; break; } - + case CLM_GETCHECKBOXCOLUMN: { Ret = (LRESULT)infoPtr->CheckBoxLeft[wParam != CLB_DENY]; break; } - + case CLM_CLEARCHECKBOXES: { Ret = (LRESULT)ClearCheckBoxes(infoPtr); @@ -1835,7 +1835,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case CLM_ENABLEQUICKSEARCH: { if (wParam == 0) @@ -1845,26 +1845,26 @@ CheckListWndProc(IN HWND hwnd, infoPtr->QuickSearchEnabled = (wParam != 0); break; } - + case CLM_SETQUICKSEARCH_TIMEOUT_RESET: { infoPtr->QuickSearchResetDelay = (UINT)wParam; break; } - + case CLM_SETQUICKSEARCH_TIMEOUT_SETFOCUS: { infoPtr->QuickSearchSetFocusDelay = (UINT)wParam; break; } - + case CLM_FINDITEMBYACCESSMASK: { Ret = (LRESULT)FindCheckItemIndexByAccessMask(infoPtr, (ACCESS_MASK)wParam); break; } - + case WM_SETFONT: { Ret = (LRESULT)RetChangeControlFont(infoPtr, @@ -1872,13 +1872,13 @@ CheckListWndProc(IN HWND hwnd, (BOOL)LOWORD(lParam)); break; } - + case WM_GETFONT: { Ret = (LRESULT)infoPtr->hFont; break; } - + case WM_STYLECHANGED: { if (wParam == (WPARAM)GWL_STYLE) @@ -1887,26 +1887,26 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_ENABLE: { EscapeQuickSearch(infoPtr); - + UpdateControl(infoPtr); break; } - + case WM_MOUSEWHEEL: { SHORT ScrollDelta; UINT ScrollLines = 3; - + SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &ScrollLines, 0); ScrollDelta = 0 - (SHORT)HIWORD(wParam); - + if (ScrollLines != 0 && abs(ScrollDelta) >= WHEEL_DELTA) { @@ -1914,13 +1914,13 @@ CheckListWndProc(IN HWND hwnd, ScrollInfo.cbSize = sizeof(ScrollInfo); ScrollInfo.fMask = SIF_RANGE | SIF_POS; - + if (GetScrollInfo(hwnd, SB_VERT, &ScrollInfo)) { INT OldPos = ScrollInfo.nPos; - + ScrollInfo.nPos += (ScrollDelta / WHEEL_DELTA) * ScrollLines; if (ScrollInfo.nPos < 0) ScrollInfo.nPos = 0; @@ -1930,12 +1930,12 @@ CheckListWndProc(IN HWND hwnd, if (OldPos != ScrollInfo.nPos) { ScrollInfo.fMask = SIF_POS; - + ScrollInfo.nPos = SetScrollInfo(hwnd, SB_VERT, &ScrollInfo, TRUE); - + if (OldPos != ScrollInfo.nPos) { ScrollWindowEx(hwnd, @@ -1957,7 +1957,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_SETFOCUS: { infoPtr->HasFocus = TRUE; @@ -1979,22 +1979,22 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_KILLFOCUS: { EscapeQuickSearch(infoPtr); - + infoPtr->HasFocus = FALSE; if (infoPtr->FocusedCheckItem != NULL) { infoPtr->FocusedPushed = FALSE; - + UpdateCheckItem(infoPtr, infoPtr->FocusedCheckItem); } break; } - + case WM_LBUTTONDBLCLK: case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: @@ -2007,10 +2007,10 @@ CheckListWndProc(IN HWND hwnd, BOOL InCheckBox; POINT pt; BOOL ChangeFocus, Capture = FALSE; - + pt.x = (LONG)LOWORD(lParam); pt.y = (LONG)HIWORD(lParam); - + NewFocus = PtToCheckItemBox(infoPtr, &pt, &NewFocusBox, @@ -2023,7 +2023,7 @@ CheckListWndProc(IN HWND hwnd, the focus to the other one or not change it at all */ InCheckBox = FALSE; - + ChangeFocus = ((NewFocus->State & CIS_DISABLED) != CIS_DISABLED); if (ChangeFocus) { @@ -2034,7 +2034,7 @@ CheckListWndProc(IN HWND hwnd, { ChangeFocus = TRUE; } - + if (InCheckBox && ChangeFocus && GetCapture() == NULL && (uMsg == WM_LBUTTONDOWN || uMsg == WM_LBUTTONDBLCLK)) { @@ -2046,7 +2046,7 @@ CheckListWndProc(IN HWND hwnd, { ChangeFocus = TRUE; } - + if (ChangeFocus) { if (infoPtr->QuickSearchEnabled && infoPtr->QuickSearchHitItem != NULL && @@ -2054,17 +2054,17 @@ CheckListWndProc(IN HWND hwnd, { EscapeQuickSearch(infoPtr); } - + ChangeCheckItemFocus(infoPtr, NewFocus, NewFocusBox); } - + if (!infoPtr->HasFocus) { SetFocus(hwnd); } - + if (Capture) { SetCapture(hwnd); @@ -2072,7 +2072,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_LBUTTONUP: { if (GetCapture() == hwnd) @@ -2083,10 +2083,10 @@ CheckListWndProc(IN HWND hwnd, UINT PtItemBox; BOOL InCheckBox; POINT pt; - + pt.x = (LONG)LOWORD(lParam); pt.y = (LONG)HIWORD(lParam); - + infoPtr->FocusedPushed = FALSE; PtItem = PtToCheckItemBox(infoPtr, @@ -2112,17 +2112,17 @@ CheckListWndProc(IN HWND hwnd, OtherBox); } } - + UpdateCheckItemBox(infoPtr, infoPtr->FocusedCheckItem, infoPtr->FocusedCheckItemBox); } - + ReleaseCapture(); } break; } - + case WM_KEYDOWN: { switch (wParam) @@ -2153,7 +2153,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case VK_RETURN: { if (GetCapture() == NULL && @@ -2193,7 +2193,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case VK_TAB: { if (GetCapture() == NULL) @@ -2201,7 +2201,7 @@ CheckListWndProc(IN HWND hwnd, PCHECKITEM NewFocus; UINT NewFocusBox = 0; BOOL Shift = GetKeyState(VK_SHIFT) & 0x8000; - + EscapeQuickSearch(infoPtr); NewFocus = FindEnabledCheckBox(infoPtr, @@ -2222,7 +2222,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + default: { goto HandleDefaultMessage; @@ -2230,7 +2230,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_KEYUP: { if (wParam == VK_SPACE && IsWindowEnabled(hwnd) && @@ -2263,11 +2263,11 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_GETDLGCODE: { INT virtKey; - + Ret = 0; virtKey = (lParam != 0 ? (INT)((LPMSG)lParam)->wParam : 0); switch (virtKey) @@ -2290,14 +2290,14 @@ CheckListWndProc(IN HWND hwnd, UINT CheckBox; BOOL EnabledBox; BOOL Shift = GetKeyState(VK_SHIFT) & 0x8000; - + EnabledBox = FindEnabledCheckBox(infoPtr, Shift, &CheckBox) != NULL; Ret |= (EnabledBox ? DLGC_WANTTAB : DLGC_WANTCHARS); break; } - + default: { if (infoPtr->QuickSearchEnabled) @@ -2309,21 +2309,21 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_CHAR: { QuickSearchFindHit(infoPtr, (WCHAR)wParam); break; } - + case WM_SYSCOLORCHANGE: { infoPtr->TextColor[0] = GetSysColor(COLOR_GRAYTEXT); infoPtr->TextColor[1] = GetSysColor(COLOR_WINDOWTEXT); break; } - + #if SUPPORT_UXTHEME case WM_MOUSELEAVE: { @@ -2336,7 +2336,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_THEMECHANGED: { if (infoPtr->ThemeHandle != NULL) @@ -2352,11 +2352,11 @@ CheckListWndProc(IN HWND hwnd, break; } #endif - + case WM_SETTINGCHANGE: { DWORD OldCaretWidth = infoPtr->CaretWidth; - + #if SUPPORT_UXTHEME /* update the hover time */ if (!SystemParametersInfo(SPI_GETMOUSEHOVERTIME, @@ -2386,13 +2386,13 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_SIZE: { UpdateControl(infoPtr); break; } - + case WM_UPDATEUISTATE: { DWORD OldUIState = infoPtr->UIState; @@ -2419,7 +2419,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_TIMER: { switch (wParam) @@ -2471,17 +2471,17 @@ CheckListWndProc(IN HWND hwnd, if (infoPtr != NULL) { RECT rcClient; - + infoPtr->hSelf = hwnd; infoPtr->hNotify = ((LPCREATESTRUCTW)lParam)->hwndParent; - + SetWindowLongPtr(hwnd, 0, (DWORD_PTR)infoPtr); infoPtr->CheckItemListHead = NULL; infoPtr->CheckItemCount = 0; - + if (!SystemParametersInfo(SPI_GETCARETWIDTH, 0, &infoPtr->CaretWidth, @@ -2491,21 +2491,21 @@ CheckListWndProc(IN HWND hwnd, } infoPtr->ItemHeight = 10; infoPtr->ShowingCaret = FALSE; - + infoPtr->HasFocus = FALSE; infoPtr->FocusedCheckItem = NULL; infoPtr->FocusedCheckItemBox = 0; infoPtr->FocusedPushed = FALSE; - + infoPtr->TextColor[0] = GetSysColor(COLOR_GRAYTEXT); infoPtr->TextColor[1] = GetSysColor(COLOR_WINDOWTEXT); - + GetClientRect(hwnd, &rcClient); - + infoPtr->CheckBoxLeft[0] = rcClient.right - 30; infoPtr->CheckBoxLeft[1] = rcClient.right - 15; - + infoPtr->QuickSearchEnabled = FALSE; infoPtr->QuickSearchText[0] = L'\0'; @@ -2545,7 +2545,7 @@ CheckListWndProc(IN HWND hwnd, } break; } - + case WM_DESTROY: { if (infoPtr->ShowingCaret) @@ -2554,14 +2554,14 @@ CheckListWndProc(IN HWND hwnd, } ClearCheckItems(infoPtr); - + #if SUPPORT_UXTHEME if (infoPtr->ThemeHandle != NULL) { CloseThemeData(infoPtr->ThemeHandle); } #endif - + HeapFree(GetProcessHeap(), 0, infoPtr); @@ -2570,7 +2570,7 @@ CheckListWndProc(IN HWND hwnd, (DWORD_PTR)NULL); break; } - + default: { HandleDefaultMessage: @@ -2581,7 +2581,7 @@ HandleDefaultMessage: break; } } - + return Ret; } @@ -2589,7 +2589,7 @@ BOOL RegisterCheckListControl(IN HINSTANCE hInstance) { WNDCLASS wc; - + wc.style = CS_DBLCLKS; wc.lpfnWndProc = CheckListWndProc; wc.cbClsExtra = 0; @@ -2601,7 +2601,7 @@ RegisterCheckListControl(IN HINSTANCE hInstance) wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.lpszMenuName = NULL; wc.lpszClassName = szCheckListWndClass; - + return RegisterClass(&wc) != 0; } diff --git a/reactos/dll/win32/aclui/misc.c b/reactos/dll/win32/aclui/misc.c index 0fb67ad1aa2..9fa7f900676 100644 --- a/reactos/dll/win32/aclui/misc.c +++ b/reactos/dll/win32/aclui/misc.c @@ -253,7 +253,7 @@ InvokeObjectPickerDialog(IN IDsObjectPicker *pDsObjectPicker, { IDataObject *pdo = NULL; HRESULT hRet; - + hRet = pDsObjectPicker->lpVtbl->InvokeDialog(pDsObjectPicker, hwndParent, &pdo); @@ -327,7 +327,7 @@ InvokeObjectPickerDialog(IN IDsObjectPicker *pDsObjectPicker, pdo->lpVtbl->Release(pdo); } - + return hRet; } diff --git a/reactos/dll/win32/advapi32/misc/shutdown.c b/reactos/dll/win32/advapi32/misc/shutdown.c index 23dc23fb54f..da1ab65c2e3 100644 --- a/reactos/dll/win32/advapi32/misc/shutdown.c +++ b/reactos/dll/win32/advapi32/misc/shutdown.c @@ -152,6 +152,6 @@ BOOL WINAPI InitiateSystemShutdownExW( LPWSTR lpMachineName, LPWSTR lpMessage, { UNIMPLEMENTED; return TRUE; -} +} /* EOF */ diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index c7b2a7c57c9..1fc6fcd3b9a 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -134,7 +134,7 @@ OpenPredefinedKey(IN ULONG Index, Status = STATUS_INVALID_PARAMETER; break; } - + return Status; } @@ -180,7 +180,7 @@ MapDefaultKey (OUT PHANDLE RealKey, Handle = RealKey; DoOpen = TRUE; } - + if (DoOpen) { /* create/open the default handle */ @@ -195,7 +195,7 @@ MapDefaultKey (OUT PHANDLE RealKey, else *(PULONG_PTR)Handle |= 0x1; } - + RtlLeaveCriticalSection (&HandleTableCS); return Status; @@ -342,7 +342,7 @@ RegOverridePredefKey(IN HKEY hKey, IN HKEY hNewHKey OPTIONAL) { LONG ErrorCode = ERROR_SUCCESS; - + if ((hKey == HKEY_CLASSES_ROOT || hKey == HKEY_CURRENT_CONFIG || hKey == HKEY_CURRENT_USER || @@ -366,7 +366,7 @@ RegOverridePredefKey(IN HKEY hKey, { return RtlNtStatusToDosError(Status); } - + ASSERT(hNewHKey != NULL); } @@ -377,7 +377,7 @@ RegOverridePredefKey(IN HKEY hKey, { NtClose(*Handle); } - + /* update the mapping */ *Handle = hNewHKey; @@ -438,9 +438,9 @@ RegpCopyTree(IN HKEY hKeySrc, ULONG Index, BufferSizeRequired, BufferSize = 0x200; NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status2 = STATUS_SUCCESS; - + InitializeListHead(©QueueHead); - + Info.Buffer = RtlAllocateHeap(ProcessHeap, 0, BufferSize); @@ -448,7 +448,7 @@ RegpCopyTree(IN HKEY hKeySrc, { return STATUS_INSUFFICIENT_RESOURCES; } - + copyKeys = RtlAllocateHeap(ProcessHeap, 0, sizeof(REGP_COPY_KEYS)); @@ -458,9 +458,9 @@ RegpCopyTree(IN HKEY hKeySrc, copyKeys->hKeyDest = hKeyDest; InsertHeadList(©QueueHead, ©Keys->ListEntry); - + /* FIXME - copy security from hKeySrc to hKeyDest or just for the subkeys? */ - + do { copyKeys = CONTAINING_RECORD(copyQueueHead.Flink, @@ -481,14 +481,14 @@ RegpCopyTree(IN HKEY hKeySrc, { UNICODE_STRING ValueName; PVOID Data; - + /* don't use RtlInitUnicodeString as the string is not NULL-terminated! */ ValueName.Length = Info.KeyValue->NameLength; ValueName.MaximumLength = ValueName.Length; ValueName.Buffer = Info.KeyValue->Name; - + Data = (PVOID)((ULONG_PTR)Info.KeyValue + Info.KeyValue->DataOffset); - + Status2 = NtSetValueKey(copyKeys->hKeyDest, &ValueName, Info.KeyValue->TitleIndex, @@ -524,7 +524,7 @@ RegpCopyTree(IN HKEY hKeySrc, /* don't break, let's try to copy as many values as possible */ Status2 = STATUS_INSUFFICIENT_RESOURCES; Index++; - + if (NT_SUCCESS(Status)) { Status = Status2; @@ -539,11 +539,11 @@ RegpCopyTree(IN HKEY hKeySrc, { Status = Status2; } - + break; } } - + /* enumerate all subkeys and open and enqueue them */ Index = 0; for (;;) @@ -559,7 +559,7 @@ RegpCopyTree(IN HKEY hKeySrc, HANDLE KeyHandle, NewKeyHandle; OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING SubKeyName, ClassName; - + /* don't use RtlInitUnicodeString as the string is not NULL-terminated! */ SubKeyName.Length = Info.KeyNode->NameLength; SubKeyName.MaximumLength = SubKeyName.Length; @@ -567,22 +567,22 @@ RegpCopyTree(IN HKEY hKeySrc, ClassName.Length = Info.KeyNode->ClassLength; ClassName.MaximumLength = ClassName.Length; ClassName.Buffer = (PWSTR)((ULONG_PTR)Info.KeyNode + Info.KeyNode->ClassOffset); - + /* open the subkey with sufficient rights */ - + InitializeObjectAttributes(&ObjectAttributes, &SubKeyName, OBJ_CASE_INSENSITIVE, copyKeys->hKeySrc, NULL); - + Status2 = NtOpenKey(&KeyHandle, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); if (NT_SUCCESS(Status2)) { /* FIXME - attempt to query the security information */ - + InitializeObjectAttributes(&ObjectAttributes, &SubKeyName, OBJ_CASE_INSENSITIVE, @@ -613,7 +613,7 @@ RegpCopyTree(IN HKEY hKeySrc, { NtClose(KeyHandle); NtClose(NewKeyHandle); - + Status2 = STATUS_INSUFFICIENT_RESOURCES; } } @@ -622,12 +622,12 @@ RegpCopyTree(IN HKEY hKeySrc, NtClose(KeyHandle); } } - + if (!NT_SUCCESS(Status2) && NT_SUCCESS(Status)) { Status = Status2; } - + Index++; } else if (Status2 == STATUS_BUFFER_OVERFLOW) @@ -679,7 +679,7 @@ RegpCopyTree(IN HKEY hKeySrc, { NtClose(copyKeys->hKeyDest); } - + RemoveEntryList(©Keys->ListEntry); RtlFreeHeap(ProcessHeap, @@ -689,7 +689,7 @@ RegpCopyTree(IN HKEY hKeySrc, } else Status = STATUS_INSUFFICIENT_RESOURCES; - + RtlFreeHeap(ProcessHeap, 0, Info.Buffer); @@ -710,14 +710,14 @@ RegCopyTreeW(IN HKEY hKeySrc, { HANDLE DestKeyHandle, KeyHandle, CurKey, SubKeyHandle = NULL; NTSTATUS Status; - + Status = MapDefaultKey(&KeyHandle, hKeySrc); if (!NT_SUCCESS(Status)) { return RtlNtStatusToDosError(Status); } - + Status = MapDefaultKey(&DestKeyHandle, hKeyDest); if (!NT_SUCCESS(Status)) @@ -746,30 +746,30 @@ RegCopyTreeW(IN HKEY hKeySrc, { goto Cleanup; } - + CurKey = SubKeyHandle; } else CurKey = KeyHandle; - + Status = RegpCopyTree(CurKey, hKeyDest); - + if (SubKeyHandle != NULL) { NtClose(SubKeyHandle); } - + Cleanup: ClosePredefKey(DestKeyHandle); Cleanup2: ClosePredefKey(KeyHandle); - + if (!NT_SUCCESS(Status)) { return RtlNtStatusToDosError(Status); } - + return ERROR_SUCCESS; } @@ -786,7 +786,7 @@ RegCopyTreeA(IN HKEY hKeySrc, { UNICODE_STRING SubKeyName = {0}; LONG Ret; - + if (lpSubKey != NULL && !RtlCreateUnicodeStringFromAsciiz(&SubKeyName, (LPSTR)lpSubKey)) @@ -799,7 +799,7 @@ RegCopyTreeA(IN HKEY hKeySrc, hKeyDest); RtlFreeUnicodeString(&SubKeyName); - + return Ret; } @@ -816,7 +816,7 @@ RegConnectRegistryA (IN LPCSTR lpMachineName, { UNICODE_STRING MachineName = {0}; LONG Ret; - + if (lpMachineName != NULL && !RtlCreateUnicodeStringFromAsciiz(&MachineName, (LPSTR)lpMachineName)) @@ -829,7 +829,7 @@ RegConnectRegistryA (IN LPCSTR lpMachineName, phkResult); RtlFreeUnicodeString(&MachineName); - + return Ret; } @@ -1180,7 +1180,7 @@ RegDeleteKeyA (HKEY hKey, Status = NtDeleteKey (TargetKey); NtClose (TargetKey); - + Cleanup: ClosePredefKey(ParentKey); @@ -1232,7 +1232,7 @@ RegDeleteKeyW (HKEY hKey, Status = NtDeleteKey (TargetKey); NtClose (TargetKey); - + Cleanup: ClosePredefKey(ParentKey); @@ -1287,7 +1287,7 @@ RegDeleteKeyValueW(IN HKEY hKey, { goto Cleanup; } - + CurKey = SubKeyHandle; } else @@ -1303,7 +1303,7 @@ RegDeleteKeyValueW(IN HKEY hKey, { NtClose(SubKeyHandle); } - + Cleanup: ClosePredefKey(KeyHandle); @@ -1328,7 +1328,7 @@ RegDeleteKeyValueA(IN HKEY hKey, { UNICODE_STRING SubKey = {0}, ValueName = {0}; LONG Ret; - + if (lpSubKey != NULL && !RtlCreateUnicodeStringFromAsciiz(&SubKey, (LPSTR)lpSubKey)) @@ -1350,7 +1350,7 @@ RegDeleteKeyValueA(IN HKEY hKey, RtlFreeUnicodeString(&SubKey); RtlFreeUnicodeString(&ValueName); - + return Ret; } @@ -1372,11 +1372,11 @@ RegpDeleteTree(IN HKEY hKey) PREG_DEL_KEYS KeyDelRoot; NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status2 = STATUS_SUCCESS; - + InitializeListHead(&delQueueHead); - + ProcessHeap = RtlGetProcessHeap(); - + /* NOTE: no need to allocate enough memory for an additional KEY_BASIC_INFORMATION structure for the root key, we only do that for subkeys as we need to allocate REGP_DEL_KEYS structures anyway! */ @@ -1413,7 +1413,7 @@ ReadFirstSubKey: { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING SubKeyName; - + ASSERT(newDelKeys != NULL); ASSERT(BasicInfo != NULL); @@ -1523,7 +1523,7 @@ SubKeyFailureNoFree: } Status2 = NtDeleteKey(delKeys->KeyHandle); - + /* NOTE: do NOT close the handle anymore, it's invalid already! */ if (!NT_SUCCESS(Status2)) @@ -1543,7 +1543,7 @@ SubKeyFailureNoFree: Status = Status2; } } - + /* remove the entry from the list */ RemoveEntryList(&delKeys->ListEntry); @@ -1599,7 +1599,7 @@ RegDeleteTreeW(IN HKEY hKey, { goto Cleanup; } - + CurKey = SubKeyHandle; } else @@ -1615,7 +1615,7 @@ RegDeleteTreeW(IN HKEY hKey, { ClosePredefKey(KeyHandle); } - + return ERROR_SUCCESS; } else @@ -1628,7 +1628,7 @@ RegDeleteTreeW(IN HKEY hKey, Cleanup: ClosePredefKey(KeyHandle); - + return RtlNtStatusToDosError(Status); } } @@ -1736,7 +1736,7 @@ RegpApplyRestrictions( DWORD dwFlags, DWORD dwType, DWORD cbData, /****************************************************************************** * RegGetValueW [ADVAPI32.@] * - * Retrieves the type and data for a value name associated with a key + * Retrieves the type and data for a value name associated with a key * optionally expanding it's content and restricting it's type. * * PARAMS @@ -1746,7 +1746,7 @@ RegpApplyRestrictions( DWORD dwFlags, DWORD dwType, DWORD cbData, * dwFlags [I] Flags restricting the value type to retrieve. * pdwType [O] Destination for the values type, may be NULL. * pvData [O] Destination for the values content, may be NULL. - * pcbData [I/O] Size of pvData, updated with the size required to + * pcbData [I/O] Size of pvData, updated with the size required to * retrieve the whole content. * * RETURNS @@ -1756,11 +1756,11 @@ RegpApplyRestrictions( DWORD dwFlags, DWORD dwType, DWORD cbData, * NOTES * - Unless RRF_NOEXPAND is specified REG_EXPAND_SZ is automatically expanded * and REG_SZ is retrieved instead. - * - Restrictions are applied after expanding, using RRF_RT_REG_EXPAND_SZ + * - Restrictions are applied after expanding, using RRF_RT_REG_EXPAND_SZ * without RRF_NOEXPAND is thus not allowed. */ LONG WINAPI -RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, +RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData ) { @@ -1768,7 +1768,7 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, PVOID pvBuf = NULL; LONG ret; - TRACE("(%p,%s,%s,%ld,%p,%p,%p=%ld)\n", + TRACE("(%p,%s,%s,%ld,%p,%p,%p=%ld)\n", hKey, debugstr_w(pszSubKey), debugstr_w(pszValue), dwFlags, pdwType, pvData, pcbData, cbData); @@ -1782,7 +1782,7 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, } ret = RegQueryValueExW(hKey, pszValue, NULL, &dwType, pvData, &cbData); - + /* If we are going to expand we need to read in the whole the value even * if the passed buffer was too small as the expanded string might be * smaller than the unexpanded one and could fit into cbData bytes. */ @@ -1791,7 +1791,7 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, { do { if (pvBuf) HeapFree(GetProcessHeap(), 0, pvBuf); - + pvBuf = HeapAlloc(GetProcessHeap(), 0, cbData); if (!pvBuf) { @@ -1800,11 +1800,11 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, } if (ret == ERROR_MORE_DATA) - ret = RegQueryValueExW(hKey, pszValue, NULL, + ret = RegQueryValueExW(hKey, pszValue, NULL, &dwType, pvBuf, &cbData); else { - /* Even if cbData was large enough we have to copy the + /* Even if cbData was large enough we have to copy the * string since ExpandEnvironmentStrings can't handle * overlapping buffers. */ CopyMemory(pvBuf, pvData, cbData); @@ -1853,15 +1853,15 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, * See RegGetValueW. */ LONG WINAPI -RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, - DWORD dwFlags, LPDWORD pdwType, PVOID pvData, +RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, + DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData ) { DWORD dwType, cbData = pcbData ? *pcbData : 0; PVOID pvBuf = NULL; LONG ret; - TRACE("(%p,%s,%s,%ld,%p,%p,%p=%ld)\n", + TRACE("(%p,%s,%s,%ld,%p,%p,%p=%ld)\n", hKey, pszSubKey, pszValue, dwFlags, pdwType, pvData, pcbData, cbData); @@ -1893,11 +1893,11 @@ RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, } if (ret == ERROR_MORE_DATA) - ret = RegQueryValueExA(hKey, pszValue, NULL, + ret = RegQueryValueExA(hKey, pszValue, NULL, &dwType, pvBuf, &cbData); else { - /* Even if cbData was large enough we have to copy the + /* Even if cbData was large enough we have to copy the * string since ExpandEnvironmentStrings can't handle * overlapping buffers. */ CopyMemory(pvBuf, pvData, cbData); @@ -1963,7 +1963,7 @@ RegSetKeyValueW(IN HKEY hKey, { return RtlNtStatusToDosError(Status); } - + if (lpSubKey != NULL) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -1986,12 +1986,12 @@ RegSetKeyValueW(IN HKEY hKey, Ret = RtlNtStatusToDosError(Status); goto Cleanup; } - + CurKey = SubKeyHandle; } else CurKey = KeyHandle; - + Ret = RegSetValueExW(CurKey, lpValueName, 0, @@ -2003,7 +2003,7 @@ RegSetKeyValueW(IN HKEY hKey, { NtClose(SubKeyHandle); } - + Cleanup: ClosePredefKey(KeyHandle); @@ -2064,7 +2064,7 @@ RegSetKeyValueA(IN HKEY hKey, Ret = RtlNtStatusToDosError(Status); goto Cleanup; } - + CurKey = SubKeyHandle; } else @@ -2081,7 +2081,7 @@ RegSetKeyValueA(IN HKEY hKey, { NtClose(SubKeyHandle); } - + Cleanup: ClosePredefKey(KeyHandle); @@ -2114,9 +2114,9 @@ RegDeleteValueA (HKEY hKey, Status = NtDeleteValueKey (KeyHandle, &ValueName); RtlFreeUnicodeString (&ValueName); - + ClosePredefKey(KeyHandle); - + if (!NT_SUCCESS(Status)) { return RtlNtStatusToDosError (Status); @@ -2776,9 +2776,9 @@ RegFlushKey(HKEY hKey) } Status = NtFlushKey (KeyHandle); - + ClosePredefKey(KeyHandle); - + if (!NT_SUCCESS(Status)) { return RtlNtStatusToDosError (Status); @@ -3031,7 +3031,7 @@ RegOpenKeyA (HKEY hKey, PHKEY phkResult) { TRACE("RegOpenKeyA hKey 0x%x lpSubKey %s phkResult %p\n", hKey, lpSubKey, phkResult); - + if (!hKey && lpSubKey && phkResult) { return ERROR_INVALID_HANDLE; @@ -3117,7 +3117,7 @@ RegOpenKeyExA (HKEY hKey, { ErrorCode = RtlNtStatusToDosError (Status); } - + ClosePredefKey(KeyHandle); return ErrorCode; @@ -3168,7 +3168,7 @@ RegOpenKeyExW (HKEY hKey, { ErrorCode = RtlNtStatusToDosError (Status); } - + ClosePredefKey(KeyHandle); return ErrorCode; @@ -3557,7 +3557,7 @@ RegQueryInfoKeyW (HKEY hKey, Cleanup: ClosePredefKey(KeyHandle); - + return ErrorCode; } @@ -4352,7 +4352,7 @@ RegRestoreKeyW (HKEY hKey, FileHandle, (ULONG)dwFlags); NtClose (FileHandle); - + Cleanup: ClosePredefKey(KeyHandle); @@ -4498,7 +4498,7 @@ RegSetKeySecurity (HKEY hKey, pSecurityDescriptor); ClosePredefKey(KeyHandle); - + if (!NT_SUCCESS(Status)) { return RtlNtStatusToDosError (Status); @@ -4837,7 +4837,7 @@ RegUnLoadKeyW (HKEY hKey, NULL); Status = NtUnloadKey (&ObjectAttributes); - + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) @@ -4963,7 +4963,7 @@ RegLoadMUIStringW(IN HKEY hKey, result = ERROR_BADKEY; goto cleanup; } - + uiStringId = _wtoi(pComma+2); *pComma = L'\0'; @@ -4972,7 +4972,7 @@ RegLoadMUIStringW(IN HKEY hKey, result = ERROR_BADKEY; FreeLibrary(hModule); } - + cleanup: HeapFree(GetProcessHeap(), 0, pwszTempBuffer); HeapFree(GetProcessHeap(), 0, pwszExpandedBuffer); @@ -5008,9 +5008,9 @@ RegLoadMUIStringA(IN HKEY hKey, goto cleanup; } - result = RegLoadMUIStringW(hKey, valueW.Buffer, pwszBuffer, cbData, NULL, Flags, + result = RegLoadMUIStringW(hKey, valueW.Buffer, pwszBuffer, cbData, NULL, Flags, baseDirW.Buffer); - + if (result == ERROR_SUCCESS) { cbData = WideCharToMultiByte(CP_ACP, 0, pwszBuffer, -1, pszOutBuf, cbOutBuf, NULL, NULL); if (pcbData) @@ -5021,7 +5021,7 @@ cleanup: HeapFree(GetProcessHeap(), 0, pwszBuffer); RtlFreeUnicodeString(&baseDirW); RtlFreeUnicodeString(&valueW); - + return result; } diff --git a/reactos/dll/win32/advapi32/sec/misc.c b/reactos/dll/win32/advapi32/sec/misc.c index b3ea8da8081..bee74716d49 100644 --- a/reactos/dll/win32/advapi32/sec/misc.c +++ b/reactos/dll/win32/advapi32/sec/misc.c @@ -60,7 +60,7 @@ LoadAndInitializeNtMarta(VOID) FindNtMartaProc(TreeResetNamedSecurityInfo); FindNtMartaProc(GetInheritanceSource); FindNtMartaProc(FreeIndexArray); - + return ERROR_SUCCESS; } @@ -68,13 +68,13 @@ DWORD CheckNtMartaPresent(VOID) { DWORD ErrorCode; - + if (NtMarta == NULL) { /* we're the first one trying to use ntmarta, initialize it and change the pointer after initialization */ ErrorCode = LoadAndInitializeNtMarta(); - + if (ErrorCode == ERROR_SUCCESS) { /* try change the NtMarta pointer */ @@ -99,7 +99,7 @@ CheckNtMartaPresent(VOID) /* ntmarta was already initialized */ ErrorCode = ERROR_SUCCESS; } - + return ErrorCode; } @@ -1372,7 +1372,7 @@ ProtectSacl: } } } - + return ERROR_SUCCESS; } @@ -1483,7 +1483,7 @@ SetNamedSecurityInfoW(LPWSTR pObjectName, PACL pSacl) { DWORD ErrorCode; - + if (pObjectName != NULL) { ErrorCode = CheckNtMartaPresent(); @@ -1532,14 +1532,14 @@ SetNamedSecurityInfoA(LPSTR pObjectName, UNICODE_STRING ObjectName; NTSTATUS Status; DWORD Ret; - + Status = RtlCreateUnicodeStringFromAsciiz(&ObjectName, pObjectName); if (!NT_SUCCESS(Status)) { return RtlNtStatusToDosError(Status); } - + Ret = SetNamedSecurityInfoW(ObjectName.Buffer, ObjectType, SecurityInfo, @@ -1570,7 +1570,7 @@ GetSecurityInfo(HANDLE handle, PSECURITY_DESCRIPTOR* ppSecurityDescriptor) { DWORD ErrorCode; - + if (handle != NULL) { ErrorCode = CheckNtMartaPresent(); @@ -1627,14 +1627,14 @@ SetSecurityInfo(HANDLE handle, if (ErrorCode == ERROR_SUCCESS) { SECURITY_DESCRIPTOR SecurityDescriptor; - + ErrorCode = pSetSecurityInfoCheck(&SecurityDescriptor, SecurityInfo, psidOwner, psidGroup, pDacl, pSacl); - + if (ErrorCode == ERROR_SUCCESS) { /* call the MARTA provider */ diff --git a/reactos/dll/win32/advapi32/sec/sec.c b/reactos/dll/win32/advapi32/sec/sec.c index ede08f543cf..5ede49d0d84 100644 --- a/reactos/dll/win32/advapi32/sec/sec.c +++ b/reactos/dll/win32/advapi32/sec/sec.c @@ -631,9 +631,9 @@ BOOL WINAPI EncryptFileA(LPCSTR lpFileName) } BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW( - PSECURITY_DESCRIPTOR pSecurityDescriptor, - DWORD dword, - SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD dword, + SECURITY_INFORMATION SecurityInformation, LPWSTR* lpwstr, PULONG pulong) { @@ -643,9 +643,9 @@ BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW( } BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA( - PSECURITY_DESCRIPTOR pSecurityDescriptor, - DWORD dword, - SECURITY_INFORMATION SecurityInformation, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD dword, + SECURITY_INFORMATION SecurityInformation, LPSTR* lpstr, PULONG pulong) { diff --git a/reactos/dll/win32/advapi32/sec/sid.c b/reactos/dll/win32/advapi32/sec/sid.c index c4f63a6321e..5e9c1156d92 100644 --- a/reactos/dll/win32/advapi32/sec/sid.c +++ b/reactos/dll/win32/advapi32/sec/sid.c @@ -699,7 +699,7 @@ ConvertStringSecurityDescriptorToSecurityDescriptorW( DWORD aclFlags; SIZE_T Length; BOOL isDacl = (ptr[-2] == 'D'); - + if (isDacl) ret = ParseFlagsString(ptr, DaclFlagTable, SDDL_ACE_BEGINC, &aclFlags, &Length); else diff --git a/reactos/dll/win32/advapi32/token/token.c b/reactos/dll/win32/advapi32/token/token.c index 27cdb500a10..205b06e91af 100644 --- a/reactos/dll/win32/advapi32/token/token.c +++ b/reactos/dll/win32/advapi32/token/token.c @@ -518,7 +518,7 @@ IsTokenRestricted(HANDLE TokenHandle) PTOKEN_GROUPS lpGroups; NTSTATUS Status; BOOL Ret = FALSE; - + /* determine the required buffer size and allocate enough memory to read the list of restricted SIDs */ @@ -532,7 +532,7 @@ IsTokenRestricted(HANDLE TokenHandle) SetLastError(RtlNtStatusToDosError(Status)); return FALSE; } - + AllocAndReadRestrictedSids: lpGroups = (PTOKEN_GROUPS)HeapAlloc(GetProcessHeap(), 0, @@ -542,9 +542,9 @@ AllocAndReadRestrictedSids: SetLastError(ERROR_OUTOFMEMORY); return FALSE; } - + /* actually read the list of the restricted SIDs */ - + Status = NtQueryInformationToken(TokenHandle, TokenRestrictedSids, lpGroups, @@ -568,7 +568,7 @@ AllocAndReadRestrictedSids: { SetLastError(RtlNtStatusToDosError(Status)); } - + /* free allocated memory */ HeapFree(GetProcessHeap(), @@ -578,7 +578,7 @@ AllocAndReadRestrictedSids: return Ret; } -BOOL STDCALL +BOOL STDCALL CreateRestrictedToken( HANDLE TokenHandle, DWORD Flags, @@ -636,7 +636,7 @@ GetSiteSidFromToken(IN HANDLE TokenHandle) &RetLen); if (NT_SUCCESS(Status)) { - for (i = 0; i < RestrictedSids->GroupCount; i++) + for (i = 0; i < RestrictedSids->GroupCount; i++) { SID* RSSid = RestrictedSids->Groups[i].Sid; @@ -649,7 +649,7 @@ GetSiteSidFromToken(IN HANDLE TokenHandle) 0, RtlLengthSid((RestrictedSids-> Groups[i]).Sid)); - if (PSiteSid == NULL) + if (PSiteSid == NULL) { SetLastError(ERROR_OUTOFMEMORY); } diff --git a/reactos/dll/win32/advpack/advpack.c b/reactos/dll/win32/advpack/advpack.c index ee3a87ea92b..2a8fecb19f0 100644 --- a/reactos/dll/win32/advpack/advpack.c +++ b/reactos/dll/win32/advpack/advpack.c @@ -365,7 +365,7 @@ HRESULT WINAPI OpenINFEngineW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSection, return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); set_ldids(*phInf, pszInstallSection, NULL); - + return S_OK; } @@ -672,7 +672,7 @@ HRESULT WINAPI TranslateInfStringA(LPCSTR pszInfFilename, LPCSTR pszInstallSecti else res = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); } - + HeapFree(GetProcessHeap(), 0, bufferW); } @@ -789,7 +789,7 @@ HRESULT WINAPI TranslateInfStringExA(HINF hInf, LPCSTR pszInfFilename, else res = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); } - + HeapFree(GetProcessHeap(), 0, bufferW); } @@ -850,7 +850,7 @@ HRESULT WINAPI TranslateInfStringExW(HINF hInf, LPCWSTR pszInfFilename, return SPAPI_E_LINE_NOT_FOUND; } - return S_OK; + return S_OK; } /*********************************************************************** diff --git a/reactos/dll/win32/advpack/files.c b/reactos/dll/win32/advpack/files.c index 163f994cdf1..fbe85cbaa40 100644 --- a/reactos/dll/win32/advpack/files.c +++ b/reactos/dll/win32/advpack/files.c @@ -109,7 +109,7 @@ HRESULT WINAPI AddDelBackupEntryA(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir, * NOTES * If the INI file does not exist before adding entries to it, the file * will be created. - * + * * If lpcszBackupDir is NULL, the INI file is assumed to exist in * c:\windows or created there if it does not exist. */ @@ -122,7 +122,7 @@ HRESULT WINAPI AddDelBackupEntryW(LPCWSTR lpcszFileList, LPCWSTR lpcszBackupDir, static const WCHAR szBackupEntry[] = { '-','1',',','0',',','0',',','0',',','0',',','0',',','-','1',0 }; - + static const WCHAR backslash[] = {'\\',0}; static const WCHAR ini[] = {'.','i','n','i',0}; static const WCHAR backup[] = {'b','a','c','k','u','p',0}; @@ -263,7 +263,7 @@ HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSou if (!lpszSourceDir || !lpszSourceFile || !lpszDestDir) return E_INVALIDARG; - + fileQueue = SetupOpenFileQueue(); if (fileQueue == INVALID_HANDLE_VALUE) return HRESULT_FROM_WIN32(GetLastError()); @@ -320,9 +320,9 @@ HRESULT WINAPI AdvInstallFileW(HWND hwnd, LPCWSTR lpszSourceDir, LPCWSTR lpszSou done: SetupTermDefaultQueueCallback(pContext); SetupCloseFileQueue(fileQueue); - + HeapFree(GetProcessHeap(), 0, szDestFilename); - + return HRESULT_FROM_WIN32(dwLastError); } @@ -385,7 +385,7 @@ static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags) ret = S_OK; } } - + return ret; } @@ -419,7 +419,7 @@ HRESULT WINAPI DelNodeA(LPCSTR pszFileOrDirName, DWORD dwFlags) * pszFileOrDirName [I] Name of file or directory to delete * dwFlags [I] Flags; see include/advpub.h * - * RETURNS + * RETURNS * Success: S_OK * Failure: E_FAIL * @@ -432,9 +432,9 @@ HRESULT WINAPI DelNodeW(LPCWSTR pszFileOrDirName, DWORD dwFlags) { WCHAR fname[MAX_PATH]; HRESULT ret = E_FAIL; - + TRACE("(%s, %d)\n", debugstr_w(pszFileOrDirName), dwFlags); - + if (dwFlags) FIXME("Flags ignored!\n"); @@ -547,7 +547,7 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles) const char *first = FileList; const char *last = FileList + strlen(FileList) - 1; LPSTR szConvertedList, temp; - + /* any number of these chars before the list is OK */ while (first < last && (*first == ' ' || *first == '\t' || *first == ':')) first++; @@ -572,7 +572,7 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles) HeapFree(GetProcessHeap(), 0, szConvertedList); return NULL; } - + *dwNumFiles = 1; /* convert the colons to double-null termination */ @@ -689,7 +689,7 @@ static DWORD fill_file_list(EXTRACTdest *extractDest, LPCSTR szCabName, LPCSTR s */ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, LPCSTR FileList, LPVOID LReserved, DWORD Reserved) -{ +{ EXTRACTdest extractDest; HMODULE hCabinet; HRESULT res = S_OK; @@ -824,7 +824,7 @@ HRESULT WINAPI FileSaveRestoreA(HWND hDlg, LPSTR pszFileList, LPSTR pszDir, RtlFreeUnicodeString(&basename); return hr; -} +} /*********************************************************************** * FileSaveRestoreW (ADVPACK.@) diff --git a/reactos/dll/win32/advpack/install.c b/reactos/dll/win32/advpack/install.c index c5a5df00cda..75f1ebf1d95 100644 --- a/reactos/dll/win32/advpack/install.c +++ b/reactos/dll/win32/advpack/install.c @@ -82,7 +82,7 @@ static HRESULT del_dirs_callback(HINF hinf, PCWSTR field, const void *arg) DWORD size; BOOL ok = SetupFindFirstLineW(hinf, field, NULL, &context); - + for (; ok; ok = SetupFindNextLine(&context, &context)) { WCHAR directory[MAX_INF_STRING_LENGTH]; @@ -148,7 +148,7 @@ static HRESULT register_ocxs_callback(HINF hinf, PCWSTR field, const void *arg) HRESULT hr = S_OK; BOOL ok = SetupFindFirstLineW(hinf, field, NULL, &context); - + for (; ok; ok = SetupFindNextLine(&context, &context)) { WCHAR buffer[MAX_INF_STRING_LENGTH]; @@ -633,7 +633,7 @@ HRESULT WINAPI ExecuteCabA(HWND hwnd, CABINFOA* pCab, LPVOID pReserved) RtlCreateUnicodeStringFromAsciiz(&inf, pCab->pszInf); RtlCreateUnicodeStringFromAsciiz(§ion, pCab->pszSection); - + MultiByteToWideChar(CP_ACP, 0, pCab->szSrcPath, -1, cabinfo.szSrcPath, sizeof(cabinfo.szSrcPath) / sizeof(WCHAR)); @@ -654,14 +654,14 @@ HRESULT WINAPI ExecuteCabA(HWND hwnd, CABINFOA* pCab, LPVOID pReserved) /*********************************************************************** * ExecuteCabW (ADVPACK.@) - * + * * Installs the INF file extracted from a specified cabinet file. - * + * * PARAMS * hwnd [I] Handle to the window used for the display. * pCab [I] Information about the cabinet file. * pReserved [I] Reserved. Must be NULL. - * + * * RETURNS * Success: S_OK. * Failure: E_FAIL. diff --git a/reactos/dll/win32/advpack/reg.c b/reactos/dll/win32/advpack/reg.c index 2b1418ad5d4..be4eade5a2c 100644 --- a/reactos/dll/win32/advpack/reg.c +++ b/reactos/dll/win32/advpack/reg.c @@ -77,7 +77,7 @@ static BOOL create_tmp_ini_file(HMODULE hm, WCHAR *ini_file) if(!rsrc_data || !rsrc_size) { ERR("Can't load REGINST resource\n"); goto error; - } + } if((hf = CreateFileW(ini_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) { @@ -213,7 +213,7 @@ static HRESULT write_predefined_strings(HMODULE hm, LPCWSTR ini_path) * hm [I] Module that contains the REGINST resouce. * pszSection [I] The INF section to execute. * pstTable [I] Table of string substitutions. - * + * * RETURNS * Success: S_OK. * Failure: E_FAIL. @@ -239,11 +239,11 @@ HRESULT WINAPI RegInstallW(HMODULE hm, LPCWSTR pszSection, const STRTABLEW* pstT for(i = 0; i < pstTable->cEntries; i++) { WCHAR tmp_value[MAX_PATH + 2]; - + tmp_value[0] = '\"'; lstrcpyW(tmp_value + 1, pstTable->pse[i].pszValue); lstrcatW(tmp_value, quote); - + WritePrivateProfileStringW(Strings, pstTable->pse[i].pszName, tmp_value, tmp_ini_path); } } @@ -307,8 +307,8 @@ HRESULT WINAPI RegRestoreAllA(HWND hWnd, LPSTR pszTitleString, HKEY hkBackupKey) HRESULT WINAPI RegRestoreAllW(HWND hWnd, LPWSTR pszTitleString, HKEY hkBackupKey) { FIXME("(%p, %s, %p) stub\n", hWnd, debugstr_w(pszTitleString), hkBackupKey); - - return E_FAIL; + + return E_FAIL; } /*********************************************************************** @@ -354,9 +354,9 @@ HRESULT WINAPI RegSaveRestoreA(HWND hWnd, LPCSTR pszTitleString, HKEY hkBackupKe * hkBackupKey [I] Key used to store the backup data. * pcszRootKey [I] Root key of the registry value * pcszSubKey [I] Sub key of the registry value. - * pcszValueName [I] Value to save or restore. + * pcszValueName [I] Value to save or restore. * dwFlags [I] See advpub.h. - * + * * RETURNS * Success: S_OK. * Failure: E_FAIL. @@ -372,7 +372,7 @@ HRESULT WINAPI RegSaveRestoreW(HWND hWnd, LPCWSTR pszTitleString, HKEY hkBackupK hkBackupKey, debugstr_w(pcszRootKey), debugstr_w(pcszSubKey), debugstr_w(pcszValueName), dwFlags); - return E_FAIL; + return E_FAIL; } /*********************************************************************** @@ -434,5 +434,5 @@ HRESULT WINAPI RegSaveRestoreOnINFW(HWND hWnd, LPCWSTR pszTitle, LPCWSTR pszINF, debugstr_w(pszINF), debugstr_w(pszSection), hHKLMBackKey, hHKCUBackKey, dwFlags); - return E_FAIL; + return E_FAIL; } diff --git a/reactos/dll/win32/authz/clictx.c b/reactos/dll/win32/authz/clictx.c index 358b480b641..cc410909def 100644 --- a/reactos/dll/win32/authz/clictx.c +++ b/reactos/dll/win32/authz/clictx.c @@ -49,7 +49,7 @@ AuthzInitializeContextFromSid(IN DWORD Flags, { PAUTHZ_CLIENT_CONTEXT ClientCtx; //PAUTHZ_RESMAN ResMan = (PAUTHZ_RESMAN)AuthzResourceManager; - + VALIDATE_RESMAN_HANDLE(AuthzResourceManager); ClientCtx = (PAUTHZ_CLIENT_CONTEXT)LocalAlloc(LMEM_FIXED, @@ -116,9 +116,9 @@ AuthzGetInformationFromContext(IN AUTHZ_CLIENT_CONTEXT_HANDLE hAuthzClientContex if (hAuthzClientContext != NULL && pSizeRequired != NULL) { PAUTHZ_CLIENT_CONTEXT ClientCtx = (PAUTHZ_CLIENT_CONTEXT)hAuthzClientContext; - + VALIDATE_CLIENTCTX_HANDLE(hAuthzClientContext); - + switch (InfoClass) { case AuthzContextInfoUserSid: diff --git a/reactos/dll/win32/authz/precomp.h b/reactos/dll/win32/authz/precomp.h index 50e1d55cfb2..c8d62cfc0c9 100644 --- a/reactos/dll/win32/authz/precomp.h +++ b/reactos/dll/win32/authz/precomp.h @@ -43,7 +43,7 @@ typedef struct _AUTHZ_RESMAN PFN_AUTHZ_DYNAMIC_ACCESS_CHECK pfnAccessCheck; PFN_AUTHZ_COMPUTE_DYNAMIC_GROUPS pfnComputeDynamicGroups; PFN_AUTHZ_FREE_DYNAMIC_GROUPS pfnFreeDynamicGroups; - + DWORD flags; PSID UserSid; LUID AuthenticationId; diff --git a/reactos/dll/win32/authz/resman.c b/reactos/dll/win32/authz/resman.c index e433b98a07f..b46cf4f7644 100644 --- a/reactos/dll/win32/authz/resman.c +++ b/reactos/dll/win32/authz/resman.c @@ -37,7 +37,7 @@ AuthzpQueryToken(IN OUT PAUTHZ_RESMAN ResMan, DWORD BufLen; PSID UserSid = NULL; BOOL Ret = FALSE; - + /* query information about the user */ BufLen = sizeof(User); Ret = GetTokenInformation(hToken, @@ -64,7 +64,7 @@ AuthzpQueryToken(IN OUT PAUTHZ_RESMAN ResMan, else Ret = FALSE; } - + if (Ret) { /* query general information */ @@ -75,7 +75,7 @@ AuthzpQueryToken(IN OUT PAUTHZ_RESMAN ResMan, BufLen, &BufLen); } - + if (Ret) { ResMan->UserSid = UserSid; @@ -109,7 +109,7 @@ AuthzpInitUnderImpersonation(IN OUT PAUTHZ_RESMAN ResMan) hToken); CloseHandle(hToken); } - + return Ret; } @@ -153,12 +153,12 @@ AuthzInitializeResourceManager(IN DWORD flags, { PAUTHZ_RESMAN ResMan; SIZE_T RequiredSize = sizeof(AUTHZ_RESMAN); - + if (ResourceManagerName != NULL) { RequiredSize += wcslen(ResourceManagerName) * sizeof(WCHAR); } - + ResMan = (PAUTHZ_RESMAN)LocalAlloc(LMEM_FIXED, RequiredSize); if (ResMan != NULL) @@ -178,17 +178,17 @@ AuthzInitializeResourceManager(IN DWORD flags, } else ResMan->ResourceManagerName[0] = UNICODE_NULL; - + ResMan->pfnAccessCheck = pfnAccessCheck; ResMan->pfnComputeDynamicGroups = pfnComputeDynamicGroups; ResMan->pfnFreeDynamicGroups = pfnFreeDynamicGroups; - + if (!(flags & AUTHZ_RM_FLAG_NO_AUDIT)) { /* FIXME - initialize auditing */ DPRINT1("Auditing not implemented!\n"); } - + if (flags & AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION) { Ret = AuthzpInitUnderImpersonation(ResMan); @@ -197,7 +197,7 @@ AuthzInitializeResourceManager(IN DWORD flags, { Ret = AuthzpInitSelf(ResMan); } - + if (Ret) { /* finally return the handle */ @@ -212,7 +212,7 @@ AuthzInitializeResourceManager(IN DWORD flags, } else SetLastError(ERROR_INVALID_PARAMETER); - + return Ret; } @@ -230,19 +230,19 @@ AuthzFreeResourceManager(IN AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager) if (AuthzResourceManager != NULL) { PAUTHZ_RESMAN ResMan = (PAUTHZ_RESMAN)AuthzResourceManager; - + VALIDATE_RESMAN_HANDLE(AuthzResourceManager); - + if (!(ResMan->flags & AUTHZ_RM_FLAG_NO_AUDIT)) { /* FIXME - cleanup auditing */ } - + if (ResMan->UserSid != NULL) { LocalFree((HLOCAL)ResMan->UserSid); } - + LocalFree((HLOCAL)AuthzResourceManager); Ret = TRUE; } diff --git a/reactos/dll/win32/avifil32/api.c b/reactos/dll/win32/avifil32/api.c index 592bac34b7b..b05ba18a73d 100644 --- a/reactos/dll/win32/avifil32/api.c +++ b/reactos/dll/win32/avifil32/api.c @@ -1159,7 +1159,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving) break; } } - + memcpy(szFilter, szAllFiles, size * sizeof(szAllFiles[0])); szFilter += size; szFilter[0] = 0; @@ -1827,7 +1827,7 @@ HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler, if (curStream != 0) { lFirstVideo = AVIStreamSampleToSample(pInStreams[curStream], pInStreams[0], - (sInfo.fccType == streamtypeVIDEO ? + (sInfo.fccType == streamtypeVIDEO ? (LONG)dwInterleave : lSampleInc) + sInfo.dwInitialFrames + lCurFrame); } else diff --git a/reactos/dll/win32/avifil32/avifile.c b/reactos/dll/win32/avifil32/avifile.c index 3ed63868432..9911c814e2e 100644 --- a/reactos/dll/win32/avifil32/avifile.c +++ b/reactos/dll/win32/avifil32/avifile.c @@ -2248,7 +2248,7 @@ static HRESULT AVIFILE_SaveFile(IAVIFileImpl *This) ck.cksize, NULL, NULL); if (mmioWrite(This->hmmio, (HPSTR)str, ck.cksize) != ck.cksize) { - HeapFree(GetProcessHeap(), 0, str); + HeapFree(GetProcessHeap(), 0, str); return AVIERR_FILEWRITE; } diff --git a/reactos/dll/win32/avifil32/avifile_Cs.rc b/reactos/dll/win32/avifil32/avifile_Cs.rc index 25d4ce56df9..bf8d4340d70 100644 --- a/reactos/dll/win32/avifil32/avifile_Cs.rc +++ b/reactos/dll/win32/avifil32/avifile_Cs.rc @@ -30,7 +30,7 @@ CAPTION "Nastaven FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Vyber datový proud:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "V&olby...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "Prolož&it každých",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_De.rc b/reactos/dll/win32/avifil32/avifile_De.rc index 7539af26186..74435b70bac 100644 --- a/reactos/dll/win32/avifil32/avifile_De.rc +++ b/reactos/dll/win32/avifil32/avifile_De.rc @@ -24,7 +24,7 @@ CAPTION "Komprimierungsoptionen" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Wählen Sie die Eingangsdaten aus:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Optionen...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Interleave alle",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_En.rc b/reactos/dll/win32/avifil32/avifile_En.rc index 2fc5b451cb6..5d1b6f39b4f 100644 --- a/reactos/dll/win32/avifil32/avifile_En.rc +++ b/reactos/dll/win32/avifil32/avifile_En.rc @@ -24,7 +24,7 @@ CAPTION "Compress options" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Choose a stream:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Options...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Interleave every",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Es.rc b/reactos/dll/win32/avifil32/avifile_Es.rc index ee3e73a4c81..d0166e4169c 100644 --- a/reactos/dll/win32/avifil32/avifile_Es.rc +++ b/reactos/dll/win32/avifil32/avifile_Es.rc @@ -24,7 +24,7 @@ CAPTION "Opciones de compresi FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Elija un stream:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Opciones...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Interleave cada",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Fr.rc b/reactos/dll/win32/avifil32/avifile_Fr.rc index 1570fe19bd1..4af35796dc5 100644 --- a/reactos/dll/win32/avifil32/avifile_Fr.rc +++ b/reactos/dll/win32/avifil32/avifile_Fr.rc @@ -28,7 +28,7 @@ CAPTION "Options de compression" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Sélectionnez un flux :",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Options...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Imbriquer à chaque",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Hu.rc b/reactos/dll/win32/avifil32/avifile_Hu.rc index 8eb98250219..1403ebf4309 100644 --- a/reactos/dll/win32/avifil32/avifile_Hu.rc +++ b/reactos/dll/win32/avifil32/avifile_Hu.rc @@ -24,7 +24,7 @@ CAPTION "T FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Válassuon folyamot:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Opciók...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Beékel minden",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Ja.rc b/reactos/dll/win32/avifil32/avifile_Ja.rc index 38fc247611b..eaa4e1a4add 100644 --- a/reactos/dll/win32/avifil32/avifile_Ja.rc +++ b/reactos/dll/win32/avifil32/avifile_Ja.rc @@ -24,7 +24,7 @@ CAPTION " FONT 9, "MS UI Gothic" BEGIN LTEXT "ƒXƒgƒŠ[ƒ€‚ð‘I‘ð(&C):",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "ƒIƒvƒVƒ‡ƒ“(&O)...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "ƒCƒ“ƒ^[ƒŠ[ƒu(&I)",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Ko.rc b/reactos/dll/win32/avifil32/avifile_Ko.rc index 035888cc1be..c92b8d883e4 100644 --- a/reactos/dll/win32/avifil32/avifile_Ko.rc +++ b/reactos/dll/win32/avifil32/avifile_Ko.rc @@ -25,7 +25,7 @@ CAPTION " FONT 8, "MS Shell Dlg" BEGIN LTEXT "½ºÆ®¸² ¼±ÅÃ(&C):",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "¿É¼Ç(&O)...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "Ç×»ó »óÈ£¹èÄ¡(&I)",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Nl.rc b/reactos/dll/win32/avifil32/avifile_Nl.rc index 9d6ce689466..9035857f754 100644 --- a/reactos/dll/win32/avifil32/avifile_Nl.rc +++ b/reactos/dll/win32/avifil32/avifile_Nl.rc @@ -26,7 +26,7 @@ CAPTION "Compressie-instellingen" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Kies een invoerbestand:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Opties...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Interleave alle",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_No.rc b/reactos/dll/win32/avifil32/avifile_No.rc index 8ead416b76e..06fadd23414 100644 --- a/reactos/dll/win32/avifil32/avifile_No.rc +++ b/reactos/dll/win32/avifil32/avifile_No.rc @@ -24,7 +24,7 @@ CAPTION "Komprimeringsinnstillinger" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Velg en strøm:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "I&nnstillinger . . .",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "Sett &inn for hver",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Pl.rc b/reactos/dll/win32/avifil32/avifile_Pl.rc index dbd35001d4f..29fc21731b4 100644 --- a/reactos/dll/win32/avifil32/avifile_Pl.rc +++ b/reactos/dll/win32/avifil32/avifile_Pl.rc @@ -25,7 +25,7 @@ CAPTION "Opcje kompresji" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Wybierz strumieñ:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Opcje...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Przeplot co",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Pt.rc b/reactos/dll/win32/avifil32/avifile_Pt.rc index 7e5d1c530d8..334b6d77c55 100644 --- a/reactos/dll/win32/avifil32/avifile_Pt.rc +++ b/reactos/dll/win32/avifil32/avifile_Pt.rc @@ -25,7 +25,7 @@ CAPTION "Op FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Escolha a stream:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Opções...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Interleave every",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Ru.rc b/reactos/dll/win32/avifil32/avifile_Ru.rc index 88f313c5ec0..aaf277d327e 100644 --- a/reactos/dll/win32/avifil32/avifile_Ru.rc +++ b/reactos/dll/win32/avifil32/avifile_Ru.rc @@ -26,7 +26,7 @@ CAPTION " FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Âûáåðèòå ïîòîê:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Îïöèè...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Ïðîñëàèâàòü êàæäûå",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Si.rc b/reactos/dll/win32/avifil32/avifile_Si.rc index 1b5d7dc70aa..1b0ed56d7f8 100644 --- a/reactos/dll/win32/avifil32/avifile_Si.rc +++ b/reactos/dll/win32/avifil32/avifile_Si.rc @@ -24,7 +24,7 @@ CAPTION "Mo FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Izbira toka:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Možnosti ...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Preplet vsake",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Tr.rc b/reactos/dll/win32/avifil32/avifile_Tr.rc index b9caa67e463..67c297f3936 100644 --- a/reactos/dll/win32/avifil32/avifile_Tr.rc +++ b/reactos/dll/win32/avifil32/avifile_Tr.rc @@ -24,7 +24,7 @@ CAPTION "S FONT 8, "MS Shell Dlg" BEGIN LTEXT "Bir akýþ se&çin:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Seçenekler...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&Interleave every",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/avifile_Uk.rc b/reactos/dll/win32/avifil32/avifile_Uk.rc index 759811a85e9..87911496031 100644 --- a/reactos/dll/win32/avifil32/avifile_Uk.rc +++ b/reactos/dll/win32/avifil32/avifile_Uk.rc @@ -14,7 +14,7 @@ CAPTION " FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Îáåð³òü ïîò³ê:",-1,2,5,114,10 - COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Ï&àðàìåòðè...",IDC_OPTIONS,145,17,45,14 AUTOCHECKBOX "&²íòåðâàë ÷åðãóâàííÿ",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP diff --git a/reactos/dll/win32/avifil32/editstream.c b/reactos/dll/win32/avifil32/editstream.c index 14d361e2a32..8857d094c39 100644 --- a/reactos/dll/win32/avifil32/editstream.c +++ b/reactos/dll/win32/avifil32/editstream.c @@ -653,7 +653,7 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart, nLastStream++; nStreams = nLastStream - streamNr; - } else + } else nStreams = 1; if (This->nStreams + nStreams + 1 > This->nTableSize) { n = This->nStreams + nStreams + 33; @@ -944,7 +944,7 @@ static HRESULT WINAPI IEditAVIStream_fnReadFormat(IAVIStream*iface,LONG pos, } else n = 0; n += lp->biSize; - + memcpy(format, lp, min((LONG)n, *fmtsize)); hr = ((LONG)n > *fmtsize ? AVIERR_BUFFERTOOSMALL : AVIERR_OK); *fmtsize = n; diff --git a/reactos/dll/win32/avifil32/getframe.c b/reactos/dll/win32/avifil32/getframe.c index d342b1255ae..efb9d867661 100644 --- a/reactos/dll/win32/avifil32/getframe.c +++ b/reactos/dll/win32/avifil32/getframe.c @@ -387,7 +387,7 @@ static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface, /* only to pass through? */ if (This->lpInFormat->biCompression == BI_RGB && lpBits == NULL) { - if (lpbi == NULL || + if (lpbi == NULL || (lpbi->biCompression == BI_RGB && lpbi->biWidth == This->lpInFormat->biWidth && lpbi->biHeight == This->lpInFormat->biHeight && diff --git a/reactos/dll/win32/avifil32/icmstream.c b/reactos/dll/win32/avifil32/icmstream.c index 82536052d15..f7ca317e2d9 100644 --- a/reactos/dll/win32/avifil32/icmstream.c +++ b/reactos/dll/win32/avifil32/icmstream.c @@ -815,7 +815,7 @@ static HRESULT AVIFILE_EncodeFrame(IAVIStreamImpl *This, dwMinQual = ICQUALITY_LOW; noPrev = TRUE; - if ((icmFlags & ICCOMPRESS_KEYFRAME) == 0 && + if ((icmFlags & ICCOMPRESS_KEYFRAME) == 0 && (This->dwICMFlags & VIDCF_FASTTEMPORALC) == 0) noPrev = FALSE; diff --git a/reactos/dll/win32/avifil32/wavfile.c b/reactos/dll/win32/avifil32/wavfile.c index d3048d60318..59e08a828a1 100644 --- a/reactos/dll/win32/avifil32/wavfile.c +++ b/reactos/dll/win32/avifil32/wavfile.c @@ -915,7 +915,7 @@ static HRESULT WINAPI IAVIStream_fnRead(IAVIStream *iface, LONG start, if (bytesread != NULL) *bytesread = buffersize; if (samplesread != NULL) - *samplesread = samples; + *samplesread = samples; return AVIERR_OK; } diff --git a/reactos/dll/win32/beepmidi/beepmidi.c b/reactos/dll/win32/beepmidi/beepmidi.c index ba50ffe6342..8665bec17d4 100644 --- a/reactos/dll/win32/beepmidi/beepmidi.c +++ b/reactos/dll/win32/beepmidi/beepmidi.c @@ -499,9 +499,9 @@ PlayNote( NoteNode* tail_node = NULL; EnterCriticalSection(&device_lock); - + node = device_info->note_list; - + while ( node != NULL ) { #ifndef ALLOW_DUPLICATE_NOTES diff --git a/reactos/dll/win32/cabinet/cabinet.h b/reactos/dll/win32/cabinet/cabinet.h index befa60404eb..2f6115536a8 100644 --- a/reactos/dll/win32/cabinet/cabinet.h +++ b/reactos/dll/win32/cabinet/cabinet.h @@ -132,7 +132,7 @@ struct ZIPstate { cab_ULONG x[ZIPBMAX+1]; /* bit offsets, then code stack */ cab_UBYTE *inpos; }; - + /* Quantum stuff */ struct QTMmodelsym { @@ -140,7 +140,7 @@ struct QTMmodelsym { }; struct QTMmodel { - int shiftsleft, entries; + int shiftsleft, entries; struct QTMmodelsym *syms; cab_UWORD tabloc[256]; }; diff --git a/reactos/dll/win32/cabinet/cabinet_main.c b/reactos/dll/win32/cabinet/cabinet_main.c index 2c21286b5e5..98ff33e291e 100644 --- a/reactos/dll/win32/cabinet/cabinet_main.c +++ b/reactos/dll/win32/cabinet/cabinet_main.c @@ -124,7 +124,7 @@ static UINT fdi_read(INT_PTR hf, void *pv, UINT cb) { HANDLE handle = (HANDLE) hf; DWORD dwRead; - + if (ReadFile(handle, pv, cb, &dwRead, NULL)) return dwRead; diff --git a/reactos/dll/win32/cabinet/fdi.c b/reactos/dll/win32/cabinet/fdi.c index 01203b6e462..dfe0c7569c8 100644 --- a/reactos/dll/win32/cabinet/fdi.c +++ b/reactos/dll/win32/cabinet/fdi.c @@ -143,7 +143,7 @@ typedef struct fdi_cds_fwd { USHORT iCabinet; /* Cabinet number in set (0 based) */ struct fdi_cds_fwd *decomp_cab; MORE_ISCAB_INFO mii; - struct fdi_folder *firstfol; + struct fdi_folder *firstfol; struct fdi_file *firstfile; struct fdi_cds_fwd *next; } fdi_decomp_state; @@ -190,7 +190,7 @@ void QTMupdatemodel(struct QTMmodel *model, int sym) { } } } - + /* then convert frequencies back to cumfreq */ for (i = model->entries - 1; i >= 0; i--) { model->syms[i].cumfreq += model->syms[i+1].cumfreq; @@ -348,7 +348,7 @@ cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum) { * * INCLUDES * fdi.h - * + * */ HFDI __cdecl FDICreate( PFNALLOC pfnalloc, @@ -385,7 +385,7 @@ HFDI __cdecl FDICreate( SetLastError(ERROR_NOT_ENOUGH_MEMORY); return NULL; } - + PFDI_INT(rv)->FDI_Intmagic = FDI_INT_MAGIC; PFDI_INT(rv)->pfnalloc = pfnalloc; PFDI_INT(rv)->pfnfree = pfnfree; @@ -423,7 +423,7 @@ static void *FDI_realloc(HFDI hfdi, void *mem, size_t prevsize, size_t newsize) char *irslt, *imem; size_t copysize = (prevsize < newsize) ? prevsize : newsize; if (prevsize == newsize) return mem; - rslt = PFDI_ALLOC(hfdi, newsize); + rslt = PFDI_ALLOC(hfdi, newsize); if (rslt) for (irslt = (char *)rslt, imem = (char *)mem; (copysize); copysize--) *irslt++ = *imem++; @@ -503,7 +503,7 @@ static BOOL FDI_read_entries( TRACE("(hfdi == ^%p, hf == %ld, pfdici == ^%p)\n", hfdi, hf, pfdici); - /* + /* * FIXME: I just noticed that I am memorizing the initial file pointer * offset and restoring it before reading in the rest of the header * information in the cabinet. Perhaps that's correct -- that is, perhaps @@ -513,7 +513,7 @@ static BOOL FDI_read_entries( * (Either way, the semantics of wine's FDICopy require me to leave the * file pointer where it is afterwards -- If Windows does not do so, we * ought to duplicate the native behavior in the FDIIsCabinet API, not here. - * + * * So, the answer lies in Windows; will native cabinet.dll recognize a * cabinet "file" embedded in another file? Note that cabextract.c does * support this, which implies that Microsoft's might. I haven't tried it @@ -547,7 +547,7 @@ static BOOL FDI_read_entries( cabsize = FDI_getoffset(hfdi, hf); - if ((cabsize == -1) || (base_offset == -1) || + if ((cabsize == -1) || (base_offset == -1) || ( PFDI_SEEK(hfdi, hf, base_offset, SEEK_SET) == -1 )) { if (pmii) { PFDI_INT(hfdi)->perf->erfOper = FDIERROR_NOT_A_CABINET; @@ -566,7 +566,7 @@ static BOOL FDI_read_entries( } return FALSE; } - + /* check basic MSCF signature */ if (EndGetI32(buf+cfhead_Signature) != 0x4643534d) { if (pmii) { @@ -676,7 +676,7 @@ static BOOL FDI_read_entries( PFDI_FREE(hfdi, prevname); previnfo = FDI_read_string(hfdi, hf, cabsize); if (previnfo) { - if (pmii) + if (pmii) pmii->previnfo = previnfo; else PFDI_FREE(hfdi, previnfo); @@ -739,7 +739,7 @@ static BOOL FDI_read_entries( * be filled out with information about the cabinet * file indicated by hf if, indeed, it is determined * to be a cabinet. - * + * * RETURNS * TRUE if the file is a cabinet. The info pointed to by pfdici will * be provided. @@ -782,7 +782,7 @@ BOOL __cdecl FDIIsCabinet( SetLastError(ERROR_BAD_ARGUMENTS); return FALSE; } - rv = FDI_read_entries(hfdi, hf, pfdici, NULL); + rv = FDI_read_entries(hfdi, hf, pfdici, NULL); if (rv) pfdici->hasnext = FALSE; /* yuck. duplicate apparent cabinet.dll bug */ @@ -946,7 +946,7 @@ static void fdi_Ziphuft_free(HFDI hfdi, struct Ziphuft *t) q = (--p)->v.t; PFDI_FREE(hfdi, p); p = q; - } + } } /********************************************************* @@ -1636,7 +1636,7 @@ static int fdi_lzx_read_lens(cab_UBYTE *lens, cab_ULONG first, cab_ULONG last, s register int bitsleft = lb->bl; cab_UBYTE *inpos = lb->ip; cab_UWORD *hufftbl; - + for (x = 0; x < 20; x++) { READ_BITS(y, 4); LENTABLE(PRETREE)[x] = y; @@ -1789,28 +1789,28 @@ static int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state) else { /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */ main_element -= LZX_NUM_CHARS; - + match_length = main_element & LZX_NUM_PRIMARY_LENGTHS; if (match_length == LZX_NUM_PRIMARY_LENGTHS) { READ_HUFFSYM(LENGTH, length_footer); match_length += length_footer; } match_length += LZX_MIN_MATCH; - + match_offset = main_element >> 3; - + if (match_offset > 2) { /* not repeated offset */ if (match_offset != 3) { extra = CAB(extra_bits)[match_offset]; READ_BITS(verbatim_bits, extra); - match_offset = CAB(lzx_position_base)[match_offset] + match_offset = CAB(lzx_position_base)[match_offset] - 2 + verbatim_bits; } else { match_offset = 1; } - + /* update repeated offset LRU queue */ R2 = R1; R1 = R0; R0 = match_offset; } @@ -1854,7 +1854,7 @@ static int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state) case LZX_BLOCKTYPE_ALIGNED: while (this_run > 0) { READ_HUFFSYM(MAINTREE, main_element); - + if (main_element < LZX_NUM_CHARS) { /* literal: 0 to LZX_NUM_CHARS-1 */ window[window_posn++] = main_element; @@ -1863,16 +1863,16 @@ static int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state) else { /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */ main_element -= LZX_NUM_CHARS; - + match_length = main_element & LZX_NUM_PRIMARY_LENGTHS; if (match_length == LZX_NUM_PRIMARY_LENGTHS) { READ_HUFFSYM(LENGTH, length_footer); match_length += length_footer; } match_length += LZX_MIN_MATCH; - + match_offset = main_element >> 3; - + if (match_offset > 2) { /* not repeated offset */ extra = CAB(extra_bits)[match_offset]; @@ -1899,7 +1899,7 @@ static int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state) /* ??? */ match_offset = 1; } - + /* update repeated offset LRU queue */ R2 = R1; R1 = R0; R0 = match_offset; } @@ -2071,7 +2071,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state char emptystring = '\0'; cab_UBYTE buf2[64]; int success = FALSE; - struct fdi_folder *fol = NULL, *linkfol = NULL; + struct fdi_folder *fol = NULL, *linkfol = NULL; struct fdi_file *file = NULL, *linkfile = NULL; tryanothercab: @@ -2082,7 +2082,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state if (!((cab->next = PFDI_ALLOC(CAB(hfdi), sizeof(fdi_decomp_state))))) return DECR_NOMEMORY; - + ZeroMemory(cab->next, sizeof(fdi_decomp_state)); /* copy pszCabPath to userpath */ @@ -2093,7 +2093,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state for (i = 0; i <= pathlen; i++) userpath[i] = pszCabPath[i]; } /* else we are in a weird place... let's leave it blank and see if the user fixes it */ - } + } /* initial fdintNEXT_CABINET notification */ ZeroMemory(&fdin, sizeof(FDINOTIFICATION)); @@ -2124,9 +2124,9 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state } if (filenamelen) for (i = 0; i < filenamelen; i++) fullpath[idx++] = cab->mii.nextname[i]; fullpath[idx] = '\0'; - + TRACE("full cab path/file name: %s\n", debugstr_a(fullpath)); - + /* try to get a handle to the cabfile */ cabhf = PFDI_OPEN(CAB(hfdi), fullpath, 32768, _S_IREAD | _S_IWRITE); if (cabhf == -1) { @@ -2135,14 +2135,14 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state if (((*pfnfdin)(fdintNEXT_CABINET, &fdin))) return DECR_USERABORT; continue; } - + if (cabhf == 0) { ERR("PFDI_OPEN returned zero for %s.\n", fullpath); fdin.fdie = FDIERROR_CABINET_NOT_FOUND; if (((*pfnfdin)(fdintNEXT_CABINET, &fdin))) return DECR_USERABORT; continue; } - + /* check if it's really a cabfile. Note that this doesn't implement the bug */ if (!FDI_read_entries(CAB(hfdi), cabhf, &fdici, &(cab->next->mii))) { WARN("FDIIsCabinet failed.\n"); @@ -2159,11 +2159,11 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state if (((*pfnfdin)(fdintNEXT_CABINET, &fdin))) return DECR_USERABORT; continue; } - + break; } while (1); - + /* cabinet notification */ ZeroMemory(&fdin, sizeof(FDINOTIFICATION)); fdin.setID = fdici.setID; @@ -2172,9 +2172,9 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state fdin.psz1 = (cab->next->mii.nextname) ? cab->next->mii.nextname : &emptystring; fdin.psz2 = (cab->next->mii.nextinfo) ? cab->next->mii.nextinfo : &emptystring; fdin.psz3 = pszCabPath; - + if (((*pfnfdin)(fdintCABINET_INFO, &fdin))) return DECR_USERABORT; - + cab->next->setID = fdici.setID; cab->next->iCabinet = fdici.iCabinet; cab->next->hfdi = CAB(hfdi); @@ -2186,12 +2186,12 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state /* read folders */ for (i = 0; i < fdici.cFolders; i++) { - if (PFDI_READ(CAB(hfdi), cab->cabhf, buf2, cffold_SIZEOF) != cffold_SIZEOF) + if (PFDI_READ(CAB(hfdi), cab->cabhf, buf2, cffold_SIZEOF) != cffold_SIZEOF) return DECR_INPUT; if (cab->mii.folder_resv > 0) PFDI_SEEK(CAB(hfdi), cab->cabhf, cab->mii.folder_resv, SEEK_CUR); - + fol = (struct fdi_folder *) PFDI_ALLOC(CAB(hfdi), sizeof(struct fdi_folder)); if (!fol) { ERR("out of memory!\n"); @@ -2199,29 +2199,29 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state } ZeroMemory(fol, sizeof(struct fdi_folder)); if (!(cab->firstfol)) cab->firstfol = fol; - + fol->offset = (cab_off_t) EndGetI32(buf2+cffold_DataOffset); fol->num_blocks = EndGetI16(buf2+cffold_NumBlocks); fol->comp_type = EndGetI16(buf2+cffold_CompType); - + if (linkfol) - linkfol->next = fol; + linkfol->next = fol; linkfol = fol; } - + /* read files */ for (i = 0; i < fdici.cFiles; i++) { if (PFDI_READ(CAB(hfdi), cab->cabhf, buf2, cffile_SIZEOF) != cffile_SIZEOF) return DECR_INPUT; - + file = (struct fdi_file *) PFDI_ALLOC(CAB(hfdi), sizeof(struct fdi_file)); if (!file) { - ERR("out of memory!\n"); + ERR("out of memory!\n"); return DECR_NOMEMORY; } ZeroMemory(file, sizeof(struct fdi_file)); if (!(cab->firstfile)) cab->firstfile = file; - + file->length = EndGetI32(buf2+cffile_UncompressedSize); file->offset = EndGetI32(buf2+cffile_FolderOffset); file->index = EndGetI16(buf2+cffile_FolderIndex); @@ -2229,15 +2229,15 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state file->date = EndGetI16(buf2+cffile_Date); file->attribs = EndGetI16(buf2+cffile_Attribs); file->filename = FDI_read_string(CAB(hfdi), cab->cabhf, fdici.cbCabinet); - + if (!file->filename) return DECR_INPUT; - + if (linkfile) linkfile->next = file; linkfile = file; } - - } else + + } else cab = cab->next; /* advance to the next cabinet */ /* iterate files -- if we encounter the continued file, process it -- @@ -2265,7 +2265,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state CAB(outlen) = outlen; CAB(outpos) = CAB(outbuf); } - + CAB(decomp_cab) = cab; return DECR_OK; } @@ -2334,14 +2334,14 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state * is the pv element, which contains the arbitrary value which was passed to * FDICopy in the pvUser argument (psz1 is also used each time, but its meaning * is highly dependent on fdint). - * + * * If you encounter unknown notifications, you should return zero if you want * decompression to continue (or -1 to abort). All strings used in the * callbacks are regular C-style strings. Detailed descriptions of each * notification type follow: * * fdintCABINET_INFO: - * + * * This is the first notification provided after calling FDICopy, and provides * the user with various information about the cabinet. Note that this is * called for each cabinet FDICopy opens, not just the first one. In the @@ -2411,11 +2411,11 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state * contain the following values: psz1 pointing to the name of the cabinet * which FDICopy is attempting to open, psz2 pointing to the name ("info") of * the next disk, psz3 pointing to the presumed file-location of the cabinet, - * and fdie containing either FDIERROR_NONE, or one of the following: + * and fdie containing either FDIERROR_NONE, or one of the following: * * FDIERROR_CABINET_NOT_FOUND, FDIERROR_NOT_A_CABINET, * FDIERROR_UNKNOWN_CABINET_VERSION, FDIERROR_CORRUPT_CABINET, - * FDIERROR_BAD_COMPR_TYPE, FDIERROR_RESERVE_MISMATCH, and + * FDIERROR_BAD_COMPR_TYPE, FDIERROR_RESERVE_MISMATCH, and * FDIERROR_WRONG_CABINET. * * The callee may choose to change the path where FDICopy will look for the @@ -2442,7 +2442,7 @@ BOOL __cdecl FDICopy( PFNFDINOTIFY pfnfdin, PFNFDIDECRYPT pfnfdid, void *pvUser) -{ +{ FDICABINETINFO fdici; FDINOTIFICATION fdin; int cabhf, filehf = 0, idx; @@ -2451,7 +2451,7 @@ BOOL __cdecl FDICopy( size_t pathlen, filenamelen; char emptystring = '\0'; cab_UBYTE buf[64]; - struct fdi_folder *fol = NULL, *linkfol = NULL; + struct fdi_folder *fol = NULL, *linkfol = NULL; struct fdi_file *file = NULL, *linkfile = NULL; fdi_decomp_state _decomp_state; fdi_decomp_state *decomp_state = &_decomp_state; @@ -2516,7 +2516,7 @@ BOOL __cdecl FDICopy( PFDI_CLOSE(hfdi, cabhf); return FALSE; } - + /* cabinet notification */ ZeroMemory(&fdin, sizeof(FDINOTIFICATION)); fdin.setID = fdici.setID; @@ -2566,7 +2566,7 @@ BOOL __cdecl FDICopy( fol->comp_type = EndGetI16(buf+cffold_CompType); if (linkfol) - linkfol->next = fol; + linkfol->next = fol; linkfol = fol; } @@ -2580,8 +2580,8 @@ BOOL __cdecl FDICopy( } file = (struct fdi_file *) PFDI_ALLOC(hfdi, sizeof(struct fdi_file)); - if (!file) { - ERR("out of memory!\n"); + if (!file) { + ERR("out of memory!\n"); PFDI_INT(hfdi)->perf->erfOper = FDIERROR_ALLOC_FAIL; PFDI_INT(hfdi)->perf->erfType = ERROR_NOT_ENOUGH_MEMORY; PFDI_INT(hfdi)->perf->fError = TRUE; @@ -2590,7 +2590,7 @@ BOOL __cdecl FDICopy( } ZeroMemory(file, sizeof(struct fdi_file)); if (!CAB(firstfile)) CAB(firstfile) = file; - + file->length = EndGetI32(buf+cffile_UncompressedSize); file->offset = EndGetI32(buf+cffile_FolderOffset); file->index = EndGetI16(buf+cffile_FolderIndex); @@ -2621,7 +2621,7 @@ BOOL __cdecl FDICopy( * If we kept a cache of certain file-pointer information, we could eliminate * that behavior... in fact I am not sure that the caching we already have * is not sufficient. - * + * * The current implementation seems to work fine in straightforward situations * where all the cabinet files needed for decryption are simultaneously * available. But presumably, the API is supposed to support cabinets which @@ -2894,7 +2894,7 @@ BOOL __cdecl FDICopy( if (prev_fds != &_decomp_state) PFDI_FREE(hfdi, prev_fds); } - + return TRUE; bail_and_fail: /* here we free ram before error returns */ @@ -2953,7 +2953,7 @@ BOOL __cdecl FDICopy( * * Frees a handle created by FDICreate. Do /not/ call this in the middle * of FDICopy. Only reason for failure would be an invalid handle. - * + * * PARAMS * hfdi [I] The HFDI to free * @@ -2979,16 +2979,16 @@ BOOL __cdecl FDIDestroy(HFDI hfdi) * * Removes all folders of a cabinet file after and including the * specified folder number. - * + * * PARAMS * hfdi [I] Handle to the FDI context. * pszCabinetName [I] Filename of the cabinet. * iFolderToDelete [I] Index of the first folder to delete. - * + * * RETURNS * Success: TRUE. * Failure: FALSE. - * + * * NOTES * The PFNWRITE function supplied to FDICreate must truncate the * file at the current position if the number of bytes to write is 0. diff --git a/reactos/dll/win32/cards/cards.c b/reactos/dll/win32/cards/cards.c index 023a039dc3e..eed5ce0d673 100644 --- a/reactos/dll/win32/cards/cards.c +++ b/reactos/dll/win32/cards/cards.c @@ -39,7 +39,7 @@ BOOL WINAPI WEP(DWORD Unknown) * Initialize card library and return cards width and height */ BOOL WINAPI cdtInit(INT *Width, INT *Height) -{ +{ DWORD dwIndex; /* Report card width and height to user */ diff --git a/reactos/dll/win32/cards/cards.rbuild b/reactos/dll/win32/cards/cards.rbuild index 64b0904fd71..1a7411a9c81 100644 --- a/reactos/dll/win32/cards/cards.rbuild +++ b/reactos/dll/win32/cards/cards.rbuild @@ -4,10 +4,10 @@ - + - + kernel32 gdi32 user32 diff --git a/reactos/dll/win32/comcat/information.c b/reactos/dll/win32/comcat/information.c index cd5a9ea9dd9..b3b19974194 100644 --- a/reactos/dll/win32/comcat/information.c +++ b/reactos/dll/win32/comcat/information.c @@ -163,11 +163,11 @@ static HRESULT WINAPI COMCAT_ICatInformation_EnumClassesOfCategories( TRACE("\n"); - if (cImplemented == (ULONG)-1) + if (cImplemented == (ULONG)-1) cImplemented = 0; - if (cRequired == (ULONG)-1) + if (cRequired == (ULONG)-1) cRequired = 0; - + if (iface == NULL || ppenumCLSID == NULL || (cImplemented && rgcatidImpl == NULL) || (cRequired && rgcatidReq == NULL)) return E_POINTER; diff --git a/reactos/dll/win32/comctl32/animate.c b/reactos/dll/win32/comctl32/animate.c index 5e3ffb1570c..9c4ee443b13 100644 --- a/reactos/dll/win32/comctl32/animate.c +++ b/reactos/dll/win32/comctl32/animate.c @@ -24,11 +24,11 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Mar. 15, 2005, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * * TODO: * - check for the 'rec ' list in some AVI files */ @@ -124,7 +124,7 @@ static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPCWSTR lpN mminfo.pchBuffer = (LPSTR)lpAvi; mminfo.cchBuffer = SizeofResource(hInst, hrsrc); infoPtr->hMMio = mmioOpenW(NULL, &mminfo, MMIO_READ); - if (!infoPtr->hMMio) + if (!infoPtr->hMMio) { FreeResource(infoPtr->hRes); return FALSE; @@ -270,7 +270,7 @@ static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC) nWidth = infoPtr->outbih->biWidth; nHeight = infoPtr->outbih->biHeight; - } + } else { pBitmapData = infoPtr->indata; @@ -435,14 +435,14 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR infoPtr->currFrame = infoPtr->nFromFrame; - if (infoPtr->dwStyle & ACS_TIMER) + if (infoPtr->dwStyle & ACS_TIMER) { TRACE("Using a timer\n"); /* create a timer to display AVI */ - infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1, + infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1, infoPtr->mah.dwMicroSecPerFrame / 1000, NULL); - } - else + } + else { if(infoPtr->dwStyle & ACS_TRANSPARENT) infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify, @@ -602,7 +602,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) /* FIXME: should handle the 'rec ' LIST when present */ infoPtr->lpIndex = Alloc(infoPtr->mah.dwTotalFrames * sizeof(DWORD)); - if (!infoPtr->lpIndex) + if (!infoPtr->lpIndex) return FALSE; numFrame = insize = 0; @@ -624,7 +624,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) } infoPtr->indata = Alloc(infoPtr->ash.dwSuggestedBufferSize); - if (!infoPtr->indata) + if (!infoPtr->indata) return FALSE; return TRUE; @@ -659,14 +659,14 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) return FALSE; if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, - (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK) + (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK) { WARN("Can't get output BIH\n"); return FALSE; } infoPtr->outdata = Alloc(infoPtr->outbih->biSizeImage); - if (!infoPtr->outdata) + if (!infoPtr->outdata) return FALSE; if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN, @@ -683,7 +683,7 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps { ANIMATE_Free(infoPtr); - if (!lpszName) + if (!lpszName) { TRACE("Closing avi!\n"); /* installer of thebat! v1.62 requires FALSE here */ @@ -697,17 +697,17 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps if (HIWORD(lpszName)) { - if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) + if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) { TRACE("No AVI resource found!\n"); - if (!ANIMATE_LoadFileW(infoPtr, lpszName)) + if (!ANIMATE_LoadFileW(infoPtr, lpszName)) { WARN("No AVI file found!\n"); return FALSE; } } - } - else + } + else { if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) { @@ -716,14 +716,14 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps } } - if (!ANIMATE_GetAviInfo(infoPtr)) + if (!ANIMATE_GetAviInfo(infoPtr)) { WARN("Can't get AVI information\n"); ANIMATE_Free(infoPtr); return FALSE; } - if (!ANIMATE_GetAviCodec(infoPtr)) + if (!ANIMATE_GetAviCodec(infoPtr)) { WARN("Can't get AVI Codec\n"); ANIMATE_Free(infoPtr); @@ -734,7 +734,7 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, infoPtr->mah.dwWidth, infoPtr->mah.dwHeight, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); - if (infoPtr->dwStyle & ACS_AUTOPLAY) + if (infoPtr->dwStyle & ACS_AUTOPLAY) return ANIMATE_Play(infoPtr, -1, 0, infoPtr->mah.dwTotalFrames - 1); return TRUE; @@ -849,7 +849,7 @@ static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, co wStyleType, lpss->styleOld, lpss->styleNew); if (wStyleType != GWL_STYLE) return 0; - + infoPtr->dwStyle = lpss->styleNew; InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); @@ -939,7 +939,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP break; case WM_SIZE: - if (infoPtr->dwStyle & ACS_CENTER) + if (infoPtr->dwStyle & ACS_CENTER) InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return DefWindowProcW(hWnd, uMsg, wParam, lParam); diff --git a/reactos/dll/win32/comctl32/comboex.c b/reactos/dll/win32/comctl32/comboex.c index 8370f00db49..c0af691b138 100644 --- a/reactos/dll/win32/comctl32/comboex.c +++ b/reactos/dll/win32/comctl32/comboex.c @@ -20,14 +20,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * */ #include @@ -731,7 +731,7 @@ COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style) /* see if we need to change the word break proc on the edit */ if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC) - SetPathWordBreakProc(infoPtr->hwndEdit, + SetPathWordBreakProc(infoPtr->hwndEdit, (infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? TRUE : FALSE); /* test if the control's appearance has changed */ diff --git a/reactos/dll/win32/comctl32/comctl32undoc.c b/reactos/dll/win32/comctl32/comctl32undoc.c index 6f434a68e02..a1898fa37ec 100644 --- a/reactos/dll/win32/comctl32/comctl32undoc.c +++ b/reactos/dll/win32/comctl32/comctl32undoc.c @@ -159,7 +159,7 @@ DWORD WINAPI GetSize (LPVOID lpMem) * Items are re-ordered by changing the order of the values in the MRUList * value. When a new item is added, it becomes the new value of the oldest * identifier, and that identifier is moved to the front of the MRUList value. - * + * * Wine stores MRU-lists in the same registry format as Windows, so when * switching between the builtin and native comctl32.dll no problems or * incompatibilities should occur. diff --git a/reactos/dll/win32/comctl32/commctrl.c b/reactos/dll/win32/comctl32/commctrl.c index 5fe4835339f..30a051d4e32 100644 --- a/reactos/dll/win32/comctl32/commctrl.c +++ b/reactos/dll/win32/comctl32/commctrl.c @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTES - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 21, 2002, by Christian Neumair. * @@ -248,7 +248,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; case DLL_PROCESS_DETACH: - /* clean up subclassing */ + /* clean up subclassing */ THEMING_Uninitialize(); /* unregister all common control classes */ @@ -875,7 +875,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags, if (lpBitmap->biSize >= sizeof(BITMAPINFOHEADER) && lpBitmap->biClrUsed) nColorTableSize = lpBitmap->biClrUsed; - else if (lpBitmap->biBitCount <= 8) + else if (lpBitmap->biBitCount <= 8) nColorTableSize = (1 << lpBitmap->biBitCount); else nColorTableSize = 0; @@ -1090,7 +1090,7 @@ VOID WINAPI InitMUILanguage (LANGID uiLang) * * BUGS * If an application manually subclasses a window after subclassing it with - * this API and then with this API again, then none of the previous + * this API and then with this API again, then none of the previous * subclasses get called or the origional window procedure. */ @@ -1139,7 +1139,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass, proc = proc->next; } } - + proc = Alloc(sizeof(SUBCLASSPROCS)); if (!proc) { ERR ("Failed to allocate subclass entry in stack\n"); @@ -1151,7 +1151,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass, RemovePropW( hWnd, COMCTL32_wSubclass ); return FALSE; } - + proc->subproc = pfnSubclass; proc->ref = dwRef; proc->id = uIDSubclass; @@ -1238,15 +1238,15 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u while (proc) { if ((proc->id == uID) && (proc->subproc == pfnSubclass)) { - + if (!prevproc) stack->SubclassProcs = proc->next; else prevproc->next = proc->next; - + if (stack->stackpos == proc) stack->stackpos = stack->stackpos->next; - + Free (proc); ret = TRUE; break; @@ -1254,7 +1254,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u prevproc = proc; proc = proc->next; } - + if (!stack->SubclassProcs && !stack->running) { TRACE("Last Subclass removed, cleaning up\n"); /* clean up our heap and reset the origional window procedure */ @@ -1265,14 +1265,14 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u Free (stack); RemovePropW( hWnd, COMCTL32_wSubclass ); } - + return ret; } /*********************************************************************** * COMCTL32_SubclassProc (internal) * - * Window procedure for all subclassed windows. + * Window procedure for all subclassed windows. * Saves the current subclassing stack position to support nested messages */ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -1280,7 +1280,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA LPSUBCLASS_INFO stack; LPSUBCLASSPROCS proc; LRESULT ret; - + TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam); stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass); @@ -1288,7 +1288,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd); return 0; } - + /* Save our old stackpos to properly handle nested messages */ proc = stack->stackpos; stack->stackpos = stack->SubclassProcs; @@ -1296,7 +1296,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA ret = DefSubclassProc(hWnd, uMsg, wParam, lParam); stack->running--; stack->stackpos = proc; - + if (!stack->SubclassProcs && !stack->running) { TRACE("Last Subclass removed, cleaning up\n"); /* clean up our heap and reset the origional window procedure */ @@ -1330,7 +1330,7 @@ LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar { LPSUBCLASS_INFO stack; LRESULT ret; - + TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam); /* retrieve our little stack from the Properties */ @@ -1349,7 +1349,7 @@ LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar ret = CallWindowProcA (stack->origproc, hWnd, uMsg, wParam, lParam); } else { const SUBCLASSPROCS *proc = stack->stackpos; - stack->stackpos = stack->stackpos->next; + stack->stackpos = stack->stackpos->next; /* call the Subclass procedure from the stack */ ret = proc->subproc (hWnd, uMsg, wParam, lParam, proc->id, proc->ref); @@ -1461,8 +1461,8 @@ void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark HPEN hPen = CreatePen(PS_SOLID, 1, clrInsertMark); HPEN hOldPen; static const DWORD adwPolyPoints[] = {4,4,4}; - LONG lCentre = (bHorizontal ? - lpRect->top + (lpRect->bottom - lpRect->top)/2 : + LONG lCentre = (bHorizontal ? + lpRect->top + (lpRect->bottom - lpRect->top)/2 : lpRect->left + (lpRect->right - lpRect->left)/2); LONG l1 = (bHorizontal ? lpRect->left : lpRect->top); LONG l2 = (bHorizontal ? lpRect->right : lpRect->bottom); @@ -1546,7 +1546,7 @@ void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight SelectObject(hdcOld, hOldDCBitmap); DeleteDC(hdcOld); - DeleteObject(*pBitmap); + DeleteObject(*pBitmap); *pBitmap = hNewBitmap; return; } diff --git a/reactos/dll/win32/comctl32/datetime.c b/reactos/dll/win32/comctl32/datetime.c index 40c2ca50450..8a1543804af 100644 --- a/reactos/dll/win32/comctl32/datetime.c +++ b/reactos/dll/win32/comctl32/datetime.c @@ -20,14 +20,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 20, 2004, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * * TODO: * -- DTS_APPCANPARSE * -- DTS_SHORTDATECENTURYFORMAT @@ -395,7 +395,7 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int wsprintfW (result, fmt__2dW, date.wMonth); break; case THREECHARMONTH: - GetLocaleInfoW(GetSystemDefaultLCID(), LOCALE_SMONTHNAME1+date.wMonth -1, + GetLocaleInfoW(GetSystemDefaultLCID(), LOCALE_SMONTHNAME1+date.wMonth -1, buffer, sizeof(buffer)/sizeof(buffer[0])); wsprintfW (result, fmt__3sW, buffer); break; @@ -440,7 +440,7 @@ static const int DayOfWeekTable[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; static int DATETIME_CalculateDayOfWeek(DWORD day, DWORD month, DWORD year) { year-=(month < 3); - + return((year + year/4 - year/100 + year/400 + DayOfWeekTable[month-1] + day ) % 7); } @@ -611,7 +611,7 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO *fieldWidthPtr = size.cx; } -static void +static void DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) { int i,prevright; @@ -720,7 +720,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y) /* recalculate the position of the monthcal popup */ if(infoPtr->dwStyle & DTS_RIGHTALIGN) - infoPtr->monthcal_pos.x = infoPtr->calbutton.left - + infoPtr->monthcal_pos.x = infoPtr->calbutton.left - (rcMonthCal.right - rcMonthCal.left); else /* FIXME: this should be after the area reserved for the checkbox */ @@ -736,7 +736,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y) ShowWindow(infoPtr->hMonthCal, SW_HIDE); } else { const SYSTEMTIME *lprgSysTimeArray = &infoPtr->date; - TRACE("update calendar %04d/%02d/%02d\n", + TRACE("update calendar %04d/%02d/%02d\n", lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay); SendMessageW(infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date)); ShowWindow(infoPtr->hMonthCal, SW_SHOW); @@ -790,9 +790,9 @@ DATETIME_Button_Command (DATETIME_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } return 0; } - - - + + + static LRESULT DATETIME_Command (DATETIME_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { @@ -855,7 +855,7 @@ DATETIME_Notify (DATETIME_INFO *infoPtr, int idCtrl, LPNMHDR lpnmh) ShowWindow(infoPtr->hMonthCal, SW_HIDE); infoPtr->dateValid = TRUE; SendMessageW (infoPtr->hMonthCal, MCM_GETCURSEL, 0, (LPARAM)&infoPtr->date); - TRACE("got from calendar %04d/%02d/%02d day of week %d\n", + TRACE("got from calendar %04d/%02d/%02d day of week %d\n", infoPtr->date.wYear, infoPtr->date.wMonth, infoPtr->date.wDay, infoPtr->date.wDayOfWeek); SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); @@ -959,7 +959,7 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags) break; } } - + switch (vkCode) { case VK_ADD: case VK_UP: @@ -1115,7 +1115,7 @@ DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height) TRACE("Height=%d, Width=%d\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right); infoPtr->rcDraw = infoPtr->rcClient; - + if (infoPtr->dwStyle & DTS_UPDOWN) { SetWindowPos(infoPtr->hUpdown, NULL, infoPtr->rcClient.right-14, 0, @@ -1144,7 +1144,7 @@ DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height) } -static LRESULT +static LRESULT DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss) { static const WCHAR buttonW[] = { 'b', 'u', 't', 't', 'o', 'n', 0 }; @@ -1153,12 +1153,12 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU wStyleType, lpss->styleOld, lpss->styleNew); if (wStyleType != GWL_STYLE) return 0; - + infoPtr->dwStyle = lpss->styleNew; if ( !(lpss->styleOld & DTS_SHOWNONE) && (lpss->styleNew & DTS_SHOWNONE) ) { infoPtr->hwndCheckbut = CreateWindowExW (0, buttonW, 0, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, - 2, 2, 13, 13, infoPtr->hwndSelf, 0, + 2, 2, 13, 13, infoPtr->hwndSelf, 0, (HINSTANCE)GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_HINSTANCE), 0); SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0); } @@ -1167,7 +1167,7 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU infoPtr->hwndCheckbut = 0; } if ( !(lpss->styleOld & DTS_UPDOWN) && (lpss->styleNew & DTS_UPDOWN) ) { - infoPtr->hUpdown = CreateUpDownControl (WS_CHILD | WS_BORDER | WS_VISIBLE, 120, 1, 20, 20, + infoPtr->hUpdown = CreateUpDownControl (WS_CHILD | WS_BORDER | WS_VISIBLE, 120, 1, 20, 20, infoPtr->hwndSelf, 1, 0, 0, UD_MAXVAL, UD_MINVAL, 0); } if ( (lpss->styleOld & DTS_UPDOWN) && !(lpss->styleNew & DTS_UPDOWN) ) { @@ -1212,7 +1212,7 @@ DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs) DATETIME_SetFormatW (infoPtr, 0); /* create the monthcal control */ - infoPtr->hMonthCal = CreateWindowExW (0, SysMonthCal32W, 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS, + infoPtr->hMonthCal = CreateWindowExW (0, SysMonthCal32W, 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS, 0, 0, 0, 0, infoPtr->hwndSelf, 0, 0, 0); /* initialize info structure */ @@ -1234,7 +1234,7 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr) DestroyWindow(infoPtr->hwndCheckbut); if (infoPtr->hUpdown) DestroyWindow(infoPtr->hUpdown); - if (infoPtr->hMonthCal) + if (infoPtr->hMonthCal) DestroyWindow(infoPtr->hMonthCal); SetWindowLongPtrW( infoPtr->hwndSelf, 0, 0 ); /* clear infoPtr */ Free (infoPtr); diff --git a/reactos/dll/win32/comctl32/dpa.c b/reactos/dll/win32/comctl32/dpa.c index 4df556eaf26..cc3b854945e 100644 --- a/reactos/dll/win32/comctl32/dpa.c +++ b/reactos/dll/win32/comctl32/dpa.c @@ -22,11 +22,11 @@ * NOTES * These functions were involuntarily documented by Microsoft in 2002 as * the outcome of an anti-trust suit brought by various U.S. governments. - * As a result the specifications on MSDN are inaccurate, incomplete + * As a result the specifications on MSDN are inaccurate, incomplete * and misleading. A much more complete (unofficial) documentation is * available at: * - * http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32 + * http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32 */ #define COBJMACROS @@ -83,7 +83,7 @@ typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM); * * RETURNS * Success: TRUE - * Failure: FALSE + * Failure: FALSE * * NOTES * No more information available yet! @@ -181,7 +181,7 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc, * * RETURNS * Success: TRUE - * Failure: FALSE + * Failure: FALSE * * NOTES * No more information available yet! @@ -212,7 +212,7 @@ HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc, * * RETURNS * Success: TRUE - * Failure: FALSE + * Failure: FALSE * * NOTES * No more information available yet! @@ -545,11 +545,11 @@ INT WINAPI DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p) /* create empty spot at the end */ if (!DPA_SetPtr(hdpa, hdpa->nItemCount, 0)) return -1; - + if (i != hdpa->nItemCount - 1) - memmove (hdpa->ptrs + i + 1, hdpa->ptrs + i, + memmove (hdpa->ptrs + i + 1, hdpa->ptrs + i, (hdpa->nItemCount - i - 1) * sizeof(LPVOID)); - + hdpa->ptrs[i] = p; return i; } @@ -590,7 +590,7 @@ BOOL WINAPI DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p) lpTemp = HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, hdpa->ptrs, nSize); else lpTemp = HeapAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY, nSize); - + if (!lpTemp) return FALSE; diff --git a/reactos/dll/win32/comctl32/draglist.c b/reactos/dll/win32/comctl32/draglist.c index 9ecade558c1..aff09f3484a 100644 --- a/reactos/dll/win32/comctl32/draglist.c +++ b/reactos/dll/win32/comctl32/draglist.c @@ -22,11 +22,11 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Mar. 10, 2004, by Robert Shearman. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features or bugs please note them below. - * + * */ #include diff --git a/reactos/dll/win32/comctl32/dsa.c b/reactos/dll/win32/comctl32/dsa.c index 5edb4fc084e..7c0ea20062e 100644 --- a/reactos/dll/win32/comctl32/dsa.c +++ b/reactos/dll/win32/comctl32/dsa.c @@ -22,11 +22,11 @@ * NOTES * These functions were involuntarily documented by Microsoft in 2002 as * the outcome of an anti-trust suit brought by various U.S. governments. - * As a result the specifications on MSDN are inaccurate, incomplete + * As a result the specifications on MSDN are inaccurate, incomplete * and misleading. A much more complete (unofficial) documentation is * available at: * - * http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32 + * http://members.ozemail.com.au/~geoffch/samples/win32/shell/comctl32 */ #include @@ -90,7 +90,7 @@ HDSA WINAPI DSA_Create (INT nSize, INT nGrow) /************************************************************************** * DSA_Destroy [COMCTL32.321] - * + * * Destroys a dynamic storage array * * PARAMS diff --git a/reactos/dll/win32/comctl32/header.c b/reactos/dll/win32/comctl32/header.c index 64403fc4f80..3a30612a8c1 100644 --- a/reactos/dll/win32/comctl32/header.c +++ b/reactos/dll/win32/comctl32/header.c @@ -117,7 +117,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI { if (mask & HDI_UNSUPPORTED_FIELDS) FIXME("unsupported header fields %x\n", (mask & HDI_UNSUPPORTED_FIELDS)); - + if (mask & HDI_BITMAP) lpItem->hbm = phdi->hbm; @@ -130,7 +130,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI if (mask & HDI_WIDTH) lpItem->cxy = phdi->cxy; - if (mask & HDI_IMAGE) + if (mask & HDI_IMAGE) { lpItem->iImage = phdi->iImage; if (phdi->iImage == I_IMAGECALLBACK) @@ -157,7 +157,7 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDI { lpItem->pszText = NULL; lpItem->callbackMask |= HDI_TEXT; - } + } } } @@ -263,7 +263,7 @@ static void HEADER_GetHotDividerRect(HWND hwnd, const HEADER_INFO *infoPtr, RECT if (infoPtr->uNumItem > 0) { HEADER_ITEM *lpItem; - + if (iDivider < infoPtr->uNumItem) { lpItem = &infoPtr->items[iDivider]; @@ -335,7 +335,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags } else { HBRUSH hbr; - + if (GetWindowLongW (hwnd, GWL_STYLE) & HDS_BUTTONS) { if (phdi->bDown) { DrawEdge (hdc, &r, BDR_RAISEDOUTER, @@ -413,7 +413,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags } if (bw || iw) - cw += *w; + cw += *w; /* align cx using the unclipped cw */ if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_LEFT) @@ -422,17 +422,17 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags cx = r.left + rw / 2 - cw / 2; else /* HDF_RIGHT */ cx = r.right - cw; - + /* clip cx & cw */ if (cx < r.left) cx = r.left; if (cx + cw > r.right) cw = r.right - cx; - + tx = cx + infoPtr->iMargin; /* since cw might have changed we have to recalculate tw */ tw = cw - infoPtr->iMargin * 2; - + if (iw || bw) { tw -= *w; if (phdi->fmt & HDF_BITMAP_ON_RIGHT) { @@ -460,17 +460,17 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags HDC hClipDC = GetDC(hwnd); HRGN hClipRgn = CreateRectRgn(r.left, r.top, r.right, r.bottom); SelectClipRgn(hClipDC, hClipRgn); - + if (bw) { HDC hdcBitmap = CreateCompatibleDC (hClipDC); SelectObject (hdcBitmap, phdi->hbm); - BitBlt (hClipDC, bx, r.top + ((INT)rh - bmp.bmHeight) / 2, + BitBlt (hClipDC, bx, r.top + ((INT)rh - bmp.bmHeight) / 2, bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY); DeleteDC (hdcBitmap); } if (iw) { - ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC, + ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC, ix, r.top + ((INT)rh - infoPtr->himl->cy) / 2, infoPtr->himl->cx, infoPtr->himl->cy, CLR_DEFAULT, CLR_DEFAULT, 0); } @@ -478,7 +478,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack, LRESULT lCDFlags DeleteObject(hClipRgn); ReleaseDC(hwnd, hClipDC); } - + if (((phdi->fmt & HDF_STRING) || (!(phdi->fmt & (HDF_OWNERDRAW|HDF_STRING|HDF_BITMAP| HDF_BITMAP_ON_RIGHT|HDF_IMAGE)))) /* no explicit format specified? */ @@ -503,7 +503,7 @@ HEADER_DrawHotDivider(HWND hwnd, HDC hdc) HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HBRUSH brush; RECT r; - + HEADER_GetHotDividerRect(hwnd, infoPtr, &r); brush = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT)); FillRect(hdc, &r, brush); @@ -528,7 +528,7 @@ HEADER_Refresh (HWND hwnd, HDC hdc) /* get rect for the bar, adjusted for the border */ GetClientRect (hwnd, &rect); lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hdc, &rect); - + if (infoPtr->bDragging) ImageList_DragShowNolock(FALSE); @@ -562,14 +562,14 @@ HEADER_Refresh (HWND hwnd, HDC hdc) DrawEdge (hdc, &rcRest, EDGE_ETCHED, BF_BOTTOM|BF_MIDDLE); } } - + if (infoPtr->iHotDivider != -1) HEADER_DrawHotDivider(hwnd, hdc); if (infoPtr->bDragging) ImageList_DragShowNolock(TRUE); SelectObject (hdc, hOldFont); - + if (lCDFlags & CDRF_NOTIFYPOSTPAINT) HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hdc, &rect); } @@ -737,7 +737,7 @@ HEADER_DrawTrackLine (HWND hwnd, HDC hdc, INT x) * [I] fSourceUnicode : is src a HDITEMW or HDITEMA * [O] ppvScratch : a pointer to a scratch buffer that needs to be freed after * the HDITEM is no longer in use or NULL if none was needed - * + * * NOTE: We depend on HDITEMA and HDITEMW having the same structure */ static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest, @@ -745,7 +745,7 @@ static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest { *ppvScratch = NULL; *dest = *src; - + if (src->mask & HDI_TEXT && src->pszText != LPSTR_TEXTCALLBACKW) /* covers TEXTCALLBACKA as well */ { if (fSourceUnicode && infoPtr->nNotifyFormat != NFR_UNICODE) @@ -754,7 +754,7 @@ static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest Str_SetPtrWtoA((LPSTR *)&dest->pszText, src->pszText); *ppvScratch = dest->pszText; } - + if (!fSourceUnicode && infoPtr->nNotifyFormat == NFR_UNICODE) { dest->pszText = NULL; @@ -812,7 +812,7 @@ HEADER_SendNotifyWithHDItemT(HWND hwnd, UINT code, INT iItem, HDITEMW *lpItem) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); NMHEADERW nmhdr; - + if (infoPtr->nNotifyFormat != NFR_UNICODE) code = HEADER_NotifyCodeWtoA(code); nmhdr.iItem = iItem; @@ -856,9 +856,9 @@ HEADER_SendNotifyWithIntFieldT(HWND hwnd, UINT code, INT iItem, INT mask, INT iV /** * Prepare callback items - * depends on NMHDDISPINFOW having same structure as NMHDDISPINFOA + * depends on NMHDDISPINFOW having same structure as NMHDDISPINFOA * (so we handle the two cases only doing a specific cast for pszText). - * Checks if any of the required field are callback. If there are sends a + * Checks if any of the required field are callback. If there are sends a * NMHDISPINFO notify to retrieve these items. The items are stored in the * HEADER_ITEM pszText and iImage fields. They should be freed with * HEADER_FreeCallbackItems. @@ -886,7 +886,7 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask) Free(lpItem->pszText); lpItem->pszText = NULL; } - + memset(&dispInfo, 0, sizeof(NMHDDISPINFOW)); dispInfo.hdr.hwndFrom = hwnd; dispInfo.hdr.idFrom = GetWindowLongPtrW (hwnd, GWLP_ID); @@ -907,17 +907,17 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask) dispInfo.iItem = iItem; dispInfo.mask = mask; dispInfo.lParam = lpItem->lParam; - + TRACE("Sending HDN_GETDISPINFO%c\n", infoPtr->nNotifyFormat == NFR_UNICODE?'W':'A'); - SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, - (WPARAM) dispInfo.hdr.idFrom, + SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, + (WPARAM) dispInfo.hdr.idFrom, (LPARAM) &dispInfo); - TRACE("SendMessage returns(mask:0x%x,str:%s,lParam:%p)\n", + TRACE("SendMessage returns(mask:0x%x,str:%s,lParam:%p)\n", dispInfo.mask, (infoPtr->nNotifyFormat == NFR_UNICODE ? debugstr_w(dispInfo.pszText) : (LPSTR) dispInfo.pszText), (void*) dispInfo.lParam); - + if (mask & HDI_IMAGE) lpItem->iImage = dispInfo.iImage; if (mask & HDI_TEXT) @@ -936,13 +936,13 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask) Free(pvBuffer); } } - - if (dispInfo.mask & HDI_DI_SETITEM) + + if (dispInfo.mask & HDI_DI_SETITEM) { /* make the items permanent */ lpItem->callbackMask &= ~dispInfo.mask; } - + return TRUE; } @@ -980,7 +980,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam) HDC hDeviceDC; int height, width; HFONT hFont; - + if (wParam < 0 || wParam >= infoPtr->uNumItem) return FALSE; @@ -990,7 +990,7 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam) lpItem = &infoPtr->items[wParam]; width = lpItem->rect.right - lpItem->rect.left; height = lpItem->rect.bottom - lpItem->rect.top; - + hDeviceDC = GetDC(NULL); hMemoryDC = CreateCompatibleDC(hDeviceDC); hMemory = CreateCompatibleBitmap(hDeviceDC, width, height); @@ -1005,13 +1005,13 @@ HEADER_CreateDragImage (HWND hwnd, WPARAM wParam) HEADER_DrawItem(hwnd, hMemoryDC, wParam, FALSE, lCDFlags); if (lCDFlags & CDRF_NOTIFYPOSTPAINT) HEADER_SendCtrlCustomDraw(hwnd, CDDS_POSTPAINT, hMemoryDC, &rc); - + hMemory = SelectObject(hMemoryDC, hOldBitmap); DeleteDC(hMemoryDC); - + if (hMemory == NULL) /* if anything failed */ return FALSE; - + himl = ImageList_Create(width, height, ILC_COLORDDB, 1, 1); ImageList_Add(himl, hMemory, NULL); DeleteObject(hMemory); @@ -1024,7 +1024,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd); INT iDivider; RECT r; - + if (wParam) { POINT pt; @@ -1032,7 +1032,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam) pt.x = (INT)(SHORT)LOWORD(lParam); pt.y = 0; HEADER_InternalHitTest (hwnd, &pt, &flags, &iDivider); - + if (flags & HHT_TOLEFT) iDivider = 0; else if (flags & HHT_NOWHERE || flags & HHT_TORIGHT) @@ -1046,7 +1046,7 @@ HEADER_SetHotDivider(HWND hwnd, WPARAM wParam, LPARAM lParam) } else iDivider = (INT)lParam; - + /* Note; wParam==FALSE, lParam==-1 is valid and is used to clear the hot divider */ if (iDivider<-1 || iDivider>(int)infoPtr->uNumItem) return iDivider; @@ -1094,7 +1094,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam) (infoPtr->uNumItem - iOrder) * sizeof(INT)); infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem); infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem); - + /* Correct the orders */ for (i = 0; i < infoPtr->uNumItem; i++) { @@ -1146,7 +1146,7 @@ HEADER_GetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode) TRACE("mask %x contains unknown fields. Using only comctl32 4.0 fields\n", mask); mask &= HDI_COMCTL32_4_0_FIELDS; } - + lpItem = &infoPtr->items[nItem]; HEADER_PrepareCallbackItems(hwnd, nItem, mask); @@ -1162,7 +1162,7 @@ HEADER_GetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode) if (mask & HDI_LPARAM) phdi->lParam = lpItem->lParam; - if (mask & HDI_IMAGE) + if (mask & HDI_IMAGE) phdi->iImage = lpItem->iImage; if (mask & HDI_ORDER) @@ -1288,7 +1288,7 @@ HEADER_InsertItemT (HWND hwnd, INT nItem, const HDITEMW *phdi, BOOL bUnicode) infoPtr->uNumItem++; infoPtr->items = ReAlloc(infoPtr->items, sizeof(HEADER_ITEM) * infoPtr->uNumItem); infoPtr->order = ReAlloc(infoPtr->order, sizeof(INT) * infoPtr->uNumItem); - + /* make space for the new item */ memmove(&infoPtr->items[nItem + 1], &infoPtr->items[nItem], (infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM)); @@ -1381,7 +1381,7 @@ static LRESULT HEADER_GetBitmapMargin(HWND hwnd) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr(hwnd); - + return infoPtr->iMargin; } @@ -1639,11 +1639,11 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) { HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem]; INT iNewOrder; - + ImageList_DragShowNolock(FALSE); ImageList_EndDrag(); lpItem->bDown=FALSE; - + if (infoPtr->iHotDivider == -1) iNewOrder = -1; else if (infoPtr->iHotDivider == infoPtr->uNumItem) @@ -1664,7 +1664,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) } else InvalidateRect(hwnd, &infoPtr->items[infoPtr->iMoveItem].rect, FALSE); - + HEADER_SetHotDivider(hwnd, FALSE, -1); } else if (!(dwStyle&HDS_DRAGDROP) || !HEADER_IsDragDistance(infoPtr, &pt)) @@ -1694,7 +1694,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack); ReleaseDC (hwnd, hdc); } - + if (!HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, iNewWidth)) { infoPtr->items[infoPtr->iMoveItem].cxy = iNewWidth; @@ -1796,7 +1796,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) } } } - + if (infoPtr->bDragging) { POINT drag; @@ -1806,7 +1806,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) ImageList_DragMove(drag.x, drag.y); HEADER_SetHotDivider(hwnd, TRUE, lParam); } - + if (infoPtr->bPressed && !infoPtr->bDragging) { BOOL oldState = infoPtr->items[infoPtr->iMoveItem].bDown; if ((nItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER)) @@ -1830,18 +1830,18 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) INT nOldWidth = lpItem->rect.right - lpItem->rect.left; RECT rcClient; RECT rcScroll; - + if (nWidth < 0) nWidth = 0; infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; HEADER_SetItemBounds(hwnd); - + GetClientRect(hwnd, &rcClient); rcScroll = rcClient; rcScroll.left = lpItem->rect.left + nOldWidth; ScrollWindowEx(hwnd, nWidth - nOldWidth, 0, &rcScroll, &rcClient, NULL, NULL, 0); InvalidateRect(hwnd, &lpItem->rect, FALSE); UpdateWindow(hwnd); - + HEADER_SendNotifyWithIntFieldT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, nWidth); } } diff --git a/reactos/dll/win32/comctl32/hotkey.c b/reactos/dll/win32/comctl32/hotkey.c index 8a56fd38993..46d1ba45b62 100644 --- a/reactos/dll/win32/comctl32/hotkey.c +++ b/reactos/dll/win32/comctl32/hotkey.c @@ -21,7 +21,7 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 21, 2004, by Robert Shearman. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features or bugs please note them below. @@ -74,15 +74,15 @@ HOTKEY_IsCombInv(const HOTKEY_INFO *infoPtr) return TRUE; if((infoPtr->InvComb & HKCOMB_A) && IsOnlySet(HOTKEYF_ALT)) return TRUE; - if((infoPtr->InvComb & HKCOMB_SC) && + if((infoPtr->InvComb & HKCOMB_SC) && IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL)) return TRUE; if((infoPtr->InvComb & HKCOMB_SA) && IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_ALT)) return TRUE; - if((infoPtr->InvComb & HKCOMB_CA) && + if((infoPtr->InvComb & HKCOMB_CA) && IsOnlySet(HOTKEYF_CONTROL | HOTKEYF_ALT)) return TRUE; - if((infoPtr->InvComb & HKCOMB_SCA) && + if((infoPtr->InvComb & HKCOMB_SCA) && IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_CONTROL | HOTKEYF_ALT)) return TRUE; @@ -130,7 +130,7 @@ HOTKEY_DrawHotKey(HOTKEY_INFO *infoPtr, HDC hdc, LPCWSTR KeyName, WORD NameLen) } /* Draw the names of the keys in the control */ -static void +static void HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc) { WCHAR KeyName[64]; @@ -143,10 +143,10 @@ HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc) HOTKEY_DrawHotKey (infoPtr, hdc, infoPtr->strNone, 4); return; } - + if(infoPtr->HotKey) Modifier = HIBYTE(infoPtr->HotKey); - else if(HOTKEY_IsCombInv(infoPtr)) + else if(HOTKEY_IsCombInv(infoPtr)) Modifier = infoPtr->InvMod; else Modifier = infoPtr->CurrMod; @@ -199,7 +199,7 @@ HOTKEY_Paint(HOTKEY_INFO *infoPtr, HDC hdc) static LRESULT HOTKEY_GetHotKey(const HOTKEY_INFO *infoPtr) { - TRACE("(infoPtr=%p) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr, + TRACE("(infoPtr=%p) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr, HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey)); return (LRESULT)infoPtr->HotKey; } @@ -208,14 +208,14 @@ static void HOTKEY_SetHotKey(HOTKEY_INFO *infoPtr, WORD hotKey) { infoPtr->HotKey = hotKey; - infoPtr->ScanCode = + infoPtr->ScanCode = MAKELPARAM(0, MapVirtualKeyW(LOBYTE(infoPtr->HotKey), 0)); TRACE("(infoPtr=%p hotKey=%x) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr, hotKey, HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey)); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); } -static void +static void HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod) { infoPtr->InvComb = invComb; @@ -407,7 +407,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs) { HOTKEY_INFO *infoPtr; DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); - SetWindowLongW (hwnd, GWL_EXSTYLE, + SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle | WS_EX_CLIENTEDGE); /* allocate memory for info structure */ diff --git a/reactos/dll/win32/comctl32/imagelist.c b/reactos/dll/win32/comctl32/imagelist.c index ee1ef0e0fa5..622c925787e 100644 --- a/reactos/dll/win32/comctl32/imagelist.c +++ b/reactos/dll/win32/comctl32/imagelist.c @@ -910,7 +910,7 @@ ImageList_DragMove (INT x, INT y) BitBlt(hdcBg, 0, 0, InternalDrag.himl->cx, InternalDrag.himl->cy, hdcOffScreen, origNewX - origRegX, origNewY - origRegY, SRCCOPY); /* draw the image */ - ImageList_InternalDragDraw(hdcOffScreen, origNewX - origRegX, + ImageList_InternalDragDraw(hdcOffScreen, origNewX - origRegX, origNewY - origRegY); /* draw the update region to the screen */ BitBlt(hdcDrag, origRegX, origRegY, sizeRegX, sizeRegY, @@ -955,7 +955,7 @@ ImageList_DragShowNolock (BOOL bShow) if (!is_valid(InternalDrag.himl)) return FALSE; - + TRACE("bShow=0x%X!\n", bShow); /* DragImage is already visible/hidden */ @@ -1024,7 +1024,7 @@ ImageList_DragShowNolock (BOOL bShow) BOOL WINAPI ImageList_Draw (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, UINT fStyle) { - return ImageList_DrawEx (himl, i, hdc, x, y, 0, 0, + return ImageList_DrawEx (himl, i, hdc, x, y, 0, 0, CLR_DEFAULT, CLR_DEFAULT, fStyle); } @@ -1144,9 +1144,9 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp) if (!hImageListDC || !hImageDC || !hImageBmp || (bBlend && !hBlendMaskBmp) || (himl->hbmMask && !hMaskListDC)) goto cleanup; - + hOldImageBmp = SelectObject(hImageDC, hImageBmp); - + /* * To obtain a transparent look, background color should be set * to white and foreground color to black when blting the diff --git a/reactos/dll/win32/comctl32/ipaddress.c b/reactos/dll/win32/comctl32/ipaddress.c index 76e41019e01..186ed3de861 100644 --- a/reactos/dll/win32/comctl32/ipaddress.c +++ b/reactos/dll/win32/comctl32/ipaddress.c @@ -22,14 +22,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * */ #include @@ -66,7 +66,7 @@ typedef struct IPPART_INFO Part[4]; } IPADDRESS_INFO; -static const WCHAR IP_SUBCLASS_PROP[] = +static const WCHAR IP_SUBCLASS_PROP[] = { 'C', 'C', 'I', 'P', '3', '2', 'S', 'u', 'b', 'c', 'l', 'a', 's', 's', 'I', 'n', 'f', 'o', 0 }; #define POS_DEFAULT 0 @@ -142,10 +142,10 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) bgCol = COLOR_3DFACE; fgCol = COLOR_GRAYTEXT; } - + FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1)); DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); - + SetBkColor (hdc, GetSysColor(bgCol)); SetTextColor(hdc, GetSysColor(fgCol)); diff --git a/reactos/dll/win32/comctl32/listview.c b/reactos/dll/win32/comctl32/listview.c index 8e43751f395..80f5a8763f8 100644 --- a/reactos/dll/win32/comctl32/listview.c +++ b/reactos/dll/win32/comctl32/listview.c @@ -25,11 +25,11 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on May. 20, 2005, by James Hawkins. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * * TODO: * * Default Message Processing @@ -103,7 +103,7 @@ * -- LVS_EX_TWOCLICKACTIVATE * -- LVS_EX_UNDERLINECOLD * -- LVS_EX_UNDERLINEHOT - * + * * Notifications: * -- LVN_BEGINSCROLL, LVN_ENDSCROLL * -- LVN_GETINFOTIP @@ -258,7 +258,7 @@ typedef struct tagLISTVIEW_INFO HIMAGELIST himlState; BOOL bLButtonDown; BOOL bRButtonDown; - POINT ptClickPos; /* point where the user clicked */ + POINT ptClickPos; /* point where the user clicked */ BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */ INT nItemHeight; INT nItemWidth; @@ -268,8 +268,8 @@ typedef struct tagLISTVIEW_INFO SHORT notifyFormat; HWND hwndNotify; RECT rcList; /* This rectangle is really the window - * client rectangle possibly reduced by the - * horizontal scroll bar and/or header - see + * client rectangle possibly reduced by the + * horizontal scroll bar and/or header - see * LISTVIEW_UpdateSize. This rectangle offset * by the LISTVIEW_GetOrigin value is in * client coordinates */ @@ -502,7 +502,7 @@ static inline void textfreeT(LPWSTR wstr, BOOL isW) static BOOL textsetptrT(LPWSTR *dest, LPCWSTR src, BOOL isW) { BOOL bResult = TRUE; - + if (src == LPSTR_TEXTCALLBACKW) { if (is_textW(*dest)) Free(*dest); @@ -533,11 +533,11 @@ static inline int textcmpWT(LPCWSTR aw, LPCWSTR bt, BOOL isW) int r = bw ? lstrcmpW(aw, bw) : 1; textfreeT(bw, isW); return r; - } - + } + return 1; } - + static inline int lstrncmpiW(LPCWSTR s1, LPCWSTR s2, int n) { int res; @@ -605,7 +605,7 @@ end: undo: if (buf - text > 2) { buf[-2] = '}'; buf[-1] = 0; } return text; -} +} static const char* debugnmlistview(const NMLISTVIEW *plvnm) { @@ -620,7 +620,7 @@ static const char* debuglvitem_t(const LVITEMW *lpLVItem, BOOL isW) { char* buf = debug_getbuf(), *text = buf; int len, size = DEBUG_BUFFER_SIZE; - + if (lpLVItem == NULL) return "(null)"; len = snprintf(buf, size, "{iItem=%d, iSubItem=%d, ", lpLVItem->iItem, lpLVItem->iSubItem); if (len == -1) goto end; buf += len; size -= len; @@ -656,7 +656,7 @@ static const char* debuglvcolumn_t(const LVCOLUMNW *lpColumn, BOOL isW) { char* buf = debug_getbuf(), *text = buf; int len, size = DEBUG_BUFFER_SIZE; - + if (lpColumn == NULL) return "(null)"; len = snprintf(buf, size, "{"); if (len == -1) goto end; buf += len; size -= len; @@ -729,7 +729,7 @@ static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, const NMHEADE static LRESULT notify_hdr(const LISTVIEW_INFO *infoPtr, INT code, LPNMHDR pnmh) { LRESULT result; - + TRACE("(code=%d)\n", code); pnmh->hwndFrom = infoPtr->hwndSelf; @@ -761,7 +761,7 @@ static inline void notify_itemactivate(const LISTVIEW_INFO *infoPtr, const LVHIT nmia.uOldState = 0; nmia.uChanged = 0; nmia.uKeyFlags = 0; - + item.mask = LVIF_PARAM|LVIF_STATE; item.iItem = htInfo->iItem; item.iSubItem = 0; @@ -771,11 +771,11 @@ static inline void notify_itemactivate(const LISTVIEW_INFO *infoPtr, const LVHIT nmia.uNewState = item.state | LVIS_ACTIVATING; nmia.uChanged = LVIF_STATE; } - + nmia.iItem = htInfo->iItem; nmia.iSubItem = htInfo->iSubItem; - nmia.ptAction = htInfo->pt; - + nmia.ptAction = htInfo->pt; + if (GetKeyState(VK_SHIFT) & 0x8000) nmia.uKeyFlags |= LVKF_SHIFT; if (GetKeyState(VK_CONTROL) & 0x8000) nmia.uKeyFlags |= LVKF_CONTROL; if (GetKeyState(VK_MENU) & 0x8000) nmia.uKeyFlags |= LVKF_ALT; @@ -795,7 +795,7 @@ static BOOL notify_click(const LISTVIEW_INFO *infoPtr, INT code, const LVHITTEST LVITEMW item; HWND hwnd = infoPtr->hwndSelf; - TRACE("code=%d, lvht=%s\n", code, debuglvhittestinfo(lvht)); + TRACE("code=%d, lvht=%s\n", code, debuglvhittestinfo(lvht)); ZeroMemory(&nmlv, sizeof(nmlv)); nmlv.iItem = lvht->iItem; nmlv.iSubItem = lvht->iSubItem; @@ -936,7 +936,7 @@ static inline DWORD notify_customdraw (const LISTVIEW_INFO *infoPtr, DWORD dwDra DWORD result; lpnmlvcd->nmcd.dwDrawStage = dwDrawStage; - if (isForItem) lpnmlvcd->nmcd.dwDrawStage |= CDDS_ITEM; + if (isForItem) lpnmlvcd->nmcd.dwDrawStage |= CDDS_ITEM; if (lpnmlvcd->iSubItem) lpnmlvcd->nmcd.dwDrawStage |= CDDS_SUBITEM; if (isForItem) lpnmlvcd->nmcd.dwItemSpec--; result = notify_hdr(infoPtr, NM_CUSTOMDRAW, &lpnmlvcd->nmcd.hdr); @@ -1023,10 +1023,10 @@ static inline BOOL ranges_delitem(RANGES ranges, INT nItem) * Note that it is important that the code destroys the iterator * after it's done with it, as the creation of the iterator may * allocate memory, which thus needs to be freed. - * + * * You can iterate both forwards, and backwards through the list, * by using iterator_next or iterator_prev respectively. - * + * * Lower numbered items are draw on top of higher number items in * LVS_ICON, and LVS_SMALLICON (which are the only modes where * items may overlap). So, to test items, you should use @@ -1050,7 +1050,7 @@ static inline BOOL ranges_delitem(RANGES ranges, INT nItem) * which sits at the start of the list. This is used in * LVS_ICON, and LVS_SMALLICON mode to handle the focused item, * which needs to be first, as it may overlap other items. - * + * * The code is a bit messy because we have: * - a special item to deal with * - simple range, or composite range @@ -1205,7 +1205,7 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; RECT frame = *lprc, rcItem, rcTemp; POINT Origin; - + /* in case we fail, we want to return an empty iterator */ if (!iterator_empty(i)) return FALSE; @@ -1217,7 +1217,7 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons if (uView == LVS_ICON || uView == LVS_SMALLICON) { INT nItem; - + if (uView == LVS_ICON && infoPtr->nFocusedItem != -1) { LISTVIEW_GetItemBox(infoPtr, infoPtr->nFocusedItem, &rcItem); @@ -1241,10 +1241,10 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons else if (uView == LVS_REPORT) { RANGE range; - + if (frame.left >= infoPtr->nItemWidth) return TRUE; if (frame.top >= infoPtr->nItemHeight * infoPtr->nItemCount) return TRUE; - + range.lower = max(frame.top / infoPtr->nItemHeight, 0); range.upper = min((frame.bottom - 1) / infoPtr->nItemHeight, infoPtr->nItemCount - 1) + 1; if (range.upper <= range.lower) return TRUE; @@ -1264,7 +1264,7 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons TRACE("nPerCol=%d, nFirstRow=%d, nLastRow=%d, nFirstCol=%d, nLastCol=%d, lower=%d\n", nPerCol, nFirstRow, nLastRow, nFirstCol, nLastCol, lower); - + if (nLastCol < nFirstCol || nLastRow < nFirstRow) return TRUE; if (!(iterator_rangesitems(i, ranges_create(nLastCol - nFirstCol + 1)))) return FALSE; @@ -1290,7 +1290,7 @@ static BOOL iterator_visibleitems(ITERATOR *i, const LISTVIEW_INFO *infoPtr, HDC POINT Origin, Position; RECT rcItem, rcClip; INT rgntype; - + rgntype = GetClipBox(hdc, &rcClip); if (rgntype == NULLREGION) return iterator_empty(i); if (!iterator_frameditems(i, infoPtr, &rcClip)) return FALSE; @@ -1302,7 +1302,7 @@ static BOOL iterator_visibleitems(ITERATOR *i, const LISTVIEW_INFO *infoPtr, HDC LISTVIEW_GetItemBox(infoPtr, i->nSpecial, &rcItem); if (!RectVisible(hdc, &rcItem)) i->nSpecial = -1; } - + /* if we can't deal with the region, we'll just go with the simple range */ LISTVIEW_GetOrigin(infoPtr, &Origin); TRACE("building visible range:\n"); @@ -1330,7 +1330,7 @@ static BOOL iterator_visibleitems(ITERATOR *i, const LISTVIEW_INFO *infoPtr, HDC } /* the iterator should restart on the next iterator_next */ TRACE("done\n"); - + return TRUE; } @@ -1346,7 +1346,7 @@ static inline LRESULT CallWindowProcT(WNDPROC proc, HWND hwnd, UINT uMsg, static inline BOOL is_autoarrange(const LISTVIEW_INFO *infoPtr) { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; - + return ((infoPtr->dwStyle & LVS_AUTOARRANGE) || infoPtr->bAutoarrange) && (uView == LVS_ICON || uView == LVS_SMALLICON); } @@ -1361,12 +1361,12 @@ static inline COLUMN_INFO * LISTVIEW_GetColumnInfo(const LISTVIEW_INFO *infoPtr, assert (nSubItem >= 0 && nSubItem < DPA_GetPtrCount(infoPtr->hdpaColumns)); return (COLUMN_INFO *)DPA_GetPtr(infoPtr->hdpaColumns, nSubItem); } - + static inline void LISTVIEW_GetHeaderRect(const LISTVIEW_INFO *infoPtr, INT nSubItem, LPRECT lprc) { *lprc = LISTVIEW_GetColumnInfo(infoPtr, nSubItem)->rcHeader; } - + static inline BOOL LISTVIEW_GetItemW(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem) { return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE); @@ -1381,7 +1381,7 @@ static inline BOOL is_redrawing(const LISTVIEW_INFO *infoPtr) static inline void LISTVIEW_InvalidateRect(const LISTVIEW_INFO *infoPtr, const RECT* rect) { - if(!is_redrawing(infoPtr)) return; + if(!is_redrawing(infoPtr)) return; TRACE(" invalidating rect=%s\n", wine_dbgstr_rect(rect)); InvalidateRect(infoPtr->hwndSelf, rect, TRUE); } @@ -1390,7 +1390,7 @@ static inline void LISTVIEW_InvalidateItem(const LISTVIEW_INFO *infoPtr, INT nIt { RECT rcBox; - if(!is_redrawing(infoPtr)) return; + if(!is_redrawing(infoPtr)) return; LISTVIEW_GetItemBox(infoPtr, nItem, &rcBox); LISTVIEW_InvalidateRect(infoPtr, &rcBox); } @@ -1399,8 +1399,8 @@ static inline void LISTVIEW_InvalidateSubItem(const LISTVIEW_INFO *infoPtr, INT { POINT Origin, Position; RECT rcBox; - - if(!is_redrawing(infoPtr)) return; + + if(!is_redrawing(infoPtr)) return; assert ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT); LISTVIEW_GetOrigin(infoPtr, &Origin); LISTVIEW_GetItemOrigin(infoPtr, nItem, &Position); @@ -1419,8 +1419,8 @@ static inline void LISTVIEW_InvalidateList(const LISTVIEW_INFO *infoPtr) static inline void LISTVIEW_InvalidateColumn(const LISTVIEW_INFO *infoPtr, INT nColumn) { RECT rcCol; - - if(!is_redrawing(infoPtr)) return; + + if(!is_redrawing(infoPtr)) return; LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcCol); rcCol.top = infoPtr->rcList.top; rcCol.bottom = infoPtr->rcList.bottom; @@ -1672,7 +1672,7 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr) if (LISTVIEW_GetViewRect(infoPtr, &rcView)) horzInfo.nMax = rcView.right - rcView.left; } - + horzInfo.fMask = SIF_RANGE | SIF_PAGE; horzInfo.nMax = max(horzInfo.nMax - 1, 0); dx = GetScrollPos(infoPtr->hwndSelf, SB_HORZ); @@ -1691,7 +1691,7 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr) if (uView == LVS_REPORT) { vertInfo.nMax = infoPtr->nItemCount; - + /* scroll by at least one page */ if(vertInfo.nPage < infoPtr->nItemHeight) vertInfo.nPage = infoPtr->nItemHeight; @@ -1732,7 +1732,7 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr) /*** * DESCRIPTION: - * Shows/hides the focus rectangle. + * Shows/hides the focus rectangle. * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure @@ -1755,7 +1755,7 @@ static void LISTVIEW_ShowFocusRect(const LISTVIEW_INFO *infoPtr, BOOL fShow) { RECT rcBox; - LISTVIEW_GetItemBox(infoPtr, infoPtr->nFocusedItem, &rcBox); + LISTVIEW_GetItemBox(infoPtr, infoPtr->nFocusedItem, &rcBox); if ((rcBox.bottom - rcBox.top) > infoPtr->nItemHeight) { LISTVIEW_InvalidateRect(infoPtr, &rcBox); @@ -1778,8 +1778,8 @@ static void LISTVIEW_ShowFocusRect(const LISTVIEW_INFO *infoPtr, BOOL fShow) item.iSubItem = 0; item.mask = LVIF_PARAM; if (!LISTVIEW_GetItemW(infoPtr, &item)) goto done; - - ZeroMemory(&dis, sizeof(dis)); + + ZeroMemory(&dis, sizeof(dis)); dis.CtlType = ODT_LISTVIEW; dis.CtlID = (UINT)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); dis.itemID = item.iItem; @@ -1807,9 +1807,9 @@ done: */ static void LISTVIEW_InvalidateSelectedItems(const LISTVIEW_INFO *infoPtr) { - ITERATOR i; - - iterator_frameditems(&i, infoPtr, &infoPtr->rcList); + ITERATOR i; + + iterator_frameditems(&i, infoPtr, &infoPtr->rcList); while(iterator_next(&i)) { if (LISTVIEW_GetItemState(infoPtr, i.nItem, LVIS_SELECTED)) @@ -1818,7 +1818,7 @@ static void LISTVIEW_InvalidateSelectedItems(const LISTVIEW_INFO *infoPtr) iterator_destroy(&i); } - + /*** * DESCRIPTION: [INTERNAL] * Computes an item's (left,top) corner, relative to rcView. @@ -1827,7 +1827,7 @@ static void LISTVIEW_InvalidateSelectedItems(const LISTVIEW_INFO *infoPtr) * over again, when this function is call in a loop. Instead, * one ca factor the computation of the Origin before the loop, * and offset the value retured by this function, on every iteration. - * + * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure * [I] nItem : item number @@ -1859,7 +1859,7 @@ static void LISTVIEW_GetItemOrigin(const LISTVIEW_INFO *infoPtr, INT nItem, LPPO lpptPosition->y = nItem * infoPtr->nItemHeight; } } - + /*** * DESCRIPTION: [INTERNAL] * Compute the rectangles of an item. This is to localize all @@ -1936,7 +1936,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW if (lpLVItem->iSubItem || uView == LVS_REPORT) lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, lpLVItem->iSubItem); - if (lpLVItem->iSubItem) + if (lpLVItem->iSubItem) { Box = lpColumnInfo->rcHeader; } @@ -2020,7 +2020,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW labelSize.cy = infoPtr->nItemHeight; goto calc_label; } - + /* we need the text in non owner draw mode */ assert(lpLVItem->mask & LVIF_TEXT); if (is_textT(lpLVItem->pszText, TRUE)) @@ -2035,7 +2035,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW SetRectEmpty(&rcText); rcText.right = infoPtr->nItemWidth - TRAILING_LABEL_PADDING; rcText.bottom = infoPtr->nItemHeight; - if (uView == LVS_ICON) + if (uView == LVS_ICON) rcText.bottom -= ICON_TOP_PADDING + infoPtr->iconSize.cy + ICON_BOTTOM_PADDING; /* now figure out the flags */ @@ -2043,7 +2043,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW uFormat = oversizedBox ? LV_FL_DT_FLAGS : LV_ML_DT_FLAGS; else uFormat = LV_SL_DT_FLAGS; - + DrawTextW (hdc, lpLVItem->pszText, -1, &rcText, uFormat | DT_CALCRECT); labelSize.cx = min(rcText.right - rcText.left + TRAILING_LABEL_PADDING, infoPtr->nItemWidth); @@ -2084,7 +2084,7 @@ calc_label: Label.right = min(Label.left + labelSize.cx, Label.right); Label.bottom = Label.top + infoPtr->nItemHeight; } - + if (lprcLabel) *lprcLabel = Label; TRACE(" - label=%s\n", wine_dbgstr_rect(&Label)); } @@ -2181,9 +2181,9 @@ static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT static void LISTVIEW_NextIconPosTop(LISTVIEW_INFO *infoPtr, LPPOINT lpPos) { INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left; - + *lpPos = infoPtr->currIconPos; - + infoPtr->currIconPos.x += infoPtr->nItemWidth; if (infoPtr->currIconPos.x + infoPtr->nItemWidth <= nListWidth) return; @@ -2191,7 +2191,7 @@ static void LISTVIEW_NextIconPosTop(LISTVIEW_INFO *infoPtr, LPPOINT lpPos) infoPtr->currIconPos.y += infoPtr->nItemHeight; } - + /*** * DESCRIPTION: * Returns the current icon position, and advances it down the left edge. @@ -2207,9 +2207,9 @@ static void LISTVIEW_NextIconPosTop(LISTVIEW_INFO *infoPtr, LPPOINT lpPos) static void LISTVIEW_NextIconPosLeft(LISTVIEW_INFO *infoPtr, LPPOINT lpPos) { INT nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top; - + *lpPos = infoPtr->currIconPos; - + infoPtr->currIconPos.y += infoPtr->nItemHeight; if (infoPtr->currIconPos.y + infoPtr->nItemHeight <= nListHeight) return; @@ -2217,7 +2217,7 @@ static void LISTVIEW_NextIconPosLeft(LISTVIEW_INFO *infoPtr, LPPOINT lpPos) infoPtr->currIconPos.y = 0; } - + /*** * DESCRIPTION: * Moves an icon to the specified position. @@ -2236,12 +2236,12 @@ static void LISTVIEW_NextIconPosLeft(LISTVIEW_INFO *infoPtr, LPPOINT lpPos) static BOOL LISTVIEW_MoveIconTo(const LISTVIEW_INFO *infoPtr, INT nItem, const POINT *lppt, BOOL isNew) { POINT old; - + if (!isNew) - { + { old.x = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem); old.y = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem); - + if (lppt->x == old.x && lppt->y == old.y) return TRUE; LISTVIEW_InvalidateItem(infoPtr, nItem); } @@ -2276,7 +2276,7 @@ static BOOL LISTVIEW_Arrange(LISTVIEW_INFO *infoPtr, INT nAlignCode) INT i; if (uView != LVS_ICON && uView != LVS_SMALLICON) return FALSE; - + TRACE("nAlignCode=%d\n", nAlignCode); if (nAlignCode == LVA_DEFAULT) @@ -2284,7 +2284,7 @@ static BOOL LISTVIEW_Arrange(LISTVIEW_INFO *infoPtr, INT nAlignCode) if (infoPtr->dwStyle & LVS_ALIGNLEFT) nAlignCode = LVA_ALIGNLEFT; else nAlignCode = LVA_ALIGNTOP; } - + switch (nAlignCode) { case LVA_ALIGNLEFT: next_pos = LISTVIEW_NextIconPosLeft; break; @@ -2292,7 +2292,7 @@ static BOOL LISTVIEW_Arrange(LISTVIEW_INFO *infoPtr, INT nAlignCode) case LVA_SNAPTOGRID: next_pos = LISTVIEW_NextIconPosTop; break; /* FIXME */ default: return FALSE; } - + infoPtr->bAutoarrange = TRUE; infoPtr->currIconPos.x = infoPtr->currIconPos.y = 0; for (i = 0; i < infoPtr->nItemCount; i++) @@ -2303,7 +2303,7 @@ static BOOL LISTVIEW_Arrange(LISTVIEW_INFO *infoPtr, INT nAlignCode) return TRUE; } - + /*** * DESCRIPTION: * Retrieves the bounding rectangle of all the items, not offset by Origin. @@ -2347,8 +2347,8 @@ static void LISTVIEW_GetAreaRect(const LISTVIEW_INFO *infoPtr, LPRECT lprcView) lprcView->right = x * infoPtr->nItemWidth; lprcView->bottom = y * infoPtr->nItemHeight; break; - - case LVS_REPORT: + + case LVS_REPORT: lprcView->right = infoPtr->nItemWidth; lprcView->bottom = infoPtr->nItemCount * infoPtr->nItemHeight; break; @@ -2374,10 +2374,10 @@ static BOOL LISTVIEW_GetViewRect(const LISTVIEW_INFO *infoPtr, LPRECT lprcView) TRACE("(lprcView=%p)\n", lprcView); if (!lprcView) return FALSE; - + LISTVIEW_GetOrigin(infoPtr, &ptOrigin); - LISTVIEW_GetAreaRect(infoPtr, lprcView); - OffsetRect(lprcView, ptOrigin.x, ptOrigin.y); + LISTVIEW_GetAreaRect(infoPtr, lprcView); + OffsetRect(lprcView, ptOrigin.x, ptOrigin.y); TRACE("lprcView=%s\n", wine_dbgstr_rect(lprcView)); @@ -2445,11 +2445,11 @@ static INT LISTVIEW_CalculateItemWidth(const LISTVIEW_INFO *infoPtr) else /* LVS_SMALLICON, or LVS_LIST */ { INT i; - + for (i = 0; i < infoPtr->nItemCount; i++) nItemWidth = max(LISTVIEW_GetLabelWidth(infoPtr, i), nItemWidth); - if (infoPtr->himlSmall) nItemWidth += infoPtr->iconSize.cx; + if (infoPtr->himlSmall) nItemWidth += infoPtr->iconSize.cx; if (infoPtr->himlState) nItemWidth += infoPtr->iconStateSize.cx; nItemWidth = max(DEFAULT_COLUMN_WIDTH, nItemWidth + WIDTH_PADDING); @@ -2479,7 +2479,7 @@ static INT LISTVIEW_CalculateItemHeight(const LISTVIEW_INFO *infoPtr) nItemHeight = infoPtr->iconSpacing.cy; else { - nItemHeight = infoPtr->ntmHeight; + nItemHeight = infoPtr->ntmHeight; if (infoPtr->himlState) nItemHeight = max(nItemHeight, infoPtr->iconStateSize.cy); if (infoPtr->himlSmall) @@ -2535,10 +2535,10 @@ static void LISTVIEW_SaveTextMetrics(LISTVIEW_INFO *infoPtr) if (GetTextExtentPoint32A(hdc, "...", 3, &sz)) infoPtr->nEllipsisWidth = sz.cx; - + SelectObject(hdc, hOldFont); ReleaseDC(infoPtr->hwndSelf, hdc); - + TRACE("tmHeight=%d\n", infoPtr->ntmHeight); } @@ -2559,14 +2559,14 @@ static void LISTVIEW_SaveTextMetrics(LISTVIEW_INFO *infoPtr) static INT CALLBACK ranges_cmp(LPVOID range1, LPVOID range2, LPARAM flags) { INT cmp; - - if (((RANGE*)range1)->upper <= ((RANGE*)range2)->lower) + + if (((RANGE*)range1)->upper <= ((RANGE*)range2)->lower) cmp = -1; - else if (((RANGE*)range2)->upper <= ((RANGE*)range1)->lower) + else if (((RANGE*)range2)->upper <= ((RANGE*)range1)->lower) cmp = 1; - else + else cmp = 0; - + TRACE("range1=%s, range2=%s, cmp=%d\n", debugrange((RANGE*)range1), debugrange((RANGE*)range2), cmp); return cmp; @@ -2582,7 +2582,7 @@ static void ranges_assert(RANGES ranges, LPCSTR desc, const char *func, int line { INT i; RANGE *prev, *curr; - + TRACE("*** Checking %s:%d:%s ***\n", func, line, desc); assert (ranges); assert (DPA_GetPtrCount(ranges->hdpa) >= 0); @@ -2613,7 +2613,7 @@ static RANGES ranges_create(int count) static void ranges_clear(RANGES ranges) { INT i; - + for(i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++) Free(DPA_GetPtr(ranges->hdpa, i)); DPA_DeleteAllPtrs(ranges->hdpa); @@ -2632,7 +2632,7 @@ static RANGES ranges_clone(RANGES ranges) { RANGES clone; INT i; - + if (!(clone = ranges_create(DPA_GetPtrCount(ranges->hdpa)))) goto fail; for (i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++) @@ -2643,7 +2643,7 @@ static RANGES ranges_clone(RANGES ranges) DPA_SetPtr(clone->hdpa, i, newrng); } return clone; - + fail: TRACE ("clone failed\n"); ranges_destroy(clone); @@ -2680,7 +2680,7 @@ static inline BOOL ranges_contain(RANGES ranges, INT nItem) static INT ranges_itemcount(RANGES ranges) { INT i, count = 0; - + for (i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++) { RANGE *sel = DPA_GetPtr(ranges->hdpa, i); @@ -2721,23 +2721,23 @@ static BOOL ranges_add(RANGES ranges, RANGE range) srchrgn.lower = range.lower - 1; srchrgn.upper = range.upper + 1; index = DPA_Search(ranges->hdpa, &srchrgn, 0, ranges_cmp, 0, DPAS_SORTED); - + if (index == -1) { RANGE *newrgn; TRACE("Adding new range\n"); - /* create the brand new range to insert */ + /* create the brand new range to insert */ newrgn = Alloc(sizeof(RANGE)); if(!newrgn) goto fail; *newrgn = range; - + /* figure out where to insert it */ index = DPA_Search(ranges->hdpa, newrgn, 0, ranges_cmp, 0, DPAS_SORTED | DPAS_INSERTAFTER); TRACE("index=%d\n", index); if (index == -1) index = 0; - + /* and get it over with */ if (DPA_InsertPtr(ranges->hdpa, index, newrgn) == -1) { @@ -2755,26 +2755,26 @@ static BOOL ranges_add(RANGES ranges, RANGE range) chkrgn->lower = min(range.lower, chkrgn->lower); chkrgn->upper = max(range.upper, chkrgn->upper); - + TRACE("New range %s @%d\n", debugrange(chkrgn), index); /* merge now common anges */ fromindex = 0; srchrgn.lower = chkrgn->lower - 1; srchrgn.upper = chkrgn->upper + 1; - + do { mergeindex = DPA_Search(ranges->hdpa, &srchrgn, fromindex, ranges_cmp, 0, 0); if (mergeindex == -1) break; - if (mergeindex == index) + if (mergeindex == index) { fromindex = index + 1; continue; } - + TRACE("Merge with index %i\n", mergeindex); - + mrgrgn = DPA_GetPtr(ranges->hdpa, mergeindex); chkrgn->lower = min(chkrgn->lower, mrgrgn->lower); chkrgn->upper = max(chkrgn->upper, mrgrgn->upper); @@ -2786,7 +2786,7 @@ static BOOL ranges_add(RANGES ranges, RANGE range) ranges_check(ranges, "after add"); return TRUE; - + fail: ranges_check(ranges, "failed add"); return FALSE; @@ -2799,15 +2799,15 @@ static BOOL ranges_del(RANGES ranges, RANGE range) TRACE("(%s)\n", debugrange(&range)); ranges_check(ranges, "before del"); - + /* we don't use DPAS_SORTED here, since we need * * to find the first overlapping range */ index = DPA_Search(ranges->hdpa, &range, 0, ranges_cmp, 0, 0); - while(index != -1) + while(index != -1) { chkrgn = DPA_GetPtr(ranges->hdpa, index); - - TRACE("Matches range %s @%d\n", debugrange(chkrgn), index); + + TRACE("Matches range %s @%d\n", debugrange(chkrgn), index); /* case 1: Same range */ if ( (chkrgn->upper == range.upper) && @@ -2818,7 +2818,7 @@ static BOOL ranges_del(RANGES ranges, RANGE range) } /* case 2: engulf */ else if ( (chkrgn->upper <= range.upper) && - (chkrgn->lower >= range.lower) ) + (chkrgn->lower >= range.lower) ) { DPA_DeletePtr(ranges->hdpa, index); } @@ -2886,7 +2886,7 @@ static BOOL LISTVIEW_DeselectAllSkipItems(LISTVIEW_INFO *infoPtr, RANGES toSkip) lvItem.state = 0; lvItem.stateMask = LVIS_SELECTED; - + /* need to clone the DPA because callbacks can change it */ if (!(clone = ranges_clone(infoPtr->selectionRanges))) return FALSE; iterator_rangesitems(&i, ranges_diff(clone, toSkip)); @@ -2901,7 +2901,7 @@ static BOOL LISTVIEW_DeselectAllSkipItems(LISTVIEW_INFO *infoPtr, RANGES toSkip) static inline BOOL LISTVIEW_DeselectAllSkipItem(LISTVIEW_INFO *infoPtr, INT nItem) { RANGES toSkip; - + if (!(toSkip = ranges_create(1))) return FALSE; if (nItem != -1) ranges_additem(toSkip, nItem); LISTVIEW_DeselectAllSkipItems(infoPtr, toSkip); @@ -2962,7 +2962,7 @@ static inline BOOL LISTVIEW_SetItemFocus(LISTVIEW_INFO *infoPtr, INT nItem) LVITEMW lvItem; if (nItem == infoPtr->nFocusedItem) return FALSE; - + lvItem.state = nItem == -1 ? 0 : LVIS_FOCUSED; lvItem.stateMask = LVIS_FOCUSED; LISTVIEW_SetItemState(infoPtr, nItem == -1 ? infoPtr->nFocusedItem : nItem, &lvItem); @@ -3014,7 +3014,7 @@ static void LISTVIEW_ShiftIndices(LISTVIEW_INFO *infoPtr, INT nItem, INT directi nNewFocus = shift_item(infoPtr, infoPtr->nFocusedItem, nItem, direction); if (nNewFocus != infoPtr->nFocusedItem) LISTVIEW_SetItemFocus(infoPtr, nNewFocus); - + /* But we are not supposed to modify nHotItem! */ infoPtr->bDoChangeNotify = bOldChange; @@ -3093,7 +3093,7 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) if (!(selection = ranges_create(100))) return; - item.state = LVIS_SELECTED; + item.state = LVIS_SELECTED; item.stateMask = LVIS_SELECTED; if ((uView == LVS_LIST) || (uView == LVS_REPORT)) @@ -3106,7 +3106,7 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) else { RANGE sel; - + sel.lower = min(infoPtr->nSelectionMark, nItem); sel.upper = max(infoPtr->nSelectionMark, nItem) + 1; ranges_add(selection, sel); @@ -3116,7 +3116,7 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) { RECT rcItem, rcSel, rcSelMark; POINT ptItem; - + rcItem.left = LVIR_BOUNDS; if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) return; rcSelMark.left = LVIR_BOUNDS; @@ -3144,7 +3144,7 @@ static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *infoPtr, INT nItem) iterator_destroy(&i); infoPtr->bDoChangeNotify = bOldChange; - + LISTVIEW_SetItemFocus(infoPtr, nItem); } @@ -3164,7 +3164,7 @@ static void LISTVIEW_SetSelection(LISTVIEW_INFO *infoPtr, INT nItem) LVITEMW lvItem; TRACE("nItem=%d\n", nItem); - + LISTVIEW_DeselectAllSkipItem(infoPtr, nItem); lvItem.state = LVIS_FOCUSED | LVIS_SELECTED; @@ -3347,14 +3347,14 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN /*** - * Tests wheather the item is assignable to a list with style lStyle + * Tests wheather the item is assignable to a list with style lStyle */ static inline BOOL is_assignable_item(const LVITEMW *lpLVItem, LONG lStyle) { - if ( (lpLVItem->mask & LVIF_TEXT) && + if ( (lpLVItem->mask & LVIF_TEXT) && (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) && (lStyle & (LVS_SORTASCENDING | LVS_SORTDESCENDING)) ) return FALSE; - + return TRUE; } @@ -3385,8 +3385,8 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL TRACE("()\n"); assert(lpLVItem->iItem >= 0 && lpLVItem->iItem < infoPtr->nItemCount); - - if (lpLVItem->mask == 0) return TRUE; + + if (lpLVItem->mask == 0) return TRUE; if (infoPtr->dwStyle & LVS_OWNERDATA) { @@ -3412,7 +3412,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL if (!isNew && !LISTVIEW_GetItemW(infoPtr, &item)) return FALSE; TRACE("oldState=%x, newState=%x\n", item.state, lpLVItem->state); - /* determine what fields will change */ + /* determine what fields will change */ if ((lpLVItem->mask & LVIF_STATE) && ((item.state ^ lpLVItem->state) & lpLVItem->stateMask & ~infoPtr->uCallbackMask)) uChanged |= LVIF_STATE; @@ -3427,18 +3427,18 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL if ((lpLVItem->mask & LVIF_TEXT) && textcmpWT(lpItem->hdr.pszText, lpLVItem->pszText, isW)) uChanged |= LVIF_TEXT; - - TRACE("uChanged=0x%x\n", uChanged); + + TRACE("uChanged=0x%x\n", uChanged); if (!uChanged) return TRUE; *bChanged = TRUE; - + ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); nmlv.iItem = lpLVItem->iItem; nmlv.uNewState = (item.state & ~lpLVItem->stateMask) | (lpLVItem->state & lpLVItem->stateMask); nmlv.uOldState = item.state; nmlv.uChanged = uChanged; nmlv.lParam = item.lParam; - + /* send LVN_ITEMCHANGING notification, if the item is not being inserted */ /* and we are _NOT_ virtual (LVS_OWERNDATA), and change notifications */ /* are enabled */ @@ -3479,7 +3479,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL } else if (lpLVItem->stateMask & LVIS_SELECTED) ranges_delitem(infoPtr->selectionRanges, lpLVItem->iItem); - + /* if we are asked to change focus, and we manage it, do it */ if (lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED) { @@ -3496,7 +3496,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL /* if we're inserting the item, we're done */ if (isNew) return TRUE; - + /* send LVN_ITEMCHANGED notification */ if (lpLVItem->mask & LVIF_PARAM) nmlv.lParam = lpLVItem->lParam; if (infoPtr->bDoChangeNotify) notify_listview(infoPtr, LVN_ITEMCHANGED, &nmlv); @@ -3525,10 +3525,10 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, /* we do not support subitems for virtual listviews */ if (infoPtr->dwStyle & LVS_OWNERDATA) return FALSE; - + /* set subitem only if column is present */ if (lpLVItem->iSubItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE; - + /* First do some sanity checks */ /* The LVIF_STATE flag is valid for subitems, but does not appear to be particularly useful. We currently do not actually do anything with @@ -3536,11 +3536,11 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, */ if (lpLVItem->mask & ~(LVIF_TEXT | LVIF_IMAGE | LVIF_STATE)) return FALSE; if (!(lpLVItem->mask & (LVIF_TEXT | LVIF_IMAGE | LVIF_STATE))) return TRUE; - + /* get the subitem structure, and create it if not there */ hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); assert (hdpaSubItems); - + lpSubItem = LISTVIEW_GetSubItemPtr(hdpaSubItems, lpLVItem->iSubItem); if (!lpSubItem) { @@ -3564,7 +3564,7 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, lpSubItem->hdr.iImage = I_IMAGECALLBACK; *bChanged = TRUE; } - + if (lpLVItem->mask & LVIF_IMAGE) if (lpSubItem->hdr.iImage != lpLVItem->iImage) { @@ -3673,7 +3673,7 @@ static INT LISTVIEW_GetTopIndex(const LISTVIEW_INFO *infoPtr) { if (GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) nItem = scrollInfo.nPos; - } + } else { if (GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) @@ -3681,7 +3681,7 @@ static INT LISTVIEW_GetTopIndex(const LISTVIEW_INFO *infoPtr) } TRACE("nItem=%d\n", nItem); - + return nItem; } @@ -3751,7 +3751,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS lvItem.cchTextMax = DISP_TEXT_SIZE; lvItem.pszText = szDispText; if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE; - if (nSubItem > 0 && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) + if (nSubItem > 0 && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) lvItem.state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED); if (lvItem.pszText == LPSTR_TEXTCALLBACKW) lvItem.pszText = szCallback; TRACE(" lvItem=%s\n", debuglvitem_t(&lvItem, TRUE)); @@ -3831,11 +3831,11 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) rcSelect.right = rcBox.right; - if (nmlvcd.clrTextBk != CLR_NONE) + if (nmlvcd.clrTextBk != CLR_NONE) ExtTextOutW(hdc, rcSelect.left, rcSelect.top, ETO_OPAQUE, &rcSelect, 0, 0, 0); if(lprcFocus) *lprcFocus = rcSelect; } - + /* figure out the text drawing flags */ uFormat = (uView == LVS_ICON ? (lprcFocus ? LV_FL_DT_FLAGS : LV_ML_DT_FLAGS) : LV_SL_DT_FLAGS); if (uView == LVS_ICON) @@ -3884,14 +3884,14 @@ static void LISTVIEW_RefreshOwnerDraw(const LISTVIEW_INFO *infoPtr, ITERATOR *i, POINT Origin, Position; DRAWITEMSTRUCT dis; LVITEMW item; - + TRACE("()\n"); ZeroMemory(&dis, sizeof(dis)); - + /* Get scroll info once before loop */ LISTVIEW_GetOrigin(infoPtr, &Origin); - + /* iterate through the invalidated rows */ while(iterator_next(i)) { @@ -3900,7 +3900,7 @@ static void LISTVIEW_RefreshOwnerDraw(const LISTVIEW_INFO *infoPtr, ITERATOR *i, item.mask = LVIF_PARAM | LVIF_STATE; item.stateMask = LVIS_SELECTED | LVIS_FOCUSED; if (!LISTVIEW_GetItemW(infoPtr, &item)) continue; - + dis.CtlType = ODT_LISTVIEW; dis.CtlID = uID; dis.itemID = item.iItem; @@ -3926,7 +3926,7 @@ static void LISTVIEW_RefreshOwnerDraw(const LISTVIEW_INFO *infoPtr, ITERATOR *i, customdraw_fill(&nmlvcd, infoPtr, hdc, &dis.rcItem, &item); if (cdmode & CDRF_NOTIFYITEMDRAW) cditemmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); - + if (!(cditemmode & CDRF_SKIPDEFAULT)) { prepaint_setup (infoPtr, hdc, &nmlvcd); @@ -3963,10 +3963,10 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, /* figure out what to draw */ rgntype = GetClipBox(hdc, &rcClip); if (rgntype == NULLREGION) return; - + /* Get scroll info once before loop */ LISTVIEW_GetOrigin(infoPtr, &Origin); - + /* narrow down the columns we need to paint */ for(colRange.lower = 0; colRange.lower < DPA_GetPtrCount(infoPtr->hdpaColumns); colRange.lower++) { @@ -4027,7 +4027,7 @@ static void LISTVIEW_RefreshList(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, D /* Get scroll info once before loop */ LISTVIEW_GetOrigin(infoPtr, &Origin); - + while(iterator_prev(i)) { LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position); @@ -4110,7 +4110,7 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra /* FIXME: Shouldn't need to do this */ oldClrTextBk = infoPtr->clrTextBk; oldClrText = infoPtr->clrText; - + infoPtr->cditemmode = CDRF_DODEFAULT; GetClientRect(infoPtr->hwndSelf, &rcClient); @@ -4128,13 +4128,13 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra /* figure out what we need to draw */ iterator_visibleitems(&i, infoPtr, hdc); - + /* send cache hint notification */ if (infoPtr->dwStyle & LVS_OWNERDATA) { RANGE range = iterator_range(&i); NMLVCACHEHINT nmlv; - + ZeroMemory(&nmlv, sizeof(NMLVCACHEHINT)); nmlv.iFrom = range.lower; nmlv.iTo = range.upper - 1; @@ -4155,7 +4155,7 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra DrawFocusRect(hdc, &infoPtr->rcFocus); } iterator_destroy(&i); - + enddraw: if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); @@ -4312,7 +4312,7 @@ static HIMAGELIST LISTVIEW_CreateDragImage(LISTVIEW_INFO *infoPtr, INT iItem, LP rcItem.right = size.cx; rcItem.bottom = size.cy; FillRect(hdc, &rcItem, infoPtr->hBkBrush); - + pos.x = pos.y = 0; if (LISTVIEW_DrawItem(infoPtr, hdc, iItem, 0, pos, infoPtr->cditemmode)) { @@ -4387,11 +4387,11 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr) DPA_DeletePtr(infoPtr->hdpaPosY, i); infoPtr->nItemCount --; } - + LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); LISTVIEW_UpdateScroll(infoPtr); LISTVIEW_InvalidateList(infoPtr); - + return TRUE; } @@ -4413,13 +4413,13 @@ static void LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn, INT dx) RECT rcOld, rcCol; POINT ptOrigin; INT nCol; - + if (nColumn < 0 || DPA_GetPtrCount(infoPtr->hdpaColumns) < 1) return; lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, min(nColumn, DPA_GetPtrCount(infoPtr->hdpaColumns) - 1)); rcCol = lpColumnInfo->rcHeader; if (nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) rcCol.left = rcCol.right; - + /* ajust the other columns */ for (nCol = nColumn; nCol < DPA_GetPtrCount(infoPtr->hdpaColumns); nCol++) { @@ -4430,10 +4430,10 @@ static void LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn, INT dx) /* do not update screen if not in report mode */ if (!is_redrawing(infoPtr) || (infoPtr->dwStyle & LVS_TYPEMASK) != LVS_REPORT) return; - + /* if we have a focus, must first erase the focus rect */ if (infoPtr->bFocus) LISTVIEW_ShowFocusRect(infoPtr, FALSE); - + /* Need to reset the item width when inserting a new column */ infoPtr->nItemWidth += dx; @@ -4444,7 +4444,7 @@ static void LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn, INT dx) rcOld = infoPtr->rcList; rcOld.left = ptOrigin.x + rcCol.left + dx; ScrollWindowEx(infoPtr->hwndSelf, dx, 0, &rcOld, &rcOld, 0, 0, SW_ERASE | SW_INVALIDATE); - + /* we can restore focus now */ if (infoPtr->bFocus) LISTVIEW_ShowFocusRect(infoPtr, TRUE); } @@ -4464,7 +4464,7 @@ static void LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn, INT dx) static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn) { RECT rcCol; - + TRACE("nColumn=%d\n", nColumn); if (nColumn < 0 || DPA_GetPtrCount(infoPtr->hdpaColumns) == 0 @@ -4476,19 +4476,19 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn) */ LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcCol); - + if (!Header_DeleteItem(infoPtr->hwndHeader, nColumn)) return FALSE; Free(DPA_GetPtr(infoPtr->hdpaColumns, nColumn)); DPA_DeletePtr(infoPtr->hdpaColumns, nColumn); - + if (!(infoPtr->dwStyle & LVS_OWNERDATA) && nColumn) { SUBITEM_INFO *lpSubItem, *lpDelItem; HDPA hdpaSubItems; INT nItem, nSubItem, i; - + for (nItem = 0; nItem < infoPtr->nItemCount; nItem++) { hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); @@ -4502,13 +4502,13 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn) nSubItem = i; lpDelItem = lpSubItem; } - else if (lpSubItem->iSubItem > nColumn) + else if (lpSubItem->iSubItem > nColumn) { lpSubItem->iSubItem--; } } - /* if we found our subitem, zapp it */ + /* if we found our subitem, zapp it */ if (nSubItem > 0) { /* free string */ @@ -4555,7 +4555,7 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir) /* if we don't refresh, what's the point of scrolling? */ if (!is_redrawing(infoPtr)) return; - + assert (abs(dir) == 1); /* arrange icons if autoarrange is on */ @@ -4570,14 +4570,14 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir) /* scrollbars need updating */ LISTVIEW_UpdateScroll(infoPtr); - /* figure out the item's position */ + /* figure out the item's position */ if (uView == LVS_REPORT) nPerCol = infoPtr->nItemCount + 1; else if (uView == LVS_LIST) nPerCol = LISTVIEW_GetCountPerColumn(infoPtr); else /* LVS_ICON, or LVS_SMALLICON */ return; - + nItemCol = nItem / nPerCol; nItemRow = nItem % nPerCol; LISTVIEW_GetOrigin(infoPtr, &Origin); @@ -4592,7 +4592,7 @@ static void LISTVIEW_ScrollOnInsert(LISTVIEW_INFO *infoPtr, INT nItem, INT dir) if (IntersectRect(&rcScroll, &rcScroll, &infoPtr->rcList)) { TRACE("Scrolling rcScroll=%s, rcList=%s\n", wine_dbgstr_rect(&rcScroll), wine_dbgstr_rect(&infoPtr->rcList)); - ScrollWindowEx(infoPtr->hwndSelf, 0, dir * infoPtr->nItemHeight, + ScrollWindowEx(infoPtr->hwndSelf, 0, dir * infoPtr->nItemHeight, &rcScroll, &rcScroll, 0, 0, SW_ERASE | SW_INVALIDATE); } @@ -4630,26 +4630,26 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem) TRACE("(nItem=%d)\n", nItem); if (nItem < 0 || nItem >= infoPtr->nItemCount) return FALSE; - + /* remove selection, and focus */ item.state = 0; item.stateMask = LVIS_SELECTED | LVIS_FOCUSED; LISTVIEW_SetItemState(infoPtr, nItem, &item); - + /* send LVN_DELETEITEM notification. */ if (!notify_deleteitem(infoPtr, nItem)) return FALSE; - /* we need to do this here, because we'll be deleting stuff */ + /* we need to do this here, because we'll be deleting stuff */ if (uView == LVS_SMALLICON || uView == LVS_ICON) LISTVIEW_InvalidateItem(infoPtr, nItem); - + if (!(infoPtr->dwStyle & LVS_OWNERDATA)) { HDPA hdpaSubItems; ITEMHDR *hdrItem; INT i; - hdpaSubItems = (HDPA)DPA_DeletePtr(infoPtr->hdpaItems, nItem); + hdpaSubItems = (HDPA)DPA_DeletePtr(infoPtr->hdpaItems, nItem); for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++) { hdrItem = (ITEMHDR *)DPA_GetPtr(hdpaSubItems, i); @@ -4771,7 +4771,7 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) rect.left = LVIR_LABEL; if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rect)) return 0; - + ZeroMemory(&dispInfo, sizeof(dispInfo)); dispInfo.item.mask = LVIF_PARAM | LVIF_STATE | LVIF_TEXT; dispInfo.item.iItem = nItem; @@ -4784,7 +4784,7 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) infoPtr->hwndEdit = CreateEditLabelT(infoPtr, dispInfo.item.pszText, WS_VISIBLE, rect.left-2, rect.top-1, 0, rect.bottom - rect.top+2, isW); if (!infoPtr->hwndEdit) return 0; - + if (notify_dispinfoT(infoPtr, LVN_BEGINLABELEDITW, &dispInfo, isW)) { if (!IsWindow(hwndSelf)) @@ -4829,7 +4829,7 @@ static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *infoPtr, INT nItem, BOOL bPart if (!LISTVIEW_GetItemRect(infoPtr, nItem, &rcItem)) return FALSE; if (bPartial && IntersectRect(&rcTemp, &infoPtr->rcList, &rcItem)) return TRUE; - + if (rcItem.left < infoPtr->rcList.left || rcItem.right > infoPtr->rcList.right) { /* scroll left/right, but in LVS_REPORT mode */ @@ -4914,7 +4914,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart, LVITEMW lvItem; if (!lpFindInfo || nItem < 0) return -1; - + lvItem.mask = 0; if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL)) { @@ -4926,12 +4926,12 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart, if (lpFindInfo->flags & LVFI_WRAP) bWrap = TRUE; - if ((lpFindInfo->flags & LVFI_NEARESTXY) && + if ((lpFindInfo->flags & LVFI_NEARESTXY) && (uView == LVS_ICON || uView ==LVS_SMALLICON)) { POINT Origin; RECT rcArea; - + LISTVIEW_GetOrigin(infoPtr, &Origin); Destination.x = lpFindInfo->pt.x - Origin.x; Destination.y = lpFindInfo->pt.y - Origin.y; @@ -4946,8 +4946,8 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart, case VK_PRIOR: Destination.y -= infoPtr->rcList.bottom - infoPtr->rcList.top; break; case VK_END: LISTVIEW_GetAreaRect(infoPtr, &rcArea); - Destination.x = rcArea.right; - Destination.y = rcArea.bottom; + Destination.x = rcArea.right; + Destination.y = rcArea.bottom; break; default: ERR("Unknown vkDirection=%d\n", lpFindInfo->vkDirection); } @@ -4977,7 +4977,7 @@ again: else continue; } - + if (lvItem.mask & LVIF_TEXT) { if (lpFindInfo->flags & LVFI_PARTIAL) @@ -4991,7 +4991,7 @@ again: } if (!bNearest) return nItem; - + /* This is very inefficient. To do a good job here, * we need a sorted array of (x,y) item positions */ LISTVIEW_GetItemOrigin(infoPtr, nItem, &Position); @@ -5311,7 +5311,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, if (lpLVItem->mask & LVIF_TEXT) { dispInfo.item.pszText = lpLVItem->pszText; - dispInfo.item.cchTextMax = lpLVItem->cchTextMax; + dispInfo.item.cchTextMax = lpLVItem->cchTextMax; } if (lpLVItem->mask & LVIF_STATE) dispInfo.item.stateMask = lpLVItem->stateMask & infoPtr->uCallbackMask; @@ -5334,15 +5334,15 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, } TRACE(" getdispinfo(1):lpLVItem=%s\n", debuglvitem_t(lpLVItem, isW)); } - + /* make sure lParam is zeroed out */ if (lpLVItem->mask & LVIF_PARAM) lpLVItem->lParam = 0; - + /* we store only a little state, so if we're not asked, we're done */ if (!(lpLVItem->mask & LVIF_STATE) || isubitem) return TRUE; /* if focus is handled by us, report it */ - if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED ) + if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED ) { lpLVItem->state &= ~LVIS_FOCUSED; if (infoPtr->nFocusedItem == lpLVItem->iItem) @@ -5350,13 +5350,13 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, } /* and do the same for selection, if we handle it */ - if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_SELECTED ) + if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_SELECTED ) { lpLVItem->state &= ~LVIS_SELECTED; if (ranges_contain(infoPtr->selectionRanges, lpLVItem->iItem)) lpLVItem->state |= LVIS_SELECTED; } - + return TRUE; } @@ -5384,7 +5384,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, dispInfo.item.mask |= LVIF_STATE; dispInfo.item.stateMask = infoPtr->uCallbackMask; } - + /* Do we need to enquire about the image? */ if ((lpLVItem->mask & LVIF_IMAGE) && pItemHdr->iImage == I_IMAGECALLBACK && (isubitem == 0 || (infoPtr->dwLvExStyle & LVS_EX_SUBITEMIMAGES))) @@ -5467,18 +5467,18 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, lpLVItem->state &= ~dispInfo.item.stateMask; lpLVItem->state |= (dispInfo.item.state & dispInfo.item.stateMask); } - if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED ) + if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_FOCUSED ) { lpLVItem->state &= ~LVIS_FOCUSED; if (infoPtr->nFocusedItem == lpLVItem->iItem) lpLVItem->state |= LVIS_FOCUSED; } - if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_SELECTED ) + if ( lpLVItem->stateMask & ~infoPtr->uCallbackMask & LVIS_SELECTED ) { lpLVItem->state &= ~LVIS_SELECTED; if (ranges_contain(infoPtr->selectionRanges, lpLVItem->iItem)) lpLVItem->state |= LVIS_SELECTED; - } + } } /* and last, but not least, the indent field */ @@ -5558,7 +5558,7 @@ static BOOL LISTVIEW_GetItemPosition(const LISTVIEW_INFO *infoPtr, INT nItem, LP } lpptPosition->x += Origin.x; lpptPosition->y += Origin.y; - + TRACE (" lpptPosition=%s\n", wine_dbgstr_point(lpptPosition)); return TRUE; } @@ -5707,11 +5707,11 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT * [IO] lprc : rectangle to receive the output * on input, lprc->top = nSubItem * lprc->left = LVIR_ICON | LVIR_BOUNDS | LVIR_LABEL - * + * * NOTE: for subItem = 0, we should return the bounds of the _entire_ item, * not only those of the first column. * Fortunately, LISTVIEW_GetItemMetrics does the right thing. - * + * * RETURN: * TRUE: success * FALSE: failure @@ -5721,7 +5721,7 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR POINT Position; LVITEMW lvItem; INT nColumn; - + if (!lprc) return FALSE; nColumn = lprc->top; @@ -5740,7 +5740,7 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR lvItem.mask = 0; lvItem.iItem = nItem; lvItem.iSubItem = nColumn; - + if (lvItem.mask && !LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE; switch(lprc->left) { @@ -5787,7 +5787,7 @@ static INT LISTVIEW_GetLabelWidth(const LISTVIEW_INFO *infoPtr, INT nItem) lvItem.pszText = szDispText; lvItem.cchTextMax = DISP_TEXT_SIZE; if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return 0; - + return LISTVIEW_GetStringWidthT(infoPtr, lvItem.pszText, TRUE); } @@ -5911,14 +5911,14 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF if (uFlags & LVNI_SELECTED) uMask |= LVIS_SELECTED; - /* if we're asked for the focused item, that's only one, + /* if we're asked for the focused item, that's only one, * so it's worth optimizing */ if (uFlags & LVNI_FOCUSED) { if ((LISTVIEW_GetItemState(infoPtr, infoPtr->nFocusedItem, uMask) & uMask) != uMask) return -1; return (infoPtr->nFocusedItem == nItem) ? -1 : infoPtr->nFocusedItem; } - + if (uFlags & LVNI_ABOVE) { if ((uView == LVS_LIST) || (uView == LVS_REPORT)) @@ -6095,9 +6095,9 @@ static void LISTVIEW_GetOrigin(const LISTVIEW_INFO *infoPtr, LPPOINT lpptOrigin) INT nHorzPos = 0, nVertPos = 0; SCROLLINFO scrollInfo; - scrollInfo.cbSize = sizeof(SCROLLINFO); + scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_POS; - + if (GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) nHorzPos = scrollInfo.nPos; if (GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) @@ -6111,7 +6111,7 @@ static void LISTVIEW_GetOrigin(const LISTVIEW_INFO *infoPtr, LPPOINT lpptOrigin) nHorzPos *= infoPtr->nItemWidth; else if (uView == LVS_REPORT) nVertPos *= infoPtr->nItemHeight; - + lpptOrigin->x -= nHorzPos; lpptOrigin->y -= nVertPos; @@ -6134,8 +6134,8 @@ static void LISTVIEW_GetOrigin(const LISTVIEW_INFO *infoPtr, LPPOINT lpptOrigin) static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *infoPtr, LPCWSTR lpszText, BOOL isW) { SIZE stringSize; - - stringSize.cx = 0; + + stringSize.cx = 0; if (is_textT(lpszText, isW)) { HFONT hFont = infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont; @@ -6166,7 +6166,7 @@ static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *infoPtr, LPCWSTR lpszTe * (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) - * + * * RETURN: * SUCCESS : item index * FAILURE : -1 @@ -6180,9 +6180,9 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, LVITEMW lvItem; ITERATOR i; INT iItem; - + TRACE("(pt=%s, subitem=%d, select=%d)\n", wine_dbgstr_point(&lpht->pt), subitem, select); - + lpht->flags = 0; lpht->iItem = -1; if (subitem) lpht->iSubItem = 0; @@ -6191,7 +6191,7 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, lpht->flags |= LVHT_TOLEFT; else if (infoPtr->rcList.right < lpht->pt.x) lpht->flags |= LVHT_TORIGHT; - + if (infoPtr->rcList.top > lpht->pt.y) lpht->flags |= LVHT_ABOVE; else if (infoPtr->rcList.bottom < lpht->pt.y) @@ -6203,19 +6203,19 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, lpht->flags |= LVHT_NOWHERE; LISTVIEW_GetOrigin(infoPtr, &Origin); - + /* first deal with the large items */ rcSearch.left = lpht->pt.x; rcSearch.top = lpht->pt.y; rcSearch.right = rcSearch.left + 1; rcSearch.bottom = rcSearch.top + 1; - + iterator_frameditems(&i, infoPtr, &rcSearch); iterator_next(&i); /* go to first item in the sequence */ iItem = i.nItem; iterator_destroy(&i); - - TRACE("lpht->iItem=%d\n", iItem); + + TRACE("lpht->iItem=%d\n", iItem); if (iItem == -1) return -1; lvItem.mask = LVIF_STATE | LVIF_TEXT; @@ -6233,7 +6233,7 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, LISTVIEW_GetItemOrigin(infoPtr, iItem, &Position); opt.x = lpht->pt.x - Position.x - Origin.x; opt.y = lpht->pt.y - Position.y - Origin.y; - + if (uView == LVS_REPORT) rcBounds = rcBox; else @@ -6249,8 +6249,8 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, lpht->flags |= LVHT_ONITEMSTATEICON; if (lpht->flags & LVHT_ONITEM) lpht->flags &= ~LVHT_NOWHERE; - - TRACE("lpht->flags=0x%x\n", lpht->flags); + + TRACE("lpht->flags=0x%x\n", lpht->flags); if (uView == LVS_REPORT && subitem) { INT j; @@ -6303,7 +6303,7 @@ static INT WINAPI LISTVIEW_InsertCompare( LPVOID first, LPVOID second, LPARAM { ITEM_INFO* lv_first = (ITEM_INFO*) DPA_GetPtr( (HDPA)first, 0 ); ITEM_INFO* lv_second = (ITEM_INFO*) DPA_GetPtr( (HDPA)second, 0 ); - INT cmpv = textcmpWT(lv_first->hdr.pszText, lv_second->hdr.pszText, TRUE); + INT cmpv = textcmpWT(lv_first->hdr.pszText, lv_second->hdr.pszText, TRUE); /* if we're sorting descending, negate the return value */ return (((const LISTVIEW_INFO *)lParam)->dwStyle & LVS_SORTDESCENDING) ? -cmpv : cmpv; @@ -6343,7 +6343,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, if (!is_assignable_item(lpLVItem, infoPtr->dwStyle)) return -1; if (!(lpItem = Alloc(sizeof(ITEM_INFO)))) return -1; - + /* insert item in listview control data structure */ if ( !(hdpaSubItems = DPA_Create(8)) ) goto fail; if ( !DPA_SetPtr(hdpaSubItems, 0, lpItem) ) assert (FALSE); @@ -6407,7 +6407,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, goto undo; } } - + /* send LVN_INSERTITEM notification */ ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); nmlv.iItem = nItem; @@ -6460,11 +6460,11 @@ fail: static BOOL LISTVIEW_RedrawItems(const LISTVIEW_INFO *infoPtr, INT nFirst, INT nLast) { INT i; - - if (nLast < nFirst || min(nFirst, nLast) < 0 || + + if (nLast < nFirst || min(nFirst, nLast) < 0 || max(nFirst, nLast) >= infoPtr->nItemCount) return FALSE; - + for (i = nFirst; i <= nLast; i++) LISTVIEW_InvalidateItem(infoPtr, i); @@ -6517,11 +6517,11 @@ static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *infoPtr, INT dx, INT dy) default: /* icon */ dx = 0; break; - } + } if (dx != 0) LISTVIEW_HScroll(infoPtr, SB_INTERNAL, dx, 0); if (dy != 0) LISTVIEW_VScroll(infoPtr, SB_INTERNAL, dy, 0); - + return TRUE; } @@ -6655,7 +6655,7 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn, if (!lpColumn || nColumn < 0) return -1; nColumn = min(nColumn, DPA_GetPtrCount(infoPtr->hdpaColumns)); - + ZeroMemory(&hdi, sizeof(HDITEMW)); column_fill_hditem(infoPtr, &hdi, nColumn, lpColumn, isW); @@ -6679,13 +6679,13 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn, } /* insert item in header control */ - nNewColumn = SendMessageW(infoPtr->hwndHeader, + nNewColumn = SendMessageW(infoPtr->hwndHeader, isW ? HDM_INSERTITEMW : HDM_INSERTITEMA, (WPARAM)nColumn, (LPARAM)&hdi); if (nNewColumn == -1) return -1; if (nNewColumn != nColumn) ERR("nColumn=%d, nNewColumn=%d\n", nColumn, nNewColumn); - - /* create our own column info */ + + /* create our own column info */ if (!(lpColumnInfo = Alloc(sizeof(COLUMN_INFO)))) goto fail; if (DPA_InsertPtr(infoPtr->hdpaColumns, nNewColumn, lpColumnInfo) == -1) goto fail; @@ -6698,7 +6698,7 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn, SUBITEM_INFO *lpSubItem; HDPA hdpaSubItems; INT nItem, i; - + for (nItem = 0; nItem < infoPtr->nItemCount; nItem++) { hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); @@ -6714,7 +6714,7 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn, /* make space for the new column */ LISTVIEW_ScrollColumns(infoPtr, nNewColumn + 1, lpColumnInfo->rcHeader.right - lpColumnInfo->rcHeader.left); LISTVIEW_UpdateItemSize(infoPtr); - + return nNewColumn; fail: @@ -6748,7 +6748,7 @@ static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, BOOL bResult; TRACE("(nColumn=%d, lpColumn=%s, isW=%d)\n", nColumn, debuglvcolumn_t(lpColumn, isW), isW); - + if (!lpColumn || nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE; ZeroMemory(&hdi, sizeof(HDITEMW)); @@ -6769,7 +6769,7 @@ static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, { COLUMN_INFO *lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, nColumn); int oldFmt = lpColumnInfo->fmt; - + lpColumnInfo->fmt = lpColumn->fmt; if ((oldFmt ^ lpColumn->fmt) & (LVCFMT_JUSTIFYMASK | LVCFMT_IMAGE)) { @@ -6835,7 +6835,7 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx) else if (uView == LVS_LIST && cx < 1) return FALSE; /* resize all columns if in LVS_LIST mode */ - if(uView == LVS_LIST) + if(uView == LVS_LIST) { infoPtr->nItemWidth = cx; LISTVIEW_InvalidateList(infoPtr); @@ -6849,7 +6849,7 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx) INT nLabelWidth; LVITEMW lvItem; - lvItem.mask = LVIF_TEXT; + lvItem.mask = LVIF_TEXT; lvItem.iItem = 0; lvItem.iSubItem = nColumn; lvItem.pszText = szDispText; @@ -6871,7 +6871,7 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx) else if(cx == LVSCW_AUTOSIZE_USEHEADER) { /* if iCol is the last column make it fill the remainder of the controls width */ - if(nColumn == DPA_GetPtrCount(infoPtr->hdpaColumns) - 1) + if(nColumn == DPA_GetPtrCount(infoPtr->hdpaColumns) - 1) { RECT rcHeader; POINT Origin; @@ -6952,7 +6952,7 @@ static HIMAGELIST LISTVIEW_CreateCheckBoxIL(const LISTVIEW_INFO *infoPtr) SelectObject(hdc, hbm_im); DrawFrameControl(hdc, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_MONO); SelectObject(hdc, hbm_orig); - ImageList_Add(himl, hbm_im, hbm_mask); + ImageList_Add(himl, hbm_im, hbm_mask); SelectObject(hdc, hbm_im); DrawFrameControl(hdc, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_MONO | DFCS_CHECKED); @@ -7004,7 +7004,7 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM } LISTVIEW_SetImageList(infoPtr, LVSIL_STATE, himl); } - + if((infoPtr->dwLvExStyle ^ dwOldStyle) & LVS_EX_HEADERDRAGDROP) { DWORD dwStyle = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE); @@ -7032,7 +7032,7 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM static HCURSOR LISTVIEW_SetHotCursor(LISTVIEW_INFO *infoPtr, HCURSOR hCursor) { HCURSOR oldCursor = infoPtr->hHotCursor; - + infoPtr->hHotCursor = hCursor; return oldCursor; @@ -7054,9 +7054,9 @@ static HCURSOR LISTVIEW_SetHotCursor(LISTVIEW_INFO *infoPtr, HCURSOR hCursor) static INT LISTVIEW_SetHotItem(LISTVIEW_INFO *infoPtr, INT iIndex) { INT iOldIndex = infoPtr->nHotItem; - + infoPtr->nHotItem = iIndex; - + return iOldIndex; } @@ -7075,9 +7075,9 @@ static INT LISTVIEW_SetHotItem(LISTVIEW_INFO *infoPtr, INT iIndex) static DWORD LISTVIEW_SetHoverTime(LISTVIEW_INFO *infoPtr, DWORD dwHoverTime) { DWORD oldHoverTime = infoPtr->dwHoverTime; - + infoPtr->dwHoverTime = dwHoverTime; - + return oldHoverTime; } @@ -7099,10 +7099,10 @@ static DWORD LISTVIEW_SetIconSpacing(LISTVIEW_INFO *infoPtr, INT cx, INT cy) UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; TRACE("requested=(%d,%d)\n", cx, cy); - + /* this is supported only for LVS_ICON style */ if (uView != LVS_ICON) return oldspacing; - + /* set to defaults, if instructed to */ if (cx == -1) cx = GetSystemMetrics(SM_CXICONSPACING); if (cy == -1) cy = GetSystemMetrics(SM_CYICONSPACING); @@ -7114,16 +7114,16 @@ static DWORD LISTVIEW_SetIconSpacing(LISTVIEW_INFO *infoPtr, INT cx, INT cy) cx = infoPtr->iconSpacing.cx; /* if 0 then compute height */ - if (cy == 0) + if (cy == 0) cy = infoPtr->iconSize.cy + 2 * infoPtr->ntmHeight + ICON_BOTTOM_PADDING + ICON_TOP_PADDING + LABEL_VERT_PADDING; - + infoPtr->iconSpacing.cx = cx; infoPtr->iconSpacing.cy = cy; TRACE("old=(%d,%d), new=(%d,%d), iconSize=(%d,%d), ntmH=%d\n", - LOWORD(oldspacing), HIWORD(oldspacing), cx, cy, + LOWORD(oldspacing), HIWORD(oldspacing), cx, cy, infoPtr->iconSize.cx, infoPtr->iconSize.cy, infoPtr->ntmHeight); @@ -7136,7 +7136,7 @@ static DWORD LISTVIEW_SetIconSpacing(LISTVIEW_INFO *infoPtr, INT cx, INT cy) static inline void set_icon_size(SIZE *size, HIMAGELIST himl, BOOL small) { INT cx, cy; - + if (himl && ImageList_GetIconSize(himl, &cx, &cy)) { size->cx = cx; @@ -7253,11 +7253,11 @@ static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFl INT nFrom, nTo; POINT Origin; RECT rcErase; - + LISTVIEW_GetOrigin(infoPtr, &Origin); nFrom = min(nOldCount, nItems); nTo = max(nOldCount, nItems); - + if (uView == LVS_REPORT) { rcErase.left = 0; @@ -7330,11 +7330,11 @@ static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, POINT pt LISTVIEW_GetOrigin(infoPtr, &Origin); /* This point value seems to be an undocumented feature. - * The best guess is that it means either at the origin, + * The best guess is that it means either at the origin, * or at true beginning of the list. I will assume the origin. */ if ((pt.x == -1) && (pt.y == -1)) pt = Origin; - + if (uView == LVS_ICON) { pt.x -= (infoPtr->nItemWidth - infoPtr->iconSize.cx) / 2; @@ -7438,16 +7438,16 @@ static BOOL LISTVIEW_SetItemTextT(LISTVIEW_INFO *infoPtr, INT nItem, const LVITE LVITEMW lvItem; if (nItem < 0 && nItem >= infoPtr->nItemCount) return FALSE; - + lvItem.iItem = nItem; lvItem.iSubItem = lpLVItem->iSubItem; lvItem.mask = LVIF_TEXT; lvItem.pszText = lpLVItem->pszText; lvItem.cchTextMax = lpLVItem->cchTextMax; - + TRACE("(nItem=%d, lpLVItem=%s, isW=%d)\n", nItem, debuglvitem_t(&lvItem, isW), isW); - return LISTVIEW_SetItemT(infoPtr, &lvItem, isW); + return LISTVIEW_SetItemT(infoPtr, &lvItem, isW); } /*** @@ -7493,7 +7493,7 @@ static BOOL LISTVIEW_SetTextBkColor(LISTVIEW_INFO *infoPtr, COLORREF clrTextBk) infoPtr->clrTextBk = clrTextBk; LISTVIEW_InvalidateList(infoPtr); } - + return TRUE; } @@ -7624,7 +7624,7 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare, /* FIXME: go thorugh selected items and mark them so in lpItem->state */ /* clear the lpItem->state for non-selected ones */ /* remove the selection ranges */ - + infoPtr->pfnCompare = pfnCompare; infoPtr->lParamSort = lParamSort; DPA_Sort(infoPtr->hdpaItems, LISTVIEW_CallBackCompare, (LPARAM)infoPtr); @@ -7970,7 +7970,7 @@ static inline BOOL LISTVIEW_EraseBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc) return LISTVIEW_FillBkgnd(infoPtr, hdc, &rc); } - + /*** * DESCRIPTION: @@ -7985,7 +7985,7 @@ static inline BOOL LISTVIEW_EraseBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc) static void scroll_list(LISTVIEW_INFO *infoPtr, INT dx, INT dy) { /* now we can scroll the list */ - ScrollWindowEx(infoPtr->hwndSelf, dx, dy, &infoPtr->rcList, + ScrollWindowEx(infoPtr->hwndSelf, dx, dy, &infoPtr->rcList, &infoPtr->rcList, 0, 0, SW_ERASE | SW_INVALIDATE); /* if we have focus, adjust rect */ OffsetRect(&infoPtr->rcFocus, dx, dy); @@ -8012,7 +8012,7 @@ static void scroll_list(LISTVIEW_INFO *infoPtr, INT dx, INT dy) * for LVS_LIST cannot occur * */ -static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, +static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, INT nScrollDiff, HWND hScrollWnd) { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; @@ -8020,7 +8020,7 @@ static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, SCROLLINFO scrollInfo; BOOL is_an_icon; - TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, + TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, debugscrollcode(nScrollCode), nScrollDiff); if (infoPtr->hwndEdit) SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); @@ -8065,7 +8065,7 @@ static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, /* quit right away if pos isn't changing */ if (nScrollDiff == 0) return 0; - + /* calculate new position, and handle overflows */ nNewScrollPos = scrollInfo.nPos + nScrollDiff; if (nScrollDiff > 0) { @@ -8082,15 +8082,15 @@ static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, scrollInfo.fMask = SIF_POS; scrollInfo.nPos = nNewScrollPos; nNewScrollPos = SetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo, TRUE); - + /* carry on only if it really changed */ if (nNewScrollPos == nOldScrollPos) return 0; - + /* now adjust to client coordinates */ nScrollDiff = nOldScrollPos - nNewScrollPos; if (uView == LVS_REPORT) nScrollDiff *= infoPtr->nItemHeight; - - /* and scroll the window */ + + /* and scroll the window */ scroll_list(infoPtr, 0, nScrollDiff); return 0; @@ -8124,7 +8124,7 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, INT nOldScrollPos, nNewScrollPos; SCROLLINFO scrollInfo; - TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, + TRACE("(nScrollCode=%d(%s), nScrollDiff=%d)\n", nScrollCode, debugscrollcode(nScrollCode), nScrollDiff); if (infoPtr->hwndEdit) SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); @@ -8168,7 +8168,7 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, /* quit right away if pos isn't changing */ if (nScrollDiff == 0) return 0; - + /* calculate new position, and handle overflows */ nNewScrollPos = scrollInfo.nPos + nScrollDiff; if (nScrollDiff > 0) { @@ -8185,17 +8185,17 @@ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, scrollInfo.fMask = SIF_POS; scrollInfo.nPos = nNewScrollPos; nNewScrollPos = SetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo, TRUE); - + /* carry on only if it really changed */ if (nNewScrollPos == nOldScrollPos) return 0; - + if(uView == LVS_REPORT) LISTVIEW_UpdateHeaderSize(infoPtr, nNewScrollPos); - + /* now adjust to client coordinates */ nScrollDiff = nOldScrollPos - nNewScrollPos; if (uView == LVS_LIST) nScrollDiff *= infoPtr->nItemWidth; - + /* and scroll the window */ scroll_list(infoPtr, nScrollDiff, 0); @@ -8367,19 +8367,19 @@ static LRESULT LISTVIEW_KillFocus(LISTVIEW_INFO *infoPtr) /* if we did not have the focus, there's nothing to do */ if (!infoPtr->bFocus) return 0; - + /* send NM_KILLFOCUS notification */ if (!notify(infoPtr, NM_KILLFOCUS)) return 0; /* if we have a focus rectagle, get rid of it */ LISTVIEW_ShowFocusRect(infoPtr, FALSE); - + /* set window focus flag */ infoPtr->bFocus = FALSE; /* invalidate the selected items before reseting focus flag */ LISTVIEW_InvalidateSelectedItems(infoPtr); - + return 0; } @@ -8400,7 +8400,7 @@ static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, LVHITTESTINFO htInfo; TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); - + /* Cancel the item edition if any */ if (infoPtr->itemEdit.fEnabled) { @@ -8514,7 +8514,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN LVITEMW item; bGroupSelect = (LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED) == 0); - + item.state = (bGroupSelect ? LVIS_SELECTED : 0) | LVIS_FOCUSED; item.stateMask = LVIS_SELECTED | LVIS_FOCUSED; LISTVIEW_SetItemState(infoPtr, nItem, &item); @@ -8540,7 +8540,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN LISTVIEW_DeselectAll(infoPtr); ReleaseCapture(); } - + if (bReceivedFocus) infoPtr->nEditLabelItem = -1; @@ -8562,7 +8562,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y) { LVHITTESTINFO lvHitTestInfo; - + TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); if (!infoPtr->bLButtonDown) return 0; @@ -8658,26 +8658,26 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; HWND hwndSelf = infoPtr->hwndSelf; - + TRACE("(lpnmh=%p)\n", lpnmh); if (!lpnmh || lpnmh->iItem < 0 || lpnmh->iItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0; - + switch (lpnmh->hdr.code) - { + { case HDN_TRACKW: case HDN_TRACKA: { COLUMN_INFO *lpColumnInfo; POINT ptOrigin; INT x; - + if (!lpnmh->pitem || !(lpnmh->pitem->mask & HDI_WIDTH)) break; /* remove the old line (if any) */ LISTVIEW_DrawTrackLine(infoPtr); - + /* compute & draw the new line */ lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, lpnmh->iItem); x = lpColumnInfo->rcHeader.left + lpnmh->pitem->cxy; @@ -8686,28 +8686,28 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE LISTVIEW_DrawTrackLine(infoPtr); break; } - + case HDN_ENDTRACKA: case HDN_ENDTRACKW: /* remove the track line (if any) */ LISTVIEW_DrawTrackLine(infoPtr); infoPtr->xTrackLine = -1; break; - + case HDN_ENDDRAG: FIXME("Changing column order not implemented\n"); return TRUE; - + case HDN_ITEMCHANGINGW: case HDN_ITEMCHANGINGA: return notify_forward_header(infoPtr, lpnmh); - + case HDN_ITEMCHANGEDW: case HDN_ITEMCHANGEDA: { COLUMN_INFO *lpColumnInfo; INT dx, cxy; - + notify_forward_header(infoPtr, lpnmh); if (!IsWindow(hwndSelf)) break; @@ -8715,14 +8715,14 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE if (!lpnmh->pitem || !(lpnmh->pitem->mask & HDI_WIDTH)) { HDITEMW hdi; - + hdi.mask = HDI_WIDTH; if (!Header_GetItemW(infoPtr->hwndHeader, lpnmh->iItem, &hdi)) return 0; cxy = hdi.cxy; } else cxy = lpnmh->pitem->cxy; - + /* determine how much we change since the last know position */ lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, lpnmh->iItem); dx = cxy - (lpColumnInfo->rcHeader.right - lpColumnInfo->rcHeader.left); @@ -8742,10 +8742,10 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE { POINT ptOrigin; RECT rcCol = lpColumnInfo->rcHeader; - + LISTVIEW_GetOrigin(infoPtr, &ptOrigin); OffsetRect(&rcCol, ptOrigin.x, 0); - + rcCol.top = infoPtr->rcList.top; rcCol.bottom = infoPtr->rcList.bottom; @@ -8852,9 +8852,9 @@ static LRESULT LISTVIEW_NotifyFormat(LISTVIEW_INFO *infoPtr, HWND hwndFrom, INT TRACE("(hwndFrom=%p, nCommand=%d)\n", hwndFrom, nCommand); if (nCommand != NF_REQUERY) return 0; - + infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); - + return 0; } @@ -8876,7 +8876,7 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc) if (infoPtr->bNoItemMetrics && infoPtr->nItemCount) { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; - + infoPtr->bNoItemMetrics = FALSE; LISTVIEW_UpdateItemSize(infoPtr); if (uView == LVS_ICON || uView == LVS_SMALLICON) @@ -8886,7 +8886,7 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc) UpdateWindow(infoPtr->hwndHeader); - if (hdc) + if (hdc) LISTVIEW_Refresh(infoPtr, hdc, NULL); else { @@ -8946,7 +8946,7 @@ static LRESULT LISTVIEW_PrintClient(LISTVIEW_INFO *infoPtr, HDC hdc, DWORD optio static LRESULT LISTVIEW_RButtonDblClk(const LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y) { LVHITTESTINFO lvHitTestInfo; - + TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); /* send NM_RELEASEDCAPTURE notification */ @@ -8993,7 +8993,7 @@ static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN lvHitTestInfo.pt.x = x; lvHitTestInfo.pt.y = y; nItem = LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE); - + if ((nItem >= 0) && (nItem < infoPtr->nItemCount)) { LISTVIEW_SetItemFocus(infoPtr, nItem); @@ -9029,7 +9029,7 @@ static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); if (!infoPtr->bRButtonDown) return 0; - + /* set button flag */ infoPtr->bRButtonDown = FALSE; @@ -9098,7 +9098,7 @@ static LRESULT LISTVIEW_SetFocus(LISTVIEW_INFO *infoPtr, HWND hwndLoseFocus) /* if we have the focus already, there's nothing to do */ if (infoPtr->bFocus) return 0; - + /* send NM_SETFOCUS notification */ if (!notify(infoPtr, NM_SETFOCUS)) return 0; @@ -9134,7 +9134,7 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra infoPtr->hFont = hFont ? hFont : infoPtr->hDefaultFont; if (infoPtr->hFont == oldFont) return 0; - + LISTVIEW_SaveTextMetrics(infoPtr); if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT) @@ -9167,7 +9167,7 @@ static LRESULT LISTVIEW_SetRedraw(LISTVIEW_INFO *infoPtr, BOOL bRedraw) infoPtr->bRedraw = bRedraw; if(!bRedraw) return 0; - + if (is_autoarrange(infoPtr)) LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); LISTVIEW_UpdateScroll(infoPtr); @@ -9200,17 +9200,17 @@ static LRESULT LISTVIEW_Size(LISTVIEW_INFO *infoPtr, int Width, int Height) LISTVIEW_UpdateSize(infoPtr); if (EqualRect(&rcOld, &infoPtr->rcList)) return 0; - - /* do not bother with display related stuff if we're not redrawing */ + + /* do not bother with display related stuff if we're not redrawing */ if (!is_redrawing(infoPtr)) return 0; - - if (is_autoarrange(infoPtr)) + + if (is_autoarrange(infoPtr)) LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); LISTVIEW_UpdateScroll(infoPtr); /* refresh all only for lists whose height changed significantly */ - if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_LIST && + if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_LIST && (rcOld.bottom - rcOld.top) / infoPtr->nItemHeight != (infoPtr->rcList.bottom - infoPtr->rcList.top) / infoPtr->nItemHeight) LISTVIEW_InvalidateList(infoPtr); @@ -9233,7 +9233,7 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr) UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; TRACE("uView=%d, rcList(old)=%s\n", uView, wine_dbgstr_rect(&infoPtr->rcList)); - + GetClientRect(infoPtr->hwndSelf, &infoPtr->rcList); if (uView == LVS_LIST) @@ -9288,7 +9288,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, wStyleType, lpss->styleOld, lpss->styleNew); if (wStyleType != GWL_STYLE) return 0; - + /* FIXME: if LVS_NOSORTHEADER changed, update header */ /* what if LVS_OWNERDATA changed? */ /* or LVS_SINGLESEL */ @@ -9308,7 +9308,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, { SIZE oldIconSize = infoPtr->iconSize; HIMAGELIST himl; - + SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); ShowWindow(infoPtr->hwndHeader, SW_HIDE); @@ -9317,7 +9317,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, himl = (uNewView == LVS_ICON ? infoPtr->himlNormal : infoPtr->himlSmall); set_icon_size(&infoPtr->iconSize, himl, uNewView != LVS_ICON); - + if (uNewView == LVS_ICON) { if ((infoPtr->iconSize.cx != oldIconSize.cx) || (infoPtr->iconSize.cy != oldIconSize.cy)) @@ -9343,7 +9343,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, if (uNewView == LVS_REPORT) ShowWindow(infoPtr->hwndHeader, (lpss->styleNew & LVS_NOCOLUMNHEADER) ? SW_HIDE : SW_SHOWNORMAL); - + if ( (uNewView == LVS_ICON || uNewView == LVS_SMALLICON) && (uNewView != uOldView || ((lpss->styleNew ^ lpss->styleOld) & LVS_ALIGNMASK)) ) LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); @@ -9845,7 +9845,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_MouseWheel(infoPtr, (short int)HIWORD(wParam)); case WM_WINDOWPOSCHANGED: - if (!(((WINDOWPOS *)lParam)->flags & SWP_NOSIZE)) + if (!(((WINDOWPOS *)lParam)->flags & SWP_NOSIZE)) { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | diff --git a/reactos/dll/win32/comctl32/pager.c b/reactos/dll/win32/comctl32/pager.c index f3773249ff5..34286177e2a 100644 --- a/reactos/dll/win32/comctl32/pager.c +++ b/reactos/dll/win32/comctl32/pager.c @@ -21,7 +21,7 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 18, 2004, by Robert Shearman. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features or bugs please note them below. @@ -43,11 +43,11 @@ * * IMPLEMENTATION NOTES: * This control uses WM_NCPAINT instead of WM_PAINT to paint itself - * as we need to scroll a child window. In order to do this we move + * as we need to scroll a child window. In order to do this we move * the child window in the control's client area, using the clipping - * region that is automatically set around the client area. As the - * entire client area now consists of the child window, we must - * allocate space (WM_NCCALCSIZE) for the buttons and draw them as + * region that is automatically set around the client area. As the + * entire client area now consists of the child window, we must + * allocate space (WM_NCCALCSIZE) for the buttons and draw them as * a non-client area (WM_NCPAINT). * Robert Shearman */ @@ -493,7 +493,7 @@ PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns) SWP_NOZORDER | SWP_NOACTIVATE); /* repaint when changing any state */ - repaintBtns = (oldTLbtnState != infoPtr->TLbtnState) || + repaintBtns = (oldTLbtnState != infoPtr->TLbtnState) || (oldBRbtnState != infoPtr->BRbtnState); if (repaintBtns) SendMessageW(infoPtr->hwndSelf, WM_NCPAINT, 0, 0); @@ -1236,7 +1236,7 @@ PAGER_Size (PAGER_INFO* infoPtr, INT type, INT x, INT y) } -static LRESULT +static LRESULT PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss) { DWORD oldStyle = infoPtr->dwStyle; @@ -1245,7 +1245,7 @@ PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lp wStyleType, lpss->styleOld, lpss->styleNew); if (wStyleType != GWL_STYLE) return 0; - + infoPtr->dwStyle = lpss->styleNew; if ((oldStyle ^ lpss->styleNew) & (PGS_HORZ | PGS_VERT)) diff --git a/reactos/dll/win32/comctl32/progress.c b/reactos/dll/win32/comctl32/progress.c index d3b7ded976c..171e00b6e96 100644 --- a/reactos/dll/win32/comctl32/progress.c +++ b/reactos/dll/win32/comctl32/progress.c @@ -19,10 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. @@ -364,12 +364,12 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) { RECT cntRect; int part = (dwStyle & PBS_VERTICAL) ? PP_BARVERT : PP_BAR; - - GetThemeBackgroundContentRect (pdi.theme, hdc, part, 0, &pdi.rect, + + GetThemeBackgroundContentRect (pdi.theme, hdc, part, 0, &pdi.rect, &cntRect); - + /* Exclude content rect - content background will be drawn later */ - ExcludeClipRect (hdc, cntRect.left, cntRect.top, + ExcludeClipRect (hdc, cntRect.left, cntRect.top, cntRect.right, cntRect.bottom); if (IsThemeBackgroundPartiallyTransparent (pdi.theme, part, 0)) DrawThemeParentBackground (infoPtr->Self, hdc, NULL); @@ -402,7 +402,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) if (ledMEnd > leds) { - /* case 1: the marquee bar extends over the end and wraps around to + /* case 1: the marquee bar extends over the end and wraps around to * the start */ const int gapStart = max((ledMEnd - leds) * ledW, 0); const int gapEnd = min(infoPtr->MarqueePos * ledW, barSize); @@ -475,12 +475,12 @@ static LRESULT PROGRESS_Timer (PROGRESS_INFO *infoPtr, INT idTimer) get_client_rect (infoPtr->Self, &rect); if(!barSmooth) - ledWidth = get_led_size( infoPtr, style, &rect ) + + ledWidth = get_led_size( infoPtr, style, &rect ) + get_led_gap( infoPtr ); else ledWidth = 1; - leds = (get_bar_size( style, &rect ) + ledWidth - 1) / + leds = (get_bar_size( style, &rect ) + ledWidth - 1) / ledWidth; /* increment the marquee progress */ @@ -556,7 +556,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case WM_CREATE: { DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); - + theme = OpenThemeData (hwnd, themeClass); dwExStyle &= ~(WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE); @@ -614,18 +614,18 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case WM_THEMECHANGED: { DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); - + theme = GetWindowTheme (hwnd); CloseThemeData (theme); theme = OpenThemeData (hwnd, themeClass); - + /* WS_EX_STATICEDGE disappears when the control is themed */ if (theme) dwExStyle &= ~WS_EX_STATICEDGE; else dwExStyle |= WS_EX_STATICEDGE; SetWindowLongW (hwnd, GWL_EXSTYLE, dwExStyle); - + InvalidateRect (hwnd, NULL, FALSE); return 0; } diff --git a/reactos/dll/win32/comctl32/propsheet.c b/reactos/dll/win32/comctl32/propsheet.c index 83ab8318f3b..15dcbc9f88a 100644 --- a/reactos/dll/win32/comctl32/propsheet.c +++ b/reactos/dll/win32/comctl32/propsheet.c @@ -22,7 +22,7 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 12, 2004, by Filip Navara. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. @@ -157,7 +157,7 @@ static const WCHAR PropSheetInfoStr[] = /* Wizard metrics specified in DLUs */ #define WIZARD_PADDING 7 #define WIZARD_HEADER_HEIGHT 36 - + /****************************************************************************** * Prototypes */ @@ -212,7 +212,7 @@ static VOID PROPSHEET_UnImplementedFlags(DWORD dwFlags) static void PROPSHEET_GetPageRect(const PropSheetInfo * psInfo, HWND hwndDlg, RECT *rc, LPCPROPSHEETPAGEW ppshpage) { - if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) { + if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) { HWND hwndChild; RECT r; @@ -990,7 +990,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, * All buttons will be at this y coordinate. */ y = rcSheet.bottom - (padding.y + buttonHeight); - + /* * Position the Back button. */ @@ -1005,9 +1005,9 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, * Position the Next button. */ hwndButton = GetDlgItem(hwndParent, IDC_NEXT_BUTTON); - + x += buttonWidth; - + SetWindowPos(hwndButton, 0, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); @@ -1015,7 +1015,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, * Position the Finish button. */ hwndButton = GetDlgItem(hwndParent, IDC_FINISH_BUTTON); - + if (psInfo->hasFinish) x += padding.x + buttonWidth; @@ -1051,7 +1051,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, ShowWindow(hwndButton, SW_HIDE); if (psInfo->ppshheader.dwFlags & - (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE)) + (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW | PSH_WIZARD_LITE)) padding.x = 0; /* @@ -1067,7 +1067,7 @@ static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, /* * Position and resize the header sunken line. */ - + SetWindowPos(hwndLineHeader, 0, 0, 0, rcSheet.right, 2, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); if (!(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW))) @@ -1327,10 +1327,10 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate) while (nrofitems > 0) { p = (WORD*)(((DWORD_PTR)p + 3) & ~3); /* DWORD align */ - + /* skip header */ p += (istemplateex ? sizeof(MyDLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE))/sizeof(WORD); - + /* check class */ switch ((WORD)*p) { @@ -1365,7 +1365,7 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate) p += *p / sizeof(WORD) + 1; /* Skip extra data */ --nrofitems; } - + ret = (p - (const WORD*)pTemplate) * sizeof(WORD); TRACE("%p %p size 0x%08x\n", p, pTemplate, ret); return ret; @@ -1445,7 +1445,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent, temp = Alloc(resSize); if (!temp) return FALSE; - + TRACE("copying pTemplate %p into temp %p (%d)\n", pTemplate, temp, resSize); memcpy(temp, pTemplate, resSize); pTemplate = temp; @@ -1521,13 +1521,13 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo) { if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) { - /* if PSH_USEHBMWATERMARK is not set, load the resource from pszbmWatermark - and put the HBITMAP in hbmWatermark. Thus all the rest of the code always + /* if PSH_USEHBMWATERMARK is not set, load the resource from pszbmWatermark + and put the HBITMAP in hbmWatermark. Thus all the rest of the code always considers hbmWatermark as valid. */ if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) && !(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK)) { - ((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark = + ((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark = CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0); } @@ -1535,7 +1535,7 @@ static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo) if ((psInfo->ppshheader.dwFlags & PSH_HEADER) && !(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)) { - ((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader = + ((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader = CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT_PTR)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0); } } @@ -1590,7 +1590,7 @@ static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo) { hwndLineHeader = GetDlgItem(hwndDlg, IDC_SUNKEN_LINEHEADER); ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage; - + if ((ppshpage->dwFlags & PSP_HIDEHEADER) || (!(psInfo->ppshheader.dwFlags & PSH_HEADER)) ) ShowWindow(hwndLineHeader, SW_HIDE); else @@ -2447,7 +2447,7 @@ EnumChildProc(HWND hwnd, LPARAM lParam) SetFocus(hwnd); return FALSE; } - } + } else { EnumChildWindows(hwnd, EnumChildProc, 0); @@ -2490,7 +2490,7 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) { /* Hide the Next button */ ShowWindow(hwndNext, SW_HIDE); - + /* Show the Finish button */ ShowWindow(hwndFinish, SW_SHOW); @@ -2532,7 +2532,7 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) /* Now try to find an edit control that deserves focus */ EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0); - + } /****************************************************************************** @@ -3276,12 +3276,12 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) hdcSrc = CreateCompatibleDC(0); ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[psInfo->active_page].hpage; - if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK) + if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK) hOldPal = SelectPalette(hdc, psInfo->ppshheader.hplWatermark, FALSE); if ( (!(ppshpage->dwFlags & PSP_HIDEHEADER)) && (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) && - (psInfo->ppshheader.dwFlags & PSH_HEADER) ) + (psInfo->ppshheader.dwFlags & PSH_HEADER) ) { HWND hwndLineHeader = GetDlgItem(hwnd, IDC_SUNKEN_LINEHEADER); HFONT hOldFont; @@ -3295,7 +3295,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2); SetRect(&rzone, 0, 0, r.right + 1, r.top - 1); - GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), (LPVOID)&bm); + GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), (LPVOID)&bm); if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD) { @@ -3345,7 +3345,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) } clrOld = SetTextColor (hdc, 0x00000000); - oldBkMode = SetBkMode (hdc, TRANSPARENT); + oldBkMode = SetBkMode (hdc, TRANSPARENT); if (ppshpage->dwFlags & PSP_USEHEADERTITLE) { SetRect(&r, 20, 10, 0, 0); @@ -3388,9 +3388,9 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) if ( (ppshpage->dwFlags & PSP_HIDEHEADER) && (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) && - (psInfo->ppshheader.dwFlags & PSH_WATERMARK) ) + (psInfo->ppshheader.dwFlags & PSH_WATERMARK) ) { - HWND hwndLine = GetDlgItem(hwnd, IDC_SUNKEN_LINE); + HWND hwndLine = GetDlgItem(hwnd, IDC_SUNKEN_LINE); GetClientRect(hwndLine, &r); MapWindowPoints(hwndLine, hwnd, (LPPOINT) &r, 2); @@ -3423,10 +3423,10 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) DeleteObject(hbr); } - SelectObject(hdcSrc, hbmp); + SelectObject(hdcSrc, hbmp); } - if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK) + if (psInfo->ppshheader.dwFlags & PSH_USEHPLWATERMARK) SelectPalette(hdc, hOldPal, FALSE); DeleteDC(hdcSrc); @@ -3478,7 +3478,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) psInfo->hFont = CreateFontIndirectW (&logFont); logFont.lfWeight = FW_BOLD; psInfo->hFontBold = CreateFontIndirectW (&logFont); - + /* * Small icon in the title bar. */ @@ -3612,7 +3612,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return FALSE; } - + case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); return FALSE; diff --git a/reactos/dll/win32/comctl32/rebar.c b/reactos/dll/win32/comctl32/rebar.c index 9f11146b8c4..b56f96615cf 100644 --- a/reactos/dll/win32/comctl32/rebar.c +++ b/reactos/dll/win32/comctl32/rebar.c @@ -21,7 +21,7 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 19, 2004, by Robert Shearman. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features or bugs please note them below. @@ -430,7 +430,7 @@ static void translate_rect(const REBAR_INFO *infoPtr, RECT *dest, const RECT *sr tmp = src->left; dest->left = src->top; dest->top = tmp; - + tmp = src->right; dest->right = src->bottom; dest->bottom = tmp; @@ -626,7 +626,7 @@ REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand) { if (theme) { - int stateId; + int stateId; if (lpBand->fDraw & DRAW_CHEVRONPUSHED) stateId = CHEVS_PRESSED; else if (lpBand->fDraw & DRAW_CHEVRONHOT) @@ -1568,8 +1568,8 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan (lpBand->cyMaxChild != lprbbi->cyMaxChild ) || (lpBand->cyIntegral != lprbbi->cyIntegral ) ) ) || ( (lprbbi->cbSize < sizeof (REBARBANDINFOA)) && - ( (lpBand->cyChild || - lpBand->cyMaxChild || + ( (lpBand->cyChild || + lpBand->cyMaxChild || lpBand->cyIntegral ) ) ) ) ) { lpBand->cxMinChild = lprbbi->cxMinChild; @@ -2725,13 +2725,13 @@ REBAR_Create (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } TRACE("created!\n"); - + if ((theme = OpenThemeData (infoPtr->hwndSelf, themeClass))) { /* native seems to clear WS_BORDER when themed */ infoPtr->dwStyle &= ~WS_BORDER; } - + return 0; } @@ -2767,7 +2767,7 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) DestroyCursor (infoPtr->hcurDrag); if(infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont); SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); - + CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); /* free rebar info data */ @@ -3326,7 +3326,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) infoPtr->fStatus, lParam); return 0; } - + /* FIXME: wrong */ if (infoPtr->dwStyle & RBS_AUTOSIZE) { NMRBAUTOSIZE autosize; diff --git a/reactos/dll/win32/comctl32/status.c b/reactos/dll/win32/comctl32/status.c index 47480834197..8106ba9c3dd 100644 --- a/reactos/dll/win32/comctl32/status.c +++ b/reactos/dll/win32/comctl32/status.c @@ -20,14 +20,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 24, 2002, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * * TODO: * -- CCS_BOTTOM (default) * -- CCS_LEFT @@ -115,13 +115,13 @@ STATUSBAR_DrawSizeGrip (HTHEME theme, HDC hdc, LPRECT lpRect) INT i; TRACE("draw size grip %d,%d - %d,%d\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); - + if (theme) { RECT gripperRect; SIZE gripperSize; gripperRect = *lpRect; - if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect, + if (SUCCEEDED (GetThemePartSize (theme, hdc, SP_GRIPPER, 0, lpRect, TS_DRAW, &gripperSize))) { gripperRect.left = gripperRect.right - gripperSize.cx; @@ -635,7 +635,7 @@ STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height) GetClientRect (infoPtr->Notify, &parent_rect); infoPtr->height = height + infoPtr->verticalBorder; - + if ((theme = GetWindowTheme (infoPtr->Self))) { /* Determine bar height from theme such that the content area is @@ -650,7 +650,7 @@ STATUSBAR_SetMinHeight (STATUS_INFO *infoPtr, INT height) } ReleaseDC (infoPtr->Self, hdc); } - + width = parent_rect.right - parent_rect.left; x = parent_rect.left; y = parent_rect.bottom - infoPtr->height; @@ -958,7 +958,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) infoPtr->parts[0].x = -1; infoPtr->parts[0].style = 0; infoPtr->parts[0].hIcon = 0; - + OpenThemeData (hwnd, themeClass); if (IsWindowUnicode (hwnd)) { @@ -1029,7 +1029,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) GetClientRect (infoPtr->Notify, &rect); width = rect.right - rect.left; infoPtr->height = textHeight + 4 + infoPtr->verticalBorder; - + if ((theme = GetWindowTheme (hwnd))) { /* Determine bar height from theme such that the content area is @@ -1044,7 +1044,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) } ReleaseDC (hwnd, hdc); } - + SetWindowPos(hwnd, 0, lpCreate->x, lpCreate->y - 1, width, infoPtr->height, SWP_NOZORDER); STATUSBAR_SetPartBounds (infoPtr); diff --git a/reactos/dll/win32/comctl32/string.c b/reactos/dll/win32/comctl32/string.c index f6dbd8c5589..1019d4c2e6b 100644 --- a/reactos/dll/win32/comctl32/string.c +++ b/reactos/dll/win32/comctl32/string.c @@ -680,9 +680,9 @@ LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch) LPSTR lpszRet = NULL; WORD ch1, ch2; INT iLen; - + TRACE("(%s,%s)\n", debugstr_a(lpszStr), debugstr_a(lpszSearch)); - + if (!lpszStr || !lpszSearch || !*lpszSearch) return NULL; diff --git a/reactos/dll/win32/comctl32/syslink.c b/reactos/dll/win32/comctl32/syslink.c index ac3e4648072..cc1e12e5de2 100644 --- a/reactos/dll/win32/comctl32/syslink.c +++ b/reactos/dll/win32/comctl32/syslink.c @@ -21,7 +21,7 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Apr. 4, 2005, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. @@ -148,7 +148,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN Item->nText = textlen; Item->Type = type; Item->Blocks = NULL; - + if(LastItem != NULL) { LastItem->Next = Item; @@ -157,9 +157,9 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN { infoPtr->Items = Item; } - + lstrcpynW(Item->Text, Text, textlen + 1); - + return Item; } @@ -170,7 +170,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr) { PDOC_ITEM Item, Next; - + Item = infoPtr->Items; while(Item != NULL) { @@ -178,7 +178,7 @@ static VOID SYSLINK_ClearDoc (SYSLINK_INFO *infoPtr) SYSLINK_FreeDocItem(Item); Item = Next; } - + infoPtr->Items = NULL; } @@ -225,7 +225,7 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text) tmp = current + taglen; lpID = NULL; lpUrl = NULL; - + CheckParameter: /* compare the current position with all known parameters */ if(!StrCmpNIW(tmp, SL_HREF, 6)) @@ -246,7 +246,7 @@ CheckParameter: { ValidParam = FALSE; } - + if(ValidParam) { /* we got a known parameter, now search until the next " character. @@ -290,7 +290,7 @@ CheckParameter: tmp++; } } - + if(ValidLink && ValidParam) { /* the tag appears to be valid. save all information @@ -326,7 +326,7 @@ CheckParameter: textstart = NULL; textlen = 0; } - + /* now it's time to add the link to the document */ current += 4; if(linktext != NULL && linklen > 0) @@ -389,7 +389,7 @@ CheckParameter: textstart = current; } } - + textlen += taglen; current += taglen; } @@ -403,11 +403,11 @@ CheckParameter: { textstart = current; } - + current++; } } - + if(textstart != NULL && textlen > 0) { Last = SYSLINK_AppendDocItem(infoPtr, textstart, textlen, CurrentType, Last); @@ -482,12 +482,12 @@ static VOID SYSLINK_RepaintLink (const SYSLINK_INFO *infoPtr, const DOC_ITEM *Do ERR("DocItem not a link!\n"); return; } - + bl = DocItem->Blocks; if (bl != NULL) { n = DocItem->nText; - + while(n > 0) { InvalidateRect(infoPtr->Self, &bl->rc, TRUE); @@ -570,7 +570,7 @@ static PDOC_ITEM SYSLINK_GetPrevLink (const SYSLINK_INFO *infoPtr, PDOC_ITEM Cur { /* returns the last link */ PDOC_ITEM Last = NULL; - + for(Current = infoPtr->Items; Current != NULL; Current = Current->Next) { if(Current->Type == slLink) @@ -584,7 +584,7 @@ static PDOC_ITEM SYSLINK_GetPrevLink (const SYSLINK_INFO *infoPtr, PDOC_ITEM Cur { /* returns the previous link */ PDOC_ITEM Cur, Prev = NULL; - + for(Cur = infoPtr->Items; Cur != NULL; Cur = Cur->Next) { if(Cur == Current) @@ -617,7 +617,7 @@ static BOOL SYSLINK_WrapLine (HDC hdc, LPWSTR Text, WCHAR BreakChar, int *LineLe *LineLen = nFit; Current = Text + nFit; - + /* check if we're in the middle of a word */ if((*Current) != BreakChar) { @@ -627,7 +627,7 @@ static BOOL SYSLINK_WrapLine (HDC hdc, LPWSTR Text, WCHAR BreakChar, int *LineLe Current--; (*LineLen)--; } - + if((*LineLen) == 0) { Extent->cx = 0; @@ -661,13 +661,13 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect) rc.right = MAXLONG; if (rc.bottom - SL_TOPMARGIN < 0) rc.bottom = MAXLONG; - + hOldFont = SelectObject(hdc, infoPtr->Font); - + x = SL_LEFTMARGIN; y = SL_TOPMARGIN; LineHeight = 0; - + for(Current = infoPtr->Items; Current != NULL; Current = Current->Next) { int n, nBlocks; @@ -697,7 +697,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect) { SelectObject(hdc, infoPtr->LinkFont); } - + while(n > 0) { int SkipChars = 0; @@ -719,7 +719,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect) int LineLen = n; BOOL Wrap = FALSE; PDOC_TEXTBLOCK nbl; - + if(n != 0) { Wrap = SYSLINK_WrapLine(hdc, tx, infoPtr->BreakChar, &LineLen, nFit, &szDim, rc.right - x); @@ -756,7 +756,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect) } } } - + nbl = ReAlloc(bl, (nBlocks + 1) * sizeof(DOC_TEXTBLOCK)); if (nbl != NULL) { @@ -764,7 +764,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect) nBlocks++; cbl = bl + nBlocks - 1; - + cbl->nChars = LineLen; cbl->nSkip = SkipChars; cbl->rc.left = x; @@ -813,7 +813,7 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect) Current->Blocks = bl; } } - + SelectObject(hdc, hOldFont); pRect->right = pRect->left + szDoc.cx; @@ -834,7 +834,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc) hOldFont = SelectObject(hdc, infoPtr->Font); OldTextColor = SetTextColor(hdc, infoPtr->TextColor); OldBkColor = SetBkColor(hdc, GetSysColor(COLOR_BTNFACE)); - + GetClientRect(infoPtr->Self, &rc); rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN; rc.bottom -= SL_BOTTOMMARGIN + SL_TOPMARGIN; @@ -846,7 +846,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc) int n; LPWSTR tx; PDOC_TEXTBLOCK bl; - + bl = Current->Blocks; if(bl != NULL) { @@ -885,7 +885,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc) SetBkColor(hdc, OldBkColor); SetTextColor(hdc, OldTextColor); SelectObject(hdc, hOldFont); - + return 0; } @@ -921,7 +921,7 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw) RECT rcClient; HFONT hOldFont = infoPtr->Font; infoPtr->Font = hFont; - + /* free the underline font */ if(infoPtr->LinkFont != NULL) { @@ -952,12 +952,12 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw) ReleaseDC(infoPtr->Self, hdc); } } - + if(bRedraw) { RedrawWindow(infoPtr->Self, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW); } - + return hOldFont; } @@ -971,12 +971,12 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text) /* clear the document */ SYSLINK_ClearDoc(infoPtr); - + if(Text == NULL || (textlen = lstrlenW(Text)) == 0) { return TRUE; } - + /* let's parse the string and create a document */ if(SYSLINK_ParseText(infoPtr, Text) > 0) { @@ -995,7 +995,7 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text) } } } - + return TRUE; } @@ -1008,7 +1008,7 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text) static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_ITEM *DocItem) { PDOC_ITEM Current, PrevFocus = NULL; - + for(Current = infoPtr->Items; Current != NULL; Current = Current->Next) { if(Current->Type == slLink) @@ -1017,7 +1017,7 @@ static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_IT { PrevFocus = Current; } - + if(Current == DocItem) { Current->u.Link.state |= LIS_FOCUSED; @@ -1028,7 +1028,7 @@ static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_IT } } } - + return PrevFocus; } @@ -1109,16 +1109,16 @@ static LRESULT SYSLINK_SetItem (const SYSLINK_INFO *infoPtr, const LITEM *Item) /* copy the bits */ di->u.Link.state |= (Item->state & Item->stateMask) & LIS_MASK; Repaint = (oldstate != di->u.Link.state); - + /* update the focus */ SYSLINK_SetFocusLink(infoPtr, ((di->u.Link.state & LIS_FOCUSED) ? di : NULL)); } - + if(Repaint) { SYSLINK_RepaintLink(infoPtr, di); } - + return TRUE; } @@ -1129,20 +1129,20 @@ static LRESULT SYSLINK_SetItem (const SYSLINK_INFO *infoPtr, const LITEM *Item) static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item) { PDOC_ITEM di; - + if(!(Item->mask & LIF_ITEMINDEX) || !(Item->mask & (LIF_FLAGSMASK))) { ERR("Invalid Flags!\n"); return FALSE; } - + di = SYSLINK_GetLinkItemByIndex(infoPtr, Item->iLink); if(di == NULL) { ERR("Link %d couldn't be found\n", Item->iLink); return FALSE; } - + if(Item->mask & LIF_STATE) { Item->state = (di->u.Link.state & Item->stateMask); @@ -1152,7 +1152,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item) Item->state &= ~LIS_FOCUSED; } } - + if(Item->mask & LIF_ITEMID) { if(di->u.Link.szID) @@ -1164,7 +1164,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item) Item->szID[0] = 0; } } - + if(Item->mask & LIF_URL) { if(di->u.Link.szUrl) @@ -1176,7 +1176,7 @@ static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item) Item->szUrl[0] = 0; } } - + return TRUE; } @@ -1204,7 +1204,7 @@ static BOOL SYSLINK_PtInDocItem (const DOC_ITEM *DocItem, POINT pt) bl++; } } - + return FALSE; } @@ -1248,7 +1248,7 @@ static LRESULT SYSLINK_HitTest (const SYSLINK_INFO *infoPtr, PLHITTESTINFO HitTe id++; } } - + return FALSE; } @@ -1264,7 +1264,7 @@ static LRESULT SYSLINK_GetIdealHeight (const SYSLINK_INFO *infoPtr) LRESULT height; TEXTMETRICW tm; HGDIOBJ hOldFont = SelectObject(hdc, infoPtr->Font); - + if(GetTextMetricsW(hdc, &tm)) { height = tm.tmHeight; @@ -1275,7 +1275,7 @@ static LRESULT SYSLINK_GetIdealHeight (const SYSLINK_INFO *infoPtr) } SelectObject(hdc, hOldFont); ReleaseDC(infoPtr->Self, hdc); - + return height; } return 0; @@ -1324,7 +1324,7 @@ static LRESULT SYSLINK_SendParentNotify (const SYSLINK_INFO *infoPtr, UINT code, static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow) { PDOC_ITEM Focus; - + infoPtr->HasFocus = TRUE; /* We always select the first link, even if we activated the control using @@ -1334,9 +1334,9 @@ static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow) { SYSLINK_SetFocusLink(infoPtr, Focus); } - + SYSLINK_RepaintLink(infoPtr, Focus); - + return 0; } @@ -1347,10 +1347,10 @@ static LRESULT SYSLINK_SetFocus (SYSLINK_INFO *infoPtr, HWND PrevFocusWindow) static LRESULT SYSLINK_KillFocus (SYSLINK_INFO *infoPtr, HWND NewFocusWindow) { PDOC_ITEM Focus; - + infoPtr->HasFocus = FALSE; Focus = SYSLINK_GetFocusLink(infoPtr, NULL); - + if(Focus != NULL) { SYSLINK_RepaintLink(infoPtr, Focus); @@ -1421,7 +1421,7 @@ static LRESULT SYSLINK_LButtonUp (SYSLINK_INFO *infoPtr, DWORD Buttons, const PO { PDOC_ITEM Current; int id; - + Current = SYSLINK_LinkAtPt(infoPtr, pt, &id, TRUE); if((Current != NULL) && (Current->u.Link.state & LIS_FOCUSED) && (infoPtr->MouseDownID == id)) { @@ -1444,7 +1444,7 @@ static BOOL SYSLINK_OnEnter (const SYSLINK_INFO *infoPtr) { PDOC_ITEM Focus; int id; - + Focus = SYSLINK_GetFocusLink(infoPtr, &id); if(Focus != NULL) { @@ -1561,10 +1561,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, { LHITTESTINFO ht; DWORD mp = GetMessagePos(); - + ht.pt.x = (short)LOWORD(mp); ht.pt.y = (short)HIWORD(mp); - + ScreenToClient(infoPtr->Self, &ht.pt); if(SYSLINK_HitTest (infoPtr, &ht)) { @@ -1614,7 +1614,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, pt.y = (short)HIWORD(lParam); return SYSLINK_LButtonUp(infoPtr, wParam, &pt); } - + case WM_KEYDOWN: { switch(wParam) @@ -1631,7 +1631,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, } goto HandleDefaultMessage; } - + case WM_GETDLGCODE: { LRESULT Ret = DLGC_HASSETSEL; @@ -1657,14 +1657,14 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, } return Ret; } - + case WM_NCHITTEST: { POINT pt; RECT rc; pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam); - + GetClientRect(infoPtr->Self, &rc); ScreenToClient(infoPtr->Self, &pt); if(pt.x < 0 || pt.y < 0 || pt.x > rc.right || pt.y > rc.bottom) @@ -1676,7 +1676,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message, { return HTCLIENT; } - + return HTTRANSPARENT; } diff --git a/reactos/dll/win32/comctl32/tab.c b/reactos/dll/win32/comctl32/tab.c index d3cf0fd0c26..3708a4b1b1a 100644 --- a/reactos/dll/win32/comctl32/tab.c +++ b/reactos/dll/win32/comctl32/tab.c @@ -887,7 +887,7 @@ static LRESULT TAB_AdjustRect(const TAB_INFO *infoPtr, WPARAM fLarger, LPRECT pr ((lStyle & TCS_BUTTONS)? 3 * (infoPtr->uNumRows - 1) : 0); /* Inflate the rectangle for the padding */ - InflateRect(prc, DISPLAY_AREA_PADDINGX, DISPLAY_AREA_PADDINGY); + InflateRect(prc, DISPLAY_AREA_PADDINGX, DISPLAY_AREA_PADDINGY); /* Inflate for the border */ InflateRect(prc, CONTROL_BORDER_SIZEX, CONTROL_BORDER_SIZEY); @@ -1098,7 +1098,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) /* Now use hPadding and vPadding */ infoPtr->uHItemPadding = infoPtr->uHItemPadding_s; infoPtr->uVItemPadding = infoPtr->uVItemPadding_s; - + /* The leftmost item will be "0" aligned */ curItemLeftPos = 0; curItemRowCount = infoPtr->uNumItem ? 1 : 0; @@ -1125,7 +1125,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) * Make sure there is enough space for the letters + icon + growing the * selected item + extra space for the selected item. */ - infoPtr->tabHeight = item_height + + infoPtr->tabHeight = item_height + ((lStyle & TCS_BUTTONS) ? 2 : 1) * infoPtr->uVItemPadding; @@ -1150,7 +1150,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) for (curItem = 0; curItem < infoPtr->uNumItem; curItem++) { TAB_ITEM *curr = TAB_GetItem(infoPtr, curItem); - + /* Set the leftmost position of the tab. */ curr->rect.left = curItemLeftPos; @@ -1203,7 +1203,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) */ if (((lStyle & TCS_MULTILINE) || (lStyle & TCS_VERTICAL)) && - (curr->rect.right > + (curr->rect.right > (clientRect.right - CONTROL_BORDER_SIZEX - DISPLAY_AREA_PADDINGX))) { curr->rect.right -= curr->rect.left; @@ -1283,7 +1283,7 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) { /* normalize the current rect */ TAB_ITEM *curr = TAB_GetItem(infoPtr, iItm); - + /* shift the item to the left side of the clientRect */ curr->rect.right -= curr->rect.left; curr->rect.left = 0; @@ -1501,7 +1501,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect HPEN holdPen; INT oldBkMode; HFONT hOldFont; - + /* if (drawRect == NULL) */ { BOOL isVisible; @@ -1530,7 +1530,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect *drawRect = selectedRect; else *drawRect = itemRect; - + if (lStyle & TCS_BUTTONS) { if (iItem == infoPtr->iSelected) @@ -1634,8 +1634,8 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect */ oldBkMode = SetBkMode(hdc, TRANSPARENT); if (!GetWindowTheme (infoPtr->hwnd) || (lStyle & TCS_BUTTONS)) - SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked) - && !(lStyle & TCS_FLATBUTTONS)) + SetTextColor(hdc, (((lStyle & TCS_HOTTRACK) && (iItem == infoPtr->iHotTracked) + && !(lStyle & TCS_FLATBUTTONS)) | (TAB_GetItem(infoPtr, iItem)->dwState & TCIS_HIGHLIGHTED)) ? comctl32_color.clrHighlight : comctl32_color.clrBtnText); @@ -1670,7 +1670,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect dis.itemState = 0; if ( iItem == infoPtr->iSelected ) dis.itemState |= ODS_SELECTED; - if (infoPtr->uFocus == iItem) + if (infoPtr->uFocus == iItem) dis.itemState |= ODS_FOCUS; dis.hwndItem = infoPtr->hwnd; dis.hDC = hdc; @@ -1713,7 +1713,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect { INT cx; INT cy; - + ImageList_GetIconSize(infoPtr->himl, &cx, &cy); if(lStyle & TCS_VERTICAL) @@ -1738,10 +1738,10 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect if (center_offset_h < 2) center_offset_h = 2; - + if (center_offset_v < 0) center_offset_v = 0; - + TRACE("for <%s>, c_o_h=%d, c_o_v=%d, draw=(%d,%d)-(%d,%d), textlen=%d\n", debugstr_w(item->pszText), center_offset_h, center_offset_v, drawRect->left, drawRect->top, drawRect->right, drawRect->bottom, @@ -1963,7 +1963,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem) if (iItem == infoPtr->iSelected) { DrawEdge(hdc, &r, EDGE_SUNKEN, BF_SOFT|BF_RECT); - + OffsetRect(&r, 1, 1); } else /* ! selected */ @@ -1998,7 +1998,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem) * Windows draws even side or bottom tabs themed, with wacky results. * However, since in Wine apps may get themed that did not opt in via * a manifest avoid theming when we know the result will be wrong */ - if ((theme = GetWindowTheme (infoPtr->hwnd)) + if ((theme = GetWindowTheme (infoPtr->hwnd)) && ((lStyle & (TCS_VERTICAL | TCS_BOTTOM)) == 0)) { static const int partIds[8] = { @@ -2506,13 +2506,13 @@ static void TAB_InvalidateTabArea(const TAB_INFO *infoPtr) if (infoPtr->uNumRows == 1) rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET; } - else + else { rInvalidate.bottom = rAdjClient.top; if (infoPtr->uNumRows == 1) rInvalidate.right = clientRect.left + rect.right + 2 * SELECTED_TAB_OFFSET; } - + /* Punch out the updown control */ if (infoPtr->needsScrolling && (rInvalidate.right > 0)) { RECT r; @@ -2522,11 +2522,11 @@ static void TAB_InvalidateTabArea(const TAB_INFO *infoPtr) else rInvalidate.right = clientRect.right - r.left; } - + TRACE("invalidate (%d,%d)-(%d,%d)\n", rInvalidate.left, rInvalidate.top, rInvalidate.right, rInvalidate.bottom); - + InvalidateRect(infoPtr->hwnd, &rInvalidate, TRUE); } @@ -2627,7 +2627,7 @@ TAB_InsertItemT (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode) memcpy(item->extra, &pti->lParam, infoPtr->cbInfo); else memset(item->extra, 0, infoPtr->cbInfo); - + TAB_SetItemBounds(infoPtr); if (infoPtr->uNumItem > 1) TAB_InvalidateTabArea(infoPtr); @@ -2688,7 +2688,7 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx) return oldcx; } -static inline LRESULT +static inline LRESULT TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight) { LPDWORD lpState; @@ -2697,7 +2697,7 @@ TAB_HighlightItem (TAB_INFO *infoPtr, INT iItem, BOOL fHighlight) if (!infoPtr || iItem < 0 || iItem >= infoPtr->uNumItem) return FALSE; - + lpState = &TAB_GetItem(infoPtr, iItem)->dwState; if (fHighlight) @@ -3019,7 +3019,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) } OpenThemeData (infoPtr->hwnd, themeClass); - + /* * We need to get text information so we need a DC and we need to select * a font. @@ -3080,7 +3080,7 @@ TAB_Destroy (TAB_INFO *infoPtr) KillTimer(infoPtr->hwnd, TAB_HOTTRACK_TIMER); CloseThemeData (GetWindowTheme (infoPtr->hwnd)); - + Free (infoPtr); return 0; } @@ -3112,7 +3112,7 @@ TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo) /* FIXME: MSDN says this is not allowed, but this hasn't been verified */ return FALSE; } - + infoPtr->cbInfo = cbInfo; return TRUE; } diff --git a/reactos/dll/win32/comctl32/theme_combo.c b/reactos/dll/win32/comctl32/theme_combo.c index af6eee8dbb7..38a26b2ee6f 100644 --- a/reactos/dll/win32/comctl32/theme_combo.c +++ b/reactos/dll/win32/comctl32/theme_combo.c @@ -82,7 +82,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c */ CopyRect (&rectEdit, &cbi->rcItem); InflateRect( &rectEdit, -1, -1 ); - + if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) { DRAWITEMSTRUCT dis; @@ -158,7 +158,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c if( hPrevFont ) SelectObject(hdc, hPrevFont ); - + HeapFree( GetProcessHeap(), 0, pText ); } @@ -179,10 +179,10 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state) { RECT frameRect; int buttonState; - + cbi.cbSize = sizeof (cbi); SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi); - + /* paint border */ if ((dwStyle & CBS_DROPDOWNLIST) != CBS_SIMPLE) GetClientRect (hwnd, &frameRect); @@ -190,14 +190,14 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state) { CopyRect (&frameRect, &cbi.rcItem); - InflateRect(&frameRect, - EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE, + InflateRect(&frameRect, + EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE, EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE); } - - DrawThemeBackground (theme, hDC, 0, + + DrawThemeBackground (theme, hDC, 0, IsWindowEnabled (hwnd) ? CBXS_NORMAL : CBXS_DISABLED, &frameRect, NULL); - + /* paint button */ if (cbi.stateButton != STATE_SYSTEM_INVISIBLE) { @@ -209,7 +209,7 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state) buttonState = CBXS_HOT; else buttonState = CBXS_NORMAL; - DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState, + DrawThemeBackground (theme, hDC, CP_DROPDOWNBUTTON, buttonState, &cbi.rcButton, NULL); } @@ -228,21 +228,21 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state) /********************************************************************** * The combo control subclass window proc. */ -LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam, +LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, ULONG_PTR dwRefData) { const WCHAR* themeClass = WC_COMBOBOXW; HTHEME theme; LRESULT result; - + switch (msg) { case WM_CREATE: result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); OpenThemeData( hwnd, themeClass ); return result; - + case WM_DESTROY: theme = GetWindowTheme( hwnd ); CloseThemeData ( theme ); @@ -253,21 +253,21 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, CloseThemeData ( theme ); OpenThemeData( hwnd, themeClass ); break; - + case WM_SYSCOLORCHANGE: theme = GetWindowTheme( hwnd ); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, * which will do the repaint. */ break; - + case WM_PAINT: theme = GetWindowTheme( hwnd ); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); return paint (theme, hwnd, (HDC)wParam, dwRefData); case WM_SETREDRAW: - /* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in + /* Since there doesn't seem to be WM_GETREDRAW, do redraw tracking in * the subclass as well. */ if( wParam ) dwRefData &= ~STATE_NOREDRAW; @@ -275,7 +275,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, dwRefData |= STATE_NOREDRAW; THEMING_SetSubclassData (hwnd, dwRefData); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); - + case WM_MOUSEMOVE: { /* Dropdown button hot-tracking */ @@ -286,7 +286,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, pt.y = (short)HIWORD(lParam); cbi.cbSize = sizeof (cbi); SendMessageW (hwnd, CB_GETCOMBOBOXINFO, 0, (LPARAM)&cbi); - + if (cbi.stateButton != STATE_SYSTEM_INVISIBLE) { if (PtInRect (&cbi.rcButton, pt)) @@ -295,7 +295,7 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, { dwRefData |= STATE_HOT; THEMING_SetSubclassData (hwnd, dwRefData); - RedrawWindow (hwnd, &cbi.rcButton, 0, + RedrawWindow (hwnd, &cbi.rcButton, 0, RDW_INVALIDATE | RDW_UPDATENOW); } } @@ -305,15 +305,15 @@ LRESULT CALLBACK THEMING_ComboSubclassProc (HWND hwnd, UINT msg, { dwRefData &= ~STATE_HOT; THEMING_SetSubclassData (hwnd, dwRefData); - RedrawWindow (hwnd, &cbi.rcButton, 0, + RedrawWindow (hwnd, &cbi.rcButton, 0, RDW_INVALIDATE | RDW_UPDATENOW); } } } } return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); - - default: + + default: /* Call old proc */ return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); } diff --git a/reactos/dll/win32/comctl32/theme_dialog.c b/reactos/dll/win32/comctl32/theme_dialog.c index 92859418e76..b9e56dc95ba 100644 --- a/reactos/dll/win32/comctl32/theme_dialog.c +++ b/reactos/dll/win32/comctl32/theme_dialog.c @@ -35,8 +35,8 @@ /********************************************************************** * The dialog subclass window proc. */ -LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, - WPARAM wParam, LPARAM lParam, +LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, + WPARAM wParam, LPARAM lParam, ULONG_PTR dwRefData) { HTHEME theme = GetWindowTheme ( hWnd ); @@ -44,14 +44,14 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, BOOL themingActive = IsThemeDialogTextureEnabled (hWnd); BOOL doTheming = themingActive && (theme != NULL); LRESULT result; - + switch (msg) { case WM_CREATE: result = THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); theme = OpenThemeData( hWnd, themeClass ); return result; - + case WM_DESTROY: CloseThemeData ( theme ); return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); @@ -61,13 +61,13 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, OpenThemeData( hWnd, themeClass ); InvalidateRect( hWnd, NULL, TRUE ); return 0; - + case WM_SYSCOLORCHANGE: if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, * which will do the repaint. */ break; - + case WM_ERASEBKGND: if (!doTheming) return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); { @@ -78,20 +78,20 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, /* Draw background*/ GetClientRect (hWnd, &rc); if (IsThemePartDefined (theme, WP_DIALOG, 0)) - /* Although there is a theme for the WINDOW class/DIALOG part, + /* Although there is a theme for the WINDOW class/DIALOG part, * but I[res] haven't seen Windows using it yet... Even when - * dialog theming is activated, the good ol' BTNFACE + * dialog theming is activated, the good ol' BTNFACE * background seems to be used. */ #if 0 - DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc, + DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc, NULL); #endif return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); - else - /* We might have gotten a TAB theme class, so check if we can + else + /* We might have gotten a TAB theme class, so check if we can * draw as a tab page. */ if (IsThemePartDefined (theme, TABP_BODY, 0)) - DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc, + DrawThemeBackground (theme, (HDC)wParam, TABP_BODY, 0, &rc, NULL); else return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); @@ -112,11 +112,11 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, WCHAR controlClass[32]; RECT rc; - GetClassNameW (controlWnd, controlClass, + GetClassNameW (controlWnd, controlClass, sizeof(controlClass) / sizeof(controlClass[0])); if (lstrcmpiW (controlClass, WC_STATICW) == 0) { - /* Static control - draw parent background and set text to + /* Static control - draw parent background and set text to * transparent, so it looks right on tab pages. */ GetClientRect (controlWnd, &rc); DrawThemeParentBackground (controlWnd, controlDC, &rc); @@ -132,7 +132,7 @@ LRESULT CALLBACK THEMING_DialogSubclassProc (HWND hWnd, UINT msg, return result; } - default: + default: /* Call old proc */ return THEMING_CallOriginalClass (hWnd, msg, wParam, lParam); } diff --git a/reactos/dll/win32/comctl32/theme_edit.c b/reactos/dll/win32/comctl32/theme_edit.c index b3b142a11db..e1fa1907019 100644 --- a/reactos/dll/win32/comctl32/theme_edit.c +++ b/reactos/dll/win32/comctl32/theme_edit.c @@ -46,26 +46,26 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region) int part = EP_EDITTEXT; int state = ETS_NORMAL; DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); - + if (!IsWindowEnabled (hwnd)) state = ETS_DISABLED; else if (dwStyle & ES_READONLY) state = ETS_READONLY; else if (GetFocus() == hwnd) state = ETS_FOCUSED; - + GetWindowRect(hwnd, &r); - + /* New clipping region passed to default proc to exclude border */ cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, r.right - cxEdge, r.bottom - cyEdge); if (region != (HRGN)1) CombineRgn (cliprgn, cliprgn, region, RGN_AND); OffsetRect(&r, -r.left, -r.top); - + dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); OffsetRect(&r, -r.left, -r.top); - + if (IsThemeBackgroundPartiallyTransparent (theme, part, state)) DrawThemeParentBackground(hwnd, dc, &r); DrawThemeBackground (theme, dc, part, state, &r, 0); @@ -79,21 +79,21 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region) /********************************************************************** * The edit control subclass window proc. */ -LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam, +LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, ULONG_PTR dwRefData) { const WCHAR* themeClass = WC_EDITW; HTHEME theme; LRESULT result; - + switch (msg) { case WM_CREATE: result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); OpenThemeData( hwnd, themeClass ); return result; - + case WM_DESTROY: theme = GetWindowTheme( hwnd ); CloseThemeData ( theme ); @@ -104,14 +104,14 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg, CloseThemeData ( theme ); OpenThemeData( hwnd, themeClass ); break; - + case WM_SYSCOLORCHANGE: theme = GetWindowTheme( hwnd ); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, * which will do the repaint. */ break; - + case WM_NCPAINT: theme = GetWindowTheme( hwnd ); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); @@ -120,11 +120,11 @@ LRESULT CALLBACK THEMING_EditSubclassProc (HWND hwnd, UINT msg, case WM_ENABLE: theme = GetWindowTheme( hwnd ); - if (theme) RedrawWindow (hwnd, NULL, NULL, + if (theme) RedrawWindow (hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); - - default: + + default: /* Call old proc */ return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); } diff --git a/reactos/dll/win32/comctl32/theme_listbox.c b/reactos/dll/win32/comctl32/theme_listbox.c index 8147ba4cf15..ffd0d052682 100644 --- a/reactos/dll/win32/comctl32/theme_listbox.c +++ b/reactos/dll/win32/comctl32/theme_listbox.c @@ -43,19 +43,19 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region) RECT r; int cxEdge = GetSystemMetrics (SM_CXEDGE), cyEdge = GetSystemMetrics (SM_CYEDGE); - + GetWindowRect(hwnd, &r); - + /* New clipping region passed to default proc to exclude border */ cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, r.right - cxEdge, r.bottom - cyEdge); if (region != (HRGN)1) CombineRgn (cliprgn, cliprgn, region, RGN_AND); OffsetRect(&r, -r.left, -r.top); - + dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); OffsetRect(&r, -r.left, -r.top); - + if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) DrawThemeParentBackground(hwnd, dc, &r); DrawThemeBackground (theme, dc, 0, 0, &r, 0); @@ -69,21 +69,21 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region) /********************************************************************** * The list control subclass window proc. */ -LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam, +LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, ULONG_PTR dwRefData) { const WCHAR* themeClass = WC_LISTBOXW; HTHEME theme; LRESULT result; - + switch (msg) { case WM_CREATE: result = THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); OpenThemeData( hwnd, themeClass ); return result; - + case WM_DESTROY: theme = GetWindowTheme( hwnd ); CloseThemeData ( theme ); @@ -94,21 +94,21 @@ LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND hwnd, UINT msg, CloseThemeData ( theme ); OpenThemeData( hwnd, themeClass ); break; - + case WM_SYSCOLORCHANGE: theme = GetWindowTheme( hwnd ); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, * which will do the repaint. */ break; - + case WM_NCPAINT: theme = GetWindowTheme( hwnd ); if (!theme) return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); nc_paint (theme, hwnd, (HRGN)wParam); break; - default: + default: /* Call old proc */ return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); } diff --git a/reactos/dll/win32/comctl32/theming.c b/reactos/dll/win32/comctl32/theming.c index e462f526b2c..df0043a0c26 100644 --- a/reactos/dll/win32/comctl32/theming.c +++ b/reactos/dll/win32/comctl32/theming.c @@ -68,7 +68,7 @@ static ATOM atSubclassProp; /* Generate a number of subclass window procs. * With a single proc alone, we can't really reliably find out the superclass, * so have one for each subclass. The subclass number is also stored in a prop - * since it's needed by THEMING_CallOriginalClass(). Then, the the subclass + * since it's needed by THEMING_CallOriginalClass(). Then, the the subclass * proc and ref data are fetched and the proc called. */ #define MAKE_SUBCLASS_PROC(N) \ @@ -109,9 +109,9 @@ static const WNDPROC subclassProcs[NUM_SUBCLASSES] = { void THEMING_Initialize (void) { int i; - static const WCHAR subclassPropName[] = + static const WCHAR subclassPropName[] = { 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 }; - static const WCHAR refDataPropName[] = + static const WCHAR refDataPropName[] = { 'C','C','3','2','T','h','e','m','i','n','g','D','a','t','a',0 }; if (!IsThemeActive()) return; @@ -128,10 +128,10 @@ void THEMING_Initialize (void) GetClassInfoExW (NULL, subclasses[i].className, &class); originalProcs[i] = class.lpfnWndProc; class.lpfnWndProc = subclassProcs[i]; - + if (!class.lpfnWndProc) { - ERR("Missing proc for class %s\n", + ERR("Missing proc for class %s\n", debugstr_w (subclasses[i].className)); continue; } @@ -143,7 +143,7 @@ void THEMING_Initialize (void) } else { - TRACE("Re-registered class %s\n", + TRACE("Re-registered class %s\n", debugstr_w (subclasses[i].className)); } } diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index 8ca4e6b2751..4cbe2114016 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -23,11 +23,11 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Mar. 14, 2004, by Robert Shearman. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features or bugs please note them below. - * + * * TODO: * - Styles: * - TBSTYLE_REGISTERDROP @@ -279,7 +279,7 @@ TOOLBAR_DumpButton(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *bP, INT btn_ { if (TRACE_ON(toolbar)){ TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08lx\n", - btn_num, bP->idCommand, GETIBITMAP(infoPtr, bP->iBitmap), + btn_num, bP->idCommand, GETIBITMAP(infoPtr, bP->iBitmap), bP->fsState, bP->fsStyle, bP->dwData, bP->iString); TRACE("string %s\n", debugstr_w(TOOLBAR_GetText(infoPtr,bP))); if (internal) @@ -341,7 +341,7 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, const TOOLBAR_INFO *infoPtr, UINT code) TRACE("to window %p, code=%08x, %s\n", infoPtr->hwndNotify, code, (infoPtr->bUnicode) ? "via Unicode" : "via ANSI"); - return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, + return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, (WPARAM)nmhdr->idFrom, (LPARAM)nmhdr); } @@ -706,10 +706,10 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, I } } else if (tbcd->nmcd.uItemState & CDIS_CHECKED || - ((tbcd->nmcd.uItemState & CDIS_HOT) + ((tbcd->nmcd.uItemState & CDIS_HOT) && ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)))) { - /* if hot, attempt to draw with hot image list, if fails, + /* if hot, attempt to draw with hot image list, if fails, use default image list */ himl = TOOLBAR_GetImageListForDrawing(infoPtr, btnPtr, IMAGE_LIST_HOT, &index); if (!himl) @@ -721,7 +721,7 @@ TOOLBAR_DrawImage(const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, I if (!himl) return; - if (!(dwItemCDFlag & TBCDRF_NOOFFSET) && + if (!(dwItemCDFlag & TBCDRF_NOOFFSET) && (tbcd->nmcd.uItemState & (CDIS_SELECTED | CDIS_CHECKED))) offset = 1; @@ -749,7 +749,7 @@ TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, DWORD BOOL non_interactive_state = (tbcd->nmcd.uItemState & CDIS_DISABLED) || (tbcd->nmcd.uItemState & CDIS_INDETERMINATE); BOOL pressed_look = !non_interactive_state && - ((tbcd->nmcd.uItemState & CDIS_SELECTED) || + ((tbcd->nmcd.uItemState & CDIS_SELECTED) || (tbcd->nmcd.uItemState & CDIS_CHECKED)); /* app don't want us to draw any edges */ @@ -820,7 +820,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr BOOL hasDropDownArrow = (TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && (btnPtr->fsStyle & BTNS_DROPDOWN)) || (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN); - BOOL drawSepDropDownArrow = hasDropDownArrow && + BOOL drawSepDropDownArrow = hasDropDownArrow && (~btnPtr->fsStyle & BTNS_WHOLEDROPDOWN); RECT rc, rcArrow, rcBitmap, rcText; LPWSTR lpText = NULL; @@ -839,8 +839,8 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr if (btnPtr->fsStyle & BTNS_SEP) { if (theme) { - DrawThemeBackground (theme, hdc, - (dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0, + DrawThemeBackground (theme, hdc, + (dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0, &rc, NULL); } else @@ -983,11 +983,11 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr (btnPtr->fsState & (TBSTATE_PRESSED | TBSTATE_CHECKED))) OffsetRect(&rcText, 1, 1); - if (!(tbcd.nmcd.uItemState & CDIS_HOT) && + if (!(tbcd.nmcd.uItemState & CDIS_HOT) && ((tbcd.nmcd.uItemState & CDIS_CHECKED) || (tbcd.nmcd.uItemState & CDIS_INDETERMINATE))) TOOLBAR_DrawPattern (&rc, &tbcd); - if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) + if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) && (tbcd.nmcd.uItemState & CDIS_HOT)) { if ( dwItemCDFlag & TBCDRF_HILITEHOTTRACK ) @@ -1006,7 +1006,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr { int partId = drawSepDropDownArrow ? TP_SPLITBUTTON : TP_BUTTON; int stateId = TS_NORMAL; - + if (tbcd.nmcd.uItemState & CDIS_DISABLED) stateId = TS_DISABLED; else if (tbcd.nmcd.uItemState & CDIS_SELECTED) @@ -1016,7 +1016,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr else if ((tbcd.nmcd.uItemState & CDIS_HOT) || (drawSepDropDownArrow && btnPtr->bDropDownPressed)) stateId = TS_HOT; - + DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL); } else @@ -1027,7 +1027,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr if (theme) { int stateId = TS_NORMAL; - + if (tbcd.nmcd.uItemState & CDIS_DISABLED) stateId = TS_DISABLED; else if (btnPtr->bDropDownPressed || (tbcd.nmcd.uItemState & CDIS_SELECTED)) @@ -1036,7 +1036,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr stateId = (tbcd.nmcd.uItemState & CDIS_HOT) ? TS_HOTCHECKED : TS_HOT; else if (tbcd.nmcd.uItemState & CDIS_HOT) stateId = TS_HOT; - + DrawThemeBackground (theme, hdc, TP_DROPDOWNBUTTON, stateId, &rcArrow, NULL); DrawThemeBackground (theme, hdc, TP_SPLITBUTTONDROPDOWN, stateId, &rcArrow, NULL); } @@ -1704,7 +1704,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd) { if (btnPtr->cx) cx = btnPtr->cx; - else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || + else if ((infoPtr->dwExStyle & TBSTYLE_EX_MIXEDBUTTONS) || (btnPtr->fsStyle & BTNS_AUTOSIZE)) { SIZE sz; @@ -1729,7 +1729,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd) /* if size has been set manually then don't add on extra space * for the drop down arrow */ - if (!btnPtr->cx && hasDropDownArrows && + if (!btnPtr->cx && hasDropDownArrows && ((btnPtr->fsStyle & BTNS_DROPDOWN) || (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN))) cx += DDARROW_WIDTH; } @@ -2353,7 +2353,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; TRACE("WM_INITDIALOG style: %x iItem(%d) idCommand(%d) iString(%ld) %s\n", - nmtb.tbButton.fsStyle, i, + nmtb.tbButton.fsStyle, i, nmtb.tbButton.idCommand, nmtb.tbButton.iString, nmtb.tbButton.iString >= 0 ? debugstr_w(infoPtr->strings[nmtb.tbButton.iString]) @@ -2369,7 +2369,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } else { - btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd, + btnInfo = (PCUSTOMBUTTON)SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_GETITEMDATA, index, 0); } @@ -2378,10 +2378,10 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (lstrlenW(nmtb.pszText)) lstrcpyW(btnInfo->text, nmtb.pszText); - else if (nmtb.tbButton.iString >= 0 && + else if (nmtb.tbButton.iString >= 0 && nmtb.tbButton.iString < infoPtr->nNumStrings) { - lstrcpyW(btnInfo->text, + lstrcpyW(btnInfo->text, infoPtr->strings[nmtb.tbButton.iString]); } } @@ -2605,9 +2605,9 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* draw image and text */ if ((btnInfo->btn.fsStyle & BTNS_SEP) == 0) { - HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr, + HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr, btnInfo->btn.iBitmap)); - ImageList_Draw (himl, GETIBITMAP(infoPtr, btnInfo->btn.iBitmap), + ImageList_Draw (himl, GETIBITMAP(infoPtr, btnInfo->btn.iBitmap), lpdis->hDC, rcButton.left+3, rcButton.top+3, ILD_NORMAL); } DrawTextW (lpdis->hDC, btnInfo->text, -1, &rcText, @@ -2677,12 +2677,12 @@ TOOLBAR_AddBitmapToImageList(TOOLBAR_INFO *infoPtr, HIMAGELIST himlDef, const TB ImageList_GetIconSize(himlDef, &cxIcon, &cyIcon); if (bitmap->hInst != COMCTL32_hModule) COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace); - + nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace); DeleteObject(hbmLoad); if (nIndex == -1) return FALSE; - + nCountAfter = ImageList_GetImageCount(himlDef); nAdded = nCountAfter - nCountBefore; if (bitmap->nButtons == 0) /* wParam == 0 is special and means add only one image */ @@ -2704,7 +2704,7 @@ TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr) HIMAGELIST himlNew; INT cx, cy; INT i; - + himlDef = GETDEFIMAGELIST(infoPtr, 0); if (himlDef == NULL || himlDef != infoPtr->himlInt) return; @@ -2800,7 +2800,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) info.nID = lpAddBmp->nID; TRACE("adding %d bitmaps!\n", info.nButtons); } - + /* check if the bitmap is already loaded and compute iSumButtons */ iSumButtons = 0; for (i = 0; i < infoPtr->nNumBitmapInfos; i++) @@ -3051,7 +3051,7 @@ TOOLBAR_AutoSize (HWND hwnd) if (infoPtr->dwStyle & CCS_NOPARENTALIGN) uPosFlags |= SWP_NOMOVE; - + if (!(infoPtr->dwStyle & CCS_NODIVIDER)) cy += GetSystemMetrics(SM_CYEDGE); @@ -3934,10 +3934,10 @@ TOOLBAR_MapAccelerator (HWND hwnd, WPARAM wParam, LPARAM lParam) UINT* pIDButton = (UINT*)lParam; WCHAR wszAccel[] = {'&',wAccel,0}; int i; - + TRACE("hwnd = %p, wAccel = %x(%s), pIDButton = %p\n", hwnd, wAccel, debugstr_wn(&wAccel,1), pIDButton); - + for (i = 0; i < infoPtr->nNumButtons; i++) { TBUTTON_INFO *btnPtr = infoPtr->buttons+i; @@ -3946,7 +3946,7 @@ TOOLBAR_MapAccelerator (HWND hwnd, WPARAM wParam, LPARAM lParam) { int iLen = strlenW(wszAccel); LPCWSTR lpszStr = TOOLBAR_GetText(infoPtr, btnPtr); - + if (!lpszStr) continue; @@ -4142,7 +4142,7 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) WARN("No hinst/bitmap found! hInst %p nID %lx\n", lpReplace->hInstOld, lpReplace->nIDOld); return FALSE; } - + /* copy the bitmap before adding it as ImageList_AddMasked modifies the * bitmap */ @@ -4272,7 +4272,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave) nmtbr.tbButton.idCommand = (int)*nmtbr.pCurrent; nmtbr.pCurrent++; - + TOOLBAR_SendNotify(&nmtbr.hdr, infoPtr, TBN_RESTORE); /* can't contain real string as we don't know whether @@ -4546,13 +4546,13 @@ TOOLBAR_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam) */ if (cx == 0) cx = 24; if (cy == 0) cx = 22; - + cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth); cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight); infoPtr->nButtonWidth = cx; infoPtr->nButtonHeight = cy; - + infoPtr->iTopMargin = default_top_margin(infoPtr); TOOLBAR_LayoutToolbar(hwnd); return TRUE; @@ -4622,7 +4622,7 @@ TOOLBAR_SetDisabledImageList (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->iVersion >= 5) id = wParam; - himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDis, + himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDis, &infoPtr->cimlDis, himl, id); /* FIXME: redraw ? */ @@ -4691,7 +4691,7 @@ TOOLBAR_SetHotImageList (HWND hwnd, WPARAM wParam, LPARAM lParam) TRACE("hwnd = %p, himl = %p, id = %d\n", hwnd, himl, id); - himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlHot, + himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlHot, &infoPtr->cimlHot, himl, id); /* FIXME: redraw ? */ @@ -4752,7 +4752,7 @@ TOOLBAR_SetHotItemEx (TOOLBAR_INFO *infoPtr, INT nHit, DWORD dwReason) infoPtr->nHotItem = nHit; } else - infoPtr->nHotItem = -1; + infoPtr->nHotItem = -1; } } } @@ -4767,7 +4767,7 @@ TOOLBAR_SetHotItem (HWND hwnd, WPARAM wParam) if ((INT)wParam > infoPtr->nNumButtons) return infoPtr->nHotItem; - + if ((INT)wParam < 0) wParam = -1; @@ -4795,7 +4795,7 @@ TOOLBAR_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->iVersion >= 5) id = wParam; - himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDef, + himlTemp = TOOLBAR_InsertImageList(&infoPtr->himlDef, &infoPtr->cimlDef, himl, id); infoPtr->nNumBitmaps = 0; @@ -4857,7 +4857,7 @@ TOOLBAR_SetInsertMark (HWND hwnd, WPARAM wParam, LPARAM lParam) return 0; } - if ((lptbim->iButton == -1) || + if ((lptbim->iButton == -1) || ((lptbim->iButton < infoPtr->nNumButtons) && (lptbim->iButton >= 0))) { @@ -4902,8 +4902,8 @@ TOOLBAR_SetMaxTextRows (HWND hwnd, WPARAM wParam, LPARAM lParam) * 1. It is not only used on buttons with the BTNS_AUTOSIZE style * 2. It is not used to create a blank area between the edge of the button * and the text or image if TBSTYLE_LIST is set. It is used to control - * the gap between the image and text. - * 3. It is not applied to both sides. If TBSTYLE_LIST is set it is used + * the gap between the image and text. + * 3. It is not applied to both sides. If TBSTYLE_LIST is set it is used * to control the bottom and right borders [with the border being * szPadding.cx - (GetSystemMetrics(SM_CXEDGE)+1)], otherwise the padding * is shared evenly on both sides of the button. @@ -5269,10 +5269,10 @@ static LRESULT TOOLBAR_Unkwn460(HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); TRACE("hwnd=%p iListGap=%ld\n", hwnd, wParam); - + if (lParam != 0) FIXME("lParam = 0x%08lx. Please report\n", lParam); - + infoPtr->iListGap = (INT)wParam; InvalidateRect(hwnd, NULL, TRUE); @@ -5395,13 +5395,13 @@ TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->dwStyle = dwStyle; infoPtr->tbim.iButton = -1; GetClientRect(hwnd, &infoPtr->client_rect); - infoPtr->bUnicode = infoPtr->hwndNotify && + infoPtr->bUnicode = infoPtr->hwndNotify && (NFR_UNICODE == SendMessageW(hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_REQUERY)); infoPtr->hwndToolTip = NULL; /* if needed the tooltip control will be created after a WM_MOUSEMOVE */ SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0); infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW (&logFont); - + OpenThemeData (hwnd, themeClass); TOOLBAR_CheckStyle (hwnd, dwStyle); @@ -5446,7 +5446,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) /* delete default font */ DeleteObject (infoPtr->hDefaultFont); - + CloseThemeData (GetWindowTheme (hwnd)); /* free toolbar info data */ @@ -5556,7 +5556,7 @@ TOOLBAR_SetRelativeHotItem(TOOLBAR_INFO *infoPtr, INT iDirection, DWORD dwReason nmtbwhi.idNew = infoPtr->buttons[nNewHotItem].idCommand; nmtbwhi.iDirection = iDirection; nmtbwhi.dwReason = dwReason; - + if (TOOLBAR_SendNotify(&nmtbwhi.hdr, infoPtr, TBN_WRAPHOTITEM)) return; } @@ -5662,7 +5662,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) { infoPtr->nButtonDrag = nHit; SetCapture (hwnd); - + /* If drag cursor has not been loaded, load it. * Note: it doesn't need to be freed */ if (!hCursorDrag) @@ -5678,7 +5678,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH); /* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */ - if ((btnPtr->fsState & TBSTATE_ENABLED) && + if ((btnPtr->fsState & TBSTATE_ENABLED) && ((btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) || ((btnPtr->fsStyle & BTNS_DROPDOWN) && ((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) || @@ -5719,7 +5719,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) nHit = TOOLBAR_InternalHitTest(hwnd, &pt); if (!infoPtr->bAnchor || (nHit >= 0)) TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE | HICF_LMOUSE); - + /* remove any left mouse button down or double-click messages * so that we can get a toggle effect on the button */ while (PeekMessageW(&msg, hwnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE) || @@ -5762,7 +5762,7 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData; } - ClientToScreen(hwnd, &pt); + ClientToScreen(hwnd, &pt); nmmouse.pt = pt; if (!TOOLBAR_SendNotify(&nmmouse.hdr, infoPtr, NM_LDOWN)) @@ -5928,7 +5928,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData; } - ClientToScreen(hwnd, &pt); + ClientToScreen(hwnd, &pt); nmmouse.pt = pt; if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_CLICK)) @@ -5958,7 +5958,7 @@ TOOLBAR_RButtonUp( HWND hwnd, WPARAM wParam, LPARAM lParam) nmmouse.dwItemData = infoPtr->buttons[nmmouse.dwHitInfo].dwData; } - ClientToScreen(hwnd, &pt); + ClientToScreen(hwnd, &pt); nmmouse.pt = pt; if (!TOOLBAR_SendNotify((LPNMHDR)&nmmouse, infoPtr, NM_RCLICK)) @@ -6055,10 +6055,10 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) TRACKMOUSEEVENT trackinfo; INT nHit; TBUTTON_INFO *btnPtr; - + if ((infoPtr->dwStyle & TBSTYLE_TOOLTIPS) && (infoPtr->hwndToolTip == NULL)) TOOLBAR_TooltipCreateControl(infoPtr); - + if ((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) { /* fill in the TRACKMOUSEEVENT struct */ trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); @@ -6087,7 +6087,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) nHit = TOOLBAR_InternalHitTest (hwnd, &pt); - if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) + if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) && (!infoPtr->bAnchor || (nHit >= 0))) TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE); @@ -6208,7 +6208,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam) * (Guy Albertelli 9/2001) * */ - if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) + if (((infoPtr->dwStyle & TBSTYLE_FLAT) || GetWindowTheme (infoPtr->hwndSelf)) && !(cs->style & TBSTYLE_TRANSPARENT)) styleadd |= TBSTYLE_TRANSPARENT; if (!(cs->style & (CCS_TOP | CCS_NOMOVEY))) { @@ -6493,9 +6493,9 @@ static LRESULT TOOLBAR_SetFont(HWND hwnd, WPARAM wParam, LPARAM lParam) { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(hwnd); - + TRACE("font=%p redraw=%ld\n", (HFONT)wParam, lParam); - + if (wParam == 0) infoPtr->hFont = infoPtr->hDefaultFont; else @@ -6616,7 +6616,7 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, const STYLESTRUCT *lpStyle) if ((dwOldStyle ^ lpStyle->styleNew) & COMMON_STYLES) { TOOLBAR_AutoSize (hwnd); - + InvalidateRect(hwnd, NULL, TRUE); } } @@ -7034,7 +7034,7 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SYSCOLORCHANGE: return TOOLBAR_SysColorChange (hwnd); - + case WM_THEMECHANGED: return theme_changed (hwnd); @@ -7183,7 +7183,7 @@ static BOOL TOOLBAR_GetButtonInfo(const TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb) { int ccht = strlen(nmtba.pszText); if (ccht) - MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1, + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1, nmtb->pszText, nmtb->cchText); memcpy(&nmtb->tbButton, &nmtba.tbButton, sizeof(TBBUTTON)); diff --git a/reactos/dll/win32/comctl32/tooltips.c b/reactos/dll/win32/comctl32/tooltips.c index 41d96a16860..eff84bd3439 100644 --- a/reactos/dll/win32/comctl32/tooltips.c +++ b/reactos/dll/win32/comctl32/tooltips.c @@ -22,11 +22,11 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 08, 2004, by Robert Shearman. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features or bugs please note them below. - * + * * TODO: * - Custom draw support. * - Animation. @@ -261,7 +261,7 @@ TOOLTIPS_Refresh (HWND hwnd, HDC hdc) BOOL icon_present; /* draw icon */ - icon_present = infoPtr->hTitleIcon && + icon_present = infoPtr->hTitleIcon && DrawIconEx(hdc, rc.left, rc.top, infoPtr->hTitleIcon, ICON_WIDTH, ICON_HEIGHT, 0, NULL, DI_NORMAL); if (icon_present) @@ -685,7 +685,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr) } hrStem = CreatePolygonRgn(pts, sizeof(pts) / sizeof(pts[0]), ALTERNATE); - + hRgn = CreateRoundRectRgn(0, (infoPtr->bToolBelow ? BALLOON_STEMHEIGHT : 0), rect.right - rect.left, @@ -696,7 +696,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr) DeleteObject(hrStem); SetWindowRgn(hwnd, hRgn, FALSE); - /* we don't free the region handle as the system deletes it when + /* we don't free the region handle as the system deletes it when * it is no longer needed */ } @@ -827,7 +827,7 @@ TOOLTIPS_TrackShow (HWND hwnd, TOOLTIPS_INFO *infoPtr) hRgn = CreateRoundRectRgn(0, 0, rect.right - rect.left, rect.bottom - rect.top, BALLOON_ROUNDEDNESS, BALLOON_ROUNDEDNESS); SetWindowRgn(hwnd, hRgn, FALSE); - /* we don't free the region handle as the system deletes it when + /* we don't free the region handle as the system deletes it when * it is no longer needed */ } diff --git a/reactos/dll/win32/comctl32/trackbar.c b/reactos/dll/win32/comctl32/trackbar.c index 1ae1f738770..7e3e9bedd89 100644 --- a/reactos/dll/win32/comctl32/trackbar.c +++ b/reactos/dll/win32/comctl32/trackbar.c @@ -20,14 +20,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 12, 2002, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * */ #include @@ -102,18 +102,18 @@ typedef struct static const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 }; -static inline int +static inline int notify_customdraw (const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage) { pnmcd->dwDrawStage = stage; - return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, + return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, pnmcd->hdr.idFrom, (LPARAM)pnmcd); } static LRESULT notify_hdr (const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh) { LRESULT result; - + TRACE("(code=%d)\n", code); pnmh->hwndFrom = infoPtr->hwndSelf; @@ -144,7 +144,7 @@ notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code) bVert ? WM_VSCROLL : WM_HSCROLL, (WPARAM)code, (LPARAM)infoPtr->hwndSelf); } - + static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr) { int i, tic, nrTics; @@ -474,8 +474,8 @@ TRACKBAR_DrawChannel (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) if (theme) { - DrawThemeBackground (theme, hdc, - (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT) ? + DrawThemeBackground (theme, hdc, + (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT) ? TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0); } else @@ -544,7 +544,7 @@ TRACKBAR_DrawOneTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int fla if (flags & TBS_VERT) x += len * side; else y += len * side; LineTo(hdc, x, y); - + if (flags & TIC_SELECTIONMARK) { if (flags & TBS_VERT) { x -= side; @@ -557,7 +557,7 @@ TRACKBAR_DrawOneTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int fla } else { x += 2 * indent; } - + LineTo(hdc, x, y); LineTo(hdc, ox, oy); } @@ -582,7 +582,7 @@ TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) }; HPEN hOldPen, hTicPen; HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - + if (theme) { int part = (dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS; @@ -605,7 +605,7 @@ TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lSelMax, ticFlags | TIC_SELECTIONMARKMAX); } - + /* clean up the pen, if we created one */ if (hTicPen) { SelectObject(hdc, hOldPen); @@ -625,7 +625,7 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) int fillClr; int PointDepth; HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - + if (theme) { int partId; @@ -636,7 +636,7 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) partId = (dwStyle & TBS_VERT) ? TKP_THUMBLEFT : TKP_THUMBTOP; else partId = (dwStyle & TBS_VERT) ? TKP_THUMBRIGHT : TKP_THUMBBOTTOM; - + if (dwStyle & WS_DISABLED) stateId = TUS_DISABLED; else if (infoPtr->flags & TB_DRAG_MODE) @@ -645,9 +645,9 @@ TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) stateId = TUS_HOT; else stateId = TUS_NORMAL; - + DrawThemeBackground (theme, hdc, partId, stateId, &thumb, 0); - + return; } @@ -839,7 +839,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED); GetClientRect (infoPtr->hwndSelf, &rcClient); - + /* try to render offscreen, if we fail, carrry onscreen */ hdc = CreateCompatibleDC(hdcDst); if (hdc) { @@ -864,7 +864,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) nmcd.rc = rcClient; gcdrf = notify_customdraw(infoPtr, &nmcd, CDDS_PREPAINT); if (gcdrf & CDRF_SKIPDEFAULT) goto cleanup; - + /* Erase backbround */ if (gcdrf == CDRF_DODEFAULT || notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { @@ -875,7 +875,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) if (gcdrf != CDRF_DODEFAULT) notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE); } - + /* draw channel */ if (gcdrf & CDRF_NOTIFYITEMDRAW) { nmcd.dwItemSpec = TBCD_CHANNEL; @@ -904,7 +904,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT); } } - + /* draw thumb */ if (!(dwStyle & TBS_NOTHUMB)) { if (gcdrf & CDRF_NOTIFYITEMDRAW) { @@ -928,7 +928,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) /* finish up the painting */ if (gcdrf & CDRF_NOTIFYPOSTPAINT) notify_customdraw(infoPtr, &nmcd, CDDS_POSTPAINT); - + cleanup: /* cleanup, if we rendered offscreen */ if (hdc != hdcDst) { @@ -1430,7 +1430,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs) hwnd, 0, 0, 0); if (infoPtr->hwndToolTip) { - TTTOOLINFOW ti; + TTTOOLINFOW ti; ZeroMemory (&ti, sizeof(ti)); ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE; @@ -1439,7 +1439,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs) SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti); } } - + OpenThemeData (hwnd, themeClass); return 0; @@ -1608,7 +1608,7 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y) return TRUE; } - if (!(infoPtr->flags & TB_DRAG_MODE)) + if (!(infoPtr->flags & TB_DRAG_MODE)) { if (GetWindowTheme (infoPtr->hwndSelf)) { @@ -1632,7 +1632,7 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y) tme.dwFlags = TME_CANCEL; tme.hwndTrack = infoPtr->hwndSelf; TrackMouseEvent( &tme ); - infoPtr->flags &= ~TB_THUMB_HOT; + infoPtr->flags &= ~TB_THUMB_HOT; } if (oldFlags != infoPtr->flags) InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE); } @@ -1880,10 +1880,10 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRACKBAR_LButtonUp (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); case WM_MOUSELEAVE: - infoPtr->flags &= ~TB_THUMB_HOT; + infoPtr->flags &= ~TB_THUMB_HOT; InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE); return 0; - + case WM_MOUSEMOVE: return TRACKBAR_MouseMove (infoPtr, wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); diff --git a/reactos/dll/win32/comctl32/treeview.c b/reactos/dll/win32/comctl32/treeview.c index 937bd0ee938..0eff5f9e88f 100644 --- a/reactos/dll/win32/comctl32/treeview.c +++ b/reactos/dll/win32/comctl32/treeview.c @@ -2325,7 +2325,7 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE hbr = CreateSolidBrush(infoPtr->clrBk); hbrOld = SelectObject(hdc, hbr); - + centerx = (item->linesOffset + item->stateOffset) / 2; centery = (item->rect.top + item->rect.bottom) / 2; @@ -2406,21 +2406,21 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE LONG rectsize = min(height, width) / 4; /* plussize = ceil(rectsize * 3/4) */ LONG plussize = (rectsize + 1) * 3 / 4; - + HPEN hNewPen = CreatePen(PS_SOLID, 0, infoPtr->clrLine); HPEN hOldPen = SelectObject(hdc, hNewPen); - + Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1, centerx + rectsize + 2, centery + rectsize + 2); - + SelectObject(hdc, hOldPen); DeleteObject(hNewPen); - + if (height < 18 || width < 18) { MoveToEx(hdc, centerx - plussize + 1, centery, NULL); LineTo(hdc, centerx + plussize, centery); - + if (!(item->state & TVIS_EXPANDED)) { MoveToEx(hdc, centerx, centery - plussize + 1, NULL); @@ -2431,7 +2431,7 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE { Rectangle(hdc, centerx - plussize + 1, centery - 1, centerx + plussize, centery + 2); - + if (!(item->state & TVIS_EXPANDED)) { Rectangle(hdc, centerx - 1, centery - plussize + 1, @@ -2601,7 +2601,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem wineItem->pszText, lstrlenW(wineItem->pszText), NULL); - + /* Draw the box around the selected item */ if ((wineItem == infoPtr->selectedItem) && inFocus) { @@ -2870,7 +2870,7 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam) if (wParam) { hdc = (HDC)wParam; - GetClientRect(infoPtr->hwnd, &rc); + GetClientRect(infoPtr->hwnd, &rc); TREEVIEW_EraseBackground(infoPtr, hdc); } else @@ -4997,7 +4997,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) /* Make sure actual scrollbar state is consistent with uInternalStatus */ ShowScrollBar(hwnd, SB_VERT, FALSE); ShowScrollBar(hwnd, SB_HORZ, FALSE); - + OpenThemeData (hwnd, themeClass); return 0; diff --git a/reactos/dll/win32/comctl32/updown.c b/reactos/dll/win32/comctl32/updown.c index f7dd6883765..c919cd6c912 100644 --- a/reactos/dll/win32/comctl32/updown.c +++ b/reactos/dll/win32/comctl32/updown.c @@ -18,14 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE - * + * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * */ #include @@ -100,7 +100,7 @@ typedef struct #define COUNT_OF(a) (sizeof(a)/sizeof(a[0])) static const WCHAR BUDDY_UPDOWN_HWND[] = { 'b', 'u', 'd', 'd', 'y', 'U', 'p', 'D', 'o', 'w', 'n', 'H', 'W', 'N', 'D', 0 }; -static const WCHAR BUDDY_SUPERCLASS_WNDPROC[] = { 'b', 'u', 'd', 'd', 'y', 'S', 'u', 'p', 'p', 'e', 'r', +static const WCHAR BUDDY_SUPERCLASS_WNDPROC[] = { 'b', 'u', 'd', 'd', 'y', 'S', 'u', 'p', 'p', 'e', 'r', 'C', 'l', 'a', 's', 's', 'W', 'n', 'd', 'P', 'r', 'o', 'c', 0 }; static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action); @@ -312,7 +312,7 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr) WCHAR txt[20]; int len; - if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy))) + if (!((infoPtr->dwStyle & UDS_SETBUDDYINT) && IsWindow(infoPtr->Buddy))) return FALSE; TRACE("set new value(%d) to buddy.\n", infoPtr->CurVal); @@ -384,10 +384,10 @@ static LRESULT UPDOWN_Draw (const UPDOWN_INFO *infoPtr, HDC hdc) dHot = (infoPtr->Flags & FLAG_DECR) && (infoPtr->Flags & FLAG_MOUSEIN); if (theme) { uPart = (infoPtr->dwStyle & UDS_HORZ) ? SPNP_UPHORZ : SPNP_UP; - uState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED + uState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED : (uPressed ? DNS_PRESSED : (uHot ? DNS_HOT : DNS_NORMAL)); dPart = (infoPtr->dwStyle & UDS_HORZ) ? SPNP_DOWNHORZ : SPNP_DOWN; - dState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED + dState = (infoPtr->dwStyle & WS_DISABLED) ? DNS_DISABLED : (dPressed ? DNS_PRESSED : (dHot ? DNS_HOT : DNS_NORMAL)); needBuddyBg = IsWindow (infoPtr->Buddy) && (IsThemeBackgroundPartiallyTransparent (theme, uPart, uState) @@ -765,7 +765,7 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, INT x, INT if(temp != infoPtr->Flags) InvalidateRect (infoPtr->Self, NULL, FALSE); - /* Set up tracking so the mousein flags can be reset when the + /* Set up tracking so the mousein flags can be reset when the * mouse leaves the control */ tme.cbSize = sizeof( tme ); tme.dwFlags = TME_LEAVE; diff --git a/reactos/dll/win32/comdlg32/cdlg.h b/reactos/dll/win32/comdlg32/cdlg.h index 22cd5a21e8a..f7a59055116 100644 --- a/reactos/dll/win32/comdlg32/cdlg.h +++ b/reactos/dll/win32/comdlg32/cdlg.h @@ -189,7 +189,7 @@ BOOL CC_HookCallChk( const CHOOSECOLORW *lpcc ); int CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ); LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam ); LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam ); -LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD +LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode, HWND hwndCtl ); LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam ); LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam ); diff --git a/reactos/dll/win32/comdlg32/cdlg_Bg.rc b/reactos/dll/win32/comdlg32/cdlg_Bg.rc index f990df05ada..50b08e751fb 100644 --- a/reactos/dll/win32/comdlg32/cdlg_Bg.rc +++ b/reactos/dll/win32/comdlg32/cdlg_Bg.rc @@ -18,7 +18,7 @@ /* * Òóê èçðè÷íî ïèøåøå äà íå ïèïàì íåùî, àìà àç ãî ïèïíàõ. - * Àêî èìà ïðîáëåìè íÿêîé äà ãè îïðàâè. + * Àêî èìà ïðîáëåìè íÿêîé äà ãè îïðàâè. */ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT diff --git a/reactos/dll/win32/comdlg32/cdlg_Cs.rc b/reactos/dll/win32/comdlg32/cdlg_Cs.rc index 1a7f5dfb2f7..a4e8194b6d3 100644 --- a/reactos/dll/win32/comdlg32/cdlg_Cs.rc +++ b/reactos/dll/win32/comdlg32/cdlg_Cs.rc @@ -197,7 +197,7 @@ FONT 8, "MS Shell Dlg" GROUPBOX "Smìr", grp1, 107, 26, 68, 28 CONTROL "N&ahoru", rad1, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12 CONTROL "&Dolù", rad2, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12 - + DEFPUSHBUTTON "Najít d&alší", IDOK, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Zrušit", IDCANCEL, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Nápovìda", pshHelp, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP diff --git a/reactos/dll/win32/comdlg32/cdlg_Eo.rc b/reactos/dll/win32/comdlg32/cdlg_Eo.rc index ade9c9b0b63..c462b1d3abd 100644 --- a/reactos/dll/win32/comdlg32/cdlg_Eo.rc +++ b/reactos/dll/win32/comdlg32/cdlg_Eo.rc @@ -372,7 +372,7 @@ IDS_INVALID_FILENAME "La dosiernomo ne povas enhavi la jenajn tipojn: \n / : IDS_PATHNOTEXISTING "Vojo estas neekzistanta" IDS_FILENOTEXISTING "Dosiero estas neekzistanta" } - + STRINGTABLE DISCARDABLE { IDS_UPFOLDER "Suriru da unu nivelo" @@ -381,11 +381,11 @@ STRINGTABLE DISCARDABLE IDS_REPORTVIEW "Detale" IDS_TODESKTOP "Foliu Desktop" } - + STRINGTABLE DISCARDABLE { PD32_PRINT_TITLE "Presu" - + PD32_VALUE_UREADABLE "Nelegebla Entry" PD32_INVALID_PAGE_RANGE "Æi tiu valoro ne estas en la paøo.\n\ Enigu valoron inter %d kaj %d." @@ -405,13 +405,13 @@ STRINGTABLE DISCARDABLE PD32_NO_DEVICES "Antaý ol vi povos plenumi printiltaskojn \ kvazaý impozi paøon aý presi dokumenton, estas necese ke vi instalu printilon. \ Oni konsilas instali øin kaj reprovi." - + PD32_DEFAULT_PRINTER "Defaýlta Printilo; " PD32_NR_OF_DOCUMENTS_IN_QUEUE "%d dokumento(j) estas en presvico" PD32_MARGINS_IN_INCHES "Marøenoj [inches]" PD32_MARGINS_IN_MILIMETERS "Marøenoj [mm]" PD32_MILIMETERS "mm" - + PD32_PRINTER_STATUS_READY "Preta" PD32_PRINTER_STATUS_PAUSED "Paýse; " PD32_PRINTER_STATUS_ERROR "Eroro; " @@ -439,7 +439,7 @@ STRINGTABLE DISCARDABLE PD32_PRINTER_STATUS_SERVER_UNKNOWN "Nekonata pres-servanto; " PD32_PRINTER_STATUS_POWER_SAVE "Energiþpare; " } - + STRINGTABLE DISCARDABLE /* Color names */ { IDS_COLOR_BLACK "Nigro" @@ -459,7 +459,7 @@ STRINGTABLE DISCARDABLE /* Color names */ IDS_COLOR_AQUA "Akvo" IDS_COLOR_WHITE "Blanko" } - + STRINGTABLE DISCARDABLE { IDS_FONT_SIZE "Elektu tiparan grandecvaloron inter %d kaj %d punktoj." diff --git a/reactos/dll/win32/comdlg32/cdlg_Ko.rc b/reactos/dll/win32/comdlg32/cdlg_Ko.rc index 46f91e1afd1..35cde8cb22a 100644 --- a/reactos/dll/win32/comdlg32/cdlg_Ko.rc +++ b/reactos/dll/win32/comdlg32/cdlg_Ko.rc @@ -1,7 +1,7 @@ /* * Copyright 1996 Bang Jun Young * Copyright 2005,2006 YunSong Hwang - * Copyright 2006 Byeong-Sik Jeon + * Copyright 2006 Byeong-Sik Jeon * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -116,7 +116,7 @@ FONT 9, "MS Shell Dlg" COMBOBOX cmb3, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP } - + CHOOSE_FONT DIALOG DISCARDABLE 13, 54, 264, 147 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "±Û²Ã" diff --git a/reactos/dll/win32/comdlg32/cdlg_Ru.rc b/reactos/dll/win32/comdlg32/cdlg_Ru.rc index 6e7adb8ccb0..e178694a239 100644 --- a/reactos/dll/win32/comdlg32/cdlg_Ru.rc +++ b/reactos/dll/win32/comdlg32/cdlg_Ru.rc @@ -323,7 +323,7 @@ BEGIN PUSHBUTTON "Îòìåíà", IDCANCEL, 126, 220, 50, 14 PUSHBUTTON "&Ïðèíòåð...", psh3, 184, 220, 48, 14 END - + NEWFILEOPENORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 280, 164 STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN diff --git a/reactos/dll/win32/comdlg32/cdlg_xx.rc b/reactos/dll/win32/comdlg32/cdlg_xx.rc index ab876256c96..19afc9f47a1 100644 --- a/reactos/dll/win32/comdlg32/cdlg_xx.rc +++ b/reactos/dll/win32/comdlg32/cdlg_xx.rc @@ -646,4 +646,4 @@ NETWORK ICON network.ico '88 88 88 88 88 CC CC CC CC CC 78 06 77 CC CC CC' 'CC CC CC CC 78 06 77 CC CC CC CC CC CC CC CC CC' 'CC CC CC CC 00 00' -}*/ +}*/ diff --git a/reactos/dll/win32/comdlg32/filedlg.c b/reactos/dll/win32/comdlg32/filedlg.c index ca058f24102..0b26ed4e85f 100644 --- a/reactos/dll/win32/comdlg32/filedlg.c +++ b/reactos/dll/win32/comdlg32/filedlg.c @@ -295,7 +295,7 @@ static BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos) fodInfos->ofnInfos->hwndOwner, FileOpenDlgProc95, (LPARAM) fodInfos); - if (SUCCEEDED(hr)) + if (SUCCEEDED(hr)) OleUninitialize(); /* Unable to create the dialog */ @@ -531,7 +531,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) static BOOL COMDLG32_GetDisplayNameOf(LPCITEMIDLIST pidl, LPWSTR pwszPath) { LPSHELLFOLDER psfDesktop; STRRET strret; - + if (FAILED(SHGetDesktopFolder(&psfDesktop))) return FALSE; @@ -577,9 +577,9 @@ static void ArrangeCtrlPositions(HWND hwndChildDlg, HWND hwndParentDlg, BOOL hid However, if there is a static text component with the stc32 id, a special case happens. The x and y coordinates of stc32 indicate the top left corner where to place the standard file dialog box in the window and the cx and cy indicate how to size the window. - Moreover, if the new component's coordinates are on the left of the stc32 , it is placed on the left + Moreover, if the new component's coordinates are on the left of the stc32 , it is placed on the left of the standard file dialog box. If they are above the stc32 component, it is placed above and so on.... - + */ GetClientRect(hwndParentDlg, &rectParent); @@ -897,20 +897,20 @@ static INT_PTR FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPVOID buffer else { LPSTR bufA = buffer; - total = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1, + total = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1, NULL, 0, NULL, NULL); - total += WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed, + total += WideCharToMultiByte(CP_ACP, 0, lpstrFileList, sizeUsed, NULL, 0, NULL, NULL); /* Prepend the current path */ - n = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1, + n = WideCharToMultiByte(CP_ACP, 0, lpstrCurrentDir, -1, bufA, size, NULL, NULL); if(nShellInfos.pidlAbsCurrent, lpstrPath); - if (lParam) + if (lParam) { if (fodInfos->unicode) lstrcpynW((LPWSTR)lParam, lpstrPath, (int)wParam); else - WideCharToMultiByte(CP_ACP, 0, lpstrPath, -1, + WideCharToMultiByte(CP_ACP, 0, lpstrPath, -1, (LPSTR)lParam, (int)wParam, NULL, NULL); - } + } retval = lstrlenW(lpstrPath); break; @@ -1922,9 +1922,9 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_w(lpszTemp), lpsf); /* append a backslash to drive letters */ - if(lstrlenW(lpwstrTemp)==2 && lpwstrTemp[1] == ':' && + if(lstrlenW(lpwstrTemp)==2 && lpwstrTemp[1] == ':' && ((lpwstrTemp[0] >= 'a' && lpwstrTemp[0] <= 'z') || - (lpwstrTemp[0] >= 'A' && lpwstrTemp[0] <= 'Z'))) + (lpwstrTemp[0] >= 'A' && lpwstrTemp[0] <= 'Z'))) { PathAddBackslashW(lpwstrTemp); } @@ -2063,7 +2063,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) { /* if no extension is specified with file name, then */ /* attach the extension from file filter or default one */ - + WCHAR *filterExt = NULL; LPWSTR lpstrFilter = NULL; static const WCHAR szwDot[] = {'.',0}; @@ -2071,7 +2071,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) /* Attach the dot*/ lstrcatW(lpstrPathAndFile, szwDot); - + /*Get the file extension from file type filter*/ lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, fodInfos->ofnInfos->nFilterIndex-1); @@ -2564,8 +2564,8 @@ static void FILEDLG95_FILETYPE_Clean(HWND hwnd) * Initialisation of the look in combo box */ -/* Small helper function, to determine if the unixfs shell extension is rooted - * at the desktop. Copied from dlls/shell32/shfldr_unixfs.c. +/* Small helper function, to determine if the unixfs shell extension is rooted + * at the desktop. Copied from dlls/shell32/shfldr_unixfs.c. */ static inline BOOL FILEDLG95_unixfs_is_rooted_at_desktop(void) { HKEY hKey; @@ -2576,10 +2576,10 @@ static inline BOOL FILEDLG95_unixfs_is_rooted_at_desktop(void) { 'N','a','m','e','S','p','a','c','e','\\','{','9','D','2','0','A','A','E','8', '-','0','6','2','5','-','4','4','B','0','-','9','C','A','7','-', '7','1','8','8','9','C','2','2','5','4','D','9','}',0 }; - + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszRootedAtDesktop, 0, KEY_READ, &hKey) != ERROR_SUCCESS) return FALSE; - + RegCloseKey(hKey); return TRUE; } @@ -2601,7 +2601,7 @@ static void FILEDLG95_LOOKIN_Init(HWND hwndCombo) /* set item height for both text field and listbox */ CBSetItemHeight(hwndCombo,-1,GetSystemMetrics(SM_CYSMICON)); CBSetItemHeight(hwndCombo,0,GetSystemMetrics(SM_CYSMICON)); - + /* Turn on the extended UI for the combo box like Windows does */ CBSetExtendedUI(hwndCombo, TRUE); @@ -2624,7 +2624,7 @@ static void FILEDLG95_LOOKIN_Init(HWND hwndCombo) FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND); /* If the unixfs extension is rooted, we don't expand the drives by default */ - if (!FILEDLG95_unixfs_is_rooted_at_desktop()) + if (!FILEDLG95_unixfs_is_rooted_at_desktop()) { /* special handling for CSIDL_DRIVES */ if (COMDLG32_PIDL_ILIsEqual(pidlTmp, pidlDrives)) @@ -3125,8 +3125,8 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd) } } SetWindowTextW( fodInfos->DlgInfos.hwndFileName, lpstrAllFile ); - - /* Select the file name like Windows does */ + + /* Select the file name like Windows does */ SendMessageW(fodInfos->DlgInfos.hwndFileName, EM_SETSEL, 0, (LPARAM)-1); } HeapFree(GetProcessHeap(),0, lpstrAllFile ); @@ -3279,7 +3279,7 @@ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex) if (!doSelected) return NULL; - + /* Set the FORMATETC structure*/ SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); diff --git a/reactos/dll/win32/comdlg32/filedlgbrowser.c b/reactos/dll/win32/comdlg32/filedlgbrowser.c index 11608f04323..04676f9fd92 100644 --- a/reactos/dll/win32/comdlg32/filedlgbrowser.c +++ b/reactos/dll/win32/comdlg32/filedlgbrowser.c @@ -134,17 +134,17 @@ static void COMDLG32_UpdateCurrentDir(const FileOpenDlgInfos *fodInfos) res = SHGetDesktopFolder(&psfDesktop); if (FAILED(res)) return; - + res = IShellFolder_GetDisplayNameOf(psfDesktop, fodInfos->ShellInfos.pidlAbsCurrent, SHGDN_FORPARSING, &strret); if (SUCCEEDED(res)) { WCHAR wszCurrentDir[MAX_PATH]; - + res = StrRetToBufW(&strret, fodInfos->ShellInfos.pidlAbsCurrent, wszCurrentDir, MAX_PATH); if (SUCCEEDED(res)) SetCurrentDirectoryW(wszCurrentDir); } - + IShellFolder_Release(psfDesktop); } diff --git a/reactos/dll/win32/comdlg32/printdlg.c b/reactos/dll/win32/comdlg32/printdlg.c index 56aea903ac4..b0a7279e264 100644 --- a/reactos/dll/win32/comdlg32/printdlg.c +++ b/reactos/dll/win32/comdlg32/printdlg.c @@ -121,7 +121,7 @@ INT PRINTDLG_SetUpPrinterListComboA(HWND hDlg, UINT id, LPCSTR name) &num); SendDlgItemMessageA(hDlg, id, CB_RESETCONTENT, 0, 0); - + for(i = 0; i < num; i++) { SendDlgItemMessageA(hDlg, id, CB_ADDSTRING, 0, (LPARAM)pi[i].pPrinterName ); @@ -822,7 +822,7 @@ static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, const PRINTER_INFO_2A *p /* set all other printer info texts */ SetDlgItemTextA(hDlg, stc11, pi->pDriverName); - + if (pi->pLocation != NULL && pi->pLocation[0] != '\0') SetDlgItemTextA(hDlg, stc14, pi->pLocation); else @@ -1987,14 +1987,14 @@ static BOOL PRINTDLG_CreateDCW(LPPRINTDLGW lppd) * * Displays the the PRINT dialog box, which enables the user to specify * specific properties of the print job. - * + * * PARAMS * lppd [IO] ptr to PRINTDLG32 struct - * + * * RETURNS * nonzero if the user pressed the OK button * zero if the user cancelled the window or an error occurred - * + * * BUGS * PrintDlg: * * The Collate Icons do not display, even though they are in the code. @@ -2345,7 +2345,7 @@ static HGLOBAL PRINTDLG_GetPGSTemplateA(const PAGESETUPDLGA *lppd) { HRSRC hResInfo; HGLOBAL hDlgTmpl; - + if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATEHANDLE) { hDlgTmpl = lppd->hPageSetupTemplate; } else if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATE) { @@ -2488,7 +2488,7 @@ _c_str2sizeW(const PAGESETUPDLGW *dlga, LPCWSTR strin) { /**************************************************************************** * PRINTDLG_PS_UpdateDlgStructA * - * Updates pda->dlga structure + * Updates pda->dlga structure * Function calls when user presses OK button * * PARAMS @@ -2507,7 +2507,7 @@ PRINTDLG_PS_UpdateDlgStructA(HWND hDlg, PageSetupDataA *pda) { memcpy(pda->dlga, &pda->curdlg, sizeof(pda->curdlg)); pda->dlga->hDevMode = pda->pdlg.hDevMode; pda->dlga->hDevNames = pda->pdlg.hDevNames; - + dn = GlobalLock(pda->pdlg.hDevNames); dm = GlobalLock(pda->pdlg.hDevMode); @@ -2593,12 +2593,12 @@ PRINTDLG_PS_UpdateDlgStructW(HWND hDlg, PageSetupDataW *pda) { * PRINTDLG_PS_ChangeActivePrinerA * * Redefines hDevMode and hDevNames HANDLES and initialises it. - * + * * PARAMS * name [in] Name of a printer for activation * pda [in/out] ptr to PageSetupDataA structure - * - * RETURN + * + * RETURN * TRUE if success * FALSE if fail */ @@ -2609,7 +2609,7 @@ PRINTDLG_PS_ChangeActivePrinterA(LPSTR name, PageSetupDataA *pda){ LPPRINTER_INFO_2A lpPrinterInfo; LPDRIVER_INFO_3A lpDriverInfo; DEVMODEA *pDevMode, *dm; - + if(!OpenPrinterA(name, &hprn, NULL)){ ERR("Can't open printer %s\n", name); return FALSE; @@ -2626,7 +2626,7 @@ PRINTDLG_PS_ChangeActivePrinterA(LPSTR name, PageSetupDataA *pda){ return FALSE; } ClosePrinter(hprn); - + needed = DocumentPropertiesA(0, 0, name, NULL, NULL, 0); if(needed == -1) { ERR("DocumentProperties fails on %s\n", debugstr_a(name)); @@ -2642,12 +2642,12 @@ PRINTDLG_PS_ChangeActivePrinterA(LPSTR name, PageSetupDataA *pda){ GMEM_MOVEABLE); dm = GlobalLock(pda->pdlg.hDevMode); memcpy(dm, pDevMode, pDevMode->dmSize + pDevMode->dmDriverExtra); - + PRINTDLG_CreateDevNames(&(pda->pdlg.hDevNames), lpDriverInfo->pDriverPath, lpPrinterInfo->pPrinterName, lpPrinterInfo->pPortName); - + GlobalUnlock(pda->pdlg.hDevMode); HeapFree(GetProcessHeap(), 0, pDevMode); HeapFree(GetProcessHeap(), 0, lpPrinterInfo); @@ -2660,7 +2660,7 @@ PRINTDLG_PS_ChangeActivePrinterA(LPSTR name, PageSetupDataA *pda){ * * Fills Printers, Paper and Source combo * - * RETURNS + * RETURNS * TRUE */ static BOOL @@ -2668,7 +2668,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; @@ -2699,8 +2699,8 @@ PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) { } /****************************************************************************************** - * PRINTDLG_PS_ChangePaperPrev - * + * PRINTDLG_PS_ChangePaperPrev + * * Changes paper preview size / position * * PARAMS: @@ -2709,12 +2709,12 @@ PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) { * RETURNS: * always - TRUE */ -static BOOL +static BOOL PRINTDLG_PS_ChangePaperPrev(const PageSetupDataA *pda) { LONG width, height, x, y; RECT rtTmp; - + if(pda->curdlg.ptPaperSize.x > pda->curdlg.ptPaperSize.y) { width = pda->rtDrawRect.right - pda->rtDrawRect.left; height = pda->curdlg.ptPaperSize.y * width / pda->curdlg.ptPaperSize.x; @@ -2735,7 +2735,7 @@ PRINTDLG_PS_ChangePaperPrev(const PageSetupDataA *pda) memcpy(&rtTmp, &pda->rtDrawRect, sizeof(RECT)); rtTmp.right += SHADOW; rtTmp.bottom += SHADOW; -#undef SHADOW +#undef SHADOW InvalidateRect(pda->hDlg, &rtTmp, TRUE); return TRUE; @@ -2754,7 +2754,7 @@ if(msg == EN_CHANGE){ \ * process WM_COMMAND message for PageSetupDlgA * * PARAMS - * hDlg [in] Main dialog HANDLE + * hDlg [in] Main dialog HANDLE * wParam [in] WM_COMMAND wParam * lParam [in] WM_COMMAND lParam * pda [in/out] ptr to PageSetupDataA @@ -2767,7 +2767,7 @@ PRINTDLG_PS_WMCommandA( WORD msg = HIWORD(wParam); WORD id = LOWORD(wParam); char buf[200]; - + TRACE("loword (lparam) %d, wparam 0x%lx, lparam %08lx\n", LOWORD(lParam),wParam,lParam); switch (id) { @@ -2820,7 +2820,7 @@ PRINTDLG_PS_WMCommandA( PRINTDLG_PaperSizeA(&(pda->pdlg), paperword,&(pda->curdlg.ptPaperSize)); pda->curdlg.ptPaperSize.x = _c_10mm2size(pda->dlga,pda->curdlg.ptPaperSize.x); pda->curdlg.ptPaperSize.y = _c_10mm2size(pda->dlga,pda->curdlg.ptPaperSize.y); - + if (IsDlgButtonChecked(hDlg, rad2)) { DWORD tmp = pda->curdlg.ptPaperSize.x; pda->curdlg.ptPaperSize.x = pda->curdlg.ptPaperSize.y; @@ -2829,7 +2829,7 @@ PRINTDLG_PS_WMCommandA( PRINTDLG_PS_ChangePaperPrev(pda); } else FIXME("could not get dialog text for papersize cmbbox?\n"); - } + } break; case cmb3: if(msg == CBN_SELCHANGE){ @@ -2846,7 +2846,7 @@ PRINTDLG_PS_WMCommandA( DEVMODEA *dm; LRESULT count; int i; - + GetDlgItemTextA(hDlg, cmb1, PrinterName, 255); if (!OpenPrinterA(PrinterName, &hPrinter, NULL)) { FIXME("Call to OpenPrinter did not succeed!\n"); @@ -2872,7 +2872,7 @@ PRINTDLG_PS_WMCommandA( PRINTDLG_PS_ChangePaperPrev(pda); /* Selecting paper in combo */ count = SendDlgItemMessageA(hDlg, cmb2, CB_GETCOUNT, 0, 0); - if(count != CB_ERR){ + if(count != CB_ERR){ for(i=0; iu.s.dmPaperSize) { SendDlgItemMessageA(hDlg, cmb2, CB_SETCURSEL, i, 0); @@ -2880,10 +2880,10 @@ PRINTDLG_PS_WMCommandA( } } } - + GlobalUnlock(pda->pdlg.hDevMode); break; - } + } case edt4: GETVAL(id, pda->curdlg.rtMargin.left); break; @@ -2900,7 +2900,7 @@ PRINTDLG_PS_WMCommandA( InvalidateRect(GetDlgItem(hDlg, rct1), NULL, TRUE); return FALSE; } -#undef GETVAL +#undef GETVAL static BOOL PRINTDLG_PS_WMCommandW( @@ -2933,7 +2933,7 @@ PRINTDLG_PS_WMCommandW( /*********************************************************************** * DefaultPagePaintHook - * Default hook paint procedure that receives WM_PSD_* messages from the dialog box + * Default hook paint procedure that receives WM_PSD_* messages from the dialog box * whenever the sample page is redrawn. */ @@ -3012,7 +3012,7 @@ PRINTDLG_DefaultPagePaintHook(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa * The image consists of a rectangle that represents the selected paper * or envelope type, with a dotted-line rectangle representing * the current margins, and partial (Greek text) characters - * to show how text looks on the printed page. + * to show how text looks on the printed page. * * The following messages in the order sends to user hook procedure: * WM_PSD_PAGESETUPDLG Draw the contents of the sample page @@ -3063,16 +3063,16 @@ PRINTDLG_PagePaintProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) hdc = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &rcClient); - + scalx = rcClient.right / (double)pda->curdlg.ptPaperSize.x; - scaly = rcClient.bottom / (double)pda->curdlg.ptPaperSize.y; + scaly = rcClient.bottom / (double)pda->curdlg.ptPaperSize.y; rcMargin = rcClient; - + rcMargin.left += (LONG)pda->curdlg.rtMargin.left * scalx; rcMargin.top += (LONG)pda->curdlg.rtMargin.top * scalx; rcMargin.right -= (LONG)pda->curdlg.rtMargin.right * scaly; rcMargin.bottom -= (LONG)pda->curdlg.rtMargin.bottom * scaly; - + /* if the space is too small then we make sure to not draw anything */ rcMargin.left = min(rcMargin.left, rcMargin.right); rcMargin.top = min(rcMargin.top, rcMargin.bottom); @@ -3087,7 +3087,7 @@ PRINTDLG_PagePaintProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) hpen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW)); holdpen = SelectObject(hdc, hpen); - + /* paint left edge */ MoveToEx(hdc, rcClient.left, rcClient.top, NULL); LineTo(hdc, rcClient.left, rcClient.bottom-1); @@ -3117,7 +3117,7 @@ PRINTDLG_PagePaintProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) rcMargin.top += 2; rcMargin.right -= 2; rcMargin.bottom -= 2; - + /* if the space is too small then we make sure to not draw anything */ rcMargin.left = min(rcMargin.left, rcMargin.right); rcMargin.top = min(rcMargin.top, rcMargin.bottom); @@ -3146,8 +3146,8 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) pda = (PageSetupDataA*)lParam; pda->hDlg = hDlg; /* saving handle to main window to PageSetupDataA structure */ memcpy(&pda->curdlg, pda->dlga, sizeof(pda->curdlg)); - - hDrawWnd = GetDlgItem(hDlg, rct1); + + hDrawWnd = GetDlgItem(hDlg, rct1); TRACE("set property to %p\n", pda); SetPropA(hDlg, "__WINE_PAGESETUPDLGDATA", pda); SetPropA(hDrawWnd, "__WINE_PAGESETUPDLGDATA", pda); @@ -3158,7 +3158,7 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) hDrawWnd, GWLP_WNDPROC, (ULONG_PTR)PRINTDLG_PagePaintProc); - + /* FIXME: Paint hook. Must it be at begin of initializtion or at end? */ res = TRUE; if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) { @@ -3236,7 +3236,7 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) pda->curdlg.ptPaperSize.y = pda->curdlg.ptPaperSize.x; pda->curdlg.ptPaperSize.x = tmp; } - } else + } else WARN("GlobalLock(pda->pdlg.hDevMode) fail? hDevMode=%p\n", pda->pdlg.hDevMode); /* Drawing paper prev */ PRINTDLG_PS_ChangePaperPrev(pda); @@ -3262,8 +3262,8 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK PageDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - static const WCHAR __WINE_PAGESETUPDLGDATA[] = - { '_', '_', 'W', 'I', 'N', 'E', '_', 'P', 'A', 'G', 'E', + static const WCHAR __WINE_PAGESETUPDLGDATA[] = + { '_', '_', 'W', 'I', 'N', 'E', '_', 'P', 'A', 'G', 'E', 'S', 'E', 'T', 'U', 'P', 'D', 'L', 'G', 'D', 'A', 'T', 'A', 0 }; PageSetupDataW *pda; LPDEVMODEW dm; @@ -3371,7 +3371,7 @@ PageDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) * NOTES * The values of hDevMode and hDevNames are filled on output and can be * changed in PAGESETUPDLG when they are passed in PageSetupDlg. - * + * */ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) { @@ -3457,7 +3457,7 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) { COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); return FALSE; } - + pda = HeapAlloc(GetProcessHeap(),0,sizeof(*pda)); pda->dlga = setupdlg; memcpy(&pda->pdlg,&pdlg,sizeof(pdlg)); @@ -3577,10 +3577,10 @@ HRESULT WINAPI PrintDlgExA(LPPRINTDLGEXA lpPrintDlgExA) * Display the the PRINT dialog box, which enables the user to specify * specific properties of the print job. The property sheet can also have * additional application-specific and driver-specific property pages. - * + * * PARAMS * lppd [IO] ptr to PRINTDLGEX struct - * + * * RETURNS * Success: S_OK * Failure: One of the following COM error codes: @@ -3589,7 +3589,7 @@ HRESULT WINAPI PrintDlgExA(LPPRINTDLGEXA lpPrintDlgExA) * E_POINTER Invalid pointer. * E_HANDLE Invalid handle. * E_FAIL Unspecified error. - * + * * FIXME * Stub */ diff --git a/reactos/dll/win32/console/colors.c b/reactos/dll/win32/console/colors.c index 82219dab840..16eabd810a3 100644 --- a/reactos/dll/win32/console/colors.c +++ b/reactos/dll/win32/console/colors.c @@ -32,7 +32,7 @@ PaintStaticControls(HWND hwndDlg, PConsoleInfo pConInfo, LPDRAWITEMSTRUCT drawIt return TRUE; } -INT_PTR +INT_PTR CALLBACK ColorsProc( HWND hwndDlg, @@ -83,7 +83,7 @@ ColorsProc( case WM_NOTIFY: { lpnmud = (LPNMUPDOWN) lParam; - lppsn = (LPPSHNOTIFY) lParam; + lppsn = (LPPSHNOTIFY) lParam; if (lppsn->hdr.code == PSN_APPLY) { @@ -98,7 +98,7 @@ ColorsProc( return TRUE; } return TRUE; - } + } if (lpnmud->hdr.idFrom == IDC_UPDOWN_COLOR_RED) { @@ -162,7 +162,7 @@ ColorsProc( case IDC_RADIO_SCREEN_TEXT: { SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(pConInfo->ScreenText), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->ScreenText), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->ScreenText), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(pConInfo->ScreenText), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); @@ -171,7 +171,7 @@ ColorsProc( case IDC_RADIO_SCREEN_BACKGROUND: { SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(pConInfo->ScreenBackground), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->ScreenBackground), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->ScreenBackground), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(pConInfo->ScreenBackground), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); @@ -180,7 +180,7 @@ ColorsProc( case IDC_RADIO_POPUP_TEXT: { SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(pConInfo->PopupText), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->PopupText), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->PopupText), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(pConInfo->PopupText), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); @@ -189,7 +189,7 @@ ColorsProc( case IDC_RADIO_POPUP_BACKGROUND: { SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(pConInfo->PopupBackground), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->PopupBackground), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(pConInfo->PopupBackground), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(pConInfo->PopupBackground), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); diff --git a/reactos/dll/win32/console/console.c b/reactos/dll/win32/console/console.c index 1b23bf5cac3..a170a029e3c 100644 --- a/reactos/dll/win32/console/console.c +++ b/reactos/dll/win32/console/console.c @@ -22,7 +22,7 @@ INT_PTR CALLBACK ColorsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { {IDC_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, InitApplet} }; @@ -65,21 +65,21 @@ AllocConsoleInfo() PConsoleInfo pConInfo; pConInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ConsoleInfo)); - + return pConInfo; } -void +void InitConsoleDefaults(PConsoleInfo pConInfo) { /* initialize struct */ pConInfo->InsertMode = TRUE; pConInfo->HistoryBufferSize = 50; pConInfo->NumberOfHistoryBuffers = 5; - pConInfo->ScreenText = RGB(192, 192, 192); - pConInfo->ScreenBackground = RGB(0, 0, 0); - pConInfo->PopupText = RGB(128, 0, 128); - pConInfo->PopupBackground = RGB(255, 255, 255); + pConInfo->ScreenText = RGB(192, 192, 192); + pConInfo->ScreenBackground = RGB(0, 0, 0); + pConInfo->PopupText = RGB(128, 0, 128); + pConInfo->PopupBackground = RGB(255, 255, 255); pConInfo->WindowSize = (DWORD)MAKELONG(80, 25); pConInfo->WindowPosition = UINT_MAX; pConInfo->ScreenBuffer = MAKELONG(80, 300); @@ -89,8 +89,8 @@ InitConsoleDefaults(PConsoleInfo pConInfo) memcpy(pConInfo->Colors, s_Colors, sizeof(s_Colors)); } - -INT_PTR + +INT_PTR CALLBACK ApplyProc( HWND hwndDlg, @@ -162,7 +162,7 @@ ApplyConsoleInfo(HWND hwndDlg, PConsoleInfo pConInfo) /* First Applet */ LONG APIENTRY -InitApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) +InitApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { PROPSHEETPAGE psp[4]; PROPSHEETHEADER psh; @@ -184,8 +184,8 @@ InitApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { return 0; } - - if (lParam) + + if (lParam) { /* use defaults */ InitConsoleDefaults(pConInfo); @@ -195,7 +195,7 @@ InitApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) if (IsBadReadPtr((const void *)pSharedInfo, sizeof(ConsoleInfo))) { /* use defaults */ - InitConsoleDefaults(pConInfo); + InitConsoleDefaults(pConInfo); } else { diff --git a/reactos/dll/win32/console/font.c b/reactos/dll/win32/console/font.c index c60de5af3c9..6efb089f475 100644 --- a/reactos/dll/win32/console/font.c +++ b/reactos/dll/win32/console/font.c @@ -10,7 +10,7 @@ #include "console.h" -INT_PTR +INT_PTR CALLBACK FontProc( HWND hwndDlg, diff --git a/reactos/dll/win32/console/lang/de-DE.rc b/reactos/dll/win32/console/lang/de-DE.rc index 76373bc9958..52628756abf 100644 --- a/reactos/dll/win32/console/lang/de-DE.rc +++ b/reactos/dll/win32/console/lang/de-DE.rc @@ -25,10 +25,10 @@ CONTROL "&Fenster", IDC_RADIO_DISPLAY_WINDOW, "Button", BS_AUTORADIOBUTTON | WS_ CONTROL "V&ollild", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 150, 50, 70, 10 GROUPBOX "Befehlsspeicher:", -1, 15, 90, 120, 70, WS_CHILD | WS_VISIBLE | WS_GROUP LTEXT "&Puffergröße", -1, 25, 100, 60, 15 -EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 100, 12, 12 LTEXT "P&ufferanzahl:", -1, 25, 120, 80, 15 -EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 120, 12, 12 CHECKBOX "&Alte Duplikate löschen", IDC_CHECK_DISCARD_DUPLICATES, 25, 140, 100, 15 @@ -75,16 +75,16 @@ CONTROL "", IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UD GROUPBOX "Fenstergröße", -1, 130, 60, 115, 40 LTEXT "B&reite:", -1, 135, 70, 25, 10 LTEXT "H&öhe:", -1, 135, 80, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_WIDTH, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 GROUPBOX "Fensterposition", -1, 130, 105, 115, 55 LTEXT "&Links:", -1, 135, 120, 25, 10 LTEXT "&Oben:", -1, 135, 130, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_LEFT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_TOP, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 CHECKBOX "&Automatisch", IDC_CHECK_SYSTEM_POS_WINDOW, 135, 145, 100, 10 END diff --git a/reactos/dll/win32/console/lang/en-US.rc b/reactos/dll/win32/console/lang/en-US.rc index f197d19574b..6e86cf52708 100644 --- a/reactos/dll/win32/console/lang/en-US.rc +++ b/reactos/dll/win32/console/lang/en-US.rc @@ -25,10 +25,10 @@ CONTROL "&Window", IDC_RADIO_DISPLAY_WINDOW, "Button", BS_AUTORADIOBUTTON | WS_C CONTROL "F&ull Screen", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 150, 50, 70, 10 GROUPBOX "Command History:", -1, 15, 90, 120, 70, WS_CHILD | WS_VISIBLE | WS_GROUP LTEXT "&Buffer Size", -1, 25, 100, 60, 15 -EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 100, 12, 12 LTEXT "&Number of Buffers:", -1, 25, 120, 80, 15 -EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 120, 12, 12 CHECKBOX "&Discard Old Duplicates", IDC_CHECK_DISCARD_DUPLICATES, 25, 140, 100, 15 @@ -75,16 +75,16 @@ CONTROL "", IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UD GROUPBOX "Window Size", -1, 130, 60, 115, 40 LTEXT "&W&idth:", -1, 135, 70, 25, 10 LTEXT "&H&eight:", -1, 135, 80, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_WIDTH, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 GROUPBOX "Window Position", -1, 130, 105, 115, 55 LTEXT "&Left:", -1, 135, 120, 25, 10 LTEXT "&Top:", -1, 135, 130, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_LEFT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_TOP, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 CHECKBOX "Let system &position window", IDC_CHECK_SYSTEM_POS_WINDOW, 135, 145, 100, 10 END diff --git a/reactos/dll/win32/console/lang/id-ID.rc b/reactos/dll/win32/console/lang/id-ID.rc index d81d5338d00..222337cfe22 100644 --- a/reactos/dll/win32/console/lang/id-ID.rc +++ b/reactos/dll/win32/console/lang/id-ID.rc @@ -24,10 +24,10 @@ CONTROL "&Jendela", IDC_RADIO_DISPLAY_WINDOW, "Button", BS_AUTORADIOBUTTON | WS_ CONTROL "Layar Pen&uh", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 150, 50, 70, 10 GROUPBOX "Histori Perintah:", -1, 15, 90, 120, 70, WS_CHILD | WS_VISIBLE | WS_GROUP LTEXT "Ukuran Bu&fer", -1, 25, 100, 60, 15 -EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 100, 12, 12 LTEXT "Ju&mlah Bufer:", -1, 25, 120, 80, 15 -EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 120, 12, 12 CHECKBOX "Abaikan &Duplikasi Lama", IDC_CHECK_DISCARD_DUPLICATES, 25, 140, 100, 15 @@ -74,16 +74,16 @@ CONTROL "", IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UD GROUPBOX "Ukuran Jendela", -1, 130, 60, 115, 40 LTEXT "P&anjang:", -1, 135, 70, 25, 10 LTEXT "T&inggi:", -1, 135, 80, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_WIDTH, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 GROUPBOX "Posisi Jendela", -1, 130, 105, 115, 55 LTEXT "&Kiri:", -1, 135, 120, 25, 10 LTEXT "&Atas:", -1, 135, 130, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_LEFT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_TOP, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 CHECKBOX "Biarkan jendela &posisi sistem", IDC_CHECK_SYSTEM_POS_WINDOW, 135, 145, 100, 10 END diff --git a/reactos/dll/win32/console/lang/ru-RU.rc b/reactos/dll/win32/console/lang/ru-RU.rc index 56cf27b63ed..fe5d51ce7f7 100644 --- a/reactos/dll/win32/console/lang/ru-RU.rc +++ b/reactos/dll/win32/console/lang/ru-RU.rc @@ -26,10 +26,10 @@ CONTROL "& CONTROL "&Ïîëíûé ýêðàí", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 150, 50, 70, 10 GROUPBOX "Èñòîðèÿ êîìàíä:", -1, 15, 90, 120, 70, WS_CHILD | WS_VISIBLE | WS_GROUP LTEXT "&Ðàçìåð áóôåðà", -1, 25, 100, 60, 15 -EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 100, 12, 12 LTEXT "&×èñëî áóôåðîâ:", -1, 25, 120, 80, 15 -EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 120, 12, 12 CHECKBOX "&Óáèðàòü ñòàðûå ýêçåìëÿðû", IDC_CHECK_DISCARD_DUPLICATES, 25, 140, 100, 15 @@ -76,16 +76,16 @@ CONTROL "", IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UD GROUPBOX "Ðàçìåð îêíà", -1, 130, 60, 115, 40 LTEXT "Ø&èðèíà:", -1, 135, 70, 25, 10 LTEXT "Â&ûñîòà:", -1, 135, 80, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_WIDTH, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 GROUPBOX "Window Position", -1, 130, 105, 115, 55 LTEXT "&Îòñòóï:", -1, 135, 120, 25, 10 LTEXT "&Âûñîòà:", -1, 135, 130, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_LEFT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_TOP, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 CHECKBOX "&Ñèñòåìíàÿ ïîçèöèÿ îêíà", IDC_CHECK_SYSTEM_POS_WINDOW, 135, 145, 100, 10 END diff --git a/reactos/dll/win32/console/lang/uk-UA.rc b/reactos/dll/win32/console/lang/uk-UA.rc index 5a8b4a4a497..6ef0e367fd2 100644 --- a/reactos/dll/win32/console/lang/uk-UA.rc +++ b/reactos/dll/win32/console/lang/uk-UA.rc @@ -24,10 +24,10 @@ CONTROL " CONTROL "&Íà âåñü åêðàí", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 150, 50, 70, 10 GROUPBOX "Æóðíàë êîìàíä:", -1, 15, 90, 120, 70, WS_CHILD | WS_VISIBLE | WS_GROUP LTEXT "&Ðîçì³ð áóôåðà", -1, 25, 100, 60, 15 -EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS,UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 100, 12, 12 LTEXT "&ʳëüê³ñòü áóôåð³â:", -1, 25, 120, 80, 15 -EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS,UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 120, 12, 12 CHECKBOX "Â&³äêèäàòè ïîâòîðåííÿ", IDC_CHECK_DISCARD_DUPLICATES, 25, 140, 100, 15 @@ -74,16 +74,16 @@ CONTROL "", IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UD GROUPBOX "Ðîçì³ð â³êíà", -1, 130, 60, 115, 40 LTEXT "Øè&ðèíà:", -1, 135, 70, 25, 10 LTEXT "Â&èñîòà:", -1, 135, 80, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_WIDTH, 165, 70, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_WIDTH, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_SIZE_HEIGHT, 165, 80, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 GROUPBOX "Ïîçèö³ÿ â³êíà", -1, 130, 105, 115, 55 LTEXT "&Çë³âà:", -1, 135, 120, 25, 10 LTEXT "Ç&ãîðè:", -1, 135, 130, 25, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_LEFT, 165, 120, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_LEFT, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 -EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP +EDITTEXT IDC_EDIT_WINDOW_POS_TOP, 165, 130, 35, 10, ES_RIGHT | WS_GROUP CONTROL "", IDC_UPDOWN_WINDOW_POS_TOP, UPDOWN_CLASS, UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 185, 30, 30, 10 CHECKBOX "&Àâòîìàòè÷íèé âèá³ð", IDC_CHECK_SYSTEM_POS_WINDOW, 135, 145, 100, 10 END diff --git a/reactos/dll/win32/console/layout.c b/reactos/dll/win32/console/layout.c index 8a9127e8d67..9def3f75924 100644 --- a/reactos/dll/win32/console/layout.c +++ b/reactos/dll/win32/console/layout.c @@ -83,7 +83,7 @@ void PaintText(LPDRAWITEMSTRUCT drawItem, PConsoleInfo pConInfo) COLORREF nbkColor, ntColor; HBRUSH hBrush = NULL; TCHAR szText[1024]; - + ZeroMemory(szText, sizeof(szText)); LoadString(hApplet, IDS_SCREEN_TEXT, szText, sizeof(szText) / sizeof(TCHAR)); @@ -122,7 +122,7 @@ void PaintText(LPDRAWITEMSTRUCT drawItem, PConsoleInfo pConInfo) -INT_PTR +INT_PTR CALLBACK LayoutProc( HWND hwndDlg, @@ -154,7 +154,7 @@ LayoutProc( SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_SCREEN_BUFFER_WIDTH), UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_HEIGHT), UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_WIDTH), UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); - + hDC = GetDC(NULL); xres = GetDeviceCaps(hDC, HORZRES); yres = GetDeviceCaps(hDC, VERTRES); @@ -177,7 +177,7 @@ LayoutProc( EnableWindow(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP), FALSE); SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_SYSTEM_POS_WINDOW), BM_SETCHECK, (WPARAM)BST_CHECKED, 0); } - + return TRUE; } case WM_DRAWITEM: @@ -188,7 +188,7 @@ LayoutProc( case WM_NOTIFY: { lpnmud = (LPNMUPDOWN) lParam; - lppsn = (LPPSHNOTIFY) lParam; + lppsn = (LPPSHNOTIFY) lParam; if (lppsn->hdr.code == UDN_DELTAPOS) { diff --git a/reactos/dll/win32/console/options.c b/reactos/dll/win32/console/options.c index 522839c0150..ba1eac6e274 100644 --- a/reactos/dll/win32/console/options.c +++ b/reactos/dll/win32/console/options.c @@ -10,10 +10,10 @@ #include "console.h" static -void +void UpdateDialogElements(HWND hwndDlg, PConsoleInfo pConInfo); -INT_PTR +INT_PTR CALLBACK OptionsProc( HWND hwndDlg, @@ -44,7 +44,7 @@ OptionsProc( { break; } - lppsn = (LPPSHNOTIFY) lParam; + lppsn = (LPPSHNOTIFY) lParam; if (lppsn->hdr.code == UDN_DELTAPOS) { hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_BUFFER_SIZE); @@ -91,7 +91,7 @@ OptionsProc( break; } case IDC_RADIO_LARGE_CURSOR: - { + { pConInfo->CursorSize = 0x64; PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; @@ -169,7 +169,7 @@ OptionsProc( } static -void +void UpdateDialogElements(HWND hwndDlg, PConsoleInfo pConInfo) { HWND hDlgCtrl; @@ -221,7 +221,7 @@ UpdateDialogElements(HWND hwndDlg, PConsoleInfo pConInfo) hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_BUFFER_SIZE); _stprintf(szBuffer, _T("%d"), pConInfo->HistoryBufferSize); SendMessage(hDlgCtrl, WM_SETTEXT, 0, (LPARAM)szBuffer); - + /* update discard duplicates */ diff --git a/reactos/dll/win32/console/resource.h b/reactos/dll/win32/console/resource.h index c01e5a85dd6..e621cc60ea5 100644 --- a/reactos/dll/win32/console/resource.h +++ b/reactos/dll/win32/console/resource.h @@ -53,7 +53,7 @@ #define IDC_EDIT_WINDOW_POS_LEFT 508 #define IDC_UPDOWN_WINDOW_POS_LEFT 509 #define IDC_EDIT_WINDOW_POS_TOP 510 -#define IDC_UPDOWN_WINDOW_POS_TOP 511 +#define IDC_UPDOWN_WINDOW_POS_TOP 511 #define IDC_CHECK_SYSTEM_POS_WINDOW 512 #define IDC_STATIC_LAYOUT_WINDOW_PREVIEW 513 diff --git a/reactos/dll/win32/crtdll/dllmain.c b/reactos/dll/win32/crtdll/dllmain.c index 93939db914f..0481162b9ea 100644 --- a/reactos/dll/win32/crtdll/dllmain.c +++ b/reactos/dll/win32/crtdll/dllmain.c @@ -134,7 +134,7 @@ DllMain(PVOID hinstDll, ULONG dwReason, PVOID reserved) hHeap = HeapCreate(0, 100000, 0); if (hHeap == NULL) return FALSE; - if (!__fileno_init()) + if (!__fileno_init()) return FALSE; /* create tls stuff */ diff --git a/reactos/dll/win32/crypt32/cert.c b/reactos/dll/win32/crypt32/cert.c index d20a49f8f5c..056096b339a 100644 --- a/reactos/dll/win32/crypt32/cert.c +++ b/reactos/dll/win32/crypt32/cert.c @@ -2108,7 +2108,7 @@ static void CRYPT_MakeCertInfo(PCERT_INFO info, const CRYPT_DATA_BLOB *pSerialNu info->rgExtension = NULL; } } - + typedef RPC_STATUS (RPC_ENTRY *UuidCreateFunc)(UUID *); typedef RPC_STATUS (RPC_ENTRY *UuidToStringFunc)(UUID *, unsigned char **); typedef RPC_STATUS (RPC_ENTRY *RpcStringFreeFunc)(unsigned char **); diff --git a/reactos/dll/win32/crypt32/decode.c b/reactos/dll/win32/crypt32/decode.c index cb83a80a0bb..e6ca94c7c17 100644 --- a/reactos/dll/win32/crypt32/decode.c +++ b/reactos/dll/win32/crypt32/decode.c @@ -659,13 +659,13 @@ static BOOL WINAPI CRYPT_AsnDecodeDerBlob(DWORD dwCertEncodingType, { BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); DWORD bytesNeeded = sizeof(CRYPT_DER_BLOB); - + if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG)) bytesNeeded += 1 + lenBytes + dataLen; if (!pvStructInfo) *pcbStructInfo = bytesNeeded; - else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, + else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded))) { CRYPT_DER_BLOB *blob; @@ -1394,7 +1394,7 @@ static BOOL WINAPI CRYPT_AsnDecodeNameValueInternal(DWORD dwCertEncodingType, LPWSTR str = (LPWSTR)value->Value.pbData; value->Value.cbData = MultiByteToWideChar(CP_UTF8, 0, - (LPCSTR)pbEncoded + 1 + lenBytes, dataLen, + (LPCSTR)pbEncoded + 1 + lenBytes, dataLen, str, bytesNeeded - sizeof(CERT_NAME_VALUE)) * 2; break; } @@ -1805,10 +1805,10 @@ static BOOL WINAPI CRYPT_AsnDecodeAlgorithmId(DWORD dwCertEncodingType, BOOL ret = TRUE; struct AsnDecodeSequenceItem items[] = { { ASN_OBJECTIDENTIFIER, offsetof(CRYPT_ALGORITHM_IDENTIFIER, pszObjId), - CRYPT_AsnDecodeOidInternal, sizeof(LPSTR), FALSE, TRUE, + CRYPT_AsnDecodeOidInternal, sizeof(LPSTR), FALSE, TRUE, offsetof(CRYPT_ALGORITHM_IDENTIFIER, pszObjId), 0 }, { 0, offsetof(CRYPT_ALGORITHM_IDENTIFIER, Parameters), - CRYPT_AsnDecodeCopyBytes, sizeof(CRYPT_OBJID_BLOB), TRUE, TRUE, + CRYPT_AsnDecodeCopyBytes, sizeof(CRYPT_OBJID_BLOB), TRUE, TRUE, offsetof(CRYPT_ALGORITHM_IDENTIFIER, Parameters.pbData), 0 }, }; @@ -2201,7 +2201,7 @@ static BOOL WINAPI CRYPT_AsnDecodeBasicConstraints(DWORD dwCertEncodingType, { struct AsnDecodeSequenceItem items[] = { { ASN_BITSTRING, offsetof(CERT_BASIC_CONSTRAINTS_INFO, SubjectType), - CRYPT_AsnDecodeBitsInternal, sizeof(CRYPT_BIT_BLOB), FALSE, TRUE, + CRYPT_AsnDecodeBitsInternal, sizeof(CRYPT_BIT_BLOB), FALSE, TRUE, offsetof(CERT_BASIC_CONSTRAINTS_INFO, SubjectType.pbData), 0 }, { ASN_INTEGER, offsetof(CERT_BASIC_CONSTRAINTS_INFO, fPathLenConstraint), CRYPT_AsnDecodePathLenConstraint, diff --git a/reactos/dll/win32/crypt32/encode.c b/reactos/dll/win32/crypt32/encode.c index d897617d9b9..cb80416cff8 100644 --- a/reactos/dll/win32/crypt32/encode.c +++ b/reactos/dll/win32/crypt32/encode.c @@ -412,7 +412,7 @@ static BOOL WINAPI CRYPT_AsnEncodeValidity(DWORD dwCertEncodingType, { timePtr, CRYPT_AsnEncodeChoiceOfTime, 0 }, }; - ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded, pcbEncoded); return ret; @@ -485,7 +485,7 @@ static BOOL WINAPI CRYPT_AsnEncodeCert(DWORD dwCertEncodingType, if (dwFlags & CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG) items[2].encodeFunc = CRYPT_AsnEncodeBits; - ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded, pcbEncoded); } @@ -2042,7 +2042,7 @@ static BOOL WINAPI CRYPT_AsnEncodeRsaPubKey(DWORD dwCertEncodingType, ((const BYTE *)pvStructInfo + sizeof(BLOBHEADER)); CRYPT_INTEGER_BLOB blob = { rsaPubKey->bitlen / 8, (BYTE *)pvStructInfo + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) }; - struct AsnEncodeSequenceItem items[] = { + struct AsnEncodeSequenceItem items[] = { { &blob, CRYPT_AsnEncodeUnsignedInteger, 0 }, { &rsaPubKey->pubexp, CRYPT_AsnEncodeInt, 0 }, }; diff --git a/reactos/dll/win32/crypt32/main.c b/reactos/dll/win32/crypt32/main.c index f5d68d55f88..cda762dd79b 100644 --- a/reactos/dll/win32/crypt32/main.c +++ b/reactos/dll/win32/crypt32/main.c @@ -163,7 +163,7 @@ HCRYPTPROV WINAPI I_CryptGetDefaultCryptProv(DWORD reserved) BOOL WINAPI I_CryptReadTrustedPublisherDWORDValueFromRegistry(LPCWSTR name, DWORD *value) { - static const WCHAR safer[] = { + static const WCHAR safer[] = { 'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\', 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m', 'C','e','r','t','i','f','i','c','a','t','e','s','\\', diff --git a/reactos/dll/win32/crypt32/oid.c b/reactos/dll/win32/crypt32/oid.c index bbad49178a9..b574bc2e7fd 100644 --- a/reactos/dll/win32/crypt32/oid.c +++ b/reactos/dll/win32/crypt32/oid.c @@ -497,7 +497,7 @@ error_close_key: RegCloseKey(hKey); - if (r != ERROR_SUCCESS) + if (r != ERROR_SUCCESS) { SetLastError(r); return FALSE; diff --git a/reactos/dll/win32/crypt32/protectdata.c b/reactos/dll/win32/crypt32/protectdata.c index 1957e7cb4bb..4eba6b150fc 100644 --- a/reactos/dll/win32/crypt32/protectdata.c +++ b/reactos/dll/win32/crypt32/protectdata.c @@ -264,7 +264,7 @@ BOOL serialize(const struct protect_data_t *pInfo, DATA_BLOB *pSerial) /* count0 */ serialize_dword(pInfo->count0,&ptr); /*TRACE("used %u\n",ptr-pSerial->pbData);*/ - + /* info0 */ serialize_string(pInfo->info0.pbData,&ptr, pInfo->info0.cbData,sizeof(BYTE),FALSE); @@ -282,7 +282,7 @@ BOOL serialize(const struct protect_data_t *pInfo, DATA_BLOB *pSerial) /* null0 */ serialize_dword(pInfo->null0,&ptr); /*TRACE("used %u\n",ptr-pSerial->pbData);*/ - + /* szDataDescr */ serialize_string((BYTE*)pInfo->szDataDescr,&ptr, (dwStrLen+1)*sizeof(WCHAR),sizeof(BYTE),TRUE); @@ -294,7 +294,7 @@ BOOL serialize(const struct protect_data_t *pInfo, DATA_BLOB *pSerial) /* unknown1 */ serialize_dword(pInfo->unknown1,&ptr); /*TRACE("used %u\n",ptr-pSerial->pbData);*/ - + /* data0 */ serialize_string(pInfo->data0.pbData,&ptr, pInfo->data0.cbData,sizeof(BYTE),TRUE); @@ -303,14 +303,14 @@ BOOL serialize(const struct protect_data_t *pInfo, DATA_BLOB *pSerial) /* null1 */ serialize_dword(pInfo->null1,&ptr); /*TRACE("used %u\n",ptr-pSerial->pbData);*/ - + /* unknown2 */ serialize_dword(pInfo->unknown2,&ptr); /*TRACE("used %u\n",ptr-pSerial->pbData);*/ /* unknown3 */ serialize_dword(pInfo->unknown3,&ptr); /*TRACE("used %u\n",ptr-pSerial->pbData);*/ - + /* salt */ serialize_string(pInfo->salt.pbData,&ptr, pInfo->salt.cbData,sizeof(BYTE),TRUE); @@ -362,7 +362,7 @@ BOOL unserialize(const DATA_BLOB *pSerial, struct protect_data_t *pInfo) ERR("reading count0 failed!\n"); return FALSE; } - + /* info0 */ if (!unserialize_string(ptr,&index,size,16,sizeof(BYTE),FALSE, &pInfo->info0.pbData, &pInfo->info0.cbData)) @@ -392,7 +392,7 @@ BOOL unserialize(const DATA_BLOB *pSerial, struct protect_data_t *pInfo) ERR("reading null0 failed!\n"); return FALSE; } - + /* szDataDescr */ if (!unserialize_string(ptr,&index,size,0,sizeof(BYTE),TRUE, (BYTE**)&pInfo->szDataDescr, NULL)) @@ -407,14 +407,14 @@ BOOL unserialize(const DATA_BLOB *pSerial, struct protect_data_t *pInfo) ERR("reading unknown0 failed!\n"); return FALSE; } - + /* unknown1 */ if (!unserialize_dword(ptr,&index,size,&pInfo->unknown1)) { ERR("reading unknown1 failed!\n"); return FALSE; } - + /* data0 */ if (!unserialize_string(ptr,&index,size,0,sizeof(BYTE),TRUE, &pInfo->data0.pbData, &pInfo->data0.cbData)) @@ -429,21 +429,21 @@ BOOL unserialize(const DATA_BLOB *pSerial, struct protect_data_t *pInfo) ERR("reading null1 failed!\n"); return FALSE; } - + /* unknown2 */ if (!unserialize_dword(ptr,&index,size,&pInfo->unknown2)) { ERR("reading unknown2 failed!\n"); return FALSE; } - + /* unknown3 */ if (!unserialize_dword(ptr,&index,size,&pInfo->unknown3)) { ERR("reading unknown3 failed!\n"); return FALSE; } - + /* salt */ if (!unserialize_string(ptr,&index,size,0,sizeof(BYTE),TRUE, &pInfo->salt.pbData, &pInfo->salt.cbData)) diff --git a/reactos/dll/win32/crypt32/sip.c b/reactos/dll/win32/crypt32/sip.c index 1e24455aa13..f0250347dfb 100644 --- a/reactos/dll/win32/crypt32/sip.c +++ b/reactos/dll/win32/crypt32/sip.c @@ -334,8 +334,8 @@ BOOL WINAPI CryptSIPRetrieveSubjectGuid * There is a lot more to be checked: * - Check for MSFC in the header * - Check for the keys CryptSIPDllIsMyFileType and CryptSIPDllIsMyFileType2 - * under HKLM\Software\Microsoft\Cryptography\OID\EncodingType 0. Here are - * functions listed that need check if a SIP Provider can deal with the + * under HKLM\Software\Microsoft\Cryptography\OID\EncodingType 0. Here are + * functions listed that need check if a SIP Provider can deal with the * given file. */ diff --git a/reactos/dll/win32/crypt32/store.c b/reactos/dll/win32/crypt32/store.c index 3b9bcb815ce..f0d7ec2a6b8 100644 --- a/reactos/dll/win32/crypt32/store.c +++ b/reactos/dll/win32/crypt32/store.c @@ -2085,7 +2085,7 @@ HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV hProv, BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, DWORD dwSaveAs, DWORD dwSaveTo, void* pvSaveToPara, DWORD dwFlags) { - FIXME("(%p,%d,%d,%d,%p,%08x) stub!\n", hCertStore, + FIXME("(%p,%d,%d,%d,%p,%08x) stub!\n", hCertStore, dwMsgAndCertEncodingType, dwSaveAs, dwSaveTo, pvSaveToPara, dwFlags); return TRUE; } diff --git a/reactos/dll/win32/crypt32/str.c b/reactos/dll/win32/crypt32/str.c index a4e9e92141e..1639b8f94bb 100644 --- a/reactos/dll/win32/crypt32/str.c +++ b/reactos/dll/win32/crypt32/str.c @@ -224,7 +224,7 @@ DWORD WINAPI CertNameToStrA(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, } /* FIXME: handle quoting */ chars = CertRDNValueToStrA( - info->rgRDN[i].rgRDNAttr[j].dwValueType, + info->rgRDN[i].rgRDNAttr[j].dwValueType, &info->rgRDN[i].rgRDNAttr[j].Value, psz ? psz + ret : NULL, psz ? csz - ret : 0); if (chars) @@ -389,7 +389,7 @@ DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, } /* FIXME: handle quoting */ chars = CertRDNValueToStrW( - info->rgRDN[i].rgRDNAttr[j].dwValueType, + info->rgRDN[i].rgRDNAttr[j].dwValueType, &info->rgRDN[i].rgRDNAttr[j].Value, psz ? psz + ret : NULL, psz ? csz - ret : 0); if (chars) diff --git a/reactos/dll/win32/cryptui/cryptui.c b/reactos/dll/win32/cryptui/cryptui.c index 475cd136b79..8961f26d77c 100644 --- a/reactos/dll/win32/cryptui/cryptui.c +++ b/reactos/dll/win32/cryptui/cryptui.c @@ -6,7 +6,7 @@ * PURPOSE: Library main function * PROGRAMMER: Christoph von Wittich * UPDATE HISTORY: -* +* */ #include diff --git a/reactos/dll/win32/dbghelp/coff.c b/reactos/dll/win32/dbghelp/coff.c index eb672df89ad..9e8bcacb261 100644 --- a/reactos/dll/win32/dbghelp/coff.c +++ b/reactos/dll/win32/dbghelp/coff.c @@ -82,7 +82,7 @@ struct CoffFileSet int nfiles_alloc; }; -static const char* coff_get_name(const IMAGE_SYMBOL* coff_sym, +static const char* coff_get_name(const IMAGE_SYMBOL* coff_sym, const char* coff_strtab) { static char namebuff[9]; @@ -137,7 +137,7 @@ static void coff_add_symbol(struct CoffFile* coff_file, struct symt* sym) coff_file->entries = (coff_file->entries) ? HeapReAlloc(GetProcessHeap(), 0, coff_file->entries, coff_file->neps_alloc * sizeof(struct symt*)) : - HeapAlloc(GetProcessHeap(), 0, + HeapAlloc(GetProcessHeap(), 0, coff_file->neps_alloc * sizeof(struct symt*)); } coff_file->entries[coff_file->neps++] = sym; @@ -174,9 +174,9 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) coff = (const IMAGE_COFF_SYMBOLS_HEADER*)msc_dbg->root; - coff_symbols = (const IMAGE_SYMBOL*)((unsigned int)coff + + coff_symbols = (const IMAGE_SYMBOL*)((unsigned int)coff + coff->LvaToFirstSymbol); - coff_linetab = (const IMAGE_LINENUMBER*)((unsigned int)coff + + coff_linetab = (const IMAGE_LINENUMBER*)((unsigned int)coff + coff->LvaToFirstLinenumber); coff_strtab = (const char*)(coff_symbols + coff->NumberOfSymbols); @@ -189,7 +189,7 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) if (coff_sym->StorageClass == IMAGE_SYM_CLASS_FILE) { - curr_file_idx = coff_add_file(&coff_files, msc_dbg->module, + curr_file_idx = coff_add_file(&coff_files, msc_dbg->module, (const char*)(coff_sym + 1)); TRACE("New file %s\n", (const char*)(coff_sym + 1)); i += naux; @@ -221,7 +221,7 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) */ const char* fn; - fn = source_get(msc_dbg->module, + fn = source_get(msc_dbg->module, coff_files.files[curr_file_idx].compiland->source); TRACE("Duplicating sect from %s: %lx %x %x %d %d\n", @@ -268,7 +268,7 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) continue; } - if (coff_sym->StorageClass == IMAGE_SYM_CLASS_STATIC && naux == 0 && + if (coff_sym->StorageClass == IMAGE_SYM_CLASS_STATIC && naux == 0 && coff_sym->SectionNumber == 1) { DWORD base = msc_dbg->sectp[coff_sym->SectionNumber - 1].VirtualAddress; @@ -283,8 +283,8 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) /* FIXME: was adding symbol to this_file ??? */ coff_add_symbol(&coff_files.files[curr_file_idx], - &symt_new_function(msc_dbg->module, - coff_files.files[curr_file_idx].compiland, + &symt_new_function(msc_dbg->module, + coff_files.files[curr_file_idx].compiland, nampnt, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, 0 /* FIXME */, @@ -321,13 +321,13 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) if (j < coff_files.nfiles) { coff_add_symbol(&coff_files.files[j], - &symt_new_function(msc_dbg->module, compiland, nampnt, + &symt_new_function(msc_dbg->module, compiland, nampnt, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, 0 /* FIXME */, NULL /* FIXME */)->symt); - } - else + } + else { - symt_new_function(msc_dbg->module, NULL, nampnt, + symt_new_function(msc_dbg->module, NULL, nampnt, msc_dbg->module->module.BaseOfImage + base + coff_sym->Value, 0 /* FIXME */, NULL /* FIXME */); } @@ -373,7 +373,7 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) TRACE("Skipping unknown entry '%s' %d %d %d\n", coff_get_name(coff_sym, coff_strtab), coff_sym->StorageClass, coff_sym->SectionNumber, naux); - + /* * For now, skip past the aux entries. */ @@ -430,7 +430,7 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) * first. */ symt_get_info(coff_files.files[j].entries[l+1], TI_GET_ADDRESS, &addr); - symt_add_func_line(msc_dbg->module, (struct symt_function*)coff_files.files[j].entries[l+1], + symt_add_func_line(msc_dbg->module, (struct symt_function*)coff_files.files[j].entries[l+1], coff_files.files[j].compiland->source, linepnt->Linenumber, msc_dbg->module->module.BaseOfImage + linepnt->Type.VirtualAddress - addr); } diff --git a/reactos/dll/win32/dbghelp/dbghelp.c b/reactos/dll/win32/dbghelp/dbghelp.c index 287f5198926..dab8efc2302 100644 --- a/reactos/dll/win32/dbghelp/dbghelp.c +++ b/reactos/dll/win32/dbghelp/dbghelp.c @@ -33,9 +33,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); * + funcargtype:s are (partly) wrong: they should be a specific struct (like * typedef) pointing to the actual type (and not a direct access) * + we should store the underlying type for an enum in the symt_enum struct - * + for enums, we store the names & values (associated to the enum type), + * + for enums, we store the names & values (associated to the enum type), * but those values are not directly usable from a debugger (that's why, I - * assume, that we have also to define constants for enum values, as + * assume, that we have also to define constants for enum values, as * Codeview does BTW. * - most options (dbghelp_options) are not used (loading lines...) * - in symbol lookup by name, we don't use RE everywhere we should. Moreover, when @@ -47,13 +47,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); * while processing a function's parameters * + get rid of MSC reading FIXME:s (lots of types are not defined) * + C++ management - * - stabs: + * - stabs: * + when, in a same module, the same definition is used in several compilation - * units, we get several definitions of the same object (especially + * units, we get several definitions of the same object (especially * struct/union). we should find a way not to duplicate them * + in some cases (dlls/user/dialog16.c DIALOG_GetControl16), the same static * global variable is defined several times (at different scopes). We are - * getting several of those while looking for a unique symbol. Part of the + * getting several of those while looking for a unique symbol. Part of the * issue is that we don't give a scope to a static variable inside a function * + C++ management * - implement the callback notification mechanism @@ -115,7 +115,7 @@ BOOL WINAPI SymSetSearchPath(HANDLE hProcess, PSTR searchPath) /*********************************************************************** * SymGetSearchPath (DBGHELP.@) */ -BOOL WINAPI SymGetSearchPath(HANDLE hProcess, LPSTR szSearchPath, +BOOL WINAPI SymGetSearchPath(HANDLE hProcess, LPSTR szSearchPath, DWORD SearchPathLength) { struct process* pcs = process_find_by_handle(hProcess); @@ -141,7 +141,7 @@ static BOOL process_invade(HANDLE hProcess) if (!EnumProcessModules(hProcess, hMods, sizeof(hMods), &sz)) return FALSE; /* FIXME should grow hMods */ - + for (i = 0; i < sz / sizeof(HMODULE); i++) { if (!GetModuleInformation(hProcess, hMods[i], &mi, sizeof(mi)) || @@ -159,7 +159,7 @@ static BOOL process_invade(HANDLE hProcess) * The initialisation of a dbghelp's context. * Note that hProcess doesn't need to be a valid process handle (except * when fInvadeProcess is TRUE). - * Since, we're also allow to load ELF (pure) libraries and Wine ELF libraries + * Since, we're also allow to load ELF (pure) libraries and Wine ELF libraries * containing PE (and NE) module(s), here's how we handle it: * - we load every module (ELF, NE, PE) passed in SymLoadModule * - in fInvadeProcess (in SymInitialize) is TRUE, we set up what is called ELF @@ -173,7 +173,7 @@ static BOOL process_invade(HANDLE hProcess) * we won't be able to provide the requested debug information. We'll * however be able to load native PE modules (and their debug information) * without any trouble. - * Note also that this scheme can be intertwined with the deferred loading + * Note also that this scheme can be intertwined with the deferred loading * mechanism (ie only load the debug information when we actually need it). */ BOOL WINAPI SymInitialize(HANDLE hProcess, PSTR UserSearchPath, BOOL fInvadeProcess) @@ -192,7 +192,7 @@ BOOL WINAPI SymInitialize(HANDLE hProcess, PSTR UserSearchPath, BOOL fInvadeProc if (UserSearchPath) { - pcs->search_path = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(UserSearchPath) + 1), + pcs->search_path = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(UserSearchPath) + 1), UserSearchPath); } else @@ -305,7 +305,7 @@ BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame, /*********************************************************************** * SymRegisterCallback (DBGHELP.@) */ -BOOL WINAPI SymRegisterCallback(HANDLE hProcess, +BOOL WINAPI SymRegisterCallback(HANDLE hProcess, PSYMBOL_REGISTERED_CALLBACK CallbackFunction, PVOID UserContext) { diff --git a/reactos/dll/win32/dbghelp/dbghelp_private.h b/reactos/dll/win32/dbghelp/dbghelp_private.h index 49d48c7ef07..76a47e914d9 100644 --- a/reactos/dll/win32/dbghelp/dbghelp_private.h +++ b/reactos/dll/win32/dbghelp/dbghelp_private.h @@ -258,7 +258,7 @@ struct module struct module* next; enum module_type type; struct elf_module_info* elf_info; - + /* memory allocation pool */ struct pool pool; @@ -277,7 +277,7 @@ struct module char* sources; }; -struct process +struct process { struct process* next; HANDLE handle; @@ -307,14 +307,14 @@ extern struct module* module_find_by_addr(const struct process* pcs, unsigned long addr, enum module_type type); extern struct module* - module_find_by_name(const struct process* pcs, + module_find_by_name(const struct process* pcs, const char* name, enum module_type type); extern struct module* module_get_debug(const struct process* pcs, struct module*); extern struct module* - module_new(struct process* pcs, const char* name, - enum module_type type, unsigned long addr, - unsigned long size, unsigned long stamp, + module_new(struct process* pcs, const char* name, + enum module_type type, unsigned long addr, + unsigned long size, unsigned long stamp, unsigned long checksum); extern struct module* module_get_container(const struct process* pcs, @@ -323,11 +323,11 @@ extern struct module* module_get_containee(const struct process* pcs, const struct module* inner); extern void module_reset_debug_info(struct module* module); -extern BOOL module_remove(struct process* pcs, +extern BOOL module_remove(struct process* pcs, struct module* module); /* msc.c */ -extern BOOL pe_load_debug_directory(const struct process* pcs, - struct module* module, +extern BOOL pe_load_debug_directory(const struct process* pcs, + struct module* module, const BYTE* mapping, const IMAGE_SECTION_HEADER* sectp, DWORD nsect, const IMAGE_DEBUG_DIRECTORY* dbg, int nDbg); @@ -336,9 +336,9 @@ extern struct module* pe_load_module(struct process* pcs, char* name, HANDLE hFile, DWORD base, DWORD size); extern struct module* - pe_load_module_from_pcs(struct process* pcs, const char* name, + pe_load_module_from_pcs(struct process* pcs, const char* name, const char* mod_name, DWORD base, DWORD size); -extern BOOL pe_load_debug_info(const struct process* pcs, +extern BOOL pe_load_debug_info(const struct process* pcs, struct module* module); /* source.c */ extern unsigned source_new(struct module* module, const char* source); @@ -354,19 +354,19 @@ extern const char* symt_get_name(const struct symt* sym); extern int symt_cmp_addr(const void* p1, const void* p2); extern int symt_find_nearest(struct module* module, DWORD addr); extern struct symt_compiland* - symt_new_compiland(struct module* module, + symt_new_compiland(struct module* module, const char* filename); extern struct symt_public* - symt_new_public(struct module* module, - struct symt_compiland* parent, + symt_new_public(struct module* module, + struct symt_compiland* parent, const char* typename, unsigned long address, unsigned size, BOOL in_code, BOOL is_func); extern struct symt_data* - symt_new_global_variable(struct module* module, + symt_new_global_variable(struct module* module, struct symt_compiland* parent, const char* name, unsigned is_static, - unsigned long addr, unsigned long size, + unsigned long addr, unsigned long size, struct symt* type); extern struct symt_function* symt_new_function(struct module* module, @@ -374,38 +374,38 @@ extern struct symt_function* const char* name, unsigned long addr, unsigned long size, struct symt* type); -extern BOOL symt_normalize_function(struct module* module, +extern BOOL symt_normalize_function(struct module* module, struct symt_function* func); extern void symt_add_func_line(struct module* module, - struct symt_function* func, - unsigned source_idx, int line_num, + struct symt_function* func, + unsigned source_idx, int line_num, unsigned long offset); extern struct symt_data* - symt_add_func_local(struct module* module, - struct symt_function* func, + symt_add_func_local(struct module* module, + struct symt_function* func, int regno, int offset, struct symt_block* block, struct symt* type, const char* name); extern struct symt_block* - symt_open_func_block(struct module* module, + symt_open_func_block(struct module* module, struct symt_function* func, - struct symt_block* block, + struct symt_block* block, unsigned pc, unsigned len); extern struct symt_block* - symt_close_func_block(struct module* module, + symt_close_func_block(struct module* module, struct symt_function* func, struct symt_block* block, unsigned pc); extern struct symt_function_point* - symt_add_function_point(struct module* module, + symt_add_function_point(struct module* module, struct symt_function* func, - enum SymTagEnum point, + enum SymTagEnum point, unsigned offset, const char* name); extern BOOL symt_fill_func_line_info(struct module* module, - struct symt_function* func, + struct symt_function* func, DWORD addr, IMAGEHLP_LINE* line); extern BOOL symt_get_func_line_next(struct module* module, PIMAGEHLP_LINE line); extern struct symt_thunk* - symt_new_thunk(struct module* module, + symt_new_thunk(struct module* module, struct symt_compiland* parent, const char* name, THUNK_ORDINAL ord, unsigned long addr, unsigned long size); @@ -415,35 +415,35 @@ extern void symt_init_basic(struct module* module); extern BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, void* pInfo); extern struct symt_basic* - symt_new_basic(struct module* module, enum BasicType, + symt_new_basic(struct module* module, enum BasicType, const char* typename, unsigned size); extern struct symt_udt* symt_new_udt(struct module* module, const char* typename, unsigned size, enum UdtKind kind); extern BOOL symt_set_udt_size(struct module* module, struct symt_udt* type, unsigned size); -extern BOOL symt_add_udt_element(struct module* module, - struct symt_udt* udt_type, +extern BOOL symt_add_udt_element(struct module* module, + struct symt_udt* udt_type, const char* name, - struct symt* elt_type, unsigned offset, + struct symt* elt_type, unsigned offset, unsigned size); extern struct symt_enum* symt_new_enum(struct module* module, const char* typename); -extern BOOL symt_add_enum_element(struct module* module, - struct symt_enum* enum_type, +extern BOOL symt_add_enum_element(struct module* module, + struct symt_enum* enum_type, const char* name, int value); extern struct symt_array* - symt_new_array(struct module* module, int min, int max, + symt_new_array(struct module* module, int min, int max, struct symt* base); extern struct symt_function_signature* - symt_new_function_signature(struct module* module, + symt_new_function_signature(struct module* module, struct symt* ret_type); extern BOOL symt_add_function_signature_parameter(struct module* module, struct symt_function_signature* sig, struct symt* param); extern struct symt_pointer* - symt_new_pointer(struct module* module, + symt_new_pointer(struct module* module, struct symt* ref_type); extern struct symt_typedef* - symt_new_typedef(struct module* module, struct symt* ref, + symt_new_typedef(struct module* module, struct symt* ref, const char* name); diff --git a/reactos/dll/win32/dbghelp/elf_module.c b/reactos/dll/win32/dbghelp/elf_module.c index 0c7371003bf..ac7fafef9da 100644 --- a/reactos/dll/win32/dbghelp/elf_module.c +++ b/reactos/dll/win32/dbghelp/elf_module.c @@ -110,7 +110,7 @@ struct thunk_area * * creating an internal hash table to ease use ELF symtab information lookup */ -static void elf_hash_symtab(const struct module* module, struct pool* pool, +static void elf_hash_symtab(const struct module* module, struct pool* pool, struct hash_table* ht_symtab, const char* map_addr, const Elf32_Shdr* symtab, const Elf32_Shdr* strtab, unsigned num_areas, struct thunk_area* thunks) @@ -197,7 +197,7 @@ static void elf_hash_symtab(const struct module* module, struct pool* pool, * * lookup a symbol by name in our internal hash table for the symtab */ -static const Elf32_Sym* elf_lookup_symtab(const struct module* module, +static const Elf32_Sym* elf_lookup_symtab(const struct module* module, const struct hash_table* ht_symtab, const char* name, struct symt* compiland) { @@ -209,7 +209,7 @@ static const Elf32_Sym* elf_lookup_symtab(const struct module* module, const char* compiland_basename; const char* base; - /* we need weak match up (at least) when symbols of same name, + /* we need weak match up (at least) when symbols of same name, * defined several times in different compilation units, * are merged in a single one (hence a different filename for c.u.) */ @@ -221,7 +221,7 @@ static const Elf32_Sym* elf_lookup_symtab(const struct module* module, if (!compiland_basename++) compiland_basename = compiland_name; } else compiland_name = compiland_basename = NULL; - + hash_table_iter_init(ht_symtab, &hti, name); while ((ste = hash_table_iter_up(&hti))) { @@ -241,7 +241,7 @@ static const Elf32_Sym* elf_lookup_symtab(const struct module* module, } if (result) { - FIXME("Already found symbol %s (%s) in symtab %s @%08x and %s @%08x\n", + FIXME("Already found symbol %s (%s) in symtab %s @%08x and %s @%08x\n", name, compiland_name, result->filename, result->symp->st_value, ste->filename, ste->symp->st_value); } @@ -253,7 +253,7 @@ static const Elf32_Sym* elf_lookup_symtab(const struct module* module, } if (!result && !(result = weak_result)) { - FIXME("Couldn't find symbol %s.%s in symtab\n", + FIXME("Couldn't find symbol %s.%s in symtab\n", module->module.ModuleName, name); return NULL; } @@ -285,7 +285,7 @@ static void elf_finish_stabs_info(struct module* module, struct hash_table* symt { break; } - symp = elf_lookup_symtab(module, symtab, sym->hash_elt.name, + symp = elf_lookup_symtab(module, symtab, sym->hash_elt.name, ((struct symt_function*)sym)->container); if (symp) { @@ -301,7 +301,7 @@ static void elf_finish_stabs_info(struct module* module, struct hash_table* symt case DataIsFileStatic: if (((struct symt_data*)sym)->u.address != module->elf_info->elf_addr) break; - symp = elf_lookup_symtab(module, symtab, sym->hash_elt.name, + symp = elf_lookup_symtab(module, symtab, sym->hash_elt.name, ((struct symt_data*)sym)->container); if (symp) { @@ -347,18 +347,18 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt /* FIXME: this is not a good idea anyway... we are creating several * compiland objects for a same compilation unit * We try to cache the last compiland used, but it's not enough - * (we should here only create compilands if they are not yet + * (we should here only create compilands if they are not yet * defined) */ if (!compiland_name || compiland_name != ste->filename) - compiland = symt_new_compiland(module, + compiland = symt_new_compiland(module, compiland_name = ste->filename); addr = module->elf_info->elf_addr + ste->symp->st_value; for (j = 0; j < num_areas; j++) { - if (ste->symp->st_value >= thunks[j].rva_start && + if (ste->symp->st_value >= thunks[j].rva_start && ste->symp->st_value < thunks[j].rva_end) break; } @@ -373,7 +373,7 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt idx = symt_find_nearest(module, addr); if (idx != -1) - symt_get_info(&module->addr_sorttab[idx]->symt, + symt_get_info(&module->addr_sorttab[idx]->symt, TI_GET_ADDRESS, &ref_addr); if (idx == -1 || addr != ref_addr) { @@ -412,12 +412,12 @@ static int elf_new_wine_thunks(struct module* module, struct hash_table* ht_symt /* If none of symbols has a correct size, we consider they are both markers * Hence, we can silence this warning - * Also, we check that we don't have two symbols, one local, the other + * Also, we check that we don't have two symbols, one local, the other * global which is legal */ - if ((xsize || ste->symp->st_size) && + if ((xsize || ste->symp->st_size) && (kind == (ELF32_ST_BIND(ste->symp->st_info) == STB_LOCAL) ? DataIsFileStatic : DataIsGlobal)) - FIXME("Duplicate in %s: %s<%08lx-%08x> %s<%s-%08lx>\n", + FIXME("Duplicate in %s: %s<%08lx-%08x> %s<%s-%08lx>\n", module->module.ModuleName, ste->ht_elt.name, addr, ste->symp->st_size, module->addr_sorttab[idx]->hash_elt.name, @@ -452,16 +452,16 @@ static int elf_new_public_symbols(struct module* module, struct hash_table* symt /* FIXME: this is not a good idea anyway... we are creating several * compiland objects for a same compilation unit * We try to cache the last compiland used, but it's not enough - * (we should here only create compilands if they are not yet + * (we should here only create compilands if they are not yet * defined) */ if (!compiland_name || compiland_name != ste->filename) - compiland = symt_new_compiland(module, + compiland = symt_new_compiland(module, compiland_name = ste->filename); symt_new_public(module, compiland, ste->ht_elt.name, module->elf_info->elf_addr + ste->symp->st_value, - ste->symp->st_size, TRUE /* FIXME */, + ste->symp->st_size, TRUE /* FIXME */, ELF32_ST_TYPE(ste->symp->st_info) == STT_FUNC); } return TRUE; @@ -610,7 +610,7 @@ static BOOL elf_load_debug_info_from_file( const char* shstrtab; int i; int symtab_sect, dynsym_sect, stab_sect, stabstr_sect, debug_sect, debuglink_sect; - struct thunk_area thunks[] = + struct thunk_area thunks[] = { {"__wine_spec_import_thunks", THUNK_ORDINAL_NOTYPE, 0, 0}, /* inter DLL calls */ {"__wine_spec_delayed_import_loaders", THUNK_ORDINAL_LOAD, 0, 0}, /* delayed inter DLL calls */ @@ -683,7 +683,7 @@ static BOOL elf_load_debug_info_from_file( if (symtab_sect == -1) { /* if we don't have a symtab but a dynsym, process the dynsym - * section instead. It'll contain less (relevant) information, + * section instead. It'll contain less (relevant) information, * but it'll be better than nothing */ if (dynsym_sect == -1) goto leave; @@ -693,7 +693,7 @@ static BOOL elf_load_debug_info_from_file( module->module.SymType = SymExport; /* create a hash table for the symtab */ - elf_hash_symtab(module, pool, ht_symtab, addr, + elf_hash_symtab(module, pool, ht_symtab, addr, spnt + symtab_sect, spnt + spnt[symtab_sect].sh_link, sizeof(thunks) / sizeof(thunks[0]), thunks); @@ -737,7 +737,7 @@ static BOOL elf_load_debug_info_from_file( { /* add the thunks for native libraries */ if (!(dbghelp_options & SYMOPT_PUBLICS_ONLY)) - elf_new_wine_thunks(module, ht_symtab, + elf_new_wine_thunks(module, ht_symtab, sizeof(thunks) / sizeof(thunks[0]), thunks); } /* add all the public symbols from symtab */ @@ -775,7 +775,7 @@ BOOL elf_load_debug_info(struct module* module) /****************************************************************** * is_dt_flag_valid - * returns true iff the section tag is valid + * returns true iff the section tag is valid */ static unsigned is_dt_flag_valid(unsigned d_tag) { @@ -898,11 +898,11 @@ static BOOL elf_load_file(struct process* pcs, const char* filename, if (elf_info->flags & ELF_INFO_MODULE) { - struct elf_module_info *elf_module_info = + struct elf_module_info *elf_module_info = HeapAlloc(GetProcessHeap(), 0, sizeof(struct elf_module_info)); if (!elf_module_info) goto leave; - elf_info->module = module_new(pcs, filename, DMT_ELF, - (load_offset) ? load_offset : start, + elf_info->module = module_new(pcs, filename, DMT_ELF, + (load_offset) ? load_offset : start, size, 0, 0); if (!elf_info->module) { @@ -947,7 +947,7 @@ static BOOL elf_load_file_from_path(HANDLE hProcess, if (!path) return FALSE; paths = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(path) + 1), path); - for (s = paths; s && *s; s = (t) ? (t+1) : NULL) + for (s = paths; s && *s; s = (t) ? (t+1) : NULL) { t = strchr(s, ':'); if (t) *t = '\0'; @@ -961,7 +961,7 @@ static BOOL elf_load_file_from_path(HANDLE hProcess, if (ret) break; s = (t) ? (t+1) : NULL; } - + HeapFree(GetProcessHeap(), 0, paths); return ret; } @@ -972,7 +972,7 @@ static BOOL elf_load_file_from_path(HANDLE hProcess, * lookup a file in standard ELF locations, and if found, load it */ static BOOL elf_search_and_load_file(struct process* pcs, const char* filename, - unsigned long load_offset, + unsigned long load_offset, struct elf_info* elf_info) { BOOL ret = FALSE; @@ -991,14 +991,14 @@ static BOOL elf_search_and_load_file(struct process* pcs, const char* filename, /* if relative pathname, try some absolute base dirs */ if (!ret && !strchr(filename, '/')) { - ret = elf_load_file_from_path(pcs, filename, load_offset, + ret = elf_load_file_from_path(pcs, filename, load_offset, getenv("PATH"), elf_info) || elf_load_file_from_path(pcs, filename, load_offset, getenv("LD_LIBRARY_PATH"), elf_info) || elf_load_file_from_path(pcs, filename, load_offset, getenv("WINEDLLPATH"), elf_info); } - + return ret; } @@ -1020,7 +1020,7 @@ BOOL elf_synchronize_module_list(struct process* pcs) struct module* module; if (!pcs->dbg_hdr_addr || - !ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, + !ReadProcessMemory(pcs->handle, (void*)pcs->dbg_hdr_addr, &dbg_hdr, sizeof(dbg_hdr), NULL)) return FALSE; @@ -1042,7 +1042,7 @@ BOOL elf_synchronize_module_list(struct process* pcs) if (lm.l_prev != NULL && /* skip first entry, normally debuggee itself */ lm.l_name != NULL && - ReadProcessMemory(pcs->handle, lm.l_name, bufstr, sizeof(bufstr), NULL)) + ReadProcessMemory(pcs->handle, lm.l_name, bufstr, sizeof(bufstr), NULL)) { bufstr[sizeof(bufstr) - 1] = '\0'; elf_search_and_load_file(pcs, bufstr, (unsigned long)lm.l_addr, @@ -1052,7 +1052,7 @@ BOOL elf_synchronize_module_list(struct process* pcs) for (module = pcs->lmodules; module; module = module->next) { - if (module->type == DMT_ELF && !module->elf_info->elf_mark && + if (module->type == DMT_ELF && !module->elf_info->elf_mark && !module->elf_info->elf_loader) { module_remove(pcs, module); @@ -1082,7 +1082,7 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs) */ if ((ptr = getenv("WINELOADER"))) ret = elf_search_and_load_file(pcs, ptr, 0, &elf_info); - else + else { ret = elf_search_and_load_file(pcs, "wine-kthread", 0, &elf_info) || elf_search_and_load_file(pcs, "wine-pthread", 0, &elf_info); @@ -1131,7 +1131,7 @@ struct module* elf_load_module(struct process* pcs, const char* name) if (lm.l_prev != NULL && /* skip first entry, normally debuggee itself */ lm.l_name != NULL && - ReadProcessMemory(pcs->handle, lm.l_name, bufstr, sizeof(bufstr), NULL)) + ReadProcessMemory(pcs->handle, lm.l_name, bufstr, sizeof(bufstr), NULL)) { bufstr[sizeof(bufstr) - 1] = '\0'; /* memcmp is needed for matches when bufstr contains also version information diff --git a/reactos/dll/win32/dbghelp/memory.c b/reactos/dll/win32/dbghelp/memory.c index f20d9188791..ebf58400458 100644 --- a/reactos/dll/win32/dbghelp/memory.c +++ b/reactos/dll/win32/dbghelp/memory.c @@ -39,12 +39,12 @@ DWORD WINAPI addr_to_linear(HANDLE hProcess, HANDLE hThread, ADDRESS* addr) { case AddrMode1616: if (GetThreadSelectorEntry(hThread, addr->Segment, &le)) - return (le.HighWord.Bits.BaseHi << 24) + + return (le.HighWord.Bits.BaseHi << 24) + (le.HighWord.Bits.BaseMid << 16) + le.BaseLow + LOWORD(addr->Offset); break; case AddrMode1632: if (GetThreadSelectorEntry(hThread, addr->Segment, &le)) - return (le.HighWord.Bits.BaseHi << 24) + + return (le.HighWord.Bits.BaseHi << 24) + (le.HighWord.Bits.BaseMid << 16) + le.BaseLow + addr->Offset; break; case AddrModeReal: diff --git a/reactos/dll/win32/dbghelp/minidump.c b/reactos/dll/win32/dbghelp/minidump.c index 67cb291c2ba..be35ce57d40 100644 --- a/reactos/dll/win32/dbghelp/minidump.c +++ b/reactos/dll/win32/dbghelp/minidump.c @@ -65,9 +65,9 @@ static void dump_modules(struct process* pcs, HANDLE hFile, RVA* rva) mdModuleList.NumberOfModules = 0; for (module = pcs->lmodules; module; module = module->next) mdModuleList.NumberOfModules++; - WriteFile(hFile, &mdModuleList.NumberOfModules, + WriteFile(hFile, &mdModuleList.NumberOfModules, sizeof(mdModuleList.NumberOfModules), &written, NULL); - *rva += sizeof(mdModuleList.NumberOfModules) + + *rva += sizeof(mdModuleList.NumberOfModules) + sizeof(mdModule) * mdModuleList.NumberOfModules; for (module = pcs->lmodules; module; module = module->next) { @@ -88,7 +88,7 @@ static void dump_modules(struct process* pcs, HANDLE hFile, RVA* rva) } for (module = pcs->lmodules; module; module = module->next) { - WriteFile(hFile, module->module.ModuleName, + WriteFile(hFile, module->module.ModuleName, strlen(module->module.ModuleName) + 1, &written, NULL); FIXME("CV and misc records not written\n"); } @@ -124,7 +124,7 @@ static void dump_system_info(struct process* pcs, HANDLE hFile, RVA* rva) WriteFile(hFile, &mdSysInfo, sizeof(mdSysInfo), &written, NULL); *rva += sizeof(mdSysInfo); - WriteFile(hFile, osInfo.szCSDVersion, strlen(osInfo.szCSDVersion) + 1, + WriteFile(hFile, osInfo.szCSDVersion, strlen(osInfo.szCSDVersion) + 1, &written, NULL); *rva += strlen(osInfo.szCSDVersion) + 1; } @@ -143,9 +143,9 @@ static void dump_threads(struct process* pcs, HANDLE hFile, RVA* rva) DBG_THREAD* thd; mdThdList.NumberOfThreads = pcs->num_threads; - WriteFile(hFile, &mdThdList.NumberOfThreads, sizeof(mdThdList.NumberOfThreads), + WriteFile(hFile, &mdThdList.NumberOfThreads, sizeof(mdThdList.NumberOfThreads), &written, NULL); - *rva += sizeof(mdThdList.NumberOfThreads) + + *rva += sizeof(mdThdList.NumberOfThreads) + mdThdList.NumberOfThreads * sizeof(mdThd); for (thd = pcs->threads; thd; thd = thd->next) { @@ -214,7 +214,7 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD ProcessId, HANDLE hFile, mdHead.u.TimeDateStamp = time(NULL); mdHead.Flags = DumpType; WriteFile(hFile, &mdHead, sizeof(mdHead), &written, NULL); - + /* 3) write stream directories */ rva += (nStream + addStream) * sizeof(mdDir); /* 3.1) write data stream directories */ @@ -254,9 +254,9 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD ProcessId, HANDLE hFile, WriteFile(hFile, &mdDir, sizeof(mdDir), &written, NULL); currRva = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); SetFilePointer(hFile, rva, NULL, FILE_BEGIN); - WriteFile(hFile, - UserStreamParam->UserStreamArray[i].Buffer, - UserStreamParam->UserStreamArray[i].BufferSize, + WriteFile(hFile, + UserStreamParam->UserStreamArray[i].Buffer, + UserStreamParam->UserStreamArray[i].BufferSize, &written, NULL); rva += UserStreamParam->UserStreamArray[i].BufferSize; SetFilePointer(hFile, currRva, NULL, FILE_BEGIN); diff --git a/reactos/dll/win32/dbghelp/path.c b/reactos/dll/win32/dbghelp/path.c index f316f9c75df..59be299f370 100644 --- a/reactos/dll/win32/dbghelp/path.c +++ b/reactos/dll/win32/dbghelp/path.c @@ -57,17 +57,17 @@ HANDLE WINAPI FindDebugInfoFile(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePa } return (h == INVALID_HANDLE_VALUE) ? NULL : h; } - + /****************************************************************** * FindDebugInfoFileEx (DBGHELP.@) * */ HANDLE WINAPI FindDebugInfoFileEx(PSTR FileName, PSTR SymbolPath, - PSTR DebugFilePath, + PSTR DebugFilePath, PFIND_DEBUG_FILE_CALLBACK Callback, PVOID CallerData) { - FIXME("(%s %s %p %p %p): stub\n", + FIXME("(%s %s %p %p %p): stub\n", FileName, SymbolPath, DebugFilePath, Callback, CallerData); return NULL; } @@ -81,7 +81,7 @@ HANDLE WINAPI FindExecutableImage(PSTR FileName, PSTR SymbolPath, PSTR ImageFile HANDLE h; if (!SearchPathA(SymbolPath, FileName, NULL, MAX_PATH, ImageFilePath, NULL)) return NULL; - h = CreateFileA(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL, + h = CreateFileA(ImageFilePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); return (h == INVALID_HANDLE_VALUE) ? NULL : h; } @@ -153,7 +153,7 @@ static BOOL do_search(const char* file, char* buffer, strcpy(buffer + pos, "*.*"); if ((h = FindFirstFileA(buffer, &fd)) == INVALID_HANDLE_VALUE) return FALSE; - /* doc doesn't specify how the tree is enumerated... + /* doc doesn't specify how the tree is enumerated... * doing a depth first based on, but may be wrong */ do @@ -179,7 +179,7 @@ static BOOL do_search(const char* file, char* buffer, */ BOOL WINAPI SearchTreeForFile(LPSTR root, LPSTR file, LPSTR buffer) { - TRACE("(%s, %s, %p)\n", + TRACE("(%s, %s, %p)\n", debugstr_a(root), debugstr_a(file), buffer); strcpy(buffer, root); return do_search(file, buffer, NULL, NULL); @@ -237,7 +237,7 @@ BOOL WINAPI SymFindFileInPath(HANDLE hProcess, LPSTR searchPath, LPSTR file, char* ptr; TRACE("(%p %s %s %p %08lx %08lx %08lx %p %p %p)\n", - hProcess, searchPath, file, id, two, three, flags, + hProcess, searchPath, file, id, two, three, flags, buffer, cb, user); if (!pcs) return FALSE; diff --git a/reactos/dll/win32/dbghelp/pe_module.c b/reactos/dll/win32/dbghelp/pe_module.c index a6b95549a4f..1ac65ca27ae 100644 --- a/reactos/dll/win32/dbghelp/pe_module.c +++ b/reactos/dll/win32/dbghelp/pe_module.c @@ -37,10 +37,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); /****************************************************************** * pe_load_stabs * - * look for stabs information in PE header (it's how the mingw compiler provides + * look for stabs information in PE header (it's how the mingw compiler provides * its debugging information) */ -static BOOL pe_load_stabs(const struct process* pcs, struct module* module, +static BOOL pe_load_stabs(const struct process* pcs, struct module* module, const void* mapping, IMAGE_NT_HEADERS* nth) { IMAGE_SECTION_HEADER* section; @@ -66,8 +66,8 @@ static BOOL pe_load_stabs(const struct process* pcs, struct module* module, if (stabstrsize && stabsize) { - ret = stabs_parse(module, - module->module.BaseOfImage - nth->OptionalHeader.ImageBase, + ret = stabs_parse(module, + module->module.BaseOfImage - nth->OptionalHeader.ImageBase, RtlImageRvaToVa(nth, (void*)mapping, stabs, NULL), stabsize, RtlImageRvaToVa(nth, (void*)mapping, stabstr, NULL), @@ -99,10 +99,10 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, WINE_TRACE("Processing DBG file %s\n", dbg_name); - if (SymFindFileInPath(pcs->handle, NULL, (char*)dbg_name, + if (SymFindFileInPath(pcs->handle, NULL, (char*)dbg_name, NULL, 0, 0, 0, tmp, dbg_match, NULL) && - (hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL, + (hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE && ((hMap = CreateFileMappingA(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) && ((dbg_mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)) @@ -125,8 +125,8 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, const IMAGE_SECTION_HEADER *sectp = (const IMAGE_SECTION_HEADER*)(hdr + 1); /* and after that and the exported names comes the debug directory */ - dbg = (const IMAGE_DEBUG_DIRECTORY*) - (dbg_mapping + sizeof(*hdr) + + dbg = (const IMAGE_DEBUG_DIRECTORY*) + (dbg_mapping + sizeof(*hdr) + hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) + hdr->ExportedNamesSize); @@ -152,7 +152,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, * * Process MSC debug information in PE file. */ -static BOOL pe_load_msc_debug_info(const struct process* pcs, +static BOOL pe_load_msc_debug_info(const struct process* pcs, struct module* module, const void* mapping, IMAGE_NT_HEADERS* nth) { @@ -200,8 +200,8 @@ static BOOL pe_load_msc_debug_info(const struct process* pcs, /*********************************************************************** * pe_load_export_debug_info */ -static BOOL pe_load_export_debug_info(const struct process* pcs, - struct module* module, +static BOOL pe_load_export_debug_info(const struct process* pcs, + struct module* module, const void* mapping, IMAGE_NT_HEADERS* nth) { unsigned int i; @@ -217,22 +217,22 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, symt_new_public(module, NULL, module->module.ModuleName, base, 0, TRUE /* FIXME */, TRUE /* FIXME */); #endif - + /* Add entry point */ - symt_new_public(module, NULL, "EntryPoint", + symt_new_public(module, NULL, "EntryPoint", base + nth->OptionalHeader.AddressOfEntryPoint, 0, TRUE, TRUE); #if 0 - /* FIXME: we'd better store addresses linked to sections rather than + /* FIXME: we'd better store addresses linked to sections rather than absolute values */ IMAGE_SECTION_HEADER* section; /* Add start of sections */ section = (IMAGE_SECTION_HEADER*) ((char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader); - for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++) + for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++) { - symt_new_public(module, NULL, section->Name, - RtlImageRvaToVa(nth, (void*)mapping, section->VirtualAddress, NULL), + symt_new_public(module, NULL, section->Name, + RtlImageRvaToVa(nth, (void*)mapping, section->VirtualAddress, NULL), 0, TRUE /* FIXME */, TRUE /* FIXME */); } #endif @@ -251,16 +251,16 @@ static BOOL pe_load_export_debug_info(const struct process* pcs, ordinals = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfNameOrdinals, NULL); names = RtlImageRvaToVa(nth, (void*)mapping, exports->AddressOfNames, NULL); - for (i = 0; i < exports->NumberOfNames; i++) + for (i = 0; i < exports->NumberOfNames; i++) { if (!names[i]) continue; - symt_new_public(module, NULL, + symt_new_public(module, NULL, RtlImageRvaToVa(nth, (void*)mapping, names[i], NULL), - base + functions[ordinals[i]], + base + functions[ordinals[i]], 0, TRUE /* FIXME */, TRUE /* FIXME */); } - - for (i = 0; i < exports->NumberOfFunctions; i++) + + for (i = 0; i < exports->NumberOfFunctions; i++) { if (!functions[i]) continue; /* Check if we already added it with a name */ @@ -304,7 +304,7 @@ BOOL pe_load_debug_info(const struct process* pcs, struct module* module) ret = pe_load_stabs(pcs, module, mapping, nth) || pe_load_msc_debug_info(pcs, module, mapping, nth); /* if we still have no debug info (we could only get SymExport at this - * point), then do the SymExport except if we have an ELF container, + * point), then do the SymExport except if we have an ELF container, * in which case we'll rely on the export's on the ELF side */ } @@ -359,9 +359,9 @@ struct module* pe_load_module(struct process* pcs, char* name, { if (!base) base = nth->OptionalHeader.ImageBase; if (!size) size = nth->OptionalHeader.SizeOfImage; - + module = module_new(pcs, loaded_name, DMT_PE, base, size, - nth->FileHeader.TimeDateStamp, + nth->FileHeader.TimeDateStamp, nth->OptionalHeader.CheckSum); if (module) { @@ -384,7 +384,7 @@ struct module* pe_load_module(struct process* pcs, char* name, * pe_load_module_from_pcs * */ -struct module* pe_load_module_from_pcs(struct process* pcs, const char* name, +struct module* pe_load_module_from_pcs(struct process* pcs, const char* name, const char* mod_name, DWORD base, DWORD size) { struct module* module; @@ -411,7 +411,7 @@ struct module* pe_load_module_from_pcs(struct process* pcs, const char* name, if (ReadProcessMemory(pcs->handle, (char*)base, &dos, sizeof(dos), NULL) && dos.e_magic == IMAGE_DOS_SIGNATURE && - ReadProcessMemory(pcs->handle, (char*)(base + dos.e_lfanew), + ReadProcessMemory(pcs->handle, (char*)(base + dos.e_lfanew), &nth, sizeof(nth), NULL) && nth.Signature == IMAGE_NT_SIGNATURE) { diff --git a/reactos/dll/win32/dbghelp/source.c b/reactos/dll/win32/dbghelp/source.c index 09cb33440af..9271ce7dc81 100644 --- a/reactos/dll/win32/dbghelp/source.c +++ b/reactos/dll/win32/dbghelp/source.c @@ -102,11 +102,11 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, LPSTR Mask, struct module* module; SOURCEFILE sf; char* ptr; - + if (!cbSrcFiles) return FALSE; pcs = process_find_by_handle(hProcess); if (!pcs) return FALSE; - + if (ModBase) { module = module_find_by_addr(pcs, ModBase, DMT_UNKNOWN); diff --git a/reactos/dll/win32/dbghelp/stabs.c b/reactos/dll/win32/dbghelp/stabs.c index f3934d8222b..3a07e434d6f 100644 --- a/reactos/dll/win32/dbghelp/stabs.c +++ b/reactos/dll/win32/dbghelp/stabs.c @@ -122,7 +122,7 @@ static void stab_strcpy(char* dest, int sz, const char* source) while (isdigit(*dest)) dest--; if (*dest == '.') *dest = '\0'; } - + assert(sz > 0); } @@ -151,7 +151,7 @@ static int stabs_new_include(const char* file, unsigned long val) { num_alloc_include_def += 256; if (!include_defs) - include_defs = HeapAlloc(GetProcessHeap(), 0, + include_defs = HeapAlloc(GetProcessHeap(), 0, sizeof(include_defs[0]) * num_alloc_include_def); else include_defs = HeapReAlloc(GetProcessHeap(), 0, include_defs, @@ -232,10 +232,10 @@ static struct symt** stabs_find_ref(long filenr, long subnr) if (cu_nrofentries <= subnr) { if (!cu_vector) - cu_vector = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + cu_vector = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(cu_vector[0]) * (subnr+1)); else - cu_vector = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + cu_vector = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cu_vector, sizeof(cu_vector[0]) * (subnr+1)); cu_nrofentries = subnr + 1; } @@ -251,10 +251,10 @@ static struct symt** stabs_find_ref(long filenr, long subnr) if (idef->nrofentries <= subnr) { if (!idef->vector) - idef->vector = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + idef->vector = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(idef->vector[0]) * (subnr+1)); else - idef->vector = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + idef->vector = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, idef->vector, sizeof(idef->vector[0]) * (subnr+1)); idef->nrofentries = subnr + 1; } @@ -268,7 +268,7 @@ static struct symt** stabs_read_type_enum(const char** x) { long filenr, subnr; - if (**x == '(') + if (**x == '(') { (*x)++; /* '(' */ filenr = strtol(*x, (char**)x, 10); /* */ @@ -292,7 +292,7 @@ struct ParseTypedefData int idx; struct module* module; #ifdef PTS_DEBUG - struct PTS_Error + struct PTS_Error { const char* ptr; unsigned line; @@ -349,12 +349,12 @@ static int stabs_get_basic(struct ParseTypedefData* ptd, unsigned basic, struct case 35: stabs_basic[basic] = symt_new_basic(ptd->module, btComplex, "long double complex", 24); break; default: PTS_ABORTIF(ptd, 1); } - } + } *symt = &stabs_basic[basic]->symt; return 0; } -static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, +static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typename, struct symt** dt); static int stabs_pts_read_id(struct ParseTypedefData* ptd) @@ -420,7 +420,7 @@ static int stabs_pts_read_range_value(struct ParseTypedefData* ptd, struct pts_r { switch (ptd->ptr[1]) { - case '0': + case '0': PTS_ABORTIF(ptd, ptd->ptr[0] != '1'); prv->sign = -1; prv->val = 0; @@ -441,7 +441,7 @@ static int stabs_pts_read_range_value(struct ParseTypedefData* ptd, struct pts_r ptd->ptr = last; break; case '+': - default: + default: prv->sign = 1; prv->val = _strtoui64(ptd->ptr, &last, 10); ptd->ptr = last; @@ -572,7 +572,7 @@ static __inline int stabs_pts_read_method_info(struct ParseTypedefData* ptd) return 0; } -static __inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, +static __inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, struct symt_udt* sdt) { long sz, ofs; @@ -607,7 +607,7 @@ static __inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, symt_get_info(adt, TI_GET_SYMNAME, &name); strcmp(tmp, "__inherited_class_"); - WideCharToMultiByte(CP_ACP, 0, name, -1, + WideCharToMultiByte(CP_ACP, 0, name, -1, tmp + strlen(tmp), sizeof(tmp) - strlen(tmp), NULL, NULL); HeapFree(GetProcessHeap(), 0, name); @@ -622,7 +622,7 @@ static __inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, } PTS_ABORTIF(ptd, *ptd->ptr++ != ';'); } - + } /* if the structure has already been filled, just redo the parsing * but don't store results into the struct @@ -630,7 +630,7 @@ static __inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, */ /* Now parse the individual elements of the structure/union. */ - while (*ptd->ptr != ';') + while (*ptd->ptr != ';') { /* agg_name : type ',' ',' */ idx = ptd->idx; @@ -672,7 +672,7 @@ static __inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, */ if (*ptd->ptr == ':') { - ptd->ptr++; + ptd->ptr++; stabs_pts_read_method_info(ptd); ptd->idx = idx; continue; @@ -718,7 +718,7 @@ static __inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd, return 0; } -static __inline int stabs_pts_read_enum(struct ParseTypedefData* ptd, +static __inline int stabs_pts_read_enum(struct ParseTypedefData* ptd, struct symt_enum* edt) { long value; @@ -781,7 +781,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ PTS_ABORTIF(ptd, new_dt != btNoType); /* first handle attribute if any */ - switch (*ptd->ptr) + switch (*ptd->ptr) { case '@': if (*++ptd->ptr == 's') @@ -916,7 +916,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ { long type, len, unk; int basic; - + PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &type) == -1); PTS_ABORTIF(ptd, *ptd->ptr++ != ';'); /* ';' */ PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &len) == -1); @@ -955,7 +955,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ new_dt = &symt_new_basic(ptd->module, btVoid, typename, 0)->symt; PTS_ABORTIF(ptd, strcmp(typename, "void")); } - } + } *stabs_find_ref(filenr1, subnr1) = *ret_dt = new_dt; @@ -964,7 +964,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ return 0; } -static int stabs_parse_typedef(struct module* module, const char* ptr, +static int stabs_parse_typedef(struct module* module, const char* ptr, const char* typename) { struct ParseTypedefData ptd; @@ -992,7 +992,7 @@ static int stabs_parse_typedef(struct module* module, const char* ptr, ret = stabs_pts_read_type_def(&ptd, typename, &dt); } - if (ret == -1 || *ptd.ptr) + if (ret == -1 || *ptd.ptr) { #ifdef PTS_DEBUG int i; @@ -1001,13 +1001,13 @@ static int stabs_parse_typedef(struct module* module, const char* ptr, { for (i = 0; i < ptd.err_idx; i++) { - TRACE("[%d]: line %d => %s\n", + TRACE("[%d]: line %d => %s\n", i, ptd.errors[i].line, debugstr_a(ptd.errors[i].ptr)); } } else TRACE("[0]: => %s\n", debugstr_a(ptd.ptr)); - + #else ERR("Failure on %s at %s\n", debugstr_a(ptr), debugstr_a(ptd.ptr)); #endif @@ -1062,14 +1062,14 @@ struct pending_loc_var * Ends function creation: mainly: * - cleans up line number information * - tries to set up a debug-start tag (FIXME: heuristic to be enhanced) - * - for stabs which have abolute address in them, initializes the size of the + * - for stabs which have abolute address in them, initializes the size of the * function (assuming that current function ends where next function starts) */ static void stabs_finalize_function(struct module* module, struct symt_function* func, unsigned long end) { IMAGEHLP_LINE il; - + if (!func) return; symt_normalize_function(module, func); /* To define the debug-start of the function, we use the second line number. @@ -1078,13 +1078,13 @@ static void stabs_finalize_function(struct module* module, struct symt_function* if (symt_fill_func_line_info(module, func, func->address, &il) && symt_get_func_line_next(module, &il)) { - symt_add_function_point(module, func, SymTagFuncDebugStart, + symt_add_function_point(module, func, SymTagFuncDebugStart, il.Address - func->address, NULL); } if (end) func->size = end - func->address; } -BOOL stabs_parse(struct module* module, unsigned long load_offset, +BOOL stabs_parse(struct module* module, unsigned long load_offset, const void* pv_stab_ptr, int stablen, const char* strs, int strtablen) { @@ -1217,7 +1217,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, "rbrac","","","", /* e0 */ }; - FIXME("Got %s<%u> %u/%lu (%s)\n", + FIXME("Got %s<%u> %u/%lu (%s)\n", defs[stab_ptr->n_type / 2], stab_ptr->n_type, stab_ptr->n_desc, stab_ptr->n_value, debugstr_a(ptr)); #endif @@ -1250,7 +1250,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, stab_ptr->n_value, 0); for (j = 0; j < num_pending_vars; j++) { - symt_add_func_local(module, curr_func, pending_vars[j].regno, + symt_add_func_local(module, curr_func, pending_vars[j].regno, pending_vars[j].offset, block, pending_vars[j].type, pending_vars[j].name); } @@ -1266,10 +1266,10 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, { struct symt* param_type = stabs_parse_type(ptr); stab_strcpy(symname, sizeof(symname), ptr); - symt_add_func_local(module, curr_func, 0, stab_ptr->n_value, + symt_add_func_local(module, curr_func, 0, stab_ptr->n_value, NULL, param_type, symname); - symt_add_function_signature_parameter(module, - (struct symt_function_signature*)curr_func->type, + symt_add_function_signature_parameter(module, + (struct symt_function_signature*)curr_func->type, param_type); } break; @@ -1283,7 +1283,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, { num_allocated_pending_vars += 8; if (!pending_vars) - pending_vars = HeapAlloc(GetProcessHeap(), 0, + pending_vars = HeapAlloc(GetProcessHeap(), 0, num_allocated_pending_vars * sizeof(pending_vars[0])); else pending_vars = HeapReAlloc(GetProcessHeap(), 0, pending_vars, @@ -1314,7 +1314,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, break; } - stab_strcpy(pending_vars[num_pending_vars].name, + stab_strcpy(pending_vars[num_pending_vars].name, sizeof(pending_vars[num_pending_vars].name), ptr); pending_vars[num_pending_vars].type = stabs_parse_type(ptr); pending_vars[num_pending_vars].offset = 0; @@ -1330,13 +1330,13 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, { num_allocated_pending_vars += 8; if (!pending_vars) - pending_vars = HeapAlloc(GetProcessHeap(), 0, + pending_vars = HeapAlloc(GetProcessHeap(), 0, num_allocated_pending_vars * sizeof(pending_vars[0])); else pending_vars = HeapReAlloc(GetProcessHeap(), 0, pending_vars, num_allocated_pending_vars * sizeof(pending_vars[0])); - } - stab_strcpy(pending_vars[num_pending_vars].name, + } + stab_strcpy(pending_vars[num_pending_vars].name, sizeof(pending_vars[num_pending_vars].name), ptr); pending_vars[num_pending_vars].type = stabs_parse_type(ptr); pending_vars[num_pending_vars].offset = stab_ptr->n_value; @@ -1352,13 +1352,13 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, if (curr_func != NULL) { assert(source_idx >= 0); - symt_add_func_line(module, curr_func, source_idx, + symt_add_func_line(module, curr_func, source_idx, stab_ptr->n_desc, stab_ptr->n_value); } break; case N_FUN: /* First, clean up the previous function we were working on. */ - stabs_finalize_function(module, curr_func, + stabs_finalize_function(module, curr_func, stab_ptr->n_value ? load_offset + stab_ptr->n_value : 0); /* @@ -1377,9 +1377,9 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, if (*symname) { struct symt_function_signature* func_type; - func_type = symt_new_function_signature(module, + func_type = symt_new_function_signature(module, stabs_parse_type(ptr)); - curr_func = symt_new_function(module, compiland, symname, + curr_func = symt_new_function(module, compiland, symname, load_offset + stab_ptr->n_value, 0, &func_type->symt); } @@ -1398,7 +1398,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, { /* Nuke old path. */ srcpath[0] = '\0'; - stabs_finalize_function(module, curr_func, + stabs_finalize_function(module, curr_func, stab_ptr->n_value ? load_offset + stab_ptr->n_value : 0); curr_func = NULL; source_idx = -1; @@ -1469,7 +1469,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset, break; } stabbuff[0] = '\0'; - TRACE("0x%02x %lx %s\n", + TRACE("0x%02x %lx %s\n", stab_ptr->n_type, stab_ptr->n_value, debugstr_a(strs + stab_ptr->n_un.n_strx)); } module->module.SymType = SymDia; diff --git a/reactos/dll/win32/dbghelp/stack.c b/reactos/dll/win32/dbghelp/stack.c index 601131a2b9d..248de457700 100644 --- a/reactos/dll/win32/dbghelp/stack.c +++ b/reactos/dll/win32/dbghelp/stack.c @@ -100,10 +100,10 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, if (!f_xlat_adr) f_xlat_adr = addr_to_linear; TRACE("Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s cSwitch=%08lx nSwitch=%08lx\n", - wine_dbgstr_addr(&frame->AddrPC), + wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), - wine_dbgstr_addr(&frame->AddrStack), + wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : (curr_mode == stm_16bit ? "16bit" : "32bit"), curr_switch, next_switch); @@ -119,18 +119,18 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, } /* Init done */ - curr_mode = (frame->AddrPC.Mode == AddrModeFlat) ? + curr_mode = (frame->AddrPC.Mode == AddrModeFlat) ? stm_32bit : stm_16bit; /* cur_switch holds address of curr_stack's field in TEB in debuggee * address space */ /* - if (NtQueryInformationThread(hThread, ThreadBasicInformation, &info, + if (NtQueryInformationThread(hThread, ThreadBasicInformation, &info, sizeof(info), NULL) != STATUS_SUCCESS) goto done_err; curr_switch = (unsigned long)info.TebBaseAddress + FIELD_OFFSET(TEB, cur_stack); */ - if (!f_read_mem(hProcess, (void*)curr_switch, &next_switch, + if (!f_read_mem(hProcess, (void*)curr_switch, &next_switch, sizeof(next_switch), NULL)) { WARN("Can't read TEB:cur_stack\n"); @@ -138,7 +138,7 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, } if (curr_mode == stm_16bit) { - if (!f_read_mem(hProcess, (void*)next_switch, &frame32, + if (!f_read_mem(hProcess, (void*)next_switch, &frame32, sizeof(frame32), NULL)) { WARN("Bad stack frame 0x%08lx\n", next_switch); @@ -185,16 +185,16 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, else { assert(curr_mode == stm_16bit); - do_switch = OFFSETOF(curr_switch) && + do_switch = OFFSETOF(curr_switch) && frame->AddrFrame.Segment == SELECTOROF(curr_switch) && frame->AddrFrame.Offset >= OFFSETOF(curr_switch); } - + if (do_switch) { if (curr_mode == stm_16bit) { - if (!f_read_mem(hProcess, (void*)next_switch, &frame32, + if (!f_read_mem(hProcess, (void*)next_switch, &frame32, sizeof(frame32), NULL)) { WARN("Bad stack frame 0x%08lx\n", next_switch); @@ -256,7 +256,7 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, frame16.entry_ip, frame16.entry_point, frame16.bp, frame16.ip, frame16.cs); - + frame->AddrPC.Mode = AddrMode1616; frame->AddrPC.Segment = frame16.cs; frame->AddrPC.Offset = frame16.ip; @@ -296,7 +296,7 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, { frame->AddrStack.Offset = frame->AddrFrame.Offset + 2 * sizeof(WORD); /* "pop up" previous BP value */ - if (!f_read_mem(hProcess, + if (!f_read_mem(hProcess, (void*)f_xlat_adr(hProcess, hThread, &frame->AddrFrame), &val, sizeof(WORD), NULL)) goto done_err; @@ -306,7 +306,7 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, { frame->AddrStack.Offset = frame->AddrFrame.Offset + 2 * sizeof(DWORD); /* "pop up" previous EBP value */ - if (!f_read_mem(hProcess, (void*)frame->AddrFrame.Offset, + if (!f_read_mem(hProcess, (void*)frame->AddrFrame.Offset, &frame->AddrFrame.Offset, sizeof(DWORD), NULL)) goto done_err; } @@ -322,14 +322,14 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, goto done_err; frame->AddrReturn.Offset = val; /* get potential cs if a far call was used */ - if (!f_read_mem(hProcess, (void*)(p + 2 * sizeof(WORD)), + if (!f_read_mem(hProcess, (void*)(p + 2 * sizeof(WORD)), &val, sizeof(WORD), NULL)) goto done_err; if (frame->AddrFrame.Offset & 1) frame->AddrReturn.Segment = val; /* far call assumed */ else { - /* not explicitly marked as far call, + /* not explicitly marked as far call, * but check whether it could be anyway */ if ((val & 7) == 7 && val != frame->AddrReturn.Segment) @@ -340,7 +340,7 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, (le.HighWord.Bits.Type & 0x08)) /* code segment */ { /* it is very uncommon to push a code segment cs as - * a parameter, so this should work in most cases + * a parameter, so this should work in most cases */ frame->AddrReturn.Segment = val; } @@ -353,19 +353,19 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, */ for (i = 0; i < sizeof(frame->Params) / sizeof(frame->Params[0]); i++) { - f_read_mem(hProcess, (void*)(p + (2 + i) * sizeof(WORD)), + f_read_mem(hProcess, (void*)(p + (2 + i) * sizeof(WORD)), &val, sizeof(val), NULL); frame->Params[i] = val; } } else { - if (!f_read_mem(hProcess, + if (!f_read_mem(hProcess, (void*)(frame->AddrFrame.Offset + sizeof(DWORD)), &frame->AddrReturn.Offset, sizeof(DWORD), NULL)) goto done_err; - f_read_mem(hProcess, - (void*)(frame->AddrFrame.Offset + 2 * sizeof(DWORD)), + f_read_mem(hProcess, + (void*)(frame->AddrFrame.Offset + 2 * sizeof(DWORD)), frame->Params, sizeof(frame->Params), NULL); } @@ -373,10 +373,10 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread, frame->Virtual = FALSE; TRACE("Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s cSwitch=%08lx nSwitch=%08lx\n", - wine_dbgstr_addr(&frame->AddrPC), + wine_dbgstr_addr(&frame->AddrPC), wine_dbgstr_addr(&frame->AddrFrame), wine_dbgstr_addr(&frame->AddrReturn), - wine_dbgstr_addr(&frame->AddrStack), + wine_dbgstr_addr(&frame->AddrStack), curr_mode == stm_start ? "start" : (curr_mode == stm_16bit ? "16bit" : "32bit"), curr_switch, next_switch); diff --git a/reactos/dll/win32/dbghelp/storage.c b/reactos/dll/win32/dbghelp/storage.c index 025b9f73618..820e603a4e6 100644 --- a/reactos/dll/win32/dbghelp/storage.c +++ b/reactos/dll/win32/dbghelp/storage.c @@ -51,7 +51,7 @@ void pool_destroy(struct pool* pool) #ifdef USE_STATS unsigned alloc, used, num; - + for (alloc = used = num = 0, arena = pool->first; arena; arena = arena->next) { alloc += pool->arena_size; @@ -89,7 +89,7 @@ void* pool_alloc(struct pool* pool, unsigned len) return ret; } } - + arena = HeapAlloc(GetProcessHeap(), 0, pool->arena_size); if (!arena) {FIXME("OOM\n");return NULL;} @@ -117,7 +117,7 @@ void* pool_realloc(struct pool* pool, void* p, unsigned old_size, unsigned new_s struct pool_arena* arena; void* new; - if ((arena = pool_is_last(pool, p, old_size)) && + if ((arena = pool_is_last(pool, p, old_size)) && (char*)p + new_size <= (char*)arena + pool->arena_size) { arena->current = (char*)p + new_size; @@ -195,10 +195,10 @@ static unsigned vector_position(const struct vector* v, const void* elt) for (i = 0; i < v->num_buckets; i++) { - if (v->buckets[i] <= elt && + if (v->buckets[i] <= elt && (const char*)elt < (const char*)v->buckets[i] + (v->elt_size << v->shift)) { - return (i << v->shift) + + return (i << v->shift) + ((const char*)elt - (const char*)v->buckets[i]) / v->elt_size; } } @@ -309,7 +309,7 @@ void* hash_table_find(const struct hash_table* ht, const char* name) return NULL; } -void hash_table_iter_init(const struct hash_table* ht, +void hash_table_iter_init(const struct hash_table* ht, struct hash_table_iter* hti, const char* name) { hti->ht = ht; @@ -329,7 +329,7 @@ void hash_table_iter_init(const struct hash_table* ht, void* hash_table_iter_up(struct hash_table_iter* hti) { if (hti->element) hti->element = hti->element->next; - while (!hti->element && hti->index < hti->last) + while (!hti->element && hti->index < hti->last) hti->element = hti->ht->buckets[++hti->index]; return hti->element; } diff --git a/reactos/dll/win32/dbghelp/symbol.c b/reactos/dll/win32/dbghelp/symbol.c index e85bb23aad8..1cc89ea4394 100644 --- a/reactos/dll/win32/dbghelp/symbol.c +++ b/reactos/dll/win32/dbghelp/symbol.c @@ -140,7 +140,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, const char* nam { struct symt_compiland* sym; - TRACE_(dbghelp_symt)("Adding compiland symbol %s:%s\n", + TRACE_(dbghelp_symt)("Adding compiland symbol %s:%s\n", module->module.ModuleName, name); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { @@ -151,7 +151,7 @@ struct symt_compiland* symt_new_compiland(struct module* module, const char* nam return sym; } -struct symt_public* symt_new_public(struct module* module, +struct symt_public* symt_new_public(struct module* module, struct symt_compiland* compiland, const char* name, unsigned long address, unsigned size, @@ -160,9 +160,9 @@ struct symt_public* symt_new_public(struct module* module, struct symt_public* sym; struct symt** p; - TRACE_(dbghelp_symt)("Adding public symbol %s:%s @%lx\n", + TRACE_(dbghelp_symt)("Adding public symbol %s:%s @%lx\n", module->module.ModuleName, name, address); - if ((dbghelp_options & SYMOPT_AUTO_PUBLICS) && + if ((dbghelp_options & SYMOPT_AUTO_PUBLICS) && symt_find_nearest(module, address) != -1) return NULL; if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) @@ -185,8 +185,8 @@ struct symt_public* symt_new_public(struct module* module, return sym; } -struct symt_data* symt_new_global_variable(struct module* module, - struct symt_compiland* compiland, +struct symt_data* symt_new_global_variable(struct module* module, + struct symt_compiland* compiland, const char* name, unsigned is_static, unsigned long addr, unsigned long size, struct symt* type) @@ -195,7 +195,7 @@ struct symt_data* symt_new_global_variable(struct module* module, struct symt** p; DWORD tsz; - TRACE_(dbghelp_symt)("Adding global symbol %s:%s @%lx %p\n", + TRACE_(dbghelp_symt)("Adding global symbol %s:%s @%lx %p\n", module->module.ModuleName, name, addr, type); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) { @@ -222,8 +222,8 @@ struct symt_data* symt_new_global_variable(struct module* module, return sym; } -struct symt_function* symt_new_function(struct module* module, - struct symt_compiland* compiland, +struct symt_function* symt_new_function(struct module* module, + struct symt_compiland* compiland, const char* name, unsigned long addr, unsigned long size, struct symt* sig_type) @@ -231,7 +231,7 @@ struct symt_function* symt_new_function(struct module* module, struct symt_function* sym; struct symt** p; - TRACE_(dbghelp_symt)("Adding global function %s:%s @%lx-%lx\n", + TRACE_(dbghelp_symt)("Adding global function %s:%s @%lx-%lx\n", module->module.ModuleName, name, addr, addr + size - 1); assert(!sig_type || sig_type->tag == SymTagFunctionType); @@ -264,8 +264,8 @@ void symt_add_func_line(struct module* module, struct symt_function* func, if (func == NULL || !(dbghelp_options & SYMOPT_LOAD_LINES)) return; - TRACE_(dbghelp_symt)("(%p)%s:%lx %s:%u\n", - func, func->hash_elt.name, offset, + TRACE_(dbghelp_symt)("(%p)%s:%lx %s:%u\n", + func, func->hash_elt.name, offset, source_get(module, source_idx), line_num); assert(func->symt.tag == SymTagFunction); @@ -296,10 +296,10 @@ void symt_add_func_line(struct module* module, struct symt_function* func, dli->u.pc_offset = func->address + offset; } -struct symt_data* symt_add_func_local(struct module* module, - struct symt_function* func, - int regno, int offset, - struct symt_block* block, +struct symt_data* symt_add_func_local(struct module* module, + struct symt_function* func, + int regno, int offset, + struct symt_block* block, struct symt* type, const char* name) { struct symt_data* locsym; @@ -308,8 +308,8 @@ struct symt_data* symt_add_func_local(struct module* module, assert(func); assert(func->symt.tag == SymTagFunction); - TRACE_(dbghelp_symt)("Adding local symbol (%s:%s): %s %p\n", - module->module.ModuleName, func->hash_elt.name, + TRACE_(dbghelp_symt)("Adding local symbol (%s:%s): %s %p\n", + module->module.ModuleName, func->hash_elt.name, name, type); locsym = pool_alloc(&module->pool, sizeof(*locsym)); locsym->symt.tag = SymTagData; @@ -338,9 +338,9 @@ struct symt_data* symt_add_func_local(struct module* module, return locsym; } -struct symt_block* symt_open_func_block(struct module* module, +struct symt_block* symt_open_func_block(struct module* module, struct symt_function* func, - struct symt_block* parent_block, + struct symt_block* parent_block, unsigned pc, unsigned len) { struct symt_block* block; @@ -365,20 +365,20 @@ struct symt_block* symt_open_func_block(struct module* module, return block; } -struct symt_block* symt_close_func_block(struct module* module, +struct symt_block* symt_close_func_block(struct module* module, struct symt_function* func, struct symt_block* block, unsigned pc) { assert(func->symt.tag == SymTagFunction); if (pc) block->size = func->address + pc - block->address; - return (block->container->tag == SymTagBlock) ? + return (block->container->tag == SymTagBlock) ? GET_ENTRY(block->container, struct symt_block, symt) : NULL; } -struct symt_function_point* symt_add_function_point(struct module* module, +struct symt_function_point* symt_add_function_point(struct module* module, struct symt_function* func, - enum SymTagEnum point, + enum SymTagEnum point, unsigned offset, const char* name) { struct symt_function_point* sym; @@ -419,14 +419,14 @@ BOOL symt_normalize_function(struct module* module, struct symt_function* func) return TRUE; } -struct symt_thunk* symt_new_thunk(struct module* module, - struct symt_compiland* compiland, +struct symt_thunk* symt_new_thunk(struct module* module, + struct symt_compiland* compiland, const char* name, THUNK_ORDINAL ord, unsigned long addr, unsigned long size) { struct symt_thunk* sym; - TRACE_(dbghelp_symt)("Adding global thunk %s:%s @%lx-%lx\n", + TRACE_(dbghelp_symt)("Adding global thunk %s:%s @%lx-%lx\n", module->module.ModuleName, name, addr, addr + size - 1); if ((sym = pool_alloc(&module->pool, sizeof(*sym)))) @@ -450,7 +450,7 @@ struct symt_thunk* symt_new_thunk(struct module* module, } /* expect sym_info->MaxNameLen to be set before being called */ -static void symt_fill_sym_info(const struct module* module, +static void symt_fill_sym_info(const struct module* module, const struct symt* sym, SYMBOL_INFO* sym_info) { const char* name; @@ -501,7 +501,7 @@ static void symt_fill_sym_info(const struct module* module, case VT_UI4: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.ulVal; break; case VT_UI2: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.uiVal; break; case VT_UI1: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.bVal; break; - default: + default: FIXME("Unsupported variant type (%u)\n", data->u.value.n1.n2.vt); } break; @@ -533,7 +533,7 @@ static void symt_fill_sym_info(const struct module* module, if (sym_info->MaxNameLen) { if (sym->tag != SymTagPublicSymbol || !(dbghelp_options & SYMOPT_UNDNAME) || - (sym_info->NameLen = UnDecorateSymbolName(sym_info->Name, sym_info->Name, + (sym_info->NameLen = UnDecorateSymbolName(sym_info->Name, sym_info->Name, sym_info->MaxNameLen, UNDNAME_COMPLETE) == 0)) { sym_info->NameLen = min(strlen(name), sym_info->MaxNameLen - 1); @@ -567,7 +567,7 @@ static BOOL symt_enum_module(struct module* module, regex_t* regex, symt_fill_sym_info(module, &sym->symt, sym_info); if (!cb(sym_info, sym_info->Size, user)) return TRUE; } - } + } return FALSE; } @@ -588,10 +588,10 @@ static BOOL resort_symbols(struct module* module) nsym++; if (!(module->module.NumSyms = nsym)) return FALSE; - + if (module->addr_sorttab) module->addr_sorttab = HeapReAlloc(GetProcessHeap(), 0, - module->addr_sorttab, + module->addr_sorttab, nsym * sizeof(struct symt_ht*)); else module->addr_sorttab = HeapAlloc(GetProcessHeap(), 0, @@ -606,7 +606,7 @@ static BOOL resort_symbols(struct module* module) assert(sym); module->addr_sorttab[nsym++] = sym; } - + qsort(module->addr_sorttab, nsym, sizeof(struct symt_ht*), symt_cmp_addr); return module->sortlist_valid = TRUE; } @@ -638,7 +638,7 @@ int symt_find_nearest(struct module* module, DWORD addr) ref_size = 0x1000; /* arbitrary value */ if (addr >= ref_addr + ref_size) return -1; } - + while (high > low + 1) { mid = (high + low) / 2; @@ -647,7 +647,7 @@ int symt_find_nearest(struct module* module, DWORD addr) else high = mid; } - if (low != high && high != module->module.NumSyms && + if (low != high && high != module->module.NumSyms && cmp_sorttab_addr(module, high, addr) <= 0) low = high; @@ -655,13 +655,13 @@ int symt_find_nearest(struct module* module, DWORD addr) * might also have the same address, but would get better information */ if (module->addr_sorttab[low]->symt.tag == SymTagPublicSymbol) - { + { symt_get_info(&module->addr_sorttab[low]->symt, TI_GET_ADDRESS, &ref_addr); if (low > 0 && module->addr_sorttab[low - 1]->symt.tag != SymTagPublicSymbol && !cmp_sorttab_addr(module, low - 1, ref_addr)) low--; - else if (low < module->module.NumSyms - 1 && + else if (low < module->module.NumSyms - 1 && module->addr_sorttab[low + 1]->symt.tag != SymTagPublicSymbol && !cmp_sorttab_addr(module, low + 1, ref_addr)) low++; @@ -695,7 +695,7 @@ static BOOL symt_enum_locals_helper(struct process* pcs, struct module* module, struct symt_block* block = (struct symt_block*)lsym; if (pc < block->address || block->address + block->size <= pc) continue; - if (!symt_enum_locals_helper(pcs, module, preg, cb, user, + if (!symt_enum_locals_helper(pcs, module, preg, cb, user, sym_info, &block->vchildren)) return FALSE; } @@ -745,12 +745,12 @@ static BOOL symt_enum_locals(struct process* pcs, const char* mask, regex_t preg; compile_regex(mask ? mask : "*", -1, &preg); - ret = symt_enum_locals_helper(pcs, module, &preg, EnumSymbolsCallback, - UserContext, sym_info, + ret = symt_enum_locals_helper(pcs, module, &preg, EnumSymbolsCallback, + UserContext, sym_info, &((struct symt_function*)sym)->vchildren); regfree(&preg); return ret; - + } symt_fill_sym_info(module, &sym->symt, sym_info); return EnumSymbolsCallback(sym_info, sym_info->Size, UserContext); @@ -777,7 +777,7 @@ BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask, const char* bang; regex_t mod_regex, sym_regex; - TRACE("(%p %s %s %p %p)\n", + TRACE("(%p %s %s %p %p)\n", hProcess, wine_dbgstr_longlong(BaseOfDll), debugstr_a(Mask), EnumSymbolsCallback, UserContext); @@ -793,13 +793,13 @@ BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask, compile_regex(Mask, bang - Mask, &mod_regex); compile_regex(bang + 1, -1, &sym_regex); - + for (module = pcs->lmodules; module; module = module->next) { if (module->type == DMT_PE && (dbg_module = module_get_debug(pcs, module))) { if (regexec(&mod_regex, module->module.ModuleName, 0, NULL, 0) == 0 && - symt_enum_module(dbg_module, &sym_regex, + symt_enum_module(dbg_module, &sym_regex, EnumSymbolsCallback, UserContext)) break; } @@ -858,14 +858,14 @@ static BOOL CALLBACK sym_enumerate_cb(PSYMBOL_INFO syminfo, ULONG size, void* ct * SymEnumerateSymbols (DBGHELP.@) */ BOOL WINAPI SymEnumerateSymbols(HANDLE hProcess, DWORD BaseOfDll, - PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, + PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext) { struct sym_enumerate se; se.ctx = UserContext; se.cb = EnumSymbolsCallback; - + return SymEnumSymbols(hProcess, BaseOfDll, NULL, sym_enumerate_cb, &se); } @@ -873,7 +873,7 @@ BOOL WINAPI SymEnumerateSymbols(HANDLE hProcess, DWORD BaseOfDll, * SymFromAddr (DBGHELP.@) * */ -BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address, +BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address, DWORD64* Displacement, PSYMBOL_INFO Symbol) { struct process* pcs = process_find_by_handle(hProcess); @@ -1003,7 +1003,7 @@ BOOL WINAPI SymGetSymFromName(HANDLE hProcess, LPSTR Name, PIMAGEHLP_SYMBOL Symb * * fills information about a file */ -BOOL symt_fill_func_line_info(struct module* module, struct symt_function* func, +BOOL symt_fill_func_line_info(struct module* module, struct symt_function* func, DWORD addr, IMAGEHLP_LINE* line) { struct line_info* dli = NULL; @@ -1062,7 +1062,7 @@ BOOL WINAPI SymGetSymPrev(HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol) * SymGetLineFromAddr (DBGHELP.@) * */ -BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr, +BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE Line) { struct process* pcs = process_find_by_handle(hProcess); @@ -1079,7 +1079,7 @@ BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr, if ((idx = symt_find_nearest(module, dwAddr)) == -1) return FALSE; if (module->addr_sorttab[idx]->symt.tag != SymTagFunction) return FALSE; - if (!symt_fill_func_line_info(module, + if (!symt_fill_func_line_info(module, (struct symt_function*)module->addr_sorttab[idx], dwAddr, Line)) return FALSE; if (pdwDisplacement) *pdwDisplacement = dwAddr - Line->Address; @@ -1109,7 +1109,7 @@ BOOL WINAPI SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line) li = (struct line_info*)Line->Key; /* things are a bit complicated because when we encounter a DLIT_SOURCEFILE * element we have to go back until we find the prev one to get the real - * source file name for the DLIT_OFFSET element just before + * source file name for the DLIT_OFFSET element just before * the first DLIT_SOURCEFILE */ while (!li->is_first) @@ -1194,7 +1194,7 @@ PVOID WINAPI SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase) BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL sym, LPSTR UnDecName, DWORD UnDecNameLength) { TRACE("(%p %s %lu): stub\n", sym, UnDecName, UnDecNameLength); - return UnDecorateSymbolName(sym->Name, UnDecName, UnDecNameLength, + return UnDecorateSymbolName(sym->Name, UnDecName, UnDecNameLength, UNDNAME_COMPLETE) != 0; } @@ -1222,7 +1222,7 @@ DWORD WINAPI UnDecorateSymbolName(LPCSTR DecoratedName, LPSTR UnDecoratedName, } if (!UnDecoratedName) return 0; - if (!p_undname(UnDecoratedName, DecoratedName, UndecoratedLength, + if (!p_undname(UnDecoratedName, DecoratedName, UndecoratedLength, und_alloc, und_free, Flags)) return 0; return strlen(UnDecoratedName); diff --git a/reactos/dll/win32/dbghelp/type.c b/reactos/dll/win32/dbghelp/type.c index 6c9fd2ed48f..8d36157cea3 100644 --- a/reactos/dll/win32/dbghelp/type.c +++ b/reactos/dll/win32/dbghelp/type.c @@ -100,8 +100,8 @@ const char* symt_get_name(const struct symt* sym) } } -static struct symt* symt_find_type_by_name(struct module* module, - enum SymTagEnum sym_tag, +static struct symt* symt_find_type_by_name(struct module* module, + enum SymTagEnum sym_tag, const char* typename) { void* ptr; @@ -132,7 +132,7 @@ static void symt_add_type(struct module* module, struct symt* symt) *p = symt; } -struct symt_basic* symt_new_basic(struct module* module, enum BasicType bt, +struct symt_basic* symt_new_basic(struct module* module, enum BasicType bt, const char* typename, unsigned size) { struct symt_basic* sym; @@ -159,7 +159,7 @@ struct symt_basic* symt_new_basic(struct module* module, enum BasicType bt, return sym; } -struct symt_udt* symt_new_udt(struct module* module, const char* typename, +struct symt_udt* symt_new_udt(struct module* module, const char* typename, unsigned size, enum UdtKind kind) { struct symt_udt* sym; @@ -187,7 +187,7 @@ BOOL symt_set_udt_size(struct module* module, struct symt_udt* udt, unsigned siz if (vector_length(&udt->vchildren) != 0) { if (udt->size != size) - FIXME_(dbghelp_symt)("Changing size for %s from %u to %u\n", + FIXME_(dbghelp_symt)("Changing size for %s from %u to %u\n", udt->hash_elt.name, udt->size, size); return TRUE; } @@ -281,7 +281,7 @@ BOOL symt_add_enum_element(struct module* module, struct symt_enum* enum_type, return TRUE; } -struct symt_array* symt_new_array(struct module* module, int min, int max, +struct symt_array* symt_new_array(struct module* module, int min, int max, struct symt* base) { struct symt_array* sym; @@ -297,7 +297,7 @@ struct symt_array* symt_new_array(struct module* module, int min, int max, return sym; } -struct symt_function_signature* symt_new_function_signature(struct module* module, +struct symt_function_signature* symt_new_function_signature(struct module* module, struct symt* ret_type) { struct symt_function_signature* sym; @@ -339,7 +339,7 @@ struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_ty return sym; } -struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, +struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, const char* name) { struct symt_typedef* sym; @@ -370,7 +370,7 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, const char* tmp; struct symt* type; void* pos = NULL; - + TRACE("(%p %s %p %p)\n", hProcess, wine_dbgstr_longlong(BaseOfDll), EnumSymbolsCallback, UserContext); @@ -401,7 +401,7 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, sym_info->NameLen = strlen(tmp) + 1; strncpy(sym_info->Name, tmp, min(sym_info->NameLen, sym_info->MaxNameLen)); sym_info->Name[sym_info->MaxNameLen - 1] = '\0'; - } + } else sym_info->Name[sym_info->NameLen = 0] = '\0'; if (!EnumSymbolsCallback(sym_info, sym_info->Size, UserContext)) break; } @@ -413,7 +413,7 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, * * Retrieves inforamtion about a symt (either symbol or type) */ -BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, +BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, void* pInfo) { unsigned len; @@ -439,7 +439,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, case SymTagFunctionType: v = &((const struct symt_function_signature*)type)->vchildren; break; case SymTagFunction: v = &((const struct symt_function*)type)->vchildren; break; default: - FIXME("Unsupported sym-tag %s for find-children\n", + FIXME("Unsupported sym-tag %s for find-children\n", symt_get_tag_str(type->tag)); return FALSE; } @@ -473,14 +473,14 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, case SymTagFuncDebugStart: case SymTagFuncDebugEnd: case SymTagLabel: - X(ULONG64) = ((const struct symt_function_point*)type)->parent->address + + X(ULONG64) = ((const struct symt_function_point*)type)->parent->address + ((const struct symt_function_point*)type)->offset; break; case SymTagThunk: X(ULONG64) = ((const struct symt_thunk*)type)->address; break; default: - FIXME("Unsupported sym-tag %s for get-address\n", + FIXME("Unsupported sym-tag %s for get-address\n", symt_get_tag_str(type->tag)); return FALSE; } @@ -501,7 +501,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, break; case TI_GET_BITPOSITION: - if (type->tag != SymTagData || + if (type->tag != SymTagData || ((const struct symt_data*)type)->kind != DataIsMember || ((const struct symt_data*)type)->u.s.length == 0) return FALSE; @@ -529,7 +529,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, X(DWORD) = 0; break; default: - FIXME("Unsupported sym-tag %s for get-children-count\n", + FIXME("Unsupported sym-tag %s for get-children-count\n", symt_get_tag_str(type->tag)); /* fall through */ case SymTagData: @@ -545,7 +545,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, * also include 'this' (GET_CHILDREN_COUNT+1) */ if (type->tag != SymTagArrayType) return FALSE; - X(DWORD) = ((const struct symt_array*)type)->end - + X(DWORD) = ((const struct symt_array*)type)->end - ((const struct symt_array*)type)->start + 1; break; @@ -578,11 +578,11 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, return FALSE; X(DWORD) = ((const struct symt_data*)type)->u.s.length; break; - case SymTagArrayType: - if (!symt_get_info(((const struct symt_array*)type)->basetype, + case SymTagArrayType: + if (!symt_get_info(((const struct symt_array*)type)->basetype, TI_GET_LENGTH, pInfo)) return FALSE; - X(DWORD) *= ((const struct symt_array*)type)->end - + X(DWORD) *= ((const struct symt_array*)type)->end - ((const struct symt_array*)type)->start + 1; break; case SymTagPublicSymbol: @@ -595,7 +595,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, X(DWORD) = ((const struct symt_thunk*)type)->size; break; default: - FIXME("Unsupported sym-tag %s for get-length\n", + FIXME("Unsupported sym-tag %s for get-length\n", symt_get_tag_str(type->tag)); /* fall through */ case SymTagFunctionType: @@ -619,7 +619,7 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, X(DWORD) = (DWORD)((const struct symt_thunk*)type)->container; break; default: - FIXME("Unsupported sym-tag %s for get-lexical-parent\n", + FIXME("Unsupported sym-tag %s for get-lexical-parent\n", symt_get_tag_str(type->tag)); return FALSE; } @@ -646,16 +646,16 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, case DataIsParam: case DataIsLocal: case DataIsMember: - X(ULONG) = ((const struct symt_data*)type)->u.s.offset >> 3; + X(ULONG) = ((const struct symt_data*)type)->u.s.offset >> 3; break; default: - FIXME("Unknown kind (%u) for get-offset\n", + FIXME("Unknown kind (%u) for get-offset\n", ((const struct symt_data*)type)->kind); return FALSE; } break; default: - FIXME("Unsupported sym-tag %s for get-offset\n", + FIXME("Unsupported sym-tag %s for get-offset\n", symt_get_tag_str(type->tag)); return FALSE; } @@ -695,14 +695,14 @@ BOOL symt_get_info(const struct symt* type, IMAGEHLP_SYMBOL_TYPE_INFO req, break; /* lexical => hierarchical */ case SymTagData: - X(DWORD) = (DWORD)((const struct symt_data*)type)->type; + X(DWORD) = (DWORD)((const struct symt_data*)type)->type; break; case SymTagFunction: X(DWORD) = (DWORD)((const struct symt_function*)type)->type; break; /* FIXME: should also work for enums and FunctionArgType */ default: - FIXME("Unsupported sym-tag %s for get-type\n", + FIXME("Unsupported sym-tag %s for get-type\n", symt_get_tag_str(type->tag)); case SymTagThunk: return FALSE; diff --git a/reactos/dll/win32/devmgr/hwpage.c b/reactos/dll/win32/devmgr/hwpage.c index ef7eb5e536a..8bda2da9292 100644 --- a/reactos/dll/win32/devmgr/hwpage.c +++ b/reactos/dll/win32/devmgr/hwpage.c @@ -151,7 +151,7 @@ UpdateControlStates(IN PHARDWARE_PAGE_DATA hpd) { PHWDEVINFO HwDevInfo; HWND hBtnTroubleShoot, hBtnProperties; - + hBtnTroubleShoot = GetDlgItem(hpd->hWnd, IDC_TROUBLESHOOT); hBtnProperties = GetDlgItem(hpd->hWnd, @@ -819,7 +819,7 @@ HardwareDlgProc(IN HWND hwndDlg, case LVN_ITEMCHANGED: { LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam; - + if ((pnmv->uChanged & LVIF_STATE) && ((pnmv->uOldState & (LVIS_FOCUSED | LVIS_SELECTED)) || (pnmv->uNewState & (LVIS_FOCUSED | LVIS_SELECTED)))) @@ -862,7 +862,7 @@ HardwareDlgProc(IN HWND hwndDlg, HardwareDlgResize(hpd, (INT)LOWORD(lParam), (INT)HIWORD(lParam)); - break; + break; case WM_SETTEXT: { @@ -1057,9 +1057,9 @@ DeviceCreateHardwarePageEx(IN HWND hWndParent, /* create the dialog */ hWnd = CreateDialogParam(hDllInstance, - MAKEINTRESOURCE(IDD_HARDWARE), - hWndParent, - HardwareDlgProc, + MAKEINTRESOURCE(IDD_HARDWARE), + hWndParent, + HardwareDlgProc, (LPARAM)hpd); if (hWnd != NULL) { diff --git a/reactos/dll/win32/devmgr/lang/de-DE.rc b/reactos/dll/win32/devmgr/lang/de-DE.rc index 3ec80248855..ac2f22c3f36 100644 --- a/reactos/dll/win32/devmgr/lang/de-DE.rc +++ b/reactos/dll/win32/devmgr/lang/de-DE.rc @@ -97,8 +97,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Geräte:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Geräteeigenschaften",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/en-US.rc b/reactos/dll/win32/devmgr/lang/en-US.rc index 7d5ec86b0a4..33eb7d78217 100644 --- a/reactos/dll/win32/devmgr/lang/en-US.rc +++ b/reactos/dll/win32/devmgr/lang/en-US.rc @@ -96,8 +96,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Devices:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Device Properties",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/es-ES.rc b/reactos/dll/win32/devmgr/lang/es-ES.rc index eee21da3d27..82870ec0cf2 100644 --- a/reactos/dll/win32/devmgr/lang/es-ES.rc +++ b/reactos/dll/win32/devmgr/lang/es-ES.rc @@ -30,35 +30,35 @@ END STRINGTABLE BEGIN IDS_DEV_NO_PROBLEM "Este dispositivo está funcionando correctamente." - IDS_DEV_NOT_CONFIGURED "Este dispositivo no esta configurado correctamente." + IDS_DEV_NOT_CONFIGURED "Este dispositivo no esta configurado correctamente." IDS_DEV_DEVLOADER_FAILED "ReactOS no podría cargar el driver para este dispositivo porque la computadora está reportando dos $1 tipos de Bus." - IDS_DEV_DEVLOADER_FAILED2 "El cargador(es) de $1 no puede cargar el driver del dispositivo." - IDS_DEV_OUT_OF_MEMORY "El driver para este dispositivo puede estar malo, o su sistema puede estar bajo en memoria u otros recursos." + IDS_DEV_DEVLOADER_FAILED2 "El cargador(es) de $1 no puede cargar el driver del dispositivo." + IDS_DEV_OUT_OF_MEMORY "El driver para este dispositivo puede estar malo, o su sistema puede estar bajo en memoria u otros recursos." IDS_DEV_ENTRY_IS_WRONG_TYPE "Este dispositivo no está funcionando correctamente porque uno de sus drivers estan malos, o su registro esta corrupto." IDS_DEV_LACKED_ARBITRATOR "El driver para este dispositivo solicitó un recurso que ReactOS no sabe dirigir." - IDS_DEV_BOOT_CONFIG_CONFLICT "Otro dispositivo está utilizando los recursos que necesita de este dispositivo." + IDS_DEV_BOOT_CONFIG_CONFLICT "Otro dispositivo está utilizando los recursos que necesita de este dispositivo." IDS_DEV_FAILED_FILTER "Los drivers para este dispositivo necesitan ser reinstalados." - IDS_DEV_DEVLOADER_NOT_FOUND "Este dispositivo no está funcionando correctamente porque ReactOS no puede cargar el archivo $1 que carga los drivers para el dispositivo." + IDS_DEV_DEVLOADER_NOT_FOUND "Este dispositivo no está funcionando correctamente porque ReactOS no puede cargar el archivo $1 que carga los drivers para el dispositivo." IDS_DEV_DEVLOADER_NOT_FOUND2 "Este dispositivo no está funcionando correctamente porque el archivo $1 que carga los conductores para este dispositivo esta malo." IDS_DEV_DEVLOADER_NOT_FOUND3 "Falla del dispositivo: Trate cabiar el driver para este dispositivo. Si eso no funciona, vea la documentación de su hardware." - IDS_DEV_INVALID_DATA "Este dispositivo no está funcionando correctamente porque el BIOS en su computadora está reportando los recursos para el dispositivo incorrectamente." - IDS_DEV_INVALID_DATA2 "Este dispositivo no está funcionando correctamente porque el BIOS en el dispositivo está reportando los recursos para el dispositivo incorrectamente." - IDS_DEV_FAILED_START "Este dispositivo o no esta presente, no trabajando correctamente, o no tiene todos los drivers instalados." - IDS_DEV_LIAR "ReactOS paró de responder mientras que procuraba encender este dispositivo, y por lo tanto nunca procurará encender este dispositivo otra vez." + IDS_DEV_INVALID_DATA "Este dispositivo no está funcionando correctamente porque el BIOS en su computadora está reportando los recursos para el dispositivo incorrectamente." + IDS_DEV_INVALID_DATA2 "Este dispositivo no está funcionando correctamente porque el BIOS en el dispositivo está reportando los recursos para el dispositivo incorrectamente." + IDS_DEV_FAILED_START "Este dispositivo o no esta presente, no trabajando correctamente, o no tiene todos los drivers instalados." + IDS_DEV_LIAR "ReactOS paró de responder mientras que procuraba encender este dispositivo, y por lo tanto nunca procurará encender este dispositivo otra vez." IDS_DEV_NORMAL_CONFLICT "Este dispositivo no puede encontrar ningun $1 recurso libre para utilizar." - IDS_DEV_NOT_VERIFIED "Este dispositivo no esta presente, no trabaja correctamente, o no tiene todos los drivers instalados." - IDS_DEV_NEED_RESTART "Este dispositivo no puede trabajar correctamente hasta que usted recomienze su computadora." - IDS_DEV_REENUMERATION "Este dispositivo está causando un conflicto de recursos." + IDS_DEV_NOT_VERIFIED "Este dispositivo no esta presente, no trabaja correctamente, o no tiene todos los drivers instalados." + IDS_DEV_NEED_RESTART "Este dispositivo no puede trabajar correctamente hasta que usted recomienze su computadora." + IDS_DEV_REENUMERATION "Este dispositivo está causando un conflicto de recursos." IDS_DEV_PARTIAL_LOG_CONF "ReactOS no puede identificar todos los recursos que este dispositivo usa." - IDS_DEV_UNKNOWN_RESOURCE "El archivo de información del driver $1 está diciendo que este dispositivo niño utiliza un recurso que el dispositivo padre no tiene o no reconoce." + IDS_DEV_UNKNOWN_RESOURCE "El archivo de información del driver $1 está diciendo que este dispositivo niño utiliza un recurso que el dispositivo padre no tiene o no reconoce." IDS_DEV_REINSTALL "Los drivers para este dispositivo necesitan ser reinstalados." IDS_DEV_REGISTRY "Su registro puede estar corrupto." IDS_DEV_WILL_BE_REMOVED "ReactOS esta removiendo este dispositivo." IDS_DEV_DISABLED "Este dispositivo no ha sido inicializado." IDS_DEV_DISABLED2 "Este dispositivo ha sido desabilitado." - IDS_DEV_DEVLOADER_NOT_READY "Los cargadores para este dispositivo no pueden cargar los drivers requeridos." + IDS_DEV_DEVLOADER_NOT_READY "Los cargadores para este dispositivo no pueden cargar los drivers requeridos." IDS_DEV_DEVLOADER_NOT_READY2 "Este adaptador de video esta funcionando correctamente." - IDS_DEV_DEVLOADER_NOT_READY3 "Los cargadores para este dispositivo no pueden cargar los drivers requeridos." + IDS_DEV_DEVLOADER_NOT_READY3 "Los cargadores para este dispositivo no pueden cargar los drivers requeridos." IDS_DEV_DEVICE_NOT_THERE "Este dispositivo no esta presente, no trabaja correctamente, o no tiene todos los drivers instalados." IDS_DEV_MOVED "ReactOS está en el proceso de instalación de este dispositivo." IDS_DEV_TOO_EARLY "ReactOS está en el proceso de instalación de este dispositivo." @@ -66,24 +66,24 @@ BEGIN IDS_DEV_FAILED_INSTALL "Los drivers para este dispositivo no están instalados." IDS_DEV_HARDWARE_DISABLED "Este dispositivo es desabilitado porque el BIOS para el dispositivo no le dio ningun recurso." IDS_DEV_CANT_SHARE_IRQ "Este dispositivo está utilizando un recurso de la petición de interrupción (IRQ) que usa otro dispositivo y no puede ser compartido. Usted debe cambiar la opción que esta confligiendo o remover el real-mode driver que causa el conflicto." - IDS_DEV_FAILED_ADD "Este dispositivo no está funcionando correctamente porque $1 no está trabajando correctamente." + IDS_DEV_FAILED_ADD "Este dispositivo no está funcionando correctamente porque $1 no está trabajando correctamente." IDS_DEV_DISABLED_SERVICE "ReactOS no puede instalar los drivers para este dispositivo porque no se puede accesar el disco o la localización en la red que tiene los archivos de instalación." - IDS_DEV_TRANSLATION_FAILED "Este dispositivo no responde a su driver." + IDS_DEV_TRANSLATION_FAILED "Este dispositivo no responde a su driver." IDS_DEV_NO_SOFTCONFIG "ReactOS no puede determinar las propiedades de este dispositivo. Consulte la documentación que vino con este dispositivo y utiliza la lengüeta del recurso para fijar la configuración correcta." - IDS_DEV_BIOS_TABLE "Los soportes lógicos inalterables del sistema(firmware) no incluyen suficiente información para configurar correctamente y utilizar este dispositivo Para utilizar este dispositivo, entre en contacto con su fabricante de computadora para obtener una actualización del BIOS." + IDS_DEV_BIOS_TABLE "Los soportes lógicos inalterables del sistema(firmware) no incluyen suficiente información para configurar correctamente y utilizar este dispositivo Para utilizar este dispositivo, entre en contacto con su fabricante de computadora para obtener una actualización del BIOS." IDS_DEV_IRQ_TRANSLATION_FAILED "Este dispocitivo esta pidiendo un interruptor PC pero es configurado para interruptor ISA (o vice versa). Por favor utilize el programa de configuración del BIOS para reconfigurar el interruptor para este dispositivo." - IDS_DEV_FAILED_DRIVER_ENTRY "ReactOS no puede inicializar el driver de dispositivo para este hardware." + IDS_DEV_FAILED_DRIVER_ENTRY "ReactOS no puede inicializar el driver de dispositivo para este hardware." IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD "ReactOS no puede cargar el driver de dispositivo para este hardware porque un caso anterior del driver de dispositivo todavía está en memoria." IDS_DEV_DRIVER_FAILED_LOAD "ReactOS no puede cargar el driver de dispositivo para este hardware. El driver puede estar corrompido o ausente." - IDS_DEV_DRIVER_SERVICE_KEY_INVALID "ReactOS no puede tener acceso a este hardware porque su información de la llave del servicio en el registro es falta o esta registrada incorrectamente." + IDS_DEV_DRIVER_SERVICE_KEY_INVALID "ReactOS no puede tener acceso a este hardware porque su información de la llave del servicio en el registro es falta o esta registrada incorrectamente." IDS_DEV_LEGACY_SERVICE_NO_DEVICES "ReactOS cargó con éxito el driver del dispositivo pero no puede encontrar el dispositivo." - IDS_DEV_DUPLICATE_DEVICE "ReactOS no puede cargar el driver de dispositivo para este hardware porque hay un dispositivo duplicado que ya funciona en el sistema." + IDS_DEV_DUPLICATE_DEVICE "ReactOS no puede cargar el driver de dispositivo para este hardware porque hay un dispositivo duplicado que ya funciona en el sistema." IDS_DEV_FAILED_POST_START "ReactOS a desabilitado este dispositivo porque a reportado problemas." IDS_DEV_HALTED "Una applicación o un servicio ha cerrado este dispositivo de hardware." - IDS_DEV_PHANTOM "Actualmente, este dispositivo de hardware no está conectado a la computadora." + IDS_DEV_PHANTOM "Actualmente, este dispositivo de hardware no está conectado a la computadora." IDS_DEV_SYSTEM_SHUTDOWN "ReactOS no puede accesar este dispositivo de hardware porque el sistema operativo está en el proceso de cerrar." IDS_DEV_HELD_FOR_EJECT "ReactOS no puede usar este dispositivo de hardware por que ha sido preparado para ""remoción segura"", pero aun no ha sido desconectado de la computadora." - IDS_DEV_DRIVER_BLOCKED "El software para este dispositivo se ha bloqueado de comenzar porque tiene problemas con ReactOS. Entre en contacto con su vendedor de hardware para un driver nuevo." + IDS_DEV_DRIVER_BLOCKED "El software para este dispositivo se ha bloqueado de comenzar porque tiene problemas con ReactOS. Entre en contacto con su vendedor de hardware para un driver nuevo." IDS_DEV_REGISTRY_TOO_LARGE "ReactOS no puede encender los nuevos dispositivos de hardware porque la colmena(hive) del sistema es demasiado grande (excede el límite del tamaño del registro)." IDS_DEV_SETPROPERTIES_FAILED "ReactOS no fue capaz de cambiar las propiedades de este dispositivo." END @@ -93,8 +93,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Dispositivos:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Propiedades de Dispositivos",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/hu-HU.rc b/reactos/dll/win32/devmgr/lang/hu-HU.rc index 6b2aa382c34..7cbb5a40fac 100644 --- a/reactos/dll/win32/devmgr/lang/hu-HU.rc +++ b/reactos/dll/win32/devmgr/lang/hu-HU.rc @@ -92,8 +92,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Eszközök:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Eszköz tulajdonságok",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/id-ID.rc b/reactos/dll/win32/devmgr/lang/id-ID.rc index b7c41340bb3..60c60260814 100644 --- a/reactos/dll/win32/devmgr/lang/id-ID.rc +++ b/reactos/dll/win32/devmgr/lang/id-ID.rc @@ -96,8 +96,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Device:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Properti Device",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/it-IT.rc b/reactos/dll/win32/devmgr/lang/it-IT.rc index 09cd8ed86bd..c456aa2a08b 100644 --- a/reactos/dll/win32/devmgr/lang/it-IT.rc +++ b/reactos/dll/win32/devmgr/lang/it-IT.rc @@ -96,8 +96,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Dispositivi:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Proprieta dei dispositivi",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/pl-PL.rc b/reactos/dll/win32/devmgr/lang/pl-PL.rc index c863bdcb2d5..43ee2f044da 100644 --- a/reactos/dll/win32/devmgr/lang/pl-PL.rc +++ b/reactos/dll/win32/devmgr/lang/pl-PL.rc @@ -98,8 +98,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Urz¹dzenia:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "W³aœciwoœci urz¹dzenia",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/pt-BR.rc b/reactos/dll/win32/devmgr/lang/pt-BR.rc index ffb8edd4123..da03818fd96 100644 --- a/reactos/dll/win32/devmgr/lang/pt-BR.rc +++ b/reactos/dll/win32/devmgr/lang/pt-BR.rc @@ -96,8 +96,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Dispositivos:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Propriedades do dispositivo",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/ru-RU.rc b/reactos/dll/win32/devmgr/lang/ru-RU.rc index 5e79490ce86..f238dc98f7f 100644 --- a/reactos/dll/win32/devmgr/lang/ru-RU.rc +++ b/reactos/dll/win32/devmgr/lang/ru-RU.rc @@ -94,8 +94,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Óñòðîéñòâà:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Ñâîéñòâà óñòðîéñòâà",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/lang/uk-UA.rc b/reactos/dll/win32/devmgr/lang/uk-UA.rc index ab39d87f421..cae213a02de 100644 --- a/reactos/dll/win32/devmgr/lang/uk-UA.rc +++ b/reactos/dll/win32/devmgr/lang/uk-UA.rc @@ -102,8 +102,8 @@ STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Ïðèñòðî¿:",IDC_DEVICES,7,6,196,10 - CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + CONTROL "",IDC_LV_DEVICES,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,16,196,50 GROUPBOX "Âëàñòèâîñò³ ïðèñòðîþ",IDC_PROPERTIESGROUP,7,76,196,105 LTEXT "",IDC_MANUFACTURER,14,88,183,10,SS_ENDELLIPSIS diff --git a/reactos/dll/win32/devmgr/stubs.c b/reactos/dll/win32/devmgr/stubs.c index 8e6c9fb02ab..982c0fc8d1d 100644 --- a/reactos/dll/win32/devmgr/stubs.c +++ b/reactos/dll/win32/devmgr/stubs.c @@ -1,4 +1,4 @@ -/* +/* * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS devmgr.dll diff --git a/reactos/dll/win32/dhcpcsvc/dhcpcsvc.c b/reactos/dll/win32/dhcpcsvc/dhcpcsvc.c index 55207897b5a..cf382b94751 100644 --- a/reactos/dll/win32/dhcpcsvc/dhcpcsvc.c +++ b/reactos/dll/win32/dhcpcsvc/dhcpcsvc.c @@ -26,8 +26,8 @@ VOID APIENTRY DhcpCApiCleanup() { } DWORD APIENTRY DhcpQueryHWInfo( DWORD AdapterIndex, - PDWORD MediaType, - PDWORD Mtu, + PDWORD MediaType, + PDWORD Mtu, PDWORD Speed ) { COMM_DHCP_REQ Req; COMM_DHCP_REPLY Reply; @@ -50,7 +50,7 @@ DWORD APIENTRY DhcpQueryHWInfo( DWORD AdapterIndex, } } -DWORD APIENTRY DhcpLeaseIpAddress( DWORD AdapterIndex ) { +DWORD APIENTRY DhcpLeaseIpAddress( DWORD AdapterIndex ) { COMM_DHCP_REQ Req; COMM_DHCP_REPLY Reply; DWORD BytesRead; @@ -98,8 +98,8 @@ DWORD APIENTRY DhcpRenewIpAddressLease( DWORD AdapterIndex ) { return Reply.Reply; } -DWORD APIENTRY DhcpStaticRefreshParams( DWORD AdapterIndex, - DWORD Address, +DWORD APIENTRY DhcpStaticRefreshParams( DWORD AdapterIndex, + DWORD Address, DWORD Netmask ) { COMM_DHCP_REQ Req; COMM_DHCP_REPLY Reply; diff --git a/reactos/dll/win32/dnsapi/dnsapi/context.c b/reactos/dll/win32/dnsapi/dnsapi/context.c index b01643f4982..7664384fdb6 100644 --- a/reactos/dll/win32/dnsapi/dnsapi/context.c +++ b/reactos/dll/win32/dnsapi/dnsapi/context.c @@ -44,12 +44,12 @@ DNS_STATUS WINAPI DnsAcquireContextHandle_W int adns_status; /* For now, don't worry about the user's identity. */ - Context = (PWINDNS_CONTEXT)RtlAllocateHeap( RtlGetProcessHeap(), 0, + Context = (PWINDNS_CONTEXT)RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof( WINDNS_CONTEXT ) ); /* The real work here is to create an adns_state that will help us * do what we want to later. */ - adns_status = adns_init( &Context->State, - adns_if_noenv | + adns_status = adns_init( &Context->State, + adns_if_noenv | adns_if_noerrprint | adns_if_noserverwarn, 0 ); @@ -61,7 +61,7 @@ DNS_STATUS WINAPI DnsAcquireContextHandle_W return ERROR_SUCCESS; } } else { - return DnsAcquireContextHandle_UTF8( CredentialsFlags, + return DnsAcquireContextHandle_UTF8( CredentialsFlags, Credentials, ContextHandle ); } @@ -76,14 +76,14 @@ DNS_STATUS WINAPI DnsAcquireContextHandle_UTF8 Credentials, ContextHandle ); } else { - /* Convert to unicode, then call the _W version + /* Convert to unicode, then call the _W version * For now, there is no conversion */ DNS_STATUS Status; - + Status = DnsAcquireContextHandle_W( TRUE, Credentials, /* XXX arty */ ContextHandle ); - + /* Free the unicode credentials when they exist. */ return Status; @@ -114,4 +114,4 @@ void WINAPI DnsReleaseContextHandle adns_finish( Context->State ); RtlFreeHeap( RtlGetProcessHeap(), 0, Context ); } - + diff --git a/reactos/dll/win32/dnsapi/dnsapi/query.c b/reactos/dll/win32/dnsapi/dnsapi/query.c index cfe2c445674..450bc699d46 100644 --- a/reactos/dll/win32/dnsapi/dnsapi/query.c +++ b/reactos/dll/win32/dnsapi/dnsapi/query.c @@ -16,10 +16,10 @@ /* DnsQuery **************************** * Begin a DNS query, and allow the result to be placed in the application * supplied result pointer. The result can be manipulated with the record - * functions. + * functions. * * Name -- The DNS object to be queried. - * Type -- The type of records to be returned. These are + * Type -- The type of records to be returned. These are * listed in windns.h * Options -- Query options. DNS_QUERY_STANDARD is the base * state, and every other option takes precedence. @@ -33,7 +33,7 @@ char *xstrsave(const char *str) { char *p; - + p = RtlAllocateHeap( RtlGetProcessHeap(), 0, strlen(str)+1 ); if ( NULL != p ) { strcpy(p,str); @@ -65,7 +65,7 @@ DNS_STATUS WINAPI DnsQuery_A adns_if_noserverwarn | (Servers ? adns_if_noserver : 0), 0 ); - + if( adns_error != adns_s_ok ) { return DnsIntTranslateAdnsToDNS_STATUS( adns_error ); } @@ -93,12 +93,12 @@ DNS_STATUS WINAPI DnsQuery_A CurrentName = (LPSTR) Name; for ( CNameLoop = 0; CNameLoop < CNAME_LOOP_MAX; CNameLoop++ ) { - adns_error = adns_synchronous( astate, - CurrentName, - adns_r_addr, - quflags, + adns_error = adns_synchronous( astate, + CurrentName, + adns_r_addr, + quflags, &answer ); - + if( adns_error != adns_s_ok ) { adns_finish( astate ); if ( CurrentName != Name ) { @@ -111,7 +111,7 @@ DNS_STATUS WINAPI DnsQuery_A if ( CurrentName != Name ) { RtlFreeHeap( CurrentName, 0, GetProcessHeap() ); } - *QueryResultSet = + *QueryResultSet = (PDNS_RECORD)RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof( DNS_RECORD ) ); if ( NULL == *QueryResultSet ) { @@ -121,7 +121,7 @@ DNS_STATUS WINAPI DnsQuery_A (*QueryResultSet)->pNext = NULL; (*QueryResultSet)->wType = Type; (*QueryResultSet)->wDataLength = sizeof(DNS_A_DATA); - (*QueryResultSet)->Data.A.IpAddress = + (*QueryResultSet)->Data.A.IpAddress = answer->rrs.addr->addr.inet.sin_addr.s_addr; adns_finish( astate ); (*QueryResultSet)->pName = xstrsave( Name ); @@ -162,7 +162,7 @@ static PCHAR DnsWToC( const WCHAR *WideString ) { static PWCHAR DnsCToW( const CHAR *NarrowString ) { int chars = mbstowcs( NULL, NarrowString, 0 ); - PWCHAR out = RtlAllocateHeap( RtlGetProcessHeap(), 0, + PWCHAR out = RtlAllocateHeap( RtlGetProcessHeap(), 0, (chars + 1) * sizeof(WCHAR) ); mbstowcs( out, NarrowString, chars + 1 ); return out; @@ -194,12 +194,12 @@ DNS_STATUS WINAPI DnsQuery_W case DNS_TYPE_AAAA: case DNS_TYPE_KEY: #endif - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(DNS_RECORD) ); ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = QueryResultWide->wDataLength; - memcpy( ConvertedRecord, QueryResultWide, + memcpy( ConvertedRecord, QueryResultWide, QueryResultWide->wDataLength ); break; @@ -211,19 +211,19 @@ DNS_STATUS WINAPI DnsQuery_W case DNS_TYPE_MF: case DNS_TYPE_MG: case DNS_TYPE_MR: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(DNS_RECORD) ); ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_PTR_DATA); - ConvertedRecord->Data.PTR.pNameHost = + ConvertedRecord->Data.PTR.pNameHost = (PCHAR)DnsCToW( QueryResultWide->Data.PTR.pNameHost ); break; case DNS_TYPE_MINFO: #ifndef __USE_W32API case DNS_TYPE_RP: #endif - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(DNS_RECORD) ); ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; @@ -239,12 +239,12 @@ DNS_STATUS WINAPI DnsQuery_W case DNS_TYPE_AFSDB: case DNS_TYPE_RT: #endif - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(DNS_RECORD) ); ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_MX_DATA); - ConvertedRecord->Data.MX.pNameExchange = + ConvertedRecord->Data.MX.pNameExchange = (PCHAR)DnsCToW( QueryResultWide->Data.MX.pNameExchange ); ConvertedRecord->Data.MX.wPreference = QueryResultWide->Data.MX.wPreference; @@ -255,42 +255,42 @@ DNS_STATUS WINAPI DnsQuery_W case DNS_TYPE_ISDN: #endif case DNS_TYPE_HINFO: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_TXT_DATA) + + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + sizeof(DNS_TXT_DATA) + QueryResultWide-> Data.TXT.dwStringCount ); ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; - ConvertedRecord->wDataLength = - sizeof(DNS_TXT_DATA) + + ConvertedRecord->wDataLength = + sizeof(DNS_TXT_DATA) + (sizeof(PWCHAR) * QueryResultWide->Data.TXT.dwStringCount); - ConvertedRecord->Data.TXT.dwStringCount = + ConvertedRecord->Data.TXT.dwStringCount = QueryResultWide->Data.TXT.dwStringCount; for( i = 0; i < ConvertedRecord->Data.TXT.dwStringCount; i++ ) { - ConvertedRecord->Data.TXT.pStringArray[i] = + ConvertedRecord->Data.TXT.pStringArray[i] = (PCHAR)DnsCToW( QueryResultWide->Data.TXT.pStringArray[i] ); } break; case DNS_TYPE_NULL: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_NULL_DATA) + + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + sizeof(DNS_NULL_DATA) + QueryResultWide-> Data.Null.dwByteCount ); ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; ConvertedRecord->wDataLength = sizeof(DNS_NULL_DATA) + QueryResultWide->Data.Null.dwByteCount; - ConvertedRecord->Data.Null.dwByteCount = + ConvertedRecord->Data.Null.dwByteCount = QueryResultWide->Data.Null.dwByteCount; - memcpy( &ConvertedRecord->Data.Null.Data, + memcpy( &ConvertedRecord->Data.Null.Data, &QueryResultWide->Data.Null.Data, QueryResultWide->Data.Null.dwByteCount ); break; #ifndef __USE_W32API case DNS_TYPE_SIG: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(DNS_RECORDA) ); ConvertedRecord->pName = DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; @@ -303,7 +303,7 @@ DNS_STATUS WINAPI DnsQuery_W break; case DNS_TYPE_NXT: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(DNS_RECORDA) ); ConvertedRecord->pName = DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; @@ -316,7 +316,7 @@ DNS_STATUS WINAPI DnsQuery_W break; case DNS_TYPE_SRV: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, + ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(DNS_RECORDA) ); ConvertedRecord->pName = DnsCToW( QueryResultWide->pName ); ConvertedRecord->wType = QueryResultWide->wType; @@ -353,7 +353,7 @@ DNS_STATUS WINAPI DnsQuery_UTF8 PIP4_ARRAY Servers, PDNS_RECORD *QueryResultSet, PVOID *Reserved ) { - return DnsQuery_UTF8( Name, Type, Options, Servers, QueryResultSet, + return DnsQuery_UTF8( Name, Type, Options, Servers, QueryResultSet, Reserved ); } @@ -362,7 +362,7 @@ void DnsIntFreeRecordList( PDNS_RECORD ToDelete ) { PDNS_RECORD next = 0; while( ToDelete ) { - if( ToDelete->pName ) + if( ToDelete->pName ) RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->pName ); switch( ToDelete->wType ) { case DNS_TYPE_CNAME: @@ -378,46 +378,46 @@ void DnsIntFreeRecordList( PDNS_RECORD ToDelete ) { case DNS_TYPE_MINFO: #ifndef __USE_W32API case DNS_TYPE_RP: - RtlFreeHeap( RtlGetProcessHeap(), 0, + RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.MINFO.pNameMailbox ); RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.MINFO.pNameErrorsMailbox ); break; - + case DNS_TYPE_AFSDB: case DNS_TYPE_RT: #endif case DNS_TYPE_MX: RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.MX.pNameExchange ); break; - + #ifndef __USE_W32API case DNS_TYPE_TXT: case DNS_TYPE_ISDN: #endif case DNS_TYPE_HINFO: for( i = 0; i < ToDelete->Data.TXT.dwStringCount; i++ ) { - RtlFreeHeap( RtlGetProcessHeap(), 0, + RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.TXT.pStringArray[i] ); } RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.TXT.pStringArray ); break; - + #ifndef __USE_W32API case DNS_TYPE_SIG: RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.SIG.pNameSigner ); break; - + case DNS_TYPE_NXT: RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.NXT.pNameNext ); break; - + case DNS_TYPE_SRV: RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.SRV.pNameTarget ); break; #endif } - + next = ToDelete->pNext; RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete ); ToDelete = next; diff --git a/reactos/dll/win32/fmifs/init.c b/reactos/dll/win32/fmifs/init.c index 0b3489d4ba8..27f635981a2 100644 --- a/reactos/dll/win32/fmifs/init.c +++ b/reactos/dll/win32/fmifs/init.c @@ -112,7 +112,7 @@ InitializeFmIfsOnce(void) NtClose(hKey); return FALSE; } - + while (TRUE) { Status = NtEnumerateValueKey( diff --git a/reactos/dll/win32/gdi32/gdi32.rbuild b/reactos/dll/win32/gdi32/gdi32.rbuild index 77646ee728a..38acd8b6094 100644 --- a/reactos/dll/win32/gdi32/gdi32.rbuild +++ b/reactos/dll/win32/gdi32/gdi32.rbuild @@ -26,7 +26,7 @@ stubs.c stubsa.c stubsw.c - wingl.c + wingl.c arc.c diff --git a/reactos/dll/win32/gdi32/include/gdi32p.h b/reactos/dll/win32/gdi32/include/gdi32p.h index e167cd1a66d..2c386d08381 100644 --- a/reactos/dll/win32/gdi32/include/gdi32p.h +++ b/reactos/dll/win32/gdi32/include/gdi32p.h @@ -49,7 +49,7 @@ typedef struct tagMETAFILEDC { HGDIOBJ Brush; HGDIOBJ Palette; HGDIOBJ Font; - + WCHAR Filename[MAX_PATH+2]; // Add more later. } METAFILEDC,*PMETAFILEDC; @@ -179,7 +179,7 @@ LogFontW2A( VOID STDCALL -EnumLogFontExW2A( +EnumLogFontExW2A( LPENUMLOGFONTEXA fontA, CONST ENUMLOGFONTEXW *fontW ); diff --git a/reactos/dll/win32/gdi32/misc/gdientry.c b/reactos/dll/win32/gdi32/misc/gdientry.c index a4c6037668b..a9e7c0acbba 100644 --- a/reactos/dll/win32/gdi32/misc/gdientry.c +++ b/reactos/dll/win32/gdi32/misc/gdientry.c @@ -72,7 +72,7 @@ DdDestroySurface(LPDDHAL_DESTROYSURFACEDATA pDestroySurface) { RealDestroy = FALSE; } - + /* Call win32k */ Return = NtGdiDdDestroySurface((HANDLE)pSurfaceLocal->hDDSurface, RealDestroy); @@ -86,10 +86,10 @@ WINAPI DdFlip(LPDDHAL_FLIPDATA Flip) { /* Call win32k */ - + return NtGdiDdFlip( (HANDLE)Flip->lpSurfCurr->hDDSurface, (HANDLE)Flip->lpSurfTarg->hDDSurface, - /* FIXME the two last should be current left handler */ + /* FIXME the two last should be current left handler */ (HANDLE)Flip->lpSurfCurr->hDDSurface, (HANDLE)Flip->lpSurfTarg->hDDSurface, (PDD_FLIPDATA)Flip); @@ -99,7 +99,7 @@ DWORD WINAPI DdLock(LPDDHAL_LOCKDATA Lock) { - /* Call win32k */ + /* Call win32k */ return NtGdiDdLock((HANDLE)Lock->lpDDSurface->hDDSurface, (PDD_LOCKDATA)Lock, (HANDLE)Lock->lpDDSurface->hDC); @@ -238,11 +238,11 @@ DdCreateSurface(LPDDHAL_CREATESURFACEDATA pCreateSurface) pDdSurfaceGlobal = &DdSurfaceGlobal; phSurface = &hPrevSurface; puhSurface = &hSurface; - + /* Clear the structures */ RtlZeroMemory(&DdSurfaceLocal, sizeof(DdSurfaceLocal)); RtlZeroMemory(&DdSurfaceGlobal, sizeof(DdSurfaceGlobal)); - RtlZeroMemory(&DdSurfaceMore, sizeof(DdSurfaceMore)); + RtlZeroMemory(&DdSurfaceMore, sizeof(DdSurfaceMore)); } /* check if we got a surface or not */ @@ -262,7 +262,7 @@ DdCreateSurface(LPDDHAL_CREATESURFACEDATA pCreateSurface) phSurface[i] = (HANDLE)lcl->hDDSurface; ptmpDdSurfaceLocal->ddsCaps.dwCaps = lcl->ddsCaps.dwCaps; - ptmpDdSurfaceLocal->dwFlags = (ptmpDdSurfaceLocal->dwFlags & + ptmpDdSurfaceLocal->dwFlags = (ptmpDdSurfaceLocal->dwFlags & (0xB0000000 | DDRAWISURF_INMASTERSPRITELIST | DDRAWISURF_HELCB | DDRAWISURF_FRONTBUFFER | DDRAWISURF_BACKBUFFER | DDRAWISURF_INVALID | @@ -279,7 +279,7 @@ DdCreateSurface(LPDDHAL_CREATESURFACEDATA pCreateSurface) if (lcl->dwFlags & DDRAWISURF_HASPIXELFORMAT) { RtlCopyMemory( &ptmpDdSurfaceGlobal->ddpfSurface , - &gpl->ddpfSurface, + &gpl->ddpfSurface, sizeof(DDPIXELFORMAT)); ptmpDdSurfaceGlobal->ddpfSurface.dwSize = sizeof(DDPIXELFORMAT); @@ -299,7 +299,7 @@ DdCreateSurface(LPDDHAL_CREATESURFACEDATA pCreateSurface) ptmpDdSurfaceMore->dwSurfaceHandle = (DWORD) pCreateSurface->lplpSList[i]->dbnOverlayNode.object_int; } - /* FIXME count to next SurfaceCount for + /* FIXME count to next SurfaceCount for ptmpDdSurfaceGlobal = pDdSurfaceGlobal; ptmpDdSurfaceLocal = pDdSurfaceLocal; ptmpDdSurfaceMore = pDdSurfaceMore; @@ -368,7 +368,7 @@ DdCreateSurface(LPDDHAL_CREATESURFACEDATA pCreateSurface) lcl->lpSurfMore->ddsCapsEx.dwCaps3 = ptmpDdSurfaceMore->ddsCapsEx.dwCaps3; lcl->lpSurfMore->ddsCapsEx.dwCaps4 = ptmpDdSurfaceMore->ddsCapsEx.dwCaps4; } - /* FIXME count to next SurfaceCount for + /* FIXME count to next SurfaceCount for ptmpDdSurfaceGlobal = pDdSurfaceGlobal; ptmpDdSurfaceLocal = pDdSurfaceLocal; ptmpDdSurfaceMore = pDdSurfaceMore; @@ -410,7 +410,7 @@ static ULONG RemberDdQueryDisplaySettingsUniquenessID = 0; BOOL WINAPI -bDDCreateSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface, +bDDCreateSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface, BOOL bComplete) { DD_SURFACE_LOCAL SurfaceLocal; @@ -440,7 +440,7 @@ bDDCreateSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface, /* Check if we have a pixel format */ if (pSurface->dwFlags & DDSD_PIXELFORMAT) - { + { /* Use global one */ SurfaceGlobal.ddpfSurface = pSurface->lpGbl->lpDD->vmiData.ddpfDisplay; SurfaceGlobal.ddpfSurface.dwSize = sizeof(DDPIXELFORMAT); @@ -469,13 +469,13 @@ bDDCreateSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface, /* * @implemented * - * GDIEntry 1 + * GDIEntry 1 */ -BOOL -WINAPI +BOOL +WINAPI DdCreateDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, HDC hdc) -{ +{ BOOL Return = FALSE; /* Check if the global hDC (hdc == 0) is being used */ @@ -490,7 +490,7 @@ DdCreateDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, /* Create the DDraw Object */ ghDirectDraw = NtGdiDdCreateDirectDrawObject(hdc); - /* Delete our DC */ + /* Delete our DC */ NtGdiDeleteObjectApp(hdc); } } @@ -509,8 +509,8 @@ DdCreateDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, else { /* Using the per-process object, so create it */ - pDirectDrawGlobal->hDD = (ULONG_PTR)NtGdiDdCreateDirectDrawObject(hdc); - + pDirectDrawGlobal->hDD = (ULONG_PTR)NtGdiDdCreateDirectDrawObject(hdc); + /* Set the return value */ Return = pDirectDrawGlobal->hDD ? TRUE : FALSE; } @@ -745,7 +745,7 @@ DdQueryDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, if (D3dCallbacks.ContextCreate) { /* FIXME - pD3dCallbacks->ContextCreate = D3dContextCreate; + pD3dCallbacks->ContextCreate = D3dContextCreate; */ } if (D3dCallbacks.ContextDestroy) @@ -754,7 +754,7 @@ DdQueryDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, } if (D3dCallbacks.ContextDestroyAll) { - /* FIXME + /* FIXME pD3dCallbacks->ContextDestroyAll = (LPD3DHAL_CONTEXTDESTROYALLCB) NtGdiD3dContextDestroyAll; */ } @@ -783,7 +783,7 @@ DdQueryDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, * * GDIEntry 3 */ -BOOL +BOOL WINAPI DdDeleteDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal) { @@ -825,8 +825,8 @@ DdDeleteDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal) * * GDIEntry 4 */ -BOOL -WINAPI +BOOL +WINAPI DdCreateSurfaceObject( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal, BOOL bPrimarySurface) { @@ -839,8 +839,8 @@ DdCreateSurfaceObject( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal, * * GDIEntry 5 */ -BOOL -WINAPI +BOOL +WINAPI DdDeleteSurfaceObject(LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal) { BOOL Return = FALSE; @@ -861,9 +861,9 @@ DdDeleteSurfaceObject(LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal) * * GDIEntry 6 */ -BOOL -WINAPI -DdResetVisrgn(LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal, +BOOL +WINAPI +DdResetVisrgn(LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal, HWND hWnd) { /* Call win32k directly */ @@ -919,15 +919,15 @@ DdCreateDIBSection(HDC hdc, * * GDIEntry 10 */ -BOOL -WINAPI +BOOL +WINAPI DdReenableDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, BOOL *pbNewMode) { /* Call win32k directly */ return NtGdiDdReenableDirectDrawObject(GetDdHandle(pDirectDrawGlobal->hDD), pbNewMode); -} +} /* @@ -935,8 +935,8 @@ DdReenableDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, * * GDIEntry 11 */ -BOOL -STDCALL +BOOL +STDCALL DdAttachSurface( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceFrom, LPDDRAWI_DDRAWSURFACE_LCL pSurfaceTo) { @@ -984,7 +984,7 @@ DdUnattachSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface, * GDIEntry 13 */ ULONG -STDCALL +STDCALL DdQueryDisplaySettingsUniqueness() { /* FIXME share memory */ @@ -996,8 +996,8 @@ DdQueryDisplaySettingsUniqueness() * * GDIEntry 14 */ -HANDLE -WINAPI +HANDLE +WINAPI DdGetDxHandle(LPDDRAWI_DIRECTDRAW_LCL pDDraw, LPDDRAWI_DDRAWSURFACE_LCL pSurface, BOOL bRelease) diff --git a/reactos/dll/win32/gdi32/misc/hacks.c b/reactos/dll/win32/gdi32/misc/hacks.c index 246d7e86227..86779d7437f 100644 --- a/reactos/dll/win32/gdi32/misc/hacks.c +++ b/reactos/dll/win32/gdi32/misc/hacks.c @@ -6,7 +6,7 @@ * * GDI32.DLL hacks * - * Api that are hacked but we can not do correct implemtions yetm but using own syscall + * Api that are hacked but we can not do correct implemtions yetm but using own syscall * */ @@ -14,12 +14,12 @@ * @implemented * */ -int +int STDCALL GetPolyFillMode(HDC hdc) { /* FIXME do not use reactos own syscall for this, - * this hack need be remove + * this hack need be remove */ return NtGdiGetPolyFillMode(hdc); } @@ -29,12 +29,12 @@ GetPolyFillMode(HDC hdc) * @implemented * */ -int +int STDCALL GetGraphicsMode(HDC hdc) { /* FIXME do not use reactos own syscall for this, - * this hack need be remove + * this hack need be remove */ return NtGdiGetGraphicsMode(hdc); } @@ -43,12 +43,12 @@ GetGraphicsMode(HDC hdc) * @implemented * */ -int +int STDCALL GetROP2(HDC hdc) { /* FIXME do not use reactos own syscall for this, - * this hack need be remove + * this hack need be remove */ return NtGdiGetROP2(hdc); } @@ -58,7 +58,7 @@ GetROP2(HDC hdc) * @implemented * */ -INT +INT STDCALL SetDIBitsToDevice( HDC hDC, @@ -96,9 +96,9 @@ SetDIBitsToDevice( * @implemented * */ -int +int STDCALL -SetBkMode(HDC hdc, +SetBkMode(HDC hdc, int iBkMode) { return NtGdiSetBkMode(hdc,iBkMode); @@ -110,7 +110,7 @@ SetBkMode(HDC hdc, */ HGDIOBJ STDCALL -SelectObject(HDC hdc, +SelectObject(HDC hdc, HGDIOBJ hgdiobj) { return NtGdiSelectObject(hdc,hgdiobj); @@ -121,7 +121,7 @@ SelectObject(HDC hdc, * @implemented * */ -int +int STDCALL GetMapMode(HDC hdc) { @@ -132,7 +132,7 @@ GetMapMode(HDC hdc) * @implemented * */ -int +int STDCALL GetStretchBltMode(HDC hdc) { @@ -143,7 +143,7 @@ GetStretchBltMode(HDC hdc) * @implemented * */ -UINT +UINT STDCALL GetTextAlign(HDC hdc) { @@ -194,7 +194,7 @@ OffsetViewportOrgEx(HDC hdc, * @implemented * */ -BOOL +BOOL STDCALL OffsetWindowOrgEx(HDC hdc, int nXOffset, diff --git a/reactos/dll/win32/gdi32/misc/heap.c b/reactos/dll/win32/gdi32/misc/heap.c index c50ef33ac8f..b9bde461486 100644 --- a/reactos/dll/win32/gdi32/misc/heap.c +++ b/reactos/dll/win32/gdi32/misc/heap.c @@ -18,11 +18,11 @@ * $Id: * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS GDI32 - * PURPOSE: + * PURPOSE: * FILE: lib/gdi32/misc/heap.c - * PROGRAMER: - * REVISION HISTORY: - * NOTES: + * PROGRAMER: + * REVISION HISTORY: + * NOTES: */ #include "precomp.h" diff --git a/reactos/dll/win32/gdi32/misc/historic.c b/reactos/dll/win32/gdi32/misc/historic.c index 71c3c3db7f9..287169c956d 100644 --- a/reactos/dll/win32/gdi32/misc/historic.c +++ b/reactos/dll/win32/gdi32/misc/historic.c @@ -4,7 +4,7 @@ * * GDI32.DLL Stubs * - * Api that does basic nothing, but is here for backwords compatible with older windows + * Api that does basic nothing, but is here for backwords compatible with older windows * */ @@ -77,7 +77,7 @@ GdiPlayScript(DWORD a0, /* * @implemented */ -HBITMAP +HBITMAP STDCALL GdiConvertBitmap(HBITMAP hbm) { @@ -99,7 +99,7 @@ GdiConvertBrush(HBRUSH hbr) /* * @implemented */ -HDC +HDC STDCALL GdiConvertDC(HDC hdc) { @@ -110,7 +110,7 @@ GdiConvertDC(HDC hdc) /* * @implemented */ -HFONT +HFONT STDCALL GdiConvertFont(HFONT hfont) { @@ -121,7 +121,7 @@ GdiConvertFont(HFONT hfont) /* * @implemented */ -HPALETTE +HPALETTE STDCALL GdiConvertPalette(HPALETTE hpal) { @@ -166,7 +166,7 @@ GdiDeleteLocalDC(HDC hdc) /* * @implemented */ -VOID +VOID STDCALL GdiSetServerAttr(HDC hdc,DWORD attr) { @@ -269,7 +269,7 @@ SelectFontLocal(HFONT Currenthfnt, /* * @implemented */ -HBRUSH +HBRUSH STDCALL GdiGetLocalBrush(HBRUSH hbr) { @@ -279,7 +279,7 @@ GdiGetLocalBrush(HBRUSH hbr) /* * @implemented */ -HDC +HDC STDCALL GdiGetLocalDC(HDC hdc) { @@ -289,7 +289,7 @@ GdiGetLocalDC(HDC hdc) /* * @implemented */ -HFONT +HFONT STDCALL GdiGetLocalFont(HFONT hfont) { diff --git a/reactos/dll/win32/gdi32/misc/misc.c b/reactos/dll/win32/gdi32/misc/misc.c index 0f2612f9975..588f063172b 100644 --- a/reactos/dll/win32/gdi32/misc/misc.c +++ b/reactos/dll/win32/gdi32/misc/misc.c @@ -52,7 +52,7 @@ GdiAlphaBlend( if ( hDCSrc == NULL ) return FALSE; if (GDI_HANDLE_GET_TYPE(hDCSrc) == GDI_OBJECT_TYPE_METADC) return FALSE; - + return NtGdiAlphaBlend( hDCDst, DstX, @@ -71,7 +71,7 @@ GdiAlphaBlend( /* * @implemented */ -HGDIOBJ +HGDIOBJ STDCALL GdiFixUpHandle(HGDIOBJ hGdiObj) { @@ -103,7 +103,7 @@ GdiQueryTable(VOID) BOOL GdiIsHandleValid(HGDIOBJ hGdiObj) { PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj); - if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 && + if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 && (Entry->Type << GDI_ENTRY_UPPER_SHIFT) == GDI_HANDLE_GET_UPPER(hGdiObj)) { HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1); @@ -118,7 +118,7 @@ BOOL GdiIsHandleValid(HGDIOBJ hGdiObj) BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, PVOID *UserData) { PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj); - if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 && + if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 && (Entry->Type << GDI_ENTRY_UPPER_SHIFT) == GDI_HANDLE_GET_UPPER(hGdiObj)) { HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1); @@ -137,7 +137,7 @@ PLDC GdiGetLDC(HDC hDC) PDC_ATTR Dc_Attr; if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return NULL; - return Dc_Attr->pvLDC; + return Dc_Attr->pvLDC; } /* diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index cfd221c41c8..71c06a6eab9 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -55,7 +55,7 @@ StretchDIBits(HDC hdc, { /* FIXME share memory */ - return NtGdiStretchDIBits(hdc, XDest, YDest, nDestWidth, nDestHeight, XSrc, YSrc, + return NtGdiStretchDIBits(hdc, XDest, YDest, nDestWidth, nDestHeight, XSrc, YSrc, nSrcWidth, nSrcHeight, lpBits, lpBitsInfo, iUsage, dwRop); } @@ -224,7 +224,7 @@ SetBrushOrgEx(HDC hdc, /* * @unimplemented */ -BOOL +BOOL STDCALL PtInRegion(IN HRGN hrgn, int x, @@ -776,7 +776,7 @@ AngleArc( /* - * @unimplemented + * @unimplemented */ BOOL STDCALL @@ -1366,8 +1366,8 @@ gdiPlaySpoolStream( /* * @unimplemented */ -HANDLE -STDCALL +HANDLE +STDCALL AddFontMemResourceEx( PVOID pbFont, DWORD cbFont, @@ -1383,8 +1383,8 @@ AddFontMemResourceEx( /* * @unimplemented */ -int -STDCALL +int +STDCALL AddFontResourceTracking( LPCSTR lpString, int unknown @@ -1400,7 +1400,7 @@ AddFontResourceTracking( /* * @unimplemented */ -HBITMAP +HBITMAP STDCALL ClearBitmapAttributes(HBITMAP hbm, DWORD dwFlags) { @@ -1412,7 +1412,7 @@ ClearBitmapAttributes(HBITMAP hbm, DWORD dwFlags) /* * @unimplemented */ -HBRUSH +HBRUSH STDCALL ClearBrushAttributes(HBRUSH hbm, DWORD dwFlags) { @@ -1424,7 +1424,7 @@ ClearBrushAttributes(HBRUSH hbm, DWORD dwFlags) /* * @unimplemented */ -BOOL +BOOL STDCALL ColorCorrectPalette(HDC hDC,HPALETTE hPalette,DWORD dwFirstEntry,DWORD dwNumOfEntries) { @@ -1450,7 +1450,7 @@ EndFormPage(HDC hdc) /* * @unimplemented */ -DWORD +DWORD STDCALL GdiAddGlsBounds(HDC hdc,LPRECT prc) { @@ -1462,7 +1462,7 @@ GdiAddGlsBounds(HDC hdc,LPRECT prc) /* * @unimplemented */ -BOOL +BOOL STDCALL GdiArtificialDecrementDriver(LPWSTR pDriverName,BOOL unknown) { @@ -1498,7 +1498,7 @@ GdiConvertAndCheckDC(HDC hdc) /* * @unimplemented */ -HENHMETAFILE +HENHMETAFILE STDCALL GdiConvertEnhMetaFile(HENHMETAFILE hmf) { @@ -1522,7 +1522,7 @@ GdiDrawStream(HDC dc, ULONG l, VOID *v) /* * @unimplemented */ -DWORD +DWORD STDCALL GdiGetCodePage(HDC hdc) { @@ -1582,7 +1582,7 @@ GdiValidateHandle(HGDIOBJ hobj) /* * @unimplemented */ -DWORD +DWORD STDCALL GetBitmapAttributes(HBITMAP hbm) { @@ -1594,7 +1594,7 @@ GetBitmapAttributes(HBITMAP hbm) /* * @unimplemented */ -DWORD +DWORD STDCALL GetBrushAttributes(HBRUSH hbr) { @@ -1606,7 +1606,7 @@ GetBrushAttributes(HBRUSH hbr) /* * @unimplemented */ -BOOL +BOOL STDCALL GetCharABCWidthsI(HDC hdc, UINT giFirst, @@ -1623,7 +1623,7 @@ GetCharABCWidthsI(HDC hdc, /* * @unimplemented */ -BOOL +BOOL STDCALL GetCharWidthI(HDC hdc, UINT giFirst, @@ -1642,7 +1642,7 @@ GetCharWidthI(HDC hdc, /* * @implemented */ -ULONG +ULONG STDCALL GetEUDCTimeStamp(VOID) { @@ -1652,7 +1652,7 @@ GetEUDCTimeStamp(VOID) /* * @implemented */ -ULONG +ULONG STDCALL GetFontAssocStatus(HDC hdc) { @@ -1669,7 +1669,7 @@ GetFontAssocStatus(HDC hdc) /* * @unimplemented */ -HFONT +HFONT STDCALL GetHFONT(HDC dc) { @@ -1681,7 +1681,7 @@ GetHFONT(HDC dc) /* * @unimplemented */ -DWORD +DWORD STDCALL GetLayout(HDC hdc ) @@ -1710,7 +1710,7 @@ GetTextExtentExPointWPri(HDC hdc, /* * @implemented */ -INT +INT STDCALL GetTextFaceAliasW(HDC hdc, int cChar, @@ -1733,7 +1733,7 @@ GetTextFaceAliasW(HDC hdc, /* * @unimplemented */ -BOOL +BOOL STDCALL MirrorRgn(HWND hwnd,HRGN hrgn) { @@ -1747,7 +1747,7 @@ MirrorRgn(HWND hwnd,HRGN hrgn) /* * @unimplemented */ -DWORD +DWORD STDCALL QueryFontAssocStatus(VOID) { @@ -1759,7 +1759,7 @@ QueryFontAssocStatus(VOID) /* * @implemented */ -BOOL +BOOL STDCALL RemoveFontMemResourceEx(HANDLE fh) { @@ -1779,7 +1779,7 @@ RemoveFontMemResourceEx(HANDLE fh) /* * @unimplemented */ -int +int STDCALL RemoveFontResourceTracking(LPCSTR lpString,int unknown) { @@ -1791,7 +1791,7 @@ RemoveFontResourceTracking(LPCSTR lpString,int unknown) /* * @unimplemented */ -HBITMAP +HBITMAP STDCALL SetBitmapAttributes(HBITMAP hbm, DWORD dwFlags) { @@ -1803,7 +1803,7 @@ SetBitmapAttributes(HBITMAP hbm, DWORD dwFlags) /* * @unimplemented */ -HBRUSH +HBRUSH STDCALL SetBrushAttributes(HBRUSH hbm, DWORD dwFlags) { @@ -1815,7 +1815,7 @@ SetBrushAttributes(HBRUSH hbm, DWORD dwFlags) /* * @unimplemented */ -DWORD +DWORD STDCALL SetLayout(HDC hdc, DWORD dwLayout) @@ -1828,7 +1828,7 @@ SetLayout(HDC hdc, /* * @unimplemented */ -DWORD +DWORD STDCALL SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout) { @@ -1842,7 +1842,7 @@ SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout) /* * @implemented */ -int +int STDCALL StartFormPage(HDC hdc) { @@ -1852,7 +1852,7 @@ StartFormPage(HDC hdc) /* * @unimplemented */ -VOID +VOID STDCALL UnloadNetworkFonts(DWORD unknown) { @@ -1863,7 +1863,7 @@ UnloadNetworkFonts(DWORD unknown) /* * @implemented */ -BOOL +BOOL STDCALL GetTextExtentExPointI(HDC hdc, LPWORD pgiIn, @@ -1879,7 +1879,7 @@ GetTextExtentExPointI(HDC hdc, /* * @implemented */ -BOOL +BOOL STDCALL GetTextExtentPointI(HDC hdc, LPWORD pgiIn, @@ -1896,7 +1896,7 @@ GetTextExtentPointI(HDC hdc, /* * @unimplemented */ -BOOL +BOOL STDCALL GdiRealizationInfo(HDC hdc, PREALIZATION_INFO pri) @@ -1911,7 +1911,7 @@ GdiRealizationInfo(HDC hdc, /* * @unimplemented */ -BOOL +BOOL STDCALL GetETM(HDC hdc, EXTTEXTMETRIC *petm) @@ -2051,7 +2051,7 @@ GdiCreateLocalMetaFilePict(HENHMETAFILE hmo) /* * @unimplemented */ -HANDLE +HANDLE STDCALL GdiGetSpoolFileHandle(LPWSTR pwszPrinterName, LPDEVMODEW pDevmode, @@ -2077,7 +2077,7 @@ GdiDeleteSpoolFileHandle(HANDLE SpoolFileHandle) /* * @unimplemented */ -DWORD +DWORD STDCALL GdiGetPageCount(HANDLE SpoolFileHandle) { @@ -2101,7 +2101,7 @@ GdiGetDC(HANDLE SpoolFileHandle) /* * @unimplemented */ -HANDLE +HANDLE STDCALL GdiGetPageHandle(HANDLE SpoolFileHandle, DWORD Page, @@ -2207,8 +2207,8 @@ GdiResetDCEMF(HANDLE SpoolFileHandle, } -HBITMAP -STDCALL +HBITMAP +STDCALL CreateDIBitmap(HDC hDc, const BITMAPINFOHEADER *Header, DWORD Init, LPCVOID Bits, const BITMAPINFO *Data, @@ -2229,7 +2229,7 @@ CombineRgn(HRGN hDest, INT CombineMode) { /* FIXME some part should be done in user mode */ - return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); + return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); } /* @@ -2282,7 +2282,7 @@ XLATEOBJ_piVector(XLATEOBJ *XlateObj) /* * @unimplemented */ -BOOL +BOOL STDCALL GdiPlayEMF(LPWSTR pwszPrinterName, LPDEVMODEW pDevmode, @@ -2409,17 +2409,17 @@ GdiPrinterThunk( HBITMAP STDCALL GdiConvertBitmapV5( - HBITMAP in_format_BitMap, + HBITMAP in_format_BitMap, HBITMAP src_BitMap, INT bpp, INT unuse) { /* FIXME guessing the prototypes */ - /* - * it have create a new bitmap with desired in format, + /* + * it have create a new bitmap with desired in format, * then convert it src_bitmap to new format - * and return it as HBITMAP + * and return it as HBITMAP */ return FALSE; @@ -2430,8 +2430,8 @@ GdiConvertBitmapV5( * @implemented * */ -COLORREF -STDCALL +COLORREF +STDCALL GetBkColor(HDC hdc) { /* FIXME some part are done in user mode */ @@ -2443,7 +2443,7 @@ GetBkColor(HDC hdc) * */ int -STDCALL +STDCALL GetBkMode(HDC hdc) { /* FIXME some part are done in user mode */ @@ -2454,8 +2454,8 @@ GetBkMode(HDC hdc) * @implemented * */ -BOOL -STDCALL +BOOL +STDCALL GetBrushOrgEx(HDC hdc,LPPOINT pt) { /* FIXME some part are done in user mode */ @@ -2466,8 +2466,8 @@ GetBrushOrgEx(HDC hdc,LPPOINT pt) * @implemented * */ -BOOL -STDCALL +BOOL +STDCALL GetCharABCWidthsFloatW(HDC hdc,UINT FirstChar,UINT LastChar,LPABCFLOAT abcF) { /* FIXME some part are done in user mode */ @@ -2478,8 +2478,8 @@ GetCharABCWidthsFloatW(HDC hdc,UINT FirstChar,UINT LastChar,LPABCFLOAT abcF) * @implemented * */ -int -STDCALL +int +STDCALL GetDeviceCaps(HDC hdc, int i) { @@ -2492,8 +2492,8 @@ GetDeviceCaps(HDC hdc, * @implemented * */ -BOOL -STDCALL +BOOL +STDCALL GetCurrentPositionEx(HDC hdc, LPPOINT lpPoint) { @@ -2505,7 +2505,7 @@ GetCurrentPositionEx(HDC hdc, * @implemented * */ -int +int STDCALL GetClipBox(HDC hdc, LPRECT lprc) @@ -2518,11 +2518,11 @@ GetClipBox(HDC hdc, * @implemented * */ -BOOL +BOOL STDCALL GetCharWidthFloatW(HDC hdc, - UINT iFirstChar, - UINT iLastChar, + UINT iFirstChar, + UINT iLastChar, PFLOAT pxBuffer) { /* FIXME some part need be done in user mode */ @@ -2564,7 +2564,7 @@ GetCharABCWidths(HDC hdc, * @implemented * */ -DWORD +DWORD STDCALL GetFontData(HDC hdc, DWORD dwTable, @@ -2584,7 +2584,7 @@ GetFontData(HDC hdc, * @implemented * */ -DWORD +DWORD STDCALL GetRegionData(HRGN hrgn, DWORD nCount, @@ -2635,12 +2635,12 @@ GetTextCharsetInfo(HDC hdc, DWORD dwFlags) { /* FIXME some part are done in user mode */ - return NtGdiGetTextCharsetInfo(hdc, lpSig, dwFlags); + return NtGdiGetTextCharsetInfo(hdc, lpSig, dwFlags); } -INT +INT STDCALL IntersectClipRect(HDC hdc, int nLeftRect, @@ -2652,7 +2652,7 @@ IntersectClipRect(HDC hdc, return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); } -INT +INT STDCALL OffsetClipRgn(HDC hdc, int nXOffset, @@ -2667,14 +2667,14 @@ INT STDCALL NamedEscape(HDC hdc, PWCHAR pDriver, - INT iEsc, + INT iEsc, INT cjIn, LPSTR pjIn, INT cjOut, LPSTR pjOut) { - /* FIXME metadc, metadc are done most in user mode, and we do not support it - * Windows 2000/XP/Vista ignore the current hdc, that are being pass and always set hdc to NULL + /* FIXME metadc, metadc are done most in user mode, and we do not support it + * Windows 2000/XP/Vista ignore the current hdc, that are being pass and always set hdc to NULL * when it calls to NtGdiExtEscape from NamedEscape */ return NtGdiExtEscape(NULL,pDriver,wcslen(pDriver),iEsc,cjIn,pjIn,cjOut,pjOut); @@ -2683,11 +2683,11 @@ NamedEscape(HDC hdc, BOOL STDCALL -PatBlt(HDC hdc, - int nXLeft, - int nYLeft, - int nWidth, - int nHeight, +PatBlt(HDC hdc, + int nXLeft, + int nYLeft, + int nWidth, + int nHeight, DWORD dwRop) { /* FIXME some part need be done in user mode */ diff --git a/reactos/dll/win32/gdi32/misc/stubsa.c b/reactos/dll/win32/gdi32/misc/stubsa.c index 8fdf94b7a93..b43f3407858 100644 --- a/reactos/dll/win32/gdi32/misc/stubsa.c +++ b/reactos/dll/win32/gdi32/misc/stubsa.c @@ -55,11 +55,11 @@ StartDocA( /* * @unimplemented */ -BOOL -STDCALL +BOOL +STDCALL PolyTextOutA( - HDC hdc, - CONST POLYTEXTA *a1, + HDC hdc, + CONST POLYTEXTA *a1, int a2 ) { diff --git a/reactos/dll/win32/gdi32/misc/stubsw.c b/reactos/dll/win32/gdi32/misc/stubsw.c index d721f4b02aa..50639f813f6 100644 --- a/reactos/dll/win32/gdi32/misc/stubsw.c +++ b/reactos/dll/win32/gdi32/misc/stubsw.c @@ -202,7 +202,7 @@ UpdateICMRegKeyW( } -/* === AFTER THIS POINT I GUESS... ========= +/* === AFTER THIS POINT I GUESS... ========= * (based on stack size in Norlander's .def) * === WHERE ARE THEY DEFINED? ============= */ diff --git a/reactos/dll/win32/gdi32/misc/wingl.c b/reactos/dll/win32/gdi32/misc/wingl.c index 8f0c9e524c6..b8f21be4912 100644 --- a/reactos/dll/win32/gdi32/misc/wingl.c +++ b/reactos/dll/win32/gdi32/misc/wingl.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * - * + * * */ diff --git a/reactos/dll/win32/gdi32/objects/arc.c b/reactos/dll/win32/gdi32/objects/arc.c index 672c7c05492..81e434499aa 100644 --- a/reactos/dll/win32/gdi32/objects/arc.c +++ b/reactos/dll/win32/gdi32/objects/arc.c @@ -1,194 +1,194 @@ -#include "precomp.h" - -BOOL -WINAPI -Arc( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXStartArc, - int nYStartArc, - int nXEndArc, - int nYEndArc -) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) -// Call Wine (rewrite of) MFDRV_MetaParam8 - return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { -// Call Wine (rewrite of) EMFDRV_ArcChordPie - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeArc, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXStartArc, - nYStartArc, - nXEndArc, - nYEndArc); -} - -BOOL -WINAPI -ArcTo( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return FALSE; //No meta support for ArcTo - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeArcTo, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); -} - -BOOL -WINAPI -Chord( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypeChord, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); -} - - -/* - * @unimplemented - */ -BOOL -STDCALL -Pie( - HDC hDC, - int a1, - int a2, - int a3, - int a4, - int a5, - int a6, - int a7, - int a8 - ) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8) - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE); - return Ret; - } - return FALSE; - } - } -#endif - return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8); -} - - +#include "precomp.h" + +BOOL +WINAPI +Arc( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXStartArc, + int nYStartArc, + int nXEndArc, + int nYEndArc +) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) +// Call Wine (rewrite of) MFDRV_MetaParam8 + return MFDRV_MetaParam8( hDC, META_ARC, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { +// Call Wine (rewrite of) EMFDRV_ArcChordPie + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARC); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeArc, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXStartArc, + nYStartArc, + nXEndArc, + nYEndArc); +} + +BOOL +WINAPI +ArcTo( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXRadial1, + int nYRadial1, + int nXRadial2, + int nYRadial2) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return FALSE; //No meta support for ArcTo + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_ARCTO); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeArcTo, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXRadial1, + nYRadial1, + nXRadial2, + nYRadial2); +} + +BOOL +WINAPI +Chord( + HDC hDC, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect, + int nXRadial1, + int nYRadial1, + int nXRadial2, + int nYRadial2) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam8( hDC, META_CHORD, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_CHORD); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypeChord, + hDC, + nLeftRect, + nTopRect, + nRightRect, + nBottomRect, + nXRadial1, + nYRadial1, + nXRadial2, + nYRadial2); +} + + +/* + * @unimplemented + */ +BOOL +STDCALL +Pie( + HDC hDC, + int a1, + int a2, + int a3, + int a4, + int a5, + int a6, + int a7, + int a8 + ) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam8( hDC, META_PIE, a1, a2, a3, a4, a5, a6, a7, a8) + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + BOOL Ret = EMFDRV_ArcChordPie( hDC, a1, a2, a3, a4, a5, a6, a7, a8, EMR_PIE); + return Ret; + } + return FALSE; + } + } +#endif + return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8); +} + + diff --git a/reactos/dll/win32/gdi32/objects/bitmap.c b/reactos/dll/win32/gdi32/objects/bitmap.c index b8dff1b1377..3b46dbebfb9 100644 --- a/reactos/dll/win32/gdi32/objects/bitmap.c +++ b/reactos/dll/win32/gdi32/objects/bitmap.c @@ -5,7 +5,7 @@ /* * Return the full scan size for a bitmap. - * + * * Based on Wine, Utils.c and Windows Graphics Prog pg 595 */ UINT @@ -13,7 +13,7 @@ FASTCALL DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines ) { UINT MaxBits = 0; - + if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)Info; @@ -23,7 +23,7 @@ DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines ) { if ((Info->bmiHeader.biCompression) && (Info->bmiHeader.biCompression != BI_BITFIELDS)) return Info->bmiHeader.biSizeImage; - // Planes are over looked by Yuan. I guess assumed always 1. + // Planes are over looked by Yuan. I guess assumed always 1. MaxBits = Info->bmiHeader.biBitCount * Info->bmiHeader.biPlanes * Info->bmiHeader.biWidth; } MaxBits = ((MaxBits + 31) & ~31 ) / 8; // From Yuan, ScanLineSize = (Width * bitcount + 31)/32 @@ -102,7 +102,7 @@ StretchBlt( int nWidthSrc, /* width of source rectangle */ int nHeightSrc, /* height of source rectangle */ DWORD dwRop) /* raster operation code */ - + { if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc)) { @@ -110,7 +110,7 @@ StretchBlt( nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop, 0); } - + return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, dwRop, 0, 0); } @@ -154,7 +154,7 @@ CreateCompatibleBitmap( -INT +INT STDCALL GetDIBits( HDC hDC, @@ -173,7 +173,7 @@ GetDIBits( } else if (lpbmi == NULL) { - // XP doesn't run this check and results in a + // XP doesn't run this check and results in a // crash in DIB_BitmapMaxBitsSize, we'll be more forgiving GdiSetLastError(ERROR_INVALID_PARAMETER); } diff --git a/reactos/dll/win32/gdi32/objects/brush.c b/reactos/dll/win32/gdi32/objects/brush.c index 379b6af8379..7775775c450 100644 --- a/reactos/dll/win32/gdi32/objects/brush.c +++ b/reactos/dll/win32/gdi32/objects/brush.c @@ -43,7 +43,7 @@ CreateDIBPatternBrush( PBITMAPINFO pConvertedInfo; UINT ConvertedInfoSize; - lpPackedDIB = GlobalLock(hglbDIBPacked); + lpPackedDIB = GlobalLock(hglbDIBPacked); if (lpPackedDIB == NULL) return 0; @@ -56,7 +56,7 @@ CreateDIBPatternBrush( if ((PBITMAPINFO)lpPackedDIB != pConvertedInfo) RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo); } - + GlobalUnlock(hglbDIBPacked); return hBrush; @@ -145,14 +145,14 @@ CreateBrushIndirect( break; case BS_PATTERN: - hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch, - FALSE, + hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch, + FALSE, FALSE); break; case BS_PATTERN8X8: - hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch, - FALSE, + hBrush = NtGdiCreatePatternBrushInternal((HBITMAP)LogBrush->lbHatch, + FALSE, TRUE); break; @@ -161,11 +161,11 @@ CreateBrushIndirect( break; case BS_HATCHED: - hBrush = NtGdiCreateHatchBrushInternal(LogBrush->lbHatch, - LogBrush->lbColor, + hBrush = NtGdiCreateHatchBrushInternal(LogBrush->lbHatch, + LogBrush->lbColor, FALSE); break; - + case BS_NULL: hBrush = NtGdiGetStockObject(NULL_BRUSH); break; diff --git a/reactos/dll/win32/gdi32/objects/coord.c b/reactos/dll/win32/gdi32/objects/coord.c index d75365479e6..70e4f3c9aad 100644 --- a/reactos/dll/win32/gdi32/objects/coord.c +++ b/reactos/dll/win32/gdi32/objects/coord.c @@ -53,14 +53,14 @@ FtoEF( EFLOAT_S * efp, FLOATL f) #endif Exp = EXP(worker.l); - Mant = MANT(worker.l); + Mant = MANT(worker.l); if (SIGN(worker.l)) Sign = -1; //// M$ storage emulation Mant = ((Mant << 7) | 0x40000000); - Mant ^= Sign; + Mant ^= Sign; Mant -= Sign; Exp -= (EXCESS-1); -//// +//// efp->lMant = Mant; efp->lExp = Exp; } @@ -71,7 +71,7 @@ CoordCnvP(MATRIX_S * mx, LPPOINT Point) { FLOAT x, y; gxf_long a, b, c; - + x = (FLOAT)Point->x; y = (FLOAT)Point->y; @@ -97,7 +97,7 @@ DPtoLP ( HDC hDC, LPPOINT Points, INT Count ) #if 0 INT i; PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; if (Dc_Attr->flXform & ( DEVICE_TO_WORLD_INVALID | // Force a full recalibration! @@ -124,7 +124,7 @@ LPtoDP ( HDC hDC, LPPOINT Points, INT Count ) #if 0 INT i; PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; if (Dc_Attr->flXform & ( PAGE_XLATE_CHANGED | // Check for Changes and Updates @@ -187,7 +187,7 @@ ModifyWorldTransform( } if (pLDC->iType == LDC_EMFLDC) { - if (iMode == MWT_MAX+1) + if (iMode == MWT_MAX+1) if (!EMFDRV_SetWorldTransform( hDC, Xform) ) return FALSE; return EMFDRV_ModifyWorldTransform( hDC, Xform, iMode); // Ported from wine. } @@ -195,11 +195,11 @@ ModifyWorldTransform( } } PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; /* Check that graphics mode is GM_ADVANCED */ - if ( Dc_Attr->iGraphicsMode != GM_ADVANCED ) return FALSE; + if ( Dc_Attr->iGraphicsMode != GM_ADVANCED ) return FALSE; #endif return NtGdiModifyWorldTransform(hDC, (CONST LPXFORM) Xform, iMode); } diff --git a/reactos/dll/win32/gdi32/objects/dc.c b/reactos/dll/win32/gdi32/objects/dc.c index a4fcfdf6132..3229b48c720 100644 --- a/reactos/dll/win32/gdi32/objects/dc.c +++ b/reactos/dll/win32/gdi32/objects/dc.c @@ -17,9 +17,9 @@ IntCreateDICW ( LPCWSTR lpwszDriver, HDC hDC = NULL; BOOL Display = FALSE, Default = TRUE; ULONG UMdhpdev = 0; - + HANDLE hspool = NULL; - + if ((!lpwszDevice) && (!lpwszDriver)) { Default = FALSE; // Ask Win32k to set Default device. @@ -36,13 +36,13 @@ IntCreateDICW ( LPCWSTR lpwszDriver, { if (lpwszDriver) // Second { - if ((!_wcsnicmp(lpwszDriver, L"DISPLAY",7)) || + if ((!_wcsnicmp(lpwszDriver, L"DISPLAY",7)) || (!_wcsnicmp(lpwszDriver, L"\\\\.\\DISPLAY",11))) Display = TRUE; RtlInitUnicodeString(&Device, lpwszDriver); } } } - + if (lpwszOutput) RtlInitUnicodeString(&Output, lpwszOutput); if (!Display) @@ -50,7 +50,7 @@ IntCreateDICW ( LPCWSTR lpwszDriver, //Handle Print device or something else. DPRINT1("Not a DISPLAY device! %wZ\n", &Device); } - + hDC = NtGdiOpenDCW( (Default ? &Device : NULL), (PDEVMODEW) lpInitData, (lpwszOutput ? &Output : NULL), @@ -75,7 +75,7 @@ IntCreateDICW ( LPCWSTR lpwszDriver, DbgPrint("DC_ATTR Allocated -> 0x%x\n",Dc_Attr); } #endif - return hDC; + return hDC; } @@ -229,7 +229,7 @@ CreateICA( { if ( lpdvmInit ) dvmInitW = GdiConvertToDevmodeW((LPDEVMODEA)lpdvmInit); - + rc = IntCreateDICW ( lpszDriverW, lpszDeviceW, lpszOutputW, @@ -259,7 +259,7 @@ DeleteDC(HDC hDC) PLDC pLDC; if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; - + if ( Dc_Attr ) { pLDC = Dc_Attr->pvLDC; @@ -272,7 +272,7 @@ DeleteDC(HDC hDC) } #endif Ret = NtGdiDeleteObjectApp(hDC); - + return Ret; } @@ -287,7 +287,7 @@ DeleteObject(HGDIOBJ hObject) { /* From Wine: DeleteObject does not SetLastError() on a null object */ if(!hObject) return FALSE; - + if (0 != ((DWORD) hObject & GDI_HANDLE_STOCK_MASK)) { DPRINT1("Trying to delete system object 0x%x\n", hObject); @@ -327,24 +327,24 @@ GetDCObject( HDC hDC, INT iType) { HGDIOBJ hGO = NULL; PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return NULL; switch (iType) { case GDI_OBJECT_TYPE_BRUSH: - hGO = Dc_Attr->hbrush; + hGO = Dc_Attr->hbrush; break; - + case GDI_OBJECT_TYPE_EXTPEN: case GDI_OBJECT_TYPE_PEN: hGO = Dc_Attr->hpen; break; - + case GDI_OBJECT_TYPE_COLORSPACE: hGO = Dc_Attr->hColorSpace; break; - } + } return hGO; } return NtGdiGetDCObject( hDC, iType ); @@ -355,7 +355,7 @@ GetDCObject( HDC hDC, INT iType) * @implemented * */ -HGDIOBJ +HGDIOBJ STDCALL GetCurrentObject(HDC hdc, UINT uObjectType) @@ -428,7 +428,7 @@ DWORD STDCALL GetAndSetDCDWord( HDC hDC, INT u, DWORD dwIn, DWORD Unk1, DWORD Unk2, DWORD Unk3 ) { - BOOL Ret = TRUE; + BOOL Ret = TRUE; // Handle something other than a normal dc object. if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -451,10 +451,10 @@ GetAndSetDCDWord( HDC hDC, INT u, DWORD dwIn, DWORD Unk1, DWORD Unk2, DWORD Unk3 } } } - Ret = NtGdiGetAndSetDCDword( hDC, u, dwIn, (DWORD*) &u ); - if (Ret) + Ret = NtGdiGetAndSetDCDword( hDC, u, dwIn, (DWORD*) &u ); + if (Ret) return u; - else + else SetLastError(ERROR_INVALID_HANDLE); return 0; } @@ -518,7 +518,7 @@ GetDCOrg( } -int +int GetNonFontObject(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) { INT dwType; @@ -556,7 +556,7 @@ GetNonFontObject(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) case GDI_OBJECT_TYPE_REGION: case GDI_OBJECT_TYPE_METAFILE: case GDI_OBJECT_TYPE_ENHMETAFILE: - case GDI_OBJECT_TYPE_EMF: + case GDI_OBJECT_TYPE_EMF: SetLastError(ERROR_INVALID_HANDLE); } return 0; @@ -566,8 +566,8 @@ GetNonFontObject(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) /* * @implemented */ -int -STDCALL +int +STDCALL GetObjectA(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) { ENUMLOGFONTEXDVW LogFont; @@ -580,7 +580,7 @@ GetObjectA(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) { SetLastError(ERROR_NOT_SUPPORTED); return 0; - } + } if (dwType == GDI_OBJECT_TYPE_FONT) { @@ -601,7 +601,7 @@ GetObjectA(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) { return 0; } - + switch (cbSize) { case sizeof(ENUMLOGFONTEXDVA): @@ -609,7 +609,7 @@ GetObjectA(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) case sizeof(ENUMLOGFONTEXA): EnumLogFontExW2A( (LPENUMLOGFONTEXA) lpBuffer, &LogFont.elfEnumLogfontEx ); break; - + case sizeof(ENUMLOGFONTA): // Same here, maybe? Check the structures. case sizeof(EXTLOGFONTA): @@ -620,7 +620,7 @@ GetObjectA(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) default: SetLastError(ERROR_BUFFER_OVERFLOW); - return 0; + return 0; } return cbSize; } @@ -632,8 +632,8 @@ GetObjectA(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) /* * @implemented */ -int -STDCALL +int +STDCALL GetObjectW(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) { DWORD dwType = GDI_HANDLE_GET_TYPE(hGdiObj); @@ -683,7 +683,7 @@ GetObjectW(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) /* * @implemented */ -COLORREF +COLORREF STDCALL GetDCBrushColor( HDC hdc @@ -691,7 +691,7 @@ GetDCBrushColor( { //#if 0 PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return CLR_INVALID; return (COLORREF) Dc_Attr->ulPenClr; //#endif @@ -701,7 +701,7 @@ GetDCBrushColor( /* * @implemented */ -COLORREF +COLORREF STDCALL GetDCPenColor( HDC hdc @@ -709,7 +709,7 @@ GetDCPenColor( { //#if 0 PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return CLR_INVALID; return (COLORREF) Dc_Attr->ulPenClr; //#endif @@ -719,7 +719,7 @@ GetDCPenColor( /* * @implemented */ -COLORREF +COLORREF STDCALL SetDCBrushColor( HDC hdc, @@ -750,7 +750,7 @@ SetDCBrushColor( /* * @implemented */ -COLORREF +COLORREF STDCALL SetDCPenColor( HDC hdc, @@ -781,7 +781,7 @@ SetDCPenColor( /* * @implemented */ -COLORREF +COLORREF STDCALL SetTextColor( HDC hdc, @@ -829,7 +829,7 @@ SetTextColor( /* * @implemented */ -COLORREF +COLORREF STDCALL SetBkColor( HDC hdc, @@ -912,8 +912,8 @@ ResetDCA( /* * @implemented */ -int -STDCALL +int +STDCALL StartDocW( HDC hdc, CONST DOCINFOW *a1 @@ -933,7 +933,7 @@ GetObjectType( ) { DWORD Ret = 0; - + if(GdiIsHandleValid(h)) { LONG Type = GDI_HANDLE_GET_TYPE(h); @@ -976,7 +976,7 @@ GetObjectType( break; case GDI_OBJECT_TYPE_METADC: Ret = OBJ_METADC; - break; + break; case GDI_OBJECT_TYPE_EXTPEN: Ret = OBJ_EXTPEN; break; @@ -1015,7 +1015,7 @@ GetStockObject( return Obj; }// Returns Null anyway. } - return Ret; + return Ret; } @@ -1028,7 +1028,7 @@ GetViewportExtEx( { #if 0 PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; if ( Dc_Attr->flXform & PAGE_EXTENTS_CHANGED ) // Something was updated, go to kernel. @@ -1054,7 +1054,7 @@ GetViewportOrgEx( { #if 0 PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; lpPoint->x = Dc_Attr->ptlViewportOrg.x; lpPoint->x = Dc_Attr->ptlViewportOrg.x; @@ -1074,7 +1074,7 @@ GetWindowExtEx( { #if 0 PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; lpSize->cx = Dc_Attr->szlWindowExt.cx; lpSize->cy = Dc_Attr->szlWindowExt.cy; @@ -1094,7 +1094,7 @@ GetWindowOrgEx( { #if 0 PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; lpPoint->x = Dc_Attr->ptlWindowOrg.x; lpPoint->x = Dc_Attr->ptlWindowOrg.x; diff --git a/reactos/dll/win32/gdi32/objects/eng.c b/reactos/dll/win32/gdi32/objects/eng.c index 04be69881c6..cd1e091b818 100644 --- a/reactos/dll/win32/gdi32/objects/eng.c +++ b/reactos/dll/win32/gdi32/objects/eng.c @@ -23,7 +23,7 @@ EngAcquireSemaphore ( IN HSEMAPHORE hsem ) /* * @unimplemented */ -BOOL +BOOL copy_my_glyphset( FD_GLYPHSET *dst_glyphset , FD_GLYPHSET * src_glyphset, ULONG Size) { BOOL retValue = FALSE; @@ -128,7 +128,7 @@ EngFindResource(HANDLE h, /* * @implemented */ -VOID STDCALL +VOID STDCALL EngFreeModule(HANDLE h) { FreeLibrary(h); @@ -159,7 +159,7 @@ EngGetPrinterDataFileName(HDEV hdev) /* * @implemented */ -HANDLE STDCALL +HANDLE STDCALL EngLoadModule(LPWSTR pwsz) { return LoadLibraryExW ( pwsz, NULL, LOAD_LIBRARY_AS_DATAFILE); @@ -168,7 +168,7 @@ EngLoadModule(LPWSTR pwsz) /* * @implemented */ -INT STDCALL +INT STDCALL EngMultiByteToWideChar(UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, @@ -181,7 +181,7 @@ EngMultiByteToWideChar(UINT CodePage, /* * @implemented */ -VOID STDCALL +VOID STDCALL EngQueryLocalTime(PENG_TIME_FIELDS etf) { SYSTEMTIME SystemTime; @@ -213,7 +213,7 @@ EngReleaseSemaphore ( IN HSEMAPHORE hsem ) * @implemented */ INT -STDCALL +STDCALL EngWideCharToMultiByte( UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, diff --git a/reactos/dll/win32/gdi32/objects/enhmfile.c b/reactos/dll/win32/gdi32/objects/enhmfile.c index faac004ec0f..73aad3b38d7 100644 --- a/reactos/dll/win32/gdi32/objects/enhmfile.c +++ b/reactos/dll/win32/gdi32/objects/enhmfile.c @@ -7,7 +7,7 @@ HENHMETAFILE STDCALL CloseEnhMetaFile( HDC hdc) -{ +{ return NtGdiCloseEnhMetaFile(hdc); } @@ -38,7 +38,7 @@ HDC WINAPI CreateEnhMetaFileW( } pLDC = LocalAlloc(LMEM_ZEROINIT, sizeof(LDC)); - + Dc_Attr->pvLDC = pLDC; pLDC->hDC = mDC; pLDC->iType = LDC_EMFDC @@ -77,10 +77,10 @@ HDC WINAPI CreateEnhMetaFileW( EmfDC->emf->iType = EMR_HEADER; EmfDC->emf->nSize = size; - + EmfDC->emf->rclBounds.left = EmfDC->emf->rclBounds.top = 0; EmfDC->emf->rclBounds.right = EmfDC->emf->rclBounds.bottom = -1; - + if(rect) { EmfDC->emf->rclFrame.left = rect->left; @@ -99,26 +99,26 @@ HDC WINAPI CreateEnhMetaFileW( EmfDC->emf->nBytes = pLDC->pvEmfDC->nSize; EmfDC->emf->nRecords = 1; EmfDC->emf->nHandles = 1; - + EmfDC->emf->sReserved = 0; /* According to docs, this is reserved and must be 0 */ EmfDC->emf->nDescription = length / 2; - + EmfDC->emf->offDescription = length ? sizeof(ENHMETAHEADER) : 0; - + EmfDC->emf->nPalEntries = 0; /* I guess this should start at 0 */ - + /* Size in pixels */ EmfDC->emf->szlDevice.cx = EmfDC->horzres; EmfDC->emf->szlDevice.cy = EmfDC->vertres; - + /* Size in millimeters */ EmfDC->emf->szlMillimeters.cx = EmfDC->horzsize; EmfDC->emf->szlMillimeters.cy = EmfDC->vertsize; - + /* Size in micrometers */ EmfDC->emf->szlMicrometers.cx = EmfDC->horzsize * 1000; EmfDC->emf->szlMicrometers.cy = EmfDC->vertsize * 1000; - + RtlCopyMemory((char *)EmfDC->emf + sizeof(ENHMETAHEADER), description, length); if (filename) /* disk based metafile */ @@ -147,8 +147,8 @@ HDC WINAPI CreateEnhMetaFileW( /* * @implemented */ -HENHMETAFILE -STDCALL +HENHMETAFILE +STDCALL CopyEnhMetaFileW( HENHMETAFILE hemfSrc, LPCWSTR lpszFile @@ -226,7 +226,7 @@ CreateEnhMetaFileA( return rc; } - + lpDescriptionW = NULL; if (lpDescription != NULL) { @@ -236,12 +236,12 @@ CreateEnhMetaFileA( return rc; } - + rc = NtGdiCreateEnhMetaFile (hdcRef, lpFileNameW, (CONST LPRECT)lpRect, lpDescriptionW ); if (lpDescriptionW != NULL) HEAP_free ( lpDescriptionW ); - + if (lpFileNameW != NULL) HEAP_free ( lpFileNameW ); diff --git a/reactos/dll/win32/gdi32/objects/font.c b/reactos/dll/win32/gdi32/objects/font.c index 1da9a9b2068..678183872c0 100644 --- a/reactos/dll/win32/gdi32/objects/font.c +++ b/reactos/dll/win32/gdi32/objects/font.c @@ -3,7 +3,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * FILE: lib/gdi32/object/font.c - * PURPOSE: + * PURPOSE: * PROGRAMMER: * */ @@ -517,13 +517,13 @@ GetCharacterPlacementW( if (lpResults->lpCaretPos && !(dwFlags & GCP_REORDER)) { int pos = 0; - + lpResults->lpCaretPos[0] = 0; for (i = 1; i < nSet; i++) if (GetTextExtentPoint32W(hdc, &(lpString[i - 1]), 1, &size)) lpResults->lpCaretPos[i] = (pos += size.cx); } - + /*if(lpResults->lpGlyphs) GetGlyphIndicesW(hdc, lpString, nSet, lpResults->lpGlyphs, 0);*/ @@ -851,7 +851,7 @@ HFONT STDCALL CreateFontIndirectExW(const ENUMLOGFONTEXDVW *elfexd) { - /* Msdn: Note, this function ignores the elfDesignVector member in + /* Msdn: Note, this function ignores the elfDesignVector member in ENUMLOGFONTEXDV. */ if ( elfexd ) @@ -904,7 +904,7 @@ CreateFontIndirectW( sizeof(Logfont.elfEnumLogfontEx.elfStyle)); RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfScript, sizeof(Logfont.elfEnumLogfontEx.elfScript)); - + RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR)); return CreateFontIndirectExW(&Logfont); @@ -942,7 +942,7 @@ CreateFontA( RtlInitAnsiString(&StringA, (LPSTR)lpszFace); RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); - ret = CreateFontW(nHeight, + ret = CreateFontW(nHeight, nWidth, nEscapement, nOrientation, diff --git a/reactos/dll/win32/gdi32/objects/linedda.c b/reactos/dll/win32/gdi32/objects/linedda.c index 94cafbcad04..564e8864c2e 100644 --- a/reactos/dll/win32/gdi32/objects/linedda.c +++ b/reactos/dll/win32/gdi32/objects/linedda.c @@ -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 */ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS GDI32 * PURPOSE: LineDDA Function @@ -43,7 +43,7 @@ BOOL STDCALL LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd, INT cnt; INT dx = nXEnd - nXStart; INT dy = nYEnd - nYStart; - + // optimized for vertical and horizontal lines so we avoid unnecessary math if(nXStart == nXEnd) { @@ -59,10 +59,10 @@ BOOL STDCALL LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd, for(cnt = dx; cnt <= dy; cnt++) { lpLineFunc(nXStart,cnt,lpData); - } + } return TRUE; } - + if(nYStart == nYEnd) { // horizontal line - use dx,dy as temp variables so we don't waste stack space diff --git a/reactos/dll/win32/gdi32/objects/metafile.c b/reactos/dll/win32/gdi32/objects/metafile.c index a0360cf6fa2..c4df6e64830 100644 --- a/reactos/dll/win32/gdi32/objects/metafile.c +++ b/reactos/dll/win32/gdi32/objects/metafile.c @@ -11,17 +11,17 @@ DWORD hMFCount = 0; /* INTERNAL FUNCTIONS ********************************************************/ BOOL -MF_CreateMFDC ( HGDIOBJ hMDC, +MF_CreateMFDC ( HGDIOBJ hMDC, PMETAFILEDC pmfDC ) { PMF_ENTRY pMFME; - + pMFME = LocalAlloc(LMEM_ZEROINIT, sizeof(MF_ENTRY)); if (!pMFME) { return FALSE; } - + if (hMF_List == NULL) { hMF_List = pMFME; @@ -32,7 +32,7 @@ MF_CreateMFDC ( HGDIOBJ hMDC, pMFME->hmDC = hMDC; pMFME->pmfDC = pmfDC; - + hMFCount++; return TRUE; } @@ -145,7 +145,7 @@ CreateMetaFileW( HDC hmDC; PMETAFILEDC pmfDC = LocalAlloc(LMEM_ZEROINIT, sizeof(METAFILEDC)); if (!pmfDC) return NULL; - + pmfDC->mh.mtHeaderSize = sizeof(METAHEADER) / sizeof(WORD); pmfDC->mh.mtVersion = 0x0300; pmfDC->mh.mtSize = pmfDC->mh.mtHeaderSize; @@ -175,7 +175,7 @@ CreateMetaFileW( // MFDRV_DeleteDC( dc->physDev ); return NULL; } - pmfDC->hFile = hFile; + pmfDC->hFile = hFile; } else /* memory based metafile */ pmfDC->mh.mtType = METAFILE_MEMORY; diff --git a/reactos/dll/win32/gdi32/objects/painting.c b/reactos/dll/win32/gdi32/objects/painting.c index 96e727c9fe1..607cb57cd64 100644 --- a/reactos/dll/win32/gdi32/objects/painting.c +++ b/reactos/dll/win32/gdi32/objects/painting.c @@ -40,9 +40,9 @@ STDCALL MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point ) { PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE; - + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) @@ -79,7 +79,7 @@ MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point ) Dc_Attr->ptlCurrent.x = x; Dc_Attr->ptlCurrent.y = y; - + Dc_Attr->ulDirty_ |= ( DIRTY_PTLCURRENT|DIRTY_STYLESTATE); // Set dirty return TRUE; } @@ -156,7 +156,7 @@ Rectangle(HDC hDC, INT Left, INT Top, INT Right, INT Bottom) */ BOOL STDCALL -RoundRect(HDC hDC, INT Left, INT Top, INT Right, INT Bottom, +RoundRect(HDC hDC, INT Left, INT Top, INT Right, INT Bottom, INT ell_Width, INT ell_Height) { #if 0 @@ -176,7 +176,7 @@ RoundRect(HDC hDC, INT Left, INT Top, INT Right, INT Bottom, } if (pLDC->iType == LDC_EMFLDC) { - return EMFDRV_RoundRect( hDC, Left, Top, Right, Bottom, + return EMFDRV_RoundRect( hDC, Left, Top, Right, Bottom, ell_Width, ell_Height ); } return FALSE; @@ -256,7 +256,7 @@ FillRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush ) { if ( (!hRgn) || (!hBrush) ) return FALSE; -#if 0 +#if 0 // Handle something other than a normal dc object. if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -291,7 +291,7 @@ FrameRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush, INT nWidth, INT nHeight ) { if ( (!hRgn) || (!hBrush) ) return FALSE; -#if 0 +#if 0 // Handle something other than a normal dc object. if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { @@ -326,14 +326,14 @@ InvertRgn( HDC hDC, HRGN hRgn ) { if ( !hRgn ) return FALSE; -#if 0 +#if 0 // Handle something other than a normal dc object. if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) { if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) return MFDRV_InvertRgn( hDC, HRGN hRgn ); // Use this instead of MFDRV_MetaParam. else - { + { PLDC pLDC = GdiGetLDC(hDC); if ( !pLDC ) { @@ -423,7 +423,7 @@ PolyBezier(HDC hDC ,const POINT* Point, DWORD cPoints) #endif return NtGdiPolyPolyDraw( hDC ,(PPOINT) Point, &cPoints, 1, GdiPolyBezier ); } - + /* * @implemented @@ -472,7 +472,7 @@ PolyDraw(HDC hDC, const POINT* Point, const BYTE *lpbTypes, int cCount ) if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) return FALSE; else - { + { PLDC pLDC = GdiGetLDC(hDC); if ( !pLDC ) { @@ -586,7 +586,7 @@ PolylineTo(HDC hDC, const POINT* Point, DWORD Count) } } #endif - return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, &Count, 1, GdiPolyLineTo ); + return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, &Count, 1, GdiPolyLineTo ); } @@ -663,7 +663,7 @@ BOOL STDCALL ExtFloodFill( HDC hDC, - int nXStart, + int nXStart, int nYStart, COLORREF crFill, UINT fuFillType diff --git a/reactos/dll/win32/gdi32/objects/palette.c b/reactos/dll/win32/gdi32/objects/palette.c index 2c62a4092a0..f370ec0d5ea 100644 --- a/reactos/dll/win32/gdi32/objects/palette.c +++ b/reactos/dll/win32/gdi32/objects/palette.c @@ -66,32 +66,32 @@ GetDIBColorTable(HDC hDC, /* * @implemented */ -UINT -WINAPI +UINT +WINAPI RealizePalette(HDC hDC) /* [in] Handle of device context */ { -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_(hDC); - else - { - HPALETTE Pal = GetDCObject(hDC, GDI_OBJECT_TYPE_PALETTE); - PLDC pLDC = GdiGetLDC((HDC) Pal); +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_(hDC); + else + { + HPALETTE Pal = GetDCObject(hDC, GDI_OBJECT_TYPE_PALETTE); + PLDC pLDC = GdiGetLDC((HDC) Pal); if ( !pLDC ) return FALSE; - if (pLDC->iType == LDC_EMFLDC) return EMFDRV_(Pal); - return FALSE; - } - } -#endif + if (pLDC->iType == LDC_EMFLDC) return EMFDRV_(Pal); + return FALSE; + } + } +#endif // return UserRealizePalette(hDC); //HACK!!!!! return NtGdiRealizePalette(hDC); } - + /* * @implemented diff --git a/reactos/dll/win32/gdi32/objects/region.c b/reactos/dll/win32/gdi32/objects/region.c index e8ee94e4757..650316f2ac8 100644 --- a/reactos/dll/win32/gdi32/objects/region.c +++ b/reactos/dll/win32/gdi32/objects/region.c @@ -29,7 +29,7 @@ GetClipRgn( HRGN -WINAPI +WINAPI CreatePolygonRgn( const POINT * lppt, int cPoints, int fnPolyFillMode) { return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn); @@ -57,8 +57,8 @@ CreateEllipticRgnIndirect( } -HRGN -WINAPI +HRGN +WINAPI CreateRectRgn(int x1, int y1, int x2,int y2) { /* FIXME Some part need be done in user mode */ diff --git a/reactos/dll/win32/gdi32/objects/text.c b/reactos/dll/win32/gdi32/objects/text.c index 052f2f75c81..631d0dcfe16 100644 --- a/reactos/dll/win32/gdi32/objects/text.c +++ b/reactos/dll/win32/gdi32/objects/text.c @@ -5,8 +5,8 @@ /* * @implemented */ -BOOL -STDCALL +BOOL +STDCALL TextOutA( HDC hdc, int nXStart, @@ -58,7 +58,7 @@ GetTextCharacterExtra( { #if 0 PDC_ATTR Dc_Attr; - + if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr)) return 0; return Dc_Attr->lTextExtra; #endif @@ -84,10 +84,10 @@ GetTextCharset(HDC hdc) /* * @implemented */ -BOOL -STDCALL +BOOL +STDCALL GetTextMetricsA( - HDC hdc, + HDC hdc, LPTEXTMETRICA lptm ) { @@ -105,10 +105,10 @@ GetTextMetricsA( /* * @implemented */ -BOOL -STDCALL +BOOL +STDCALL GetTextMetricsW( - HDC hdc, + HDC hdc, LPTEXTMETRICW lptm ) { @@ -267,16 +267,16 @@ GetTextExtentPoint32W( /* * @implemented */ -BOOL -STDCALL +BOOL +STDCALL ExtTextOutA( - HDC hdc, - int X, - int Y, - UINT fuOptions, + HDC hdc, + int X, + int Y, + UINT fuOptions, CONST RECT *lprc, - LPCSTR lpString, - UINT cbCount, + LPCSTR lpString, + UINT cbCount, CONST INT *lpDx ) { @@ -298,16 +298,16 @@ ExtTextOutA( /* * @implemented */ -BOOL -STDCALL +BOOL +STDCALL ExtTextOutW( - HDC hdc, - int X, - int Y, - UINT fuOptions, + HDC hdc, + int X, + int Y, + UINT fuOptions, CONST RECT *lprc, - LPCWSTR lpString, - UINT cbCount, + LPCWSTR lpString, + UINT cbCount, CONST INT *lpDx ) { @@ -443,8 +443,8 @@ SetTextCharacterExtra( cExtra = Dc_Attr->lTextExtra; Dc_Attr->lTextExtra = CharExtra; return cExrta; -#endif -// Do this for now. +#endif +// Do this for now. return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 ); } diff --git a/reactos/dll/win32/gdi32/objects/utils.c b/reactos/dll/win32/gdi32/objects/utils.c index 057d52d320f..885cd9ddd5e 100644 --- a/reactos/dll/win32/gdi32/objects/utils.c +++ b/reactos/dll/win32/gdi32/objects/utils.c @@ -34,7 +34,7 @@ CalculateColorTableSize( /* * At first get some basic parameters from the passed BitmapInfoHeader - * structure. It can have one of the following formats: + * structure. It can have one of the following formats: * - BITMAPCOREHEADER (the oldest one with totally different layout * from the others) * - BITMAPINFOHEADER (the standard and most common header) @@ -74,7 +74,7 @@ CalculateColorTableSize( *ColorTableSize = 0; else *ColorTableSize = 3; - + return TRUE; case BI_RGB: @@ -100,7 +100,7 @@ CalculateColorTableSize( *ColorTableSize = ClrUsed; return TRUE; } - + case BI_RLE4: if (BitCount == 4) { @@ -123,7 +123,7 @@ CalculateColorTableSize( return TRUE; default: - return FALSE; + return FALSE; } } @@ -217,7 +217,7 @@ ConvertBitmapInfo( { DataSize = CoreBitmapInfo->bmciHeader.bcHeight * - CoreBitmapInfo->bmciHeader.bcWidth * + CoreBitmapInfo->bmciHeader.bcWidth * CoreBitmapInfo->bmciHeader.bcBitCount; DataSize = ((DataSize + 31) & ~31) / 8; DataSize *= CoreBitmapInfo->bmciHeader.bcPlanes; diff --git a/reactos/dll/win32/gdiplus/gdiplus/graphics.c b/reactos/dll/win32/gdiplus/gdiplus/graphics.c index 20efed3e8ca..ca98281e029 100644 --- a/reactos/dll/win32/gdiplus/gdiplus/graphics.c +++ b/reactos/dll/win32/gdiplus/gdiplus/graphics.c @@ -359,5 +359,5 @@ GdiplusNotificationHook(OUT ULONG_PTR *token) */ VOID WINGDIPAPI GdiplusNotificationUnhook(ULONG_PTR token) -{ +{ } diff --git a/reactos/dll/win32/gdiplus/gdiplus/path.c b/reactos/dll/win32/gdiplus/gdiplus/path.c index 72423dba815..1201763ebb3 100644 --- a/reactos/dll/win32/gdiplus/gdiplus/path.c +++ b/reactos/dll/win32/gdiplus/gdiplus/path.c @@ -6,7 +6,7 @@ /* * @unimplemented */ -GpStatus WINGDIPAPI +GpStatus WINGDIPAPI GdipCreatePath( GpFillMode brushMode,GpPath **path) { return NotImplemented; diff --git a/reactos/dll/win32/glu32/libnurbs/interface/bezierEval.h b/reactos/dll/win32/glu32/libnurbs/interface/bezierEval.h index 2a0fb4680d9..5d70b70139a 100644 --- a/reactos/dll/win32/glu32/libnurbs/interface/bezierEval.h +++ b/reactos/dll/win32/glu32/libnurbs/interface/bezierEval.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/interface/bezierPatch.h b/reactos/dll/win32/glu32/libnurbs/interface/bezierPatch.h index 83655743399..4f6629ed938 100644 --- a/reactos/dll/win32/glu32/libnurbs/interface/bezierPatch.h +++ b/reactos/dll/win32/glu32/libnurbs/interface/bezierPatch.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -43,7 +43,7 @@ typedef struct bezierPatch{ float umin, vmin, umax, vmax; int uorder; /*order= degree + 1*/ - int vorder; + int vorder; /* *the control points are stored in a one dimensional array. @@ -52,13 +52,13 @@ typedef struct bezierPatch{ *where P(i,j) are the control points, B_i(.) are Bezier *basis functions. *Each control point can have dimension 3 or 4: (x,y,z,w). - *The components of P(i,j) are stored in a one dimensional - *array: + *The components of P(i,j) are stored in a one dimensional + *array: * ctlpoints[] *in the order of: * P[0,0], P[0,1], ..., P[0,vorder-1], * P[1,0], P[1,1], ..., P[1,vorder-1], - * ... + * ... * P[uorder-1,0], P[uorder-1,1], ..., P[uorder-1,vorder-1]. */ int dimension; @@ -67,7 +67,7 @@ typedef struct bezierPatch{ /* *in case we have to manage multiple bezierPatches. */ - struct bezierPatch *next; + struct bezierPatch *next; } bezierPatch; diff --git a/reactos/dll/win32/glu32/libnurbs/interface/bezierPatchMesh.h b/reactos/dll/win32/glu32/libnurbs/interface/bezierPatchMesh.h index 1231de1393a..fe86148db5a 100644 --- a/reactos/dll/win32/glu32/libnurbs/interface/bezierPatchMesh.h +++ b/reactos/dll/win32/glu32/libnurbs/interface/bezierPatchMesh.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -44,7 +44,7 @@ typedef struct bezierPatchMesh{ bezierPatch *bpatch; /*vertex*/ - bezierPatch *bpatch_normal; + bezierPatch *bpatch_normal; bezierPatch *bpatch_texcoord; /*s,t,r,q*/ bezierPatch *bpatch_color; /*RGBA*/ @@ -57,10 +57,10 @@ typedef struct bezierPatchMesh{ int index_UVarray; int size_length_array; int index_length_array; - + int counter; /*track the current strip size*/ GLenum type; /*track the current type: 0: GL_TRIANGLES, 1: GL_TRIANGLE_STRIP*/ - + /*we eventually want to evaluate from (u,v) to (x,y,z) and draw them*/ float *vertex_array; /*each vertex contains three components*/ float *normal_array; /*each normal contains three components*/ @@ -108,7 +108,7 @@ void bezierPatchMeshDelDeg(bezierPatchMesh* bpm); void bezierPatchMeshEval(bezierPatchMesh* bpm); - + void bezierPatchMeshDraw(bezierPatchMesh* bpm); void bezierPatchMeshListDraw(bezierPatchMesh* list); diff --git a/reactos/dll/win32/glu32/libnurbs/interface/glcurveval.h b/reactos/dll/win32/glu32/libnurbs/interface/glcurveval.h index 4b44f6e847e..247643ed27d 100644 --- a/reactos/dll/win32/glu32/libnurbs/interface/glcurveval.h +++ b/reactos/dll/win32/glu32/libnurbs/interface/glcurveval.h @@ -51,9 +51,9 @@ class CurveMap; #ifndef IN_MAX_BEZIER_ORDER #define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ #endif - + #ifndef IN_MAX_DIMENSION -#define IN_MAX_DIMENSION 4 +#define IN_MAX_DIMENSION 4 #endif typedef struct curveEvalMachine{ @@ -67,7 +67,7 @@ typedef struct curveEvalMachine{ REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values } curveEvalMachine; -class OpenGLCurveEvaluator : public BasicCurveEvaluator { +class OpenGLCurveEvaluator : public BasicCurveEvaluator { public: OpenGLCurveEvaluator(void); virtual ~OpenGLCurveEvaluator(void); diff --git a/reactos/dll/win32/glu32/libnurbs/interface/glrenderer.h b/reactos/dll/win32/glu32/libnurbs/interface/glrenderer.h index 0a28f478174..a80e368fb1c 100644 --- a/reactos/dll/win32/glu32/libnurbs/interface/glrenderer.h +++ b/reactos/dll/win32/glu32/libnurbs/interface/glrenderer.h @@ -53,7 +53,7 @@ class GLUnurbs : public NurbsTessellator { public: GLUnurbs( void ); void loadGLMatrices( void ); - void useGLMatrices( const GLfloat modelMatrix[16], + void useGLMatrices( const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4] ); void setSamplingMatrixIdentity( void ); @@ -62,16 +62,16 @@ public: void bgnrender( void ); void endrender( void ); void setautoloadmode( INREAL value ) - { - - if (value) autoloadmode = GL_TRUE; - else autoloadmode = GL_FALSE; - + { + + if (value) autoloadmode = GL_TRUE; + else autoloadmode = GL_FALSE; + } GLboolean getautoloadmode( void ) { return autoloadmode; } void (APIENTRY *errorCallback)( GLenum ); - void postError( int which ) + void postError( int which ) { if (errorCallback) (errorCallback)( (GLenum)which ); } #ifdef _WIN32 void putSurfCallBack(GLenum which, void (GLAPIENTRY *fn)() ) @@ -87,7 +87,7 @@ public: { return surfaceEvaluator.get_vertices_call_back(); } - + void put_vertices_call_back(int flag) { surfaceEvaluator.put_vertices_call_back(flag); @@ -97,7 +97,7 @@ public: { return surfaceEvaluator.get_callback_auto_normal(); } - + void put_callback_auto_normal(int flag) { surfaceEvaluator.put_callback_auto_normal(flag); @@ -133,11 +133,11 @@ private: OpenGLSurfaceEvaluator surfaceEvaluator; OpenGLCurveEvaluator curveEvaluator; - void loadSamplingMatrix( const GLfloat vmat[4][4], + void loadSamplingMatrix( const GLfloat vmat[4][4], const GLint viewport[4] ); void loadCullingMatrix( GLfloat vmat[4][4] ); static void grabGLMatrix( GLfloat vmat[4][4] ); - static void transform4d( GLfloat A[4], GLfloat B[4], + static void transform4d( GLfloat A[4], GLfloat B[4], GLfloat mat[4][4] ); static void multmatrix4d( GLfloat n[4][4], const GLfloat left[4][4], const GLfloat right[4][4] ); diff --git a/reactos/dll/win32/glu32/libnurbs/interface/glsurfeval.h b/reactos/dll/win32/glu32/libnurbs/interface/glsurfeval.h index c34a58cb9b9..5fb34411b7b 100644 --- a/reactos/dll/win32/glu32/libnurbs/interface/glsurfeval.h +++ b/reactos/dll/win32/glu32/libnurbs/interface/glsurfeval.h @@ -59,9 +59,9 @@ class StoredVertex; #ifndef IN_MAX_BEZIER_ORDER #define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/ #endif - + #ifndef IN_MAX_DIMENSION -#define IN_MAX_DIMENSION 4 +#define IN_MAX_DIMENSION 4 #endif typedef struct surfEvalMachine{ @@ -82,14 +82,14 @@ typedef struct surfEvalMachine{ REAL ucoeffDeriv[IN_MAX_BEZIER_ORDER]; /*cache the polynomial derivatives*/ REAL vcoeffDeriv[IN_MAX_BEZIER_ORDER]; } surfEvalMachine; - - + + class StoredVertex { public: StoredVertex() { type = 0; } ~StoredVertex(void) {} - void saveEvalCoord(REAL x, REAL y) + void saveEvalCoord(REAL x, REAL y) {coord[0] = x; coord[1] = y; type = TYPECOORD; } void saveEvalPoint(long x, long y) {point[0] = x; point[1] = y; type = TYPEPOINT; } @@ -113,7 +113,7 @@ public: void enable( long ); void disable( long ); void bgnmap2f( long ); - void map2f( long, REAL, REAL, long, long, + void map2f( long, REAL, REAL, long, long, REAL, REAL, long, long, REAL * ); void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); void mapmesh2f( long, long, long, long, long ); @@ -162,7 +162,7 @@ public: void put_callback_auto_normal(int flag) { callback_auto_normal = flag; - } + } int get_callback_auto_normal() { @@ -179,7 +179,7 @@ public: - + private: StoredVertex *vertexCache[VERTEX_CACHE_SIZE]; int tmeshing; @@ -222,14 +222,14 @@ private: void LOD_triangle(REAL A[2], REAL B[2], REAL C[2], int level); void LOD_eval(int num_vert, REAL* verts, int type, int level); - + int LOD_eval_level; //set by LOD_eval_list() /*************begin for internal evaluators*****************/ - - /*the following global variables are only defined in this file. + + /*the following global variables are only defined in this file. *They are used to cache the precomputed Bezier polynomial values. - *These calues may be used consecutively in which case we don't have + *These calues may be used consecutively in which case we don't have *recompute these values again. */ int global_uorder; /*store the uorder in the previous evaluation*/ @@ -273,9 +273,9 @@ private: int global_grid_nv; /*functions*/ - void inDoDomain2WithDerivs(int k, REAL u, REAL v, - REAL u1, REAL u2, int uorder, - REAL v1, REAL v2, int vorder, + void inDoDomain2WithDerivs(int k, REAL u, REAL v, + REAL u1, REAL u2, int uorder, + REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv); void inPreEvaluate(int order, REAL vprime, REAL *coeff); @@ -297,20 +297,20 @@ private: int vorder, REAL *ctlPoints); - void inMapGrid2f(int nu, REAL u0, REAL u1, + void inMapGrid2f(int nu, REAL u0, REAL u1, int nv, REAL v0, REAL v1); void inEvalMesh2(int lowU, int lowV, int highU, int highV); void inEvalPoint2(int i, int j); void inEvalCoord2f(REAL u, REAL v); -void inEvalULine(int n_points, REAL v, REAL* u_vals, +void inEvalULine(int n_points, REAL v, REAL* u_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3]); -void inEvalVLine(int n_points, REAL u, REAL* v_vals, +void inEvalVLine(int n_points, REAL u, REAL* v_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3]); -void inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, +void inEvalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val ); void inEvalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val); @@ -324,7 +324,7 @@ void inPreEvaluateBV_intfac(REAL v ) void inPreEvaluateBU_intfac(REAL u) { - inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); + inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints); } void inDoDomain2WithDerivsBV(int k, REAL u, REAL v, @@ -375,9 +375,9 @@ void inMap2fEM(int which, //0:vert,1:norm,2:color,3:tex int vorder, REAL *ctlPoints); -void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, +void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint, REAL *retdu, REAL *retdv); -void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, +void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint); void inDoEvalCoord2EM(REAL u, REAL v); @@ -388,7 +388,7 @@ void inBPMListEvalEM(bezierPatchMesh* list); /*************end for internal evaluators*****************/ - + }; inline void StoredVertex::invoke(OpenGLSurfaceEvaluator *eval) diff --git a/reactos/dll/win32/glu32/libnurbs/internals/arc.h b/reactos/dll/win32/glu32/libnurbs/internals/arc.h index 1c2db8c474d..35b2878b5ec 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/arc.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/arc.h @@ -51,9 +51,9 @@ class Bin; class Arc; -struct BezierArc; +struct BezierArc; -typedef class Arc *Arc_ptr; +typedef class Arc *Arc_ptr; enum arc_side { arc_none = 0, arc_right, arc_top, arc_left, arc_bottom }; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/arcsorter.h b/reactos/dll/win32/glu32/libnurbs/internals/arcsorter.h index 7e5cd9d5556..7c7d7a42a41 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/arcsorter.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/arcsorter.h @@ -56,8 +56,8 @@ protected: virtual int qscmp( char *, char * ); Subdivider& subdivider; private: - void qsexc( char *i, char *j ); // i<-j, j<-i - void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i + void qsexc( char *i, char *j ); // i<-j, j<-i + void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i }; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/backend.h b/reactos/dll/win32/glu32/libnurbs/internals/backend.h index d79ca4789cf..d8af424065e 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/backend.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/backend.h @@ -63,8 +63,8 @@ public: void surfpts( long, REAL *, long, long, int, int, REAL, REAL, REAL, REAL ); void surfbbox( long, REAL *, REAL * ); - void surfgrid( REAL, REAL, long, REAL, REAL, long ); - void surfmesh( long, long, long, long ); + void surfgrid( REAL, REAL, long, REAL, REAL, long ); + void surfmesh( long, long, long, long ); void bgntmesh( char * ); void endtmesh( void ); void swaptmesh( void ); @@ -83,10 +83,10 @@ public: void endtfan(); void bgnqstrip(); void endqstrip(); - void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, + void evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, int n_lower, REAL v_lower, REAL* lower_val ); - void evalVStrip(int n_left, REAL u_left, REAL* left_val, + void evalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL v_right, REAL* right_val ); void tmeshvertNOGE(TrimVertex *t); @@ -94,7 +94,7 @@ public: void tmeshvertNOGE_BV(TrimVertex *t); void preEvaluateBU(REAL u); void preEvaluateBV(REAL v); - + /* curve backend routines */ void bgncurv( void ); @@ -102,7 +102,7 @@ public: void curvpts( long, REAL *, long, int, REAL, REAL ); void curvgrid( REAL, REAL, long ); void curvmesh( long, long ); - void curvpt( REAL ); + void curvpt( REAL ); void bgnline( void ); void endline( void ); void endcurv( void ); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/basicsurfeval.h b/reactos/dll/win32/glu32/libnurbs/internals/basicsurfeval.h index 611d623aee5..0396ff3669d 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/basicsurfeval.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/basicsurfeval.h @@ -54,8 +54,8 @@ public: virtual void enable( long ); virtual void disable( long ); virtual void bgnmap2f( long ); - virtual void map2f( long, REAL, REAL, long, long, - REAL, REAL, long, long, + virtual void map2f( long, REAL, REAL, long, long, + REAL, REAL, long, long, REAL * ); virtual void mapgrid2f( long, REAL, REAL, long, REAL, REAL ); virtual void mapmesh2f( long, long, long, long, long ); @@ -89,7 +89,7 @@ public: virtual void inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL* ret_point, REAL* ret_normal) = 0; virtual void inPreEvaluateBV_intfac(REAL v ) = 0; virtual void inPreEvaluateBU_intfac(REAL u ) = 0; - + }; #endif /* __glubasicsurfeval_h_ */ diff --git a/reactos/dll/win32/glu32/libnurbs/internals/bin.h b/reactos/dll/win32/glu32/libnurbs/internals/bin.h index d28be345473..77b59e99087 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/bin.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/bin.h @@ -46,7 +46,7 @@ #include "arc.h" #include "defines.h" -class Bin +class Bin { /* a linked list of jordan arcs */ private: Arc_ptr head;/*first arc on list */ diff --git a/reactos/dll/win32/glu32/libnurbs/internals/bufpool.h b/reactos/dll/win32/glu32/libnurbs/internals/bufpool.h index 463f347efd2..c9a54b4ba1b 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/bufpool.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/bufpool.h @@ -60,7 +60,7 @@ public: inline void* new_buffer( void ); inline void free_buffer( void * ); void clear( void ); - + private: void grow( void ); @@ -100,7 +100,7 @@ Pool::free_buffer( void *b ) *----------------------------------------------------------------------------- */ -inline void * +inline void * Pool::new_buffer( void ) { void *buffer; @@ -110,7 +110,7 @@ Pool::new_buffer( void ) /* find free buffer */ if( freelist ) { - buffer = (void *) freelist; + buffer = (void *) freelist; freelist = freelist->next; } else { if( ! nextfree ) @@ -120,7 +120,7 @@ Pool::new_buffer( void ) } return buffer; } - + class PooledObj { public: inline void * operator new( size_t, Pool & ); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/cachingeval.h b/reactos/dll/win32/glu32/libnurbs/internals/cachingeval.h index a9db41ea241..14c3caa602c 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/cachingeval.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/cachingeval.h @@ -49,7 +49,7 @@ public: virtual int canPlayAndRecord( void ); virtual int createHandle( int handle ); virtual void beginOutput( ServiceMode, int handle ); - virtual void endOutput( void ); + virtual void endOutput( void ); virtual void discardRecording( int handle ); virtual void playRecording( int handle ); }; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/curvelist.h b/reactos/dll/win32/glu32/libnurbs/internals/curvelist.h index bb1b229b45e..0d261783ec6 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/curvelist.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/curvelist.h @@ -49,7 +49,7 @@ class Mapdesc; class Quilt; class Curve; -class Curvelist +class Curvelist { friend class Subdivider; public: diff --git a/reactos/dll/win32/glu32/libnurbs/internals/dataTransform.h b/reactos/dll/win32/glu32/libnurbs/internals/dataTransform.h index d41a9894fef..2a4a72127ec 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/dataTransform.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/dataTransform.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/internals/defines.h b/reactos/dll/win32/glu32/libnurbs/internals/defines.h index 0476dee2ed2..2e4fd9b04a7 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/defines.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/defines.h @@ -47,7 +47,7 @@ #define CULL_TRIVIAL_ACCEPT 1 #define CULL_ACCEPT 2 -/* maximum order of a B-Spline */ +/* maximum order of a B-Spline */ #define MAXORDER 24 /* maximum dimension of any B-spline range space */ diff --git a/reactos/dll/win32/glu32/libnurbs/internals/displaylist.h b/reactos/dll/win32/glu32/libnurbs/internals/displaylist.h index 1a7b86912ee..f32de5f2c74 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/displaylist.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/displaylist.h @@ -60,7 +60,7 @@ struct Dlnode : public PooledObj { }; inline -Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) +Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) { work = _work; arg = _arg; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/displaymode.h b/reactos/dll/win32/glu32/libnurbs/internals/displaymode.h index 5718839a885..8815da25d42 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/displaymode.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/displaymode.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/internals/flistsorter.h b/reactos/dll/win32/glu32/libnurbs/internals/flistsorter.h index 3db15709004..36adb5c73b7 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/flistsorter.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/flistsorter.h @@ -50,9 +50,9 @@ public: FlistSorter(void); void qsort( REAL *a, int n ); -protected: +protected: virtual int qscmp( char *, char * ); - virtual void qsexc( char *i, char *j ); // i<-j, j<-i - virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i + virtual void qsexc( char *i, char *j ); // i<-j, j<-i + virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i }; #endif /* __gluflistsorter_h_ */ diff --git a/reactos/dll/win32/glu32/libnurbs/internals/gridtrimvertex.h b/reactos/dll/win32/glu32/libnurbs/internals/gridtrimvertex.h index 98a146f1c83..d263fd48c71 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/gridtrimvertex.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/gridtrimvertex.h @@ -56,7 +56,7 @@ public: GridTrimVertex() { g = 0; t = 0; } TrimVertex *t; GridVertex *g; - + inline void set( long, long ); inline void set( REAL, REAL ); inline void set( TrimVertex * ); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/hull.h b/reactos/dll/win32/glu32/libnurbs/internals/hull.h index acac3969fcb..9270325ae35 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/hull.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/hull.h @@ -64,7 +64,7 @@ private: Trimline *right; long index; }; - + Side lower; Side upper; Trimline fakeleft; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/jarcloc.h b/reactos/dll/win32/glu32/libnurbs/internals/jarcloc.h index c8ef40e1a9e..6ed06b5e7c5 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/jarcloc.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/jarcloc.h @@ -77,7 +77,7 @@ Jarcloc::getnextpt() } return p++; } - + inline TrimVertex * Jarcloc::getprevpt() { diff --git a/reactos/dll/win32/glu32/libnurbs/internals/knotvector.h b/reactos/dll/win32/glu32/libnurbs/internals/knotvector.h index b1d732908b6..eecefe41ebe 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/knotvector.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/knotvector.h @@ -60,7 +60,7 @@ struct Knotvector { /* a knot vector */ /* tolerance to test knot coincidence */ #define TOLERANCE 1.0e-5 -inline int +inline int identical( Knot x, Knot y ) { return ((x-y) < TOLERANCE) ? 1 : 0; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/mapdesc.h b/reactos/dll/win32/glu32/libnurbs/internals/mapdesc.h index 6c0d4f64c89..6bcaa4fbb37 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/mapdesc.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/mapdesc.h @@ -54,7 +54,7 @@ class Backend; class Mapdesc : public PooledObj { friend class Maplist; - + public: Mapdesc( long, int, int, Backend & ); int isProperty( long ); @@ -129,7 +129,7 @@ private: Maxmatrix smat; REAL s_steps; /* max samples in s direction */ REAL t_steps; /* max samples in t direction */ - REAL sampling_method; + REAL sampling_method; REAL culling_method; /* check for culling */ REAL bbox_subdividing; Mapdesc * next; @@ -194,62 +194,62 @@ Mapdesc::xformSampling( REAL *d, REAL *s ) xformNonrational( smat, d, s ); } -inline int +inline int Mapdesc::isRational( void ) { return isrational ? 1 : 0; } -inline int -Mapdesc::getNcoords( void ) +inline int +Mapdesc::getNcoords( void ) { - return ncoords; + return ncoords; } -inline int -Mapdesc::isConstantSampling( void ) +inline int +Mapdesc::isConstantSampling( void ) { - return ((sampling_method == N_FIXEDRATE) ? 1 : 0); + return ((sampling_method == N_FIXEDRATE) ? 1 : 0); } -inline int -Mapdesc::isDomainSampling( void ) -{ - return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0); +inline int +Mapdesc::isDomainSampling( void ) +{ + return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0); } -inline int -Mapdesc::isParametricDistanceSampling( void ) +inline int +Mapdesc::isParametricDistanceSampling( void ) { return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0); } -inline int -Mapdesc::isObjectSpaceParaSampling( void ) +inline int +Mapdesc::isObjectSpaceParaSampling( void ) { return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0); } -inline int -Mapdesc::isObjectSpacePathSampling( void ) +inline int +Mapdesc::isObjectSpacePathSampling( void ) { return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0); } -inline int -Mapdesc::isSurfaceAreaSampling( void ) +inline int +Mapdesc::isSurfaceAreaSampling( void ) { return ((sampling_method == N_SURFACEAREA) ? 1 : 0); } -inline int -Mapdesc::isPathLengthSampling( void ) +inline int +Mapdesc::isPathLengthSampling( void ) { return ((sampling_method == N_PATHLENGTH) ? 1 : 0); } -inline int -Mapdesc::isRangeSampling( void ) +inline int +Mapdesc::isRangeSampling( void ) { return ( isParametricDistanceSampling() || isPathLengthSampling() || isSurfaceAreaSampling() || @@ -263,14 +263,14 @@ Mapdesc::isSampling( void ) return isRangeSampling() || isConstantSampling() || isDomainSampling(); } -inline int -Mapdesc::isCulling( void ) +inline int +Mapdesc::isCulling( void ) { return ((culling_method != N_NOCULLING) ? 1 : 0); } -inline int -Mapdesc::isBboxSubdividing( void ) +inline int +Mapdesc::isBboxSubdividing( void ) { return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0); } diff --git a/reactos/dll/win32/glu32/libnurbs/internals/maplist.h b/reactos/dll/win32/glu32/libnurbs/internals/maplist.h index b46f27bf332..3b873cbaf3b 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/maplist.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/maplist.h @@ -77,7 +77,7 @@ Maplist::isMap( long type ) return (locate( type ) ? 1 : 0); } -inline void +inline void Maplist::undefine( long type ) { Mapdesc *m = locate( type ); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/monotonizer.h b/reactos/dll/win32/glu32/libnurbs/internals/monotonizer.h index 703479e9c3d..cb4b8a6a085 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/monotonizer.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/monotonizer.h @@ -40,7 +40,7 @@ class Monotonizer { void monotonize( Arc *, Bin & ); int isMonotone( Arc * ); public: - Monotonizer( ArcTessellator& at, Pool& ap, Pool& p, jmp_buf& j ) + Monotonizer( ArcTessellator& at, Pool& ap, Pool& p, jmp_buf& j ) : arctessellator(at), arcpool(ap), pwlarcpool(p), nurbsJmpBuf(j) {} int decompose( Bin &, REAL ); }; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/mymath.h b/reactos/dll/win32/glu32/libnurbs/internals/mymath.h index 73078251dda..9154d7d4f52 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/mymath.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/mymath.h @@ -47,7 +47,7 @@ #if defined(GLBUILD) || defined(STANDALONE) #define M_SQRT2 1.41421356237309504880 #define ceilf myceilf -#define floorf myfloorf +#define floorf myfloorf #define sqrtf sqrt extern "C" double sqrt(double); extern "C" float ceilf(float); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/mysetjmp.h b/reactos/dll/win32/glu32/libnurbs/internals/mysetjmp.h index bfb9cea98ba..f54297a8ca1 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/mysetjmp.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/mysetjmp.h @@ -74,7 +74,7 @@ deleteJumpbuffer(JumpBuffer *jb) } inline void -mylongjmp( JumpBuffer *j, int code ) +mylongjmp( JumpBuffer *j, int code ) { ::longjmp( j->buf, code ); } diff --git a/reactos/dll/win32/glu32/libnurbs/internals/nurbsconsts.h b/reactos/dll/win32/glu32/libnurbs/internals/nurbsconsts.h index 866a0e9018e..e0c87b44b6f 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/nurbsconsts.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/nurbsconsts.h @@ -42,7 +42,7 @@ #ifndef __glunurbsconsts_h_ #define __glunurbsconsts_h_ -/* NURBS Properties - one set per map, +/* NURBS Properties - one set per map, each takes a single INREAL arg */ #define N_SAMPLING_TOLERANCE 1 #define N_S_RATE 6 @@ -52,7 +52,7 @@ #define N_MINSAVINGS 14 #define N_NOSAVINGSSUBDIVISION 0.0 -/* NURBS Properties - one set per map, +/* NURBS Properties - one set per map, each takes an enumerated value */ #define N_CULLING 2 #define N_NOCULLING 0.0 @@ -74,7 +74,7 @@ /* NURBS Rendering Properties - one set per renderer each takes an enumerated value */ #define N_DISPLAY 3 -#define N_FILL 1.0 +#define N_FILL 1.0 #define N_OUTLINE_POLY 2.0 #define N_OUTLINE_TRI 3.0 #define N_OUTLINE_QUAD 4.0 @@ -119,8 +119,8 @@ /* type argument for trimming curves */ #ifndef N_P2D -#define N_P2D 0x8 +#define N_P2D 0x8 #define N_P2DR 0xd -#endif +#endif #endif /* __glunurbsconsts_h_ */ diff --git a/reactos/dll/win32/glu32/libnurbs/internals/nurbstess.h b/reactos/dll/win32/glu32/libnurbs/internals/nurbstess.h index 3577088a9c2..d1b250ba214 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/nurbstess.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/nurbstess.h @@ -102,7 +102,7 @@ public: void set_domain_distance_u_rate(REAL u_rate); void set_domain_distance_v_rate(REAL v_rate); void set_is_domain_distance_sampling(int flag); - + protected: Renderhints renderhints; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/patch.h b/reactos/dll/win32/glu32/libnurbs/internals/patch.h index 8eac27fdf4c..f0666ded81f 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/patch.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/patch.h @@ -62,7 +62,7 @@ struct Patchspec : public Pspec { int stride; void clamp( REAL ); void getstepsize( REAL ); - void singleStep( void ); + void singleStep( void ); }; class Patch { @@ -90,8 +90,8 @@ private: int cullval; int notInBbox; int needsSampling; - REAL cpts[MAXORDER*MAXORDER*MAXCOORDS]; //culling pts - REAL spts[MAXORDER*MAXORDER*MAXCOORDS]; //sampling pts + REAL cpts[MAXORDER*MAXORDER*MAXCOORDS]; //culling pts + REAL spts[MAXORDER*MAXORDER*MAXCOORDS]; //sampling pts REAL bpts[MAXORDER*MAXORDER*MAXCOORDS]; //bbox pts Patchspec pspec[2]; void checkBboxConstraint( void ); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/patchlist.h b/reactos/dll/win32/glu32/libnurbs/internals/patchlist.h index bc4136c23bf..e92730a85bc 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/patchlist.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/patchlist.h @@ -53,7 +53,7 @@ friend class Subdivider; public: Patchlist( Quilt *, REAL *, REAL * ); Patchlist( Patchlist &, int , REAL ); - ~Patchlist(); + ~Patchlist(); void bbox(); int cullCheck( void ); void getstepsize( void ); @@ -80,14 +80,14 @@ Patchlist::getStepsize( int param ) inline int Patchlist::get_uorder() -{ +{ return patch->get_uorder(); } inline int Patchlist::get_vorder() -{ +{ return patch->get_vorder(); } diff --git a/reactos/dll/win32/glu32/libnurbs/internals/quilt.h b/reactos/dll/win32/glu32/libnurbs/internals/quilt.h index e1bf2724606..a50bc2d6245 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/quilt.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/quilt.h @@ -51,7 +51,7 @@ class Mapdesc; class Flist; struct Knotvector; -/* constants for memory allocation of NURBS to Bezier conversion */ +/* constants for memory allocation of NURBS to Bezier conversion */ #define MAXDIM 2 struct Quiltspec { /* a specification for a dimension of a quilt */ @@ -66,7 +66,7 @@ struct Quiltspec { /* a specification for a dimension of a quilt */ }; typedef Quiltspec *Quiltspec_ptr; - + class Quilt : public PooledObj { /* an array of bezier patches */ public: Quilt( Mapdesc * ); @@ -75,7 +75,7 @@ public: Quiltspec qspec[MAXDIM]; /* the dimensional data */ Quiltspec_ptr eqspec; /* qspec trailer */ Quilt *next; /* next quilt in linked list */ - + public: void deleteMe( Pool& ); void toBezier( Knotvector &, INREAL *, long ); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/reader.h b/reactos/dll/win32/glu32/libnurbs/internals/reader.h index 76493c693af..188d9fdc6d5 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/reader.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/reader.h @@ -46,7 +46,7 @@ #include "types.h" enum Curvetype { ct_nurbscurve, ct_pwlcurve, ct_none }; - + struct Property; struct O_surface; struct O_nurbssurface; @@ -69,7 +69,7 @@ struct O_curve : public PooledObj { int used; /* curve called in cur surf */ int save; /* 1 if in display list */ long nuid; - O_curve() { next = 0; used = 0; owner = 0; + O_curve() { next = 0; used = 0; owner = 0; curve.o_pwlcurve = 0; } }; @@ -82,10 +82,10 @@ struct O_nurbscurve : public PooledObj { int used; /* curve called in cur surf */ int save; /* 1 if in display list */ O_curve * owner; /* owning curve */ - O_nurbscurve( long _type ) + O_nurbscurve( long _type ) { type = _type; owner = 0; next = 0; used = 0; } }; - + class O_pwlcurve : public PooledObj { public: TrimVertex *pts; /* array of trim vertices */ @@ -111,7 +111,7 @@ struct O_nurbssurface : public PooledObj { O_nurbssurface * next; /* next surface in chain */ int save; /* 1 if in display list */ int used; /* 1 if prev called in block */ - O_nurbssurface( long _type ) + O_nurbssurface( long _type ) { type = _type; owner = 0; next = 0; used = 0; } }; diff --git a/reactos/dll/win32/glu32/libnurbs/internals/simplemath.h b/reactos/dll/win32/glu32/libnurbs/internals/simplemath.h index 24cb952adec..d9f752dee37 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/simplemath.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/simplemath.h @@ -44,13 +44,13 @@ /* simple inline routines */ -inline int +inline int max( int x, int y ) { return ( x < y ) ? y : x; } -inline REAL +inline REAL min( REAL x, REAL y ) { return ( x > y ) ? y : x; } -inline REAL +inline REAL glu_abs( REAL x ) { return ( x < 0.0 ) ? -x : x; } #endif /* __glusimplemath_h_ */ diff --git a/reactos/dll/win32/glu32/libnurbs/internals/sorter.h b/reactos/dll/win32/glu32/libnurbs/internals/sorter.h index b5bd09f31b7..f637114e771 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/sorter.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/sorter.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -45,10 +45,10 @@ public: Sorter( int es ); void qsort( void *a, int n ); -protected: +protected: virtual int qscmp( char *, char * ); - virtual void qsexc( char *i, char *j ); // i<-j, j<-i - virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i + virtual void qsexc( char *i, char *j ); // i<-j, j<-i + virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i private: void qs1( char *, char * ); diff --git a/reactos/dll/win32/glu32/libnurbs/internals/subdivider.h b/reactos/dll/win32/glu32/libnurbs/internals/subdivider.h index 635f83bf87c..0299951f7e8 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/subdivider.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/subdivider.h @@ -187,7 +187,7 @@ private: *GLU_U_STEP: number of u-segments per unit u length of domain *GLU_V_STEP: number of v-segments per unit v length of domain *These two numbers are normally stored in mapdesc->maxs(t)rate. - *I (ZL) put these two numbers here so that I can optimize the untrimmed + *I (ZL) put these two numbers here so that I can optimize the untrimmed *case in the case of domain distance sampling. *These two numbers are set by set_domain_distance_u_rate() and ..._v_..(). */ @@ -197,7 +197,7 @@ private: }; inline void -Subdivider::beginLoop( void ) +Subdivider::beginLoop( void ) { pjarc = 0; } diff --git a/reactos/dll/win32/glu32/libnurbs/internals/trimline.h b/reactos/dll/win32/glu32/libnurbs/internals/trimline.h index f1e4d053af4..5087abb9176 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/trimline.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/trimline.h @@ -51,7 +51,7 @@ class Backend; class Trimline { private: - TrimVertex** pts; + TrimVertex** pts; long numverts; long i; long size; @@ -78,32 +78,32 @@ public: void getNextPts( Arc_ptr ); void getPrevPts( Arc_ptr ); inline TrimVertex * next( void ); - inline TrimVertex * prev( void ); + inline TrimVertex * prev( void ); inline TrimVertex * first( void ); inline TrimVertex * last( void ); }; inline TrimVertex * -Trimline::next( void ) +Trimline::next( void ) { - if( i < numverts) return pts[i++]; else return 0; -} - -inline TrimVertex * -Trimline::prev( void ) -{ - if( i >= 0 ) return pts[i--]; else return 0; -} - -inline TrimVertex * -Trimline::first( void ) -{ - i = 0; return pts[i]; + if( i < numverts) return pts[i++]; else return 0; } inline TrimVertex * -Trimline::last( void ) +Trimline::prev( void ) { - i = numverts; return pts[--i]; -} + if( i >= 0 ) return pts[i--]; else return 0; +} + +inline TrimVertex * +Trimline::first( void ) +{ + i = 0; return pts[i]; +} + +inline TrimVertex * +Trimline::last( void ) +{ + i = numverts; return pts[--i]; +} #endif /* __glutrimline_h_ */ diff --git a/reactos/dll/win32/glu32/libnurbs/internals/trimregion.h b/reactos/dll/win32/glu32/libnurbs/internals/trimregion.h index e1c9d8edcab..f8ab4c600d8 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/trimregion.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/trimregion.h @@ -72,7 +72,7 @@ private: }; inline void -TrimRegion::init( REAL vval ) +TrimRegion::init( REAL vval ) { bot.vval = vval; } diff --git a/reactos/dll/win32/glu32/libnurbs/internals/trimvertex.h b/reactos/dll/win32/glu32/libnurbs/internals/trimvertex.h index bbd147faea6..0a4795bade5 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/trimvertex.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/trimvertex.h @@ -58,11 +58,11 @@ public: typedef class TrimVertex *TrimVertex_p; -inline REAL -det3( TrimVertex *a, TrimVertex *b, TrimVertex *c ) -{ - return a->param[0] * (b->param[1]-c->param[1]) + - b->param[0] * (c->param[1]-a->param[1]) + +inline REAL +det3( TrimVertex *a, TrimVertex *b, TrimVertex *c ) +{ + return a->param[0] * (b->param[1]-c->param[1]) + + b->param[0] * (c->param[1]-a->param[1]) + c->param[0] * (a->param[1]-b->param[1]); } diff --git a/reactos/dll/win32/glu32/libnurbs/internals/uarray.h b/reactos/dll/win32/glu32/libnurbs/internals/uarray.h index 9aa51a86186..71478219512 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/uarray.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/uarray.h @@ -45,7 +45,7 @@ #include "types.h" class Arc; -typedef class Arc *Arc_ptr; +typedef class Arc *Arc_ptr; class Uarray { private: diff --git a/reactos/dll/win32/glu32/libnurbs/internals/varray.h b/reactos/dll/win32/glu32/libnurbs/internals/varray.h index 574add36a44..a2056c03007 100644 --- a/reactos/dll/win32/glu32/libnurbs/internals/varray.h +++ b/reactos/dll/win32/glu32/libnurbs/internals/varray.h @@ -64,10 +64,10 @@ private: }; inline void -Varray::append( REAL v ) +Varray::append( REAL v ) { if( v != vval[numquads] ) - vval[++numquads] = v; + vval[++numquads] = v; } diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/definitions.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/definitions.h index c852cad1a2f..37c8f935849 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/definitions.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/definitions.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/directedLine.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/directedLine.h index 1c41e59591a..258d96af05a 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/directedLine.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/directedLine.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -51,10 +51,10 @@ class directedLine { directedLine* next; /*double linked list*/ directedLine* prev; /*double linked list*/ - /*in case we need a list of polygons each + /*in case we need a list of polygons each *consisting of a double linked list */ - directedLine* nextPolygon; + directedLine* nextPolygon; /*optimization make cutoff polygon faster*/ /* directedLine* prevPolygon;*/ @@ -72,7 +72,7 @@ public: ~directedLine(); void init(short dir, sampledLine* sl); - + Real* head(); /*points[0] if INCREASING, points[n-1] otherwise*/ Real* tail(); /*points[n-1] if INCREASING, points[0] otherwise*/ Real* getVertex(Int i); /*points[i] if INCREASING, points[n-1-i] otherwise*/ @@ -108,13 +108,13 @@ public: /*check to see if the list forms a closed polygon *return 1 if yes */ - short isPolygon(); - + short isPolygon(); + Int compInY(directedLine* nl); Int compInX(directedLine* nl); /*return an array of pointers. - *the + *the */ directedLine** sortAllPolygons(); @@ -122,7 +122,7 @@ public: Int numEdgesAllPolygons(); Int numPolygons(); - /*check if the head of this edge is connected to + /*check if the head of this edge is connected to *the tail of the prev */ short isConnected(); @@ -133,7 +133,7 @@ public: void printList(); void printAllPolygons(); void writeAllPolygons(char* filename); - + /*insert a polygon: using nextPolygon*/ directedLine* insertPolygon(directedLine* newpolygon); @@ -142,15 +142,15 @@ public: Int toArraySinglePolygon(directedLine** array, Int index); directedLine** toArrayAllPolygons(Int& total_num_edges); - void connectDiagonal(directedLine* v1, directedLine* v2, - directedLine** ret_p1, + void connectDiagonal(directedLine* v1, directedLine* v2, + directedLine** ret_p1, directedLine** ret_p2, sampledLine** generatedLine, directedLine* list); /*generate two slines */ - void connectDiagonal_2slines(directedLine* v1, directedLine* v2, - directedLine** ret_p1, + void connectDiagonal_2slines(directedLine* v1, directedLine* v2, + directedLine** ret_p1, directedLine** ret_p2, directedLine* list); diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/gridWrap.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/gridWrap.h index e4ed33ca3b5..be3a4a670f0 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/gridWrap.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/gridWrap.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -52,14 +52,14 @@ class gridWrap{ Real u_min, u_max; Real v_min, v_max; - /*cache the coordinate values for efficiency. - *these are redundant information when + /*cache the coordinate values for efficiency. + *these are redundant information when *the grid is uniform. */ Real* u_values; /*size is n_ulines*/ Real* v_values; /*size is n_vlines*/ - Int is_uniform; + Int is_uniform; public: //uniform grid constructor @@ -73,7 +73,7 @@ public: Int nVlines, Real *vvlas ); ~gridWrap(); - + void print(); Int get_n_ulines() {return n_ulines;} Int get_n_vlines() {return n_vlines;} @@ -82,17 +82,17 @@ public: Real get_v_min() {return v_min;} Real get_v_max() {return v_max;} - Real get_u_value(Int i) + Real get_u_value(Int i) { assert(i=n_ulines){printf("ERROR, n_ulines=%i,i=%i\n",n_ulines,i);exit(0);}*/ + /*if(i>=n_ulines){printf("ERROR, n_ulines=%i,i=%i\n",n_ulines,i);exit(0);}*/ return u_values[i];} Real get_v_value(Int j) {return v_values[j];} Real* get_u_values() {return u_values;} Real* get_v_values() {return v_values;} - void outputFanWithPoint(Int v, Int uleft, Int uright, + void outputFanWithPoint(Int v, Int uleft, Int uright, Real vert[2], primStream* pStream); void draw(); diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/monoChain.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/monoChain.h index e820f4af9f8..e714d9be5e0 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/monoChain.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/monoChain.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -51,20 +51,20 @@ class monoChain{ monoChain* next; monoChain* prev; monoChain* nextPolygon; //a list of polygons - + //cached informatin //bounding box Real minX, maxX, minY, maxY; Int isIncrease; - + //for efficiently comparing two chains directedLine* current; - + public: monoChain(directedLine* cHead, directedLine* cTail); ~monoChain() {} - + inline void setNext(monoChain* n) {next = n;} inline void setPrev(monoChain* p) {prev = p;} inline void setNextPolygon(monoChain* np) {nextPolygon = np;} @@ -72,7 +72,7 @@ public: inline monoChain* getPrev() {return prev;} inline directedLine* getHead() {return chainHead;} inline directedLine* getTail() {return chainTail;} - + inline void resetCurrent() { current = ((isIncrease==1)? chainHead:chainTail);} void deleteLoop(); @@ -87,14 +87,14 @@ public: Int toArraySingleLoop(monoChain** array, Int index); Int isKey; - Real keyY; //the current horizotal line + Real keyY; //the current horizotal line Real chainIntersectHoriz(Real y); //updates current incrementally for efficiency directedLine* find(Real y);//find dline so that y intersects dline. void printOneChain(); void printChainLoop(); void printAllLoops(); - + }; monoChain* directedLineLoopToMonoChainLoop(directedLine* loop); @@ -102,7 +102,7 @@ monoChain* directedLineLoopListToMonoChainLoopList(directedLine* list); Int MC_sweepY(Int nVertices, monoChain** sortedVertices, sweepRange** ret_ranges); void MC_findDiagonals(Int total_num_edges, monoChain** sortedVertices, - sweepRange** ranges, Int& num_diagonals, + sweepRange** ranges, Int& num_diagonals, directedLine** diagonal_vertices); directedLine* MC_partitionY(directedLine *polygons, sampledLine **retSampledLines); diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/monoPolyPart.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/monoPolyPart.h index 5c968348bc6..28b008f501f 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/monoPolyPart.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/monoPolyPart.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -39,7 +39,7 @@ #ifndef _MONO_POLY_PART_H #define _MONO_POLY_PART_H - + class directedLine; directedLine* monoPolyPart(directedLine* polygon); diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/monoTriangulation.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/monoTriangulation.h index 9486794af19..0b9cca805f9 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/monoTriangulation.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/monoTriangulation.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -49,23 +49,23 @@ class Arc; typedef Arc *Arc_ptr; class reflexChain{ - Real2 *queue; - /*the order of the polygon vertices: either q[0],q[1].., or + Real2 *queue; + /*the order of the polygon vertices: either q[0],q[1].., or * q[n-1], q[n-2], ..., q[0] *this order determines the interior of the polygon, so it *also used to determines whether a chain is reflex or convex */ - Int isIncreasing; + Int isIncreasing; Int index_queue; Int size_queue; /*allocated size*/ - + public: reflexChain(Int size, Int isIncreasing); ~reflexChain(); - + void insert(Real u, Real v); void insert(Real v[2]); - + void processNewVertex(Real v[2], primStream* pStream); void outputFan(Real v[2], primStream* pStream); @@ -78,7 +78,7 @@ public: /*dynamic array of pointers to reals. *Intended to store an array of (u,v). *Notice that it doesn't allocate or dealocate the space - *for the (u,v) themselfs. So it assums that someone else + *for the (u,v) themselfs. So it assums that someone else *is taking care of them, while this class only plays with *the pointers. */ @@ -107,13 +107,13 @@ public: void monoTriangulation(directedLine* monoPolygon, primStream* pStream); -void monoTriangulationRec(Real* topVertex, Real* botVertex, +void monoTriangulationRec(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, primStream* pStream); -void monoTriangulationRec(directedLine* inc_chain, Int inc_index, - directedLine* dec_chain, Int dec_index, +void monoTriangulationRec(directedLine* inc_chain, Int inc_index, + directedLine* dec_chain, Int dec_index, directedLine* topVertex, Int top_index, directedLine* botVertex, primStream* pStream); @@ -124,60 +124,60 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index, *is increasing (left chain in V-monotone case) or decreaing (right chain *in V-monotone case). */ -void monoTriangulation2(Real* topVertex, Real* botVertex, +void monoTriangulation2(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_smallIndex, Int inc_largeIndex, Int is_increase_chain, primStream* pStream); -void monoTriangulationRecGen(Real* topVertex, Real* botVertex, +void monoTriangulationRecGen(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream); + primStream* pStream); -void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecGenOpt(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, - primStream* pStream); + primStream* pStream); void triangulateXYMonoTB(Int n_left, Real** leftVerts, Int n_right, Real** rightVerts, primStream* pStream); -void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecGenTBOpt(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, primStream* pStream); -void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, +void monoTriangulationRecOpt(Real* topVertex, Real* botVertex, vertexArray* left_chain, Int left_current, vertexArray* right_chain, Int right_current, primStream* pStream); -void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, +void monoTriangulationRecFunGen(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, Int inc_end, vertexArray* dec_chain, Int dec_current, Int dec_end, Int (*compFun)(Real*, Real*), primStream* pStream); -void monoTriangulationRecFun(Real* topVertex, Real* botVertex, +void monoTriangulationRecFun(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Int (*compFun)(Real*, Real*), primStream* pStream); -void monoTriangulationFun(directedLine* monoPolygon, +void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*), primStream* pStream); -void monoTriangulationRec(Real* topVertex, Real* botVertex, +void monoTriangulationRec(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Backend* backend); void monoTriangulationFunBackend(Arc_ptr loop, Int (*compFun)(Real*, Real*), Backend* backend); -void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, +void monoTriangulationRecFunBackend(Real* topVertex, Real* botVertex, vertexArray* inc_chain, Int inc_current, vertexArray* dec_chain, Int dec_current, Int (*compFun)(Real*, Real*), diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionX.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionX.h index 7faf23a8fe0..8d04e7e8731 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionX.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionX.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionY.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionY.h index a212f537644..f21712185df 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionY.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/partitionY.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -40,15 +40,15 @@ *A and B such that each chain is Y-monotonic that is the intersection of any *horizontal line intersects each chain has at most one connected componenets * (empty, single point or a single line). - * - * A vertex is a cusp if both its ajacent vertices are either at or above v, + * + * A vertex is a cusp if both its ajacent vertices are either at or above v, *or both at or below v. In addition, at least one of the ajacent verteces is - *strictly below or above v. - * A vertex is a relex vertex if the internals angle is strictly greater than + *strictly below or above v. + * A vertex is a relex vertex if the internals angle is strictly greater than *180. In other words, if the the signed area is negative: - *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the + *(x1, y1), (x2, y2), (x3, y3) are the three vertices along a polygon, the *order is such that left hand side is inside the polygon. Then (x2,y2) is - *reflex if: + *reflex if: * (x2-x1, y2-y1) cross (x3-x1, y3-y1) <0. *A vertex is an interior cusp if it is a cusp and a reflex. *A vertex is an exterior cusp if it is a cusp but not a reflex. @@ -78,7 +78,7 @@ typedef struct sweepRange{ directedLine *left; Int leftType; /*either a vertex (leftType=0) or an edge (leftType =1) */ directedLine *right; - Int rightType; /*either a vertex (rightType=0) or an edge (rightType =1) */ + Int rightType; /*either a vertex (rightType=0) or an edge (rightType =1) */ } sweepRange; sweepRange* sweepRangeMake(directedLine* left, Int leftType, @@ -87,7 +87,7 @@ sweepRange* sweepRangeMake(directedLine* left, Int leftType, void sweepRangeDelete(sweepRange* range); Int sweepRangeEqual(sweepRange* sr1, sweepRange* sr2); -/*given a set of simple polygons where the interior +/*given a set of simple polygons where the interior *is decided by left-hand principle, *return a range (sight) for each vertex. This is called *Trapezoidalization. diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/polyDBG.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/polyDBG.h index d60dca1854e..7f8326c5828 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/polyDBG.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/polyDBG.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -46,7 +46,7 @@ Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]); Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]); - + Int DBG_edgesIntersect(directedLine* l1, directedLine* l2); Int DBG_polygonSelfIntersect(directedLine* poly); diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/polyUtil.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/polyUtil.h index 6547ed9e19e..19453ce7acd 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/polyUtil.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/polyUtil.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/primitiveStream.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/primitiveStream.h index bcef56bba2d..369cd6c3eba 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/primitiveStream.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/primitiveStream.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -37,7 +37,7 @@ ** $Header: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/glu32/libnurbs/nurbtess/primitiveStream.h,v 1.1 2004/02/02 16:39:13 navaraf Exp $ */ -/*we do not use the constans GL_... so that this file is independent of +/*we do not use the constans GL_... so that this file is independent of * */ @@ -59,13 +59,13 @@ class primStream { Int index_vertices; Int size_vertices; - /*the vertex is inserted one by one. counter is used to - *count the number of vertices which have been inserted so far in + /*the vertex is inserted one by one. counter is used to + *count the number of vertices which have been inserted so far in *the current primitive */ Int counter; -public: +public: primStream(Int sizeLengths, Int sizeVertices); ~primStream(); @@ -83,16 +83,16 @@ public: } Real* get_vertices() {return vertices;} - /*the begining of inserting a new primitive. + /*the begining of inserting a new primitive. *reset counter to be 0. */ void begin(); void insert(Real u, Real v); void insert(Real v[2]) {insert(v[0], v[1]);} void end(Int type); - + Int num_triangles(); - + void triangle(Real A[2], Real B[2], Real C[2]) { begin(); @@ -110,7 +110,7 @@ public: - + #endif diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/quicksort.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/quicksort.h index a2403afd007..c8bc71a8eee 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/quicksort.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/quicksort.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/rectBlock.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/rectBlock.h index 9b07330138d..afa9c4fff30 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/rectBlock.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/rectBlock.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -72,7 +72,7 @@ class rectBlockArray{ public: rectBlockArray(Int s); ~rectBlockArray();//delete avarything including the blocks - + Int get_n_elements() {return n_elements;} rectBlock* get_element(Int i) {return array[i];} void insert(rectBlock* newBlock); //only take the pointer, not ther cotent @@ -82,7 +82,7 @@ public: void print(); void draw(Real* u_values, Real* v_values); }; - + #endif diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleComp.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleComp.h index f1fc23b9164..26719555140 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleComp.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleComp.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -44,7 +44,7 @@ #include "rectBlock.h" void sampleConnectedComp(Real* topVertex, Real* botVertex, - vertexArray* leftChain, + vertexArray* leftChain, Int leftStartIndex, Int botLeftIndex, vertexArray* rightChain, Int rightStartIndex, Int botRightIndex, @@ -89,5 +89,5 @@ void sampleLeftSingleTrimEdgeRegionGen(Real topVert[2], Real botVert[2], Int rightDownBegin, Int rightDownEnd, primStream* pStream); - + #endif diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompBot.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompBot.h index 48d3a39ff9e..4a0b10ad13b 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompBot.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompBot.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -42,14 +42,14 @@ #include "sampleMonoPoly.h" -void findBotLeftSegment(vertexArray* leftChain, +void findBotLeftSegment(vertexArray* leftChain, Int leftEnd, Int leftCorner, Real u, Int& ret_index_mono, Int& ret_index_pass); -void findBotRightSegment(vertexArray* rightChain, +void findBotRightSegment(vertexArray* rightChain, Int rightEnd, Int rightCorner, Real u, @@ -70,7 +70,7 @@ void sampleBotRightWithGridLinePost(Real* botVertex, primStream* pStream); -void sampleBotRightWithGridLine(Real* botVertex, +void sampleBotRightWithGridLine(Real* botVertex, vertexArray* rightChain, Int rightEnd, Int rightCorner, @@ -89,7 +89,7 @@ void sampleBotLeftWithGridLinePost(Real* botVertex, Int leftCorner, gridWrap* grid, Int gridV, - Int leftU, + Int leftU, Int rightU, primStream* pStream); diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompRight.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompRight.h index 5c852e4c328..53afc1cdf84 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompRight.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompRight.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -43,7 +43,7 @@ #define NOT_TAKEOUT #include "sampleMonoPoly.h" -void stripOfFanRight(vertexArray* rightChain, +void stripOfFanRight(vertexArray* rightChain, Int largeIndex, Int smallIndex, gridWrap* grid, @@ -60,7 +60,7 @@ void sampleRightStripRecF(vertexArray* rightChain, Int botRightIndex, gridBoundaryChain* rightGridChain, Int rightGridChainStartIndex, - Int rightGridChainEndIndex, + Int rightGridChainEndIndex, primStream* pStream ); //the degenerate case of sampleRightOneGridStep @@ -72,7 +72,7 @@ void sampleRightOneGridStepNoMiddle(vertexArray* rightChain, primStream* pStream); //sampling the right area in between two grid lines //shape: _________| -void sampleRightOneGridStep(vertexArray* rightChain, +void sampleRightOneGridStep(vertexArray* rightChain, Int beginRightIndex, Int endRightIndex, gridBoundaryChain* rightGridChain, diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompTop.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompTop.h index 50204642d30..0b447366aeb 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompTop.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleCompTop.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleMonoPoly.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleMonoPoly.h index 412c4366b55..158625c4656 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleMonoPoly.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampleMonoPoly.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -49,7 +49,7 @@ void triangulateXYMono(Int n_upper, Real upperVerts[][2], Int n_lower, Real lowerVerts[][2], primStream* pStream); -void stripOfFanLeft(vertexArray* leftChain, +void stripOfFanLeft(vertexArray* leftChain, Int largeIndex, Int smallIndex, gridWrap* grid, @@ -100,12 +100,12 @@ void sampleMonoPoly(directedLine* polygon, gridWrap* grid, Int ulinear, Int vlin void sampleMonoPolyRec( Real* topVertex, Real* botVertex, - vertexArray* leftChain, + vertexArray* leftChain, Int leftStartIndex, vertexArray* rightChain, Int rightStartIndex, - gridBoundaryChain* leftGridChain, - gridBoundaryChain* rightGridChain, + gridBoundaryChain* leftGridChain, + gridBoundaryChain* rightGridChain, Int gridStartIndex, primStream* pStream, rectBlockArray* rbArray @@ -120,20 +120,20 @@ void sampleLeftStripRecF(vertexArray* leftChain, primStream* pStream ); -void findUpCorners(Real *topVertex, - vertexArray *leftChain, +void findUpCorners(Real *topVertex, + vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, - vertexArray *rightChain, + vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, Real v, Real uleft, Real uright, - Int& ret_leftCornerWhere, + Int& ret_leftCornerWhere, Int& ret_leftCornerIndex, Int& ret_rightCornerWhere, Int& ret_rightCornerIndex ); -void findDownCorners(Real *botVertex, +void findDownCorners(Real *botVertex, vertexArray *leftChain, Int leftChainStartIndex, Int leftChainEndIndex, vertexArray *rightChain, Int rightChainStartIndex, Int rightChainEndIndex, Real v, @@ -144,8 +144,8 @@ void findDownCorners(Real *botVertex, Int& ret_rightCornerWhere, Int& ret_rightCornerIndex ); -void findNeck(vertexArray *leftChain, Int botLeftIndex, - vertexArray *rightChain, Int botRightIndex, +void findNeck(vertexArray *leftChain, Int botLeftIndex, + vertexArray *rightChain, Int botRightIndex, Int& leftLastIndex, /*left point of the neck*/ Int& rightLastIndex /*right point of the neck*/ ); @@ -155,20 +155,20 @@ Int findNeckF(vertexArray *leftChain, Int botLeftIndex, gridBoundaryChain* leftGridChain, gridBoundaryChain* rightGridChain, Int gridStartIndex, - Int& neckLeft, + Int& neckLeft, Int& neckRight); -void findTopAndBot(directedLine* polygon, - directedLine*& topV, +void findTopAndBot(directedLine* polygon, + directedLine*& topV, directedLine*& botV); -void findGridChains(directedLine* top, directedLine* bot, +void findGridChains(directedLine* top, directedLine* bot, gridWrap* grid, gridBoundaryChain*& leftGridChain, gridBoundaryChain*& rightGridChain); void toVertexArrays(directedLine* topV, directedLine* botV, vertexArray& leftChain, vertexArray& rightChain); void drawCorners( - Real* topV, Real* botV, + Real* topV, Real* botV, vertexArray* leftChain, vertexArray* rightChain, gridBoundaryChain* leftGridChain, @@ -184,7 +184,7 @@ void drawCorners( Int bot_rightCornerWhere, Int bot_rightCornerIndex); -Int checkMiddle(vertexArray* chain, Int begin, Int end, +Int checkMiddle(vertexArray* chain, Int begin, Int end, Real vup, Real vbelow); #endif diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampledLine.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampledLine.h index 54e7481c280..b202b9874d9 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/sampledLine.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/sampledLine.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -68,7 +68,7 @@ public: void tessellateAll(Real u_reso, Real v_reso); void print(); - + sampledLine* next; }; diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/searchTree.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/searchTree.h index 9bb97e31b07..5c4ed0c3580 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/searchTree.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/searchTree.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -44,13 +44,13 @@ typedef struct treeNode{ void *key; struct treeNode* parent; struct treeNode* left; /*children*/ - struct treeNode* right; + struct treeNode* right; } treeNode; treeNode* TreeNodeMake(void *key); void TreeNodeDeleteSingleNode(treeNode* node); void TreeNodeDeleteWholeTree(treeNode* node); -void TreeNodePrint(treeNode* node, +void TreeNodePrint(treeNode* node, void (*keyPrint) (void*)); int TreeNodeDepth(treeNode* root); treeNode* TreeNodeMinimum(treeNode* node); diff --git a/reactos/dll/win32/glu32/libnurbs/nurbtess/zlassert.h b/reactos/dll/win32/glu32/libnurbs/nurbtess/zlassert.h index 62ad089b6bd..bf74e96d304 100644 --- a/reactos/dll/win32/glu32/libnurbs/nurbtess/zlassert.h +++ b/reactos/dll/win32/glu32/libnurbs/nurbtess/zlassert.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libtess/dict-list.h b/reactos/dll/win32/glu32/libtess/dict-list.h index 70f64bd419e..fe817b9d4bc 100644 --- a/reactos/dll/win32/glu32/libtess/dict-list.h +++ b/reactos/dll/win32/glu32/libtess/dict-list.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -71,7 +71,7 @@ typedef struct DictNode DictNode; Dict *dictNewDict( void *frame, int (*leq)(void *frame, DictKey key1, DictKey key2) ); - + void dictDeleteDict( Dict *dict ); /* Search returns the node with the smallest key greater than or equal diff --git a/reactos/dll/win32/glu32/libtess/dict.c b/reactos/dll/win32/glu32/libtess/dict.c index a59903bac04..76fbbeab6ac 100644 --- a/reactos/dll/win32/glu32/libtess/dict.c +++ b/reactos/dll/win32/glu32/libtess/dict.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libtess/dict.h b/reactos/dll/win32/glu32/libtess/dict.h index b015ec63218..45ce64b56d4 100644 --- a/reactos/dll/win32/glu32/libtess/dict.h +++ b/reactos/dll/win32/glu32/libtess/dict.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -71,7 +71,7 @@ typedef struct DictNode DictNode; Dict *dictNewDict( void *frame, int (*leq)(void *frame, DictKey key1, DictKey key2) ); - + void dictDeleteDict( Dict *dict ); /* Search returns the node with the smallest key greater than or equal diff --git a/reactos/dll/win32/glu32/libtess/geom.c b/reactos/dll/win32/glu32/libtess/geom.c index ce9b7ffd113..21b63f30538 100644 --- a/reactos/dll/win32/glu32/libtess/geom.c +++ b/reactos/dll/win32/glu32/libtess/geom.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -66,7 +66,7 @@ GLdouble __gl_edgeEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( VertLeq( u, v ) && VertLeq( v, w )); - + gapL = v->s - u->s; gapR = w->s - v->s; @@ -90,7 +90,7 @@ GLdouble __gl_edgeSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( VertLeq( u, v ) && VertLeq( v, w )); - + gapL = v->s - u->s; gapR = w->s - v->s; @@ -121,7 +121,7 @@ GLdouble __gl_transEval( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( TransLeq( u, v ) && TransLeq( v, w )); - + gapL = v->t - u->t; gapR = w->t - v->t; @@ -145,7 +145,7 @@ GLdouble __gl_transSign( GLUvertex *u, GLUvertex *v, GLUvertex *w ) GLdouble gapL, gapR; assert( TransLeq( u, v ) && TransLeq( v, w )); - + gapL = v->t - u->t; gapR = w->t - v->t; diff --git a/reactos/dll/win32/glu32/libtess/memalloc.c b/reactos/dll/win32/glu32/libtess/memalloc.c index e65b06e001b..92e7b4f16af 100644 --- a/reactos/dll/win32/glu32/libtess/memalloc.c +++ b/reactos/dll/win32/glu32/libtess/memalloc.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libtess/memalloc.h b/reactos/dll/win32/glu32/libtess/memalloc.h index 7e280b5d3ad..139d4aa777d 100644 --- a/reactos/dll/win32/glu32/libtess/memalloc.h +++ b/reactos/dll/win32/glu32/libtess/memalloc.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libtess/mesh.c b/reactos/dll/win32/glu32/libtess/mesh.c index a7d30c4f6b2..4adc12a77fe 100644 --- a/reactos/dll/win32/glu32/libtess/mesh.c +++ b/reactos/dll/win32/glu32/libtess/mesh.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -134,7 +134,7 @@ static void Splice( GLUhalfEdge *a, GLUhalfEdge *b ) * the new vertex *before* vNext so that algorithms which walk the vertex * list will not see the newly created vertices. */ -static void MakeVertex( GLUvertex *newVertex, +static void MakeVertex( GLUvertex *newVertex, GLUhalfEdge *eOrig, GLUvertex *vNext ) { GLUhalfEdge *e; @@ -174,7 +174,7 @@ static void MakeFace( GLUface *newFace, GLUhalfEdge *eOrig, GLUface *fNext ) GLUface *fPrev; GLUface *fNew = newFace; - assert(fNew != NULL); + assert(fNew != NULL); /* insert in circular doubly-linked list before fNext */ fPrev = fNext->prev; @@ -286,9 +286,9 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) if (newVertex1 == NULL || newVertex2 == NULL || newFace == NULL) { if (newVertex1 != NULL) memFree(newVertex1); if (newVertex2 != NULL) memFree(newVertex2); - if (newFace != NULL) memFree(newFace); + if (newFace != NULL) memFree(newFace); return NULL; - } + } e = MakeEdge( &mesh->eHead ); if (e == NULL) return NULL; @@ -298,7 +298,7 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) MakeFace( newFace, e, &mesh->fHead ); return e; } - + /* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the * mesh connectivity and topology. It changes the mesh so that @@ -355,7 +355,7 @@ int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) eOrg->Org->anEdge = eOrg; } if( ! joiningLoops ) { - GLUface *newFace= allocFace(); + GLUface *newFace= allocFace(); if (newFace == NULL) return 0; /* We split one loop into two -- the new loop is eDst->Lface. @@ -403,7 +403,7 @@ int __gl_meshDelete( GLUhalfEdge *eDel ) Splice( eDel, eDel->Oprev ); if( ! joiningLoops ) { GLUface *newFace= allocFace(); - if (newFace == NULL) return 0; + if (newFace == NULL) return 0; /* We are splitting one loop into two -- create a new loop for eDel. */ MakeFace( newFace, eDel, eDel->Lface ); @@ -506,7 +506,7 @@ GLUhalfEdge *__gl_meshSplitEdge( GLUhalfEdge *eOrg ) GLUhalfEdge *__gl_meshConnect( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) { GLUhalfEdge *eNewSym; - int joiningLoops = FALSE; + int joiningLoops = FALSE; GLUhalfEdge *eNew = MakeEdge( eOrg ); if (eNew == NULL) return NULL; @@ -608,7 +608,7 @@ GLUmesh *__gl_meshNewMesh( void ) if (mesh == NULL) { return NULL; } - + v = &mesh->vHead; f = &mesh->fHead; e = &mesh->eHead; diff --git a/reactos/dll/win32/glu32/libtess/mesh.h b/reactos/dll/win32/glu32/libtess/mesh.h index 47b051650b4..87132b12c91 100644 --- a/reactos/dll/win32/glu32/libtess/mesh.h +++ b/reactos/dll/win32/glu32/libtess/mesh.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -44,7 +44,7 @@ #include -typedef struct GLUmesh GLUmesh; +typedef struct GLUmesh GLUmesh; typedef struct GLUvertex GLUvertex; typedef struct GLUface GLUface; diff --git a/reactos/dll/win32/glu32/libtess/normal.h b/reactos/dll/win32/glu32/libtess/normal.h index b2b2d15cea0..e082c873844 100644 --- a/reactos/dll/win32/glu32/libtess/normal.h +++ b/reactos/dll/win32/glu32/libtess/normal.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libtess/priorityq-heap.c b/reactos/dll/win32/glu32/libtess/priorityq-heap.c index d4737ba65eb..a846f3ff064 100644 --- a/reactos/dll/win32/glu32/libtess/priorityq-heap.c +++ b/reactos/dll/win32/glu32/libtess/priorityq-heap.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -175,8 +175,8 @@ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) /* If the heap overflows, double its size. */ pq->max <<= 1; - pq->nodes = (PQnode *)memRealloc( pq->nodes, - (size_t) + pq->nodes = (PQnode *)memRealloc( pq->nodes, + (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] ))); if (pq->nodes == NULL) { pq->nodes = saveNodes; /* restore ptr to free upon return */ @@ -184,7 +184,7 @@ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) } pq->handles = (PQhandleElem *)memRealloc( pq->handles, (size_t) - ((pq->max + 1) * + ((pq->max + 1) * sizeof( pq->handles[0] ))); if (pq->handles == NULL) { pq->handles = saveHandles; /* restore ptr to free upon return */ diff --git a/reactos/dll/win32/glu32/libtess/priorityq-heap.h b/reactos/dll/win32/glu32/libtess/priorityq-heap.h index 6ac5c2cb422..3d559fbe20c 100644 --- a/reactos/dll/win32/glu32/libtess/priorityq-heap.h +++ b/reactos/dll/win32/glu32/libtess/priorityq-heap.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -98,7 +98,7 @@ struct PriorityQ { int initialized; int (*leq)(PQkey key1, PQkey key2); }; - + PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); void pqDeletePriorityQ( PriorityQ *pq ); diff --git a/reactos/dll/win32/glu32/libtess/priorityq-sort.h b/reactos/dll/win32/glu32/libtess/priorityq-sort.h index 32c88fabe6a..7f71e20182e 100644 --- a/reactos/dll/win32/glu32/libtess/priorityq-sort.h +++ b/reactos/dll/win32/glu32/libtess/priorityq-sort.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -109,7 +109,7 @@ struct PriorityQ { int initialized; int (*leq)(PQkey key1, PQkey key2); }; - + PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); void pqDeletePriorityQ( PriorityQ *pq ); diff --git a/reactos/dll/win32/glu32/libtess/priorityq.c b/reactos/dll/win32/glu32/libtess/priorityq.c index f79a93d78ec..d9b7f816222 100644 --- a/reactos/dll/win32/glu32/libtess/priorityq.c +++ b/reactos/dll/win32/glu32/libtess/priorityq.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -82,7 +82,7 @@ PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ) /* really __gl_pqSortDeletePriorityQ */ void pqDeletePriorityQ( PriorityQ *pq ) { - assert(pq != NULL); + assert(pq != NULL); if (pq->heap != NULL) __gl_pqHeapDeletePriorityQ( pq->heap ); if (pq->order != NULL) memFree( pq->order ); if (pq->keys != NULL) memFree( pq->keys ); @@ -176,7 +176,7 @@ int pqInit( PriorityQ *pq ) } /* really __gl_pqSortInsert */ -/* returns LONG_MAX iff out of memory */ +/* returns LONG_MAX iff out of memory */ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) { long curr; @@ -190,15 +190,15 @@ PQhandle pqInsert( PriorityQ *pq, PQkey keyNew ) /* If the heap overflows, double its size. */ pq->max <<= 1; - pq->keys = (PQHeapKey *)memRealloc( pq->keys, + pq->keys = (PQHeapKey *)memRealloc( pq->keys, (size_t) (pq->max * sizeof( pq->keys[0] ))); - if (pq->keys == NULL) { + if (pq->keys == NULL) { pq->keys = saveKey; /* restore ptr to free upon return */ return LONG_MAX; } } - assert(curr != LONG_MAX); + assert(curr != LONG_MAX); pq->keys[curr] = keyNew; /* Negative handles index the sorted array. */ diff --git a/reactos/dll/win32/glu32/libtess/priorityq.h b/reactos/dll/win32/glu32/libtess/priorityq.h index 148eadc7f7a..b1a0ee2f51f 100644 --- a/reactos/dll/win32/glu32/libtess/priorityq.h +++ b/reactos/dll/win32/glu32/libtess/priorityq.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -109,7 +109,7 @@ struct PriorityQ { int initialized; int (*leq)(PQkey key1, PQkey key2); }; - + PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) ); void pqDeletePriorityQ( PriorityQ *pq ); diff --git a/reactos/dll/win32/glu32/libtess/render.c b/reactos/dll/win32/glu32/libtess/render.c index 266a5a5881f..e2f850771f6 100644 --- a/reactos/dll/win32/glu32/libtess/render.c +++ b/reactos/dll/win32/glu32/libtess/render.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -289,15 +289,15 @@ static void RenderFan( GLUtesselator *tess, GLUhalfEdge *e, long size ) * edge "e". The fan *should* contain exactly "size" triangles * (otherwise we've goofed up somewhere). */ - CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_FAN ); - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_FAN ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); while( ! Marked( e->Lface )) { e->Lface->marked = TRUE; --size; e = e->Onext; - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); } assert( size == 0 ); @@ -312,20 +312,20 @@ static void RenderStrip( GLUtesselator *tess, GLUhalfEdge *e, long size ) * (otherwise we've goofed up somewhere). */ CALL_BEGIN_OR_BEGIN_DATA( GL_TRIANGLE_STRIP ); - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); while( ! Marked( e->Lface )) { e->Lface->marked = TRUE; --size; e = e->Dprev; - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); if( Marked( e->Lface )) break; e->Lface->marked = TRUE; --size; e = e->Onext; - CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Dst->data ); } assert( size == 0 ); @@ -349,7 +349,7 @@ void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh ) CALL_BEGIN_OR_BEGIN_DATA( GL_LINE_LOOP ); e = f->anEdge; do { - CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); + CALL_VERTEX_OR_VERTEX_DATA( e->Org->data ); e = e->Lnext; } while( e != f->anEdge ); CALL_END_OR_END_DATA(); @@ -490,14 +490,14 @@ GLboolean __gl_renderCache( GLUtesselator *tess ) : (tess->cacheCount > 3) ? GL_TRIANGLE_FAN : GL_TRIANGLES ); - CALL_VERTEX_OR_VERTEX_DATA( v0->data ); + CALL_VERTEX_OR_VERTEX_DATA( v0->data ); if( sign > 0 ) { for( vc = v0+1; vc < vn; ++vc ) { - CALL_VERTEX_OR_VERTEX_DATA( vc->data ); + CALL_VERTEX_OR_VERTEX_DATA( vc->data ); } } else { for( vc = vn-1; vc > v0; --vc ) { - CALL_VERTEX_OR_VERTEX_DATA( vc->data ); + CALL_VERTEX_OR_VERTEX_DATA( vc->data ); } } CALL_END_OR_END_DATA(); diff --git a/reactos/dll/win32/glu32/libtess/render.h b/reactos/dll/win32/glu32/libtess/render.h index 12ed587f0c7..bf8ed2755b1 100644 --- a/reactos/dll/win32/glu32/libtess/render.h +++ b/reactos/dll/win32/glu32/libtess/render.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libtess/sweep.h b/reactos/dll/win32/glu32/libtess/sweep.h index 1837fdadd29..c04290371b0 100644 --- a/reactos/dll/win32/glu32/libtess/sweep.h +++ b/reactos/dll/win32/glu32/libtess/sweep.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libtess/tess.c b/reactos/dll/win32/glu32/libtess/tess.c index 0489350a027..b941eee1296 100644 --- a/reactos/dll/win32/glu32/libtess/tess.c +++ b/reactos/dll/win32/glu32/libtess/tess.c @@ -502,7 +502,7 @@ gluTessEndPolygon( GLUtesselator *tess ) { GLUmesh *mesh; - if (setjmp(tess->env) != 0) { + if (setjmp(tess->env) != 0) { /* come back here if out of memory */ CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); return; diff --git a/reactos/dll/win32/glu32/libtess/tess.h b/reactos/dll/win32/glu32/libtess/tess.h index cbe3c8df117..4c40de6e959 100644 --- a/reactos/dll/win32/glu32/libtess/tess.h +++ b/reactos/dll/win32/glu32/libtess/tess.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -118,9 +118,9 @@ struct GLUtesselator { int cacheCount; /* number of cached vertices */ CachedVertex cache[TESS_MAX_CACHE]; /* the vertex data */ - /*** rendering callbacks that also pass polygon data ***/ + /*** rendering callbacks that also pass polygon data ***/ void (GLAPIENTRY *callBeginData)( GLenum type, void *polygonData ); - void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge, + void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge, void *polygonData ); void (GLAPIENTRY *callVertexData)( void *data, void *polygonData ); void (GLAPIENTRY *callEndData)( void *polygonData ); diff --git a/reactos/dll/win32/glu32/libtess/tessmono.c b/reactos/dll/win32/glu32/libtess/tessmono.c index 0410f70fe61..8446a40f263 100644 --- a/reactos/dll/win32/glu32/libtess/tessmono.c +++ b/reactos/dll/win32/glu32/libtess/tessmono.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -53,7 +53,7 @@ * (what else would it do??) The region must consist of a single * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this * case means that any vertical line intersects the interior of the - * region in a single interval. + * region in a single interval. * * Tessellation consists of adding interior edges (actually pairs of * half-edges), to split the region into non-overlapping triangles. diff --git a/reactos/dll/win32/glu32/libtess/tessmono.h b/reactos/dll/win32/glu32/libtess/tessmono.h index 36e76093ff2..970d23350a2 100644 --- a/reactos/dll/win32/glu32/libtess/tessmono.h +++ b/reactos/dll/win32/glu32/libtess/tessmono.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -46,7 +46,7 @@ * (what else would it do??) The region must consist of a single * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this * case means that any vertical line intersects the interior of the - * region in a single interval. + * region in a single interval. * * Tessellation consists of adding interior edges (actually pairs of * half-edges), to split the region into non-overlapping triangles. diff --git a/reactos/dll/win32/glu32/libutil/error.c b/reactos/dll/win32/glu32/libutil/error.c index 50ca8dafad9..cdcea37d75f 100644 --- a/reactos/dll/win32/glu32/libutil/error.c +++ b/reactos/dll/win32/glu32/libutil/error.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libutil/glue.c b/reactos/dll/win32/glu32/libutil/glue.c index cb7d3de9b08..f3f348ad536 100644 --- a/reactos/dll/win32/glu32/libutil/glue.c +++ b/reactos/dll/win32/glu32/libutil/glue.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libutil/gluint.h b/reactos/dll/win32/glu32/libutil/gluint.h index 73ddd4baf73..17152233ce8 100644 --- a/reactos/dll/win32/glu32/libutil/gluint.h +++ b/reactos/dll/win32/glu32/libutil/gluint.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released diff --git a/reactos/dll/win32/glu32/libutil/mipmap.c b/reactos/dll/win32/glu32/libutil/mipmap.c index 04bdf521d28..8eaac3c18d7 100644 --- a/reactos/dll/win32/glu32/libutil/mipmap.c +++ b/reactos/dll/win32/glu32/libutil/mipmap.c @@ -1452,7 +1452,7 @@ static void scale_internal_ubyte(GLint components, GLint widthin, totals[k] += (GLubyte)(*(temp_index)) * percent; } - /* calculate the value for pixels in the last row */ + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; @@ -1666,7 +1666,7 @@ static void scale_internal_byte(GLint components, GLint widthin, totals[k] += (GLbyte)(*(temp_index)) * percent; } - /* calculate the value for pixels in the last row */ + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; @@ -1893,7 +1893,7 @@ static void scale_internal_ushort(GLint components, GLint widthin, } } - /* calculate the value for pixels in the last row */ + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; @@ -3279,7 +3279,7 @@ static GLboolean legalType(GLenum type) case GL_UNSIGNED_INT: case GL_FLOAT: case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: case GL_UNSIGNED_SHORT_4_4_4_4: @@ -3376,7 +3376,7 @@ static void closestFit(GLenum target, GLint width, GLint height, if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1) ) { GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); + GLint heightPowerOf2= nearestPower(height); GLint proxyWidth; do { @@ -3886,7 +3886,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memreq); + dstImage = (GLuint *)malloc(memreq); break; default: return GLU_INVALID_ENUM; @@ -4250,7 +4250,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, int nextWidth= newwidth/2; int nextHeight= newheight/2; if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; + if (nextHeight < 1) nextHeight= 1; memreq = image_size(nextWidth, nextHeight, format, type); } @@ -4391,13 +4391,13 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: halveImagePackedPixel(4,extract5551,shove5551, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: halveImagePackedPixel(4,extract1555rev,shove1555rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, @@ -4778,7 +4778,7 @@ static GLfloat bytes_per_element(GLenum type) case GL_FLOAT: return(sizeof(GLfloat)); case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: return(sizeof(GLubyte)); case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: @@ -4944,31 +4944,31 @@ static void fill_image(const PixelStorageModes *psm, *iter2++ = (*((const GLbyte *) iter)) * 516; } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: extract565(myswap_bytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: extract565rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: extract4444(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: extract4444rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: extract5551(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -5000,19 +5000,19 @@ static void fill_image(const PixelStorageModes *psm, *iter2++ = widget.us[0]; } break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: extract8888(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: extract8888rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: extract1010102(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -5066,7 +5066,7 @@ static void fill_image(const PixelStorageModes *psm, /* want 'iter' pointing at start, not within, row for assertion * purposes */ - iter= start; + iter= start; #endif } /* for i */ @@ -5216,7 +5216,7 @@ static void empty_image(const PixelStorageModes *psm, *((GLbyte *) iter) = *iter2++ >> 9; } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -5229,7 +5229,7 @@ static void empty_image(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -5408,7 +5408,7 @@ static void empty_image(const PixelStorageModes *psm, /* want 'iter' pointing at start, not within, row for assertion * purposes */ - iter= start; + iter= start; #endif } /* for i */ @@ -5448,7 +5448,7 @@ static void extract332(int isSwap, } /* extract332() */ static void shove332(const GLfloat shoveComponents[], - int index, void *packedPixel) + int index, void *packedPixel) { /* 11100000 == 0xe0 */ /* 00011100 == 0x1c */ @@ -5484,7 +5484,7 @@ static void extract233rev(int isSwap, } /* extract233rev() */ static void shove233rev(const GLfloat shoveComponents[], - int index, void *packedPixel) + int index, void *packedPixel) { /* 0000,0111 == 0x07 */ /* 0011,1000 == 0x38 */ @@ -6094,7 +6094,7 @@ static void scaleInternalPackedPixel(int components, #endif /* calculate the value for pixels in the last row */ - + y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes; @@ -6490,7 +6490,7 @@ static void halve1DimagePackedPixel(int components, (*extractPackedPixel)(isSwap,src, &extractTotals[0][0]); (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), - &extractTotals[1][0]); + &extractTotals[1][0]); for (cc = 0; cc < components; cc++) { int kk; @@ -6536,7 +6536,7 @@ static void halve1DimagePackedPixel(int components, (*extractPackedPixel)(isSwap,src, &extractTotals[0][0]); (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), - &extractTotals[1][0]); + &extractTotals[1][0]); for (cc = 0; cc < components; cc++) { int kk; @@ -6728,31 +6728,31 @@ static void fillImage3D(const PixelStorageModes *psm, *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: extract565(myswapBytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: extract565rev(myswapBytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: extract4444(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: extract4444rev(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: extract5551(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -6784,19 +6784,19 @@ static void fillImage3D(const PixelStorageModes *psm, *iter2++ = widget.us[0]; } break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: extract8888(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: extract8888rev(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: extract1010102(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -7094,7 +7094,7 @@ static void emptyImage3D(const PixelStorageModes *psm, } shove233rev(shoveComponents,0,(void *)iter); break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -7107,7 +7107,7 @@ static void emptyImage3D(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; } @@ -7365,7 +7365,7 @@ static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, GLint *newWidth, GLint *newHeight, GLint *newDepth) { GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); + GLint heightPowerOf2= nearestPower(height); GLint depthPowerOf2= nearestPower(depth); GLint proxyWidth ; @@ -7462,7 +7462,7 @@ static void halveImagePackedPixelSlice(int components, } totals[cc]/= (float)BOX2; } /* for cc */ - + (*shovePackedPixel)(totals,outIndex,dataOut); outIndex++; /* skip over to next group of 2 */ @@ -7782,7 +7782,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, /* clamp to 1 */ if (nextWidth < 1) nextWidth= 1; if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; + if (nextDepth < 1) nextDepth= 1; memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); } switch(type) { @@ -7823,7 +7823,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memReq); + dstImage = (GLuint *)malloc(memReq); break; default: return GLU_INVALID_ENUM; /* assertion */ @@ -8133,8 +8133,8 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, int nextHeight= newHeight/2; int nextDepth= newDepth/2; if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; + if (nextHeight < 1) nextHeight= 1; + if (nextDepth < 1) nextDepth= 1; memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); } @@ -8193,7 +8193,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } } /* level userLevel is in srcImage; nothing saved yet */ - level = userLevel; + level = userLevel; } glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); @@ -8324,13 +8324,13 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, srcImage,dstImage,elementSize,rowSize, imageSize,myswapBytes); break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: halveImagePackedPixel3D(4,extract5551,shove5551, newWidth,newHeight,newDepth, srcImage,dstImage,elementSize,rowSize, imageSize,myswapBytes); break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: halveImagePackedPixel3D(4,extract1555rev,shove1555rev, newWidth,newHeight,newDepth, srcImage,dstImage,elementSize,rowSize, diff --git a/reactos/dll/win32/glu32/libutil/project.c b/reactos/dll/win32/glu32/libutil/project.c index 733d916635c..5707535de34 100644 --- a/reactos/dll/win32/glu32/libutil/project.c +++ b/reactos/dll/win32/glu32/libutil/project.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -159,7 +159,7 @@ static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], int i; for (i=0; i<4; i++) { - out[i] = + out[i] = in[0] * matrix[0*4+i] + in[1] * matrix[1*4+i] + in[2] * matrix[2*4+i] + @@ -242,7 +242,7 @@ static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { - r[i*4+j] = + r[i*4+j] = a[i*4+0]*b[0*4+j] + a[i*4+1]*b[1*4+j] + a[i*4+2]*b[2*4+j] + @@ -252,8 +252,8 @@ static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], } GLint GLAPIENTRY -gluProject(GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble modelMatrix[16], +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz) @@ -288,7 +288,7 @@ gluProject(GLdouble objx, GLdouble objy, GLdouble objz, GLint GLAPIENTRY gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, - const GLdouble modelMatrix[16], + const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz) @@ -327,10 +327,10 @@ gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, GLint GLAPIENTRY gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], + const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], - GLclampd nearVal, GLclampd farVal, + GLclampd nearVal, GLclampd farVal, GLdouble *objx, GLdouble *objy, GLdouble *objz, GLdouble *objw) { @@ -369,7 +369,7 @@ void GLAPIENTRY gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, GLint viewport[4]) { - if (deltax <= 0 || deltay <= 0) { + if (deltax <= 0 || deltay <= 0) { return; } diff --git a/reactos/dll/win32/glu32/libutil/registry.c b/reactos/dll/win32/glu32/libutil/registry.c index 56627a86406..2589dc0584a 100644 --- a/reactos/dll/win32/glu32/libutil/registry.c +++ b/reactos/dll/win32/glu32/libutil/registry.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -60,7 +60,7 @@ gluGetString(GLenum name) } /* extName is an extension name. - * extString is a string of extensions separated by blank(s). There may or + * extString is a string of extensions separated by blank(s). There may or * may not be leading or trailing blank(s) in extString. * This works in cases of extensions being prefixes of another like * GL_EXT_texture and GL_EXT_texture3D. @@ -76,7 +76,7 @@ gluCheckExtension(const GLubyte *extName, const GLubyte *extString) if (extString == NULL) return GL_FALSE; - deleteThis = lookHere = (char *)malloc(strlen((const char *)extString)+1); + deleteThis = lookHere = (char *)malloc(strlen((const char *)extString)+1); if (lookHere == NULL) return GL_FALSE; /* strtok() will modify string, so copy it somewhere */ @@ -86,7 +86,7 @@ gluCheckExtension(const GLubyte *extName, const GLubyte *extString) if (strcmp(word,(const char *)extName) == 0) { flag = GL_TRUE; break; - } + } lookHere = NULL; /* get next token */ } free((void *)deleteThis); diff --git a/reactos/dll/win32/hhctrl.ocx/Ko.rc b/reactos/dll/win32/hhctrl.ocx/Ko.rc index 05f7aafe8ba..e0f023f9ad7 100644 --- a/reactos/dll/win32/hhctrl.ocx/Ko.rc +++ b/reactos/dll/win32/hhctrl.ocx/Ko.rc @@ -4,7 +4,7 @@ * * Copyright 2005 James Hawkins * Copyright 2005 YunSong Hwang - + * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either diff --git a/reactos/dll/win32/hhctrl.ocx/chm.c b/reactos/dll/win32/hhctrl.ocx/chm.c index d65d766a18c..4c515cd2e99 100644 --- a/reactos/dll/win32/hhctrl.ocx/chm.c +++ b/reactos/dll/win32/hhctrl.ocx/chm.c @@ -235,7 +235,7 @@ BOOL LoadWinTypeFromCHM(CHMInfo *pChmInfo, HH_WINTYPEW *pHHWinType) pHHWinType->pszJump2 = strdupAtoW(GetChmString(pChmInfo, (DWORD)pHHWinType->pszJump2)); pHHWinType->pszUrlJump1 = strdupAtoW(GetChmString(pChmInfo, (DWORD)pHHWinType->pszUrlJump1)); pHHWinType->pszUrlJump2 = strdupAtoW(GetChmString(pChmInfo, (DWORD)pHHWinType->pszUrlJump2)); - + /* FIXME: pszCustomTabs is a list of multiple zero-terminated strings so ReadString won't * work in this case */ diff --git a/reactos/dll/win32/hhctrl.ocx/help.c b/reactos/dll/win32/hhctrl.ocx/help.c index 3bc9e8e6b62..82eabca8f4e 100644 --- a/reactos/dll/win32/hhctrl.ocx/help.c +++ b/reactos/dll/win32/hhctrl.ocx/help.c @@ -143,7 +143,7 @@ static void SB_OnPaint(HWND hWnd) PAINTSTRUCT ps; HDC hdc; RECT rc; - + hdc = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &rc); @@ -159,7 +159,7 @@ static void SB_OnPaint(HWND hWnd) LineTo(hdc, 1, 1); LineTo(hdc, 1, rc.bottom - 1); - + MoveToEx(hdc, 0, rc.bottom, NULL); LineTo(hdc, rc.right, rc.bottom); diff --git a/reactos/dll/win32/hid/hid.c b/reactos/dll/win32/hid/hid.c index f9e949568e1..fba669aa330 100644 --- a/reactos/dll/win32/hid/hid.c +++ b/reactos/dll/win32/hid/hid.c @@ -43,13 +43,13 @@ DllMain(HINSTANCE hinstDLL, case DLL_PROCESS_ATTACH: hDllInstance = hinstDLL; break; - + case DLL_THREAD_ATTACH: break; - + case DLL_THREAD_DETACH: break; - + case DLL_PROCESS_DETACH: break; } @@ -99,7 +99,7 @@ HidD_GetAttributes(IN HANDLE HidDeviceObject, { HID_COLLECTION_INFORMATION hci; DWORD RetLen; - + if(!DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &hci, sizeof(HID_COLLECTION_INFORMATION), @@ -107,13 +107,13 @@ HidD_GetAttributes(IN HANDLE HidDeviceObject, { return FALSE; } - + /* copy the fields */ Attributes->Size = sizeof(HIDD_ATTRIBUTES); Attributes->VendorID = hci.VendorID; Attributes->ProductID = hci.ProductID; Attributes->VersionNumber = hci.VersionNumber; - + return TRUE; } @@ -255,12 +255,12 @@ HidD_GetPreparsedData(IN HANDLE HidDeviceObject, HID_COLLECTION_INFORMATION hci; DWORD RetLen; BOOL Ret; - + if(PreparsedData == NULL) { return FALSE; } - + if(!DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &hci, sizeof(HID_COLLECTION_INFORMATION), @@ -268,14 +268,14 @@ HidD_GetPreparsedData(IN HANDLE HidDeviceObject, { return FALSE; } - + *PreparsedData = LocalAlloc(LHND, hci.DescriptorSize); if(*PreparsedData == NULL) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } - + Ret = DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, NULL, 0, *PreparsedData, hci.DescriptorSize, @@ -369,12 +369,12 @@ HidD_Hello(OUT PCHAR Buffer, IN ULONG BufferLength) { const CHAR HelloString[] = "Hello\n"; - + if(BufferLength > 0) { memcpy(Buffer, HelloString, min(sizeof(HelloString), BufferLength)); } - + return sizeof(HelloString); } diff --git a/reactos/dll/win32/hid/stubs.c b/reactos/dll/win32/hid/stubs.c index c085baaf112..744db42908a 100644 --- a/reactos/dll/win32/hid/stubs.c +++ b/reactos/dll/win32/hid/stubs.c @@ -325,7 +325,7 @@ HidP_SetData(IN HIDP_REPORT_TYPE ReportType, HIDAPI NTSTATUS DDKAPI HidP_SetScaledUsageValue(IN HIDP_REPORT_TYPE ReportType, - IN USAGE UsagePage, + IN USAGE UsagePage, IN USHORT LinkCollection OPTIONAL, IN USAGE Usage, IN LONG UsageValue, diff --git a/reactos/dll/win32/imagehlp/access.c b/reactos/dll/win32/imagehlp/access.c index 5935b1132fe..256f3127c4f 100644 --- a/reactos/dll/win32/imagehlp/access.c +++ b/reactos/dll/win32/imagehlp/access.c @@ -152,7 +152,7 @@ PLOADED_IMAGE IMAGEAPI ImageLoad(LPSTR DllName, LPSTR DllPath) /* Use the full untouched name */ strcpy(FullName, LoadedImage->ModuleName); } - + /* Check if the Names Match */ if (!_stricmp(DllName, FullName)) { @@ -230,19 +230,19 @@ BOOL IMAGEAPI MapAndLoad( /* Assume failure */ pLoadedImage->hFile = INVALID_HANDLE_VALUE; - + /* Start open loop */ while (TRUE) { /* Get a handle to the file */ - hFile = CreateFileA(FileToOpen, - ReadOnly ? GENERIC_READ : + hFile = CreateFileA(FileToOpen, + ReadOnly ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE, ReadOnly ? FILE_SHARE_READ : FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - 0, + NULL, + OPEN_EXISTING, + 0, NULL); if (hFile == INVALID_HANDLE_VALUE) @@ -277,11 +277,11 @@ BOOL IMAGEAPI MapAndLoad( /* Create the File Mapping */ hFileMapping = CreateFileMappingA(hFile, - NULL, + NULL, ReadOnly ? PAGE_READONLY : - PAGE_READWRITE, - 0, - 0, + PAGE_READWRITE, + 0, + 0, NULL); if (!hFileMapping) { @@ -296,7 +296,7 @@ BOOL IMAGEAPI MapAndLoad( ReadOnly ? FILE_MAP_READ : FILE_MAP_WRITE, 0, - 0, + 0, 0); /* Close the handle to the map, we don't need it anymore */ @@ -447,7 +447,7 @@ ImageDirectoryEntryToData32(PVOID Base, { /* No header found */ if (FoundHeader) *FoundHeader = NULL; - + /* And simply return the VA */ return (PVOID)((ULONG_PTR)Base + DirectoryEntryVA); } @@ -455,12 +455,12 @@ ImageDirectoryEntryToData32(PVOID Base, /* Read the first Section */ CurrentSection = (PIMAGE_SECTION_HEADER)((ULONG_PTR)OptionalHeader + FileHeader->SizeOfOptionalHeader); - + /* Loop through every section*/ for (i = 0; i < FileHeader->NumberOfSections; i++) - { + { /* If the Directory VA is located inside this section's VA, then this section belongs to this Directory */ - if ((DirectoryEntryVA >= CurrentSection->VirtualAddress) && + if ((DirectoryEntryVA >= CurrentSection->VirtualAddress) && (DirectoryEntryVA < (CurrentSection->VirtualAddress + CurrentSection->SizeOfRawData))) { @@ -494,7 +494,7 @@ GetTimestampForLoadedLibrary(HMODULE Module) /* * @implemented */ -PVOID +PVOID IMAGEAPI ImageDirectoryEntryToData(PVOID Base, BOOLEAN MappedAsImage, @@ -542,7 +542,7 @@ ImageDirectoryEntryToDataEx(IN PVOID Base, /* * @implemented */ -PIMAGE_SECTION_HEADER +PIMAGE_SECTION_HEADER IMAGEAPI ImageRvaToSection(IN PIMAGE_NT_HEADERS NtHeaders, IN PVOID Base, @@ -558,7 +558,7 @@ ImageRvaToSection(IN PIMAGE_NT_HEADERS NtHeaders, for (i = 0; i < NtHeaders->FileHeader.NumberOfSections; i++) { /* Check if the RVA is in between */ - if ((Rva >= Section->VirtualAddress) && + if ((Rva >= Section->VirtualAddress) && (Rva < (Section->VirtualAddress + Section->SizeOfRawData))) { /* Return this section */ @@ -587,8 +587,8 @@ ImageNtHeader(PVOID Base) /* * @implemented */ -PVOID -IMAGEAPI +PVOID +IMAGEAPI ImageRvaToVa(IN PIMAGE_NT_HEADERS NtHeaders, IN PVOID Base, IN ULONG Rva, diff --git a/reactos/dll/win32/imagehlp/integrity.c b/reactos/dll/win32/imagehlp/integrity.c index 00b5885300f..6399949750e 100644 --- a/reactos/dll/win32/imagehlp/integrity.c +++ b/reactos/dll/win32/imagehlp/integrity.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(imagehlp); static BOOL -IMAGEHLP_GetSecurityDirOffset(HANDLE handle, +IMAGEHLP_GetSecurityDirOffset(HANDLE handle, DWORD *pdwOfs, DWORD *pdwSize) { @@ -86,7 +86,7 @@ IMAGEHLP_GetSecurityDirOffset(HANDLE handle, /*********************************************************************** * IMAGEHLP_GetCertificateOffset (INTERNAL) * - * Read a file's PE header, and return the offset and size of the + * Read a file's PE header, and return the offset and size of the * security directory. */ static BOOL IMAGEHLP_GetCertificateOffset( HANDLE handle, DWORD num, @@ -223,7 +223,7 @@ BOOL IMAGEAPI ImageEnumerateCertificates( return FALSE; if( hdr.dwLength > (size-offset) ) return FALSE; - + if( (TypeFilter == CERT_SECTION_TYPE_ANY) || (TypeFilter == hdr.wCertificateType) ) { diff --git a/reactos/dll/win32/imm32/imm.c b/reactos/dll/win32/imm32/imm.c index b95b2572bd8..00161d62f10 100644 --- a/reactos/dll/win32/imm32/imm.c +++ b/reactos/dll/win32/imm32/imm.c @@ -970,7 +970,7 @@ LONG WINAPI ImmGetCompositionStringW( else { FIXME("Unhandled index 0x%x\n",dwIndex); - } + } ImmUnlockIMCC(data->IMC.hCompStr); diff --git a/reactos/dll/win32/iphlpapi/ifenum.h b/reactos/dll/win32/iphlpapi/ifenum.h index 79342ac432a..742ad5da8a7 100644 --- a/reactos/dll/win32/iphlpapi/ifenum.h +++ b/reactos/dll/win32/iphlpapi/ifenum.h @@ -140,7 +140,7 @@ DWORD getInterfaceEntryByIndex(DWORD index, PMIB_IFROW entry); char *toIPAddressString(unsigned int addr, char string[16]); /* add and delete IP addresses */ -NTSTATUS addIPAddress( IPAddr Address, IPMask Mask, DWORD IfIndex, +NTSTATUS addIPAddress( IPAddr Address, IPMask Mask, DWORD IfIndex, PULONG NteContext, PULONG NteInstance ); NTSTATUS deleteIpAddress( ULONG NteContext ); diff --git a/reactos/dll/win32/iphlpapi/ifenum_reactos.c b/reactos/dll/win32/iphlpapi/ifenum_reactos.c index 1fe6ba99c3b..b3066b13d36 100644 --- a/reactos/dll/win32/iphlpapi/ifenum_reactos.c +++ b/reactos/dll/win32/iphlpapi/ifenum_reactos.c @@ -22,9 +22,9 @@ * - This iphlpapi does not rely on any reactos-only features. * - This implementation is meant to be largely correct. I am not, however, * paying any attention to performance. It can be done faster, and - * someone should definately optimize this code when speed is more of a + * someone should definately optimize this code when speed is more of a * priority than it is now. - * + * * Edited implementation notes from the original -- Basically edited to add * information and prune things which are not accurate about this file. * Interface index fun: @@ -82,7 +82,7 @@ NTSTATUS openTcpFile(PHANDLE tcpFile) { NULL ); status = ZwCreateFile( tcpFile, - SYNCHRONIZE | GENERIC_EXECUTE | + SYNCHRONIZE | GENERIC_EXECUTE | GENERIC_READ | GENERIC_WRITE, &objectAttributes, &ioStatusBlock, @@ -121,7 +121,7 @@ void closeTcpFile( HANDLE h ) { * IPAddrEntry * IPInterfaceInfo */ -NTSTATUS tdiGetSetOfThings( HANDLE tcpFile, +NTSTATUS tdiGetSetOfThings( HANDLE tcpFile, DWORD toiClass, DWORD toiType, DWORD toiId, @@ -134,17 +134,17 @@ NTSTATUS tdiGetSetOfThings( HANDLE tcpFile, TCP_REQUEST_QUERY_INFORMATION_EX req = TCP_REQUEST_QUERY_INFORMATION_INIT; PVOID entitySet = 0; NTSTATUS status = STATUS_SUCCESS; - DWORD allocationSizeForEntityArray = entrySize * MAX_TDI_ENTITIES, + DWORD allocationSizeForEntityArray = entrySize * MAX_TDI_ENTITIES, arraySize = entrySize * MAX_TDI_ENTITIES; TRACE("TdiGetSetOfThings(tcpFile %x,toiClass %x,toiType %x,toiId %x," "teiEntity %x,fixedPart %d,entrySize %d)\n", - (int)tcpFile, - (int)toiClass, - (int)toiType, - (int)toiId, + (int)tcpFile, + (int)toiClass, + (int)toiType, + (int)toiId, (int)teiEntity, - (int)fixedPart, + (int)fixedPart, (int)entrySize ); req.ID.toi_class = toiClass; @@ -177,10 +177,10 @@ NTSTATUS tdiGetSetOfThings( HANDLE tcpFile, ERR("IOCTL Failed\n"); return STATUS_UNSUCCESSFUL; } - + arraySize = allocationSizeForEntityArray; entitySet = HeapAlloc( GetProcessHeap(), 0, arraySize ); - + if( !entitySet ) { status = STATUS_INSUFFICIENT_RESOURCES; WARN("TdiGetSetOfThings() => %08x\n", (int)status); @@ -195,7 +195,7 @@ NTSTATUS tdiGetSetOfThings( HANDLE tcpFile, arraySize, &allocationSizeForEntityArray, NULL ); - + /* This is why we have the loop -- we might have added an adapter */ if( arraySize == allocationSizeForEntityArray ) break; @@ -211,13 +211,13 @@ NTSTATUS tdiGetSetOfThings( HANDLE tcpFile, WARN("TdiGetSetOfThings(): Array changed size: %d -> %d.\n", arraySize, allocationSizeForEntityArray ); - } while( TRUE ); /* We break if the array we received was the size we + } while( TRUE ); /* We break if the array we received was the size we * expected. Therefore, we got here because it wasn't */ - + *numEntries = (arraySize - fixedPart) / entrySize; *tdiEntitySet = entitySet; - WARN("TdiGetSetOfThings() => Success: %d things @ %08x\n", + WARN("TdiGetSetOfThings() => Success: %d things @ %08x\n", (int)*numEntries, (int)entitySet); return STATUS_SUCCESS; @@ -277,12 +277,12 @@ NTSTATUS tdiGetMibForIfEntity entry->ent.if_physaddr[5] & 0xff, entry->ent.if_descr); TRACE("} status %08x\n",status); - - return status; + + return status; } NTSTATUS tdiGetEntityIDSet( HANDLE tcpFile, - TDIEntityID **entitySet, + TDIEntityID **entitySet, PDWORD numEntities ) { NTSTATUS status = tdiGetSetOfThings( tcpFile, INFO_CLASS_GENERIC, @@ -300,16 +300,16 @@ NTSTATUS tdiGetEntityIDSet( HANDLE tcpFile, for( i = 0; i < *numEntities; i++ ) { TRACE("%-4d: %04x:%08x\n", i, - (*entitySet)[i].tei_entity, + (*entitySet)[i].tei_entity, (*entitySet)[i].tei_instance ); } } - + return status; } BOOL isInterface( TDIEntityID *if_maybe ) { - return + return if_maybe->tei_entity == IF_ENTITY; } @@ -317,11 +317,11 @@ static BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe ) { IFEntrySafelySized entryInfo; NTSTATUS status; - status = tdiGetMibForIfEntity( tcpFile, + status = tdiGetMibForIfEntity( tcpFile, loop_maybe, &entryInfo ); - return NT_SUCCESS(status) && (!entryInfo.ent.if_type || + return NT_SUCCESS(status) && (!entryInfo.ent.if_type || entryInfo.ent.if_type == IFENT_SOFTWARE_LOOPBACK); } @@ -377,7 +377,7 @@ BOOL hasArp( HANDLE tcpFile, TDIEntityID *arp_maybe ) { return type == AT_ENTITY; } -static NTSTATUS getInterfaceInfoSet( HANDLE tcpFile, +static NTSTATUS getInterfaceInfoSet( HANDLE tcpFile, IFInfo **infoSet, PDWORD numInterfaces ) { DWORD numEntities; @@ -392,9 +392,9 @@ static NTSTATUS getInterfaceInfoSet( HANDLE tcpFile, return status; } - infoSetInt = HeapAlloc( GetProcessHeap(), 0, + infoSetInt = HeapAlloc( GetProcessHeap(), 0, sizeof(IFInfo) * numEntities ); - + if( infoSetInt ) { for( i = 0; i < numEntities; i++ ) { if( isInterface( &entIDSet[i] ) ) { @@ -417,7 +417,7 @@ static NTSTATUS getInterfaceInfoSet( HANDLE tcpFile, ( tcpFile, &ip_ent, &addrs, &numAddrs ); for( j = 0; j < numAddrs && NT_SUCCESS(status); j++ ) { TRACE("ADDR %d: index %d (target %d)\n", j, addrs[j].iae_index, infoSetInt[curInterf].if_info.ent.if_index); - if( addrs[j].iae_index == + if( addrs[j].iae_index == infoSetInt[curInterf].if_info.ent.if_index ) { memcpy( &infoSetInt[curInterf].ip_addr, &addrs[j], @@ -467,18 +467,18 @@ static DWORD getNumInterfacesInt(BOOL onlyNonLoopback) for( i = 0; i < numEntities; i++ ) { if( isInterface( &entitySet[i] ) && - (!onlyNonLoopback || + (!onlyNonLoopback || (onlyNonLoopback && !isLoopback( tcpFile, &entitySet[i] ))) ) numInterfaces++; } - TRACE("getNumInterfaces: success: %d %d %08x\n", + TRACE("getNumInterfaces: success: %d %d %08x\n", onlyNonLoopback, numInterfaces, status ); closeTcpFile( tcpFile ); tdiFreeThingSet( entitySet ); - + return numInterfaces; } @@ -509,7 +509,7 @@ DWORD getNthInterfaceEntity( HANDLE tcpFile, DWORD index, TDIEntityID *ent ) { } } - TRACE("Index %d is entity #%d - %04x:%08x\n", index, i, + TRACE("Index %d is entity #%d - %04x:%08x\n", index, i, entitySet[i].tei_entity, entitySet[i].tei_instance ); if( numInterfaces == index && i < numEntities ) { @@ -527,7 +527,7 @@ NTSTATUS getInterfaceInfoByIndex( HANDLE tcpFile, DWORD index, IFInfo *info ) { DWORD numInterfaces; NTSTATUS status = getInterfaceInfoSet( tcpFile, &ifInfo, &numInterfaces ); int i; - + if( NT_SUCCESS(status) ) for( i = 0; i < numInterfaces; i++ ) { if( ifInfo[i].if_info.ent.if_index == index ) { @@ -541,13 +541,13 @@ NTSTATUS getInterfaceInfoByIndex( HANDLE tcpFile, DWORD index, IFInfo *info ) { else return status; } - + NTSTATUS getInterfaceInfoByName( HANDLE tcpFile, char *name, IFInfo *info ) { IFInfo *ifInfo; DWORD numInterfaces; - int i; + int i; NTSTATUS status = getInterfaceInfoSet( tcpFile, &ifInfo, &numInterfaces ); - + if( NT_SUCCESS(status) ) for( i = 0; i < numInterfaces; i++ ) { if( !strcmp(ifInfo[i].if_info.ent.if_descr, name) ) { @@ -555,13 +555,13 @@ NTSTATUS getInterfaceInfoByName( HANDLE tcpFile, char *name, IFInfo *info ) { break; } } - + if( NT_SUCCESS(status) ) return i < numInterfaces ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; else return status; } - + /* Note that the result of this operation must be freed later */ const char *getInterfaceNameByIndex(DWORD index) @@ -573,14 +573,14 @@ const char *getInterfaceNameByIndex(DWORD index) if( NT_SUCCESS(status) ) { status = getInterfaceInfoByIndex( tcpFile, index, &ifInfo ); - + if( NT_SUCCESS(status) ) { adapter_name = ifInfo.if_info.ent.if_descr; - - interfaceName = HeapAlloc( GetProcessHeap(), 0, + + interfaceName = HeapAlloc( GetProcessHeap(), 0, strlen(adapter_name) + 1 ); strcpy( interfaceName, adapter_name ); - + closeTcpFile( tcpFile ); } } @@ -600,7 +600,7 @@ DWORD getInterfaceIndexByName(const char *name, PDWORD index) if( NT_SUCCESS(status) ) { status = getInterfaceInfoByName( tcpFile, (char *)name, &ifInfo ); - + if( NT_SUCCESS(status) ) { *index = ifInfo.if_info.ent.if_index; closeTcpFile( tcpFile ); @@ -621,39 +621,39 @@ InterfaceIndexTable *getInterfaceIndexTableInt( BOOL nonLoopbackOnly ) { if( NT_SUCCESS(status) ) { status = getInterfaceInfoSet( tcpFile, &ifInfo, &numInterfaces ); - TRACE("InterfaceInfoSet: %08x, %04x:%08x\n", - status, + TRACE("InterfaceInfoSet: %08x, %04x:%08x\n", + status, ifInfo->entity_id.tei_entity, ifInfo->entity_id.tei_instance); if( NT_SUCCESS(status) ) { ret = (InterfaceIndexTable *) calloc(1, - sizeof(InterfaceIndexTable) + + sizeof(InterfaceIndexTable) + (numInterfaces - 1) * sizeof(DWORD)); - + if (ret) { ret->numAllocated = numInterfaces; TRACE("NumInterfaces = %d\n", numInterfaces); - + for( i = 0; i < numInterfaces; i++ ) { TRACE("Examining interface %d\n", i); - if( !nonLoopbackOnly || + if( !nonLoopbackOnly || !isLoopback( tcpFile, &ifInfo[i].entity_id ) ) { TRACE("Interface %d matches (%d)\n", i, curInterface); - ret->indexes[curInterface++] = + ret->indexes[curInterface++] = ifInfo[i].if_info.ent.if_index; } - } + } ret->numIndexes = curInterface; } - + tdiFreeThingSet( ifInfo ); } closeTcpFile( tcpFile ); } - + return ret; } @@ -670,12 +670,12 @@ DWORD getInterfaceIPAddrByName(const char *name) return INADDR_ANY; } -NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile, +NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile, char *name, DWORD index, IFInfo *ifInfo) { - NTSTATUS status = - name ? + NTSTATUS status = + name ? getInterfaceInfoByName( tcpFile, name, ifInfo ) : getInterfaceInfoByIndex( tcpFile, index, ifInfo ); @@ -709,7 +709,7 @@ DWORD getAddrByIndexOrName( char *name, DWORD index, IPHLPAddrType addrType ) { } return addrOut; -} +} DWORD getInterfaceIPAddrByIndex(DWORD index) { return getAddrByIndexOrName( 0, index, IPAAddr ); @@ -731,7 +731,7 @@ DWORD getInterfaceMaskByIndex(DWORD index) { return getAddrByIndexOrName( 0, index, IPAMask ); } -void getInterfacePhysicalFromInfo( IFInfo *info, +void getInterfacePhysicalFromInfo( IFInfo *info, PDWORD len, PBYTE addr, PDWORD type ) { *len = info->if_info.ent.if_physaddrlen; memcpy( addr, info->if_info.ent.if_physaddr, *len ); @@ -747,7 +747,7 @@ DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr, if( NT_SUCCESS(status) ) { status = getInterfaceInfoByName( tcpFile, (char *)name, &info ); - if( NT_SUCCESS(status) ) + if( NT_SUCCESS(status) ) getInterfacePhysicalFromInfo( &info, len, addr, type ); closeTcpFile( tcpFile ); } @@ -764,7 +764,7 @@ DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr, if( NT_SUCCESS(status) ) { status = getInterfaceInfoByIndex( tcpFile, index, &info ); - if( NT_SUCCESS(status) ) + if( NT_SUCCESS(status) ) getInterfacePhysicalFromInfo( &info, len, addr, type ); closeTcpFile( tcpFile ); } @@ -803,13 +803,13 @@ DWORD getInterfaceEntryByName(const char *name, PMIB_IFROW entry) if( NT_SUCCESS(status) ) { status = getInterfaceInfoByName( tcpFile, (char *)name, &info ); - + if( NT_SUCCESS(status) ) { memcpy( &entry->wszName[MAX_INTERFACE_NAME_LEN], &info.if_info, sizeof(info.if_info) ); } - + TRACE("entry->bDescr = %s\n", entry->bDescr); closeTcpFile( tcpFile ); @@ -828,13 +828,13 @@ DWORD getInterfaceEntryByIndex(DWORD index, PMIB_IFROW entry) if( NT_SUCCESS(status) ) { status = getInterfaceInfoByIndex( tcpFile, index, &info ); - + if( NT_SUCCESS(status) ) { memcpy( &entry->wszName[MAX_INTERFACE_NAME_LEN], &info.if_info, sizeof(info.if_info) ); } - + closeTcpFile( tcpFile ); } @@ -854,8 +854,8 @@ char *toIPAddressString(unsigned int addr, char string[16]) return string; } -NTSTATUS addIPAddress( IPAddr Address, IPMask Mask, DWORD IfIndex, - PULONG NteContext, PULONG NteInstance ) +NTSTATUS addIPAddress( IPAddr Address, IPMask Mask, DWORD IfIndex, + PULONG NteContext, PULONG NteInstance ) { HANDLE tcpFile; NTSTATUS status = openTcpFile( &tcpFile ); @@ -863,17 +863,17 @@ NTSTATUS addIPAddress( IPAddr Address, IPMask Mask, DWORD IfIndex, IO_STATUS_BLOCK Iosb; TRACE("Called.\n"); - + if( !NT_SUCCESS(status) ) return status; Data.NteContext = IfIndex; Data.NewAddress = Address; Data.NewNetmask = Mask; - status = NtDeviceIoControlFile( tcpFile, + status = NtDeviceIoControlFile( tcpFile, + NULL, NULL, NULL, - NULL, &Iosb, IOCTL_SET_IP_ADDRESS, &Data, @@ -882,7 +882,7 @@ NTSTATUS addIPAddress( IPAddr Address, IPMask Mask, DWORD IfIndex, sizeof(Data) ); closeTcpFile( tcpFile ); - + if( NT_SUCCESS(status) ) { *NteContext = Iosb.Information; *NteInstance = Data.NewAddress; @@ -896,20 +896,20 @@ NTSTATUS addIPAddress( IPAddr Address, IPMask Mask, DWORD IfIndex, } -NTSTATUS deleteIpAddress( ULONG NteContext ) +NTSTATUS deleteIpAddress( ULONG NteContext ) { HANDLE tcpFile; NTSTATUS status = openTcpFile( &tcpFile ); IO_STATUS_BLOCK Iosb; TRACE("Called.\n"); - + if( !NT_SUCCESS(status) ) return status; - status = NtDeviceIoControlFile( tcpFile, + status = NtDeviceIoControlFile( tcpFile, + NULL, NULL, NULL, - NULL, &Iosb, IOCTL_DELETE_IP_ADDRESS, &NteContext, diff --git a/reactos/dll/win32/iphlpapi/iphlpapi_main.c b/reactos/dll/win32/iphlpapi/iphlpapi_main.c index 433b3953cc0..19190b292f1 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi_main.c +++ b/reactos/dll/win32/iphlpapi/iphlpapi_main.c @@ -620,11 +620,11 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen) for (ndx = 0; ndx < table->numIndexes; ndx++) { PIP_ADAPTER_INFO ptr = &pAdapterInfo[ndx]; DWORD addrLen = sizeof(ptr->Address), type; - const char *ifname = + const char *ifname = getInterfaceNameByIndex(table->indexes[ndx]); /* on Win98 this is left empty, but whatever */ - + strncpy(ptr->AdapterName,ifname,sizeof(ptr->AdapterName)); consumeInterfaceName(ifname); ptr->AdapterName[MAX_ADAPTER_NAME_LENGTH] = '\0'; @@ -1131,7 +1131,7 @@ static int IpForwardTableSorter(const void *a, const void *b) DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder) { DWORD ret; - + TRACE("pIpForwardTable %p, pdwSize %p, bOrder %ld\n", pIpForwardTable, pdwSize, (DWORD)bOrder); if (!pdwSize) @@ -1244,7 +1244,7 @@ DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOr if (!pIpNetTable || *pdwSize < size) { *pdwSize = size; ret = ERROR_INSUFFICIENT_BUFFER; - } + } else { PMIB_IPNETTABLE table = getArpTable(); @@ -1341,7 +1341,7 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen) return ERROR_INVALID_PARAMETER; resInfo = getResInfo(); - if (!resInfo) + if (!resInfo) return ERROR_OUTOFMEMORY; size = sizeof(FIXED_INFO) + (resInfo->riCount > 0 ? (resInfo->riCount - 1) * @@ -1366,7 +1366,7 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen) for (i = 0, ptr = &pFixedInfo->DnsServerList; i < resInfo->riCount && ptr; i++, ptr = ptr->Next) { - struct sockaddr_in *addr_v4 = + struct sockaddr_in *addr_v4 = (struct sockaddr_in *)&resInfo->riAddressList[i]; toIPAddressString (addr_v4->sin_addr.s_addr, diff --git a/reactos/dll/win32/iphlpapi/iphlpapi_private.h b/reactos/dll/win32/iphlpapi/iphlpapi_private.h index 29b28b03bd2..00435302941 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi_private.h +++ b/reactos/dll/win32/iphlpapi/iphlpapi_private.h @@ -70,9 +70,9 @@ typedef struct _IPRouteEntry { ULONG ire_metric3; ULONG ire_metric4; ULONG ire_gw; - ULONG ire_type; + ULONG ire_type; ULONG ire_proto; - ULONG ire_age; + ULONG ire_age; ULONG ire_mask; ULONG ire_metric5; ULONG ire_info; @@ -82,17 +82,17 @@ typedef struct _IPRouteEntry { typedef char *caddr_t; typedef union _IFEntrySafelySized { - CHAR MaxSize[sizeof(DWORD) + - sizeof(IFEntry) + + CHAR MaxSize[sizeof(DWORD) + + sizeof(IFEntry) + MAX_ADAPTER_DESCRIPTION_LENGTH + 1]; IFEntry ent; } IFEntrySafelySized; typedef union _TCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED { - CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1 + + CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1 + sizeof(IPRouteEntry)]; TCP_REQUEST_SET_INFORMATION_EX Req; -} TCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED, +} TCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED, *PTCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED; /* Encapsulates information about an interface */ @@ -120,7 +120,7 @@ NTSTATUS tdiGetEntityIDSet( HANDLE tcpFile, TDIEntityID **entitySet, NTSTATUS tdiGetSetOfThings( HANDLE tcpFile, DWORD toiClass, DWORD toiType, DWORD toiId, DWORD teiEntity, DWORD teiInstance, DWORD fixedPart, - DWORD entrySize, PVOID *tdiEntitySet, + DWORD entrySize, PVOID *tdiEntitySet, PDWORD numEntries ); VOID tdiFreeThingSet( PVOID things ); NTSTATUS getNthIpEntity( HANDLE tcpFile, DWORD index, TDIEntityID *ent ); diff --git a/reactos/dll/win32/iphlpapi/ipstats_reactos.c b/reactos/dll/win32/iphlpapi/ipstats_reactos.c index 14a3ab3d8c8..b9f60da526b 100644 --- a/reactos/dll/win32/iphlpapi/ipstats_reactos.c +++ b/reactos/dll/win32/iphlpapi/ipstats_reactos.c @@ -65,14 +65,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); BOOL isIpEntity( HANDLE tcpFile, TDIEntityID *ent ) { DWORD entityType, returnedLen; NTSTATUS status; - TCP_REQUEST_QUERY_INFORMATION_EX req; + TCP_REQUEST_QUERY_INFORMATION_EX req; req.ID.toi_class = INFO_CLASS_GENERIC; req.ID.toi_type = INFO_TYPE_PROVIDER; req.ID.toi_id = ENTITY_TYPE_ID; req.ID.toi_entity = *ent; - status = + status = DeviceIoControl ( tcpFile, IOCTL_TCP_QUERY_INFORMATION_EX, @@ -83,7 +83,7 @@ BOOL isIpEntity( HANDLE tcpFile, TDIEntityID *ent ) { &returnedLen, NULL ); - TRACE("Ent: %04x:d -> %04x\n", + TRACE("Ent: %04x:d -> %04x\n", ent->tei_entity, ent->tei_instance, entityType ); return NT_SUCCESS(status) && entityType == CL_NL_IP; @@ -108,7 +108,7 @@ NTSTATUS getNthIpEntity( HANDLE tcpFile, DWORD index, TDIEntityID *ent ) { } if( numRoutes == index && i < numEntities ) { - TRACE("Index %d is entity #%d - %04x:%08x\n", index, i, + TRACE("Index %d is entity #%d - %04x:%08x\n", index, i, entitySet[i].tei_entity, entitySet[i].tei_instance ); memcpy( ent, &entitySet[i], sizeof(*ent) ); tdiFreeThingSet( entitySet ); @@ -169,8 +169,8 @@ NTSTATUS tdiGetMibForIpEntity entry->ipsi_numaddr, entry->ipsi_numroutes, status); - - return status; + + return status; } NTSTATUS tdiGetRoutesForIpEntity @@ -191,7 +191,7 @@ NTSTATUS tdiGetRoutesForIpEntity (PVOID *)routes, numRoutes); - return status; + return status; } NTSTATUS tdiGetIpAddrsForIpEntity @@ -201,8 +201,8 @@ NTSTATUS tdiGetIpAddrsForIpEntity TRACE("TdiGetIpAddrsForIpEntity(tcpFile %x,entityId %x)\n", (DWORD)tcpFile, ent->tei_instance); - status = tdiGetSetOfThings( tcpFile, - INFO_CLASS_PROTOCOL, + status = tdiGetSetOfThings( tcpFile, + INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_ADDRTABLE_ENTRY_ID, ent->tei_entity, @@ -212,7 +212,7 @@ NTSTATUS tdiGetIpAddrsForIpEntity (PVOID *)addrs, numAddrs ); - return status; + return status; } DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry) @@ -455,10 +455,10 @@ RouteTable *getRouteTable(void) TRACE("GETTING ROUTE TABLE\n"); - out_route_table = HeapAlloc( GetProcessHeap(), 0, - sizeof(RouteTable) + + out_route_table = HeapAlloc( GetProcessHeap(), 0, + sizeof(RouteTable) + (sizeof(RouteEntry) * (numRoutes - 1)) ); - + out_route_table->numRoutes = numRoutes; for( i = 0; routesAdded < numRoutes; i++ ) { @@ -480,14 +480,14 @@ RouteTable *getRouteTable(void) TRACE("Route set returned\n"); #if 0 - HexDump( route_set, - sizeof( IPRouteEntry ) * + HexDump( route_set, + sizeof( IPRouteEntry ) * snmpInfo.ipsi_numroutes ); #endif for( j = 0; j < snmpInfo.ipsi_numroutes; j++ ) { int routeNum = j + routesAdded; - out_route_table->routes[routeNum].dest = + out_route_table->routes[routeNum].dest = route_set[j].ire_dest; out_route_table->routes[routeNum].mask = route_set[j].ire_mask; @@ -531,7 +531,7 @@ DWORD getNumArpEntries(void) status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities ); for( i = 0; i < numEntities; i++ ) { - if( isInterface( &entitySet[i] ) && + if( isInterface( &entitySet[i] ) && hasArp( tcpFile, &entitySet[i] ) ) { status = tdiGetSetOfThings( tcpFile, @@ -578,13 +578,13 @@ PMIB_IPNETTABLE getArpTable(void) } IpArpTable = HeapAlloc - ( GetProcessHeap(), 0, + ( GetProcessHeap(), 0, sizeof(DWORD) + (sizeof(MIB_IPNETROW) * totalNumber) ); status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities ); for( i = 0; i < numEntities; i++ ) { - if( isIpEntity( tcpFile, &entitySet[i] ) && + if( isIpEntity( tcpFile, &entitySet[i] ) && hasArp( tcpFile, &entitySet[i] ) ) { status = tdiGetSetOfThings( tcpFile, diff --git a/reactos/dll/win32/iphlpapi/registry.c b/reactos/dll/win32/iphlpapi/registry.c index 0cbc212ba8f..85433ec94b8 100644 --- a/reactos/dll/win32/iphlpapi/registry.c +++ b/reactos/dll/win32/iphlpapi/registry.c @@ -6,29 +6,29 @@ int GetLongestChildKeyName( HANDLE RegHandle ) { LONG Status; DWORD MaxAdapterName; - Status = RegQueryInfoKeyW(RegHandle, - NULL, - NULL, - NULL, - NULL, - &MaxAdapterName, - NULL, - NULL, - NULL, - NULL, - NULL, + Status = RegQueryInfoKeyW(RegHandle, + NULL, + NULL, + NULL, + NULL, + &MaxAdapterName, + NULL, + NULL, + NULL, + NULL, + NULL, NULL); - if (Status == ERROR_SUCCESS) + if (Status == ERROR_SUCCESS) return MaxAdapterName + 1; else return -1; } -LONG OpenChildKeyRead( HANDLE RegHandle, - PWCHAR ChildKeyName, +LONG OpenChildKeyRead( HANDLE RegHandle, + PWCHAR ChildKeyName, PHKEY ReturnHandle ) { - return RegOpenKeyExW( RegHandle, - ChildKeyName, + return RegOpenKeyExW( RegHandle, + ChildKeyName, 0, KEY_READ, ReturnHandle ); @@ -51,7 +51,7 @@ PWCHAR GetNthChildKeyName( HANDLE RegHandle, DWORD n ) { ValueLen = MaxAdapterName; Value = (PWCHAR)HeapAlloc( GetProcessHeap(), 0, MaxAdapterName ); - Status = RegEnumKeyExW( RegHandle, n, Value, &ValueLen, + Status = RegEnumKeyExW( RegHandle, n, Value, &ValueLen, NULL, NULL, NULL, NULL ); if (Status != ERROR_SUCCESS) return 0; @@ -68,13 +68,13 @@ void ConsumeChildKeyName( PWCHAR Name ) { PWCHAR QueryRegistryValueString( HANDLE RegHandle, PWCHAR ValueName ) { PWCHAR Name; DWORD ReturnedSize = 0; - - if (RegQueryValueExW( RegHandle, ValueName, NULL, NULL, NULL, + + if (RegQueryValueExW( RegHandle, ValueName, NULL, NULL, NULL, &ReturnedSize ) != 0) { return 0; } else { Name = malloc( ReturnedSize ); - RegQueryValueExW( RegHandle, ValueName, NULL, NULL, (PVOID)Name, + RegQueryValueExW( RegHandle, ValueName, NULL, NULL, (PVOID)Name, &ReturnedSize ); return Name; } diff --git a/reactos/dll/win32/iphlpapi/resinfo.c b/reactos/dll/win32/iphlpapi/resinfo.c index 39c213bda03..5dd612872a7 100644 --- a/reactos/dll/win32/iphlpapi/resinfo.c +++ b/reactos/dll/win32/iphlpapi/resinfo.c @@ -20,7 +20,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 "config.h" #include "iphlpapi_private.h" diff --git a/reactos/dll/win32/iphlpapi/resinfo.h b/reactos/dll/win32/iphlpapi/resinfo.h index be71202c582..415f39eb5ce 100644 --- a/reactos/dll/win32/iphlpapi/resinfo.h +++ b/reactos/dll/win32/iphlpapi/resinfo.h @@ -1,5 +1,5 @@ /* - * iphlpapi dll implementation -- Resolver information helper function + * iphlpapi dll implementation -- Resolver information helper function * prototypes * * Copyright (C) 2004 Art Yerkes diff --git a/reactos/dll/win32/iphlpapi/resinfo_reactos.c b/reactos/dll/win32/iphlpapi/resinfo_reactos.c index 2bafbc35836..fa2df5cc45d 100644 --- a/reactos/dll/win32/iphlpapi/resinfo_reactos.c +++ b/reactos/dll/win32/iphlpapi/resinfo_reactos.c @@ -20,7 +20,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 "config.h" #include "iphlpapi_private.h" @@ -98,7 +98,7 @@ typedef VOID (*EnumInterfacesFunc)( HKEY ChildKeyHandle, static void EnumInterfaces( PVOID Data, EnumInterfacesFunc cb ) { HKEY RegHandle; HKEY ChildKeyHandle = 0; - PWCHAR RegKeyToEnumerate = + PWCHAR RegKeyToEnumerate = L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces"; PWCHAR ChildKeyName = 0; DWORD CurrentInterface; @@ -125,7 +125,7 @@ static void EnumInterfaces( PVOID Data, EnumInterfacesFunc cb ) { static void EnumNameServers( HANDLE RegHandle, PWCHAR Interface, PVOID Data, EnumNameServersFunc cb ) { - PWCHAR NameServerString = + PWCHAR NameServerString = QueryRegistryValueString(RegHandle, L"NameServer"); /* Now, count the non-empty comma separated */ if (NameServerString) { @@ -134,7 +134,7 @@ static void EnumNameServers( HANDLE RegHandle, PWCHAR Interface, for (ch = 0; NameServerString[ch]; ch++) { if (NameServerString[ch] == ',') { if (ch - LastNameStart > 0) { /* Skip empty entries */ - PWCHAR NameServer = + PWCHAR NameServer = malloc(ch - LastNameStart + 1); if (NameServer) { memcpy(NameServer,NameServerString + LastNameStart, @@ -143,7 +143,7 @@ static void EnumNameServers( HANDLE RegHandle, PWCHAR Interface, cb( Interface, NameServer, Data ); free(NameServer); } - } + } LastNameStart = ch + 1; /* The first one after the comma */ } } @@ -178,7 +178,7 @@ static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server, PVOID _Data ) { PNAME_SERVER_LIST_PRIVATE Data = (PNAME_SERVER_LIST_PRIVATE)_Data; - RtlUnicodeToMultiByteN((PCHAR)&Data->AddrString[Data->CurrentName], + RtlUnicodeToMultiByteN((PCHAR)&Data->AddrString[Data->CurrentName], sizeof(Data->AddrString[0]), NULL, Server, @@ -212,31 +212,31 @@ PIPHLP_RES_INFO getResInfo() { NAME_SERVER_LIST_PRIVATE PrivateNSEnum = { 0 }; PIPHLP_RES_INFO ResInfo; struct sockaddr_in *AddrList; - + ServerCount = CountNameServers( &PrivateNSEnum ); - - errCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE, + + errCode = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\" "Parameters", 0, KEY_READ, &hKey); if (errCode != ERROR_SUCCESS) { RegCloseKey( hKey ); return NULL; } - + Str = QueryRegistryValueString( hKey, L"NameServer" ); ExtraServer = Str ? 1 : 0; ServerCount += ExtraServer; PrivateNSEnum.NumServers = ServerCount; - PrivateNSEnum.AddrString = + PrivateNSEnum.AddrString = (PIP_ADDRESS_STRING) - RtlAllocateHeap( GetProcessHeap(), 0, + RtlAllocateHeap( GetProcessHeap(), 0, ServerCount * sizeof(IP_ADDRESS_STRING) ); - ResInfo = + ResInfo = (PIPHLP_RES_INFO)RtlAllocateHeap - ( GetProcessHeap(), 0, + ( GetProcessHeap(), 0, sizeof(IPHLP_RES_INFO) + (ServerCount * sizeof(struct sockaddr_in)) ); @@ -256,12 +256,12 @@ PIPHLP_RES_INFO getResInfo() { if( ExtraServer ) { ULONG ResultSize; - for( ResultSize = 0; Str[ResultSize]; ResultSize++ ) + for( ResultSize = 0; Str[ResultSize]; ResultSize++ ) ((PCHAR)&AddrString)[ResultSize] = Str[ResultSize]; ((PCHAR)&AddrString)[ResultSize] = 0; ResInfo->riAddressList[0].sin_family = AF_INET; - ResInfo->riAddressList[0].sin_addr.s_addr = + ResInfo->riAddressList[0].sin_addr.s_addr = inet_addr( (PCHAR)&AddrString ); ResInfo->riAddressList[0].sin_port = 0; ConsumeRegValueString( Str ); @@ -270,11 +270,11 @@ PIPHLP_RES_INFO getResInfo() { for( i = ExtraServer; i < ServerCount; i++ ) { /* Hmm seems that dns servers are always AF_INET but ... */ ResInfo->riAddressList[i].sin_family = AF_INET; - ResInfo->riAddressList[i].sin_addr.s_addr = + ResInfo->riAddressList[i].sin_addr.s_addr = inet_addr( (PCHAR)&PrivateNSEnum.AddrString[i - ExtraServer] ); ResInfo->riAddressList[i].sin_port = 0; } - + RtlFreeHeap( GetProcessHeap(), 0, PrivateNSEnum.AddrString ); RegCloseKey( hKey ); diff --git a/reactos/dll/win32/iphlpapi/route.c b/reactos/dll/win32/iphlpapi/route.c index 1d67b9ff98a..ec6b69cb724 100644 --- a/reactos/dll/win32/iphlpapi/route.c +++ b/reactos/dll/win32/iphlpapi/route.c @@ -20,7 +20,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 "config.h" #include "iphlpapi_private.h" @@ -53,7 +53,7 @@ DWORD createIpForwardEntry( PMIB_IPFORWARDROW pRoute ) { TRACE("pRoute %p\n", pRoute); /* could use SIOCADDRT, not sure I want to */ FIXME(":stub\n"); - return (DWORD) 0; + return (DWORD) 0; } DWORD setIpForwardEntry( PMIB_IPFORWARDROW pRoute ) { diff --git a/reactos/dll/win32/iphlpapi/route_reactos.c b/reactos/dll/win32/iphlpapi/route_reactos.c index 3fc960e2c0d..3d8e565b181 100644 --- a/reactos/dll/win32/iphlpapi/route_reactos.c +++ b/reactos/dll/win32/iphlpapi/route_reactos.c @@ -20,7 +20,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 "config.h" #include "iphlpapi_private.h" @@ -55,12 +55,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); DWORD createIpForwardEntry( PMIB_IPFORWARDROW pRoute ) { HANDLE tcpFile = INVALID_HANDLE_VALUE; NTSTATUS status = openTcpFile( &tcpFile ); - TCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED req = + TCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED req = TCP_REQUEST_SET_INFORMATION_INIT; IPRouteEntry *rte; TDIEntityID id; DWORD returnSize = 0; - + TRACE("Called.\n"); if( NT_SUCCESS(status) ) @@ -72,7 +72,7 @@ DWORD createIpForwardEntry( PMIB_IPFORWARDROW pRoute ) { req.Req.ID.toi_id = IP_MIB_ROUTETABLE_ENTRY_ID; req.Req.ID.toi_entity = id; req.Req.BufferSize = sizeof(*rte); - rte = + rte = (IPRouteEntry *)&req.Req.Buffer[0]; // dwForwardPolicy @@ -119,12 +119,12 @@ DWORD setIpForwardEntry( PMIB_IPFORWARDROW pRoute ) { DWORD deleteIpForwardEntry( PMIB_IPFORWARDROW pRoute ) { HANDLE tcpFile = INVALID_HANDLE_VALUE; NTSTATUS status = openTcpFile( &tcpFile ); - TCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED req = + TCP_REQUEST_SET_INFORMATION_EX_SAFELY_SIZED req = TCP_REQUEST_SET_INFORMATION_INIT; IPRouteEntry *rte; TDIEntityID id; DWORD returnSize = 0; - + TRACE("Called.\n"); if( NT_SUCCESS(status) ) @@ -136,7 +136,7 @@ DWORD deleteIpForwardEntry( PMIB_IPFORWARDROW pRoute ) { req.Req.ID.toi_id = IP_MIB_ROUTETABLE_ENTRY_ID; req.Req.ID.toi_entity = id; req.Req.BufferSize = sizeof(*rte); - rte = + rte = (IPRouteEntry *)&req.Req.Buffer[0]; // dwForwardPolicy diff --git a/reactos/dll/win32/kernel32/debug/debugger.c b/reactos/dll/win32/kernel32/debug/debugger.c index 9d2de50e1cc..611acf217e2 100644 --- a/reactos/dll/win32/kernel32/debug/debugger.c +++ b/reactos/dll/win32/kernel32/debug/debugger.c @@ -492,7 +492,7 @@ WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, } /* Loop while we keep getting interrupted */ - do + do { /* Call the native API */ Status = DbgUiWaitStateChange(&WaitStateChange, Timeout); diff --git a/reactos/dll/win32/kernel32/file/dir.c b/reactos/dll/win32/kernel32/file/dir.c index 11bbeb2811c..49924c1bd72 100644 --- a/reactos/dll/win32/kernel32/file/dir.c +++ b/reactos/dll/win32/kernel32/file/dir.c @@ -168,7 +168,7 @@ CreateDirectoryExW ( BOOLEAN ReparsePoint = FALSE; PVOID EaBuffer = NULL; ULONG EaLength = 0; - + OpenOptions = FILE_DIRECTORY_FILE | FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT; CreateOptions = FILE_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT; @@ -216,7 +216,7 @@ OpenTemplateDir: /* Some FSs (FAT) don't support reparse points, try opening the directory without FILE_OPEN_REPARSE_POINT */ OpenOptions &= ~FILE_OPEN_REPARSE_POINT; - + DPRINT("Reparse points not supported, try with less options\n"); /* try again */ @@ -228,11 +228,11 @@ OpenTemplateDir: goto CleanupNoNtPath; } } - + /* * Translate the new directory path and check if they're the same */ - + if (!RtlDosPathNameToNtPathName_U (lpNewDirectory, &NtPathU, NULL, @@ -241,7 +241,7 @@ OpenTemplateDir: Status = STATUS_OBJECT_PATH_NOT_FOUND; goto CleanupNoNtPath; } - + if (RtlEqualUnicodeString(&NtPathU, &NtTemplatePathU, TRUE)) @@ -274,7 +274,7 @@ OpenTemplateDir: DPRINT1("Failed to query the basic directory attributes\n"); goto Cleanup; } - + /* clear the reparse point attribute if present. We're going to set the reparse point later which will cause the attribute to be set */ if (FileBasicInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) @@ -381,7 +381,7 @@ OpenTemplateDir: goto Cleanup; } - + if (ReparsePoint) { /* diff --git a/reactos/dll/win32/kernel32/file/file.c b/reactos/dll/win32/kernel32/file/file.c index 4f33b8e98c2..5dde6510762 100644 --- a/reactos/dll/win32/kernel32/file/file.c +++ b/reactos/dll/win32/kernel32/file/file.c @@ -891,7 +891,7 @@ GetFileAttributesExW(LPCWSTR lpFileName, /* Get file attributes */ Status = NtQueryFullAttributesFile(&ObjectAttributes, &FileInformation); - + RtlFreeUnicodeString (&FileName); if (!NT_SUCCESS (Status)) { @@ -978,15 +978,15 @@ GetFileAttributesByHandle(IN HANDLE hFile, FILE_BASIC_INFORMATION FileBasic; IO_STATUS_BLOCK IoStatusBlock; NTSTATUS Status; - + UNREFERENCED_PARAMETER(dwFlags); - + if (IsConsoleHandle(hFile)) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; } - + Status = NtQueryInformationFile(hFile, &IoStatusBlock, &FileBasic, @@ -997,7 +997,7 @@ GetFileAttributesByHandle(IN HANDLE hFile, *dwFileAttributes = FileBasic.FileAttributes; return TRUE; } - + SetLastErrorByStatus(Status); return FALSE; } @@ -1016,7 +1016,7 @@ SetFileAttributesByHandle(IN HANDLE hFile, NTSTATUS Status; UNREFERENCED_PARAMETER(dwFlags); - + if (IsConsoleHandle(hFile)) { SetLastError(ERROR_INVALID_HANDLE); @@ -1031,7 +1031,7 @@ SetFileAttributesByHandle(IN HANDLE hFile, if (NT_SUCCESS(Status)) { FileBasic.FileAttributes = dwFileAttributes; - + Status = NtSetInformationFile(hFile, &IoStatusBlock, &FileBasic, @@ -1044,7 +1044,7 @@ SetFileAttributesByHandle(IN HANDLE hFile, SetLastErrorByStatus(Status); return FALSE; } - + return TRUE; } diff --git a/reactos/dll/win32/kernel32/file/npipe.c b/reactos/dll/win32/kernel32/file/npipe.c index f7678420d38..536c0c73527 100644 --- a/reactos/dll/win32/kernel32/file/npipe.c +++ b/reactos/dll/win32/kernel32/file/npipe.c @@ -141,7 +141,7 @@ CreateNamedPipeW(LPCWSTR lpName, CreateOptions |= FILE_SYNCHRONOUS_IO_NONALERT; } - /* Handle all open modes */ + /* Handle all open modes */ if (dwOpenMode & PIPE_ACCESS_OUTBOUND) { ShareAccess |= FILE_SHARE_READ; @@ -268,8 +268,8 @@ WaitNamedPipeA(LPCSTR lpNamedPipeName, * Microsoft's NPFS.SYS. The main difference is that: * - This code actually respects the timeout instead of ignoring it! * - This code validates and creates the proper names for both UNC and local pipes - * - On NT, you open the *root* pipe directory (either \DosDevices\Pipe or - * \DosDevices\Unc\Server\Pipe) and then send the pipe to wait on in the + * - On NT, you open the *root* pipe directory (either \DosDevices\Pipe or + * \DosDevices\Unc\Server\Pipe) and then send the pipe to wait on in the * FILE_PIPE_WAIT_FOR_BUFFER structure. */ #ifdef USING_PROPER_NPFS_WAIT_SEMANTICS @@ -308,7 +308,7 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName, /* Find the path type of the name we were given */ NewName = NamedPipeName; Type = RtlDetermineDosPathNameType_U(lpNamedPipeName); - + /* Check if this was a device path, ie : "\\.\pipe\name" */ if (Type == RtlPathTypeLocalDevice) { diff --git a/reactos/dll/win32/kernel32/misc/actctx.c b/reactos/dll/win32/kernel32/misc/actctx.c index 71adc6b9bf3..d70fa3172d5 100644 --- a/reactos/dll/win32/kernel32/misc/actctx.c +++ b/reactos/dll/win32/kernel32/misc/actctx.c @@ -31,7 +31,7 @@ FindActCtxSectionStringA( { BOOL bRetVal; LPWSTR lpStringToFindW; - + /* Convert lpStringToFind */ if (lpStringToFind) { @@ -40,9 +40,9 @@ FindActCtxSectionStringA( } /* Call the Unicode function */ - bRetVal = FindActCtxSectionStringW(dwFlags, + bRetVal = FindActCtxSectionStringW(dwFlags, lpExtensionGuid, - ulSectionId, + ulSectionId, lpStringToFindW, ReturnedData); @@ -79,7 +79,7 @@ CreateActCtxA( { BasepAnsiStringToHeapUnicodeString(pActCtx->lpSource, (LPWSTR*) &pActCtxW.lpSource); - } + } if (pActCtx->lpAssemblyDirectory) { BasepAnsiStringToHeapUnicodeString(pActCtx->lpAssemblyDirectory, diff --git a/reactos/dll/win32/kernel32/misc/errormsg.c b/reactos/dll/win32/kernel32/misc/errormsg.c index a1f336a6a46..297f58e9eb7 100644 --- a/reactos/dll/win32/kernel32/misc/errormsg.c +++ b/reactos/dll/win32/kernel32/misc/errormsg.c @@ -557,7 +557,7 @@ DWORD WINAPI FormatMessageW( if (sprintfbuf) { HeapFree(GetProcessHeap(),0,sprintfbuf); } - len += 256; + len += 256; sprintfbuf=HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR)); /* CMF - This makes a BIG assumption about va_list */ } while (0 > _vsnwprintf(sprintfbuf, len, fmtstr, (va_list) argliststart)); diff --git a/reactos/dll/win32/kernel32/misc/lcformat.c b/reactos/dll/win32/kernel32/misc/lcformat.c index d3e58306fa8..16f3aa3092f 100644 --- a/reactos/dll/win32/kernel32/misc/lcformat.c +++ b/reactos/dll/win32/kernel32/misc/lcformat.c @@ -1695,7 +1695,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, break; } } - + // Add left bracket if (dwFmt & CF_PARENS) { diff --git a/reactos/dll/win32/kernel32/misc/nls.c b/reactos/dll/win32/kernel32/misc/nls.c index a3345aa0728..e44a42f4c16 100644 --- a/reactos/dll/win32/kernel32/misc/nls.c +++ b/reactos/dll/win32/kernel32/misc/nls.c @@ -710,7 +710,7 @@ IntWideCharToMultiByteCP(UINT CodePage, DWORD Flags, } } -/** +/** * @name IntIsLeadByte * * Internal function to detect if byte is lead byte in specific character @@ -861,7 +861,7 @@ GetCPFileNameFromRegistry(UINT CodePage, LPWSTR FileName, ULONG FileNameSize) min(Kvpi->DataLength / sizeof(WCHAR), FileNameSize)); } } - + /* free temporary buffer */ HeapFree(GetProcessHeap(),0,Kvpi); return bRetValue; @@ -1063,7 +1063,7 @@ GetACP(VOID) * @name GetOEMCP * * Get active OEM code page number. - * + * * @implemented */ diff --git a/reactos/dll/win32/mapi32/sendmail.c b/reactos/dll/win32/mapi32/sendmail.c index eb954a504cb..02a77d51eb6 100644 --- a/reactos/dll/win32/mapi32/sendmail.c +++ b/reactos/dll/win32/mapi32/sendmail.c @@ -53,7 +53,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mapi); * Failure: MAPI_E_FAILURE * * NOTES - * This is a temporary hack. + * This is a temporary hack. */ ULONG WINAPI MAPISendMail( LHANDLE session, ULONG_PTR uiparam, lpMapiMessage message, FLAGS flags, ULONG reserved ) @@ -169,7 +169,7 @@ ULONG WINAPI MAPISendMail( LHANDLE session, ULONG_PTR uiparam, } ret = MAPI_E_FAILURE; size = sizeof(format) + to_size + cc_size + bcc_size + subj_size + body_size; - + mailto = HeapAlloc( GetProcessHeap(), 0, size ); if (!mailto) goto exit; diff --git a/reactos/dll/win32/mapi32/util.c b/reactos/dll/win32/mapi32/util.c index 6621e6f35bc..9313377c2e7 100644 --- a/reactos/dll/win32/mapi32/util.c +++ b/reactos/dll/win32/mapi32/util.c @@ -806,7 +806,7 @@ ULONG WINAPI CbOfEncoded(LPCSTR lpszEnc) * * PARAMS * session [I] MAPI session handle - * item [I] Enumerated variable that identifies which + * item [I] Enumerated variable that identifies which * configuration information is being requested * reference [O] Buffer where configuration information is written * config_extensions[I/O] Path of file to create stream on diff --git a/reactos/dll/win32/mlang/mlang.c b/reactos/dll/win32/mlang/mlang.c index b5b8e0d235d..8c50aa95e97 100644 --- a/reactos/dll/win32/mlang/mlang.c +++ b/reactos/dll/win32/mlang/mlang.c @@ -530,7 +530,7 @@ HRESULT WINAPI ConvertINetMultiByteToUnicode( *pcDstSize = MultiByteToWideChar(dwEncoding, 0, pSrcStr, *pcSrcSize, NULL, 0); break; } - + if (!*pcDstSize) return E_FAIL; @@ -830,7 +830,7 @@ static HRESULT WINAPI MLANGCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOu IClassFactoryImpl *This = (IClassFactoryImpl *)iface; HRESULT hres; LPUNKNOWN punk; - + TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); *ppobj = NULL; @@ -1384,7 +1384,7 @@ static HRESULT WINAPI fnIMLangFontLink_CodePageToCodePages( { ICOM_THIS_MULTI(MLang_impl, vtbl_IMLangFontLink, iface); CHARSETINFO cs; - BOOL rc; + BOOL rc; TRACE("(%p) Seeking %u\n",This, uCodePage); memset(&cs, 0, sizeof(cs)); @@ -1412,7 +1412,7 @@ static HRESULT WINAPI fnIMLangFontLink_CodePagesToCodePage( DWORD mask = 0x00000000; UINT i; CHARSETINFO cs; - BOOL rc; + BOOL rc; TRACE("(%p) scanning 0x%x default page %u\n",This, dwCodePages, uDefaultCodePage); @@ -1420,7 +1420,7 @@ static HRESULT WINAPI fnIMLangFontLink_CodePagesToCodePage( *puCodePage = 0x00000000; rc = TranslateCharsetInfo((DWORD*)uDefaultCodePage, &cs, TCI_SRCCODEPAGE); - + if (rc && (dwCodePages & cs.fs.fsCsb[0])) { TRACE("Found Default Codepage\n"); @@ -1428,7 +1428,7 @@ static HRESULT WINAPI fnIMLangFontLink_CodePagesToCodePage( return S_OK; } - + for (i = 0; i < 32; i++) { @@ -1862,7 +1862,7 @@ static BOOL CALLBACK enum_locales_proc(LPWSTR locale) info->wszLocaleName[0] = 0; GetLocaleInfoW(info->lcid, LOCALE_SLANGUAGE, info->wszLocaleName, MAX_LOCALE_NAME); TRACE("ISO639: %s SLANGUAGE: %s\n", wine_dbgstr_w(info->wszRfc1766), wine_dbgstr_w(info->wszLocaleName)); - + data->total++; return TRUE; @@ -2298,7 +2298,7 @@ static HRESULT WINAPI fnIMultiLanguage2_ConvertStringToUnicodeEx( * * PARAMS * see ConvertStringToUnicode - * dwFlag + * dwFlag * lpFallBack if dwFlag contains MLCONVCHARF_USEDEFCHAR, lpFallBack string used * instead unconvertible characters. * diff --git a/reactos/dll/win32/mmdrv/common.c b/reactos/dll/win32/mmdrv/common.c index 8d64b2ff496..0bc5ca2586d 100644 --- a/reactos/dll/win32/mmdrv/common.c +++ b/reactos/dll/win32/mmdrv/common.c @@ -1,258 +1,258 @@ -/* - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Multimedia - * FILE: dll/win32/mmdrv/common.c - * PURPOSE: Multimedia User Mode Driver (Common functions) - * PROGRAMMER: Andrew Greenwood - * UPDATE HISTORY: - * Jan 14, 2007: Created - */ - -#include - -/* - Translates errors to MMRESULT codes. -*/ - -MMRESULT -ErrorToMmResult(UINT error_code) -{ - switch ( error_code ) - { - case NO_ERROR : - case ERROR_IO_PENDING : - return MMSYSERR_NOERROR; - - case ERROR_BUSY : - return MMSYSERR_ALLOCATED; - - case ERROR_NOT_SUPPORTED : - case ERROR_INVALID_FUNCTION : - return MMSYSERR_NOTSUPPORTED; - - case ERROR_NOT_ENOUGH_MEMORY : - return MMSYSERR_NOMEM; - - case ERROR_ACCESS_DENIED : - return MMSYSERR_BADDEVICEID; - - case ERROR_INSUFFICIENT_BUFFER : - return MMSYSERR_INVALPARAM; - }; - - /* If all else fails, it's just a plain old error */ - - return MMSYSERR_ERROR; -} - - -/* - Obtains a device count for a specific kind of device. -*/ - -DWORD -GetDeviceCount(DeviceType device_type) -{ - UINT index = 0; - HANDLE handle; - - /* Cycle through devices until an error occurs */ - - while ( OpenKernelDevice(device_type, index, GENERIC_READ, &handle) == MMSYSERR_NOERROR ) - { - CloseHandle(handle); - index ++; - } - - DPRINT("Found %d devices of type %d\n", index, device_type); - - return index; -} - - -/* - Obtains device capabilities. This could either be done as individual - functions for wave, MIDI and aux, or like this. I chose this method as - it centralizes everything. -*/ - -DWORD -GetDeviceCapabilities( - DeviceType device_type, - DWORD device_id, - PVOID capabilities, - DWORD capabilities_size) -{ - MMRESULT result; - DWORD ioctl; - HANDLE handle; - DWORD bytes_returned; - BOOL device_io_result; - - ASSERT(capabilities); - - /* Choose the right IOCTL for the job */ - - if ( IsWaveDevice(device_type) ) - ioctl = IOCTL_WAVE_GET_CAPABILITIES; - else if ( IsMidiDevice(device_type) ) - ioctl = IOCTL_MIDI_GET_CAPABILITIES; - else if ( IsAuxDevice(device_type) ) - return MMSYSERR_NOTSUPPORTED; /* TODO */ - else - return MMSYSERR_NOTSUPPORTED; - - result = OpenKernelDevice(device_type, - device_id, - GENERIC_READ, - &handle); - - if ( result != MMSYSERR_NOERROR ) - { - DPRINT("Failed to open kernel device\n"); - return result; - } - - device_io_result = DeviceIoControl(handle, - ioctl, - NULL, - 0, - (LPVOID) capabilities, - capabilities_size, - &bytes_returned, - NULL); - - /* Translate result */ - - if ( device_io_result ) - result = MMSYSERR_NOERROR; - else - result = ErrorToMmResult(GetLastError()); - - /* Clean up and return */ - - CloseKernelDevice(handle); - - return result; -} - - -/* - A wrapper around OpenKernelDevice that creates a session, - opens the kernel device, initializes session data and notifies - the client (application) that the device has been opened. Again, - this supports any device type and the only real difference is - the open descriptor. -*/ - -DWORD -OpenDevice( - DeviceType device_type, - DWORD device_id, - PVOID open_descriptor, - DWORD flags, - DWORD private_handle) -{ - SessionInfo* session_info; - MMRESULT result; - DWORD message; - - /* This will automatically check for duplicate sessions */ - result = CreateSession(device_type, device_id, &session_info); - - if ( result != MMSYSERR_NOERROR ) - { - DPRINT("Couldn't allocate session info\n"); - return result; - } - - result = OpenKernelDevice(device_type, - device_id, - GENERIC_READ, - &session_info->kernel_device_handle); - - if ( result != MMSYSERR_NOERROR ) - { - DPRINT("Failed to open kernel device\n"); - DestroySession(session_info); - return result; - } - - /* Set common session data */ - - session_info->flags = flags; - - /* Set wave/MIDI specific data */ - - if ( IsWaveDevice(device_type) ) - { - LPWAVEOPENDESC wave_open_desc = (LPWAVEOPENDESC) open_descriptor; - session_info->callback = wave_open_desc->dwCallback; - session_info->mme_wave_handle = wave_open_desc->hWave; - session_info->app_user_data = wave_open_desc->dwInstance; - } - else - { - DPRINT("Only wave devices are supported at present!\n"); - DestroySession(session_info); - return MMSYSERR_NOTSUPPORTED; - } - - /* Start the processing thread */ - - result = StartSessionThread(session_info); - - if ( result != MMSYSERR_NOERROR ) - { - DestroySession(session_info); - return result; - } - - /* Store the session info */ - - *((SessionInfo**)private_handle) = session_info; - - /* Send the right message */ - - message = (device_type == WaveOutDevice) ? WOM_OPEN : - (device_type == WaveInDevice) ? WIM_OPEN : - (device_type == MidiOutDevice) ? MOM_OPEN : - (device_type == MidiInDevice) ? MIM_OPEN : 0xFFFFFFFF; - - NotifyClient(session_info, message, 0, 0); - - return MMSYSERR_NOERROR; -} - - -/* - Attempts to close a device. This can fail if playback/recording has - not been stopped. We need to make sure it's safe to destroy the - session as well (mainly by killing the session thread.) -*/ - -DWORD -CloseDevice( - DWORD private_handle) -{ - MMRESULT result; - SessionInfo* session_info = (SessionInfo*) private_handle; - /* TODO: Maybe this is best off inside the playback thread? */ - - ASSERT(session_info); - - result = CallSessionThread(session_info, WODM_CLOSE, 0); - - if ( result == MMSYSERR_NOERROR ) - { - /* TODO: Wait for it to be safe to terminate */ - - CloseKernelDevice(session_info->kernel_device_handle); - - DestroySession(session_info); - } - - return result; -} - +/* + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Multimedia + * FILE: dll/win32/mmdrv/common.c + * PURPOSE: Multimedia User Mode Driver (Common functions) + * PROGRAMMER: Andrew Greenwood + * UPDATE HISTORY: + * Jan 14, 2007: Created + */ + +#include + +/* + Translates errors to MMRESULT codes. +*/ + +MMRESULT +ErrorToMmResult(UINT error_code) +{ + switch ( error_code ) + { + case NO_ERROR : + case ERROR_IO_PENDING : + return MMSYSERR_NOERROR; + + case ERROR_BUSY : + return MMSYSERR_ALLOCATED; + + case ERROR_NOT_SUPPORTED : + case ERROR_INVALID_FUNCTION : + return MMSYSERR_NOTSUPPORTED; + + case ERROR_NOT_ENOUGH_MEMORY : + return MMSYSERR_NOMEM; + + case ERROR_ACCESS_DENIED : + return MMSYSERR_BADDEVICEID; + + case ERROR_INSUFFICIENT_BUFFER : + return MMSYSERR_INVALPARAM; + }; + + /* If all else fails, it's just a plain old error */ + + return MMSYSERR_ERROR; +} + + +/* + Obtains a device count for a specific kind of device. +*/ + +DWORD +GetDeviceCount(DeviceType device_type) +{ + UINT index = 0; + HANDLE handle; + + /* Cycle through devices until an error occurs */ + + while ( OpenKernelDevice(device_type, index, GENERIC_READ, &handle) == MMSYSERR_NOERROR ) + { + CloseHandle(handle); + index ++; + } + + DPRINT("Found %d devices of type %d\n", index, device_type); + + return index; +} + + +/* + Obtains device capabilities. This could either be done as individual + functions for wave, MIDI and aux, or like this. I chose this method as + it centralizes everything. +*/ + +DWORD +GetDeviceCapabilities( + DeviceType device_type, + DWORD device_id, + PVOID capabilities, + DWORD capabilities_size) +{ + MMRESULT result; + DWORD ioctl; + HANDLE handle; + DWORD bytes_returned; + BOOL device_io_result; + + ASSERT(capabilities); + + /* Choose the right IOCTL for the job */ + + if ( IsWaveDevice(device_type) ) + ioctl = IOCTL_WAVE_GET_CAPABILITIES; + else if ( IsMidiDevice(device_type) ) + ioctl = IOCTL_MIDI_GET_CAPABILITIES; + else if ( IsAuxDevice(device_type) ) + return MMSYSERR_NOTSUPPORTED; /* TODO */ + else + return MMSYSERR_NOTSUPPORTED; + + result = OpenKernelDevice(device_type, + device_id, + GENERIC_READ, + &handle); + + if ( result != MMSYSERR_NOERROR ) + { + DPRINT("Failed to open kernel device\n"); + return result; + } + + device_io_result = DeviceIoControl(handle, + ioctl, + NULL, + 0, + (LPVOID) capabilities, + capabilities_size, + &bytes_returned, + NULL); + + /* Translate result */ + + if ( device_io_result ) + result = MMSYSERR_NOERROR; + else + result = ErrorToMmResult(GetLastError()); + + /* Clean up and return */ + + CloseKernelDevice(handle); + + return result; +} + + +/* + A wrapper around OpenKernelDevice that creates a session, + opens the kernel device, initializes session data and notifies + the client (application) that the device has been opened. Again, + this supports any device type and the only real difference is + the open descriptor. +*/ + +DWORD +OpenDevice( + DeviceType device_type, + DWORD device_id, + PVOID open_descriptor, + DWORD flags, + DWORD private_handle) +{ + SessionInfo* session_info; + MMRESULT result; + DWORD message; + + /* This will automatically check for duplicate sessions */ + result = CreateSession(device_type, device_id, &session_info); + + if ( result != MMSYSERR_NOERROR ) + { + DPRINT("Couldn't allocate session info\n"); + return result; + } + + result = OpenKernelDevice(device_type, + device_id, + GENERIC_READ, + &session_info->kernel_device_handle); + + if ( result != MMSYSERR_NOERROR ) + { + DPRINT("Failed to open kernel device\n"); + DestroySession(session_info); + return result; + } + + /* Set common session data */ + + session_info->flags = flags; + + /* Set wave/MIDI specific data */ + + if ( IsWaveDevice(device_type) ) + { + LPWAVEOPENDESC wave_open_desc = (LPWAVEOPENDESC) open_descriptor; + session_info->callback = wave_open_desc->dwCallback; + session_info->mme_wave_handle = wave_open_desc->hWave; + session_info->app_user_data = wave_open_desc->dwInstance; + } + else + { + DPRINT("Only wave devices are supported at present!\n"); + DestroySession(session_info); + return MMSYSERR_NOTSUPPORTED; + } + + /* Start the processing thread */ + + result = StartSessionThread(session_info); + + if ( result != MMSYSERR_NOERROR ) + { + DestroySession(session_info); + return result; + } + + /* Store the session info */ + + *((SessionInfo**)private_handle) = session_info; + + /* Send the right message */ + + message = (device_type == WaveOutDevice) ? WOM_OPEN : + (device_type == WaveInDevice) ? WIM_OPEN : + (device_type == MidiOutDevice) ? MOM_OPEN : + (device_type == MidiInDevice) ? MIM_OPEN : 0xFFFFFFFF; + + NotifyClient(session_info, message, 0, 0); + + return MMSYSERR_NOERROR; +} + + +/* + Attempts to close a device. This can fail if playback/recording has + not been stopped. We need to make sure it's safe to destroy the + session as well (mainly by killing the session thread.) +*/ + +DWORD +CloseDevice( + DWORD private_handle) +{ + MMRESULT result; + SessionInfo* session_info = (SessionInfo*) private_handle; + /* TODO: Maybe this is best off inside the playback thread? */ + + ASSERT(session_info); + + result = CallSessionThread(session_info, WODM_CLOSE, 0); + + if ( result == MMSYSERR_NOERROR ) + { + /* TODO: Wait for it to be safe to terminate */ + + CloseKernelDevice(session_info->kernel_device_handle); + + DestroySession(session_info); + } + + return result; +} + diff --git a/reactos/dll/win32/mmdrv/kernel.c b/reactos/dll/win32/mmdrv/kernel.c index efba1fce75a..19a45522c3d 100644 --- a/reactos/dll/win32/mmdrv/kernel.c +++ b/reactos/dll/win32/mmdrv/kernel.c @@ -1,206 +1,206 @@ -/* - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Multimedia - * FILE: dll/win32/mmdrv/kernel.c - * PURPOSE: Multimedia User Mode Driver (kernel interface) - * PROGRAMMER: Andrew Greenwood - * UPDATE HISTORY: - * Jan 14, 2007: Created - */ - -#include - -/* - Devices that we provide access to follow a standard naming convention. - The first wave output, for example, appears as \Device\WaveOut0 - - I'm not entirely certain how drivers find a free name to use, or why - we need to strip the leading \Device from it when opening, but hey... -*/ - -MMRESULT -CobbleDeviceName( - DeviceType device_type, - DWORD device_id, - PWCHAR out_device_name) -{ - WCHAR base_device_name[MAX_DEVICE_NAME_LENGTH]; - - /* Work out the base name from the device type */ - - switch ( device_type ) - { - case WaveOutDevice : - wsprintf(base_device_name, L"%ls", WAVE_OUT_DEVICE_NAME); - break; - - case WaveInDevice : - wsprintf(base_device_name, L"%ls", WAVE_IN_DEVICE_NAME); - break; - - case MidiOutDevice : - wsprintf(base_device_name, L"%ls", MIDI_OUT_DEVICE_NAME); - break; - - case MidiInDevice : - wsprintf(base_device_name, L"%ls", MIDI_IN_DEVICE_NAME); - break; - - case AuxDevice : - wsprintf(base_device_name, L"%ls", AUX_DEVICE_NAME); - break; - - default : - return MMSYSERR_BADDEVICEID; - }; - - /* Now append the device number, removing the leading \Device */ - - wsprintf(out_device_name, - L"\\\\.%ls%d", - base_device_name + strlen("\\Device"), - device_id); - - return MMSYSERR_NOERROR; -} - - -/* - Takes a device type (eg: WaveOutDevice), a device ID, desired access and - a pointer to a location that will store the handle of the opened "file" if - the function succeeds. - - The device type and ID are converted into a device name using the above - function. -*/ - -MMRESULT -OpenKernelDevice( - DeviceType device_type, - DWORD device_id, - DWORD access, - HANDLE* handle) -{ - MMRESULT result; - WCHAR device_name[MAX_DEVICE_NAME_LENGTH]; - DWORD open_flags = 0; - - ASSERT(handle); - - /* Glue the base device name and the ID together */ - - result = CobbleDeviceName(device_type, device_id, device_name); - - DPRINT("Opening kernel device %ls\n", device_name); - - if ( result != MMSYSERR_NOERROR ) - return result; - - /* We want overlapped I/O when writing */ - - if ( access != GENERIC_READ ) - open_flags = FILE_FLAG_OVERLAPPED; - - /* Now try opening... */ - - *handle = CreateFile(device_name, - access, - FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - open_flags, - NULL); - - if ( *handle == INVALID_HANDLE_VALUE ) - return ErrorToMmResult(GetLastError()); - - return MMSYSERR_NOERROR; -} - - -/* - Just an alias for the benefit of having a pair of functions ;) -*/ - -void -CloseKernelDevice(HANDLE device_handle) -{ - CloseHandle(device_handle); -} - - -MMRESULT -SetDeviceData( - HANDLE device_handle, - DWORD ioctl, - PBYTE input_buffer, - DWORD buffer_size) -{ - DPRINT("SetDeviceData\n"); - /* TODO */ - return 0; -} - - -MMRESULT -GetDeviceData( - HANDLE device_handle, - DWORD ioctl, - PBYTE output_buffer, - DWORD buffer_size) -{ - OVERLAPPED overlap; - DWORD bytes_returned; - BOOL success; - DWORD transfer; - - DPRINT("GetDeviceData\n"); - - memset(&overlap, 0, sizeof(overlap)); - - overlap.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - - if ( ! overlap.hEvent ) - return MMSYSERR_NOMEM; - - success = DeviceIoControl(device_handle, - ioctl, - NULL, - 0, - output_buffer, - buffer_size, - &bytes_returned, - &overlap); - - if ( ! success ) - { - if ( GetLastError() == ERROR_IO_PENDING ) - { - if ( ! GetOverlappedResult(device_handle, &overlap, &transfer, TRUE) ) - { - CloseHandle(overlap.hEvent); - return ErrorToMmResult(GetLastError()); - } - } - else - { - CloseHandle(overlap.hEvent); - return ErrorToMmResult(GetLastError()); - } - } - - while ( TRUE ) - { - SetEvent(overlap.hEvent); - - if ( WaitForSingleObjectEx(overlap.hEvent, 0, TRUE) != WAIT_IO_COMPLETION ) - { - break; - } - } - - CloseHandle(overlap.hEvent); - - return MMSYSERR_NOERROR; -} +/* + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Multimedia + * FILE: dll/win32/mmdrv/kernel.c + * PURPOSE: Multimedia User Mode Driver (kernel interface) + * PROGRAMMER: Andrew Greenwood + * UPDATE HISTORY: + * Jan 14, 2007: Created + */ + +#include + +/* + Devices that we provide access to follow a standard naming convention. + The first wave output, for example, appears as \Device\WaveOut0 + + I'm not entirely certain how drivers find a free name to use, or why + we need to strip the leading \Device from it when opening, but hey... +*/ + +MMRESULT +CobbleDeviceName( + DeviceType device_type, + DWORD device_id, + PWCHAR out_device_name) +{ + WCHAR base_device_name[MAX_DEVICE_NAME_LENGTH]; + + /* Work out the base name from the device type */ + + switch ( device_type ) + { + case WaveOutDevice : + wsprintf(base_device_name, L"%ls", WAVE_OUT_DEVICE_NAME); + break; + + case WaveInDevice : + wsprintf(base_device_name, L"%ls", WAVE_IN_DEVICE_NAME); + break; + + case MidiOutDevice : + wsprintf(base_device_name, L"%ls", MIDI_OUT_DEVICE_NAME); + break; + + case MidiInDevice : + wsprintf(base_device_name, L"%ls", MIDI_IN_DEVICE_NAME); + break; + + case AuxDevice : + wsprintf(base_device_name, L"%ls", AUX_DEVICE_NAME); + break; + + default : + return MMSYSERR_BADDEVICEID; + }; + + /* Now append the device number, removing the leading \Device */ + + wsprintf(out_device_name, + L"\\\\.%ls%d", + base_device_name + strlen("\\Device"), + device_id); + + return MMSYSERR_NOERROR; +} + + +/* + Takes a device type (eg: WaveOutDevice), a device ID, desired access and + a pointer to a location that will store the handle of the opened "file" if + the function succeeds. + + The device type and ID are converted into a device name using the above + function. +*/ + +MMRESULT +OpenKernelDevice( + DeviceType device_type, + DWORD device_id, + DWORD access, + HANDLE* handle) +{ + MMRESULT result; + WCHAR device_name[MAX_DEVICE_NAME_LENGTH]; + DWORD open_flags = 0; + + ASSERT(handle); + + /* Glue the base device name and the ID together */ + + result = CobbleDeviceName(device_type, device_id, device_name); + + DPRINT("Opening kernel device %ls\n", device_name); + + if ( result != MMSYSERR_NOERROR ) + return result; + + /* We want overlapped I/O when writing */ + + if ( access != GENERIC_READ ) + open_flags = FILE_FLAG_OVERLAPPED; + + /* Now try opening... */ + + *handle = CreateFile(device_name, + access, + FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + open_flags, + NULL); + + if ( *handle == INVALID_HANDLE_VALUE ) + return ErrorToMmResult(GetLastError()); + + return MMSYSERR_NOERROR; +} + + +/* + Just an alias for the benefit of having a pair of functions ;) +*/ + +void +CloseKernelDevice(HANDLE device_handle) +{ + CloseHandle(device_handle); +} + + +MMRESULT +SetDeviceData( + HANDLE device_handle, + DWORD ioctl, + PBYTE input_buffer, + DWORD buffer_size) +{ + DPRINT("SetDeviceData\n"); + /* TODO */ + return 0; +} + + +MMRESULT +GetDeviceData( + HANDLE device_handle, + DWORD ioctl, + PBYTE output_buffer, + DWORD buffer_size) +{ + OVERLAPPED overlap; + DWORD bytes_returned; + BOOL success; + DWORD transfer; + + DPRINT("GetDeviceData\n"); + + memset(&overlap, 0, sizeof(overlap)); + + overlap.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + + if ( ! overlap.hEvent ) + return MMSYSERR_NOMEM; + + success = DeviceIoControl(device_handle, + ioctl, + NULL, + 0, + output_buffer, + buffer_size, + &bytes_returned, + &overlap); + + if ( ! success ) + { + if ( GetLastError() == ERROR_IO_PENDING ) + { + if ( ! GetOverlappedResult(device_handle, &overlap, &transfer, TRUE) ) + { + CloseHandle(overlap.hEvent); + return ErrorToMmResult(GetLastError()); + } + } + else + { + CloseHandle(overlap.hEvent); + return ErrorToMmResult(GetLastError()); + } + } + + while ( TRUE ) + { + SetEvent(overlap.hEvent); + + if ( WaitForSingleObjectEx(overlap.hEvent, 0, TRUE) != WAIT_IO_COMPLETION ) + { + break; + } + } + + CloseHandle(overlap.hEvent); + + return MMSYSERR_NOERROR; +} diff --git a/reactos/dll/win32/mmdrv/mme.c b/reactos/dll/win32/mmdrv/mme.c index 82ca3e2755c..490668e12a7 100644 --- a/reactos/dll/win32/mmdrv/mme.c +++ b/reactos/dll/win32/mmdrv/mme.c @@ -1,143 +1,143 @@ -/* - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Multimedia - * FILE: dll/win32/mmdrv/mme.c - * PURPOSE: Multimedia User Mode Driver (MME Interface) - * PROGRAMMER: Andrew Greenwood - * Aleksey Bragin - * UPDATE HISTORY: - * Jan 14, 2007: Rewritten and tidied up - */ - -#include - -/* - Sends a message to the client (application), such as WOM_DONE. This - is just a wrapper around DriverCallback which translates the - parameters appropriately. -*/ - -BOOL -NotifyClient( - SessionInfo* session_info, - DWORD message, - DWORD parameter1, - DWORD parameter2) -{ - return DriverCallback(session_info->callback, - HIWORD(session_info->flags), - session_info->mme_handle, - message, - session_info->app_user_data, - parameter1, - parameter2); -} - - - -/* - MME Driver Entrypoint - Wave Output -*/ - -APIENTRY DWORD -wodMessage( - DWORD device_id, - DWORD message, - DWORD private_handle, - DWORD parameter1, - DWORD parameter2) -{ - switch ( message ) - { - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p80.htm */ - case WODM_GETNUMDEVS : - DPRINT("WODM_GETNUMDEVS\n"); - return GetDeviceCount(WaveOutDevice); - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p6h.htm */ - case WODM_GETDEVCAPS : - DPRINT("WODM_GETDEVCAPS\n"); - return GetDeviceCapabilities(WaveOutDevice, - device_id, - (PVOID) parameter1, - parameter2); - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p85.htm */ - case WODM_OPEN : - { - WAVEOPENDESC* open_desc = (WAVEOPENDESC*) parameter1; - DPRINT("WODM_OPEN\n"); - - if ( parameter2 && WAVE_FORMAT_QUERY ) - return QueryWaveFormat(WaveOutDevice, open_desc->lpFormat); - else - return OpenDevice(WaveOutDevice, - device_id, - open_desc, - parameter2, - private_handle); - } - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p6g.htm */ - case WODM_CLOSE : - { - DPRINT("WODM_CLOSE\n"); - return CloseDevice(private_handle); - } - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p9w.htm */ - case WODM_WRITE : - { - DPRINT("WODM_WRITE\n"); - return WriteWaveBuffer(private_handle, - (PWAVEHDR) parameter1, - parameter2); - } - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p86.htm */ - case WODM_PAUSE : - { - DPRINT("WODM_PAUSE\n"); - return HandleBySessionThread(private_handle, message, 0); - } - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p89.htm */ - case WODM_RESTART : - { - DPRINT("WODM_RESTART\n"); - return HandleBySessionThread(private_handle, message, 0); - } - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p88.htm */ - case WODM_RESET : - { - DPRINT("WODM_RESET\n"); - return HandleBySessionThread(private_handle, message, 0); - } - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p83.htm */ -#if 0 - case WODM_GETPOS : - { - DPRINT("WODM_GETPOS\n"); - return GetPosition(private_handle, - (PMMTIME) parameter1, - parameter2); - } -#endif - - /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p6f.htm */ - case WODM_BREAKLOOP : - { - DPRINT("WODM_BREAKLOOP\n"); - return HandleBySessionThread(private_handle, message, 0); - } - - /* TODO: Others */ - } - - DPRINT("Unsupported message\n"); - return MMSYSERR_NOTSUPPORTED; -} +/* + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Multimedia + * FILE: dll/win32/mmdrv/mme.c + * PURPOSE: Multimedia User Mode Driver (MME Interface) + * PROGRAMMER: Andrew Greenwood + * Aleksey Bragin + * UPDATE HISTORY: + * Jan 14, 2007: Rewritten and tidied up + */ + +#include + +/* + Sends a message to the client (application), such as WOM_DONE. This + is just a wrapper around DriverCallback which translates the + parameters appropriately. +*/ + +BOOL +NotifyClient( + SessionInfo* session_info, + DWORD message, + DWORD parameter1, + DWORD parameter2) +{ + return DriverCallback(session_info->callback, + HIWORD(session_info->flags), + session_info->mme_handle, + message, + session_info->app_user_data, + parameter1, + parameter2); +} + + + +/* + MME Driver Entrypoint + Wave Output +*/ + +APIENTRY DWORD +wodMessage( + DWORD device_id, + DWORD message, + DWORD private_handle, + DWORD parameter1, + DWORD parameter2) +{ + switch ( message ) + { + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p80.htm */ + case WODM_GETNUMDEVS : + DPRINT("WODM_GETNUMDEVS\n"); + return GetDeviceCount(WaveOutDevice); + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p6h.htm */ + case WODM_GETDEVCAPS : + DPRINT("WODM_GETDEVCAPS\n"); + return GetDeviceCapabilities(WaveOutDevice, + device_id, + (PVOID) parameter1, + parameter2); + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p85.htm */ + case WODM_OPEN : + { + WAVEOPENDESC* open_desc = (WAVEOPENDESC*) parameter1; + DPRINT("WODM_OPEN\n"); + + if ( parameter2 && WAVE_FORMAT_QUERY ) + return QueryWaveFormat(WaveOutDevice, open_desc->lpFormat); + else + return OpenDevice(WaveOutDevice, + device_id, + open_desc, + parameter2, + private_handle); + } + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p6g.htm */ + case WODM_CLOSE : + { + DPRINT("WODM_CLOSE\n"); + return CloseDevice(private_handle); + } + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p9w.htm */ + case WODM_WRITE : + { + DPRINT("WODM_WRITE\n"); + return WriteWaveBuffer(private_handle, + (PWAVEHDR) parameter1, + parameter2); + } + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p86.htm */ + case WODM_PAUSE : + { + DPRINT("WODM_PAUSE\n"); + return HandleBySessionThread(private_handle, message, 0); + } + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p89.htm */ + case WODM_RESTART : + { + DPRINT("WODM_RESTART\n"); + return HandleBySessionThread(private_handle, message, 0); + } + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p88.htm */ + case WODM_RESET : + { + DPRINT("WODM_RESET\n"); + return HandleBySessionThread(private_handle, message, 0); + } + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p83.htm */ +#if 0 + case WODM_GETPOS : + { + DPRINT("WODM_GETPOS\n"); + return GetPosition(private_handle, + (PMMTIME) parameter1, + parameter2); + } +#endif + + /* http://www.osronline.com/ddkx/w98ddk/mmedia_4p6f.htm */ + case WODM_BREAKLOOP : + { + DPRINT("WODM_BREAKLOOP\n"); + return HandleBySessionThread(private_handle, message, 0); + } + + /* TODO: Others */ + } + + DPRINT("Unsupported message\n"); + return MMSYSERR_NOTSUPPORTED; +} diff --git a/reactos/dll/win32/mmdrv/mmioctl.h b/reactos/dll/win32/mmdrv/mmioctl.h index 977b91540e4..5cdc5812b77 100644 --- a/reactos/dll/win32/mmdrv/mmioctl.h +++ b/reactos/dll/win32/mmdrv/mmioctl.h @@ -1,147 +1,147 @@ -/* - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Multimedia - * FILE: dll/win32/mmdrv/mmioctl.h - * PURPOSE: Multimedia system NT4 compatibility - * PROGRAMMER: Andrew Greenwood - * UPDATE HISTORY: - * Jan 13, 2007: Split from mmdrv.h - */ - -#ifndef MMDRV_IOCTLS -#define MMDRV_IOCTLS - - -#include -#include -#include -#include - - -/* - Base names of the supported devices, as provided by drivers running in - kernel mode. - - \Device\WaveIn0 etc. -*/ - -#define WAVE_OUT_DEVICE_NAME L"\\Device\\WaveOut" -#define WAVE_IN_DEVICE_NAME L"\\Device\\WaveIn" -#define MIDI_OUT_DEVICE_NAME L"\\Device\\MidiOut" -#define MIDI_IN_DEVICE_NAME L"\\Device\\MidiIn" -#define AUX_DEVICE_NAME L"\\Device\\MMAux" - - -/* - Base IOCTL codes -*/ - -#define IOCTL_SOUND_BASE FILE_DEVICE_SOUND -#define IOCTL_WAVE_BASE 0x0000 -#define IOCTL_MIDI_BASE 0x0080 -#define IOCTL_AUX_BASE 0x0100 - - -/* - Wave IOCTLs -*/ - -#define IOCTL_WAVE_QUERY_FORMAT \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_WAVE_SET_FORMAT \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_GET_CAPABILITIES \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_WAVE_SET_STATE \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_GET_STATE \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_GET_POSITION \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_SET_VOLUME \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_WAVE_GET_VOLUME \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_WAVE_SET_PITCH \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_GET_PITCH \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000A, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_SET_PLAYBACK_RATE \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000B, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_GET_PLAYBACK_RATE \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000C, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_PLAY \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000D, METHOD_IN_DIRECT, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_RECORD \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000E, METHOD_OUT_DIRECT, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_BREAK_LOOP \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000F, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_WAVE_SET_LOW_PRIORITY \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS) - - -/* - MIDI IOCTLs -*/ - -#define IOCTL_MIDI_GET_CAPABILITIES \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_MIDI_SET_STATE \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_MIDI_GET_STATE \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_MIDI_SET_VOLUME \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_MIDI_GET_VOLUME \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_MIDI_PLAY \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_MIDI_RECORD \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_MIDI_CACHE_PATCHES \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_MIDI_CACHE_DRUM_PATCHES \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS) - - -/* - Aux IOCTLs -*/ - -#define IOCTL_AUX_GET_CAPABILITIES \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_AUX_SET_VOLUME \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_AUX_GET_VOLUME \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_SOUND_GET_CHANGED_VOLUME \ - CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) - -#endif +/* + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Multimedia + * FILE: dll/win32/mmdrv/mmioctl.h + * PURPOSE: Multimedia system NT4 compatibility + * PROGRAMMER: Andrew Greenwood + * UPDATE HISTORY: + * Jan 13, 2007: Split from mmdrv.h + */ + +#ifndef MMDRV_IOCTLS +#define MMDRV_IOCTLS + + +#include +#include +#include +#include + + +/* + Base names of the supported devices, as provided by drivers running in + kernel mode. + + \Device\WaveIn0 etc. +*/ + +#define WAVE_OUT_DEVICE_NAME L"\\Device\\WaveOut" +#define WAVE_IN_DEVICE_NAME L"\\Device\\WaveIn" +#define MIDI_OUT_DEVICE_NAME L"\\Device\\MidiOut" +#define MIDI_IN_DEVICE_NAME L"\\Device\\MidiIn" +#define AUX_DEVICE_NAME L"\\Device\\MMAux" + + +/* + Base IOCTL codes +*/ + +#define IOCTL_SOUND_BASE FILE_DEVICE_SOUND +#define IOCTL_WAVE_BASE 0x0000 +#define IOCTL_MIDI_BASE 0x0080 +#define IOCTL_AUX_BASE 0x0100 + + +/* + Wave IOCTLs +*/ + +#define IOCTL_WAVE_QUERY_FORMAT \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_SET_FORMAT \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_CAPABILITIES \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_SET_STATE \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_STATE \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_POSITION \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_SET_VOLUME \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_GET_VOLUME \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_SET_PITCH \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_PITCH \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000A, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_SET_PLAYBACK_RATE \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000B, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_PLAYBACK_RATE \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000C, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_PLAY \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000D, METHOD_IN_DIRECT, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_RECORD \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000E, METHOD_OUT_DIRECT, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_BREAK_LOOP \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x000F, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_SET_LOW_PRIORITY \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS) + + +/* + MIDI IOCTLs +*/ + +#define IOCTL_MIDI_GET_CAPABILITIES \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIDI_SET_STATE \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_GET_STATE \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_SET_VOLUME \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIDI_GET_VOLUME \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIDI_PLAY \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_RECORD \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_CACHE_PATCHES \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_CACHE_DRUM_PATCHES \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS) + + +/* + Aux IOCTLs +*/ + +#define IOCTL_AUX_GET_CAPABILITIES \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_AUX_SET_VOLUME \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_AUX_GET_VOLUME \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_SOUND_GET_CHANGED_VOLUME \ + CTL_CODE(IOCTL_SOUND_BASE, IOCTL_AUX_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) + +#endif diff --git a/reactos/dll/win32/mmdrv/session.c b/reactos/dll/win32/mmdrv/session.c index b9d63e7d9b5..87b71deba25 100644 --- a/reactos/dll/win32/mmdrv/session.c +++ b/reactos/dll/win32/mmdrv/session.c @@ -1,245 +1,245 @@ -/* - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Multimedia - * FILE: dll/win32/mmdrv/session.c - * PURPOSE: Multimedia User Mode Driver (session management) - * PROGRAMMER: Andrew Greenwood - * UPDATE HISTORY: - * Jan 14, 2007: Created - */ - -#include - -/* Each session is tracked, but the list must be locked when in use */ - -SessionInfo* session_list = NULL; -CRITICAL_SECTION session_lock; - - -/* - Obtains a pointer to the session associated with a device type and ID. - If no session exists, returns NULL. This is mainly used to see if a - session already exists prior to creating a new one. -*/ - -SessionInfo* -GetSession( - DeviceType device_type, - DWORD device_id) -{ - SessionInfo* session_info; - - EnterCriticalSection(&session_lock); - session_info = session_list; - - while ( session_info ) - { - if ( ( session_info->device_type == device_type ) && - ( session_info->device_id == device_id ) ) - { - LeaveCriticalSection(&session_lock); - return session_info; - } - - session_info = session_info->next; - } - - LeaveCriticalSection(&session_lock); - return NULL; -} - - -/* - Creates a new session, associated with the specified device type and ID. - Whilst the session list is locked, this also checks to see if an existing - session is associated with the device. -*/ - -MMRESULT -CreateSession( - DeviceType device_type, - DWORD device_id, - SessionInfo** session_info) -{ - HANDLE heap = GetProcessHeap(); - - ASSERT(session_info); - - EnterCriticalSection(&session_lock); - - /* Ensure we're not creating a duplicate session */ - - if ( GetSession(device_type, device_id) ) - { - DPRINT("Already allocated session\n"); - LeaveCriticalSection(&session_lock); - return MMSYSERR_ALLOCATED; - } - - *session_info = HeapAlloc(heap, HEAP_ZERO_MEMORY, sizeof(SessionInfo)); - - if ( ! *session_info ) - { - DPRINT("Failed to allocate mem for session info\n"); - LeaveCriticalSection(&session_lock); - return MMSYSERR_NOMEM; - } - - (*session_info)->device_type = device_type; - (*session_info)->device_id = device_id; - - /* Add to the list */ - - (*session_info)->next = session_list; - session_list = *session_info; - - LeaveCriticalSection(&session_lock); - - return MMSYSERR_NOERROR; -} - - -/* - Removes a session from the list and destroys it. This function does NOT - perform any additional cleanup. Think of it as a slightly more advanced - free() -*/ - -VOID -DestroySession(SessionInfo* session) -{ - HANDLE heap = GetProcessHeap(); - SessionInfo* session_node; - SessionInfo* session_prev; - - /* TODO: More cleanup stuff */ - - /* Remove from the list */ - - EnterCriticalSection(&session_lock); - - session_node = session_list; - session_prev = NULL; - - while ( session_node ) - { - if ( session_node == session ) - { - /* Bridge the gap for when we go */ - session_prev->next = session->next; - break; - } - - /* Save the previous node, fetch the next */ - session_prev = session_node; - session_node = session_node->next; - } - - LeaveCriticalSection(&session_lock); - - HeapFree(heap, 0, session); -} - - -/* - Allocates events and other resources for the session thread, starts it, - and waits for it to announce that it is ready to work for us. -*/ - -MMRESULT -StartSessionThread(SessionInfo* session_info) -{ - LPTASKCALLBACK task; - MMRESULT result; - - ASSERT(session_info); - - /* This is our "ready" event, sent when the thread is idle */ - - session_info->thread.ready_event = CreateEvent(NULL, FALSE, FALSE, NULL); - - if ( ! session_info->thread.ready_event ) - { - DPRINT("Couldn't create thread_ready event\n"); - return MMSYSERR_NOMEM; - } - - /* This is our "go" event, sent when we want the thread to do something */ - - session_info->thread.go_event = CreateEvent(NULL, FALSE, FALSE, NULL); - - if ( ! session_info->thread.go_event ) - { - DPRINT("Couldn't create thread_go event\n"); - CloseHandle(session_info->thread.ready_event); - return MMSYSERR_NOMEM; - } - - /* TODO - other kinds of devices need attention, too */ - task = ( session_info->device_type == WaveOutDevice ) - ? (LPTASKCALLBACK) WaveThread : NULL; - - ASSERT(task); - - /* Effectively, this is a beefed-up CreateThread */ - - result = mmTaskCreate(task, - &session_info->thread.handle, - (DWORD) session_info); - - if ( result != MMSYSERR_NOERROR ) - { - DPRINT("Task creation failed\n"); - CloseHandle(session_info->thread.ready_event); - CloseHandle(session_info->thread.go_event); - return result; - } - - /* Wait for the thread to be ready before completing */ - - WaitForSingleObject(session_info->thread.ready_event, INFINITE); - - return MMSYSERR_NOERROR; -} - - -/* - The session thread is pretty simple. Upon creation, it announces that it - is ready to do stuff for us. When we want it to perform an action, we use - CallSessionThread with an appropriate function and parameter, then tell - the thread we want it to do something. When it's finished, it announces - that it is ready once again. -*/ - -MMRESULT -CallSessionThread( - SessionInfo* session_info, - ThreadFunction function, - PVOID thread_parameter) -{ - ASSERT(session_info); - - session_info->thread.function = function; - session_info->thread.parameter = thread_parameter; - - DPRINT("Calling session thread\n"); - SetEvent(session_info->thread.go_event); - - DPRINT("Waiting for thread response\n"); - WaitForSingleObject(session_info->thread.ready_event, INFINITE); - - return session_info->thread.result; -} - - -DWORD -HandleBySessionThread( - DWORD private_handle, - DWORD message, - DWORD parameter) -{ - return CallSessionThread((SessionInfo*) private_handle, - message, - (PVOID) parameter); -} +/* + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Multimedia + * FILE: dll/win32/mmdrv/session.c + * PURPOSE: Multimedia User Mode Driver (session management) + * PROGRAMMER: Andrew Greenwood + * UPDATE HISTORY: + * Jan 14, 2007: Created + */ + +#include + +/* Each session is tracked, but the list must be locked when in use */ + +SessionInfo* session_list = NULL; +CRITICAL_SECTION session_lock; + + +/* + Obtains a pointer to the session associated with a device type and ID. + If no session exists, returns NULL. This is mainly used to see if a + session already exists prior to creating a new one. +*/ + +SessionInfo* +GetSession( + DeviceType device_type, + DWORD device_id) +{ + SessionInfo* session_info; + + EnterCriticalSection(&session_lock); + session_info = session_list; + + while ( session_info ) + { + if ( ( session_info->device_type == device_type ) && + ( session_info->device_id == device_id ) ) + { + LeaveCriticalSection(&session_lock); + return session_info; + } + + session_info = session_info->next; + } + + LeaveCriticalSection(&session_lock); + return NULL; +} + + +/* + Creates a new session, associated with the specified device type and ID. + Whilst the session list is locked, this also checks to see if an existing + session is associated with the device. +*/ + +MMRESULT +CreateSession( + DeviceType device_type, + DWORD device_id, + SessionInfo** session_info) +{ + HANDLE heap = GetProcessHeap(); + + ASSERT(session_info); + + EnterCriticalSection(&session_lock); + + /* Ensure we're not creating a duplicate session */ + + if ( GetSession(device_type, device_id) ) + { + DPRINT("Already allocated session\n"); + LeaveCriticalSection(&session_lock); + return MMSYSERR_ALLOCATED; + } + + *session_info = HeapAlloc(heap, HEAP_ZERO_MEMORY, sizeof(SessionInfo)); + + if ( ! *session_info ) + { + DPRINT("Failed to allocate mem for session info\n"); + LeaveCriticalSection(&session_lock); + return MMSYSERR_NOMEM; + } + + (*session_info)->device_type = device_type; + (*session_info)->device_id = device_id; + + /* Add to the list */ + + (*session_info)->next = session_list; + session_list = *session_info; + + LeaveCriticalSection(&session_lock); + + return MMSYSERR_NOERROR; +} + + +/* + Removes a session from the list and destroys it. This function does NOT + perform any additional cleanup. Think of it as a slightly more advanced + free() +*/ + +VOID +DestroySession(SessionInfo* session) +{ + HANDLE heap = GetProcessHeap(); + SessionInfo* session_node; + SessionInfo* session_prev; + + /* TODO: More cleanup stuff */ + + /* Remove from the list */ + + EnterCriticalSection(&session_lock); + + session_node = session_list; + session_prev = NULL; + + while ( session_node ) + { + if ( session_node == session ) + { + /* Bridge the gap for when we go */ + session_prev->next = session->next; + break; + } + + /* Save the previous node, fetch the next */ + session_prev = session_node; + session_node = session_node->next; + } + + LeaveCriticalSection(&session_lock); + + HeapFree(heap, 0, session); +} + + +/* + Allocates events and other resources for the session thread, starts it, + and waits for it to announce that it is ready to work for us. +*/ + +MMRESULT +StartSessionThread(SessionInfo* session_info) +{ + LPTASKCALLBACK task; + MMRESULT result; + + ASSERT(session_info); + + /* This is our "ready" event, sent when the thread is idle */ + + session_info->thread.ready_event = CreateEvent(NULL, FALSE, FALSE, NULL); + + if ( ! session_info->thread.ready_event ) + { + DPRINT("Couldn't create thread_ready event\n"); + return MMSYSERR_NOMEM; + } + + /* This is our "go" event, sent when we want the thread to do something */ + + session_info->thread.go_event = CreateEvent(NULL, FALSE, FALSE, NULL); + + if ( ! session_info->thread.go_event ) + { + DPRINT("Couldn't create thread_go event\n"); + CloseHandle(session_info->thread.ready_event); + return MMSYSERR_NOMEM; + } + + /* TODO - other kinds of devices need attention, too */ + task = ( session_info->device_type == WaveOutDevice ) + ? (LPTASKCALLBACK) WaveThread : NULL; + + ASSERT(task); + + /* Effectively, this is a beefed-up CreateThread */ + + result = mmTaskCreate(task, + &session_info->thread.handle, + (DWORD) session_info); + + if ( result != MMSYSERR_NOERROR ) + { + DPRINT("Task creation failed\n"); + CloseHandle(session_info->thread.ready_event); + CloseHandle(session_info->thread.go_event); + return result; + } + + /* Wait for the thread to be ready before completing */ + + WaitForSingleObject(session_info->thread.ready_event, INFINITE); + + return MMSYSERR_NOERROR; +} + + +/* + The session thread is pretty simple. Upon creation, it announces that it + is ready to do stuff for us. When we want it to perform an action, we use + CallSessionThread with an appropriate function and parameter, then tell + the thread we want it to do something. When it's finished, it announces + that it is ready once again. +*/ + +MMRESULT +CallSessionThread( + SessionInfo* session_info, + ThreadFunction function, + PVOID thread_parameter) +{ + ASSERT(session_info); + + session_info->thread.function = function; + session_info->thread.parameter = thread_parameter; + + DPRINT("Calling session thread\n"); + SetEvent(session_info->thread.go_event); + + DPRINT("Waiting for thread response\n"); + WaitForSingleObject(session_info->thread.ready_event, INFINITE); + + return session_info->thread.result; +} + + +DWORD +HandleBySessionThread( + DWORD private_handle, + DWORD message, + DWORD parameter) +{ + return CallSessionThread((SessionInfo*) private_handle, + message, + (PVOID) parameter); +} diff --git a/reactos/dll/win32/mmdrv/wave_io.c b/reactos/dll/win32/mmdrv/wave_io.c index a7923cb29dd..3c34e0211d2 100644 --- a/reactos/dll/win32/mmdrv/wave_io.c +++ b/reactos/dll/win32/mmdrv/wave_io.c @@ -1,40 +1,40 @@ -/* - Don't use this. -*/ - -#include - -/* - Complete a partial wave buffer transaction -*/ - -void -CompleteWaveOverlap( - DWORD error_code, - DWORD bytes_transferred, - LPOVERLAPPED overlapped) -{ - DPRINT("Complete partial wave overlap\n"); -} - -/* - Helper function to set up loops -*/ - -VOID -UpdateWaveLoop(SessionInfo* session_info) -{ -} - - -/* - The hub of all wave I/O. This ensures a constant stream of buffers are - passed between the land of usermode and kernelmode. -*/ - -VOID -PerformWaveIO( - SessionInfo* session_info) -{ - -} +/* + Don't use this. +*/ + +#include + +/* + Complete a partial wave buffer transaction +*/ + +void +CompleteWaveOverlap( + DWORD error_code, + DWORD bytes_transferred, + LPOVERLAPPED overlapped) +{ + DPRINT("Complete partial wave overlap\n"); +} + +/* + Helper function to set up loops +*/ + +VOID +UpdateWaveLoop(SessionInfo* session_info) +{ +} + + +/* + The hub of all wave I/O. This ensures a constant stream of buffers are + passed between the land of usermode and kernelmode. +*/ + +VOID +PerformWaveIO( + SessionInfo* session_info) +{ + +} diff --git a/reactos/dll/win32/mpr/nps.c b/reactos/dll/win32/mpr/nps.c index 2f75674b903..a290e28f8ef 100644 --- a/reactos/dll/win32/mpr/nps.c +++ b/reactos/dll/win32/mpr/nps.c @@ -82,7 +82,7 @@ static INT_PTR WINAPI NPS_ProxyPasswordDialog( hitem = GetDlgItem( hdlg, IDC_USERNAME ); if( hitem ) GetWindowTextA( hitem, lpAuthDlgStruct->lpUsername, lpAuthDlgStruct->cbUsername ); - + password[0] = 0; hitem = GetDlgItem( hdlg, IDC_PASSWORD ); if( hitem ) @@ -119,7 +119,7 @@ DWORD WINAPI NPSAuthenticationDialogA( LPAUTHDLGSTRUCTA lpAuthDlgStruct ) lpAuthDlgStruct->lpOUTitle, lpAuthDlgStruct->lpExplainText); return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ), - lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog, + lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog, (LPARAM) lpAuthDlgStruct ); } diff --git a/reactos/dll/win32/mpr/pwcache.c b/reactos/dll/win32/mpr/pwcache.c index f8d3e322041..6678dac2fda 100644 --- a/reactos/dll/win32/mpr/pwcache.c +++ b/reactos/dll/win32/mpr/pwcache.c @@ -107,7 +107,7 @@ DWORD WINAPI WNetCachePassword( valname = MPR_GetValueName( pbResource, cbResource, nType ); if( valname ) { - r = RegSetValueExA( hkey, valname, 0, REG_BINARY, + r = RegSetValueExA( hkey, valname, 0, REG_BINARY, (LPBYTE)pbPassword, cbPassword ); if( r ) r = WN_CANCEL; @@ -221,9 +221,9 @@ DWORD WINAPI WNetGetCachedPassword( * * NOTES * the parameter count is verifyed - * + * * This function is a huge security risk, as virii and such can use - * it to grab all the passwords in the cache. It's bad enough to + * it to grab all the passwords in the cache. It's bad enough to * store the passwords (insecurely). * * bpPrefix and cbPrefix are used to filter the returned passwords @@ -306,7 +306,7 @@ UINT WINAPI WNetEnumCachedPasswords( entry->cbPassword = data_sz; entry->iEntry = i; entry->nType = nType; - r = RegEnumValueA( hkey, i, NULL, &val_sz, NULL, &type, + r = RegEnumValueA( hkey, i, NULL, &val_sz, NULL, &type, &entry->abResource[val_sz], &data_sz ); if( r == ERROR_SUCCESS ) enumPasswordProc( entry, param ); diff --git a/reactos/dll/win32/mpr/wnet.c b/reactos/dll/win32/mpr/wnet.c index 9a6a9ef1b67..afc7c06517b 100644 --- a/reactos/dll/win32/mpr/wnet.c +++ b/reactos/dll/win32/mpr/wnet.c @@ -133,7 +133,7 @@ static void _tryLoadProvider(PCWSTR provider) { static const WCHAR szProviderName[] = { 'N','a','m','e',0 }; PWSTR name = NULL; - + size = 0; RegQueryValueExW(hKey, szProviderName, NULL, NULL, NULL, &size); if (size) @@ -893,7 +893,7 @@ static DWORD _enumerateProvidersW(PWNetEnumerator enumerator, LPDWORD lpcCount, if (*lpBufferSize < sizeof(NETRESOURCEA)) return WN_MORE_DATA; - if (!providerTable || enumerator->providerIndex >= + if (!providerTable || enumerator->providerIndex >= providerTable->numProviders) ret = WN_NO_MORE_ENTRIES; else diff --git a/reactos/dll/win32/msacm32/format.c b/reactos/dll/win32/msacm32/format.c index b64f8b0db5d..e44b5b780b1 100644 --- a/reactos/dll/win32/msacm32/format.c +++ b/reactos/dll/win32/msacm32/format.c @@ -789,8 +789,8 @@ MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, /* (WS) MSDN info page says that if had != 0, then we should find * the specific driver to get its tags from. Therefore I'm removing * the FIXME call and adding a search block below. It also seems - * that the lack of this functionality was the responsible for - * codecs to be multiply and incorrectly listed. + * that the lack of this functionality was the responsible for + * codecs to be multiply and incorrectly listed. */ /* if (had) FIXME("had != NULL, not supported\n"); */ @@ -815,7 +815,7 @@ MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, if (bPcmDone) continue; bPcmDone = TRUE; } - if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport)) + if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport)) return MMSYSERR_NOERROR; } } diff --git a/reactos/dll/win32/msacm32/internal.c b/reactos/dll/win32/msacm32/internal.c index 9cb8002a380..05e54e88109 100644 --- a/reactos/dll/win32/msacm32/internal.c +++ b/reactos/dll/win32/msacm32/internal.c @@ -241,7 +241,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileNa { PWINE_ACMDRIVERID padid; - TRACE("(%s, %s, %p)\n", + TRACE("(%s, %s, %p)\n", debugstr_w(pszDriverAlias), debugstr_w(pszFileName), hinstModule); padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID)); diff --git a/reactos/dll/win32/msi/action.c b/reactos/dll/win32/msi/action.c index b7e0fe6841d..e500c47aed1 100644 --- a/reactos/dll/win32/msi/action.c +++ b/reactos/dll/win32/msi/action.c @@ -74,90 +74,90 @@ static const WCHAR szWriteRegistryValues[] = 'V','a','l','u','e','s',0}; static const WCHAR szCostInitialize[] = {'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0}; -static const WCHAR szFileCost[] = +static const WCHAR szFileCost[] = {'F','i','l','e','C','o','s','t',0}; -static const WCHAR szInstallInitialize[] = +static const WCHAR szInstallInitialize[] = {'I','n','s','t','a','l','l','I','n','i','t','i','a','l','i','z','e',0}; -static const WCHAR szInstallValidate[] = +static const WCHAR szInstallValidate[] = {'I','n','s','t','a','l','l','V','a','l','i','d','a','t','e',0}; -static const WCHAR szLaunchConditions[] = +static const WCHAR szLaunchConditions[] = {'L','a','u','n','c','h','C','o','n','d','i','t','i','o','n','s',0}; -static const WCHAR szProcessComponents[] = +static const WCHAR szProcessComponents[] = {'P','r','o','c','e','s','s','C','o','m','p','o','n','e','n','t','s',0}; -static const WCHAR szRegisterTypeLibraries[] = +static const WCHAR szRegisterTypeLibraries[] = {'R','e','g','i','s','t','e','r','T','y','p','e', 'L','i','b','r','a','r','i','e','s',0}; -const WCHAR szRegisterClassInfo[] = +const WCHAR szRegisterClassInfo[] = {'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0}; -const WCHAR szRegisterProgIdInfo[] = +const WCHAR szRegisterProgIdInfo[] = {'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0}; -static const WCHAR szCreateShortcuts[] = +static const WCHAR szCreateShortcuts[] = {'C','r','e','a','t','e','S','h','o','r','t','c','u','t','s',0}; -static const WCHAR szPublishProduct[] = +static const WCHAR szPublishProduct[] = {'P','u','b','l','i','s','h','P','r','o','d','u','c','t',0}; -static const WCHAR szWriteIniValues[] = +static const WCHAR szWriteIniValues[] = {'W','r','i','t','e','I','n','i','V','a','l','u','e','s',0}; -static const WCHAR szSelfRegModules[] = +static const WCHAR szSelfRegModules[] = {'S','e','l','f','R','e','g','M','o','d','u','l','e','s',0}; -static const WCHAR szPublishFeatures[] = +static const WCHAR szPublishFeatures[] = {'P','u','b','l','i','s','h','F','e','a','t','u','r','e','s',0}; -static const WCHAR szRegisterProduct[] = +static const WCHAR szRegisterProduct[] = {'R','e','g','i','s','t','e','r','P','r','o','d','u','c','t',0}; -static const WCHAR szInstallExecute[] = +static const WCHAR szInstallExecute[] = {'I','n','s','t','a','l','l','E','x','e','c','u','t','e',0}; -static const WCHAR szInstallExecuteAgain[] = +static const WCHAR szInstallExecuteAgain[] = {'I','n','s','t','a','l','l','E','x','e','c','u','t','e', 'A','g','a','i','n',0}; -static const WCHAR szInstallFinalize[] = +static const WCHAR szInstallFinalize[] = {'I','n','s','t','a','l','l','F','i','n','a','l','i','z','e',0}; -static const WCHAR szForceReboot[] = +static const WCHAR szForceReboot[] = {'F','o','r','c','e','R','e','b','o','o','t',0}; static const WCHAR szResolveSource[] = {'R','e','s','o','l','v','e','S','o','u','r','c','e',0}; -static const WCHAR szAppSearch[] = +static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0}; -static const WCHAR szAllocateRegistrySpace[] = +static const WCHAR szAllocateRegistrySpace[] = {'A','l','l','o','c','a','t','e','R','e','g','i','s','t','r','y', 'S','p','a','c','e',0}; -static const WCHAR szBindImage[] = +static const WCHAR szBindImage[] = {'B','i','n','d','I','m','a','g','e',0}; -static const WCHAR szCCPSearch[] = +static const WCHAR szCCPSearch[] = {'C','C','P','S','e','a','r','c','h',0}; -static const WCHAR szDeleteServices[] = +static const WCHAR szDeleteServices[] = {'D','e','l','e','t','e','S','e','r','v','i','c','e','s',0}; -static const WCHAR szDisableRollback[] = +static const WCHAR szDisableRollback[] = {'D','i','s','a','b','l','e','R','o','l','l','b','a','c','k',0}; -static const WCHAR szExecuteAction[] = +static const WCHAR szExecuteAction[] = {'E','x','e','c','u','t','e','A','c','t','i','o','n',0}; -const WCHAR szFindRelatedProducts[] = +const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t','e','d', 'P','r','o','d','u','c','t','s',0}; -static const WCHAR szInstallAdminPackage[] = +static const WCHAR szInstallAdminPackage[] = {'I','n','s','t','a','l','l','A','d','m','i','n', 'P','a','c','k','a','g','e',0}; -static const WCHAR szInstallSFPCatalogFile[] = +static const WCHAR szInstallSFPCatalogFile[] = {'I','n','s','t','a','l','l','S','F','P','C','a','t','a','l','o','g', 'F','i','l','e',0}; -static const WCHAR szIsolateComponents[] = +static const WCHAR szIsolateComponents[] = {'I','s','o','l','a','t','e','C','o','m','p','o','n','e','n','t','s',0}; -const WCHAR szMigrateFeatureStates[] = +const WCHAR szMigrateFeatureStates[] = {'M','i','g','r','a','t','e','F','e','a','t','u','r','e', 'S','t','a','t','e','s',0}; -const WCHAR szMoveFiles[] = +const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0}; -static const WCHAR szMsiPublishAssemblies[] = +static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h', 'A','s','s','e','m','b','l','i','e','s',0}; -static const WCHAR szMsiUnpublishAssemblies[] = +static const WCHAR szMsiUnpublishAssemblies[] = {'M','s','i','U','n','p','u','b','l','i','s','h', 'A','s','s','e','m','b','l','i','e','s',0}; -static const WCHAR szInstallODBC[] = +static const WCHAR szInstallODBC[] = {'I','n','s','t','a','l','l','O','D','B','C',0}; -static const WCHAR szInstallServices[] = +static const WCHAR szInstallServices[] = {'I','n','s','t','a','l','l','S','e','r','v','i','c','e','s',0}; -const WCHAR szPatchFiles[] = +const WCHAR szPatchFiles[] = {'P','a','t','c','h','F','i','l','e','s',0}; -static const WCHAR szPublishComponents[] = +static const WCHAR szPublishComponents[] = {'P','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t','s',0}; static const WCHAR szRegisterComPlus[] = {'R','e','g','i','s','t','e','r','C','o','m','P','l','u','s',0}; @@ -250,10 +250,10 @@ static struct _actions StandardActions[]; static void ui_actionstart(MSIPACKAGE *package, LPCWSTR action) { - static const WCHAR Query_t[] = + static const WCHAR Query_t[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','A','c','t','i','o', 'n','T','e','x','t','`',' ', - 'W','H','E','R','E', ' ','`','A','c','t','i','o','n','`',' ','=', + 'W','H','E','R','E', ' ','`','A','c','t','i','o','n','`',' ','=', ' ','\'','%','s','\'',0}; MSIRECORD * row; @@ -264,7 +264,7 @@ static void ui_actionstart(MSIPACKAGE *package, LPCWSTR action) msiobj_release(&row->hdr); } -static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, +static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, UINT rc) { MSIRECORD * row; @@ -275,7 +275,7 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, {'A','c','t','i','o','n',' ','e','n','d','e','d',' ','%','s',':',' ', '%','s', '.',' ','R','e','t','u','r','n',' ','v','a','l','u','e',' ', '%','i','.',0}; - static const WCHAR format[] = + static const WCHAR format[] = {'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0}; WCHAR message[1024]; WCHAR timet[0x100]; @@ -285,10 +285,10 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, sprintfW(message,template_s,timet,action); else sprintfW(message,template_e,timet,action,rc); - + row = MSI_CreateRecord(1); MSI_RecordSetStringW(row,1,message); - + MSI_ProcessMessage(package, INSTALLMESSAGE_INFO, row); msiobj_release(&row->hdr); } @@ -304,7 +304,7 @@ static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine ) return ERROR_SUCCESS; ptr = szCommandLine; - + while (*ptr) { if (*ptr==' ') @@ -321,7 +321,7 @@ static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine ) ERR("command line contains unknown string : %s\n", debugstr_w(ptr)); break; } - + quote = FALSE; len = ptr2-ptr; @@ -329,9 +329,9 @@ static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine ) memcpy(prop,ptr,len*sizeof(WCHAR)); prop[len]=0; ptr2++; - - len = 0; - ptr = ptr2; + + len = 0; + ptr = ptr2; while (*ptr && (quote || (!quote && *ptr!=' '))) { if (*ptr == '"') @@ -339,7 +339,7 @@ static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine ) ptr++; len++; } - + if (*ptr2=='"') { ptr2++; @@ -351,7 +351,7 @@ static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine ) if (lstrlenW(prop) > 0) { - TRACE("Found commandline property (%s) = (%s)\n", + TRACE("Found commandline property (%s) = (%s)\n", debugstr_w(prop), debugstr_w(val)); MSI_SetPropertyW(package,prop,val); } @@ -585,7 +585,7 @@ static UINT msi_apply_transforms( MSIPACKAGE *package ) } /**************************************************** - * TOP level entry points + * TOP level entry points *****************************************************/ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, @@ -603,12 +603,12 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, package->script->InWhatSequence = SEQUENCE_INSTALL; - if (szPackagePath) + if (szPackagePath) { LPWSTR p, check, path; - + path = strdupW(szPackagePath); - p = strrchrW(path,'\\'); + p = strrchrW(path,'\\'); if (p) { p++; @@ -655,7 +655,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, } else rc = ACTION_ProcessExecSequence(package,FALSE); - + if (rc == -1) { /* install was halted but should be considered a success */ @@ -667,16 +667,16 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, /* process the ending type action */ if (rc == ERROR_SUCCESS) ACTION_PerformActionSequence(package,-1,ui); - else if (rc == ERROR_INSTALL_USEREXIT) + else if (rc == ERROR_INSTALL_USEREXIT) ACTION_PerformActionSequence(package,-2,ui); - else if (rc == ERROR_INSTALL_SUSPEND) + else if (rc == ERROR_INSTALL_SUSPEND) ACTION_PerformActionSequence(package,-4,ui); else /* failed */ ACTION_PerformActionSequence(package,-3,ui); /* finish up running custom actions */ ACTION_FinishCustomActions(package); - + return rc; } @@ -705,7 +705,7 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI) { LPCWSTR action, cond; - TRACE("Running the actions\n"); + TRACE("Running the actions\n"); /* check conditions */ cond = MSI_RecordGetString(row,2); @@ -789,7 +789,7 @@ UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable, INT iSequenceMode ) static const WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','%','s','`', - ' ','W','H','E','R','E',' ', + ' ','W','H','E','R','E',' ', '`','S','e','q','u','e','n','c','e','`',' ', '>',' ','0',' ','O','R','D','E','R',' ','B','Y',' ', '`','S','e','q','u','e','n','c','e','`',0}; @@ -879,7 +879,7 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package) {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','I','n','s','t','a','l','l', 'U','I','S','e','q','u','e','n','c','e','`', - ' ','W','H','E','R','E',' ', + ' ','W','H','E','R','E',' ', '`','S','e','q','u','e','n','c','e','`',' ', '>',' ','0',' ','O','R','D','E','R',' ','B','Y',' ', '`','S','e','q','u','e','n','c','e','`',0}; @@ -889,10 +889,10 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package) iap.UI = TRUE; rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); - + if (rc == ERROR_SUCCESS) { - TRACE("Running the actions\n"); + TRACE("Running the actions\n"); rc = MSI_IterateRecords(view, NULL, ITERATE_Actions, &iap); msiobj_release(&view->hdr); @@ -904,24 +904,24 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package) /******************************************************** * ACTION helper functions and functions that perform the actions *******************************************************/ -static BOOL ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action, +static BOOL ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action, UINT* rc, BOOL force ) { - BOOL ret = FALSE; + BOOL ret = FALSE; BOOL run = force; int i; if (!run && !package->script->CurrentlyScripting) run = TRUE; - + if (!run) { if (strcmpW(action,szInstallFinalize) == 0 || strcmpW(action,szInstallExecute) == 0 || - strcmpW(action,szInstallExecuteAgain) == 0) + strcmpW(action,szInstallExecuteAgain) == 0) run = TRUE; } - + i = 0; while (StandardActions[i].action != NULL) { @@ -970,17 +970,17 @@ static BOOL ACTION_HandleCustomAction( MSIPACKAGE* package, LPCWSTR action, return ret; } -/* +/* * A lot of actions are really important even if they don't do anything * explicit... Lots of properties are set at the beginning of the installation * CostFinalize does a bunch of work to translate the directories and such - * + * * But until I get write access to the database that is hard, so I am going to * hack it to see if I can get something to run. */ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, BOOL force) { - UINT rc = ERROR_SUCCESS; + UINT rc = ERROR_SUCCESS; BOOL handled; TRACE("Performing action (%s)\n",debugstr_w(action)); @@ -1076,7 +1076,7 @@ static UINT msi_create_directory( MSIPACKAGE* package, LPCWSTR dir ) install_path = resolve_folder(package, dir, FALSE, FALSE, &folder); if (!install_path) - return ERROR_FUNCTION_FAILED; + return ERROR_FUNCTION_FAILED; /* create the path */ if (folder->State == 0) @@ -1105,7 +1105,7 @@ UINT msi_create_component_directories( MSIPACKAGE *package ) } /* - * Also we cannot enable/disable components either, so for now I am just going + * Also we cannot enable/disable components either, so for now I am just going * to do all the directories for all the components. */ static UINT ACTION_CreateFolders(MSIPACKAGE *package) @@ -1162,7 +1162,7 @@ static UINT load_component( MSIRECORD *row, LPVOID param ) static UINT load_all_components( MSIPACKAGE *package ) { static const WCHAR query[] = { - 'S','E','L','E','C','T',' ','*',' ','F','R', 'O','M',' ', + 'S','E','L','E','C','T',' ','*',' ','F','R', 'O','M',' ', '`','C','o','m','p','o','n','e','n','t','`',0 }; MSIQUERY *view; UINT r; @@ -1249,7 +1249,7 @@ static UINT load_feature(MSIRECORD * row, LPVOID param) { MSIPACKAGE* package = (MSIPACKAGE*)param; MSIFEATURE* feature; - static const WCHAR Query1[] = + static const WCHAR Query1[] = {'S','E','L','E','C','T',' ', '`','C','o','m','p','o','n','e','n','t','_','`', ' ','F','R','O','M',' ','`','F','e','a','t','u','r','e', @@ -1268,7 +1268,7 @@ static UINT load_feature(MSIRECORD * row, LPVOID param) list_init( &feature->Children ); list_init( &feature->Components ); - + feature->Feature = msi_dup_record_field( row, 1 ); TRACE("Loading feature %s\n",debugstr_w(feature->Feature)); @@ -1279,7 +1279,7 @@ static UINT load_feature(MSIRECORD * row, LPVOID param) if (!MSI_RecordIsNull(row,5)) feature->Display = MSI_RecordGetInteger(row,5); - + feature->Level= MSI_RecordGetInteger(row,6); feature->Directory = msi_dup_record_field( row, 7 ); feature->Attributes = MSI_RecordGetInteger(row,8); @@ -1335,7 +1335,7 @@ static UINT load_all_features( MSIPACKAGE *package ) if (!list_empty(&package->features)) return ERROR_SUCCESS; - + r = MSI_DatabaseOpenViewW( package->db, query, &view ); if (r != ERROR_SUCCESS) return r; @@ -1372,7 +1372,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param) file = msi_alloc_zero( sizeof (MSIFILE) ); if (!file) return ERROR_NOT_ENOUGH_MEMORY; - + file->File = msi_dup_record_field( row, 1 ); component = MSI_RecordGetString( row, 2 ); @@ -1386,7 +1386,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param) file->ShortName = msi_dup_record_field( row, 3 ); file->LongName = strdupW( folder_split_path(file->ShortName, '|')); - + file->FileSize = MSI_RecordGetInteger( row, 4 ); file->Version = msi_dup_record_field( row, 5 ); file->Language = msi_dup_record_field( row, 6 ); @@ -1411,10 +1411,10 @@ static UINT load_file(MSIRECORD *row, LPVOID param) file->IsCompressed = package->WordCount & MSIWORDCOUNT_COMPRESSED; } - TRACE("File Loaded (%s)\n",debugstr_w(file->File)); + TRACE("File Loaded (%s)\n",debugstr_w(file->File)); list_add_tail( &package->files, &file->entry ); - + return ERROR_SUCCESS; } @@ -1556,12 +1556,12 @@ static MSIFOLDER *load_folder( MSIPACKAGE *package, LPCWSTR dir ) if (!tgt_long) tgt_long = tgt_short; - + if (!src_short) { src_short = tgt_short; src_long = tgt_long; } - + if (!src_long) src_long = src_short; @@ -1576,7 +1576,7 @@ static MSIFOLDER *load_folder( MSIPACKAGE *package, LPCWSTR dir ) TRACE("SourceShort = %s\n", debugstr_w( folder->SourceShortPath )); parent = MSI_RecordGetString(row, 2); - if (parent) + if (parent) { folder->Parent = load_folder( package, parent ); if ( folder->Parent ) @@ -1655,7 +1655,7 @@ static void ACTION_UpdateFeatureInstallStates(MSIPACKAGE *package) } } -static BOOL process_state_property (MSIPACKAGE* package, LPCWSTR property, +static BOOL process_state_property (MSIPACKAGE* package, LPCWSTR property, INSTALLSTATE state) { static const WCHAR all[]={'A','L','L',0}; @@ -2086,9 +2086,9 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package) return MSI_SetFeatureStates(package); } -/* OK this value is "interpreted" and then formatted based on the +/* OK this value is "interpreted" and then formatted based on the first few characters */ -static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type, +static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type, DWORD *size) { LPSTR data = NULL; @@ -2113,9 +2113,9 @@ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type, data = msi_alloc(*size); - byte[0] = '0'; - byte[1] = 'x'; - byte[4] = 0; + byte[0] = '0'; + byte[1] = 'x'; + byte[4] = 0; count = 0; /* if uneven pad with a zero in front */ if (strlenW(ptr)%2) @@ -2147,7 +2147,7 @@ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type, DWORD d = 0; deformat_string(package, &value[1], &deformated); - *type=REG_DWORD; + *type=REG_DWORD; *size = sizeof(DWORD); data = msi_alloc(*size); p = deformated; @@ -2199,7 +2199,7 @@ static LPSTR parse_value(MSIPACKAGE *package, LPCWSTR value, DWORD *type, static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = (MSIPACKAGE*)param; - static const WCHAR szHCR[] = + static const WCHAR szHCR[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_', 'R','O','O','T','\\',0}; static const WCHAR szHCU[] = @@ -2253,7 +2253,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) /* null values can have special meanings */ if (name[0]=='-' && name[1] == 0) return ERROR_SUCCESS; - else if ((name[0]=='+' && name[1] == 0) || + else if ((name[0]=='+' && name[1] == 0) || (name[0] == '*' && name[1] == 0)) name = NULL; check_first = TRUE; @@ -2265,7 +2265,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) /* get the root key */ switch (root) { - case -1: + case -1: { static const WCHAR szALLUSER[] = {'A','L','L','U','S','E','R','S',0}; LPWSTR all_users = msi_dup_property( package, szALLUSER ); @@ -2282,7 +2282,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) msi_free(all_users); } break; - case 0: root_key = HKEY_CLASSES_ROOT; + case 0: root_key = HKEY_CLASSES_ROOT; szRoot = szHCR; break; case 1: root_key = HKEY_CURRENT_USER; @@ -2291,7 +2291,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) case 2: root_key = HKEY_LOCAL_MACHINE; szRoot = szHLM; break; - case 3: root_key = HKEY_USERS; + case 3: root_key = HKEY_USERS; szRoot = szHU; break; default: @@ -2320,7 +2320,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param) value = MSI_RecordGetString(row,5); if (value) - value_data = parse_value(package, value, &type, &size); + value_data = parse_value(package, value, &type, &size); else { static const WCHAR szEmpty[] = {0}; @@ -2445,14 +2445,14 @@ static UINT ACTION_InstallValidate(MSIPACKAGE *package) debugstr_w(feature->Feature), feature->Installed, feature->Action, feature->ActionRequest); } - + return ERROR_SUCCESS; } static UINT ITERATE_LaunchConditions(MSIRECORD *row, LPVOID param) { MSIPACKAGE* package = (MSIPACKAGE*)param; - LPCWSTR cond = NULL; + LPCWSTR cond = NULL; LPCWSTR message = NULL; static const WCHAR title[]= {'I','n','s','t','a','l','l',' ','F','a', 'i','l','e','d',0}; @@ -2463,7 +2463,7 @@ static UINT ITERATE_LaunchConditions(MSIRECORD *row, LPVOID param) { LPWSTR deformated; message = MSI_RecordGetString(row,2); - deformat_string(package,message,&deformated); + deformat_string(package,message,&deformated); MessageBoxW(NULL,deformated,title,MB_OK); msi_free(deformated); return ERROR_FUNCTION_FAILED; @@ -2576,7 +2576,7 @@ static UINT ACTION_GetSharedDLLsCount(LPCWSTR dll) DWORD type; DWORD sz = sizeof(count); DWORD rc; - + hkey = openSharedDLLsKey(); rc = RegQueryValueExW(hkey, dll, NULL, &type, (LPBYTE)&count, &sz); if (rc != ERROR_SUCCESS) @@ -2608,8 +2608,8 @@ static void ACTION_RefCountComponent( MSIPACKAGE* package, MSICOMPONENT *comp ) BOOL write = FALSE; /* only refcount DLLs */ - if (comp->KeyPath == NULL || - comp->Attributes & msidbComponentAttributesRegistryKeyPath || + if (comp->KeyPath == NULL || + comp->Attributes & msidbComponentAttributesRegistryKeyPath || comp->Attributes & msidbComponentAttributesODBCDataSource) write = FALSE; else @@ -2662,11 +2662,11 @@ static void ACTION_RefCountComponent( MSIPACKAGE* package, MSICOMPONENT *comp ) ACTION_WriteSharedDLLsCount( file->TargetPath, count ); } } - + /* add a count for permenent */ if (comp->Attributes & msidbComponentAttributesPermanent) count ++; - + comp->RefCount = count; if (write) @@ -2706,7 +2706,7 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) continue; squash_guid(comp->ComponentId,squished_cc); - + msi_free(comp->FullKeypath); comp->FullKeypath = resolve_keypath( package, comp ); @@ -2776,7 +2776,7 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) ui_actiondata(package,szProcessComponents,uirow); msiobj_release( &uirow->hdr ); } - } + } RegCloseKey(hkey); return rc; } @@ -2789,13 +2789,13 @@ typedef struct { ITypeLib *ptLib; } typelib_struct; -static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType, +static BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam) { TLIBATTR *attr; typelib_struct *tl_struct = (typelib_struct*) lParam; static const WCHAR fmt[] = {'%','s','\\','%','i',0}; - int sz; + int sz; HRESULT res; if (!IS_INTRESOURCE(lpszName)) @@ -2867,7 +2867,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param) comp->Action = INSTALLSTATE_LOCAL; - file = get_loaded_file( package, comp->KeyPath ); + file = get_loaded_file( package, comp->KeyPath ); if (!file) return ERROR_SUCCESS; @@ -2924,7 +2924,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param) static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package) { - /* + /* * OK this is a bit confusing.. I am given a _Component key and I believe * that the file that is being registered as a type library is the "key file * of that component" which I interpret to mean "The file in the KeyPath of @@ -3045,7 +3045,7 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param) if (!MSI_RecordIsNull(row,9)) { LPWSTR Path; - INT index; + INT index; buffer = MSI_RecordGetString(row,9); @@ -3076,7 +3076,7 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param) TRACE("Writing shortcut to %s\n",debugstr_w(target_file)); IPersistFile_Save(pf,target_file,FALSE); - msi_free(target_file); + msi_free(target_file); err: if (pf) @@ -3147,7 +3147,7 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param) return ERROR_SUCCESS; } - do + do { DWORD write; sz = 1024; @@ -3155,7 +3155,7 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param) if (rc != ERROR_SUCCESS) { ERR("Failed to get stream\n"); - CloseHandle(the_file); + CloseHandle(the_file); DeleteFileW(FilePath); break; } @@ -3175,7 +3175,7 @@ static UINT ITERATE_PublishProduct(MSIRECORD *row, LPVOID param) } /* - * 99% of the work done here is only done for + * 99% of the work done here is only done for * advertised installs. However this is where the * Icon table is processed and written out * so that is what I am going to do here. @@ -3244,15 +3244,15 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) msi_reg_set_val_dword( hkey, INSTALLPROPERTY_VERSIONW, verdword ); } msi_free(buffer); - + /* FIXME: Need to write more keys to the user registry */ - + hDb= alloc_msihandle( &package->db->hdr ); if (!hDb) { rc = ERROR_NOT_ENOUGH_MEMORY; goto end; } - rc = MsiGetSummaryInformationW(hDb, NULL, 0, &hSumInfo); + rc = MsiGetSummaryInformationW(hDb, NULL, 0, &hSumInfo); MsiCloseHandle(hDb); if (rc == ERROR_SUCCESS) { @@ -3317,7 +3317,7 @@ static UINT ITERATE_WriteIniValues(MSIRECORD *row, LPVOID param) comp->Action = INSTALLSTATE_LOCAL; - identifier = MSI_RecordGetString(row,1); + identifier = MSI_RecordGetString(row,1); filename = MSI_RecordGetString(row,2); dirproperty = MSI_RecordGetString(row,3); section = MSI_RecordGetString(row,4); @@ -3392,7 +3392,7 @@ static UINT ACTION_WriteIniValues(MSIPACKAGE *package) { UINT rc; MSIQUERY * view; - static const WCHAR ExecSeqQuery[] = + static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','I','n','i','F','i','l','e','`',0}; @@ -3471,7 +3471,7 @@ static UINT ACTION_SelfRegModules(MSIPACKAGE *package) { UINT rc; MSIQUERY * view; - static const WCHAR ExecSeqQuery[] = + static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','S','e','l','f','R','e','g','`',0}; @@ -3494,7 +3494,7 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) UINT rc; HKEY hkey=0; HKEY hukey=0; - + rc = MSIREG_OpenFeaturesKey(package->ProductCode,&hkey,TRUE); if (rc != ERROR_SUCCESS) goto end; @@ -3692,18 +3692,18 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) LPWSTR buffer = NULL; UINT rc; DWORD size, langid; - static const WCHAR szWindowsInstaller[] = + static const WCHAR szWindowsInstaller[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0}; - static const WCHAR szUpgradeCode[] = + static const WCHAR szUpgradeCode[] = {'U','p','g','r','a','d','e','C','o','d','e',0}; - static const WCHAR modpath_fmt[] = + static const WCHAR modpath_fmt[] = {'M','s','i','E','x','e','c','.','e','x','e',' ', '/','I','[','P','r','o','d','u','c','t','C','o','d','e',']',0}; - static const WCHAR szModifyPath[] = + static const WCHAR szModifyPath[] = {'M','o','d','i','f','y','P','a','t','h',0}; - static const WCHAR szUninstallString[] = + static const WCHAR szUninstallString[] = {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0}; - static const WCHAR szEstimatedSize[] = + static const WCHAR szEstimatedSize[] = {'E','s','t','i','m','a','t','e','d','S','i','z','e',0}; static const WCHAR szProductLanguage[] = {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; @@ -3713,7 +3713,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) SYSTEMTIME systime; static const WCHAR date_fmt[] = {'%','i','%','i','%','i',0}; LPWSTR upgrade_code; - WCHAR szDate[9]; + WCHAR szDate[9]; rc = MSIREG_OpenUninstallKey(package->ProductCode,&hkey,TRUE); if (rc != ERROR_SUCCESS) @@ -3725,7 +3725,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) msi_write_uninstall_property_vals( package, hkey ); msi_reg_set_val_dword( hkey, szWindowsInstaller, 1 ); - + msi_make_package_local( package, hkey ); /* do ModifyPath and UninstallString */ @@ -3736,11 +3736,11 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) /* FIXME: Write real Estimated Size when we have it */ msi_reg_set_val_dword( hkey, szEstimatedSize, 0 ); - + GetLocalTime(&systime); sprintfW(szDate,date_fmt,systime.wYear,systime.wMonth,systime.wDay); msi_reg_set_val_str( hkey, INSTALLPROPERTY_INSTALLDATEW, szDate ); - + langid = msi_get_property_int( package, szProductLanguage, 0 ); msi_reg_set_val_dword( hkey, INSTALLPROPERTY_LANGUAGEW, langid ); @@ -3754,7 +3754,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) msi_reg_set_val_dword( hkey, INSTALLPROPERTY_VERSIONMINORW, (verdword>>16)&0x00FF ); } msi_free(buffer); - + /* Handle Upgrade Codes */ upgrade_code = msi_dup_property( package, szUpgradeCode ); if (upgrade_code) @@ -3772,7 +3772,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) msi_free(upgrade_code); } - + RegCloseKey(hkey); /* FIXME: call ui_actiondata */ @@ -3857,7 +3857,7 @@ static UINT ACTION_ResolveSource(MSIPACKAGE* package) DWORD attrib, len; LPWSTR ptr, source; UINT rc; - + /* * we are currently doing what should be done here in the top level Install * however for Adminastrative and uninstalls this step will be needed @@ -3885,13 +3885,13 @@ static UINT ACTION_ResolveSource(MSIPACKAGE* package) LPWSTR msg; DWORD size = 0; - rc = MsiSourceListGetInfoW(package->ProductCode, NULL, + rc = MsiSourceListGetInfoW(package->ProductCode, NULL, MSIINSTALLCONTEXT_USERMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTW,NULL,&size); if (rc == ERROR_MORE_DATA) { prompt = msi_alloc(size * sizeof(WCHAR)); - MsiSourceListGetInfoW(package->ProductCode, NULL, + MsiSourceListGetInfoW(package->ProductCode, NULL, MSIINSTALLCONTEXT_USERMANAGED, MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTW,prompt,&size); } @@ -3925,7 +3925,7 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package) LPWSTR productid; UINT rc,i; - static const WCHAR szPropKeys[][80] = + static const WCHAR szPropKeys[][80] = { {'P','r','o','d','u','c','t','I','D',0}, {'U','S','E','R','N','A','M','E',0}, @@ -3933,7 +3933,7 @@ static UINT ACTION_RegisterUser(MSIPACKAGE *package) {0}, }; - static const WCHAR szRegKeys[][80] = + static const WCHAR szRegKeys[][80] = { {'P','r','o','d','u','c','t','I','D',0}, {'R','e','g','O','w','n','e','r',0}, @@ -3995,7 +3995,7 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param) component = MSI_RecordGetString(rec,3); comp = get_loaded_component(package,component); - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL ) && + if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL ) && !ACTION_VerifyComponentForAction( comp, INSTALLSTATE_SOURCE ) && !ACTION_VerifyComponentForAction( comp, INSTALLSTATE_ADVERTISED )) { @@ -4011,10 +4011,10 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param) rc = MSIREG_OpenUserComponentsKey(compgroupid, &hkey, TRUE); if (rc != ERROR_SUCCESS) goto end; - + text = MSI_RecordGetString(rec,4); feature = MSI_RecordGetString(rec,5); - + advertise = create_component_advertise_string(package, comp, feature); sz = strlenW(advertise); @@ -4024,7 +4024,7 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param) sz+=3; sz *= sizeof(WCHAR); - + output = msi_alloc_zero(sz); strcpyW(output,advertise); msi_free(advertise); @@ -4033,7 +4033,7 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param) strcatW(output,text); msi_reg_set_val_multi_str( hkey, qualifier, output ); - + end: RegCloseKey(hkey); msi_free(output); @@ -4061,7 +4061,7 @@ static UINT ACTION_PublishComponents(MSIPACKAGE *package) {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','P','u','b','l','i','s','h', 'C','o','m','p','o','n','e','n','t','`',0}; - + rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4155,7 +4155,7 @@ static UINT ACTION_InstallServices( MSIPACKAGE *package ) static const WCHAR ExecSeqQuery[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', 'S','e','r','v','i','c','e','I','n','s','t','a','l','l',0}; - + rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; @@ -4175,7 +4175,7 @@ static UINT msi_unimplemented_action_stub( MSIPACKAGE *package, MSIQUERY *view = NULL; DWORD count = 0; UINT r; - + r = MSI_OpenQuery( package->db, &view, query, table ); if (r == ERROR_SUCCESS) { diff --git a/reactos/dll/win32/msi/classes.c b/reactos/dll/win32/msi/classes.c index d34534f9777..212d6693752 100644 --- a/reactos/dll/win32/msi/classes.c +++ b/reactos/dll/win32/msi/classes.c @@ -64,7 +64,7 @@ static MSIAPPID *load_appid( MSIPACKAGE* package, MSIRECORD *row ) appid = msi_alloc_zero( sizeof(MSIAPPID) ); if (!appid) return NULL; - + appid->AppID = msi_dup_record_field( row, 1 ); TRACE("loading appid %s\n", debugstr_w( appid->AppID )); @@ -79,7 +79,7 @@ static MSIAPPID *load_appid( MSIPACKAGE* package, MSIRECORD *row ) appid->RunAsInteractiveUser = !MSI_RecordIsNull(row,7); list_add_tail( &package->appids, &appid->entry ); - + return appid; } @@ -104,7 +104,7 @@ static MSIAPPID *load_given_appid( MSIPACKAGE *package, LPCWSTR name ) return appid; } } - + row = MSI_QueryGetRecord(package->db, ExecSeqQuery, name); if (!row) return NULL; @@ -148,13 +148,13 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row ) if (!MSI_RecordIsNull(row,6)) { - INT icon_index = MSI_RecordGetInteger(row,6); + INT icon_index = MSI_RecordGetInteger(row,6); LPCWSTR FileName = MSI_RecordGetString(row,5); LPWSTR FilePath; static const WCHAR fmt[] = {'%','s',',','%','i',0}; FilePath = build_icon_path(package,FileName); - + progid->IconPath = msi_alloc( (strlenW(FilePath)+10)* sizeof(WCHAR) ); sprintfW(progid->IconPath,fmt,FilePath,icon_index); @@ -184,7 +184,7 @@ static MSIPROGID *load_progid( MSIPACKAGE* package, MSIRECORD *row ) progid->CurVer = parent; parent->VersionInd = progid; } - + return progid; } @@ -209,7 +209,7 @@ static MSIPROGID *load_given_progid(MSIPACKAGE *package, LPCWSTR name) return progid; } } - + row = MSI_QueryGetRecord( package->db, ExecSeqQuery, name ); if (!row) return NULL; @@ -254,13 +254,13 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row ) if (!MSI_RecordIsNull(row,9)) { - INT icon_index = MSI_RecordGetInteger(row,9); + INT icon_index = MSI_RecordGetInteger(row,9); LPCWSTR FileName = MSI_RecordGetString(row,8); LPWSTR FilePath; static const WCHAR fmt[] = {'%','s',',','%','i',0}; FilePath = build_icon_path(package,FileName); - + cls->IconPath = msi_alloc( (strlenW(FilePath)+5)* sizeof(WCHAR) ); sprintfW(cls->IconPath,fmt,FilePath,icon_index); @@ -309,15 +309,15 @@ static MSICLASS *load_class( MSIPACKAGE* package, MSIRECORD *row ) cls->Feature = get_loaded_feature(package,buffer); cls->Attributes = MSI_RecordGetInteger(row,13); - + return cls; } /* - * the Class table has 3 primary keys. Generally it is only + * the Class table has 3 primary keys. Generally it is only * referenced through the first CLSID key. However when loading * all of the classes we need to make sure we do not ignore rows - * with other Context and ComponentIndexs + * with other Context and ComponentIndexs */ static MSICLASS *load_given_class(MSIPACKAGE *package, LPCWSTR classid) { @@ -330,7 +330,7 @@ static MSICLASS *load_given_class(MSIPACKAGE *package, LPCWSTR classid) if (!classid) return NULL; - + /* check for classes already loaded */ LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry ) { @@ -364,7 +364,7 @@ static MSIMIME *load_mime( MSIPACKAGE* package, MSIRECORD *row ) if (!mt) return mt; - mt->ContentType = msi_dup_record_field( row, 1 ); + mt->ContentType = msi_dup_record_field( row, 1 ); TRACE("loading mime %s\n", debugstr_w(mt->ContentType)); buffer = MSI_RecordGetString( row, 2 ); @@ -390,7 +390,7 @@ static MSIMIME *load_given_mime( MSIPACKAGE *package, LPCWSTR mime ) if (!mime) return NULL; - + /* check for mime already loaded */ LIST_FOR_EACH_ENTRY( mt, &package->mimes, MSIMIME, entry ) { @@ -400,7 +400,7 @@ static MSIMIME *load_given_mime( MSIPACKAGE *package, LPCWSTR mime ) return mt; } } - + row = MSI_QueryGetRecord(package->db, ExecSeqQuery, mime); if (!row) return NULL; @@ -446,7 +446,7 @@ static MSIEXTENSION *load_extension( MSIPACKAGE* package, MSIRECORD *row ) /* * While the extension table has 2 primary keys, this function is only looking - * at the Extension key which is what is referenced as a forign key + * at the Extension key which is what is referenced as a forign key */ static MSIEXTENSION *load_given_extension( MSIPACKAGE *package, LPCWSTR name ) { @@ -471,7 +471,7 @@ static MSIEXTENSION *load_given_extension( MSIPACKAGE *package, LPCWSTR name ) return ext; } } - + row = MSI_QueryGetRecord( package->db, ExecSeqQuery, name ); if (!row) return NULL; @@ -515,7 +515,7 @@ static UINT iterate_load_verb(MSIRECORD *row, LPVOID param) /* assosiate the verb with the correct extension */ list_add_tail( &extension->verbs, &verb->entry ); - + return ERROR_SUCCESS; } @@ -546,7 +546,7 @@ static UINT iterate_all_classes(MSIRECORD *rec, LPVOID param) break; } } - + if (!match) load_class(package, rec); @@ -751,7 +751,7 @@ static UINT register_appid(MSIAPPID *appid, LPCWSTR app ) {'A','c','t','i','v','a','t','e','A','s','S','t','o','r','a','g','e',0}; static const WCHAR szY[] = {'Y',0}; static const WCHAR szRunAs[] = {'R','u','n','A','s',0}; - static const WCHAR szUser[] = + static const WCHAR szUser[] = {'I','n','t','e','r','a','c','t','i','v','e',' ','U','s','e','r',0}; HKEY hkey2,hkey3; @@ -785,11 +785,11 @@ static UINT register_appid(MSIAPPID *appid, LPCWSTR app ) UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) { - /* + /* * Again I am assuming the words, "Whose key file represents" when referring * to a Component as to meaning that Components KeyPath file */ - + UINT rc; MSIRECORD *uirow; static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 }; @@ -888,7 +888,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) if (cls->ProgID && cls->ProgID->VersionInd) { - msi_reg_set_subkey_val( hkey2, szVIProgID, NULL, + msi_reg_set_subkey_val( hkey2, szVIProgID, NULL, cls->ProgID->VersionInd->ProgID ); } } @@ -904,7 +904,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) if (cls->IconPath) { - static const WCHAR szDefaultIcon[] = + static const WCHAR szDefaultIcon[] = {'D','e','f','a','u','l','t','I','c','o','n',0}; msi_reg_set_subkey_val( hkey2, szDefaultIcon, NULL, cls->IconPath ); @@ -925,7 +925,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) msi_reg_set_subkey_val( hkey2, szInproc32, NULL, cls->DefInprocHandler32 ); } - + RegCloseKey(hkey2); /* if there is a FileTypeMask, register the FileType */ @@ -954,7 +954,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) index ++; } } - + uirow = MSI_CreateRecord(1); MSI_RecordSetStringW( uirow, 1, cls->clsid ); @@ -1034,7 +1034,7 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) debugstr_w(progid->ProgID)); continue; } - + TRACE("Registering progid %s\n", debugstr_w(progid->ProgID)); register_progid( progid ); @@ -1048,7 +1048,7 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) return ERROR_SUCCESS; } -static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid, +static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid, MSICOMPONENT* component, MSIEXTENSION* extension, MSIVERB* verb, INT* Sequence ) { @@ -1080,7 +1080,7 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid, msi_reg_set_val_str( key, NULL, command ); msi_free(command); - advertise = create_component_advertise_string(package, component, + advertise = create_component_advertise_string(package, component, extension->Feature->Feature); size = strlenW(advertise); @@ -1100,7 +1100,7 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid, } msi_reg_set_val_multi_str( key, szCommand, command ); - + RegCloseKey(key); msi_free(keyname); msi_free(advertise); @@ -1128,7 +1128,7 @@ static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid, UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) { - static const WCHAR szContentType[] = + static const WCHAR szContentType[] = {'C','o','n','t','e','n','t',' ','T','y','p','e',0 }; HKEY hkey; MSIEXTENSION *ext; @@ -1141,18 +1141,18 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) * shortcuts and the like. Because Mike McCormack is working on this i am * going to default to TRUE */ - + LIST_FOR_EACH_ENTRY( ext, &package->extensions, MSIEXTENSION, entry ) { LPWSTR extension; MSIFEATURE *feature; - + if (!ext->Component) continue; feature = ext->Feature; - /* + /* * yes. MSDN says that these are based on _Feature_ not on * Component. So verify the feature is to be installed */ @@ -1190,14 +1190,14 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) if (ext->ProgID || ext->ProgIDText) { - static const WCHAR szSN[] = + static const WCHAR szSN[] = {'\\','S','h','e','l','l','N','e','w',0}; HKEY hkey2; LPWSTR newkey; LPCWSTR progid; MSIVERB *verb; INT Sequence = MSI_NULL_INTEGER; - + if (ext->ProgID) progid = ext->ProgID->ProgID; else @@ -1205,7 +1205,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) msi_reg_set_val_str( hkey, NULL, progid ); - newkey = msi_alloc( (strlenW(progid)+strlenW(szSN)+1) * sizeof(WCHAR)); + newkey = msi_alloc( (strlenW(progid)+strlenW(szSN)+1) * sizeof(WCHAR)); strcpyW(newkey,progid); strcatW(newkey,szSN); @@ -1221,7 +1221,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) ext, verb, &Sequence); } } - + RegCloseKey(hkey); uirow = MSI_CreateRecord(1); @@ -1235,7 +1235,7 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) { - static const WCHAR szExten[] = + static const WCHAR szExten[] = {'E','x','t','e','n','s','i','o','n',0 }; MSIRECORD *uirow; MSIMIME *mt; @@ -1247,12 +1247,12 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) LPWSTR extension; LPCWSTR exten; LPCWSTR mime; - static const WCHAR fmt[] = + static const WCHAR fmt[] = {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\', 'C','o','n','t','e','n','t',' ','T','y','p','e','\\', '%','s',0}; LPWSTR key; - /* + /* * check if the MIME is to be installed. Either as requesed by an * extension or Class */ @@ -1266,7 +1266,7 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) debugstr_w(mt->ContentType)); continue; } - + mime = mt->ContentType; exten = mt->Extension->Extension; diff --git a/reactos/dll/win32/msi/cond.tab.c b/reactos/dll/win32/msi/cond.tab.c index 3cbed28a594..9fa4152dff9 100644 --- a/reactos/dll/win32/msi/cond.tab.c +++ b/reactos/dll/win32/msi/cond.tab.c @@ -1622,7 +1622,7 @@ yyreduce: { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - + MSI_GetComponentStateW(cond->package, yyvsp[0].string, &install, &action ); yyval.value = action; msi_free( yyvsp[0].string ); @@ -1634,7 +1634,7 @@ yyreduce: { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - + MSI_GetComponentStateW(cond->package, yyvsp[0].string, &install, &action ); yyval.value = install; msi_free( yyvsp[0].string ); @@ -1646,7 +1646,7 @@ yyreduce: { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - + MSI_GetFeatureStateW(cond->package, yyvsp[0].string, &install, &action ); yyval.value = action; msi_free( yyvsp[0].string ); @@ -1658,7 +1658,7 @@ yyreduce: { COND_input* cond = (COND_input*) info; INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - + MSI_GetFeatureStateW(cond->package, yyvsp[0].string, &install, &action ); yyval.value = install; msi_free( yyvsp[0].string ); @@ -2008,12 +2008,12 @@ static INT comp_substring(LPWSTR a, LPWSTR b, BOOL casless) /* ERROR NOT WORKING REWRITE */ { if (casless) return strstrW(a,b)!=NULL; else return strstrW(a,b)!=NULL;} static INT comp_start(LPWSTR a, LPWSTR b, BOOL casless) -{ if (casless) return strncmpiW(a,b,strlenW(b))==0; +{ if (casless) return strncmpiW(a,b,strlenW(b))==0; else return strncmpW(a,b,strlenW(b))==0;} static INT comp_end(LPWSTR a, LPWSTR b, BOOL casless) -{ - int i = strlenW(a); - int j = strlenW(b); +{ + int i = strlenW(a); + int j = strlenW(b); if (j>i) return 0; if (casless) return (!strcmpiW(&a[i-j-1],b)); @@ -2051,7 +2051,7 @@ static INT comp_ge_m2(INT a, LPWSTR b) static int COND_IsIdent( WCHAR x ) { - return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' ) + return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' ) || ( x == '#' ) || (x == '.') ); } @@ -2098,7 +2098,7 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond ) ERR("Unterminated string\n"); rc = COND_ERROR; break; - default: + default: if( COND_IsAlpha( ch ) ) { while( COND_IsIdent( str->data[len] ) ) @@ -2145,7 +2145,7 @@ static int COND_lex( void *COND_lval, COND_input *cond ) do { rc = COND_GetOne( str, cond ); } while (rc == COND_SPACE); - + return rc; } @@ -2191,8 +2191,8 @@ MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *package, LPCWSTR szCondition ) cond.str = szCondition; cond.n = 0; cond.result = -1; - - TRACE("Evaluating %s\n",debugstr_w(szCondition)); + + TRACE("Evaluating %s\n",debugstr_w(szCondition)); if ( szCondition == NULL || szCondition[0] == 0) r = MSICONDITION_NONE; diff --git a/reactos/dll/win32/msi/create.c b/reactos/dll/win32/msi/create.c index 740f563808f..95f15b289d3 100644 --- a/reactos/dll/win32/msi/create.c +++ b/reactos/dll/win32/msi/create.c @@ -66,7 +66,7 @@ static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record ) MSIVIEW *tv = NULL; MSIRECORD *rec = NULL; - TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name), + TRACE("%p Table %s (%s)\n", cv, debugstr_w(cv->name), cv->bIsTemp?"temporary":"permanent"); /* only add tables that don't exist already */ diff --git a/reactos/dll/win32/msi/custom.c b/reactos/dll/win32/msi/custom.c index a464dfede10..b4842b8fbf4 100644 --- a/reactos/dll/win32/msi/custom.c +++ b/reactos/dll/win32/msi/custom.c @@ -83,7 +83,7 @@ static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR acti if (!package->script) return TRUE; - if ((options & msidbCustomActionTypeClientRepeat) == + if ((options & msidbCustomActionTypeClientRepeat) == msidbCustomActionTypeClientRepeat) { if (!(package->script->InWhatSequence & SEQUENCE_UI && @@ -284,7 +284,7 @@ end: } -static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, +static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, LPWSTR tmp_file) { DWORD sz=MAX_PATH; @@ -313,7 +313,7 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, the_file = CreateFileW(tmp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - + if (the_file == INVALID_HANDLE_VALUE) return ERROR_FUNCTION_FAILED; @@ -321,7 +321,7 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, if (!row) return ERROR_FUNCTION_FAILED; - do + do { DWORD write; sz = 1024; @@ -329,7 +329,7 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, if (rc != ERROR_SUCCESS) { ERR("Failed to get stream\n"); - CloseHandle(the_file); + CloseHandle(the_file); DeleteFileW(tmp_file); break; } @@ -344,7 +344,7 @@ static UINT store_binary_to_temp(MSIPACKAGE *package, LPCWSTR source, return ERROR_SUCCESS; } -static void file_running_action(MSIPACKAGE* package, HANDLE Handle, +static void file_running_action(MSIPACKAGE* package, HANDLE Handle, BOOL process, LPCWSTR name) { MSIRUNNINGACTION *action; @@ -361,11 +361,11 @@ static void file_running_action(MSIPACKAGE* package, HANDLE Handle, static UINT process_action_return_value(UINT type, HANDLE ThreadHandle) { DWORD rc=0; - + if (type == 2) { GetExitCodeProcess(ThreadHandle,&rc); - + if (rc == 0) return ERROR_SUCCESS; else @@ -389,7 +389,7 @@ static UINT process_action_return_value(UINT type, HANDLE ThreadHandle) } } -static UINT process_handle(MSIPACKAGE* package, UINT type, +static UINT process_handle(MSIPACKAGE* package, UINT type, HANDLE ThreadHandle, HANDLE ProcessHandle, LPCWSTR Name, BOOL *finished) { @@ -418,7 +418,7 @@ static UINT process_handle(MSIPACKAGE* package, UINT type, if (finished) *finished = TRUE; } - else + else { TRACE("Asynchronous Execution of action %s\n",debugstr_w(Name)); /* asynchronous */ @@ -448,7 +448,7 @@ static UINT process_handle(MSIPACKAGE* package, UINT type, typedef UINT __stdcall CustomEntry(MSIHANDLE); -typedef struct +typedef struct { MSIPACKAGE *package; WCHAR *target; @@ -529,7 +529,7 @@ static HANDLE do_msidbCustomActionTypeDll(MSIPACKAGE *package, LPCWSTR dll, LPCW return CreateThread(NULL, 0, DllThread, info, 0, NULL); } -static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source, +static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source, LPCWSTR target, const INT type, LPCWSTR action) { WCHAR tmp_file[MAX_PATH]; @@ -546,7 +546,7 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source, { static const WCHAR dot[]={'.',0}; strcatW(tmp_file,dot); - } + } ThreadHandle = do_msidbCustomActionTypeDll( package, tmp_file, target ); @@ -560,7 +560,7 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, LPCWSTR source, return rc; } -static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, +static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, LPCWSTR target, const INT type, LPCWSTR action) { WCHAR tmp_file[MAX_PATH]; @@ -584,7 +584,7 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, if (deformated) len += strlenW(deformated); - + cmd = msi_alloc(sizeof(WCHAR)*len); strcpyW(cmd,tmp_file); @@ -610,14 +610,14 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source, } msi_free(cmd); - prc = process_handle(package, type, info.hThread, info.hProcess, action, + prc = process_handle(package, type, info.hThread, info.hProcess, action, &finished); if (!finished) track_tempfile(package, tmp_file, tmp_file); else DeleteFileW(tmp_file); - + return prc; } @@ -683,7 +683,7 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source, rc = CreateProcessW(NULL, cmd, NULL, NULL, FALSE, 0, NULL, c_collen, &si, &info); - + if ( !rc ) { ERR("Unable to execute command %s\n", debugstr_w(cmd)); @@ -692,7 +692,7 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source, } msi_free(cmd); - prc = process_handle(package, type, info.hThread, info.hProcess, action, + prc = process_handle(package, type, info.hThread, info.hProcess, action, NULL); return prc; @@ -769,7 +769,7 @@ static UINT HANDLE_CustomType50(MSIPACKAGE *package, LPCWSTR source, rc = CreateProcessW(NULL, cmd, NULL, NULL, FALSE, 0, NULL, c_collen, &si, &info); - + if ( !rc ) { ERR("Unable to execute command %s\n", debugstr_w(cmd)); diff --git a/reactos/dll/win32/msi/database.c b/reactos/dll/win32/msi/database.c index 8abed5c77bc..f5a9955db18 100644 --- a/reactos/dll/win32/msi/database.c +++ b/reactos/dll/win32/msi/database.c @@ -150,7 +150,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb) } if ( !IsEqualGUID( &stat.clsid, &CLSID_MsiDatabase ) && - !IsEqualGUID( &stat.clsid, &CLSID_MsiPatch ) ) + !IsEqualGUID( &stat.clsid, &CLSID_MsiPatch ) ) { ERR("storage GUID is not a MSI database GUID %s\n", debugstr_guid(&stat.clsid) ); @@ -603,16 +603,16 @@ static UINT msi_add_records_to_table(MSIDATABASE *db, LPWSTR *columns, LPWSTR *t LPWSTR prelude = msi_build_insertsql_prelude(labels[0]); LPWSTR columns_sql = msi_build_insertsql_columns(columns, types, num_columns); - + for (i = 0; i < num_records; i++) { LPWSTR data = msi_build_insertsql_data(records, types, num_columns, i); - size = lstrlenW(prelude) + lstrlenW(columns_sql) + sizeof(mid) + lstrlenW(data) + sizeof(end) - 1; + size = lstrlenW(prelude) + lstrlenW(columns_sql) + sizeof(mid) + lstrlenW(data) + sizeof(end) - 1; insert_sql = msi_alloc(size * sizeof(WCHAR)); if (!insert_sql) return ERROR_OUTOFMEMORY; - + lstrcpyW(insert_sql, prelude); lstrcatW(insert_sql, columns_sql); lstrcatW(insert_sql, mid); diff --git a/reactos/dll/win32/msi/delete.c b/reactos/dll/win32/msi/delete.c index 1484f6a61e1..6b584036104 100644 --- a/reactos/dll/win32/msi/delete.c +++ b/reactos/dll/win32/msi/delete.c @@ -203,7 +203,7 @@ UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) dv = msi_alloc_zero( sizeof *dv ); if( !dv ) return ERROR_FUNCTION_FAILED; - + /* fill the structure */ dv->view.ops = &delete_ops; dv->db = db; diff --git a/reactos/dll/win32/msi/dialog.c b/reactos/dll/win32/msi/dialog.c index d928edc30dc..f85a3957f76 100644 --- a/reactos/dll/win32/msi/dialog.c +++ b/reactos/dll/win32/msi/dialog.c @@ -97,7 +97,7 @@ struct msi_dialog_tag }; typedef UINT (*msi_dialog_control_func)( msi_dialog *dialog, MSIRECORD *rec ); -struct control_handler +struct control_handler { LPCWSTR control_type; msi_dialog_control_func func; @@ -133,7 +133,7 @@ static const WCHAR szMaskedEdit[] = { 'M','a','s','k','e','d','E','d','i','t',0 static const WCHAR szPathEdit[] = { 'P','a','t','h','E','d','i','t',0 }; static const WCHAR szProgressBar[] = { 'P','r','o','g','r','e','s','s','B','a','r',0 }; -static const WCHAR szRadioButtonGroup[] = { +static const WCHAR szRadioButtonGroup[] = { 'R','a','d','i','o','B','u','t','t','o','n','G','r','o','u','p',0 }; static const WCHAR szIcon[] = { 'I','c','o','n',0 }; static const WCHAR szSelectionTree[] = { @@ -539,7 +539,7 @@ static HICON msi_load_icon( MSIDATABASE *db, LPCWSTR text, UINT attributes ) /* called from the Control Event subscription code */ -void msi_dialog_handle_event( msi_dialog* dialog, LPCWSTR control, +void msi_dialog_handle_event( msi_dialog* dialog, LPCWSTR control, LPCWSTR attribute, MSIRECORD *rec ) { msi_control* ctrl; @@ -991,7 +991,7 @@ static HBITMAP msi_load_picture( MSIDATABASE *db, LPCWSTR name, ERR("failed to get bitmap handle\n"); goto end; } - + /* make the bitmap the desired size */ r = GetObjectW( hOleBitmap, sizeof bm, &bm ); if (r != sizeof bm ) @@ -1055,7 +1055,7 @@ static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) ERR("Failed to load bitmap %s\n", debugstr_w(text)); msi_free( text ); - + return ERROR_SUCCESS; } @@ -1069,7 +1069,7 @@ static UINT msi_dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec ) control = msi_dialog_add_control( dialog, rec, szStatic, SS_ICON | SS_CENTERIMAGE | WS_GROUP ); - + attributes = MSI_RecordGetInteger( rec, 8 ); text = msi_get_deformatted_field( dialog->package, rec, 10 ); control->hIcon = msi_load_icon( dialog->package->db, text, attributes ); @@ -1653,7 +1653,7 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec ) r = MSI_OpenQuery( package->db, &view, query, prop ); if( r != ERROR_SUCCESS ) { - ERR("query failed for dialog %s radio group %s\n", + ERR("query failed for dialog %s radio group %s\n", debugstr_w(dialog->name), debugstr_w(prop)); return ERROR_INVALID_PARAMETER; } @@ -2404,7 +2404,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control lstrcpynW( num, begin + 1, end - begin ); begin += end - begin + 1; - /* empty braces or '0' hides the column */ + /* empty braces or '0' hides the column */ if ( !num[0] || !lstrcmpW( num, zero ) ) { count++; @@ -2968,7 +2968,7 @@ static UINT msi_dialog_button_handler( msi_dialog *dialog, if ( r != ERROR_SUCCESS ) goto done; - } + } /* handle all other events */ LIST_FOR_EACH_ENTRY_SAFE( rec_entry, next, &events, struct rec_list, entry ) @@ -3097,7 +3097,7 @@ static LRESULT msi_dialog_oncommand( msi_dialog *dialog, WPARAM param, HWND hwnd case 2: /* escape */ control = msi_dialog_find_control( dialog, dialog->control_cancel ); break; - default: + default: control = msi_dialog_find_control_by_hwnd( dialog, hwnd ); } @@ -3150,7 +3150,7 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, dialog->package->center_x = LOWORD(lParam) + dialog->size.cx / 2.0; dialog->package->center_y = HIWORD(lParam) + dialog->size.cy / 2.0; break; - + case WM_CREATE: return msi_dialog_oncreate( hwnd, (LPCREATESTRUCTW)lParam ); @@ -3370,7 +3370,7 @@ void msi_dialog_destroy( msi_dialog *dialog ) if( dialog->hwnd ) ShowWindow( dialog->hwnd, SW_HIDE ); - + if( dialog->hwnd ) DestroyWindow( dialog->hwnd ); @@ -3482,7 +3482,7 @@ static UINT msi_error_dialog_set_error( MSIPACKAGE *package, LPWSTR error_dialog { MSIRECORD * row; - static const WCHAR update[] = + static const WCHAR update[] = {'U','P','D','A','T','E',' ','`','C','o','n','t','r','o','l','`',' ', 'S','E','T',' ','`','T','e','x','t','`',' ','=',' ','\'','%','s','\'',' ', 'W','H','E','R','E', ' ','`','D','i','a','l','o','g','_','`',' ','=',' ','\'','%','s','\'',' ', diff --git a/reactos/dll/win32/msi/distinct.c b/reactos/dll/win32/msi/distinct.c index a00f274a5c4..4ed5d957928 100644 --- a/reactos/dll/win32/msi/distinct.c +++ b/reactos/dll/win32/msi/distinct.c @@ -300,7 +300,7 @@ UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table ) dv = msi_alloc_zero( sizeof *dv ); if( !dv ) return ERROR_FUNCTION_FAILED; - + /* fill the structure */ dv->view.ops = &distinct_ops; msiobj_addref( &db->hdr ); diff --git a/reactos/dll/win32/msi/events.c b/reactos/dll/win32/msi/events.c index 13805a66484..f5d048254ed 100644 --- a/reactos/dll/win32/msi/events.c +++ b/reactos/dll/win32/msi/events.c @@ -92,7 +92,7 @@ static UINT event_do_dialog( MSIPACKAGE *package, LPCWSTR name, msi_dialog *pare /* * End a modal dialog box */ -static UINT ControlEvent_EndDialog(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_EndDialog(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { static const WCHAR szExit[] = { @@ -131,7 +131,7 @@ static UINT ControlEvent_EndDialog(MSIPACKAGE* package, LPCWSTR argument, /* * transition from one modal dialog to another modal dialog */ -static UINT ControlEvent_NewDialog(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_NewDialog(MSIPACKAGE* package, LPCWSTR argument, msi_dialog *dialog) { /* store the name of the next dialog, and signal this one to end */ @@ -144,7 +144,7 @@ static UINT ControlEvent_NewDialog(MSIPACKAGE* package, LPCWSTR argument, /* * Create a new child dialog of an existing modal dialog */ -static UINT ControlEvent_SpawnDialog(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_SpawnDialog(MSIPACKAGE* package, LPCWSTR argument, msi_dialog *dialog) { /* don't destroy a modeless dialogs that might be our parent */ @@ -158,21 +158,21 @@ static UINT ControlEvent_SpawnDialog(MSIPACKAGE* package, LPCWSTR argument, * Creates a dialog that remains up for a period of time * based on a condition */ -static UINT ControlEvent_SpawnWaitDialog(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_SpawnWaitDialog(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { FIXME("Doing Nothing\n"); return ERROR_SUCCESS; } -static UINT ControlEvent_DoAction(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_DoAction(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { ACTION_PerformAction(package,argument,TRUE); return ERROR_SUCCESS; } -static UINT ControlEvent_AddLocal(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_AddLocal(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { static const WCHAR szAll[] = {'A','L','L',0}; @@ -192,7 +192,7 @@ static UINT ControlEvent_AddLocal(MSIPACKAGE* package, LPCWSTR argument, return ERROR_SUCCESS; } -static UINT ControlEvent_Remove(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_Remove(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { static const WCHAR szAll[] = {'A','L','L',0}; @@ -212,7 +212,7 @@ static UINT ControlEvent_Remove(MSIPACKAGE* package, LPCWSTR argument, return ERROR_SUCCESS; } -static UINT ControlEvent_AddSource(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_AddSource(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { static const WCHAR szAll[] = {'A','L','L',0}; @@ -231,7 +231,7 @@ static UINT ControlEvent_AddSource(MSIPACKAGE* package, LPCWSTR argument, return ERROR_SUCCESS; } -static UINT ControlEvent_SetTargetPath(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_SetTargetPath(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { LPWSTR path = msi_dup_property( package, argument ); @@ -250,7 +250,7 @@ static UINT ControlEvent_SetTargetPath(MSIPACKAGE* package, LPCWSTR argument, return r; } -static UINT ControlEvent_Reset(MSIPACKAGE* package, LPCWSTR argument, +static UINT ControlEvent_Reset(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { msi_dialog_reset(dialog); @@ -304,7 +304,7 @@ VOID ControlEvent_UnSubscribeToEvent( MSIPACKAGE *package, LPCWSTR event, } } -VOID ControlEvent_FireSubscribedEvent( MSIPACKAGE *package, LPCWSTR event, +VOID ControlEvent_FireSubscribedEvent( MSIPACKAGE *package, LPCWSTR event, MSIRECORD *rec ) { struct subscriber *sub; diff --git a/reactos/dll/win32/msi/files.c b/reactos/dll/win32/msi/files.c index 38b1f8ff888..f921aec50f3 100644 --- a/reactos/dll/win32/msi/files.c +++ b/reactos/dll/win32/msi/files.c @@ -103,7 +103,7 @@ static UINT writeout_cabinet_stream(MSIPACKAGE *package, LPCWSTR stream_name, HANDLE the_file; WCHAR tmp[MAX_PATH]; - rc = read_raw_stream_data(package->db,stream_name,&data,&size); + rc = read_raw_stream_data(package->db,stream_name,&data,&size); if (rc != ERROR_SUCCESS) return rc; @@ -175,7 +175,7 @@ static INT_PTR cabinet_open(char *pszFile, int oflag, int pmode) dwCreateDisposition = CREATE_NEW; else if (oflag & _O_CREAT) dwCreateDisposition = CREATE_ALWAYS; - handle = CreateFileA( pszFile, dwAccess, dwShareMode, NULL, + handle = CreateFileA( pszFile, dwAccess, dwShareMode, NULL, dwCreateDisposition, 0, NULL ); if (handle == INVALID_HANDLE_VALUE) return 0; @@ -576,7 +576,7 @@ static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *m return rc; } -static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key, +static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key, MSIFILE** file) { LIST_FOR_EACH_ENTRY( *file, &package->files, MSIFILE, entry ) @@ -647,7 +647,7 @@ static UINT copy_install_file(MSIFILE *file) /* * ACTION_InstallFiles() - * + * * For efficiency, this is done in two passes: * 1) Correct all the TargetPaths and determine what files are to be installed. * 2) Extract Cabinets and copy files. @@ -755,7 +755,7 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param) TRACE("Skipping copy due to disabled component %s\n", debugstr_w(component)); - /* the action taken was the same as the current install state */ + /* the action taken was the same as the current install state */ comp->Action = comp->Installed; return ERROR_SUCCESS; @@ -815,7 +815,7 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param) dest = build_directory_name(2, dest_path, dest_name); TRACE("Duplicating file %s to %s\n",debugstr_w(file->TargetPath), - debugstr_w(dest)); + debugstr_w(dest)); if (strcmpW(file->TargetPath,dest)) rc = !CopyFileW(file->TargetPath,dest,TRUE); @@ -826,7 +826,7 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param) ERR("Failed to copy file %s -> %s, last error %d\n", debugstr_w(file->TargetPath), debugstr_w(dest_path), GetLastError()); - FIXME("We should track these duplicate files as well\n"); + FIXME("We should track these duplicate files as well\n"); msi_free(dest_path); msi_free(dest); diff --git a/reactos/dll/win32/msi/format.c b/reactos/dll/win32/msi/format.c index 4cb802e2135..7d40128c04e 100644 --- a/reactos/dll/win32/msi/format.c +++ b/reactos/dll/win32/msi/format.c @@ -20,7 +20,7 @@ */ /* -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiformatrecord.asp +http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiformatrecord.asp */ #include @@ -40,14 +40,14 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msifo WINE_DEFAULT_DEBUG_CHANNEL(msi); -static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, +static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data, DWORD len, MSIRECORD* record, BOOL* in_group); static LPWSTR build_default_format(MSIRECORD* record) { - int i; + int i; int count; LPWSTR rc, buf; static const WCHAR fmt[] = {'%','i',':',' ','%','s',' ',0}; @@ -129,7 +129,7 @@ static LPWSTR deformat_component(MSIPACKAGE* package, LPCWSTR key, DWORD* sz) return value; } -static LPWSTR deformat_file(MSIPACKAGE* package, LPCWSTR key, DWORD* sz, +static LPWSTR deformat_file(MSIPACKAGE* package, LPCWSTR key, DWORD* sz, BOOL shortname) { LPWSTR value = NULL; @@ -173,7 +173,7 @@ static LPWSTR deformat_file(MSIPACKAGE* package, LPCWSTR key, DWORD* sz, return value; } -static LPWSTR deformat_environment(MSIPACKAGE* package, LPCWSTR key, +static LPWSTR deformat_environment(MSIPACKAGE* package, LPCWSTR key, DWORD* chunk) { LPWSTR value = NULL; @@ -196,7 +196,7 @@ static LPWSTR deformat_environment(MSIPACKAGE* package, LPCWSTR key, return value; } - + static LPWSTR deformat_NULL(DWORD* chunk) { LPWSTR value; @@ -235,7 +235,7 @@ static BOOL is_key_number(LPCWSTR key) static LPWSTR deformat_index(MSIRECORD* record, LPCWSTR key, DWORD* chunk ) { INT index; - LPWSTR value; + LPWSTR value; index = atoiW(key); TRACE("record index %i\n",index); @@ -266,10 +266,10 @@ static LPWSTR deformat_property(MSIPACKAGE* package, LPCWSTR key, DWORD* chunk) } /* - * Groups cannot be nested. They are just treated as from { to next } + * Groups cannot be nested. They are just treated as from { to next } */ static BOOL find_next_group(LPCWSTR source, DWORD len_remaining, - LPWSTR *group, LPCWSTR *mark, + LPWSTR *group, LPCWSTR *mark, LPCWSTR* mark2) { int i; @@ -290,7 +290,7 @@ static BOOL find_next_group(LPCWSTR source, DWORD len_remaining, if (! found) return FALSE; - *mark2 = &(*mark)[i]; + *mark2 = &(*mark)[i]; i = *mark2 - *mark; *group = msi_alloc(i*sizeof(WCHAR)); @@ -305,7 +305,7 @@ static BOOL find_next_group(LPCWSTR source, DWORD len_remaining, static BOOL find_next_outermost_key(LPCWSTR source, DWORD len_remaining, - LPWSTR *key, LPCWSTR *mark, LPCWSTR* mark2, + LPWSTR *key, LPCWSTR *mark, LPCWSTR* mark2, BOOL *nested) { INT count = 0; @@ -336,7 +336,7 @@ static BOOL find_next_outermost_key(LPCWSTR source, DWORD len_remaining, if (count > 0) return FALSE; - *mark2 = &(*mark)[i-1]; + *mark2 = &(*mark)[i-1]; i = *mark2 - *mark; *key = msi_alloc(i*sizeof(WCHAR)); @@ -349,7 +349,7 @@ static BOOL find_next_outermost_key(LPCWSTR source, DWORD len_remaining, return TRUE; } -static LPWSTR deformat_group(MSIPACKAGE* package, LPWSTR group, DWORD len, +static LPWSTR deformat_group(MSIPACKAGE* package, LPWSTR group, DWORD len, MSIRECORD* record, DWORD* size) { LPWSTR value = NULL; @@ -360,7 +360,7 @@ static LPWSTR deformat_group(MSIPACKAGE* package, LPWSTR group, DWORD len, static const WCHAR fmt[] = {'{','%','s','}',0}; UINT sz; - if (!group || group[0] == 0) + if (!group || group[0] == 0) { *size = 0; return NULL; @@ -412,7 +412,7 @@ static LPWSTR deformat_group(MSIPACKAGE* package, LPWSTR group, DWORD len, * len is in WCHARs * return is also in WCHARs */ -static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, +static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data, DWORD len, MSIRECORD* record, INT* failcount) { @@ -437,7 +437,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, TRACE("Starting with %s\n",debugstr_wn(ptr,len)); /* scan for special characters... fast exit */ - if ((!scanW(ptr,'[',len) || (scanW(ptr,'[',len) && !scanW(ptr,']',len))) && + if ((!scanW(ptr,'[',len) || (scanW(ptr,'[',len) && !scanW(ptr,']',len))) && (scanW(ptr,'{',len) && !scanW(ptr,'}',len))) { /* not formatted */ @@ -446,7 +446,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, TRACE("Returning %s\n",debugstr_wn(*data,len)); return len; } - + progress = ptr; while (progress - ptr < len) @@ -455,14 +455,14 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, if (find_next_group(progress, len - (progress - ptr), &key, &mark, &mark2)) { - value = deformat_group(package, key, strlenW(key)+1, record, + value = deformat_group(package, key, strlenW(key)+1, record, &chunk); msi_free( key ); key = NULL; nested = FALSE; } /* formatted string located */ - else if (!find_next_outermost_key(progress, len - (progress - ptr), + else if (!find_next_outermost_key(progress, len - (progress - ptr), &key, &mark, &mark2, &nested)) { LPBYTE nd2; @@ -494,7 +494,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, else tgt = msi_realloc(newdata,size); newdata = tgt; - memcpy(&newdata[old_size],progress,(cnt * sizeof(WCHAR))); + memcpy(&newdata[old_size],progress,(cnt * sizeof(WCHAR))); } progress = mark; @@ -509,7 +509,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, key = value; } - TRACE("Current %s .. %s\n",debugstr_wn((LPWSTR)newdata, + TRACE("Current %s .. %s\n",debugstr_wn((LPWSTR)newdata, size/sizeof(WCHAR)),debugstr_w(key)); if (!package) @@ -517,7 +517,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, /* only deformat number indexs */ if (key && is_key_number(key)) { - value = deformat_index(record,key,&chunk); + value = deformat_index(record,key,&chunk); if (!chunk && failcount && *failcount >= 0) (*failcount)++; } @@ -573,7 +573,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, } else value = deformat_property(package,key,&chunk); - break; + break; } } @@ -590,7 +590,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, nd2= msi_alloc(chunk); newdata = nd2; memcpy(&newdata[size],value,chunk); - size+=chunk; + size+=chunk; msi_free(value); } else if (failcount && *failcount >=0 ) @@ -599,7 +599,7 @@ static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, progress = mark2+1; } - TRACE("after everything %s\n",debugstr_wn((LPWSTR)newdata, + TRACE("after everything %s\n",debugstr_wn((LPWSTR)newdata, size/sizeof(WCHAR))); *data = (LPWSTR)newdata; @@ -672,7 +672,7 @@ UINT MSI_FormatRecordA( MSIPACKAGE* package, MSIRECORD* record, LPSTR buffer, len = deformat_string_internal(package,rec,&deformated,strlenW(rec), record, NULL); - /* If len is zero then WideCharToMultiByte will return 0 indicating + /* If len is zero then WideCharToMultiByte will return 0 indicating * failure, but that will do just as well since we are ignoring * possible errors. */ @@ -705,7 +705,7 @@ UINT MSI_FormatRecordA( MSIPACKAGE* package, MSIRECORD* record, LPSTR buffer, } -UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord, +UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord, LPWSTR szResult, DWORD *sz ) { UINT r = ERROR_INVALID_HANDLE; diff --git a/reactos/dll/win32/msi/handle.c b/reactos/dll/win32/msi/handle.c index 6af3c4110f5..5c719cb638c 100644 --- a/reactos/dll/win32/msi/handle.c +++ b/reactos/dll/win32/msi/handle.c @@ -35,7 +35,7 @@ static CRITICAL_SECTION MSI_handle_cs; static CRITICAL_SECTION_DEBUG MSI_handle_cs_debug = { 0, 0, &MSI_handle_cs, - { &MSI_handle_cs_debug.ProcessLocksList, + { &MSI_handle_cs_debug.ProcessLocksList, &MSI_handle_cs_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": MSI_handle_cs") } }; @@ -45,7 +45,7 @@ static CRITICAL_SECTION MSI_object_cs; static CRITICAL_SECTION_DEBUG MSI_object_cs_debug = { 0, 0, &MSI_object_cs, - { &MSI_object_cs_debug.ProcessLocksList, + { &MSI_object_cs_debug.ProcessLocksList, &MSI_object_cs_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": MSI_object_cs") } }; diff --git a/reactos/dll/win32/msi/helpers.c b/reactos/dll/win32/msi/helpers.c index 38f2614e2bd..35cfad1a2fc 100644 --- a/reactos/dll/win32/msi/helpers.c +++ b/reactos/dll/win32/msi/helpers.c @@ -49,7 +49,7 @@ LPWSTR build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name ) { LPWSTR SystemFolder, dest, FilePath; - static const WCHAR szInstaller[] = + static const WCHAR szInstaller[] = {'M','i','c','r','o','s','o','f','t','\\', 'I','n','s','t','a','l','l','e','r','\\',0}; static const WCHAR szFolder[] = @@ -141,7 +141,7 @@ int track_tempfile( MSIPACKAGE *package, LPCWSTR name, LPCWSTR path ) MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir ) { MSIFOLDER *folder; - + LIST_FOR_EACH_ENTRY( folder, &package->folders, MSIFOLDER, entry ) { if (lstrcmpW( dir, folder->Directory )==0) @@ -207,7 +207,7 @@ static void clean_spaces_from_path( LPWSTR p ) } } -LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, +LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, BOOL set_prop, MSIFOLDER **folder) { MSIFOLDER *f; @@ -268,7 +268,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, else if (!source && f->Property) { path = build_directory_name( 2, f->Property, NULL ); - + TRACE(" internally set to %s\n",debugstr_w(path)); if (set_prop) MSI_SetPropertyW( package, name, path ); @@ -293,7 +293,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, if (set_prop) MSI_SetPropertyW(package,name,path); } - else + else { /* source may be in a few different places ... check each of them */ path = NULL; @@ -370,7 +370,7 @@ UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action) return ERROR_FUNCTION_FAILED; } TRACE("Scheduling Action %s in script %i\n",debugstr_w(action), script); - + count = package->script->ActionCount[script]; package->script->ActionCount[script]++; if (count != 0) @@ -463,7 +463,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package) { INT i; struct list *item, *cursor; - + TRACE("Freeing package action data\n"); remove_tracked_tempfiles(package); @@ -493,7 +493,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package) LIST_FOR_EACH_SAFE( item, cursor, &package->components ) { MSICOMPONENT *comp = LIST_ENTRY( item, MSICOMPONENT, entry ); - + list_remove( &comp->entry ); msi_free( comp->Component ); msi_free( comp->ComponentId ); @@ -606,7 +606,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package) * build_directory_name() * * This function is to save messing round with directory names - * It handles adding backslashes between path segments, + * It handles adding backslashes between path segments, * and can add \ at the end of the directory name if told to. * * It takes a variable number of arguments. @@ -620,7 +620,7 @@ void ACTION_free_package_structures( MSIPACKAGE* package) * Path segments will be added with a \ separating them. * A \ will not be added after the last segment, however if the * last segment is NULL, then the last character will be a \ - * + * */ LPWSTR build_directory_name(DWORD count, ...) { @@ -723,10 +723,10 @@ void ui_progress(MSIPACKAGE *package, int a, int b, int c, int d ) void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * record) { - static const WCHAR Query_t[] = + static const WCHAR Query_t[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','A','c','t','i','o', 'n','T','e','x','t','`',' ', - 'W','H','E','R','E',' ', '`','A','c','t','i','o','n','`',' ','=', + 'W','H','E','R','E',' ', '`','A','c','t','i','o','n','`',' ','=', ' ','\'','%','s','\'',0}; WCHAR message[1024]; MSIRECORD * row = 0; @@ -760,7 +760,7 @@ void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * record) row = MSI_CreateRecord(1); MSI_RecordSetStringW(row,1,message); - + MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row); msiobj_release(&row->hdr); @@ -808,7 +808,7 @@ void reduce_to_shortfilename(WCHAR* filename) *p = 0; } -LPWSTR create_component_advertise_string(MSIPACKAGE* package, +LPWSTR create_component_advertise_string(MSIPACKAGE* package, MSICOMPONENT* component, LPCWSTR feature) { static const WCHAR fmt[] = {'%','s','%','s','%','c','%','s',0}; @@ -833,14 +833,14 @@ LPWSTR create_component_advertise_string(MSIPACKAGE* package, TRACE("prod=%s feat=%s comp=%s\n", debugstr_w(productid_85), debugstr_w(feature), debugstr_w(component_85)); - + sz = 20 + lstrlenW(feature) + 20 + 3; output = msi_alloc_zero(sz*sizeof(WCHAR)); sprintfW(output, fmt, productid_85, feature, component?'>':'<', component_85); - + return output; } @@ -863,17 +863,17 @@ void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature) LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry ) { MSICOMPONENT* component = cl->component; - + TRACE("MODIFYING(%i): Component %s (Installed %i, Action %i, Request %i)\n", - newstate, debugstr_w(component->Component), component->Installed, + newstate, debugstr_w(component->Component), component->Installed, component->Action, component->ActionRequest); - + if (!component->Enabled) continue; - + if (newstate == INSTALLSTATE_LOCAL) msi_component_set_state( component, INSTALLSTATE_LOCAL ); - else + else { ComponentList *clist; MSIFEATURE *f; @@ -913,9 +913,9 @@ void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature) } } TRACE("Result (%i): Component %s (Installed %i, Action %i, Request %i)\n", - newstate, debugstr_w(component->Component), component->Installed, + newstate, debugstr_w(component->Component), component->Installed, component->Action, component->ActionRequest); - } + } } UINT register_unique_action(MSIPACKAGE *package, LPCWSTR action) @@ -927,7 +927,7 @@ UINT register_unique_action(MSIPACKAGE *package, LPCWSTR action) return FALSE; TRACE("Registering Action %s as having fun\n",debugstr_w(action)); - + count = package->script->UniqueActionsCount; package->script->UniqueActionsCount++; if (count != 0) diff --git a/reactos/dll/win32/msi/install.c b/reactos/dll/win32/msi/install.c index 6292861b237..135225ce345 100644 --- a/reactos/dll/win32/msi/install.c +++ b/reactos/dll/win32/msi/install.c @@ -46,7 +46,7 @@ UINT WINAPI MsiDoActionA( MSIHANDLE hInstall, LPCSTR szAction ) szwAction = strdupAtoW(szAction); if (szAction && !szwAction) - return ERROR_FUNCTION_FAILED; + return ERROR_FUNCTION_FAILED; ret = MsiDoActionW( hInstall, szwAction ); msi_free( szwAction ); @@ -69,7 +69,7 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction ) package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE ); if (!package) return ERROR_INVALID_HANDLE; - + ret = ACTION_PerformUIAction( package, szAction ); msiobj_release( &package->hdr ); @@ -88,7 +88,7 @@ UINT WINAPI MsiSequenceA( MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode szwTable = strdupAtoW(szTable); if (szTable && !szwTable) - return ERROR_FUNCTION_FAILED; + return ERROR_FUNCTION_FAILED; ret = MsiSequenceW( hInstall, szwTable, iSequenceMode ); msi_free( szwTable ); @@ -111,7 +111,7 @@ UINT WINAPI MsiSequenceW( MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode ret = MSI_Sequence( package, szTable, iSequenceMode ); msiobj_release( &package->hdr ); - + return ret; } @@ -124,11 +124,11 @@ UINT msi_strcpy_to_awstring( LPCWSTR str, awstring *awbuf, DWORD *sz ) if (!sz) return r; - + if (awbuf->unicode) { len = lstrlenW( str ); - if (awbuf->str.w) + if (awbuf->str.w) lstrcpynW( awbuf->str.w, str, *sz ); } else @@ -178,7 +178,7 @@ static UINT WINAPI MSI_GetTargetPath( MSIHANDLE hInstall, LPCWSTR szFolder, /*********************************************************************** * MsiGetTargetPathA (MSI.@) */ -UINT WINAPI MsiGetTargetPathA( MSIHANDLE hInstall, LPCSTR szFolder, +UINT WINAPI MsiGetTargetPathA( MSIHANDLE hInstall, LPCSTR szFolder, LPSTR szPathBuf, DWORD* pcchPathBuf ) { LPWSTR szwFolder; @@ -189,7 +189,7 @@ UINT WINAPI MsiGetTargetPathA( MSIHANDLE hInstall, LPCSTR szFolder, szwFolder = strdupAtoW(szFolder); if (szFolder && !szwFolder) - return ERROR_FUNCTION_FAILED; + return ERROR_FUNCTION_FAILED; path.unicode = FALSE; path.str.a = szPathBuf; @@ -257,7 +257,7 @@ static UINT MSI_GetSourcePath( MSIHANDLE hInstall, LPCWSTR szFolder, /*********************************************************************** * MsiGetSourcePathA (MSI.@) */ -UINT WINAPI MsiGetSourcePathA( MSIHANDLE hInstall, LPCSTR szFolder, +UINT WINAPI MsiGetSourcePathA( MSIHANDLE hInstall, LPCSTR szFolder, LPSTR szPathBuf, DWORD* pcchPathBuf ) { LPWSTR folder; @@ -323,7 +323,7 @@ end: * changed a bit also. The given folder path does not have to actually already * exist, it just cannot be read only and must be a legal folder path. */ -UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, +UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath) { DWORD attrib; @@ -351,7 +351,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, if (lstrcmpiW(path, folder->Property) == 0) { /* - * Resolved Target has not really changed, so just + * Resolved Target has not really changed, so just * set this folder and do not recalculate everything. */ msi_free(folder->ResolvedTarget); @@ -398,7 +398,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, /*********************************************************************** * MsiSetTargetPathW (MSI.@) */ -UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, +UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath) { MSIPACKAGE *package; @@ -514,8 +514,8 @@ UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, if (!szwFeature) return ERROR_FUNCTION_FAILED; - - rc = MsiSetFeatureStateW(hInstall,szwFeature, iState); + + rc = MsiSetFeatureStateW(hInstall,szwFeature, iState); msi_free(szwFeature); @@ -536,7 +536,7 @@ UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE* package, LPCWSTR szFeature, if (!feature) return ERROR_UNKNOWN_FEATURE; - if (iState == INSTALLSTATE_ADVERTISED && + if (iState == INSTALLSTATE_ADVERTISED && feature->Attributes & msidbFeatureAttributesDisallowAdvertise) return ERROR_FUNCTION_FAILED; @@ -550,7 +550,7 @@ UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE* package, LPCWSTR szFeature, if (lstrcmpW(szFeature, child->Feature_Parent) == 0) MSI_SetFeatureStateW(package, child->Feature, iState); } - + return rc; } @@ -583,7 +583,7 @@ UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, { LPWSTR szwFeature = NULL; UINT rc; - + szwFeature = strdupAtoW(szFeature); rc = MsiGetFeatureStateW(hInstall,szwFeature,piInstalled, piAction); @@ -680,7 +680,7 @@ UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent, { LPWSTR szwComponent= NULL; UINT rc; - + szwComponent= strdupAtoW(szComponent); rc = MsiGetComponentStateW(hInstall,szwComponent,piInstalled, piAction); @@ -775,7 +775,7 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall) LANGID langid; static const WCHAR szProductLanguage[] = {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; - + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) return ERROR_INVALID_HANDLE; diff --git a/reactos/dll/win32/msi/order.c b/reactos/dll/win32/msi/order.c index 82b12698405..11ad9e631bb 100644 --- a/reactos/dll/win32/msi/order.c +++ b/reactos/dll/win32/msi/order.c @@ -98,7 +98,7 @@ static UINT ORDER_mergesort( MSIORDERVIEW *ov, UINT left, UINT right ) if( r != ERROR_SUCCESS ) return r; if( swap ) - { + { temp = array[j]; memmove( &array[i+1], &array[i], (j-i)*sizeof (UINT) ); array[i] = temp; @@ -339,7 +339,7 @@ UINT ORDER_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, ov = msi_alloc_zero( sizeof *ov + sizeof (UINT) * count ); if( !ov ) return ERROR_FUNCTION_FAILED; - + /* fill the structure */ ov->view.ops = &order_ops; msiobj_addref( &db->hdr ); diff --git a/reactos/dll/win32/msi/package.c b/reactos/dll/win32/msi/package.c index 1455c6da2e5..96aa307a460 100644 --- a/reactos/dll/win32/msi/package.c +++ b/reactos/dll/win32/msi/package.c @@ -146,45 +146,45 @@ static VOID set_installer_properties(MSIPACKAGE *package) LONG res; static const WCHAR cszbs[]={'\\',0}; - static const WCHAR CFF[] = + static const WCHAR CFF[] = {'C','o','m','m','o','n','F','i','l','e','s','F','o','l','d','e','r',0}; - static const WCHAR PFF[] = + static const WCHAR PFF[] = {'P','r','o','g','r','a','m','F','i','l','e','s','F','o','l','d','e','r',0}; - static const WCHAR CADF[] = + static const WCHAR CADF[] = {'C','o','m','m','o','n','A','p','p','D','a','t','a','F','o','l','d','e','r',0}; - static const WCHAR FaF[] = + static const WCHAR FaF[] = {'F','a','v','o','r','i','t','e','s','F','o','l','d','e','r',0}; - static const WCHAR FoF[] = + static const WCHAR FoF[] = {'F','o','n','t','s','F','o','l','d','e','r',0}; - static const WCHAR SendTF[] = + static const WCHAR SendTF[] = {'S','e','n','d','T','o','F','o','l','d','e','r',0}; - static const WCHAR SMF[] = + static const WCHAR SMF[] = {'S','t','a','r','t','M','e','n','u','F','o','l','d','e','r',0}; - static const WCHAR StF[] = + static const WCHAR StF[] = {'S','t','a','r','t','u','p','F','o','l','d','e','r',0}; - static const WCHAR TemplF[] = + static const WCHAR TemplF[] = {'T','e','m','p','l','a','t','e','F','o','l','d','e','r',0}; - static const WCHAR DF[] = + static const WCHAR DF[] = {'D','e','s','k','t','o','p','F','o','l','d','e','r',0}; - static const WCHAR PMF[] = + static const WCHAR PMF[] = {'P','r','o','g','r','a','m','M','e','n','u','F','o','l','d','e','r',0}; - static const WCHAR ATF[] = + static const WCHAR ATF[] = {'A','d','m','i','n','T','o','o','l','s','F','o','l','d','e','r',0}; - static const WCHAR ADF[] = + static const WCHAR ADF[] = {'A','p','p','D','a','t','a','F','o','l','d','e','r',0}; - static const WCHAR SF[] = + static const WCHAR SF[] = {'S','y','s','t','e','m','F','o','l','d','e','r',0}; - static const WCHAR SF16[] = + static const WCHAR SF16[] = {'S','y','s','t','e','m','1','6','F','o','l','d','e','r',0}; - static const WCHAR LADF[] = + static const WCHAR LADF[] = {'L','o','c','a','l','A','p','p','D','a','t','a','F','o','l','d','e','r',0}; - static const WCHAR MPF[] = + static const WCHAR MPF[] = {'M','y','P','i','c','t','u','r','e','s','F','o','l','d','e','r',0}; - static const WCHAR PF[] = + static const WCHAR PF[] = {'P','e','r','s','o','n','a','l','F','o','l','d','e','r',0}; - static const WCHAR WF[] = + static const WCHAR WF[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0}; - static const WCHAR WV[] = + static const WCHAR WV[] = {'W','i','n','d','o','w','s','V','o','l','u','m','e',0}; static const WCHAR TF[]= {'T','e','m','p','F','o','l','d','e','r',0}; @@ -199,7 +199,7 @@ static VOID set_installer_properties(MSIPACKAGE *package) static const WCHAR szFormat[] = {'%','l','i',0}; static const WCHAR szWinBuild[] = {'W','i','n','d','o','w','s','B','u','i','l','d', 0 }; - static const WCHAR szSPL[] = + static const WCHAR szSPL[] = {'S','e','r','v','i','c','e','P','a','c','k','L','e','v','e','l',0 }; static const WCHAR szSix[] = {'6',0 }; @@ -308,7 +308,7 @@ static VOID set_installer_properties(MSIPACKAGE *package) SHGetFolderPathW(NULL,CSIDL_WINDOWS,NULL,0,pth); strcatW(pth,cszbs); MSI_SetPropertyW(package, WF, pth); - + /* Physical Memory is specified in MB. Using total amount. */ msex.dwLength = sizeof(msex); GlobalMemoryStatusEx( &msex ); @@ -320,7 +320,7 @@ static VOID set_installer_properties(MSIPACKAGE *package) if (ptr) *(ptr+1) = 0; MSI_SetPropertyW(package, WV, pth); - + GetTempPathW(MAX_PATH,pth); MSI_SetPropertyW(package, TF, pth); @@ -337,7 +337,7 @@ static VOID set_installer_properties(MSIPACKAGE *package) sprintfW(verstr,szFormat,verval); switch (OSVersion.dwPlatformId) { - case VER_PLATFORM_WIN32_WINDOWS: + case VER_PLATFORM_WIN32_WINDOWS: MSI_SetPropertyW(package,v9x,verstr); break; case VER_PLATFORM_WIN32_NT: @@ -468,7 +468,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPWSTR base_url ) package->PackagePath = strdupW( db->path ); package->BaseURL = strdupW( base_url ); - /* OK, here is where we do a slew of things to the database to + /* OK, here is where we do a slew of things to the database to * prep for all that is to come as a package */ for (i=0; i rec->count ) return ERROR_INVALID_PARAMETER; - + MSI_FreeField( &rec->fields[iField] ); rec->fields[iField].type = MSIFIELD_INT; rec->fields[iField].u.iVal = iVal; @@ -329,7 +329,7 @@ BOOL WINAPI MsiRecordIsNull( MSIHANDLE handle, unsigned int iField ) } -UINT MSI_RecordGetStringA(MSIRECORD *rec, unsigned int iField, +UINT MSI_RecordGetStringA(MSIRECORD *rec, unsigned int iField, LPSTR szValue, DWORD *pcchValue) { UINT len=0, ret; @@ -374,7 +374,7 @@ UINT MSI_RecordGetStringA(MSIRECORD *rec, unsigned int iField, return ret; } -UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, unsigned int iField, +UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, unsigned int iField, LPSTR szValue, DWORD *pcchValue) { MSIRECORD *rec; diff --git a/reactos/dll/win32/msi/registry.c b/reactos/dll/win32/msi/registry.c index 56f694e9c47..9519c51edc1 100644 --- a/reactos/dll/win32/msi/registry.c +++ b/reactos/dll/win32/msi/registry.c @@ -41,9 +41,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); -/* +/* * This module will be all the helper functions for registry access by the - * installer bits. + * installer bits. */ static const WCHAR szUserFeatures_fmt[] = { 'S','o','f','t','w','a','r','e','\\', @@ -724,7 +724,7 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid) return r; } -UINT WINAPI MsiEnumFeaturesA(LPCSTR szProduct, DWORD index, +UINT WINAPI MsiEnumFeaturesA(LPCSTR szProduct, DWORD index, LPSTR szFeature, LPSTR szParent) { DWORD r; @@ -754,7 +754,7 @@ UINT WINAPI MsiEnumFeaturesA(LPCSTR szProduct, DWORD index, return r; } -UINT WINAPI MsiEnumFeaturesW(LPCWSTR szProduct, DWORD index, +UINT WINAPI MsiEnumFeaturesW(LPCWSTR szProduct, DWORD index, LPWSTR szFeature, LPWSTR szParent) { HKEY hkeyProduct = 0; @@ -902,7 +902,7 @@ static UINT WINAPI MSI_EnumComponentQualifiers( LPCWSTR szComponent, DWORD iInde break; if (r != ERROR_MORE_DATA) goto end; - + if (type != REG_MULTI_SZ) { ERR("component data has wrong type (%d)\n", type); diff --git a/reactos/dll/win32/msi/regsvr.c b/reactos/dll/win32/msi/regsvr.c index dca1c80bdf7..17323389b48 100644 --- a/reactos/dll/win32/msi/regsvr.c +++ b/reactos/dll/win32/msi/regsvr.c @@ -525,7 +525,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) { * coclass list */ static struct regsvr_coclass const coclass_list[] = { - { + { &CLSID_IMsiServer, "Msi install server", "ole32.dll", @@ -535,8 +535,8 @@ static struct regsvr_coclass const coclass_list[] = { PROGID_CLSID, "IMsiServer", NULL - }, - { + }, + { &CLSID_IMsiServerMessage, "Wine Installer Message RPC", NULL, @@ -547,7 +547,7 @@ static struct regsvr_coclass const coclass_list[] = { "WindowsInstaller.Message", NULL }, - { + { &CLSID_IMsiServerX1, "Msi install server", "ole32.dll", @@ -558,7 +558,7 @@ static struct regsvr_coclass const coclass_list[] = { "WindowsInstaller.Installer", NULL }, - { + { &CLSID_IMsiServerX2, "Msi install server", "ole32.dll", @@ -569,7 +569,7 @@ static struct regsvr_coclass const coclass_list[] = { "WindowsInstaller.Installer", NULL }, - { + { &CLSID_IMsiServerX3, "Msi install server", "ole32.dll", @@ -588,18 +588,18 @@ static struct regsvr_coclass const coclass_list[] = { */ /* * we should declare: (@see ole32/regsvr.c for examples) - [-HKEY_CLASSES_ROOT\Interface\{000C101C-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C101D-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C1025-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C1033-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C1090-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C1093-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C1095-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C109A-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C109B-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C109C-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C109D-0000-0000-C000-000000000046}] - [-HKEY_CLASSES_ROOT\Interface\{000C109E-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C101C-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C101D-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C1025-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C1033-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C1090-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C1093-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C1095-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C109A-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C109B-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C109C-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C109D-0000-0000-C000-000000000046}] + [-HKEY_CLASSES_ROOT\Interface\{000C109E-0000-0000-C000-000000000046}] [-HKEY_CLASSES_ROOT\Interface\{000C109F-0000-0000-C000-000000000046}] */ static struct regsvr_interface const interface_list[] = { diff --git a/reactos/dll/win32/msi/select.c b/reactos/dll/win32/msi/select.c index 60bb3901299..f9ef0467589 100644 --- a/reactos/dll/win32/msi/select.c +++ b/reactos/dll/win32/msi/select.c @@ -302,7 +302,7 @@ static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name ) return r; sv->cols[sv->num_cols] = n; - TRACE("Translating column %s from %d -> %d\n", + TRACE("Translating column %s from %d -> %d\n", debugstr_w( name ), sv->num_cols, n); sv->num_cols++; @@ -331,7 +331,7 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, sv = msi_alloc_zero( sizeof *sv + count*sizeof (UINT) ); if( !sv ) return ERROR_FUNCTION_FAILED; - + /* fill the structure */ sv->view.ops = &select_ops; sv->db = db; diff --git a/reactos/dll/win32/msi/source.c b/reactos/dll/win32/msi/source.c index 3b18dc67382..230a6aaf3ce 100644 --- a/reactos/dll/win32/msi/source.c +++ b/reactos/dll/win32/msi/source.c @@ -54,8 +54,8 @@ typedef struct tagMediaInfo static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, BOOL user, BOOL create) { - HKEY rootkey = 0; - UINT rc; + HKEY rootkey = 0; + UINT rc; static const WCHAR szSourceList[] = {'S','o','u','r','c','e','L','i','s','t',0}; if (user) @@ -69,7 +69,7 @@ static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, BOOL user, BOOL create) if (create) rc = RegCreateKeyW(rootkey, szSourceList, key); else - rc = RegOpenKeyW(rootkey,szSourceList, key); + rc = RegOpenKeyW(rootkey,szSourceList, key); return rc; } @@ -82,7 +82,7 @@ static UINT OpenMediaSubkey(HKEY rootkey, HKEY *key, BOOL create) if (create) rc = RegCreateKeyW(rootkey, media, key); else - rc = RegOpenKeyW(rootkey,media, key); + rc = RegOpenKeyW(rootkey,media, key); return rc; } @@ -95,7 +95,7 @@ static UINT OpenNetworkSubkey(HKEY rootkey, HKEY *key, BOOL create) if (create) rc = RegCreateKeyW(rootkey, net, key); else - rc = RegOpenKeyW(rootkey, net, key); + rc = RegOpenKeyW(rootkey, net, key); return rc; } @@ -108,7 +108,7 @@ static UINT OpenURLSubkey(HKEY rootkey, HKEY *key, BOOL create) if (create) rc = RegCreateKeyW(rootkey, URL, key); else - rc = RegOpenKeyW(rootkey, URL, key); + rc = RegOpenKeyW(rootkey, URL, key); return rc; } @@ -132,7 +132,7 @@ static UINT find_given_source(HKEY key, LPCWSTR szSource, media_info *ss) if (rc != ERROR_NO_MORE_ITEMS) { val = msi_alloc(val_size); - RegEnumValueW(key, index, szIndex, &size, NULL, NULL, (LPBYTE)val, + RegEnumValueW(key, index, szIndex, &size, NULL, NULL, (LPBYTE)val, &val_size); if (lstrcmpiW(szSource,val)==0) { @@ -155,8 +155,8 @@ static UINT find_given_source(HKEY key, LPCWSTR szSource, media_info *ss) */ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, - LPCWSTR szProperty, LPWSTR szValue, - LPDWORD pcchValue) + LPCWSTR szProperty, LPWSTR szValue, + LPDWORD pcchValue) { HKEY sourcekey; UINT rc; @@ -168,13 +168,13 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, if (szValue && !pcchValue) return ERROR_INVALID_PARAMETER; - + if (dwOptions == MSICODE_PATCH) { FIXME("Unhandled options MSICODE_PATCH\n"); return ERROR_FUNCTION_FAILED; } - + if (szUserSid) FIXME("Unhandled UserSid %s\n",debugstr_w(szUserSid)); @@ -225,7 +225,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, LPWSTR ptr; buffer = msi_alloc(size); rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEW, - 0, 0, (LPBYTE)buffer,&size); + 0, 0, (LPBYTE)buffer,&size); ptr = strchrW(buffer,';'); if (ptr) ptr = strchrW(ptr+1,';'); if (!ptr) @@ -258,7 +258,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, { buffer = msi_alloc(size); rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEW, - 0, 0, (LPBYTE)buffer,&size); + 0, 0, (LPBYTE)buffer,&size); if (*pcchValue < 1) { rc = ERROR_MORE_DATA; @@ -274,7 +274,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, } else if (strcmpW(INSTALLPROPERTY_PACKAGENAMEW, szProperty)==0) { - rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, 0, + rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_PACKAGENAMEW, 0, 0, (LPBYTE)szValue, pcchValue); if (rc != ERROR_SUCCESS && rc != ERROR_MORE_DATA) rc = ERROR_UNKNOWN_PROPERTY; @@ -310,7 +310,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, FIXME("Unhandled options MSICODE_PATCH\n"); return ERROR_FUNCTION_FAILED; } - + if (szUserSid) FIXME("Unhandled UserSid %s\n",debugstr_w(szUserSid)); @@ -358,8 +358,8 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, static const WCHAR LastUsedSource_Fmt[] = {'%','c',';','%','i',';','%','s',0}; /* make sure the source is registered */ - MsiSourceListAddSourceExW(szProduct, szUserSid, dwContext, - dwOptions, szValue, 0); + MsiSourceListAddSourceExW(szProduct, szUserSid, dwContext, + dwOptions, szValue, 0); if (dwOptions & MSISOURCETYPE_NETWORK) typechar = 'n'; @@ -373,7 +373,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, size = (lstrlenW(szValue)+5)*sizeof(WCHAR); buffer = msi_alloc(size); sprintfW(buffer, LastUsedSource_Fmt, typechar, 1, szValue); - rc = RegSetValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEW, 0, + rc = RegSetValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEW, 0, REG_EXPAND_SZ, (LPBYTE)buffer, size); if (rc != ERROR_SUCCESS) rc = ERROR_UNKNOWN_PROPERTY; @@ -421,7 +421,7 @@ UINT WINAPI MsiSourceListAddSourceW( LPCWSTR szProduct, LPCWSTR szUserName, msi_free(psid); } - ret = MsiSourceListAddSourceExW(szProduct, sidstr, + ret = MsiSourceListAddSourceExW(szProduct, sidstr, MSIINSTALLCONTEXT_USERMANAGED, MSISOURCETYPE_NETWORK, szSource, 0); if (sidstr) @@ -458,7 +458,7 @@ UINT WINAPI MsiSourceListAddSourceA( LPCSTR szProduct, LPCSTR szUserName, * MsiSourceListAddSourceExW (MSI.@) */ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid, - MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szSource, + MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szSource, DWORD dwIndex) { HKEY sourcekey; @@ -531,7 +531,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid, current_index ++; sprintfW(source_struct.szIndex,fmt,current_index); - rc = RegSetValueExW(typekey, source_struct.szIndex, 0, REG_EXPAND_SZ, + rc = RegSetValueExW(typekey, source_struct.szIndex, 0, REG_EXPAND_SZ, (const BYTE *)szSource, size); } @@ -543,8 +543,8 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid, /****************************************************************** * MsiSourceListAddMediaDisk(MSI.@) */ -UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid, - MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwDiskId, +UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid, + MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwDiskId, LPCWSTR szVolumeLabel, LPCWSTR szDiskPrompt) { HKEY sourcekey; @@ -570,7 +570,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid, FIXME("Unhandled options MSICODE_PATCH\n"); return ERROR_FUNCTION_FAILED; } - + if (szUserSid) FIXME("Unhandled UserSid %s\n",debugstr_w(szUserSid)); diff --git a/reactos/dll/win32/msi/string.c b/reactos/dll/win32/msi/string.c index 7a806630354..803d6d9a693 100644 --- a/reactos/dll/win32/msi/string.c +++ b/reactos/dll/win32/msi/string.c @@ -78,14 +78,14 @@ string_table *msi_init_stringtable( int entries, UINT codepage ) st = msi_alloc( sizeof (string_table) ); if( !st ) - return NULL; + return NULL; if( entries < 1 ) entries = 1; st->strings = msi_alloc_zero( sizeof (msistring) * entries ); if( !st->strings ) { msi_free( st ); - return NULL; + return NULL; } st->maxcount = entries; st->freeslot = 1; @@ -300,7 +300,7 @@ UINT msi_id2stringW( string_table *st, UINT id, LPWSTR buffer, UINT *sz ) if( *sz < len ) *sz = len; - memcpy( buffer, str, (*sz)*sizeof(WCHAR) ); + memcpy( buffer, str, (*sz)*sizeof(WCHAR) ); *sz = len; return ERROR_SUCCESS; @@ -342,7 +342,7 @@ UINT msi_id2stringA( string_table *st, UINT id, LPSTR buffer, UINT *sz ) { n = strlenW( str ) + 1; while( n && (len > *sz) ) - len = WideCharToMultiByte( st->codepage, 0, + len = WideCharToMultiByte( st->codepage, 0, str, --n, NULL, 0, NULL, NULL ); } else @@ -412,7 +412,7 @@ UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res ) l_str = msi_string_lookup_id( st, lval ); if( !l_str ) return ERROR_INVALID_PARAMETER; - + r_str = msi_string_lookup_id( st, rval ); if( !r_str ) return ERROR_INVALID_PARAMETER; diff --git a/reactos/dll/win32/msi/suminfo.c b/reactos/dll/win32/msi/suminfo.c index f7f57876d08..0a57f878db9 100644 --- a/reactos/dll/win32/msi/suminfo.c +++ b/reactos/dll/win32/msi/suminfo.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); #include "pshpack1.h" -typedef struct { +typedef struct { WORD wByteOrder; WORD wFormat; DWORD dwOSVer; @@ -47,20 +47,20 @@ typedef struct { DWORD reserved; } PROPERTYSETHEADER; -typedef struct { +typedef struct { FMTID fmtid; DWORD dwOffset; } FORMATIDOFFSET; -typedef struct { +typedef struct { DWORD cbSection; DWORD cProperties; -} PROPERTYSECTIONHEADER; - -typedef struct { +} PROPERTYSECTIONHEADER; + +typedef struct { DWORD propid; DWORD dwOffset; -} PROPERTYIDOFFSET; +} PROPERTYIDOFFSET; typedef struct { DWORD type; @@ -74,7 +74,7 @@ typedef struct { } str; } u; } PROPERTY_DATA; - + #include "poppack.h" #define SECT_HDR_SIZE (sizeof(PROPERTYSECTIONHEADER)) @@ -414,7 +414,7 @@ MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount ) TRACE("%p %d\n", stg, uiUpdateCount ); - si = alloc_msiobject( MSIHANDLETYPE_SUMMARYINFO, + si = alloc_msiobject( MSIHANDLETYPE_SUMMARYINFO, sizeof (MSISUMMARYINFO), MSI_CloseSummaryInfo ); if( !si ) return si; @@ -436,7 +436,7 @@ MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount ) return si; } -UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, +UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, LPCWSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle ) { MSISUMMARYINFO *si; @@ -479,13 +479,13 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase, return ret; } -UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, +UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, LPCSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle) { LPWSTR szwDatabase = NULL; UINT ret; - TRACE("%ld %s %d %p\n", hDatabase, debugstr_a(szDatabase), + TRACE("%ld %s %d %p\n", hDatabase, debugstr_a(szDatabase), uiUpdateCount, pHandle); if( szDatabase ) diff --git a/reactos/dll/win32/msi/table.c b/reactos/dll/win32/msi/table.c index c66048ab6c3..610a9383cf3 100644 --- a/reactos/dll/win32/msi/table.c +++ b/reactos/dll/win32/msi/table.c @@ -126,7 +126,7 @@ static LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) *p++ = 0x4840; count --; } - while( count -- ) + while( count -- ) { ch = *in++; if( !ch ) @@ -238,7 +238,7 @@ static UINT read_stream_data( IStorage *stg, LPCWSTR stname, TRACE("%s -> %s\n",debugstr_w(stname),debugstr_w(encname)); - r = IStorage_OpenStream(stg, encname, NULL, + r = IStorage_OpenStream(stg, encname, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm); msi_free( encname ); if( FAILED( r ) ) @@ -259,7 +259,7 @@ static UINT read_stream_data( IStorage *stg, LPCWSTR stname, WARN("Too big!\n"); goto end; } - + sz = stat.cbSize.QuadPart; data = msi_alloc( sz ); if( !data ) @@ -268,7 +268,7 @@ static UINT read_stream_data( IStorage *stg, LPCWSTR stname, ret = ERROR_NOT_ENOUGH_MEMORY; goto end; } - + r = IStream_Read(stm, data, sz, &count ); if( FAILED( r ) || ( count != sz ) ) { @@ -296,7 +296,7 @@ UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm ) TRACE("%s -> %s\n",debugstr_w(stname),debugstr_w(encname)); - r = IStorage_OpenStream(db->storage, encname, NULL, + r = IStorage_OpenStream(db->storage, encname, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm); if( FAILED( r ) ) { @@ -305,7 +305,7 @@ UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm ) LIST_FOR_EACH_ENTRY( transform, &db->transforms, MSITRANSFORM, entry ) { TRACE("looking for %s in transform storage\n", debugstr_w(stname) ); - r = IStorage_OpenStream( transform->stg, encname, NULL, + r = IStorage_OpenStream( transform->stg, encname, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); if (SUCCEEDED(r)) break; @@ -342,7 +342,7 @@ UINT read_raw_stream_data( MSIDATABASE *db, LPCWSTR stname, WARN("Too big!\n"); goto end; } - + sz = stat.cbSize.QuadPart; data = msi_alloc( sz ); if( !data ) @@ -351,7 +351,7 @@ UINT read_raw_stream_data( MSIDATABASE *db, LPCWSTR stname, ret = ERROR_NOT_ENOUGH_MEMORY; goto end; } - + r = IStream_Read(stm, data, sz, &count ); if( FAILED( r ) || ( count != sz ) ) { @@ -382,7 +382,7 @@ static UINT write_stream_data( IStorage *stg, LPCWSTR stname, LPWSTR encname; encname = encode_streamname(TRUE, stname ); - r = IStorage_OpenStream( stg, encname, NULL, + r = IStorage_OpenStream( stg, encname, NULL, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, &stm); if( FAILED(r) ) { @@ -604,7 +604,7 @@ static UINT save_table( MSIDATABASE *db, MSITABLE *t ) r = table_get_column_info( db, t->name, &cols, &num_cols ); if( r != ERROR_SUCCESS ) return r; - + row_size = msi_table_get_row_size( cols, num_cols ); rawsize = t->row_count * row_size; @@ -653,7 +653,7 @@ HRESULT init_string_table( IStorage *stg ) r = IStorage_CreateStream( stg, encname, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm); msi_free( encname ); - if( r ) + if( r ) { TRACE("Failed\n"); return r; @@ -673,7 +673,7 @@ HRESULT init_string_table( IStorage *stg ) r = IStorage_CreateStream( stg, encname, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm); msi_free( encname ); - if( r ) + if( r ) { TRACE("Failed\n"); return E_FAIL; @@ -1335,7 +1335,7 @@ static UINT TABLE_close( struct tagMSIVIEW *view ) return ERROR_FUNCTION_FAILED; tv->table = NULL; - + return ERROR_SUCCESS; } @@ -1557,7 +1557,7 @@ static UINT TABLE_find_matching_rows( struct tagMSIVIEW *view, UINT col, { case 4: offset = tv->columns[col-1].offset/2; - row_value = tv->table->data[i][offset] + + row_value = tv->table->data[i][offset] + (tv->table->data[i][offset + 1] << 16); break; case 2: @@ -1640,7 +1640,7 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view ) tv = msi_alloc_zero( sz ); if( !tv ) return ERROR_FUNCTION_FAILED; - + columns = msi_alloc( column_count*sizeof (MSICOLUMNINFO)); if( !columns ) { diff --git a/reactos/dll/win32/msi/tokenize.c b/reactos/dll/win32/msi/tokenize.c index 96aa67c43ba..5d8c0d39168 100644 --- a/reactos/dll/win32/msi/tokenize.c +++ b/reactos/dll/win32/msi/tokenize.c @@ -137,7 +137,7 @@ static int compKeyword(const void *m1, const void *m2){ /* ** This function looks up an identifier to determine if it is a -** keyword. If it is a keyword, the token code of that keyword is +** keyword. If it is a keyword, the token code of that keyword is ** returned. If the input is not a keyword, TK_ID is returned. */ static int sqliteKeywordCode(const WCHAR *z, int n){ diff --git a/reactos/dll/win32/msi/upgrade.c b/reactos/dll/win32/msi/upgrade.c index da954997bb9..fda9277c408 100644 --- a/reactos/dll/win32/msi/upgrade.c +++ b/reactos/dll/win32/msi/upgrade.c @@ -119,7 +119,7 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) uirow = MSI_CreateRecord(1); attributes = MSI_RecordGetInteger(rec,5); - + while (rc == ERROR_SUCCESS) { rc = RegEnumValueW(hkey, index, product, &sz, NULL, NULL, NULL, NULL); @@ -144,14 +144,14 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) index ++; continue; } - + sz = sizeof(DWORD); RegQueryValueExW(hukey, INSTALLPROPERTY_VERSIONW, NULL, NULL, (LPBYTE)&check, &sz); /* check min */ ver = MSI_RecordGetString(rec,2); comp_ver = msi_version_str_to_dword(ver); - r = check - comp_ver; + r = check - comp_ver; if (r < 0 || (r == 0 && !(attributes & msidbUpgradeAttributesVersionMinInclusive))) { @@ -164,7 +164,7 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) ver = MSI_RecordGetString(rec,3); comp_ver = msi_version_str_to_dword(ver); r = check - comp_ver; - if (r > 0 || (r == 0 && !(attributes & + if (r > 0 || (r == 0 && !(attributes & msidbUpgradeAttributesVersionMaxInclusive))) { RegCloseKey(hukey); @@ -178,7 +178,7 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) (LPBYTE)&check, &sz); RegCloseKey(hukey); language = MSI_RecordGetString(rec,4); - TRACE("Checking languages %x and %s\n", check, + TRACE("Checking languages %x and %s\n", check, debugstr_w(language)); if (!check_language(check, language, attributes)) { @@ -194,13 +194,13 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param) } RegCloseKey(hkey); msiobj_release( &uirow->hdr); - + return ERROR_SUCCESS; } UINT ACTION_FindRelatedProducts(MSIPACKAGE *package) { - static const WCHAR Query[] = + static const WCHAR Query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M', ' ','`','U','p','g','r','a','d','e','`',0}; UINT rc = ERROR_SUCCESS; @@ -217,9 +217,9 @@ UINT ACTION_FindRelatedProducts(MSIPACKAGE *package) rc = MSI_DatabaseOpenViewW(package->db, Query, &view); if (rc != ERROR_SUCCESS) return ERROR_SUCCESS; - + rc = MSI_IterateRecords(view, NULL, ITERATE_FindRelatedProducts, package); msiobj_release(&view->hdr); - + return rc; } diff --git a/reactos/dll/win32/msi/where.c b/reactos/dll/win32/msi/where.c index a30ebcb7c98..647bacc4e6c 100644 --- a/reactos/dll/win32/msi/where.c +++ b/reactos/dll/win32/msi/where.c @@ -165,7 +165,7 @@ static const WCHAR *STRING_evaluate( string_table *st, return NULL; } -static UINT STRCMP_Evaluate( string_table *st, MSIVIEW *table, UINT row, +static UINT STRCMP_Evaluate( string_table *st, MSIVIEW *table, UINT row, struct expr *cond, INT *val, MSIRECORD *record ) { int sr; @@ -189,7 +189,7 @@ static UINT STRCMP_Evaluate( string_table *st, MSIVIEW *table, UINT row, return ERROR_SUCCESS; } -static UINT WHERE_evaluate( MSIDATABASE *db, MSIVIEW *table, UINT row, +static UINT WHERE_evaluate( MSIDATABASE *db, MSIVIEW *table, UINT row, struct expr *cond, INT *val, MSIRECORD *record ) { UINT r, tval; @@ -571,7 +571,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table, wv = msi_alloc_zero( sizeof *wv ); if( !wv ) return ERROR_FUNCTION_FAILED; - + /* fill the structure */ wv->view.ops = &where_ops; msiobj_addref( &db->hdr ); diff --git a/reactos/dll/win32/msvcrt/dllmain.c b/reactos/dll/win32/msvcrt/dllmain.c index a2b30a71c2c..34907715ba7 100644 --- a/reactos/dll/win32/msvcrt/dllmain.c +++ b/reactos/dll/win32/msvcrt/dllmain.c @@ -75,7 +75,7 @@ DllMain(PVOID hinstDll, ULONG dwReason, PVOID reserved) hHeap = HeapCreate(0, 100000, 0); if (hHeap == NULL) return FALSE; - if (!__fileno_init()) + if (!__fileno_init()) return FALSE; /* create tls stuff */ diff --git a/reactos/dll/win32/msvfw32/drawdib.c b/reactos/dll/win32/msvfw32/drawdib.c index 734f0e20b49..643be09bfed 100644 --- a/reactos/dll/win32/msvfw32/drawdib.c +++ b/reactos/dll/win32/msvfw32/drawdib.c @@ -77,12 +77,12 @@ static DWORD HDD_HandleRef = 1; /*********************************************************************** * DrawDibOpen [MSVFW32.@] */ -HDRAWDIB VFWAPI DrawDibOpen(void) +HDRAWDIB VFWAPI DrawDibOpen(void) { WINE_HDD* whdd; TRACE("(void)\n"); - + whdd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_HDD)); TRACE("=> %p\n", whdd); @@ -98,7 +98,7 @@ HDRAWDIB VFWAPI DrawDibOpen(void) /*********************************************************************** * DrawDibClose [MSVFW32.@] */ -BOOL VFWAPI DrawDibClose(HDRAWDIB hdd) +BOOL VFWAPI DrawDibClose(HDRAWDIB hdd) { WINE_HDD* whdd = MSVIDEO_GetHddPtr(hdd); WINE_HDD** p; @@ -126,7 +126,7 @@ BOOL VFWAPI DrawDibClose(HDRAWDIB hdd) /*********************************************************************** * DrawDibEnd [MSVFW32.@] */ -BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) +BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) { BOOL ret = TRUE; WINE_HDD *whdd = MSVIDEO_GetHddPtr(hdd); @@ -145,7 +145,7 @@ BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) /*if (whdd->lpvbits) HeapFree(GetProcessHeap(), 0, whdd->lpvbuf);*/ - if (whdd->hMemDC) + if (whdd->hMemDC) { SelectObject(whdd->hMemDC, whdd->hOldDib); DeleteDC(whdd->hMemDC); @@ -155,7 +155,7 @@ BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) if (whdd->hDib) DeleteObject(whdd->hDib); whdd->hDib = 0; - if (whdd->hic) + if (whdd->hic) { ICDecompressEnd(whdd->hic); ICClose(whdd->hic); @@ -177,7 +177,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, - UINT wFlags) + UINT wFlags) { BOOL ret = TRUE; WINE_HDD *whdd; @@ -199,28 +199,28 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, if (whdd->begun) DrawDibEnd(hdd); - if (lpbi->biCompression) + if (lpbi->biCompression) { DWORD size = 0; whdd->hic = ICOpen(ICTYPE_VIDEO, lpbi->biCompression, ICMODE_DECOMPRESS); - if (!whdd->hic) + if (!whdd->hic) { WARN("Could not open IC. biCompression == 0x%08x\n", lpbi->biCompression); ret = FALSE; } - if (ret) + if (ret) { size = ICDecompressGetFormat(whdd->hic, lpbi, NULL); - if (size == ICERR_UNSUPPORTED) + if (size == ICERR_UNSUPPORTED) { WARN("Codec doesn't support GetFormat, giving up.\n"); ret = FALSE; } } - if (ret) + if (ret) { whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, size); @@ -228,18 +228,18 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, ret = FALSE; } - if (ret) + if (ret) { /* FIXME: Use Ex functions if available? */ if (ICDecompressBegin(whdd->hic, lpbi, whdd->lpbiOut) != ICERR_OK) ret = FALSE; - + TRACE("biSizeImage == %d\n", whdd->lpbiOut->biSizeImage); TRACE("biCompression == %d\n", whdd->lpbiOut->biCompression); TRACE("biBitCount == %d\n", whdd->lpbiOut->biBitCount); } } - else + else { DWORD dwSize; /* No compression */ @@ -249,14 +249,14 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, memcpy(whdd->lpbiOut, lpbi, dwSize); } - if (ret) + if (ret) { /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(), 0, whdd->lpbiOut->biSizeImage);*/ whdd->hMemDC = CreateCompatibleDC(hdc); TRACE("Creating: %d, %p\n", whdd->lpbiOut->biSize, whdd->lpvbits); whdd->hDib = CreateDIBSection(whdd->hMemDC, (BITMAPINFO *)whdd->lpbiOut, DIB_RGB_COLORS, &(whdd->lpvbits), 0, 0); - if (whdd->hDib) + if (whdd->hDib) { TRACE("Created: %p,%p\n", whdd->hDib, whdd->lpvbits); } @@ -268,7 +268,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, whdd->hOldDib = SelectObject(whdd->hMemDC, whdd->hDib); } - if (ret) + if (ret) { whdd->hdc = hdc; whdd->dxDst = dxDst; @@ -279,8 +279,8 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, whdd->dySrc = dySrc; whdd->begun = TRUE; whdd->hpal = 0; - } - else + } + else { if (whdd->hic) ICClose(whdd->hic); @@ -315,7 +315,7 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | DDF_UPDATE | DDF_DONTDRAW | DDF_BACKGROUNDPAL)) FIXME("wFlags == 0x%08x not handled\n", (DWORD)wFlags); - if (!lpBits) + if (!lpBits) { /* Undocumented? */ lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(num_colours(lpbi)*sizeof(RGBQUAD)); @@ -324,9 +324,9 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, #define CHANGED(x) (whdd->x != x) - if ((!whdd->begun) || - (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) || - (!(wFlags & DDF_SAME_DRAW) && (CHANGED(lpbi) || CHANGED(dxSrc) || CHANGED(dySrc) || CHANGED(dxDst) || CHANGED(dyDst)))) + if ((!whdd->begun) || + (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) || + (!(wFlags & DDF_SAME_DRAW) && (CHANGED(lpbi) || CHANGED(dxSrc) || CHANGED(dySrc) || CHANGED(dxDst) || CHANGED(dyDst)))) { TRACE("Something changed!\n"); ret = DrawDibBegin(hdd, hdc, dxDst, dyDst, lpbi, dxSrc, dySrc, 0); @@ -334,13 +334,13 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, #undef CHANGED - if ((dxDst == -1) && (dyDst == -1)) + if ((dxDst == -1) && (dyDst == -1)) { dxDst = dxSrc; dyDst = dySrc; } - if (!(wFlags & DDF_UPDATE)) + if (!(wFlags & DDF_UPDATE)) { DWORD biSizeImage = lpbi->biSizeImage; @@ -348,7 +348,7 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, if ((lpbi->biCompression == BI_RGB) && (biSizeImage == 0)) biSizeImage = ((lpbi->biWidth * lpbi->biBitCount + 31) / 32) * 4 * lpbi->biHeight; - if (lpbi->biCompression) + if (lpbi->biCompression) { DWORD flags = 0; @@ -374,7 +374,7 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, if (!(StretchBlt(whdd->hdc, xDst, yDst, dxDst, dyDst, whdd->hMemDC, xSrc, ySrc, dxSrc, dySrc, SRCCOPY))) ret = FALSE; - + return ret; } @@ -406,7 +406,7 @@ BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEEN /*********************************************************************** * DrawDibSetPalette [MSVFW32.@] */ -BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal) +BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal) { WINE_HDD *whdd; @@ -417,7 +417,7 @@ BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal) whdd->hpal = hpal; - if (whdd->begun) + if (whdd->begun) { SelectPalette(whdd->hdc, hpal, 0); RealizePalette(whdd->hdc); @@ -438,7 +438,7 @@ LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSi /*********************************************************************** * DrawDibGetPalette [MSVFW32.@] */ -HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd) +HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd) { WINE_HDD *whdd; @@ -453,7 +453,7 @@ HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd) /*********************************************************************** * DrawDibRealize [MSVFW32.@] */ -UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground) +UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground) { WINE_HDD *whdd; HPALETTE oldPal; @@ -464,7 +464,7 @@ UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground) whdd = MSVIDEO_GetHddPtr(hdd); if (!whdd) return FALSE; - if (!whdd || !(whdd->begun)) + if (!whdd || !(whdd->begun)) { ret = 0; goto out; diff --git a/reactos/dll/win32/netapi32/access.c b/reactos/dll/win32/netapi32/access.c index d7a2eaa3798..4b4c00145bf 100644 --- a/reactos/dll/win32/netapi32/access.c +++ b/reactos/dll/win32/netapi32/access.c @@ -448,7 +448,7 @@ static void ACCESS_QueryAdminDisplayInformation(PNET_DISPLAY_USER *buf, PDWORD p name_sz = lstrlenW(sAdminUserName); comment_sz = 1; full_name_sz = 1; - + *pdwSize = sizeof(NET_DISPLAY_USER); *pdwSize += (name_sz + comment_sz + full_name_sz) * sizeof(WCHAR); NetApiBufferAllocate(*pdwSize, (LPVOID *) buf); @@ -487,7 +487,7 @@ static void ACCESS_QueryGuestDisplayInformation(PNET_DISPLAY_USER *buf, PDWORD p name_sz = lstrlenW(sGuestUserName); comment_sz = 1; full_name_sz = 1; - + *pdwSize = sizeof(NET_DISPLAY_USER); *pdwSize += (name_sz + comment_sz + full_name_sz) * sizeof(WCHAR); NetApiBufferAllocate(*pdwSize, (LPVOID *) buf); @@ -666,7 +666,7 @@ NetGetDCName(LPCWSTR servername, LPCWSTR domainname, LPBYTE *bufptr) { FIXME("(%s, %s, %p) stub!\n", debugstr_w(servername), debugstr_w(domainname), bufptr); - return NERR_DCNotFound; /* say we can't find a domain controller */ + return NERR_DCNotFound; /* say we can't find a domain controller */ } @@ -684,7 +684,7 @@ NetGetDCName(LPCWSTR servername, LPCWSTR domainname, LPBYTE *bufptr) * USER_MODALS_INFO_0 struct. * 1 Return logon server and domain controller information. bufptr * points to a USER_MODALS_INFO_1 struct. - * 2 Return domain name and identifier. bufptr points to a + * 2 Return domain name and identifier. bufptr points to a * USER_MODALS_INFO_2 struct. * 3 Return lockout information. bufptr points to a USER_MODALS_INFO_3 * struct. @@ -692,7 +692,7 @@ NetGetDCName(LPCWSTR servername, LPCWSTR domainname, LPBYTE *bufptr) * * RETURNS * Success: NERR_Success. - * Failure: + * Failure: * ERROR_ACCESS_DENIED - the user does not have access to the info. * NERR_InvalidComputer - computer name is invalid. */ @@ -700,7 +700,7 @@ NET_API_STATUS WINAPI NetUserModalsGet( LPCWSTR szServer, DWORD level, LPBYTE *pbuffer) { TRACE("(%s %d %p)\n", debugstr_w(szServer), level, pbuffer); - + switch (level) { case 0: @@ -779,7 +779,7 @@ NET_API_STATUS WINAPI NetUserModalsGet( LsaFreeMemory(domainInfo); break; - } + } case 3: /* return lockout information */ FIXME("level 3 not implemented!\n"); diff --git a/reactos/dll/win32/netapi32/apibuf.c b/reactos/dll/win32/netapi32/apibuf.c index a88c6f4c31c..7cbc6b411cb 100644 --- a/reactos/dll/win32/netapi32/apibuf.c +++ b/reactos/dll/win32/netapi32/apibuf.c @@ -62,15 +62,15 @@ NET_API_STATUS WINAPI NetApiBufferReallocate(LPVOID OldBuffer, DWORD NewByteCoun LPVOID* NewBuffer) { TRACE("(%p, %d, %p)\n", OldBuffer, NewByteCount, NewBuffer); - if (NewByteCount) + if (NewByteCount) { if (OldBuffer) *NewBuffer = HeapReAlloc(GetProcessHeap(), 0, OldBuffer, NewByteCount); else *NewBuffer = HeapAlloc(GetProcessHeap(), 0, NewByteCount); return *NewBuffer ? NERR_Success : GetLastError(); - } - else + } + else { if (!HeapFree(GetProcessHeap(), 0, OldBuffer)) return GetLastError(); *NewBuffer = 0; diff --git a/reactos/dll/win32/netapi32/ds.c b/reactos/dll/win32/netapi32/ds.c index 819dc23be3e..3aabeef8e69 100644 --- a/reactos/dll/win32/netapi32/ds.c +++ b/reactos/dll/win32/netapi32/ds.c @@ -78,7 +78,7 @@ VOID WINAPI DsRoleFreeMemory(PVOID Buffer) * * PARAMS * lpServer [I] Pointer to UNICODE string with Computername - * InfoLevel [I] Type of data to retrieve + * InfoLevel [I] Type of data to retrieve * Buffer [O] Pointer to to the requested data * * RETURNS diff --git a/reactos/dll/win32/netapi32/wksta.c b/reactos/dll/win32/netapi32/wksta.c index c51ef023cfd..9fff0512998 100644 --- a/reactos/dll/win32/netapi32/wksta.c +++ b/reactos/dll/win32/netapi32/wksta.c @@ -141,7 +141,7 @@ static void wprint_name(WCHAR *buffer, int len, ULONG transport, /*********************************************************************** * NetWkstaTransportEnum (NETAPI32.@) */ - + struct WkstaTransportEnumData { UCHAR n_adapt; @@ -246,14 +246,14 @@ static BOOL WkstaEnumAdaptersCallback(UCHAR totalLANAs, UCHAR lanaIndex, /**********************************************************************/ -NET_API_STATUS WINAPI +NET_API_STATUS WINAPI NetWkstaTransportEnum(LPWSTR ServerName, DWORD level, PBYTE* pbuf, DWORD prefmaxlen, LPDWORD read_entries, PDWORD total_entries, PDWORD hresume) { NET_API_STATUS ret; - TRACE(":%s, 0x%08x, %p, 0x%08x, %p, %p, %p\n", debugstr_w(ServerName), + TRACE(":%s, 0x%08x, %p, 0x%08x, %p, %p, %p\n", debugstr_w(ServerName), level, pbuf, prefmaxlen, read_entries, total_entries,hresume); if (!NETAPI_IsLocalComputer(ServerName)) { @@ -497,7 +497,7 @@ NET_API_STATUS WINAPI NetWkstaGetInfo( LPWSTR servername, DWORD level, LSA_OBJECT_ATTRIBUTES ObjectAttributes; LSA_HANDLE PolicyHandle; NTSTATUS NtStatus; - + computerNameLen = MAX_COMPUTERNAME_LENGTH + 1; GetComputerNameW(computerName, &computerNameLen); computerNameLen++; /* include NULL terminator */ diff --git a/reactos/dll/win32/netid/lang/pl-PL.rc b/reactos/dll/win32/netid/lang/pl-PL.rc index ab013d944f1..198dd989e66 100644 --- a/reactos/dll/win32/netid/lang/pl-PL.rc +++ b/reactos/dll/win32/netid/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translation by xrogers -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_PROPPAGECOMPUTER DIALOGEX 0, 0, 256, 218 diff --git a/reactos/dll/win32/newdev/lang/bg-BG.rc b/reactos/dll/win32/newdev/lang/bg-BG.rc index 5fdaf82df2a..246071e5d4d 100644 --- a/reactos/dll/win32/newdev/lang/bg-BG.rc +++ b/reactos/dll/win32/newdev/lang/bg-BG.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ñëàãàíå íà óñòðîéñòâî" FONT 8, "MS Shell Dlg" @@ -19,7 +19,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ñëàãàíå íà óñòðîéñòâî" FONT 8, "MS Shell Dlg" @@ -34,7 +34,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ñëàãàíå íà óñòðîéñòâî" FONT 8, "MS Shell Dlg" @@ -56,10 +56,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Òúðñåíå â èçâàæäàåìè íîñèòåëè",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Òúðñåíå è â",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Òúðñåíå è â",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Îáçîð",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -80,7 +80,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ñëàãàíå íà óñòðîéñòâî" FONT 8, "MS Shell Dlg" @@ -94,7 +94,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ñëàãàíå íà óñòðîéñòâî" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/de-DE.rc b/reactos/dll/win32/newdev/lang/de-DE.rc index 956dfb697b9..21ab0d0b16f 100644 --- a/reactos/dll/win32/newdev/lang/de-DE.rc +++ b/reactos/dll/win32/newdev/lang/de-DE.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardwareinstallation" FONT 8, "MS Shell Dlg" @@ -19,7 +19,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardwareinstallation" FONT 8, "MS Shell Dlg" @@ -34,7 +34,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardwareinstallation" FONT 8, "MS Shell Dlg" @@ -56,10 +56,10 @@ BEGIN BS_AUTORADIOBUTTON,30,98,171,12 CONTROL "Wechseldatenträger durchsuchen",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Diesen Pfad ebenfalls durchsuchen",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Diesen Pfad ebenfalls durchsuchen",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,54,162,10 PUSHBUTTON "Durchsuchen",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,64,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,64,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -80,7 +80,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Geräteinstallation" FONT 8, "MS Shell Dlg" @@ -94,7 +94,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardwareinstallation" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/en-US.rc b/reactos/dll/win32/newdev/lang/en-US.rc index c103a952140..6f5635a4668 100644 --- a/reactos/dll/win32/newdev/lang/en-US.rc +++ b/reactos/dll/win32/newdev/lang/en-US.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -19,7 +19,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -34,7 +34,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -56,10 +56,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Search removeable media",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Include this path",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Include this path",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Browse",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -80,7 +80,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -94,7 +94,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/es-ES.rc b/reactos/dll/win32/newdev/lang/es-ES.rc index 32213b73c3b..7527eb289f1 100644 --- a/reactos/dll/win32/newdev/lang/es-ES.rc +++ b/reactos/dll/win32/newdev/lang/es-ES.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Instalación de Dispositivos" FONT 8, "MS Shell Dlg" @@ -19,7 +19,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Instalación de Dispositivos" FONT 8, "MS Shell Dlg" @@ -34,7 +34,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -56,10 +56,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Buscar en medios extraíbles",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Incluir esta ubicación de búsqueda",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Incluir esta ubicación de búsqueda",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Examinar",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -80,7 +80,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -94,7 +94,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/fr-FR.rc b/reactos/dll/win32/newdev/lang/fr-FR.rc index d36b24b1d7a..bf1d11159f6 100644 --- a/reactos/dll/win32/newdev/lang/fr-FR.rc +++ b/reactos/dll/win32/newdev/lang/fr-FR.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installation de matériel" FONT 8, "MS Shell Dlg" @@ -19,7 +19,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installation de matériel" FONT 8, "MS Shell Dlg" @@ -34,7 +34,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installation de matériel" FONT 8, "MS Shell Dlg" @@ -56,10 +56,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Rechercher un disque amovible",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Inclure cet endroit",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Inclure cet endroit",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Parcourir",IDC_BROWSE,248,69,45,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -80,7 +80,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -94,7 +94,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installation de matériel" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/hu-HU.rc b/reactos/dll/win32/newdev/lang/hu-HU.rc index aa150632e9b..40ab26c15bd 100644 --- a/reactos/dll/win32/newdev/lang/hu-HU.rc +++ b/reactos/dll/win32/newdev/lang/hu-HU.rc @@ -2,7 +2,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardver telepítõ" FONT 8, "MS Shell Dlg" @@ -20,7 +20,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardver telepítõ" FONT 8, "MS Shell Dlg" @@ -35,7 +35,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -60,7 +60,7 @@ BEGIN CONTROL "A következõ útvonalon keressen",IDC_CHECK_PATH,"Button", WS_TABSTOP,47,54,162,10 PUSHBUTTON "Böngészés",IDC_BROWSE,248,69,45,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -81,7 +81,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Device installation" FONT 8, "MS Shell Dlg" @@ -95,7 +95,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardver telepítõ" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/id-ID.rc b/reactos/dll/win32/newdev/lang/id-ID.rc index 08b497bf413..495375838bc 100644 --- a/reactos/dll/win32/newdev/lang/id-ID.rc +++ b/reactos/dll/win32/newdev/lang/id-ID.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Instalasi Device" FONT 8, "MS Shell Dlg" @@ -19,7 +19,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Instalasi Device" FONT 8, "MS Shell Dlg" @@ -34,7 +34,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Instalasi Device" FONT 8, "MS Shell Dlg" @@ -56,10 +56,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Mencari media removeable",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Sertakan path ini",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Sertakan path ini",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Lihat",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -80,7 +80,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Instalasi Device" FONT 8, "MS Shell Dlg" @@ -94,7 +94,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Instalasi Device" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/it-IT.rc b/reactos/dll/win32/newdev/lang/it-IT.rc index 5e206bf2f63..f2e61418254 100644 --- a/reactos/dll/win32/newdev/lang/it-IT.rc +++ b/reactos/dll/win32/newdev/lang/it-IT.rc @@ -3,14 +3,14 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/newdev/lang/it-IT.rc * PURPOSE: Italian Translation of dll/win32/newdev/lang/en-US.rc -* PROGRAMMERS: +* PROGRAMMERS: * Copyright (C) 2007 Daniele Forsi (dforsi at gmail.com) Italian Translation */ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installazione dispositivo" FONT 8, "MS Shell Dlg" @@ -28,7 +28,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installazione dispositivo" FONT 8, "MS Shell Dlg" @@ -43,7 +43,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installazione dispositivo" FONT 8, "MS Shell Dlg" @@ -65,10 +65,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Cerca nei supporti rimuovibili",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Includi questo percorso",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Includi questo percorso",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Sfoglia",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -89,7 +89,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installazione dispositivo" FONT 8, "MS Shell Dlg" @@ -103,7 +103,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Installazione dispositivo" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/ru-RU.rc b/reactos/dll/win32/newdev/lang/ru-RU.rc index 947fa1c40f1..1792fe248be 100644 --- a/reactos/dll/win32/newdev/lang/ru-RU.rc +++ b/reactos/dll/win32/newdev/lang/ru-RU.rc @@ -1,7 +1,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ìàñòåð íîâîãî îáîðóäîâàíèÿ" FONT 8, "MS Shell Dlg" @@ -19,7 +19,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ìàñòåð íîâîãî îáîðóäîâàíèÿ" FONT 8, "MS Shell Dlg" @@ -34,7 +34,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ìàñòåð íîâîãî îáîðóäîâàíèÿ" FONT 8, "MS Shell Dlg" @@ -56,10 +56,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Ïîèñê íà ñìåííûõ íîñèòåëÿõ",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Âêëþ÷èòü ýòî ìåñòî ïîèñêà",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Âêëþ÷èòü ýòî ìåñòî ïîèñêà",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Îáçîð",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -80,7 +80,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ìàñòåð íîâîãî îáîðóäîâàíèÿ" FONT 8, "MS Shell Dlg" @@ -93,7 +93,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Ìàñòåð íîâîãî îáîðóäîâàíèÿ" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/th-TH.rc b/reactos/dll/win32/newdev/lang/th-TH.rc index 74ee5e60256..13408105ead 100644 --- a/reactos/dll/win32/newdev/lang/th-TH.rc +++ b/reactos/dll/win32/newdev/lang/th-TH.rc @@ -21,7 +21,7 @@ LANGUAGE LANG_THAI, SUBLANG_DEFAULT IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "¡ÒõԴµÑ駤èÒÍØ»¡Ã³ì" FONT 8, "MS Shell Dlg" @@ -39,7 +39,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "¡ÒõԴµÑé§ÍØ»¡Ã³ì" FONT 8, "MS Shell Dlg" @@ -54,7 +54,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "¡ÒõԴµÑé§ÍØ»¡Ã³ì" FONT 8, "MS Shell Dlg" @@ -76,10 +76,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "¤é¹ËÒÊ×èÍà¤Å×è͹·Õè",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "ÃÇÁàÊé¹·Ò§¹Õé",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "ÃÇÁàÊé¹·Ò§¹Õé",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Ê׺¤é¹",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -100,7 +100,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "¡ÒõԴµÑé§ÍØ»¡Ã³ì" FONT 8, "MS Shell Dlg" @@ -114,7 +114,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "¡ÒõԴµÑé§ÍØ»¡Ã³ì" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/newdev/lang/uk-UA.rc b/reactos/dll/win32/newdev/lang/uk-UA.rc index b15b65a5829..b64ba895441 100644 --- a/reactos/dll/win32/newdev/lang/uk-UA.rc +++ b/reactos/dll/win32/newdev/lang/uk-UA.rc @@ -9,7 +9,7 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT IDD_WELCOMEPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Óñòàíîâêà ïðèñòðîþ" FONT 8, "MS Shell Dlg" @@ -27,7 +27,7 @@ BEGIN END IDD_NODRIVER DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Óñòàíîâêà ïðèñòðîþ" FONT 8, "MS Shell Dlg" @@ -42,7 +42,7 @@ BEGIN END IDD_INSTALLFAILED DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Óñòàíîâêà ïðèñòðîþ" FONT 8, "MS Shell Dlg" @@ -64,10 +64,10 @@ BEGIN BS_AUTORADIOBUTTON,27,98,171,12 CONTROL "Øóêàòè íà çì³ííèõ íîñ³ÿõ",IDC_CHECK_MEDIA,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,47,33,163,9 - CONTROL "Âêëþ÷èòè öåé øëÿõ",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | + CONTROL "Âêëþ÷èòè öåé øëÿõ",IDC_CHECK_PATH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47,54,162,10 PUSHBUTTON "Îãëÿä",IDC_BROWSE,248,69,50,14 - COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO_PATH,61,71,176,12,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_AUTOHSCROLL END @@ -88,7 +88,7 @@ BEGIN END IDD_NEEDREBOOT DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Óñòàíîâêà ïðèñòðîþ" FONT 8, "MS Shell Dlg" @@ -102,7 +102,7 @@ BEGIN END IDD_FINISHPAGE DIALOGEX DISCARDABLE 0, 0, 317, 193 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Óñòàíîâêà ïðèñòðîþ" FONT 8, "MS Shell Dlg" diff --git a/reactos/dll/win32/objsel/factory.c b/reactos/dll/win32/objsel/factory.c index f104c00045a..bf259c18976 100644 --- a/reactos/dll/win32/objsel/factory.c +++ b/reactos/dll/win32/objsel/factory.c @@ -62,13 +62,13 @@ static ULONG WINAPI OBJSEL_IClassFactory_AddRef(LPCLASSFACTORY iface) { ClassFactoryImpl *This = (ClassFactoryImpl *)iface; ULONG ref; - + TRACE("\n"); if (This == NULL) return E_POINTER; - + ref = InterlockedIncrement(&This->ref); - + if (ref == 1) { InterlockedIncrement(&dll_refs); @@ -85,13 +85,13 @@ static ULONG WINAPI OBJSEL_IClassFactory_Release(LPCLASSFACTORY iface) { ClassFactoryImpl *This = (ClassFactoryImpl *)iface; ULONG ref; - + TRACE("\n"); if (This == NULL) return E_POINTER; - + ref = InterlockedDecrement(&This->ref); - + if (ref == 0) { InterlockedDecrement(&dll_refs); diff --git a/reactos/dll/win32/objsel/objsel.c b/reactos/dll/win32/objsel/objsel.c index e99aaefbee4..da454cd9da3 100644 --- a/reactos/dll/win32/objsel/objsel.c +++ b/reactos/dll/win32/objsel/objsel.c @@ -202,7 +202,7 @@ HRESULT WINAPI OBJSEL_IDsObjectPicker_Create(LPVOID *ppvObj) { Instance->lpVtbl = &IDsObjectPicker_Vtbl; OBJSEL_IDsObjectPicker_AddRef((IDsObjectPicker *)Instance); - + *ppvObj = Instance; return S_OK; } diff --git a/reactos/dll/win32/objsel/regsvr.c b/reactos/dll/win32/objsel/regsvr.c index 17c9fd3ec47..806e03198c7 100644 --- a/reactos/dll/win32/objsel/regsvr.c +++ b/reactos/dll/win32/objsel/regsvr.c @@ -518,7 +518,7 @@ static LONG recursive_delete_keyW(HKEY base, WCHAR const *name) { * coclass list */ static struct regsvr_coclass const coclass_list[] = { - { + { &CLSID_DsObjectPicker, "DsObjectPicker", NULL, @@ -527,7 +527,7 @@ static struct regsvr_coclass const coclass_list[] = { "Both", NULL, NULL - }, + }, { NULL } /* list terminator */ }; diff --git a/reactos/dll/win32/odbc32/proxyodbc.c b/reactos/dll/win32/odbc32/proxyodbc.c index a5f44f75dd7..39266b9093b 100644 --- a/reactos/dll/win32/odbc32/proxyodbc.c +++ b/reactos/dll/win32/odbc32/proxyodbc.c @@ -18,8 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * NOTES: - * Proxy ODBC driver manager. This manager delegates all ODBC - * calls to a real ODBC driver manager named by the environment + * Proxy ODBC driver manager. This manager delegates all ODBC + * calls to a real ODBC driver manager named by the environment * variable LIB_ODBC_DRIVER_MANAGER, or to libodbc.so if the * variable is not set. * diff --git a/reactos/dll/win32/odbccp32/odbccp32.c b/reactos/dll/win32/odbccp32/odbccp32.c index 0d4662bb724..e2af0393948 100644 --- a/reactos/dll/win32/odbccp32/odbccp32.c +++ b/reactos/dll/win32/odbccp32/odbccp32.c @@ -432,7 +432,7 @@ BOOL WINAPI SQLInstallDriver(LPCSTR lpszInfFile, LPCSTR lpszDriver, if (lpszInfFile) return FALSE; - + return SQLInstallDriverEx(lpszDriver, NULL, lpszPath, cbPathMax, pcbPathOut, ODBC_INSTALL_COMPLETE, &usage); } diff --git a/reactos/dll/win32/ole32/bindctx.c b/reactos/dll/win32/ole32/bindctx.c index da68f33ab8d..6713321633d 100644 --- a/reactos/dll/win32/ole32/bindctx.c +++ b/reactos/dll/win32/ole32/bindctx.c @@ -199,7 +199,7 @@ BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk) if(This->bindCtxTable[index].pObj) IUnknown_Release(This->bindCtxTable[index].pObj); HeapFree(GetProcessHeap(),0,This->bindCtxTable[index].pkeyObj); - + /* 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]; @@ -227,7 +227,7 @@ BindCtxImpl_ReleaseBoundObjects(IBindCtx* iface) IUnknown_Release(This->bindCtxTable[i].pObj); HeapFree(GetProcessHeap(),0,This->bindCtxTable[i].pkeyObj); } - + This->bindCtxTableLastIndex = 0; return S_OK; @@ -399,7 +399,7 @@ BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR ppenum) if(This->bindCtxTable[index].pObj) IUnknown_Release(This->bindCtxTable[index].pObj); HeapFree(GetProcessHeap(),0,This->bindCtxTable[index].pkeyObj); - + /* 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]; diff --git a/reactos/dll/win32/ole32/classmoniker.c b/reactos/dll/win32/ole32/classmoniker.c index 514990a5bb8..a850af42811 100644 --- a/reactos/dll/win32/ole32/classmoniker.c +++ b/reactos/dll/win32/ole32/classmoniker.c @@ -482,7 +482,7 @@ static HRESULT WINAPI ClassMoniker_Inverse(IMoniker* iface,IMoniker** ppmk) static HRESULT WINAPI ClassMoniker_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix) { DWORD mkSys; - + TRACE("(%p, %p)\n", pmkOther, ppmkPrefix); *ppmkPrefix = NULL; diff --git a/reactos/dll/win32/ole32/compobj.c b/reactos/dll/win32/ole32/compobj.c index 662b42a8dba..9114e975daf 100644 --- a/reactos/dll/win32/ole32/compobj.c +++ b/reactos/dll/win32/ole32/compobj.c @@ -425,7 +425,7 @@ DWORD apartment_release(struct apartment *apt) return ret; } -/* The given OXID must be local to this process: +/* The given OXID must be local to this process: * * The ref parameter is here mostly to ensure people remember that * they get one, you should normally take a ref for thread safety. @@ -1553,7 +1553,7 @@ HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid) * PARAMS * riid [I] Interface whose proxy/stub CLSID is to be returned. * pclsid [O] Where to store returned proxy/stub CLSID. - * + * * RETURNS * S_OK * E_OUTOFMEMORY @@ -1658,7 +1658,7 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid) * PARAMS * riid [I] Interface whose proxy/stub CLSID is to be registered. * rclsid [I] CLSID of the proxy/stub. - * + * * RETURNS * Success: S_OK * Failure: E_OUTOFMEMORY @@ -2561,14 +2561,14 @@ HRESULT WINAPI CoLockObjectExternal( if (!apt) return CO_E_NOTINITIALIZED; stubmgr = get_stub_manager_from_object(apt, pUnk); - + if (stubmgr) { if (fLock) stub_manager_ext_addref(stubmgr, 1); else stub_manager_ext_release(stubmgr, 1, fLastUnlockReleases); - + stub_manager_int_release(stubmgr); return S_OK; @@ -3019,7 +3019,7 @@ HRESULT WINAPI CoAllowSetForegroundWindow(IUnknown *pUnk, void *pvReserved) FIXME("(%p, %p): stub\n", pUnk, pvReserved); return S_OK; } - + /*********************************************************************** * CoQueryProxyBlanket [OLE32.@] * diff --git a/reactos/dll/win32/ole32/compobj_private.h b/reactos/dll/win32/ole32/compobj_private.h index c12150af208..382a6830106 100644 --- a/reactos/dll/win32/ole32/compobj_private.h +++ b/reactos/dll/win32/ole32/compobj_private.h @@ -71,7 +71,7 @@ typedef enum ifstub_state } STUB_STATE; /* an interface stub */ -struct ifstub +struct ifstub { struct list entry; /* entry in stub_manager->ifstubs list (CS stub_manager->lock) */ IRpcStubBuffer *stubbuffer; /* RO */ @@ -284,7 +284,7 @@ static inline struct oletls *COM_CurrentInfo(void) } static inline APARTMENT* COM_CurrentApt(void) -{ +{ return COM_CurrentInfo()->apt; } diff --git a/reactos/dll/win32/ole32/compositemoniker.c b/reactos/dll/win32/ole32/compositemoniker.c index 4a0af25a8cd..e0d7f7d1d6f 100644 --- a/reactos/dll/win32/ole32/compositemoniker.c +++ b/reactos/dll/win32/ole32/compositemoniker.c @@ -629,7 +629,7 @@ CompositeMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash) if(FAILED(res)) break; *pdwHash = *pdwHash ^ tempHash; - + IMoniker_Release(tempMk); } @@ -1411,7 +1411,7 @@ static HRESULT WINAPI CompositeMonikerMarshalImpl_GetMarshalSizeMax( return S_OK; } -static HRESULT WINAPI CompositeMonikerMarshalImpl_MarshalInterface(LPMARSHAL iface, IStream *pStm, +static HRESULT WINAPI CompositeMonikerMarshalImpl_MarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags) { diff --git a/reactos/dll/win32/ole32/dcom.idl b/reactos/dll/win32/ole32/dcom.idl index 6e5a454dc77..3f7f523991b 100644 --- a/reactos/dll/win32/ole32/dcom.idl +++ b/reactos/dll/win32/ole32/dcom.idl @@ -188,7 +188,7 @@ interface IRemUnknown : IUnknown IPID ipid; unsigned long cPublicRefs; unsigned long cPrivateRefs; - } REMINTERFACEREF; + } REMINTERFACEREF; HRESULT RemQueryInterface( [in] REFIPID ripid, @@ -263,7 +263,7 @@ interface IOXIDResolver [out, ref] DUALSTRINGARRAY **ppdsaOxidBindings, [out, ref] IPID *pipidRemUnknown, [out, ref] DWORD *pAuthnHint, - [out, ref] COMVERSION *pComVersion); + [out, ref] COMVERSION *pComVersion); } [ diff --git a/reactos/dll/win32/ole32/defaulthandler.c b/reactos/dll/win32/ole32/defaulthandler.c index 9486813f105..fb401128ef6 100644 --- a/reactos/dll/win32/ole32/defaulthandler.c +++ b/reactos/dll/win32/ole32/defaulthandler.c @@ -1438,7 +1438,7 @@ static void WINAPI DefaultHandler_IAdviseSink_OnClose( IAdviseSink *iface) { DefaultHandler *This = impl_from_IAdviseSink(iface); - + TRACE("()\n"); if (This->oleAdviseHolder) diff --git a/reactos/dll/win32/ole32/errorinfo.c b/reactos/dll/win32/ole32/errorinfo.c index 7318a970f3f..b83953f9d0a 100644 --- a/reactos/dll/win32/ole32/errorinfo.c +++ b/reactos/dll/win32/ole32/errorinfo.c @@ -83,8 +83,8 @@ static BSTR WINAPI ERRORINFO_SysAllocString(const OLECHAR* in) newBuffer++; /* - * Copy the information in the buffer. It is not possible to pass - * a NULL pointer here. + * Copy the information in the buffer. It is not possible to pass + * a NULL pointer here. */ memcpy(newBuffer, in, bufferSize); @@ -528,7 +528,7 @@ HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo) } *pperrinfo = COM_CurrentInfo()->errorinfo; - + /* clear thread error state */ COM_CurrentInfo()->errorinfo = NULL; return S_OK; @@ -566,6 +566,6 @@ HRESULT WINAPI SetErrorInfo(ULONG dwReserved, IErrorInfo *perrinfo) /* set to new value */ COM_CurrentInfo()->errorinfo = perrinfo; if (perrinfo) IErrorInfo_AddRef(perrinfo); - + return S_OK; } diff --git a/reactos/dll/win32/ole32/filemoniker.c b/reactos/dll/win32/ole32/filemoniker.c index 4ef7d593d45..0f76fec81a8 100644 --- a/reactos/dll/win32/ole32/filemoniker.c +++ b/reactos/dll/win32/ole32/filemoniker.c @@ -252,7 +252,7 @@ FileMonikerImpl_Load(IMoniker* iface, IStream* pStm) goto fail; if (!dwbuffer) /* No W-string */ - { + { bytesA--; len=MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, filePathA, bytesA, NULL, 0); if (!len) @@ -325,7 +325,7 @@ FileMonikerImpl_Load(IMoniker* iface, IStream* pStm) * 3) path string type A * 4) DWORD constant : 0xDEADFFFF * 5) five DWORD constant: zero - * 6) If we're only writing the multibyte version, + * 6) If we're only writing the multibyte version, * write a zero DWORD and finish. * * 7) DWORD: double-length of the the path string type W ("\0" not @@ -386,16 +386,16 @@ FileMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty) } /* Write the wide version if: - * + couldn't convert to CP_ACP, - * or + it's a directory, - * or + there's a character > 0xFF + * + couldn't convert to CP_ACP, + * or + it's a directory, + * or + there's a character > 0xFF */ len = lstrlenW(filePathW); bWriteWide = (bUsedDefault || (len > 0 && filePathW[len-1]=='\\' )); if (!bWriteWide) { WCHAR* pch; - for(pch=filePathW;*pch;++pch) + for(pch=filePathW;*pch;++pch) { if (*pch > 0xFF) { @@ -985,17 +985,17 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p { for(i=0;ifilePathName); TRACE("-- %s\n", debugstr_w(*ppszDisplayName)); - + return S_OK; } diff --git a/reactos/dll/win32/ole32/git.c b/reactos/dll/win32/ole32/git.c index e878f83c552..ae2dc2d35b0 100644 --- a/reactos/dll/win32/ole32/git.c +++ b/reactos/dll/win32/ole32/git.c @@ -37,7 +37,7 @@ #include "ole2.h" #include "winerror.h" -#include "compobj_private.h" +#include "compobj_private.h" #include "wine/list.h" #include "wine/debug.h" @@ -69,7 +69,7 @@ typedef struct StdGlobalInterfaceTableImpl ULONG ref; struct list list; ULONG nextCookie; - + } StdGlobalInterfaceTableImpl; void* StdGlobalInterfaceTableInstance; @@ -89,7 +89,7 @@ static void StdGlobalInterfaceTable_Destroy(void* self) { TRACE("(%p)\n", self); FIXME("Revoke held interfaces here\n"); - + HeapFree(GetProcessHeap(), 0, self); StdGlobalInterfaceTableInstance = NULL; } @@ -110,7 +110,7 @@ StdGlobalInterfaceTable_FindEntry(IGlobalInterfaceTable* iface, DWORD cookie) if (e->cookie == cookie) return e; } - + TRACE("Entry not found\n"); return NULL; } @@ -182,7 +182,7 @@ StdGlobalInterfaceTable_RegisterInterfaceInGlobal( TRACE("iface=%p, pUnk=%p, riid=%s, pdwCookie=0x%p\n", iface, pUnk, debugstr_guid(riid), pdwCookie); if (pUnk == NULL) return E_INVALIDARG; - + /* marshal the interface */ TRACE("About to marshal the interface\n"); @@ -202,7 +202,7 @@ StdGlobalInterfaceTable_RegisterInterfaceInGlobal( if (entry == NULL) return E_OUTOFMEMORY; EnterCriticalSection(&git_section); - + entry->iid = *riid; entry->stream = stream; entry->cookie = self->nextCookie; @@ -213,9 +213,9 @@ StdGlobalInterfaceTable_RegisterInterfaceInGlobal( /* and return the cookie */ *pdwCookie = entry->cookie; - + LeaveCriticalSection(&git_section); - + TRACE("Cookie is 0x%x\n", entry->cookie); return S_OK; } @@ -241,7 +241,7 @@ StdGlobalInterfaceTable_RevokeInterfaceFromGlobal( list_remove(&entry->entry); LeaveCriticalSection(&git_section); - + /* Free the stream */ hr = CoReleaseMarshalData(entry->stream); if (hr != S_OK) @@ -250,7 +250,7 @@ StdGlobalInterfaceTable_RevokeInterfaceFromGlobal( return hr; } IStream_Release(entry->stream); - + HeapFree(GetProcessHeap(), 0, entry); return S_OK; } @@ -329,7 +329,7 @@ GITCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) { if (IsEqualIID(riid,&IID_IGlobalInterfaceTable)) { - if (StdGlobalInterfaceTableInstance == NULL) + if (StdGlobalInterfaceTableInstance == NULL) StdGlobalInterfaceTableInstance = StdGlobalInterfaceTable_Construct(); return IGlobalInterfaceTable_QueryInterface( (IGlobalInterfaceTable*) StdGlobalInterfaceTableInstance, riid, ppv); } diff --git a/reactos/dll/win32/ole32/ifs.c b/reactos/dll/win32/ole32/ifs.c index ec20da364ea..6d80fa78d74 100644 --- a/reactos/dll/win32/ole32/ifs.c +++ b/reactos/dll/win32/ole32/ifs.c @@ -172,7 +172,7 @@ static LPVOID WINAPI IMalloc_fnAlloc(LPMALLOC iface, DWORD cb) { if(Malloc32.pSpy) { DWORD preAllocResult; - + EnterCriticalSection(&IMalloc32_SpyCS); preAllocResult = IMallocSpy_PreAlloc(Malloc32.pSpy, cb); if ((cb != 0) && (preAllocResult == 0)) { @@ -182,7 +182,7 @@ static LPVOID WINAPI IMalloc_fnAlloc(LPMALLOC iface, DWORD cb) { return NULL; } } - + addr = HeapAlloc(GetProcessHeap(),0,cb); if(Malloc32.pSpy) { diff --git a/reactos/dll/win32/ole32/itemmoniker.c b/reactos/dll/win32/ole32/itemmoniker.c index 2a8ed22a205..b8954d5f955 100644 --- a/reactos/dll/win32/ole32/itemmoniker.c +++ b/reactos/dll/win32/ole32/itemmoniker.c @@ -788,7 +788,7 @@ HRESULT WINAPI ItemMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk) HRESULT WINAPI ItemMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix) { DWORD mkSys; - + TRACE("(%p,%p)\n", pmkOther, ppmkPrefix); IMoniker_IsSystemMoniker(pmkOther,&mkSys); diff --git a/reactos/dll/win32/ole32/marshal.c b/reactos/dll/win32/ole32/marshal.c index d9183473be3..6c3859f1c60 100644 --- a/reactos/dll/win32/ole32/marshal.c +++ b/reactos/dll/win32/ole32/marshal.c @@ -105,7 +105,7 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno debugstr_guid(riid), hr); return E_NOINTERFACE; } - + /* IUnknown doesn't require a stub buffer, because it never goes out on * the wire */ if (!IsEqualIID(riid, &IID_IUnknown)) @@ -119,7 +119,7 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno IUnknown_Release(iobject); return hr; } - + hr = IPSFactoryBuffer_CreateStub(psfb, riid, iobject, &stub); IPSFactoryBuffer_Release(psfb); if (hr != S_OK) @@ -1116,7 +1116,7 @@ typedef struct _StdMarshalImpl DWORD mshlflags; } StdMarshalImpl; -static HRESULT WINAPI +static HRESULT WINAPI StdMarshalImpl_QueryInterface(LPMARSHAL iface, REFIID riid, LPVOID *ppv) { *ppv = NULL; @@ -1304,9 +1304,9 @@ StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, v { TRACE("Unmarshalling object marshalled in same apartment for iid %s, " "returning original object %p\n", debugstr_guid(riid), stubmgr->object); - + hres = IUnknown_QueryInterface(stubmgr->object, riid, ppv); - + /* unref the ifstub. FIXME: only do this on success? */ if (!stub_manager_is_table_marshaled(stubmgr, &stdobjref.ipid)) stub_manager_ext_release(stubmgr, stdobjref.cPublicRefs, TRUE); @@ -1363,7 +1363,7 @@ StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm) APARTMENT *apt; TRACE("iface=%p, pStm=%p\n", iface, pStm); - + hres = IStream_Read(pStm, &stdobjref, sizeof(stdobjref), &res); if (hres) return STG_E_READFAULT; @@ -1416,7 +1416,7 @@ static const IMarshalVtbl VT_StdMarshal = static HRESULT StdMarshalImpl_Construct(REFIID riid, void** ppvObject) { - StdMarshalImpl * pStdMarshal = + StdMarshalImpl * pStdMarshal = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(StdMarshalImpl)); if (!pStdMarshal) return E_OUTOFMEMORY; @@ -1533,7 +1533,7 @@ static HRESULT get_unmarshaler_from_stream(IStream *stream, IMarshal **marshal, } else if (objref.flags & OBJREF_CUSTOM) { - ULONG custom_header_size = FIELD_OFFSET(OBJREF, u_objref.u_custom.pData) - + ULONG custom_header_size = FIELD_OFFSET(OBJREF, u_objref.u_custom.pData) - FIELD_OFFSET(OBJREF, u_objref.u_custom); TRACE("Using custom unmarshaling\n"); /* read constant sized OR_CUSTOM data from stream */ @@ -1752,7 +1752,7 @@ cleanup: IMarshal_Release(pMarshal); TRACE("completed with hr 0x%08x\n", hr); - + return hr; } @@ -1818,7 +1818,7 @@ HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv) IMarshal_Release(pMarshal); TRACE("completed with hr 0x%x\n", hr); - + return hr; } @@ -1837,7 +1837,7 @@ HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv) * Failure: HRESULT error code. * * NOTES - * + * * Call this function to release resources associated with a normal or * table-weak marshal that will not be unmarshaled, and all table-strong * marshals when they are no longer needed. diff --git a/reactos/dll/win32/ole32/memlockbytes.c b/reactos/dll/win32/ole32/memlockbytes.c index 57c5b0bfa4f..ed40c7f0738 100644 --- a/reactos/dll/win32/ole32/memlockbytes.c +++ b/reactos/dll/win32/ole32/memlockbytes.c @@ -99,7 +99,7 @@ static const ILockBytesVtbl HGLOBALLockBytesImpl_Vtbl; * * PARAMS * hGlobal [ I] Global memory handle - * fDeleteOnRelease [ I] Whether the handle should be freed when the object is released. + * fDeleteOnRelease [ I] Whether the handle should be freed when the object is released. * ppLkbyt [ O] Address of ILockBytes pointer that receives * the interface pointer to the new byte array object. * @@ -142,7 +142,7 @@ HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL hGlobal, * RETURNS * S_OK if *phglobal has a correct value * E_INVALIDARG if any parameters are invalid - * + * */ HRESULT WINAPI GetHGlobalFromILockBytes(ILockBytes* plkbyt, HGLOBAL* phglobal) { diff --git a/reactos/dll/win32/ole32/memlockbytes16.c b/reactos/dll/win32/ole32/memlockbytes16.c index bccb953c735..dd5427d4427 100644 --- a/reactos/dll/win32/ole32/memlockbytes16.c +++ b/reactos/dll/win32/ole32/memlockbytes16.c @@ -497,7 +497,7 @@ HRESULT CDECL HGLOBALLockBytesImpl16_Stat( /****************************************************************************** * CreateILockBytesOnHGlobal [OLE2.54] - * + * * Creates an ILockBytes interface for a HGLOBAL handle. * * PARAMS diff --git a/reactos/dll/win32/ole32/ole16.c b/reactos/dll/win32/ole32/ole16.c index b89efa8f098..4181640048b 100644 --- a/reactos/dll/win32/ole32/ole16.c +++ b/reactos/dll/win32/ole32/ole16.c @@ -128,7 +128,7 @@ SEGPTR CDECL IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb) SEGPTR ret; IMalloc16Impl *This = (IMalloc16Impl *)iface; TRACE("(%p)->Realloc(%08x,%d)\n",This,pv,cb); - if (!pv) + if (!pv) ret = IMalloc16_fnAlloc(iface, cb); else if (cb) { ret = MapLS( HeapReAlloc( GetProcessHeap(), 0, MapSL(pv), cb ) ); @@ -420,7 +420,7 @@ HRESULT WINAPI ProgIDFromCLSID16( ret = COM_OpenKeyForCLSID(clsid, wszProgID, KEY_READ, &hkey); if (FAILED(ret)) return ret; - + if (RegQueryValueA(hkey, NULL, NULL, &len)) ret = REGDB_E_READREGDB; diff --git a/reactos/dll/win32/ole32/ole2.c b/reactos/dll/win32/ole32/ole2.c index e58385bdf71..8e761304013 100644 --- a/reactos/dll/win32/ole32/ole2.c +++ b/reactos/dll/win32/ole32/ole2.c @@ -527,7 +527,7 @@ HRESULT WINAPI DoDragDrop ( trackerInfo.curMousePos.x = msg.pt.x; trackerInfo.curMousePos.y = msg.pt.y; trackerInfo.dwKeyState = OLEDD_GetButtonState(); - + if ( (msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST) ) { @@ -856,7 +856,7 @@ static HRESULT EnumOLEVERB_Construct(HKEY hkeyVerb, ULONG index, IEnumOLEVERB ** This->index = index; This->hkeyVerb = hkeyVerb; *ppenum = (IEnumOLEVERB *)&This->lpvtbl; - return S_OK; + return S_OK; } /*********************************************************************** @@ -2477,7 +2477,7 @@ HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew) HRESULT res = S_OK; TRACE("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew)); - + res = COM_OpenKeyForCLSID(clsidOld, NULL, KEY_READ | KEY_WRITE, &hkey); if (FAILED(res)) goto done; diff --git a/reactos/dll/win32/ole32/ole2_16.c b/reactos/dll/win32/ole32/ole2_16.c index 90a1ed20237..bf2f466ef38 100644 --- a/reactos/dll/win32/ole32/ole2_16.c +++ b/reactos/dll/win32/ole32/ole2_16.c @@ -104,7 +104,7 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16( return 0; } - FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n", + FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n", hIcon, lpszLabel, lpszSourceFile, iIconIndex); hdc = CreateMetaFileW(NULL); diff --git a/reactos/dll/win32/ole32/oleobj.c b/reactos/dll/win32/ole32/oleobj.c index 1c887977ac5..31dffeac675 100644 --- a/reactos/dll/win32/ole32/oleobj.c +++ b/reactos/dll/win32/ole32/oleobj.c @@ -111,7 +111,7 @@ static HRESULT WINAPI EnumOleSTATDATA_Next( for (; celt; celt--, rgelt++) { - while ((This->index < This->pOleAdviseHolder->maxSinks) && + while ((This->index < This->pOleAdviseHolder->maxSinks) && !This->pOleAdviseHolder->arrayOfSinks[This->index]) { This->index++; @@ -144,7 +144,7 @@ static HRESULT WINAPI EnumOleSTATDATA_Skip( for (; celt; celt--) { - while ((This->index < This->pOleAdviseHolder->maxSinks) && + while ((This->index < This->pOleAdviseHolder->maxSinks) && !This->pOleAdviseHolder->arrayOfSinks[This->index]) { This->index++; @@ -197,7 +197,7 @@ static HRESULT EnumOleSTATDATA_Construct(OleAdviseHolderImpl *pOleAdviseHolder, This->pOleAdviseHolder = pOleAdviseHolder; IOleAdviseHolder_AddRef((IOleAdviseHolder *)pOleAdviseHolder); *ppenum = (IEnumSTATDATA *)&This->lpvtbl; - return S_OK; + return S_OK; } /************************************************************************** @@ -573,7 +573,7 @@ static void DataAdviseHolder_Destructor(DataAdviseHolder* ptrToDestroy) { if (ptrToDestroy->Connections[index].sink != NULL) { - if (ptrToDestroy->delegate && + if (ptrToDestroy->delegate && (ptrToDestroy->Connections[index].advf & WINE_ADVF_REMOTE)) IDataObject_DUnadvise(ptrToDestroy->delegate, ptrToDestroy->Connections[index].remote_connection); diff --git a/reactos/dll/win32/ole32/oleproxy.c b/reactos/dll/win32/ole32/oleproxy.c index e8079411c8f..9dc089963b8 100644 --- a/reactos/dll/win32/ole32/oleproxy.c +++ b/reactos/dll/win32/ole32/oleproxy.c @@ -569,7 +569,7 @@ static HRESULT WINAPI RemUnkStub_Invoke(LPRPCSTUBBUFFER iface, buf = pMsg->Buffer; *(HRESULT *)buf = hr; buf += sizeof(HRESULT); - + if (hr) return hr; /* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */ memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT)); diff --git a/reactos/dll/win32/ole32/rpc.c b/reactos/dll/win32/ole32/rpc.c index 9c3ab832bb8..80fbd0ef870 100644 --- a/reactos/dll/win32/ole32/rpc.c +++ b/reactos/dll/win32/ole32/rpc.c @@ -1021,7 +1021,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid, endpoint, NULL, &string_binding); - + if (status == RPC_S_OK) { status = RpcBindingFromStringBindingW(string_binding, &bind); @@ -1072,7 +1072,7 @@ HRESULT RPC_CreateServerChannel(IRpcChannelBuffer **chan) This->lpVtbl = &ServerRpcChannelBufferVtbl; This->refs = 1; - + *chan = (IRpcChannelBuffer*)This; return S_OK; @@ -1424,7 +1424,7 @@ HRESULT RPC_RegisterInterface(REFIID riid) struct registered_if *rif; BOOL found = FALSE; HRESULT hr = S_OK; - + TRACE("(%s)\n", debugstr_guid(riid)); EnterCriticalSection(&csRegIf); @@ -1527,7 +1527,7 @@ void RPC_StartRemoting(struct apartment *apt) RPC_STATUS status; get_rpc_endpoint(endpoint, &apt->oxid); - + status = RpcServerUseProtseqEpW( wszRpcTransport, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, @@ -1712,7 +1712,7 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) while (tries++ < MAXTRIES) { TRACE("waiting for %s\n", debugstr_w(pipefn)); - + WaitNamedPipeW( pipefn, NMPWAIT_WAIT_FOREVER ); hPipe = CreateFileW(pipefn, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); if (hPipe == INVALID_HANDLE_VALUE) { @@ -1737,17 +1737,17 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) CloseHandle(hPipe); break; } - + if (tries >= MAXTRIES) return E_NOINTERFACE; - + hres = CreateStreamOnHGlobal(0,TRUE,&pStm); if (hres) return hres; hres = IStream_Write(pStm,marshalbuffer,bufferlen,&res); if (hres) goto out; seekto.u.LowPart = 0;seekto.u.HighPart = 0; hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos); - + TRACE("unmarshalling classfactory\n"); hres = CoUnmarshalInterface(pStm,&IID_IClassFactory,ppv); out: @@ -1799,7 +1799,7 @@ static DWORD WINAPI local_server_thread(LPVOID param) FIXME("pipe creation failed for %s, le is %u\n", debugstr_w(pipefn), GetLastError()); return 1; } - + while (1) { if (!ConnectNamedPipe(hPipe,NULL)) { @@ -1819,7 +1819,7 @@ static DWORD WINAPI local_server_thread(LPVOID param) } TRACE("marshalling IClassFactory to client\n"); - + hres = IStream_Stat(pStm,&ststg,0); if (hres) return hres; @@ -1833,14 +1833,14 @@ static DWORD WINAPI local_server_thread(LPVOID param) buflen = ststg.cbSize.u.LowPart; buffer = HeapAlloc(GetProcessHeap(),0,buflen); - + hres = IStream_Read(pStm,buffer,buflen,&res); if (hres) { FIXME("Stream Read failed, %x\n",hres); HeapFree(GetProcessHeap(),0,buffer); return hres; } - + WriteFile(hPipe,buffer,buflen,&res,NULL); HeapFree(GetProcessHeap(),0,buffer); diff --git a/reactos/dll/win32/ole32/stg_prop.c b/reactos/dll/win32/ole32/stg_prop.c index 76a86ca59f8..e5d3f8a4e75 100644 --- a/reactos/dll/win32/ole32/stg_prop.c +++ b/reactos/dll/win32/ole32/stg_prop.c @@ -1083,7 +1083,7 @@ static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This, case VT_LPSTR: { DWORD count; - + StorageUtl_ReadDWord(data, 0, &count); if (This->codePage == CP_UNICODE && count / 2) { diff --git a/reactos/dll/win32/ole32/stg_stream.c b/reactos/dll/win32/ole32/stg_stream.c index 1bcb40b0054..2d1bdc5b9d8 100644 --- a/reactos/dll/win32/ole32/stg_stream.c +++ b/reactos/dll/win32/ole32/stg_stream.c @@ -386,7 +386,7 @@ static HRESULT WINAPI StgStreamImpl_Write( WARN("storage reverted\n"); return STG_E_REVERTED; } - + /* * If the caller is not interested in the number of bytes written, * we use another buffer to avoid "if" statements in the code. diff --git a/reactos/dll/win32/ole32/storage.c b/reactos/dll/win32/ole32/storage.c index febdc1290b3..51f72ad8040 100644 --- a/reactos/dll/win32/ole32/storage.c +++ b/reactos/dll/win32/ole32/storage.c @@ -114,18 +114,18 @@ static void _create_istream16(LPSTREAM16 *str); * #define DF_VTOC_FREE -1 * #define DF_NAMELEN 0x20 // Maximum entry name length - 31 characters plus * // a NUL terminator - * + * * #define DF_FT_STORAGE 1 * #define DF_FT_STREAM 2 * #define DF_FT_LOCKBYTES 3 // Not used -- How the bloody hell did I manage * #define DF_FT_PROPERTY 4 // Not Used -- to figure these two out? * #define DF_FT_ROOT 5 - * + * * #define DF_BLOCK_SIZE 0x200 * #define DF_VTOC_SIZE 0x80 * #define DF_DE_PER_BLOCK 4 * #define DF_STREAM_BLOCK_SIZE 0x40 - * + * * A DocFile is divided into blocks of 512 bytes. * The first block contains the header. * @@ -199,36 +199,36 @@ static void _create_istream16(LPSTREAM16 *str); * * * #define TOTAL_SIMPLE_VTOCS 109 - * + * * struct DocFile_Header * { - * df_byte iMagic1; // 0xd0 - * df_byte iMagic2; // 0xcf - * df_byte iMagic3; // 0x11 - * df_byte iMagic4; // 0xe0 - Spells D0CF11E0, or DocFile - * df_byte iMagic5; // 161 (igi upside down) - * df_byte iMagic6; // 177 (lli upside down - see below - * df_byte iMagic7; // 26 (gz upside down) - * df_byte iMagic8; // 225 (szz upside down) - see below + * df_byte iMagic1; // 0xd0 + * df_byte iMagic2; // 0xcf + * df_byte iMagic3; // 0x11 + * df_byte iMagic4; // 0xe0 - Spells D0CF11E0, or DocFile + * df_byte iMagic5; // 161 (igi upside down) + * df_byte iMagic6; // 177 (lli upside down - see below + * df_byte iMagic7; // 26 (gz upside down) + * df_byte iMagic8; // 225 (szz upside down) - see below * df_int4 aiUnknown1[4]; - * df_int4 iVersion; // DocFile Version - 0x03003E + * df_int4 iVersion; // DocFile Version - 0x03003E * df_int4 aiUnknown2[4]; - * df_int4 nVTOCs; // Number of VTOCs - * df_int4 iFirstDirBlock; // First Directory Block + * df_int4 nVTOCs; // Number of VTOCs + * df_int4 iFirstDirBlock; // First Directory Block * df_int4 aiUnknown3[2]; - * df_int4 iFirstDataVTOC; // First data VTOC block + * df_int4 iFirstDataVTOC; // First data VTOC block * df_int4 iHasData; // 1 if there is data in the file - yes, this is important - * df_int4 iExtendedVTOC; // Extended VTOC location - * df_int4 iExtendedVTOCSize; // Size of extended VTOC (+1?) + * df_int4 iExtendedVTOC; // Extended VTOC location + * df_int4 iExtendedVTOCSize; // Size of extended VTOC (+1?) * df_int4 aiVTOCofVTOCs[TOTAL_SIMPLE_VTOCS]; * }; - * + * * struct DocFile_VTOC * { * df_int4 aiBlocks[DF_VTOC_SIZE]; * }; - * - * + * + * * The meaning of the magic numbers * * 0xd0cf11e0 is DocFile with a zero on the end (sort of) @@ -243,27 +243,27 @@ static void _create_istream16(LPSTREAM16 *str); * Microsoft placeholder variables, along the lines of foo, bar and baz. * Alternatively, it could be 22526, which would be gzszz. * - * + * * struct DocFile_DirEnt * { - * df_char achEntryName[DF_NAMELEN]; // Entry Name - * df_int2 iNameLen; // Name length in bytes, including NUL terminator - * df_byte iFileType; // Entry type - * df_byte iColour; // 1 = Black, 0 = Red - * df_int4 iLeftSibling; // Next Left Sibling Entry - See below - * df_int4 iRightSibling; // Next Right Sibling Entry - * df_int4 iFirstChild; // First Child Entry - * df_byte achClassID[16]; // Class ID - * df_int4 iStateBits; // [GS]etStateBits value - * df_int4 iCreatedLow; // Low DWORD of creation time - * df_int4 iCreatedHigh; // High DWORD of creation time - * df_int4 iModifiedLow; // Low DWORD of modification time - * df_int4 iModifiedHigh; // High DWORD of modification time - * df_int4 iVTOCPosition; // VTOC Position - * df_int4 iFileSize; // Size of the stream - * df_int4 iZero; // We think this is part of the 64 bit stream size - must be 0 + * df_char achEntryName[DF_NAMELEN]; // Entry Name + * df_int2 iNameLen; // Name length in bytes, including NUL terminator + * df_byte iFileType; // Entry type + * df_byte iColour; // 1 = Black, 0 = Red + * df_int4 iLeftSibling; // Next Left Sibling Entry - See below + * df_int4 iRightSibling; // Next Right Sibling Entry + * df_int4 iFirstChild; // First Child Entry + * df_byte achClassID[16]; // Class ID + * df_int4 iStateBits; // [GS]etStateBits value + * df_int4 iCreatedLow; // Low DWORD of creation time + * df_int4 iCreatedHigh; // High DWORD of creation time + * df_int4 iModifiedLow; // Low DWORD of modification time + * df_int4 iModifiedHigh; // High DWORD of modification time + * df_int4 iVTOCPosition; // VTOC Position + * df_int4 iFileSize; // Size of the stream + * df_int4 iZero; // We think this is part of the 64 bit stream size - must be 0 * }; - * + * * Siblings * ======== * @@ -364,7 +364,7 @@ STORAGE_get_big_block(stream_access16 *str,int n,BYTE *block) DWORD args[6]; HRESULT hres; HANDLE16 hsig; - + args[0] = (DWORD)str->lockbytes; /* iface */ args[1] = (n+1)*BIGSIZE; args[2] = 0; /* ULARGE_INTEGER offset */ @@ -1095,7 +1095,7 @@ static void _ilockbytes16_addref(SEGPTR lockbytes) { DWORD args[1]; HRESULT hres; - + args[0] = (DWORD)lockbytes; /* iface */ if (!WOWCallback16Ex( (DWORD)((const ILockBytes16Vtbl*)MapSL( @@ -1113,7 +1113,7 @@ static void _ilockbytes16_release(SEGPTR lockbytes) { DWORD args[1]; HRESULT hres; - + args[0] = (DWORD)lockbytes; /* iface */ if (!WOWCallback16Ex( (DWORD)((const ILockBytes16Vtbl*)MapSL( @@ -1131,7 +1131,7 @@ static void _ilockbytes16_flush(SEGPTR lockbytes) { DWORD args[1]; HRESULT hres; - + args[0] = (DWORD)lockbytes; /* iface */ if (!WOWCallback16Ex( (DWORD)((const ILockBytes16Vtbl*)MapSL( @@ -2151,7 +2151,7 @@ HRESULT WINAPI StgIsStorageILockBytes16(SEGPTR plkbyt) DWORD args[6]; HRESULT hres; HANDLE16 hsig; - + args[0] = (DWORD)plkbyt; /* iface */ args[1] = args[2] = 0; /* ULARGE_INTEGER offset */ args[3] = WOWGlobalAllocLock16( 0, 8, &hsig ); /* sig */ diff --git a/reactos/dll/win32/ole32/storage32.c b/reactos/dll/win32/ole32/storage32.c index 584b132e229..3511e66fb40 100644 --- a/reactos/dll/win32/ole32/storage32.c +++ b/reactos/dll/win32/ole32/storage32.c @@ -972,7 +972,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream( if ( FAILED( validateSTGM(grfMode) )) return STG_E_INVALIDFLAG; - if (STGM_SHARE_MODE(grfMode) != STGM_SHARE_EXCLUSIVE) + if (STGM_SHARE_MODE(grfMode) != STGM_SHARE_EXCLUSIVE) return STG_E_INVALIDFLAG; /* @@ -4344,8 +4344,8 @@ void StorageUtl_CopyPropertyToSTATSTG( /* * The copy of the string occurs only when the flag is not set */ - if( ((statFlags & STATFLAG_NONAME) != 0) || - (source->name == NULL) || + if( ((statFlags & STATFLAG_NONAME) != 0) || + (source->name == NULL) || (source->name[0] == 0) ) { destination->pwcsName = 0; @@ -5819,25 +5819,25 @@ HRESULT WINAPI StgCreateStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD st if (stgfmt != STGFMT_FILE && grfAttrs != 0) { ERR("grfAttrs must be 0 if stgfmt != STGFMT_FILE\n"); - return STG_E_INVALIDPARAMETER; + return STG_E_INVALIDPARAMETER; } if (stgfmt == STGFMT_FILE && grfAttrs != 0 && grfAttrs != FILE_FLAG_NO_BUFFERING) { ERR("grfAttrs must be 0 or FILE_FLAG_NO_BUFFERING if stgfmt == STGFMT_FILE\n"); - return STG_E_INVALIDPARAMETER; + return STG_E_INVALIDPARAMETER; } if (stgfmt == STGFMT_FILE) { - ERR("Cannot use STGFMT_FILE - this is NTFS only\n"); + ERR("Cannot use STGFMT_FILE - this is NTFS only\n"); return STG_E_INVALIDPARAMETER; } if (stgfmt == STGFMT_STORAGE || stgfmt == STGFMT_DOCFILE) { FIXME("Stub: calling StgCreateDocfile, but ignoring pStgOptions and grfAttrs\n"); - return StgCreateDocfile(pwcsName, grfMode, 0, (IStorage **)ppObjectOpen); + return StgCreateDocfile(pwcsName, grfMode, 0, (IStorage **)ppObjectOpen); } ERR("Invalid stgfmt argument\n"); @@ -5872,15 +5872,15 @@ HRESULT WINAPI StgOpenStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD stgf if (stgfmt != STGFMT_DOCFILE && grfAttrs != 0) { ERR("grfAttrs must be 0 if stgfmt != STGFMT_DOCFILE\n"); - return STG_E_INVALIDPARAMETER; + return STG_E_INVALIDPARAMETER; } switch (stgfmt) { case STGFMT_FILE: - ERR("Cannot use STGFMT_FILE - this is NTFS only\n"); + ERR("Cannot use STGFMT_FILE - this is NTFS only\n"); return STG_E_INVALIDPARAMETER; - + case STGFMT_STORAGE: break; @@ -5888,7 +5888,7 @@ HRESULT WINAPI StgOpenStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD stgf if (grfAttrs && grfAttrs != FILE_FLAG_NO_BUFFERING) { ERR("grfAttrs must be 0 or FILE_FLAG_NO_BUFFERING if stgfmt == STGFMT_DOCFILE\n"); - return STG_E_INVALIDPARAMETER; + return STG_E_INVALIDPARAMETER; } FIXME("Stub: calling StgOpenStorage, but ignoring pStgOptions and grfAttrs\n"); break; @@ -5901,7 +5901,7 @@ HRESULT WINAPI StgOpenStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD stgf return STG_E_INVALIDPARAMETER; } - return StgOpenStorage(pwcsName, NULL, grfMode, (SNB)NULL, 0, (IStorage **)ppObjectOpen); + return StgOpenStorage(pwcsName, NULL, grfMode, (SNB)NULL, 0, (IStorage **)ppObjectOpen); } @@ -6240,7 +6240,7 @@ HRESULT WINAPI StgSetTimes(OLECHAR const *str, FILETIME const *pctime, { IStorage *stg = NULL; HRESULT r; - + TRACE("%s %p %p %p\n", debugstr_w(str), pctime, patime, pmtime); r = StgOpenStorage(str, NULL, STGM_READWRITE | STGM_SHARE_DENY_WRITE, @@ -7026,7 +7026,7 @@ static HRESULT STREAM_ReadString( IStream *stm, LPWSTR *string ) return E_OUTOFMEMORY; TRACE("%d bytes\n",len); - + str = CoTaskMemAlloc( len ); if( !str ) return E_OUTOFMEMORY; @@ -7128,7 +7128,7 @@ HRESULT WINAPI WriteFmtUserTypeStg( TRACE("progid is %s\n",debugstr_w(wstrProgID)); - r = STORAGE_WriteCompObj( pstg, &clsid, + r = STORAGE_WriteCompObj( pstg, &clsid, lpszUserType, szwClipName, wstrProgID ); CoTaskMemFree(wstrProgID); @@ -7153,7 +7153,7 @@ HRESULT WINAPI ReadFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT* pcf, LPOLESTR* lp TRACE("(%p,%p,%p)\n", pstg, pcf, lplpszUserType); - r = IStorage_OpenStream( pstg, szCompObj, NULL, + r = IStorage_OpenStream( pstg, szCompObj, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm ); if( FAILED ( r ) ) { diff --git a/reactos/dll/win32/ole32/stubmanager.c b/reactos/dll/win32/ole32/stubmanager.c index 2243f337bd9..286acb85b73 100644 --- a/reactos/dll/win32/ole32/stubmanager.c +++ b/reactos/dll/win32/ole32/stubmanager.c @@ -53,7 +53,7 @@ struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) struct stub_manager *sm; assert( apt ); - + sm = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct stub_manager)); if (!sm) return NULL; @@ -101,7 +101,7 @@ struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) LeaveCriticalSection(&apt->cs); TRACE("Created new stub manager (oid=%s) at %p for object with IUnknown %p\n", wine_dbgstr_longlong(sm->oid), sm, object); - + return sm; } @@ -155,7 +155,7 @@ struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object) else TRACE("not found for object %p\n", object); - return result; + return result; } /* removes the apartment reference to an object, destroying it when no other @@ -257,13 +257,13 @@ ULONG stub_manager_ext_addref(struct stub_manager *m, ULONG refs) ULONG rc; EnterCriticalSection(&m->lock); - + /* make sure we don't overflow extrefs */ refs = min(refs, (ULONG_MAX-1 - m->extrefs)); rc = (m->extrefs += refs); LeaveCriticalSection(&m->lock); - + TRACE("added %u refs to %p (oid %s), rc is now %u\n", refs, m, wine_dbgstr_longlong(m->oid), rc); return rc; @@ -281,7 +281,7 @@ ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs, BOOL last_unl rc = (m->extrefs -= refs); LeaveCriticalSection(&m->lock); - + TRACE("removed %u refs from %p (oid %s), rc is now %u\n", refs, m, wine_dbgstr_longlong(m->oid), rc); if (rc == 0 && last_unlock_releases) @@ -294,7 +294,7 @@ static struct ifstub *stub_manager_ipid_to_ifstub(struct stub_manager *m, const { struct list *cursor; struct ifstub *result = NULL; - + EnterCriticalSection(&m->lock); LIST_FOR_EACH( cursor, &m->ifstubs ) { @@ -537,10 +537,10 @@ BOOL stub_manager_notify_unmarshal(struct stub_manager *m, const IPID *ipid) void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const IPID *ipid) { struct ifstub *ifstub; - + if (!(ifstub = stub_manager_ipid_to_ifstub(m, ipid))) return; - + if (ifstub->flags & MSHLFLAGS_TABLEWEAK) refs = 0; else if (ifstub->flags & MSHLFLAGS_TABLESTRONG) @@ -553,9 +553,9 @@ void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid) { struct ifstub *ifstub = stub_manager_ipid_to_ifstub(m, ipid); - + assert( ifstub ); - + return ifstub->flags & (MSHLFLAGS_TABLESTRONG | MSHLFLAGS_TABLEWEAK); } diff --git a/reactos/dll/win32/ole32/usrmarshal.c b/reactos/dll/win32/ole32/usrmarshal.c index c1b55422bd3..51bddf57d2f 100644 --- a/reactos/dll/win32/ole32/usrmarshal.c +++ b/reactos/dll/win32/ole32/usrmarshal.c @@ -371,7 +371,7 @@ ULONG __RPC_USER HGLOBAL_UserSize(ULONG *pFlags, ULONG StartingSize, HGLOBAL *ph size += (ULONG)ret; } } - + return size; } @@ -1079,7 +1079,7 @@ ULONG __RPC_USER HENHMETAFILE_UserSize(ULONG *pFlags, ULONG StartingSize, HENHME if (*phEmf) { UINT emfsize; - + size += 2 * sizeof(ULONG); emfsize = GetEnhMetaFileBits(*phEmf, 0, NULL); size += emfsize; @@ -1128,11 +1128,11 @@ unsigned char * __RPC_USER HENHMETAFILE_UserMarshal(ULONG *pFlags, unsigned char pBuffer += sizeof(ULONG); *(ULONG *)pBuffer = (ULONG)(ULONG_PTR)*phEmf; pBuffer += sizeof(ULONG); - + if (*phEmf) { UINT emfsize = GetEnhMetaFileBits(*phEmf, 0, NULL); - + *(ULONG *)pBuffer = emfsize; pBuffer += sizeof(ULONG); *(ULONG *)pBuffer = emfsize; @@ -1200,7 +1200,7 @@ unsigned char * __RPC_USER HENHMETAFILE_UserUnmarshal(ULONG *pFlags, unsigned ch *phEmf = SetEnhMetaFileBits(size, pBuffer); pBuffer += size; } - else + else *phEmf = NULL; } else diff --git a/reactos/dll/win32/oleaut32/oaidl_p.c b/reactos/dll/win32/oleaut32/oaidl_p.c index c4419d7483d..1ecd01ff1b4 100644 --- a/reactos/dll/win32/oleaut32/oaidl_p.c +++ b/reactos/dll/win32/oleaut32/oaidl_p.c @@ -15,7 +15,7 @@ */ /* Compiler settings for oaidl.idl: Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext - error checks: allocation ref bounds_check enum stub_data + error checks: allocation ref bounds_check enum stub_data */ /*@@MIDL_FILE_HEADING( ) */ @@ -41,8 +41,8 @@ #include "oaidl.h" -#define TYPE_FORMAT_STRING_SIZE 1907 -#define PROC_FORMAT_STRING_SIZE 495 +#define TYPE_FORMAT_STRING_SIZE 1907 +#define PROC_FORMAT_STRING_SIZE 495 typedef struct _MIDL_TYPE_FORMAT_STRING { @@ -80,17 +80,17 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString; static const MIDL_STUB_DESC Object_StubDesc; -HRESULT STDMETHODCALLTYPE IDispatch_GetTypeInfoCount_Proxy( +HRESULT STDMETHODCALLTYPE IDispatch_GetTypeInfoCount_Proxy( IDispatch __RPC_FAR * This, /* [out] */ UINT __RPC_FAR *pctinfo) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -99,37 +99,37 @@ HRESULT STDMETHODCALLTYPE IDispatch_GetTypeInfoCount_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!pctinfo) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); - + *pctinfo = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -153,7 +153,7 @@ void __RPC_STUB IDispatch_GetTypeInfoCount_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; UINT __RPC_FAR *pctinfo; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -163,32 +163,32 @@ NdrStubInitialize( RpcTryFinally { pctinfo = &_M0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IDispatch*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeInfoCount((IDispatch *) ((CStdStubBuffer *)This)->pvServerObject,pctinfo); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = *pctinfo; _StubMsg.Buffer += sizeof(UINT); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IDispatch_GetTypeInfo_Proxy( +HRESULT STDMETHODCALLTYPE IDispatch_GetTypeInfo_Proxy( IDispatch __RPC_FAR * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, @@ -196,11 +196,11 @@ HRESULT STDMETHODCALLTYPE IDispatch_GetTypeInfo_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTInfo) { MIDL_memset( @@ -216,46 +216,46 @@ HRESULT STDMETHODCALLTYPE IDispatch_GetTypeInfo_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 4); - - - + + + if(!ppTInfo) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = iTInfo; _StubMsg.Buffer += sizeof(UINT); - + *( LCID __RPC_FAR * )_StubMsg.Buffer = lcid; _StubMsg.Buffer += sizeof(LCID); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[6] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -281,7 +281,7 @@ void __RPC_STUB IDispatch_GetTypeInfo_Stub( UINT iTInfo; LCID lcid; ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -292,57 +292,57 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[6] ); - + iTInfo = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + lcid = *( LCID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(LCID); - + ppTInfo = &_M1; _M1 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IDispatch*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeInfo( (IDispatch *) ((CStdStubBuffer *)This)->pvServerObject, iTInfo, lcid, ppTInfo); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, &__MIDL_TypeFormatString.Format[6] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IDispatch_GetIDsOfNames_Proxy( +HRESULT STDMETHODCALLTYPE IDispatch_GetIDsOfNames_Proxy( IDispatch __RPC_FAR * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, @@ -352,11 +352,11 @@ HRESULT STDMETHODCALLTYPE IDispatch_GetIDsOfNames_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -365,9 +365,9 @@ HRESULT STDMETHODCALLTYPE IDispatch_GetIDsOfNames_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 5); - - - + + + if(!riid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -382,62 +382,62 @@ HRESULT STDMETHODCALLTYPE IDispatch_GetIDsOfNames_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 0U + 7U + 7U + 7U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + _StubMsg.MaxCount = cNames; - + NdrConformantArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgszNames, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[54] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + _StubMsg.MaxCount = cNames; - + NdrConformantArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgszNames, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[54] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( UINT __RPC_FAR * )_StubMsg.Buffer = cNames; _StubMsg.Buffer += sizeof(UINT); - + *( LCID __RPC_FAR * )_StubMsg.Buffer = lcid; _StubMsg.Buffer += sizeof(LCID); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[16] ); - + NdrConformantArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgDispId, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[88], (unsigned char)0 ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { _StubMsg.MaxCount = cNames; - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[84], @@ -461,7 +461,7 @@ void __RPC_STUB IDispatch_GetIDsOfNames_Stub( DISPID __RPC_FAR *rgDispId; LPOLESTR __RPC_FAR *rgszNames; IID* riid = 0; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -473,27 +473,27 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[16] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + NdrConformantArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgszNames, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[54], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); cNames = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + lcid = *( LCID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(LCID); - + rgDispId = NdrAllocate(&_StubMsg,cNames * 4); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IDispatch*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetIDsOfNames( (IDispatch *) ((CStdStubBuffer *)This)->pvServerObject, @@ -502,49 +502,49 @@ NdrStubInitialize( cNames, lcid, rgDispId); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 7U; _StubMsg.MaxCount = cNames; - + NdrConformantArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgDispId, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[88] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); _StubMsg.MaxCount = cNames; - + NdrConformantArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgDispId, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[88] ); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { _StubMsg.MaxCount = cNames; - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)rgszNames, &__MIDL_TypeFormatString.Format[50] ); - + if ( rgDispId ) _StubMsg.pfnFree( rgDispId ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE IDispatch_RemoteInvoke_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE IDispatch_RemoteInvoke_Proxy( IDispatch __RPC_FAR * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -560,11 +560,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pVarResult) { MIDL_memset( @@ -587,9 +587,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 6); - - - + + + if(!riid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -620,98 +620,98 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U + 11U + 7U + 4U + 11U + 7U + 7U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pDispParams, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1080] ); - + _StubMsg.MaxCount = cVarRef; - + NdrConformantArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgVarRefIdx, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1170] ); - + _StubMsg.MaxCount = cVarRef; - + NdrComplexArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgVarRef, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1184] ); - + NdrProxyGetBuffer(This, &_StubMsg); *( DISPID __RPC_FAR * )_StubMsg.Buffer = dispIdMember; _StubMsg.Buffer += sizeof(DISPID); - + NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + *( LCID __RPC_FAR * )_StubMsg.Buffer = lcid; _StubMsg.Buffer += sizeof(LCID); - + *( DWORD __RPC_FAR * )_StubMsg.Buffer = dwFlags; _StubMsg.Buffer += sizeof(DWORD); - + NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pDispParams, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1080] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( UINT __RPC_FAR * )_StubMsg.Buffer = cVarRef; _StubMsg.Buffer += sizeof(UINT); - + _StubMsg.MaxCount = cVarRef; - + NdrConformantArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgVarRefIdx, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1170] ); - + _StubMsg.MaxCount = cVarRef; - + NdrComplexArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgVarRef, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1184] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[34] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pVarResult, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110], (unsigned char)0 ); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pExcepInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1138], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pArgErr = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + NdrComplexArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgVarRef, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1184], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -728,7 +728,7 @@ NdrStubInitialize( ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[2], ( void __RPC_FAR * )pArgErr); _StubMsg.MaxCount = cVarRef; - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[1180], @@ -761,7 +761,7 @@ void __RPC_STUB IDispatch_RemoteInvoke_Stub( VARIANTARG __RPC_FAR *rgVarRef; UINT __RPC_FAR *rgVarRefIdx; IID* riid = 0; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -777,40 +777,40 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[34] ); - + dispIdMember = *( DISPID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DISPID); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + lcid = *( LCID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(LCID); - + dwFlags = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pDispParams, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1080], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); cVarRef = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + NdrConformantArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgVarRefIdx, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1170], (unsigned char)0 ); - + NdrComplexArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgVarRef, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1184], (unsigned char)0 ); - + pVarResult = &_M6; MIDL_memset( pVarResult, @@ -818,10 +818,10 @@ NdrStubInitialize( sizeof( VARIANT )); pExcepInfo = &_pExcepInfoM; pArgErr = &_M7; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = IDispatch_Invoke_Stub( (IDispatch *) ((CStdStubBuffer *)This)->pvServerObject, dispIdMember, @@ -835,78 +835,78 @@ NdrStubInitialize( cVarRef, rgVarRefIdx, rgVarRef); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 7U + 11U + 7U + 7U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pVarResult, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pExcepInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1138] ); - + _StubMsg.MaxCount = cVarRef; - + NdrComplexArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgVarRef, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1184] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pVarResult, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pExcepInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1138] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( UINT __RPC_FAR * )_StubMsg.Buffer = *pArgErr; _StubMsg.Buffer += sizeof(UINT); - + _StubMsg.MaxCount = cVarRef; - + NdrComplexArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgVarRef, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1184] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pDispParams, &__MIDL_TypeFormatString.Format[98] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pVarResult, &__MIDL_TypeFormatString.Format[1102] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pExcepInfo, &__MIDL_TypeFormatString.Format[1120] ); - + _StubMsg.MaxCount = cVarRef; - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)rgVarRef, &__MIDL_TypeFormatString.Format[1180] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(7) _IDispatchProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(7) _IDispatchProxyVtbl = { { &IID_IDispatch }, { @@ -948,7 +948,7 @@ static const CInterfaceStubVtbl _IDispatchStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -/* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumVARIANT_RemoteNext_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumVARIANT_RemoteNext_Proxy( IEnumVARIANT __RPC_FAR * This, /* [in] */ ULONG celt, /* [length_is][size_is][out] */ VARIANT __RPC_FAR *rgVar, @@ -956,11 +956,11 @@ extern const MIDL_STUB_DESC Object_StubDesc; { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(rgVar) { MIDL_memset( @@ -976,9 +976,9 @@ extern const MIDL_STUB_DESC Object_StubDesc; ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!rgVar) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -989,44 +989,44 @@ extern const MIDL_STUB_DESC Object_StubDesc; } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( ULONG __RPC_FAR * )_StubMsg.Buffer = celt; _StubMsg.Buffer += sizeof(ULONG); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[72] ); - + NdrComplexArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgVar, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1206], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pCeltFetched = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { _StubMsg.MaxCount = celt; _StubMsg.Offset = 0; _StubMsg.ActualCount = _StubMsg.MaxCount; - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[1202], @@ -1053,7 +1053,7 @@ void __RPC_STUB IEnumVARIANT_RemoteNext_Stub( ULONG celt; ULONG __RPC_FAR *pCeltFetched; VARIANT __RPC_FAR *rgVar; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -1065,81 +1065,81 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[72] ); - + celt = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + rgVar = NdrAllocate(&_StubMsg,celt * 16); pCeltFetched = &_M11; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = IEnumVARIANT_Next_Stub( (IEnumVARIANT *) ((CStdStubBuffer *)This)->pvServerObject, celt, rgVar, pCeltFetched); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 12U + 7U + 7U; _StubMsg.MaxCount = celt; _StubMsg.Offset = 0; _StubMsg.ActualCount = pCeltFetched ? *pCeltFetched : 0; - + NdrComplexArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgVar, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1206] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); _StubMsg.MaxCount = celt; _StubMsg.Offset = 0; _StubMsg.ActualCount = pCeltFetched ? *pCeltFetched : 0; - + NdrComplexArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgVar, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1206] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( ULONG __RPC_FAR * )_StubMsg.Buffer = *pCeltFetched; _StubMsg.Buffer += sizeof(ULONG); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { _StubMsg.MaxCount = celt; _StubMsg.Offset = 0; _StubMsg.ActualCount = pCeltFetched ? *pCeltFetched : 0; - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)rgVar, &__MIDL_TypeFormatString.Format[1202] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IEnumVARIANT_Skip_Proxy( +HRESULT STDMETHODCALLTYPE IEnumVARIANT_Skip_Proxy( IEnumVARIANT __RPC_FAR * This, /* [in] */ ULONG celt) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -1148,33 +1148,33 @@ HRESULT STDMETHODCALLTYPE IEnumVARIANT_Skip_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 4); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( ULONG __RPC_FAR * )_StubMsg.Buffer = celt; _StubMsg.Buffer += sizeof(ULONG); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[84] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -1193,7 +1193,7 @@ void __RPC_STUB IEnumVARIANT_Skip_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; ULONG celt; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -1203,41 +1203,41 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[84] ); - + celt = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IEnumVARIANT*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Skip((IEnumVARIANT *) ((CStdStubBuffer *)This)->pvServerObject,celt); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IEnumVARIANT_Reset_Proxy( +HRESULT STDMETHODCALLTYPE IEnumVARIANT_Reset_Proxy( IEnumVARIANT __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -1246,30 +1246,30 @@ HRESULT STDMETHODCALLTYPE IEnumVARIANT_Reset_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 5); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -1287,7 +1287,7 @@ void __RPC_STUB IEnumVARIANT_Reset_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -1295,39 +1295,39 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IEnumVARIANT*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Reset((IEnumVARIANT *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IEnumVARIANT_Clone_Proxy( +HRESULT STDMETHODCALLTYPE IEnumVARIANT_Clone_Proxy( IEnumVARIANT __RPC_FAR * This, /* [out] */ IEnumVARIANT __RPC_FAR *__RPC_FAR *ppEnum) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppEnum) { MIDL_memset( @@ -1343,40 +1343,40 @@ HRESULT STDMETHODCALLTYPE IEnumVARIANT_Clone_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 6); - - - + + + if(!ppEnum) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[90] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppEnum, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1224], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -1400,7 +1400,7 @@ void __RPC_STUB IEnumVARIANT_Clone_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; IEnumVARIANT __RPC_FAR *__RPC_FAR *ppEnum; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -1411,43 +1411,43 @@ NdrStubInitialize( { ppEnum = &_M12; _M12 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IEnumVARIANT*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Clone((IEnumVARIANT *) ((CStdStubBuffer *)This)->pvServerObject,ppEnum); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppEnum, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1224] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppEnum, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1224] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppEnum, &__MIDL_TypeFormatString.Format[1224] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(7) _IEnumVARIANTProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(7) _IEnumVARIANTProxyVtbl = { { &IID_IEnumVARIANT }, { @@ -1489,7 +1489,7 @@ static const CInterfaceStubVtbl _IEnumVARIANTStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeComp_RemoteBind_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeComp_RemoteBind_Proxy( ITypeComp __RPC_FAR * This, /* [in] */ LPOLESTR szName, /* [in] */ ULONG lHashVal, @@ -1503,11 +1503,11 @@ extern const MIDL_STUB_DESC Object_StubDesc; { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTInfo) { MIDL_memset( @@ -1545,9 +1545,9 @@ extern const MIDL_STUB_DESC Object_StubDesc; ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!szName) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -1578,71 +1578,71 @@ extern const MIDL_STUB_DESC Object_StubDesc; } RpcTryFinally { - + _StubMsg.BufferLength = 12U + 10U + 4U; NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)szName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)szName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( ULONG __RPC_FAR * )_StubMsg.Buffer = lHashVal; _StubMsg.Buffer += sizeof(ULONG); - + *( WORD __RPC_FAR * )_StubMsg.Buffer = wFlags; _StubMsg.Buffer += sizeof(WORD); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[96] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6], (unsigned char)0 ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pDescKind, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1250], (unsigned char)0 ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppFuncDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1254], (unsigned char)0 ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppVarDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1464], (unsigned char)0 ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTypeComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1568], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -1699,7 +1699,7 @@ void __RPC_STUB ITypeComp_RemoteBind_Stub( LPVARDESC __RPC_FAR *ppVarDesc; LPOLESTR szName; WORD wFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -1716,19 +1716,19 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[96] ); - + NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&szName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); lHashVal = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + wFlags = *( WORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(WORD); - + ppTInfo = &_M15; _M15 = 0; pDescKind = &_M16; @@ -1743,10 +1743,10 @@ NdrStubInitialize( pDummy, 0, sizeof( CLEANLOCALSTORAGE )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeComp_Bind_Stub( (ITypeComp *) ((CStdStubBuffer *)This)->pvServerObject, szName, @@ -1758,89 +1758,89 @@ NdrStubInitialize( ppVarDesc, ppTypeComp, pDummy); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U + 4U + 15U + 0U + 11U + 7U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppFuncDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1254] ); - + NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppVarDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1464] ); - + NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTypeComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pDescKind, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1250] ); - + NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppFuncDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1254] ); - + NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppVarDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1464] ); - + NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTypeComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1568] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, &__MIDL_TypeFormatString.Format[6] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppFuncDesc, &__MIDL_TypeFormatString.Format[1254] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppVarDesc, &__MIDL_TypeFormatString.Format[1464] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTypeComp, &__MIDL_TypeFormatString.Format[1540] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pDummy, &__MIDL_TypeFormatString.Format[1562] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeComp_RemoteBindType_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeComp_RemoteBindType_Proxy( ITypeComp __RPC_FAR * This, /* [in] */ LPOLESTR szName, /* [in] */ ULONG lHashVal, @@ -1848,11 +1848,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTInfo) { MIDL_memset( @@ -1868,9 +1868,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 4); - - - + + + if(!szName) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -1881,43 +1881,43 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 12U + 10U; NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)szName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)szName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( ULONG __RPC_FAR * )_StubMsg.Buffer = lHashVal; _StubMsg.Buffer += sizeof(ULONG); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[130] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -1943,7 +1943,7 @@ void __RPC_STUB ITypeComp_RemoteBindType_Stub( ULONG lHashVal; ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo; LPOLESTR szName; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -1955,61 +1955,61 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[130] ); - + NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&szName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); lHashVal = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + ppTInfo = &_M23; _M23 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeComp_BindType_Stub( (ITypeComp *) ((CStdStubBuffer *)This)->pvServerObject, szName, lHashVal, ppTInfo); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, &__MIDL_TypeFormatString.Format[6] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(5) _ITypeCompProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(5) _ITypeCompProxyVtbl = { { &IID_ITypeComp }, { @@ -2047,18 +2047,18 @@ static const CInterfaceStubVtbl _ITypeCompStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetTypeAttr_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetTypeAttr_Proxy( ITypeInfo __RPC_FAR * This, /* [out] */ LPTYPEATTR __RPC_FAR *ppTypeAttr, /* [out] */ CLEANLOCALSTORAGE __RPC_FAR *pDummy) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTypeAttr) { *ppTypeAttr = 0; @@ -2078,9 +2078,9 @@ extern const MIDL_STUB_DESC Object_StubDesc; ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!ppTypeAttr) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -2091,36 +2091,36 @@ extern const MIDL_STUB_DESC Object_StubDesc; } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[142] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTypeAttr, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1578], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1644], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -2150,7 +2150,7 @@ void __RPC_STUB ITypeInfo_RemoteGetTypeAttr_Stub( MIDL_STUB_MESSAGE _StubMsg; CLEANLOCALSTORAGE __RPC_FAR *pDummy; LPTYPEATTR __RPC_FAR *ppTypeAttr; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -2167,67 +2167,67 @@ NdrStubInitialize( pDummy, 0, sizeof( CLEANLOCALSTORAGE )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetTypeAttr_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, ppTypeAttr, pDummy); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U + 7U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTypeAttr, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1578] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTypeAttr, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1578] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1644] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTypeAttr, &__MIDL_TypeFormatString.Format[1578] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pDummy, &__MIDL_TypeFormatString.Format[1638] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo_GetTypeComp_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo_GetTypeComp_Proxy( ITypeInfo __RPC_FAR * This, /* [out] */ ITypeComp __RPC_FAR *__RPC_FAR *ppTComp) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTComp) { MIDL_memset( @@ -2243,40 +2243,40 @@ HRESULT STDMETHODCALLTYPE ITypeInfo_GetTypeComp_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 4); - - - + + + if(!ppTComp) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[152] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -2300,7 +2300,7 @@ void __RPC_STUB ITypeInfo_GetTypeComp_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; ITypeComp __RPC_FAR *__RPC_FAR *ppTComp; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -2311,44 +2311,44 @@ NdrStubInitialize( { ppTComp = &_M26; _M26 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeComp((ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject,ppTComp); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTComp, &__MIDL_TypeFormatString.Format[1540] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetFuncDesc_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetFuncDesc_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ LPFUNCDESC __RPC_FAR *ppFuncDesc, @@ -2356,11 +2356,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppFuncDesc) { *ppFuncDesc = 0; @@ -2380,9 +2380,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 5); - - - + + + if(!ppFuncDesc) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -2393,39 +2393,39 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[158] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppFuncDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1254], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1660], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -2456,7 +2456,7 @@ void __RPC_STUB ITypeInfo_RemoteGetFuncDesc_Stub( UINT index; CLEANLOCALSTORAGE __RPC_FAR *pDummy; LPFUNCDESC __RPC_FAR *ppFuncDesc; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -2468,10 +2468,10 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[158] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + ppFuncDesc = &_M27; _M27 = 0; pDummy = &_M28; @@ -2479,58 +2479,58 @@ NdrStubInitialize( pDummy, 0, sizeof( CLEANLOCALSTORAGE )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetFuncDesc_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, index, ppFuncDesc, pDummy); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U + 7U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppFuncDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1254] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppFuncDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1254] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1660] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppFuncDesc, &__MIDL_TypeFormatString.Format[1254] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pDummy, &__MIDL_TypeFormatString.Format[1654] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetVarDesc_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetVarDesc_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ LPVARDESC __RPC_FAR *ppVarDesc, @@ -2538,11 +2538,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppVarDesc) { *ppVarDesc = 0; @@ -2562,9 +2562,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 6); - - - + + + if(!ppVarDesc) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -2575,39 +2575,39 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[170] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppVarDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1464], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1676], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -2638,7 +2638,7 @@ void __RPC_STUB ITypeInfo_RemoteGetVarDesc_Stub( UINT index; CLEANLOCALSTORAGE __RPC_FAR *pDummy; LPVARDESC __RPC_FAR *ppVarDesc; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -2650,10 +2650,10 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[170] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + ppVarDesc = &_M29; _M29 = 0; pDummy = &_M30; @@ -2661,58 +2661,58 @@ NdrStubInitialize( pDummy, 0, sizeof( CLEANLOCALSTORAGE )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetVarDesc_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, index, ppVarDesc, pDummy); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U + 7U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppVarDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1464] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppVarDesc, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1464] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1676] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppVarDesc, &__MIDL_TypeFormatString.Format[1464] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pDummy, &__MIDL_TypeFormatString.Format[1670] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetNames_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetNames_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ MEMBERID memid, /* [length_is][size_is][out] */ BSTR __RPC_FAR *rgBstrNames, @@ -2721,11 +2721,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(rgBstrNames) { MIDL_memset( @@ -2741,9 +2741,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 7); - - - + + + if(!rgBstrNames) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -2754,47 +2754,47 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( MEMBERID __RPC_FAR * )_StubMsg.Buffer = memid; _StubMsg.Buffer += sizeof(MEMBERID); - + *( UINT __RPC_FAR * )_StubMsg.Buffer = cMaxNames; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[182] ); - + NdrComplexArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgBstrNames, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1690], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pcNames = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { _StubMsg.MaxCount = cMaxNames; _StubMsg.Offset = 0; _StubMsg.ActualCount = _StubMsg.MaxCount; - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[1686], @@ -2822,7 +2822,7 @@ void __RPC_STUB ITypeInfo_RemoteGetNames_Stub( MEMBERID memid; UINT __RPC_FAR *pcNames; BSTR __RPC_FAR *rgBstrNames; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -2834,86 +2834,86 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[182] ); - + memid = *( MEMBERID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(MEMBERID); - + cMaxNames = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + rgBstrNames = NdrAllocate(&_StubMsg,cMaxNames * 4); pcNames = &_M34; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetNames_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, memid, rgBstrNames, cMaxNames, pcNames); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 12U + 7U + 7U; _StubMsg.MaxCount = cMaxNames; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcNames ? *pcNames : 0; - + NdrComplexArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgBstrNames, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1690] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); _StubMsg.MaxCount = cMaxNames; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcNames ? *pcNames : 0; - + NdrComplexArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgBstrNames, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1690] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( UINT __RPC_FAR * )_StubMsg.Buffer = *pcNames; _StubMsg.Buffer += sizeof(UINT); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { _StubMsg.MaxCount = cMaxNames; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcNames ? *pcNames : 0; - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)rgBstrNames, &__MIDL_TypeFormatString.Format[1686] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo_GetRefTypeOfImplType_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo_GetRefTypeOfImplType_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ HREFTYPE __RPC_FAR *pRefType) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -2922,40 +2922,40 @@ HRESULT STDMETHODCALLTYPE ITypeInfo_GetRefTypeOfImplType_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 8); - - - + + + if(!pRefType) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[196] ); - + *pRefType = *( HREFTYPE __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HREFTYPE); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -2980,7 +2980,7 @@ void __RPC_STUB ITypeInfo_GetRefTypeOfImplType_Stub( MIDL_STUB_MESSAGE _StubMsg; UINT index; HREFTYPE __RPC_FAR *pRefType; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -2991,51 +2991,51 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[196] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + pRefType = &_M35; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetRefTypeOfImplType( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, index, pRefType); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HREFTYPE __RPC_FAR * )_StubMsg.Buffer = *pRefType; _StubMsg.Buffer += sizeof(HREFTYPE); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo_GetImplTypeFlags_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo_GetImplTypeFlags_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ INT __RPC_FAR *pImplTypeFlags) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -3044,40 +3044,40 @@ HRESULT STDMETHODCALLTYPE ITypeInfo_GetImplTypeFlags_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 9); - - - + + + if(!pImplTypeFlags) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[196] ); - + *pImplTypeFlags = *( INT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(INT); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -3102,7 +3102,7 @@ void __RPC_STUB ITypeInfo_GetImplTypeFlags_Stub( MIDL_STUB_MESSAGE _StubMsg; UINT index; INT __RPC_FAR *pImplTypeFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -3113,49 +3113,49 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[196] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + pImplTypeFlags = &_M36; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetImplTypeFlags( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, index, pImplTypeFlags); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( INT __RPC_FAR * )_StubMsg.Buffer = *pImplTypeFlags; _StubMsg.Buffer += sizeof(INT); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalGetIDsOfNames_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalGetIDsOfNames_Proxy( ITypeInfo __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -3164,30 +3164,30 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 10); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -3205,7 +3205,7 @@ void __RPC_STUB ITypeInfo_LocalGetIDsOfNames_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -3213,40 +3213,40 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetIDsOfNames_Stub((ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalInvoke_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalInvoke_Proxy( ITypeInfo __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -3255,30 +3255,30 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 11); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -3296,7 +3296,7 @@ void __RPC_STUB ITypeInfo_LocalInvoke_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -3304,31 +3304,31 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_Invoke_Stub((ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetDocumentation_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetDocumentation_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ MEMBERID memid, /* [in] */ DWORD refPtrFlags, @@ -3339,11 +3339,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrName) { MIDL_memset( @@ -3373,9 +3373,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 12); - - - + + + if(!pBstrName) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -3394,51 +3394,51 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( MEMBERID __RPC_FAR * )_StubMsg.Buffer = memid; _StubMsg.Buffer += sizeof(MEMBERID); - + *( DWORD __RPC_FAR * )_StubMsg.Buffer = refPtrFlags; _StubMsg.Buffer += sizeof(DWORD); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[204] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrDocString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pdwHelpContext = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -3482,7 +3482,7 @@ void __RPC_STUB ITypeInfo_RemoteGetDocumentation_Stub( BSTR __RPC_FAR *pBstrName; DWORD __RPC_FAR *pdwHelpContext; DWORD refPtrFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -3496,13 +3496,13 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[204] ); - + memid = *( MEMBERID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(MEMBERID); - + refPtrFlags = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + pBstrName = &_M37; MIDL_memset( pBstrName, @@ -3519,10 +3519,10 @@ NdrStubInitialize( pBstrHelpFile, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetDocumentation_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, memid, @@ -3531,69 +3531,69 @@ NdrStubInitialize( pBstrDocString, pdwHelpContext, pBstrHelpFile); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 15U + 11U + 11U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrDocString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrDocString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( DWORD __RPC_FAR * )_StubMsg.Buffer = *pdwHelpContext; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrName, &__MIDL_TypeFormatString.Format[1708] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrDocString, &__MIDL_TypeFormatString.Format[1708] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetDllEntry_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetDllEntry_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ MEMBERID memid, /* [in] */ INVOKEKIND invKind, @@ -3604,11 +3604,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrDllName) { MIDL_memset( @@ -3631,9 +3631,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 13); - - - + + + if(!pBstrDllName) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -3648,50 +3648,50 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( MEMBERID __RPC_FAR * )_StubMsg.Buffer = memid; _StubMsg.Buffer += sizeof(MEMBERID); - + NdrSimpleTypeMarshall( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( unsigned char __RPC_FAR * )&invKind, 14); *( DWORD __RPC_FAR * )_StubMsg.Buffer = refPtrFlags; _StubMsg.Buffer += sizeof(DWORD); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[226] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrDllName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 1) & ~ 0x1); *pwOrdinal = *( WORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(WORD); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -3730,7 +3730,7 @@ void __RPC_STUB ITypeInfo_RemoteGetDllEntry_Stub( BSTR __RPC_FAR *pBstrName; WORD __RPC_FAR *pwOrdinal; DWORD refPtrFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -3743,17 +3743,17 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[226] ); - + memid = *( MEMBERID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(MEMBERID); - + NdrSimpleTypeUnmarshall( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( unsigned char __RPC_FAR * )&invKind, 14); refPtrFlags = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + pBstrDllName = &_M41; MIDL_memset( pBstrDllName, @@ -3765,10 +3765,10 @@ NdrStubInitialize( 0, sizeof( BSTR )); pwOrdinal = &_M43; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetDllEntry_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, memid, @@ -3777,68 +3777,68 @@ NdrStubInitialize( pBstrDllName, pBstrName, pwOrdinal); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 15U + 5U + 10U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrDllName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrDllName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 1) & ~ 0x1); *( WORD __RPC_FAR * )_StubMsg.Buffer = *pwOrdinal; _StubMsg.Buffer += sizeof(WORD); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrDllName, &__MIDL_TypeFormatString.Format[1708] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrName, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo_GetRefTypeInfo_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo_GetRefTypeInfo_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ HREFTYPE hRefType, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTInfo) { MIDL_memset( @@ -3854,43 +3854,43 @@ HRESULT STDMETHODCALLTYPE ITypeInfo_GetRefTypeInfo_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 14); - - - + + + if(!ppTInfo) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( HREFTYPE __RPC_FAR * )_StubMsg.Buffer = hRefType; _StubMsg.Buffer += sizeof(HREFTYPE); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[246] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -3915,7 +3915,7 @@ void __RPC_STUB ITypeInfo_GetRefTypeInfo_Stub( MIDL_STUB_MESSAGE _StubMsg; HREFTYPE hRefType; ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -3926,62 +3926,62 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[246] ); - + hRefType = *( HREFTYPE __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HREFTYPE); - + ppTInfo = &_M44; _M44 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetRefTypeInfo( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, hRefType, ppTInfo); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, &__MIDL_TypeFormatString.Format[6] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalAddressOfMember_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalAddressOfMember_Proxy( ITypeInfo __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -3990,30 +3990,30 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 15); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -4031,7 +4031,7 @@ void __RPC_STUB ITypeInfo_LocalAddressOfMember_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4039,42 +4039,42 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_AddressOfMember_Stub((ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteCreateInstance_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteCreateInstance_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ REFIID riid, /* [iid_is][out] */ IUnknown __RPC_FAR *__RPC_FAR *ppvObj) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppvObj) { MIDL_memset( @@ -4090,9 +4090,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 16); - - - + + + if(!riid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -4103,44 +4103,44 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[254] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppvObj, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1716], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[1716], @@ -4162,7 +4162,7 @@ void __RPC_STUB ITypeInfo_RemoteCreateInstance_Stub( MIDL_STUB_MESSAGE _StubMsg; IUnknown __RPC_FAR *__RPC_FAR *ppvObj; IID* riid = 0; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4173,74 +4173,74 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[254] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + ppvObj = (void *)&_M45; _M45 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_CreateInstance_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, riid, ppvObj); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppvObj, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1716] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppvObj, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1716] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppvObj, &__MIDL_TypeFormatString.Format[1716] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo_GetMops_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo_GetMops_Proxy( ITypeInfo __RPC_FAR * This, /* [in] */ MEMBERID memid, /* [out] */ BSTR __RPC_FAR *pBstrMops) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrMops) { MIDL_memset( @@ -4256,43 +4256,43 @@ HRESULT STDMETHODCALLTYPE ITypeInfo_GetMops_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 17); - - - + + + if(!pBstrMops) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( MEMBERID __RPC_FAR * )_StubMsg.Buffer = memid; _StubMsg.Buffer += sizeof(MEMBERID); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[264] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrMops, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -4317,7 +4317,7 @@ void __RPC_STUB ITypeInfo_GetMops_Stub( MIDL_STUB_MESSAGE _StubMsg; MEMBERID memid; BSTR __RPC_FAR *pBstrMops; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4328,67 +4328,67 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[264] ); - + memid = *( MEMBERID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(MEMBERID); - + pBstrMops = &_M46; MIDL_memset( pBstrMops, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetMops( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, memid, pBstrMops); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrMops, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrMops, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrMops, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetContainingTypeLib_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_RemoteGetContainingTypeLib_Proxy( ITypeInfo __RPC_FAR * This, /* [out] */ ITypeLib __RPC_FAR *__RPC_FAR *ppTLib, /* [out] */ UINT __RPC_FAR *pIndex) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTLib) { MIDL_memset( @@ -4404,9 +4404,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 18); - - - + + + if(!ppTLib) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -4417,34 +4417,34 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[272] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTLib, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1726], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pIndex = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -4474,7 +4474,7 @@ void __RPC_STUB ITypeInfo_RemoteGetContainingTypeLib_Stub( MIDL_STUB_MESSAGE _StubMsg; UINT __RPC_FAR *pIndex; ITypeLib __RPC_FAR *__RPC_FAR *ppTLib; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4487,61 +4487,61 @@ NdrStubInitialize( ppTLib = &_M47; _M47 = 0; pIndex = &_M48; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_GetContainingTypeLib_Stub( (ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject, ppTLib, pIndex); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTLib, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1726] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTLib, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1726] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( UINT __RPC_FAR * )_StubMsg.Buffer = *pIndex; _StubMsg.Buffer += sizeof(UINT); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTLib, &__MIDL_TypeFormatString.Format[1726] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalReleaseTypeAttr_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalReleaseTypeAttr_Proxy( ITypeInfo __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -4550,30 +4550,30 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 19); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -4591,7 +4591,7 @@ void __RPC_STUB ITypeInfo_LocalReleaseTypeAttr_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4599,40 +4599,40 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_ReleaseTypeAttr_Stub((ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalReleaseFuncDesc_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalReleaseFuncDesc_Proxy( ITypeInfo __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -4641,30 +4641,30 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 20); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -4682,7 +4682,7 @@ void __RPC_STUB ITypeInfo_LocalReleaseFuncDesc_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4690,40 +4690,40 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_ReleaseFuncDesc_Stub((ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalReleaseVarDesc_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo_LocalReleaseVarDesc_Proxy( ITypeInfo __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -4732,30 +4732,30 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 21); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -4773,7 +4773,7 @@ void __RPC_STUB ITypeInfo_LocalReleaseVarDesc_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4781,30 +4781,30 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo_ReleaseVarDesc_Stub((ITypeInfo *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(22) _ITypeInfoProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(22) _ITypeInfoProxyVtbl = { { &IID_ITypeInfo }, { @@ -4876,17 +4876,17 @@ static const CInterfaceStubVtbl _ITypeInfoStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetTypeKind_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetTypeKind_Proxy( ITypeInfo2 __RPC_FAR * This, /* [out] */ TYPEKIND __RPC_FAR *pTypeKind) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -4895,39 +4895,39 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetTypeKind_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 22); - - - + + + if(!pTypeKind) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[282] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pTypeKind, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1250], (unsigned char)0 ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -4951,7 +4951,7 @@ void __RPC_STUB ITypeInfo2_GetTypeKind_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; TYPEKIND __RPC_FAR *pTypeKind; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -4961,43 +4961,43 @@ NdrStubInitialize( RpcTryFinally { pTypeKind = &_M49; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeKind((ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject,pTypeKind); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pTypeKind, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1250] ); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetTypeFlags_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetTypeFlags_Proxy( ITypeInfo2 __RPC_FAR * This, /* [out] */ ULONG __RPC_FAR *pTypeFlags) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -5006,37 +5006,37 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetTypeFlags_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 23); - - - + + + if(!pTypeFlags) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); - + *pTypeFlags = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -5060,7 +5060,7 @@ void __RPC_STUB ITypeInfo2_GetTypeFlags_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; ULONG __RPC_FAR *pTypeFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -5070,32 +5070,32 @@ NdrStubInitialize( RpcTryFinally { pTypeFlags = &_M50; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeFlags((ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject,pTypeFlags); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( ULONG __RPC_FAR * )_StubMsg.Buffer = *pTypeFlags; _StubMsg.Buffer += sizeof(ULONG); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncIndexOfMemId_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncIndexOfMemId_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ MEMBERID memid, /* [in] */ INVOKEKIND invKind, @@ -5103,11 +5103,11 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncIndexOfMemId_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -5116,44 +5116,44 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncIndexOfMemId_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 24); - - - + + + if(!pFuncIndex) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( MEMBERID __RPC_FAR * )_StubMsg.Buffer = memid; _StubMsg.Buffer += sizeof(MEMBERID); - + NdrSimpleTypeMarshall( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( unsigned char __RPC_FAR * )&invKind, 14); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[288] ); - + *pFuncIndex = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -5179,7 +5179,7 @@ void __RPC_STUB ITypeInfo2_GetFuncIndexOfMemId_Stub( INVOKEKIND invKind; MEMBERID memid; UINT __RPC_FAR *pFuncIndex; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -5190,56 +5190,56 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[288] ); - + memid = *( MEMBERID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(MEMBERID); - + NdrSimpleTypeUnmarshall( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( unsigned char __RPC_FAR * )&invKind, 14); pFuncIndex = &_M51; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFuncIndexOfMemId( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, memid, invKind, pFuncIndex); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = *pFuncIndex; _StubMsg.Buffer += sizeof(UINT); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarIndexOfMemId_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarIndexOfMemId_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ MEMBERID memid, /* [out] */ UINT __RPC_FAR *pVarIndex) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -5248,40 +5248,40 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarIndexOfMemId_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 25); - - - + + + if(!pVarIndex) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( MEMBERID __RPC_FAR * )_StubMsg.Buffer = memid; _StubMsg.Buffer += sizeof(MEMBERID); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[196] ); - + *pVarIndex = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -5306,7 +5306,7 @@ void __RPC_STUB ITypeInfo2_GetVarIndexOfMemId_Stub( MIDL_STUB_MESSAGE _StubMsg; MEMBERID memid; UINT __RPC_FAR *pVarIndex; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -5317,51 +5317,51 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[196] ); - + memid = *( MEMBERID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(MEMBERID); - + pVarIndex = &_M52; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetVarIndexOfMemId( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, memid, pVarIndex); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = *pVarIndex; _StubMsg.Buffer += sizeof(UINT); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ REFGUID guid, /* [out] */ VARIANT __RPC_FAR *pVarVal) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pVarVal) { MIDL_memset( @@ -5377,9 +5377,9 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 26); - - - + + + if(!guid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -5390,39 +5390,39 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetCustData_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[298] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -5447,7 +5447,7 @@ void __RPC_STUB ITypeInfo2_GetCustData_Stub( MIDL_STUB_MESSAGE _StubMsg; REFGUID guid = 0; VARIANT __RPC_FAR *pVarVal; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -5458,58 +5458,58 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[298] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + pVarVal = &_M53; MIDL_memset( pVarVal, 0, sizeof( VARIANT )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, guid, pVarVal); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, &__MIDL_TypeFormatString.Format[1102] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT index, /* [in] */ REFGUID guid, @@ -5517,11 +5517,11 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncCustData_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pVarVal) { MIDL_memset( @@ -5537,9 +5537,9 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 27); - - - + + + if(!guid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -5550,42 +5550,42 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetFuncCustData_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[308] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -5611,7 +5611,7 @@ void __RPC_STUB ITypeInfo2_GetFuncCustData_Stub( REFGUID guid = 0; UINT index; VARIANT __RPC_FAR *pVarVal; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -5622,62 +5622,62 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[308] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + pVarVal = &_M54; MIDL_memset( pVarVal, 0, sizeof( VARIANT )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetFuncCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, index, guid, pVarVal); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, &__MIDL_TypeFormatString.Format[1102] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetParamCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetParamCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT indexFunc, /* [in] */ UINT indexParam, @@ -5686,11 +5686,11 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetParamCustData_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pVarVal) { MIDL_memset( @@ -5706,9 +5706,9 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetParamCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 28); - - - + + + if(!guid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -5719,45 +5719,45 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetParamCustData_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U + 0U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = indexFunc; _StubMsg.Buffer += sizeof(UINT); - + *( UINT __RPC_FAR * )_StubMsg.Buffer = indexParam; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[320] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -5784,7 +5784,7 @@ void __RPC_STUB ITypeInfo2_GetParamCustData_Stub( UINT indexFunc; UINT indexParam; VARIANT __RPC_FAR *pVarVal; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -5795,24 +5795,24 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[320] ); - + indexFunc = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + indexParam = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + pVarVal = &_M55; MIDL_memset( pVarVal, 0, sizeof( VARIANT )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetParamCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, @@ -5820,41 +5820,41 @@ NdrStubInitialize( indexParam, guid, pVarVal); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, &__MIDL_TypeFormatString.Format[1102] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT index, /* [in] */ REFGUID guid, @@ -5862,11 +5862,11 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarCustData_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pVarVal) { MIDL_memset( @@ -5882,9 +5882,9 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 29); - - - + + + if(!guid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -5895,42 +5895,42 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetVarCustData_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[308] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -5956,7 +5956,7 @@ void __RPC_STUB ITypeInfo2_GetVarCustData_Stub( REFGUID guid = 0; UINT index; VARIANT __RPC_FAR *pVarVal; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -5967,62 +5967,62 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[308] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + pVarVal = &_M56; MIDL_memset( pVarVal, 0, sizeof( VARIANT )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetVarCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, index, guid, pVarVal); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, &__MIDL_TypeFormatString.Format[1102] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetImplTypeCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetImplTypeCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT index, /* [in] */ REFGUID guid, @@ -6030,11 +6030,11 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetImplTypeCustData_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pVarVal) { MIDL_memset( @@ -6050,9 +6050,9 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetImplTypeCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 30); - - - + + + if(!guid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -6063,42 +6063,42 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetImplTypeCustData_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[308] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -6124,7 +6124,7 @@ void __RPC_STUB ITypeInfo2_GetImplTypeCustData_Stub( REFGUID guid = 0; UINT index; VARIANT __RPC_FAR *pVarVal; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -6135,62 +6135,62 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[308] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + pVarVal = &_M57; MIDL_memset( pVarVal, 0, sizeof( VARIANT )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetImplTypeCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, index, guid, pVarVal); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, &__MIDL_TypeFormatString.Format[1102] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo2_RemoteGetDocumentation2_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeInfo2_RemoteGetDocumentation2_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ MEMBERID memid, /* [in] */ LCID lcid, @@ -6201,11 +6201,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pbstrHelpString) { MIDL_memset( @@ -6228,9 +6228,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 31); - - - + + + if(!pbstrHelpString) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -6245,49 +6245,49 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( MEMBERID __RPC_FAR * )_StubMsg.Buffer = memid; _StubMsg.Buffer += sizeof(MEMBERID); - + *( LCID __RPC_FAR * )_StubMsg.Buffer = lcid; _StubMsg.Buffer += sizeof(LCID); - + *( DWORD __RPC_FAR * )_StubMsg.Buffer = refPtrFlags; _StubMsg.Buffer += sizeof(DWORD); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[334] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pbstrHelpString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pdwHelpStringContext = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pbstrHelpStringDll, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -6326,7 +6326,7 @@ void __RPC_STUB ITypeInfo2_RemoteGetDocumentation2_Stub( BSTR __RPC_FAR *pbstrHelpStringDll; DWORD __RPC_FAR *pdwHelpStringContext; DWORD refPtrFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -6339,16 +6339,16 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[334] ); - + memid = *( MEMBERID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(MEMBERID); - + lcid = *( LCID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(LCID); - + refPtrFlags = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + pbstrHelpString = &_M58; MIDL_memset( pbstrHelpString, @@ -6360,10 +6360,10 @@ NdrStubInitialize( pbstrHelpStringDll, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeInfo2_GetDocumentation2_Stub( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, memid, @@ -6372,67 +6372,67 @@ NdrStubInitialize( pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U + 11U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpStringDll, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pbstrHelpString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( DWORD __RPC_FAR * )_StubMsg.Buffer = *pdwHelpStringContext; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pbstrHelpStringDll, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpString, &__MIDL_TypeFormatString.Format[1708] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpStringDll, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [out] */ CUSTDATA __RPC_FAR *pCustData) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pCustData) { MIDL_memset( @@ -6448,40 +6448,40 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 32); - - - + + + if(!pCustData) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[354] ); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -6505,7 +6505,7 @@ void __RPC_STUB ITypeInfo2_GetAllCustData_Stub( MIDL_STUB_MESSAGE _StubMsg; CUSTDATA _pCustDataM; CUSTDATA __RPC_FAR *pCustData; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -6516,55 +6516,55 @@ NdrStubInitialize( { pCustData = &_pCustDataM; pCustData -> prgCustData = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetAllCustData((ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject,pCustData); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 11U; NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pCustData, &__MIDL_TypeFormatString.Format[1748] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllFuncCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllFuncCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ CUSTDATA __RPC_FAR *pCustData) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pCustData) { MIDL_memset( @@ -6580,43 +6580,43 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllFuncCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 33); - - - + + + if(!pCustData) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[360] ); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -6641,7 +6641,7 @@ void __RPC_STUB ITypeInfo2_GetAllFuncCustData_Stub( CUSTDATA _pCustDataM; UINT index; CUSTDATA __RPC_FAR *pCustData; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -6652,53 +6652,53 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[360] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + pCustData = &_pCustDataM; pCustData -> prgCustData = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetAllFuncCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, index, pCustData); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 11U; NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pCustData, &__MIDL_TypeFormatString.Format[1748] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllParamCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllParamCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT indexFunc, /* [in] */ UINT indexParam, @@ -6706,11 +6706,11 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllParamCustData_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pCustData) { MIDL_memset( @@ -6726,46 +6726,46 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllParamCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 34); - - - + + + if(!pCustData) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = indexFunc; _StubMsg.Buffer += sizeof(UINT); - + *( UINT __RPC_FAR * )_StubMsg.Buffer = indexParam; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[368] ); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -6791,7 +6791,7 @@ void __RPC_STUB ITypeInfo2_GetAllParamCustData_Stub( UINT indexFunc; UINT indexParam; CUSTDATA __RPC_FAR *pCustData; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -6802,68 +6802,68 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[368] ); - + indexFunc = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + indexParam = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + pCustData = &_pCustDataM; pCustData -> prgCustData = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetAllParamCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, indexFunc, indexParam, pCustData); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 11U; NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pCustData, &__MIDL_TypeFormatString.Format[1748] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllVarCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllVarCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ CUSTDATA __RPC_FAR *pCustData) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pCustData) { MIDL_memset( @@ -6879,43 +6879,43 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllVarCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 35); - - - + + + if(!pCustData) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[360] ); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -6940,7 +6940,7 @@ void __RPC_STUB ITypeInfo2_GetAllVarCustData_Stub( CUSTDATA _pCustDataM; UINT index; CUSTDATA __RPC_FAR *pCustData; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -6951,64 +6951,64 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[360] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + pCustData = &_pCustDataM; pCustData -> prgCustData = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetAllVarCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, index, pCustData); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 11U; NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pCustData, &__MIDL_TypeFormatString.Format[1748] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllImplTypeCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllImplTypeCustData_Proxy( ITypeInfo2 __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ CUSTDATA __RPC_FAR *pCustData) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pCustData) { MIDL_memset( @@ -7024,43 +7024,43 @@ HRESULT STDMETHODCALLTYPE ITypeInfo2_GetAllImplTypeCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 36); - - - + + + if(!pCustData) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[360] ); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -7085,7 +7085,7 @@ void __RPC_STUB ITypeInfo2_GetAllImplTypeCustData_Stub( CUSTDATA _pCustDataM; UINT index; CUSTDATA __RPC_FAR *pCustData; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -7096,52 +7096,52 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[360] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + pCustData = &_pCustDataM; pCustData -> prgCustData = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeInfo2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetAllImplTypeCustData( (ITypeInfo2 *) ((CStdStubBuffer *)This)->pvServerObject, index, pCustData); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 11U; NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pCustData, &__MIDL_TypeFormatString.Format[1748] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(37) _ITypeInfo2ProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(37) _ITypeInfo2ProxyVtbl = { { &IID_ITypeInfo2 }, { @@ -7243,17 +7243,17 @@ static const CInterfaceStubVtbl _ITypeInfo2StubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteGetTypeInfoCount_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteGetTypeInfoCount_Proxy( ITypeLib __RPC_FAR * This, /* [out] */ UINT __RPC_FAR *pcTInfo) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -7262,37 +7262,37 @@ extern const MIDL_STUB_DESC Object_StubDesc; ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!pcTInfo) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); - + *pcTInfo = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -7316,7 +7316,7 @@ void __RPC_STUB ITypeLib_RemoteGetTypeInfoCount_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; UINT __RPC_FAR *pcTInfo; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -7326,45 +7326,45 @@ NdrStubInitialize( RpcTryFinally { pcTInfo = &_M61; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib_GetTypeInfoCount_Stub((ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject,pcTInfo); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = *pcTInfo; _StubMsg.Buffer += sizeof(UINT); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfo_Proxy( +HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfo_Proxy( ITypeLib __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTInfo) { MIDL_memset( @@ -7380,43 +7380,43 @@ HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfo_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 4); - - - + + + if(!ppTInfo) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[246] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -7441,7 +7441,7 @@ void __RPC_STUB ITypeLib_GetTypeInfo_Stub( MIDL_STUB_MESSAGE _StubMsg; UINT index; ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -7452,64 +7452,64 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[246] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + ppTInfo = &_M62; _M62 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeLib*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeInfo( (ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject, index, ppTInfo); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, &__MIDL_TypeFormatString.Format[6] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoType_Proxy( +HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoType_Proxy( ITypeLib __RPC_FAR * This, /* [in] */ UINT index, /* [out] */ TYPEKIND __RPC_FAR *pTKind) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -7518,42 +7518,42 @@ HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoType_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 5); - - - + + + if(!pTKind) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( UINT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(UINT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[378] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pTKind, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1250], (unsigned char)0 ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -7578,7 +7578,7 @@ void __RPC_STUB ITypeLib_GetTypeInfoType_Stub( MIDL_STUB_MESSAGE _StubMsg; UINT index; TYPEKIND __RPC_FAR *pTKind; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -7589,52 +7589,52 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[378] ); - + index = *( UINT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(UINT); - + pTKind = &_M63; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeLib*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeInfoType( (ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject, index, pTKind); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pTKind, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1250] ); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoOfGuid_Proxy( +HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoOfGuid_Proxy( ITypeLib __RPC_FAR * This, /* [in] */ REFGUID guid, /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTinfo) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTinfo) { MIDL_memset( @@ -7650,9 +7650,9 @@ HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoOfGuid_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 6); - - - + + + if(!guid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -7663,39 +7663,39 @@ HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoOfGuid_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[386] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTinfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -7720,7 +7720,7 @@ void __RPC_STUB ITypeLib_GetTypeInfoOfGuid_Stub( MIDL_STUB_MESSAGE _StubMsg; REFGUID guid = 0; ITypeInfo __RPC_FAR *__RPC_FAR *ppTinfo; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -7731,66 +7731,66 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[386] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + ppTinfo = &_M64; _M64 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeLib*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeInfoOfGuid( (ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject, guid, ppTinfo); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTinfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTinfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[6] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTinfo, &__MIDL_TypeFormatString.Format[6] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteGetLibAttr_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteGetLibAttr_Proxy( ITypeLib __RPC_FAR * This, /* [out] */ LPTLIBATTR __RPC_FAR *ppTLibAttr, /* [out] */ CLEANLOCALSTORAGE __RPC_FAR *pDummy) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTLibAttr) { *ppTLibAttr = 0; @@ -7810,9 +7810,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 7); - - - + + + if(!ppTLibAttr) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -7823,36 +7823,36 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[396] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTLibAttr, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1804], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1838], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -7882,7 +7882,7 @@ void __RPC_STUB ITypeLib_RemoteGetLibAttr_Stub( MIDL_STUB_MESSAGE _StubMsg; CLEANLOCALSTORAGE __RPC_FAR *pDummy; LPTLIBATTR __RPC_FAR *ppTLibAttr; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -7899,67 +7899,67 @@ NdrStubInitialize( pDummy, 0, sizeof( CLEANLOCALSTORAGE )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib_GetLibAttr_Stub( (ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject, ppTLibAttr, pDummy); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U + 7U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTLibAttr, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1804] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTLibAttr, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1804] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pDummy, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1838] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTLibAttr, &__MIDL_TypeFormatString.Format[1804] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pDummy, &__MIDL_TypeFormatString.Format[1832] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeComp_Proxy( +HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeComp_Proxy( ITypeLib __RPC_FAR * This, /* [out] */ ITypeComp __RPC_FAR *__RPC_FAR *ppTComp) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTComp) { MIDL_memset( @@ -7975,40 +7975,40 @@ HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeComp_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 8); - - - + + + if(!ppTComp) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[152] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -8032,7 +8032,7 @@ void __RPC_STUB ITypeLib_GetTypeComp_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; ITypeComp __RPC_FAR *__RPC_FAR *ppTComp; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -8043,44 +8043,44 @@ NdrStubInitialize( { ppTComp = &_M67; _M67 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeLib*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetTypeComp((ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject,ppTComp); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTComp, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1540] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTComp, &__MIDL_TypeFormatString.Format[1540] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteGetDocumentation_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteGetDocumentation_Proxy( ITypeLib __RPC_FAR * This, /* [in] */ INT index, /* [in] */ DWORD refPtrFlags, @@ -8091,11 +8091,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrName) { MIDL_memset( @@ -8125,9 +8125,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 9); - - - + + + if(!pBstrName) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -8146,51 +8146,51 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( INT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(INT); - + *( DWORD __RPC_FAR * )_StubMsg.Buffer = refPtrFlags; _StubMsg.Buffer += sizeof(DWORD); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[204] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrDocString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pdwHelpContext = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -8234,7 +8234,7 @@ void __RPC_STUB ITypeLib_RemoteGetDocumentation_Stub( BSTR __RPC_FAR *pBstrName; DWORD __RPC_FAR *pdwHelpContext; DWORD refPtrFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -8248,13 +8248,13 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[204] ); - + index = *( INT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(INT); - + refPtrFlags = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + pBstrName = &_M68; MIDL_memset( pBstrName, @@ -8271,10 +8271,10 @@ NdrStubInitialize( pBstrHelpFile, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib_GetDocumentation_Stub( (ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject, index, @@ -8283,69 +8283,69 @@ NdrStubInitialize( pBstrDocString, pdwHelpContext, pBstrHelpFile); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 15U + 11U + 11U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrDocString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrDocString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( DWORD __RPC_FAR * )_StubMsg.Buffer = *pdwHelpContext; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrName, &__MIDL_TypeFormatString.Format[1708] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrDocString, &__MIDL_TypeFormatString.Format[1708] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteIsName_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteIsName_Proxy( ITypeLib __RPC_FAR * This, /* [in] */ LPOLESTR szNameBuf, /* [in] */ ULONG lHashVal, @@ -8354,11 +8354,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrLibName) { MIDL_memset( @@ -8374,9 +8374,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 10); - - - + + + if(!szNameBuf) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -8391,46 +8391,46 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 12U + 10U; NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)szNameBuf, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)szNameBuf, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( ULONG __RPC_FAR * )_StubMsg.Buffer = lHashVal; _StubMsg.Buffer += sizeof(ULONG); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[406] ); - + *pfName = *( BOOL __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(BOOL); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrLibName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -8462,7 +8462,7 @@ void __RPC_STUB ITypeLib_RemoteIsName_Stub( BSTR __RPC_FAR *pBstrLibName; BOOL __RPC_FAR *pfName; LPOLESTR szNameBuf; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -8475,70 +8475,70 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[406] ); - + NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&szNameBuf, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); lHashVal = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + pfName = &_M74; pBstrLibName = &_M75; MIDL_memset( pBstrLibName, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib_IsName_Stub( (ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject, szNameBuf, lHashVal, pfName, pBstrLibName); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrLibName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( BOOL __RPC_FAR * )_StubMsg.Buffer = *pfName; _StubMsg.Buffer += sizeof(BOOL); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrLibName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrLibName, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteFindName_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_RemoteFindName_Proxy( ITypeLib __RPC_FAR * This, /* [in] */ LPOLESTR szNameBuf, /* [in] */ ULONG lHashVal, @@ -8549,11 +8549,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppTInfo) { MIDL_memset( @@ -8576,9 +8576,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 11); - - - + + + if(!szNameBuf) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -8601,66 +8601,66 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 12U + 10U + 4U; NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)szNameBuf, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)szNameBuf, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( ULONG __RPC_FAR * )_StubMsg.Buffer = lHashVal; _StubMsg.Buffer += sizeof(ULONG); - + *( USHORT __RPC_FAR * )_StubMsg.Buffer = *pcFound; _StubMsg.Buffer += sizeof(USHORT); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[422] ); - + NdrComplexArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1852], (unsigned char)0 ); - + NdrConformantVaryingArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rgMemId, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1874], (unsigned char)0 ); - + *pcFound = *( USHORT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(USHORT); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrLibName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = _StubMsg.MaxCount; - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[1848], @@ -8668,7 +8668,7 @@ NdrStubInitialize( _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = _StubMsg.MaxCount; - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[1870], @@ -8702,7 +8702,7 @@ void __RPC_STUB ITypeLib_RemoteFindName_Stub( ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo; MEMBERID __RPC_FAR *rgMemId; LPOLESTR szNameBuf; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -8717,19 +8717,19 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[422] ); - + NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&szNameBuf, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); lHashVal = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + pcFound = ( USHORT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof( USHORT ); - + ppTInfo = NdrAllocate(&_StubMsg,*pcFound * 4); rgMemId = NdrAllocate(&_StubMsg,*pcFound * 4); pBstrLibName = &_M84; @@ -8737,10 +8737,10 @@ NdrStubInitialize( pBstrLibName, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib_FindName_Stub( (ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject, szNameBuf, @@ -8749,101 +8749,101 @@ NdrStubInitialize( rgMemId, pcFound, pBstrLibName); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 12U + 15U + 4U + 14U + 11U; _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcFound ? *pcFound : 0; - + NdrComplexArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1852] ); - + _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcFound ? *pcFound : 0; - + NdrConformantVaryingArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rgMemId, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1874] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrLibName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcFound ? *pcFound : 0; - + NdrComplexArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppTInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1852] ); - + _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcFound ? *pcFound : 0; - + NdrConformantVaryingArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rgMemId, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1874] ); - + *( USHORT __RPC_FAR * )_StubMsg.Buffer = *pcFound; _StubMsg.Buffer += sizeof(USHORT); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrLibName, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcFound ? *pcFound : 0; - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppTInfo, &__MIDL_TypeFormatString.Format[1848] ); - + _StubMsg.MaxCount = pcFound ? *pcFound : 0; _StubMsg.Offset = 0; _StubMsg.ActualCount = pcFound ? *pcFound : 0; - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)rgMemId, &__MIDL_TypeFormatString.Format[1870] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrLibName, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_LocalReleaseTLibAttr_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib_LocalReleaseTLibAttr_Proxy( ITypeLib __RPC_FAR * This) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -8852,30 +8852,30 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 12); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[88] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -8893,7 +8893,7 @@ void __RPC_STUB ITypeLib_LocalReleaseTLibAttr_Stub( { HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -8901,30 +8901,30 @@ NdrStubInitialize( _pRpcChannelBuffer); RpcTryFinally { - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib_ReleaseTLibAttr_Stub((ITypeLib *) ((CStdStubBuffer *)This)->pvServerObject); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(13) _ITypeLibProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(13) _ITypeLibProxyVtbl = { { &IID_ITypeLib }, { @@ -8978,18 +8978,18 @@ static const CInterfaceStubVtbl _ITypeLibStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -HRESULT STDMETHODCALLTYPE ITypeLib2_GetCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeLib2_GetCustData_Proxy( ITypeLib2 __RPC_FAR * This, /* [in] */ REFGUID guid, /* [out] */ VARIANT __RPC_FAR *pVarVal) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pVarVal) { MIDL_memset( @@ -9005,9 +9005,9 @@ HRESULT STDMETHODCALLTYPE ITypeLib2_GetCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 13); - - - + + + if(!guid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -9018,39 +9018,39 @@ HRESULT STDMETHODCALLTYPE ITypeLib2_GetCustData_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[298] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -9075,7 +9075,7 @@ void __RPC_STUB ITypeLib2_GetCustData_Stub( MIDL_STUB_MESSAGE _StubMsg; REFGUID guid = 0; VARIANT __RPC_FAR *pVarVal; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -9086,69 +9086,69 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[298] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&guid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + pVarVal = &_M85; MIDL_memset( pVarVal, 0, sizeof( VARIANT )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeLib2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetCustData( (ITypeLib2 *) ((CStdStubBuffer *)This)->pvServerObject, guid, pVarVal); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pVarVal, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1110] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pVarVal, &__MIDL_TypeFormatString.Format[1102] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib2_RemoteGetLibStatistics_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib2_RemoteGetLibStatistics_Proxy( ITypeLib2 __RPC_FAR * This, /* [out] */ ULONG __RPC_FAR *pcUniqueNames, /* [out] */ ULONG __RPC_FAR *pcchUniqueNames) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -9157,9 +9157,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 14); - - - + + + if(!pcUniqueNames) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -9170,31 +9170,31 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[446] ); - + *pcUniqueNames = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + *pcchUniqueNames = *( ULONG __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(ULONG); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -9224,7 +9224,7 @@ void __RPC_STUB ITypeLib2_RemoteGetLibStatistics_Stub( MIDL_STUB_MESSAGE _StubMsg; ULONG __RPC_FAR *pcUniqueNames; ULONG __RPC_FAR *pcchUniqueNames; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -9236,40 +9236,40 @@ NdrStubInitialize( { pcUniqueNames = &_M86; pcchUniqueNames = &_M87; - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib2_GetLibStatistics_Stub( (ITypeLib2 *) ((CStdStubBuffer *)This)->pvServerObject, pcUniqueNames, pcchUniqueNames); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( ULONG __RPC_FAR * )_StubMsg.Buffer = *pcUniqueNames; _StubMsg.Buffer += sizeof(ULONG); - + *( ULONG __RPC_FAR * )_StubMsg.Buffer = *pcchUniqueNames; _StubMsg.Buffer += sizeof(ULONG); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib2_RemoteGetDocumentation2_Proxy( +/* [call_as] */ HRESULT STDMETHODCALLTYPE ITypeLib2_RemoteGetDocumentation2_Proxy( ITypeLib2 __RPC_FAR * This, /* [in] */ INT index, /* [in] */ LCID lcid, @@ -9280,11 +9280,11 @@ NdrStubInitialize( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pbstrHelpString) { MIDL_memset( @@ -9307,9 +9307,9 @@ NdrStubInitialize( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 15); - - - + + + if(!pbstrHelpString) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -9324,49 +9324,49 @@ NdrStubInitialize( } RpcTryFinally { - + _StubMsg.BufferLength = 4U + 4U + 4U; NdrProxyGetBuffer(This, &_StubMsg); *( INT __RPC_FAR * )_StubMsg.Buffer = index; _StubMsg.Buffer += sizeof(INT); - + *( LCID __RPC_FAR * )_StubMsg.Buffer = lcid; _StubMsg.Buffer += sizeof(LCID); - + *( DWORD __RPC_FAR * )_StubMsg.Buffer = refPtrFlags; _StubMsg.Buffer += sizeof(DWORD); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[334] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pbstrHelpString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *pdwHelpStringContext = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pbstrHelpStringDll, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -9405,7 +9405,7 @@ void __RPC_STUB ITypeLib2_RemoteGetDocumentation2_Stub( BSTR __RPC_FAR *pbstrHelpStringDll; DWORD __RPC_FAR *pdwHelpStringContext; DWORD refPtrFlags; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -9418,16 +9418,16 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[334] ); - + index = *( INT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(INT); - + lcid = *( LCID __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(LCID); - + refPtrFlags = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + pbstrHelpString = &_M88; MIDL_memset( pbstrHelpString, @@ -9439,10 +9439,10 @@ NdrStubInitialize( pbstrHelpStringDll, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; - - + + _RetVal = ITypeLib2_GetDocumentation2_Stub( (ITypeLib2 *) ((CStdStubBuffer *)This)->pvServerObject, index, @@ -9451,67 +9451,67 @@ NdrStubInitialize( pbstrHelpString, pdwHelpStringContext, pbstrHelpStringDll); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U + 11U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpStringDll, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pbstrHelpString, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( DWORD __RPC_FAR * )_StubMsg.Buffer = *pdwHelpStringContext; _StubMsg.Buffer += sizeof(DWORD); - + NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pbstrHelpStringDll, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpString, &__MIDL_TypeFormatString.Format[1708] ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pbstrHelpStringDll, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ITypeLib2_GetAllCustData_Proxy( +HRESULT STDMETHODCALLTYPE ITypeLib2_GetAllCustData_Proxy( ITypeLib2 __RPC_FAR * This, /* [out] */ CUSTDATA __RPC_FAR *pCustData) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pCustData) { MIDL_memset( @@ -9527,40 +9527,40 @@ HRESULT STDMETHODCALLTYPE ITypeLib2_GetAllCustData_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 16); - - - + + + if(!pCustData) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[354] ); - + NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -9584,7 +9584,7 @@ void __RPC_STUB ITypeLib2_GetAllCustData_Stub( MIDL_STUB_MESSAGE _StubMsg; CUSTDATA _pCustDataM; CUSTDATA __RPC_FAR *pCustData; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -9595,43 +9595,43 @@ NdrStubInitialize( { pCustData = &_pCustDataM; pCustData -> prgCustData = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeLib2*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetAllCustData((ITypeLib2 *) ((CStdStubBuffer *)This)->pvServerObject,pCustData); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 11U; NdrComplexStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrComplexStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pCustData, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1788] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pCustData, &__MIDL_TypeFormatString.Format[1748] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(17) _ITypeLib2ProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(17) _ITypeLib2ProxyVtbl = { { &IID_ITypeLib2 }, { @@ -9697,17 +9697,17 @@ const CInterfaceStubVtbl _ITypeLib2StubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -HRESULT STDMETHODCALLTYPE IErrorInfo_GetGUID_Proxy( +HRESULT STDMETHODCALLTYPE IErrorInfo_GetGUID_Proxy( IErrorInfo __RPC_FAR * This, /* [out] */ GUID __RPC_FAR *pGUID) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pGUID) { MIDL_memset( @@ -9723,39 +9723,39 @@ HRESULT STDMETHODCALLTYPE IErrorInfo_GetGUID_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!pGUID) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[456] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pGUID, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -9779,7 +9779,7 @@ void __RPC_STUB IErrorInfo_GetGUID_Stub( MIDL_STUB_MESSAGE _StubMsg; IID _pGUIDM; GUID __RPC_FAR *pGUID; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -9789,49 +9789,49 @@ NdrStubInitialize( RpcTryFinally { pGUID = &_pGUIDM; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetGUID((IErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,pGUID); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 11U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pGUID, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pGUID, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IErrorInfo_GetSource_Proxy( +HRESULT STDMETHODCALLTYPE IErrorInfo_GetSource_Proxy( IErrorInfo __RPC_FAR * This, /* [out] */ BSTR __RPC_FAR *pBstrSource) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrSource) { MIDL_memset( @@ -9847,40 +9847,40 @@ HRESULT STDMETHODCALLTYPE IErrorInfo_GetSource_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 4); - - - + + + if(!pBstrSource) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[462] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrSource, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -9904,7 +9904,7 @@ void __RPC_STUB IErrorInfo_GetSource_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; BSTR __RPC_FAR *pBstrSource; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -9918,54 +9918,54 @@ NdrStubInitialize( pBstrSource, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetSource((IErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,pBstrSource); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrSource, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrSource, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrSource, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IErrorInfo_GetDescription_Proxy( +HRESULT STDMETHODCALLTYPE IErrorInfo_GetDescription_Proxy( IErrorInfo __RPC_FAR * This, /* [out] */ BSTR __RPC_FAR *pBstrDescription) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrDescription) { MIDL_memset( @@ -9981,40 +9981,40 @@ HRESULT STDMETHODCALLTYPE IErrorInfo_GetDescription_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 5); - - - + + + if(!pBstrDescription) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[462] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrDescription, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10038,7 +10038,7 @@ void __RPC_STUB IErrorInfo_GetDescription_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; BSTR __RPC_FAR *pBstrDescription; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10052,54 +10052,54 @@ NdrStubInitialize( pBstrDescription, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetDescription((IErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,pBstrDescription); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrDescription, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrDescription, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrDescription, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IErrorInfo_GetHelpFile_Proxy( +HRESULT STDMETHODCALLTYPE IErrorInfo_GetHelpFile_Proxy( IErrorInfo __RPC_FAR * This, /* [out] */ BSTR __RPC_FAR *pBstrHelpFile) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(pBstrHelpFile) { MIDL_memset( @@ -10115,40 +10115,40 @@ HRESULT STDMETHODCALLTYPE IErrorInfo_GetHelpFile_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 6); - - - + + + if(!pBstrHelpFile) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[462] ); - + NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10172,7 +10172,7 @@ void __RPC_STUB IErrorInfo_GetHelpFile_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; BSTR __RPC_FAR *pBstrHelpFile; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10186,54 +10186,54 @@ NdrStubInitialize( pBstrHelpFile, 0, sizeof( BSTR )); - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetHelpFile((IErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,pBstrHelpFile); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 8U + 11U; NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1128] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pBstrHelpFile, &__MIDL_TypeFormatString.Format[1708] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE IErrorInfo_GetHelpContext_Proxy( +HRESULT STDMETHODCALLTYPE IErrorInfo_GetHelpContext_Proxy( IErrorInfo __RPC_FAR * This, /* [out] */ DWORD __RPC_FAR *pdwHelpContext) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -10242,37 +10242,37 @@ HRESULT STDMETHODCALLTYPE IErrorInfo_GetHelpContext_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 7); - - - + + + if(!pdwHelpContext) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrProxyGetBuffer(This, &_StubMsg); NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); - + *pdwHelpContext = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10296,7 +10296,7 @@ void __RPC_STUB IErrorInfo_GetHelpContext_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; DWORD __RPC_FAR *pdwHelpContext; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10306,31 +10306,31 @@ NdrStubInitialize( RpcTryFinally { pdwHelpContext = &_M94; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((IErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetHelpContext((IErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,pdwHelpContext); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U + 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( DWORD __RPC_FAR * )_StubMsg.Buffer = *pdwHelpContext; _StubMsg.Buffer += sizeof(DWORD); - + *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(8) _IErrorInfoProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(8) _IErrorInfoProxyVtbl = { { &IID_IErrorInfo }, { @@ -10374,17 +10374,17 @@ static const CInterfaceStubVtbl _IErrorInfoStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetGUID_Proxy( +HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetGUID_Proxy( ICreateErrorInfo __RPC_FAR * This, /* [in] */ REFGUID rguid) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -10393,42 +10393,42 @@ HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetGUID_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!rguid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)rguid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)rguid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[468] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10447,7 +10447,7 @@ void __RPC_STUB ICreateErrorInfo_SetGUID_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; REFGUID rguid = 0; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10457,45 +10457,45 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[468] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&rguid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - - + + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ICreateErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> SetGUID((ICreateErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,rguid); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetSource_Proxy( +HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetSource_Proxy( ICreateErrorInfo __RPC_FAR * This, /* [in] */ LPOLESTR szSource) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -10504,42 +10504,42 @@ HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetSource_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 4); - - - + + + if(!szSource) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 12U; NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)szSource, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)szSource, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[474] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10558,7 +10558,7 @@ void __RPC_STUB ICreateErrorInfo_SetSource_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; LPOLESTR szSource; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10569,47 +10569,47 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[474] ); - + NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&szSource, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248], (unsigned char)0 ); - - + + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ICreateErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> SetSource((ICreateErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,szSource); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetDescription_Proxy( +HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetDescription_Proxy( ICreateErrorInfo __RPC_FAR * This, /* [in] */ LPOLESTR szDescription) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -10618,42 +10618,42 @@ HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetDescription_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 5); - - - + + + if(!szDescription) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 12U; NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)szDescription, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)szDescription, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[474] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10672,7 +10672,7 @@ void __RPC_STUB ICreateErrorInfo_SetDescription_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; LPOLESTR szDescription; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10683,47 +10683,47 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[474] ); - + NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&szDescription, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248], (unsigned char)0 ); - - + + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ICreateErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> SetDescription((ICreateErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,szDescription); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetHelpFile_Proxy( +HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetHelpFile_Proxy( ICreateErrorInfo __RPC_FAR * This, /* [in] */ LPOLESTR szHelpFile) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -10732,42 +10732,42 @@ HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetHelpFile_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 6); - - - + + + if(!szHelpFile) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 12U; NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)szHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)szHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[474] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10786,7 +10786,7 @@ void __RPC_STUB ICreateErrorInfo_SetHelpFile_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; LPOLESTR szHelpFile; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10797,47 +10797,47 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[474] ); - + NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&szHelpFile, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1248], (unsigned char)0 ); - - + + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ICreateErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> SetHelpFile((ICreateErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,szHelpFile); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetHelpContext_Proxy( +HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetHelpContext_Proxy( ICreateErrorInfo __RPC_FAR * This, /* [in] */ DWORD dwHelpContext) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -10846,33 +10846,33 @@ HRESULT STDMETHODCALLTYPE ICreateErrorInfo_SetHelpContext_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 7); - - - + + + RpcTryFinally { - + _StubMsg.BufferLength = 4U; NdrProxyGetBuffer(This, &_StubMsg); *( DWORD __RPC_FAR * )_StubMsg.Buffer = dwHelpContext; _StubMsg.Buffer += sizeof(DWORD); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[84] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -10891,7 +10891,7 @@ void __RPC_STUB ICreateErrorInfo_SetHelpContext_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; DWORD dwHelpContext; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -10901,32 +10901,32 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[84] ); - + dwHelpContext = *( DWORD __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(DWORD); - - + + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ICreateErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> SetHelpContext((ICreateErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,dwHelpContext); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(8) _ICreateErrorInfoProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(8) _ICreateErrorInfoProxyVtbl = { { &IID_ICreateErrorInfo }, { @@ -10970,17 +10970,17 @@ static const CInterfaceStubVtbl _ICreateErrorInfoStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -HRESULT STDMETHODCALLTYPE ISupportErrorInfo_InterfaceSupportsErrorInfo_Proxy( +HRESULT STDMETHODCALLTYPE ISupportErrorInfo_InterfaceSupportsErrorInfo_Proxy( ISupportErrorInfo __RPC_FAR * This, /* [in] */ REFIID riid) { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + RpcTryExcept { NdrProxyInitialize( @@ -10989,42 +10989,42 @@ HRESULT STDMETHODCALLTYPE ISupportErrorInfo_InterfaceSupportsErrorInfo_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!riid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); } RpcTryFinally { - + _StubMsg.BufferLength = 0U; NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[468] ); - + _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { @@ -11043,7 +11043,7 @@ void __RPC_STUB ISupportErrorInfo_InterfaceSupportsErrorInfo_Stub( HRESULT _RetVal; MIDL_STUB_MESSAGE _StubMsg; IID* riid = 0; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -11053,34 +11053,34 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[468] ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - - + + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ISupportErrorInfo*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> InterfaceSupportsErrorInfo((ISupportErrorInfo *) ((CStdStubBuffer *)This)->pvServerObject,riid); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 4U; NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const CINTERFACE_PROXY_VTABLE(4) _ISupportErrorInfoProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(4) _ISupportErrorInfoProxyVtbl = { { &IID_ISupportErrorInfo }, { @@ -11116,7 +11116,7 @@ static const CInterfaceStubVtbl _ISupportErrorInfoStubVtbl = extern const MIDL_STUB_DESC Object_StubDesc; -HRESULT STDMETHODCALLTYPE ITypeFactory_CreateFromTypeInfo_Proxy( +HRESULT STDMETHODCALLTYPE ITypeFactory_CreateFromTypeInfo_Proxy( ITypeFactory __RPC_FAR * This, /* [in] */ ITypeInfo __RPC_FAR *pTypeInfo, /* [in] */ REFIID riid, @@ -11124,11 +11124,11 @@ HRESULT STDMETHODCALLTYPE ITypeFactory_CreateFromTypeInfo_Proxy( { HRESULT _RetVal; - + RPC_MESSAGE _RpcMessage; - + MIDL_STUB_MESSAGE _StubMsg; - + if(ppv) { MIDL_memset( @@ -11144,9 +11144,9 @@ HRESULT STDMETHODCALLTYPE ITypeFactory_CreateFromTypeInfo_Proxy( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PMIDL_STUB_DESC )&Object_StubDesc, 3); - - - + + + if(!riid) { RpcRaiseException(RPC_X_NULL_REF_POINTER); @@ -11157,52 +11157,52 @@ HRESULT STDMETHODCALLTYPE ITypeFactory_CreateFromTypeInfo_Proxy( } RpcTryFinally { - + _StubMsg.BufferLength = 0U + 0U; NdrInterfacePointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)pTypeInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] ); - + NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxyGetBuffer(This, &_StubMsg); NdrInterfacePointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)pTypeInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] ); - + NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38] ); - + NdrProxySendReceive(This, &_StubMsg); - + if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[480] ); - + NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&ppv, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1896], (unsigned char)0 ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); _RetVal = *( HRESULT __RPC_FAR * )_StubMsg.Buffer; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrProxyFreeBuffer(This, &_StubMsg); - + } RpcEndFinally - + } RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE) { _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrClearOutParameters( ( PMIDL_STUB_MESSAGE )&_StubMsg, ( PFORMAT_STRING )&__MIDL_TypeFormatString.Format[1896], @@ -11225,7 +11225,7 @@ void __RPC_STUB ITypeFactory_CreateFromTypeInfo_Stub( ITypeInfo __RPC_FAR *pTypeInfo; IUnknown __RPC_FAR *__RPC_FAR *ppv; IID* riid = 0; - + NdrStubInitialize( _pRpcMessage, &_StubMsg, @@ -11237,70 +11237,70 @@ NdrStubInitialize( { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[480] ); - + NdrInterfacePointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&pTypeInfo, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10], (unsigned char)0 ); - + NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR * __RPC_FAR *)&riid, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[38], (unsigned char)0 ); - + ppv = (void *)&_M101; _M101 = 0; - + *_pdwStubPhase = STUB_CALL_SERVER; _RetVal = (((ITypeFactory*) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> CreateFromTypeInfo( (ITypeFactory *) ((CStdStubBuffer *)This)->pvServerObject, pTypeInfo, riid, ppv); - + *_pdwStubPhase = STUB_MARSHAL; - + _StubMsg.BufferLength = 0U + 4U; _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *)ppv, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1896] ); - + _StubMsg.BufferLength += 16; - + NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg); _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg, (unsigned char __RPC_FAR *)ppv, (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[1896] ); - + _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3); *( HRESULT __RPC_FAR * )_StubMsg.Buffer = _RetVal; _StubMsg.Buffer += sizeof(HRESULT); - + } RpcFinally { NdrInterfacePointerFree( &_StubMsg, (unsigned char __RPC_FAR *)pTypeInfo, &__MIDL_TypeFormatString.Format[10] ); - + _StubMsg.MaxCount = (unsigned long) ( riid ); - + NdrPointerFree( &_StubMsg, (unsigned char __RPC_FAR *)ppv, &__MIDL_TypeFormatString.Format[1896] ); - + } RpcEndFinally - _pRpcMessage->BufferLength = + _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); - + } -static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[3] = +static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[3] = { { (USER_MARSHAL_SIZING_ROUTINE)VARIANT_UserSize, @@ -11323,7 +11323,7 @@ static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[3] = }; -static const MIDL_STUB_DESC Object_StubDesc = +static const MIDL_STUB_DESC Object_StubDesc = { 0, NdrOleAllocate, @@ -11347,7 +11347,7 @@ static const MIDL_STUB_DESC Object_StubDesc = 0 /* Reserved5 */ }; -static const CINTERFACE_PROXY_VTABLE(4) _ITypeFactoryProxyVtbl = +static const CINTERFACE_PROXY_VTABLE(4) _ITypeFactoryProxyVtbl = { { &IID_ITypeFactory }, { @@ -11415,7 +11415,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = { 0, { - + 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11429,7 +11429,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 8 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 10 */ +/* 10 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11439,7 +11439,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 12 */ NdrFcShort( 0x6 ), /* Type Offset=6 */ /* 14 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 16 */ +/* 16 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11447,7 +11447,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 18 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ -/* 20 */ +/* 20 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11459,7 +11459,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 26 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 28 */ +/* 28 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11471,7 +11471,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 34 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 36 */ +/* 36 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11483,7 +11483,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 42 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 44 */ +/* 44 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11491,7 +11491,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 46 */ NdrFcShort( 0x62 ), /* Type Offset=98 */ -/* 48 */ +/* 48 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11499,7 +11499,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 50 */ NdrFcShort( 0x44e ), /* Type Offset=1102 */ -/* 52 */ +/* 52 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11507,7 +11507,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 54 */ NdrFcShort( 0x460 ), /* Type Offset=1120 */ -/* 56 */ +/* 56 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11517,7 +11517,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 58 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ /* 60 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 62 */ +/* 62 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11525,7 +11525,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 64 */ NdrFcShort( 0x48e ), /* Type Offset=1166 */ -/* 66 */ +/* 66 */ 0x50, /* FC_IN_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11537,7 +11537,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 72 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 74 */ +/* 74 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11545,7 +11545,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 76 */ NdrFcShort( 0x4b2 ), /* Type Offset=1202 */ -/* 78 */ +/* 78 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11561,7 +11561,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 88 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 90 */ +/* 90 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11571,7 +11571,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 92 */ NdrFcShort( 0x4c8 ), /* Type Offset=1224 */ /* 94 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 96 */ +/* 96 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11583,7 +11583,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 102 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x6, /* FC_SHORT */ -/* 104 */ +/* 104 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11591,7 +11591,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 106 */ NdrFcShort( 0x6 ), /* Type Offset=6 */ -/* 108 */ +/* 108 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11599,7 +11599,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 110 */ NdrFcShort( 0x4e2 ), /* Type Offset=1250 */ -/* 112 */ +/* 112 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11607,7 +11607,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 114 */ NdrFcShort( 0x4e6 ), /* Type Offset=1254 */ -/* 116 */ +/* 116 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11615,7 +11615,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 118 */ NdrFcShort( 0x5b8 ), /* Type Offset=1464 */ -/* 120 */ +/* 120 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11623,7 +11623,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 122 */ NdrFcShort( 0x604 ), /* Type Offset=1540 */ -/* 124 */ +/* 124 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11633,7 +11633,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 126 */ NdrFcShort( 0x61a ), /* Type Offset=1562 */ /* 128 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 130 */ +/* 130 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11643,7 +11643,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 132 */ NdrFcShort( 0x4de ), /* Type Offset=1246 */ /* 134 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 136 */ +/* 136 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11653,7 +11653,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 138 */ NdrFcShort( 0x6 ), /* Type Offset=6 */ /* 140 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 142 */ +/* 142 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11661,7 +11661,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 144 */ NdrFcShort( 0x62a ), /* Type Offset=1578 */ -/* 146 */ +/* 146 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11671,7 +11671,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 148 */ NdrFcShort( 0x666 ), /* Type Offset=1638 */ /* 150 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 152 */ +/* 152 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11683,7 +11683,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 158 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 160 */ +/* 160 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11691,7 +11691,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 162 */ NdrFcShort( 0x4e6 ), /* Type Offset=1254 */ -/* 164 */ +/* 164 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11703,7 +11703,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 170 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 172 */ +/* 172 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11711,7 +11711,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 174 */ NdrFcShort( 0x5b8 ), /* Type Offset=1464 */ -/* 176 */ +/* 176 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11723,7 +11723,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 182 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 184 */ +/* 184 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11733,7 +11733,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 186 */ NdrFcShort( 0x696 ), /* Type Offset=1686 */ /* 188 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 190 */ +/* 190 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11745,7 +11745,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 196 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 198 */ +/* 198 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11759,7 +11759,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 206 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 208 */ +/* 208 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11767,7 +11767,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 210 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ -/* 212 */ +/* 212 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11775,7 +11775,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 214 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ -/* 216 */ +/* 216 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11783,7 +11783,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 218 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ -/* 220 */ +/* 220 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11799,7 +11799,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0xe, /* FC_ENUM32 */ /* 230 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 232 */ +/* 232 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11807,7 +11807,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 234 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ -/* 236 */ +/* 236 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11815,7 +11815,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 238 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ -/* 240 */ +/* 240 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11827,7 +11827,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 246 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 248 */ +/* 248 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11837,7 +11837,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 250 */ NdrFcShort( 0x6 ), /* Type Offset=6 */ /* 252 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 254 */ +/* 254 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11845,7 +11845,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 256 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ -/* 258 */ +/* 258 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11857,7 +11857,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 264 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 266 */ +/* 266 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11867,7 +11867,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 268 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ /* 270 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 272 */ +/* 272 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11875,7 +11875,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 274 */ NdrFcShort( 0x6be ), /* Type Offset=1726 */ -/* 276 */ +/* 276 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11885,7 +11885,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 278 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ /* 280 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 282 */ +/* 282 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11899,7 +11899,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 290 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0xe, /* FC_ENUM32 */ -/* 292 */ +/* 292 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11909,7 +11909,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 294 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ /* 296 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 298 */ +/* 298 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11917,7 +11917,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 300 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ -/* 302 */ +/* 302 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11929,7 +11929,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 308 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 310 */ +/* 310 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11937,7 +11937,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 312 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ -/* 314 */ +/* 314 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11951,7 +11951,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 322 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 324 */ +/* 324 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11959,7 +11959,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 326 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ -/* 328 */ +/* 328 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11975,7 +11975,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 338 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 340 */ +/* 340 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11983,7 +11983,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 342 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ -/* 344 */ +/* 344 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -11991,7 +11991,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 346 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ -/* 348 */ +/* 348 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12001,7 +12001,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 350 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ /* 352 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 354 */ +/* 354 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12013,7 +12013,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 360 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 362 */ +/* 362 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12027,7 +12027,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 370 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 372 */ +/* 372 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12039,7 +12039,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x8, /* FC_LONG */ /* 378 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 380 */ +/* 380 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12049,7 +12049,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 382 */ NdrFcShort( 0x4e2 ), /* Type Offset=1250 */ /* 384 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 386 */ +/* 386 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12057,7 +12057,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 388 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ -/* 390 */ +/* 390 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12067,7 +12067,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 392 */ NdrFcShort( 0x6 ), /* Type Offset=6 */ /* 394 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 396 */ +/* 396 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12075,7 +12075,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 398 */ NdrFcShort( 0x70c ), /* Type Offset=1804 */ -/* 400 */ +/* 400 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12085,7 +12085,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 402 */ NdrFcShort( 0x728 ), /* Type Offset=1832 */ /* 404 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 406 */ +/* 406 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12095,7 +12095,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 408 */ NdrFcShort( 0x4de ), /* Type Offset=1246 */ /* 410 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 412 */ +/* 412 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12103,7 +12103,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 414 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ -/* 416 */ +/* 416 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12113,7 +12113,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 418 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ /* 420 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 422 */ +/* 422 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12123,7 +12123,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 424 */ NdrFcShort( 0x4de ), /* Type Offset=1246 */ /* 426 */ 0x4e, /* FC_IN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 428 */ +/* 428 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12131,7 +12131,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 430 */ NdrFcShort( 0x738 ), /* Type Offset=1848 */ -/* 432 */ +/* 432 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12139,7 +12139,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 434 */ NdrFcShort( 0x74e ), /* Type Offset=1870 */ -/* 436 */ +/* 436 */ 0x50, /* FC_IN_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12147,7 +12147,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 438 */ NdrFcShort( 0x760 ), /* Type Offset=1888 */ -/* 440 */ +/* 440 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12157,7 +12157,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 442 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ /* 444 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 446 */ +/* 446 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12165,7 +12165,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 448 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ -/* 450 */ +/* 450 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12175,7 +12175,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 452 */ NdrFcShort( 0x2 ), /* Type Offset=2 */ /* 454 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 456 */ +/* 456 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12185,7 +12185,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 458 */ NdrFcShort( 0x764 ), /* Type Offset=1892 */ /* 460 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 462 */ +/* 462 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12195,7 +12195,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 464 */ NdrFcShort( 0x6ac ), /* Type Offset=1708 */ /* 466 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 468 */ +/* 468 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12205,7 +12205,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 470 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ /* 472 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 474 */ +/* 474 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12215,7 +12215,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = /* 476 */ NdrFcShort( 0x4de ), /* Type Offset=1246 */ /* 478 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */ 0x8, /* FC_LONG */ -/* 480 */ +/* 480 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12223,7 +12223,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 482 */ NdrFcShort( 0xa ), /* Type Offset=10 */ -/* 484 */ +/* 484 */ 0x4d, /* FC_IN_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12231,7 +12231,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = 0x2, /* Alpha Stack size = 2 */ #endif /* 486 */ NdrFcShort( 0x1c ), /* Type Offset=28 */ -/* 488 */ +/* 488 */ 0x51, /* FC_OUT_PARAM */ #ifndef _ALPHA_ 0x1, /* x86, MIPS & PPC Stack size = 1 */ @@ -12251,14 +12251,14 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0, { NdrFcShort( 0x0 ), /* 0 */ -/* 2 */ +/* 2 */ 0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */ /* 4 */ 0x8, /* FC_LONG */ 0x5c, /* FC_PAD */ -/* 6 */ +/* 6 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 8 */ NdrFcShort( 0x2 ), /* Offset= 2 (10) */ -/* 10 */ +/* 10 */ 0x2f, /* FC_IP */ 0x5a, /* FC_CONSTANT_IID */ /* 12 */ NdrFcLong( 0x20401 ), /* 132097 */ @@ -12272,16 +12272,16 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x0, /* 0 */ /* 26 */ 0x0, /* 0 */ 0x46, /* 70 */ -/* 28 */ +/* 28 */ 0x11, 0x0, /* FC_RP */ /* 30 */ NdrFcShort( 0x8 ), /* Offset= 8 (38) */ -/* 32 */ +/* 32 */ 0x1d, /* FC_SMFARRAY */ 0x0, /* 0 */ /* 34 */ NdrFcShort( 0x8 ), /* 8 */ /* 36 */ 0x2, /* FC_CHAR */ 0x5b, /* FC_END */ -/* 38 */ +/* 38 */ 0x15, /* FC_STRUCT */ 0x3, /* 3 */ /* 40 */ NdrFcShort( 0x10 ), /* 16 */ @@ -12292,10 +12292,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 46 */ 0x0, /* 0 */ NdrFcShort( 0xfffffff1 ), /* Offset= -15 (32) */ 0x5b, /* FC_END */ -/* 50 */ +/* 50 */ 0x11, 0x0, /* FC_RP */ /* 52 */ NdrFcShort( 0x2 ), /* Offset= 2 (54) */ -/* 54 */ +/* 54 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 56 */ NdrFcShort( 0x4 ), /* 4 */ @@ -12306,10 +12306,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = #else NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */ #endif -/* 62 */ +/* 62 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 64 */ +/* 64 */ 0x48, /* FC_VARIABLE_REPEAT */ 0x49, /* FC_FIXED_OFFSET */ /* 66 */ NdrFcShort( 0x4 ), /* 4 */ @@ -12318,19 +12318,19 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 72 */ NdrFcShort( 0x0 ), /* 0 */ /* 74 */ NdrFcShort( 0x0 ), /* 0 */ /* 76 */ 0x12, 0x8, /* FC_UP [simple_pointer] */ -/* 78 */ +/* 78 */ 0x25, /* FC_C_WSTRING */ 0x5c, /* FC_PAD */ -/* 80 */ +/* 80 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 82 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 84 */ +/* 84 */ 0x11, 0x0, /* FC_RP */ /* 86 */ NdrFcShort( 0x2 ), /* Offset= 2 (88) */ -/* 88 */ +/* 88 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 90 */ NdrFcShort( 0x4 ), /* 4 */ @@ -12343,13 +12343,13 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = #endif /* 96 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 98 */ +/* 98 */ 0x11, 0x0, /* FC_RP */ /* 100 */ NdrFcShort( 0x3d4 ), /* Offset= 980 (1080) */ -/* 102 */ +/* 102 */ 0x12, 0x0, /* FC_UP */ /* 104 */ NdrFcShort( 0x396 ), /* Offset= 918 (1022) */ -/* 106 */ +/* 106 */ 0x2b, /* FC_NON_ENCAPSULATED_UNION */ 0x7, /* FC_USHORT */ /* 108 */ 0x7, /* Corr desc: FC_USHORT */ @@ -12445,10 +12445,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 370 */ NdrFcLong( 0x4024 ), /* 16420 */ /* 374 */ NdrFcShort( 0x284 ), /* Offset= 644 (1018) */ /* 376 */ NdrFcShort( 0xffffffff ), /* Offset= -1 (375) */ -/* 378 */ +/* 378 */ 0x12, 0x0, /* FC_UP */ /* 380 */ NdrFcShort( 0xc ), /* Offset= 12 (392) */ -/* 382 */ +/* 382 */ 0x1b, /* FC_CARRAY */ 0x1, /* 1 */ /* 384 */ NdrFcShort( 0x2 ), /* 2 */ @@ -12457,7 +12457,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 388 */ NdrFcShort( 0xfffc ), /* -4 */ /* 390 */ 0x6, /* FC_SHORT */ 0x5b, /* FC_END */ -/* 392 */ +/* 392 */ 0x17, /* FC_CSTRUCT */ 0x3, /* 3 */ /* 394 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12466,13 +12466,13 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x8, /* FC_LONG */ /* 400 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 402 */ +/* 402 */ 0x15, /* FC_STRUCT */ 0x7, /* 7 */ /* 404 */ NdrFcShort( 0x8 ), /* 8 */ /* 406 */ 0xb, /* FC_HYPER */ 0x5b, /* FC_END */ -/* 408 */ +/* 408 */ 0x15, /* FC_STRUCT */ 0x7, /* 7 */ /* 410 */ NdrFcShort( 0x10 ), /* 16 */ @@ -12484,7 +12484,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x39, /* FC_ALIGNM8 */ /* 418 */ 0xb, /* FC_HYPER */ 0x5b, /* FC_END */ -/* 420 */ +/* 420 */ 0x2f, /* FC_IP */ 0x5a, /* FC_CONSTANT_IID */ /* 422 */ NdrFcLong( 0x0 ), /* 0 */ @@ -12498,7 +12498,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x0, /* 0 */ /* 436 */ 0x0, /* 0 */ 0x46, /* 70 */ -/* 438 */ +/* 438 */ 0x2f, /* FC_IP */ 0x5a, /* FC_CONSTANT_IID */ /* 440 */ NdrFcLong( 0x20400 ), /* 132096 */ @@ -12512,10 +12512,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x0, /* 0 */ /* 454 */ 0x0, /* 0 */ 0x46, /* 70 */ -/* 456 */ +/* 456 */ 0x12, 0x0, /* FC_UP */ /* 458 */ NdrFcShort( 0x1ea ), /* Offset= 490 (948) */ -/* 460 */ +/* 460 */ 0x2a, /* FC_ENCAPSULATED_UNION */ 0x49, /* 73 */ /* 462 */ NdrFcShort( 0x18 ), /* 24 */ @@ -12541,17 +12541,17 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 520 */ NdrFcLong( 0x14 ), /* 20 */ /* 524 */ NdrFcShort( 0x17e ), /* Offset= 382 (906) */ /* 526 */ NdrFcShort( 0xffffffff ), /* Offset= -1 (525) */ -/* 528 */ +/* 528 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 530 */ NdrFcShort( 0x4 ), /* 4 */ /* 532 */ 0x19, /* Corr desc: field pointer, FC_ULONG */ 0x0, /* */ /* 534 */ NdrFcShort( 0x0 ), /* 0 */ -/* 536 */ +/* 536 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 538 */ +/* 538 */ 0x48, /* FC_VARIABLE_REPEAT */ 0x49, /* FC_FIXED_OFFSET */ /* 540 */ NdrFcShort( 0x4 ), /* 4 */ @@ -12561,33 +12561,33 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 548 */ NdrFcShort( 0x0 ), /* 0 */ /* 550 */ 0x12, 0x0, /* FC_UP */ /* 552 */ NdrFcShort( 0xffffff60 ), /* Offset= -160 (392) */ -/* 554 */ +/* 554 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 556 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 558 */ +/* 558 */ 0x16, /* FC_PSTRUCT */ 0x3, /* 3 */ /* 560 */ NdrFcShort( 0x8 ), /* 8 */ -/* 562 */ +/* 562 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 564 */ +/* 564 */ 0x46, /* FC_NO_REPEAT */ 0x5c, /* FC_PAD */ /* 566 */ NdrFcShort( 0x4 ), /* 4 */ /* 568 */ NdrFcShort( 0x4 ), /* 4 */ /* 570 */ 0x11, 0x0, /* FC_RP */ /* 572 */ NdrFcShort( 0xffffffd4 ), /* Offset= -44 (528) */ -/* 574 */ +/* 574 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 576 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 578 */ +/* 578 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 580 */ NdrFcShort( 0x0 ), /* 0 */ @@ -12600,7 +12600,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 592 */ NdrFcShort( 0xffffff54 ), /* Offset= -172 (420) */ /* 594 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 596 */ +/* 596 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 598 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12610,10 +12610,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x36, /* FC_POINTER */ /* 606 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 608 */ +/* 608 */ 0x11, 0x0, /* FC_RP */ /* 610 */ NdrFcShort( 0xffffffe0 ), /* Offset= -32 (578) */ -/* 612 */ +/* 612 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 614 */ NdrFcShort( 0x0 ), /* 0 */ @@ -12626,7 +12626,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 626 */ NdrFcShort( 0xffffff44 ), /* Offset= -188 (438) */ /* 628 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 630 */ +/* 630 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 632 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12636,20 +12636,20 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x36, /* FC_POINTER */ /* 640 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 642 */ +/* 642 */ 0x11, 0x0, /* FC_RP */ /* 644 */ NdrFcShort( 0xffffffe0 ), /* Offset= -32 (612) */ -/* 646 */ +/* 646 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 648 */ NdrFcShort( 0x4 ), /* 4 */ /* 650 */ 0x19, /* Corr desc: field pointer, FC_ULONG */ 0x0, /* */ /* 652 */ NdrFcShort( 0x0 ), /* 0 */ -/* 654 */ +/* 654 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 656 */ +/* 656 */ 0x48, /* FC_VARIABLE_REPEAT */ 0x49, /* FC_FIXED_OFFSET */ /* 658 */ NdrFcShort( 0x4 ), /* 4 */ @@ -12659,13 +12659,13 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 666 */ NdrFcShort( 0x0 ), /* 0 */ /* 668 */ 0x12, 0x0, /* FC_UP */ /* 670 */ NdrFcShort( 0x160 ), /* Offset= 352 (1022) */ -/* 672 */ +/* 672 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 674 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 676 */ +/* 676 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 678 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12675,10 +12675,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x36, /* FC_POINTER */ /* 686 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 688 */ +/* 688 */ 0x11, 0x0, /* FC_RP */ /* 690 */ NdrFcShort( 0xffffffd4 ), /* Offset= -44 (646) */ -/* 692 */ +/* 692 */ 0x2f, /* FC_IP */ 0x5a, /* FC_CONSTANT_IID */ /* 694 */ NdrFcLong( 0x2f ), /* 47 */ @@ -12692,7 +12692,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x0, /* 0 */ /* 708 */ 0x0, /* 0 */ 0x46, /* 70 */ -/* 710 */ +/* 710 */ 0x1b, /* FC_CARRAY */ 0x0, /* 0 */ /* 712 */ NdrFcShort( 0x1 ), /* 1 */ @@ -12701,7 +12701,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 716 */ NdrFcShort( 0x4 ), /* 4 */ /* 718 */ 0x1, /* FC_BYTE */ 0x5b, /* FC_END */ -/* 720 */ +/* 720 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 722 */ NdrFcShort( 0x10 ), /* 16 */ @@ -12714,20 +12714,20 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 732 */ NdrFcShort( 0xffffffd8 ), /* Offset= -40 (692) */ /* 734 */ 0x36, /* FC_POINTER */ 0x5b, /* FC_END */ -/* 736 */ +/* 736 */ 0x12, 0x0, /* FC_UP */ /* 738 */ NdrFcShort( 0xffffffe4 ), /* Offset= -28 (710) */ -/* 740 */ +/* 740 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 742 */ NdrFcShort( 0x4 ), /* 4 */ /* 744 */ 0x19, /* Corr desc: field pointer, FC_ULONG */ 0x0, /* */ /* 746 */ NdrFcShort( 0x0 ), /* 0 */ -/* 748 */ +/* 748 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 750 */ +/* 750 */ 0x48, /* FC_VARIABLE_REPEAT */ 0x49, /* FC_FIXED_OFFSET */ /* 752 */ NdrFcShort( 0x4 ), /* 4 */ @@ -12737,13 +12737,13 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 760 */ NdrFcShort( 0x0 ), /* 0 */ /* 762 */ 0x12, 0x0, /* FC_UP */ /* 764 */ NdrFcShort( 0xffffffd4 ), /* Offset= -44 (720) */ -/* 766 */ +/* 766 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 768 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 770 */ +/* 770 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 772 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12753,10 +12753,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x36, /* FC_POINTER */ /* 780 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 782 */ +/* 782 */ 0x11, 0x0, /* FC_RP */ /* 784 */ NdrFcShort( 0xffffffd4 ), /* Offset= -44 (740) */ -/* 786 */ +/* 786 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 788 */ NdrFcShort( 0x18 ), /* 24 */ @@ -12769,10 +12769,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 798 */ NdrFcShort( 0xfffffd08 ), /* Offset= -760 (38) */ /* 800 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 802 */ +/* 802 */ 0x11, 0x0, /* FC_RP */ /* 804 */ NdrFcShort( 0xffffff1e ), /* Offset= -226 (578) */ -/* 806 */ +/* 806 */ 0x1b, /* FC_CARRAY */ 0x0, /* 0 */ /* 808 */ NdrFcShort( 0x1 ), /* 1 */ @@ -12781,27 +12781,27 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 812 */ NdrFcShort( 0x0 ), /* 0 */ /* 814 */ 0x1, /* FC_BYTE */ 0x5b, /* FC_END */ -/* 816 */ +/* 816 */ 0x16, /* FC_PSTRUCT */ 0x3, /* 3 */ /* 818 */ NdrFcShort( 0x8 ), /* 8 */ -/* 820 */ +/* 820 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 822 */ +/* 822 */ 0x46, /* FC_NO_REPEAT */ 0x5c, /* FC_PAD */ /* 824 */ NdrFcShort( 0x4 ), /* 4 */ /* 826 */ NdrFcShort( 0x4 ), /* 4 */ /* 828 */ 0x12, 0x0, /* FC_UP */ /* 830 */ NdrFcShort( 0xffffffe8 ), /* Offset= -24 (806) */ -/* 832 */ +/* 832 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 834 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 836 */ +/* 836 */ 0x1b, /* FC_CARRAY */ 0x1, /* 1 */ /* 838 */ NdrFcShort( 0x2 ), /* 2 */ @@ -12810,27 +12810,27 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 842 */ NdrFcShort( 0x0 ), /* 0 */ /* 844 */ 0x6, /* FC_SHORT */ 0x5b, /* FC_END */ -/* 846 */ +/* 846 */ 0x16, /* FC_PSTRUCT */ 0x3, /* 3 */ /* 848 */ NdrFcShort( 0x8 ), /* 8 */ -/* 850 */ +/* 850 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 852 */ +/* 852 */ 0x46, /* FC_NO_REPEAT */ 0x5c, /* FC_PAD */ /* 854 */ NdrFcShort( 0x4 ), /* 4 */ /* 856 */ NdrFcShort( 0x4 ), /* 4 */ /* 858 */ 0x12, 0x0, /* FC_UP */ /* 860 */ NdrFcShort( 0xffffffe8 ), /* Offset= -24 (836) */ -/* 862 */ +/* 862 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 864 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 866 */ +/* 866 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 868 */ NdrFcShort( 0x4 ), /* 4 */ @@ -12839,27 +12839,27 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 872 */ NdrFcShort( 0x0 ), /* 0 */ /* 874 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 876 */ +/* 876 */ 0x16, /* FC_PSTRUCT */ 0x3, /* 3 */ /* 878 */ NdrFcShort( 0x8 ), /* 8 */ -/* 880 */ +/* 880 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 882 */ +/* 882 */ 0x46, /* FC_NO_REPEAT */ 0x5c, /* FC_PAD */ /* 884 */ NdrFcShort( 0x4 ), /* 4 */ /* 886 */ NdrFcShort( 0x4 ), /* 4 */ /* 888 */ 0x12, 0x0, /* FC_UP */ /* 890 */ NdrFcShort( 0xffffffe8 ), /* Offset= -24 (866) */ -/* 892 */ +/* 892 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 894 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 896 */ +/* 896 */ 0x1b, /* FC_CARRAY */ 0x7, /* 7 */ /* 898 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12868,27 +12868,27 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 902 */ NdrFcShort( 0x0 ), /* 0 */ /* 904 */ 0xb, /* FC_HYPER */ 0x5b, /* FC_END */ -/* 906 */ +/* 906 */ 0x16, /* FC_PSTRUCT */ 0x3, /* 3 */ /* 908 */ NdrFcShort( 0x8 ), /* 8 */ -/* 910 */ +/* 910 */ 0x4b, /* FC_PP */ 0x5c, /* FC_PAD */ -/* 912 */ +/* 912 */ 0x46, /* FC_NO_REPEAT */ 0x5c, /* FC_PAD */ /* 914 */ NdrFcShort( 0x4 ), /* 4 */ /* 916 */ NdrFcShort( 0x4 ), /* 4 */ /* 918 */ 0x12, 0x0, /* FC_UP */ /* 920 */ NdrFcShort( 0xffffffe8 ), /* Offset= -24 (896) */ -/* 922 */ +/* 922 */ 0x5b, /* FC_END */ 0x8, /* FC_LONG */ /* 924 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 926 */ +/* 926 */ 0x15, /* FC_STRUCT */ 0x3, /* 3 */ /* 928 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12896,7 +12896,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x8, /* FC_LONG */ /* 932 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 934 */ +/* 934 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 936 */ NdrFcShort( 0x8 ), /* 8 */ @@ -12908,7 +12908,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 944 */ NdrFcShort( 0xffffffee ), /* Offset= -18 (926) */ /* 946 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 948 */ +/* 948 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 950 */ NdrFcShort( 0x28 ), /* 40 */ @@ -12923,54 +12923,54 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 962 */ 0x0, /* 0 */ NdrFcShort( 0xfffffe09 ), /* Offset= -503 (460) */ 0x5b, /* FC_END */ -/* 966 */ +/* 966 */ 0x12, 0x8, /* FC_UP [simple_pointer] */ /* 968 */ 0x2, /* FC_CHAR */ 0x5c, /* FC_PAD */ -/* 970 */ +/* 970 */ 0x12, 0x8, /* FC_UP [simple_pointer] */ /* 972 */ 0x6, /* FC_SHORT */ 0x5c, /* FC_PAD */ -/* 974 */ +/* 974 */ 0x12, 0x8, /* FC_UP [simple_pointer] */ /* 976 */ 0x8, /* FC_LONG */ 0x5c, /* FC_PAD */ -/* 978 */ +/* 978 */ 0x12, 0x8, /* FC_UP [simple_pointer] */ /* 980 */ 0xa, /* FC_FLOAT */ 0x5c, /* FC_PAD */ -/* 982 */ +/* 982 */ 0x12, 0x8, /* FC_UP [simple_pointer] */ /* 984 */ 0xc, /* FC_DOUBLE */ 0x5c, /* FC_PAD */ -/* 986 */ +/* 986 */ 0x12, 0x10, /* FC_UP */ /* 988 */ NdrFcShort( 0xfffffd9e ), /* Offset= -610 (378) */ -/* 990 */ +/* 990 */ 0x12, 0x10, /* FC_UP */ /* 992 */ NdrFcShort( 0x2 ), /* Offset= 2 (994) */ -/* 994 */ +/* 994 */ 0x12, 0x0, /* FC_UP */ /* 996 */ NdrFcShort( 0xfffffc1c ), /* Offset= -996 (0) */ -/* 998 */ +/* 998 */ 0x12, 0x0, /* FC_UP */ /* 1000 */ NdrFcShort( 0xfffffdaa ), /* Offset= -598 (402) */ -/* 1002 */ +/* 1002 */ 0x12, 0x0, /* FC_UP */ /* 1004 */ NdrFcShort( 0xfffffdac ), /* Offset= -596 (408) */ -/* 1006 */ +/* 1006 */ 0x12, 0x10, /* FC_UP */ /* 1008 */ NdrFcShort( 0xfffffdb4 ), /* Offset= -588 (420) */ -/* 1010 */ +/* 1010 */ 0x12, 0x10, /* FC_UP */ /* 1012 */ NdrFcShort( 0xfffffdc2 ), /* Offset= -574 (438) */ -/* 1014 */ +/* 1014 */ 0x12, 0x10, /* FC_UP */ /* 1016 */ NdrFcShort( 0xfffffdd0 ), /* Offset= -560 (456) */ -/* 1018 */ +/* 1018 */ 0x12, 0x0, /* FC_UP */ /* 1020 */ NdrFcShort( 0xfffffed4 ), /* Offset= -300 (720) */ -/* 1022 */ +/* 1022 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x7, /* 7 */ /* 1024 */ NdrFcShort( 0x20 ), /* 32 */ @@ -12993,7 +12993,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1046 */ NdrFcShort( 0x10 ), /* 16 */ /* 1048 */ NdrFcShort( 0x0 ), /* 0 */ /* 1050 */ NdrFcShort( 0xfffffc4c ), /* Offset= -948 (102) */ -/* 1052 */ +/* 1052 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 1054 */ NdrFcShort( 0x0 ), /* 0 */ @@ -13006,7 +13006,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1066 */ NdrFcShort( 0xffffffe8 ), /* Offset= -24 (1042) */ /* 1068 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1070 */ +/* 1070 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 1072 */ NdrFcShort( 0x4 ), /* 4 */ @@ -13015,7 +13015,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1076 */ NdrFcShort( 0xc ), /* 12 */ /* 1078 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 1080 */ +/* 1080 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1082 */ NdrFcShort( 0x10 ), /* 16 */ @@ -13027,16 +13027,16 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x8, /* FC_LONG */ /* 1092 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1094 */ +/* 1094 */ 0x12, 0x0, /* FC_UP */ /* 1096 */ NdrFcShort( 0xffffffd4 ), /* Offset= -44 (1052) */ -/* 1098 */ +/* 1098 */ 0x12, 0x0, /* FC_UP */ /* 1100 */ NdrFcShort( 0xffffffe2 ), /* Offset= -30 (1070) */ -/* 1102 */ +/* 1102 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1104 */ NdrFcShort( 0x6 ), /* Offset= 6 (1110) */ -/* 1106 */ +/* 1106 */ 0x13, 0x0, /* FC_OP */ /* 1108 */ NdrFcShort( 0xffffffaa ), /* Offset= -86 (1022) */ /* 1110 */ 0xb4, /* FC_USER_MARSHAL */ @@ -13045,10 +13045,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1114 */ NdrFcShort( 0x10 ), /* 16 */ /* 1116 */ NdrFcShort( 0x0 ), /* 0 */ /* 1118 */ NdrFcShort( 0xfffffff4 ), /* Offset= -12 (1106) */ -/* 1120 */ +/* 1120 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1122 */ NdrFcShort( 0x10 ), /* Offset= 16 (1138) */ -/* 1124 */ +/* 1124 */ 0x13, 0x0, /* FC_OP */ /* 1126 */ NdrFcShort( 0xfffffd22 ), /* Offset= -734 (392) */ /* 1128 */ 0xb4, /* FC_USER_MARSHAL */ @@ -13057,7 +13057,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1132 */ NdrFcShort( 0x4 ), /* 4 */ /* 1134 */ NdrFcShort( 0x0 ), /* 0 */ /* 1136 */ NdrFcShort( 0xfffffff4 ), /* Offset= -12 (1124) */ -/* 1138 */ +/* 1138 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1140 */ NdrFcShort( 0x20 ), /* 32 */ @@ -13080,10 +13080,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x8, /* FC_LONG */ /* 1164 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 1166 */ +/* 1166 */ 0x11, 0x0, /* FC_RP */ /* 1168 */ NdrFcShort( 0x2 ), /* Offset= 2 (1170) */ -/* 1170 */ +/* 1170 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 1172 */ NdrFcShort( 0x4 ), /* 4 */ @@ -13096,10 +13096,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = #endif /* 1178 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 1180 */ +/* 1180 */ 0x11, 0x0, /* FC_RP */ /* 1182 */ NdrFcShort( 0x2 ), /* Offset= 2 (1184) */ -/* 1184 */ +/* 1184 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 1186 */ NdrFcShort( 0x0 ), /* 0 */ @@ -13116,10 +13116,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1198 */ NdrFcShort( 0xffffffa8 ), /* Offset= -88 (1110) */ /* 1200 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1202 */ +/* 1202 */ 0x11, 0x0, /* FC_RP */ /* 1204 */ NdrFcShort( 0x2 ), /* Offset= 2 (1206) */ -/* 1206 */ +/* 1206 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 1208 */ NdrFcShort( 0x0 ), /* 0 */ @@ -13142,10 +13142,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1220 */ NdrFcShort( 0xffffff92 ), /* Offset= -110 (1110) */ /* 1222 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1224 */ +/* 1224 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1226 */ NdrFcShort( 0x2 ), /* Offset= 2 (1228) */ -/* 1228 */ +/* 1228 */ 0x2f, /* FC_IP */ 0x5a, /* FC_CONSTANT_IID */ /* 1230 */ NdrFcLong( 0x20404 ), /* 132100 */ @@ -13159,22 +13159,22 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x0, /* 0 */ /* 1244 */ 0x0, /* 0 */ 0x46, /* 70 */ -/* 1246 */ +/* 1246 */ 0x11, 0x8, /* FC_RP [simple_pointer] */ -/* 1248 */ +/* 1248 */ 0x25, /* FC_C_WSTRING */ 0x5c, /* FC_PAD */ -/* 1250 */ +/* 1250 */ 0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */ /* 1252 */ 0xe, /* FC_ENUM32 */ 0x5c, /* FC_PAD */ -/* 1254 */ +/* 1254 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1256 */ NdrFcShort( 0x2 ), /* Offset= 2 (1258) */ -/* 1258 */ +/* 1258 */ 0x13, 0x0, /* FC_OP */ /* 1260 */ NdrFcShort( 0xaa ), /* Offset= 170 (1430) */ -/* 1262 */ +/* 1262 */ 0x2b, /* FC_NON_ENCAPSULATED_UNION */ 0x7, /* FC_USHORT */ /* 1264 */ 0x7, /* Corr desc: FC_USHORT */ @@ -13192,13 +13192,13 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1292 */ NdrFcLong( 0x1d ), /* 29 */ /* 1296 */ NdrFcShort( 0x8008 ), /* Simple arm type: FC_LONG */ /* 1298 */ NdrFcShort( 0x0 ), /* Offset= 0 (1298) */ -/* 1300 */ +/* 1300 */ 0x13, 0x0, /* FC_OP */ /* 1302 */ NdrFcShort( 0x24 ), /* Offset= 36 (1338) */ -/* 1304 */ +/* 1304 */ 0x13, 0x0, /* FC_OP */ /* 1306 */ NdrFcShort( 0x10 ), /* Offset= 16 (1322) */ -/* 1308 */ +/* 1308 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 1310 */ NdrFcShort( 0x8 ), /* 8 */ @@ -13210,7 +13210,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1318 */ NdrFcShort( 0xfffffe78 ), /* Offset= -392 (926) */ /* 1320 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1322 */ +/* 1322 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1324 */ NdrFcShort( 0x4 ), /* 4 */ @@ -13223,7 +13223,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x3e, /* FC_STRUCTPAD2 */ /* 1336 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1338 */ +/* 1338 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1340 */ NdrFcShort( 0x8 ), /* 8 */ @@ -13236,7 +13236,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x3e, /* FC_STRUCTPAD2 */ /* 1352 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1354 */ +/* 1354 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1356 */ NdrFcShort( 0x18 ), /* 24 */ @@ -13247,7 +13247,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1364 */ 0x4, /* 4 */ NdrFcShort( 0xffffff01 ), /* Offset= -255 (1110) */ 0x5b, /* FC_END */ -/* 1368 */ +/* 1368 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1370 */ NdrFcShort( 0x8 ), /* 8 */ @@ -13257,10 +13257,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x6, /* FC_SHORT */ /* 1378 */ 0x3e, /* FC_STRUCTPAD2 */ 0x5b, /* FC_END */ -/* 1380 */ +/* 1380 */ 0x13, 0x0, /* FC_OP */ /* 1382 */ NdrFcShort( 0xffffffe4 ), /* Offset= -28 (1354) */ -/* 1384 */ +/* 1384 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1386 */ NdrFcShort( 0x10 ), /* 16 */ @@ -13274,7 +13274,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1398 */ NdrFcShort( 0xffffffe2 ), /* Offset= -30 (1368) */ /* 1400 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1402 */ +/* 1402 */ 0x1b, /* FC_CARRAY */ 0x3, /* 3 */ /* 1404 */ NdrFcShort( 0x4 ), /* 4 */ @@ -13283,7 +13283,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1408 */ NdrFcShort( 0x1e ), /* 30 */ /* 1410 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 1412 */ +/* 1412 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 1414 */ NdrFcShort( 0x0 ), /* 0 */ @@ -13296,7 +13296,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1426 */ NdrFcShort( 0xffffffd6 ), /* Offset= -42 (1384) */ /* 1428 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1430 */ +/* 1430 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1432 */ NdrFcShort( 0x34 ), /* 52 */ @@ -13319,19 +13319,19 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x3e, /* FC_STRUCTPAD2 */ /* 1454 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1456 */ +/* 1456 */ 0x13, 0x0, /* FC_OP */ /* 1458 */ NdrFcShort( 0xffffffc8 ), /* Offset= -56 (1402) */ -/* 1460 */ +/* 1460 */ 0x13, 0x0, /* FC_OP */ /* 1462 */ NdrFcShort( 0xffffffce ), /* Offset= -50 (1412) */ -/* 1464 */ +/* 1464 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1466 */ NdrFcShort( 0x2 ), /* Offset= 2 (1468) */ -/* 1468 */ +/* 1468 */ 0x13, 0x0, /* FC_OP */ /* 1470 */ NdrFcShort( 0x2c ), /* Offset= 44 (1514) */ -/* 1472 */ +/* 1472 */ 0x2b, /* FC_NON_ENCAPSULATED_UNION */ 0x8, /* FC_LONG */ /* 1474 */ 0x8, /* Corr desc: FC_LONG */ @@ -13349,10 +13349,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1502 */ NdrFcLong( 0x2 ), /* 2 */ /* 1506 */ NdrFcShort( 0x4 ), /* Offset= 4 (1510) */ /* 1508 */ NdrFcShort( 0xffffffff ), /* Offset= -1 (1507) */ -/* 1510 */ +/* 1510 */ 0x13, 0x0, /* FC_OP */ /* 1512 */ NdrFcShort( 0xfffffe6e ), /* Offset= -402 (1110) */ -/* 1514 */ +/* 1514 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1516 */ NdrFcShort( 0x24 ), /* 36 */ @@ -13370,15 +13370,15 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x38, /* FC_ALIGNM4 */ /* 1534 */ 0xe, /* FC_ENUM32 */ 0x5b, /* FC_END */ -/* 1536 */ +/* 1536 */ 0x13, 0x8, /* FC_OP [simple_pointer] */ -/* 1538 */ +/* 1538 */ 0x25, /* FC_C_WSTRING */ 0x5c, /* FC_PAD */ -/* 1540 */ +/* 1540 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1542 */ NdrFcShort( 0x2 ), /* Offset= 2 (1544) */ -/* 1544 */ +/* 1544 */ 0x2f, /* FC_IP */ 0x5a, /* FC_CONSTANT_IID */ /* 1546 */ NdrFcLong( 0x20403 ), /* 132099 */ @@ -13392,7 +13392,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x0, /* 0 */ /* 1560 */ 0x0, /* 0 */ 0x46, /* 70 */ -/* 1562 */ +/* 1562 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1564 */ NdrFcShort( 0x4 ), /* Offset= 4 (1568) */ /* 1566 */ 0x8, /* FC_LONG */ @@ -13403,13 +13403,13 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1572 */ NdrFcShort( 0xc ), /* 12 */ /* 1574 */ NdrFcShort( 0x4 ), /* 4 */ /* 1576 */ NdrFcShort( 0xfffffff6 ), /* Offset= -10 (1566) */ -/* 1578 */ +/* 1578 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1580 */ NdrFcShort( 0x2 ), /* Offset= 2 (1582) */ -/* 1582 */ +/* 1582 */ 0x13, 0x0, /* FC_OP */ /* 1584 */ NdrFcShort( 0xe ), /* Offset= 14 (1598) */ -/* 1586 */ +/* 1586 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1588 */ NdrFcShort( 0x8 ), /* 8 */ @@ -13419,7 +13419,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x6, /* FC_SHORT */ /* 1596 */ 0x3e, /* FC_STRUCTPAD2 */ 0x5b, /* FC_END */ -/* 1598 */ +/* 1598 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1600 */ NdrFcShort( 0x4c ), /* 76 */ @@ -13450,12 +13450,12 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1630 */ 0x0, /* 0 */ NdrFcShort( 0xffffffd3 ), /* Offset= -45 (1586) */ 0x5b, /* FC_END */ -/* 1634 */ +/* 1634 */ 0x13, 0x8, /* FC_OP [simple_pointer] */ -/* 1636 */ +/* 1636 */ 0x25, /* FC_C_WSTRING */ 0x5c, /* FC_PAD */ -/* 1638 */ +/* 1638 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1640 */ NdrFcShort( 0x4 ), /* Offset= 4 (1644) */ /* 1642 */ 0x8, /* FC_LONG */ @@ -13466,7 +13466,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1648 */ NdrFcShort( 0xc ), /* 12 */ /* 1650 */ NdrFcShort( 0x4 ), /* 4 */ /* 1652 */ NdrFcShort( 0xfffffff6 ), /* Offset= -10 (1642) */ -/* 1654 */ +/* 1654 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1656 */ NdrFcShort( 0x4 ), /* Offset= 4 (1660) */ /* 1658 */ 0x8, /* FC_LONG */ @@ -13477,7 +13477,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1664 */ NdrFcShort( 0xc ), /* 12 */ /* 1666 */ NdrFcShort( 0x4 ), /* 4 */ /* 1668 */ NdrFcShort( 0xfffffff6 ), /* Offset= -10 (1658) */ -/* 1670 */ +/* 1670 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1672 */ NdrFcShort( 0x4 ), /* Offset= 4 (1676) */ /* 1674 */ 0x8, /* FC_LONG */ @@ -13488,10 +13488,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1680 */ NdrFcShort( 0xc ), /* 12 */ /* 1682 */ NdrFcShort( 0x4 ), /* 4 */ /* 1684 */ NdrFcShort( 0xfffffff6 ), /* Offset= -10 (1674) */ -/* 1686 */ +/* 1686 */ 0x11, 0x0, /* FC_RP */ /* 1688 */ NdrFcShort( 0x2 ), /* Offset= 2 (1690) */ -/* 1690 */ +/* 1690 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 1692 */ NdrFcShort( 0x0 ), /* 0 */ @@ -13514,17 +13514,17 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1704 */ NdrFcShort( 0xfffffdc0 ), /* Offset= -576 (1128) */ /* 1706 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1708 */ +/* 1708 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1710 */ NdrFcShort( 0xfffffdba ), /* Offset= -582 (1128) */ -/* 1712 */ +/* 1712 */ 0x11, 0xc, /* FC_RP [alloced_on_stack] [simple_pointer] */ /* 1714 */ 0x6, /* FC_SHORT */ 0x5c, /* FC_PAD */ -/* 1716 */ +/* 1716 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1718 */ NdrFcShort( 0x2 ), /* Offset= 2 (1720) */ -/* 1720 */ +/* 1720 */ 0x2f, /* FC_IP */ 0x5c, /* FC_PAD */ /* 1722 */ 0x28, /* Corr desc: parameter, FC_LONG */ @@ -13534,10 +13534,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = #else NdrFcShort( 0x8 ), /* Alpha Stack size/offset = 8 */ #endif -/* 1726 */ +/* 1726 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1728 */ NdrFcShort( 0x2 ), /* Offset= 2 (1730) */ -/* 1730 */ +/* 1730 */ 0x2f, /* FC_IP */ 0x5a, /* FC_CONSTANT_IID */ /* 1732 */ NdrFcLong( 0x20402 ), /* 132098 */ @@ -13551,10 +13551,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x0, /* 0 */ /* 1746 */ 0x0, /* 0 */ 0x46, /* 70 */ -/* 1748 */ +/* 1748 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1750 */ NdrFcShort( 0x26 ), /* Offset= 38 (1788) */ -/* 1752 */ +/* 1752 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1754 */ NdrFcShort( 0x20 ), /* 32 */ @@ -13568,7 +13568,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1766 */ NdrFcShort( 0xfffffd70 ), /* Offset= -656 (1110) */ /* 1768 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1770 */ +/* 1770 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 1772 */ NdrFcShort( 0x0 ), /* 0 */ @@ -13581,7 +13581,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1784 */ NdrFcShort( 0xffffffe0 ), /* Offset= -32 (1752) */ /* 1786 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1788 */ +/* 1788 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1790 */ NdrFcShort( 0x8 ), /* 8 */ @@ -13591,16 +13591,16 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x36, /* FC_POINTER */ /* 1798 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1800 */ +/* 1800 */ 0x13, 0x0, /* FC_OP */ /* 1802 */ NdrFcShort( 0xffffffe0 ), /* Offset= -32 (1770) */ -/* 1804 */ +/* 1804 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1806 */ NdrFcShort( 0x2 ), /* Offset= 2 (1808) */ -/* 1808 */ +/* 1808 */ 0x13, 0x0, /* FC_OP */ /* 1810 */ NdrFcShort( 0x2 ), /* Offset= 2 (1812) */ -/* 1812 */ +/* 1812 */ 0x1a, /* FC_BOGUS_STRUCT */ 0x3, /* 3 */ /* 1814 */ NdrFcShort( 0x20 ), /* 32 */ @@ -13617,7 +13617,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = 0x3e, /* FC_STRUCTPAD2 */ /* 1830 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1832 */ +/* 1832 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1834 */ NdrFcShort( 0x4 ), /* Offset= 4 (1838) */ /* 1836 */ 0x8, /* FC_LONG */ @@ -13628,10 +13628,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1842 */ NdrFcShort( 0xc ), /* 12 */ /* 1844 */ NdrFcShort( 0x4 ), /* 4 */ /* 1846 */ NdrFcShort( 0xfffffff6 ), /* Offset= -10 (1836) */ -/* 1848 */ +/* 1848 */ 0x11, 0x0, /* FC_RP */ /* 1850 */ NdrFcShort( 0x2 ), /* Offset= 2 (1852) */ -/* 1852 */ +/* 1852 */ 0x21, /* FC_BOGUS_ARRAY */ 0x3, /* 3 */ /* 1854 */ NdrFcShort( 0x0 ), /* 0 */ @@ -13654,10 +13654,10 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = /* 1866 */ NdrFcShort( 0xfffff8c0 ), /* Offset= -1856 (10) */ /* 1868 */ 0x5c, /* FC_PAD */ 0x5b, /* FC_END */ -/* 1870 */ +/* 1870 */ 0x11, 0x0, /* FC_RP */ /* 1872 */ NdrFcShort( 0x2 ), /* Offset= 2 (1874) */ -/* 1874 */ +/* 1874 */ 0x1c, /* FC_CVARRAY */ 0x3, /* 3 */ /* 1876 */ NdrFcShort( 0x4 ), /* 4 */ @@ -13677,17 +13677,17 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = #endif /* 1886 */ 0x8, /* FC_LONG */ 0x5b, /* FC_END */ -/* 1888 */ +/* 1888 */ 0x11, 0x8, /* FC_RP [simple_pointer] */ /* 1890 */ 0x6, /* FC_SHORT */ 0x5c, /* FC_PAD */ -/* 1892 */ +/* 1892 */ 0x11, 0x4, /* FC_RP [alloced_on_stack] */ /* 1894 */ NdrFcShort( 0xfffff8c0 ), /* Offset= -1856 (38) */ -/* 1896 */ +/* 1896 */ 0x11, 0x14, /* FC_RP [alloced_on_stack] */ /* 1898 */ NdrFcShort( 0x2 ), /* Offset= 2 (1900) */ -/* 1900 */ +/* 1900 */ 0x2f, /* FC_IP */ 0x5c, /* FC_PAD */ /* 1902 */ 0x28, /* Corr desc: parameter, FC_LONG */ @@ -13702,7 +13702,7 @@ static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = } }; -static const CInterfaceProxyVtbl * const _oaidl_ProxyVtblList[] = +static const CInterfaceProxyVtbl * const _oaidl_ProxyVtblList[] = { ( const CInterfaceProxyVtbl *) &_IDispatchProxyVtbl, ( const CInterfaceProxyVtbl *) &_ITypeInfoProxyVtbl, @@ -13718,7 +13718,7 @@ static const CInterfaceProxyVtbl * const _oaidl_ProxyVtblList[] = 0 }; -static const CInterfaceStubVtbl * const _oaidl_StubVtblList[] = +static const CInterfaceStubVtbl * const _oaidl_StubVtblList[] = { ( const CInterfaceStubVtbl *) &_IDispatchStubVtbl, ( const CInterfaceStubVtbl *) &_ITypeInfoStubVtbl, @@ -13734,7 +13734,7 @@ static const CInterfaceStubVtbl * const _oaidl_StubVtblList[] = 0 }; -static const PCInterfaceName _oaidl_InterfaceNamesList[] = +static const PCInterfaceName _oaidl_InterfaceNamesList[] = { "IDispatch", "ITypeInfo", @@ -13762,16 +13762,16 @@ int __stdcall _oaidl_IID_Lookup( const IID * pIID, int * pIndex ) IID_BS_LOOKUP_NEXT_TEST( _oaidl, 2 ) IID_BS_LOOKUP_NEXT_TEST( _oaidl, 1 ) IID_BS_LOOKUP_RETURN_RESULT( _oaidl, 11, *pIndex ) - + } -const ExtendedProxyFileInfo oaidl_ProxyFileInfo = +const ExtendedProxyFileInfo oaidl_ProxyFileInfo = { (const PCInterfaceProxyVtblList *) & _oaidl_ProxyVtblList, (const PCInterfaceStubVtblList *) & _oaidl_StubVtblList, (const PCInterfaceName * ) & _oaidl_InterfaceNamesList, 0, /* no delegation */ - & _oaidl_IID_Lookup, + & _oaidl_IID_Lookup, 11, 1, 0, /* table of [async_uuid] interfaces */ diff --git a/reactos/dll/win32/oleaut32/oleaut32_Ko.rc b/reactos/dll/win32/oleaut32/oleaut32_Ko.rc index b3b5296df7f..43b60cd31b0 100644 --- a/reactos/dll/win32/oleaut32/oleaut32_Ko.rc +++ b/reactos/dll/win32/oleaut32/oleaut32_Ko.rc @@ -1,7 +1,7 @@ /* * Korean resources for oleaut32 * - * + * *Copyright 2005 YunSong Hwang(hys545@dreamwiz.com) * 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/reactos/dll/win32/oleaut32/oleaut32_Pl.rc b/reactos/dll/win32/oleaut32/oleaut32_Pl.rc index 8c250cbbb9f..03eccdab938 100644 --- a/reactos/dll/win32/oleaut32/oleaut32_Pl.rc +++ b/reactos/dll/win32/oleaut32/oleaut32_Pl.rc @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_POLISH, SUBLANG_DEFAULT +LANGUAGE LANG_POLISH, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE { diff --git a/reactos/dll/win32/oleaut32/olefont.c b/reactos/dll/win32/oleaut32/olefont.c index 3376c0cbc4b..6df60756d1d 100644 --- a/reactos/dll/win32/oleaut32/olefont.c +++ b/reactos/dll/win32/oleaut32/olefont.c @@ -1269,7 +1269,7 @@ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames( * OLEFontImpl_Invoke (IDispatch) * * See Windows documentation for more details on IDispatch methods. - * + * * Note: Do not call _put_Xxx methods, since setting things here * should not call notify functions as I found out debugging the generic * MS VB5 installer. @@ -2100,7 +2100,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Save( return E_FAIL; } -static const IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable = +static const IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable = { OLEFontImpl_IPersistPropertyBag_QueryInterface, OLEFontImpl_IPersistPropertyBag_AddRef, @@ -2178,7 +2178,7 @@ static HRESULT WINAPI OLEFontImpl_IPersistStreamInit_InitNew( return S_OK; } -static const IPersistStreamInitVtbl OLEFontImpl_IPersistStreamInit_VTable = +static const IPersistStreamInitVtbl OLEFontImpl_IPersistStreamInit_VTable = { OLEFontImpl_IPersistStreamInit_QueryInterface, OLEFontImpl_IPersistStreamInit_AddRef, diff --git a/reactos/dll/win32/oleaut32/olepicture.c b/reactos/dll/win32/oleaut32/olepicture.c index 01e766dd2b1..5c02df72564 100644 --- a/reactos/dll/win32/oleaut32/olepicture.c +++ b/reactos/dll/win32/oleaut32/olepicture.c @@ -655,10 +655,10 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, SetWindowExtEx(hdcMask, This->himetricWidth, This->himetricHeight, NULL); SetViewportOrgEx(hdcMask, 0, This->origHeight, NULL); SetViewportExtEx(hdcMask, This->origWidth, -This->origHeight, NULL); - - SetBkColor(hdc, RGB(255, 255, 255)); - SetTextColor(hdc, RGB(0, 0, 0)); - StretchBlt(hdc, x, y, cx, cy, hdcMask, xSrc, ySrc, cxSrc, cySrc, SRCAND); + + SetBkColor(hdc, RGB(255, 255, 255)); + SetTextColor(hdc, RGB(0, 0, 0)); + StretchBlt(hdc, x, y, cx, cy, hdcMask, xSrc, ySrc, cxSrc, cySrc, SRCAND); StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc, cxSrc, cySrc, SRCPAINT); SelectObject(hdcMask, hOldbm); @@ -1058,7 +1058,7 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr if (!cm) cm = gif->SColorMap; bmi = HeapAlloc(GetProcessHeap(),0,sizeof(BITMAPINFOHEADER)+(cm->ColorCount)*sizeof(RGBQUAD)); bytes= HeapAlloc(GetProcessHeap(),0,padding*gif->SHeight); - + /* look for the transparent color extension */ for (i = 0; i < si->ExtensionBlockCount; ++i) { eb = si->ExtensionBlocks + i; @@ -1133,7 +1133,7 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr /* Create the Mask */ HDC hdc = CreateCompatibleDC(0); HDC hdcMask = CreateCompatibleDC(0); - HBITMAP hOldbitmap; + HBITMAP hOldbitmap; HBITMAP hOldbitmapmask; unsigned int monopadding = (((unsigned)(gif->SWidth + 31)) >> 5) << 2; @@ -1192,7 +1192,7 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr SelectObject(hdc, This->hbmXor); SetBkColor(hdc, RGB(0,0,0)); SetTextColor(hdc, RGB(255,255,255)); - BitBlt(hdc, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, + BitBlt(hdc, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, hdcMask, 0, 0, SRCAND); SelectObject(hdc, hOldbitmap); @@ -1201,7 +1201,7 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr DeleteDC(hdc); DeleteObject(hTempMask); } - + DeleteDC(hdcref); This->desc.picType = PICTYPE_BITMAP; OLEPictureImpl_SetBitmap(This); @@ -1644,7 +1644,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) { WORD magic; STATSTG statstg; OLEPictureImpl *This = impl_from_IPersistStream(iface); - + TRACE("(%p,%p)\n",This,pStm); /**************************************************************************************** @@ -1682,9 +1682,9 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) { } headerread += xread; xread = 0; - + if (!memcmp(&(header[0]),"lt\0\0", 4) && (statfailed || (header[1] + headerread <= statstg.cbSize.QuadPart))) { - if (toread != 0 && toread != header[1]) + if (toread != 0 && toread != header[1]) FIXME("varying lengths of image data (prev=%u curr=%u), only last one will be used\n", toread, header[1]); toread = header[1]; @@ -1697,7 +1697,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) { (header[1]==0) ) {/* Found start of bitmap data */ headerisdata = TRUE; - if (toread == 0) + if (toread == 0) toread = statstg.cbSize.QuadPart-8; else toread -= 8; xread = 8; @@ -1951,7 +1951,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength) || (pInfoBitmap->bmiHeader.biBitCount == 24) || (pInfoBitmap->bmiHeader.biBitCount == 32 && pInfoBitmap->bmiHeader.biCompression == BI_RGB)) { iNumEntriesPalette = pInfoBitmap->bmiHeader.biClrUsed; - if (iNumEntriesPalette > 256) iNumEntriesPalette = 256; + if (iNumEntriesPalette > 256) iNumEntriesPalette = 256; } else if ((pInfoBitmap->bmiHeader.biBitCount == 16 || pInfoBitmap->bmiHeader.biBitCount == 32) && pInfoBitmap->bmiHeader.biCompression == BI_BITFIELDS) { iNumEntriesPalette = 3; @@ -2553,9 +2553,9 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, if (!ppvRet) return E_POINTER; - if (strncmpW(szURLorPath, file, 7) == 0) { + if (strncmpW(szURLorPath, file, 7) == 0) { szURLorPath += 7; - + hFile = CreateFileW(szURLorPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); if (hFile == INVALID_HANDLE_VALUE) @@ -2576,12 +2576,12 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, } } CloseHandle(hFile); - + if (!hGlobal) return E_UNEXPECTED; hRes = CreateStreamOnHGlobal(hGlobal, TRUE, &stream); - if (FAILED(hRes)) + if (FAILED(hRes)) { GlobalFree(hGlobal); return hRes; @@ -2591,11 +2591,11 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, IBindCtx *pbc; hRes = CreateBindCtx(0, &pbc); - if (SUCCEEDED(hRes)) + if (SUCCEEDED(hRes)) { hRes = CreateURLMoniker(NULL, szURLorPath, &pmnk); if (SUCCEEDED(hRes)) - { + { hRes = IMoniker_BindToStorage(pmnk, pbc, NULL, &IID_IStream, (LPVOID*)&stream); IMoniker_Release(pmnk); } @@ -2605,13 +2605,13 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, return hRes; } - hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER, + hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER, &IID_IPicture, (LPVOID*)&ipicture); if (hRes != S_OK) { IStream_Release(stream); return hRes; } - + hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream); if (hRes) { IStream_Release(stream); @@ -2619,7 +2619,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, return hRes; } - hRes = IPersistStream_Load(pStream, stream); + hRes = IPersistStream_Load(pStream, stream); IPersistStream_Release(pStream); IStream_Release(stream); @@ -2631,7 +2631,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, hRes = IPicture_QueryInterface(ipicture,riid,ppvRet); if (hRes) FIXME("Failed to get interface %s from IPicture.\n",debugstr_guid(riid)); - + IPicture_Release(ipicture); return hRes; } diff --git a/reactos/dll/win32/oleaut32/recinfo.c b/reactos/dll/win32/oleaut32/recinfo.c index 97a9545b19c..6f1c013d8a6 100644 --- a/reactos/dll/win32/oleaut32/recinfo.c +++ b/reactos/dll/win32/oleaut32/recinfo.c @@ -60,7 +60,7 @@ static HRESULT copy_to_variant(void *src, VARIANT *pvar, enum VARENUM vt) #define CASE_COPY(x) \ case VT_ ## x: \ V_ ## x(pvar) = *(typeof(V_ ## x(pvar))*)src; \ - break + break switch(vt) { CASE_COPY(I2); @@ -241,7 +241,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordClear(IRecordInfo *iface, PVOID pvEx break; } } - + return S_OK; } @@ -251,7 +251,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordCopy(IRecordInfo *iface, PVOID pvExi IRecordInfoImpl *This = (IRecordInfoImpl*)iface; TRACE("(%p)->(%p %p)\n", This, pvExisting, pvNew); - + if(!pvExisting || !pvNew) return E_INVALIDARG; @@ -288,12 +288,12 @@ static HRESULT WINAPI IRecordInfoImpl_GetName(IRecordInfo *iface, BSTR *pbstrNam static HRESULT WINAPI IRecordInfoImpl_GetSize(IRecordInfo *iface, ULONG *pcbSize) { IRecordInfoImpl *This = (IRecordInfoImpl*)iface; - + TRACE("(%p)->(%p)\n", This, pcbSize); if(!pcbSize) return E_INVALIDARG; - + *pcbSize = This->size; return S_OK; } @@ -329,7 +329,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetField(IRecordInfo *iface, PVOID pvData, break; if(i == This->n_vars) return TYPE_E_FIELDNOTFOUND; - + VariantClear(pvarField); return copy_to_variant(((PBYTE)pvData)+This->fields[i].offset, pvarField, This->fields[i].vt); @@ -427,7 +427,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetFieldNames(IRecordInfo *iface, ULONG *p for(i=0; ifields[i].name); } - + *pcNames = n; return S_OK; } @@ -459,7 +459,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordCreateCopy(IRecordInfo *iface, PVOID if(!pvSource || !ppvDest) return E_INVALIDARG; - + *ppvDest = IRecordInfo_RecordCreate(iface); return IRecordInfo_RecordCopy(iface, pvSource, *ppvDest); } @@ -511,7 +511,7 @@ HRESULT WINAPI GetRecordInfoFromGuids(REFGUID rGuidTypeLib, ULONG uVerMajor, ITypeInfo *pTypeInfo; ITypeLib *pTypeLib; HRESULT hres; - + TRACE("(%p,%d,%d,%d,%p,%p)\n", rGuidTypeLib, uVerMajor, uVerMinor, lcid, rGuidTypeInfo, ppRecInfo); @@ -548,7 +548,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo if(!pTI || !ppRecInfo) return E_INVALIDARG; - + hres = ITypeInfo_GetTypeAttr(pTI, &typeattr); if(FAILED(hres) || !typeattr) { WARN("GetTypeAttr failed: %08x\n", hres); @@ -614,7 +614,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo WARN("GetDocumentation failed: %08x\n", hres); ITypeInfo_ReleaseVarDesc(pTypeInfo, vardesc); } - + *ppRecInfo = (IRecordInfo*)ret; return S_OK; diff --git a/reactos/dll/win32/oleaut32/safearray.c b/reactos/dll/win32/oleaut32/safearray.c index 8b8072c3032..69e1ee36df6 100644 --- a/reactos/dll/win32/oleaut32/safearray.c +++ b/reactos/dll/win32/oleaut32/safearray.c @@ -449,7 +449,7 @@ HRESULT WINAPI SafeArrayAllocDescriptor(UINT cDims, SAFEARRAY **ppsaOut) LONG allocSize; TRACE("(%d,%p)\n", cDims, ppsaOut); - + if (!cDims || cDims >= 0x10000) /* Maximum 65535 dimensions */ return E_INVALIDARG; @@ -493,7 +493,7 @@ HRESULT WINAPI SafeArrayAllocDescriptorEx(VARTYPE vt, UINT cDims, SAFEARRAY **pp HRESULT hRet = E_UNEXPECTED; TRACE("(%d->%s,%d,%p)\n", vt, debugstr_vt(vt), cDims, ppsaOut); - + cbElements = SAFEARRAY_GetVTSize(vt); if (!cbElements) WARN("Creating a descriptor with an invalid VARTYPE!\n"); @@ -526,9 +526,9 @@ HRESULT WINAPI SafeArrayAllocDescriptorEx(VARTYPE vt, UINT cDims, SAFEARRAY **pp HRESULT WINAPI SafeArrayAllocData(SAFEARRAY *psa) { HRESULT hRet = E_INVALIDARG; - + TRACE("(%p)\n", psa); - + if (psa) { ULONG ulSize = SAFEARRAY_GetCellCount(psa); @@ -599,9 +599,9 @@ SAFEARRAY* WINAPI SafeArrayCreateEx(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsa ULONG ulSize = 0; IRecordInfo* iRecInfo = (IRecordInfo*)pvExtra; SAFEARRAY* psa; - + TRACE("(%d->%s,%d,%p,%p)\n", vt, debugstr_vt(vt), cDims, rgsabound, pvExtra); - + if (vt == VT_RECORD) { if (!iRecInfo) @@ -646,7 +646,7 @@ SAFEARRAY* WINAPI SafeArrayCreateEx(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsa SAFEARRAY* WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements) { TRACE("(%d->%s,%d,%d\n", vt, debugstr_vt(vt), lLbound, cElements); - + if (vt == VT_RECORD) return NULL; @@ -678,7 +678,7 @@ SAFEARRAY* WINAPI SafeArrayCreateVectorEx(VARTYPE vt, LONG lLbound, ULONG cEleme SAFEARRAY* psa; TRACE("(%d->%s,%d,%d,%p\n", vt, debugstr_vt(vt), lLbound, cElements, pvExtra); - + if (vt == VT_RECORD) { if (!iRecInfo) @@ -724,7 +724,7 @@ SAFEARRAY* WINAPI SafeArrayCreateVectorEx(VARTYPE vt, LONG lLbound, ULONG cEleme HRESULT WINAPI SafeArrayDestroyDescriptor(SAFEARRAY *psa) { TRACE("(%p)\n", psa); - + if (psa) { LPVOID lpv = (char*)psa - SAFEARRAY_HIDDEN_SIZE; @@ -767,7 +767,7 @@ HRESULT WINAPI SafeArrayLock(SAFEARRAY *psa) ULONG ulLocks; TRACE("(%p)\n", psa); - + if (!psa) return E_INVALIDARG; @@ -801,7 +801,7 @@ HRESULT WINAPI SafeArrayLock(SAFEARRAY *psa) HRESULT WINAPI SafeArrayUnlock(SAFEARRAY *psa) { TRACE("(%p)\n", psa); - + if (!psa) return E_INVALIDARG; @@ -918,7 +918,7 @@ HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData HRESULT hRet; TRACE("(%p,%p,%p)\n", psa, rgIndices, pvData); - + if (!psa || !rgIndices || !pvData) return E_INVALIDARG; @@ -994,7 +994,7 @@ HRESULT WINAPI SafeArrayGetElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound) { TRACE("(%p,%d,%p)\n", psa, nDim, plUbound); - + if (!psa || !plUbound) return E_INVALIDARG; @@ -1054,7 +1054,7 @@ HRESULT WINAPI SafeArrayGetLBound(SAFEARRAY *psa, UINT nDim, LONG *plLbound) */ UINT WINAPI SafeArrayGetDim(SAFEARRAY *psa) { - TRACE("(%p) returning %d\n", psa, psa ? psa->cDims : 0u); + TRACE("(%p) returning %d\n", psa, psa ? psa->cDims : 0u); return psa ? psa->cDims : 0; } @@ -1161,7 +1161,7 @@ HRESULT WINAPI SafeArrayPtrOfIndex(SAFEARRAY *psa, LONG *rgIndices, void **ppvDa LONG c1; TRACE("(%p,%p,%p)\n", psa, rgIndices, ppvData); - + /* The general formula for locating the cell number of an entry in an n * dimensional array (where cn = coordinate in dimension dn) is: * @@ -1218,7 +1218,7 @@ HRESULT WINAPI SafeArrayPtrOfIndex(SAFEARRAY *psa, LONG *rgIndices, void **ppvDa HRESULT WINAPI SafeArrayDestroyData(SAFEARRAY *psa) { TRACE("(%p)\n", psa); - + if (!psa) return E_INVALIDARG; @@ -1274,7 +1274,7 @@ HRESULT WINAPI SafeArrayCopyData(SAFEARRAY *psaSource, SAFEARRAY *psaTarget) int dim; TRACE("(%p,%p)\n", psaSource, psaTarget); - + if (!psaSource || !psaTarget || psaSource->cDims != psaTarget->cDims || psaSource->cbElements != psaTarget->cbElements) @@ -1387,7 +1387,7 @@ HRESULT WINAPI SafeArrayCopy(SAFEARRAY *psa, SAFEARRAY **ppsaOut) if ((*ppsaOut)->pvData) { hRet = SAFEARRAY_CopyData(psa, *ppsaOut); - + if (SUCCEEDED(hRet)) return hRet; @@ -1420,7 +1420,7 @@ HRESULT WINAPI SafeArrayRedim(SAFEARRAY *psa, SAFEARRAYBOUND *psabound) SAFEARRAYBOUND *oldBounds; TRACE("(%p,%p)\n", psa, psabound); - + if (!psa || psa->fFeatures & FADF_FIXEDSIZE || !psabound) return E_INVALIDARG; @@ -1534,7 +1534,7 @@ HRESULT WINAPI SafeArraySetRecordInfo(SAFEARRAY *psa, IRecordInfo *pRinfo) IRecordInfo** dest = (IRecordInfo**)psa; TRACE("(%p,%p)\n", psa, pRinfo); - + if (!psa || !(psa->fFeatures & FADF_RECORD)) return E_INVALIDARG; @@ -1659,7 +1659,7 @@ HRESULT WINAPI VectorFromBstr(BSTR bstr, SAFEARRAY **ppsa) SAFEARRAYBOUND sab; TRACE("(%p,%p)\n", bstr, ppsa); - + if (!ppsa) return E_INVALIDARG; diff --git a/reactos/dll/win32/oleaut32/tmarshal.c b/reactos/dll/win32/oleaut32/tmarshal.c index 1a30aa371b2..f2dce139d67 100644 --- a/reactos/dll/win32/oleaut32/tmarshal.c +++ b/reactos/dll/win32/oleaut32/tmarshal.c @@ -135,41 +135,41 @@ _unmarshal_interface(marshal_state *buf, REFIID riid, LPUNKNOWN *pUnk) { DWORD xsize; TRACE("...%s...\n",debugstr_guid(riid)); - + *pUnk = NULL; hres = xbuf_get(buf,(LPBYTE)&xsize,sizeof(xsize)); if (hres) { ERR("xbuf_get failed\n"); return hres; } - + if (xsize == 0) return S_OK; - + hres = CreateStreamOnHGlobal(0,TRUE,&pStm); if (hres) { ERR("Stream create failed %x\n",hres); return hres; } - + hres = IStream_Write(pStm,buf->base+buf->curoff,xsize,&res); if (hres) { ERR("stream write %x\n",hres); return hres; } - + memset(&seekto,0,sizeof(seekto)); hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos); if (hres) { ERR("Failed Seek %x\n",hres); return hres; } - + hres = CoUnmarshalInterface(pStm,riid,(LPVOID*)pUnk); if (hres) { ERR("Unmarshalling interface %s failed with %x\n",debugstr_guid(riid),hres); return hres; } - + IStream_Release(pStm); return xbuf_skip(buf,xsize); } @@ -199,25 +199,25 @@ _marshal_interface(marshal_state *buf, REFIID riid, LPUNKNOWN pUnk) { hres = E_FAIL; TRACE("...%s...\n",debugstr_guid(riid)); - + hres = CreateStreamOnHGlobal(0,TRUE,&pStm); if (hres) { ERR("Stream create failed %x\n",hres); goto fail; } - + hres = CoMarshalInterface(pStm,riid,pUnk,0,NULL,0); if (hres) { ERR("Marshalling interface %s failed with %x\n", debugstr_guid(riid), hres); goto fail; } - + hres = IStream_Stat(pStm,&ststg,0); if (hres) { ERR("Stream stat failed\n"); goto fail; } - + tempbuf = HeapAlloc(GetProcessHeap(), 0, ststg.cbSize.u.LowPart); memset(&seekto,0,sizeof(seekto)); hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos); @@ -225,22 +225,22 @@ _marshal_interface(marshal_state *buf, REFIID riid, LPUNKNOWN pUnk) { ERR("Failed Seek %x\n",hres); goto fail; } - + hres = IStream_Read(pStm,tempbuf,ststg.cbSize.u.LowPart,&res); if (hres) { ERR("Failed Read %x\n",hres); goto fail; } - + xsize = ststg.cbSize.u.LowPart; xbuf_add(buf,(LPBYTE)&xsize,sizeof(xsize)); hres = xbuf_add(buf,tempbuf,ststg.cbSize.u.LowPart); - + HeapFree(GetProcessHeap(),0,tempbuf); IStream_Release(pStm); - + return hres; - + fail: xsize = 0; xbuf_add(buf,(LPBYTE)&xsize,sizeof(xsize)); @@ -633,7 +633,7 @@ serialize_param( DWORD len; if (!*bstr) { /* -1 means "null string" which is equivalent to empty string */ - len = -1; + len = -1; hres = xbuf_add(buf, (LPBYTE)&len,sizeof(DWORD)); if (hres) return hres; } else { @@ -651,7 +651,7 @@ serialize_param( } return S_OK; } - + case VT_BSTR: { if (debugout) { if (*arg) @@ -1040,7 +1040,7 @@ deserialize_param( ITypeInfo_ReleaseTypeAttr(tinfo2, tattr); ITypeInfo_Release(tinfo2); } - /* read it in all cases, we need to know if we have + /* read it in all cases, we need to know if we have * NULL pointer or not. */ hres = xbuf_get(buf,(LPBYTE)&cookie,sizeof(cookie)); @@ -1892,7 +1892,7 @@ TMStubImpl_AddRef(LPRPCSTUBBUFFER iface) { TMStubImpl *This = (TMStubImpl *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - + TRACE("(%p)->(ref before=%u)\n", This, refCount - 1); return refCount; diff --git a/reactos/dll/win32/oleaut32/typelib.c b/reactos/dll/win32/oleaut32/typelib.c index b55599fba2d..0fe9b2a5504 100644 --- a/reactos/dll/win32/oleaut32/typelib.c +++ b/reactos/dll/win32/oleaut32/typelib.c @@ -3753,7 +3753,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType( ITypeLibImpl *This = (ITypeLibImpl *)iface; int i; ITypeInfoImpl *pTInfo = This->pTypeInfo; - + if ((ITypeLib2_fnGetTypeInfoCount(iface) < index + 1) || (index < 0)) return TYPE_E_ELEMENTNOTFOUND; @@ -4517,7 +4517,7 @@ static ULONG WINAPI ITypeInfo_fnRelease(ITypeInfo2 *iface) pCustDataNext = pCustData->next; TLB_Free(pCustData); } - if (HIWORD(pFInfo->Entry) != 0 && pFInfo->Entry != (BSTR)-1) + if (HIWORD(pFInfo->Entry) != 0 && pFInfo->Entry != (BSTR)-1) SysFreeString(pFInfo->Entry); SysFreeString(pFInfo->HelpString); SysFreeString(pFInfo->Name); @@ -4636,7 +4636,7 @@ static HRESULT TLB_CopyElemDesc( const ELEMDESC *src, ELEMDESC *dest, char **buf *buffer += sizeof(PARAMDESCEX); memcpy(pparamdescex_dest, pparamdescex_src, sizeof(PARAMDESCEX)); VariantInit(&pparamdescex_dest->varDefaultValue); - return VariantCopy(&pparamdescex_dest->varDefaultValue, + return VariantCopy(&pparamdescex_dest->varDefaultValue, (VARIANTARG *)&pparamdescex_src->varDefaultValue); } else @@ -4793,7 +4793,7 @@ static HRESULT ITypeInfoImpl_GetInternalDispatchFuncDesc( ITypeInfo *iface, *funcs = implemented_funcs + This->TypeAttr.cFuncs; else *hrefoffset = 0; - + if (index < implemented_funcs) return E_INVALIDARG; return ITypeInfoImpl_GetInternalFuncDesc(iface, index - implemented_funcs, @@ -5372,7 +5372,7 @@ static HRESULT typedescvt_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, tdesc = tdesc->u.lptdesc; /* munch VT_PTR -> VT_USERDEFINED(interface) into VT_UNKNOWN or - * VT_DISPATCH and VT_PTR -> VT_PTR -> VT_USERDEFINED(interface) into + * VT_DISPATCH and VT_PTR -> VT_PTR -> VT_USERDEFINED(interface) into * VT_BYREF|VT_DISPATCH or VT_BYREF|VT_UNKNOWN */ if ((tdesc->vt == VT_USERDEFINED) || ((tdesc->vt == VT_PTR) && (tdesc->u.lptdesc->vt == VT_USERDEFINED))) @@ -5385,7 +5385,7 @@ static HRESULT typedescvt_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, tdesc_userdefined = tdesc->u.lptdesc; } hr = userdefined_to_variantvt(tinfo, tdesc_userdefined, &vt_userdefined); - if ((hr == S_OK) && + if ((hr == S_OK) && (((vt_userdefined & VT_TYPEMASK) == VT_UNKNOWN) || ((vt_userdefined & VT_TYPEMASK) == VT_DISPATCH))) { @@ -5587,7 +5587,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( TRACE("invoking:\n"); dump_TLBFuncDescOne(pFuncInfo); } - + switch (func_desc->funckind) { case FUNC_PUREVIRTUAL: case FUNC_VIRTUAL: { @@ -5989,7 +5989,7 @@ func_fail: hres = ITypeInfo2_GetVarDesc(iface, var_index, &var_desc); if(FAILED(hres)) return hres; - + FIXME("varseek: Found memid, but variable-based invoking not supported\n"); dump_VARDESC(var_desc); ITypeInfo2_ReleaseVarDesc(iface, var_desc); @@ -6418,19 +6418,19 @@ static HRESULT WINAPI ITypeInfo_fnGetContainingTypeLib( ITypeInfo2 *iface, ITypeLib * *ppTLib, UINT *pIndex) { ITypeInfoImpl *This = (ITypeInfoImpl *)iface; - + /* If a pointer is null, we simply ignore it, the ATL in particular passes pIndex as 0 */ if (pIndex) { *pIndex=This->index; TRACE("returning pIndex=%d\n", *pIndex); } - + if (ppTLib) { *ppTLib=(LPTYPELIB )(This->pTypeLib); ITypeLib2_AddRef(*ppTLib); TRACE("returning ppTLib=%p\n", *ppTLib); } - + return S_OK; } diff --git a/reactos/dll/win32/oleaut32/typelib2.c b/reactos/dll/win32/oleaut32/typelib2.c index 874d8a8180f..f1a5dd16cb0 100644 --- a/reactos/dll/win32/oleaut32/typelib2.c +++ b/reactos/dll/win32/oleaut32/typelib2.c @@ -924,7 +924,7 @@ static int ctl2_encode_typedesc( if (typeoffset == This->typelib_segdir[MSFT_SEG_TYPEDESC].length) { int mix_field; - + if (target_type & 0x80000000) { mix_field = ((target_type >> 16) & 0x3fff) | VT_BYREF; } else { @@ -959,7 +959,7 @@ static int ctl2_encode_typedesc( if (typeoffset == This->typelib_segdir[MSFT_SEG_TYPEDESC].length) { int mix_field; - + if (target_type & 0x80000000) { mix_field = ((target_type >> 16) & VT_TYPEMASK) | VT_ARRAY; } else { @@ -1200,7 +1200,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface, REFGUI guidentry.next_hash = -1; offset = ctl2_alloc_guid(This->typelib, &guidentry); - + if (offset == -1) return E_OUTOFMEMORY; This->typeinfo->posguid = offset; @@ -1382,7 +1382,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc( FIXME("{%d,%p,%p,%d,%d,%d,%d,%d,%d,%d,{%d},%d}\n", pFuncDesc->memid, pFuncDesc->lprgscode, pFuncDesc->lprgelemdescParam, pFuncDesc->funckind, pFuncDesc->invkind, pFuncDesc->callconv, pFuncDesc->cParams, pFuncDesc->cParamsOpt, pFuncDesc->oVft, pFuncDesc->cScodes, pFuncDesc->elemdescFunc.tdesc.vt, pFuncDesc->wFuncFlags); /* FIXME("{%d, %d}\n", pFuncDesc->lprgelemdescParam[0].tdesc.vt, pFuncDesc->lprgelemdescParam[1].tdesc.vt); */ /* return E_OUTOFMEMORY; */ - + if (!This->typedata) { This->typedata = HeapAlloc(GetProcessHeap(), 0, 0x2000); This->typedata[0] = 0; @@ -1658,7 +1658,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc( This->datawidth += var_alignment - 1; This->datawidth &= ~(var_alignment - 1); typedata[4] = This->datawidth; - + /* add the new variable to the total data width */ This->datawidth += var_datawidth; @@ -2468,7 +2468,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetContainingTypeLib( ICreateTypeInfo2Impl *This = impl_from_ITypeInfo2(iface); TRACE("(%p,%p,%p)\n", iface, ppTLib, pIndex); - + *ppTLib = (ITypeLib *)&This->typelib->lpVtblTypeLib2; This->typelib->ref++; *pIndex = This->typeinfo->typekind >> 16; @@ -3135,7 +3135,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetGuid(ICreateTypeLib2 * iface, REFGUID guidentry.next_hash = -1; offset = ctl2_alloc_guid(This, &guidentry); - + if (offset == -1) return E_OUTOFMEMORY; This->typelib_header.posguid = offset; diff --git a/reactos/dll/win32/oleaut32/usrmarshal.c b/reactos/dll/win32/oleaut32/usrmarshal.c index 67faf2080c0..f78fbd96286 100644 --- a/reactos/dll/win32/oleaut32/usrmarshal.c +++ b/reactos/dll/win32/oleaut32/usrmarshal.c @@ -101,10 +101,10 @@ unsigned char * WINAPI CLEANLOCALSTORAGE_UserMarshal(ULONG *pFlags, unsigned cha ITypeLib_ReleaseTLibAttr((ITypeLib*)pstg->pInterface, *(TLIBATTR**)pstg->pStorage); break; case CLS_TYPEATTR: - ITypeInfo_ReleaseTypeAttr((ITypeInfo*)pstg->pInterface, *(TYPEATTR**)pstg->pStorage); + ITypeInfo_ReleaseTypeAttr((ITypeInfo*)pstg->pInterface, *(TYPEATTR**)pstg->pStorage); break; case CLS_FUNCDESC: - ITypeInfo_ReleaseFuncDesc((ITypeInfo*)pstg->pInterface, *(FUNCDESC**)pstg->pStorage); + ITypeInfo_ReleaseFuncDesc((ITypeInfo*)pstg->pInterface, *(FUNCDESC**)pstg->pStorage); break; case CLS_VARDESC: ITypeInfo_ReleaseVarDesc((ITypeInfo*)pstg->pInterface, *(VARDESC**)pstg->pStorage); @@ -183,7 +183,7 @@ unsigned char * WINAPI BSTR_UserUnmarshal(ULONG *pFlags, unsigned char *Buffer, header = (bstr_wire_t*)Buffer; if(header->len != header->len2) FIXME("len %08x != len2 %08x\n", header->len, header->len2); - + if(*pstr) { SysFreeString(*pstr); @@ -301,7 +301,7 @@ static ULONG wire_extra_user_size(ULONG *pFlags, ULONG Start, VARIANT *pvar) { if (V_ISBYREF(pvar)) return LPSAFEARRAY_UserSize(pFlags, Start, V_ARRAYREF(pvar)); - else + else return LPSAFEARRAY_UserSize(pFlags, Start, &V_ARRAY(pvar)); } @@ -335,17 +335,17 @@ static ULONG wire_extra_user_size(ULONG *pFlags, ULONG Start, VARIANT *pvar) /* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer. returns Buffer on failure, new position otherwise */ static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Buffer, REFIID riid, IUnknown *punk) { - IStream *working; + IStream *working; HGLOBAL working_mem; void *working_memlocked; unsigned char *oldpos; ULONG size; HRESULT hr; - + TRACE("pFlags=%d, Buffer=%p, pUnk=%p\n", *pFlags, Buffer, punk); oldpos = Buffer; - + /* CoMarshalInterface needs a stream, whereas at this level we are operating in terms of buffers. * We create a stream on an HGLOBAL, so we can simply do a memcpy to move it to the buffer. * in rpcrt4/ndr_ole.c, a simple IStream implementation is wrapped around the buffer object, @@ -353,7 +353,7 @@ static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Bu * code has no way to know how long the marshalled buffer is. */ size = interface_variant_size(pFlags, riid, punk); - + working_mem = GlobalAlloc(0, size); if (!working_mem) return oldpos; @@ -362,7 +362,7 @@ static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Bu GlobalFree(working_mem); return oldpos; } - + hr = CoMarshalInterface(working, riid, punk, LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL); if (hr != S_OK) { IStream_Release(working); /* this also releases the hglobal */ @@ -390,7 +390,7 @@ static unsigned char *interface_variant_unmarshal(ULONG *pFlags, unsigned char * unsigned char *oldpos; ULONG size; HRESULT hr; - + TRACE("pFlags=%d, Buffer=%p, ppUnk=%p\n", *pFlags, Buffer, ppunk); oldpos = Buffer; @@ -409,7 +409,7 @@ static unsigned char *interface_variant_unmarshal(ULONG *pFlags, unsigned char * } working_memlocked = GlobalLock(working_mem); - + /* now we copy the contents of the marshalling buffer to working_memlocked, unlock it, and demarshal the stream */ memcpy(working_memlocked, Buffer + sizeof(ULONG), size); GlobalUnlock(working_mem); @@ -463,7 +463,7 @@ unsigned char * WINAPI VARIANT_UserMarshal(ULONG *pFlags, unsigned char *Buffer, ALIGN_POINTER(Buffer, 7); - header = (variant_wire_t *)Buffer; + header = (variant_wire_t *)Buffer; header->clSize = 0; /* fixed up at the end */ header->rpcReserverd = 0; @@ -494,7 +494,7 @@ unsigned char * WINAPI VARIANT_UserMarshal(ULONG *pFlags, unsigned char *Buffer, *(DWORD*)Pos = 'U' | 's' << 8 | 'e' << 16 | 'r' << 24; Pos += 4; } - } + } else { if((header->vt & VT_TYPEMASK) == VT_DECIMAL) @@ -565,8 +565,8 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffe ALIGN_POINTER(Buffer, 7); VariantClear(pvar); - header = (variant_wire_t *)Buffer; - + header = (variant_wire_t *)Buffer; + pvar->n1.n2.vt = header->vt; pvar->n1.n2.wReserved1 = header->wReserved1; pvar->n1.n2.wReserved2 = header->wReserved2; @@ -581,7 +581,7 @@ unsigned char * WINAPI VARIANT_UserUnmarshal(ULONG *pFlags, unsigned char *Buffe { Pos += 4; pvar->n1.n2.n3.byref = CoTaskMemAlloc(type_size); - memcpy(pvar->n1.n2.n3.byref, Pos, type_size); + memcpy(pvar->n1.n2.n3.byref, Pos, type_size); if((header->vt & VT_TYPEMASK) != VT_VARIANT) Pos += type_size; else @@ -1686,7 +1686,7 @@ HRESULT CALLBACK ITypeInfo_GetContainingTypeLib_Proxy( HRESULT hr; TRACE("(%p, %p, %p)\n", This, ppTLib, pIndex ); - + hr = ITypeInfo_RemoteGetContainingTypeLib_Proxy(This, &pTL, &index); if(SUCCEEDED(hr)) { @@ -1812,7 +1812,7 @@ UINT CALLBACK ITypeLib_GetTypeInfoCount_Proxy( TRACE("(%p)\n", This); ITypeLib_RemoteGetTypeInfoCount_Proxy(This, &count); - + return count; } @@ -1836,7 +1836,7 @@ HRESULT CALLBACK ITypeLib_GetLibAttr_Proxy( stg.pStorage = NULL; stg.pInterface = NULL; - return ITypeLib_RemoteGetLibAttr_Proxy(This, ppTLibAttr, &stg); + return ITypeLib_RemoteGetLibAttr_Proxy(This, ppTLibAttr, &stg); } HRESULT __RPC_STUB ITypeLib_GetLibAttr_Stub( @@ -1846,7 +1846,7 @@ HRESULT __RPC_STUB ITypeLib_GetLibAttr_Stub( { HRESULT hr; TRACE("(%p, %p)\n", This, ppTLibAttr); - + hr = ITypeLib_GetLibAttr(This, ppTLibAttr); if(hr != S_OK) return hr; diff --git a/reactos/dll/win32/oleaut32/varformat.c b/reactos/dll/win32/oleaut32/varformat.c index 5faecd24ece..8c5c2668af0 100644 --- a/reactos/dll/win32/oleaut32/varformat.c +++ b/reactos/dll/win32/oleaut32/varformat.c @@ -1492,7 +1492,7 @@ VARIANT_FormatNumber_Bool: } if (localeValue) { - if (GetLocaleInfoW(lcid, localeValue, pBuff, + if (GetLocaleInfoW(lcid, localeValue, pBuff, sizeof(buff)/sizeof(WCHAR)-(pBuff-buff))) { TRACE("added %s\n", debugstr_w(pBuff)); diff --git a/reactos/dll/win32/oleaut32/variant.c b/reactos/dll/win32/oleaut32/variant.c index 0540e956eb2..1b99cc38213 100644 --- a/reactos/dll/win32/oleaut32/variant.c +++ b/reactos/dll/win32/oleaut32/variant.c @@ -1312,7 +1312,7 @@ HRESULT WINAPI VarDateFromUdateEx(UDATE *pUdateIn, LCID lcid, ULONG dwFlags, DAT if (lcid != MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)) FIXME("lcid possibly not handled, treating as en-us\n"); - + memcpy(&ud, pUdateIn, sizeof(ud)); if (dwFlags & VAR_VALIDDATE) @@ -1356,7 +1356,7 @@ HRESULT WINAPI VarDateFromUdateEx(UDATE *pUdateIn, LCID lcid, ULONG dwFlags, DAT HRESULT WINAPI VarDateFromUdate(UDATE *pUdateIn, ULONG dwFlags, DATE *pDateOut) { LCID lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); - + return VarDateFromUdateEx(pUdateIn, lcid, dwFlags, pDateOut); } @@ -2759,7 +2759,7 @@ HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags) VARTYPE breserv = V_VT(bstrv) & ~VT_TYPEMASK; VARTYPE nreserv = V_VT(nonbv) & ~VT_TYPEMASK; - if (!breserv && !nreserv) + if (!breserv && !nreserv) /* No VT_RESERVED set ==> BSTR always greater */ rc = VARCMP_GT; else if (breserv && !nreserv) { @@ -5164,7 +5164,7 @@ VarRound_Exit: /********************************************************************** * VarIdiv [OLEAUT32.153] * - * Converts input variants to integers and divides them. + * Converts input variants to integers and divides them. * * PARAMS * left [I] Left hand variant diff --git a/reactos/dll/win32/oleaut32/vartype.c b/reactos/dll/win32/oleaut32/vartype.c index f3da2819e7e..de4460c7058 100644 --- a/reactos/dll/win32/oleaut32/vartype.c +++ b/reactos/dll/win32/oleaut32/vartype.c @@ -4659,14 +4659,14 @@ static unsigned char VARIANT_int_divbychar(DWORD * p, unsigned int n, unsigned c unsigned char remainder = 0; ULONGLONG iTempDividend; signed int i; - + for (i = n - 1; i >= 0 && !p[i]; i--); /* skip leading zeros */ for (; i >= 0; i--) { iTempDividend = ((ULONGLONG)remainder << 32) + p[i]; remainder = iTempDividend % divisor; p[i] = iTempDividend / divisor; } - + return remainder; } } @@ -4706,17 +4706,17 @@ static int VARIANT_DI_mul(VARIANT_DI * a, VARIANT_DI * b, VARIANT_DI * result) result->sign = 0; } else { unsigned char remainder = 0; - int iA; + int iA; /* perform actual multiplication */ for (iA = 0; iA <= mulstart; iA++) { ULONG iOverflowMul; int iB; - + for (iOverflowMul = 0, iB = 0; iB < sizeof(b->bitsnum)/sizeof(DWORD); iB++) { ULONG iRV; int iR; - + iRV = VARIANT_Mul(b->bitsnum[iB], a->bitsnum[iA], &iOverflowMul); iR = iA + iB; do { @@ -4748,12 +4748,12 @@ static int VARIANT_DI_mul(VARIANT_DI * a, VARIANT_DI * b, VARIANT_DI * result) while (result->scale > 0 && !VARIANT_int_iszero( running + sizeof(result->bitsnum) / sizeof(DWORD), (sizeof(running) - sizeof(result->bitsnum)) / sizeof(DWORD))) { - + remainder = VARIANT_int_divbychar(running, sizeof(running) / sizeof(DWORD), 10); if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder); result->scale--; } - + /* round up the result - native oleaut32 does this */ if (remainder >= 5) { unsigned int i; @@ -4768,7 +4768,7 @@ static int VARIANT_DI_mul(VARIANT_DI * a, VARIANT_DI * b, VARIANT_DI * result) and copy result bits into result structure */ r_overflow = !VARIANT_int_iszero( - running + sizeof(result->bitsnum)/sizeof(DWORD), + running + sizeof(result->bitsnum)/sizeof(DWORD), (sizeof(running) - sizeof(result->bitsnum))/sizeof(DWORD)); memcpy(result->bitsnum, running, sizeof(result->bitsnum)); } @@ -4847,7 +4847,7 @@ static int VARIANT_DI_tostringW(VARIANT_DI * a, WCHAR * s, unsigned int n) } else { memmove(s + periodpos + 1, s + periodpos, (i + 1 - periodpos) * sizeof(WCHAR)); s[periodpos] = '.'; i++; - + /* remove extra zeros at the end, if any */ while (s[i - 1] == '0') s[--i] = '\0'; if (s[i - 1] == '.') s[--i] = '\0'; @@ -4863,14 +4863,14 @@ static void VARIANT_int_shiftleft(DWORD * p, unsigned int n, unsigned int shift) { DWORD shifted; unsigned int i; - + /* shift whole DWORDs to the left */ while (shift >= 32) { memmove(p + 1, p, (n - 1) * sizeof(DWORD)); *p = 0; shift -= 32; } - + /* shift remainder (1..31 bits) */ shifted = 0; if (shift > 0) for (i = 0; i < n; i++) @@ -4886,7 +4886,7 @@ static void VARIANT_int_shiftleft(DWORD * p, unsigned int n, unsigned int shift) Value at v is incremented by the value at p. Any size is supported, provided that v is not shorter than p. Any unapplied carry is returned as a result. */ -static unsigned char VARIANT_int_add(DWORD * v, unsigned int nv, DWORD * p, +static unsigned char VARIANT_int_add(DWORD * v, unsigned int nv, DWORD * p, unsigned int np) { unsigned char carry = 0; @@ -4912,11 +4912,11 @@ static unsigned char VARIANT_int_add(DWORD * v, unsigned int nv, DWORD * p, return carry; } -/* perform integral division with operand p as dividend. Parameter n indicates - number of available DWORDs in divisor p, but available space in p must be - actually at least 2 * n DWORDs, because the remainder of the integral - division is built in the next n DWORDs past the start of the quotient. This - routine replaces the dividend in p with the quotient, and appends n +/* perform integral division with operand p as dividend. Parameter n indicates + number of available DWORDs in divisor p, but available space in p must be + actually at least 2 * n DWORDs, because the remainder of the integral + division is built in the next n DWORDs past the start of the quotient. This + routine replaces the dividend in p with the quotient, and appends n additional DWORDs for the remainder. Thanks to Lee & Mark Atkinson for their book _Using_C_ (my very first book on @@ -4961,15 +4961,15 @@ static unsigned char VARIANT_int_mulbychar(DWORD * p, unsigned int n, unsigned c { unsigned int i; ULONG iOverflowMul; - + for (iOverflowMul = 0, i = 0; i < n; i++) p[i] = VARIANT_Mul(p[i], m, &iOverflowMul); return (unsigned char)iOverflowMul; } -/* increment value in A by the value indicated in B, with scale adjusting. - Modifies parameters by adjusting scales. Returns 0 if addition was - successful, nonzero if a parameter underflowed before it could be +/* increment value in A by the value indicated in B, with scale adjusting. + Modifies parameters by adjusting scales. Returns 0 if addition was + successful, nonzero if a parameter underflowed before it could be successfully used in the addition. */ static int VARIANT_int_addlossy( @@ -5511,14 +5511,14 @@ HRESULT WINAPI VarDecDiv(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECI if (di_result.scale > DEC_MAX_SCALE) { unsigned char remainder = 0; - + /* division underflowed. In order to comply with the MSDN specifications for DECIMAL ranges, some significant digits must be removed */ WARN("result scale is %u, scaling (with loss of significant digits)...\n", di_result.scale); - while (di_result.scale > DEC_MAX_SCALE && + while (di_result.scale > DEC_MAX_SCALE && !VARIANT_int_iszero(di_result.bitsnum, sizeof(di_result.bitsnum) / sizeof(DWORD))) { remainder = VARIANT_int_divbychar(di_result.bitsnum, sizeof(di_result.bitsnum) / sizeof(DWORD), 10); @@ -5583,7 +5583,7 @@ HRESULT WINAPI VarDecMul(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECI */ WARN("result scale is %u, scaling (with loss of significant digits)...\n", di_result.scale); - while (di_result.scale > DEC_MAX_SCALE && + while (di_result.scale > DEC_MAX_SCALE && !VARIANT_int_iszero(di_result.bitsnum, sizeof(di_result.bitsnum)/sizeof(DWORD))) { VARIANT_int_divbychar(di_result.bitsnum, sizeof(di_result.bitsnum)/sizeof(DWORD), 10); @@ -6348,8 +6348,8 @@ static BSTR VARIANT_BstrReplaceDecimal(WCHAR * buff, LCID lcid, ULONG dwFlags) WCHAR lpDecimalSep[16]; /* Native oleaut32 uses the locale-specific decimal separator even in the - absence of the LOCALE_USE_NLS flag. For example, the Spanish/Latin - American locales will see "one thousand and one tenth" as "1000,1" + absence of the LOCALE_USE_NLS flag. For example, the Spanish/Latin + American locales will see "one thousand and one tenth" as "1000,1" instead of "1000.1" (notice the comma). The following code checks for the need to replace the decimal separator, and if so, will prepare an appropriate NUMBERFMTW structure to do the job via GetNumberFormatW(). @@ -6789,7 +6789,7 @@ HRESULT WINAPI VarBstrFromDec(DECIMAL* pDecIn, LCID lcid, ULONG dwFlags, BSTR* p { *pbstrOut = VARIANT_BstrReplaceDecimal(buff, lcid, dwFlags); } - + TRACE("returning %s\n", debugstr_w(*pbstrOut)); return *pbstrOut ? S_OK : E_OUTOFMEMORY; } diff --git a/reactos/dll/win32/oledlg/insobjdlg.c b/reactos/dll/win32/oledlg/insobjdlg.c index 8ddf22756f8..e07c4e0f7b7 100644 --- a/reactos/dll/win32/oledlg/insobjdlg.c +++ b/reactos/dll/win32/oledlg/insobjdlg.c @@ -362,7 +362,7 @@ static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo* pdlgInfo) if (ERROR_SUCCESS == RegQueryValueA(hkey, "NotInsertable", keyname, &len)) continue; - RtlMultiByteToUnicodeN(wszclsid, MAX_PATH, NULL, szclsid, MAX_PATH); + RtlMultiByteToUnicodeN(wszclsid, MAX_PATH, NULL, szclsid, MAX_PATH); CLSIDFromString(wszclsid, &clsid); for (i = 0; i < pdlgInfo->lpOleUIInsertObject->cClsidExclude; i++) @@ -402,7 +402,7 @@ static void UIINSERTOBJECTDLG_FreeObjectTypes(InsertObjectDlgInfo* pdlgInfo) for (i = 0; i < count; i++) { - CLSID* lpclsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB, + CLSID* lpclsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETITEMDATA, (WPARAM)i, (LPARAM)0); HeapFree(GetProcessHeap(), 0, lpclsid); } @@ -450,7 +450,7 @@ static BOOL UIINSERTOBJECTDLG_OnOpen(InsertObjectDlgInfo* pdlgInfo) if (index >= 0) { - CLSID* clsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB, + CLSID* clsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETITEMDATA, (WPARAM)index, 0); memcpy(&pdlgInfo->lpOleUIInsertObject->clsid, clsid, sizeof(CLSID)); @@ -481,7 +481,7 @@ static BOOL UIINSERTOBJECTDLG_OnOpen(InsertObjectDlgInfo* pdlgInfo) SendMessageA(pdlgInfo->hwndFileTB, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)fname); lstrcpynA(pdlgInfo->lpOleUIInsertObject->lpszFile, fname, pdlgInfo->lpOleUIInsertObject->cchFile); - RtlMultiByteToUnicodeN(wcsFile, MAX_PATH, NULL, fname, MAX_PATH); + RtlMultiByteToUnicodeN(wcsFile, MAX_PATH, NULL, fname, MAX_PATH); if (ERROR_SUCCESS == (hres = GetClassFile(wcsFile, &pdlgInfo->lpOleUIInsertObject->clsid))) { if (pdlgInfo->lpOleUIInsertObject->dwFlags & IOF_CREATEFILEOBJECT) diff --git a/reactos/dll/win32/oledlg/oledlg_Cs.rc b/reactos/dll/win32/oledlg/oledlg_Cs.rc index 4271a762129..ad39eb70af1 100644 --- a/reactos/dll/win32/oledlg/oledlg_Cs.rc +++ b/reactos/dll/win32/oledlg/oledlg_Cs.rc @@ -35,7 +35,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Storno",IDCANCEL,221,24,66,14 GROUPBOX "Výsledek",IDC_RESULT,7,103,208,41 - CONTROL "Vytvoøit nový",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Vytvoøit nový",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Vytvoøit propojení",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -43,7 +43,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "Pøid&at propojení...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Zobrazit jako ikonu",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Zobrazit jako ikonu",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Procházet...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Soubor:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_De.rc b/reactos/dll/win32/oledlg/oledlg_De.rc index b2ae5faf43a..f2a32d8e6af 100644 --- a/reactos/dll/win32/oledlg/oledlg_De.rc +++ b/reactos/dll/win32/oledlg/oledlg_De.rc @@ -30,7 +30,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Abbrechen",IDCANCEL,221,24,66,14 GROUPBOX "Ergebnis",IDC_RESULT,7,103,208,41 - CONTROL "&Neu erstellen",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "&Neu erstellen",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "S&teuerung erstellen",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -38,7 +38,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "Steuerung hin&zufügen",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Als &Symbol anzeigen",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Als &Symbol anzeigen",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "D&urchsuchen...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Datei:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_En.rc b/reactos/dll/win32/oledlg/oledlg_En.rc index 5b89a252c52..a60e65d31ff 100644 --- a/reactos/dll/win32/oledlg/oledlg_En.rc +++ b/reactos/dll/win32/oledlg/oledlg_En.rc @@ -30,7 +30,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Cancel",IDCANCEL,221,24,66,14 GROUPBOX "Result",IDC_RESULT,7,103,208,41 - CONTROL "Create New",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Create New",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Create Control",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -38,7 +38,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Add Control...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Display As Icon",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Display As Icon",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Browse...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "File:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Es.rc b/reactos/dll/win32/oledlg/oledlg_Es.rc index 44d8d926e7f..9d488ad2615 100644 --- a/reactos/dll/win32/oledlg/oledlg_Es.rc +++ b/reactos/dll/win32/oledlg/oledlg_Es.rc @@ -30,7 +30,7 @@ BEGIN DEFPUSHBUTTON "Aceptar",IDOK,221,7,66,14 PUSHBUTTON "Cancelar",IDCANCEL,221,24,66,14 GROUPBOX "Resultado",IDC_RESULT,7,103,208,41 - CONTROL "Crear nuevo",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Crear nuevo",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Crear control",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -38,7 +38,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Añadir control...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Mostrar como icono",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Mostrar como icono",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Explorar...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Archivo:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Fr.rc b/reactos/dll/win32/oledlg/oledlg_Fr.rc index 41654cb75f4..9aaaccee18b 100644 --- a/reactos/dll/win32/oledlg/oledlg_Fr.rc +++ b/reactos/dll/win32/oledlg/oledlg_Fr.rc @@ -34,7 +34,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Annuler",IDCANCEL,221,24,66,14 GROUPBOX "Résultat",IDC_RESULT,7,103,208,41 - CONTROL "Créer nouveau",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Créer nouveau",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Créer le contrôle",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -42,7 +42,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Ajoute Contrôle...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Afficher comme icône",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Afficher comme icône",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Parcourir...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Fichier :",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Hu.rc b/reactos/dll/win32/oledlg/oledlg_Hu.rc index 58cc0882f2a..222059cabf5 100644 --- a/reactos/dll/win32/oledlg/oledlg_Hu.rc +++ b/reactos/dll/win32/oledlg/oledlg_Hu.rc @@ -30,7 +30,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Mégse",IDCANCEL,221,24,66,14 GROUPBOX "Eredmény",IDC_RESULT,7,103,208,41 - CONTROL "Új létrehozása",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Új létrehozása",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Vezérlõ létrehozása",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -38,7 +38,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "Vezérlõ hozzá&adása...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Megjelenítés ikonként",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Megjelenítés ikonként",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Tallóz...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Fájl:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Ja.rc b/reactos/dll/win32/oledlg/oledlg_Ja.rc index a412f7d86b2..621e0d35706 100644 --- a/reactos/dll/win32/oledlg/oledlg_Ja.rc +++ b/reactos/dll/win32/oledlg/oledlg_Ja.rc @@ -30,7 +30,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹",IDCANCEL,221,24,66,14 GROUPBOX "Œ‹‰Ê",IDC_RESULT,7,103,208,41 - CONTROL "V‹Kì¬",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "V‹Kì¬",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "ƒRƒ“ƒgƒ[ƒ‹‚ðì¬",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -38,7 +38,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "ƒRƒ“ƒgƒ[ƒ‹‚ð’ljÁ(&A)...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "ƒAƒCƒRƒ“‚Æ‚µ‚Ä•\Ž¦",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "ƒAƒCƒRƒ“‚Æ‚µ‚Ä•\Ž¦",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "ŽQÆ...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "ƒtƒ@ƒCƒ‹:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Ko.rc b/reactos/dll/win32/oledlg/oledlg_Ko.rc index 1182cbf5689..04bcbd2ce5f 100644 --- a/reactos/dll/win32/oledlg/oledlg_Ko.rc +++ b/reactos/dll/win32/oledlg/oledlg_Ko.rc @@ -30,7 +30,7 @@ BEGIN DEFPUSHBUTTON "È®ÀÎ",IDOK,221,7,66,14 PUSHBUTTON "Ãë¼Ò",IDCANCEL,221,24,66,14 GROUPBOX "°á°ú",IDC_RESULT,7,103,208,41 - CONTROL "»õ·Î ¸¸µé±â",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "»õ·Î ¸¸µé±â",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "ÄÁÆ®·Ñ ¸¸µé±â",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -38,7 +38,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "ÄÁÆ®·Ñ Ãß°¡(&A)...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "¾ÆÀÌÄÜÀ¸·Î º¸±â",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "¾ÆÀÌÄÜÀ¸·Î º¸±â",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "ã±â...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "ÆÄÀÏ:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Nl.rc b/reactos/dll/win32/oledlg/oledlg_Nl.rc index 62eb5d11e64..92f5a598681 100644 --- a/reactos/dll/win32/oledlg/oledlg_Nl.rc +++ b/reactos/dll/win32/oledlg/oledlg_Nl.rc @@ -31,7 +31,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Annuleren",IDCANCEL,221,24,66,14 GROUPBOX "Resultaat",IDC_RESULT,7,103,208,41 - CONTROL "Nieuw",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Nieuw",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Creëren",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -39,7 +39,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "Toevoegen...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Als pictogram weergeven",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Als pictogram weergeven",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Bladeren...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Bestandsnaam:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_No.rc b/reactos/dll/win32/oledlg/oledlg_No.rc index 2c9dff6a40d..4dce180cdd6 100644 --- a/reactos/dll/win32/oledlg/oledlg_No.rc +++ b/reactos/dll/win32/oledlg/oledlg_No.rc @@ -30,7 +30,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Avbryt",IDCANCEL,221,24,66,14 GROUPBOX "Resultat",IDC_RESULT,7,103,208,41 - CONTROL "Opprett ny",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Opprett ny",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Opprett kontroller",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -38,7 +38,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Legg til kontroller . . .",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Vis som ikon",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Vis som ikon",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Bla . . .",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Fil:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Pl.rc b/reactos/dll/win32/oledlg/oledlg_Pl.rc index 36aaaa4846b..3d6e11614cc 100644 --- a/reactos/dll/win32/oledlg/oledlg_Pl.rc +++ b/reactos/dll/win32/oledlg/oledlg_Pl.rc @@ -31,7 +31,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,229,7,66,14 PUSHBUTTON "Anuluj",IDCANCEL,229,24,66,14 GROUPBOX "Wynik",IDC_RESULT,7,103,208,41 - CONTROL "Utwórz nowy",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Utwórz nowy",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Utwórz kontrolkê",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,72,10 @@ -39,7 +39,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Dodaj kontrolkê...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Wyœwietlaj jako ikonê",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Wyœwietlaj jako ikonê",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,84,10 PUSHBUTTON "Przegl¹daj...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Plik:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Pt.rc b/reactos/dll/win32/oledlg/oledlg_Pt.rc index 69cd06a4629..b7e12068e48 100644 --- a/reactos/dll/win32/oledlg/oledlg_Pt.rc +++ b/reactos/dll/win32/oledlg/oledlg_Pt.rc @@ -31,7 +31,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Cancelar",IDCANCEL,221,24,66,14 GROUPBOX "Resultado",IDC_RESULT,7,103,208,41 - CONTROL "Criar novo",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Criar novo",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Criar controle",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -39,7 +39,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Adicionar Controle...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Mostrar como ícone",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Mostrar como ícone",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Procurar...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Arquivo:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Tr.rc b/reactos/dll/win32/oledlg/oledlg_Tr.rc index 8a96fe43220..b353926fbea 100644 --- a/reactos/dll/win32/oledlg/oledlg_Tr.rc +++ b/reactos/dll/win32/oledlg/oledlg_Tr.rc @@ -32,7 +32,7 @@ BEGIN DEFPUSHBUTTON "Tamam",IDOK,221,7,66,14 PUSHBUTTON "Ýptal",IDCANCEL,221,24,66,14 GROUPBOX "Sonuç",IDC_RESULT,7,103,208,41 - CONTROL "Yeni Oluþtur",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Yeni Oluþtur",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Denetim Oluþtur",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -40,7 +40,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Denetim Ekle...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Simge Olarak Göster",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Simge Olarak Göster",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Gözat...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Dosya:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/oledlg/oledlg_Uk.rc b/reactos/dll/win32/oledlg/oledlg_Uk.rc index fcc3cc660c2..99a4a1fd4b0 100644 --- a/reactos/dll/win32/oledlg/oledlg_Uk.rc +++ b/reactos/dll/win32/oledlg/oledlg_Uk.rc @@ -20,7 +20,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,221,7,66,14 PUSHBUTTON "Ñêàñóâàòè",IDCANCEL,221,24,66,14 GROUPBOX "Ðåçóëüòàò",IDC_RESULT,7,103,208,41 - CONTROL "Ñòâîðèòè íîâèé",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | + CONTROL "Ñòâîðèòè íîâèé",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,20,62,10 CONTROL "Ñòâîðèòè åëåìåíò óïðàâë³ííÿ",IDC_CREATECONTROL,"Button", BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10 @@ -28,7 +28,7 @@ BEGIN BS_AUTORADIOBUTTON,7,37,67,10 LTEXT "",IDC_RESULTDESC,49,112,159,23 PUSHBUTTON "&Äîäàòè åëåìåíò óïðàâë³ííÿ...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE - CONTROL "Ó âèãëÿä³ çíà÷êà",IDC_ASICON,"Button",BS_AUTOCHECKBOX | + CONTROL "Ó âèãëÿä³ çíà÷êà",IDC_ASICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10 PUSHBUTTON "Îãëÿä...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE LTEXT "Ôàéë:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE diff --git a/reactos/dll/win32/opengl32/gl.c b/reactos/dll/win32/opengl32/gl.c index dfb0c82c1e8..51c5c2770b4 100644 --- a/reactos/dll/win32/opengl32/gl.c +++ b/reactos/dll/win32/opengl32/gl.c @@ -68,7 +68,7 @@ __asm__(".align 4" "\n\t" \ " movl %fs:0x18, %eax" "\n\t" \ " movl 0xbe8(%eax), %eax" "\n\t" \ " jmp *"FOO((icdidx*4))"(%eax)" "\n\t"); - + GLFUNCS_MACRO # undef FOO # undef X diff --git a/reactos/dll/win32/opengl32/opengl32.c b/reactos/dll/win32/opengl32/opengl32.c index 1125c870a6c..e9a6e3e398e 100644 --- a/reactos/dll/win32/opengl32/opengl32.c +++ b/reactos/dll/win32/opengl32/opengl32.c @@ -71,7 +71,7 @@ OPENGL32_ThreadAttach() teb->glTable = dispatchTable; TlsSetValue( OPENGL32_tls, lpData ); - + return TRUE; } @@ -542,7 +542,7 @@ OPENGL32_UnloadICD( GLDRIVERDATA *icd ) * Output is length of the drivername. * Can be NULL if name is NULL. * - * \return Error code + * \return Error code * \retval ERROR_NO_MORE_ITEMS End of driver list. * \retval ERROR_SUCCESS Success. */ @@ -593,7 +593,7 @@ OPENGL32_RegEnumDrivers( DWORD idx, LPWSTR name, LPDWORD cName ) * \param driver Name of the driver to get information about. * \param icd Pointer to GLDRIVERDATA. * - * \return Error code. + * \return Error code. * \retval ERROR_SUCCESS Success. * * \note On success the following fields of \a icd are filled: \a driver_name, diff --git a/reactos/dll/win32/packet/Packet32.c b/reactos/dll/win32/packet/Packet32.c index d8f48970749..1e2531cc870 100644 --- a/reactos/dll/win32/packet/Packet32.c +++ b/reactos/dll/win32/packet/Packet32.c @@ -55,7 +55,7 @@ TCHAR szWindowTitle[] = TEXT("PACKET.DLL"); #else #ifdef _DEBUG_TO_FILE #include -/*! +/*! \brief Macro to print a debug string. The behavior differs depending on the debug level */ #define ODS(_x) { \ @@ -64,8 +64,8 @@ TCHAR szWindowTitle[] = TEXT("PACKET.DLL"); fprintf(f, "%s", _x); \ fclose(f); \ } -/*! - \brief Macro to print debug data with the printf convention. The behavior differs depending on +/*! + \brief Macro to print debug data with the printf convention. The behavior differs depending on the debug level */ #define ODSEx(_x, _y) { \ @@ -77,7 +77,7 @@ TCHAR szWindowTitle[] = TEXT("PACKET.DLL"); LONG PacketDumpRegistryKey(PCHAR KeyName, PCHAR FileName); #else -#define ODS(_x) +#define ODS(_x) #define ODSEx(_x, _y) #endif #endif @@ -93,7 +93,7 @@ LPCTSTR NPFRegistryLocation = TEXT("SYSTEM\\ControlSet001\\Services\\NPF"); //--------------------------------------------------------------------------- -/*! +/*! \brief The main dll function. */ @@ -104,9 +104,9 @@ BOOL APIENTRY DllMain (HANDLE DllHandle,DWORD Reason,LPVOID lpReserved) switch ( Reason ) { case DLL_PROCESS_ATTACH: - + ODS("\n************Packet32: DllMain************\n"); - + #ifdef _DEBUG_TO_FILE // dump a bunch of registry keys useful for debug to file PacketDumpRegistryKey("HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}", @@ -130,7 +130,7 @@ BOOL APIENTRY DllMain (HANDLE DllHandle,DWORD Reason,LPVOID lpReserved) return Status; } -/*! +/*! \brief Converts an ASCII string to UNICODE. Uses the MultiByteToWideChar() system function. \param string The string to convert. \return The converted string. @@ -146,7 +146,7 @@ WCHAR* SChar2WChar(char* string) return TmpStr; } -/*! +/*! \brief Sets the maximum possible lookahead buffer for the driver's Packet_tap() function. \param AdapterObject Handle to the service control manager. \return If the function succeeds, the return value is nonzero. @@ -177,8 +177,8 @@ BOOLEAN PacketSetMaxLookaheadsize (LPADAPTER AdapterObject) return Status; } -/*! - \brief Retrieves the event associated in the driver with a capture instance and stores it in an +/*! + \brief Retrieves the event associated in the driver with a capture instance and stores it in an _ADAPTER structure. \param AdapterObject Handle to the service control manager. \return If the function succeeds, the return value is nonzero. @@ -210,13 +210,13 @@ BOOLEAN PacketSetReadEvt(LPADAPTER AdapterObject) if(GetLastError()!=ERROR_ALREADY_EXISTS){ if(AdapterObject->ReadEvent != NULL) CloseHandle(AdapterObject->ReadEvent); - + // open the shared event AdapterObject->ReadEvent=CreateEventW(NULL, TRUE, FALSE, EventName+7); - } + } if(AdapterObject->ReadEvent==NULL || GetLastError()!=ERROR_ALREADY_EXISTS){ ODS("PacketSetReadEvt: error retrieving the event from the kernel\n"); @@ -229,7 +229,7 @@ BOOLEAN PacketSetReadEvt(LPADAPTER AdapterObject) } -/*! +/*! \brief Installs the NPF device driver. \param ascmHandle Handle to the service control manager. \param ascmHandle A pointer to a handle that will receive the pointer to the driver's service. @@ -243,11 +243,11 @@ BOOL PacketInstallDriver(SC_HANDLE ascmHandle, SC_HANDLE* srvHandle, TCHAR* driv { BOOL result = FALSE; ULONG err; - + ODS("installdriver\n"); - + if (GetFileAttributes(driverPath) != 0xffffffff) { - *srvHandle = CreateService(ascmHandle, + *srvHandle = CreateService(ascmHandle, NPFServiceName, NPFServiceDesc, SERVICE_ALL_ACCESS, @@ -279,10 +279,10 @@ BOOL PacketInstallDriver(SC_HANDLE ascmHandle, SC_HANDLE* srvHandle, TCHAR* driv } } return result; - + } -/*! +/*! \brief Convert a Unicode dotted-quad to a 32-bit IP address. \param cp A string containing the address. \return the converted 32-bit numeric address. @@ -306,20 +306,20 @@ ULONG inet_addrU(const WCHAR *cp) part = part*10 + (c - '0'); } if (part > 255) - return -1; + return -1; val = val | (part << i*8); if (i == 3) { if (c != '\0') - return -1; // extra gunk at end of string + return -1; // extra gunk at end of string } else { if (c == '\0') - return -1; // string ends early + return -1; // string ends early } } return val; } -/*! +/*! \brief Dumps a registry key to disk in text format. Uses regedit. \param KeyName Name of the ket to dump. All its subkeys will be saved recursively. \param FileName Name of the file that will contain the dump. @@ -359,9 +359,9 @@ LONG PacketDumpRegistryKey(PCHAR KeyName, PCHAR FileName) */ /// Current packet.dll Version. It can be retrieved directly or through the PacketGetVersion() function. -char PacketLibraryVersion[] = "2.3"; +char PacketLibraryVersion[] = "2.3"; -/*! +/*! \brief Returns a string with the dll version. \return A char pointer to the version of the library. */ @@ -369,7 +369,7 @@ PCHAR PacketGetVersion(){ return PacketLibraryVersion; } -/*! +/*! \brief Returns information about the MAC type of an adapter. \param AdapterObject The adapter on which information is needed. \param type Pointer to a NetType structure that will be filled by the function. @@ -378,12 +378,12 @@ PCHAR PacketGetVersion(){ This function return the link layer technology and the speed (in bps) of an opened adapter. The LinkType field of the type parameter can have one of the following values: - - NdisMedium802_3: Ethernet (802.3) - - NdisMediumWan: WAN - - NdisMedium802_5: Token Ring (802.5) - - NdisMediumFddi: FDDI - - NdisMediumAtm: ATM - - NdisMediumArcnet878_2: ARCNET (878.2) + - NdisMedium802_3: Ethernet (802.3) + - NdisMediumWan: WAN + - NdisMedium802_5: Token Ring (802.5) + - NdisMediumFddi: FDDI + - NdisMediumAtm: ATM + - NdisMediumArcnet878_2: ARCNET (878.2) */ BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type) { @@ -415,12 +415,12 @@ BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type) return Status; } -/*! +/*! \brief Stops and unloads the WinPcap device driver. \return If the function succeeds, the return value is nonzero, otherwise it is zero. This function can be used to unload the driver from memory when the application no more needs it. - Note that the driver is physically stopped and unloaded only when all the files on its devices + Note that the driver is physically stopped and unloaded only when all the files on its devices are closed, i.e. when all the applications that use WinPcap close all their adapters. */ BOOL PacketStopDriver() @@ -431,17 +431,17 @@ BOOL PacketStopDriver() SERVICE_STATUS serviceStatus; scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - + if(scmHandle != NULL){ - + schService = OpenService (scmHandle, NPFServiceName, SERVICE_ALL_ACCESS ); - + if (schService != NULL) { - + ret = ControlService (schService, SERVICE_CONTROL_STOP, &serviceStatus @@ -449,39 +449,39 @@ BOOL PacketStopDriver() if (!ret) { } - + CloseServiceHandle (schService); - + CloseServiceHandle(scmHandle); - + return ret; } } - + return FALSE; } -/*! +/*! \brief Opens an adapter. - \param AdapterName A string containing the name of the device to open. + \param AdapterName A string containing the name of the device to open. Use the PacketGetAdapterNames() function to retrieve the list of available devices. \return If the function succeeds, the return value is the pointer to a properly initialized ADAPTER object, otherwise the return value is NULL. - This function tries to load and start the packet driver at the first invocation. In this way, + This function tries to load and start the packet driver at the first invocation. In this way, the management of the driver is transparent to the application, that simply needs to open an adapter to start WinPcap. - - \note the Windows 95 version of the NPF driver works with the ASCII string format, while the Windows NT - version works with UNICODE. Therefore, AdapterName \b should be an ASCII string in Windows 95, and a UNICODE - string in Windows NT. This difference is not a problem if the string pointed by AdapterName was obtained + + \note the Windows 95 version of the NPF driver works with the ASCII string format, while the Windows NT + version works with UNICODE. Therefore, AdapterName \b should be an ASCII string in Windows 95, and a UNICODE + string in Windows NT. This difference is not a problem if the string pointed by AdapterName was obtained through the PacketGetAdapterNames function, because it returns the names of the adapters in the proper format. - Problems can arise in Windows NT when the string is obtained from ANSI C functions like scanf, because they - use the ASCII format. Since this could be a relevant problem during the porting of command-line applications + Problems can arise in Windows NT when the string is obtained from ANSI C functions like scanf, because they + use the ASCII format. Since this could be a relevant problem during the porting of command-line applications from UNIX, we included in the Windows NT version of PacketOpenAdapter the ability to detect ASCII strings and - convert them to UNICODE before sending them to the device driver. Therefore PacketOpenAdapter in Windows NT - accepts both the ASCII and the UNICODE format. If a ASCII string is received, it is converted to UNICODE + convert them to UNICODE before sending them to the device driver. Therefore PacketOpenAdapter in Windows NT + accepts both the ASCII and the UNICODE format. If a ASCII string is received, it is converted to UNICODE by PACKET.DLL before being passed to the driver. */ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) @@ -510,7 +510,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) *driverPath = 0; GetCurrentDirectory(512, driverPath); wsprintf(driverPath + wcslen(driverPath), NPFDriverName); - + // check if the NPF registry key is already present // this means that the driver is already installed and that we don't need to call PacketInstallDriver KeyRes=RegOpenKeyEx(HKEY_LOCAL_MACHINE, @@ -518,25 +518,25 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) 0, KEY_READ, &PathKey); - + if(KeyRes != ERROR_SUCCESS){ Result = PacketInstallDriver(scmHandle,&svcHandle,driverPath); } else { Result = TRUE; RegCloseKey(PathKey); } - + if (Result) { - + srvHandle = OpenService(scmHandle, NPFServiceName, SERVICE_START | SERVICE_QUERY_STATUS ); if (srvHandle != NULL){ - + QuerySStat = QueryServiceStatus(srvHandle, &SStat); ODSEx("The status of the driver is:%d\n",SStat.dwCurrentState); - + if (!QuerySStat || SStat.dwCurrentState != SERVICE_RUNNING){ ODS("Calling startservice\n"); - if (StartService(srvHandle, 0, NULL)==0){ + if (StartService(srvHandle, 0, NULL)==0){ error = GetLastError(); if (error!=ERROR_SERVICE_ALREADY_RUNNING && error!=ERROR_ALREADY_EXISTS){ SetLastError(error); @@ -545,7 +545,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) ODSEx("PacketOpenAdapter: StartService failed, Error=%d\n",error); return NULL; } - } + } } } else { error = GetLastError(); @@ -556,7 +556,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) return FALSE; } wsprintf(driverPath, TEXT("%s\\drivers%s"), WinPath, NPFDriverName); - + if (KeyRes != ERROR_SUCCESS) { Result = PacketInstallDriver(scmHandle,&svcHandle,driverPath); } else { @@ -569,7 +569,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) ODSEx("The status of the driver is:%d\n",SStat.dwCurrentState); if (!QuerySStat || SStat.dwCurrentState != SERVICE_RUNNING) { ODS("Calling startservice\n"); - if (StartService(srvHandle, 0, NULL) == 0) { + if (StartService(srvHandle, 0, NULL) == 0) { error = GetLastError(); if (error != ERROR_SERVICE_ALREADY_RUNNING && error!=ERROR_ALREADY_EXISTS) { SetLastError(error); @@ -595,7 +595,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) } else { // Unicode AdapterNameU = NULL; } - + lpAdapter = (LPADAPTER)GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT,sizeof(ADAPTER)); if (lpAdapter == NULL) { ODS("PacketOpenAdapter: GlobalAlloc Failed\n"); @@ -609,7 +609,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) lpAdapter->NumWrites = 1; wsprintf(SymbolicLink,TEXT("\\\\.\\%s%s"), DOSNAMEPREFIX, &AdapterName[8]); - + // Copy only the bytes that fit in the adapter structure. // Note that lpAdapter->SymbolicLink is present for backward compatibility but will // never be used by the apps @@ -617,7 +617,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) //try if it is possible to open the adapter immediately lpAdapter->hFile = CreateFile(SymbolicLink,GENERIC_WRITE | GENERIC_READ,0,NULL,OPEN_EXISTING,0,0); - + if (lpAdapter->hFile != INVALID_HANDLE_VALUE) { ODSEx("PacketOpenAdapter: CreateFile(%S) successfull\n", SymbolicLink); if (PacketSetReadEvt(lpAdapter) == FALSE) { @@ -630,14 +630,14 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) SetLastError(error); ODSEx("PacketOpenAdapter: PacketSetReadEvt failed, Error=%d\n",error); return NULL; - } - + } + PacketSetMaxLookaheadsize(lpAdapter); if (AdapterNameU != NULL) free(AdapterNameU); return lpAdapter; } - //this is probably the first request on the packet driver. + //this is probably the first request on the packet driver. //We must create the dos device and set the access rights on it else { Result = DefineDosDevice(DDD_RAW_TARGET_PATH, @@ -646,11 +646,11 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) if (Result) { ODSEx("PacketOpenAdapter: calling CreateFile(%S)\n", SymbolicLink); - + lpAdapter->hFile = CreateFile( SymbolicLink, GENERIC_WRITE | GENERIC_READ,0,NULL,OPEN_EXISTING,0,0); - if (lpAdapter->hFile != INVALID_HANDLE_VALUE) { + if (lpAdapter->hFile != INVALID_HANDLE_VALUE) { if (PacketSetReadEvt(lpAdapter) == FALSE) { error = GetLastError(); ODS("PacketOpenAdapter: Unable to open the read event\n"); @@ -660,7 +660,7 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) //set the error to the one on which we failed SetLastError(error); ODSEx("PacketOpenAdapter: PacketSetReadEvt failed, Error=1,%d\n",error); - return NULL; + return NULL; } PacketSetMaxLookaheadsize(lpAdapter); if (AdapterNameU != NULL) @@ -684,9 +684,9 @@ LPADAPTER PacketOpenAdapter(LPTSTR AdapterName) } -/*! +/*! \brief Closes an adapter. - \param lpAdapter the pointer to the adapter to close. + \param lpAdapter the pointer to the adapter to close. PacketCloseAdapter closes the given adapter and frees the associated ADAPTER structure */ @@ -698,16 +698,16 @@ VOID PacketCloseAdapter(LPADAPTER lpAdapter) GlobalFreePtr(lpAdapter); } -/*! +/*! \brief Allocates a _PACKET structure. - \return On succeess, the return value is the pointer to a _PACKET structure otherwise the + \return On succeess, the return value is the pointer to a _PACKET structure otherwise the return value is NULL. The structure returned will be passed to the PacketReceivePacket() function to receive the packets from the driver. - \warning The Buffer field of the _PACKET structure is not set by this function. - The buffer \b must be allocated by the application, and associated to the PACKET structure + \warning The Buffer field of the _PACKET structure is not set by this function. + The buffer \b must be allocated by the application, and associated to the PACKET structure with a call to PacketInitPacket. */ LPPACKET PacketAllocatePacket(void) @@ -722,11 +722,11 @@ LPPACKET PacketAllocatePacket(void) return lpPacket; } -/*! +/*! \brief Frees a _PACKET structure. - \param lpPacket The structure to free. + \param lpPacket The structure to free. - \warning the user-allocated buffer associated with the _PACKET structure is not deallocated + \warning the user-allocated buffer associated with the _PACKET structure is not deallocated by this function and \b must be explicitly deallocated by the programmer. */ @@ -735,19 +735,19 @@ VOID PacketFreePacket(LPPACKET lpPacket) GlobalFreePtr(lpPacket); } -/*! +/*! \brief Initializes a _PACKET structure. - \param lpPacket The structure to initialize. + \param lpPacket The structure to initialize. \param Buffer A pointer to a user-allocated buffer that will contain the captured data. - \param Length the length of the buffer. This is the maximum buffer size that will be + \param Length the length of the buffer. This is the maximum buffer size that will be transferred from the driver to the application using a single read. - \note the size of the buffer associated with the PACKET structure is a parameter that can sensibly + \note the size of the buffer associated with the PACKET structure is a parameter that can sensibly influence the performance of the capture process, since this buffer will contain the packets received - from the the driver. The driver is able to return several packets using a single read call - (see the PacketReceivePacket() function for details), and the number of packets transferable to the + from the the driver. The driver is able to return several packets using a single read call + (see the PacketReceivePacket() function for details), and the number of packets transferable to the application in a call is limited only by the size of the buffer associated with the PACKET structure - passed to PacketReceivePacket(). Therefore setting a big buffer with PacketInitPacket can noticeably + passed to PacketReceivePacket(). Therefore setting a big buffer with PacketInitPacket can noticeably decrease the number of system calls, reducing the impcat of the capture process on the processor. */ @@ -759,33 +759,33 @@ VOID PacketInitPacket(LPPACKET lpPacket,PVOID Buffer,UINT Length) lpPacket->bIoComplete = FALSE; } -/*! +/*! \brief Read data (packets or statistics) from the NPF driver. - \param AdapterObject Pointer to an _ADAPTER structure identifying the network adapter from which + \param AdapterObject Pointer to an _ADAPTER structure identifying the network adapter from which the data is received. \param lpPacket Pointer to a PACKET structure that will contain the data. - \param Sync This parameter is deprecated and will be ignored. It is present for compatibility with + \param Sync This parameter is deprecated and will be ignored. It is present for compatibility with older applications. \return If the function succeeds, the return value is nonzero. - The data received with this function can be a group of packets or a static on the network traffic, - depending on the working mode of the driver. The working mode can be set with the PacketSetMode() - function. Give a look at that function if you are interested in the format used to return statistics + The data received with this function can be a group of packets or a static on the network traffic, + depending on the working mode of the driver. The working mode can be set with the PacketSetMode() + function. Give a look at that function if you are interested in the format used to return statistics values, here only the normal capture mode will be described. - The number of packets received with this function is variable. It depends on the number of packets - currently stored in the driver’s buffer, on the size of these packets and on the size of the buffer - associated to the lpPacket parameter. The following figure shows the format used by the driver to pass - packets to the application. + The number of packets received with this function is variable. It depends on the number of packets + currently stored in the driver’s buffer, on the size of these packets and on the size of the buffer + associated to the lpPacket parameter. The following figure shows the format used by the driver to pass + packets to the application. \image html encoding.gif "method used to encode the packets" Packets are stored in the buffer associated with the lpPacket _PACKET structure. The Length field of that structure is updated with the amount of data copied in the buffer. Each packet has a header - consisting in a bpf_hdr structure that defines its length and contains its timestamp. A padding field - is used to word-align the data in the buffer (to speed up the access to the packets). The bh_datalen - and bh_hdrlen fields of the bpf_hdr structures should be used to extract the packets from the buffer. - + consisting in a bpf_hdr structure that defines its length and contains its timestamp. A padding field + is used to word-align the data in the buffer (to speed up the access to the packets). The bh_datalen + and bh_hdrlen fields of the bpf_hdr structures should be used to extract the packets from the buffer. + Examples can be seen either in the TestApp sample application (see the \ref packetsamps page) provided in the developer's pack, or in the pcap_read() function of wpcap. */ @@ -798,33 +798,33 @@ BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sy return res; } -/*! +/*! \brief Sends one (or more) copies of a packet to the network. - \param AdapterObject Pointer to an _ADAPTER structure identifying the network adapter that will + \param AdapterObject Pointer to an _ADAPTER structure identifying the network adapter that will send the packets. \param lpPacket Pointer to a PACKET structure with the packet to send. - \param Sync This parameter is deprecated and will be ignored. It is present for compatibility with + \param Sync This parameter is deprecated and will be ignored. It is present for compatibility with older applications. \return If the function succeeds, the return value is nonzero. - This function is used to send a raw packet to the network. 'Raw packet' means that the programmer - will have to include the protocol headers, since the packet is sent to the network 'as is'. - The CRC needs not to be calculated and put at the end of the packet, because it will be transparently + This function is used to send a raw packet to the network. 'Raw packet' means that the programmer + will have to include the protocol headers, since the packet is sent to the network 'as is'. + The CRC needs not to be calculated and put at the end of the packet, because it will be transparently added by the network interface. The behavior of this function is influenced by the PacketSetNumWrites() function. With PacketSetNumWrites(), - it is possible to change the number of times a single write must be repeated. The default is 1, + it is possible to change the number of times a single write must be repeated. The default is 1, i.e. every call to PacketSendPacket() will correspond to one packet sent to the network. If this number is - greater than 1, for example 1000, every raw packet written by the application will be sent 1000 times on - the network. This feature mitigates the overhead of the context switches and therefore can be used to generate - high speed traffic. It is particularly useful for tools that test networks, routers, and servers and need + greater than 1, for example 1000, every raw packet written by the application will be sent 1000 times on + the network. This feature mitigates the overhead of the context switches and therefore can be used to generate + high speed traffic. It is particularly useful for tools that test networks, routers, and servers and need to obtain high network loads. - The optimized sending process is still limited to one packet at a time: for the moment it cannot be used + The optimized sending process is still limited to one packet at a time: for the moment it cannot be used to send a buffer with multiple packets. - \note The ability to write multiple packets is currently present only in the Windows NTx version of the + \note The ability to write multiple packets is currently present only in the Windows NTx version of the packet driver. In Windows 95/98/ME it is emulated at user level in packet.dll. This means that an application - that uses the multiple write method will run in Windows 9x as well, but its performance will be very low + that uses the multiple write method will run in Windows 9x as well, but its performance will be very low compared to the one of WindowsNTx. */ BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync) @@ -834,9 +834,9 @@ BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync) } -/*! +/*! \brief Sends a buffer of packets to the network. - \param AdapterObject Pointer to an _ADAPTER structure identifying the network adapter that will + \param AdapterObject Pointer to an _ADAPTER structure identifying the network adapter that will send the packets. \param PacketBuff Pointer to buffer with the packets to send. \param Size Size of the buffer pointed by the PacketBuff argument. @@ -849,8 +849,8 @@ BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync) This function is used to send a buffer of raw packets to the network. The buffer can contain an arbitrary number of raw packets, each of which preceded by a dump_bpf_hdr structure. The dump_bpf_hdr is the same used by WinPcap and libpcap to store the packets in a file, therefore sending a capture file is straightforward. - 'Raw packets' means that the sending application will have to include the protocol headers, since every packet - is sent to the network 'as is'. The CRC of the packets needs not to be calculated, because it will be + 'Raw packets' means that the sending application will have to include the protocol headers, since every packet + is sent to the network 'as is'. The CRC of the packets needs not to be calculated, because it will be transparently added by the network interface. \note Using this function if more efficient than issuing a series of PacketSendPacket(), because the packets are @@ -858,7 +858,7 @@ BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync) \note When Sync is set to TRUE, the packets are synchronized in the kerenl with a high precision timestamp. This requires a remarkable amount of CPU, but allows to send the packets with a precision of some microseconds - (depending on the precision of the performance counter of the machine). Such a precision cannot be reached + (depending on the precision of the performance counter of the machine). Such a precision cannot be reached sending the packets separately with PacketSendPacket(). */ INT PacketSendPackets(LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync) @@ -904,7 +904,7 @@ INT PacketSendPackets(LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOO // Exit from the loop on termination or error if(TotBytesTransfered >= Size || Res != TRUE) break; - + // Wait until the time interval has elapsed while( CurTicks.QuadPart <= TargetTicks.QuadPart ) QueryPerformanceCounter(&CurTicks); @@ -915,21 +915,21 @@ INT PacketSendPackets(LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOO return TotBytesTransfered; } -/*! +/*! \brief Defines the minimum amount of data that will be received in a read. \param AdapterObject Pointer to an _ADAPTER structure \param nbytes the minimum amount of data in the kernel buffer that will cause the driver to release a read on this adapter. \return If the function succeeds, the return value is nonzero. - In presence of a large value for nbytes, the kernel waits for the arrival of several packets before - copying the data to the user. This guarantees a low number of system calls, i.e. lower processor usage, - i.e. better performance, which is a good setting for applications like sniffers. Vice versa, a small value - means that the kernel will copy the packets as soon as the application is ready to receive them. This is - suggested for real time applications (like, for example, a bridge) that need the better responsiveness from + In presence of a large value for nbytes, the kernel waits for the arrival of several packets before + copying the data to the user. This guarantees a low number of system calls, i.e. lower processor usage, + i.e. better performance, which is a good setting for applications like sniffers. Vice versa, a small value + means that the kernel will copy the packets as soon as the application is ready to receive them. This is + suggested for real time applications (like, for example, a bridge) that need the better responsiveness from the kernel. - \b note: this function has effect only in Windows NTx. The driver for Windows 9x doesn't offer + \b note: this function has effect only in Windows NTx. The driver for Windows 9x doesn't offer this possibility, therefore PacketSetMinToCopy is implemented under these systems only for compatibility. */ @@ -949,30 +949,30 @@ BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes) - Capture mode (mode = PACKET_MODE_CAPT): normal capture mode. The packets transiting on the wire are copied to the application when PacketReceivePacket() is called. This is the default working mode of an adapter. - Statistical mode (mode = PACKET_MODE_STAT): programmable statistical mode. PacketReceivePacket() returns, at - precise intervals, statics values on the network traffic. The interval between the statistic samples is - by default 1 second but it can be set to any other value (with a 1 ms precision) with the + precise intervals, statics values on the network traffic. The interval between the statistic samples is + by default 1 second but it can be set to any other value (with a 1 ms precision) with the PacketSetReadTimeout() function. The data returned by PacketReceivePacket() when the adapter is in statistical mode is shown in the following figure:

\image html stats.gif "data structure returned by statistical mode" - Two 64-bit counters are provided: the number of packets and the amount of bytes that satisfy a filter - previously set with PacketSetBPF(). If no filter has been set, all the packets are counted. The counters are - encapsulated in a bpf_hdr structure, so that they will be parsed correctly by wpcap. Statistical mode has a - very low impact on system performance compared to capture mode. + Two 64-bit counters are provided: the number of packets and the amount of bytes that satisfy a filter + previously set with PacketSetBPF(). If no filter has been set, all the packets are counted. The counters are + encapsulated in a bpf_hdr structure, so that they will be parsed correctly by wpcap. Statistical mode has a + very low impact on system performance compared to capture mode. - Dump mode (mode = PACKET_MODE_DUMP): the packets are dumped to disk by the driver, in libpcap format. This - method is much faster than saving the packets after having captured them. No data is returned + method is much faster than saving the packets after having captured them. No data is returned by PacketReceivePacket(). If the application sets a filter with PacketSetBPF(), only the packets that satisfy this filter are dumped to disk. - - Statitical Dump mode (mode = PACKET_MODE_STAT_DUMP): the packets are dumped to disk by the driver, in libpcap - format, like in dump mode. PacketReceivePacket() returns, at precise intervals, statics values on the + - Statitical Dump mode (mode = PACKET_MODE_STAT_DUMP): the packets are dumped to disk by the driver, in libpcap + format, like in dump mode. PacketReceivePacket() returns, at precise intervals, statics values on the network traffic and on the amount of data saved to file, in a way similar to statistical mode. - The data returned by PacketReceivePacket() when the adapter is in statistical dump mode is shown in - the following figure:

+ The data returned by PacketReceivePacket() when the adapter is in statistical dump mode is shown in + the following figure:

\image html dump.gif "data structure returned by statistical dump mode" - Three 64-bit counters are provided: the number of packets accepted, the amount of bytes accepted and the - effective amount of data (including headers) dumped to file. If no filter has been set, all the packets are - dumped to disk. The counters are encapsulated in a bpf_hdr structure, so that they will be parsed correctly + Three 64-bit counters are provided: the number of packets accepted, the amount of bytes accepted and the + effective amount of data (including headers) dumped to file. If no filter has been set, all the packets are + dumped to disk. The counters are encapsulated in a bpf_hdr structure, so that they will be parsed correctly by wpcap. - Look at the NetMeter example in the + Look at the NetMeter example in the WinPcap developer's pack to see how to use statistics mode. */ BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode) @@ -988,10 +988,10 @@ BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode) \param len the length of the buffer containing the name, in bytes. \return If the function succeeds, the return value is nonzero. - This function defines the file name that the driver will open to store the packets on disk when + This function defines the file name that the driver will open to store the packets on disk when it works in dump mode. The adapter must be in dump mode, i.e. PacketSetMode() should have been called previously with mode = PACKET_MODE_DUMP. otherwise this function will fail. - If PacketSetDumpName was already invoked on the adapter pointed by AdapterObject, the driver + If PacketSetDumpName was already invoked on the adapter pointed by AdapterObject, the driver closes the old file and opens the new one. */ @@ -1007,7 +1007,7 @@ BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len) if(((PUCHAR)name)[1]!=0 && len>1){ //ASCII FileName=SChar2WChar(name); len*=2; - } + } else { //Unicode FileName=name; } @@ -1039,7 +1039,7 @@ BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len) very long dumps fill the disk space. If both maxfilesize and maxnpacks are set, the dump is stopped when the first of the two is reached. - \note When a limit is reached, the dump is stopped, but the file remains opened. In order to flush + \note When a limit is reached, the dump is stopped, but the file remains opened. In order to flush correctly the data and access the file consistently, you need to close the adapter with PacketCloseAdapter(). */ BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks) @@ -1057,7 +1057,7 @@ BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxn NULL, 0, &BytesReturned, - NULL); + NULL); } /*! @@ -1066,10 +1066,10 @@ BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxn \param sync if TRUE, the function blocks until the dump is finished, otherwise it returns immediately. \return TRUE if the dump is ended, FALSE otherwise. - PacketIsDumpEnded() informs the user about the limits that were set with a previous call to + PacketIsDumpEnded() informs the user about the limits that were set with a previous call to PacketSetDumpLimits(). - \warning If no calls to PacketSetDumpLimits() were performed or if the dump process has no limits + \warning If no calls to PacketSetDumpLimits() were performed or if the dump process has no limits (i.e. if the arguments of the last call to PacketSetDumpLimits() were both 0), setting sync to TRUE will block the application on this call forever. */ @@ -1102,16 +1102,16 @@ BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync) \return The handle of the event that the driver signals when some data is available in the kernel buffer. The event returned by this function is signaled by the driver if: - - The adapter pointed by AdapterObject is in capture mode and an amount of data greater or equal + - The adapter pointed by AdapterObject is in capture mode and an amount of data greater or equal than the one set with the PacketSetMinToCopy() function is received from the network. - the adapter pointed by AdapterObject is in capture mode, no data has been received from the network but the the timeout set with the PacketSetReadTimeout() function has elapsed. - - the adapter pointed by AdapterObject is in statics mode and the the timeout set with the + - the adapter pointed by AdapterObject is in statics mode and the the timeout set with the PacketSetReadTimeout() function has elapsed. This means that a new statistic sample is available. In every case, a call to PacketReceivePacket() will return immediately. - The event can be passed to standard Win32 functions (like WaitForSingleObject or WaitForMultipleObjects) - to wait until the driver's buffer contains some data. It is particularly useful in GUI applications that + The event can be passed to standard Win32 functions (like WaitForSingleObject or WaitForMultipleObjects) + to wait until the driver's buffer contains some data. It is particularly useful in GUI applications that need to wait concurrently on several events. */ @@ -1137,13 +1137,13 @@ BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites) /*! \brief Sets the timeout after which a read on an adapter returns. \param AdapterObject Pointer to an _ADAPTER structure. - \param timeout indicates the timeout, in milliseconds, after which a call to PacketReceivePacket() on - the adapter pointed by AdapterObject will be released, also if no packets have been captured by the driver. - Setting timeout to 0 means no timeout, i.e. PacketReceivePacket() never returns if no packet arrives. + \param timeout indicates the timeout, in milliseconds, after which a call to PacketReceivePacket() on + the adapter pointed by AdapterObject will be released, also if no packets have been captured by the driver. + Setting timeout to 0 means no timeout, i.e. PacketReceivePacket() never returns if no packet arrives. A timeout of -1 causes PacketReceivePacket() to always return immediately. \return If the function succeeds, the return value is nonzero. - \note This function works also if the adapter is working in statistics mode, and can be used to set the + \note This function works also if the adapter is working in statistics mode, and can be used to set the time interval between two statistic reports. */ BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout) @@ -1160,16 +1160,16 @@ BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout) \brief Sets the size of the kernel-level buffer associated with a capture. \param AdapterObject Pointer to an _ADAPTER structure. \param dim New size of the buffer, in \b kilobytes. - \return The function returns TRUE if successfully completed, FALSE if there is not enough memory to + \return The function returns TRUE if successfully completed, FALSE if there is not enough memory to allocate the new buffer. - When a new dimension is set, the data in the old buffer is discarded and the packets stored in it are - lost. - + When a new dimension is set, the data in the old buffer is discarded and the packets stored in it are + lost. + Note: the dimension of the kernel buffer affects heavily the performances of the capture process. - An adequate buffer in the driver is able to keep the packets while the application is busy, compensating - the delays of the application and avoiding the loss of packets during bursts or high network activity. - The buffer size is set to 0 when an instance of the driver is opened: the programmer should remember to + An adequate buffer in the driver is able to keep the packets while the application is busy, compensating + the delays of the application and avoiding the loss of packets during bursts or high network activity. + The buffer size is set to 0 when an instance of the driver is opened: the programmer should remember to set it to a proper value. As an example, wpcap sets the buffer size to 1MB at the beginning of a capture. */ BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim) @@ -1181,20 +1181,20 @@ BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim) /*! \brief Sets a kernel-level packet filter. \param AdapterObject Pointer to an _ADAPTER structure. - \param fp Pointer to a filtering program that will be associated with this capture or monitoring + \param fp Pointer to a filtering program that will be associated with this capture or monitoring instance and that will be executed on every incoming packet. - \return This function returns TRUE if the filter is set successfully, FALSE if an error occurs - or if the filter program is not accepted after a safeness check by the driver. The driver performs + \return This function returns TRUE if the filter is set successfully, FALSE if an error occurs + or if the filter program is not accepted after a safeness check by the driver. The driver performs the check in order to avoid system crashes due to buggy or malicious filters, and it rejects non conformat filters. - This function associates a new BPF filter to the adapter AdapterObject. The filter, pointed by fp, is a + This function associates a new BPF filter to the adapter AdapterObject. The filter, pointed by fp, is a set of bpf_insn instructions. - A filter can be automatically created by using the pcap_compile() function of wpcap. This function - converts a human readable text expression with the syntax of WinDump (see the manual of WinDump at - http://netgroup.polito.it/windump for details) into a BPF program. If your program doesn't link wpcap, but - you need to know the code of a particular filter, you can launch WinDump with the -d or -dd or -ddd + A filter can be automatically created by using the pcap_compile() function of wpcap. This function + converts a human readable text expression with the syntax of WinDump (see the manual of WinDump at + http://netgroup.polito.it/windump for details) into a BPF program. If your program doesn't link wpcap, but + you need to know the code of a particular filter, you can launch WinDump with the -d or -dd or -ddd flags to obtain the pseudocode. */ @@ -1212,10 +1212,10 @@ BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp) With this function, the programmer can know the value of two internal variables of the driver: - - the number of packets that have been received by the adapter AdapterObject, starting at the - time in which it was opened with PacketOpenAdapter. + - the number of packets that have been received by the adapter AdapterObject, starting at the + time in which it was opened with PacketOpenAdapter. - the number of packets that have been dropped by the driver. A packet is dropped when the kernel - buffer associated with the adapter is full. + buffer associated with the adapter is full. */ BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s) { @@ -1247,9 +1247,9 @@ BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s) With this function, the programmer can retireve the sname values provided by PacketGetStats(), plus: - - the number of drops by interface (not yet supported, always 0). + - the number of drops by interface (not yet supported, always 0). - the number of packets that reached the application, i.e that were accepted by the kernel filter and - that fitted in the kernel buffer. + that fitted in the kernel buffer. */ BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s) { @@ -1281,9 +1281,9 @@ BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s) \param OidData A pointer to a _PACKET_OID_DATA structure that contains or receives the data. \return If the function succeeds, the return value is nonzero. - \note not all the network adapters implement all the query/set functions. There is a set of mandatory - OID functions that is granted to be present on all the adapters, and a set of facultative functions, not - provided by all the cards (see the Microsoft DDKs to see which functions are mandatory). If you use a + \note not all the network adapters implement all the query/set functions. There is a set of mandatory + OID functions that is granted to be present on all the adapters, and a set of facultative functions, not + provided by all the cards (see the Microsoft DDKs to see which functions are mandatory). If you use a facultative function, be careful to enclose it in an if statement to check the result. */ BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData) @@ -1294,7 +1294,7 @@ BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA Oid /*Result=DeviceIoControl(AdapterObject->hFile,(DWORD) Set ? pBIOCSETOID : pBIOCQUERYOID, OidData,sizeof(PACKET_OID_DATA)-1+OidData->Length,OidData, sizeof(PACKET_OID_DATA)-1+OidData->Length,&BytesReturned,NULL);*/ - + // output some debug info ODSEx("PacketRequest, OID=%d ", OidData->Oid); ODSEx("Length=%d ", OidData->Length); @@ -1313,12 +1313,12 @@ BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA Oid The filter defined with this filter is evaluated by the network card, at a level that is under the NPF device driver. Here is a list of the most useful hardware filters (A complete list can be found in ntddndis.h): - - NDIS_PACKET_TYPE_PROMISCUOUS: sets promiscuous mode. Every incoming packet is accepted by the adapter. - - NDIS_PACKET_TYPE_DIRECTED: only packets directed to the workstation's adapter are accepted. - - NDIS_PACKET_TYPE_BROADCAST: only broadcast packets are accepted. - - NDIS_PACKET_TYPE_MULTICAST: only multicast packets belonging to groups of which this adapter is a member are accepted. - - NDIS_PACKET_TYPE_ALL_MULTICAST: every multicast packet is accepted. - - NDIS_PACKET_TYPE_ALL_LOCAL: all local packets, i.e. NDIS_PACKET_TYPE_DIRECTED + NDIS_PACKET_TYPE_BROADCAST + NDIS_PACKET_TYPE_MULTICAST + - NDIS_PACKET_TYPE_PROMISCUOUS: sets promiscuous mode. Every incoming packet is accepted by the adapter. + - NDIS_PACKET_TYPE_DIRECTED: only packets directed to the workstation's adapter are accepted. + - NDIS_PACKET_TYPE_BROADCAST: only broadcast packets are accepted. + - NDIS_PACKET_TYPE_MULTICAST: only multicast packets belonging to groups of which this adapter is a member are accepted. + - NDIS_PACKET_TYPE_ALL_MULTICAST: every multicast packet is accepted. + - NDIS_PACKET_TYPE_ALL_LOCAL: all local packets, i.e. NDIS_PACKET_TYPE_DIRECTED + NDIS_PACKET_TYPE_BROADCAST + NDIS_PACKET_TYPE_MULTICAST */ BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter) { @@ -1346,26 +1346,26 @@ BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter) \return If the function succeeds, the return value is nonzero. Usually, this is the first function that should be used to communicate with the driver. - It returns the names of the adapters installed on the system and supported by WinPcap. + It returns the names of the adapters installed on the system and supported by WinPcap. After the names of the adapters, pStr contains a string that describes each of them. - \b Warning: - the result of this function is obtained querying the registry, therefore the format + \b Warning: + the result of this function is obtained querying the registry, therefore the format of the result in Windows NTx is different from the one in Windows 9x. Windows 9x uses the ASCII - encoding method to store a string, while Windows NTx uses UNICODE. After a call to PacketGetAdapterNames + encoding method to store a string, while Windows NTx uses UNICODE. After a call to PacketGetAdapterNames in Windows 95x, pStr contains, in succession: - a variable number of ASCII strings, each with the names of an adapter, separated by a "\0" - a double "\0" - - a number of ASCII strings, each with the description of an adapter, separated by a "\0". The number + - a number of ASCII strings, each with the description of an adapter, separated by a "\0". The number of descriptions is the same of the one of names. The fisrt description corresponds to the first name, and so on. - - a double "\0". + - a double "\0". In Windows NTx, pStr contains: the names of the adapters, in UNICODE format, separated by a single UNICODE "\0" (i.e. 2 ASCII "\0"), a double UNICODE "\0", followed by the descriptions of the adapters, in ASCII format, separated by a single ASCII "\0" . The string is terminated by a double ASCII "\0". - a variable number of UNICODE strings, each with the names of an adapter, separated by a UNICODE "\0" - a double UNICODE "\0" - a number of ASCII strings, each with the description of an adapter, separated by an ASCII "\0". - - a double ASCII "\0". + - a double ASCII "\0". */ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) @@ -1405,7 +1405,7 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) if (Status!=ERROR_SUCCESS) continue; RegKeySize += dim; } - + // Allocate the memory for the original device names ODSEx("Need %d bytes for the names\n", RegKeySize+2); BpStr = GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT, RegKeySize+2); @@ -1431,7 +1431,7 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) dim=sizeof(UpperBindStr); Status=RegQueryValueExW(LinkageKey,L"UpperBind",NULL,NULL,(PUCHAR)UpperBindStr,&dim); - + ODSEx("UpperBind=%S ", UpperBindStr); if( Status!=ERROR_SUCCESS || _wcsicmp(UpperBindStr,L"NdisWan")==0 ){ @@ -1468,9 +1468,9 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) ODS("\n"); #endif - + if (k != 0){ - + DescBuf=GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT, 4096); if (DescBuf == NULL) { GlobalFreePtr (BpStr); @@ -1478,9 +1478,9 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) return FALSE; } DpStr=DescBuf; - + for(i=0,k=0;BpStr[i]!=0 || BpStr[i+1]!=0;){ - + if(k+wcslen(BpStr+i)+30 > *BufferSize){ // Input buffer too small GlobalFreePtr(OidData); @@ -1525,10 +1525,10 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) *DpStr++=*TTpStr++; } *DpStr++=*TTpStr++; - + // Close the adapter PacketCloseAdapter(adapter); - + } *DpStr = 0; @@ -1618,7 +1618,7 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) ODS("\tCreating a device name - Retrieve the description.\n"); continue; } - + // Copy the description TTpStr = (char*)(OidData->Data); while (*TTpStr != 0){ @@ -1631,10 +1631,10 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) ODS("\tCreating a device name - completed.\n"); } *DpStr = 0; - + pStr[k++] = 0; pStr[k] = 0; - + if ((ULONG)(DpStr - DescBuf + k) < *BufferSize) { memcpy(pStr + k, DescBuf, DpStr-DescBuf); } else { @@ -1643,7 +1643,7 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) GlobalFreePtr(DescBuf); return FALSE; } - + GlobalFreePtr(OidData); GlobalFreePtr(BpStr); GlobalFreePtr(DescBuf); @@ -1664,8 +1664,8 @@ BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize) \param NEntries Size of the array (in npf_if_addr). \return If the function succeeds, the return value is nonzero. - This function grabs from the registry information like the IP addresses, the netmasks - and the broadcast addresses of an interface. The buffer passed by the user is filled with + This function grabs from the registry information like the IP addresses, the netmasks + and the broadcast addresses of an interface. The buffer passed by the user is filled with npf_if_addr structures, each of which contains the data for a single address. If the buffer is full, the reaming addresses are dropeed, therefore set its dimension to sizeof(npf_if_addr) if you want only the first address. @@ -1705,7 +1705,7 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri if (wcsncmp(ifname, L"NPF_", 4) == 0) ifname += 4; - if( RegOpenKeyEx(HKEY_LOCAL_MACHINE, + if( RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\ControlSet001\\Services\\Tcpip\\Parameters\\Interfaces"), 0, KEY_READ, &UnderTcpKey) == ERROR_SUCCESS) { @@ -1717,7 +1717,7 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri } else { - + // Query the registry key with the interface's adresses status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\ControlSet001\\Services"), @@ -1750,17 +1750,17 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri status=RegQueryValueEx(TcpIpKey,TEXT("UseZeroBroadcast"),NULL,&RegType,(LPBYTE)&ZeroBroadcast,&BufLen); if (status != ERROR_SUCCESS) ZeroBroadcast=0; - + BufLen = 4; /* See if DHCP is used by this system */ status=RegQueryValueEx(TcpIpKey,TEXT("EnableDHCP"),NULL,&RegType,(LPBYTE)&DHCPEnabled,&BufLen); if (status != ERROR_SUCCESS) DHCPEnabled=0; - - + + /* Retrieve the adrresses */ if(DHCPEnabled){ - + BufLen = sizeof String; // Open the key with the addresses status = RegQueryValueEx(TcpIpKey,TEXT("DhcpIPAddress"),NULL,&RegType,(LPBYTE)String,&BufLen); @@ -1773,10 +1773,10 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri StringPos = 0; for(naddrs = 0;naddrs <* NEntries;naddrs++){ TmpAddr = (struct sockaddr_in *) &(buffer[naddrs].IPAddress); - + if((TmpAddr->sin_addr.S_un.S_addr = inet_addrU(String + StringPos))!= -1){ TmpAddr->sin_family = AF_INET; - + TmpBroad = (struct sockaddr_in *) &(buffer[naddrs].Broadcast); TmpBroad->sin_family = AF_INET; if(ZeroBroadcast==0) @@ -1786,13 +1786,13 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri while(*(String + StringPos) != 0)StringPos++; StringPos++; - + if(*(String + StringPos) == 0 || (StringPos * sizeof (WCHAR)) >= BufLen) - break; + break; } else break; - } - + } + BufLen = sizeof String; // Open the key with the netmasks status = RegQueryValueEx(TcpIpKey,TEXT("DhcpSubnetMask"),NULL,&RegType,(LPBYTE)String,&BufLen); @@ -1800,33 +1800,33 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri RegCloseKey(TcpIpKey); goto fail; } - + // scan the key to obtain the masks StringPos = 0; for(nmasks = 0;nmasks < *NEntries;nmasks++){ TmpAddr = (struct sockaddr_in *) &(buffer[nmasks].SubnetMask); - + if((TmpAddr->sin_addr.S_un.S_addr = inet_addrU(String + StringPos))!= -1){ TmpAddr->sin_family = AF_INET; - + while(*(String + StringPos) != 0)StringPos++; StringPos++; - + if(*(String + StringPos) == 0 || (StringPos * sizeof (WCHAR)) >= BufLen) break; } else break; - } - + } + // The number of masks MUST be equal to the number of adresses if(nmasks != naddrs){ RegCloseKey(TcpIpKey); goto fail; } - + } else{ - + BufLen = sizeof String; // Open the key with the addresses status = RegQueryValueEx(TcpIpKey,TEXT("IPAddress"),NULL,&RegType,(LPBYTE)String,&BufLen); @@ -1834,12 +1834,12 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri RegCloseKey(TcpIpKey); goto fail; } - + // scan the key to obtain the addresses StringPos = 0; for(naddrs = 0;naddrs < *NEntries;naddrs++){ TmpAddr = (struct sockaddr_in *) &(buffer[naddrs].IPAddress); - + if((TmpAddr->sin_addr.S_un.S_addr = inet_addrU(String + StringPos))!= -1){ TmpAddr->sin_family = AF_INET; @@ -1849,16 +1849,16 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri TmpBroad->sin_addr.S_un.S_addr = 0xffffffff; // 255.255.255.255 else TmpBroad->sin_addr.S_un.S_addr = 0; // 0.0.0.0 - + while(*(String + StringPos) != 0)StringPos++; StringPos++; - + if(*(String + StringPos) == 0 || (StringPos * sizeof (WCHAR)) >= BufLen) break; } else break; - } - + } + BufLen = sizeof String; // Open the key with the netmasks status = RegQueryValueEx(TcpIpKey,TEXT("SubnetMask"),NULL,&RegType,(LPBYTE)String,&BufLen); @@ -1866,45 +1866,45 @@ BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntri RegCloseKey(TcpIpKey); goto fail; } - + // scan the key to obtain the masks StringPos = 0; for(nmasks = 0;nmasks <* NEntries;nmasks++){ TmpAddr = (struct sockaddr_in *) &(buffer[nmasks].SubnetMask); - + if((TmpAddr->sin_addr.S_un.S_addr = inet_addrU(String + StringPos))!= -1){ TmpAddr->sin_family = AF_INET; - + while(*(String + StringPos) != 0)StringPos++; StringPos++; - + if(*(String + StringPos) == 0 || (StringPos * sizeof (WCHAR)) >= BufLen) break; } else break; - } - + } + // The number of masks MUST be equal to the number of adresses if(nmasks != naddrs){ RegCloseKey(TcpIpKey); goto fail; } - + } - + *NEntries = naddrs + 1; RegCloseKey(TcpIpKey); - + if (status != ERROR_SUCCESS) { goto fail; } - - + + if (AdapterNameU != NULL) free(AdapterNameU); return TRUE; - + fail: if (AdapterNameU != NULL) free(AdapterNameU); @@ -1918,7 +1918,7 @@ fail: \param maskp Pointer to a variable that will receive the netmask of the adapter. \return If the function succeeds, the return value is nonzero. - \note this function is obsolete and is maintained for backward compatibility. Use PacketGetNetInfoEx() instead. + \note this function is obsolete and is maintained for backward compatibility. Use PacketGetNetInfoEx() instead. */ BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp) @@ -1974,17 +1974,17 @@ BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp) goto fail; } RegCloseKey(ParametersKey); - + BufLen = 4; /* See if DHCP is used by this system */ status=RegQueryValueEx(TcpIpKey,TEXT("EnableDHCP"),NULL,&RegType,(LPBYTE)&DHCPEnabled,&BufLen); if (status != ERROR_SUCCESS) DHCPEnabled=0; - + /* Retrieve the netmask */ if(DHCPEnabled){ - + BufLen = sizeof String; status = RegQueryValueEx(TcpIpKey,TEXT("DhcpIPAddress"),NULL,&RegType,(LPBYTE)String,&BufLen); if (status != ERROR_SUCCESS) { @@ -1997,18 +1997,18 @@ BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp) for(i=0;i<4;i++){ *((char*)netp+i) = *((char*)&TAddr+3-i); } - + BufLen = sizeof String; status=RegQueryValueEx(TcpIpKey,TEXT("DHCPSubnetMask"),NULL,&RegType, (LPBYTE)String,&BufLen); - + TAddr = inet_addrU(String); // swap bytes for backward compatibility for(i=0;i<4;i++){ *((char*)maskp+i) = *((char*)&TAddr+3-i); } - - + + } else{ @@ -2024,11 +2024,11 @@ BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp) for(i=0;i<4;i++){ *((char*)netp+i) = *((char*)&TAddr+3-i); } - + BufLen = sizeof String; status=RegQueryValueEx(TcpIpKey,TEXT("SubnetMask"),NULL,&RegType, (LPBYTE)String,&BufLen); - + TAddr = inet_addrU(String); // swap bytes for backward compatibility for(i=0;i<4;i++){ @@ -2037,17 +2037,17 @@ BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp) } - + if (status != ERROR_SUCCESS) { RegCloseKey(TcpIpKey); goto fail; } - - + + if (AdapterNameU != NULL) free(AdapterNameU); return TRUE; - + fail: if (AdapterNameU != NULL) free(AdapterNameU); diff --git a/reactos/dll/win32/packet/include/packet32.h b/reactos/dll/win32/packet/include/packet32.h index 862cc372555..fad5b532afe 100644 --- a/reactos/dll/win32/packet/include/packet32.h +++ b/reactos/dll/win32/packet/include/packet32.h @@ -20,7 +20,7 @@ */ /** @ingroup packetapi - * @{ + * @{ */ /** @defgroup packet32h Packet.dll definitions and data structures @@ -75,7 +75,7 @@ /// Alignment macro. Defines the alignment size. #define Packet_ALIGNMENT sizeof(int) -/// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT. +/// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT. #define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1)) /*! @@ -97,7 +97,7 @@ typedef struct NetType /*! \brief A BPF pseudo-assembly program. - The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet. + The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet. */ struct bpf_program { UINT bf_len; ///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow. @@ -122,24 +122,24 @@ struct bpf_insn { It is used by packet.dll to return statistics about a capture session. */ struct bpf_stat { - UINT bs_recv; ///< Number of packets that the driver received from the network adapter - ///< from the beginning of the current capture. This value includes the packets + UINT bs_recv; ///< Number of packets that the driver received from the network adapter + ///< from the beginning of the current capture. This value includes the packets ///< lost by the driver. - UINT bs_drop; ///< number of packets that the driver lost from the beginning of a capture. - ///< Basically, a packet is lost when the the buffer of the driver is full. + UINT bs_drop; ///< number of packets that the driver lost from the beginning of a capture. + ///< Basically, a packet is lost when the the buffer of the driver is full. ///< In this situation the packet cannot be stored and the driver rejects it. UINT ps_ifdrop; ///< drops by interface. XXX not yet supported UINT bs_capt; ///< number of packets that pass the filter, find place in the kernel buffer and ///< thus reach the application. }; - + /*! \brief Packet header. - + This structure defines the header associated with every packet delivered to the application. */ struct bpf_hdr { - struct timeval bh_tstamp; ///< The timestamp associated with the captured packet. + struct timeval bh_tstamp; ///< The timestamp associated with the captured packet. ///< It is stored in a TimeVal structure. UINT bh_caplen; ///< Length of captured portion. The captured portion can be different ///< from the original packet, because it is possible (with a proper filter) @@ -147,22 +147,22 @@ struct bpf_hdr { UINT bh_datalen; ///< Original length of packet USHORT bh_hdrlen; ///< Length of bpf header (this struct plus alignment padding). In some cases, ///< a padding could be added between the end of this structure and the packet - ///< data for performance reasons. This filed can be used to retrieve the actual data + ///< data for performance reasons. This filed can be used to retrieve the actual data ///< of the packet. }; - + /*! \brief Dump packet header. - + This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets(). It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a packet in a dump file. This makes straightforward sending WinPcap dump files to the network. */ struct dump_bpf_hdr{ struct timeval ts; ///< Time stamp of the packet - UINT caplen; ///< Length of captured portion. The captured portion can smaller than the - ///< the original packet, because it is possible (with a proper filter) to - ///< instruct the driver to capture only a portion of the packets. + UINT caplen; ///< Length of captured portion. The captured portion can smaller than the + ///< the original packet, because it is possible (with a proper filter) to + ///< instruct the driver to capture only a portion of the packets. UINT len; ///< Length of the original packet (off wire). }; @@ -171,7 +171,7 @@ struct dump_bpf_hdr{ #define DOSNAMEPREFIX TEXT("Packet_") ///< Prefix added to the adapters device names to create the WinPcap devices #define MAX_LINK_NAME_LENGTH 64 //< Maximum length of the devices symbolic links -#define NMAX_PACKET 65535 +#define NMAX_PACKET 65535 /*! \brief Describes a network adapter. @@ -179,20 +179,20 @@ struct dump_bpf_hdr{ This structure is the most important for the functioning of packet.dll, but the great part of its fields should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters */ -typedef struct _ADAPTER { +typedef struct _ADAPTER { HANDLE hFile; ///< \internal Handle to an open instance of the NPF driver. CHAR SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened. - int NumWrites; ///< \internal Number of times a packets written on this adapter will be repeated + int NumWrites; ///< \internal Number of times a packets written on this adapter will be repeated ///< on the wire. HANDLE ReadEvent; ///< A notification event associated with the read calls on the adapter. ///< It can be passed to standard Win32 functions (like WaitForSingleObject - ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some - ///< data. It is particularly useful in GUI applications that need to wait + ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some + ///< data. It is particularly useful in GUI applications that need to wait ///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy() ///< function can be used to define the minimum amount of data in the kernel buffer - ///< that will cause the event to be signalled. - - UINT ReadTimeOut; ///< \internal The amount of time after which a read on the driver will be released and + ///< that will cause the event to be signalled. + + UINT ReadTimeOut; ///< \internal The amount of time after which a read on the driver will be released and ///< ReadEvent will be signaled, also if no packets were captured } ADAPTER, *LPADAPTER; @@ -201,7 +201,7 @@ typedef struct _ADAPTER { This structure defines the header associated with every packet delivered to the application. */ -typedef struct _PACKET { +typedef struct _PACKET { HANDLE hEvent; ///< \deprecated Still present for compatibility with old applications. OVERLAPPED OverLapped; ///< \deprecated Still present for compatibility with old applications. PVOID Buffer; ///< Buffer with containing the packets. See the PacketReceivePacket() for @@ -214,24 +214,24 @@ typedef struct _PACKET { /*! \brief Structure containing an OID request. - - It is used by the PacketRequest() function to send an OID to the interface card driver. - It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, + + It is used by the PacketRequest() function to send an OID to the interface card driver. + It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, the list of the multicast groups defined on it, and so on. */ struct _PACKET_OID_DATA { ULONG Oid; ///< OID code. See the Microsoft DDK documentation or the file ntddndis.h ///< for a complete list of valid codes. ULONG Length; ///< Length of the data field - UCHAR Data[1]; ///< variable-lenght field that contains the information passed to or received + UCHAR Data[1]; ///< variable-lenght field that contains the information passed to or received ///< from the adapter. -}; +}; typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA; /*! \brief Addresses of a network adapter. - This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with + This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with an adapter. */ typedef struct npf_if_addr { @@ -283,6 +283,6 @@ VOID PacketCloseAdapter(LPADAPTER lpAdapter); #ifdef __cplusplus } -#endif +#endif #endif //__PACKET32 diff --git a/reactos/dll/win32/packet/resource.h b/reactos/dll/win32/packet/resource.h index 6cf0c78db23..6d5e116e031 100644 --- a/reactos/dll/win32/packet/resource.h +++ b/reactos/dll/win32/packet/resource.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 diff --git a/reactos/dll/win32/packet/trace.c b/reactos/dll/win32/packet/trace.c index a332387995e..4ff6a14b3a5 100644 --- a/reactos/dll/win32/packet/trace.c +++ b/reactos/dll/win32/packet/trace.c @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Diagnostic Trace // -#include +#include #include #include //#include diff --git a/reactos/dll/win32/psapi/malloc.c b/reactos/dll/win32/psapi/malloc.c index 6ef15d0e82b..951eab9bec2 100644 --- a/reactos/dll/win32/psapi/malloc.c +++ b/reactos/dll/win32/psapi/malloc.c @@ -30,12 +30,12 @@ MemAlloc(IN HANDLE Heap, { return NULL; } - + if(Heap == NULL) { Heap = NtCurrentPeb()->ProcessHeap; } - + if(Size > 0) { if(Ptr == NULL) diff --git a/reactos/dll/win32/psapi/psapi.c b/reactos/dll/win32/psapi/psapi.c index d3fc5971438..3f13a60d9c6 100644 --- a/reactos/dll/win32/psapi/psapi.c +++ b/reactos/dll/win32/psapi/psapi.c @@ -661,7 +661,7 @@ EmptyWorkingSet(HANDLE hProcess) SetLastErrorByStatus(Status); return FALSE; } - + return TRUE; } @@ -677,13 +677,13 @@ EnumDeviceDrivers(LPVOID *lpImageBase, { ENUM_DEVICE_DRIVERS_CONTEXT Context; NTSTATUS Status; - + if(cb == 0 || lpImageBase == NULL) { *lpcbNeeded = 0; return TRUE; } - + cb /= sizeof(PVOID); Context.lpImageBase = lpImageBase; @@ -715,15 +715,15 @@ EnumProcesses(DWORD *lpidProcess, { ENUM_PROCESSES_CONTEXT Context; NTSTATUS Status; - + cb /= sizeof(DWORD); - + if(cb == 0 || lpidProcess == NULL) { *lpcbNeeded = 0; return TRUE; } - + Context.lpidProcess = lpidProcess; Context.nCount = cb; @@ -754,9 +754,9 @@ EnumProcessModules(HANDLE hProcess, { ENUM_PROCESS_MODULES_CONTEXT Context; NTSTATUS Status; - + cb /= sizeof(HMODULE); - + if(cb == 0 || lphModule == NULL) { *lpcbNeeded = 0; @@ -776,7 +776,7 @@ EnumProcessModules(HANDLE hProcess, SetLastErrorByStatus(Status); return FALSE; } - + return TRUE; } @@ -1099,10 +1099,10 @@ EnumPageFilesA(PENUM_PAGE_FILE_CALLBACKA pCallbackRoutine, LPVOID lpContext) { INTERNAL_ENUM_PAGE_FILES_CONTEXT Context; - + Context.pCallbackRoutine = pCallbackRoutine; Context.lpContext = lpContext; - + return EnumPageFilesW(InternalAnsiPageFileCallback, &Context); } diff --git a/reactos/dll/win32/riched20/caret.c b/reactos/dll/win32/riched20/caret.c index f2ca5952487..d20c5b3f2cc 100644 --- a/reactos/dll/win32/riched20/caret.c +++ b/reactos/dll/win32/riched20/caret.c @@ -32,39 +32,39 @@ void ME_GetSelection(ME_TextEditor *editor, int *from, int *to) { *from = ME_GetCursorOfs(editor, 0); *to = ME_GetCursorOfs(editor, 1); - + if (*from > *to) { int tmp = *from; *from = *to; - *to = tmp; + *to = tmp; } } int ME_GetTextLength(ME_TextEditor *editor) { - return ME_CharOfsFromRunOfs(editor, ME_FindItemBack(editor->pBuffer->pLast, diRun), 0); + return ME_CharOfsFromRunOfs(editor, ME_FindItemBack(editor->pBuffer->pLast, diRun), 0); } int ME_GetTextLengthEx(ME_TextEditor *editor, GETTEXTLENGTHEX *how) { int length; - + if (how->flags & GTL_PRECISE && how->flags & GTL_CLOSE) return E_INVALIDARG; if (how->flags & GTL_NUMCHARS && how->flags & GTL_NUMBYTES) return E_INVALIDARG; - + length = ME_GetTextLength(editor); - + if (how->flags & GTL_USECRLF) length += editor->nParagraphs; - + if (how->flags & GTL_NUMBYTES) { CPINFO cpinfo; - + if (how->codepage == 1200) return length * 2; if (how->flags & GTL_PRECISE) @@ -74,7 +74,7 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, GETTEXTLENGTHEX *how) ERR("Invalid codepage %u\n", how->codepage); return E_INVALIDARG; } - return length; + return length; } @@ -93,8 +93,8 @@ int ME_SetSelection(ME_TextEditor *editor, int from, int to) if (from == 0 && to == -1) { editor->pCursors[1].pRun = ME_FindItemFwd(editor->pBuffer->pFirst, diRun); - editor->pCursors[1].nOffset = 0; - editor->pCursors[0].pRun = ME_FindItemBack(editor->pBuffer->pLast, diRun); + editor->pCursors[1].nOffset = 0; + editor->pCursors[0].pRun = ME_FindItemBack(editor->pBuffer->pLast, diRun); editor->pCursors[0].nOffset = 0; ME_InvalidateSelection(editor); ME_ClearTempStyle(editor); @@ -168,7 +168,7 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, assert(!(ME_GetParagraph(pCursorRun)->member.para.nFlags & MEPF_REWRAP)); assert(pCursor->pRun); assert(pCursor->pRun->type == diRun); - + if (pCursorRun->type == diRun) { ME_DisplayItem *row = ME_FindItemBack(pCursorRun, diStartRowOrParagraph); @@ -178,9 +178,9 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, ME_DisplayItem *run = pCursorRun; ME_DisplayItem *para = NULL; SIZE sz = {0, 0}; - + ME_InitContext(&c, editor, hDC); - + if (!pCursor->nOffset && !editor->bCaretAtEnd) { ME_DisplayItem *prev = ME_FindItemBack(pCursorRun, diRunOrStartRow); @@ -192,7 +192,7 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, para = ME_FindItemBack(row, diParagraph); assert(para); assert(para->type == diParagraph); - if (editor->bCaretAtEnd && !pCursor->nOffset && + if (editor->bCaretAtEnd && !pCursor->nOffset && run == ME_FindItemFwd(row, diRun)) { ME_DisplayItem *tmp = ME_FindItemBack(row, diRunOrParagraph); @@ -213,7 +213,7 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, *height = pSizeRun->member.run.nAscent + pSizeRun->member.run.nDescent; *x = run->member.run.pt.x + sz.cx; *y = para->member.para.nYPos + row->member.row.nBaseline + pSizeRun->member.run.pt.y - pSizeRun->member.run.nAscent - ME_GetYScrollPos(editor); - + ME_DestroyContext(&c); ReleaseDC(editor->hWnd, hDC); return; @@ -256,12 +256,12 @@ void ME_HideCaret(ME_TextEditor *ed) } } -void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, +void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nChars) { ME_Cursor c; int shift = 0; - + while(nChars > 0) { ME_Run *run; @@ -287,9 +287,9 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, int nCharsToDelete = nChars; int i; int loc = c.nOffset; - + ME_FindItemBack(c.pRun, diParagraph)->member.para.nFlags |= MEPF_REWRAP; - + cursor = c; ME_StrRelPos(run->strText, loc, &nChars); /* nChars is the number of characters that should be deleted from the @@ -297,8 +297,8 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, nCharsToDelete is a number of chars to delete from THIS run */ nCharsToDelete -= nChars; shift -= nCharsToDelete; - TRACE("Deleting %d (intended %d-remaning %d) chars at %d in '%s' (%d)\n", - nCharsToDelete, nIntendedChars, nChars, c.nOffset, + TRACE("Deleting %d (intended %d-remaning %d) chars at %d in '%s' (%d)\n", + nCharsToDelete, nIntendedChars, nChars, c.nOffset, debugstr_w(run->strText->szData), run->strText->nLen); if (!c.nOffset && ME_StrVLen(run->strText) == nCharsToDelete) @@ -323,10 +323,10 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, TRACE("Post deletion string: %s (%d)\n", debugstr_w(run->strText->szData), run->strText->nLen); TRACE("Shift value: %d\n", shift); ME_StrDeleteV(run->strText, c.nOffset, nCharsToDelete); - + /* update cursors (including c) */ for (i=-1; inCursors; i++) { - ME_Cursor *pThisCur = editor->pCursors + i; + ME_Cursor *pThisCur = editor->pCursors + i; if (i == -1) pThisCur = &c; if (pThisCur->pRun == cursor.pRun) { if (pThisCur->nOffset > cursor.nOffset) { @@ -345,9 +345,9 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, } } } - + /* c = updated data now */ - + if (c.pRun == cursor.pRun) ME_SkipAndPropagateCharOffset(c.pRun, shift); else @@ -359,7 +359,7 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, ME_Remove(cursor.pRun); ME_DestroyDisplayItem(cursor.pRun); } - + shift = 0; /* ME_CheckCharOffsets(editor); @@ -369,9 +369,9 @@ void ME_InternalDeleteText(ME_TextEditor *editor, int nOfs, } } -void ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, +void ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars) -{ +{ assert(nCursor>=0 && nCursornCursors); /* text operations set modified state */ editor->nModifyStep = 1; @@ -386,9 +386,9 @@ ME_InternalInsertTextFromCursor(ME_TextEditor *editor, int nCursor, ME_Cursor *p = &editor->pCursors[nCursor]; editor->bCaretAtEnd = FALSE; - + assert(p->pRun->type == diRun); - + return ME_InsertRunAtCursor(editor, p, style, str, len, flags); } @@ -398,7 +398,7 @@ void ME_InsertGraphicsFromCursor(ME_TextEditor *editor, int nCursor) { ME_Style *pStyle = ME_GetInsertStyle(editor, nCursor); WCHAR space = ' '; - + /* FIXME no no no */ if (ME_IsSelection(editor)) ME_DeleteSelection(editor); @@ -415,7 +415,7 @@ ME_InsertTableCellFromCursor(ME_TextEditor *editor, int nCursor) WCHAR tab = '\t'; ME_DisplayItem *p, *run; ME_Style *pStyle = ME_GetInsertStyle(editor, nCursor); - + p = ME_InternalInsertTextFromCursor(editor, nCursor, &tab, 1, pStyle, MERF_CELL); run = p; @@ -435,7 +435,7 @@ ME_InsertTableCellFromCursor(ME_TextEditor *editor, int nCursor) } -void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, +void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style) { const WCHAR *pos; @@ -470,9 +470,9 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, if (pos!=str) ME_InternalInsertTextFromCursor(editor, nCursor, str, pos-str, style, 0); - + ME_InternalInsertTextFromCursor(editor, nCursor, &tab, 1, style, MERF_TAB); - + pos++; if(pos-str <= len) { len -= pos - str; @@ -518,7 +518,7 @@ static BOOL ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs) { ME_DisplayItem *pRun = pCursor->pRun; - + if (nRelOfs == -1) { if (!pCursor->nOffset) @@ -549,7 +549,7 @@ ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs) else pCursor->nOffset = pRun->member.run.strText->nLen; } - + if (pCursor->nOffset) pCursor->nOffset = ME_StrRelPos2(pCursor->pRun->member.run.strText, pCursor->nOffset, nRelOfs); return TRUE; @@ -559,7 +559,7 @@ ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *pCursor, int nRelOfs) if (!(pRun->member.run.nFlags & MERF_ENDPARA)) { int new_ofs = ME_StrRelPos2(pRun->member.run.strText, pCursor->nOffset, nRelOfs); - + if (new_ofs < pRun->member.run.strText->nLen) { pCursor->nOffset = new_ofs; @@ -585,7 +585,7 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) { ME_DisplayItem *pRun = cursor->pRun, *pOtherRun; int nOffset = cursor->nOffset; - + if (nRelOfs == -1) { /* Backward movement */ @@ -626,7 +626,7 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs) { /* Forward movement */ BOOL last_delim = FALSE; - + while (TRUE) { if (last_delim && !ME_CallWordBreakProc(editor, pRun->member.run.strText, @@ -680,7 +680,7 @@ ME_SelectWord(ME_TextEditor *editor) int ME_GetCursorOfs(ME_TextEditor *editor, int nCursor) { ME_Cursor *pCursor = &editor->pCursors[nCursor]; - + return ME_GetParagraph(pCursor->pRun)->member.para.nCharOfs + pCursor->pRun->member.run.nCharOfs + pCursor->nOffset; } @@ -689,7 +689,7 @@ int ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ME_Cursor *result, BOOL { ME_DisplayItem *p = editor->pBuffer->pFirst->member.para.next_para; int rx = 0; - + if (is_eol) *is_eol = 0; @@ -804,16 +804,16 @@ void ME_LButtonDown(ME_TextEditor *editor, int x, int y) { ME_Cursor tmp_cursor; int is_selection = 0; - + editor->nUDArrowX = -1; - + y += ME_GetYScrollPos(editor); tmp_cursor = editor->pCursors[0]; is_selection = ME_IsSelection(editor); ME_FindPixelPos(editor, x, y, &editor->pCursors[0], &editor->bCaretAtEnd); - + if (GetKeyState(VK_SHIFT)>=0) { editor->pCursors[1] = editor->pCursors[0]; @@ -836,17 +836,17 @@ void ME_LButtonDown(ME_TextEditor *editor, int x, int y) void ME_MouseMove(ME_TextEditor *editor, int x, int y) { ME_Cursor tmp_cursor; - + y += ME_GetYScrollPos(editor); tmp_cursor = editor->pCursors[0]; /* FIXME: do something with the return value of ME_FindPixelPos */ ME_FindPixelPos(editor, x, y, &tmp_cursor, &editor->bCaretAtEnd); - - if (tmp_cursor.pRun == editor->pCursors[0].pRun && + + if (tmp_cursor.pRun == editor->pCursors[0].pRun && tmp_cursor.nOffset == editor->pCursors[0].nOffset) return; - + ME_InvalidateSelection(editor); editor->pCursors[0] = tmp_cursor; HideCaret(editor->hWnd); @@ -856,7 +856,7 @@ void ME_MouseMove(ME_TextEditor *editor, int x, int y) ME_SendSelChange(editor); } -static ME_DisplayItem *ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow, +static ME_DisplayItem *ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow, int x, int *pOffset, int *pbCaretAtEnd) { ME_DisplayItem *pNext, *pLastRun; @@ -879,13 +879,13 @@ static ME_DisplayItem *ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pR if (ch < s->nLen) { if (pOffset) *pOffset = ch; - return pNext; + return pNext; } } pLastRun = pNext; pNext = ME_FindItemFwd(pNext, diRunOrStartRow); } while(pNext && pNext->type == diRun); - + if ((pLastRun->member.run.nFlags & MERF_ENDPARA) == 0) { pNext = ME_FindItemFwd(pNext, diRun); @@ -966,18 +966,18 @@ static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor) ME_DisplayItem *pLast, *p; int x, y, ys, yd, yp, yprev; ME_Cursor tmp_curs = *pCursor; - + x = ME_GetXForArrow(editor, pCursor); if (!pCursor->nOffset && editor->bCaretAtEnd) pRun = ME_FindItemBack(pRun, diRun); - + p = ME_FindItemBack(pRun, diStartRowOrParagraph); assert(p->type == diStartRow); yp = ME_FindItemBack(p, diParagraph)->member.para.nYPos; yprev = ys = y = yp + p->member.row.nYPos; yd = y - editor->sizeWindow.cy; pLast = p; - + do { p = ME_FindItemBack(p, diStartRowOrParagraph); if (!p) @@ -994,7 +994,7 @@ static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor) pLast = p; yprev = y; } while(1); - + pCursor->pRun = ME_FindRunInRow(editor, pLast, x, &pCursor->nOffset, &editor->bCaretAtEnd); ME_UpdateSelection(editor, &tmp_curs); if (yprev < editor->sizeWindow.cy) @@ -1002,7 +1002,7 @@ static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor) ME_EnsureVisible(editor, ME_FindItemFwd(editor->pBuffer->pFirst, diRun)); ME_Repaint(editor); } - else + else { ME_ScrollUp(editor, ys-yprev); } @@ -1010,7 +1010,7 @@ static void ME_ArrowPageUp(ME_TextEditor *editor, ME_Cursor *pCursor) assert(pCursor->pRun->type == diRun); } -/* FIXME: in the original RICHEDIT, PageDown always scrolls by the same amount +/* FIXME: in the original RICHEDIT, PageDown always scrolls by the same amount of pixels, even if it makes the scroll bar position exceed its normal maximum. In such a situation, clicking the scrollbar restores its position back to the normal range (ie. sets it to (doclength-screenheight)). */ @@ -1021,18 +1021,18 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor) ME_DisplayItem *pLast, *p; int x, y, ys, yd, yp, yprev; ME_Cursor tmp_curs = *pCursor; - + x = ME_GetXForArrow(editor, pCursor); if (!pCursor->nOffset && editor->bCaretAtEnd) pRun = ME_FindItemBack(pRun, diRun); - + p = ME_FindItemBack(pRun, diStartRowOrParagraph); assert(p->type == diStartRow); yp = ME_FindItemBack(p, diParagraph)->member.para.nYPos; yprev = ys = y = yp + p->member.row.nYPos; yd = y + editor->sizeWindow.cy; pLast = p; - + do { p = ME_FindItemFwd(p, diStartRowOrParagraph); if (!p) @@ -1047,7 +1047,7 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor) pLast = p; yprev = y; } while(1); - + pCursor->pRun = ME_FindRunInRow(editor, pLast, x, &pCursor->nOffset, &editor->bCaretAtEnd); ME_UpdateSelection(editor, &tmp_curs); if (yprev >= editor->nTotalLength-editor->sizeWindow.cy) @@ -1055,7 +1055,7 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor) ME_EnsureVisible(editor, ME_FindItemBack(editor->pBuffer->pLast, diRun)); ME_Repaint(editor); } - else + else { ME_ScrollUp(editor,ys-yprev); } @@ -1101,10 +1101,10 @@ static void ME_ArrowCtrlHome(ME_TextEditor *editor, ME_Cursor *pCursor) static void ME_ArrowEnd(ME_TextEditor *editor, ME_Cursor *pCursor) { ME_DisplayItem *pRow; - + if (editor->bCaretAtEnd && !pCursor->nOffset) return; - + pRow = ME_FindItemFwd(pCursor->pRun, diStartRowOrParagraphOrEnd); assert(pRow); if (pRow->type == diStartRow) { @@ -1121,7 +1121,7 @@ static void ME_ArrowEnd(ME_TextEditor *editor, ME_Cursor *pCursor) pCursor->nOffset = 0; editor->bCaretAtEnd = FALSE; } - + static void ME_ArrowCtrlEnd(ME_TextEditor *editor, ME_Cursor *pCursor) { ME_DisplayItem *p = ME_FindItemFwd(pCursor->pRun, diTextEnd); @@ -1142,17 +1142,17 @@ BOOL ME_IsSelection(ME_TextEditor *editor) static int ME_GetSelCursor(ME_TextEditor *editor, int dir) { int cdir = ME_GetCursorOfs(editor, 0) - ME_GetCursorOfs(editor, 1); - + if (cdir*dir>0) return 0; else return 1; } - + BOOL ME_UpdateSelection(ME_TextEditor *editor, ME_Cursor *pTempCursor) { ME_Cursor old_anchor = editor->pCursors[1]; - + if (GetKeyState(VK_SHIFT)>=0) /* cancelling selection */ { /* any selection was present ? if so, it's no more, repaint ! */ @@ -1187,7 +1187,7 @@ ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor) ME_Style *style; int from, to; ME_Cursor c; - + ME_GetSelection(editor, &from, &to); ME_CursorFromCharOfs(editor, from, &c); if (from != to) { @@ -1204,10 +1204,10 @@ void ME_SendSelChange(ME_TextEditor *editor) SELCHANGE sc; ME_ClearTempStyle(editor); - + if (!(editor->nEventMask & ENM_SELCHANGE)) return; - + sc.nmhdr.hwndFrom = editor->hWnd; sc.nmhdr.idFrom = GetWindowLongW(editor->hWnd, GWLP_ID); sc.nmhdr.code = EN_SELCHANGE; @@ -1228,7 +1228,7 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl) ME_Cursor *p = &editor->pCursors[nCursor]; ME_Cursor tmp_curs = *p; BOOL success = FALSE; - + ME_CheckCharOffsets(editor); editor->nUDArrowX = -1; switch(nVKey) { @@ -1266,22 +1266,22 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl) editor->bCaretAtEnd = 0; break; } - case VK_END: + case VK_END: if (ctrl) ME_ArrowCtrlEnd(editor, &tmp_curs); else ME_ArrowEnd(editor, &tmp_curs); break; } - + if (!extend) editor->pCursors[1] = tmp_curs; *p = tmp_curs; - + ME_InvalidateSelection(editor); ME_Repaint(editor); HideCaret(editor->hWnd); - ME_EnsureVisible(editor, tmp_curs.pRun); + ME_EnsureVisible(editor, tmp_curs.pRun); ME_ShowCaret(editor); ME_SendSelChange(editor); return success; diff --git a/reactos/dll/win32/riched20/context.c b/reactos/dll/win32/riched20/context.c index 7eef5564a8e..dd61c82b188 100644 --- a/reactos/dll/win32/riched20/context.c +++ b/reactos/dll/win32/riched20/context.c @@ -22,7 +22,7 @@ void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC) { - c->nSequence = editor->nSequence++; + c->nSequence = editor->nSequence++; c->hDC = hDC; c->editor = editor; c->pt.x = 0; diff --git a/reactos/dll/win32/riched20/editor.c b/reactos/dll/win32/riched20/editor.c index 4cdb54a1be2..4bb229c8432 100644 --- a/reactos/dll/win32/riched20/editor.c +++ b/reactos/dll/win32/riched20/editor.c @@ -20,9 +20,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -/* +/* API implementation status: - + Messages (ANSI versions not done yet) + EM_AUTOURLDETECT 2.0 + EM_CANPASTE @@ -140,9 +140,9 @@ - WM_STYLECHANGING - WM_STYLECHANGED (things like read-only flag) - WM_UNICHAR - + Notifications - + * EN_CHANGE (sent from the wrong place) - EN_CORRECTTEXT - EN_DROPFILES @@ -157,14 +157,14 @@ - EN_PROTECTED + EN_REQUESTRESIZE - EN_SAVECLIPBOARD - + EN_SELCHANGE + + EN_SELCHANGE + EN_SETFOCUS - EN_STOPNOUNDO * EN_UPDATE (sent from the wrong place) - EN_VSCROLL - + Styles - + - ES_AUTOHSCROLL - ES_AUTOVSCROLL - ES_CENTER @@ -188,8 +188,8 @@ /* * RICHED20 TODO (incomplete): * - * - messages/styles/notifications listed above - * - Undo coalescing + * - messages/styles/notifications listed above + * - Undo coalescing * - add remaining CHARFORMAT/PARAFORMAT fields * - right/center align should strip spaces from the beginning * - pictures/OLE objects (not just smiling faces that lack API support ;-) ) @@ -224,7 +224,7 @@ #include "editor.h" #include "commdlg.h" #include "winreg.h" -#define NO_SHLWAPI_STREAM +#define NO_SHLWAPI_STREAM #include "shlwapi.h" #include "rtf.h" #include "imm.h" @@ -233,7 +233,7 @@ #define STACK_SIZE_MAX 1000 #define TEXT_LIMIT_DEFAULT 32767 - + WINE_DEFAULT_DEBUG_CHANNEL(richedit); static BOOL ME_RegisterEditorClass(HINSTANCE); @@ -255,24 +255,24 @@ static inline int is_version_nt(void) } static ME_TextBuffer *ME_MakeText(void) { - + ME_TextBuffer *buf = ALLOC_OBJ(ME_TextBuffer); ME_DisplayItem *p1 = ME_MakeDI(diTextStart); ME_DisplayItem *p2 = ME_MakeDI(diTextEnd); - + p1->prev = NULL; p1->next = p2; p2->prev = p1; p2->next = NULL; p1->member.para.next_para = p2; p2->member.para.prev_para = p1; - p2->member.para.nCharOfs = 0; - + p2->member.para.nCharOfs = 0; + buf->pFirst = p1; buf->pLast = p2; buf->pCharStyle = NULL; - + return buf; } @@ -281,9 +281,9 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea { WCHAR wszText[STREAMIN_BUFFER_SIZE+1]; WCHAR *pText; - + TRACE("%08x %p\n", dwFormat, stream); - + do { long nWideChars = 0; @@ -295,7 +295,7 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea if (!stream->dwSize) break; } - + if (!(dwFormat & SF_UNICODE)) { /* FIXME? this is doomed to fail on true MBCS like UTF-8, luckily they're unlikely to be used as CP_ACP */ @@ -307,7 +307,7 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea nWideChars = stream->dwSize >> 1; pText = (WCHAR *)stream->buffer; } - + ME_InsertTextFromCursor(editor, 0, pText, nWideChars, style); if (stream->dwSize == 0) break; @@ -431,7 +431,7 @@ static void ME_RTFParAttrHook(RTF_Info *info) PARAFORMAT2 fmt; fmt.cbSize = sizeof(fmt); fmt.dwMask = 0; - + switch(info->rtfMinor) { case rtfParDef: /* restores default paragraph attributes */ @@ -445,7 +445,7 @@ static void ME_RTFParAttrHook(RTF_Info *info) case rtfInTable: { ME_DisplayItem *para; - + RTFFlushOutputBuffer(info); para = ME_GetParagraph(info->editor->pCursors[0].pRun); assert(para->member.para.pCells); @@ -490,7 +490,7 @@ static void ME_RTFParAttrHook(RTF_Info *info) if (fmt.cTabCount < MAX_TAB_STOPS) fmt.rgxTabs[fmt.cTabCount++] = info->rtfParam; break; - } + } if (fmt.dwMask) { RTFFlushOutputBuffer(info); /* FIXME too slow ? how come ?*/ @@ -501,16 +501,16 @@ static void ME_RTFParAttrHook(RTF_Info *info) static void ME_RTFTblAttrHook(RTF_Info *info) { ME_DisplayItem *para; - + switch (info->rtfMinor) { case rtfRowDef: RTFFlushOutputBuffer(info); para = ME_GetParagraph(info->editor->pCursors[0].pRun); - + /* Release possibly inherited cell definitions */ ME_DestroyTableCellList(para); - + para->member.para.pCells = ALLOC_OBJ(ME_TableCell); para->member.para.pCells->nRightBoundary = 0; para->member.para.pCells->next = NULL; @@ -519,11 +519,11 @@ static void ME_RTFTblAttrHook(RTF_Info *info) case rtfCellPos: RTFFlushOutputBuffer(info); para = ME_GetParagraph(info->editor->pCursors[0].pRun); - + if (para->member.para.pLastCell->nRightBoundary) { ME_TableCell *pCell = ALLOC_OBJ(ME_TableCell); - + pCell->next = NULL; para->member.para.pLastCell->next = pCell; para->member.para.pLastCell = pCell; @@ -614,7 +614,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre TRACE("stream==%p hWnd==%p format==0x%X\n", stream, editor->hWnd, (UINT)format); editor->nEventMask = 0; - + ME_GetSelection(editor, &from, &to); if ((format & SFF_SELECTION) && (editor->mode & TM_RICHTEXT)) { style = ME_GetSelectionInsertStyle(editor); @@ -624,7 +624,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre else { style = editor->pBuffer->pDefaultStyle; ME_AddRefStyle(style); - SendMessageA(editor->hWnd, EM_SETSEL, 0, 0); + SendMessageA(editor->hWnd, EM_SETSEL, 0, 0); ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor)); from = to = 0; ME_ClearTempStyle(editor); @@ -672,7 +672,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre RTFInit(&parser); RTFSetReadHook(&parser, ME_RTFReadHook); BeginFile(&parser); - + /* do the parsing */ RTFRead(&parser); RTFFlushOutputBuffer(&parser); @@ -755,7 +755,7 @@ ME_DisplayItem * ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int *nItemOffset) { ME_DisplayItem *item = ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph); - + while (item && item->member.para.next_para->member.para.nCharOfs <= nOffset) item = ME_FindItemFwd(item, diParagraph); @@ -768,7 +768,7 @@ ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int *nItemOffset = nOffset; return item; } - + do { item = ME_FindItemFwd(item, diRun); } while (item && (item->member.run.nCharOfs + ME_StrLen(item->member.run.strText) <= nOffset)); @@ -794,7 +794,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, const WCHAR *te TRACE("flags==0x%08x, chrg->cpMin==%d, chrg->cpMax==%d text==%s\n", flags, chrg->cpMin, chrg->cpMax, debugstr_w(text)); - + if (flags & ~(FR_DOWN | FR_MATCHCASE | FR_WHOLEWORD)) FIXME("Flags 0x%08x not implemented\n", flags & ~(FR_DOWN | FR_MATCHCASE | FR_WHOLEWORD)); @@ -804,7 +804,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, const WCHAR *te nMax = nTextLen; else nMax = chrg->cpMax > nTextLen ? nTextLen : chrg->cpMax; - + /* when searching up, if cpMin < cpMax, then instead of searching * on [cpMin,cpMax], we search on [0,cpMin], otherwise, search on * [cpMax, cpMin]. The exception is when cpMax is -1, in which @@ -827,7 +827,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, const WCHAR *te chrgText->cpMin = chrgText->cpMax = -1; return -1; } - + if (flags & FR_DOWN) /* Forward search */ { /* If possible, find the character before where the search starts */ @@ -860,7 +860,7 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, const WCHAR *te ME_DisplayItem *pCurItem = item; int nCurStart = nStart; int nMatched = 0; - + while (pCurItem && ME_CharCompare(pCurItem->member.run.strText->szData[nCurStart + nMatched], text[nMatched], (flags & FR_MATCHCASE))) { if ((flags & FR_WHOLEWORD) && isalnumW(wLastChar)) @@ -945,23 +945,23 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, const WCHAR *te chrgText->cpMin = chrgText->cpMax = -1; return -1; } - + para = ME_GetParagraph(item); - + while (item && para->member.para.nCharOfs + item->member.run.nCharOfs + nEnd - nLen >= nMin) { ME_DisplayItem *pCurItem = item; int nCurEnd = nEnd; int nMatched = 0; - + if (nCurEnd - nMatched == 0) { pCurItem = ME_FindItemBack(pCurItem, diRun); para = ME_GetParagraph(pCurItem); nCurEnd = ME_StrLen(pCurItem->member.run.strText) + nMatched; } - + while (pCurItem && ME_CharCompare(pCurItem->member.run.strText->szData[nCurEnd - nMatched - 1], text[nLen - nMatched - 1], (flags & FR_MATCHCASE))) { if ((flags & FR_WHOLEWORD) && isalnumW(wLastChar)) @@ -1037,7 +1037,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) { BOOL ctrl_is_down = GetKeyState(VK_CONTROL) & 0x8000; BOOL shift_is_down = GetKeyState(VK_SHIFT) & 0x8000; - + switch (nKey) { case VK_LEFT: @@ -1074,7 +1074,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) CHARFORMAT2W chf; char buf[2048]; chf.cbSize = sizeof(chf); - + ME_GetSelectionCharFormat(editor, &chf); ME_DumpStyleToBuf(&chf, buf); MessageBoxA(NULL, buf, "Style dump", MB_OK); @@ -1162,14 +1162,14 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->pFontCache[i].nAge = 0; ed->pFontCache[i].hFont = NULL; } - + ME_CheckCharOffsets(ed); - + if (GetWindowLongW(hWnd, GWL_STYLE) & ES_PASSWORD) ed->cPasswordMask = '*'; else ed->cPasswordMask = 0; - + return ed; } @@ -1184,13 +1184,13 @@ static DWORD CALLBACK ME_ReadFromHGLOBALUnicode(DWORD_PTR dwCookie, LPBYTE lpBuf ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie; int i; WORD *pSrc, *pDest; - + cb = cb >> 1; pDest = (WORD *)lpBuff; pSrc = (WORD *)GlobalLock(pData->hData); for (i = 0; inLength+i]; i++) { pDest[i] = pSrc[pData->nLength+i]; - } + } pData->nLength += i; *pcb = 2*i; GlobalUnlock(pData->hData); @@ -1202,12 +1202,12 @@ static DWORD CALLBACK ME_ReadFromHGLOBALRTF(DWORD_PTR dwCookie, LPBYTE lpBuff, L ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie; int i; BYTE *pSrc, *pDest; - + pDest = lpBuff; pSrc = (BYTE *)GlobalLock(pData->hData); for (i = 0; inLength+i]; i++) { pDest[i] = pSrc[pData->nLength+i]; - } + } pData->nLength += i; *pcb = i; GlobalUnlock(pData->hData); @@ -1336,7 +1336,7 @@ static const char * const richedit_messages[] = { "EM_GETOLEINTERFACE", "EM_GETPARAFORMAT", "EM_GETSELTEXT", - "EM_HIDESELECTION", + "EM_HIDESELECTION", "EM_PASTESPECIAL", "EM_REQUESTRESIZE", "EM_SELECTIONTYPE", @@ -1417,17 +1417,17 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode) { ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(hWnd, 0); - + TRACE("hwnd %p msg %04x (%s) %lx %lx, unicode %d\n", hWnd, msg, get_msg_name(msg), wParam, lParam, unicode); - + if (!editor && msg != WM_NCCREATE && msg != WM_NCDESTROY) { ERR("called with invalid hWnd %p - application bug?\n", hWnd); - return 0; + return 0; } switch(msg) { - + UNSUPPORTED_MSG(EM_DISPLAYBAND) UNSUPPORTED_MSG(EM_FINDWORDBREAK) UNSUPPORTED_MSG(EM_FMTLINES) @@ -1457,9 +1457,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, UNSUPPORTED_MSG(WM_STYLECHANGING) UNSUPPORTED_MSG(WM_STYLECHANGED) /* UNSUPPORTED_MSG(WM_UNICHAR) FIXME missing in Wine headers */ - + /* Messages specific to Richedit controls */ - + case EM_STREAMIN: return ME_StreamIn(editor, wParam, (EDITSTREAM*)lParam); case EM_STREAMOUT: @@ -1518,7 +1518,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, editor->nUndoLimit = STACK_SIZE_DEFAULT; else editor->nUndoLimit = min(wParam, STACK_SIZE_MAX); - /* Setting a max stack size keeps wine from getting killed + /* Setting a max stack size keeps wine from getting killed for hogging memory. Windows allocates all this memory at once, so no program would realistically set a value above our maximum. */ return editor->nUndoLimit; @@ -1545,9 +1545,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } case EM_SETOPTIONS: { - /* these flags are equivalent to ES_* counterparts - * ECO_READONLY is already implemented in the code, only requires - * setting the bit to work + /* these flags are equivalent to ES_* counterparts + * ECO_READONLY is already implemented in the code, only requires + * setting the bit to work */ DWORD mask = ECO_VERTICAL | ECO_AUTOHSCROLL | ECO_AUTOVSCROLL | ECO_NOHIDESEL | ECO_READONLY | ECO_WANTRETURN; @@ -1603,7 +1603,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } case EM_AUTOURLDETECT: { - if (wParam==1 || wParam ==0) + if (wParam==1 || wParam ==0) { editor->AutoURLDetect_bEnable = (BOOL)wParam; return 0; @@ -1704,7 +1704,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, editor->nModifyStep = 1; else editor->nModifyStep = 0; - + return 0; } case EM_SETREADONLY: @@ -1720,7 +1720,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, case EM_SETEVENTMASK: { DWORD nOldMask = editor->nEventMask; - + editor->nEventMask = lParam; return nOldMask; } @@ -1849,13 +1849,13 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, int top, bottom; /* row's edges relative to document top */ int nPos; ME_DisplayItem *para, *row; - + nPos = ME_GetYScrollPos(editor); row = ME_RowStart(editor->pCursors[0].pRun); para = ME_GetParagraph(row); top = para->member.para.nYPos + row->member.row.nYPos; bottom = top + row->member.row.nHeight; - + if (top < nPos) /* caret above window */ ME_ScrollAbs(editor, top); else if (nPos + editor->sizeWindow.cy < bottom) /*below*/ @@ -1868,13 +1868,13 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, CHARFORMAT2W fmt; HDC hDC; BOOL bRepaint = LOWORD(lParam); - + if (!wParam) - wParam = (WPARAM)GetStockObject(SYSTEM_FONT); + wParam = (WPARAM)GetStockObject(SYSTEM_FONT); GetObjectW((HGDIOBJ)wParam, sizeof(LOGFONTW), &lf); hDC = GetDC(hWnd); - ME_CharFormatFromLogFont(hDC, &lf, &fmt); - ReleaseDC(hWnd, hDC); + ME_CharFormatFromLogFont(hDC, &lf, &fmt); + ReleaseDC(hWnd, hDC); ME_SetCharFormat(editor, 0, ME_GetTextLength(editor), &fmt); ME_SetDefaultCharFormat(editor, &fmt); @@ -1924,7 +1924,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return FALSE; } case WM_PASTE: - { + { DWORD dwFormat = 0; EDITSTREAM es; ME_GlobalDestStruct gds; @@ -1955,10 +1955,10 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, LPDATAOBJECT dataObj = NULL; CHARRANGE range; HRESULT hr = S_OK; - + if (editor->cPasswordMask) return 0; /* Copying or Cutting masked text isn't allowed */ - + ME_GetSelection(editor, (int*)&range.cpMin, (int*)&range.cpMax); if(editor->lpOleCallback) hr = IRichEditOleCallback_GetClipboardData(editor->lpOleCallback, &range, RECO_COPY, &dataObj); @@ -2060,7 +2060,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, int nLen = rng->chrg.cpMax-rng->chrg.cpMin; WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1); int nChars = ME_GetTextW(editor, p, rng->chrg.cpMin, nLen, editor->bEmulateVersion10); - /* FIXME this is a potential security hole (buffer overrun) + /* FIXME this is a potential security hole (buffer overrun) if you know more about wchar->mbyte conversion please explain */ WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)rng->lpstrText, nLen+1, NULL, NULL); @@ -2074,7 +2074,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, const unsigned int nMaxChars = *(WORD *) lParam; unsigned int nEndChars, nCharsLeft = nMaxChars; char *dest = (char *) lParam; - /* rich text editor 1.0 uses \r\n for line end, 2.0 uses just \r; + /* rich text editor 1.0 uses \r\n for line end, 2.0 uses just \r; we need to know how if we have the extra \n or not */ int nLF = editor->bEmulateVersion10; @@ -2148,14 +2148,14 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { if (lParam == -1) return ME_RowNumberFromCharOfs(editor, ME_GetCursorOfs(editor,1)); - else + else return ME_RowNumberFromCharOfs(editor, lParam); } case EM_LINEINDEX: { ME_DisplayItem *item, *para; int nCharOfs; - + if (wParam == -1) item = ME_FindItemBack(editor->pCursors[0].pRun, diStartRow); else @@ -2172,7 +2172,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { ME_DisplayItem *item, *item_end; int nChars = 0, nThisLineOfs = 0, nNextLineOfs = 0; - + if (wParam > ME_GetTextLength(editor)) return 0; if (wParam == -1) @@ -2266,14 +2266,14 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_DisplayItem *pRun; int nCharOfs, nOffset, nLength; POINTL pt = {0,0}; - - nCharOfs = wParam; + + nCharOfs = wParam; /* detect which API version we're dealing with */ if (wParam >= 0x40000) nCharOfs = lParam; nLength = ME_GetTextLength(editor); - - if (nCharOfs < nLength) { + + if (nCharOfs < nLength) { ME_RunOfsFromCharOfs(editor, nCharOfs, &pRun, &nOffset); assert(pRun->type == diRun); pt.y = pRun->member.run.pt.y; @@ -2366,7 +2366,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (ME_KeyDown(editor, LOWORD(wParam))) return 0; goto do_default; - case WM_CHAR: + case WM_CHAR: { WCHAR wstr; @@ -2379,7 +2379,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, } if (editor->AutoURLDetect_bEnable) ME_AutoURLDetect(editor, wstr); - + switch (wstr) { case 1: /* Ctrl-A */ @@ -2389,7 +2389,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, SendMessageW(editor->hWnd, WM_COPY, 0, 0); return 0; } - + if (GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_READONLY) { MessageBeep(MB_ICONERROR); return 0; /* FIXME really 0 ? */ @@ -2422,19 +2422,19 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return 0; } case EM_SCROLL: /* fall through */ - case WM_VSCROLL: + case WM_VSCROLL: { int origNPos; int lineHeight; - + origNPos = ME_GetYScrollPos(editor); lineHeight = 24; - + if (editor && editor->pBuffer && editor->pBuffer->pDefaultStyle) lineHeight = editor->pBuffer->pDefaultStyle->tm.tmHeight; if (lineHeight <= 0) lineHeight = 24; - - switch(LOWORD(wParam)) + + switch(LOWORD(wParam)) { case SB_LINEUP: ME_ScrollUp(editor,lineHeight); @@ -2461,14 +2461,14 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { int gcWheelDelta; UINT pulScrollLines; - + SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0); gcWheelDelta = -GET_WHEEL_DELTA_WPARAM(wParam); - + if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines) { /* FIXME follow the original */ - ME_ScrollDown(editor,pulScrollLines * (gcWheelDelta / WHEEL_DELTA) * 8); + ME_ScrollDown(editor,pulScrollLines * (gcWheelDelta / WHEEL_DELTA) * 8); } break; } @@ -2483,7 +2483,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (lParam) { RECT *rc = (RECT *)lParam; - + if (wParam) { editor->rcFormat.left += rc->left; @@ -2619,7 +2619,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, mask |= (TM_RICHTEXT | TM_PLAINTEXT); changes |= (wParam & (TM_RICHTEXT | TM_PLAINTEXT)); } - /*FIXME: Currently no support for undo level and code page options*/ + /*FIXME: Currently no support for undo level and code page options*/ editor->mode = (editor->mode & (~mask)) | changes; return 0; } @@ -2669,13 +2669,13 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP LRESULT WINAPI RichEdit10ANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { LRESULT result; - + /* FIXME: this is NOT the same as 2.0 version */ result = RichEditANSIWndProc(hWnd, msg, wParam, lParam); if (msg == WM_NCCREATE) { ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(hWnd, 0); - + editor->bEmulateVersion10 = TRUE; editor->pBuffer->pLast->member.para.nCharOfs = 2; } @@ -2717,14 +2717,14 @@ void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam info.chrg.cpMin = ME_CharOfsFromRunOfs(editor,tmpCursor.pRun,0); info.chrg.cpMax = info.chrg.cpMin + ME_StrVLen(tmpRun->strText); SendMessageW(GetParent(editor->hWnd), WM_NOTIFY,info.nmhdr.idFrom, (LPARAM)&info); - } + } } int ME_CountParagraphsBetween(ME_TextEditor *editor, int from, int to) { ME_DisplayItem *item = ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph); int i = 0; - + while(item && item->member.para.next_para->member.para.nCharOfs <= from) item = item->member.para.next_para; if (!item) @@ -2742,12 +2742,12 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in ME_DisplayItem *item = ME_FindItemAtOffset(editor, diRun, nStart, &nStart); int nWritten = 0; WCHAR *pStart = buffer; - + if (!item) { *buffer = 0; return 0; } - + if (nStart) { int nLen = ME_StrLen(item->member.run.strText) - nStart; @@ -2762,7 +2762,7 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in nStart = 0; item = ME_FindItemFwd(item, diRun); } - + while(nChars && item) { int nLen = ME_StrLen(item->member.run.strText); @@ -2791,8 +2791,8 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in CopyMemory(buffer, item->member.run.strText->szData, sizeof(WCHAR)*nLen); nChars -= nLen; nWritten += nLen; - buffer += nLen; - + buffer += nLen; + if (!nChars) { TRACE("nWritten=%d, actual=%d\n", nWritten, buffer-pStart); @@ -2803,14 +2803,14 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in } *buffer = 0; TRACE("nWritten=%d, actual=%d\n", nWritten, buffer-pStart); - return nWritten; + return nWritten; } static BOOL ME_RegisterEditorClass(HINSTANCE hInstance) { WNDCLASSW wcW; WNDCLASSA wcA; - + wcW.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS; wcW.lpfnWndProc = RichEditWndProcW; wcW.cbClsExtra = 0; @@ -2872,7 +2872,7 @@ LRESULT WINAPI REListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) * REExtendedRegisterClass (RICHED20.8) * * FIXME undocumented - * Need to check for errors and implement controls and callbacks + * Need to check for errors and implement controls and callbacks */ LRESULT WINAPI REExtendedRegisterClass(void) { @@ -2902,7 +2902,7 @@ LRESULT WINAPI REExtendedRegisterClass(void) wcW.style = CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW; wcW.lpfnWndProc = REComboWndProc; wcW.lpszClassName = REComboBox20W; - if (RegisterClassW(&wcW)) ME_ComboBoxRegistered = TRUE; + if (RegisterClassW(&wcW)) ME_ComboBoxRegistered = TRUE; } result = 0; @@ -2914,7 +2914,7 @@ LRESULT WINAPI REExtendedRegisterClass(void) return result; } -int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) +int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) { struct prefix_s { const char *text; @@ -2948,10 +2948,10 @@ int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) RichEditANSIWndProc(editor->hWnd, EM_EXGETSEL, (WPARAM) 0, (LPARAM) &ins_pt); sel_min = ins_pt.cpMin; sel_max = ins_pt.cpMax; - if (sel_min==sel_max) + if (sel_min==sel_max) car_pos = sel_min; if (sel_min!=sel_max) - car_pos = ME_GetTextLength(editor)+1; + car_pos = ME_GetTextLength(editor)+1; cur_format.cbSize = sizeof(cur_format); default_format.cbSize = sizeof(default_format); RichEditANSIWndProc(editor->hWnd, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM) &cur_format); @@ -2962,9 +2962,9 @@ int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) curf_ef = cur_format.dwEffects & link.dwEffects; def_ef = default_format.dwEffects & link.dwEffects; link_ef = link.dwEffects & link.dwEffects; - if (curf_ef == link_ef) + if (curf_ef == link_ef) { - if( curChar == '\n' || curChar=='\r' || curChar==' ') + if( curChar == '\n' || curChar=='\r' || curChar==' ') { ME_SetSelection(editor, car_pos, car_pos); RichEditANSIWndProc(editor->hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &default_format); @@ -2976,9 +2976,9 @@ int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) { cur_prefx = 0; prefx_cnt = (sizeof(prefixes)/sizeof(struct prefix_s))-1; - while (cur_prefx<=prefx_cnt) + while (cur_prefx<=prefx_cnt) { - if (text_pos == -1) + if (text_pos == -1) { ft.lpstrText = prefixes[cur_prefx].text; URLmin=max(0,(car_pos-prefixes[cur_prefx].length)); @@ -2989,10 +2989,10 @@ int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) } ft.chrg.cpMin = URLmin; ft.chrg.cpMax = URLmax; - text_pos=RichEditANSIWndProc(editor->hWnd, EM_FINDTEXT, FR_DOWN, (LPARAM)&ft); + text_pos=RichEditANSIWndProc(editor->hWnd, EM_FINDTEXT, FR_DOWN, (LPARAM)&ft); cur_prefx++; } - if (text_pos != -1) + if (text_pos != -1) { url.cpMin=text_pos; url.cpMax=car_pos-1; diff --git a/reactos/dll/win32/riched20/editor.h b/reactos/dll/win32/riched20/editor.h index f71842b01db..6e90c3be8d6 100644 --- a/reactos/dll/win32/riched20/editor.h +++ b/reactos/dll/win32/riched20/editor.h @@ -128,7 +128,7 @@ static inline int ME_CharCompare(WCHAR a, WCHAR b, int caseSensitive) return caseSensitive ? (a == b) : (toupperW(a) == toupperW(b)); } -/* note: those two really return the first matching offset (starting from EOS)+1 +/* note: those two really return the first matching offset (starting from EOS)+1 * in other words, an offset of the first trailing white/black */ int ME_ReverseFindNonWhitespaceV(ME_String *s, int nVChar); int ME_ReverseFindWhitespaceV(ME_String *s, int nVChar); @@ -186,7 +186,7 @@ int ME_CharFromPos(ME_TextEditor *editor, int x, int y); void ME_LButtonDown(ME_TextEditor *editor, int x, int y); void ME_MouseMove(ME_TextEditor *editor, int x, int y); void ME_DeleteTextAtCursor(ME_TextEditor *editor, int nCursor, int nChars); -void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, +void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *str, int len, ME_Style *style); BOOL ME_ArrowKey(ME_TextEditor *ed, int nVKey, BOOL extend, BOOL ctrl); @@ -220,7 +220,7 @@ void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor); void ME_SendRequestResize(ME_TextEditor *editor, BOOL force); /* para.c */ -ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run); +ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run); void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end); void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *editor); ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style); diff --git a/reactos/dll/win32/riched20/editstr.h b/reactos/dll/win32/riched20/editstr.h index 7bb91d52445..de558dd4c81 100644 --- a/reactos/dll/win32/riched20/editstr.h +++ b/reactos/dll/win32/riched20/editstr.h @@ -70,7 +70,7 @@ typedef enum { diRun, /* run (sequence of chars with the same character format) */ diStartRow, /* start of the row (line of text on the screen) */ diTextEnd, /* end of the text buffer */ - + /********************* these below are meant for finding only *********************/ diStartRowOrParagraph, /* 5 */ diStartRowOrParagraphOrEnd, @@ -78,7 +78,7 @@ typedef enum { diRunOrStartRow, diParagraphOrEnd, diRunOrParagraphOrEnd, /* 10 */ - + diUndoInsertRun, /* 11 */ diUndoDeleteRun, /* 12 */ diUndoJoinParagraphs, /* 13 */ @@ -162,7 +162,7 @@ typedef struct tagME_TableCell typedef struct tagME_Paragraph { PARAFORMAT2 *pFmt; - + BOOL bTable; /* this paragraph is a table row */ struct tagME_TableCell *pCells; /* list of cells and their properties */ struct tagME_TableCell *pLastCell; /* points to the last cell in the list */ @@ -194,7 +194,7 @@ typedef struct tagME_Row * to a screen line (that's why there are no rows in an unformatted * paragraph * - the paragraphs contain "shortcut" pointers to the previous and the next - * paragraph, that makes iteration over paragraphs faster + * paragraph, that makes iteration over paragraphs faster * - the list starts with diTextStart and ends with diTextEnd */ @@ -350,9 +350,9 @@ typedef struct tagME_WrapContext POINT pt; BOOL bOverflown; ME_DisplayItem *pRowStart; - + ME_DisplayItem *pLastSplittableRun; POINT ptLastSplittableRun; -} ME_WrapContext; +} ME_WrapContext; #endif diff --git a/reactos/dll/win32/riched20/list.c b/reactos/dll/win32/riched20/list.c index ad7b4b659e4..81134112675 100644 --- a/reactos/dll/win32/riched20/list.c +++ b/reactos/dll/win32/riched20/list.c @@ -99,10 +99,10 @@ BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass) return TRUE; if (nTypeOrClass==diStartRowOrParagraph && (type==diStartRow || type==diParagraph)) return TRUE; - if (nTypeOrClass==diStartRowOrParagraphOrEnd + if (nTypeOrClass==diStartRowOrParagraphOrEnd && (type==diStartRow || type==diParagraph || type==diTextEnd)) return TRUE; - if (nTypeOrClass==diRunOrParagraphOrEnd + if (nTypeOrClass==diRunOrParagraphOrEnd && (type==diRun || type==diParagraph || type==diTextEnd)) return TRUE; return FALSE; @@ -154,7 +154,7 @@ ME_DisplayItem *ME_MakeDI(ME_DIType type) { item->member.para.pFmt->dwMask = 0; item->member.para.nFlags = MEPF_REWRAP; } - + return item; } @@ -197,7 +197,7 @@ void ME_DumpDocument(ME_TextBuffer *buffer) TRACE(" - StartRow\n"); break; case diRun: - TRACE(" - Run(\"%s\", %d)\n", debugstr_w(pItem->member.run.strText->szData), + TRACE(" - Run(\"%s\", %d)\n", debugstr_w(pItem->member.run.strText->szData), pItem->member.run.nCharOfs); break; case diTextEnd: diff --git a/reactos/dll/win32/riched20/paint.c b/reactos/dll/win32/riched20/paint.c index 63a0c4c4082..5291f3daf8d 100644 --- a/reactos/dll/win32/riched20/paint.c +++ b/reactos/dll/win32/riched20/paint.c @@ -43,7 +43,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpda { BOOL bPaint = (rcUpdate == NULL); if (rcUpdate) - bPaint = c.pt.ybottom && + bPaint = c.pt.ybottom && c.pt.y+item->member.para.nHeight>rcUpdate->top; if (bPaint) { @@ -59,7 +59,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpda RECT rc; int xs = c.rcView.left, xe = c.rcView.right; int ys = c.pt.y, ye = c.rcView.bottom; - + if (bOnlyNew) { int y1 = editor->nTotalLength-yoffset, y2 = editor->nLastTotalLength-yoffset; @@ -68,7 +68,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpda else ys = ye; } - + if (rcUpdate && ys!=ye) { xs = rcUpdate->left, xe = rcUpdate->right; @@ -109,14 +109,14 @@ void ME_UpdateRepaint(ME_TextEditor *editor) { /* Should be called whenever the contents of the control have changed */ ME_Cursor *pCursor; - + if (ME_WrapMarkedParagraphs(editor)) ME_UpdateScrollBar(editor); - + /* Ensure that the cursor is visible */ pCursor = &editor->pCursors[0]; ME_EnsureVisible(editor, pCursor->pRun); - + /* send EN_CHANGE if the event mask asks for it */ if(editor->nEventMask & ENM_CHANGE) { @@ -128,19 +128,19 @@ void ME_UpdateRepaint(ME_TextEditor *editor) void ME_RewrapRepaint(ME_TextEditor *editor) -{ +{ /* RewrapRepaint should be called whenever the control has changed in * looks, but not content. Like resizing. */ - + ME_MarkAllForWrapping(editor); ME_WrapMarkedParagraphs(editor); ME_UpdateScrollBar(editor); - + ME_Repaint(editor); } -static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, int nChars, +static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, int nChars, ME_Style *s, int *width, int nSelFrom, int nSelTo, int ymin, int cy) { HDC hDC = c->hDC; HGDIOBJ hOldFont; @@ -149,7 +149,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in hOldFont = ME_SelectStyleFont(c->editor, hDC, s); rgbBack = ME_GetBackColor(c->editor); if ((s->fmt.dwMask & CFM_LINK) && (s->fmt.dwEffects & CFE_LINK)) - rgbOld = SetTextColor(hDC, RGB(0,0,255)); + rgbOld = SetTextColor(hDC, RGB(0,0,255)); else if ((s->fmt.dwMask & CFM_COLOR) && (s->fmt.dwEffects & CFE_AUTOCOLOR)) rgbOld = SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT)); else @@ -165,7 +165,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in { int numerator = 1; int denominator = 1; - + if (c->editor->nZoomNumerator) { numerator = c->editor->nZoomNumerator; @@ -187,7 +187,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in GetTextExtentPoint32W(hDC, szText, nSelFrom, &sz); x += sz.cx; GetTextExtentPoint32W(hDC, szText+nSelFrom, nSelTo-nSelFrom, &sz); - + /* Invert selection if not hidden by EM_HIDESELECTION */ if (c->editor->bHideSelection == FALSE) PatBlt(hDC, x, ymin, sz.cx, cy, DSTINVERT); @@ -230,18 +230,18 @@ static void ME_DrawGraphics(ME_Context *c, int x, int y, ME_Run *run, if (selected) { /* descent is usually (always?) 0 for graphics */ - PatBlt(c->hDC, x, y-run->nAscent, sz.cx, run->nAscent+run->nDescent, DSTINVERT); + PatBlt(c->hDC, x, y-run->nAscent, sz.cx, run->nAscent+run->nDescent, DSTINVERT); } } -static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Paragraph *para) +static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Paragraph *para) { ME_Run *run = &rundi->member.run; ME_DisplayItem *start = ME_FindItemBack(rundi, diStartRow); int runofs = run->nCharOfs+para->nCharOfs; int nSelFrom, nSelTo; const WCHAR wszSpace[] = {' ', 0}; - + if (run->nFlags & MERF_HIDDEN) return; @@ -252,9 +252,9 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa ME_DrawTextWithStyle(c, x, y, wszSpace, 1, run->style, NULL, 0, 1, c->pt.y + start->member.row.nYPos, start->member.row.nHeight); - + /* you can always comment it out if you need visible paragraph marks */ - if (run->nFlags & (MERF_ENDPARA | MERF_TAB | MERF_CELL)) + if (run->nFlags & (MERF_ENDPARA | MERF_TAB | MERF_CELL)) return; if (run->nFlags & MERF_GRAPHICS) @@ -264,14 +264,14 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa if (c->editor->cPasswordMask) { ME_String *szMasked = ME_MakeStringR(c->editor->cPasswordMask,ME_StrVLen(run->strText)); - ME_DrawTextWithStyle(c, x, y, - szMasked->szData, ME_StrVLen(szMasked), run->style, NULL, + ME_DrawTextWithStyle(c, x, y, + szMasked->szData, ME_StrVLen(szMasked), run->style, NULL, nSelFrom-runofs,nSelTo-runofs, c->pt.y+start->member.row.nYPos, start->member.row.nHeight); ME_DestroyString(szMasked); } else - ME_DrawTextWithStyle(c, x, y, - run->strText->szData, ME_StrVLen(run->strText), run->style, NULL, + ME_DrawTextWithStyle(c, x, y, + run->strText->szData, ME_StrVLen(run->strText), run->style, NULL, nSelFrom-runofs,nSelTo-runofs, c->pt.y+start->member.row.nYPos, start->member.row.nHeight); } } @@ -298,7 +298,7 @@ void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) { int xs, xe; int visible = 0; int nMargWidth = 0; - + c->pt.x = c->rcView.left; rcPara.left = c->rcView.left; rcPara.right = c->rcView.right; @@ -343,7 +343,7 @@ void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) { pt.y = 12+y; ME_DebugWrite(c->hDC, &pt, buf); } - + height = p->member.row.nHeight; baseline = p->member.row.nBaseline; pno++; @@ -396,7 +396,7 @@ void ME_ScrollUp(ME_TextEditor *editor, int cy) } void ME_ScrollDown(ME_TextEditor *editor, int cy) -{ +{ ME_Scroll(editor, cy, 3); } @@ -406,10 +406,10 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) int nOrigPos, nNewPos, nActualScroll; nOrigPos = ME_GetYScrollPos(editor); - + si.cbSize = sizeof(SCROLLINFO); si.fMask = SIF_POS; - + switch (type) { case 1: @@ -428,7 +428,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) FIXME("ME_Scroll called incorrectly\n"); si.nPos = 0; } - + nNewPos = SetScrollInfo(editor->hWnd, SB_VERT, &si, editor->bRedraw); nActualScroll = nOrigPos - nNewPos; if (editor->bRedraw) @@ -439,45 +439,45 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) ScrollWindowEx(editor->hWnd, 0, nActualScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE); ME_Repaint(editor); } - + ME_UpdateScrollBar(editor); } - + void ME_UpdateScrollBar(ME_TextEditor *editor) -{ - /* Note that this is the only funciton that should ever call SetScrolLInfo +{ + /* Note that this is the only funciton that should ever call SetScrolLInfo * with SIF_PAGE or SIF_RANGE. SetScrollPos and SetScrollRange should never * be used at all. */ - + HWND hWnd; SCROLLINFO si; BOOL bScrollBarWasVisible,bScrollBarWillBeVisible; - + if (ME_WrapMarkedParagraphs(editor)) FIXME("ME_UpdateScrollBar had to call ME_WrapMarkedParagraphs\n"); - + hWnd = editor->hWnd; si.cbSize = sizeof(si); bScrollBarWasVisible = ME_GetYScrollVisible(editor); bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy; - + if (bScrollBarWasVisible != bScrollBarWillBeVisible) { ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible); ME_MarkAllForWrapping(editor); ME_WrapMarkedParagraphs(editor); } - + si.fMask = SIF_PAGE | SIF_RANGE; if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL) si.fMask |= SIF_DISABLENOSCROLL; - - si.nMin = 0; + + si.nMin = 0; si.nMax = editor->nTotalLength; - + si.nPage = editor->sizeWindow.cy; - + TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage); SetScrollInfo(hWnd, SB_VERT, &si, TRUE); } @@ -504,18 +504,18 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_DisplayItem *pRun) ME_DisplayItem *pRow = ME_FindItemBack(pRun, diStartRow); ME_DisplayItem *pPara = ME_FindItemBack(pRun, diParagraph); int y, yrel, yheight, yold; - + assert(pRow); assert(pPara); - + y = pPara->member.para.nYPos+pRow->member.row.nYPos; yheight = pRow->member.row.nHeight; yold = ME_GetYScrollPos(editor); yrel = y - yold; - + if (y < yold) ME_ScrollAbs(editor,y); - else if (yrel + yheight > editor->sizeWindow.cy) + else if (yrel + yheight > editor->sizeWindow.cy) ME_ScrollAbs(editor,y+yheight-editor->sizeWindow.cy); } @@ -555,16 +555,16 @@ ME_InvalidateSelection(ME_TextEditor *editor) assert(para1->type == diParagraph); assert(para2->type == diParagraph); /* last selection markers aren't always updated, which means - they can point past the end of the document */ + they can point past the end of the document */ if (editor->nLastSelStart > len) - editor->nLastSelEnd = len; + editor->nLastSelEnd = len; if (editor->nLastSelEnd > len) - editor->nLastSelEnd = len; - + editor->nLastSelEnd = len; + /* if the start part of selection is being expanded or contracted... */ if (nStart < editor->nLastSelStart) { ME_MarkForPainting(editor, para1, ME_FindItemFwd(editor->pLastSelStartPara, diParagraphOrEnd)); - } else + } else if (nStart > editor->nLastSelStart) { ME_MarkForPainting(editor, editor->pLastSelStartPara, ME_FindItemFwd(para1, diParagraphOrEnd)); } @@ -572,7 +572,7 @@ ME_InvalidateSelection(ME_TextEditor *editor) /* if the end part of selection is being contracted or expanded... */ if (nEnd < editor->nLastSelEnd) { ME_MarkForPainting(editor, para2, ME_FindItemFwd(editor->pLastSelEndPara, diParagraphOrEnd)); - } else + } else if (nEnd > editor->nLastSelEnd) { ME_MarkForPainting(editor, editor->pLastSelEndPara, ME_FindItemFwd(para2, diParagraphOrEnd)); } @@ -605,10 +605,10 @@ ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator) || (float)numerator / (float)denominator > 64.0) return FALSE; } - + editor->nZoomNumerator = numerator; editor->nZoomDenominator = denominator; - + ME_RewrapRepaint(editor); return TRUE; } diff --git a/reactos/dll/win32/riched20/para.c b/reactos/dll/win32/riched20/para.c index 1774957bc37..b3413c371d0 100644 --- a/reactos/dll/win32/riched20/para.c +++ b/reactos/dll/win32/riched20/para.c @@ -1,6 +1,6 @@ /* * RichEdit - functions working on paragraphs of text (diParagraph). - * + * * Copyright 2004 by Krzysztof Foltman * Copyright 2006 by Phil Krylov * @@ -17,7 +17,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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ + */ #include "editor.h" @@ -45,7 +45,7 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text) cf.dwMask |= CFM_IMPRINT|CFM_ITALIC|CFM_LINK|CFM_OUTLINE|CFM_PROTECTED; cf.dwMask |= CFM_REVISED|CFM_SHADOW|CFM_SMALLCAPS|CFM_STRIKEOUT; cf.dwMask |= CFM_SUBSCRIPT|CFM_UNDERLINE; - + cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR; lstrcpyW(cf.szFaceName, lf.lfFaceName); cf.yHeight=lf.lfHeight*1440/GetDeviceCaps(hDC, LOGPIXELSY); @@ -55,16 +55,16 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text) if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC; if (lf.lfUnderline) cf.dwEffects |= CFE_UNDERLINE; if (lf.lfStrikeOut) cf.dwEffects |= CFE_STRIKEOUT; - + ZeroMemory(&fmt, sizeof(fmt)); fmt.cbSize = sizeof(fmt); fmt.dwMask = PFM_ALIGNMENT | PFM_OFFSET | PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_TABSTOPS; CopyMemory(para->member.para.pFmt, &fmt, sizeof(PARAFORMAT2)); - + style = ME_MakeStyle(&cf); text->pDefaultStyle = style; - + run = ME_MakeRun(style, ME_MakeString(wszParagraphSign), MERF_ENDPARA); run->member.run.nCharOfs = 0; @@ -77,7 +77,7 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *text) text->pLast->member.para.nCharOfs = 1; } - + void ME_MarkAllForWrapping(ME_TextEditor *editor) { ME_MarkForWrapping(editor, editor->pBuffer->pFirst->member.para.next_para, editor->pBuffer->pLast); @@ -112,8 +112,8 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME int ofs; ME_DisplayItem *pp; int end_len = (editor->bEmulateVersion10 ? 2 : 1); - - assert(run->type == diRun); + + assert(run->type == diRun); run_para = ME_GetParagraph(run); assert(run_para->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); @@ -121,11 +121,11 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME ofs = end_run->member.run.nCharOfs = run->member.run.nCharOfs; next_para = run_para->member.para.next_para; assert(next_para == ME_FindItemFwd(run_para, diParagraphOrEnd)); - + undo = ME_AddUndoItem(editor, diUndoJoinParagraphs, NULL); if (undo) undo->nStart = run_para->member.para.nCharOfs + ofs; - + /* the new paragraph will have a different starting offset, so let's update its runs */ pp = run; while(pp->type == diRun) { @@ -134,18 +134,18 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME } new_para->member.para.nCharOfs = ME_GetParagraph(run)->member.para.nCharOfs+ofs; new_para->member.para.nCharOfs += end_len; - + new_para->member.para.nFlags = MEPF_REWRAP; /* FIXME copy flags (if applicable) */ /* FIXME initialize format style and call ME_SetParaFormat blah blah */ CopyMemory(new_para->member.para.pFmt, run_para->member.para.pFmt, sizeof(PARAFORMAT2)); - + /* FIXME remove this as soon as nLeftMargin etc are replaced with proper fields of PARAFORMAT2 */ new_para->member.para.nLeftMargin = run_para->member.para.nLeftMargin; new_para->member.para.nRightMargin = run_para->member.para.nRightMargin; new_para->member.para.nFirstMargin = run_para->member.para.nFirstMargin; new_para->member.para.bTable = run_para->member.para.bTable; - + /* Inherit previous cell definitions if any */ new_para->member.para.pCells = NULL; if (run_para->member.para.pCells) @@ -164,7 +164,7 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME new_para->member.para.pLastCell = pNewCell; } } - + /* fix paragraph properties. FIXME only needed when called from RTF reader */ if (run_para->member.para.pCells && !run_para->member.para.bTable) { @@ -172,7 +172,7 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME * stored is invalid */ ME_DestroyTableCellList(run_para); } - + /* insert paragraph into paragraph double linked list */ new_para->member.para.prev_para = run_para; new_para->member.para.next_para = next_para; @@ -186,11 +186,11 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, ME /* force rewrap of the */ run_para->member.para.prev_para->member.para.nFlags |= MEPF_REWRAP; new_para->member.para.prev_para->member.para.nFlags |= MEPF_REWRAP; - + /* we've added the end run, so we need to modify nCharOfs in the next paragraphs */ ME_PropagateCharOffset(next_para, end_len); editor->nParagraphs++; - + return new_para; } @@ -206,9 +206,9 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) assert(tp->type == diParagraph); assert(tp->member.para.next_para); assert(tp->member.para.next_para->type == diParagraph); - + pNext = tp->member.para.next_para; - + { /* null char format operation to store the original char format for the ENDPARA run */ CHARFORMAT2W fmt; @@ -222,17 +222,17 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) assert(pNext->member.para.pFmt->cbSize == sizeof(PARAFORMAT2)); CopyMemory(undo->di.member.para.pFmt, pNext->member.para.pFmt, sizeof(PARAFORMAT2)); } - + shift = pNext->member.para.nCharOfs - tp->member.para.nCharOfs - end_len; - + pRun = ME_FindItemBack(pNext, diRunOrParagraph); pFirstRunInNext = ME_FindItemFwd(pNext, diRunOrParagraph); - + assert(pRun); assert(pRun->type == diRun); assert(pRun->member.run.nFlags & MERF_ENDPARA); assert(pFirstRunInNext->type == diRun); - + /* if some cursor points at end of paragraph, make it point to the first run of the next joined paragraph */ for (i=0; inCursors; i++) { @@ -250,7 +250,7 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) TRACE("shifting \"%s\" by %d (previous %d)\n", debugstr_w(pTmp->member.run.strText->szData), shift, pTmp->member.run.nCharOfs); pTmp->member.run.nCharOfs += shift; } while(1); - + ME_Remove(pRun); ME_DestroyDisplayItem(pRun); @@ -258,16 +258,16 @@ ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp) editor->pLastSelStartPara = tp; if (editor->pLastSelEndPara == pNext) editor->pLastSelEndPara = tp; - + tp->member.para.next_para = pNext->member.para.next_para; pNext->member.para.next_para->member.para.prev_para = tp; ME_Remove(pNext); ME_DestroyDisplayItem(pNext); ME_PropagateCharOffset(tp->member.para.next_para, -end_len); - + ME_CheckCharOffsets(editor); - + editor->nParagraphs--; tp->member.para.nFlags |= MEPF_REWRAP; return tp; @@ -299,22 +299,22 @@ void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048]) p += sprintf(p, "Offset: %d\n", (int)pFmt->dxOffset); else p += sprintf(p, "Offset: N/A\n"); - + if (pFmt->dwMask & PFM_OFFSETINDENT) p += sprintf(p, "Offset indent: %d\n", (int)pFmt->dxStartIndent); else p += sprintf(p, "Offset indent: N/A\n"); - + if (pFmt->dwMask & PFM_STARTINDENT) p += sprintf(p, "Start indent: %d\n", (int)pFmt->dxStartIndent); else p += sprintf(p, "Start indent: N/A\n"); - + if (pFmt->dwMask & PFM_RIGHTINDENT) p += sprintf(p, "Right indent: %d\n", (int)pFmt->dxRightIndent); else p += sprintf(p, "Right indent: N/A\n"); - + ME_DumpStyleEffect(&p, "Page break before:", pFmt, PFM_PAGEBREAKBEFORE); } @@ -323,7 +323,7 @@ void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 * PARAFORMAT2 copy; assert(sizeof(*para->member.para.pFmt) == sizeof(PARAFORMAT2)); ME_AddUndoItem(editor, diUndoSetParagraphFormat, para); - + CopyMemory(©, para->member.para.pFmt, sizeof(PARAFORMAT2)); if (pFmt->dwMask & PFM_ALIGNMENT) @@ -334,13 +334,13 @@ void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 * para->member.para.pFmt->dxOffset = pFmt->dxOffset; if (pFmt->dwMask & PFM_OFFSETINDENT) para->member.para.pFmt->dxStartIndent += pFmt->dxStartIndent; - + if (pFmt->dwMask & PFM_TABSTOPS) { para->member.para.pFmt->cTabCount = pFmt->cTabCount; memcpy(para->member.para.pFmt->rgxTabs, pFmt->rgxTabs, pFmt->cTabCount*sizeof(int)); } - + /* FIXME to be continued (indents, bulleting and such) */ if (memcmp(©, para->member.para.pFmt, sizeof(PARAFORMAT2))) @@ -352,7 +352,7 @@ void ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayItem **para_end) { ME_Cursor *pEndCursor = &editor->pCursors[1]; - + *para = ME_GetParagraph(editor->pCursors[0].pRun); *para_end = ME_GetParagraph(editor->pCursors[1].pRun); if ((*para_end)->member.para.nCharOfs < (*para)->member.para.nCharOfs) { @@ -362,7 +362,7 @@ ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayIte *para_end = tmp; pEndCursor = &editor->pCursors[0]; } - + /* selection consists of chars from nFrom up to nTo-1 */ if ((*para_end)->member.para.nCharOfs > (*para)->member.para.nCharOfs) { if (!pEndCursor->nOffset) { @@ -375,9 +375,9 @@ ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayIte void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) { ME_DisplayItem *para, *para_end; - + ME_GetSelectionParas(editor, ¶, ¶_end); - + do { ME_SetParaFormat(editor, para, pFmt); if (para == para_end) @@ -393,37 +393,37 @@ void ME_GetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 * CopyMemory(pFmt, para->member.para.pFmt, sizeof(PARAFORMAT2)); return; } - CopyMemory(pFmt, para->member.para.pFmt, pFmt->cbSize); + CopyMemory(pFmt, para->member.para.pFmt, pFmt->cbSize); } void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) { ME_DisplayItem *para, *para_end; PARAFORMAT2 tmp; - + ME_GetSelectionParas(editor, ¶, ¶_end); - + ME_GetParaFormat(editor, para, pFmt); if (para == para_end) return; - + do { ZeroMemory(&tmp, sizeof(tmp)); tmp.cbSize = sizeof(tmp); ME_GetParaFormat(editor, para, &tmp); - - assert(tmp.dwMask & PFM_ALIGNMENT); + + assert(tmp.dwMask & PFM_ALIGNMENT); if (pFmt->wAlignment != tmp.wAlignment) pFmt->dwMask &= ~PFM_ALIGNMENT; - + assert(tmp.dwMask & PFM_STARTINDENT); if (pFmt->dxStartIndent != tmp.dxStartIndent) pFmt->dwMask &= ~PFM_STARTINDENT; - + assert(tmp.dwMask & PFM_OFFSET); if (pFmt->dxOffset != tmp.dxOffset) pFmt->dwMask &= ~PFM_OFFSET; - - assert(tmp.dwMask & PFM_TABSTOPS); + + assert(tmp.dwMask & PFM_TABSTOPS); if (pFmt->dwMask & PFM_TABSTOPS) { if (pFmt->cTabCount != tmp.cTabCount) pFmt->dwMask &= ~PFM_TABSTOPS; @@ -431,7 +431,7 @@ void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) if (memcmp(pFmt->rgxTabs, tmp.rgxTabs, tmp.cTabCount*sizeof(int))) pFmt->dwMask &= ~PFM_TABSTOPS; } - + if (para == para_end) return; para = para->member.para.next_para; diff --git a/reactos/dll/win32/riched20/reader.c b/reactos/dll/win32/riched20/reader.c index 0cf8ca7f561..6411813f5f4 100644 --- a/reactos/dll/win32/riched20/reader.c +++ b/reactos/dll/win32/riched20/reader.c @@ -2518,7 +2518,7 @@ CharSet(RTF_Info *info) { if (info->ansiCodePage == CP_UTF8) return; - + switch (info->rtfMinor) { case rtfAnsiCharSet: @@ -2546,7 +2546,7 @@ static void Destination (RTF_Info *info) { if (!RTFGetDestinationCallback(info, info->rtfMinor)) - RTFSkipGroup (info); + RTFSkipGroup (info); } @@ -2581,8 +2581,8 @@ static void SpecialChar (RTF_Info *info) { case rtfOptDest: /* the next token determines destination, if it's unknown, skip the group */ - /* this way we filter out the garbage coming from unknown destinations */ - RTFGetToken(info); + /* this way we filter out the garbage coming from unknown destinations */ + RTFGetToken(info); if (info->rtfClass != rtfDestination) RTFSkipGroup(info); else diff --git a/reactos/dll/win32/riched20/richole.c b/reactos/dll/win32/riched20/richole.c index 0585e43edf8..04ad79845bb 100644 --- a/reactos/dll/win32/riched20/richole.c +++ b/reactos/dll/win32/riched20/richole.c @@ -86,8 +86,8 @@ IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj) return S_OK; } FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid) ); - - return E_NOINTERFACE; + + return E_NOINTERFACE; } static ULONG WINAPI diff --git a/reactos/dll/win32/riched20/row.c b/reactos/dll/win32/riched20/row.c index 3abff5f7a51..6bf0062bd2c 100644 --- a/reactos/dll/win32/riched20/row.c +++ b/reactos/dll/win32/riched20/row.c @@ -1,9 +1,9 @@ /* * RichEdit - Operations on rows of text (rows are recreated during * wrapping and are used for displaying the document, they don't keep any - * true document content; delete all rows, rewrap all paragraphs and + * true document content; delete all rows, rewrap all paragraphs and * you get them back). - * + * * Copyright 2004 by Krzysztof Foltman * * This library is free software; you can redistribute it and/or @@ -19,12 +19,12 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ + */ #include "editor.h" -ME_DisplayItem *ME_FindRowStart(ME_Context *c, ME_DisplayItem *item, +ME_DisplayItem *ME_FindRowStart(ME_Context *c, ME_DisplayItem *item, int nRelPos) { ME_DisplayItem *para = ME_GetParagraph(item); ME_MustBeWrapped(c, para); @@ -70,7 +70,7 @@ ME_DisplayItem *ME_FindRowStart(ME_Context *c, ME_DisplayItem *item, /* I'm sure these functions would simplify some code in caret ops etc, * I just didn't remember them when I wrote that code - */ + */ ME_DisplayItem *ME_RowStart(ME_DisplayItem *item) { return ME_FindItemBackOrHere(item, diStartRow); @@ -89,7 +89,7 @@ ME_FindRowWithNumber(ME_TextEditor *editor, int nRow) { ME_DisplayItem *item = ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph); int nCount = 0; - + while (item && nCount + item->member.para.nRows <= nRow) { nCount += item->member.para.nRows; @@ -117,7 +117,7 @@ ME_RowNumberFromCharOfs(ME_TextEditor *editor, int nOfs) if (item) { ME_DisplayItem *next_para = item->member.para.next_para; - + nOfs -= item->member.para.nCharOfs; item = ME_FindItemFwd(item, diRun); while ((item = ME_FindItemFwd(item, diStartRowOrParagraph)) != NULL) diff --git a/reactos/dll/win32/riched20/rtf.h b/reactos/dll/win32/riched20/rtf.h index be36a93e0e1..b88592b5ac0 100644 --- a/reactos/dll/win32/riched20/rtf.h +++ b/reactos/dll/win32/riched20/rtf.h @@ -1083,7 +1083,7 @@ struct _RTF_Info { /* edit window to output to */ HWND hwndEdit; - + ME_TextEditor *editor; ME_Style *style; diff --git a/reactos/dll/win32/riched20/run.c b/reactos/dll/win32/riched20/run.c index 29fc309ce21..dca64b657e6 100644 --- a/reactos/dll/win32/riched20/run.c +++ b/reactos/dll/win32/riched20/run.c @@ -31,7 +31,7 @@ WINE_DECLARE_DEBUG_CHANNEL(richedit_lists); * ME_CanJoinRuns * * Returns 1 if two runs can be safely merged into one, 0 otherwise. - */ + */ int ME_CanJoinRuns(ME_Run *run1, ME_Run *run2) { if ((run1->nFlags | run2->nFlags) & MERF_NOJOIN) @@ -53,15 +53,15 @@ void ME_SkipAndPropagateCharOffset(ME_DisplayItem *p, int shift) /****************************************************************************** * ME_PropagateCharOffsets * - * Shifts (increases or decreases) character offset (relative to beginning of - * the document) of the part of the text starting from given place. - */ + * Shifts (increases or decreases) character offset (relative to beginning of + * the document) of the part of the text starting from given place. + */ void ME_PropagateCharOffset(ME_DisplayItem *p, int shift) { /* Runs in one paragraph contain character offset relative to their owning * paragraph. If we start the shifting from the run, we need to shift * all the relative offsets until the end of the paragraph - */ + */ if (p->type == diRun) /* propagate in all runs in this para */ { TRACE("PropagateCharOffset(%s, %d)\n", debugstr_w(p->member.run.strText->szData), shift); @@ -71,10 +71,10 @@ void ME_PropagateCharOffset(ME_DisplayItem *p, int shift) p = ME_FindItemFwd(p, diRunOrParagraphOrEnd); } while(p->type == diRun); } - /* Runs in next paragraphs don't need their offsets updated, because they, + /* Runs in next paragraphs don't need their offsets updated, because they, * again, those offsets are relative to their respective paragraphs. - * Instead of that, we're updating paragraphs' character offsets. - */ + * Instead of that, we're updating paragraphs' character offsets. + */ if (p->type == diParagraph) /* propagate in all next paras */ { do { @@ -95,9 +95,9 @@ void ME_PropagateCharOffset(ME_DisplayItem *p, int shift) /****************************************************************************** * ME_CheckCharOffsets - * + * * Checks if editor lists' validity and optionally dumps the document structure - */ + */ void ME_CheckCharOffsets(ME_TextEditor *editor) { ME_DisplayItem *p = editor->pBuffer->pFirst; @@ -140,11 +140,11 @@ void ME_CheckCharOffsets(ME_TextEditor *editor) /****************************************************************************** * ME_CharOfsFromRunOfs - * + * * Converts a character position relative to the start of the run, to a * character position relative to the start of the document. - * Kind of a "local to global" offset conversion. - */ + * Kind of a "local to global" offset conversion. + */ int ME_CharOfsFromRunOfs(ME_TextEditor *editor, ME_DisplayItem *pRun, int nOfs) { ME_DisplayItem *pPara; @@ -161,11 +161,11 @@ int ME_CharOfsFromRunOfs(ME_TextEditor *editor, ME_DisplayItem *pRun, int nOfs) /****************************************************************************** * ME_CursorFromCharOfs - * + * * Converts a character offset (relative to the start of the document) to - * a cursor structure (which contains a run and a position relative to that - * run). - */ + * a cursor structure (which contains a run and a position relative to that + * run). + */ void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCursor) { ME_RunOfsFromCharOfs(editor, nCharOfs, &pCursor->pRun, &pCursor->nOffset); @@ -173,11 +173,11 @@ void ME_CursorFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_Cursor *pCurso /****************************************************************************** * ME_RunOfsFromCharOfs - * + * * Find a run and relative character offset given an absolute character offset * (absolute offset being an offset relative to the start of the document). - * Kind of a "global to local" offset conversion. - */ + * Kind of a "global to local" offset conversion. + */ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem **ppRun, int *pOfs) { ME_DisplayItem *pPara; @@ -226,9 +226,9 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem ** /****************************************************************************** * ME_JoinRuns - * + * * Merges two adjacent runs, the one given as a parameter and the next one. - */ + */ void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p) { ME_DisplayItem *pNext = p->next; @@ -238,7 +238,7 @@ void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p) ME_GetParagraph(p)->member.para.nFlags |= MEPF_REWRAP; /* if we were at the end of screen line, and the next run is in the new - * line, then it's not the end of the line anymore */ + * line, then it's not the end of the line anymore */ if (editor->bCaretAtEnd && editor->pCursors[0].pRun == pNext) editor->bCaretAtEnd = FALSE; /* Update all cursors so that they don't contain the soon deleted run */ @@ -263,10 +263,10 @@ void ME_JoinRuns(ME_TextEditor *editor, ME_DisplayItem *p) /****************************************************************************** * ME_SplitRun - * + * * Splits a run into two in a given place. It also updates the screen position - * and size (extent) of the newly generated runs. - */ + * and size (extent) of the newly generated runs. + */ ME_DisplayItem *ME_SplitRun(ME_Context *c, ME_DisplayItem *item, int nVChar) { ME_TextEditor *editor = c->editor; @@ -312,10 +312,10 @@ ME_DisplayItem *ME_SplitRun(ME_Context *c, ME_DisplayItem *item, int nVChar) /****************************************************************************** * ME_SplitRunSimple - * + * * Does the most basic job of splitting a run into two - it does not - * update the positions and extents. - */ + * update the positions and extents. + */ ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_DisplayItem *item, int nVChar) { ME_Run *run = &item->member.run; @@ -352,9 +352,9 @@ ME_DisplayItem *ME_SplitRunSimple(ME_TextEditor *editor, ME_DisplayItem *item, i /****************************************************************************** * ME_MakeRun - * + * * A helper function to create run structures quickly. - */ + */ ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags) { ME_DisplayItem *item = ME_MakeDI(diRun); @@ -368,9 +368,9 @@ ME_DisplayItem *ME_MakeRun(ME_Style *s, ME_String *strData, int nFlags) /****************************************************************************** * ME_InsertRun - * + * * Inserts a run at a given character position (offset). - */ + */ ME_DisplayItem *ME_InsertRun(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem *pItem) { ME_Cursor tmp; @@ -383,38 +383,38 @@ ME_DisplayItem *ME_InsertRun(ME_TextEditor *editor, int nCharOfs, ME_DisplayItem pItem->member.run.strText->szData, pItem->member.run.strText->nLen, pItem->member.run.nFlags); - + return pDI; } /****************************************************************************** * ME_InsertRunAtCursor - * + * * Inserts a new run with given style, flags and content at a given position, - * which is passed as a cursor structure (which consists of a run and - * a run-relative character offset). - */ + * which is passed as a cursor structure (which consists of a run and + * a run-relative character offset). + */ ME_DisplayItem * ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, const WCHAR *str, int len, int flags) { ME_DisplayItem *pDI; ME_UndoItem *pUI; - + if (cursor->nOffset) { /* We're inserting at the middle of the existing run, which means that * that run must be split. It isn't always necessary, but */ cursor->pRun = ME_SplitRunSimple(editor, cursor->pRun, cursor->nOffset); cursor->nOffset = 0; } - + pUI = ME_AddUndoItem(editor, diUndoDeleteRun, NULL); if (pUI) { pUI->nStart = (ME_GetParagraph(cursor->pRun)->member.para.nCharOfs + cursor->pRun->member.run.nCharOfs); pUI->nLen = len; } - + pDI = ME_MakeRun(style, ME_MakeStringN(str, len), flags); pDI->member.run.nCharOfs = cursor->pRun->member.run.nCharOfs; ME_InsertBefore(cursor->pRun, pDI); @@ -426,11 +426,11 @@ ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor, ME_Style *style, /****************************************************************************** * ME_UpdateRunFlags - * + * * Determine some of run attributes given its content (style, text content). - * Some flags cannot be determined by this function (MERF_GRAPHICS, - * MERF_ENDPARA) - */ + * Some flags cannot be determined by this function (MERF_GRAPHICS, + * MERF_ENDPARA) + */ void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run) { assert(run->nCharOfs != -1); @@ -469,10 +469,10 @@ void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run) /****************************************************************************** * ME_GetGraphicsSize - * + * * Sets run extent for graphics runs. This functionality is just a placeholder * for future OLE object support, and will be removed. - */ + */ void ME_GetGraphicsSize(ME_TextEditor *editor, ME_Run *run, SIZE *pSize) { assert(run->nFlags & MERF_GRAPHICS); @@ -482,11 +482,11 @@ void ME_GetGraphicsSize(ME_TextEditor *editor, ME_Run *run, SIZE *pSize) /****************************************************************************** * ME_CharFromPoint - * + * * Returns a character position inside the run given a run-relative * pixel horizontal position. This version rounds left (ie. if the second - * character is at pixel position 8, then for cx=0..7 it returns 0). - */ + * character is at pixel position 8, then for cx=0..7 it returns 0). + */ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run) { int fit = 0; @@ -498,7 +498,7 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run) if (run->nFlags & (MERF_TAB | MERF_CELL)) { - if (cx < run->nWidth/2) + if (cx < run->nWidth/2) return 0; return 1; } @@ -512,7 +512,7 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run) } hDC = GetDC(editor->hWnd); hOldFont = ME_SelectStyleFont(editor, hDC, run->style); - + if (editor->cPasswordMask) { ME_String *strMasked = ME_MakeStringR(editor->cPasswordMask,ME_StrVLen(run->strText)); @@ -525,7 +525,7 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run) GetTextExtentExPointW(hDC, run->strText->szData, run->strText->nLen, cx, &fit, NULL, &sz); } - + ME_UnselectStyleFont(editor, hDC, run->style, hOldFont); ReleaseDC(editor->hWnd, hDC); return fit; @@ -533,20 +533,20 @@ int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run) /****************************************************************************** * ME_CharFromPointCursor - * + * * Returns a character position inside the run given a run-relative - * pixel horizontal position. This version rounds to the nearest character edge - * (ie. if the second character is at pixel position 8, then for cx=0..3 + * pixel horizontal position. This version rounds to the nearest character edge + * (ie. if the second character is at pixel position 8, then for cx=0..3 * it returns 0, and for cx=4..7 it returns 1). - * + * * It is used for mouse click handling, for better usability (and compatibility - * with the native control). - */ + * with the native control). + */ int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run) { ME_String *strRunText; /* This could point to either the run's real text, or it's masked form in a password control */ - + int fit = 0, fit1 = 0; HGDIOBJ hOldFont; HDC hDC; @@ -568,7 +568,7 @@ int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run) return 0; return 1; } - + if (editor->cPasswordMask) strRunText = ME_MakeStringR(editor->cPasswordMask,ME_StrVLen(run->strText)); else @@ -588,10 +588,10 @@ int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run) if (cx >= (sz2.cx+sz3.cx)/2) fit = fit1; } - + if (editor->cPasswordMask) ME_DestroyString(strRunText); - + ME_UnselectStyleFont(editor, hDC, run->style, hOldFont); ReleaseDC(editor->hWnd, hDC); return fit; @@ -599,10 +599,10 @@ int ME_CharFromPointCursor(ME_TextEditor *editor, int cx, ME_Run *run) /****************************************************************************** * ME_PointFromChar - * + * * Returns a run-relative pixel position given a run-relative character * position (character offset) - */ + */ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset) { SIZE size; @@ -617,12 +617,12 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset) ME_GetGraphicsSize(editor, pRun, &size); return 1; } - + if (editor->cPasswordMask) strRunText = ME_MakeStringR(editor->cPasswordMask,ME_StrVLen(pRun->strText)); else strRunText = pRun->strText; - + hOldFont = ME_SelectStyleFont(editor, hDC, pRun->style); GetTextExtentPoint32W(hDC, strRunText->szData, nOffset, &size); ME_UnselectStyleFont(editor, hDC, pRun->style, hOldFont); @@ -648,7 +648,7 @@ static void ME_GetTextExtent(ME_Context *c, LPCWSTR szText, int nChars, ME_Style /****************************************************************************** * ME_GetRunSizeCommon - * + * * Finds width, height, ascent and descent of a run, up to given character * (nLen). */ @@ -665,11 +665,11 @@ static SIZE ME_GetRunSizeCommon(ME_Context *c, ME_Paragraph *para, ME_Run *run, * this is wasteful for MERF_NONTEXT runs, but that shouldn't matter * in practice */ - + if (c->editor->cPasswordMask) { ME_String *szMasked = ME_MakeStringR(c->editor->cPasswordMask,nLen); - ME_GetTextExtent(c, szMasked->szData, nLen,run->style, &size); + ME_GetTextExtent(c, szMasked->szData, nLen,run->style, &size); ME_DestroyString(szMasked); } else @@ -724,10 +724,10 @@ static SIZE ME_GetRunSizeCommon(ME_Context *c, ME_Paragraph *para, ME_Run *run, /****************************************************************************** * ME_GetRunSize - * + * * Finds width and height (but not ascent and descent) of a part of the run - * up to given character. - */ + * up to given character. + */ SIZE ME_GetRunSize(ME_Context *c, ME_Paragraph *para, ME_Run *run, int nLen) { int asc, desc; @@ -736,11 +736,11 @@ SIZE ME_GetRunSize(ME_Context *c, ME_Paragraph *para, ME_Run *run, int nLen) /****************************************************************************** * ME_CalcRunExtent - * + * * Updates the size of the run (fills width, ascent and descent). The height * is calculated based on whole row's ascent and descent anyway, so no need - * to use it here. - */ + * to use it here. + */ void ME_CalcRunExtent(ME_Context *c, ME_Paragraph *para, ME_Run *run) { if (run->nFlags & MERF_HIDDEN) @@ -757,10 +757,10 @@ void ME_CalcRunExtent(ME_Context *c, ME_Paragraph *para, ME_Run *run) /****************************************************************************** * ME_MustBeWrapped - * + * * This should ensure that the given paragraph is wrapped so that its screen - * row structure may be used. But it doesn't, yet. - */ + * row structure may be used. But it doesn't, yet. + */ void ME_MustBeWrapped(ME_Context *c, ME_DisplayItem *para) { assert(para->type == diParagraph); @@ -769,10 +769,10 @@ void ME_MustBeWrapped(ME_Context *c, ME_DisplayItem *para) /****************************************************************************** * ME_SetSelectionCharFormat - * + * * Applies a style change, either to a current selection, or to insert cursor * (ie. the style next typed characters will use). - */ + */ void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) { int nFrom, nTo; @@ -792,9 +792,9 @@ void ME_SetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) /****************************************************************************** * ME_SetCharFormat - * + * * Applies a style change to the specified part of the text - */ + */ void ME_SetCharFormat(ME_TextEditor *editor, int nOfs, int nChars, CHARFORMAT2W *pFmt) { ME_Cursor tmp, tmp2; @@ -841,9 +841,9 @@ void ME_SetCharFormat(ME_TextEditor *editor, int nOfs, int nChars, CHARFORMAT2W /****************************************************************************** * ME_SetDefaultCharFormat - * + * * Applies a style change to the default character style. - */ + */ void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) { ME_Style *style; @@ -872,10 +872,10 @@ static void ME_GetRunCharFormat(ME_TextEditor *editor, ME_DisplayItem *run, CHAR /****************************************************************************** * ME_GetDefaultCharFormat - * + * * Retrieves the current default character style (the one applied where no * other style was applied) . - */ + */ void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) { int nFrom, nTo; @@ -885,10 +885,10 @@ void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) /****************************************************************************** * ME_GetSelectionCharFormat - * + * * If selection exists, it returns all style elements that are set consistently - * in the whole selection. If not, it just returns the current style. - */ + * in the whole selection. If not, it just returns the current style. + */ void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) { int nFrom, nTo; @@ -903,10 +903,10 @@ void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) /****************************************************************************** * ME_GetCharFormat - * + * * Returns the style consisting of those attributes which are consistently set - * in the whole character range. - */ + * in the whole character range. + */ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *pFmt) { ME_DisplayItem *run, *run_end; @@ -927,7 +927,7 @@ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *p ME_GetRunCharFormat(editor, run, pFmt); return; } - + if (nTo>nFrom) /* selection consists of chars from nFrom up to nTo-1 */ nTo--; ME_RunOfsFromCharOfs(editor, nTo, &run_end, &nOffset2); diff --git a/reactos/dll/win32/riched20/string.c b/reactos/dll/win32/riched20/string.c index 10f62397afa..bb4287bbba1 100644 --- a/reactos/dll/win32/riched20/string.c +++ b/reactos/dll/win32/riched20/string.c @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "editor.h" +#include "editor.h" WINE_DEFAULT_DEBUG_CHANNEL(richedit); @@ -40,7 +40,7 @@ ME_String *ME_MakeString(LPCWSTR szText) ME_String *ME_MakeStringN(LPCWSTR szText, int nMaxChars) { ME_String *s = ALLOC_OBJ(ME_String); - + s->nLen = nMaxChars; s->nBuffer = ME_GetOptimalBuffer(s->nLen+1); s->szData = ALLOC_N_OBJ(WCHAR, s->nBuffer); @@ -54,7 +54,7 @@ ME_String *ME_MakeStringR(WCHAR cRepeat, int nMaxChars) { /* Make a string by repeating a char nMaxChars times */ int i; ME_String *s = ALLOC_OBJ(ME_String); - + s->nLen = nMaxChars; s->nBuffer = ME_GetOptimalBuffer(s->nLen+1); s->szData = ALLOC_N_OBJ(WCHAR, s->nBuffer); @@ -68,7 +68,7 @@ ME_String *ME_MakeStringR(WCHAR cRepeat, int nMaxChars) ME_String *ME_MakeStringB(int nMaxChars) { /* Create a buffer (uninitialized string) of size nMaxChars */ ME_String *s = ALLOC_OBJ(ME_String); - + s->nLen = nMaxChars; s->nBuffer = ME_GetOptimalBuffer(s->nLen+1); s->szData = ALLOC_N_OBJ(WCHAR, s->nBuffer); @@ -98,7 +98,7 @@ void ME_AppendString(ME_String *s1, ME_String *s2) WCHAR *buf; s1->nBuffer = ME_GetOptimalBuffer(s1->nLen+s2->nLen+1); - buf = ALLOC_N_OBJ(WCHAR, s1->nBuffer); + buf = ALLOC_N_OBJ(WCHAR, s1->nBuffer); lstrcpyW(buf, s1->szData); lstrcpyW(buf+s1->nLen, s2->szData); FREE_OBJ(s1->szData); @@ -115,7 +115,7 @@ ME_String *ME_ConcatString(ME_String *s1, ME_String *s2) s->szData = ALLOC_N_OBJ(WCHAR, s->nBuffer); lstrcpyW(s->szData, s1->szData); lstrcpyW(s->szData+s1->nLen, s2->szData); - return s; + return s; } ME_String *ME_VSplitString(ME_String *orig, int charidx) @@ -173,7 +173,7 @@ int ME_CalcSkipChars(ME_String *s) } */ -int ME_StrLen(ME_String *s) { +int ME_StrLen(ME_String *s) { return s->nLen; } @@ -184,13 +184,13 @@ int ME_StrVLen(ME_String *s) { int ME_StrRelPos(ME_String *s, int nVChar, int *pRelChars) { int nRelChars = *pRelChars; - + TRACE("%s,%d,&%d\n", debugstr_w(s->szData), nVChar, *pRelChars); assert(*pRelChars); if (!nRelChars) return nVChar; - + if (nRelChars>0) nRelChars = min(*pRelChars, s->nLen - nVChar); else @@ -234,11 +234,11 @@ int ME_PosToVPos(ME_String *s, int nPos) void ME_StrDeleteV(ME_String *s, int nVChar, int nChars) { int end_ofs; - + assert(nVChar >=0 && nVChar <= s->nLen); assert(nChars >= 0); assert(nVChar+nChars <= s->nLen); - + end_ofs = ME_StrRelPos2(s, nVChar, nChars); assert(end_ofs <= s->nLen); memmove(s->szData+nVChar, s->szData+end_ofs, 2*(s->nLen+1-end_ofs)); @@ -248,11 +248,11 @@ void ME_StrDeleteV(ME_String *s, int nVChar, int nChars) int ME_GetCharFwd(ME_String *s, int nPos) { int nVPos = 0; - + assert(nPos < ME_StrLen(s)); if (nPos) nVPos = ME_StrRelPos2(s, nVPos, nPos); - + if (nVPos < s->nLen) return s->szData[nVPos]; return -1; @@ -261,11 +261,11 @@ int ME_GetCharFwd(ME_String *s, int nPos) int ME_GetCharBack(ME_String *s, int nPos) { int nVPos = ME_StrVLen(s); - + assert(nPos < ME_StrLen(s)); if (nPos) nVPos = ME_StrRelPos2(s, nVPos, -nPos); - + if (nVPos < s->nLen) return s->szData[nVPos]; return -1; @@ -275,7 +275,7 @@ int ME_FindNonWhitespaceV(ME_String *s, int nVChar) { int i; for (i = nVChar; inLen && ME_IsWSpace(s->szData[i]); i++) ; - + return i; } @@ -284,7 +284,7 @@ int ME_ReverseFindNonWhitespaceV(ME_String *s, int nVChar) { int i; for (i = nVChar; i>0 && ME_IsWSpace(s->szData[i-1]); i--) ; - + return i; } @@ -293,7 +293,7 @@ int ME_ReverseFindWhitespaceV(ME_String *s, int nVChar) { int i; for (i = nVChar; i>0 && !ME_IsWSpace(s->szData[i-1]); i--) ; - + return i; } diff --git a/reactos/dll/win32/riched20/style.c b/reactos/dll/win32/riched20/style.c index 1dfdef1d64a..ccaf932e7cd 100644 --- a/reactos/dll/win32/riched20/style.c +++ b/reactos/dll/win32/riched20/style.c @@ -60,7 +60,7 @@ CHARFORMAT2W *ME_ToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from) return to; } - assert(from->cbSize >= sizeof(CHARFORMAT2W)); + assert(from->cbSize >= sizeof(CHARFORMAT2W)); return from; } @@ -100,7 +100,7 @@ CHARFORMAT2W *ME_ToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from) t->cbSize = sizeof(*t); /* it was overwritten by CopyMemory */ return to; } - assert(to->cbSize >= sizeof(CHARFORMAT2W)); + assert(to->cbSize >= sizeof(CHARFORMAT2W)); return from; } @@ -113,7 +113,7 @@ void ME_CopyToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from) ME_Style *ME_MakeStyle(CHARFORMAT2W *style) { CHARFORMAT2W styledata; ME_Style *s = ALLOC_OBJ(ME_Style); - + style = ME_ToCF2W(&styledata, style); memset(s, 0, sizeof(ME_Style)); if (style->cbSize <= sizeof(CHARFORMAT2W)) @@ -141,7 +141,7 @@ ME_Style *ME_MakeStyle(CHARFORMAT2W *style) { s->fmt.dwMask |= mask;\ CopyMemory(s->fmt.member, style->member, sizeof(style->member));\ } - + void ME_InitCharFormat2W(CHARFORMAT2W *pFmt) { ZeroMemory(pFmt, sizeof(CHARFORMAT2W)); @@ -167,7 +167,7 @@ ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) COPY_STYLE_ITEM(CFM_STYLE, sStyle); COPY_STYLE_ITEM(CFM_UNDERLINETYPE, bUnderlineType); COPY_STYLE_ITEM(CFM_WEIGHT, wWeight); - + s->fmt.dwEffects &= ~(style->dwMask); s->fmt.dwEffects |= style->dwEffects & style->dwMask; s->fmt.dwMask |= style->dwMask; @@ -212,8 +212,8 @@ void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]) WCHAR *q = pFmt->szFaceName; while(*q) { *p++ = (*q > 255) ? '?' : *q; - q++; - } + q++; + } } else p += sprintf(p, "N/A"); @@ -221,7 +221,7 @@ void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]) p += sprintf(p, "\nFont size: %d\n", (int)pFmt->yHeight); else p += sprintf(p, "\nFont size: N/A\n"); - + if (pFmt->dwMask & CFM_OFFSET) p += sprintf(p, "Char offset: %d\n", (int)pFmt->yOffset); else @@ -231,7 +231,7 @@ void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]) p += sprintf(p, "Font charset: %d\n", (int)pFmt->bCharSet); else p += sprintf(p, "Font charset: N/A\n"); - + /* I'm assuming CFM_xxx and CFE_xxx are the same values, fortunately it IS true wrt used flags*/ ME_DumpStyleEffect(&p, "Font bold:", pFmt, CFM_BOLD); ME_DumpStyleEffect(&p, "Font italic:", pFmt, CFM_ITALIC); @@ -267,7 +267,7 @@ ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, ME_Style *s, int nZoomNumerator, int nZoomDenominator = 1; } lf->lfHeight = -s->fmt.yHeight*ry*nZoomNumerator/nZoomDenominator/1440; - + lf->lfWeight = 400; if (s->fmt.dwEffects & s->fmt.dwMask & CFM_BOLD) lf->lfWeight = 700; @@ -289,7 +289,7 @@ ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, ME_Style *s, int nZoomNumerator, int void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt) { int rx, ry; - + ME_InitCharFormat2W(fmt); rx = GetDeviceCaps(hDC, LOGPIXELSX); ry = GetDeviceCaps(hDC, LOGPIXELSY); @@ -325,9 +325,9 @@ HFONT ME_SelectStyleFont(ME_TextEditor *editor, HDC hDC, ME_Style *s) ME_FontCacheItem *item; assert(hDC); assert(s); - + ME_LogFontFromStyle(hDC, &lf, s, editor->nZoomNumerator, editor->nZoomDenominator); - + for (i=0; ipFontCache[i].nAge++; for (i=0, nEmpty=-1, nAge=0; imember.run.style); diff --git a/reactos/dll/win32/riched20/undo.c b/reactos/dll/win32/riched20/undo.c index 2a9d9156033..403a291b88a 100644 --- a/reactos/dll/win32/riched20/undo.c +++ b/reactos/dll/win32/riched20/undo.c @@ -25,10 +25,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); void ME_EmptyUndoStack(ME_TextEditor *editor) { ME_DisplayItem *p, *pNext; - + if (editor->nUndoMode == umIgnore) return; - + TRACE("Emptying undo stack\n"); p = editor->pUndoStack; @@ -36,16 +36,16 @@ void ME_EmptyUndoStack(ME_TextEditor *editor) editor->nUndoStackSize = 0; while(p) { pNext = p->next; - ME_DestroyDisplayItem(p); + ME_DestroyDisplayItem(p); p = pNext; - } + } p = editor->pRedoStack; editor->pRedoStack = NULL; while(p) { pNext = p->next; - ME_DestroyDisplayItem(p); + ME_DestroyDisplayItem(p); p = pNext; - } + } } ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayItem *pdi) { @@ -82,7 +82,7 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayIte pItem->member.para.pFmt = ALLOC_OBJ(PARAFORMAT2); pItem->member.para.pFmt->cbSize = sizeof(PARAFORMAT2); pItem->member.para.pFmt->dwMask = 0; - + break; default: assert(0 == "AddUndoItem, unsupported item type"); @@ -105,7 +105,7 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayIte else editor->pUndoStackBottom = pItem; editor->pUndoStack = pItem; - + if (editor->nUndoStackSize > editor->nUndoLimit) { /* remove oldest undo from stack */ ME_DisplayItem *p = editor->pUndoStackBottom; @@ -150,9 +150,9 @@ ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayIte void ME_CommitUndo(ME_TextEditor *editor) { if (editor->nUndoMode == umIgnore) return; - + assert(editor->nUndoMode == umAddToUndo); - + /* no transactions, no need to commit */ if (!editor->pUndoStack) return; @@ -160,7 +160,7 @@ void ME_CommitUndo(ME_TextEditor *editor) { /* no need to commit empty transactions */ if (editor->pUndoStack->type == diUndoEndTransaction) return; - + ME_AddUndoItem(editor, diUndoEndTransaction, NULL); ME_SendSelChange(editor); } @@ -232,18 +232,18 @@ static void ME_PlayUndoItem(ME_TextEditor *editor, ME_DisplayItem *pItem) void ME_Undo(ME_TextEditor *editor) { ME_DisplayItem *p; ME_UndoMode nMode = editor->nUndoMode; - + if (editor->nUndoMode == umIgnore) return; assert(nMode == umAddToUndo || nMode == umIgnore); - + /* no undo items ? */ if (!editor->pUndoStack) return; - + /* watch out for uncommited transactions ! */ assert(editor->pUndoStack->type == diUndoEndTransaction); - + editor->nUndoMode = umAddToRedo; p = editor->pUndoStack->next; ME_DestroyDisplayItem(editor->pUndoStack); @@ -265,18 +265,18 @@ void ME_Undo(ME_TextEditor *editor) { void ME_Redo(ME_TextEditor *editor) { ME_DisplayItem *p; ME_UndoMode nMode = editor->nUndoMode; - + assert(nMode == umAddToUndo || nMode == umIgnore); - + if (editor->nUndoMode == umIgnore) return; /* no redo items ? */ if (!editor->pRedoStack) return; - + /* watch out for uncommited transactions ! */ assert(editor->pRedoStack->type == diUndoEndTransaction); - + editor->nUndoMode = umAddBackToUndo; p = editor->pRedoStack->next; ME_DestroyDisplayItem(editor->pRedoStack); diff --git a/reactos/dll/win32/riched20/wrap.c b/reactos/dll/win32/riched20/wrap.c index af6e9a9152e..e39297dc096 100644 --- a/reactos/dll/win32/riched20/wrap.c +++ b/reactos/dll/win32/riched20/wrap.c @@ -457,12 +457,12 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) { } editor->sizeWindow.cx = c.rcView.right-c.rcView.left; editor->sizeWindow.cy = c.rcView.bottom-c.rcView.top; - + editor->nTotalLength = c.pt.y; ME_DestroyContext(&c); ReleaseDC(hWnd, hDC); - + if (bModified || editor->nTotalLength < editor->nLastTotalLength) ME_InvalidateMarkedParagraphs(editor); return bModified; @@ -476,11 +476,11 @@ void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) { if (editor->bRedraw) { RECT rc = c.rcView; - int ofs = ME_GetYScrollPos(editor); - + int ofs = ME_GetYScrollPos(editor); + ME_DisplayItem *item = editor->pBuffer->pFirst; while(item != editor->pBuffer->pLast) { - if (item->member.para.nFlags & MEPF_REPAINT) { + if (item->member.para.nFlags & MEPF_REPAINT) { rc.top = item->member.para.nYPos - ofs; rc.bottom = item->member.para.nYPos + item->member.para.nHeight - ofs; InvalidateRect(editor->hWnd, &rc, TRUE); @@ -517,7 +517,7 @@ ME_SendRequestResize(ME_TextEditor *editor, BOOL force) info.nmhdr.code = EN_REQUESTRESIZE; info.rc = rc; info.rc.bottom = editor->nTotalLength; - + SendMessageW(GetParent(editor->hWnd), WM_NOTIFY, info.nmhdr.idFrom, (LPARAM)&info); } diff --git a/reactos/dll/win32/riched20/writer.c b/reactos/dll/win32/riched20/writer.c index e964ce76836..dee72e372bc 100644 --- a/reactos/dll/win32/riched20/writer.c +++ b/reactos/dll/win32/riched20/writer.c @@ -60,7 +60,7 @@ ME_StreamOutFlush(ME_OutStream *pStream) pStream->pos - nStart, &nWritten); TRACE("error=%u written=%u\n", stream->dwError, nWritten); if (nWritten > (pStream->pos - nStart) || nWritten<0) { - FIXME("Invalid returned written size *pcb: 0x%x (%d) instead of %d\n", + FIXME("Invalid returned written size *pcb: 0x%x (%d) instead of %d\n", (unsigned)nWritten, nWritten, nRemaining); nWritten = nRemaining; } @@ -116,7 +116,7 @@ ME_StreamOutPrint(ME_OutStream *pStream, const char *format, ...) va_start(valist, format); len = vsnprintf(string, sizeof(string), format, valist); va_end(valist); - + return ME_StreamOutMove(pStream, string, len); } @@ -128,10 +128,10 @@ ME_StreamOutRTFHeader(ME_OutStream *pStream, int dwFormat) UINT nCodePage; LANGID language; BOOL success; - + if (dwFormat & SF_USECODEPAGE) { CPINFOEXW info; - + switch (HIWORD(dwFormat)) { case CP_ACP: cCharSet = "ansi"; @@ -177,10 +177,10 @@ ME_StreamOutRTFHeader(ME_OutStream *pStream, int dwFormat) return FALSE; pStream->nDefaultCodePage = nCodePage; - + /* FIXME: This should be a document property */ /* TODO: handle SFF_PLAINRTF */ - language = GetUserDefaultLangID(); + language = GetUserDefaultLangID(); if (!ME_StreamOutPrint(pStream, "\\deff0\\deflang%u\\deflangfe%u", language, language)) return FALSE; @@ -197,7 +197,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ME_DisplayItem *item = pFirstRun; ME_FontTableItem *table = pStream->fonttbl; int i; - + do { CHARFORMAT2W *fmt = &item->member.run.style->fmt; COLORREF crColor; @@ -205,7 +205,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, if (fmt->dwMask & CFM_FACE) { WCHAR *face = fmt->szFaceName; BYTE bCharSet = (fmt->dwMask & CFM_CHARSET) ? fmt->bCharSet : DEFAULT_CHARSET; - + for (i = 0; i < pStream->nFontTblLen; i++) if (table[i].bCharSet == bCharSet && (table[i].szFaceName == face || !lstrcmpW(table[i].szFaceName, face))) @@ -216,7 +216,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, pStream->nFontTblLen++; } } - + if (fmt->dwMask & CFM_COLOR && !(fmt->dwEffects & CFE_AUTOCOLOR)) { crColor = fmt->crTextColor; for (i = 1; i < pStream->nColorTblLen; i++) @@ -242,10 +242,10 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, break; item = ME_FindItemFwd(item, diRun); } while (item); - + if (!ME_StreamOutPrint(pStream, "{\\fonttbl")) return FALSE; - + for (i = 0; i < pStream->nFontTblLen; i++) { if (table[i].bCharSet != DEFAULT_CHARSET) { if (!ME_StreamOutPrint(pStream, "{\\f%u\\fcharset%u ", i, table[i].bCharSet)) @@ -291,7 +291,7 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) if (para->member.para.pCells) { ME_TableCell *cell = para->member.para.pCells; - + if (!ME_StreamOutPrint(pStream, "\\trowd")) return FALSE; do { @@ -302,19 +302,19 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) } while (cell); props[0] = '\0'; } - + /* TODO: Don't emit anything if the last PARAFORMAT2 is inherited */ if (!ME_StreamOutPrint(pStream, "\\pard")) return FALSE; if (para->member.para.bTable) strcat(props, "\\intbl"); - + /* TODO: PFM_BORDER. M$ does not emit any keywords for these properties, and * when streaming border keywords in, PFM_BORDER is set, but wBorder field is * set very different from the documentation. * (Tested with RichEdit 5.50.25.0601) */ - + if (fmt->dwMask & PFM_ALIGNMENT) { switch (fmt->wAlignment) { case PFA_LEFT: @@ -331,7 +331,7 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) break; } } - + if (fmt->dwMask & PFM_LINESPACING) { /* FIXME: MSDN says that the bLineSpacingRule field is controlled by the * PFM_SPACEAFTER flag. Is that true? I don't believe so. */ @@ -375,7 +375,7 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) strcat(props, "\\sbys"); if (fmt->dwMask & PFM_TABLE && fmt->dwMask & PFE_TABLE) strcat(props, "\\intbl"); - + if (fmt->dwMask & PFM_OFFSET) sprintf(props + strlen(props), "\\li%d", fmt->dxOffset); if (fmt->dwMask & PFM_OFFSETINDENT || fmt->dwMask & PFM_STARTINDENT) @@ -391,7 +391,7 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) if (fmt->dwMask & PFM_TABSTOPS) { static const char * const leader[6] = { "", "\\tldot", "\\tlhyph", "\\tlul", "\\tlth", "\\tleq" }; - + for (i = 0; i < fmt->cTabCount; i++) { switch ((fmt->rgxTabs[i] >> 24) & 0xF) { case 1: @@ -412,8 +412,8 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) sprintf(props+strlen(props), "\\tx%d", fmt->rgxTabs[i]&0x00FFFFFF); } } - - + + if (fmt->dwMask & PFM_SHADING) { static const char * const style[16] = { "", "\\bgdkhoriz", "\\bgdkvert", "\\bgdkfdiag", "\\bgdkbdiag", "\\bgdkcross", "\\bgdkdcross", @@ -427,7 +427,7 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) sprintf(props + strlen(props), "\\cfpat%d\\cbpat%d", (fmt->wShadingStyle >> 4) & 0xF, (fmt->wShadingStyle >> 8) & 0xF); } - + if (*props && !ME_StreamOutPrint(pStream, props)) return FALSE; @@ -540,10 +540,10 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt) strcat(props, "\\ul"); } /* FIXME: How to emit CFM_WEIGHT? */ - + if (fmt->dwMask & CFM_FACE || fmt->dwMask & CFM_CHARSET) { WCHAR *szFaceName; - + if (fmt->dwMask & CFM_FACE) szFaceName = fmt->szFaceName; else @@ -587,7 +587,7 @@ ME_StreamOutRTFText(ME_OutStream *pStream, WCHAR *text, LONG nChars) if (nChars == -1) nChars = lstrlenW(text); - + while (nChars) { /* In UTF-8 mode, font charsets are not used. */ if (pStream->nDefaultCodePage == CP_UTF8) { @@ -650,21 +650,21 @@ static BOOL ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int nChars, int dwFormat) { ME_DisplayItem *p, *pEnd, *pPara; - int nOffset, nEndLen; - + int nOffset, nEndLen; + ME_RunOfsFromCharOfs(editor, nStart, &p, &nOffset); ME_RunOfsFromCharOfs(editor, nStart+nChars, &pEnd, &nEndLen); - + pPara = ME_GetParagraph(p); - + if (!ME_StreamOutRTFHeader(pStream, dwFormat)) return FALSE; if (!ME_StreamOutRTFFontAndColorTbl(pStream, p, pEnd)) return FALSE; - + /* TODO: stylesheet table */ - + /* FIXME: maybe emit something smarter for the generator? */ if (!ME_StreamOutPrint(pStream, "{\\*\\generator Wine Riched20 2.0.????;}")) return FALSE; @@ -713,13 +713,13 @@ ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int nC nChars--; } else { int nEnd; - + if (!ME_StreamOutPrint(pStream, "{")) return FALSE; TRACE("style %p\n", p->member.run.style); if (!ME_StreamOutRTFCharProps(pStream, &p->member.run.style->fmt)) return FALSE; - + nEnd = (p == pEnd) ? nEndLen : ME_StrLen(p->member.run.strText); if (!ME_StreamOutRTFText(pStream, p->member.run.strText->szData + nOffset, nEnd - nOffset)) return FALSE; @@ -754,12 +754,12 @@ ME_StreamOutText(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int n if (!item) return FALSE; - + if (dwFormat & SF_USECODEPAGE) nCodePage = HIWORD(dwFormat); /* TODO: Handle SF_TEXTIZED */ - + while (success && nChars && item) { nLen = ME_StrLen(item->member.run.strText) - nStart; if (nLen > nChars) @@ -767,7 +767,7 @@ ME_StreamOutText(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int n if (item->member.run.nFlags & MERF_ENDPARA) { static const WCHAR szEOL[2] = { '\r', '\n' }; - + if (dwFormat & SF_UNICODE) success = ME_StreamOutMove(pStream, (const char *)szEOL, sizeof(szEOL)); else @@ -791,14 +791,14 @@ ME_StreamOutText(ME_TextEditor *editor, ME_OutStream *pStream, int nStart, int n success = ME_StreamOutMove(pStream, buffer, nSize); } } - + nChars -= nLen; if (editor->bEmulateVersion10 && nChars && item->member.run.nFlags & MERF_ENDPARA) nChars--; nStart = 0; item = ME_FindItemFwd(item, diRun); } - + FREE_OBJ(buffer); return success; } diff --git a/reactos/dll/win32/rpcrt4/cproxy.c b/reactos/dll/win32/rpcrt4/cproxy.c index f045e0c8e33..3597cd49db5 100644 --- a/reactos/dll/win32/rpcrt4/cproxy.c +++ b/reactos/dll/win32/rpcrt4/cproxy.c @@ -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 - * + * * TODO: Handle non-i386 architectures * Get rid of #if 0'ed code. */ @@ -174,7 +174,7 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid, } } } - else + else This->PVtbl = vtbl->Vtbl; This->lpVtbl = &StdProxy_Vtbl; diff --git a/reactos/dll/win32/rpcrt4/rpc_binding.c b/reactos/dll/win32/rpcrt4/rpc_binding.c index 273f2253d45..88e52034ff0 100644 --- a/reactos/dll/win32/rpcrt4/rpc_binding.c +++ b/reactos/dll/win32/rpcrt4/rpc_binding.c @@ -225,7 +225,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection) HeapFree(GetProcessHeap(), 0, pname); memset(&Connection->ovl, 0, sizeof(Connection->ovl)); /* pipe is connected; change to message-read mode. */ - dwMode = PIPE_READMODE_MESSAGE; + dwMode = PIPE_READMODE_MESSAGE; SetNamedPipeHandleState(conn, &dwMode, NULL, NULL); Connection->ovl[0].hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); Connection->ovl[1].hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); @@ -371,7 +371,7 @@ RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding* Binding, LPSTR NetworkAddr, LPST RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding* Binding, LPWSTR NetworkAddr, LPWSTR Endpoint, LPWSTR NetworkOptions) { - TRACE("(RpcBinding == ^%p, NetworkAddr == \"%s\", EndPoint == \"%s\", NetworkOptions == \"%s\")\n", Binding, + TRACE("(RpcBinding == ^%p, NetworkAddr == \"%s\", EndPoint == \"%s\", NetworkOptions == \"%s\")\n", Binding, debugstr_w(NetworkAddr), debugstr_w(Endpoint), debugstr_w(NetworkOptions)); RPCRT4_strfree(Binding->NetworkAddr); @@ -399,7 +399,7 @@ RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPSTR Endpoint) RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, UUID* ObjectUuid) { - TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid)); + TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid)); if (ObjectUuid) memcpy(&Binding->ObjectUuid, ObjectUuid, sizeof(UUID)); else UuidCreateNil(&Binding->ObjectUuid); return RPC_S_OK; @@ -453,7 +453,7 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, TRACE("(Binding == ^%p)\n", Binding); /* if we try to bind a new interface and the connection is already opened, - * close the current connection and create a new with the new binding. */ + * close the current connection and create a new with the new binding. */ if (!Binding->server && Binding->FromConn && memcmp(&Binding->FromConn->ActiveInterface, InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER))) { @@ -468,7 +468,7 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, return RPC_S_OK; } } - + /* create a new connection */ RPCRT4_CreateConnection(&NewConnection, Binding->server, Binding->Protseq, Binding->NetworkAddr, Binding->Endpoint, NULL, Binding); *Connection = NewConnection; @@ -582,7 +582,7 @@ static LPWSTR RPCRT4_strconcatW(LPWSTR dst, LPCWSTR src) { DWORD len = strlenW(dst), slen = strlenW(src); LPWSTR ndst = HeapReAlloc(GetProcessHeap(), 0, dst, (len+slen+2)*sizeof(WCHAR)); - if (!ndst) + if (!ndst) { HeapFree(GetProcessHeap(), 0, dst); return NULL; @@ -607,7 +607,7 @@ RPC_STATUS RPC_ENTRY RpcBindingCopy( *DestinationBinding = NULL; return RPC_S_WRONG_KIND_OF_BINDING; } - + DestBinding = (RpcBinding*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcBinding)); @@ -616,7 +616,7 @@ RPC_STATUS RPC_ENTRY RpcBindingCopy( *DestinationBinding = NULL; return ERROR_NOT_ENOUGH_MEMORY; } - + memcpy(DestBinding, SrcBinding, sizeof(RpcBinding)); DestBinding->refs = 1; DestBinding->Next = NULL; // FIXME: ? @@ -802,7 +802,7 @@ RPC_STATUS WINAPI RpcStringBindingParseA( unsigned char *StringBinding, unsigned /* FIXME: this is kind of inefficient */ *Options = (unsigned char*) RPCRT4_strconcatA( (char*)*Options, opt); HeapFree(GetProcessHeap(), 0, opt); - } else + } else *Options = (unsigned char*) opt; } } @@ -811,7 +811,7 @@ RPC_STATUS WINAPI RpcStringBindingParseA( unsigned char *StringBinding, unsigned data = close+1; if (*data) goto fail; } - else if (NetworkAddr) + else if (NetworkAddr) *NetworkAddr = (unsigned char*)RPCRT4_strdupA(data); return RPC_S_OK; @@ -893,7 +893,7 @@ RPC_STATUS WINAPI RpcStringBindingParseW( LPWSTR StringBinding, LPWSTR *ObjUuid, /* FIXME: this is kind of inefficient */ *Options = RPCRT4_strconcatW(*Options, opt); HeapFree(GetProcessHeap(), 0, opt); - } else + } else *Options = opt; } } @@ -901,7 +901,7 @@ RPC_STATUS WINAPI RpcStringBindingParseW( LPWSTR StringBinding, LPWSTR *ObjUuid, data = close+1; if (*data) goto fail; - } else if (NetworkAddr) + } else if (NetworkAddr) *NetworkAddr = RPCRT4_strdupW(data); return RPC_S_OK; @@ -926,7 +926,7 @@ RPC_STATUS WINAPI RpcBindingFree( RPC_BINDING_HANDLE* Binding ) if (status == RPC_S_OK) *Binding = 0; return status; } - + /*********************************************************************** * RpcBindingVectorFree (RPCRT4.@) */ @@ -943,7 +943,7 @@ RPC_STATUS WINAPI RpcBindingVectorFree( RPC_BINDING_VECTOR** BindingVector ) *BindingVector = NULL; return RPC_S_OK; } - + /*********************************************************************** * RpcBindingInqObject (RPCRT4.@) */ @@ -955,7 +955,7 @@ RPC_STATUS WINAPI RpcBindingInqObject( RPC_BINDING_HANDLE Binding, UUID* ObjectU memcpy(ObjectUuid, &bind->ObjectUuid, sizeof(UUID)); return RPC_S_OK; } - + /*********************************************************************** * RpcBindingSetObject (RPCRT4.@) */ @@ -999,9 +999,9 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingA( unsigned char *StringBinding, RP RpcStringFreeA((unsigned char**)&Protseq); RpcStringFreeA((unsigned char**)&ObjectUuid); - if (ret == RPC_S_OK) + if (ret == RPC_S_OK) *Binding = (RPC_BINDING_HANDLE)bind; - else + else RPCRT4_DestroyBinding(bind); return ret; @@ -1045,7 +1045,7 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingW( LPWSTR StringBinding, RPC_BINDIN return ret; } - + /*********************************************************************** * RpcBindingToStringBindingA (RPCRT4.@) */ @@ -1067,7 +1067,7 @@ RPC_STATUS WINAPI RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, unsign return ret; } - + /*********************************************************************** * RpcBindingToStringBindingW (RPCRT4.@) */ @@ -1106,7 +1106,7 @@ RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(unsigned char *protseq) { UNICODE_STRING protseqW; if (!protseq) return RPC_S_INVALID_RPC_PROTSEQ; /* ? */ - + if (RtlCreateUnicodeStringFromAsciiz(&protseqW, (char*)protseq)) { RPC_STATUS ret = RpcNetworkIsProtseqValidW(protseqW.Buffer); RtlFreeUnicodeString(&protseqW); @@ -1116,7 +1116,7 @@ RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(unsigned char *protseq) { /*********************************************************************** * RpcNetworkIsProtseqValidW (RPCRT4.@) - * + * * Checks if the given protocol sequence is known by the RPC system. * If it is, returns RPC_S_OK, otherwise RPC_S_PROTSEQ_NOT_SUPPORTED. * @@ -1125,7 +1125,7 @@ RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(unsigned char *protseq) { * ncacn_np rpc over named pipes */ RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(LPWSTR protseq) { - static const WCHAR protseqsW[][15] = { + static const WCHAR protseqsW[][15] = { {'n','c','a','l','r','p','c',0}, {'n','c','a','c','n','_','n','p',0} }; @@ -1137,7 +1137,7 @@ RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(LPWSTR protseq) { for (i = 0; i < count; i++) { if (!strcmpW(protseq, protseqsW[i])) return RPC_S_OK; } - + FIXME("Unknown protseq %s - we probably need to implement it one day\n", debugstr_w(protseq)); return RPC_S_PROTSEQ_NOT_SUPPORTED; } diff --git a/reactos/dll/win32/rpcrt4/rpc_defs.h b/reactos/dll/win32/rpcrt4/rpc_defs.h index 9e9a7359b10..dd4402082a8 100644 --- a/reactos/dll/win32/rpcrt4/rpc_defs.h +++ b/reactos/dll/win32/rpcrt4/rpc_defs.h @@ -103,7 +103,7 @@ typedef struct unsigned short max_tsize; /* Maximum transmission fragment size */ unsigned short max_rsize; /* Maximum receive fragment size */ unsigned long assoc_gid; /* Associated group id */ - /* + /* * Following this header are these fields: * RpcAddressString server_address; * RpcResults results; diff --git a/reactos/dll/win32/rpcrt4/rpc_epmap.c b/reactos/dll/win32/rpcrt4/rpc_epmap.c index f7d01a1a190..5d19262755c 100644 --- a/reactos/dll/win32/rpcrt4/rpc_epmap.c +++ b/reactos/dll/win32/rpcrt4/rpc_epmap.c @@ -231,7 +231,7 @@ RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE msg.message_type = RPCSS_NP_MESSAGE_TYPEID_RESOLVEEPMSG; msg.message.resolveepmsg.iface = If->InterfaceId; msg.message.resolveepmsg.object = bind->ObjectUuid; - + msg.vardata_payload_size = strlen(bind->Protseq) + 1; /* send the message */ @@ -241,7 +241,7 @@ RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE /* empty-string result means not registered */ if (reply.as_string[0] == '\0') return EPT_S_NOT_REGISTERED; - + /* otherwise we fully bind the handle & return RPC_S_OK */ return RPCRT4_ResolveBinding(Binding, reply.as_string); } diff --git a/reactos/dll/win32/rpcrt4/rpc_message.c b/reactos/dll/win32/rpcrt4/rpc_message.c index 7c34719f55a..203528118b4 100644 --- a/reactos/dll/win32/rpcrt4/rpc_message.c +++ b/reactos/dll/win32/rpcrt4/rpc_message.c @@ -54,7 +54,7 @@ static DWORD RPCRT4_GetHeaderSize(RpcPktHdr *Header) 0, 0, 0, 0, 0 }; ULONG ret = 0; - + if (Header->common.ptype < sizeof(header_sizes) / sizeof(header_sizes[0])) { ret = header_sizes[Header->common.ptype]; if (ret == 0) @@ -82,7 +82,7 @@ static VOID RPCRT4_BuildCommonHeader(RpcPktHdr *Header, unsigned char PacketType Header->common.call_id = 1; Header->common.flags = 0; /* Flags and fragment length are computed in RPCRT4_Send. */ -} +} static RpcPktHdr *RPCRT4_BuildRequestHeader(unsigned long DataRepresentation, unsigned long BufferLength, @@ -240,7 +240,7 @@ VOID RPCRT4_FreeHeader(RpcPktHdr *Header) /*********************************************************************** * RPCRT4_Send (internal) - * + * * Transmit a packet over connection in acceptable fragments. */ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, @@ -301,7 +301,7 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, /*********************************************************************** * RPCRT4_Receive (internal) - * + * * Receive a packet from connection and merge the fragments. */ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, diff --git a/reactos/dll/win32/rpcrt4/rpc_server.c b/reactos/dll/win32/rpcrt4/rpc_server.c index df83b65d548..f04627a6c69 100644 --- a/reactos/dll/win32/rpcrt4/rpc_server.c +++ b/reactos/dll/win32/rpcrt4/rpc_server.c @@ -314,7 +314,7 @@ static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSA /* put in the drep. FIXME: is this more universally applicable? perhaps we should move this outward... */ - msg->DataRepresentation = + msg->DataRepresentation = MAKELONG( MAKEWORD(hdr->common.drep[0], hdr->common.drep[1]), MAKEWORD(hdr->common.drep[2], hdr->common.drep[3])); @@ -702,14 +702,14 @@ RPC_STATUS WINAPI RpcServerInqBindings( RPC_BINDING_VECTOR** BindingVector ) RPC_STATUS WINAPI RpcServerUseProtseqEpA( unsigned char *Protseq, UINT MaxCalls, unsigned char *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 ); } @@ -719,14 +719,14 @@ RPC_STATUS WINAPI RpcServerUseProtseqEpA( unsigned char *Protseq, UINT MaxCalls, 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 ); } @@ -929,7 +929,7 @@ RPC_STATUS WINAPI RpcObjectSetType( UUID* ObjUuid, UUID* TypeUuid ) if ((! TypeUuid) || UuidIsNil(TypeUuid, &dummy)) { /* ... and drop it from the list */ if (map) { - if (prev) + if (prev) prev->next = map->next; else RpcObjTypeMaps = map->next; @@ -960,7 +960,7 @@ RPC_STATUS WINAPI RpcServerRegisterAuthInfoA( unsigned char *ServerPrincName, un 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 */ } @@ -971,7 +971,7 @@ RPC_STATUS WINAPI RpcServerRegisterAuthInfoW( LPWSTR ServerPrincName, unsigned l 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 */ } @@ -1010,7 +1010,7 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) LeaveCriticalSection(&listen_cs); return RPC_S_NOT_LISTENING; } - + LeaveCriticalSection(&listen_cs); return RPC_S_OK; @@ -1027,7 +1027,7 @@ RPC_STATUS WINAPI RpcMgmtStopServerListening ( RPC_BINDING_HANDLE Binding ) FIXME("client-side invocation not implemented.\n"); return RPC_S_WRONG_KIND_OF_BINDING; } - + RPCRT4_stop_listen(FALSE); return RPC_S_OK; diff --git a/reactos/dll/win32/rpcrt4/rpcrt4_main.c b/reactos/dll/win32/rpcrt4/rpcrt4_main.c index 0b8e1e032e6..4e534d93e12 100644 --- a/reactos/dll/win32/rpcrt4/rpcrt4_main.c +++ b/reactos/dll/win32/rpcrt4/rpcrt4_main.c @@ -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 - * + * * WINE RPC TODO's (and a few TODONT's) * * - Ove's decreasingly incomplete widl is an IDL compiler for wine. For widl @@ -45,11 +45,11 @@ * * - Some transports are not yet implemented. The existing transport implementations * are incomplete and may be bug-infested. - * + * * - The various transports that we do support ought to be supported in a more * object-oriented manner, as in DCE's RPC implementation, instead of cluttering * up the code with conditionals like we do now. - * + * * - Data marshalling: So far, only the beginnings of a full implementation * exist in wine. NDR protocol itself is documented, but the MS API's to * convert data-types in memory into NDR are not. This is challenging work, @@ -59,7 +59,7 @@ * use it to implement out-of-process OLE client/server communications. * ATM there is maybe a disconnect between the marshalling in the OLE DLLs * and the marshalling going on here [TODO: well, is there or not?] - * + * * - In-source API Documentation, at least for those functions which we have * implemented, but preferably for everything we can document, would be nice, * since some of this stuff is quite obscure. @@ -213,7 +213,7 @@ void WINAPI RpcRaiseException(RPC_STATUS exception) * UUID *Uuid1 [I] Uuid to compare * UUID *Uuid2 [I] Uuid to compare * RPC_STATUS *Status [O] returns RPC_S_OK - * + * * RETURNS * -1 if Uuid1 is less than Uuid2 * 0 if Uuid1 and Uuid2 are equal @@ -321,7 +321,7 @@ static void RPC_UuidGetSystemTime(ULONGLONG *time) typedef DWORD WINAPI (*LPGETADAPTERSINFO)(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen); -/* Assume that a hardware address is at least 6 bytes long */ +/* Assume that a hardware address is at least 6 bytes long */ #define ADDRESS_BYTES_NEEDED 6 static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address) @@ -333,7 +333,7 @@ static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address) PIP_ADAPTER_INFO adapter = HeapAlloc(GetProcessHeap(), 0, buflen); HANDLE hIpHlpApi; LPGETADAPTERSINFO pGetAdaptersInfo; - + hIpHlpApi = LoadLibrary("iphlpapi.dll"); if (hIpHlpApi) { @@ -353,15 +353,15 @@ static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address) else { goto local; - } + } } - + /* Free the Library */ FreeLibrary(hIpHlpApi); goto exit; } - -local: + +local: /* We can't get a hardware address, just use random numbers. Set the multicast bit to prevent conflicts with real cards. */ for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) { @@ -369,7 +369,7 @@ local: } address[0] |= 0x01; status = RPC_S_UUID_LOCAL_ONLY; - + exit: HeapFree(GetProcessHeap(), 0, adapter); return status; @@ -386,9 +386,9 @@ exit: * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique. * * FIXME: No compensation for changes across reloading - * this dll or across reboots (e.g. clock going + * this dll or across reboots (e.g. clock going * backwards and swapped network cards). The RFC - * suggests using NVRAM for storing persistent + * suggests using NVRAM for storing persistent * values. */ RPC_STATUS WINAPI UuidCreate(UUID *Uuid) @@ -674,7 +674,7 @@ HRESULT WINAPI DllRegisterServer( void ) } BOOL RPCRT4_StartRPCSS(void) -{ +{ PROCESS_INFORMATION pi; STARTUPINFOA si; static char cmd[6]; @@ -711,11 +711,11 @@ BOOL RPCRT4_StartRPCSS(void) /*********************************************************************** * RPCRT4_RPCSSOnDemandCall (internal) - * + * * Attempts to send a message to the RPCSS process * on the local machine, invoking it if necessary. * For remote RPCSS calls, use.... your imagination. - * + * * PARAMS * msg [I] pointer to the RPCSS message * vardata_payload [I] pointer vardata portion of the RPCSS message @@ -745,7 +745,7 @@ BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPC Sleep(200); client_handle = RPCRT4_RpcssNPConnect(); if (client_handle) break; - } + } /* we are only willing to try twice */ if (j++ >= 1) break; } diff --git a/reactos/dll/win32/rpcrt4/rpcss_np_client.c b/reactos/dll/win32/rpcrt4/rpcss_np_client.c index 3906f212999..c454f95d25c 100644 --- a/reactos/dll/win32/rpcrt4/rpcss_np_client.c +++ b/reactos/dll/win32/rpcrt4/rpcss_np_client.c @@ -35,19 +35,19 @@ HANDLE RPCRT4_RpcssNPConnect(void) HANDLE the_pipe = NULL; DWORD dwmode, wait_result; HANDLE master_mutex = RPCRT4_GetMasterMutex(); - + TRACE("\n"); while (TRUE) { wait_result = WaitForSingleObject(master_mutex, MASTER_MUTEX_TIMEOUT); switch (wait_result) { - case WAIT_ABANDONED: + case WAIT_ABANDONED: case WAIT_OBJECT_0: break; case WAIT_FAILED: case WAIT_TIMEOUT: - default: + default: ERR("This should never happen: couldn't enter mutex.\n"); return NULL; } @@ -67,18 +67,18 @@ HANDLE RPCRT4_RpcssNPConnect(void) break; if (GetLastError() != ERROR_PIPE_BUSY) { - WARN("Unable to open named pipe %s (assuming unavailable).\n", + WARN("Unable to open named pipe %s (assuming unavailable).\n", debugstr_a(NAME_RPCSS_NAMED_PIPE)); the_pipe = NULL; break; } WARN("Named pipe busy (will wait)\n"); - + if (!ReleaseMutex(master_mutex)) ERR("Failed to release master mutex. Expect deadlock.\n"); - /* wait for the named pipe. We are only + /* wait for the named pipe. We are only willing to wait only 5 seconds. It should be available /very/ soon. */ if (! WaitNamedPipeA(NAME_RPCSS_NAMED_PIPE, MASTER_MUTEX_WAITNAMEDPIPE_TIMEOUT)) { @@ -124,7 +124,7 @@ BOOL RPCRT4_SendReceiveNPMsg(HANDLE np, PRPCSS_NP_MESSAGE msg, char *vardata, PR /* process the vardata payload if necessary */ vardata_payload_msg.message_type = RPCSS_NP_MESSAGE_TYPEID_VARDATAPAYLOADMSG; vardata_payload_msg.vardata_payload_size = 0; /* meaningless */ - for ( payload_offset = 0; payload_offset < msg->vardata_payload_size; + for ( payload_offset = 0; payload_offset < msg->vardata_payload_size; payload_offset += VARDATA_PAYLOAD_BYTES ) { TRACE("sending vardata payload. vd=%p, po=%d, ps=%d\n", vardata, payload_offset, msg->vardata_payload_size); @@ -138,7 +138,7 @@ BOOL RPCRT4_SendReceiveNPMsg(HANDLE np, PRPCSS_NP_MESSAGE msg, char *vardata, PR return FALSE; } } - + if (! ReadFile(np, reply, sizeof(RPCSS_NP_REPLY), &count, NULL)) { ERR("read failed.\n"); return FALSE; diff --git a/reactos/dll/win32/rpcrt4_new/cproxy.c b/reactos/dll/win32/rpcrt4_new/cproxy.c index 6580bcf143c..23dfb0251dd 100644 --- a/reactos/dll/win32/rpcrt4_new/cproxy.c +++ b/reactos/dll/win32/rpcrt4_new/cproxy.c @@ -1,450 +1,450 @@ -/* - * COM proxy implementation - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * TODO: Handle non-i386 architectures - */ - -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - -#include "objbase.h" -#include "rpcproxy.h" - -#include "cpsf.h" -#include "ndr_misc.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(ole); - -struct StublessThunk; - -/* I don't know what MS's std proxy structure looks like, - so this probably doesn't match, but that shouldn't matter */ -typedef struct { - const IRpcProxyBufferVtbl *lpVtbl; - LPVOID *PVtbl; - LONG RefCount; - const MIDL_STUBLESS_PROXY_INFO *stubless; - const IID* piid; - LPUNKNOWN pUnkOuter; - PCInterfaceName name; - LPPSFACTORYBUFFER pPSFactory; - LPRPCCHANNELBUFFER pChannel; - struct StublessThunk *thunks; -} StdProxyImpl; - -static const IRpcProxyBufferVtbl StdProxy_Vtbl; - -#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) - -/* How the Windows stubless proxy thunks work is explained at - * http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp, - * but I'll use a slightly different method, to make life easier */ - -#if defined(__i386__) - -#include "pshpack1.h" - -struct StublessThunk { - BYTE push; - DWORD index; - BYTE call; - LONG handler; - BYTE ret; - WORD bytes; - BYTE pad[3]; -}; - -#include "poppack.h" - -/* adjust the stack size since we don't use Windows's method */ -#define STACK_ADJUST sizeof(DWORD) - -#define FILL_STUBLESS(x,idx,stk) \ - x->push = 0x68; /* pushl [immediate] */ \ - x->index = (idx); \ - x->call = 0xe8; /* call [near] */ \ - x->handler = (char*)ObjectStubless - (char*)&x->ret; \ - x->ret = 0xc2; /* ret [immediate] */ \ - x->bytes = stk; \ - x->pad[0] = 0x8d; /* leal (%esi),%esi */ \ - x->pad[1] = 0x76; \ - x->pad[2] = 0x00; - -static HRESULT WINAPI ObjectStubless(DWORD index) -{ - char *args = (char*)(&index + 2); - LPVOID iface = *(LPVOID*)args; - - ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - - PFORMAT_STRING fs = This->stubless->ProcFormatString + This->stubless->FormatStringOffset[index]; - unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; - TRACE("(%p)->(%d)([%d bytes]) ret=%08x\n", iface, index, bytes, *(DWORD*)(args+bytes)); - - return NdrClientCall2(This->stubless->pStubDesc, fs, args); -} - -#else /* __i386__ */ - -/* can't do that on this arch */ -struct StublessThunk { int dummy; }; -#define FILL_STUBLESS(x,idx,stk) \ - ERR("stubless proxies are not supported on this architecture\n"); -#define STACK_ADJUST 0 - -#endif /* __i386__ */ - -HRESULT WINAPI StdProxy_Construct(REFIID riid, - LPUNKNOWN pUnkOuter, - const ProxyFileInfo *ProxyInfo, - int Index, - LPPSFACTORYBUFFER pPSFactory, - LPRPCPROXYBUFFER *ppProxy, - LPVOID *ppvObj) -{ - StdProxyImpl *This; - const MIDL_STUBLESS_PROXY_INFO *stubless = NULL; - PCInterfaceName name = ProxyInfo->pNamesArray[Index]; - CInterfaceProxyVtbl *vtbl = ProxyInfo->pProxyVtblList[Index]; - - TRACE("(%p,%p,%p,%p,%p) %s\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj, name); - - /* TableVersion = 2 means it is the stubless version of CInterfaceProxyVtbl */ - if (ProxyInfo->TableVersion > 1) { - stubless = *(const void **)vtbl; - vtbl = (CInterfaceProxyVtbl *)((const void **)vtbl + 1); - TRACE("stubless=%p\n", stubless); - } - - TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid)); - TRACE("vtbl=%p\n", vtbl->Vtbl); - - if (!IsEqualGUID(vtbl->header.piid, riid)) { - ERR("IID mismatch during proxy creation\n"); - return RPC_E_UNEXPECTED; - } - - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(StdProxyImpl)); - if (!This) return E_OUTOFMEMORY; - - if (stubless) { - CInterfaceStubVtbl *svtbl = ProxyInfo->pStubVtblList[Index]; - unsigned long i, count = svtbl->header.DispatchTableCount; - /* Maybe the original vtbl is just modified directly to point at - * ObjectStublessClientXXX thunks in real Windows, but I don't like it - */ - TRACE("stubless thunks: count=%ld\n", count); - This->thunks = HeapAlloc(GetProcessHeap(),0,sizeof(struct StublessThunk)*count); - This->PVtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPVOID)*count); - for (i=0; ithunks[i]; - if (vtbl->Vtbl[i] == (LPVOID)-1) { - PFORMAT_STRING fs = stubless->ProcFormatString + stubless->FormatStringOffset[i]; - unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; - TRACE("method %ld: stacksize=%d\n", i, bytes); - FILL_STUBLESS(thunk, i, bytes) - This->PVtbl[i] = thunk; - } - else { - memset(thunk, 0, sizeof(struct StublessThunk)); - This->PVtbl[i] = vtbl->Vtbl[i]; - } - } - } - else - This->PVtbl = vtbl->Vtbl; - - This->lpVtbl = &StdProxy_Vtbl; - /* one reference for the proxy */ - This->RefCount = 1; - This->stubless = stubless; - This->piid = vtbl->header.piid; - This->pUnkOuter = pUnkOuter; - This->name = name; - This->pPSFactory = pPSFactory; - This->pChannel = NULL; - *ppProxy = (LPRPCPROXYBUFFER)&This->lpVtbl; - *ppvObj = &This->PVtbl; - /* if there is no outer unknown then the caller will control the lifetime - * of the proxy object through the proxy buffer, so no need to increment the - * ref count of the proxy object */ - if (pUnkOuter) - IUnknown_AddRef((IUnknown *)*ppvObj); - IPSFactoryBuffer_AddRef(pPSFactory); - - return S_OK; -} - -static void WINAPI StdProxy_Destruct(LPRPCPROXYBUFFER iface) -{ - ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); - - if (This->pChannel) - IRpcProxyBuffer_Disconnect(iface); - - IPSFactoryBuffer_Release(This->pPSFactory); - if (This->thunks) { - HeapFree(GetProcessHeap(),0,This->PVtbl); - HeapFree(GetProcessHeap(),0,This->thunks); - } - HeapFree(GetProcessHeap(),0,This); -} - -static HRESULT WINAPI StdProxy_QueryInterface(LPRPCPROXYBUFFER iface, - REFIID riid, - LPVOID *obj) -{ - ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); - TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj); - - if (IsEqualGUID(&IID_IUnknown,riid) || - IsEqualGUID(This->piid,riid)) { - *obj = &This->PVtbl; - InterlockedIncrement(&This->RefCount); - return S_OK; - } - - if (IsEqualGUID(&IID_IRpcProxyBuffer,riid)) { - *obj = &This->lpVtbl; - InterlockedIncrement(&This->RefCount); - return S_OK; - } - - return E_NOINTERFACE; -} - -static ULONG WINAPI StdProxy_AddRef(LPRPCPROXYBUFFER iface) -{ - ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); - TRACE("(%p)->AddRef()\n",This); - - return InterlockedIncrement(&This->RefCount); -} - -static ULONG WINAPI StdProxy_Release(LPRPCPROXYBUFFER iface) -{ - ULONG refs; - ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); - TRACE("(%p)->Release()\n",This); - - refs = InterlockedDecrement(&This->RefCount); - if (!refs) - StdProxy_Destruct((LPRPCPROXYBUFFER)&This->lpVtbl); - return refs; -} - -static HRESULT WINAPI StdProxy_Connect(LPRPCPROXYBUFFER iface, - LPRPCCHANNELBUFFER pChannel) -{ - ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); - TRACE("(%p)->Connect(%p)\n",This,pChannel); - - This->pChannel = pChannel; - IRpcChannelBuffer_AddRef(pChannel); - return S_OK; -} - -static VOID WINAPI StdProxy_Disconnect(LPRPCPROXYBUFFER iface) -{ - ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); - TRACE("(%p)->Disconnect()\n",This); - - IRpcChannelBuffer_Release(This->pChannel); - This->pChannel = NULL; -} - -static const IRpcProxyBufferVtbl StdProxy_Vtbl = -{ - StdProxy_QueryInterface, - StdProxy_AddRef, - StdProxy_Release, - StdProxy_Connect, - StdProxy_Disconnect -}; - -static void StdProxy_GetChannel(LPVOID iface, - LPRPCCHANNELBUFFER *ppChannel) -{ - ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->GetChannel(%p) %s\n",This,ppChannel,This->name); - - *ppChannel = This->pChannel; -} - -static void StdProxy_GetIID(LPVOID iface, - const IID **ppiid) -{ - ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->GetIID(%p) %s\n",This,ppiid,This->name); - - *ppiid = This->piid; -} - -HRESULT WINAPI IUnknown_QueryInterface_Proxy(LPUNKNOWN iface, - REFIID riid, - LPVOID *ppvObj) -{ - ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->QueryInterface(%s,%p) %s\n",This,debugstr_guid(riid),ppvObj,This->name); - return IUnknown_QueryInterface(This->pUnkOuter,riid,ppvObj); -} - -ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface) -{ - ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->AddRef() %s\n",This,This->name); - return IUnknown_AddRef(This->pUnkOuter); -} - -ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface) -{ - ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - TRACE("(%p)->Release() %s\n",This,This->name); - return IUnknown_Release(This->pUnkOuter); -} - -/*********************************************************************** - * NdrProxyInitialize [RPCRT4.@] - */ -void WINAPI NdrProxyInitialize(void *This, - PRPC_MESSAGE pRpcMsg, - PMIDL_STUB_MESSAGE pStubMsg, - PMIDL_STUB_DESC pStubDescriptor, - unsigned int ProcNum) -{ - TRACE("(%p,%p,%p,%p,%d)\n", This, pRpcMsg, pStubMsg, pStubDescriptor, ProcNum); - NdrClientInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor, ProcNum); - StdProxy_GetChannel(This, &pStubMsg->pRpcChannelBuffer); - IRpcChannelBuffer_GetDestCtx(pStubMsg->pRpcChannelBuffer, - &pStubMsg->dwDestContext, - &pStubMsg->pvDestContext); - TRACE("channel=%p\n", pStubMsg->pRpcChannelBuffer); -} - -/*********************************************************************** - * NdrProxyGetBuffer [RPCRT4.@] - */ -void WINAPI NdrProxyGetBuffer(void *This, - PMIDL_STUB_MESSAGE pStubMsg) -{ - HRESULT hr; - const IID *riid = NULL; - - TRACE("(%p,%p)\n", This, pStubMsg); - pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength; - pStubMsg->dwStubPhase = PROXY_GETBUFFER; - StdProxy_GetIID(This, &riid); - hr = IRpcChannelBuffer_GetBuffer(pStubMsg->pRpcChannelBuffer, - (RPCOLEMESSAGE*)pStubMsg->RpcMsg, - riid); - if (FAILED(hr)) - { - RpcRaiseException(hr); - return; - } - pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer; - pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength; - pStubMsg->Buffer = pStubMsg->BufferStart; - pStubMsg->dwStubPhase = PROXY_MARSHAL; -} - -/*********************************************************************** - * NdrProxySendReceive [RPCRT4.@] - */ -void WINAPI NdrProxySendReceive(void *This, - PMIDL_STUB_MESSAGE pStubMsg) -{ - ULONG Status = 0; - HRESULT hr; - - TRACE("(%p,%p)\n", This, pStubMsg); - - if (!pStubMsg->pRpcChannelBuffer) - { - WARN("Trying to use disconnected proxy %p\n", This); - RpcRaiseException(RPC_E_DISCONNECTED); - } - - pStubMsg->dwStubPhase = PROXY_SENDRECEIVE; - hr = IRpcChannelBuffer_SendReceive(pStubMsg->pRpcChannelBuffer, - (RPCOLEMESSAGE*)pStubMsg->RpcMsg, - &Status); - pStubMsg->dwStubPhase = PROXY_UNMARSHAL; - pStubMsg->BufferLength = pStubMsg->RpcMsg->BufferLength; - pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer; - pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength; - pStubMsg->Buffer = pStubMsg->BufferStart; - - /* raise exception if call failed */ - if (hr == RPC_S_CALL_FAILED) RpcRaiseException(*(DWORD*)pStubMsg->Buffer); - else if (FAILED(hr)) RpcRaiseException(hr); -} - -/*********************************************************************** - * NdrProxyFreeBuffer [RPCRT4.@] - */ -void WINAPI NdrProxyFreeBuffer(void *This, - PMIDL_STUB_MESSAGE pStubMsg) -{ - HRESULT hr; - - TRACE("(%p,%p)\n", This, pStubMsg); - hr = IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer, - (RPCOLEMESSAGE*)pStubMsg->RpcMsg); -} - -/*********************************************************************** - * NdrProxyErrorHandler [RPCRT4.@] - */ -HRESULT WINAPI NdrProxyErrorHandler(DWORD dwExceptionCode) -{ - WARN("(0x%08x): a proxy call failed\n", dwExceptionCode); - - if (FAILED(dwExceptionCode)) - return dwExceptionCode; - else - return HRESULT_FROM_WIN32(dwExceptionCode); -} - -HRESULT WINAPI -CreateProxyFromTypeInfo( LPTYPEINFO pTypeInfo, LPUNKNOWN pUnkOuter, REFIID riid, - LPRPCPROXYBUFFER *ppProxy, LPVOID *ppv ) -{ - typedef INT (WINAPI *MessageBoxA)(HWND,LPCSTR,LPCSTR,UINT); - HMODULE hUser32 = LoadLibraryA("user32"); - MessageBoxA pMessageBoxA = (void *)GetProcAddress(hUser32, "MessageBoxA"); - - FIXME("%p %p %s %p %p\n", pTypeInfo, pUnkOuter, debugstr_guid(riid), ppProxy, ppv); - if (pMessageBoxA) - { - pMessageBoxA(NULL, - "The native implementation of OLEAUT32.DLL cannot be used " - "with Wine's RPCRT4.DLL. Remove OLEAUT32.DLL and try again.\n", - "Wine: Unimplemented CreateProxyFromTypeInfo", - 0x10); - ExitProcess(1); - } - return E_NOTIMPL; -} +/* + * COM proxy implementation + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * TODO: Handle non-i386 architectures + */ + +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" + +#include "objbase.h" +#include "rpcproxy.h" + +#include "cpsf.h" +#include "ndr_misc.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +struct StublessThunk; + +/* I don't know what MS's std proxy structure looks like, + so this probably doesn't match, but that shouldn't matter */ +typedef struct { + const IRpcProxyBufferVtbl *lpVtbl; + LPVOID *PVtbl; + LONG RefCount; + const MIDL_STUBLESS_PROXY_INFO *stubless; + const IID* piid; + LPUNKNOWN pUnkOuter; + PCInterfaceName name; + LPPSFACTORYBUFFER pPSFactory; + LPRPCCHANNELBUFFER pChannel; + struct StublessThunk *thunks; +} StdProxyImpl; + +static const IRpcProxyBufferVtbl StdProxy_Vtbl; + +#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) + +/* How the Windows stubless proxy thunks work is explained at + * http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp, + * but I'll use a slightly different method, to make life easier */ + +#if defined(__i386__) + +#include "pshpack1.h" + +struct StublessThunk { + BYTE push; + DWORD index; + BYTE call; + LONG handler; + BYTE ret; + WORD bytes; + BYTE pad[3]; +}; + +#include "poppack.h" + +/* adjust the stack size since we don't use Windows's method */ +#define STACK_ADJUST sizeof(DWORD) + +#define FILL_STUBLESS(x,idx,stk) \ + x->push = 0x68; /* pushl [immediate] */ \ + x->index = (idx); \ + x->call = 0xe8; /* call [near] */ \ + x->handler = (char*)ObjectStubless - (char*)&x->ret; \ + x->ret = 0xc2; /* ret [immediate] */ \ + x->bytes = stk; \ + x->pad[0] = 0x8d; /* leal (%esi),%esi */ \ + x->pad[1] = 0x76; \ + x->pad[2] = 0x00; + +static HRESULT WINAPI ObjectStubless(DWORD index) +{ + char *args = (char*)(&index + 2); + LPVOID iface = *(LPVOID*)args; + + ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); + + PFORMAT_STRING fs = This->stubless->ProcFormatString + This->stubless->FormatStringOffset[index]; + unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; + TRACE("(%p)->(%d)([%d bytes]) ret=%08x\n", iface, index, bytes, *(DWORD*)(args+bytes)); + + return NdrClientCall2(This->stubless->pStubDesc, fs, args); +} + +#else /* __i386__ */ + +/* can't do that on this arch */ +struct StublessThunk { int dummy; }; +#define FILL_STUBLESS(x,idx,stk) \ + ERR("stubless proxies are not supported on this architecture\n"); +#define STACK_ADJUST 0 + +#endif /* __i386__ */ + +HRESULT WINAPI StdProxy_Construct(REFIID riid, + LPUNKNOWN pUnkOuter, + const ProxyFileInfo *ProxyInfo, + int Index, + LPPSFACTORYBUFFER pPSFactory, + LPRPCPROXYBUFFER *ppProxy, + LPVOID *ppvObj) +{ + StdProxyImpl *This; + const MIDL_STUBLESS_PROXY_INFO *stubless = NULL; + PCInterfaceName name = ProxyInfo->pNamesArray[Index]; + CInterfaceProxyVtbl *vtbl = ProxyInfo->pProxyVtblList[Index]; + + TRACE("(%p,%p,%p,%p,%p) %s\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj, name); + + /* TableVersion = 2 means it is the stubless version of CInterfaceProxyVtbl */ + if (ProxyInfo->TableVersion > 1) { + stubless = *(const void **)vtbl; + vtbl = (CInterfaceProxyVtbl *)((const void **)vtbl + 1); + TRACE("stubless=%p\n", stubless); + } + + TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid)); + TRACE("vtbl=%p\n", vtbl->Vtbl); + + if (!IsEqualGUID(vtbl->header.piid, riid)) { + ERR("IID mismatch during proxy creation\n"); + return RPC_E_UNEXPECTED; + } + + This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(StdProxyImpl)); + if (!This) return E_OUTOFMEMORY; + + if (stubless) { + CInterfaceStubVtbl *svtbl = ProxyInfo->pStubVtblList[Index]; + unsigned long i, count = svtbl->header.DispatchTableCount; + /* Maybe the original vtbl is just modified directly to point at + * ObjectStublessClientXXX thunks in real Windows, but I don't like it + */ + TRACE("stubless thunks: count=%ld\n", count); + This->thunks = HeapAlloc(GetProcessHeap(),0,sizeof(struct StublessThunk)*count); + This->PVtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPVOID)*count); + for (i=0; ithunks[i]; + if (vtbl->Vtbl[i] == (LPVOID)-1) { + PFORMAT_STRING fs = stubless->ProcFormatString + stubless->FormatStringOffset[i]; + unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; + TRACE("method %ld: stacksize=%d\n", i, bytes); + FILL_STUBLESS(thunk, i, bytes) + This->PVtbl[i] = thunk; + } + else { + memset(thunk, 0, sizeof(struct StublessThunk)); + This->PVtbl[i] = vtbl->Vtbl[i]; + } + } + } + else + This->PVtbl = vtbl->Vtbl; + + This->lpVtbl = &StdProxy_Vtbl; + /* one reference for the proxy */ + This->RefCount = 1; + This->stubless = stubless; + This->piid = vtbl->header.piid; + This->pUnkOuter = pUnkOuter; + This->name = name; + This->pPSFactory = pPSFactory; + This->pChannel = NULL; + *ppProxy = (LPRPCPROXYBUFFER)&This->lpVtbl; + *ppvObj = &This->PVtbl; + /* if there is no outer unknown then the caller will control the lifetime + * of the proxy object through the proxy buffer, so no need to increment the + * ref count of the proxy object */ + if (pUnkOuter) + IUnknown_AddRef((IUnknown *)*ppvObj); + IPSFactoryBuffer_AddRef(pPSFactory); + + return S_OK; +} + +static void WINAPI StdProxy_Destruct(LPRPCPROXYBUFFER iface) +{ + ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); + + if (This->pChannel) + IRpcProxyBuffer_Disconnect(iface); + + IPSFactoryBuffer_Release(This->pPSFactory); + if (This->thunks) { + HeapFree(GetProcessHeap(),0,This->PVtbl); + HeapFree(GetProcessHeap(),0,This->thunks); + } + HeapFree(GetProcessHeap(),0,This); +} + +static HRESULT WINAPI StdProxy_QueryInterface(LPRPCPROXYBUFFER iface, + REFIID riid, + LPVOID *obj) +{ + ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); + TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj); + + if (IsEqualGUID(&IID_IUnknown,riid) || + IsEqualGUID(This->piid,riid)) { + *obj = &This->PVtbl; + InterlockedIncrement(&This->RefCount); + return S_OK; + } + + if (IsEqualGUID(&IID_IRpcProxyBuffer,riid)) { + *obj = &This->lpVtbl; + InterlockedIncrement(&This->RefCount); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI StdProxy_AddRef(LPRPCPROXYBUFFER iface) +{ + ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); + TRACE("(%p)->AddRef()\n",This); + + return InterlockedIncrement(&This->RefCount); +} + +static ULONG WINAPI StdProxy_Release(LPRPCPROXYBUFFER iface) +{ + ULONG refs; + ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); + TRACE("(%p)->Release()\n",This); + + refs = InterlockedDecrement(&This->RefCount); + if (!refs) + StdProxy_Destruct((LPRPCPROXYBUFFER)&This->lpVtbl); + return refs; +} + +static HRESULT WINAPI StdProxy_Connect(LPRPCPROXYBUFFER iface, + LPRPCCHANNELBUFFER pChannel) +{ + ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); + TRACE("(%p)->Connect(%p)\n",This,pChannel); + + This->pChannel = pChannel; + IRpcChannelBuffer_AddRef(pChannel); + return S_OK; +} + +static VOID WINAPI StdProxy_Disconnect(LPRPCPROXYBUFFER iface) +{ + ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); + TRACE("(%p)->Disconnect()\n",This); + + IRpcChannelBuffer_Release(This->pChannel); + This->pChannel = NULL; +} + +static const IRpcProxyBufferVtbl StdProxy_Vtbl = +{ + StdProxy_QueryInterface, + StdProxy_AddRef, + StdProxy_Release, + StdProxy_Connect, + StdProxy_Disconnect +}; + +static void StdProxy_GetChannel(LPVOID iface, + LPRPCCHANNELBUFFER *ppChannel) +{ + ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); + TRACE("(%p)->GetChannel(%p) %s\n",This,ppChannel,This->name); + + *ppChannel = This->pChannel; +} + +static void StdProxy_GetIID(LPVOID iface, + const IID **ppiid) +{ + ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); + TRACE("(%p)->GetIID(%p) %s\n",This,ppiid,This->name); + + *ppiid = This->piid; +} + +HRESULT WINAPI IUnknown_QueryInterface_Proxy(LPUNKNOWN iface, + REFIID riid, + LPVOID *ppvObj) +{ + ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); + TRACE("(%p)->QueryInterface(%s,%p) %s\n",This,debugstr_guid(riid),ppvObj,This->name); + return IUnknown_QueryInterface(This->pUnkOuter,riid,ppvObj); +} + +ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface) +{ + ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); + TRACE("(%p)->AddRef() %s\n",This,This->name); + return IUnknown_AddRef(This->pUnkOuter); +} + +ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface) +{ + ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); + TRACE("(%p)->Release() %s\n",This,This->name); + return IUnknown_Release(This->pUnkOuter); +} + +/*********************************************************************** + * NdrProxyInitialize [RPCRT4.@] + */ +void WINAPI NdrProxyInitialize(void *This, + PRPC_MESSAGE pRpcMsg, + PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDescriptor, + unsigned int ProcNum) +{ + TRACE("(%p,%p,%p,%p,%d)\n", This, pRpcMsg, pStubMsg, pStubDescriptor, ProcNum); + NdrClientInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor, ProcNum); + StdProxy_GetChannel(This, &pStubMsg->pRpcChannelBuffer); + IRpcChannelBuffer_GetDestCtx(pStubMsg->pRpcChannelBuffer, + &pStubMsg->dwDestContext, + &pStubMsg->pvDestContext); + TRACE("channel=%p\n", pStubMsg->pRpcChannelBuffer); +} + +/*********************************************************************** + * NdrProxyGetBuffer [RPCRT4.@] + */ +void WINAPI NdrProxyGetBuffer(void *This, + PMIDL_STUB_MESSAGE pStubMsg) +{ + HRESULT hr; + const IID *riid = NULL; + + TRACE("(%p,%p)\n", This, pStubMsg); + pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength; + pStubMsg->dwStubPhase = PROXY_GETBUFFER; + StdProxy_GetIID(This, &riid); + hr = IRpcChannelBuffer_GetBuffer(pStubMsg->pRpcChannelBuffer, + (RPCOLEMESSAGE*)pStubMsg->RpcMsg, + riid); + if (FAILED(hr)) + { + RpcRaiseException(hr); + return; + } + pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer; + pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength; + pStubMsg->Buffer = pStubMsg->BufferStart; + pStubMsg->dwStubPhase = PROXY_MARSHAL; +} + +/*********************************************************************** + * NdrProxySendReceive [RPCRT4.@] + */ +void WINAPI NdrProxySendReceive(void *This, + PMIDL_STUB_MESSAGE pStubMsg) +{ + ULONG Status = 0; + HRESULT hr; + + TRACE("(%p,%p)\n", This, pStubMsg); + + if (!pStubMsg->pRpcChannelBuffer) + { + WARN("Trying to use disconnected proxy %p\n", This); + RpcRaiseException(RPC_E_DISCONNECTED); + } + + pStubMsg->dwStubPhase = PROXY_SENDRECEIVE; + hr = IRpcChannelBuffer_SendReceive(pStubMsg->pRpcChannelBuffer, + (RPCOLEMESSAGE*)pStubMsg->RpcMsg, + &Status); + pStubMsg->dwStubPhase = PROXY_UNMARSHAL; + pStubMsg->BufferLength = pStubMsg->RpcMsg->BufferLength; + pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer; + pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength; + pStubMsg->Buffer = pStubMsg->BufferStart; + + /* raise exception if call failed */ + if (hr == RPC_S_CALL_FAILED) RpcRaiseException(*(DWORD*)pStubMsg->Buffer); + else if (FAILED(hr)) RpcRaiseException(hr); +} + +/*********************************************************************** + * NdrProxyFreeBuffer [RPCRT4.@] + */ +void WINAPI NdrProxyFreeBuffer(void *This, + PMIDL_STUB_MESSAGE pStubMsg) +{ + HRESULT hr; + + TRACE("(%p,%p)\n", This, pStubMsg); + hr = IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer, + (RPCOLEMESSAGE*)pStubMsg->RpcMsg); +} + +/*********************************************************************** + * NdrProxyErrorHandler [RPCRT4.@] + */ +HRESULT WINAPI NdrProxyErrorHandler(DWORD dwExceptionCode) +{ + WARN("(0x%08x): a proxy call failed\n", dwExceptionCode); + + if (FAILED(dwExceptionCode)) + return dwExceptionCode; + else + return HRESULT_FROM_WIN32(dwExceptionCode); +} + +HRESULT WINAPI +CreateProxyFromTypeInfo( LPTYPEINFO pTypeInfo, LPUNKNOWN pUnkOuter, REFIID riid, + LPRPCPROXYBUFFER *ppProxy, LPVOID *ppv ) +{ + typedef INT (WINAPI *MessageBoxA)(HWND,LPCSTR,LPCSTR,UINT); + HMODULE hUser32 = LoadLibraryA("user32"); + MessageBoxA pMessageBoxA = (void *)GetProcAddress(hUser32, "MessageBoxA"); + + FIXME("%p %p %s %p %p\n", pTypeInfo, pUnkOuter, debugstr_guid(riid), ppProxy, ppv); + if (pMessageBoxA) + { + pMessageBoxA(NULL, + "The native implementation of OLEAUT32.DLL cannot be used " + "with Wine's RPCRT4.DLL. Remove OLEAUT32.DLL and try again.\n", + "Wine: Unimplemented CreateProxyFromTypeInfo", + 0x10); + ExitProcess(1); + } + return E_NOTIMPL; +} diff --git a/reactos/dll/win32/rpcrt4_new/cpsf.c b/reactos/dll/win32/rpcrt4_new/cpsf.c index dcf37219195..d87f347d88a 100644 --- a/reactos/dll/win32/rpcrt4_new/cpsf.c +++ b/reactos/dll/win32/rpcrt4_new/cpsf.c @@ -1,307 +1,307 @@ -/* - * COM proxy/stub factory (CStdPSFactory) implementation - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "winreg.h" - -#include "objbase.h" - -#include "rpcproxy.h" - -#include "wine/debug.h" - -#include "cpsf.h" - -WINE_DEFAULT_DEBUG_CHANNEL(ole); - -static BOOL FindProxyInfo(const ProxyFileInfo **pProxyFileList, REFIID riid, const ProxyFileInfo **pProxyInfo, int *pIndex) -{ - while (*pProxyFileList) { - if ((*pProxyFileList)->pIIDLookupRtn(riid, pIndex)) { - *pProxyInfo = *pProxyFileList; - TRACE("found: ProxyInfo %p Index %d\n", *pProxyInfo, *pIndex); - return TRUE; - } - pProxyFileList++; - } - TRACE("not found\n"); - return FALSE; -} - -static HRESULT WINAPI CStdPSFactory_QueryInterface(LPPSFACTORYBUFFER iface, - REFIID riid, - LPVOID *obj) -{ - CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; - TRACE("(%p)->QueryInterface(%s,%p)\n",iface,debugstr_guid(riid),obj); - if (IsEqualGUID(&IID_IUnknown,riid) || - IsEqualGUID(&IID_IPSFactoryBuffer,riid)) { - *obj = This; - This->RefCount++; - return S_OK; - } - return E_NOINTERFACE; -} - -static ULONG WINAPI CStdPSFactory_AddRef(LPPSFACTORYBUFFER iface) -{ - CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; - TRACE("(%p)->AddRef()\n",iface); - return ++(This->RefCount); -} - -static ULONG WINAPI CStdPSFactory_Release(LPPSFACTORYBUFFER iface) -{ - CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; - TRACE("(%p)->Release()\n",iface); - return --(This->RefCount); -} - -static HRESULT WINAPI CStdPSFactory_CreateProxy(LPPSFACTORYBUFFER iface, - LPUNKNOWN pUnkOuter, - REFIID riid, - LPRPCPROXYBUFFER *ppProxy, - LPVOID *ppv) -{ - CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; - const ProxyFileInfo *ProxyInfo; - int Index; - TRACE("(%p)->CreateProxy(%p,%s,%p,%p)\n",iface,pUnkOuter, - debugstr_guid(riid),ppProxy,ppv); - if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index)) - return E_NOINTERFACE; - return StdProxy_Construct(riid, pUnkOuter, ProxyInfo, Index, iface, ppProxy, ppv); -} - -static HRESULT WINAPI CStdPSFactory_CreateStub(LPPSFACTORYBUFFER iface, - REFIID riid, - LPUNKNOWN pUnkServer, - LPRPCSTUBBUFFER *ppStub) -{ - CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; - const ProxyFileInfo *ProxyInfo; - int Index; - TRACE("(%p)->CreateStub(%s,%p,%p)\n",iface,debugstr_guid(riid), - pUnkServer,ppStub); - if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index)) - return E_NOINTERFACE; - - if(ProxyInfo->pDelegatedIIDs && ProxyInfo->pDelegatedIIDs[Index]) - return CStdStubBuffer_Delegating_Construct(riid, pUnkServer, ProxyInfo->pNamesArray[Index], - ProxyInfo->pStubVtblList[Index], ProxyInfo->pDelegatedIIDs[Index], - iface, ppStub); - - return CStdStubBuffer_Construct(riid, pUnkServer, ProxyInfo->pNamesArray[Index], - ProxyInfo->pStubVtblList[Index], iface, ppStub); -} - -static const IPSFactoryBufferVtbl CStdPSFactory_Vtbl = -{ - CStdPSFactory_QueryInterface, - CStdPSFactory_AddRef, - CStdPSFactory_Release, - CStdPSFactory_CreateProxy, - CStdPSFactory_CreateStub -}; - -/*********************************************************************** - * NdrDllGetClassObject [RPCRT4.@] - */ -HRESULT WINAPI NdrDllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv, - const ProxyFileInfo **pProxyFileList, - const CLSID *pclsid, - CStdPSFactoryBuffer *pPSFactoryBuffer) -{ - TRACE("(%s, %s, %p, %p, %s, %p)\n", debugstr_guid(rclsid), - debugstr_guid(iid), ppv, pProxyFileList, debugstr_guid(pclsid), - pPSFactoryBuffer); - - *ppv = NULL; - if (!pPSFactoryBuffer->lpVtbl) { - const ProxyFileInfo **pProxyFileList2; - int max_delegating_vtbl_size = 0; - pPSFactoryBuffer->lpVtbl = &CStdPSFactory_Vtbl; - pPSFactoryBuffer->RefCount = 0; - pPSFactoryBuffer->pProxyFileList = pProxyFileList; - for (pProxyFileList2 = pProxyFileList; *pProxyFileList2; pProxyFileList2++) { - int i; - for (i = 0; i < (*pProxyFileList2)->TableSize; i++) { - /* FIXME: i think that different vtables should be copied for - * async interfaces */ - void * const *pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Vtbl; - void **pRpcStubVtbl = (void **)&(*pProxyFileList2)->pStubVtblList[i]->Vtbl; - int j; - - if ((*pProxyFileList2)->pDelegatedIIDs && (*pProxyFileList2)->pDelegatedIIDs[i]) { - pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Delegating_Vtbl; - if ((*pProxyFileList2)->pStubVtblList[i]->header.DispatchTableCount > max_delegating_vtbl_size) - max_delegating_vtbl_size = (*pProxyFileList2)->pStubVtblList[i]->header.DispatchTableCount; - } - - for (j = 0; j < sizeof(IRpcStubBufferVtbl)/sizeof(void *); j++) - if (!pRpcStubVtbl[j]) - pRpcStubVtbl[j] = pSrcRpcStubVtbl[j]; - } - } - if(max_delegating_vtbl_size > 0) - create_delegating_vtbl(max_delegating_vtbl_size); - } - if (IsEqualGUID(rclsid, pclsid)) - return IPSFactoryBuffer_QueryInterface((LPPSFACTORYBUFFER)pPSFactoryBuffer, iid, ppv); - else { - const ProxyFileInfo *info; - int index; - /* otherwise, the dll may be using the iid as the clsid, so - * search for it in the proxy file list */ - if (FindProxyInfo(pProxyFileList, rclsid, &info, &index)) - return IPSFactoryBuffer_QueryInterface((LPPSFACTORYBUFFER)pPSFactoryBuffer, iid, ppv); - - WARN("class %s not available\n", debugstr_guid(rclsid)); - return CLASS_E_CLASSNOTAVAILABLE; - } -} - -/*********************************************************************** - * NdrDllCanUnloadNow [RPCRT4.@] - */ -HRESULT WINAPI NdrDllCanUnloadNow(CStdPSFactoryBuffer *pPSFactoryBuffer) -{ - return !(pPSFactoryBuffer->RefCount); -} - -/*********************************************************************** - * NdrDllRegisterProxy [RPCRT4.@] - */ -HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, - const ProxyFileInfo **pProxyFileList, - const CLSID *pclsid) -{ - LPSTR clsid; - char keyname[120], module[MAX_PATH]; - HKEY key, subkey; - DWORD len; - - TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); - UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); - - /* register interfaces to point to clsid */ - while (*pProxyFileList) { - unsigned u; - for (u=0; u<(*pProxyFileList)->TableSize; u++) { - CInterfaceStubVtbl *proxy = (*pProxyFileList)->pStubVtblList[u]; - PCInterfaceName name = (*pProxyFileList)->pNamesArray[u]; - LPSTR iid; - - TRACE("registering %s %s => %s\n", name, debugstr_guid(proxy->header.piid), clsid); - - UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); - snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); - RpcStringFreeA((unsigned char**)&iid); - if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, - KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { - if (name) - RegSetValueExA(key, NULL, 0, REG_SZ, (const BYTE *)name, strlen(name)); - if (RegCreateKeyExA(key, "ProxyStubClsid32", 0, NULL, 0, - KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) { - snprintf(module, sizeof(module), "{%s}", clsid); - RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module)); - RegCloseKey(subkey); - } - RegCloseKey(key); - } - } - pProxyFileList++; - } - - /* register clsid to point to module */ - snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); - len = GetModuleFileNameA(hDll, module, sizeof(module)); - if (len && len < sizeof(module)) { - TRACE("registering CLSID %s => %s\n", clsid, module); - if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, - KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { - RegSetValueExA(subkey, NULL, 0, REG_SZ, (const BYTE *)"PSFactoryBuffer", strlen("PSFactoryBuffer")); - if (RegCreateKeyExA(key, "InProcServer32", 0, NULL, 0, - KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) { - RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module)); - RegSetValueExA(subkey, "ThreadingModel", 0, REG_SZ, (const BYTE *)"Both", strlen("Both")); - RegCloseKey(subkey); - } - RegCloseKey(key); - } - } - - /* done */ - RpcStringFreeA((unsigned char**)&clsid); - return S_OK; -} - -/*********************************************************************** - * NdrDllUnregisterProxy [RPCRT4.@] - */ -HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, - const ProxyFileInfo **pProxyFileList, - const CLSID *pclsid) -{ - LPSTR clsid; - char keyname[120], module[MAX_PATH]; - DWORD len; - - TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); - UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); - - /* unregister interfaces */ - while (*pProxyFileList) { - unsigned u; - for (u=0; u<(*pProxyFileList)->TableSize; u++) { - CInterfaceStubVtbl *proxy = (*pProxyFileList)->pStubVtblList[u]; - PCInterfaceName name = (*pProxyFileList)->pNamesArray[u]; - LPSTR iid; - - TRACE("unregistering %s %s <= %s\n", name, debugstr_guid(proxy->header.piid), clsid); - - UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); - snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); - RpcStringFreeA((unsigned char**)&iid); - RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); - } - pProxyFileList++; - } - - /* unregister clsid */ - snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); - len = GetModuleFileNameA(hDll, module, sizeof(module)); - if (len && len < sizeof(module)) { - TRACE("unregistering CLSID %s <= %s\n", clsid, module); - RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); - } - - /* done */ - RpcStringFreeA((unsigned char**)&clsid); - return S_OK; -} +/* + * COM proxy/stub factory (CStdPSFactory) implementation + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winreg.h" + +#include "objbase.h" + +#include "rpcproxy.h" + +#include "wine/debug.h" + +#include "cpsf.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +static BOOL FindProxyInfo(const ProxyFileInfo **pProxyFileList, REFIID riid, const ProxyFileInfo **pProxyInfo, int *pIndex) +{ + while (*pProxyFileList) { + if ((*pProxyFileList)->pIIDLookupRtn(riid, pIndex)) { + *pProxyInfo = *pProxyFileList; + TRACE("found: ProxyInfo %p Index %d\n", *pProxyInfo, *pIndex); + return TRUE; + } + pProxyFileList++; + } + TRACE("not found\n"); + return FALSE; +} + +static HRESULT WINAPI CStdPSFactory_QueryInterface(LPPSFACTORYBUFFER iface, + REFIID riid, + LPVOID *obj) +{ + CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; + TRACE("(%p)->QueryInterface(%s,%p)\n",iface,debugstr_guid(riid),obj); + if (IsEqualGUID(&IID_IUnknown,riid) || + IsEqualGUID(&IID_IPSFactoryBuffer,riid)) { + *obj = This; + This->RefCount++; + return S_OK; + } + return E_NOINTERFACE; +} + +static ULONG WINAPI CStdPSFactory_AddRef(LPPSFACTORYBUFFER iface) +{ + CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; + TRACE("(%p)->AddRef()\n",iface); + return ++(This->RefCount); +} + +static ULONG WINAPI CStdPSFactory_Release(LPPSFACTORYBUFFER iface) +{ + CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; + TRACE("(%p)->Release()\n",iface); + return --(This->RefCount); +} + +static HRESULT WINAPI CStdPSFactory_CreateProxy(LPPSFACTORYBUFFER iface, + LPUNKNOWN pUnkOuter, + REFIID riid, + LPRPCPROXYBUFFER *ppProxy, + LPVOID *ppv) +{ + CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; + const ProxyFileInfo *ProxyInfo; + int Index; + TRACE("(%p)->CreateProxy(%p,%s,%p,%p)\n",iface,pUnkOuter, + debugstr_guid(riid),ppProxy,ppv); + if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index)) + return E_NOINTERFACE; + return StdProxy_Construct(riid, pUnkOuter, ProxyInfo, Index, iface, ppProxy, ppv); +} + +static HRESULT WINAPI CStdPSFactory_CreateStub(LPPSFACTORYBUFFER iface, + REFIID riid, + LPUNKNOWN pUnkServer, + LPRPCSTUBBUFFER *ppStub) +{ + CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface; + const ProxyFileInfo *ProxyInfo; + int Index; + TRACE("(%p)->CreateStub(%s,%p,%p)\n",iface,debugstr_guid(riid), + pUnkServer,ppStub); + if (!FindProxyInfo(This->pProxyFileList,riid,&ProxyInfo,&Index)) + return E_NOINTERFACE; + + if(ProxyInfo->pDelegatedIIDs && ProxyInfo->pDelegatedIIDs[Index]) + return CStdStubBuffer_Delegating_Construct(riid, pUnkServer, ProxyInfo->pNamesArray[Index], + ProxyInfo->pStubVtblList[Index], ProxyInfo->pDelegatedIIDs[Index], + iface, ppStub); + + return CStdStubBuffer_Construct(riid, pUnkServer, ProxyInfo->pNamesArray[Index], + ProxyInfo->pStubVtblList[Index], iface, ppStub); +} + +static const IPSFactoryBufferVtbl CStdPSFactory_Vtbl = +{ + CStdPSFactory_QueryInterface, + CStdPSFactory_AddRef, + CStdPSFactory_Release, + CStdPSFactory_CreateProxy, + CStdPSFactory_CreateStub +}; + +/*********************************************************************** + * NdrDllGetClassObject [RPCRT4.@] + */ +HRESULT WINAPI NdrDllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv, + const ProxyFileInfo **pProxyFileList, + const CLSID *pclsid, + CStdPSFactoryBuffer *pPSFactoryBuffer) +{ + TRACE("(%s, %s, %p, %p, %s, %p)\n", debugstr_guid(rclsid), + debugstr_guid(iid), ppv, pProxyFileList, debugstr_guid(pclsid), + pPSFactoryBuffer); + + *ppv = NULL; + if (!pPSFactoryBuffer->lpVtbl) { + const ProxyFileInfo **pProxyFileList2; + int max_delegating_vtbl_size = 0; + pPSFactoryBuffer->lpVtbl = &CStdPSFactory_Vtbl; + pPSFactoryBuffer->RefCount = 0; + pPSFactoryBuffer->pProxyFileList = pProxyFileList; + for (pProxyFileList2 = pProxyFileList; *pProxyFileList2; pProxyFileList2++) { + int i; + for (i = 0; i < (*pProxyFileList2)->TableSize; i++) { + /* FIXME: i think that different vtables should be copied for + * async interfaces */ + void * const *pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Vtbl; + void **pRpcStubVtbl = (void **)&(*pProxyFileList2)->pStubVtblList[i]->Vtbl; + int j; + + if ((*pProxyFileList2)->pDelegatedIIDs && (*pProxyFileList2)->pDelegatedIIDs[i]) { + pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Delegating_Vtbl; + if ((*pProxyFileList2)->pStubVtblList[i]->header.DispatchTableCount > max_delegating_vtbl_size) + max_delegating_vtbl_size = (*pProxyFileList2)->pStubVtblList[i]->header.DispatchTableCount; + } + + for (j = 0; j < sizeof(IRpcStubBufferVtbl)/sizeof(void *); j++) + if (!pRpcStubVtbl[j]) + pRpcStubVtbl[j] = pSrcRpcStubVtbl[j]; + } + } + if(max_delegating_vtbl_size > 0) + create_delegating_vtbl(max_delegating_vtbl_size); + } + if (IsEqualGUID(rclsid, pclsid)) + return IPSFactoryBuffer_QueryInterface((LPPSFACTORYBUFFER)pPSFactoryBuffer, iid, ppv); + else { + const ProxyFileInfo *info; + int index; + /* otherwise, the dll may be using the iid as the clsid, so + * search for it in the proxy file list */ + if (FindProxyInfo(pProxyFileList, rclsid, &info, &index)) + return IPSFactoryBuffer_QueryInterface((LPPSFACTORYBUFFER)pPSFactoryBuffer, iid, ppv); + + WARN("class %s not available\n", debugstr_guid(rclsid)); + return CLASS_E_CLASSNOTAVAILABLE; + } +} + +/*********************************************************************** + * NdrDllCanUnloadNow [RPCRT4.@] + */ +HRESULT WINAPI NdrDllCanUnloadNow(CStdPSFactoryBuffer *pPSFactoryBuffer) +{ + return !(pPSFactoryBuffer->RefCount); +} + +/*********************************************************************** + * NdrDllRegisterProxy [RPCRT4.@] + */ +HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, + const ProxyFileInfo **pProxyFileList, + const CLSID *pclsid) +{ + LPSTR clsid; + char keyname[120], module[MAX_PATH]; + HKEY key, subkey; + DWORD len; + + TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); + UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); + + /* register interfaces to point to clsid */ + while (*pProxyFileList) { + unsigned u; + for (u=0; u<(*pProxyFileList)->TableSize; u++) { + CInterfaceStubVtbl *proxy = (*pProxyFileList)->pStubVtblList[u]; + PCInterfaceName name = (*pProxyFileList)->pNamesArray[u]; + LPSTR iid; + + TRACE("registering %s %s => %s\n", name, debugstr_guid(proxy->header.piid), clsid); + + UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); + snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); + RpcStringFreeA((unsigned char**)&iid); + if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, + KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { + if (name) + RegSetValueExA(key, NULL, 0, REG_SZ, (const BYTE *)name, strlen(name)); + if (RegCreateKeyExA(key, "ProxyStubClsid32", 0, NULL, 0, + KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) { + snprintf(module, sizeof(module), "{%s}", clsid); + RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module)); + RegCloseKey(subkey); + } + RegCloseKey(key); + } + } + pProxyFileList++; + } + + /* register clsid to point to module */ + snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); + len = GetModuleFileNameA(hDll, module, sizeof(module)); + if (len && len < sizeof(module)) { + TRACE("registering CLSID %s => %s\n", clsid, module); + if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, + KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { + RegSetValueExA(subkey, NULL, 0, REG_SZ, (const BYTE *)"PSFactoryBuffer", strlen("PSFactoryBuffer")); + if (RegCreateKeyExA(key, "InProcServer32", 0, NULL, 0, + KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) { + RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module)); + RegSetValueExA(subkey, "ThreadingModel", 0, REG_SZ, (const BYTE *)"Both", strlen("Both")); + RegCloseKey(subkey); + } + RegCloseKey(key); + } + } + + /* done */ + RpcStringFreeA((unsigned char**)&clsid); + return S_OK; +} + +/*********************************************************************** + * NdrDllUnregisterProxy [RPCRT4.@] + */ +HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, + const ProxyFileInfo **pProxyFileList, + const CLSID *pclsid) +{ + LPSTR clsid; + char keyname[120], module[MAX_PATH]; + DWORD len; + + TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); + UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); + + /* unregister interfaces */ + while (*pProxyFileList) { + unsigned u; + for (u=0; u<(*pProxyFileList)->TableSize; u++) { + CInterfaceStubVtbl *proxy = (*pProxyFileList)->pStubVtblList[u]; + PCInterfaceName name = (*pProxyFileList)->pNamesArray[u]; + LPSTR iid; + + TRACE("unregistering %s %s <= %s\n", name, debugstr_guid(proxy->header.piid), clsid); + + UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); + snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); + RpcStringFreeA((unsigned char**)&iid); + RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); + } + pProxyFileList++; + } + + /* unregister clsid */ + snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); + len = GetModuleFileNameA(hDll, module, sizeof(module)); + if (len && len < sizeof(module)) { + TRACE("unregistering CLSID %s <= %s\n", clsid, module); + RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); + } + + /* done */ + RpcStringFreeA((unsigned char**)&clsid); + return S_OK; +} diff --git a/reactos/dll/win32/rpcrt4_new/cpsf.h b/reactos/dll/win32/rpcrt4_new/cpsf.h index 5ce8fe6575e..015389c01b2 100644 --- a/reactos/dll/win32/rpcrt4_new/cpsf.h +++ b/reactos/dll/win32/rpcrt4_new/cpsf.h @@ -1,56 +1,56 @@ -/* - * COM proxy definitions - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_CPSF_H -#define __WINE_CPSF_H - -HRESULT WINAPI StdProxy_Construct(REFIID riid, - LPUNKNOWN pUnkOuter, - const ProxyFileInfo *ProxyInfo, - int Index, - LPPSFACTORYBUFFER pPSFactory, - LPRPCPROXYBUFFER *ppProxy, - LPVOID *ppvObj); - -HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub); - -HRESULT WINAPI CStdStubBuffer_Delegating_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - REFIID delegating_iid, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub); - -const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface); - -const IRpcStubBufferVtbl CStdStubBuffer_Vtbl; -const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl; - -void create_delegating_vtbl(DWORD num_methods); - -HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub); - -#endif /* __WINE_CPSF_H */ +/* + * COM proxy definitions + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_CPSF_H +#define __WINE_CPSF_H + +HRESULT WINAPI StdProxy_Construct(REFIID riid, + LPUNKNOWN pUnkOuter, + const ProxyFileInfo *ProxyInfo, + int Index, + LPPSFACTORYBUFFER pPSFactory, + LPRPCPROXYBUFFER *ppProxy, + LPVOID *ppvObj); + +HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, + LPUNKNOWN pUnkServer, + PCInterfaceName name, + CInterfaceStubVtbl *vtbl, + LPPSFACTORYBUFFER pPSFactory, + LPRPCSTUBBUFFER *ppStub); + +HRESULT WINAPI CStdStubBuffer_Delegating_Construct(REFIID riid, + LPUNKNOWN pUnkServer, + PCInterfaceName name, + CInterfaceStubVtbl *vtbl, + REFIID delegating_iid, + LPPSFACTORYBUFFER pPSFactory, + LPRPCSTUBBUFFER *ppStub); + +const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface); + +const IRpcStubBufferVtbl CStdStubBuffer_Vtbl; +const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl; + +void create_delegating_vtbl(DWORD num_methods); + +HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub); + +#endif /* __WINE_CPSF_H */ diff --git a/reactos/dll/win32/rpcrt4_new/cstub.c b/reactos/dll/win32/rpcrt4_new/cstub.c index 0ae85ae055f..d2f0b49da1d 100644 --- a/reactos/dll/win32/rpcrt4_new/cstub.c +++ b/reactos/dll/win32/rpcrt4_new/cstub.c @@ -1,587 +1,587 @@ -/* - * COM stub (CStdStubBuffer) implementation - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "excpt.h" - -#include "objbase.h" -#include "rpcproxy.h" - -#include "wine/debug.h" -#include "wine/exception.h" - -#include "cpsf.h" - -WINE_DEFAULT_DEBUG_CHANNEL(ole); - -#define STUB_HEADER(This) (((const CInterfaceStubHeader*)((This)->lpVtbl))[-1]) - -static WINE_EXCEPTION_FILTER(stub_filter) -{ - if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) - return EXCEPTION_CONTINUE_SEARCH; - return EXCEPTION_EXECUTE_HANDLER; -} - -typedef struct -{ - IUnknownVtbl *base_obj; - IRpcStubBuffer *base_stub; - CStdStubBuffer stub_buffer; -} cstdstubbuffer_delegating_t; - -static inline cstdstubbuffer_delegating_t *impl_from_delegating( IRpcStubBuffer *iface ) -{ - return (cstdstubbuffer_delegating_t*)((char *)iface - FIELD_OFFSET(cstdstubbuffer_delegating_t, stub_buffer)); -} - -HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub) -{ - CStdStubBuffer *This; - IUnknown *pvServer; - HRESULT r; - TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name); - TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid)); - TRACE("vtbl=%p\n", &vtbl->Vtbl); - - if (!IsEqualGUID(vtbl->header.piid, riid)) { - ERR("IID mismatch during stub creation\n"); - return RPC_E_UNEXPECTED; - } - - r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer); - if(FAILED(r)) - return r; - - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(CStdStubBuffer)); - if (!This) { - IUnknown_Release(pvServer); - return E_OUTOFMEMORY; - } - - This->lpVtbl = &vtbl->Vtbl; - This->RefCount = 1; - This->pvServerObject = pvServer; - This->pPSFactory = pPSFactory; - *ppStub = (LPRPCSTUBBUFFER)This; - - IPSFactoryBuffer_AddRef(pPSFactory); - return S_OK; -} - -static CRITICAL_SECTION delegating_vtbl_section; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &delegating_vtbl_section, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": delegating_vtbl_section") } -}; -static CRITICAL_SECTION delegating_vtbl_section = { &critsect_debug, -1, 0, 0, 0, 0 }; - -typedef struct -{ - DWORD ref; - IUnknownVtbl vtbl; -} ref_counted_vtbl; - -static struct -{ - ref_counted_vtbl *table; - DWORD size; -} current_vtbl; - - -static HRESULT WINAPI delegating_QueryInterface(IUnknown *pUnk, REFIID iid, void **ppv) -{ - *ppv = (void *)pUnk; - return S_OK; -} - -static ULONG WINAPI delegating_AddRef(IUnknown *pUnk) -{ - return 1; -} - -static ULONG WINAPI delegating_Release(IUnknown *pUnk) -{ - return 1; -} - -#if defined(__i386__) - -/* The idea here is to replace the first param on the stack - ie. This (which will point to cstdstubbuffer_delegating_t) - with This->stub_buffer.pvServerObject and then jump to the - relevant offset in This->stub_buffer.pvServerObject's vtbl. -*/ -#include "pshpack1.h" -typedef struct { - DWORD mov1; /* mov 0x4(%esp), %eax 8b 44 24 04 */ - WORD mov2; /* mov 0x10(%eax), %eax 8b 40 */ - BYTE sixteen; /* 10 */ - DWORD mov3; /* mov %eax, 0x4(%esp) 89 44 24 04 */ - WORD mov4; /* mov (%eax), %eax 8b 00 */ - WORD mov5; /* mov offset(%eax), %eax 8b 80 */ - DWORD offset; /* xx xx xx xx */ - WORD jmp; /* jmp *%eax ff e0 */ - BYTE pad[3]; /* lea 0x0(%esi), %esi 8d 76 00 */ -} vtbl_method_t; -#include "poppack.h" - -static void fill_table(IUnknownVtbl *vtbl, DWORD num) -{ - vtbl_method_t *method; - void **entry; - DWORD i; - - vtbl->QueryInterface = delegating_QueryInterface; - vtbl->AddRef = delegating_AddRef; - vtbl->Release = delegating_Release; - - method = (vtbl_method_t*)((void **)vtbl + num); - entry = (void**)(vtbl + 1); - - for(i = 3; i < num; i++) - { - *entry = method; - method->mov1 = 0x0424448b; - method->mov2 = 0x408b; - method->sixteen = 0x10; - method->mov3 = 0x04244489; - method->mov4 = 0x008b; - method->mov5 = 0x808b; - method->offset = i << 2; - method->jmp = 0xe0ff; - method->pad[0] = 0x8d; - method->pad[1] = 0x76; - method->pad[2] = 0x00; - - method++; - entry++; - } -} - -#else /* __i386__ */ - -typedef struct {int dummy;} vtbl_method_t; -static void fill_table(IUnknownVtbl *vtbl, DWORD num) -{ - ERR("delegated stubs are not supported on this architecture\n"); -} - -#endif /* __i386__ */ - -void create_delegating_vtbl(DWORD num_methods) -{ - TRACE("%d\n", num_methods); - if(num_methods <= 3) - { - ERR("should have more than %d methods\n", num_methods); - return; - } - - EnterCriticalSection(&delegating_vtbl_section); - if(num_methods > current_vtbl.size) - { - DWORD size; - if(current_vtbl.table && current_vtbl.table->ref == 0) - { - TRACE("freeing old table\n"); - HeapFree(GetProcessHeap(), 0, current_vtbl.table); - } - size = sizeof(DWORD) + num_methods * sizeof(void*) + (num_methods - 3) * sizeof(vtbl_method_t); - current_vtbl.table = HeapAlloc(GetProcessHeap(), 0, size); - fill_table(¤t_vtbl.table->vtbl, num_methods); - current_vtbl.table->ref = 0; - current_vtbl.size = num_methods; - } - LeaveCriticalSection(&delegating_vtbl_section); -} - -static IUnknownVtbl *get_delegating_vtbl(void) -{ - IUnknownVtbl *ret; - - EnterCriticalSection(&delegating_vtbl_section); - current_vtbl.table->ref++; - ret = ¤t_vtbl.table->vtbl; - LeaveCriticalSection(&delegating_vtbl_section); - return ret; -} - -static void release_delegating_vtbl(IUnknownVtbl *vtbl) -{ - ref_counted_vtbl *table = (ref_counted_vtbl*)((DWORD *)vtbl - 1); - - EnterCriticalSection(&delegating_vtbl_section); - table->ref--; - TRACE("ref now %d\n", table->ref); - if(table->ref == 0 && table != current_vtbl.table) - { - TRACE("... and we're not current so free'ing\n"); - HeapFree(GetProcessHeap(), 0, table); - } - LeaveCriticalSection(&delegating_vtbl_section); -} - -HRESULT WINAPI CStdStubBuffer_Delegating_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - REFIID delegating_iid, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub) -{ - cstdstubbuffer_delegating_t *This; - IUnknown *pvServer; - HRESULT r; - - TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name); - TRACE("iid=%s delegating to %s\n", debugstr_guid(vtbl->header.piid), debugstr_guid(delegating_iid)); - TRACE("vtbl=%p\n", &vtbl->Vtbl); - - if (!IsEqualGUID(vtbl->header.piid, riid)) - { - ERR("IID mismatch during stub creation\n"); - return RPC_E_UNEXPECTED; - } - - r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer); - if(FAILED(r)) return r; - - This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This)); - if (!This) - { - IUnknown_Release(pvServer); - return E_OUTOFMEMORY; - } - - This->base_obj = get_delegating_vtbl(); - r = create_stub(delegating_iid, (IUnknown*)&This->base_obj, &This->base_stub); - if(FAILED(r)) - { - release_delegating_vtbl(This->base_obj); - HeapFree(GetProcessHeap(), 0, This); - IUnknown_Release(pvServer); - return r; - } - - This->stub_buffer.lpVtbl = &vtbl->Vtbl; - This->stub_buffer.RefCount = 1; - This->stub_buffer.pvServerObject = pvServer; - This->stub_buffer.pPSFactory = pPSFactory; - *ppStub = (LPRPCSTUBBUFFER)&This->stub_buffer; - - IPSFactoryBuffer_AddRef(pPSFactory); - return S_OK; -} - -HRESULT WINAPI CStdStubBuffer_QueryInterface(LPRPCSTUBBUFFER iface, - REFIID riid, - LPVOID *obj) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj); - - if (IsEqualIID(&IID_IUnknown, riid) || - IsEqualIID(&IID_IRpcStubBuffer, riid)) - { - IUnknown_AddRef(iface); - *obj = iface; - return S_OK; - } - *obj = NULL; - return E_NOINTERFACE; -} - -ULONG WINAPI CStdStubBuffer_AddRef(LPRPCSTUBBUFFER iface) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - TRACE("(%p)->AddRef()\n",This); - return InterlockedIncrement(&This->RefCount); -} - -ULONG WINAPI NdrCStdStubBuffer_Release(LPRPCSTUBBUFFER iface, - LPPSFACTORYBUFFER pPSF) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - ULONG refs; - - TRACE("(%p)->Release()\n",This); - - refs = InterlockedDecrement(&This->RefCount); - if (!refs) - { - /* test_Release shows that native doesn't call Disconnect here. - We'll leave it in for the time being. */ - IRpcStubBuffer_Disconnect(iface); - - IPSFactoryBuffer_Release(pPSF); - HeapFree(GetProcessHeap(),0,This); - } - return refs; -} - -ULONG WINAPI NdrCStdStubBuffer2_Release(LPRPCSTUBBUFFER iface, - LPPSFACTORYBUFFER pPSF) -{ - cstdstubbuffer_delegating_t *This = impl_from_delegating( iface ); - ULONG refs; - - TRACE("(%p)->Release()\n", This); - - refs = InterlockedDecrement(&This->stub_buffer.RefCount); - if (!refs) - { - /* Just like NdrCStdStubBuffer_Release, we shouldn't call - Disconnect here */ - IRpcStubBuffer_Disconnect((IRpcStubBuffer *)&This->stub_buffer); - - IRpcStubBuffer_Release(This->base_stub); - release_delegating_vtbl(This->base_obj); - - IPSFactoryBuffer_Release(pPSF); - HeapFree(GetProcessHeap(), 0, This); - } - - return refs; -} - -HRESULT WINAPI CStdStubBuffer_Connect(LPRPCSTUBBUFFER iface, - LPUNKNOWN lpUnkServer) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - HRESULT r; - IUnknown *new = NULL; - - TRACE("(%p)->Connect(%p)\n",This,lpUnkServer); - - r = IUnknown_QueryInterface(lpUnkServer, STUB_HEADER(This).piid, (void**)&new); - new = InterlockedExchangePointer((void**)&This->pvServerObject, new); - if(new) - IUnknown_Release(new); - return r; -} - -void WINAPI CStdStubBuffer_Disconnect(LPRPCSTUBBUFFER iface) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - IUnknown *old; - TRACE("(%p)->Disconnect()\n",This); - - old = InterlockedExchangePointer((void**)&This->pvServerObject, NULL); - - if(old) - IUnknown_Release(old); -} - -HRESULT WINAPI CStdStubBuffer_Invoke(LPRPCSTUBBUFFER iface, - PRPCOLEMESSAGE pMsg, - LPRPCCHANNELBUFFER pChannel) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - DWORD dwPhase = STUB_UNMARSHAL; - HRESULT hr = S_OK; - - TRACE("(%p)->Invoke(%p,%p)\n",This,pMsg,pChannel); - - __TRY - { - if (STUB_HEADER(This).pDispatchTable) - STUB_HEADER(This).pDispatchTable[pMsg->iMethod](iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase); - else /* pure interpreted */ - NdrStubCall2(iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase); - } - __EXCEPT(stub_filter) - { - DWORD dwExceptionCode = GetExceptionCode(); - WARN("a stub call failed with exception 0x%08x (%d)\n", dwExceptionCode, dwExceptionCode); - if (FAILED(dwExceptionCode)) - hr = dwExceptionCode; - else - hr = HRESULT_FROM_WIN32(dwExceptionCode); - } - __ENDTRY - - return hr; -} - -LPRPCSTUBBUFFER WINAPI CStdStubBuffer_IsIIDSupported(LPRPCSTUBBUFFER iface, - REFIID riid) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - TRACE("(%p)->IsIIDSupported(%s)\n",This,debugstr_guid(riid)); - return IsEqualGUID(STUB_HEADER(This).piid, riid) ? iface : NULL; -} - -ULONG WINAPI CStdStubBuffer_CountRefs(LPRPCSTUBBUFFER iface) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - TRACE("(%p)->CountRefs()\n",This); - return This->RefCount; -} - -HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface(LPRPCSTUBBUFFER iface, - LPVOID *ppv) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - TRACE("(%p)->DebugServerQueryInterface(%p)\n",This,ppv); - return S_OK; -} - -void WINAPI CStdStubBuffer_DebugServerRelease(LPRPCSTUBBUFFER iface, - LPVOID pv) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - TRACE("(%p)->DebugServerRelease(%p)\n",This,pv); -} - -const IRpcStubBufferVtbl CStdStubBuffer_Vtbl = -{ - CStdStubBuffer_QueryInterface, - CStdStubBuffer_AddRef, - NULL, - CStdStubBuffer_Connect, - CStdStubBuffer_Disconnect, - CStdStubBuffer_Invoke, - CStdStubBuffer_IsIIDSupported, - CStdStubBuffer_CountRefs, - CStdStubBuffer_DebugServerQueryInterface, - CStdStubBuffer_DebugServerRelease -}; - -static HRESULT WINAPI CStdStubBuffer_Delegating_Connect(LPRPCSTUBBUFFER iface, - LPUNKNOWN lpUnkServer) -{ - cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); - HRESULT r; - TRACE("(%p)->Connect(%p)\n", This, lpUnkServer); - - r = CStdStubBuffer_Connect(iface, lpUnkServer); - if(SUCCEEDED(r)) - r = IRpcStubBuffer_Connect(This->base_stub, (IUnknown*)&This->base_obj); - - return r; -} - -static void WINAPI CStdStubBuffer_Delegating_Disconnect(LPRPCSTUBBUFFER iface) -{ - cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); - TRACE("(%p)->Disconnect()\n", This); - - IRpcStubBuffer_Disconnect(This->base_stub); - CStdStubBuffer_Disconnect(iface); -} - -static ULONG WINAPI CStdStubBuffer_Delegating_CountRefs(LPRPCSTUBBUFFER iface) -{ - cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); - ULONG ret; - TRACE("(%p)->CountRefs()\n", This); - - ret = CStdStubBuffer_CountRefs(iface); - ret += IRpcStubBuffer_CountRefs(This->base_stub); - - return ret; -} - -const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl = -{ - CStdStubBuffer_QueryInterface, - CStdStubBuffer_AddRef, - NULL, - CStdStubBuffer_Delegating_Connect, - CStdStubBuffer_Delegating_Disconnect, - CStdStubBuffer_Invoke, - CStdStubBuffer_IsIIDSupported, - CStdStubBuffer_Delegating_CountRefs, - CStdStubBuffer_DebugServerQueryInterface, - CStdStubBuffer_DebugServerRelease -}; - -const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - return STUB_HEADER(This).pServerInfo; -} - -/************************************************************************ - * NdrStubForwardingFunction [RPCRT4.@] - */ -void __RPC_STUB NdrStubForwardingFunction( IRpcStubBuffer *iface, IRpcChannelBuffer *pChannel, - PRPC_MESSAGE pMsg, DWORD *pdwStubPhase ) -{ - /* Note pMsg is passed intact since RPCOLEMESSAGE is basically a RPC_MESSAGE. */ - - cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); - HRESULT r = IRpcStubBuffer_Invoke(This->base_stub, (RPCOLEMESSAGE*)pMsg, pChannel); - if(FAILED(r)) RpcRaiseException(r); - return; -} - -/*********************************************************************** - * NdrStubInitialize [RPCRT4.@] - */ -void WINAPI NdrStubInitialize(PRPC_MESSAGE pRpcMsg, - PMIDL_STUB_MESSAGE pStubMsg, - PMIDL_STUB_DESC pStubDescriptor, - LPRPCCHANNELBUFFER pRpcChannelBuffer) -{ - TRACE("(%p,%p,%p,%p)\n", pRpcMsg, pStubMsg, pStubDescriptor, pRpcChannelBuffer); - NdrServerInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor); - pStubMsg->pRpcChannelBuffer = pRpcChannelBuffer; -} - -/*********************************************************************** - * NdrStubGetBuffer [RPCRT4.@] - */ -void WINAPI NdrStubGetBuffer(LPRPCSTUBBUFFER iface, - LPRPCCHANNELBUFFER pRpcChannelBuffer, - PMIDL_STUB_MESSAGE pStubMsg) -{ - CStdStubBuffer *This = (CStdStubBuffer *)iface; - HRESULT hr; - - TRACE("(%p, %p, %p)\n", This, pRpcChannelBuffer, pStubMsg); - - pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength; - hr = IRpcChannelBuffer_GetBuffer(pRpcChannelBuffer, - (RPCOLEMESSAGE *)pStubMsg->RpcMsg, STUB_HEADER(This).piid); - if (FAILED(hr)) - { - RpcRaiseException(hr); - return; - } - - pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer; - pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength; - pStubMsg->Buffer = pStubMsg->BufferStart; -} +/* + * COM stub (CStdStubBuffer) implementation + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "excpt.h" + +#include "objbase.h" +#include "rpcproxy.h" + +#include "wine/debug.h" +#include "wine/exception.h" + +#include "cpsf.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +#define STUB_HEADER(This) (((const CInterfaceStubHeader*)((This)->lpVtbl))[-1]) + +static WINE_EXCEPTION_FILTER(stub_filter) +{ + if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) + return EXCEPTION_CONTINUE_SEARCH; + return EXCEPTION_EXECUTE_HANDLER; +} + +typedef struct +{ + IUnknownVtbl *base_obj; + IRpcStubBuffer *base_stub; + CStdStubBuffer stub_buffer; +} cstdstubbuffer_delegating_t; + +static inline cstdstubbuffer_delegating_t *impl_from_delegating( IRpcStubBuffer *iface ) +{ + return (cstdstubbuffer_delegating_t*)((char *)iface - FIELD_OFFSET(cstdstubbuffer_delegating_t, stub_buffer)); +} + +HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, + LPUNKNOWN pUnkServer, + PCInterfaceName name, + CInterfaceStubVtbl *vtbl, + LPPSFACTORYBUFFER pPSFactory, + LPRPCSTUBBUFFER *ppStub) +{ + CStdStubBuffer *This; + IUnknown *pvServer; + HRESULT r; + TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name); + TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid)); + TRACE("vtbl=%p\n", &vtbl->Vtbl); + + if (!IsEqualGUID(vtbl->header.piid, riid)) { + ERR("IID mismatch during stub creation\n"); + return RPC_E_UNEXPECTED; + } + + r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer); + if(FAILED(r)) + return r; + + This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(CStdStubBuffer)); + if (!This) { + IUnknown_Release(pvServer); + return E_OUTOFMEMORY; + } + + This->lpVtbl = &vtbl->Vtbl; + This->RefCount = 1; + This->pvServerObject = pvServer; + This->pPSFactory = pPSFactory; + *ppStub = (LPRPCSTUBBUFFER)This; + + IPSFactoryBuffer_AddRef(pPSFactory); + return S_OK; +} + +static CRITICAL_SECTION delegating_vtbl_section; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &delegating_vtbl_section, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": delegating_vtbl_section") } +}; +static CRITICAL_SECTION delegating_vtbl_section = { &critsect_debug, -1, 0, 0, 0, 0 }; + +typedef struct +{ + DWORD ref; + IUnknownVtbl vtbl; +} ref_counted_vtbl; + +static struct +{ + ref_counted_vtbl *table; + DWORD size; +} current_vtbl; + + +static HRESULT WINAPI delegating_QueryInterface(IUnknown *pUnk, REFIID iid, void **ppv) +{ + *ppv = (void *)pUnk; + return S_OK; +} + +static ULONG WINAPI delegating_AddRef(IUnknown *pUnk) +{ + return 1; +} + +static ULONG WINAPI delegating_Release(IUnknown *pUnk) +{ + return 1; +} + +#if defined(__i386__) + +/* The idea here is to replace the first param on the stack + ie. This (which will point to cstdstubbuffer_delegating_t) + with This->stub_buffer.pvServerObject and then jump to the + relevant offset in This->stub_buffer.pvServerObject's vtbl. +*/ +#include "pshpack1.h" +typedef struct { + DWORD mov1; /* mov 0x4(%esp), %eax 8b 44 24 04 */ + WORD mov2; /* mov 0x10(%eax), %eax 8b 40 */ + BYTE sixteen; /* 10 */ + DWORD mov3; /* mov %eax, 0x4(%esp) 89 44 24 04 */ + WORD mov4; /* mov (%eax), %eax 8b 00 */ + WORD mov5; /* mov offset(%eax), %eax 8b 80 */ + DWORD offset; /* xx xx xx xx */ + WORD jmp; /* jmp *%eax ff e0 */ + BYTE pad[3]; /* lea 0x0(%esi), %esi 8d 76 00 */ +} vtbl_method_t; +#include "poppack.h" + +static void fill_table(IUnknownVtbl *vtbl, DWORD num) +{ + vtbl_method_t *method; + void **entry; + DWORD i; + + vtbl->QueryInterface = delegating_QueryInterface; + vtbl->AddRef = delegating_AddRef; + vtbl->Release = delegating_Release; + + method = (vtbl_method_t*)((void **)vtbl + num); + entry = (void**)(vtbl + 1); + + for(i = 3; i < num; i++) + { + *entry = method; + method->mov1 = 0x0424448b; + method->mov2 = 0x408b; + method->sixteen = 0x10; + method->mov3 = 0x04244489; + method->mov4 = 0x008b; + method->mov5 = 0x808b; + method->offset = i << 2; + method->jmp = 0xe0ff; + method->pad[0] = 0x8d; + method->pad[1] = 0x76; + method->pad[2] = 0x00; + + method++; + entry++; + } +} + +#else /* __i386__ */ + +typedef struct {int dummy;} vtbl_method_t; +static void fill_table(IUnknownVtbl *vtbl, DWORD num) +{ + ERR("delegated stubs are not supported on this architecture\n"); +} + +#endif /* __i386__ */ + +void create_delegating_vtbl(DWORD num_methods) +{ + TRACE("%d\n", num_methods); + if(num_methods <= 3) + { + ERR("should have more than %d methods\n", num_methods); + return; + } + + EnterCriticalSection(&delegating_vtbl_section); + if(num_methods > current_vtbl.size) + { + DWORD size; + if(current_vtbl.table && current_vtbl.table->ref == 0) + { + TRACE("freeing old table\n"); + HeapFree(GetProcessHeap(), 0, current_vtbl.table); + } + size = sizeof(DWORD) + num_methods * sizeof(void*) + (num_methods - 3) * sizeof(vtbl_method_t); + current_vtbl.table = HeapAlloc(GetProcessHeap(), 0, size); + fill_table(¤t_vtbl.table->vtbl, num_methods); + current_vtbl.table->ref = 0; + current_vtbl.size = num_methods; + } + LeaveCriticalSection(&delegating_vtbl_section); +} + +static IUnknownVtbl *get_delegating_vtbl(void) +{ + IUnknownVtbl *ret; + + EnterCriticalSection(&delegating_vtbl_section); + current_vtbl.table->ref++; + ret = ¤t_vtbl.table->vtbl; + LeaveCriticalSection(&delegating_vtbl_section); + return ret; +} + +static void release_delegating_vtbl(IUnknownVtbl *vtbl) +{ + ref_counted_vtbl *table = (ref_counted_vtbl*)((DWORD *)vtbl - 1); + + EnterCriticalSection(&delegating_vtbl_section); + table->ref--; + TRACE("ref now %d\n", table->ref); + if(table->ref == 0 && table != current_vtbl.table) + { + TRACE("... and we're not current so free'ing\n"); + HeapFree(GetProcessHeap(), 0, table); + } + LeaveCriticalSection(&delegating_vtbl_section); +} + +HRESULT WINAPI CStdStubBuffer_Delegating_Construct(REFIID riid, + LPUNKNOWN pUnkServer, + PCInterfaceName name, + CInterfaceStubVtbl *vtbl, + REFIID delegating_iid, + LPPSFACTORYBUFFER pPSFactory, + LPRPCSTUBBUFFER *ppStub) +{ + cstdstubbuffer_delegating_t *This; + IUnknown *pvServer; + HRESULT r; + + TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name); + TRACE("iid=%s delegating to %s\n", debugstr_guid(vtbl->header.piid), debugstr_guid(delegating_iid)); + TRACE("vtbl=%p\n", &vtbl->Vtbl); + + if (!IsEqualGUID(vtbl->header.piid, riid)) + { + ERR("IID mismatch during stub creation\n"); + return RPC_E_UNEXPECTED; + } + + r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer); + if(FAILED(r)) return r; + + This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This)); + if (!This) + { + IUnknown_Release(pvServer); + return E_OUTOFMEMORY; + } + + This->base_obj = get_delegating_vtbl(); + r = create_stub(delegating_iid, (IUnknown*)&This->base_obj, &This->base_stub); + if(FAILED(r)) + { + release_delegating_vtbl(This->base_obj); + HeapFree(GetProcessHeap(), 0, This); + IUnknown_Release(pvServer); + return r; + } + + This->stub_buffer.lpVtbl = &vtbl->Vtbl; + This->stub_buffer.RefCount = 1; + This->stub_buffer.pvServerObject = pvServer; + This->stub_buffer.pPSFactory = pPSFactory; + *ppStub = (LPRPCSTUBBUFFER)&This->stub_buffer; + + IPSFactoryBuffer_AddRef(pPSFactory); + return S_OK; +} + +HRESULT WINAPI CStdStubBuffer_QueryInterface(LPRPCSTUBBUFFER iface, + REFIID riid, + LPVOID *obj) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj); + + if (IsEqualIID(&IID_IUnknown, riid) || + IsEqualIID(&IID_IRpcStubBuffer, riid)) + { + IUnknown_AddRef(iface); + *obj = iface; + return S_OK; + } + *obj = NULL; + return E_NOINTERFACE; +} + +ULONG WINAPI CStdStubBuffer_AddRef(LPRPCSTUBBUFFER iface) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + TRACE("(%p)->AddRef()\n",This); + return InterlockedIncrement(&This->RefCount); +} + +ULONG WINAPI NdrCStdStubBuffer_Release(LPRPCSTUBBUFFER iface, + LPPSFACTORYBUFFER pPSF) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + ULONG refs; + + TRACE("(%p)->Release()\n",This); + + refs = InterlockedDecrement(&This->RefCount); + if (!refs) + { + /* test_Release shows that native doesn't call Disconnect here. + We'll leave it in for the time being. */ + IRpcStubBuffer_Disconnect(iface); + + IPSFactoryBuffer_Release(pPSF); + HeapFree(GetProcessHeap(),0,This); + } + return refs; +} + +ULONG WINAPI NdrCStdStubBuffer2_Release(LPRPCSTUBBUFFER iface, + LPPSFACTORYBUFFER pPSF) +{ + cstdstubbuffer_delegating_t *This = impl_from_delegating( iface ); + ULONG refs; + + TRACE("(%p)->Release()\n", This); + + refs = InterlockedDecrement(&This->stub_buffer.RefCount); + if (!refs) + { + /* Just like NdrCStdStubBuffer_Release, we shouldn't call + Disconnect here */ + IRpcStubBuffer_Disconnect((IRpcStubBuffer *)&This->stub_buffer); + + IRpcStubBuffer_Release(This->base_stub); + release_delegating_vtbl(This->base_obj); + + IPSFactoryBuffer_Release(pPSF); + HeapFree(GetProcessHeap(), 0, This); + } + + return refs; +} + +HRESULT WINAPI CStdStubBuffer_Connect(LPRPCSTUBBUFFER iface, + LPUNKNOWN lpUnkServer) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + HRESULT r; + IUnknown *new = NULL; + + TRACE("(%p)->Connect(%p)\n",This,lpUnkServer); + + r = IUnknown_QueryInterface(lpUnkServer, STUB_HEADER(This).piid, (void**)&new); + new = InterlockedExchangePointer((void**)&This->pvServerObject, new); + if(new) + IUnknown_Release(new); + return r; +} + +void WINAPI CStdStubBuffer_Disconnect(LPRPCSTUBBUFFER iface) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + IUnknown *old; + TRACE("(%p)->Disconnect()\n",This); + + old = InterlockedExchangePointer((void**)&This->pvServerObject, NULL); + + if(old) + IUnknown_Release(old); +} + +HRESULT WINAPI CStdStubBuffer_Invoke(LPRPCSTUBBUFFER iface, + PRPCOLEMESSAGE pMsg, + LPRPCCHANNELBUFFER pChannel) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + DWORD dwPhase = STUB_UNMARSHAL; + HRESULT hr = S_OK; + + TRACE("(%p)->Invoke(%p,%p)\n",This,pMsg,pChannel); + + __TRY + { + if (STUB_HEADER(This).pDispatchTable) + STUB_HEADER(This).pDispatchTable[pMsg->iMethod](iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase); + else /* pure interpreted */ + NdrStubCall2(iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase); + } + __EXCEPT(stub_filter) + { + DWORD dwExceptionCode = GetExceptionCode(); + WARN("a stub call failed with exception 0x%08x (%d)\n", dwExceptionCode, dwExceptionCode); + if (FAILED(dwExceptionCode)) + hr = dwExceptionCode; + else + hr = HRESULT_FROM_WIN32(dwExceptionCode); + } + __ENDTRY + + return hr; +} + +LPRPCSTUBBUFFER WINAPI CStdStubBuffer_IsIIDSupported(LPRPCSTUBBUFFER iface, + REFIID riid) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + TRACE("(%p)->IsIIDSupported(%s)\n",This,debugstr_guid(riid)); + return IsEqualGUID(STUB_HEADER(This).piid, riid) ? iface : NULL; +} + +ULONG WINAPI CStdStubBuffer_CountRefs(LPRPCSTUBBUFFER iface) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + TRACE("(%p)->CountRefs()\n",This); + return This->RefCount; +} + +HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface(LPRPCSTUBBUFFER iface, + LPVOID *ppv) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + TRACE("(%p)->DebugServerQueryInterface(%p)\n",This,ppv); + return S_OK; +} + +void WINAPI CStdStubBuffer_DebugServerRelease(LPRPCSTUBBUFFER iface, + LPVOID pv) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + TRACE("(%p)->DebugServerRelease(%p)\n",This,pv); +} + +const IRpcStubBufferVtbl CStdStubBuffer_Vtbl = +{ + CStdStubBuffer_QueryInterface, + CStdStubBuffer_AddRef, + NULL, + CStdStubBuffer_Connect, + CStdStubBuffer_Disconnect, + CStdStubBuffer_Invoke, + CStdStubBuffer_IsIIDSupported, + CStdStubBuffer_CountRefs, + CStdStubBuffer_DebugServerQueryInterface, + CStdStubBuffer_DebugServerRelease +}; + +static HRESULT WINAPI CStdStubBuffer_Delegating_Connect(LPRPCSTUBBUFFER iface, + LPUNKNOWN lpUnkServer) +{ + cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); + HRESULT r; + TRACE("(%p)->Connect(%p)\n", This, lpUnkServer); + + r = CStdStubBuffer_Connect(iface, lpUnkServer); + if(SUCCEEDED(r)) + r = IRpcStubBuffer_Connect(This->base_stub, (IUnknown*)&This->base_obj); + + return r; +} + +static void WINAPI CStdStubBuffer_Delegating_Disconnect(LPRPCSTUBBUFFER iface) +{ + cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); + TRACE("(%p)->Disconnect()\n", This); + + IRpcStubBuffer_Disconnect(This->base_stub); + CStdStubBuffer_Disconnect(iface); +} + +static ULONG WINAPI CStdStubBuffer_Delegating_CountRefs(LPRPCSTUBBUFFER iface) +{ + cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); + ULONG ret; + TRACE("(%p)->CountRefs()\n", This); + + ret = CStdStubBuffer_CountRefs(iface); + ret += IRpcStubBuffer_CountRefs(This->base_stub); + + return ret; +} + +const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl = +{ + CStdStubBuffer_QueryInterface, + CStdStubBuffer_AddRef, + NULL, + CStdStubBuffer_Delegating_Connect, + CStdStubBuffer_Delegating_Disconnect, + CStdStubBuffer_Invoke, + CStdStubBuffer_IsIIDSupported, + CStdStubBuffer_Delegating_CountRefs, + CStdStubBuffer_DebugServerQueryInterface, + CStdStubBuffer_DebugServerRelease +}; + +const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + return STUB_HEADER(This).pServerInfo; +} + +/************************************************************************ + * NdrStubForwardingFunction [RPCRT4.@] + */ +void __RPC_STUB NdrStubForwardingFunction( IRpcStubBuffer *iface, IRpcChannelBuffer *pChannel, + PRPC_MESSAGE pMsg, DWORD *pdwStubPhase ) +{ + /* Note pMsg is passed intact since RPCOLEMESSAGE is basically a RPC_MESSAGE. */ + + cstdstubbuffer_delegating_t *This = impl_from_delegating(iface); + HRESULT r = IRpcStubBuffer_Invoke(This->base_stub, (RPCOLEMESSAGE*)pMsg, pChannel); + if(FAILED(r)) RpcRaiseException(r); + return; +} + +/*********************************************************************** + * NdrStubInitialize [RPCRT4.@] + */ +void WINAPI NdrStubInitialize(PRPC_MESSAGE pRpcMsg, + PMIDL_STUB_MESSAGE pStubMsg, + PMIDL_STUB_DESC pStubDescriptor, + LPRPCCHANNELBUFFER pRpcChannelBuffer) +{ + TRACE("(%p,%p,%p,%p)\n", pRpcMsg, pStubMsg, pStubDescriptor, pRpcChannelBuffer); + NdrServerInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor); + pStubMsg->pRpcChannelBuffer = pRpcChannelBuffer; +} + +/*********************************************************************** + * NdrStubGetBuffer [RPCRT4.@] + */ +void WINAPI NdrStubGetBuffer(LPRPCSTUBBUFFER iface, + LPRPCCHANNELBUFFER pRpcChannelBuffer, + PMIDL_STUB_MESSAGE pStubMsg) +{ + CStdStubBuffer *This = (CStdStubBuffer *)iface; + HRESULT hr; + + TRACE("(%p, %p, %p)\n", This, pRpcChannelBuffer, pStubMsg); + + pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength; + hr = IRpcChannelBuffer_GetBuffer(pRpcChannelBuffer, + (RPCOLEMESSAGE *)pStubMsg->RpcMsg, STUB_HEADER(This).piid); + if (FAILED(hr)) + { + RpcRaiseException(hr); + return; + } + + pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer; + pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength; + pStubMsg->Buffer = pStubMsg->BufferStart; +} diff --git a/reactos/dll/win32/rpcrt4_new/epm_towers.h b/reactos/dll/win32/rpcrt4_new/epm_towers.h index 7570cc2e846..d0661d484d4 100644 --- a/reactos/dll/win32/rpcrt4_new/epm_towers.h +++ b/reactos/dll/win32/rpcrt4_new/epm_towers.h @@ -1,88 +1,88 @@ -/* - * Endpoint Mapper Tower Definitions - * - * Copyright 2006 Robert Shearman (for CodeWeavers) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#define EPM_PROTOCOL_DNET_NSP 0x04 -#define EPM_PROTOCOL_OSI_TP4 0x05 -#define EPM_PROTOCOL_OSI_CLNS 0x06 -#define EPM_PROTOCOL_TCP 0x07 -#define EPM_PROTOCOL_UDP 0x08 -#define EPM_PROTOCOL_IP 0x09 -#define EPM_PROTOCOL_NCADG 0x0a /* Connectionless RPC */ -#define EPM_PROTOCOL_NCACN 0x0b -#define EPM_PROTOCOL_NCALRPC 0x0c /* Local RPC */ -#define EPM_PROTOCOL_UUID 0x0d -#define EPM_PROTOCOL_IPX 0x0e -#define EPM_PROTOCOL_SMB 0x0f -#define EPM_PROTOCOL_PIPE 0x10 -#define EPM_PROTOCOL_NETBIOS 0x11 -#define EPM_PROTOCOL_NETBEUI 0x12 -#define EPM_PROTOCOL_SPX 0x13 -#define EPM_PROTOCOL_NB_IPX 0x14 /* NetBIOS over IPX */ -#define EPM_PROTOCOL_DSP 0x16 /* AppleTalk Data Stream Protocol */ -#define EPM_PROTOCOL_DDP 0x17 /* AppleTalk Data Datagram Protocol */ -#define EPM_PROTOCOL_APPLETALK 0x18 /* AppleTalk */ -#define EPM_PROTOCOL_VINES_SPP 0x1a -#define EPM_PROTOCOL_VINES_IPC 0x1b /* Inter Process Communication */ -#define EPM_PROTOCOL_STREETTALK 0x1c /* Vines Streettalk */ -#define EPM_PROTOCOL_HTTP 0x1f -#define EPM_PROTOCOL_UNIX_DS 0x20 /* Unix domain socket */ -#define EPM_PROTOCOL_NULL 0x21 - -#include - -typedef unsigned char u_int8; -typedef unsigned short u_int16; -typedef unsigned int u_int32; - -typedef struct -{ - u_int16 count_lhs; - u_int8 protid; - GUID uuid; - u_int16 major_version; - u_int16 count_rhs; - u_int16 minor_version; -} twr_uuid_floor_t; - -typedef struct -{ - u_int16 count_lhs; - u_int8 protid; - u_int16 count_rhs; - u_int16 port; -} twr_tcp_floor_t; - -typedef struct -{ - u_int16 count_lhs; - u_int8 protid; - u_int16 count_rhs; - u_int32 ipv4addr; -} twr_ipv4_floor_t; - -typedef struct -{ - u_int16 count_lhs; - u_int8 protid; - u_int16 count_rhs; -} twr_empty_floor_t; - -#include +/* + * Endpoint Mapper Tower Definitions + * + * Copyright 2006 Robert Shearman (for CodeWeavers) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#define EPM_PROTOCOL_DNET_NSP 0x04 +#define EPM_PROTOCOL_OSI_TP4 0x05 +#define EPM_PROTOCOL_OSI_CLNS 0x06 +#define EPM_PROTOCOL_TCP 0x07 +#define EPM_PROTOCOL_UDP 0x08 +#define EPM_PROTOCOL_IP 0x09 +#define EPM_PROTOCOL_NCADG 0x0a /* Connectionless RPC */ +#define EPM_PROTOCOL_NCACN 0x0b +#define EPM_PROTOCOL_NCALRPC 0x0c /* Local RPC */ +#define EPM_PROTOCOL_UUID 0x0d +#define EPM_PROTOCOL_IPX 0x0e +#define EPM_PROTOCOL_SMB 0x0f +#define EPM_PROTOCOL_PIPE 0x10 +#define EPM_PROTOCOL_NETBIOS 0x11 +#define EPM_PROTOCOL_NETBEUI 0x12 +#define EPM_PROTOCOL_SPX 0x13 +#define EPM_PROTOCOL_NB_IPX 0x14 /* NetBIOS over IPX */ +#define EPM_PROTOCOL_DSP 0x16 /* AppleTalk Data Stream Protocol */ +#define EPM_PROTOCOL_DDP 0x17 /* AppleTalk Data Datagram Protocol */ +#define EPM_PROTOCOL_APPLETALK 0x18 /* AppleTalk */ +#define EPM_PROTOCOL_VINES_SPP 0x1a +#define EPM_PROTOCOL_VINES_IPC 0x1b /* Inter Process Communication */ +#define EPM_PROTOCOL_STREETTALK 0x1c /* Vines Streettalk */ +#define EPM_PROTOCOL_HTTP 0x1f +#define EPM_PROTOCOL_UNIX_DS 0x20 /* Unix domain socket */ +#define EPM_PROTOCOL_NULL 0x21 + +#include + +typedef unsigned char u_int8; +typedef unsigned short u_int16; +typedef unsigned int u_int32; + +typedef struct +{ + u_int16 count_lhs; + u_int8 protid; + GUID uuid; + u_int16 major_version; + u_int16 count_rhs; + u_int16 minor_version; +} twr_uuid_floor_t; + +typedef struct +{ + u_int16 count_lhs; + u_int8 protid; + u_int16 count_rhs; + u_int16 port; +} twr_tcp_floor_t; + +typedef struct +{ + u_int16 count_lhs; + u_int8 protid; + u_int16 count_rhs; + u_int32 ipv4addr; +} twr_ipv4_floor_t; + +typedef struct +{ + u_int16 count_lhs; + u_int8 protid; + u_int16 count_rhs; +} twr_empty_floor_t; + +#include diff --git a/reactos/dll/win32/rpcrt4_new/rpc_binding.c b/reactos/dll/win32/rpcrt4_new/rpc_binding.c index f69d2909c4c..063be45b252 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_binding.c +++ b/reactos/dll/win32/rpcrt4_new/rpc_binding.c @@ -1,1586 +1,1586 @@ -/* - * RPC binding API - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * Copyright 2003 Mike Hearn - * Copyright 2004 Filip Navara - * Copyright 2006 CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winnls.h" -#include "winerror.h" -#include "winternl.h" -#include "wine/unicode.h" - -#include "rpc.h" -#include "rpcndr.h" - -#include "wine/debug.h" - -#include "rpc_binding.h" -#include "rpc_message.h" - -WINE_DEFAULT_DEBUG_CHANNEL(rpc); - -LPSTR RPCRT4_strndupA(LPCSTR src, INT slen) -{ - DWORD len; - LPSTR s; - if (!src) return NULL; - if (slen == -1) slen = strlen(src); - len = slen; - s = HeapAlloc(GetProcessHeap(), 0, len+1); - memcpy(s, src, len); - s[len] = 0; - return s; -} - -LPSTR RPCRT4_strdupWtoA(LPCWSTR src) -{ - DWORD len; - LPSTR s; - if (!src) return NULL; - len = WideCharToMultiByte(CP_ACP, 0, src, -1, NULL, 0, NULL, NULL); - s = HeapAlloc(GetProcessHeap(), 0, len); - WideCharToMultiByte(CP_ACP, 0, src, -1, s, len, NULL, NULL); - return s; -} - -LPWSTR RPCRT4_strdupAtoW(LPCSTR src) -{ - DWORD len; - LPWSTR s; - if (!src) return NULL; - len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0); - s = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, src, -1, s, len); - return s; -} - -static LPWSTR RPCRT4_strndupAtoW(LPCSTR src, INT slen) -{ - DWORD len; - LPWSTR s; - if (!src) return NULL; - len = MultiByteToWideChar(CP_ACP, 0, src, slen, NULL, 0); - s = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, src, slen, s, len); - return s; -} - -LPWSTR RPCRT4_strndupW(LPCWSTR src, INT slen) -{ - DWORD len; - LPWSTR s; - if (!src) return NULL; - if (slen == -1) slen = strlenW(src); - len = slen; - s = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR)); - memcpy(s, src, len*sizeof(WCHAR)); - s[len] = 0; - return s; -} - -void RPCRT4_strfree(LPSTR src) -{ - HeapFree(GetProcessHeap(), 0, src); -} - -static RPC_STATUS RPCRT4_AllocBinding(RpcBinding** Binding, BOOL server) -{ - RpcBinding* NewBinding; - - NewBinding = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcBinding)); - NewBinding->refs = 1; - NewBinding->server = server; - - *Binding = NewBinding; - - return RPC_S_OK; -} - -static RPC_STATUS RPCRT4_CreateBindingA(RpcBinding** Binding, BOOL server, LPCSTR Protseq) -{ - RpcBinding* NewBinding; - - RPCRT4_AllocBinding(&NewBinding, server); - NewBinding->Protseq = RPCRT4_strdupA(Protseq); - - TRACE("binding: %p\n", NewBinding); - *Binding = NewBinding; - - return RPC_S_OK; -} - -static RPC_STATUS RPCRT4_CreateBindingW(RpcBinding** Binding, BOOL server, LPCWSTR Protseq) -{ - RpcBinding* NewBinding; - - RPCRT4_AllocBinding(&NewBinding, server); - NewBinding->Protseq = RPCRT4_strdupWtoA(Protseq); - - TRACE("binding: %p\n", NewBinding); - *Binding = NewBinding; - - return RPC_S_OK; -} - -static RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding* Binding, LPCSTR NetworkAddr, - LPCSTR Endpoint, LPCSTR NetworkOptions) -{ - RPC_STATUS status; - - TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding, - debugstr_a(NetworkAddr), debugstr_a(Endpoint), debugstr_a(NetworkOptions)); - - RPCRT4_strfree(Binding->NetworkAddr); - Binding->NetworkAddr = RPCRT4_strdupA(NetworkAddr); - RPCRT4_strfree(Binding->Endpoint); - if (Endpoint) { - Binding->Endpoint = RPCRT4_strdupA(Endpoint); - } else { - Binding->Endpoint = RPCRT4_strdupA(""); - } - HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions); - Binding->NetworkOptions = RPCRT4_strdupAtoW(NetworkOptions); - if (!Binding->Endpoint) ERR("out of memory?\n"); - - status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr, - Binding->Endpoint, Binding->NetworkOptions, - &Binding->Assoc); - if (status != RPC_S_OK) - return status; - - return RPC_S_OK; -} - -static RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding* Binding, LPCWSTR NetworkAddr, - LPCWSTR Endpoint, LPCWSTR NetworkOptions) -{ - RPC_STATUS status; - - TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding, - debugstr_w(NetworkAddr), debugstr_w(Endpoint), debugstr_w(NetworkOptions)); - - RPCRT4_strfree(Binding->NetworkAddr); - Binding->NetworkAddr = RPCRT4_strdupWtoA(NetworkAddr); - RPCRT4_strfree(Binding->Endpoint); - if (Endpoint) { - Binding->Endpoint = RPCRT4_strdupWtoA(Endpoint); - } else { - Binding->Endpoint = RPCRT4_strdupA(""); - } - if (!Binding->Endpoint) ERR("out of memory?\n"); - HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions); - Binding->NetworkOptions = RPCRT4_strdupW(NetworkOptions); - - status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr, - Binding->Endpoint, Binding->NetworkOptions, - &Binding->Assoc); - if (status != RPC_S_OK) - return status; - - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint) -{ - RPC_STATUS status; - - TRACE("(RpcBinding == ^%p, EndPoint == \"%s\"\n", Binding, Endpoint); - - RPCRT4_strfree(Binding->Endpoint); - Binding->Endpoint = RPCRT4_strdupA(Endpoint); - - RpcAssoc_Release(Binding->Assoc); - Binding->Assoc = NULL; - status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr, - Binding->Endpoint, Binding->NetworkOptions, - &Binding->Assoc); - if (status != RPC_S_OK) - return status; - - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid) -{ - TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid)); - if (ObjectUuid) memcpy(&Binding->ObjectUuid, ObjectUuid, sizeof(UUID)); - else UuidCreateNil(&Binding->ObjectUuid); - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection) -{ - RpcBinding* NewBinding; - TRACE("(RpcBinding == ^%p, Connection == ^%p)\n", Binding, Connection); - - RPCRT4_AllocBinding(&NewBinding, Connection->server); - NewBinding->Protseq = RPCRT4_strdupA(rpcrt4_conn_get_name(Connection)); - NewBinding->NetworkAddr = RPCRT4_strdupA(Connection->NetworkAddr); - NewBinding->Endpoint = RPCRT4_strdupA(Connection->Endpoint); - NewBinding->FromConn = Connection; - - TRACE("binding: %p\n", NewBinding); - *Binding = NewBinding; - - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_ExportBinding(RpcBinding** Binding, RpcBinding* OldBinding) -{ - InterlockedIncrement(&OldBinding->refs); - *Binding = OldBinding; - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_DestroyBinding(RpcBinding* Binding) -{ - if (InterlockedDecrement(&Binding->refs)) - return RPC_S_OK; - - TRACE("binding: %p\n", Binding); - if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc); - RPCRT4_strfree(Binding->Endpoint); - RPCRT4_strfree(Binding->NetworkAddr); - RPCRT4_strfree(Binding->Protseq); - HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions); - if (Binding->AuthInfo) RpcAuthInfo_Release(Binding->AuthInfo); - if (Binding->QOS) RpcQualityOfService_Release(Binding->QOS); - HeapFree(GetProcessHeap(), 0, Binding); - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, - const RPC_SYNTAX_IDENTIFIER *TransferSyntax, - const RPC_SYNTAX_IDENTIFIER *InterfaceId) -{ - TRACE("(Binding == ^%p)\n", Binding); - - if (!Binding->server) { - return RpcAssoc_GetClientConnection(Binding->Assoc, InterfaceId, - TransferSyntax, Binding->AuthInfo, Binding->QOS, Connection); - } else { - /* we already have a connection with acceptable binding, so use it */ - if (Binding->FromConn) { - *Connection = Binding->FromConn; - return RPC_S_OK; - } else { - ERR("no connection in binding\n"); - return RPC_S_INTERNAL_ERROR; - } - } -} - -RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection) -{ - TRACE("(Binding == ^%p)\n", Binding); - if (!Connection) return RPC_S_OK; - if (Binding->server) { - /* don't destroy a connection that is cached in the binding */ - if (Binding->FromConn == Connection) - return RPC_S_OK; - return RPCRT4_DestroyConnection(Connection); - } - else { - RpcAssoc_ReleaseIdleConnection(Binding->Assoc, Connection); - return RPC_S_OK; - } -} - -/* utility functions for string composing and parsing */ -static unsigned RPCRT4_strcopyA(LPSTR data, LPCSTR src) -{ - unsigned len = strlen(src); - memcpy(data, src, len*sizeof(CHAR)); - return len; -} - -static unsigned RPCRT4_strcopyW(LPWSTR data, LPCWSTR src) -{ - unsigned len = strlenW(src); - memcpy(data, src, len*sizeof(WCHAR)); - return len; -} - -static LPSTR RPCRT4_strconcatA(LPSTR dst, LPCSTR src) -{ - DWORD len = strlen(dst), slen = strlen(src); - LPSTR ndst = HeapReAlloc(GetProcessHeap(), 0, dst, (len+slen+2)*sizeof(CHAR)); - if (!ndst) - { - HeapFree(GetProcessHeap(), 0, dst); - return NULL; - } - ndst[len] = ','; - memcpy(ndst+len+1, src, slen+1); - return ndst; -} - -static LPWSTR RPCRT4_strconcatW(LPWSTR dst, LPCWSTR src) -{ - DWORD len = strlenW(dst), slen = strlenW(src); - LPWSTR ndst = HeapReAlloc(GetProcessHeap(), 0, dst, (len+slen+2)*sizeof(WCHAR)); - if (!ndst) - { - HeapFree(GetProcessHeap(), 0, dst); - return NULL; - } - ndst[len] = ','; - memcpy(ndst+len+1, src, (slen+1)*sizeof(WCHAR)); - return ndst; -} - - -/*********************************************************************** - * RpcStringBindingComposeA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, - RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, - RPC_CSTR Options, RPC_CSTR *StringBinding ) -{ - DWORD len = 1; - LPSTR data; - - TRACE( "(%s,%s,%s,%s,%s,%p)\n", - debugstr_a( (char*)ObjUuid ), debugstr_a( (char*)Protseq ), - debugstr_a( (char*)NetworkAddr ), debugstr_a( (char*)Endpoint ), - debugstr_a( (char*)Options ), StringBinding ); - - if (ObjUuid && *ObjUuid) len += strlen((char*)ObjUuid) + 1; - if (Protseq && *Protseq) len += strlen((char*)Protseq) + 1; - if (NetworkAddr && *NetworkAddr) len += strlen((char*)NetworkAddr); - if (Endpoint && *Endpoint) len += strlen((char*)Endpoint) + 2; - if (Options && *Options) len += strlen((char*)Options) + 2; - - data = HeapAlloc(GetProcessHeap(), 0, len); - *StringBinding = (unsigned char*)data; - - if (ObjUuid && *ObjUuid) { - data += RPCRT4_strcopyA(data, (char*)ObjUuid); - *data++ = '@'; - } - if (Protseq && *Protseq) { - data += RPCRT4_strcopyA(data, (char*)Protseq); - *data++ = ':'; - } - if (NetworkAddr && *NetworkAddr) - data += RPCRT4_strcopyA(data, (char*)NetworkAddr); - - if ((Endpoint && *Endpoint) || - (Options && *Options)) { - *data++ = '['; - if (Endpoint && *Endpoint) { - data += RPCRT4_strcopyA(data, (char*)Endpoint); - if (Options && *Options) *data++ = ','; - } - if (Options && *Options) { - data += RPCRT4_strcopyA(data, (char*)Options); - } - *data++ = ']'; - } - *data = 0; - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcStringBindingComposeW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcStringBindingComposeW( RPC_WSTR ObjUuid, RPC_WSTR Protseq, - RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, - RPC_WSTR Options, RPC_WSTR* StringBinding ) -{ - DWORD len = 1; - RPC_WSTR data; - - TRACE("(%s,%s,%s,%s,%s,%p)\n", - debugstr_w( ObjUuid ), debugstr_w( Protseq ), - debugstr_w( NetworkAddr ), debugstr_w( Endpoint ), - debugstr_w( Options ), StringBinding); - - if (ObjUuid && *ObjUuid) len += strlenW(ObjUuid) + 1; - if (Protseq && *Protseq) len += strlenW(Protseq) + 1; - if (NetworkAddr && *NetworkAddr) len += strlenW(NetworkAddr); - if (Endpoint && *Endpoint) len += strlenW(Endpoint) + 2; - if (Options && *Options) len += strlenW(Options) + 2; - - data = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - *StringBinding = data; - - if (ObjUuid && *ObjUuid) { - data += RPCRT4_strcopyW(data, ObjUuid); - *data++ = '@'; - } - if (Protseq && *Protseq) { - data += RPCRT4_strcopyW(data, Protseq); - *data++ = ':'; - } - if (NetworkAddr && *NetworkAddr) { - data += RPCRT4_strcopyW(data, NetworkAddr); - } - if ((Endpoint && *Endpoint) || - (Options && *Options)) { - *data++ = '['; - if (Endpoint && *Endpoint) { - data += RPCRT4_strcopyW(data, Endpoint); - if (Options && *Options) *data++ = ','; - } - if (Options && *Options) { - data += RPCRT4_strcopyW(data, Options); - } - *data++ = ']'; - } - *data = 0; - - return RPC_S_OK; -} - - -/*********************************************************************** - * RpcStringBindingParseA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcStringBindingParseA( RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, - RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr, - RPC_CSTR *Endpoint, RPC_CSTR *Options) -{ - CHAR *data, *next; - static const char ep_opt[] = "endpoint="; - - TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_a((char*)StringBinding), - ObjUuid, Protseq, NetworkAddr, Endpoint, Options); - - if (ObjUuid) *ObjUuid = NULL; - if (Protseq) *Protseq = NULL; - if (NetworkAddr) *NetworkAddr = NULL; - if (Endpoint) *Endpoint = NULL; - if (Options) *Options = NULL; - - data = (char*) StringBinding; - - next = strchr(data, '@'); - if (next) { - if (ObjUuid) *ObjUuid = (unsigned char*)RPCRT4_strndupA(data, next - data); - data = next+1; - } - - next = strchr(data, ':'); - if (next) { - if (Protseq) *Protseq = (unsigned char*)RPCRT4_strndupA(data, next - data); - data = next+1; - } - - next = strchr(data, '['); - if (next) { - CHAR *close, *opt; - - if (NetworkAddr) *NetworkAddr = (unsigned char*)RPCRT4_strndupA(data, next - data); - data = next+1; - close = strchr(data, ']'); - if (!close) goto fail; - - /* tokenize options */ - while (data < close) { - next = strchr(data, ','); - if (!next || next > close) next = close; - /* FIXME: this is kind of inefficient */ - opt = RPCRT4_strndupA(data, next - data); - data = next+1; - - /* parse option */ - next = strchr(opt, '='); - if (!next) { - /* not an option, must be an endpoint */ - if (*Endpoint) goto fail; - *Endpoint = (unsigned char*) opt; - } else { - if (strncmp(opt, ep_opt, strlen(ep_opt)) == 0) { - /* endpoint option */ - if (*Endpoint) goto fail; - *Endpoint = (unsigned char*) RPCRT4_strdupA(next+1); - HeapFree(GetProcessHeap(), 0, opt); - } else { - /* network option */ - if (*Options) { - /* FIXME: this is kind of inefficient */ - *Options = (unsigned char*) RPCRT4_strconcatA( (char*)*Options, opt); - HeapFree(GetProcessHeap(), 0, opt); - } else - *Options = (unsigned char*) opt; - } - } - } - - data = close+1; - if (*data) goto fail; - } - else if (NetworkAddr) - *NetworkAddr = (unsigned char*)RPCRT4_strdupA(data); - - return RPC_S_OK; - -fail: - if (ObjUuid) RpcStringFreeA((unsigned char**)ObjUuid); - if (Protseq) RpcStringFreeA((unsigned char**)Protseq); - if (NetworkAddr) RpcStringFreeA((unsigned char**)NetworkAddr); - if (Endpoint) RpcStringFreeA((unsigned char**)Endpoint); - if (Options) RpcStringFreeA((unsigned char**)Options); - return RPC_S_INVALID_STRING_BINDING; -} - -/*********************************************************************** - * RpcStringBindingParseW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcStringBindingParseW( RPC_WSTR StringBinding, RPC_WSTR *ObjUuid, - RPC_WSTR *Protseq, RPC_WSTR *NetworkAddr, - RPC_WSTR *Endpoint, RPC_WSTR *Options) -{ - WCHAR *data, *next; - static const WCHAR ep_opt[] = {'e','n','d','p','o','i','n','t','=',0}; - - TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_w(StringBinding), - ObjUuid, Protseq, NetworkAddr, Endpoint, Options); - - if (ObjUuid) *ObjUuid = NULL; - if (Protseq) *Protseq = NULL; - if (NetworkAddr) *NetworkAddr = NULL; - if (Endpoint) *Endpoint = NULL; - if (Options) *Options = NULL; - - data = StringBinding; - - next = strchrW(data, '@'); - if (next) { - if (ObjUuid) *ObjUuid = RPCRT4_strndupW(data, next - data); - data = next+1; - } - - next = strchrW(data, ':'); - if (next) { - if (Protseq) *Protseq = RPCRT4_strndupW(data, next - data); - data = next+1; - } - - next = strchrW(data, '['); - if (next) { - WCHAR *close, *opt; - - if (NetworkAddr) *NetworkAddr = RPCRT4_strndupW(data, next - data); - data = next+1; - close = strchrW(data, ']'); - if (!close) goto fail; - - /* tokenize options */ - while (data < close) { - next = strchrW(data, ','); - if (!next || next > close) next = close; - /* FIXME: this is kind of inefficient */ - opt = RPCRT4_strndupW(data, next - data); - data = next+1; - - /* parse option */ - next = strchrW(opt, '='); - if (!next) { - /* not an option, must be an endpoint */ - if (*Endpoint) goto fail; - *Endpoint = opt; - } else { - if (strncmpW(opt, ep_opt, strlenW(ep_opt)) == 0) { - /* endpoint option */ - if (*Endpoint) goto fail; - *Endpoint = RPCRT4_strdupW(next+1); - HeapFree(GetProcessHeap(), 0, opt); - } else { - /* network option */ - if (*Options) { - /* FIXME: this is kind of inefficient */ - *Options = RPCRT4_strconcatW(*Options, opt); - HeapFree(GetProcessHeap(), 0, opt); - } else - *Options = opt; - } - } - } - - data = close+1; - if (*data) goto fail; - } else if (NetworkAddr) - *NetworkAddr = RPCRT4_strdupW(data); - - return RPC_S_OK; - -fail: - if (ObjUuid) RpcStringFreeW(ObjUuid); - if (Protseq) RpcStringFreeW(Protseq); - if (NetworkAddr) RpcStringFreeW(NetworkAddr); - if (Endpoint) RpcStringFreeW(Endpoint); - if (Options) RpcStringFreeW(Options); - return RPC_S_INVALID_STRING_BINDING; -} - -/*********************************************************************** - * RpcBindingFree (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingFree( RPC_BINDING_HANDLE* Binding ) -{ - RPC_STATUS status; - TRACE("(%p) = %p\n", Binding, *Binding); - status = RPCRT4_DestroyBinding(*Binding); - if (status == RPC_S_OK) *Binding = 0; - return status; -} - -/*********************************************************************** - * RpcBindingVectorFree (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingVectorFree( RPC_BINDING_VECTOR** BindingVector ) -{ - RPC_STATUS status; - unsigned long c; - - TRACE("(%p)\n", BindingVector); - for (c=0; c<(*BindingVector)->Count; c++) { - status = RpcBindingFree(&(*BindingVector)->BindingH[c]); - } - HeapFree(GetProcessHeap(), 0, *BindingVector); - *BindingVector = NULL; - return RPC_S_OK; -} - -/*********************************************************************** - * RpcBindingInqObject (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingInqObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid ) -{ - RpcBinding* bind = (RpcBinding*)Binding; - - TRACE("(%p,%p) = %s\n", Binding, ObjectUuid, debugstr_guid(&bind->ObjectUuid)); - memcpy(ObjectUuid, &bind->ObjectUuid, sizeof(UUID)); - return RPC_S_OK; -} - -/*********************************************************************** - * RpcBindingSetObject (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingSetObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid ) -{ - RpcBinding* bind = (RpcBinding*)Binding; - - TRACE("(%p,%s)\n", Binding, debugstr_guid(ObjectUuid)); - if (bind->server) return RPC_S_WRONG_KIND_OF_BINDING; - return RPCRT4_SetBindingObject(Binding, ObjectUuid); -} - -/*********************************************************************** - * RpcBindingFromStringBindingA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingFromStringBindingA( RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding ) -{ - RPC_STATUS ret; - RpcBinding* bind = NULL; - RPC_CSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options; - UUID Uuid; - - TRACE("(%s,%p)\n", debugstr_a((char*)StringBinding), Binding); - - ret = RpcStringBindingParseA(StringBinding, &ObjectUuid, &Protseq, - &NetworkAddr, &Endpoint, &Options); - if (ret != RPC_S_OK) return ret; - - ret = UuidFromStringA(ObjectUuid, &Uuid); - - if (ret == RPC_S_OK) - ret = RPCRT4_CreateBindingA(&bind, FALSE, (char*)Protseq); - if (ret == RPC_S_OK) - ret = RPCRT4_SetBindingObject(bind, &Uuid); - if (ret == RPC_S_OK) - ret = RPCRT4_CompleteBindingA(bind, (char*)NetworkAddr, (char*)Endpoint, (char*)Options); - - RpcStringFreeA((unsigned char**)&Options); - RpcStringFreeA((unsigned char**)&Endpoint); - RpcStringFreeA((unsigned char**)&NetworkAddr); - RpcStringFreeA((unsigned char**)&Protseq); - RpcStringFreeA((unsigned char**)&ObjectUuid); - - if (ret == RPC_S_OK) - *Binding = (RPC_BINDING_HANDLE)bind; - else - RPCRT4_DestroyBinding(bind); - - return ret; -} - -/*********************************************************************** - * RpcBindingFromStringBindingW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingFromStringBindingW( RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding ) -{ - RPC_STATUS ret; - RpcBinding* bind = NULL; - RPC_WSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options; - UUID Uuid; - - TRACE("(%s,%p)\n", debugstr_w(StringBinding), Binding); - - ret = RpcStringBindingParseW(StringBinding, &ObjectUuid, &Protseq, - &NetworkAddr, &Endpoint, &Options); - if (ret != RPC_S_OK) return ret; - - ret = UuidFromStringW(ObjectUuid, &Uuid); - - if (ret == RPC_S_OK) - ret = RPCRT4_CreateBindingW(&bind, FALSE, Protseq); - if (ret == RPC_S_OK) - ret = RPCRT4_SetBindingObject(bind, &Uuid); - if (ret == RPC_S_OK) - ret = RPCRT4_CompleteBindingW(bind, NetworkAddr, Endpoint, Options); - - RpcStringFreeW(&Options); - RpcStringFreeW(&Endpoint); - RpcStringFreeW(&NetworkAddr); - RpcStringFreeW(&Protseq); - RpcStringFreeW(&ObjectUuid); - - if (ret == RPC_S_OK) - *Binding = (RPC_BINDING_HANDLE)bind; - else - RPCRT4_DestroyBinding(bind); - - return ret; -} - -/*********************************************************************** - * RpcBindingToStringBindingA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding ) -{ - RPC_STATUS ret; - RpcBinding* bind = (RpcBinding*)Binding; - RPC_CSTR ObjectUuid; - - TRACE("(%p,%p)\n", Binding, StringBinding); - - ret = UuidToStringA(&bind->ObjectUuid, &ObjectUuid); - if (ret != RPC_S_OK) return ret; - - ret = RpcStringBindingComposeA(ObjectUuid, (unsigned char*)bind->Protseq, (unsigned char*) bind->NetworkAddr, - (unsigned char*) bind->Endpoint, NULL, StringBinding); - - RpcStringFreeA(&ObjectUuid); - - return ret; -} - -/*********************************************************************** - * RpcBindingToStringBindingW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding, RPC_WSTR *StringBinding ) -{ - RPC_STATUS ret; - unsigned char *str = NULL; - TRACE("(%p,%p)\n", Binding, StringBinding); - ret = RpcBindingToStringBindingA(Binding, &str); - *StringBinding = RPCRT4_strdupAtoW((char*)str); - RpcStringFreeA((unsigned char**)&str); - return ret; -} - -/*********************************************************************** - * I_RpcBindingSetAsync (RPCRT4.@) - * NOTES - * Exists in win9x and winNT, but with different number of arguments - * (9x version has 3 arguments, NT has 2). - */ -RPC_STATUS WINAPI I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn) -{ - RpcBinding* bind = (RpcBinding*)Binding; - - TRACE( "(%p,%p): stub\n", Binding, BlockingFn ); - - bind->BlockingFn = BlockingFn; - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcBindingCopy (RPCRT4.@) - */ -RPC_STATUS RPC_ENTRY RpcBindingCopy( - RPC_BINDING_HANDLE SourceBinding, - RPC_BINDING_HANDLE* DestinationBinding) -{ - RpcBinding *DestBinding; - RpcBinding *SrcBinding = (RpcBinding*)SourceBinding; - RPC_STATUS status; - - TRACE("(%p, %p)\n", SourceBinding, DestinationBinding); - - status = RPCRT4_AllocBinding(&DestBinding, SrcBinding->server); - if (status != RPC_S_OK) return status; - - DestBinding->ObjectUuid = SrcBinding->ObjectUuid; - DestBinding->BlockingFn = SrcBinding->BlockingFn; - DestBinding->Protseq = RPCRT4_strndupA(SrcBinding->Protseq, -1); - DestBinding->NetworkAddr = RPCRT4_strndupA(SrcBinding->NetworkAddr, -1); - DestBinding->Endpoint = RPCRT4_strndupA(SrcBinding->Endpoint, -1); - DestBinding->NetworkOptions = RPCRT4_strdupW(SrcBinding->NetworkOptions); - if (SrcBinding->Assoc) SrcBinding->Assoc->refs++; - DestBinding->Assoc = SrcBinding->Assoc; - - if (SrcBinding->AuthInfo) RpcAuthInfo_AddRef(SrcBinding->AuthInfo); - DestBinding->AuthInfo = SrcBinding->AuthInfo; - if (SrcBinding->QOS) RpcQualityOfService_AddRef(SrcBinding->QOS); - DestBinding->QOS = SrcBinding->QOS; - - *DestinationBinding = DestBinding; - return RPC_S_OK; -} - -/*********************************************************************** - * RpcImpersonateClient (RPCRT4.@) - * - * Impersonates the client connected via a binding handle so that security - * checks are done in the context of the client. - * - * PARAMS - * BindingHandle [I] Handle to the binding to the client. - * - * RETURNS - * Success: RPS_S_OK. - * Failure: RPC_STATUS value. - * - * NOTES - * - * If BindingHandle is NULL then the function impersonates the client - * connected to the binding handle of the current thread. - */ -RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle) -{ - FIXME("(%p): stub\n", BindingHandle); - ImpersonateSelf(SecurityImpersonation); - return RPC_S_OK; -} - -/*********************************************************************** - * RpcRevertToSelfEx (RPCRT4.@) - * - * Stops impersonating the client connected to the binding handle so that security - * checks are no longer done in the context of the client. - * - * PARAMS - * BindingHandle [I] Handle to the binding to the client. - * - * RETURNS - * Success: RPS_S_OK. - * Failure: RPC_STATUS value. - * - * NOTES - * - * If BindingHandle is NULL then the function stops impersonating the client - * connected to the binding handle of the current thread. - */ -RPC_STATUS WINAPI RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle) -{ - FIXME("(%p): stub\n", BindingHandle); - return RPC_S_OK; -} - -static inline BOOL has_nt_auth_identity(ULONG AuthnLevel) -{ - switch (AuthnLevel) - { - case RPC_C_AUTHN_GSS_NEGOTIATE: - case RPC_C_AUTHN_WINNT: - case RPC_C_AUTHN_GSS_KERBEROS: - return TRUE; - default: - return FALSE; - } -} - -static RPC_STATUS RpcAuthInfo_Create(ULONG AuthnLevel, ULONG AuthnSvc, - CredHandle cred, TimeStamp exp, - ULONG cbMaxToken, - RPC_AUTH_IDENTITY_HANDLE identity, - RpcAuthInfo **ret) -{ - RpcAuthInfo *AuthInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*AuthInfo)); - if (!AuthInfo) - return ERROR_OUTOFMEMORY; - - AuthInfo->refs = 1; - AuthInfo->AuthnLevel = AuthnLevel; - AuthInfo->AuthnSvc = AuthnSvc; - AuthInfo->cred = cred; - AuthInfo->exp = exp; - AuthInfo->cbMaxToken = cbMaxToken; - AuthInfo->identity = identity; - - /* duplicate the SEC_WINNT_AUTH_IDENTITY structure, if applicable, to - * enable better matching in RpcAuthInfo_IsEqual */ - if (identity && has_nt_auth_identity(AuthnSvc)) - { - const SEC_WINNT_AUTH_IDENTITY_W *nt_identity = identity; - AuthInfo->nt_identity = HeapAlloc(GetProcessHeap(), 0, sizeof(*AuthInfo->nt_identity)); - if (!AuthInfo->nt_identity) - { - HeapFree(GetProcessHeap(), 0, AuthInfo); - return ERROR_OUTOFMEMORY; - } - - AuthInfo->nt_identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; - if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE) - AuthInfo->nt_identity->User = RPCRT4_strndupW(nt_identity->User, nt_identity->UserLength); - else - AuthInfo->nt_identity->User = RPCRT4_strndupAtoW((const char *)nt_identity->User, nt_identity->UserLength); - AuthInfo->nt_identity->UserLength = nt_identity->UserLength; - if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE) - AuthInfo->nt_identity->Domain = RPCRT4_strndupW(nt_identity->Domain, nt_identity->DomainLength); - else - AuthInfo->nt_identity->Domain = RPCRT4_strndupAtoW((const char *)nt_identity->Domain, nt_identity->DomainLength); - AuthInfo->nt_identity->DomainLength = nt_identity->DomainLength; - if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE) - AuthInfo->nt_identity->Password = RPCRT4_strndupW(nt_identity->Password, nt_identity->PasswordLength); - else - AuthInfo->nt_identity->Password = RPCRT4_strndupAtoW((const char *)nt_identity->Password, nt_identity->PasswordLength); - AuthInfo->nt_identity->PasswordLength = nt_identity->PasswordLength; - - if (!AuthInfo->nt_identity->User || - !AuthInfo->nt_identity->Domain || - !AuthInfo->nt_identity->Password) - { - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User); - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Domain); - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Password); - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity); - HeapFree(GetProcessHeap(), 0, AuthInfo); - return ERROR_OUTOFMEMORY; - } - } - else - AuthInfo->nt_identity = NULL; - *ret = AuthInfo; - return RPC_S_OK; -} - -ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo) -{ - return InterlockedIncrement(&AuthInfo->refs); -} - -ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo) -{ - ULONG refs = InterlockedDecrement(&AuthInfo->refs); - - if (!refs) - { - FreeCredentialsHandle(&AuthInfo->cred); - if (AuthInfo->nt_identity) - { - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User); - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Domain); - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User); - HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity); - } - HeapFree(GetProcessHeap(), 0, AuthInfo); - } - - return refs; -} - -BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2) -{ - if (AuthInfo1 == AuthInfo2) - return TRUE; - - if (!AuthInfo1 || !AuthInfo2) - return FALSE; - - if ((AuthInfo1->AuthnLevel != AuthInfo2->AuthnLevel) || - (AuthInfo1->AuthnSvc != AuthInfo2->AuthnSvc)) - return FALSE; - - if (AuthInfo1->identity == AuthInfo2->identity) - return TRUE; - - if (!AuthInfo1->identity || !AuthInfo2->identity) - return FALSE; - - if (has_nt_auth_identity(AuthInfo1->AuthnSvc)) - { - const SEC_WINNT_AUTH_IDENTITY_W *identity1 = AuthInfo1->nt_identity; - const SEC_WINNT_AUTH_IDENTITY_W *identity2 = AuthInfo2->nt_identity; - /* compare user names */ - if (identity1->UserLength != identity2->UserLength || - memcmp(identity1->User, identity2->User, identity1->UserLength)) - return FALSE; - /* compare domain names */ - if (identity1->DomainLength != identity2->DomainLength || - memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength)) - return FALSE; - /* compare passwords */ - if (identity1->PasswordLength != identity2->PasswordLength || - memcmp(identity1->Password, identity2->Password, identity1->PasswordLength)) - return FALSE; - } - else - return FALSE; - - return TRUE; -} - -static RPC_STATUS RpcQualityOfService_Create(const RPC_SECURITY_QOS *qos_src, BOOL unicode, RpcQualityOfService **qos_dst) -{ - RpcQualityOfService *qos = HeapAlloc(GetProcessHeap(), 0, sizeof(*qos)); - - if (!qos) - return RPC_S_OUT_OF_RESOURCES; - - qos->refs = 1; - qos->qos = HeapAlloc(GetProcessHeap(), 0, sizeof(*qos->qos)); - if (!qos->qos) goto error; - qos->qos->Version = qos_src->Version; - qos->qos->Capabilities = qos_src->Capabilities; - qos->qos->IdentityTracking = qos_src->IdentityTracking; - qos->qos->ImpersonationType = qos_src->ImpersonationType; - qos->qos->AdditionalSecurityInfoType = 0; - - if (qos_src->Version >= 2) - { - const RPC_SECURITY_QOS_V2_W *qos_src2 = (const RPC_SECURITY_QOS_V2_W *)qos_src; - qos->qos->AdditionalSecurityInfoType = qos_src2->AdditionalSecurityInfoType; - if (qos_src2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) - { - const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_src = qos_src2->u.HttpCredentials; - RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_dst; - - http_credentials_dst = HeapAlloc(GetProcessHeap(), 0, sizeof(*http_credentials_dst)); - qos->qos->u.HttpCredentials = http_credentials_dst; - if (!http_credentials_dst) goto error; - http_credentials_dst->TransportCredentials = NULL; - http_credentials_dst->Flags = http_credentials_src->Flags; - http_credentials_dst->AuthenticationTarget = http_credentials_src->AuthenticationTarget; - http_credentials_dst->NumberOfAuthnSchemes = http_credentials_src->NumberOfAuthnSchemes; - http_credentials_dst->AuthnSchemes = NULL; - http_credentials_dst->ServerCertificateSubject = NULL; - if (http_credentials_src->TransportCredentials) - { - SEC_WINNT_AUTH_IDENTITY_W *cred_dst; - cred_dst = http_credentials_dst->TransportCredentials = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cred_dst)); - if (!cred_dst) goto error; - cred_dst->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; - if (unicode) - { - const SEC_WINNT_AUTH_IDENTITY_W *cred_src = http_credentials_src->TransportCredentials; - cred_dst->UserLength = cred_src->UserLength; - cred_dst->PasswordLength = cred_src->PasswordLength; - cred_dst->DomainLength = cred_src->DomainLength; - cred_dst->User = RPCRT4_strndupW(cred_src->User, cred_src->UserLength); - cred_dst->Password = RPCRT4_strndupW(cred_src->Password, cred_src->PasswordLength); - cred_dst->Domain = RPCRT4_strndupW(cred_src->Domain, cred_src->DomainLength); - } - else - { - const SEC_WINNT_AUTH_IDENTITY_A *cred_src = (const SEC_WINNT_AUTH_IDENTITY_A *)http_credentials_src->TransportCredentials; - cred_dst->UserLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, NULL, 0); - cred_dst->DomainLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, NULL, 0); - cred_dst->PasswordLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, NULL, 0); - cred_dst->User = HeapAlloc(GetProcessHeap(), 0, cred_dst->UserLength * sizeof(WCHAR)); - cred_dst->Password = HeapAlloc(GetProcessHeap(), 0, cred_dst->PasswordLength * sizeof(WCHAR)); - cred_dst->Domain = HeapAlloc(GetProcessHeap(), 0, cred_dst->DomainLength * sizeof(WCHAR)); - if (!cred_dst || !cred_dst->Password || !cred_dst->Domain) goto error; - MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, cred_dst->User, cred_dst->UserLength); - MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, cred_dst->Domain, cred_dst->DomainLength); - MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, cred_dst->Password, cred_dst->PasswordLength); - } - } - if (http_credentials_src->NumberOfAuthnSchemes) - { - http_credentials_dst->AuthnSchemes = HeapAlloc(GetProcessHeap(), 0, http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes)); - if (!http_credentials_dst->AuthnSchemes) goto error; - memcpy(http_credentials_dst->AuthnSchemes, http_credentials_src->AuthnSchemes, http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes)); - } - if (http_credentials_src->ServerCertificateSubject) - { - if (unicode) - http_credentials_dst->ServerCertificateSubject = - RPCRT4_strndupW(http_credentials_src->ServerCertificateSubject, - strlenW(http_credentials_src->ServerCertificateSubject)); - else - http_credentials_dst->ServerCertificateSubject = - RPCRT4_strdupAtoW((char *)http_credentials_src->ServerCertificateSubject); - if (!http_credentials_dst->ServerCertificateSubject) goto error; - } - } - } - *qos_dst = qos; - return RPC_S_OK; - -error: - if (qos->qos) - { - if (qos->qos->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP && - qos->qos->u.HttpCredentials) - { - if (qos->qos->u.HttpCredentials->TransportCredentials) - { - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->User); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Domain); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Password); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials); - } - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->AuthnSchemes); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->ServerCertificateSubject); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials); - } - HeapFree(GetProcessHeap(), 0, qos->qos); - } - HeapFree(GetProcessHeap(), 0, qos); - return RPC_S_OUT_OF_RESOURCES; -} - -ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos) -{ - return InterlockedIncrement(&qos->refs); -} - -ULONG RpcQualityOfService_Release(RpcQualityOfService *qos) -{ - ULONG refs = InterlockedDecrement(&qos->refs); - - if (!refs) - { - if (qos->qos->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) - { - if (qos->qos->u.HttpCredentials->TransportCredentials) - { - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->User); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Domain); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Password); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials); - } - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->AuthnSchemes); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->ServerCertificateSubject); - HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials); - } - HeapFree(GetProcessHeap(), 0, qos->qos); - HeapFree(GetProcessHeap(), 0, qos); - } - return refs; -} - -BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2) -{ - if (qos1 == qos2) - return TRUE; - - if (!qos1 || !qos2) - return FALSE; - - TRACE("qos1 = { %ld %ld %ld %ld }, qos2 = { %ld %ld %ld %ld }\n", - qos1->qos->Capabilities, qos1->qos->IdentityTracking, - qos1->qos->ImpersonationType, qos1->qos->AdditionalSecurityInfoType, - qos2->qos->Capabilities, qos2->qos->IdentityTracking, - qos2->qos->ImpersonationType, qos2->qos->AdditionalSecurityInfoType); - - if ((qos1->qos->Capabilities != qos2->qos->Capabilities) || - (qos1->qos->IdentityTracking != qos2->qos->IdentityTracking) || - (qos1->qos->ImpersonationType != qos2->qos->ImpersonationType) || - (qos1->qos->AdditionalSecurityInfoType != qos2->qos->AdditionalSecurityInfoType)) - return FALSE; - - if (qos1->qos->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) - { - const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials1 = qos1->qos->u.HttpCredentials; - const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials2 = qos2->qos->u.HttpCredentials; - - if (http_credentials1->Flags != http_credentials2->Flags) - return FALSE; - - if (http_credentials1->AuthenticationTarget != http_credentials2->AuthenticationTarget) - return FALSE; - - /* authentication schemes and server certificate subject not currently used */ - - if (http_credentials1->TransportCredentials != http_credentials2->TransportCredentials) - { - const SEC_WINNT_AUTH_IDENTITY_W *identity1 = http_credentials1->TransportCredentials; - const SEC_WINNT_AUTH_IDENTITY_W *identity2 = http_credentials2->TransportCredentials; - - if (!identity1 || !identity2) - return FALSE; - - /* compare user names */ - if (identity1->UserLength != identity2->UserLength || - memcmp(identity1->User, identity2->User, identity1->UserLength)) - return FALSE; - /* compare domain names */ - if (identity1->DomainLength != identity2->DomainLength || - memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength)) - return FALSE; - /* compare passwords */ - if (identity1->PasswordLength != identity2->PasswordLength || - memcmp(identity1->Password, identity2->Password, identity1->PasswordLength)) - return FALSE; - } - } - - return TRUE; -} - -/*********************************************************************** - * RpcRevertToSelf (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcRevertToSelf(void) -{ - FIXME("stub\n"); - RevertToSelf(); - return RPC_S_OK; -} - -/*********************************************************************** - * RpcMgmtSetComTimeout (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtSetComTimeout(RPC_BINDING_HANDLE BindingHandle, unsigned int Timeout) -{ - FIXME("(%p, %d): stub\n", BindingHandle, Timeout); - return RPC_S_OK; -} - -/*********************************************************************** - * RpcBindingInqAuthInfoExA (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingInqAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, - ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, - ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS ) -{ - FIXME("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel, - AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS); - return RPC_S_INVALID_BINDING; -} - -/*********************************************************************** - * RpcBindingInqAuthInfoExW (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingInqAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, - ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, - ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS ) -{ - FIXME("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel, - AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS); - return RPC_S_INVALID_BINDING; -} - -/*********************************************************************** - * RpcBindingInqAuthInfoA (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingInqAuthInfoA( RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, - ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc ) -{ - FIXME("%p %p %p %p %p %p\n", Binding, ServerPrincName, AuthnLevel, - AuthnSvc, AuthIdentity, AuthzSvc); - return RPC_S_INVALID_BINDING; -} - -/*********************************************************************** - * RpcBindingInqAuthInfoW (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingInqAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, - ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc ) -{ - FIXME("%p %p %p %p %p %p\n", Binding, ServerPrincName, AuthnLevel, - AuthnSvc, AuthIdentity, AuthzSvc); - return RPC_S_INVALID_BINDING; -} - -/*********************************************************************** - * RpcBindingSetAuthInfoExA (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingSetAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, - ULONG AuthnLevel, ULONG AuthnSvc, - RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, - RPC_SECURITY_QOS *SecurityQos ) -{ - RpcBinding* bind = (RpcBinding*)Binding; - SECURITY_STATUS r; - CredHandle cred; - TimeStamp exp; - ULONG package_count; - ULONG i; - PSecPkgInfoA packages; - ULONG cbMaxToken; - - TRACE("%p %s %u %u %p %u %p\n", Binding, debugstr_a((const char*)ServerPrincName), - AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos); - - if (SecurityQos) - { - RPC_STATUS status; - - TRACE("SecurityQos { Version=%ld, Capabilties=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld", - SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType); - if (SecurityQos->Version >= 2) - { - const RPC_SECURITY_QOS_V2_A *SecurityQos2 = (const RPC_SECURITY_QOS_V2_A *)SecurityQos; - TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType); - if (SecurityQos2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) - TRACE(", { %p, 0x%lx, %ld, %ld, %p, %s }", - SecurityQos2->u.HttpCredentials->TransportCredentials, - SecurityQos2->u.HttpCredentials->Flags, - SecurityQos2->u.HttpCredentials->AuthenticationTarget, - SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes, - SecurityQos2->u.HttpCredentials->AuthnSchemes, - SecurityQos2->u.HttpCredentials->ServerCertificateSubject); - } - TRACE("}\n"); - status = RpcQualityOfService_Create(SecurityQos, FALSE, &bind->QOS); - if (status != RPC_S_OK) - return status; - } - else - { - if (bind->QOS) RpcQualityOfService_Release(bind->QOS); - bind->QOS = NULL; - } - - if (AuthnSvc == RPC_C_AUTHN_DEFAULT) - AuthnSvc = RPC_C_AUTHN_WINNT; - - /* FIXME: the mapping should probably be retrieved using SSPI somehow */ - if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT) - AuthnLevel = RPC_C_AUTHN_LEVEL_NONE; - - if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE)) - { - if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); - bind->AuthInfo = NULL; - return RPC_S_OK; - } - - if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY) - { - FIXME("unknown AuthnLevel %u\n", AuthnLevel); - return RPC_S_UNKNOWN_AUTHN_LEVEL; - } - - if (AuthzSvr) - { - FIXME("unsupported AuthzSvr %u\n", AuthzSvr); - return RPC_S_UNKNOWN_AUTHZ_SERVICE; - } - - r = EnumerateSecurityPackagesA(&package_count, &packages); - if (r != SEC_E_OK) - { - ERR("EnumerateSecurityPackagesA failed with error 0x%08x\n", r); - return RPC_S_SEC_PKG_ERROR; - } - - for (i = 0; i < package_count; i++) - if (packages[i].wRPCID == AuthnSvc) - break; - - if (i == package_count) - { - FIXME("unsupported AuthnSvc %u\n", AuthnSvc); - FreeContextBuffer(packages); - return RPC_S_UNKNOWN_AUTHN_SERVICE; - } - - TRACE("found package %s for service %u\n", packages[i].Name, AuthnSvc); - r = AcquireCredentialsHandleA((SEC_CHAR *)ServerPrincName, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, - AuthIdentity, NULL, NULL, &cred, &exp); - cbMaxToken = packages[i].cbMaxToken; - FreeContextBuffer(packages); - if (r == ERROR_SUCCESS) - { - if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); - bind->AuthInfo = NULL; - r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken, - AuthIdentity, &bind->AuthInfo); - if (r != RPC_S_OK) - FreeCredentialsHandle(&cred); - return RPC_S_OK; - } - else - { - ERR("AcquireCredentialsHandleA failed with error 0x%08x\n", r); - return RPC_S_SEC_PKG_ERROR; - } -} - -/*********************************************************************** - * RpcBindingSetAuthInfoExW (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingSetAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, - ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, - RPC_SECURITY_QOS *SecurityQos ) -{ - RpcBinding* bind = (RpcBinding*)Binding; - SECURITY_STATUS r; - CredHandle cred; - TimeStamp exp; - ULONG package_count; - ULONG i; - PSecPkgInfoW packages; - ULONG cbMaxToken; - - TRACE("%p %s %u %u %p %u %p\n", Binding, debugstr_w((const WCHAR*)ServerPrincName), - AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos); - - if (SecurityQos) - { - RPC_STATUS status; - - TRACE("SecurityQos { Version=%ld, Capabilties=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld", - SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType); - if (SecurityQos->Version >= 2) - { - const RPC_SECURITY_QOS_V2_W *SecurityQos2 = (const RPC_SECURITY_QOS_V2_W *)SecurityQos; - TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType); - if (SecurityQos2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) - TRACE(", { %p, 0x%lx, %ld, %ld, %p, %s }", - SecurityQos2->u.HttpCredentials->TransportCredentials, - SecurityQos2->u.HttpCredentials->Flags, - SecurityQos2->u.HttpCredentials->AuthenticationTarget, - SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes, - SecurityQos2->u.HttpCredentials->AuthnSchemes, - debugstr_w(SecurityQos2->u.HttpCredentials->ServerCertificateSubject)); - } - TRACE("}\n"); - status = RpcQualityOfService_Create(SecurityQos, TRUE, &bind->QOS); - if (status != RPC_S_OK) - return status; - } - else - { - if (bind->QOS) RpcQualityOfService_Release(bind->QOS); - bind->QOS = NULL; - } - - if (AuthnSvc == RPC_C_AUTHN_DEFAULT) - AuthnSvc = RPC_C_AUTHN_WINNT; - - /* FIXME: the mapping should probably be retrieved using SSPI somehow */ - if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT) - AuthnLevel = RPC_C_AUTHN_LEVEL_NONE; - - if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE)) - { - if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); - bind->AuthInfo = NULL; - return RPC_S_OK; - } - - if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY) - { - FIXME("unknown AuthnLevel %u\n", AuthnLevel); - return RPC_S_UNKNOWN_AUTHN_LEVEL; - } - - if (AuthzSvr) - { - FIXME("unsupported AuthzSvr %u\n", AuthzSvr); - return RPC_S_UNKNOWN_AUTHZ_SERVICE; - } - - r = EnumerateSecurityPackagesW(&package_count, &packages); - if (r != SEC_E_OK) - { - ERR("EnumerateSecurityPackagesA failed with error 0x%08x\n", r); - return RPC_S_SEC_PKG_ERROR; - } - - for (i = 0; i < package_count; i++) - if (packages[i].wRPCID == AuthnSvc) - break; - - if (i == package_count) - { - FIXME("unsupported AuthnSvc %u\n", AuthnSvc); - FreeContextBuffer(packages); - return RPC_S_UNKNOWN_AUTHN_SERVICE; - } - - TRACE("found package %s for service %u\n", debugstr_w(packages[i].Name), AuthnSvc); - r = AcquireCredentialsHandleW((SEC_WCHAR *)ServerPrincName, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, - AuthIdentity, NULL, NULL, &cred, &exp); - cbMaxToken = packages[i].cbMaxToken; - FreeContextBuffer(packages); - if (r == ERROR_SUCCESS) - { - if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); - bind->AuthInfo = NULL; - r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken, - AuthIdentity, &bind->AuthInfo); - if (r != RPC_S_OK) - FreeCredentialsHandle(&cred); - return RPC_S_OK; - } - else - { - ERR("AcquireCredentialsHandleA failed with error 0x%08x\n", r); - return RPC_S_SEC_PKG_ERROR; - } -} - -/*********************************************************************** - * RpcBindingSetAuthInfoA (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingSetAuthInfoA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, - ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr ) -{ - TRACE("%p %s %u %u %p %u\n", Binding, debugstr_a((const char*)ServerPrincName), - AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr); - return RpcBindingSetAuthInfoExA(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL); -} - -/*********************************************************************** - * RpcBindingSetAuthInfoW (RPCRT4.@) - */ -RPCRTAPI RPC_STATUS RPC_ENTRY -RpcBindingSetAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, - ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr ) -{ - TRACE("%p %s %u %u %p %u\n", Binding, debugstr_w((const WCHAR*)ServerPrincName), - AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr); - return RpcBindingSetAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL); -} - -/*********************************************************************** - * RpcBindingSetOption (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcBindingSetOption(RPC_BINDING_HANDLE BindingHandle, ULONG Option, ULONG OptionValue) -{ - FIXME("(%p, %d, %d): stub\n", BindingHandle, Option, OptionValue); - return RPC_S_OK; -} +/* + * RPC binding API + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2003 Mike Hearn + * Copyright 2004 Filip Navara + * Copyright 2006 CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "winerror.h" +#include "winternl.h" +#include "wine/unicode.h" + +#include "rpc.h" +#include "rpcndr.h" + +#include "wine/debug.h" + +#include "rpc_binding.h" +#include "rpc_message.h" + +WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +LPSTR RPCRT4_strndupA(LPCSTR src, INT slen) +{ + DWORD len; + LPSTR s; + if (!src) return NULL; + if (slen == -1) slen = strlen(src); + len = slen; + s = HeapAlloc(GetProcessHeap(), 0, len+1); + memcpy(s, src, len); + s[len] = 0; + return s; +} + +LPSTR RPCRT4_strdupWtoA(LPCWSTR src) +{ + DWORD len; + LPSTR s; + if (!src) return NULL; + len = WideCharToMultiByte(CP_ACP, 0, src, -1, NULL, 0, NULL, NULL); + s = HeapAlloc(GetProcessHeap(), 0, len); + WideCharToMultiByte(CP_ACP, 0, src, -1, s, len, NULL, NULL); + return s; +} + +LPWSTR RPCRT4_strdupAtoW(LPCSTR src) +{ + DWORD len; + LPWSTR s; + if (!src) return NULL; + len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0); + s = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, src, -1, s, len); + return s; +} + +static LPWSTR RPCRT4_strndupAtoW(LPCSTR src, INT slen) +{ + DWORD len; + LPWSTR s; + if (!src) return NULL; + len = MultiByteToWideChar(CP_ACP, 0, src, slen, NULL, 0); + s = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, src, slen, s, len); + return s; +} + +LPWSTR RPCRT4_strndupW(LPCWSTR src, INT slen) +{ + DWORD len; + LPWSTR s; + if (!src) return NULL; + if (slen == -1) slen = strlenW(src); + len = slen; + s = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR)); + memcpy(s, src, len*sizeof(WCHAR)); + s[len] = 0; + return s; +} + +void RPCRT4_strfree(LPSTR src) +{ + HeapFree(GetProcessHeap(), 0, src); +} + +static RPC_STATUS RPCRT4_AllocBinding(RpcBinding** Binding, BOOL server) +{ + RpcBinding* NewBinding; + + NewBinding = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcBinding)); + NewBinding->refs = 1; + NewBinding->server = server; + + *Binding = NewBinding; + + return RPC_S_OK; +} + +static RPC_STATUS RPCRT4_CreateBindingA(RpcBinding** Binding, BOOL server, LPCSTR Protseq) +{ + RpcBinding* NewBinding; + + RPCRT4_AllocBinding(&NewBinding, server); + NewBinding->Protseq = RPCRT4_strdupA(Protseq); + + TRACE("binding: %p\n", NewBinding); + *Binding = NewBinding; + + return RPC_S_OK; +} + +static RPC_STATUS RPCRT4_CreateBindingW(RpcBinding** Binding, BOOL server, LPCWSTR Protseq) +{ + RpcBinding* NewBinding; + + RPCRT4_AllocBinding(&NewBinding, server); + NewBinding->Protseq = RPCRT4_strdupWtoA(Protseq); + + TRACE("binding: %p\n", NewBinding); + *Binding = NewBinding; + + return RPC_S_OK; +} + +static RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding* Binding, LPCSTR NetworkAddr, + LPCSTR Endpoint, LPCSTR NetworkOptions) +{ + RPC_STATUS status; + + TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding, + debugstr_a(NetworkAddr), debugstr_a(Endpoint), debugstr_a(NetworkOptions)); + + RPCRT4_strfree(Binding->NetworkAddr); + Binding->NetworkAddr = RPCRT4_strdupA(NetworkAddr); + RPCRT4_strfree(Binding->Endpoint); + if (Endpoint) { + Binding->Endpoint = RPCRT4_strdupA(Endpoint); + } else { + Binding->Endpoint = RPCRT4_strdupA(""); + } + HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions); + Binding->NetworkOptions = RPCRT4_strdupAtoW(NetworkOptions); + if (!Binding->Endpoint) ERR("out of memory?\n"); + + status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr, + Binding->Endpoint, Binding->NetworkOptions, + &Binding->Assoc); + if (status != RPC_S_OK) + return status; + + return RPC_S_OK; +} + +static RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding* Binding, LPCWSTR NetworkAddr, + LPCWSTR Endpoint, LPCWSTR NetworkOptions) +{ + RPC_STATUS status; + + TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding, + debugstr_w(NetworkAddr), debugstr_w(Endpoint), debugstr_w(NetworkOptions)); + + RPCRT4_strfree(Binding->NetworkAddr); + Binding->NetworkAddr = RPCRT4_strdupWtoA(NetworkAddr); + RPCRT4_strfree(Binding->Endpoint); + if (Endpoint) { + Binding->Endpoint = RPCRT4_strdupWtoA(Endpoint); + } else { + Binding->Endpoint = RPCRT4_strdupA(""); + } + if (!Binding->Endpoint) ERR("out of memory?\n"); + HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions); + Binding->NetworkOptions = RPCRT4_strdupW(NetworkOptions); + + status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr, + Binding->Endpoint, Binding->NetworkOptions, + &Binding->Assoc); + if (status != RPC_S_OK) + return status; + + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint) +{ + RPC_STATUS status; + + TRACE("(RpcBinding == ^%p, EndPoint == \"%s\"\n", Binding, Endpoint); + + RPCRT4_strfree(Binding->Endpoint); + Binding->Endpoint = RPCRT4_strdupA(Endpoint); + + RpcAssoc_Release(Binding->Assoc); + Binding->Assoc = NULL; + status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr, + Binding->Endpoint, Binding->NetworkOptions, + &Binding->Assoc); + if (status != RPC_S_OK) + return status; + + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid) +{ + TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid)); + if (ObjectUuid) memcpy(&Binding->ObjectUuid, ObjectUuid, sizeof(UUID)); + else UuidCreateNil(&Binding->ObjectUuid); + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection) +{ + RpcBinding* NewBinding; + TRACE("(RpcBinding == ^%p, Connection == ^%p)\n", Binding, Connection); + + RPCRT4_AllocBinding(&NewBinding, Connection->server); + NewBinding->Protseq = RPCRT4_strdupA(rpcrt4_conn_get_name(Connection)); + NewBinding->NetworkAddr = RPCRT4_strdupA(Connection->NetworkAddr); + NewBinding->Endpoint = RPCRT4_strdupA(Connection->Endpoint); + NewBinding->FromConn = Connection; + + TRACE("binding: %p\n", NewBinding); + *Binding = NewBinding; + + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_ExportBinding(RpcBinding** Binding, RpcBinding* OldBinding) +{ + InterlockedIncrement(&OldBinding->refs); + *Binding = OldBinding; + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_DestroyBinding(RpcBinding* Binding) +{ + if (InterlockedDecrement(&Binding->refs)) + return RPC_S_OK; + + TRACE("binding: %p\n", Binding); + if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc); + RPCRT4_strfree(Binding->Endpoint); + RPCRT4_strfree(Binding->NetworkAddr); + RPCRT4_strfree(Binding->Protseq); + HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions); + if (Binding->AuthInfo) RpcAuthInfo_Release(Binding->AuthInfo); + if (Binding->QOS) RpcQualityOfService_Release(Binding->QOS); + HeapFree(GetProcessHeap(), 0, Binding); + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, + const RPC_SYNTAX_IDENTIFIER *TransferSyntax, + const RPC_SYNTAX_IDENTIFIER *InterfaceId) +{ + TRACE("(Binding == ^%p)\n", Binding); + + if (!Binding->server) { + return RpcAssoc_GetClientConnection(Binding->Assoc, InterfaceId, + TransferSyntax, Binding->AuthInfo, Binding->QOS, Connection); + } else { + /* we already have a connection with acceptable binding, so use it */ + if (Binding->FromConn) { + *Connection = Binding->FromConn; + return RPC_S_OK; + } else { + ERR("no connection in binding\n"); + return RPC_S_INTERNAL_ERROR; + } + } +} + +RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection) +{ + TRACE("(Binding == ^%p)\n", Binding); + if (!Connection) return RPC_S_OK; + if (Binding->server) { + /* don't destroy a connection that is cached in the binding */ + if (Binding->FromConn == Connection) + return RPC_S_OK; + return RPCRT4_DestroyConnection(Connection); + } + else { + RpcAssoc_ReleaseIdleConnection(Binding->Assoc, Connection); + return RPC_S_OK; + } +} + +/* utility functions for string composing and parsing */ +static unsigned RPCRT4_strcopyA(LPSTR data, LPCSTR src) +{ + unsigned len = strlen(src); + memcpy(data, src, len*sizeof(CHAR)); + return len; +} + +static unsigned RPCRT4_strcopyW(LPWSTR data, LPCWSTR src) +{ + unsigned len = strlenW(src); + memcpy(data, src, len*sizeof(WCHAR)); + return len; +} + +static LPSTR RPCRT4_strconcatA(LPSTR dst, LPCSTR src) +{ + DWORD len = strlen(dst), slen = strlen(src); + LPSTR ndst = HeapReAlloc(GetProcessHeap(), 0, dst, (len+slen+2)*sizeof(CHAR)); + if (!ndst) + { + HeapFree(GetProcessHeap(), 0, dst); + return NULL; + } + ndst[len] = ','; + memcpy(ndst+len+1, src, slen+1); + return ndst; +} + +static LPWSTR RPCRT4_strconcatW(LPWSTR dst, LPCWSTR src) +{ + DWORD len = strlenW(dst), slen = strlenW(src); + LPWSTR ndst = HeapReAlloc(GetProcessHeap(), 0, dst, (len+slen+2)*sizeof(WCHAR)); + if (!ndst) + { + HeapFree(GetProcessHeap(), 0, dst); + return NULL; + } + ndst[len] = ','; + memcpy(ndst+len+1, src, (slen+1)*sizeof(WCHAR)); + return ndst; +} + + +/*********************************************************************** + * RpcStringBindingComposeA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, + RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, + RPC_CSTR Options, RPC_CSTR *StringBinding ) +{ + DWORD len = 1; + LPSTR data; + + TRACE( "(%s,%s,%s,%s,%s,%p)\n", + debugstr_a( (char*)ObjUuid ), debugstr_a( (char*)Protseq ), + debugstr_a( (char*)NetworkAddr ), debugstr_a( (char*)Endpoint ), + debugstr_a( (char*)Options ), StringBinding ); + + if (ObjUuid && *ObjUuid) len += strlen((char*)ObjUuid) + 1; + if (Protseq && *Protseq) len += strlen((char*)Protseq) + 1; + if (NetworkAddr && *NetworkAddr) len += strlen((char*)NetworkAddr); + if (Endpoint && *Endpoint) len += strlen((char*)Endpoint) + 2; + if (Options && *Options) len += strlen((char*)Options) + 2; + + data = HeapAlloc(GetProcessHeap(), 0, len); + *StringBinding = (unsigned char*)data; + + if (ObjUuid && *ObjUuid) { + data += RPCRT4_strcopyA(data, (char*)ObjUuid); + *data++ = '@'; + } + if (Protseq && *Protseq) { + data += RPCRT4_strcopyA(data, (char*)Protseq); + *data++ = ':'; + } + if (NetworkAddr && *NetworkAddr) + data += RPCRT4_strcopyA(data, (char*)NetworkAddr); + + if ((Endpoint && *Endpoint) || + (Options && *Options)) { + *data++ = '['; + if (Endpoint && *Endpoint) { + data += RPCRT4_strcopyA(data, (char*)Endpoint); + if (Options && *Options) *data++ = ','; + } + if (Options && *Options) { + data += RPCRT4_strcopyA(data, (char*)Options); + } + *data++ = ']'; + } + *data = 0; + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcStringBindingComposeW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcStringBindingComposeW( RPC_WSTR ObjUuid, RPC_WSTR Protseq, + RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, + RPC_WSTR Options, RPC_WSTR* StringBinding ) +{ + DWORD len = 1; + RPC_WSTR data; + + TRACE("(%s,%s,%s,%s,%s,%p)\n", + debugstr_w( ObjUuid ), debugstr_w( Protseq ), + debugstr_w( NetworkAddr ), debugstr_w( Endpoint ), + debugstr_w( Options ), StringBinding); + + if (ObjUuid && *ObjUuid) len += strlenW(ObjUuid) + 1; + if (Protseq && *Protseq) len += strlenW(Protseq) + 1; + if (NetworkAddr && *NetworkAddr) len += strlenW(NetworkAddr); + if (Endpoint && *Endpoint) len += strlenW(Endpoint) + 2; + if (Options && *Options) len += strlenW(Options) + 2; + + data = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + *StringBinding = data; + + if (ObjUuid && *ObjUuid) { + data += RPCRT4_strcopyW(data, ObjUuid); + *data++ = '@'; + } + if (Protseq && *Protseq) { + data += RPCRT4_strcopyW(data, Protseq); + *data++ = ':'; + } + if (NetworkAddr && *NetworkAddr) { + data += RPCRT4_strcopyW(data, NetworkAddr); + } + if ((Endpoint && *Endpoint) || + (Options && *Options)) { + *data++ = '['; + if (Endpoint && *Endpoint) { + data += RPCRT4_strcopyW(data, Endpoint); + if (Options && *Options) *data++ = ','; + } + if (Options && *Options) { + data += RPCRT4_strcopyW(data, Options); + } + *data++ = ']'; + } + *data = 0; + + return RPC_S_OK; +} + + +/*********************************************************************** + * RpcStringBindingParseA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcStringBindingParseA( RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, + RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr, + RPC_CSTR *Endpoint, RPC_CSTR *Options) +{ + CHAR *data, *next; + static const char ep_opt[] = "endpoint="; + + TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_a((char*)StringBinding), + ObjUuid, Protseq, NetworkAddr, Endpoint, Options); + + if (ObjUuid) *ObjUuid = NULL; + if (Protseq) *Protseq = NULL; + if (NetworkAddr) *NetworkAddr = NULL; + if (Endpoint) *Endpoint = NULL; + if (Options) *Options = NULL; + + data = (char*) StringBinding; + + next = strchr(data, '@'); + if (next) { + if (ObjUuid) *ObjUuid = (unsigned char*)RPCRT4_strndupA(data, next - data); + data = next+1; + } + + next = strchr(data, ':'); + if (next) { + if (Protseq) *Protseq = (unsigned char*)RPCRT4_strndupA(data, next - data); + data = next+1; + } + + next = strchr(data, '['); + if (next) { + CHAR *close, *opt; + + if (NetworkAddr) *NetworkAddr = (unsigned char*)RPCRT4_strndupA(data, next - data); + data = next+1; + close = strchr(data, ']'); + if (!close) goto fail; + + /* tokenize options */ + while (data < close) { + next = strchr(data, ','); + if (!next || next > close) next = close; + /* FIXME: this is kind of inefficient */ + opt = RPCRT4_strndupA(data, next - data); + data = next+1; + + /* parse option */ + next = strchr(opt, '='); + if (!next) { + /* not an option, must be an endpoint */ + if (*Endpoint) goto fail; + *Endpoint = (unsigned char*) opt; + } else { + if (strncmp(opt, ep_opt, strlen(ep_opt)) == 0) { + /* endpoint option */ + if (*Endpoint) goto fail; + *Endpoint = (unsigned char*) RPCRT4_strdupA(next+1); + HeapFree(GetProcessHeap(), 0, opt); + } else { + /* network option */ + if (*Options) { + /* FIXME: this is kind of inefficient */ + *Options = (unsigned char*) RPCRT4_strconcatA( (char*)*Options, opt); + HeapFree(GetProcessHeap(), 0, opt); + } else + *Options = (unsigned char*) opt; + } + } + } + + data = close+1; + if (*data) goto fail; + } + else if (NetworkAddr) + *NetworkAddr = (unsigned char*)RPCRT4_strdupA(data); + + return RPC_S_OK; + +fail: + if (ObjUuid) RpcStringFreeA((unsigned char**)ObjUuid); + if (Protseq) RpcStringFreeA((unsigned char**)Protseq); + if (NetworkAddr) RpcStringFreeA((unsigned char**)NetworkAddr); + if (Endpoint) RpcStringFreeA((unsigned char**)Endpoint); + if (Options) RpcStringFreeA((unsigned char**)Options); + return RPC_S_INVALID_STRING_BINDING; +} + +/*********************************************************************** + * RpcStringBindingParseW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcStringBindingParseW( RPC_WSTR StringBinding, RPC_WSTR *ObjUuid, + RPC_WSTR *Protseq, RPC_WSTR *NetworkAddr, + RPC_WSTR *Endpoint, RPC_WSTR *Options) +{ + WCHAR *data, *next; + static const WCHAR ep_opt[] = {'e','n','d','p','o','i','n','t','=',0}; + + TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_w(StringBinding), + ObjUuid, Protseq, NetworkAddr, Endpoint, Options); + + if (ObjUuid) *ObjUuid = NULL; + if (Protseq) *Protseq = NULL; + if (NetworkAddr) *NetworkAddr = NULL; + if (Endpoint) *Endpoint = NULL; + if (Options) *Options = NULL; + + data = StringBinding; + + next = strchrW(data, '@'); + if (next) { + if (ObjUuid) *ObjUuid = RPCRT4_strndupW(data, next - data); + data = next+1; + } + + next = strchrW(data, ':'); + if (next) { + if (Protseq) *Protseq = RPCRT4_strndupW(data, next - data); + data = next+1; + } + + next = strchrW(data, '['); + if (next) { + WCHAR *close, *opt; + + if (NetworkAddr) *NetworkAddr = RPCRT4_strndupW(data, next - data); + data = next+1; + close = strchrW(data, ']'); + if (!close) goto fail; + + /* tokenize options */ + while (data < close) { + next = strchrW(data, ','); + if (!next || next > close) next = close; + /* FIXME: this is kind of inefficient */ + opt = RPCRT4_strndupW(data, next - data); + data = next+1; + + /* parse option */ + next = strchrW(opt, '='); + if (!next) { + /* not an option, must be an endpoint */ + if (*Endpoint) goto fail; + *Endpoint = opt; + } else { + if (strncmpW(opt, ep_opt, strlenW(ep_opt)) == 0) { + /* endpoint option */ + if (*Endpoint) goto fail; + *Endpoint = RPCRT4_strdupW(next+1); + HeapFree(GetProcessHeap(), 0, opt); + } else { + /* network option */ + if (*Options) { + /* FIXME: this is kind of inefficient */ + *Options = RPCRT4_strconcatW(*Options, opt); + HeapFree(GetProcessHeap(), 0, opt); + } else + *Options = opt; + } + } + } + + data = close+1; + if (*data) goto fail; + } else if (NetworkAddr) + *NetworkAddr = RPCRT4_strdupW(data); + + return RPC_S_OK; + +fail: + if (ObjUuid) RpcStringFreeW(ObjUuid); + if (Protseq) RpcStringFreeW(Protseq); + if (NetworkAddr) RpcStringFreeW(NetworkAddr); + if (Endpoint) RpcStringFreeW(Endpoint); + if (Options) RpcStringFreeW(Options); + return RPC_S_INVALID_STRING_BINDING; +} + +/*********************************************************************** + * RpcBindingFree (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingFree( RPC_BINDING_HANDLE* Binding ) +{ + RPC_STATUS status; + TRACE("(%p) = %p\n", Binding, *Binding); + status = RPCRT4_DestroyBinding(*Binding); + if (status == RPC_S_OK) *Binding = 0; + return status; +} + +/*********************************************************************** + * RpcBindingVectorFree (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingVectorFree( RPC_BINDING_VECTOR** BindingVector ) +{ + RPC_STATUS status; + unsigned long c; + + TRACE("(%p)\n", BindingVector); + for (c=0; c<(*BindingVector)->Count; c++) { + status = RpcBindingFree(&(*BindingVector)->BindingH[c]); + } + HeapFree(GetProcessHeap(), 0, *BindingVector); + *BindingVector = NULL; + return RPC_S_OK; +} + +/*********************************************************************** + * RpcBindingInqObject (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingInqObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid ) +{ + RpcBinding* bind = (RpcBinding*)Binding; + + TRACE("(%p,%p) = %s\n", Binding, ObjectUuid, debugstr_guid(&bind->ObjectUuid)); + memcpy(ObjectUuid, &bind->ObjectUuid, sizeof(UUID)); + return RPC_S_OK; +} + +/*********************************************************************** + * RpcBindingSetObject (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingSetObject( RPC_BINDING_HANDLE Binding, UUID* ObjectUuid ) +{ + RpcBinding* bind = (RpcBinding*)Binding; + + TRACE("(%p,%s)\n", Binding, debugstr_guid(ObjectUuid)); + if (bind->server) return RPC_S_WRONG_KIND_OF_BINDING; + return RPCRT4_SetBindingObject(Binding, ObjectUuid); +} + +/*********************************************************************** + * RpcBindingFromStringBindingA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingFromStringBindingA( RPC_CSTR StringBinding, RPC_BINDING_HANDLE* Binding ) +{ + RPC_STATUS ret; + RpcBinding* bind = NULL; + RPC_CSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options; + UUID Uuid; + + TRACE("(%s,%p)\n", debugstr_a((char*)StringBinding), Binding); + + ret = RpcStringBindingParseA(StringBinding, &ObjectUuid, &Protseq, + &NetworkAddr, &Endpoint, &Options); + if (ret != RPC_S_OK) return ret; + + ret = UuidFromStringA(ObjectUuid, &Uuid); + + if (ret == RPC_S_OK) + ret = RPCRT4_CreateBindingA(&bind, FALSE, (char*)Protseq); + if (ret == RPC_S_OK) + ret = RPCRT4_SetBindingObject(bind, &Uuid); + if (ret == RPC_S_OK) + ret = RPCRT4_CompleteBindingA(bind, (char*)NetworkAddr, (char*)Endpoint, (char*)Options); + + RpcStringFreeA((unsigned char**)&Options); + RpcStringFreeA((unsigned char**)&Endpoint); + RpcStringFreeA((unsigned char**)&NetworkAddr); + RpcStringFreeA((unsigned char**)&Protseq); + RpcStringFreeA((unsigned char**)&ObjectUuid); + + if (ret == RPC_S_OK) + *Binding = (RPC_BINDING_HANDLE)bind; + else + RPCRT4_DestroyBinding(bind); + + return ret; +} + +/*********************************************************************** + * RpcBindingFromStringBindingW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingFromStringBindingW( RPC_WSTR StringBinding, RPC_BINDING_HANDLE* Binding ) +{ + RPC_STATUS ret; + RpcBinding* bind = NULL; + RPC_WSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options; + UUID Uuid; + + TRACE("(%s,%p)\n", debugstr_w(StringBinding), Binding); + + ret = RpcStringBindingParseW(StringBinding, &ObjectUuid, &Protseq, + &NetworkAddr, &Endpoint, &Options); + if (ret != RPC_S_OK) return ret; + + ret = UuidFromStringW(ObjectUuid, &Uuid); + + if (ret == RPC_S_OK) + ret = RPCRT4_CreateBindingW(&bind, FALSE, Protseq); + if (ret == RPC_S_OK) + ret = RPCRT4_SetBindingObject(bind, &Uuid); + if (ret == RPC_S_OK) + ret = RPCRT4_CompleteBindingW(bind, NetworkAddr, Endpoint, Options); + + RpcStringFreeW(&Options); + RpcStringFreeW(&Endpoint); + RpcStringFreeW(&NetworkAddr); + RpcStringFreeW(&Protseq); + RpcStringFreeW(&ObjectUuid); + + if (ret == RPC_S_OK) + *Binding = (RPC_BINDING_HANDLE)bind; + else + RPCRT4_DestroyBinding(bind); + + return ret; +} + +/*********************************************************************** + * RpcBindingToStringBindingA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding ) +{ + RPC_STATUS ret; + RpcBinding* bind = (RpcBinding*)Binding; + RPC_CSTR ObjectUuid; + + TRACE("(%p,%p)\n", Binding, StringBinding); + + ret = UuidToStringA(&bind->ObjectUuid, &ObjectUuid); + if (ret != RPC_S_OK) return ret; + + ret = RpcStringBindingComposeA(ObjectUuid, (unsigned char*)bind->Protseq, (unsigned char*) bind->NetworkAddr, + (unsigned char*) bind->Endpoint, NULL, StringBinding); + + RpcStringFreeA(&ObjectUuid); + + return ret; +} + +/*********************************************************************** + * RpcBindingToStringBindingW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding, RPC_WSTR *StringBinding ) +{ + RPC_STATUS ret; + unsigned char *str = NULL; + TRACE("(%p,%p)\n", Binding, StringBinding); + ret = RpcBindingToStringBindingA(Binding, &str); + *StringBinding = RPCRT4_strdupAtoW((char*)str); + RpcStringFreeA((unsigned char**)&str); + return ret; +} + +/*********************************************************************** + * I_RpcBindingSetAsync (RPCRT4.@) + * NOTES + * Exists in win9x and winNT, but with different number of arguments + * (9x version has 3 arguments, NT has 2). + */ +RPC_STATUS WINAPI I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn) +{ + RpcBinding* bind = (RpcBinding*)Binding; + + TRACE( "(%p,%p): stub\n", Binding, BlockingFn ); + + bind->BlockingFn = BlockingFn; + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcBindingCopy (RPCRT4.@) + */ +RPC_STATUS RPC_ENTRY RpcBindingCopy( + RPC_BINDING_HANDLE SourceBinding, + RPC_BINDING_HANDLE* DestinationBinding) +{ + RpcBinding *DestBinding; + RpcBinding *SrcBinding = (RpcBinding*)SourceBinding; + RPC_STATUS status; + + TRACE("(%p, %p)\n", SourceBinding, DestinationBinding); + + status = RPCRT4_AllocBinding(&DestBinding, SrcBinding->server); + if (status != RPC_S_OK) return status; + + DestBinding->ObjectUuid = SrcBinding->ObjectUuid; + DestBinding->BlockingFn = SrcBinding->BlockingFn; + DestBinding->Protseq = RPCRT4_strndupA(SrcBinding->Protseq, -1); + DestBinding->NetworkAddr = RPCRT4_strndupA(SrcBinding->NetworkAddr, -1); + DestBinding->Endpoint = RPCRT4_strndupA(SrcBinding->Endpoint, -1); + DestBinding->NetworkOptions = RPCRT4_strdupW(SrcBinding->NetworkOptions); + if (SrcBinding->Assoc) SrcBinding->Assoc->refs++; + DestBinding->Assoc = SrcBinding->Assoc; + + if (SrcBinding->AuthInfo) RpcAuthInfo_AddRef(SrcBinding->AuthInfo); + DestBinding->AuthInfo = SrcBinding->AuthInfo; + if (SrcBinding->QOS) RpcQualityOfService_AddRef(SrcBinding->QOS); + DestBinding->QOS = SrcBinding->QOS; + + *DestinationBinding = DestBinding; + return RPC_S_OK; +} + +/*********************************************************************** + * RpcImpersonateClient (RPCRT4.@) + * + * Impersonates the client connected via a binding handle so that security + * checks are done in the context of the client. + * + * PARAMS + * BindingHandle [I] Handle to the binding to the client. + * + * RETURNS + * Success: RPS_S_OK. + * Failure: RPC_STATUS value. + * + * NOTES + * + * If BindingHandle is NULL then the function impersonates the client + * connected to the binding handle of the current thread. + */ +RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle) +{ + FIXME("(%p): stub\n", BindingHandle); + ImpersonateSelf(SecurityImpersonation); + return RPC_S_OK; +} + +/*********************************************************************** + * RpcRevertToSelfEx (RPCRT4.@) + * + * Stops impersonating the client connected to the binding handle so that security + * checks are no longer done in the context of the client. + * + * PARAMS + * BindingHandle [I] Handle to the binding to the client. + * + * RETURNS + * Success: RPS_S_OK. + * Failure: RPC_STATUS value. + * + * NOTES + * + * If BindingHandle is NULL then the function stops impersonating the client + * connected to the binding handle of the current thread. + */ +RPC_STATUS WINAPI RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle) +{ + FIXME("(%p): stub\n", BindingHandle); + return RPC_S_OK; +} + +static inline BOOL has_nt_auth_identity(ULONG AuthnLevel) +{ + switch (AuthnLevel) + { + case RPC_C_AUTHN_GSS_NEGOTIATE: + case RPC_C_AUTHN_WINNT: + case RPC_C_AUTHN_GSS_KERBEROS: + return TRUE; + default: + return FALSE; + } +} + +static RPC_STATUS RpcAuthInfo_Create(ULONG AuthnLevel, ULONG AuthnSvc, + CredHandle cred, TimeStamp exp, + ULONG cbMaxToken, + RPC_AUTH_IDENTITY_HANDLE identity, + RpcAuthInfo **ret) +{ + RpcAuthInfo *AuthInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*AuthInfo)); + if (!AuthInfo) + return ERROR_OUTOFMEMORY; + + AuthInfo->refs = 1; + AuthInfo->AuthnLevel = AuthnLevel; + AuthInfo->AuthnSvc = AuthnSvc; + AuthInfo->cred = cred; + AuthInfo->exp = exp; + AuthInfo->cbMaxToken = cbMaxToken; + AuthInfo->identity = identity; + + /* duplicate the SEC_WINNT_AUTH_IDENTITY structure, if applicable, to + * enable better matching in RpcAuthInfo_IsEqual */ + if (identity && has_nt_auth_identity(AuthnSvc)) + { + const SEC_WINNT_AUTH_IDENTITY_W *nt_identity = identity; + AuthInfo->nt_identity = HeapAlloc(GetProcessHeap(), 0, sizeof(*AuthInfo->nt_identity)); + if (!AuthInfo->nt_identity) + { + HeapFree(GetProcessHeap(), 0, AuthInfo); + return ERROR_OUTOFMEMORY; + } + + AuthInfo->nt_identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; + if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE) + AuthInfo->nt_identity->User = RPCRT4_strndupW(nt_identity->User, nt_identity->UserLength); + else + AuthInfo->nt_identity->User = RPCRT4_strndupAtoW((const char *)nt_identity->User, nt_identity->UserLength); + AuthInfo->nt_identity->UserLength = nt_identity->UserLength; + if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE) + AuthInfo->nt_identity->Domain = RPCRT4_strndupW(nt_identity->Domain, nt_identity->DomainLength); + else + AuthInfo->nt_identity->Domain = RPCRT4_strndupAtoW((const char *)nt_identity->Domain, nt_identity->DomainLength); + AuthInfo->nt_identity->DomainLength = nt_identity->DomainLength; + if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE) + AuthInfo->nt_identity->Password = RPCRT4_strndupW(nt_identity->Password, nt_identity->PasswordLength); + else + AuthInfo->nt_identity->Password = RPCRT4_strndupAtoW((const char *)nt_identity->Password, nt_identity->PasswordLength); + AuthInfo->nt_identity->PasswordLength = nt_identity->PasswordLength; + + if (!AuthInfo->nt_identity->User || + !AuthInfo->nt_identity->Domain || + !AuthInfo->nt_identity->Password) + { + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User); + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Domain); + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Password); + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity); + HeapFree(GetProcessHeap(), 0, AuthInfo); + return ERROR_OUTOFMEMORY; + } + } + else + AuthInfo->nt_identity = NULL; + *ret = AuthInfo; + return RPC_S_OK; +} + +ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo) +{ + return InterlockedIncrement(&AuthInfo->refs); +} + +ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo) +{ + ULONG refs = InterlockedDecrement(&AuthInfo->refs); + + if (!refs) + { + FreeCredentialsHandle(&AuthInfo->cred); + if (AuthInfo->nt_identity) + { + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User); + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Domain); + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User); + HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity); + } + HeapFree(GetProcessHeap(), 0, AuthInfo); + } + + return refs; +} + +BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2) +{ + if (AuthInfo1 == AuthInfo2) + return TRUE; + + if (!AuthInfo1 || !AuthInfo2) + return FALSE; + + if ((AuthInfo1->AuthnLevel != AuthInfo2->AuthnLevel) || + (AuthInfo1->AuthnSvc != AuthInfo2->AuthnSvc)) + return FALSE; + + if (AuthInfo1->identity == AuthInfo2->identity) + return TRUE; + + if (!AuthInfo1->identity || !AuthInfo2->identity) + return FALSE; + + if (has_nt_auth_identity(AuthInfo1->AuthnSvc)) + { + const SEC_WINNT_AUTH_IDENTITY_W *identity1 = AuthInfo1->nt_identity; + const SEC_WINNT_AUTH_IDENTITY_W *identity2 = AuthInfo2->nt_identity; + /* compare user names */ + if (identity1->UserLength != identity2->UserLength || + memcmp(identity1->User, identity2->User, identity1->UserLength)) + return FALSE; + /* compare domain names */ + if (identity1->DomainLength != identity2->DomainLength || + memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength)) + return FALSE; + /* compare passwords */ + if (identity1->PasswordLength != identity2->PasswordLength || + memcmp(identity1->Password, identity2->Password, identity1->PasswordLength)) + return FALSE; + } + else + return FALSE; + + return TRUE; +} + +static RPC_STATUS RpcQualityOfService_Create(const RPC_SECURITY_QOS *qos_src, BOOL unicode, RpcQualityOfService **qos_dst) +{ + RpcQualityOfService *qos = HeapAlloc(GetProcessHeap(), 0, sizeof(*qos)); + + if (!qos) + return RPC_S_OUT_OF_RESOURCES; + + qos->refs = 1; + qos->qos = HeapAlloc(GetProcessHeap(), 0, sizeof(*qos->qos)); + if (!qos->qos) goto error; + qos->qos->Version = qos_src->Version; + qos->qos->Capabilities = qos_src->Capabilities; + qos->qos->IdentityTracking = qos_src->IdentityTracking; + qos->qos->ImpersonationType = qos_src->ImpersonationType; + qos->qos->AdditionalSecurityInfoType = 0; + + if (qos_src->Version >= 2) + { + const RPC_SECURITY_QOS_V2_W *qos_src2 = (const RPC_SECURITY_QOS_V2_W *)qos_src; + qos->qos->AdditionalSecurityInfoType = qos_src2->AdditionalSecurityInfoType; + if (qos_src2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) + { + const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_src = qos_src2->u.HttpCredentials; + RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_dst; + + http_credentials_dst = HeapAlloc(GetProcessHeap(), 0, sizeof(*http_credentials_dst)); + qos->qos->u.HttpCredentials = http_credentials_dst; + if (!http_credentials_dst) goto error; + http_credentials_dst->TransportCredentials = NULL; + http_credentials_dst->Flags = http_credentials_src->Flags; + http_credentials_dst->AuthenticationTarget = http_credentials_src->AuthenticationTarget; + http_credentials_dst->NumberOfAuthnSchemes = http_credentials_src->NumberOfAuthnSchemes; + http_credentials_dst->AuthnSchemes = NULL; + http_credentials_dst->ServerCertificateSubject = NULL; + if (http_credentials_src->TransportCredentials) + { + SEC_WINNT_AUTH_IDENTITY_W *cred_dst; + cred_dst = http_credentials_dst->TransportCredentials = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cred_dst)); + if (!cred_dst) goto error; + cred_dst->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; + if (unicode) + { + const SEC_WINNT_AUTH_IDENTITY_W *cred_src = http_credentials_src->TransportCredentials; + cred_dst->UserLength = cred_src->UserLength; + cred_dst->PasswordLength = cred_src->PasswordLength; + cred_dst->DomainLength = cred_src->DomainLength; + cred_dst->User = RPCRT4_strndupW(cred_src->User, cred_src->UserLength); + cred_dst->Password = RPCRT4_strndupW(cred_src->Password, cred_src->PasswordLength); + cred_dst->Domain = RPCRT4_strndupW(cred_src->Domain, cred_src->DomainLength); + } + else + { + const SEC_WINNT_AUTH_IDENTITY_A *cred_src = (const SEC_WINNT_AUTH_IDENTITY_A *)http_credentials_src->TransportCredentials; + cred_dst->UserLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, NULL, 0); + cred_dst->DomainLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, NULL, 0); + cred_dst->PasswordLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, NULL, 0); + cred_dst->User = HeapAlloc(GetProcessHeap(), 0, cred_dst->UserLength * sizeof(WCHAR)); + cred_dst->Password = HeapAlloc(GetProcessHeap(), 0, cred_dst->PasswordLength * sizeof(WCHAR)); + cred_dst->Domain = HeapAlloc(GetProcessHeap(), 0, cred_dst->DomainLength * sizeof(WCHAR)); + if (!cred_dst || !cred_dst->Password || !cred_dst->Domain) goto error; + MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, cred_dst->User, cred_dst->UserLength); + MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, cred_dst->Domain, cred_dst->DomainLength); + MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, cred_dst->Password, cred_dst->PasswordLength); + } + } + if (http_credentials_src->NumberOfAuthnSchemes) + { + http_credentials_dst->AuthnSchemes = HeapAlloc(GetProcessHeap(), 0, http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes)); + if (!http_credentials_dst->AuthnSchemes) goto error; + memcpy(http_credentials_dst->AuthnSchemes, http_credentials_src->AuthnSchemes, http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes)); + } + if (http_credentials_src->ServerCertificateSubject) + { + if (unicode) + http_credentials_dst->ServerCertificateSubject = + RPCRT4_strndupW(http_credentials_src->ServerCertificateSubject, + strlenW(http_credentials_src->ServerCertificateSubject)); + else + http_credentials_dst->ServerCertificateSubject = + RPCRT4_strdupAtoW((char *)http_credentials_src->ServerCertificateSubject); + if (!http_credentials_dst->ServerCertificateSubject) goto error; + } + } + } + *qos_dst = qos; + return RPC_S_OK; + +error: + if (qos->qos) + { + if (qos->qos->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP && + qos->qos->u.HttpCredentials) + { + if (qos->qos->u.HttpCredentials->TransportCredentials) + { + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->User); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Domain); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Password); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials); + } + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->AuthnSchemes); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->ServerCertificateSubject); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials); + } + HeapFree(GetProcessHeap(), 0, qos->qos); + } + HeapFree(GetProcessHeap(), 0, qos); + return RPC_S_OUT_OF_RESOURCES; +} + +ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos) +{ + return InterlockedIncrement(&qos->refs); +} + +ULONG RpcQualityOfService_Release(RpcQualityOfService *qos) +{ + ULONG refs = InterlockedDecrement(&qos->refs); + + if (!refs) + { + if (qos->qos->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) + { + if (qos->qos->u.HttpCredentials->TransportCredentials) + { + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->User); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Domain); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials->Password); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->TransportCredentials); + } + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->AuthnSchemes); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials->ServerCertificateSubject); + HeapFree(GetProcessHeap(), 0, qos->qos->u.HttpCredentials); + } + HeapFree(GetProcessHeap(), 0, qos->qos); + HeapFree(GetProcessHeap(), 0, qos); + } + return refs; +} + +BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2) +{ + if (qos1 == qos2) + return TRUE; + + if (!qos1 || !qos2) + return FALSE; + + TRACE("qos1 = { %ld %ld %ld %ld }, qos2 = { %ld %ld %ld %ld }\n", + qos1->qos->Capabilities, qos1->qos->IdentityTracking, + qos1->qos->ImpersonationType, qos1->qos->AdditionalSecurityInfoType, + qos2->qos->Capabilities, qos2->qos->IdentityTracking, + qos2->qos->ImpersonationType, qos2->qos->AdditionalSecurityInfoType); + + if ((qos1->qos->Capabilities != qos2->qos->Capabilities) || + (qos1->qos->IdentityTracking != qos2->qos->IdentityTracking) || + (qos1->qos->ImpersonationType != qos2->qos->ImpersonationType) || + (qos1->qos->AdditionalSecurityInfoType != qos2->qos->AdditionalSecurityInfoType)) + return FALSE; + + if (qos1->qos->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) + { + const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials1 = qos1->qos->u.HttpCredentials; + const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials2 = qos2->qos->u.HttpCredentials; + + if (http_credentials1->Flags != http_credentials2->Flags) + return FALSE; + + if (http_credentials1->AuthenticationTarget != http_credentials2->AuthenticationTarget) + return FALSE; + + /* authentication schemes and server certificate subject not currently used */ + + if (http_credentials1->TransportCredentials != http_credentials2->TransportCredentials) + { + const SEC_WINNT_AUTH_IDENTITY_W *identity1 = http_credentials1->TransportCredentials; + const SEC_WINNT_AUTH_IDENTITY_W *identity2 = http_credentials2->TransportCredentials; + + if (!identity1 || !identity2) + return FALSE; + + /* compare user names */ + if (identity1->UserLength != identity2->UserLength || + memcmp(identity1->User, identity2->User, identity1->UserLength)) + return FALSE; + /* compare domain names */ + if (identity1->DomainLength != identity2->DomainLength || + memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength)) + return FALSE; + /* compare passwords */ + if (identity1->PasswordLength != identity2->PasswordLength || + memcmp(identity1->Password, identity2->Password, identity1->PasswordLength)) + return FALSE; + } + } + + return TRUE; +} + +/*********************************************************************** + * RpcRevertToSelf (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcRevertToSelf(void) +{ + FIXME("stub\n"); + RevertToSelf(); + return RPC_S_OK; +} + +/*********************************************************************** + * RpcMgmtSetComTimeout (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtSetComTimeout(RPC_BINDING_HANDLE BindingHandle, unsigned int Timeout) +{ + FIXME("(%p, %d): stub\n", BindingHandle, Timeout); + return RPC_S_OK; +} + +/*********************************************************************** + * RpcBindingInqAuthInfoExA (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingInqAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, + ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, + ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS ) +{ + FIXME("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel, + AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS); + return RPC_S_INVALID_BINDING; +} + +/*********************************************************************** + * RpcBindingInqAuthInfoExW (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingInqAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, + ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, + ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS ) +{ + FIXME("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel, + AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS); + return RPC_S_INVALID_BINDING; +} + +/*********************************************************************** + * RpcBindingInqAuthInfoA (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingInqAuthInfoA( RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, + ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc ) +{ + FIXME("%p %p %p %p %p %p\n", Binding, ServerPrincName, AuthnLevel, + AuthnSvc, AuthIdentity, AuthzSvc); + return RPC_S_INVALID_BINDING; +} + +/*********************************************************************** + * RpcBindingInqAuthInfoW (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingInqAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, + ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc ) +{ + FIXME("%p %p %p %p %p %p\n", Binding, ServerPrincName, AuthnLevel, + AuthnSvc, AuthIdentity, AuthzSvc); + return RPC_S_INVALID_BINDING; +} + +/*********************************************************************** + * RpcBindingSetAuthInfoExA (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingSetAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, + ULONG AuthnLevel, ULONG AuthnSvc, + RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, + RPC_SECURITY_QOS *SecurityQos ) +{ + RpcBinding* bind = (RpcBinding*)Binding; + SECURITY_STATUS r; + CredHandle cred; + TimeStamp exp; + ULONG package_count; + ULONG i; + PSecPkgInfoA packages; + ULONG cbMaxToken; + + TRACE("%p %s %u %u %p %u %p\n", Binding, debugstr_a((const char*)ServerPrincName), + AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos); + + if (SecurityQos) + { + RPC_STATUS status; + + TRACE("SecurityQos { Version=%ld, Capabilties=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld", + SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType); + if (SecurityQos->Version >= 2) + { + const RPC_SECURITY_QOS_V2_A *SecurityQos2 = (const RPC_SECURITY_QOS_V2_A *)SecurityQos; + TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType); + if (SecurityQos2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) + TRACE(", { %p, 0x%lx, %ld, %ld, %p, %s }", + SecurityQos2->u.HttpCredentials->TransportCredentials, + SecurityQos2->u.HttpCredentials->Flags, + SecurityQos2->u.HttpCredentials->AuthenticationTarget, + SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes, + SecurityQos2->u.HttpCredentials->AuthnSchemes, + SecurityQos2->u.HttpCredentials->ServerCertificateSubject); + } + TRACE("}\n"); + status = RpcQualityOfService_Create(SecurityQos, FALSE, &bind->QOS); + if (status != RPC_S_OK) + return status; + } + else + { + if (bind->QOS) RpcQualityOfService_Release(bind->QOS); + bind->QOS = NULL; + } + + if (AuthnSvc == RPC_C_AUTHN_DEFAULT) + AuthnSvc = RPC_C_AUTHN_WINNT; + + /* FIXME: the mapping should probably be retrieved using SSPI somehow */ + if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT) + AuthnLevel = RPC_C_AUTHN_LEVEL_NONE; + + if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE)) + { + if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); + bind->AuthInfo = NULL; + return RPC_S_OK; + } + + if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY) + { + FIXME("unknown AuthnLevel %u\n", AuthnLevel); + return RPC_S_UNKNOWN_AUTHN_LEVEL; + } + + if (AuthzSvr) + { + FIXME("unsupported AuthzSvr %u\n", AuthzSvr); + return RPC_S_UNKNOWN_AUTHZ_SERVICE; + } + + r = EnumerateSecurityPackagesA(&package_count, &packages); + if (r != SEC_E_OK) + { + ERR("EnumerateSecurityPackagesA failed with error 0x%08x\n", r); + return RPC_S_SEC_PKG_ERROR; + } + + for (i = 0; i < package_count; i++) + if (packages[i].wRPCID == AuthnSvc) + break; + + if (i == package_count) + { + FIXME("unsupported AuthnSvc %u\n", AuthnSvc); + FreeContextBuffer(packages); + return RPC_S_UNKNOWN_AUTHN_SERVICE; + } + + TRACE("found package %s for service %u\n", packages[i].Name, AuthnSvc); + r = AcquireCredentialsHandleA((SEC_CHAR *)ServerPrincName, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, + AuthIdentity, NULL, NULL, &cred, &exp); + cbMaxToken = packages[i].cbMaxToken; + FreeContextBuffer(packages); + if (r == ERROR_SUCCESS) + { + if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); + bind->AuthInfo = NULL; + r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken, + AuthIdentity, &bind->AuthInfo); + if (r != RPC_S_OK) + FreeCredentialsHandle(&cred); + return RPC_S_OK; + } + else + { + ERR("AcquireCredentialsHandleA failed with error 0x%08x\n", r); + return RPC_S_SEC_PKG_ERROR; + } +} + +/*********************************************************************** + * RpcBindingSetAuthInfoExW (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingSetAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, + ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, + RPC_SECURITY_QOS *SecurityQos ) +{ + RpcBinding* bind = (RpcBinding*)Binding; + SECURITY_STATUS r; + CredHandle cred; + TimeStamp exp; + ULONG package_count; + ULONG i; + PSecPkgInfoW packages; + ULONG cbMaxToken; + + TRACE("%p %s %u %u %p %u %p\n", Binding, debugstr_w((const WCHAR*)ServerPrincName), + AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos); + + if (SecurityQos) + { + RPC_STATUS status; + + TRACE("SecurityQos { Version=%ld, Capabilties=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld", + SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType); + if (SecurityQos->Version >= 2) + { + const RPC_SECURITY_QOS_V2_W *SecurityQos2 = (const RPC_SECURITY_QOS_V2_W *)SecurityQos; + TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType); + if (SecurityQos2->AdditionalSecurityInfoType == RPC_C_AUTHN_INFO_TYPE_HTTP) + TRACE(", { %p, 0x%lx, %ld, %ld, %p, %s }", + SecurityQos2->u.HttpCredentials->TransportCredentials, + SecurityQos2->u.HttpCredentials->Flags, + SecurityQos2->u.HttpCredentials->AuthenticationTarget, + SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes, + SecurityQos2->u.HttpCredentials->AuthnSchemes, + debugstr_w(SecurityQos2->u.HttpCredentials->ServerCertificateSubject)); + } + TRACE("}\n"); + status = RpcQualityOfService_Create(SecurityQos, TRUE, &bind->QOS); + if (status != RPC_S_OK) + return status; + } + else + { + if (bind->QOS) RpcQualityOfService_Release(bind->QOS); + bind->QOS = NULL; + } + + if (AuthnSvc == RPC_C_AUTHN_DEFAULT) + AuthnSvc = RPC_C_AUTHN_WINNT; + + /* FIXME: the mapping should probably be retrieved using SSPI somehow */ + if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT) + AuthnLevel = RPC_C_AUTHN_LEVEL_NONE; + + if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE)) + { + if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); + bind->AuthInfo = NULL; + return RPC_S_OK; + } + + if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY) + { + FIXME("unknown AuthnLevel %u\n", AuthnLevel); + return RPC_S_UNKNOWN_AUTHN_LEVEL; + } + + if (AuthzSvr) + { + FIXME("unsupported AuthzSvr %u\n", AuthzSvr); + return RPC_S_UNKNOWN_AUTHZ_SERVICE; + } + + r = EnumerateSecurityPackagesW(&package_count, &packages); + if (r != SEC_E_OK) + { + ERR("EnumerateSecurityPackagesA failed with error 0x%08x\n", r); + return RPC_S_SEC_PKG_ERROR; + } + + for (i = 0; i < package_count; i++) + if (packages[i].wRPCID == AuthnSvc) + break; + + if (i == package_count) + { + FIXME("unsupported AuthnSvc %u\n", AuthnSvc); + FreeContextBuffer(packages); + return RPC_S_UNKNOWN_AUTHN_SERVICE; + } + + TRACE("found package %s for service %u\n", debugstr_w(packages[i].Name), AuthnSvc); + r = AcquireCredentialsHandleW((SEC_WCHAR *)ServerPrincName, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, + AuthIdentity, NULL, NULL, &cred, &exp); + cbMaxToken = packages[i].cbMaxToken; + FreeContextBuffer(packages); + if (r == ERROR_SUCCESS) + { + if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); + bind->AuthInfo = NULL; + r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken, + AuthIdentity, &bind->AuthInfo); + if (r != RPC_S_OK) + FreeCredentialsHandle(&cred); + return RPC_S_OK; + } + else + { + ERR("AcquireCredentialsHandleA failed with error 0x%08x\n", r); + return RPC_S_SEC_PKG_ERROR; + } +} + +/*********************************************************************** + * RpcBindingSetAuthInfoA (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingSetAuthInfoA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, + ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr ) +{ + TRACE("%p %s %u %u %p %u\n", Binding, debugstr_a((const char*)ServerPrincName), + AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr); + return RpcBindingSetAuthInfoExA(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL); +} + +/*********************************************************************** + * RpcBindingSetAuthInfoW (RPCRT4.@) + */ +RPCRTAPI RPC_STATUS RPC_ENTRY +RpcBindingSetAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, + ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr ) +{ + TRACE("%p %s %u %u %p %u\n", Binding, debugstr_w((const WCHAR*)ServerPrincName), + AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr); + return RpcBindingSetAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL); +} + +/*********************************************************************** + * RpcBindingSetOption (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcBindingSetOption(RPC_BINDING_HANDLE BindingHandle, ULONG Option, ULONG OptionValue) +{ + FIXME("(%p, %d, %d): stub\n", BindingHandle, Option, OptionValue); + return RPC_S_OK; +} diff --git a/reactos/dll/win32/rpcrt4_new/rpc_binding.h b/reactos/dll/win32/rpcrt4_new/rpc_binding.h index f01ae6e84a6..a8721a72549 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_binding.h +++ b/reactos/dll/win32/rpcrt4_new/rpc_binding.h @@ -1,202 +1,202 @@ -/* - * RPC binding API - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_RPC_BINDING_H -#define __WINE_RPC_BINDING_H - -#include "wine/rpcss_shared.h" -#include "security.h" -#include "wine/list.h" - - -typedef struct _RpcAuthInfo -{ - LONG refs; - - ULONG AuthnLevel; - ULONG AuthnSvc; - CredHandle cred; - TimeStamp exp; - ULONG cbMaxToken; - /* the auth identity pointer that the application passed us (freed by application) */ - RPC_AUTH_IDENTITY_HANDLE *identity; - /* our copy of NT auth identity structure, if the authentication service - * takes an NT auth identity */ - SEC_WINNT_AUTH_IDENTITY_W *nt_identity; -} RpcAuthInfo; - -typedef struct _RpcQualityOfService -{ - LONG refs; - - RPC_SECURITY_QOS_V2_W *qos; -} RpcQualityOfService; - -typedef struct _RpcAssoc -{ - struct list entry; /* entry in the global list of associations */ - LONG refs; - - LPSTR Protseq; - LPSTR NetworkAddr; - LPSTR Endpoint; - LPWSTR NetworkOptions; - - /* id of this association group */ - ULONG assoc_group_id; - - CRITICAL_SECTION cs; - struct list connection_pool; -} RpcAssoc; - -struct connection_ops; - -typedef struct _RpcConnection -{ - struct _RpcConnection* Next; - BOOL server; - LPSTR NetworkAddr; - LPSTR Endpoint; - LPWSTR NetworkOptions; - const struct connection_ops *ops; - USHORT MaxTransmissionSize; - /* The active interface bound to server. */ - RPC_SYNTAX_IDENTIFIER ActiveInterface; - USHORT NextCallId; - - /* authentication */ - CtxtHandle ctx; - TimeStamp exp; - ULONG attr; - RpcAuthInfo *AuthInfo; - ULONG encryption_auth_len; - ULONG signature_auth_len; - RpcQualityOfService *QOS; - - /* client-only */ - struct list conn_pool_entry; - ULONG assoc_group_id; /* association group returned during binding */ -} RpcConnection; - -struct connection_ops { - const char *name; - unsigned char epm_protocols[2]; /* only floors 3 and 4. see http://www.opengroup.org/onlinepubs/9629399/apdxl.htm */ - RpcConnection *(*alloc)(void); - RPC_STATUS (*open_connection_client)(RpcConnection *conn); - RPC_STATUS (*handoff)(RpcConnection *old_conn, RpcConnection *new_conn); - int (*read)(RpcConnection *conn, void *buffer, unsigned int len); - int (*write)(RpcConnection *conn, const void *buffer, unsigned int len); - int (*close)(RpcConnection *conn); - size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint); - RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint); -}; - -/* don't know what MS's structure looks like */ -typedef struct _RpcBinding -{ - LONG refs; - struct _RpcBinding* Next; - BOOL server; - UUID ObjectUuid; - LPSTR Protseq; - LPSTR NetworkAddr; - LPSTR Endpoint; - LPWSTR NetworkOptions; - RPC_BLOCKING_FN BlockingFn; - ULONG ServerTid; - RpcConnection* FromConn; - RpcAssoc *Assoc; - - /* authentication */ - RpcAuthInfo *AuthInfo; - RpcQualityOfService *QOS; -} RpcBinding; - -LPSTR RPCRT4_strndupA(LPCSTR src, INT len); -LPWSTR RPCRT4_strndupW(LPCWSTR src, INT len); -LPSTR RPCRT4_strdupWtoA(LPCWSTR src); -LPWSTR RPCRT4_strdupAtoW(LPCSTR src); -void RPCRT4_strfree(LPSTR src); - -#define RPCRT4_strdupA(x) RPCRT4_strndupA((x),-1) -#define RPCRT4_strdupW(x) RPCRT4_strndupW((x),-1) - -ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo); -ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo); -BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2); -ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos); -ULONG RpcQualityOfService_Release(RpcQualityOfService *qos); -BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2); - -RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAssoc **assoc); -RPC_STATUS RpcAssoc_GetClientConnection(RpcAssoc *assoc, const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, RpcAuthInfo *AuthInfo, RpcQualityOfService *QOS, RpcConnection **Connection); -void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection); -ULONG RpcAssoc_Release(RpcAssoc *assoc); - -RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS); -RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection); -RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection); -RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection); -RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection); - -RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint); -RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid); -RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection); -RPC_STATUS RPCRT4_ExportBinding(RpcBinding** Binding, RpcBinding* OldBinding); -RPC_STATUS RPCRT4_DestroyBinding(RpcBinding* Binding); -RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, - const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId); -RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection); -BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPCSS_NP_REPLY reply); -HANDLE RPCRT4_GetMasterMutex(void); -HANDLE RPCRT4_RpcssNPConnect(void); - -static inline const char *rpcrt4_conn_get_name(const RpcConnection *Connection) -{ - return Connection->ops->name; -} - -static inline int rpcrt4_conn_read(RpcConnection *Connection, - void *buffer, unsigned int len) -{ - return Connection->ops->read(Connection, buffer, len); -} - -static inline int rpcrt4_conn_write(RpcConnection *Connection, - const void *buffer, unsigned int len) -{ - return Connection->ops->write(Connection, buffer, len); -} - -static inline int rpcrt4_conn_close(RpcConnection *Connection) -{ - return Connection->ops->close(Connection); -} - -static inline RPC_STATUS rpcrt4_conn_handoff(RpcConnection *old_conn, RpcConnection *new_conn) -{ - return old_conn->ops->handoff(old_conn, new_conn); -} - -/* floors 3 and up */ -RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint); -RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint); - -#endif +/* + * RPC binding API + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_RPC_BINDING_H +#define __WINE_RPC_BINDING_H + +#include "wine/rpcss_shared.h" +#include "security.h" +#include "wine/list.h" + + +typedef struct _RpcAuthInfo +{ + LONG refs; + + ULONG AuthnLevel; + ULONG AuthnSvc; + CredHandle cred; + TimeStamp exp; + ULONG cbMaxToken; + /* the auth identity pointer that the application passed us (freed by application) */ + RPC_AUTH_IDENTITY_HANDLE *identity; + /* our copy of NT auth identity structure, if the authentication service + * takes an NT auth identity */ + SEC_WINNT_AUTH_IDENTITY_W *nt_identity; +} RpcAuthInfo; + +typedef struct _RpcQualityOfService +{ + LONG refs; + + RPC_SECURITY_QOS_V2_W *qos; +} RpcQualityOfService; + +typedef struct _RpcAssoc +{ + struct list entry; /* entry in the global list of associations */ + LONG refs; + + LPSTR Protseq; + LPSTR NetworkAddr; + LPSTR Endpoint; + LPWSTR NetworkOptions; + + /* id of this association group */ + ULONG assoc_group_id; + + CRITICAL_SECTION cs; + struct list connection_pool; +} RpcAssoc; + +struct connection_ops; + +typedef struct _RpcConnection +{ + struct _RpcConnection* Next; + BOOL server; + LPSTR NetworkAddr; + LPSTR Endpoint; + LPWSTR NetworkOptions; + const struct connection_ops *ops; + USHORT MaxTransmissionSize; + /* The active interface bound to server. */ + RPC_SYNTAX_IDENTIFIER ActiveInterface; + USHORT NextCallId; + + /* authentication */ + CtxtHandle ctx; + TimeStamp exp; + ULONG attr; + RpcAuthInfo *AuthInfo; + ULONG encryption_auth_len; + ULONG signature_auth_len; + RpcQualityOfService *QOS; + + /* client-only */ + struct list conn_pool_entry; + ULONG assoc_group_id; /* association group returned during binding */ +} RpcConnection; + +struct connection_ops { + const char *name; + unsigned char epm_protocols[2]; /* only floors 3 and 4. see http://www.opengroup.org/onlinepubs/9629399/apdxl.htm */ + RpcConnection *(*alloc)(void); + RPC_STATUS (*open_connection_client)(RpcConnection *conn); + RPC_STATUS (*handoff)(RpcConnection *old_conn, RpcConnection *new_conn); + int (*read)(RpcConnection *conn, void *buffer, unsigned int len); + int (*write)(RpcConnection *conn, const void *buffer, unsigned int len); + int (*close)(RpcConnection *conn); + size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint); + RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint); +}; + +/* don't know what MS's structure looks like */ +typedef struct _RpcBinding +{ + LONG refs; + struct _RpcBinding* Next; + BOOL server; + UUID ObjectUuid; + LPSTR Protseq; + LPSTR NetworkAddr; + LPSTR Endpoint; + LPWSTR NetworkOptions; + RPC_BLOCKING_FN BlockingFn; + ULONG ServerTid; + RpcConnection* FromConn; + RpcAssoc *Assoc; + + /* authentication */ + RpcAuthInfo *AuthInfo; + RpcQualityOfService *QOS; +} RpcBinding; + +LPSTR RPCRT4_strndupA(LPCSTR src, INT len); +LPWSTR RPCRT4_strndupW(LPCWSTR src, INT len); +LPSTR RPCRT4_strdupWtoA(LPCWSTR src); +LPWSTR RPCRT4_strdupAtoW(LPCSTR src); +void RPCRT4_strfree(LPSTR src); + +#define RPCRT4_strdupA(x) RPCRT4_strndupA((x),-1) +#define RPCRT4_strdupW(x) RPCRT4_strndupW((x),-1) + +ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo); +ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo); +BOOL RpcAuthInfo_IsEqual(const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2); +ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos); +ULONG RpcQualityOfService_Release(RpcQualityOfService *qos); +BOOL RpcQualityOfService_IsEqual(const RpcQualityOfService *qos1, const RpcQualityOfService *qos2); + +RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAssoc **assoc); +RPC_STATUS RpcAssoc_GetClientConnection(RpcAssoc *assoc, const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, RpcAuthInfo *AuthInfo, RpcQualityOfService *QOS, RpcConnection **Connection); +void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection); +ULONG RpcAssoc_Release(RpcAssoc *assoc); + +RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS); +RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection); +RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection); +RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection); +RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection); + +RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint); +RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid); +RPC_STATUS RPCRT4_MakeBinding(RpcBinding** Binding, RpcConnection* Connection); +RPC_STATUS RPCRT4_ExportBinding(RpcBinding** Binding, RpcBinding* OldBinding); +RPC_STATUS RPCRT4_DestroyBinding(RpcBinding* Binding); +RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, + const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId); +RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection); +BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPCSS_NP_REPLY reply); +HANDLE RPCRT4_GetMasterMutex(void); +HANDLE RPCRT4_RpcssNPConnect(void); + +static inline const char *rpcrt4_conn_get_name(const RpcConnection *Connection) +{ + return Connection->ops->name; +} + +static inline int rpcrt4_conn_read(RpcConnection *Connection, + void *buffer, unsigned int len) +{ + return Connection->ops->read(Connection, buffer, len); +} + +static inline int rpcrt4_conn_write(RpcConnection *Connection, + const void *buffer, unsigned int len) +{ + return Connection->ops->write(Connection, buffer, len); +} + +static inline int rpcrt4_conn_close(RpcConnection *Connection) +{ + return Connection->ops->close(Connection); +} + +static inline RPC_STATUS rpcrt4_conn_handoff(RpcConnection *old_conn, RpcConnection *new_conn) +{ + return old_conn->ops->handoff(old_conn, new_conn); +} + +/* floors 3 and up */ +RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint); +RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint); + +#endif diff --git a/reactos/dll/win32/rpcrt4_new/rpc_defs.h b/reactos/dll/win32/rpcrt4_new/rpc_defs.h index c0c3609f1cc..dd702b06e1d 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_defs.h +++ b/reactos/dll/win32/rpcrt4_new/rpc_defs.h @@ -1,212 +1,212 @@ -/* - * RPC definitions - * - * Copyright 2001-2002 Ove Kåven, TransGaming Technologies - * Copyright 2004 Filip Navara - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_RPC_DEFS_H -#define __WINE_RPC_DEFS_H - -/* info from http://www.microsoft.com/msj/0398/dcomtextfigs.htm */ - -typedef struct -{ - unsigned char rpc_ver; /* RPC major version (5) */ - unsigned char rpc_ver_minor; /* RPC minor version (0) */ - unsigned char ptype; /* Packet type (PKT_*) */ - unsigned char flags; - unsigned char drep[4]; /* Data representation */ - unsigned short frag_len; /* Data size in bytes including header and tail. */ - unsigned short auth_len; /* Authentication length */ - unsigned long call_id; /* Call identifier. */ -} RpcPktCommonHdr; - -typedef struct -{ - RpcPktCommonHdr common; - unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */ - unsigned short context_id; /* Presentation context identifier */ - unsigned short opnum; -} RpcPktRequestHdr; - -typedef struct -{ - RpcPktCommonHdr common; - unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */ - unsigned short context_id; /* Presentation context identifier */ - unsigned char cancel_count; - unsigned char reserved; -} RpcPktResponseHdr; - -typedef struct -{ - RpcPktCommonHdr common; - unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */ - unsigned short context_id; /* Presentation context identifier */ - unsigned char cancel_count; /* Received cancel count */ - unsigned char reserved; /* Force alignment! */ - unsigned long status; /* Runtime fault code (RPC_STATUS) */ - unsigned long reserved2; -} RpcPktFaultHdr; - -typedef struct -{ - RpcPktCommonHdr common; - unsigned short max_tsize; /* Maximum transmission fragment size */ - unsigned short max_rsize; /* Maximum receive fragment size */ - unsigned long assoc_gid; /* Associated group id */ - unsigned char num_elements; /* Number of elements */ - unsigned char padding[3]; /* Force alignment! */ - unsigned short context_id; /* Presentation context identifier */ - unsigned char num_syntaxes; /* Number of syntaxes */ - RPC_SYNTAX_IDENTIFIER abstract; - RPC_SYNTAX_IDENTIFIER transfer; -} RpcPktBindHdr; - -#include "pshpack1.h" -typedef struct -{ - unsigned short length; /* Length of the string including null terminator */ - char string[1]; /* String data in single byte, null terminated form */ -} RpcAddressString; -#include "poppack.h" - -typedef struct -{ - unsigned char num_results; /* Number of results */ - unsigned char reserved[3]; /* Force alignment! */ - struct { - unsigned short result; - unsigned short reason; - } results[1]; -} RpcResults; - -typedef struct -{ - RpcPktCommonHdr common; - unsigned short max_tsize; /* Maximum transmission fragment size */ - unsigned short max_rsize; /* Maximum receive fragment size */ - unsigned long assoc_gid; /* Associated group id */ - /* - * Following this header are these fields: - * RpcAddressString server_address; - * [0 - 3 bytes of padding so that results is 4-byte aligned] - * RpcResults results; - * RPC_SYNTAX_IDENTIFIER transfer; - */ -} RpcPktBindAckHdr; - -typedef struct -{ - RpcPktCommonHdr common; - unsigned short reject_reason; - unsigned char protocols_count; - struct { - unsigned char rpc_ver; - unsigned char rpc_ver_minor; - } protocols[1]; -} RpcPktBindNAckHdr; - -/* Union representing all possible packet headers */ -typedef union -{ - RpcPktCommonHdr common; - RpcPktRequestHdr request; - RpcPktResponseHdr response; - RpcPktFaultHdr fault; - RpcPktBindHdr bind; - RpcPktBindAckHdr bind_ack; - RpcPktBindNAckHdr bind_nack; -} RpcPktHdr; - -typedef struct -{ - unsigned char auth_type; /* authentication scheme in use */ - unsigned char auth_level; /* RPC_C_AUTHN_LEVEL* */ - unsigned char auth_pad_length; /* length of padding to restore n % 4 alignment */ - unsigned char auth_reserved; /* reserved, must be zero */ - unsigned long auth_context_id; /* unique value for the authenticated connection */ -} RpcAuthVerifier; - -#define RPC_AUTH_VERIFIER_LEN(common_hdr) \ - ((common_hdr)->auth_len ? (common_hdr)->auth_len + sizeof(RpcAuthVerifier) : 0) - -#define RPC_VER_MAJOR 5 -#define RPC_VER_MINOR 0 - -#define RPC_FLG_FIRST 1 -#define RPC_FLG_LAST 2 -#define RPC_FLG_OBJECT_UUID 0x80 - -#define RPC_MIN_PACKET_SIZE 0x1000 -#define RPC_MAX_PACKET_SIZE 0x16D0 - -#define PKT_REQUEST 0 -#define PKT_PING 1 -#define PKT_RESPONSE 2 -#define PKT_FAULT 3 -#define PKT_WORKING 4 -#define PKT_NOCALL 5 -#define PKT_REJECT 6 -#define PKT_ACK 7 -#define PKT_CL_CANCEL 8 -#define PKT_FACK 9 -#define PKT_CANCEL_ACK 10 -#define PKT_BIND 11 -#define PKT_BIND_ACK 12 -#define PKT_BIND_NACK 13 -#define PKT_ALTER_CONTEXT 14 -#define PKT_ALTER_CONTEXT_RESP 15 -#define PKT_AUTH3 16 -#define PKT_SHUTDOWN 17 -#define PKT_CO_CANCEL 18 -#define PKT_ORPHANED 19 - -#define RESULT_ACCEPT 0 -#define RESULT_USER_REJECTION 1 -#define RESULT_PROVIDER_REJECTION 2 - -#define REASON_NONE 0 -#define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED 1 -#define REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED 2 -#define REASON_LOCAL_LIMIT_EXCEEDED 3 - -#define REJECT_REASON_NOT_SPECIFIED 0 -#define REJECT_TEMPORARY_CONGESTION 1 -#define REJECT_LOCAL_LIMIT_EXCEEDED 2 -#define REJECT_CALLED_PADDR_UNKNOWN 3 /* not used */ -#define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED 4 -#define REJECT_DEFAULT_CONTEXT_NOT_SUPPORTED 5 /* not used */ -#define REJECT_USER_DATA_NOT_READABLE 6 /* not used */ -#define REJECT_NO_PSAP_AVAILABLE 7 /* not used */ -#define REJECT_UNKNOWN_AUTHN_SERVICE 8 -#define REJECT_INVALID_CHECKSUM 9 - -#define NCADG_IP_UDP 0x08 -#define NCACN_IP_TCP 0x07 -#define NCADG_IPX 0x0E -#define NCACN_SPX 0x0C -#define NCACN_NB_NB 0x12 -#define NCACN_NB_IPX 0x0D -#define NCACN_DNET_NSP 0x04 -#define NCACN_HTTP 0x1F - -/* FreeDCE: TWR_C_FLR_PROT_ID_IP */ -#define TWR_IP 0x09 - -#endif /* __WINE_RPC_DEFS_H */ +/* + * RPC definitions + * + * Copyright 2001-2002 Ove Kåven, TransGaming Technologies + * Copyright 2004 Filip Navara + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_RPC_DEFS_H +#define __WINE_RPC_DEFS_H + +/* info from http://www.microsoft.com/msj/0398/dcomtextfigs.htm */ + +typedef struct +{ + unsigned char rpc_ver; /* RPC major version (5) */ + unsigned char rpc_ver_minor; /* RPC minor version (0) */ + unsigned char ptype; /* Packet type (PKT_*) */ + unsigned char flags; + unsigned char drep[4]; /* Data representation */ + unsigned short frag_len; /* Data size in bytes including header and tail. */ + unsigned short auth_len; /* Authentication length */ + unsigned long call_id; /* Call identifier. */ +} RpcPktCommonHdr; + +typedef struct +{ + RpcPktCommonHdr common; + unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */ + unsigned short context_id; /* Presentation context identifier */ + unsigned short opnum; +} RpcPktRequestHdr; + +typedef struct +{ + RpcPktCommonHdr common; + unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */ + unsigned short context_id; /* Presentation context identifier */ + unsigned char cancel_count; + unsigned char reserved; +} RpcPktResponseHdr; + +typedef struct +{ + RpcPktCommonHdr common; + unsigned long alloc_hint; /* Data size in bytes excluding header and tail. */ + unsigned short context_id; /* Presentation context identifier */ + unsigned char cancel_count; /* Received cancel count */ + unsigned char reserved; /* Force alignment! */ + unsigned long status; /* Runtime fault code (RPC_STATUS) */ + unsigned long reserved2; +} RpcPktFaultHdr; + +typedef struct +{ + RpcPktCommonHdr common; + unsigned short max_tsize; /* Maximum transmission fragment size */ + unsigned short max_rsize; /* Maximum receive fragment size */ + unsigned long assoc_gid; /* Associated group id */ + unsigned char num_elements; /* Number of elements */ + unsigned char padding[3]; /* Force alignment! */ + unsigned short context_id; /* Presentation context identifier */ + unsigned char num_syntaxes; /* Number of syntaxes */ + RPC_SYNTAX_IDENTIFIER abstract; + RPC_SYNTAX_IDENTIFIER transfer; +} RpcPktBindHdr; + +#include "pshpack1.h" +typedef struct +{ + unsigned short length; /* Length of the string including null terminator */ + char string[1]; /* String data in single byte, null terminated form */ +} RpcAddressString; +#include "poppack.h" + +typedef struct +{ + unsigned char num_results; /* Number of results */ + unsigned char reserved[3]; /* Force alignment! */ + struct { + unsigned short result; + unsigned short reason; + } results[1]; +} RpcResults; + +typedef struct +{ + RpcPktCommonHdr common; + unsigned short max_tsize; /* Maximum transmission fragment size */ + unsigned short max_rsize; /* Maximum receive fragment size */ + unsigned long assoc_gid; /* Associated group id */ + /* + * Following this header are these fields: + * RpcAddressString server_address; + * [0 - 3 bytes of padding so that results is 4-byte aligned] + * RpcResults results; + * RPC_SYNTAX_IDENTIFIER transfer; + */ +} RpcPktBindAckHdr; + +typedef struct +{ + RpcPktCommonHdr common; + unsigned short reject_reason; + unsigned char protocols_count; + struct { + unsigned char rpc_ver; + unsigned char rpc_ver_minor; + } protocols[1]; +} RpcPktBindNAckHdr; + +/* Union representing all possible packet headers */ +typedef union +{ + RpcPktCommonHdr common; + RpcPktRequestHdr request; + RpcPktResponseHdr response; + RpcPktFaultHdr fault; + RpcPktBindHdr bind; + RpcPktBindAckHdr bind_ack; + RpcPktBindNAckHdr bind_nack; +} RpcPktHdr; + +typedef struct +{ + unsigned char auth_type; /* authentication scheme in use */ + unsigned char auth_level; /* RPC_C_AUTHN_LEVEL* */ + unsigned char auth_pad_length; /* length of padding to restore n % 4 alignment */ + unsigned char auth_reserved; /* reserved, must be zero */ + unsigned long auth_context_id; /* unique value for the authenticated connection */ +} RpcAuthVerifier; + +#define RPC_AUTH_VERIFIER_LEN(common_hdr) \ + ((common_hdr)->auth_len ? (common_hdr)->auth_len + sizeof(RpcAuthVerifier) : 0) + +#define RPC_VER_MAJOR 5 +#define RPC_VER_MINOR 0 + +#define RPC_FLG_FIRST 1 +#define RPC_FLG_LAST 2 +#define RPC_FLG_OBJECT_UUID 0x80 + +#define RPC_MIN_PACKET_SIZE 0x1000 +#define RPC_MAX_PACKET_SIZE 0x16D0 + +#define PKT_REQUEST 0 +#define PKT_PING 1 +#define PKT_RESPONSE 2 +#define PKT_FAULT 3 +#define PKT_WORKING 4 +#define PKT_NOCALL 5 +#define PKT_REJECT 6 +#define PKT_ACK 7 +#define PKT_CL_CANCEL 8 +#define PKT_FACK 9 +#define PKT_CANCEL_ACK 10 +#define PKT_BIND 11 +#define PKT_BIND_ACK 12 +#define PKT_BIND_NACK 13 +#define PKT_ALTER_CONTEXT 14 +#define PKT_ALTER_CONTEXT_RESP 15 +#define PKT_AUTH3 16 +#define PKT_SHUTDOWN 17 +#define PKT_CO_CANCEL 18 +#define PKT_ORPHANED 19 + +#define RESULT_ACCEPT 0 +#define RESULT_USER_REJECTION 1 +#define RESULT_PROVIDER_REJECTION 2 + +#define REASON_NONE 0 +#define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED 1 +#define REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED 2 +#define REASON_LOCAL_LIMIT_EXCEEDED 3 + +#define REJECT_REASON_NOT_SPECIFIED 0 +#define REJECT_TEMPORARY_CONGESTION 1 +#define REJECT_LOCAL_LIMIT_EXCEEDED 2 +#define REJECT_CALLED_PADDR_UNKNOWN 3 /* not used */ +#define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED 4 +#define REJECT_DEFAULT_CONTEXT_NOT_SUPPORTED 5 /* not used */ +#define REJECT_USER_DATA_NOT_READABLE 6 /* not used */ +#define REJECT_NO_PSAP_AVAILABLE 7 /* not used */ +#define REJECT_UNKNOWN_AUTHN_SERVICE 8 +#define REJECT_INVALID_CHECKSUM 9 + +#define NCADG_IP_UDP 0x08 +#define NCACN_IP_TCP 0x07 +#define NCADG_IPX 0x0E +#define NCACN_SPX 0x0C +#define NCACN_NB_NB 0x12 +#define NCACN_NB_IPX 0x0D +#define NCACN_DNET_NSP 0x04 +#define NCACN_HTTP 0x1F + +/* FreeDCE: TWR_C_FLR_PROT_ID_IP */ +#define TWR_IP 0x09 + +#endif /* __WINE_RPC_DEFS_H */ diff --git a/reactos/dll/win32/rpcrt4_new/rpc_epmap.c b/reactos/dll/win32/rpcrt4_new/rpc_epmap.c index cac3f626c1a..7da16753c82 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_epmap.c +++ b/reactos/dll/win32/rpcrt4_new/rpc_epmap.c @@ -1,384 +1,384 @@ -/* - * RPC endpoint mapper - * - * Copyright 2002 Greg Turner - * Copyright 2001 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * TODO: - * - actually do things right - */ - -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - -#include "rpc.h" - -#include "wine/debug.h" - -#include "rpc_binding.h" -#include "epm_towers.h" - -WINE_DEFAULT_DEBUG_CHANNEL(ole); - -/* The "real" RPC portmapper endpoints that I know of are: - * - * ncadg_ip_udp: 135 - * ncacn_ip_tcp: 135 - * ncacn_np: \\pipe\epmapper (?) - * ncalrpc: epmapper - * - * If the user's machine ran a DCE RPC daemon, it would - * probably be possible to connect to it, but there are many - * reasons not to, like: - * - the user probably does *not* run one, and probably - * shouldn't be forced to run one just for local COM - * - very few Unix systems use DCE RPC... if they run a RPC - * daemon at all, it's usually Sun RPC - * - DCE RPC registrations are persistent and saved on disk, - * while MS-RPC registrations are documented as non-persistent - * and stored only in RAM, and auto-destroyed when the process - * dies (something DCE RPC can't do) - * - * Of course, if the user *did* want to run a DCE RPC daemon anyway, - * there would be interoperability advantages, like the possibility - * of running a fully functional DCOM server using Wine... - */ - -/*********************************************************************** - * RpcEpRegisterA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, - UUID_VECTOR *UuidVector, RPC_CSTR Annotation ) -{ - RPCSS_NP_MESSAGE msg; - RPCSS_NP_REPLY reply; - char *vardata_payload, *vp; - PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; - unsigned long c; - RPC_STATUS rslt = RPC_S_OK; - - TRACE("(%p,%p,%p,%s)\n", IfSpec, BindingVector, UuidVector, debugstr_a((char*)Annotation)); - TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID)); - for (c=0; cCount; c++) { - RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[c]); - TRACE(" protseq[%ld]=%s\n", c, debugstr_a(bind->Protseq)); - TRACE(" endpoint[%ld]=%s\n", c, debugstr_a(bind->Endpoint)); - } - if (UuidVector) { - for (c=0; cCount; c++) - TRACE(" obj[%ld]=%s\n", c, debugstr_guid(UuidVector->Uuid[c])); - } - - /* FIXME: Do something with annotation. */ - - /* construct the message to rpcss */ - msg.message_type = RPCSS_NP_MESSAGE_TYPEID_REGISTEREPMSG; - msg.message.registerepmsg.iface = If->InterfaceId; - msg.message.registerepmsg.no_replace = 0; - - msg.message.registerepmsg.object_count = (UuidVector) ? UuidVector->Count : 0; - msg.message.registerepmsg.binding_count = BindingVector->Count; - - /* calculate vardata payload size */ - msg.vardata_payload_size = msg.message.registerepmsg.object_count * sizeof(UUID); - for (c=0; c < msg.message.registerepmsg.binding_count; c++) { - RpcBinding *bind = (RpcBinding *)(BindingVector->BindingH[c]); - msg.vardata_payload_size += strlen(bind->Protseq) + 1; - msg.vardata_payload_size += strlen(bind->Endpoint) + 1; - } - - /* allocate the payload buffer */ - vp = vardata_payload = LocalAlloc(LPTR, msg.vardata_payload_size); - if (!vardata_payload) - return RPC_S_OUT_OF_MEMORY; - - /* populate the payload data */ - for (c=0; c < msg.message.registerepmsg.object_count; c++) { - CopyMemory(vp, UuidVector->Uuid[c], sizeof(UUID)); - vp += sizeof(UUID); - } - - for (c=0; c < msg.message.registerepmsg.binding_count; c++) { - RpcBinding *bind = (RpcBinding*)(BindingVector->BindingH[c]); - unsigned long pslen = strlen(bind->Protseq) + 1, eplen = strlen(bind->Endpoint) + 1; - CopyMemory(vp, bind->Protseq, pslen); - vp += pslen; - CopyMemory(vp, bind->Endpoint, eplen); - vp += eplen; - } - - /* send our request */ - if (!RPCRT4_RPCSSOnDemandCall(&msg, vardata_payload, &reply)) - rslt = RPC_S_OUT_OF_MEMORY; - - /* free the payload buffer */ - LocalFree(vardata_payload); - - return rslt; -} - -/*********************************************************************** - * RpcEpUnregister (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcEpUnregister( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, - UUID_VECTOR *UuidVector ) -{ - RPCSS_NP_MESSAGE msg; - RPCSS_NP_REPLY reply; - char *vardata_payload, *vp; - PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; - unsigned long c; - RPC_STATUS rslt = RPC_S_OK; - - TRACE("(%p,%p,%p)\n", IfSpec, BindingVector, UuidVector); - TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID)); - for (c=0; cCount; c++) { - RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[c]); - TRACE(" protseq[%ld]=%s\n", c, debugstr_a(bind->Protseq)); - TRACE(" endpoint[%ld]=%s\n", c, debugstr_a(bind->Endpoint)); - } - if (UuidVector) { - for (c=0; cCount; c++) - TRACE(" obj[%ld]=%s\n", c, debugstr_guid(UuidVector->Uuid[c])); - } - - /* construct the message to rpcss */ - msg.message_type = RPCSS_NP_MESSAGE_TYPEID_UNREGISTEREPMSG; - msg.message.unregisterepmsg.iface = If->InterfaceId; - - msg.message.unregisterepmsg.object_count = (UuidVector) ? UuidVector->Count : 0; - msg.message.unregisterepmsg.binding_count = BindingVector->Count; - - /* calculate vardata payload size */ - msg.vardata_payload_size = msg.message.unregisterepmsg.object_count * sizeof(UUID); - for (c=0; c < msg.message.unregisterepmsg.binding_count; c++) { - RpcBinding *bind = (RpcBinding *)(BindingVector->BindingH[c]); - msg.vardata_payload_size += strlen(bind->Protseq) + 1; - msg.vardata_payload_size += strlen(bind->Endpoint) + 1; - } - - /* allocate the payload buffer */ - vp = vardata_payload = LocalAlloc(LPTR, msg.vardata_payload_size); - if (!vardata_payload) - return RPC_S_OUT_OF_MEMORY; - - /* populate the payload data */ - for (c=0; c < msg.message.unregisterepmsg.object_count; c++) { - CopyMemory(vp, UuidVector->Uuid[c], sizeof(UUID)); - vp += sizeof(UUID); - } - - for (c=0; c < msg.message.unregisterepmsg.binding_count; c++) { - RpcBinding *bind = (RpcBinding*)(BindingVector->BindingH[c]); - unsigned long pslen = strlen(bind->Protseq) + 1, eplen = strlen(bind->Endpoint) + 1; - CopyMemory(vp, bind->Protseq, pslen); - vp += pslen; - CopyMemory(vp, bind->Endpoint, eplen); - vp += eplen; - } - - /* send our request */ - if (!RPCRT4_RPCSSOnDemandCall(&msg, vardata_payload, &reply)) - rslt = RPC_S_OUT_OF_MEMORY; - - /* free the payload buffer */ - LocalFree(vardata_payload); - - return rslt; -} - -/*********************************************************************** - * RpcEpResolveBinding (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec ) -{ - RPCSS_NP_MESSAGE msg; - RPCSS_NP_REPLY reply; - PRPC_CLIENT_INTERFACE If = (PRPC_CLIENT_INTERFACE)IfSpec; - RpcBinding* bind = (RpcBinding*)Binding; - - TRACE("(%p,%p)\n", Binding, IfSpec); - TRACE(" protseq=%s\n", debugstr_a(bind->Protseq)); - TRACE(" obj=%s\n", debugstr_guid(&bind->ObjectUuid)); - TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID)); - - /* FIXME: totally untested */ - - /* just return for fully bound handles */ - if (bind->Endpoint && (bind->Endpoint[0] != '\0')) - return RPC_S_OK; - - /* construct the message to rpcss */ - msg.message_type = RPCSS_NP_MESSAGE_TYPEID_RESOLVEEPMSG; - msg.message.resolveepmsg.iface = If->InterfaceId; - msg.message.resolveepmsg.object = bind->ObjectUuid; - - msg.vardata_payload_size = strlen(bind->Protseq) + 1; - - /* send the message */ - if (!RPCRT4_RPCSSOnDemandCall(&msg, bind->Protseq, &reply)) - return RPC_S_OUT_OF_MEMORY; - - /* empty-string result means not registered */ - if (reply.as_string[0] == '\0') - return EPT_S_NOT_REGISTERED; - - /* otherwise we fully bind the handle & return RPC_S_OK */ - return RPCRT4_ResolveBinding(Binding, reply.as_string); -} - -typedef unsigned int unsigned32; -typedef struct twr_t - { - unsigned32 tower_length; - /* [size_is] */ BYTE tower_octet_string[ 1 ]; - } twr_t; - -/*********************************************************************** - * TowerExplode (RPCRT4.@) - */ -RPC_STATUS WINAPI TowerExplode( - const twr_t *tower, PRPC_SYNTAX_IDENTIFIER object, PRPC_SYNTAX_IDENTIFIER syntax, - char **protseq, char **endpoint, char **address) -{ - size_t tower_size; - RPC_STATUS status; - const unsigned char *p; - u_int16 floor_count; - const twr_uuid_floor_t *object_floor; - const twr_uuid_floor_t *syntax_floor; - - if (protseq) - *protseq = NULL; - if (endpoint) - *endpoint = NULL; - if (address) - *address = NULL; - - tower_size = tower->tower_length; - - if (tower_size < sizeof(u_int16)) - return EPT_S_NOT_REGISTERED; - - p = &tower->tower_octet_string[0]; - - floor_count = *(const u_int16 *)p; - p += sizeof(u_int16); - tower_size -= sizeof(u_int16); - TRACE("floor_count: %d\n", floor_count); - /* FIXME: should we do something with the floor count? at the moment we don't */ - - if (tower_size < sizeof(*object_floor) + sizeof(*syntax_floor)) - return EPT_S_NOT_REGISTERED; - - object_floor = (const twr_uuid_floor_t *)p; - p += sizeof(*object_floor); - tower_size -= sizeof(*object_floor); - syntax_floor = (const twr_uuid_floor_t *)p; - p += sizeof(*syntax_floor); - tower_size -= sizeof(*syntax_floor); - - if ((object_floor->count_lhs != sizeof(object_floor->protid) + - sizeof(object_floor->uuid) + sizeof(object_floor->major_version)) || - (object_floor->protid != EPM_PROTOCOL_UUID) || - (object_floor->count_rhs != sizeof(object_floor->minor_version))) - return EPT_S_NOT_REGISTERED; - - if ((syntax_floor->count_lhs != sizeof(syntax_floor->protid) + - sizeof(syntax_floor->uuid) + sizeof(syntax_floor->major_version)) || - (syntax_floor->protid != EPM_PROTOCOL_UUID) || - (syntax_floor->count_rhs != sizeof(syntax_floor->minor_version))) - return EPT_S_NOT_REGISTERED; - - status = RpcTransport_ParseTopOfTower(p, tower_size, protseq, address, endpoint); - if ((status == RPC_S_OK) && syntax && object) - { - syntax->SyntaxGUID = syntax_floor->uuid; - syntax->SyntaxVersion.MajorVersion = syntax_floor->major_version; - syntax->SyntaxVersion.MinorVersion = syntax_floor->minor_version; - object->SyntaxGUID = object_floor->uuid; - object->SyntaxVersion.MajorVersion = object_floor->major_version; - object->SyntaxVersion.MinorVersion = object_floor->minor_version; - } - return status; -} - -/*********************************************************************** - * TowerConstruct (RPCRT4.@) - */ -RPC_STATUS WINAPI TowerConstruct( - const RPC_SYNTAX_IDENTIFIER *object, const RPC_SYNTAX_IDENTIFIER *syntax, - const char *protseq, const char *endpoint, const char *address, - twr_t **tower) -{ - size_t tower_size; - RPC_STATUS status; - unsigned char *p; - twr_uuid_floor_t *object_floor; - twr_uuid_floor_t *syntax_floor; - - *tower = NULL; - - status = RpcTransport_GetTopOfTower(NULL, &tower_size, protseq, address, endpoint); - - if (status != RPC_S_OK) - return status; - - tower_size += sizeof(u_int16) + sizeof(*object_floor) + sizeof(*syntax_floor); - *tower = I_RpcAllocate(FIELD_OFFSET(twr_t, tower_octet_string[tower_size])); - if (!*tower) - return RPC_S_OUT_OF_RESOURCES; - - (*tower)->tower_length = tower_size; - p = &(*tower)->tower_octet_string[0]; - *(u_int16 *)p = 5; /* number of floors */ - p += sizeof(u_int16); - object_floor = (twr_uuid_floor_t *)p; - p += sizeof(*object_floor); - syntax_floor = (twr_uuid_floor_t *)p; - p += sizeof(*syntax_floor); - - object_floor->count_lhs = sizeof(object_floor->protid) + sizeof(object_floor->uuid) + - sizeof(object_floor->major_version); - object_floor->protid = EPM_PROTOCOL_UUID; - object_floor->count_rhs = sizeof(object_floor->minor_version); - object_floor->uuid = object->SyntaxGUID; - object_floor->major_version = object->SyntaxVersion.MajorVersion; - object_floor->minor_version = object->SyntaxVersion.MinorVersion; - - syntax_floor->count_lhs = sizeof(syntax_floor->protid) + sizeof(syntax_floor->uuid) + - sizeof(syntax_floor->major_version); - syntax_floor->protid = EPM_PROTOCOL_UUID; - syntax_floor->count_rhs = sizeof(syntax_floor->minor_version); - syntax_floor->uuid = syntax->SyntaxGUID; - syntax_floor->major_version = syntax->SyntaxVersion.MajorVersion; - syntax_floor->minor_version = syntax->SyntaxVersion.MinorVersion; - - status = RpcTransport_GetTopOfTower(p, &tower_size, protseq, address, endpoint); - if (status != RPC_S_OK) - { - I_RpcFree(*tower); - *tower = NULL; - return status; - } - return RPC_S_OK; -} +/* + * RPC endpoint mapper + * + * Copyright 2002 Greg Turner + * Copyright 2001 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * TODO: + * - actually do things right + */ + +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" + +#include "rpc.h" + +#include "wine/debug.h" + +#include "rpc_binding.h" +#include "epm_towers.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +/* The "real" RPC portmapper endpoints that I know of are: + * + * ncadg_ip_udp: 135 + * ncacn_ip_tcp: 135 + * ncacn_np: \\pipe\epmapper (?) + * ncalrpc: epmapper + * + * If the user's machine ran a DCE RPC daemon, it would + * probably be possible to connect to it, but there are many + * reasons not to, like: + * - the user probably does *not* run one, and probably + * shouldn't be forced to run one just for local COM + * - very few Unix systems use DCE RPC... if they run a RPC + * daemon at all, it's usually Sun RPC + * - DCE RPC registrations are persistent and saved on disk, + * while MS-RPC registrations are documented as non-persistent + * and stored only in RAM, and auto-destroyed when the process + * dies (something DCE RPC can't do) + * + * Of course, if the user *did* want to run a DCE RPC daemon anyway, + * there would be interoperability advantages, like the possibility + * of running a fully functional DCOM server using Wine... + */ + +/*********************************************************************** + * RpcEpRegisterA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, + UUID_VECTOR *UuidVector, RPC_CSTR Annotation ) +{ + RPCSS_NP_MESSAGE msg; + RPCSS_NP_REPLY reply; + char *vardata_payload, *vp; + PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; + unsigned long c; + RPC_STATUS rslt = RPC_S_OK; + + TRACE("(%p,%p,%p,%s)\n", IfSpec, BindingVector, UuidVector, debugstr_a((char*)Annotation)); + TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID)); + for (c=0; cCount; c++) { + RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[c]); + TRACE(" protseq[%ld]=%s\n", c, debugstr_a(bind->Protseq)); + TRACE(" endpoint[%ld]=%s\n", c, debugstr_a(bind->Endpoint)); + } + if (UuidVector) { + for (c=0; cCount; c++) + TRACE(" obj[%ld]=%s\n", c, debugstr_guid(UuidVector->Uuid[c])); + } + + /* FIXME: Do something with annotation. */ + + /* construct the message to rpcss */ + msg.message_type = RPCSS_NP_MESSAGE_TYPEID_REGISTEREPMSG; + msg.message.registerepmsg.iface = If->InterfaceId; + msg.message.registerepmsg.no_replace = 0; + + msg.message.registerepmsg.object_count = (UuidVector) ? UuidVector->Count : 0; + msg.message.registerepmsg.binding_count = BindingVector->Count; + + /* calculate vardata payload size */ + msg.vardata_payload_size = msg.message.registerepmsg.object_count * sizeof(UUID); + for (c=0; c < msg.message.registerepmsg.binding_count; c++) { + RpcBinding *bind = (RpcBinding *)(BindingVector->BindingH[c]); + msg.vardata_payload_size += strlen(bind->Protseq) + 1; + msg.vardata_payload_size += strlen(bind->Endpoint) + 1; + } + + /* allocate the payload buffer */ + vp = vardata_payload = LocalAlloc(LPTR, msg.vardata_payload_size); + if (!vardata_payload) + return RPC_S_OUT_OF_MEMORY; + + /* populate the payload data */ + for (c=0; c < msg.message.registerepmsg.object_count; c++) { + CopyMemory(vp, UuidVector->Uuid[c], sizeof(UUID)); + vp += sizeof(UUID); + } + + for (c=0; c < msg.message.registerepmsg.binding_count; c++) { + RpcBinding *bind = (RpcBinding*)(BindingVector->BindingH[c]); + unsigned long pslen = strlen(bind->Protseq) + 1, eplen = strlen(bind->Endpoint) + 1; + CopyMemory(vp, bind->Protseq, pslen); + vp += pslen; + CopyMemory(vp, bind->Endpoint, eplen); + vp += eplen; + } + + /* send our request */ + if (!RPCRT4_RPCSSOnDemandCall(&msg, vardata_payload, &reply)) + rslt = RPC_S_OUT_OF_MEMORY; + + /* free the payload buffer */ + LocalFree(vardata_payload); + + return rslt; +} + +/*********************************************************************** + * RpcEpUnregister (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcEpUnregister( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *BindingVector, + UUID_VECTOR *UuidVector ) +{ + RPCSS_NP_MESSAGE msg; + RPCSS_NP_REPLY reply; + char *vardata_payload, *vp; + PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; + unsigned long c; + RPC_STATUS rslt = RPC_S_OK; + + TRACE("(%p,%p,%p)\n", IfSpec, BindingVector, UuidVector); + TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID)); + for (c=0; cCount; c++) { + RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[c]); + TRACE(" protseq[%ld]=%s\n", c, debugstr_a(bind->Protseq)); + TRACE(" endpoint[%ld]=%s\n", c, debugstr_a(bind->Endpoint)); + } + if (UuidVector) { + for (c=0; cCount; c++) + TRACE(" obj[%ld]=%s\n", c, debugstr_guid(UuidVector->Uuid[c])); + } + + /* construct the message to rpcss */ + msg.message_type = RPCSS_NP_MESSAGE_TYPEID_UNREGISTEREPMSG; + msg.message.unregisterepmsg.iface = If->InterfaceId; + + msg.message.unregisterepmsg.object_count = (UuidVector) ? UuidVector->Count : 0; + msg.message.unregisterepmsg.binding_count = BindingVector->Count; + + /* calculate vardata payload size */ + msg.vardata_payload_size = msg.message.unregisterepmsg.object_count * sizeof(UUID); + for (c=0; c < msg.message.unregisterepmsg.binding_count; c++) { + RpcBinding *bind = (RpcBinding *)(BindingVector->BindingH[c]); + msg.vardata_payload_size += strlen(bind->Protseq) + 1; + msg.vardata_payload_size += strlen(bind->Endpoint) + 1; + } + + /* allocate the payload buffer */ + vp = vardata_payload = LocalAlloc(LPTR, msg.vardata_payload_size); + if (!vardata_payload) + return RPC_S_OUT_OF_MEMORY; + + /* populate the payload data */ + for (c=0; c < msg.message.unregisterepmsg.object_count; c++) { + CopyMemory(vp, UuidVector->Uuid[c], sizeof(UUID)); + vp += sizeof(UUID); + } + + for (c=0; c < msg.message.unregisterepmsg.binding_count; c++) { + RpcBinding *bind = (RpcBinding*)(BindingVector->BindingH[c]); + unsigned long pslen = strlen(bind->Protseq) + 1, eplen = strlen(bind->Endpoint) + 1; + CopyMemory(vp, bind->Protseq, pslen); + vp += pslen; + CopyMemory(vp, bind->Endpoint, eplen); + vp += eplen; + } + + /* send our request */ + if (!RPCRT4_RPCSSOnDemandCall(&msg, vardata_payload, &reply)) + rslt = RPC_S_OUT_OF_MEMORY; + + /* free the payload buffer */ + LocalFree(vardata_payload); + + return rslt; +} + +/*********************************************************************** + * RpcEpResolveBinding (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE IfSpec ) +{ + RPCSS_NP_MESSAGE msg; + RPCSS_NP_REPLY reply; + PRPC_CLIENT_INTERFACE If = (PRPC_CLIENT_INTERFACE)IfSpec; + RpcBinding* bind = (RpcBinding*)Binding; + + TRACE("(%p,%p)\n", Binding, IfSpec); + TRACE(" protseq=%s\n", debugstr_a(bind->Protseq)); + TRACE(" obj=%s\n", debugstr_guid(&bind->ObjectUuid)); + TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID)); + + /* FIXME: totally untested */ + + /* just return for fully bound handles */ + if (bind->Endpoint && (bind->Endpoint[0] != '\0')) + return RPC_S_OK; + + /* construct the message to rpcss */ + msg.message_type = RPCSS_NP_MESSAGE_TYPEID_RESOLVEEPMSG; + msg.message.resolveepmsg.iface = If->InterfaceId; + msg.message.resolveepmsg.object = bind->ObjectUuid; + + msg.vardata_payload_size = strlen(bind->Protseq) + 1; + + /* send the message */ + if (!RPCRT4_RPCSSOnDemandCall(&msg, bind->Protseq, &reply)) + return RPC_S_OUT_OF_MEMORY; + + /* empty-string result means not registered */ + if (reply.as_string[0] == '\0') + return EPT_S_NOT_REGISTERED; + + /* otherwise we fully bind the handle & return RPC_S_OK */ + return RPCRT4_ResolveBinding(Binding, reply.as_string); +} + +typedef unsigned int unsigned32; +typedef struct twr_t + { + unsigned32 tower_length; + /* [size_is] */ BYTE tower_octet_string[ 1 ]; + } twr_t; + +/*********************************************************************** + * TowerExplode (RPCRT4.@) + */ +RPC_STATUS WINAPI TowerExplode( + const twr_t *tower, PRPC_SYNTAX_IDENTIFIER object, PRPC_SYNTAX_IDENTIFIER syntax, + char **protseq, char **endpoint, char **address) +{ + size_t tower_size; + RPC_STATUS status; + const unsigned char *p; + u_int16 floor_count; + const twr_uuid_floor_t *object_floor; + const twr_uuid_floor_t *syntax_floor; + + if (protseq) + *protseq = NULL; + if (endpoint) + *endpoint = NULL; + if (address) + *address = NULL; + + tower_size = tower->tower_length; + + if (tower_size < sizeof(u_int16)) + return EPT_S_NOT_REGISTERED; + + p = &tower->tower_octet_string[0]; + + floor_count = *(const u_int16 *)p; + p += sizeof(u_int16); + tower_size -= sizeof(u_int16); + TRACE("floor_count: %d\n", floor_count); + /* FIXME: should we do something with the floor count? at the moment we don't */ + + if (tower_size < sizeof(*object_floor) + sizeof(*syntax_floor)) + return EPT_S_NOT_REGISTERED; + + object_floor = (const twr_uuid_floor_t *)p; + p += sizeof(*object_floor); + tower_size -= sizeof(*object_floor); + syntax_floor = (const twr_uuid_floor_t *)p; + p += sizeof(*syntax_floor); + tower_size -= sizeof(*syntax_floor); + + if ((object_floor->count_lhs != sizeof(object_floor->protid) + + sizeof(object_floor->uuid) + sizeof(object_floor->major_version)) || + (object_floor->protid != EPM_PROTOCOL_UUID) || + (object_floor->count_rhs != sizeof(object_floor->minor_version))) + return EPT_S_NOT_REGISTERED; + + if ((syntax_floor->count_lhs != sizeof(syntax_floor->protid) + + sizeof(syntax_floor->uuid) + sizeof(syntax_floor->major_version)) || + (syntax_floor->protid != EPM_PROTOCOL_UUID) || + (syntax_floor->count_rhs != sizeof(syntax_floor->minor_version))) + return EPT_S_NOT_REGISTERED; + + status = RpcTransport_ParseTopOfTower(p, tower_size, protseq, address, endpoint); + if ((status == RPC_S_OK) && syntax && object) + { + syntax->SyntaxGUID = syntax_floor->uuid; + syntax->SyntaxVersion.MajorVersion = syntax_floor->major_version; + syntax->SyntaxVersion.MinorVersion = syntax_floor->minor_version; + object->SyntaxGUID = object_floor->uuid; + object->SyntaxVersion.MajorVersion = object_floor->major_version; + object->SyntaxVersion.MinorVersion = object_floor->minor_version; + } + return status; +} + +/*********************************************************************** + * TowerConstruct (RPCRT4.@) + */ +RPC_STATUS WINAPI TowerConstruct( + const RPC_SYNTAX_IDENTIFIER *object, const RPC_SYNTAX_IDENTIFIER *syntax, + const char *protseq, const char *endpoint, const char *address, + twr_t **tower) +{ + size_t tower_size; + RPC_STATUS status; + unsigned char *p; + twr_uuid_floor_t *object_floor; + twr_uuid_floor_t *syntax_floor; + + *tower = NULL; + + status = RpcTransport_GetTopOfTower(NULL, &tower_size, protseq, address, endpoint); + + if (status != RPC_S_OK) + return status; + + tower_size += sizeof(u_int16) + sizeof(*object_floor) + sizeof(*syntax_floor); + *tower = I_RpcAllocate(FIELD_OFFSET(twr_t, tower_octet_string[tower_size])); + if (!*tower) + return RPC_S_OUT_OF_RESOURCES; + + (*tower)->tower_length = tower_size; + p = &(*tower)->tower_octet_string[0]; + *(u_int16 *)p = 5; /* number of floors */ + p += sizeof(u_int16); + object_floor = (twr_uuid_floor_t *)p; + p += sizeof(*object_floor); + syntax_floor = (twr_uuid_floor_t *)p; + p += sizeof(*syntax_floor); + + object_floor->count_lhs = sizeof(object_floor->protid) + sizeof(object_floor->uuid) + + sizeof(object_floor->major_version); + object_floor->protid = EPM_PROTOCOL_UUID; + object_floor->count_rhs = sizeof(object_floor->minor_version); + object_floor->uuid = object->SyntaxGUID; + object_floor->major_version = object->SyntaxVersion.MajorVersion; + object_floor->minor_version = object->SyntaxVersion.MinorVersion; + + syntax_floor->count_lhs = sizeof(syntax_floor->protid) + sizeof(syntax_floor->uuid) + + sizeof(syntax_floor->major_version); + syntax_floor->protid = EPM_PROTOCOL_UUID; + syntax_floor->count_rhs = sizeof(syntax_floor->minor_version); + syntax_floor->uuid = syntax->SyntaxGUID; + syntax_floor->major_version = syntax->SyntaxVersion.MajorVersion; + syntax_floor->minor_version = syntax->SyntaxVersion.MinorVersion; + + status = RpcTransport_GetTopOfTower(p, &tower_size, protseq, address, endpoint); + if (status != RPC_S_OK) + { + I_RpcFree(*tower); + *tower = NULL; + return status; + } + return RPC_S_OK; +} diff --git a/reactos/dll/win32/rpcrt4_new/rpc_message.c b/reactos/dll/win32/rpcrt4_new/rpc_message.c index 37839f7ce87..53bf65d8b25 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_message.c +++ b/reactos/dll/win32/rpcrt4_new/rpc_message.c @@ -1,1146 +1,1146 @@ -/* - * RPC messages - * - * Copyright 2001-2002 Ove Kåven, TransGaming Technologies - * Copyright 2004 Filip Navara - * Copyright 2006 CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - -#include "rpc.h" -#include "rpcndr.h" -#include "rpcdcep.h" - -#include "wine/debug.h" - -#include "rpc_binding.h" -#include "rpc_defs.h" -#include "rpc_message.h" -#include "ncastatus.h" - -WINE_DEFAULT_DEBUG_CHANNEL(rpc); - -/* note: the DCE/RPC spec says the alignment amount should be 4, but - * MS/RPC servers seem to always use 16 */ -#define AUTH_ALIGNMENT 16 - -/* gets the amount needed to round a value up to the specified alignment */ -#define ROUND_UP_AMOUNT(value, alignment) \ - (((alignment) - (((value) % (alignment)))) % (alignment)) -#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1)) - -enum secure_packet_direction -{ - SECURE_PACKET_SEND, - SECURE_PACKET_RECEIVE -}; - -static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg); - -static DWORD RPCRT4_GetHeaderSize(const RpcPktHdr *Header) -{ - static const DWORD header_sizes[] = { - sizeof(Header->request), 0, sizeof(Header->response), - sizeof(Header->fault), 0, 0, 0, 0, 0, 0, 0, sizeof(Header->bind), - sizeof(Header->bind_ack), sizeof(Header->bind_nack), - 0, 0, 0, 0, 0 - }; - ULONG ret = 0; - - if (Header->common.ptype < sizeof(header_sizes) / sizeof(header_sizes[0])) { - ret = header_sizes[Header->common.ptype]; - if (ret == 0) - FIXME("unhandled packet type\n"); - if (Header->common.flags & RPC_FLG_OBJECT_UUID) - ret += sizeof(UUID); - } else { - TRACE("invalid packet type\n"); - } - - return ret; -} - -static int packet_has_body(const RpcPktHdr *Header) -{ - return (Header->common.ptype == PKT_FAULT) || - (Header->common.ptype == PKT_REQUEST) || - (Header->common.ptype == PKT_RESPONSE); -} - -static int packet_has_auth_verifier(const RpcPktHdr *Header) -{ - return !(Header->common.ptype == PKT_BIND_NACK) && - !(Header->common.ptype == PKT_SHUTDOWN); -} - -static VOID RPCRT4_BuildCommonHeader(RpcPktHdr *Header, unsigned char PacketType, - unsigned long DataRepresentation) -{ - Header->common.rpc_ver = RPC_VER_MAJOR; - Header->common.rpc_ver_minor = RPC_VER_MINOR; - Header->common.ptype = PacketType; - Header->common.drep[0] = LOBYTE(LOWORD(DataRepresentation)); - Header->common.drep[1] = HIBYTE(LOWORD(DataRepresentation)); - Header->common.drep[2] = LOBYTE(HIWORD(DataRepresentation)); - Header->common.drep[3] = HIBYTE(HIWORD(DataRepresentation)); - Header->common.auth_len = 0; - Header->common.call_id = 1; - Header->common.flags = 0; - /* Flags and fragment length are computed in RPCRT4_Send. */ -} - -static RpcPktHdr *RPCRT4_BuildRequestHeader(unsigned long DataRepresentation, - unsigned long BufferLength, - unsigned short ProcNum, - UUID *ObjectUuid) -{ - RpcPktHdr *header; - BOOL has_object; - RPC_STATUS status; - - has_object = (ObjectUuid != NULL && !UuidIsNil(ObjectUuid, &status)); - header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(header->request) + (has_object ? sizeof(UUID) : 0)); - if (header == NULL) { - return NULL; - } - - RPCRT4_BuildCommonHeader(header, PKT_REQUEST, DataRepresentation); - header->common.frag_len = sizeof(header->request); - header->request.alloc_hint = BufferLength; - header->request.context_id = 0; - header->request.opnum = ProcNum; - if (has_object) { - header->common.flags |= RPC_FLG_OBJECT_UUID; - header->common.frag_len += sizeof(UUID); - memcpy(&header->request + 1, ObjectUuid, sizeof(UUID)); - } - - return header; -} - -RpcPktHdr *RPCRT4_BuildResponseHeader(unsigned long DataRepresentation, - unsigned long BufferLength) -{ - RpcPktHdr *header; - - header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->response)); - if (header == NULL) { - return NULL; - } - - RPCRT4_BuildCommonHeader(header, PKT_RESPONSE, DataRepresentation); - header->common.frag_len = sizeof(header->response); - header->response.alloc_hint = BufferLength; - - return header; -} - -RpcPktHdr *RPCRT4_BuildFaultHeader(unsigned long DataRepresentation, - RPC_STATUS Status) -{ - RpcPktHdr *header; - - header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->fault)); - if (header == NULL) { - return NULL; - } - - RPCRT4_BuildCommonHeader(header, PKT_FAULT, DataRepresentation); - header->common.frag_len = sizeof(header->fault); - header->fault.status = Status; - - return header; -} - -RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation, - unsigned short MaxTransmissionSize, - unsigned short MaxReceiveSize, - unsigned long AssocGroupId, - const RPC_SYNTAX_IDENTIFIER *AbstractId, - const RPC_SYNTAX_IDENTIFIER *TransferId) -{ - RpcPktHdr *header; - - header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->bind)); - if (header == NULL) { - return NULL; - } - - RPCRT4_BuildCommonHeader(header, PKT_BIND, DataRepresentation); - header->common.frag_len = sizeof(header->bind); - header->bind.max_tsize = MaxTransmissionSize; - header->bind.max_rsize = MaxReceiveSize; - header->bind.assoc_gid = AssocGroupId; - header->bind.num_elements = 1; - header->bind.num_syntaxes = 1; - memcpy(&header->bind.abstract, AbstractId, sizeof(RPC_SYNTAX_IDENTIFIER)); - memcpy(&header->bind.transfer, TransferId, sizeof(RPC_SYNTAX_IDENTIFIER)); - - return header; -} - -static RpcPktHdr *RPCRT4_BuildAuthHeader(unsigned long DataRepresentation) -{ - RpcPktHdr *header; - - header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(header->common) + 12); - if (header == NULL) - return NULL; - - RPCRT4_BuildCommonHeader(header, PKT_AUTH3, DataRepresentation); - header->common.frag_len = 0x14; - header->common.auth_len = 0; - - return header; -} - -RpcPktHdr *RPCRT4_BuildBindNackHeader(unsigned long DataRepresentation, - unsigned char RpcVersion, - unsigned char RpcVersionMinor) -{ - RpcPktHdr *header; - - header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->bind_nack)); - if (header == NULL) { - return NULL; - } - - RPCRT4_BuildCommonHeader(header, PKT_BIND_NACK, DataRepresentation); - header->common.frag_len = sizeof(header->bind_nack); - header->bind_nack.reject_reason = REJECT_REASON_NOT_SPECIFIED; - header->bind_nack.protocols_count = 1; - header->bind_nack.protocols[0].rpc_ver = RpcVersion; - header->bind_nack.protocols[0].rpc_ver_minor = RpcVersionMinor; - - return header; -} - -RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation, - unsigned short MaxTransmissionSize, - unsigned short MaxReceiveSize, - LPCSTR ServerAddress, - unsigned long Result, - unsigned long Reason, - const RPC_SYNTAX_IDENTIFIER *TransferId) -{ - RpcPktHdr *header; - unsigned long header_size; - RpcAddressString *server_address; - RpcResults *results; - RPC_SYNTAX_IDENTIFIER *transfer_id; - - header_size = sizeof(header->bind_ack) + - ROUND_UP(FIELD_OFFSET(RpcAddressString, string[strlen(ServerAddress) + 1]), 4) + - sizeof(RpcResults) + - sizeof(RPC_SYNTAX_IDENTIFIER); - - header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, header_size); - if (header == NULL) { - return NULL; - } - - RPCRT4_BuildCommonHeader(header, PKT_BIND_ACK, DataRepresentation); - header->common.frag_len = header_size; - header->bind_ack.max_tsize = MaxTransmissionSize; - header->bind_ack.max_rsize = MaxReceiveSize; - server_address = (RpcAddressString*)(&header->bind_ack + 1); - server_address->length = strlen(ServerAddress) + 1; - strcpy(server_address->string, ServerAddress); - /* results is 4-byte aligned */ - results = (RpcResults*)((ULONG_PTR)server_address + ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4)); - results->num_results = 1; - results->results[0].result = Result; - results->results[0].reason = Reason; - transfer_id = (RPC_SYNTAX_IDENTIFIER*)(results + 1); - memcpy(transfer_id, TransferId, sizeof(RPC_SYNTAX_IDENTIFIER)); - - return header; -} - -VOID RPCRT4_FreeHeader(RpcPktHdr *Header) -{ - HeapFree(GetProcessHeap(), 0, Header); -} - -NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status) -{ - switch (status) - { - case ERROR_INVALID_HANDLE: return NCA_S_FAULT_CONTEXT_MISMATCH; - case ERROR_OUTOFMEMORY: return NCA_S_FAULT_REMOTE_NO_MEMORY; - case RPC_S_NOT_LISTENING: return NCA_S_SERVER_TOO_BUSY; - case RPC_S_UNKNOWN_IF: return NCA_S_UNK_IF; - case RPC_S_SERVER_TOO_BUSY: return NCA_S_SERVER_TOO_BUSY; - case RPC_S_CALL_FAILED: return NCA_S_FAULT_UNSPEC; - case RPC_S_CALL_FAILED_DNE: return NCA_S_MANAGER_NOT_ENTERED; - case RPC_S_PROTOCOL_ERROR: return NCA_S_PROTO_ERROR; - case RPC_S_UNSUPPORTED_TYPE: return NCA_S_UNSUPPORTED_TYPE; - case RPC_S_INVALID_TAG: return NCA_S_FAULT_INVALID_TAG; - case RPC_S_INVALID_BOUND: return NCA_S_FAULT_INVALID_BOUND; - case RPC_S_PROCNUM_OUT_OF_RANGE: return NCA_S_OP_RNG_ERROR; - case RPC_X_SS_HANDLES_MISMATCH: return NCA_S_FAULT_CONTEXT_MISMATCH; - case RPC_S_CALL_CANCELLED: return NCA_S_FAULT_CANCEL; - case RPC_S_COMM_FAILURE: return NCA_S_COMM_FAILURE; - case RPC_X_WRONG_PIPE_ORDER: return NCA_S_FAULT_PIPE_ORDER; - case RPC_X_PIPE_CLOSED: return NCA_S_FAULT_PIPE_CLOSED; - case RPC_X_PIPE_DISCIPLINE_ERROR: return NCA_S_FAULT_PIPE_DISCIPLINE; - case RPC_X_PIPE_EMPTY: return NCA_S_FAULT_PIPE_EMPTY; - case STATUS_FLOAT_DIVIDE_BY_ZERO: return NCA_S_FAULT_FP_DIV_ZERO; - case STATUS_FLOAT_INVALID_OPERATION: return NCA_S_FAULT_FP_ERROR; - case STATUS_FLOAT_OVERFLOW: return NCA_S_FAULT_FP_OVERFLOW; - case STATUS_FLOAT_UNDERFLOW: return NCA_S_FAULT_FP_UNDERFLOW; - case STATUS_INTEGER_DIVIDE_BY_ZERO: return NCA_S_FAULT_INT_DIV_BY_ZERO; - case STATUS_INTEGER_OVERFLOW: return NCA_S_FAULT_INT_OVERFLOW; - default: return status; - } -} - -RPC_STATUS NCA2RPC_STATUS(NCA_STATUS status) -{ - switch (status) - { - case NCA_S_COMM_FAILURE: return RPC_S_COMM_FAILURE; - case NCA_S_OP_RNG_ERROR: return RPC_S_PROCNUM_OUT_OF_RANGE; - case NCA_S_UNK_IF: return RPC_S_UNKNOWN_IF; - case NCA_S_YOU_CRASHED: return RPC_S_CALL_FAILED; - case NCA_S_PROTO_ERROR: return RPC_S_PROTOCOL_ERROR; - case NCA_S_OUT_ARGS_TOO_BIG: return ERROR_NOT_ENOUGH_SERVER_MEMORY; - case NCA_S_SERVER_TOO_BUSY: return RPC_S_SERVER_TOO_BUSY; - case NCA_S_UNSUPPORTED_TYPE: return RPC_S_UNSUPPORTED_TYPE; - case NCA_S_FAULT_INT_DIV_BY_ZERO: return RPC_S_ZERO_DIVIDE; - case NCA_S_FAULT_ADDR_ERROR: return RPC_S_ADDRESS_ERROR; - case NCA_S_FAULT_FP_DIV_ZERO: return RPC_S_FP_DIV_ZERO; - case NCA_S_FAULT_FP_UNDERFLOW: return RPC_S_FP_UNDERFLOW; - case NCA_S_FAULT_FP_OVERFLOW: return RPC_S_FP_OVERFLOW; - case NCA_S_FAULT_INVALID_TAG: return RPC_S_INVALID_TAG; - case NCA_S_FAULT_INVALID_BOUND: return RPC_S_INVALID_BOUND; - case NCA_S_RPC_VERSION_MISMATCH: return RPC_S_PROTOCOL_ERROR; - case NCA_S_UNSPEC_REJECT: return RPC_S_CALL_FAILED_DNE; - case NCA_S_BAD_ACTID: return RPC_S_CALL_FAILED_DNE; - case NCA_S_WHO_ARE_YOU_FAILED: return RPC_S_CALL_FAILED; - case NCA_S_MANAGER_NOT_ENTERED: return RPC_S_CALL_FAILED_DNE; - case NCA_S_FAULT_CANCEL: return RPC_S_CALL_CANCELLED; - case NCA_S_FAULT_ILL_INST: return RPC_S_ADDRESS_ERROR; - case NCA_S_FAULT_FP_ERROR: return RPC_S_FP_OVERFLOW; - case NCA_S_FAULT_INT_OVERFLOW: return RPC_S_ADDRESS_ERROR; - case NCA_S_FAULT_UNSPEC: return RPC_S_CALL_FAILED; - case NCA_S_FAULT_PIPE_EMPTY: return RPC_X_PIPE_EMPTY; - case NCA_S_FAULT_PIPE_CLOSED: return RPC_X_PIPE_CLOSED; - case NCA_S_FAULT_PIPE_ORDER: return RPC_X_WRONG_PIPE_ORDER; - case NCA_S_FAULT_PIPE_DISCIPLINE: return RPC_X_PIPE_DISCIPLINE_ERROR; - case NCA_S_FAULT_PIPE_COMM_ERROR: return RPC_S_COMM_FAILURE; - case NCA_S_FAULT_PIPE_MEMORY: return ERROR_OUTOFMEMORY; - case NCA_S_FAULT_CONTEXT_MISMATCH: return ERROR_INVALID_HANDLE; - case NCA_S_FAULT_REMOTE_NO_MEMORY: return ERROR_NOT_ENOUGH_SERVER_MEMORY; - default: return status; - } -} - -static RPC_STATUS RPCRT4_SecurePacket(RpcConnection *Connection, - enum secure_packet_direction dir, - RpcPktHdr *hdr, unsigned int hdr_size, - unsigned char *stub_data, unsigned int stub_data_size, - RpcAuthVerifier *auth_hdr, - unsigned char *auth_value, unsigned int auth_value_size) -{ - SecBufferDesc message; - SecBuffer buffers[4]; - SECURITY_STATUS sec_status; - - message.ulVersion = SECBUFFER_VERSION; - message.cBuffers = sizeof(buffers)/sizeof(buffers[0]); - message.pBuffers = buffers; - - buffers[0].cbBuffer = hdr_size; - buffers[0].BufferType = SECBUFFER_DATA|SECBUFFER_READONLY_WITH_CHECKSUM; - buffers[0].pvBuffer = hdr; - buffers[1].cbBuffer = stub_data_size; - buffers[1].BufferType = SECBUFFER_DATA; - buffers[1].pvBuffer = stub_data; - buffers[2].cbBuffer = sizeof(*auth_hdr); - buffers[2].BufferType = SECBUFFER_DATA|SECBUFFER_READONLY_WITH_CHECKSUM; - buffers[2].pvBuffer = auth_hdr; - buffers[3].cbBuffer = auth_value_size; - buffers[3].BufferType = SECBUFFER_TOKEN; - buffers[3].pvBuffer = auth_value; - - if (dir == SECURE_PACKET_SEND) - { - if ((auth_hdr->auth_level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) && packet_has_body(hdr)) - { - sec_status = EncryptMessage(&Connection->ctx, 0, &message, 0 /* FIXME */); - if (sec_status != SEC_E_OK) - { - ERR("EncryptMessage failed with 0x%08x\n", sec_status); - return RPC_S_SEC_PKG_ERROR; - } - } - else if (auth_hdr->auth_level != RPC_C_AUTHN_LEVEL_NONE) - { - sec_status = MakeSignature(&Connection->ctx, 0, &message, 0 /* FIXME */); - if (sec_status != SEC_E_OK) - { - ERR("MakeSignature failed with 0x%08x\n", sec_status); - return RPC_S_SEC_PKG_ERROR; - } - } - } - else if (dir == SECURE_PACKET_RECEIVE) - { - if ((auth_hdr->auth_level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) && packet_has_body(hdr)) - { - sec_status = DecryptMessage(&Connection->ctx, &message, 0 /* FIXME */, 0); - if (sec_status != SEC_E_OK) - { - ERR("EncryptMessage failed with 0x%08x\n", sec_status); - return RPC_S_SEC_PKG_ERROR; - } - } - else if (auth_hdr->auth_level != RPC_C_AUTHN_LEVEL_NONE) - { - sec_status = VerifySignature(&Connection->ctx, &message, 0 /* FIXME */, NULL); - if (sec_status != SEC_E_OK) - { - ERR("VerifySignature failed with 0x%08x\n", sec_status); - return RPC_S_SEC_PKG_ERROR; - } - } - } - - return RPC_S_OK; -} - -/*********************************************************************** - * RPCRT4_SendAuth (internal) - * - * Transmit a packet with authorization data over connection in acceptable fragments. - */ -static RPC_STATUS RPCRT4_SendAuth(RpcConnection *Connection, RpcPktHdr *Header, - void *Buffer, unsigned int BufferLength, - const void *Auth, unsigned int AuthLength) -{ - PUCHAR buffer_pos; - DWORD hdr_size; - LONG count; - unsigned char *pkt; - LONG alen; - RPC_STATUS status; - - buffer_pos = Buffer; - /* The packet building functions save the packet header size, so we can use it. */ - hdr_size = Header->common.frag_len; - if (AuthLength) - Header->common.auth_len = AuthLength; - else if (Connection->AuthInfo && packet_has_auth_verifier(Header)) - { - if ((Connection->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) && packet_has_body(Header)) - Header->common.auth_len = Connection->encryption_auth_len; - else - Header->common.auth_len = Connection->signature_auth_len; - } - else - Header->common.auth_len = 0; - Header->common.flags |= RPC_FLG_FIRST; - Header->common.flags &= ~RPC_FLG_LAST; - - alen = RPC_AUTH_VERIFIER_LEN(&Header->common); - - while (!(Header->common.flags & RPC_FLG_LAST)) { - unsigned char auth_pad_len = Header->common.auth_len ? ROUND_UP_AMOUNT(BufferLength, AUTH_ALIGNMENT) : 0; - unsigned int pkt_size = BufferLength + hdr_size + alen + auth_pad_len; - - /* decide if we need to split the packet into fragments */ - if (pkt_size <= Connection->MaxTransmissionSize) { - Header->common.flags |= RPC_FLG_LAST; - Header->common.frag_len = pkt_size; - } else { - auth_pad_len = 0; - /* make sure packet payload will be a multiple of 16 */ - Header->common.frag_len = - ((Connection->MaxTransmissionSize - hdr_size - alen) & ~(AUTH_ALIGNMENT-1)) + - hdr_size + alen; - } - - pkt = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Header->common.frag_len); - - memcpy(pkt, Header, hdr_size); - - /* fragment consisted of header only and is the last one */ - if (hdr_size == Header->common.frag_len) - goto write; - - memcpy(pkt + hdr_size, buffer_pos, Header->common.frag_len - hdr_size - auth_pad_len - alen); - - /* add the authorization info */ - if (Connection->AuthInfo && packet_has_auth_verifier(Header)) - { - RpcAuthVerifier *auth_hdr = (RpcAuthVerifier *)&pkt[Header->common.frag_len - alen]; - - auth_hdr->auth_type = Connection->AuthInfo->AuthnSvc; - auth_hdr->auth_level = Connection->AuthInfo->AuthnLevel; - auth_hdr->auth_pad_length = auth_pad_len; - auth_hdr->auth_reserved = 0; - /* a unique number... */ - auth_hdr->auth_context_id = (unsigned long)Connection; - - if (AuthLength) - memcpy(auth_hdr + 1, Auth, AuthLength); - else - { - status = RPCRT4_SecurePacket(Connection, SECURE_PACKET_SEND, - (RpcPktHdr *)pkt, hdr_size, - pkt + hdr_size, Header->common.frag_len - hdr_size - alen, - auth_hdr, - (unsigned char *)(auth_hdr + 1), Header->common.auth_len); - if (status != RPC_S_OK) - { - HeapFree(GetProcessHeap(), 0, pkt); - return status; - } - } - } - -write: - count = rpcrt4_conn_write(Connection, pkt, Header->common.frag_len); - HeapFree(GetProcessHeap(), 0, pkt); - if (count<0) { - WARN("rpcrt4_conn_write failed (auth)\n"); - return RPC_S_PROTOCOL_ERROR; - } - - buffer_pos += Header->common.frag_len - hdr_size - alen - auth_pad_len; - BufferLength -= Header->common.frag_len - hdr_size - alen - auth_pad_len; - Header->common.flags &= ~RPC_FLG_FIRST; - } - - return RPC_S_OK; -} - -/*********************************************************************** - * RPCRT4_ClientAuthorize (internal) - * - * Authorize a client connection. A NULL in param signifies a new connection. - */ -static RPC_STATUS RPCRT4_ClientAuthorize(RpcConnection *conn, SecBuffer *in, - SecBuffer *out) -{ - SECURITY_STATUS r; - SecBufferDesc out_desc; - SecBufferDesc inp_desc; - SecPkgContext_Sizes secctx_sizes; - BOOL continue_needed; - ULONG context_req = ISC_REQ_CONNECTION | ISC_REQ_USE_DCE_STYLE | - ISC_REQ_MUTUAL_AUTH | ISC_REQ_DELEGATE; - - if (conn->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_PKT_INTEGRITY) - context_req |= ISC_REQ_INTEGRITY; - else if (conn->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) - context_req |= ISC_REQ_CONFIDENTIALITY | ISC_REQ_INTEGRITY; - - out->BufferType = SECBUFFER_TOKEN; - out->cbBuffer = conn->AuthInfo->cbMaxToken; - out->pvBuffer = HeapAlloc(GetProcessHeap(), 0, out->cbBuffer); - if (!out->pvBuffer) return ERROR_OUTOFMEMORY; - - out_desc.ulVersion = 0; - out_desc.cBuffers = 1; - out_desc.pBuffers = out; - - inp_desc.cBuffers = 1; - inp_desc.pBuffers = in; - inp_desc.ulVersion = 0; - - r = InitializeSecurityContextA(&conn->AuthInfo->cred, in ? &conn->ctx : NULL, - NULL, context_req, 0, SECURITY_NETWORK_DREP, - in ? &inp_desc : NULL, 0, &conn->ctx, &out_desc, &conn->attr, - &conn->exp); - if (FAILED(r)) - { - WARN("InitializeSecurityContext failed with error 0x%08x\n", r); - goto failed; - } - - TRACE("r = 0x%08x, attr = 0x%08x\n", r, conn->attr); - continue_needed = ((r == SEC_I_CONTINUE_NEEDED) || - (r == SEC_I_COMPLETE_AND_CONTINUE)); - - if ((r == SEC_I_COMPLETE_NEEDED) || (r == SEC_I_COMPLETE_AND_CONTINUE)) - { - TRACE("complete needed\n"); - r = CompleteAuthToken(&conn->ctx, &out_desc); - if (FAILED(r)) - { - WARN("CompleteAuthToken failed with error 0x%08x\n", r); - goto failed; - } - } - - TRACE("cbBuffer = %ld\n", out->cbBuffer); - - if (!continue_needed) - { - r = QueryContextAttributesA(&conn->ctx, SECPKG_ATTR_SIZES, &secctx_sizes); - if (FAILED(r)) - { - WARN("QueryContextAttributes failed with error 0x%08x\n", r); - goto failed; - } - conn->signature_auth_len = secctx_sizes.cbMaxSignature; - conn->encryption_auth_len = secctx_sizes.cbSecurityTrailer; - } - - return RPC_S_OK; - -failed: - HeapFree(GetProcessHeap(), 0, out->pvBuffer); - out->pvBuffer = NULL; - return ERROR_ACCESS_DENIED; /* FIXME: is this correct? */ -} - -/*********************************************************************** - * RPCRT4_AuthorizeBinding (internal) - */ -static RPC_STATUS RPCRT_AuthorizeConnection(RpcConnection* conn, - BYTE *challenge, ULONG count) -{ - SecBuffer inp, out; - RpcPktHdr *resp_hdr; - RPC_STATUS status; - - TRACE("challenge %s, %d bytes\n", challenge, count); - - inp.BufferType = SECBUFFER_TOKEN; - inp.pvBuffer = challenge; - inp.cbBuffer = count; - - status = RPCRT4_ClientAuthorize(conn, &inp, &out); - if (status) return status; - - resp_hdr = RPCRT4_BuildAuthHeader(NDR_LOCAL_DATA_REPRESENTATION); - if (!resp_hdr) - return E_OUTOFMEMORY; - - status = RPCRT4_SendAuth(conn, resp_hdr, NULL, 0, out.pvBuffer, out.cbBuffer); - - HeapFree(GetProcessHeap(), 0, out.pvBuffer); - RPCRT4_FreeHeader(resp_hdr); - - return status; -} - -/*********************************************************************** - * RPCRT4_Send (internal) - * - * Transmit a packet over connection in acceptable fragments. - */ -RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, - void *Buffer, unsigned int BufferLength) -{ - RPC_STATUS r; - SecBuffer out; - - if (!Connection->AuthInfo || SecIsValidHandle(&Connection->ctx)) - { - return RPCRT4_SendAuth(Connection, Header, Buffer, BufferLength, NULL, 0); - } - - /* tack on a negotiate packet */ - RPCRT4_ClientAuthorize(Connection, NULL, &out); - r = RPCRT4_SendAuth(Connection, Header, Buffer, BufferLength, out.pvBuffer, out.cbBuffer); - HeapFree(GetProcessHeap(), 0, out.pvBuffer); - - return r; -} - -/*********************************************************************** - * RPCRT4_Receive (internal) - * - * Receive a packet from connection and merge the fragments. - */ -RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, - PRPC_MESSAGE pMsg) -{ - RPC_STATUS status; - DWORD hdr_length; - LONG dwRead; - unsigned short first_flag; - unsigned long data_length; - unsigned long buffer_length; - unsigned long auth_length; - unsigned char *auth_data = NULL; - RpcPktCommonHdr common_hdr; - - *Header = NULL; - - TRACE("(%p, %p, %p)\n", Connection, Header, pMsg); - - /* read packet common header */ - dwRead = rpcrt4_conn_read(Connection, &common_hdr, sizeof(common_hdr)); - if (dwRead != sizeof(common_hdr)) { - WARN("Short read of header, %d bytes\n", dwRead); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - /* verify if the header really makes sense */ - if (common_hdr.rpc_ver != RPC_VER_MAJOR || - common_hdr.rpc_ver_minor != RPC_VER_MINOR) { - WARN("unhandled packet version\n"); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - hdr_length = RPCRT4_GetHeaderSize((RpcPktHdr*)&common_hdr); - if (hdr_length == 0) { - WARN("header length == 0\n"); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - *Header = HeapAlloc(GetProcessHeap(), 0, hdr_length); - memcpy(*Header, &common_hdr, sizeof(common_hdr)); - - /* read the rest of packet header */ - dwRead = rpcrt4_conn_read(Connection, &(*Header)->common + 1, hdr_length - sizeof(common_hdr)); - if (dwRead != hdr_length - sizeof(common_hdr)) { - WARN("bad header length, %d bytes, hdr_length %d\n", dwRead, hdr_length); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - /* read packet body */ - switch (common_hdr.ptype) { - case PKT_RESPONSE: - pMsg->BufferLength = (*Header)->response.alloc_hint; - break; - case PKT_REQUEST: - pMsg->BufferLength = (*Header)->request.alloc_hint; - break; - default: - pMsg->BufferLength = common_hdr.frag_len - hdr_length - RPC_AUTH_VERIFIER_LEN(&common_hdr); - } - - TRACE("buffer length = %u\n", pMsg->BufferLength); - - status = I_RpcGetBuffer(pMsg); - if (status != RPC_S_OK) goto fail; - - first_flag = RPC_FLG_FIRST; - auth_length = common_hdr.auth_len; - if (auth_length) { - auth_data = HeapAlloc(GetProcessHeap(), 0, RPC_AUTH_VERIFIER_LEN(&common_hdr)); - if (!auth_data) { - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - } - buffer_length = 0; - while (TRUE) - { - unsigned int header_auth_len = RPC_AUTH_VERIFIER_LEN(&(*Header)->common); - - /* verify header fields */ - - if (((*Header)->common.frag_len < hdr_length) || - ((*Header)->common.frag_len - hdr_length < header_auth_len)) { - WARN("frag_len %d too small for hdr_length %d and auth_len %d\n", - (*Header)->common.frag_len, hdr_length, header_auth_len); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - if ((*Header)->common.auth_len != auth_length) { - WARN("auth_len header field changed from %ld to %d\n", - auth_length, (*Header)->common.auth_len); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - if (((*Header)->common.flags & RPC_FLG_FIRST) != first_flag) { - TRACE("invalid packet flags\n"); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - data_length = (*Header)->common.frag_len - hdr_length - header_auth_len; - if (data_length + buffer_length > pMsg->BufferLength) { - TRACE("allocation hint exceeded, new buffer length = %ld\n", - data_length + buffer_length); - pMsg->BufferLength = data_length + buffer_length; - status = I_RpcReAllocateBuffer(pMsg); - if (status != RPC_S_OK) goto fail; - } - - if (data_length == 0) dwRead = 0; else - dwRead = rpcrt4_conn_read(Connection, - (unsigned char *)pMsg->Buffer + buffer_length, data_length); - if (dwRead != data_length) { - WARN("bad data length, %d/%ld\n", dwRead, data_length); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - if (header_auth_len) { - if (header_auth_len < sizeof(RpcAuthVerifier)) { - WARN("bad auth verifier length %d\n", header_auth_len); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - /* FIXME: we should accumulate authentication data for the bind, - * bind_ack, alter_context and alter_context_response if necessary. - * however, the details of how this is done is very sketchy in the - * DCE/RPC spec. for all other packet types that have authentication - * verifier data then it is just duplicated in all the fragments */ - dwRead = rpcrt4_conn_read(Connection, auth_data, header_auth_len); - if (dwRead != header_auth_len) { - WARN("bad authentication data length, %d/%d\n", dwRead, - header_auth_len); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - /* these packets are handled specially, not by the generic SecurePacket - * function */ - if ((common_hdr.ptype != PKT_BIND) && - (common_hdr.ptype != PKT_BIND_ACK) && - (common_hdr.ptype != PKT_AUTH3)) - status = RPCRT4_SecurePacket(Connection, SECURE_PACKET_RECEIVE, - *Header, hdr_length, - (unsigned char *)pMsg->Buffer + buffer_length, data_length, - (RpcAuthVerifier *)auth_data, - (unsigned char *)auth_data + sizeof(RpcAuthVerifier), - header_auth_len - sizeof(RpcAuthVerifier)); - } - - buffer_length += data_length; - if (!((*Header)->common.flags & RPC_FLG_LAST)) { - TRACE("next header\n"); - - /* read the header of next packet */ - dwRead = rpcrt4_conn_read(Connection, *Header, hdr_length); - if (dwRead != hdr_length) { - WARN("invalid packet header size (%d)\n", dwRead); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - first_flag = 0; - } else { - break; - } - } - pMsg->BufferLength = buffer_length; - - /* respond to authorization request */ - if (common_hdr.ptype == PKT_BIND_ACK && auth_length > sizeof(RpcAuthVerifier)) - { - status = RPCRT_AuthorizeConnection(Connection, - auth_data + sizeof(RpcAuthVerifier), - auth_length); - if (status) - goto fail; - } - - /* success */ - status = RPC_S_OK; - -fail: - if (status != RPC_S_OK) { - RPCRT4_FreeHeader(*Header); - *Header = NULL; - } - HeapFree(GetProcessHeap(), 0, auth_data); - return status; -} - -/*********************************************************************** - * I_RpcGetBuffer [RPCRT4.@] - * - * Allocates a buffer for use by I_RpcSend or I_RpcSendReceive and binds to the - * server interface. - * - * PARAMS - * pMsg [I/O] RPC message information. - * - * RETURNS - * Success: RPC_S_OK. - * Failure: RPC_S_INVALID_BINDING if pMsg->Handle is invalid. - * RPC_S_SERVER_UNAVAILABLE if unable to connect to server. - * ERROR_OUTOFMEMORY if buffer allocation failed. - * - * NOTES - * The pMsg->BufferLength field determines the size of the buffer to allocate, - * in bytes. - * - * Use I_RpcFreeBuffer() to unbind from the server and free the message buffer. - * - * SEE ALSO - * I_RpcFreeBuffer(), I_RpcSend(), I_RpcReceive(), I_RpcSendReceive(). - */ -RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg) -{ - TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength); - /* FIXME: pfnAllocate? */ - pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->BufferLength); - - TRACE("Buffer=%p\n", pMsg->Buffer); - /* FIXME: which errors to return? */ - return pMsg->Buffer ? S_OK : E_OUTOFMEMORY; -} - -/*********************************************************************** - * I_RpcReAllocateBuffer (internal) - */ -static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg) -{ - TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength); - pMsg->Buffer = HeapReAlloc(GetProcessHeap(), 0, pMsg->Buffer, pMsg->BufferLength); - - TRACE("Buffer=%p\n", pMsg->Buffer); - return pMsg->Buffer ? RPC_S_OK : RPC_S_OUT_OF_RESOURCES; -} - -/*********************************************************************** - * I_RpcFreeBuffer [RPCRT4.@] - * - * Frees a buffer allocated by I_RpcGetBuffer or I_RpcReceive and unbinds from - * the server interface. - * - * PARAMS - * pMsg [I/O] RPC message information. - * - * RETURNS - * RPC_S_OK. - * - * SEE ALSO - * I_RpcGetBuffer(), I_RpcReceive(). - */ -RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg) -{ - TRACE("(%p) Buffer=%p\n", pMsg, pMsg->Buffer); - /* FIXME: pfnFree? */ - HeapFree(GetProcessHeap(), 0, pMsg->Buffer); - pMsg->Buffer = NULL; - return S_OK; -} - -/*********************************************************************** - * I_RpcSend [RPCRT4.@] - * - * Sends a message to the server. - * - * PARAMS - * pMsg [I/O] RPC message information. - * - * RETURNS - * Unknown. - * - * NOTES - * The buffer must have been allocated with I_RpcGetBuffer(). - * - * SEE ALSO - * I_RpcGetBuffer(), I_RpcReceive(), I_RpcSendReceive(). - */ -RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) -{ - RpcBinding* bind = (RpcBinding*)pMsg->Handle; - RpcConnection* conn; - RPC_CLIENT_INTERFACE* cif = NULL; - RPC_STATUS status; - RpcPktHdr *hdr; - - TRACE("(%p)\n", pMsg); - if (!bind || bind->server) return RPC_S_INVALID_BINDING; - - cif = pMsg->RpcInterfaceInformation; - if (!cif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */ - - if (!bind->Endpoint || !bind->Endpoint[0]) - { - TRACE("automatically resolving partially bound binding\n"); - status = RpcEpResolveBinding(bind, cif); - if (status != RPC_S_OK) return status; - } - - status = RPCRT4_OpenBinding(bind, &conn, &cif->TransferSyntax, - &cif->InterfaceId); - if (status != RPC_S_OK) return status; - - hdr = RPCRT4_BuildRequestHeader(pMsg->DataRepresentation, - pMsg->BufferLength, pMsg->ProcNum, - &bind->ObjectUuid); - if (!hdr) - { - RPCRT4_CloseBinding(bind, conn); - return ERROR_OUTOFMEMORY; - } - hdr->common.call_id = conn->NextCallId++; - - status = RPCRT4_Send(conn, hdr, pMsg->Buffer, pMsg->BufferLength); - - RPCRT4_FreeHeader(hdr); - - /* save the connection, so the response can be read from it */ - pMsg->ReservedForRuntime = conn; - return status; -} - -/* is this status something that the server can't recover from? */ -static inline BOOL is_hard_error(RPC_STATUS status) -{ - switch (status) - { - case 0: /* user-defined fault */ - case ERROR_ACCESS_DENIED: - case ERROR_INVALID_PARAMETER: - case RPC_S_PROTOCOL_ERROR: - case RPC_S_CALL_FAILED: - case RPC_S_CALL_FAILED_DNE: - case RPC_S_SEC_PKG_ERROR: - return TRUE; - default: - return FALSE; - } -} - -/*********************************************************************** - * I_RpcReceive [RPCRT4.@] - */ -RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg) -{ - RpcBinding* bind = (RpcBinding*)pMsg->Handle; - RpcConnection* conn; - RPC_CLIENT_INTERFACE* cif = NULL; - RPC_SERVER_INTERFACE* sif = NULL; - RPC_STATUS status; - RpcPktHdr *hdr = NULL; - - TRACE("(%p)\n", pMsg); - if (!bind) return RPC_S_INVALID_BINDING; - - if (pMsg->ReservedForRuntime) { - conn = pMsg->ReservedForRuntime; - pMsg->ReservedForRuntime = NULL; - } else { - if (bind->server) { - sif = pMsg->RpcInterfaceInformation; - if (!sif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */ - status = RPCRT4_OpenBinding(bind, &conn, &sif->TransferSyntax, - &sif->InterfaceId); - } else { - cif = pMsg->RpcInterfaceInformation; - if (!cif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */ - - if (!bind->Endpoint || !bind->Endpoint[0]) - { - TRACE("automatically resolving partially bound binding\n"); - status = RpcEpResolveBinding(bind, cif); - if (status != RPC_S_OK) return status; - } - - status = RPCRT4_OpenBinding(bind, &conn, &cif->TransferSyntax, - &cif->InterfaceId); - } - if (status != RPC_S_OK) return status; - } - - status = RPCRT4_Receive(conn, &hdr, pMsg); - if (status != RPC_S_OK) { - WARN("receive failed with error %lx\n", status); - goto fail; - } - - switch (hdr->common.ptype) { - case PKT_RESPONSE: - if (bind->server) { - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - break; - case PKT_REQUEST: - if (!bind->server) { - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - break; - case PKT_FAULT: - ERR ("we got fault packet with status 0x%lx\n", hdr->fault.status); - status = NCA2RPC_STATUS(hdr->fault.status); - if (is_hard_error(status)) - goto fail; - break; - default: - WARN("bad packet type %d\n", hdr->common.ptype); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } - - /* success */ - RPCRT4_CloseBinding(bind, conn); - RPCRT4_FreeHeader(hdr); - return status; - -fail: - RPCRT4_FreeHeader(hdr); - RPCRT4_DestroyConnection(conn); - return status; -} - -/*********************************************************************** - * I_RpcSendReceive [RPCRT4.@] - * - * Sends a message to the server and receives the response. - * - * PARAMS - * pMsg [I/O] RPC message information. - * - * RETURNS - * Success: RPC_S_OK. - * Failure: Any error code. - * - * NOTES - * The buffer must have been allocated with I_RpcGetBuffer(). - * - * SEE ALSO - * I_RpcGetBuffer(), I_RpcSend(), I_RpcReceive(). - */ -RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg) -{ - RPC_STATUS status; - RPC_MESSAGE original_message; - - TRACE("(%p)\n", pMsg); - - original_message = *pMsg; - status = I_RpcSend(pMsg); - if (status == RPC_S_OK) - status = I_RpcReceive(pMsg); - /* free the buffer replaced by a new buffer in I_RpcReceive */ - if (status == RPC_S_OK) - I_RpcFreeBuffer(&original_message); - return status; -} +/* + * RPC messages + * + * Copyright 2001-2002 Ove Kåven, TransGaming Technologies + * Copyright 2004 Filip Navara + * Copyright 2006 CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" + +#include "rpc.h" +#include "rpcndr.h" +#include "rpcdcep.h" + +#include "wine/debug.h" + +#include "rpc_binding.h" +#include "rpc_defs.h" +#include "rpc_message.h" +#include "ncastatus.h" + +WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +/* note: the DCE/RPC spec says the alignment amount should be 4, but + * MS/RPC servers seem to always use 16 */ +#define AUTH_ALIGNMENT 16 + +/* gets the amount needed to round a value up to the specified alignment */ +#define ROUND_UP_AMOUNT(value, alignment) \ + (((alignment) - (((value) % (alignment)))) % (alignment)) +#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1)) + +enum secure_packet_direction +{ + SECURE_PACKET_SEND, + SECURE_PACKET_RECEIVE +}; + +static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg); + +static DWORD RPCRT4_GetHeaderSize(const RpcPktHdr *Header) +{ + static const DWORD header_sizes[] = { + sizeof(Header->request), 0, sizeof(Header->response), + sizeof(Header->fault), 0, 0, 0, 0, 0, 0, 0, sizeof(Header->bind), + sizeof(Header->bind_ack), sizeof(Header->bind_nack), + 0, 0, 0, 0, 0 + }; + ULONG ret = 0; + + if (Header->common.ptype < sizeof(header_sizes) / sizeof(header_sizes[0])) { + ret = header_sizes[Header->common.ptype]; + if (ret == 0) + FIXME("unhandled packet type\n"); + if (Header->common.flags & RPC_FLG_OBJECT_UUID) + ret += sizeof(UUID); + } else { + TRACE("invalid packet type\n"); + } + + return ret; +} + +static int packet_has_body(const RpcPktHdr *Header) +{ + return (Header->common.ptype == PKT_FAULT) || + (Header->common.ptype == PKT_REQUEST) || + (Header->common.ptype == PKT_RESPONSE); +} + +static int packet_has_auth_verifier(const RpcPktHdr *Header) +{ + return !(Header->common.ptype == PKT_BIND_NACK) && + !(Header->common.ptype == PKT_SHUTDOWN); +} + +static VOID RPCRT4_BuildCommonHeader(RpcPktHdr *Header, unsigned char PacketType, + unsigned long DataRepresentation) +{ + Header->common.rpc_ver = RPC_VER_MAJOR; + Header->common.rpc_ver_minor = RPC_VER_MINOR; + Header->common.ptype = PacketType; + Header->common.drep[0] = LOBYTE(LOWORD(DataRepresentation)); + Header->common.drep[1] = HIBYTE(LOWORD(DataRepresentation)); + Header->common.drep[2] = LOBYTE(HIWORD(DataRepresentation)); + Header->common.drep[3] = HIBYTE(HIWORD(DataRepresentation)); + Header->common.auth_len = 0; + Header->common.call_id = 1; + Header->common.flags = 0; + /* Flags and fragment length are computed in RPCRT4_Send. */ +} + +static RpcPktHdr *RPCRT4_BuildRequestHeader(unsigned long DataRepresentation, + unsigned long BufferLength, + unsigned short ProcNum, + UUID *ObjectUuid) +{ + RpcPktHdr *header; + BOOL has_object; + RPC_STATUS status; + + has_object = (ObjectUuid != NULL && !UuidIsNil(ObjectUuid, &status)); + header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(header->request) + (has_object ? sizeof(UUID) : 0)); + if (header == NULL) { + return NULL; + } + + RPCRT4_BuildCommonHeader(header, PKT_REQUEST, DataRepresentation); + header->common.frag_len = sizeof(header->request); + header->request.alloc_hint = BufferLength; + header->request.context_id = 0; + header->request.opnum = ProcNum; + if (has_object) { + header->common.flags |= RPC_FLG_OBJECT_UUID; + header->common.frag_len += sizeof(UUID); + memcpy(&header->request + 1, ObjectUuid, sizeof(UUID)); + } + + return header; +} + +RpcPktHdr *RPCRT4_BuildResponseHeader(unsigned long DataRepresentation, + unsigned long BufferLength) +{ + RpcPktHdr *header; + + header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->response)); + if (header == NULL) { + return NULL; + } + + RPCRT4_BuildCommonHeader(header, PKT_RESPONSE, DataRepresentation); + header->common.frag_len = sizeof(header->response); + header->response.alloc_hint = BufferLength; + + return header; +} + +RpcPktHdr *RPCRT4_BuildFaultHeader(unsigned long DataRepresentation, + RPC_STATUS Status) +{ + RpcPktHdr *header; + + header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->fault)); + if (header == NULL) { + return NULL; + } + + RPCRT4_BuildCommonHeader(header, PKT_FAULT, DataRepresentation); + header->common.frag_len = sizeof(header->fault); + header->fault.status = Status; + + return header; +} + +RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation, + unsigned short MaxTransmissionSize, + unsigned short MaxReceiveSize, + unsigned long AssocGroupId, + const RPC_SYNTAX_IDENTIFIER *AbstractId, + const RPC_SYNTAX_IDENTIFIER *TransferId) +{ + RpcPktHdr *header; + + header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->bind)); + if (header == NULL) { + return NULL; + } + + RPCRT4_BuildCommonHeader(header, PKT_BIND, DataRepresentation); + header->common.frag_len = sizeof(header->bind); + header->bind.max_tsize = MaxTransmissionSize; + header->bind.max_rsize = MaxReceiveSize; + header->bind.assoc_gid = AssocGroupId; + header->bind.num_elements = 1; + header->bind.num_syntaxes = 1; + memcpy(&header->bind.abstract, AbstractId, sizeof(RPC_SYNTAX_IDENTIFIER)); + memcpy(&header->bind.transfer, TransferId, sizeof(RPC_SYNTAX_IDENTIFIER)); + + return header; +} + +static RpcPktHdr *RPCRT4_BuildAuthHeader(unsigned long DataRepresentation) +{ + RpcPktHdr *header; + + header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(header->common) + 12); + if (header == NULL) + return NULL; + + RPCRT4_BuildCommonHeader(header, PKT_AUTH3, DataRepresentation); + header->common.frag_len = 0x14; + header->common.auth_len = 0; + + return header; +} + +RpcPktHdr *RPCRT4_BuildBindNackHeader(unsigned long DataRepresentation, + unsigned char RpcVersion, + unsigned char RpcVersionMinor) +{ + RpcPktHdr *header; + + header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(header->bind_nack)); + if (header == NULL) { + return NULL; + } + + RPCRT4_BuildCommonHeader(header, PKT_BIND_NACK, DataRepresentation); + header->common.frag_len = sizeof(header->bind_nack); + header->bind_nack.reject_reason = REJECT_REASON_NOT_SPECIFIED; + header->bind_nack.protocols_count = 1; + header->bind_nack.protocols[0].rpc_ver = RpcVersion; + header->bind_nack.protocols[0].rpc_ver_minor = RpcVersionMinor; + + return header; +} + +RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation, + unsigned short MaxTransmissionSize, + unsigned short MaxReceiveSize, + LPCSTR ServerAddress, + unsigned long Result, + unsigned long Reason, + const RPC_SYNTAX_IDENTIFIER *TransferId) +{ + RpcPktHdr *header; + unsigned long header_size; + RpcAddressString *server_address; + RpcResults *results; + RPC_SYNTAX_IDENTIFIER *transfer_id; + + header_size = sizeof(header->bind_ack) + + ROUND_UP(FIELD_OFFSET(RpcAddressString, string[strlen(ServerAddress) + 1]), 4) + + sizeof(RpcResults) + + sizeof(RPC_SYNTAX_IDENTIFIER); + + header = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, header_size); + if (header == NULL) { + return NULL; + } + + RPCRT4_BuildCommonHeader(header, PKT_BIND_ACK, DataRepresentation); + header->common.frag_len = header_size; + header->bind_ack.max_tsize = MaxTransmissionSize; + header->bind_ack.max_rsize = MaxReceiveSize; + server_address = (RpcAddressString*)(&header->bind_ack + 1); + server_address->length = strlen(ServerAddress) + 1; + strcpy(server_address->string, ServerAddress); + /* results is 4-byte aligned */ + results = (RpcResults*)((ULONG_PTR)server_address + ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4)); + results->num_results = 1; + results->results[0].result = Result; + results->results[0].reason = Reason; + transfer_id = (RPC_SYNTAX_IDENTIFIER*)(results + 1); + memcpy(transfer_id, TransferId, sizeof(RPC_SYNTAX_IDENTIFIER)); + + return header; +} + +VOID RPCRT4_FreeHeader(RpcPktHdr *Header) +{ + HeapFree(GetProcessHeap(), 0, Header); +} + +NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status) +{ + switch (status) + { + case ERROR_INVALID_HANDLE: return NCA_S_FAULT_CONTEXT_MISMATCH; + case ERROR_OUTOFMEMORY: return NCA_S_FAULT_REMOTE_NO_MEMORY; + case RPC_S_NOT_LISTENING: return NCA_S_SERVER_TOO_BUSY; + case RPC_S_UNKNOWN_IF: return NCA_S_UNK_IF; + case RPC_S_SERVER_TOO_BUSY: return NCA_S_SERVER_TOO_BUSY; + case RPC_S_CALL_FAILED: return NCA_S_FAULT_UNSPEC; + case RPC_S_CALL_FAILED_DNE: return NCA_S_MANAGER_NOT_ENTERED; + case RPC_S_PROTOCOL_ERROR: return NCA_S_PROTO_ERROR; + case RPC_S_UNSUPPORTED_TYPE: return NCA_S_UNSUPPORTED_TYPE; + case RPC_S_INVALID_TAG: return NCA_S_FAULT_INVALID_TAG; + case RPC_S_INVALID_BOUND: return NCA_S_FAULT_INVALID_BOUND; + case RPC_S_PROCNUM_OUT_OF_RANGE: return NCA_S_OP_RNG_ERROR; + case RPC_X_SS_HANDLES_MISMATCH: return NCA_S_FAULT_CONTEXT_MISMATCH; + case RPC_S_CALL_CANCELLED: return NCA_S_FAULT_CANCEL; + case RPC_S_COMM_FAILURE: return NCA_S_COMM_FAILURE; + case RPC_X_WRONG_PIPE_ORDER: return NCA_S_FAULT_PIPE_ORDER; + case RPC_X_PIPE_CLOSED: return NCA_S_FAULT_PIPE_CLOSED; + case RPC_X_PIPE_DISCIPLINE_ERROR: return NCA_S_FAULT_PIPE_DISCIPLINE; + case RPC_X_PIPE_EMPTY: return NCA_S_FAULT_PIPE_EMPTY; + case STATUS_FLOAT_DIVIDE_BY_ZERO: return NCA_S_FAULT_FP_DIV_ZERO; + case STATUS_FLOAT_INVALID_OPERATION: return NCA_S_FAULT_FP_ERROR; + case STATUS_FLOAT_OVERFLOW: return NCA_S_FAULT_FP_OVERFLOW; + case STATUS_FLOAT_UNDERFLOW: return NCA_S_FAULT_FP_UNDERFLOW; + case STATUS_INTEGER_DIVIDE_BY_ZERO: return NCA_S_FAULT_INT_DIV_BY_ZERO; + case STATUS_INTEGER_OVERFLOW: return NCA_S_FAULT_INT_OVERFLOW; + default: return status; + } +} + +RPC_STATUS NCA2RPC_STATUS(NCA_STATUS status) +{ + switch (status) + { + case NCA_S_COMM_FAILURE: return RPC_S_COMM_FAILURE; + case NCA_S_OP_RNG_ERROR: return RPC_S_PROCNUM_OUT_OF_RANGE; + case NCA_S_UNK_IF: return RPC_S_UNKNOWN_IF; + case NCA_S_YOU_CRASHED: return RPC_S_CALL_FAILED; + case NCA_S_PROTO_ERROR: return RPC_S_PROTOCOL_ERROR; + case NCA_S_OUT_ARGS_TOO_BIG: return ERROR_NOT_ENOUGH_SERVER_MEMORY; + case NCA_S_SERVER_TOO_BUSY: return RPC_S_SERVER_TOO_BUSY; + case NCA_S_UNSUPPORTED_TYPE: return RPC_S_UNSUPPORTED_TYPE; + case NCA_S_FAULT_INT_DIV_BY_ZERO: return RPC_S_ZERO_DIVIDE; + case NCA_S_FAULT_ADDR_ERROR: return RPC_S_ADDRESS_ERROR; + case NCA_S_FAULT_FP_DIV_ZERO: return RPC_S_FP_DIV_ZERO; + case NCA_S_FAULT_FP_UNDERFLOW: return RPC_S_FP_UNDERFLOW; + case NCA_S_FAULT_FP_OVERFLOW: return RPC_S_FP_OVERFLOW; + case NCA_S_FAULT_INVALID_TAG: return RPC_S_INVALID_TAG; + case NCA_S_FAULT_INVALID_BOUND: return RPC_S_INVALID_BOUND; + case NCA_S_RPC_VERSION_MISMATCH: return RPC_S_PROTOCOL_ERROR; + case NCA_S_UNSPEC_REJECT: return RPC_S_CALL_FAILED_DNE; + case NCA_S_BAD_ACTID: return RPC_S_CALL_FAILED_DNE; + case NCA_S_WHO_ARE_YOU_FAILED: return RPC_S_CALL_FAILED; + case NCA_S_MANAGER_NOT_ENTERED: return RPC_S_CALL_FAILED_DNE; + case NCA_S_FAULT_CANCEL: return RPC_S_CALL_CANCELLED; + case NCA_S_FAULT_ILL_INST: return RPC_S_ADDRESS_ERROR; + case NCA_S_FAULT_FP_ERROR: return RPC_S_FP_OVERFLOW; + case NCA_S_FAULT_INT_OVERFLOW: return RPC_S_ADDRESS_ERROR; + case NCA_S_FAULT_UNSPEC: return RPC_S_CALL_FAILED; + case NCA_S_FAULT_PIPE_EMPTY: return RPC_X_PIPE_EMPTY; + case NCA_S_FAULT_PIPE_CLOSED: return RPC_X_PIPE_CLOSED; + case NCA_S_FAULT_PIPE_ORDER: return RPC_X_WRONG_PIPE_ORDER; + case NCA_S_FAULT_PIPE_DISCIPLINE: return RPC_X_PIPE_DISCIPLINE_ERROR; + case NCA_S_FAULT_PIPE_COMM_ERROR: return RPC_S_COMM_FAILURE; + case NCA_S_FAULT_PIPE_MEMORY: return ERROR_OUTOFMEMORY; + case NCA_S_FAULT_CONTEXT_MISMATCH: return ERROR_INVALID_HANDLE; + case NCA_S_FAULT_REMOTE_NO_MEMORY: return ERROR_NOT_ENOUGH_SERVER_MEMORY; + default: return status; + } +} + +static RPC_STATUS RPCRT4_SecurePacket(RpcConnection *Connection, + enum secure_packet_direction dir, + RpcPktHdr *hdr, unsigned int hdr_size, + unsigned char *stub_data, unsigned int stub_data_size, + RpcAuthVerifier *auth_hdr, + unsigned char *auth_value, unsigned int auth_value_size) +{ + SecBufferDesc message; + SecBuffer buffers[4]; + SECURITY_STATUS sec_status; + + message.ulVersion = SECBUFFER_VERSION; + message.cBuffers = sizeof(buffers)/sizeof(buffers[0]); + message.pBuffers = buffers; + + buffers[0].cbBuffer = hdr_size; + buffers[0].BufferType = SECBUFFER_DATA|SECBUFFER_READONLY_WITH_CHECKSUM; + buffers[0].pvBuffer = hdr; + buffers[1].cbBuffer = stub_data_size; + buffers[1].BufferType = SECBUFFER_DATA; + buffers[1].pvBuffer = stub_data; + buffers[2].cbBuffer = sizeof(*auth_hdr); + buffers[2].BufferType = SECBUFFER_DATA|SECBUFFER_READONLY_WITH_CHECKSUM; + buffers[2].pvBuffer = auth_hdr; + buffers[3].cbBuffer = auth_value_size; + buffers[3].BufferType = SECBUFFER_TOKEN; + buffers[3].pvBuffer = auth_value; + + if (dir == SECURE_PACKET_SEND) + { + if ((auth_hdr->auth_level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) && packet_has_body(hdr)) + { + sec_status = EncryptMessage(&Connection->ctx, 0, &message, 0 /* FIXME */); + if (sec_status != SEC_E_OK) + { + ERR("EncryptMessage failed with 0x%08x\n", sec_status); + return RPC_S_SEC_PKG_ERROR; + } + } + else if (auth_hdr->auth_level != RPC_C_AUTHN_LEVEL_NONE) + { + sec_status = MakeSignature(&Connection->ctx, 0, &message, 0 /* FIXME */); + if (sec_status != SEC_E_OK) + { + ERR("MakeSignature failed with 0x%08x\n", sec_status); + return RPC_S_SEC_PKG_ERROR; + } + } + } + else if (dir == SECURE_PACKET_RECEIVE) + { + if ((auth_hdr->auth_level == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) && packet_has_body(hdr)) + { + sec_status = DecryptMessage(&Connection->ctx, &message, 0 /* FIXME */, 0); + if (sec_status != SEC_E_OK) + { + ERR("EncryptMessage failed with 0x%08x\n", sec_status); + return RPC_S_SEC_PKG_ERROR; + } + } + else if (auth_hdr->auth_level != RPC_C_AUTHN_LEVEL_NONE) + { + sec_status = VerifySignature(&Connection->ctx, &message, 0 /* FIXME */, NULL); + if (sec_status != SEC_E_OK) + { + ERR("VerifySignature failed with 0x%08x\n", sec_status); + return RPC_S_SEC_PKG_ERROR; + } + } + } + + return RPC_S_OK; +} + +/*********************************************************************** + * RPCRT4_SendAuth (internal) + * + * Transmit a packet with authorization data over connection in acceptable fragments. + */ +static RPC_STATUS RPCRT4_SendAuth(RpcConnection *Connection, RpcPktHdr *Header, + void *Buffer, unsigned int BufferLength, + const void *Auth, unsigned int AuthLength) +{ + PUCHAR buffer_pos; + DWORD hdr_size; + LONG count; + unsigned char *pkt; + LONG alen; + RPC_STATUS status; + + buffer_pos = Buffer; + /* The packet building functions save the packet header size, so we can use it. */ + hdr_size = Header->common.frag_len; + if (AuthLength) + Header->common.auth_len = AuthLength; + else if (Connection->AuthInfo && packet_has_auth_verifier(Header)) + { + if ((Connection->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) && packet_has_body(Header)) + Header->common.auth_len = Connection->encryption_auth_len; + else + Header->common.auth_len = Connection->signature_auth_len; + } + else + Header->common.auth_len = 0; + Header->common.flags |= RPC_FLG_FIRST; + Header->common.flags &= ~RPC_FLG_LAST; + + alen = RPC_AUTH_VERIFIER_LEN(&Header->common); + + while (!(Header->common.flags & RPC_FLG_LAST)) { + unsigned char auth_pad_len = Header->common.auth_len ? ROUND_UP_AMOUNT(BufferLength, AUTH_ALIGNMENT) : 0; + unsigned int pkt_size = BufferLength + hdr_size + alen + auth_pad_len; + + /* decide if we need to split the packet into fragments */ + if (pkt_size <= Connection->MaxTransmissionSize) { + Header->common.flags |= RPC_FLG_LAST; + Header->common.frag_len = pkt_size; + } else { + auth_pad_len = 0; + /* make sure packet payload will be a multiple of 16 */ + Header->common.frag_len = + ((Connection->MaxTransmissionSize - hdr_size - alen) & ~(AUTH_ALIGNMENT-1)) + + hdr_size + alen; + } + + pkt = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Header->common.frag_len); + + memcpy(pkt, Header, hdr_size); + + /* fragment consisted of header only and is the last one */ + if (hdr_size == Header->common.frag_len) + goto write; + + memcpy(pkt + hdr_size, buffer_pos, Header->common.frag_len - hdr_size - auth_pad_len - alen); + + /* add the authorization info */ + if (Connection->AuthInfo && packet_has_auth_verifier(Header)) + { + RpcAuthVerifier *auth_hdr = (RpcAuthVerifier *)&pkt[Header->common.frag_len - alen]; + + auth_hdr->auth_type = Connection->AuthInfo->AuthnSvc; + auth_hdr->auth_level = Connection->AuthInfo->AuthnLevel; + auth_hdr->auth_pad_length = auth_pad_len; + auth_hdr->auth_reserved = 0; + /* a unique number... */ + auth_hdr->auth_context_id = (unsigned long)Connection; + + if (AuthLength) + memcpy(auth_hdr + 1, Auth, AuthLength); + else + { + status = RPCRT4_SecurePacket(Connection, SECURE_PACKET_SEND, + (RpcPktHdr *)pkt, hdr_size, + pkt + hdr_size, Header->common.frag_len - hdr_size - alen, + auth_hdr, + (unsigned char *)(auth_hdr + 1), Header->common.auth_len); + if (status != RPC_S_OK) + { + HeapFree(GetProcessHeap(), 0, pkt); + return status; + } + } + } + +write: + count = rpcrt4_conn_write(Connection, pkt, Header->common.frag_len); + HeapFree(GetProcessHeap(), 0, pkt); + if (count<0) { + WARN("rpcrt4_conn_write failed (auth)\n"); + return RPC_S_PROTOCOL_ERROR; + } + + buffer_pos += Header->common.frag_len - hdr_size - alen - auth_pad_len; + BufferLength -= Header->common.frag_len - hdr_size - alen - auth_pad_len; + Header->common.flags &= ~RPC_FLG_FIRST; + } + + return RPC_S_OK; +} + +/*********************************************************************** + * RPCRT4_ClientAuthorize (internal) + * + * Authorize a client connection. A NULL in param signifies a new connection. + */ +static RPC_STATUS RPCRT4_ClientAuthorize(RpcConnection *conn, SecBuffer *in, + SecBuffer *out) +{ + SECURITY_STATUS r; + SecBufferDesc out_desc; + SecBufferDesc inp_desc; + SecPkgContext_Sizes secctx_sizes; + BOOL continue_needed; + ULONG context_req = ISC_REQ_CONNECTION | ISC_REQ_USE_DCE_STYLE | + ISC_REQ_MUTUAL_AUTH | ISC_REQ_DELEGATE; + + if (conn->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_PKT_INTEGRITY) + context_req |= ISC_REQ_INTEGRITY; + else if (conn->AuthInfo->AuthnLevel == RPC_C_AUTHN_LEVEL_PKT_PRIVACY) + context_req |= ISC_REQ_CONFIDENTIALITY | ISC_REQ_INTEGRITY; + + out->BufferType = SECBUFFER_TOKEN; + out->cbBuffer = conn->AuthInfo->cbMaxToken; + out->pvBuffer = HeapAlloc(GetProcessHeap(), 0, out->cbBuffer); + if (!out->pvBuffer) return ERROR_OUTOFMEMORY; + + out_desc.ulVersion = 0; + out_desc.cBuffers = 1; + out_desc.pBuffers = out; + + inp_desc.cBuffers = 1; + inp_desc.pBuffers = in; + inp_desc.ulVersion = 0; + + r = InitializeSecurityContextA(&conn->AuthInfo->cred, in ? &conn->ctx : NULL, + NULL, context_req, 0, SECURITY_NETWORK_DREP, + in ? &inp_desc : NULL, 0, &conn->ctx, &out_desc, &conn->attr, + &conn->exp); + if (FAILED(r)) + { + WARN("InitializeSecurityContext failed with error 0x%08x\n", r); + goto failed; + } + + TRACE("r = 0x%08x, attr = 0x%08x\n", r, conn->attr); + continue_needed = ((r == SEC_I_CONTINUE_NEEDED) || + (r == SEC_I_COMPLETE_AND_CONTINUE)); + + if ((r == SEC_I_COMPLETE_NEEDED) || (r == SEC_I_COMPLETE_AND_CONTINUE)) + { + TRACE("complete needed\n"); + r = CompleteAuthToken(&conn->ctx, &out_desc); + if (FAILED(r)) + { + WARN("CompleteAuthToken failed with error 0x%08x\n", r); + goto failed; + } + } + + TRACE("cbBuffer = %ld\n", out->cbBuffer); + + if (!continue_needed) + { + r = QueryContextAttributesA(&conn->ctx, SECPKG_ATTR_SIZES, &secctx_sizes); + if (FAILED(r)) + { + WARN("QueryContextAttributes failed with error 0x%08x\n", r); + goto failed; + } + conn->signature_auth_len = secctx_sizes.cbMaxSignature; + conn->encryption_auth_len = secctx_sizes.cbSecurityTrailer; + } + + return RPC_S_OK; + +failed: + HeapFree(GetProcessHeap(), 0, out->pvBuffer); + out->pvBuffer = NULL; + return ERROR_ACCESS_DENIED; /* FIXME: is this correct? */ +} + +/*********************************************************************** + * RPCRT4_AuthorizeBinding (internal) + */ +static RPC_STATUS RPCRT_AuthorizeConnection(RpcConnection* conn, + BYTE *challenge, ULONG count) +{ + SecBuffer inp, out; + RpcPktHdr *resp_hdr; + RPC_STATUS status; + + TRACE("challenge %s, %d bytes\n", challenge, count); + + inp.BufferType = SECBUFFER_TOKEN; + inp.pvBuffer = challenge; + inp.cbBuffer = count; + + status = RPCRT4_ClientAuthorize(conn, &inp, &out); + if (status) return status; + + resp_hdr = RPCRT4_BuildAuthHeader(NDR_LOCAL_DATA_REPRESENTATION); + if (!resp_hdr) + return E_OUTOFMEMORY; + + status = RPCRT4_SendAuth(conn, resp_hdr, NULL, 0, out.pvBuffer, out.cbBuffer); + + HeapFree(GetProcessHeap(), 0, out.pvBuffer); + RPCRT4_FreeHeader(resp_hdr); + + return status; +} + +/*********************************************************************** + * RPCRT4_Send (internal) + * + * Transmit a packet over connection in acceptable fragments. + */ +RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, + void *Buffer, unsigned int BufferLength) +{ + RPC_STATUS r; + SecBuffer out; + + if (!Connection->AuthInfo || SecIsValidHandle(&Connection->ctx)) + { + return RPCRT4_SendAuth(Connection, Header, Buffer, BufferLength, NULL, 0); + } + + /* tack on a negotiate packet */ + RPCRT4_ClientAuthorize(Connection, NULL, &out); + r = RPCRT4_SendAuth(Connection, Header, Buffer, BufferLength, out.pvBuffer, out.cbBuffer); + HeapFree(GetProcessHeap(), 0, out.pvBuffer); + + return r; +} + +/*********************************************************************** + * RPCRT4_Receive (internal) + * + * Receive a packet from connection and merge the fragments. + */ +RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, + PRPC_MESSAGE pMsg) +{ + RPC_STATUS status; + DWORD hdr_length; + LONG dwRead; + unsigned short first_flag; + unsigned long data_length; + unsigned long buffer_length; + unsigned long auth_length; + unsigned char *auth_data = NULL; + RpcPktCommonHdr common_hdr; + + *Header = NULL; + + TRACE("(%p, %p, %p)\n", Connection, Header, pMsg); + + /* read packet common header */ + dwRead = rpcrt4_conn_read(Connection, &common_hdr, sizeof(common_hdr)); + if (dwRead != sizeof(common_hdr)) { + WARN("Short read of header, %d bytes\n", dwRead); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + /* verify if the header really makes sense */ + if (common_hdr.rpc_ver != RPC_VER_MAJOR || + common_hdr.rpc_ver_minor != RPC_VER_MINOR) { + WARN("unhandled packet version\n"); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + hdr_length = RPCRT4_GetHeaderSize((RpcPktHdr*)&common_hdr); + if (hdr_length == 0) { + WARN("header length == 0\n"); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + *Header = HeapAlloc(GetProcessHeap(), 0, hdr_length); + memcpy(*Header, &common_hdr, sizeof(common_hdr)); + + /* read the rest of packet header */ + dwRead = rpcrt4_conn_read(Connection, &(*Header)->common + 1, hdr_length - sizeof(common_hdr)); + if (dwRead != hdr_length - sizeof(common_hdr)) { + WARN("bad header length, %d bytes, hdr_length %d\n", dwRead, hdr_length); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + /* read packet body */ + switch (common_hdr.ptype) { + case PKT_RESPONSE: + pMsg->BufferLength = (*Header)->response.alloc_hint; + break; + case PKT_REQUEST: + pMsg->BufferLength = (*Header)->request.alloc_hint; + break; + default: + pMsg->BufferLength = common_hdr.frag_len - hdr_length - RPC_AUTH_VERIFIER_LEN(&common_hdr); + } + + TRACE("buffer length = %u\n", pMsg->BufferLength); + + status = I_RpcGetBuffer(pMsg); + if (status != RPC_S_OK) goto fail; + + first_flag = RPC_FLG_FIRST; + auth_length = common_hdr.auth_len; + if (auth_length) { + auth_data = HeapAlloc(GetProcessHeap(), 0, RPC_AUTH_VERIFIER_LEN(&common_hdr)); + if (!auth_data) { + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + } + buffer_length = 0; + while (TRUE) + { + unsigned int header_auth_len = RPC_AUTH_VERIFIER_LEN(&(*Header)->common); + + /* verify header fields */ + + if (((*Header)->common.frag_len < hdr_length) || + ((*Header)->common.frag_len - hdr_length < header_auth_len)) { + WARN("frag_len %d too small for hdr_length %d and auth_len %d\n", + (*Header)->common.frag_len, hdr_length, header_auth_len); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + if ((*Header)->common.auth_len != auth_length) { + WARN("auth_len header field changed from %ld to %d\n", + auth_length, (*Header)->common.auth_len); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + if (((*Header)->common.flags & RPC_FLG_FIRST) != first_flag) { + TRACE("invalid packet flags\n"); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + data_length = (*Header)->common.frag_len - hdr_length - header_auth_len; + if (data_length + buffer_length > pMsg->BufferLength) { + TRACE("allocation hint exceeded, new buffer length = %ld\n", + data_length + buffer_length); + pMsg->BufferLength = data_length + buffer_length; + status = I_RpcReAllocateBuffer(pMsg); + if (status != RPC_S_OK) goto fail; + } + + if (data_length == 0) dwRead = 0; else + dwRead = rpcrt4_conn_read(Connection, + (unsigned char *)pMsg->Buffer + buffer_length, data_length); + if (dwRead != data_length) { + WARN("bad data length, %d/%ld\n", dwRead, data_length); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + if (header_auth_len) { + if (header_auth_len < sizeof(RpcAuthVerifier)) { + WARN("bad auth verifier length %d\n", header_auth_len); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + /* FIXME: we should accumulate authentication data for the bind, + * bind_ack, alter_context and alter_context_response if necessary. + * however, the details of how this is done is very sketchy in the + * DCE/RPC spec. for all other packet types that have authentication + * verifier data then it is just duplicated in all the fragments */ + dwRead = rpcrt4_conn_read(Connection, auth_data, header_auth_len); + if (dwRead != header_auth_len) { + WARN("bad authentication data length, %d/%d\n", dwRead, + header_auth_len); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + /* these packets are handled specially, not by the generic SecurePacket + * function */ + if ((common_hdr.ptype != PKT_BIND) && + (common_hdr.ptype != PKT_BIND_ACK) && + (common_hdr.ptype != PKT_AUTH3)) + status = RPCRT4_SecurePacket(Connection, SECURE_PACKET_RECEIVE, + *Header, hdr_length, + (unsigned char *)pMsg->Buffer + buffer_length, data_length, + (RpcAuthVerifier *)auth_data, + (unsigned char *)auth_data + sizeof(RpcAuthVerifier), + header_auth_len - sizeof(RpcAuthVerifier)); + } + + buffer_length += data_length; + if (!((*Header)->common.flags & RPC_FLG_LAST)) { + TRACE("next header\n"); + + /* read the header of next packet */ + dwRead = rpcrt4_conn_read(Connection, *Header, hdr_length); + if (dwRead != hdr_length) { + WARN("invalid packet header size (%d)\n", dwRead); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + first_flag = 0; + } else { + break; + } + } + pMsg->BufferLength = buffer_length; + + /* respond to authorization request */ + if (common_hdr.ptype == PKT_BIND_ACK && auth_length > sizeof(RpcAuthVerifier)) + { + status = RPCRT_AuthorizeConnection(Connection, + auth_data + sizeof(RpcAuthVerifier), + auth_length); + if (status) + goto fail; + } + + /* success */ + status = RPC_S_OK; + +fail: + if (status != RPC_S_OK) { + RPCRT4_FreeHeader(*Header); + *Header = NULL; + } + HeapFree(GetProcessHeap(), 0, auth_data); + return status; +} + +/*********************************************************************** + * I_RpcGetBuffer [RPCRT4.@] + * + * Allocates a buffer for use by I_RpcSend or I_RpcSendReceive and binds to the + * server interface. + * + * PARAMS + * pMsg [I/O] RPC message information. + * + * RETURNS + * Success: RPC_S_OK. + * Failure: RPC_S_INVALID_BINDING if pMsg->Handle is invalid. + * RPC_S_SERVER_UNAVAILABLE if unable to connect to server. + * ERROR_OUTOFMEMORY if buffer allocation failed. + * + * NOTES + * The pMsg->BufferLength field determines the size of the buffer to allocate, + * in bytes. + * + * Use I_RpcFreeBuffer() to unbind from the server and free the message buffer. + * + * SEE ALSO + * I_RpcFreeBuffer(), I_RpcSend(), I_RpcReceive(), I_RpcSendReceive(). + */ +RPC_STATUS WINAPI I_RpcGetBuffer(PRPC_MESSAGE pMsg) +{ + TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength); + /* FIXME: pfnAllocate? */ + pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->BufferLength); + + TRACE("Buffer=%p\n", pMsg->Buffer); + /* FIXME: which errors to return? */ + return pMsg->Buffer ? S_OK : E_OUTOFMEMORY; +} + +/*********************************************************************** + * I_RpcReAllocateBuffer (internal) + */ +static RPC_STATUS I_RpcReAllocateBuffer(PRPC_MESSAGE pMsg) +{ + TRACE("(%p): BufferLength=%d\n", pMsg, pMsg->BufferLength); + pMsg->Buffer = HeapReAlloc(GetProcessHeap(), 0, pMsg->Buffer, pMsg->BufferLength); + + TRACE("Buffer=%p\n", pMsg->Buffer); + return pMsg->Buffer ? RPC_S_OK : RPC_S_OUT_OF_RESOURCES; +} + +/*********************************************************************** + * I_RpcFreeBuffer [RPCRT4.@] + * + * Frees a buffer allocated by I_RpcGetBuffer or I_RpcReceive and unbinds from + * the server interface. + * + * PARAMS + * pMsg [I/O] RPC message information. + * + * RETURNS + * RPC_S_OK. + * + * SEE ALSO + * I_RpcGetBuffer(), I_RpcReceive(). + */ +RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg) +{ + TRACE("(%p) Buffer=%p\n", pMsg, pMsg->Buffer); + /* FIXME: pfnFree? */ + HeapFree(GetProcessHeap(), 0, pMsg->Buffer); + pMsg->Buffer = NULL; + return S_OK; +} + +/*********************************************************************** + * I_RpcSend [RPCRT4.@] + * + * Sends a message to the server. + * + * PARAMS + * pMsg [I/O] RPC message information. + * + * RETURNS + * Unknown. + * + * NOTES + * The buffer must have been allocated with I_RpcGetBuffer(). + * + * SEE ALSO + * I_RpcGetBuffer(), I_RpcReceive(), I_RpcSendReceive(). + */ +RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) +{ + RpcBinding* bind = (RpcBinding*)pMsg->Handle; + RpcConnection* conn; + RPC_CLIENT_INTERFACE* cif = NULL; + RPC_STATUS status; + RpcPktHdr *hdr; + + TRACE("(%p)\n", pMsg); + if (!bind || bind->server) return RPC_S_INVALID_BINDING; + + cif = pMsg->RpcInterfaceInformation; + if (!cif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */ + + if (!bind->Endpoint || !bind->Endpoint[0]) + { + TRACE("automatically resolving partially bound binding\n"); + status = RpcEpResolveBinding(bind, cif); + if (status != RPC_S_OK) return status; + } + + status = RPCRT4_OpenBinding(bind, &conn, &cif->TransferSyntax, + &cif->InterfaceId); + if (status != RPC_S_OK) return status; + + hdr = RPCRT4_BuildRequestHeader(pMsg->DataRepresentation, + pMsg->BufferLength, pMsg->ProcNum, + &bind->ObjectUuid); + if (!hdr) + { + RPCRT4_CloseBinding(bind, conn); + return ERROR_OUTOFMEMORY; + } + hdr->common.call_id = conn->NextCallId++; + + status = RPCRT4_Send(conn, hdr, pMsg->Buffer, pMsg->BufferLength); + + RPCRT4_FreeHeader(hdr); + + /* save the connection, so the response can be read from it */ + pMsg->ReservedForRuntime = conn; + return status; +} + +/* is this status something that the server can't recover from? */ +static inline BOOL is_hard_error(RPC_STATUS status) +{ + switch (status) + { + case 0: /* user-defined fault */ + case ERROR_ACCESS_DENIED: + case ERROR_INVALID_PARAMETER: + case RPC_S_PROTOCOL_ERROR: + case RPC_S_CALL_FAILED: + case RPC_S_CALL_FAILED_DNE: + case RPC_S_SEC_PKG_ERROR: + return TRUE; + default: + return FALSE; + } +} + +/*********************************************************************** + * I_RpcReceive [RPCRT4.@] + */ +RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg) +{ + RpcBinding* bind = (RpcBinding*)pMsg->Handle; + RpcConnection* conn; + RPC_CLIENT_INTERFACE* cif = NULL; + RPC_SERVER_INTERFACE* sif = NULL; + RPC_STATUS status; + RpcPktHdr *hdr = NULL; + + TRACE("(%p)\n", pMsg); + if (!bind) return RPC_S_INVALID_BINDING; + + if (pMsg->ReservedForRuntime) { + conn = pMsg->ReservedForRuntime; + pMsg->ReservedForRuntime = NULL; + } else { + if (bind->server) { + sif = pMsg->RpcInterfaceInformation; + if (!sif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */ + status = RPCRT4_OpenBinding(bind, &conn, &sif->TransferSyntax, + &sif->InterfaceId); + } else { + cif = pMsg->RpcInterfaceInformation; + if (!cif) return RPC_S_INTERFACE_NOT_FOUND; /* ? */ + + if (!bind->Endpoint || !bind->Endpoint[0]) + { + TRACE("automatically resolving partially bound binding\n"); + status = RpcEpResolveBinding(bind, cif); + if (status != RPC_S_OK) return status; + } + + status = RPCRT4_OpenBinding(bind, &conn, &cif->TransferSyntax, + &cif->InterfaceId); + } + if (status != RPC_S_OK) return status; + } + + status = RPCRT4_Receive(conn, &hdr, pMsg); + if (status != RPC_S_OK) { + WARN("receive failed with error %lx\n", status); + goto fail; + } + + switch (hdr->common.ptype) { + case PKT_RESPONSE: + if (bind->server) { + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + break; + case PKT_REQUEST: + if (!bind->server) { + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + break; + case PKT_FAULT: + ERR ("we got fault packet with status 0x%lx\n", hdr->fault.status); + status = NCA2RPC_STATUS(hdr->fault.status); + if (is_hard_error(status)) + goto fail; + break; + default: + WARN("bad packet type %d\n", hdr->common.ptype); + status = RPC_S_PROTOCOL_ERROR; + goto fail; + } + + /* success */ + RPCRT4_CloseBinding(bind, conn); + RPCRT4_FreeHeader(hdr); + return status; + +fail: + RPCRT4_FreeHeader(hdr); + RPCRT4_DestroyConnection(conn); + return status; +} + +/*********************************************************************** + * I_RpcSendReceive [RPCRT4.@] + * + * Sends a message to the server and receives the response. + * + * PARAMS + * pMsg [I/O] RPC message information. + * + * RETURNS + * Success: RPC_S_OK. + * Failure: Any error code. + * + * NOTES + * The buffer must have been allocated with I_RpcGetBuffer(). + * + * SEE ALSO + * I_RpcGetBuffer(), I_RpcSend(), I_RpcReceive(). + */ +RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg) +{ + RPC_STATUS status; + RPC_MESSAGE original_message; + + TRACE("(%p)\n", pMsg); + + original_message = *pMsg; + status = I_RpcSend(pMsg); + if (status == RPC_S_OK) + status = I_RpcReceive(pMsg); + /* free the buffer replaced by a new buffer in I_RpcReceive */ + if (status == RPC_S_OK) + I_RpcFreeBuffer(&original_message); + return status; +} diff --git a/reactos/dll/win32/rpcrt4_new/rpc_message.h b/reactos/dll/win32/rpcrt4_new/rpc_message.h index 8815d8d2dec..4eb0d54d15e 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_message.h +++ b/reactos/dll/win32/rpcrt4_new/rpc_message.h @@ -1,40 +1,40 @@ -/* - * RPC message API - * - * Copyright 2004 Filip Navara - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_RPC_MESSAGE_H -#define __WINE_RPC_MESSAGE_H - -#include "wine/rpcss_shared.h" -#include "rpc_defs.h" - -typedef unsigned int NCA_STATUS; - -RpcPktHdr *RPCRT4_BuildFaultHeader(unsigned long DataRepresentation, RPC_STATUS Status); -RpcPktHdr *RPCRT4_BuildResponseHeader(unsigned long DataRepresentation, unsigned long BufferLength); -RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, unsigned long AssocGroupId, const RPC_SYNTAX_IDENTIFIER *AbstractId, const RPC_SYNTAX_IDENTIFIER *TransferId); -RpcPktHdr *RPCRT4_BuildBindNackHeader(unsigned long DataRepresentation, unsigned char RpcVersion, unsigned char RpcVersionMinor); -RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, LPCSTR ServerAddress, unsigned long Result, unsigned long Reason, const RPC_SYNTAX_IDENTIFIER *TransferId); -VOID RPCRT4_FreeHeader(RpcPktHdr *Header); -RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength); -RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg); -NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status); -RPC_STATUS NCA2RPC_STATUS(NCA_STATUS status); - -#endif +/* + * RPC message API + * + * Copyright 2004 Filip Navara + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_RPC_MESSAGE_H +#define __WINE_RPC_MESSAGE_H + +#include "wine/rpcss_shared.h" +#include "rpc_defs.h" + +typedef unsigned int NCA_STATUS; + +RpcPktHdr *RPCRT4_BuildFaultHeader(unsigned long DataRepresentation, RPC_STATUS Status); +RpcPktHdr *RPCRT4_BuildResponseHeader(unsigned long DataRepresentation, unsigned long BufferLength); +RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, unsigned long AssocGroupId, const RPC_SYNTAX_IDENTIFIER *AbstractId, const RPC_SYNTAX_IDENTIFIER *TransferId); +RpcPktHdr *RPCRT4_BuildBindNackHeader(unsigned long DataRepresentation, unsigned char RpcVersion, unsigned char RpcVersionMinor); +RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, LPCSTR ServerAddress, unsigned long Result, unsigned long Reason, const RPC_SYNTAX_IDENTIFIER *TransferId); +VOID RPCRT4_FreeHeader(RpcPktHdr *Header); +RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength); +RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg); +NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status); +RPC_STATUS NCA2RPC_STATUS(NCA_STATUS status); + +#endif diff --git a/reactos/dll/win32/rpcrt4_new/rpc_misc.h b/reactos/dll/win32/rpcrt4_new/rpc_misc.h index 0cb41c1b7be..6bccfd69618 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_misc.h +++ b/reactos/dll/win32/rpcrt4_new/rpc_misc.h @@ -1,28 +1,28 @@ -/* - * RPC definitions - * - * Copyright 2003 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#ifndef __WINE_RPC_MISC_H -#define __WINE_RPC_MISC_H - -/* flags for RPC_MESSAGE.RpcFlags */ -#define WINE_RPCFLAG_EXCEPTION 0x0001 - -#endif /* __WINE_RPC_MISC_H */ +/* + * RPC definitions + * + * Copyright 2003 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#ifndef __WINE_RPC_MISC_H +#define __WINE_RPC_MISC_H + +/* flags for RPC_MESSAGE.RpcFlags */ +#define WINE_RPCFLAG_EXCEPTION 0x0001 + +#endif /* __WINE_RPC_MISC_H */ diff --git a/reactos/dll/win32/rpcrt4_new/rpc_server.c b/reactos/dll/win32/rpcrt4_new/rpc_server.c index b62954bded7..bc60868ba6e 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_server.c +++ b/reactos/dll/win32/rpcrt4_new/rpc_server.c @@ -1,1116 +1,1116 @@ -/* - * RPC server API - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * Copyright 2004 Filip Navara - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * TODO: - * - a whole lot - */ - -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - -#include "rpc.h" -#include "rpcndr.h" -#include "excpt.h" - -#include "wine/debug.h" -#include "wine/exception.h" - -#include "rpc_server.h" -#include "rpc_message.h" -#include "rpc_defs.h" -#include "ncastatus.h" - -WINE_DEFAULT_DEBUG_CHANNEL(rpc); - -typedef struct _RpcPacket -{ - struct _RpcConnection* conn; - RpcPktHdr* hdr; - RPC_MESSAGE* msg; -} RpcPacket; - -typedef struct _RpcObjTypeMap -{ - /* FIXME: a hash table would be better. */ - struct _RpcObjTypeMap *next; - UUID Object; - UUID Type; -} RpcObjTypeMap; - -static RpcObjTypeMap *RpcObjTypeMaps; - -/* list of type RpcServerProtseq */ -static struct list protseqs = LIST_INIT(protseqs); -static struct list server_interfaces = LIST_INIT(server_interfaces); - -static CRITICAL_SECTION server_cs; -static CRITICAL_SECTION_DEBUG server_cs_debug = -{ - 0, 0, &server_cs, - { &server_cs_debug.ProcessLocksList, &server_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": server_cs") } -}; -static CRITICAL_SECTION server_cs = { &server_cs_debug, -1, 0, 0, 0, 0 }; - -static CRITICAL_SECTION listen_cs; -static CRITICAL_SECTION_DEBUG listen_cs_debug = -{ - 0, 0, &listen_cs, - { &listen_cs_debug.ProcessLocksList, &listen_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": listen_cs") } -}; -static CRITICAL_SECTION listen_cs = { &listen_cs_debug, -1, 0, 0, 0, 0 }; - -/* whether the server is currently listening */ -static BOOL std_listen; -/* number of manual listeners (calls to RpcServerListen) */ -static LONG manual_listen_count; -/* total listeners including auto listeners */ -static LONG listen_count; - -static UUID uuid_nil; - -static inline RpcObjTypeMap *LookupObjTypeMap(UUID *ObjUuid) -{ - RpcObjTypeMap *rslt = RpcObjTypeMaps; - RPC_STATUS dummy; - - while (rslt) { - if (! UuidCompare(ObjUuid, &rslt->Object, &dummy)) break; - rslt = rslt->next; - } - - return rslt; -} - -static inline UUID *LookupObjType(UUID *ObjUuid) -{ - RpcObjTypeMap *map = LookupObjTypeMap(ObjUuid); - if (map) - return &map->Type; - else - return &uuid_nil; -} - -static RpcServerInterface* RPCRT4_find_interface(UUID* object, - const RPC_SYNTAX_IDENTIFIER* if_id, - BOOL check_object) -{ - UUID* MgrType = NULL; - RpcServerInterface* cif; - RPC_STATUS status; - - if (check_object) - MgrType = LookupObjType(object); - EnterCriticalSection(&server_cs); - LIST_FOR_EACH_ENTRY(cif, &server_interfaces, RpcServerInterface, entry) { - if (!memcmp(if_id, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)) && - (check_object == FALSE || UuidEqual(MgrType, &cif->MgrTypeUuid, &status)) && - std_listen) { - InterlockedIncrement(&cif->CurrentCalls); - break; - } - } - LeaveCriticalSection(&server_cs); - if (&cif->entry == &server_interfaces) cif = NULL; - TRACE("returning %p for %s\n", cif, debugstr_guid(object)); - return cif; -} - -static void RPCRT4_release_server_interface(RpcServerInterface *sif) -{ - if (!InterlockedDecrement(&sif->CurrentCalls) && - sif->CallsCompletedEvent) { - /* sif must have been removed from server_interfaces before - * CallsCompletedEvent is set */ - SetEvent(sif->CallsCompletedEvent); - HeapFree(GetProcessHeap(), 0, sif); - } -} - -static WINE_EXCEPTION_FILTER(rpc_filter) -{ - WARN("exception caught with code 0x%08x = %d\n", GetExceptionCode(), GetExceptionCode()); - TRACE("returning failure packet\n"); - /* catch every exception */ - return EXCEPTION_EXECUTE_HANDLER; -} - -static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSAGE* msg) -{ - RpcServerInterface* sif; - RPC_DISPATCH_FUNCTION func; - UUID *object_uuid; - RpcPktHdr *response; - void *buf = msg->Buffer; - RPC_STATUS status; - BOOL exception; - - switch (hdr->common.ptype) { - case PKT_BIND: - TRACE("got bind packet\n"); - - /* FIXME: do more checks! */ - if (hdr->bind.max_tsize < RPC_MIN_PACKET_SIZE || - !UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status)) { - TRACE("packet size less than min size, or active interface syntax guid non-null\n"); - sif = NULL; - } else { - sif = RPCRT4_find_interface(NULL, &hdr->bind.abstract, FALSE); - } - if (sif == NULL) { - TRACE("rejecting bind request on connection %p\n", conn); - /* Report failure to client. */ - response = RPCRT4_BuildBindNackHeader(NDR_LOCAL_DATA_REPRESENTATION, - RPC_VER_MAJOR, RPC_VER_MINOR); - } else { - TRACE("accepting bind request on connection %p for %s\n", conn, - debugstr_guid(&hdr->bind.abstract.SyntaxGUID)); - - /* accept. */ - response = RPCRT4_BuildBindAckHeader(NDR_LOCAL_DATA_REPRESENTATION, - RPC_MAX_PACKET_SIZE, - RPC_MAX_PACKET_SIZE, - conn->Endpoint, - RESULT_ACCEPT, REASON_NONE, - &sif->If->TransferSyntax); - - /* save the interface for later use */ - conn->ActiveInterface = hdr->bind.abstract; - conn->MaxTransmissionSize = hdr->bind.max_tsize; - - RPCRT4_release_server_interface(sif); - } - - status = RPCRT4_Send(conn, response, NULL, 0); - RPCRT4_FreeHeader(response); - if (status != RPC_S_OK) - goto fail; - - break; - - case PKT_REQUEST: - TRACE("got request packet\n"); - - /* fail if the connection isn't bound with an interface */ - if (UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status)) { - /* FIXME: should send BindNack instead */ - response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION, - status); - - RPCRT4_Send(conn, response, NULL, 0); - RPCRT4_FreeHeader(response); - break; - } - - if (hdr->common.flags & RPC_FLG_OBJECT_UUID) { - object_uuid = (UUID*)(&hdr->request + 1); - } else { - object_uuid = NULL; - } - - sif = RPCRT4_find_interface(object_uuid, &conn->ActiveInterface, TRUE); - if (!sif) { - WARN("interface %s no longer registered, returning fault packet\n", debugstr_guid(&conn->ActiveInterface.SyntaxGUID)); - response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION, - NCA_S_UNK_IF); - - RPCRT4_Send(conn, response, NULL, 0); - RPCRT4_FreeHeader(response); - break; - } - msg->RpcInterfaceInformation = sif->If; - /* copy the endpoint vector from sif to msg so that midl-generated code will use it */ - msg->ManagerEpv = sif->MgrEpv; - if (object_uuid != NULL) { - RPCRT4_SetBindingObject(msg->Handle, object_uuid); - } - - /* find dispatch function */ - msg->ProcNum = hdr->request.opnum; - if (sif->Flags & RPC_IF_OLE) { - /* native ole32 always gives us a dispatch table with a single entry - * (I assume that's a wrapper for IRpcStubBuffer::Invoke) */ - func = *sif->If->DispatchTable->DispatchTable; - } else { - if (msg->ProcNum >= sif->If->DispatchTable->DispatchTableCount) { - WARN("invalid procnum (%d/%d)\n", msg->ProcNum, sif->If->DispatchTable->DispatchTableCount); - response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION, - NCA_S_OP_RNG_ERROR); - - RPCRT4_Send(conn, response, NULL, 0); - RPCRT4_FreeHeader(response); - } - func = sif->If->DispatchTable->DispatchTable[msg->ProcNum]; - } - - /* put in the drep. FIXME: is this more universally applicable? - perhaps we should move this outward... */ - msg->DataRepresentation = - MAKELONG( MAKEWORD(hdr->common.drep[0], hdr->common.drep[1]), - MAKEWORD(hdr->common.drep[2], hdr->common.drep[3])); - - exception = FALSE; - - /* dispatch */ - __TRY { - if (func) func(msg); - } __EXCEPT(rpc_filter) { - exception = TRUE; - if (GetExceptionCode() == STATUS_ACCESS_VIOLATION) - status = ERROR_NOACCESS; - else - status = GetExceptionCode(); - response = RPCRT4_BuildFaultHeader(msg->DataRepresentation, - RPC2NCA_STATUS(status)); - } __ENDTRY - - if (!exception) - response = RPCRT4_BuildResponseHeader(msg->DataRepresentation, - msg->BufferLength); - - /* send response packet */ - if (response) { - status = RPCRT4_Send(conn, response, exception ? NULL : msg->Buffer, - exception ? 0 : msg->BufferLength); - RPCRT4_FreeHeader(response); - } else - ERR("out of memory\n"); - - msg->RpcInterfaceInformation = NULL; - RPCRT4_release_server_interface(sif); - - break; - - default: - FIXME("unhandled packet type %u\n", hdr->common.ptype); - break; - } - -fail: - /* clean up */ - if (msg->Buffer == buf) msg->Buffer = NULL; - TRACE("freeing Buffer=%p\n", buf); - HeapFree(GetProcessHeap(), 0, buf); - RPCRT4_DestroyBinding(msg->Handle); - msg->Handle = 0; - I_RpcFreeBuffer(msg); - msg->Buffer = NULL; - RPCRT4_FreeHeader(hdr); - HeapFree(GetProcessHeap(), 0, msg); -} - -static DWORD CALLBACK RPCRT4_worker_thread(LPVOID the_arg) -{ - RpcPacket *pkt = the_arg; - RPCRT4_process_packet(pkt->conn, pkt->hdr, pkt->msg); - HeapFree(GetProcessHeap(), 0, pkt); - return 0; -} - -static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg) -{ - RpcConnection* conn = (RpcConnection*)the_arg; - RpcPktHdr *hdr; - RpcBinding *pbind; - RPC_MESSAGE *msg; - RPC_STATUS status; - RpcPacket *packet; - - TRACE("(%p)\n", conn); - - for (;;) { - msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RPC_MESSAGE)); - - /* create temporary binding for dispatch, it will be freed in - * RPCRT4_process_packet */ - RPCRT4_MakeBinding(&pbind, conn); - msg->Handle = (RPC_BINDING_HANDLE)pbind; - - status = RPCRT4_Receive(conn, &hdr, msg); - if (status != RPC_S_OK) { - WARN("receive failed with error %lx\n", status); - HeapFree(GetProcessHeap(), 0, msg); - break; - } - -#if 0 - RPCRT4_process_packet(conn, hdr, msg); -#else - packet = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcPacket)); - packet->conn = conn; - packet->hdr = hdr; - packet->msg = msg; - QueueUserWorkItem(RPCRT4_worker_thread, packet, WT_EXECUTELONGFUNCTION); -#endif - msg = NULL; - } - RPCRT4_DestroyConnection(conn); - return 0; -} - -void RPCRT4_new_client(RpcConnection* conn) -{ - HANDLE thread = CreateThread(NULL, 0, RPCRT4_io_thread, conn, 0, NULL); - if (!thread) { - DWORD err = GetLastError(); - ERR("failed to create thread, error=%08x\n", err); - RPCRT4_DestroyConnection(conn); - } - /* we could set conn->thread, but then we'd have to make the io_thread wait - * for that, otherwise the thread might finish, destroy the connection, and - * free the memory we'd write to before we did, causing crashes and stuff - - * so let's implement that later, when we really need conn->thread */ - - CloseHandle( thread ); -} - -static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) -{ - int res; - unsigned int count; - void *objs = NULL; - RpcServerProtseq* cps = the_arg; - RpcConnection* conn; - BOOL set_ready_event = FALSE; - - TRACE("(the_arg == ^%p)\n", the_arg); - - for (;;) { - objs = cps->ops->get_wait_array(cps, objs, &count); - - if (set_ready_event) - { - /* signal to function that changed state that we are now sync'ed */ - SetEvent(cps->server_ready_event); - set_ready_event = FALSE; - } - - /* start waiting */ - res = cps->ops->wait_for_new_connection(cps, count, objs); - if (res == -1) - break; - else if (res == 0) - { - if (!std_listen) - { - SetEvent(cps->server_ready_event); - break; - } - set_ready_event = TRUE; - } - } - cps->ops->free_wait_array(cps, objs); - EnterCriticalSection(&cps->cs); - /* close connections */ - conn = cps->conn; - while (conn) { - RPCRT4_CloseConnection(conn); - conn = conn->Next; - } - LeaveCriticalSection(&cps->cs); - return 0; -} - -/* tells the server thread that the state has changed and waits for it to - * make the changes */ -static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps) -{ - /* make sure we are the only thread sync'ing the server state, otherwise - * there is a race with the server thread setting an older state and setting - * the server_ready_event when the new state hasn't yet been applied */ - WaitForSingleObject(ps->mgr_mutex, INFINITE); - - ps->ops->signal_state_changed(ps); - - /* wait for server thread to make the requested changes before returning */ - WaitForSingleObject(ps->server_ready_event, INFINITE); - - ReleaseMutex(ps->mgr_mutex); -} - -static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen) -{ - RPC_STATUS status = RPC_S_OK; - HANDLE server_thread; - - EnterCriticalSection(&listen_cs); - if (ps->is_listening) goto done; - - if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL); - if (!ps->server_ready_event) ps->server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); - server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); - if (!server_thread) - { - status = RPC_S_OUT_OF_RESOURCES; - goto done; - } - ps->is_listening = TRUE; - CloseHandle(server_thread); - -done: - LeaveCriticalSection(&listen_cs); - return status; -} - -static RPC_STATUS RPCRT4_start_listen(BOOL auto_listen) -{ - RPC_STATUS status = RPC_S_ALREADY_LISTENING; - RpcServerProtseq *cps; - - TRACE("\n"); - - EnterCriticalSection(&listen_cs); - if (auto_listen || (manual_listen_count++ == 0)) - { - status = RPC_S_OK; - if (++listen_count == 1) - std_listen = TRUE; - } - LeaveCriticalSection(&listen_cs); - - if (std_listen) - { - EnterCriticalSection(&server_cs); - LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) - { - status = RPCRT4_start_listen_protseq(cps, TRUE); - if (status != RPC_S_OK) - break; - - /* make sure server is actually listening on the interface before - * returning */ - RPCRT4_sync_with_server_thread(cps); - } - LeaveCriticalSection(&server_cs); - } - - return status; -} - -static void RPCRT4_stop_listen(BOOL auto_listen) -{ - EnterCriticalSection(&listen_cs); - if (auto_listen || (--manual_listen_count == 0)) - { - if (listen_count != 0 && --listen_count == 0) { - RpcServerProtseq *cps; - - std_listen = FALSE; - LeaveCriticalSection(&listen_cs); - - LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) - RPCRT4_sync_with_server_thread(cps); - - return; - } - assert(listen_count >= 0); - } - LeaveCriticalSection(&listen_cs); -} - -static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq* ps, LPSTR endpoint) -{ - RPC_STATUS status; - - status = ps->ops->open_endpoint(ps, endpoint); - if (status != RPC_S_OK) - return status; - - if (std_listen) - { - status = RPCRT4_start_listen_protseq(ps, FALSE); - if (status == RPC_S_OK) - RPCRT4_sync_with_server_thread(ps); - } - - return status; -} - -/*********************************************************************** - * RpcServerInqBindings (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerInqBindings( RPC_BINDING_VECTOR** BindingVector ) -{ - RPC_STATUS status; - DWORD count; - RpcServerProtseq* ps; - RpcConnection* conn; - - if (BindingVector) - TRACE("(*BindingVector == ^%p)\n", *BindingVector); - else - ERR("(BindingVector == NULL!!?)\n"); - - EnterCriticalSection(&server_cs); - /* count connections */ - count = 0; - LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { - EnterCriticalSection(&ps->cs); - conn = ps->conn; - while (conn) { - count++; - conn = conn->Next; - } - LeaveCriticalSection(&ps->cs); - } - if (count) { - /* export bindings */ - *BindingVector = HeapAlloc(GetProcessHeap(), 0, - sizeof(RPC_BINDING_VECTOR) + - sizeof(RPC_BINDING_HANDLE)*(count-1)); - (*BindingVector)->Count = count; - count = 0; - LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { - EnterCriticalSection(&ps->cs); - conn = ps->conn; - while (conn) { - RPCRT4_MakeBinding((RpcBinding**)&(*BindingVector)->BindingH[count], - conn); - count++; - conn = conn->Next; - } - LeaveCriticalSection(&ps->cs); - } - status = RPC_S_OK; - } else { - *BindingVector = NULL; - status = RPC_S_NO_BINDINGS; - } - LeaveCriticalSection(&server_cs); - return status; -} - -/*********************************************************************** - * RpcServerUseProtseqEpA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUseProtseqEpA( RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR 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 ); -} - -/*********************************************************************** - * RpcServerUseProtseqEpW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUseProtseqEpW( RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR 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 ); -} - -/*********************************************************************** - * alloc_serverprotoseq (internal) - * - * Must be called with server_cs held. - */ -static RPC_STATUS alloc_serverprotoseq(UINT MaxCalls, char *Protseq, RpcServerProtseq **ps) -{ - const struct protseq_ops *ops = rpcrt4_get_protseq_ops(Protseq); - - if (!ops) - { - FIXME("protseq %s not supported\n", debugstr_a(Protseq)); - return RPC_S_PROTSEQ_NOT_SUPPORTED; - } - - *ps = ops->alloc(); - if (!*ps) - return RPC_S_OUT_OF_RESOURCES; - (*ps)->MaxCalls = MaxCalls; - (*ps)->Protseq = Protseq; - (*ps)->ops = ops; - (*ps)->MaxCalls = 0; - (*ps)->conn = NULL; - InitializeCriticalSection(&(*ps)->cs); - (*ps)->is_listening = FALSE; - (*ps)->mgr_mutex = NULL; - (*ps)->server_ready_event = NULL; - - list_add_head(&protseqs, &(*ps)->entry); - - TRACE("new protseq %p created for %s\n", *ps, Protseq); - - return RPC_S_OK; -} - -/* Finds a given protseq or creates a new one if one doesn't already exist */ -static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, char *Protseq, RpcServerProtseq **ps) -{ - RPC_STATUS status; - RpcServerProtseq *cps; - - EnterCriticalSection(&server_cs); - - LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) - if (!strcmp(cps->Protseq, Protseq)) - { - TRACE("found existing protseq object for %s\n", Protseq); - *ps = cps; - LeaveCriticalSection(&server_cs); - return S_OK; - } - - status = alloc_serverprotoseq(MaxCalls, Protseq, ps); - - LeaveCriticalSection(&server_cs); - - return status; -} - -/*********************************************************************** - * RpcServerUseProtseqEpExA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUseProtseqEpExA( RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor, - PRPC_POLICY lpPolicy ) -{ - char *szps = (char*)Protseq, *szep = (char*)Endpoint; - RpcServerProtseq* ps; - RPC_STATUS status; - - TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_a(szps), MaxCalls, - debugstr_a(szep), SecurityDescriptor, - lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags ); - - status = RPCRT4_get_or_create_serverprotseq(MaxCalls, RPCRT4_strdupA(szps), &ps); - if (status != RPC_S_OK) - return status; - - return RPCRT4_use_protseq(ps, szep); -} - -/*********************************************************************** - * RpcServerUseProtseqEpExW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUseProtseqEpExW( RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor, - PRPC_POLICY lpPolicy ) -{ - RpcServerProtseq* ps; - RPC_STATUS status; - LPSTR EndpointA; - - TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_w( Protseq ), MaxCalls, - debugstr_w( Endpoint ), SecurityDescriptor, - lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags ); - - status = RPCRT4_get_or_create_serverprotseq(MaxCalls, RPCRT4_strdupWtoA(Protseq), &ps); - if (status != RPC_S_OK) - return status; - - EndpointA = RPCRT4_strdupWtoA(Endpoint); - status = RPCRT4_use_protseq(ps, EndpointA); - RPCRT4_strfree(EndpointA); - return status; -} - -/*********************************************************************** - * RpcServerUseProtseqA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor) -{ - TRACE("(Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_a((char*)Protseq), MaxCalls, SecurityDescriptor); - return RpcServerUseProtseqEpA(Protseq, MaxCalls, NULL, SecurityDescriptor); -} - -/*********************************************************************** - * RpcServerUseProtseqW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor) -{ - TRACE("Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_w(Protseq), MaxCalls, SecurityDescriptor); - return RpcServerUseProtseqEpW(Protseq, MaxCalls, NULL, SecurityDescriptor); -} - -/*********************************************************************** - * RpcServerRegisterIf (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerRegisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv ) -{ - TRACE("(%p,%s,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv); - return RpcServerRegisterIf2( IfSpec, MgrTypeUuid, MgrEpv, 0, RPC_C_LISTEN_MAX_CALLS_DEFAULT, (UINT)-1, NULL ); -} - -/*********************************************************************** - * RpcServerRegisterIfEx (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerRegisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, - UINT Flags, UINT MaxCalls, RPC_IF_CALLBACK_FN* IfCallbackFn ) -{ - TRACE("(%p,%s,%p,%u,%u,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls, IfCallbackFn); - return RpcServerRegisterIf2( IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, (UINT)-1, IfCallbackFn ); -} - -/*********************************************************************** - * RpcServerRegisterIf2 (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, - UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn ) -{ - PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; - RpcServerInterface* sif; - unsigned int i; - - TRACE("(%p,%s,%p,%u,%u,%u,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls, - MaxRpcSize, IfCallbackFn); - TRACE(" interface id: %s %d.%d\n", debugstr_guid(&If->InterfaceId.SyntaxGUID), - If->InterfaceId.SyntaxVersion.MajorVersion, - If->InterfaceId.SyntaxVersion.MinorVersion); - TRACE(" transfer syntax: %s %d.%d\n", debugstr_guid(&If->TransferSyntax.SyntaxGUID), - If->TransferSyntax.SyntaxVersion.MajorVersion, - If->TransferSyntax.SyntaxVersion.MinorVersion); - TRACE(" dispatch table: %p\n", If->DispatchTable); - if (If->DispatchTable) { - TRACE(" dispatch table count: %d\n", If->DispatchTable->DispatchTableCount); - for (i=0; iDispatchTable->DispatchTableCount; i++) { - TRACE(" entry %d: %p\n", i, If->DispatchTable->DispatchTable[i]); - } - TRACE(" reserved: %ld\n", If->DispatchTable->Reserved); - } - TRACE(" protseq endpoint count: %d\n", If->RpcProtseqEndpointCount); - TRACE(" default manager epv: %p\n", If->DefaultManagerEpv); - TRACE(" interpreter info: %p\n", If->InterpreterInfo); - - sif = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcServerInterface)); - sif->If = If; - if (MgrTypeUuid) { - memcpy(&sif->MgrTypeUuid, MgrTypeUuid, sizeof(UUID)); - sif->MgrEpv = MgrEpv; - } else { - memset(&sif->MgrTypeUuid, 0, sizeof(UUID)); - sif->MgrEpv = If->DefaultManagerEpv; - } - sif->Flags = Flags; - sif->MaxCalls = MaxCalls; - sif->MaxRpcSize = MaxRpcSize; - sif->IfCallbackFn = IfCallbackFn; - - EnterCriticalSection(&server_cs); - list_add_head(&server_interfaces, &sif->entry); - LeaveCriticalSection(&server_cs); - - if (sif->Flags & RPC_IF_AUTOLISTEN) - RPCRT4_start_listen(TRUE); - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcServerUnregisterIf (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUnregisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, UINT WaitForCallsToComplete ) -{ - PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; - HANDLE event = NULL; - BOOL found = FALSE; - BOOL completed = TRUE; - RpcServerInterface *cif; - RPC_STATUS status; - - TRACE("(IfSpec == (RPC_IF_HANDLE)^%p (%s), MgrTypeUuid == %s, WaitForCallsToComplete == %u)\n", - IfSpec, debugstr_guid(&If->InterfaceId.SyntaxGUID), debugstr_guid(MgrTypeUuid), WaitForCallsToComplete); - - EnterCriticalSection(&server_cs); - LIST_FOR_EACH_ENTRY(cif, &server_interfaces, RpcServerInterface, entry) { - if ((!IfSpec || !memcmp(&If->InterfaceId, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER))) && - UuidEqual(MgrTypeUuid, &cif->MgrTypeUuid, &status)) { - list_remove(&cif->entry); - if (cif->CurrentCalls) { - completed = FALSE; - if (WaitForCallsToComplete) - cif->CallsCompletedEvent = event = CreateEventW(NULL, FALSE, FALSE, NULL); - } - found = TRUE; - break; - } - } - LeaveCriticalSection(&server_cs); - - if (!found) { - ERR("not found for object %s\n", debugstr_guid(MgrTypeUuid)); - return RPC_S_UNKNOWN_IF; - } - - if (completed) - HeapFree(GetProcessHeap(), 0, cif); - else if (event) { - /* sif will be freed when the last call is completed, so be careful not to - * touch that memory here as that could happen before we get here */ - WaitForSingleObject(event, INFINITE); - CloseHandle(event); - } - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcServerUnregisterIfEx (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerUnregisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, int RundownContextHandles ) -{ - FIXME("(IfSpec == (RPC_IF_HANDLE)^%p, MgrTypeUuid == %s, RundownContextHandles == %d): stub\n", - IfSpec, debugstr_guid(MgrTypeUuid), RundownContextHandles); - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcObjectSetType (RPCRT4.@) - * - * PARAMS - * ObjUuid [I] "Object" UUID - * TypeUuid [I] "Type" UUID - * - * RETURNS - * RPC_S_OK The call succeeded - * RPC_S_INVALID_OBJECT The provided object (nil) is not valid - * RPC_S_ALREADY_REGISTERED The provided object is already registered - * - * Maps "Object" UUIDs to "Type" UUID's. Passing the nil UUID as the type - * resets the mapping for the specified object UUID to nil (the default). - * The nil object is always associated with the nil type and cannot be - * reassigned. Servers can support multiple implementations on the same - * interface by registering different end-point vectors for the different - * types. There's no need to call this if a server only supports the nil - * type, as is typical. - */ -RPC_STATUS WINAPI RpcObjectSetType( UUID* ObjUuid, UUID* TypeUuid ) -{ - RpcObjTypeMap *map = RpcObjTypeMaps, *prev = NULL; - RPC_STATUS dummy; - - TRACE("(ObjUUID == %s, TypeUuid == %s).\n", debugstr_guid(ObjUuid), debugstr_guid(TypeUuid)); - if ((! ObjUuid) || UuidIsNil(ObjUuid, &dummy)) { - /* nil uuid cannot be remapped */ - return RPC_S_INVALID_OBJECT; - } - - /* find the mapping for this object if there is one ... */ - while (map) { - if (! UuidCompare(ObjUuid, &map->Object, &dummy)) break; - prev = map; - map = map->next; - } - if ((! TypeUuid) || UuidIsNil(TypeUuid, &dummy)) { - /* ... and drop it from the list */ - if (map) { - if (prev) - prev->next = map->next; - else - RpcObjTypeMaps = map->next; - HeapFree(GetProcessHeap(), 0, map); - } - } else { - /* ... , fail if we found it ... */ - if (map) - return RPC_S_ALREADY_REGISTERED; - /* ... otherwise create a new one and add it in. */ - map = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcObjTypeMap)); - memcpy(&map->Object, ObjUuid, sizeof(UUID)); - memcpy(&map->Type, TypeUuid, sizeof(UUID)); - map->next = NULL; - if (prev) - prev->next = map; /* prev is the last map in the linklist */ - else - RpcObjTypeMaps = map; - } - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcServerRegisterAuthInfoA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerRegisterAuthInfoA( RPC_CSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, - LPVOID Arg ) -{ - FIXME( "(%s,%u,%p,%p): stub\n", ServerPrincName, AuthnSvc, GetKeyFn, Arg ); - - return RPC_S_UNKNOWN_AUTHN_SERVICE; /* We don't know any authentication services */ -} - -/*********************************************************************** - * RpcServerRegisterAuthInfoW (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerRegisterAuthInfoW( RPC_WSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, - LPVOID Arg ) -{ - FIXME( "(%s,%u,%p,%p): stub\n", debugstr_w( ServerPrincName ), AuthnSvc, GetKeyFn, Arg ); - - return RPC_S_UNKNOWN_AUTHN_SERVICE; /* We don't know any authentication services */ -} - -/*********************************************************************** - * RpcServerListen (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait ) -{ - RPC_STATUS status = RPC_S_OK; - - TRACE("(%u,%u,%u)\n", MinimumCallThreads, MaxCalls, DontWait); - - if (list_empty(&protseqs)) - return RPC_S_NO_PROTSEQS_REGISTERED; - - status = RPCRT4_start_listen(FALSE); - - if (DontWait || (status != RPC_S_OK)) return status; - - return RpcMgmtWaitServerListen(); -} - -/*********************************************************************** - * RpcMgmtServerWaitListen (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) -{ - TRACE("()\n"); - - EnterCriticalSection(&listen_cs); - - if (!std_listen) { - LeaveCriticalSection(&listen_cs); - return RPC_S_NOT_LISTENING; - } - - LeaveCriticalSection(&listen_cs); - - FIXME("not waiting for server calls to finish\n"); - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcMgmtStopServerListening (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtStopServerListening ( RPC_BINDING_HANDLE Binding ) -{ - TRACE("(Binding == (RPC_BINDING_HANDLE)^%p)\n", Binding); - - if (Binding) { - FIXME("client-side invocation not implemented.\n"); - return RPC_S_WRONG_KIND_OF_BINDING; - } - - RPCRT4_stop_listen(FALSE); - - return RPC_S_OK; -} - -/*********************************************************************** - * RpcMgmtEnableIdleCleanup (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtEnableIdleCleanup(void) -{ - FIXME("(): stub\n"); - return RPC_S_OK; -} - -/*********************************************************************** - * I_RpcServerStartListening (RPCRT4.@) - */ -RPC_STATUS WINAPI I_RpcServerStartListening( HWND hWnd ) -{ - FIXME( "(%p): stub\n", hWnd ); - - return RPC_S_OK; -} - -/*********************************************************************** - * I_RpcServerStopListening (RPCRT4.@) - */ -RPC_STATUS WINAPI I_RpcServerStopListening( void ) -{ - FIXME( "(): stub\n" ); - - return RPC_S_OK; -} - -/*********************************************************************** - * I_RpcWindowProc (RPCRT4.@) - */ -UINT WINAPI I_RpcWindowProc( void *hWnd, UINT Message, UINT wParam, ULONG lParam ) -{ - FIXME( "(%p,%08x,%08x,%08x): stub\n", hWnd, Message, wParam, lParam ); - - return 0; -} - -/*********************************************************************** - * RpcMgmtInqIfIds (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR **IfIdVector) -{ - FIXME("(%p,%p): stub\n", Binding, IfIdVector); - return RPC_S_INVALID_BINDING; -} - -/*********************************************************************** - * RpcMgmtEpEltInqBegin (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE Binding, ULONG InquiryType, - RPC_IF_ID *IfId, ULONG VersOption, UUID *ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext) -{ - FIXME("(%p,%u,%p,%u,%p,%p): stub\n", - Binding, InquiryType, IfId, VersOption, ObjectUuid, InquiryContext); - return RPC_S_INVALID_BINDING; -} - -/*********************************************************************** - * RpcMgmtIsServerListening (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding) -{ - FIXME("(%p): stub\n", Binding); - return RPC_S_INVALID_BINDING; -} - -/*********************************************************************** - * RpcMgmtSetServerStackSize (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcMgmtSetServerStackSize(ULONG ThreadStackSize) -{ - FIXME("(0x%x): stub\n", ThreadStackSize); - return RPC_S_OK; -} +/* + * RPC server API + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2004 Filip Navara + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * TODO: + * - a whole lot + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" + +#include "rpc.h" +#include "rpcndr.h" +#include "excpt.h" + +#include "wine/debug.h" +#include "wine/exception.h" + +#include "rpc_server.h" +#include "rpc_message.h" +#include "rpc_defs.h" +#include "ncastatus.h" + +WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +typedef struct _RpcPacket +{ + struct _RpcConnection* conn; + RpcPktHdr* hdr; + RPC_MESSAGE* msg; +} RpcPacket; + +typedef struct _RpcObjTypeMap +{ + /* FIXME: a hash table would be better. */ + struct _RpcObjTypeMap *next; + UUID Object; + UUID Type; +} RpcObjTypeMap; + +static RpcObjTypeMap *RpcObjTypeMaps; + +/* list of type RpcServerProtseq */ +static struct list protseqs = LIST_INIT(protseqs); +static struct list server_interfaces = LIST_INIT(server_interfaces); + +static CRITICAL_SECTION server_cs; +static CRITICAL_SECTION_DEBUG server_cs_debug = +{ + 0, 0, &server_cs, + { &server_cs_debug.ProcessLocksList, &server_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": server_cs") } +}; +static CRITICAL_SECTION server_cs = { &server_cs_debug, -1, 0, 0, 0, 0 }; + +static CRITICAL_SECTION listen_cs; +static CRITICAL_SECTION_DEBUG listen_cs_debug = +{ + 0, 0, &listen_cs, + { &listen_cs_debug.ProcessLocksList, &listen_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": listen_cs") } +}; +static CRITICAL_SECTION listen_cs = { &listen_cs_debug, -1, 0, 0, 0, 0 }; + +/* whether the server is currently listening */ +static BOOL std_listen; +/* number of manual listeners (calls to RpcServerListen) */ +static LONG manual_listen_count; +/* total listeners including auto listeners */ +static LONG listen_count; + +static UUID uuid_nil; + +static inline RpcObjTypeMap *LookupObjTypeMap(UUID *ObjUuid) +{ + RpcObjTypeMap *rslt = RpcObjTypeMaps; + RPC_STATUS dummy; + + while (rslt) { + if (! UuidCompare(ObjUuid, &rslt->Object, &dummy)) break; + rslt = rslt->next; + } + + return rslt; +} + +static inline UUID *LookupObjType(UUID *ObjUuid) +{ + RpcObjTypeMap *map = LookupObjTypeMap(ObjUuid); + if (map) + return &map->Type; + else + return &uuid_nil; +} + +static RpcServerInterface* RPCRT4_find_interface(UUID* object, + const RPC_SYNTAX_IDENTIFIER* if_id, + BOOL check_object) +{ + UUID* MgrType = NULL; + RpcServerInterface* cif; + RPC_STATUS status; + + if (check_object) + MgrType = LookupObjType(object); + EnterCriticalSection(&server_cs); + LIST_FOR_EACH_ENTRY(cif, &server_interfaces, RpcServerInterface, entry) { + if (!memcmp(if_id, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)) && + (check_object == FALSE || UuidEqual(MgrType, &cif->MgrTypeUuid, &status)) && + std_listen) { + InterlockedIncrement(&cif->CurrentCalls); + break; + } + } + LeaveCriticalSection(&server_cs); + if (&cif->entry == &server_interfaces) cif = NULL; + TRACE("returning %p for %s\n", cif, debugstr_guid(object)); + return cif; +} + +static void RPCRT4_release_server_interface(RpcServerInterface *sif) +{ + if (!InterlockedDecrement(&sif->CurrentCalls) && + sif->CallsCompletedEvent) { + /* sif must have been removed from server_interfaces before + * CallsCompletedEvent is set */ + SetEvent(sif->CallsCompletedEvent); + HeapFree(GetProcessHeap(), 0, sif); + } +} + +static WINE_EXCEPTION_FILTER(rpc_filter) +{ + WARN("exception caught with code 0x%08x = %d\n", GetExceptionCode(), GetExceptionCode()); + TRACE("returning failure packet\n"); + /* catch every exception */ + return EXCEPTION_EXECUTE_HANDLER; +} + +static void RPCRT4_process_packet(RpcConnection* conn, RpcPktHdr* hdr, RPC_MESSAGE* msg) +{ + RpcServerInterface* sif; + RPC_DISPATCH_FUNCTION func; + UUID *object_uuid; + RpcPktHdr *response; + void *buf = msg->Buffer; + RPC_STATUS status; + BOOL exception; + + switch (hdr->common.ptype) { + case PKT_BIND: + TRACE("got bind packet\n"); + + /* FIXME: do more checks! */ + if (hdr->bind.max_tsize < RPC_MIN_PACKET_SIZE || + !UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status)) { + TRACE("packet size less than min size, or active interface syntax guid non-null\n"); + sif = NULL; + } else { + sif = RPCRT4_find_interface(NULL, &hdr->bind.abstract, FALSE); + } + if (sif == NULL) { + TRACE("rejecting bind request on connection %p\n", conn); + /* Report failure to client. */ + response = RPCRT4_BuildBindNackHeader(NDR_LOCAL_DATA_REPRESENTATION, + RPC_VER_MAJOR, RPC_VER_MINOR); + } else { + TRACE("accepting bind request on connection %p for %s\n", conn, + debugstr_guid(&hdr->bind.abstract.SyntaxGUID)); + + /* accept. */ + response = RPCRT4_BuildBindAckHeader(NDR_LOCAL_DATA_REPRESENTATION, + RPC_MAX_PACKET_SIZE, + RPC_MAX_PACKET_SIZE, + conn->Endpoint, + RESULT_ACCEPT, REASON_NONE, + &sif->If->TransferSyntax); + + /* save the interface for later use */ + conn->ActiveInterface = hdr->bind.abstract; + conn->MaxTransmissionSize = hdr->bind.max_tsize; + + RPCRT4_release_server_interface(sif); + } + + status = RPCRT4_Send(conn, response, NULL, 0); + RPCRT4_FreeHeader(response); + if (status != RPC_S_OK) + goto fail; + + break; + + case PKT_REQUEST: + TRACE("got request packet\n"); + + /* fail if the connection isn't bound with an interface */ + if (UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status)) { + /* FIXME: should send BindNack instead */ + response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION, + status); + + RPCRT4_Send(conn, response, NULL, 0); + RPCRT4_FreeHeader(response); + break; + } + + if (hdr->common.flags & RPC_FLG_OBJECT_UUID) { + object_uuid = (UUID*)(&hdr->request + 1); + } else { + object_uuid = NULL; + } + + sif = RPCRT4_find_interface(object_uuid, &conn->ActiveInterface, TRUE); + if (!sif) { + WARN("interface %s no longer registered, returning fault packet\n", debugstr_guid(&conn->ActiveInterface.SyntaxGUID)); + response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION, + NCA_S_UNK_IF); + + RPCRT4_Send(conn, response, NULL, 0); + RPCRT4_FreeHeader(response); + break; + } + msg->RpcInterfaceInformation = sif->If; + /* copy the endpoint vector from sif to msg so that midl-generated code will use it */ + msg->ManagerEpv = sif->MgrEpv; + if (object_uuid != NULL) { + RPCRT4_SetBindingObject(msg->Handle, object_uuid); + } + + /* find dispatch function */ + msg->ProcNum = hdr->request.opnum; + if (sif->Flags & RPC_IF_OLE) { + /* native ole32 always gives us a dispatch table with a single entry + * (I assume that's a wrapper for IRpcStubBuffer::Invoke) */ + func = *sif->If->DispatchTable->DispatchTable; + } else { + if (msg->ProcNum >= sif->If->DispatchTable->DispatchTableCount) { + WARN("invalid procnum (%d/%d)\n", msg->ProcNum, sif->If->DispatchTable->DispatchTableCount); + response = RPCRT4_BuildFaultHeader(NDR_LOCAL_DATA_REPRESENTATION, + NCA_S_OP_RNG_ERROR); + + RPCRT4_Send(conn, response, NULL, 0); + RPCRT4_FreeHeader(response); + } + func = sif->If->DispatchTable->DispatchTable[msg->ProcNum]; + } + + /* put in the drep. FIXME: is this more universally applicable? + perhaps we should move this outward... */ + msg->DataRepresentation = + MAKELONG( MAKEWORD(hdr->common.drep[0], hdr->common.drep[1]), + MAKEWORD(hdr->common.drep[2], hdr->common.drep[3])); + + exception = FALSE; + + /* dispatch */ + __TRY { + if (func) func(msg); + } __EXCEPT(rpc_filter) { + exception = TRUE; + if (GetExceptionCode() == STATUS_ACCESS_VIOLATION) + status = ERROR_NOACCESS; + else + status = GetExceptionCode(); + response = RPCRT4_BuildFaultHeader(msg->DataRepresentation, + RPC2NCA_STATUS(status)); + } __ENDTRY + + if (!exception) + response = RPCRT4_BuildResponseHeader(msg->DataRepresentation, + msg->BufferLength); + + /* send response packet */ + if (response) { + status = RPCRT4_Send(conn, response, exception ? NULL : msg->Buffer, + exception ? 0 : msg->BufferLength); + RPCRT4_FreeHeader(response); + } else + ERR("out of memory\n"); + + msg->RpcInterfaceInformation = NULL; + RPCRT4_release_server_interface(sif); + + break; + + default: + FIXME("unhandled packet type %u\n", hdr->common.ptype); + break; + } + +fail: + /* clean up */ + if (msg->Buffer == buf) msg->Buffer = NULL; + TRACE("freeing Buffer=%p\n", buf); + HeapFree(GetProcessHeap(), 0, buf); + RPCRT4_DestroyBinding(msg->Handle); + msg->Handle = 0; + I_RpcFreeBuffer(msg); + msg->Buffer = NULL; + RPCRT4_FreeHeader(hdr); + HeapFree(GetProcessHeap(), 0, msg); +} + +static DWORD CALLBACK RPCRT4_worker_thread(LPVOID the_arg) +{ + RpcPacket *pkt = the_arg; + RPCRT4_process_packet(pkt->conn, pkt->hdr, pkt->msg); + HeapFree(GetProcessHeap(), 0, pkt); + return 0; +} + +static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg) +{ + RpcConnection* conn = (RpcConnection*)the_arg; + RpcPktHdr *hdr; + RpcBinding *pbind; + RPC_MESSAGE *msg; + RPC_STATUS status; + RpcPacket *packet; + + TRACE("(%p)\n", conn); + + for (;;) { + msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RPC_MESSAGE)); + + /* create temporary binding for dispatch, it will be freed in + * RPCRT4_process_packet */ + RPCRT4_MakeBinding(&pbind, conn); + msg->Handle = (RPC_BINDING_HANDLE)pbind; + + status = RPCRT4_Receive(conn, &hdr, msg); + if (status != RPC_S_OK) { + WARN("receive failed with error %lx\n", status); + HeapFree(GetProcessHeap(), 0, msg); + break; + } + +#if 0 + RPCRT4_process_packet(conn, hdr, msg); +#else + packet = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcPacket)); + packet->conn = conn; + packet->hdr = hdr; + packet->msg = msg; + QueueUserWorkItem(RPCRT4_worker_thread, packet, WT_EXECUTELONGFUNCTION); +#endif + msg = NULL; + } + RPCRT4_DestroyConnection(conn); + return 0; +} + +void RPCRT4_new_client(RpcConnection* conn) +{ + HANDLE thread = CreateThread(NULL, 0, RPCRT4_io_thread, conn, 0, NULL); + if (!thread) { + DWORD err = GetLastError(); + ERR("failed to create thread, error=%08x\n", err); + RPCRT4_DestroyConnection(conn); + } + /* we could set conn->thread, but then we'd have to make the io_thread wait + * for that, otherwise the thread might finish, destroy the connection, and + * free the memory we'd write to before we did, causing crashes and stuff - + * so let's implement that later, when we really need conn->thread */ + + CloseHandle( thread ); +} + +static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) +{ + int res; + unsigned int count; + void *objs = NULL; + RpcServerProtseq* cps = the_arg; + RpcConnection* conn; + BOOL set_ready_event = FALSE; + + TRACE("(the_arg == ^%p)\n", the_arg); + + for (;;) { + objs = cps->ops->get_wait_array(cps, objs, &count); + + if (set_ready_event) + { + /* signal to function that changed state that we are now sync'ed */ + SetEvent(cps->server_ready_event); + set_ready_event = FALSE; + } + + /* start waiting */ + res = cps->ops->wait_for_new_connection(cps, count, objs); + if (res == -1) + break; + else if (res == 0) + { + if (!std_listen) + { + SetEvent(cps->server_ready_event); + break; + } + set_ready_event = TRUE; + } + } + cps->ops->free_wait_array(cps, objs); + EnterCriticalSection(&cps->cs); + /* close connections */ + conn = cps->conn; + while (conn) { + RPCRT4_CloseConnection(conn); + conn = conn->Next; + } + LeaveCriticalSection(&cps->cs); + return 0; +} + +/* tells the server thread that the state has changed and waits for it to + * make the changes */ +static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps) +{ + /* make sure we are the only thread sync'ing the server state, otherwise + * there is a race with the server thread setting an older state and setting + * the server_ready_event when the new state hasn't yet been applied */ + WaitForSingleObject(ps->mgr_mutex, INFINITE); + + ps->ops->signal_state_changed(ps); + + /* wait for server thread to make the requested changes before returning */ + WaitForSingleObject(ps->server_ready_event, INFINITE); + + ReleaseMutex(ps->mgr_mutex); +} + +static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen) +{ + RPC_STATUS status = RPC_S_OK; + HANDLE server_thread; + + EnterCriticalSection(&listen_cs); + if (ps->is_listening) goto done; + + if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL); + if (!ps->server_ready_event) ps->server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); + server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); + if (!server_thread) + { + status = RPC_S_OUT_OF_RESOURCES; + goto done; + } + ps->is_listening = TRUE; + CloseHandle(server_thread); + +done: + LeaveCriticalSection(&listen_cs); + return status; +} + +static RPC_STATUS RPCRT4_start_listen(BOOL auto_listen) +{ + RPC_STATUS status = RPC_S_ALREADY_LISTENING; + RpcServerProtseq *cps; + + TRACE("\n"); + + EnterCriticalSection(&listen_cs); + if (auto_listen || (manual_listen_count++ == 0)) + { + status = RPC_S_OK; + if (++listen_count == 1) + std_listen = TRUE; + } + LeaveCriticalSection(&listen_cs); + + if (std_listen) + { + EnterCriticalSection(&server_cs); + LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) + { + status = RPCRT4_start_listen_protseq(cps, TRUE); + if (status != RPC_S_OK) + break; + + /* make sure server is actually listening on the interface before + * returning */ + RPCRT4_sync_with_server_thread(cps); + } + LeaveCriticalSection(&server_cs); + } + + return status; +} + +static void RPCRT4_stop_listen(BOOL auto_listen) +{ + EnterCriticalSection(&listen_cs); + if (auto_listen || (--manual_listen_count == 0)) + { + if (listen_count != 0 && --listen_count == 0) { + RpcServerProtseq *cps; + + std_listen = FALSE; + LeaveCriticalSection(&listen_cs); + + LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) + RPCRT4_sync_with_server_thread(cps); + + return; + } + assert(listen_count >= 0); + } + LeaveCriticalSection(&listen_cs); +} + +static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq* ps, LPSTR endpoint) +{ + RPC_STATUS status; + + status = ps->ops->open_endpoint(ps, endpoint); + if (status != RPC_S_OK) + return status; + + if (std_listen) + { + status = RPCRT4_start_listen_protseq(ps, FALSE); + if (status == RPC_S_OK) + RPCRT4_sync_with_server_thread(ps); + } + + return status; +} + +/*********************************************************************** + * RpcServerInqBindings (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerInqBindings( RPC_BINDING_VECTOR** BindingVector ) +{ + RPC_STATUS status; + DWORD count; + RpcServerProtseq* ps; + RpcConnection* conn; + + if (BindingVector) + TRACE("(*BindingVector == ^%p)\n", *BindingVector); + else + ERR("(BindingVector == NULL!!?)\n"); + + EnterCriticalSection(&server_cs); + /* count connections */ + count = 0; + LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { + EnterCriticalSection(&ps->cs); + conn = ps->conn; + while (conn) { + count++; + conn = conn->Next; + } + LeaveCriticalSection(&ps->cs); + } + if (count) { + /* export bindings */ + *BindingVector = HeapAlloc(GetProcessHeap(), 0, + sizeof(RPC_BINDING_VECTOR) + + sizeof(RPC_BINDING_HANDLE)*(count-1)); + (*BindingVector)->Count = count; + count = 0; + LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { + EnterCriticalSection(&ps->cs); + conn = ps->conn; + while (conn) { + RPCRT4_MakeBinding((RpcBinding**)&(*BindingVector)->BindingH[count], + conn); + count++; + conn = conn->Next; + } + LeaveCriticalSection(&ps->cs); + } + status = RPC_S_OK; + } else { + *BindingVector = NULL; + status = RPC_S_NO_BINDINGS; + } + LeaveCriticalSection(&server_cs); + return status; +} + +/*********************************************************************** + * RpcServerUseProtseqEpA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUseProtseqEpA( RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR 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 ); +} + +/*********************************************************************** + * RpcServerUseProtseqEpW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUseProtseqEpW( RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR 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 ); +} + +/*********************************************************************** + * alloc_serverprotoseq (internal) + * + * Must be called with server_cs held. + */ +static RPC_STATUS alloc_serverprotoseq(UINT MaxCalls, char *Protseq, RpcServerProtseq **ps) +{ + const struct protseq_ops *ops = rpcrt4_get_protseq_ops(Protseq); + + if (!ops) + { + FIXME("protseq %s not supported\n", debugstr_a(Protseq)); + return RPC_S_PROTSEQ_NOT_SUPPORTED; + } + + *ps = ops->alloc(); + if (!*ps) + return RPC_S_OUT_OF_RESOURCES; + (*ps)->MaxCalls = MaxCalls; + (*ps)->Protseq = Protseq; + (*ps)->ops = ops; + (*ps)->MaxCalls = 0; + (*ps)->conn = NULL; + InitializeCriticalSection(&(*ps)->cs); + (*ps)->is_listening = FALSE; + (*ps)->mgr_mutex = NULL; + (*ps)->server_ready_event = NULL; + + list_add_head(&protseqs, &(*ps)->entry); + + TRACE("new protseq %p created for %s\n", *ps, Protseq); + + return RPC_S_OK; +} + +/* Finds a given protseq or creates a new one if one doesn't already exist */ +static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, char *Protseq, RpcServerProtseq **ps) +{ + RPC_STATUS status; + RpcServerProtseq *cps; + + EnterCriticalSection(&server_cs); + + LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) + if (!strcmp(cps->Protseq, Protseq)) + { + TRACE("found existing protseq object for %s\n", Protseq); + *ps = cps; + LeaveCriticalSection(&server_cs); + return S_OK; + } + + status = alloc_serverprotoseq(MaxCalls, Protseq, ps); + + LeaveCriticalSection(&server_cs); + + return status; +} + +/*********************************************************************** + * RpcServerUseProtseqEpExA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUseProtseqEpExA( RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor, + PRPC_POLICY lpPolicy ) +{ + char *szps = (char*)Protseq, *szep = (char*)Endpoint; + RpcServerProtseq* ps; + RPC_STATUS status; + + TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_a(szps), MaxCalls, + debugstr_a(szep), SecurityDescriptor, + lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags ); + + status = RPCRT4_get_or_create_serverprotseq(MaxCalls, RPCRT4_strdupA(szps), &ps); + if (status != RPC_S_OK) + return status; + + return RPCRT4_use_protseq(ps, szep); +} + +/*********************************************************************** + * RpcServerUseProtseqEpExW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUseProtseqEpExW( RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor, + PRPC_POLICY lpPolicy ) +{ + RpcServerProtseq* ps; + RPC_STATUS status; + LPSTR EndpointA; + + TRACE("(%s,%u,%s,%p,{%u,%lu,%lu})\n", debugstr_w( Protseq ), MaxCalls, + debugstr_w( Endpoint ), SecurityDescriptor, + lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags ); + + status = RPCRT4_get_or_create_serverprotseq(MaxCalls, RPCRT4_strdupWtoA(Protseq), &ps); + if (status != RPC_S_OK) + return status; + + EndpointA = RPCRT4_strdupWtoA(Endpoint); + status = RPCRT4_use_protseq(ps, EndpointA); + RPCRT4_strfree(EndpointA); + return status; +} + +/*********************************************************************** + * RpcServerUseProtseqA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUseProtseqA(RPC_CSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor) +{ + TRACE("(Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_a((char*)Protseq), MaxCalls, SecurityDescriptor); + return RpcServerUseProtseqEpA(Protseq, MaxCalls, NULL, SecurityDescriptor); +} + +/*********************************************************************** + * RpcServerUseProtseqW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUseProtseqW(RPC_WSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor) +{ + TRACE("Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_w(Protseq), MaxCalls, SecurityDescriptor); + return RpcServerUseProtseqEpW(Protseq, MaxCalls, NULL, SecurityDescriptor); +} + +/*********************************************************************** + * RpcServerRegisterIf (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerRegisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv ) +{ + TRACE("(%p,%s,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv); + return RpcServerRegisterIf2( IfSpec, MgrTypeUuid, MgrEpv, 0, RPC_C_LISTEN_MAX_CALLS_DEFAULT, (UINT)-1, NULL ); +} + +/*********************************************************************** + * RpcServerRegisterIfEx (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerRegisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, + UINT Flags, UINT MaxCalls, RPC_IF_CALLBACK_FN* IfCallbackFn ) +{ + TRACE("(%p,%s,%p,%u,%u,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls, IfCallbackFn); + return RpcServerRegisterIf2( IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, (UINT)-1, IfCallbackFn ); +} + +/*********************************************************************** + * RpcServerRegisterIf2 (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, + UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn ) +{ + PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; + RpcServerInterface* sif; + unsigned int i; + + TRACE("(%p,%s,%p,%u,%u,%u,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls, + MaxRpcSize, IfCallbackFn); + TRACE(" interface id: %s %d.%d\n", debugstr_guid(&If->InterfaceId.SyntaxGUID), + If->InterfaceId.SyntaxVersion.MajorVersion, + If->InterfaceId.SyntaxVersion.MinorVersion); + TRACE(" transfer syntax: %s %d.%d\n", debugstr_guid(&If->TransferSyntax.SyntaxGUID), + If->TransferSyntax.SyntaxVersion.MajorVersion, + If->TransferSyntax.SyntaxVersion.MinorVersion); + TRACE(" dispatch table: %p\n", If->DispatchTable); + if (If->DispatchTable) { + TRACE(" dispatch table count: %d\n", If->DispatchTable->DispatchTableCount); + for (i=0; iDispatchTable->DispatchTableCount; i++) { + TRACE(" entry %d: %p\n", i, If->DispatchTable->DispatchTable[i]); + } + TRACE(" reserved: %ld\n", If->DispatchTable->Reserved); + } + TRACE(" protseq endpoint count: %d\n", If->RpcProtseqEndpointCount); + TRACE(" default manager epv: %p\n", If->DefaultManagerEpv); + TRACE(" interpreter info: %p\n", If->InterpreterInfo); + + sif = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcServerInterface)); + sif->If = If; + if (MgrTypeUuid) { + memcpy(&sif->MgrTypeUuid, MgrTypeUuid, sizeof(UUID)); + sif->MgrEpv = MgrEpv; + } else { + memset(&sif->MgrTypeUuid, 0, sizeof(UUID)); + sif->MgrEpv = If->DefaultManagerEpv; + } + sif->Flags = Flags; + sif->MaxCalls = MaxCalls; + sif->MaxRpcSize = MaxRpcSize; + sif->IfCallbackFn = IfCallbackFn; + + EnterCriticalSection(&server_cs); + list_add_head(&server_interfaces, &sif->entry); + LeaveCriticalSection(&server_cs); + + if (sif->Flags & RPC_IF_AUTOLISTEN) + RPCRT4_start_listen(TRUE); + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcServerUnregisterIf (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUnregisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, UINT WaitForCallsToComplete ) +{ + PRPC_SERVER_INTERFACE If = (PRPC_SERVER_INTERFACE)IfSpec; + HANDLE event = NULL; + BOOL found = FALSE; + BOOL completed = TRUE; + RpcServerInterface *cif; + RPC_STATUS status; + + TRACE("(IfSpec == (RPC_IF_HANDLE)^%p (%s), MgrTypeUuid == %s, WaitForCallsToComplete == %u)\n", + IfSpec, debugstr_guid(&If->InterfaceId.SyntaxGUID), debugstr_guid(MgrTypeUuid), WaitForCallsToComplete); + + EnterCriticalSection(&server_cs); + LIST_FOR_EACH_ENTRY(cif, &server_interfaces, RpcServerInterface, entry) { + if ((!IfSpec || !memcmp(&If->InterfaceId, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER))) && + UuidEqual(MgrTypeUuid, &cif->MgrTypeUuid, &status)) { + list_remove(&cif->entry); + if (cif->CurrentCalls) { + completed = FALSE; + if (WaitForCallsToComplete) + cif->CallsCompletedEvent = event = CreateEventW(NULL, FALSE, FALSE, NULL); + } + found = TRUE; + break; + } + } + LeaveCriticalSection(&server_cs); + + if (!found) { + ERR("not found for object %s\n", debugstr_guid(MgrTypeUuid)); + return RPC_S_UNKNOWN_IF; + } + + if (completed) + HeapFree(GetProcessHeap(), 0, cif); + else if (event) { + /* sif will be freed when the last call is completed, so be careful not to + * touch that memory here as that could happen before we get here */ + WaitForSingleObject(event, INFINITE); + CloseHandle(event); + } + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcServerUnregisterIfEx (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerUnregisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, int RundownContextHandles ) +{ + FIXME("(IfSpec == (RPC_IF_HANDLE)^%p, MgrTypeUuid == %s, RundownContextHandles == %d): stub\n", + IfSpec, debugstr_guid(MgrTypeUuid), RundownContextHandles); + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcObjectSetType (RPCRT4.@) + * + * PARAMS + * ObjUuid [I] "Object" UUID + * TypeUuid [I] "Type" UUID + * + * RETURNS + * RPC_S_OK The call succeeded + * RPC_S_INVALID_OBJECT The provided object (nil) is not valid + * RPC_S_ALREADY_REGISTERED The provided object is already registered + * + * Maps "Object" UUIDs to "Type" UUID's. Passing the nil UUID as the type + * resets the mapping for the specified object UUID to nil (the default). + * The nil object is always associated with the nil type and cannot be + * reassigned. Servers can support multiple implementations on the same + * interface by registering different end-point vectors for the different + * types. There's no need to call this if a server only supports the nil + * type, as is typical. + */ +RPC_STATUS WINAPI RpcObjectSetType( UUID* ObjUuid, UUID* TypeUuid ) +{ + RpcObjTypeMap *map = RpcObjTypeMaps, *prev = NULL; + RPC_STATUS dummy; + + TRACE("(ObjUUID == %s, TypeUuid == %s).\n", debugstr_guid(ObjUuid), debugstr_guid(TypeUuid)); + if ((! ObjUuid) || UuidIsNil(ObjUuid, &dummy)) { + /* nil uuid cannot be remapped */ + return RPC_S_INVALID_OBJECT; + } + + /* find the mapping for this object if there is one ... */ + while (map) { + if (! UuidCompare(ObjUuid, &map->Object, &dummy)) break; + prev = map; + map = map->next; + } + if ((! TypeUuid) || UuidIsNil(TypeUuid, &dummy)) { + /* ... and drop it from the list */ + if (map) { + if (prev) + prev->next = map->next; + else + RpcObjTypeMaps = map->next; + HeapFree(GetProcessHeap(), 0, map); + } + } else { + /* ... , fail if we found it ... */ + if (map) + return RPC_S_ALREADY_REGISTERED; + /* ... otherwise create a new one and add it in. */ + map = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcObjTypeMap)); + memcpy(&map->Object, ObjUuid, sizeof(UUID)); + memcpy(&map->Type, TypeUuid, sizeof(UUID)); + map->next = NULL; + if (prev) + prev->next = map; /* prev is the last map in the linklist */ + else + RpcObjTypeMaps = map; + } + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcServerRegisterAuthInfoA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerRegisterAuthInfoA( RPC_CSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, + LPVOID Arg ) +{ + FIXME( "(%s,%u,%p,%p): stub\n", ServerPrincName, AuthnSvc, GetKeyFn, Arg ); + + return RPC_S_UNKNOWN_AUTHN_SERVICE; /* We don't know any authentication services */ +} + +/*********************************************************************** + * RpcServerRegisterAuthInfoW (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerRegisterAuthInfoW( RPC_WSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, + LPVOID Arg ) +{ + FIXME( "(%s,%u,%p,%p): stub\n", debugstr_w( ServerPrincName ), AuthnSvc, GetKeyFn, Arg ); + + return RPC_S_UNKNOWN_AUTHN_SERVICE; /* We don't know any authentication services */ +} + +/*********************************************************************** + * RpcServerListen (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait ) +{ + RPC_STATUS status = RPC_S_OK; + + TRACE("(%u,%u,%u)\n", MinimumCallThreads, MaxCalls, DontWait); + + if (list_empty(&protseqs)) + return RPC_S_NO_PROTSEQS_REGISTERED; + + status = RPCRT4_start_listen(FALSE); + + if (DontWait || (status != RPC_S_OK)) return status; + + return RpcMgmtWaitServerListen(); +} + +/*********************************************************************** + * RpcMgmtServerWaitListen (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) +{ + TRACE("()\n"); + + EnterCriticalSection(&listen_cs); + + if (!std_listen) { + LeaveCriticalSection(&listen_cs); + return RPC_S_NOT_LISTENING; + } + + LeaveCriticalSection(&listen_cs); + + FIXME("not waiting for server calls to finish\n"); + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcMgmtStopServerListening (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtStopServerListening ( RPC_BINDING_HANDLE Binding ) +{ + TRACE("(Binding == (RPC_BINDING_HANDLE)^%p)\n", Binding); + + if (Binding) { + FIXME("client-side invocation not implemented.\n"); + return RPC_S_WRONG_KIND_OF_BINDING; + } + + RPCRT4_stop_listen(FALSE); + + return RPC_S_OK; +} + +/*********************************************************************** + * RpcMgmtEnableIdleCleanup (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtEnableIdleCleanup(void) +{ + FIXME("(): stub\n"); + return RPC_S_OK; +} + +/*********************************************************************** + * I_RpcServerStartListening (RPCRT4.@) + */ +RPC_STATUS WINAPI I_RpcServerStartListening( HWND hWnd ) +{ + FIXME( "(%p): stub\n", hWnd ); + + return RPC_S_OK; +} + +/*********************************************************************** + * I_RpcServerStopListening (RPCRT4.@) + */ +RPC_STATUS WINAPI I_RpcServerStopListening( void ) +{ + FIXME( "(): stub\n" ); + + return RPC_S_OK; +} + +/*********************************************************************** + * I_RpcWindowProc (RPCRT4.@) + */ +UINT WINAPI I_RpcWindowProc( void *hWnd, UINT Message, UINT wParam, ULONG lParam ) +{ + FIXME( "(%p,%08x,%08x,%08x): stub\n", hWnd, Message, wParam, lParam ); + + return 0; +} + +/*********************************************************************** + * RpcMgmtInqIfIds (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtInqIfIds(RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR **IfIdVector) +{ + FIXME("(%p,%p): stub\n", Binding, IfIdVector); + return RPC_S_INVALID_BINDING; +} + +/*********************************************************************** + * RpcMgmtEpEltInqBegin (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtEpEltInqBegin(RPC_BINDING_HANDLE Binding, ULONG InquiryType, + RPC_IF_ID *IfId, ULONG VersOption, UUID *ObjectUuid, RPC_EP_INQ_HANDLE* InquiryContext) +{ + FIXME("(%p,%u,%p,%u,%p,%p): stub\n", + Binding, InquiryType, IfId, VersOption, ObjectUuid, InquiryContext); + return RPC_S_INVALID_BINDING; +} + +/*********************************************************************** + * RpcMgmtIsServerListening (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding) +{ + FIXME("(%p): stub\n", Binding); + return RPC_S_INVALID_BINDING; +} + +/*********************************************************************** + * RpcMgmtSetServerStackSize (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcMgmtSetServerStackSize(ULONG ThreadStackSize) +{ + FIXME("(0x%x): stub\n", ThreadStackSize); + return RPC_S_OK; +} diff --git a/reactos/dll/win32/rpcrt4_new/rpc_server.h b/reactos/dll/win32/rpcrt4_new/rpc_server.h index eb32be6afc9..822e954a880 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_server.h +++ b/reactos/dll/win32/rpcrt4_new/rpc_server.h @@ -1,81 +1,81 @@ -/* - * RPC server API - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_RPC_SERVER_H -#define __WINE_RPC_SERVER_H - -#include "rpc_binding.h" -#include "wine/list.h" - -struct protseq_ops; - -typedef struct _RpcServerProtseq -{ - const struct protseq_ops *ops; /* RO */ - struct list entry; /* CS ::server_cs */ - LPSTR Protseq; /* RO */ - UINT MaxCalls; /* RO */ - /* list of listening connections */ - RpcConnection* conn; /* CS cs */ - CRITICAL_SECTION cs; - - /* is the server currently listening? */ - BOOL is_listening; /* CS ::listen_cs */ - /* mutex for ensuring only one thread can change state at a time */ - HANDLE mgr_mutex; - /* set when server thread has finished opening connections */ - HANDLE server_ready_event; -} RpcServerProtseq; - -struct protseq_ops -{ - const char *name; - RpcServerProtseq *(*alloc)(void); - void (*signal_state_changed)(RpcServerProtseq *protseq); - /* previous array is passed in to allow reuse of memory */ - void *(*get_wait_array)(RpcServerProtseq *protseq, void *prev_array, unsigned int *count); - void (*free_wait_array)(RpcServerProtseq *protseq, void *array); - /* returns -1 for failure, 0 for server state changed and 1 to indicate a - * new connection was established */ - int (*wait_for_new_connection)(RpcServerProtseq *protseq, unsigned int count, void *wait_array); - /* opens the endpoint and optionally begins listening */ - RPC_STATUS (*open_endpoint)(RpcServerProtseq *protseq, LPSTR endpoint); -}; - -typedef struct _RpcServerInterface -{ - struct list entry; - RPC_SERVER_INTERFACE* If; - UUID MgrTypeUuid; - RPC_MGR_EPV* MgrEpv; - UINT Flags; - UINT MaxCalls; - UINT MaxRpcSize; - RPC_IF_CALLBACK_FN* IfCallbackFn; - LONG CurrentCalls; /* number of calls currently executing */ - /* set when unregistering interface to let the caller of - * RpcServerUnregisterIf* know that all calls have finished */ - HANDLE CallsCompletedEvent; -} RpcServerInterface; - -void RPCRT4_new_client(RpcConnection* conn); -const struct protseq_ops *rpcrt4_get_protseq_ops(const char *protseq); - -#endif /* __WINE_RPC_SERVER_H */ +/* + * RPC server API + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_RPC_SERVER_H +#define __WINE_RPC_SERVER_H + +#include "rpc_binding.h" +#include "wine/list.h" + +struct protseq_ops; + +typedef struct _RpcServerProtseq +{ + const struct protseq_ops *ops; /* RO */ + struct list entry; /* CS ::server_cs */ + LPSTR Protseq; /* RO */ + UINT MaxCalls; /* RO */ + /* list of listening connections */ + RpcConnection* conn; /* CS cs */ + CRITICAL_SECTION cs; + + /* is the server currently listening? */ + BOOL is_listening; /* CS ::listen_cs */ + /* mutex for ensuring only one thread can change state at a time */ + HANDLE mgr_mutex; + /* set when server thread has finished opening connections */ + HANDLE server_ready_event; +} RpcServerProtseq; + +struct protseq_ops +{ + const char *name; + RpcServerProtseq *(*alloc)(void); + void (*signal_state_changed)(RpcServerProtseq *protseq); + /* previous array is passed in to allow reuse of memory */ + void *(*get_wait_array)(RpcServerProtseq *protseq, void *prev_array, unsigned int *count); + void (*free_wait_array)(RpcServerProtseq *protseq, void *array); + /* returns -1 for failure, 0 for server state changed and 1 to indicate a + * new connection was established */ + int (*wait_for_new_connection)(RpcServerProtseq *protseq, unsigned int count, void *wait_array); + /* opens the endpoint and optionally begins listening */ + RPC_STATUS (*open_endpoint)(RpcServerProtseq *protseq, LPSTR endpoint); +}; + +typedef struct _RpcServerInterface +{ + struct list entry; + RPC_SERVER_INTERFACE* If; + UUID MgrTypeUuid; + RPC_MGR_EPV* MgrEpv; + UINT Flags; + UINT MaxCalls; + UINT MaxRpcSize; + RPC_IF_CALLBACK_FN* IfCallbackFn; + LONG CurrentCalls; /* number of calls currently executing */ + /* set when unregistering interface to let the caller of + * RpcServerUnregisterIf* know that all calls have finished */ + HANDLE CallsCompletedEvent; +} RpcServerInterface; + +void RPCRT4_new_client(RpcConnection* conn); +const struct protseq_ops *rpcrt4_get_protseq_ops(const char *protseq); + +#endif /* __WINE_RPC_SERVER_H */ diff --git a/reactos/dll/win32/rpcrt4_new/rpc_transport.c b/reactos/dll/win32/rpcrt4_new/rpc_transport.c index b99f4fc553e..6e2a699cece 100644 --- a/reactos/dll/win32/rpcrt4_new/rpc_transport.c +++ b/reactos/dll/win32/rpcrt4_new/rpc_transport.c @@ -1,1837 +1,1837 @@ -/* - * RPC transport layer - * - * Copyright 2001 Ove Kåven, TransGaming Technologies - * Copyright 2003 Mike Hearn - * Copyright 2004 Filip Navara - * Copyright 2006 Mike McCormack - * Copyright 2006 Damjan Jovanovic - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - */ - -#include "config.h" - -#include -#include -#include -#include -#include - -#ifdef HAVE_UNISTD_H -# include -#endif -#include -#include -#include -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_NETINET_TCP_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_SYS_POLL_H -#include -#endif - -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winnls.h" -#include "winerror.h" -#include "winternl.h" -#include "wine/unicode.h" - -#include "rpc.h" -#include "rpcndr.h" - -#include "wine/debug.h" - -#include "rpc_binding.h" -#include "rpc_message.h" -#include "rpc_server.h" -#include "epm_towers.h" - -#include "unix_func.h" - -#ifndef SOL_TCP -# define SOL_TCP IPPROTO_TCP -#endif - -WINE_DEFAULT_DEBUG_CHANNEL(rpc); - -static CRITICAL_SECTION assoc_list_cs; -static CRITICAL_SECTION_DEBUG assoc_list_cs_debug = -{ - 0, 0, &assoc_list_cs, - { &assoc_list_cs_debug.ProcessLocksList, &assoc_list_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": assoc_list_cs") } -}; -static CRITICAL_SECTION assoc_list_cs = { &assoc_list_cs_debug, -1, 0, 0, 0, 0 }; - -static struct list assoc_list = LIST_INIT(assoc_list); - -/**** ncacn_np support ****/ - -typedef struct _RpcConnection_np -{ - RpcConnection common; - HANDLE pipe; - OVERLAPPED ovl; - BOOL listening; -} RpcConnection_np; - -static RpcConnection *rpcrt4_conn_np_alloc(void) -{ - RpcConnection_np *npc = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcConnection_np)); - if (npc) - { - npc->pipe = NULL; - memset(&npc->ovl, 0, sizeof(npc->ovl)); - npc->listening = FALSE; - } - return &npc->common; -} - -static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc) -{ - if (npc->listening) - return RPC_S_OK; - - npc->listening = TRUE; - if (ConnectNamedPipe(npc->pipe, &npc->ovl)) - return RPC_S_OK; - - if (GetLastError() == ERROR_PIPE_CONNECTED) { - SetEvent(npc->ovl.hEvent); - return RPC_S_OK; - } - if (GetLastError() == ERROR_IO_PENDING) { - /* will be completed in rpcrt4_protseq_np_wait_for_new_connection */ - return RPC_S_OK; - } - npc->listening = FALSE; - WARN("Couldn't ConnectNamedPipe (error was %d)\n", GetLastError()); - return RPC_S_OUT_OF_RESOURCES; -} - -static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *Connection, LPCSTR pname) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - TRACE("listening on %s\n", pname); - - npc->pipe = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX, - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, - PIPE_UNLIMITED_INSTANCES, - RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); - if (npc->pipe == INVALID_HANDLE_VALUE) { - WARN("CreateNamedPipe failed with error %d\n", GetLastError()); - if (GetLastError() == ERROR_FILE_EXISTS) - return RPC_S_DUPLICATE_ENDPOINT; - else - return RPC_S_CANT_CREATE_ENDPOINT; - } - - memset(&npc->ovl, 0, sizeof(npc->ovl)); - npc->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); - - /* Note: we don't call ConnectNamedPipe here because it must be done in the - * server thread as the thread must be alertable */ - return RPC_S_OK; -} - -static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname, BOOL wait) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - HANDLE pipe; - DWORD err, dwMode; - - TRACE("connecting to %s\n", pname); - - while (TRUE) { - DWORD dwFlags = 0; - if (Connection->QOS) - { - dwFlags = SECURITY_SQOS_PRESENT; - switch (Connection->QOS->qos->ImpersonationType) - { - case RPC_C_IMP_LEVEL_DEFAULT: - /* FIXME: what to do here? */ - break; - case RPC_C_IMP_LEVEL_ANONYMOUS: - dwFlags |= SECURITY_ANONYMOUS; - break; - case RPC_C_IMP_LEVEL_IDENTIFY: - dwFlags |= SECURITY_IDENTIFICATION; - break; - case RPC_C_IMP_LEVEL_IMPERSONATE: - dwFlags |= SECURITY_IMPERSONATION; - break; - case RPC_C_IMP_LEVEL_DELEGATE: - dwFlags |= SECURITY_DELEGATION; - break; - } - if (Connection->QOS->qos->IdentityTracking == RPC_C_QOS_IDENTIFY_DYNAMIC) - dwFlags |= SECURITY_CONTEXT_TRACKING; - } - pipe = CreateFileA(pname, GENERIC_READ|GENERIC_WRITE, 0, NULL, - OPEN_EXISTING, dwFlags, 0); - if (pipe != INVALID_HANDLE_VALUE) break; - err = GetLastError(); - if (err == ERROR_PIPE_BUSY) { - TRACE("connection failed, error=%x\n", err); - return RPC_S_SERVER_TOO_BUSY; - } - if (!wait) - return RPC_S_SERVER_UNAVAILABLE; - if (!WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { - err = GetLastError(); - WARN("connection failed, error=%x\n", err); - return RPC_S_SERVER_UNAVAILABLE; - } - } - - /* success */ - memset(&npc->ovl, 0, sizeof(npc->ovl)); - /* pipe is connected; change to message-read mode. */ - dwMode = PIPE_READMODE_MESSAGE; - SetNamedPipeHandleState(pipe, &dwMode, NULL, NULL); - npc->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); - npc->pipe = pipe; - - return RPC_S_OK; -} - -static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; - RPC_STATUS r; - LPSTR pname; - - /* already connected? */ - if (npc->pipe) - return RPC_S_OK; - - /* protseq=ncalrpc: supposed to use NT LPC ports, - * but we'll implement it with named pipes for now */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); - I_RpcFree(pname); - - return r; -} - -static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, LPSTR endpoint) -{ - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; - RPC_STATUS r; - LPSTR pname; - RpcConnection *Connection; - - r = RPCRT4_CreateConnection(&Connection, TRUE, protseq->Protseq, NULL, - endpoint, NULL, NULL, NULL); - if (r != RPC_S_OK) - return r; - - /* protseq=ncalrpc: supposed to use NT LPC ports, - * but we'll implement it with named pipes for now */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); - - EnterCriticalSection(&protseq->cs); - Connection->Next = protseq->conn; - protseq->conn = Connection; - LeaveCriticalSection(&protseq->cs); - - return r; -} - -static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - static const char prefix[] = "\\\\."; - RPC_STATUS r; - LPSTR pname; - - /* already connected? */ - if (npc->pipe) - return RPC_S_OK; - - /* protseq=ncacn_np: named pipes */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_open_pipe(Connection, pname, FALSE); - I_RpcFree(pname); - - return r; -} - -static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, LPSTR endpoint) -{ - static const char prefix[] = "\\\\."; - RPC_STATUS r; - LPSTR pname; - RpcConnection *Connection; - - r = RPCRT4_CreateConnection(&Connection, TRUE, protseq->Protseq, NULL, - endpoint, NULL, NULL, NULL); - if (r != RPC_S_OK) - return r; - - /* protseq=ncacn_np: named pipes */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); - - EnterCriticalSection(&protseq->cs); - Connection->Next = protseq->conn; - protseq->conn = Connection; - LeaveCriticalSection(&protseq->cs); - - return r; -} - -static void rpcrt4_conn_np_handoff(RpcConnection_np *old_npc, RpcConnection_np *new_npc) -{ - /* because of the way named pipes work, we'll transfer the connected pipe - * to the child, then reopen the server binding to continue listening */ - - new_npc->pipe = old_npc->pipe; - new_npc->ovl = old_npc->ovl; - old_npc->pipe = 0; - memset(&old_npc->ovl, 0, sizeof(old_npc->ovl)); - old_npc->listening = FALSE; -} - -static RPC_STATUS rpcrt4_ncacn_np_handoff(RpcConnection *old_conn, RpcConnection *new_conn) -{ - RPC_STATUS status; - LPSTR pname; - static const char prefix[] = "\\\\."; - - rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - - pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); - strcat(strcpy(pname, prefix), old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); - - return status; -} - -static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection *new_conn) -{ - RPC_STATUS status; - LPSTR pname; - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; - - TRACE("%s\n", old_conn->Endpoint); - - rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - - pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); - strcat(strcpy(pname, prefix), old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); - - return status; -} - -static int rpcrt4_conn_np_read(RpcConnection *Connection, - void *buffer, unsigned int count) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - char *buf = buffer; - BOOL ret = TRUE; - unsigned int bytes_left = count; - - while (bytes_left) - { - DWORD bytes_read; - ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, NULL); - if (!ret || !bytes_read) - break; - bytes_left -= bytes_read; - buf += bytes_read; - } - return ret ? count : -1; -} - -static int rpcrt4_conn_np_write(RpcConnection *Connection, - const void *buffer, unsigned int count) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - const char *buf = buffer; - BOOL ret = TRUE; - unsigned int bytes_left = count; - - while (bytes_left) - { - DWORD bytes_written; - ret = WriteFile(npc->pipe, buf, count, &bytes_written, NULL); - if (!ret || !bytes_written) - break; - bytes_left -= bytes_written; - buf += bytes_written; - } - return ret ? count : -1; -} - -static int rpcrt4_conn_np_close(RpcConnection *Connection) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - if (npc->pipe) { - FlushFileBuffers(npc->pipe); - CloseHandle(npc->pipe); - npc->pipe = 0; - } - if (npc->ovl.hEvent) { - CloseHandle(npc->ovl.hEvent); - npc->ovl.hEvent = 0; - } - return 0; -} - -static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data, - const char *networkaddr, - const char *endpoint) -{ - twr_empty_floor_t *smb_floor; - twr_empty_floor_t *nb_floor; - size_t size; - size_t networkaddr_size; - size_t endpoint_size; - - TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint); - - networkaddr_size = strlen(networkaddr) + 1; - endpoint_size = strlen(endpoint) + 1; - size = sizeof(*smb_floor) + endpoint_size + sizeof(*nb_floor) + networkaddr_size; - - if (!tower_data) - return size; - - smb_floor = (twr_empty_floor_t *)tower_data; - - tower_data += sizeof(*smb_floor); - - smb_floor->count_lhs = sizeof(smb_floor->protid); - smb_floor->protid = EPM_PROTOCOL_SMB; - smb_floor->count_rhs = endpoint_size; - - memcpy(tower_data, endpoint, endpoint_size); - tower_data += endpoint_size; - - nb_floor = (twr_empty_floor_t *)tower_data; - - tower_data += sizeof(*nb_floor); - - nb_floor->count_lhs = sizeof(nb_floor->protid); - nb_floor->protid = EPM_PROTOCOL_NETBIOS; - nb_floor->count_rhs = networkaddr_size; - - memcpy(tower_data, networkaddr, networkaddr_size); - tower_data += networkaddr_size; - - return size; -} - -static RPC_STATUS rpcrt4_ncacn_np_parse_top_of_tower(const unsigned char *tower_data, - size_t tower_size, - char **networkaddr, - char **endpoint) -{ - const twr_empty_floor_t *smb_floor = (const twr_empty_floor_t *)tower_data; - const twr_empty_floor_t *nb_floor; - - TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint); - - if (tower_size < sizeof(*smb_floor)) - return EPT_S_NOT_REGISTERED; - - tower_data += sizeof(*smb_floor); - tower_size -= sizeof(*smb_floor); - - if ((smb_floor->count_lhs != sizeof(smb_floor->protid)) || - (smb_floor->protid != EPM_PROTOCOL_SMB) || - (smb_floor->count_rhs > tower_size)) - return EPT_S_NOT_REGISTERED; - - if (endpoint) - { - *endpoint = I_RpcAllocate(smb_floor->count_rhs); - if (!*endpoint) - return RPC_S_OUT_OF_RESOURCES; - memcpy(*endpoint, tower_data, smb_floor->count_rhs); - } - tower_data += smb_floor->count_rhs; - tower_size -= smb_floor->count_rhs; - - if (tower_size < sizeof(*nb_floor)) - return EPT_S_NOT_REGISTERED; - - nb_floor = (const twr_empty_floor_t *)tower_data; - - tower_data += sizeof(*nb_floor); - tower_size -= sizeof(*nb_floor); - - if ((nb_floor->count_lhs != sizeof(nb_floor->protid)) || - (nb_floor->protid != EPM_PROTOCOL_NETBIOS) || - (nb_floor->count_rhs > tower_size)) - return EPT_S_NOT_REGISTERED; - - if (networkaddr) - { - *networkaddr = I_RpcAllocate(nb_floor->count_rhs); - if (!*networkaddr) - { - if (endpoint) - { - I_RpcFree(*endpoint); - *endpoint = NULL; - } - return RPC_S_OUT_OF_RESOURCES; - } - memcpy(*networkaddr, tower_data, nb_floor->count_rhs); - } - - return RPC_S_OK; -} - -typedef struct _RpcServerProtseq_np -{ - RpcServerProtseq common; - HANDLE mgr_event; -} RpcServerProtseq_np; - -static RpcServerProtseq *rpcrt4_protseq_np_alloc(void) -{ - RpcServerProtseq_np *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps)); - if (ps) - ps->mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL); - return &ps->common; -} - -static void rpcrt4_protseq_np_signal_state_changed(RpcServerProtseq *protseq) -{ - RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); - SetEvent(npps->mgr_event); -} - -static void *rpcrt4_protseq_np_get_wait_array(RpcServerProtseq *protseq, void *prev_array, unsigned int *count) -{ - HANDLE *objs = prev_array; - RpcConnection_np *conn; - RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); - - EnterCriticalSection(&protseq->cs); - - /* open and count connections */ - *count = 1; - conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); - while (conn) { - rpcrt4_conn_listen_pipe(conn); - if (conn->ovl.hEvent) - (*count)++; - conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); - } - - /* make array of connections */ - if (objs) - objs = HeapReAlloc(GetProcessHeap(), 0, objs, *count*sizeof(HANDLE)); - else - objs = HeapAlloc(GetProcessHeap(), 0, *count*sizeof(HANDLE)); - if (!objs) - { - ERR("couldn't allocate objs\n"); - LeaveCriticalSection(&protseq->cs); - return NULL; - } - - objs[0] = npps->mgr_event; - *count = 1; - conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); - while (conn) { - if ((objs[*count] = conn->ovl.hEvent)) - (*count)++; - conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); - } - LeaveCriticalSection(&protseq->cs); - return objs; -} - -static void rpcrt4_protseq_np_free_wait_array(RpcServerProtseq *protseq, void *array) -{ - HeapFree(GetProcessHeap(), 0, array); -} - -static int rpcrt4_protseq_np_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array) -{ - HANDLE b_handle; - HANDLE *objs = wait_array; - DWORD res; - RpcConnection *cconn; - RpcConnection_np *conn; - - if (!objs) - return -1; - - res = WaitForMultipleObjects(count, objs, FALSE, INFINITE); - if (res == WAIT_OBJECT_0) - return 0; - else if (res == WAIT_FAILED) - { - ERR("wait failed with error %d\n", GetLastError()); - return -1; - } - else - { - b_handle = objs[res - WAIT_OBJECT_0]; - /* find which connection got a RPC */ - EnterCriticalSection(&protseq->cs); - conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); - while (conn) { - if (b_handle == conn->ovl.hEvent) break; - conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); - } - cconn = NULL; - if (conn) - RPCRT4_SpawnConnection(&cconn, &conn->common); - else - ERR("failed to locate connection for handle %p\n", b_handle); - LeaveCriticalSection(&protseq->cs); - if (cconn) - { - RPCRT4_new_client(cconn); - return 1; - } - else return -1; - } -} - -static size_t rpcrt4_ncalrpc_get_top_of_tower(unsigned char *tower_data, - const char *networkaddr, - const char *endpoint) -{ - twr_empty_floor_t *pipe_floor; - size_t size; - size_t endpoint_size; - - TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint); - - endpoint_size = strlen(networkaddr) + 1; - size = sizeof(*pipe_floor) + endpoint_size; - - if (!tower_data) - return size; - - pipe_floor = (twr_empty_floor_t *)tower_data; - - tower_data += sizeof(*pipe_floor); - - pipe_floor->count_lhs = sizeof(pipe_floor->protid); - pipe_floor->protid = EPM_PROTOCOL_SMB; - pipe_floor->count_rhs = endpoint_size; - - memcpy(tower_data, endpoint, endpoint_size); - tower_data += endpoint_size; - - return size; -} - -static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_data, - size_t tower_size, - char **networkaddr, - char **endpoint) -{ - const twr_empty_floor_t *pipe_floor = (const twr_empty_floor_t *)tower_data; - - TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint); - - *networkaddr = NULL; - *endpoint = NULL; - - if (tower_size < sizeof(*pipe_floor)) - return EPT_S_NOT_REGISTERED; - - tower_data += sizeof(*pipe_floor); - tower_size -= sizeof(*pipe_floor); - - if ((pipe_floor->count_lhs != sizeof(pipe_floor->protid)) || - (pipe_floor->protid != EPM_PROTOCOL_SMB) || - (pipe_floor->count_rhs > tower_size)) - return EPT_S_NOT_REGISTERED; - - if (endpoint) - { - *endpoint = I_RpcAllocate(pipe_floor->count_rhs); - if (!*endpoint) - return RPC_S_OUT_OF_RESOURCES; - memcpy(*endpoint, tower_data, pipe_floor->count_rhs); - } - - return RPC_S_OK; -} - -/**** ncacn_ip_tcp support ****/ - -typedef struct _RpcConnection_tcp -{ - RpcConnection common; - int sock; -} RpcConnection_tcp; - -static RpcConnection *rpcrt4_conn_tcp_alloc(void) -{ - RpcConnection_tcp *tcpc; - tcpc = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcConnection_tcp)); - if (tcpc == NULL) - return NULL; - tcpc->sock = -1; - return &tcpc->common; -} - -static RPC_STATUS rpcrt4_ncacn_ip_tcp_open(RpcConnection* Connection) -{ - RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; - int sock; - int ret; - struct addrinfo *ai; - struct addrinfo *ai_cur; - struct addrinfo hints; - - TRACE("(%s, %s)\n", Connection->NetworkAddr, Connection->Endpoint); - - if (tcpc->sock != -1) - return RPC_S_OK; - - hints.ai_flags = 0; - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - - ret = getaddrinfo(Connection->NetworkAddr, Connection->Endpoint, &hints, &ai); - if (ret) - { - ERR("getaddrinfo for %s:%s failed: %s\n", Connection->NetworkAddr, - Connection->Endpoint, gai_strerror(ret)); - return RPC_S_SERVER_UNAVAILABLE; - } - - for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next) - { - int val; - - if (TRACE_ON(rpc)) - { - char host[256]; - char service[256]; - getnameinfo(ai_cur->ai_addr, ai_cur->ai_addrlen, - host, sizeof(host), service, sizeof(service), - NI_NUMERICHOST | NI_NUMERICSERV); - TRACE("trying %s:%s\n", host, service); - } - - sock = socket(ai_cur->ai_family, ai_cur->ai_socktype, ai_cur->ai_protocol); - if (sock < 0) - { - WARN("socket() failed: %s\n", strerror(errno)); - continue; - } - - if (0>connect(sock, ai_cur->ai_addr, ai_cur->ai_addrlen)) - { - WARN("connect() failed: %s\n", strerror(errno)); - close(sock); - continue; - } - - /* RPC depends on having minimal latency so disable the Nagle algorithm */ - val = 1; - setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&val, sizeof(val)); - - tcpc->sock = sock; - - freeaddrinfo(ai); - TRACE("connected\n"); - return RPC_S_OK; - } - - freeaddrinfo(ai); - ERR("couldn't connect to %s:%s\n", Connection->NetworkAddr, Connection->Endpoint); - return RPC_S_SERVER_UNAVAILABLE; -} - -static RPC_STATUS rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(RpcServerProtseq *protseq, LPSTR endpoint) -{ - RPC_STATUS status = RPC_S_CANT_CREATE_ENDPOINT; - int sock; - int ret; - struct addrinfo *ai; - struct addrinfo *ai_cur; - struct addrinfo hints; - RpcConnection *first_connection = NULL; - u_long blocking; - - TRACE("(%p, %s)\n", protseq, endpoint); - - hints.ai_flags = AI_PASSIVE /* for non-localhost addresses */; - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - - ret = getaddrinfo(NULL, endpoint, &hints, &ai); - if (ret) - { - ERR("getaddrinfo for port %s failed: %s\n", endpoint, - gai_strerror(ret)); - if ((ret == EAI_SERVICE) || (ret == EAI_NONAME)) - return RPC_S_INVALID_ENDPOINT_FORMAT; - return RPC_S_CANT_CREATE_ENDPOINT; - } - - for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next) - { - RpcConnection_tcp *tcpc; - RPC_STATUS create_status; - - if (TRACE_ON(rpc)) - { - char host[256]; - char service[256]; - getnameinfo(ai_cur->ai_addr, ai_cur->ai_addrlen, - host, sizeof(host), service, sizeof(service), - NI_NUMERICHOST | NI_NUMERICSERV); - TRACE("trying %s:%s\n", host, service); - } - - sock = socket(ai_cur->ai_family, ai_cur->ai_socktype, ai_cur->ai_protocol); - if (sock < 0) - { - WARN("socket() failed: %s\n", strerror(errno)); - status = RPC_S_CANT_CREATE_ENDPOINT; - continue; - } - - ret = bind(sock, ai_cur->ai_addr, ai_cur->ai_addrlen); - if (ret < 0) - { - WARN("bind failed: %s\n", strerror(errno)); - close(sock); - if (errno == WSAEADDRINUSE) - status = RPC_S_DUPLICATE_ENDPOINT; - else - status = RPC_S_CANT_CREATE_ENDPOINT; - continue; - } - create_status = RPCRT4_CreateConnection((RpcConnection **)&tcpc, TRUE, - protseq->Protseq, NULL, - endpoint, NULL, NULL, NULL); - if (create_status != RPC_S_OK) - { - close(sock); - status = create_status; - continue; - } - - tcpc->sock = sock; - ret = listen(sock, protseq->MaxCalls); - if (ret < 0) - { - WARN("listen failed: %s\n", strerror(errno)); - RPCRT4_DestroyConnection(&tcpc->common); - status = RPC_S_OUT_OF_RESOURCES; - continue; - } - /* need a non-blocking socket, otherwise accept() has a potential - * race-condition (poll() says it is readable, connection drops, - * and accept() blocks until the next connection comes...) - */ - blocking = 1; - ret = ioctlsocket(sock, FIONBIO, &blocking); - if (ret < 0) - { - WARN("couldn't make socket non-blocking, error %d\n", ret); - RPCRT4_DestroyConnection(&tcpc->common); - status = RPC_S_OUT_OF_RESOURCES; - continue; - } - - tcpc->common.Next = first_connection; - first_connection = &tcpc->common; - } - - freeaddrinfo(ai); - - /* if at least one connection was created for an endpoint then - * return success */ - if (first_connection) - { - RpcConnection *conn; - - /* find last element in list */ - for (conn = first_connection; conn->Next; conn = conn->Next) - ; - - EnterCriticalSection(&protseq->cs); - conn->Next = protseq->conn; - protseq->conn = first_connection; - LeaveCriticalSection(&protseq->cs); - - TRACE("listening on %s\n", endpoint); - return RPC_S_OK; - } - - ERR("couldn't listen on port %s\n", endpoint); - return status; -} - -static RPC_STATUS rpcrt4_conn_tcp_handoff(RpcConnection *old_conn, RpcConnection *new_conn) -{ - int ret; - struct sockaddr_in address; - socklen_t addrsize; - u_long blocking; - RpcConnection_tcp *server = (RpcConnection_tcp*) old_conn; - RpcConnection_tcp *client = (RpcConnection_tcp*) new_conn; - - addrsize = sizeof(address); - ret = accept(server->sock, (struct sockaddr*) &address, &addrsize); - if (ret < 0) - { - ERR("Failed to accept a TCP connection: error %d\n", ret); - return RPC_S_OUT_OF_RESOURCES; - } - /* reset to blocking behaviour */ - blocking = 0; - ret = ioctlsocket(ret, FIONBIO, &blocking); - client->sock = ret; - TRACE("Accepted a new TCP connection\n"); - return RPC_S_OK; -} - -static int rpcrt4_conn_tcp_read(RpcConnection *Connection, - void *buffer, unsigned int count) -{ - RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; - int r = recv(tcpc->sock, buffer, count, MSG_WAITALL); - TRACE("%d %p %u -> %d\n", tcpc->sock, buffer, count, r); - return r; -} - -static int rpcrt4_conn_tcp_write(RpcConnection *Connection, - const void *buffer, unsigned int count) -{ - RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; - int r = write(tcpc->sock, buffer, count); - TRACE("%d %p %u -> %d\n", tcpc->sock, buffer, count, r); - return r; -} - -static int rpcrt4_conn_tcp_close(RpcConnection *Connection) -{ - RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; - - TRACE("%d\n", tcpc->sock); - - if (tcpc->sock != -1) - close(tcpc->sock); - tcpc->sock = -1; - return 0; -} - -static size_t rpcrt4_ncacn_ip_tcp_get_top_of_tower(unsigned char *tower_data, - const char *networkaddr, - const char *endpoint) -{ - twr_tcp_floor_t *tcp_floor; - twr_ipv4_floor_t *ipv4_floor; - struct addrinfo *ai; - struct addrinfo hints; - int ret; - size_t size = sizeof(*tcp_floor) + sizeof(*ipv4_floor); - - TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint); - - if (!tower_data) - return size; - - tcp_floor = (twr_tcp_floor_t *)tower_data; - tower_data += sizeof(*tcp_floor); - - ipv4_floor = (twr_ipv4_floor_t *)tower_data; - - tcp_floor->count_lhs = sizeof(tcp_floor->protid); - tcp_floor->protid = EPM_PROTOCOL_TCP; - tcp_floor->count_rhs = sizeof(tcp_floor->port); - - ipv4_floor->count_lhs = sizeof(ipv4_floor->protid); - ipv4_floor->protid = EPM_PROTOCOL_IP; - ipv4_floor->count_rhs = sizeof(ipv4_floor->ipv4addr); - - hints.ai_flags = AI_NUMERICHOST; - /* FIXME: only support IPv4 at the moment. how is IPv6 represented by the EPM? */ - hints.ai_family = PF_INET; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - - ret = getaddrinfo(networkaddr, endpoint, &hints, &ai); - if (ret) - { - ret = getaddrinfo("0.0.0.0", endpoint, &hints, &ai); - if (ret) - { - ERR("getaddrinfo failed: %s\n", gai_strerror(ret)); - return 0; - } - } - - if (ai->ai_family == PF_INET) - { - const struct sockaddr_in *sin = (const struct sockaddr_in *)ai->ai_addr; - tcp_floor->port = sin->sin_port; - ipv4_floor->ipv4addr = sin->sin_addr.s_addr; - } - else - { - ERR("unexpected protocol family %d\n", ai->ai_family); - return 0; - } - - freeaddrinfo(ai); - - return size; -} - -static RPC_STATUS rpcrt4_ncacn_ip_tcp_parse_top_of_tower(const unsigned char *tower_data, - size_t tower_size, - char **networkaddr, - char **endpoint) -{ - const twr_tcp_floor_t *tcp_floor = (const twr_tcp_floor_t *)tower_data; - const twr_ipv4_floor_t *ipv4_floor; - struct in_addr in_addr; - - TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint); - - if (tower_size < sizeof(*tcp_floor)) - return EPT_S_NOT_REGISTERED; - - tower_data += sizeof(*tcp_floor); - tower_size -= sizeof(*tcp_floor); - - if (tower_size < sizeof(*ipv4_floor)) - return EPT_S_NOT_REGISTERED; - - ipv4_floor = (const twr_ipv4_floor_t *)tower_data; - - if ((tcp_floor->count_lhs != sizeof(tcp_floor->protid)) || - (tcp_floor->protid != EPM_PROTOCOL_TCP) || - (tcp_floor->count_rhs != sizeof(tcp_floor->port)) || - (ipv4_floor->count_lhs != sizeof(ipv4_floor->protid)) || - (ipv4_floor->protid != EPM_PROTOCOL_IP) || - (ipv4_floor->count_rhs != sizeof(ipv4_floor->ipv4addr))) - return EPT_S_NOT_REGISTERED; - - if (endpoint) - { - *endpoint = I_RpcAllocate(6 /* sizeof("65535") + 1 */); - if (!*endpoint) - return RPC_S_OUT_OF_RESOURCES; - sprintf(*endpoint, "%u", ntohs(tcp_floor->port)); - } - - if (networkaddr) - { - *networkaddr = I_RpcAllocate(INET_ADDRSTRLEN); - if (!*networkaddr) - { - if (endpoint) - { - I_RpcFree(*endpoint); - *endpoint = NULL; - } - return RPC_S_OUT_OF_RESOURCES; - } - in_addr.s_addr = ipv4_floor->ipv4addr; - if (!inet_ntop(AF_INET, &in_addr, *networkaddr, INET_ADDRSTRLEN)) - { - ERR("inet_ntop: %s\n", strerror(errno)); - I_RpcFree(*networkaddr); - *networkaddr = NULL; - if (endpoint) - { - I_RpcFree(*endpoint); - *endpoint = NULL; - } - return EPT_S_NOT_REGISTERED; - } - } - - return RPC_S_OK; -} - -typedef struct _RpcServerProtseq_sock -{ - RpcServerProtseq common; - int mgr_event_rcv; - int mgr_event_snd; -} RpcServerProtseq_sock; - -static RpcServerProtseq *rpcrt4_protseq_sock_alloc(void) -{ - RpcServerProtseq_sock *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps)); - if (ps) - { - int fds[2]; - u_long blocking; - if (!socketpair(PF_UNIX, SOCK_DGRAM, 0, fds)) - { - blocking = 1; - ioctlsocket(fds[0], FIONBIO, &blocking); - ioctlsocket(fds[1], FIONBIO, &blocking); - ps->mgr_event_rcv = fds[0]; - ps->mgr_event_snd = fds[1]; - } - else - { - ERR("socketpair failed with error %s\n", strerror(errno)); - HeapFree(GetProcessHeap(), 0, ps); - return NULL; - } - } - return &ps->common; -} - -static void rpcrt4_protseq_sock_signal_state_changed(RpcServerProtseq *protseq) -{ - RpcServerProtseq_sock *sockps = CONTAINING_RECORD(protseq, RpcServerProtseq_sock, common); - char dummy = 1; - write(sockps->mgr_event_snd, &dummy, sizeof(dummy)); -} - -static void *rpcrt4_protseq_sock_get_wait_array(RpcServerProtseq *protseq, void *prev_array, unsigned int *count) -{ - struct pollfd *poll_info = prev_array; - RpcConnection_tcp *conn; - RpcServerProtseq_sock *sockps = CONTAINING_RECORD(protseq, RpcServerProtseq_sock, common); - - EnterCriticalSection(&protseq->cs); - - /* open and count connections */ - *count = 1; - conn = (RpcConnection_tcp *)protseq->conn; - while (conn) { - if (conn->sock != -1) - (*count)++; - conn = (RpcConnection_tcp *)conn->common.Next; - } - - /* make array of connections */ - if (poll_info) - poll_info = HeapReAlloc(GetProcessHeap(), 0, poll_info, *count*sizeof(*poll_info)); - else - poll_info = HeapAlloc(GetProcessHeap(), 0, *count*sizeof(*poll_info)); - if (!poll_info) - { - ERR("couldn't allocate poll_info\n"); - LeaveCriticalSection(&protseq->cs); - return NULL; - } - - poll_info[0].fd = sockps->mgr_event_rcv; - poll_info[0].events = POLLIN; - *count = 1; - conn = CONTAINING_RECORD(protseq->conn, RpcConnection_tcp, common); - while (conn) { - if (conn->sock != -1) - { - poll_info[*count].fd = conn->sock; - poll_info[*count].events = POLLIN; - (*count)++; - } - conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_tcp, common); - } - LeaveCriticalSection(&protseq->cs); - return poll_info; -} - -static void rpcrt4_protseq_sock_free_wait_array(RpcServerProtseq *protseq, void *array) -{ - HeapFree(GetProcessHeap(), 0, array); -} - -static int rpcrt4_protseq_sock_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array) -{ - struct pollfd *poll_info = wait_array; - int ret, i; - RpcConnection *cconn; - RpcConnection_tcp *conn; - - if (!poll_info) - return -1; - - ret = poll(poll_info, count, -1); - if (ret < 0) - { - ERR("poll failed with error %d\n", ret); - return -1; - } - - for (i = 0; i < count; i++) - if (poll_info[i].revents & POLLIN) - { - /* RPC server event */ - if (i == 0) - { - char dummy; - read(poll_info[0].fd, &dummy, sizeof(dummy)); - return 0; - } - - /* find which connection got a RPC */ - EnterCriticalSection(&protseq->cs); - conn = CONTAINING_RECORD(protseq->conn, RpcConnection_tcp, common); - while (conn) { - if (poll_info[i].fd == conn->sock) break; - conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_tcp, common); - } - cconn = NULL; - if (conn) - RPCRT4_SpawnConnection(&cconn, &conn->common); - else - ERR("failed to locate connection for fd %d\n", poll_info[i].fd); - LeaveCriticalSection(&protseq->cs); - if (cconn) - RPCRT4_new_client(cconn); - else - return -1; - } - - return 1; -} - -static const struct connection_ops conn_protseq_list[] = { - { "ncacn_np", - { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_SMB }, - rpcrt4_conn_np_alloc, - rpcrt4_ncacn_np_open, - rpcrt4_ncacn_np_handoff, - rpcrt4_conn_np_read, - rpcrt4_conn_np_write, - rpcrt4_conn_np_close, - rpcrt4_ncacn_np_get_top_of_tower, - rpcrt4_ncacn_np_parse_top_of_tower, - }, - { "ncalrpc", - { EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_PIPE }, - rpcrt4_conn_np_alloc, - rpcrt4_ncalrpc_open, - rpcrt4_ncalrpc_handoff, - rpcrt4_conn_np_read, - rpcrt4_conn_np_write, - rpcrt4_conn_np_close, - rpcrt4_ncalrpc_get_top_of_tower, - rpcrt4_ncalrpc_parse_top_of_tower, - }, - { "ncacn_ip_tcp", - { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_TCP }, - rpcrt4_conn_tcp_alloc, - rpcrt4_ncacn_ip_tcp_open, - rpcrt4_conn_tcp_handoff, - rpcrt4_conn_tcp_read, - rpcrt4_conn_tcp_write, - rpcrt4_conn_tcp_close, - rpcrt4_ncacn_ip_tcp_get_top_of_tower, - rpcrt4_ncacn_ip_tcp_parse_top_of_tower, - } -}; - - -static const struct protseq_ops protseq_list[] = -{ - { - "ncacn_np", - rpcrt4_protseq_np_alloc, - rpcrt4_protseq_np_signal_state_changed, - rpcrt4_protseq_np_get_wait_array, - rpcrt4_protseq_np_free_wait_array, - rpcrt4_protseq_np_wait_for_new_connection, - rpcrt4_protseq_ncacn_np_open_endpoint, - }, - { - "ncalrpc", - rpcrt4_protseq_np_alloc, - rpcrt4_protseq_np_signal_state_changed, - rpcrt4_protseq_np_get_wait_array, - rpcrt4_protseq_np_free_wait_array, - rpcrt4_protseq_np_wait_for_new_connection, - rpcrt4_protseq_ncalrpc_open_endpoint, - }, - { - "ncacn_ip_tcp", - rpcrt4_protseq_sock_alloc, - rpcrt4_protseq_sock_signal_state_changed, - rpcrt4_protseq_sock_get_wait_array, - rpcrt4_protseq_sock_free_wait_array, - rpcrt4_protseq_sock_wait_for_new_connection, - rpcrt4_protseq_ncacn_ip_tcp_open_endpoint, - }, -}; - -#define ARRAYSIZE(a) (sizeof((a)) / sizeof((a)[0])) - -const struct protseq_ops *rpcrt4_get_protseq_ops(const char *protseq) -{ - int i; - for(i=0; iserver); - return Connection->ops->open_connection_client(Connection); -} - -RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection) -{ - TRACE("(Connection == ^%p)\n", Connection); - if (SecIsValidHandle(&Connection->ctx)) - { - DeleteSecurityContext(&Connection->ctx); - SecInvalidateHandle(&Connection->ctx); - } - rpcrt4_conn_close(Connection); - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, - LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, - LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS) -{ - const struct connection_ops *ops; - RpcConnection* NewConnection; - - ops = rpcrt4_get_conn_protseq_ops(Protseq); - if (!ops) - { - FIXME("not supported for protseq %s\n", Protseq); - return RPC_S_PROTSEQ_NOT_SUPPORTED; - } - - NewConnection = ops->alloc(); - NewConnection->Next = NULL; - NewConnection->server = server; - NewConnection->ops = ops; - NewConnection->NetworkAddr = RPCRT4_strdupA(NetworkAddr); - NewConnection->Endpoint = RPCRT4_strdupA(Endpoint); - NewConnection->NetworkOptions = RPCRT4_strdupW(NetworkOptions); - NewConnection->MaxTransmissionSize = RPC_MAX_PACKET_SIZE; - memset(&NewConnection->ActiveInterface, 0, sizeof(NewConnection->ActiveInterface)); - NewConnection->NextCallId = 1; - - SecInvalidateHandle(&NewConnection->ctx); - memset(&NewConnection->exp, 0, sizeof(NewConnection->exp)); - NewConnection->attr = 0; - if (AuthInfo) RpcAuthInfo_AddRef(AuthInfo); - NewConnection->AuthInfo = AuthInfo; - NewConnection->encryption_auth_len = 0; - NewConnection->signature_auth_len = 0; - if (QOS) RpcQualityOfService_AddRef(QOS); - NewConnection->QOS = QOS; - - list_init(&NewConnection->conn_pool_entry); - - TRACE("connection: %p\n", NewConnection); - *Connection = NewConnection; - - return RPC_S_OK; -} - -RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, - LPCSTR Endpoint, LPCWSTR NetworkOptions, - RpcAssoc **assoc_out) -{ - RpcAssoc *assoc; - - EnterCriticalSection(&assoc_list_cs); - LIST_FOR_EACH_ENTRY(assoc, &assoc_list, RpcAssoc, entry) - { - if (!strcmp(Protseq, assoc->Protseq) && - !strcmp(NetworkAddr, assoc->NetworkAddr) && - !strcmp(Endpoint, assoc->Endpoint) && - ((!assoc->NetworkOptions && !NetworkOptions) || !strcmpW(NetworkOptions, assoc->NetworkOptions))) - { - assoc->refs++; - *assoc_out = assoc; - LeaveCriticalSection(&assoc_list_cs); - TRACE("using existing assoc %p\n", assoc); - return RPC_S_OK; - } - } - - assoc = HeapAlloc(GetProcessHeap(), 0, sizeof(*assoc)); - if (!assoc) - { - LeaveCriticalSection(&assoc_list_cs); - return RPC_S_OUT_OF_RESOURCES; - } - assoc->refs = 1; - list_init(&assoc->connection_pool); - InitializeCriticalSection(&assoc->cs); - assoc->Protseq = RPCRT4_strdupA(Protseq); - assoc->NetworkAddr = RPCRT4_strdupA(NetworkAddr); - assoc->Endpoint = RPCRT4_strdupA(Endpoint); - assoc->NetworkOptions = NetworkOptions ? RPCRT4_strdupW(NetworkOptions) : NULL; - assoc->assoc_group_id = 0; - list_add_head(&assoc_list, &assoc->entry); - *assoc_out = assoc; - - LeaveCriticalSection(&assoc_list_cs); - - TRACE("new assoc %p\n", assoc); - - return RPC_S_OK; -} - -ULONG RpcAssoc_Release(RpcAssoc *assoc) -{ - ULONG refs; - - EnterCriticalSection(&assoc_list_cs); - refs = --assoc->refs; - if (!refs) - list_remove(&assoc->entry); - LeaveCriticalSection(&assoc_list_cs); - - if (!refs) - { - RpcConnection *Connection, *cursor2; - - TRACE("destroying assoc %p\n", assoc); - - LIST_FOR_EACH_ENTRY_SAFE(Connection, cursor2, &assoc->connection_pool, RpcConnection, conn_pool_entry) - { - list_remove(&Connection->conn_pool_entry); - RPCRT4_DestroyConnection(Connection); - } - - HeapFree(GetProcessHeap(), 0, assoc->NetworkOptions); - HeapFree(GetProcessHeap(), 0, assoc->Endpoint); - HeapFree(GetProcessHeap(), 0, assoc->NetworkAddr); - HeapFree(GetProcessHeap(), 0, assoc->Protseq); - - HeapFree(GetProcessHeap(), 0, assoc); - } - - return refs; -} - -#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1)) - -static RPC_STATUS RpcAssoc_BindConnection(const RpcAssoc *assoc, RpcConnection *conn, - const RPC_SYNTAX_IDENTIFIER *InterfaceId, - const RPC_SYNTAX_IDENTIFIER *TransferSyntax) -{ - RpcPktHdr *hdr; - RpcPktHdr *response_hdr; - RPC_MESSAGE msg; - RPC_STATUS status; - - TRACE("sending bind request to server\n"); - - hdr = RPCRT4_BuildBindHeader(NDR_LOCAL_DATA_REPRESENTATION, - RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, - assoc->assoc_group_id, - InterfaceId, TransferSyntax); - - status = RPCRT4_Send(conn, hdr, NULL, 0); - RPCRT4_FreeHeader(hdr); - if (status != RPC_S_OK) - return status; - - status = RPCRT4_Receive(conn, &response_hdr, &msg); - if (status != RPC_S_OK) - { - ERR("receive failed\n"); - return status; - } - - switch (response_hdr->common.ptype) - { - case PKT_BIND_ACK: - { - RpcAddressString *server_address = msg.Buffer; - if ((msg.BufferLength >= FIELD_OFFSET(RpcAddressString, string[0])) || - (msg.BufferLength >= ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4))) - { - unsigned short remaining = msg.BufferLength - - ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4); - RpcResults *results = (RpcResults*)((ULONG_PTR)server_address + - ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4)); - if ((results->num_results == 1) && (remaining >= sizeof(*results))) - { - switch (results->results[0].result) - { - case RESULT_ACCEPT: - conn->assoc_group_id = response_hdr->bind_ack.assoc_gid; - conn->MaxTransmissionSize = response_hdr->bind_ack.max_tsize; - conn->ActiveInterface = *InterfaceId; - break; - case RESULT_PROVIDER_REJECTION: - switch (results->results[0].reason) - { - case REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED: - ERR("syntax %s, %d.%d not supported\n", - debugstr_guid(&InterfaceId->SyntaxGUID), - InterfaceId->SyntaxVersion.MajorVersion, - InterfaceId->SyntaxVersion.MinorVersion); - status = RPC_S_UNKNOWN_IF; - break; - case REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED: - ERR("transfer syntax not supported\n"); - status = RPC_S_SERVER_UNAVAILABLE; - break; - case REASON_NONE: - default: - status = RPC_S_CALL_FAILED_DNE; - } - break; - case RESULT_USER_REJECTION: - default: - ERR("rejection result %d\n", results->results[0].result); - status = RPC_S_CALL_FAILED_DNE; - } - } - else - { - ERR("incorrect results size\n"); - status = RPC_S_CALL_FAILED_DNE; - } - } - else - { - ERR("bind ack packet too small (%d)\n", msg.BufferLength); - status = RPC_S_PROTOCOL_ERROR; - } - break; - } - case PKT_BIND_NACK: - switch (response_hdr->bind_nack.reject_reason) - { - case REJECT_LOCAL_LIMIT_EXCEEDED: - case REJECT_TEMPORARY_CONGESTION: - ERR("server too busy\n"); - status = RPC_S_SERVER_TOO_BUSY; - break; - case REJECT_PROTOCOL_VERSION_NOT_SUPPORTED: - ERR("protocol version not supported\n"); - status = RPC_S_PROTOCOL_ERROR; - break; - case REJECT_UNKNOWN_AUTHN_SERVICE: - ERR("unknown authentication service\n"); - status = RPC_S_UNKNOWN_AUTHN_SERVICE; - break; - case REJECT_INVALID_CHECKSUM: - ERR("invalid checksum\n"); - status = ERROR_ACCESS_DENIED; - break; - default: - ERR("rejected bind for reason %d\n", response_hdr->bind_nack.reject_reason); - status = RPC_S_CALL_FAILED_DNE; - } - break; - default: - ERR("wrong packet type received %d\n", response_hdr->common.ptype); - status = RPC_S_PROTOCOL_ERROR; - break; - } - - RPCRT4_FreeHeader(response_hdr); - return status; -} - -static RpcConnection *RpcAssoc_GetIdleConnection(RpcAssoc *assoc, - const RPC_SYNTAX_IDENTIFIER *InterfaceId, - const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RpcAuthInfo *AuthInfo, - const RpcQualityOfService *QOS) -{ - RpcConnection *Connection; - EnterCriticalSection(&assoc->cs); - /* try to find a compatible connection from the connection pool */ - LIST_FOR_EACH_ENTRY(Connection, &assoc->connection_pool, RpcConnection, conn_pool_entry) - { - if (!memcmp(&Connection->ActiveInterface, InterfaceId, - sizeof(RPC_SYNTAX_IDENTIFIER)) && - RpcAuthInfo_IsEqual(Connection->AuthInfo, AuthInfo) && - RpcQualityOfService_IsEqual(Connection->QOS, QOS)) - { - list_remove(&Connection->conn_pool_entry); - LeaveCriticalSection(&assoc->cs); - TRACE("got connection from pool %p\n", Connection); - return Connection; - } - } - - LeaveCriticalSection(&assoc->cs); - return NULL; -} - -RPC_STATUS RpcAssoc_GetClientConnection(RpcAssoc *assoc, - const RPC_SYNTAX_IDENTIFIER *InterfaceId, - const RPC_SYNTAX_IDENTIFIER *TransferSyntax, RpcAuthInfo *AuthInfo, - RpcQualityOfService *QOS, RpcConnection **Connection) -{ - RpcConnection *NewConnection; - RPC_STATUS status; - - *Connection = RpcAssoc_GetIdleConnection(assoc, InterfaceId, TransferSyntax, AuthInfo, QOS); - if (*Connection) - return RPC_S_OK; - - /* create a new connection */ - status = RPCRT4_CreateConnection(&NewConnection, FALSE /* is this a server connection? */, - assoc->Protseq, assoc->NetworkAddr, - assoc->Endpoint, assoc->NetworkOptions, - AuthInfo, QOS); - if (status != RPC_S_OK) - return status; - - status = RPCRT4_OpenClientConnection(NewConnection); - if (status != RPC_S_OK) - { - RPCRT4_DestroyConnection(NewConnection); - return status; - } - - status = RpcAssoc_BindConnection(assoc, NewConnection, InterfaceId, TransferSyntax); - if (status != RPC_S_OK) - { - RPCRT4_DestroyConnection(NewConnection); - return status; - } - - *Connection = NewConnection; - - return RPC_S_OK; -} - -void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection) -{ - assert(!Connection->server); - EnterCriticalSection(&assoc->cs); - if (!assoc->assoc_group_id) assoc->assoc_group_id = Connection->assoc_group_id; - list_add_head(&assoc->connection_pool, &Connection->conn_pool_entry); - LeaveCriticalSection(&assoc->cs); -} - - -RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection) -{ - RPC_STATUS err; - - err = RPCRT4_CreateConnection(Connection, OldConnection->server, - rpcrt4_conn_get_name(OldConnection), - OldConnection->NetworkAddr, - OldConnection->Endpoint, NULL, - OldConnection->AuthInfo, OldConnection->QOS); - if (err == RPC_S_OK) - rpcrt4_conn_handoff(OldConnection, *Connection); - return err; -} - -RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection) -{ - TRACE("connection: %p\n", Connection); - - RPCRT4_CloseConnection(Connection); - RPCRT4_strfree(Connection->Endpoint); - RPCRT4_strfree(Connection->NetworkAddr); - HeapFree(GetProcessHeap(), 0, Connection->NetworkOptions); - if (Connection->AuthInfo) RpcAuthInfo_Release(Connection->AuthInfo); - if (Connection->QOS) RpcQualityOfService_Release(Connection->QOS); - HeapFree(GetProcessHeap(), 0, Connection); - return RPC_S_OK; -} - -RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, - size_t *tower_size, - const char *protseq, - const char *networkaddr, - const char *endpoint) -{ - twr_empty_floor_t *protocol_floor; - const struct connection_ops *protseq_ops = rpcrt4_get_conn_protseq_ops(protseq); - - *tower_size = 0; - - if (!protseq_ops) - return RPC_S_INVALID_RPC_PROTSEQ; - - if (!tower_data) - { - *tower_size = sizeof(*protocol_floor); - *tower_size += protseq_ops->get_top_of_tower(NULL, networkaddr, endpoint); - return RPC_S_OK; - } - - protocol_floor = (twr_empty_floor_t *)tower_data; - protocol_floor->count_lhs = sizeof(protocol_floor->protid); - protocol_floor->protid = protseq_ops->epm_protocols[0]; - protocol_floor->count_rhs = 0; - - tower_data += sizeof(*protocol_floor); - - *tower_size = protseq_ops->get_top_of_tower(tower_data, networkaddr, endpoint); - if (!*tower_size) - return EPT_S_NOT_REGISTERED; - - *tower_size += sizeof(*protocol_floor); - - return RPC_S_OK; -} - -RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, - size_t tower_size, - char **protseq, - char **networkaddr, - char **endpoint) -{ - const twr_empty_floor_t *protocol_floor; - const twr_empty_floor_t *floor4; - const struct connection_ops *protseq_ops = NULL; - RPC_STATUS status; - int i; - - if (tower_size < sizeof(*protocol_floor)) - return EPT_S_NOT_REGISTERED; - - protocol_floor = (const twr_empty_floor_t *)tower_data; - tower_data += sizeof(*protocol_floor); - tower_size -= sizeof(*protocol_floor); - if ((protocol_floor->count_lhs != sizeof(protocol_floor->protid)) || - (protocol_floor->count_rhs > tower_size)) - return EPT_S_NOT_REGISTERED; - tower_data += protocol_floor->count_rhs; - tower_size -= protocol_floor->count_rhs; - - floor4 = (const twr_empty_floor_t *)tower_data; - if ((tower_size < sizeof(*floor4)) || - (floor4->count_lhs != sizeof(floor4->protid))) - return EPT_S_NOT_REGISTERED; - - for(i = 0; i < ARRAYSIZE(conn_protseq_list); i++) - if ((protocol_floor->protid == conn_protseq_list[i].epm_protocols[0]) && - (floor4->protid == conn_protseq_list[i].epm_protocols[1])) - { - protseq_ops = &conn_protseq_list[i]; - break; - } - - if (!protseq_ops) - return EPT_S_NOT_REGISTERED; - - status = protseq_ops->parse_top_of_tower(tower_data, tower_size, networkaddr, endpoint); - - if ((status == RPC_S_OK) && protseq) - { - *protseq = I_RpcAllocate(strlen(protseq_ops->name) + 1); - strcpy(*protseq, protseq_ops->name); - } - - return status; -} - -/*********************************************************************** - * RpcNetworkIsProtseqValidW (RPCRT4.@) - * - * Checks if the given protocol sequence is known by the RPC system. - * If it is, returns RPC_S_OK, otherwise RPC_S_PROTSEQ_NOT_SUPPORTED. - * - */ -RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(RPC_WSTR protseq) -{ - char ps[0x10]; - - WideCharToMultiByte(CP_ACP, 0, protseq, -1, - ps, sizeof ps, NULL, NULL); - if (rpcrt4_get_conn_protseq_ops(ps)) - return RPC_S_OK; - - FIXME("Unknown protseq %s\n", debugstr_w(protseq)); - - return RPC_S_INVALID_RPC_PROTSEQ; -} - -/*********************************************************************** - * RpcNetworkIsProtseqValidA (RPCRT4.@) - */ -RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(RPC_CSTR protseq) -{ - UNICODE_STRING protseqW; - - if (RtlCreateUnicodeStringFromAsciiz(&protseqW, (char*)protseq)) - { - RPC_STATUS ret = RpcNetworkIsProtseqValidW(protseqW.Buffer); - RtlFreeUnicodeString(&protseqW); - return ret; - } - return RPC_S_OUT_OF_MEMORY; -} +/* + * RPC transport layer + * + * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2003 Mike Hearn + * Copyright 2004 Filip Navara + * Copyright 2006 Mike McCormack + * Copyright 2006 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif +#include +#include +#include +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_NETINET_TCP_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_SYS_POLL_H +#include +#endif + +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "winerror.h" +#include "winternl.h" +#include "wine/unicode.h" + +#include "rpc.h" +#include "rpcndr.h" + +#include "wine/debug.h" + +#include "rpc_binding.h" +#include "rpc_message.h" +#include "rpc_server.h" +#include "epm_towers.h" + +#include "unix_func.h" + +#ifndef SOL_TCP +# define SOL_TCP IPPROTO_TCP +#endif + +WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +static CRITICAL_SECTION assoc_list_cs; +static CRITICAL_SECTION_DEBUG assoc_list_cs_debug = +{ + 0, 0, &assoc_list_cs, + { &assoc_list_cs_debug.ProcessLocksList, &assoc_list_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": assoc_list_cs") } +}; +static CRITICAL_SECTION assoc_list_cs = { &assoc_list_cs_debug, -1, 0, 0, 0, 0 }; + +static struct list assoc_list = LIST_INIT(assoc_list); + +/**** ncacn_np support ****/ + +typedef struct _RpcConnection_np +{ + RpcConnection common; + HANDLE pipe; + OVERLAPPED ovl; + BOOL listening; +} RpcConnection_np; + +static RpcConnection *rpcrt4_conn_np_alloc(void) +{ + RpcConnection_np *npc = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcConnection_np)); + if (npc) + { + npc->pipe = NULL; + memset(&npc->ovl, 0, sizeof(npc->ovl)); + npc->listening = FALSE; + } + return &npc->common; +} + +static RPC_STATUS rpcrt4_conn_listen_pipe(RpcConnection_np *npc) +{ + if (npc->listening) + return RPC_S_OK; + + npc->listening = TRUE; + if (ConnectNamedPipe(npc->pipe, &npc->ovl)) + return RPC_S_OK; + + if (GetLastError() == ERROR_PIPE_CONNECTED) { + SetEvent(npc->ovl.hEvent); + return RPC_S_OK; + } + if (GetLastError() == ERROR_IO_PENDING) { + /* will be completed in rpcrt4_protseq_np_wait_for_new_connection */ + return RPC_S_OK; + } + npc->listening = FALSE; + WARN("Couldn't ConnectNamedPipe (error was %d)\n", GetLastError()); + return RPC_S_OUT_OF_RESOURCES; +} + +static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *Connection, LPCSTR pname) +{ + RpcConnection_np *npc = (RpcConnection_np *) Connection; + TRACE("listening on %s\n", pname); + + npc->pipe = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, + PIPE_UNLIMITED_INSTANCES, + RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); + if (npc->pipe == INVALID_HANDLE_VALUE) { + WARN("CreateNamedPipe failed with error %d\n", GetLastError()); + if (GetLastError() == ERROR_FILE_EXISTS) + return RPC_S_DUPLICATE_ENDPOINT; + else + return RPC_S_CANT_CREATE_ENDPOINT; + } + + memset(&npc->ovl, 0, sizeof(npc->ovl)); + npc->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + + /* Note: we don't call ConnectNamedPipe here because it must be done in the + * server thread as the thread must be alertable */ + return RPC_S_OK; +} + +static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname, BOOL wait) +{ + RpcConnection_np *npc = (RpcConnection_np *) Connection; + HANDLE pipe; + DWORD err, dwMode; + + TRACE("connecting to %s\n", pname); + + while (TRUE) { + DWORD dwFlags = 0; + if (Connection->QOS) + { + dwFlags = SECURITY_SQOS_PRESENT; + switch (Connection->QOS->qos->ImpersonationType) + { + case RPC_C_IMP_LEVEL_DEFAULT: + /* FIXME: what to do here? */ + break; + case RPC_C_IMP_LEVEL_ANONYMOUS: + dwFlags |= SECURITY_ANONYMOUS; + break; + case RPC_C_IMP_LEVEL_IDENTIFY: + dwFlags |= SECURITY_IDENTIFICATION; + break; + case RPC_C_IMP_LEVEL_IMPERSONATE: + dwFlags |= SECURITY_IMPERSONATION; + break; + case RPC_C_IMP_LEVEL_DELEGATE: + dwFlags |= SECURITY_DELEGATION; + break; + } + if (Connection->QOS->qos->IdentityTracking == RPC_C_QOS_IDENTIFY_DYNAMIC) + dwFlags |= SECURITY_CONTEXT_TRACKING; + } + pipe = CreateFileA(pname, GENERIC_READ|GENERIC_WRITE, 0, NULL, + OPEN_EXISTING, dwFlags, 0); + if (pipe != INVALID_HANDLE_VALUE) break; + err = GetLastError(); + if (err == ERROR_PIPE_BUSY) { + TRACE("connection failed, error=%x\n", err); + return RPC_S_SERVER_TOO_BUSY; + } + if (!wait) + return RPC_S_SERVER_UNAVAILABLE; + if (!WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) { + err = GetLastError(); + WARN("connection failed, error=%x\n", err); + return RPC_S_SERVER_UNAVAILABLE; + } + } + + /* success */ + memset(&npc->ovl, 0, sizeof(npc->ovl)); + /* pipe is connected; change to message-read mode. */ + dwMode = PIPE_READMODE_MESSAGE; + SetNamedPipeHandleState(pipe, &dwMode, NULL, NULL); + npc->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + npc->pipe = pipe; + + return RPC_S_OK; +} + +static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) +{ + RpcConnection_np *npc = (RpcConnection_np *) Connection; + static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + RPC_STATUS r; + LPSTR pname; + + /* already connected? */ + if (npc->pipe) + return RPC_S_OK; + + /* protseq=ncalrpc: supposed to use NT LPC ports, + * but we'll implement it with named pipes for now */ + pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); + strcat(strcpy(pname, prefix), Connection->Endpoint); + r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); + I_RpcFree(pname); + + return r; +} + +static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, LPSTR endpoint) +{ + static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + RPC_STATUS r; + LPSTR pname; + RpcConnection *Connection; + + r = RPCRT4_CreateConnection(&Connection, TRUE, protseq->Protseq, NULL, + endpoint, NULL, NULL, NULL); + if (r != RPC_S_OK) + return r; + + /* protseq=ncalrpc: supposed to use NT LPC ports, + * but we'll implement it with named pipes for now */ + pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); + strcat(strcpy(pname, prefix), Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection, pname); + I_RpcFree(pname); + + EnterCriticalSection(&protseq->cs); + Connection->Next = protseq->conn; + protseq->conn = Connection; + LeaveCriticalSection(&protseq->cs); + + return r; +} + +static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) +{ + RpcConnection_np *npc = (RpcConnection_np *) Connection; + static const char prefix[] = "\\\\."; + RPC_STATUS r; + LPSTR pname; + + /* already connected? */ + if (npc->pipe) + return RPC_S_OK; + + /* protseq=ncacn_np: named pipes */ + pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); + strcat(strcpy(pname, prefix), Connection->Endpoint); + r = rpcrt4_conn_open_pipe(Connection, pname, FALSE); + I_RpcFree(pname); + + return r; +} + +static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, LPSTR endpoint) +{ + static const char prefix[] = "\\\\."; + RPC_STATUS r; + LPSTR pname; + RpcConnection *Connection; + + r = RPCRT4_CreateConnection(&Connection, TRUE, protseq->Protseq, NULL, + endpoint, NULL, NULL, NULL); + if (r != RPC_S_OK) + return r; + + /* protseq=ncacn_np: named pipes */ + pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); + strcat(strcpy(pname, prefix), Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection, pname); + I_RpcFree(pname); + + EnterCriticalSection(&protseq->cs); + Connection->Next = protseq->conn; + protseq->conn = Connection; + LeaveCriticalSection(&protseq->cs); + + return r; +} + +static void rpcrt4_conn_np_handoff(RpcConnection_np *old_npc, RpcConnection_np *new_npc) +{ + /* because of the way named pipes work, we'll transfer the connected pipe + * to the child, then reopen the server binding to continue listening */ + + new_npc->pipe = old_npc->pipe; + new_npc->ovl = old_npc->ovl; + old_npc->pipe = 0; + memset(&old_npc->ovl, 0, sizeof(old_npc->ovl)); + old_npc->listening = FALSE; +} + +static RPC_STATUS rpcrt4_ncacn_np_handoff(RpcConnection *old_conn, RpcConnection *new_conn) +{ + RPC_STATUS status; + LPSTR pname; + static const char prefix[] = "\\\\."; + + rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); + + pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); + strcat(strcpy(pname, prefix), old_conn->Endpoint); + status = rpcrt4_conn_create_pipe(old_conn, pname); + I_RpcFree(pname); + + return status; +} + +static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection *new_conn) +{ + RPC_STATUS status; + LPSTR pname; + static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + + TRACE("%s\n", old_conn->Endpoint); + + rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); + + pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); + strcat(strcpy(pname, prefix), old_conn->Endpoint); + status = rpcrt4_conn_create_pipe(old_conn, pname); + I_RpcFree(pname); + + return status; +} + +static int rpcrt4_conn_np_read(RpcConnection *Connection, + void *buffer, unsigned int count) +{ + RpcConnection_np *npc = (RpcConnection_np *) Connection; + char *buf = buffer; + BOOL ret = TRUE; + unsigned int bytes_left = count; + + while (bytes_left) + { + DWORD bytes_read; + ret = ReadFile(npc->pipe, buf, bytes_left, &bytes_read, NULL); + if (!ret || !bytes_read) + break; + bytes_left -= bytes_read; + buf += bytes_read; + } + return ret ? count : -1; +} + +static int rpcrt4_conn_np_write(RpcConnection *Connection, + const void *buffer, unsigned int count) +{ + RpcConnection_np *npc = (RpcConnection_np *) Connection; + const char *buf = buffer; + BOOL ret = TRUE; + unsigned int bytes_left = count; + + while (bytes_left) + { + DWORD bytes_written; + ret = WriteFile(npc->pipe, buf, count, &bytes_written, NULL); + if (!ret || !bytes_written) + break; + bytes_left -= bytes_written; + buf += bytes_written; + } + return ret ? count : -1; +} + +static int rpcrt4_conn_np_close(RpcConnection *Connection) +{ + RpcConnection_np *npc = (RpcConnection_np *) Connection; + if (npc->pipe) { + FlushFileBuffers(npc->pipe); + CloseHandle(npc->pipe); + npc->pipe = 0; + } + if (npc->ovl.hEvent) { + CloseHandle(npc->ovl.hEvent); + npc->ovl.hEvent = 0; + } + return 0; +} + +static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data, + const char *networkaddr, + const char *endpoint) +{ + twr_empty_floor_t *smb_floor; + twr_empty_floor_t *nb_floor; + size_t size; + size_t networkaddr_size; + size_t endpoint_size; + + TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint); + + networkaddr_size = strlen(networkaddr) + 1; + endpoint_size = strlen(endpoint) + 1; + size = sizeof(*smb_floor) + endpoint_size + sizeof(*nb_floor) + networkaddr_size; + + if (!tower_data) + return size; + + smb_floor = (twr_empty_floor_t *)tower_data; + + tower_data += sizeof(*smb_floor); + + smb_floor->count_lhs = sizeof(smb_floor->protid); + smb_floor->protid = EPM_PROTOCOL_SMB; + smb_floor->count_rhs = endpoint_size; + + memcpy(tower_data, endpoint, endpoint_size); + tower_data += endpoint_size; + + nb_floor = (twr_empty_floor_t *)tower_data; + + tower_data += sizeof(*nb_floor); + + nb_floor->count_lhs = sizeof(nb_floor->protid); + nb_floor->protid = EPM_PROTOCOL_NETBIOS; + nb_floor->count_rhs = networkaddr_size; + + memcpy(tower_data, networkaddr, networkaddr_size); + tower_data += networkaddr_size; + + return size; +} + +static RPC_STATUS rpcrt4_ncacn_np_parse_top_of_tower(const unsigned char *tower_data, + size_t tower_size, + char **networkaddr, + char **endpoint) +{ + const twr_empty_floor_t *smb_floor = (const twr_empty_floor_t *)tower_data; + const twr_empty_floor_t *nb_floor; + + TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint); + + if (tower_size < sizeof(*smb_floor)) + return EPT_S_NOT_REGISTERED; + + tower_data += sizeof(*smb_floor); + tower_size -= sizeof(*smb_floor); + + if ((smb_floor->count_lhs != sizeof(smb_floor->protid)) || + (smb_floor->protid != EPM_PROTOCOL_SMB) || + (smb_floor->count_rhs > tower_size)) + return EPT_S_NOT_REGISTERED; + + if (endpoint) + { + *endpoint = I_RpcAllocate(smb_floor->count_rhs); + if (!*endpoint) + return RPC_S_OUT_OF_RESOURCES; + memcpy(*endpoint, tower_data, smb_floor->count_rhs); + } + tower_data += smb_floor->count_rhs; + tower_size -= smb_floor->count_rhs; + + if (tower_size < sizeof(*nb_floor)) + return EPT_S_NOT_REGISTERED; + + nb_floor = (const twr_empty_floor_t *)tower_data; + + tower_data += sizeof(*nb_floor); + tower_size -= sizeof(*nb_floor); + + if ((nb_floor->count_lhs != sizeof(nb_floor->protid)) || + (nb_floor->protid != EPM_PROTOCOL_NETBIOS) || + (nb_floor->count_rhs > tower_size)) + return EPT_S_NOT_REGISTERED; + + if (networkaddr) + { + *networkaddr = I_RpcAllocate(nb_floor->count_rhs); + if (!*networkaddr) + { + if (endpoint) + { + I_RpcFree(*endpoint); + *endpoint = NULL; + } + return RPC_S_OUT_OF_RESOURCES; + } + memcpy(*networkaddr, tower_data, nb_floor->count_rhs); + } + + return RPC_S_OK; +} + +typedef struct _RpcServerProtseq_np +{ + RpcServerProtseq common; + HANDLE mgr_event; +} RpcServerProtseq_np; + +static RpcServerProtseq *rpcrt4_protseq_np_alloc(void) +{ + RpcServerProtseq_np *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps)); + if (ps) + ps->mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL); + return &ps->common; +} + +static void rpcrt4_protseq_np_signal_state_changed(RpcServerProtseq *protseq) +{ + RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); + SetEvent(npps->mgr_event); +} + +static void *rpcrt4_protseq_np_get_wait_array(RpcServerProtseq *protseq, void *prev_array, unsigned int *count) +{ + HANDLE *objs = prev_array; + RpcConnection_np *conn; + RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); + + EnterCriticalSection(&protseq->cs); + + /* open and count connections */ + *count = 1; + conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); + while (conn) { + rpcrt4_conn_listen_pipe(conn); + if (conn->ovl.hEvent) + (*count)++; + conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); + } + + /* make array of connections */ + if (objs) + objs = HeapReAlloc(GetProcessHeap(), 0, objs, *count*sizeof(HANDLE)); + else + objs = HeapAlloc(GetProcessHeap(), 0, *count*sizeof(HANDLE)); + if (!objs) + { + ERR("couldn't allocate objs\n"); + LeaveCriticalSection(&protseq->cs); + return NULL; + } + + objs[0] = npps->mgr_event; + *count = 1; + conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); + while (conn) { + if ((objs[*count] = conn->ovl.hEvent)) + (*count)++; + conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); + } + LeaveCriticalSection(&protseq->cs); + return objs; +} + +static void rpcrt4_protseq_np_free_wait_array(RpcServerProtseq *protseq, void *array) +{ + HeapFree(GetProcessHeap(), 0, array); +} + +static int rpcrt4_protseq_np_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array) +{ + HANDLE b_handle; + HANDLE *objs = wait_array; + DWORD res; + RpcConnection *cconn; + RpcConnection_np *conn; + + if (!objs) + return -1; + + res = WaitForMultipleObjects(count, objs, FALSE, INFINITE); + if (res == WAIT_OBJECT_0) + return 0; + else if (res == WAIT_FAILED) + { + ERR("wait failed with error %d\n", GetLastError()); + return -1; + } + else + { + b_handle = objs[res - WAIT_OBJECT_0]; + /* find which connection got a RPC */ + EnterCriticalSection(&protseq->cs); + conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); + while (conn) { + if (b_handle == conn->ovl.hEvent) break; + conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); + } + cconn = NULL; + if (conn) + RPCRT4_SpawnConnection(&cconn, &conn->common); + else + ERR("failed to locate connection for handle %p\n", b_handle); + LeaveCriticalSection(&protseq->cs); + if (cconn) + { + RPCRT4_new_client(cconn); + return 1; + } + else return -1; + } +} + +static size_t rpcrt4_ncalrpc_get_top_of_tower(unsigned char *tower_data, + const char *networkaddr, + const char *endpoint) +{ + twr_empty_floor_t *pipe_floor; + size_t size; + size_t endpoint_size; + + TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint); + + endpoint_size = strlen(networkaddr) + 1; + size = sizeof(*pipe_floor) + endpoint_size; + + if (!tower_data) + return size; + + pipe_floor = (twr_empty_floor_t *)tower_data; + + tower_data += sizeof(*pipe_floor); + + pipe_floor->count_lhs = sizeof(pipe_floor->protid); + pipe_floor->protid = EPM_PROTOCOL_SMB; + pipe_floor->count_rhs = endpoint_size; + + memcpy(tower_data, endpoint, endpoint_size); + tower_data += endpoint_size; + + return size; +} + +static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_data, + size_t tower_size, + char **networkaddr, + char **endpoint) +{ + const twr_empty_floor_t *pipe_floor = (const twr_empty_floor_t *)tower_data; + + TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint); + + *networkaddr = NULL; + *endpoint = NULL; + + if (tower_size < sizeof(*pipe_floor)) + return EPT_S_NOT_REGISTERED; + + tower_data += sizeof(*pipe_floor); + tower_size -= sizeof(*pipe_floor); + + if ((pipe_floor->count_lhs != sizeof(pipe_floor->protid)) || + (pipe_floor->protid != EPM_PROTOCOL_SMB) || + (pipe_floor->count_rhs > tower_size)) + return EPT_S_NOT_REGISTERED; + + if (endpoint) + { + *endpoint = I_RpcAllocate(pipe_floor->count_rhs); + if (!*endpoint) + return RPC_S_OUT_OF_RESOURCES; + memcpy(*endpoint, tower_data, pipe_floor->count_rhs); + } + + return RPC_S_OK; +} + +/**** ncacn_ip_tcp support ****/ + +typedef struct _RpcConnection_tcp +{ + RpcConnection common; + int sock; +} RpcConnection_tcp; + +static RpcConnection *rpcrt4_conn_tcp_alloc(void) +{ + RpcConnection_tcp *tcpc; + tcpc = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcConnection_tcp)); + if (tcpc == NULL) + return NULL; + tcpc->sock = -1; + return &tcpc->common; +} + +static RPC_STATUS rpcrt4_ncacn_ip_tcp_open(RpcConnection* Connection) +{ + RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; + int sock; + int ret; + struct addrinfo *ai; + struct addrinfo *ai_cur; + struct addrinfo hints; + + TRACE("(%s, %s)\n", Connection->NetworkAddr, Connection->Endpoint); + + if (tcpc->sock != -1) + return RPC_S_OK; + + hints.ai_flags = 0; + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + hints.ai_addrlen = 0; + hints.ai_addr = NULL; + hints.ai_canonname = NULL; + hints.ai_next = NULL; + + ret = getaddrinfo(Connection->NetworkAddr, Connection->Endpoint, &hints, &ai); + if (ret) + { + ERR("getaddrinfo for %s:%s failed: %s\n", Connection->NetworkAddr, + Connection->Endpoint, gai_strerror(ret)); + return RPC_S_SERVER_UNAVAILABLE; + } + + for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next) + { + int val; + + if (TRACE_ON(rpc)) + { + char host[256]; + char service[256]; + getnameinfo(ai_cur->ai_addr, ai_cur->ai_addrlen, + host, sizeof(host), service, sizeof(service), + NI_NUMERICHOST | NI_NUMERICSERV); + TRACE("trying %s:%s\n", host, service); + } + + sock = socket(ai_cur->ai_family, ai_cur->ai_socktype, ai_cur->ai_protocol); + if (sock < 0) + { + WARN("socket() failed: %s\n", strerror(errno)); + continue; + } + + if (0>connect(sock, ai_cur->ai_addr, ai_cur->ai_addrlen)) + { + WARN("connect() failed: %s\n", strerror(errno)); + close(sock); + continue; + } + + /* RPC depends on having minimal latency so disable the Nagle algorithm */ + val = 1; + setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&val, sizeof(val)); + + tcpc->sock = sock; + + freeaddrinfo(ai); + TRACE("connected\n"); + return RPC_S_OK; + } + + freeaddrinfo(ai); + ERR("couldn't connect to %s:%s\n", Connection->NetworkAddr, Connection->Endpoint); + return RPC_S_SERVER_UNAVAILABLE; +} + +static RPC_STATUS rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(RpcServerProtseq *protseq, LPSTR endpoint) +{ + RPC_STATUS status = RPC_S_CANT_CREATE_ENDPOINT; + int sock; + int ret; + struct addrinfo *ai; + struct addrinfo *ai_cur; + struct addrinfo hints; + RpcConnection *first_connection = NULL; + u_long blocking; + + TRACE("(%p, %s)\n", protseq, endpoint); + + hints.ai_flags = AI_PASSIVE /* for non-localhost addresses */; + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + hints.ai_addrlen = 0; + hints.ai_addr = NULL; + hints.ai_canonname = NULL; + hints.ai_next = NULL; + + ret = getaddrinfo(NULL, endpoint, &hints, &ai); + if (ret) + { + ERR("getaddrinfo for port %s failed: %s\n", endpoint, + gai_strerror(ret)); + if ((ret == EAI_SERVICE) || (ret == EAI_NONAME)) + return RPC_S_INVALID_ENDPOINT_FORMAT; + return RPC_S_CANT_CREATE_ENDPOINT; + } + + for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next) + { + RpcConnection_tcp *tcpc; + RPC_STATUS create_status; + + if (TRACE_ON(rpc)) + { + char host[256]; + char service[256]; + getnameinfo(ai_cur->ai_addr, ai_cur->ai_addrlen, + host, sizeof(host), service, sizeof(service), + NI_NUMERICHOST | NI_NUMERICSERV); + TRACE("trying %s:%s\n", host, service); + } + + sock = socket(ai_cur->ai_family, ai_cur->ai_socktype, ai_cur->ai_protocol); + if (sock < 0) + { + WARN("socket() failed: %s\n", strerror(errno)); + status = RPC_S_CANT_CREATE_ENDPOINT; + continue; + } + + ret = bind(sock, ai_cur->ai_addr, ai_cur->ai_addrlen); + if (ret < 0) + { + WARN("bind failed: %s\n", strerror(errno)); + close(sock); + if (errno == WSAEADDRINUSE) + status = RPC_S_DUPLICATE_ENDPOINT; + else + status = RPC_S_CANT_CREATE_ENDPOINT; + continue; + } + create_status = RPCRT4_CreateConnection((RpcConnection **)&tcpc, TRUE, + protseq->Protseq, NULL, + endpoint, NULL, NULL, NULL); + if (create_status != RPC_S_OK) + { + close(sock); + status = create_status; + continue; + } + + tcpc->sock = sock; + ret = listen(sock, protseq->MaxCalls); + if (ret < 0) + { + WARN("listen failed: %s\n", strerror(errno)); + RPCRT4_DestroyConnection(&tcpc->common); + status = RPC_S_OUT_OF_RESOURCES; + continue; + } + /* need a non-blocking socket, otherwise accept() has a potential + * race-condition (poll() says it is readable, connection drops, + * and accept() blocks until the next connection comes...) + */ + blocking = 1; + ret = ioctlsocket(sock, FIONBIO, &blocking); + if (ret < 0) + { + WARN("couldn't make socket non-blocking, error %d\n", ret); + RPCRT4_DestroyConnection(&tcpc->common); + status = RPC_S_OUT_OF_RESOURCES; + continue; + } + + tcpc->common.Next = first_connection; + first_connection = &tcpc->common; + } + + freeaddrinfo(ai); + + /* if at least one connection was created for an endpoint then + * return success */ + if (first_connection) + { + RpcConnection *conn; + + /* find last element in list */ + for (conn = first_connection; conn->Next; conn = conn->Next) + ; + + EnterCriticalSection(&protseq->cs); + conn->Next = protseq->conn; + protseq->conn = first_connection; + LeaveCriticalSection(&protseq->cs); + + TRACE("listening on %s\n", endpoint); + return RPC_S_OK; + } + + ERR("couldn't listen on port %s\n", endpoint); + return status; +} + +static RPC_STATUS rpcrt4_conn_tcp_handoff(RpcConnection *old_conn, RpcConnection *new_conn) +{ + int ret; + struct sockaddr_in address; + socklen_t addrsize; + u_long blocking; + RpcConnection_tcp *server = (RpcConnection_tcp*) old_conn; + RpcConnection_tcp *client = (RpcConnection_tcp*) new_conn; + + addrsize = sizeof(address); + ret = accept(server->sock, (struct sockaddr*) &address, &addrsize); + if (ret < 0) + { + ERR("Failed to accept a TCP connection: error %d\n", ret); + return RPC_S_OUT_OF_RESOURCES; + } + /* reset to blocking behaviour */ + blocking = 0; + ret = ioctlsocket(ret, FIONBIO, &blocking); + client->sock = ret; + TRACE("Accepted a new TCP connection\n"); + return RPC_S_OK; +} + +static int rpcrt4_conn_tcp_read(RpcConnection *Connection, + void *buffer, unsigned int count) +{ + RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; + int r = recv(tcpc->sock, buffer, count, MSG_WAITALL); + TRACE("%d %p %u -> %d\n", tcpc->sock, buffer, count, r); + return r; +} + +static int rpcrt4_conn_tcp_write(RpcConnection *Connection, + const void *buffer, unsigned int count) +{ + RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; + int r = write(tcpc->sock, buffer, count); + TRACE("%d %p %u -> %d\n", tcpc->sock, buffer, count, r); + return r; +} + +static int rpcrt4_conn_tcp_close(RpcConnection *Connection) +{ + RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; + + TRACE("%d\n", tcpc->sock); + + if (tcpc->sock != -1) + close(tcpc->sock); + tcpc->sock = -1; + return 0; +} + +static size_t rpcrt4_ncacn_ip_tcp_get_top_of_tower(unsigned char *tower_data, + const char *networkaddr, + const char *endpoint) +{ + twr_tcp_floor_t *tcp_floor; + twr_ipv4_floor_t *ipv4_floor; + struct addrinfo *ai; + struct addrinfo hints; + int ret; + size_t size = sizeof(*tcp_floor) + sizeof(*ipv4_floor); + + TRACE("(%p, %s, %s)\n", tower_data, networkaddr, endpoint); + + if (!tower_data) + return size; + + tcp_floor = (twr_tcp_floor_t *)tower_data; + tower_data += sizeof(*tcp_floor); + + ipv4_floor = (twr_ipv4_floor_t *)tower_data; + + tcp_floor->count_lhs = sizeof(tcp_floor->protid); + tcp_floor->protid = EPM_PROTOCOL_TCP; + tcp_floor->count_rhs = sizeof(tcp_floor->port); + + ipv4_floor->count_lhs = sizeof(ipv4_floor->protid); + ipv4_floor->protid = EPM_PROTOCOL_IP; + ipv4_floor->count_rhs = sizeof(ipv4_floor->ipv4addr); + + hints.ai_flags = AI_NUMERICHOST; + /* FIXME: only support IPv4 at the moment. how is IPv6 represented by the EPM? */ + hints.ai_family = PF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + hints.ai_addrlen = 0; + hints.ai_addr = NULL; + hints.ai_canonname = NULL; + hints.ai_next = NULL; + + ret = getaddrinfo(networkaddr, endpoint, &hints, &ai); + if (ret) + { + ret = getaddrinfo("0.0.0.0", endpoint, &hints, &ai); + if (ret) + { + ERR("getaddrinfo failed: %s\n", gai_strerror(ret)); + return 0; + } + } + + if (ai->ai_family == PF_INET) + { + const struct sockaddr_in *sin = (const struct sockaddr_in *)ai->ai_addr; + tcp_floor->port = sin->sin_port; + ipv4_floor->ipv4addr = sin->sin_addr.s_addr; + } + else + { + ERR("unexpected protocol family %d\n", ai->ai_family); + return 0; + } + + freeaddrinfo(ai); + + return size; +} + +static RPC_STATUS rpcrt4_ncacn_ip_tcp_parse_top_of_tower(const unsigned char *tower_data, + size_t tower_size, + char **networkaddr, + char **endpoint) +{ + const twr_tcp_floor_t *tcp_floor = (const twr_tcp_floor_t *)tower_data; + const twr_ipv4_floor_t *ipv4_floor; + struct in_addr in_addr; + + TRACE("(%p, %d, %p, %p)\n", tower_data, (int)tower_size, networkaddr, endpoint); + + if (tower_size < sizeof(*tcp_floor)) + return EPT_S_NOT_REGISTERED; + + tower_data += sizeof(*tcp_floor); + tower_size -= sizeof(*tcp_floor); + + if (tower_size < sizeof(*ipv4_floor)) + return EPT_S_NOT_REGISTERED; + + ipv4_floor = (const twr_ipv4_floor_t *)tower_data; + + if ((tcp_floor->count_lhs != sizeof(tcp_floor->protid)) || + (tcp_floor->protid != EPM_PROTOCOL_TCP) || + (tcp_floor->count_rhs != sizeof(tcp_floor->port)) || + (ipv4_floor->count_lhs != sizeof(ipv4_floor->protid)) || + (ipv4_floor->protid != EPM_PROTOCOL_IP) || + (ipv4_floor->count_rhs != sizeof(ipv4_floor->ipv4addr))) + return EPT_S_NOT_REGISTERED; + + if (endpoint) + { + *endpoint = I_RpcAllocate(6 /* sizeof("65535") + 1 */); + if (!*endpoint) + return RPC_S_OUT_OF_RESOURCES; + sprintf(*endpoint, "%u", ntohs(tcp_floor->port)); + } + + if (networkaddr) + { + *networkaddr = I_RpcAllocate(INET_ADDRSTRLEN); + if (!*networkaddr) + { + if (endpoint) + { + I_RpcFree(*endpoint); + *endpoint = NULL; + } + return RPC_S_OUT_OF_RESOURCES; + } + in_addr.s_addr = ipv4_floor->ipv4addr; + if (!inet_ntop(AF_INET, &in_addr, *networkaddr, INET_ADDRSTRLEN)) + { + ERR("inet_ntop: %s\n", strerror(errno)); + I_RpcFree(*networkaddr); + *networkaddr = NULL; + if (endpoint) + { + I_RpcFree(*endpoint); + *endpoint = NULL; + } + return EPT_S_NOT_REGISTERED; + } + } + + return RPC_S_OK; +} + +typedef struct _RpcServerProtseq_sock +{ + RpcServerProtseq common; + int mgr_event_rcv; + int mgr_event_snd; +} RpcServerProtseq_sock; + +static RpcServerProtseq *rpcrt4_protseq_sock_alloc(void) +{ + RpcServerProtseq_sock *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps)); + if (ps) + { + int fds[2]; + u_long blocking; + if (!socketpair(PF_UNIX, SOCK_DGRAM, 0, fds)) + { + blocking = 1; + ioctlsocket(fds[0], FIONBIO, &blocking); + ioctlsocket(fds[1], FIONBIO, &blocking); + ps->mgr_event_rcv = fds[0]; + ps->mgr_event_snd = fds[1]; + } + else + { + ERR("socketpair failed with error %s\n", strerror(errno)); + HeapFree(GetProcessHeap(), 0, ps); + return NULL; + } + } + return &ps->common; +} + +static void rpcrt4_protseq_sock_signal_state_changed(RpcServerProtseq *protseq) +{ + RpcServerProtseq_sock *sockps = CONTAINING_RECORD(protseq, RpcServerProtseq_sock, common); + char dummy = 1; + write(sockps->mgr_event_snd, &dummy, sizeof(dummy)); +} + +static void *rpcrt4_protseq_sock_get_wait_array(RpcServerProtseq *protseq, void *prev_array, unsigned int *count) +{ + struct pollfd *poll_info = prev_array; + RpcConnection_tcp *conn; + RpcServerProtseq_sock *sockps = CONTAINING_RECORD(protseq, RpcServerProtseq_sock, common); + + EnterCriticalSection(&protseq->cs); + + /* open and count connections */ + *count = 1; + conn = (RpcConnection_tcp *)protseq->conn; + while (conn) { + if (conn->sock != -1) + (*count)++; + conn = (RpcConnection_tcp *)conn->common.Next; + } + + /* make array of connections */ + if (poll_info) + poll_info = HeapReAlloc(GetProcessHeap(), 0, poll_info, *count*sizeof(*poll_info)); + else + poll_info = HeapAlloc(GetProcessHeap(), 0, *count*sizeof(*poll_info)); + if (!poll_info) + { + ERR("couldn't allocate poll_info\n"); + LeaveCriticalSection(&protseq->cs); + return NULL; + } + + poll_info[0].fd = sockps->mgr_event_rcv; + poll_info[0].events = POLLIN; + *count = 1; + conn = CONTAINING_RECORD(protseq->conn, RpcConnection_tcp, common); + while (conn) { + if (conn->sock != -1) + { + poll_info[*count].fd = conn->sock; + poll_info[*count].events = POLLIN; + (*count)++; + } + conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_tcp, common); + } + LeaveCriticalSection(&protseq->cs); + return poll_info; +} + +static void rpcrt4_protseq_sock_free_wait_array(RpcServerProtseq *protseq, void *array) +{ + HeapFree(GetProcessHeap(), 0, array); +} + +static int rpcrt4_protseq_sock_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array) +{ + struct pollfd *poll_info = wait_array; + int ret, i; + RpcConnection *cconn; + RpcConnection_tcp *conn; + + if (!poll_info) + return -1; + + ret = poll(poll_info, count, -1); + if (ret < 0) + { + ERR("poll failed with error %d\n", ret); + return -1; + } + + for (i = 0; i < count; i++) + if (poll_info[i].revents & POLLIN) + { + /* RPC server event */ + if (i == 0) + { + char dummy; + read(poll_info[0].fd, &dummy, sizeof(dummy)); + return 0; + } + + /* find which connection got a RPC */ + EnterCriticalSection(&protseq->cs); + conn = CONTAINING_RECORD(protseq->conn, RpcConnection_tcp, common); + while (conn) { + if (poll_info[i].fd == conn->sock) break; + conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_tcp, common); + } + cconn = NULL; + if (conn) + RPCRT4_SpawnConnection(&cconn, &conn->common); + else + ERR("failed to locate connection for fd %d\n", poll_info[i].fd); + LeaveCriticalSection(&protseq->cs); + if (cconn) + RPCRT4_new_client(cconn); + else + return -1; + } + + return 1; +} + +static const struct connection_ops conn_protseq_list[] = { + { "ncacn_np", + { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_SMB }, + rpcrt4_conn_np_alloc, + rpcrt4_ncacn_np_open, + rpcrt4_ncacn_np_handoff, + rpcrt4_conn_np_read, + rpcrt4_conn_np_write, + rpcrt4_conn_np_close, + rpcrt4_ncacn_np_get_top_of_tower, + rpcrt4_ncacn_np_parse_top_of_tower, + }, + { "ncalrpc", + { EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_PIPE }, + rpcrt4_conn_np_alloc, + rpcrt4_ncalrpc_open, + rpcrt4_ncalrpc_handoff, + rpcrt4_conn_np_read, + rpcrt4_conn_np_write, + rpcrt4_conn_np_close, + rpcrt4_ncalrpc_get_top_of_tower, + rpcrt4_ncalrpc_parse_top_of_tower, + }, + { "ncacn_ip_tcp", + { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_TCP }, + rpcrt4_conn_tcp_alloc, + rpcrt4_ncacn_ip_tcp_open, + rpcrt4_conn_tcp_handoff, + rpcrt4_conn_tcp_read, + rpcrt4_conn_tcp_write, + rpcrt4_conn_tcp_close, + rpcrt4_ncacn_ip_tcp_get_top_of_tower, + rpcrt4_ncacn_ip_tcp_parse_top_of_tower, + } +}; + + +static const struct protseq_ops protseq_list[] = +{ + { + "ncacn_np", + rpcrt4_protseq_np_alloc, + rpcrt4_protseq_np_signal_state_changed, + rpcrt4_protseq_np_get_wait_array, + rpcrt4_protseq_np_free_wait_array, + rpcrt4_protseq_np_wait_for_new_connection, + rpcrt4_protseq_ncacn_np_open_endpoint, + }, + { + "ncalrpc", + rpcrt4_protseq_np_alloc, + rpcrt4_protseq_np_signal_state_changed, + rpcrt4_protseq_np_get_wait_array, + rpcrt4_protseq_np_free_wait_array, + rpcrt4_protseq_np_wait_for_new_connection, + rpcrt4_protseq_ncalrpc_open_endpoint, + }, + { + "ncacn_ip_tcp", + rpcrt4_protseq_sock_alloc, + rpcrt4_protseq_sock_signal_state_changed, + rpcrt4_protseq_sock_get_wait_array, + rpcrt4_protseq_sock_free_wait_array, + rpcrt4_protseq_sock_wait_for_new_connection, + rpcrt4_protseq_ncacn_ip_tcp_open_endpoint, + }, +}; + +#define ARRAYSIZE(a) (sizeof((a)) / sizeof((a)[0])) + +const struct protseq_ops *rpcrt4_get_protseq_ops(const char *protseq) +{ + int i; + for(i=0; iserver); + return Connection->ops->open_connection_client(Connection); +} + +RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection) +{ + TRACE("(Connection == ^%p)\n", Connection); + if (SecIsValidHandle(&Connection->ctx)) + { + DeleteSecurityContext(&Connection->ctx); + SecInvalidateHandle(&Connection->ctx); + } + rpcrt4_conn_close(Connection); + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, + LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, + LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS) +{ + const struct connection_ops *ops; + RpcConnection* NewConnection; + + ops = rpcrt4_get_conn_protseq_ops(Protseq); + if (!ops) + { + FIXME("not supported for protseq %s\n", Protseq); + return RPC_S_PROTSEQ_NOT_SUPPORTED; + } + + NewConnection = ops->alloc(); + NewConnection->Next = NULL; + NewConnection->server = server; + NewConnection->ops = ops; + NewConnection->NetworkAddr = RPCRT4_strdupA(NetworkAddr); + NewConnection->Endpoint = RPCRT4_strdupA(Endpoint); + NewConnection->NetworkOptions = RPCRT4_strdupW(NetworkOptions); + NewConnection->MaxTransmissionSize = RPC_MAX_PACKET_SIZE; + memset(&NewConnection->ActiveInterface, 0, sizeof(NewConnection->ActiveInterface)); + NewConnection->NextCallId = 1; + + SecInvalidateHandle(&NewConnection->ctx); + memset(&NewConnection->exp, 0, sizeof(NewConnection->exp)); + NewConnection->attr = 0; + if (AuthInfo) RpcAuthInfo_AddRef(AuthInfo); + NewConnection->AuthInfo = AuthInfo; + NewConnection->encryption_auth_len = 0; + NewConnection->signature_auth_len = 0; + if (QOS) RpcQualityOfService_AddRef(QOS); + NewConnection->QOS = QOS; + + list_init(&NewConnection->conn_pool_entry); + + TRACE("connection: %p\n", NewConnection); + *Connection = NewConnection; + + return RPC_S_OK; +} + +RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, + LPCSTR Endpoint, LPCWSTR NetworkOptions, + RpcAssoc **assoc_out) +{ + RpcAssoc *assoc; + + EnterCriticalSection(&assoc_list_cs); + LIST_FOR_EACH_ENTRY(assoc, &assoc_list, RpcAssoc, entry) + { + if (!strcmp(Protseq, assoc->Protseq) && + !strcmp(NetworkAddr, assoc->NetworkAddr) && + !strcmp(Endpoint, assoc->Endpoint) && + ((!assoc->NetworkOptions && !NetworkOptions) || !strcmpW(NetworkOptions, assoc->NetworkOptions))) + { + assoc->refs++; + *assoc_out = assoc; + LeaveCriticalSection(&assoc_list_cs); + TRACE("using existing assoc %p\n", assoc); + return RPC_S_OK; + } + } + + assoc = HeapAlloc(GetProcessHeap(), 0, sizeof(*assoc)); + if (!assoc) + { + LeaveCriticalSection(&assoc_list_cs); + return RPC_S_OUT_OF_RESOURCES; + } + assoc->refs = 1; + list_init(&assoc->connection_pool); + InitializeCriticalSection(&assoc->cs); + assoc->Protseq = RPCRT4_strdupA(Protseq); + assoc->NetworkAddr = RPCRT4_strdupA(NetworkAddr); + assoc->Endpoint = RPCRT4_strdupA(Endpoint); + assoc->NetworkOptions = NetworkOptions ? RPCRT4_strdupW(NetworkOptions) : NULL; + assoc->assoc_group_id = 0; + list_add_head(&assoc_list, &assoc->entry); + *assoc_out = assoc; + + LeaveCriticalSection(&assoc_list_cs); + + TRACE("new assoc %p\n", assoc); + + return RPC_S_OK; +} + +ULONG RpcAssoc_Release(RpcAssoc *assoc) +{ + ULONG refs; + + EnterCriticalSection(&assoc_list_cs); + refs = --assoc->refs; + if (!refs) + list_remove(&assoc->entry); + LeaveCriticalSection(&assoc_list_cs); + + if (!refs) + { + RpcConnection *Connection, *cursor2; + + TRACE("destroying assoc %p\n", assoc); + + LIST_FOR_EACH_ENTRY_SAFE(Connection, cursor2, &assoc->connection_pool, RpcConnection, conn_pool_entry) + { + list_remove(&Connection->conn_pool_entry); + RPCRT4_DestroyConnection(Connection); + } + + HeapFree(GetProcessHeap(), 0, assoc->NetworkOptions); + HeapFree(GetProcessHeap(), 0, assoc->Endpoint); + HeapFree(GetProcessHeap(), 0, assoc->NetworkAddr); + HeapFree(GetProcessHeap(), 0, assoc->Protseq); + + HeapFree(GetProcessHeap(), 0, assoc); + } + + return refs; +} + +#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1)) + +static RPC_STATUS RpcAssoc_BindConnection(const RpcAssoc *assoc, RpcConnection *conn, + const RPC_SYNTAX_IDENTIFIER *InterfaceId, + const RPC_SYNTAX_IDENTIFIER *TransferSyntax) +{ + RpcPktHdr *hdr; + RpcPktHdr *response_hdr; + RPC_MESSAGE msg; + RPC_STATUS status; + + TRACE("sending bind request to server\n"); + + hdr = RPCRT4_BuildBindHeader(NDR_LOCAL_DATA_REPRESENTATION, + RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, + assoc->assoc_group_id, + InterfaceId, TransferSyntax); + + status = RPCRT4_Send(conn, hdr, NULL, 0); + RPCRT4_FreeHeader(hdr); + if (status != RPC_S_OK) + return status; + + status = RPCRT4_Receive(conn, &response_hdr, &msg); + if (status != RPC_S_OK) + { + ERR("receive failed\n"); + return status; + } + + switch (response_hdr->common.ptype) + { + case PKT_BIND_ACK: + { + RpcAddressString *server_address = msg.Buffer; + if ((msg.BufferLength >= FIELD_OFFSET(RpcAddressString, string[0])) || + (msg.BufferLength >= ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4))) + { + unsigned short remaining = msg.BufferLength - + ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4); + RpcResults *results = (RpcResults*)((ULONG_PTR)server_address + + ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4)); + if ((results->num_results == 1) && (remaining >= sizeof(*results))) + { + switch (results->results[0].result) + { + case RESULT_ACCEPT: + conn->assoc_group_id = response_hdr->bind_ack.assoc_gid; + conn->MaxTransmissionSize = response_hdr->bind_ack.max_tsize; + conn->ActiveInterface = *InterfaceId; + break; + case RESULT_PROVIDER_REJECTION: + switch (results->results[0].reason) + { + case REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED: + ERR("syntax %s, %d.%d not supported\n", + debugstr_guid(&InterfaceId->SyntaxGUID), + InterfaceId->SyntaxVersion.MajorVersion, + InterfaceId->SyntaxVersion.MinorVersion); + status = RPC_S_UNKNOWN_IF; + break; + case REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED: + ERR("transfer syntax not supported\n"); + status = RPC_S_SERVER_UNAVAILABLE; + break; + case REASON_NONE: + default: + status = RPC_S_CALL_FAILED_DNE; + } + break; + case RESULT_USER_REJECTION: + default: + ERR("rejection result %d\n", results->results[0].result); + status = RPC_S_CALL_FAILED_DNE; + } + } + else + { + ERR("incorrect results size\n"); + status = RPC_S_CALL_FAILED_DNE; + } + } + else + { + ERR("bind ack packet too small (%d)\n", msg.BufferLength); + status = RPC_S_PROTOCOL_ERROR; + } + break; + } + case PKT_BIND_NACK: + switch (response_hdr->bind_nack.reject_reason) + { + case REJECT_LOCAL_LIMIT_EXCEEDED: + case REJECT_TEMPORARY_CONGESTION: + ERR("server too busy\n"); + status = RPC_S_SERVER_TOO_BUSY; + break; + case REJECT_PROTOCOL_VERSION_NOT_SUPPORTED: + ERR("protocol version not supported\n"); + status = RPC_S_PROTOCOL_ERROR; + break; + case REJECT_UNKNOWN_AUTHN_SERVICE: + ERR("unknown authentication service\n"); + status = RPC_S_UNKNOWN_AUTHN_SERVICE; + break; + case REJECT_INVALID_CHECKSUM: + ERR("invalid checksum\n"); + status = ERROR_ACCESS_DENIED; + break; + default: + ERR("rejected bind for reason %d\n", response_hdr->bind_nack.reject_reason); + status = RPC_S_CALL_FAILED_DNE; + } + break; + default: + ERR("wrong packet type received %d\n", response_hdr->common.ptype); + status = RPC_S_PROTOCOL_ERROR; + break; + } + + RPCRT4_FreeHeader(response_hdr); + return status; +} + +static RpcConnection *RpcAssoc_GetIdleConnection(RpcAssoc *assoc, + const RPC_SYNTAX_IDENTIFIER *InterfaceId, + const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RpcAuthInfo *AuthInfo, + const RpcQualityOfService *QOS) +{ + RpcConnection *Connection; + EnterCriticalSection(&assoc->cs); + /* try to find a compatible connection from the connection pool */ + LIST_FOR_EACH_ENTRY(Connection, &assoc->connection_pool, RpcConnection, conn_pool_entry) + { + if (!memcmp(&Connection->ActiveInterface, InterfaceId, + sizeof(RPC_SYNTAX_IDENTIFIER)) && + RpcAuthInfo_IsEqual(Connection->AuthInfo, AuthInfo) && + RpcQualityOfService_IsEqual(Connection->QOS, QOS)) + { + list_remove(&Connection->conn_pool_entry); + LeaveCriticalSection(&assoc->cs); + TRACE("got connection from pool %p\n", Connection); + return Connection; + } + } + + LeaveCriticalSection(&assoc->cs); + return NULL; +} + +RPC_STATUS RpcAssoc_GetClientConnection(RpcAssoc *assoc, + const RPC_SYNTAX_IDENTIFIER *InterfaceId, + const RPC_SYNTAX_IDENTIFIER *TransferSyntax, RpcAuthInfo *AuthInfo, + RpcQualityOfService *QOS, RpcConnection **Connection) +{ + RpcConnection *NewConnection; + RPC_STATUS status; + + *Connection = RpcAssoc_GetIdleConnection(assoc, InterfaceId, TransferSyntax, AuthInfo, QOS); + if (*Connection) + return RPC_S_OK; + + /* create a new connection */ + status = RPCRT4_CreateConnection(&NewConnection, FALSE /* is this a server connection? */, + assoc->Protseq, assoc->NetworkAddr, + assoc->Endpoint, assoc->NetworkOptions, + AuthInfo, QOS); + if (status != RPC_S_OK) + return status; + + status = RPCRT4_OpenClientConnection(NewConnection); + if (status != RPC_S_OK) + { + RPCRT4_DestroyConnection(NewConnection); + return status; + } + + status = RpcAssoc_BindConnection(assoc, NewConnection, InterfaceId, TransferSyntax); + if (status != RPC_S_OK) + { + RPCRT4_DestroyConnection(NewConnection); + return status; + } + + *Connection = NewConnection; + + return RPC_S_OK; +} + +void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection) +{ + assert(!Connection->server); + EnterCriticalSection(&assoc->cs); + if (!assoc->assoc_group_id) assoc->assoc_group_id = Connection->assoc_group_id; + list_add_head(&assoc->connection_pool, &Connection->conn_pool_entry); + LeaveCriticalSection(&assoc->cs); +} + + +RPC_STATUS RPCRT4_SpawnConnection(RpcConnection** Connection, RpcConnection* OldConnection) +{ + RPC_STATUS err; + + err = RPCRT4_CreateConnection(Connection, OldConnection->server, + rpcrt4_conn_get_name(OldConnection), + OldConnection->NetworkAddr, + OldConnection->Endpoint, NULL, + OldConnection->AuthInfo, OldConnection->QOS); + if (err == RPC_S_OK) + rpcrt4_conn_handoff(OldConnection, *Connection); + return err; +} + +RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection) +{ + TRACE("connection: %p\n", Connection); + + RPCRT4_CloseConnection(Connection); + RPCRT4_strfree(Connection->Endpoint); + RPCRT4_strfree(Connection->NetworkAddr); + HeapFree(GetProcessHeap(), 0, Connection->NetworkOptions); + if (Connection->AuthInfo) RpcAuthInfo_Release(Connection->AuthInfo); + if (Connection->QOS) RpcQualityOfService_Release(Connection->QOS); + HeapFree(GetProcessHeap(), 0, Connection); + return RPC_S_OK; +} + +RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, + size_t *tower_size, + const char *protseq, + const char *networkaddr, + const char *endpoint) +{ + twr_empty_floor_t *protocol_floor; + const struct connection_ops *protseq_ops = rpcrt4_get_conn_protseq_ops(protseq); + + *tower_size = 0; + + if (!protseq_ops) + return RPC_S_INVALID_RPC_PROTSEQ; + + if (!tower_data) + { + *tower_size = sizeof(*protocol_floor); + *tower_size += protseq_ops->get_top_of_tower(NULL, networkaddr, endpoint); + return RPC_S_OK; + } + + protocol_floor = (twr_empty_floor_t *)tower_data; + protocol_floor->count_lhs = sizeof(protocol_floor->protid); + protocol_floor->protid = protseq_ops->epm_protocols[0]; + protocol_floor->count_rhs = 0; + + tower_data += sizeof(*protocol_floor); + + *tower_size = protseq_ops->get_top_of_tower(tower_data, networkaddr, endpoint); + if (!*tower_size) + return EPT_S_NOT_REGISTERED; + + *tower_size += sizeof(*protocol_floor); + + return RPC_S_OK; +} + +RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, + size_t tower_size, + char **protseq, + char **networkaddr, + char **endpoint) +{ + const twr_empty_floor_t *protocol_floor; + const twr_empty_floor_t *floor4; + const struct connection_ops *protseq_ops = NULL; + RPC_STATUS status; + int i; + + if (tower_size < sizeof(*protocol_floor)) + return EPT_S_NOT_REGISTERED; + + protocol_floor = (const twr_empty_floor_t *)tower_data; + tower_data += sizeof(*protocol_floor); + tower_size -= sizeof(*protocol_floor); + if ((protocol_floor->count_lhs != sizeof(protocol_floor->protid)) || + (protocol_floor->count_rhs > tower_size)) + return EPT_S_NOT_REGISTERED; + tower_data += protocol_floor->count_rhs; + tower_size -= protocol_floor->count_rhs; + + floor4 = (const twr_empty_floor_t *)tower_data; + if ((tower_size < sizeof(*floor4)) || + (floor4->count_lhs != sizeof(floor4->protid))) + return EPT_S_NOT_REGISTERED; + + for(i = 0; i < ARRAYSIZE(conn_protseq_list); i++) + if ((protocol_floor->protid == conn_protseq_list[i].epm_protocols[0]) && + (floor4->protid == conn_protseq_list[i].epm_protocols[1])) + { + protseq_ops = &conn_protseq_list[i]; + break; + } + + if (!protseq_ops) + return EPT_S_NOT_REGISTERED; + + status = protseq_ops->parse_top_of_tower(tower_data, tower_size, networkaddr, endpoint); + + if ((status == RPC_S_OK) && protseq) + { + *protseq = I_RpcAllocate(strlen(protseq_ops->name) + 1); + strcpy(*protseq, protseq_ops->name); + } + + return status; +} + +/*********************************************************************** + * RpcNetworkIsProtseqValidW (RPCRT4.@) + * + * Checks if the given protocol sequence is known by the RPC system. + * If it is, returns RPC_S_OK, otherwise RPC_S_PROTSEQ_NOT_SUPPORTED. + * + */ +RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(RPC_WSTR protseq) +{ + char ps[0x10]; + + WideCharToMultiByte(CP_ACP, 0, protseq, -1, + ps, sizeof ps, NULL, NULL); + if (rpcrt4_get_conn_protseq_ops(ps)) + return RPC_S_OK; + + FIXME("Unknown protseq %s\n", debugstr_w(protseq)); + + return RPC_S_INVALID_RPC_PROTSEQ; +} + +/*********************************************************************** + * RpcNetworkIsProtseqValidA (RPCRT4.@) + */ +RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(RPC_CSTR protseq) +{ + UNICODE_STRING protseqW; + + if (RtlCreateUnicodeStringFromAsciiz(&protseqW, (char*)protseq)) + { + RPC_STATUS ret = RpcNetworkIsProtseqValidW(protseqW.Buffer); + RtlFreeUnicodeString(&protseqW); + return ret; + } + return RPC_S_OUT_OF_MEMORY; +} diff --git a/reactos/dll/win32/rpcrt4_new/rpcrt4_main.c b/reactos/dll/win32/rpcrt4_new/rpcrt4_main.c index 513ff472054..8b97ff4e1f4 100644 --- a/reactos/dll/win32/rpcrt4_new/rpcrt4_main.c +++ b/reactos/dll/win32/rpcrt4_new/rpcrt4_main.c @@ -1,830 +1,830 @@ -/* - * RPCRT4 - * - * Copyright 2000 Huw D M Davies for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * WINE RPC TODO's (and a few TODONT's) - * - * - Ove's decreasingly incomplete widl is an IDL compiler for wine. For widl - * to be wine's only IDL compiler, a fair bit of work remains to be done. - * until then we have used some midl-generated stuff. (What?) - * widl currently doesn't generate stub/proxy files required by wine's (O)RPC - * capabilities -- nor does it make those lovely format strings :( - * The MS MIDL compiler does some really esoteric stuff. Of course Ove has - * started with the less esoteric stuff. There are also lots of nice - * comments in there if you want to flex your bison and help build this monster. - * - * - RPC has a quite featureful error handling mechanism; basically none of this is - * implemented right now. We also have deficiencies on the compiler side, where - * wine's __TRY / __EXCEPT / __FINALLY macros are not even used for RpcTryExcept & co, - * due to syntactic differences! (we can fix it with widl by using __TRY) - * - * - There are several different memory allocation schemes for MSRPC. - * I don't even understand what they all are yet, much less have them - * properly implemented. Surely we are supposed to be doing something with - * the user-provided allocation/deallocation functions, but so far, - * I don't think we are doing this... - * - * - MSRPC provides impersonation capabilities which currently are not possible - * to implement in wine. At the very least we should implement the authorization - * API's & gracefully ignore the irrelevant stuff (to an extent we already do). - * - * - Some transports are not yet implemented. The existing transport implementations - * are incomplete and may be bug-infested. - * - * - The various transports that we do support ought to be supported in a more - * object-oriented manner, as in DCE's RPC implementation, instead of cluttering - * up the code with conditionals like we do now. - * - * - Data marshalling: So far, only the beginnings of a full implementation - * exist in wine. NDR protocol itself is documented, but the MS API's to - * convert data-types in memory into NDR are not. This is challenging work, - * and has supposedly been "at the top of Greg's queue" for several months now. - * - * - ORPC is RPC for OLE; once we have a working RPC framework, we can - * use it to implement out-of-process OLE client/server communications. - * ATM there is maybe a disconnect between the marshalling in the OLE DLLs - * and the marshalling going on here [TODO: well, is there or not?] - * - * - In-source API Documentation, at least for those functions which we have - * implemented, but preferably for everything we can document, would be nice, - * since some of this stuff is quite obscure. - * - * - Name services... [TODO: what about them] - * - * - Protocol Towers: Totally unimplemented.... I think. - * - * - Context Handle Rundown: whatever that is. - * - * - Nested RPC's: Totally unimplemented. - * - * - Statistics: we are supposed to be keeping various counters. we aren't. - * - * - Async RPC: Unimplemented. - * - * - XML/http RPC: Somewhere there's an XML fiend that wants to do this! Betcha - * we could use these as a transport for RPC's across computers without a - * permissions and/or licensing crisis. - * - * - The NT "ports" API, aka LPC. Greg claims this is on his radar. Might (or - * might not) enable users to get some kind of meaningful result out of - * NT-based native rpcrt4's. Commonly-used transport for self-to-self RPC's. - * - * - ...? More stuff I haven't thought of. If you think of more RPC todo's - * drop me an e-mail or send a patch to the - * wine-patches mailing list. - */ - -#include "config.h" - -#include -#include -#include -#include - -#include "windef.h" -#include "winerror.h" -#include "winbase.h" -#include "winuser.h" -#include "iptypes.h" -#include "iphlpapi.h" -#include "wine/unicode.h" -#include "rpc.h" - -#include "ole2.h" -#include "rpcndr.h" -#include "rpcproxy.h" - -#include "rpc_binding.h" -#include "rpcss_np_client.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(rpc); - -static UUID uuid_nil; -static HANDLE master_mutex; - -HANDLE RPCRT4_GetMasterMutex(void) -{ - return master_mutex; -} - -static CRITICAL_SECTION uuid_cs; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &uuid_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": uuid_cs") } -}; -static CRITICAL_SECTION uuid_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; - -/*********************************************************************** - * DllMain - * - * PARAMS - * hinstDLL [I] handle to the DLL's instance - * fdwReason [I] - * lpvReserved [I] reserved, must be NULL - * - * RETURNS - * Success: TRUE - * Failure: FALSE - */ - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - switch (fdwReason) { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - master_mutex = CreateMutexA( NULL, FALSE, RPCSS_MASTER_MUTEX_NAME); - if (!master_mutex) - ERR("Failed to create master mutex\n"); - break; - - case DLL_PROCESS_DETACH: - CloseHandle(master_mutex); - master_mutex = NULL; - break; - } - - return TRUE; -} - -/************************************************************************* - * RpcStringFreeA [RPCRT4.@] - * - * Frees a character string allocated by the RPC run-time library. - * - * RETURNS - * - * S_OK if successful. - */ -RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR* String) -{ - HeapFree( GetProcessHeap(), 0, *String); - - return RPC_S_OK; -} - -/************************************************************************* - * RpcStringFreeW [RPCRT4.@] - * - * Frees a character string allocated by the RPC run-time library. - * - * RETURNS - * - * S_OK if successful. - */ -RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR* String) -{ - HeapFree( GetProcessHeap(), 0, *String); - - return RPC_S_OK; -} - -/************************************************************************* - * RpcRaiseException [RPCRT4.@] - * - * Raises an exception. - */ -void WINAPI RpcRaiseException(RPC_STATUS exception) -{ - /* FIXME: translate exception? */ - RaiseException(exception, 0, 0, NULL); -} - -/************************************************************************* - * UuidCompare [RPCRT4.@] - * - * PARAMS - * UUID *Uuid1 [I] Uuid to compare - * UUID *Uuid2 [I] Uuid to compare - * RPC_STATUS *Status [O] returns RPC_S_OK - * - * RETURNS - * -1 if Uuid1 is less than Uuid2 - * 0 if Uuid1 and Uuid2 are equal - * 1 if Uuid1 is greater than Uuid2 - */ -int WINAPI UuidCompare(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status) -{ - int i; - - TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2)); - - *Status = RPC_S_OK; - - if (!Uuid1) Uuid1 = &uuid_nil; - if (!Uuid2) Uuid2 = &uuid_nil; - - if (Uuid1 == Uuid2) return 0; - - if (Uuid1->Data1 != Uuid2->Data1) - return Uuid1->Data1 < Uuid2->Data1 ? -1 : 1; - - if (Uuid1->Data2 != Uuid2->Data2) - return Uuid1->Data2 < Uuid2->Data2 ? -1 : 1; - - if (Uuid1->Data3 != Uuid2->Data3) - return Uuid1->Data3 < Uuid2->Data3 ? -1 : 1; - - for (i = 0; i < 8; i++) { - if (Uuid1->Data4[i] < Uuid2->Data4[i]) - return -1; - if (Uuid1->Data4[i] > Uuid2->Data4[i]) - return 1; - } - - return 0; -} - -/************************************************************************* - * UuidEqual [RPCRT4.@] - * - * PARAMS - * UUID *Uuid1 [I] Uuid to compare - * UUID *Uuid2 [I] Uuid to compare - * RPC_STATUS *Status [O] returns RPC_S_OK - * - * RETURNS - * TRUE/FALSE - */ -int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status) -{ - TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2)); - return !UuidCompare(Uuid1, Uuid2, Status); -} - -/************************************************************************* - * UuidIsNil [RPCRT4.@] - * - * PARAMS - * UUID *Uuid [I] Uuid to compare - * RPC_STATUS *Status [O] retuns RPC_S_OK - * - * RETURNS - * TRUE/FALSE - */ -int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status) -{ - TRACE("(%s)\n", debugstr_guid(Uuid)); - if (!Uuid) return TRUE; - return !UuidCompare(Uuid, &uuid_nil, Status); -} - - /************************************************************************* - * UuidCreateNil [RPCRT4.@] - * - * PARAMS - * UUID *Uuid [O] returns a nil UUID - * - * RETURNS - * RPC_S_OK - */ -RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid) -{ - *Uuid = uuid_nil; - return RPC_S_OK; -} - -/* Number of 100ns ticks per clock tick. To be safe, assume that the clock - resolution is at least 1000 * 100 * (1/1000000) = 1/10 of a second */ -#define TICKS_PER_CLOCK_TICK 1000 -#define SECSPERDAY 86400 -#define TICKSPERSEC 10000000 -/* UUID system time starts at October 15, 1582 */ -#define SECS_15_OCT_1582_TO_1601 ((17 + 30 + 31 + 365 * 18 + 5) * SECSPERDAY) -#define TICKS_15_OCT_1582_TO_1601 ((ULONGLONG)SECS_15_OCT_1582_TO_1601 * TICKSPERSEC) - -static void RPC_UuidGetSystemTime(ULONGLONG *time) -{ - FILETIME ft; - - GetSystemTimeAsFileTime(&ft); - - *time = ((ULONGLONG)ft.dwHighDateTime << 32) | ft.dwLowDateTime; - *time += TICKS_15_OCT_1582_TO_1601; -} - -/* Assume that a hardware address is at least 6 bytes long */ -#define ADDRESS_BYTES_NEEDED 6 - -static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address) -{ - int i; - DWORD status = RPC_S_OK; - - ULONG buflen = sizeof(IP_ADAPTER_INFO); - PIP_ADAPTER_INFO adapter = HeapAlloc(GetProcessHeap(), 0, buflen); - - if (GetAdaptersInfo(adapter, &buflen) == ERROR_BUFFER_OVERFLOW) { - HeapFree(GetProcessHeap(), 0, adapter); - adapter = HeapAlloc(GetProcessHeap(), 0, buflen); - } - - if (GetAdaptersInfo(adapter, &buflen) == NO_ERROR) { - for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) { - address[i] = adapter->Address[i]; - } - } - /* We can't get a hardware address, just use random numbers. - Set the multicast bit to prevent conflicts with real cards. */ - else { - for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) { - address[i] = rand() & 0xff; - } - - address[0] |= 0x01; - status = RPC_S_UUID_LOCAL_ONLY; - } - - HeapFree(GetProcessHeap(), 0, adapter); - return status; -} - -/************************************************************************* - * UuidCreate [RPCRT4.@] - * - * Creates a 128bit UUID. - * - * RETURNS - * - * RPC_S_OK if successful. - * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique. - * - * FIXME: No compensation for changes across reloading - * this dll or across reboots (e.g. clock going - * backwards and swapped network cards). The RFC - * suggests using NVRAM for storing persistent - * values. - */ -RPC_STATUS WINAPI UuidCreate(UUID *Uuid) -{ - static int initialised, count; - - ULONGLONG time; - static ULONGLONG timelast; - static WORD sequence; - - static DWORD status; - static BYTE address[MAX_ADAPTER_ADDRESS_LENGTH]; - - EnterCriticalSection(&uuid_cs); - - if (!initialised) { - RPC_UuidGetSystemTime(&timelast); - count = TICKS_PER_CLOCK_TICK; - - sequence = ((rand() & 0xff) << 8) + (rand() & 0xff); - sequence &= 0x1fff; - - status = RPC_UuidGetNodeAddress(address); - initialised = 1; - } - - /* Generate time element of the UUID. Account for going faster - than our clock as well as the clock going backwards. */ - while (1) { - RPC_UuidGetSystemTime(&time); - if (time > timelast) { - count = 0; - break; - } - if (time < timelast) { - sequence = (sequence + 1) & 0x1fff; - count = 0; - break; - } - if (count < TICKS_PER_CLOCK_TICK) { - count++; - break; - } - } - - timelast = time; - time += count; - - /* Pack the information into the UUID structure. */ - - Uuid->Data1 = (unsigned long)(time & 0xffffffff); - Uuid->Data2 = (unsigned short)((time >> 32) & 0xffff); - Uuid->Data3 = (unsigned short)((time >> 48) & 0x0fff); - - /* This is a version 1 UUID */ - Uuid->Data3 |= (1 << 12); - - Uuid->Data4[0] = sequence & 0xff; - Uuid->Data4[1] = (sequence & 0x3f00) >> 8; - Uuid->Data4[1] |= 0x80; - - Uuid->Data4[2] = address[0]; - Uuid->Data4[3] = address[1]; - Uuid->Data4[4] = address[2]; - Uuid->Data4[5] = address[3]; - Uuid->Data4[6] = address[4]; - Uuid->Data4[7] = address[5]; - - LeaveCriticalSection(&uuid_cs); - - TRACE("%s\n", debugstr_guid(Uuid)); - - return status; -} - -/************************************************************************* - * UuidCreateSequential [RPCRT4.@] - * - * Creates a 128bit UUID. - * - * RETURNS - * - * RPC_S_OK if successful. - * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique. - * - */ -RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid) -{ - return UuidCreate(Uuid); -} - - -/************************************************************************* - * UuidHash [RPCRT4.@] - * - * Generates a hash value for a given UUID - * - * Code based on FreeDCE implementation - * - */ -unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status) -{ - BYTE *data = (BYTE*)uuid; - short c0 = 0, c1 = 0, x, y; - unsigned int i; - - if (!uuid) data = (BYTE*)(uuid = &uuid_nil); - - TRACE("(%s)\n", debugstr_guid(uuid)); - - for (i=0; iData1, Uuid->Data2, Uuid->Data3, - Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], - Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], - Uuid->Data4[6], Uuid->Data4[7] ); - - return RPC_S_OK; -} - -/************************************************************************* - * UuidToStringW [RPCRT4.@] - * - * Converts a UUID to a string. - * - * S_OK if successful. - * S_OUT_OF_MEMORY if unsuccessful. - */ -RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR* StringUuid) -{ - char buf[37]; - - if (!Uuid) Uuid = &uuid_nil; - - sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - Uuid->Data1, Uuid->Data2, Uuid->Data3, - Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], - Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], - Uuid->Data4[6], Uuid->Data4[7] ); - - *StringUuid = RPCRT4_strdupAtoW(buf); - - if(!(*StringUuid)) - return RPC_S_OUT_OF_MEMORY; - - return RPC_S_OK; -} - -static const BYTE hex2bin[] = -{ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x00 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x10 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x20 */ - 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, /* 0x30 */ - 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, /* 0x40 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x50 */ - 0,10,11,12,13,14,15 /* 0x60 */ -}; - -/*********************************************************************** - * UuidFromStringA (RPCRT4.@) - */ -RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid) -{ - int i; - - if (!s) return UuidCreateNil( uuid ); - - if (strlen((char*)s) != 36) return RPC_S_INVALID_STRING_UUID; - - if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-')) - return RPC_S_INVALID_STRING_UUID; - - for (i=0; i<36; i++) - { - if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue; - if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID; - } - - /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ - - uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 | - hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]); - uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]]; - uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]]; - - /* these are just sequential bytes */ - uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]]; - uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]]; - uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]]; - uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]]; - uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]]; - uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]]; - uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]]; - uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]]; - return RPC_S_OK; -} - - -/*********************************************************************** - * UuidFromStringW (RPCRT4.@) - */ -RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid) -{ - int i; - - if (!s) return UuidCreateNil( uuid ); - - if (strlenW(s) != 36) return RPC_S_INVALID_STRING_UUID; - - if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-')) - return RPC_S_INVALID_STRING_UUID; - - for (i=0; i<36; i++) - { - if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue; - if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID; - } - - /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ - - uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 | - hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]); - uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]]; - uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]]; - - /* these are just sequential bytes */ - uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]]; - uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]]; - uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]]; - uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]]; - uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]]; - uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]]; - uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]]; - uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]]; - return RPC_S_OK; -} - -/*********************************************************************** - * DllRegisterServer (RPCRT4.@) - */ - -HRESULT WINAPI DllRegisterServer( void ) -{ - FIXME( "(): stub\n" ); - return S_OK; -} - -static BOOL RPCRT4_StartRPCSS(void) -{ - PROCESS_INFORMATION pi; - STARTUPINFOA si; - static char cmd[6]; - BOOL rslt; - - ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); - ZeroMemory(&si, sizeof(STARTUPINFOA)); - si.cb = sizeof(STARTUPINFOA); - - /* apparently it's not OK to use a constant string below */ - CopyMemory(cmd, "rpcss", 6); - - /* FIXME: will this do the right thing when run as a test? */ - rslt = CreateProcessA( - NULL, /* executable */ - cmd, /* command line */ - NULL, /* process security attributes */ - NULL, /* primary thread security attributes */ - FALSE, /* inherit handles */ - 0, /* creation flags */ - NULL, /* use parent's environment */ - NULL, /* use parent's current directory */ - &si, /* STARTUPINFO pointer */ - &pi /* PROCESS_INFORMATION */ - ); - - if (rslt) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - - return rslt; -} - -/*********************************************************************** - * RPCRT4_RPCSSOnDemandCall (internal) - * - * Attempts to send a message to the RPCSS process - * on the local machine, invoking it if necessary. - * For remote RPCSS calls, use.... your imagination. - * - * PARAMS - * msg [I] pointer to the RPCSS message - * vardata_payload [I] pointer vardata portion of the RPCSS message - * reply [O] pointer to reply structure - * - * RETURNS - * TRUE if successful - * FALSE otherwise - */ -BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPCSS_NP_REPLY reply) -{ - HANDLE client_handle; - BOOL ret; - int i, j = 0; - - TRACE("(msg == %p, vardata_payload == %p, reply == %p)\n", msg, vardata_payload, reply); - - client_handle = RPCRT4_RpcssNPConnect(); - - while (INVALID_HANDLE_VALUE == client_handle) { - /* start the RPCSS process */ - if (!RPCRT4_StartRPCSS()) { - ERR("Unable to start RPCSS process.\n"); - return FALSE; - } - /* wait for a connection (w/ periodic polling) */ - for (i = 0; i < 60; i++) { - Sleep(200); - client_handle = RPCRT4_RpcssNPConnect(); - if (INVALID_HANDLE_VALUE != client_handle) break; - } - /* we are only willing to try twice */ - if (j++ >= 1) break; - } - - if (INVALID_HANDLE_VALUE == client_handle) { - /* no dice! */ - ERR("Unable to connect to RPCSS process!\n"); - SetLastError(RPC_E_SERVER_DIED_DNE); - return FALSE; - } - - /* great, we're connected. now send the message */ - ret = TRUE; - if (!RPCRT4_SendReceiveNPMsg(client_handle, msg, vardata_payload, reply)) { - ERR("Something is amiss: RPC_SendReceive failed.\n"); - ret = FALSE; - } - CloseHandle(client_handle); - - return ret; -} - -#define MAX_RPC_ERROR_TEXT 256 - -/****************************************************************************** - * DceErrorInqTextW (rpcrt4.@) - * - * Notes - * 1. On passing a NULL pointer the code does bomb out. - * 2. The size of the required buffer is not defined in the documentation. - * It appears to be 256. - * 3. The function is defined to return RPC_S_INVALID_ARG but I don't know - * of any value for which it does. - * 4. The MSDN documentation currently declares that the second argument is - * unsigned char *, even for the W version. I don't believe it. - */ -RPC_STATUS RPC_ENTRY DceErrorInqTextW (RPC_STATUS e, RPC_WSTR buffer) -{ - DWORD count; - count = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, e, 0, buffer, MAX_RPC_ERROR_TEXT, NULL); - if (!count) - { - count = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, RPC_S_NOT_RPC_ERROR, 0, buffer, MAX_RPC_ERROR_TEXT, NULL); - if (!count) - { - ERR ("Failed to translate error\n"); - return RPC_S_INVALID_ARG; - } - } - return RPC_S_OK; -} - -/****************************************************************************** - * DceErrorInqTextA (rpcrt4.@) - */ -RPC_STATUS RPC_ENTRY DceErrorInqTextA (RPC_STATUS e, RPC_CSTR buffer) -{ - RPC_STATUS status; - WCHAR bufferW [MAX_RPC_ERROR_TEXT]; - if ((status = DceErrorInqTextW (e, bufferW)) == RPC_S_OK) - { - if (!WideCharToMultiByte(CP_ACP, 0, bufferW, -1, (LPSTR)buffer, MAX_RPC_ERROR_TEXT, - NULL, NULL)) - { - ERR ("Failed to translate error\n"); - status = RPC_S_INVALID_ARG; - } - } - return status; -} - -/****************************************************************************** - * I_RpcAllocate (rpcrt4.@) - */ -void * WINAPI I_RpcAllocate(unsigned int Size) -{ - return HeapAlloc(GetProcessHeap(), 0, Size); -} - -/****************************************************************************** - * I_RpcFree (rpcrt4.@) - */ -void WINAPI I_RpcFree(void *Object) -{ - HeapFree(GetProcessHeap(), 0, Object); -} - -/****************************************************************************** - * I_RpcMapWin32Status (rpcrt4.@) - */ -DWORD WINAPI I_RpcMapWin32Status(RPC_STATUS status) -{ - FIXME("(%ld): stub\n", status); - return 0; -} +/* + * RPCRT4 + * + * Copyright 2000 Huw D M Davies for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * WINE RPC TODO's (and a few TODONT's) + * + * - Ove's decreasingly incomplete widl is an IDL compiler for wine. For widl + * to be wine's only IDL compiler, a fair bit of work remains to be done. + * until then we have used some midl-generated stuff. (What?) + * widl currently doesn't generate stub/proxy files required by wine's (O)RPC + * capabilities -- nor does it make those lovely format strings :( + * The MS MIDL compiler does some really esoteric stuff. Of course Ove has + * started with the less esoteric stuff. There are also lots of nice + * comments in there if you want to flex your bison and help build this monster. + * + * - RPC has a quite featureful error handling mechanism; basically none of this is + * implemented right now. We also have deficiencies on the compiler side, where + * wine's __TRY / __EXCEPT / __FINALLY macros are not even used for RpcTryExcept & co, + * due to syntactic differences! (we can fix it with widl by using __TRY) + * + * - There are several different memory allocation schemes for MSRPC. + * I don't even understand what they all are yet, much less have them + * properly implemented. Surely we are supposed to be doing something with + * the user-provided allocation/deallocation functions, but so far, + * I don't think we are doing this... + * + * - MSRPC provides impersonation capabilities which currently are not possible + * to implement in wine. At the very least we should implement the authorization + * API's & gracefully ignore the irrelevant stuff (to an extent we already do). + * + * - Some transports are not yet implemented. The existing transport implementations + * are incomplete and may be bug-infested. + * + * - The various transports that we do support ought to be supported in a more + * object-oriented manner, as in DCE's RPC implementation, instead of cluttering + * up the code with conditionals like we do now. + * + * - Data marshalling: So far, only the beginnings of a full implementation + * exist in wine. NDR protocol itself is documented, but the MS API's to + * convert data-types in memory into NDR are not. This is challenging work, + * and has supposedly been "at the top of Greg's queue" for several months now. + * + * - ORPC is RPC for OLE; once we have a working RPC framework, we can + * use it to implement out-of-process OLE client/server communications. + * ATM there is maybe a disconnect between the marshalling in the OLE DLLs + * and the marshalling going on here [TODO: well, is there or not?] + * + * - In-source API Documentation, at least for those functions which we have + * implemented, but preferably for everything we can document, would be nice, + * since some of this stuff is quite obscure. + * + * - Name services... [TODO: what about them] + * + * - Protocol Towers: Totally unimplemented.... I think. + * + * - Context Handle Rundown: whatever that is. + * + * - Nested RPC's: Totally unimplemented. + * + * - Statistics: we are supposed to be keeping various counters. we aren't. + * + * - Async RPC: Unimplemented. + * + * - XML/http RPC: Somewhere there's an XML fiend that wants to do this! Betcha + * we could use these as a transport for RPC's across computers without a + * permissions and/or licensing crisis. + * + * - The NT "ports" API, aka LPC. Greg claims this is on his radar. Might (or + * might not) enable users to get some kind of meaningful result out of + * NT-based native rpcrt4's. Commonly-used transport for self-to-self RPC's. + * + * - ...? More stuff I haven't thought of. If you think of more RPC todo's + * drop me an e-mail or send a patch to the + * wine-patches mailing list. + */ + +#include "config.h" + +#include +#include +#include +#include + +#include "windef.h" +#include "winerror.h" +#include "winbase.h" +#include "winuser.h" +#include "iptypes.h" +#include "iphlpapi.h" +#include "wine/unicode.h" +#include "rpc.h" + +#include "ole2.h" +#include "rpcndr.h" +#include "rpcproxy.h" + +#include "rpc_binding.h" +#include "rpcss_np_client.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(rpc); + +static UUID uuid_nil; +static HANDLE master_mutex; + +HANDLE RPCRT4_GetMasterMutex(void) +{ + return master_mutex; +} + +static CRITICAL_SECTION uuid_cs; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &uuid_cs, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": uuid_cs") } +}; +static CRITICAL_SECTION uuid_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; + +/*********************************************************************** + * DllMain + * + * PARAMS + * hinstDLL [I] handle to the DLL's instance + * fdwReason [I] + * lpvReserved [I] reserved, must be NULL + * + * RETURNS + * Success: TRUE + * Failure: FALSE + */ + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + switch (fdwReason) { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + master_mutex = CreateMutexA( NULL, FALSE, RPCSS_MASTER_MUTEX_NAME); + if (!master_mutex) + ERR("Failed to create master mutex\n"); + break; + + case DLL_PROCESS_DETACH: + CloseHandle(master_mutex); + master_mutex = NULL; + break; + } + + return TRUE; +} + +/************************************************************************* + * RpcStringFreeA [RPCRT4.@] + * + * Frees a character string allocated by the RPC run-time library. + * + * RETURNS + * + * S_OK if successful. + */ +RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR* String) +{ + HeapFree( GetProcessHeap(), 0, *String); + + return RPC_S_OK; +} + +/************************************************************************* + * RpcStringFreeW [RPCRT4.@] + * + * Frees a character string allocated by the RPC run-time library. + * + * RETURNS + * + * S_OK if successful. + */ +RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR* String) +{ + HeapFree( GetProcessHeap(), 0, *String); + + return RPC_S_OK; +} + +/************************************************************************* + * RpcRaiseException [RPCRT4.@] + * + * Raises an exception. + */ +void WINAPI RpcRaiseException(RPC_STATUS exception) +{ + /* FIXME: translate exception? */ + RaiseException(exception, 0, 0, NULL); +} + +/************************************************************************* + * UuidCompare [RPCRT4.@] + * + * PARAMS + * UUID *Uuid1 [I] Uuid to compare + * UUID *Uuid2 [I] Uuid to compare + * RPC_STATUS *Status [O] returns RPC_S_OK + * + * RETURNS + * -1 if Uuid1 is less than Uuid2 + * 0 if Uuid1 and Uuid2 are equal + * 1 if Uuid1 is greater than Uuid2 + */ +int WINAPI UuidCompare(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status) +{ + int i; + + TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2)); + + *Status = RPC_S_OK; + + if (!Uuid1) Uuid1 = &uuid_nil; + if (!Uuid2) Uuid2 = &uuid_nil; + + if (Uuid1 == Uuid2) return 0; + + if (Uuid1->Data1 != Uuid2->Data1) + return Uuid1->Data1 < Uuid2->Data1 ? -1 : 1; + + if (Uuid1->Data2 != Uuid2->Data2) + return Uuid1->Data2 < Uuid2->Data2 ? -1 : 1; + + if (Uuid1->Data3 != Uuid2->Data3) + return Uuid1->Data3 < Uuid2->Data3 ? -1 : 1; + + for (i = 0; i < 8; i++) { + if (Uuid1->Data4[i] < Uuid2->Data4[i]) + return -1; + if (Uuid1->Data4[i] > Uuid2->Data4[i]) + return 1; + } + + return 0; +} + +/************************************************************************* + * UuidEqual [RPCRT4.@] + * + * PARAMS + * UUID *Uuid1 [I] Uuid to compare + * UUID *Uuid2 [I] Uuid to compare + * RPC_STATUS *Status [O] returns RPC_S_OK + * + * RETURNS + * TRUE/FALSE + */ +int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status) +{ + TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2)); + return !UuidCompare(Uuid1, Uuid2, Status); +} + +/************************************************************************* + * UuidIsNil [RPCRT4.@] + * + * PARAMS + * UUID *Uuid [I] Uuid to compare + * RPC_STATUS *Status [O] retuns RPC_S_OK + * + * RETURNS + * TRUE/FALSE + */ +int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status) +{ + TRACE("(%s)\n", debugstr_guid(Uuid)); + if (!Uuid) return TRUE; + return !UuidCompare(Uuid, &uuid_nil, Status); +} + + /************************************************************************* + * UuidCreateNil [RPCRT4.@] + * + * PARAMS + * UUID *Uuid [O] returns a nil UUID + * + * RETURNS + * RPC_S_OK + */ +RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid) +{ + *Uuid = uuid_nil; + return RPC_S_OK; +} + +/* Number of 100ns ticks per clock tick. To be safe, assume that the clock + resolution is at least 1000 * 100 * (1/1000000) = 1/10 of a second */ +#define TICKS_PER_CLOCK_TICK 1000 +#define SECSPERDAY 86400 +#define TICKSPERSEC 10000000 +/* UUID system time starts at October 15, 1582 */ +#define SECS_15_OCT_1582_TO_1601 ((17 + 30 + 31 + 365 * 18 + 5) * SECSPERDAY) +#define TICKS_15_OCT_1582_TO_1601 ((ULONGLONG)SECS_15_OCT_1582_TO_1601 * TICKSPERSEC) + +static void RPC_UuidGetSystemTime(ULONGLONG *time) +{ + FILETIME ft; + + GetSystemTimeAsFileTime(&ft); + + *time = ((ULONGLONG)ft.dwHighDateTime << 32) | ft.dwLowDateTime; + *time += TICKS_15_OCT_1582_TO_1601; +} + +/* Assume that a hardware address is at least 6 bytes long */ +#define ADDRESS_BYTES_NEEDED 6 + +static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address) +{ + int i; + DWORD status = RPC_S_OK; + + ULONG buflen = sizeof(IP_ADAPTER_INFO); + PIP_ADAPTER_INFO adapter = HeapAlloc(GetProcessHeap(), 0, buflen); + + if (GetAdaptersInfo(adapter, &buflen) == ERROR_BUFFER_OVERFLOW) { + HeapFree(GetProcessHeap(), 0, adapter); + adapter = HeapAlloc(GetProcessHeap(), 0, buflen); + } + + if (GetAdaptersInfo(adapter, &buflen) == NO_ERROR) { + for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) { + address[i] = adapter->Address[i]; + } + } + /* We can't get a hardware address, just use random numbers. + Set the multicast bit to prevent conflicts with real cards. */ + else { + for (i = 0; i < ADDRESS_BYTES_NEEDED; i++) { + address[i] = rand() & 0xff; + } + + address[0] |= 0x01; + status = RPC_S_UUID_LOCAL_ONLY; + } + + HeapFree(GetProcessHeap(), 0, adapter); + return status; +} + +/************************************************************************* + * UuidCreate [RPCRT4.@] + * + * Creates a 128bit UUID. + * + * RETURNS + * + * RPC_S_OK if successful. + * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique. + * + * FIXME: No compensation for changes across reloading + * this dll or across reboots (e.g. clock going + * backwards and swapped network cards). The RFC + * suggests using NVRAM for storing persistent + * values. + */ +RPC_STATUS WINAPI UuidCreate(UUID *Uuid) +{ + static int initialised, count; + + ULONGLONG time; + static ULONGLONG timelast; + static WORD sequence; + + static DWORD status; + static BYTE address[MAX_ADAPTER_ADDRESS_LENGTH]; + + EnterCriticalSection(&uuid_cs); + + if (!initialised) { + RPC_UuidGetSystemTime(&timelast); + count = TICKS_PER_CLOCK_TICK; + + sequence = ((rand() & 0xff) << 8) + (rand() & 0xff); + sequence &= 0x1fff; + + status = RPC_UuidGetNodeAddress(address); + initialised = 1; + } + + /* Generate time element of the UUID. Account for going faster + than our clock as well as the clock going backwards. */ + while (1) { + RPC_UuidGetSystemTime(&time); + if (time > timelast) { + count = 0; + break; + } + if (time < timelast) { + sequence = (sequence + 1) & 0x1fff; + count = 0; + break; + } + if (count < TICKS_PER_CLOCK_TICK) { + count++; + break; + } + } + + timelast = time; + time += count; + + /* Pack the information into the UUID structure. */ + + Uuid->Data1 = (unsigned long)(time & 0xffffffff); + Uuid->Data2 = (unsigned short)((time >> 32) & 0xffff); + Uuid->Data3 = (unsigned short)((time >> 48) & 0x0fff); + + /* This is a version 1 UUID */ + Uuid->Data3 |= (1 << 12); + + Uuid->Data4[0] = sequence & 0xff; + Uuid->Data4[1] = (sequence & 0x3f00) >> 8; + Uuid->Data4[1] |= 0x80; + + Uuid->Data4[2] = address[0]; + Uuid->Data4[3] = address[1]; + Uuid->Data4[4] = address[2]; + Uuid->Data4[5] = address[3]; + Uuid->Data4[6] = address[4]; + Uuid->Data4[7] = address[5]; + + LeaveCriticalSection(&uuid_cs); + + TRACE("%s\n", debugstr_guid(Uuid)); + + return status; +} + +/************************************************************************* + * UuidCreateSequential [RPCRT4.@] + * + * Creates a 128bit UUID. + * + * RETURNS + * + * RPC_S_OK if successful. + * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique. + * + */ +RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid) +{ + return UuidCreate(Uuid); +} + + +/************************************************************************* + * UuidHash [RPCRT4.@] + * + * Generates a hash value for a given UUID + * + * Code based on FreeDCE implementation + * + */ +unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status) +{ + BYTE *data = (BYTE*)uuid; + short c0 = 0, c1 = 0, x, y; + unsigned int i; + + if (!uuid) data = (BYTE*)(uuid = &uuid_nil); + + TRACE("(%s)\n", debugstr_guid(uuid)); + + for (i=0; iData1, Uuid->Data2, Uuid->Data3, + Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], + Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], + Uuid->Data4[6], Uuid->Data4[7] ); + + return RPC_S_OK; +} + +/************************************************************************* + * UuidToStringW [RPCRT4.@] + * + * Converts a UUID to a string. + * + * S_OK if successful. + * S_OUT_OF_MEMORY if unsuccessful. + */ +RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR* StringUuid) +{ + char buf[37]; + + if (!Uuid) Uuid = &uuid_nil; + + sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + Uuid->Data1, Uuid->Data2, Uuid->Data3, + Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], + Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], + Uuid->Data4[6], Uuid->Data4[7] ); + + *StringUuid = RPCRT4_strdupAtoW(buf); + + if(!(*StringUuid)) + return RPC_S_OUT_OF_MEMORY; + + return RPC_S_OK; +} + +static const BYTE hex2bin[] = +{ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x00 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x10 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x20 */ + 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, /* 0x30 */ + 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, /* 0x40 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x50 */ + 0,10,11,12,13,14,15 /* 0x60 */ +}; + +/*********************************************************************** + * UuidFromStringA (RPCRT4.@) + */ +RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid) +{ + int i; + + if (!s) return UuidCreateNil( uuid ); + + if (strlen((char*)s) != 36) return RPC_S_INVALID_STRING_UUID; + + if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-')) + return RPC_S_INVALID_STRING_UUID; + + for (i=0; i<36; i++) + { + if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue; + if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID; + } + + /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ + + uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 | + hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]); + uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]]; + uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]]; + + /* these are just sequential bytes */ + uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]]; + uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]]; + uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]]; + uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]]; + uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]]; + uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]]; + uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]]; + uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]]; + return RPC_S_OK; +} + + +/*********************************************************************** + * UuidFromStringW (RPCRT4.@) + */ +RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid) +{ + int i; + + if (!s) return UuidCreateNil( uuid ); + + if (strlenW(s) != 36) return RPC_S_INVALID_STRING_UUID; + + if ((s[8]!='-') || (s[13]!='-') || (s[18]!='-') || (s[23]!='-')) + return RPC_S_INVALID_STRING_UUID; + + for (i=0; i<36; i++) + { + if ((i == 8)||(i == 13)||(i == 18)||(i == 23)) continue; + if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) return RPC_S_INVALID_STRING_UUID; + } + + /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ + + uuid->Data1 = (hex2bin[s[0]] << 28 | hex2bin[s[1]] << 24 | hex2bin[s[2]] << 20 | hex2bin[s[3]] << 16 | + hex2bin[s[4]] << 12 | hex2bin[s[5]] << 8 | hex2bin[s[6]] << 4 | hex2bin[s[7]]); + uuid->Data2 = hex2bin[s[9]] << 12 | hex2bin[s[10]] << 8 | hex2bin[s[11]] << 4 | hex2bin[s[12]]; + uuid->Data3 = hex2bin[s[14]] << 12 | hex2bin[s[15]] << 8 | hex2bin[s[16]] << 4 | hex2bin[s[17]]; + + /* these are just sequential bytes */ + uuid->Data4[0] = hex2bin[s[19]] << 4 | hex2bin[s[20]]; + uuid->Data4[1] = hex2bin[s[21]] << 4 | hex2bin[s[22]]; + uuid->Data4[2] = hex2bin[s[24]] << 4 | hex2bin[s[25]]; + uuid->Data4[3] = hex2bin[s[26]] << 4 | hex2bin[s[27]]; + uuid->Data4[4] = hex2bin[s[28]] << 4 | hex2bin[s[29]]; + uuid->Data4[5] = hex2bin[s[30]] << 4 | hex2bin[s[31]]; + uuid->Data4[6] = hex2bin[s[32]] << 4 | hex2bin[s[33]]; + uuid->Data4[7] = hex2bin[s[34]] << 4 | hex2bin[s[35]]; + return RPC_S_OK; +} + +/*********************************************************************** + * DllRegisterServer (RPCRT4.@) + */ + +HRESULT WINAPI DllRegisterServer( void ) +{ + FIXME( "(): stub\n" ); + return S_OK; +} + +static BOOL RPCRT4_StartRPCSS(void) +{ + PROCESS_INFORMATION pi; + STARTUPINFOA si; + static char cmd[6]; + BOOL rslt; + + ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); + ZeroMemory(&si, sizeof(STARTUPINFOA)); + si.cb = sizeof(STARTUPINFOA); + + /* apparently it's not OK to use a constant string below */ + CopyMemory(cmd, "rpcss", 6); + + /* FIXME: will this do the right thing when run as a test? */ + rslt = CreateProcessA( + NULL, /* executable */ + cmd, /* command line */ + NULL, /* process security attributes */ + NULL, /* primary thread security attributes */ + FALSE, /* inherit handles */ + 0, /* creation flags */ + NULL, /* use parent's environment */ + NULL, /* use parent's current directory */ + &si, /* STARTUPINFO pointer */ + &pi /* PROCESS_INFORMATION */ + ); + + if (rslt) { + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + } + + return rslt; +} + +/*********************************************************************** + * RPCRT4_RPCSSOnDemandCall (internal) + * + * Attempts to send a message to the RPCSS process + * on the local machine, invoking it if necessary. + * For remote RPCSS calls, use.... your imagination. + * + * PARAMS + * msg [I] pointer to the RPCSS message + * vardata_payload [I] pointer vardata portion of the RPCSS message + * reply [O] pointer to reply structure + * + * RETURNS + * TRUE if successful + * FALSE otherwise + */ +BOOL RPCRT4_RPCSSOnDemandCall(PRPCSS_NP_MESSAGE msg, char *vardata_payload, PRPCSS_NP_REPLY reply) +{ + HANDLE client_handle; + BOOL ret; + int i, j = 0; + + TRACE("(msg == %p, vardata_payload == %p, reply == %p)\n", msg, vardata_payload, reply); + + client_handle = RPCRT4_RpcssNPConnect(); + + while (INVALID_HANDLE_VALUE == client_handle) { + /* start the RPCSS process */ + if (!RPCRT4_StartRPCSS()) { + ERR("Unable to start RPCSS process.\n"); + return FALSE; + } + /* wait for a connection (w/ periodic polling) */ + for (i = 0; i < 60; i++) { + Sleep(200); + client_handle = RPCRT4_RpcssNPConnect(); + if (INVALID_HANDLE_VALUE != client_handle) break; + } + /* we are only willing to try twice */ + if (j++ >= 1) break; + } + + if (INVALID_HANDLE_VALUE == client_handle) { + /* no dice! */ + ERR("Unable to connect to RPCSS process!\n"); + SetLastError(RPC_E_SERVER_DIED_DNE); + return FALSE; + } + + /* great, we're connected. now send the message */ + ret = TRUE; + if (!RPCRT4_SendReceiveNPMsg(client_handle, msg, vardata_payload, reply)) { + ERR("Something is amiss: RPC_SendReceive failed.\n"); + ret = FALSE; + } + CloseHandle(client_handle); + + return ret; +} + +#define MAX_RPC_ERROR_TEXT 256 + +/****************************************************************************** + * DceErrorInqTextW (rpcrt4.@) + * + * Notes + * 1. On passing a NULL pointer the code does bomb out. + * 2. The size of the required buffer is not defined in the documentation. + * It appears to be 256. + * 3. The function is defined to return RPC_S_INVALID_ARG but I don't know + * of any value for which it does. + * 4. The MSDN documentation currently declares that the second argument is + * unsigned char *, even for the W version. I don't believe it. + */ +RPC_STATUS RPC_ENTRY DceErrorInqTextW (RPC_STATUS e, RPC_WSTR buffer) +{ + DWORD count; + count = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, e, 0, buffer, MAX_RPC_ERROR_TEXT, NULL); + if (!count) + { + count = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, RPC_S_NOT_RPC_ERROR, 0, buffer, MAX_RPC_ERROR_TEXT, NULL); + if (!count) + { + ERR ("Failed to translate error\n"); + return RPC_S_INVALID_ARG; + } + } + return RPC_S_OK; +} + +/****************************************************************************** + * DceErrorInqTextA (rpcrt4.@) + */ +RPC_STATUS RPC_ENTRY DceErrorInqTextA (RPC_STATUS e, RPC_CSTR buffer) +{ + RPC_STATUS status; + WCHAR bufferW [MAX_RPC_ERROR_TEXT]; + if ((status = DceErrorInqTextW (e, bufferW)) == RPC_S_OK) + { + if (!WideCharToMultiByte(CP_ACP, 0, bufferW, -1, (LPSTR)buffer, MAX_RPC_ERROR_TEXT, + NULL, NULL)) + { + ERR ("Failed to translate error\n"); + status = RPC_S_INVALID_ARG; + } + } + return status; +} + +/****************************************************************************** + * I_RpcAllocate (rpcrt4.@) + */ +void * WINAPI I_RpcAllocate(unsigned int Size) +{ + return HeapAlloc(GetProcessHeap(), 0, Size); +} + +/****************************************************************************** + * I_RpcFree (rpcrt4.@) + */ +void WINAPI I_RpcFree(void *Object) +{ + HeapFree(GetProcessHeap(), 0, Object); +} + +/****************************************************************************** + * I_RpcMapWin32Status (rpcrt4.@) + */ +DWORD WINAPI I_RpcMapWin32Status(RPC_STATUS status) +{ + FIXME("(%ld): stub\n", status); + return 0; +} diff --git a/reactos/dll/win32/rpcrt4_new/rpcss_np_client.c b/reactos/dll/win32/rpcrt4_new/rpcss_np_client.c index 016f77f5f15..f2ed65d00bf 100644 --- a/reactos/dll/win32/rpcrt4_new/rpcss_np_client.c +++ b/reactos/dll/win32/rpcrt4_new/rpcss_np_client.c @@ -1,152 +1,152 @@ -/* - * RPCSS named pipe client implementation - * - * Copyright (C) 2002 Greg Turner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "wine/rpcss_shared.h" -#include "wine/debug.h" - -#include "rpc_binding.h" - -WINE_DEFAULT_DEBUG_CHANNEL(ole); - -HANDLE RPCRT4_RpcssNPConnect(void) -{ - HANDLE the_pipe; - DWORD dwmode, wait_result; - HANDLE master_mutex = RPCRT4_GetMasterMutex(); - - TRACE("\n"); - - while (TRUE) { - - wait_result = WaitForSingleObject(master_mutex, MASTER_MUTEX_TIMEOUT); - switch (wait_result) { - case WAIT_ABANDONED: - case WAIT_OBJECT_0: - break; - case WAIT_FAILED: - case WAIT_TIMEOUT: - default: - ERR("This should never happen: couldn't enter mutex.\n"); - return NULL; - } - - /* try to open the client side of the named pipe. */ - the_pipe = CreateFileA( - NAME_RPCSS_NAMED_PIPE, /* pipe name */ - GENERIC_READ | GENERIC_WRITE, /* r/w access */ - 0, /* no sharing */ - NULL, /* no security attributes */ - OPEN_EXISTING, /* open an existing pipe */ - 0, /* default attributes */ - NULL /* no template file */ - ); - - if (the_pipe != INVALID_HANDLE_VALUE) - break; - - if (GetLastError() != ERROR_PIPE_BUSY) { - WARN("Unable to open named pipe %s (assuming unavailable).\n", - debugstr_a(NAME_RPCSS_NAMED_PIPE)); - break; - } - - WARN("Named pipe busy (will wait)\n"); - - if (!ReleaseMutex(master_mutex)) - ERR("Failed to release master mutex. Expect deadlock.\n"); - - /* wait for the named pipe. We are only willing to wait for 5 seconds. - It should be available /very/ soon. */ - if (! WaitNamedPipeA(NAME_RPCSS_NAMED_PIPE, MASTER_MUTEX_WAITNAMEDPIPE_TIMEOUT)) - { - ERR("Named pipe unavailable after waiting. Something is probably wrong.\n"); - break; - } - - } - - if (the_pipe != INVALID_HANDLE_VALUE) { - dwmode = PIPE_READMODE_MESSAGE; - /* SetNamedPipeHandleState not implemented ATM, but still seems to work somehow. */ - if (! SetNamedPipeHandleState(the_pipe, &dwmode, NULL, NULL)) - WARN("Failed to set pipe handle state\n"); - } - - if (!ReleaseMutex(master_mutex)) - ERR("Uh oh, failed to leave the RPC Master Mutex!\n"); - - return the_pipe; -} - -BOOL RPCRT4_SendReceiveNPMsg(HANDLE np, PRPCSS_NP_MESSAGE msg, char *vardata, PRPCSS_NP_REPLY reply) -{ - DWORD count; - UINT32 payload_offset; - RPCSS_NP_MESSAGE vardata_payload_msg; - - TRACE("(np == %p, msg == %p, vardata == %p, reply == %p)\n", - np, msg, vardata, reply); - - if (! WriteFile(np, msg, sizeof(RPCSS_NP_MESSAGE), &count, NULL)) { - ERR("write failed.\n"); - return FALSE; - } - - if (count != sizeof(RPCSS_NP_MESSAGE)) { - ERR("write count mismatch.\n"); - return FALSE; - } - - /* process the vardata payload if necessary */ - vardata_payload_msg.message_type = RPCSS_NP_MESSAGE_TYPEID_VARDATAPAYLOADMSG; - vardata_payload_msg.vardata_payload_size = 0; /* meaningless */ - for ( payload_offset = 0; payload_offset < msg->vardata_payload_size; - payload_offset += VARDATA_PAYLOAD_BYTES ) { - TRACE("sending vardata payload. vd=%p, po=%d, ps=%d\n", vardata, - payload_offset, msg->vardata_payload_size); - ZeroMemory(vardata_payload_msg.message.vardatapayloadmsg.payload, VARDATA_PAYLOAD_BYTES); - CopyMemory(vardata_payload_msg.message.vardatapayloadmsg.payload, - vardata, - min( VARDATA_PAYLOAD_BYTES, msg->vardata_payload_size - payload_offset )); - vardata += VARDATA_PAYLOAD_BYTES; - if (! WriteFile(np, &vardata_payload_msg, sizeof(RPCSS_NP_MESSAGE), &count, NULL)) { - ERR("vardata write failed at %u bytes.\n", payload_offset); - return FALSE; - } - } - - if (! ReadFile(np, reply, sizeof(RPCSS_NP_REPLY), &count, NULL)) { - ERR("read failed.\n"); - return FALSE; - } - - if (count != sizeof(RPCSS_NP_REPLY)) { - ERR("read count mismatch. got %d.\n", count); - return FALSE; - } - - /* message execution was successful */ - return TRUE; -} +/* + * RPCSS named pipe client implementation + * + * Copyright (C) 2002 Greg Turner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "wine/rpcss_shared.h" +#include "wine/debug.h" + +#include "rpc_binding.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +HANDLE RPCRT4_RpcssNPConnect(void) +{ + HANDLE the_pipe; + DWORD dwmode, wait_result; + HANDLE master_mutex = RPCRT4_GetMasterMutex(); + + TRACE("\n"); + + while (TRUE) { + + wait_result = WaitForSingleObject(master_mutex, MASTER_MUTEX_TIMEOUT); + switch (wait_result) { + case WAIT_ABANDONED: + case WAIT_OBJECT_0: + break; + case WAIT_FAILED: + case WAIT_TIMEOUT: + default: + ERR("This should never happen: couldn't enter mutex.\n"); + return NULL; + } + + /* try to open the client side of the named pipe. */ + the_pipe = CreateFileA( + NAME_RPCSS_NAMED_PIPE, /* pipe name */ + GENERIC_READ | GENERIC_WRITE, /* r/w access */ + 0, /* no sharing */ + NULL, /* no security attributes */ + OPEN_EXISTING, /* open an existing pipe */ + 0, /* default attributes */ + NULL /* no template file */ + ); + + if (the_pipe != INVALID_HANDLE_VALUE) + break; + + if (GetLastError() != ERROR_PIPE_BUSY) { + WARN("Unable to open named pipe %s (assuming unavailable).\n", + debugstr_a(NAME_RPCSS_NAMED_PIPE)); + break; + } + + WARN("Named pipe busy (will wait)\n"); + + if (!ReleaseMutex(master_mutex)) + ERR("Failed to release master mutex. Expect deadlock.\n"); + + /* wait for the named pipe. We are only willing to wait for 5 seconds. + It should be available /very/ soon. */ + if (! WaitNamedPipeA(NAME_RPCSS_NAMED_PIPE, MASTER_MUTEX_WAITNAMEDPIPE_TIMEOUT)) + { + ERR("Named pipe unavailable after waiting. Something is probably wrong.\n"); + break; + } + + } + + if (the_pipe != INVALID_HANDLE_VALUE) { + dwmode = PIPE_READMODE_MESSAGE; + /* SetNamedPipeHandleState not implemented ATM, but still seems to work somehow. */ + if (! SetNamedPipeHandleState(the_pipe, &dwmode, NULL, NULL)) + WARN("Failed to set pipe handle state\n"); + } + + if (!ReleaseMutex(master_mutex)) + ERR("Uh oh, failed to leave the RPC Master Mutex!\n"); + + return the_pipe; +} + +BOOL RPCRT4_SendReceiveNPMsg(HANDLE np, PRPCSS_NP_MESSAGE msg, char *vardata, PRPCSS_NP_REPLY reply) +{ + DWORD count; + UINT32 payload_offset; + RPCSS_NP_MESSAGE vardata_payload_msg; + + TRACE("(np == %p, msg == %p, vardata == %p, reply == %p)\n", + np, msg, vardata, reply); + + if (! WriteFile(np, msg, sizeof(RPCSS_NP_MESSAGE), &count, NULL)) { + ERR("write failed.\n"); + return FALSE; + } + + if (count != sizeof(RPCSS_NP_MESSAGE)) { + ERR("write count mismatch.\n"); + return FALSE; + } + + /* process the vardata payload if necessary */ + vardata_payload_msg.message_type = RPCSS_NP_MESSAGE_TYPEID_VARDATAPAYLOADMSG; + vardata_payload_msg.vardata_payload_size = 0; /* meaningless */ + for ( payload_offset = 0; payload_offset < msg->vardata_payload_size; + payload_offset += VARDATA_PAYLOAD_BYTES ) { + TRACE("sending vardata payload. vd=%p, po=%d, ps=%d\n", vardata, + payload_offset, msg->vardata_payload_size); + ZeroMemory(vardata_payload_msg.message.vardatapayloadmsg.payload, VARDATA_PAYLOAD_BYTES); + CopyMemory(vardata_payload_msg.message.vardatapayloadmsg.payload, + vardata, + min( VARDATA_PAYLOAD_BYTES, msg->vardata_payload_size - payload_offset )); + vardata += VARDATA_PAYLOAD_BYTES; + if (! WriteFile(np, &vardata_payload_msg, sizeof(RPCSS_NP_MESSAGE), &count, NULL)) { + ERR("vardata write failed at %u bytes.\n", payload_offset); + return FALSE; + } + } + + if (! ReadFile(np, reply, sizeof(RPCSS_NP_REPLY), &count, NULL)) { + ERR("read failed.\n"); + return FALSE; + } + + if (count != sizeof(RPCSS_NP_REPLY)) { + ERR("read count mismatch. got %d.\n", count); + return FALSE; + } + + /* message execution was successful */ + return TRUE; +} diff --git a/reactos/dll/win32/rpcrt4_new/rpcss_np_client.h b/reactos/dll/win32/rpcrt4_new/rpcss_np_client.h index db65d432bca..5b21cfe2869 100644 --- a/reactos/dll/win32/rpcrt4_new/rpcss_np_client.h +++ b/reactos/dll/win32/rpcrt4_new/rpcss_np_client.h @@ -1,26 +1,26 @@ -/* - * Copyright (C) 2002 Greg Turner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_RPCSS_NP_CLIENT_H -#define __WINE_RPCSS_NP_CLIENT_H - -/* rpcss_np_client.c */ -HANDLE RPC_RpcssNPConnect(void); -BOOL RPCRT4_SendReceiveNPMsg(HANDLE, PRPCSS_NP_MESSAGE, char *, PRPCSS_NP_REPLY); - -#endif /* __RPCSS_NP_CLINET_H */ +/* + * Copyright (C) 2002 Greg Turner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_RPCSS_NP_CLIENT_H +#define __WINE_RPCSS_NP_CLIENT_H + +/* rpcss_np_client.c */ +HANDLE RPC_RpcssNPConnect(void); +BOOL RPCRT4_SendReceiveNPMsg(HANDLE, PRPCSS_NP_MESSAGE, char *, PRPCSS_NP_REPLY); + +#endif /* __RPCSS_NP_CLINET_H */ diff --git a/reactos/dll/win32/rpcrt4_new/unix_func.c b/reactos/dll/win32/rpcrt4_new/unix_func.c index 490f10c9ac0..7ccc7429a72 100644 --- a/reactos/dll/win32/rpcrt4_new/unix_func.c +++ b/reactos/dll/win32/rpcrt4_new/unix_func.c @@ -55,7 +55,7 @@ poll(struct pollfd *fds, } rc = select(++n, ip, op, &efds, toptr); - + if (rc <= 0) return rc; diff --git a/reactos/dll/win32/rpcrt4_new/unix_func.h b/reactos/dll/win32/rpcrt4_new/unix_func.h index bfdad0df270..49d4b2b79d0 100644 --- a/reactos/dll/win32/rpcrt4_new/unix_func.h +++ b/reactos/dll/win32/rpcrt4_new/unix_func.h @@ -5,15 +5,15 @@ #define POLLNORM POLLIN #define POLLERR 010 #define POLLHUP 020 -#define POLLNVAL 040 - -struct pollfd -{ - int fd; /* file descriptor */ - short events; /* requested events */ - short revents; /* returned events */ -}; - -int poll(struct pollfd *fds, unsigned long nfds, int timo); -int socketpair (int af, int type, int protocol, SOCKET socket[2]); -const char * inet_ntop (int af, const void *src, char *dst, size_t cnt); +#define POLLNVAL 040 + +struct pollfd +{ + int fd; /* file descriptor */ + short events; /* requested events */ + short revents; /* returned events */ +}; + +int poll(struct pollfd *fds, unsigned long nfds, int timo); +int socketpair (int af, int type, int protocol, SOCKET socket[2]); +const char * inet_ntop (int af, const void *src, char *dst, size_t cnt); diff --git a/reactos/dll/win32/secur32/dllmain.c b/reactos/dll/win32/secur32/dllmain.c index 11f8ed78ca8..b50c74d2a03 100644 --- a/reactos/dll/win32/secur32/dllmain.c +++ b/reactos/dll/win32/secur32/dllmain.c @@ -28,7 +28,7 @@ BOOL STDCALL DllMain(HINSTANCE hInstance, ULONG Reason, PVOID Reserved) return(FALSE); } break; - + case DLL_PROCESS_DETACH: if (!RtlDestroyHeap(Secur32Heap)) { diff --git a/reactos/dll/win32/secur32/lsa.c b/reactos/dll/win32/secur32/lsa.c index 49d5834fca0..b8ff26041c1 100644 --- a/reactos/dll/win32/secur32/lsa.c +++ b/reactos/dll/win32/secur32/lsa.c @@ -27,7 +27,7 @@ LsaDeregisterLogonProcess(HANDLE LsaHandle) LSASS_REQUEST Request; LSASS_REPLY Reply; NTSTATUS Status; - + Request.Header.u1.s1.DataLength = 0; Request.Header.u1.s1.TotalLength = sizeof(LSASS_REQUEST); Request.Type = LSASS_REQUEST_DEREGISTER_LOGON_PROCESS; @@ -38,12 +38,12 @@ LsaDeregisterLogonProcess(HANDLE LsaHandle) { return(Status); } - + if (!NT_SUCCESS(Reply.Status)) { return(Reply.Status); } - + return(Status); } @@ -77,10 +77,10 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle, Request = (PLSASS_REQUEST)&RawRequest; Reply = (PLSASS_REPLY)&RawReply; - + Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + SubmitBufferLength - sizeof(PORT_MESSAGE); - Request->Header.u1.s1.TotalLength = + Request->Header.u1.s1.TotalLength = Request->Header.u1.s1.DataLength + sizeof(PORT_MESSAGE); Request->Type = LSASS_REQUEST_CALL_AUTHENTICATION_PACKAGE; Request->d.CallAuthenticationPackageRequest.AuthenticationPackage = @@ -90,7 +90,7 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle, memcpy(Request->d.CallAuthenticationPackageRequest.InBuffer, ProtocolSubmitBuffer, SubmitBufferLength); - + Status = NtRequestWaitReplyPort(LsaHandle, &Request->Header, &Reply->Header); @@ -98,12 +98,12 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle, { return(Status); } - + if (!NT_SUCCESS(Reply->Status)) { return(Reply->Status); } - + OutBufferSize = Reply->d.CallAuthenticationPackageReply.OutBufferLength; *ProtocolReturnBuffer = RtlAllocateHeap(Secur32Heap, 0, @@ -112,7 +112,7 @@ LsaCallAuthenticationPackage(HANDLE LsaHandle, memcpy(*ProtocolReturnBuffer, Reply->d.CallAuthenticationPackageReply.OutBuffer, *ReturnBufferLength); - + return(Status); } @@ -139,14 +139,14 @@ LsaLookupAuthenticationPackage(HANDLE LsaHandle, PLSASS_REQUEST Request; LSASS_REQUEST RawRequest; LSASS_REPLY Reply; - + Request = (PLSASS_REQUEST)&RawRequest; Request->Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) + PackageName->Length - sizeof(PORT_MESSAGE); Request->Header.u1.s1.TotalLength = Request->Header.u1.s1.DataLength + sizeof(PORT_MESSAGE); Request->Type = LSASS_REQUEST_LOOKUP_AUTHENTICATION_PACKAGE; - + Status = NtRequestWaitReplyPort(LsaHandle, &Request->Header, &Reply.Header); @@ -158,9 +158,9 @@ LsaLookupAuthenticationPackage(HANDLE LsaHandle, { return(Reply.Status); } - + *AuthenticationPackage = Reply.d.LookupAuthenticationPackageReply.Package; - + return(Reply.Status); } @@ -191,29 +191,29 @@ LsaLogonUser(HANDLE LsaHandle, PLSASS_REPLY Reply; LSASS_REPLY RawReply; NTSTATUS Status; - + RequestLength = sizeof(LSASS_REQUEST) - sizeof(PORT_MESSAGE); RequestLength = RequestLength + (OriginName->Length * sizeof(WCHAR)); RequestLength = RequestLength + AuthenticationInformationLength; - RequestLength = RequestLength + + RequestLength = RequestLength + (LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES)); - + CurrentLength = 0; Request = (PLSASS_REQUEST)&RawMessage; - + Request->d.LogonUserRequest.OriginNameLength = OriginName->Length; Request->d.LogonUserRequest.OriginName = (PWSTR)&RawMessage + CurrentLength; memcpy((PWSTR)&RawMessage + CurrentLength, OriginName->Buffer, OriginName->Length * sizeof(WCHAR)); CurrentLength = CurrentLength + (OriginName->Length * sizeof(WCHAR)); - + Request->d.LogonUserRequest.LogonType = LogonType; - + Request->d.LogonUserRequest.AuthenticationPackage = AuthenticationPackage; - - Request->d.LogonUserRequest.AuthenticationInformation = + + Request->d.LogonUserRequest.AuthenticationInformation = (PVOID)((ULONG_PTR)&RawMessage + CurrentLength); Request->d.LogonUserRequest.AuthenticationInformationLength = AuthenticationInformationLength; @@ -221,22 +221,22 @@ LsaLogonUser(HANDLE LsaHandle, AuthenticationInformation, AuthenticationInformationLength); CurrentLength = CurrentLength + AuthenticationInformationLength; - + Request->d.LogonUserRequest.LocalGroupsCount = LocalGroups->GroupCount; - Request->d.LogonUserRequest.LocalGroups = + Request->d.LogonUserRequest.LocalGroups = (PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength; memcpy((PSID_AND_ATTRIBUTES)&RawMessage + CurrentLength, LocalGroups->Groups, LocalGroups->GroupCount * sizeof(SID_AND_ATTRIBUTES)); - + Request->d.LogonUserRequest.SourceContext = *SourceContext; - + Request->Type = LSASS_REQUEST_LOGON_USER; Request->Header.u1.s1.DataLength = RequestLength - sizeof(PORT_MESSAGE); Request->Header.u1.s1.TotalLength = RequestLength + sizeof(PORT_MESSAGE); - + Reply = (PLSASS_REPLY)&RawReply; - + Status = NtRequestWaitReplyPort(LsaHandle, &Request->Header, &Reply->Header); @@ -246,12 +246,12 @@ LsaLogonUser(HANDLE LsaHandle, } *SubStatus = Reply->d.LogonUserReply.SubStatus; - + if (!NT_SUCCESS(Reply->Status)) { return(Status); } - + *ProfileBuffer = RtlAllocateHeap(Secur32Heap, 0, Reply->d.LogonUserReply.ProfileBufferLength); @@ -261,10 +261,10 @@ LsaLogonUser(HANDLE LsaHandle, Reply->d.LogonUserReply.ProfileBufferLength); *LogonId = Reply->d.LogonUserReply.LogonId; *Token = Reply->d.LogonUserReply.Token; - memcpy(Quotas, + memcpy(Quotas, &Reply->d.LogonUserReply.Quotas, sizeof(Reply->d.LogonUserReply.Quotas)); - + return(Status); } @@ -296,17 +296,17 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName, { return(Status); } - + Request.Type = LSASS_REQUEST_REGISTER_LOGON_PROCESS; - Request.Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) - + Request.Header.u1.s1.DataLength = sizeof(LSASS_REQUEST) - sizeof(PORT_MESSAGE); Request.Header.u1.s1.TotalLength = sizeof(LSASS_REQUEST); - + Request.d.RegisterLogonProcessRequest.Length = LsaLogonProcessName->Length; memcpy(Request.d.RegisterLogonProcessRequest.LogonProcessNameBuffer, LsaLogonProcessName->Buffer, Request.d.RegisterLogonProcessRequest.Length); - + Status = NtRequestWaitReplyPort(*Handle, &Request.Header, &Reply.Header); @@ -316,16 +316,16 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName, *Handle = INVALID_HANDLE_VALUE; return(Status); } - + if (!NT_SUCCESS(Reply.Status)) { NtClose(*Handle); *Handle = INVALID_HANDLE_VALUE; return(Status); } - + *OperationalMode = Reply.d.RegisterLogonProcessReply.OperationalMode; - + return(Reply.Status); } diff --git a/reactos/dll/win32/secur32/sspi.c b/reactos/dll/win32/secur32/sspi.c index 408a21cf9ce..54586f8a7a3 100644 --- a/reactos/dll/win32/secur32/sspi.c +++ b/reactos/dll/win32/secur32/sspi.c @@ -122,7 +122,7 @@ QueryContextAttributesW(PCtxtHandle Handle, SECURITY_STATUS WINAPI -AcquireCredentialsHandleA ( +AcquireCredentialsHandleA ( SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fUsage, @@ -140,7 +140,7 @@ AcquireCredentialsHandleA ( SECURITY_STATUS WINAPI -AcquireCredentialsHandleW ( +AcquireCredentialsHandleW ( SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fUsage, @@ -159,7 +159,7 @@ AcquireCredentialsHandleW ( SECURITY_STATUS WINAPI -InitializeSecurityContextA ( +InitializeSecurityContextA ( PCredHandle phCred, PCtxtHandle phContext, SEC_CHAR* pszTarget, diff --git a/reactos/dll/win32/serialui/lang/pl-PL.rc b/reactos/dll/win32/serialui/lang/pl-PL.rc index f63378b2456..a0a4a742819 100644 --- a/reactos/dll/win32/serialui/lang/pl-PL.rc +++ b/reactos/dll/win32/serialui/lang/pl-PL.rc @@ -25,7 +25,7 @@ BEGIN IDS_TITLE, "W³aœciwoœci dla: %s" END -IDD_COMMDLG DIALOGEX 6,5,222,175 +IDD_COMMDLG DIALOGEX 6,5,222,175 FONT 8, "MS Shell Dlg" STYLE 0x10C80080 EXSTYLE 0x00000001 diff --git a/reactos/dll/win32/serialui/serialui.c b/reactos/dll/win32/serialui/serialui.c index 0cbfaf489cd..682b0badd0b 100644 --- a/reactos/dll/win32/serialui/serialui.c +++ b/reactos/dll/win32/serialui/serialui.c @@ -382,7 +382,7 @@ VOID OkButton(HWND hDlg) /* Stop bits */ Index = SendMessageW(GetDlgItem(hDlg, IDC_STOPBITS), CB_GETCURSEL, 0, 0); lpDlgInfo->lpCC->dcb.StopBits = StopBits[Index].StopBit; - + /* Flow Control */ Index = SendMessageW(GetDlgItem(hDlg, IDC_FLOW), CB_GETCURSEL, 0, 0); if(lpDlgInfo->InitialFlowIndex != Index) diff --git a/reactos/dll/win32/serialui/serialui.def b/reactos/dll/win32/serialui/serialui.def index 5bc05184a2f..79883898b7b 100644 --- a/reactos/dll/win32/serialui/serialui.def +++ b/reactos/dll/win32/serialui/serialui.def @@ -5,6 +5,6 @@ drvCommConfigDialogW drvCommConfigDialogA drvSetDefaultCommConfigW drvSetDefaultCommConfigA -drvGetDefaultCommConfigW +drvGetDefaultCommConfigW drvGetDefaultCommConfigA diff --git a/reactos/dll/win32/setupapi/dirid.c b/reactos/dll/win32/setupapi/dirid.c index 3f9f94cbf99..3dbd485243b 100644 --- a/reactos/dll/win32/setupapi/dirid.c +++ b/reactos/dll/win32/setupapi/dirid.c @@ -199,7 +199,7 @@ static BOOL store_user_dirid( HINF hinf, int id, WCHAR *str ) new = HeapReAlloc( GetProcessHeap(), 0, user_dirids, new_size * sizeof(*new) ); else - new = HeapAlloc( GetProcessHeap(), 0, + new = HeapAlloc( GetProcessHeap(), 0, new_size * sizeof(*new) ); if (!new) return FALSE; diff --git a/reactos/dll/win32/setupapi/diskspace.c b/reactos/dll/win32/setupapi/diskspace.c index f246e5e15d5..9edaf5d3d10 100644 --- a/reactos/dll/win32/setupapi/diskspace.c +++ b/reactos/dll/win32/setupapi/diskspace.c @@ -52,9 +52,9 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListW(PVOID Reserved1, DWORD Reserved2, UINT list = HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST)); list->dwDriveCount = 0; - + ptr = drives; - + while (*ptr) { DWORD type = GetDriveTypeW(ptr); @@ -89,8 +89,8 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListA(PVOID Reserved1, DWORD Reserved2, UINT /*********************************************************************** * SetupAddInstallSectionToDiskSpaceListA (SETUPAPI.@) */ -BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace, - HINF InfHandle, HINF LayoutInfHandle, +BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace, + HINF InfHandle, HINF LayoutInfHandle, LPCSTR SectionName, PVOID Reserved1, UINT Reserved2) { FIXME ("Stub\n"); @@ -100,8 +100,8 @@ BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace, /*********************************************************************** * SetupQuerySpaceRequiredOnDriveA (SETUPAPI.@) */ -BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace, - LPCSTR DriveSpec, LONGLONG* SpaceRequired, +BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace, + LPCSTR DriveSpec, LONGLONG* SpaceRequired, PVOID Reserved1, UINT Reserved2) { WCHAR driveW[20]; @@ -115,7 +115,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace, lstrcatW(driveW,bkslsh); TRACE("Looking for drive %s\n",debugstr_w(driveW)); - + for (i = 0; i < list->dwDriveCount; i++) { TRACE("checking drive %s\n",debugstr_w(list->Drives[i].lpzName)); @@ -137,5 +137,5 @@ BOOL WINAPI SetupDestroyDiskSpaceList(HDSKSPC DiskSpace) { LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace; HeapFree(GetProcessHeap(),0,list); - return TRUE; + return TRUE; } diff --git a/reactos/dll/win32/setupapi/driver.c b/reactos/dll/win32/setupapi/driver.c index 9d365c1154b..5e448928a21 100644 --- a/reactos/dll/win32/setupapi/driver.c +++ b/reactos/dll/win32/setupapi/driver.c @@ -621,7 +621,7 @@ RegpApplyRestrictions( DWORD dwFlags, DWORD dwType, DWORD cbData, } static LONG WINAPI -RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, +RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData ) { @@ -629,7 +629,7 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, PVOID pvBuf = NULL; LONG ret; - TRACE("(%p,%s,%s,%ld,%p,%p,%p=%ld)\n", + TRACE("(%p,%s,%s,%ld,%p,%p,%p=%ld)\n", hKey, debugstr_w(pszSubKey), debugstr_w(pszValue), dwFlags, pdwType, pvData, pcbData, cbData); @@ -643,7 +643,7 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, } ret = RegQueryValueExW(hKey, pszValue, NULL, &dwType, pvData, &cbData); - + /* If we are going to expand we need to read in the whole the value even * if the passed buffer was too small as the expanded string might be * smaller than the unexpanded one and could fit into cbData bytes. */ @@ -652,7 +652,7 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, { do { if (pvBuf) HeapFree(GetProcessHeap(), 0, pvBuf); - + pvBuf = HeapAlloc(GetProcessHeap(), 0, cbData); if (!pvBuf) { @@ -661,11 +661,11 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, } if (ret == ERROR_MORE_DATA) - ret = RegQueryValueExW(hKey, pszValue, NULL, + ret = RegQueryValueExW(hKey, pszValue, NULL, &dwType, pvBuf, &cbData); else { - /* Even if cbData was large enough we have to copy the + /* Even if cbData was large enough we have to copy the * string since ExpandEnvironmentStrings can't handle * overlapping buffers. */ CopyMemory(pvBuf, pvData, cbData); diff --git a/reactos/dll/win32/setupapi/query.c b/reactos/dll/win32/setupapi/query.c index 90820710e91..ae39b6beb2e 100644 --- a/reactos/dll/win32/setupapi/query.c +++ b/reactos/dll/win32/setupapi/query.c @@ -114,7 +114,7 @@ BOOL WINAPI SetupGetInfInformationA(LPCVOID InfSpec, DWORD SearchControl, /*********************************************************************** * SetupGetInfInformationW (SETUPAPI.@) - * + * * BUGS * Only handles the case when InfSpec is an INF handle. */ @@ -240,7 +240,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation, */ BOOL WINAPI SetupQueryInfFileInformationW(PSP_INF_INFORMATION InfInformation, UINT InfIndex, PWSTR ReturnBuffer, - DWORD ReturnBufferSize, PDWORD RequiredSize) + DWORD ReturnBufferSize, PDWORD RequiredSize) { DWORD len; LPWSTR ptr; diff --git a/reactos/dll/win32/setupapi/queue.c b/reactos/dll/win32/setupapi/queue.c index 60d8d5ac00c..171e4136ff9 100644 --- a/reactos/dll/win32/setupapi/queue.c +++ b/reactos/dll/win32/setupapi/queue.c @@ -1571,9 +1571,9 @@ UINT WINAPI SetupRenameErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR source, * SetupCopyErrorA (SETUPAPI.@) */ -UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname, +UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname, PCSTR sourcepath, PCSTR sourcefile, PCSTR targetpath, - UINT w32error, DWORD style, PSTR pathbuffer, + UINT w32error, DWORD style, PSTR pathbuffer, DWORD buffersize, PDWORD requiredsize) { FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n", @@ -1585,9 +1585,9 @@ UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname, * SetupCopyErrorW (SETUPAPI.@) */ -UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname, +UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname, PCWSTR sourcepath, PCWSTR sourcefile, PCWSTR targetpath, - UINT w32error, DWORD style, PWSTR pathbuffer, + UINT w32error, DWORD style, PWSTR pathbuffer, DWORD buffersize, PDWORD requiredsize) { FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n", diff --git a/reactos/dll/win32/setupapi/res/lang/Cs.rc b/reactos/dll/win32/setupapi/res/lang/Cs.rc index 9f30d3defcf..ca8b09def91 100644 --- a/reactos/dll/win32/setupapi/res/lang/Cs.rc +++ b/reactos/dll/win32/setupapi/res/lang/Cs.rc @@ -4,7 +4,7 @@ * * Copyright 2001 Andreas Mohr * Copyright 2004 David Kredba - * + * * 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/reactos/dll/win32/setupapi/setupapi_private.h b/reactos/dll/win32/setupapi/setupapi_private.h index 919a9de1c2f..7d991fcc6e1 100644 --- a/reactos/dll/win32/setupapi/setupapi_private.h +++ b/reactos/dll/win32/setupapi/setupapi_private.h @@ -61,7 +61,7 @@ struct DeviceInterface /* Element of DeviceInfoElement.InterfaceListHead */ struct DeviceInfoElement* DeviceInfo; GUID InterfaceClassGuid; - + /* SPINT_ACTIVE : the interface is active/enabled * SPINT_DEFAULT: the interface is the default interface for the device class * SPINT_REMOVED: the interface is removed diff --git a/reactos/dll/win32/shdocvw/factory.c b/reactos/dll/win32/shdocvw/factory.c index 7770b4d551f..6a1843c9174 100644 --- a/reactos/dll/win32/shdocvw/factory.c +++ b/reactos/dll/win32/shdocvw/factory.c @@ -92,7 +92,7 @@ static HRESULT WINAPI WBCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) SHDOCVW_LockModule(); else SHDOCVW_UnlockModule(); - + return S_OK; } diff --git a/reactos/dll/win32/shdocvw/shdocvw.h b/reactos/dll/win32/shdocvw/shdocvw.h index 735c1c469b2..5b8eb507663 100644 --- a/reactos/dll/win32/shdocvw/shdocvw.h +++ b/reactos/dll/win32/shdocvw/shdocvw.h @@ -52,7 +52,7 @@ extern IClassFactoryImpl SHDOCVW_ClassFactory; /********************************************************************** * Shell Instance Objects */ -extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, +extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvClassObj); /********************************************************************** diff --git a/reactos/dll/win32/shdocvw/shdocvw_main.c b/reactos/dll/win32/shdocvw/shdocvw_main.c index cd86cfe984c..b1d83d4cce5 100644 --- a/reactos/dll/win32/shdocvw/shdocvw_main.c +++ b/reactos/dll/win32/shdocvw/shdocvw_main.c @@ -161,7 +161,7 @@ static HRESULT WINAPI dlQueryInterface( IBindStatusCallback* This, REFIID riid, void** ppvObject ) { if (ppvObject == NULL) return E_POINTER; - + if( IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IBindStatusCallback)) { @@ -177,7 +177,7 @@ static ULONG WINAPI dlAddRef( IBindStatusCallback* iface ) IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; SHDOCVW_LockModule(); - + return InterlockedIncrement( &This->ref ); } @@ -185,7 +185,7 @@ static ULONG WINAPI dlRelease( IBindStatusCallback* iface ) { IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface; DWORD ref = InterlockedDecrement( &This->ref ); - + if( !ref ) { DestroyWindow( This->hDialog ); @@ -193,7 +193,7 @@ static ULONG WINAPI dlRelease( IBindStatusCallback* iface ) } SHDOCVW_UnlockModule(); - + return ref; } @@ -427,7 +427,7 @@ static BOOL SHDOCVW_TryDownloadMozillaControl(void) return ret; } - + static BOOL SHDOCVW_TryLoadMozillaControl(void) { WCHAR szPath[MAX_PATH]; diff --git a/reactos/dll/win32/shdocvw/shlinstobj.c b/reactos/dll/win32/shdocvw/shlinstobj.c index 19ba3b84fae..60593af4791 100644 --- a/reactos/dll/win32/shdocvw/shlinstobj.c +++ b/reactos/dll/win32/shdocvw/shlinstobj.c @@ -1,4 +1,4 @@ -/* +/* * Shell Instance Objects - Add hot water and stir until dissolved. * * Copyright 2005 Michael Jung @@ -46,7 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw); #define CHARS_IN_GUID 39 /****************************************************************************** - * RegistryPropertyBag + * RegistryPropertyBag * * Gives access to a registry key's values via the IPropertyBag interface. */ @@ -106,7 +106,7 @@ static ULONG WINAPI RegistryPropertyBag_IPropertyBag_Release(IPropertyBag *iface cRef = InterlockedDecrement(&This->m_cRef); - if (cRef == 0) { + if (cRef == 0) { RegistryPropertyBag_Destroy(This); SHDOCVW_UnlockModule(); } @@ -124,18 +124,18 @@ static HRESULT WINAPI RegistryPropertyBag_IPropertyBag_Read(IPropertyBag *iface, VARTYPE vtDst = V_VT(pVar); HRESULT hr = S_OK; - TRACE("(iface=%p, pwszPropName=%s, pVar=%p, pErrorLog=%p)\n", iface, debugstr_w(pwszPropName), + TRACE("(iface=%p, pwszPropName=%s, pVar=%p, pErrorLog=%p)\n", iface, debugstr_w(pwszPropName), pVar, pErrorLog); res = RegQueryValueExW(This->m_hInitPropertyBagKey, pwszPropName, NULL, &dwType, NULL, &cbData); - if (res != ERROR_SUCCESS) + if (res != ERROR_SUCCESS) return E_INVALIDARG; pwszValue = HeapAlloc(GetProcessHeap(), 0, cbData); if (!pwszValue) return E_OUTOFMEMORY; - - res = RegQueryValueExW(This->m_hInitPropertyBagKey, pwszPropName, NULL, &dwType, + + res = RegQueryValueExW(This->m_hInitPropertyBagKey, pwszPropName, NULL, &dwType, (LPBYTE)pwszValue, &cbData); if (res != ERROR_SUCCESS) { HeapFree(GetProcessHeap(), 0, pwszValue); @@ -152,10 +152,10 @@ static HRESULT WINAPI RegistryPropertyBag_IPropertyBag_Read(IPropertyBag *iface, SysFreeString(V_BSTR(pVar)); } - return hr; + return hr; } -static HRESULT WINAPI RegistryPropertyBag_IPropertyBag_Write(IPropertyBag *iface, +static HRESULT WINAPI RegistryPropertyBag_IPropertyBag_Write(IPropertyBag *iface, LPCOLESTR pwszPropName, VARIANT *pVar) { FIXME("(iface=%p, pwszPropName=%s, pVar=%p) stub\n", iface, debugstr_w(pwszPropName), pVar); @@ -174,9 +174,9 @@ HRESULT RegistryPropertyBag_Constructor(HKEY hInitPropertyBagKey, REFIID riid, L HRESULT hr = E_FAIL; RegistryPropertyBag *pRegistryPropertyBag; - TRACE("(hInitPropertyBagKey=%p, riid=%s, ppvObject=%p)\n", hInitPropertyBagKey, + TRACE("(hInitPropertyBagKey=%p, riid=%s, ppvObject=%p)\n", hInitPropertyBagKey, debugstr_guid(riid), ppvObject); - + pRegistryPropertyBag = HeapAlloc(GetProcessHeap(), 0, sizeof(RegistryPropertyBag)); if (pRegistryPropertyBag) { pRegistryPropertyBag->lpIPropertyBagVtbl = &RegistryPropertyBag_IPropertyBagVtbl; @@ -210,7 +210,7 @@ static void InstanceObjectFactory_Destroy(InstanceObjectFactory *This) { HeapFree(GetProcessHeap(), 0, This); } -static HRESULT WINAPI InstanceObjectFactory_IClassFactory_QueryInterface(IClassFactory *iface, +static HRESULT WINAPI InstanceObjectFactory_IClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID* ppv) { InstanceObjectFactory *This = ADJUST_THIS(InstanceObjectFactory, IClassFactory, iface); @@ -230,7 +230,7 @@ static HRESULT WINAPI InstanceObjectFactory_IClassFactory_QueryInterface(IClassF IUnknown_AddRef((IUnknown*)*ppv); return S_OK; } - + static ULONG WINAPI InstanceObjectFactory_IClassFactory_AddRef(IClassFactory *iface) { InstanceObjectFactory *This = ADJUST_THIS(InstanceObjectFactory, IClassFactory, iface); @@ -255,7 +255,7 @@ static ULONG WINAPI InstanceObjectFactory_IClassFactory_Release(IClassFactory *i cRef = InterlockedDecrement(&This->m_cRef); - if (cRef == 0) { + if (cRef == 0) { IClassFactory_LockServer(iface, FALSE); InstanceObjectFactory_Destroy(This); } @@ -269,13 +269,13 @@ static HRESULT WINAPI InstanceObjectFactory_IClassFactory_CreateInstance(IClassF InstanceObjectFactory *This = ADJUST_THIS(InstanceObjectFactory, IClassFactory, iface); IPersistPropertyBag *pPersistPropertyBag; HRESULT hr; - + TRACE("(pUnkOuter=%p, riid=%s, ppvObj=%p)\n", pUnkOuter, debugstr_guid(riid), ppvObj); - + hr = CoCreateInstance(&This->m_clsidInstance, NULL, CLSCTX_INPROC_SERVER, &IID_IPersistPropertyBag, (LPVOID*)&pPersistPropertyBag); if (FAILED(hr)) { - TRACE("Failed to create instance of %s. hr = %08lx\n", + TRACE("Failed to create instance of %s. hr = %08lx\n", debugstr_guid(&This->m_clsidInstance), hr); return hr; } @@ -293,7 +293,7 @@ static HRESULT WINAPI InstanceObjectFactory_IClassFactory_CreateInstance(IClassF return hr; } -static HRESULT WINAPI InstanceObjectFactory_IClassFactory_LockServer(IClassFactory *iface, +static HRESULT WINAPI InstanceObjectFactory_IClassFactory_LockServer(IClassFactory *iface, BOOL fLock) { TRACE("(iface=%p, fLock=%d) stub\n", iface, fLock); @@ -303,7 +303,7 @@ static HRESULT WINAPI InstanceObjectFactory_IClassFactory_LockServer(IClassFacto else SHDOCVW_UnlockModule(); - return S_OK; + return S_OK; } static const IClassFactoryVtbl InstanceObjectFactory_IClassFactoryVtbl = { @@ -355,14 +355,14 @@ HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *pProper * Success: S_OK, * Failure: CLASS_E_CLASSNOTAVAILABLE */ -HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid, +HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvClassObj) { WCHAR wszInstanceKey[] = { 'C','L','S','I','D','\\','{','0','0','0','0','0','0','0','0','-', '0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0', '0','0','0','0','}','\\','I','n','s','t','a','n','c','e', 0 }; const WCHAR wszCLSID[] = { 'C','L','S','I','D',0 }; - const WCHAR wszInitPropertyBag[] = + const WCHAR wszInitPropertyBag[] = { 'I','n','i','t','P','r','o','p','e','r','t','y','B','a','g',0 }; WCHAR wszCLSIDInstance[CHARS_IN_GUID]; CLSID clsidInstance; @@ -371,8 +371,8 @@ HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid, IPropertyBag *pInitPropertyBag; HRESULT hr; LONG res; - - TRACE("(rclsid=%s, riid=%s, ppvClassObject=%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), + + TRACE("(rclsid=%s, riid=%s, ppvClassObject=%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppvClassObj); /* Figure if there is an 'Instance' subkey for the given CLSID and aquire a handle. */ @@ -403,9 +403,9 @@ HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid, return CLASS_E_CLASSNOTAVAILABLE; } - /* If the construction succeeds, the new RegistryPropertyBag is responsible for closing + /* If the construction succeeds, the new RegistryPropertyBag is responsible for closing * hInitProperyBagKey. */ - hr = RegistryPropertyBag_Constructor(hInitPropertyBagKey, &IID_IPropertyBag, + hr = RegistryPropertyBag_Constructor(hInitPropertyBagKey, &IID_IPropertyBag, (LPVOID*)&pInitPropertyBag); if (FAILED(hr)) { RegCloseKey(hInitPropertyBagKey); @@ -416,6 +416,6 @@ HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid, * and asks them to initialize themselves with the help of the 'pInitiPropertyBag' */ hr = InstanceObjectFactory_Constructor(&clsidInstance, pInitPropertyBag, riid, ppvClassObj); IPropertyBag_Release(pInitPropertyBag); /* The factory will hold a reference the bag. */ - + return hr; } diff --git a/reactos/dll/win32/shdocvw/webbrowser.c b/reactos/dll/win32/shdocvw/webbrowser.c index 81109505899..5d155179a3f 100644 --- a/reactos/dll/win32/shdocvw/webbrowser.c +++ b/reactos/dll/win32/shdocvw/webbrowser.c @@ -515,9 +515,9 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA if(!This->client) return E_FAIL; - if((Flags && V_VT(Flags) != VT_EMPTY) + if((Flags && V_VT(Flags) != VT_EMPTY) || (TargetFrameName && V_VT(TargetFrameName) != VT_EMPTY) - || (PostData && V_VT(PostData) != VT_EMPTY) + || (PostData && V_VT(PostData) != VT_EMPTY) || (Headers && V_VT(Headers) != VT_EMPTY)) FIXME("Unsupported arguments\n"); diff --git a/reactos/dll/win32/shell32/autocomplete.c b/reactos/dll/win32/shell32/autocomplete.c index 23c5923c030..985400cf035 100644 --- a/reactos/dll/win32/shell32/autocomplete.c +++ b/reactos/dll/win32/shell32/autocomplete.c @@ -31,7 +31,7 @@ - implement ACO_FILTERPREFIXES style - implement ACO_USETAB style - implement ACO_RTLREADING style - + */ #include "config.h" @@ -88,7 +88,7 @@ static inline IAutoCompleteImpl *impl_from_IAutoComplete2( IAutoComplete2 *iface converts This to an interface pointer */ #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IAutoComplete2_(This) (IAutoComplete2*)&(This->lpvtblAutoComplete2) +#define _IAutoComplete2_(This) (IAutoComplete2*)&(This->lpvtblAutoComplete2) static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -104,7 +104,7 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO return CLASS_E_NOAGGREGATION; lpac = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl)); - if (!lpac) + if (!lpac) return E_OUTOFMEMORY; lpac->ref = 1; @@ -117,12 +117,12 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO lpac->hwndListBox = NULL; lpac->txtbackup = NULL; lpac->quickComplete = NULL; - + if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (lpac), riid, ppv))) { IUnknown_Release (_IUnknown_ (lpac)); return E_NOINTERFACE; } - + TRACE("-- (%p)->\n",lpac); return S_OK; @@ -137,14 +137,14 @@ static HRESULT WINAPI IAutoComplete_fnQueryInterface( LPVOID *ppvObj) { IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface; - + TRACE("(%p)->(\n\tIID:\t%s,%p)\n", This, shdebugstr_guid(riid), ppvObj); *ppvObj = NULL; - if(IsEqualIID(riid, &IID_IUnknown)) + if(IsEqualIID(riid, &IID_IUnknown)) { *ppvObj = This; - } + } else if(IsEqualIID(riid, &IID_IAutoComplete)) { *ppvObj = (IAutoComplete*)This; @@ -161,7 +161,7 @@ static HRESULT WINAPI IAutoComplete_fnQueryInterface( return S_OK; } TRACE("-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; + return E_NOINTERFACE; } /****************************************************************************** @@ -172,7 +172,7 @@ static ULONG WINAPI IAutoComplete_fnAddRef( { IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - + TRACE("(%p)->(%u)\n", This, refCount - 1); return refCount; @@ -186,7 +186,7 @@ static ULONG WINAPI IAutoComplete_fnRelease( { IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - + TRACE("(%p)->(%u)\n", This, refCount + 1); if (!refCount) { @@ -233,7 +233,7 @@ static HRESULT WINAPI IAutoComplete_fnInit( IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface; static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0}; - TRACE("(%p)->(0x%08lx, %p, %s, %s)\n", + TRACE("(%p)->(0x%08lx, %p, %s, %s)\n", This, (long)hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete)); if (This->options & ACO_AUTOSUGGEST) TRACE(" ACO_AUTOSUGGEST\n"); @@ -258,14 +258,14 @@ static HRESULT WINAPI IAutoComplete_fnInit( HWND hwndParent; hwndParent = GetParent(This->hwndEdit); - + /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ - This->hwndListBox = CreateWindowExW(0, lbName, NULL, - WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, + This->hwndListBox = CreateWindowExW(0, lbName, NULL, + WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - hwndParent, NULL, + hwndParent, NULL, (HINSTANCE)GetWindowLongPtrW( hwndParent, GWLP_HINSTANCE ), NULL); - + if (This->hwndListBox) { This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc); SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This); @@ -290,7 +290,7 @@ static HRESULT WINAPI IAutoComplete_fnInit( res = RegOpenKeyExW(HKEY_CURRENT_USER, key, 0, KEY_READ, &hKey); if (res != ERROR_SUCCESS) { /* if the key is not found, MSDN states we must seek in HKEY_LOCAL_MACHINE */ - res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, &hKey); + res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, key, 0, KEY_READ, &hKey); } if (res == ERROR_SUCCESS) { res = RegQueryValueW(hKey, value, result, &len); @@ -468,22 +468,22 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ShowWindow(This->hwndListBox, SW_HIDE); break; case WM_KILLFOCUS: - if ((This->options && ACO_AUTOSUGGEST) && + if ((This->options && ACO_AUTOSUGGEST) && ((HWND)wParam != This->hwndListBox)) { ShowWindow(This->hwndListBox, SW_HIDE); } break; case WM_KEYUP: - + GetWindowTextW( hwnd, (LPWSTR)hwndText, 255); - + switch(wParam) { case VK_RETURN: /* If quickComplete is set and control is pressed, replace the string */ - control = GetKeyState(VK_CONTROL) & 0x8000; + control = GetKeyState(VK_CONTROL) & 0x8000; if (control && This->quickComplete) { - hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR)); sel = sprintfW(hwndQCText, This->quickComplete, hwndText); SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText); @@ -496,15 +496,15 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, case VK_LEFT: case VK_RIGHT: return 0; - case VK_UP: + case VK_UP: case VK_DOWN: - /* Two cases here : - - if the listbox is not visible, displays it + /* Two cases here : + - if the listbox is not visible, displays it with all the entries if the style ACO_UPDOWNKEYDROPSLIST is present but does not select anything. - if the listbox is visible, change the selection */ - if ( (This->options & (ACO_AUTOSUGGEST | ACO_UPDOWNKEYDROPSLIST)) + if ( (This->options & (ACO_AUTOSUGGEST | ACO_UPDOWNKEYDROPSLIST)) && (!IsWindowVisible(This->hwndListBox) && (! *hwndText)) ) { /* We must dispays all the entries */ @@ -524,7 +524,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, if (sel != -1) { WCHAR *msg; int len; - + len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL); msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR)); SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg); @@ -534,8 +534,8 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, } else { SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)This->txtbackup); SendMessageW(hwnd, EM_SETSEL, lstrlenW(This->txtbackup), lstrlenW(This->txtbackup)); - } - } + } + } return 0; } break; @@ -552,25 +552,25 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, hwndText[b-1] = '\0'; } else { hwndText[0] = '\0'; - SetWindowTextW(hwnd, hwndText); - } + SetWindowTextW(hwnd, hwndText); + } } break; - default: + default: ; } - + SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0); HeapFree(GetProcessHeap(), 0, This->txtbackup); This->txtbackup = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR)); + HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR)); lstrcpyW(This->txtbackup, hwndText); /* Returns if there is no text to search and we doesn't want to display all the entries */ if ((!displayall) && (! *hwndText) ) break; - + IEnumString_Reset(This->enumstr); filled = FALSE; for(cpt = 0;;) { @@ -579,41 +579,41 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, break; if ((LPWSTR)strstrW(strs, hwndText) == strs) { - + if (This->options & ACO_AUTOAPPEND) { SetWindowTextW(hwnd, strs); SendMessageW(hwnd, EM_SETSEL, lstrlenW(hwndText), lstrlenW(strs)); break; - } + } if (This->options & ACO_AUTOSUGGEST) { SendMessageW(This->hwndListBox, LB_ADDSTRING, 0, (LPARAM)strs); filled = TRUE; cpt++; } - } + } } - + if (This->options & ACO_AUTOSUGGEST) { if (filled) { height = SendMessageW(This->hwndListBox, LB_GETITEMHEIGHT, 0, 0); SendMessageW(This->hwndListBox, LB_CARETOFF, 0, 0); GetWindowRect(hwnd, &r); SetParent(This->hwndListBox, HWND_DESKTOP); - /* It seems that Windows XP displays 7 lines at most + /* It seems that Windows XP displays 7 lines at most and otherwise displays a vertical scroll bar */ - SetWindowPos(This->hwndListBox, HWND_TOP, - r.left, r.bottom + 1, r.right - r.left, min(height * 7, height*(cpt+1)), + SetWindowPos(This->hwndListBox, HWND_TOP, + r.left, r.bottom + 1, r.right - r.left, min(height * 7, height*(cpt+1)), SWP_SHOWWINDOW ); } else { ShowWindow(This->hwndListBox, SW_HIDE); } } - - break; + + break; default: return CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam); - + } return 0; diff --git a/reactos/dll/win32/shell32/brsfolder.c b/reactos/dll/win32/shell32/brsfolder.c index 7f73becb1cf..c11219d88d5 100644 --- a/reactos/dll/win32/shell32/brsfolder.c +++ b/reactos/dll/win32/shell32/brsfolder.c @@ -52,7 +52,7 @@ typedef struct tagTV_ITEMDATA LPSHELLFOLDER lpsfParent; /* IShellFolder of the parent */ LPITEMIDLIST lpi; /* PIDL relativ to parent */ LPITEMIDLIST lpifq; /* Fully qualified PIDL */ - IEnumIDList* pEnumIL; /* Children iterator */ + IEnumIDList* pEnumIL; /* Children iterator */ } TV_ITEMDATA, *LPTV_ITEMDATA; #define SUPPORTEDFLAGS (BIF_STATUSTEXT | \ @@ -91,7 +91,7 @@ static void browsefolder_callback( LPBROWSEINFOW lpBrowseInfo, HWND hWnd, * InitializeTreeView [Internal] * * Called from WM_INITDIALOG handler. - * + * * PARAMS * hwndParent [I] The BrowseForFolder dialog * root [I] ITEMIDLIST of the root shell folder @@ -108,18 +108,18 @@ static void InitializeTreeView( browse_info *info ) LPCITEMIDLIST root = info->lpBrowseInfo->pidlRoot; TRACE("%p\n", info ); - + Shell_GetImageList(NULL, &hImageList); if (hImageList) SendMessageW( info->hwndTreeView, TVM_SETIMAGELIST, 0, (LPARAM)hImageList ); /* We want to call InsertTreeViewItem down the code, in order to insert - * the root item of the treeview. Due to InsertTreeViewItem's signature, + * the root item of the treeview. Due to InsertTreeViewItem's signature, * we need the following to do this: * - * + An ITEMIDLIST corresponding to _the parent_ of root. - * + An ITEMIDLIST, which is a relative path from root's parent to root + * + An ITEMIDLIST corresponding to _the parent_ of root. + * + An ITEMIDLIST, which is a relative path from root's parent to root * (containing a single SHITEMID). * + An IShellFolder interface pointer of root's parent folder. * @@ -129,7 +129,7 @@ static void InitializeTreeView( browse_info *info ) pidlParent = ILClone(root); ILRemoveLastID(pidlParent); pidlChild = ILClone(ILFindLastID(root)); - + if (_ILIsDesktop(pidlParent)) { hr = SHGetDesktopFolder(&lpsfParent); } else { @@ -142,7 +142,7 @@ static void InitializeTreeView( browse_info *info ) hr = IShellFolder_BindToObject(lpsfDesktop, pidlParent, 0, &IID_IShellFolder, (LPVOID*)&lpsfParent); IShellFolder_Release(lpsfDesktop); } - + if (!SUCCEEDED(hr)) { WARN("Could not bind to parent shell folder! hr = %08x\n", hr); return; @@ -154,7 +154,7 @@ static void InitializeTreeView( browse_info *info ) lpsfRoot = lpsfParent; hr = IShellFolder_AddRef(lpsfParent); } - + if (!SUCCEEDED(hr)) { WARN("Could not bind to root shell folder! hr = %08x\n", hr); IShellFolder_Release(lpsfParent); @@ -244,8 +244,8 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR * * PARAMS * info [I] data for the dialog - * lpsf [I] IShellFolder interface of the item's parent shell folder - * pidl [I] ITEMIDLIST of the child to insert, relativ to parent + * lpsf [I] IShellFolder interface of the item's parent shell folder + * pidl [I] ITEMIDLIST of the child to insert, relativ to parent * pidlParent [I] ITEMIDLIST of the parent shell folder * pEnumIL [I] Iterator for the children of the item to be inserted * hParent [I] The treeview-item that represents the parent shell folder @@ -296,7 +296,7 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf, /****************************************************************************** * FillTreeView [Internal] * - * For each child (given by lpe) of the parent shell folder, which is given by + * For each child (given by lpe) of the parent shell folder, which is given by * lpsf and whose PIDL is pidl, insert a treeview-item right under hParent * * PARAMS @@ -319,7 +319,7 @@ static void FillTreeView( browse_info *info, IShellFolder * lpsf, /* No IEnumIDList -> No children */ if (!lpe) return; - + SetCapture( hwnd ); SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) ); @@ -393,7 +393,7 @@ static void BrsFolder_CheckValidSelection( browse_info *info, LPTV_ITEMDATA lptv dwAttributes = SFGAO_FOLDER | SFGAO_FILESYSTEM; r = IShellFolder_GetAttributesOf(lptvid->lpsfParent, 1, (LPCITEMIDLIST*)&lptvid->lpi, &dwAttributes); - if (FAILED(r) || + if (FAILED(r) || ((dwAttributes & (SFGAO_FOLDER|SFGAO_FILESYSTEM)) != (SFGAO_FOLDER|SFGAO_FILESYSTEM))) { bEnabled = FALSE; @@ -576,15 +576,15 @@ static BOOL BrsFolder_OnCommand( browse_info *info, UINT id ) return FALSE; } -static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, +static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, BOOL is_str, HTREEITEM *pItem) { LPITEMIDLIST pidlSelection = (LPITEMIDLIST)selection; LPCITEMIDLIST pidlCurrent, pidlRoot; TVITEMEXW item; BOOL bResult = FALSE; - - /* If 'selection' is a string, convert to a Shell ID List. */ + + /* If 'selection' is a string, convert to a Shell ID List. */ if (is_str) { IShellFolder *psfDesktop; HRESULT hr; @@ -593,10 +593,10 @@ static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, if (FAILED(hr)) goto done; - hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, + hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, (LPOLESTR)selection, NULL, &pidlSelection, NULL); IShellFolder_Release(psfDesktop); - if (FAILED(hr)) + if (FAILED(hr)) goto done; } @@ -617,7 +617,7 @@ static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, memset(&item, 0, sizeof(item)); item.mask = TVIF_PARAM; item.hItem = TreeView_GetRoot(info->hwndTreeView); - if (item.hItem) + if (item.hItem) item.hItem = TreeView_GetChild(info->hwndTreeView, item.hItem); /* Walk the tree along the nodes corresponding to the remaining ITEMIDLIST */ @@ -640,16 +640,16 @@ static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, } } - if (_ILIsEmpty(pidlCurrent) && item.hItem) + if (_ILIsEmpty(pidlCurrent) && item.hItem) bResult = TRUE; done: if (pidlSelection && pidlSelection != (LPITEMIDLIST)selection) ILFree(pidlSelection); - if (pItem) + if (pItem) *pItem = item.hItem; - + return bResult; } @@ -667,10 +667,10 @@ static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL LPWSTR selectionW = NULL; BOOL result = FALSE; int length; - + if (!is_str) return BrsFolder_OnSetSelectionW(info, selection, is_str); - + if ((length = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)selection, -1, NULL, 0)) && (selectionW = HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR))) && MultiByteToWideChar(CP_ACP, 0, (LPCSTR)selection, -1, selectionW, length)) @@ -818,7 +818,7 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi) templateName = swBrowseTemplateName; r = DialogBoxParamW( shell32_hInstance, templateName, lpbi->hwndOwner, BrsFolderDlgProc, (LPARAM)&info ); - if (SUCCEEDED(hr)) + if (SUCCEEDED(hr)) OleUninitialize(); if (!r) return NULL; diff --git a/reactos/dll/win32/shell32/changenotify.c b/reactos/dll/win32/shell32/changenotify.c index d59d40f6dfc..c9bd7888c47 100644 --- a/reactos/dll/win32/shell32/changenotify.c +++ b/reactos/dll/win32/shell32/changenotify.c @@ -54,7 +54,7 @@ typedef struct _NOTIFICATIONLIST LONG wSignalledEvent; /* event that occurred */ DWORD dwFlags; /* client flags */ LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/ - + } NOTIFICATIONLIST, *LPNOTIFICATIONLIST; static NOTIFICATIONLIST *head, *tail; @@ -300,11 +300,11 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID return; } - if( ( ( wEventId & SHCNE_NOITEMEVENTS ) && + if( ( ( wEventId & SHCNE_NOITEMEVENTS ) && ( wEventId & ~SHCNE_NOITEMEVENTS ) ) || - ( ( wEventId & SHCNE_ONEITEMEVENTS ) && + ( ( wEventId & SHCNE_ONEITEMEVENTS ) && ( wEventId & ~SHCNE_ONEITEMEVENTS ) ) || - ( ( wEventId & SHCNE_TWOITEMEVENTS ) && + ( ( wEventId & SHCNE_TWOITEMEVENTS ) && ( wEventId & ~SHCNE_TWOITEMEVENTS ) ) ) { WARN("mutually incompatible events listed\n"); @@ -341,7 +341,7 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID if( Pidls[0] && SHGetPathFromIDListW(Pidls[0], path )) TRACE("notify %08x on item1 = %s\n", wEventId, debugstr_w(path)); - + if( Pidls[1] && SHGetPathFromIDListW(Pidls[1], path )) TRACE("notify %08x on item2 = %s\n", wEventId, debugstr_w(path)); } @@ -397,7 +397,7 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID } TRACE("notify Done\n"); LeaveCriticalSection(&SHELL32_ChangenotifyCS); - + /* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */ if ((typeFlag & SHCNF_PATHA) || (typeFlag & SHCNF_PRINTERA)) { diff --git a/reactos/dll/win32/shell32/classes.c b/reactos/dll/win32/shell32/classes.c index db4ce80126e..2b4a556fe02 100644 --- a/reactos/dll/win32/shell32/classes.c +++ b/reactos/dll/win32/shell32/classes.c @@ -50,7 +50,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); #define MAX_EXTENSION_LENGTH 20 BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot) -{ +{ HKEY hkey; WCHAR szTemp[MAX_EXTENSION_LENGTH + 2]; @@ -66,12 +66,12 @@ BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL lstrcpynW(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH); if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szTemp, 0, 0x02000000, &hkey)) - { + { return FALSE; } if (RegQueryValueW(hkey, NULL, szFileType, &len)) - { + { RegCloseKey(hkey); return FALSE; } @@ -100,12 +100,12 @@ BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bP lstrcpynA(szTemp + (bPrependDot?1:0), szExtension, MAX_EXTENSION_LENGTH); if (RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, 0x02000000, &hkey)) - { + { return FALSE; } if (RegQueryValueA(hkey, NULL, szFileType, &len)) - { + { RegCloseKey(hkey); return FALSE; } @@ -335,7 +335,7 @@ BOOL HCR_GetDefaultIconFromGUIDW(REFIID riid, LPWSTR szDest, DWORD len, int* pic static const WCHAR swEmpty[] = {0}; BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) -{ +{ HKEY hkey; BOOL ret = FALSE; DWORD buflen = len; @@ -343,7 +343,7 @@ BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len) szDest[0] = 0; if (HCR_RegOpenClassIDKey(riid, &hkey)) { - static const WCHAR wszLocalizedString[] = + static const WCHAR wszLocalizedString[] = { 'L','o','c','a','l','i','z','e','d','S','t','r','i','n','g', 0 }; if (!RegLoadMUIStringW(hkey, wszLocalizedString, szDest, len, NULL, 0, NULL) || !RegQueryValueExW(hkey, swEmpty, 0, NULL, (LPBYTE)szDest, &len)) @@ -411,7 +411,7 @@ BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len) * Query the registry for a shell folders' attributes * * PARAMS - * pidlFolder [I] A simple pidl of type PT_GUID. + * pidlFolder [I] A simple pidl of type PT_GUID. * pdwAttributes [IO] In: Attributes to be queried, OUT: Resulting attributes. * * RETURNS @@ -429,28 +429,28 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) LONG lResult; DWORD dwTemp, dwLen; static const WCHAR wszAttributes[] = { 'A','t','t','r','i','b','u','t','e','s',0 }; - static const WCHAR wszCallForAttributes[] = { + static const WCHAR wszCallForAttributes[] = { 'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0 }; WCHAR wszShellFolderKey[] = { 'C','L','S','I','D','\\','{','0','0','0','2','1','4','0','0','-', '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-','0','0','0','0','0','0','0', '0','0','0','4','6','}','\\','S','h','e','l','l','F','o','l','d','e','r',0 }; TRACE("(pidlFolder=%p, pdwAttributes=%p)\n", pidlFolder, pdwAttributes); - - if (!_ILIsPidlSimple(pidlFolder)) { - ERR("HCR_GetFolderAttributes should be called for simple PIDL's only!\n"); + + if (!_ILIsPidlSimple(pidlFolder)) { + ERR("HCR_GetFolderAttributes should be called for simple PIDL's only!\n"); return FALSE; } - + if (!_ILIsDesktop(pidlFolder)) { if (FAILED(StringFromCLSID(_ILGetGUIDPointer(pidlFolder), &pwszCLSID))) return FALSE; memcpy(&wszShellFolderKey[6], pwszCLSID, 38 * sizeof(WCHAR)); CoTaskMemFree(pwszCLSID); } - + lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey); if (lResult != ERROR_SUCCESS) return FALSE; - + dwLen = sizeof(DWORD); lResult = RegQueryValueExW(hSFKey, wszCallForAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); if ((lResult == ERROR_SUCCESS) && (dwTemp & *pdwAttributes)) { @@ -460,9 +460,9 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) RegCloseKey(hSFKey); hr = SHGetDesktopFolder(&psfDesktop); if (SUCCEEDED(hr)) { - hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder, + hr = IShellFolder_BindToObject(psfDesktop, pidlFolder, NULL, &IID_IShellFolder, (LPVOID*)&psfFolder); - if (SUCCEEDED(hr)) { + if (SUCCEEDED(hr)) { hr = IShellFolder_GetAttributesOf(psfFolder, 0, NULL, pdwAttributes); IShellFolder_Release(psfFolder); } diff --git a/reactos/dll/win32/shell32/dde.c b/reactos/dll/win32/shell32/dde.c index ea794ad7f09..fe5a1f7d8ad 100644 --- a/reactos/dll/win32/shell32/dde.c +++ b/reactos/dll/win32/shell32/dde.c @@ -91,7 +91,7 @@ static inline void Dde_OnDisconnect(HCONV hconv) FIXME("stub\n"); } -static HDDEDATA CALLBACK DdeCallback( +static HDDEDATA CALLBACK DdeCallback( UINT uType, UINT uFmt, HCONV hconv, diff --git a/reactos/dll/win32/shell32/dialogs.c b/reactos/dll/win32/shell32/dialogs.c index cfe50ccc638..953b1449b92 100644 --- a/reactos/dll/win32/shell32/dialogs.c +++ b/reactos/dll/win32/shell32/dialogs.c @@ -406,15 +406,15 @@ int WINAPI RestartDialogEx(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, D return 0; } -/************************************************************************* - * LogoffWindowsDialog [SHELL32.54] - */ - -int WINAPI LogoffWindowsDialog(DWORD uFlags) -{ - ERR("LogoffWindowsDialog is UNIMPLEMENTED\n"); - ExitWindowsEx(EWX_LOGOFF, 0); - return 0; +/************************************************************************* + * LogoffWindowsDialog [SHELL32.54] + */ + +int WINAPI LogoffWindowsDialog(DWORD uFlags) +{ + ERR("LogoffWindowsDialog is UNIMPLEMENTED\n"); + ExitWindowsEx(EWX_LOGOFF, 0); + return 0; } /************************************************************************* diff --git a/reactos/dll/win32/shell32/drive.c b/reactos/dll/win32/shell32/drive.c index f53c74984b0..c90ad339dec 100644 --- a/reactos/dll/win32/shell32/drive.c +++ b/reactos/dll/win32/shell32/drive.c @@ -81,7 +81,7 @@ GetFreeBytesShare(LARGE_INTEGER TotalNumberOfFreeBytes, LARGE_INTEGER TotalNumbe Result = ConvertUlongToLargeInteger(1); }else { - Result = LargeIntegerDivide(TotalNumberOfFreeBytes, Temp, &Remainder); + Result = LargeIntegerDivide(TotalNumberOfFreeBytes, Temp, &Remainder); } return Result; @@ -121,7 +121,7 @@ PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT drawItem) hBlueBrush = CreateSolidBrush(RGB(0, 0, 255)); hMagBrush = CreateSolidBrush(RGB(255, 0, 255)); - + SendDlgItemMessageW(hwndDlg, 14007, WM_GETTEXT, 20, (LPARAM)szBuffer); Result.QuadPart = _wtoi(szBuffer); @@ -220,9 +220,9 @@ InitializeGeneralDriveDialog(HWND hwndDlg, WCHAR * szDrive) } -INT_PTR -CALLBACK -DriveGeneralDlg( +INT_PTR +CALLBACK +DriveGeneralDlg( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -246,7 +246,7 @@ DriveGeneralDlg( lpstr = (WCHAR *)ppsp->lParam; SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lpstr); InitializeGeneralDriveDialog(hwndDlg, lpstr); - return TRUE; + return TRUE; case WM_DRAWITEM: drawItem = (LPDRAWITEMSTRUCT)lParam; if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015) @@ -281,9 +281,9 @@ DriveGeneralDlg( return FALSE; } -INT_PTR -CALLBACK -DriveExtraDlg( +INT_PTR +CALLBACK +DriveExtraDlg( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -347,9 +347,9 @@ DriveExtraDlg( return FALSE; } -INT_PTR -CALLBACK -DriveHardwareDlg( +INT_PTR +CALLBACK +DriveHardwareDlg( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -376,7 +376,7 @@ DriveHardwareDlg( return FALSE; } -static +static const struct { diff --git a/reactos/dll/win32/shell32/enumidlist.c b/reactos/dll/win32/shell32/enumidlist.c index 6356c4d68bc..5ac38815c62 100644 --- a/reactos/dll/win32/shell32/enumidlist.c +++ b/reactos/dll/win32/shell32/enumidlist.c @@ -131,7 +131,7 @@ BOOL CreateFolderEnumList( do { - if ( !(stffile.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + if ( !(stffile.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) || (dwFlags & SHCONTF_INCLUDEHIDDEN) ) { if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && diff --git a/reactos/dll/win32/shell32/folders.c b/reactos/dll/win32/shell32/folders.c index 21199059d7c..322e584b9d0 100644 --- a/reactos/dll/win32/shell32/folders.c +++ b/reactos/dll/win32/shell32/folders.c @@ -76,7 +76,7 @@ static inline IExtractIconW *impl_from_IExtractIconA( IExtractIconA *iface ) IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl) { IExtractIconWImpl* ei; - + TRACE("%p\n", pidl); ei = HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl)); @@ -422,7 +422,7 @@ IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl) { IExtractIconWImpl *This = (IExtractIconWImpl *)IExtractIconW_Constructor(pidl); IExtractIconA *eia = (IExtractIconA *)&This->lpvtblExtractIconA; - + TRACE("(%p)->(%p)\n", This, eia); return eia; } @@ -470,7 +470,7 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation( HRESULT ret; LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, cchMax * sizeof(WCHAR)); IExtractIconW *This = impl_from_IExtractIconA(iface); - + TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags); ret = IExtractIconW_GetIconLocation(This, uFlags, lpwstrFile, cchMax, piIndex, pwFlags); diff --git a/reactos/dll/win32/shell32/fprop.c b/reactos/dll/win32/shell32/fprop.c index c414c4384ff..a65a74117a9 100644 --- a/reactos/dll/win32/shell32/fprop.c +++ b/reactos/dll/win32/shell32/fprop.c @@ -48,7 +48,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); #define MAX_PROPERTY_SHEET_PAGE 32 -typedef struct _LANGANDCODEPAGE_ +typedef struct _LANGANDCODEPAGE_ { WORD lang; WORD code; @@ -119,7 +119,7 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext) WCHAR value[MAX_PATH]; DWORD lname = MAX_PATH; DWORD lvalue = MAX_PATH; - + HKEY hKey; LONG result; HWND hDlgCtrl; @@ -162,17 +162,17 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext) * * SHFileGeneralGetFileTimeString [Internal] * - * formats a given LPFILETIME struct into readable user format + * formats a given LPFILETIME struct into readable user format */ -BOOL +BOOL SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR * lpResult) { FILETIME ft; SYSTEMTIME dt; WORD wYear; static const WCHAR wFormat[] = {'%','0','2','d','/','%','0','2','d','/','%','0','4','d',' ',' ','%','0','2','d',':','%','0','2','u',0}; - + if (lpFileTime == NULL || lpResult == NULL) return FALSE; @@ -184,7 +184,7 @@ SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR * lpResult) wYear = dt.wYear; /* ddmmyy */ sprintfW (lpResult, wFormat, dt.wDay, dt.wMonth, wYear, dt.wHour, dt.wMinute); - + TRACE("result %s\n",debugstr_w(lpResult)); return TRUE; } @@ -197,7 +197,7 @@ SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR * lpResult) * */ -BOOL +BOOL SH_FileGeneralSetText(HWND hwndDlg, WCHAR * lpstr) { int flength; @@ -205,7 +205,7 @@ SH_FileGeneralSetText(HWND hwndDlg, WCHAR * lpstr) WCHAR * lpdir; WCHAR buff[MAX_PATH]; HWND hDlgCtrl; - + if (lpstr == NULL) return FALSE; @@ -213,7 +213,7 @@ SH_FileGeneralSetText(HWND hwndDlg, WCHAR * lpstr) plength = strlenW(lpstr); flength = strlenW(lpdir); - + if (lpdir) { /* location text field */ @@ -246,7 +246,7 @@ BOOL SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER lpfilesize) { BOOL result; - HANDLE hFile; + HANDLE hFile; FILETIME create_time; FILETIME accessed_time; FILETIME write_time; @@ -256,7 +256,7 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER if (lpfilename == NULL) return FALSE; - + hFile = CreateFileW(lpfilename, GENERIC_READ, FILE_SHARE_READ,NULL, @@ -269,9 +269,9 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER WARN("failed to open file %s\n", debugstr_w(lpfilename)); return FALSE; } - + result = GetFileTime(hFile, &create_time, &accessed_time, &write_time); - + if (!result) { WARN("GetFileTime failed\n"); @@ -294,7 +294,7 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER hDlgCtrl = GetDlgItem(hwndDlg, 14019); SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)resultstr); } - + if (!GetFileSizeEx(hFile, &file_size)) { WARN("GetFileSize failed\n"); @@ -307,7 +307,7 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER hDlgCtrl = GetDlgItem(hwndDlg, 14011); TRACE("result size %u resultstr %s\n", file_size.QuadPart, debugstr_w(resultstr)); SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)resultstr); - + if (lpfilesize) lpfilesize->QuadPart = (ULONGLONG)file_size.QuadPart; @@ -329,7 +329,7 @@ SH_FileVersionQuerySetText(HWND hwndDlg, DWORD dlgId, LPVOID pInfo, WCHAR * text if(hwndDlg == NULL || resptr == NULL || text == NULL) return FALSE; - + if(VerQueryValueW(pInfo, text, (LPVOID *)resptr, &reslen)) { /* file description property */ @@ -350,7 +350,7 @@ SH_FileVersionQuerySetText(HWND hwndDlg, DWORD dlgId, LPVOID pInfo, WCHAR * text */ -BOOL +BOOL SH_FileVersionQuerySetListText(HWND hwndDlg, LPVOID pInfo, const WCHAR * text, WCHAR **resptr, WORD lang, WORD code) { UINT reslen; @@ -402,9 +402,9 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename) static const WCHAR wFileDescriptionFormat[] = { '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o', '\\','%','0','4','x','%','0','4','x','\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0 }; static const WCHAR wLegalCopyrightFormat[] = { '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o', - '\\','%','0','4','x','%','0','4','x','\\','L','e','g','a','l','C','o','p','y','r','i','g','h','t',0 }; + '\\','%','0','4','x','%','0','4','x','\\','L','e','g','a','l','C','o','p','y','r','i','g','h','t',0 }; static const WCHAR wTranslation[] = { 'V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0 }; - static const WCHAR wCompanyName[] = { 'C','o','m','p','a','n','y','N','a','m','e',0 }; + static const WCHAR wCompanyName[] = { 'C','o','m','p','a','n','y','N','a','m','e',0 }; static const WCHAR wFileVersion[] = { 'F','i','l','e','V','e','r','s','i','o','n',0 }; static const WCHAR wInternalName[] = { 'I','n','t','e','r','n','a','l','N','a','m','e',0 }; static const WCHAR wOriginalFilename[] = { 'O','r','i','g','i','n','a','l','F','i','l','e','n','a','m','e',0 }; @@ -421,13 +421,13 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename) WARN("GetFileVersionInfoSize failed\n"); return FALSE; } - + if(!(pBuf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, versize))) { WARN("HeapAlloc failed bytes %x\n",versize); return FALSE; } - + if(!GetFileVersionInfoW(lpfilename, handle, versize, pBuf)) { HeapFree(GetProcessHeap(), 0, pBuf); @@ -454,10 +454,10 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename) lang = lplangcode->lang; code = lplangcode->code; } - + sprintfW(buff, wFileDescriptionFormat, lang, code); SH_FileVersionQuerySetText(hwndDlg, 14003, pBuf, buff, &str); - + sprintfW(buff, wLegalCopyrightFormat, lang, code); SH_FileVersionQuerySetText(hwndDlg, 14005, pBuf, buff, &str); @@ -472,7 +472,7 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename) SH_FileVersionQuerySetListText(hwndDlg, pBuf, wProductName, &str, lang, code); SH_FileVersionQuerySetListText(hwndDlg, pBuf, wProductVersion, &str, lang, code); SetWindowLong(hwndDlg, DWL_USER, (LONG)pBuf); - + /* select first item */ hDlgCtrl = GetDlgItem(hwndDlg, 14009); SendMessageW(hDlgCtrl, LB_SETCURSEL, 0, 0); @@ -488,9 +488,9 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename) * * wnd proc of 'Version' property sheet page */ -INT_PTR -CALLBACK -SH_FileVersionDlgProc( +INT_PTR +CALLBACK +SH_FileVersionDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -523,7 +523,7 @@ SH_FileVersionDlgProc( HWND hDlgCtrl; LRESULT lresult; WCHAR * str; - + hDlgCtrl = GetDlgItem(hwndDlg, 14009); lresult = SendMessageW(hDlgCtrl, LB_GETCURSEL, (WPARAM)NULL, (LPARAM)NULL); if(lresult == LB_ERR) @@ -558,9 +558,9 @@ SH_FileVersionDlgProc( * */ -INT_PTR -CALLBACK -SH_FileGeneralDlgProc( +INT_PTR +CALLBACK +SH_FileGeneralDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -603,13 +603,13 @@ SH_FileGeneralDlgProc( * SH_ShowPropertiesDialog * * called from ShellExecuteExW32 - * + * * lpf contains (quoted) path of folder/file * * TODO: provide button change application type if file has registered type * make filename field editable and apply changes to filename on close */ - + BOOL SH_ShowPropertiesDialog(WCHAR * lpf) { @@ -624,7 +624,7 @@ SH_ShowPropertiesDialog(WCHAR * lpf) if (lpf== NULL) return FALSE; - + if ( !strlenW(lpf) ) return FALSE; @@ -634,7 +634,7 @@ SH_ShowPropertiesDialog(WCHAR * lpf) /* remove quotes from lpf */ LPWSTR src = lpf + 1; LPWSTR dst = wFileName; - + while(*src && *src!='"') *dst++ = *src++; diff --git a/reactos/dll/win32/shell32/iconcache.c b/reactos/dll/win32/shell32/iconcache.c index 9df0af0d854..e1509e4d5c6 100644 --- a/reactos/dll/win32/shell32/iconcache.c +++ b/reactos/dll/win32/shell32/iconcache.c @@ -78,15 +78,15 @@ static CRITICAL_SECTION SHELL32_SicCS = { &critsect_debug, -1, 0, 0, 0, 0 }; */ static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam) { LPSIC_ENTRY e1 = (LPSIC_ENTRY)p1, e2 = (LPSIC_ENTRY)p2; - + TRACE("%p %p %8lx\n", p1, p2, lparam); /* Icons in the cache are keyed by the name of the file they are * loaded from, their resource index and the fact if they have a shortcut - * icon overlay or not. + * icon overlay or not. */ if (e1->dwSourceIndex != e2->dwSourceIndex || /* first the faster one */ - (e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT)) + (e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT)) return 1; if (strcmpiW(e1->sSourceFile,e2->sSourceFile)) @@ -103,7 +103,7 @@ static int SIC_LoadOverlayIcon(int icon_idx); * * NOTES * Creates a new icon as a copy of the passed-in icon, overlayed with a - * shortcut image. + * shortcut image. */ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large) { ICONINFO SourceIconInfo, ShortcutIconInfo, TargetIconInfo; @@ -427,12 +427,12 @@ BOOL SIC_Initialize(void) ImageList_SetBkColor(ShellBigIconList, CLR_NONE); /* Load the document icon, which is used as the default if an icon isn't found. */ - hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT), + hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT), IMAGE_ICON, cx_small, cy_small, LR_SHARED); - hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT), + hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT), IMAGE_ICON, cx_large, cy_large, LR_SHARED); - if (!hSm || !hLg) + if (!hSm || !hLg) { FIXME("Failed to load IDI_SHELL_DOCUMENT icon!\n"); return FALSE; @@ -440,7 +440,7 @@ BOOL SIC_Initialize(void) SIC_IconAppend (swShell32Name, IDI_SHELL_DOCUMENT-1, hSm, hLg, 0); SIC_IconAppend (swShell32Name, -IDI_SHELL_DOCUMENT, hSm, hLg, 0); - + TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList); return TRUE; @@ -491,7 +491,7 @@ static int SIC_LoadOverlayIcon(int icon_idx) 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', 'E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','I','c','o','n','s',0 - }; + }; static const WCHAR wszNumFmt[] = {'%','d',0}; iconPath = swShell32Name; /* default: load icon from shell32.dll */ @@ -731,7 +731,7 @@ UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, * executable) and patch parameters if needed. */ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon) -{ +{ HICON hIcon = NULL; INT len = MultiByteToWideChar(CP_ACP, 0, lpIconPath, -1, NULL, 0); /* Note that we need to allocate MAX_PATH, since we are supposed to fill diff --git a/reactos/dll/win32/shell32/pidl.c b/reactos/dll/win32/shell32/pidl.c index cd7a984f957..82389dc6841 100644 --- a/reactos/dll/win32/shell32/pidl.c +++ b/reactos/dll/win32/shell32/pidl.c @@ -1267,7 +1267,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath) IShellFolder_Release(psfFolder); return FALSE; } - + hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret); IShellFolder_Release(psfFolder); if (FAILED(hr)) return FALSE; @@ -1288,10 +1288,10 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI TRACE_(shell)("pidl=%p\n", pidl); pdump(pidl); - + if (!pidl || !ppv) return E_INVALIDARG; - + *ppv = NULL; if (ppidlLast) *ppidlLast = NULL; @@ -2049,7 +2049,7 @@ IID* _ILGetGUIDPointer(LPCITEMIDLIST pidl) FileStructW* _ILGetFileStructW(LPCITEMIDLIST pidl) { FileStructW *pFileStructW; WORD cbOffset; - + if (!(_ILIsValue(pidl) || _ILIsFolder(pidl))) return NULL; @@ -2119,7 +2119,7 @@ BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) FileTimeToSystemTime (&lft, &time); ret = GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&time, NULL, pOut, uOutSize); - if (ret) + if (ret) { /* Append space + time without seconds */ pOut[ret-1] = ' '; diff --git a/reactos/dll/win32/shell32/pidl.h b/reactos/dll/win32/shell32/pidl.h index e1f89d9e7b3..0babd9dec5a 100644 --- a/reactos/dll/win32/shell32/pidl.h +++ b/reactos/dll/win32/shell32/pidl.h @@ -64,7 +64,7 @@ * drive 0x2F drive (lnk/persistent) * folder/file 0x30 folder/file (1) (lnk/persistent) * folder 0x31 folder (usual) -* valueA 0x32 file (ANSI file name) +* valueA 0x32 file (ANSI file name) * valueW 0x34 file (Unicode file name) * workgroup 0x41 network (3) * computer 0x42 network (4) @@ -111,7 +111,7 @@ typedef BYTE PIDLTYPE; typedef struct tagPIDLCPanelStruct -{ +{ BYTE dummy; /*01 is 0x00 */ DWORD iconIdx; /*02 negative icon ID */ WORD offsDispName; /*06*/ @@ -143,8 +143,8 @@ typedef struct tagFileStruct The second the dos name when needed or just 0x00 */ } FileStruct; -/* At least on WinXP, this struct is appended with 2-byte-alignment to FileStruct. There follows - * a WORD member after the wszName string, which gives the offset from the beginning of the PIDL +/* At least on WinXP, this struct is appended with 2-byte-alignment to FileStruct. There follows + * a WORD member after the wszName string, which gives the offset from the beginning of the PIDL * to the FileStructW member. */ typedef struct tagFileStructW { WORD cbLen; @@ -211,7 +211,7 @@ BOOL _ILIsValue (LPCITEMIDLIST pidl); BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl); BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl); BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl); -static inline +static inline BOOL _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB) { return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) || diff --git a/reactos/dll/win32/shell32/recyclebin.c b/reactos/dll/win32/shell32/recyclebin.c index 743e4fa6f44..f599b74701b 100644 --- a/reactos/dll/win32/shell32/recyclebin.c +++ b/reactos/dll/win32/shell32/recyclebin.c @@ -237,7 +237,7 @@ CBEnumBitBucket(IN PVOID Context, IN HANDLE hDeletedFile) ERR("GetDeletedFileDetailsW failed\n"); return FALSE; } - + pidl = SHAlloc(dwSize); if (!pidl) { @@ -274,9 +274,9 @@ static HRESULT WINAPI RecycleBin_EnumObjects(IShellFolder2 *iface, HWND hwnd, SH RecycleBin *This = (RecycleBin *)iface; IEnumIDList *list; static const WCHAR szDrive = L'C'; - + TRACE("(%p, %p, %x, %p)\n", This, hwnd, (unsigned int)grfFlags, ppenumIDList); - + if (grfFlags & SHCONTF_NONFOLDERS) { TRACE("Starting Enumeration\n"); @@ -299,7 +299,7 @@ static HRESULT WINAPI RecycleBin_EnumObjects(IShellFolder2 *iface, HWND hwnd, SH if (*ppenumIDList == NULL) return E_OUTOFMEMORY; } - + return S_OK; } @@ -403,7 +403,7 @@ static HRESULT WINAPI RecycleBin_Initialize(IPersistFolder2 *iface, LPCITEMIDLIS { RecycleBin *This = impl_from_IPersistFolder(iface); TRACE("(%p, %p)\n", This, pidl); - + This->pidl = ILClone(pidl); if (This->pidl == NULL) return E_OUTOFMEMORY; @@ -476,7 +476,7 @@ static HRESULT WINAPI RecycleBin_GetDetailsOf(IShellFolder2 *iface, LPCITEMIDLIS if (iColumn == COLUMN_NAME) return RecycleBin_GetDisplayNameOf(iface, pidl, SHGDN_NORMAL, &pDetails->str); - + pFileDetails = UnpackDetailsFromPidl(pidl); switch (iColumn) { @@ -500,7 +500,7 @@ static HRESULT WINAPI RecycleBin_GetDetailsOf(IShellFolder2 *iface, LPCITEMIDLIS default: return E_FAIL; } - + pDetails->str.uType = STRRET_WSTR; pDetails->str.u.pOleStr = StrDupW(buffer); return (pDetails->str.u.pOleStr != NULL ? S_OK : E_OUTOFMEMORY); @@ -517,7 +517,7 @@ static HRESULT WINAPI RecycleBin_MapColumnToSCID(IShellFolder2 *iface, UINT iCol return S_OK; } -static const IShellFolder2Vtbl recycleBinVtbl = +static const IShellFolder2Vtbl recycleBinVtbl = { /* IUnknown */ RecycleBin_QueryInterface, @@ -702,9 +702,9 @@ static const IContextMenuVtbl recycleBincmVtbl = RecycleBin_IContextMenu_GetCommandString }; -INT_PTR -CALLBACK -RecycleBinGeneralDlg( +INT_PTR +CALLBACK +RecycleBinGeneralDlg( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -749,9 +749,9 @@ InitializeBitBucketDlg(HWND hwndDlg) -INT_PTR -CALLBACK -BitBucketDlg( +INT_PTR +CALLBACK +BitBucketDlg( HWND hwndDlg, UINT uMsg, WPARAM wParam, diff --git a/reactos/dll/win32/shell32/regsvr.c b/reactos/dll/win32/shell32/regsvr.c index d8747f5fed3..84aa35456b5 100644 --- a/reactos/dll/win32/shell32/regsvr.c +++ b/reactos/dll/win32/shell32/regsvr.c @@ -279,7 +279,7 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list) (CONST BYTE*)(buffer), strlen(buffer)+1); if (res != ERROR_SUCCESS) goto error_close_clsid_key; } - + if (list->idDefaultIcon) { HKEY icon_key; char buffer[64]; @@ -334,7 +334,7 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list) RegCloseKey(mcdm_key); } - if (list->flags & + if (list->flags & (SHELLFOLDER_WANTSFORPARSING|SHELLFOLDER_ATTRIBUTES|SHELLFOLDER_CALLFORATTRIBUTES)) { HKEY shellfolder_key; @@ -345,10 +345,10 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list) if (res != ERROR_SUCCESS) goto error_close_clsid_key; if (list->flags & SHELLFOLDER_WANTSFORPARSING) res = RegSetValueExA(shellfolder_key, wfparsing_valuename, 0, REG_SZ, (const BYTE *)"", 1); - if (list->flags & SHELLFOLDER_ATTRIBUTES) - res = RegSetValueExA(shellfolder_key, attributes_valuename, 0, REG_DWORD, + if (list->flags & SHELLFOLDER_ATTRIBUTES) + res = RegSetValueExA(shellfolder_key, attributes_valuename, 0, REG_DWORD, (const BYTE *)&list->dwAttributes, sizeof(DWORD)); - if (list->flags & SHELLFOLDER_CALLFORATTRIBUTES) + if (list->flags & SHELLFOLDER_CALLFORATTRIBUTES) res = RegSetValueExA(shellfolder_key, cfattributes_valuename, 0, REG_DWORD, (const BYTE *)&list->dwCallForAttributes, sizeof(DWORD)); RegCloseKey(shellfolder_key); @@ -476,13 +476,13 @@ static WCHAR *get_namespace_key(struct regsvr_namespace const *list) { static HRESULT register_namespace_extensions(struct regsvr_namespace const *list) { WCHAR *pwszKey; HKEY hKey; - + for (; list->clsid; list++) { pwszKey = get_namespace_key(list); - + /* Create the key and set the value. */ - if (pwszKey && ERROR_SUCCESS == - RegCreateKeyExW(HKEY_LOCAL_MACHINE, pwszKey, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL)) + if (pwszKey && ERROR_SUCCESS == + RegCreateKeyExW(HKEY_LOCAL_MACHINE, pwszKey, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL)) { RegSetValueExW(hKey, NULL, 0, REG_SZ, (const BYTE *)list->value, sizeof(WCHAR)*(lstrlenW(list->value)+1)); RegCloseKey(hKey); @@ -495,7 +495,7 @@ static HRESULT register_namespace_extensions(struct regsvr_namespace const *list static HRESULT unregister_namespace_extensions(struct regsvr_namespace const *list) { WCHAR *pwszKey; - + for (; list->clsid; list++) { pwszKey = get_namespace_key(list); RegDeleteKeyW(HKEY_LOCAL_MACHINE, pwszKey); @@ -702,18 +702,18 @@ static const WCHAR wszRecycleBin[] = { 'T','r','a','s','h', 0 }; static struct regsvr_namespace const namespace_extensions_list[] = { #if 0 - { + { &CLSID_UnixDosFolder, wszDesktop, wszSlash }, - { + { &CLSID_MyDocuments, wszDesktop, wszMyDocuments }, #endif - { + { &CLSID_RecycleBin, wszDesktop, wszRecycleBin diff --git a/reactos/dll/win32/shell32/shell32_De.rc b/reactos/dll/win32/shell32/shell32_De.rc index a74fef9a378..222619ed4de 100644 --- a/reactos/dll/win32/shell32/shell32_De.rc +++ b/reactos/dll/win32/shell32/shell32_De.rc @@ -224,7 +224,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 LTEXT "Zugegriffen:", 14018, 10, 100, 45, 10 LTEXT "", 14019, 70, 100, 150, 10 LTEXT "Attribute:", 14020, 10, 115, 45, 10 - CHECKBOX "&Schreibgeschützt", 14021, 70, 115, 67, 10 + CHECKBOX "&Schreibgeschützt", 14021, 70, 115, 67, 10 CHECKBOX "&Versteckt", 14022, 140, 115, 50, 10 CHECKBOX "&Archiv", 14023, 190, 115, 45, 10 } diff --git a/reactos/dll/win32/shell32/shell32_En.rc b/reactos/dll/win32/shell32/shell32_En.rc index e072428bdb4..8ac3b9ec672 100644 --- a/reactos/dll/win32/shell32/shell32_En.rc +++ b/reactos/dll/win32/shell32/shell32_En.rc @@ -314,7 +314,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 LTEXT "Which user account do you want to use to run this program?", -1, 10, 20, 220, 20 CHECKBOX "Current User %s", 14000, 10, 45, 150, 10 LTEXT "Protect my computer and data from unauthorized program activity", -1, 25, 57, 200, 10, WS_DISABLED - CHECKBOX "This option can prevent computer viruses from harming your computer or personal data, but selecting it might cause the program to function improperly.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE + CHECKBOX "This option can prevent computer viruses from harming your computer or personal data, but selecting it might cause the program to function improperly.", 14001, 25, 68, 200, 30, WS_DISABLED | BS_MULTILINE CHECKBOX "The following user:", 14002, 10, 100, 90, 10 LTEXT "User name:", -1, 20, 115, 60, 10 COMBOBOX 14003, 70, 115, 100, 15, CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP diff --git a/reactos/dll/win32/shell32/shell32_main.c b/reactos/dll/win32/shell32/shell32_main.c index 63f81f39b8f..a74ad804318 100644 --- a/reactos/dll/win32/shell32/shell32_main.c +++ b/reactos/dll/win32/shell32/shell32_main.c @@ -279,7 +279,7 @@ static DWORD shgfi_get_exe_type(LPCWSTR szFullPath) return 0; if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) { - return IMAGE_NT_SIGNATURE | + return IMAGE_NT_SIGNATURE | (nt.OptionalHeader.MajorSubsystemVersion << 24) | (nt.OptionalHeader.MinorSubsystemVersion << 16); } @@ -354,7 +354,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes, psfi, psfi->dwAttributes, sizeofpsfi, flags); - if ( (flags & SHGFI_USEFILEATTRIBUTES) && + if ( (flags & SHGFI_USEFILEATTRIBUTES) && (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL))) return FALSE; @@ -471,7 +471,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, { if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) strcatW (psfi->szTypeName, szFile); - else + else { WCHAR sTemp[64]; @@ -592,13 +592,13 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ strcpyW(sTemp, szFullPath); - if (flags & SHGFI_SYSICONINDEX) + if (flags & SHGFI_SYSICONINDEX) { psfi->iIcon = SIC_GetIconIndex(sTemp,icon_idx,0); if (psfi->iIcon == -1) psfi->iIcon = 0; } - else + else { IconNotYetLoaded=FALSE; if (flags & SHGFI_SMALLICON) @@ -747,7 +747,7 @@ HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon) * ExtractIconA [SHELL32.@] */ HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex) -{ +{ HICON ret; INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0); LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); @@ -824,7 +824,7 @@ VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON * pLargeIcon, HICON /************************************************************************* * Printers_RegisterWindowW [SHELL32.213] * used by "printui.dll": - * find the Window of the given Type for the specific Printer and + * find the Window of the given Type for the specific Printer and * return the already existent hwnd or open a new window */ BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, @@ -835,7 +835,7 @@ BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, phwnd, (phwnd != NULL) ? *(phwnd) : NULL); return FALSE; -} +} /************************************************************************* * Printers_UnregisterWindow [SHELL32.214] @@ -843,7 +843,7 @@ BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd) { FIXME("(%p, %p) stub!\n", hClassPidl, hwnd); -} +} /*************************************************************************/ diff --git a/reactos/dll/win32/shell32/shelllink.c b/reactos/dll/win32/shell32/shelllink.c index 1c1c37c194f..b49dac8a376 100644 --- a/reactos/dll/win32/shell32/shelllink.c +++ b/reactos/dll/win32/shell32/shelllink.c @@ -707,7 +707,7 @@ static HRESULT Stream_LoadLocation( IStream *stm, } /* if there's valid local volume information, load it */ - if( loc->dwVolTableOfs && + if( loc->dwVolTableOfs && ((loc->dwVolTableOfs + sizeof(LOCAL_VOLUME_INFO)) <= loc->dwTotalSize) ) { LOCAL_VOLUME_INFO *volume_info; @@ -748,7 +748,7 @@ static HRESULT Stream_LoadAdvertiseInfo( IStream* stm, LPWSTR *str ) ULONG count; HRESULT r; EXP_DARWIN_LINK buffer; - + TRACE("%p\n",stm); r = IStream_Read( stm, &buffer.dbh.cbSize, sizeof (DWORD), &count ); @@ -778,7 +778,7 @@ static HRESULT Stream_LoadAdvertiseInfo( IStream* stm, LPWSTR *str ) return E_FAIL; } - *str = HeapAlloc( GetProcessHeap(), 0, + *str = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(buffer.szwDarwinID)+1) * sizeof(WCHAR) ); lstrcpyW( *str, buffer.szwDarwinID ); @@ -837,7 +837,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( This->sProduct = NULL; HeapFree(GetProcessHeap(), 0, This->sComponent); This->sComponent = NULL; - + This->wHotKey = (WORD)hdr.wHotKey; This->iIcoNdx = hdr.nIcon; FileTimeToSystemTime (&hdr.Time1, &This->time1); @@ -954,7 +954,7 @@ end: /************************************************************************ * Stream_WriteString * - * Helper function for IPersistStream_Save. Writes a unicode string + * Helper function for IPersistStream_Save. Writes a unicode string * with terminating nul byte to a stream, preceded by the its length. */ static HRESULT Stream_WriteString( IStream* stm, LPCWSTR str ) @@ -1040,7 +1040,7 @@ static HRESULT Stream_WriteLocationInfo( IStream* stm, LPCWSTR path, static EXP_DARWIN_LINK* shelllink_build_darwinid( LPCWSTR string, DWORD magic ) { EXP_DARWIN_LINK *buffer; - + buffer = LocalAlloc( LMEM_ZEROINIT, sizeof *buffer ); buffer->dbh.cbSize = sizeof *buffer; buffer->dbh.dwSignature = magic; @@ -1054,7 +1054,7 @@ static HRESULT Stream_WriteAdvertiseInfo( IStream* stm, LPCWSTR string, DWORD ma { EXP_DARWIN_LINK *buffer; ULONG count; - + TRACE("%p\n",stm); buffer = shelllink_build_darwinid( string, magic ); @@ -1310,7 +1310,7 @@ HRESULT WINAPI IShellLink_ConstructFromFile( IUnknown* pUnkOuter, REFIID riid, if (SUCCEEDED(hr)) { WCHAR path[MAX_PATH]; - if (SHGetPathFromIDListW(pidl, path)) + if (SHGetPathFromIDListW(pidl, path)) hr = IPersistFile_Load(ppf, path, 0); else hr = E_FAIL; @@ -1660,7 +1660,7 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile) TRACE("(%p)->(path=%s)\n",This, pszFile); str = HEAP_strdupAtoW(GetProcessHeap(), 0, pszFile); - if( !str ) + if( !str ) return E_OUTOFMEMORY; r = IShellLinkW_SetPath((IShellLinkW*)&(This->lpvtblw), str); @@ -2532,7 +2532,7 @@ shelllink_get_msi_component_path( LPWSTR component ) return path; } -INT_PTR CALLBACK ExtendedShortcutProc( +INT_PTR CALLBACK ExtendedShortcutProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -2581,9 +2581,9 @@ INT_PTR CALLBACK ExtendedShortcutProc( * dialog proc of the shortcut property dialog */ -INT_PTR -CALLBACK -SH_ShellLinkDlgProc( +INT_PTR +CALLBACK +SH_ShellLinkDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, @@ -2607,7 +2607,7 @@ SH_ShellLinkDlgProc( ppsp = (LPPROPSHEETPAGEW)lParam; if (ppsp == NULL) break; - + TRACE("ShellLink_DlgProc (WM_INITDIALOG hwnd %p lParam %p ppsplParam %x)\n",hwndDlg, lParam, ppsp->lParam); This = (IShellLinkImpl *)ppsp->lParam; @@ -2632,7 +2632,7 @@ SH_ShellLinkDlgProc( SendMessageW( hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)This->sDescription ); return TRUE; case WM_NOTIFY: - lppsn = (LPPSHNOTIFY) lParam; + lppsn = (LPPSHNOTIFY) lParam; if ( lppsn->hdr.code == PSN_APPLY ) { /* set working directory */ @@ -2670,7 +2670,7 @@ SH_ShellLinkDlgProc( switch(LOWORD(wParam)) { case 14020: - /// + /// /// FIXME /// open target directory /// diff --git a/reactos/dll/win32/shell32/shellole.c b/reactos/dll/win32/shell32/shellole.c index e705b089e01..4ad43a2c080 100644 --- a/reactos/dll/win32/shell32/shellole.c +++ b/reactos/dll/win32/shell32/shellole.c @@ -299,7 +299,7 @@ DWORD WINAPI SHCLSIDFromStringAW (LPCVOID clsid, CLSID *id) * * Equivalent to CoGetMalloc(MEMCTX_TASK, ...). Under Windows 9x this function * could use the shell32 built-in "mini-COM" without the need to load ole32.dll - - * see SHLoadOLE for details. + * see SHLoadOLE for details. * * PARAMS * lpmal [O] Destination for IMalloc interface. @@ -322,7 +322,7 @@ HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal) * * Equivalent to CoTaskMemAlloc. Under Windows 9x this function could use * the shell32 built-in "mini-COM" without the need to load ole32.dll - - * see SHLoadOLE for details. + * see SHLoadOLE for details. * * NOTES * exported by ordinal @@ -344,7 +344,7 @@ LPVOID WINAPI SHAlloc(DWORD len) * * Equivalent to CoTaskMemFree. Under Windows 9x this function could use * the shell32 built-in "mini-COM" without the need to load ole32.dll - - * see SHLoadOLE for details. + * see SHLoadOLE for details. * * NOTES * exported by ordinal @@ -456,7 +456,7 @@ static ULONG WINAPI IDefClF_fnRelease(LPCLASSFACTORY iface) { IDefClFImpl *This = (IDefClFImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - + TRACE("(%p)->(count=%u)\n", This, refCount + 1); if (!refCount) diff --git a/reactos/dll/win32/shell32/shellord.c b/reactos/dll/win32/shell32/shellord.c index b0ad3300dae..53e5129f571 100644 --- a/reactos/dll/win32/shell32/shellord.c +++ b/reactos/dll/win32/shell32/shellord.c @@ -1197,10 +1197,10 @@ BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length) if( r == ERROR_SUCCESS ) { type = REG_BINARY; - r = RegQueryValueExW( hkey, szwSettings, + r = RegQueryValueExW( hkey, szwSettings, NULL, &type, (LPBYTE)cs, (LPDWORD)&length ); RegCloseKey( hkey ); - + } /* if we can't read from the registry, create default values */ @@ -1222,7 +1222,7 @@ BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length) cs->fAdminsCreateCommonGroups = TRUE; cs->fMenuEnumFilter = 96; } - + return TRUE; } @@ -1244,7 +1244,7 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *cs) NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); if( r == ERROR_SUCCESS ) { - r = RegSetValueExW( hkey, szwSettings, 0, + r = RegSetValueExW( hkey, szwSettings, 0, REG_BINARY, (LPBYTE) cs, cs->cLength); RegCloseKey( hkey ); @@ -1538,7 +1538,7 @@ DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString) /************************************************************************ * DoEnvironmentSubstW [SHELL32.@] * - * See DoEnvironmentSubstA. + * See DoEnvironmentSubstA. */ DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString) { @@ -1549,7 +1549,7 @@ DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString) /************************************************************************ * DoEnvironmentSubst [SHELL32.53] * - * See DoEnvironmentSubstA. + * See DoEnvironmentSubstA. */ DWORD WINAPI DoEnvironmentSubstAW(LPVOID x, UINT y) { diff --git a/reactos/dll/win32/shell32/shellpath.c b/reactos/dll/win32/shell32/shellpath.c index b9b7f1230f5..f750cdaba49 100644 --- a/reactos/dll/win32/shell32/shellpath.c +++ b/reactos/dll/win32/shell32/shellpath.c @@ -1615,7 +1615,7 @@ end: /************************************************************************* * SHGetFolderPathW [SHELL32.@] * - * Convert nFolder to path. + * Convert nFolder to path. * * RETURNS * Success: S_OK @@ -1649,7 +1649,7 @@ HRESULT WINAPI SHGetFolderPathW( DWORD folder = nFolder & CSIDL_FOLDER_MASK; CSIDL_Type type; int ret; - + TRACE("%p,%p,nFolder=0x%04x\n", hwndOwner,pszPath,nFolder); /* Windows always NULL-terminates the resulting path regardless of success @@ -1934,8 +1934,8 @@ static HRESULT _SHRegisterCommonShellFolders(void) /****************************************************************************** * _SHAppendToUnixPath [Internal] * - * Helper function for _SHCreateSymbolicLinks. Appends pwszSubPath (or the - * corresponding resource, if IS_INTRESOURCE) to the unix base path 'szBasePath' + * Helper function for _SHCreateSymbolicLinks. Appends pwszSubPath (or the + * corresponding resource, if IS_INTRESOURCE) to the unix base path 'szBasePath' * and replaces backslashes with slashes. * * PARAMS @@ -1975,24 +1975,24 @@ static inline BOOL _SHAppendToUnixPath(char *szBasePath, LPCWSTR pwszSubPath) { } else { lstrcpyW(wszSubPath, pwszSubPath); } - + if (szBasePath[cLen-1] != '/') szBasePath[cLen++] = '/'; - + if (!WideCharToMultiByte(CP_ACP, 0, wszSubPath, -1, szBasePath + cLen, FILENAME_MAX - cLen, NULL, NULL)) { return FALSE; } - + pBackslash = szBasePath + cLen; while ((pBackslash = strchr(pBackslash, '\\'))) *pBackslash = '/'; - + return TRUE; } #if 0 /****************************************************************************** * _SHCreateSymbolicLinks [Internal] - * + * * Sets up symbol links for various shell folders to point into the users home * directory. We do an educated guess about what the user would probably want: * - If there is a 'My Documents' directory in $HOME, the user probably wants @@ -2036,17 +2036,17 @@ static void _SHCreateSymbolicLinks(void) if (_SHAppendToUnixPath(szPersonalTarget, MAKEINTRESOURCEW(IDS_PERSONAL)) && !stat(szPersonalTarget, &statFolder) && S_ISDIR(statFolder.st_mode)) { - /* '$HOME/My Documents' exists. Create 'My Pictures', 'My Videos' and + /* '$HOME/My Documents' exists. Create 'My Pictures', 'My Videos' and * 'My Music' subfolders or fail silently if they already exist. */ for (i = 0; i < sizeof(aidsMyStuff)/sizeof(aidsMyStuff[0]); i++) { strcpy(szMyStuffTarget, szPersonalTarget); if (_SHAppendToUnixPath(szMyStuffTarget, MAKEINTRESOURCEW(aidsMyStuff[i]))) mkdir(szMyStuffTarget); } - } + } else { - /* '$HOME/My Documents' doesn't exists, but '$HOME' does. */ + /* '$HOME/My Documents' doesn't exists, but '$HOME' does. */ strcpy(szPersonalTarget, pszHome); } @@ -2076,7 +2076,7 @@ static void _SHCreateSymbolicLinks(void) if (FAILED(hr)) continue; pszMyStuff = wine_get_unix_file_name(wszTempPath); if (!pszMyStuff) continue; - + strcpy(szMyStuffTarget, szPersonalTarget); if (_SHAppendToUnixPath(szMyStuffTarget, MAKEINTRESOURCEW(aidsMyStuff[i])) && !stat(szMyStuffTarget, &statFolder) && S_ISDIR(statFolder.st_mode)) @@ -2084,7 +2084,7 @@ static void _SHCreateSymbolicLinks(void) /* If there's a 'My Whatever' directory where 'My Documents' links to, link to it. */ rmdir(pszMyStuff); symlink(szMyStuffTarget, pszMyStuff); - } + } else { /* Else link to where 'My Documents' itself links to. */ @@ -2101,7 +2101,7 @@ static void _SHCreateSymbolicLinks(void) { hr = SHGetFolderPathW(NULL, CSIDL_DESKTOPDIRECTORY|CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_DEFAULT, wszTempPath); - if (SUCCEEDED(hr) && (pszDesktop = wine_get_unix_file_name(wszTempPath))) + if (SUCCEEDED(hr) && (pszDesktop = wine_get_unix_file_name(wszTempPath))) { rmdir(pszDesktop); symlink(szDesktopTarget, pszDesktop); @@ -2125,7 +2125,7 @@ HRESULT SHELL_RegisterShellFolders(void) #if 0 _SHCreateSymbolicLinks(); #endif - + hr = _SHRegisterUserShellFolders(TRUE); if (SUCCEEDED(hr)) hr = _SHRegisterUserShellFolders(FALSE); @@ -2216,7 +2216,7 @@ HRESULT WINAPI SHGetFolderLocation( TRACE("%p 0x%08x %p 0x%08x %p\n", hwndOwner, nFolder, hToken, dwReserved, ppidl); - + if (!ppidl) return E_INVALIDARG; if (dwReserved) diff --git a/reactos/dll/win32/shell32/shellstring.c b/reactos/dll/win32/shell32/shellstring.c index a35e15cd96c..5eba435fc78 100644 --- a/reactos/dll/win32/shell32/shellstring.c +++ b/reactos/dll/win32/shell32/shellstring.c @@ -232,7 +232,7 @@ BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn) * length of actual string * * NOTES - * Not really sure if this function returns actually a value at all. + * Not really sure if this function returns actually a value at all. */ DWORD WINAPI CheckEscapesA( LPSTR string, /* [I/O] string to check ??*/ diff --git a/reactos/dll/win32/shell32/shfldr_desktop.c b/reactos/dll/win32/shell32/shfldr_desktop.c index 432d00e1d97..9c6a57edd24 100644 --- a/reactos/dll/win32/shell32/shfldr_desktop.c +++ b/reactos/dll/win32/shell32/shfldr_desktop.c @@ -166,7 +166,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, { /* it's a filesystem path with a drive. Let MyComputer/UnixDosFolder parse it */ #if 0 - if (UNIXFS_is_rooted_at_desktop()) + if (UNIXFS_is_rooted_at_desktop()) pidlTemp = _ILCreateGuid(PT_GUID, &CLSID_UnixDosFolder); else #endif @@ -408,10 +408,10 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface, { IGenericSFImpl *This = (IGenericSFImpl *)iface; HRESULT hr = S_OK; - static const DWORD dwDesktopAttributes = + static const DWORD dwDesktopAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER; - static const DWORD dwMyComputerAttributes = + static const DWORD dwMyComputerAttributes = SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER; @@ -425,13 +425,13 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface, if (*rgfInOut == 0) *rgfInOut = ~0; - + if(cidl == 0) { - *rgfInOut &= dwDesktopAttributes; + *rgfInOut &= dwDesktopAttributes; } else { while (cidl > 0 && *apidl) { pdump (*apidl); - if (_ILIsDesktop(*apidl)) { + if (_ILIsDesktop(*apidl)) { *rgfInOut &= dwDesktopAttributes; } else if (_ILIsMyComputer(*apidl)) { *rgfInOut &= dwMyComputerAttributes; diff --git a/reactos/dll/win32/shell32/shfldr_fs.c b/reactos/dll/win32/shell32/shfldr_fs.c index 0fa690df1b2..59b6dd2ff05 100644 --- a/reactos/dll/win32/shell32/shfldr_fs.c +++ b/reactos/dll/win32/shell32/shfldr_fs.c @@ -303,7 +303,7 @@ static ULONG WINAPI IShellFolder_fnRelease (IShellFolder2 * iface) /************************************************************************** * SHELL32_CreatePidlFromBindCtx [internal] * - * If the caller bound File System Bind Data, assume it is the + * If the caller bound File System Bind Data, assume it is the * find data for the path. * This allows binding of paths that don't exist. */ @@ -340,7 +340,7 @@ LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path) } IFileSystemBindData_Release( fsbd ); } - + return pidl; } @@ -702,12 +702,12 @@ static const WCHAR NeverShowExtW[] = { 'N','e','v','e','r','S','h','o','w','E', /****************************************************************************** * SHELL_FS_HideExtension [Internal] * - * Query the registry if the filename extension of a given path should be + * Query the registry if the filename extension of a given path should be * hidden. * * PARAMS * szPath [I] Relative or absolute path of a file - * + * * RETURNS * TRUE, if the filename's extension should be hidden * FALSE, otherwise. @@ -718,7 +718,7 @@ BOOL SHELL_FS_HideExtension(LPWSTR szPath) DWORD dwData; DWORD dwDataSize = sizeof (DWORD); BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */ - + if (!RegCreateKeyExW(HKEY_CURRENT_USER, AdvancedW, 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) { if (!RegQueryValueExW(hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData, &dwDataSize)) doHide = dwData; @@ -742,7 +742,7 @@ BOOL SHELL_FS_HideExtension(LPWSTR szPath) } return doHide; } - + void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags) { /*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */ @@ -788,7 +788,7 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, if (_ILIsDesktop(pidl)) { /* empty pidl */ if ((GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING) && - (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER)) + (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER)) { if (This->sPathTarget) lstrcpynW(pszPath, This->sPathTarget, MAX_PATH); @@ -798,8 +798,8 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, } } else if (_ILIsPidlSimple(pidl)) { if ((GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING) && - (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER) && - This->sPathTarget) + (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER) && + This->sPathTarget) { lstrcpynW(pszPath, This->sPathTarget, MAX_PATH); PathAddBackslashW(pszPath); @@ -879,7 +879,7 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, lstrcpynW(szDest + len, ext, MAX_PATH - len); } } - + TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest)); if (MoveFileW (szSrc, szDest)) { @@ -1176,11 +1176,11 @@ static WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pid WCHAR *wszListPos; int iPathLen; int i; - + iPathLen = lstrlenW(wszBasePath); wszPathsList = HeapAlloc(GetProcessHeap(), 0, MAX_PATH*sizeof(WCHAR)*cidl+1); wszListPos = wszPathsList; - + for (i = 0; i < cidl; i++) { if (!_ILIsFolder(pidls[i]) && !_ILIsValue(pidls[i])) continue; diff --git a/reactos/dll/win32/shell32/shfldr_mycomp.c b/reactos/dll/win32/shell32/shfldr_mycomp.c index 79ad9858589..d4d9c491c7d 100644 --- a/reactos/dll/win32/shell32/shfldr_mycomp.c +++ b/reactos/dll/win32/shell32/shfldr_mycomp.c @@ -442,7 +442,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, if (*rgfInOut == 0) *rgfInOut = ~0; - + if(cidl == 0){ IShellFolder *psfParent = NULL; LPCITEMIDLIST rpidl = NULL; @@ -535,7 +535,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface, hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*) &pObj); SHFree (pidl); } - else + else hr = E_NOINTERFACE; if (SUCCEEDED(hr) && !pObj) @@ -576,7 +576,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, pszPath[1] = ':'; SHELL32_GUIDToStringW(&CLSID_MyComputer, &pszPath[2]); } - else if (_ILIsPidlSimple(pidl)) + else if (_ILIsPidlSimple(pidl)) { /* take names of special folders only if its only this folder */ if (_ILIsSpecialFolder(pidl)) @@ -602,7 +602,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, /* * We can only get a filesystem path from a shellfolder * if the value WantsFORPARSING exists in - * CLSID\\{...}\\shellfolder + * CLSID\\{...}\\shellfolder * exception: the MyComputer folder has this keys not * but like any filesystem backed * folder it needs these behaviour @@ -613,7 +613,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, lstrcpyW (szRegPath, clsidW); SHELL32_GUIDToStringW (clsid, &szRegPath[6]); lstrcatW (szRegPath, shellfolderW); - r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath, + r = SHGetValueW (HKEY_CLASSES_ROOT, szRegPath, wantsForParsingW, NULL, NULL, NULL); if (r == ERROR_SUCCESS) bWantsForParsing = TRUE; @@ -659,7 +659,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, } } else if (_ILIsDrive(pidl)) - { + { _ILSimpleGetTextW (pidl, pszPath, MAX_PATH); /* append my own path */ /* long view "lw_name (C:)" */ @@ -680,7 +680,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface, strcpyW (pszPath, wszDrive); } } - else + else { /* Neither a shell namespace extension nor a drive letter. */ ERR("Wrong pidl type\n"); diff --git a/reactos/dll/win32/shell32/shfldr_printers.c b/reactos/dll/win32/shell32/shfldr_printers.c index 8fbac9755e1..3ee92805086 100644 --- a/reactos/dll/win32/shell32/shfldr_printers.c +++ b/reactos/dll/win32/shell32/shfldr_printers.c @@ -63,7 +63,7 @@ WINE_DEFAULT_DEBUG_CHANNEL (shell); typedef struct { IExtractIconWVtbl *lpVtbl; - IExtractIconAVtbl *lpvtblExtractIconA; + IExtractIconAVtbl *lpvtblExtractIconA; volatile LONG ref; LPITEMIDLIST pidl; } IExtractIconWImpl; @@ -286,7 +286,7 @@ static struct IExtractIconAVtbl eiavt = static IUnknown *IEI_Printers_Constructor(LPCITEMIDLIST pidl) { IExtractIconWImpl* ei; - + TRACE("%p\n", pidl); ei = HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl)); @@ -430,7 +430,7 @@ static BOOL CreatePrintersEnumList(IEnumIDList *list, DWORD dwFlags) { DWORD needed, num, i; PRINTER_INFO_4W *pi; - + EnumPrintersW(PRINTER_ENUM_LOCAL, NULL, 4, NULL, 0, &needed, &num); pi = HeapAlloc(GetProcessHeap(), 0, needed); if(!EnumPrintersW(PRINTER_ENUM_LOCAL, NULL, 4, (LPBYTE)pi, needed, &needed, &num)) { diff --git a/reactos/dll/win32/shell32/shlexec.c b/reactos/dll/win32/shell32/shlexec.c index 5640a76f531..5093bee2610 100644 --- a/reactos/dll/win32/shell32/shlexec.c +++ b/reactos/dll/win32/shell32/shlexec.c @@ -259,7 +259,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp else { used ++; - if (used < len) + if (used < len) *res++ = *fmt++; else fmt++; @@ -1044,7 +1044,7 @@ static HKEY ShellExecute_GetClassKey( LPSHELLEXECUTEINFOW sei ) if (sei->fMask & SEE_MASK_CLASSALL) return sei->hkeyClass; - + if (sei->fMask & SEE_MASK_CLASSNAME) lpClass = sei->lpClass; else @@ -1177,7 +1177,7 @@ static HRESULT shellex_run_context_menu_default( IShellExtInit *obj, ici.lpVerb = MAKEINTRESOURCEA( def ); ici.hwnd = sei->hwnd; ici.lpParametersW = sei->lpParameters; - + r = IContextMenu_InvokeCommand( cm, (LPCMINVOKECOMMANDINFO) &ici ); TRACE("invoke command returned %08x\n", r ); diff --git a/reactos/dll/win32/shell32/shlfileop.c b/reactos/dll/win32/shell32/shlfileop.c index 94c5546ab54..fb9ee60c83d 100644 --- a/reactos/dll/win32/shell32/shlfileop.c +++ b/reactos/dll/win32/shell32/shlfileop.c @@ -1015,7 +1015,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles) /* empty list */ if (!szFiles[0]) return ERROR_ACCESS_DENIED; - + flList->feFiles = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, flList->num_alloc * sizeof(FILE_ENTRY)); @@ -1119,7 +1119,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, FILE_ENTRY *feFrom, LPWSTR szDes /* Don't ask the user about overwriting files when he accepted to overwrite the folder. FIXME: this is not exactly what Windows does - e.g. there would be an additional confirmation for a nested folder */ - fileOp.fFlags |= FOF_NOCONFIRMATION; + fileOp.fFlags |= FOF_NOCONFIRMATION; SHFileOperationW(&fileOp); } @@ -1131,7 +1131,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, WCHAR *szFrom, WCHAR *szTo) if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FILE, PathFindFileNameW(szTo), op)) return 0; } - + return SHNotifyCopyFileW(szFrom, szTo, FALSE) == 0; } @@ -1344,7 +1344,7 @@ static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom) break; } } - + /* delete the file or directory */ if (IsAttribFile(fileEntry->attributes)) bPathExists = DeleteFileW(fileEntry->szFullPath); @@ -1540,7 +1540,7 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp) if (ret == ERROR_CANCELLED) lpFileOp->fAnyOperationsAborted = TRUE; - + return ret; } diff --git a/reactos/dll/win32/shell32/shlfolder.c b/reactos/dll/win32/shell32/shlfolder.c index b6bdd076d9c..9eaa12dda6b 100644 --- a/reactos/dll/win32/shell32/shlfolder.c +++ b/reactos/dll/win32/shell32/shlfolder.c @@ -80,7 +80,7 @@ static inline BOOL SHELL32_GetCustomFolderAttributeFromPath( PathAddBackslashW(pwszFolderPath); PathAppendW(pwszFolderPath, wszDesktopIni); - return GetPrivateProfileStringW(pwszHeading, pwszAttribute, wszDefault, + return GetPrivateProfileStringW(pwszHeading, pwszAttribute, wszDefault, pwszValue, cchValue, pwszFolderPath); } @@ -100,7 +100,7 @@ BOOL SHELL32_GetCustomFolderAttribute( if (!SHGetPathFromIDListW(pidl, wszFolderPath)) return FALSE; - return SHELL32_GetCustomFolderAttributeFromPath(wszFolderPath, pwszHeading, + return SHELL32_GetCustomFolderAttributeFromPath(wszFolderPath, pwszHeading, pwszAttribute, pwszValue, cchValue); } return FALSE; @@ -207,7 +207,7 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot, IPersistFolder3 *ppf; if (_ILIsFolder(pidlChild) && - SUCCEEDED (IUnknown_QueryInterface ((IUnknown *) * ppvOut, &IID_IPersistFolder3, (LPVOID *) & ppf))) + SUCCEEDED (IUnknown_QueryInterface ((IUnknown *) * ppvOut, &IID_IPersistFolder3, (LPVOID *) & ppf))) { PERSIST_FOLDER_TARGET_INFO ppfti; @@ -247,7 +247,7 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot, * SHELL32_BindToChild [Internal] * * Common code for IShellFolder_BindToObject. - * + * * PARAMS * pidlRoot [I] The parent shell folder's absolute pidl. * pathRoot [I] Absolute dos path of the parent shell folder. @@ -283,7 +283,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, CLSID clsidFolder = CLSID_ShellFSFolder; static const WCHAR wszCLSID[] = {'C','L','S','I','D',0}; WCHAR wszCLSIDValue[CHARS_IN_GUID], wszFolderPath[MAX_PATH], *pwszPathTail = wszFolderPath; - + /* see if folder CLSID should be overridden by desktop.ini file */ if (pathRoot) { lstrcpynW(wszFolderPath, pathRoot, MAX_PATH); @@ -403,7 +403,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO SFGAO_FOLDER | /*0x20000000 */ SFGAO_FILESYSTEM | /*0x40000000 */ SFGAO_HASSUBFOLDER; /*0x80000000 */ - + TRACE ("0x%08x\n", *pdwAttributes); if (*pdwAttributes & ~dwSupportedAttr) @@ -442,7 +442,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO } /* Set common attributes */ - *pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | + *pdwAttributes |= SFGAO_FILESYSTEM | SFGAO_DROPTARGET | SFGAO_HASPROPSHEET | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANCOPY; if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) diff --git a/reactos/dll/win32/shell32/shlfsbind.c b/reactos/dll/win32/shell32/shlfsbind.c index c50e74c3a95..50f5c92eda2 100644 --- a/reactos/dll/win32/shell32/shlfsbind.c +++ b/reactos/dll/win32/shell32/shlfsbind.c @@ -133,7 +133,7 @@ HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW * LPUNKNOWN pUnk; IFileSystemBindData *pfsbd = NULL; HRESULT ret; - + TRACE("%p, %p\n", pbc, pfd); ret = IBindCtx_GetObjectParam(pbc, (LPOLESTR)wFileSystemBindData, &pUnk); @@ -187,7 +187,7 @@ static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface) { IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - + TRACE("(%p)->(count=%i)\n", This, refCount + 1); if (!refCount) diff --git a/reactos/dll/win32/shell32/shlview.c b/reactos/dll/win32/shell32/shlview.c index 888268840bb..a22e33e93c5 100644 --- a/reactos/dll/win32/shell32/shlview.c +++ b/reactos/dll/win32/shell32/shlview.c @@ -1294,7 +1294,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn case NM_RCLICK: TRACE("-- NM_RCLICK %p\n",This); - break; + break; case NM_DBLCLK: TRACE("-- NM_DBLCLK %p\n",This); @@ -1622,7 +1622,7 @@ static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wPara case WM_GETDLGCODE: return SendMessageA(pThis->hWndList,uMessage,0,0); - case WM_DESTROY: + case WM_DESTROY: RevokeDragDrop(pThis->hWnd); SHChangeNotifyDeregister(pThis->hNotify); break; @@ -2220,7 +2220,7 @@ static HRESULT drag_notify_subitem(IShellViewImpl *This, DWORD grfKeyState, POIN HRESULT hr; RECT clientRect; - /* Map from global to client coordinates and query the index of the listview-item, which is + /* Map from global to client coordinates and query the index of the listview-item, which is * currently under the mouse cursor. */ htinfo.pt.x = pt.x; htinfo.pt.y = pt.y; @@ -2236,7 +2236,7 @@ static HRESULT drag_notify_subitem(IShellViewImpl *This, DWORD grfKeyState, POIN { This->cScrollDelay = (This->cScrollDelay + 1) % 5; /* DragOver is called every 50 ms */ if (This->cScrollDelay == 0) { /* Mouse did hover another 250 ms over the scroll-area */ - if (htinfo.pt.x < SCROLLAREAWIDTH) + if (htinfo.pt.x < SCROLLAREAWIDTH) SendMessageW(This->hWndList, WM_HSCROLL, SB_LINEUP, 0); if (htinfo.pt.x > clientRect.right - SCROLLAREAWIDTH) SendMessageW(This->hWndList, WM_HSCROLL, SB_LINEDOWN, 0); @@ -2249,11 +2249,11 @@ static HRESULT drag_notify_subitem(IShellViewImpl *This, DWORD grfKeyState, POIN This->cScrollDelay = 0; /* Reset, if the cursor is not over the listview's scroll-area */ } This->ptLastMousePos = htinfo.pt; - + /* If we are still over the previous sub-item, notify it via DragOver and return. */ if (This->pCurDropTarget && lResult == This->iDragOverItem) return IDropTarget_DragOver(This->pCurDropTarget, grfKeyState, pt, pdwEffect); - + /* We've left the previous sub-item, notify it via DragLeave and Release it. */ if (This->pCurDropTarget) { IDropTarget_DragLeave(This->pCurDropTarget); @@ -2265,7 +2265,7 @@ static HRESULT drag_notify_subitem(IShellViewImpl *This, DWORD grfKeyState, POIN if (lResult == -1) { /* We are not above one of the listview's subitems. Bind to the parent folder's * DropTarget interface. */ - hr = IShellFolder_QueryInterface(This->pSFParent, &IID_IDropTarget, + hr = IShellFolder_QueryInterface(This->pSFParent, &IID_IDropTarget, (LPVOID*)&This->pCurDropTarget); } else { /* Query the relative PIDL of the shellfolder object represented by the currently @@ -2281,7 +2281,7 @@ static HRESULT drag_notify_subitem(IShellViewImpl *This, DWORD grfKeyState, POIN } /* If anything failed, pCurDropTarget should be NULL now, which ought to be a save state. */ - if (FAILED(hr)) + if (FAILED(hr)) return hr; /* Notify the item just entered via DragEnter. */ @@ -2317,11 +2317,11 @@ static HRESULT WINAPI ISVDropTarget_DragLeave(IDropTarget *iface) { This->pCurDataObject = NULL; This->pCurDropTarget = NULL; This->iDragOverItem = 0; - + return S_OK; } -static HRESULT WINAPI ISVDropTarget_Drop(IDropTarget *iface, IDataObject* pDataObject, +static HRESULT WINAPI ISVDropTarget_Drop(IDropTarget *iface, IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) { IShellViewImpl *This = impl_from_IDropTarget(iface); diff --git a/reactos/dll/win32/shell32/shres.rc b/reactos/dll/win32/shell32/shres.rc index e62b95f810f..2394070bcf1 100644 --- a/reactos/dll/win32/shell32/shres.rc +++ b/reactos/dll/win32/shell32/shres.rc @@ -48,7 +48,7 @@ END /* - * This include a set of Shell32 icons, + * This include a set of Shell32 icons, * bitmaps and avi files. Licence's can be * found in the corresponding directorys */ diff --git a/reactos/dll/win32/shell32/shresdef.h b/reactos/dll/win32/shell32/shresdef.h index 401bf562f8e..e2ea79092f9 100644 --- a/reactos/dll/win32/shell32/shresdef.h +++ b/reactos/dll/win32/shell32/shresdef.h @@ -147,9 +147,9 @@ #define IDI_SHELL_CONFIRM_DELETE 161 #define IDI_SHELL_MY_DOCUMENTS 235 -/* +/* AVI resources, windows shell32 has 14 of them: 150-152 and 160-170 -FIXME: Need to add them, but for now just let them use the same: searching.avi +FIXME: Need to add them, but for now just let them use the same: searching.avi (also to limit shell32's size) */ #define IDR_AVI_SEARCH 150 diff --git a/reactos/dll/win32/shell32/shv_item_cmenu.c b/reactos/dll/win32/shell32/shv_item_cmenu.c index 35f6d9b14a3..fa1947ef340 100644 --- a/reactos/dll/win32/shell32/shv_item_cmenu.c +++ b/reactos/dll/win32/shell32/shv_item_cmenu.c @@ -782,7 +782,7 @@ HRESULT WINAPI SHCreateDefaultContextMenu( pcm = ISvItemCm_Constructor( pdcm->psf, pdcm->pidlFolder, pdcm->apidl, pdcm->cidl ); else pcm = ISvBgCm_Constructor( pdcm->psf, TRUE ); - + hr = S_OK; *ppv = pcm; diff --git a/reactos/dll/win32/shell32/systray.c b/reactos/dll/win32/shell32/systray.c index 2258eb9a568..4bb26fba365 100644 --- a/reactos/dll/win32/shell32/systray.c +++ b/reactos/dll/win32/shell32/systray.c @@ -87,7 +87,7 @@ BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid) nidW.u.uTimeout = pnid->u.uTimeout; nidW.dwInfoFlags = pnid->dwInfoFlags; } - + if (cbSize >= NOTIFYICONDATAA_V3_SIZE) nidW.guidItem = pnid->guidItem; diff --git a/reactos/dll/win32/shellext/devcpux/processor.c b/reactos/dll/win32/shellext/devcpux/processor.c index 6e4f2b243b4..4e8359d8b18 100644 --- a/reactos/dll/win32/shellext/devcpux/processor.c +++ b/reactos/dll/win32/shellext/devcpux/processor.c @@ -2,7 +2,7 @@ * PROJECT: ReactOS Shell Extensions * LICENSE: LGPL - See COPYING in the top level directory * FILE: dll\win32\shellext\devcpux\processor.c - * PURPOSE: + * PURPOSE: * COPYRIGHT: Copyright 2007 Christoph von Wittich * */ @@ -56,7 +56,7 @@ PropSheetExtProc(PSP_PROPSHEETPAGE_REQUEST PropPageRequest, LPFNADDPROPSHEETPAGE hPropSheetPage = CreatePropertySheetPage(&PropSheetPage); if(!hPropSheetPage) return FALSE; - + if(!(fAddFunc)(hPropSheetPage, lParam)) { DestroyPropertySheetPage (hPropSheetPage); return FALSE; diff --git a/reactos/dll/win32/shellext/slayer/lang/de-DE.rc b/reactos/dll/win32/shellext/slayer/lang/de-DE.rc index cc5246216c5..fd8358d351b 100644 --- a/reactos/dll/win32/shellext/slayer/lang/de-DE.rc +++ b/reactos/dll/win32/shellext/slayer/lang/de-DE.rc @@ -30,7 +30,7 @@ BEGIN PUSHBUTTON "&Abbrechen", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/en-US.rc b/reactos/dll/win32/shellext/slayer/lang/en-US.rc index 0ff5f96589f..de199c79ba3 100644 --- a/reactos/dll/win32/shellext/slayer/lang/en-US.rc +++ b/reactos/dll/win32/shellext/slayer/lang/en-US.rc @@ -30,7 +30,7 @@ BEGIN PUSHBUTTON "&Cancel", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/es-ES.rc b/reactos/dll/win32/shellext/slayer/lang/es-ES.rc index 1c3679198ef..a351760b825 100644 --- a/reactos/dll/win32/shellext/slayer/lang/es-ES.rc +++ b/reactos/dll/win32/shellext/slayer/lang/es-ES.rc @@ -35,7 +35,7 @@ BEGIN PUSHBUTTON "&Cancelar", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Capa de extención de compatibilidad para applicaciones" diff --git a/reactos/dll/win32/shellext/slayer/lang/fr-FR.rc b/reactos/dll/win32/shellext/slayer/lang/fr-FR.rc index 20a1556765e..97c017bd510 100644 --- a/reactos/dll/win32/shellext/slayer/lang/fr-FR.rc +++ b/reactos/dll/win32/shellext/slayer/lang/fr-FR.rc @@ -30,7 +30,7 @@ BEGIN PUSHBUTTON "&Annuler", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/hu-HU.rc b/reactos/dll/win32/shellext/slayer/lang/hu-HU.rc index ec6d93ef528..3cd327c8896 100644 --- a/reactos/dll/win32/shellext/slayer/lang/hu-HU.rc +++ b/reactos/dll/win32/shellext/slayer/lang/hu-HU.rc @@ -34,7 +34,7 @@ BEGIN PUSHBUTTON "&Mégse", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/id-ID.rc b/reactos/dll/win32/shellext/slayer/lang/id-ID.rc index b377502f8aa..839cb281dd1 100644 --- a/reactos/dll/win32/shellext/slayer/lang/id-ID.rc +++ b/reactos/dll/win32/shellext/slayer/lang/id-ID.rc @@ -30,7 +30,7 @@ BEGIN PUSHBUTTON "&Batal", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Kompatibilitas Aplikasi Ekstensi Lapisan Shell" diff --git a/reactos/dll/win32/shellext/slayer/lang/it-IT.rc b/reactos/dll/win32/shellext/slayer/lang/it-IT.rc index 2b2ccda015d..d47b1699443 100644 --- a/reactos/dll/win32/shellext/slayer/lang/it-IT.rc +++ b/reactos/dll/win32/shellext/slayer/lang/it-IT.rc @@ -31,7 +31,7 @@ BEGIN PUSHBUTTON "A&nnulla", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Estensione dell'ambiente per la compatibilià delle applicazioni" diff --git a/reactos/dll/win32/shellext/slayer/lang/nl-NL.rc b/reactos/dll/win32/shellext/slayer/lang/nl-NL.rc index 3cbabf75cc9..bd0dc0a84d8 100644 --- a/reactos/dll/win32/shellext/slayer/lang/nl-NL.rc +++ b/reactos/dll/win32/shellext/slayer/lang/nl-NL.rc @@ -30,7 +30,7 @@ BEGIN PUSHBUTTON "&Cancel", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/pl-PL.rc b/reactos/dll/win32/shellext/slayer/lang/pl-PL.rc index d89766e239c..8fbb8512a3a 100644 --- a/reactos/dll/win32/shellext/slayer/lang/pl-PL.rc +++ b/reactos/dll/win32/shellext/slayer/lang/pl-PL.rc @@ -32,7 +32,7 @@ BEGIN PUSHBUTTON "&Anuluj", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/ru-RU.rc b/reactos/dll/win32/shellext/slayer/lang/ru-RU.rc index 23eb2bb1e7c..59ded0cb2b3 100644 --- a/reactos/dll/win32/shellext/slayer/lang/ru-RU.rc +++ b/reactos/dll/win32/shellext/slayer/lang/ru-RU.rc @@ -37,7 +37,7 @@ BEGIN PUSHBUTTON "&Îòìåíà", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/sk-SK.rc b/reactos/dll/win32/shellext/slayer/lang/sk-SK.rc index 50e2790a8dd..06292db1eb1 100644 --- a/reactos/dll/win32/shellext/slayer/lang/sk-SK.rc +++ b/reactos/dll/win32/shellext/slayer/lang/sk-SK.rc @@ -37,7 +37,7 @@ BEGIN PUSHBUTTON "&Zruši", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Application Compatibility Layer Shell Extension" diff --git a/reactos/dll/win32/shellext/slayer/lang/sv-SE.rc b/reactos/dll/win32/shellext/slayer/lang/sv-SE.rc index eb9b08d4157..d96aa3a1e5f 100644 --- a/reactos/dll/win32/shellext/slayer/lang/sv-SE.rc +++ b/reactos/dll/win32/shellext/slayer/lang/sv-SE.rc @@ -32,7 +32,7 @@ BEGIN PUSHBUTTON "&Avbryt", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Tilläggsfliken Kompatibilitet" diff --git a/reactos/dll/win32/shellext/slayer/lang/uk-UA.rc b/reactos/dll/win32/shellext/slayer/lang/uk-UA.rc index 3b998237539..1dfcae2ab98 100644 --- a/reactos/dll/win32/shellext/slayer/lang/uk-UA.rc +++ b/reactos/dll/win32/shellext/slayer/lang/uk-UA.rc @@ -38,7 +38,7 @@ BEGIN PUSHBUTTON "&Ñêàñóâàòè", IDCANCEL, 162,116,60,14 END -STRINGTABLE +STRINGTABLE BEGIN IDS_SLAYER "Slayer" IDS_DESCRIPTION "Ðîçøèðåíÿ îáîëîíêè äëÿ Ïðîøàðêà ñóì³ñíîñò³ ïðîãðàì" diff --git a/reactos/dll/win32/shellext/slayer/slayer.c b/reactos/dll/win32/shellext/slayer/slayer.c index f116d2dab27..bfda5be0a8e 100644 --- a/reactos/dll/win32/shellext/slayer/slayer.c +++ b/reactos/dll/win32/shellext/slayer/slayer.c @@ -66,7 +66,7 @@ static VOID ClearCItemList(LPCOMPATIBILITYPAGE info) { PCITEM item, next; - + for (item = info->CItems; item != NULL; item = next) @@ -76,7 +76,7 @@ ClearCItemList(LPCOMPATIBILITYPAGE info) 0, item); } - + info->CSelectedItem = NULL; info->CItems = NULL; info->nItems = 0; @@ -320,7 +320,7 @@ FillComboBoxWithCompatibilityModes(LPCOMPATIBILITYPAGE info, CB_RESETCONTENT, 0, 0); - + for (item = info->CItems; item != NULL; item = item->next) @@ -340,7 +340,7 @@ FillComboBoxWithCompatibilityModes(LPCOMPATIBILITYPAGE info, } i++; } - + if (!sel && bSelectItem && i > 0) { /* select the first item */ @@ -511,7 +511,7 @@ ApplySettings(LPCOMPATIBILITYPAGE this, TCHAR szFlags[256]; BOOL enabled = IsDlgButtonChecked(hwndDlg, IDC_CHKRUNCOMPATIBILITY) == BST_CHECKED; - + if (enabled) { HWND hCombo = GetDlgItem(hwndDlg, @@ -961,7 +961,7 @@ DllUnregisterServer(VOID) LONG e; HKEY hk; WCHAR szGuid[40]; - + StringFromGUID2(&CLSID_ICompatibilityPage, szGuid, sizeof(szGuid) / sizeof(szGuid[0])); diff --git a/reactos/dll/win32/shlwapi/assoc.c b/reactos/dll/win32/shlwapi/assoc.c index caac8279a9b..b08719722ee 100644 --- a/reactos/dll/win32/shlwapi/assoc.c +++ b/reactos/dll/win32/shlwapi/assoc.c @@ -414,7 +414,7 @@ HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc /************************************************************************** * AssocIsDangerous (SHLWAPI.@) - * + * * Determine if a file association is dangerous (potentially malware). * * PARAMS @@ -468,7 +468,7 @@ static ULONG WINAPI IQueryAssociations_fnAddRef(IQueryAssociations *iface) { IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - + TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); return refCount; @@ -491,7 +491,7 @@ static ULONG WINAPI IQueryAssociations_fnRelease(IQueryAssociations *iface) TRACE("Destroying IQueryAssociations (%p)\n", This); HeapFree(GetProcessHeap(), 0, This); } - + return refCount; } diff --git a/reactos/dll/win32/shlwapi/istream.c b/reactos/dll/win32/shlwapi/istream.c index ff93b77621f..34efbed6eb0 100644 --- a/reactos/dll/win32/shlwapi/istream.c +++ b/reactos/dll/win32/shlwapi/istream.c @@ -82,7 +82,7 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface) { ISHFileStream *This = (ISHFileStream *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - + TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); return refCount; @@ -94,10 +94,10 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface) static ULONG WINAPI IStream_fnRelease(IStream *iface) { ISHFileStream *This = (ISHFileStream *)iface; - ULONG refCount = InterlockedDecrement(&This->ref); + ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); - + if (!refCount) { IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ @@ -105,7 +105,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) CloseHandle(This->hFile); HeapFree(GetProcessHeap(), 0, This); } - + return refCount; } diff --git a/reactos/dll/win32/shlwapi/ordinal.c b/reactos/dll/win32/shlwapi/ordinal.c index 6ebabfaf2e3..972f676dfd3 100644 --- a/reactos/dll/win32/shlwapi/ordinal.c +++ b/reactos/dll/win32/shlwapi/ordinal.c @@ -2140,7 +2140,7 @@ typedef struct /************************************************************************* * @ [SHLWAPI.208] * - * Initialize an FDSA arrary. + * Initialize an FDSA arrary. */ BOOL WINAPI FDSA_Initialize(DWORD block_size, DWORD inc, FDSA_info *info, void *mem, DWORD init_blocks) @@ -2152,7 +2152,7 @@ BOOL WINAPI FDSA_Initialize(DWORD block_size, DWORD inc, FDSA_info *info, void * if(mem) memset(mem, 0, block_size * init_blocks); - + info->num_items = 0; info->inc = inc; info->mem = mem; @@ -4195,7 +4195,7 @@ DWORD WINAPI SHGetShellKey(DWORD a, DWORD b, DWORD c) /*********************************************************************** * SHQueueUserWorkItem (SHLWAPI.@) */ -BOOL WINAPI SHQueueUserWorkItem(LPTHREAD_START_ROUTINE pfnCallback, +BOOL WINAPI SHQueueUserWorkItem(LPTHREAD_START_ROUTINE pfnCallback, LPVOID pContext, LONG lPriority, DWORD_PTR dwTag, DWORD_PTR *pdwId, LPCSTR pszModule, DWORD dwFlags) { @@ -4297,7 +4297,7 @@ DWORD WINAPI GetUIVersion(void) /*********************************************************************** * ShellMessageBoxWrapW [SHLWAPI.388] * - * loads a string resource for a module, displays the string in a + * loads a string resource for a module, displays the string in a * message box and writes it into the logfile * * PARAMS @@ -4408,7 +4408,7 @@ PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(PSHELL_USER_PERMISSION *a BOOL ret = TRUE; if (!memcmp((void*)sid, (void*)&null_sid, sizeof(SHELL_USER_SID))) - { /* current user's SID */ + { /* current user's SID */ if (!cur_user) { HANDLE Token; @@ -4460,14 +4460,14 @@ PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(PSHELL_USER_PERMISSION *a case ACCESS_ALLOWED_ACE_TYPE: if (!AddAccessAllowedAce(pAcl, ACL_REVISION, sup->dwAccessMask, sid)) goto error; - if (sup->fInherit && !AddAccessAllowedAceEx(pAcl, ACL_REVISION, + if (sup->fInherit && !AddAccessAllowedAceEx(pAcl, ACL_REVISION, (BYTE)sup->dwInheritMask, sup->dwInheritAccessMask, sid)) goto error; break; case ACCESS_DENIED_ACE_TYPE: if (!AddAccessDeniedAce(pAcl, ACL_REVISION, sup->dwAccessMask, sid)) goto error; - if (sup->fInherit && !AddAccessDeniedAceEx(pAcl, ACL_REVISION, + if (sup->fInherit && !AddAccessDeniedAceEx(pAcl, ACL_REVISION, (BYTE)sup->dwInheritMask, sup->dwInheritAccessMask, sid)) goto error; break; diff --git a/reactos/dll/win32/shlwapi/path.c b/reactos/dll/win32/shlwapi/path.c index b2005c1e787..cad43a36c89 100644 --- a/reactos/dll/win32/shlwapi/path.c +++ b/reactos/dll/win32/shlwapi/path.c @@ -3308,7 +3308,7 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, while(*pszPath == '\\') pszPath++; - + if(isalphaW(*pszPath) && pszPath[1] == '|' && pszPath[2] == '\\') /* c|\ -> c:\ */ pszPath[1] = ':'; diff --git a/reactos/dll/win32/shlwapi/reg.c b/reactos/dll/win32/shlwapi/reg.c index 1f528834695..86f96612320 100644 --- a/reactos/dll/win32/shlwapi/reg.c +++ b/reactos/dll/win32/shlwapi/reg.c @@ -210,7 +210,7 @@ LONG WINAPI SHRegCloseUSKey( * SHRegCreateUSKeyA [SHLWAPI.@] * * Create or open a user-specific registry key. - * + * * PARAMS * pszPath [I] Key name to create or open. * samDesired [I] Wanted security access. @@ -251,7 +251,7 @@ LONG WINAPI SHRegCreateUSKeyW(LPCWSTR pszPath, REGSAM samDesired, HUSKEY hRelati * PARAMS * hUSKey [I] Handle to an open registry key. * pszValue [I] Empty key name. - * delRegFlags [I] Flag that specifies the base from which to delete + * delRegFlags [I] Flag that specifies the base from which to delete * the key. * * RETURNS @@ -1550,7 +1550,7 @@ DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey) } if (dwRet == ERROR_NO_MORE_ITEMS) dwRet = ERROR_SUCCESS; - + if (lpszName != szNameBuf) HeapFree(GetProcessHeap(), 0, lpszName); /* Free buffer if allocated */ } diff --git a/reactos/dll/win32/shlwapi/regstream.c b/reactos/dll/win32/shlwapi/regstream.c index 6aca8f937ef..e86833b98f9 100644 --- a/reactos/dll/win32/shlwapi/regstream.c +++ b/reactos/dll/win32/shlwapi/regstream.c @@ -78,7 +78,7 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface) { ISHRegStream *This = (ISHRegStream *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - + TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); return refCount; diff --git a/reactos/dll/win32/shlwapi/string.c b/reactos/dll/win32/shlwapi/string.c index b2cd7f28e47..34204da2c68 100644 --- a/reactos/dll/win32/shlwapi/string.c +++ b/reactos/dll/win32/shlwapi/string.c @@ -66,8 +66,8 @@ static void FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal_buffer, int decimal_bu fmt->lpThousandSep = thousand_buffer; fmt->lpDecimalSep = decimal_buffer; - /* - * Converting grouping string to number as described on + /* + * Converting grouping string to number as described on * http://blogs.msdn.com/oldnewthing/archive/2006/04/18/578251.aspx */ fmt->Grouping = 0; @@ -113,7 +113,7 @@ static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf) } while (qdwValue > 0); if (neg) *(--c) = '-'; - + return GetNumberFormatW(LOCALE_USER_DEFAULT, 0, c, &fmt, pszBuf, cchBuf); } @@ -132,7 +132,7 @@ static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf) WCHAR buf[64]; NUMBERFMTW fmt; WCHAR decimal[8], thousand[8]; - + snprintfW(buf, 64, flfmt, value); FillNumberFmt(&fmt, decimal, sizeof decimal / sizeof (WCHAR), @@ -1558,7 +1558,7 @@ HRESULT WINAPI StrRetToBSTR(STRRET *lpStrRet, LPCITEMIDLIST pidl, BSTR* pBstrOut LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) { WCHAR wszBuf[256]; - + if (!StrFormatKBSizeW(llBytes, wszBuf, 256)) return NULL; if (!WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, lpszDest, cchMax, NULL, NULL)) @@ -2699,7 +2699,7 @@ HRESULT WINAPI SHLoadIndirectString(LPCWSTR src, LPWSTR dst, UINT dst_len, void *index_str = 0; index_str++; index = atoiW(index_str); - + hmod = LoadLibraryW(dllname); if(!hmod) goto end; diff --git a/reactos/dll/win32/shlwapi/url.c b/reactos/dll/win32/shlwapi/url.c index 68d93093856..f2542b96444 100644 --- a/reactos/dll/win32/shlwapi/url.c +++ b/reactos/dll/win32/shlwapi/url.c @@ -425,7 +425,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, state = 3; break; } - + /* Now at root location, cannot back up any more. */ /* "root" will point at the '/' */ @@ -1044,7 +1044,7 @@ HRESULT WINAPI UrlEscapeW( for(src = pszUrl; *src; ) { WCHAR cur = *src; len = 0; - + if((int_flags & WINE_URL_COLLAPSE_SLASHES) && src == pszUrl + parsed_url.cchProtocol + 1) { int localhost_len = sizeof(localhost)/sizeof(WCHAR) - 1; while(cur == '/' || cur == '\\') { @@ -1443,7 +1443,7 @@ HRESULT WINAPI HashData(const unsigned char *lpSrc, DWORD nSrcLen, * pszUrl [I] Url to hash * lpDest [O] Destinationh for hash * nDestLen [I] Length of lpDest - * + * * RETURNS * Success: S_OK. lpDest is filled with the computed hash value. * Failure: E_INVALIDARG, if any argument is invalid. @@ -2178,7 +2178,7 @@ BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) /************************************************************************* * UrlCreateFromPathA [SHLWAPI.@] - * + * * See UrlCreateFromPathW */ HRESULT WINAPI UrlCreateFromPathA(LPCSTR pszPath, LPSTR pszUrl, LPDWORD pcchUrl, DWORD dwReserved) diff --git a/reactos/dll/win32/smdll/query.c b/reactos/dll/win32/smdll/query.c index 665f42dba08..606c0571a6e 100644 --- a/reactos/dll/win32/smdll/query.c +++ b/reactos/dll/win32/smdll/query.c @@ -32,7 +32,7 @@ * set and must match the SmInformationClass info size; * ReturnedDataLength: optional pointer to storage to receive * the size of the returnede data. - * + * * RETURN VALUE * STATUS_SUCCESS: OK you get what you asked for; * STATUS_INFO_LENGTH_MISMATCH: you set DataLength to 0 or to a @@ -40,7 +40,7 @@ * requires; * STATUS_INVALID_PARAMETER_2: bad information class; * A port error. - * + * */ NTSTATUS STDCALL SmQueryInformation (IN HANDLE hSmApiPort, diff --git a/reactos/dll/win32/snmpapi/snmpapi.c b/reactos/dll/win32/snmpapi/snmpapi.c index d1ab1ca1152..c6bfeb150e4 100644 --- a/reactos/dll/win32/snmpapi/snmpapi.c +++ b/reactos/dll/win32/snmpapi/snmpapi.c @@ -166,7 +166,7 @@ SnmpSvcInitUptime() /* * @implemented */ -DWORD +DWORD SNMP_FUNC_TYPE SnmpSvcGetUptime() { diff --git a/reactos/dll/win32/syssetup/lang/cs-CZ.rc b/reactos/dll/win32/syssetup/lang/cs-CZ.rc index 36237fdfe1e..20306882cf3 100644 --- a/reactos/dll/win32/syssetup/lang/cs-CZ.rc +++ b/reactos/dll/win32/syssetup/lang/cs-CZ.rc @@ -40,7 +40,7 @@ BEGIN LTEXT "Vývojáøi systému ReactOS by rádi zmínili následující Open Source projekty."\ "Tyto projekty (nebo jejich èásti) byly použity pøi vývoji systému ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS je licencován pod GPL. Pokud chcete systém (nebo jeho èásti) použít "\ "nebo redistribuovat, musíte respektovat GPL", @@ -77,7 +77,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE LTEXT "Instalátor vytvoøí uživatelský úèet nazvaný Administrator. "\ "Mùžete tento úèet použít, pokud budete potøebovat úplný pøístup k Vašemu poèítaèi.", - IDC_STATIC, 54, 57, 250, 25 + IDC_STATIC, 54, 57, 250, 25 LTEXT "Zadejte heslo úètu Administrator o délce 14 znakù nebo ménì.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Heslo:", IDC_STATIC, 54, 104, 75, 8 @@ -156,7 +156,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/de-DE.rc b/reactos/dll/win32/syssetup/lang/de-DE.rc index 1508b99710f..ae96805830c 100644 --- a/reactos/dll/win32/syssetup/lang/de-DE.rc +++ b/reactos/dll/win32/syssetup/lang/de-DE.rc @@ -41,7 +41,7 @@ BEGIN LTEXT "Die ReactOS Programmierer möchten folgende Open Source Projekte anerkennen, "\ "die (teils) verwendet wurden, um ReactOS zu erstellen:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS ist unter der GPL veröffentlicht, wenn Sie (Teile von) ReactOS wiederverwenden "\ "oder wiederveröffentlichen wollen, müssen Sie die Bestimmungen der GPL anerkennen.", @@ -157,7 +157,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/el-GR.rc b/reactos/dll/win32/syssetup/lang/el-GR.rc index c0a2c628def..f920e264ed0 100644 --- a/reactos/dll/win32/syssetup/lang/el-GR.rc +++ b/reactos/dll/win32/syssetup/lang/el-GR.rc @@ -41,7 +41,7 @@ BEGIN LTEXT "Ïé õðåýèõíïé ãéá ôçí áíÜðôõîç ôïõ ReactOS èá Þèåëáí íá áíáãíùñßóïõí ôéò ðáñáêÜôù åñãáóßåò "\ "åëåýèåñïõ ëïãéóìéêïý, (ìÝñç ôùí ïðïßùí) ÷ñçóéìïðïéÞèçêáí ãéá ôçí áíÜðôõîç ôïõ ReactOS:", IDC_STATIC,15,4,286,25 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "Ôï ReactOS óáò Ý÷åé äïèåß óýìöùíá ìå ôçí Üäåéá GPL, Ýôóé áí èÝëåôå íá îáíá÷ñçóéìïðïéÞóåôå "\ "Þ íá åðáíáäéáíåßìåôå ìÝñç ôïõ Þ ïëüëêëçñï ôï Reactos, ðñÝðåé íá ôçñåßôå ôçí GPL.", @@ -158,7 +158,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "ÃåíéêÞ ¢äåéá ×ñÞóçò GNU" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/en-US.rc b/reactos/dll/win32/syssetup/lang/en-US.rc index 802183fd12a..fae1d407c06 100644 --- a/reactos/dll/win32/syssetup/lang/en-US.rc +++ b/reactos/dll/win32/syssetup/lang/en-US.rc @@ -41,7 +41,7 @@ BEGIN LTEXT "The ReactOS developers would like to acknowledge the following Open Source projects, "\ "(parts of) which were used to create ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS is licensed under the GPL, so if you want to reuse or redistribute "\ "(parts of) it you must respect the GPL", @@ -158,7 +158,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/es-ES.rc b/reactos/dll/win32/syssetup/lang/es-ES.rc index e3c3d3b2f5b..e00f4af4b8a 100644 --- a/reactos/dll/win32/syssetup/lang/es-ES.rc +++ b/reactos/dll/win32/syssetup/lang/es-ES.rc @@ -47,7 +47,7 @@ BEGIN LTEXT "The ReactOS developers would like to acknowledge the following Open Source projects, "\ "(parts of) which were used to create ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS is licensed under the GPL, so if you want to reuse or redistribute "\ "(parts of) it you must respect the GPL", @@ -168,7 +168,7 @@ BEGIN "La computadora sera recargada automaticamente en 15 segundos o si presiona el "\ "boton de recargar.", IDC_STATIC, 13, 33, 212, 32 /* GROUPBOX "", -1, 7, 3, 231, 106 */ - CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 + CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 PUSHBUTTON "&Recargar", IDOK, 98, 87, 50, 14 END @@ -178,7 +178,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/fr-FR.rc b/reactos/dll/win32/syssetup/lang/fr-FR.rc index 9610241458c..75aeecc0a54 100644 --- a/reactos/dll/win32/syssetup/lang/fr-FR.rc +++ b/reactos/dll/win32/syssetup/lang/fr-FR.rc @@ -42,7 +42,7 @@ BEGIN LTEXT "Les développeurs de ReactOS voudraient présenter les projets Open Source suivants, "\ "(ou seulement des composants) qui ont été utilisés pour créer ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS est sous license GPL, ainsi si vous voulez le réutiliser ou le redistribuer "\ "(ou seulement des composants) vous devez respecter la GPL", @@ -158,7 +158,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/hu-HU.rc b/reactos/dll/win32/syssetup/lang/hu-HU.rc index 2a321378c61..abf36891ede 100644 --- a/reactos/dll/win32/syssetup/lang/hu-HU.rc +++ b/reactos/dll/win32/syssetup/lang/hu-HU.rc @@ -40,7 +40,7 @@ BEGIN LTEXT "A ReactOS fejlesztõk szeretnének köszönetet mondani az alábbi Open Source projekteknek "\ "amiket (részben) felhasználtak a ReactOS fejlesztéséhez:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "A ReactOS a GPL licenszével rendelkezik, így felhasználásához és terjesztéséhez "\ "ezt a licenszt kell figyelembe venni.", @@ -160,7 +160,7 @@ BEGIN "A számítógép 15 másodperc múlva újraindul, vagy azonnal ha rákattintasz "\ "az Újraindítás gombra.", IDC_STATIC, 13, 33, 212, 32 // GROUPBOX "", -1, 7, 3, 231, 106 - CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 + CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 PUSHBUTTON "&Újraindítás", IDOK, 98, 87, 50, 14 END*/ @@ -170,7 +170,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/id-ID.rc b/reactos/dll/win32/syssetup/lang/id-ID.rc index b950eade33f..b304d655f5a 100644 --- a/reactos/dll/win32/syssetup/lang/id-ID.rc +++ b/reactos/dll/win32/syssetup/lang/id-ID.rc @@ -39,7 +39,7 @@ BEGIN LTEXT "The ReactOS developers would like to acknowledge the following Open Source projects, "\ "(parts of) which were used to create ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS is licensed under the GPL, so if you want to reuse or redistribute "\ "(parts of) it you must respect the GPL", @@ -156,7 +156,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/it-IT.rc b/reactos/dll/win32/syssetup/lang/it-IT.rc index fee61a6bd85..b85296c8f6f 100644 --- a/reactos/dll/win32/syssetup/lang/it-IT.rc +++ b/reactos/dll/win32/syssetup/lang/it-IT.rc @@ -32,7 +32,7 @@ BEGIN LTEXT "Gli sviluppatori di ReactOS desiderano citare i seguenti progetti Open Source, "\ "che sono stati usati (in tutto o in parte) per creare ReactOS:", IDC_STATIC,20,7,286,19 - LISTBOX IDC_PROJECTS,20,30,280,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,20,30,280,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS è soggetto alla licenza GPL, per cui se si desidera riusarlo o ridistribuirlo "\ "(in tutto o in parte) è necessario rispettare la GPL", @@ -149,7 +149,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/ja-JP.rc b/reactos/dll/win32/syssetup/lang/ja-JP.rc index 70d7f17e985..3e122c0c070 100644 --- a/reactos/dll/win32/syssetup/lang/ja-JP.rc +++ b/reactos/dll/win32/syssetup/lang/ja-JP.rc @@ -41,7 +41,7 @@ BEGIN LTEXT "ReactOS ‚ÌŠJ”­ŽÒ‚æ‚èAˆÈ‰º‚̃I[ƒvƒ“ƒ\\[ƒX ƒvƒƒWƒFƒNƒg‚ÉŠ´ŽÓ‚̈ӂð•\\–¾‚µ‚Ü‚·B"\ "ReactOS 쬂ɂ͂±‚ê‚ç‚̃I[ƒvƒ“ƒ\\[ƒX ƒvƒƒWƒFƒNƒg‚ª—p‚¢‚ç‚ê‚Ü‚µ‚½:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS ‚Í GPL ‚̉º‚щƒCƒZƒ“ƒX‚³‚ê‚Ä‚¨‚èAReactOS ‚â‚»‚̈ꕔ‚ðÄ—˜—p‚â"\ "”z•z‚ð‚·‚é‚É‚Í GPL ‚É]‚í‚È‚­‚Ä‚Í‚È‚è‚Ü‚¹‚ñB", @@ -158,7 +158,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 9, "MS UI Gothic" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/nl-NL.rc b/reactos/dll/win32/syssetup/lang/nl-NL.rc index 542057041b8..5ac0ff975e6 100644 --- a/reactos/dll/win32/syssetup/lang/nl-NL.rc +++ b/reactos/dll/win32/syssetup/lang/nl-NL.rc @@ -41,7 +41,7 @@ BEGIN LTEXT "The ReactOS developers would like to acknowledge the following Open Source projects, "\ "(parts of) which were used to create ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS is licensed under the GPL, so if you want to reuse or redistribute "\ "(parts of) it you must respect the GPL", @@ -158,7 +158,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/pl-PL.rc b/reactos/dll/win32/syssetup/lang/pl-PL.rc index 5e6b55fe965..db156d7765c 100644 --- a/reactos/dll/win32/syssetup/lang/pl-PL.rc +++ b/reactos/dll/win32/syssetup/lang/pl-PL.rc @@ -1,6 +1,6 @@ -/* +/* * translated by Caemyr - */ + */ /* * Copyright (C) 2004 Filip Navara * Copyright (C) 2004 Eric Kohl diff --git a/reactos/dll/win32/syssetup/lang/ru-RU.rc b/reactos/dll/win32/syssetup/lang/ru-RU.rc index c8ef397f8b2..1d016e85dc5 100644 --- a/reactos/dll/win32/syssetup/lang/ru-RU.rc +++ b/reactos/dll/win32/syssetup/lang/ru-RU.rc @@ -23,7 +23,7 @@ BEGIN LTEXT "Ðàçðàáîò÷èêè ReactOS è Open Source-ïðîåêòû, áëàãîäàðÿ êîòîðûì "\ "áûëà ñîçäàíà ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS ðàñïðîñòðàíÿåòñÿ ïîä ëèöåíçèåé GPL, åñëè "\ "âû õîòèòå èñïîëüçîâàòü è ðàñïðîñòðàíÿòü åå, âû äîëæíû ñîáëþäàòü GPL.", @@ -139,7 +139,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/uk-UA.rc b/reactos/dll/win32/syssetup/lang/uk-UA.rc index 9f53d16add8..87aff1f9bf0 100644 --- a/reactos/dll/win32/syssetup/lang/uk-UA.rc +++ b/reactos/dll/win32/syssetup/lang/uk-UA.rc @@ -30,7 +30,7 @@ BEGIN LTEXT "Ðîçðîáíèêè ReactOS õîò³ëè á ïîäÿêóâàòè íàñòóïíèì Open Source ïðîåêòàì, "\ "ùî (÷àñòêîâî) âèêîðèñòîâóâàëèñÿ ïðè ñòâîðåíí³ ReactOS:", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS ë³öåíçóºòüñÿ ïî GPL, òàê ùî ÿêùî Âè õî÷åòå ïîâòîðíî âèêîðèñòîâóâàòè "\ "àáî ïîøèðþâàòè éîãî (÷àñòèíè), Âè ìàºòå ïîâàæàòè GPL", @@ -147,7 +147,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU General Public License" FONT 8, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "OK",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/lang/zh-CN.rc b/reactos/dll/win32/syssetup/lang/zh-CN.rc index ca669a01829..12fc7a01bc0 100644 --- a/reactos/dll/win32/syssetup/lang/zh-CN.rc +++ b/reactos/dll/win32/syssetup/lang/zh-CN.rc @@ -32,7 +32,7 @@ BEGIN LTEXT "ReactOS µÄ¿ª·¢ÈËÔ±¾ÍÒÔϵÄ×ÔÓÉÈí¼þÏîÄ¿±íʾ¸Ðл¡£"\ "ÔÚ½¨Á¢ ReactOS ʱʹÓÃÁËÆäÖеĴúÂë :", IDC_STATIC,15,7,286,19 - LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | + LISTBOX IDC_PROJECTS,15,30,286,75,LBS_NOSEL | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL LTEXT "ReactOS ÊÇ»ùÓÚGPLЭÒé·¢²¼µÄ£¬Òò´ËÈç¹ûÄúÐèÒªÔÙÓûòÖØз¢²¼ ReactOS "\ "(»ò²¿·Ö)±ØÐë×ñÑ­GPLÐí¿É¡£", @@ -146,7 +146,7 @@ STYLE DS_CENTER | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "GNU ͨÓù«¹²Ðí¿ÉÖ¤" FONT 9, "MS Shell Dlg" BEGIN - EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | + EDITTEXT IDC_GPL_TEXT,7,7,319,190,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL DEFPUSHBUTTON "È·¶¨",IDOK,141,209,50,14 END diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index b6fe0526e6a..ed07a307134 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -432,7 +432,7 @@ WriteOwnerSettings(TCHAR * OwnerName, RegCloseKey(hKey); return FALSE; } - + res = RegSetValueEx(hKey, _T("RegisteredOrganization"), 0, @@ -506,7 +506,7 @@ OwnerPageDlgProc(HWND hwndDlg, SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME)); SetWindowLong(hwndDlg, DWL_MSGRESULT, -1); - + return TRUE; } @@ -1450,7 +1450,7 @@ DateTimePageDlgProc(HWND hwndDlg, SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)SetupData); CreateTimeZoneList(SetupData); - + if (SetupData->UnattendSetup) { ShowTimeZoneList(GetDlgItem(hwndDlg, IDC_TIMEZONELIST), @@ -1607,7 +1607,7 @@ RegistrationNotificationProc(PVOID Context, if (SPREG_TIMEOUT != StatusInfo->FailureCode) { FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, - StatusInfo->Win32Error, 0, + StatusInfo->Win32Error, 0, ErrorMessage + wcslen(ErrorMessage), sizeof(ErrorMessage) / sizeof(ErrorMessage[0]) - wcslen(ErrorMessage), NULL); @@ -1730,7 +1730,7 @@ StartComponentRegistration(HWND hwndDlg, PULONG MaxProgress) INFCONTEXT Context; WCHAR SectionName[512]; PREGISTRATIONDATA RegistrationData; - + DllCount = -1; if (! SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2", L"RegisterDlls", &Context)) @@ -1967,7 +1967,7 @@ FinishDlgProc(HWND hwndDlg, case PSN_SETACTIVE: /* Enable the correct buttons on for the active page */ PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH); - + SendDlgItemMessage(hwndDlg, IDC_RESTART_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0, 300)); SendDlgItemMessage(hwndDlg, IDC_RESTART_PROGRESS, PBM_SETPOS, 0, 0); @@ -2016,7 +2016,7 @@ ProcessUnattendInf(HINF hUnattendedInf) DPRINT1("Error: Cant find UnattendSetupEnabled Key! %d\n", GetLastError()); return FALSE; } - + if (!SetupGetStringField(&InfContext, 1, szValue, @@ -2026,13 +2026,13 @@ ProcessUnattendInf(HINF hUnattendedInf) DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError()); return FALSE; } - + if (_tcscmp(szValue, _T("yes")) != 0) { DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n"); return FALSE; - } - + } + if (!SetupFindFirstLine(hUnattendedInf, _T("Unattend"), NULL, @@ -2041,10 +2041,10 @@ ProcessUnattendInf(HINF hUnattendedInf) DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError()); return FALSE; } - - + + do - { + { if (!SetupGetStringField(&InfContext, 0, szName, @@ -2103,9 +2103,9 @@ ProcessUnattendInf(HINF hUnattendedInf) } else if (!_tcscmp(szName, _T("DisableVmwInst"))) { - if(!_tcscmp(szValue, _T("yes"))) + if(!_tcscmp(szValue, _T("yes"))) SetupData.DisableVmwInst = 1; - else + else SetupData.DisableVmwInst = 0; } else if (!_tcscmp(szName, _T("BootCDRegTestActive"))) @@ -2136,7 +2136,7 @@ ProcessUnattendInf(HINF hUnattendedInf) int i = 0; do { - if(SetupGetStringField(&InfContext, + if(SetupGetStringField(&InfContext, 0, szValue, sizeof(szValue) / sizeof(TCHAR), @@ -2150,7 +2150,7 @@ ProcessUnattendInf(HINF hUnattendedInf) { DPRINT("value %S\n", szPath); if (RegSetValueEx(hKey, - szName, + szName, 0, REG_SZ, (const BYTE*)szPath, @@ -2203,7 +2203,7 @@ ProcessUnattendInf(HINF hUnattendedInf) } strcpy(&szPath[length], "dbgprint.exe SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n"); fwrite(szPath, 1, strlen(szPath) + 1, file); - strcpy(&szPath[length], "shutdown.exe -s"); + strcpy(&szPath[length], "shutdown.exe -s"); fwrite(szPath, 1, strlen(szPath) + 1, file); } fclose(file); @@ -2215,10 +2215,10 @@ ProcessUnattendInf(HINF hUnattendedInf) /* * GetRosInstallCD should find the path to ros installation medium * BUG 1 - * If there are more than one CDDrive in it containing a ReactOS + * If there are more than one CDDrive in it containing a ReactOS * installation cd, then it will pick the first one regardless if * it is really the installation cd - * + * * The best way to implement this is to set the key * HKLM\Software\Microsoft\Windows NT\CurrentVersion\SourcePath (REG_SZ) */ @@ -2275,8 +2275,8 @@ ProcessUnattendSetup() dwLength = wcslen(szPath); if (dwLength + 21 > MAX_PATH) { - /* FIXME - * allocate bigger buffer + /* FIXME + * allocate bigger buffer */ return; } @@ -2306,9 +2306,9 @@ InstallWizard(VOID) /* Clear setup data */ ZeroMemory(&SetupData, sizeof(SETUPDATA)); - + ProcessUnattendSetup(); - + /* Create the Welcome page */ psp.dwSize = sizeof(PROPSHEETPAGE); diff --git a/reactos/dll/win32/urlmon/binding.c b/reactos/dll/win32/urlmon/binding.c index aaadbd87638..43b5e04681b 100644 --- a/reactos/dll/win32/urlmon/binding.c +++ b/reactos/dll/win32/urlmon/binding.c @@ -196,7 +196,7 @@ static HWND get_notif_hwnd(void) notif_wnd_proc, 0, 0, NULL, NULL, NULL, NULL, NULL, wszURLMonikerNotificationWindow, - NULL + NULL }; wndclass.hInstance = URLMON_hInstance; diff --git a/reactos/dll/win32/urlmon/file.c b/reactos/dll/win32/urlmon/file.c index 8d7b444b9d6..4951798195a 100644 --- a/reactos/dll/win32/urlmon/file.c +++ b/reactos/dll/win32/urlmon/file.c @@ -246,7 +246,7 @@ static HRESULT WINAPI FileProtocol_Read(IInternetProtocol *iface, void *pv, if(pcbRead) *pcbRead = read; - + return cb == read ? S_OK : S_FALSE; } @@ -362,6 +362,6 @@ HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) ret->ref = 1; *ppobj = PROTOCOL(ret); - + return S_OK; } diff --git a/reactos/dll/win32/urlmon/ftp.c b/reactos/dll/win32/urlmon/ftp.c index 6db8fe5af0a..33fe5671935 100644 --- a/reactos/dll/win32/urlmon/ftp.c +++ b/reactos/dll/win32/urlmon/ftp.c @@ -197,6 +197,6 @@ HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) ret->ref = 1; *ppobj = PROTOCOL(ret); - + return S_OK; } diff --git a/reactos/dll/win32/urlmon/http.c b/reactos/dll/win32/urlmon/http.c index 8dc343264d9..e7297cfa94a 100644 --- a/reactos/dll/win32/urlmon/http.c +++ b/reactos/dll/win32/urlmon/http.c @@ -927,6 +927,6 @@ HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) ret->ref = 1; *ppobj = PROTOCOL(ret); - + return S_OK; } diff --git a/reactos/dll/win32/urlmon/internet.c b/reactos/dll/win32/urlmon/internet.c index 26269823610..5a42532b147 100644 --- a/reactos/dll/win32/urlmon/internet.c +++ b/reactos/dll/win32/urlmon/internet.c @@ -43,7 +43,7 @@ static HRESULT parse_schema(LPCWSTR url, DWORD flags, LPWSTR result, DWORD size, if(flags) ERR("wrong flags\n"); - + ptr = strchrW(url, ':'); if(ptr) len = ptr-url; @@ -219,7 +219,7 @@ HRESULT WINAPI CoInternetCombineUrl(LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, IInternetProtocolInfo *protocol_info; DWORD size = cchResult; HRESULT hres; - + TRACE("(%s,%s,0x%08x,%p,%d,%p,%d)\n", debugstr_w(pwzBaseUrl), debugstr_w(pwzRelativeUrl), dwCombineFlags, pwzResult, cchResult, pcchResult, dwReserved); diff --git a/reactos/dll/win32/urlmon/sec_mgr.c b/reactos/dll/win32/urlmon/sec_mgr.c index 609ca4f7ddd..615d5dfd3e1 100644 --- a/reactos/dll/win32/urlmon/sec_mgr.c +++ b/reactos/dll/win32/urlmon/sec_mgr.c @@ -271,7 +271,7 @@ static HRESULT WINAPI SecManagerImpl_MapUrlToZone(IInternetSecurityManager *ifac return hres; } -static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *iface, +static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *iface, LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved) { SecManagerImpl *This = SECMGR_THIS(iface); @@ -375,7 +375,7 @@ static HRESULT WINAPI SecManagerImpl_ProcessUrlAction(IInternetSecurityManager * FIXME("Default action is not implemented\n"); return E_NOTIMPL; } - + static HRESULT WINAPI SecManagerImpl_QueryCustomPolicy(IInternetSecurityManager *iface, LPCWSTR pwszUrl, REFGUID guidKey, @@ -574,7 +574,7 @@ static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface) HeapFree(GetProcessHeap(), 0, This); URLMON_UnlockModule(); } - + return refCount; } diff --git a/reactos/dll/win32/urlmon/session.c b/reactos/dll/win32/urlmon/session.c index a57a8dce82e..06c10b6d5c2 100644 --- a/reactos/dll/win32/urlmon/session.c +++ b/reactos/dll/win32/urlmon/session.c @@ -78,7 +78,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, TRACE("Could not open protocol handler key\n"); return E_FAIL; } - + size = sizeof(str_clsid); res = RegQueryValueExW(hkey, wszCLSID, NULL, &type, (LPBYTE)str_clsid, &size); RegCloseKey(hkey); @@ -340,7 +340,7 @@ static BOOL get_url_encoding(HKEY root, DWORD *encoding) DWORD size = sizeof(DWORD), res, type; HKEY hkey; - static const WCHAR wszKeyName[] = + static const WCHAR wszKeyName[] = {'S','O','F','T','W','A','R','E', '\\','M','i','c','r','o','s','o','f','t', '\\','W','i','n','d','o','w','s', diff --git a/reactos/dll/win32/urlmon/umon.c b/reactos/dll/win32/urlmon/umon.c index b8c6bfeffff..a2a7bcc9537 100644 --- a/reactos/dll/win32/urlmon/umon.c +++ b/reactos/dll/win32/urlmon/umon.c @@ -408,7 +408,7 @@ static HRESULT WINAPI URLMonikerImpl_IsDirty(IMoniker* iface) static HRESULT WINAPI URLMonikerImpl_Load(IMoniker* iface,IStream* pStm) { URLMonikerImpl *This = (URLMonikerImpl *)iface; - + HRESULT res; ULONG size; ULONG got; @@ -610,7 +610,7 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, url.nPort = INTERNET_DEFAULT_FTP_PORT; dwService = INTERNET_SERVICE_FTP; break; - + case INTERNET_SCHEME_GOPHER: if (!url.nPort) url.nPort = INTERNET_DEFAULT_GOPHER_PORT; @@ -715,7 +715,7 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, InternetCloseHandle(bind->hrequest); hres = S_OK; } - + InternetCloseHandle(bind->hconnect); InternetCloseHandle(bind->hinternet); } while(0); @@ -776,7 +776,7 @@ static HRESULT WINAPI URLMonikerImpl_Reduce(IMoniker* iface, IMoniker** ppmkReduced) { URLMonikerImpl *This = (URLMonikerImpl *)iface; - + TRACE("(%p,%p,%d,%p,%p)\n",This,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced); if(!ppmkReduced) @@ -860,7 +860,7 @@ static HRESULT WINAPI URLMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherM static HRESULT WINAPI URLMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash) { URLMonikerImpl *This = (URLMonikerImpl *)iface; - + int h = 0,i,skip,len; int off = 0; LPOLESTR val; @@ -959,14 +959,14 @@ static HRESULT WINAPI URLMonikerImpl_GetDisplayName(IMoniker* iface, LPOLESTR *ppszDisplayName) { URLMonikerImpl *This = (URLMonikerImpl *)iface; - + int len; - + TRACE("(%p,%p,%p,%p)\n",This,pbc,pmkToLeft,ppszDisplayName); - + if(!ppszDisplayName) return E_INVALIDARG; - + /* FIXME: If this is a partial URL, try and get a URL moniker from SZ_URLCONTEXT in the bind context, then look at pmkToLeft to try and complete the URL */ @@ -1093,7 +1093,7 @@ HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback, * CreateAsyncBindCtxEx (URLMON.@) * * Create an asynchronous bind context. - */ + */ HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx** pbind, DWORD reserved) @@ -1173,7 +1173,7 @@ HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker IBindCtx_Release(bind); } } - + hres = URLMonikerImpl_Construct(obj, lefturl, szURL); CoTaskMemFree(lefturl); if(SUCCEEDED(hres)) @@ -1229,7 +1229,7 @@ HRESULT WINAPI CoInternetQueryInfo(LPCWSTR pwzUrl, QUERYOPTION QueryOption, HRESULT WINAPI IsAsyncMoniker(IMoniker *pmk) { IUnknown *am; - + TRACE("(%p)\n", pmk); if(!pmk) return E_INVALIDARG; @@ -1384,20 +1384,20 @@ HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN pCaller, FIXME("(%p,%s,%s,%08x,%p) cannot accept NULL strings !\n", pCaller, debugstr_a(szURL), debugstr_a(szFileName), dwReserved, lpfnCB); return E_INVALIDARG; /* The error code is not specified in this case... */ } - + if (RtlCreateUnicodeStringFromAsciiz(&szURL_w, szURL)) { if (RtlCreateUnicodeStringFromAsciiz(&szFileName_w, szFileName)) { HRESULT ret = URLDownloadToFileW(pCaller, szURL_w.Buffer, szFileName_w.Buffer, dwReserved, lpfnCB); RtlFreeUnicodeString(&szURL_w); RtlFreeUnicodeString(&szFileName_w); - + return ret; } else { RtlFreeUnicodeString(&szURL_w); } } - + FIXME("(%p,%s,%s,%08x,%p) could not allocate W strings !\n", pCaller, szURL, szFileName, dwReserved, lpfnCB); return E_OUTOFMEMORY; } @@ -1447,7 +1447,7 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, hinternet = InternetOpenW(wszAppName, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); if (hinternet == NULL) { return E_OUTOFMEMORY; - } + } memset(&url, 0, sizeof(url)); url.dwStructSize = sizeof(url); @@ -1467,7 +1467,7 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, return S_OK; } } - + hcon = InternetConnectW(hinternet, url.lpszHostName, url.nPort, url.lpszUserName, url.lpszPassword, INTERNET_SERVICE_HTTP, 0, 0); @@ -1475,13 +1475,13 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, InternetCloseHandle(hinternet); return E_OUTOFMEMORY; } - + hreq = HttpOpenRequestW(hcon, NULL, url.lpszUrlPath, NULL, NULL, NULL, 0, 0); if (!hreq) { InternetCloseHandle(hinternet); InternetCloseHandle(hcon); return E_OUTOFMEMORY; - } + } if (!HttpSendRequestW(hreq, NULL, 0, NULL, 0)) { InternetCloseHandle(hinternet); @@ -1489,18 +1489,18 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, InternetCloseHandle(hreq); return E_OUTOFMEMORY; } - + if (HttpQueryInfoW(hreq, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &total_size, &arg_size, NULL)) { TRACE(" total size : %d\n", total_size); } - + hfile = CreateFileW(szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); if (hfile == INVALID_HANDLE_VALUE) { return E_ACCESSDENIED; } - + if (lpfnCB) { if (IBindStatusCallback_OnProgress(lpfnCB, 0, total_size != 0xFFFFFFFF ? total_size : 0, BINDSTATUS_BEGINDOWNLOADDATA, szURL) == E_ABORT) { @@ -1511,7 +1511,7 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, return S_OK; } } - + total = 0; while (1) { r = InternetReadFile(hreq, buffer, sizeof(buffer), &sz); @@ -1519,13 +1519,13 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, InternetCloseHandle(hreq); InternetCloseHandle(hcon); InternetCloseHandle(hinternet); - + CloseHandle(hfile); - return E_OUTOFMEMORY; + return E_OUTOFMEMORY; } if (!sz) break; - + total += sz; if (lpfnCB) { @@ -1538,12 +1538,12 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, return S_OK; } } - + if (!WriteFile(hfile, buffer, sz, &written, NULL)) { InternetCloseHandle(hreq); InternetCloseHandle(hcon); InternetCloseHandle(hinternet); - + CloseHandle(hfile); return E_OUTOFMEMORY; } @@ -1559,11 +1559,11 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, return S_OK; } } - + InternetCloseHandle(hreq); InternetCloseHandle(hcon); InternetCloseHandle(hinternet); - + CloseHandle(hfile); return S_OK; @@ -1668,7 +1668,7 @@ HRESULT WINAPI HlinkSimpleNavigateToString( LPCWSTR szTarget, HRESULT WINAPI HlinkNavigateString( IUnknown *pUnk, LPCWSTR szTarget ) { TRACE("%p %s\n", pUnk, debugstr_w( szTarget ) ); - return HlinkSimpleNavigateToString( + return HlinkSimpleNavigateToString( szTarget, NULL, NULL, pUnk, NULL, NULL, 0, 0 ); } diff --git a/reactos/dll/win32/urlmon/umstream.c b/reactos/dll/win32/urlmon/umstream.c index cd5e1538720..e7827c49dd1 100644 --- a/reactos/dll/win32/urlmon/umstream.c +++ b/reactos/dll/win32/urlmon/umstream.c @@ -218,7 +218,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) return refCount; } -static HRESULT WINAPI IStream_fnRead (IStream * iface, +static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRead) diff --git a/reactos/dll/win32/urlmon/urlmon_main.c b/reactos/dll/win32/urlmon/urlmon_main.c index bbd7cc59208..8b1e3fdab6f 100644 --- a/reactos/dll/win32/urlmon/urlmon_main.c +++ b/reactos/dll/win32/urlmon/urlmon_main.c @@ -143,7 +143,7 @@ static HRESULT WINAPI CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, ClassFactory *This = (ClassFactory*)iface; HRESULT hres; LPUNKNOWN punk; - + TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); *ppobj = NULL; @@ -187,7 +187,7 @@ static const ClassFactory SecurityManagerCF = { &ClassFactoryVtbl, SecManagerImpl_Construct}; static const ClassFactory ZoneManagerCF = { &ClassFactoryVtbl, ZoneMgrImpl_Construct}; - + struct object_creation_info { const CLSID *clsid; @@ -260,9 +260,9 @@ static void init_session(BOOL init) HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { int i; - + TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - + for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) { if (IsEqualGUID(object_creation[i].clsid, rclsid)) @@ -322,7 +322,7 @@ HRESULT WINAPI ObtainUserAgentString(DWORD dwOption, LPSTR pcszUAOut, DWORD *cbS /************************************************************************** * IsValidURL (URLMON.@) - * + * * Determines if a specified string is a valid URL. * * PARAMS @@ -341,10 +341,10 @@ HRESULT WINAPI ObtainUserAgentString(DWORD dwOption, LPSTR pcszUAOut, DWORD *cbS HRESULT WINAPI IsValidURL(LPBC pBC, LPCWSTR szURL, DWORD dwReserved) { FIXME("(%p, %s, %d): stub\n", pBC, debugstr_w(szURL), dwReserved); - + if (pBC != NULL || dwReserved != 0) return E_INVALIDARG; - + return S_OK; } diff --git a/reactos/dll/win32/urlmon/urlmon_main.h b/reactos/dll/win32/urlmon/urlmon_main.h index 46ec6714b9f..743ab48a1a4 100644 --- a/reactos/dll/win32/urlmon/urlmon_main.h +++ b/reactos/dll/win32/urlmon/urlmon_main.h @@ -43,7 +43,7 @@ static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_ref #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) typedef struct -{ +{ const IStreamVtbl *lpVtbl; LONG ref; HANDLE handle; diff --git a/reactos/dll/win32/user32/De.rc b/reactos/dll/win32/user32/De.rc index 33ede2129fb..7c891570a80 100644 --- a/reactos/dll/win32/user32/De.rc +++ b/reactos/dll/win32/user32/De.rc @@ -8,7 +8,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL // SELWINDOW DIALOG DISCARDABLE 20, 20, 220, 140 -STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | +STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Fenster Auswählen" diff --git a/reactos/dll/win32/user32/Fr.rc b/reactos/dll/win32/user32/Fr.rc index b4eda02c31e..b2e647e052f 100644 --- a/reactos/dll/win32/user32/Fr.rc +++ b/reactos/dll/win32/user32/Fr.rc @@ -1,5 +1,5 @@ //French Translation -//Benoit Plante (aka cmoibenlepro) +//Benoit Plante (aka cmoibenlepro) //2005 LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL diff --git a/reactos/dll/win32/user32/Sv.rc b/reactos/dll/win32/user32/Sv.rc index a58f7437b71..c7d6ad66fda 100644 --- a/reactos/dll/win32/user32/Sv.rc +++ b/reactos/dll/win32/user32/Sv.rc @@ -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 */ - + LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL ///////////////////////////////////////////////////////////////////////////// diff --git a/reactos/dll/win32/user32/controls/button.c b/reactos/dll/win32/user32/controls/button.c index 4a9e1307e9d..ff806fe3526 100644 --- a/reactos/dll/win32/user32/controls/button.c +++ b/reactos/dll/win32/user32/controls/button.c @@ -22,11 +22,11 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 3, 2004, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * * TODO * Styles * - BS_NOTIFY: is it complete? @@ -43,7 +43,7 @@ * - BCM_GETTEXTMARGIN * - BCM_SETIMAGELIST * - BCM_SETTEXTMARGIN - * + * * Notifications * - BCN_HOTITEMCHANGE * - BN_DISABLE @@ -915,7 +915,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) rtext.left += checkBoxWidth + 4; rbox.right = checkBoxWidth; } - + /* Since WM_ERASEBKGND does nothing, first prepare background */ if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush ); if (action == ODA_DRAWENTIRE) FillRect( hDC, &client, hBrush ); @@ -923,7 +923,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) /* Draw label */ client = rtext; dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &rtext); - + /* Only adjust rbox when rtext is valid */ if (dtFlags != (UINT)-1L) { @@ -948,11 +948,11 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) /* rbox must have the correct height */ delta = rbox.bottom - rbox.top - checkBoxHeight; - + if (style & BS_TOP) { if (delta > 0) { rbox.bottom = rbox.top + checkBoxHeight; - } else { + } else { rbox.top -= -delta/2 + 1; rbox.bottom = rbox.top + checkBoxHeight; } diff --git a/reactos/dll/win32/user32/controls/combo.c b/reactos/dll/win32/user32/controls/combo.c index 3af54b9a67b..a5db5ad5800 100644 --- a/reactos/dll/win32/user32/controls/combo.c +++ b/reactos/dll/win32/user32/controls/combo.c @@ -21,11 +21,11 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 4, 2004, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. - * + * * TODO: * - ComboBox_[GS]etMinVisible() * - CB_GETMINVISIBLE, CB_SETMINVISIBLE @@ -434,7 +434,7 @@ static void CBCalcPlacement( /* don't allow negative window width */ if (lprEdit->right < lprEdit->left) lprEdit->right = lprEdit->left; - + TRACE("\ttext\t= (%ld,%ld-%ld,%ld)\n", lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom); diff --git a/reactos/dll/win32/user32/controls/edit.c b/reactos/dll/win32/user32/controls/edit.c index 3e942367885..5a543e61b13 100644 --- a/reactos/dll/win32/user32/controls/edit.c +++ b/reactos/dll/win32/user32/controls/edit.c @@ -24,7 +24,7 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 8, 2004, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. @@ -1058,13 +1058,13 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, } break; - - /* IME messages to make the edit control IME aware */ + + /* IME messages to make the edit control IME aware */ case WM_IME_SETCONTEXT: break; case WM_IME_STARTCOMPOSITION: - /* + /* * FIXME in IME: This message is not always sent like it should be */ if (es->selection_start != es->selection_end) @@ -1080,7 +1080,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, if (es->composition_len == 0) { if (es->selection_start != es->selection_end) - { + { static const WCHAR empty_stringW[] = {0}; EDIT_EM_ReplaceSel(es, TRUE, empty_stringW, TRUE, TRUE); } @@ -1102,7 +1102,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, case WM_IME_CONTROL: break; - + default: result = DefWindowProcT(hwnd, msg, wParam, lParam, unicode); break; @@ -2429,7 +2429,7 @@ static void EDIT_SetCaretPos(EDITSTATE *es, INT pos, static void EDIT_AdjustFormatRect(EDITSTATE *es) { RECT ClientRect; - + es->format_rect.right = max(es->format_rect.right, es->format_rect.left + es->char_width); if (es->style & ES_MULTILINE) { @@ -2464,7 +2464,7 @@ static void EDIT_AdjustFormatRect(EDITSTATE *es) if ((es->style & ES_MULTILINE) && !(es->style & ES_AUTOHSCROLL)) EDIT_BuildLineDefs_ML(es, 0, strlenW(es->text), 0, NULL); - + EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP); } @@ -2482,13 +2482,13 @@ static void EDIT_SetRectNP(EDITSTATE *es, LPRECT rc) LONG_PTR ExStyle; INT bw, bh; ExStyle = GetWindowLongPtrW(es->hwndSelf, GWL_EXSTYLE); - + CopyRect(&es->format_rect, rc); - + if (ExStyle & WS_EX_CLIENTEDGE) { es->format_rect.left++; es->format_rect.right--; - + if (es->format_rect.bottom - es->format_rect.top >= es->line_height + 2) { @@ -2508,7 +2508,7 @@ static void EDIT_SetRectNP(EDITSTATE *es, LPRECT rc) es->format_rect.bottom -= bh; } } - + es->format_rect.left += es->left_margin; es->format_rect.right -= es->right_margin; EDIT_AdjustFormatRect(es); @@ -3333,7 +3333,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac if (e != s) for (i = 0 , p = es->text ; i < e - s ; i++) p[i + s] = buf[i]; - EDIT_BuildLineDefs_ML(es, s, e, + EDIT_BuildLineDefs_ML(es, s, e, abs(es->selection_end - es->selection_start) - strl, hrgn); strl = 0; e = s; @@ -3354,7 +3354,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac EDIT_NOTIFY_PARENT(es, EN_MAXTEXT); } } - + if (e != s) { if (can_undo) { utl = strlenW(es->undo_text); @@ -3406,7 +3406,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac if (bufl) HeapFree(GetProcessHeap(), 0, buf); - + s += strl; /* If text has been deleted and we're right or center aligned then scroll rightward */ @@ -3824,7 +3824,7 @@ static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, es->right_margin = default_right_margin; es->format_rect.right -= es->right_margin; } - + if (action & (EC_LEFTMARGIN | EC_RIGHTMARGIN)) { EDIT_AdjustFormatRect(es); if (repaint) EDIT_UpdateText(es, NULL, TRUE); @@ -4256,7 +4256,7 @@ static void EDIT_WM_Copy(EDITSTATE *es) static LRESULT EDIT_WM_Create(EDITSTATE *es, LPCWSTR name) { RECT clientRect; - + TRACE("%s\n", debugstr_w(name)); /* * To initialize some final structure members, we call some helper @@ -4266,7 +4266,7 @@ static LRESULT EDIT_WM_Create(EDITSTATE *es, LPCWSTR name) */ EDIT_WM_SetFont(es, 0, FALSE); EDIT_EM_EmptyUndoBuffer(es); - + /* We need to calculate the format rect (applications may send EM_SETMARGINS before the control gets visible) */ GetClientRect(es->hwndSelf, &clientRect); @@ -4960,7 +4960,7 @@ static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc) /* paint the border and the background */ IntersectClipRect(dc, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); - + if(es->style & WS_BORDER) { bw = GetSystemMetrics(SM_CXBORDER); bh = GetSystemMetrics(SM_CYBORDER); @@ -4969,7 +4969,7 @@ static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc) if(es->style & WS_HSCROLL) rc.bottom+=bh; if(es->style & WS_VSCROLL) rc.right+=bw; } - + /* Draw the frame. Same code as in nonclient.c */ old_brush = SelectObject(dc, GetSysColorBrush(COLOR_WINDOWFRAME)); PatBlt(dc, rc.left, rc.top, rc.right - rc.left, bh, PATCOPY); @@ -4977,12 +4977,12 @@ static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc) PatBlt(dc, rc.left, rc.bottom - 1, rc.right - rc.left, -bw, PATCOPY); PatBlt(dc, rc.right - 1, rc.top, -bw, rc.bottom - rc.top, PATCOPY); SelectObject(dc, old_brush); - + /* Keep the border clean */ IntersectClipRect(dc, rc.left+bw, rc.top+bh, max(rc.right-bw, rc.left+bw), max(rc.bottom-bh, rc.top+bh)); } - + GetClipBox(dc, &rc); FillRect(dc, &rc, brush); @@ -5098,7 +5098,7 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw) if (font) SelectObject(dc, old_font); ReleaseDC(es->hwndSelf, dc); - + /* Reset the format rect and the margins */ GetClientRect(es->hwndSelf, &clientRect); EDIT_SetRectNP(es, &clientRect); @@ -5152,14 +5152,14 @@ static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text, BOOL unicode) "selection.\n"); EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE); - if (text) + if (text) { TRACE("%s\n", debugstr_w(text)); EDIT_EM_ReplaceSel(es, FALSE, text, FALSE, FALSE); if(!unicode) HeapFree(GetProcessHeap(), 0, (LPWSTR)text); - } - else + } + else { static const WCHAR empty_stringW[] = {0}; TRACE("\n"); @@ -5179,7 +5179,7 @@ static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text, BOOL unicode) EDIT_NOTIFY_PARENT(es, EN_CHANGE); } EDIT_EM_ScrollCaret(es); - EDIT_UpdateScrollInfo(es); + EDIT_UpdateScrollInfo(es); } @@ -5444,7 +5444,7 @@ static void EDIT_UpdateText(EDITSTATE *es, LPRECT rc, BOOL bErase) } /******************************************************************** - * + * * The Following code is to handle inline editing from IMEs */ @@ -5480,7 +5480,7 @@ static void EDIT_GetCompositionStr(HWND hwnd, LPARAM CompFlag, EDITSTATE *es) if (CompFlag & GCS_COMPATTR) { - /* + /* * We do not use the attributes yet. it would tell us what characters * are in transition and which are converted or decided upon */ @@ -5496,7 +5496,7 @@ static void EDIT_GetCompositionStr(HWND hwnd, LPARAM CompFlag, EDITSTATE *es) ImmReleaseContext(hwnd,hIMC); return; } - ImmGetCompositionStringW(hIMC,GCS_COMPATTR, lpCompStrAttr, + ImmGetCompositionStringW(hIMC,GCS_COMPATTR, lpCompStrAttr, dwBufLenAttr); lpCompStrAttr[dwBufLenAttr] = 0; } @@ -5507,7 +5507,7 @@ static void EDIT_GetCompositionStr(HWND hwnd, LPARAM CompFlag, EDITSTATE *es) /* check for change in composition start */ if (es->selection_end < es->composition_start) es->composition_start = es->selection_end; - + /* replace existing selection string */ es->selection_start = es->composition_start; diff --git a/reactos/dll/win32/user32/controls/listbox.c b/reactos/dll/win32/user32/controls/listbox.c index cde2290d942..4a4240c8846 100644 --- a/reactos/dll/win32/user32/controls/listbox.c +++ b/reactos/dll/win32/user32/controls/listbox.c @@ -3243,7 +3243,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, LISTBOX_HandleMouseMove( descr, mousePos.x, mousePos.y); descr->captured = captured; - } + } else if (GetCapture() == descr->self) { LISTBOX_HandleMouseMove( descr, (INT16)LOWORD(lParam), diff --git a/reactos/dll/win32/user32/controls/scrollbar.c b/reactos/dll/win32/user32/controls/scrollbar.c index 7de8c2bcb57..86f2e91afa7 100644 --- a/reactos/dll/win32/user32/controls/scrollbar.c +++ b/reactos/dll/win32/user32/controls/scrollbar.c @@ -1277,7 +1277,7 @@ ScrollBarWndProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam) HDC hdc; DbgPrint("ScrollBarWndProc WM_ENABLE\n"); NtUserEnableScrollBar(Wnd,SB_CTL,(wParam ? ESB_ENABLE_BOTH : ESB_DISABLE_BOTH)); - /* Refresh Scrollbars. */ + /* Refresh Scrollbars. */ hdc = GetDCEx( Wnd, 0, DCX_CACHE ); if (!hdc) return 1; IntDrawScrollBar( Wnd, hdc, SB_CTL); diff --git a/reactos/dll/win32/user32/controls/static.c b/reactos/dll/win32/user32/controls/static.c index e2bc81a04d1..0747a388040 100644 --- a/reactos/dll/win32/user32/controls/static.c +++ b/reactos/dll/win32/user32/controls/static.c @@ -21,7 +21,7 @@ * * This code was audited for completeness against the documented features * of Comctl32.dll version 6.0 on Oct. 4, 2004, by Dimitrie O. Paun. - * + * * Unless otherwise noted, we believe this code to be complete, as per * the specification mentioned above. * If you discover missing features, or bugs, please note them below. @@ -342,7 +342,7 @@ static BOOL hasTextStyle( DWORD style ) case SS_OWNERDRAW: return TRUE; } - + return FALSE; } @@ -416,7 +416,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, { LPCSTR textA; LPCWSTR textW; - + if (full_style & SS_SUNKEN) SetWindowLongW( hwnd, GWL_EXSTYLE, GetWindowLongW( hwnd, GWL_EXSTYLE ) | WS_EX_STATICEDGE ); @@ -662,7 +662,7 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) if (!(len = SendMessageW( hwnd, WM_GETTEXTLENGTH, 0, 0 ))) return; if (!(text = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return; SendMessageW( hwnd, WM_GETTEXT, len + 1, (LPARAM)text ); - + if (((style & SS_TYPEMASK) == SS_SIMPLE) && (style & SS_NOPREFIX)) { /* Windows uses the faster ExtTextOut() to draw the text and @@ -675,9 +675,9 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) { DrawTextW( hdc, text, -1, &rc, wFormat ); } - + HeapFree( GetProcessHeap(), 0, text ); - + if (hFont) SelectObject( hdc, hOldFont ); } @@ -815,7 +815,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style ) // HENHMETAFILE hEnhMetaFile; // RECT rc; // HBRUSH hbrush; -// +// // GetClientRect(hwnd, &rc); // hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); // FillRect(hdc, &rc, hbrush); diff --git a/reactos/dll/win32/user32/include/user32p.h b/reactos/dll/win32/user32/include/user32p.h index d413fc8db0b..ff01b4d5273 100644 --- a/reactos/dll/win32/user32/include/user32p.h +++ b/reactos/dll/win32/user32/include/user32p.h @@ -33,7 +33,7 @@ #define NtUserMsqClearWakeMask() \ NtUserCallNoParam(NOPARAM_ROUTINE_MSQCLEARWAKEMASK) - + #define NtUserAnyPopup() \ (BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_ANYPOPUP) diff --git a/reactos/dll/win32/user32/misc/desktop.c b/reactos/dll/win32/user32/misc/desktop.c index 5a9ae8efa9f..fa60ecfb7b1 100644 --- a/reactos/dll/win32/user32/misc/desktop.c +++ b/reactos/dll/win32/user32/misc/desktop.c @@ -31,9 +31,9 @@ const struct builtin_class_descr DESKTOP_builtin_class = (HBRUSH)(COLOR_BACKGROUND+1) /* brush */ }; -static -LRESULT -WINAPI +static +LRESULT +WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) { FIXME("Desktop Class Atom!\n"); @@ -203,7 +203,7 @@ SystemParametersInfoA(UINT uiAction, if (!SystemParametersInfoW(uiAction, sizeof(ICONMETRICSW), &icmw, fWinIni)) return FALSE; - + picma->iHorzSpacing = icmw.iHorzSpacing; picma->iVertSpacing = icmw.iVertSpacing; picma->iTitleWrap = icmw.iTitleWrap; diff --git a/reactos/dll/win32/user32/misc/display.c b/reactos/dll/win32/user32/misc/display.c index 7ae3fce67e4..cfa42e5e4ca 100644 --- a/reactos/dll/win32/user32/misc/display.c +++ b/reactos/dll/win32/user32/misc/display.c @@ -62,7 +62,7 @@ EnumDisplayDevicesA( return FALSE; } - DisplayDeviceW.cb = sizeof(DISPLAY_DEVICEW); + DisplayDeviceW.cb = sizeof(DISPLAY_DEVICEW); rc = NtUserEnumDisplayDevices ( &Device, iDevNum, @@ -216,7 +216,7 @@ EnumDisplaySettingsExA( memset(&lpDevModeW,0,sizeof(DEVMODEW)); lpDevModeW.dmSize = sizeof(DEVMODEW); - + rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &lpDevModeW, dwFlags ); if (!rc) diff --git a/reactos/dll/win32/user32/misc/dllmain.c b/reactos/dll/win32/user32/misc/dllmain.c index 6061cfdef51..c4637b292ee 100644 --- a/reactos/dll/win32/user32/misc/dllmain.c +++ b/reactos/dll/win32/user32/misc/dllmain.c @@ -110,7 +110,7 @@ DllMain( Cleanup(); return FALSE; } - + /* Initialize message spying */ if (!SPY_Init()) return FALSE; diff --git a/reactos/dll/win32/user32/misc/misc.c b/reactos/dll/win32/user32/misc/misc.c index 7ec1bbbb856..7d1f5a92cf9 100644 --- a/reactos/dll/win32/user32/misc/misc.c +++ b/reactos/dll/win32/user32/misc/misc.c @@ -377,7 +377,7 @@ ValidateHandle(HANDLE handle, UINT uType) return NULL; } - if (!(NtUserValidateHandleSecure(handle, FALSE))) return NULL; + if (!(NtUserValidateHandleSecure(handle, FALSE))) return NULL; return pEntry->ptr; } diff --git a/reactos/dll/win32/user32/misc/resources.c b/reactos/dll/win32/user32/misc/resources.c index c8c59da87f6..eb7e6fa025b 100644 --- a/reactos/dll/win32/user32/misc/resources.c +++ b/reactos/dll/win32/user32/misc/resources.c @@ -198,8 +198,8 @@ int STDCALL LoadStringW ( (nBufferMax < 1) || ((nBufferMax > 0) && IsBadWritePtr(lpBuffer, nBufferMax * sizeof(lpBuffer[0]))) || - /* undocumented: If nBufferMax is 0, LoadStringW will copy a pointer to the - in-memory image of the string to the specified buffer and return the length + /* undocumented: If nBufferMax is 0, LoadStringW will copy a pointer to the + in-memory image of the string to the specified buffer and return the length of the string in WCHARs */ ((nBufferMax == 0) && IsBadWritePtr(lpBuffer, sizeof(lpBuffer))) ) @@ -266,7 +266,7 @@ RegisterDeviceNotificationW( return NULL; } ConfigRet = RegNotify ( hRecipient, NotificationFilter, Flags, (PULONG) &hDevNotify); - if (ConfigRet != CR_SUCCESS) + if (ConfigRet != CR_SUCCESS) { switch (ConfigRet) { @@ -308,7 +308,7 @@ UnregisterDeviceNotification( return FALSE; } ConfigRet = UnRegNotify ( (ULONG) Handle ); - if (ConfigRet != CR_SUCCESS) + if (ConfigRet != CR_SUCCESS) { switch (ConfigRet) { diff --git a/reactos/dll/win32/user32/windows/class.c b/reactos/dll/win32/user32/windows/class.c index b06341913ad..220b1fa4236 100644 --- a/reactos/dll/win32/user32/windows/class.c +++ b/reactos/dll/win32/user32/windows/class.c @@ -618,7 +618,7 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx) if (MenuName.Buffer != NULL) hMenu = LoadMenuA(WndClass.hInstance, WndClass.lpszMenuName); } - + if (IS_ATOM(WndClass.lpszClassName)) { ClassName.Length = diff --git a/reactos/dll/win32/user32/windows/clipboard.c b/reactos/dll/win32/user32/windows/clipboard.c index 76253821d7b..7e9318ce4cc 100644 --- a/reactos/dll/win32/user32/windows/clipboard.c +++ b/reactos/dll/win32/user32/windows/clipboard.c @@ -69,7 +69,7 @@ EmptyClipboard(VOID) UINT STDCALL EnumClipboardFormats(UINT format) { - UINT ret = NtUserEnumClipboardFormats(format); + UINT ret = NtUserEnumClipboardFormats(format); return ret; } @@ -82,19 +82,19 @@ GetClipboardData(UINT uFormat) HGLOBAL hGlobal = NULL; PVOID pGlobal = NULL; DWORD size = 0; - + /* dealing with bitmap object */ if (uFormat != CF_BITMAP) { size = (DWORD)NtUserGetClipboardData(uFormat, QUERY_SIZE); - + if (size) { hGlobal = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, size); pGlobal = GlobalLock(hGlobal); - + size = (DWORD)NtUserGetClipboardData(uFormat, (DWORD)pGlobal); - + GlobalUnlock(hGlobal); } } @@ -102,7 +102,7 @@ GetClipboardData(UINT uFormat) { hGlobal = NtUserGetClipboardData(CF_BITMAP, !QUERY_SIZE); } - + return hGlobal; } @@ -116,12 +116,12 @@ GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount) UNICODE_STRING FormatName; INT Length; ANSI_STRING ClassName; - + ClassName.MaximumLength = cchMaxCount; ClassName.Buffer = lpszFormatName; lpBuffer = HEAP_alloc(cchMaxCount * sizeof(WCHAR)); - + if (!lpBuffer) { SetLastError(ERROR_OUTOFMEMORY); @@ -136,7 +136,7 @@ GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount) Length = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount); HEAP_strcpyWtoA(lpszFormatName, FormatName.Buffer, Length); - + return strlen(lpszFormatName); } @@ -154,7 +154,7 @@ GetClipboardFormatNameW(UINT format, LPWSTR lpszFormatName, INT cchMaxCount) FormatName.Buffer = (PWSTR)lpszFormatName; Ret = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount); return Ret; - + } /* @@ -216,13 +216,13 @@ IsClipboardFormatAvailable(UINT format) /* * @implemented */ - + UINT STDCALL RegisterClipboardFormatA(LPCSTR lpszFormat) { UINT ret = 0; UNICODE_STRING usFormat = {0}; - + if (lpszFormat == NULL) { SetLastError(ERROR_INVALID_PARAMETER); @@ -235,7 +235,7 @@ RegisterClipboardFormatA(LPCSTR lpszFormat) SetLastError(ERROR_INVALID_NAME); return 0; } - + ret = RtlCreateUnicodeStringFromAsciiz(&usFormat, lpszFormat); if (ret) { @@ -254,13 +254,13 @@ RegisterClipboardFormatW(LPCWSTR lpszFormat) { UINT ret = 0; UNICODE_STRING usFormat = {0}; - + if (lpszFormat == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } - + /* check for "" */ if (*lpszFormat == 0) //NULL { @@ -280,18 +280,18 @@ HGLOBAL renderLocale (DWORD Locale) HGLOBAL hGlobal; hGlobal = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, sizeof(DWORD)); - + if(!hGlobal) { return hGlobal; } - + pLocale = (DWORD*)GlobalLock(hGlobal); - + *pLocale = Locale; - + GlobalUnlock(hGlobal); - + return hGlobal; } @@ -304,12 +304,12 @@ SetClipboardData(UINT uFormat, HANDLE hMem) DWORD size; LPVOID pMem; HANDLE ret = NULL; - + if (hMem == NULL) { - return NtUserSetClipboardData(uFormat, 0, 0); + return NtUserSetClipboardData(uFormat, 0, 0); } - + if (uFormat == CF_BITMAP) { /* GlobalLock should return 0 for GDI handles @@ -327,18 +327,18 @@ SetClipboardData(UINT uFormat, HANDLE hMem) /* GetObject for HBITMAP not implemented in ReactOS */ //if (GetObject(hMem, 0, NULL) == sifeof(BITMAP)) //{ - return NtUserSetClipboardData(CF_BITMAP, hMem, 0); + return NtUserSetClipboardData(CF_BITMAP, hMem, 0); //} /*}*/ } size = GlobalSize(hMem); pMem = GlobalLock(hMem); - - if ((pMem) && (size)) + + if ((pMem) && (size)) { size = GlobalSize(hMem); - ret = NtUserSetClipboardData(uFormat, pMem, size); + ret = NtUserSetClipboardData(uFormat, pMem, size); //should i unlock hMem? GlobalUnlock(hMem); } @@ -346,9 +346,9 @@ SetClipboardData(UINT uFormat, HANDLE hMem) { ERR("SetClipboardData failed\n"); } - + return ret; - + } /* diff --git a/reactos/dll/win32/user32/windows/dc.c b/reactos/dll/win32/user32/windows/dc.c index c5361ade38a..b52aee4534f 100644 --- a/reactos/dll/win32/user32/windows/dc.c +++ b/reactos/dll/win32/user32/windows/dc.c @@ -89,7 +89,7 @@ ReleaseDC( if (!hDC) return FALSE; // Null hDC return zero. GdiReleaseDC ( hDC ); // Release locals. - // Win 3.1 throw back, hWnd is ignored and not used. + // Win 3.1 throw back, hWnd is ignored and not used. return NtUserCallOneParam( (DWORD) hDC, ONEPARAM_ROUTINE_RELEASEDC); } diff --git a/reactos/dll/win32/user32/windows/defwnd.c b/reactos/dll/win32/user32/windows/defwnd.c index 3d94f6fa4c7..e641c26f0df 100644 --- a/reactos/dll/win32/user32/windows/defwnd.c +++ b/reactos/dll/win32/user32/windows/defwnd.c @@ -40,10 +40,10 @@ HBRUSH SysBrushes[NUM_SYSCOLORS] = {0}; /* Bits in the dwKeyData */ #define KEYDATA_ALT 0x2000 #define KEYDATA_PREVSTATE 0x4000 - + static short iF10Key = 0; static short iMenuSysKey = 0; - + /* FUNCTIONS *****************************************************************/ void @@ -207,7 +207,7 @@ DefWndSetRedraw(HWND hWnd, WPARAM wParam) } } else /* Content cannot be redrawn after a change. */ - { + { if (Style & WS_VISIBLE) /* Visible */ { RedrawWindow( hWnd, NULL, 0, RDW_ALLCHILDREN | RDW_VALIDATE ); @@ -823,7 +823,7 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) DefWndTrackScrollBar(hWnd, wParam, Pt); } break; - + default: /* FIXME: Implement */ UNIMPLEMENTED; @@ -986,30 +986,30 @@ VOID FASTCALL DefWndScreenshot(HWND hWnd) { RECT rect; - + OpenClipboard(hWnd); EmptyClipboard(); - + HDC hdc = GetWindowDC(hWnd); GetWindowRect(hWnd, &rect); INT w = rect.right - rect.left; INT h = rect.bottom - rect.top; - + HBITMAP hbitmap = CreateCompatibleBitmap(hdc, w, h); HDC hdc2 = CreateCompatibleDC(hdc); SelectObject(hdc2, hbitmap); - + BitBlt(hdc2, 0, 0, w, h, hdc, 0, 0, SRCCOPY); - + SetClipboardData(CF_BITMAP, hbitmap); - + ReleaseDC(hWnd, hdc); ReleaseDC(hWnd, hdc2); - + CloseClipboard(); - + } @@ -1051,14 +1051,14 @@ User32DefWindowProc(HWND hWnd, case WM_MBUTTONDOWN: iF10Key = iMenuSysKey = 0; break; - + case WM_NCLBUTTONDOWN: { return (DefWndNCLButtonDown(hWnd, wParam, lParam)); } case WM_LBUTTONDBLCLK: - return (DefWndNCLButtonDblClk(hWnd, HTCLIENT, lParam)); + return (DefWndNCLButtonDblClk(hWnd, HTCLIENT, lParam)); case WM_NCLBUTTONDBLCLK: { @@ -1360,7 +1360,7 @@ User32DefWindowProc(HWND hWnd, iMenuSysKey = 1; else iMenuSysKey = 0; - + iF10Key = 0; if (wParam == VK_F4) /* Try to close the window */ @@ -1427,7 +1427,7 @@ User32DefWindowProc(HWND hWnd, { LONG Style; INT Ret = 0; - + if (!lParam) return 0; Style = GetWindowLongW(hWnd, GWL_STYLE); if ((Style & WS_VISIBLE) && wParam) return 0; @@ -1551,34 +1551,34 @@ User32DefWindowProc(HWND hWnd, { return (1); } - + case WM_INPUTLANGCHANGEREQUEST: { HKL NewHkl; - - if(wParam & INPUTLANGCHANGE_BACKWARD + + if(wParam & INPUTLANGCHANGE_BACKWARD && wParam & INPUTLANGCHANGE_FORWARD) { return FALSE; } - + //FIXME: What to do with INPUTLANGCHANGE_SYSCHARSET ? - + if(wParam & INPUTLANGCHANGE_BACKWARD) NewHkl = (HKL) HKL_PREV; else if(wParam & INPUTLANGCHANGE_FORWARD) NewHkl = (HKL) HKL_NEXT; else NewHkl = (HKL) lParam; - + NtUserActivateKeyboardLayout(NewHkl, 0); - + return TRUE; } - - case WM_INPUTLANGCHANGE: + + case WM_INPUTLANGCHANGE: { //FIXME: What to do? return TRUE; } - + case WM_ENDSESSION: if (wParam) PostQuitMessage(0); return 0; diff --git a/reactos/dll/win32/user32/windows/dialog.c b/reactos/dll/win32/user32/windows/dialog.c index 640f6f1e56f..7c258d8176d 100644 --- a/reactos/dll/win32/user32/windows/dialog.c +++ b/reactos/dll/win32/user32/windows/dialog.c @@ -878,7 +878,7 @@ static void DEFDLG_RestoreFocus( HWND hwnd ) infoPtr->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE ); if (!IsWindow( infoPtr->hwndFocus )) return; } - SetFocus( infoPtr->hwndFocus ); + SetFocus( infoPtr->hwndFocus ); /* This used to set infoPtr->hwndFocus to NULL for no apparent reason, sometimes losing focus when receiving WM_SETFOCUS messages. */ @@ -1362,7 +1362,7 @@ CreateDialogIndirectParamAorW( /* FIXME: * This function might be obsolete since I don't think it is exported by NT * Also wine has one more parameter identifying weather it should call - * the function with unicode or not + * the function with unicode or not */ return DIALOG_CreateIndirect( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit , !Flags, FALSE ); } @@ -2005,7 +2005,7 @@ GetNextDlgGroupItem( } - /* Always go forward around the group and list of controls; for the + /* Always go forward around the group and list of controls; for the * previous control keep track; for the next break when you find one */ retvalue = hCtl; @@ -2158,7 +2158,7 @@ static void DIALOG_FixChildrenOnChangeFocus (HWND hwndDlg, HWND hwndNext) { INT dlgcode_def = SendMessageW (hwndDef, WM_GETDLGCODE, 0, 0); /* I know that if it is a button then it should already be a - * UNDEFPUSHBUTTON, since we have just told the buttons to + * UNDEFPUSHBUTTON, since we have just told the buttons to * change style. But maybe they ignored our request */ if ((dlgcode_def & DLGC_BUTTON) && @@ -2276,7 +2276,7 @@ IsDialogMessageW( if ((GetFocus() == lpMsg->hwnd) && (SendMessageW (lpMsg->hwnd, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)) { - SendMessageW (hDlg, WM_COMMAND, MAKEWPARAM (GetDlgCtrlID(lpMsg->hwnd),BN_CLICKED), (LPARAM)lpMsg->hwnd); + SendMessageW (hDlg, WM_COMMAND, MAKEWPARAM (GetDlgCtrlID(lpMsg->hwnd),BN_CLICKED), (LPARAM)lpMsg->hwnd); } else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0))) { diff --git a/reactos/dll/win32/user32/windows/draw.c b/reactos/dll/win32/user32/windows/draw.c index 6554ee0d965..b2d415c8589 100644 --- a/reactos/dll/win32/user32/windows/draw.c +++ b/reactos/dll/win32/user32/windows/draw.c @@ -771,7 +771,7 @@ static BOOL UITOOLS95_DFC_ButtonRadio(HDC dc, LPRECT r, UINT uFlags) } else { - SetTextColor(dc, GetSysColor(COLOR_BTNSHADOW)); + SetTextColor(dc, GetSysColor(COLOR_BTNSHADOW)); TextOut(dc, rc.left, rc.top, OutRight, 1); SetTextColor(dc, GetSysColor(COLOR_BTNHIGHLIGHT)); TextOut(dc, rc.left, rc.top, OutLeft, 1); @@ -789,7 +789,7 @@ static BOOL UITOOLS95_DFC_ButtonRadio(HDC dc, LPRECT r, UINT uFlags) SetTextColor(dc, GetSysColor(COLOR_WINDOWTEXT)); TextOut(dc, rc.left, rc.top, Check, 1); } - + SetTextColor(dc, GetSysColor(COLOR_WINDOWTEXT)); SelectObject(dc, hOldFont); diff --git a/reactos/dll/win32/user32/windows/font.c b/reactos/dll/win32/user32/windows/font.c index a1d4ffb8dc5..71eb17ea8a6 100644 --- a/reactos/dll/win32/user32/windows/font.c +++ b/reactos/dll/win32/user32/windows/font.c @@ -104,7 +104,7 @@ static LONG TEXT_TabbedTextOut( HDC hdc, INT x, INT y, LPCWSTR lpstr, INT x0; x0 = x; r.left = x0; - /* chop the string into substrings of 0 or more + /* chop the string into substrings of 0 or more * possibly followed by 1 or more normal characters */ for (i = 0; i < count; i++) if (lpstr[i] != '\t') break; @@ -149,7 +149,7 @@ static LONG TEXT_TabbedTextOut( HDC hdc, INT x, INT y, LPCWSTR lpstr, } } else x += extent.cx; - + if (fDisplayText) { r.top = y; @@ -1006,7 +1006,7 @@ static void TEXT_DrawUnderscore (HDC hdc, int x, int y, const WCHAR *str, int of if (prefix_x < rect->left ) prefix_x = rect->left; if (prefix_end > rect->right) prefix_end = rect->right; } - + hpen = CreatePen (PS_SOLID, 1, GetTextColor (hdc)); oldPen = SelectObject (hdc, hpen); MoveToEx (hdc, prefix_x, y, NULL); diff --git a/reactos/dll/win32/user32/windows/hook.c b/reactos/dll/win32/user32/windows/hook.c index 4e99fd34954..1ef28ee1e92 100644 --- a/reactos/dll/win32/user32/windows/hook.c +++ b/reactos/dll/win32/user32/windows/hook.c @@ -76,13 +76,13 @@ CallMsgFilterA( CBT_CREATEWNDW cbtcwW; CREATESTRUCTW csW; MSG Msg; - + Msg.hwnd = lpMsg->hwnd; Msg.message = lpMsg->message; Msg.time = lpMsg->time; Msg.pt = lpMsg->pt; Msg.wParam = lpMsg->wParam; - + cbtcwW.lpcs = &csW; cbtcwW.hwndInsertAfter = cbtcwA->hwndInsertAfter; csW = *(CREATESTRUCTW *)cbtcwA->lpcs; @@ -98,12 +98,12 @@ CallMsgFilterA( csW.lpszClass = usBuffer.Buffer; } Msg.lParam =(LPARAM) &cbtcwW; - + ret = NtUserCallMsgFilter((LPMSG)&Msg, nCode); lpMsg->time = Msg.time; lpMsg->pt = Msg.pt; - + cbtcwA->hwndInsertAfter = cbtcwW.hwndInsertAfter; if (HIWORD(csW.lpszName)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszName ); if (HIWORD(csW.lpszClass)) HeapFree( GetProcessHeap(), 0, (LPWSTR)csW.lpszClass ); diff --git a/reactos/dll/win32/user32/windows/input.c b/reactos/dll/win32/user32/windows/input.c index abb0a7c5b05..7f0a90e26d9 100644 --- a/reactos/dll/win32/user32/windows/input.c +++ b/reactos/dll/win32/user32/windows/input.c @@ -234,7 +234,7 @@ BOOL STDCALL GetKeyboardLayoutNameA(LPSTR pwszKLID) { WCHAR buf[KL_NAMELENGTH]; - + if (GetKeyboardLayoutNameW(buf)) return WideCharToMultiByte( CP_ACP, 0, buf, -1, pwszKLID, KL_NAMELENGTH, NULL, NULL ) != 0; return FALSE; @@ -358,7 +358,7 @@ MapVirtualKeyW(UINT uCode, /* * @implemented - */ + */ DWORD STDCALL OemKeyScan(WORD wOemChar) { @@ -370,7 +370,7 @@ OemKeyScan(WORD wOemChar) Vk = VkKeyScanW(p); Scan = MapVirtualKeyW((Vk & 0x00ff), 0); if(!Scan) return -1; - /* + /* Page 450-1, MS W2k SuperBible by SAMS. Return, low word has the scan code and high word has the shift state. */ @@ -880,7 +880,7 @@ TrackMouseEvent( } return TRUE; - + } /* EOF */ diff --git a/reactos/dll/win32/user32/windows/mdi.c b/reactos/dll/win32/user32/windows/mdi.c index ff4d2ed5d2b..8e3f87691cf 100644 --- a/reactos/dll/win32/user32/windows/mdi.c +++ b/reactos/dll/win32/user32/windows/mdi.c @@ -963,7 +963,7 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild, HBITMAP hBmpClose ) if ( menuInfo.hbmpItem != 0 ) DeleteObject(menuInfo.hbmpItem); - + /* close */ DeleteMenu(menu, SC_CLOSE, MF_BYCOMMAND); /* restore */ @@ -1255,7 +1255,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, if (!ci->child) ci->child = HeapAlloc(GetProcessHeap(), 0, sizeof(HWND)); else - ci->child = HeapReAlloc(GetProcessHeap(), 0, ci->child, sizeof(HWND) * ci->nActiveChildren); + ci->child = HeapReAlloc(GetProcessHeap(), 0, ci->child, sizeof(HWND) * ci->nActiveChildren); ci->child[ci->nActiveChildren - 1] = (HWND)lParam; } @@ -1514,7 +1514,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message, TRACE("%p %04x (%s) %08x %08lx\n", hwnd, message, SPY_GetMsgName(message, hwnd), wParam, lParam); #ifndef __REACTOS__ hwnd = WIN_GetFullHandle( hwnd ); -#endif +#endif if (!ci) return DefWindowProcW( hwnd, message, wParam, lParam ); switch (message) diff --git a/reactos/dll/win32/user32/windows/menu.c b/reactos/dll/win32/user32/windows/menu.c index c48a03170e9..3ec775e19e4 100644 --- a/reactos/dll/win32/user32/windows/menu.c +++ b/reactos/dll/win32/user32/windows/menu.c @@ -137,7 +137,7 @@ MenuGetRosMenuInfo(PROSMENUINFO MenuInfo, HMENU Menu) /*********************************************************************** * MenuSetRosMenuInfo * - * Set full information about menu + * Set full information about menu */ static BOOL FASTCALL MenuSetRosMenuInfo(PROSMENUINFO MenuInfo) @@ -169,12 +169,12 @@ static BOOL FASTCALL MenuGetRosMenuItemInfo(HMENU Menu, UINT Index, PROSMENUITEMINFO ItemInfo) { UINT Save_Mask = ItemInfo->fMask; /* Save the org mask bits. */ - + if (ItemInfo->dwTypeData != NULL) { HeapFree(GetProcessHeap(), 0, ItemInfo->dwTypeData); } - + ItemInfo->fMask = MIIM_BITMAP | MIIM_CHECKMARKS | MIIM_DATA | MIIM_FTYPE | MIIM_ID | MIIM_STATE | MIIM_STRING | MIIM_SUBMENU | MIIM_TYPE; @@ -521,7 +521,7 @@ MenuDrawMenuItem(HWND Wnd, PROSMENUINFO MenuInfo, HWND WndOwner, HDC Dc, PWCHAR Text; BOOL flat_menu = FALSE; int bkgnd; - + if (0 != (Item->fType & MF_SYSMENU)) { if (! IsIconic(Wnd)) @@ -726,7 +726,7 @@ MenuDrawMenuItem(HWND Wnd, PROSMENUINFO MenuInfo, HWND WndOwner, HDC Dc, * FIXME: * Custom checkmark bitmaps are monochrome but not always 1bpp. */ - if( !(MenuInfo->dwStyle & MNS_NOCHECK)) + if( !(MenuInfo->dwStyle & MNS_NOCHECK)) { HBITMAP bm = 0 != (Item->fState & MF_CHECKED) ? Item->hbmpChecked : Item->hbmpUnchecked; if (NULL != bm) /* we have a custom bitmap */ @@ -783,7 +783,7 @@ MenuDrawMenuItem(HWND Wnd, PROSMENUINFO MenuInfo, HWND WndOwner, HDC Dc, { MenuDrawBitmapItem(Dc, Item, &Rect, MenuInfo->Self, WndOwner, Action, MenuBar); } - + /* No bitmap - process text if present */ if (Item->Text) { @@ -795,7 +795,7 @@ MenuDrawMenuItem(HWND Wnd, PROSMENUINFO MenuInfo, HWND WndOwner, HDC Dc, if( !(MenuInfo->dwStyle & MNS_CHECKORBMP)) Rect.left += MenuInfo->maxBmpSize.cx; - + if (0 != (Item->fState & MFS_DEFAULT)) { FontOld = SelectObject(Dc, hMenuFontBold); @@ -1243,9 +1243,9 @@ MenuCalcItemSize(HDC Dc, PROSMENUITEMINFO ItemInfo, PROSMENUINFO MenuInfo, HWND ItemInfo->Rect.right += ArrowBitmapWidth + MenuCharSize.cx; return; } - + ItemInfo->XTab = 0; - + if (ItemInfo->hbmpItem) { SIZE Size; @@ -1305,16 +1305,16 @@ MenuCalcItemSize(HDC Dc, PROSMENUITEMINFO ItemInfo, PROSMENUINFO MenuInfo, HWND { hfontOld = SelectObject( Dc, hMenuFontBold ); } - if (MenuBar) + if (MenuBar) { txtheight = DrawTextW( Dc, ItemInfo->dwTypeData, -1, &rc, - DT_SINGLELINE|DT_CALCRECT); + DT_SINGLELINE|DT_CALCRECT); ItemInfo->Rect.right += rc.right - rc.left; itemheight = max( max( itemheight, txtheight), GetSystemMetrics( SM_CYMENU) - 1); ItemInfo->Rect.right += 2 * MenuCharSize.cx; - } - else + } + else { if ((p = strchrW( ItemInfo->dwTypeData, '\t' )) != NULL) { @@ -1333,8 +1333,8 @@ MenuCalcItemSize(HDC Dc, PROSMENUITEMINFO ItemInfo, PROSMENUINFO MenuInfo, HWND txtheight = max( txtheight, tmpheight); txtwidth += MenuCharSize.cx + /* space for the tab */ tmprc.right - tmprc.left; /* space for the short cut */ - } - else + } + else { txtheight = DrawTextW( Dc, ItemInfo->dwTypeData, -1, &rc, DT_SINGLELINE|DT_CALCRECT); @@ -1345,7 +1345,7 @@ MenuCalcItemSize(HDC Dc, PROSMENUITEMINFO ItemInfo, PROSMENUINFO MenuInfo, HWND itemheight = max( itemheight, max( txtheight + 2, MenuCharSize.cy + 4)); } if (hfontOld) SelectObject (Dc, hfontOld); - } + } else if( MenuBar) { itemheight = max( itemheight, GetSystemMetrics(SM_CYMENU)-1); @@ -1383,7 +1383,7 @@ MenuPopupMenuCalcSize(PROSMENUINFO MenuInfo, HWND WndOwner) MenuInfo->maxBmpSize.cx = 0; MenuInfo->maxBmpSize.cy = 0; - MenuInitRosMenuItemInfo(&ItemInfo); + MenuInitRosMenuItemInfo(&ItemInfo); while (Start < MenuInfo->MenuItemCount) { OrgX = MaxX; @@ -1627,9 +1627,9 @@ DrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font) UINT i; HFONT FontOld = NULL; BOOL flat_menu = FALSE; - + SystemParametersInfoW (SPI_GETFLATMENU, 0, &flat_menu, 0); - + if (NULL == Menu) { Menu = GetMenu(Wnd); @@ -1747,7 +1747,7 @@ MenuInitTracking(HWND Wnd, HMENU Menu, BOOL Popup, UINT Flags) SendMessageW(Wnd, WM_INITMENU, (WPARAM)Menu, 0); MenuGetRosMenuInfo(&MenuInfo, Menu); - + if (0 == MenuInfo.Height) { /* app changed/recreated menu bar entries in WM_INITMENU @@ -3665,20 +3665,20 @@ track_menu: /* * From MSDN: - * The MFT_BITMAP, MFT_SEPARATOR, and MFT_STRING values cannot be combined + * The MFT_BITMAP, MFT_SEPARATOR, and MFT_STRING values cannot be combined * with one another. Also MFT_OWNERDRAW. Set fMask to MIIM_TYPE to use fType. * * Windows 2K/XP: fType is used only if fMask has a value of MIIM_FTYPE. * - * MIIM_TYPE: Retrieves or sets the fType and dwTypeData members. Windows + * MIIM_TYPE: Retrieves or sets the fType and dwTypeData members. Windows * 2K/XP: MIIM_TYPE is replaced by MIIM_BITMAP, MIIM_FTYPE, and MIIM_STRING. - * MFT_STRING is replaced by MIIM_STRING. + * MFT_STRING is replaced by MIIM_STRING. * (So, I guess we should use MIIM_STRING only for strings?) * * MIIM_FTYPE: Windows 2K/Windows XP: Retrieves or sets the fType member. * * Based on wine, SetMenuItemInfo_common: - * 1) set MIIM_STRING | MIIM_FTYPE | MIIM_BITMAP any one with MIIM_TYPE, + * 1) set MIIM_STRING | MIIM_FTYPE | MIIM_BITMAP any one with MIIM_TYPE, * it will result in a error. * 2) set menu mask to MIIM_FTYPE and MFT_BITMAP ftype it will result in a error. * These conditions are addressed in Win32k IntSetMenuItemInfo. @@ -3687,11 +3687,11 @@ track_menu: static BOOL FASTCALL -MenuSetItemData( +MenuSetItemData( LPMENUITEMINFOW mii, - UINT Flags, - UINT_PTR IDNewItem, - LPCWSTR NewItem, + UINT Flags, + UINT_PTR IDNewItem, + LPCWSTR NewItem, BOOL Unicode) { /* @@ -3727,7 +3727,7 @@ MenuSetItemData( } } else - { + { LPCSTR NewItemA = (LPCSTR) NewItem; if (*NewItemA == '\b') { @@ -4121,7 +4121,7 @@ GetMenuItemInfoA( { miiW.dwTypeData = RtlAllocateHeap(GetProcessHeap(), 0, miiW.cch * sizeof(WCHAR)); - if (miiW.dwTypeData == NULL) return FALSE; + if (miiW.dwTypeData == NULL) return FALSE; } if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO)&miiW, FALSE)) @@ -4166,7 +4166,7 @@ GetMenuItemInfoW( MENUITEMINFOW miiW; LPWSTR String; INT Count; - + if (mii->cbSize != sizeof(MENUITEMINFOW) && mii->cbSize != sizeof(MENUITEMINFOW) - sizeof(HBITMAP)) { @@ -4189,7 +4189,7 @@ GetMenuItemInfoW( { miiW.dwTypeData = RtlAllocateHeap(GetProcessHeap(), 0, miiW.cch * sizeof(WCHAR)); - if (miiW.dwTypeData == NULL) return FALSE; + if (miiW.dwTypeData == NULL) return FALSE; } if (!NtUserMenuItemInfo(Menu, Item, ByPosition, (PROSMENUITEMINFO) &miiW, FALSE)) @@ -4197,7 +4197,7 @@ GetMenuItemInfoW( if (miiW.dwTypeData) RtlFreeHeap(GetProcessHeap(), 0, miiW.dwTypeData); return FALSE; } - + RtlCopyMemory(mii, &miiW, miiW.cbSize); // Okay to over write user data. if (!String || !Count) @@ -4435,7 +4435,7 @@ InsertMenuItemA( { RtlCopyMemory ( &mi, lpmii, lpmii->cbSize ); - if( lpmii->cbSize != sizeof( MENUITEMINFOW)) + if( lpmii->cbSize != sizeof( MENUITEMINFOW)) { mi.cbSize = sizeof( MENUITEMINFOW); mi.hbmpItem = NULL; @@ -4487,7 +4487,7 @@ InsertMenuItemW( { RtlCopyMemory(&mi, lpmii, lpmii->cbSize); - if( lpmii->cbSize != sizeof( MENUITEMINFOW)) + if( lpmii->cbSize != sizeof( MENUITEMINFOW)) { mi.cbSize = sizeof( MENUITEMINFOW); mi.hbmpItem = NULL; @@ -4670,7 +4670,7 @@ ModifyMenuA( mi.Height = 0; if (!MenuSetRosMenuInfo( &mi )) return FALSE; - + MenuInitRosMenuItemInfo( &rmii ); if(!MenuGetRosMenuItemInfo( hMnu, uPosition, &rmii)) return FALSE; @@ -4679,7 +4679,7 @@ ModifyMenuA( NtUserDestroyMenu( rmii.hSubMenu ); /* ModifyMenu() spec */ MenuCleanupRosMenuItemInfo( &rmii ); - + MenuSetItemData((LPMENUITEMINFOW) &mii, uFlags, uIDNewItem, @@ -4706,7 +4706,7 @@ ModifyMenuW( LPCWSTR lpNewItem) { ROSMENUINFO mi; - ROSMENUITEMINFO rmii; + ROSMENUITEMINFO rmii; MENUITEMINFOW mii; memset ( &mii, 0, sizeof(mii) ); mii.cbSize = sizeof(MENUITEMINFOW); @@ -4815,8 +4815,8 @@ SetMenuItemBitmaps( ROSMENUITEMINFO uItem; memset ( &uItem, 0, sizeof(uItem) ); uItem.fMask = MIIM_STATE | MIIM_BITMAP; - - if(!(NtUserMenuItemInfo(hMenu, uPosition, + + if(!(NtUserMenuItemInfo(hMenu, uPosition, (BOOL)(MF_BYPOSITION & uFlags), &uItem, FALSE))) return FALSE; if (!hBitmapChecked && !hBitmapUnchecked) @@ -4852,7 +4852,7 @@ SetMenuItemInfoA( RtlCopyMemory(&MenuItemInfoW, lpmii, min(lpmii->cbSize, sizeof(MENUITEMINFOW))); - if( lpmii->cbSize != sizeof( MENUITEMINFOW)) + if( lpmii->cbSize != sizeof( MENUITEMINFOW)) { MenuItemInfoW.cbSize = sizeof( MENUITEMINFOW); MenuItemInfoW.hbmpItem = NULL; @@ -4912,14 +4912,14 @@ SetMenuItemInfoW( RtlCopyMemory(&MenuItemInfoW, lpmii, min(lpmii->cbSize, sizeof(MENUITEMINFOW))); - if( lpmii->cbSize != sizeof( MENUITEMINFOW)) + if( lpmii->cbSize != sizeof( MENUITEMINFOW)) { MenuItemInfoW.cbSize = sizeof( MENUITEMINFOW); MenuItemInfoW.hbmpItem = NULL; } if (((MenuItemInfoW.fMask & MIIM_STRING) || - ((MenuItemInfoW.fMask & MIIM_TYPE) && + ((MenuItemInfoW.fMask & MIIM_TYPE) && (MENU_ITEM_TYPE(MenuItemInfoW.fType) == MF_STRING))) && MenuItemInfoW.dwTypeData != NULL) { diff --git a/reactos/dll/win32/user32/windows/window.c b/reactos/dll/win32/user32/windows/window.c index 27b28689d9b..8e262a494d9 100644 --- a/reactos/dll/win32/user32/windows/window.c +++ b/reactos/dll/win32/user32/windows/window.c @@ -167,7 +167,7 @@ User32CreateWindowEx(DWORD dwExStyle, #if 0 DbgPrint("[window] User32CreateWindowEx style %d, exstyle %d, parent %d\n", dwStyle, dwExStyle, hWndParent); #endif - + if (IS_ATOM(lpClassName)) { RtlInitUnicodeString(&ClassName, NULL); @@ -207,7 +207,7 @@ User32CreateWindowEx(DWORD dwExStyle, return (HWND)0; } } - + if(!hMenu && (dwStyle & (WS_OVERLAPPEDWINDOW | WS_POPUP))) { if(Unicode) @@ -1018,7 +1018,7 @@ int STDCALL GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount) { DWORD ProcessId; - + if (lpString == NULL) return 0; @@ -1101,7 +1101,7 @@ int STDCALL GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount) { DWORD ProcessId; - + if (lpString == NULL) return 0; diff --git a/reactos/dll/win32/usp10/usp10.c b/reactos/dll/win32/usp10/usp10.c index 8605a99d9fb..2e3bf6e2965 100644 --- a/reactos/dll/win32/usp10/usp10.c +++ b/reactos/dll/win32/usp10/usp10.c @@ -365,7 +365,7 @@ HRESULT WINAPI ScriptRecordDigitSubstitution(LCID locale, SCRIPT_DIGITSUBSTITUTE TRACE("0x%x, %p\n", locale, sds); /* This implementation appears to be correct for all languages, but it's - * not clear if sds->DigitSubstitute is ever set to anything except + * not clear if sds->DigitSubstitute is ever set to anything except * CONTEXT or NONE in reality */ if (!sds) return E_POINTER; @@ -388,7 +388,7 @@ HRESULT WINAPI ScriptRecordDigitSubstitution(LCID locale, SCRIPT_DIGITSUBSTITUTE switch (sub) { - case 0: + case 0: if (plgid == LANG_ARABIC || plgid == LANG_FARSI) sds->DigitSubstitute = SCRIPT_DIGITSUBSTITUTE_CONTEXT; else @@ -423,7 +423,7 @@ HRESULT WINAPI ScriptRecordDigitSubstitution(LCID locale, SCRIPT_DIGITSUBSTITUTE * Success: S_OK * Failure: E_INVALIDARG if sds is invalid. Otherwise an HRESULT. */ -HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE *sds, +HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE *sds, SCRIPT_CONTROL *sc, SCRIPT_STATE *ss) { SCRIPT_DIGITSUBSTITUTE psds; @@ -490,7 +490,7 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem int cnt = 0, index = 0; int New_Script = SCRIPT_UNDEFINED; - TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems, + TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems, psControl, psState, pItems, pcItems); if (!pwcInChars || !cInChars || !pItems || cMaxItems < 2) @@ -689,10 +689,10 @@ error: */ HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa, int iX, - int iY, - UINT uOptions, - const RECT *prc, - int iMinSel, + int iY, + UINT uOptions, + const RECT *prc, + int iMinSel, int iMaxSel, BOOL fDisabled) { @@ -804,7 +804,7 @@ HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrai * ScriptStringXtoCP (USP10.@) * */ -HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int* piCh, int* piTrailing) +HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int* piCh, int* piTrailing) { StringAnalysis* analysis = ssa; int i; @@ -1167,7 +1167,7 @@ complex_ranges[] = /*********************************************************************** * ScriptIsComplex (USP10.@) - * + * * Determine if a string is complex. * * PARAMS @@ -1221,7 +1221,7 @@ HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag) * Success: S_OK * Failure: Non-zero HRESULT value. */ -HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, +HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, int cChars, int cMaxGlyphs, SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, WORD *pwLogClust, SCRIPT_VISATTR *psva, int *pcGlyphs) @@ -1261,7 +1261,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, TRACE("\n"); } - /* Set up a valid SCRIPT_VISATTR and LogClust for each char in this run */ + /* Set up a valid SCRIPT_VISATTR and LogClust for each char in this run */ for (cnt = 0; cnt < cChars; cnt++) { /* FIXME: set to better values */ psva[cnt].uJustification = 2; @@ -1293,7 +1293,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, * Success: S_OK * Failure: Non-zero HRESULT value. */ -HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, +HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, int cGlyphs, const SCRIPT_VISATTR *psva, SCRIPT_ANALYSIS *psa, int *piAdvance, GOFFSET *pGoffset, ABC *pABC ) { @@ -1328,7 +1328,7 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, { for (wcnt = 0; wcnt < cGlyphs ; wcnt++) { /* add up the char lengths */ TRACE(" Glyph=%04x, abcA=%d, abcB=%d, abcC=%d wcnt=%d\n", - pwGlyphs[wcnt], + pwGlyphs[wcnt], lpABC[wcnt].abcA, lpABC[wcnt].abcB, lpABC[wcnt].abcC, wcnt); @@ -1394,8 +1394,8 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars * ScriptTextOut (USP10.@) * */ -HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UINT fuOptions, - const RECT *lprc, const SCRIPT_ANALYSIS *psa, const WCHAR *pwcReserved, +HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UINT fuOptions, + const RECT *lprc, const SCRIPT_ANALYSIS *psa, const WCHAR *pwcReserved, int iReserved, const WORD *pwGlyphs, int cGlyphs, const int *piAdvance, const int *piJustify, const GOFFSET *pGoffset) { diff --git a/reactos/dll/win32/uxtheme/draw.c b/reactos/dll/win32/uxtheme/draw.c index 003cf20ff10..5b7ae095c7d 100644 --- a/reactos/dll/win32/uxtheme/draw.c +++ b/reactos/dll/win32/uxtheme/draw.c @@ -55,8 +55,8 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags) HRESULT hr; TRACE("(%p,0x%08x\n", hwnd, dwFlags); - hr = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled), - (HANDLE)(dwFlags|0x80000000)); + hr = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled), + (HANDLE)(dwFlags|0x80000000)); /* 0x80000000 serves as a "flags set" flag */ if (FAILED(hr)) return hr; @@ -75,9 +75,9 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd) DWORD dwDialogTextureFlags; TRACE("(%p)\n", hwnd); - dwDialogTextureFlags = (DWORD)GetPropW (hwnd, + dwDialogTextureFlags = (DWORD)GetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled)); - if (dwDialogTextureFlags == 0) + if (dwDialogTextureFlags == 0) /* Means EnableThemeDialogTexture wasn't called for this dialog */ return TRUE; @@ -94,7 +94,7 @@ HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc) HWND hParent; HRGN clip = NULL; int hasClip = -1; - + TRACE("(%p,%p,%p)\n", hwnd, hdc, prc); hParent = GetParent(hwnd); if(!hParent) @@ -102,7 +102,7 @@ HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc) if(prc) { CopyRect(&rt, prc); MapWindowPoints(hwnd, NULL, (LPPOINT)&rt, 2); - + clip = CreateRectRgn(0,0,1,1); hasClip = GetClipRgn(hdc, clip); if(hasClip == -1) @@ -188,7 +188,7 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, HDC hdc, int iPartId, POINT size = {pRect->right-pRect->left, pRect->bottom-pRect->top}; POINT reqsize; for(i=4; i>=0; i--) { - PTHEME_PROPERTY fileProp = + PTHEME_PROPERTY fileProp = MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, i + TMT_IMAGEFILE1); if (!fileProp) continue; if(FAILED(GetThemePosition(hTheme, iPartId, iStateId, i + TMT_MINSIZE1, &reqsize))) { @@ -201,7 +201,7 @@ static PTHEME_PROPERTY UXTHEME_SelectImage(HTHEME hTheme, HDC hdc, int iPartId, HBITMAP hBmp; BOOL hasAlpha; - lstrcpynW(szPath, fileProp->lpValue, + lstrcpynW(szPath, fileProp->lpValue, min(fileProp->dwValueLen+1, sizeof(szPath)/sizeof(szPath[0]))); hBmp = MSSTYLES_LoadBitmap(hTheme, szPath, &hasAlpha); if(!hBmp) continue; @@ -255,7 +255,7 @@ static HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iState TRACE("Failed to load bitmap %s\n", debugstr_w(szPath)); return HRESULT_FROM_WIN32(GetLastError()); } - + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_IMAGELAYOUT, &imagelayout); GetThemeInt(hTheme, iPartId, iStateId, TMT_IMAGECOUNT, &imagecount); @@ -287,7 +287,7 @@ static inline BOOL UXTHEME_StretchBlt(HDC hdcDst, int nXOriginDst, int nYOriginD HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, INT transparent, COLORREF transcolor) { - static const BLENDFUNCTION blendFunc = + static const BLENDFUNCTION blendFunc = { AC_SRC_OVER, /* BlendOp */ 0, /* BlendFlag */ @@ -331,11 +331,11 @@ static inline BOOL UXTHEME_Blt(HDC hdcDest, int nXOriginDest, int nYOriginDest, * * Stretches or tiles, depending on sizingtype. */ -static inline BOOL UXTHEME_SizedBlt (HDC hdcDst, int nXOriginDst, int nYOriginDst, +static inline BOOL UXTHEME_SizedBlt (HDC hdcDst, int nXOriginDst, int nYOriginDst, int nWidthDst, int nHeightDst, - HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, + HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, - int sizingtype, + int sizingtype, INT transparent, COLORREF transcolor) { if (sizingtype == ST_TILE) @@ -351,7 +351,7 @@ static inline BOOL UXTHEME_SizedBlt (HDC hdcDst, int nXOriginDst, int nYOriginDs { int bltWidth = min (xRemaining, nWidthSrc); if (!UXTHEME_Blt (hdcDst, xOfs, yOfs, bltWidth, bltHeight, - hdcSrc, nXOriginSrc, nYOriginSrc, + hdcSrc, nXOriginSrc, nYOriginSrc, transparent, transcolor)) return FALSE; xOfs += nWidthSrc; @@ -370,10 +370,10 @@ static inline BOOL UXTHEME_SizedBlt (HDC hdcDst, int nXOriginDst, int nYOriginDs } } -/* Get transparency parameters passed to UXTHEME_StretchBlt() - the parameters - * depend on whether the image has full alpha or whether it is +/* Get transparency parameters passed to UXTHEME_StretchBlt() - the parameters + * depend on whether the image has full alpha or whether it is * color-transparent or just opaque. */ -static inline void get_transparency (HTHEME hTheme, int iPartId, int iStateId, +static inline void get_transparency (HTHEME hTheme, int iPartId, int iStateId, BOOL hasImageAlpha, INT* transparent, COLORREF* transparentcolor, BOOL glyph) { @@ -385,12 +385,12 @@ static inline void get_transparency (HTHEME hTheme, int iPartId, int iStateId, else { BOOL trans = FALSE; - GetThemeBool(hTheme, iPartId, iStateId, + GetThemeBool(hTheme, iPartId, iStateId, glyph ? TMT_GLYPHTRANSPARENT : TMT_TRANSPARENT, &trans); if(trans) { *transparent = ALPHABLEND_BINARY; - if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, - glyph ? TMT_GLYPHTRANSPARENTCOLOR : TMT_TRANSPARENTCOLOR, + if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, + glyph ? TMT_GLYPHTRANSPARENTCOLOR : TMT_TRANSPARENTCOLOR, transparentcolor))) { /* If image is transparent, but no color was specified, use magenta */ *transparentcolor = RGB(255, 0, 255); @@ -424,7 +424,7 @@ static HRESULT UXTHEME_DrawImageGlyph(HTHEME hTheme, HDC hdc, int iPartId, POINT topleft; BOOL hasAlpha; - hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, TRUE, + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, TRUE, &bmpSrc, &rcSrc, &hasAlpha); if(FAILED(hr)) return hr; hdcSrc = CreateCompatibleDC(hdc); @@ -499,7 +499,7 @@ static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId, RECT rcSrc; BOOL hasAlpha; - hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, prc, FALSE, + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, prc, FALSE, &bmpSrc, &rcSrc, &hasAlpha); if (FAILED(hr)) return hr; @@ -520,7 +520,7 @@ static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId, dstSize.y = rcDst.bottom-rcDst.top; srcSize.x = rcSrc.right-rcSrc.left; srcSize.y = rcSrc.bottom-rcSrc.top; - + GetThemeBool(hTheme, iPartId, iStateId, TMT_UNIFORMSIZING, &uniformsizing); if(uniformsizing) { /* Scale height and width equally */ @@ -535,11 +535,11 @@ static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId, rcDst.right = rcDst.left + dstSize.x; } } - + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_SIZINGTYPE, &sizingtype); if(sizingtype == ST_TRUESIZE) { int truesizestretchmark = 100; - + if(dstSize.x < 0 || dstSize.y < 0) { BOOL mirrorimage = TRUE; GetThemeBool(hTheme, iPartId, iStateId, TMT_MIRRORIMAGE, &mirrorimage); @@ -555,7 +555,7 @@ static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId, } } /* Whatever TrueSizeStretchMark does - it does not seem to - * be what's outlined below. It appears as if native + * be what's outlined below. It appears as if native * uxtheme always stretches if dest is smaller than source * (ie as if TrueSizeStretchMark==100 with the code below) */ #if 0 @@ -612,7 +612,7 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, COLORREF transparentcolor = 0; BOOL hasAlpha; - hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, FALSE, + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, FALSE, &bmpSrc, &rcSrc, &hasAlpha); if(FAILED(hr)) return hr; hdcSrc = CreateCompatibleDC(hdc); @@ -623,7 +623,7 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, oldSrc = SelectObject(hdcSrc, bmpSrc); CopyRect(&rcDst, pRect); - + get_transparency (hTheme, iPartId, iStateId, hasAlpha, &transparent, &transparentcolor, FALSE); @@ -670,34 +670,34 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, /* Upper left corner */ if(!UXTHEME_Blt(hdcDst, 0, 0, sm.cxLeftWidth, sm.cyTopHeight, - hdcSrc, rcSrc.left, rcSrc.top, + hdcSrc, rcSrc.left, rcSrc.top, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } /* Upper right corner */ - if(!UXTHEME_Blt (hdcDst, dstSize.x-sm.cxRightWidth, 0, + if(!UXTHEME_Blt (hdcDst, dstSize.x-sm.cxRightWidth, 0, sm.cxRightWidth, sm.cyTopHeight, - hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } /* Lower left corner */ - if(!UXTHEME_Blt (hdcDst, 0, dstSize.y-sm.cyBottomHeight, + if(!UXTHEME_Blt (hdcDst, 0, dstSize.y-sm.cyBottomHeight, sm.cxLeftWidth, sm.cyBottomHeight, - hdcSrc, rcSrc.left, rcSrc.bottom-sm.cyBottomHeight, + hdcSrc, rcSrc.left, rcSrc.bottom-sm.cyBottomHeight, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } /* Lower right corner */ - if(!UXTHEME_Blt (hdcDst, dstSize.x-sm.cxRightWidth, dstSize.y-sm.cyBottomHeight, + if(!UXTHEME_Blt (hdcDst, dstSize.x-sm.cxRightWidth, dstSize.y-sm.cyBottomHeight, sm.cxRightWidth, sm.cyBottomHeight, - hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.bottom-sm.cyBottomHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.bottom-sm.cyBottomHeight, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } if ((sizingtype == ST_STRETCH) || (sizingtype == ST_TILE)) { @@ -708,43 +708,43 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, if(destCenterWidth > 0) { /* Center top */ - if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, 0, + if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, 0, destCenterWidth, sm.cyTopHeight, - hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top, - srcCenterWidth, sm.cyTopHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top, + srcCenterWidth, sm.cyTopHeight, sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } /* Center bottom */ - if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, dstSize.y-sm.cyBottomHeight, + if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, dstSize.y-sm.cyBottomHeight, destCenterWidth, sm.cyBottomHeight, - hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.bottom-sm.cyBottomHeight, - srcCenterWidth, sm.cyBottomHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.bottom-sm.cyBottomHeight, + srcCenterWidth, sm.cyBottomHeight, sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } } if(destCenterHeight > 0) { /* Left center */ - if(!UXTHEME_SizedBlt (hdcDst, 0, sm.cyTopHeight, + if(!UXTHEME_SizedBlt (hdcDst, 0, sm.cyTopHeight, sm.cxLeftWidth, destCenterHeight, - hdcSrc, rcSrc.left, rcSrc.top+sm.cyTopHeight, - sm.cxLeftWidth, srcCenterHeight, - sizingtype, + hdcSrc, rcSrc.left, rcSrc.top+sm.cyTopHeight, + sm.cxLeftWidth, srcCenterHeight, + sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } /* Right center */ - if(!UXTHEME_SizedBlt (hdcDst, dstSize.x-sm.cxRightWidth, sm.cyTopHeight, + if(!UXTHEME_SizedBlt (hdcDst, dstSize.x-sm.cxRightWidth, sm.cyTopHeight, sm.cxRightWidth, destCenterHeight, - hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top+sm.cyTopHeight, - sm.cxRightWidth, srcCenterHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top+sm.cyTopHeight, + sm.cxRightWidth, srcCenterHeight, sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } } if(destCenterHeight > 0 && destCenterWidth > 0) { @@ -752,13 +752,13 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, GetThemeBool(hTheme, iPartId, iStateId, TMT_BORDERONLY, &borderonly); if(!borderonly) { /* Center */ - if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, sm.cyTopHeight, + if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, sm.cyTopHeight, destCenterWidth, destCenterHeight, - hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top+sm.cyTopHeight, - srcCenterWidth, srcCenterHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top+sm.cyTopHeight, + srcCenterWidth, srcCenterHeight, sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; + goto draw_error; } } } @@ -993,7 +993,7 @@ enum EDGE_NUMCOLORS }; -static const struct +static const struct { int themeProp; int sysColor; @@ -1084,7 +1084,7 @@ static COLORREF get_edge_color (int edgeType, HTHEME theme, int part, int state) { COLORREF col; if ((EdgeColorMap[edgeType].themeProp == -1) - || FAILED (GetThemeColor (theme, part, state, + || FAILED (GetThemeColor (theme, part, state, EdgeColorMap[edgeType].themeProp, &col))) col = GetSysColor (EdgeColorMap[edgeType].sysColor); return col; @@ -1106,7 +1106,7 @@ static inline HBRUSH get_edge_brush (int edgeType, HTHEME theme, int part, int s * Same as DrawEdge invoked with BF_DIAGONAL */ static HRESULT draw_diag_edge (HDC hdc, HTHEME theme, int part, int state, - const RECT* rc, UINT uType, + const RECT* rc, UINT uType, UINT uFlags, LPRECT contentsRect) { POINT Points[4]; @@ -1317,10 +1317,10 @@ static HRESULT draw_diag_edge (HDC hdc, HTHEME theme, int part, int state, if((uFlags & BF_MIDDLE) && retval) { HBRUSH hbsave; - HBRUSH hb = get_edge_brush ((uFlags & BF_MONO) ? EDGE_WINDOW : EDGE_FILL, + HBRUSH hb = get_edge_brush ((uFlags & BF_MONO) ? EDGE_WINDOW : EDGE_FILL, theme, part, state); HPEN hpsave; - HPEN hp = get_edge_pen ((uFlags & BF_MONO) ? EDGE_WINDOW : EDGE_FILL, + HPEN hp = get_edge_pen ((uFlags & BF_MONO) ? EDGE_WINDOW : EDGE_FILL, theme, part, state); hbsave = (HBRUSH)SelectObject(hdc, hb); hpsave = (HPEN)SelectObject(hdc, hp); @@ -1356,7 +1356,7 @@ static HRESULT draw_diag_edge (HDC hdc, HTHEME theme, int part, int state, * Same as DrawEdge invoked without BF_DIAGONAL */ static HRESULT draw_rect_edge (HDC hdc, HTHEME theme, int part, int state, - const RECT* rc, UINT uType, + const RECT* rc, UINT uType, UINT uFlags, LPRECT contentsRect) { signed char LTInnerI, LTOuterI; @@ -1478,7 +1478,7 @@ static HRESULT draw_rect_edge (HDC hdc, HTHEME theme, int part, int state, if((uFlags & BF_MIDDLE) && retval) { - HBRUSH br = get_edge_brush ((uFlags & BF_MONO) ? EDGE_WINDOW : EDGE_FILL, + HBRUSH br = get_edge_brush ((uFlags & BF_MONO) ? EDGE_WINDOW : EDGE_FILL, theme, part, state); FillRect(hdc, &InnerRect, br); DeleteObject (br); @@ -1513,7 +1513,7 @@ HRESULT WINAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, TRACE("%d %d 0x%08x 0x%08x\n", iPartId, iStateId, uEdge, uFlags); if(!hTheme) return E_HANDLE; - + if(uFlags & BF_DIAGONAL) return draw_diag_edge (hdc, hTheme, iPartId, iStateId, pDestRect, uEdge, uFlags, pContentRect); @@ -1550,11 +1550,11 @@ HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, COLORREF oldTextColor; int oldBkMode; RECT rt; - + TRACE("%d %d: stub\n", iPartId, iStateId); if(!hTheme) return E_HANDLE; - + hr = GetThemeFont(hTheme, hdc, iPartId, iStateId, TMT_FONT, &logfont); if(SUCCEEDED(hr)) { hFont = CreateFontIndirectW(&logfont); @@ -1564,7 +1564,7 @@ HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, CopyRect(&rt, pRect); if(hFont) oldFont = SelectObject(hdc, hFont); - + if(dwTextFlags2 & DTT_GRAYED) textColor = GetSysColor(COLOR_GRAYTEXT); else { @@ -1614,11 +1614,11 @@ HRESULT WINAPI GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, int iPartId GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype); if(bgtype == BT_BORDERFILL) { int bordersize = 1; - + GetThemeInt(hTheme, iPartId, iStateId, TMT_BORDERSIZE, &bordersize); InflateRect(pContentRect, -bordersize, -bordersize); } else if ((bgtype == BT_IMAGEFILE) - && (SUCCEEDED(hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, + && (SUCCEEDED(hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_SIZINGMARGINS, NULL, &margin)))) { pContentRect->left = pBoundingRect->left + margin.cxLeftWidth; pContentRect->top = pBoundingRect->top + margin.cyTopHeight; @@ -1662,11 +1662,11 @@ HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype); if(bgtype == BT_BORDERFILL) { int bordersize = 1; - + GetThemeInt(hTheme, iPartId, iStateId, TMT_BORDERSIZE, &bordersize); InflateRect(pExtentRect, bordersize, bordersize); } else if ((bgtype == BT_IMAGEFILE) - && (SUCCEEDED(hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, + && (SUCCEEDED(hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_SIZINGMARGINS, NULL, &margin)))) { pExtentRect->left = pContentRect->left - margin.cxLeftWidth; pExtentRect->top = pContentRect->top - margin.cyTopHeight; @@ -1725,14 +1725,14 @@ static HRESULT get_border_background_size (HTHEME hTheme, int iPartId, HRESULT hr = S_OK; int bordersize = 1; - if (SUCCEEDED (hr = GetThemeInt(hTheme, iPartId, iStateId, TMT_BORDERSIZE, + if (SUCCEEDED (hr = GetThemeInt(hTheme, iPartId, iStateId, TMT_BORDERSIZE, &bordersize))) { psz->x = psz->y = 2*bordersize; if (eSize != TS_MIN) { psz->x++; - psz->y++; + psz->y++; } } return hr; @@ -1783,14 +1783,14 @@ HRESULT WINAPI GetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId, HGDIOBJ oldFont = NULL; LOGFONTW logfont; RECT rt = {0,0,0xFFFF,0xFFFF}; - + TRACE("%d %d: stub\n", iPartId, iStateId); if(!hTheme) return E_HANDLE; if(pBoundingRect) CopyRect(&rt, pBoundingRect); - + hr = GetThemeFont(hTheme, hdc, iPartId, iStateId, TMT_FONT, &logfont); if(SUCCEEDED(hr)) { hFont = CreateFontIndirectW(&logfont); @@ -1799,7 +1799,7 @@ HRESULT WINAPI GetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId, } if(hFont) oldFont = SelectObject(hdc, hFont); - + DrawTextW(hdc, pszText, iCharCount, &rt, dwTextFlags|DT_CALCRECT); CopyRect(pExtentRect, &rt); @@ -1867,8 +1867,8 @@ BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, if (bgtype != BT_IMAGEFILE) return FALSE; - if(FAILED (UXTHEME_LoadImage (hTheme, 0, iPartId, iStateId, &rect, FALSE, - &bmpSrc, &rcSrc, &hasAlpha))) + if(FAILED (UXTHEME_LoadImage (hTheme, 0, iPartId, iStateId, &rect, FALSE, + &bmpSrc, &rcSrc, &hasAlpha))) return FALSE; get_transparency (hTheme, iPartId, iStateId, hasAlpha, &transparent, diff --git a/reactos/dll/win32/uxtheme/system.c b/reactos/dll/win32/uxtheme/system.c index 9e69cb82bd6..412a31404b6 100644 --- a/reactos/dll/win32/uxtheme/system.c +++ b/reactos/dll/win32/uxtheme/system.c @@ -246,7 +246,7 @@ static const char * const SysColorsNames[] = "MenuHilight", /* COLOR_MENUHILIGHT */ "MenuBar", /* COLOR_MENUBAR */ }; -static const WCHAR strColorKey[] = +static const WCHAR strColorKey[] = { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\', 'C','o','l','o','r','s',0 }; static const WCHAR keyFlatMenus[] = { 'F','l','a','t','M','e','n','u', 0}; @@ -261,7 +261,7 @@ static const struct BackupSysParam { int spiGet, spiSet; const WCHAR* keyName; -} backupSysParams[] = +} backupSysParams[] = { {SPI_GETFLATMENU, SPI_SETFLATMENU, keyFlatMenus}, {SPI_GETGRADIENTCAPTIONS, SPI_SETGRADIENTCAPTIONS, keyGradientCaption}, @@ -283,19 +283,19 @@ static void save_sys_colors (HKEY baseKey) for (i = 0; i < NUM_SYS_COLORS; i++) { COLORREF col = GetSysColor (i); - - sprintf (colorStr, "%d %d %d", + + sprintf (colorStr, "%d %d %d", GetRValue (col), GetGValue (col), GetBValue (col)); - RegSetValueExA (hKey, SysColorsNames[i], 0, REG_SZ, + RegSetValueExA (hKey, SysColorsNames[i], 0, REG_SZ, (BYTE*)colorStr, strlen (colorStr)+1); } RegCloseKey (hKey); } } -/* Before activating a theme, query current system colors, certain settings - * and backup them in the registry, so they can be restored when the theme +/* Before activating a theme, query current system colors, certain settings + * and backup them in the registry, so they can be restored when the theme * is deactivated */ static void UXTHEME_BackupSystemMetrics(void) { @@ -308,22 +308,22 @@ static void UXTHEME_BackupSystemMetrics(void) { NONCLIENTMETRICSW ncm; LOGFONTW iconTitleFont; - + /* back up colors */ save_sys_colors (hKey); - + /* back up "other" settings */ while (bsp->spiGet >= 0) { DWORD value; - + SystemParametersInfoW (bsp->spiGet, 0, &value, 0); - RegSetValueExW (hKey, bsp->keyName, 0, REG_DWORD, + RegSetValueExW (hKey, bsp->keyName, 0, REG_DWORD, (LPBYTE)&value, sizeof (value)); - + bsp++; } - + /* back up non-client metrics */ memset (&ncm, 0, sizeof (ncm)); ncm.cbSize = sizeof (ncm); @@ -333,9 +333,9 @@ static void UXTHEME_BackupSystemMetrics(void) memset (&iconTitleFont, 0, sizeof (iconTitleFont)); SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof (iconTitleFont), &iconTitleFont, 0); - RegSetValueExW (hKey, keyIconTitleFont, 0, REG_BINARY, + RegSetValueExW (hKey, keyIconTitleFont, 0, REG_BINARY, (LPBYTE)&iconTitleFont, sizeof (iconTitleFont)); - + RegCloseKey (hKey); } } @@ -347,25 +347,25 @@ static void UXTHEME_RestoreSystemMetrics(void) const struct BackupSysParam* bsp = backupSysParams; if (RegOpenKeyExW (HKEY_CURRENT_USER, szThemeManager, - 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) + 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { HKEY colorKey; - + /* read backed-up colors */ if (RegOpenKeyExW (hKey, strColorKey, - 0, KEY_QUERY_VALUE, &colorKey) == ERROR_SUCCESS) + 0, KEY_QUERY_VALUE, &colorKey) == ERROR_SUCCESS) { int i; COLORREF sysCols[NUM_SYS_COLORS]; int sysColsIndices[NUM_SYS_COLORS]; int sysColCount = 0; - + for (i = 0; i < NUM_SYS_COLORS; i++) { DWORD type; char colorStr[13]; DWORD count = sizeof(colorStr); - + if (RegQueryValueExA (colorKey, SysColorsNames[i], 0, &type, (LPBYTE) colorStr, &count) == ERROR_SUCCESS) { @@ -379,56 +379,56 @@ static void UXTHEME_RestoreSystemMetrics(void) } } RegCloseKey (colorKey); - + SetSysColors (sysColCount, sysColsIndices, sysCols); } - + /* read backed-up other settings */ while (bsp->spiGet >= 0) { DWORD value; DWORD count = sizeof(value); DWORD type; - + if (RegQueryValueExW (hKey, bsp->keyName, 0, &type, (LPBYTE)&value, &count) == ERROR_SUCCESS) { SystemParametersInfoW (bsp->spiSet, 0, (LPVOID)value, SPIF_UPDATEINIFILE); } - + bsp++; } - + /* read backed-up non-client metrics */ { NONCLIENTMETRICSW ncm; LOGFONTW iconTitleFont; DWORD count = sizeof(ncm); DWORD type; - + if (RegQueryValueExW (hKey, keyNonClientMetrics, 0, &type, (LPBYTE)&ncm, &count) == ERROR_SUCCESS) { - SystemParametersInfoW (SPI_SETNONCLIENTMETRICS, + SystemParametersInfoW (SPI_SETNONCLIENTMETRICS, count, (LPVOID)&ncm, SPIF_UPDATEINIFILE); } - + count = sizeof(iconTitleFont); - + if (RegQueryValueExW (hKey, keyIconTitleFont, 0, &type, (LPBYTE)&iconTitleFont, &count) == ERROR_SUCCESS) { - SystemParametersInfoW (SPI_SETICONTITLELOGFONT, + SystemParametersInfoW (SPI_SETICONTITLELOGFONT, count, (LPVOID)&iconTitleFont, SPIF_UPDATEINIFILE); } } - + RegCloseKey (hKey); } } -/* Make system settings persistent, so they're in effect even w/o uxtheme +/* Make system settings persistent, so they're in effect even w/o uxtheme * loaded. * For efficiency reasons, only the last SystemParametersInfoW sets * SPIF_SENDWININICHANGE */ @@ -443,26 +443,26 @@ static void UXTHEME_SaveSystemMetrics(void) while (bsp->spiGet >= 0) { DWORD value; - + SystemParametersInfoW (bsp->spiGet, 0, &value, 0); SystemParametersInfoW (bsp->spiSet, 0, (LPVOID)value, SPIF_UPDATEINIFILE); - + bsp++; } - + memset (&ncm, 0, sizeof (ncm)); ncm.cbSize = sizeof (ncm); - SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, + SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, sizeof (ncm), (LPVOID)&ncm, 0); - SystemParametersInfoW (SPI_SETNONCLIENTMETRICS, + SystemParametersInfoW (SPI_SETNONCLIENTMETRICS, sizeof (ncm), (LPVOID)&ncm, SPIF_UPDATEINIFILE); memset (&iconTitleFont, 0, sizeof (iconTitleFont)); - SystemParametersInfoW (SPI_GETICONTITLELOGFONT, + SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof (iconTitleFont), (LPVOID)&iconTitleFont, 0); - SystemParametersInfoW (SPI_SETICONTITLELOGFONT, - sizeof (iconTitleFont), (LPVOID)&iconTitleFont, + SystemParametersInfoW (SPI_SETICONTITLELOGFONT, + sizeof (iconTitleFont), (LPVOID)&iconTitleFont, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); } @@ -501,11 +501,11 @@ static HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf) tmp[1] = '\0'; RegSetValueExW(hKey, szThemeActive, 0, REG_SZ, (const BYTE*)tmp, sizeof(WCHAR)*2); if(bThemeActive) { - RegSetValueExW(hKey, szColorName, 0, REG_SZ, (const BYTE*)szCurrentColor, + RegSetValueExW(hKey, szColorName, 0, REG_SZ, (const BYTE*)szCurrentColor, (lstrlenW(szCurrentColor)+1)*sizeof(WCHAR)); - RegSetValueExW(hKey, szSizeName, 0, REG_SZ, (const BYTE*)szCurrentSize, + RegSetValueExW(hKey, szSizeName, 0, REG_SZ, (const BYTE*)szCurrentSize, (lstrlenW(szCurrentSize)+1)*sizeof(WCHAR)); - RegSetValueExW(hKey, szDllName, 0, REG_SZ, (const BYTE*)szCurrentTheme, + RegSetValueExW(hKey, szDllName, 0, REG_SZ, (const BYTE*)szCurrentTheme, (lstrlenW(szCurrentTheme)+1)*sizeof(WCHAR)); } else { @@ -518,9 +518,9 @@ static HRESULT UXTHEME_SetActiveTheme(PTHEME_FILE tf) } else TRACE("Failed to open theme registry key\n"); - + UXTHEME_SaveSystemMetrics (); - + return hr; } @@ -583,7 +583,7 @@ HRESULT WINAPI EnableTheming(BOOL fEnable) TRACE("(%d)\n", fEnable); if(fEnable != bThemeActive) { - if(fEnable) + if(fEnable) UXTHEME_BackupSystemMetrics(); else UXTHEME_RestoreSystemMetrics(); @@ -1053,7 +1053,7 @@ HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, EnumThemeProc callback, * or when pszSizeName does not refer to a valid size * * NOTES - * XP fails with E_POINTER when pszColorNames points to a buffer smaller than + * XP fails with E_POINTER when pszColorNames points to a buffer smaller than * sizeof(THEMENAMES). * * Not very efficient that I'm opening & validating the theme every call, but @@ -1113,7 +1113,7 @@ HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName, * or when pszColorName does not refer to a valid color * * NOTES - * XP fails with E_POINTER when pszSizeNames points to a buffer smaller than + * XP fails with E_POINTER when pszSizeNames points to a buffer smaller than * sizeof(THEMENAMES). * * Not very efficient that I'm opening & validating the theme every call, but diff --git a/reactos/dll/win32/vdmdbg/vdmdbg.c b/reactos/dll/win32/vdmdbg/vdmdbg.c index 60ca25a832f..bd6a2701e91 100644 --- a/reactos/dll/win32/vdmdbg/vdmdbg.c +++ b/reactos/dll/win32/vdmdbg/vdmdbg.c @@ -33,14 +33,14 @@ ULONG WINAPI VDMGetPointer( HANDLE handle, UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; } - + BOOL WINAPI VDMProcessException( LPDEBUG_EVENT lpDebugEvent ) { UNIMPLEMENTED; return FALSE; } -BOOL WINAPI VDMGetSegmentInfo( WORD word, +BOOL WINAPI VDMGetSegmentInfo( WORD word, ULONG ulong, BOOL boolVal, VDM_SEGINFO *pVDMSegInfo ) @@ -105,7 +105,7 @@ BOOL WINAPI VDMTerminateTaskWOW( DWORD dwProcessId, WORD hTask ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } BOOL WINAPI VDMGetContext( HANDLE handle, @@ -113,7 +113,7 @@ BOOL WINAPI VDMGetContext( HANDLE handle, LPVDMCONTEXT lpVDMContext ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } BOOL WINAPI VDMSetContext( HANDLE handle, @@ -121,7 +121,7 @@ BOOL WINAPI VDMSetContext( HANDLE handle, LPVDMCONTEXT lpVDMContext) { UNIMPLEMENTED; - return FALSE; + return FALSE; } @@ -135,7 +135,7 @@ BOOL WINAPI VDMGetSelectorModule( HANDLE handle, UINT uInt2 ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } @@ -146,7 +146,7 @@ BOOL WINAPI VDMGetModuleSelector( HANDLE handle, LPWORD lpword ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } BOOL WINAPI VDMModuleFirst( HANDLE handle, @@ -156,7 +156,7 @@ BOOL WINAPI VDMModuleFirst( HANDLE handle, LPVOID lpvoid ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } BOOL WINAPI VDMGlobalFirst( HANDLE handle, @@ -167,7 +167,7 @@ BOOL WINAPI VDMGlobalFirst( HANDLE handle, LPVOID lpvoid ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } BOOL WINAPI VDMGlobalNext( HANDLE handle, @@ -178,7 +178,7 @@ BOOL WINAPI VDMGlobalNext( HANDLE handle, LPVOID lpvoid ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } BOOL WINAPI VDMModuleNext( HANDLE handle, @@ -188,7 +188,7 @@ BOOL WINAPI VDMModuleNext( HANDLE handle, LPVOID lpvoid ) { UNIMPLEMENTED; - return FALSE; + return FALSE; } BOOL STDCALL diff --git a/reactos/dll/win32/vdmdbg/vdmdbg.def b/reactos/dll/win32/vdmdbg/vdmdbg.def index dd5fb99f4af..ee6cdd0ad00 100644 --- a/reactos/dll/win32/vdmdbg/vdmdbg.def +++ b/reactos/dll/win32/vdmdbg/vdmdbg.def @@ -1,11 +1,11 @@ -; +; ; vdmdbg.def ; ; Exports for VDMDBG DLL ; ; Copyright (C) 1998 Free Software Foundation, Inc. ; Created by J.J. van der Heijden -; +; ; This file is part of the Windows32 API Library. ; Based on the November 1997 Platform SDK ; @@ -13,7 +13,7 @@ ; modify it under the terms of the GNU Library General Public ; License as published by the Free Software Foundation; either ; version 2 of the License, or (at your option) any later version. -; +; ; This library is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -21,7 +21,7 @@ ; ; You should have received a copy of the GNU Library General Public ; License along with this library; see the file COPYING.LIB. -; If not, write to the Free Software Foundation, +; If not, write to the Free Software Foundation, ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ; LIBRARY VDMDBG diff --git a/reactos/dll/win32/vdmdbg/vdmdbg.h b/reactos/dll/win32/vdmdbg/vdmdbg.h index 1b8a221e555..28531f2134b 100644 --- a/reactos/dll/win32/vdmdbg/vdmdbg.h +++ b/reactos/dll/win32/vdmdbg/vdmdbg.h @@ -28,7 +28,7 @@ typedef struct { typedef BOOL ( WINAPI *PROCESSENUMPROC ) ( - DWORD dwProcessId, + DWORD dwProcessId, DWORD dwAttributes, LPARAM lpUserDefined ); @@ -62,7 +62,7 @@ typedef struct { typedef DWORD ( CALLBACK* DEBUGEVENTPROC ) ( LPDEBUG_EVENT, LPVOID ); -typedef BOOL ( WINAPI *TASKENUMPROC ) +typedef BOOL ( WINAPI *TASKENUMPROC ) ( DWORD dwThreadId, WORD hMod16, WORD hTask16, diff --git a/reactos/dll/win32/version/info.c b/reactos/dll/win32/version/info.c index 2b5d535bf3f..df5a7d2c96a 100644 --- a/reactos/dll/win32/version/info.c +++ b/reactos/dll/win32/version/info.c @@ -594,12 +594,12 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle, /* We have a 16bit resource. */ #endif /* ! __REACTOS__ */ } - else + else { static const char signature[] = "FE2X"; DWORD bufsize = vvis->wLength + strlen(signature); DWORD convbuf; - + /* We have a 32bit resource. * * XP/W2K/W2K3 uses a buffer which is 2 times the actual needed space + 4 bytes "FE2X" diff --git a/reactos/dll/win32/wininet/cookie.c b/reactos/dll/win32/wininet/cookie.c index 231facabf01..a507ed46921 100644 --- a/reactos/dll/win32/wininet/cookie.c +++ b/reactos/dll/win32/wininet/cookie.c @@ -202,8 +202,8 @@ static BOOL COOKIE_matchDomain(LPCWSTR lpszCookieDomain, LPCWSTR lpszCookiePath, if (!searchDomain->lpCookieDomain) return FALSE; - TRACE("comparing domain %s with %s\n", - debugstr_w(lpszCookieDomain), + TRACE("comparing domain %s with %s\n", + debugstr_w(lpszCookieDomain), debugstr_w(searchDomain->lpCookieDomain)); if (allow_partial && !strstrW(lpszCookieDomain, searchDomain->lpCookieDomain)) @@ -274,7 +274,7 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, struct list * cursor; domain_count++; TRACE("found domain %p\n", cookiesDomain); - + LIST_FOR_EACH(cursor, &cookiesDomain->cookie_list) { cookie *thisCookie = LIST_ENTRY(cursor, cookie, entry); @@ -418,13 +418,13 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, if (!(ourCookieData = strchrW(lpCookieData, '='))) { - TRACE("something terribly wrong with cookie data %s\n", + TRACE("something terribly wrong with cookie data %s\n", debugstr_w(ourCookieData)); return FALSE; } ourCookieNameSize = ourCookieData - lpCookieData; ourCookieData += 1; - ourCookieName = HeapAlloc(GetProcessHeap(), 0, + ourCookieName = HeapAlloc(GetProcessHeap(), 0, (ourCookieNameSize + 1)*sizeof(WCHAR)); memcpy(ourCookieName, ourCookieData, ourCookieNameSize * sizeof(WCHAR)); ourCookieName[ourCookieNameSize] = '\0'; diff --git a/reactos/dll/win32/wininet/dialogs.c b/reactos/dll/win32/wininet/dialogs.c index 7fc6207e2b2..343d2abbeba 100644 --- a/reactos/dll/win32/wininet/dialogs.c +++ b/reactos/dll/win32/wininet/dialogs.c @@ -129,7 +129,7 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) /*********************************************************************** * WININET_GetSetPassword */ -static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer, +static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer, LPCWSTR szRealm, BOOL bSet ) { WCHAR szResource[0x80], szUserPass[0x40]; @@ -158,11 +158,11 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer, if( bSet ) { szUserPass[0] = 0; - GetWindowTextW( hUserItem, szUserPass, + GetWindowTextW( hUserItem, szUserPass, (sizeof szUserPass-1)/sizeof(WCHAR) ); lstrcatW(szUserPass, szColon); u_len = strlenW( szUserPass ); - GetWindowTextW( hPassItem, szUserPass+u_len, + GetWindowTextW( hPassItem, szUserPass+u_len, (sizeof szUserPass)/sizeof(WCHAR)-u_len ); r_len = (strlenW( szResource ) + 1)*sizeof(WCHAR); @@ -205,7 +205,7 @@ static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest, lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); if( !lpwhr ) return FALSE; - + lpwhs = (LPWININETHTTPSESSIONW) lpwhr->hdr.lpwhparent; if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION) { @@ -218,14 +218,14 @@ static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest, p = HeapAlloc( GetProcessHeap(), 0, (strlenW( username ) + 1)*sizeof(WCHAR) ); if( !p ) return FALSE; - + lstrcpyW( p, username ); hIC->lpszProxyUsername = p; p = HeapAlloc( GetProcessHeap(), 0, (strlenW( password ) + 1)*sizeof(WCHAR) ); if( !p ) return FALSE; - + lstrcpyW( p, password ); hIC->lpszProxyPassword = p; @@ -259,7 +259,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog( } /* extract the name of the proxy server */ - if( WININET_GetProxyServer( params->hRequest, + if( WININET_GetProxyServer( params->hRequest, szServer, sizeof szServer/sizeof(WCHAR)) ) { hitem = GetDlgItem( hdlg, IDC_PROXY ); @@ -285,7 +285,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog( hitem = GetDlgItem( hdlg, IDC_USERNAME ); if( hitem ) GetWindowTextW( hitem, username, sizeof username/sizeof(WCHAR) ); - + password[0] = 0; hitem = GetDlgItem( hdlg, IDC_PASSWORD ); if( hitem ) @@ -296,7 +296,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog( SendMessageW( hitem, BM_GETSTATE, 0, 0 ) && WININET_GetAuthRealm( params->hRequest, szRealm, sizeof szRealm/sizeof(WCHAR)) && - WININET_GetProxyServer( params->hRequest, + WININET_GetProxyServer( params->hRequest, szServer, sizeof szServer/sizeof(WCHAR)) ) { WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE ); diff --git a/reactos/dll/win32/wininet/ftp.c b/reactos/dll/win32/wininet/ftp.c index aa254f61cb2..46320dabe46 100644 --- a/reactos/dll/win32/wininet/ftp.c +++ b/reactos/dll/win32/wininet/ftp.c @@ -160,7 +160,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, LPWSTR lpwzLocalFile; LPWSTR lpwzNewRemoteFile; BOOL ret; - + lpwzLocalFile = lpszLocalFile?WININET_strdup_AtoW(lpszLocalFile):NULL; lpwzNewRemoteFile = lpszNewRemoteFile?WININET_strdup_AtoW(lpszNewRemoteFile):NULL; ret = FtpPutFileW(hConnect, lpwzLocalFile, lpwzNewRemoteFile, @@ -319,7 +319,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) { LPWSTR lpwzDirectory; BOOL ret; - + lpwzDirectory = lpszDirectory?WININET_strdup_AtoW(lpszDirectory):NULL; ret = FtpSetCurrentDirectoryW(hConnect, lpwzDirectory); HeapFree(GetProcessHeap(), 0, lpwzDirectory); @@ -448,7 +448,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) { LPWSTR lpwzDirectory; BOOL ret; - + lpwzDirectory = lpszDirectory?WININET_strdup_AtoW(lpszDirectory):NULL; ret = FtpCreateDirectoryW(hConnect, lpwzDirectory); HeapFree(GetProcessHeap(), 0, lpwzDirectory); @@ -575,12 +575,12 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, WIN32_FIND_DATAW wfd; LPWIN32_FIND_DATAW lpFindFileDataW; HINTERNET ret; - + lpwzSearchFile = lpszSearchFile?WININET_strdup_AtoW(lpszSearchFile):NULL; lpFindFileDataW = lpFindFileData?&wfd:NULL; ret = FtpFindFirstFileW(hConnect, lpwzSearchFile, lpFindFileDataW, dwFlags, dwContext); HeapFree(GetProcessHeap(), 0, lpwzSearchFile); - + if(lpFindFileData) { WININET_find_data_WtoA(lpFindFileDataW, lpFindFileData); } @@ -903,7 +903,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession, { LPWSTR lpwzFileName; HINTERNET ret; - + lpwzFileName = lpszFileName?WININET_strdup_AtoW(lpszFileName):NULL; ret = FtpOpenFileW(hFtpSession, lpwzFileName, fdwAccess, dwFlags, dwContext); HeapFree(GetProcessHeap(), 0, lpwzFileName); @@ -928,7 +928,7 @@ HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession, LPWININETFTPSESSIONW lpwfs; LPWININETAPPINFOW hIC = NULL; HINTERNET r = NULL; - + TRACE("(%p,%s,0x%08lx,0x%08lx,0x%08lx)\n", hFtpSession, debugstr_w(lpszFileName), fdwAccess, dwFlags, dwContext); @@ -1024,7 +1024,7 @@ HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs, lpwh->hdr.lpfnStatusCB = lpwfs->hdr.lpfnStatusCB; lpwh->nDataSocket = nDataSocket; lpwh->session_deleted = FALSE; - + handle = WININET_AllocHandle( &lpwh->hdr ); if( !handle ) goto lend; @@ -1080,7 +1080,7 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN LPWSTR lpwzRemoteFile; LPWSTR lpwzNewFile; BOOL ret; - + lpwzRemoteFile = lpszRemoteFile?WININET_strdup_AtoW(lpszRemoteFile):NULL; lpwzNewFile = lpszNewFile?WININET_strdup_AtoW(lpszNewFile):NULL; ret = FtpGetFileW(hInternet, lpwzRemoteFile, lpwzNewFile, fFailIfExists, @@ -1120,7 +1120,7 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps INTERNET_SetLastError(ERROR_FTP_TRANSFER_IN_PROGRESS); goto lend; } - + hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent; if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) { @@ -1259,7 +1259,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) { LPWSTR lpwzFileName; BOOL ret; - + lpwzFileName = lpszFileName?WININET_strdup_AtoW(lpszFileName):NULL; ret = FtpDeleteFileW(hFtpSession, lpwzFileName); HeapFree(GetProcessHeap(), 0, lpwzFileName); @@ -1378,7 +1378,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) { LPWSTR lpwzDirectory; BOOL ret; - + lpwzDirectory = lpszDirectory?WININET_strdup_AtoW(lpszDirectory):NULL; ret = FtpRemoveDirectoryW(hFtpSession, lpwzDirectory); HeapFree(GetProcessHeap(), 0, lpwzDirectory); @@ -1499,7 +1499,7 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes LPWSTR lpwzSrc; LPWSTR lpwzDest; BOOL ret; - + lpwzSrc = lpszSrc?WININET_strdup_AtoW(lpszSrc):NULL; lpwzDest = lpszDest?WININET_strdup_AtoW(lpszDest):NULL; ret = FtpRenameFileW(hFtpSession, lpwzSrc, lpwzDest); @@ -1673,7 +1673,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, INTERNET_SetLastError(ERROR_INVALID_PARAMETER); goto lerror; } - + lpwfs = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETFTPSESSIONW)); if (NULL == lpwfs) { @@ -1716,7 +1716,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, lpwfs->lpszUserName = WININET_strdupW(lpszUserName); lpwfs->lpszPassword = WININET_strdupW(lpszPassword); } - + /* Don't send a handle created callback if this handle was created with InternetOpenUrl */ if (!(lpwfs->hdr.dwInternalFlags & INET_OPENURL)) { @@ -1729,7 +1729,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, INTERNET_STATUS_HANDLE_CREATED, &iar, sizeof(INTERNET_ASYNC_RESULT)); } - + SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_RESOLVING_NAME, (LPWSTR) lpszServerName, strlenW(lpszServerName)); @@ -2235,7 +2235,7 @@ static BOOL FTP_GetFileSize(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, for (i = 0; (lpszResponseBuffer[i] != ' ') && (lpszResponseBuffer[i] != '\0'); i++) ; if (lpszResponseBuffer[i] == '\0') return FALSE; *dwSize = atol(&(lpszResponseBuffer[i + 1])); - + bSuccess = TRUE; } else { FTP_SetResponseError(nResCode); @@ -2539,7 +2539,7 @@ static DWORD FTP_SendRetrieve(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile goto lend; TRACE("Waiting to receive %ld bytes\n", nResult); - + if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_RETR, lpszRemoteFile, 0, 0, 0)) goto lend; @@ -2631,7 +2631,7 @@ static void FTP_CloseSessionHandle(LPWININETHANDLEHEADER hdr) if (lpwfs->download_in_progress != NULL) lpwfs->download_in_progress->session_deleted = TRUE; - + if (lpwfs->sndSocket != -1) closesocket(lpwfs->sndSocket); @@ -2694,7 +2694,7 @@ static void FTP_CloseFileTransferHandle(LPWININETHANDLEHEADER hdr) Wonder what to do if the server sends us an error code though... */ nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext); - + if (lpwh->nDataSocket != -1) closesocket(lpwh->nDataSocket); @@ -2774,7 +2774,7 @@ BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileD (LARGE_INTEGER *) &(lpFindFileData->ftLastAccessTime)); lpFindFileData->ftLastWriteTime = lpFindFileData->ftLastAccessTime; lpFindFileData->ftCreationTime = lpFindFileData->ftLastAccessTime; - + /* Not all fields are filled in */ lpFindFileData->nFileSizeHigh = 0; /* We do not handle files bigger than 0xFFFFFFFF bytes yet :-) */ lpFindFileData->nFileSizeLow = lpafp->nSize; @@ -2809,12 +2809,12 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT char *pszTmp; BOOL found = FALSE; int i; - + lpfp->lpszName = NULL; do { if(!(pszLine = INTERNET_GetNextLine(nSocket, &nBufLen))) return FALSE; - + pszToken = strtok(pszLine, szSpace); /* ls format *

sakpatch 05-09-03 06:02PM 12656686 2003-04-21bgm_cmd_e.rgz */ else if(isdigit(pszToken[0]) && 8 == strlen(pszToken)) { lpfp->permissions = 0xFFFF; /* No idea, put full permission :-) */ - + sscanf(pszToken, "%d-%d-%d", &lpfp->tmLastModified.tm_mon, &lpfp->tmLastModified.tm_mday, @@ -2902,7 +2902,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT /* Hacky and bad Y2K protection :-) */ if (lpfp->tmLastModified.tm_year < 70) lpfp->tmLastModified.tm_year += 100; - + pszToken = strtok(NULL, szSpace); if(!pszToken) continue; sscanf(pszToken, "%d:%d", @@ -2917,7 +2917,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT lpfp->tmLastModified.tm_hour, lpfp->tmLastModified.tm_min, lpfp->tmLastModified.tm_sec, (lpfp->tmLastModified.tm_year >= 100) ? lpfp->tmLastModified.tm_year - 100 : lpfp->tmLastModified.tm_year, lpfp->tmLastModified.tm_mon, lpfp->tmLastModified.tm_mday); - + pszToken = strtok(NULL, szSpace); if(!pszToken) continue; if(!strcasecmp(pszToken, "")) { @@ -2930,7 +2930,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT lpfp->nSize = atol(pszToken); TRACE("Size: %ld\n", lpfp->nSize); } - + pszToken = strtok(NULL, szSpace); if(!pszToken) continue; lpfp->lpszName = WININET_strdup_AtoW(pszToken); @@ -2940,7 +2940,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT else if(pszToken[0] == '+') { FIXME("EPLF Format not implemented\n"); } - + if(lpfp->lpszName) { if((lpszSearchFile == NULL) || (PathMatchSpecW(lpfp->lpszName, lpszSearchFile))) { @@ -2983,7 +2983,7 @@ static BOOL FTP_ParseDirectory(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR if (indexFilePropArray+1 >= sizeFilePropArray) { LPFILEPROPERTIESW tmpafp; - + sizeFilePropArray *= 2; tmpafp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *lpafp, sizeof(FILEPROPERTIESW)*sizeFilePropArray); diff --git a/reactos/dll/win32/wininet/gopher.c b/reactos/dll/win32/wininet/gopher.c index a599ad8c3fa..3fd5664c3bd 100644 --- a/reactos/dll/win32/wininet/gopher.c +++ b/reactos/dll/win32/wininet/gopher.c @@ -65,7 +65,7 @@ BOOL WINAPI GopherCreateLocatorA( /*********************************************************************** * GopherCreateLocatorW (WININET.@) - * + * * See GopherCreateLocatorA. */ BOOL WINAPI GopherCreateLocatorW( @@ -138,7 +138,7 @@ HINTERNET WINAPI GopherFindFirstFileW( * GopherGetAttributeA (WININET.@) * * Retrieves the specific attribute information from the server. - * + * * RETURNS * TRUE on success * FALSE on failure diff --git a/reactos/dll/win32/wininet/http.c b/reactos/dll/win32/wininet/http.c index 22c199957f1..47a0ce9b161 100644 --- a/reactos/dll/win32/wininet/http.c +++ b/reactos/dll/win32/wininet/http.c @@ -180,9 +180,9 @@ static void HTTP_FreeTokens(LPWSTR * token_array) } /* ********************************************************************** - * + * * Helper functions for the HttpSendRequest(Ex) functions - * + * */ static void HTTP_FixVerb( LPWININETHTTPREQW lpwhr ) { @@ -221,7 +221,7 @@ static void HTTP_FixURL( LPWININETHTTPREQW lpwhr) lpwhr->lpszPath, strlenW(szHttp), szHttp, strlenW(szHttp) ) && lpwhr->lpszPath[0] != '/') /* not an absolute path ?? --> fix it !! */ { - WCHAR *fixurl = HeapAlloc(GetProcessHeap(), 0, + WCHAR *fixurl = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpwhr->lpszPath) + 2)*sizeof(WCHAR)); *fixurl = '/'; strcpyW(fixurl + 1, lpwhr->lpszPath); @@ -285,7 +285,7 @@ static LPWSTR HTTP_BuildHeaderRequestString( LPWININETHTTPREQW lpwhr, LPCWSTR ve while ( (*p == '\n') || (*p == '\r') ) p--; strcpyW( p+1, sztwocrlf ); - + return requestString; } @@ -357,7 +357,7 @@ static void HTTP_ProcessHeaders( LPWININETHTTPREQW lpwhr ) cookie_data = &buf_cookie[nEqualPos + 1]; Host = HTTP_GetHeader(lpwhr,szHost); - len = lstrlenW((domain ? domain : (Host?Host->lpszValue:NULL))) + + len = lstrlenW((domain ? domain : (Host?Host->lpszValue:NULL))) + strlenW(lpwhr->lpszPath) + 9; buf_url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); sprintfW(buf_url, szFmt, (domain ? domain : (Host?Host->lpszValue:NULL))); /* FIXME PATH!!! */ @@ -465,7 +465,7 @@ BOOL WINAPI HttpAddRequestHeadersW(HINTERNET hHttpRequest, TRACE("%p, %s, %li, %li\n", hHttpRequest, debugstr_w(lpszHeader), dwHeaderLength, dwModifier); - if (!lpszHeader) + if (!lpszHeader) return TRUE; lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hHttpRequest ); @@ -525,7 +525,7 @@ BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest, * FALSE on failure * */ -BOOL WINAPI HttpEndRequestA(HINTERNET hRequest, +BOOL WINAPI HttpEndRequestA(HINTERNET hRequest, LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD dwContext) { LPINTERNET_BUFFERSA ptr; @@ -589,7 +589,7 @@ BOOL WINAPI HttpEndRequestA(HINTERNET hRequest, * FALSE on failure * */ -BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, +BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, LPINTERNET_BUFFERSW lpBuffersOut, DWORD dwFlags, DWORD dwContext) { BOOL rc = FALSE; @@ -674,7 +674,7 @@ HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, int i; for(i=0;lpszAcceptTypes[i]!=NULL;i++) TRACE("\taccept type: %s\n",debugstr_w(lpszAcceptTypes[i])); - } + } lpwhs = (LPWININETHTTPSESSIONW) WININET_GetObject( hHttpSession ); if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION) @@ -766,7 +766,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, if (lpszAcceptTypes) { /* find out how many there are */ - while (lpszAcceptTypes[acceptTypesCount]) + while (lpszAcceptTypes[acceptTypesCount]) acceptTypesCount++; szAcceptTypes = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *) * (acceptTypesCount+1)); acceptTypesCount = 0; @@ -814,7 +814,7 @@ end: static UINT HTTP_Base64( LPCWSTR bin, LPWSTR base64 ) { UINT n = 0, x; - static LPCSTR HTTP_Base64Enc = + static LPCSTR HTTP_Base64Enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; while( bin[0] ) @@ -904,7 +904,7 @@ static BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQW lpwhr, HTTP_ADDHDR_FLAG_REPLACE); HeapFree( GetProcessHeap(), 0, authorization ); - + return ret; } @@ -1299,7 +1299,7 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev if ((dwInfoLevel & ~HTTP_QUERY_MODIFIER_FLAGS_MASK) == HTTP_QUERY_CUSTOM) { INT requested_index = (lpdwIndex)?(*lpdwIndex):0; - INT index = HTTP_GetCustomHeaderIndex(lpwhr, (LPWSTR)lpBuffer, + INT index = HTTP_GetCustomHeaderIndex(lpwhr, (LPWSTR)lpBuffer, requested_index,request_only); if (index < 0) @@ -1469,10 +1469,10 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev STHook->wMonth = tmpTM.tm_mon + 1; STHook->wSecond = tmpTM.tm_sec; STHook->wYear = tmpTM.tm_year; - + bSuccess = TRUE; - - TRACE(" returning time : %04d/%02d/%02d - %d - %02d:%02d:%02d.%02d\n", + + TRACE(" returning time : %04d/%02d/%02d - %d - %02d:%02d:%02d.%02d\n", STHook->wYear, STHook->wMonth, STHook->wDay, STHook->wDayOfWeek, STHook->wHour, STHook->wMinute, STHook->wSecond, STHook->wMilliseconds); } @@ -1627,13 +1627,13 @@ BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, info_mod &= ~ modifier_flags[i].val; } } - + if (info_mod) { TRACE(" Unknown (%08lx)", info_mod); } TRACE("\n"); } - + lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hHttpRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) { @@ -1839,7 +1839,7 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, lpBuffersIn->lpvBuffer, lpBuffersIn->dwBufferLength, lpBuffersIn->dwBufferTotal, FALSE); } - + WININET_Release(&lpwhr->hdr); TRACE("<---\n"); return ret; @@ -2080,7 +2080,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST #if 0 /* - * This upsets redirects to binary files on sourceforge.net + * This upsets redirects to binary files on sourceforge.net * and gives an html page instead of the target file * Examination of the HTTP request sent by native wininet.dll * reveals that it doesn't send a referrer in that case. @@ -2094,7 +2094,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST HTTP_ADDHDR_FLAG_REQ|HTTP_ADDREQ_FLAG_REPLACE| HTTP_ADDHDR_FLAG_ADD_IF_NEW); #endif - + HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); lpwhs->lpszServerName = WININET_strdupW(hostName); HeapFree(GetProcessHeap(), 0, lpwhs->lpszHostName); @@ -2113,7 +2113,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST HTTP_ProcessHeader(lpwhr, szHost, lpwhs->lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ); - + HeapFree(GetProcessHeap(), 0, lpwhs->lpszUserName); lpwhs->lpszUserName = NULL; if (userName[0]) @@ -2263,7 +2263,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, INTERNET_SetLastError(0); HTTP_FixVerb(lpwhr); - + /* if we are using optional stuff, we must add the fixed header of that option length */ if (dwContentLength > 0) { @@ -2296,7 +2296,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, HTTP_AddProxyInfo(lpwhr); requestString = HTTP_BuildHeaderRequestString(lpwhr, lpwhr->lpszVerb, lpwhr->lpszPath, FALSE); - + TRACE("Request header -> %s\n", debugstr_w(requestString) ); /* Send the request and store the results */ @@ -2331,18 +2331,18 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, { INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_RECEIVING_RESPONSE, NULL, 0); - + if (cnt < 0) goto lend; - + responseLen = HTTP_GetResponseHeaders(lpwhr); if (responseLen) bSuccess = TRUE; - + INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_RESPONSE_RECEIVED, &responseLen, sizeof(DWORD)); - + HTTP_ProcessHeaders(lpwhr); } else @@ -2355,7 +2355,7 @@ lend: HeapFree(GetProcessHeap(), 0, requestString); /* TODO: send notification for P3P header */ - + if(!(lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_AUTO_REDIRECT) && bSuccess && bEndRequest) { DWORD dwCode,dwCodeLength=sizeof(DWORD),dwIndex=0; @@ -2414,7 +2414,7 @@ HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, assert( hIC->hdr.htype == WH_HINIT ); hIC->hdr.dwContext = dwContext; - + lpwhs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETHTTPSESSIONW)); if (NULL == lpwhs) { @@ -2700,7 +2700,7 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr) if (!pFieldAndValue) break; - HTTP_ProcessHeader(lpwhr, pFieldAndValue[0], pFieldAndValue[1], + HTTP_ProcessHeader(lpwhr, pFieldAndValue[0], pFieldAndValue[1], HTTP_ADDREQ_FLAG_ADD ); HTTP_FreeTokens(pFieldAndValue); @@ -2831,7 +2831,7 @@ static BOOL HTTP_ProcessHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field, LPCWSTR v /* REPLACE wins out over ADD */ if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) dwModifier &= ~HTTP_ADDHDR_FLAG_ADD; - + if (dwModifier & HTTP_ADDHDR_FLAG_ADD) index = -1; else @@ -3030,7 +3030,7 @@ static INT HTTP_GetCustomHeaderIndex(LPWININETHTTPREQW lpwhr, LPCWSTR lpszField, { if (!strcmpiW(lpwhr->pCustHeaders[index].lpszField, lpszField)) { - if ((request_only && + if ((request_only && !(lpwhr->pCustHeaders[index].wFlags & HDR_ISREQUEST))|| (!request_only && (lpwhr->pCustHeaders[index].wFlags & HDR_ISREQUEST))) diff --git a/reactos/dll/win32/wininet/internet.c b/reactos/dll/win32/wininet/internet.c index 0135f55c110..78c013355ff 100644 --- a/reactos/dll/win32/wininet/internet.c +++ b/reactos/dll/win32/wininet/internet.c @@ -106,7 +106,7 @@ static HMODULE WININET_hModule; #define HANDLE_CHUNK_SIZE 0x10 static CRITICAL_SECTION WININET_cs; -static CRITICAL_SECTION_DEBUG WININET_cs_debug = +static CRITICAL_SECTION_DEBUG WININET_cs_debug = { 0, 0, &WININET_cs, { &WININET_cs_debug.ProcessLocksList, &WININET_cs_debug.ProcessLocksList }, @@ -127,7 +127,7 @@ HINTERNET WININET_AllocHandle( LPWININETHANDLEHEADER info ) if( !WININET_dwMaxHandles ) { num = HANDLE_CHUNK_SIZE; - p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (UINT)* num); if( !p ) goto end; @@ -150,10 +150,10 @@ HINTERNET WININET_AllocHandle( LPWININETHANDLEHEADER info ) ERR("handle isn't free but should be\n"); WININET_Handles[handle] = WININET_AddRef( info ); - while( WININET_Handles[WININET_dwNextHandle] && + while( WININET_Handles[WININET_dwNextHandle] && (WININET_dwNextHandle < WININET_dwMaxHandles ) ) WININET_dwNextHandle++; - + end: LeaveCriticalSection( &WININET_cs ); @@ -193,7 +193,7 @@ LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet ) EnterCriticalSection( &WININET_cs ); - if( (handle > 0) && ( handle <= WININET_dwMaxHandles ) && + if( (handle > 0) && ( handle <= WININET_dwMaxHandles ) && WININET_Handles[handle-1] ) info = WININET_AddRef( WININET_Handles[handle-1] ); @@ -396,7 +396,7 @@ static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOW lpwai ) TRACE("Proxy is enabled.\n"); /* figure out how much memory the proxy setting takes */ - r = RegQueryValueExW( key, szProxyServer, NULL, &keytype, + r = RegQueryValueExW( key, szProxyServer, NULL, &keytype, NULL, &len); if( (r == ERROR_SUCCESS) && len && (keytype == REG_SZ) ) { @@ -442,7 +442,7 @@ static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOW lpwai ) * None * */ -static void dump_INTERNET_FLAGS(DWORD dwFlags) +static void dump_INTERNET_FLAGS(DWORD dwFlags) { #define FE(x) { x, #x } static const wininet_flag_info flag[] = { @@ -477,13 +477,13 @@ static void dump_INTERNET_FLAGS(DWORD dwFlags) }; #undef FE int i; - + for (i = 0; i < (sizeof(flag) / sizeof(flag[0])); i++) { if (flag[i].val & dwFlags) { TRACE(" %s", flag[i].name); dwFlags &= ~flag[i].val; } - } + } if (dwFlags) TRACE(" Unknown flags (%08lx)\n", dwFlags); else @@ -517,7 +517,7 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, #undef FE DWORD i; const char *access_type_str = "Unknown"; - + TRACE("(%s, %li, %s, %s, %li)\n", debugstr_w(lpszAgent), dwAccessType, debugstr_w(lpszProxy), debugstr_w(lpszProxyBypass), dwFlags); for (i = 0; i < (sizeof(access_type) / sizeof(access_type[0])); i++) { @@ -540,7 +540,7 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, INTERNET_SetLastError(ERROR_OUTOFMEMORY); goto lend; } - + memset(lpwai, 0, sizeof(WININETAPPINFOW)); lpwai->hdr.htype = WH_HINIT; lpwai->hdr.lpwhparent = NULL; @@ -915,7 +915,7 @@ BOOL WINAPI InternetFindNextFileA(HINTERNET hFind, LPVOID lpvFindData) { BOOL ret; WIN32_FIND_DATAW fd; - + ret = InternetFindNextFileW(hFind, lpvFindData?&fd:NULL); if(lpvFindData) WININET_find_data_WtoA(&fd, (LPWIN32_FIND_DATAA)lpvFindData); @@ -1072,7 +1072,7 @@ static VOID INTERNET_CloseHandle(LPWININETHANDLEHEADER hdr) BOOL WINAPI InternetCloseHandle(HINTERNET hInternet) { LPWININETHANDLEHEADER lpwh; - + TRACE("%p\n",hInternet); lpwh = WININET_GetObject( hInternet ); @@ -1155,7 +1155,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, dwUrlLength=-1; nLength=MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,NULL,0); - /* if dwUrlLength=-1 then nLength includes null but length to + /* if dwUrlLength=-1 then nLength includes null but length to InternetCrackUrlW should not include it */ if (dwUrlLength == -1) nLength--; @@ -1202,7 +1202,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, lpUrlComponents->nScheme=UCW.nScheme; lpUrlComponents->nPort=UCW.nPort; HeapFree(GetProcessHeap(), 0, lpwszUrl); - + TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", lpszUrl, debugstr_an(lpUrlComponents->lpszScheme,lpUrlComponents->dwSchemeLength), debugstr_an(lpUrlComponents->lpszHostName,lpUrlComponents->dwHostNameLength), @@ -1325,7 +1325,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR } } lpszap = lpszUrl; - + /* Determine if the URI is absolute. */ while (*lpszap != '\0') { @@ -1664,7 +1664,7 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA( LPWININETHANDLEHEADER lpwh; TRACE("0x%08lx\n", (ULONG)hInternet); - + lpwh = WININET_GetObject(hInternet); if (!lpwh) return INTERNET_INVALID_STATUS_CALLBACK; @@ -1696,7 +1696,7 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW( LPWININETHANDLEHEADER lpwh; TRACE("0x%08lx\n", (ULONG)hInternet); - + lpwh = WININET_GetObject(hInternet); if (!lpwh) return INTERNET_INVALID_STATUS_CALLBACK; @@ -1750,7 +1750,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer , lpwhr = (LPWININETHTTPREQW)lpwh; TRACE("HTTPREQ %li\n",dwNumOfBytesToWrite); - retval = NETCON_send(&lpwhr->netConnection, lpBuffer, + retval = NETCON_send(&lpwhr->netConnection, lpBuffer, dwNumOfBytesToWrite, 0, (LPINT)lpdwNumOfBytesWritten); WININET_Release( lpwh ); @@ -2197,7 +2197,7 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d sizeof(INTERNET_PROXY_INFOA)); *((LPSTR)(pPI->lpszProxy)) = '\0'; } - + if (lpwai->lpszProxyBypass) { pPI->lpszProxyBypass = (LPSTR)((LPBYTE)lpBuffer + @@ -2843,7 +2843,7 @@ BOOL WINAPI InternetCheckConnectionA(LPCSTR lpszUrl, DWORD dwFlags, DWORD dwRese MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, szUrl, len); rc = InternetCheckConnectionW(szUrl, dwFlags, dwReserved); HeapFree(GetProcessHeap(), 0, szUrl); - + return rc; } @@ -2863,10 +2863,10 @@ HINTERNET WINAPI INTERNET_InternetOpenUrlW(LPWININETAPPINFOW hIC, LPCWSTR lpszUr WCHAR protocol[32], hostName[MAXHOSTNAME], userName[1024]; WCHAR password[1024], path[2048], extra[1024]; HINTERNET client = NULL, client1 = NULL; - + TRACE("(%p, %s, %s, %08lx, %08lx, %08lx)\n", hIC, debugstr_w(lpszUrl), debugstr_w(lpszHeaders), dwHeadersLength, dwFlags, dwContext); - + urlComponents.dwStructSize = sizeof(URL_COMPONENTSW); urlComponents.lpszScheme = protocol; urlComponents.dwSchemeLength = 32; @@ -2896,7 +2896,7 @@ HINTERNET WINAPI INTERNET_InternetOpenUrlW(LPWININETAPPINFOW hIC, LPCWSTR lpszUr break; } break; - + case INTERNET_SCHEME_HTTP: case INTERNET_SCHEME_HTTPS: { static const WCHAR szStars[] = { '*','/','*', 0 }; @@ -2932,7 +2932,7 @@ HINTERNET WINAPI INTERNET_InternetOpenUrlW(LPWININETAPPINFOW hIC, LPCWSTR lpszUr } TRACE(" %p <--\n", client1); - + return client1; } @@ -2962,11 +2962,11 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); goto lend; } - + if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) { WORKREQUEST workRequest; struct WORKREQ_INTERNETOPENURLW *req; - + workRequest.asyncall = INTERNETOPENURLW; workRequest.hdr = WININET_AddRef( &hIC->hdr ); req = &workRequest.u.InternetOpenUrlW; @@ -2981,7 +2981,7 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, req->dwHeadersLength = dwHeadersLength; req->dwFlags = dwFlags; req->dwContext = dwContext; - + INTERNET_AsyncCall(&workRequest); /* * This is from windows. @@ -2990,12 +2990,12 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, } else { ret = INTERNET_InternetOpenUrlW(hIC, lpszUrl, lpszHeaders, dwHeadersLength, dwFlags, dwContext); } - + lend: if( hIC ) WININET_Release( &hIC->hdr ); TRACE(" %p <--\n", ret); - + return ret; } @@ -3026,7 +3026,7 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, return (HINTERNET)NULL; MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, szUrl, lenUrl); } - + if(lpszHeaders) { lenHeaders = MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, NULL, 0 ); szHeaders = HeapAlloc(GetProcessHeap(), 0, lenHeaders*sizeof(WCHAR)); @@ -3036,7 +3036,7 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, } MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, szHeaders, lenHeaders); } - + rc = InternetOpenUrlW(hInternet, szUrl, szHeaders, lenHeaders, dwFlags, dwContext); @@ -3453,7 +3453,7 @@ static VOID INTERNET_ExecuteWork(void) { struct WORKREQ_INTERNETOPENURLW *req = &workRequest.u.InternetOpenUrlW; LPWININETAPPINFOW hIC = (LPWININETAPPINFOW) workRequest.hdr; - + TRACE("INTERNETOPENURLW %p\n", hIC); INTERNET_InternetOpenUrlW(hIC, req->lpszUrl, diff --git a/reactos/dll/win32/wininet/internet.h b/reactos/dll/win32/wininet/internet.h index 8043e4cf289..d871a859e84 100644 --- a/reactos/dll/win32/wininet/internet.h +++ b/reactos/dll/win32/wininet/internet.h @@ -108,10 +108,10 @@ inline static void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND dataA->nFileSizeLow = dataW->nFileSizeLow; dataA->dwReserved0 = dataW->dwReserved0; dataA->dwReserved1 = dataW->dwReserved1; - WideCharToMultiByte(CP_ACP, 0, dataW->cFileName, -1, + WideCharToMultiByte(CP_ACP, 0, dataW->cFileName, -1, dataA->cFileName, sizeof(dataA->cFileName), NULL, NULL); - WideCharToMultiByte(CP_ACP, 0, dataW->cAlternateFileName, -1, + WideCharToMultiByte(CP_ACP, 0, dataW->cAlternateFileName, -1, dataA->cAlternateFileName, sizeof(dataA->cAlternateFileName), NULL, NULL); } diff --git a/reactos/dll/win32/wininet/urlcache.c b/reactos/dll/win32/wininet/urlcache.c index f1435120a38..4b62e7e7d5c 100644 --- a/reactos/dll/win32/wininet/urlcache.c +++ b/reactos/dll/win32/wininet/urlcache.c @@ -299,7 +299,7 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) int i, j; dwFileSize = NEWFILE_SIZE; - + /* First set some constants and defaults in the header */ strcpy(pHeader->szSignature, "WINE URLCache Ver 0.2005001"); pHeader->dwFileSize = dwFileSize; @@ -309,14 +309,14 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) pHeader->dwCacheLimitLow = 0x07ff5400; /* Copied from a Windows 2000 cache index */ pHeader->DirectoryCount = 4; - + /* If the registry has a cache size set, use the registry value */ if (RegOpenKeyA(HKEY_CURRENT_USER, szCacheContent, &key) == ERROR_SUCCESS) { DWORD dw; DWORD len = sizeof(dw); DWORD keytype; - + if (RegQueryValueExA(key, "CacheLimit", NULL, &keytype, (BYTE *) &dw, &len) == ERROR_SUCCESS && keytype == REG_DWORD) @@ -326,17 +326,17 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) } RegCloseKey(key); } - + URLCache_CreateHashTable(pHeader, NULL); /* Last step - create the directories */ - + strcpyW(wszDirPath, pContainer->path); pwchDir = wszDirPath + strlenW(wszDirPath); pwchDir[8] = 0; - + GetSystemTimeAsFileTime(&ft); - + for (i = 0; !dwError && i < pHeader->DirectoryCount; ++i) { /* The following values were copied from a Windows index. @@ -349,7 +349,7 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) { int k; ULONGLONG n = ft.dwHighDateTime; - + /* Generate a file name to attempt to create. * This algorithm will create what will appear * to be random and unrelated directory names @@ -358,26 +358,26 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) n <<= 32; n += ft.dwLowDateTime; n ^= ((ULONGLONG) i << 56) | ((ULONGLONG) j << 48); - + for (k = 0; k < 8; ++k) { int r = (n % 36); - + /* Dividing by a prime greater than 36 helps * with the appearance of randomness */ n /= 37; - + if (r < 10) pwchDir[k] = '0' + r; else pwchDir[k] = 'A' + (r - 10); } - + if (CreateDirectoryW(wszDirPath, 0)) { int k; - + /* The following is OK because we generated an * 8 character directory name made from characters * [A-Z0-9], which are equivalent for all code @@ -399,7 +399,7 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) } } } - + UnmapViewOfFile(pHeader); } else @@ -530,7 +530,7 @@ void URLCacheContainers_CreateDefaults(void) int nFolder; /* CSIDL_* constant */ const WCHAR * shpath_suffix; /* suffix on path returned by SHGetSpecialFolderPath */ const WCHAR * cache_prefix; /* prefix used to reference the container */ - } DefaultContainerData[] = + } DefaultContainerData[] = { { CSIDL_INTERNET_CACHE, UrlSuffix, UrlPrefix }, { CSIDL_HISTORY, HistorySuffix, HistoryPrefix }, @@ -561,7 +561,7 @@ void URLCacheContainers_CreateDefaults(void) wszCachePath[path_len] = '\\'; strcpyW(wszMutexName, wszCachePath); - + if (suffix_len) { memcpy(wszCachePath + path_len + 1, DefaultContainerData[i].shpath_suffix, (suffix_len + 1) * sizeof(WCHAR)); @@ -669,7 +669,7 @@ static LPURLCACHE_HEADER URLCacheContainer_LockIndex(URLCACHECONTAINER * pContai { TRACE("Directory[%d] = \"%.8s\"\n", index, pHeader->directory_data[index].filename); } - + return pHeader; } @@ -753,7 +753,7 @@ static BOOL URLCache_FindFirstFreeEntry(URLCACHE_HEADER * pHeader, DWORD dwBlock DWORD dwFreeCounter; for (dwBlockNumber = 0; dwBlockNumber < pHeader->dwIndexCapacityInBlocks; dwBlockNumber++) { - for (dwFreeCounter = 0; + for (dwFreeCounter = 0; dwFreeCounter < dwBlocksNeeded && dwFreeCounter + dwBlockNumber < pHeader->dwIndexCapacityInBlocks && URLCache_Allocation_BlockIsFree(AllocationTable, dwBlockNumber + dwFreeCounter); @@ -904,9 +904,9 @@ static BOOL URLCache_LocalFileNameToPathA( */ static BOOL URLCache_CopyEntry( URLCACHECONTAINER * pContainer, - LPCURLCACHE_HEADER pHeader, - LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo, - LPDWORD lpdwBufferSize, + LPCURLCACHE_HEADER pHeader, + LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo, + LPDWORD lpdwBufferSize, URL_CACHEFILE_ENTRY * pUrlEntry, BOOL bUnicode) { @@ -943,7 +943,7 @@ static BOOL URLCache_CopyEntry( else lenUrl = strlen(pUrlEntry->szSourceUrlName); dwRequiredSize += lenUrl + 1; - + /* FIXME: is source url optional? */ if (*lpdwBufferSize >= dwRequiredSize) { @@ -1045,7 +1045,7 @@ static DWORD URLCache_HashKey(LPCSTR lpszKey) /* NOTE: this uses the same lookup table as SHLWAPI.UrlHash{A,W} * but the algorithm and result are not the same! */ - static const unsigned char lookupTable[256] = + static const unsigned char lookupTable[256] = { 0x01, 0x0E, 0x6E, 0x19, 0x61, 0xAE, 0x84, 0x77, 0x8A, 0xAA, 0x7D, 0x76, 0x1B, 0xE9, 0x8C, 0x33, @@ -1334,7 +1334,7 @@ BOOL WINAPI GetUrlCacheEntryInfoExA( DWORD dwFlags) { TRACE("(%s, %p, %p, %p, %p, %p, %lx)\n", - debugstr_a(lpszUrl), + debugstr_a(lpszUrl), lpCacheEntryInfo, lpdwCacheEntryInfoBufSize, lpszReserved, @@ -1518,7 +1518,7 @@ BOOL WINAPI GetUrlCacheEntryInfoExW( DWORD dwFlags) { TRACE("(%s, %p, %p, %p, %p, %p, %lx)\n", - debugstr_w(lpszUrl), + debugstr_w(lpszUrl), lpCacheEntryInfo, lpdwCacheEntryInfoBufSize, lpszReserved, @@ -1662,7 +1662,7 @@ BOOL WINAPI SetUrlCacheEntryInfoW(LPCWSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOW */ BOOL WINAPI RetrieveUrlCacheEntryFileA( IN LPCSTR lpszUrlName, - OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo, + OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo, IN OUT LPDWORD lpdwCacheEntryInfoBufferSize, IN DWORD dwReserved ) @@ -1748,7 +1748,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW( * */ BOOL WINAPI UnlockUrlCacheEntryFileA( - IN LPCSTR lpszUrlName, + IN LPCSTR lpszUrlName, IN DWORD dwReserved ) { @@ -1914,12 +1914,12 @@ BOOL WINAPI CreateUrlCacheEntryW( for (lpszUrlEnd = lpszUrlName; *lpszUrlEnd; lpszUrlEnd++) ; - + if (((lpszUrlEnd - lpszUrlName) > 1) && (*(lpszUrlEnd - 1) == '/' || *(lpszUrlEnd - 1) == '\\')) lpszUrlEnd--; - for (lpszUrlPart = lpszUrlEnd; - (lpszUrlPart >= lpszUrlName); + for (lpszUrlPart = lpszUrlEnd; + (lpszUrlPart >= lpszUrlName); lpszUrlPart--) { if ((*lpszUrlPart == '/' || *lpszUrlPart == '\\') && ((lpszUrlEnd - lpszUrlPart) > 1)) @@ -1968,7 +1968,7 @@ BOOL WINAPI CreateUrlCacheEntryW( URLCacheContainer_UnlockIndex(pContainer, pHeader); for (lpszFileNameNoPath = lpszFileName + lBufferSize / sizeof(WCHAR) - 2; - lpszFileNameNoPath >= lpszFileName; + lpszFileNameNoPath >= lpszFileName; --lpszFileNameNoPath) { if (*lpszFileNameNoPath == '/' || *lpszFileNameNoPath == '\\') @@ -2056,7 +2056,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal( if (lpszOriginalUrl) WARN(": lpszOriginalUrl ignored\n"); - + if (lpszLocalFileName) { HANDLE hFile; @@ -2428,7 +2428,7 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamA( NULL); if (hFile == INVALID_HANDLE_VALUE) return FALSE; - + /* allocate handle storage space */ pStream = HeapAlloc(GetProcessHeap(), 0, sizeof(STREAM_HANDLE) + strlen(lpszUrlName) * sizeof(CHAR)); if (!pStream) diff --git a/reactos/dll/win32/wininet/utility.c b/reactos/dll/win32/wininet/utility.c index b63e1a0d6c7..33b9a7376c1 100644 --- a/reactos/dll/win32/wininet/utility.c +++ b/reactos/dll/win32/wininet/utility.c @@ -247,11 +247,11 @@ VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext, lpvNewInfo = WININET_strdup_WtoA(lpvStatusInfo); } } - + TRACE(" callback(%p) (%p (%p), %08lx, %ld (%s), %p, %ld)\n", hdr->lpfnStatusCB, hHttpSession, hdr, dwContext, dwInternetStatus, get_callback_name(dwInternetStatus), lpvNewInfo, dwStatusInfoLength); - + hdr->lpfnStatusCB(hHttpSession, dwContext, dwInternetStatus, lpvNewInfo, dwStatusInfoLength); @@ -274,10 +274,10 @@ VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext, lpvStatusInfo, dwStatusInfoLength, hdr->dwFlags & INTERNET_FLAG_ASYNC ? "" : "non ", hdr->lpfnStatusCB); - + if (!(hdr->lpfnStatusCB)) return; - + if (hdr->dwFlags & INTERNET_FLAG_ASYNC) { WORKREQUEST workRequest; @@ -297,7 +297,7 @@ VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext, req->dwInternetStatus = dwInternetStatus; req->lpvStatusInfo = lpvStatusInfo_copy; req->dwStatusInfoLength = dwStatusInfoLength; - + INTERNET_AsyncCall(&workRequest); } else diff --git a/reactos/dll/win32/wininet/wininet_Bg.rc b/reactos/dll/win32/wininet/wininet_Bg.rc index 7f3e30d25e0..24e19d5ceca 100644 --- a/reactos/dll/win32/wininet/wininet_Bg.rc +++ b/reactos/dll/win32/wininet/wininet_Bg.rc @@ -22,7 +22,7 @@ IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Âúâåäåòå ìðåæîâà ïàðîëà" FONT 8, "MS Shell Dlg" -{ +{ LTEXT "Âúâåäåòå âàøåòî ïîòðåáèòåëñêî èìå è ïàðîëà:", -1, 40, 6, 150, 15 LTEXT "Ïðîêñè", -1, 40, 26, 50, 10 LTEXT "Îáëàñò", -1, 40, 46, 50, 10 diff --git a/reactos/dll/win32/winmm/driver.c b/reactos/dll/win32/winmm/driver.c index 71b0a1fb4a5..84ba1df4309 100644 --- a/reactos/dll/win32/winmm/driver.c +++ b/reactos/dll/win32/winmm/driver.c @@ -97,10 +97,10 @@ static LRESULT inline DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT msg, if (pFnSendMessage16) ret = pFnSendMessage16(lpDrv->d.d16.hDriver16, msg, lParam1, lParam2); } else { - TRACE("Before call32 proc=%p drvrID=%08lx hDrv=%p wMsg=%04x p1=%08lx p2=%08lx\n", + TRACE("Before call32 proc=%p drvrID=%08lx hDrv=%p wMsg=%04x p1=%08lx p2=%08lx\n", lpDrv->d.d32.lpDrvProc, lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2); ret = lpDrv->d.d32.lpDrvProc(lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2); - TRACE("After call32 proc=%p drvrID=%08lx hDrv=%p wMsg=%04x p1=%08lx p2=%08lx => %08lx\n", + TRACE("After call32 proc=%p drvrID=%08lx hDrv=%p wMsg=%04x p1=%08lx p2=%08lx => %08lx\n", lpDrv->d.d32.lpDrvProc, lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2, ret); } return ret; @@ -381,7 +381,7 @@ HDRVR WINAPI OpenDriver(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lPar WCHAR libName[128]; LPCWSTR lsn = lpSectionName; - TRACE("(%s, %s, 0x%08lx);\n", + TRACE("(%s, %s, 0x%08lx);\n", debugstr_w(lpDriverName), debugstr_w(lpSectionName), lParam); /* If no section name is specified, either the caller is intending on @@ -422,7 +422,7 @@ HDRVR WINAPI OpenDriver(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lPar if (DRIVER_AddToList(lpDrv, 0, lParam)) goto the_end; HeapFree(GetProcessHeap(), 0, lpDrv); } - TRACE("Failed to open driver %s from system.ini file, section %s\n", + TRACE("Failed to open driver %s from system.ini file, section %s\n", debugstr_w(lpDriverName), debugstr_w(lpSectionName)); return 0; @@ -579,7 +579,7 @@ BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, /* this is an undocumented DCB_ value used for mmThreads * loword of dwCallBack contains the handle of the lpMMThd block * which dwSignalCount has to be incremented - */ + */ if (pFnGetMMThread16) { WINE_MMTHREAD* lpMMThd = pFnGetMMThread16(LOWORD(dwCallBack)); diff --git a/reactos/dll/win32/winmm/lolvldrv.c b/reactos/dll/win32/winmm/lolvldrv.c index 822da55c823..0e7f7a67e03 100644 --- a/reactos/dll/win32/winmm/lolvldrv.c +++ b/reactos/dll/win32/winmm/lolvldrv.c @@ -77,7 +77,7 @@ static WINE_LLTYPE llTypes[MMDRV_MAX] = { * * */ -void MMDRV_InstallMap(unsigned int drv, +void MMDRV_InstallMap(unsigned int drv, MMDRV_MAPFUNC mp1632, MMDRV_UNMAPFUNC um1632, MMDRV_MAPFUNC mp3216, MMDRV_UNMAPFUNC um3216, LPDRVCALLBACK cb) @@ -251,7 +251,7 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, } } else { assert(part->u.fnMessage16 && pFnCallMMDrvFunc16); - + if (bFrom32) { map = llType->Map32ATo16(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2); switch (map) { @@ -266,8 +266,8 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, case WINMM_MAP_OKMEM: 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 = pFnCallMMDrvFunc16((DWORD)part->u.fnMessage16, - mld->uDeviceID, wMsg, mld->dwDriverInstance, + ret = pFnCallMMDrvFunc16((DWORD)part->u.fnMessage16, + mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); TRACE("=> %s\n", WINMM_ErrorToString(ret)); if (map == WINMM_MAP_OKMEM) @@ -281,8 +281,8 @@ DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, } else { 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 = pFnCallMMDrvFunc16((DWORD)part->u.fnMessage16, - mld->uDeviceID, wMsg, mld->dwDriverInstance, + ret = pFnCallMMDrvFunc16((DWORD)part->u.fnMessage16, + mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); TRACE("=> %s\n", WINMM_ErrorToString(ret)); } @@ -564,7 +564,7 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg) } TRACE("Got %u dev for (%s:%s)\n", count, lpDrv->drvname, llTypes[type].typestr); - + if (HIWORD(count)) return FALSE; diff --git a/reactos/dll/win32/winmm/mci.c b/reactos/dll/win32/winmm/mci.c index 9c9a7c86207..664601ba973 100644 --- a/reactos/dll/win32/winmm/mci.c +++ b/reactos/dll/win32/winmm/mci.c @@ -20,14 +20,14 @@ /* TODO: * - implement WINMM (32bit) multitasking and use it in all MCI drivers - * instead of the home grown one + * instead of the home grown one * - 16bit mmTaskXXX functions are currently broken because the 16 * loader does not support binary command lines => provide Wine's * own mmtask.tsk not using binary command line. * - correctly handle the MCI_ALL_DEVICE_ID in functions. * - finish mapping 16 <=> 32 of MCI structures and commands * - implement auto-open feature (ie, when a string command is issued - * for a not yet opened device, MCI automatically opens it) + * for a not yet opened device, MCI automatically opens it) * - use a default registry setting to replace the [mci] section in * configuration file (layout of info in registry should be compatible * with all Windows' version - which use different layouts of course) @@ -318,7 +318,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2) if (dwParam1 & MCI_OPEN_ALIAS) mci_openW->lpstrAlias = MCI_strdupAtoW(mci_openA->lpstrAlias); /* FIXME: this is only needed for specific types of MCI devices, and - * may cause a segfault if the two DWORD:s don't exist at the end of + * may cause a segfault if the two DWORD:s don't exist at the end of * mci_openA */ memcpy(mci_openW + 1, mci_openA + 1, 2 * sizeof(DWORD)); @@ -566,7 +566,7 @@ static DWORD MCI_GetDevTypeFromFileName(LPCWSTR fileName, LPCWSTR buf, UINT len) if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, keyW, 0, KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS) { DWORD dwLen = len; - LONG lRet = RegQueryValueExW( hKey, tmp + 1, 0, 0, (void*)buf, &dwLen ); + LONG lRet = RegQueryValueExW( hKey, tmp + 1, 0, 0, (void*)buf, &dwLen ); RegCloseKey( hKey ); if (lRet == ERROR_SUCCESS) return 0; } @@ -1174,7 +1174,7 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCWSTR lpCmd, /************************************************************************** * MCI_HandleReturnValues [internal] */ -static DWORD MCI_HandleReturnValues(DWORD dwRet, LPWINE_MCIDRIVER wmd, DWORD retType, +static DWORD MCI_HandleReturnValues(DWORD dwRet, LPWINE_MCIDRIVER wmd, DWORD retType, LPDWORD data, LPWSTR lpstrRet, UINT uRetLen) { static const WCHAR wszLd [] = {'%','l','d',0}; @@ -1262,7 +1262,7 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrRet, static const WCHAR wszNew[] = {'n','e','w',0}; static const WCHAR wszSAliasS[] = {' ','a','l','i','a','s',' ',0}; - TRACE("(%s, %p, %d, %p)\n", + TRACE("(%s, %p, %d, %p)\n", debugstr_w(lpstrCommand), lpstrRet, uRetLen, hwndCallback); /* format is */ @@ -1402,7 +1402,7 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrRet, default: ERR("oops\n"); } - TRACE("verb=%s on dev=%s; offset=%d\n", + TRACE("verb=%s on dev=%s; offset=%d\n", debugstr_w(verb), debugstr_w(dev), offset); if ((dwRet = MCI_ParseOptArgs(data, offset, lpCmd, args, &dwFlags))) @@ -1647,7 +1647,7 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSW lpParms) if (uDevType < MCI_DEVTYPE_FIRST || uDevType > MCI_DEVTYPE_LAST || - !LoadStringW(WINMM_IData.hWinMM32Instance, uDevType, + !LoadStringW(WINMM_IData.hWinMM32Instance, uDevType, strDevTyp, sizeof(strDevTyp) / sizeof(WCHAR))) { dwRet = MCIERR_BAD_INTEGER; goto errCleanUp; @@ -1667,7 +1667,7 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSW lpParms) */ if (dwParam & MCI_OPEN_ELEMENT) { ERR("Both MCI_OPEN_ELEMENT(%s) and %s are used\n", - debugstr_w(lpParms->lpstrElementName), + debugstr_w(lpParms->lpstrElementName), debugstr_w(strDevTyp)); dwRet = MCIERR_UNRECOGNIZED_KEYWORD; goto errCleanUp; @@ -1883,13 +1883,13 @@ static DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSW lpParm ret = MCIERR_UNRECOGNIZED_COMMAND; } else { s = NULL; - if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, wszHklmMci, 0, + if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, wszHklmMci, 0, KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS) { - if (RegQueryInfoKeyW( hKey, 0, 0, 0, &cnt, - 0, 0, 0, 0, 0, 0, 0) == ERROR_SUCCESS && + if (RegQueryInfoKeyW( hKey, 0, 0, 0, &cnt, + 0, 0, 0, 0, 0, 0, 0) == ERROR_SUCCESS && lpParms->dwNumber <= cnt) { DWORD bufLen = sizeof(buf); - if (RegEnumKeyExW(hKey, lpParms->dwNumber - 1, + if (RegEnumKeyExW(hKey, lpParms->dwNumber - 1, buf, &bufLen, 0, 0, 0, 0) == ERROR_SUCCESS) s = buf; } @@ -2271,7 +2271,7 @@ UINT WINAPI mciGetDeviceIDA(LPCSTR lpstrName) */ UINT WINAPI mciGetDeviceIDW(LPCWSTR lpwstrName) { - return MCI_GetDriverFromString(lpwstrName); + return MCI_GetDriverFromString(lpwstrName); } /****************************************************************** diff --git a/reactos/dll/win32/winmm/message16.c b/reactos/dll/win32/winmm/message16.c index aa986a534de..620d9e05c8c 100644 --- a/reactos/dll/win32/winmm/message16.c +++ b/reactos/dll/win32/winmm/message16.c @@ -1798,9 +1798,9 @@ theEnd: * MMDRV_LoadMMDrvFunc16 * */ -unsigned MMDRV_LoadMMDrvFunc16(LPCSTR drvName, LPWINE_DRIVER d, +unsigned MMDRV_LoadMMDrvFunc16(LPCSTR drvName, LPWINE_DRIVER d, LPWINE_MM_DRIVER lpDrv) -{ +{ WINEMM_msgFunc16 func; unsigned count = 0; char buffer[128]; @@ -3351,7 +3351,7 @@ static WINMM_MapType MCI_UnMapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlag LPMCI_INFO_PARMS16 mip16 = (LPMCI_INFO_PARMS16)MapSL(lParam); LPMCI_INFO_PARMSW mip32w = *(LPMCI_INFO_PARMSW*)((char*)mip16 - sizeof(LPMCI_INFO_PARMSW)); - MultiByteToWideChar(CP_ACP, 0, MapSL(mip16->lpstrReturn), mip16->dwRetSize, + MultiByteToWideChar(CP_ACP, 0, MapSL(mip16->lpstrReturn), mip16->dwRetSize, mip32w->lpstrReturn, mip32w->dwRetSize / sizeof(WCHAR)); UnMapLS( lParam ); UnMapLS( mip16->lpstrReturn ); @@ -3451,7 +3451,7 @@ static WINMM_MapType MCI_UnMapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlag UnMapLS( lParam ); if (msip16) { - MultiByteToWideChar(CP_ACP, 0, MapSL(msip16->lpstrReturn), msip16->dwRetSize, + MultiByteToWideChar(CP_ACP, 0, MapSL(msip16->lpstrReturn), msip16->dwRetSize, msip32w->lpstrReturn, msip32w->dwRetSize); UnMapLS( msip16->lpstrReturn ); HeapFree( GetProcessHeap(), 0, MapSL(msip16->lpstrReturn) ); diff --git a/reactos/dll/win32/winmm/midimap/midimap.c b/reactos/dll/win32/winmm/midimap/midimap.c index 6bfdef36107..80d900d4c8a 100644 --- a/reactos/dll/win32/winmm/midimap/midimap.c +++ b/reactos/dll/win32/winmm/midimap/midimap.c @@ -120,7 +120,7 @@ static BOOL MIDIMAP_FindPort(const WCHAR* name, unsigned* dev) { const WCHAR* ptr = name + 1; *dev = 0; - do + do { *dev = *dev * 10 + *ptr - '0'; } while (isdigit(*++ptr)); diff --git a/reactos/dll/win32/winmm/mmio.c b/reactos/dll/win32/winmm/mmio.c index 8cf05e99528..a15a68a1364 100644 --- a/reactos/dll/win32/winmm/mmio.c +++ b/reactos/dll/win32/winmm/mmio.c @@ -222,7 +222,7 @@ static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, } } -/* This array will be the entire list for most apps +/* This array will be the entire list for most apps * Note that temporary ioProcs will be stored with a 0 fourCC code */ @@ -296,9 +296,9 @@ LPMMIOPROC MMIO_InstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, * let the user delete anyway, that's okay */ ppListNode = &pIOProcListAnchor; - while ((*ppListNode) && - ((fccIOProc != 0) ? - (*ppListNode)->fourCC != fccIOProc : + while ((*ppListNode) && + ((fccIOProc != 0) ? + (*ppListNode)->fourCC != fccIOProc : (*ppListNode)->pIOProc != pIOProc)) ppListNode = &((*ppListNode)->pNext); @@ -504,9 +504,9 @@ static MMRESULT MMIO_Flush(WINE_MMIO* wm, UINT uFlags) /* not quite sure what to do here, but I'll guess */ if (wm->info.dwFlags & MMIO_DIRTY) { /* FIXME: error handling */ - send_message(wm->ioProc, &wm->info, MMIOM_SEEK, + send_message(wm->ioProc, &wm->info, MMIOM_SEEK, wm->info.lBufOffset, SEEK_SET, MMIO_PROC_32A); - send_message(wm->ioProc, &wm->info, MMIOM_WRITE, + send_message(wm->ioProc, &wm->info, MMIOM_WRITE, (LPARAM)wm->info.pchBuffer, wm->info.pchNext - wm->info.pchBuffer, MMIO_PROC_32A); } @@ -536,7 +536,7 @@ static LONG MMIO_GrabNextBuffer(LPWINE_MMIO wm, int for_read) wm->bBufferLoaded = TRUE; if (for_read) { - size = send_message(wm->ioProc, &wm->info, MMIOM_READ, + size = send_message(wm->ioProc, &wm->info, MMIOM_READ, (LPARAM)wm->info.pchBuffer, size, MMIO_PROC_32A); if (size > 0) wm->info.pchEndRead += size; @@ -592,7 +592,7 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, /************************************************************************** * MMIO_Open [internal] */ -HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, +HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, enum mmioProcType type) { LPWINE_MMIO wm; @@ -672,7 +672,7 @@ HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, wm->info.dwFlags = dwOpenFlags; /* call IO proc to actually open file */ - refmminfo->wErrorRet = send_message(wm->ioProc, &wm->info, MMIOM_OPEN, + refmminfo->wErrorRet = send_message(wm->ioProc, &wm->info, MMIOM_OPEN, (LPARAM)szFileName, 0, MMIO_PROC_32A); /* grab file size, when possible */ @@ -735,7 +735,7 @@ MMRESULT WINAPI mmioClose(HMMIO hmmio, UINT uFlags) if ((result = MMIO_Flush(wm, 0)) != MMSYSERR_NOERROR) return result; - result = send_message(wm->ioProc, &wm->info, MMIOM_CLOSE, + result = send_message(wm->ioProc, &wm->info, MMIOM_CLOSE, uFlags, 0, MMIO_PROC_32A); MMIO_SetBuffer(wm, NULL, 0, 0); @@ -766,7 +766,7 @@ LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch) /* unbuffered case first */ if (!wm->info.pchBuffer) - return send_message(wm->ioProc, &wm->info, MMIOM_READ, + return send_message(wm->ioProc, &wm->info, MMIOM_READ, (LPARAM)pch, cch, MMIO_PROC_32A); /* first try from current buffer */ @@ -847,7 +847,7 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch) } count = bytesW; } else { - count = send_message(wm->ioProc, &wm->info, MMIOM_WRITE, + count = send_message(wm->ioProc, &wm->info, MMIOM_WRITE, (LPARAM)pch, cch, MMIO_PROC_32A); wm->info.lBufOffset = wm->info.lDiskOffset; } @@ -871,7 +871,7 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin) /* not buffered, direct seek on file */ if (!wm->info.pchBuffer) - return send_message(wm->ioProc, &wm->info, MMIOM_SEEK, + return send_message(wm->ioProc, &wm->info, MMIOM_SEEK, lOffset, iOrigin, MMIO_PROC_32A); switch (iOrigin) { @@ -1023,9 +1023,9 @@ MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags) if (uFlags == MMIO_WRITE && (lpmmioinfo->dwFlags & MMIO_DIRTY)) { - send_message(wm->ioProc, &wm->info, MMIOM_SEEK, + send_message(wm->ioProc, &wm->info, MMIOM_SEEK, lpmmioinfo->lBufOffset, SEEK_SET, MMIO_PROC_32A); - send_message(wm->ioProc, &wm->info, MMIOM_WRITE, + send_message(wm->ioProc, &wm->info, MMIOM_WRITE, (LPARAM)lpmmioinfo->pchBuffer, lpmmioinfo->pchNext - lpmmioinfo->pchBuffer, MMIO_PROC_32A); lpmmioinfo->dwFlags &= ~MMIO_DIRTY; @@ -1034,7 +1034,7 @@ MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags) return MMIOERR_CANNOTWRITE; if (lpmmioinfo) { - wm->dwFileSize = max(wm->dwFileSize, lpmmioinfo->lBufOffset + + wm->dwFileSize = max(wm->dwFileSize, lpmmioinfo->lBufOffset + (lpmmioinfo->pchNext - lpmmioinfo->pchBuffer)); } MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ); @@ -1108,7 +1108,7 @@ LPMMIOPROC WINAPI mmioInstallIOProcW(FOURCC fccIOProc, * * */ -LRESULT MMIO_SendMessage(HMMIO hmmio, UINT uMessage, LPARAM lParam1, +LRESULT MMIO_SendMessage(HMMIO hmmio, UINT uMessage, LPARAM lParam1, LPARAM lParam2, enum mmioProcType type) { LPWINE_MMIO wm; diff --git a/reactos/dll/win32/winmm/mmsystem.c b/reactos/dll/win32/winmm/mmsystem.c index 30250a763db..0699ac24b2c 100644 --- a/reactos/dll/win32/winmm/mmsystem.c +++ b/reactos/dll/win32/winmm/mmsystem.c @@ -467,12 +467,12 @@ UINT16 WINAPI auxGetDevCaps16(UINT16 uDeviceID, LPAUXCAPS16 lpCaps, UINT16 uSize ret = auxGetDevCapsA(uDeviceID, &acA, sizeof(acA)); if (ret == MMSYSERR_NOERROR) { AUXCAPS16 ac16; - ac16.wMid = acA.wMid; - ac16.wPid = acA.wPid; - ac16.vDriverVersion = acA.vDriverVersion; - strcpy(ac16.szPname, acA.szPname); - ac16.wTechnology = acA.wTechnology; - ac16.dwSupport = acA.dwSupport; + ac16.wMid = acA.wMid; + ac16.wPid = acA.wPid; + ac16.vDriverVersion = acA.vDriverVersion; + strcpy(ac16.szPname, acA.szPname); + ac16.wTechnology = acA.wTechnology; + ac16.dwSupport = acA.dwSupport; memcpy(lpCaps, &ac16, min(uSize, sizeof(ac16))); } return ret; @@ -662,7 +662,7 @@ HTASK16 WINAPI mciGetCreatorTask16(UINT16 uDeviceID) LPWINE_MCIDRIVER wmd; HTASK16 ret = 0; - if ((wmd = MCI_GetDriver(uDeviceID))) + if ((wmd = MCI_GetDriver(uDeviceID))) ret = HTASK_16(wmd->CreatorThread); TRACE("(%u) => %04x\n", uDeviceID, ret); @@ -2405,7 +2405,7 @@ exit: HeapFree(GetProcessHeap(), 0, lpDrv); HeapFree(GetProcessHeap(), 0, fnA); HeapFree(GetProcessHeap(), 0, snA); - TRACE("Unable to load 16 bit module %s[%s]: %s\n", + TRACE("Unable to load 16 bit module %s[%s]: %s\n", debugstr_w(fn), debugstr_w(sn), cause); return NULL; } @@ -2415,7 +2415,7 @@ exit: * * */ -static LRESULT DRIVER_SendMessage16(HDRVR16 hDrv16, UINT msg, +static LRESULT DRIVER_SendMessage16(HDRVR16 hDrv16, UINT msg, LPARAM lParam1, LPARAM lParam2) { LRESULT ret = 0; @@ -2813,7 +2813,7 @@ HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16* lpmmioinfo16, mmioinfo.pchBuffer = MapSL((DWORD)lpmmioinfo16->pchBuffer); mmioinfo.adwInfo[0] = lpmmioinfo16->adwInfo[0]; /* if we don't have a file name, it's likely a passed open file descriptor */ - if (!szFileName) + if (!szFileName) mmioinfo.adwInfo[0] = (DWORD)DosFileHandleToWin32Handle(mmioinfo.adwInfo[0]); mmioinfo.adwInfo[1] = lpmmioinfo16->adwInfo[1]; mmioinfo.adwInfo[2] = lpmmioinfo16->adwInfo[2]; @@ -2917,7 +2917,7 @@ MMRESULT16 WINAPI mmioSetInfo16(HMMIO16 hmmio, const MMIOINFO16* lpmmioinfo, UIN /* check if seg and lin buffers are the same */ if (mmioinfo.cchBuffer != lpmmioinfo->cchBuffer || - mmioinfo.pchBuffer != MapSL((DWORD)lpmmioinfo->pchBuffer)) + mmioinfo.pchBuffer != MapSL((DWORD)lpmmioinfo->pchBuffer)) return MMSYSERR_INVALPARAM; /* check pointers coherence */ @@ -2942,7 +2942,7 @@ MMRESULT16 WINAPI mmioSetInfo16(HMMIO16 hmmio, const MMIOINFO16* lpmmioinfo, UIN MMRESULT16 WINAPI mmioSetBuffer16(HMMIO16 hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT16 uFlags) { - MMRESULT ret = mmioSetBuffer(HMMIO_32(hmmio), MapSL((DWORD)pchBuffer), + MMRESULT ret = mmioSetBuffer(HMMIO_32(hmmio), MapSL((DWORD)pchBuffer), cchBuffer, uFlags); if (ret == MMSYSERR_NOERROR) @@ -2981,7 +2981,7 @@ MMRESULT16 WINAPI mmioAdvance16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uF } else ret = mmioAdvance(HMMIO_32(hmmio), NULL, uFlags); - + if (ret != MMSYSERR_NOERROR) return ret; if (lpmmioinfo) @@ -3021,7 +3021,7 @@ LPMMIOPROC16 WINAPI mmioInstallIOProc16(FOURCC fccIOProc, LPMMIOPROC16 pIOProc, LRESULT WINAPI mmioSendMessage16(HMMIO16 hmmio, UINT16 uMessage, LPARAM lParam1, LPARAM lParam2) { - return MMIO_SendMessage(HMMIO_32(hmmio), uMessage, + return MMIO_SendMessage(HMMIO_32(hmmio), uMessage, lParam1, lParam2, MMIO_PROC_16); } @@ -3060,12 +3060,12 @@ MMRESULT16 WINAPI mmioRename16(LPCSTR szFileName, LPCSTR szNewFileName, MMRESULT ret; MMIOINFO mmioinfo; - if (lpmmioinfo != NULL && lpmmioinfo->pIOProc != NULL && + if (lpmmioinfo != NULL && lpmmioinfo->pIOProc != NULL && lpmmioinfo->fccIOProc == 0) { FIXME("Can't handle this case yet\n"); return MMSYSERR_ERROR; } - + /* this is a bit hacky, but it'll work if we get a fourCC code or nothing. * but a non installed ioproc without a fourcc won't do */ diff --git a/reactos/dll/win32/winmm/registry.c b/reactos/dll/win32/winmm/registry.c index 79f1fc427bd..4ffa6132b97 100644 --- a/reactos/dll/win32/winmm/registry.c +++ b/reactos/dll/win32/winmm/registry.c @@ -1,134 +1,134 @@ -/* - MME User-Mode Driver Support - (c) Andrew Greenwood, 2007. - - This is intended for use with WINE's winmm.dll to allow it to find - and load appropriate drivers from the correct (Windows) registry keys. - - By default, WINE's winmm.dll will look in: - HKEY_CURRENT_USER\Software\Wine\Drivers - - Here it determines the driver to load based on a value called "Audio". - - Windows NT stores a list of drivers in: - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32 - - TODO: Handle system.ini -*/ - -#include -#include "winemm.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(winmm); - -BOOL LoadRegistryMMEDrivers(char* key) -{ - INT driver_count = 0; - INT driver_index = 0; - HKEY drivers_key; - BOOL ret; - - DWORD value_name_length = 256; - char value_name[value_name_length]; - - DWORD value_data_length = 256; - char value_data[value_data_length]; - - DWORD value_type; - - if ( RegOpenKeyA(HKEY_LOCAL_MACHINE, key, &drivers_key) != ERROR_SUCCESS ) - { - TRACE("ERROR: Could not open: HKEY_LOCAL_MACHINE\\%s\n", key); - return 0; - } - - while ( RegEnumValue(drivers_key, - driver_index, - value_name, - &value_name_length, - NULL, - &value_type, - value_data, - &value_data_length) == ERROR_SUCCESS ) - { - BOOL valid_driver = FALSE; - BOOL is_mapper = FALSE; - - if ( value_type == REG_SZ ) - { - /* We look for mappers first so they don't match - something else later on! */ - - if ( ! stricmp("wavemapper", value_name) ) - { - TRACE("Found a Wave-mapper: %s\n", value_data); - valid_driver = TRUE; - is_mapper = TRUE; - driver_count ++; - } - else if ( ! stricmp("midimapper", value_name) ) - { - TRACE("Found a MIDI-mapper: %s\n", value_data); - valid_driver = TRUE; - is_mapper = TRUE; - driver_count ++; - } - else if ( ! strnicmp("wave", value_name, 4) ) - { - TRACE("Found a Wave driver: %s\n", value_data); - valid_driver = TRUE; - driver_count ++; - } - else if ( ! strnicmp("midi", value_name, 4) ) - { - TRACE("Found a MIDI driver: %s\n", value_data); - valid_driver = TRUE; - driver_count ++; - } - else if ( ! strnicmp("mixer", value_name, 5) ) - { - TRACE("Found a mixer driver: %s\n", value_data); - valid_driver = TRUE; - driver_count ++; - } - else if ( ! strnicmp("aux", value_name, 4) ) - { - TRACE("Found an aux driver: %s\n", value_data); - valid_driver = TRUE; - driver_count ++; - } - else - { - TRACE("Not supported: %s\n", value_data); - } - - /* If we have a valid driver now, we get it "installed" in - winmm itself so it can be used */ - - if ( valid_driver ) - { - if ( ! MMDRV_Install(value_name, value_data, is_mapper) ) - { - TRACE("FAILED when initializing %s\n", value_data); - } - } - } - else - { - TRACE("Invalid data format\n"); - } - - /* Reinitialize */ - value_name_length = 256; - value_data_length = 256; - memset(value_name, 0, value_name_length); - memset(value_data, 0, value_data_length); - - driver_index ++; - } - - TRACE("Found a total of %d drivers\n", driver_count); - - return driver_count; -} +/* + MME User-Mode Driver Support + (c) Andrew Greenwood, 2007. + + This is intended for use with WINE's winmm.dll to allow it to find + and load appropriate drivers from the correct (Windows) registry keys. + + By default, WINE's winmm.dll will look in: + HKEY_CURRENT_USER\Software\Wine\Drivers + + Here it determines the driver to load based on a value called "Audio". + + Windows NT stores a list of drivers in: + HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32 + + TODO: Handle system.ini +*/ + +#include +#include "winemm.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winmm); + +BOOL LoadRegistryMMEDrivers(char* key) +{ + INT driver_count = 0; + INT driver_index = 0; + HKEY drivers_key; + BOOL ret; + + DWORD value_name_length = 256; + char value_name[value_name_length]; + + DWORD value_data_length = 256; + char value_data[value_data_length]; + + DWORD value_type; + + if ( RegOpenKeyA(HKEY_LOCAL_MACHINE, key, &drivers_key) != ERROR_SUCCESS ) + { + TRACE("ERROR: Could not open: HKEY_LOCAL_MACHINE\\%s\n", key); + return 0; + } + + while ( RegEnumValue(drivers_key, + driver_index, + value_name, + &value_name_length, + NULL, + &value_type, + value_data, + &value_data_length) == ERROR_SUCCESS ) + { + BOOL valid_driver = FALSE; + BOOL is_mapper = FALSE; + + if ( value_type == REG_SZ ) + { + /* We look for mappers first so they don't match + something else later on! */ + + if ( ! stricmp("wavemapper", value_name) ) + { + TRACE("Found a Wave-mapper: %s\n", value_data); + valid_driver = TRUE; + is_mapper = TRUE; + driver_count ++; + } + else if ( ! stricmp("midimapper", value_name) ) + { + TRACE("Found a MIDI-mapper: %s\n", value_data); + valid_driver = TRUE; + is_mapper = TRUE; + driver_count ++; + } + else if ( ! strnicmp("wave", value_name, 4) ) + { + TRACE("Found a Wave driver: %s\n", value_data); + valid_driver = TRUE; + driver_count ++; + } + else if ( ! strnicmp("midi", value_name, 4) ) + { + TRACE("Found a MIDI driver: %s\n", value_data); + valid_driver = TRUE; + driver_count ++; + } + else if ( ! strnicmp("mixer", value_name, 5) ) + { + TRACE("Found a mixer driver: %s\n", value_data); + valid_driver = TRUE; + driver_count ++; + } + else if ( ! strnicmp("aux", value_name, 4) ) + { + TRACE("Found an aux driver: %s\n", value_data); + valid_driver = TRUE; + driver_count ++; + } + else + { + TRACE("Not supported: %s\n", value_data); + } + + /* If we have a valid driver now, we get it "installed" in + winmm itself so it can be used */ + + if ( valid_driver ) + { + if ( ! MMDRV_Install(value_name, value_data, is_mapper) ) + { + TRACE("FAILED when initializing %s\n", value_data); + } + } + } + else + { + TRACE("Invalid data format\n"); + } + + /* Reinitialize */ + value_name_length = 256; + value_data_length = 256; + memset(value_name, 0, value_name_length); + memset(value_data, 0, value_data_length); + + driver_index ++; + } + + TRACE("Found a total of %d drivers\n", driver_count); + + return driver_count; +} diff --git a/reactos/dll/win32/winmm/time.c b/reactos/dll/win32/winmm/time.c index a4609146c72..33c53763763 100644 --- a/reactos/dll/win32/winmm/time.c +++ b/reactos/dll/win32/winmm/time.c @@ -55,7 +55,7 @@ static BOOL TIME_TimeToDie = TRUE; * * Second, a brief survey of a variety of Win 2k and Win X * machines showed that a 'standard' (aka default) timer - * resolution was 1 ms (Win9x is documented as being 1). However, one + * resolution was 1 ms (Win9x is documented as being 1). However, one * machine had a standard timer resolution of 10 ms. * * Further, if we set our default resolution to 1, @@ -140,7 +140,7 @@ static LPWINE_TIMERENTRY lpTimers; * 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 hKillTimeEvent is used to mark the section where we + * the hKillTimeEvent is used to mark the section where we * handle the callbacks so we can do synchronous kills. * EPP 99/07/13, updated 04/01/10 */ @@ -155,11 +155,11 @@ static LPWINE_TIMERENTRY lpTimers; { if (timer->lpFunc) { if (idx == nSizeLpTimers) { - if (lpTimers) + if (lpTimers) lpTimers = (LPWINE_TIMERENTRY) HeapReAlloc(GetProcessHeap(), 0, lpTimers, ++nSizeLpTimers * sizeof(WINE_TIMERENTRY)); - else + else lpTimers = (LPWINE_TIMERENTRY) HeapAlloc(GetProcessHeap(), 0, ++nSizeLpTimers * sizeof(WINE_TIMERENTRY)); @@ -191,7 +191,7 @@ static LPWINE_TIMERENTRY lpTimers; else delta_time = timer->dwTriggerTime - cur_time; } - } + } else delta_time = timer->dwTriggerTime - cur_time; @@ -207,7 +207,7 @@ static LPWINE_TIMERENTRY lpTimers; if (TIME_hKillEvent) SetEvent(TIME_hKillEvent); /* Finally, adjust the recommended wait time downward - by the amount of time the processing routines + by the amount of time the processing routines actually took */ adjust_time = GetTickCount() - cur_time; if (adjust_time > ret_time) @@ -237,7 +237,7 @@ static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg) new event; it's not clear if that would be worth it or not. */ - while (! TIME_TimeToDie) + while (! TIME_TimeToDie) { sleep_time = TIME_MMSysTimeCallback(iData); @@ -246,7 +246,7 @@ static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg) rc = WaitForSingleObject(TIME_hWakeEvent, sleep_time); if (rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0) - { + { FIXME("Unexpected error %ld(%ld) in timer thread\n", rc, GetLastError()); break; } diff --git a/reactos/dll/win32/winmm/winemm.h b/reactos/dll/win32/winmm/winemm.h index 5a82503f53c..e74be2cdb8f 100644 --- a/reactos/dll/win32/winmm/winemm.h +++ b/reactos/dll/win32/winmm/winemm.h @@ -275,14 +275,14 @@ MMRESULT MIDI_StreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, DWORD cMidi, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen, BOOL bFrom32); UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, - LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, + LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags, BOOL bFrom32); HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, enum mmioProcType type); LPMMIOPROC MMIO_InstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags, enum mmioProcType type); -LRESULT MMIO_SendMessage(HMMIO hmmio, UINT uMessage, LPARAM lParam1, +LRESULT MMIO_SendMessage(HMMIO hmmio, UINT uMessage, LPARAM lParam1, LPARAM lParam2, enum mmioProcType type); LPWINE_MMIO MMIO_Get(HMMIO h); diff --git a/reactos/dll/win32/winmm/winmm.c b/reactos/dll/win32/winmm/winmm.c index 7cc2ff9ea0b..dc3ef3fa150 100644 --- a/reactos/dll/win32/winmm/winmm.c +++ b/reactos/dll/win32/winmm/winmm.c @@ -1748,7 +1748,7 @@ MMRESULT WINAPI midiStreamClose(HMIDISTRM hMidiStrm) * MMSYSTEM_MidiStream_Open [internal] */ MMRESULT MIDI_StreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, DWORD cMidi, - DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen, + DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen, BOOL bFrom32) { WINE_MIDIStream* lpMidiStrm; @@ -2000,8 +2000,8 @@ MMRESULT WINAPI midiStreamStop(HMIDISTRM hMidiStrm) return ret; } -UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, - LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, +UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, + LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags, BOOL bFrom32) { HANDLE handle; @@ -2053,14 +2053,14 @@ UINT WAVE_Open(HANDLE* lphndl, UINT uDeviceID, UINT uType, wod.uMappedDeviceID = -1; } wmld->uDeviceID = uDeviceID; - - dwRet = MMDRV_Open(wmld, (uType == MMDRV_WAVEOUT) ? WODM_OPEN : WIDM_OPEN, + + dwRet = MMDRV_Open(wmld, (uType == MMDRV_WAVEOUT) ? WODM_OPEN : WIDM_OPEN, (DWORD)&wod, dwFlags); TRACE("dwRet = %s\n", WINMM_ErrorToString(dwRet)); if (dwRet != WAVERR_BADFORMAT || ((dwFlags & (WAVE_MAPPED|WAVE_FORMAT_DIRECT)) != 0) || (uDeviceID == WAVE_MAPPER)) break; - /* if we ask for a format which isn't supported by the physical driver, + /* if we ask for a format which isn't supported by the physical driver, * let's try to map it through the wave mapper (except, if we already tried * or user didn't allow us to use acm codecs or the device is already the mapper) */ @@ -2257,7 +2257,7 @@ UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut, if (lpWaveOutHdr == NULL || uSize < sizeof (WAVEHDR)) return MMSYSERR_INVALPARAM; - + if (!(lpWaveOutHdr->dwFlags & WHDR_PREPARED)) { return MMSYSERR_NOERROR; } diff --git a/reactos/dll/win32/winmm/winmm.rbuild b/reactos/dll/win32/winmm/winmm.rbuild index 9775fce3caf..1e4bbf94bf1 100644 --- a/reactos/dll/win32/winmm/winmm.rbuild +++ b/reactos/dll/win32/winmm/winmm.rbuild @@ -6,7 +6,7 @@ - + . diff --git a/reactos/dll/win32/winmm/winmm_Cs.rc b/reactos/dll/win32/winmm/winmm_Cs.rc index 333f8704229..bab91ccf19f 100644 --- a/reactos/dll/win32/winmm/winmm_Cs.rc +++ b/reactos/dll/win32/winmm/winmm_Cs.rc @@ -1,7 +1,7 @@ /* * Czech resources for winmm * Copyright 1999 Eric Pouech - * Copyright 2004 David Kredba + * Copyright 2004 David Kredba * * 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/reactos/dll/win32/wintrust/crypt.c b/reactos/dll/win32/wintrust/crypt.c index 3dd127c5f7a..1e5a194fb4e 100644 --- a/reactos/dll/win32/wintrust/crypt.c +++ b/reactos/dll/win32/wintrust/crypt.c @@ -156,7 +156,7 @@ BOOL WINAPI CryptSIPCreateIndirectData(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pcb SIP_INDIRECT_DATA* pIndirectData) { FIXME("(%p %p %p) stub\n", pSubjectInfo, pcbIndirectData, pIndirectData); - + return FALSE; } @@ -168,7 +168,7 @@ BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pdwEn { FIXME("(%p %p %d %p %p) stub\n", pSubjectInfo, pdwEncodingType, dwIndex, pcbSignedDataMsg, pbSignedDataMsg); - + return FALSE; } @@ -180,7 +180,7 @@ BOOL WINAPI CryptSIPPutSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD pdwEnc { FIXME("(%p %d %p %d %p) stub\n", pSubjectInfo, pdwEncodingType, pdwIndex, cbSignedDataMsg, pbSignedDataMsg); - + return FALSE; } @@ -191,7 +191,7 @@ BOOL WINAPI CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD dwIndex) { FIXME("(%p %d) stub\n", pSubjectInfo, dwIndex); - + return FALSE; } @@ -202,6 +202,6 @@ BOOL WINAPI CryptSIPVerifyIndirectData(SIP_SUBJECTINFO* pSubjectInfo, SIP_INDIRECT_DATA* pIndirectData) { FIXME("(%p %p) stub\n", pSubjectInfo, pIndirectData); - + return FALSE; } diff --git a/reactos/dll/win32/wintrust/register.c b/reactos/dll/win32/wintrust/register.c index 6f0f57516b9..ce48745b35b 100644 --- a/reactos/dll/win32/wintrust/register.c +++ b/reactos/dll/win32/wintrust/register.c @@ -157,7 +157,7 @@ static void WINTRUST_FreeRegStructs(void) * */ static void WINTRUST_Guid2Wstr(const GUID* pgActionID, WCHAR* GuidString) -{ +{ static const WCHAR wszFormat[] = {'{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-', '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2','X','%','0','2', 'X','%','0','2','X','%','0','2','X','}', 0}; @@ -336,7 +336,7 @@ BOOL WINAPI WintrustRemoveActionID( GUID* pgActionID ) WCHAR GuidString[39]; TRACE("(%s)\n", debugstr_guid(pgActionID)); - + if (!pgActionID) { SetLastError(ERROR_INVALID_PARAMETER); @@ -704,7 +704,7 @@ static BOOL WINTRUST_RegisterGenChainVerify(void) * Failure: FALSE. * * NOTES - * WintrustAddDefaultForUsage will only return TRUE or FALSE, no last + * WintrustAddDefaultForUsage will only return TRUE or FALSE, no last * error is set, not even when the registry cannot be written to. */ BOOL WINAPI WintrustAddDefaultForUsage(const char *pszUsageOID, @@ -810,7 +810,7 @@ static BOOL WINTRUST_SIPPAddProvider(GUID* Subject, WCHAR* MagicNumber) Ret = CryptSIPAddProvider(&NewProv); HeapFree(GetProcessHeap(), 0, NewProv.pwszDLLFileName); - + return Ret; } @@ -976,7 +976,7 @@ add_trust_providers: return CryptRegisterRes; else if (SIPAddProviderRes == S_OK) return TrustProviderRes; - else + else return SIPAddProviderRes; } diff --git a/reactos/dll/win32/wintrust/wintrust_main.c b/reactos/dll/win32/wintrust/wintrust_main.c index a29d9a70eea..5104c9bed47 100644 --- a/reactos/dll/win32/wintrust/wintrust_main.c +++ b/reactos/dll/win32/wintrust/wintrust_main.c @@ -90,12 +90,12 @@ LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID, LPVOID ActionData ) /* Trust providers can be found at: * HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust\CertCheck\ * - * Process Explorer expects a correct implementation, so we + * Process Explorer expects a correct implementation, so we * return TRUST_E_PROVIDER_UNKNOWN. * * Girotel needs ERROR_SUCCESS. * - * For now return TRUST_E_PROVIDER_UNKNOWN only when + * For now return TRUST_E_PROVIDER_UNKNOWN only when * ActionID = WINTRUST_ACTION_GENERIC_VERIFY_V2. * */ diff --git a/reactos/dll/win32/wldap32/add.c b/reactos/dll/win32/wldap32/add.c index a32b2f23142..8db4f829175 100644 --- a/reactos/dll/win32/wldap32/add.c +++ b/reactos/dll/win32/wldap32/add.c @@ -110,7 +110,7 @@ ULONG CDECL ldap_addW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[] ) char *dnU = NULL; LDAPMod **attrsU = NULL; int msg; - + ret = WLDAP32_LDAP_NO_MEMORY; TRACE( "(%p, %s, %p)\n", ld, debugstr_w(dn), attrs ); diff --git a/reactos/dll/win32/wldap32/ber.c b/reactos/dll/win32/wldap32/ber.c index 159c12893ba..4e7888b9b3b 100644 --- a/reactos/dll/win32/wldap32/ber.c +++ b/reactos/dll/win32/wldap32/ber.c @@ -315,7 +315,7 @@ ULONG CDECL WLDAP32_ber_skip_tag( BerElement *berelement, ULONG *len ) * ... [I] Values to encode. * * RETURNS - * Success: Non-negative number. + * Success: Non-negative number. * Failure: LBER_ERROR * * NOTES @@ -410,7 +410,7 @@ INT CDECL WLDAP32_ber_printf( BerElement *berelement, PCHAR fmt, ... ) * ... [I] Pointers to values to be decoded. * * RETURNS - * Success: Non-negative number. + * Success: Non-negative number. * Failure: LBER_ERROR * * NOTES diff --git a/reactos/dll/win32/wldap32/bind.c b/reactos/dll/win32/wldap32/bind.c index 0196d16c653..ec3218f55ed 100644 --- a/reactos/dll/win32/wldap32/bind.c +++ b/reactos/dll/win32/wldap32/bind.c @@ -285,7 +285,7 @@ exit: * cred [I] Credentials. * serverctrls [I] Array of LDAP server controls. * clientctrls [I] Array of LDAP client controls. - * message [O] Message ID of the bind operation. + * message [O] Message ID of the bind operation. * * RETURNS * Success: LDAP_SUCCESS @@ -515,7 +515,7 @@ exit: * Failure: An LDAP error code. * * NOTES - * Set dn and passwd to NULL to bind as an anonymous user. + * Set dn and passwd to NULL to bind as an anonymous user. */ ULONG CDECL ldap_simple_bindW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR passwd ) { @@ -609,7 +609,7 @@ exit: * Failure: An LDAP error code. * * NOTES - * Set dn and passwd to NULL to bind as an anonymous user. + * Set dn and passwd to NULL to bind as an anonymous user. */ ULONG CDECL ldap_simple_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR passwd ) { diff --git a/reactos/dll/win32/wldap32/control.c b/reactos/dll/win32/wldap32/control.c index c7b84233670..8f06bfb8f55 100644 --- a/reactos/dll/win32/wldap32/control.c +++ b/reactos/dll/win32/wldap32/control.c @@ -338,7 +338,7 @@ ULONG CDECL ldap_free_controlsA( LDAPControlA **controls ) * * RETURNS * LDAP_SUCCESS - * + * * NOTES * Obsolete, use ldap_controls_freeW. */ diff --git a/reactos/dll/win32/wldap32/delete.c b/reactos/dll/win32/wldap32/delete.c index 2b65d468ecb..30dbb612e12 100644 --- a/reactos/dll/win32/wldap32/delete.c +++ b/reactos/dll/win32/wldap32/delete.c @@ -317,7 +317,7 @@ exit: #endif return ret; } - + /*********************************************************************** * ldap_delete_sA (WLDAP32.@) * diff --git a/reactos/dll/win32/wldap32/dn.c b/reactos/dll/win32/wldap32/dn.c index 0e6610d3fe5..9ffa92aa844 100644 --- a/reactos/dll/win32/wldap32/dn.c +++ b/reactos/dll/win32/wldap32/dn.c @@ -75,7 +75,7 @@ PCHAR CDECL ldap_dn2ufnA( PCHAR dn ) * dn [I] DN to convert. * * RETURNS - * Success: Pointer to a string containing the user-friendly name. + * Success: Pointer to a string containing the user-friendly name. * Failure: NULL * * NOTES @@ -139,7 +139,7 @@ PCHAR * CDECL ldap_explode_dnA( PCHAR dn, ULONG notypes ) * * RETURNS * Success: Pointer to a NULL-terminated array that contains the DN - * components. + * components. * Failure: NULL * * NOTES @@ -268,7 +268,7 @@ ULONG CDECL ldap_ufn2dnA( PCHAR ufn, PCHAR *dn ) * * PARAMS * ufn [I] User-friendly name to convert. - * dn [O] Receives a pointer to a string containing the DN. + * dn [O] Receives a pointer to a string containing the DN. * * RETURNS * Success: LDAP_SUCCESS diff --git a/reactos/dll/win32/wldap32/init.c b/reactos/dll/win32/wldap32/init.c index 08cab81a948..3d45c437cf2 100644 --- a/reactos/dll/win32/wldap32/init.c +++ b/reactos/dll/win32/wldap32/init.c @@ -79,7 +79,7 @@ static char **split_hostnames( const char *hostnames ) q = p; i = 0; - + while (*p) { if (p[1] != '\0') @@ -90,7 +90,7 @@ static char **split_hostnames( const char *hostnames ) res[i] = strdupU( q ); if (!res[i]) goto oom; i++; - + while (isspace( *p )) p++; q = p; } @@ -120,7 +120,7 @@ oom: /* Determine if a URL starts with a known LDAP scheme */ static int has_ldap_scheme( char *url ) { - if (!strncasecmp( url, "ldap://", 7 ) || + if (!strncasecmp( url, "ldap://", 7 ) || !strncasecmp( url, "ldaps://", 8 ) || !strncasecmp( url, "ldapi://", 8 ) || !strncasecmp( url, "cldap://", 8 )) return 1; @@ -134,11 +134,11 @@ static int has_ldap_scheme( char *url ) static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnumber ) { char *res, *p, *q, **v; - unsigned int i = 0, size = 0; + unsigned int i = 0, size = 0; static const char sep[] = " ", fmt[] = ":%d"; char port[7]; - sprintf( port, fmt, portnumber ); + sprintf( port, fmt, portnumber ); for (v = hostnames; *v; v++) { @@ -153,14 +153,14 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum size += strlen( *v ); - if (!strchr( q, ':' )) + if (!strchr( q, ':' )) size += strlen( port ); i++; } size += (i - 1) * strlen( sep ); - + res = HeapAlloc( GetProcessHeap(), 0, size + 1 ); if (!res) return NULL; @@ -258,7 +258,7 @@ exit: * The hostname string can be a space separated string of hostnames, * in which case the LDAP runtime will try to connect to the hosts * in order, until a connection can be made. A hostname may have a - * trailing portnumber (separated from the hostname by a ':'), which + * trailing portnumber (separated from the hostname by a ':'), which * will take precedence over the portnumber supplied as a parameter * to this function. */ @@ -297,7 +297,7 @@ exit: /*********************************************************************** * ldap_connect (WLDAP32.@) * - * Connect to an LDAP server. + * Connect to an LDAP server. * * PARAMS * ld [I] Pointer to an LDAP context. @@ -366,7 +366,7 @@ exit: * The hostname string can be a space separated string of hostnames, * in which case the LDAP runtime will try to connect to the hosts * in order, until a connection can be made. A hostname may have a - * trailing portnumber (separated from the hostname by a ':'), which + * trailing portnumber (separated from the hostname by a ':'), which * will take precedence over the portnumber supplied as a parameter * to this function. The connection will not be made until the first * LDAP function that needs it is called. @@ -449,7 +449,7 @@ exit: * The hostname string can be a space separated string of hostnames, * in which case the LDAP runtime will try to connect to the hosts * in order, until a connection can be made. A hostname may have a - * trailing portnumber (separated from the hostname by a ':'), which + * trailing portnumber (separated from the hostname by a ':'), which * will take precedence over the portnumber supplied as a parameter * to this function. */ @@ -531,7 +531,7 @@ WLDAP32_LDAP * CDECL ldap_sslinitA( PCHAR hostname, ULONG portnumber, int secure * The hostname string can be a space separated string of hostnames, * in which case the LDAP runtime will try to connect to the hosts * in order, until a connection can be made. A hostname may have a - * trailing portnumber (separated from the hostname by a ':'), which + * trailing portnumber (separated from the hostname by a ':'), which * will take precedence over the portnumber supplied as a parameter * to this function. The connection will not be made until the first * LDAP function that needs it is called. diff --git a/reactos/dll/win32/wldap32/misc.c b/reactos/dll/win32/wldap32/misc.c index 9d938c89c1c..b6259d7bc04 100644 --- a/reactos/dll/win32/wldap32/misc.c +++ b/reactos/dll/win32/wldap32/misc.c @@ -317,7 +317,7 @@ PCHAR CDECL ldap_first_attributeA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, /*********************************************************************** * ldap_first_attributeW (WLDAP32.@) * - * Get the first attribute for a given entry. + * Get the first attribute for a given entry. * * PARAMS * ld [I] Pointer to an LDAP context. @@ -364,7 +364,7 @@ PWCHAR CDECL ldap_first_attributeW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry * Failure: NULL * * NOTES - * The returned entry will be freed when the message is freed. + * The returned entry will be freed when the message is freed. */ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_first_entry( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *res ) { @@ -633,7 +633,7 @@ ULONG CDECL WLDAP32_ldap_result( WLDAP32_LDAP *ld, ULONG msgid, ULONG all, * src [I] Wide character string to convert. * srclen [I] Size of string to convert, in characters. * dst [O] Pointer to a buffer that receives the converted string. - * dstlen [I] Size of the destination buffer in characters. + * dstlen [I] Size of the destination buffer in characters. * * RETURNS * The number of characters written into the destination buffer. @@ -655,7 +655,7 @@ int CDECL LdapUnicodeToUTF8( LPCWSTR src, int srclen, LPSTR dst, int dstlen ) * src [I] UTF8 string to convert. * srclen [I] Size of string to convert, in characters. * dst [O] Pointer to a buffer that receives the converted string. - * dstlen [I] Size of the destination buffer in characters. + * dstlen [I] Size of the destination buffer in characters. * * RETURNS * The number of characters written into the destination buffer. diff --git a/reactos/dll/win32/wldap32/option.c b/reactos/dll/win32/wldap32/option.c index 6525bf5cfb1..858bc2a4ea3 100644 --- a/reactos/dll/win32/wldap32/option.c +++ b/reactos/dll/win32/wldap32/option.c @@ -416,7 +416,7 @@ ULONG CDECL ldap_set_optionA( WLDAP32_LDAP *ld, int option, void *value ) * * NOTES * Set value to LDAP_OPT_ON or LDAP_OPT_OFF for on/off options. - */ + */ ULONG CDECL ldap_set_optionW( WLDAP32_LDAP *ld, int option, void *value ) { ULONG ret = LDAP_NOT_SUPPORTED; diff --git a/reactos/dll/win32/wldap32/page.c b/reactos/dll/win32/wldap32/page.c index a3ed11288cc..8fddfbafe7a 100644 --- a/reactos/dll/win32/wldap32/page.c +++ b/reactos/dll/win32/wldap32/page.c @@ -220,7 +220,7 @@ ULONG CDECL ldap_parse_page_controlA( WLDAP32_LDAP *ld, PLDAPControlA *ctrls, ret = ldap_parse_page_controlW( ld, ctrlsW, count, cookie ); controlarrayfreeW( ctrlsW ); - + #endif return ret; } @@ -250,8 +250,8 @@ ULONG CDECL ldap_parse_page_controlW( WLDAP32_LDAP *ld, PLDAPControlW *ctrls, } if (!control) - return WLDAP32_LDAP_CONTROL_NOT_FOUND; - + return WLDAP32_LDAP_CONTROL_NOT_FOUND; + ber = ber_init( &((LDAPControl *)control)->ldctl_value ); if (!ber) return WLDAP32_LDAP_NO_MEMORY; @@ -263,7 +263,7 @@ ULONG CDECL ldap_parse_page_controlW( WLDAP32_LDAP *ld, PLDAPControlW *ctrls, ret = LDAP_SUCCESS; ber_free( ber, 1 ); - + #endif return ret; } diff --git a/reactos/dll/win32/wldap32/parse.c b/reactos/dll/win32/wldap32/parse.c index e47adf2e849..321fdd64b8e 100644 --- a/reactos/dll/win32/wldap32/parse.c +++ b/reactos/dll/win32/wldap32/parse.c @@ -72,7 +72,7 @@ ULONG CDECL ldap_parse_extended_resultA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage * /*********************************************************************** * ldap_parse_extended_resultW (WLDAP32.@) * - * Parse the result of an extended operation. + * Parse the result of an extended operation. * * PARAMS * ld [I] Pointer to an LDAP context. @@ -134,7 +134,7 @@ ULONG CDECL ldap_parse_referenceA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *messag *referrals = strarrayWtoA( referralsW ); ldap_value_freeW( referralsW ); -#endif +#endif return ret; } @@ -165,7 +165,7 @@ ULONG CDECL ldap_parse_referenceW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *messag TRACE( "(%p, %p, %p)\n", ld, message, referrals ); if (!ld) return ~0UL; - + ret = ldap_parse_reference( ld, message, &referralsU, NULL, 0 ); *referrals = strarrayUtoW( referralsU ); @@ -215,7 +215,7 @@ ULONG CDECL ldap_parse_resultA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result, /*********************************************************************** * ldap_parse_resultW (WLDAP32.@) * - * Parse a result message. + * Parse a result message. * * PARAMS * ld [I] Pointer to an LDAP context. @@ -386,7 +386,7 @@ INT CDECL ldap_parse_vlv_controlA( WLDAP32_LDAP *ld, PLDAPControlA *control, * PARAMS * ld [I] Pointer to an LDAP context. * control [I] Controls obtained from a result message. - * targetpos [O] Positition of the target in the result list. + * targetpos [O] Positition of the target in the result list. * listcount [O] Estimate of the number of results in the list. * context [O] Server side context. * errcode [O] Error code from the listview operation. diff --git a/reactos/dll/win32/wldap32/rename.c b/reactos/dll/win32/wldap32/rename.c index 47842b5d68b..c631a4c0a59 100644 --- a/reactos/dll/win32/wldap32/rename.c +++ b/reactos/dll/win32/wldap32/rename.c @@ -246,7 +246,7 @@ exit: * RETURNS * Success: LDAP_SUCCESS * Failure: An LDAP error code. - */ + */ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, PWCHAR newparent, INT delete, PLDAPControlW *serverctrls, PLDAPControlW *clientctrls ) diff --git a/reactos/dll/win32/wldap32/value.c b/reactos/dll/win32/wldap32/value.c index 61bcfc3c877..942d5a2940f 100644 --- a/reactos/dll/win32/wldap32/value.c +++ b/reactos/dll/win32/wldap32/value.c @@ -193,9 +193,9 @@ static char **bv2str_array( struct berval **bv ) while (i > 0) HeapFree( GetProcessHeap(), 0, str[--i] ); HeapFree( GetProcessHeap(), 0, str ); return NULL; - } + } i++; - p++; + p++; } str[i] = NULL; return str; diff --git a/reactos/dll/win32/wldap32/wldap32.h b/reactos/dll/win32/wldap32/wldap32.h index b21f24e3d9f..1081eca71b4 100644 --- a/reactos/dll/win32/wldap32/wldap32.h +++ b/reactos/dll/win32/wldap32/wldap32.h @@ -443,8 +443,8 @@ static inline LDAPControlW *controlAtoW( LDAPControlA *control ) } controlW->ldctl_oid = strAtoW( control->ldctl_oid ); - controlW->ldctl_value.bv_len = len; - controlW->ldctl_value.bv_val = val; + controlW->ldctl_value.bv_len = len; + controlW->ldctl_value.bv_val = val; controlW->ldctl_iscritical = control->ldctl_iscritical; return controlW; @@ -471,7 +471,7 @@ static inline LDAPControlA *controlWtoA( LDAPControlW *control ) } controlA->ldctl_oid = strWtoA( control->ldctl_oid ); - controlA->ldctl_value.bv_len = len; + controlA->ldctl_value.bv_len = len; controlA->ldctl_value.bv_val = val; controlA->ldctl_iscritical = control->ldctl_iscritical; @@ -499,8 +499,8 @@ static inline LDAPControl *controlWtoU( LDAPControlW *control ) } controlU->ldctl_oid = strWtoU( control->ldctl_oid ); - controlU->ldctl_value.bv_len = len; - controlU->ldctl_value.bv_val = val; + controlU->ldctl_value.bv_len = len; + controlU->ldctl_value.bv_val = val; controlU->ldctl_iscritical = control->ldctl_iscritical; return controlU; @@ -527,10 +527,10 @@ static inline LDAPControlW *controlUtoW( LDAPControl *control ) } controlW->ldctl_oid = strUtoW( control->ldctl_oid ); - controlW->ldctl_value.bv_len = len; - controlW->ldctl_value.bv_val = val; + controlW->ldctl_value.bv_len = len; + controlW->ldctl_value.bv_val = val; controlW->ldctl_iscritical = control->ldctl_iscritical; - + return controlW; } diff --git a/reactos/dll/win32/wldap32/wldap32_Ko.rc b/reactos/dll/win32/wldap32/wldap32_Ko.rc index 578271571a5..5f0f052c641 100644 --- a/reactos/dll/win32/wldap32/wldap32_Ko.rc +++ b/reactos/dll/win32/wldap32/wldap32_Ko.rc @@ -2,7 +2,7 @@ * Korean resources for WLDAP32 * * Copyright 2005 YunSong Hwang - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either diff --git a/reactos/dll/win32/ws2_32/misc/async.c b/reactos/dll/win32/ws2_32/misc/async.c index 558960caea0..2147907393b 100644 --- a/reactos/dll/win32/ws2_32/misc/async.c +++ b/reactos/dll/win32/ws2_32/misc/async.c @@ -1,706 +1,706 @@ -/* Async WINSOCK DNS services - * - * Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka. - * Copyright (C) 1999 Marcus Meissner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * 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.) - * - Verify & Check all calls for correctness - * (currently only WSAGetHostByName*, WSAGetServByPort* calls) - * - Check error returns. - * - mirc/mirc32 Finger @linux.kernel.org sometimes fails in threaded mode. - * (not sure why) - * - This implementation did ignore the "NOTE:" section above (since the - * whole stuff did not work anyway to other changes). - */ - -#include -#include - -#define WS_FD_SETSIZE FD_SETSIZE -#define HAVE_GETPROTOBYNAME -#define HAVE_GETPROTOBYNUMBER -#define HAVE_GETSERVBYPORT -typedef struct hostent WS_hostent; -typedef struct servent WS_servent; -typedef struct protoent WS_protoent; - -#include "wine/config.h" -#include "wine/port.h" - -#ifndef __REACTOS__ -#include -#include -#include -#ifdef HAVE_SYS_IPC_H -# include -#endif -#ifdef HAVE_SYS_IOCTL_H -# include -#endif -#ifdef HAVE_SYS_FILIO_H -# include -#endif -#if defined(__svr4__) -#include -#ifdef HAVE_SYS_SOCKIO_H -# include -#endif -#endif - -#if defined(__EMX__) -# include -#endif - -#ifdef HAVE_SYS_PARAM_H -# include -#endif - -#ifdef HAVE_SYS_MSG_H -# include -#endif -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif -#include -#include -#include -#ifdef HAVE_SYS_ERRNO_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#include -#ifdef HAVE_ARPA_NAMESER_H -# include -#endif -#ifdef HAVE_RESOLV_H -# include -#endif -#endif - -#define CALLBACK __stdcall - -#include "wine/winbase16.h" -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "winsock2.h" -#include "ws2spi.h" -#include "wownt32.h" -#include "wine/winsock16.h" -#include "winnt.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(winsock); - - -/* protoptypes of some functions in socket.c - */ - -#define AQ_WIN16 0x00 -#define AQ_WIN32 0x04 -#define HB_WIN32(hb) (hb->flags & AQ_WIN32) -#define AQ_NUMBER 0x00 -#define AQ_NAME 0x08 -#define AQ_COPYPTR1 0x10 -#define AQ_DUPLOWPTR1 0x20 -#define AQ_MASKPTR1 0x30 -#define AQ_COPYPTR2 0x40 -#define AQ_DUPLOWPTR2 0x80 -#define AQ_MASKPTR2 0xC0 - -#define AQ_GETHOST 0 -#define AQ_GETPROTO 1 -#define AQ_GETSERV 2 -#define AQ_GETMASK 3 - -/* The handles used are pseudo-handles that can be simply casted. */ -/* 16-bit values are used internally (to be sure handle comparison works right in 16-bit apps). */ -#define WSA_H32(h16) ((HANDLE)(ULONG_PTR)(h16)) - -/* ----------------------------------- helper functions - */ - -static int list_size(char** l, int item_size) -{ - int i,j = 0; - if(l) - { 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; - char** l_to = (char**)ref; - int i,j,k; - - for(j=0;l_src[j];j++) ; - p += (j + 1) * sizeof(char*); - for(i=0;ih_name) + 1; - size += list_size(p_he->h_aliases, 0); - size += list_size(p_he->h_addr_list, p_he->h_length ); } - return size; -} - -/* Copy hostent to p_to, fix up inside pointers using p_base (different for - * Win16 (linear vs. segmented). Return -neededsize on overrun. - */ -static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, int flag) -{ - char* p_name,*p_aliases,*p_addr,*p; - struct ws_hostent16 *p_to16 = (struct ws_hostent16*)p_to; - WS_hostent *p_to32 = (WS_hostent*)p_to; - int size = hostent_size(p_he) + - ( - (flag & AQ_WIN16) ? sizeof(struct ws_hostent16) : sizeof(WS_hostent) - - sizeof(struct hostent) - ); - - if (t_size < size) - return -size; - p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_hostent16) : sizeof(WS_hostent); - p_name = p; - strcpy(p, p_he->h_name); p += strlen(p) + 1; - p_aliases = p; - p += list_dup(p_he->h_aliases, p, p_base + (p - (char*)p_to), 0); - p_addr = p; - list_dup(p_he->h_addr_list, p, p_base + (p - (char*)p_to), p_he->h_length); - - if (flag & AQ_WIN16) - { - p_to16->h_addrtype = (INT16)p_he->h_addrtype; - p_to16->h_length = (INT16)p_he->h_length; - p_to16->h_name = (SEGPTR)(p_base + (p_name - p_to)); - p_to16->h_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); - p_to16->h_addr_list = (SEGPTR)(p_base + (p_addr - p_to)); - } - else - { - 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)); - p_to32->h_addr_list = (char **)(p_base + (p_addr - p_to)); - } - - return size; -} - -/* ----- protoent */ - -static int protoent_size(struct protoent* p_pe) -{ - int size = 0; - if( p_pe ) - { size = sizeof(struct protoent); - size += strlen(p_pe->p_name) + 1; - size += list_size(p_pe->p_aliases, 0); } - return size; -} - -/* Copy protoent to p_to, fix up inside pointers using p_base (different for - * Win16 (linear vs. segmented). Return -neededsize on overrun. - */ -static int WS_copy_pe(char *p_to,char *p_base,int t_size,struct protoent* p_pe, int flag) -{ - char* p_name,*p_aliases,*p; - struct ws_protoent16 *p_to16 = (struct ws_protoent16*)p_to; - WS_protoent *p_to32 = (WS_protoent*)p_to; - int size = protoent_size(p_pe) + - ( - (flag & AQ_WIN16) ? sizeof(struct ws_protoent16) : sizeof(WS_protoent) - - sizeof(struct protoent) - ); - - if (t_size < size) - return -size; - p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_protoent16) : sizeof(WS_protoent); - p_name = p; - strcpy(p, p_pe->p_name); p += strlen(p) + 1; - p_aliases = p; - list_dup(p_pe->p_aliases, p, p_base + (p - (char*)p_to), 0); - - if (flag & AQ_WIN16) - { - p_to16->p_proto = (INT16)p_pe->p_proto; - p_to16->p_name = (SEGPTR)(p_base) + (p_name - p_to); - p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to)); - } - else - { - 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)); - } - - return size; -} - -/* ----- servent */ - -static int servent_size(struct servent* p_se) -{ - int size = 0; - if( p_se ) { - size += sizeof(struct servent); - size += strlen(p_se->s_proto) + strlen(p_se->s_name) + 2; - size += list_size(p_se->s_aliases, 0); - } - return size; -} - -/* Copy servent to p_to, fix up inside pointers using p_base (different for - * Win16 (linear vs. segmented). Return -neededsize on overrun. - * Take care of different Win16/Win32 servent structs (packing !) - */ -static int WS_copy_se(char *p_to,char *p_base,int t_size,struct servent* p_se, int flag) -{ - char* p_name,*p_aliases,*p_proto,*p; - struct ws_servent16 *p_to16 = (struct ws_servent16*)p_to; - WS_servent *p_to32 = (WS_servent*)p_to; - int size = servent_size(p_se) + - ( - (flag & AQ_WIN16) ? sizeof(struct ws_servent16) : sizeof(WS_servent) - - sizeof(struct servent) - ); - - if (t_size < size) - return -size; - p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_servent16) : sizeof(WS_servent); - p_name = p; - strcpy(p, p_se->s_name); p += strlen(p) + 1; - p_proto = p; - strcpy(p, p_se->s_proto); p += strlen(p) + 1; - p_aliases = p; - list_dup(p_se->s_aliases, p, p_base + (p - p_to), 0); - - if (flag & AQ_WIN16) - { - p_to16->s_port = (INT16)p_se->s_port; - p_to16->s_name = (SEGPTR)(p_base + (p_name - p_to)); - p_to16->s_proto = (SEGPTR)(p_base + (p_proto - p_to)); - p_to16->s_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); - } - else - { - 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)); - } - - return size; -} - -static HANDLE16 __ws_async_handle = 0xdead; - -/* Generic async query struct. we use symbolic names for the different queries - * for readability. - */ -typedef struct _async_query { - HWND16 hWnd; - UINT16 uMsg; - LPCSTR ptr1; -#define host_name ptr1 -#define host_addr ptr1 -#define serv_name ptr1 -#define proto_name ptr1 - LPCSTR ptr2; -#define serv_proto ptr2 - int int1; -#define host_len int1 -#define proto_number int1 -#define serv_port int1 - int int2; -#define host_type int2 - SEGPTR sbuf; - INT16 sbuflen; - - HANDLE16 async_handle; - int flags; - int qt; - char xbuf[1]; -} async_query; - - -/**************************************************************************** - * The async query function. - * - * 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. - */ -static DWORD WINAPI _async_queryfun(LPVOID arg) { - async_query *aq = (async_query*)arg; - int size = 0; - WORD fail = 0; - char *targetptr = (HB_WIN32(aq)?(char*)aq->sbuf:0/*(char*)MapSL(aq->sbuf)*/); - - switch (aq->flags & AQ_GETMASK) { - case AQ_GETHOST: { - struct hostent *he; - char *copy_hostent = targetptr; - char buf[100]; - if( !(aq->host_name)) { - aq->host_name = buf; - if( gethostname( buf, 100) == -1) { - fail = WSAENOBUFS; /* appropriate ? */ - break; - } - } - he = (aq->flags & AQ_NAME) ? - gethostbyname(aq->host_name): - gethostbyaddr(aq->host_addr,aq->host_len,aq->host_type); - if (!he) fail = WSAGetLastError(); - if (he) { - size = WS_copy_he(copy_hostent,(char*)aq->sbuf,aq->sbuflen,he,aq->flags); - if (size < 0) { - fail = WSAENOBUFS; - size = -size; - } - } - } - break; - case AQ_GETPROTO: { -#if defined(HAVE_GETPROTOBYNAME) && defined(HAVE_GETPROTOBYNUMBER) - struct protoent *pe; - char *copy_protoent = targetptr; - pe = (aq->flags & AQ_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); - if (size < 0) { - fail = WSAENOBUFS; - size = -size; - } - } else { - if (aq->flags & AQ_NAME) - MESSAGE("protocol %s not found; You might want to add " - "this to /etc/protocols\n", debugstr_a(aq->proto_name) ); - else - MESSAGE("protocol number %d not found; You might want to add " - "this to /etc/protocols\n", aq->proto_number ); - fail = WSANO_DATA; - } -#else - fail = WSANO_DATA; -#endif - } - break; - case AQ_GETSERV: { - struct servent *se; - char *copy_servent = targetptr; - se = (aq->flags & AQ_NAME)? - getservbyname(aq->serv_name,aq->serv_proto) : -#ifdef HAVE_GETSERVBYPORT - getservbyport(aq->serv_port,aq->serv_proto); -#else - NULL; -#endif - if (se) { - size = WS_copy_se(copy_servent,(char*)aq->sbuf,aq->sbuflen,se,aq->flags); - if (size < 0) { - fail = WSAENOBUFS; - size = -size; - } - } else { - 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 ):"*"); - 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 ):"*"); - fail = WSANO_DATA; - } - } - break; - } - PostMessageA(HWND_32(aq->hWnd),aq->uMsg,(WPARAM) aq->async_handle,size|(fail<<16)); - HeapFree(GetProcessHeap(),0,arg); - return 0; -} - -/**************************************************************************** - * 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. - */ -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; - case AQ_COPYPTR1: memcpy(pto, ptr1, int1); ptr1 = pto; pto += int1; break; - case AQ_DUPLOWPTR1: pfm = ptr1; ptr1 = pto; do *pto++ = tolower(*pfm); while (*pfm++); break; - } - if (ptr2) switch (flags & AQ_MASKPTR2) { - case 0: break; - case AQ_COPYPTR2: memcpy(pto, ptr2, int2); ptr2 = pto; pto += int2; break; - case AQ_DUPLOWPTR2: pfm = ptr2; ptr2 = pto; do *pto++ = tolower(*pfm); while (*pfm++); break; - } - - aq->hWnd = HWND_16(hWnd); - aq->uMsg = uMsg; - aq->int1 = int1; - aq->ptr1 = ptr1; - aq->int2 = int2; - aq->ptr2 = ptr2; - /* avoid async_handle = 0 */ - aq->async_handle = (++__ws_async_handle ? __ws_async_handle : ++__ws_async_handle); - aq->flags = flags; - aq->sbuf = (SEGPTR)sbuf; - aq->sbuflen = sbuflen; - -#if 1 - if (CreateThread(NULL,0,_async_queryfun,aq,0,NULL) == INVALID_HANDLE_VALUE) -#endif - _async_queryfun(aq); - return __ws_async_handle; -} - - -/*********************************************************************** - * WSAAsyncGetHostByAddr (WINSOCK.102) - */ -HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 uMsg, LPCSTR addr, - INT16 len, INT16 type, SEGPTR sbuf, INT16 buflen) -{ - TRACE("hwnd %04x, msg %04x, addr %08x[%i]\n", - hWnd, uMsg, (unsigned)addr , len ); - return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,len,addr,type,NULL, - (void*)sbuf,buflen, - AQ_NUMBER|AQ_COPYPTR1|AQ_WIN16|AQ_GETHOST); -} - -/*********************************************************************** - * WSAAsyncGetHostByAddr (WS2_32.102) - */ -HANDLE WINAPI WSAAsyncGetHostByAddr(HWND hWnd, UINT uMsg, LPCSTR addr, - INT len, INT type, LPSTR sbuf, INT buflen) -{ - TRACE("hwnd %p, msg %04x, addr %08x[%i]\n", - hWnd, uMsg, (unsigned)addr , len ); - return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,len,addr,type,NULL,sbuf,buflen, - AQ_NUMBER|AQ_COPYPTR1|AQ_WIN32|AQ_GETHOST)); -} - -/*********************************************************************** - * WSAAsyncGetHostByName (WINSOCK.103) - */ -HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, - SEGPTR sbuf, INT16 buflen) -{ - TRACE("hwnd %04x, msg %04x, host %s, buffer %i\n", - hWnd, uMsg, (name)?name:"", (int)buflen ); - return __WSAsyncDBQuery(HWND_32(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, - LPSTR sbuf, INT buflen) -{ - TRACE("hwnd %p, msg %08x, host %s, buffer %i\n", - hWnd, uMsg, (name)?name:"", (int)buflen ); - return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen, - AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETHOST)); -} - -/*********************************************************************** - * WSAAsyncGetProtoByName (WINSOCK.105) - */ -HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, - SEGPTR sbuf, INT16 buflen) -{ - TRACE("hwnd %04x, msg %08x, protocol %s\n", - hWnd, uMsg, (name)?name:"" ); - return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,NULL, - (void*)sbuf,buflen, - AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN16|AQ_GETPROTO); -} - -/*********************************************************************** - * WSAAsyncGetProtoByName (WS2_32.105) - */ -HANDLE WINAPI WSAAsyncGetProtoByName(HWND hWnd, UINT uMsg, LPCSTR name, - LPSTR sbuf, INT buflen) -{ - TRACE("hwnd %p, msg %08x, protocol %s\n", - hWnd, uMsg, (name)?name:"" ); - return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen, - AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETPROTO)); -} - - -/*********************************************************************** - * WSAAsyncGetProtoByNumber (WINSOCK.104) - */ -HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd,UINT16 uMsg,INT16 number, - SEGPTR sbuf, INT16 buflen) -{ - TRACE("hwnd %04x, msg %04x, num %i\n", hWnd, uMsg, number ); - return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,number,NULL,0,NULL, - (void*)sbuf,buflen, - AQ_GETPROTO|AQ_NUMBER|AQ_WIN16); -} - -/*********************************************************************** - * WSAAsyncGetProtoByNumber (WS2_32.104) - */ -HANDLE WINAPI WSAAsyncGetProtoByNumber(HWND hWnd, UINT uMsg, INT number, - LPSTR sbuf, INT buflen) -{ - TRACE("hwnd %p, msg %04x, num %i\n", hWnd, uMsg, number ); - return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,number,NULL,0,NULL,sbuf,buflen, - AQ_GETPROTO|AQ_NUMBER|AQ_WIN32)); -} - -/*********************************************************************** - * WSAAsyncGetServByName (WINSOCK.107) - */ -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", - hWnd, uMsg, (name)?name:"", (proto)?proto:""); - return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,proto, - (void*)sbuf,buflen, - AQ_GETSERV|AQ_NAME|AQ_DUPLOWPTR1|AQ_DUPLOWPTR2|AQ_WIN16); -} - -/*********************************************************************** - * WSAAsyncGetServByName (WS2_32.107) - */ -HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name, - LPCSTR proto, LPSTR sbuf, INT buflen) -{ - TRACE("hwnd %p, msg %04x, name %s, proto %s\n", - hWnd, uMsg, (name)?name:"", (proto)?proto:""); - return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,proto,sbuf,buflen, - AQ_GETSERV|AQ_NAME|AQ_DUPLOWPTR1|AQ_DUPLOWPTR2|AQ_WIN32)); -} - -/*********************************************************************** - * WSAAsyncGetServByPort (WINSOCK.106) - */ -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", - hWnd, uMsg, port, (proto)?proto:"" ); - return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,port,NULL,0,proto, - (void*)sbuf,buflen, - AQ_GETSERV|AQ_NUMBER|AQ_DUPLOWPTR2|AQ_WIN16); -} - -/*********************************************************************** - * WSAAsyncGetServByPort (WS2_32.106) - */ -HANDLE WINAPI WSAAsyncGetServByPort(HWND hWnd, UINT uMsg, INT port, - LPCSTR proto, LPSTR sbuf, INT buflen) -{ - TRACE("hwnd %p, msg %04x, port %i, proto %s\n", - hWnd, uMsg, port, (proto)?proto:"" ); - return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,port,NULL,0,proto,sbuf,buflen, - AQ_GETSERV|AQ_NUMBER|AQ_DUPLOWPTR2|AQ_WIN32)); -} +/* Async WINSOCK DNS services + * + * Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka. + * Copyright (C) 1999 Marcus Meissner + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * 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.) + * - Verify & Check all calls for correctness + * (currently only WSAGetHostByName*, WSAGetServByPort* calls) + * - Check error returns. + * - mirc/mirc32 Finger @linux.kernel.org sometimes fails in threaded mode. + * (not sure why) + * - This implementation did ignore the "NOTE:" section above (since the + * whole stuff did not work anyway to other changes). + */ + +#include +#include + +#define WS_FD_SETSIZE FD_SETSIZE +#define HAVE_GETPROTOBYNAME +#define HAVE_GETPROTOBYNUMBER +#define HAVE_GETSERVBYPORT +typedef struct hostent WS_hostent; +typedef struct servent WS_servent; +typedef struct protoent WS_protoent; + +#include "wine/config.h" +#include "wine/port.h" + +#ifndef __REACTOS__ +#include +#include +#include +#ifdef HAVE_SYS_IPC_H +# include +#endif +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#ifdef HAVE_SYS_FILIO_H +# include +#endif +#if defined(__svr4__) +#include +#ifdef HAVE_SYS_SOCKIO_H +# include +#endif +#endif + +#if defined(__EMX__) +# include +#endif + +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#ifdef HAVE_SYS_MSG_H +# include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#include +#include +#include +#ifdef HAVE_SYS_ERRNO_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#include +#ifdef HAVE_ARPA_NAMESER_H +# include +#endif +#ifdef HAVE_RESOLV_H +# include +#endif +#endif + +#define CALLBACK __stdcall + +#include "wine/winbase16.h" +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winsock2.h" +#include "ws2spi.h" +#include "wownt32.h" +#include "wine/winsock16.h" +#include "winnt.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winsock); + + +/* protoptypes of some functions in socket.c + */ + +#define AQ_WIN16 0x00 +#define AQ_WIN32 0x04 +#define HB_WIN32(hb) (hb->flags & AQ_WIN32) +#define AQ_NUMBER 0x00 +#define AQ_NAME 0x08 +#define AQ_COPYPTR1 0x10 +#define AQ_DUPLOWPTR1 0x20 +#define AQ_MASKPTR1 0x30 +#define AQ_COPYPTR2 0x40 +#define AQ_DUPLOWPTR2 0x80 +#define AQ_MASKPTR2 0xC0 + +#define AQ_GETHOST 0 +#define AQ_GETPROTO 1 +#define AQ_GETSERV 2 +#define AQ_GETMASK 3 + +/* The handles used are pseudo-handles that can be simply casted. */ +/* 16-bit values are used internally (to be sure handle comparison works right in 16-bit apps). */ +#define WSA_H32(h16) ((HANDLE)(ULONG_PTR)(h16)) + +/* ----------------------------------- helper functions - */ + +static int list_size(char** l, int item_size) +{ + int i,j = 0; + if(l) + { 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; + char** l_to = (char**)ref; + int i,j,k; + + for(j=0;l_src[j];j++) ; + p += (j + 1) * sizeof(char*); + for(i=0;ih_name) + 1; + size += list_size(p_he->h_aliases, 0); + size += list_size(p_he->h_addr_list, p_he->h_length ); } + return size; +} + +/* Copy hostent to p_to, fix up inside pointers using p_base (different for + * Win16 (linear vs. segmented). Return -neededsize on overrun. + */ +static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, int flag) +{ + char* p_name,*p_aliases,*p_addr,*p; + struct ws_hostent16 *p_to16 = (struct ws_hostent16*)p_to; + WS_hostent *p_to32 = (WS_hostent*)p_to; + int size = hostent_size(p_he) + + ( + (flag & AQ_WIN16) ? sizeof(struct ws_hostent16) : sizeof(WS_hostent) + - sizeof(struct hostent) + ); + + if (t_size < size) + return -size; + p = p_to; + p += (flag & AQ_WIN16) ? + sizeof(struct ws_hostent16) : sizeof(WS_hostent); + p_name = p; + strcpy(p, p_he->h_name); p += strlen(p) + 1; + p_aliases = p; + p += list_dup(p_he->h_aliases, p, p_base + (p - (char*)p_to), 0); + p_addr = p; + list_dup(p_he->h_addr_list, p, p_base + (p - (char*)p_to), p_he->h_length); + + if (flag & AQ_WIN16) + { + p_to16->h_addrtype = (INT16)p_he->h_addrtype; + p_to16->h_length = (INT16)p_he->h_length; + p_to16->h_name = (SEGPTR)(p_base + (p_name - p_to)); + p_to16->h_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); + p_to16->h_addr_list = (SEGPTR)(p_base + (p_addr - p_to)); + } + else + { + 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)); + p_to32->h_addr_list = (char **)(p_base + (p_addr - p_to)); + } + + return size; +} + +/* ----- protoent */ + +static int protoent_size(struct protoent* p_pe) +{ + int size = 0; + if( p_pe ) + { size = sizeof(struct protoent); + size += strlen(p_pe->p_name) + 1; + size += list_size(p_pe->p_aliases, 0); } + return size; +} + +/* Copy protoent to p_to, fix up inside pointers using p_base (different for + * Win16 (linear vs. segmented). Return -neededsize on overrun. + */ +static int WS_copy_pe(char *p_to,char *p_base,int t_size,struct protoent* p_pe, int flag) +{ + char* p_name,*p_aliases,*p; + struct ws_protoent16 *p_to16 = (struct ws_protoent16*)p_to; + WS_protoent *p_to32 = (WS_protoent*)p_to; + int size = protoent_size(p_pe) + + ( + (flag & AQ_WIN16) ? sizeof(struct ws_protoent16) : sizeof(WS_protoent) + - sizeof(struct protoent) + ); + + if (t_size < size) + return -size; + p = p_to; + p += (flag & AQ_WIN16) ? + sizeof(struct ws_protoent16) : sizeof(WS_protoent); + p_name = p; + strcpy(p, p_pe->p_name); p += strlen(p) + 1; + p_aliases = p; + list_dup(p_pe->p_aliases, p, p_base + (p - (char*)p_to), 0); + + if (flag & AQ_WIN16) + { + p_to16->p_proto = (INT16)p_pe->p_proto; + p_to16->p_name = (SEGPTR)(p_base) + (p_name - p_to); + p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to)); + } + else + { + 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)); + } + + return size; +} + +/* ----- servent */ + +static int servent_size(struct servent* p_se) +{ + int size = 0; + if( p_se ) { + size += sizeof(struct servent); + size += strlen(p_se->s_proto) + strlen(p_se->s_name) + 2; + size += list_size(p_se->s_aliases, 0); + } + return size; +} + +/* Copy servent to p_to, fix up inside pointers using p_base (different for + * Win16 (linear vs. segmented). Return -neededsize on overrun. + * Take care of different Win16/Win32 servent structs (packing !) + */ +static int WS_copy_se(char *p_to,char *p_base,int t_size,struct servent* p_se, int flag) +{ + char* p_name,*p_aliases,*p_proto,*p; + struct ws_servent16 *p_to16 = (struct ws_servent16*)p_to; + WS_servent *p_to32 = (WS_servent*)p_to; + int size = servent_size(p_se) + + ( + (flag & AQ_WIN16) ? sizeof(struct ws_servent16) : sizeof(WS_servent) + - sizeof(struct servent) + ); + + if (t_size < size) + return -size; + p = p_to; + p += (flag & AQ_WIN16) ? + sizeof(struct ws_servent16) : sizeof(WS_servent); + p_name = p; + strcpy(p, p_se->s_name); p += strlen(p) + 1; + p_proto = p; + strcpy(p, p_se->s_proto); p += strlen(p) + 1; + p_aliases = p; + list_dup(p_se->s_aliases, p, p_base + (p - p_to), 0); + + if (flag & AQ_WIN16) + { + p_to16->s_port = (INT16)p_se->s_port; + p_to16->s_name = (SEGPTR)(p_base + (p_name - p_to)); + p_to16->s_proto = (SEGPTR)(p_base + (p_proto - p_to)); + p_to16->s_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); + } + else + { + 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)); + } + + return size; +} + +static HANDLE16 __ws_async_handle = 0xdead; + +/* Generic async query struct. we use symbolic names for the different queries + * for readability. + */ +typedef struct _async_query { + HWND16 hWnd; + UINT16 uMsg; + LPCSTR ptr1; +#define host_name ptr1 +#define host_addr ptr1 +#define serv_name ptr1 +#define proto_name ptr1 + LPCSTR ptr2; +#define serv_proto ptr2 + int int1; +#define host_len int1 +#define proto_number int1 +#define serv_port int1 + int int2; +#define host_type int2 + SEGPTR sbuf; + INT16 sbuflen; + + HANDLE16 async_handle; + int flags; + int qt; + char xbuf[1]; +} async_query; + + +/**************************************************************************** + * The async query function. + * + * 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. + */ +static DWORD WINAPI _async_queryfun(LPVOID arg) { + async_query *aq = (async_query*)arg; + int size = 0; + WORD fail = 0; + char *targetptr = (HB_WIN32(aq)?(char*)aq->sbuf:0/*(char*)MapSL(aq->sbuf)*/); + + switch (aq->flags & AQ_GETMASK) { + case AQ_GETHOST: { + struct hostent *he; + char *copy_hostent = targetptr; + char buf[100]; + if( !(aq->host_name)) { + aq->host_name = buf; + if( gethostname( buf, 100) == -1) { + fail = WSAENOBUFS; /* appropriate ? */ + break; + } + } + he = (aq->flags & AQ_NAME) ? + gethostbyname(aq->host_name): + gethostbyaddr(aq->host_addr,aq->host_len,aq->host_type); + if (!he) fail = WSAGetLastError(); + if (he) { + size = WS_copy_he(copy_hostent,(char*)aq->sbuf,aq->sbuflen,he,aq->flags); + if (size < 0) { + fail = WSAENOBUFS; + size = -size; + } + } + } + break; + case AQ_GETPROTO: { +#if defined(HAVE_GETPROTOBYNAME) && defined(HAVE_GETPROTOBYNUMBER) + struct protoent *pe; + char *copy_protoent = targetptr; + pe = (aq->flags & AQ_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); + if (size < 0) { + fail = WSAENOBUFS; + size = -size; + } + } else { + if (aq->flags & AQ_NAME) + MESSAGE("protocol %s not found; You might want to add " + "this to /etc/protocols\n", debugstr_a(aq->proto_name) ); + else + MESSAGE("protocol number %d not found; You might want to add " + "this to /etc/protocols\n", aq->proto_number ); + fail = WSANO_DATA; + } +#else + fail = WSANO_DATA; +#endif + } + break; + case AQ_GETSERV: { + struct servent *se; + char *copy_servent = targetptr; + se = (aq->flags & AQ_NAME)? + getservbyname(aq->serv_name,aq->serv_proto) : +#ifdef HAVE_GETSERVBYPORT + getservbyport(aq->serv_port,aq->serv_proto); +#else + NULL; +#endif + if (se) { + size = WS_copy_se(copy_servent,(char*)aq->sbuf,aq->sbuflen,se,aq->flags); + if (size < 0) { + fail = WSAENOBUFS; + size = -size; + } + } else { + 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 ):"*"); + 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 ):"*"); + fail = WSANO_DATA; + } + } + break; + } + PostMessageA(HWND_32(aq->hWnd),aq->uMsg,(WPARAM) aq->async_handle,size|(fail<<16)); + HeapFree(GetProcessHeap(),0,arg); + return 0; +} + +/**************************************************************************** + * 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. + */ +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; + case AQ_COPYPTR1: memcpy(pto, ptr1, int1); ptr1 = pto; pto += int1; break; + case AQ_DUPLOWPTR1: pfm = ptr1; ptr1 = pto; do *pto++ = tolower(*pfm); while (*pfm++); break; + } + if (ptr2) switch (flags & AQ_MASKPTR2) { + case 0: break; + case AQ_COPYPTR2: memcpy(pto, ptr2, int2); ptr2 = pto; pto += int2; break; + case AQ_DUPLOWPTR2: pfm = ptr2; ptr2 = pto; do *pto++ = tolower(*pfm); while (*pfm++); break; + } + + aq->hWnd = HWND_16(hWnd); + aq->uMsg = uMsg; + aq->int1 = int1; + aq->ptr1 = ptr1; + aq->int2 = int2; + aq->ptr2 = ptr2; + /* avoid async_handle = 0 */ + aq->async_handle = (++__ws_async_handle ? __ws_async_handle : ++__ws_async_handle); + aq->flags = flags; + aq->sbuf = (SEGPTR)sbuf; + aq->sbuflen = sbuflen; + +#if 1 + if (CreateThread(NULL,0,_async_queryfun,aq,0,NULL) == INVALID_HANDLE_VALUE) +#endif + _async_queryfun(aq); + return __ws_async_handle; +} + + +/*********************************************************************** + * WSAAsyncGetHostByAddr (WINSOCK.102) + */ +HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 uMsg, LPCSTR addr, + INT16 len, INT16 type, SEGPTR sbuf, INT16 buflen) +{ + TRACE("hwnd %04x, msg %04x, addr %08x[%i]\n", + hWnd, uMsg, (unsigned)addr , len ); + return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,len,addr,type,NULL, + (void*)sbuf,buflen, + AQ_NUMBER|AQ_COPYPTR1|AQ_WIN16|AQ_GETHOST); +} + +/*********************************************************************** + * WSAAsyncGetHostByAddr (WS2_32.102) + */ +HANDLE WINAPI WSAAsyncGetHostByAddr(HWND hWnd, UINT uMsg, LPCSTR addr, + INT len, INT type, LPSTR sbuf, INT buflen) +{ + TRACE("hwnd %p, msg %04x, addr %08x[%i]\n", + hWnd, uMsg, (unsigned)addr , len ); + return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,len,addr,type,NULL,sbuf,buflen, + AQ_NUMBER|AQ_COPYPTR1|AQ_WIN32|AQ_GETHOST)); +} + +/*********************************************************************** + * WSAAsyncGetHostByName (WINSOCK.103) + */ +HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, + SEGPTR sbuf, INT16 buflen) +{ + TRACE("hwnd %04x, msg %04x, host %s, buffer %i\n", + hWnd, uMsg, (name)?name:"", (int)buflen ); + return __WSAsyncDBQuery(HWND_32(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, + LPSTR sbuf, INT buflen) +{ + TRACE("hwnd %p, msg %08x, host %s, buffer %i\n", + hWnd, uMsg, (name)?name:"", (int)buflen ); + return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen, + AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETHOST)); +} + +/*********************************************************************** + * WSAAsyncGetProtoByName (WINSOCK.105) + */ +HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, + SEGPTR sbuf, INT16 buflen) +{ + TRACE("hwnd %04x, msg %08x, protocol %s\n", + hWnd, uMsg, (name)?name:"" ); + return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,NULL, + (void*)sbuf,buflen, + AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN16|AQ_GETPROTO); +} + +/*********************************************************************** + * WSAAsyncGetProtoByName (WS2_32.105) + */ +HANDLE WINAPI WSAAsyncGetProtoByName(HWND hWnd, UINT uMsg, LPCSTR name, + LPSTR sbuf, INT buflen) +{ + TRACE("hwnd %p, msg %08x, protocol %s\n", + hWnd, uMsg, (name)?name:"" ); + return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen, + AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETPROTO)); +} + + +/*********************************************************************** + * WSAAsyncGetProtoByNumber (WINSOCK.104) + */ +HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd,UINT16 uMsg,INT16 number, + SEGPTR sbuf, INT16 buflen) +{ + TRACE("hwnd %04x, msg %04x, num %i\n", hWnd, uMsg, number ); + return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,number,NULL,0,NULL, + (void*)sbuf,buflen, + AQ_GETPROTO|AQ_NUMBER|AQ_WIN16); +} + +/*********************************************************************** + * WSAAsyncGetProtoByNumber (WS2_32.104) + */ +HANDLE WINAPI WSAAsyncGetProtoByNumber(HWND hWnd, UINT uMsg, INT number, + LPSTR sbuf, INT buflen) +{ + TRACE("hwnd %p, msg %04x, num %i\n", hWnd, uMsg, number ); + return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,number,NULL,0,NULL,sbuf,buflen, + AQ_GETPROTO|AQ_NUMBER|AQ_WIN32)); +} + +/*********************************************************************** + * WSAAsyncGetServByName (WINSOCK.107) + */ +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", + hWnd, uMsg, (name)?name:"", (proto)?proto:""); + return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,proto, + (void*)sbuf,buflen, + AQ_GETSERV|AQ_NAME|AQ_DUPLOWPTR1|AQ_DUPLOWPTR2|AQ_WIN16); +} + +/*********************************************************************** + * WSAAsyncGetServByName (WS2_32.107) + */ +HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name, + LPCSTR proto, LPSTR sbuf, INT buflen) +{ + TRACE("hwnd %p, msg %04x, name %s, proto %s\n", + hWnd, uMsg, (name)?name:"", (proto)?proto:""); + return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,proto,sbuf,buflen, + AQ_GETSERV|AQ_NAME|AQ_DUPLOWPTR1|AQ_DUPLOWPTR2|AQ_WIN32)); +} + +/*********************************************************************** + * WSAAsyncGetServByPort (WINSOCK.106) + */ +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", + hWnd, uMsg, port, (proto)?proto:"" ); + return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,port,NULL,0,proto, + (void*)sbuf,buflen, + AQ_GETSERV|AQ_NUMBER|AQ_DUPLOWPTR2|AQ_WIN16); +} + +/*********************************************************************** + * WSAAsyncGetServByPort (WS2_32.106) + */ +HANDLE WINAPI WSAAsyncGetServByPort(HWND hWnd, UINT uMsg, INT port, + LPCSTR proto, LPSTR sbuf, INT buflen) +{ + TRACE("hwnd %p, msg %04x, port %i, proto %s\n", + hWnd, uMsg, port, (proto)?proto:"" ); + return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,port,NULL,0,proto,sbuf,buflen, + AQ_GETSERV|AQ_NUMBER|AQ_DUPLOWPTR2|AQ_WIN32)); +} diff --git a/reactos/dll/win32/ws2_32/misc/dllmain.c b/reactos/dll/win32/ws2_32/misc/dllmain.c index bddf23beddd..18b1a02f7a3 100644 --- a/reactos/dll/win32/ws2_32/misc/dllmain.c +++ b/reactos/dll/win32/ws2_32/misc/dllmain.c @@ -80,7 +80,7 @@ WSAStartup(IN WORD wVersionRequested, WS_DbgPrint(MAX_TRACE, ("WSAStartup of ws2_32.dll\n")); - if (!g_hInstDll) + if (!g_hInstDll) return WSASYSNOTREADY; if (lpWSAData == NULL) @@ -95,7 +95,7 @@ WSAStartup(IN WORD wVersionRequested, return WSAVERNOTSUPPORTED; } - if (Low == 1) + if (Low == 1) { if (High == 0) { diff --git a/reactos/dll/win32/ws2_32/misc/ns.c b/reactos/dll/win32/ws2_32/misc/ns.c index 1e13a24919b..c9b29ea736c 100644 --- a/reactos/dll/win32/ws2_32/misc/ns.c +++ b/reactos/dll/win32/ws2_32/misc/ns.c @@ -523,8 +523,8 @@ void free_hostent(struct hostent *he) { char *next = 0; HFREE(he->h_name); - if(he->h_aliases) - { + if(he->h_aliases) + { next = he->h_aliases[0]; while(next) { HFREE(next); next++; } } diff --git a/reactos/dll/win32/ws2_32/tests/tests/WinsockEvent.c b/reactos/dll/win32/ws2_32/tests/tests/WinsockEvent.c index 3bb20f3bacd..460ea5a2f7b 100644 --- a/reactos/dll/win32/ws2_32/tests/tests/WinsockEvent.c +++ b/reactos/dll/win32/ws2_32/tests/tests/WinsockEvent.c @@ -24,7 +24,7 @@ static void TestWSACloseEventSuccess() { BOOL result; - + _SetHooks(HooksSuccess); result = WSACloseEvent(TestHandle); _AssertTrue(result); @@ -53,7 +53,7 @@ static void TestWSACloseEventFailure() { BOOL result; - + _SetHooks(HooksFailure); result = WSACloseEvent(TestHandle); _AssertFalse(result); diff --git a/reactos/drivers/base/kdcom/kdcom.rbuild b/reactos/drivers/base/kdcom/kdcom.rbuild index b5fcf2f734d..605ed0457cd 100644 --- a/reactos/drivers/base/kdcom/kdcom.rbuild +++ b/reactos/drivers/base/kdcom/kdcom.rbuild @@ -1,11 +1,11 @@ - - - - - - . - - ntoskrnl - hal - kdbg.c - + + + + + + . + + ntoskrnl + hal + kdbg.c + diff --git a/reactos/drivers/bus/acpi/ospm/osl.c b/reactos/drivers/bus/acpi/ospm/osl.c index 55d1be4c1d8..833804f2833 100644 --- a/reactos/drivers/bus/acpi/ospm/osl.c +++ b/reactos/drivers/bus/acpi/ospm/osl.c @@ -351,10 +351,10 @@ acpi_os_read_pci_cfg_byte( if (func == 0) return AE_ERROR; - slot.u.AsULONG = 0; + slot.u.AsULONG = 0; slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; slot.u.bits.FunctionNumber = func & 0xFFFF; - + DPRINT("acpi_os_read_pci_cfg_byte, slot=0x%X, func=0x%X\n", slot.u.AsULONG, func); ret = HalGetBusDataByOffset(PCIConfiguration, bus, @@ -382,7 +382,7 @@ acpi_os_read_pci_cfg_word( if (func == 0) return AE_ERROR; - slot.u.AsULONG = 0; + slot.u.AsULONG = 0; slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; slot.u.bits.FunctionNumber = func & 0xFFFF; @@ -413,7 +413,7 @@ acpi_os_read_pci_cfg_dword( if (func == 0) return AE_ERROR; - slot.u.AsULONG = 0; + slot.u.AsULONG = 0; slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; slot.u.bits.FunctionNumber = func & 0xFFFF; @@ -445,7 +445,7 @@ acpi_os_write_pci_cfg_byte( if (func == 0) return AE_ERROR; - slot.u.AsULONG = 0; + slot.u.AsULONG = 0; slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; slot.u.bits.FunctionNumber = func & 0xFFFF; @@ -477,7 +477,7 @@ acpi_os_write_pci_cfg_word( if (func == 0) return AE_ERROR; - slot.u.AsULONG = 0; + slot.u.AsULONG = 0; slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; slot.u.bits.FunctionNumber = func & 0xFFFF; @@ -509,7 +509,7 @@ acpi_os_write_pci_cfg_dword( if (func == 0) return AE_ERROR; - slot.u.AsULONG = 0; + slot.u.AsULONG = 0; slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF; slot.u.bits.FunctionNumber = func & 0xFFFF; diff --git a/reactos/drivers/bus/isapnp/isapnp.h b/reactos/drivers/bus/isapnp/isapnp.h index ac05f003bbe..9bfcc911910 100644 --- a/reactos/drivers/bus/isapnp/isapnp.h +++ b/reactos/drivers/bus/isapnp/isapnp.h @@ -16,7 +16,7 @@ extern "C" { #define TAG_ISAPNP TAG('I', 'P', 'N', 'P') #define IO_RESOURCE_REQUIRED 0x00 //ROS Extension - + #define ISAPNP_ADDRESS_PORT 0x0279 // ADDRESS (W) #define ISAPNP_WRITE_PORT 0x0A79 // WRITE_DATA (W) #define ISAPNP_MIN_READ_PORT 0x0203 // READ_DATA (R) diff --git a/reactos/drivers/bus/pci/pci.c b/reactos/drivers/bus/pci/pci.c index f9bcabecfbb..504ed5a1680 100644 --- a/reactos/drivers/bus/pci/pci.c +++ b/reactos/drivers/bus/pci/pci.c @@ -18,7 +18,7 @@ static DRIVER_DISPATCH PciDispatchDeviceControl; static NTSTATUS STDCALL PciDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); -static DRIVER_ADD_DEVICE PciAddDevice; +static DRIVER_ADD_DEVICE PciAddDevice; static NTSTATUS STDCALL PciAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject); static DRIVER_DISPATCH PciPowerControl; @@ -293,7 +293,7 @@ PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, Index++; Buffer[Index] = UNICODE_NULL; - + BufferU.Length = BufferU.MaximumLength = (USHORT) Index * sizeof(WCHAR); BufferU.Buffer = Buffer; @@ -660,7 +660,7 @@ PciDuplicateUnicodeString( if ((SourceString->Length == 0) - && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | + && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) { DestinationString->Length = 0; diff --git a/reactos/drivers/bus/pci/pci.h b/reactos/drivers/bus/pci/pci.h index 2e8af5859fb..3810e21c991 100644 --- a/reactos/drivers/bus/pci/pci.h +++ b/reactos/drivers/bus/pci/pci.h @@ -102,7 +102,7 @@ typedef struct _FDO_DEVICE_EXTENSION /* Driver extension associated with PCI driver */ typedef struct _PCI_DRIVER_EXTENSION { - // + // LIST_ENTRY BusListHead; // Lock for namespace bus list KSPIN_LOCK BusListLock; diff --git a/reactos/drivers/filesystems/cdfs/cleanup.c b/reactos/drivers/filesystems/cdfs/cleanup.c index a9da4aea256..d6162b10879 100644 --- a/reactos/drivers/filesystems/cdfs/cleanup.c +++ b/reactos/drivers/filesystems/cdfs/cleanup.c @@ -22,7 +22,7 @@ * PROJECT: ReactOS kernel * FILE: services/fs/cdfs/cleanup.c * PURPOSE: CDROM (ISO 9660) filesystem driver - * PROGRAMMER: + * PROGRAMMER: * UPDATE HISTORY: */ diff --git a/reactos/drivers/filesystems/npfs_new/create.c b/reactos/drivers/filesystems/npfs_new/create.c index 27814392723..49d7fa828d3 100644 --- a/reactos/drivers/filesystems/npfs_new/create.c +++ b/reactos/drivers/filesystems/npfs_new/create.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: drivers/filesystems/npfs/create.c * PURPOSE: Named pipe filesystem - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ diff --git a/reactos/drivers/filesystems/npfs_new/finfo.c b/reactos/drivers/filesystems/npfs_new/finfo.c index 5d257aae37b..682bd552ac9 100644 --- a/reactos/drivers/filesystems/npfs_new/finfo.c +++ b/reactos/drivers/filesystems/npfs_new/finfo.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: drivers/filesystems/npfs/finfo.c * PURPOSE: Named pipe filesystem - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ diff --git a/reactos/drivers/filesystems/npfs_new/fsctrl.c b/reactos/drivers/filesystems/npfs_new/fsctrl.c index bd6d808f76f..5cd54e1346a 100644 --- a/reactos/drivers/filesystems/npfs_new/fsctrl.c +++ b/reactos/drivers/filesystems/npfs_new/fsctrl.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: drivers/filesystems/npfs/fsctrl.c * PURPOSE: Named pipe filesystem - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ diff --git a/reactos/drivers/filesystems/npfs_new/npfs.c b/reactos/drivers/filesystems/npfs_new/npfs.c index 37248a1740d..06dc165fca5 100644 --- a/reactos/drivers/filesystems/npfs_new/npfs.c +++ b/reactos/drivers/filesystems/npfs_new/npfs.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: drivers/filesystems/npfs/npfs.c * PURPOSE: Named pipe filesystem - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ diff --git a/reactos/drivers/filesystems/npfs_new/rw.c b/reactos/drivers/filesystems/npfs_new/rw.c index e2d3cf22ffa..bad3ab57190 100644 --- a/reactos/drivers/filesystems/npfs_new/rw.c +++ b/reactos/drivers/filesystems/npfs_new/rw.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: drivers/filesystems/npfs/rw.c * PURPOSE: Named pipe filesystem - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ diff --git a/reactos/drivers/filesystems/npfs_new/volume.c b/reactos/drivers/filesystems/npfs_new/volume.c index ee956ca8ca7..2d5006231af 100644 --- a/reactos/drivers/filesystems/npfs_new/volume.c +++ b/reactos/drivers/filesystems/npfs_new/volume.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: drivers/filesystems/npfs/volume.c * PURPOSE: Named pipe filesystem - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/drivers/filesystems/ntfs/mft.c b/reactos/drivers/filesystems/ntfs/mft.c index 9cce0d5d2a1..f4d0887b884 100644 --- a/reactos/drivers/filesystems/ntfs/mft.c +++ b/reactos/drivers/filesystems/ntfs/mft.c @@ -197,7 +197,7 @@ ReadFileRecord (PDEVICE_EXTENSION Vcb, ULONGLONG vcn = index * BytesPerFileRecord / Vcb->NtfsInfo.BytesPerCluster; LONG m = (Vcb->NtfsInfo.BytesPerCluster / BytesPerFileRecord) - 1; ULONG n = m > 0 ? (index & m) : 0; - + p = ExAllocatePool(NonPagedPool, clusters * Vcb->NtfsInfo.BytesPerCluster); ReadVCN (Vcb, Mft, AttributeData, vcn, clusters, p); diff --git a/reactos/drivers/filesystems/vfat/create.c b/reactos/drivers/filesystems/vfat/create.c index 32a7e0efab3..7a3b9876fb7 100644 --- a/reactos/drivers/filesystems/vfat/create.c +++ b/reactos/drivers/filesystems/vfat/create.c @@ -659,14 +659,14 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) #ifndef USE_ROS_CC_AND_FS if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY)) { - if (Stack->Parameters.Create.SecurityContext->DesiredAccess & FILE_WRITE_DATA || + if (Stack->Parameters.Create.SecurityContext->DesiredAccess & FILE_WRITE_DATA || RequestedDisposition == FILE_OVERWRITE || RequestedDisposition == FILE_OVERWRITE_IF) { if (!MmFlushImageSection(&pFcb->SectionObjectPointers, MmFlushForWrite)) { DPRINT1("%wZ\n", &pFcb->PathNameU); - DPRINT1("%d %d %d\n", Stack->Parameters.Create.SecurityContext->DesiredAccess & FILE_WRITE_DATA, + DPRINT1("%d %d %d\n", Stack->Parameters.Create.SecurityContext->DesiredAccess & FILE_WRITE_DATA, RequestedDisposition == FILE_OVERWRITE, RequestedDisposition == FILE_OVERWRITE_IF); VfatCloseFile (DeviceExt, FileObject); return STATUS_SHARING_VIOLATION; @@ -728,7 +728,7 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) { Irp->IoStatus.Information = FILE_SUPERSEDED; } - else if (RequestedDisposition == FILE_OVERWRITE || + else if (RequestedDisposition == FILE_OVERWRITE || RequestedDisposition == FILE_OVERWRITE_IF) { Irp->IoStatus.Information = FILE_OVERWRITTEN; diff --git a/reactos/drivers/filesystems/vfat/fastio.c b/reactos/drivers/filesystems/vfat/fastio.c index f6bfc0ca81a..9697e1cb4d3 100644 --- a/reactos/drivers/filesystems/vfat/fastio.c +++ b/reactos/drivers/filesystems/vfat/fastio.c @@ -124,15 +124,15 @@ VfatFastIoUnlockAllByKey(IN PFILE_OBJECT FileObject, } static BOOLEAN NTAPI -VfatFastIoDeviceControl(IN PFILE_OBJECT FileObject, - IN BOOLEAN Wait, - IN PVOID InputBuffer OPTIONAL, - IN ULONG InputBufferLength, - OUT PVOID OutputBuffer OPTIONAL, +VfatFastIoDeviceControl(IN PFILE_OBJECT FileObject, + IN BOOLEAN Wait, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength, - IN ULONG IoControlCode, - OUT PIO_STATUS_BLOCK IoStatus, - IN PDEVICE_OBJECT DeviceObject) + IN ULONG IoControlCode, + OUT PIO_STATUS_BLOCK IoStatus, + IN PDEVICE_OBJECT DeviceObject) { DPRINT("VfatFastIoDeviceControl\n"); return FALSE; @@ -315,7 +315,7 @@ VfatAcquireForLazyWrite(IN PVOID Context, PVFATFCB Fcb = (PVFATFCB)Context; ASSERT(Fcb); DPRINT("VfatAcquireForLazyWrite(): Fcb %p\n", Fcb); - + if (!ExAcquireResourceExclusiveLite(&(Fcb->MainResource), Wait)) { DPRINT("VfatAcquireForLazyWrite(): ExReleaseResourceLite failed.\n"); @@ -330,7 +330,7 @@ VfatReleaseFromLazyWrite(IN PVOID Context) PVFATFCB Fcb = (PVFATFCB)Context; ASSERT(Fcb); DPRINT("VfatReleaseFromLazyWrite(): Fcb %p\n", Fcb); - + ExReleaseResourceLite(&(Fcb->MainResource)); } @@ -341,7 +341,7 @@ VfatAcquireForReadAhead(IN PVOID Context, PVFATFCB Fcb = (PVFATFCB)Context; ASSERT(Fcb); DPRINT("VfatAcquireForReadAhead(): Fcb %p\n", Fcb); - + if (!ExAcquireResourceExclusiveLite(&(Fcb->MainResource), Wait)) { DPRINT("VfatAcquireForReadAhead(): ExReleaseResourceLite failed.\n"); @@ -356,7 +356,7 @@ VfatReleaseFromReadAhead(IN PVOID Context) PVFATFCB Fcb = (PVFATFCB)Context; ASSERT(Fcb); DPRINT("VfatReleaseFromReadAhead(): Fcb %p\n", Fcb); - + ExReleaseResourceLite(&(Fcb->MainResource)); } diff --git a/reactos/drivers/filesystems/vfat/fcb.c b/reactos/drivers/filesystems/vfat/fcb.c index fe141b2b256..be3560566bc 100644 --- a/reactos/drivers/filesystems/vfat/fcb.c +++ b/reactos/drivers/filesystems/vfat/fcb.c @@ -26,11 +26,11 @@ static ULONG vfatNameHash(ULONG hash, PUNICODE_STRING NameU) PWCHAR last; PWCHAR curr; register WCHAR c; - + ASSERT(NameU->Buffer[0] != L'.'); curr = NameU->Buffer; last = NameU->Buffer + NameU->Length / sizeof(WCHAR); - + while(curr < last) { c = towlower(*curr++); @@ -68,12 +68,12 @@ static VOID vfatInitFcb(PVFATFCB Fcb, PUNICODE_STRING NameU) { USHORT PathNameBufferLength; - + if (NameU) PathNameBufferLength = NameU->Length + sizeof(WCHAR); else PathNameBufferLength = 0; - + Fcb->PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameBufferLength); if (!Fcb->PathNameBuffer) { @@ -81,7 +81,7 @@ vfatInitFcb(PVFATFCB Fcb, PUNICODE_STRING NameU) DPRINT1("Unable to initialize FCB for filename '%wZ'\n", NameU); KEBUGCHECKEX(0, (ULONG_PTR)Fcb, (ULONG_PTR)NameU, 0, 0); } - + Fcb->PathNameU.Length = 0; Fcb->PathNameU.Buffer = Fcb->PathNameBuffer; Fcb->PathNameU.MaximumLength = PathNameBufferLength; @@ -108,9 +108,9 @@ PVFATFCB vfatNewFCB(PDEVICE_EXTENSION pVCB, PUNICODE_STRING pFileNameU) { PVFATFCB rcFCB; - + DPRINT("'%wZ'\n", pFileNameU); - + rcFCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->FcbLookasideList); if (rcFCB == NULL) { @@ -135,7 +135,7 @@ vfatNewFCB(PDEVICE_EXTENSION pVCB, PUNICODE_STRING pFileNameU) rcFCB->RFCB.PagingIoResource = &rcFCB->PagingIoResource; rcFCB->RFCB.Resource = &rcFCB->MainResource; rcFCB->RFCB.IsFastIoPossible = FastIoIsNotPossible; - + return rcFCB; } @@ -178,12 +178,12 @@ vfatReleaseFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB) ULONG Index; ULONG ShortIndex; PVFATFCB tmpFcb; - + DPRINT ("releasing FCB at %x: %wZ, refCount:%d\n", pFCB, &pFCB->PathNameU, pFCB->RefCount); - + while (pFCB) { Index = pFCB->Hash.Hash % pVCB->HashTableSize; @@ -237,12 +237,12 @@ vfatAddFCBToTable(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB) { ULONG Index; ULONG ShortIndex; - + Index = pFCB->Hash.Hash % pVCB->HashTableSize; ShortIndex = pFCB->ShortHash.Hash % pVCB->HashTableSize; - + InsertTailList (&pVCB->FcbListHead, &pFCB->FcbListEntry); - + pFCB->Hash.next = pVCB->FcbHashTable[Index]; pVCB->FcbHashTable[Index] = &pFCB->Hash; if (pFCB->Hash.Hash != pFCB->ShortHash.Hash) @@ -264,19 +264,19 @@ vfatGrabFCBFromTable(PDEVICE_EXTENSION pVCB, PUNICODE_STRING PathNameU) UNICODE_STRING DirNameU; UNICODE_STRING FileNameU; PUNICODE_STRING FcbNameU; - + HASHENTRY* entry; - + DPRINT("'%wZ'\n", PathNameU); - + Hash = vfatNameHash(0, PathNameU); - + entry = pVCB->FcbHashTable[Hash % pVCB->HashTableSize]; if (entry) { vfatSplitPathName(PathNameU, &DirNameU, &FileNameU); } - + while (entry) { if (entry->Hash == Hash) @@ -318,26 +318,26 @@ vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb) #endif PFILE_OBJECT fileObject; PVFATCCB newCCB; - + fileObject = IoCreateStreamFileObject (NULL, vcb->StorageDevice); - + newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); if (newCCB == NULL) { return STATUS_INSUFFICIENT_RESOURCES; } RtlZeroMemory(newCCB, sizeof (VFATCCB)); - + fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; fileObject->FsContext = fcb; fileObject->FsContext2 = newCCB; fcb->FileObject = fileObject; fcb->RefCount++; - + #ifdef USE_ROS_CC_AND_FS fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGE_SIZE) ? vcb->FatInfo.BytesPerCluster : PAGE_SIZE; - + status = CcRosInitializeFileCache (fileObject, fileCacheQuantum); if (!NT_SUCCESS (status)) @@ -353,7 +353,7 @@ vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb) &VfatGlobalData->CacheMgrCallbacks, fcb); #endif - + fcb->Flags |= FCB_CACHE_INITIALIZED; return STATUS_SUCCESS; } @@ -365,7 +365,7 @@ vfatMakeRootFCB(PDEVICE_EXTENSION pVCB) ULONG FirstCluster, CurrentCluster, Size = 0; NTSTATUS Status = STATUS_SUCCESS; UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\\"); - + FCB = vfatNewFCB(pVCB, &NameU); if (FCB->Flags & FCB_IS_FATX_ENTRY) { @@ -385,7 +385,7 @@ vfatMakeRootFCB(PDEVICE_EXTENSION pVCB) CurrentCluster = FirstCluster = pVCB->FatInfo.RootCluster; FCB->entry.Fat.FirstCluster = (unsigned short)(FirstCluster & 0xffff); FCB->entry.Fat.FirstClusterHigh = (unsigned short)(FirstCluster >> 16); - + while (CurrentCluster != 0xffffffff && NT_SUCCESS(Status)) { Size += pVCB->FatInfo.BytesPerCluster; @@ -405,10 +405,10 @@ vfatMakeRootFCB(PDEVICE_EXTENSION pVCB) FCB->RFCB.ValidDataLength.QuadPart = Size; FCB->RFCB.AllocationSize.QuadPart = Size; FCB->RFCB.IsFastIoPossible = FastIoIsNotPossible; - + vfatFCBInitializeCacheFromVolume(pVCB, FCB); vfatAddFCBToTable(pVCB, FCB); - + return(FCB); } @@ -417,13 +417,13 @@ vfatOpenRootFCB(PDEVICE_EXTENSION pVCB) { PVFATFCB FCB; UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\\"); - + FCB = vfatGrabFCBFromTable (pVCB, &NameU); if (FCB == NULL) { FCB = vfatMakeRootFCB (pVCB); } - + return FCB; } @@ -439,15 +439,15 @@ vfatMakeFCBFromDirEntry( USHORT PathNameLength; ULONG Size; ULONG hash; - + UNICODE_STRING NameU; - + PathNameLength = directoryFCB->PathNameU.Length + max(DirContext->LongNameU.Length, DirContext->ShortNameU.Length); if (!vfatFCBIsRoot (directoryFCB)) { PathNameLength += sizeof(WCHAR); } - + if (PathNameLength > LONGNAME_MAX_LENGTH * sizeof(WCHAR)) { return STATUS_OBJECT_NAME_INVALID; @@ -460,7 +460,7 @@ vfatMakeFCBFromDirEntry( NameU.Buffer = PathNameBuffer; NameU.Length = 0; NameU.MaximumLength = PathNameLength; - + RtlCopyUnicodeString(&NameU, &directoryFCB->PathNameU); if (!vfatFCBIsRoot (directoryFCB)) { @@ -476,7 +476,7 @@ vfatMakeFCBFromDirEntry( RtlAppendUnicodeStringToString(&NameU, &DirContext->ShortNameU); } NameU.Buffer[NameU.Length / sizeof(WCHAR)] = 0; - + rcFCB = vfatNewFCB (vcb, &NameU); RtlCopyMemory (&rcFCB->entry, &DirContext->DirEntry, sizeof (DIR_ENTRY)); RtlCopyUnicodeString(&rcFCB->ShortNameU, &DirContext->ShortNameU); @@ -488,7 +488,7 @@ vfatMakeFCBFromDirEntry( { rcFCB->ShortHash.Hash = vfatNameHash(hash, &rcFCB->ShortNameU); } - + if (vfatFCBIsDirectory(rcFCB)) { ULONG FirstCluster, CurrentCluster; @@ -536,7 +536,7 @@ vfatMakeFCBFromDirEntry( rcFCB->parentFcb = directoryFCB; vfatAddFCBToTable (vcb, rcFCB); *fileFCB = rcFCB; - + ExFreePool(PathNameBuffer); return STATUS_SUCCESS; } @@ -548,7 +548,7 @@ vfatAttachFCBToFileObject ( PFILE_OBJECT fileObject) { PVFATCCB newCCB; - + newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); if (newCCB == NULL) { @@ -556,12 +556,12 @@ vfatAttachFCBToFileObject ( return STATUS_INSUFFICIENT_RESOURCES; } RtlZeroMemory (newCCB, sizeof (VFATCCB)); - + fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; fileObject->FsContext = fcb; fileObject->FsContext2 = newCCB; DPRINT ("file open: fcb:%x PathName:%wZ\n", fcb, &fcb->PathNameU); - + return STATUS_SUCCESS; } @@ -583,17 +583,17 @@ vfatDirFindFile ( WCHAR ShortNameBuffer[13]; BOOLEAN FoundLong = FALSE; BOOLEAN FoundShort = FALSE; - + ASSERT(pDeviceExt); ASSERT(pDirectoryFCB); ASSERT(FileToFindU); - + DPRINT ("vfatDirFindFile(VCB:%08x, dirFCB:%08x, File:%wZ)\n", pDeviceExt, pDirectoryFCB, FileToFindU); DPRINT ("Dir Path:%wZ\n", &pDirectoryFCB->PathNameU); - + DirContext.DirIndex = 0; DirContext.LongNameU.Buffer = LongNameBuffer; DirContext.LongNameU.Length = 0; @@ -601,7 +601,7 @@ vfatDirFindFile ( DirContext.ShortNameU.Buffer = ShortNameBuffer; DirContext.ShortNameU.Length = 0; DirContext.ShortNameU.MaximumLength = sizeof(ShortNameBuffer); - + while (TRUE) { status = pDeviceExt->GetNextDirEntry(&Context, @@ -618,7 +618,7 @@ vfatDirFindFile ( { return status; } - + DPRINT (" Index:%d longName:%wZ\n", DirContext.DirIndex, &DirContext.LongNameU); @@ -643,7 +643,7 @@ vfatDirFindFile ( } DirContext.DirIndex++; } - + return STATUS_OBJECT_NAME_NOT_FOUND; } @@ -663,7 +663,7 @@ vfatGetFCBForFile ( WCHAR NameBuffer[260]; PWCHAR curr, prev, last; ULONG Length; - + DPRINT ("vfatGetFCBForFile (%x,%x,%x,%wZ)\n", pVCB, pParentFCB, @@ -673,23 +673,23 @@ vfatGetFCBForFile ( FileNameU.Buffer = NameBuffer; FileNameU.MaximumLength = sizeof(NameBuffer); RtlCopyUnicodeString(&FileNameU, pFileNameU); - + parentFCB = *pParentFCB; - + if (parentFCB == NULL) { // Trivial case, open of the root directory on volume if (RtlEqualUnicodeString(&FileNameU, &RootNameU, FALSE)) { DPRINT ("returning root FCB\n"); - + FCB = vfatOpenRootFCB (pVCB); *pFCB = FCB; *pParentFCB = NULL; - + return (FCB != NULL) ? STATUS_SUCCESS : STATUS_OBJECT_PATH_NOT_FOUND; } - + /* Check for an existing FCB */ FCB = vfatGrabFCBFromTable (pVCB, &FileNameU); if (FCB) @@ -699,13 +699,13 @@ vfatGetFCBForFile ( (*pParentFCB)->RefCount++; return STATUS_SUCCESS; } - + last = curr = FileNameU.Buffer + FileNameU.Length / sizeof(WCHAR) - 1; while (*curr != L'\\' && curr > FileNameU.Buffer) { curr--; } - + if (curr > FileNameU.Buffer) { NameU.Buffer = FileNameU.Buffer; @@ -734,13 +734,13 @@ vfatGetFCBForFile ( { FCB = NULL; } - + if (FCB == NULL) { FCB = vfatOpenRootFCB(pVCB); curr = FileNameU.Buffer; } - + parentFCB = NULL; prev = curr; } @@ -751,7 +751,7 @@ vfatGetFCBForFile ( prev = curr = FileNameU.Buffer - 1; last = FileNameU.Buffer + FileNameU.Length / sizeof(WCHAR) - 1; } - + while (curr <= last) { if (parentFCB) @@ -763,12 +763,12 @@ vfatGetFCBForFile ( if (!vfatFCBIsDirectory (FCB)) { DPRINT ("Element in requested path is not a directory\n"); - + vfatReleaseFCB (pVCB, FCB); FCB = NULL; *pParentFCB = NULL; *pFCB = NULL; - + return STATUS_OBJECT_PATH_NOT_FOUND; } parentFCB = FCB; @@ -826,15 +826,15 @@ vfatGetFCBForFile ( vfatReleaseFCB (pVCB, parentFCB); *pParentFCB = NULL; *pFCB = NULL; - + return status; } } } - + *pParentFCB = parentFCB; *pFCB = FCB; - + return STATUS_SUCCESS; } diff --git a/reactos/drivers/filesystems/vfat/flush.c b/reactos/drivers/filesystems/vfat/flush.c index dd296532bd1..ae6547bbacf 100644 --- a/reactos/drivers/filesystems/vfat/flush.c +++ b/reactos/drivers/filesystems/vfat/flush.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: drivers/fs/vfat/flush.c * PURPOSE: VFAT Filesystem - * PROGRAMMER: + * PROGRAMMER: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/drivers/filesystems/vfat/misc.c b/reactos/drivers/filesystems/vfat/misc.c index dd7a2b10a45..5016486fb1e 100644 --- a/reactos/drivers/filesystems/vfat/misc.c +++ b/reactos/drivers/filesystems/vfat/misc.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: drivers/fs/vfat/misc.c * PURPOSE: VFAT Filesystem - * PROGRAMMER: + * PROGRAMMER: * */ diff --git a/reactos/drivers/input/kbdclass/kbdclass.c b/reactos/drivers/input/kbdclass/kbdclass.c index 8a7897fc507..fb9ba439e1f 100644 --- a/reactos/drivers/input/kbdclass/kbdclass.c +++ b/reactos/drivers/input/kbdclass/kbdclass.c @@ -1,9 +1,9 @@ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Keyboard class driver * FILE: drivers/kbdclass/kbdclass.c * PURPOSE: Keyboard class driver - * + * * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) */ diff --git a/reactos/drivers/input/kbdclass/misc.c b/reactos/drivers/input/kbdclass/misc.c index 92971eafcdd..e7a0fa630ac 100644 --- a/reactos/drivers/input/kbdclass/misc.c +++ b/reactos/drivers/input/kbdclass/misc.c @@ -1,9 +1,9 @@ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Keyboard class driver * FILE: drivers/input/kbdclass/misc.c * PURPOSE: Misceallenous operations - * + * * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) */ @@ -30,16 +30,16 @@ ForwardIrpAndWait( PDEVICE_OBJECT LowerDevice; KEVENT Event; NTSTATUS Status; - + ASSERT(!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO); LowerDevice = ((PPORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice; - + KeInitializeEvent(&Event, NotificationEvent, FALSE); IoCopyCurrentIrpStackLocationToNext(Irp); - + DPRINT("Calling lower device %p\n", LowerDevice); IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE); - + Status = IoCallDriver(LowerDevice, Irp); if (Status == STATUS_PENDING) { @@ -47,7 +47,7 @@ ForwardIrpAndWait( if (NT_SUCCESS(Status)) Status = Irp->IoStatus.Status; } - + return Status; } @@ -57,10 +57,10 @@ ForwardIrpAndForget( IN PIRP Irp) { PDEVICE_OBJECT LowerDevice; - + ASSERT(!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO); LowerDevice = ((PPORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice; - + IoSkipCurrentIrpStackLocation(Irp); return IoCallDriver(LowerDevice, Irp); } @@ -81,7 +81,7 @@ DuplicateUnicodeString( if ((SourceString->Length == 0) - && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | + && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) { DestinationString->Length = 0; diff --git a/reactos/drivers/input/mouclass/misc.c b/reactos/drivers/input/mouclass/misc.c index c7faf0e1210..3645e7447f4 100644 --- a/reactos/drivers/input/mouclass/misc.c +++ b/reactos/drivers/input/mouclass/misc.c @@ -1,9 +1,9 @@ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Mouse class driver * FILE: drivers/input/mouclass/misc.c * PURPOSE: Misceallenous operations - * + * * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) */ @@ -30,16 +30,16 @@ ForwardIrpAndWait( PDEVICE_OBJECT LowerDevice; KEVENT Event; NTSTATUS Status; - + ASSERT(!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO); LowerDevice = ((PPORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice; - + KeInitializeEvent(&Event, NotificationEvent, FALSE); IoCopyCurrentIrpStackLocationToNext(Irp); - + DPRINT("Calling lower device %p\n", LowerDevice); IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE); - + Status = IoCallDriver(LowerDevice, Irp); if (Status == STATUS_PENDING) { @@ -47,7 +47,7 @@ ForwardIrpAndWait( if (NT_SUCCESS(Status)) Status = Irp->IoStatus.Status; } - + return Status; } @@ -57,10 +57,10 @@ ForwardIrpAndForget( IN PIRP Irp) { PDEVICE_OBJECT LowerDevice; - + ASSERT(!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO); LowerDevice = ((PPORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice; - + IoSkipCurrentIrpStackLocation(Irp); return IoCallDriver(LowerDevice, Irp); } @@ -81,7 +81,7 @@ DuplicateUnicodeString( if ((SourceString->Length == 0) - && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | + && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) { DestinationString->Length = 0; diff --git a/reactos/drivers/ksfilter/ks/kcom.c b/reactos/drivers/ksfilter/ks/kcom.c index b54caf65f4c..c041e60c1c8 100644 --- a/reactos/drivers/ksfilter/ks/kcom.c +++ b/reactos/drivers/ksfilter/ks/kcom.c @@ -1,51 +1,51 @@ -/* =============================================================== - Kernel-mode COM -*/ - -#include -#include -#include -#include -#include - - -/* http://msdn2.microsoft.com/en-us/library/ms809781.aspx */ -COMDDKAPI NTSTATUS NTAPI -KoCreateInstance( - IN REFCLSID ClassId, - IN IUnknown* UnkOuter OPTIONAL, - IN ULONG ClsContext, - IN REFIID InterfaceId, - OUT PVOID* Interface) -{ - /* If UnkOuter isn't NULL, it must be IUnknown - TODO: CHECK THIS PARAM */ - /* TODO: Check IRQL? */ - - DPRINT("KoCreateInstance called\n"); - - if ( ClsContext != CLSCTX_KERNEL_SERVER ) - { - DPRINT("FAILED: ClsContext must be CLSCTX_KERNEL_SERVER\n"); - return STATUS_INVALID_PARAMETER_3; - } - - /* - Find the desired interface and create an instance. - - But we also need to supply a - pointer which will be set to a list of available interfaces, to - IoGetDeviceInterfaces. - - We can then create a file based on this information and thus talk - to the appropriate device. - - Useful references: - http://www.freelists.org/archives/wdmaudiodev/01-2003/msg00023.html - - TODO - */ - - DPRINT("** FAKING SUCCESS **\n"); - - return STATUS_SUCCESS; -} +/* =============================================================== + Kernel-mode COM +*/ + +#include +#include +#include +#include +#include + + +/* http://msdn2.microsoft.com/en-us/library/ms809781.aspx */ +COMDDKAPI NTSTATUS NTAPI +KoCreateInstance( + IN REFCLSID ClassId, + IN IUnknown* UnkOuter OPTIONAL, + IN ULONG ClsContext, + IN REFIID InterfaceId, + OUT PVOID* Interface) +{ + /* If UnkOuter isn't NULL, it must be IUnknown - TODO: CHECK THIS PARAM */ + /* TODO: Check IRQL? */ + + DPRINT("KoCreateInstance called\n"); + + if ( ClsContext != CLSCTX_KERNEL_SERVER ) + { + DPRINT("FAILED: ClsContext must be CLSCTX_KERNEL_SERVER\n"); + return STATUS_INVALID_PARAMETER_3; + } + + /* + Find the desired interface and create an instance. + + But we also need to supply a + pointer which will be set to a list of available interfaces, to + IoGetDeviceInterfaces. + + We can then create a file based on this information and thus talk + to the appropriate device. + + Useful references: + http://www.freelists.org/archives/wdmaudiodev/01-2003/msg00023.html + + TODO + */ + + DPRINT("** FAKING SUCCESS **\n"); + + return STATUS_SUCCESS; +} diff --git a/reactos/drivers/multimedia/audio/sb16_nt4/main.c b/reactos/drivers/multimedia/audio/sb16_nt4/main.c index 30894e7685a..aae7be7f629 100644 --- a/reactos/drivers/multimedia/audio/sb16_nt4/main.c +++ b/reactos/drivers/multimedia/audio/sb16_nt4/main.c @@ -359,7 +359,7 @@ CreateDeviceName( DeviceName->Buffer[DeviceName->Length / sizeof(UNICODE_NULL)] = UNICODE_NULL; - return STATUS_SUCCESS; + return STATUS_SUCCESS; } NTSTATUS STDCALL diff --git a/reactos/drivers/network/afd/afd/lock.c b/reactos/drivers/network/afd/afd/lock.c index 0eeb490963b..a341cdfd614 100644 --- a/reactos/drivers/network/afd/afd/lock.c +++ b/reactos/drivers/network/afd/afd/lock.c @@ -239,7 +239,7 @@ NTSTATUS NTAPI UnlockAndMaybeComplete BOOL ShouldUnlock ) { if( Status == STATUS_PENDING ) { - /* We should firstly mark this IRP as pending, because + /* We should firstly mark this IRP as pending, because otherwise it may be completed by StreamSocketConnectComplete() before we return from SocketStateUnlock(). */ IoMarkIrpPending( Irp ); diff --git a/reactos/drivers/network/afd/afd/select.c b/reactos/drivers/network/afd/afd/select.c index 212afc3b340..c486275ce47 100644 --- a/reactos/drivers/network/afd/afd/select.c +++ b/reactos/drivers/network/afd/afd/select.c @@ -53,24 +53,24 @@ static VOID ZeroEvents( PAFD_HANDLE HandleArray, /* you must pass either Poll OR Irp */ -static VOID SignalSocket( - PAFD_ACTIVE_POLL Poll OPTIONAL, - PIRP _Irp OPTIONAL, +static VOID SignalSocket( + PAFD_ACTIVE_POLL Poll OPTIONAL, + PIRP _Irp OPTIONAL, PAFD_POLL_INFO PollReq, - NTSTATUS Status - ) + NTSTATUS Status + ) { UINT i; PIRP Irp = _Irp ? _Irp : Poll->Irp; AFD_DbgPrint(MID_TRACE,("Called (Status %x)\n", Status)); - + if (Poll) { KeCancelTimer( &Poll->Timer ); RemoveEntryList( &Poll->ListEntry ); ExFreePool( Poll ); } - + Irp->IoStatus.Status = Status; Irp->IoStatus.Information = FIELD_OFFSET(AFD_POLL_INFO, Handles) + sizeof(AFD_HANDLE) * PollReq->HandleCount; @@ -230,11 +230,11 @@ AfdSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp, Irp->IoStatus.Status = Status; SignalSocket( NULL, Irp, PollReq, Status ); } else { - + PAFD_ACTIVE_POLL Poll = NULL; - + Poll = ExAllocatePool( NonPagedPool, AllocSize ); - + if (Poll){ Poll->Irp = Irp; Poll->DeviceExt = DeviceExt; @@ -245,7 +245,7 @@ AfdSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp, KeInitializeDpc( (PRKDPC)&Poll->TimeoutDpc, (PKDEFERRED_ROUTINE)SelectTimeout, Poll ); - + InsertTailList( &DeviceExt->Polls, &Poll->ListEntry ); KeSetTimer( &Poll->Timer, PollReq->Timeout, &Poll->TimeoutDpc ); diff --git a/reactos/drivers/network/ndis/ndis/buffer.c b/reactos/drivers/network/ndis/ndis/buffer.c index 90d8676b430..4ea78f4ab5b 100644 --- a/reactos/drivers/network/ndis/ndis/buffer.c +++ b/reactos/drivers/network/ndis/ndis/buffer.c @@ -350,7 +350,7 @@ NdisAllocateBuffer( { ASSERT(VirtualAddress != NULL); ASSERT(Length > 0); - + *Buffer = IoAllocateMdl(VirtualAddress, Length, FALSE, FALSE, NULL); if (*Buffer != NULL) { MmBuildMdlForNonPagedPool(*Buffer); @@ -504,25 +504,25 @@ NdisAllocatePacketPoolEx( Size = sizeof(NDISI_PACKET_POOL) + Length * NumberOfDescriptors; Pool = ExAllocatePool(NonPagedPool, Size); - if (Pool) + if (Pool) { KeInitializeSpinLock(&Pool->SpinLock.SpinLock); Pool->PacketLength = Length; - if (NumberOfDescriptors > 0) + if (NumberOfDescriptors > 0) { Packet = (PNDIS_PACKET)&Pool->Buffer; Pool->FreeList = Packet; NextPacket = (PNDIS_PACKET)((ULONG_PTR)Packet + Length); - for (i = 1; i < NumberOfDescriptors; i++) + for (i = 1; i < NumberOfDescriptors; i++) { Packet->Private.Head = (PNDIS_BUFFER)NextPacket; Packet = NextPacket; NextPacket = (PNDIS_PACKET)((ULONG_PTR)Packet + Length); } Packet->Private.Head = NULL; - } + } else Pool->FreeList = NULL; diff --git a/reactos/drivers/network/ndis/ndis/config.c b/reactos/drivers/network/ndis/ndis/config.c index 30aa5a61b0a..2199328e04d 100644 --- a/reactos/drivers/network/ndis/ndis/config.c +++ b/reactos/drivers/network/ndis/ndis/config.c @@ -66,7 +66,7 @@ NdisWriteConfiguration( ULONG ParameterType = ParameterValue->ParameterType; ULONG DataSize; PVOID Data; - WCHAR Buff[25]; + WCHAR Buff[25]; if(ParameterType != NdisParameterInteger && ParameterType != NdisParameterHexInteger && @@ -81,28 +81,28 @@ NdisWriteConfiguration( /* reset parameter type to standard reg types */ switch(ParameterType) - { + { case NdisParameterHexInteger: - case NdisParameterInteger: - { + case NdisParameterInteger: + { UNICODE_STRING Str; - + Str.Buffer = (PWSTR) &Buff; Str.MaximumLength = (USHORT)sizeof(Buff); Str.Length = 0; - + ParameterType = REG_SZ; if (!NT_SUCCESS(RtlIntegerToUnicodeString( ParameterValue->ParameterData.IntegerData, - (ParameterType == NdisParameterInteger) ? 10 : 16, &Str))) + (ParameterType == NdisParameterInteger) ? 10 : 16, &Str))) { *Status = NDIS_STATUS_FAILURE; return; - } + } Data = Str.Buffer; - DataSize = Str.Length; + DataSize = Str.Length; } - break; + break; case NdisParameterString: case NdisParameterMultiString: ParameterType = REG_SZ; @@ -507,7 +507,7 @@ NdisReadConfiguration( str.Buffer = (PWCHAR)KeyInformation->Data; (*ParameterValue)->ParameterType = ParameterType; - + /* If ParameterType is NdisParameterInteger then the base of str is decimal. If ParameterType is NdisParameterHexInteger then the base of str is hexadecimal. diff --git a/reactos/drivers/network/ndis/ndis/control.c b/reactos/drivers/network/ndis/ndis/control.c index ec2db26170b..3dd216234d6 100644 --- a/reactos/drivers/network/ndis/ndis/control.c +++ b/reactos/drivers/network/ndis/ndis/control.c @@ -123,7 +123,7 @@ NdisReleaseReadWriteLock( LockState->LockState = -1; KfReleaseSpinLock(&Lock->SpinLock, LockState->OldIrql); return; - } + } } diff --git a/reactos/drivers/network/ndis/ndis/miniport.c b/reactos/drivers/network/ndis/ndis/miniport.c index 41aaf513ee4..9400eecb5fa 100644 --- a/reactos/drivers/network/ndis/ndis/miniport.c +++ b/reactos/drivers/network/ndis/ndis/miniport.c @@ -508,7 +508,7 @@ MiniLocateDevice( KeAcquireSpinLock(&AdapterListLock, &OldIrql); { CurrentEntry = AdapterListHead.Flink; - + while (CurrentEntry != &AdapterListHead) { Adapter = CONTAINING_RECORD(CurrentEntry, LOGICAL_ADAPTER, ListEntry); @@ -518,12 +518,12 @@ MiniLocateDevice( NDIS_DbgPrint(DEBUG_MINIPORT, ("Examining adapter 0x%lx\n", Adapter)); NDIS_DbgPrint(DEBUG_MINIPORT, ("AdapterName = %wZ\n", AdapterName)); NDIS_DbgPrint(DEBUG_MINIPORT, ("DeviceName = %wZ\n", &Adapter->NdisMiniportBlock.MiniportName)); - + if (RtlCompareUnicodeString(AdapterName, &Adapter->NdisMiniportBlock.MiniportName, TRUE) == 0) { break; } - + Adapter = NULL; CurrentEntry = CurrentEntry->Flink; } @@ -615,20 +615,20 @@ MiniQueueWorkItem( PNDIS_MINIPORT_WORK_ITEM Item; NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - + ASSERT(Adapter); ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL); - + Item = ExAllocatePool(NonPagedPool, sizeof(NDIS_MINIPORT_WORK_ITEM)); if (Item == NULL) { NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); return NDIS_STATUS_RESOURCES; } - + Item->WorkItemType = WorkItemType; Item->WorkItemContext = WorkItemContext; - + /* safe due to adapter lock held */ Item->Link.Next = NULL; if (!Adapter->WorkQueueHead) @@ -641,9 +641,9 @@ MiniQueueWorkItem( Adapter->WorkQueueTail->Link.Next = (PSINGLE_LIST_ENTRY)Item; Adapter->WorkQueueTail = Item; } - + KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); - + return NDIS_STATUS_SUCCESS; } @@ -668,27 +668,27 @@ MiniDequeueWorkItem( */ { PNDIS_MINIPORT_WORK_ITEM Item; - + NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); - + Item = Adapter->WorkQueueHead; - + if (Item) { /* safe due to adapter lock held */ Adapter->WorkQueueHead = (PNDIS_MINIPORT_WORK_ITEM)Item->Link.Next; - + if (Item == Adapter->WorkQueueTail) Adapter->WorkQueueTail = NULL; - + *WorkItemType = Item->WorkItemType; *WorkItemContext = Item->WorkItemContext; - + ExFreePool(Item); - + return NDIS_STATUS_SUCCESS; } - + return NDIS_STATUS_FAILURE; } @@ -707,9 +707,9 @@ MiniDoRequest( */ { NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - + Adapter->MediaRequest = NdisRequest; - + switch (NdisRequest->RequestType) { case NdisRequestQueryInformation: @@ -721,7 +721,7 @@ MiniDoRequest( (PULONG)&NdisRequest->DATA.QUERY_INFORMATION.BytesWritten, (PULONG)&NdisRequest->DATA.QUERY_INFORMATION.BytesNeeded); break; - + case NdisRequestSetInformation: return (*Adapter->DriverHandle->MiniportCharacteristics.SetInformationHandler)( Adapter->MiniportAdapterContext, @@ -731,7 +731,7 @@ MiniDoRequest( (PULONG)&NdisRequest->DATA.SET_INFORMATION.BytesRead, (PULONG)&NdisRequest->DATA.SET_INFORMATION.BytesNeeded); break; - + default: return NDIS_STATUS_FAILURE; } @@ -777,7 +777,7 @@ VOID NTAPI MiniportDpc( NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n")); - NdisStatus = + NdisStatus = MiniDequeueWorkItem (Adapter, &WorkItemType, &WorkItemContext); @@ -1152,7 +1152,7 @@ DoQueries( NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); /* Get MAC options for adapter */ - NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MAC_OPTIONS, sizeof(UINT), + NdisStatus = MiniQueryInformation(Adapter, OID_GEN_MAC_OPTIONS, sizeof(UINT), &Adapter->NdisMiniportBlock.MacOptions, &BytesWritten); diff --git a/reactos/drivers/network/ndis/ndis/protocol.c b/reactos/drivers/network/ndis/ndis/protocol.c index 0515ed9e4cf..1891b66a332 100644 --- a/reactos/drivers/network/ndis/ndis/protocol.c +++ b/reactos/drivers/network/ndis/ndis/protocol.c @@ -623,8 +623,8 @@ NdisOpenAdapter( AdapterBinding->NdisOpenBlock.SendPacketsHandler = ProSendPackets; AdapterBinding->NdisOpenBlock.TransferDataHandler = ProTransferData; - AdapterBinding->NdisOpenBlock.RequestCompleteHandler = - Protocol->Chars.RequestCompleteHandler; + AdapterBinding->NdisOpenBlock.RequestCompleteHandler = + Protocol->Chars.RequestCompleteHandler; #if 0 /* XXX this looks fishy */ diff --git a/reactos/drivers/network/tcpip/datalink/lan.c b/reactos/drivers/network/tcpip/datalink/lan.c index bc515129088..94239036f99 100644 --- a/reactos/drivers/network/tcpip/datalink/lan.c +++ b/reactos/drivers/network/tcpip/datalink/lan.c @@ -298,32 +298,32 @@ VOID LanReceiveWorker( PVOID Context ) { Packet = WorkItem->Packet; Adapter = WorkItem->Adapter; BytesTransferred = WorkItem->BytesTransferred; - + IPPacket.NdisPacket = Packet; - + NdisGetFirstBufferFromPacket(Packet, &NdisBuffer, &IPPacket.Header, &IPPacket.ContigSize, &IPPacket.TotalSize); - + IPPacket.ContigSize = IPPacket.TotalSize = BytesTransferred; /* Determine which upper layer protocol that should receive this packet and pass it to the correct receive handler */ - + TI_DbgPrint(MID_TRACE, ("ContigSize: %d, TotalSize: %d, BytesTransferred: %d\n", IPPacket.ContigSize, IPPacket.TotalSize, BytesTransferred)); - + PacketType = PC(IPPacket.NdisPacket)->PacketType; IPPacket.Position = 0; - + TI_DbgPrint (DEBUG_DATALINK, ("Ether Type = %x ContigSize = %d Total = %d\n", PacketType, IPPacket.ContigSize, IPPacket.TotalSize)); - + switch (PacketType) { case ETYPE_IPv4: case ETYPE_IPv6: @@ -336,7 +336,7 @@ VOID LanReceiveWorker( PVOID Context ) { default: break; } - + FreeNdisPacket( Packet ); } @@ -486,7 +486,7 @@ NDIS_STATUS STDCALL ProtocolReceive( else { if (NdisStatus == NDIS_STATUS_SUCCESS) - { + { NdisTransferData(&NdisStatus, Adapter->NdisHandle, MacReceiveContext, 0, PacketSize, NdisPacket, &BytesTransferred); diff --git a/reactos/drivers/network/tcpip/include/tcpip.h b/reactos/drivers/network/tcpip/include/tcpip.h index 8e4740bd7db..5a4c19b88a0 100644 --- a/reactos/drivers/network/tcpip/include/tcpip.h +++ b/reactos/drivers/network/tcpip/include/tcpip.h @@ -121,9 +121,9 @@ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; -struct in_addr +struct in_addr { - union + union { struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; struct { u_short s_w1,s_w2; } S_un_w; @@ -136,7 +136,7 @@ struct in_addr #define s_impno S_un.S_un_b.s_b4 #define s_lh S_un.S_un_b.s_b3 }; -struct sockaddr_in +struct sockaddr_in { short sin_family; u_short sin_port; diff --git a/reactos/drivers/network/tcpip/recmutex/recmutex.c b/reactos/drivers/network/tcpip/recmutex/recmutex.c index 84264ab39cb..0427a29664b 100644 --- a/reactos/drivers/network/tcpip/recmutex/recmutex.c +++ b/reactos/drivers/network/tcpip/recmutex/recmutex.c @@ -5,8 +5,8 @@ VOID RecursiveMutexInit( PRECURSIVE_MUTEX RecMutex ) { RtlZeroMemory( RecMutex, sizeof(*RecMutex) ); KeInitializeSpinLock( &RecMutex->SpinLock ); ExInitializeFastMutex( &RecMutex->Mutex ); - KeInitializeEvent( &RecMutex->StateLockedEvent, - NotificationEvent, FALSE ); + KeInitializeEvent( &RecMutex->StateLockedEvent, + NotificationEvent, FALSE ); } /* NOTE: When we leave, the FAST_MUTEX must have been released. The result @@ -21,7 +21,7 @@ SIZE_T RecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToWrite ) { if( !RecMutex ) return FALSE; - if( CurrentThread == RecMutex->CurrentThread || + if( CurrentThread == RecMutex->CurrentThread || (!ToWrite && !RecMutex->Writer) ) { RecMutex->LockCount++; return TRUE; @@ -75,7 +75,7 @@ VOID RecursiveMutexLeave( PRECURSIVE_MUTEX RecMutex ) { } RecMutex->OldIrql = PASSIVE_LEVEL; - KePulseEvent( &RecMutex->StateLockedEvent, IO_NETWORK_INCREMENT, + KePulseEvent( &RecMutex->StateLockedEvent, IO_NETWORK_INCREMENT, FALSE ); } } diff --git a/reactos/drivers/network/tcpip/recmutex/recmutex.h b/reactos/drivers/network/tcpip/recmutex/recmutex.h index bec2cf60754..a45ae1b87ad 100644 --- a/reactos/drivers/network/tcpip/recmutex/recmutex.h +++ b/reactos/drivers/network/tcpip/recmutex/recmutex.h @@ -7,7 +7,7 @@ typedef struct _RECURSIVE_MUTEX { /* Number of times this object was locked */ SIZE_T LockCount; /* CurrentThread */ - PVOID CurrentThread; + PVOID CurrentThread; /* Notification event which signals that another thread can take over */ KEVENT StateLockedEvent; /* IRQL from spin lock */ diff --git a/reactos/drivers/network/tcpip/tcpip/dispatch.c b/reactos/drivers/network/tcpip/tcpip/dispatch.c index 3eacc972921..e17167463ef 100644 --- a/reactos/drivers/network/tcpip/tcpip/dispatch.c +++ b/reactos/drivers/network/tcpip/tcpip/dispatch.c @@ -198,15 +198,15 @@ VOID NTAPI DispCancelRequest( switch(MinorFunction) { case TDI_SEND: case TDI_RECEIVE: - DisType.Type = TDI_DISCONNECT_RELEASE | + DisType.Type = TDI_DISCONNECT_RELEASE | ((MinorFunction == TDI_RECEIVE) ? TDI_DISCONNECT_ABORT : 0); DisType.Context = TranContext->Handle.ConnectionContext; DisType.Irp = Irp; DisType.FileObject = FileObject; - + TCPRemoveIRP( TranContext->Handle.ConnectionContext, Irp ); - if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE), + if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE), DispDoDisconnect, &DisType ) ) ASSERT(0); break; @@ -1511,7 +1511,7 @@ NTSTATUS DispTdiSetIPAddress( PIRP Irp, PIO_STACK_LOCATION IrpSp ) { (PIP_SET_ADDRESS)Irp->AssociatedIrp.SystemBuffer; IF_LIST_ITER(IF); - TI_DbgPrint(MID_TRACE,("Setting IP Address for adapter %d\n", + TI_DbgPrint(MID_TRACE,("Setting IP Address for adapter %d\n", IpAddrChange->NteIndex)); ForEachInterface(IF) { diff --git a/reactos/drivers/network/tcpip/tcpip/iinfo.c b/reactos/drivers/network/tcpip/tcpip/iinfo.c index 7a6fe06f49c..2bed180272d 100644 --- a/reactos/drivers/network/tcpip/tcpip/iinfo.c +++ b/reactos/drivers/network/tcpip/tcpip/iinfo.c @@ -85,7 +85,7 @@ TDI_STATUS InfoTdiQueryGetArptableMIB(TDIEntityID *ID, NTSTATUS Status; DWORD NumNeighbors = NBCopyNeighbors( Interface, NULL ); DWORD MemSize = NumNeighbors * sizeof(IPARP_ENTRY); - PIPARP_ENTRY ArpEntries = + PIPARP_ENTRY ArpEntries = ExAllocatePoolWithTag ( NonPagedPool, MemSize, FOURCC('A','R','P','t') ); @@ -106,7 +106,7 @@ TDI_STATUS InfoTdiQueryGetArpCapability(TDIEntityID *ID, NTSTATUS Status; DWORD Capability = 0x280; - TI_DbgPrint(MID_TRACE,("Copying out %d bytes (AT_ENTITY capability)\n", + TI_DbgPrint(MID_TRACE,("Copying out %d bytes (AT_ENTITY capability)\n", sizeof(Capability))); Status = InfoCopyOut ( (PVOID)&Capability, sizeof(Capability), Buffer, BufferSize ); diff --git a/reactos/drivers/network/tcpip/tcpip/info.c b/reactos/drivers/network/tcpip/tcpip/info.c index fb4305c5919..312b94f6fa1 100644 --- a/reactos/drivers/network/tcpip/tcpip/info.c +++ b/reactos/drivers/network/tcpip/tcpip/info.c @@ -98,7 +98,7 @@ TDI_STATUS InfoTdiQueryListEntities(PNDIS_BUFFER Buffer, *BufferSize = Size; TI_DbgPrint(DEBUG_INFO,("BufSize: %d, NeededSize: %d\n", BufSize, Size)); - + if (BufSize < Size) { TcpipReleaseSpinLock( &EntityListLock, OldIrql ); diff --git a/reactos/drivers/network/wshtcpip/wshtcpip.c b/reactos/drivers/network/wshtcpip/wshtcpip.c index 98dea284b2e..406975c7a86 100644 --- a/reactos/drivers/network/wshtcpip/wshtcpip.c +++ b/reactos/drivers/network/wshtcpip/wshtcpip.c @@ -93,7 +93,7 @@ WSHGetProviderGuid( } -/* +/* Document from OSR how WSHGetSockaddrType works http://www.osronline.com/ddkx/network/37wshfun_5lyq.htm */ @@ -106,37 +106,37 @@ WSHGetSockaddrType( OUT PSOCKADDR_INFO SockaddrInfo) { PSOCKADDR_IN ipv4 = (PSOCKADDR_IN)Sockaddr; - + if ((ipv4 != NULL) && (SockaddrLength == sizeof(SOCKADDR_IN)) && (ipv4->sin_family == AF_INET) - && (SockaddrInfo != NULL)) - { - + && (SockaddrInfo != NULL)) + { + switch (ntohl(ipv4->sin_addr.s_addr)) { case INADDR_ANY: SockaddrInfo->AddressInfo = SockaddrAddressInfoWildcard; break; - - case INADDR_BROADCAST: - SockaddrInfo->AddressInfo = SockaddrAddressInfoBroadcast; - break; - - case INADDR_LOOPBACK: - SockaddrInfo->AddressInfo = SockaddrAddressInfoLoopback; - break; - default: + case INADDR_BROADCAST: + SockaddrInfo->AddressInfo = SockaddrAddressInfoBroadcast; + break; + + case INADDR_LOOPBACK: + SockaddrInfo->AddressInfo = SockaddrAddressInfoLoopback; + break; + + default: SockaddrInfo->AddressInfo = SockaddrAddressInfoNormal; - break; + break; } SockaddrInfo->EndpointInfo = SockaddrEndpointInfoNormal; if (ntohs(ipv4->sin_port) == 0) SockaddrInfo->EndpointInfo = SockaddrEndpointInfoWildcard; if (ntohs(ipv4->sin_port) < IPPORT_RESERVED) - SockaddrInfo->EndpointInfo = SockaddrEndpointInfoReserved; + SockaddrInfo->EndpointInfo = SockaddrEndpointInfoReserved; return 0; } @@ -147,7 +147,7 @@ WSHGetSockaddrType( SockaddrInfo->AddressInfo = SockaddrAddressInfoNormal; SockaddrInfo->EndpointInfo = SockaddrEndpointInfoNormal; } - + DPRINT1("Size of Address Family %d \n",SockaddrLength); DPRINT1("FIXME WSHGetSockaddrType return Winsock error, but we do not return any error\n"); diff --git a/reactos/drivers/serial/serenum/misc.c b/reactos/drivers/serial/serenum/misc.c index 1dad6ac1ae6..1b6f1f9cd54 100644 --- a/reactos/drivers/serial/serenum/misc.c +++ b/reactos/drivers/serial/serenum/misc.c @@ -196,7 +196,7 @@ DuplicateUnicodeString( if ((SourceString->Length == 0) - && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | + && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) { DestinationString->Length = 0; diff --git a/reactos/drivers/serial/serial/devctrl.c b/reactos/drivers/serial/serial/devctrl.c index 379b7ac897d..018abc9208e 100644 --- a/reactos/drivers/serial/serial/devctrl.c +++ b/reactos/drivers/serial/serial/devctrl.c @@ -171,11 +171,11 @@ static BOOLEAN SerialGetPerfStats(IN PIRP pIrp) { PSERIAL_DEVICE_EXTENSION pDeviceExtension; - + ASSERT(pIrp); pDeviceExtension = (PSERIAL_DEVICE_EXTENSION) IoGetCurrentIrpStackLocation(pIrp)->DeviceObject->DeviceExtension; - + /* * we assume buffer is big enough to hold SerialPerfStats structure * caller must verify this diff --git a/reactos/drivers/setup/blue/blue.c b/reactos/drivers/setup/blue/blue.c index 2cd7e007ee4..b167f6b7531 100644 --- a/reactos/drivers/setup/blue/blue.c +++ b/reactos/drivers/setup/blue/blue.c @@ -273,7 +273,7 @@ ScrCreate(PDEVICE_OBJECT DeviceObject, NTSTATUS Status; DeviceExtension = DeviceObject->DeviceExtension; - + ScrAcquireOwnership(DeviceExtension); /* get pointer to video memory */ diff --git a/reactos/drivers/storage/class/include/class2.h b/reactos/drivers/storage/class/include/class2.h index 37aa1fa1fdf..77287d327ea 100644 --- a/reactos/drivers/storage/class/include/class2.h +++ b/reactos/drivers/storage/class/include/class2.h @@ -46,35 +46,35 @@ struct _CLASS_INIT_DATA; -typedef VOID +typedef VOID (STDCALL *PCLASS_ERROR)(IN PDEVICE_OBJECT DeviceObject, IN PSCSI_REQUEST_BLOCK Srb, IN OUT NTSTATUS *Status, IN OUT BOOLEAN *Retry); -typedef BOOLEAN +typedef BOOLEAN (STDCALL *PCLASS_DEVICE_CALLBACK)(IN PINQUIRYDATA); -typedef NTSTATUS +typedef NTSTATUS (STDCALL *PCLASS_READ_WRITE)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); -typedef BOOLEAN +typedef BOOLEAN (STDCALL *PCLASS_FIND_DEVICES)(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath, IN struct _CLASS_INIT_DATA *InitializationData, IN PDEVICE_OBJECT PortDeviceObject, IN ULONG PortNumber); -typedef NTSTATUS +typedef NTSTATUS (STDCALL *PCLASS_DEVICE_CONTROL)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); -typedef NTSTATUS +typedef NTSTATUS (STDCALL *PCLASS_SHUTDOWN_FLUSH)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); -typedef NTSTATUS +typedef NTSTATUS (STDCALL *PCLASS_CREATE_CLOSE)(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); diff --git a/reactos/drivers/storage/ide/pciidex/miniport.c b/reactos/drivers/storage/ide/pciidex/miniport.c index f69597fb3ba..81fa8a3a484 100644 --- a/reactos/drivers/storage/ide/pciidex/miniport.c +++ b/reactos/drivers/storage/ide/pciidex/miniport.c @@ -155,7 +155,7 @@ PciIdeXSetBusData( { Status = STATUS_UNSUCCESSFUL; goto cleanup; - } + } BytesWritten = (*FdoDeviceExtension->BusInterface->SetBusData)( FdoDeviceExtension->BusInterface->Context, diff --git a/reactos/drivers/storage/ide/pciidex/misc.c b/reactos/drivers/storage/ide/pciidex/misc.c index aaa73de6996..21eaf8eb866 100644 --- a/reactos/drivers/storage/ide/pciidex/misc.c +++ b/reactos/drivers/storage/ide/pciidex/misc.c @@ -83,7 +83,7 @@ DuplicateUnicodeString( if ((SourceString->Length == 0) - && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | + && (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) { DestinationString->Length = 0; diff --git a/reactos/drivers/storage/ide/uniata/atapi.h b/reactos/drivers/storage/ide/uniata/atapi.h index 0ed576912a0..bbb29c66939 100644 --- a/reactos/drivers/storage/ide/uniata/atapi.h +++ b/reactos/drivers/storage/ide/uniata/atapi.h @@ -84,7 +84,7 @@ ScsiDebugPrint( ... ); -#define PRINT_PREFIX 0, +#define PRINT_PREFIX 0, #define KdPrint2(_x_) {ScsiDebugPrint("%x: ", PsGetCurrentThread()) ; ScsiDebugPrint _x_ ; } #define KdPrint(_x_) ScsiDebugPrint _x_ @@ -112,7 +112,7 @@ DbgPrint( /* #define PRINT_PREFIX_PTR ((PCHAR)&__tmp__kdprint__buff__) #define PRINT_UPREFIX_PTR ((PWCHAR)&__tmp__kdprint__ubuff__) -#define PRINT_PREFIX PRINT_PREFIX_PTR, +#define PRINT_PREFIX PRINT_PREFIX_PTR, #define KdPrint2(_x_) \ { \ WCHAR __tmp__kdprint__ubuff__[256]; \ @@ -233,8 +233,8 @@ typedef struct _IDE_REGISTERS_2 { #define DFLAGS_DWORDIO_ENABLED 0x0400 // Indicates that we should use 32-bit IO #define DFLAGS_WCACHE_ENABLED 0x0800 // Indicates that we use write cache #define DFLAGS_RCACHE_ENABLED 0x1000 // Indicates that we use read cache -#define DFLAGS_ORIG_GEOMETRY 0x2000 // -#define DFLAGS_REINIT_DMA 0x4000 // +#define DFLAGS_ORIG_GEOMETRY 0x2000 // +#define DFLAGS_REINIT_DMA 0x4000 // // // Used to disable 'advanced' features. // @@ -337,12 +337,12 @@ typedef struct _MODE_PARAMETER_HEADER_10 { #define IDE_COMMAND_MEDIA_EJECT 0xED #define IDE_COMMAND_FLUSH_CACHE48 0xEA #define IDE_COMMAND_ENABLE_MEDIA_STATUS 0xEF -#define IDE_COMMAND_SET_FEATURES 0xEF /* features command, +#define IDE_COMMAND_SET_FEATURES 0xEF /* features command, IDE_COMMAND_ENABLE_MEDIA_STATUS */ #define IDE_COMMAND_READ_NATIVE_SIZE 0xF8 #define IDE_COMMAND_SET_NATIVE_SIZE 0xF9 -#define SCSIOP_ATA_PASSTHROUGH 0xCC // +#define SCSIOP_ATA_PASSTHROUGH 0xCC // // // IDE status definitions @@ -554,7 +554,7 @@ typedef struct _IDENTIFY_DATA { USHORT DoubleWordIo; // 60 48 USHORT Reserved62_0:8; // 62 49 - USHORT SupportDma:1; + USHORT SupportDma:1; USHORT SupportLba:1; USHORT DisableIordy:1; USHORT SupportIordy:1; @@ -572,11 +572,11 @@ typedef struct _IDENTIFY_DATA { #define IDENTIFY_CAPABILITIES_SUPPORT_QTAG 0x4000 #define IDENTIFY_CAPABILITIES_SUPPORT_IDMA 0x8000*/ - USHORT DeviceStandbyMin:1; // 64 50 + USHORT DeviceStandbyMin:1; // 64 50 USHORT Reserved50_1:13; USHORT DeviceCapability1:1; USHORT DeviceCapability0:1; -// USHORT Reserved2; +// USHORT Reserved2; UCHAR Vendor51; // 66 51 UCHAR PioCycleTimingMode; // 67 @@ -663,12 +663,12 @@ typedef struct _IDENTIFY_DATA { USHORT Reserved_82_15:1; USHORT Microcode:1; // 83/86 - USHORT Queued:1; // - USHORT CFA:1; // - USHORT APM:1; // - USHORT Notify:1; // - USHORT Standby:1; // - USHORT Spinup:1; // + USHORT Queued:1; // + USHORT CFA:1; // + USHORT APM:1; // + USHORT Notify:1; // + USHORT Standby:1; // + USHORT Spinup:1; // USHORT Reserver_83_7:1; USHORT MaxSecurity:1; // USHORT AutoAcoustic:1; // @@ -692,7 +692,7 @@ typedef struct _IDENTIFY_DATA { USHORT UltraDMASupport : 8; // 88 USHORT UltraDMAActive : 8; - + USHORT EraseTime; // 89 USHORT EnhancedEraseTime; // 90 USHORT CurentAPMLevel; // 91 @@ -728,9 +728,9 @@ typedef struct _IDENTIFY_DATA { USHORT Reserved107[10]; // 107-116 ULONG LargeSectorSize; // 117-118 - + USHORT Reserved117[8]; // 119-126 - + USHORT RemovableStatus; // 127 USHORT SecurityStatus; // 128 @@ -760,7 +760,7 @@ typedef struct _IDENTIFY_DATA { UCHAR :1; UCHAR CmdProtocol:2; // 00 00 // USHORT GeneralConfiguration; // 00 - + USHORT NumberOfCylinders; // 02 USHORT Reserved1; // 04 USHORT NumberOfHeads; // 06 @@ -1110,7 +1110,7 @@ AtaCommand( IN UCHAR command, IN USHORT cylinder, IN UCHAR head, - IN UCHAR sector, + IN UCHAR sector, IN UCHAR count, IN UCHAR feature, IN ULONG flags @@ -1132,7 +1132,7 @@ AtapiDpcDispatch( IN PVOID SystemArgument1, IN PVOID SystemArgument2 ); - + //#define AtaCommand(de, devn, chan, cmd, cyl, hd, sec, cnt, feat, flg) diff --git a/reactos/drivers/storage/ide/uniata/bm_devs.h b/reactos/drivers/storage/ide/uniata/bm_devs.h index 2ba12f75ec1..b630d66bdbf 100644 --- a/reactos/drivers/storage/ide/uniata/bm_devs.h +++ b/reactos/drivers/storage/ide/uniata/bm_devs.h @@ -64,12 +64,12 @@ Revision History: #define ATA_UDMA 0x40 #define ATA_UDMA0 0x40 // ATA-16 -#define ATA_UDMA1 0x41 // ATA-25 -#define ATA_UDMA2 0x42 // ATA-33 +#define ATA_UDMA1 0x41 // ATA-25 +#define ATA_UDMA2 0x42 // ATA-33 #define ATA_UDMA3 0x43 // ATA-44 -#define ATA_UDMA4 0x44 // ATA-66 -#define ATA_UDMA5 0x45 // ATA-100 -#define ATA_UDMA6 0x46 // ATA-133 +#define ATA_UDMA4 0x44 // ATA-66 +#define ATA_UDMA5 0x45 // ATA-100 +#define ATA_UDMA6 0x46 // ATA-133 //#define ATA_UDMA7 0x47 // ATA-166 #define ATA_SA150 0x47 /*0x80*/ @@ -444,7 +444,7 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 0007, 1191, 0x00, ATA_UDMA4, "Acard ATP860R" , 0 ), PCI_DEV_HW_SPEC_BM( 0008, 1191, 0x00, ATA_UDMA6, "Acard ATP865A" , 0 ), PCI_DEV_HW_SPEC_BM( 0009, 1191, 0x00, ATA_UDMA6, "Acard ATP865R" , 0 ), - + PCI_DEV_HW_SPEC_BM( 5289, 10b9, 0x00, ATA_SA150, "ALI M5289" , UNIATA_SATA | UNIATA_NO_SLAVE ), PCI_DEV_HW_SPEC_BM( 5288, 10b9, 0x00, ATA_SA300, "ALI M5288" , UNIATA_SATA | UNIATA_NO_SLAVE ), PCI_DEV_HW_SPEC_BM( 5287, 10b9, 0x00, ATA_SA150, "ALI M5287" , UNIATA_SATA | UNIATA_NO_SLAVE ), @@ -521,7 +521,7 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 2829, 8086, 0x00, ATA_SA300, "Intel ICH8M" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 282a, 8086, 0x00, ATA_SA300, "Intel ICH8M" , UNIATA_SATA | UNIATA_AHCI ), // PCI_DEV_HW_SPEC_BM( 3200, 8086, 0x00, ATA_SA150, "Intel 31244" , UNIATA_SATA ), - + PCI_DEV_HW_SPEC_BM( 01bc, 10de, 0x00, ATA_UDMA5, "nVidia nForce" , AMDNVIDIA ), PCI_DEV_HW_SPEC_BM( 0065, 10de, 0x00, ATA_UDMA6, "nVidia nForce2" , AMDNVIDIA ), PCI_DEV_HW_SPEC_BM( 0085, 10de, 0x00, ATA_UDMA6, "nVidia nForce2 Pro",AMDNVIDIA ), @@ -583,7 +583,7 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 0240, 1166, 0x00, ATA_SA150, "ServerWorks K2" , SWKSMIO ), PCI_DEV_HW_SPEC_BM( 0241, 1166, 0x00, ATA_SA150, "ServerWorks Frodo4" , SWKSMIO ), PCI_DEV_HW_SPEC_BM( 0242, 1166, 0x00, ATA_SA150, "ServerWorks Frodo8" , SWKSMIO ), - + PCI_DEV_HW_SPEC_BM( 3114, 1095, 0x00, ATA_SA150, "SiI 3114" , SIIMIO | SII4CH | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 3512, 1095, 0x02, ATA_SA150, "SiI 3512" , SIIMIO | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 3112, 1095, 0x02, ATA_SA150, "SiI 3112" , SIIMIO | UNIATA_SATA ), @@ -627,7 +627,7 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 0630, 1039, 0x00, ATA_UDMA5, "SiS 630S" , SIS100OLD ), PCI_DEV_HW_SPEC_BM( 0630, 1039, 0x00, ATA_UDMA4, "SiS 630" , SIS66, ), PCI_DEV_HW_SPEC_BM( 0620, 1039, 0x00, ATA_UDMA4, "SiS 620" , SIS66, ), - + PCI_DEV_HW_SPEC_BM( 0550, 1039, 0x00, ATA_UDMA5, "SiS 550" , SIS66, ), PCI_DEV_HW_SPEC_BM( 0540, 1039, 0x00, ATA_UDMA4, "SiS 540" , SIS66, ), PCI_DEV_HW_SPEC_BM( 0530, 1039, 0x00, ATA_UDMA4, "SiS 530" , SIS66, ), @@ -657,26 +657,26 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 3249, 1106, 0x00, ATA_SA150, "VIA 6421" , VIABAR | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 0591, 1106, 0x00, ATA_SA150, "VIA 8237A" , 0 | UNIATA_SATA ), //PCI_DEV_HW_SPEC_BM( 3349, 1106, 0x00, ATA_SA150, "VIA 8251" , VIAAHCI| UNIATA_SATA ), - + PCI_DEV_HW_SPEC_BM( c693, 1080, 0x00, ATA_WDMA2, "Cypress 82C693" ,0 ), - -/* + +/* PCI_DEV_HW_SPEC_BM( 4d68, 105a, 0, 0, "Promise TX2 ATA-100 controller", UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 6268, 105a, 0, 0, "Promise TX2 ATA-100 controller", UNIATA_RAID_CONTROLLER), - + PCI_DEV_HW_SPEC_BM( 4d69, 105a, 0, 0, "Promise TX2 ATA-133 controller", UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 5275, 105a, 0, 0, "Promise TX2 ATA-133 controller", UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 6269, 105a, 0, 0, "Promise TX2 ATA-133 controller", UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 7275, 105a, 0, 0, "Promise TX2 ATA-133 controller", UNIATA_RAID_CONTROLLER), - + PCI_DEV_HW_SPEC_BM( 4d33, 105a, 0, 0, "Promise Ultra/FastTrak-33 controller", UNIATA_RAID_CONTROLLER), - + PCI_DEV_HW_SPEC_BM( 0d38, 105a, 0, 0, "Promise FastTrak 66 controller", 0), PCI_DEV_HW_SPEC_BM( 4d38, 105a, 0, 0, "Promise Ultra/FastTrak-66 controller", UNIATA_RAID_CONTROLLER), - + PCI_DEV_HW_SPEC_BM( 4d30, 105a, 0, 0, "Promise Ultra/FastTrak-100 controller", UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 0d30, 105a, 0, 0, "Promise OEM ATA-100 controllers", UNIATA_RAID_CONTROLLER), - + PCI_DEV_HW_SPEC_BM( 0004, 1103, 0, 0, "HighPoint HPT366/368/370/372 controller", UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 0005, 1103, 0, 0, "HighPoint HPT372 controller", UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 0008, 1103, 0, 0, "HighPoint HPT374 controller", UNIATA_RAID_CONTROLLER), @@ -684,7 +684,7 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 0001, 16ca, 0x00, ATA_WDMA2, "Cenatek Rocket Drive",0 ), PCI_DEV_HW_SPEC_BM( 0102, 1078, 0x00, ATA_UDMA2, "Cyrix 5530" , 0 ), - + PCI_DEV_HW_SPEC_BM( 0102, 1042, 0x00, ATA_PIO4, "RZ 100x" , 0 ), PCI_DEV_HW_SPEC_BM( 8172, 1283, 0x00, ATA_UDMA2, "IT8172" , 0 ), diff --git a/reactos/drivers/storage/ide/uniata/bsmaster.h b/reactos/drivers/storage/ide/uniata/bsmaster.h index 48d022c8f12..fd5b6746fe4 100644 --- a/reactos/drivers/storage/ide/uniata/bsmaster.h +++ b/reactos/drivers/storage/ide/uniata/bsmaster.h @@ -906,7 +906,7 @@ typedef struct _HW_DEVICE_EXTENSION { BOOLEAN opt_AtapiDmaZeroTransfer; // default FALSE BOOLEAN opt_AtapiDmaControlCmd; // default FALSE BOOLEAN opt_AtapiDmaRawRead; // default TRUE - BOOLEAN opt_AtapiDmaReadWrite; // default TRUE + BOOLEAN opt_AtapiDmaReadWrite; // default TRUE } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION; @@ -951,7 +951,7 @@ UniataDisconnectIntr2( IN PVOID HwDeviceExtension ); -extern ULONG +extern ULONG ScsiPortGetBusDataByOffset( IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, diff --git a/reactos/drivers/storage/ide/uniata/id_ata.cpp b/reactos/drivers/storage/ide/uniata/id_ata.cpp index 27e6e9afc0f..02c1e700f05 100644 --- a/reactos/drivers/storage/ide/uniata/id_ata.cpp +++ b/reactos/drivers/storage/ide/uniata/id_ata.cpp @@ -49,7 +49,7 @@ Revision History: 7. XP support (binary compatibility) 8. Serial ATA (SATA/SATA2) support 9. NT 3.51 support (binary compatibility) - + etc. (See todo.txt) @@ -171,7 +171,7 @@ AtapiRegGetStringParameterValue( IN ULONG MaxLen ) { -#define ITEMS_TO_QUERY 2 // always 1 greater than what is searched +#define ITEMS_TO_QUERY 2 // always 1 greater than what is searched NTSTATUS status; RTL_QUERY_REGISTRY_TABLE parameters[ITEMS_TO_QUERY]; UNICODE_STRING ustr; @@ -739,7 +739,7 @@ AtaCommand48( } else { chan->ChannelCtrlFlags &= ~CTRFLAGS_LBA48; - + //if(feature || // (deviceExtension->lun[ldev].DeviceFlags & (DFLAGS_ATAPI_DEVICE | DFLAGS_TAPE_DEVICE | DFLAGS_LBA_ENABLED))) { AtapiWritePort1(chan, IDX_IO1_o_Feature, (UCHAR)feature); @@ -847,14 +847,14 @@ AtaCommand( IN UCHAR command, IN USHORT cylinder, IN UCHAR head, - IN UCHAR sector, + IN UCHAR sector, IN UCHAR count, IN UCHAR feature, IN ULONG flags ) { return AtaCommand48(deviceExtension, DeviceNumber, lChannel, - command, + command, (ULONG)sector | ((ULONG)cylinder << 8) | ((ULONG)(head & 0x0f) << 24), count, feature, flags); } // end AtaCommand() @@ -881,16 +881,16 @@ AtaPioMode(PIDENTIFY_DATA2 ident) return 5; if (ident->AdvancedPIOModes & AdvancedPIOModes_4) return 4; - if (ident->AdvancedPIOModes & AdvancedPIOModes_3) + if (ident->AdvancedPIOModes & AdvancedPIOModes_3) return 3; - } + } if (ident->PioCycleTimingMode == 2) return 2; if (ident->PioCycleTimingMode == 1) return 1; if (ident->PioCycleTimingMode == 0) return 0; - return -1; + return -1; } // end AtaPioMode() LONG @@ -1084,7 +1084,7 @@ UniataDumpATARegs( for(j=1; jRegTranslation[IDX_IO1+j].Addr, @@ -1092,7 +1092,7 @@ UniataDumpATARegs( } for(j=0; jRegTranslation[IDX_BM_IO+j].Addr, @@ -1299,7 +1299,7 @@ IssueIdentify( KdPrint2((PRINT_PREFIX "IssueIdentify: BASE statusByte %#x\n", statusByte)); if (atapiDev || !(LunExt->DeviceFlags & DFLAGS_DWORDIO_ENABLED) /*!deviceExtension->DWordIO*/) { - + KdPrint2((PRINT_PREFIX " use 16bit IO\n")); #if 0 USHORT w; @@ -1307,20 +1307,20 @@ IssueIdentify( // ATI/SII chipsets with memory-mapped IO hangs when // I call ReadBuffer(), probably due to PCI burst/prefetch enabled // Unfortunately, I don't know yet how to workaround it except the way you see below. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX " IO_%#x (%#x), %s:\n", IDX_IO1_i_Data, chan->RegTranslation[IDX_IO1_i_Data].Addr, chan->RegTranslation[IDX_IO1_i_Data].MemIo ? "Mem" : "IO")); for(i=0; i<256; i++) { /* - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX " IO_%#x (%#x):\n", IDX_IO1_i_Data, chan->RegTranslation[IDX_IO1_i_Data].Addr)); */ w = AtapiReadPort2(chan, IDX_IO1_i_Data); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX " %x\n", w)); AtapiStallExecution(1); ((PUSHORT)&deviceExtension->FullIdentifyData)[i] = w; @@ -1383,7 +1383,7 @@ IssueIdentify( ULONGLONG cylinders=0; ULONGLONG tmp_cylinders=0; // Read very-old-style drive geometry - KdPrint2((PRINT_PREFIX "CHS %#x:%#x:%#x\n", + KdPrint2((PRINT_PREFIX "CHS %#x:%#x:%#x\n", deviceExtension->FullIdentifyData.NumberOfCylinders, deviceExtension->FullIdentifyData.NumberOfHeads, deviceExtension->FullIdentifyData.SectorsPerTrack @@ -1397,7 +1397,7 @@ IssueIdentify( /* (deviceExtension->FullIdentifyData.TranslationFieldsValid) &&*/ (NumOfSectors < deviceExtension->FullIdentifyData.UserAddressableSectors)) { KdPrint2((PRINT_PREFIX "NumberOfCylinders == 0x3fff\n")); - cylinders = + cylinders = (deviceExtension->FullIdentifyData.UserAddressableSectors / (deviceExtension->FullIdentifyData.NumberOfHeads * deviceExtension->FullIdentifyData.SectorsPerTrack)); @@ -1435,13 +1435,13 @@ IssueIdentify( (deviceExtension->FullIdentifyData.UserAddressableSectors48 > NumOfSectors) ) { KdPrint2((PRINT_PREFIX "LBA48\n")); - cylinders = + cylinders = (deviceExtension->FullIdentifyData.UserAddressableSectors48 / (deviceExtension->FullIdentifyData.NumberOfHeads * deviceExtension->FullIdentifyData.SectorsPerTrack)); KdPrint2((PRINT_PREFIX "cylinders %#I64x\n", cylinders)); - + NativeNumOfSectors = cylinders * deviceExtension->FullIdentifyData.NumberOfHeads * deviceExtension->FullIdentifyData.SectorsPerTrack; @@ -1473,7 +1473,7 @@ IssueIdentify( KdPrint2((PRINT_PREFIX "Read high order bytes\n")); NativeNumOfSectors |= ((ULONG)AtapiReadPort1(chan, IDX_IO1_i_BlockNumber) << 24 ); - hNativeNumOfSectors= + hNativeNumOfSectors= (ULONG)AtapiReadPort1(chan, IDX_IO1_i_CylinderLow) | ((ULONG)AtapiReadPort1(chan, IDX_IO1_i_CylinderHigh) << 8) ; ((PULONG)&NativeNumOfSectors)[1] = hNativeNumOfSectors; @@ -1496,7 +1496,7 @@ IssueIdentify( ((ULONGLONG)AtapiReadPort1(chan, IDX_IO1_i_CylinderLow) << 8 ) | ((ULONGLONG)AtapiReadPort1(chan, IDX_IO1_i_CylinderLow) << 32) | ((ULONGLONG)AtapiReadPort1(chan, IDX_IO1_i_CylinderHigh) << 16) | - ((ULONGLONG)AtapiReadPort1(chan, IDX_IO1_i_CylinderHigh) << 40) + ((ULONGLONG)AtapiReadPort1(chan, IDX_IO1_i_CylinderHigh) << 40) ; } @@ -1520,7 +1520,7 @@ IssueIdentify( } } } - + if(NumOfSectors < 0x2100000 /*&& NumOfSectors > 31*1000*1000*/) { // check for native LBA size // some drives report ~32Gb in Identify Block @@ -1880,7 +1880,7 @@ AtapiResetController__( // Indicate ready for next request. ScsiPortNotification(NextLuRequest, - deviceExtension, + deviceExtension, PathId, TargetId, Lun); @@ -1899,7 +1899,7 @@ AtapiResetController__( chan->ChannelCtrlFlags = 0; InterlockedExchange(&(chan->CheckIntr), CHECK_INTR_IDLE); - + // Reset controller KdPrint2((PRINT_PREFIX " disable intr (0)\n")); AtapiDisableInterrupts(deviceExtension, j); @@ -2029,7 +2029,7 @@ default_reset: statusByte = WaitOnBusyLong(chan); statusByte = UniataIsIdle(deviceExtension, statusByte); if(statusByte == 0xff) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "no drive, status %#x\n", statusByte)); deviceExtension->lun[i + (j * 2)].DeviceFlags = 0; @@ -2054,7 +2054,7 @@ default_reset: IDE_COMMAND_ATAPI_IDENTIFY, FALSE); } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiResetController: Status after soft reset %#x\n", statusByte)); } @@ -2134,7 +2134,7 @@ MapError( // Read the error register. errorByte = AtapiReadPort1(chan, IDX_IO1_i_Error); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "MapError: Error register is %#x\n", errorByte)); @@ -2143,7 +2143,7 @@ MapError( switch (errorByte >> 4) { case SCSI_SENSE_NO_SENSE: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: No sense information\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2151,7 +2151,7 @@ MapError( case SCSI_SENSE_RECOVERED_ERROR: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Recovered error\n")); scsiStatus = 0; srbStatus = SRB_STATUS_SUCCESS; @@ -2159,7 +2159,7 @@ MapError( case SCSI_SENSE_NOT_READY: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Device not ready\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2167,7 +2167,7 @@ MapError( case SCSI_SENSE_MEDIUM_ERROR: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Media error\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2175,7 +2175,7 @@ MapError( case SCSI_SENSE_HARDWARE_ERROR: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Hardware error\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2183,7 +2183,7 @@ MapError( case SCSI_SENSE_ILLEGAL_REQUEST: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Illegal request\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2191,7 +2191,7 @@ MapError( case SCSI_SENSE_UNIT_ATTENTION: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Unit attention\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2199,7 +2199,7 @@ MapError( case SCSI_SENSE_DATA_PROTECT: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Data protect\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2207,14 +2207,14 @@ MapError( case SCSI_SENSE_BLANK_CHECK: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Blank check\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; break; case SCSI_SENSE_ABORTED_COMMAND: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "Atapi: Command Aborted\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2222,7 +2222,7 @@ MapError( default: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ATAPI: Invalid sense information\n")); scsiStatus = 0; srbStatus = SRB_STATUS_ERROR; @@ -2237,7 +2237,7 @@ MapError( chan->ReturningMediaStatus = errorByte; if (errorByte & IDE_ERROR_MEDIA_CHANGE_REQ) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: Media change\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2257,7 +2257,7 @@ MapError( } } else if (errorByte & IDE_ERROR_COMMAND_ABORTED) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: Command abort\n")); srbStatus = SRB_STATUS_ABORTED; scsiStatus = SCSISTAT_CHECK_CONDITION; @@ -2280,7 +2280,7 @@ MapError( } else if (errorByte & IDE_ERROR_END_OF_MEDIA) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: End of media\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2306,7 +2306,7 @@ MapError( } else if (errorByte & IDE_ERROR_ILLEGAL_LENGTH) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: Illegal length\n")); srbStatus = SRB_STATUS_INVALID_REQUEST; @@ -2327,7 +2327,7 @@ MapError( } else if (errorByte & IDE_ERROR_BAD_BLOCK) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: Bad block\n")); srbStatus = SRB_STATUS_ERROR; scsiStatus = SCSISTAT_CHECK_CONDITION; @@ -2347,7 +2347,7 @@ MapError( } else if (errorByte & IDE_ERROR_ID_NOT_FOUND) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: Id not found\n")); srbStatus = SRB_STATUS_ERROR; scsiStatus = SCSISTAT_CHECK_CONDITION; @@ -2370,7 +2370,7 @@ MapError( } else if (errorByte & IDE_ERROR_MEDIA_CHANGE) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: Media change\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2391,7 +2391,7 @@ MapError( } else if (errorByte & IDE_ERROR_DATA_ERROR) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IDE: Data error\n")); scsiStatus = SCSISTAT_CHECK_CONDITION; srbStatus = SRB_STATUS_ERROR; @@ -2419,18 +2419,18 @@ MapError( if (deviceExtension->lun[ldev].ErrorCount >= MAX_ERRORS) { // deviceExtension->DWordIO = FALSE; - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "MapError: ErrorCount >= MAX_ERRORS\n")); deviceExtension->lun[ldev].DeviceFlags &= ~DFLAGS_DWORDIO_ENABLED; deviceExtension->lun[ldev].MaximumBlockXfer = 0; BrutePoint(); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "MapError: Disabling 32-bit PIO and Multi-sector IOs\n")); // Log the error. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ScsiPortLogError: devExt %#x, Srb %#x, P:T:D=%d:%d:%d, MsgId %#x (%d)\n", HwDeviceExtension, Srb, @@ -2580,7 +2580,7 @@ AtapiHwInitialize__( LunExt->MaximumBlockXfer = 0; } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiHwInitialize: Using Multiblock on Device %d. Blocks / int - %d\n", i, LunExt->MaximumBlockXfer)); @@ -2588,7 +2588,7 @@ AtapiHwInitialize__( } if(LunExt->IdentifyData.MajorRevision) { - + if(LunExt->opt_ReadCacheEnable) { KdPrint2((PRINT_PREFIX " Try Enable Read Cache\n")); // If supported, setup read/write cacheing @@ -2598,7 +2598,7 @@ AtapiHwInitialize__( // Check for errors. if (statusByte & IDE_STATUS_ERROR) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiHwInitialize: Enable read/write cacheing on Device %d failed\n", i)); LunExt->DeviceFlags &= ~DFLAGS_RCACHE_ENABLED; @@ -2620,7 +2620,7 @@ AtapiHwInitialize__( 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_BASE_READY); // Check for errors. if (statusByte & IDE_STATUS_ERROR) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiHwInitialize: Enable write cacheing on Device %d failed\n", i)); LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; @@ -3000,7 +3000,7 @@ AtapiCallBack__( // Ask for next request. ScsiPortNotification(NextLuRequest, - deviceExtension, + deviceExtension, PathId, TargetId, Lun); @@ -3113,7 +3113,7 @@ AtapiInterrupt( for(_c=0; _cNumberChannels; _c++) { checked[_c] = FALSE; } -// fc = +// fc = // atapiDev = (deviceExtension->lun[ldev].DeviceFlags & DFLAGS_ATAPI_DEVICE) ? TRUE : FALSE; for(pass=0; pass<2; pass++) { for(_c=0; _cNumberChannels; _c++) { @@ -3279,7 +3279,7 @@ AtapiInterrupt2( } KdPrint2((PRINT_PREFIX "AtapiInterrupt2: return %d\n", status)); return status; - + } // end AtapiInterrupt2() RETTYPE_XXableInterrupts @@ -3301,7 +3301,7 @@ AtapiInterruptDpc( CHECK_INTR_DETECTED) != CHECK_INTR_DETECTED) { continue; } - + } else { deviceExtension->chan[c].ChannelCtrlFlags &= ~CTRFLAGS_DPC_REQ; } @@ -3495,7 +3495,7 @@ AtapiCheckInterrupt__( status = AtapiReadPortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x1c); if (!DmaTransfer) break; - if (!(status & + if (!(status & ((Channel) ? 0x00004000 : 0x00000400))) { KdPrint2((PRINT_PREFIX " Promise old/new unexpected\n")); return FALSE; @@ -3693,7 +3693,7 @@ skip_dma_stat_check: KdPrint2((PRINT_PREFIX " status %#x\n", statusByte)); if (statusByte == 0xff) { // interrupt from empty controller ? - } else + } else if (statusByte & IDE_STATUS_BUSY) { if(!chan->ExpectingInterrupt) { KdPrint2((PRINT_PREFIX " unexpected intr + BUSY\n")); @@ -3747,7 +3747,7 @@ skip_dma_stat_check: KdPrint2((PRINT_PREFIX " base status %#x\n", statusByte)); if (statusByte == 0xff) { // interrupt from empty controller ? - } else + } else if(!(statusByte & (IDE_STATUS_DRQ | IDE_STATUS_DRDY))) { KdPrint2((PRINT_PREFIX " no DRQ/DRDY set\n")); return OurInterrupt; @@ -3855,9 +3855,9 @@ AtapiInterrupt__( } if (srb) { - PathId = srb->PathId; + PathId = srb->PathId; TargetId = srb->TargetId; - Lun = srb->Lun; + Lun = srb->Lun; } else { PathId = (UCHAR)c; TargetId = @@ -4028,7 +4028,7 @@ ServiceInterrupt: KdPrint2((PRINT_PREFIX " operate like in DPC\n")); InDpc = TRUE; } - + if (!atapiDev) { // IDE if (statusByte & IDE_STATUS_BUSY) { @@ -4065,10 +4065,10 @@ try_dpc_wait: AtapiStallExecution(TimerValue); goto ServiceInterrupt; #endif //UNIATA_CORE - } else + } else if (InDpc && i == k) { // reset the controller. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX " Resetting due to BUSY on entry - %#x.\n", statusByte)); goto IntrPrepareResetController; @@ -4363,7 +4363,7 @@ IntrPrepareResetController: KdPrint2((PRINT_PREFIX "AtapiInterrupt: get W wordCount %#x\n", wordCount)); if (wordCount != AtaReq->WordsLeft) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiInterrupt: %d words requested; %d words xferred\n", AtaReq->WordsLeft, wordCount)); @@ -4372,7 +4372,7 @@ IntrPrepareResetController: // Verify this makes sense. if (wordCount > AtaReq->WordsLeft) { wordCount = AtaReq->WordsLeft; - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiInterrupt: Write underrun\n")); DataOverrun = TRUE; } @@ -4402,7 +4402,7 @@ IntrPrepareResetController: // Ensure that this is a write command. if (srb->SrbFlags & SRB_FLAGS_DATA_OUT) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiInterrupt: Write interrupt\n")); statusByte = WaitOnBusy(chan); @@ -4422,7 +4422,7 @@ IntrPrepareResetController: } } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiInterrupt: Int reason %#x, but srb is for a write %#x.\n", interruptReason, srb)); @@ -4457,7 +4457,7 @@ IntrPrepareResetController: KdPrint2((PRINT_PREFIX "AtapiInterrupt: get R wordCount %#x\n", wordCount)); if (wordCount != AtaReq->WordsLeft) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiInterrupt: %d words requested; %d words xferred\n", AtaReq->WordsLeft, wordCount)); @@ -4500,7 +4500,7 @@ IntrPrepareResetController: statusByte = WaitOnBusy(chan); if (atapiDev || !(LunExt->DeviceFlags & DFLAGS_DWORDIO_ENABLED) /*!deviceExtension->DWordIO*/) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeIntr: Read %#x words\n", wordCount)); ReadBuffer(chan, @@ -4519,7 +4519,7 @@ IntrPrepareResetController: } } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeIntr: Read %#x Dwords\n", wordCount/2)); ReadBuffer2(chan, @@ -4529,7 +4529,7 @@ IntrPrepareResetController: } } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiInterrupt: Int reason %#x, but srb is for a read %#x.\n", interruptReason, srb)); @@ -4826,7 +4826,7 @@ PIO_wait_busy: if (i == 5*30) { // reset the controller. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiInterrupt: Resetting due to BSY still up - %#x.\n", statusByte)); goto IntrPrepareResetController; @@ -5007,7 +5007,7 @@ IntrCompleteReq: KdPrint2((PRINT_PREFIX "AtapiInterrupt: Clear RDP\n")); chan->RDP = FALSE; goto CompleteRDP; - } + } AtapiStallExecution(50); } } @@ -5039,7 +5039,7 @@ reenqueue_req: NULL); } else { ScsiPortNotification(NextLuRequest, - deviceExtension, + deviceExtension, PathId, TargetId, Lun); @@ -5151,7 +5151,7 @@ IdeSendSmartCommand( if (regs->bCommandReg != SMART_CMD) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendSmartCommand: bCommandReg != SMART_CMD\n")); return SRB_STATUS_INVALID_REQUEST; } @@ -5175,7 +5175,7 @@ IdeSendSmartCommand( statusByte = WaitOnBusy(chan); if (statusByte & IDE_STATUS_BUSY) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendSmartCommand: Returning BUSY status\n")); return SRB_STATUS_BUSY; } @@ -5212,7 +5212,7 @@ IdeSendSmartCommand( statusByte = WaitOnBusy(chan); if (statusByte & IDE_STATUS_BUSY) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendSmartCommand: Returning BUSY status\n")); return SRB_STATUS_BUSY; } @@ -5268,7 +5268,7 @@ UniAtaCalculateLBARegs( sectorNumber = 1; } else { cylinder = (USHORT)(startingSector / tmp); - drvSelect = (UCHAR)((startingSector % tmp) / LunExt->IdentifyData.SectorsPerTrack); + drvSelect = (UCHAR)((startingSector % tmp) / LunExt->IdentifyData.SectorsPerTrack); sectorNumber = (UCHAR)(startingSector % LunExt->IdentifyData.SectorsPerTrack) + 1; } @@ -5471,7 +5471,7 @@ IdeReadWrite( if (!(statusByte & IDE_STATUS_DRQ)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeReadWrite: DRQ never asserted (%#x)\n", statusByte)); @@ -5494,7 +5494,7 @@ IdeReadWrite( // Write next DEV_BSIZE/2*N words. if (!(LunExt->DeviceFlags & DFLAGS_DWORDIO_ENABLED)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeReadWrite: Write %#x words\n", wordCount)); WriteBuffer(chan, @@ -5504,7 +5504,7 @@ IdeReadWrite( } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeReadWrite: Write %#x Dwords\n", wordCount/2)); WriteBuffer2(chan, @@ -5564,7 +5564,7 @@ IdeVerify( LunExt->IdentifyData.NumberOfCylinders; } - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeVerify: Total sectors %#x\n", sectors)); @@ -5572,21 +5572,21 @@ IdeVerify( MOV_DD_SWP(startingSector, ((PCDB)Srb->Cdb)->CDB10.LBA); MOV_DW_SWP(sectorCount, ((PCDB)Srb->Cdb)->CDB10.TransferBlocks); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeVerify: Starting sector %#x. Number of blocks %#x\n", startingSector, sectorCount)); endSector = startingSector + sectorCount; - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeVerify: Ending sector %#x\n", endSector)); if (endSector > sectors) { // Too big, round down. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeVerify: Truncating request to %#x blocks\n", sectors - startingSector - 1)); @@ -5839,7 +5839,7 @@ call_dma_setup: } else { KdPrint2((PRINT_PREFIX "AtapiSendCommand: zero transfer, no DMA setup\n")); } - + } else { if(AtaReq->Flags & REQ_FLAG_DMA_OPERATION) { // if this is queued request, reinit DMA and check @@ -5898,7 +5898,7 @@ call_dma_setup: if(AtaReq->Flags & REQ_FLAG_DMA_OPERATION) { KdPrint2((PRINT_PREFIX " REQ_FLAG_DMA_OPERATION\n")); } - + KdPrint2((PRINT_PREFIX "AtapiSendCommand: CMD_ACTION_EXEC\n")); #ifndef UNIATA_CORE @@ -5942,7 +5942,7 @@ call_dma_setup: KdPrint2((PRINT_PREFIX "AtapiSendCommand: Command %#x to TargetId %d lun %d\n", Srb->Cdb[0], Srb->TargetId, Srb->Lun)); - + // Make sure command is to ATAPI device. flags = deviceExtension->lun[ldev].DeviceFlags; if (flags & (DFLAGS_SANYO_ATAPI_CHANGER | DFLAGS_ATAPI_CHANGER)) { @@ -6279,7 +6279,7 @@ IdeSendCommand( switch (Srb->Cdb[0]) { case SCSIOP_INQUIRY: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_INQUIRY PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); // Filter out all TIDs but 0 and 1 since this is an IDE interface @@ -6289,7 +6289,7 @@ IdeSendCommand( (Srb->TargetId > 2) /*|| (!deviceExtension->lun[ldev].DeviceFlags & DFLAGS_DEVICE_PRESENT)*/) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_INQUIRY rejected\n")); // Indicate no device found at this address. status = SRB_STATUS_SELECTION_TIMEOUT; @@ -6297,15 +6297,15 @@ IdeSendCommand( } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_INQUIRY ok\n")); PINQUIRYDATA inquiryData = (PINQUIRYDATA)(Srb->DataBuffer); PIDENTIFY_DATA2 identifyData = &(deviceExtension->lun[ldev].IdentifyData); if (!(deviceExtension->lun[ldev].DeviceFlags & DFLAGS_DEVICE_PRESENT)) { - + if(!CheckDevice(HwDeviceExtension, lChannel, ldev & 1, FALSE)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_INQUIRY rejected (2)\n")); // Indicate no device found at this address. status = SRB_STATUS_SELECTION_TIMEOUT; @@ -6313,7 +6313,7 @@ IdeSendCommand( } } else { if(!UniataAnybodyHome(HwDeviceExtension, lChannel, ldev & 1)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_INQUIRY device have gone\n")); // Indicate no device found at this address. deviceExtension->lun[ldev].DeviceFlags &= ~DFLAGS_DEVICE_PRESENT; @@ -6330,14 +6330,14 @@ IdeSendCommand( // Set the removable bit, if applicable. if (deviceExtension->lun[ldev].DeviceFlags & DFLAGS_REMOVABLE_DRIVE) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "RemovableMedia\n")); inquiryData->RemovableMedia = 1; } // Set the Relative Addressing (LBA) bit, if applicable. if (deviceExtension->lun[ldev].DeviceFlags & DFLAGS_LBA_ENABLED) { inquiryData->RelativeAddressing = 1; - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "RelativeAddressing\n")); } // Set the CommandQueue bit @@ -6366,7 +6366,7 @@ IdeSendCommand( case SCSIOP_MODE_SENSE: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_MODE_SENSE PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); // This is used to determine if the media is write-protected. @@ -6414,7 +6414,7 @@ IdeSendCommand( case SCSIOP_TEST_UNIT_READY: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_TEST_UNIT_READY PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); if (deviceExtension->lun[ldev].DeviceFlags & DFLAGS_MEDIA_STATUS_ENABLED) { @@ -6461,7 +6461,7 @@ IdeSendCommand( case SCSIOP_READ_CAPACITY: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "** IdeSendCommand: SCSIOP_READ_CAPACITY PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); // Claim 512 byte blocks (big-endian). @@ -6483,7 +6483,7 @@ IdeSendCommand( MOV_DD_SWP( ((PREAD_CAPACITY_DATA)Srb->DataBuffer)->LogicalBlockAddress, i ); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "** IDE disk %#x - #sectors %#x, #heads %#x, #cylinders %#x\n", Srb->TargetId, deviceExtension->lun[ldev].IdentifyData.SectorsPerTrack, @@ -6496,7 +6496,7 @@ IdeSendCommand( case SCSIOP_VERIFY: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_VERIFY PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); status = IdeVerify(HwDeviceExtension,Srb); @@ -6506,7 +6506,7 @@ IdeSendCommand( case SCSIOP_READ: case SCSIOP_WRITE: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_READ/SCSIOP_WRITE PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); AtaReq->Flags &= ~REQ_FLAG_RW_MASK; @@ -6517,7 +6517,7 @@ IdeSendCommand( case SCSIOP_START_STOP_UNIT: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_START_STOP_UNIT PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); //Determine what type of operation we should perform @@ -6569,7 +6569,7 @@ IdeSendCommand( // this function makes sense buffers to report the results // of the original GET_MEDIA_STATUS command - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_REQUEST_SENSE PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); if (deviceExtension->lun[ldev].DeviceFlags & DFLAGS_MEDIA_STATUS_ENABLED) { @@ -6585,7 +6585,7 @@ IdeSendCommand( PIDEREGS_EX regs; BOOLEAN use_dma = FALSE; ULONG to_lim; - + regs = (PIDEREGS_EX) &(Srb->Cdb[2]); lChannel = Srb->TargetId >> 1; @@ -6595,7 +6595,7 @@ IdeSendCommand( if((regs->bReserved & 1) == 0) { // execute ATA command - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: SCSIOP_START_STOP_UNIT PATH:LUN:TID = %#x:%#x:%#x\n", Srb->PathId, Srb->Lun, Srb->TargetId)); @@ -6636,7 +6636,7 @@ IdeSendCommand( AtapiWritePort1(chan, IDX_IO1_o_CylinderHigh, regs->bCylHighReg); } AtapiWritePort1(chan, IDX_IO1_o_Command, regs->bCommandReg); - + if(use_dma) { GetBaseStatus(chan, statusByte); if(statusByte & IDE_STATUS_ERROR) { @@ -6751,7 +6751,7 @@ passthrough_err: default: - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeSendCommand: Unsupported command %#x\n", Srb->Cdb[0])); @@ -6812,7 +6812,7 @@ IdeMediaStatus( // Read the error register. errorByte = AtapiReadPort1(chan, IDX_IO1_i_Error); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "IdeMediaStatus: Error enabling media status. Status %#x, error byte %#x\n", statusByte, errorByte)); @@ -7018,7 +7018,7 @@ AtapiStartIo__( /* KeBugCheckEx(0xc000000e, (Srb->PathId<<16) | (Srb->TargetId<<8) | (Srb->Lun), - Srb->Function, + Srb->Function, TopLevel, 0x80000001); */ if(TopLevel && Srb && Srb->SrbExtension) { @@ -7035,7 +7035,7 @@ AtapiStartIo__( //ASSERT(deviceExtension); //ASSERT(chan); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "** AtapiStartIo: Function %#x, PATH:LUN:TID = %#x:%#x:%#x\n", Srb->Function, Srb->PathId, Srb->Lun, Srb->TargetId)); KdPrint2((PRINT_PREFIX " VendorID+DeviceID/Rev %#x/%#x\n", deviceExtension->DevID, deviceExtension->RevID)); @@ -7051,7 +7051,7 @@ AtapiStartIo__( reject_srb: //if(!CheckDevice(HwDeviceExtension, lChannel, ldev & 1, FALSE)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiStartIo: SRB rejected\n")); // Indicate no device found at this address. KdPrint2((PRINT_PREFIX "SRB_STATUS_SELECTION_TIMEOUT\n")); @@ -7097,7 +7097,7 @@ reject_srb: } else { //if(!CheckDevice(HwDeviceExtension, lChannel, ldev & 1, FALSE)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiStartIo: EXECUTE_SCSI rejected (2)\n")); // Indicate no device found at this address. KdPrint2((PRINT_PREFIX "SRB_STATUS_SELECTION_TIMEOUT\n")); @@ -7114,7 +7114,7 @@ reject_srb: g_foo += a; } } __except(EXCEPTION_EXECUTE_HANDLER) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiStartIo: Bad data buffer -> EXECUTE_SCSI rejected\n")); // Indicate no device found at this address. KdPrint2((PRINT_PREFIX "SRB_STATUS_ERROR\n")); @@ -7140,7 +7140,7 @@ reject_srb: } /*KeBugCheckEx(0xc000000e, (Srb->PathId<<16) | (Srb->TargetId<<8) | (Srb->Lun), - Srb->Function, + Srb->Function, status, 0x80000001);*/ if(status == SRB_STATUS_BUSY) status = SRB_STATUS_PENDING; @@ -7209,7 +7209,7 @@ reject_srb: } /* KeBugCheckEx(0xc000000e, (Srb->PathId<<16) | (Srb->TargetId<<8) | (Srb->Lun), - Srb->Function, + Srb->Function, status, 0x80000002);*/ } @@ -7238,7 +7238,7 @@ reject_srb: if (!AtapiResetController__(deviceExtension, lChannel, RESET_COMPLETE_CURRENT)) { KdPrint2((PRINT_PREFIX "AtapiStartIo: Abort command failed\n")); // Log reset failure. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ScsiPortLogError: devExt %#x, Srb %#x, P:T:D=%d:%d:%d, MsgId %#x (%d)\n", HwDeviceExtension, NULL, 0, 0, 0, SP_INTERNAL_ADAPTER_ERROR, 5 << 8 )); @@ -7302,7 +7302,7 @@ reject_srb: if (!AtapiResetController__(deviceExtension, lChannel, RESET_COMPLETE_ALL)) { KdPrint2((PRINT_PREFIX "AtapiStartIo: Reset bus failed\n")); // Log reset failure. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "ScsiPortLogError: devExt %#x, Srb %#x, P:T:D=%d:%d:%d, MsgId %#x (%d) - (2)\n", HwDeviceExtension, NULL, 0, 0, 0, SP_INTERNAL_ADAPTER_ERROR, 5 << 8 )); @@ -7339,7 +7339,7 @@ reject_srb: 0, ATA_C_F_DIS_WCACHE, ATA_WAIT_BASE_READY); // Check for errors. if (status & IDE_STATUS_ERROR) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiHwInitialize: Disable write cacheing on Device %d failed\n", ldev)); } @@ -7351,7 +7351,7 @@ reject_srb: 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_BASE_READY); // Check for errors. if (status & IDE_STATUS_ERROR) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiHwInitialize: Enable write cacheing on Device %d failed\n", ldev)); deviceExtension->lun[ldev].DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; @@ -7599,7 +7599,7 @@ reject_srb: case IOCTL_SCSI_MINIPORT_UNIATA_RESETBB: case IOCTL_SCSI_MINIPORT_UNIATA_RESET_DEVICE: if(bad_ldev) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiStartIo: bad_ldev -> IOCTL SRB rejected\n")); // Indicate no device found at this address. goto reject_srb; @@ -7635,7 +7635,7 @@ uata_ctl_queue: KdPrint2((PRINT_PREFIX "AtapiStartIo: Already have %d request(s)!\n", chan->queue_depth)); goto complete_req; - } + } } /* process request */ @@ -7675,7 +7675,7 @@ uata_ctl_queue: } if(AtaCtl->SetMode.MaxMode != (ULONG)-1) { LunExt->LimitedTransferMode = (UCHAR)(AtaCtl->SetMode.MaxMode); - if(LunExt->LimitedTransferMode > + if(LunExt->LimitedTransferMode > LunExt->OrigTransferMode) { // check for incorrect value LunExt->LimitedTransferMode = @@ -7744,7 +7744,7 @@ uata_ctl_queue: break; } case IOCTL_SCSI_MINIPORT_UNIATA_RESETBB: { - + KdPrint2((PRINT_PREFIX "AtapiStartIo: Forget BB list\n")); ForgetBadBlocks(LunExt); @@ -7797,7 +7797,7 @@ complete_req: if (status != SRB_STATUS_PENDING) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiStartIo: Srb %#x complete with status %#x\n", Srb, status)); @@ -7836,7 +7836,7 @@ complete_req: NULL); ScsiPortNotification(NextLuRequest, - deviceExtension, + deviceExtension, PathId, TargetId, Lun); @@ -8184,7 +8184,7 @@ DriverEntry( /* KeBugCheckEx(0xc000000e, (i << 16) | BMList[0].ChanInitOk, - c, + c, newStatus, statusToReturn);*/ // Look for PCI IDE controller @@ -8238,7 +8238,7 @@ DriverEntry( /* KeBugCheckEx(0xc000000e, i, - c, + c, newStatus, statusToReturn);*/ // -------------- @@ -8534,7 +8534,7 @@ AtapiRegCheckParameterValue( IN ULONG Default ) { -#define ITEMS_TO_QUERY 2 // always 1 greater than what is searched +#define ITEMS_TO_QUERY 2 // always 1 greater than what is searched // PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; NTSTATUS status; diff --git a/reactos/drivers/storage/ide/uniata/id_badblock.cpp b/reactos/drivers/storage/ide/uniata/id_badblock.cpp index d753123daa8..48e96dc386d 100644 --- a/reactos/drivers/storage/ide/uniata/id_badblock.cpp +++ b/reactos/drivers/storage/ide/uniata/id_badblock.cpp @@ -144,10 +144,10 @@ InitBadBlocks( QueryTable[0].QueryRoutine = BadBlockQueryRoutine; QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED; - QueryTable[0].Name = NULL; // If Name is NULL, the QueryRoutine function - // specified for this table entry is called - // for all values associated with the current - // registry key. + QueryTable[0].Name = NULL; // If Name is NULL, the QueryRoutine function + // specified for this table entry is called + // for all values associated with the current + // registry key. QueryTable[0].EntryContext = NULL; QueryTable[0].DefaultType = REG_NONE; QueryTable[0].DefaultData = 0; @@ -253,7 +253,7 @@ CheckIfBadBlock( for (ULONG i = 0; i < nBadBlocks; i++) { - if (lba + count > arrBadBlocks->m_lbaStart && + if (lba + count > arrBadBlocks->m_lbaStart && lba < arrBadBlocks->m_lbaEnd) { KdPrint(( "listed BB @ %I64x\n", lba)); return true; diff --git a/reactos/drivers/storage/ide/uniata/id_dma.cpp b/reactos/drivers/storage/ide/uniata/id_dma.cpp index 51f8ea284ac..7f650a5a999 100644 --- a/reactos/drivers/storage/ide/uniata/id_dma.cpp +++ b/reactos/drivers/storage/ide/uniata/id_dma.cpp @@ -255,7 +255,7 @@ retry_DB_IO: while (count) { AtaReq->dma_tab[i].base = dma_base; AtaReq->dma_tab[i].count = (dma_count & 0xffff); - i++; + i++; if (i >= ATA_DMA_ENTRIES) { AtaReq->dma_base = 0; KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" )); @@ -312,7 +312,7 @@ AtapiDmaPioSync( // This must never be called after DMA operation !!! KdPrint2((PRINT_PREFIX "AtapiDmaPioSync: data %#x, len %#x\n", data, count)); - + if(!Srb) { KdPrint2((PRINT_PREFIX "AtapiDmaPioSync: !Srb\n" )); return FALSE; @@ -394,7 +394,7 @@ AtapiDmaStart( ULONG VendorID = deviceExtension->DevID & 0xffff; ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; - KdPrint2((PRINT_PREFIX "AtapiDmaStart: %s on %#x:%#x\n", + KdPrint2((PRINT_PREFIX "AtapiDmaStart: %s on %#x:%#x\n", (Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? "read" : "write", lChannel, DeviceNumber )); @@ -423,10 +423,10 @@ AtapiDmaStart( if(ChipType == PRNEW) { ULONG Channel = deviceExtension->Channel + lChannel; if(chan->ChannelCtrlFlags & CTRFLAGS_LBA48) { - AtapiWritePortEx1(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11, + AtapiWritePortEx1(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11, AtapiReadPortEx1(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11) | (Channel ? 0x08 : 0x02)); - AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),(Channel ? 0x24 : 0x20), + AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),(Channel ? 0x24 : 0x20), ((Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? 0x05000000 : 0x06000000) | (Srb->DataTransferLength >> 1) ); } @@ -435,7 +435,7 @@ AtapiDmaStart( if(deviceExtension->MemIo) { // begin transaction AtapiWritePort4(chan, - IDX_BM_Command, + IDX_BM_Command, (AtapiReadPort4(chan, IDX_BM_Command) & ~0x000000c0) | ((Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? 0x00000080 : 0x000000c0) ); @@ -446,20 +446,20 @@ AtapiDmaStart( } // set pointer to Pointer Table - AtapiWritePort4(chan, IDX_BM_PRD_Table, + AtapiWritePort4(chan, IDX_BM_PRD_Table, AtaReq->dma_base ); // set transfer direction - AtapiWritePort1(chan, IDX_BM_Command, + AtapiWritePort1(chan, IDX_BM_Command, (Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? BM_COMMAND_READ : BM_COMMAND_WRITE); // clear Error & Intr bits (writeing 1 clears bits) // set DMA capability bit - AtapiWritePort1(chan, IDX_BM_Status, + AtapiWritePort1(chan, IDX_BM_Status, AtapiReadPort1(chan, IDX_BM_Status) | (BM_STATUS_INTR | BM_STATUS_ERR) /*| (DeviceNumber ? BM_STATUS_DRIVE_1_DMA : BM_STATUS_DRIVE_0_DMA)*/); // begin transaction - AtapiWritePort1(chan, IDX_BM_Command, + AtapiWritePort1(chan, IDX_BM_Command, AtapiReadPort1(chan, IDX_BM_Command) | BM_COMMAND_START_STOP); return; @@ -489,10 +489,10 @@ AtapiDmaDone( if(ChipType == PRNEW) { ULONG Channel = deviceExtension->Channel + lChannel; if(chan->ChannelCtrlFlags & CTRFLAGS_LBA48) { - AtapiWritePortEx1(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11, + AtapiWritePortEx1(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11, AtapiReadPortEx1(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11) & ~(Channel ? 0x08 : 0x02)); - AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),(Channel ? 0x24 : 0x20), + AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0),(Channel ? 0x24 : 0x20), 0 ); } @@ -501,7 +501,7 @@ AtapiDmaDone( if(deviceExtension->MemIo) { // end transaction AtapiWritePort4(chan, - IDX_BM_Command, + IDX_BM_Command, (AtapiReadPort4(chan, IDX_BM_Command) & ~0x00000080) ); // clear flag @@ -515,7 +515,7 @@ AtapiDmaDone( // get status dma_status = AtapiReadPort1(chan, IDX_BM_Status) & BM_STATUS_MASK; // end transaction - AtapiWritePort1(chan, IDX_BM_Command, + AtapiWritePort1(chan, IDX_BM_Command, AtapiReadPort1(chan, IDX_BM_Command) & ~BM_COMMAND_START_STOP); // clear interrupt and error status @@ -540,12 +540,12 @@ AtapiDmaReinit( apiomode = (CHAR)AtaPioMode(&(LunExt->IdentifyData)); if(!(AtaReq->Flags & REQ_FLAG_DMA_OPERATION)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaReinit: !(AtaReq->Flags & REQ_FLAG_DMA_OPERATION), fall to PIO on Device %d\n", ldev & 1)); goto limit_pio; } if(!AtaReq->dma_base) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaReinit: no PRD, fall to PIO on Device %d\n", ldev & 1)); goto limit_pio; } @@ -553,35 +553,35 @@ AtapiDmaReinit( if((deviceExtension->HbaCtrlFlags & HBAFLAGS_DMA_DISABLED_LBA48) && (AtaReq->lba >= ATA_MAX_LBA28) && (LunExt->TransferMode > ATA_PIO5) ) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaReinit: FORCE_DOWNRATE on Device %d for LBA48\n", ldev & 1)); goto limit_lba48; } if(AtaReq->Flags & REQ_FLAG_FORCE_DOWNRATE) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaReinit: FORCE_DOWNRATE on Device %d\n", ldev & 1)); if(AtaReq->lba >= ATA_MAX_LBA28) { limit_lba48: LunExt->DeviceFlags |= REQ_FLAG_FORCE_DOWNRATE_LBA48; limit_pio: // do not make extra work if we already use PIO - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaReinit: set PIO mode on Device %d (%x -> %x)\n", ldev & 1, LunExt->TransferMode, ATA_PIO0+apiomode)); if(/*LunExt->TransferMode >= ATA_DMA*/ LunExt->TransferMode != ATA_PIO0+apiomode ) { AtapiDmaInit(deviceExtension, ldev & 1, ldev >> 1, - apiomode, + apiomode, -1, -1 ); } } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaReinit: set MAX mode on Device %d\n", ldev & 1)); AtapiDmaInit(deviceExtension, ldev & 1, ldev >> 1, - apiomode, + apiomode, min( retry_Wdma[AtaReq->retry], (CHAR)AtaWmode(&(LunExt->IdentifyData)) ), min( retry_Udma[AtaReq->retry], @@ -594,7 +594,7 @@ limit_pio: LunExt->TransferMode) || (LunExt->DeviceFlags & DFLAGS_REINIT_DMA)) { // restore IO mode - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaReinit: restore IO mode on Device %d\n", ldev & 1)); AtapiDmaInit__(deviceExtension, ldev); } @@ -609,7 +609,7 @@ AtapiDmaInit__( PHW_LU_EXTENSION LunExt = &(deviceExtension->lun[ldev]); if(LunExt->IdentifyData.SupportDma) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaInit__: Set (U)DMA on Device %d\n", ldev & 1)); /* for(i=AtaUmode(&(LunExt->IdentifyData)); i>=0; i--) { AtapiDmaInit(deviceExtension, ldev & 1, ldev >> 1, @@ -628,7 +628,7 @@ AtapiDmaInit__( (CHAR)AtaWmode(&(LunExt->IdentifyData)), (CHAR)AtaUmode(&(LunExt->IdentifyData)) ); } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiDmaInit__: Set PIO on Device %d\n", ldev & 1)); AtapiDmaInit(deviceExtension, ldev & 1, ldev >> 1, (CHAR)AtaPioMode(&(LunExt->IdentifyData)), -1, -1); @@ -644,7 +644,7 @@ AtaSetTransferMode( IN ULONG mode ) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtaSetTransferMode: Set %#x on Device %d/%d\n", mode, lChannel, DeviceNumber)); LONG statusByte = 0; CHAR apiomode; @@ -906,7 +906,7 @@ set_new_acard: for(i=udmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) { ULONG word54; - + GetPciConfig4(0x54, word54); word54 &= ~(0x000f000f << (dev * 4)); word54 |= (((ali_udma[i]<<16) | 5) << (dev * 4)); @@ -987,7 +987,7 @@ set_new_acard: /*********/ /* Cyrix */ /*********/ - ULONG cyr_piotiming[] = + ULONG cyr_piotiming[] = { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 }; ULONG cyr_wdmatiming[] = { 0x00077771, 0x00012121, 0x00002020 }; ULONG cyr_udmatiming[] = { 0x00921250, 0x00911140, 0x00911030 }; @@ -1070,7 +1070,7 @@ set_new_acard: return; } } - + for(i=wdmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { hpt_timing(deviceExtension, dev, (UCHAR)(ATA_WDMA0+i)); @@ -1105,7 +1105,7 @@ set_new_acard: UCHAR new44 = 0; UCHAR intel_timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x10, 0x21, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23 }; - + if(deviceExtension->DevID == ATA_I82371FB) { if (wdmamode >= 2 && apiomode >= 4) { ULONG word40; @@ -1161,7 +1161,7 @@ set_new_acard: reg54 &= ~(0x1000 << dev); } SetPciConfig2(0x54, reg54); - + udma_ok = TRUE; idx = i+8; if(ChipFlags & ICH4_FIX) { @@ -1238,7 +1238,7 @@ set_new_acard: return; } } - + for(i=wdmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { promise_timing(deviceExtension, dev, (UCHAR)(ATA_WDMA0+i)); @@ -1300,7 +1300,7 @@ set_new_acard: return; } } - + for(i=wdmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { @@ -1345,11 +1345,11 @@ l_ATA_SILICON_IMAGE_ID: /********************/ if(ChipType == SIIMIO) { - static const UCHAR sil_modes[7] = + static const UCHAR sil_modes[7] = { 0xf, 0xb, 0x7, 0x5, 0x3, 0x2, 0x1 }; - static const USHORT sil_wdma_modes[3] = + static const USHORT sil_wdma_modes[3] = { 0x2208, 0x10c2, 0x10c1 }; - static const USHORT sil_pio_modes[6] = + static const USHORT sil_pio_modes[6] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1, 0x10c1 }; UCHAR ureg = 0xac + ((UCHAR)DeviceNumber * 0x02) + ((UCHAR)Channel * 0x10); @@ -1490,7 +1490,7 @@ l_ATA_SILICON_IMAGE_ID: return; } } - + offs = 5; for(i=wdmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { @@ -1513,7 +1513,7 @@ l_ATA_SILICON_IMAGE_ID: case 0x16ca: /* Cenatek Rocket Drive controller */ if (wdmamode >= 0 && - (AtapiReadPort1(chan, IDX_BM_Status) & + (AtapiReadPort1(chan, IDX_BM_Status) & (DeviceNumber ? BM_STATUS_DRIVE_1_DMA : BM_STATUS_DRIVE_0_DMA))) { AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + wdmamode); } else { @@ -1553,7 +1553,7 @@ l_ATA_SILICON_IMAGE_ID: goto setup_drive_ite; } } - + for(i=wdmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { SetPciConfig1(0x48, reg48 & ~u_flag); @@ -1592,7 +1592,7 @@ setup_drive_ite: if (pio > 1) { /* enable prefetch and IORDY sample-point */ drive_enables |= (0x06 << (DeviceNumber*4)); - } + } SetPciConfig2(0x40, drive_enables); } else @@ -1611,7 +1611,7 @@ setup_drive_ite: return; } } - + for(i=wdmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { @@ -1637,7 +1637,7 @@ setup_drive_ite: case 0x3388: /* HiNT Corp. VXPro II EIDE */ if (wdmamode >= 0 && - (AtapiReadPort1(chan, IDX_BM_Status) & + (AtapiReadPort1(chan, IDX_BM_Status) & (DeviceNumber ? BM_STATUS_DRIVE_1_DMA : BM_STATUS_DRIVE_0_DMA))) { AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_DMA); } else { @@ -1662,7 +1662,7 @@ try_generic_dma: if ((udmamode >= 0 || /*wdmamode > 1*/ wdmamode >= 0) && /*deviceExtension->BaseIoAddressBM[lChannel]*/ deviceExtension->BusMaster && (GetDmaStatus(deviceExtension, lChannel) & - (!(ldev & 1) ? + (!(ldev & 1) ? BM_STATUS_DRIVE_0_DMA : BM_STATUS_DRIVE_1_DMA))) { // LunExt->TransferMode = ATA_DMA; // return; @@ -1718,7 +1718,7 @@ cyrix_timing( AtapiWritePortEx4(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),(dev*8) + 0x20, reg20); AtapiWritePortEx4(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),(dev*8) + 0x24, reg24); } // cyrix_timing() - + VOID promise_timing( IN PHW_DEVICE_EXTENSION deviceExtension, @@ -1865,12 +1865,12 @@ hpt_timing( case ATA_UDMA5: timing = 0x16454e31; break; default: timing = 0x06514e57; } - + case HPT366: { UCHAR reg41; - + GetPciConfig1(0x41 + (dev << 2), reg41); - + switch (reg41) { case 0x85: /* 25Mhz */ switch (mode) { diff --git a/reactos/drivers/storage/ide/uniata/id_init.cpp b/reactos/drivers/storage/ide/uniata/id_init.cpp index 7eef06af85c..11708307352 100644 --- a/reactos/drivers/storage/ide/uniata/id_init.cpp +++ b/reactos/drivers/storage/ide/uniata/id_init.cpp @@ -78,7 +78,7 @@ UniataChipDetect( c = AtapiRegCheckDevValue(deviceExtension, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"ForceSimplex", 0); if(c) { - *simplexOnly = TRUE; + *simplexOnly = TRUE; } KdPrint2((PRINT_PREFIX "i: %#x\n", i)); @@ -112,7 +112,7 @@ UniataChipDetect( PCI_DEV_HW_SPEC_BM( 0630, 1039, 0x00, ATA_UDMA5, "SiS 630S" , SIS100OLD ), PCI_DEV_HW_SPEC_BM( 0630, 1039, 0x00, ATA_UDMA4, "SiS 630" , SIS66 ), PCI_DEV_HW_SPEC_BM( 0620, 1039, 0x00, ATA_UDMA4, "SiS 620" , SIS66 ), - + PCI_DEV_HW_SPEC_BM( 0550, 1039, 0x00, ATA_UDMA5, "SiS 550" , SIS66 ), PCI_DEV_HW_SPEC_BM( 0540, 1039, 0x00, ATA_UDMA4, "SiS 540" , SIS66 ), PCI_DEV_HW_SPEC_BM( 0530, 1039, 0x00, ATA_UDMA4, "SiS 530" , SIS66 ), @@ -166,7 +166,7 @@ UniataChipDetect( i = AtapiFindListedDev(DevTypeInfo, -1, HwDeviceExtension, SystemIoBusNumber, -1, NULL); goto for_ugly_chips; - case ATA_VIA_ID: + case ATA_VIA_ID: KdPrint2((PRINT_PREFIX "ATA_VIA_ID\n")); // New chips have own DeviceId if(deviceExtension->DevID != ATA_VIA82C571) @@ -213,7 +213,7 @@ UniataChipDetect( case 0x06401095: /* CMD 640 known bad, no DMA */ case 0x06011039: - *simplexOnly = TRUE; + *simplexOnly = TRUE; /* FALLTHROUGH */ @@ -231,7 +231,7 @@ UniataChipDetect( case 0x81721283: /* IT8172 IDE controller */ deviceExtension->MaxTransferMode = ATA_UDMA2; - *simplexOnly = TRUE; + *simplexOnly = TRUE; break; default: @@ -251,7 +251,7 @@ for_ugly_chips: deviceExtension->HwFlags |= DevTypeInfo[i].RaidFlags; KdPrint2((PRINT_PREFIX "HwFlags: %#x\n", deviceExtension->HwFlags)); - + tmp32 = AtapiRegCheckDevValue(deviceExtension, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"HwFlagsOverride", deviceExtension->HwFlags); KdPrint2((PRINT_PREFIX "HwFlagsOverride: %#x\n", tmp32)); deviceExtension->HwFlags = tmp32; @@ -263,7 +263,7 @@ for_ugly_chips: KdPrint2((PRINT_PREFIX "HwFlags (final): %#x\n", deviceExtension->HwFlags)); if(deviceExtension->HwFlags & UNIATA_SIMPLEX_ONLY) { KdPrint2((PRINT_PREFIX "UNIATA_SIMPLEX_ONLY\n" )); - *simplexOnly = TRUE; + *simplexOnly = TRUE; } KdPrint2((PRINT_PREFIX "MaxTransferMode: %#x\n", deviceExtension->MaxTransferMode)); @@ -320,7 +320,7 @@ for_ugly_chips: chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; } - } + } break; case ATA_NVIDIA_ID: if(ChipFlags & UNIATA_SATA) { @@ -512,9 +512,9 @@ for_ugly_chips: chan->RegTranslation[IDX_BM_PRD_Table].MemIo = MemIo; chan->RegTranslation[IDX_SATA_SStatus].Addr = BaseMemAddress + offs + 0x40; - chan->RegTranslation[IDX_SATA_SStatus].MemIo = MemIo; + chan->RegTranslation[IDX_SATA_SStatus].MemIo = MemIo; chan->RegTranslation[IDX_SATA_SError].Addr = BaseMemAddress + offs + 0x44; - chan->RegTranslation[IDX_SATA_SError].MemIo = MemIo; + chan->RegTranslation[IDX_SATA_SError].MemIo = MemIo; chan->RegTranslation[IDX_SATA_SControl].Addr = BaseMemAddress + offs + 0x48; chan->RegTranslation[IDX_SATA_SControl].MemIo = MemIo; @@ -555,7 +555,7 @@ for_ugly_chips: if(tmp32 == ATA_SIS5513 || tmp32 == ATA_SIS5517) { i = AtapiFindListedDev((BUSMASTER_CONTROLLER_INFORMATION*)&SiSSouthAdapters[0], - -1, HwDeviceExtension, SystemIoBusNumber, -1, NULL); + -1, HwDeviceExtension, SystemIoBusNumber, -1, NULL); if(i != 0xFFFFFFFF) { deviceExtension->HwFlags = (deviceExtension->HwFlags & ~CHIPTYPE_MASK) | SIS133OLD; //deviceExtension->MaxTransferMode = ATA_UDMA6; @@ -639,7 +639,7 @@ for_ugly_chips: if(/*deviceExtension->*/BaseMemAddress) { KdPrint2((PRINT_PREFIX "UniataChipDetect: BAR5 %x\n", /*deviceExtension->*/BaseMemAddress)); if(ChipFlags & VIABAR) { - + ULONG BaseIoAddressBM_0; ULONG BaseIo; @@ -774,7 +774,7 @@ for_ugly_chips: break; } case 0x1078: /* Cyrix 5530 ATA33 controller */ - if(deviceExtension->DevID == 0x01021078) { + if(deviceExtension->DevID == 0x01021078) { ConfigInfo->AlignmentMask = 0x0f; deviceExtension->MaximumDmaTransferLength = 63*1024; } @@ -811,7 +811,7 @@ AtapiViaSouthBridgeFixup( slotData.u.AsULONG = slotNumber; for(funcNumber = 0; funcNumber < PCI_MAX_FUNCTION; funcNumber++) { - + slotData.u.bits.FunctionNumber = funcNumber; busDataRead = ScsiPortGetBusData(HwDeviceExtension, @@ -834,9 +834,9 @@ AtapiViaSouthBridgeFixup( dev_id == 0x31021106 || /* VIA VT8662 */ dev_id == 0x31121106) { /* VIA VT8361 */ UCHAR reg76; - + GetPciConfig1(0x76, reg76); - + if ((reg76 & 0xf0) != 0xd0) { SetPciConfig1(0x75, 0x80); SetPciConfig1(0x76, (reg76 & 0x0f) | 0xd0); @@ -875,7 +875,7 @@ AtapiRosbSouthBridgeFixup( /* locate the ISA part in the southbridge and enable UDMA33 */ slotData.u.AsULONG = slotNumber; for(funcNumber = 0; funcNumber < PCI_MAX_FUNCTION; funcNumber++) { - + slotData.u.bits.FunctionNumber = funcNumber; busDataRead = ScsiPortGetBusData(HwDeviceExtension, @@ -928,7 +928,7 @@ AtapiAliSouthBridgeFixup( * the ATA channel tristate buffer */ slotData.u.AsULONG = slotNumber; for(funcNumber = 0; funcNumber < PCI_MAX_FUNCTION; funcNumber++) { - + slotData.u.bits.FunctionNumber = funcNumber; busDataRead = ScsiPortGetBusData(HwDeviceExtension, @@ -1099,12 +1099,12 @@ AtapiReadChipConfig( if(channel == CHAN_NOT_SPECIFIED) { if(AtapiRegCheckDevValue(deviceExtension, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"ForceSimplex", FALSE)) { - deviceExtension->simplexOnly = TRUE; + deviceExtension->simplexOnly = TRUE; } - deviceExtension->opt_AtapiDmaZeroTransfer = FALSE; - deviceExtension->opt_AtapiDmaControlCmd = FALSE; - deviceExtension->opt_AtapiDmaRawRead = TRUE; - deviceExtension->opt_AtapiDmaReadWrite = TRUE; + deviceExtension->opt_AtapiDmaZeroTransfer = FALSE; + deviceExtension->opt_AtapiDmaControlCmd = FALSE; + deviceExtension->opt_AtapiDmaRawRead = TRUE; + deviceExtension->opt_AtapiDmaReadWrite = TRUE; } if(c == CHAN_NOT_SPECIFIED) { @@ -1120,21 +1120,21 @@ AtapiReadChipConfig( //UniAtaReadLunConfig(deviceExtension, c, 1); } - deviceExtension->opt_AtapiDmaZeroTransfer = + deviceExtension->opt_AtapiDmaZeroTransfer = AtapiRegCheckDevValue(deviceExtension, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiDmaZeroTransfer", deviceExtension->opt_AtapiDmaZeroTransfer) ? - TRUE : FALSE; + TRUE : FALSE; deviceExtension->opt_AtapiDmaControlCmd = AtapiRegCheckDevValue(deviceExtension, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiDmaControlCmd", deviceExtension->opt_AtapiDmaControlCmd) ? - TRUE : FALSE; + TRUE : FALSE; deviceExtension->opt_AtapiDmaRawRead = AtapiRegCheckDevValue(deviceExtension, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiDmaRawRead", deviceExtension->opt_AtapiDmaRawRead) ? - TRUE : FALSE; + TRUE : FALSE; deviceExtension->opt_AtapiDmaReadWrite = AtapiRegCheckDevValue(deviceExtension, CHAN_NOT_SPECIFIED, DEVNUM_NOT_SPECIFIED, L"AtapiDmaReadWrite", deviceExtension->opt_AtapiDmaReadWrite) ? - TRUE : FALSE; + TRUE : FALSE; } else { chan = &deviceExtension->chan[c]; @@ -1196,7 +1196,7 @@ AtapiChipInit( } switch(VendorID) { -// case ATA_ACARD_ID: +// case ATA_ACARD_ID: // break; case ATA_ACER_LABS_ID: if(ChipFlags & UNIATA_SATA) { @@ -1268,7 +1268,7 @@ AtapiChipInit( } } break; - case ATA_HIGHPOINT_ID: + case ATA_HIGHPOINT_ID: if(c == CHAN_NOT_SPECIFIED) { @@ -1332,7 +1332,7 @@ AtapiChipInit( #else /* enable PCI interrupt */ ChangePciConfig2(/*PCIR_COMMAND*/0x04, (a & ~0x0400)); -#endif +#endif break; } if(deviceExtension->MaxTransferMode < ATA_UDMA2) @@ -1366,7 +1366,7 @@ AtapiChipInit( /* enable device and PHY state change interrupts */ AtapiWritePortEx4(NULL, (ULONG)(&deviceExtension->BaseIoAddressSATA_0),offs+4, 0x000d000d); /* disable NCQ support */ - AtapiWritePortEx4(NULL, (ULONG)(&deviceExtension->BaseIoAddressSATA_0),0x0400, + AtapiWritePortEx4(NULL, (ULONG)(&deviceExtension->BaseIoAddressSATA_0),0x0400, AtapiReadPortEx4(NULL, (ULONG)(&deviceExtension->BaseIoAddressSATA_0),0x0400) & 0xfffffff9); } else { /* clear interrupt status */ @@ -1381,7 +1381,7 @@ AtapiChipInit( } } else { UCHAR reg52; - + // check 80-pin cable if(c == CHAN_NOT_SPECIFIED) { @@ -1411,7 +1411,7 @@ AtapiChipInit( /* setup clocks */ if(c == CHAN_NOT_SPECIFIED) { // ATA_OUTB(ctlr->r_res1, 0x11, ATA_INB(ctlr->r_res1, 0x11) | 0x0a); - AtapiWritePortEx1(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11, + AtapiWritePortEx1(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11, AtapiReadPortEx1(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x11) | 0x0a ); } /* FALLTHROUGH */ @@ -1419,7 +1419,7 @@ AtapiChipInit( /* enable burst mode */ // ATA_OUTB(ctlr->r_res1, 0x1f, ATA_INB(ctlr->r_res1, 0x1f) | 0x01); if(c == CHAN_NOT_SPECIFIED) { - AtapiWritePortEx1(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x1f, + AtapiWritePortEx1(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x1f, AtapiReadPortEx1(NULL, (ULONG)(&deviceExtension->BaseIoAddressBM_0),0x1f) | 0x01 ); for(c=0; cNumberChannels; c++) { chan = &deviceExtension->chan[c]; @@ -1460,7 +1460,7 @@ AtapiChipInit( } for(c=0; c<4; c++) { chan = &deviceExtension->chan[c]; - AtapiWritePort4(chan, IDX_BM_Command, + AtapiWritePort4(chan, IDX_BM_Command, (AtapiReadPort4(chan, IDX_BM_Command) & ~0x00000f8f) | channel ); AtapiWritePort4(chan, IDX_BM_DeviceSpecific0, 0x00000001); if(chan->MaxTransferMode < ATA_SA150 && @@ -1470,7 +1470,7 @@ AtapiChipInit( } } else { chan = &deviceExtension->chan[c]; - AtapiWritePort4(chan, IDX_BM_Command, + AtapiWritePort4(chan, IDX_BM_Command, (AtapiReadPort4(chan, IDX_BM_Command) & ~0x00000f8f) | channel ); AtapiWritePort4(chan, IDX_BM_DeviceSpecific0, 0x00000001); if(chan->MaxTransferMode < ATA_SA150 && @@ -1481,7 +1481,7 @@ AtapiChipInit( break; } break; } - case ATA_SERVERWORKS_ID: + case ATA_SERVERWORKS_ID: if(c == CHAN_NOT_SPECIFIED) { if(ChipType == SWKS33) { AtapiRosbSouthBridgeFixup(HwDeviceExtension, PCIConfiguration, @@ -1680,7 +1680,7 @@ AtapiChipInit( } } break; - case ATA_VIA_ID: + case ATA_VIA_ID: if(c == CHAN_NOT_SPECIFIED) { /* prepare for ATA-66 on the 82C686a and 82C596b */ @@ -1708,7 +1708,7 @@ AtapiChipInit( chan->MaxTransferMode = min(deviceExtension->MaxTransferMode, ATA_UDMA2); } } - + if(c == CHAN_NOT_SPECIFIED) { /* the southbridge might need the data corruption fix */ if(ChipFlags & VIABUG) { diff --git a/reactos/drivers/storage/ide/uniata/id_probe.cpp b/reactos/drivers/storage/ide/uniata/id_probe.cpp index 9bcacf18c86..5b90d3593b4 100644 --- a/reactos/drivers/storage/ide/uniata/id_probe.cpp +++ b/reactos/drivers/storage/ide/uniata/id_probe.cpp @@ -59,7 +59,7 @@ ULONG maxPciBus = 16; PDRIVER_OBJECT SavedDriverObject = NULL; -// local routines +// local routines ULONG UniataEnumBusMasterController__( @@ -119,7 +119,7 @@ AtapiGetIoRange( ~0x07/*PCI_ADDRESS_IOMASK*/) + offset ), length, - (BOOLEAN)!(*ConfigInfo->AccessRanges)[rid].RangeInMemory) + (BOOLEAN)!(*ConfigInfo->AccessRanges)[rid].RangeInMemory) ); KdPrint2((PRINT_PREFIX " AtapiGetIoRange: %#x\n", io_start)); @@ -229,7 +229,7 @@ UniataEnumBusMasterController__( for(busNumber=0 ;busNumberVendorIdStr), (PCHAR)vendorStrPtr, 4); RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4); - + newBMListPtr->nVendorId = VendorID; newBMListPtr->VendorId = (PCHAR)&(newBMListPtr->VendorIdStr); newBMListPtr->VendorIdLength = 4; @@ -508,7 +508,7 @@ UniataEnumBusMasterController__( if(!pass) { if(!BMListLen) break; - BMList = (PBUSMASTER_CONTROLLER_INFORMATION)ExAllocatePool(NonPagedPool, + BMList = (PBUSMASTER_CONTROLLER_INFORMATION)ExAllocatePool(NonPagedPool, (BMListLen+1)*sizeof(BUSMASTER_CONTROLLER_INFORMATION)); if(!BMList) { BMListLen=0; @@ -529,7 +529,7 @@ UniataEnumBusMasterController__( /* Wrapper for read PCI config space */ -ULONG +ULONG ScsiPortGetBusDataByOffset( IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, @@ -617,7 +617,7 @@ AtapiFindListedDev( busDataRead = HalGetBusData( //ScsiPortGetBusData(HwDeviceExtension, - PCIConfiguration, busNumber, slotData.u.AsULONG, + PCIConfiguration, busNumber, slotData.u.AsULONG, &pciData, PCI_COMMON_HDR_LENGTH); // no more buses (this should not happen) if(!busDataRead) { @@ -666,7 +666,7 @@ AtapiFindDev( slotData.u.AsULONG = SlotNumber; // walk through all Function Numbers for(funcNumber = 0; funcNumber < PCI_MAX_FUNCTION; funcNumber++) { - + slotData.u.bits.FunctionNumber = funcNumber; if(slotData.u.AsULONG == SlotNumber) continue; @@ -1033,7 +1033,7 @@ UniataFindBusMasterController( } /* - * the Cypress chip is a mess, it contains two ATA functions, but + * the Cypress chip is a mess, it contains two ATA functions, but * both channels are visible on the first one. * simply ignore the second function for now, as the right * solution (ignoring the second channel on the first function) @@ -1129,9 +1129,9 @@ UniataFindBusMasterController( KdPrint2((PRINT_PREFIX "!MasterDev\n")); ConfigInfo->SlotNumber = slotNumber; ConfigInfo->SystemIoBusNumber = SystemIoBusNumber; - + /* primary and secondary channels share the same interrupt */ - if(!ConfigInfo->BusInterruptVector || + if(!ConfigInfo->BusInterruptVector || (ConfigInfo->BusInterruptVector != pciData.u.type0.InterruptLine)) { KdPrint2((PRINT_PREFIX "patch irq line = %#x\n", pciData.u.type0.InterruptLine)); ConfigInfo->BusInterruptVector = pciData.u.type0.InterruptLine; // set default value @@ -1148,8 +1148,8 @@ UniataFindBusMasterController( if((WinVer_Id() >= WinVer_NT) || (ConfigInfo->Length >= sizeof(_ConfigInfo->comm) + sizeof(_ConfigInfo->nt4))) { _ConfigInfo->nt4.DeviceExtensionSize = sizeof(HW_DEVICE_EXTENSION); - _ConfigInfo->nt4.SpecificLuExtensionSize = sizeof(HW_LU_EXTENSION); - _ConfigInfo->nt4.SrbExtensionSize = sizeof(ATA_REQ); + _ConfigInfo->nt4.SpecificLuExtensionSize = sizeof(HW_LU_EXTENSION); + _ConfigInfo->nt4.SrbExtensionSize = sizeof(ATA_REQ); } if((WinVer_Id() > WinVer_2k) || (ConfigInfo->Length >= sizeof(_ConfigInfo->comm) + sizeof(_ConfigInfo->nt4) + sizeof(_ConfigInfo->w2k))) { @@ -1171,7 +1171,7 @@ UniataFindBusMasterController( found = FALSE; if(deviceExtension->BusMaster) { - + KdPrint2((PRINT_PREFIX "Reconstruct ConfigInfo\n")); ConfigInfo->MapBuffers = TRUE; #ifdef USE_OWN_DMA @@ -1189,7 +1189,7 @@ UniataFindBusMasterController( if(AltInit) { // I'm sorry, I have to do this - // when Win doesn't + // when Win doesn't if(ConfigInfo->AdapterInterfaceType == Isa /*&& // InDriverEntry*/) { @@ -1271,7 +1271,7 @@ UniataFindBusMasterController( KdPrint2((PRINT_PREFIX "ScsiPortValidateRange failed (1)\n")); continue; } - + if(!ScsiPortValidateRange(HwDeviceExtension, PCIBus /*ConfigInfo->AdapterInterfaceType*/, SystemIoBusNumber /*ConfigInfo->SystemIoBusNumber*/, @@ -1377,14 +1377,14 @@ UniataFindBusMasterController( GetBaseStatus(chan, statusByte); skip_find_dev = FALSE; if(!(deviceExtension->HwFlags & UNIATA_NO_SLAVE)) { - if ((statusByte & 0xf8) == 0xf8 || + if ((statusByte & 0xf8) == 0xf8 || (statusByte == 0xa5)) { // Check slave. KdPrint2((PRINT_PREFIX "Check drive 1\n")); SelectDrive(chan, 1); AtapiStallExecution(1); GetBaseStatus(chan, statusByte); - if ((statusByte & 0xf8) == 0xf8 || + if ((statusByte & 0xf8) == 0xf8 || (statusByte == 0xa5)) { // No controller at this base address. KdPrint2((PRINT_PREFIX "Empty channel\n")); @@ -1404,7 +1404,7 @@ UniataFindBusMasterController( KdPrint2((PRINT_PREFIX "no devices\n")); /* KeBugCheckEx(0xc000000e, ScsiPortConvertPhysicalAddressToUlong(IoBasePort1), - ScsiPortConvertPhysicalAddressToUlong(IoBasePort2), + ScsiPortConvertPhysicalAddressToUlong(IoBasePort2), (ULONG)(deviceExtension->BaseIoAddressBM[c]), skip_find_dev);*/ } //#ifdef UNIATA_INIT_ON_PROBE @@ -1427,7 +1427,7 @@ UniataFindBusMasterController( if (channel == 1) { KdPrint2((PRINT_PREFIX "claim Secondary\n")); ConfigInfo->AtdiskSecondaryClaimed = TRUE; - + FirstMasterOk = TRUE; } } @@ -1460,7 +1460,7 @@ exit_findbm: if(BaseIoAddressBM_0) ScsiPortFreeDeviceBase(HwDeviceExtension, BaseIoAddressBM_0); - + KdPrint2((PRINT_PREFIX "return SP_RETURN_NOT_FOUND\n")); return SP_RETURN_NOT_FOUND; } else { @@ -1551,7 +1551,7 @@ UniataConnectIntr2( KdPrint2((PRINT_PREFIX "Create DO\n")); - devname.Length = + devname.Length = _snwprintf(devname_str, sizeof(devname_str)/sizeof(WCHAR), L"\\Device\\uniata%d_2ch", i); devname.Length *= sizeof(WCHAR); @@ -1592,7 +1592,7 @@ UniataConnectIntr2( KdPrint2((PRINT_PREFIX "isr2_affinity %#x\n", BMList[i].Isr2Affinity)); // deviceExtension->QueueNewIrql = BMList[i].Isr2Irql; - + KdPrint2((PRINT_PREFIX "IoConnectInterrupt\n")); status = IoConnectInterrupt( &(BMList[i].Isr2InterruptObject), @@ -1852,7 +1852,7 @@ retryIdentifier: do { AtapiStallExecution(1000); statusByte = AtapiReadPort1(chan, IDX_ATAPI_IO1_i_Status); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: First access to status %#x\n", statusByte)); } while ((statusByte & IDE_STATUS_BUSY) && ++i < 10); @@ -1870,7 +1870,7 @@ retryIdentifier: if ((statusByte = AtapiReadPort1(chan, IDX_IO1_i_CylinderLow)) != 0xAA) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: Identifier read back from Slave (%#x)\n", statusByte)); not_found: @@ -1940,7 +1940,7 @@ not_found: AtapiReadChipConfig(HwDeviceExtension, DEVNUM_NOT_SPECIFIED, 0); AtapiChipInit(HwDeviceExtension, DEVNUM_NOT_SPECIFIED, 0); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: Found IDE at %#x\n", BaseIoAddress1)); @@ -1956,12 +1956,12 @@ not_found: #ifndef UNIATA_CORE if (AtapiParseArgumentString(ArgumentString, "dump") == 1) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: Crash dump\n")); atapiOnly = FALSE; deviceExtension->DriverMustPoll = TRUE; } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: Atapi Only\n")); atapiOnly = TRUE; deviceExtension->DriverMustPoll = FALSE; @@ -1969,7 +1969,7 @@ not_found: #endif //UNIATA_CORE } else { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: Atapi Only (2)\n")); atapiOnly = TRUE; deviceExtension->DriverMustPoll = FALSE; @@ -1989,14 +1989,14 @@ not_found: // Save the Interrupe Mode for later use deviceExtension->InterruptMode = ConfigInfo->InterruptMode; - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: look for devices\n")); // Search for devices on this controller. if (FindDevices(HwDeviceExtension, /*atapiOnly*/ FALSE, 0)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: detected\n")); // Claim primary or secondary ATA IO range. if (portBase) { @@ -2022,7 +2022,7 @@ not_found: } } - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: return SP_RETURN_FOUND\n")); return(SP_RETURN_FOUND); } @@ -2038,7 +2038,7 @@ not_found: *Again = FALSE; *(adapterCount) = 0; - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "AtapiFindController: return SP_RETURN_NOT_FOUND\n")); return(SP_RETURN_NOT_FOUND); @@ -2137,23 +2137,23 @@ CheckDevice( statusByte = WaitOnBusy(chan); if((statusByte | IDE_STATUS_BUSY) == 0xff) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "CheckDevice: bad status %x\n", statusByte)); } else if(statusByte != 0xff && (statusByte & IDE_STATUS_BUSY)) { // Perform hard-reset. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "CheckDevice: BUSY\n")); GetBaseStatus(chan, statusByte); } if((statusByte | IDE_STATUS_BUSY) == 0xff) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "CheckDevice: no dev ?\n")); } else if(deviceExtension->BaseIoAddressSATA_0.Addr) { //if(deviceExtension->HwFlags & UNIATA_SATA) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "CheckDevice: try enable SATA Phy\n")); statusByte = UniataSataPhyEnable(HwDeviceExtension, Channel); if(statusByte == 0xff) { @@ -2322,7 +2322,7 @@ FindDevices( // Search for devices. for (i = 0; i < max_ldev; i++) { AtapiDisableInterrupts(deviceExtension, Channel); - deviceResponded |= + deviceResponded |= (CheckDevice(HwDeviceExtension, Channel, i, TRUE) != 0); AtapiEnableInterrupts(deviceExtension, Channel); } @@ -2343,7 +2343,7 @@ FindDevices( deviceExtension->lun[ldev].IdentifyData.NumberOfHeads == 0x07) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: Found nasty Compaq ESDI!\n")); // Change these values to something reasonable. @@ -2358,7 +2358,7 @@ FindDevices( deviceExtension->lun[ldev].IdentifyData.NumberOfHeads == 0x0F) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: Found nasty Compaq ESDI!\n")); // Change these values to something reasonable. @@ -2397,7 +2397,7 @@ FindDevices( if (statusByte & IDE_STATUS_ERROR) { // Reset the device. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: Resetting controller before SetDriveParameters.\n")); AtapiWritePort1(chan, IDX_IO2_o_Control, IDE_DC_RESET_CONTROLLER ); @@ -2415,7 +2415,7 @@ FindDevices( statusByte = WaitOnBusy(chan); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: Status before SetDriveParameters: (%#x) (%#x)\n", statusByte, AtapiReadPort1(chan, IDX_IO1_i_DriveSelect))); @@ -2425,7 +2425,7 @@ FindDevices( // Use the IDENTIFY data to set drive parameters. if (!SetDriveParameters(HwDeviceExtension,i,Channel)) { - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: Set drive parameters for device %d failed\n", i)); // Don't use this device as writes could cause corruption. @@ -2464,11 +2464,11 @@ FindDevices( if(deviceExtension->lun[ldev].DeviceFlags & DFLAGS_DEVICE_PRESENT) { // Make sure some device (master is preferred) is selected on exit. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: select %d dev to clear INTR\n", i)); SelectDrive(chan, i); GetBaseStatus(chan, statusByte); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: statusByte=%#x\n", statusByte)); } } @@ -2477,7 +2477,7 @@ FindDevices( if(deviceExtension->lun[ldev].DeviceFlags & DFLAGS_DEVICE_PRESENT) { // Make sure some device (master is preferred) is selected on exit. - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: select %d dev on exit\n", i)); SelectDrive(chan, i); break; @@ -2491,7 +2491,7 @@ FindDevices( // AtapiWritePort1(chan, IDX_IO2_o_Control, IDE_DC_A_4BIT ); GetBaseStatus(chan, statusByte); - KdPrint2((PRINT_PREFIX + KdPrint2((PRINT_PREFIX "FindDevices: returning %d\n", deviceResponded)); diff --git a/reactos/drivers/storage/ide/uniata/id_sata.cpp b/reactos/drivers/storage/ide/uniata/id_sata.cpp index 7c99adca0e2..eda1a661863 100644 --- a/reactos/drivers/storage/ide/uniata/id_sata.cpp +++ b/reactos/drivers/storage/ide/uniata/id_sata.cpp @@ -134,7 +134,7 @@ UniataSataClearErr( //if(ChipFlags & UNIATA_SATA) { SStatus.Reg = AtapiReadPort4(chan, IDX_SATA_SStatus); - SError.Reg = AtapiReadPort4(chan, IDX_SATA_SError); + SError.Reg = AtapiReadPort4(chan, IDX_SATA_SError); if(SStatus.Reg) { KdPrint2((PRINT_PREFIX " SStatus %x\n", SStatus.Reg)); diff --git a/reactos/drivers/storage/ide/uniata/inc/CrossNt.h b/reactos/drivers/storage/ide/uniata/inc/CrossNt.h index 12fbdeca089..2e22649ba39 100644 --- a/reactos/drivers/storage/ide/uniata/inc/CrossNt.h +++ b/reactos/drivers/storage/ide/uniata/inc/CrossNt.h @@ -7,7 +7,7 @@ extern "C" { #if !defined(NT_INCLUDED) #include // various NT definitions -#endif +#endif #include #include diff --git a/reactos/drivers/storage/ide/uniata/scsi.h b/reactos/drivers/storage/ide/uniata/scsi.h index b6d639554af..8dc4c632862 100644 --- a/reactos/drivers/storage/ide/uniata/scsi.h +++ b/reactos/drivers/storage/ide/uniata/scsi.h @@ -170,7 +170,7 @@ typedef union _CDB { UCHAR Reserved : 4; } Fields; } Byte2; - + UCHAR Reserved2[3]; UCHAR Start_TrackSes;; UCHAR AllocationLength[2]; @@ -531,7 +531,7 @@ typedef union _CDB { } Byte2; UCHAR Reserved1 [2]; UCHAR TrackNum; - UCHAR Reserved2 [6]; + UCHAR Reserved2 [6]; } CLOSE_TRACK_SESSION, *PCLOSE_TRACK_SESSION; @@ -1519,7 +1519,7 @@ typedef PREAD_TOC_FULL_TOC PREAD_TOC_PMA; typedef struct _READ_TOC_ATIP { UCHAR Length[2]; UCHAR Reserved[2]; - + #define ATIP_SpeedRef_Mask 0x07 #define ATIP_SpeedRef_2X 0x01 #define ATIP_WritingPower_Mask 0x07 @@ -1930,8 +1930,8 @@ typedef struct _EVENT_STAT_DEV_BUSY_BLOCK { // Define mode disc info block. -typedef struct _DISC_INFO_BLOCK { // - UCHAR DataLength [2]; +typedef struct _DISC_INFO_BLOCK { // + UCHAR DataLength [2]; #define DiscInfo_Disk_Mask 0x03 #define DiscInfo_Disk_Empty 0x00 @@ -1994,7 +1994,7 @@ typedef struct _DISC_INFO_BLOCK { // // Define track info block. typedef struct _TRACK_INFO_BLOCK { - UCHAR DataLength [2]; + UCHAR DataLength [2]; UCHAR TrackNum; UCHAR SesNum; UCHAR Reserved0; @@ -2264,7 +2264,7 @@ typedef struct _MODE_WRITE_PARAMS_PAGE { // 0x05 } Byte4; UCHAR LinkSize; - UCHAR Reserved3; + UCHAR Reserved3; union { UCHAR Flags; @@ -2370,7 +2370,7 @@ typedef struct _MODE_CD_PARAMS_PAGE { // 0x0D UCHAR PageCode : 6; UCHAR Reserved : 1; UCHAR PageSavable : 1; - + UCHAR PageLength; // 0x06 UCHAR Reserved1; @@ -2409,7 +2409,7 @@ typedef struct _MODE_CD_AUDIO_CONTROL_PAGE { // 0x0E UCHAR PageCode : 6; UCHAR Reserved1: 1; UCHAR PageSavable : 1; - + UCHAR PageLength; // 0x0E #define CdAudio_SOTC 0x02 @@ -2438,7 +2438,7 @@ typedef struct _MODE_POWER_CONDITION_PAGE { // 0x1A UCHAR PageCode : 6; UCHAR Reserved1: 1; UCHAR PageSavable : 1; - + UCHAR PageLength; // 0x0A UCHAR Reserved2; @@ -2465,7 +2465,7 @@ typedef struct _MODE_FAIL_REPORT_PAGE { // 0x1C UCHAR PageCode : 6; UCHAR Reserved1: 1; UCHAR PageSavable : 1; - + UCHAR PageLength; // 0x0A #define FailReport_LogErr 0x01 @@ -2504,7 +2504,7 @@ typedef struct _MODE_TIMEOUT_AND_PROTECT_PAGE { // 0x1D UCHAR PageCode : 6; UCHAR Reserved1: 1; UCHAR PageSavable : 1; - + UCHAR PageLength; // 0x08 UCHAR Reserved2[2]; @@ -2567,31 +2567,31 @@ typedef struct _MODE_CAPABILITIES_PAGE2 { // 0x2A UCHAR PageLength; -#define DevCap_read_cd_r 0x01 // reserved in 1.2 -#define DevCap_read_cd_rw 0x02 // reserved in 1.2 +#define DevCap_read_cd_r 0x01 // reserved in 1.2 +#define DevCap_read_cd_rw 0x02 // reserved in 1.2 #define DevCap_method2 0x04 #define DevCap_read_dvd_rom 0x08 #define DevCap_read_dvd_r 0x10 #define DevCap_read_dvd_ram 0x20 UCHAR ReadCap; // DevCap_*_read -/* UCHAR cd_r_read : 1; // reserved in 1.2 - UCHAR cd_rw_read : 1; // reserved in 1.2 +/* UCHAR cd_r_read : 1; // reserved in 1.2 + UCHAR cd_rw_read : 1; // reserved in 1.2 UCHAR method2 : 1; UCHAR dvd_rom : 1; UCHAR dvd_r_read : 1; UCHAR dvd_ram_read : 1; UCHAR Reserved2 : 2;*/ -#define DevCap_write_cd_r 0x01 // reserved in 1.2 -#define DevCap_write_cd_rw 0x02 // reserved in 1.2 +#define DevCap_write_cd_r 0x01 // reserved in 1.2 +#define DevCap_write_cd_rw 0x02 // reserved in 1.2 #define DevCap_test_write 0x04 #define DevCap_write_dvd_r 0x10 #define DevCap_write_dvd_ram 0x20 UCHAR WriteCap; // DevCap_*_write -/* UCHAR cd_r_write : 1; // reserved in 1.2 - UCHAR cd_rw_write : 1; // reserved in 1.2 +/* UCHAR cd_r_write : 1; // reserved in 1.2 + UCHAR cd_rw_write : 1; // reserved in 1.2 UCHAR test_write : 1; UCHAR reserved3a : 1; UCHAR dvd_r_write : 1; @@ -2656,16 +2656,16 @@ typedef struct _MODE_CAPABILITIES_PAGE2 { // 0x2A #define DevCap_separate_volume 0x01 #define DevCap_separate_mute 0x02 -#define DevCap_disc_present 0x04 // reserved in 1.2 -#define DevCap_sw_slot_select 0x08 // reserved in 1.2 -#define DevCap_change_side_cap 0x10 +#define DevCap_disc_present 0x04 // reserved in 1.2 +#define DevCap_sw_slot_select 0x08 // reserved in 1.2 +#define DevCap_change_side_cap 0x10 #define DevCap_rw_leadin_read 0x20 UCHAR Capabilities3; /* UCHAR separate_volume : 1; UCHAR separate_mute : 1; - UCHAR disc_present : 1; // reserved in 1.2 - UCHAR sss : 1; // reserved in 1.2 + UCHAR disc_present : 1; // reserved in 1.2 + UCHAR sss : 1; // reserved in 1.2 UCHAR Reserved7 : 4;*/ UCHAR MaximumSpeedSupported[2]; diff --git a/reactos/drivers/storage/ide/uniata/srb.h b/reactos/drivers/storage/ide/uniata/srb.h index ec9316ad625..3bf8579c989 100644 --- a/reactos/drivers/storage/ide/uniata/srb.h +++ b/reactos/drivers/storage/ide/uniata/srb.h @@ -56,7 +56,7 @@ typedef struct _PORT_CONFIGURATION_INFORMATION { // well as level, such as internal buses. ULONG BusInterruptVector; KINTERRUPT_MODE InterruptMode; // Interrupt mode (level-sensitive or edge-triggered) - + ULONG MaximumTransferLength; // Max bytes that can be transferred in a single SRB ULONG NumberOfPhysicalBreaks; // Number of contiguous blocks of physical memory ULONG DmaChannel; // DMA channel for devices using system DMA @@ -84,8 +84,8 @@ typedef struct _PORT_CONFIGURATION_INFORMATION { BOOLEAN MultipleRequestPerLu; // Supports multiple requests per logical unit. BOOLEAN ReceiveEvent; // Support receive event function. BOOLEAN RealModeInitialized; // Indicates the real-mode driver has initialized the card. - - BOOLEAN BufferAccessScsiPortControlled; // Indicate that the miniport will not touch + + BOOLEAN BufferAccessScsiPortControlled; // Indicate that the miniport will not touch // the data buffers directly. UCHAR MaximumNumberOfTargets; // Indicator for wide scsi. UCHAR ReservedUchars[2]; // Ensure quadword alignment. @@ -110,7 +110,7 @@ typedef struct _PORT_CONFIGURATION_INFORMATION_NT { } PORT_CONFIGURATION_INFORMATION_NT, *PPORT_CONFIGURATION_INFORMATION_NT; typedef struct _PORT_CONFIGURATION_INFORMATION_2K { - // Used to determine whether the system and/or the miniport support + // Used to determine whether the system and/or the miniport support // 64-bit physical addresses. See SCSI_DMA64_* flags below. UCHAR Dma64BitAddresses; // Indicates that the miniport can accept a SRB_FUNCTION_RESET_DEVICE @@ -141,9 +141,9 @@ typedef struct _PORT_CONFIGURATION_INFORMATION_COMMON { // // -// Set by scsiport on entering HwFindAdapter if the system can support 64-bit -// physical addresses. The miniport can use this information before calling -// ScsiPortGetUncachedExtension to modify the DeviceExtensionSize, +// Set by scsiport on entering HwFindAdapter if the system can support 64-bit +// physical addresses. The miniport can use this information before calling +// ScsiPortGetUncachedExtension to modify the DeviceExtensionSize, // SpecificLuExtensionSize & SrbExtensionSize fields to account for the extra // size of the scatter gather list. // @@ -152,7 +152,7 @@ typedef struct _PORT_CONFIGURATION_INFORMATION_COMMON { // // Set by the miniport before calling ScsiPortGetUncachedExtension to indicate -// that scsiport should provide it with 64-bit physical addresses. If the +// that scsiport should provide it with 64-bit physical addresses. If the // system does not support 64-bit PA's then this bit will be ignored. // @@ -363,9 +363,9 @@ typedef struct _SCSI_WMI_REQUEST_BLOCK { #define SRB_STATUS_INTERNAL_ERROR 0x30 // -// Srb status values 0x38 through 0x3f are reserved for internal port driver +// Srb status values 0x38 through 0x3f are reserved for internal port driver // use. -// +// @@ -566,7 +566,7 @@ typedef struct _HW_INITIALIZATION_DATA { ULONG SrbExtensionSize; ULONG NumberOfAccessRanges; PVOID Reserved; - + BOOLEAN MapBuffers; // Data buffers must be mapped into virtual address space. BOOLEAN NeedPhysicalAddresses; // We need to tranlate virtual to physical addresses. BOOLEAN TaggedQueuing; // Supports tagged queuing diff --git a/reactos/drivers/storage/ide/uniata/uniata.rbuild b/reactos/drivers/storage/ide/uniata/uniata.rbuild index 6ead4936e7e..992ea097acb 100644 --- a/reactos/drivers/storage/ide/uniata/uniata.rbuild +++ b/reactos/drivers/storage/ide/uniata/uniata.rbuild @@ -4,7 +4,7 @@ - . + . inc ntoskrnl hal @@ -17,11 +17,11 @@ id_queue.cpp id_sata.cpp idedma.rc - + ros_glue.cpp ros_glue_asm.s - + -lgcc diff --git a/reactos/drivers/storage/port/buslogic/BT958dt.h b/reactos/drivers/storage/port/buslogic/BT958dt.h index 6d839fdaf80..d5ef7146696 100644 --- a/reactos/drivers/storage/port/buslogic/BT958dt.h +++ b/reactos/drivers/storage/port/buslogic/BT958dt.h @@ -1,10 +1,10 @@ /* - * vmscsi-- Miniport driver for the Buslogic BT 958 SCSI Controller + * vmscsi-- Miniport driver for the Buslogic BT 958 SCSI Controller * under Windows 2000/XP/Server 2003 * * Based in parts on the buslogic driver for the same device * available with the GNU Linux Operating System. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -35,67 +35,67 @@ DEFINE_GUID(BT958ExtendedSetupInfoGuid_GUID, \ typedef struct _BT958ExtendedSetupInfo { - // + // UCHAR BusType; #define BT958ExtendedSetupInfo_BusType_SIZE sizeof(UCHAR) #define BT958ExtendedSetupInfo_BusType_ID 1 - // + // UCHAR BIOS_Address; #define BT958ExtendedSetupInfo_BIOS_Address_SIZE sizeof(UCHAR) #define BT958ExtendedSetupInfo_BIOS_Address_ID 2 - // + // USHORT ScatterGatherLimit; #define BT958ExtendedSetupInfo_ScatterGatherLimit_SIZE sizeof(USHORT) #define BT958ExtendedSetupInfo_ScatterGatherLimit_ID 3 - // + // UCHAR MailboxCount; #define BT958ExtendedSetupInfo_MailboxCount_SIZE sizeof(UCHAR) #define BT958ExtendedSetupInfo_MailboxCount_ID 4 - // + // ULONG BaseMailboxAddress; #define BT958ExtendedSetupInfo_BaseMailboxAddress_SIZE sizeof(ULONG) #define BT958ExtendedSetupInfo_BaseMailboxAddress_ID 5 - // + // BOOLEAN FastOnEISA; #define BT958ExtendedSetupInfo_FastOnEISA_SIZE sizeof(BOOLEAN) #define BT958ExtendedSetupInfo_FastOnEISA_ID 6 - // + // BOOLEAN LevelSensitiveInterrupt; #define BT958ExtendedSetupInfo_LevelSensitiveInterrupt_SIZE sizeof(BOOLEAN) #define BT958ExtendedSetupInfo_LevelSensitiveInterrupt_ID 7 - // + // UCHAR FirmwareRevision[3]; #define BT958ExtendedSetupInfo_FirmwareRevision_SIZE sizeof(UCHAR[3]) #define BT958ExtendedSetupInfo_FirmwareRevision_ID 8 - // + // BOOLEAN HostWideSCSI; #define BT958ExtendedSetupInfo_HostWideSCSI_SIZE sizeof(BOOLEAN) #define BT958ExtendedSetupInfo_HostWideSCSI_ID 9 - // + // BOOLEAN HostDifferentialSCSI; #define BT958ExtendedSetupInfo_HostDifferentialSCSI_SIZE sizeof(BOOLEAN) #define BT958ExtendedSetupInfo_HostDifferentialSCSI_ID 10 - // + // BOOLEAN HostSupportsSCAM; #define BT958ExtendedSetupInfo_HostSupportsSCAM_SIZE sizeof(BOOLEAN) #define BT958ExtendedSetupInfo_HostSupportsSCAM_ID 11 - // + // BOOLEAN HostUltraSCSI; #define BT958ExtendedSetupInfo_HostUltraSCSI_SIZE sizeof(BOOLEAN) #define BT958ExtendedSetupInfo_HostUltraSCSI_ID 12 - // + // BOOLEAN HostSmartTermination; #define BT958ExtendedSetupInfo_HostSmartTermination_SIZE sizeof(BOOLEAN) #define BT958ExtendedSetupInfo_HostSmartTermination_ID 13 diff --git a/reactos/drivers/storage/port/buslogic/BusLogic958.c b/reactos/drivers/storage/port/buslogic/BusLogic958.c index 3c824801665..a8da5b742d7 100644 --- a/reactos/drivers/storage/port/buslogic/BusLogic958.c +++ b/reactos/drivers/storage/port/buslogic/BusLogic958.c @@ -1,10 +1,10 @@ /* - * vmscsi-- Miniport driver for the Buslogic BT 958 SCSI Controller + * vmscsi-- Miniport driver for the Buslogic BT 958 SCSI Controller * under Windows 2000/XP/Server 2003 * * Based in parts on the buslogic driver for the same device * available with the GNU Linux Operating System. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -40,7 +40,7 @@ // on all flavours of WinXP and Win Server 2003 // For Win2k however, please refer PR 22812 /* -Revision History: +Revision History: v1.0.0.4 // Pre final release to VMware in Sep 2001, without WMI | | @@ -104,16 +104,16 @@ DriverEntry(IN PVOID DriverObject, DebugPrint((TRACE,"\n BusLogic - Inside the DriverEntry function \n")); - // Zero out structure. - for (i = 0; i < sizeof(HW_INITIALIZATION_DATA); i++) + // Zero out structure. + for (i = 0; i < sizeof(HW_INITIALIZATION_DATA); i++) { ((PUCHAR) & hwInitializationData)[i] = 0; } - // Set size of hwInitializationData. + // Set size of hwInitializationData. hwInitializationData.HwInitializationDataSize = sizeof(HW_INITIALIZATION_DATA); - // Set entry points. + // Set entry points. hwInitializationData.HwInitialize = BT958HwInitialize; hwInitializationData.HwResetBus = BT958HwResetBus; hwInitializationData.HwStartIo = BT958HwStartIO; @@ -123,7 +123,7 @@ DriverEntry(IN PVOID DriverObject, // Inidicate no buffer mapping but will need physical addresses hwInitializationData.NeedPhysicalAddresses = TRUE; - + // Indicate Auto request sense is supported hwInitializationData.AutoRequestSense = TRUE; hwInitializationData.MultipleRequestPerLu = TRUE; @@ -133,7 +133,7 @@ DriverEntry(IN PVOID DriverObject, #else hwInitializationData.TaggedQueuing = FALSE; #endif - + hwInitializationData.AdapterInterfaceType = PCIBus; // Fill in the vendor id and the device id @@ -141,15 +141,15 @@ DriverEntry(IN PVOID DriverObject, hwInitializationData.VendorIdLength = 4; hwInitializationData.DeviceId = &DeviceId; hwInitializationData.DeviceIdLength = 4; - + hwInitializationData.NumberOfAccessRanges = 2; - // Specify size of extensions. + // Specify size of extensions. hwInitializationData.DeviceExtensionSize = sizeof(HW_DEVICE_EXTENSION); - // logical unit extension + // logical unit extension hwInitializationData.SrbExtensionSize = sizeof(BusLogic_CCB_T); HwContext = 0; @@ -158,14 +158,14 @@ DriverEntry(IN PVOID DriverObject, Status = ScsiPortInitialize(DriverObject, Argument2, - &hwInitializationData, + &hwInitializationData, &HwContext); DebugPrint((TRACE,"\n BusLogic - Exiting the DriverEntry function \n")); DebugPrint((INFO,"\n BusLogic - Status = %ul \n", Status)); return( Status ); -} // end DriverEntry() +} // end DriverEntry() ULONG @@ -179,7 +179,7 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, ) //_________________________________________________________________________________________________ // Routine Description: -// This function is called by the OS-specific port driver after the necessary storage +// This function is called by the OS-specific port driver after the necessary storage // has been allocated, to gather information about the adapter's configuration. // // Arguments: @@ -190,16 +190,16 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, // // Return Value: // HwScsiFindAdapter must return one of the following status values: -// SP_RETURN_FOUND: Indicates a supported HBA was found and that the HBA-relevant -// configuration information was successfully determined and set in -// the PORT_CONFIGURATION_INFORMATION structure. -// SP_RETURN_ERROR: Indicates an HBA was found but there was error obtaining the -// configuration information. If possible, such an error should be -// logged with ScsiPortLogError. -// SP_RETURN_BAD_CONFIG: Indicates the supplied configuration information was invalid -// for the adapter. -// SP_RETURN_NOT_FOUND: Indicates no supported HBA was found for the supplied -// configuration information. +// SP_RETURN_FOUND: Indicates a supported HBA was found and that the HBA-relevant +// configuration information was successfully determined and set in +// the PORT_CONFIGURATION_INFORMATION structure. +// SP_RETURN_ERROR: Indicates an HBA was found but there was error obtaining the +// configuration information. If possible, such an error should be +// logged with ScsiPortLogError. +// SP_RETURN_BAD_CONFIG: Indicates the supplied configuration information was invalid +// for the adapter. +// SP_RETURN_NOT_FOUND: Indicates no supported HBA was found for the supplied +// configuration information. //________________________________________________________________________________________________ { PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; @@ -216,13 +216,13 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, accessRange = &((*(ConfigInfo->AccessRanges))[0]); - // Inform SCSIPORT that we are NOT a WMI data provider + // Inform SCSIPORT that we are NOT a WMI data provider // Sirish, 10th June 2002 ConfigInfo->WmiDataProvider = FALSE; /*Sirish, 10th June 2002 BT958WmiInitialize(deviceExtension);*/ // Check for configuration information passed in form the system - if ((*ConfigInfo->AccessRanges)[0].RangeLength != 0) + if ((*ConfigInfo->AccessRanges)[0].RangeLength != 0) { // check if the system supplied bus-relative address is valid and has not been // claimed by anyother device @@ -231,12 +231,12 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, ConfigInfo->SystemIoBusNumber, accessRange->RangeStart, accessRange->RangeLength, - TRUE) ) // TRUE: iniospace + TRUE) ) // TRUE: iniospace { DebugPrint((INFO,"\n BusLogic - Validate Range function succeeded \n")); // Map the Bus-relative range addresses to system-space logical range addresses - // so that these mapped logical addresses can be called with SciPortRead/Writexxx + // so that these mapped logical addresses can be called with SciPortRead/Writexxx // to determine whether the adapter is an HBA that the driver supports pciAddress = (PUCHAR) ScsiPortGetDeviceBase(deviceExtension, @@ -244,7 +244,7 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, ConfigInfo->SystemIoBusNumber, accessRange->RangeStart, accessRange->RangeLength, - TRUE); // TRUE: iniospace + TRUE); // TRUE: iniospace if(pciAddress) { @@ -261,17 +261,17 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, } } - if (NumPort == 0) + if (NumPort == 0) { return(SP_RETURN_NOT_FOUND); } // Hardware found, let's find out hardware configuration - // and fill out ConfigInfo table for WinNT + // and fill out ConfigInfo table for WinNT ConfigInfo->NumberOfBuses = 1; - ConfigInfo->MaximumTransferLength = MAX_TRANSFER_SIZE; - -#if SG_SUPPORT + ConfigInfo->MaximumTransferLength = MAX_TRANSFER_SIZE; + +#if SG_SUPPORT ConfigInfo->ScatterGather = TRUE; #else ConfigInfo->ScatterGather = FALSE; @@ -289,8 +289,8 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, #endif // Should we change this to double-word aligned to increase performance - ConfigInfo->AlignmentMask = 0x0; - + ConfigInfo->AlignmentMask = 0x0; + portFound = hcsp->IO_Address; if (!Buslogic_InitBT958(deviceExtension,ConfigInfo)) // harware specific initializations. Find what's for our card @@ -305,27 +305,27 @@ BT958HwFindAdapter(IN PVOID HwDeviceExtension, return(SP_RETURN_ERROR); } - + if (NumPort != 0) *Again = TRUE; return(SP_RETURN_FOUND); -} // end BT958FindAdapter() +} // end BT958FindAdapter() -BOOLEAN -Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, +BOOLEAN +Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo) //_________________________________________________________________________ // Routine Description: // This routine is called from the driver's FindAdapter routine -// On invocation this routine probes the host adapter to check -// if its hardware registers are responding correctly, and +// On invocation this routine probes the host adapter to check +// if its hardware registers are responding correctly, and // initializes the device and makes it ready for IO // Arguments: // 1. deviceExtension -// 2. Port Configuration info +// 2. Port Configuration info // Return Value: // TRUE : Device initialized properly // FALSE : Device failed to initialize @@ -334,20 +334,20 @@ Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, CHAR ch; BusLogic_HostAdapter_T *HostAdapter = &(deviceExtension->hcs); - - // Probe the Host Adapter. + + // Probe the Host Adapter. // If unsuccessful, abort further initialization. - if (!BusLogic_ProbeHostAdapter(HostAdapter)) - return FALSE; - - // Hard Reset the Host Adapter. + if (!BusLogic_ProbeHostAdapter(HostAdapter)) + return FALSE; + + // Hard Reset the Host Adapter. // If unsuccessful, abort further initialization. - if (!BusLogic_HardwareResetHostAdapter(HostAdapter, TRUE)) + if (!BusLogic_HardwareResetHostAdapter(HostAdapter, TRUE)) return FALSE; /* * PR 40284 -- Disable interrupts until driver initialization is complete. - */ + */ ch = 0; if (BusLogic_Command(HostAdapter, BusLogic_DisableHostAdapterInterrupt, &ch, sizeof(ch), NULL, 0) < 0) { @@ -356,18 +356,18 @@ Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, DebugPrint((INFO, "\n BusLogic - Disabled interrupts.\n")); } - // Check the Host Adapter. + // Check the Host Adapter. // If unsuccessful, abort further initialization. - if (!BusLogic_CheckHostAdapter(HostAdapter)) - return FALSE; - + if (!BusLogic_CheckHostAdapter(HostAdapter)) + return FALSE; + // Allocate a Noncached Extension to use for mail boxes. deviceExtension->NoncachedExtension = ScsiPortGetUncachedExtension(deviceExtension, ConfigInfo, sizeof(NONCACHED_EXTENSION)); - if (deviceExtension->NoncachedExtension == NULL) - { + if (deviceExtension->NoncachedExtension == NULL) + { // Log error. ScsiPortLogError(deviceExtension, NULL, @@ -393,22 +393,22 @@ Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, // Fill in the: // 1.Maximum number of scsi target devices that are supported by our adapter ConfigInfo->MaximumNumberOfTargets = HostAdapter->MaxTargetDevices; - // 2. Maximum number of logical units per target the HBA can control. + // 2. Maximum number of logical units per target the HBA can control. ConfigInfo->MaximumNumberOfLogicalUnits = HostAdapter->MaxLogicalUnits; ConfigInfo->InitiatorBusId[0] = HostAdapter->SCSI_ID; - // Maximum number of breaks between address ranges that a data buffer can - // have if the HBA supports scatter/gather. In other words, the number of - // scatter/gather lists minus one. - ConfigInfo->NumberOfPhysicalBreaks = HostAdapter->DriverScatterGatherLimit; + // Maximum number of breaks between address ranges that a data buffer can + // have if the HBA supports scatter/gather. In other words, the number of + // scatter/gather lists minus one. + ConfigInfo->NumberOfPhysicalBreaks = HostAdapter->DriverScatterGatherLimit; } else { // An error occurred during Host Adapter Configuration Querying, Host // Adapter Configuration, Host Adapter Initialization, or Target Device Inquiry, // so return FALSE - - return FALSE; - } + + return FALSE; + } // Initialization completed successfully return TRUE; } // end Buslogic_InitBT958 @@ -421,7 +421,7 @@ BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter) // The routine reads the status, interrupt and geometry regiter and // checks if their contents are valid // Arguments: -// 1. Host Adapter structure +// 1. Host Adapter structure // // Return Value: // TRUE: Probe completed successfully @@ -431,18 +431,18 @@ BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter) BusLogic_StatusRegister_T StatusRegister; BusLogic_InterruptRegister_T InterruptRegister; BusLogic_GeometryRegister_T GeometryRegister; - + DebugPrint((TRACE,"\n BusLogic - Inside ProbeHostaAdapter function \n")); // Read the Status, Interrupt, and Geometry Registers to test if there are I/O // ports that respond, and to check the values to determine if they are from a // BusLogic Host Adapter. A nonexistent I/O port will return 0xFF, in which // case there is definitely no BusLogic Host Adapter at this base I/O Address. // The test here is a subset of that used by the BusLogic Host Adapter BIOS. - + InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter); GeometryRegister.All = BusLogic_ReadGeometryRegister(HostAdapter); StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter); - + if (StatusRegister.All == 0 || StatusRegister.Bits.DiagnosticActive || StatusRegister.Bits.CommandParameterRegisterBusy || @@ -450,7 +450,7 @@ BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter) StatusRegister.Bits.CommandInvalid || InterruptRegister.Bits.Reserved != 0) return FALSE; - + // Check the undocumented Geometry Register to test if there is an I/O port // that responded. Adaptec Host Adapters do not implement the Geometry // Register, so this test helps serve to avoid incorrectly recognizing an @@ -463,24 +463,24 @@ BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter) // supported by this driver. However, the AMI FastDisk always returns 0x00 // upon reading the Geometry Register, so the extended translation option // should always be left disabled on the AMI FastDisk. - + if (GeometryRegister.All == 0xFF) return FALSE; return TRUE; }// end BusLogic_ProbeHostAdapter -BOOLEAN -BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, +BOOLEAN +BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, BOOLEAN HardReset) //_________________________________________________________________________ -// Routine Description: BusLogic_HardwareResetHostAdapter issues a Hardware -// Reset to the Host Adapter and waits for Host Adapter +// Routine Description: BusLogic_HardwareResetHostAdapter issues a Hardware +// Reset to the Host Adapter and waits for Host Adapter // Diagnostics to complete. If HardReset is TRUE, a -// Hard Reset is performed which also initiates a SCSI -// Bus Reset. Otherwise, a Soft Reset is performed which -// only resets the Host Adapter without forcing a SCSI +// Hard Reset is performed which also initiates a SCSI +// Bus Reset. Otherwise, a Soft Reset is performed which +// only resets the Host Adapter without forcing a SCSI // Bus Reset. // Arguments: -// 1. Host Adapter structure +// 1. Host Adapter structure // 2. Boolean HardReset - True: Do hard reset // Return Value: // TRUE : Reset completed successfully @@ -489,48 +489,48 @@ BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, { BusLogic_StatusRegister_T StatusRegister; int TimeoutCounter; - + // Issue a Hard Reset or Soft Reset Command to the Host Adapter. The Host // Adapter should respond by setting Diagnostic Active in the Status Register. if (HardReset) BusLogic_HardReset(HostAdapter); - else + else BusLogic_SoftReset(HostAdapter); - + // Wait until Diagnostic Active is set in the Status Register. TimeoutCounter = 100; while (--TimeoutCounter >= 0) { StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter); - if (StatusRegister.Bits.DiagnosticActive) + if (StatusRegister.Bits.DiagnosticActive) break; } - + // if inspite of waiting for time out period , if it didn't et set, then something is wrong-- so just return. - if (TimeoutCounter < 0) + if (TimeoutCounter < 0) return FALSE; - + // // Wait 100 microseconds to allow completion of any initial diagnostic // activity which might leave the contents of the Status Register // unpredictable. ScsiPortStallExecution(100); - + // Wait until Diagnostic Active is reset in the Status Register. TimeoutCounter = 10*10000; while (--TimeoutCounter >= 0) { StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter); - if (!StatusRegister.Bits.DiagnosticActive) + if (!StatusRegister.Bits.DiagnosticActive) break; ScsiPortStallExecution(100); } - - if (TimeoutCounter < 0) + + if (TimeoutCounter < 0) return FALSE; - + // Wait until at least one of the Diagnostic Failure, Host Adapter Ready, - // or Data In Register Ready bits is set in the Status Register. + // or Data In Register Ready bits is set in the Status Register. TimeoutCounter = 10000; while (--TimeoutCounter >= 0) { @@ -543,34 +543,34 @@ BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, } ScsiPortStallExecution(100); } - + //device didn't respond to reset if (TimeoutCounter < 0) return FALSE; - + // If Diagnostic Failure is set or Host Adapter Ready is reset, then an // error occurred during the Host Adapter diagnostics. If Data In Register // Ready is set, then there is an Error Code available. if (StatusRegister.Bits.DiagnosticFailure || !StatusRegister.Bits.HostAdapterReady) { DebugPrint((ERROR, "\n BusLogic - Failure - HOST ADAPTER STATUS REGISTER = %02X\n", StatusRegister.All)); - + if (StatusRegister.Bits.DataInRegisterReady) { DebugPrint((ERROR, "HOST ADAPTER ERROR CODE = %d\n", BusLogic_ReadDataInRegister(HostAdapter))); } return FALSE; - } - - // Indicate the Host Adapter Hard Reset completed successfully. + } + + // Indicate the Host Adapter Hard Reset completed successfully. return TRUE; }// end BusLogic_HardwareResetHostAdapter -BOOLEAN +BOOLEAN BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter) //_________________________________________________________________________ -// Routine Description: BusLogic_CheckHostAdapter checks to be sure this +// Routine Description: BusLogic_CheckHostAdapter checks to be sure this // really is a BusLogic // Arguments: // 1. Host Adapter Structure @@ -584,7 +584,7 @@ BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter) BOOLEAN Result = TRUE; DebugPrint((TRACE, "\n BusLogic - Inside BusLogic_CheckHostAdapter function \n")); - + // // Issue the Inquire Extended Setup Information command. Only genuine // BusLogic Host Adapters and TRUE clones support this command. Adaptec 1542C @@ -604,7 +604,7 @@ BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter) return Result; }// end BusLogic_CheckHostAdapter -int +int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, BusLogic_OperationCode_T OperationCode, void *ParameterData, @@ -627,7 +627,7 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, // Arguments: // 1. HostAdapter - Host Adapter structure // 2. OperationCode - Operation code for the command -// 3. ParameterData - Buffer containing parameters that needs to be passed as part +// 3. ParameterData - Buffer containing parameters that needs to be passed as part // of the command // 4. ParameterLength - Number of parameters // 5. ReplyData - Buffer where reply data is copied @@ -648,14 +648,14 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, // Clear out the Reply Data if provided. if (ReplyLength > 0) memset(ReplyData, 0, ReplyLength); - + // If the IRQ Channel has not yet been acquired, then interrupts must be // disabled while issuing host adapter commands since a Command Complete // interrupt could occur if the IRQ Channel was previously enabled by another // BusLogic Host Adapter or another driver sharing the same IRQ Channel. - + // Wait for the Host Adapter Ready bit to be set and the Command/Parameter - // Register Busy bit to be reset in the Status Register. + // Register Busy bit to be reset in the Status Register. TimeoutCounter = 10000; while (--TimeoutCounter >= 0) { @@ -673,11 +673,11 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, Result = -2; goto Done; } - + // Write the OperationCode to the Command/Parameter Register. HostAdapter->HostAdapterCommandCompleted = FALSE; BusLogic_WriteCommandParameterRegister(HostAdapter, (UCHAR)OperationCode); - + //Write any additional Parameter Bytes. TimeoutCounter = 10000; while (ParameterLength > 0 && --TimeoutCounter >= 0) @@ -693,15 +693,15 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, // the Operation Code was valid, and data is waiting to be read back // from the Host Adapter. Otherwise, wait for the Command/Parameter // Register Busy bit in the Status Register to be reset. - + ScsiPortStallExecution(100); InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter); StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter); - if (InterruptRegister.Bits.CommandComplete) + if (InterruptRegister.Bits.CommandComplete) break; - if (HostAdapter->HostAdapterCommandCompleted) + if (HostAdapter->HostAdapterCommandCompleted) break; - if (StatusRegister.Bits.DataInRegisterReady) + if (StatusRegister.Bits.DataInRegisterReady) break; if (StatusRegister.Bits.CommandParameterRegisterBusy) continue; @@ -714,7 +714,7 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, Result = -2; goto Done; } - + // The Modify I/O Address command does not cause a Command Complete Interrupt. if (OperationCode == BusLogic_ModifyIOAddress) { @@ -728,18 +728,18 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, Result = 0; goto Done; } - + // Select an appropriate timeout value for awaiting command completion. switch (OperationCode) { case BusLogic_InquireInstalledDevicesID0to7: case BusLogic_InquireInstalledDevicesID8to15: case BusLogic_InquireTargetDevices: - // Approximately 60 seconds. + // Approximately 60 seconds. TimeoutCounter = 60*10000; break; default: - // Approximately 1 second. + // Approximately 1 second. TimeoutCounter = 10000; break; } @@ -752,9 +752,9 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, { InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter); StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter); - if (InterruptRegister.Bits.CommandComplete) + if (InterruptRegister.Bits.CommandComplete) break; - if (HostAdapter->HostAdapterCommandCompleted) + if (HostAdapter->HostAdapterCommandCompleted) break; if (StatusRegister.Bits.DataInRegisterReady) { @@ -768,7 +768,7 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, } } if (OperationCode == BusLogic_FetchHostAdapterLocalRAM && - StatusRegister.Bits.HostAdapterReady) + StatusRegister.Bits.HostAdapterReady) { break; } @@ -780,10 +780,10 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, Result = -2; goto Done; } - + // Clear any pending Command Complete Interrupt. BusLogic_InterruptReset(HostAdapter); - + // Process Command Invalid conditions. if (StatusRegister.Bits.CommandInvalid) { @@ -794,7 +794,7 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, // commands are never attempted after Mailbox Initialization is // performed, so there should be no Host Adapter state lost by a // Soft Reset in response to a Command Invalid condition. - + ScsiPortStallExecution(1000); StatusRegister.All = BusLogic_ReadStatusRegister(HostAdapter); if (StatusRegister.Bits.CommandInvalid || @@ -813,7 +813,7 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, Result = -1; goto Done; } - + // Handle Excess Parameters Supplied conditions. if (ParameterLength > 0) { @@ -821,17 +821,17 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, Result = -1; goto Done; } - + // Indicate the command completed successfully. Result = ReplyBytes; - + // Restore the interrupt status if necessary and return. Done: return Result; }// end BusLogic_Command -BOOLEAN +BOOLEAN BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) //___________________________________________________________________________________________ // Routine Description: @@ -858,14 +858,14 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) BusLogic_RequestedReplyLength_T RequestedReplyLength; UCHAR *TargetPointer, Character; ULONG /*TargetID,*/ i; - - - // Issue the Inquire Board ID command. - if (BusLogic_Command(HostAdapter, + + + // Issue the Inquire Board ID command. + if (BusLogic_Command(HostAdapter, BusLogic_InquireBoardID, NULL, 0, - &BoardID, sizeof(BoardID)) + &BoardID, sizeof(BoardID)) != sizeof(BoardID)) { DebugPrint((ERROR, "\n BusLogic - Failure: INQUIRE BOARD ID\n")); @@ -873,9 +873,9 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) } // Issue the Inquire Configuration command. - if (BusLogic_Command(HostAdapter, - BusLogic_InquireConfiguration, - NULL, + if (BusLogic_Command(HostAdapter, + BusLogic_InquireConfiguration, + NULL, 0, &Configuration, sizeof(Configuration)) != sizeof(Configuration)) @@ -883,26 +883,26 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) DebugPrint((ERROR, "\n BusLogic - Failure: INQUIRE CONFIGURATION\n")); return FALSE; } - + // Issue the Inquire Setup Information command. RequestedReplyLength = sizeof(SetupInformation); - if (BusLogic_Command(HostAdapter, + if (BusLogic_Command(HostAdapter, BusLogic_InquireSetupInformation, &RequestedReplyLength, sizeof(RequestedReplyLength), - &SetupInformation, + &SetupInformation, sizeof(SetupInformation)) != sizeof(SetupInformation)) { DebugPrint((ERROR, "\n BusLogic - Failure: INQUIRE SETUP INFORMATION\n")); return FALSE; } - + // Issue the Inquire Extended Setup Information command. RequestedReplyLength = sizeof(ExtendedSetupInformation); - if (BusLogic_Command(HostAdapter, + if (BusLogic_Command(HostAdapter, BusLogic_InquireExtendedSetupInformation, - &RequestedReplyLength, + &RequestedReplyLength, sizeof(RequestedReplyLength), &ExtendedSetupInformation, sizeof(ExtendedSetupInformation)) @@ -911,7 +911,7 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) DebugPrint((ERROR, "\n BusLogic - Failure: INQUIRE EXTENDED SETUP INFORMATION\n")); return FALSE; } - + // Issue the Inquire Firmware Version 3rd Digit command. FirmwareVersion3rdDigit = '\0'; if (BoardID.FirmwareVersion1stDigit > '0') @@ -928,12 +928,12 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) return FALSE; } } - + // Issue the Inquire Host Adapter Model Number command. RequestedReplyLength = sizeof(HostAdapterModelNumber); - if (BusLogic_Command(HostAdapter, + if (BusLogic_Command(HostAdapter, BusLogic_InquireHostAdapterModelNumber, - &RequestedReplyLength, + &RequestedReplyLength, sizeof(RequestedReplyLength), &HostAdapterModelNumber, sizeof(HostAdapterModelNumber)) @@ -942,10 +942,10 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) DebugPrint((ERROR, "\n BusLogic - Failure: INQUIRE HOST ADAPTER MODEL NUMBER\n")); return FALSE; } - + // BusLogic MultiMaster Host Adapters can be identified by their model number // and the major version number of their firmware as follows: - // + // // 5.xx BusLogic "W" Series Host Adapters: // BT-948/958/958D // Save the Model Name and Host Adapter Name in the Host Adapter structure. @@ -960,7 +960,7 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) *TargetPointer++ = Character; } *TargetPointer++ = '\0'; - + // Save the Firmware Version in the Host Adapter structure. TargetPointer = HostAdapter->FirmwareVersion; *TargetPointer++ = BoardID.FirmwareVersion1stDigit; @@ -969,7 +969,7 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) if (FirmwareVersion3rdDigit != ' ' && FirmwareVersion3rdDigit != '\0') *TargetPointer++ = FirmwareVersion3rdDigit; *TargetPointer = '\0'; - + // Issue the Inquire Firmware Version Letter command. if (strcmp((char*)HostAdapter->FirmwareVersion, "3.3") >= 0) { @@ -990,24 +990,24 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) } *TargetPointer = '\0'; } - - + + // Save the Host Adapter SCSI ID in the Host Adapter structure. HostAdapter->SCSI_ID = Configuration.HostAdapterID; - + // Determine the Bus Type and save it in the Host Adapter structure, determine // and save the IRQ Channel if necessary, and determine and save the DMA // Channel for ISA Host Adapters. HostAdapter->HostAdapterBusType = BusLogic_HostAdapterBusTypes[HostAdapter->ModelName[3] - '4']; - + GeometryRegister.All = BusLogic_ReadGeometryRegister(HostAdapter); - + // Determine whether Extended Translation is enabled and save it in // the Host Adapter structure. // HostAdapter->ExtendedTranslationEnabled = GeometryRegister.Bits.ExtendedTranslationEnabled; HostAdapter->ExtendedTranslationEnabled = GeometryRegister.All; - - + + // Save the Scatter Gather Limits, Level Sensitive Interrupt flag, Wide // SCSI flag, Differential SCSI flag, SCAM Supported flag, and // Ultra SCSI flag in the Host Adapter structure. @@ -1031,8 +1031,8 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) HostAdapter->HostSupportsSCAM = ExtendedSetupInformation.HostSupportsSCAM; HostAdapter->HostUltraSCSI = ExtendedSetupInformation.HostUltraSCSI; - - + + // Determine whether Extended LUN Format CCBs are supported and save the // information in the Host Adapter structure. if (HostAdapter->FirmwareVersion[0] == '5' || @@ -1053,7 +1053,7 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) != sizeof(PCIHostAdapterInformation)) { DebugPrint((ERROR, "\n BusLogic - Failure: INQUIRE PCI HOST ADAPTER INFORMATION\n")); - return FALSE; + return FALSE; } // Save the Termination Information in the Host Adapter structure. @@ -1063,8 +1063,8 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) HostAdapter->LowByteTerminated = PCIHostAdapterInformation.LowByteTerminated; HostAdapter->HighByteTerminated = PCIHostAdapterInformation.HighByteTerminated; } - } - + } + // Issue the Fetch Host Adapter Local RAM command to read the AutoSCSI data // from "W" and "C" series MultiMaster Host Adapters. if (HostAdapter->FirmwareVersion[0] >= '4') @@ -1086,7 +1086,7 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) // Information in the Host Adapter structure. HostAdapter->ParityCheckingEnabled = AutoSCSIData.ParityCheckingEnabled; HostAdapter->BusResetEnabled = AutoSCSIData.BusResetEnabled; - + // Save the Wide Permitted, Fast Permitted, Synchronous Permitted, // Disconnect Permitted, Ultra Permitted, and SCAM Information in the // Host Adapter structure. @@ -1103,14 +1103,14 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) HostAdapter->SCAM_Enabled = AutoSCSIData.SCAM_Enabled; HostAdapter->SCAM_Level2 = AutoSCSIData.SCAM_Level2; } - } - + } + // Determine the maximum number of Target IDs and Logical Units supported by // this driver for Wide and Narrow Host Adapters. HostAdapter->MaxTargetDevices = (HostAdapter->HostWideSCSI ? 16 : 8); HostAdapter->MaxLogicalUnits = (HostAdapter->ExtendedLUNSupport ? 32 : 8); - - // Select appropriate values for the Mailbox Count, + + // Select appropriate values for the Mailbox Count, // Initial CCBs, and Incremental CCBs variables based on whether or not Strict // Round Robin Mode is supported. If Strict Round Robin Mode is supported, // then there is no performance degradation in using the maximum possible @@ -1132,26 +1132,26 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) { HostAdapter->HostAdapterQueueDepth = 192; } - + if (strcmp((char*)HostAdapter->FirmwareVersion, "3.31") >= 0) { HostAdapter->StrictRoundRobinModeSupport = TRUE; HostAdapter->MailboxCount = BusLogic_MaxMailboxes; } - + // // Tagged Queuing support is available and operates properly on all "W" series // MultiMaster Host Adapters, on "C" series MultiMaster Host Adapters with // firmware version 4.22 and above, and on "S" series MultiMaster Host // Adapters with firmware version 3.35 and above. HostAdapter->TaggedQueuingPermitted = 0xFFFF; - + // // Determine the Host Adapter BIOS Address if the BIOS is enabled and ///save it in the Host Adapter structure. The BIOS is disabled if the // BIOS_Address is 0. HostAdapter->BIOS_Address = ExtendedSetupInformation.BIOS_Address << 12; - + // //Initialize parameters for MultiMaster Host Adapters. @@ -1159,22 +1159,22 @@ BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter) // Initialize the Host Adapter Full Model Name from the Model Name. strcpy((char*)HostAdapter->FullModelName, "BusLogic "); strcat((char*)HostAdapter->FullModelName, (char*)HostAdapter->ModelName); - + // Tagged Queuing is only allowed if Disconnect/Reconnect is permitted. // Therefore, mask the Tagged Queuing Permitted Default bits with the // Disconnect/Reconnect Permitted bits. HostAdapter->TaggedQueuingPermitted &= HostAdapter->DisconnectPermitted; - + // Select an appropriate value for Bus Settle Time either from a BusLogic // Driver Options specification, or from BusLogic_DefaultBusSettleTime. HostAdapter->BusSettleTime = BusLogic_DefaultBusSettleTime; - + // Indicate reading the Host Adapter Configuration completed successfully. return TRUE; }// end BusLogic_ReadHostAdapterConfiguration -BOOLEAN -BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, +BOOLEAN +BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo) //_____________________________________________________________________________________________ // Routine Description: @@ -1186,7 +1186,7 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, // 2. port config information // Return Value: // TRUE : Host Adapter initialization completed successfully -// FALSE : Initialization failed +// FALSE : Initialization failed //______________________________________________________________________________________________ { BusLogic_HostAdapter_T *HostAdapter = &(deviceExtension->hcs); @@ -1197,12 +1197,12 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, // Used when we get the Physical address of the mail boxes ULONG length; - + // Initialize the pointers to the first and last CCBs that are queued for // completion processing. HostAdapter->FirstCompletedCCB = NULL; HostAdapter->LastCompletedCCB = NULL; - + // Initialize the Bus Device Reset Pending CCB, Tagged Queuing Active, // Command Successful Flag, Active Commands, and Commands Since Reset // for each Target Device. @@ -1211,14 +1211,14 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, HostAdapter->BusDeviceResetPendingCCB[TargetID] = NULL; HostAdapter->TargetFlags[TargetID].TaggedQueuingActive = FALSE; HostAdapter->TargetFlags[TargetID].CommandSuccessfulFlag = FALSE; - + HostAdapter->ActiveCommandsPerTarget[TargetID] = 0; for (LunID = 0; LunID < HostAdapter->MaxLogicalUnits; LunID++) HostAdapter->ActiveCommandsPerLun[TargetID][LunID] = 0; HostAdapter->CommandsSinceReset[TargetID] = 0; } - + // Convert virtual to physical mailbox address. deviceExtension->NoncachedExtension->MailboxPA = ScsiPortConvertPhysicalAddressToUlong( ScsiPortGetPhysicalAddress(deviceExtension, @@ -1235,13 +1235,13 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, HostAdapter->NextIncomingMailbox = HostAdapter->FirstIncomingMailbox; // Initialize the Outgoing and Incoming Mailbox structures. - memset(HostAdapter->FirstOutgoingMailbox, + memset(HostAdapter->FirstOutgoingMailbox, 0, HostAdapter->MailboxCount * sizeof(BusLogic_OutgoingMailbox_T)); - memset(HostAdapter->FirstIncomingMailbox, + memset(HostAdapter->FirstIncomingMailbox, 0, HostAdapter->MailboxCount * sizeof(BusLogic_IncomingMailbox_T)); - + ExtendedMailboxRequest.MailboxCount = HostAdapter->MailboxCount; ExtendedMailboxRequest.BaseMailboxAddress = deviceExtension->NoncachedExtension->MailboxPA ; @@ -1249,14 +1249,14 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, if (BusLogic_Command(HostAdapter, BusLogic_InitializeExtendedMailbox, &ExtendedMailboxRequest, - sizeof(ExtendedMailboxRequest), - NULL, 0) + sizeof(ExtendedMailboxRequest), + NULL, 0) < 0) { DebugPrint((ERROR, "\n BusLogic - Failure: MAILBOX INITIALIZATION\n")); return FALSE; } - + // Enable Strict Round Robin Mode if supported by the Host Adapter. In // Strict Round Robin Mode, the Host Adapter only looks at the next Outgoing // Mailbox for each new command, rather than scanning through all the @@ -1265,10 +1265,10 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, if (HostAdapter->StrictRoundRobinModeSupport) { RoundRobinModeRequest = BusLogic_StrictRoundRobinMode; - if (BusLogic_Command(HostAdapter, + if (BusLogic_Command(HostAdapter, BusLogic_EnableStrictRoundRobinMode, &RoundRobinModeRequest, - sizeof(RoundRobinModeRequest), + sizeof(RoundRobinModeRequest), NULL, 0) < 0) @@ -1277,7 +1277,7 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, return FALSE; } } - + // For Host Adapters that support Extended LUN Format CCBs, issue the Set CCB // Format command to allow 32 Logical Units per Target Device. @@ -1296,25 +1296,25 @@ BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, return FALSE; } } - - // Announce Successful Initialization. + + // Announce Successful Initialization. if (!HostAdapter->HostAdapterInitialized) { - DebugPrint((INFO, "\n BusLogic - %s Initialized Successfully\n", - HostAdapter, HostAdapter->FullModelName)); + DebugPrint((INFO, "\n BusLogic - %s Initialized Successfully\n", + HostAdapter, HostAdapter->FullModelName)); } else { - DebugPrint((WARNING, "\n BusLogic - %s not initialized Successfully\n", + DebugPrint((WARNING, "\n BusLogic - %s not initialized Successfully\n", HostAdapter, HostAdapter->FullModelName)); } - HostAdapter->HostAdapterInitialized = TRUE; + HostAdapter->HostAdapterInitialized = TRUE; // Indicate the Host Adapter Initialization completed successfully. return TRUE; }// end BusLogic_InitializeHostAdapter -BOOLEAN +BOOLEAN BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) //_________________________________________________________________________________________ // Routine Description: @@ -1322,7 +1322,7 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) // through Host Adapter. // Arguments: // 1. Host Adpater structure -// 2. +// 2. // Return Value: // TRUE : Inquiry successful // FALSE : Inquiry failed @@ -1334,7 +1334,7 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) BusLogic_SynchronousPeriod_T SynchronousPeriod; BusLogic_RequestedReplyLength_T RequestedReplyLength; int TargetID; - + // Wait a few seconds between the Host Adapter Hard Reset which initiates // a SCSI Bus Reset and issuing any SCSI Commands. Some SCSI devices get // confused if they receive SCSI Commands too soon after a SCSI Bus Reset. @@ -1351,7 +1351,7 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) if (strcmp((char*)HostAdapter->FirmwareVersion, "4.25") >= 0) { if (BusLogic_Command(HostAdapter, - BusLogic_InquireTargetDevices, + BusLogic_InquireTargetDevices, NULL, 0, &InstalledDevices, @@ -1366,10 +1366,10 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) HostAdapter->TargetFlags[TargetID].TargetExists = (InstalledDevices & (1 << TargetID) ? TRUE : FALSE); } } - + // Issue the Inquire Setup Information command. RequestedReplyLength = sizeof(SetupInformation); - if (BusLogic_Command(HostAdapter, + if (BusLogic_Command(HostAdapter, BusLogic_InquireSetupInformation, &RequestedReplyLength, sizeof(RequestedReplyLength), @@ -1398,7 +1398,7 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) } } - + // Issue the Inquire Synchronous Period command. if (HostAdapter->FirmwareVersion[0] >= '3') { @@ -1407,7 +1407,7 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) BusLogic_InquireSynchronousPeriod, &RequestedReplyLength, sizeof(RequestedReplyLength), - &SynchronousPeriod, + &SynchronousPeriod, sizeof(SynchronousPeriod)) != sizeof(SynchronousPeriod)) { @@ -1419,7 +1419,7 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) HostAdapter->SynchronousPeriod[TargetID] = SynchronousPeriod[TargetID]; } } - + // Indicate the Target Device Inquiry completed successfully. return TRUE; }// end BusLogic_TargetDeviceInquiry @@ -1427,20 +1427,20 @@ BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter) VOID BusLogic_InitializeCCB( PBuslogic_CCB_T CCB) { CCB->Opcode = BusLogic_InitiatorCCB; - CCB->DataDirection = 0; - CCB->TagEnable = 0; - CCB->QueueTag = 0 ; - CCB->CDB_Length = 0; - CCB->SenseDataLength = 0; + CCB->DataDirection = 0; + CCB->TagEnable = 0; + CCB->QueueTag = 0 ; + CCB->CDB_Length = 0; + CCB->SenseDataLength = 0; CCB->DataLength = 0; CCB->DataPointer = 0; CCB->HostAdapterStatus = 0; CCB->TargetDeviceStatus = 0; - CCB->TargetID = 0; - CCB->LogicalUnit = 0; - CCB->LegacyTagEnable = 0; - CCB->LegacyQueueTag = 0; - + CCB->TargetID = 0; + CCB->LogicalUnit = 0; + CCB->LegacyTagEnable = 0; + CCB->LegacyQueueTag = 0; + CCB->SenseDataPointer = 0; // BusLogic Driver Defined Portion @@ -1448,7 +1448,7 @@ VOID BusLogic_InitializeCCB( PBuslogic_CCB_T CCB) CCB->SerialNumber = 0; CCB->Next = NULL; CCB->HostAdapter = NULL; - + CCB->CompletionCode = 0; // Pointer to the CCB CCB->SrbAddress = NULL; @@ -1462,14 +1462,14 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, ) //__________________________________________________________________________________ // Routine Description: -// As soon as it receives the initial request for a -// target peripheral, the OS-specific port driver calls -// the HwScsiStartIo routine with an input SRB. After -// this call, the HBA miniport driver owns the request +// As soon as it receives the initial request for a +// target peripheral, the OS-specific port driver calls +// the HwScsiStartIo routine with an input SRB. After +// this call, the HBA miniport driver owns the request // and is expected to complete it. // Arguments: -// 1. DeviceExtension: Points to the miniport driver's per-HBA storage area. -// 2. Srb: Points to the SCSI request block to be started. +// 1. DeviceExtension: Points to the miniport driver's per-HBA storage area. +// 2. Srb: Points to the SCSI request block to be started. // Return Value: // TRUE : HwScsiStartIo returns TRUE to acknowledge receipt of the SRB. //__________________________________________________________________________________ @@ -1482,10 +1482,10 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, PBuslogic_CCB_T ccb; BusLogic_TargetFlags_T *TargetFlags = &HostAdapter->TargetFlags[Srb->TargetId]; - - + + DebugPrint((TRACE, "\n BusLogic - Inside Start IO routine\n")); - + // Make sure that this request isn't too long for the adapter. If so // bounce it back as an invalid request if (BusLogic_CDB_MaxLength < Srb->CdbLength) @@ -1500,16 +1500,16 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, return TRUE; } - switch (Srb->Function) - { + switch (Srb->Function) + { /* - Sirish, 10th June 2002 + Sirish, 10th June 2002 // Check if command is a WMI request. case SRB_FUNCTION_WMI: // Process the WMI request and return. return BT958WmiSrb(HwDeviceExtension, (PSCSI_WMI_REQUEST_BLOCK) Srb); */ - + case SRB_FUNCTION_EXECUTE_SCSI: // get the ccb structure from the extension @@ -1519,9 +1519,9 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, // Save SRB back pointer in CCB. ccb->SrbAddress = Srb; - // Build CCB. - Have some way of knowing that a srb has already been + // Build CCB. - Have some way of knowing that a srb has already been // completed and you just need to return from here - BusLogic_QueueCommand(HwDeviceExtension ,Srb, ccb); + BusLogic_QueueCommand(HwDeviceExtension ,Srb, ccb); // Place the CCB in an Outgoing Mailbox. The higher levels of the SCSI // Subsystem should not attempt to queue more commands than can be placed @@ -1532,7 +1532,7 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, if (!BusLogic_WriteOutgoingMailbox(deviceExtension , BusLogic_MailboxStartCommand, ccb)) { - DebugPrint((ERROR, "\n BusLogic - Unable to write Outgoing Mailbox - " + DebugPrint((ERROR, "\n BusLogic - Unable to write Outgoing Mailbox - " "Pausing for 1 second\n")); ScsiPortStallExecution(1000); if (!BusLogic_WriteOutgoingMailbox(deviceExtension , BusLogic_MailboxStartCommand, ccb)) @@ -1546,7 +1546,7 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, } } - else + else { /* * Reverted to pre 1.1.0.0 control flow @@ -1561,30 +1561,30 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, else { ScsiPortNotification(NextRequest,deviceExtension,NULL); } - } + } return TRUE; case SRB_FUNCTION_ABORT_COMMAND: - + // Get CCB to abort. ccb = Srb->NextSrb->SrbExtension; // Set abort SRB for completion. ccb->AbortSrb = Srb; - AbortSRB = ScsiPortGetSrb(HwDeviceExtension, - Srb->PathId, - Srb->TargetId, - Srb->Lun, + AbortSRB = ScsiPortGetSrb(HwDeviceExtension, + Srb->PathId, + Srb->TargetId, + Srb->Lun, Srb->QueueTag); - - if ((AbortSRB != Srb->NextSrb) || (AbortSRB->SrbStatus != SRB_STATUS_PENDING)) + + if ((AbortSRB != Srb->NextSrb) || (AbortSRB->SrbStatus != SRB_STATUS_PENDING)) { Srb->SrbStatus = SRB_STATUS_ABORT_FAILED; ScsiPortNotification(RequestComplete, HwDeviceExtension, Srb); ScsiPortNotification(NextRequest, HwDeviceExtension, NULL); return TRUE; - } + } // write the abort information into a mailbox if (BusLogic_WriteOutgoingMailbox( deviceExtension, BusLogic_MailboxAbortCommand, ccb)) @@ -1610,7 +1610,7 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, else { DebugPrint((WARNING, "\n BusLogic - Unable to Abort CCB #%ld to Target %d" - " - No Outgoing Mailboxes\n", ccb->SerialNumber, + " - No Outgoing Mailboxes\n", ccb->SerialNumber, Srb->TargetId)); Srb->SrbStatus = SRB_STATUS_ERROR; ScsiPortNotification(RequestComplete, HwDeviceExtension, Srb); @@ -1620,19 +1620,19 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, case SRB_FUNCTION_RESET_BUS: - - // Reset SCSI bus. - DebugPrint((INFO, "\n BusLogic - SRB_FUNCTION_RESET_BUS, srb=%x \n",Srb)); + + // Reset SCSI bus. + DebugPrint((INFO, "\n BusLogic - SRB_FUNCTION_RESET_BUS, srb=%x \n",Srb)); BT958HwResetBus(HwDeviceExtension, Srb->PathId); Srb->SrbStatus = SRB_STATUS_SUCCESS; ScsiPortNotification(RequestComplete, HwDeviceExtension, Srb); ScsiPortNotification(NextRequest, HwDeviceExtension, NULL); return TRUE; - + case SRB_FUNCTION_RESET_DEVICE: - + ccb = Srb->SrbExtension; BusLogic_InitializeCCB(ccb); @@ -1645,9 +1645,9 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, Srb->SrbStatus = SRB_STATUS_SUCCESS; ScsiPortNotification(RequestComplete, HwDeviceExtension, Srb); ScsiPortNotification(NextRequest, HwDeviceExtension, NULL); - return TRUE; - } - + return TRUE; + } + /* * Reverted to pre 1.1.0.0 control flow * The 1.1.0.0 control flow causes the .NET Server freeze during installs/restarts @@ -1662,9 +1662,9 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, ScsiPortNotification(NextRequest,deviceExtension,NULL); } return TRUE; - + default: - + // Set error, complete request and signal ready for next request. Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST; ScsiPortNotification(RequestComplete,deviceExtension,Srb); @@ -1672,12 +1672,12 @@ BT958HwStartIO(IN PVOID HwDeviceExtension, return TRUE; - } // end switch - + } // end switch + }// end BusLogic_TargetDeviceInquiry -BOOLEAN +BOOLEAN BusLogic_WriteOutgoingMailbox(PHW_DEVICE_EXTENSION deviceExtension , BusLogic_ActionCode_T ActionCode, BusLogic_CCB_T *CCB) @@ -1708,13 +1708,13 @@ BusLogic_WriteOutgoingMailbox(PHW_DEVICE_EXTENSION deviceExtension , if (NextOutgoingMailbox->ActionCode == BusLogic_OutgoingMailboxFree) { CCB->Status = BusLogic_CCB_Active; - + // The CCB field must be written before the Action Code field since // the Host Adapter is operating asynchronously and the locking code // does not protect against simultaneous access by the Host Adapter. - + // Get CCB physical address. - NextOutgoingMailbox->CCB = ScsiPortConvertPhysicalAddressToUlong( ScsiPortGetPhysicalAddress(deviceExtension, + NextOutgoingMailbox->CCB = ScsiPortConvertPhysicalAddressToUlong( ScsiPortGetPhysicalAddress(deviceExtension, NULL, CCB, &length)); @@ -1745,13 +1745,13 @@ BusLogic_WriteOutgoingMailbox(PHW_DEVICE_EXTENSION deviceExtension , }// end BusLogic_WriteOutgoingMailbox -int +int BusLogic_QueueCommand(IN PVOID HwDeviceExtension , - IN PSCSI_REQUEST_BLOCK Srb, + IN PSCSI_REQUEST_BLOCK Srb, PBuslogic_CCB_T CCB) //_________________________________________________________________________ // Routine Description: -// BusLogic_QueueCommand creates a CCB for Command +// BusLogic_QueueCommand creates a CCB for Command // Arguments: // 1. HwDeviceExtemsion: device extension // 2. Srb: Pointe to the SRB @@ -1775,17 +1775,17 @@ BusLogic_QueueCommand(IN PVOID HwDeviceExtension , // void *BufferPointer = Srb->DataBuffer; int BufferLength = Srb->DataTransferLength; - if (Srb->DataTransferLength > 0) + if (Srb->DataTransferLength > 0) { - CCB->DataLength = Srb->DataTransferLength; + CCB->DataLength = Srb->DataTransferLength; // Initialize the fields in the BusLogic Command Control Block (CCB). #if SG_SUPPORT - { + { ULONG xferLength, remainLength; PVOID virtualAddress; UCHAR i = 0; - + virtualAddress = Srb->DataBuffer; xferLength = Srb->DataTransferLength; remainLength = xferLength; @@ -1817,20 +1817,20 @@ BusLogic_QueueCommand(IN PVOID HwDeviceExtension , if (i > 1) { CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather; - CCB->DataLength = i * sizeof(BusLogic_ScatterGatherSegment_T); + CCB->DataLength = i * sizeof(BusLogic_ScatterGatherSegment_T); virtualAddress = (PVOID) & (CCB->ScatterGatherList); CCB->DataPointer = ScsiPortConvertPhysicalAddressToUlong( ScsiPortGetPhysicalAddress(HwDeviceExtension, 0, (PVOID)virtualAddress, &length)); - } - else /* Turn off SG */ + } + else /* Turn off SG */ { CCB->Opcode = BusLogic_InitiatorCCB; CCB->DataLength = CCB->ScatterGatherList[0].SegmentByteCount; CCB->DataPointer = CCB->ScatterGatherList[0].SegmentDataPointer; - + } } #else @@ -1840,34 +1840,34 @@ BusLogic_QueueCommand(IN PVOID HwDeviceExtension , Srb, BufferPointer, &length)); -#endif +#endif } - switch (Srb->SrbFlags & SRB_FLAGS_UNSPECIFIED_DIRECTION) + switch (Srb->SrbFlags & SRB_FLAGS_UNSPECIFIED_DIRECTION) { - case SRB_FLAGS_NO_DATA_TRANSFER: + case SRB_FLAGS_NO_DATA_TRANSFER: CCB->DataDirection = BusLogic_NoDataTransfer; break; case SRB_FLAGS_DATA_IN: CCB->DataDirection = BusLogic_DataInLengthChecked; TargetStatistics[TargetID].ReadCommands++; - BusLogic_IncrementByteCounter(&TargetStatistics[TargetID].TotalBytesRead, + BusLogic_IncrementByteCounter(&TargetStatistics[TargetID].TotalBytesRead, BufferLength); BusLogic_IncrementSizeBucket(TargetStatistics[TargetID].ReadCommandSizeBuckets, - BufferLength); + BufferLength); break; case SRB_FLAGS_DATA_OUT: CCB->DataDirection = BusLogic_DataOutLengthChecked; TargetStatistics[TargetID].WriteCommands++; - BusLogic_IncrementByteCounter(&TargetStatistics[TargetID].TotalBytesWritten, + BusLogic_IncrementByteCounter(&TargetStatistics[TargetID].TotalBytesWritten, BufferLength); - BusLogic_IncrementSizeBucket(TargetStatistics[TargetID].WriteCommandSizeBuckets, - BufferLength); - + BusLogic_IncrementSizeBucket(TargetStatistics[TargetID].WriteCommandSizeBuckets, + BufferLength); + break; - + case SRB_FLAGS_UNSPECIFIED_DIRECTION: /* let device decide direction */ default: CCB->DataDirection = BusLogic_UncheckedDataTransfer; @@ -1883,7 +1883,7 @@ BusLogic_QueueCommand(IN PVOID HwDeviceExtension , CCB->LogicalUnit = LogicalUnit; CCB->TagEnable = FALSE; CCB->LegacyTagEnable = FALSE; - + // BusLogic recommends that after a Reset the first couple of commands that // are sent to a Target Device be sent in a non Tagged Queue fashion so that // the Host Adapter and Target Device can establish Synchronous and Wide @@ -1904,13 +1904,13 @@ BusLogic_QueueCommand(IN PVOID HwDeviceExtension , (HostAdapter->TaggedQueuingPermitted & (1 << TargetID))) { TargetFlags->TaggedQueuingActive = TRUE; - DebugPrint((INFO, "\n BusLogic - Tagged Queuing now active for Target %d\n", + DebugPrint((INFO, "\n BusLogic - Tagged Queuing now active for Target %d\n", TargetID)); } if (TargetFlags->TaggedQueuingActive) { BusLogic_QueueTag_T QueueTag = BusLogic_SimpleQueueTag; - + // When using Tagged Queuing with Simple Queue Tags, it appears that disk // drive controllers do not guarantee that a queued command will not // remain in a disconnected state indefinitely if commands that read or @@ -1944,12 +1944,12 @@ BusLogic_QueueCommand(IN PVOID HwDeviceExtension , } ScsiPortMoveMemory(CCB->CDB, Srb->Cdb, CDB_Length); - - //Fix for the XP Port driver - shuts of auto sense at times. 22nd May 2002 + + //Fix for the XP Port driver - shuts of auto sense at times. 22nd May 2002 //{sirish, shobhit}@calsoftinc.com - if ((Srb->SrbFlags & SRB_FLAGS_DISABLE_AUTOSENSE) || + if ((Srb->SrbFlags & SRB_FLAGS_DISABLE_AUTOSENSE) || (Srb->SenseInfoBufferLength <= 0)) { - + //Disable auto request sense CCB->SenseDataLength = BusLogic_DisableAutoReqSense; } else { @@ -1965,7 +1965,7 @@ BusLogic_QueueCommand(IN PVOID HwDeviceExtension , CCB->SenseDataLength = (unsigned char) length; } } - + return 0; }// end BusLogic_QueueCommand @@ -1975,18 +1975,18 @@ STDCALL BT958HwInterrupt(IN PVOID HwDeviceExtension) //_________________________________________________________________________ // Routine Description: -// HwScsiInterrupt is called when the HBA generates an -// interrupt. Miniport drivers of HBAs that do not +// HwScsiInterrupt is called when the HBA generates an +// interrupt. Miniport drivers of HBAs that do not // generate interrupts do not have this routine. -// HwScsiInterrupt is responsible for completing -// interrupt-driven I/O operations. This routine must +// HwScsiInterrupt is responsible for completing +// interrupt-driven I/O operations. This routine must // clear the interrupt on the HBA before it returns TRUE. // Arguments: -// 1. HwDeviceExtension: Points to the miniport driver's per-HBA storage area. +// 1. HwDeviceExtension: Points to the miniport driver's per-HBA storage area. // Return Value: // TRUE : Acknowledged the interrupts on the HBA -// FALSE: If the miniport finds that its HBA did not generate -// the interrupt, HwScsiInterrupt should return FALSE +// FALSE: If the miniport finds that its HBA did not generate +// the interrupt, HwScsiInterrupt should return FALSE // as soon as possible. //_________________________________________________________________________ { @@ -1995,18 +1995,18 @@ BT958HwInterrupt(IN PVOID HwDeviceExtension) BusLogic_HostAdapter_T *HostAdapter = &(deviceExtension->hcs); // PBuslogic_CCB_T ccb; // PSCSI_REQUEST_BLOCK srb; - + // ULONG residualBytes; // ULONG i; - + BusLogic_InterruptRegister_T InterruptRegister; - + // Read the Host Adapter Interrupt Register. InterruptRegister.All = BusLogic_ReadInterruptRegister(HostAdapter); if (InterruptRegister.Bits.InterruptValid) { - + // Acknowledge the interrupt and reset the Host Adapter // Interrupt Register. BusLogic_InterruptReset(HostAdapter); @@ -2028,8 +2028,8 @@ BT958HwInterrupt(IN PVOID HwDeviceExtension) } } else - return FALSE; - + return FALSE; + // Process any completed CCBs. if (HostAdapter->FirstCompletedCCB != NULL) BusLogic_ProcessCompletedCCBs(deviceExtension); @@ -2041,12 +2041,12 @@ BT958HwInterrupt(IN PVOID HwDeviceExtension) // I have replaced the NULL with srb->pathid check if this is correct BT958HwResetBus(HwDeviceExtension, SP_UNTAGGED); HostAdapter->HostAdapterExternalReset = FALSE; - HostAdapter->HostAdapterInternalError = FALSE; - } + HostAdapter->HostAdapterInternalError = FALSE; + } return TRUE; }// end BT958HwInterrupt -void +void BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension) //________________________________________________________________________________________ // Routine Description: @@ -2055,10 +2055,10 @@ BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension) // Arguments: // 1. deviceExtension : pointer to the device extension //_________________________________________________________________________________________ -{ +{ BusLogic_HostAdapter_T *HostAdapter = &(deviceExtension->hcs); - - + + // Scan through the Incoming Mailboxes in Strict Round Robin fashion, saving // any completed CCBs for further processing. It is essential that for each // CCB and SCSI Command issued, command completion processing is performed @@ -2075,7 +2075,7 @@ BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension) while ((CompletionCode = NextIncomingMailbox->CompletionCode) != BusLogic_IncomingMailboxFree) { // Convert Physical CCB to Virtual. - BusLogic_CCB_T *CCB = (BusLogic_CCB_T *) ScsiPortGetVirtualAddress(deviceExtension, + BusLogic_CCB_T *CCB = (BusLogic_CCB_T *) ScsiPortGetVirtualAddress(deviceExtension, ScsiPortConvertUlongToPhysicalAddress(NextIncomingMailbox->CCB)); DebugPrint((INFO, "\n Buslogic - Virtual CCB %lx\n", CCB)); @@ -2083,7 +2083,7 @@ BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension) { if (CCB->Status == BusLogic_CCB_Active || CCB->Status == BusLogic_CCB_Reset) { - + // Save the Completion Code for this CCB and queue the CCB // for completion processing. CCB->CompletionCode = CompletionCode; @@ -2094,7 +2094,7 @@ BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension) // If a CCB ever appears in an Incoming Mailbox and is not marked // as status Active or Reset, then there is most likely a bug in // the Host Adapter firmware. - DebugPrint((ERROR, "\n BusLogic - Illegal CCB #%ld status %d in " + DebugPrint((ERROR, "\n BusLogic - Illegal CCB #%ld status %d in " "Incoming Mailbox\n", CCB->SerialNumber, CCB->Status)); } } @@ -2106,8 +2106,8 @@ BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension) }// end BusLogic_ScanIncomingMailboxes -void -BusLogic_QueueCompletedCCB(PHW_DEVICE_EXTENSION deviceExtension, +void +BusLogic_QueueCompletedCCB(PHW_DEVICE_EXTENSION deviceExtension, BusLogic_CCB_T *CCB) //_________________________________________________________________________________ // Routine Description: @@ -2137,7 +2137,7 @@ BusLogic_QueueCompletedCCB(PHW_DEVICE_EXTENSION deviceExtension, }// end BusLogic_QueueCompletedCCB -void +void BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) //_________________________________________________________________________________ // Routine Description: @@ -2154,32 +2154,32 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) PSCSI_REQUEST_BLOCK srb; PCDB RealCdb; - if (HostAdapter->ProcessCompletedCCBsActive) + if (HostAdapter->ProcessCompletedCCBsActive) return; HostAdapter->ProcessCompletedCCBsActive = TRUE; while (HostAdapter->FirstCompletedCCB != NULL) { BusLogic_CCB_T *CCB = HostAdapter->FirstCompletedCCB; - + // Get SRB from CCB. srb = CCB->SrbAddress; HostAdapter->FirstCompletedCCB = CCB->Next; if (HostAdapter->FirstCompletedCCB == NULL) HostAdapter->LastCompletedCCB = NULL; - + // Process the Completed CCB. if (CCB->Opcode == BusLogic_BusDeviceReset) { int TargetID = CCB->TargetID, LunID; - DebugPrint((TRACE, "\n BusLogic - Bus Device Reset CCB #%ld to Target " - "%d Completed\n", CCB->SerialNumber, TargetID)); + DebugPrint((TRACE, "\n BusLogic - Bus Device Reset CCB #%ld to Target " + "%d Completed\n", CCB->SerialNumber, TargetID)); BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].BusDeviceResetsCompleted); - + HostAdapter->TargetFlags[TargetID].TaggedQueuingActive = FALSE; HostAdapter->CommandsSinceReset[TargetID] = 0; //HostAdapter->LastResetCompleted[TargetID] = jiffies; - HostAdapter->ActiveCommandsPerTarget[TargetID] = 0; + HostAdapter->ActiveCommandsPerTarget[TargetID] = 0; for (LunID = 0; LunID < HostAdapter->MaxLogicalUnits; LunID++) HostAdapter->ActiveCommandsPerLun[TargetID][LunID] = 0; @@ -2189,8 +2189,8 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) srb->TargetId, 0xFF, (ULONG)SRB_STATUS_BUS_RESET); - - + + HostAdapter->BusDeviceResetPendingCCB[TargetID] = NULL; } else @@ -2207,11 +2207,11 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) break; } - //Processing for CCB that was to be aborted + //Processing for CCB that was to be aborted case BusLogic_AbortedCommandNotFound: { srb = CCB->AbortSrb; - srb->SrbStatus = SRB_STATUS_ABORT_FAILED; + srb->SrbStatus = SRB_STATUS_ABORT_FAILED; break; } @@ -2226,7 +2226,7 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) case BusLogic_CommandAbortedAtHostRequest: { - DebugPrint((TRACE, "\n BusLogic - CCB #%ld to Target %d Aborted\n", + DebugPrint((TRACE, "\n BusLogic - CCB #%ld to Target %d Aborted\n", CCB->SerialNumber, CCB->TargetID)); //BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[CCB->TargetID].CommandAbortsCompleted); @@ -2242,7 +2242,7 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) // Set status for completing abort request. srb->SrbStatus = SRB_STATUS_SUCCESS; - break; + break; } case BusLogic_CommandCompletedWithError: @@ -2250,7 +2250,7 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) RealCdb = (PCDB)CCB->CDB; DebugPrint((ERROR, "\n BusLogic - %x Command completed with error Host - " "%x Target %x \n", RealCdb->CDB6GENERIC.OperationCode, - CCB->HostAdapterStatus, CCB->TargetDeviceStatus)); + CCB->HostAdapterStatus, CCB->TargetDeviceStatus)); srb->SrbStatus = BusLogic_ComputeResultCode(HostAdapter, CCB->HostAdapterStatus, @@ -2279,7 +2279,7 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) }// end switch - + // When an INQUIRY command completes normally, save the CmdQue (Tagged Queuing Supported) // and WBus16 (16 Bit Wide Data Transfers Supported) bits. RealCdb = (PCDB) CCB->CDB; @@ -2292,7 +2292,7 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) TargetFlags->TaggedQueuingSupported = InquiryResult->CmdQue; TargetFlags->WideTransfersSupported = InquiryResult->WBus16; } - + DebugPrint((INFO, "\n BusLogic - SCSI Status %x\n", srb->ScsiStatus)); DebugPrint((INFO, "\n BusLogic - HBA Status %x\n", CCB->HostAdapterStatus)); @@ -2307,7 +2307,7 @@ BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension) }// end BusLogic_ProcessCompletedCCBs -UCHAR +UCHAR BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, BusLogic_HostAdapterStatus_T HostAdapterStatus, BusLogic_TargetDeviceStatus_T TargetDeviceStatus, @@ -2327,7 +2327,7 @@ BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, UCHAR HostStatus = 0; // Namita 2Oct CDROM issue - if (TargetDeviceStatus != BusLogic_OperationGood && (HostAdapterStatus == BusLogic_CommandCompletedNormally || + if (TargetDeviceStatus != BusLogic_OperationGood && (HostAdapterStatus == BusLogic_CommandCompletedNormally || HostAdapterStatus == BusLogic_LinkedCommandCompleted || HostAdapterStatus == BusLogic_LinkedCommandCompletedWithFlag)) { @@ -2337,7 +2337,7 @@ BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, { HostStatus = SRB_STATUS_ERROR; if(SenseDataLength != BusLogic_DisableAutoReqSense) - HostStatus |= SRB_STATUS_AUTOSENSE_VALID; + HostStatus |= SRB_STATUS_AUTOSENSE_VALID; break; } case BusLogic_DeviceBusy: @@ -2373,21 +2373,21 @@ BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, case BusLogic_InvalidOutgoingMailboxActionCode: case BusLogic_InvalidCommandOperationCode: case BusLogic_InvalidCommandParameter: - DebugPrint((WARNING, "\n BusLogic - Driver Protocol Error 0x%02X\n", + DebugPrint((WARNING, "\n BusLogic - Driver Protocol Error 0x%02X\n", HostAdapterStatus)); case BusLogic_DataUnderRun: - + case BusLogic_DataOverRun: // SRB_STATUS_DATA_OVERRUN case BusLogic_LinkedCCBhasInvalidLUN: - + case BusLogic_TaggedQueuingMessageRejected: // SRB_STATUS_MESSAGE_REJECTED case BusLogic_TargetDeviceReconnectedImproperly: case BusLogic_AbortQueueGenerated: case BusLogic_HostAdapterSoftwareError: - + case BusLogic_HostAdapterHardwareTimeoutError: // SRB_STATUS_TIMEOUT { @@ -2434,7 +2434,7 @@ BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, } default: { - DebugPrint((WARNING, "\n BusLogic - Unknown HBA Status 0x%02X\n", + DebugPrint((WARNING, "\n BusLogic - Unknown HBA Status 0x%02X\n", HostAdapterStatus)); HostStatus = SRB_STATUS_ERROR; break; @@ -2445,7 +2445,7 @@ BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, }// end BusLogic_ComputeResultCode -BOOLEAN +BOOLEAN STDCALL BT958HwResetBus(IN PVOID HwDeviceExtension, IN ULONG PathId) @@ -2454,8 +2454,8 @@ BT958HwResetBus(IN PVOID HwDeviceExtension, // BT958HwResetBus resets Host Adapter if possible, marking all // currently executing SCSI Commands as having been Reset. // Arguments: -// 1. HwDeviceExtension: Points to the miniport driver's per-HBA storage area. -// 2. PathId: Identifies the SCSI bus to be reset. +// 1. HwDeviceExtension: Points to the miniport driver's per-HBA storage area. +// 2. PathId: Identifies the SCSI bus to be reset. // Return Value: // TRUE : If the bus is successfully reset, HwScsiResetBus returns TRUE. // FALSE : reset did not complete successfully @@ -2476,7 +2476,7 @@ BT958HwResetBus(IN PVOID HwDeviceExtension, 0xFF, 0xFF, (ULONG) SRB_STATUS_BUS_RESET); - + if (HostAdapter->HostAdapterExternalReset) { //BusLogic_IncrementErrorCounter(&HostAdapter->ExternalHostAdapterResets); @@ -2499,7 +2499,7 @@ BT958HwResetBus(IN PVOID HwDeviceExtension, { if (HostAdapter->HostAdapterInternalError) DebugPrint((0,"BusLogic Warning: Resetting %s due to Host Adapter Internal Error\n",HostAdapter->FullModelName)); - else + else DebugPrint((0,"BUsLogic Warning: Resetting %s due to External SCSI Bus Reset\n",HostAdapter->FullModelName)); } else @@ -2508,12 +2508,12 @@ BT958HwResetBus(IN PVOID HwDeviceExtension, //BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[srb->TargetId].HostAdapterResetsAttempted); } */ - + // Attempt to Reset and Reinitialize the Host Adapter. // Change the initialize routine to make allocation some place else if (!(BusLogic_HardwareResetHostAdapter(HostAdapter, HardReset) && BusLogic_InitializeHostAdapter(deviceExtension, NULL))) { - DebugPrint((ERROR, "\n Buslogic - Resetting %s Failed\n", + DebugPrint((ERROR, "\n Buslogic - Resetting %s Failed\n", HostAdapter->FullModelName)); Result = FALSE; goto Done; @@ -2528,7 +2528,7 @@ BT958HwResetBus(IN PVOID HwDeviceExtension, if (HardReset) ScsiPortStallExecution(HostAdapter->BusSettleTime); Result = TRUE; - + Done: return Result; }// end BT958HwResetBus @@ -2551,17 +2551,17 @@ BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension, PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; BusLogic_HostAdapter_T *HostAdapter = &(deviceExtension->hcs); - + UCHAR TargetID = Srb->TargetId; PBuslogic_CCB_T CCB = Srb->SrbExtension; BOOLEAN Result = FALSE; BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].BusDeviceResetsRequested); - + // If this is a Synchronous Reset and a Bus Device Reset is already pending // for this Target Device, do not send a second one. Add this Command to // the list of Commands for which completion processing must be performed // when the Bus Device Reset CCB completes. - + if (HostAdapter->BusDeviceResetPendingCCB[TargetID] != NULL) { DebugPrint((WARNING, "\n BusLogic - Unable to Reset Command to Target %d - " @@ -2569,23 +2569,23 @@ BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension, Result = TRUE; goto Done; } - - DebugPrint((WARNING, "\n BusLogic - Sending Bus Device Reset CCB #%ld to Target %d\n", + + DebugPrint((WARNING, "\n BusLogic - Sending Bus Device Reset CCB #%ld to Target %d\n", CCB->SerialNumber, TargetID)); CCB->Opcode = BusLogic_BusDeviceReset; CCB->TargetID = TargetID; - + // Attempt to write an Outgoing Mailbox with the Bus Device Reset CCB. // If sending a Bus Device Reset is impossible, attempt a full Host // Adapter Hard Reset and SCSI Bus Reset. if (!(BusLogic_WriteOutgoingMailbox(deviceExtension, BusLogic_MailboxStartCommand, CCB))) { - DebugPrint((WARNING, "\n BusLogic - Unable to write Outgoing Mailbox for " + DebugPrint((WARNING, "\n BusLogic - Unable to write Outgoing Mailbox for " "Bus Device Reset\n")); goto Done; } - + // If there is a currently executing CCB in the Host Adapter for this Command // (i.e. this is an Asynchronous Reset), then an Incoming Mailbox entry may be // made with a completion code of BusLogic_HostAdapterAssertedBusDeviceReset. @@ -2600,24 +2600,24 @@ BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension, // Device as Reset. When the Bus Device Reset CCB is processed by the // interrupt handler, any remaining CCBs marked as Reset will have completion // processing performed. - + BusLogic_IncrementErrorCounter( &HostAdapter->TargetStatistics[TargetID].BusDeviceResetsAttempted); HostAdapter->BusDeviceResetPendingCCB[TargetID] = CCB; //HostAdapter->LastResetAttempted[TargetID] = jiffies; - + // FlashPoint Host Adapters may have already completed the Bus Device // Reset and BusLogic_QueueCompletedCCB been called, or it may still be // pending. - - Result = TRUE; + + Result = TRUE; // If a Bus Device Reset was not possible for some reason, force a full // Host Adapter Hard Reset and SCSI Bus Reset. - + Done: return Result; } -BOOLEAN +BOOLEAN STDCALL BT958HwInitialize(IN PVOID HwDeviceExtension) //_______________________________________________________________________________ @@ -2638,39 +2638,39 @@ BT958HwInitialize(IN PVOID HwDeviceExtension) if (BusLogic_Command(HostAdapter, BusLogic_DisableHostAdapterInterrupt, &Parameter, - sizeof(Parameter), - NULL, - 0) + sizeof(Parameter), + NULL, + 0) < 0) { return FALSE; - } + } return TRUE; }// end BT958HwInitialize -SCSI_ADAPTER_CONTROL_STATUS +SCSI_ADAPTER_CONTROL_STATUS STDCALL BT958HwAdapterControl(IN PVOID HwDeviceExtension, IN SCSI_ADAPTER_CONTROL_TYPE ControlType, IN PVOID Parameters) //__________________________________________________________________________________________ // Routine Description: -// A miniport driver's HwScsiAdapterControl routine is called to perform -// synchronous operations to control the state or behavior of an HBA, such as +// A miniport driver's HwScsiAdapterControl routine is called to perform +// synchronous operations to control the state or behavior of an HBA, such as // stopping or restarting the HBA for power management. // Arguments: // 1. HwDeviceExtension: device extension -// 2. ControlType: Specifies one of the following adapter-control operations. +// 2. ControlType: Specifies one of the following adapter-control operations. // ScsiQuerySupportedControlTypes : Reports the adapter-control operations -// implemented by the miniport. -// ScsiStopAdapter: Shuts down the HBA. -// ScsiRestartAdapter: Reinitializes an HBA. +// implemented by the miniport. +// ScsiStopAdapter: Shuts down the HBA. +// ScsiRestartAdapter: Reinitializes an HBA. // ScsiSetBootConfig: Not supported // ScsiSetRunningConfig: Not supported // 3. Parameters: // Return Value: -// TRUE : -// FALSE : +// TRUE : +// FALSE : //_________________________________________________________________________ { PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; @@ -2693,7 +2693,7 @@ BT958HwAdapterControl(IN PVOID HwDeviceExtension, // // Structure defining which functions this miniport supports // - BOOLEAN SupportedConrolTypes[ScsiAdapterControlMax] = + BOOLEAN SupportedConrolTypes[ScsiAdapterControlMax] = { TRUE, // ScsiQuerySupportedControlTypes TRUE, // ScsiStopAdapter @@ -2703,15 +2703,15 @@ BT958HwAdapterControl(IN PVOID HwDeviceExtension, }; DebugPrint((TRACE, "\n BusLogic - Inside HwAdapterControl function \n")); - switch(ControlType) + switch(ControlType) { case ScsiQuerySupportedControlTypes: - // Reports the adapter-control operations implemented by the miniport. The port - // driver calls HwScsiAdapterControl with this control type after the HBA has been - // initialized but before the first I/O. The miniport fills in the + // Reports the adapter-control operations implemented by the miniport. The port + // driver calls HwScsiAdapterControl with this control type after the HBA has been + // initialized but before the first I/O. The miniport fills in the // SCSI_SUPPORTED_CONTROL_TYPE_LIST structure at Parameters with the operations it - // supports. After HwScsiAdapterControl returns from this call, the port driver - // calls the miniport's HwScsiAdapterControl only for supported operations. + // supports. After HwScsiAdapterControl returns from this call, the port driver + // calls the miniport's HwScsiAdapterControl only for supported operations. { // This entry point provides the method by which SCSIPort determines the @@ -2720,72 +2720,72 @@ BT958HwAdapterControl(IN PVOID HwDeviceExtension, // honoring the size limits. ControlTypeList = Parameters; AdjustedMaxControlType = (ControlTypeList->MaxControlType < ScsiAdapterControlMax) ? ControlTypeList->MaxControlType :ScsiAdapterControlMax; - for (Index = 0; Index < AdjustedMaxControlType; Index++) + for (Index = 0; Index < AdjustedMaxControlType; Index++) { ControlTypeList->SupportedTypeList[Index] = SupportedConrolTypes[Index]; } break; } - case ScsiStopAdapter: + case ScsiStopAdapter: // Shuts down the HBA. The port driver calls HwScsiAdapterControl with this control // type when the HBA has been removed from the system, stopped for resource reconfiguration, - // shut down for power management, or otherwise reconfigured or disabled. The port driver - // ensures that there are no uncompleted requests and issues an SRB_FUNCTION_FLUSH request - // to the miniport before calling this routine. The miniport disables interrupts on its HBA, + // shut down for power management, or otherwise reconfigured or disabled. The port driver + // ensures that there are no uncompleted requests and issues an SRB_FUNCTION_FLUSH request + // to the miniport before calling this routine. The miniport disables interrupts on its HBA, // halts all processing, (including background processing not subject to interrupts or processing - // of which the port driver is unaware, such as reconstructing fault-tolerant volumes), flushes - // any remaining cached data to persistent storage, and puts the HBA into a state from which it - // can be reinitialized or restarted. - // The miniport should not free its resources when stopping its HBA. If the HBA was removed or - // stopped for PnP resource reconfiguration, the port driver releases resources on behalf of the - // miniport driver. If the HBA is shut down for power management, the miniport's resources are - // preserved so the HBA can be restarted. + // of which the port driver is unaware, such as reconstructing fault-tolerant volumes), flushes + // any remaining cached data to persistent storage, and puts the HBA into a state from which it + // can be reinitialized or restarted. + // The miniport should not free its resources when stopping its HBA. If the HBA was removed or + // stopped for PnP resource reconfiguration, the port driver releases resources on behalf of the + // miniport driver. If the HBA is shut down for power management, the miniport's resources are + // preserved so the HBA can be restarted. { CHAR Parameter = 0; DebugPrint((INFO, "\n BusLogic - stopping the device \n")); if (BusLogic_Command(HostAdapter, BusLogic_DisableHostAdapterInterrupt, &Parameter, - sizeof(Parameter), - NULL, - 0) + sizeof(Parameter), + NULL, + 0) < 0) - { + { return ScsiAdapterControlUnsuccessful; } break; } case ScsiRestartAdapter: - // Reinitializes an HBA. The port driver calls HwScsiAdapterControl with this control type to power - // up an HBA that was shut down for power management. All resources previously assigned to the miniport - // are still available, and its device extension and logical unit extensions, if any, are intact. - // The miniport performs the same operations as in its HwScsiInitialize routine, such as setting up - // the HBA's registers and its initial state, if any. - // The miniport must not call routines that can only be called from HwScsiFindAdapter or from - // HwScsiAdapterControl when the control type is ScsiSetRunningConfig, such as ScsiPortGetBusData and - // ScsiPortSetBusDataByOffset. If the miniport must call such routines to restart its HBA, it must also - // implement ScsiSetRunningConfig. - // If the miniport does not implement ScsiRestartAdapter, the port driver calls the miniport's HwScsiFindAdapter and HwScsiInitialize routines. However, because such routines might do detection work which is unnecessary for restarting the HBA, such a miniport will not power up its HBA as quickly as a miniport that implements ScsiRestartAdapter. + // Reinitializes an HBA. The port driver calls HwScsiAdapterControl with this control type to power + // up an HBA that was shut down for power management. All resources previously assigned to the miniport + // are still available, and its device extension and logical unit extensions, if any, are intact. + // The miniport performs the same operations as in its HwScsiInitialize routine, such as setting up + // the HBA's registers and its initial state, if any. + // The miniport must not call routines that can only be called from HwScsiFindAdapter or from + // HwScsiAdapterControl when the control type is ScsiSetRunningConfig, such as ScsiPortGetBusData and + // ScsiPortSetBusDataByOffset. If the miniport must call such routines to restart its HBA, it must also + // implement ScsiSetRunningConfig. + // If the miniport does not implement ScsiRestartAdapter, the port driver calls the miniport's HwScsiFindAdapter and HwScsiInitialize routines. However, because such routines might do detection work which is unnecessary for restarting the HBA, such a miniport will not power up its HBA as quickly as a miniport that implements ScsiRestartAdapter. // See PR 69004. We were not calling BT958HwInitialize earlier if the // first two calls succeeded thus causing resume from standby to fail. { - if (!(BusLogic_HardwareResetHostAdapter(HostAdapter, TRUE) && + if (!(BusLogic_HardwareResetHostAdapter(HostAdapter, TRUE) && BusLogic_InitializeHostAdapter(deviceExtension, NULL) && BT958HwInitialize(HwDeviceExtension)) ) { - DebugPrint((ERROR, "\n Buslogic - Resetting %s Failed\n", + DebugPrint((ERROR, "\n Buslogic - Resetting %s Failed\n", HostAdapter->FullModelName)); return ScsiAdapterControlUnsuccessful; } - ScsiPortStallExecution(HostAdapter->BusSettleTime); + ScsiPortStallExecution(HostAdapter->BusSettleTime); break; } - default: + default: { return ScsiAdapterControlUnsuccessful; } diff --git a/reactos/drivers/storage/port/buslogic/BusLogic958.h b/reactos/drivers/storage/port/buslogic/BusLogic958.h index 8bdbf76248e..5314c0f8bf0 100644 --- a/reactos/drivers/storage/port/buslogic/BusLogic958.h +++ b/reactos/drivers/storage/port/buslogic/BusLogic958.h @@ -1,10 +1,10 @@ /* - * vmscsi-- Miniport driver for the Buslogic BT 958 SCSI Controller + * vmscsi-- Miniport driver for the Buslogic BT 958 SCSI Controller * under Windows 2000/XP/Server 2003 * * Based in parts on the buslogic driver for the same device * available with the GNU Linux Operating System. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -46,7 +46,7 @@ //#include "miniport.h" -//#include "scsi.h" +//#include "scsi.h" //#include "scsiwmi.h" //_________________________________________________________________________________________ // #defines @@ -113,7 +113,7 @@ //_________________________________________________________________________________________ -// typedef +// typedef //_________________________________________________________________________________________ typedef enum { @@ -186,8 +186,8 @@ typedef unsigned int BusLogic_ByteCount_T; typedef struct BusLogic_FetchHostAdapterLocalRAMRequest { - UCHAR ByteOffset; // Byte 0 - UCHAR ByteCount; // Byte 1 + UCHAR ByteOffset; // Byte 0 + UCHAR ByteCount; // Byte 1 } BusLogic_FetchHostAdapterLocalRAMRequest_T; @@ -338,26 +338,26 @@ typedef struct BusLogic_SetupInformation // Define the Inquire Extended Setup Information reply structure. typedef struct BusLogic_ExtendedSetupInformation { - UCHAR BusType; // Byte 0 - UCHAR BIOS_Address; // Byte 1 - unsigned short ScatterGatherLimit; // Bytes 2-3 - UCHAR MailboxCount; // Byte 4 - BusLogic_BusAddress_T BaseMailboxAddress; // Bytes 5-8 + UCHAR BusType; // Byte 0 + UCHAR BIOS_Address; // Byte 1 + unsigned short ScatterGatherLimit; // Bytes 2-3 + UCHAR MailboxCount; // Byte 4 + BusLogic_BusAddress_T BaseMailboxAddress; // Bytes 5-8 struct { - UCHAR :2; // Byte 9 Bits 0-1 - BOOLEAN FastOnEISA:1; // Byte 9 Bit 2 - UCHAR :3; // Byte 9 Bits 3-5 - BOOLEAN LevelSensitiveInterrupt:1; // Byte 9 Bit 6 - UCHAR :1; - } Misc; // Byte 9 Bit 7 - UCHAR FirmwareRevision[3]; // Bytes 10-12 - BOOLEAN HostWideSCSI:1; // Byte 13 Bit 0 - BOOLEAN HostDifferentialSCSI:1; // Byte 13 Bit 1 - BOOLEAN HostSupportsSCAM:1; // Byte 13 Bit 2 - BOOLEAN HostUltraSCSI:1; // Byte 13 Bit 3 - BOOLEAN HostSmartTermination:1; // Byte 13 Bit 4 - UCHAR :3; // Byte 13 Bits 5-7 + UCHAR :2; // Byte 9 Bits 0-1 + BOOLEAN FastOnEISA:1; // Byte 9 Bit 2 + UCHAR :3; // Byte 9 Bits 3-5 + BOOLEAN LevelSensitiveInterrupt:1; // Byte 9 Bit 6 + UCHAR :1; + } Misc; // Byte 9 Bit 7 + UCHAR FirmwareRevision[3]; // Bytes 10-12 + BOOLEAN HostWideSCSI:1; // Byte 13 Bit 0 + BOOLEAN HostDifferentialSCSI:1; // Byte 13 Bit 1 + BOOLEAN HostSupportsSCAM:1; // Byte 13 Bit 2 + BOOLEAN HostUltraSCSI:1; // Byte 13 Bit 3 + BOOLEAN HostSmartTermination:1; // Byte 13 Bit 4 + UCHAR :3; // Byte 13 Bits 5-7 }BusLogic_ExtendedSetupInformation_T; // Define the Host Adapter Local RAM AutoSCSI structure. @@ -547,8 +547,8 @@ typedef enum }BusLogic_CCB_Status_T; // Define the 32 Bit Mode Command Control Block (CCB) structure. The first 40 -// bytes are defined by the MultiMaster Firmware The remaining components are -// defined by the Scsi MiniportDriver. +// bytes are defined by the MultiMaster Firmware The remaining components are +// defined by the Scsi MiniportDriver. // Extended LUN Format CCBs differ from Legacy LUN Format 32 Bit Mode // CCBs only in having the TagEnable and QueueTag fields moved from byte 17 to // byte 1, and the Logical Unit field in byte 17 expanded to 6 bits. In theory, @@ -624,13 +624,13 @@ typedef struct BusLogic_IncomingMailbox // The following structure is allocated // from noncached memory as data will be DMA'd to // and from it. -typedef struct _NONCACHED_EXTENSION +typedef struct _NONCACHED_EXTENSION { // Physical base address of mailboxes ULONG MailboxPA; // Mailboxes - UCHAR MailboxOut[BusLogic_MaxMailboxes * sizeof(BusLogic_OutgoingMailbox_T)]; + UCHAR MailboxOut[BusLogic_MaxMailboxes * sizeof(BusLogic_OutgoingMailbox_T)]; UCHAR MailboxIn[BusLogic_MaxMailboxes * sizeof(BusLogic_IncomingMailbox_T)]; } NONCACHED_EXTENSION, *PNONCACHED_EXTENSION; @@ -663,7 +663,7 @@ static BusLogic_HostAdapterBusType_T BusLogic_EISA_Bus, /* BT-7xx */ BusLogic_Unknown_Bus, /* BT-8xx */ BusLogic_PCI_Bus /* BT-9xx */ - }; + }; // Define the BusLogic Driver Host Adapter structure typedef struct BusLogic_HostAdapter @@ -671,7 +671,7 @@ typedef struct BusLogic_HostAdapter BusLogic_HostAdapterType_T HostAdapterType; BusLogic_HostAdapterBusType_T HostAdapterBusType; - + UCHAR ModelName[9]; UCHAR FirmwareVersion[6]; UCHAR FullModelName[18]; @@ -680,7 +680,7 @@ typedef struct BusLogic_HostAdapter PUCHAR IO_Address; UCHAR IRQ_Channel; UCHAR SCSI_ID; - + BOOLEAN ExtendedTranslationEnabled:1; BOOLEAN ParityCheckingEnabled:1; BOOLEAN BusResetEnabled:1; @@ -705,7 +705,7 @@ typedef struct BusLogic_HostAdapter volatile BOOLEAN HostAdapterCommandCompleted; unsigned short HostAdapterScatterGatherLimit; unsigned short DriverScatterGatherLimit; - + UCHAR MaxTargetDevices; UCHAR MaxLogicalUnits; @@ -723,7 +723,7 @@ typedef struct BusLogic_HostAdapter unsigned short ExternalHostAdapterResets; unsigned short HostAdapterInternalErrors; unsigned short TargetDeviceCount; - + BusLogic_BusAddress_T BIOS_Address; BusLogic_CCB_T *FirstCompletedCCB; @@ -747,14 +747,14 @@ typedef struct BusLogic_HostAdapter BusLogic_IncomingMailbox_T *FirstIncomingMailbox; BusLogic_IncomingMailbox_T *LastIncomingMailbox; BusLogic_IncomingMailbox_T *NextIncomingMailbox; - BusLogic_TargetStatistics_T TargetStatistics[BusLogic_MaxTargetDevices]; + BusLogic_TargetStatistics_T TargetStatistics[BusLogic_MaxTargetDevices]; }BusLogic_HostAdapter_T; -// Buslogic specific port driver device object extension. -typedef struct +// Buslogic specific port driver device object extension. +typedef struct _HW_DEVICE_EXTENSION -{ +{ BusLogic_HostAdapter_T hcs; PNONCACHED_EXTENSION NoncachedExtension; SCSI_WMILIB_CONTEXT WmiLibContext; @@ -795,14 +795,14 @@ typedef struct SCSI_Inquiry typedef struct BusLogic_WmiExtendedSetupInformation { - UCHAR BusType; // Byte 0 - UCHAR BIOS_Address; // Byte 1 - unsigned short ScatterGatherLimit; // Bytes 2-3 - UCHAR MailboxCount; // Byte 4 - BusLogic_BusAddress_T BaseMailboxAddress; // Bytes 5-8 - BOOLEAN FastOnEISA; // Byte 9 + UCHAR BusType; // Byte 0 + UCHAR BIOS_Address; // Byte 1 + unsigned short ScatterGatherLimit; // Bytes 2-3 + UCHAR MailboxCount; // Byte 4 + BusLogic_BusAddress_T BaseMailboxAddress; // Bytes 5-8 + BOOLEAN FastOnEISA; // Byte 9 BOOLEAN LevelSensitiveInterrupt; // Byte 10 - UCHAR FirmwareRevision[3]; // Bytes 11-14 + UCHAR FirmwareRevision[3]; // Bytes 11-14 BOOLEAN HostWideSCSI; // Byte 15 BOOLEAN HostDifferentialSCSI; // Byte 16 BOOLEAN HostSupportsSCAM; // Byte 17 @@ -862,25 +862,25 @@ BOOLEAN BT958WmiSrb(IN PHW_DEVICE_EXTENSION HwDeviceExtension, IN OUT PSCSI_WMI_REQUEST_BLOCK Srb); #endif -void +void BT958WmiInitialize( IN PHW_DEVICE_EXTENSION HwDeviceExtension); -BOOLEAN -Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, +BOOLEAN +Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo); -BOOLEAN +BOOLEAN BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter); -BOOLEAN -BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, +BOOLEAN +BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, BOOLEAN HardReset); -BOOLEAN +BOOLEAN BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter); -int +int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, BusLogic_OperationCode_T OperationCode, void *ParameterData, @@ -888,36 +888,36 @@ BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, void *ReplyData, int ReplyLength); -BOOLEAN +BOOLEAN BusLogic_ReadHostAdapterConfiguration( BusLogic_HostAdapter_T *HostAdapter); - -BOOLEAN + +BOOLEAN BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo); -BOOLEAN +BOOLEAN BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter); -int +int BusLogic_QueueCommand(IN PVOID HwDeviceExtension, - IN PSCSI_REQUEST_BLOCK Srb, + IN PSCSI_REQUEST_BLOCK Srb, IN PBuslogic_CCB_T ccb); -BOOLEAN +BOOLEAN BusLogic_WriteOutgoingMailbox(PHW_DEVICE_EXTENSION deviceExtension , BusLogic_ActionCode_T ActionCode, BusLogic_CCB_T *CCB); -void +void BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension); -void +void BusLogic_QueueCompletedCCB(PHW_DEVICE_EXTENSION deviceExtension, BusLogic_CCB_T *CCB); -void +void BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension); -UCHAR +UCHAR BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, BusLogic_HostAdapterStatus_T HostAdapterStatus, BusLogic_TargetDeviceStatus_T TargetDeviceStatus, @@ -927,13 +927,13 @@ BOOLEAN BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension, PSCSI_REQUEST_BLOCK Srb); -static UCHAR +static UCHAR ReadBusLogicPort(PUCHAR adr ) { return ScsiPortReadPortUchar( adr ); } -static VOID +static VOID WriteBusLogicPort(UCHAR data, PUCHAR adr) { @@ -945,12 +945,12 @@ WriteBusLogicPort(UCHAR data, //_________________________________________________________________________________________ // Define the BusLogic SCSI Host Adapter I/O Register Offsets. -#define BusLogic_ControlRegisterOffset 0 // WO register -#define BusLogic_StatusRegisterOffset 0 // RO register -#define BusLogic_CommandParameterRegisterOffset 1 // WO register -#define BusLogic_DataInRegisterOffset 1 // RO register -#define BusLogic_InterruptRegisterOffset 2 // RO register -#define BusLogic_GeometryRegisterOffset 3 // RO register +#define BusLogic_ControlRegisterOffset 0 // WO register +#define BusLogic_StatusRegisterOffset 0 // RO register +#define BusLogic_CommandParameterRegisterOffset 1 // WO register +#define BusLogic_DataInRegisterOffset 1 // RO register +#define BusLogic_InterruptRegisterOffset 2 // RO register +#define BusLogic_GeometryRegisterOffset 3 // RO register // Define the structure of the write-only Control Register. @@ -959,11 +959,11 @@ typedef union BusLogic_ControlRegister UCHAR All; struct { - UCHAR :4; // Bits 0-3 - BOOLEAN SCSIBusReset:1; // Bit 4 - BOOLEAN InterruptReset:1; // Bit 5 - BOOLEAN SoftReset:1; // Bit 6 - BOOLEAN HardReset:1; // Bit 7 + UCHAR :4; // Bits 0-3 + BOOLEAN SCSIBusReset:1; // Bit 4 + BOOLEAN InterruptReset:1; // Bit 5 + BOOLEAN SoftReset:1; // Bit 6 + BOOLEAN HardReset:1; // Bit 7 } Bits; }BusLogic_ControlRegister_T; @@ -972,16 +972,16 @@ typedef union BusLogic_ControlRegister typedef union BusLogic_StatusRegister { UCHAR All; - struct + struct { - BOOLEAN CommandInvalid:1; // Bit 0 - BOOLEAN Reserved:1; // Bit 1 - BOOLEAN DataInRegisterReady:1; // Bit 2 - BOOLEAN CommandParameterRegisterBusy:1; // Bit 3 - BOOLEAN HostAdapterReady:1; // Bit 4 - BOOLEAN InitializationRequired:1; // Bit 5 - BOOLEAN DiagnosticFailure:1; // Bit 6 - BOOLEAN DiagnosticActive:1; // Bit 7 + BOOLEAN CommandInvalid:1; // Bit 0 + BOOLEAN Reserved:1; // Bit 1 + BOOLEAN DataInRegisterReady:1; // Bit 2 + BOOLEAN CommandParameterRegisterBusy:1; // Bit 3 + BOOLEAN HostAdapterReady:1; // Bit 4 + BOOLEAN InitializationRequired:1; // Bit 5 + BOOLEAN DiagnosticFailure:1; // Bit 6 + BOOLEAN DiagnosticActive:1; // Bit 7 } Bits; }BusLogic_StatusRegister_T; @@ -993,12 +993,12 @@ typedef union BusLogic_InterruptRegister UCHAR All; struct { - BOOLEAN IncomingMailboxLoaded:1; // Bit 0 - BOOLEAN OutgoingMailboxAvailable:1; // Bit 1 - BOOLEAN CommandComplete:1; // Bit 2 - BOOLEAN ExternalBusReset:1; // Bit 3 - UCHAR Reserved:3; // Bits 4-6 - BOOLEAN InterruptValid:1; // Bit 7 + BOOLEAN IncomingMailboxLoaded:1; // Bit 0 + BOOLEAN OutgoingMailboxAvailable:1; // Bit 1 + BOOLEAN CommandComplete:1; // Bit 2 + BOOLEAN ExternalBusReset:1; // Bit 3 + UCHAR Reserved:3; // Bits 4-6 + BOOLEAN InterruptValid:1; // Bit 7 } Bits; }BusLogic_InterruptRegister_T; @@ -1017,15 +1017,15 @@ typedef union BusLogic_GeometryRegister UCHAR All; struct { - BusLogic_BIOS_DiskGeometryTranslation_T Drive0Geometry:2; // Bits 0-1 - BusLogic_BIOS_DiskGeometryTranslation_T Drive1Geometry:2; // Bits 2-3 - UCHAR :3; // Bits 4-6 - BOOLEAN ExtendedTranslationEnabled:1; // Bit 7 + BusLogic_BIOS_DiskGeometryTranslation_T Drive0Geometry:2; // Bits 0-1 + BusLogic_BIOS_DiskGeometryTranslation_T Drive1Geometry:2; // Bits 2-3 + UCHAR :3; // Bits 4-6 + BOOLEAN ExtendedTranslationEnabled:1; // Bit 7 } Bits; } BusLogic_GeometryRegister_T; -static void +static void BusLogic_InterruptReset(BusLogic_HostAdapter_T *HostAdapter) { BusLogic_ControlRegister_T ControlRegister; @@ -1046,7 +1046,7 @@ BusLogic_SoftReset(BusLogic_HostAdapter_T *HostAdapter) HostAdapter->IO_Address + BusLogic_ControlRegisterOffset); } -static void +static void BusLogic_HardReset(BusLogic_HostAdapter_T *HostAdapter) { BusLogic_ControlRegister_T ControlRegister; @@ -1056,31 +1056,31 @@ BusLogic_HardReset(BusLogic_HostAdapter_T *HostAdapter) HostAdapter->IO_Address + BusLogic_ControlRegisterOffset); } -static UCHAR +static UCHAR BusLogic_ReadStatusRegister(BusLogic_HostAdapter_T *HostAdapter) { return ReadBusLogicPort(HostAdapter->IO_Address + BusLogic_StatusRegisterOffset); } -static UCHAR +static UCHAR BusLogic_ReadInterruptRegister(BusLogic_HostAdapter_T *HostAdapter) { return ReadBusLogicPort(HostAdapter->IO_Address + BusLogic_InterruptRegisterOffset); } -static UCHAR +static UCHAR BusLogic_ReadGeometryRegister(BusLogic_HostAdapter_T *HostAdapter) { return ReadBusLogicPort(HostAdapter->IO_Address + BusLogic_GeometryRegisterOffset); } -static UCHAR +static UCHAR BusLogic_ReadDataInRegister(BusLogic_HostAdapter_T *HostAdapter) { return ReadBusLogicPort(HostAdapter->IO_Address + BusLogic_DataInRegisterOffset); } -static void +static void BusLogic_WriteCommandParameterRegister(BusLogic_HostAdapter_T *HostAdapter, UCHAR Value) { @@ -1091,10 +1091,10 @@ BusLogic_WriteCommandParameterRegister(BusLogic_HostAdapter_T *HostAdapter, // BusLogic_StartMailboxCommand issues an Execute Mailbox Command, which // notifies the Host Adapter that an entry has been made in an Outgoing // Mailbox. -static void +static void BusLogic_StartMailboxCommand(BusLogic_HostAdapter_T *HostAdapter) { - BusLogic_WriteCommandParameterRegister(HostAdapter, + BusLogic_WriteCommandParameterRegister(HostAdapter, BusLogic_ExecuteMailboxCommand); } @@ -1136,7 +1136,7 @@ typedef enum BusLogic_SetCCBFormatRequest // Statistics //______________________________________________________________________________________ // BusLogic_IncrementByteCounter increments Byte Counter by Amount. -static void +static void BusLogic_IncrementByteCounter(BusLogic_ByteCounter_T *ByteCounter, unsigned int Amount) { @@ -1149,7 +1149,7 @@ BusLogic_IncrementByteCounter(BusLogic_ByteCounter_T *ByteCounter, } // BusLogic_IncrementSizeBucket increments the Bucket for Amount. -static void +static void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, unsigned int Amount) { @@ -1158,17 +1158,17 @@ BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, { if (Amount < 2*1024) Index = (Amount < 1*1024 ? 0 : 1); - else + else Index = (Amount < 4*1024 ? 2 : 3); } else if (Amount < 128*1024) { if (Amount < 32*1024) Index = (Amount < 16*1024 ? 4 : 5); - else + else Index = (Amount < 64*1024 ? 6 : 7); } - else + else Index = (Amount < 256*1024 ? 8 : 9); CommandSizeBuckets[Index]++; } @@ -1176,11 +1176,11 @@ BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, // BusLogic_IncrementErrorCounter increments Error Counter by 1, stopping at // 65535 rather than wrapping around to 0. -static void +static void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter) { if (*ErrorCounter < 65535) (*ErrorCounter)++; } //____________________________________________________________________________________________ -#endif // _BT958_H_ +#endif // _BT958_H_ diff --git a/reactos/drivers/storage/port/buslogic/Log.c b/reactos/drivers/storage/port/buslogic/Log.c index c29671bf3ac..18d9c0df7f1 100644 --- a/reactos/drivers/storage/port/buslogic/Log.c +++ b/reactos/drivers/storage/port/buslogic/Log.c @@ -1,7 +1,7 @@ #include "Log.h" #include #include -#pragma hdrstop +#pragma hdrstop BOOLEAN LogMessage(PCHAR szFormat, ...) { @@ -14,7 +14,7 @@ BOOLEAN LogMessage(PCHAR szFormat, ...) HANDLE FileHandle; UNICODE_STRING fileName; - + //format the string va_start(va,szFormat); vsprintf(messagebuf,szFormat,va); @@ -32,7 +32,7 @@ BOOLEAN LogMessage(PCHAR szFormat, ...) } RtlZeroMemory(fileName.Buffer, fileName.MaximumLength); status = RtlAppendUnicodeToString(&fileName, (PWSTR)DEFAULT_LOG_FILE_NAME); - + //DbgPrint("\n Initializing Object attributes"); InitializeObjectAttributes (&objectAttributes, @@ -42,17 +42,17 @@ BOOLEAN LogMessage(PCHAR szFormat, ...) NULL ); DbgPrint("\n BusLogic - Creating the file"); - + status = ZwCreateFile(&FileHandle, FILE_APPEND_DATA, &objectAttributes, &IoStatus, - 0, + 0, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_WRITE, FILE_OPEN_IF, FILE_SYNCHRONOUS_IO_NONALERT, - NULL, + NULL, 0 ); if(NT_SUCCESS(status)) @@ -66,7 +66,7 @@ BOOLEAN LogMessage(PCHAR szFormat, ...) //put a time stamp on the output message sprintf(buf,"%10u-%10u %s",time.HighPart,time.LowPart,messagebuf); - //format the string to make sure it appends a newline carrage-return to the + //format the string to make sure it appends a newline carrage-return to the //end of the string. Length=strlen(buf); if(buf[Length-1]=='\n') @@ -84,7 +84,7 @@ BOOLEAN LogMessage(PCHAR szFormat, ...) buf[Length+1] = '\0'; DbgPrint("\n BusLogic - Writing to the file"); DbgPrint("\n BusLogic - Buf = %s", buf); - + status = ZwWriteFile(FileHandle, NULL, NULL, diff --git a/reactos/drivers/storage/port/buslogic/resource.h b/reactos/drivers/storage/port/buslogic/resource.h index 009dfade6d9..2b9edcf0941 100644 --- a/reactos/drivers/storage/port/buslogic/resource.h +++ b/reactos/drivers/storage/port/buslogic/resource.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 diff --git a/reactos/drivers/storage/port/buslogic/wmi.c b/reactos/drivers/storage/port/buslogic/wmi.c index b8bb5db4ad1..6b8ecfa3258 100644 --- a/reactos/drivers/storage/port/buslogic/wmi.c +++ b/reactos/drivers/storage/port/buslogic/wmi.c @@ -38,7 +38,7 @@ BT958QueryWmiRegInfo OUT PWCHAR *MofResourceName ); -SCSIWMIGUIDREGINFO BT958GuidList[] = +SCSIWMIGUIDREGINFO BT958GuidList[] = { {&BT958WmiExtendedSetupInfoGuid, 1, @@ -54,9 +54,9 @@ void BT958WmiInitialize( ) { PSCSI_WMILIB_CONTEXT WmiLibContext; - + WmiLibContext = &HwDeviceExtension->WmiLibContext; - + WmiLibContext->GuidList = BT958GuidList; WmiLibContext->GuidCount = BT958GuidCount; WmiLibContext->QueryWmiRegInfo = BT958QueryWmiRegInfo; @@ -64,7 +64,7 @@ void BT958WmiInitialize( WmiLibContext->SetWmiDataItem = NULL; WmiLibContext->SetWmiDataBlock = NULL; WmiLibContext->WmiFunctionControl = NULL; - WmiLibContext->ExecuteWmiMethod = NULL; + WmiLibContext->ExecuteWmiMethod = NULL; } @@ -107,11 +107,11 @@ Return Value: ASSERT(Srb->Length == sizeof(SCSI_WMI_REQUEST_BLOCK)); ASSERT(Srb->DataTransferLength >= sizeof(ULONG)); ASSERT(Srb->DataBuffer); - + // Check if the WMI SRB is targetted for the adapter or one of the disks - if (!(Srb->WMIFlags & SRB_WMI_FLAGS_ADAPTER_REQUEST)) + if (!(Srb->WMIFlags & SRB_WMI_FLAGS_ADAPTER_REQUEST)) { - + // This is targetted to one of the disks, since there are no per disk // wmi information we return an error. Note that if there was per // disk information, then you'd likely have a differen WmiLibContext @@ -119,7 +119,7 @@ Return Value: Srb->DataTransferLength = 0; Srb->SrbStatus = SRB_STATUS_SUCCESS; - } + } else { // Process the incoming WMI request. @@ -130,24 +130,24 @@ Return Value: Srb->DataPath, Srb->DataTransferLength, Srb->DataBuffer); - + // We assune that the wmi request will never pend so that we can // allocate the requestContext from stack. If the WMI request could // ever pend then we'd need to allocate the request context from // the SRB extension. // ASSERT(! pending); - + retSize = ScsiPortWmiGetReturnSize(&requestContext); status = ScsiPortWmiGetReturnStatus(&requestContext); - - // We can do this since we assume it is done synchronously + + // We can do this since we assume it is done synchronously Srb->DataTransferLength = retSize; - + // // Adapter ready for next request. // - + Srb->SrbStatus = status; } @@ -175,53 +175,53 @@ BT958QueryWmiDataBlock( Routine Description: This routine is a callback into the miniport to query for the contents of - one or more instances of a data block. This callback may be called with + one or more instances of a data block. This callback may be called with an output buffer that is too small to return all of the data queried. - In this case the callback is responsible to report the correct output + In this case the callback is responsible to report the correct output buffer size needed. - - If the request can be completed immediately without pending, - ScsiPortWmiPostProcess should be called from within this callback and + + If the request can be completed immediately without pending, + ScsiPortWmiPostProcess should be called from within this callback and FALSE returned. - + If the request cannot be completed within this callback then TRUE should be returned. Once the pending operations are finished the miniport should call ScsiPortWmiPostProcess and then complete the srb. - + Arguments: DeviceContext is a caller specified context value originally passed to ScsiPortWmiDispatchFunction. RequestContext is a context associated with the srb being processed. - + GuidIndex is the index into the list of guids provided when the miniport registered InstanceIndex is the index that denotes first instance of the data block is being queried. - + InstanceCount is the number of instances expected to be returned for the data block. - - InstanceLengthArray is a pointer to an array of ULONG that returns the + + InstanceLengthArray is a pointer to an array of ULONG that returns the lengths of each instance of the data block. This may be NULL when there is not enough space in the output buffer to fufill the request. In this case the miniport should call ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN and the size of the output buffer needed to fufill the request. - + BufferAvail on entry has the maximum size available to write the data - blocks in the output buffer. If the output buffer is not large enough - to return all of the data blocks then the miniport should call - ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN + blocks in the output buffer. If the output buffer is not large enough + to return all of the data blocks then the miniport should call + ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN and the size of the output buffer needed to fufill the request. Buffer on return is filled with the returned data blocks. Note that each - instance of the data block must be aligned on a 8 byte boundry. This - may be NULL when there is not enough space in the output buffer to - fufill the request. In this case the miniport should call - ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN and + instance of the data block must be aligned on a 8 byte boundry. This + may be NULL when there is not enough space in the output buffer to + fufill the request. In this case the miniport should call + ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN and the size of the output buffer needed to fufill the request. @@ -240,12 +240,12 @@ Return Value: ASSERT((InstanceIndex == 0) && (InstanceCount == 1)); - switch (GuidIndex) + switch (GuidIndex) { case BT958_SETUP_GUID_INDEX: { size = sizeof(BT958ExtendedSetupInfo)-1; - if (OutBufferSize < size) + if (OutBufferSize < size) { // // The buffer passed to return the data is too small @@ -333,7 +333,7 @@ Return Value: --*/ { - *MofResourceName = BT958Wmi_MofResourceName; + *MofResourceName = BT958Wmi_MofResourceName; return SRB_STATUS_SUCCESS; } @@ -373,7 +373,7 @@ Return Value: BusLogic_WmiExtendedSetupInformation_T WmiExtendedSetupInfo; PUCHAR SourceBuf = (PUCHAR) &WmiExtendedSetupInfo; - + // // Issue the Inquire Extended Setup Information command. Only genuine // BusLogic Host Adapters and TRUE clones support this command. Adaptec 1542C @@ -390,23 +390,23 @@ Return Value: { Result = FALSE; } - - WmiExtendedSetupInfo.BusType = ExtendedSetupInformation.BusType; - WmiExtendedSetupInfo.BIOS_Address = ExtendedSetupInformation.BIOS_Address; - WmiExtendedSetupInfo.ScatterGatherLimit = ExtendedSetupInformation.ScatterGatherLimit; - WmiExtendedSetupInfo.MailboxCount = ExtendedSetupInformation.MailboxCount; + + WmiExtendedSetupInfo.BusType = ExtendedSetupInformation.BusType; + WmiExtendedSetupInfo.BIOS_Address = ExtendedSetupInformation.BIOS_Address; + WmiExtendedSetupInfo.ScatterGatherLimit = ExtendedSetupInformation.ScatterGatherLimit; + WmiExtendedSetupInfo.MailboxCount = ExtendedSetupInformation.MailboxCount; WmiExtendedSetupInfo.BaseMailboxAddress = ExtendedSetupInformation.BaseMailboxAddress; - WmiExtendedSetupInfo.FastOnEISA = ExtendedSetupInformation.Misc.FastOnEISA; - WmiExtendedSetupInfo.LevelSensitiveInterrupt = ExtendedSetupInformation.Misc.LevelSensitiveInterrupt; - WmiExtendedSetupInfo.FirmwareRevision[0] = ExtendedSetupInformation.FirmwareRevision[0]; - WmiExtendedSetupInfo.FirmwareRevision[1] = ExtendedSetupInformation.FirmwareRevision[1]; - WmiExtendedSetupInfo.FirmwareRevision[2] = ExtendedSetupInformation.FirmwareRevision[2]; - WmiExtendedSetupInfo.HostWideSCSI = ExtendedSetupInformation.HostWideSCSI; - WmiExtendedSetupInfo.HostDifferentialSCSI= ExtendedSetupInformation.HostDifferentialSCSI; - WmiExtendedSetupInfo.HostSupportsSCAM = ExtendedSetupInformation.HostSupportsSCAM; - WmiExtendedSetupInfo.HostUltraSCSI = ExtendedSetupInformation.HostUltraSCSI; - WmiExtendedSetupInfo.HostSmartTermination= ExtendedSetupInformation.HostSmartTermination; - + WmiExtendedSetupInfo.FastOnEISA = ExtendedSetupInformation.Misc.FastOnEISA; + WmiExtendedSetupInfo.LevelSensitiveInterrupt = ExtendedSetupInformation.Misc.LevelSensitiveInterrupt; + WmiExtendedSetupInfo.FirmwareRevision[0] = ExtendedSetupInformation.FirmwareRevision[0]; + WmiExtendedSetupInfo.FirmwareRevision[1] = ExtendedSetupInformation.FirmwareRevision[1]; + WmiExtendedSetupInfo.FirmwareRevision[2] = ExtendedSetupInformation.FirmwareRevision[2]; + WmiExtendedSetupInfo.HostWideSCSI = ExtendedSetupInformation.HostWideSCSI; + WmiExtendedSetupInfo.HostDifferentialSCSI= ExtendedSetupInformation.HostDifferentialSCSI; + WmiExtendedSetupInfo.HostSupportsSCAM = ExtendedSetupInformation.HostSupportsSCAM; + WmiExtendedSetupInfo.HostUltraSCSI = ExtendedSetupInformation.HostUltraSCSI; + WmiExtendedSetupInfo.HostSmartTermination= ExtendedSetupInformation.HostSmartTermination; + for (; numberOfBytes; numberOfBytes--) { *Buffer++ = *SourceBuf++; diff --git a/reactos/drivers/storage/port/diskdump/diskdump.c b/reactos/drivers/storage/port/diskdump/diskdump.c index 9bb952f90d9..b5e0262f9bd 100644 --- a/reactos/drivers/storage/port/diskdump/diskdump.c +++ b/reactos/drivers/storage/port/diskdump/diskdump.c @@ -22,7 +22,7 @@ * PROJECT: ReactOS Kernel * FILE: services/storage/diskdump/diskdump.c * PURPOSE: Dumping crash data to the pagefile - * PROGRAMMER: + * PROGRAMMER: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/drivers/storage/scsiport/scsiport.c b/reactos/drivers/storage/scsiport/scsiport.c index 6821ee36418..639c58ce474 100644 --- a/reactos/drivers/storage/scsiport/scsiport.c +++ b/reactos/drivers/storage/scsiport/scsiport.c @@ -2674,7 +2674,7 @@ ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject, DPRINT(" IOCTL_SCSI_GET_DUMP_POINTERS\n"); DumpPointers = (PDUMP_POINTERS)Irp->AssociatedIrp.SystemBuffer; DumpPointers->DeviceObject = DeviceObject; - + Irp->IoStatus.Information = sizeof(DUMP_POINTERS); } break; @@ -3078,7 +3078,7 @@ SpiAdapterControl(PDEVICE_OBJECT DeviceObject, IrpStack = IoGetCurrentIrpStackLocation(Irp); Srb = (PSCSI_REQUEST_BLOCK)IrpStack->Parameters.Others.Argument1; - /* Depending on the map registers number, we allocate + /* Depending on the map registers number, we allocate either from NonPagedPool, or from our static list */ if (SrbInfo->NumberOfMapRegisters > MAX_SG_LIST) { @@ -3710,7 +3710,7 @@ SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension) /* Check if this device is unsupported */ if (InquiryData->DeviceTypeQualifier == DEVICE_QUALIFIER_NOT_SUPPORTED) { - DeviceExtension->LunExtensionList[Hint] = + DeviceExtension->LunExtensionList[Hint] = DeviceExtension->LunExtensionList[Hint]->Next; continue; @@ -3754,7 +3754,7 @@ SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension) else { /* Remove this LUN from the list */ - DeviceExtension->LunExtensionList[Hint] = + DeviceExtension->LunExtensionList[Hint] = DeviceExtension->LunExtensionList[Hint]->Next; /* Decide whether we are continuing or not */ @@ -3818,7 +3818,7 @@ SpiGetInquiryData(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, /* Calculate data size */ Length = sizeof(SCSI_ADAPTER_BUS_INFO) + (BusCount - 1) * sizeof(SCSI_BUS_DATA); - + Length += InquiryDataSize * LunCount; /* Check, if all data is going to fit into provided buffer */ @@ -6108,7 +6108,7 @@ SpiStatusSrbToNt(UCHAR SrbStatus) case SRB_STATUS_TIMEOUT: case SRB_STATUS_COMMAND_TIMEOUT: return STATUS_IO_TIMEOUT; - + case SRB_STATUS_BAD_SRB_BLOCK_LENGTH: case SRB_STATUS_BAD_FUNCTION: return STATUS_INVALID_DEVICE_REQUEST; diff --git a/reactos/drivers/storage/scsiport/scsiport.rbuild b/reactos/drivers/storage/scsiport/scsiport.rbuild index 0c6e5dbe4f7..722069f6941 100644 --- a/reactos/drivers/storage/scsiport/scsiport.rbuild +++ b/reactos/drivers/storage/scsiport/scsiport.rbuild @@ -1,13 +1,13 @@ - - - - - - - - . - ntoskrnl - hal - scsiport.c - scsiport.rc - + + + + + + + + . + ntoskrnl + hal + scsiport.c + scsiport.rc + diff --git a/reactos/drivers/usb/nt4compat/usbdriver/debug.h b/reactos/drivers/usb/nt4compat/usbdriver/debug.h index 23101b55740..49d9c16e362 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/debug.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/debug.h @@ -1,8 +1,8 @@ #ifndef _UHCIDBG_H_ -#define _UHCIDBG_H_ +#define _UHCIDBG_H_ -#define DBGLVL_OFF 0 // if gDebugLevel set to this, there is NO debug output -#define DBGLVL_MINIMUM 1 // minimum verbosity +#define DBGLVL_OFF 0 // if gDebugLevel set to this, there is NO debug output +#define DBGLVL_MINIMUM 1 // minimum verbosity #define DBGLVL_DEFAULT 2 // default verbosity level if no registry override #define DBGLVL_MEDIUM 3 // medium verbosity #define DBGLVL_HIGH 4 // highest 'safe' level (without severely affecting timing ) @@ -10,7 +10,7 @@ #define DBGLVL_ULTRA 6 // ultra, prints hell lots of stuff from ISR/allocs/etc #ifndef DBGSTR_PREFIX -#define DBGSTR_PREFIX "wood_uhci: " +#define DBGSTR_PREFIX "wood_uhci: " #endif #define DEBUG_UHCI TRUE @@ -52,10 +52,10 @@ extern ULONG debug_level; #define uhci_dbg_print_cond( ilev, cond, _x_ ) #define uhci_dbg_print( ilev, _x_) -#define uhci_trap_cont( ilev, cond ) +#define uhci_trap_cont( ilev, cond ) #define uhci_trap( ilev ) #define uhci_assert( cond ) -#define TRAP() +#define TRAP() #define dbg_count_list( _x_ ) 0 #endif //DBG @@ -63,7 +63,7 @@ extern ULONG debug_level; #define usb_dbg_print( ilev, _x_ ) uhci_dbg_print( ilev, _x_ ) #define ehci_dbg_print( ilev, _x_ ) uhci_dbg_print( ilev, _x_ ) #define ohci_dbg_print( ilev, _x_ ) uhci_dbg_print( ilev, _x_ ) -#define ehci_dbg_print_cond( ilev, cond, _x_ ) uhci_dbg_print_cond( ilev, cond, _x_ ) +#define ehci_dbg_print_cond( ilev, cond, _x_ ) uhci_dbg_print_cond( ilev, cond, _x_ ) #define DO_NOTHING diff --git a/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h b/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h index 34809a1abb1..d66e30352d0 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/devmgr.h @@ -34,15 +34,15 @@ typedef struct _USB_DRIVER_DESCRIPTION WORD vendor_id; // USB Vendor ID WORD product_id; // USB Product ID. WORD release_num; // Release Number of Device - + // Interface Info BYTE config_val; // Configuration Value BYTE if_num; // Interface Number BYTE if_class; // Interface Class BYTE if_sub_class; // Interface SubClass BYTE if_protocol; // Interface Protocol - - // Driver Info + + // Driver Info const char *driver_name; // Driver name for Name Registry BYTE dev_class; // Device Class (from SampleStorageDeviceID.h) BYTE dev_sub_class; // Device Subclass @@ -77,20 +77,20 @@ extern USB_DRIVER g_driver_list[ DEVMGR_MAX_DRIVERS ]; #define MAX_HCDS 8 #define dev_mgr_from_hcd( hCD ) ( ( hCD )->hcd_get_dev_mgr( hCD ) ) -#define dev_mgr_from_dev( pdEV ) ( dev_mgr_from_hcd( pdEV->hcd ) ) +#define dev_mgr_from_dev( pdEV ) ( dev_mgr_from_hcd( pdEV->hcd ) ) typedef struct _USB_DEV_MANAGER { //BYTE dev_addr_map[ MAX_DEVS / 8 ]; //one bit per dev struct _HCD *hcd_array[ MAX_HCDS ]; - unsigned char hcd_count; - + unsigned char hcd_count; + KSPIN_LOCK dev_list_lock; LIST_HEAD dev_list; //PDEVICE_EXTENSION pdev_ext; - - PVOID pthread; + + PVOID pthread; BOOLEAN term_flag; KEVENT wake_up_event; diff --git a/reactos/drivers/usb/nt4compat/usbdriver/dmgrdisp.c b/reactos/drivers/usb/nt4compat/usbdriver/dmgrdisp.c index 140a797300e..8aaf8d00684 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/dmgrdisp.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/dmgrdisp.c @@ -40,13 +40,13 @@ disp_urb_completion(PURB purb, PVOID context) // at this stage, the irp can not be canceled since the urb // won't be found in any queue and the irp is not in any queue. // see line 4685 in hub.c - // Sometimes, it may be very fast to enter this routine before + // Sometimes, it may be very fast to enter this routine before // the dev_mgr_register_irp to be called in dispatch routine in // usb2.0 environment as - // we did in usb1.1 driver. We can not simply add a loop to wait + // we did in usb1.1 driver. We can not simply add a loop to wait // for the dispatch thread to add the irp to the list, because // here we are at DPC level higher than the dispatch thread - // running level. And the solution is to register the irp + // running level. And the solution is to register the irp // before the urb is scheduled instead of registering it after // urb is scheduled. if (purb->pirp) @@ -134,7 +134,7 @@ disp_noio_urb_completion(PURB purb, PVOID context) return; } -//this function is called by the hcd's +//this function is called by the hcd's //dispatch when they have done their job. NTSTATUS dev_mgr_dispatch(IN PUSB_DEV_MANAGER dev_mgr, IN PIRP irp) @@ -504,7 +504,7 @@ dev_mgr_dispatch(IN PUSB_DEV_MANAGER dev_mgr, IN PIRP irp) //dev count, output_buffer_length must be no less than sizeof( long ). #define IOCTL_ENUM_DEVICES CTL_CODE( FILE_HCD_DEV_TYPE, 4094, METHOD_BUFFERED, FILE_ANY_ACCESS ) -//input_buffer is a dword value to indicate the count of elements in the array +//input_buffer is a dword value to indicate the count of elements in the array //input_buffer_length is sizeof( long ), output_buffer is to receive a //structure ENUM_DEV_ARRAY where dev_count is the elements hold in this array. @@ -516,17 +516,17 @@ dev_mgr_dispatch(IN PUSB_DEV_MANAGER dev_mgr, IN PIRP irp) #define IOCTL_SUBMIT_URB_RD CTL_CODE( FILE_HCD_DEV_TYPE, 4096, METHOD_IN_DIRECT, FILE_ANY_ACCESS ) #define IOCTL_SUBMIT_URB_WR CTL_CODE( FILE_HCD_DEV_TYPE, 4097, METHOD_OUT_DIRECT, FILE_ANY_ACCESS ) -// input_buffer is a URB, and input_buffer_length is equal to or greater than +// input_buffer is a URB, and input_buffer_length is equal to or greater than // sizeof( URB ); the output_buffer is a buffer to receive data from or send data // to device. only the following urb fields can be accessed, others must be zeroed. // DEV_HANDLE endp_handle; // UCHAR setup_packet[8]; //for control pipe // the choosing of IOCTL_SUBMIT_URB_RD or IOCTL_SUBMIT_URB_WR should be determined -// by the current URB, for example, a request string from device will use XXX_RD, +// by the current URB, for example, a request string from device will use XXX_RD, // and a write to the bulk endpoint will use XXX_WR #define IOCTL_SUBMIT_URB_NOIO CTL_CODE( FILE_HCD_DEV_TYPE, 4098, METHOD_BUFFERED, FILE_ANY_ACCESS ) -// input_buffer is a URB, and input_buffer_length is equal to or greater than +// input_buffer is a URB, and input_buffer_length is equal to or greater than // sizeof( URB ); the output_buffer is null and no output_buffer_length, // only the following fields in urb can be accessed, others must be zeroed. // DEV_HANDLE endp_handle; diff --git a/reactos/drivers/usb/nt4compat/usbdriver/ehci.c b/reactos/drivers/usb/nt4compat/usbdriver/ehci.c index 8d3727e82a7..9ad6b668eec 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/ehci.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/ehci.c @@ -674,7 +674,7 @@ ehci_process_pending_endp(PEHCI_DEV ehci) pwork_item = (PWORK_QUEUE_ITEM) & cancel_list[1]; // we do not need to worry the ehci_cancel_pending_endp_urb running when the - // driver is unloading since purb-reference count will prevent the dev_mgr to + // driver is unloading since purb-reference count will prevent the dev_mgr to // quit till all the reference count to the dev drop to zero. ExInitializeWorkItem(pwork_item, ehci_cancel_pending_endp_urb, (PVOID) cancel_list); ExQueueWorkItem(pwork_item, DelayedWorkQueue); @@ -771,7 +771,7 @@ ehci_submit_urb(PEHCI_DEV ehci, PUSB_DEV pdev, PUSB_ENDPOINT pendp, PURB purb) else if (usb_endp_busy_count(purb->pendp) && endp_type(purb->pendp) != USB_ENDPOINT_XFER_ISOC) { // - //No purb waiting but purb overlap not allowed, + //No purb waiting but purb overlap not allowed, //so leave it in queue and return, will be scheduled //later // @@ -960,13 +960,13 @@ ehci_dpc_callback(PKDPC dpc, PVOID context, PVOID sysarg1, PVOID sysarg2) sync_param.context = (PVOID) & temp_list; ehci_dbg_print(DBGLVL_MAXIMUM, ("ehci_dpc_callback(): entering..., ehci=0x%x\n", ehci)); - //remove finished purb from ehci's purb-list + //remove finished purb from ehci's purb-list KeSynchronizeExecution(ehci->pdev_ext->ehci_int, ehci_sync_remove_urb_finished, &sync_param); - //release resources( itds, sitds, fstns, tds, and qhs ) allocated for the purb + //release resources( itds, sitds, fstns, tds, and qhs ) allocated for the purb while (IsListEmpty(&temp_list) == FALSE) { - //not in any public queue, if do not access into dev, no race + //not in any public queue, if do not access into dev, no race //condition will occur purb = (PURB) RemoveHeadList(&temp_list); urb_status = purb->status; @@ -1300,7 +1300,7 @@ ehci_remove_device(PEHCI_DEV ehci, PUSB_DEV dev) lock_dev(dev, FALSE); if (dev->usb_config) { - //only for configed dev + //only for configed dev for(i = 0; i < dev->usb_config->if_count; i++) { for(j = 0; j < dev->usb_config->interf[i].endp_count; j++) @@ -2376,7 +2376,7 @@ ehci_internal_submit_iso(PEHCI_DEV ehci, PURB purb) if (pipe_content->interval < 3) { // this indicates one itd schedules more than one uframes - // for multiple transactions described by iso_packet_desc + // for multiple transactions described by iso_packet_desc if (i == 0) k = td_count == 1 ? purb->iso_frame_count : j; // the first itd else @@ -2461,9 +2461,9 @@ ehci_internal_submit_iso(PEHCI_DEV ehci, PURB purb) } else { - // scan to find if the buf pointer already filled in the td + // scan to find if the buf pointer already filled in the td // since interval = 1, we do not need k * REAL_INTERVAL - // k is transaction count for current td, + // k is transaction count for current td, // n is hw_bufp( pbuf ) index // n2 is the last phys_addr index we stopped for(m = n2; m < start_uf + k; m++) @@ -2820,7 +2820,7 @@ ehci_cancel_urb(PEHCI_DEV ehci, PUSB_DEV pdev, PUSB_ENDPOINT pendp, PURB purb) return STATUS_SUCCESS; } - // search the purb in the purb-list and try to cancel + // search the purb in the purb-list and try to cancel sync_param.ehci = ehci; sync_param.context = purb; @@ -3059,7 +3059,7 @@ ehci_rh_submit_urb(PUSB_DEV pdev, PURB purb) case USB_PORT_FEAT_C_RESET: { ps->wPortChange &= ~USB_PORT_STAT_C_RESET; - //the reset signal is down in rh_timer_svc_reset_port_completion + //the reset signal is down in rh_timer_svc_reset_port_completion // enable or not is set by host controller // status = EHCI_READ_PORT_ULONG( ( PUSHORT ) ( ehci->port_base + i ) ); usb_dbg_print(DBGLVL_MAXIMUM, @@ -3083,7 +3083,7 @@ ehci_rh_submit_urb(PUSB_DEV pdev, PURB purb) } else if (psetup->bmRequestType == 0xd3 && psetup->bRequest == HUB_REQ_GET_STATE) { - // get bus state + // get bus state if (psetup->wIndex == 0 || psetup->wIndex > port_count || psetup->wLength == 0) { purb->status = STATUS_INVALID_PARAMETER; @@ -3599,12 +3599,12 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU if (addr_space == 0) { - //port has been mapped to memory space + //port has been mapped to memory space pdev_ext->ehci->port_mapped = TRUE; pdev_ext->ehci->port_base = (PBYTE) MmMapIoSpace(pdev_ext->ehci->ehci_reg_base, pdev_ext->res_port.Length, FALSE); - //fatal error can not map the registers + //fatal error can not map the registers if (pdev_ext->ehci->port_base == NULL) { release_adapter(pdev_ext->padapter); @@ -3687,7 +3687,7 @@ ehci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr) if (drvr_obj == NULL) return NULL; - //note: hcd count wont increment till the hcd is registered in dev_mgr + //note: hcd count wont increment till the hcd is registered in dev_mgr sprintf(str_dev_name, "%s%d", EHCI_DEVICE_NAME, dev_mgr->hcd_count); sprintf(str_symb_name, "%s%d", EHCI_DOS_DEVICE_NAME, dev_mgr->hcd_count); @@ -3850,7 +3850,7 @@ ehci_init_schedule(PEHCI_DEV ehci, PADAPTER_OBJECT padapter) // chain qh to the shadow list InsertTailList(&ehci->periodic_list_cpu[EHCI_SCHED_INT8_INDEX], &pelnk->sched_link); - // chain it to the periodic schedule, we use it as a docking point + // chain it to the periodic schedule, we use it as a docking point // for req of 8- uframes request pqh = (PEHCI_QH) pqh_content; @@ -4290,7 +4290,7 @@ ehci_claim_bw_for_int(PEHCI_DEV ehci, PURB purb, BOOLEAN release) // 55 is 144 - 90 + 1, turnaround time is one byte not the worst case 90 bytes, // refer to ehci-1.0 table 4-5 p64 ss_time = 231 * 25 / 12; - // cs_time = ( 55 * 8 + ( LONG )( ( ( 19 + 7 * 8 * purb->data_length ) / 6 ) ) ) * 25 / 12; + // cs_time = ( 55 * 8 + ( LONG )( ( ( 19 + 7 * 8 * purb->data_length ) / 6 ) ) ) * 25 / 12; cs_time = (55 * 8 + (LONG) (((7 * 8 * purb->data_length) / 6))) * 25 / 12; } else @@ -4406,7 +4406,7 @@ ehci_get_cache_policy(PEHCI_DEV ehci) #define BEST_BUDGET_TIME_UFRAME ( ( 188 * 7 / 6 ) * 25 / 12 ) // in: 231 is sum of split token + host ipg + token, 8 is bus turn-around time, 67 is full speed data token in DATA packet -// out: 49 byte is sum of split token+ host ipg + token + host ipg + data packet +// out: 49 byte is sum of split token+ host ipg + token + host ipg + data packet #define iso_max_data_load( dir ) ( dir == USB_DIR_IN ? \ ( ( 188 * 8 - 231 - 8 - 67 + ( 8 - 1 ) ) / 8 ) : ( 188 - 49 ) ) @@ -4527,7 +4527,7 @@ ehci_claim_bw_for_iso(PEHCI_DEV ehci, PURB purb, BOOLEAN release) // // calculate for each frame // in: 231 is sum of split token + host ipg + token, 8 is bus turn-around time, 67 is full speed data token in DATA packet - // out: 49 byte is sum of split token+ host ipg + token + host ipg + data packet + // out: 49 byte is sum of split token+ host ipg + token + host ipg + data packet // bit-stuffing is for high speed bus transfer // @@ -4541,12 +4541,12 @@ ehci_claim_bw_for_iso(PEHCI_DEV ehci, PURB purb, BOOLEAN release) else { // an output transfer according to ehci-1.0 table 4-5 p64 - // ss_time = ( 49 * 8 + ( LONG )( ( ( 19 + 7 * 8 * 188 ) / 6 ) ) ) * 25 / 12; + // ss_time = ( 49 * 8 + ( LONG )( ( ( 19 + 7 * 8 * 188 ) / 6 ) ) ) * 25 / 12; ss_time = (49 * 8 + (LONG) (((7 * 8 * 188) / 6))) * 25 / 12; cs_time = 0; for(i = 0; i < (LONG) purb->iso_frame_count; i++) { - // remainder = ( 49 * 8 + ( LONG )( ( ( 19 + 7 * 8 * ( purb->iso_packet_desc[ i ].length % 188 ) ) / 6 ) ) ) * 25 / 12; + // remainder = ( 49 * 8 + ( LONG )( ( ( 19 + 7 * 8 * ( purb->iso_packet_desc[ i ].length % 188 ) ) / 6 ) ) ) * 25 / 12; remainder = (49 * 8 + (LONG) (((7 * 8 * (purb->iso_packet_desc[i].length % 188)) / 6))) * 25 / 12; remainder >>= 1; @@ -6160,7 +6160,7 @@ ehci_unload(IN PDRIVER_OBJECT DriverObject) // dev_mgr->term_flag = TRUE; // - // wake up the thread if it is + // wake up the thread if it is // KeSetEvent(&dev_mgr->wake_up_event, 0, FALSE); KeWaitForSingleObject(dev_mgr->pthread, Executive, KernelMode, TRUE, NULL); @@ -6264,7 +6264,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) // routines for handling system PNP and power management requests //DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = generic_dispatch_irp; - // The Functional Device Object (FDO) will not be created for PNP devices until + // The Functional Device Object (FDO) will not be created for PNP devices until // this routine is called upon device plug-in. RtlZeroMemory(&g_dev_mgr, sizeof(USB_DEV_MANAGER)); g_dev_mgr.usb_driver_obj = DriverObject; diff --git a/reactos/drivers/usb/nt4compat/usbdriver/ehci.h b/reactos/drivers/usb/nt4compat/usbdriver/ehci.h index 203534280f0..4e1f9b2df40 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/ehci.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/ehci.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2001-2002 by David Brownell - * + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -140,7 +140,7 @@ typedef struct _EHCI_ELEM_POOL /* * EHCI Specification 0.95 Section 3.5 - * QTD: describe data transfer components (buffer, direction, ...) + * QTD: describe data transfer components (buffer, direction, ...) * See Fig 3-6 "Queue Element Transfer Descriptor Block Diagram". * * These are associated only with "QH" (Queue Head) structures, @@ -202,7 +202,7 @@ typedef struct _EHCI_QTD /* first part defined by EHCI spec */ ULONG hw_next; /* see EHCI 3.5.1 */ ULONG hw_alt_next; /* see EHCI 3.5.2 */ - ULONG hw_token; /* see EHCI 3.5.3 */ + ULONG hw_token; /* see EHCI 3.5.3 */ ULONG hw_buf [5]; /* see EHCI 3.5.4 */ /* the rest is HCD-private */ @@ -292,7 +292,7 @@ typedef struct _EHCI_QH ULONG hw_info1; /* see EHCI 3.6.2 */ ULONG hw_info2; /* see EHCI 3.6.2 */ ULONG hw_current; /* qtd list - see EHCI 3.6.4 */ - + /* qtd overlay (hardware parts of a struct ehci_qtd) */ ULONG hw_qtd_next; ULONG hw_alt_next; @@ -371,7 +371,7 @@ typedef struct _EHCI_ITD { /* first part defined by EHCI spec */ ULONG hw_next; /* see EHCI 3.3.1 */ ULONG hw_transaction [8]; /* see EHCI 3.3.2 */ - ULONG hw_bufp [7]; /* see EHCI 3.3.3 */ + ULONG hw_bufp [7]; /* see EHCI 3.3.3 */ /* the rest is EHCI-private */ PEHCI_ELEM_LINKS elem_head_link; @@ -384,7 +384,7 @@ typedef struct _EHCI_ITD { /*-------------------------------------------------------------------------*/ /* - * EHCI Specification 0.95 Section 3.4 + * EHCI Specification 0.95 Section 3.4 * siTD, aka split-transaction isochronous Transfer Descriptor * ... describe low/full speed iso xfers through TT in hubs * see Figure 3-5 "Split-transaction Isochronous Transaction Descriptor (siTD) @@ -438,7 +438,7 @@ typedef struct _EHCI_SITD_CONTENT ULONG back_terminal : 1; ULONG reserved7 : 4; ULONG back_ptr : 27; - + } EHCI_SITD_CONTENT, *PEHCI_SITD_CONTENT; typedef struct _EHCI_SITD @@ -501,8 +501,8 @@ typedef struct _EHCI_FSTN #define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */ #define HCS_N_CC(p) (((p)>>12)&0xf) /* bits 15:12, #companion HCs */ #define HCS_N_PCC(p) (((p)>>8)&0xf) /* bits 11:8, ports per CC */ -#define HCS_PORTROUTED(p) ((p)&(1 << 7)) /* true: port routing */ -#define HCS_PPC(p) ((p)&(1 << 4)) /* true: port power control */ +#define HCS_PORTROUTED(p) ((p)&(1 << 7)) /* true: port routing */ +#define HCS_PPC(p) ((p)&(1 << 4)) /* true: port power control */ #define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */ #define HCC_EXT_CAPS(p) (((p)>>8)&0xff) /* for pci extended caps */ @@ -769,7 +769,7 @@ typedef struct _EHCI_DEV PUSHORT frame_bw; //unit uFrame USHORT min_bw; //the bottle-neck of the bandwidths across frame-list - KTIMER reset_timer; //used to reset the host controller + KTIMER reset_timer; //used to reset the host controller struct _EHCI_DEVICE_EXTENSION *pdev_ext; PUSB_DEV root_hub; //root hub @@ -780,7 +780,7 @@ typedef UHCI_PORT EHCI_MEMORY; typedef struct _EHCI_DEVICE_EXTENSION { //struct _USB_DEV_MANAGER *pdev_mgr; - DEVEXT_HEADER dev_ext_hdr; + DEVEXT_HEADER dev_ext_hdr; PDEVICE_OBJECT pdev_obj; PDRIVER_OBJECT pdrvr_obj; PEHCI_DEV ehci; diff --git a/reactos/drivers/usb/nt4compat/usbdriver/events.h b/reactos/drivers/usb/nt4compat/usbdriver/events.h index 1dd0353d4ec..bbbe4f3144b 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/events.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/events.h @@ -8,7 +8,7 @@ #define USB_EVENT_FLAG_ACTIVE 0x80000000 -#define USB_EVENT_FLAG_QUE_TYPE 0x000000FF +#define USB_EVENT_FLAG_QUE_TYPE 0x000000FF #define USB_EVENT_FLAG_QUE_RESET 0x01 #define USB_EVENT_FLAG_NOQUE 0x00 @@ -43,7 +43,7 @@ typedef struct _USB_EVENT struct _USB_EVENT *pnext; //vertical queue for serialized operation PROCESS_EVENT process_event; PROCESS_QUEUE process_queue; - + } USB_EVENT, *PUSB_EVENT; typedef struct _USB_EVENT_POOL @@ -101,7 +101,7 @@ typedef struct _TIMER_SVC ULONG context; PUSB_DEV pdev; TIMER_SVC_HANDLER func; - + } TIMER_SVC, *PTIMER_SVC; typedef struct _TIMER_SVC_POOL diff --git a/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c b/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c index cd1bdbc9f96..3df843b93b7 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c @@ -271,7 +271,7 @@ gendrv_event_select_driver(PUSB_DEV pdev, //always null. we do not use thi { // // try to search the registry to find one driver. - // if found, create the PDO, load the driver. + // if found, create the PDO, load the driver. // and call its AddDevice. // LONG i; @@ -302,7 +302,7 @@ gendrv_event_select_driver(PUSB_DEV pdev, //always null. we do not use thi pdrvr_ext = (PGENDRV_DRVR_EXTENSION) pdrvr->driver_ext; // - // well, let's do the hard work to see if there is a class driver + // well, let's do the hard work to see if there is a class driver // for this device. // in the event routine, we have no need to check if the device is zomb or // not, it must be alive there. @@ -721,7 +721,7 @@ gendrv_if_connect(PDEV_CONNECT_DATA params, DEV_HANDLE if_handle) { // // try to search the registry to find one driver. - // if found, create the PDO, load the driver. + // if found, create the PDO, load the driver. // and call its AddDevice. // LONG if_idx, i; @@ -756,7 +756,7 @@ gendrv_if_connect(PDEV_CONNECT_DATA params, DEV_HANDLE if_handle) goto ERROR_OUT; } // obtain the pointer to the config desc, the dev won't go away in this routine - pconfig_desc = pdev->usb_config->pusb_config_desc; // + pconfig_desc = pdev->usb_config->pusb_config_desc; // usb_unlock_dev(pdev); pdev = NULL; @@ -773,7 +773,7 @@ gendrv_if_connect(PDEV_CONNECT_DATA params, DEV_HANDLE if_handle) return FALSE; // - // well, let's do the hard work to see if there is a class driver + // well, let's do the hard work to see if there is a class driver // for this device. // i = gendrv_make_key((PUSB_DESC_HEADER) pif_desc); @@ -1712,7 +1712,7 @@ gendrv_startio(IN PDEVICE_OBJECT dev_obj, IN PIRP irp) // // we have to register irp before the urb is scheduled to - // avoid race condition. + // avoid race condition. // ASSERT(dev_mgr_register_irp(dev_mgr, irp, purb)); // @@ -1720,11 +1720,11 @@ gendrv_startio(IN PDEVICE_OBJECT dev_obj, IN PIRP irp) // now the current irp and not in any urb queue. dev_mgr_cancel_irp // can not find it and simply return. // - // FIXME: there is a time window that the irp is registered and + // FIXME: there is a time window that the irp is registered and // the urb is not queued. In the meantime, the cancel - // request may come and cause the irp removed from the irp + // request may come and cause the irp removed from the irp // queue while fail to cancel due to urb not in any urb queue . - // Thus from that point on, the irp can not be canceled till it + // Thus from that point on, the irp can not be canceled till it // is completed or hanging there forever. // status = usb_submit_urb(dev_mgr, purb); diff --git a/reactos/drivers/usb/nt4compat/usbdriver/hcd.h b/reactos/drivers/usb/nt4compat/usbdriver/hcd.h index 8f62b3e7d48..854e02e3746 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/hcd.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/hcd.h @@ -12,7 +12,7 @@ #define HCD_ID_MASK 0xf #define HCD_DISP_READ_PORT_COUNT 1 // the param is a pointer to UCHAR -#define HCD_DISP_READ_RH_DEV_CHANGE 2 // the param is a buffer to hold conn change on all the port +#define HCD_DISP_READ_RH_DEV_CHANGE 2 // the param is a buffer to hold conn change on all the port // must have the rh dev_lock acquired struct _HCD; @@ -23,12 +23,12 @@ struct _URB; typedef VOID ( *PHCD_SET_DEV_MGR )( struct _HCD* hcd, struct _USB_DEV_MANAGER *dev_mgr ); typedef struct _USB_DEV_MANAGER* ( *PHCD_GET_DEV_MGR )( struct _HCD* hcd ); -typedef ULONG ( *PHCD_GET_TYPE )( struct _HCD* hcd ); +typedef ULONG ( *PHCD_GET_TYPE )( struct _HCD* hcd ); typedef VOID ( *PHCD_SET_ID )( struct _HCD* hcd, UCHAR id ); typedef UCHAR ( *PHCD_GET_ID )( struct _HCD* hcd ); typedef UCHAR ( *PHCD_ALLOC_ADDR )( struct _HCD* hcd ); typedef VOID ( *PHCD_FREE_ADDR )( struct _HCD* hcd, UCHAR addr ); -typedef NTSTATUS ( *PHCD_SUBMIT_URB )( struct _HCD* hcd, struct _USB_DEV *pdev, struct _USB_ENDPOINT *pendp, struct _URB *purb ); +typedef NTSTATUS ( *PHCD_SUBMIT_URB )( struct _HCD* hcd, struct _USB_DEV *pdev, struct _USB_ENDPOINT *pendp, struct _URB *purb ); typedef VOID ( *PHCD_GENERIC_URB_COMPLETION )( struct _URB *purb, PVOID context ); //we can get te hcd from purb typedef struct _USB_DEV* ( *PHCD_GET_ROOT_HUB )( struct _HCD* hcd ); typedef VOID ( *PHCD_SET_ROOT_HUB )( struct _HCD* hcd, struct _USB_DEV *root_hub ); @@ -52,7 +52,7 @@ typedef struct _HCD PHCD_GENERIC_URB_COMPLETION hcd_generic_urb_completion; PHCD_GET_ROOT_HUB hcd_get_root_hub; PHCD_SET_ROOT_HUB hcd_set_root_hub; - PHCD_REMOVE_DEVICE hcd_remove_device; + PHCD_REMOVE_DEVICE hcd_remove_device; PHCD_RH_RESET_PORT hcd_rh_reset_port; PHCD_RELEASE hcd_release; PHCD_CANCEL_URB hcd_cancel_urb; diff --git a/reactos/drivers/usb/nt4compat/usbdriver/hub.c b/reactos/drivers/usb/nt4compat/usbdriver/hub.c index b0ac6df9046..34ed14f5cef 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/hub.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/hub.c @@ -628,7 +628,7 @@ hub_get_port_status_completion(PURB purb, PVOID context) // // must be fatal error // FIXME: better to pass it to the completion for further - // processing? + // processing? // usb_free_mem(purb); } @@ -758,7 +758,7 @@ hub_clear_port_feature_completion(PURB purb, PVOID context) { // // FIXME: should we pass the error to the completion directly - // instead of forstall it here? + // instead of forstall it here? // // do not think the device is workable, no requests to it any more. // including the int polling diff --git a/reactos/drivers/usb/nt4compat/usbdriver/hub.h b/reactos/drivers/usb/nt4compat/usbdriver/hub.h index f6d5d1bf364..91447c99111 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/hub.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/hub.h @@ -122,7 +122,7 @@ typedef struct _USB_HUB_DESCRIPTOR BYTE bPwrOn2PwrGood; BYTE bHubContrCurrent; - /* DeviceRemovable and PortPwrCtrlMask want to be variable-length + /* DeviceRemovable and PortPwrCtrlMask want to be variable-length bitmaps that hold max 256 entries, but for now they're ignored */ BYTE bitmap[0]; } USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR; @@ -179,10 +179,10 @@ typedef struct _HUB_EXTENSION USB_HUB_STATUS hub_status; USB_PORT_STATUS port_status; //working data buf for get port feature - + USB_PORT_STATUS rh_port1_status; //working buf for get rh port1 feature USB_PORT_STATUS rh_port2_status; //working buf for get rh port2 feature - + USB_HUB_DESCRIPTOR hub_desc; } HUB_EXTENSION, *PHUB_EXTENSION; @@ -207,7 +207,7 @@ typedef struct _HUB2_EXTENSION USB_HUB_STATUS hub_status; USB_PORT_STATUS port_status; //working data buf for get port feature - + USB_PORT_STATUS rh_port_status[ EHCI_MAX_ROOT_PORTS ]; //working buf for get rh ports feature UCHAR multiple_tt; // boolean diff --git a/reactos/drivers/usb/nt4compat/usbdriver/irplist.h b/reactos/drivers/usb/nt4compat/usbdriver/irplist.h index 81156475b87..f6dbe064d5e 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/irplist.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/irplist.h @@ -22,7 +22,7 @@ typedef struct _IRP_LIST } IRP_LIST, *PIRP_LIST; BOOLEAN -init_irp_list( +init_irp_list( PIRP_LIST irp_list ); diff --git a/reactos/drivers/usb/nt4compat/usbdriver/ohci.c b/reactos/drivers/usb/nt4compat/usbdriver/ohci.c index 6cc55e9a18f..8388017ed31 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/ohci.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/ohci.c @@ -190,12 +190,12 @@ ohci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU if (addr_space == 0) { - //port has been mapped to memory space + //port has been mapped to memory space pdev_ext->ehci->port_mapped = TRUE; pdev_ext->ehci->port_base = (PBYTE) MmMapIoSpace(pdev_ext->ehci->ehci_reg_base, pdev_ext->res_port.Length, FALSE); - //fatal error can not map the registers + //fatal error can not map the registers if (pdev_ext->ehci->port_base == NULL) { release_adapter(pdev_ext->padapter); diff --git a/reactos/drivers/usb/nt4compat/usbdriver/ohci.h b/reactos/drivers/usb/nt4compat/usbdriver/ohci.h index 093c57d1d77..788048afb7b 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/ohci.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/ohci.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2007 by Aleksey Bragin - * + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your diff --git a/reactos/drivers/usb/nt4compat/usbdriver/td.c b/reactos/drivers/usb/nt4compat/usbdriver/td.c index 67c8bc578ed..39cc8b589d8 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/td.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/td.c @@ -465,7 +465,7 @@ unlock_td_pool(PUHCI_TD_POOL_LIST pool_list, BOOLEAN at_dpc) { //if( !at_dpc ) // KeReleaseSpinLock( &pool_list->pool_lock ); - //else + //else // KeReleaseSpinLockFromDpcLevel( &pool_list->pool_lock ); } @@ -588,7 +588,7 @@ lock_qh_pool(PUHCI_QH_POOL pool, BOOLEAN at_dpc) { //if( !at_dpc ) // KeAcquireSpinLock( &pool->pool_lock ); - //else + //else // KeAcquireSpinLockAtDpcLevel( &pool->pool_lock ); } diff --git a/reactos/drivers/usb/nt4compat/usbdriver/td.h b/reactos/drivers/usb/nt4compat/usbdriver/td.h index 8897c18ceee..ec2afa8ac8a 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/td.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/td.h @@ -189,7 +189,7 @@ struct URB; #define dev_state( pdEV ) ( ( pdEV )->flags & USB_DEV_STATE_MASK ) -#define dev_class( pdev ) ( pdev->flags & USB_DEV_CLASS_MASK ) +#define dev_class( pdev ) ( pdev->flags & USB_DEV_CLASS_MASK ) #define uhci_from_hcd( hCD ) ( struct_ptr( ( hCD ), UHCI_DEV, hcd_interf ) ) #define uhci_from_dev( dEV ) ( struct_ptr( ( dEV->hcd ), UHCI_DEV, hcd_interf ) ) @@ -234,8 +234,8 @@ typedef struct _UHCI_TD_POOL } UHCI_TD_POOL, *PUHCI_TD_POOL; -BOOLEAN -init_td_pool( +BOOLEAN +init_td_pool( PUHCI_TD_POOL pool ); @@ -339,13 +339,13 @@ BOOLEAN at_dpc typedef struct _UHCI_QH { /* Hardware fields */ - ULONG link; // Next queue + ULONG link; // Next queue ULONG element; // Queue element pointer /* Software fields */ ULONG phy_addr; //constant since initialized struct _QH_EXTENSION *pqhe; - + } UHCI_QH, *PUHCI_QH; typedef struct _QH_EXTENSION @@ -409,7 +409,7 @@ PUHCI_QH_POOL pool, BOOLEAN at_dpc ); -/* +/* * Search tree for determining where fits in the * skelqh[] skeleton. * @@ -492,8 +492,8 @@ typedef struct _USB_INTERFACE LONG if_ext_size; UCHAR altif_count; LIST_ENTRY altif_list; - - + + } USB_INTERFACE, *PUSB_INTERFACE; #define MAX_INTERFACES_PER_CONFIG 4 @@ -506,7 +506,7 @@ typedef struct _USB_CONFIGURATION UCHAR if_count; USB_INTERFACE interf[MAX_INTERFACES_PER_CONFIG]; struct _USB_DEV *pusb_dev; - + } USB_CONFIGURATION, *PUSB_CONFIGURATION; #define USE_IRQL \ @@ -582,7 +582,7 @@ typedef struct _USB_DEV struct _USB_DEV *parent_dev; UCHAR port_idx; //parent hub's port idx, to which the dev attached - + struct _HCD *hcd; //point to the hcd the dev belongs to USB_ENDPOINT default_endp; //control endp. its interfac pointer is to the first interface @@ -590,7 +590,7 @@ typedef struct _USB_DEV LONG desc_buf_size; PUCHAR desc_buf; struct _USB_DEVICE_DESC *pusb_dev_desc; - + UCHAR active_config_idx; PUSB_CONFIGURATION usb_config; //the active configuration @@ -700,7 +700,7 @@ typedef struct _UHCI LONG fsbr_cnt; //used to record number of fsbr users KTIMER reset_timer; //used to reset the host controller - + //struct _USB_DEV_MANAGER dev_mgr; //it is in hcd_interf struct _DEVICE_EXTENSION *pdev_ext; @@ -751,7 +751,7 @@ typedef struct _DEVEXT_HEADER typedef struct _DEVICE_EXTENSION { //struct _USB_DEV_MANAGER *pdev_mgr; - DEVEXT_HEADER dev_ext_hdr; + DEVEXT_HEADER dev_ext_hdr; PDEVICE_OBJECT pdev_obj; PDRIVER_OBJECT pdrvr_obj; PUHCI_DEV uhci; @@ -864,7 +864,7 @@ PUSB_DEV dev ); BOOLEAN -uhci_remove_device( +uhci_remove_device( PUHCI_DEV uhci, PUSB_DEV dev ); diff --git a/reactos/drivers/usb/nt4compat/usbdriver/uhci.c b/reactos/drivers/usb/nt4compat/usbdriver/uhci.c index 7a6c776e566..7ea885aa623 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/uhci.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/uhci.c @@ -420,7 +420,7 @@ uhci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr) ASSERT(dev_mgr != NULL); - //note: hcd count wont increment till the hcd is registered in dev_mgr + //note: hcd count wont increment till the hcd is registered in dev_mgr sprintf(str_dev_name, "%s%d", UHCI_DEVICE_NAME, dev_mgr->hcd_count); sprintf(str_symb_name, "%s%d", DOS_DEVICE_NAME, dev_mgr->hcd_count); @@ -790,12 +790,12 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU if (addr_space == 0) { - //port has been mapped to memory space + //port has been mapped to memory space pdev_ext->uhci->port_mapped = TRUE; pdev_ext->uhci->port_base = (PBYTE) MmMapIoSpace(pdev_ext->uhci->uhci_reg_base, pdev_ext->res_port.Length, FALSE); - //fatal error can not map the registers + //fatal error can not map the registers if (pdev_ext->uhci->port_base == NULL) { release_adapter(pdev_ext->padapter); @@ -1410,7 +1410,7 @@ uhci_submit_urb(PUHCI_DEV uhci, PUSB_DEV pdev, PUSB_ENDPOINT pendp, PURB purb) else if (usb_endp_busy_count(purb->pendp) && endp_type(purb->pendp) != USB_ENDPOINT_XFER_ISOC) { // - //No urb waiting but urb overlap not allowed, + //No urb waiting but urb overlap not allowed, //so leave it in queue and return, will be scheduled //later // @@ -1568,13 +1568,13 @@ uhci_dpc_callback(PKDPC dpc, PVOID context, PVOID sysarg1, PVOID sysarg2) sync_param.context = (PVOID) & temp_list; uhci_dbg_print(DBGLVL_MAXIMUM, ("uhci_dpc_callback(): entering..., uhci=0x%x\n", uhci)); - //remove finished urb from uhci's urb-list + //remove finished urb from uhci's urb-list KeSynchronizeExecution(uhci->pdev_ext->uhci_int, uhci_sync_remove_urb_finished, &sync_param); //release resources( tds, and qhs ) the urb occupied while (IsListEmpty(&temp_list) == FALSE) { - //not in any public queue, if do not access into dev, no race + //not in any public queue, if do not access into dev, no race //condition will occur purb = (PURB) RemoveHeadList(&temp_list); urb_status = purb->status; @@ -1851,7 +1851,7 @@ uhci_remove_device(PUHCI_DEV uhci, PUSB_DEV dev) lock_dev(dev, FALSE); if (dev->usb_config) { - //only for configed dev + //only for configed dev for(i = 0; i < dev->usb_config->if_count; i++) { for(j = 0; j < dev->usb_config->interf[i].endp_count; j++) @@ -2569,12 +2569,12 @@ uhci_remove_bulk_from_schedule(PUHCI_DEV uhci, PURB urb) if (pprev != pnext) { - //not the last one + //not the last one pprev_qh->link = pnext_qh->phy_addr; } else { - //only two qhs in the list + //only two qhs in the list for(i = 0; i < UHCI_MAX_SKELQHS; i++) { if (pprev_qh == uhci->skel_qh[i]) @@ -3356,7 +3356,7 @@ uhci_rh_submit_urb(PUSB_DEV pdev, PURB purb) } else if (psetup->bmRequestType == 0xd3 && psetup->bRequest == HUB_REQ_GET_STATE) { - // get bus state + // get bus state if (psetup->wIndex == 0 || psetup->wIndex > 2 || psetup->wLength == 0) { purb->status = STATUS_INVALID_PARAMETER; @@ -3530,7 +3530,7 @@ uhci_unload(IN PDRIVER_OBJECT DriverObject) dev_mgr->term_flag = TRUE; // - // wake up the thread if it is + // wake up the thread if it is // KeSetEvent(&dev_mgr->wake_up_event, 0, FALSE); KeWaitForSingleObject(dev_mgr->pthread, Executive, KernelMode, TRUE, NULL); @@ -3846,7 +3846,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) // routines for handling system PNP and power management requests //DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = generic_dispatch_irp; - // The Functional Device Object (FDO) will not be created for PNP devices until + // The Functional Device Object (FDO) will not be created for PNP devices until // this routine is called upon device plug-in. RtlZeroMemory(&g_dev_mgr, sizeof(USB_DEV_MANAGER)); g_dev_mgr.usb_driver_obj = DriverObject; diff --git a/reactos/drivers/usb/nt4compat/usbdriver/umss.c b/reactos/drivers/usb/nt4compat/usbdriver/umss.c index d42e795bf79..2c8632039eb 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/umss.c +++ b/reactos/drivers/usb/nt4compat/usbdriver/umss.c @@ -1923,7 +1923,7 @@ Routine Description: Wrapper for handling worker thread callbacks, it is importent to lock the dev from being deleted by calling usb_query_and_lock_dev and in umss_worker, call the usb_unlock_dev to release the ref - count. One exception is that the umss_if_disconnect call this + count. One exception is that the umss_if_disconnect call this function to delete the device object that is still held by some others, and deferred deletion is required. diff --git a/reactos/drivers/usb/nt4compat/usbdriver/umss.h b/reactos/drivers/usb/nt4compat/usbdriver/umss.h index 3e7af8678ab..ca67e03f027 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/umss.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/umss.h @@ -47,7 +47,7 @@ // output_buffer_length is the size of the buffer #define IOCTL_REGISTER_DRIVER CTL_CODE( FILE_USB_DEV_TYPE, 4203, METHOD_BUFFERED, FILE_ANY_ACCESS ) -// input_buffer is a CLASS_DRV_REG_INFO, and input_buffer_length is equal to or greater than +// input_buffer is a CLASS_DRV_REG_INFO, and input_buffer_length is equal to or greater than // sizeof( CLASS_DRV_REG_INFO ); the output_buffer is null and no output_buffer_length, // only the following fields in urb can be accessed, others must be zeroed. @@ -205,7 +205,7 @@ typedef struct _UMSS_DEVICE_EXTENSION //this structure is the device extension for dev_obj //created for the device. DEVEXT_HEADER dev_ext_hdr; - + ULONG flags; LIST_ENTRY dev_obj_link; // this link is used by the driver object to track the existing dev_objs @@ -262,7 +262,7 @@ typedef struct _UMSS_WORKER_PACKET PVOID pdev; } UMSS_WORKER_PACKET, *PUMSS_WORKER_PACKET; - + BOOLEAN umss_driver_init( PUSB_DEV_MANAGER dev_mgr, @@ -313,7 +313,7 @@ IN PUMSS_DEVICE_EXTENSION pdev_ext, IN UCHAR trans_dir, IN PVOID buf, IN ULONG buf_length, -IN PURBCOMPLETION completion +IN PURBCOMPLETION completion ); BOOLEAN diff --git a/reactos/drivers/usb/nt4compat/usbdriver/usb.h b/reactos/drivers/usb/nt4compat/usbdriver/usb.h index aaa9a76b750..a9bc705a470 100644 --- a/reactos/drivers/usb/nt4compat/usbdriver/usb.h +++ b/reactos/drivers/usb/nt4compat/usbdriver/usb.h @@ -85,8 +85,8 @@ typedef unsigned long ULONG_PTR, *PULONG_PTR; ( uRb )->context = contExt; \ ( uRb )->reference = refereNce; \ } - - + + #define UsbBuildGetDescriptorRequest(uRb, \ endp_hAndle, \ @@ -487,7 +487,7 @@ typedef LONG USBD_STATUS; #define USB_STATUS_BABBLE_DETECTED ((USBD_STATUS)0xC0000408L) // -// returned by HCD if a transfer is submitted to an endpoint that is +// returned by HCD if a transfer is submitted to an endpoint that is // stalled // #define USB_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000430L) @@ -506,7 +506,7 @@ typedef LONG USBD_STATUS; // #define USB_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L) // -// returned by USBD if it cannot complete a URB request, typically this +// returned by USBD if it cannot complete a URB request, typically this // will be returned in the URB status field when the Irp is completed // with a more specific NT error code in the irp.status field. // @@ -519,25 +519,25 @@ typedef LONG USBD_STATUS; #define USB_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L) // // generic HC error -// +// #define USB_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L) // // returned when a short packet terminates the transfer // ie USBD_SHORT_TRANSFER_OK bit not set -// +// #define USB_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L) -// +// // returned if the requested start frame is not within -// USBD_ISO_START_FRAME_RANGE of the current USB frame, +// USBD_ISO_START_FRAME_RANGE of the current USB frame, // note that the stall bit is set -// +// #define USB_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L) // -// returned by HCD if all packets in an iso transfer complete with an error +// returned by HCD if all packets in an iso transfer complete with an error // #define USB_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L) // -// returned by USBD if the frame length control for a given +// returned by USBD if the frame length control for a given // HC is already taken by anothe driver // #define USB_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L) @@ -569,7 +569,7 @@ typedef LONG USBD_STATUS; //dev count, output_buffer_length must be no less than sizeof( unsigned long ). #define IOCTL_ENUM_DEVICES CTL_CODE( FILE_HCD_DEV_TYPE, 4094, METHOD_BUFFERED, FILE_ANY_ACCESS ) -//input_buffer is a dword value to indicate the count of elements in the array +//input_buffer is a dword value to indicate the count of elements in the array //input_buffer_length is sizeof( unsigned long ), output_buffer is to receive a //structure ENUM_DEV_ARRAY where dev_count is the elements hold in this array. @@ -582,17 +582,17 @@ typedef LONG USBD_STATUS; #define IOCTL_SUBMIT_URB_RD CTL_CODE( FILE_HCD_DEV_TYPE, 4096, METHOD_IN_DIRECT, FILE_ANY_ACCESS ) #define IOCTL_SUBMIT_URB_WR CTL_CODE( FILE_HCD_DEV_TYPE, 4097, METHOD_OUT_DIRECT, FILE_ANY_ACCESS ) // if the major_function is IRP_MJ_DEVICE_CONTROL -// input_buffer is a URB, and input_buffer_length is equal to or greater than +// input_buffer is a URB, and input_buffer_length is equal to or greater than // sizeof( URB ); the output_buffer is a buffer to receive data from or send data // to device. only the following urb fields can be accessed, others must be zeroed. // DEV_HANDLE endp_handle; // UCHAR setup_packet[8]; // for control pipe // the choosing of IOCTL_SUBMIT_URB_RD or IOCTL_SUBMIT_URB_WR should be determined -// by the current URB, for example, a request string from device will use XXX_RD, +// by the current URB, for example, a request string from device will use XXX_RD, // and a write to the bulk endpoint will use XXX_WR // if the major_function is IRP_MJ_INTERNAL_DEVICE_CONTROL -// input_buffer is a URB, and input_buffer_length is equal to or greater than -// sizeof( URB ); +// input_buffer is a URB, and input_buffer_length is equal to or greater than +// sizeof( URB ); // only the following urb fields can be accessed, others must be zeroed. // DEV_HANDLE endp_handle; // UCHAR setup_packet[8]; // for control pipe, or zeroed @@ -600,7 +600,7 @@ typedef LONG USBD_STATUS; // ULONG data_length; // buffer size in bytes #define IOCTL_SUBMIT_URB_NOIO CTL_CODE( FILE_HCD_DEV_TYPE, 4098, METHOD_BUFFERED, FILE_ANY_ACCESS ) -// input_buffer is a URB, and input_buffer_length is equal to or greater than +// input_buffer is a URB, and input_buffer_length is equal to or greater than // sizeof( URB ); the output_buffer is null and no output_buffer_length, // only the following fields in urb can be accessed, others must be zeroed. // DEV_HANDLE endp_handle; @@ -623,7 +623,7 @@ typedef struct _ENUM_DEV_ELEMENT USHORT product_id; USHORT vendor_id; UCHAR dev_addr; - + } ENUM_DEV_ELEMENT, *PENUM_DEV_ELEMENT; typedef struct _ENUM_DEV_ARRAY @@ -657,7 +657,7 @@ typedef struct _USB_STRING_DESCRIPTOR UCHAR bLength; UCHAR bDescriptorType; USHORT wData[1]; - + } USB_STRING_DESCRIPTOR, *PUSB_STRING_DESCRIPTOR; typedef struct _USB_DESC_HEADER @@ -677,7 +677,7 @@ typedef struct _USB_ENDPOINT_DESC UCHAR bInterval; } USB_ENDPOINT_DESC, *PUSB_ENDPOINT_DESC; - + typedef struct _USB_INTERFACE_DESC { UCHAR bLength; @@ -721,7 +721,7 @@ typedef struct _USB_DEVICE_DESC UCHAR iProduct; UCHAR iSerialNumber; UCHAR bNumConfigurations; - + } USB_DEVICE_DESC, *PUSB_DEVICE_DESC; @@ -742,7 +742,7 @@ typedef struct _USB_DEVICE_DESC typedef struct _SPLIT_ISO_BUS_TIME { USHORT bus_time; - USHORT start_uframe; + USHORT start_uframe; } SPLIT_ISO_BUS_TIME, *PSPLIT_ISO_BUS_TIME; @@ -790,9 +790,9 @@ typedef struct _URB_HS_PIPE_CONTENT ULONG max_packet_size : 4; // bit 20-23 log( max_packet_size ) ULONG interval : 4; // bit 24-27 the same definition in USB2.0, for high or full/low speed ULONG start_uframe : 3; // bit 28-30 - ULONG reserved1 : 1; // + ULONG reserved1 : 1; // -} URB_HS_PIPE_CONTENT, *PURB_HS_PIPE_CONTENT; +} URB_HS_PIPE_CONTENT, *PURB_HS_PIPE_CONTENT; typedef struct _URB_HS_CONTEXT_CONTENT { @@ -814,7 +814,7 @@ typedef struct _URB //and max packet length is encoded in 3 bits from 23-21 //that means 2^(x) bytes in the packet. ULONG pipe; // bit0-1: endp type, bit 6: ls or fs. bit 7: dir - + union { UCHAR setup_packet[8]; // for control @@ -856,7 +856,7 @@ typedef struct _URB UCHAR ctrl_reserved; // send it down with ctrl_stack_count zero, that means the stack is not initialized, // and can be initialized by receiver to 1 and only 1. // If the initializer found the stack size won't meet the number down the drivers, it must - // reallocate one urb with the required stack size. and store the previous urb in + // reallocate one urb with the required stack size. and store the previous urb in // ctrl_parent_urb } ctrl_req_context; }; @@ -872,7 +872,7 @@ typedef struct _URB ISO_PACKET_DESC iso_packet_desc[ 1 ]; //used to build up trasac_list for iso transfer and claim bandwidth CTRL_REQ_STACK ctrl_req_stack[ 1 ]; }; - + } URB, *PURB; @@ -1033,7 +1033,7 @@ PUCHAR* pdesc_BUF BOOLEAN usb_skip_one_config( PUCHAR* pconfig_desc_BUF -); +); VOID usb_wait_ms_dpc( @@ -1047,14 +1047,14 @@ ULONG us BOOLEAN usb_query_clicks( -PLARGE_INTEGER clicks +PLARGE_INTEGER clicks ); VOID usb_cal_cpu_freq(); NTSTATUS -usb_reset_pipe_ex( +usb_reset_pipe_ex( struct _USB_DEV_MANAGER *dev_mgr, DEV_HANDLE endp_handle, PURBCOMPLETION reset_completion, diff --git a/reactos/drivers/usb/usbd/test.c b/reactos/drivers/usb/usbd/test.c index 8f9bea1fd7f..6bb1ea53b02 100644 --- a/reactos/drivers/usb/usbd/test.c +++ b/reactos/drivers/usb/usbd/test.c @@ -14,8 +14,8 @@ int main() USB_INTERFACE_DESCRIPTOR InterfaceDescriptor; USBD_GetInterfaceLengthTYPE USBD_GetInterfaceLength; - InterfaceDescriptor.bLength = 10; - InterfaceDescriptor.bNumEndpoints = 2; + InterfaceDescriptor.bLength = 10; + InterfaceDescriptor.bNumEndpoints = 2; InterfaceDescriptor.bDescriptorType = /*USB_INTERFACE_DESCRIPTOR_TYPE*/2; InterfaceDescriptor.iInterface = 0x1; @@ -30,4 +30,4 @@ int main() FreeLibrary(Lib); return 0; } - + diff --git a/reactos/drivers/usb/usbd/usbd.c b/reactos/drivers/usb/usbd/usbd.c index 547a1da22d7..1988a998206 100644 --- a/reactos/drivers/usb/usbd/usbd.c +++ b/reactos/drivers/usb/usbd/usbd.c @@ -120,7 +120,7 @@ USBD_CalculateUsbBandwidth( 0x0d /* UsbdPipeTypeInterrupt */ }; DWORD Result; - + if (OverheadTable[EndpointType] != 0) { Result = ((MaxPacketSize + OverheadTable[EndpointType]) * 8 * 7) / 6; @@ -235,7 +235,7 @@ USBD_CompleteRequest(DWORD Unknown1, DWORD Unknown2) */ VOID STDCALL USBD_RegisterHcFilter( - PDEVICE_OBJECT DeviceObject, + PDEVICE_OBJECT DeviceObject, PDEVICE_OBJECT FilterDeviceObject ) { @@ -325,14 +325,14 @@ USBD_CreateConfigurationRequestEx( /* Include the NULL entry */ ++InterfaceCount; - UrbSize = sizeof(Urb->UrbSelectConfiguration) + + UrbSize = sizeof(Urb->UrbSelectConfiguration) + (InterfaceCount * sizeof(PUSBD_INTERFACE_LIST_ENTRY)); Urb = ExAllocatePool(NonPagedPool, UrbSize); Urb->UrbSelectConfiguration.Hdr.Function = - URB_FUNCTION_SELECT_CONFIGURATION; + URB_FUNCTION_SELECT_CONFIGURATION; Urb->UrbSelectConfiguration.Hdr.Length = sizeof(Urb->UrbSelectConfiguration); - Urb->UrbSelectConfiguration.ConfigurationDescriptor = + Urb->UrbSelectConfiguration.ConfigurationDescriptor = ConfigurationDescriptor; memcpy((PVOID)&Urb->UrbSelectConfiguration.Interface, (PVOID)InterfaceList, InterfaceCount * sizeof(PUSBD_INTERFACE_LIST_ENTRY)); @@ -455,8 +455,8 @@ USBD_ParseConfigurationDescriptorEx( if (UsbInterfaceDesc->bLength == 0) break; UsbInterfaceDesc = UsbInterfaceDesc + UsbInterfaceDesc->bLength; - } - return NULL; + } + return NULL; } /* diff --git a/reactos/drivers/usb/usbhub/createclose.c b/reactos/drivers/usb/usbhub/createclose.c index 7001f24aad7..db66df47b04 100644 --- a/reactos/drivers/usb/usbhub/createclose.c +++ b/reactos/drivers/usb/usbhub/createclose.c @@ -16,7 +16,7 @@ UsbhubCreate( IN PIRP Irp) { DPRINT("Usbhub: IRP_MJ_CREATE\n"); - + Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -29,7 +29,7 @@ UsbhubClose( IN PIRP Irp) { DPRINT("Usbhub: IRP_MJ_CLOSE\n"); - + Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -42,7 +42,7 @@ UsbhubCleanup( IN PIRP Irp) { DPRINT("Usbhub: IRP_MJ_CLEANUP\n"); - + Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); diff --git a/reactos/drivers/usb/usbhub/fdo.c b/reactos/drivers/usb/usbhub/fdo.c index 786bba498a1..1bdb54d9a0f 100644 --- a/reactos/drivers/usb/usbhub/fdo.c +++ b/reactos/drivers/usb/usbhub/fdo.c @@ -61,10 +61,10 @@ UsbhubFdoQueryBusRelations( ULONG NeededSize; NTSTATUS Status; CHAR Buffer[3][40]; - + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; dev = DeviceExtension->dev; - + /* Create PDOs that are missing */ for (i = 0; i < dev->maxchild; i++) { @@ -93,23 +93,23 @@ UsbhubFdoQueryBusRelations( DPRINT("Usbhub: IoCreateDevice() failed with status 0x%08lx\n", Status); return Status; } - + Pdo = DeviceExtension->Children[i]; Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; - + PdoExtension = Pdo->DeviceExtension; RtlZeroMemory(PdoExtension, sizeof(HUB_DEVICE_EXTENSION)); - + PdoExtension->IsFDO = FALSE; PdoExtension->dev = dev->children[i]; - + sprintf(Buffer[0], "%lu", i); Status = UsbhubInitMultiSzString( &PdoExtension->InstanceId, Buffer[0], NULL); if (!NT_SUCCESS(Status)) goto ByeBye; - + DPRINT1("child #%lu: USB\\Vid_%04x&Pid_%04x&Rev_%04x\n", i, PdoExtension->dev->descriptor.idVendor, @@ -127,13 +127,13 @@ UsbhubFdoQueryBusRelations( Buffer[0], Buffer[1], NULL); if (!NT_SUCCESS(Status)) goto ByeBye; - + Status = UsbhubInitMultiSzString( &PdoExtension->DeviceId, Buffer[1], NULL); if (!NT_SUCCESS(Status)) goto ByeBye; - + if (PdoExtension->dev->actconfig->desc.bNumInterfaces == 1) { /* Single-interface USB device */ @@ -184,13 +184,13 @@ UsbhubFdoQueryBusRelations( &PdoExtension->CompatibleIds, Buffer[0], Buffer[1], Buffer[2], "USB\\COMPOSITE", NULL); } - + if (!NT_SUCCESS(Status)) goto ByeBye; - + Pdo->Flags &= ~DO_DEVICE_INITIALIZING; } - + /* Fill returned structure */ NeededSize = sizeof(DEVICE_RELATIONS); if (Children > 1) @@ -211,7 +211,7 @@ UsbhubFdoQueryBusRelations( } } ASSERT(Children == DeviceRelations->Count); - + *pDeviceRelations = DeviceRelations; return STATUS_SUCCESS; @@ -233,7 +233,7 @@ UsbhubPnpFdo( NTSTATUS Status; ULONG MinorFunction; ULONG_PTR Information = 0; - + IrpSp = IoGetCurrentIrpStackLocation(Irp); MinorFunction = IrpSp->MinorFunction; @@ -335,7 +335,7 @@ UsbhubDeviceControlFdo( PUSB_NODE_CONNECTION_NAME ConnectionName; DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; ConnectionName = (PUSB_NODE_CONNECTION_NAME)BufferOut; - + DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME\n"); if (LengthOut < sizeof(USB_NODE_CONNECTION_NAME)) Status = STATUS_BUFFER_TOO_SMALL; @@ -383,7 +383,7 @@ UsbhubDeviceControlFdo( ULONG NumberOfOpenPipes = 0; ULONG SizeOfOpenPipesArray; ConnectionInformation = (PUSB_NODE_CONNECTION_INFORMATION)BufferOut; - + DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_INFORMATION\n"); if (LengthOut < sizeof(USB_NODE_CONNECTION_INFORMATION)) Status = STATUS_BUFFER_TOO_SMALL; @@ -417,7 +417,7 @@ UsbhubDeviceControlFdo( ConnectionInformation->DeviceIsHub = dev->descriptor.bDeviceClass == USB_CLASS_HUB; ConnectionInformation->DeviceAddress = dev->devnum; ConnectionInformation->ConnectionStatus = DeviceConnected; - + for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) for (j = 0; j < dev->actconfig->interface[i].num_altsetting; j++) for (k = 0; k < dev->actconfig->interface[i].altsetting[j].desc.bNumEndpoints; k++) @@ -435,7 +435,7 @@ UsbhubDeviceControlFdo( NumberOfOpenPipes++; } ConnectionInformation->NumberOfOpenPipes = NumberOfOpenPipes; - + Information = sizeof(USB_NODE_CONNECTION_INFORMATION); if (NumberOfOpenPipes <= SizeOfOpenPipesArray) Status = STATUS_SUCCESS; diff --git a/reactos/drivers/usb/usbhub/pdo.c b/reactos/drivers/usb/usbhub/pdo.c index 60b5c2b96c1..4f9633c4843 100644 --- a/reactos/drivers/usb/usbhub/pdo.c +++ b/reactos/drivers/usb/usbhub/pdo.c @@ -21,18 +21,18 @@ UsbhubInternalDeviceControlPdo( PIO_STACK_LOCATION Stack; ULONG_PTR Information = 0; NTSTATUS Status; - + DPRINT("Usbhub: UsbhubInternalDeviceControlPdo() called\n"); - + Stack = IoGetCurrentIrpStackLocation(Irp); Status = Irp->IoStatus.Status; - + switch (Stack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO: { PHUB_DEVICE_EXTENSION DeviceExtension; - + DPRINT("Usbhub: IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO\n"); if (Irp->AssociatedIrp.SystemBuffer == NULL || Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PVOID)) @@ -43,7 +43,7 @@ UsbhubInternalDeviceControlPdo( { PVOID* pHubPointer; DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - + pHubPointer = (PVOID*)Irp->AssociatedIrp.SystemBuffer; *pHubPointer = DeviceExtension->dev; Information = sizeof(PVOID); @@ -58,7 +58,7 @@ UsbhubInternalDeviceControlPdo( Status = Irp->IoStatus.Status; } } - + Irp->IoStatus.Information = Information; Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -72,9 +72,9 @@ UsbhubPdoStartDevice( { PHUB_DEVICE_EXTENSION DeviceExtension; NTSTATUS Status; - + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - + /* Register and activate device interface */ Status = IoRegisterDeviceInterface( DeviceObject, @@ -88,14 +88,14 @@ UsbhubPdoStartDevice( DPRINT("Usbhub: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status); return Status; } - + Status = IoSetDeviceInterfaceState(&DeviceExtension->SymbolicLinkName, TRUE); if (!NT_SUCCESS(Status)) { DPRINT("Usbhub: IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status); return Status; } - + return STATUS_SUCCESS; } @@ -110,11 +110,11 @@ UsbhubPdoQueryId( PUNICODE_STRING SourceString; UNICODE_STRING String; NTSTATUS Status; - + IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType; DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; RtlInitUnicodeString(&String, NULL); - + switch (IdType) { case BusQueryDeviceID: @@ -145,7 +145,7 @@ UsbhubPdoQueryId( DPRINT1("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType); return STATUS_NOT_SUPPORTED; } - + Status = UsbhubDuplicateUnicodeString( &String, SourceString, @@ -182,7 +182,7 @@ UsbhubPdoQueryDeviceText( DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n"); else DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation\n"); - + if (!DeviceExtension->dev->descriptor.iProduct) return STATUS_NOT_SUPPORTED; @@ -235,7 +235,7 @@ UsbhubPnpPdo( PIO_STACK_LOCATION Stack; ULONG_PTR Information = 0; NTSTATUS Status; - + Stack = IoGetCurrentIrpStackLocation(Irp); MinorFunction = Stack->MinorFunction; diff --git a/reactos/drivers/usb/usbhub/usbhub.c b/reactos/drivers/usb/usbhub/usbhub.c index 2b86dfe0bca..4e51002b438 100644 --- a/reactos/drivers/usb/usbhub/usbhub.c +++ b/reactos/drivers/usb/usbhub/usbhub.c @@ -35,9 +35,9 @@ GetRootHubPointer( PIRP Irp; IO_STATUS_BLOCK IoStatus; NTSTATUS Status; - + KeInitializeEvent (&Event, NotificationEvent, FALSE); - + Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO, Pdo, NULL, sizeof(NULL), @@ -50,25 +50,25 @@ GetRootHubPointer( DPRINT("Usbhub: IoBuildDeviceIoControlRequest() failed\n"); return STATUS_INSUFFICIENT_RESOURCES; } - + /* Initialize the status block before sending the IRP */ IoGetNextIrpStackLocation(Irp)->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; IoStatus.Status = STATUS_NOT_SUPPORTED; IoStatus.Information = 0; - + Status = IoCallDriver(Pdo, Irp); - + if (Status == STATUS_PENDING) { DPRINT("Usbhub: Operation pending\n"); KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); Status = IoStatus.Status; } - + return Status; } -NTSTATUS STDCALL +NTSTATUS STDCALL UsbhubAddDevice( IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo) @@ -76,7 +76,7 @@ UsbhubAddDevice( PDEVICE_OBJECT Fdo; PHUB_DEVICE_EXTENSION DeviceExtension; NTSTATUS Status; - + Status = IoCreateDevice(DriverObject, sizeof(HUB_DEVICE_EXTENSION), NULL, /* DeviceName */ @@ -89,11 +89,11 @@ UsbhubAddDevice( DPRINT1("Usbhub: IoCreateDevice() failed with status 0x%08lx\n", Status); return Status; } - + // zerofill device extension DeviceExtension = (PHUB_DEVICE_EXTENSION)Fdo->DeviceExtension; RtlZeroMemory(DeviceExtension, sizeof(HUB_DEVICE_EXTENSION)); - + /* Get a pointer to the linux structure created by the USB controller, * by sending IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO to lower device. */ @@ -105,7 +105,7 @@ UsbhubAddDevice( return Status; } DeviceExtension->dev->dev.dev_ext = Pdo; - + DeviceExtension->IsFDO = TRUE; Fdo->Flags |= DO_POWER_PAGABLE; Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice); @@ -117,7 +117,7 @@ UsbhubAddDevice( } Fdo->Flags |= DO_BUFFERED_IO; Fdo->Flags &= ~DO_DEVICE_INITIALIZING; - + return STATUS_SUCCESS; } @@ -190,19 +190,19 @@ DriverEntry( IN PUNICODE_STRING RegistryPath) { ULONG i; - + DriverObject->DriverExtension->AddDevice = UsbhubAddDevice; - + for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) DriverObject->MajorFunction[i] = IrpStub; - + DriverObject->MajorFunction[IRP_MJ_CREATE] = UsbhubCreate; DriverObject->MajorFunction[IRP_MJ_CLOSE] = UsbhubClose; DriverObject->MajorFunction[IRP_MJ_CLEANUP] = UsbhubCleanup; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl; DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = DispatchInternalDeviceControl; DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp; - + return STATUS_SUCCESS; } diff --git a/reactos/drivers/usb/usbhub/usbhub.h b/reactos/drivers/usb/usbhub/usbhub.h index 763c06cdd02..deaa1d0293c 100644 --- a/reactos/drivers/usb/usbhub/usbhub.h +++ b/reactos/drivers/usb/usbhub/usbhub.h @@ -15,7 +15,7 @@ typedef struct _HUB_DEVICE_EXTENSION PDEVICE_OBJECT LowerDevice; PDEVICE_OBJECT Children[USB_MAXCHILDREN]; - + /* Fields valid only when IsFDO == FALSE */ UNICODE_STRING DeviceId; // REG_SZ UNICODE_STRING InstanceId; // REG_SZ diff --git a/reactos/drivers/usb/usbstor/usbstor.h b/reactos/drivers/usb/usbstor/usbstor.h index fe4bf32bf26..6d5ff55a115 100644 --- a/reactos/drivers/usb/usbstor/usbstor.h +++ b/reactos/drivers/usb/usbstor/usbstor.h @@ -20,7 +20,7 @@ typedef struct _USBSTOR_DEVICE_EXTENSION PDEVICE_OBJECT LowerDevice; PDEVICE_OBJECT Children[USB_MAXCHILDREN]; - + /* Fields valid only when IsFDO == FALSE */ UNICODE_STRING DeviceDescription; // REG_SZ UNICODE_STRING DeviceId; // REG_SZ diff --git a/reactos/drivers/video/displays/framebuf/dd.c b/reactos/drivers/video/displays/framebuf/dd.c index e9f8d9843c4..3d29218989f 100644 --- a/reactos/drivers/video/displays/framebuf/dd.c +++ b/reactos/drivers/video/displays/framebuf/dd.c @@ -23,16 +23,16 @@ #include "framebuf.h" -DWORD CALLBACK +DWORD CALLBACK DdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd) { - + /* We do not support 3d buffer so we fail here */ - if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && + if ((pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER) && (pccsd->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) { pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - return DDHAL_DRIVER_HANDLED; + return DDHAL_DRIVER_HANDLED; } @@ -41,11 +41,11 @@ DdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd) { /* check the fourcc diffent FOURCC, but we only support BMP for now */ //if(pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFlags & DDPF_FOURCC) - //{ + //{ // /* We do not support other pixel format */ // switch (pccsd->lpDDSurfaceDesc->ddpfPixelFormat.dwFourCC) - // { - // default: + // { + // default: // pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; // return DDHAL_DRIVER_HANDLED; // } @@ -55,7 +55,7 @@ DdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd) //{ // /* We do not support texture surface */ // pccsd->ddRVal = DDERR_INVALIDPIXELFORMAT; - // return DDHAL_DRIVER_HANDLED; + // return DDHAL_DRIVER_HANDLED; //} /* Fail */ @@ -63,53 +63,53 @@ DdCanCreateSurface(LPDDHAL_CANCREATESURFACEDATA pccsd) return DDHAL_DRIVER_HANDLED; } - pccsd->ddRVal = DD_OK; + pccsd->ddRVal = DD_OK; return DDHAL_DRIVER_HANDLED; } -DWORD CALLBACK +DWORD CALLBACK DdCreateSurface(PDD_CREATESURFACEDATA pcsd) { int i; - + if (pcsd->dwSCnt < 1) { pcsd->ddRVal = DDERR_GENERIC; return DDHAL_DRIVER_NOTHANDLED; } - + for (i=0; i<(int)pcsd->dwSCnt; i++) - { - pcsd->lplpSList[i]->lpGbl->lPitch = (DWORD)(pcsd->lplpSList[i]->lpGbl->wWidth * + { + pcsd->lplpSList[i]->lpGbl->lPitch = (DWORD)(pcsd->lplpSList[i]->lpGbl->wWidth * (pcsd->lplpSList[i]->lpGbl->ddpfSurface.dwRGBBitCount / 8)); - - pcsd->lplpSList[i]->lpGbl->dwBlockSizeX = pcsd->lplpSList[i]->lpGbl->lPitch * + + pcsd->lplpSList[i]->lpGbl->dwBlockSizeX = pcsd->lplpSList[i]->lpGbl->lPitch * (DWORD)(pcsd->lplpSList[i]->lpGbl->wHeight); pcsd->lplpSList[i]->lpGbl->dwBlockSizeY = 1; - + if ( pcsd->lplpSList[i] ->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) { - /* We maybe should alloc it with EngAlloc - for now we trusting ddraw alloc it */ + /* We maybe should alloc it with EngAlloc + for now we trusting ddraw alloc it */ pcsd->lplpSList[i]->lpGbl->fpVidMem = 0; } else { - - /* We maybe should alloc it with EngAlloc - for now we trusting ddraw alloc it */ + + /* We maybe should alloc it with EngAlloc + for now we trusting ddraw alloc it */ pcsd->lplpSList[i]->lpGbl->fpVidMem = DDHAL_PLEASEALLOC_BLOCKSIZE; } pcsd->lpDDSurfaceDesc->lPitch = pcsd->lplpSList[i]->lpGbl->lPitch; pcsd->lpDDSurfaceDesc->dwFlags |= DDSD_PITCH; - + } // for i - + pcsd->ddRVal = DD_OK; return DDHAL_DRIVER_HANDLED; } diff --git a/reactos/drivers/video/displays/framebuf/ddenable.c b/reactos/drivers/video/displays/framebuf/ddenable.c index 2c30ba07bef..b88c27b0c29 100644 --- a/reactos/drivers/video/displays/framebuf/ddenable.c +++ b/reactos/drivers/video/displays/framebuf/ddenable.c @@ -25,7 +25,7 @@ DrvDisableDirectDraw( IN DHPDEV dhpdev) { PPDEV ppdev = (PPDEV)dhpdev; ppdev->bDDInitialized = FALSE; - /* Add Clean up code here if we need it + /* Add Clean up code here if we need it when we shout down directx interface */ } @@ -35,15 +35,15 @@ DrvEnableDirectDraw( OUT DD_CALLBACKS *pCallBacks, OUT DD_SURFACECALLBACKS *pSurfaceCallBacks, OUT DD_PALETTECALLBACKS *pPaletteCallBacks) -{ +{ PPDEV ppdev = (PPDEV)dhpdev; - + if (ppdev->bDDInitialized == TRUE) { return TRUE; } - /* Setup pixel format */ + /* Setup pixel format */ ppdev->ddpfDisplay.dwSize = sizeof( DDPIXELFORMAT ); ppdev->ddpfDisplay.dwFourCC = 0; @@ -59,11 +59,11 @@ DrvEnableDirectDraw( switch(ppdev->iDitherFormat) { - case BMF_8BPP: + case BMF_8BPP: ppdev->ddpfDisplay.dwFlags |= DDPF_PALETTEINDEXED8; break; - - case BMF_16BPP: + + case BMF_16BPP: switch(ppdev->RedMask) { case 0x7C00: @@ -72,14 +72,14 @@ DrvEnableDirectDraw( default: break; - } + } break; - case BMF_24BPP: + case BMF_24BPP: break; case BMF_32BPP: - ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0xff000000; + ppdev->ddpfDisplay.dwRGBAlphaBitMask = 0xff000000; break; default: @@ -87,14 +87,14 @@ DrvEnableDirectDraw( ppdev->ddpfDisplay.dwRGBBitCount=0; break; } - + if (pCallBacks !=NULL) { memset(pCallBacks,0,sizeof(DD_CALLBACKS)); - /* FILL pCallBacks with hal stuff */ - pCallBacks->dwSize = sizeof(DDHAL_DDCALLBACKS); - pCallBacks->CanCreateSurface = (PDD_CANCREATESURFACE)DdCanCreateSurface; + /* FILL pCallBacks with hal stuff */ + pCallBacks->dwSize = sizeof(DDHAL_DDCALLBACKS); + pCallBacks->CanCreateSurface = (PDD_CANCREATESURFACE)DdCanCreateSurface; pCallBacks->CreateSurface = (PDD_CREATESURFACE)DdCreateSurface; /* Fill in the HAL Callback flags */ @@ -105,10 +105,10 @@ DrvEnableDirectDraw( { memset(pSurfaceCallBacks,0,sizeof(DD_SURFACECALLBACKS)); - /* FILL pSurfaceCallBacks with hal stuff */ + /* FILL pSurfaceCallBacks with hal stuff */ // pSurfaceCallBacks.dwSize = sizeof(DDHAL_DDSURFACECALLBACKS); - // pSurfaceCallBacks.DestroySurface = DdDestroySurface; - // pSurfaceCallBacks.Lock = DdLock; + // pSurfaceCallBacks.DestroySurface = DdDestroySurface; + // pSurfaceCallBacks.Lock = DdLock; // pSurfaceCallBacks.Blt = DdBlt; // pSurfaceCallBacks->dwFlags = DDHAL_SURFCB32_DESTROYSURFACE | DDHAL_SURFCB32_LOCK | DDHAL_SURFCB32_BLT ; @@ -120,7 +120,7 @@ DrvEnableDirectDraw( /* FILL pPaletteCallBacks with hal stuff */ /* We will not support this callback in the framebuf.dll */ } - + /* Fixme fill the ppdev->dxHalInfo with the info we need */ ppdev->bDDInitialized = TRUE; @@ -135,17 +135,17 @@ DrvGetDirectDrawInfo( OUT VIDEOMEMORY *pvmList, OUT DWORD *pdwNumFourCCCodes, OUT DWORD *pdwFourCC) -{ +{ PPDEV ppdev = (PPDEV)dhpdev; LONG i; DWORD heap = 1; /* we always alloc one heap */ BOOL bDDrawHeap = FALSE; - + if (ppdev == NULL) return FALSE; - /* check so pHalInfo, pdwNumHeaps, pdwNumFourCCCodes is not NULL - pdwFourCC and pvmList can be null + /* check so pHalInfo, pdwNumHeaps, pdwNumFourCCCodes is not NULL + pdwFourCC and pvmList can be null */ if (pHalInfo == NULL) @@ -153,42 +153,42 @@ DrvGetDirectDrawInfo( if (pdwNumHeaps == NULL) return FALSE; - + if (pdwNumFourCCCodes == NULL) return FALSE; - - /* Setup heap */ + + /* Setup heap */ if ( (ppdev->ScreenWidth < ppdev->MemWidth) || (ppdev->ScreenHeight < ppdev->MemHeight)) - { + { bDDrawHeap = TRUE; heap++; } - + ppdev->dwHeap = heap; *pdwNumHeaps = heap; - /* We do not support other fourcc */ + /* We do not support other fourcc */ *pdwNumFourCCCodes = 0; - - /* - check see if pvmList and pdwFourCC are frist call - or frist. Secon call we fill in pHalInfo info + + /* + check see if pvmList and pdwFourCC are frist call + or frist. Secon call we fill in pHalInfo info */ - if(!(pvmList && pdwFourCC)) - { + if(!(pvmList && pdwFourCC)) + { RtlZeroMemory(pHalInfo, sizeof(DD_HALINFO)); pHalInfo->dwSize = sizeof(DD_HALINFO); - pHalInfo->ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTQUEUE | DDCAPS_BLTCOLORFILL | DDCAPS_READSCANLINE | + pHalInfo->ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTQUEUE | DDCAPS_BLTCOLORFILL | DDCAPS_READSCANLINE | DDCAPS_BLTSTRETCH | DDCAPS_COLORKEY | DDCAPS_CANBLTSYSMEM; - pHalInfo->ddCaps.dwFXCaps = DDFXCAPS_BLTSTRETCHY | DDFXCAPS_BLTSTRETCHX | - DDFXCAPS_BLTSTRETCHYN | DDFXCAPS_BLTSTRETCHXN | + pHalInfo->ddCaps.dwFXCaps = DDFXCAPS_BLTSTRETCHY | DDFXCAPS_BLTSTRETCHX | + DDFXCAPS_BLTSTRETCHYN | DDFXCAPS_BLTSTRETCHXN | DDFXCAPS_BLTSHRINKY | DDFXCAPS_BLTSHRINKX | - DDFXCAPS_BLTSHRINKYN | DDFXCAPS_BLTSHRINKXN | + DDFXCAPS_BLTSHRINKYN | DDFXCAPS_BLTSHRINKXN | DDFXCAPS_BLTMIRRORUPDOWN | DDFXCAPS_BLTMIRRORLEFTRIGHT; pHalInfo->ddCaps.dwCaps2 = DDCAPS2_NONLOCALVIDMEM | DDCAPS2_NONLOCALVIDMEMCAPS; @@ -196,7 +196,7 @@ DrvGetDirectDrawInfo( pHalInfo->ddCaps.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP; pHalInfo->ddCaps.dwCKeyCaps = DDCKEYCAPS_SRCBLT | DDCKEYCAPS_SRCBLTCLRSPACE; - + pHalInfo->ddCaps.dwSVBCaps = DDCAPS_BLT; pHalInfo->ddCaps.ddsCaps.dwCaps |= DDSCAPS_LOCALVIDMEM | DDSCAPS_NONLOCALVIDMEM; @@ -204,7 +204,7 @@ DrvGetDirectDrawInfo( pHalInfo->ddCaps.dwVidMemTotal = (ppdev->MemHeight - ppdev->ScreenHeight) * ppdev->ScreenDelta; /* fill in some basic info that we need */ - pHalInfo->vmiData.pvPrimary = ppdev->ScreenPtr; + pHalInfo->vmiData.pvPrimary = ppdev->ScreenPtr; pHalInfo->vmiData.dwDisplayWidth = ppdev->ScreenWidth; pHalInfo->vmiData.dwDisplayHeight = ppdev->ScreenHeight; pHalInfo->vmiData.lDisplayPitch = ppdev->ScreenDelta; @@ -213,17 +213,17 @@ DrvGetDirectDrawInfo( pHalInfo->vmiData.ddpfDisplay.dwRGBBitCount = ppdev->BitsPerPixel; pHalInfo->vmiData.ddpfDisplay.dwRBitMask = ppdev->RedMask; pHalInfo->vmiData.ddpfDisplay.dwGBitMask = ppdev->GreenMask; - pHalInfo->vmiData.ddpfDisplay.dwBBitMask = ppdev->BlueMask; - pHalInfo->vmiData.dwOffscreenAlign = 4; + pHalInfo->vmiData.ddpfDisplay.dwBBitMask = ppdev->BlueMask; + pHalInfo->vmiData.dwOffscreenAlign = 4; - if ( ppdev->BitsPerPixel == 8 ) - { - pHalInfo->vmiData.ddpfDisplay.dwFlags |= DDPF_PALETTEINDEXED8; - } + if ( ppdev->BitsPerPixel == 8 ) + { + pHalInfo->vmiData.ddpfDisplay.dwFlags |= DDPF_PALETTEINDEXED8; + } - /* FIXME + /* FIXME Config the rops we do not doing that yet - for we need write the rops table + for we need write the rops table */ for(i=0;ipvmList = pvmList; @@ -241,7 +241,7 @@ DrvGetDirectDrawInfo( { pvmList->dwFlags = VIDMEM_ISLINEAR ; pvmList->fpStart = ppdev->ScreenHeight * ppdev->ScreenDelta; - pvmList->fpEnd = ppdev->MemHeight * ppdev->ScreenDelta - 1; + pvmList->fpEnd = ppdev->MemHeight * ppdev->ScreenDelta - 1; pvmList->ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; pvmList++; } @@ -250,7 +250,7 @@ DrvGetDirectDrawInfo( pvmList->fpEnd = (ppdev->MemHeight * ppdev->ScreenDelta) - 1; pvmList->dwFlags = VIDMEM_ISNONLOCAL | VIDMEM_ISLINEAR | VIDMEM_ISWC; pvmList->ddsCaps.dwCaps = DDSCAPS_FRONTBUFFER | DDSCAPS_BACKBUFFER ; - pvmList->ddsCapsAlt.dwCaps = DDSCAPS_FRONTBUFFER | DDSCAPS_BACKBUFFER; + pvmList->ddsCapsAlt.dwCaps = DDSCAPS_FRONTBUFFER | DDSCAPS_BACKBUFFER; pvmList = ppdev->pvmList; } diff --git a/reactos/drivers/video/displays/framebuf/enable.c b/reactos/drivers/video/displays/framebuf/enable.c index 5fa85af3acd..d989576f7cd 100644 --- a/reactos/drivers/video/displays/framebuf/enable.c +++ b/reactos/drivers/video/displays/framebuf/enable.c @@ -32,7 +32,7 @@ static DRVFN DrvFunctionTable[] = {INDEX_DrvSetPalette, (PFN)DrvSetPalette}, {INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape}, {INDEX_DrvMovePointer, (PFN)DrvMovePointer} - + }; /* diff --git a/reactos/drivers/video/displays/framebuf/framebuf.h b/reactos/drivers/video/displays/framebuf/framebuf.h index fae7318c4dc..189710eee4e 100644 --- a/reactos/drivers/video/displays/framebuf/framebuf.h +++ b/reactos/drivers/video/displays/framebuf/framebuf.h @@ -52,7 +52,7 @@ typedef struct _PDEV PVOID ScreenPtr; HPALETTE DefaultPalette; PALETTEENTRY *PaletteEntries; - + #ifdef EXPERIMENTAL_MOUSE_CURSOR_SUPPORT VIDEO_POINTER_ATTRIBUTES PointerAttributes; XLATEOBJ *PointerXlateObject; @@ -62,14 +62,14 @@ typedef struct _PDEV POINTL PointerHotSpot; #endif - /* DirectX Support */ + /* DirectX Support */ DWORD iDitherFormat; ULONG MemHeight; ULONG MemWidth; DWORD dwHeap; - VIDEOMEMORY* pvmList; - BOOL bDDInitialized; - DDPIXELFORMAT ddpfDisplay; + VIDEOMEMORY* pvmList; + BOOL bDDInitialized; + DDPIXELFORMAT ddpfDisplay; } PDEV, *PPDEV; #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) diff --git a/reactos/drivers/video/miniport/vbe/vbemp.c b/reactos/drivers/video/miniport/vbe/vbemp.c index af321fcebd3..a207c3eb2ba 100644 --- a/reactos/drivers/video/miniport/vbe/vbemp.c +++ b/reactos/drivers/video/miniport/vbe/vbemp.c @@ -245,7 +245,7 @@ VBEInitialize(PVOID HwDeviceExtension) VideoPortDebugPrint(Warn, "No VBE BIOS present\n"); return FALSE; } - + VideoPortDebugPrint(Trace, "VBE BIOS Present (%d.%d, %8ld Kb)\n", VBEDeviceExtension->VbeInfo.Version / 0x100, VBEDeviceExtension->VbeInfo.Version & 0xFF, @@ -359,7 +359,7 @@ VBEInitialize(PVOID HwDeviceExtension) } #ifdef VBE12_SUPPORT else - { + { VBEDeviceExtension->ModeNumbers[SuitableModeCount] = ModeTemp; SuitableModeCount++; } @@ -887,7 +887,7 @@ VBEQueryMode( ULONG VideoModeId) { PVBE_MODEINFO VBEMode = &DeviceExtension->ModeInfo[VideoModeId]; - + VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION); VideoMode->ModeIndex = VideoModeId; VideoMode->VisScreenWidth = VBEMode->XResolution; diff --git a/reactos/drivers/video/videoprt/agp.c b/reactos/drivers/video/videoprt/agp.c index e2c51ff7682..89a875b7dc0 100644 --- a/reactos/drivers/video/videoprt/agp.c +++ b/reactos/drivers/video/videoprt/agp.c @@ -166,7 +166,7 @@ IntAgpReleasePhysical( DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); AgpBusInterface = &DeviceExtension->AgpInterface; AgpMapping = (PVIDEO_PORT_AGP_MAPPING)PhysicalContext; - + /* Release memory */ Status = AgpBusInterface->ReleaseMemory(AgpBusInterface->AgpContext, AgpMapping->MapHandle); @@ -175,7 +175,7 @@ IntAgpReleasePhysical( DPRINT1("Warning: AgpBusInterface->ReleaseMemory failed (Status = 0x%x)\n", Status); } - + /* Free resources */ ExFreePool(AgpMapping); } @@ -243,7 +243,7 @@ IntAgpReservePhysical( *PhysicalContext = (PVOID)AgpMapping; return AgpMapping->PhysicalAddress; } - + PVOID NTAPI IntAgpCommitVirtual( @@ -294,7 +294,7 @@ IntAgpCommitVirtual( ASSERT(Size == Pages * PAGE_SIZE); ASSERT(BaseAddress == (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + OffsetInBytes)); - + /* Map the physical memory into the released virtual memory area */ Status = IntVideoPortMapPhysicalMemory(VirtualMapping->ProcessHandle, PhysicalAddress, @@ -392,7 +392,7 @@ IntAgpReleaseVirtual( DPRINT("AgpReleaseVirtual - VirtualContext: 0x%x\n", VirtualContext); VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext; - + /* Release the virtual memory */ if (VirtualMapping->ProcessHandle == NULL) { @@ -410,7 +410,7 @@ IntAgpReleaseVirtual( DPRINT1("Warning: ZwFreeVirtualMemory() failed: Status = 0x%x\n", Status); } } - + /* Free resources */ ExFreePool(VirtualMapping); } @@ -487,7 +487,7 @@ IntAgpSetRate( DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); AgpBusInterface = &DeviceExtension->AgpInterface; - + return NT_SUCCESS(AgpBusInterface->SetRate(AgpBusInterface->AgpContext, Rate)); } diff --git a/reactos/drivers/video/videoprt/dma.c b/reactos/drivers/video/videoprt/dma.c index 398dbddc4b6..c22535dad04 100644 --- a/reactos/drivers/video/videoprt/dma.c +++ b/reactos/drivers/video/videoprt/dma.c @@ -132,7 +132,7 @@ VideoPortFreeCommonBuffer( IN PVOID HwDeviceExtension, PVP_DMA_ADAPTER VpDmaAdapter; VpDmaAdapter = VideoPortGetDmaAdapter( - HwDeviceExtension, + HwDeviceExtension, (PVP_DEVICE_DESCRIPTION)&DeviceDescription); HalFreeCommonBuffer( diff --git a/reactos/drivers/video/videoprt/resource.c b/reactos/drivers/video/videoprt/resource.c index 2af3f260273..8d125994277 100644 --- a/reactos/drivers/video/videoprt/resource.c +++ b/reactos/drivers/video/videoprt/resource.c @@ -596,7 +596,7 @@ VideoPortVerifyAccessRanges( DPRINT("VideoPortVerifyAccessRanges\n"); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); - + /* Create the resource list */ ResourceListSize = sizeof(CM_RESOURCE_LIST) + (NumAccessRanges - 1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); @@ -606,7 +606,7 @@ VideoPortVerifyAccessRanges( DPRINT("ExAllocatePool() failed\n"); return ERROR_INVALID_PARAMETER; } - + /* Fill resource list */ ResourceList->Count = 1; ResourceList->List[0].InterfaceType = DeviceExtension->AdapterInterfaceType; @@ -639,7 +639,7 @@ VideoPortVerifyAccessRanges( if (AccessRanges->RangePassive & VIDEO_RANGE_10_BIT_DECODE) PartialDescriptor->Flags |= CM_RESOURCE_PORT_10_BIT_DECODE; } - + /* Try to acquire all resource ranges */ Status = IoReportResourceForDetection( DeviceExtension->DriverObject, @@ -648,7 +648,7 @@ VideoPortVerifyAccessRanges( ResourceList, ResourceListSize, &ConflictDetected); ExFreePool(ResourceList); - + if (!NT_SUCCESS(Status) || ConflictDetected) return ERROR_INVALID_PARAMETER; else diff --git a/reactos/drivers/video/videoprt/videoprt.c b/reactos/drivers/video/videoprt/videoprt.c index 3ffd215d398..6de68c576e4 100644 --- a/reactos/drivers/video/videoprt/videoprt.c +++ b/reactos/drivers/video/videoprt/videoprt.c @@ -662,7 +662,7 @@ VideoPortInitialize( } /* add no PNP bus here, add more bus type if it needed */ - + if ( (HwInitializationData->AdapterInterfaceType == InterfaceTypeUndefined) || (HwInitializationData->AdapterInterfaceType == Internal) ) diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp index 8d1c8b69c3f..8b137891791 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp @@ -1 +1 @@ - + diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp index 8d1c8b69c3f..8b137891791 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp @@ -1 +1 @@ - + diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp index 8d1c8b69c3f..8b137891791 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp @@ -1 +1 @@ - + diff --git a/reactos/drivers/wdm/audio/backpln/portcls/MiniportWavePci.cpp b/reactos/drivers/wdm/audio/backpln/portcls/MiniportWavePci.cpp index 8d1c8b69c3f..8b137891791 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/MiniportWavePci.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/MiniportWavePci.cpp @@ -1 +1 @@ - + diff --git a/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp b/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp index 8d1c8b69c3f..8b137891791 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp @@ -1 +1 @@ - + diff --git a/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp b/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp index 8d1c8b69c3f..8b137891791 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp @@ -1 +1 @@ - + diff --git a/reactos/drivers/wdm/audio/drivers/sb16/adapter.cpp b/reactos/drivers/wdm/audio/drivers/sb16/adapter.cpp index 5455b2e428e..3a4ea38f529 100644 --- a/reactos/drivers/wdm/audio/drivers/sb16/adapter.cpp +++ b/reactos/drivers/wdm/audio/drivers/sb16/adapter.cpp @@ -9,32 +9,32 @@ class CAdapterSB16 : DECLARE_STD_UNKNOWN(); DEFINE_STD_CONSTRUCTOR(CAdapterSB16); ~CAdapterSB16(); - + STDMETHODIMP_(NTSTATUS) Init( IN PRESOURCELIST ResourceList, IN PDEVICE_OBJECT DeviceObject); - + STDMETHODIMP_(PINTERRUPTSYNC) GetInterruptSync(void); - + STDMETHODIMP_(void) SetWaveMiniport( IN PWAVEMINIPORTSB16 Miniport); - + STDMETHODIMP_(BYTE) Read(void); - + STDMETHODIMP_(BOOLEAN) Write( IN BYTE Value); - + STDMETHODIMP_(NTSTATUS) Reset(void); - + STDMETHODIMP_(void) SetMixerValue( IN BYTE Index, IN BYTE Value); - + STDMETHODIMP_(BYTE) GetMixerValue( IN BYTE Index); - + STDMETHODIMP_(void) ResetMixer(void); - + //IMP_IAdapterPowerManagement; }; diff --git a/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c b/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c index c1956e86ad4..397724ccd79 100644 --- a/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c +++ b/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c @@ -29,7 +29,7 @@ NTSTATUS AudioAddDevice( /* What do we do?! */ /* RtlAssert("FAIL", __FILE__, __LINE__, "?" */ } - + return STATUS_SUCCESS; } diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index fbcb9301b92..8d09ee9981f 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -190,8 +190,8 @@ HalAssignSlotResources( } -BOOLEAN -NTAPI +BOOLEAN +NTAPI HalBeginSystemInterrupt (KIRQL Irql, ULONG Vector, PKIRQL OldIrql) @@ -443,7 +443,7 @@ HalReadDmaCounter( PADAPTER_OBJECT AdapterObject) { UNIMPLEMENTED; - + return 0; } diff --git a/reactos/hal/halppc/generic/display.c b/reactos/hal/halppc/generic/display.c index 4e0d8edd6b7..0baa1e78740 100644 --- a/reactos/hal/halppc/generic/display.c +++ b/reactos/hal/halppc/generic/display.c @@ -34,7 +34,7 @@ * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to + * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is @@ -54,7 +54,7 @@ * not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from the * XFree86 Project. -*/ +*/ /* DISPLAY OWNERSHIP * @@ -156,10 +156,10 @@ VOID FASTCALL HalClearDisplay (UCHAR CharAttribute) { ULONG i; - ULONG deviceSize = + ULONG deviceSize = PpcEarlybootInfo.dispDeviceRowBytes * PpcEarlybootInfo.dispDeviceRect[3]; - for(i = 0; i < deviceSize; i += sizeof(int) ) + for(i = 0; i < deviceSize; i += sizeof(int) ) SetPhys(GraphVideoBuffer + i, CharAttribute); CursorX = 0; @@ -172,24 +172,24 @@ HalClearDisplay (UCHAR CharAttribute) VOID STATIC HalScrollDisplay (VOID) { - ULONG i, deviceSize = + ULONG i, deviceSize = PpcEarlybootInfo.dispDeviceRowBytes * PpcEarlybootInfo.dispDeviceRect[3]; - ULONG Dest = (ULONG)GraphVideoBuffer, + ULONG Dest = (ULONG)GraphVideoBuffer, Src = (ULONG)(GraphVideoBuffer + (16 * PpcEarlybootInfo.dispDeviceRowBytes)); ULONG End = (ULONG) - GraphVideoBuffer + + GraphVideoBuffer + (PpcEarlybootInfo.dispDeviceRowBytes * (PpcEarlybootInfo.dispDeviceRect[3]-16)); - - while( Src < End ) + + while( Src < End ) { SetPhys((ULONG)Dest, GetPhys(Src)); Src += 4; Dest += 4; } /* Clear the bottom row */ - for(i = End; i < deviceSize; i += sizeof(int) ) + for(i = End; i < deviceSize; i += sizeof(int) ) SetPhys(GraphVideoBuffer + i, 1); } @@ -200,8 +200,8 @@ HalPutCharacter (CHAR Character) #if 0 int i,j,k; ULONG Dest = - (GraphVideoBuffer + - (16 * PpcEarlybootInfo.dispDeviceRowBytes * CursorY) + + (GraphVideoBuffer + + (16 * PpcEarlybootInfo.dispDeviceRowBytes * CursorY) + (8 * (PpcEarlybootInfo.dispDeviceDepth / 8) * CursorX)), RowDest; UCHAR ByteToPlace; @@ -270,7 +270,7 @@ HalReleaseDisplayOwnership(VOID) VOID STDCALL HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters) /* - * FUNCTION: + * FUNCTION: * ARGUMENTS: * ResetDisplayParameters = Pointer to a driver specific * reset routine. @@ -308,7 +308,7 @@ HalDisplayString(IN PCH String) //KiAcquireSpinLock(&Lock); _disable(); - + while (*pch != 0) { if (*pch == '\n') @@ -327,14 +327,14 @@ HalDisplayString(IN PCH String) { HalPutCharacter (*pch); CursorX++; - + if (CursorX >= SizeX) { CursorY++; CursorX = 0; } } - + if (CursorY >= SizeY) { HalScrollDisplay (); diff --git a/reactos/hal/halppc/generic/dma.c b/reactos/hal/halppc/generic/dma.c index f0d7f0a1000..57b6dfe80c6 100644 --- a/reactos/hal/halppc/generic/dma.c +++ b/reactos/hal/halppc/generic/dma.c @@ -134,7 +134,7 @@ HalpInitDma(VOID) * Check if Extended DMA is available. We're just going to do a random * read and write. */ - + WRITE_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2), 0x2A); if (READ_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2)) == 0x2A) HalpEisaDma = TRUE; @@ -193,7 +193,7 @@ HalpGetAdapterMaximumPhysicalAddress( * * Allocate initial, or additional, map buffers for DMA master adapter. * - * @param MasterAdapter + * @param MasterAdapter * DMA master adapter to allocate buffers for. * @param SizeOfMapBuffers * Size of the map buffers to allocate (not including the size @@ -228,7 +228,7 @@ HalpGrowMapBuffers( LowestAcceptableAddress.LowPart = HighestAcceptableAddress.LowPart == 0xFFFFFFFF ? 0x1000000 : 0; BoundryAddressMultiple.QuadPart = 0; - + VirtualAddress = MmAllocateContiguousMemorySpecifyCache( MapRegisterCount << PAGE_SHIFT, LowestAcceptableAddress, HighestAcceptableAddress, BoundryAddressMultiple, MmNonCached); @@ -258,7 +258,7 @@ HalpGrowMapBuffers( * a virtual and physical address and corresponds to PAGE_SIZE large * buffer. */ - + if (MapRegisterCount > 0) { PROS_MAP_REGISTER_ENTRY CurrentEntry, PreviousEntry; @@ -425,7 +425,7 @@ HalpDmaAllocateChildAdapter( KernelMode); if (!NT_SUCCESS(Status)) return NULL; - + RtlZeroMemory(AdapterObject, sizeof(ADAPTER_OBJECT)); Status = ObInsertObject( @@ -514,7 +514,7 @@ HalpDmaInitializeEisaAdapter( else { /* - * Validate setup for non-busmaster DMA adapter. Secondary controller + * Validate setup for non-busmaster DMA adapter. Secondary controller * supports only 16-bit transfers and main controller supports only * 8-bit transfers. Anything else is invalid. */ @@ -623,7 +623,7 @@ HalGetAdapter( { EisaAdapter = FALSE; } - + /* * Disallow creating adapter for ISA/EISA DMA channel 4 since it's used * for cascading the controllers and it's not available for software use. @@ -685,7 +685,7 @@ HalGetAdapter( AdapterObject = HalpEisaAdapter[DeviceDescription->DmaChannel]; if (AdapterObject != NULL) { - if (AdapterObject->NeedsMapRegisters && + if (AdapterObject->NeedsMapRegisters && MapRegisters > AdapterObject->MapRegistersPerChannel) AdapterObject->MapRegistersPerChannel = MapRegisters; } @@ -713,7 +713,7 @@ HalGetAdapter( AdapterObject->MapRegistersPerChannel = MapRegisters; /* - * FIXME: Verify that the following makes sense. Actually + * FIXME: Verify that the following makes sense. Actually * MasterAdapter->NumberOfMapRegisters contains even the number * of gaps, so this will not work correctly all the time. It * doesn't matter much since it's only optimization to avoid @@ -946,7 +946,7 @@ HalReadDmaCounter( */ KeAcquireSpinLock(&AdapterObject->MasterAdapter->SpinLock, &OldIrql); - + /* Send the request to the specific controller. */ if (AdapterObject->AdapterNumber == 1) { @@ -986,7 +986,7 @@ HalReadDmaCounter( } KeReleaseSpinLock(&AdapterObject->MasterAdapter->SpinLock, OldIrql); - + Count++; Count &= 0xffff; if (AdapterObject->Width16Bits) @@ -1018,7 +1018,7 @@ HalpGrowMapBufferWorker(PVOID DeferredContext) KeWaitForSingleObject(&HalpDmaLock, Executive, KernelMode, FALSE, NULL); - Succeeded = HalpGrowMapBuffers(WorkItem->AdapterObject->MasterAdapter, + Succeeded = HalpGrowMapBuffers(WorkItem->AdapterObject->MasterAdapter, WorkItem->NumberOfMapRegisters); KeSetEvent(&HalpDmaLock, 0, 0); @@ -1076,7 +1076,7 @@ HalAllocateAdapterChannel( ULONG Index = ~0; ULONG Result; KIRQL OldIrql; - + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); /* Set up the wait context block in case we can't run right away. */ @@ -1180,10 +1180,10 @@ HalAllocateAdapterChannel( AdapterObject->CurrentWcb = WaitContextBlock; Result = ExecutionRoutine( - WaitContextBlock->DeviceObject, WaitContextBlock->CurrentIrp, + WaitContextBlock->DeviceObject, WaitContextBlock->CurrentIrp, AdapterObject->MapRegisterBase, WaitContextBlock->DeviceContext); - /* + /* * Possible return values: * * - KeepObject @@ -1247,7 +1247,7 @@ IoFreeAdapterChannel( KIRQL OldIrql; MasterAdapter = AdapterObject->MasterAdapter; - + for (;;) { /* @@ -1569,7 +1569,7 @@ IoFlushAdapterBuffers( PHYSICAL_ADDRESS PhysicalAddress; PPFN_NUMBER MdlPagesPtr; - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL(DISPATCH_LEVEL); if (AdapterObject != NULL && !AdapterObject->MasterDevice) { @@ -1588,7 +1588,7 @@ IoFlushAdapterBuffers( } SlaveDma = TRUE; } - + /* This can happen if the device supports hardware scatter/gather. */ if (MapRegisterBase == NULL) return TRUE; @@ -1682,7 +1682,7 @@ IoMapTransfer( ULONG Counter; DMA_MODE AdapterMode; KIRQL OldIrql; - + /* * Precalculate some values that are used in all cases. * @@ -1747,7 +1747,7 @@ IoMapTransfer( /* * Try to calculate the size of the transfer. We can only transfer - * pages that are physically contiguous and that don't cross the + * pages that are physically contiguous and that don't cross the * 64Kb boundary (this limitation applies only for ISA controllers). */ @@ -1841,7 +1841,7 @@ IoMapTransfer( if (AdapterObject != NULL && !AdapterObject->MasterDevice) { AdapterMode = AdapterObject->AdapterMode; - + if (WriteToDevice) { AdapterMode.TransferType = WRITE_TRANSFER; diff --git a/reactos/hal/halppc/generic/irql.c b/reactos/hal/halppc/generic/irql.c index ed3ad450a84..e3859ddd665 100644 --- a/reactos/hal/halppc/generic/irql.c +++ b/reactos/hal/halppc/generic/irql.c @@ -16,7 +16,7 @@ /* GLOBALS ******************************************************************/ /* - * FIXME: Use EISA_CONTROL STRUCTURE INSTEAD OF HARD-CODED OFFSETS + * FIXME: Use EISA_CONTROL STRUCTURE INSTEAD OF HARD-CODED OFFSETS */ typedef union @@ -29,10 +29,10 @@ typedef union }; } PIC_MASK; - -/* + +/* * PURPOSE: - Mask for HalEnableSystemInterrupt and HalDisableSystemInterrupt - * - At startup enable timer and cascade + * - At startup enable timer and cascade */ #if defined(__GNUC__) static PIC_MASK pic_mask = {.both = 0xFFFA}; @@ -42,7 +42,7 @@ static PIC_MASK pic_mask = { 0xFFFA }; /* - * PURPOSE: Mask for disabling of acknowledged interrupts + * PURPOSE: Mask for disabling of acknowledged interrupts */ #if defined(__GNUC__) static PIC_MASK pic_mask_intr = {.both = 0x0000}; @@ -94,11 +94,11 @@ VOID NTAPI HalpInitPICs(VOID) WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x2); /* 8086 mode */ WRITE_PORT_UCHAR((PUCHAR)0x21, 0x1); - WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x1); + WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x1); /* Enable interrupts */ WRITE_PORT_UCHAR((PUCHAR)0x21, 0xFF); WRITE_PORT_UCHAR((PUCHAR)0xa1, 0xFF); - + /* We can now enable interrupts */ _enable(); } @@ -108,13 +108,13 @@ VOID HalpEndSystemInterrupt(KIRQL Irql) * FUNCTION: Enable all irqs with higher priority. */ { - const USHORT mask[] = + const USHORT mask[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - }; + }; /* Interrupts should be disable while enabling irqs of both pics */ _disable(); @@ -183,7 +183,7 @@ HalpLowerIrql(KIRQL NewIrql) { return; } - if (KeGetCurrentThread() != NULL && + if (KeGetCurrentThread() != NULL && KeGetCurrentThread()->ApcState.KernelApcPending) { KiDeliverApc(KernelMode, NULL, NULL); @@ -211,7 +211,7 @@ VOID FASTCALL KfLowerIrql (KIRQL NewIrql) { DPRINT("KfLowerIrql(NewIrql %d)\n", NewIrql); - + if (NewIrql > KeGetPcr()->Irql) { DbgPrint ("(%s:%d) NewIrql %x CurrentIrql %x\n", @@ -219,7 +219,7 @@ KfLowerIrql (KIRQL NewIrql) KEBUGCHECK(0); for(;;); } - + HalpLowerIrql(NewIrql); } @@ -244,9 +244,9 @@ KIRQL FASTCALL KfRaiseIrql (KIRQL NewIrql) { KIRQL OldIrql; - + DPRINT("KfRaiseIrql(NewIrql %d)\n", NewIrql); - + if (NewIrql < KeGetPcr()->Irql) { DbgPrint ("%s:%d CurrentIrql %x NewIrql %x\n", @@ -254,7 +254,7 @@ KfRaiseIrql (KIRQL NewIrql) KEBUGCHECK (0); for(;;); } - + OldIrql = KeGetPcr()->Irql; KeGetPcr()->Irql = NewIrql; return OldIrql; @@ -308,7 +308,7 @@ KeRaiseIrqlToSynchLevel (VOID) } -BOOLEAN STDCALL +BOOLEAN STDCALL HalBeginSystemInterrupt (KIRQL Irql, ULONG Vector, PKIRQL OldIrql) @@ -355,7 +355,7 @@ VOID STDCALL HalEndSystemInterrupt (KIRQL Irql, ULONG Unknown2) HalpLowerIrql(Irql); HalpEndSystemInterrupt(Irql); } - + BOOLEAN STDCALL HalDisableSystemInterrupt( @@ -363,7 +363,7 @@ HalDisableSystemInterrupt( KIRQL Irql) { ULONG irq; - + if (Vector < IRQ_BASE || Vector >= IRQ_BASE + NR_IRQS) return FALSE; @@ -377,7 +377,7 @@ HalDisableSystemInterrupt( { WRITE_PORT_UCHAR((PUCHAR)0xa1, (UCHAR)(pic_mask.slave|pic_mask_intr.slave)); } - + return TRUE; } @@ -422,7 +422,7 @@ HalRequestSoftwareInterrupt( case DISPATCH_LEVEL: ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = TRUE; break; - + default: KEBUGCHECK(0); } @@ -441,7 +441,7 @@ HalClearSoftwareInterrupt( case DISPATCH_LEVEL: ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = FALSE; break; - + default: KEBUGCHECK(0); } diff --git a/reactos/hal/halppc/generic/isa.c b/reactos/hal/halppc/generic/isa.c index 665bb1edd45..b7f944853cb 100644 --- a/reactos/hal/halppc/generic/isa.c +++ b/reactos/hal/halppc/generic/isa.c @@ -26,7 +26,7 @@ BOOLEAN HalIsaProbe(VOID) */ { DbgPrint("Assuming ISA bus\n"); - + /* * Probe for plug and play support */ diff --git a/reactos/hal/halppc/generic/processor.c b/reactos/hal/halppc/generic/processor.c index 430435319ac..a4d1828a07d 100644 --- a/reactos/hal/halppc/generic/processor.c +++ b/reactos/hal/halppc/generic/processor.c @@ -40,7 +40,7 @@ HalAllProcessorsStarted (VOID) NTHALAPI BOOLEAN -NTAPI +NTAPI HalStartNextProcessor( IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, IN PKPROCESSOR_STATE ProcessorState diff --git a/reactos/hal/halppc/generic/profil.c b/reactos/hal/halppc/generic/profil.c index f740cccf216..2c7959d3f8d 100644 --- a/reactos/hal/halppc/generic/profil.c +++ b/reactos/hal/halppc/generic/profil.c @@ -54,7 +54,7 @@ KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency) { LARGE_INTEGER Result; /* for now */ - if(PerformanceFrequency) PerformanceFrequency->QuadPart = 100000000; + if(PerformanceFrequency) PerformanceFrequency->QuadPart = 100000000; Result.HighPart = HalpDecrementerRoll; Result.LowPart = __rdtsc(); return Result; diff --git a/reactos/hal/halppc/generic/pwroff.c b/reactos/hal/halppc/generic/pwroff.c index cf6be7555b9..674fe190c04 100644 --- a/reactos/hal/halppc/generic/pwroff.c +++ b/reactos/hal/halppc/generic/pwroff.c @@ -37,13 +37,13 @@ go: cmp ax,101h ; See if version 1.1 or greater mov dx,offset wrongver jc error - + mov [ver],ax mov ax,5301h ; Do a real mode connection mov bx,0 ; device = BIOS int 15h jnc noconerr - + cmp ah,2 ; Pass if already connected mov dx,offset errmsg ; else error jnz error @@ -54,14 +54,14 @@ noconerr: int 15h mov dx,offset errmsg jc error - + mov ax,530dh ; Now engage and enable CPU management mov bx,1 ; device = all mov cx,1 ; enable int 15h mov dx,offset errmsg jc error - + mov ax,530fh mov bx,1 ; device = ALL mov cx,1 ; enable diff --git a/reactos/hal/halppc/include/apic.h b/reactos/hal/halppc/include/apic.h index 7454c210f72..92497b82251 100644 --- a/reactos/hal/halppc/include/apic.h +++ b/reactos/hal/halppc/include/apic.h @@ -193,7 +193,7 @@ extern CPU_INFO CPUMap[MAX_CPU]; /* Map of all CPUs in the system */ __inline VOID APICWrite(ULONG Offset, ULONG Value); __inline ULONG APICRead(ULONG Offset); -VOID APICSendIPI(ULONG Target, ULONG Mode); +VOID APICSendIPI(ULONG Target, ULONG Mode); VOID APICSetup(VOID); VOID HaliInitBSP(VOID); VOID APICSyncArbIDs(VOID); diff --git a/reactos/hal/halppc/include/haldma.h b/reactos/hal/halppc/include/haldma.h index 59ddb9338a0..e918e3b2745 100644 --- a/reactos/hal/halppc/include/haldma.h +++ b/reactos/hal/halppc/include/haldma.h @@ -2,7 +2,7 @@ #define HALDMA_H /* - * DMA Page Register Structure + * DMA Page Register Structure * 080 DMA RESERVED * 081 DMA Page Register (channel 2) * 082 DMA Page Register (channel 3) @@ -62,7 +62,7 @@ typedef struct _DMA_CHANNEL_MASK } DMA_CHANNEL_MASK, *PDMA_CHANNEL_MASK; /* - * DMA Mask Register Structure + * DMA Mask Register Structure * * MSB LSB * x x x x x x x x @@ -101,7 +101,7 @@ typedef union _DMA_MODE } DMA_MODE, *PDMA_MODE; /* - * DMA Extended Mode Register Structure + * DMA Extended Mode Register Structure * * MSB LSB * x x x x x x x x @@ -110,7 +110,7 @@ typedef union _DMA_MODE * | | | | \---- 01 - Channel 1 select * | | | | 10 - Channel 2 select * | | | | 11 - Channel 3 select - * | | | | + * | | | | * | | | | 00 - 8-bit I/O, by bytes * | | | \------------ 01 - 16-bit I/O, by words, address shifted * | | | 10 - 32-bit I/O, by bytes @@ -122,7 +122,7 @@ typedef union _DMA_MODE * | | 11 - Burst * | | * | \---------------------------- 0 - Terminal Count is Output - * | + * | * \---------------------------------0 - Disable Stop Register * 1 - Enable Stop Register */ @@ -182,14 +182,14 @@ typedef struct _DMA_CHANNEL_STOP typedef struct _DMA1_ADDRESS_COUNT { UCHAR DmaBaseAddress; - UCHAR DmaBaseCount; + UCHAR DmaBaseCount; } DMA1_ADDRESS_COUNT, *PDMA1_ADDRESS_COUNT; typedef struct _DMA2_ADDRESS_COUNT { UCHAR DmaBaseAddress; UCHAR Reserved1; - UCHAR DmaBaseCount; + UCHAR DmaBaseCount; UCHAR Reserved2; } DMA2_ADDRESS_COUNT, *PDMA2_ADDRESS_COUNT; @@ -198,12 +198,12 @@ typedef struct _DMA1_CONTROL DMA1_ADDRESS_COUNT DmaAddressCount[4]; UCHAR DmaStatus; UCHAR DmaRequest; - UCHAR SingleMask; + UCHAR SingleMask; UCHAR Mode; UCHAR ClearBytePointer; UCHAR MasterClear; UCHAR ClearMask; - UCHAR AllMask; + UCHAR AllMask; } DMA1_CONTROL, *PDMA1_CONTROL; typedef struct _DMA2_CONTROL @@ -232,13 +232,13 @@ typedef struct _EISA_CONTROL { /* DMA Controller 1 */ DMA1_CONTROL DmaController1; /* 00h-0Fh */ - UCHAR Reserved1[16]; /* 0Fh-1Fh */ - + UCHAR Reserved1[16]; /* 0Fh-1Fh */ + /* Interrupt Controller 1 (PIC) */ UCHAR Pic1Operation; /* 20h */ UCHAR Pic1Interrupt; /* 21h */ UCHAR Reserved2[30]; /* 22h-3Fh */ - + /* Timer */ UCHAR TimerCounter; /* 40h */ UCHAR TimerMemoryRefresh; /* 41h */ @@ -252,29 +252,29 @@ typedef struct _EISA_CONTROL UCHAR TimerCounter2; /* 4Ah */ UCHAR TimerOperation2; /* 4Bh */ UCHAR Reserved5[20]; /* 4Ch-5Fh */ - + /* NMI / Keyboard / RTC */ UCHAR Keyboard; /* 60h */ UCHAR NmiStatus; /* 61h */ UCHAR Reserved6[14]; /* 62h-6Fh */ UCHAR NmiEnable; /* 70h */ UCHAR Reserved7[15]; /* 71h-7Fh */ - + /* DMA Page Registers Controller 1 */ DMA_PAGE DmaController1Pages; /* 80h-8Fh */ UCHAR Reserved8[16]; /* 90h-9Fh */ - + /* Interrupt Controller 2 (PIC) */ UCHAR Pic2Operation; /* 0A0h */ UCHAR Pic2Interrupt; /* 0A1h */ UCHAR Reserved9[30]; /* 0A2h-0BFh */ - + /* DMA Controller 2 */ DMA1_CONTROL DmaController2; /* 0C0h-0CFh */ - + /* System Reserved Ports */ UCHAR SystemReserved[816]; /* 0D0h-3FFh */ - + /* Extended DMA Registers, Controller 1 */ UCHAR DmaHighByteCount1[8]; /* 400h-407h */ UCHAR Reserved10[2]; /* 408h-409h */ @@ -287,25 +287,25 @@ typedef struct _EISA_CONTROL UCHAR Reserved12; /* 463h */ UCHAR BusMaster; /* 464h */ UCHAR Reserved13[27]; /* 465h-47Fh */ - + /* DMA Page Registers Controller 2 */ DMA_PAGE DmaController2Pages; /* 480h-48Fh */ UCHAR Reserved14[48]; /* 490h-4BFh */ - + /* Extended DMA Registers, Controller 2 */ UCHAR DmaHighByteCount2[16]; /* 4C0h-4CFh */ - + /* Edge/Level Control Registers */ UCHAR Pic1EdgeLevel; /* 4D0h */ UCHAR Pic2EdgeLevel; /* 4D1h */ UCHAR Reserved15[2]; /* 4D2h-4D3h */ - + /* Extended DMA Registers, Controller 2 */ UCHAR DmaChainMode2; /* 4D4h */ UCHAR Reserved16; /* 4D5h */ UCHAR DmaExtendedMode2; /* 4D6h */ UCHAR Reserved17[9]; /* 4D7h-4DFh */ - + /* DMA Stop Registers */ DMA_CHANNEL_STOP DmaChannelStop[8]; /* 4E0h-4FFh */ } EISA_CONTROL, *PEISA_CONTROL; @@ -328,7 +328,7 @@ struct _ADAPTER_OBJECT { /* * For normal adapter objects pointer to master adapter that takes care * of channel allocation. For master adapter set to NULL. - */ + */ struct _ADAPTER_OBJECT *MasterAdapter; ULONG MapRegistersPerChannel; @@ -358,7 +358,7 @@ struct _ADAPTER_OBJECT { BOOLEAN Dma64BitAddresses; LIST_ENTRY AdapterList; } ADAPTER_OBJECT; - + typedef struct _GROW_WORK_ITEM { WORK_QUEUE_ITEM WorkQueueItem; PADAPTER_OBJECT AdapterObject; diff --git a/reactos/hal/halppc/include/halirq.h b/reactos/hal/halppc/include/halirq.h index 32b77abc8a3..5421415db38 100644 --- a/reactos/hal/halppc/include/halirq.h +++ b/reactos/hal/halppc/include/halirq.h @@ -13,9 +13,9 @@ #define IRQ_BASE FIRST_DEVICE_VECTOR #define NR_IRQS (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR) -/* - * FIXME: - * This does not work if we have more than 24 IRQs (ie. more than one I/O APIC) +/* + * FIXME: + * This does not work if we have more than 24 IRQs (ie. more than one I/O APIC) */ #define VECTOR2IRQ(vector) (23 - (vector - IRQ_BASE) / 8) #define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector)) diff --git a/reactos/hal/halppc/include/halp.h b/reactos/hal/halppc/include/halp.h index cb540295512..daf60b2fcbf 100644 --- a/reactos/hal/halppc/include/halp.h +++ b/reactos/hal/halppc/include/halp.h @@ -1,5 +1,5 @@ /* - * + * */ #ifndef __INTERNAL_HAL_HAL_H @@ -37,7 +37,7 @@ /* adapter.c */ PADAPTER_OBJECT STDCALL HalpAllocateAdapterEx(ULONG NumberOfMapRegisters,BOOLEAN IsMaster, BOOLEAN Dma32BitAddresses); - + /* bus.c */ VOID NTAPI HalpInitNonBusHandler (VOID); diff --git a/reactos/hal/halppc/include/ioapic.h b/reactos/hal/halppc/include/ioapic.h index 114853c4a6d..bcdd7fe8ec1 100644 --- a/reactos/hal/halppc/include/ioapic.h +++ b/reactos/hal/halppc/include/ioapic.h @@ -52,13 +52,13 @@ typedef struct _IOAPIC_ROUTE_ENTRY { mask : 1, /* 0: enabled, 1: disabled */ __reserved_2 : 15; - union { - struct { + union { + struct { ULONG __reserved_1 : 24, physical_dest : 4, __reserved_2 : 4; } physical; - struct { + struct { ULONG __reserved_1 : 24, logical_dest : 8; } logical; diff --git a/reactos/hal/halx86/generic/dma.c b/reactos/hal/halx86/generic/dma.c index 539bfef1c53..804bf782f6b 100644 --- a/reactos/hal/halx86/generic/dma.c +++ b/reactos/hal/halx86/generic/dma.c @@ -134,7 +134,7 @@ HalpInitDma(VOID) * Check if Extended DMA is available. We're just going to do a random * read and write. */ - + WRITE_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2), 0x2A); if (READ_PORT_UCHAR((PUCHAR)FIELD_OFFSET(EISA_CONTROL, DmaController2Pages.Channel2)) == 0x2A) HalpEisaDma = TRUE; @@ -193,7 +193,7 @@ HalpGetAdapterMaximumPhysicalAddress( * * Allocate initial, or additional, map buffers for DMA master adapter. * - * @param MasterAdapter + * @param MasterAdapter * DMA master adapter to allocate buffers for. * @param SizeOfMapBuffers * Size of the map buffers to allocate (not including the size @@ -228,7 +228,7 @@ HalpGrowMapBuffers( LowestAcceptableAddress.LowPart = HighestAcceptableAddress.LowPart == 0xFFFFFFFF ? 0x1000000 : 0; BoundryAddressMultiple.QuadPart = 0; - + VirtualAddress = MmAllocateContiguousMemorySpecifyCache( MapRegisterCount << PAGE_SHIFT, LowestAcceptableAddress, HighestAcceptableAddress, BoundryAddressMultiple, MmNonCached); @@ -258,7 +258,7 @@ HalpGrowMapBuffers( * a virtual and physical address and corresponds to PAGE_SIZE large * buffer. */ - + if (MapRegisterCount > 0) { PROS_MAP_REGISTER_ENTRY CurrentEntry, PreviousEntry; @@ -425,7 +425,7 @@ HalpDmaAllocateChildAdapter( KernelMode); if (!NT_SUCCESS(Status)) return NULL; - + RtlZeroMemory(AdapterObject, sizeof(ADAPTER_OBJECT)); Status = ObInsertObject( @@ -514,7 +514,7 @@ HalpDmaInitializeEisaAdapter( else { /* - * Validate setup for non-busmaster DMA adapter. Secondary controller + * Validate setup for non-busmaster DMA adapter. Secondary controller * supports only 16-bit transfers and main controller supports only * 8-bit transfers. Anything else is invalid. */ @@ -623,7 +623,7 @@ HalGetAdapter( { EisaAdapter = FALSE; } - + /* * Disallow creating adapter for ISA/EISA DMA channel 4 since it's used * for cascading the controllers and it's not available for software use. @@ -685,7 +685,7 @@ HalGetAdapter( AdapterObject = HalpEisaAdapter[DeviceDescription->DmaChannel]; if (AdapterObject != NULL) { - if (AdapterObject->NeedsMapRegisters && + if (AdapterObject->NeedsMapRegisters && MapRegisters > AdapterObject->MapRegistersPerChannel) AdapterObject->MapRegistersPerChannel = MapRegisters; } @@ -713,7 +713,7 @@ HalGetAdapter( AdapterObject->MapRegistersPerChannel = MapRegisters; /* - * FIXME: Verify that the following makes sense. Actually + * FIXME: Verify that the following makes sense. Actually * MasterAdapter->NumberOfMapRegisters contains even the number * of gaps, so this will not work correctly all the time. It * doesn't matter much since it's only optimization to avoid @@ -946,7 +946,7 @@ HalReadDmaCounter( */ KeAcquireSpinLock(&AdapterObject->MasterAdapter->SpinLock, &OldIrql); - + /* Send the request to the specific controller. */ if (AdapterObject->AdapterNumber == 1) { @@ -986,7 +986,7 @@ HalReadDmaCounter( } KeReleaseSpinLock(&AdapterObject->MasterAdapter->SpinLock, OldIrql); - + Count++; Count &= 0xffff; if (AdapterObject->Width16Bits) @@ -1018,7 +1018,7 @@ HalpGrowMapBufferWorker(PVOID DeferredContext) KeWaitForSingleObject(&HalpDmaLock, Executive, KernelMode, FALSE, NULL); - Succeeded = HalpGrowMapBuffers(WorkItem->AdapterObject->MasterAdapter, + Succeeded = HalpGrowMapBuffers(WorkItem->AdapterObject->MasterAdapter, WorkItem->NumberOfMapRegisters); KeSetEvent(&HalpDmaLock, 0, 0); @@ -1076,7 +1076,7 @@ HalAllocateAdapterChannel( ULONG Index = ~0; ULONG Result; KIRQL OldIrql; - + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); /* Set up the wait context block in case we can't run right away. */ @@ -1180,10 +1180,10 @@ HalAllocateAdapterChannel( AdapterObject->CurrentWcb = WaitContextBlock; Result = ExecutionRoutine( - WaitContextBlock->DeviceObject, WaitContextBlock->CurrentIrp, + WaitContextBlock->DeviceObject, WaitContextBlock->CurrentIrp, AdapterObject->MapRegisterBase, WaitContextBlock->DeviceContext); - /* + /* * Possible return values: * * - KeepObject @@ -1247,7 +1247,7 @@ IoFreeAdapterChannel( KIRQL OldIrql; MasterAdapter = AdapterObject->MasterAdapter; - + for (;;) { /* @@ -1569,7 +1569,7 @@ IoFlushAdapterBuffers( PHYSICAL_ADDRESS PhysicalAddress; PPFN_NUMBER MdlPagesPtr; - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL(DISPATCH_LEVEL); if (AdapterObject != NULL && !AdapterObject->MasterDevice) { @@ -1588,7 +1588,7 @@ IoFlushAdapterBuffers( } SlaveDma = TRUE; } - + /* This can happen if the device supports hardware scatter/gather. */ if (MapRegisterBase == NULL) return TRUE; @@ -1682,7 +1682,7 @@ IoMapTransfer( ULONG Counter; DMA_MODE AdapterMode; KIRQL OldIrql; - + /* * Precalculate some values that are used in all cases. * @@ -1747,7 +1747,7 @@ IoMapTransfer( /* * Try to calculate the size of the transfer. We can only transfer - * pages that are physically contiguous and that don't cross the + * pages that are physically contiguous and that don't cross the * 64Kb boundary (this limitation applies only for ISA controllers). */ @@ -1841,7 +1841,7 @@ IoMapTransfer( if (AdapterObject != NULL && !AdapterObject->MasterDevice) { AdapterMode = AdapterObject->AdapterMode; - + if (WriteToDevice) { AdapterMode.TransferType = WRITE_TRANSFER; diff --git a/reactos/hal/halx86/generic/irql.c b/reactos/hal/halx86/generic/irql.c index fdd9ae8cd58..f767911cedf 100644 --- a/reactos/hal/halx86/generic/irql.c +++ b/reactos/hal/halx86/generic/irql.c @@ -16,7 +16,7 @@ /* GLOBALS ******************************************************************/ /* - * FIXME: Use EISA_CONTROL STRUCTURE INSTEAD OF HARD-CODED OFFSETS + * FIXME: Use EISA_CONTROL STRUCTURE INSTEAD OF HARD-CODED OFFSETS */ typedef union @@ -29,10 +29,10 @@ typedef union }; } PIC_MASK; - -/* + +/* * PURPOSE: - Mask for HalEnableSystemInterrupt and HalDisableSystemInterrupt - * - At startup enable timer and cascade + * - At startup enable timer and cascade */ #if defined(__GNUC__) static PIC_MASK pic_mask = {.both = 0xFFFA}; @@ -42,7 +42,7 @@ static PIC_MASK pic_mask = { 0xFFFA }; /* - * PURPOSE: Mask for disabling of acknowledged interrupts + * PURPOSE: Mask for disabling of acknowledged interrupts */ #if defined(__GNUC__) static PIC_MASK pic_mask_intr = {.both = 0x0000}; @@ -94,11 +94,11 @@ VOID NTAPI HalpInitPICs(VOID) WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x2); /* 8086 mode */ WRITE_PORT_UCHAR((PUCHAR)0x21, 0x1); - WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x1); + WRITE_PORT_UCHAR((PUCHAR)0xa1, 0x1); /* Enable interrupts */ WRITE_PORT_UCHAR((PUCHAR)0x21, 0xFF); WRITE_PORT_UCHAR((PUCHAR)0xa1, 0xFF); - + /* We can now enable interrupts */ _enable(); } @@ -108,13 +108,13 @@ VOID HalpEndSystemInterrupt(KIRQL Irql) * FUNCTION: Enable all irqs with higher priority. */ { - const USHORT mask[] = + const USHORT mask[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - }; + }; /* Interrupts should be disable while enabling irqs of both pics */ _disable(); @@ -303,7 +303,7 @@ HalpLowerIrql(KIRQL NewIrql) { return; } - if (KeGetCurrentThread() != NULL && + if (KeGetCurrentThread() != NULL && KeGetCurrentThread()->ApcState.KernelApcPending) { KiDeliverApc(KernelMode, NULL, NULL); @@ -331,7 +331,7 @@ VOID FASTCALL KfLowerIrql (KIRQL NewIrql) { DPRINT("KfLowerIrql(NewIrql %d)\n", NewIrql); - + if (NewIrql > KeGetPcr()->Irql) { DbgPrint ("(%s:%d) NewIrql %x CurrentIrql %x\n", @@ -339,7 +339,7 @@ KfLowerIrql (KIRQL NewIrql) KEBUGCHECK(0); for(;;); } - + HalpLowerIrql(NewIrql); } @@ -364,9 +364,9 @@ KIRQL FASTCALL KfRaiseIrql (KIRQL NewIrql) { KIRQL OldIrql; - + DPRINT("KfRaiseIrql(NewIrql %d)\n", NewIrql); - + if (NewIrql < KeGetPcr()->Irql) { DbgPrint ("%s:%d CurrentIrql %x NewIrql %x\n", @@ -374,7 +374,7 @@ KfRaiseIrql (KIRQL NewIrql) KEBUGCHECK (0); for(;;); } - + OldIrql = KeGetPcr()->Irql; KeGetPcr()->Irql = NewIrql; return OldIrql; @@ -428,7 +428,7 @@ KeRaiseIrqlToSynchLevel (VOID) } -BOOLEAN STDCALL +BOOLEAN STDCALL HalBeginSystemInterrupt (KIRQL Irql, ULONG Vector, PKIRQL OldIrql) @@ -475,7 +475,7 @@ VOID STDCALL HalEndSystemInterrupt (KIRQL Irql, ULONG Unknown2) HalpLowerIrql(Irql); HalpEndSystemInterrupt(Irql); } - + BOOLEAN STDCALL HalDisableSystemInterrupt( @@ -483,7 +483,7 @@ HalDisableSystemInterrupt( KIRQL Irql) { ULONG irq; - + if (Vector < IRQ_BASE || Vector >= IRQ_BASE + NR_IRQS) return FALSE; @@ -497,7 +497,7 @@ HalDisableSystemInterrupt( { WRITE_PORT_UCHAR((PUCHAR)0xa1, (UCHAR)(pic_mask.slave|pic_mask_intr.slave)); } - + return TRUE; } @@ -542,7 +542,7 @@ HalRequestSoftwareInterrupt( case DISPATCH_LEVEL: ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = TRUE; break; - + default: KEBUGCHECK(0); } @@ -561,7 +561,7 @@ HalClearSoftwareInterrupt( case DISPATCH_LEVEL: ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = FALSE; break; - + default: KEBUGCHECK(0); } diff --git a/reactos/hal/halx86/include/apic.h b/reactos/hal/halx86/include/apic.h index 7454c210f72..92497b82251 100644 --- a/reactos/hal/halx86/include/apic.h +++ b/reactos/hal/halx86/include/apic.h @@ -193,7 +193,7 @@ extern CPU_INFO CPUMap[MAX_CPU]; /* Map of all CPUs in the system */ __inline VOID APICWrite(ULONG Offset, ULONG Value); __inline ULONG APICRead(ULONG Offset); -VOID APICSendIPI(ULONG Target, ULONG Mode); +VOID APICSendIPI(ULONG Target, ULONG Mode); VOID APICSetup(VOID); VOID HaliInitBSP(VOID); VOID APICSyncArbIDs(VOID); diff --git a/reactos/hal/halx86/include/haldma.h b/reactos/hal/halx86/include/haldma.h index 59ddb9338a0..e918e3b2745 100644 --- a/reactos/hal/halx86/include/haldma.h +++ b/reactos/hal/halx86/include/haldma.h @@ -2,7 +2,7 @@ #define HALDMA_H /* - * DMA Page Register Structure + * DMA Page Register Structure * 080 DMA RESERVED * 081 DMA Page Register (channel 2) * 082 DMA Page Register (channel 3) @@ -62,7 +62,7 @@ typedef struct _DMA_CHANNEL_MASK } DMA_CHANNEL_MASK, *PDMA_CHANNEL_MASK; /* - * DMA Mask Register Structure + * DMA Mask Register Structure * * MSB LSB * x x x x x x x x @@ -101,7 +101,7 @@ typedef union _DMA_MODE } DMA_MODE, *PDMA_MODE; /* - * DMA Extended Mode Register Structure + * DMA Extended Mode Register Structure * * MSB LSB * x x x x x x x x @@ -110,7 +110,7 @@ typedef union _DMA_MODE * | | | | \---- 01 - Channel 1 select * | | | | 10 - Channel 2 select * | | | | 11 - Channel 3 select - * | | | | + * | | | | * | | | | 00 - 8-bit I/O, by bytes * | | | \------------ 01 - 16-bit I/O, by words, address shifted * | | | 10 - 32-bit I/O, by bytes @@ -122,7 +122,7 @@ typedef union _DMA_MODE * | | 11 - Burst * | | * | \---------------------------- 0 - Terminal Count is Output - * | + * | * \---------------------------------0 - Disable Stop Register * 1 - Enable Stop Register */ @@ -182,14 +182,14 @@ typedef struct _DMA_CHANNEL_STOP typedef struct _DMA1_ADDRESS_COUNT { UCHAR DmaBaseAddress; - UCHAR DmaBaseCount; + UCHAR DmaBaseCount; } DMA1_ADDRESS_COUNT, *PDMA1_ADDRESS_COUNT; typedef struct _DMA2_ADDRESS_COUNT { UCHAR DmaBaseAddress; UCHAR Reserved1; - UCHAR DmaBaseCount; + UCHAR DmaBaseCount; UCHAR Reserved2; } DMA2_ADDRESS_COUNT, *PDMA2_ADDRESS_COUNT; @@ -198,12 +198,12 @@ typedef struct _DMA1_CONTROL DMA1_ADDRESS_COUNT DmaAddressCount[4]; UCHAR DmaStatus; UCHAR DmaRequest; - UCHAR SingleMask; + UCHAR SingleMask; UCHAR Mode; UCHAR ClearBytePointer; UCHAR MasterClear; UCHAR ClearMask; - UCHAR AllMask; + UCHAR AllMask; } DMA1_CONTROL, *PDMA1_CONTROL; typedef struct _DMA2_CONTROL @@ -232,13 +232,13 @@ typedef struct _EISA_CONTROL { /* DMA Controller 1 */ DMA1_CONTROL DmaController1; /* 00h-0Fh */ - UCHAR Reserved1[16]; /* 0Fh-1Fh */ - + UCHAR Reserved1[16]; /* 0Fh-1Fh */ + /* Interrupt Controller 1 (PIC) */ UCHAR Pic1Operation; /* 20h */ UCHAR Pic1Interrupt; /* 21h */ UCHAR Reserved2[30]; /* 22h-3Fh */ - + /* Timer */ UCHAR TimerCounter; /* 40h */ UCHAR TimerMemoryRefresh; /* 41h */ @@ -252,29 +252,29 @@ typedef struct _EISA_CONTROL UCHAR TimerCounter2; /* 4Ah */ UCHAR TimerOperation2; /* 4Bh */ UCHAR Reserved5[20]; /* 4Ch-5Fh */ - + /* NMI / Keyboard / RTC */ UCHAR Keyboard; /* 60h */ UCHAR NmiStatus; /* 61h */ UCHAR Reserved6[14]; /* 62h-6Fh */ UCHAR NmiEnable; /* 70h */ UCHAR Reserved7[15]; /* 71h-7Fh */ - + /* DMA Page Registers Controller 1 */ DMA_PAGE DmaController1Pages; /* 80h-8Fh */ UCHAR Reserved8[16]; /* 90h-9Fh */ - + /* Interrupt Controller 2 (PIC) */ UCHAR Pic2Operation; /* 0A0h */ UCHAR Pic2Interrupt; /* 0A1h */ UCHAR Reserved9[30]; /* 0A2h-0BFh */ - + /* DMA Controller 2 */ DMA1_CONTROL DmaController2; /* 0C0h-0CFh */ - + /* System Reserved Ports */ UCHAR SystemReserved[816]; /* 0D0h-3FFh */ - + /* Extended DMA Registers, Controller 1 */ UCHAR DmaHighByteCount1[8]; /* 400h-407h */ UCHAR Reserved10[2]; /* 408h-409h */ @@ -287,25 +287,25 @@ typedef struct _EISA_CONTROL UCHAR Reserved12; /* 463h */ UCHAR BusMaster; /* 464h */ UCHAR Reserved13[27]; /* 465h-47Fh */ - + /* DMA Page Registers Controller 2 */ DMA_PAGE DmaController2Pages; /* 480h-48Fh */ UCHAR Reserved14[48]; /* 490h-4BFh */ - + /* Extended DMA Registers, Controller 2 */ UCHAR DmaHighByteCount2[16]; /* 4C0h-4CFh */ - + /* Edge/Level Control Registers */ UCHAR Pic1EdgeLevel; /* 4D0h */ UCHAR Pic2EdgeLevel; /* 4D1h */ UCHAR Reserved15[2]; /* 4D2h-4D3h */ - + /* Extended DMA Registers, Controller 2 */ UCHAR DmaChainMode2; /* 4D4h */ UCHAR Reserved16; /* 4D5h */ UCHAR DmaExtendedMode2; /* 4D6h */ UCHAR Reserved17[9]; /* 4D7h-4DFh */ - + /* DMA Stop Registers */ DMA_CHANNEL_STOP DmaChannelStop[8]; /* 4E0h-4FFh */ } EISA_CONTROL, *PEISA_CONTROL; @@ -328,7 +328,7 @@ struct _ADAPTER_OBJECT { /* * For normal adapter objects pointer to master adapter that takes care * of channel allocation. For master adapter set to NULL. - */ + */ struct _ADAPTER_OBJECT *MasterAdapter; ULONG MapRegistersPerChannel; @@ -358,7 +358,7 @@ struct _ADAPTER_OBJECT { BOOLEAN Dma64BitAddresses; LIST_ENTRY AdapterList; } ADAPTER_OBJECT; - + typedef struct _GROW_WORK_ITEM { WORK_QUEUE_ITEM WorkQueueItem; PADAPTER_OBJECT AdapterObject; diff --git a/reactos/hal/halx86/include/halirq.h b/reactos/hal/halx86/include/halirq.h index 839dfcf05b4..baec1f854ed 100644 --- a/reactos/hal/halx86/include/halirq.h +++ b/reactos/hal/halx86/include/halirq.h @@ -13,9 +13,9 @@ #define IRQ_BASE FIRST_DEVICE_VECTOR #define NR_IRQS (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR) -/* - * FIXME: - * This does not work if we have more than 24 IRQs (ie. more than one I/O APIC) +/* + * FIXME: + * This does not work if we have more than 24 IRQs (ie. more than one I/O APIC) */ #define VECTOR2IRQ(vector) (23 - (vector - IRQ_BASE) / 8) #define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector)) diff --git a/reactos/hal/halx86/include/halp.h b/reactos/hal/halx86/include/halp.h index 61e9260087c..ff86b21b356 100644 --- a/reactos/hal/halx86/include/halp.h +++ b/reactos/hal/halx86/include/halp.h @@ -1,5 +1,5 @@ /* - * + * */ #ifndef __INTERNAL_HAL_HAL_H @@ -31,7 +31,7 @@ /* adapter.c */ PADAPTER_OBJECT STDCALL HalpAllocateAdapterEx(ULONG NumberOfMapRegisters,BOOLEAN IsMaster, BOOLEAN Dma32BitAddresses); - + /* bus.c */ VOID NTAPI HalpInitNonBusHandler (VOID); diff --git a/reactos/hal/halx86/include/ioapic.h b/reactos/hal/halx86/include/ioapic.h index 114853c4a6d..bcdd7fe8ec1 100644 --- a/reactos/hal/halx86/include/ioapic.h +++ b/reactos/hal/halx86/include/ioapic.h @@ -52,13 +52,13 @@ typedef struct _IOAPIC_ROUTE_ENTRY { mask : 1, /* 0: enabled, 1: disabled */ __reserved_2 : 15; - union { - struct { + union { + struct { ULONG __reserved_1 : 24, physical_dest : 4, __reserved_2 : 4; } physical; - struct { + struct { ULONG __reserved_1 : 24, logical_dest : 8; } logical; diff --git a/reactos/hal/halx86/mp/spinlock.c b/reactos/hal/halx86/mp/spinlock.c index b31ca481fd0..cdc40082727 100644 --- a/reactos/hal/halx86/mp/spinlock.c +++ b/reactos/hal/halx86/mp/spinlock.c @@ -101,7 +101,7 @@ KfAcquireSpinLock ( KIRQL OldIrql; ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); - + OldIrql = KfRaiseIrql(DISPATCH_LEVEL); KiAcquireSpinLock(SpinLock); diff --git a/reactos/hal/halx86/xbox/display_xbox.c b/reactos/hal/halx86/xbox/display_xbox.c index f93b9feed28..d692b41755f 100644 --- a/reactos/hal/halx86/xbox/display_xbox.c +++ b/reactos/hal/halx86/xbox/display_xbox.c @@ -408,7 +408,7 @@ HalReleaseDisplayOwnership(VOID) VOID STDCALL HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters) /* - * FUNCTION: + * FUNCTION: * ARGUMENTS: * ResetDisplayParameters = Pointer to a driver specific * reset routine. @@ -465,7 +465,7 @@ HalDisplayString(IN PCH String) { HalPutCharacter(*pch); CursorX++; - + if (SizeX <= CursorX) { CursorY++; @@ -478,10 +478,10 @@ HalDisplayString(IN PCH String) HalScrollDisplay (); CursorY = SizeY - 1; } - + pch++; } - + Ke386RestoreFlags(Flags); KiReleaseSpinLock(&Lock); diff --git a/reactos/include/GL/gl.h b/reactos/include/GL/gl.h index 4d92b4e3487..38efb047a21 100644 --- a/reactos/include/GL/gl.h +++ b/reactos/include/GL/gl.h @@ -1452,7 +1452,7 @@ GLAPI void APIENTRY glSamplePass( GLenum pass ); /* Include external definitions of OpenGL extensions */ /* Removed, see this bug report for reference: * http://sourceforge.net/tracker/index.php?func=detail&aid=610178&group_id=2435&atid=102435 - * + * * #include */ diff --git a/reactos/include/GL/glext.h b/reactos/include/GL/glext.h index c4b4baa0930..d6a834b0f34 100644 --- a/reactos/include/GL/glext.h +++ b/reactos/include/GL/glext.h @@ -13,21 +13,21 @@ extern "C" { ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: This software was created using the ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has ** not been independently verified as being compliant with the OpenGL(R) diff --git a/reactos/include/GL/glu.h b/reactos/include/GL/glu.h index d6e9e37fdba..4baa04634f7 100644 --- a/reactos/include/GL/glu.h +++ b/reactos/include/GL/glu.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: This software was created using the ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has ** not been independently verified as being compliant with the OpenGL(R) diff --git a/reactos/include/crt/assert.h b/reactos/include/crt/assert.h index 9d825c9a288..625908a179e 100644 --- a/reactos/include/crt/assert.h +++ b/reactos/include/crt/assert.h @@ -1,4 +1,4 @@ -/* +/* * assert.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -10,7 +10,7 @@ /* We should be able to include this file multiple times to allow the assert macro to be enabled/disabled for different parts of code. So don't add a - header guard. */ + header guard. */ #ifndef RC_INVOKED diff --git a/reactos/include/crt/ctype.h b/reactos/include/crt/ctype.h index 6404b16221e..92f2a89ac3b 100644 --- a/reactos/include/crt/ctype.h +++ b/reactos/include/crt/ctype.h @@ -1,4 +1,4 @@ -/* +/* * ctype.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -33,7 +33,7 @@ #define _CONTROL 0x0020 /* _BLANK is set for SP and non-ASCII horizontal space chars (eg, "no-break space", 0xA0, in CP1250) but not for HT. */ -#define _BLANK 0x0040 +#define _BLANK 0x0040 #define _HEX 0x0080 #define _LEADBYTE 0x8000 @@ -79,7 +79,7 @@ _CRTIMP int __cdecl toupper(int); /* * These are the cheap non-std versions: The return values are undefined * if the argument is not ASCII char or is not of appropriate case - */ + */ _CRTIMP int __cdecl _tolower(int); _CRTIMP int __cdecl _toupper(int); #endif @@ -114,7 +114,7 @@ __MINGW_IMPORT unsigned short _ctype[]; # else /* CRTDLL */ __MINGW_IMPORT unsigned short* _pctype_dll; # define _pctype _pctype_dll -# endif +# endif #else /* __DECLSPEC_SUPPORTED */ extern unsigned short** _imp___ctype; @@ -129,7 +129,7 @@ extern unsigned short** _imp___ctype; #endif /* __DECLSPEC_SUPPORTED */ /* - * Use inlines here rather than macros, because macros will upset + * Use inlines here rather than macros, because macros will upset * C++ usage (eg, ::isalnum), and so usually get undefined * * According to standard for SB chars, these function are defined only @@ -139,7 +139,7 @@ extern unsigned short** _imp___ctype; * * If no MB char support is needed, these can be simplified even * more by command line define -DMB_CUR_MAX=1. The compiler will then - * optimise away the constant condition. + * optimise away the constant condition. */ #if ! (defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES) \ @@ -245,14 +245,14 @@ int __cdecl __iscsymf (int); /* Valid first character in C symbol */ int __cdecl __iscsym (int); /* Valid character in C symbol (after first) */ #if !(defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES)) -__CRT_INLINE int __cdecl __isascii(int c) {return ((c & ~0x7F) == 0);} +__CRT_INLINE int __cdecl __isascii(int c) {return ((c & ~0x7F) == 0);} __CRT_INLINE int __cdecl __toascii(int c) {return (c & 0x7F);} __CRT_INLINE int __cdecl __iscsymf(int c) {return (isalpha(c) || (c == '_'));} __CRT_INLINE int __cdecl __iscsym(int c) {return (isalnum(c) || (c == '_'));} #endif /* __NO_CTYPE_INLINES */ #ifndef _NO_OLDNAMES -/* Not _CRTIMP */ +/* Not _CRTIMP */ int __cdecl isascii (int); int __cdecl toascii (int); int __cdecl iscsymf (int); diff --git a/reactos/include/crt/direct.h b/reactos/include/crt/direct.h index cf446627936..90338edfa3d 100644 --- a/reactos/include/crt/direct.h +++ b/reactos/include/crt/direct.h @@ -36,7 +36,7 @@ struct _diskfree_t { unsigned bytes_per_sector; }; #define _DISKFREE_T_DEFINED -#endif +#endif /* * You really shouldn't be using these. Use the Win32 API functions instead. @@ -54,7 +54,7 @@ _CRTIMP unsigned __cdecl _getdiskfree (unsigned, struct _diskfree_t *); #ifndef _WDIRECT_DEFINED /* wide character versions. Also in wchar.h */ -#ifdef __MSVCRT__ +#ifdef __MSVCRT__ _CRTIMP int __cdecl _wchdir(const wchar_t*); _CRTIMP wchar_t* __cdecl _wgetcwd(wchar_t*, int); _CRTIMP wchar_t* __cdecl _wgetdcwd(int, wchar_t*, int); diff --git a/reactos/include/crt/dos.h b/reactos/include/crt/dos.h index b3aa9aeffd8..9d39dad6384 100644 --- a/reactos/include/crt/dos.h +++ b/reactos/include/crt/dos.h @@ -72,7 +72,7 @@ struct _diskfree_t { unsigned bytes_per_sector; }; #define _DISKFREE_T_DEFINED -#endif +#endif _CRTIMP unsigned __cdecl _getdiskfree (unsigned, struct _diskfree_t *); diff --git a/reactos/include/crt/errno.h b/reactos/include/crt/errno.h index f9f709c6584..56f0346c6e8 100644 --- a/reactos/include/crt/errno.h +++ b/reactos/include/crt/errno.h @@ -1,4 +1,4 @@ -/* +/* * errno.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. diff --git a/reactos/include/crt/excpt.h b/reactos/include/crt/excpt.h index 30ba11404bd..421311ee319 100644 --- a/reactos/include/crt/excpt.h +++ b/reactos/include/crt/excpt.h @@ -1,4 +1,4 @@ -/* +/* * excpt.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. diff --git a/reactos/include/crt/float.h b/reactos/include/crt/float.h index 53bfb34dbdf..6226f4818be 100644 --- a/reactos/include/crt/float.h +++ b/reactos/include/crt/float.h @@ -1,4 +1,4 @@ -/* +/* * float.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -12,7 +12,7 @@ * NOTE: GCC provides float.h, but it doesn't include the non-standard * stuff for accessing the fp controller. We include_next the * GCC-supplied header and just define the MS-specific extensions - * here. + * here. * */ @@ -116,7 +116,7 @@ _CRTIMP unsigned int __cdecl _statusfp (void); /* Report the FPU status word */ word to 0x37f (64 bit mantissa precison rather than 53 bit). By default, the mingw version of _fpreset sets fp control as per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when - building your application. + building your application. */ void __cdecl _fpreset (void); void __cdecl fpreset (void); diff --git a/reactos/include/crt/inttypes.h b/reactos/include/crt/inttypes.h index a2042614ab5..3937d2166a5 100644 --- a/reactos/include/crt/inttypes.h +++ b/reactos/include/crt/inttypes.h @@ -20,7 +20,7 @@ typedef struct { #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) /* 7.8.1 Macros for format specifiers - * + * * MS runtime does not yet understand C9x standard "ll" * length specifier. It appears to treat "ll" as "l". * The non-standard I64 length specifier causes warning in GCC, @@ -227,7 +227,7 @@ typedef struct { #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* * no length modifier for char types prior to C9x - * MS runtime scanf appears to treat "hh" as "h" + * MS runtime scanf appears to treat "hh" as "h" */ /* signed char */ diff --git a/reactos/include/crt/io.h b/reactos/include/crt/io.h index cfab09880c3..bfb20b81012 100644 --- a/reactos/include/crt/io.h +++ b/reactos/include/crt/io.h @@ -1,4 +1,4 @@ -/* +/* * io.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -42,7 +42,7 @@ typedef unsigned long _fsize_t; /* * The maximum length of a file name. You should use GetVolumeInformation * instead of this constant. But hey, this works. - * Also defined in stdio.h. + * Also defined in stdio.h. */ #ifndef FILENAME_MAX #define FILENAME_MAX (260) @@ -73,8 +73,8 @@ struct _finddatai64_t { struct __finddata64_t { unsigned attrib; - __time64_t time_create; - __time64_t time_access; + __time64_t time_create; + __time64_t time_access; __time64_t time_write; _fsize_t size; char name[FILENAME_MAX]; @@ -101,7 +101,7 @@ struct _wfinddatai64_t { struct __wfinddata64_t { unsigned attrib; - __time64_t time_create; + __time64_t time_create; __time64_t time_access; __time64_t time_write; _fsize_t size; @@ -139,14 +139,14 @@ _CRTIMP long __cdecl _findfirsti64(const char*, struct _finddatai64_t*); _CRTIMP int __cdecl _findnexti64(long, struct _finddatai64_t*); _CRTIMP __int64 __cdecl _lseeki64(int, __int64, int); _CRTIMP __int64 __cdecl _telli64(int); -/* These require newer versions of msvcrt.dll (6.1 or higher). */ +/* These require newer versions of msvcrt.dll (6.1 or higher). */ #if __MSVCRT_VERSION__ >= 0x0601 _CRTIMP intptr_t __cdecl _findfirst64(const char*, struct __finddata64_t*); -_CRTIMP intptr_t __cdecl _findnext64(intptr_t, struct __finddata64_t*); +_CRTIMP intptr_t __cdecl _findnext64(intptr_t, struct __finddata64_t*); #endif /* __MSVCRT_VERSION__ >= 0x0601 */ #ifndef __NO_MINGW_LFS -__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) +__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) { return _lseeki64(fd, (__int64) offset, whence); } @@ -181,7 +181,7 @@ _CRTIMP int __cdecl chmod (const char*, int); * it doesn't seem to hurt to add them). */ #define F_OK 0 /* Check for file existence */ /* Well maybe it does hurt. On newer versions of MSVCRT, an access mode - of 1 causes invalid parameter error. */ + of 1 causes invalid parameter error. */ #define X_OK 1 /* MS access() doesn't check for execute permission. */ #define W_OK 2 /* Check for write permission */ #define R_OK 4 /* Check for read permission */ @@ -259,7 +259,7 @@ _CRTIMP wchar_t * __cdecl _wmktemp(wchar_t*); _CRTIMP long __cdecl _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*); _CRTIMP int __cdecl _wfindnexti64(long, struct _wfinddatai64_t*); #if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); +_CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); _CRTIMP intptr_t __cdecl _wfindnext64(intptr_t, struct __wfinddata64_t*); #endif #endif /* defined (__MSVCRT__) */ diff --git a/reactos/include/crt/limits.h b/reactos/include/crt/limits.h index 04f79f58cbc..ab80ae4859c 100644 --- a/reactos/include/crt/limits.h +++ b/reactos/include/crt/limits.h @@ -1,4 +1,4 @@ -/* +/* * limits.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -80,7 +80,7 @@ #define ULONG_MAX 0xffffffffUL #ifndef __STRICT_ANSI__ -/* POSIX wants this. */ +/* POSIX wants this. */ #define SSIZE_MAX LONG_MAX #endif diff --git a/reactos/include/crt/locale.h b/reactos/include/crt/locale.h index 41746c6a35b..ea4e666a0de 100644 --- a/reactos/include/crt/locale.h +++ b/reactos/include/crt/locale.h @@ -1,4 +1,4 @@ -/* +/* * locale.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. diff --git a/reactos/include/crt/malloc.h b/reactos/include/crt/malloc.h index 5afa2916f43..dbe50b0ebfa 100644 --- a/reactos/include/crt/malloc.h +++ b/reactos/include/crt/malloc.h @@ -67,11 +67,11 @@ _CRTIMP int __cdecl _heapmin (void); /* Return unused heap to the OS. */ _CRTIMP int __cdecl _heapset (unsigned int); _CRTIMP size_t __cdecl _msize (void*); -_CRTIMP size_t __cdecl _get_sbh_threshold (void); +_CRTIMP size_t __cdecl _get_sbh_threshold (void); _CRTIMP int __cdecl _set_sbh_threshold (size_t); -_CRTIMP void* __cdecl _expand (void*, size_t); +_CRTIMP void* __cdecl _expand (void*, size_t); -/* These require msvcr70.dll or higher. */ +/* These require msvcr70.dll or higher. */ #if __MSVCRT_VERSION__ >= 0x0700 _CRTIMP void * __cdecl _aligned_offset_malloc(size_t, size_t, size_t); _CRTIMP void * __cdecl _aligned_offset_realloc(void*, size_t, size_t, size_t); @@ -81,7 +81,7 @@ _CRTIMP void * __cdecl _aligned_realloc (void*, size_t, size_t); _CRTIMP void __cdecl _aligned_free (void*); #endif /* __MSVCRT_VERSION__ >= 0x0700 */ -/* These require libmingwex.a. */ +/* These require libmingwex.a. */ void * __cdecl __mingw_aligned_offset_malloc (size_t, size_t, size_t); void * __cdecl __mingw_aligned_offset_realloc (void*, size_t, size_t, size_t); diff --git a/reactos/include/crt/math.h b/reactos/include/crt/math.h index b03bc541ff6..0d60c6f19d9 100644 --- a/reactos/include/crt/math.h +++ b/reactos/include/crt/math.h @@ -1,4 +1,4 @@ -/* +/* * math.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -65,7 +65,7 @@ #define M_SQRT1_2 0.70710678118654752440 #endif -/* These are also defined in Mingw float.h; needed here as well to work +/* These are also defined in Mingw float.h; needed here as well to work around GCC build issues. */ #ifndef __STRICT_ANSI__ #ifndef __MINGW_FPCLASS_DEFINED @@ -224,7 +224,7 @@ _CRTIMP double __cdecl _y1 (double); _CRTIMP double __cdecl _yn (int, double); _CRTIMP int __cdecl _matherr (struct _exception *); -/* These are also declared in Mingw float.h; needed here as well to work +/* These are also declared in Mingw float.h; needed here as well to work around GCC build issues. */ /* BEGIN FLOAT.H COPY */ /* @@ -276,7 +276,7 @@ _CRTIMP int __cdecl fpclass (double); #endif /* Not _NO_OLDNAMES */ -/* This require msvcr70.dll or higher. */ +/* This require msvcr70.dll or higher. */ #if __MSVCRT_VERSION__ >= 0x0700 _CRTIMP int __cdecl _set_SSE2_enable (int); #endif /* __MSVCRT_VERSION__ >= 0x0700 */ @@ -321,8 +321,8 @@ extern const double __QNAN; /* We can't inline float or double, because we want to ensure truncation - to semantic type before classification. - (A normal long double value might become subnormal when + to semantic type before classification. + (A normal long double value might become subnormal when converted to double, and zero when converted to float.) */ @@ -442,7 +442,7 @@ __CRT_INLINE float __cdecl tanhf (float x) {return (float) tanh (x);} extern long double __cdecl tanhl (long double); -/* Inverse hyperbolic trig functions */ +/* Inverse hyperbolic trig functions */ /* 7.12.5.1 */ extern double __cdecl acosh (double); extern float __cdecl acoshf (float); @@ -516,7 +516,7 @@ extern float __cdecl logbf (float); extern long double __cdecl logbl (long double); /* Inline versions. GCC-4.0+ can do a better fast-math optimization - with __builtins. */ + with __builtins. */ #if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) __CRT_INLINE double __cdecl logb (double x) { @@ -557,7 +557,7 @@ extern float __cdecl scalblnf (float, long); extern long double __cdecl scalblnl (long double, long); /* 7.12.7.1 */ -/* Implementations adapted from Cephes versions */ +/* Implementations adapted from Cephes versions */ extern double __cdecl cbrt (double); extern float __cdecl cbrtf (float); extern long double __cdecl cbrtl (long double); @@ -629,7 +629,7 @@ extern long long __cdecl llrint (double); extern long long __cdecl llrintf (float); extern long long __cdecl llrintl (long double); -/* Inline versions of above. +/* Inline versions of above. GCC 4.0+ can do a better fast-math job with __builtins. */ #if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) __CRT_INLINE double __cdecl rint (double x) @@ -653,15 +653,7 @@ __CRT_INLINE long double __cdecl rintl (long double x) return retval; } -__CRT_INLINE long __cdecl lrint (double x) -{ - long retval; - __asm__ __volatile__ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long __cdecl lrintf (float x) +__CRT_INLINE long __cdecl lrint (double x) { long retval; __asm__ __volatile__ @@ -669,7 +661,15 @@ __CRT_INLINE long __cdecl lrintf (float x) return retval; } -__CRT_INLINE long __cdecl lrintl (long double x) +__CRT_INLINE long __cdecl lrintf (float x) +{ + long retval; + __asm__ __volatile__ + ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); + return retval; +} + +__CRT_INLINE long __cdecl lrintl (long double x) { long retval; __asm__ __volatile__ @@ -693,7 +693,7 @@ __CRT_INLINE long long __cdecl llrintf (float x) return retval; } -__CRT_INLINE long long __cdecl llrintl (long double x) +__CRT_INLINE long long __cdecl llrintl (long double x) { long long retval; __asm__ __volatile__ @@ -727,7 +727,7 @@ extern long double __cdecl truncl (long double); extern float __cdecl fmodf (float, float); extern long double __cdecl fmodl (long double, long double); -/* 7.12.10.2 */ +/* 7.12.10.2 */ extern double __cdecl remainder (double, double); extern float __cdecl remainderf (float, float); extern long double __cdecl remainderl (long double, long double); @@ -785,18 +785,18 @@ extern float __cdecl fminf (float, float); extern long double __cdecl fminl (long double, long double); /* 7.12.13.1 */ -/* return x * y + z as a ternary op */ +/* return x * y + z as a ternary op */ extern double __cdecl fma (double, double, double); extern float __cdecl fmaf (float, float, float); extern long double __cdecl fmal (long double, long double, long double); /* 7.12.14 */ -/* +/* * With these functions, comparisons involving quiet NaNs set the FP * condition code to "unordered". The IEEE floating-point spec * dictates that the result of floating-point comparisons should be - * false whenever a NaN is involved, with the exception of the != op, + * false whenever a NaN is involved, with the exception of the != op, * which always returns true: yes, (NaN != NaN) is true). */ diff --git a/reactos/include/crt/mbctype.h b/reactos/include/crt/mbctype.h index dd57a7b5cd7..43911c996ed 100644 --- a/reactos/include/crt/mbctype.h +++ b/reactos/include/crt/mbctype.h @@ -1,4 +1,4 @@ -/* +/* * mbctype.h * * Functions for testing multibyte character types and converting characters. @@ -25,8 +25,8 @@ #include <_mingw.h> /* return values for _mbsbtype and _mbbtype in mbstring.h */ -#define _MBC_SINGLE 0 -#define _MBC_LEAD 1 +#define _MBC_SINGLE 0 +#define _MBC_LEAD 1 #define _MBC_TRAIL 2 #define _MBC_ILLEGAL (-1) @@ -48,7 +48,7 @@ #ifndef RC_INVOKED -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif diff --git a/reactos/include/crt/mbstring.h b/reactos/include/crt/mbstring.h index 4ad777602af..593ae0c33f1 100644 --- a/reactos/include/crt/mbstring.h +++ b/reactos/include/crt/mbstring.h @@ -1,7 +1,7 @@ /* * mbstring.h * - * Protototypes for string functions supporting multibyte characters. + * Protototypes for string functions supporting multibyte characters. * * This file is part of the Mingw32 package. * @@ -29,7 +29,7 @@ #define __need_size_t #include -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif diff --git a/reactos/include/crt/mingw32/stdarg.h b/reactos/include/crt/mingw32/stdarg.h index c9ddd6b7fc1..55450553821 100644 --- a/reactos/include/crt/mingw32/stdarg.h +++ b/reactos/include/crt/mingw32/stdarg.h @@ -58,7 +58,7 @@ typedef __builtin_va_list __gnuc_va_list; /* Define va_list, if desired, from __gnuc_va_list. */ /* We deliberately do not define va_list when called from stdio.h, because ANSI C says that stdio.h is not supposed to define - va_list. stdio.h needs to have access to that data type, + va_list. stdio.h needs to have access to that data type, but must not use that name. It should use the name __gnuc_va_list, which is safe because it is reserved for the implementation. */ diff --git a/reactos/include/crt/mingw32/stddef.h b/reactos/include/crt/mingw32/stddef.h index 7e6179595da..8102a5fc386 100644 --- a/reactos/include/crt/mingw32/stddef.h +++ b/reactos/include/crt/mingw32/stddef.h @@ -283,7 +283,7 @@ typedef long ssize_t; symbols in the _FOO_T_ family, stays defined even after its corresponding type is defined). If we define wchar_t, then we must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if - we undef _WCHAR_T_, then we must also define rune_t, since + we undef _WCHAR_T_, then we must also define rune_t, since headers like runetype.h assume that if machine/ansi.h is included, and _BSD_WCHAR_T_ is not defined, then rune_t is available. machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of diff --git a/reactos/include/crt/process.h b/reactos/include/crt/process.h index bdc2f0c59d2..a572edcfa16 100644 --- a/reactos/include/crt/process.h +++ b/reactos/include/crt/process.h @@ -1,4 +1,4 @@ -/* +/* * process.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -98,7 +98,7 @@ _CRTIMP void __cdecl _endthread (void); #ifdef __MSVCRT__ _CRTIMP unsigned long __cdecl - _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *), + _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *), void*, unsigned, unsigned*); _CRTIMP void __cdecl _endthreadex (unsigned); #endif diff --git a/reactos/include/crt/search.h b/reactos/include/crt/search.h index 2d7768b53a8..1b80a1e6a14 100644 --- a/reactos/include/crt/search.h +++ b/reactos/include/crt/search.h @@ -1,4 +1,4 @@ -/* +/* * search.h * * Functions for searching and sorting. @@ -38,7 +38,7 @@ typedef unsigned int size_t; #endif /* bsearch and qsort are also declared in stdlib.h */ -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, +_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); _CRTIMP void __cdecl qsort (void*, size_t, size_t, int (*)(const void*, const void*)); diff --git a/reactos/include/crt/setjmp.h b/reactos/include/crt/setjmp.h index 38bb62a0e66..b170f43c445 100644 --- a/reactos/include/crt/setjmp.h +++ b/reactos/include/crt/setjmp.h @@ -1,4 +1,4 @@ -/* +/* * setjmp.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. diff --git a/reactos/include/crt/signal.h b/reactos/include/crt/signal.h index 887150d81f3..b142fd26190 100644 --- a/reactos/include/crt/signal.h +++ b/reactos/include/crt/signal.h @@ -1,4 +1,4 @@ -/* +/* * signal.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. diff --git a/reactos/include/crt/stdint.h b/reactos/include/crt/stdint.h index 5241d48b3a2..2d8e0d851a1 100644 --- a/reactos/include/crt/stdint.h +++ b/reactos/include/crt/stdint.h @@ -43,9 +43,9 @@ typedef unsigned uint_least32_t; typedef long long int_least64_t; typedef unsigned long long uint_least64_t; -/* 7.18.1.3 Fastest minimum-width integer types +/* 7.18.1.3 Fastest minimum-width integer types * Not actually guaranteed to be fastest for all purposes - * Here we use the exact-width types for 8 and 16-bit ints. + * Here we use the exact-width types for 8 and 16-bit ints. */ typedef char int_fast8_t; typedef unsigned char uint_fast8_t; @@ -68,7 +68,7 @@ typedef unsigned long long uintmax_t; #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) /* 7.18.2.1 Limits of exact-width integer types */ -#define INT8_MIN (-128) +#define INT8_MIN (-128) #define INT16_MIN (-32768) #define INT32_MIN (-2147483647 - 1) #define INT64_MIN (-9223372036854775807LL - 1) @@ -116,7 +116,7 @@ typedef unsigned long long uintmax_t; #define UINT_FAST64_MAX UINT64_MAX /* 7.18.2.4 Limits of integer types capable of holding - object pointers */ + object pointers */ #define INTPTR_MIN INT32_MIN #define INTPTR_MAX INT32_MAX #define UINTPTR_MAX UINT32_MAX @@ -135,7 +135,7 @@ typedef unsigned long long uintmax_t; #define SIZE_MAX UINT32_MAX -#ifndef WCHAR_MIN /* also in wchar.h */ +#ifndef WCHAR_MIN /* also in wchar.h */ #define WCHAR_MIN 0 #define WCHAR_MAX 0xffff /* UINT16_MAX */ #endif diff --git a/reactos/include/crt/stdio.h b/reactos/include/crt/stdio.h index 23914a3ff12..8e12777dfd1 100644 --- a/reactos/include/crt/stdio.h +++ b/reactos/include/crt/stdio.h @@ -407,7 +407,7 @@ _CRTIMP int __cdecl fileno (FILE*); #include __CRT_INLINE FILE* __cdecl fopen64 (const char* filename, const char* mode) { - return fopen (filename, mode); + return fopen (filename, mode); } int __cdecl fseeko64 (FILE*, off64_t, int); @@ -448,7 +448,7 @@ _CRTIMP wint_t __cdecl fgetwc (FILE*); _CRTIMP wint_t __cdecl fputwc (wchar_t, FILE*); _CRTIMP wint_t __cdecl ungetwc (wchar_t, FILE*); -#ifdef __MSVCRT__ +#ifdef __MSVCRT__ _CRTIMP wchar_t* __cdecl fgetws (wchar_t*, int, FILE*); _CRTIMP int __cdecl fputws (const wchar_t*, FILE*); _CRTIMP wint_t __cdecl getwc (FILE*); diff --git a/reactos/include/crt/stdlib.h b/reactos/include/crt/stdlib.h index dd407b12fd2..f6ece9a4c09 100644 --- a/reactos/include/crt/stdlib.h +++ b/reactos/include/crt/stdlib.h @@ -128,8 +128,8 @@ __MINGW_IMPORT char** __argv_dll; #endif /* __DECLSPEC_SUPPORTED */ #endif /* MB_CUR_MAX */ -/* - * MS likes to declare errno in stdlib.h as well. +/* + * MS likes to declare errno in stdlib.h as well. */ #ifdef _UWIN @@ -144,7 +144,7 @@ extern int errno; #if !defined (__STRICT_ANSI__) /* - * Use environ from the DLL, not as a global. + * Use environ from the DLL, not as a global. */ #ifdef __MSVCRT__ @@ -355,7 +355,7 @@ _CRTIMP int __cdecl system (const char*); _CRTIMP char* __cdecl getenv (const char*); /* bsearch and qsort are also in non-ANSI header search.h */ -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, +_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); _CRTIMP void __cdecl qsort (void*, size_t, size_t, int (*)(const void*, const void*)); @@ -481,7 +481,7 @@ void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN; #ifndef __STRICT_ANSI__ /* inline using non-ansi functions */ __CRT_INLINE void __cdecl _Exit(int __status) { _exit (__status); } -#endif +#endif typedef struct { long long quot, rem; } lldiv_t; @@ -494,7 +494,7 @@ __CRT_INLINE long long __cdecl llabs(long long _j) long long __cdecl strtoll (const char* __restrict__, char** __restrict, int); unsigned long long __cdecl strtoull (const char* __restrict__, char** __restrict__, int); -#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ +#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ long long __cdecl atoll (const char *); #if !defined (__STRICT_ANSI__) @@ -514,9 +514,9 @@ __CRT_INLINE char* __cdecl ulltoa (unsigned long long _n, char * _c, int _i) __CRT_INLINE long long __cdecl wtoll (const wchar_t * _w) { return _wtoi64 (_w); } __CRT_INLINE wchar_t* __cdecl lltow (long long _n, wchar_t * _w, int _i) - { return _i64tow (_n, _w, _i); } + { return _i64tow (_n, _w, _i); } __CRT_INLINE wchar_t* __cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) - { return _ui64tow (_n, _w, _i); } + { return _ui64tow (_n, _w, _i); } #endif /* (__STRICT_ANSI__) */ #endif /* __MSVCRT__ */ diff --git a/reactos/include/crt/strings.h b/reactos/include/crt/strings.h index 2a777c2d752..5342276e375 100644 --- a/reactos/include/crt/strings.h +++ b/reactos/include/crt/strings.h @@ -2,7 +2,7 @@ File: strings.h Copyright: Public Domain - This file is provided because non ANSI fuctions are described in string.h + This file is provided because non ANSI fuctions are described in string.h that belong in strings.h. These functions are provided for in the OLDNAME libraries. */ diff --git a/reactos/include/crt/sys/stat.h b/reactos/include/crt/sys/stat.h index e0d01eb115c..357a1793f0d 100644 --- a/reactos/include/crt/sys/stat.h +++ b/reactos/include/crt/sys/stat.h @@ -171,7 +171,7 @@ _CRTIMP int __cdecl stat (const char*, struct stat*); #if defined (__MSVCRT__) _CRTIMP int __cdecl _fstati64(int, struct _stati64 *); _CRTIMP int __cdecl _stati64(const char *, struct _stati64 *); -/* These require newer versions of msvcrt.dll (6.10 or higher). */ +/* These require newer versions of msvcrt.dll (6.10 or higher). */ #if __MSVCRT_VERSION__ >= 0x0601 _CRTIMP int __cdecl _fstat64 (int, struct __stat64*); _CRTIMP int __cdecl _stat64 (const char*, struct __stat64*); diff --git a/reactos/include/crt/sys/time.h b/reactos/include/crt/sys/time.h index 17a3960a9af..1f1d0be0d79 100644 --- a/reactos/include/crt/sys/time.h +++ b/reactos/include/crt/sys/time.h @@ -35,7 +35,7 @@ struct timezone IEEE Std 1003.1, 2004 Edition The timezone pointer arg is ignored. Errors are ignored. -*/ +*/ int __cdecl gettimeofday(struct timeval *__restrict__, void *__restrict__ /* tzp (unused) */); diff --git a/reactos/include/crt/sys/timeb.h b/reactos/include/crt/sys/timeb.h index 4cb4b2e379b..d5653129a1f 100644 --- a/reactos/include/crt/sys/timeb.h +++ b/reactos/include/crt/sys/timeb.h @@ -60,7 +60,7 @@ _CRTIMP void __cdecl _ftime (struct _timeb*); _CRTIMP void __cdecl ftime (struct timeb*); #endif /* Not _NO_OLDNAMES */ -/* This requires newer versions of msvcrt.dll (6.10 or higher). */ +/* This requires newer versions of msvcrt.dll (6.10 or higher). */ #if __MSVCRT_VERSION__ >= 0x0601 _CRTIMP void __cdecl _ftime64 (struct __timeb64*); #endif /* __MSVCRT_VERSION__ >= 0x0601 */ diff --git a/reactos/include/crt/sys/types.h b/reactos/include/crt/sys/types.h index 2bc04e755d2..026471fe1a3 100644 --- a/reactos/include/crt/sys/types.h +++ b/reactos/include/crt/sys/types.h @@ -103,7 +103,7 @@ typedef long _ssize_t; #ifndef _NO_OLDNAMES typedef _ssize_t ssize_t; #endif -#endif /* Not _SSIZE_T_ */ +#endif /* Not _SSIZE_T_ */ #ifndef _FPOS64_T_ #define _FPOS64_T_ diff --git a/reactos/include/crt/sys/utime.h b/reactos/include/crt/sys/utime.h index 75cfeb45a72..76caeaf2794 100644 --- a/reactos/include/crt/sys/utime.h +++ b/reactos/include/crt/sys/utime.h @@ -66,7 +66,7 @@ _CRTIMP int __cdecl _futime (int, struct _utimbuf*); _CRTIMP int __cdecl _wutime (const wchar_t*, struct _utimbuf*); #endif /* MSVCRT runtime */ -/* These require newer versions of msvcrt.dll (6.10 or higher). */ +/* These require newer versions of msvcrt.dll (6.10 or higher). */ #if __MSVCRT_VERSION__ >= 0x0601 _CRTIMP int __cdecl _utime64 (const char*, struct __utimbuf64*); _CRTIMP int __cdecl _wutime64 (const wchar_t*, struct __utimbuf64*); diff --git a/reactos/include/crt/time.h b/reactos/include/crt/time.h index 13d4d1630b3..47028e9dc80 100644 --- a/reactos/include/crt/time.h +++ b/reactos/include/crt/time.h @@ -1,4 +1,4 @@ -/* +/* * time.h * This file has no copyright assigned and is placed in the Public Domain. * This file is a part of the mingw-runtime package. @@ -114,7 +114,7 @@ extern _CRTIMP void __cdecl tzset (void); _CRTIMP char* __cdecl _strdate(char*); _CRTIMP char* __cdecl _strtime(char*); -/* These require newer versions of msvcrt.dll (6.10 or higher). */ +/* These require newer versions of msvcrt.dll (6.10 or higher). */ #if __MSVCRT_VERSION__ >= 0x0601 _CRTIMP __time64_t __cdecl _time64( __time64_t*); _CRTIMP __time64_t __cdecl _mktime64 (struct tm*); @@ -177,7 +177,7 @@ __MINGW_IMPORT char *tzname[2]; #else /* not __MSVCRT__ */ /* CRTDLL is royally messed up when it comes to these macros. - TODO: import and alias these via oldnames import library instead + TODO: import and alias these via oldnames import library instead of macros. */ #define daylight _daylight @@ -206,7 +206,7 @@ _CRTIMP wchar_t* __cdecl _wctime64 (const __time64_t*); #endif /* __STRICT_ANSI__ */ _CRTIMP size_t __cdecl wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); #define _WTIME_DEFINED -#endif /* _WTIME_DEFINED */ +#endif /* _WTIME_DEFINED */ #ifdef __cplusplus } diff --git a/reactos/include/crt/wchar.h b/reactos/include/crt/wchar.h index 8b5c6bf12bd..38e3ab7ccaf 100644 --- a/reactos/include/crt/wchar.h +++ b/reactos/include/crt/wchar.h @@ -59,7 +59,7 @@ #ifndef RC_INVOKED -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -115,7 +115,7 @@ _CRTIMP wint_t __cdecl fgetwc (FILE*); _CRTIMP wint_t __cdecl fputwc (wchar_t, FILE*); _CRTIMP wint_t __cdecl ungetwc (wchar_t, FILE*); -#ifdef __MSVCRT__ +#ifdef __MSVCRT__ _CRTIMP wchar_t* __cdecl fgetws (wchar_t*, int, FILE*); _CRTIMP int __cdecl fputws (const wchar_t*, FILE*); _CRTIMP wint_t __cdecl getwc (FILE*); @@ -179,7 +179,7 @@ _CRTIMP wchar_t* __cdecl _wctime64 (const __time64_t*); #endif /* __STRICT_ANSI__ */ _CRTIMP size_t __cdecl wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); #define _WTIME_DEFINED -#endif /* _WTIME_DEFINED */ +#endif /* _WTIME_DEFINED */ #ifndef _WSTRING_DEFINED @@ -280,7 +280,7 @@ int __cdecl wctob(wint_t); #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ __CRT_INLINE int __cdecl fwide(FILE* __UNUSED_PARAM(stream), int __UNUSED_PARAM(mode)) - {return -1;} /* limited to byte orientation */ + {return -1;} /* limited to byte orientation */ __CRT_INLINE int __cdecl mbsinit(const mbstate_t* __UNUSED_PARAM(ps)) {return 1;} wchar_t* __cdecl wmemset(wchar_t *, wchar_t, size_t); @@ -323,7 +323,7 @@ struct _wfinddatai64_t { }; struct __wfinddata64_t { unsigned attrib; - __time64_t time_create; + __time64_t time_create; __time64_t time_access; __time64_t time_write; _fsize_t size; @@ -350,7 +350,7 @@ _CRTIMP wchar_t* __cdecl _wmktemp (wchar_t*); _CRTIMP long __cdecl _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*); _CRTIMP int __cdecl _wfindnexti64 (long, struct _wfinddatai64_t*); #if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); +_CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); _CRTIMP intptr_t __cdecl _wfindnext64(intptr_t, struct __wfinddata64_t*); #endif /* __MSVCRT_VERSION__ >= 0x0601 */ #endif /* defined (__MSVCRT__) */ @@ -359,7 +359,7 @@ _CRTIMP intptr_t __cdecl _wfindnext64(intptr_t, struct __wfinddata64_t*); #ifndef _WDIRECT_DEFINED /* Also in direct.h */ -#ifdef __MSVCRT__ +#ifdef __MSVCRT__ _CRTIMP int __cdecl _wchdir (const wchar_t*); _CRTIMP wchar_t* __cdecl _wgetcwd (wchar_t*, int); _CRTIMP wchar_t* __cdecl _wgetdcwd (int, wchar_t*, int); diff --git a/reactos/include/crt/wctype.h b/reactos/include/crt/wctype.h index 9ca33bb0b27..341b278e315 100644 --- a/reactos/include/crt/wctype.h +++ b/reactos/include/crt/wctype.h @@ -1,4 +1,4 @@ -/* +/* * wctype.h * * Functions for testing wide character types and converting characters. @@ -148,7 +148,7 @@ typedef wchar_t wctrans_t; of wctrans and towctrans are not C99 compliant in that wctrans("tolower") returns 0, while std specifies that a non-zero value should be returned for a valid string descriptor. If you want the MS behaviour (and you have - msvcp60.dll in your path) add -lmsvcp60 to your command line. */ + msvcp60.dll in your path) add -lmsvcp60 to your command line. */ wint_t __cdecl towctrans(wint_t, wctrans_t); wctrans_t __cdecl wctrans(const char*); diff --git a/reactos/include/ddk/atsmedia.h b/reactos/include/ddk/atsmedia.h index 9312b033625..1bda6825a02 100644 --- a/reactos/include/ddk/atsmedia.h +++ b/reactos/include/ddk/atsmedia.h @@ -3,7 +3,7 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: + * FILE: * PURPOSE: headers * PROGRAMMER: Magnus Olsen (greatlrd) * diff --git a/reactos/include/ddk/csq.h b/reactos/include/ddk/csq.h index 5be2e9deaf8..e01e8336f6b 100644 --- a/reactos/include/ddk/csq.h +++ b/reactos/include/ddk/csq.h @@ -68,7 +68,7 @@ struct _IO_CSQ; * Function to insert an IRP in the queue. No need to worry about locking; * just tack it onto your list or something. * - * Sample implementation: + * Sample implementation: * VOID NTAPI CsqInsertIrp(PIO_CSQ Csq, PIRP Irp) { @@ -151,7 +151,7 @@ typedef VOID (NTAPI *PIO_CSQ_RELEASE_LOCK) (struct _IO_CSQ *Csq, /* * Finally, this is called by the queue library when it wants to complete * a canceled IRP. - * + * * Sample: * VOID NTAPI CsqCompleteCancelledIrp(PIO_CSQ Csq, PIRP Irp) @@ -286,7 +286,7 @@ PIRP NTAPI IoCsqRemoveIrp(PIO_CSQ Csq, PIO_CSQ_IRP_CONTEXT Context); /* - * Remove the next IRP from the queue + * Remove the next IRP from the queue */ NTKERNELAPI PIRP NTAPI IoCsqRemoveNextIrp(PIO_CSQ Csq, diff --git a/reactos/include/ddk/d3dhal.h b/reactos/include/ddk/d3dhal.h index 6d1b3ae9b05..67a5e1781b9 100644 --- a/reactos/include/ddk/d3dhal.h +++ b/reactos/include/ddk/d3dhal.h @@ -328,7 +328,7 @@ typedef enum _D3DHAL_DP2OPERATION { D3DDP2OP_SETMATERIAL = 33, D3DDP2OP_SETLIGHT = 34, D3DDP2OP_CREATELIGHT = 35, - D3DDP2OP_SETTRANSFORM = 36, + D3DDP2OP_SETTRANSFORM = 36, D3DDP2OP_TEXBLT = 38, D3DDP2OP_STATESET = 39, D3DDP2OP_SETPRIORITY = 40, diff --git a/reactos/include/ddk/d3dnthal.h b/reactos/include/ddk/d3dnthal.h index 90e91300713..a890704345b 100644 --- a/reactos/include/ddk/d3dnthal.h +++ b/reactos/include/ddk/d3dnthal.h @@ -1,4 +1,4 @@ -/* +/* * Direct3D NT driver interface */ @@ -20,7 +20,7 @@ DEFINE_GUID(GUID_D3DParseUnknownCommandCallback, 0x2E04FFA0, 0x98E4, 0x11D1, 0x8 DEFINE_GUID(GUID_ZPixelFormats, 0x93869880, 0x36CF, 0x11D1, 0x9B, 0x1B, 0x00, 0xAA, 0x00, 0xBB, 0xB8, 0xAE); DEFINE_GUID(GUID_DDStereoMode, 0xF828169C, 0xA8E8, 0x11D2, 0xA1, 0xF2, 0x00, 0xA0, 0xC9, 0x83, 0xEA, 0xF6); -typedef struct _D3DNTHAL_CONTEXTCREATEDATA +typedef struct _D3DNTHAL_CONTEXTCREATEDATA { union { @@ -42,26 +42,26 @@ typedef struct _D3DNTHAL_CONTEXTCREATEDATA HRESULT ddrval; } D3DNTHAL_CONTEXTCREATEDATA, *LPD3DNTHAL_CONTEXTCREATEDATA; -typedef struct _D3DNTHAL_CONTEXTDESTROYDATA +typedef struct _D3DNTHAL_CONTEXTDESTROYDATA { ULONG_PTR dwhContext; HRESULT ddrval; } D3DNTHAL_CONTEXTDESTROYDATA, *LPD3DNTHAL_CONTEXTDESTROYDATA; -typedef struct _D3DNTHAL_CONTEXTDESTROYALLDATA +typedef struct _D3DNTHAL_CONTEXTDESTROYALLDATA { DWORD dwPID; HRESULT ddrval; } D3DNTHAL_CONTEXTDESTROYALLDATA, *LPD3DNTHAL_CONTEXTDESTROYALLDATA; -typedef struct _D3DNTHAL_SCENECAPTUREDATA +typedef struct _D3DNTHAL_SCENECAPTUREDATA { ULONG_PTR dwhContext; DWORD dwFlag; HRESULT ddrval; } D3DNTHAL_SCENECAPTUREDATA, *LPD3DNTHAL_SCENECAPTUREDATA; -typedef struct _D3DNTHAL_TEXTURECREATEDATA +typedef struct _D3DNTHAL_TEXTURECREATEDATA { ULONG_PTR dwhContext; HANDLE hDDS; @@ -69,14 +69,14 @@ typedef struct _D3DNTHAL_TEXTURECREATEDATA HRESULT ddrval; } D3DNTHAL_TEXTURECREATEDATA, *LPD3DNTHAL_TEXTURECREATEDATA; -typedef struct _D3DNTHAL_TEXTUREDESTROYDATA +typedef struct _D3DNTHAL_TEXTUREDESTROYDATA { ULONG_PTR dwhContext; ULONG_PTR dwHandle; HRESULT ddrval; } D3DNTHAL_TEXTUREDESTROYDATA, *LPD3DNTHAL_TEXTUREDESTROYDATA; -typedef struct _D3DNTHAL_TEXTURESWAPDATA +typedef struct _D3DNTHAL_TEXTURESWAPDATA { ULONG_PTR dwhContext; ULONG_PTR dwHandle1; @@ -84,10 +84,10 @@ typedef struct _D3DNTHAL_TEXTURESWAPDATA HRESULT ddrval; } D3DNTHAL_TEXTURESWAPDATA, *LPD3DNTHAL_TEXTURESWAPDATA; -typedef struct _D3DNTHAL_TEXTUREGETSURFDATA +typedef struct _D3DNTHAL_TEXTUREGETSURFDATA { ULONG_PTR dwhContext; - HANDLE hDDS; + HANDLE hDDS; ULONG_PTR dwHandle; HRESULT ddrval; } D3DNTHAL_TEXTUREGETSURFDATA, *LPD3DNTHAL_TEXTUREGETSURFDATA; @@ -101,7 +101,7 @@ typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREDESTROYCB)(LPD3DNTHAL_TEXTUREDESTROYD typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTURESWAPCB)(LPD3DNTHAL_TEXTURESWAPDATA); typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREGETSURFCB)(LPD3DNTHAL_TEXTUREGETSURFDATA); -typedef struct _D3DNTHALDeviceDesc_V1 +typedef struct _D3DNTHALDeviceDesc_V1 { DWORD dwSize; DWORD dwFlags; @@ -118,7 +118,7 @@ typedef struct _D3DNTHALDeviceDesc_V1 DWORD dwMaxVertexCount; } D3DNTHALDEVICEDESC_V1, *LPD3DNTHALDEVICEDESC_V1; -typedef struct _D3DNTHAL_GLOBALDRIVERDATA +typedef struct _D3DNTHAL_GLOBALDRIVERDATA { DWORD dwSize; D3DNTHALDEVICEDESC_V1 hwCaps; @@ -128,7 +128,7 @@ typedef struct _D3DNTHAL_GLOBALDRIVERDATA LPDDSURFACEDESC lpTextureFormats; } D3DNTHAL_GLOBALDRIVERDATA, *LPD3DNTHAL_GLOBALDRIVERDATA; -typedef struct _D3DNTHAL_CALLBACKS +typedef struct _D3DNTHAL_CALLBACKS { DWORD dwSize; LPD3DNTHAL_CONTEXTCREATECB ContextCreate; diff --git a/reactos/include/ddk/dderror.h b/reactos/include/ddk/dderror.h index bdbd94e1cc1..68db475f390 100644 --- a/reactos/include/ddk/dderror.h +++ b/reactos/include/ddk/dderror.h @@ -3,18 +3,18 @@ #define _DDERROR_ #define _WINERROR_ #define NO_ERROR 0 -#define ERROR_INVALID_FUNCTION 1 -#define ERROR_NOT_ENOUGH_MEMORY 8 -#define ERROR_DEV_NOT_EXIST 55 -#define ERROR_INVALID_PARAMETER 87 -#define ERROR_INSUFFICIENT_BUFFER 122 -#define ERROR_INVALID_NAME 123 -#define ERROR_BUSY 170 -#define ERROR_MORE_DATA 234 -#define WAIT_TIMEOUT 258 -#define ERROR_IO_PENDING 997 -#define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164 -#define ERROR_CONTINUE 1246 -#define ERROR_NO_MORE_DEVICES 1248 -#endif +#define ERROR_INVALID_FUNCTION 1 +#define ERROR_NOT_ENOUGH_MEMORY 8 +#define ERROR_DEV_NOT_EXIST 55 +#define ERROR_INVALID_PARAMETER 87 +#define ERROR_INSUFFICIENT_BUFFER 122 +#define ERROR_INVALID_NAME 123 +#define ERROR_BUSY 170 +#define ERROR_MORE_DATA 234 +#define WAIT_TIMEOUT 258 +#define ERROR_IO_PENDING 997 +#define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164 +#define ERROR_CONTINUE 1246 +#define ERROR_NO_MORE_DEVICES 1248 +#endif diff --git a/reactos/include/ddk/ddkernel.h b/reactos/include/ddk/ddkernel.h index c2be3c5eac4..75a5b016350 100644 --- a/reactos/include/ddk/ddkernel.h +++ b/reactos/include/ddk/ddkernel.h @@ -2,7 +2,7 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: + * FILE: * PURPOSE: Directx headers * PROGRAMMER: Magnus Olsen (greatlrd) * diff --git a/reactos/include/ddk/ddrawi.h b/reactos/include/ddk/ddrawi.h index 4e010392c56..ab8f5654d6c 100644 --- a/reactos/include/ddk/ddrawi.h +++ b/reactos/include/ddk/ddrawi.h @@ -701,7 +701,7 @@ typedef struct _DDHALINFO { #define DDHALINFO_MODEXILLEGAL 0x00000002 #define DDHALINFO_GETDRIVERINFOSET 0x00000004 #define DDHALINFO_GETDRIVERINFO2 0x00000008 -#endif +#endif #define DDRAWI_VPORTSTART 0x0001 #define DDRAWI_VPORTSTOP 0x0002 #define DDRAWI_VPORTUPDATE 0x0003 @@ -735,7 +735,7 @@ typedef struct _DDHALINFO { #define DDHAL_EXEBUFCB32_DESTROYEXEBUF 0x00000004 #define DDHAL_EXEBUFCB32_LOCKEXEBUF 0x00000008 #define DDHAL_EXEBUFCB32_UNLOCKEXEBUF 0x00000010 -#endif +#endif #define DDHAL_VPORT32_CANCREATEVIDEOPORT 0x00000001 #define DDHAL_VPORT32_CREATEVIDEOPORT 0x00000002 #define DDHAL_VPORT32_FLIP 0x00000004 diff --git a/reactos/include/ddk/ddrawint.h b/reactos/include/ddk/ddrawint.h index e2c871dd08b..17f2a8779c6 100644 --- a/reactos/include/ddk/ddrawint.h +++ b/reactos/include/ddk/ddrawint.h @@ -1,4 +1,4 @@ -/* +/* * DirectDraw NT driver interface */ @@ -59,7 +59,7 @@ extern "C" { typedef ULONG_PTR FLATPTR; -typedef struct _DD_VIDEOPORT_LOCAL *PDD_VIDEOPORT_LOCAL; +typedef struct _DD_VIDEOPORT_LOCAL *PDD_VIDEOPORT_LOCAL; /************************************************************************/ /* _DD_GETHEAPALIGNMENTDATA is defined in dmemmgr.h */ @@ -122,13 +122,13 @@ typedef struct _DD_DIRECTDRAW_LOCAL typedef struct _DD_SURFACE_GLOBAL { - union + union { DWORD dwBlockSizeY; LONG lSlicePitch; }; - union + union { PVIDEOMEMORY lpVidMemHeap; DWORD dwBlockSizeX; @@ -561,7 +561,7 @@ typedef struct _DD_GETAVAILDRIVERMEMORYDATA PVOID GetAvailDriverMemory; } DD_GETAVAILDRIVERMEMORYDATA, *PDD_GETAVAILDRIVERMEMORYDATA; typedef DWORD (STDCALL *PDD_GETAVAILDRIVERMEMORY)(PDD_GETAVAILDRIVERMEMORYDATA); - + typedef struct _DD_MISCELLANEOUSCALLBACKS { DWORD dwSize; @@ -1146,7 +1146,7 @@ typedef struct _DD_GETDRIVERINFODATA PVOID lpvData; // Output: DWORD dwActualSize; - HRESULT ddRVal; + HRESULT ddRVal; } DD_GETDRIVERINFODATA, *PDD_GETDRIVERINFODATA; typedef DWORD (STDCALL *PDD_GETDRIVERINFO)(PDD_GETDRIVERINFODATA); @@ -1265,30 +1265,30 @@ typedef struct _DD_MORESURFACECAPS /*********************************************************/ typedef struct _DD_SYNCSURFACEDATA { - PDD_DIRECTDRAW_LOCAL lpDD; + PDD_DIRECTDRAW_LOCAL lpDD; PDD_SURFACE_LOCAL lpDDSurface; - DWORD dwSurfaceOffset; - ULONG_PTR fpLockPtr; - LONG lPitch; - DWORD dwOverlayOffset; - ULONG dwDriverReserved1; - ULONG dwDriverReserved2; - ULONG dwDriverReserved3; - ULONG dwDriverReserved4; + DWORD dwSurfaceOffset; + ULONG_PTR fpLockPtr; + LONG lPitch; + DWORD dwOverlayOffset; + ULONG dwDriverReserved1; + ULONG dwDriverReserved2; + ULONG dwDriverReserved3; + ULONG dwDriverReserved4; HRESULT ddRVal; } DD_SYNCSURFACEDATA, *PDD_SYNCSURFACEDATA; typedef DWORD (STDCALL *PDD_KERNELCB_SYNCSURFACE)(PDD_SYNCSURFACEDATA); typedef struct _DD_SYNCVIDEOPORTDATA { - PDD_DIRECTDRAW_LOCAL lpDD; + PDD_DIRECTDRAW_LOCAL lpDD; PDD_VIDEOPORT_LOCAL lpVideoPort; - DWORD dwOriginOffset; - DWORD dwHeight; - DWORD dwVBIHeight; - ULONG dwDriverReserved1; - ULONG dwDriverReserved2; - ULONG dwDriverReserved3; + DWORD dwOriginOffset; + DWORD dwHeight; + DWORD dwVBIHeight; + ULONG dwDriverReserved1; + ULONG dwDriverReserved2; + ULONG dwDriverReserved3; HRESULT ddRVal; } DD_SYNCVIDEOPORTDATA, *PDD_SYNCVIDEOPORTDATA; typedef DWORD (STDCALL *PDD_KERNELCB_SYNCVIDEOPORT)(PDD_SYNCVIDEOPORTDATA); @@ -1302,18 +1302,18 @@ typedef struct DD_NTPRIVATEDRIVERCAPS typedef struct _DD_UPDATENONLOCALHEAPDATA { - PDD_DIRECTDRAW_GLOBAL lpDD; - DWORD dwHeap; - FLATPTR fpGARTLin; - FLATPTR fpGARTDev; + PDD_DIRECTDRAW_GLOBAL lpDD; + DWORD dwHeap; + FLATPTR fpGARTLin; + FLATPTR fpGARTDev; ULONG_PTR ulPolicyMaxBytes; - HRESULT ddRVal; + HRESULT ddRVal; VOID* UpdateNonLocalHeap; } DD_UPDATENONLOCALHEAPDATA, *PDD_UPDATENONLOCALHEAPDATA; typedef struct _DD_STEREOMODE { - DWORD dwSize; + DWORD dwSize; DWORD dwHeight; DWORD dwWidth; DWORD dwBpp; @@ -1392,12 +1392,12 @@ typedef struct DD_KERNELCALLBACKS #define DDHAL_PLEASEALLOC_USERMEM 0x00000004l -#define VIDMEM_ISLINEAR 0x00000001l -#define VIDMEM_ISRECTANGULAR 0x00000002l -#define VIDMEM_ISHEAP 0x00000004l -#define VIDMEM_ISNONLOCAL 0x00000008l -#define VIDMEM_ISWC 0x00000010l -#define VIDMEM_HEAPDISABLED 0x00000020l +#define VIDMEM_ISLINEAR 0x00000001l +#define VIDMEM_ISRECTANGULAR 0x00000002l +#define VIDMEM_ISHEAP 0x00000004l +#define VIDMEM_ISNONLOCAL 0x00000008l +#define VIDMEM_ISWC 0x00000010l +#define VIDMEM_HEAPDISABLED 0x00000020l #define DDHAL_CREATESURFACEEX_SWAPHANDLES 0x00000001l @@ -1408,13 +1408,13 @@ typedef struct DD_KERNELCALLBACKS #define DDHAL_DRIVER_HANDLED 0x00000001l #define DDHAL_DRIVER_NOCKEYHW 0x00000002l -#define DDRAWISURF_HASCKEYSRCBLT 0x00000800L -#define DDRAWISURF_HASPIXELFORMAT 0x00002000L -#define DDRAWISURF_HASOVERLAYDATA 0x00004000L -#define DDRAWISURF_FRONTBUFFER 0x04000000L -#define DDRAWISURF_BACKBUFFER 0x08000000L -#define DDRAWISURF_INVALID 0x10000000L -#define DDRAWISURF_DRIVERMANAGED 0x40000000L +#define DDRAWISURF_HASCKEYSRCBLT 0x00000800L +#define DDRAWISURF_HASPIXELFORMAT 0x00002000L +#define DDRAWISURF_HASOVERLAYDATA 0x00004000L +#define DDRAWISURF_FRONTBUFFER 0x04000000L +#define DDRAWISURF_BACKBUFFER 0x08000000L +#define DDRAWISURF_INVALID 0x10000000L +#define DDRAWISURF_DRIVERMANAGED 0x40000000L #define ROP_HAS_SOURCE 0x00000001l #define ROP_HAS_PATTERN 0x00000002l @@ -1437,9 +1437,9 @@ typedef struct DD_KERNELCALLBACKS #define DDHALINFO_GETDRIVERINFOSET 0x00000004 #define DDHALINFO_GETDRIVERINFO2 0x00000008 -#define DDRAWIVPORT_ON 0x00000001 -#define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002 -#define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004 +#define DDRAWIVPORT_ON 0x00000001 +#define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002 +#define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004 #define DDHAL_PRIVATECAP_ATOMICSURFACECREATION 0x00000001l #define DDHAL_PRIVATECAP_NOTIFYPRIMARYCREATION 0x00000002l diff --git a/reactos/include/ddk/diskguid.h b/reactos/include/ddk/diskguid.h index 0cbe803e32b..920de6f6fc9 100644 --- a/reactos/include/ddk/diskguid.h +++ b/reactos/include/ddk/diskguid.h @@ -2,7 +2,7 @@ #ifdef DEFINE_GUID DEFINE_GUID(PARTITION_ENTRY_UNUSED_GUID, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); // Entry unused DEFINE_GUID(PARTITION_SYSTEM_GUID, 0xC12A7328, 0xF81F, 0x11D2, 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B); // EFI system partition -DEFINE_GUID(PARTITION_MSFT_RESERVED_GUID, 0xE3C9E316, 0x0B5C, 0x4DB8, 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE); // Microsoft reserved space +DEFINE_GUID(PARTITION_MSFT_RESERVED_GUID, 0xE3C9E316, 0x0B5C, 0x4DB8, 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE); // Microsoft reserved space DEFINE_GUID(PARTITION_BASIC_DATA_GUID, 0xEBD0A0A2, 0xB9E5, 0x4433, 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7); // Basic data partition DEFINE_GUID(PARTITION_LDM_METADATA_GUID, 0x5808C8AA, 0x7E8F, 0x42E0, 0x85, 0xD2, 0xE1, 0xE9, 0x04, 0x34, 0xCF, 0xB3); // Logical Disk Manager metadata partition DEFINE_GUID(PARTITION_LDM_DATA_GUID, 0xAF9B60A0, 0x1431, 0x4F62, 0xBC, 0x68, 0x33, 0x11, 0x71, 0x4A, 0x69, 0xAD); // Logical Disk Manager data partition diff --git a/reactos/include/ddk/dmemmgr.h b/reactos/include/ddk/dmemmgr.h index cd2889687a5..ed339cfa597 100644 --- a/reactos/include/ddk/dmemmgr.h +++ b/reactos/include/ddk/dmemmgr.h @@ -3,7 +3,7 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: + * FILE: * PURPOSE: Directx headers * PROGRAMMER: Magnus Olsen (greatlrd) * @@ -25,7 +25,7 @@ typedef struct _VIDEOMEMORY *LPVIDMEM; #endif #define SURFACEALIGN_DISCARDABLE 0x00000001 -#define VMEMHEAP_LINEAR 0x00000001 +#define VMEMHEAP_LINEAR 0x00000001 #define VMEMHEAP_RECTANGULAR 0x00000002 #define VMEMHEAP_ALIGNMENT 0x00000004 @@ -41,7 +41,7 @@ typedef struct _VMEMR { struct _VMEMR *next; struct _VMEMR *prev; - + struct _VMEMR *pUp; struct _VMEMR *pDown; struct _VMEMR *pLeft; @@ -101,7 +101,7 @@ typedef struct _VMEMHEAP DWORD dwTotalSize; FLATPTR fpGARTLin; FLATPTR fpGARTDev; - DWORD dwCommitedSize; + DWORD dwCommitedSize; DWORD dwCoalesceCount; HEAPALIGNMENT Alignment; DDSCAPSEX ddsCapsEx; @@ -117,7 +117,7 @@ typedef struct _VMEMHEAP typedef struct _DD_GETHEAPALIGNMENTDATA { - ULONG_PTR dwInstance; + ULONG_PTR dwInstance; DWORD dwHeap; HRESULT ddRVal; VOID* GetHeapAlignment; @@ -127,7 +127,7 @@ typedef struct _DD_GETHEAPALIGNMENTDATA extern void WINAPI VidMemFree( LPVMEMHEAP pvmh, FLATPTR ptr); extern FLATPTR WINAPI VidMemAlloc( LPVMEMHEAP pvmh, DWORD width, DWORD height); -extern FLATPTR WINAPI +extern FLATPTR WINAPI HeapVidMemAllocAligned( LPVIDMEM lpVidMem, DWORD dwWidth, diff --git a/reactos/include/ddk/drmk.h b/reactos/include/ddk/drmk.h index a3b89d15799..1f7dcbe8e8e 100644 --- a/reactos/include/ddk/drmk.h +++ b/reactos/include/ddk/drmk.h @@ -1,83 +1,83 @@ -/* - ReactOS Kernel Streaming - Digital Rights Management - - Author: Andrew Greenwood -*/ - -#ifndef DRMK_H -#define DRMK_H - -#include -#include -#include - -typedef struct -{ - DWORD Flags; - PDEVICE_OBJECT DeviceObject; - PFILE_OBJECT FileObject; - PVOID Context; -} DRMFORWARD, *PDRMFORWARD, *PCDRMFORWARD; - -typedef struct -{ - BOOL CopyProtect; - ULONG Reserved; - BOOL DigitalOutputDisable; -} DRMRIGHTS, *PDRMRIGHTS; - - -/* =============================================================== - Digital Rights Management Functions - TODO: Check calling convention -*/ - -#ifdef __cplusplus -extern "C" -{ -#endif - -NTAPI NTSTATUS -DrmAddContentHandlers( - IN ULONG ContentId, - IN PVOID *paHandlers, - IN ULONG NumHandlers); - -NTAPI NTSTATUS -DrmCreateContentMixed( - IN PULONG paContentId, - IN ULONG cContentId, - OUT PULONG pMixedContentId); - -NTAPI NTSTATUS -DrmDestroyContent( - IN ULONG ContentId); - -NTAPI NTSTATUS -DrmForwardContentToDeviceObject( - IN ULONG ContentId, - IN PVOID Reserved, - IN PCDRMFORWARD DrmForward); - -NTAPI NTSTATUS -DrmForwardContentToFileObject( - IN ULONG ContentId, - IN PFILE_OBJECT FileObject); - -NTAPI NTSTATUS -DrmForwardContentToInterface( - IN ULONG ContentId, - IN PUNKNOWN pUnknown, - IN ULONG NumMethods); - -NTAPI NTSTATUS -DrmGetContentRights( - IN ULONG ContentId, - OUT PDRMRIGHTS DrmRights); - -#ifdef __cplusplus -} -#endif - -#endif +/* + ReactOS Kernel Streaming + Digital Rights Management + + Author: Andrew Greenwood +*/ + +#ifndef DRMK_H +#define DRMK_H + +#include +#include +#include + +typedef struct +{ + DWORD Flags; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + PVOID Context; +} DRMFORWARD, *PDRMFORWARD, *PCDRMFORWARD; + +typedef struct +{ + BOOL CopyProtect; + ULONG Reserved; + BOOL DigitalOutputDisable; +} DRMRIGHTS, *PDRMRIGHTS; + + +/* =============================================================== + Digital Rights Management Functions + TODO: Check calling convention +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +NTAPI NTSTATUS +DrmAddContentHandlers( + IN ULONG ContentId, + IN PVOID *paHandlers, + IN ULONG NumHandlers); + +NTAPI NTSTATUS +DrmCreateContentMixed( + IN PULONG paContentId, + IN ULONG cContentId, + OUT PULONG pMixedContentId); + +NTAPI NTSTATUS +DrmDestroyContent( + IN ULONG ContentId); + +NTAPI NTSTATUS +DrmForwardContentToDeviceObject( + IN ULONG ContentId, + IN PVOID Reserved, + IN PCDRMFORWARD DrmForward); + +NTAPI NTSTATUS +DrmForwardContentToFileObject( + IN ULONG ContentId, + IN PFILE_OBJECT FileObject); + +NTAPI NTSTATUS +DrmForwardContentToInterface( + IN ULONG ContentId, + IN PUNKNOWN pUnknown, + IN ULONG NumMethods); + +NTAPI NTSTATUS +DrmGetContentRights( + IN ULONG ContentId, + OUT PDRMRIGHTS DrmRights); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/reactos/include/ddk/dvp.h b/reactos/include/ddk/dvp.h index 1730b514ecb..c08d70a6020 100644 --- a/reactos/include/ddk/dvp.h +++ b/reactos/include/ddk/dvp.h @@ -3,7 +3,7 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: + * FILE: * PURPOSE: Directx headers * PROGRAMMER: Magnus Olsen (greatlrd) * @@ -51,7 +51,7 @@ typedef struct _DDVIDEOPORTCONNECT ULONG_PTR dwReserved1; } DDVIDEOPORTCONNECT, *LPDDVIDEOPORTCONNECT; -typedef struct _DDVIDEOPORTDESC +typedef struct _DDVIDEOPORTDESC { DWORD dwSize; DWORD dwFieldWidth; @@ -69,32 +69,32 @@ typedef struct _DDVIDEOPORTDESC typedef struct _DDVIDEOPORTBANDWIDTH { DWORD dwSize; - DWORD dwOverlay; - DWORD dwColorkey; + DWORD dwOverlay; + DWORD dwColorkey; DWORD dwYInterpolate; DWORD dwYInterpAndColorkey; - ULONG_PTR dwReserved1; - ULONG_PTR dwReserved2; + ULONG_PTR dwReserved1; + ULONG_PTR dwReserved2; } DDVIDEOPORTBANDWIDTH, *LPDDVIDEOPORTBANDWIDTH; typedef struct _DDVIDEOPORTCAPS { - DWORD dwSize; - DWORD dwFlags; - DWORD dwMaxWidth; + DWORD dwSize; + DWORD dwFlags; + DWORD dwMaxWidth; DWORD dwMaxVBIWidth; - DWORD dwMaxHeight; + DWORD dwMaxHeight; DWORD dwVideoPortID; - DWORD dwCaps; - DWORD dwFX; + DWORD dwCaps; + DWORD dwFX; DWORD dwNumAutoFlipSurfaces; - DWORD dwAlignVideoPortBoundary; + DWORD dwAlignVideoPortBoundary; DWORD dwAlignVideoPortPrescaleWidth; - DWORD dwAlignVideoPortCropBoundary; - DWORD dwAlignVideoPortCropWidth; - DWORD dwPreshrinkXStep; - DWORD dwPreshrinkYStep; - DWORD dwNumVBIAutoFlipSurfaces; + DWORD dwAlignVideoPortCropBoundary; + DWORD dwAlignVideoPortCropWidth; + DWORD dwPreshrinkXStep; + DWORD dwPreshrinkYStep; + DWORD dwNumVBIAutoFlipSurfaces; DWORD dwNumPreferredAutoflip; WORD wNumFilterTapsX; WORD wNumFilterTapsY; @@ -130,10 +130,10 @@ typedef struct _DDVIDEOPORTSTATUS typedef struct _DDVIDEOPORTNOTIFY { - LARGE_INTEGER ApproximateTimeStamp; - LONG lField; - UINT dwSurfaceIndex; - LONG lDone; + LARGE_INTEGER ApproximateTimeStamp; + LONG lField; + UINT dwSurfaceIndex; + LONG lDone; } DDVIDEOPORTNOTIFY, *LPDDVIDEOPORTNOTIFY; @@ -246,10 +246,10 @@ typedef HRESULT (*LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); #undef INTERFACE #define INTERFACE IDDVideoPortContainer DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT *, IUnknown *) PURE; STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE; STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE; @@ -279,10 +279,10 @@ typedef HRESULT (*LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); #undef INTERFACE #define INTERFACE IDirectDrawVideoPort DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE; STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; @@ -343,10 +343,10 @@ typedef HRESULT (*LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); #define INTERFACE IDirectDrawVideoPortNotify DECLARE_INTERFACE_( IDirectDrawVideoPortNotify, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(AcquireNotification)(THIS_ HANDLE *, LPDDVIDEOPORTNOTIFY) PURE; STDMETHOD(ReleaseNotification)(THIS_ HANDLE) PURE; }; @@ -369,5 +369,5 @@ typedef HRESULT (*LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); #ifdef __cplusplus }; #endif -#endif +#endif #endif diff --git a/reactos/include/ddk/dxapi.h b/reactos/include/ddk/dxapi.h index 2ecf0657523..9d65a468fe2 100644 --- a/reactos/include/ddk/dxapi.h +++ b/reactos/include/ddk/dxapi.h @@ -1,4 +1,4 @@ ULONG DxApiGetVersion(); -ULONG DxApi( IN ULONG dwFunctionNum,IN PVOID lpvInBuffer, IN ULONG cbInBuffer, +ULONG DxApi( IN ULONG dwFunctionNum,IN PVOID lpvInBuffer, IN ULONG cbInBuffer, IN PVOID lpvOutBuffer, IN ULONG cbOutBuffer); diff --git a/reactos/include/ddk/ide.h b/reactos/include/ddk/ide.h index e8eeb9ad800..b3e0e0692cf 100644 --- a/reactos/include/ddk/ide.h +++ b/reactos/include/ddk/ide.h @@ -272,7 +272,7 @@ PciIdeXSetBusData( IN ULONG ConfigDataOffset, IN ULONG BufferLength); -/* Bit field values for +/* Bit field values for * PCIIDE_TRANSFER_MODE_SELECT.DeviceTransferModeSupported and * IDE_CONTROLLER_PROPERTIES.SupportedTransferMode */ diff --git a/reactos/include/ddk/ieverp.h b/reactos/include/ddk/ieverp.h index d19c1a5d9c0..d8afbdd0215 100644 --- a/reactos/include/ddk/ieverp.h +++ b/reactos/include/ddk/ieverp.h @@ -2,7 +2,7 @@ #define VER_MAJOR_PRODUCTVER 6 #define VER_MINOR_PRODUCTVER 0 -#undef VER_PRODUCTBUILD +#undef VER_PRODUCTBUILD #define VER_PRODUCTBUILD 2900 #define VER_PRODUCTVERSION VER_MAJOR_PRODUCTVER,VER_MINOR_PRODUCTVER,VER_PRODUCTBUILD,VER_PRODUCTBUILD_QFE #define VER_PRODUCTVERSION_W (0x0600) diff --git a/reactos/include/ddk/kcom.h b/reactos/include/ddk/kcom.h index d2bbe44dc93..1d097cb8267 100644 --- a/reactos/include/ddk/kcom.h +++ b/reactos/include/ddk/kcom.h @@ -7,7 +7,7 @@ #if defined(__cplusplus) extern "C" { -#endif +#endif #define STATIC_KoCreateObject 0x72CF721CL, 0x525A, 0x11D1, 0x9A, 0xA1, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 DEFINE_GUIDSTRUCT("72CF721C-525A-11D1-9AA1-00A0C9223196", KoCreateObject); @@ -27,14 +27,14 @@ interface __declspec(uuid("21B36996-8DE3-11D1-8AE0-00A0C9223196")) IKoInitialize #ifndef COMDDKMETHOD #ifdef _COMDDK_ #define COMDDKMETHOD -#else +#else #define COMDDKMETHOD DECLSPEC_IMPORT #endif #endif #ifdef _COMDDK_ #define COMDDKAPI -#else +#else #define COMDDKAPI DECLSPEC_IMPORT #endif diff --git a/reactos/include/ddk/ksdebug.h b/reactos/include/ddk/ksdebug.h index c6b1723e7ff..fc1137b0df6 100644 --- a/reactos/include/ddk/ksdebug.h +++ b/reactos/include/ddk/ksdebug.h @@ -10,7 +10,7 @@ #if defined(__cplusplus) extern "C" { -#endif +#endif #if defined(_NTDDK_) #define DEBUGLVL_ERROR 0 diff --git a/reactos/include/ddk/lmon.h b/reactos/include/ddk/lmon.h index 4a35c759403..20fbfe831a4 100644 --- a/reactos/include/ddk/lmon.h +++ b/reactos/include/ddk/lmon.h @@ -10,14 +10,14 @@ #define LPPORT_INFO_FF LPPORT_INFO_FFA #endif -typedef struct _PORT_INFO_FFW +typedef struct _PORT_INFO_FFW { LPWSTR pName; DWORD cbMonitorData; LPBYTE pMonitorData; } PORT_INFO_FFW, *PPORT_INFO_FFW, *LPPORT_INFO_FFW; -typedef struct _PORT_INFO_FFA +typedef struct _PORT_INFO_FFA { LPSTR pName; DWORD cbMonitorData; diff --git a/reactos/include/ddk/ntddbeep.h b/reactos/include/ddk/ntddbeep.h index bcb5f54ed42..9e10b0682c0 100644 --- a/reactos/include/ddk/ntddbeep.h +++ b/reactos/include/ddk/ntddbeep.h @@ -13,7 +13,7 @@ extern "C" { #define BEEP_FREQUENCY_MAXIMUM 0x7FFF #define IOCTL_BEEP_SET CTL_CODE(FILE_DEVICE_BEEP, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) -typedef struct _BEEP_SET_PARAMETERS +typedef struct _BEEP_SET_PARAMETERS { ULONG Frequency; ULONG Duration; @@ -22,5 +22,5 @@ typedef struct _BEEP_SET_PARAMETERS #ifdef __cplusplus } #endif -#endif +#endif diff --git a/reactos/include/ddk/ntddft.h b/reactos/include/ddk/ntddft.h index 4966eb2e6f2..72ca3ac6c5b 100644 --- a/reactos/include/ddk/ntddft.h +++ b/reactos/include/ddk/ntddft.h @@ -17,5 +17,5 @@ extern "C" { #ifdef __cplusplus } #endif -#endif +#endif diff --git a/reactos/include/ddk/ntddtdi.h b/reactos/include/ddk/ntddtdi.h index 4f77fe00128..04b725bfb92 100644 --- a/reactos/include/ddk/ntddtdi.h +++ b/reactos/include/ddk/ntddtdi.h @@ -27,4 +27,4 @@ extern "C" { } #endif -#endif +#endif diff --git a/reactos/include/ddk/ntnls.h b/reactos/include/ddk/ntnls.h index 2e141202251..3e52ddc4d87 100644 --- a/reactos/include/ddk/ntnls.h +++ b/reactos/include/ddk/ntnls.h @@ -7,7 +7,7 @@ extern "C" { #endif #define MAXIMUM_LEADBYTES 12 -typedef struct _CPTABLEINFO +typedef struct _CPTABLEINFO { USHORT CodePage; USHORT MaximumCharacterSize; @@ -23,7 +23,7 @@ typedef struct _CPTABLEINFO PUSHORT DBCSOffsets; } CPTABLEINFO, *PCPTABLEINFO; -typedef struct _NLSTABLEINFO +typedef struct _NLSTABLEINFO { CPTABLEINFO OemTableInfo; CPTABLEINFO AnsiTableInfo; @@ -34,4 +34,4 @@ typedef struct _NLSTABLEINFO #ifdef __cplusplus } #endif -#endif +#endif diff --git a/reactos/include/ddk/objerror.h b/reactos/include/ddk/objerror.h index d9d3a0a6788..71c94c89277 100644 --- a/reactos/include/ddk/objerror.h +++ b/reactos/include/ddk/objerror.h @@ -3,7 +3,7 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: + * FILE: * PURPOSE: Directx headers * PROGRAMMER: Magnus Olsen (greatlrd) * diff --git a/reactos/include/ddk/polarity.h b/reactos/include/ddk/polarity.h index cc4b75aee9c..0043605de41 100644 --- a/reactos/include/ddk/polarity.h +++ b/reactos/include/ddk/polarity.h @@ -2,8 +2,8 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: - * PURPOSE: + * FILE: + * PURPOSE: * PROGRAMMER: Magnus Olsen (greatlrd) * */ @@ -14,7 +14,7 @@ #ifdef USE_POLARITY #ifdef BUILDING_DLL #define POLARITY __declspec( dllexport ) - #else + #else #define POLARITY __declspec( dllimport ) #endif #else diff --git a/reactos/include/ddk/portcls.h b/reactos/include/ddk/portcls.h index 6476359b7ac..d5f92ee194d 100644 --- a/reactos/include/ddk/portcls.h +++ b/reactos/include/ddk/portcls.h @@ -14,87 +14,87 @@ == EXPORTS == DRM (new in XP): - * PcAddContentHandlers + * PcAddContentHandlers * PcCreateContentMixed * PcDestroyContent - * PcForwardContentToDeviceObject + * PcForwardContentToDeviceObject * PcForwardContentToFileObject * PcForwardContentToInterface * PcGetContentRights IRP HANDLING: - * PcCompleteIrp - * PcDispatchIrp + * PcCompleteIrp + * PcDispatchIrp * PcForwardIrpSynchronous ADAPTER: - * PcAddAdapterDevice - * PcInitializeAdapterDriver + * PcAddAdapterDevice + * PcInitializeAdapterDriver FACTORIES: - * PcNewDmaChannel - * PcNewInterruptSync - * PcNewMiniport - * PcNewPort - * PcNewRegistryKey - * PcNewResourceList - * PcNewResourceSublist - * PcNewServiceGroup + * PcNewDmaChannel + * PcNewInterruptSync + * PcNewMiniport + * PcNewPort + * PcNewRegistryKey + * PcNewResourceList + * PcNewResourceSublist + * PcNewServiceGroup POWER MANAGEMENT: - * PcRegisterAdapterPowerManagement + * PcRegisterAdapterPowerManagement * PcRequestNewPowerState PROPERTIES: - * PcCompletePendingPropertyRequest - * PcGetDeviceProperty + * PcCompletePendingPropertyRequest + * PcGetDeviceProperty IO TIMEOUTS: * PcRegisterIoTimeout * PcUnregisterIoTimeout PHYSICAL CONNECTIONS: - * PcRegisterPhysicalConnection - * PcRegisterPhysicalConnectionFromExternal - * PcRegisterPhysicalConnectionToExternal + * PcRegisterPhysicalConnection + * PcRegisterPhysicalConnectionFromExternal + * PcRegisterPhysicalConnectionToExternal MISC: - * PcGetTimeInterval - * PcRegisterSubdevice + * PcGetTimeInterval + * PcRegisterSubdevice == AUDIO HELPER OBJECT INTERFACES == - IDmaChannel - IDmaChannelSlave - IDmaOperations + IDmaChannel + IDmaChannelSlave + IDmaOperations IDrmPort (XP) IDrmPort2 (XP) - IInterruptSync - IMasterClock + IInterruptSync + IMasterClock IPortClsVersion (XP) - IPortEvents + IPortEvents IPreFetchOffset (XP) IRegistryKey - IResourceList - IServiceGroup + IResourceList + IServiceGroup IServiceSink IUnregisterPhysicalConnection (Vista) IUnregisterSubdevice (Vista) == AUDIO PORT OBJECT INTERFACES == - IPort - IPortDMus - IPortMidi - IPortTopology - IPortWaveCyclic + IPort + IPortDMus + IPortMidi + IPortTopology + IPortWaveCyclic IPortWavePci == AUDIO MINIPORT OBJECT INTERFACES == - IMiniport - IMiniportDMus - IMiniportMidi - IMiniportTopology - IMiniportWaveCyclic + IMiniport + IMiniportDMus + IMiniportMidi + IMiniportTopology + IMiniportWaveCyclic IMiniportWavePci == AUDIO MINIPORT AUXILIARY INTERFACES == @@ -102,17 +102,17 @@ IPinCount (XP) == AUDIO STREAM OBJECT INTERFACES == - IAllocatorMXF + IAllocatorMXF IDrmAudioStream (XP) - IMiniportMidiStream - IMiniportWaveCyclicStream - IMiniportWavePciStream - IMXF - IPortWavePciStream + IMiniportMidiStream + IMiniportWaveCyclicStream + IMiniportWavePciStream + IMXF + IPortWavePciStream ISynthSinkDMus == DIRECTMUSIC USERMODE SYNTH AND SYNTH SINK INTERFACES == - IDirectMusicSynth + IDirectMusicSynth IDirectMusicSynthSink == AUDIO POWER MANAGEMENT INTERFACES == diff --git a/reactos/include/ddk/punknown.h b/reactos/include/ddk/punknown.h index 75d2ef3bb4a..ef75fb87c75 100644 --- a/reactos/include/ddk/punknown.h +++ b/reactos/include/ddk/punknown.h @@ -1,81 +1,81 @@ -/* - ReactOS Kernel-Mode COM - by Andrew Greenwood - - Please see COPYING in the top-level directory for license information. -*/ - -#ifndef _UNKNOWN_H_ -#define _UNKNOWN_H_ - -#include -#define COM_NO_WINDOWS_H -#include - -#ifdef PUT_GUIDS_HERE - #include -#endif - - -/* =============================================================== - IUnknown -*/ - +/* + ReactOS Kernel-Mode COM + by Andrew Greenwood + + Please see COPYING in the top-level directory for license information. +*/ + +#ifndef _UNKNOWN_H_ +#define _UNKNOWN_H_ + +#include +#define COM_NO_WINDOWS_H +#include + +#ifdef PUT_GUIDS_HERE + #include +#endif + + +/* =============================================================== + IUnknown +*/ + #ifndef __IUnknown_INTERFACE_DEFINED__ -#define __IUnknown_INTERFACE_DEFINED__ -DEFINE_GUID( - IID_IUnknown, - 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x46); - -#undef INTERFACE -#define INTERFACE IUnknown - -DECLARE_INTERFACE(IUnknown) -{ - STDMETHOD_(NTSTATUS, QueryInterface)( THIS_ - IN REFIID, - OUT PVOID*) - PURE; - - STDMETHOD_(ULONG, AddRef)( THIS ) - PURE; - - STDMETHOD_(ULONG, Release)( THIS ) - PURE; -}; -#endif - -#undef INTERFACE - -typedef IUnknown *PUNKNOWN; - - -/* =============================================================== - IUnknown definition - Boilerplate code macro for use in subclassed interfaces -*/ - -#define DEFINE_ABSTRACT_UNKNOWN() \ - STDMETHOD_(NTSTATUS, QueryInterface)( THIS_ \ - REFIID InterfaceId, \ - PVOID* Interface) \ - PURE; \ -\ - STDMETHOD_(ULONG, AddRef)(THIS) \ - PURE; \ -\ - STDMETHOD_(ULONG, Release)(THIS) \ - PURE; - - -/* =============================================================== - Constructor callback definition -*/ - -typedef HRESULT (*PFNCREATEINSTANCE)( - OUT PUNKNOWN* Unknown, - IN REFCLSID ClassId, - IN PUNKNOWN OuterUnknown, - IN POOL_TYPE PoolType); - -#endif +#define __IUnknown_INTERFACE_DEFINED__ +DEFINE_GUID( + IID_IUnknown, + 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x46); + +#undef INTERFACE +#define INTERFACE IUnknown + +DECLARE_INTERFACE(IUnknown) +{ + STDMETHOD_(NTSTATUS, QueryInterface)( THIS_ + IN REFIID, + OUT PVOID*) + PURE; + + STDMETHOD_(ULONG, AddRef)( THIS ) + PURE; + + STDMETHOD_(ULONG, Release)( THIS ) + PURE; +}; +#endif + +#undef INTERFACE + +typedef IUnknown *PUNKNOWN; + + +/* =============================================================== + IUnknown definition + Boilerplate code macro for use in subclassed interfaces +*/ + +#define DEFINE_ABSTRACT_UNKNOWN() \ + STDMETHOD_(NTSTATUS, QueryInterface)( THIS_ \ + REFIID InterfaceId, \ + PVOID* Interface) \ + PURE; \ +\ + STDMETHOD_(ULONG, AddRef)(THIS) \ + PURE; \ +\ + STDMETHOD_(ULONG, Release)(THIS) \ + PURE; + + +/* =============================================================== + Constructor callback definition +*/ + +typedef HRESULT (*PFNCREATEINSTANCE)( + OUT PUNKNOWN* Unknown, + IN REFCLSID ClassId, + IN PUNKNOWN OuterUnknown, + IN POOL_TYPE PoolType); + +#endif diff --git a/reactos/include/ddk/stdunk.h b/reactos/include/ddk/stdunk.h index d653216a1f6..d2c72e63275 100644 --- a/reactos/include/ddk/stdunk.h +++ b/reactos/include/ddk/stdunk.h @@ -1,218 +1,218 @@ -/* - ReactOS Kernel-Mode COM - IUnknown implementations - - LICENSE - Please see COPYING in the top-level directory for license information. - - AUTHORS - Andrew Greenwood -*/ - -#ifndef STDUNK_H -#define STDUNK_H - -#define STDUNK_TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) - -#include - -/* =============================================================== - INonDelegatingUnknown interface -*/ - -DECLARE_INTERFACE(INonDelegatingUnknown) -{ - STDMETHOD_(NTSTATUS, NonDelegatingQueryInterface)( THIS_ - IN REFIID, - OUT PVOID*) PURE; - - STDMETHOD_(ULONG, NonDelegatingAddRef)( THIS ) PURE; - STDMETHOD_(ULONG, NonDelegatingRelease)( THIS ) PURE; -}; - -typedef INonDelegatingUnknown *PNONDELEGATINGUNKNOWN; - - -/* =============================================================== - CUnknown declaration / definition - - There are 2 variants for this, and I'm not sure if the C - version is correct. -*/ - -#ifdef __cplusplus - -class CUnknown : public INonDelegatingUnknown -{ - private : - LONG m_ref_count; - PUNKNOWN m_outer_unknown; - - public : - /* CUnknown */ - CUnknown(PUNKNOWN pUnknownOuter); - virtual ~CUnknown(); - - PUNKNOWN GetOuterUnknown() - { return m_outer_unknown; } - - /* INonDelegatingUnknown */ - STDMETHODIMP_(ULONG) NonDelegatingAddRef(); - STDMETHODIMP_(ULONG) NonDelegatingRelease(); - - STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface( - REFIID rIID, - PVOID* ppVoid); -}; - -#define DECLARE_STD_UNKNOWN() \ - STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface( \ - REFIID iid, \ - PVOID* ppvObject); \ -\ - STDMETHODIMP_(NTSTATUS) QueryInterface( \ - REFIID riid, \ - void** ppv) \ - { \ - return GetOuterUnknown()->QueryInterface(riid, ppv); \ - } \ -\ - STDMETHODIMP_(ULONG) AddRef() \ - { \ - return GetOuterUnknown()->AddRef(); \ - } \ -\ - STDMETHODIMP_(ULONG) Release() \ - { \ - return GetOuterUnknown()->Release(); \ - } - -#define DEFINE_STD_CONSTRUCTOR(classname) \ - classname(PUNKNOWN outer_unknown) \ - : CUnknown(outer_unknown) \ - { } - -#else /* Not C++ - this is probably very buggy... */ - -STDMETHODCALLTYPE -NTSTATUS -Unknown_QueryInterface( - IUnknown* this, - IN REFIID refiid, - OUT PVOID* output); - -STDMETHODCALLTYPE -ULONG -Unknown_AddRef( - IUnknown* unknown_this); - -STDMETHODCALLTYPE -ULONG -Unknown_Release( - IUnknown* unknown_this); - -typedef struct CUnknown -{ - union - { - IUnknown IUnknown; - INonDelegatingUnknown INonDelegatingUnknown; - }; - - LONG m_ref_count; - PUNKNOWN m_outer_unknown; -} CUnknown; - -#endif /* __cplusplus */ - - - -#ifdef __cplusplus - - -/* =============================================================== - Construction helpers -*/ - -#define QICAST(typename) \ - PVOID( (typename) (this) ) - -#define QICASTUNKNOWN(typename) \ - PVOID( PUNKNOWN( (typename) (this) ) ) - -#define STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, tag, base) \ - classname *new_ptr = new(pool_type, tag) classname(outer_unknown); \ -\ - if ( ! new_ptr ) \ - return STATUS_INSUFFICIENT_RESOURCES; \ -\ - *unknown = PUNKNOWN((base)(new_ptr)); \ - (*unknown)->AddRef(); \ - return STATUS_SUCCESS - -#define STD_CREATE_BODY_WITH_TAG(classname, unknown, outer_unknown, pool_type, tag, base) \ - STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, tag, PUNKNOWN) - -#define STD_CREATE_BODY_(classname, unknown, outer_unknown, pool_type, base) \ - STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, STDUNK_TAG('r','C','c','P'), base) - -#define STD_CREATE_BODY(classname, unknown, outer_unknown, pool_type) \ - STD_CREATE_BODY_(classname, unknown, outer_unknown, pool_type, PUNKNOWN) - - -/* =============================================================== - Custom "new" and "delete" C++ operators -*/ - -#ifndef ALLOCATION_OPERATORS_DEFINED -#define ALLOCATION_OPERATORS_DEFINED - -inline PVOID -KCOM_New( - size_t size, - POOL_TYPE pool_type, - ULONG tag) -{ - PVOID result; - - result = ExAllocatePoolWithTag(pool_type, size, tag); - - if ( result ) - RtlZeroMemory(result, size); - - return result; -} - -inline PVOID -operator new ( - size_t size, - POOL_TYPE pool_type) -{ - return KCOM_New(size, pool_type, STDUNK_TAG ('w','N','c','P')); -} - -inline PVOID -operator new ( - size_t size, - POOL_TYPE pool_type, - ULONG tag) -{ - return KCOM_New(size, pool_type, tag); -} - -inline void __cdecl -operator delete( - PVOID ptr) -{ - ExFreePool(ptr); -} - -#endif /* ALLOCATION_OPERATORS_DEFINED */ - - -#else /* Being compiled with C */ - - -#endif /* __cplusplus */ - -#endif /* include guard */ +/* + ReactOS Kernel-Mode COM + IUnknown implementations + + LICENSE + Please see COPYING in the top-level directory for license information. + + AUTHORS + Andrew Greenwood +*/ + +#ifndef STDUNK_H +#define STDUNK_H + +#define STDUNK_TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) + +#include + +/* =============================================================== + INonDelegatingUnknown interface +*/ + +DECLARE_INTERFACE(INonDelegatingUnknown) +{ + STDMETHOD_(NTSTATUS, NonDelegatingQueryInterface)( THIS_ + IN REFIID, + OUT PVOID*) PURE; + + STDMETHOD_(ULONG, NonDelegatingAddRef)( THIS ) PURE; + STDMETHOD_(ULONG, NonDelegatingRelease)( THIS ) PURE; +}; + +typedef INonDelegatingUnknown *PNONDELEGATINGUNKNOWN; + + +/* =============================================================== + CUnknown declaration / definition + + There are 2 variants for this, and I'm not sure if the C + version is correct. +*/ + +#ifdef __cplusplus + +class CUnknown : public INonDelegatingUnknown +{ + private : + LONG m_ref_count; + PUNKNOWN m_outer_unknown; + + public : + /* CUnknown */ + CUnknown(PUNKNOWN pUnknownOuter); + virtual ~CUnknown(); + + PUNKNOWN GetOuterUnknown() + { return m_outer_unknown; } + + /* INonDelegatingUnknown */ + STDMETHODIMP_(ULONG) NonDelegatingAddRef(); + STDMETHODIMP_(ULONG) NonDelegatingRelease(); + + STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface( + REFIID rIID, + PVOID* ppVoid); +}; + +#define DECLARE_STD_UNKNOWN() \ + STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface( \ + REFIID iid, \ + PVOID* ppvObject); \ +\ + STDMETHODIMP_(NTSTATUS) QueryInterface( \ + REFIID riid, \ + void** ppv) \ + { \ + return GetOuterUnknown()->QueryInterface(riid, ppv); \ + } \ +\ + STDMETHODIMP_(ULONG) AddRef() \ + { \ + return GetOuterUnknown()->AddRef(); \ + } \ +\ + STDMETHODIMP_(ULONG) Release() \ + { \ + return GetOuterUnknown()->Release(); \ + } + +#define DEFINE_STD_CONSTRUCTOR(classname) \ + classname(PUNKNOWN outer_unknown) \ + : CUnknown(outer_unknown) \ + { } + +#else /* Not C++ - this is probably very buggy... */ + +STDMETHODCALLTYPE +NTSTATUS +Unknown_QueryInterface( + IUnknown* this, + IN REFIID refiid, + OUT PVOID* output); + +STDMETHODCALLTYPE +ULONG +Unknown_AddRef( + IUnknown* unknown_this); + +STDMETHODCALLTYPE +ULONG +Unknown_Release( + IUnknown* unknown_this); + +typedef struct CUnknown +{ + union + { + IUnknown IUnknown; + INonDelegatingUnknown INonDelegatingUnknown; + }; + + LONG m_ref_count; + PUNKNOWN m_outer_unknown; +} CUnknown; + +#endif /* __cplusplus */ + + + +#ifdef __cplusplus + + +/* =============================================================== + Construction helpers +*/ + +#define QICAST(typename) \ + PVOID( (typename) (this) ) + +#define QICASTUNKNOWN(typename) \ + PVOID( PUNKNOWN( (typename) (this) ) ) + +#define STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, tag, base) \ + classname *new_ptr = new(pool_type, tag) classname(outer_unknown); \ +\ + if ( ! new_ptr ) \ + return STATUS_INSUFFICIENT_RESOURCES; \ +\ + *unknown = PUNKNOWN((base)(new_ptr)); \ + (*unknown)->AddRef(); \ + return STATUS_SUCCESS + +#define STD_CREATE_BODY_WITH_TAG(classname, unknown, outer_unknown, pool_type, tag, base) \ + STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, tag, PUNKNOWN) + +#define STD_CREATE_BODY_(classname, unknown, outer_unknown, pool_type, base) \ + STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, STDUNK_TAG('r','C','c','P'), base) + +#define STD_CREATE_BODY(classname, unknown, outer_unknown, pool_type) \ + STD_CREATE_BODY_(classname, unknown, outer_unknown, pool_type, PUNKNOWN) + + +/* =============================================================== + Custom "new" and "delete" C++ operators +*/ + +#ifndef ALLOCATION_OPERATORS_DEFINED +#define ALLOCATION_OPERATORS_DEFINED + +inline PVOID +KCOM_New( + size_t size, + POOL_TYPE pool_type, + ULONG tag) +{ + PVOID result; + + result = ExAllocatePoolWithTag(pool_type, size, tag); + + if ( result ) + RtlZeroMemory(result, size); + + return result; +} + +inline PVOID +operator new ( + size_t size, + POOL_TYPE pool_type) +{ + return KCOM_New(size, pool_type, STDUNK_TAG ('w','N','c','P')); +} + +inline PVOID +operator new ( + size_t size, + POOL_TYPE pool_type, + ULONG tag) +{ + return KCOM_New(size, pool_type, tag); +} + +inline void __cdecl +operator delete( + PVOID ptr) +{ + ExFreePool(ptr); +} + +#endif /* ALLOCATION_OPERATORS_DEFINED */ + + +#else /* Being compiled with C */ + + +#endif /* __cplusplus */ + +#endif /* include guard */ diff --git a/reactos/include/ddk/usb.h b/reactos/include/ddk/usb.h index 8807ef09ecd..4a294b1269f 100644 --- a/reactos/include/ddk/usb.h +++ b/reactos/include/ddk/usb.h @@ -87,7 +87,7 @@ typedef struct _USBD_INTERFACE_INFORMATION UCHAR Protocol; UCHAR Reserved; USBD_INTERFACE_HANDLE InterfaceHandle; - ULONG NumberOfPipes; + ULONG NumberOfPipes; USBD_PIPE_INFORMATION Pipes[1]; } USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; @@ -318,7 +318,7 @@ struct _URB_ISOCH_TRANSFER ULONG StartFrame; ULONG NumberOfPackets; ULONG ErrorCount; - USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; + USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; }; typedef struct _URB @@ -497,6 +497,6 @@ typedef struct _URB #define MS_GENRE_DESCRIPTOR_INDEX 0x0001 #define MS_POWER_DESCRIPTOR_INDEX 0x0002 #define MS_OS_STRING_SIGNATURE L"MSFT100" -#define USBD_PIPE_DIRECTION_IN(pipeInformation) ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) +#define USBD_PIPE_DIRECTION_IN(pipeInformation) ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) #endif /* __USB_H */ diff --git a/reactos/include/ddk/usb200.h b/reactos/include/ddk/usb200.h index b751541d454..8376c97a16f 100644 --- a/reactos/include/ddk/usb200.h +++ b/reactos/include/ddk/usb200.h @@ -28,7 +28,7 @@ typedef union _BM_REQUEST_TYPE UCHAR Type:2; UCHAR Dir:1; }; - UCHAR B; + UCHAR B; } BM_REQUEST_TYPE, *PBM_REQUEST_TYPE; typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET diff --git a/reactos/include/ddk/usbprint.h b/reactos/include/ddk/usbprint.h index eb30434f7d3..b2ebd838471 100644 --- a/reactos/include/ddk/usbprint.h +++ b/reactos/include/ddk/usbprint.h @@ -1,17 +1,17 @@ #define USBPRINT_IOCTL_INDEX 0x0000 #define IOCTL_USBPRINT_GET_LPT_STATUS \ - CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+12, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+12, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_USBPRINT_GET_1284_ID \ - CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+13, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+13, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_USBPRINT_VENDOR_SET_COMMAND \ - CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+14, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_USBPRINT_VENDOR_SET_COMMAND \ + CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+14, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_USBPRINT_VENDOR_GET_COMMAND \ - CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+15, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+15, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_USBPRINT_SOFT_RESET \ - CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+16, METHOD_BUFFERED, FILE_ANY_ACCESS) + CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+16, METHOD_BUFFERED, FILE_ANY_ACCESS) diff --git a/reactos/include/ddk/wdm.h b/reactos/include/ddk/wdm.h index c010038f1ee..59814ebdf79 100644 --- a/reactos/include/ddk/wdm.h +++ b/reactos/include/ddk/wdm.h @@ -1,24 +1,24 @@ -/* - WDM (far from finished!) -*/ - -#ifndef WDM_H -#define WDM_H - -typedef int CM_RESOURCE_TYPE; - -#define CmResourceTypeNull 0 -#define CmResourceTypePort 1 -#define CmResourceTypeInterrupt 2 -#define CmResourceTypeMemory 3 -#define CmResourceTypeDma 4 -#define CmResourceTypeDeviceSpecific 5 -#define CmResourceTypeBusNumber 6 -#define CmResourceTypeNonArbitrated 128 -#define CmResourceTypeConfigData 128 -#define CmResourceTypeDevicePrivate 129 -#define CmResourceTypePcCardConfig 130 -#define CmResourceTypeMfCardConfig 131 - -#endif - +/* + WDM (far from finished!) +*/ + +#ifndef WDM_H +#define WDM_H + +typedef int CM_RESOURCE_TYPE; + +#define CmResourceTypeNull 0 +#define CmResourceTypePort 1 +#define CmResourceTypeInterrupt 2 +#define CmResourceTypeMemory 3 +#define CmResourceTypeDma 4 +#define CmResourceTypeDeviceSpecific 5 +#define CmResourceTypeBusNumber 6 +#define CmResourceTypeNonArbitrated 128 +#define CmResourceTypeConfigData 128 +#define CmResourceTypeDevicePrivate 129 +#define CmResourceTypePcCardConfig 130 +#define CmResourceTypeMfCardConfig 131 + +#endif + diff --git a/reactos/include/ddk/winddi.h b/reactos/include/ddk/winddi.h index a007c9cbf2e..d9e40e2963a 100644 --- a/reactos/include/ddk/winddi.h +++ b/reactos/include/ddk/winddi.h @@ -316,7 +316,7 @@ typedef struct _DEVINFO { typedef struct _DRIVEROBJ *PDRIVEROBJ; -typedef BOOL +typedef BOOL (APIENTRY CALLBACK *FREEOBJPROC)( IN PDRIVEROBJ pDriverObj); @@ -3499,7 +3499,7 @@ DrvUnloadFontFile( #define WOC_SPRITE_OVERLAP 0x00000080 #define WOC_SPRITE_NO_OVERLAP 0x00000100 -typedef VOID +typedef VOID (APIENTRY CALLBACK * WNDOBJCHANGEPROC)( WNDOBJ *pwo, FLONG fl); @@ -3515,12 +3515,12 @@ typedef BOOL IN RECTL *prclSrc, IN BLENDOBJ *pBlendObj); -typedef BOOL +typedef BOOL (APIENTRY *PFN_DrvAssertMode)( IN DHPDEV dhpdev, IN BOOL bEnable); -typedef BOOL +typedef BOOL (APIENTRY *PFN_DrvBitBlt)( IN SURFOBJ *psoTrg, IN SURFOBJ *psoSrc, @@ -3534,12 +3534,12 @@ typedef BOOL IN POINTL *pptlBrush, IN ROP4 rop4); -typedef VOID +typedef VOID (APIENTRY *PFN_DrvCompletePDEV)( IN DHPDEV dhpdev, IN HDEV hdev); -typedef BOOL +typedef BOOL (APIENTRY *PFN_DrvCopyBits)( IN SURFOBJ *psoDest, IN SURFOBJ *psoSrc, @@ -3548,52 +3548,52 @@ typedef BOOL IN RECTL *prclDest, IN POINTL *pptlSrc); -typedef HBITMAP +typedef HBITMAP (APIENTRY *PFN_DrvCreateDeviceBitmap)( IN DHPDEV dhpdev, IN SIZEL sizl, IN ULONG iFormat); -typedef VOID +typedef VOID (APIENTRY *PFN_DrvDeleteDeviceBitmap)( IN DHSURF dhsurf); -typedef HBITMAP +typedef HBITMAP (APIENTRY *PFN_DrvDeriveSurface)( DD_DIRECTDRAW_GLOBAL *pDirectDraw, DD_SURFACE_LOCAL *pSurface); -typedef LONG +typedef LONG (APIENTRY *PFN_DrvDescribePixelFormat)( IN DHPDEV dhpdev, IN LONG iPixelFormat, IN ULONG cjpfd, OUT PIXELFORMATDESCRIPTOR *ppfd); -typedef VOID +typedef VOID (APIENTRY *PFN_DrvDestroyFont)( IN FONTOBJ *pfo); -typedef VOID +typedef VOID (APIENTRY *PFN_DrvDisableDriver)( VOID); -typedef VOID +typedef VOID (APIENTRY *PFN_DrvDisablePDEV)( IN DHPDEV dhpdev); -typedef VOID +typedef VOID (APIENTRY *PFN_DrvDisableSurface)( IN DHPDEV dhpdev); -typedef ULONG +typedef ULONG (APIENTRY *PFN_DrvDitherColor)( IN DHPDEV dhpdev, IN ULONG iMode, IN ULONG rgb, OUT ULONG *pul); -typedef ULONG +typedef ULONG (APIENTRY *PFN_DrvDrawEscape)( IN SURFOBJ *pso, IN ULONG iEsc, @@ -3602,13 +3602,13 @@ typedef ULONG IN ULONG cjIn, IN PVOID pvIn); -typedef BOOL +typedef BOOL (APIENTRY *PFN_DrvEnableDriver)( IN ULONG iEngineVersion, IN ULONG cj, OUT DRVENABLEDATA *pded); #if 0 -typedef DHPDEV +typedef DHPDEV (APIENTRY *PFN_DrvEnablePDEV)( IN DEVMODEW *pdm, IN LPWSTR pwszLogAddress, @@ -3622,16 +3622,16 @@ typedef DHPDEV IN LPWSTR pwszDeviceName, IN HANDLE hDriver); #endif -typedef HSURF +typedef HSURF (APIENTRY *PFN_DrvEnableSurface)( IN DHPDEV dhpdev); -typedef BOOL +typedef BOOL (APIENTRY *PFN_DrvEndDoc)( IN SURFOBJ *pso, IN FLONG fl); -typedef ULONG +typedef ULONG (APIENTRY *PFN_DrvEscape)( IN SURFOBJ *pso, IN ULONG iEsc, @@ -3640,7 +3640,7 @@ typedef ULONG IN ULONG cjOut, OUT PVOID pvOut); -typedef BOOL +typedef BOOL (APIENTRY *PFN_DrvFillPath)( IN SURFOBJ *pso, IN PATHOBJ *ppo, @@ -3650,7 +3650,7 @@ typedef BOOL IN MIX mix, IN FLONG flOptions); -typedef ULONG +typedef ULONG (APIENTRY *PFN_DrvFontManagement)( IN SURFOBJ *pso, IN FONTOBJ *pfo, @@ -3660,12 +3660,12 @@ typedef ULONG IN ULONG cjOut, OUT PVOID pvOut); -typedef VOID +typedef VOID (APIENTRY *PFN_DrvFree)( IN PVOID pv, IN ULONG_PTR id); -typedef ULONG +typedef ULONG (APIENTRY *PFN_DrvGetGlyphMode)( IN DHPDEV dhpdev, IN FONTOBJ *pfo); diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 9c2a1fdfcef..dc854f4e0d9 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -5396,7 +5396,7 @@ KeGetCurrentProcessorNumber(VOID) ); return Number; } - + #else #error Unknown architecture #endif diff --git a/reactos/include/dxsdk/DShow.h b/reactos/include/dxsdk/DShow.h index a419ecc4e51..e04f9b5bcc9 100644 --- a/reactos/include/dxsdk/DShow.h +++ b/reactos/include/dxsdk/DShow.h @@ -53,5 +53,5 @@ #define OAFALSE (0) #endif -#endif +#endif diff --git a/reactos/include/dxsdk/PIXPlugin.h b/reactos/include/dxsdk/PIXPlugin.h index 1c33aa6195b..96ef5bd6308 100644 --- a/reactos/include/dxsdk/PIXPlugin.h +++ b/reactos/include/dxsdk/PIXPlugin.h @@ -3,7 +3,7 @@ #pragma once #ifdef __cplusplus -extern "C" +extern "C" { #endif diff --git a/reactos/include/dxsdk/amparse.h b/reactos/include/dxsdk/amparse.h index ae1a192f24a..5920bfd8055 100644 --- a/reactos/include/dxsdk/amparse.h +++ b/reactos/include/dxsdk/amparse.h @@ -4,7 +4,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif DEFINE_GUID(IID_IAMParse, 0xC47A3420, 0x005C, 0x11D2, 0x90, 0x38, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x98); diff --git a/reactos/include/dxsdk/amvideo.h b/reactos/include/dxsdk/amvideo.h index b4271ee21b7..f4c219ff6d5 100644 --- a/reactos/include/dxsdk/amvideo.h +++ b/reactos/include/dxsdk/amvideo.h @@ -11,53 +11,53 @@ #ifdef __cplusplus extern "C" { -#endif +#endif #include #define AMDDS_NONE 0x00 #define AMDDS_DCIPS 0x01 -#define AMDDS_PS 0x02 -#define AMDDS_RGBOVR 0x04 -#define AMDDS_YUVOVR 0x08 -#define AMDDS_RGBOFF 0x10 -#define AMDDS_YUVOFF 0x20 -#define AMDDS_RGBFLP 0x40 -#define AMDDS_YUVFLP 0x80 -#define AMDDS_ ALL 0xFF +#define AMDDS_PS 0x02 +#define AMDDS_RGBOVR 0x04 +#define AMDDS_YUVOVR 0x08 +#define AMDDS_RGBOFF 0x10 +#define AMDDS_YUVOFF 0x20 +#define AMDDS_RGBFLP 0x40 +#define AMDDS_YUVFLP 0x80 +#define AMDDS_ ALL 0xFF #define AMDDS_DEFAULT AMDDS_ALL #define AMDDS_YUV (AMDDS_YUVOFF | AMDDS_YUVOVR | AMDDS_YUVFLP) #define AMDDS_RGB (AMDDS_RGBOFF | AMDDS_RGBOVR | AMDDS_RGBFLP) #define AMDDS_PRIMARY (AMDDS_DCIPS | AMDDS_PS) -#define iPALETTE_COLORS 256 +#define iPALETTE_COLORS 256 #define iEGA_COLORS 16 #define iMASK_COLORS 3 -#define iTRUECOLOR 16 -#define iRED 0 -#define iGREEN 1 -#define iBLUE 2 -#define iPALETTE 8 -#define iMAXBITS 8 +#define iTRUECOLOR 16 +#define iRED 0 +#define iGREEN 1 +#define iBLUE 2 +#define iPALETTE 8 +#define iMAXBITS 8 -typedef struct tag_TRUECOLORINFO +typedef struct tag_TRUECOLORINFO { DWORD dwBitMasks[iMASK_COLORS]; RGBQUAD bmiColors[iPALETTE_COLORS]; } TRUECOLORINFO; -typedef struct tagVIDEOINFOHEADER +typedef struct tagVIDEOINFOHEADER { RECT rcSource; RECT rcTarget; - DWORD dwBitRate; + DWORD dwBitRate; DWORD dwBitErrorRate; REFERENCE_TIME AvgTimePerFrame; BITMAPINFOHEADER bmiHeader; } VIDEOINFOHEADER; -typedef struct tagVIDEOINFO +typedef struct tagVIDEOINFO { RECT rcSource; RECT rcTarget; @@ -65,7 +65,7 @@ typedef struct tagVIDEOINFO DWORD dwBitErrorRate; REFERENCE_TIME AvgTimePerFrame; BITMAPINFOHEADER bmiHeader; - union + union { RGBQUAD bmiColors[iPALETTE_COLORS]; DWORD dwBitMasks[iMASK_COLORS]; @@ -73,15 +73,15 @@ typedef struct tagVIDEOINFO }; } VIDEOINFO; -typedef struct tagMPEG1VIDEOINFO +typedef struct tagMPEG1VIDEOINFO { VIDEOINFOHEADER hdr; - DWORD dwStartTimeCode; - DWORD cbSequenceHeader; - BYTE bSequenceHeader[1]; + DWORD dwStartTimeCode; + DWORD cbSequenceHeader; + BYTE bSequenceHeader[1]; } MPEG1VIDEOINFO; -typedef struct tagAnalogVideoInfo +typedef struct tagAnalogVideoInfo { RECT rcSource; RECT rcTarget; @@ -101,7 +101,7 @@ typedef struct tagAnalogVideoInfo #define SIZE_VIDEOHEADER (sizeof(BITMAPINFOHEADER) + SIZE_PREHEADER) #define WIDTHBYTES(BTIS) ((DWORD)(((BTIS)+31) & (~31)) / 8) -#define DIBWIDTHBYTES(BI) (DWORD)(BI).biBitCount) * (DWORD)WIDTHBYTES((DWORD)(BI).biWidth +#define DIBWIDTHBYTES(BI) (DWORD)(BI).biBitCount) * (DWORD)WIDTHBYTES((DWORD)(BI).biWidth #define _DIBSIZE(BI) (DIBWIDTHBYTES(BI) * (DWORD)(BI).biHeight) #define DIBSIZE(BI) ((BI).biHeight < 0 ? (-1)*(_DIBSIZE(BI)) : _DIBSIZE(BI)) @@ -184,11 +184,11 @@ DECLARE_INTERFACE_(IQualProp, IUnknown) STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD(get_FramesDroppedInRenderer)(THIS_ int *pcFrames) PURE; - STDMETHOD(get_FramesDrawn)(THIS_ int *pcFramesDrawn) PURE; - STDMETHOD(get_AvgFrameRate)(THIS_ int *piAvgFrameRate) PURE; - STDMETHOD(get_Jitter)(THIS_ int *iJitter) PURE; - STDMETHOD(get_AvgSyncOffset)(THIS_ int *piAvg) PURE; - STDMETHOD(get_DevSyncOffset)(THIS_ int *piDev) PURE; + STDMETHOD(get_FramesDrawn)(THIS_ int *pcFramesDrawn) PURE; + STDMETHOD(get_AvgFrameRate)(THIS_ int *piAvgFrameRate) PURE; + STDMETHOD(get_Jitter)(THIS_ int *iJitter) PURE; + STDMETHOD(get_AvgSyncOffset)(THIS_ int *piAvg) PURE; + STDMETHOD(get_DevSyncOffset)(THIS_ int *piDev) PURE; }; @@ -240,7 +240,7 @@ DECLARE_INTERFACE_(IFullScreenVideoEx, IFullScreenVideo) -typedef enum +typedef enum { AM_PROPERTY_FRAMESTEP_STEP = 0x01, AM_PROPERTY_FRAMESTEP_CANCEL = 0x02, @@ -256,5 +256,5 @@ typedef struct _AM_FRAMESTEP_STEP #ifdef __cplusplus } #endif -#endif +#endif diff --git a/reactos/include/dxsdk/aviriff.h b/reactos/include/dxsdk/aviriff.h index 9cfb6af33fd..261ab096d83 100644 --- a/reactos/include/dxsdk/aviriff.h +++ b/reactos/include/dxsdk/aviriff.h @@ -248,8 +248,8 @@ typedef struct _avitimedindex typedef struct _avitimecodeindex { - FOURCC fcc; - UINT cb; + FOURCC fcc; + UINT cb; WORD wLongsPerEntry; BYTE bIndexSubType; BYTE bIndexType; diff --git a/reactos/include/dxsdk/bdatypes.h b/reactos/include/dxsdk/bdatypes.h index 73a40cc1ea6..3a979efe42e 100644 --- a/reactos/include/dxsdk/bdatypes.h +++ b/reactos/include/dxsdk/bdatypes.h @@ -18,7 +18,7 @@ #define BDA_CHAN_BANDWITH_NOT_SET -1 #define BDA_CHAN_BANDWITH_NOT_DEFINED 0 #define BDA_FREQUENCY_MULTIPLIER_NOT_SET -1 -#define BDA_FREQUENCY_MULTIPLIER_NOT_DEFINED 0 +#define BDA_FREQUENCY_MULTIPLIER_NOT_DEFINED 0 typedef struct _BDA_TEMPLATE_CONNECTION @@ -375,5 +375,5 @@ typedef V1_ENUM enum HierarchyAlpha -#endif +#endif diff --git a/reactos/include/dxsdk/d3dx9shape.h b/reactos/include/dxsdk/d3dx9shape.h index c84c54c207d..c1dec053b8e 100644 --- a/reactos/include/dxsdk/d3dx9shape.h +++ b/reactos/include/dxsdk/d3dx9shape.h @@ -7,16 +7,16 @@ extern "C" { #endif -HRESULT WINAPI +HRESULT WINAPI D3DXCreateBox( - LPDIRECT3DDEVICE9 pDevice, + LPDIRECT3DDEVICE9 pDevice, FLOAT Width, FLOAT Height, FLOAT Depth, LPD3DXMESH* ppMesh, LPD3DXBUFFER* ppAdjacency); -HRESULT WINAPI +HRESULT WINAPI D3DXCreateCylinder( LPDIRECT3DDEVICE9 pDevice, FLOAT Radius1, @@ -27,7 +27,7 @@ HRESULT WINAPI LPD3DXMESH* ppMesh, LPD3DXBUFFER* ppAdjacency); -HRESULT WINAPI +HRESULT WINAPI D3DXCreatePolygon( LPDIRECT3DDEVICE9 pDevice, FLOAT Length, @@ -37,7 +37,7 @@ D3DXCreatePolygon( HRESULT WINAPI D3DXCreateSphere( - LPDIRECT3DDEVICE9 pDevice, + LPDIRECT3DDEVICE9 pDevice, FLOAT Radius, UINT Slices, UINT Stacks, @@ -78,7 +78,7 @@ D3DXCreateTorus( FLOAT InnerRadius, FLOAT OuterRadius, UINT Sides, - UINT Rings, + UINT Rings, LPD3DXMESH* ppMesh, LPD3DXBUFFER* ppAdjacency); diff --git a/reactos/include/dxsdk/d3dx9xof.h b/reactos/include/dxsdk/d3dx9xof.h index 32c675fd944..ad561afbdde 100644 --- a/reactos/include/dxsdk/d3dx9xof.h +++ b/reactos/include/dxsdk/d3dx9xof.h @@ -68,7 +68,7 @@ typedef struct _D3DXF_FILELOADRESOURCE #if !defined( DECLSPEC_UUID ) #if _MSC_VER >= 1100 #define DECLSPEC_UUID( x ) __declspec( uuid( x ) ) - #else + #else #define DECLSPEC_UUID( x ) #endif #endif diff --git a/reactos/include/dxsdk/ddraw.h b/reactos/include/dxsdk/ddraw.h index 744e8770984..58d508fa8e5 100644 --- a/reactos/include/dxsdk/ddraw.h +++ b/reactos/include/dxsdk/ddraw.h @@ -18,7 +18,7 @@ #ifndef DIRECTDRAW_VERSION #define DIRECTDRAW_VERSION 0x0700 -#endif +#endif #undef ENABLE_NAMELESS_UNION_PRAGMA #ifdef DIRECTX_REDIST @@ -46,7 +46,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif /* This define are obsolete in ms ddk, but are use internal in Windows NT4/2000/XP/2003/ReactOS */ #define DDCAPS_STEREOVIEW 0x00040000 @@ -158,7 +158,7 @@ extern "C" { #define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT(602) #define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT(603) #define DDERR_DCALREADYCREATED MAKE_DDHRESULT(620) -#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT(630) +#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT(630) #define DDERR_CANTPAGELOCK MAKE_DDHRESULT(640) #define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT(660) #define DDERR_NOTPAGELOCKED MAKE_DDHRESULT(680) @@ -289,7 +289,7 @@ extern "C" { DDSCAPS2_CUBEMAP_NEGATIVEY |\ DDSCAPS2_CUBEMAP_POSITIVEZ |\ DDSCAPS2_CUBEMAP_NEGATIVEZ ) - + #define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000 #define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000 #define DDSCAPS2_DONOTPERSIST 0x00040000 @@ -659,7 +659,7 @@ extern "C" { #ifndef MAKEFOURCC #define MAKEFOURCC(c0,c1,c2,c3) \ ((DWORD)(BYTE)(c0)|((DWORD)(BYTE)(c1)<<8)|((DWORD)(BYTE)(c2)<< 16)|((DWORD)(BYTE)(c3)<<24)) -#endif +#endif #define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1')) #define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2')) @@ -997,7 +997,7 @@ typedef struct _DDCAPS_DX7 DWORD dwNLVBCKeyCaps; DWORD dwNLVBFXCaps; DWORD dwNLVBRops[DD_ROP_SPACE]; - DDSCAPS2 ddsCaps; + DDSCAPS2 ddsCaps; } DDCAPS_DX7, *LPDDCAPS_DX7; #if DIRECTDRAW_VERSION<=0x300 @@ -1030,7 +1030,7 @@ typedef struct _DDCOLORKEY { DWORD dwColorSpaceLowValue; DWORD dwColorSpaceHighValue; - + } DDCOLORKEY, *LPDDCOLORKEY; typedef struct _DDOSCAPS @@ -1068,7 +1068,7 @@ typedef struct _DDPIXELFORMAT { DWORD dwRBitMask; DWORD dwYBitMask; - DWORD dwStencilBitDepth; + DWORD dwStencilBitDepth; DWORD dwLuminanceBitMask; DWORD dwBumpDuBitMask; DWORD dwOperations; @@ -1205,7 +1205,7 @@ typedef struct _DDRGBA typedef BOOL (* LPDDENUMCALLBACKW)(GUID *, LPWSTR, LPWSTR, LPVOID); extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext ); extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext ); - + #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) #define HMONITOR_DECLARED DECLARE_HANDLE(HMONITOR); @@ -1213,10 +1213,10 @@ typedef struct _DDRGBA typedef BOOL (*LPDDENUMCALLBACKEXA)(GUID *, LPSTR, LPSTR, LPVOID, HMONITOR); typedef BOOL (*LPDDENUMCALLBACKEXW)(GUID *, LPWSTR, LPWSTR, LPVOID, HMONITOR); - + extern HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); - + typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); @@ -1312,20 +1312,20 @@ typedef struct tagDDDEVICEIDENTIFIER char szDriver[MAX_DDDEVICEID_STRING]; char szDescription[MAX_DDDEVICEID_STRING]; #ifdef _WIN32 - LARGE_INTEGER liDriverVersion; + LARGE_INTEGER liDriverVersion; #else - DWORD dwDriverVersionLowPart; + DWORD dwDriverVersionLowPart; DWORD dwDriverVersionHighPart; #endif DWORD dwVendorId; DWORD dwDeviceId; DWORD dwSubSysId; - DWORD dwRevision; + DWORD dwRevision; GUID guidDeviceIdentifier; } DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER; typedef struct tagDDDEVICEIDENTIFIER2 -{ +{ char szDriver[MAX_DDDEVICEID_STRING]; char szDescription[MAX_DDDEVICEID_STRING]; #ifdef _WIN32 @@ -1382,11 +1382,11 @@ typedef struct _DDOVERLAYFX #define INTERFACE IDirectDraw DECLARE_INTERFACE_( IDirectDraw, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; - + STDMETHOD(Compact)(THIS) PURE; STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER *, IUnknown * ) PURE; STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE *, IUnknown * ) PURE; @@ -1464,10 +1464,10 @@ typedef struct _DDOVERLAYFX #undef INTERFACE #define INTERFACE IDirectDraw2 DECLARE_INTERFACE_( IDirectDraw2, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(Compact)(THIS) PURE; STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER *, IUnknown * ) PURE; STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE *, IUnknown * ) PURE; @@ -1487,7 +1487,7 @@ typedef struct _DDOVERLAYFX STDMETHOD(RestoreDisplayMode)(THIS) PURE; STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; }; @@ -1549,10 +1549,10 @@ typedef struct _DDOVERLAYFX #define INTERFACE IDirectDraw4 DECLARE_INTERFACE_( IDirectDraw4, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(Compact)(THIS) PURE; STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER *, IUnknown * ) PURE; STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE *, IUnknown * ) PURE; @@ -1572,8 +1572,8 @@ typedef struct _DDOVERLAYFX STDMETHOD(RestoreDisplayMode)(THIS) PURE; STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE4 *) PURE; STDMETHOD(RestoreAllSurfaces)(THIS) PURE; STDMETHOD(TestCooperativeLevel)(THIS) PURE; @@ -1645,10 +1645,10 @@ typedef struct _DDOVERLAYFX #define INTERFACE IDirectDraw7 DECLARE_INTERFACE_( IDirectDraw7, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(Compact)(THIS) PURE; STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER *, IUnknown * ) PURE; STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE *, IUnknown * ) PURE; @@ -1668,8 +1668,8 @@ typedef struct _DDOVERLAYFX STDMETHOD(RestoreDisplayMode)(THIS) PURE; STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE7 *) PURE; STDMETHOD(RestoreAllSurfaces)(THIS) PURE; STDMETHOD(TestCooperativeLevel)(THIS) PURE; @@ -1780,10 +1780,10 @@ typedef struct _DDOVERLAYFX #define INTERFACE IDirectDrawGammaControl DECLARE_INTERFACE_( IDirectDrawGammaControl, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; }; @@ -1807,10 +1807,10 @@ typedef struct _DDOVERLAYFX #define INTERFACE IDirectDrawColorControl DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; }; @@ -1834,7 +1834,7 @@ typedef struct _DDOVERLAYFX #undef INTERFACE #define INTERFACE IDirectDrawClipper DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; @@ -1873,10 +1873,10 @@ typedef struct _DDOVERLAYFX #define INTERFACE IDirectDrawSurface DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE; STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE; @@ -1995,7 +1995,7 @@ typedef struct _DDOVERLAYFX { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE; STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE; @@ -2028,7 +2028,7 @@ typedef struct _DDOVERLAYFX STDMETHOD(Unlock)(THIS_ LPVOID) PURE; STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE; STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE; STDMETHOD(GetDDInterface)(THIS_ LPVOID *) PURE; STDMETHOD(PageLock)(THIS_ DWORD) PURE; STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; @@ -2124,7 +2124,7 @@ DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; @@ -2157,10 +2157,10 @@ DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) STDMETHOD(Unlock)(THIS_ LPVOID) PURE; STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; STDMETHOD(GetDDInterface)(THIS_ LPVOID *) PURE; STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE; }; @@ -2254,10 +2254,10 @@ DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) #define INTERFACE IDirectDrawSurface4 DECLARE_INTERFACE_( IDirectDrawSurface4, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4) PURE; STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX) PURE; @@ -2293,8 +2293,8 @@ DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4) PURE; STDMETHOD(GetDDInterface)(THIS_ LPVOID *) PURE; STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; @@ -2401,10 +2401,10 @@ DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) #define INTERFACE IDirectDrawSurface7 DECLARE_INTERFACE_( IDirectDrawSurface7, IUnknown ) - { + { STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7) PURE; STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE7, LPRECT,DWORD, LPDDBLTFX) PURE; @@ -2440,13 +2440,13 @@ DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE7) PURE; STDMETHOD(GetDDInterface)(THIS_ LPVOID *) PURE; STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE; - STDMETHOD(ChangeUniquenessValue)(THIS) PURE; + STDMETHOD(ChangeUniquenessValue)(THIS) PURE; STDMETHOD(SetPriority)(THIS_ DWORD) PURE; STDMETHOD(GetPriority)(THIS_ LPDWORD) PURE; STDMETHOD(SetLOD)(THIS_ DWORD) PURE; diff --git a/reactos/include/dxsdk/dmdls.h b/reactos/include/dxsdk/dmdls.h index d93fee324be..e0cf2d72155 100644 --- a/reactos/include/dxsdk/dmdls.h +++ b/reactos/include/dxsdk/dmdls.h @@ -132,7 +132,7 @@ typedef struct _DMUS_WAVE typedef struct _DMUS_WAVEDATA { ULONG cbSize; - BYTE byData[DMUS_MIN_DATA_SIZE]; + BYTE byData[DMUS_MIN_DATA_SIZE]; } DMUS_WAVEDATA; typedef struct _DMUS_ARTICULATION diff --git a/reactos/include/dxsdk/dmusics.h b/reactos/include/dxsdk/dmusics.h index a18adf397e2..90c6d57681c 100644 --- a/reactos/include/dxsdk/dmusics.h +++ b/reactos/include/dxsdk/dmusics.h @@ -9,7 +9,7 @@ interface IDirectMusicSynth; interface IDirectMusicSynthSink; -#ifndef __cplusplus +#ifndef __cplusplus typedef interface IDirectMusicSynth IDirectMusicSynth; typedef interface IDirectMusicSynthSink IDirectMusicSynthSink; #endif @@ -22,7 +22,7 @@ DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661, 0x5C85, 0x11D2, 0xAF, 0x DEFINE_GUID(IID_IDirectMusicSynth8, 0x53CAB625, 0x2711, 0x4C9F, 0x9D, 0xE7, 0x1B, 0x7F, 0x92, 0x5F, 0x6F, 0xC8); DEFINE_GUID(IID_IDirectMusicSynthSink, 0x09823663, 0x5C85, 0x11D2, 0xAF, 0xA6, 0x00, 0xAA, 0x00, 0x24, 0xD8, 0xB6); DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink, 0x0A3A5BA5, 0x37B6, 0x11D2, 0xB9, 0xF9, 0x00, 0x00, 0xF8, 0x75, 0xAC, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xBE208857, 0x8952, 0x11D2, 0xBA, 0x1C, 0x00, 0x00, 0xF8, 0x75, 0xAC, 0x12); +DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xBE208857, 0x8952, 0x11D2, 0xBA, 0x1C, 0x00, 0x00, 0xF8, 0x75, 0xAC, 0x12); #define REFRESH_F_LASTBUFFER 0x00000001 @@ -30,7 +30,7 @@ typedef struct _DMUS_VOICE_STATE { BOOL bExists; SAMPLE_POSITION spPosition; -} DMUS_VOICE_STATE; +} DMUS_VOICE_STATE; #endif @@ -72,7 +72,7 @@ DECLARE_INTERFACE_(IDirectMusicSynth8, IDirectMusicSynth) STDMETHOD(Close) (THIS) PURE; STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE; STDMETHOD(Download) (THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree ) PURE; - STDMETHOD(Unload) (THIS_ HANDLE hDownload, HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData ) PURE; + STDMETHOD(Unload) (THIS_ HANDLE hDownload, HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData ) PURE; STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE; STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE; diff --git a/reactos/include/dxsdk/dsetup.h b/reactos/include/dxsdk/dsetup.h index 728f9605367..67e34dba1aa 100644 --- a/reactos/include/dxsdk/dsetup.h +++ b/reactos/include/dxsdk/dsetup.h @@ -129,7 +129,7 @@ INT WINAPI DirectXUnRegisterApplication( HWND hWnd, LPGUID lpGUID); #define DirectXSetup DirectXSetupA #define DirectXRegisterApplication DirectXRegisterApplicationA #define DirectXSetupGetEULA DirectXSetupGetEULAA - + #endif typedef DWORD (*DSETUP_CALLBACK)( DWORD Reason, DWORD MsgType, LPSTR szMessage, diff --git a/reactos/include/dxsdk/dv.h b/reactos/include/dxsdk/dv.h index cf9cbcfc316..9f063c962a0 100644 --- a/reactos/include/dxsdk/dv.h +++ b/reactos/include/dxsdk/dv.h @@ -11,7 +11,7 @@ typedef struct Tag_DVAudInfo WORD wBlkMode; WORD wDIFMode; WORD wBlkDiv; - + } DVAudInfo; #define DV_AUDIOMODE 0x00000f00 diff --git a/reactos/include/dxsdk/dxdiag.h b/reactos/include/dxsdk/dxdiag.h index c3484471334..45b677315a0 100644 --- a/reactos/include/dxsdk/dxdiag.h +++ b/reactos/include/dxsdk/dxdiag.h @@ -35,7 +35,7 @@ DECLARE_INTERFACE_(IDxDiagContainer,IUnknown) STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(GetNumberOfChildContainers) (THIS_ DWORD *pdwCount) PURE; STDMETHOD(EnumChildContainerNames) (THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE; - STDMETHOD(GetChildContainer) (THIS_ LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) PURE; + STDMETHOD(GetChildContainer) (THIS_ LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) PURE; STDMETHOD(GetNumberOfProps) (THIS_ DWORD *pdwCount) PURE; STDMETHOD(EnumPropNames) (THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE; STDMETHOD(GetProp) (THIS_ LPCWSTR pwszPropName, VARIANT *pvarProp) PURE; @@ -49,7 +49,7 @@ DECLARE_INTERFACE_(IDxDiagProvider,IUnknown) STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; - STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE; + STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE; STDMETHOD(GetRootContainer) (THIS_ IDxDiagContainer **ppInstance) PURE; }; diff --git a/reactos/include/dxsdk/dxerr9.h b/reactos/include/dxsdk/dxerr9.h index acfadd2a0ec..440bc3fcf63 100644 --- a/reactos/include/dxsdk/dxerr9.h +++ b/reactos/include/dxsdk/dxerr9.h @@ -3,7 +3,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif const char* WINAPI DXGetErrorString9A(HRESULT hr); @@ -22,7 +22,7 @@ HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WC #define DXGetErrorString9 DXGetErrorString9A #define DXGetErrorDescription9 DXGetErrorDescription9A #define DXTrace DXTraceA -#endif +#endif #if defined(DEBUG) | defined(_DEBUG) diff --git a/reactos/include/dxsdk/dxsdkver.h b/reactos/include/dxsdk/dxsdkver.h index c5cd5f7e77e..5ed1a591125 100644 --- a/reactos/include/dxsdk/dxsdkver.h +++ b/reactos/include/dxsdk/dxsdkver.h @@ -7,4 +7,4 @@ #define _DXSDK_BUILD_MAJOR 91 #define _DXSDK_BUILD_MINOR 0000 -#endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/reactos/include/dxsdk/mmstream.idl b/reactos/include/dxsdk/mmstream.idl index 91eac4e552d..7c6cb450ec3 100644 --- a/reactos/include/dxsdk/mmstream.idl +++ b/reactos/include/dxsdk/mmstream.idl @@ -23,7 +23,7 @@ cpp_quote("#define MS_E_NOTRUNNING MS_ERROR_CODE(10)") -// FIXME HACK remove the // for two cpp_quote +// FIXME HACK remove the // for two cpp_quote cpp_quote("#if 0"); typedef LPVOID PAPCFUNC; cpp_quote("#endif"); diff --git a/reactos/include/dxsdk/regbag.idl b/reactos/include/dxsdk/regbag.idl index 5beff1372f4..4543922615a 100644 --- a/reactos/include/dxsdk/regbag.idl +++ b/reactos/include/dxsdk/regbag.idl @@ -7,7 +7,7 @@ import "oaidl.idl"; import "ocidl.idl"; #endif -[object, +[object, hidden, restricted, uuid(8A674B48-1F63-11d3-B64C-00C04F79498E), pointer_default(unique), diff --git a/reactos/include/dxsdk/tvratings.idl b/reactos/include/dxsdk/tvratings.idl index d62e95caa95..0c239834f72 100644 --- a/reactos/include/dxsdk/tvratings.idl +++ b/reactos/include/dxsdk/tvratings.idl @@ -2,7 +2,7 @@ import "oaidl.idl"; import "ocidl.idl"; -typedef enum +typedef enum { MPAA = 0, US_TV = 1, @@ -32,7 +32,7 @@ typedef enum } EnTvRat_GenericLevel; -typedef enum +typedef enum { MPAA_NotApplicable = TvRat_0, MPAA_G = TvRat_1, @@ -44,7 +44,7 @@ typedef enum MPAA_NotRated = TvRat_7 } EnTvRat_MPAA; -typedef enum +typedef enum { US_TV_None = TvRat_0, US_TV_Y = TvRat_1, @@ -56,7 +56,7 @@ typedef enum US_TV_None7 = TvRat_7 } EnTvRat_US_TV; -typedef enum +typedef enum { CAE_TV_Exempt = TvRat_0, CAE_TV_C = TvRat_1, @@ -68,7 +68,7 @@ typedef enum CAE_TV_Reserved = TvRat_7 } EnTvRat_CAE_TV; -typedef enum +typedef enum { CAF_TV_Exempt = TvRat_0, CAF_TV_G = TvRat_1, @@ -80,7 +80,7 @@ typedef enum CAF_TV_Reserved = TvRat_7 } EnTvRat_CAF_TV; -typedef enum +typedef enum { BfAttrNone = 0, BfIsBlocked = 1, @@ -94,7 +94,7 @@ typedef enum BfValidAttrSubmask = 255 } BfEnTvRat_GenericAttributes; -typedef enum +typedef enum { US_TV_IsBlocked = BfIsBlocked, US_TV_IsViolent = BfIsAttr_1, @@ -104,19 +104,19 @@ typedef enum US_TV_ValidAttrSubmask = 31 } BfEnTvRat_Attributes_US_TV; -typedef enum +typedef enum { MPAA_IsBlocked = BfIsBlocked, MPAA_ValidAttrSubmask = 1 } BfEnTvRat_Attributes_MPAA; -typedef enum +typedef enum { CAE_IsBlocked = BfIsBlocked, CAE_ValidAttrSubmask = 1 } BfEnTvRat_Attributes_CAE_TV; -typedef enum +typedef enum { CAF_IsBlocked = BfIsBlocked, CAF_ValidAttrSubmask = 1 diff --git a/reactos/include/dxsdk/vpconfig.h b/reactos/include/dxsdk/vpconfig.h index 08953fa03c9..e647901acc0 100644 --- a/reactos/include/dxsdk/vpconfig.h +++ b/reactos/include/dxsdk/vpconfig.h @@ -18,7 +18,7 @@ DECLARE_INTERFACE_(IVPBaseConfig, IUnknown) STDMETHOD (GetMaxPixelRate)(THIS_ IN OUT LPAMVPSIZE pamvpSize, OUT LPDWORD pdwMaxPixelsPerSecond) PURE; - STDMETHOD (InformVPInputFormats)(THIS_ IN DWORD dwNumFormats, + STDMETHOD (InformVPInputFormats)(THIS_ IN DWORD dwNumFormats, IN LPDDPIXELFORMAT pDDPixelFormats) PURE; STDMETHOD (GetVideoFormats)(THIS_ IN OUT LPDWORD pdwNumFormats, @@ -30,7 +30,7 @@ DECLARE_INTERFACE_(IVPBaseConfig, IUnknown) STDMETHOD (SetDirectDrawKernelHandle)(THIS_ IN ULONG_PTR dwDDKernelHandle) PURE; STDMETHOD (SetVideoPortID)(THIS_ IN DWORD dwVideoPortID) PURE; - STDMETHOD (SetDDSurfaceKernelHandles)(THIS_ IN DWORD cHandles, + STDMETHOD (SetDDSurfaceKernelHandles)(THIS_ IN DWORD cHandles, IN ULONG_PTR *rgDDKernelHandles) PURE; STDMETHOD (SetSurfaceParameters)(THIS_ IN DWORD dwPitch, IN DWORD dwXOrigin, diff --git a/reactos/include/host/typedefs.h b/reactos/include/host/typedefs.h index 4b53b266331..08364233d93 100644 --- a/reactos/include/host/typedefs.h +++ b/reactos/include/host/typedefs.h @@ -46,7 +46,7 @@ #define FALSE 0 #define TRUE (!(FALSE)) -/* FIXME: this value is target specific, host tools MUST not use it +/* FIXME: this value is target specific, host tools MUST not use it * and this line has to be removed */ #define PAGE_SIZE 4096 diff --git a/reactos/include/ndk/extypes.h b/reactos/include/ndk/extypes.h index 71e4fe1d540..1e7ce74681b 100644 --- a/reactos/include/ndk/extypes.h +++ b/reactos/include/ndk/extypes.h @@ -832,7 +832,7 @@ typedef struct _SYSTEM_PERFORMANCE_INFORMATION ULONG SystemCalls; } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION; -// Class 3 +// Class 3 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION { LARGE_INTEGER BootTime; @@ -1170,7 +1170,7 @@ typedef struct _SYSTEM_GDI_DRIVER_INFORMATION } SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION; // Class 27 -// Not an actually class, simply a PVOID to the ImageAddress +// Not an actually class, simply a PVOID to the ImageAddress // Class 28 typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION @@ -1356,7 +1356,7 @@ typedef struct _SYSTEM_VERIFIER_INFORMATION // FIXME: Class 52 -// Class 53 +// Class 53 typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION { ULONG SessionId; diff --git a/reactos/include/ndk/i386/ketypes.h b/reactos/include/ndk/i386/ketypes.h index 1abaa1f89f0..b9107ed8661 100644 --- a/reactos/include/ndk/i386/ketypes.h +++ b/reactos/include/ndk/i386/ketypes.h @@ -609,7 +609,7 @@ typedef struct _KIPCR union { NT_TIB NtTib; - struct + struct { struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; PVOID Used_StackBase; diff --git a/reactos/include/ndk/ldrfuncs.h b/reactos/include/ndk/ldrfuncs.h index abb69242345..1d029c081a3 100644 --- a/reactos/include/ndk/ldrfuncs.h +++ b/reactos/include/ndk/ldrfuncs.h @@ -50,7 +50,7 @@ LdrFindResource_U( ); NTSTATUS -NTAPI +NTAPI LdrFindResourceDirectory_U( IN PVOID BaseAddress, IN PLDR_RESOURCE_INFO ResourceInfo, diff --git a/reactos/include/ndk/psfuncs.h b/reactos/include/ndk/psfuncs.h index df1de79e55b..b99f9f3a755 100644 --- a/reactos/include/ndk/psfuncs.h +++ b/reactos/include/ndk/psfuncs.h @@ -82,7 +82,7 @@ PsGetThreadHardErrorsAreDisabled( ); NTKERNELAPI -VOID +VOID NTAPI PsSetThreadHardErrorsAreDisabled( PETHREAD Thread, @@ -90,7 +90,7 @@ PsSetThreadHardErrorsAreDisabled( ); NTKERNELAPI -VOID +VOID NTAPI PsEstablishWin32Callouts( PWIN32_CALLOUTS_FPNS CalloutData diff --git a/reactos/include/ndk/pstypes.h b/reactos/include/ndk/pstypes.h index 8d6f3cdc617..964b658ec99 100644 --- a/reactos/include/ndk/pstypes.h +++ b/reactos/include/ndk/pstypes.h @@ -697,7 +697,7 @@ typedef struct _INITIAL_TEB // // TEB Active Frame Structures // -typedef struct _TEB_ACTIVE_FRAME_CONTEXT +typedef struct _TEB_ACTIVE_FRAME_CONTEXT { ULONG Flags; LPSTR FrameName; diff --git a/reactos/include/psdk/activscp.idl b/reactos/include/psdk/activscp.idl index 1ccfc3dfcec..6dc66e74812 100644 --- a/reactos/include/psdk/activscp.idl +++ b/reactos/include/psdk/activscp.idl @@ -19,7 +19,7 @@ import "ocidl.idl"; import "oleidl.idl"; import "oaidl.idl"; - + typedef enum tagSCRIPTSTATE { SCRIPTSTATE_UNINITIALIZED = 0, SCRIPTSTATE_STARTED = 1, @@ -91,13 +91,13 @@ interface IActiveScriptError : IUnknown HRESULT GetExceptionInfo( [out] EXCEPINFO *pexcepinfo ); - + HRESULT GetSourcePosition( [out] DWORD *pdwSourceContext, [out] ULONG *pulLineNumber, [out] LONG *plCharacterPosition ); - + HRESULT GetSourceLineText( [out] BSTR *pbstrSourceLine ); @@ -112,33 +112,33 @@ interface IActiveScriptSite : IUnknown { HRESULT GetLCID( [out] LCID *plcid); - + HRESULT GetItemInfo( [in] LPCOLESTR pstrName, [in] DWORD dwReturnMask, [out] IUnknown **ppiunkItem, [out] ITypeInfo **ppti ); - + HRESULT GetDocVersionString( [out] BSTR *pbstrVersion ); - + HRESULT OnScriptTerminate( [in] const VARIANT *pvarResult, [in] const EXCEPINFO *pexcepinfo ); - + HRESULT OnStateChange( [in] SCRIPTSTATE ssScriptState ); - + HRESULT OnScriptError( [in] IActiveScriptError *pscripterror ); - + HRESULT OnEnterScript(void); - + HRESULT OnLeaveScript(void); } diff --git a/reactos/include/psdk/af_irda.h b/reactos/include/psdk/af_irda.h index 87b485ddd6c..5e0426dbf4d 100644 --- a/reactos/include/psdk/af_irda.h +++ b/reactos/include/psdk/af_irda.h @@ -53,7 +53,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_IRDAENUM_BUS_ENUMERATOR, #define IRDA_PROTO_SOCK_STREAM 1 #define PF_IRDA AF_IRDA #define SOL_IRLMP 0x00FF -#define SIO_LAZY_DISCOVERY _IOR('t', 127, ULONG) +#define SIO_LAZY_DISCOVERY _IOR('t', 127, ULONG) #define IAS_MAX_USER_STRING 256 diff --git a/reactos/include/psdk/cryptuiapi.h b/reactos/include/psdk/cryptuiapi.h index 10575abb0db..c00134ca1eb 100644 --- a/reactos/include/psdk/cryptuiapi.h +++ b/reactos/include/psdk/cryptuiapi.h @@ -5,7 +5,7 @@ typedef struct _CRYPTUI_CERT_MGR_STRUCT { DWORD dwFlags; LPCWSTR pwszTitle; LPCSTR pszInitUsageOID; -} CRYPTUI_CERT_MGR_STRUCT, +} CRYPTUI_CERT_MGR_STRUCT, *PCRYPTUI_CERT_MGR_STRUCT; typedef const CRYPTUI_CERT_MGR_STRUCT *PCCRYPTUI_CERT_MGR_STRUCT; diff --git a/reactos/include/psdk/cvconst.h b/reactos/include/psdk/cvconst.h index a63f03ba175..59fc1831d7c 100644 --- a/reactos/include/psdk/cvconst.h +++ b/reactos/include/psdk/cvconst.h @@ -40,13 +40,13 @@ enum SymTagEnum SymTagPointerType, SymTagArrayType, SymTagBaseType, - SymTagTypedef, + SymTagTypedef, SymTagBaseClass, SymTagFriend, - SymTagFunctionArgType, - SymTagFuncDebugStart, + SymTagFunctionArgType, + SymTagFuncDebugStart, SymTagFuncDebugEnd, - SymTagUsingNamespace, + SymTagUsingNamespace, SymTagVTableShape, SymTagVTable, SymTagCustom, @@ -287,7 +287,7 @@ enum CV_HREG_e CV_M4_Psr = 51, CV_M4_FltF0 = 60, /* this includes FltF1 to Flt31 */ CV_M4_FltFsr = 92, - + /* Alpha AXP CPU */ CV_ALPHA_NOREG = CV_REG_NONE, CV_ALPHA_FltF0 = 10, /* this includes FltF1 to FltF31 */ @@ -311,7 +311,7 @@ enum CV_HREG_e CV_ALPHA_Psr = 76, CV_ALPHA_FltFsr = 77, CV_ALPHA_SoftFpcr = 78, - + /* Motorola & IBM PowerPC CPU */ CV_PPC_GPR0 = 1, /* this includes GPR1 to GPR31 */ CV_PPC_CR = 33, @@ -357,7 +357,7 @@ enum CV_HREG_e CV_ARM_LR = 24, CV_ARM_PC = 25, CV_ARM_CPSR = 26, - + /* Intel IA64 CPU */ CV_IA64_NOREG = CV_REG_NONE, CV_IA64_Br0 = 512, /* this includes Br1 to Br7 */ @@ -428,5 +428,5 @@ typedef enum THUNK_ORDINAL_ADJUSTOR, THUNK_ORDINAL_VCALL, THUNK_ORDINAL_PCODE, - THUNK_ORDINAL_LOAD + THUNK_ORDINAL_LOAD } THUNK_ORDINAL; diff --git a/reactos/include/psdk/d3d8types.h b/reactos/include/psdk/d3d8types.h index d49bd6ad66b..453c8192606 100644 --- a/reactos/include/psdk/d3d8types.h +++ b/reactos/include/psdk/d3d8types.h @@ -142,7 +142,7 @@ #define D3DTA_ALPHAREPLICATE 0x00000020 #define D3DTA_TEMP 0x00000005 -#define D3DCOLORWRITEENABLE_RED (1L<<0) +#define D3DCOLORWRITEENABLE_RED (1L<<0) #define D3DCOLORWRITEENABLE_GREEN (1L<<1) #define D3DCOLORWRITEENABLE_BLUE (1L<<2) #define D3DCOLORWRITEENABLE_ALPHA (1L<<3) @@ -154,7 +154,7 @@ ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) -/**************************** +/**************************** * Vertex Shaders Declaration */ diff --git a/reactos/include/psdk/d3d9types.h b/reactos/include/psdk/d3d9types.h index e99e1348600..b27d7254c56 100644 --- a/reactos/include/psdk/d3d9types.h +++ b/reactos/include/psdk/d3d9types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2003 Jason Edmeades + * Copyright (C) 2002-2003 Jason Edmeades * Copyright (C) 2002-2003 Raphael Junqueira * Copyright (C) 2005 Oliver Stieber * @@ -106,7 +106,7 @@ #define D3DUSAGE_RTPATCHES 0x00000080L #define D3DUSAGE_NPATCHES 0x00000100L #define D3DUSAGE_DYNAMIC 0x00000200L -#define D3DUSAGE_AUTOGENMIPMAP 0x00000400L +#define D3DUSAGE_AUTOGENMIPMAP 0x00000400L #define D3DUSAGE_DMAP 0x00004000L #define D3DUSAGE_QUERY_FILTER 0x00020000L @@ -167,7 +167,7 @@ #define D3DTA_COMPLEMENT 0x00000010 #define D3DTA_ALPHAREPLICATE 0x00000020 -#define D3DCOLORWRITEENABLE_RED (1L<<0) +#define D3DCOLORWRITEENABLE_RED (1L<<0) #define D3DCOLORWRITEENABLE_GREEN (1L<<1) #define D3DCOLORWRITEENABLE_BLUE (1L<<2) #define D3DCOLORWRITEENABLE_ALPHA (1L<<3) @@ -205,7 +205,7 @@ #define D3DPRESENT_BACK_BUFFERS_MAX 3L #define D3DPRESENT_RATE_DEFAULT 0x00000000 -/**************************** +/**************************** * Vertex Shaders Declaration */ @@ -213,17 +213,17 @@ typedef enum _D3DDECLUSAGE { D3DDECLUSAGE_POSITION = 0, D3DDECLUSAGE_BLENDWEIGHT = 1, D3DDECLUSAGE_BLENDINDICES = 2, - D3DDECLUSAGE_NORMAL = 3, - D3DDECLUSAGE_PSIZE = 4, - D3DDECLUSAGE_TEXCOORD = 5, - D3DDECLUSAGE_TANGENT = 6, - D3DDECLUSAGE_BINORMAL = 7, - D3DDECLUSAGE_TESSFACTOR = 8, - D3DDECLUSAGE_POSITIONT = 9, - D3DDECLUSAGE_COLOR = 10, - D3DDECLUSAGE_FOG = 11, - D3DDECLUSAGE_DEPTH = 12, - D3DDECLUSAGE_SAMPLE = 13 + D3DDECLUSAGE_NORMAL = 3, + D3DDECLUSAGE_PSIZE = 4, + D3DDECLUSAGE_TEXCOORD = 5, + D3DDECLUSAGE_TANGENT = 6, + D3DDECLUSAGE_BINORMAL = 7, + D3DDECLUSAGE_TESSFACTOR = 8, + D3DDECLUSAGE_POSITIONT = 9, + D3DDECLUSAGE_COLOR = 10, + D3DDECLUSAGE_FOG = 11, + D3DDECLUSAGE_DEPTH = 12, + D3DDECLUSAGE_SAMPLE = 13 } D3DDECLUSAGE; /* MSDN is quite confussing at this point... @@ -439,7 +439,7 @@ typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE { D3DSIO_SETP = 94, D3DSIO_TEXLDL = 95, D3DSIO_BREAKP = 96, - + D3DSIO_PHASE = 0xFFFD, D3DSIO_COMMENT = 0xFFFE, D3DSIO_END = 0XFFFF, @@ -506,7 +506,7 @@ typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE { #define D3DSP_REGTYPE_MASK2 0x00001800 typedef enum _D3DSHADER_PARAM_REGISTER_TYPE { - D3DSPR_TEMP = 0, + D3DSPR_TEMP = 0, D3DSPR_INPUT = 1, D3DSPR_CONST = 2, D3DSPR_ADDR = 3, @@ -728,7 +728,7 @@ typedef enum _D3DDEGREETYPE { D3DDEGREE_QUADRATIC = 2, D3DDEGREE_CUBIC = 3, D3DDEGREE_QUINTIC = 5, - + D3DDEGREE_FORCE_DWORD = 0x7fffffff } D3DDEGREETYPE; @@ -778,7 +778,7 @@ typedef enum _D3DFORMAT { D3DFMT_G16R16 = 34, D3DFMT_A2R10G10B10 = 35, D3DFMT_A16B16G16R16 = 36, - + D3DFMT_A8P8 = 40, D3DFMT_P8 = 41, @@ -824,12 +824,12 @@ typedef enum _D3DFORMAT { D3DFMT_R16F = 111, D3DFMT_G16R16F = 112, D3DFMT_A16B16G16R16F = 113, - + /* IEEE formats */ D3DFMT_R32F = 114, D3DFMT_G32R32F = 115, D3DFMT_A32B32G32R32F = 116, - + D3DFMT_CxV8U8 = 117, @@ -1214,7 +1214,7 @@ typedef enum _D3DSAMPLERSTATETYPE { D3DSAMP_SRGBTEXTURE = 11, D3DSAMP_ELEMENTINDEX = 12, D3DSAMP_DMAPOFFSET = 13, - + D3DSAMP_FORCE_DWORD = 0x7fffffff, } D3DSAMPLERSTATETYPE; @@ -1234,7 +1234,7 @@ typedef struct _D3DADAPTER_IDENTIFIER9 { char Driver[MAX_DEVICE_IDENTIFIER_STRING]; char Description[MAX_DEVICE_IDENTIFIER_STRING]; char DeviceName[32]; - LARGE_INTEGER DriverVersion; + LARGE_INTEGER DriverVersion; DWORD VendorId; DWORD DeviceId; @@ -1314,13 +1314,13 @@ typedef struct _D3DDEVINFO_D3D9STAGETIMINGS { /* Vertex cache optimization hints. */ typedef struct D3DDEVINFO_VCACHE { /* Must be a 4 char code FOURCC (e.g. CACH) */ - DWORD Pattern; + DWORD Pattern; /* 0 to get the longest strips, 1 vertex cache */ - DWORD OptMethod; + DWORD OptMethod; /* Cache size to use (only valid if OptMethod==1) */ DWORD CacheSize; /* internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1) */ - DWORD MagicNumber; + DWORD MagicNumber; } D3DDEVINFO_VCACHE; typedef struct D3DRESOURCESTATS { diff --git a/reactos/include/psdk/d3dx8core.h b/reactos/include/psdk/d3dx8core.h index 4d795c26bf6..7a378940262 100644 --- a/reactos/include/psdk/d3dx8core.h +++ b/reactos/include/psdk/d3dx8core.h @@ -107,13 +107,13 @@ DECLARE_INTERFACE_(ID3DXFont,IUnknown) #endif /************************************************************************************* - * Define entrypoints + * Define entrypoints */ HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer); HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont); UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF); -HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, - LPD3DXBUFFER* ppConstants, +HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, + LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors); HRESULT WINAPI D3DXAssembleShaderFromFileA(LPSTR pSrcFile, DWORD Flags, diff --git a/reactos/include/psdk/dbghelp.h b/reactos/include/psdk/dbghelp.h index d883a87971d..6098efe6a03 100644 --- a/reactos/include/psdk/dbghelp.h +++ b/reactos/include/psdk/dbghelp.h @@ -76,7 +76,7 @@ typedef struct _tagADDRESS #define SYMF_THUNK 0x00002000 #define SYMF_TLSREL 0x00004000 -typedef enum +typedef enum { SymNone = 0, SymCoff, @@ -255,7 +255,7 @@ typedef struct _DBGHELP_MODLOAD_DATA typedef DWORD RVA; typedef ULONG64 RVA64; -typedef enum _MINIDUMP_TYPE +typedef enum _MINIDUMP_TYPE { MiniDumpNormal = 0x0000, MiniDumpWithDataSegs = 0x0001, @@ -284,7 +284,7 @@ typedef struct _MINIDUMP_THREAD_CALLBACK ULONG64 StackEnd; } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK; -typedef struct _MINIDUMP_THREAD_EX_CALLBACK +typedef struct _MINIDUMP_THREAD_EX_CALLBACK { ULONG ThreadId; HANDLE ThreadHandle; @@ -301,7 +301,7 @@ typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK ULONG ThreadId; } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK; -typedef enum _THREAD_WRITE_FLAGS +typedef enum _THREAD_WRITE_FLAGS { ThreadWriteThread = 0x0001, ThreadWriteStack = 0x0002, @@ -310,7 +310,7 @@ typedef enum _THREAD_WRITE_FLAGS ThreadWriteInstructionWindow = 0x0010 } THREAD_WRITE_FLAGS; -typedef struct _MINIDUMP_MODULE_CALLBACK +typedef struct _MINIDUMP_MODULE_CALLBACK { PWCHAR FullPath; ULONGLONG BaseOfImage; @@ -324,12 +324,12 @@ typedef struct _MINIDUMP_MODULE_CALLBACK ULONG SizeOfMiscRecord; } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK; -typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK +typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK { ULONG64 BaseOfImage; } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK; -typedef enum _MODULE_WRITE_FLAGS +typedef enum _MODULE_WRITE_FLAGS { ModuleWriteModule = 0x0001, ModuleWriteDataSeg = 0x0002, @@ -338,12 +338,12 @@ typedef enum _MODULE_WRITE_FLAGS ModuleReferencedByMemory = 0x0010 } MODULE_WRITE_FLAGS; -typedef struct _MINIDUMP_CALLBACK_INPUT +typedef struct _MINIDUMP_CALLBACK_INPUT { ULONG ProcessId; HANDLE ProcessHandle; ULONG CallbackType; - union + union { MINIDUMP_THREAD_CALLBACK Thread; MINIDUMP_THREAD_EX_CALLBACK ThreadEx; @@ -355,7 +355,7 @@ typedef struct _MINIDUMP_CALLBACK_INPUT typedef struct _MINIDUMP_CALLBACK_OUTPUT { - union + union { ULONG ModuleWriteFlags; ULONG ThreadWriteFlags; @@ -366,19 +366,19 @@ typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID CallbackParam, const PMINIDUMP_CALLBACK_INPUT CallbackInput, PMINIDUMP_CALLBACK_OUTPUT CallbackOutput); -typedef struct _MINIDUMP_CALLBACK_INFORMATION +typedef struct _MINIDUMP_CALLBACK_INFORMATION { MINIDUMP_CALLBACK_ROUTINE CallbackRoutine; void* CallbackParam; } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION; -typedef struct _MINIDUMP_LOCATION_DESCRIPTOR +typedef struct _MINIDUMP_LOCATION_DESCRIPTOR { ULONG DataSize; RVA Rva; } MINIDUMP_LOCATION_DESCRIPTOR; -typedef struct _MINIDUMP_DIRECTORY +typedef struct _MINIDUMP_DIRECTORY { ULONG StreamType; MINIDUMP_LOCATION_DESCRIPTOR Location; @@ -402,7 +402,7 @@ typedef struct _MINIDUMP_EXCEPTION_INFORMATION BOOL ClientPointers; } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION; -typedef struct MINIDUMP_EXCEPTION_STREAM +typedef struct MINIDUMP_EXCEPTION_STREAM { ULONG ThreadId; ULONG __alignment; @@ -410,14 +410,14 @@ typedef struct MINIDUMP_EXCEPTION_STREAM MINIDUMP_LOCATION_DESCRIPTOR ThreadContext; } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM; -typedef struct _MINIDUMP_HEADER +typedef struct _MINIDUMP_HEADER { DWORD Signature; DWORD Version; DWORD NumberOfStreams; RVA StreamDirectoryRva; DWORD CheckSum; - union + union { DWORD Reserved; DWORD TimeDateStamp; @@ -425,7 +425,7 @@ typedef struct _MINIDUMP_HEADER ULONGLONG Flags; } MINIDUMP_HEADER, *PMINIDUMP_HEADER; -typedef struct _MINIDUMP_MEMORY_DESCRIPTOR +typedef struct _MINIDUMP_MEMORY_DESCRIPTOR { ULONGLONG StartOfMemoryRange; MINIDUMP_LOCATION_DESCRIPTOR Memory; @@ -445,7 +445,7 @@ typedef struct _MINIDUMP_MODULE ULONGLONG Reserved1; } MINIDUMP_MODULE, *PMINIDUMP_MODULE; -typedef struct _MINIDUMP_MODULE_LIST +typedef struct _MINIDUMP_MODULE_LIST { ULONG NumberOfModules; MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */ @@ -498,16 +498,16 @@ typedef struct _MINIDUMP_SYSTEM_INFO RVA CSDVersionRva; ULONG Reserved1; - union _CPU_INFORMATION + union _CPU_INFORMATION { - struct + struct { ULONG VendorId[3]; ULONG VersionInformation; ULONG FeatureInformation; ULONG AMDExtendedCpuFeatures; } X86CpuInfo; - struct + struct { ULONGLONG ProcessorFeatures[2]; } OtherCpuInfo; @@ -550,7 +550,7 @@ typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR ModuleName, DWORD BaseOf BOOL WINAPI SymEnumerateModules(HANDLE hProcess, PSYM_ENUMMODULES_CALLBACK EnumModulesCallback, PVOID UserContext); -BOOL WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr, +BOOL WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr, PIMAGEHLP_MODULE ModuleInfo); BOOL WINAPI SymGetModuleInfoW(HANDLE hProcess, DWORD dwAddr, PIMAGEHLP_MODULEW ModuleInfo); @@ -608,7 +608,7 @@ typedef struct _SYMBOL_INFO CHAR Name[1]; } SYMBOL_INFO, *PSYMBOL_INFO; -typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO +typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO { TI_GET_SYMTAG, TI_GET_SYMNAME, @@ -639,7 +639,7 @@ typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO TI_GET_CALLING_CONVENTION, } IMAGEHLP_SYMBOL_TYPE_INFO; -typedef struct _TI_FINDCHILDREN_PARAMS +typedef struct _TI_FINDCHILDREN_PARAMS { ULONG Count; ULONG Start; @@ -671,7 +671,7 @@ typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO pSymInfo, BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll, PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext); -BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 addr, DWORD64* displacement, +BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 addr, DWORD64* displacement, SYMBOL_INFO* sym_info); BOOL WINAPI SymFromName(HANDLE hProcess, LPSTR Name, PSYMBOL_INFO Symbol); BOOL WINAPI SymGetSymFromAddr(HANDLE,DWORD,PDWORD,PIMAGEHLP_SYMBOL); @@ -706,7 +706,7 @@ typedef BOOL (CALLBACK *PSYM_ENUMSOURCFILES_CALLBACK)(PSOURCEFILE pSourceFile, BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, LPSTR Mask, PSYM_ENUMSOURCFILES_CALLBACK cbSrcFiles, PVOID UserContext); -BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr, +BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE Line); BOOL WINAPI SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line); BOOL WINAPI SymGetLineNext(HANDLE hProcess, PIMAGEHLP_LINE Line); diff --git a/reactos/include/psdk/ddrawgdi.h b/reactos/include/psdk/ddrawgdi.h index c74d745fe10..605c707659d 100644 --- a/reactos/include/psdk/ddrawgdi.h +++ b/reactos/include/psdk/ddrawgdi.h @@ -18,7 +18,7 @@ */ #include - + /* Define the real export names */ #define DdCreateDirectDrawObject GdiEntry1 #define DdQueryDirectDrawObject GdiEntry2 @@ -38,16 +38,16 @@ #define DdSwapTextureHandles GdiEntry16 -BOOL -STDCALL -DdCreateDirectDrawObject( +BOOL +STDCALL +DdCreateDirectDrawObject( LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, HDC hdc ); -BOOL -STDCALL -DdQueryDirectDrawObject( +BOOL +STDCALL +DdQueryDirectDrawObject( LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, LPDDHALINFO pHalInfo, LPDDHAL_DDCALLBACKS pDDCallbacks, @@ -61,48 +61,48 @@ DdQueryDirectDrawObject( LPVIDMEM pvmList ); -BOOL -STDCALL -DdDeleteDirectDrawObject( +BOOL +STDCALL +DdDeleteDirectDrawObject( LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal ); -BOOL -STDCALL -DdCreateSurfaceObject( +BOOL +STDCALL +DdCreateSurfaceObject( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal, BOOL bPrimarySurface ); -BOOL -STDCALL -DdDeleteSurfaceObject( +BOOL +STDCALL +DdDeleteSurfaceObject( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal ); -BOOL -STDCALL -DdResetVisrgn( +BOOL +STDCALL +DdResetVisrgn( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal, HWND hWnd ); -HDC -STDCALL -DdGetDC( +HDC +STDCALL +DdGetDC( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal, LPPALETTEENTRY pColorTable ); -BOOL -STDCALL -DdReleaseDC( +BOOL +STDCALL +DdReleaseDC( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal ); -HBITMAP -STDCALL -DdCreateDIBSection( +HBITMAP +STDCALL +DdCreateDIBSection( HDC hdc, CONST BITMAPINFO *pbmi, UINT iUsage, @@ -111,50 +111,50 @@ DdCreateDIBSection( DWORD dwOffset ); -BOOL -STDCALL -DdReenableDirectDrawObject( +BOOL +STDCALL +DdReenableDirectDrawObject( LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, BOOL *pbNewMode ); -BOOL -STDCALL -DdAttachSurface( +BOOL +STDCALL +DdAttachSurface( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceFrom, LPDDRAWI_DDRAWSURFACE_LCL pSurfaceTo ); -VOID -STDCALL -DdUnattachSurface( +VOID +STDCALL +DdUnattachSurface( LPDDRAWI_DDRAWSURFACE_LCL pSurface, LPDDRAWI_DDRAWSURFACE_LCL pSurfaceAttached ); -ULONG -STDCALL +ULONG +STDCALL DdQueryDisplaySettingsUniqueness(VOID); -HANDLE -STDCALL -DdGetDxHandle( +HANDLE +STDCALL +DdGetDxHandle( LPDDRAWI_DIRECTDRAW_LCL pDDraw, LPDDRAWI_DDRAWSURFACE_LCL pSurface, BOOL bRelease ); -BOOL -STDCALL -DdSetGammaRamp( +BOOL +STDCALL +DdSetGammaRamp( LPDDRAWI_DIRECTDRAW_LCL pDDraw, HDC hdc, LPVOID lpGammaRamp ); -DWORD -STDCALL -DdSwapTextureHandles( +DWORD +STDCALL +DdSwapTextureHandles( LPDDRAWI_DIRECTDRAW_LCL pDDraw, LPDDRAWI_DDRAWSURFACE_LCL pDDSLcl1, LPDDRAWI_DDRAWSURFACE_LCL pDDSLcl2 diff --git a/reactos/include/psdk/dinput.h b/reactos/include/psdk/dinput.h index 5efb003e69a..3113e06592e 100644 --- a/reactos/include/psdk/dinput.h +++ b/reactos/include/psdk/dinput.h @@ -212,7 +212,7 @@ DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8) #define DI8DEVTYPE_SCREENPOINTER 0x1A #define DI8DEVTYPE_REMOTE 0x1B #define DI8DEVTYPE_SUPPLEMENTAL 0x1C - + #define DIDEVTYPEMOUSE_UNKNOWN 1 #define DIDEVTYPEMOUSE_TRADITIONAL 2 #define DIDEVTYPEMOUSE_FINGERSTICK 3 @@ -310,7 +310,7 @@ DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8) #define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS 11 #define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS 12 #define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS 13 - + #define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType) #define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType) @@ -798,7 +798,7 @@ typedef struct DIDEVCAPS { #define DISCL_BACKGROUND 0x00000008 #define DIEFT_ALL 0x00000000 - + #define DIEFT_CONSTANTFORCE 0x00000001 #define DIEFT_RAMPFORCE 0x00000002 #define DIEFT_PERIODIC 0x00000003 @@ -813,7 +813,7 @@ typedef struct DIDEVCAPS { #define DIEFT_DEADBAND 0x00004000 #define DIEFT_STARTDELAY 0x00008000 #define DIEFT_GETTYPE(n) LOBYTE(n) - + #define DI_DEGREES 100 #define DI_FFNOMINALMAX 10000 #define DI_SECONDS 1000000 diff --git a/reactos/include/psdk/dispex.idl b/reactos/include/psdk/dispex.idl index 3ba6f743975..35aaa9389f9 100644 --- a/reactos/include/psdk/dispex.idl +++ b/reactos/include/psdk/dispex.idl @@ -171,6 +171,6 @@ pointer_default(unique) ] interface IObjectIdentity : IUnknown { - HRESULT IsEqualObject( + HRESULT IsEqualObject( [in] IUnknown *punk); } diff --git a/reactos/include/psdk/dplay.h b/reactos/include/psdk/dplay.h index c662862602f..f293ac45845 100644 --- a/reactos/include/psdk/dplay.h +++ b/reactos/include/psdk/dplay.h @@ -192,7 +192,7 @@ typedef struct tagDPNAME { LPWSTR lpszShortName; LPSTR lpszShortNameA; - }; + }; union /*playerLongName */ /* Player's formal/real name */ { diff --git a/reactos/include/psdk/dvdevcod.h b/reactos/include/psdk/dvdevcod.h index eefe3b4f8b9..77242a64211 100644 --- a/reactos/include/psdk/dvdevcod.h +++ b/reactos/include/psdk/dvdevcod.h @@ -33,27 +33,27 @@ #ifndef EXCLUDE_DVDEVCODE_ENUMS -typedef enum _tagDVD_WARNING +typedef enum _tagDVD_WARNING { DVD_WARNING_InvalidDVD1_0Disc =1, DVD_WARNING_FormatNotSupported =2, DVD_WARNING_IllegalNavCommand =3, - DVD_WARNING_Open =4, - DVD_WARNING_Seek =5, - DVD_WARNING_Read =6 + DVD_WARNING_Open =4, + DVD_WARNING_Seek =5, + DVD_WARNING_Read =6 } DVD_WARNING; -typedef enum _tagDVD_ERROR +typedef enum _tagDVD_ERROR { - DVD_ERROR_Unexpected =1, - DVD_ERROR_CopyProtectFail =2, - DVD_ERROR_InvalidDVD1_0Disc =3, - DVD_ERROR_InvalidDiscRegion =4, - DVD_ERROR_LowParentalLevel =5, - DVD_ERROR_MacrovisionFail =6, - DVD_ERROR_IncompatibleSystemAndDecoderRegions =7, + DVD_ERROR_Unexpected =1, + DVD_ERROR_CopyProtectFail =2, + DVD_ERROR_InvalidDVD1_0Disc =3, + DVD_ERROR_InvalidDiscRegion =4, + DVD_ERROR_LowParentalLevel =5, + DVD_ERROR_MacrovisionFail =6, + DVD_ERROR_IncompatibleSystemAndDecoderRegions =7, DVD_ERROR_IncompatibleDiscAndDecoderRegions =8 - + } DVD_ERROR; #endif diff --git a/reactos/include/psdk/edevdefs.h b/reactos/include/psdk/edevdefs.h index b2882ad8202..12565a69b3a 100644 --- a/reactos/include/psdk/edevdefs.h +++ b/reactos/include/psdk/edevdefs.h @@ -5,12 +5,12 @@ #define ED_BASE 0x1000L #define ED_DEVCAP_CAN_RECORD ED_BASE+1L -#define ED_DEVCAP_CAN_RECORD_STROBE ED_BASE+2L +#define ED_DEVCAP_CAN_RECORD_STROBE ED_BASE+2L #define ED_DEVCAP_HAS_AUDIO ED_BASE+3L #define ED_DEVCAP_HAS_VIDEO ED_BASE+4L #define ED_DEVCAP_USES_FILES ED_BASE+5L #define ED_DEVCAP_CAN_SAVE ED_BASE+6L -#define ED_DEVCAP_DEVICE_TYPE ED_BASE+7L +#define ED_DEVCAP_DEVICE_TYPE ED_BASE+7L #define ED_DEVTYPE_VCR ED_BASE+8L #define ED_DEVTYPE_LASERDISK ED_BASE+9L #define ED_DEVTYPE_ATR ED_BASE+10L @@ -49,10 +49,10 @@ #define ED_DEVCAP_VIDEO_INPUTS ED_BASE+43L #define ED_DEVCAP_AUDIO_INPUTS ED_BASE+44L #define ED_DEVCAP_NEEDS_CALIBRATING ED_BASE+45L -#define ED_DEVCAP_SEEK_TYPE ED_BASE+46L -#define ED_SEEK_PERFECT ED_BASE+47L -#define ED_SEEK_FAST ED_BASE+48L -#define ED_SEEK_SLOW ED_BASE+49L +#define ED_DEVCAP_SEEK_TYPE ED_BASE+46L +#define ED_SEEK_PERFECT ED_BASE+47L +#define ED_SEEK_FAST ED_BASE+48L +#define ED_SEEK_SLOW ED_BASE+49L #define ED_POWER_ON ED_BASE+50L #define ED_POWER_OFF ED_BASE+51L #define ED_POWER_STANDBY ED_BASE+52L @@ -71,14 +71,14 @@ #define ED_TRANSCAP_CAN_DELAY_AUDIO_IN ED_BASE+107L #define ED_TRANSCAP_CAN_DELAY_AUDIO_OUT ED_BASE+108L #define ED_TRANSCAP_FWD_VARIABLE_MAX ED_BASE+109L -#define ED_TRANSCAP_REV_VARIABLE_MAX ED_BASE+110L -#define ED_TRANSCAP_NUM_AUDIO_TRACKS ED_BASE+111L -#define ED_TRANSCAP_LTC_TRACK ED_BASE+112L -#define ED_TRANSCAP_NEEDS_TBC ED_BASE+113L -#define ED_TRANSCAP_NEEDS_CUEING ED_BASE+114L +#define ED_TRANSCAP_REV_VARIABLE_MAX ED_BASE+110L +#define ED_TRANSCAP_NUM_AUDIO_TRACKS ED_BASE+111L +#define ED_TRANSCAP_LTC_TRACK ED_BASE+112L +#define ED_TRANSCAP_NEEDS_TBC ED_BASE+113L +#define ED_TRANSCAP_NEEDS_CUEING ED_BASE+114L #define ED_TRANSCAP_CAN_INSERT ED_BASE+115L #define ED_TRANSCAP_CAN_ASSEMBLE ED_BASE+116L -#define ED_TRANSCAP_FIELD_STEP ED_BASE+117L +#define ED_TRANSCAP_FIELD_STEP ED_BASE+117L #define ED_TRANSCAP_CLOCK_INC_RATE ED_BASE+118L #define ED_TRANSCAP_CAN_DETECT_LENGTH ED_BASE+119L #define ED_TRANSCAP_CAN_FREEZE ED_BASE+120L @@ -121,14 +121,14 @@ #define ED_TCG_VIDEO ED_BASE+411L #define ED_TCG_READER ED_BASE+412L #define ED_TCG_FREE ED_BASE+413L -#define ED_TCG_REFERENCE_SOURCE ED_BASE+414L +#define ED_TCG_REFERENCE_SOURCE ED_BASE+414L -#define ED_TCR_SOURCE ED_BASE+416L +#define ED_TCR_SOURCE ED_BASE+416L #define ED_TCR_LTC ED_BASE+417L #define ED_TCR_VITC ED_BASE+418L -#define ED_TCR_CT ED_BASE+419L -#define ED_TCR_FTC ED_BASE+420L -#define ED_TCR_LAST_VALUE ED_BASE+421L +#define ED_TCR_CT ED_BASE+419L +#define ED_TCR_FTC ED_BASE+420L +#define ED_TCR_LAST_VALUE ED_BASE+421L #define ED_TCD_SOURCE ED_BASE+422L #define ED_TCR ED_BASE+423L #define ED_TCG ED_BASE+424L @@ -186,7 +186,7 @@ #define ED_TIMEREF_CONTROL_TRACK ED_BASE+551L #define ED_TIMEREF_INDEX ED_BASE+552L #define ED_TRANSBASIC_SUPERIMPOSE ED_BASE+553L -#define ED_TRANSBASIC_END_STOP_ACTION ED_BASE+554L +#define ED_TRANSBASIC_END_STOP_ACTION ED_BASE+554L #define ED_TRANSBASIC_RECORD_FORMAT ED_BASE+555L #define ED_RECORD_FORMAT_SP ED_BASE+556L #define ED_RECORD_FORMAT_LP ED_BASE+557L @@ -272,7 +272,7 @@ #define ED_EDIT_MODE_ASSEMBLE ED_BASE+660L #define ED_EDIT_MODE_INSERT ED_BASE+661L #define ED_EDIT_MODE_CRASH_RECORD ED_BASE+662L -#define ED_EDIT_MODE_BOOKMARK_TIME ED_BASE+663L +#define ED_EDIT_MODE_BOOKMARK_TIME ED_BASE+663L #define ED_EDIT_MODE_BOOKMARK_CHAPTER ED_BASE+664L #define ED_EDIT_MASTER ED_BASE+666L #define ED_EDIT_TRACK ED_BASE+667L @@ -281,10 +281,10 @@ #define ED_EDIT_REC_INPOINT ED_BASE+670L #define ED_EDIT_REC_OUTPOINT ED_BASE+671L #define ED_EDIT_REHEARSE_MODE ED_BASE+672L -#define ED_EDIT_BVB ED_BASE+673L +#define ED_EDIT_BVB ED_BASE+673L #define ED_EDIT_VBV ED_BASE+674L #define ED_EDIT_VVV ED_BASE+675L -#define ED_EDIT_PERFORM ED_BASE+676L +#define ED_EDIT_PERFORM ED_BASE+676L #define ED_EDIT_ABORT ED_BASE+677L #define ED_EDIT_TIMEOUT ED_BASE+678L #define ED_EDIT_SEEK ED_BASE+679L @@ -298,13 +298,13 @@ #define ED_ERR_DEVICE_NOT_READY ED_BASE+700L -#define ED_TRANSCAP_FWD_VARIABLE_MIN ED_BASE+800L -#define ED_TRANSCAP_REV_VARIABLE_MIN ED_BASE+801L -#define ED_TRANSCAP_FWD_SHUTTLE_MAX ED_BASE+802L -#define ED_TRANSCAP_FWD_SHUTTLE_MIN ED_BASE+803L -#define ED_TRANSCAP_REV_SHUTTLE_MAX ED_BASE+804L -#define ED_TRANSCAP_REV_SHUTTLE_MIN ED_BASE+805L -#define ED_TRANSCAP_MULTIPLE_EDITS ED_BASE+806L +#define ED_TRANSCAP_FWD_VARIABLE_MIN ED_BASE+800L +#define ED_TRANSCAP_REV_VARIABLE_MIN ED_BASE+801L +#define ED_TRANSCAP_FWD_SHUTTLE_MAX ED_BASE+802L +#define ED_TRANSCAP_FWD_SHUTTLE_MIN ED_BASE+803L +#define ED_TRANSCAP_REV_SHUTTLE_MAX ED_BASE+804L +#define ED_TRANSCAP_REV_SHUTTLE_MIN ED_BASE+805L +#define ED_TRANSCAP_MULTIPLE_EDITS ED_BASE+806L #define ED_TRANSCAP_IS_MASTER ED_BASE+807L #define ED_MODE_RECORD_FREEZE ED_BASE+808L #define ED_MODE_STEP_REV ED_BASE+809L @@ -316,14 +316,14 @@ #define ED_EDIT_PREREAD ED_BASE+815L #define DEV_PORT_SIM 1 -#define DEV_PORT_COM1 2 +#define DEV_PORT_COM1 2 #define DEV_PORT_COM2 3 #define DEV_PORT_COM3 4 #define DEV_PORT_COM4 5 -#define DEV_PORT_DIAQ 6 -#define DEV_PORT_ARTI 7 -#define DEV_PORT_1394 8 -#define DEV_PORT_USB 9 +#define DEV_PORT_DIAQ 6 +#define DEV_PORT_ARTI 7 +#define DEV_PORT_1394 8 +#define DEV_PORT_USB 9 #define DEV_PORT_MIN DEV_PORT_SIM #define DEV_PORT_MAX DEV_PORT_USB @@ -358,9 +358,9 @@ #define ED_AUDIO_22 0x0200000L #define ED_AUDIO_23 0x0400000L #define ED_AUDIO_24 0x0800000L -#define ED_AUDIO_ALL 0x10000000 +#define ED_AUDIO_ALL 0x10000000 -#define ED_VIDEO 0x2000000L +#define ED_VIDEO 0x2000000L #endif diff --git a/reactos/include/psdk/hlink.idl b/reactos/include/psdk/hlink.idl index 884c4be5ec0..3dc41d3cdb1 100644 --- a/reactos/include/psdk/hlink.idl +++ b/reactos/include/psdk/hlink.idl @@ -377,24 +377,24 @@ interface IHlinkFrame : IUnknown { typedef IHlinkFrame *LPHLINKFRAME; - HRESULT SetBrowseContext( + HRESULT SetBrowseContext( [in, unique] IHlinkBrowseContext * pihlbc); - HRESULT GetBrowseContext( + HRESULT GetBrowseContext( [out] IHlinkBrowseContext ** ppihlbc); - HRESULT Navigate( - [in] DWORD grfHLNF, - [in, unique] LPBC pbc, - [in, unique] IBindStatusCallback *pibsc, + HRESULT Navigate( + [in] DWORD grfHLNF, + [in, unique] LPBC pbc, + [in, unique] IBindStatusCallback *pibsc, [in, unique] IHlink *pihlNavigate); - HRESULT OnNavigate( - [in] DWORD grfHLNF, - [in, unique] IMoniker *pimkTarget, - [in, unique] LPCWSTR pwzLocation, - [in, unique] LPCWSTR pwzFriendlyName, + HRESULT OnNavigate( + [in] DWORD grfHLNF, + [in, unique] IMoniker *pimkTarget, + [in, unique] LPCWSTR pwzLocation, + [in, unique] LPCWSTR pwzFriendlyName, [in] DWORD dwreserved); - HRESULT UpdateHlink( - [in] ULONG uHLID, - [in, unique] IMoniker *pimkTarget, - [in, unique] LPCWSTR pwzLocation, + HRESULT UpdateHlink( + [in] ULONG uHLID, + [in, unique] IMoniker *pimkTarget, + [in, unique] LPCWSTR pwzLocation, [in, unique] LPCWSTR pwzFriendlyName); } diff --git a/reactos/include/psdk/intrin_ppc.h b/reactos/include/psdk/intrin_ppc.h index 55327e66ce1..cfc2a280dca 100644 --- a/reactos/include/psdk/intrin_ppc.h +++ b/reactos/include/psdk/intrin_ppc.h @@ -268,12 +268,12 @@ PPC_QUAL long _InterlockedExchangeAdd(volatile long * const Addend, const long V long x; long y = *Addend; long addend = y; - + do { x = y; y = _InterlockedCompareExchange(Addend, addend + Value, x); - } + } while(y != x); return y; @@ -481,7 +481,7 @@ PPC_QUAL long _InterlockedIncrement(volatile long * const lpAddend) /*** String operations ***/ /* NOTE: we don't set a memory clobber in the __stosX functions because Visual C++ doesn't */ -/* Note that the PPC store multiple operations may raise an exception in LE +/* Note that the PPC store multiple operations may raise an exception in LE * mode */ PPC_QUAL void __stosb(unsigned char * Dest, const unsigned char Data, unsigned long Count) { @@ -490,7 +490,7 @@ PPC_QUAL void __stosb(unsigned char * Dest, const unsigned char Data, unsigned l PPC_QUAL void __stosw(unsigned short * Dest, const unsigned short Data, unsigned long Count) { - while(Count--) + while(Count--) *Dest++ = Data; } @@ -610,7 +610,7 @@ PPC_QUAL unsigned char _BitScanForward(unsigned long * const Index, const unsign else { unsigned long mask = Mask; mask &= -mask; - *Index = + *Index = ((mask & 0xffff0000) ? 16 : 0) + ((mask & 0xff00ff00) ? 8 : 0) + ((mask & 0xf0f0f0f0) ? 4 : 0) + @@ -674,17 +674,17 @@ PPC_QUAL unsigned char _rotl8(const unsigned char value, const unsigned char shi PPC_QUAL unsigned short _rotl16(const unsigned short value, const unsigned char shift) { - return (value << shift) | (value >> (16-shift)); + return (value << shift) | (value >> (16-shift)); } PPC_QUAL unsigned char _rotr8(const unsigned char value, const unsigned char shift) { - return (value >> shift) | (value << (8-shift)); + return (value >> shift) | (value << (8-shift)); } PPC_QUAL unsigned short _rotr16(const unsigned short value, const unsigned char shift) { - return (value >> shift) | (value << (16-shift)); + return (value >> shift) | (value << (16-shift)); } PPC_QUAL unsigned long long __ll_lshift(const unsigned long long Mask, int Bit) @@ -877,7 +877,7 @@ PPC_QUAL unsigned long long __rdtsc(void) /* Finally decided to do this by enabling single step trap */ PPC_QUAL void __debugbreak(void) { - + } PPC_QUAL void __int2c(void) diff --git a/reactos/include/psdk/ks.h b/reactos/include/psdk/ks.h index 5601883f5e9..831b1766be4 100644 --- a/reactos/include/psdk/ks.h +++ b/reactos/include/psdk/ks.h @@ -589,63 +589,63 @@ typedef enum #define KSPROPSETID_AC3 /* - KSPROPERTY_AC3_ALTERNATE_AUDIO - KSPROPERTY_AC3_BIT_STREAM_MODE - KSPROPERTY_AC3_DIALOGUE_LEVEL - KSPROPERTY_AC3_DOWNMIX - KSPROPERTY_AC3_ERROR_CONCEALMENT - KSPROPERTY_AC3_LANGUAGE_CODE + KSPROPERTY_AC3_ALTERNATE_AUDIO + KSPROPERTY_AC3_BIT_STREAM_MODE + KSPROPERTY_AC3_DIALOGUE_LEVEL + KSPROPERTY_AC3_DOWNMIX + KSPROPERTY_AC3_ERROR_CONCEALMENT + KSPROPERTY_AC3_LANGUAGE_CODE KSPROPERTY_AC3_ROOM_TYPE */ #define KSPROPSETID_Acoustic_Echo_Cancel /* - KSPROPERTY_AEC_MODE - KSPROPERTY_AEC_NOISE_FILL_ENABLE + KSPROPERTY_AEC_MODE + KSPROPERTY_AEC_NOISE_FILL_ENABLE KSPROPERTY_AEC_STATUS */ #define KSPROPSETID_Audio /* KSPROPERTY_AUDIO_3D_INTERFACE - KSPROPERTY_AUDIO_AGC - KSPROPERTY_AUDIO_ALGORITHM_INSTANCE - KSPROPERTY_AUDIO_BASS - KSPROPERTY_AUDIO_BASS_BOOST - KSPROPERTY_AUDIO_CHANNEL_CONFIG - KSPROPERTY_AUDIO_CHORUS_LEVEL - KSPROPERTY_AUDIO_COPY_PROTECTION - KSPROPERTY_AUDIO_CPU_RESOURCES - KSPROPERTY_AUDIO_DELAY - KSPROPERTY_AUDIO_DEMUX_DEST - KSPROPERTY_AUDIO_DEV_SPECIFIC - KSPROPERTY_AUDIO_DYNAMIC_RANGE - KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE - KSPROPERTY_AUDIO_EQ_BANDS - KSPROPERTY_AUDIO_EQ_LEVEL - KSPROPERTY_AUDIO_FILTER_STATE - KSPROPERTY_AUDIO_LATENCY - KSPROPERTY_AUDIO_LOUDNESS - KSPROPERTY_AUDIO_MANUFACTURE_GUID - KSPROPERTY_AUDIO_MID - KSPROPERTY_AUDIO_MIX_LEVEL_CAPS - KSPROPERTY_AUDIO_MIX_LEVEL_TABLE - KSPROPERTY_AUDIO_MUTE - KSPROPERTY_AUDIO_MUX_SOURCE - KSPROPERTY_AUDIO_NUM_EQ_BANDS + KSPROPERTY_AUDIO_AGC + KSPROPERTY_AUDIO_ALGORITHM_INSTANCE + KSPROPERTY_AUDIO_BASS + KSPROPERTY_AUDIO_BASS_BOOST + KSPROPERTY_AUDIO_CHANNEL_CONFIG + KSPROPERTY_AUDIO_CHORUS_LEVEL + KSPROPERTY_AUDIO_COPY_PROTECTION + KSPROPERTY_AUDIO_CPU_RESOURCES + KSPROPERTY_AUDIO_DELAY + KSPROPERTY_AUDIO_DEMUX_DEST + KSPROPERTY_AUDIO_DEV_SPECIFIC + KSPROPERTY_AUDIO_DYNAMIC_RANGE + KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE + KSPROPERTY_AUDIO_EQ_BANDS + KSPROPERTY_AUDIO_EQ_LEVEL + KSPROPERTY_AUDIO_FILTER_STATE + KSPROPERTY_AUDIO_LATENCY + KSPROPERTY_AUDIO_LOUDNESS + KSPROPERTY_AUDIO_MANUFACTURE_GUID + KSPROPERTY_AUDIO_MID + KSPROPERTY_AUDIO_MIX_LEVEL_CAPS + KSPROPERTY_AUDIO_MIX_LEVEL_TABLE + KSPROPERTY_AUDIO_MUTE + KSPROPERTY_AUDIO_MUX_SOURCE + KSPROPERTY_AUDIO_NUM_EQ_BANDS KSPROPERTY_AUDIO_PEAKMETER - KSPROPERTY_AUDIO_POSITION - KSPROPERTY_AUDIO_PREFERRED_STATUS - KSPROPERTY_AUDIO_PRODUCT_GUID - KSPROPERTY_AUDIO_QUALITY - KSPROPERTY_AUDIO_REVERB_LEVEL - KSPROPERTY_AUDIO_SAMPLING_RATE - KSPROPERTY_AUDIO_STEREO_ENHANCE - KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY - KSPROPERTY_AUDIO_SURROUND_ENCODE - KSPROPERTY_AUDIO_TREBLE - KSPROPERTY_AUDIO_VOLUMELEVEL - KSPROPERTY_AUDIO_WIDE_MODE + KSPROPERTY_AUDIO_POSITION + KSPROPERTY_AUDIO_PREFERRED_STATUS + KSPROPERTY_AUDIO_PRODUCT_GUID + KSPROPERTY_AUDIO_QUALITY + KSPROPERTY_AUDIO_REVERB_LEVEL + KSPROPERTY_AUDIO_SAMPLING_RATE + KSPROPERTY_AUDIO_STEREO_ENHANCE + KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY + KSPROPERTY_AUDIO_SURROUND_ENCODE + KSPROPERTY_AUDIO_TREBLE + KSPROPERTY_AUDIO_VOLUMELEVEL + KSPROPERTY_AUDIO_WIDE_MODE KSPROPERTY_AUDIO_WIDENESS */ @@ -657,27 +657,27 @@ typedef enum #define KSPROPSETID_DirectSound3DBuffer /* - KSPROPERTY_DIRECTSOUND3DBUFFER_ALL - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION - KSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME - KSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE - KSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE - KSPROPERTY_DIRECTSOUND3DBUFFER_MODE - KSPROPERTY_DIRECTSOUND3DBUFFER_POSITION + KSPROPERTY_DIRECTSOUND3DBUFFER_ALL + KSPROPERTY_DIRECTSOUND3DBUFFER_CONEANGLES + KSPROPERTY_DIRECTSOUND3DBUFFER_CONEORIENTATION + KSPROPERTY_DIRECTSOUND3DBUFFER_CONEOUTSIDEVOLUME + KSPROPERTY_DIRECTSOUND3DBUFFER_MAXDISTANCE + KSPROPERTY_DIRECTSOUND3DBUFFER_MINDISTANCE + KSPROPERTY_DIRECTSOUND3DBUFFER_MODE + KSPROPERTY_DIRECTSOUND3DBUFFER_POSITION KSPROPERTY_DIRECTSOUND3DBUFFER_VELOCITY */ #define KSPROPSETID_DirectSound3DListener /* - KSPROPERTY_DIRECTSOUND3DLISTENER_ALL + KSPROPERTY_DIRECTSOUND3DLISTENER_ALL KSPROPERTY_DIRECTSOUND3DLISTENER_ALLOCATION - KSPROPERTY_DIRECTSOUND3DLISTENER_BATCH - KSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR - KSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR - KSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION - KSPROPERTY_DIRECTSOUND3DLISTENER_POSITION - KSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR + KSPROPERTY_DIRECTSOUND3DLISTENER_BATCH + KSPROPERTY_DIRECTSOUND3DLISTENER_DISTANCEFACTOR + KSPROPERTY_DIRECTSOUND3DLISTENER_DOPPLERFACTOR + KSPROPERTY_DIRECTSOUND3DLISTENER_ORIENTATION + KSPROPERTY_DIRECTSOUND3DLISTENER_POSITION + KSPROPERTY_DIRECTSOUND3DLISTENER_ROLLOFFFACTOR KSPROPERTY_DIRECTSOUND3DLISTENER_VELOCITY */ @@ -688,8 +688,8 @@ typedef enum #define KSPROPSETID_Hrtf3d /* - KSPROPERTY_HRTF3D_FILTER_FORMAT - KSPROPERTY_HRTF3D_INITIALIZE + KSPROPERTY_HRTF3D_FILTER_FORMAT + KSPROPERTY_HRTF3D_INITIALIZE KSPROPERTY_HRTF3D_PARAMS */ @@ -700,35 +700,35 @@ typedef enum #define KSPROPSETID_Synth /* - KSPROPERTY_SYNTH_CAPS - KSPROPERTY_SYNTH_CHANNELGROUPS - KSPROPERTY_SYNTH_LATENCYCLOCK - KSPROPERTY_SYNTH_MASTERCLOCK - KSPROPERTY_SYNTH_PORTPARAMETERS - KSPROPERTY_SYNTH_RUNNINGSTATS - KSPROPERTY_SYNTH_VOICEPRIORITY - KSPROPERTY_SYNTH_VOLUME + KSPROPERTY_SYNTH_CAPS + KSPROPERTY_SYNTH_CHANNELGROUPS + KSPROPERTY_SYNTH_LATENCYCLOCK + KSPROPERTY_SYNTH_MASTERCLOCK + KSPROPERTY_SYNTH_PORTPARAMETERS + KSPROPERTY_SYNTH_RUNNINGSTATS + KSPROPERTY_SYNTH_VOICEPRIORITY + KSPROPERTY_SYNTH_VOLUME KSPROPERTY_SYNTH_VOLUMEBOOST */ #define KSPROPSETID_Synth_Dls /* - KSPROPERTY_SYNTH_DLS_APPEND - KSPROPERTY_SYNTH_DLS_COMPACT - KSPROPERTY_SYNTH_DLS_DOWNLOAD - KSPROPERTY_SYNTH_DLS_UNLOAD + KSPROPERTY_SYNTH_DLS_APPEND + KSPROPERTY_SYNTH_DLS_COMPACT + KSPROPERTY_SYNTH_DLS_DOWNLOAD + KSPROPERTY_SYNTH_DLS_UNLOAD KSPROPERTY_SYNTH_DLS_WAVEFORMAT */ /* #define KSPROPSETID_Sysaudio */ /* - KSPROPERTY_SYSAUDIO_COMPONENT_ID - KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE - KSPROPERTY_SYSAUDIO_DEVICE_COUNT - KSPROPERTY_SYSAUDIO_DEVICE_FRIENDLY_NAME - KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE - KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME - KSPROPERTY_SYSAUDIO_INSTANCE_INFO + KSPROPERTY_SYSAUDIO_COMPONENT_ID + KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE + KSPROPERTY_SYSAUDIO_DEVICE_COUNT + KSPROPERTY_SYSAUDIO_DEVICE_FRIENDLY_NAME + KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE + KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME + KSPROPERTY_SYSAUDIO_INSTANCE_INFO KSPROPERTY_SYSAUDIO_SELECT_GRAPH */ @@ -739,7 +739,7 @@ typedef enum #define KSPROPSETID_TopologyNode /* - KSPROPERTY_TOPOLOGYNODE_ENABLE + KSPROPERTY_TOPOLOGYNODE_ENABLE KSPROPERTY_TOPOLOGYNODE_RESET */ @@ -760,35 +760,35 @@ typedef enum Node Types */ /* - KSNODETYPE_3D_EFFECTS + KSNODETYPE_3D_EFFECTS KSNODETYPE_ACOUSTIC_ECHO_CANCEL - KSNODETYPE_ADC - KSNODETYPE_AGC - KSNODETYPE_CHORUS - KSNODETYPE_DAC - KSNODETYPE_DELAY - KSNODETYPE_DEMUX - KSNODETYPE_DEV_SPECIFIC - KSNODETYPE_DMSYNTH - KSNODETYPE_DMSYNTH_CAPS - KSNODETYPE_DRM_DESCRAMBLE - KSNODETYPE_EQUALIZER - KSNODETYPE_LOUDNESS - KSNODETYPE_MUTE - KSNODETYPE_MUX + KSNODETYPE_ADC + KSNODETYPE_AGC + KSNODETYPE_CHORUS + KSNODETYPE_DAC + KSNODETYPE_DELAY + KSNODETYPE_DEMUX + KSNODETYPE_DEV_SPECIFIC + KSNODETYPE_DMSYNTH + KSNODETYPE_DMSYNTH_CAPS + KSNODETYPE_DRM_DESCRAMBLE + KSNODETYPE_EQUALIZER + KSNODETYPE_LOUDNESS + KSNODETYPE_MUTE + KSNODETYPE_MUX KSNODETYPE_PEAKMETER - KSNODETYPE_PROLOGIC_DECODER - KSNODETYPE_PROLOGIC_ENCODER - KSNODETYPE_REVERB - KSNODETYPE_SRC + KSNODETYPE_PROLOGIC_DECODER + KSNODETYPE_PROLOGIC_ENCODER + KSNODETYPE_REVERB + KSNODETYPE_SRC KSNODETYPE_STEREO_ENHANCE - KSNODETYPE_STEREO_WIDE - KSNODETYPE_SUM - KSNODETYPE_SUPERMIX - KSNODETYPE_SWMIDI - KSNODETYPE_SWSYNTH - KSNODETYPE_SYNTHESIZER - KSNODETYPE_TONE + KSNODETYPE_STEREO_WIDE + KSNODETYPE_SUM + KSNODETYPE_SUPERMIX + KSNODETYPE_SWMIDI + KSNODETYPE_SWSYNTH + KSNODETYPE_SYNTHESIZER + KSNODETYPE_TONE KSNODETYPE_VOLUME */ diff --git a/reactos/include/psdk/mapidefs.h b/reactos/include/psdk/mapidefs.h index 3be0d92281f..1b18dd67a31 100644 --- a/reactos/include/psdk/mapidefs.h +++ b/reactos/include/psdk/mapidefs.h @@ -896,17 +896,17 @@ DECLARE_INTERFACE_(IMAPIProp,IUnknown) #define IMAPIProp_AddRef(p) (p)->lpVtbl->AddRef(p) #define IMAPIProp_Release(p) (p)->lpVtbl->Release(p) /*** IMAPIProp methods ***/ -#define IMAPIProp_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c) -#define IMAPIProp_SaveChanges(p,a) (p)->lpVtbl->SaveChanges(p,a) -#define IMAPIProp_GetProps(p,a,b,c,d) (p)->lpVtbl->GetProps(p,a,b,c,d) -#define IMAPIProp_GetPropList(p,a,b) (p)->lpVtbl->GetPropList(p,a,b) -#define IMAPIProp_OpenProperty(p,a,b,c,d,e) (p)->lpVtbl->OpenProperty(p,a,b,c,d,e) -#define IMAPIProp_SetProps(p,a,b,c) (p)->lpVtbl->SetProps(p,a,b,c) -#define IMAPIProp_DeleteProps(p,a,b) (p)->lpVtbl->DeleteProps(p,a,b) -#define IMAPIProp_CopyTo(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CopyTo(p,a,b,c,d,e,f,g,h,i) -#define IMAPIProp_CopyProps(p,a,b,c,d,e,f,g) (p)->lpVtbl->CopyProps(p,a,b,c,d,e,f,g) -#define IMAPIProp_GetNamesFromIDs(p,a,b,c,d,e) (p)->lpVtbl->GetNamesFromIDs(p,a,b,c,d,e) -#define IMAPIProp_GetIDsFromNames(p,a,b,c,d) (p)->lpVtbl->GetIDsFromNames(p,a,b,c,d) +#define IMAPIProp_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c) +#define IMAPIProp_SaveChanges(p,a) (p)->lpVtbl->SaveChanges(p,a) +#define IMAPIProp_GetProps(p,a,b,c,d) (p)->lpVtbl->GetProps(p,a,b,c,d) +#define IMAPIProp_GetPropList(p,a,b) (p)->lpVtbl->GetPropList(p,a,b) +#define IMAPIProp_OpenProperty(p,a,b,c,d,e) (p)->lpVtbl->OpenProperty(p,a,b,c,d,e) +#define IMAPIProp_SetProps(p,a,b,c) (p)->lpVtbl->SetProps(p,a,b,c) +#define IMAPIProp_DeleteProps(p,a,b) (p)->lpVtbl->DeleteProps(p,a,b) +#define IMAPIProp_CopyTo(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CopyTo(p,a,b,c,d,e,f,g,h,i) +#define IMAPIProp_CopyProps(p,a,b,c,d,e,f,g) (p)->lpVtbl->CopyProps(p,a,b,c,d,e,f,g) +#define IMAPIProp_GetNamesFromIDs(p,a,b,c,d,e) (p)->lpVtbl->GetNamesFromIDs(p,a,b,c,d,e) +#define IMAPIProp_GetIDsFromNames(p,a,b,c,d) (p)->lpVtbl->GetIDsFromNames(p,a,b,c,d) #endif typedef IMAPIProp *LPMAPIPROP; diff --git a/reactos/include/psdk/mapiutil.h b/reactos/include/psdk/mapiutil.h index 408144ead06..6e512969781 100644 --- a/reactos/include/psdk/mapiutil.h +++ b/reactos/include/psdk/mapiutil.h @@ -175,7 +175,7 @@ LPSPropValue WINAPI LpValFindProp(ULONG,ULONG,LPSPropValue); static inline FILETIME FtAddFt(FILETIME ftLeft, FILETIME ftRight) { LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight; - union { FILETIME ft; LONG64 ll; } ftmap; + union { FILETIME ft; LONG64 ll; } ftmap; ftmap.ll = *pl + *pr; return ftmap.ft; } @@ -183,7 +183,7 @@ static inline FILETIME FtAddFt(FILETIME ftLeft, FILETIME ftRight) static inline FILETIME FtSubFt(FILETIME ftLeft, FILETIME ftRight) { LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight; - union { FILETIME ft; LONG64 ll; } ftmap; + union { FILETIME ft; LONG64 ll; } ftmap; ftmap.ll = *pl - *pr; return ftmap.ft; } @@ -191,7 +191,7 @@ static inline FILETIME FtSubFt(FILETIME ftLeft, FILETIME ftRight) static inline FILETIME FtNegFt(FILETIME ftLeft) { LONG64 *p = (LONG64*)&ftLeft; - union { FILETIME ft; LONG64 ll; } ftmap; + union { FILETIME ft; LONG64 ll; } ftmap; ftmap.ll = -*p; return ftmap.ft; } @@ -199,7 +199,7 @@ static inline FILETIME FtNegFt(FILETIME ftLeft) static inline FILETIME FtMulDw(DWORD dwLeft, FILETIME ftRight) { LONG64 l = (LONG64)dwLeft, *pr = (LONG64*)&ftRight; - union { FILETIME ft; LONG64 ll; } ftmap; + union { FILETIME ft; LONG64 ll; } ftmap; ftmap.ll = l * (*pr); return ftmap.ft; } @@ -207,7 +207,7 @@ static inline FILETIME FtMulDw(DWORD dwLeft, FILETIME ftRight) static inline FILETIME FtMulDwDw(DWORD dwLeft, DWORD dwRight) { LONG64 l = (LONG64)dwLeft, r = (LONG64)dwRight; - union { FILETIME ft; LONG64 ll; } ftmap; + union { FILETIME ft; LONG64 ll; } ftmap; ftmap.ll = l * r; return ftmap.ft; } @@ -253,17 +253,17 @@ DECLARE_INTERFACE_(IPropData,IMAPIProp) #define IPropData_AddRef(p) (p)->lpVtbl->AddRef(p) #define IPropData_Release(p) (p)->lpVtbl->Release(p) /*** IMAPIProp methods ***/ -#define IPropData_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c) -#define IPropData_SaveChanges(p,a) (p)->lpVtbl->SaveChanges(p,a) -#define IPropData_GetProps(p,a,b,c,d) (p)->lpVtbl->GetProps(p,a,b,c,d) -#define IPropData_GetPropList(p,a,b) (p)->lpVtbl->GetPropList(p,a,b) -#define IPropData_OpenProperty(p,a,b,c,d,e) (p)->lpVtbl->OpenProperty(p,a,b,c,d,e) -#define IPropData_SetProps(p,a,b,c) (p)->lpVtbl->SetProps(p,a,b,c) -#define IPropData_DeleteProps(p,a,b) (p)->lpVtbl->DeleteProps(p,a,b) -#define IPropData_CopyTo(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CopyTo(p,a,b,c,d,e,f,g,h,i) -#define IPropData_CopyProps(p,a,b,c,d,e,f,g) (p)->lpVtbl->CopyProps(p,a,b,c,d,e,f,g) -#define IPropData_GetNamesFromIDs(p,a,b,c,d,e) (p)->lpVtbl->GetNamesFromIDs(p,a,b,c,d,e) -#define IPropData_GetIDsFromNames(p,a,b,c,d) (p)->lpVtbl->GetIDsFromNames(p,a,b,c,d) +#define IPropData_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c) +#define IPropData_SaveChanges(p,a) (p)->lpVtbl->SaveChanges(p,a) +#define IPropData_GetProps(p,a,b,c,d) (p)->lpVtbl->GetProps(p,a,b,c,d) +#define IPropData_GetPropList(p,a,b) (p)->lpVtbl->GetPropList(p,a,b) +#define IPropData_OpenProperty(p,a,b,c,d,e) (p)->lpVtbl->OpenProperty(p,a,b,c,d,e) +#define IPropData_SetProps(p,a,b,c) (p)->lpVtbl->SetProps(p,a,b,c) +#define IPropData_DeleteProps(p,a,b) (p)->lpVtbl->DeleteProps(p,a,b) +#define IPropData_CopyTo(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CopyTo(p,a,b,c,d,e,f,g,h,i) +#define IPropData_CopyProps(p,a,b,c,d,e,f,g) (p)->lpVtbl->CopyProps(p,a,b,c,d,e,f,g) +#define IPropData_GetNamesFromIDs(p,a,b,c,d,e) (p)->lpVtbl->GetNamesFromIDs(p,a,b,c,d,e) +#define IPropData_GetIDsFromNames(p,a,b,c,d) (p)->lpVtbl->GetIDsFromNames(p,a,b,c,d) #define IPropData_HrSetObjAccess(p,a) (p)->lpVtbl->HrSetObjAccess(p,a) #define IPropData_HrSetPropAccess(p,a,b) (p)->lpVtbl->HrSetPropAccess(p,a,b) #define IPropData_HrGetPropAccess(p,a,b) (p)->lpVtbl->HrGetPropAccess(p,a,b) diff --git a/reactos/include/psdk/mlang.idl b/reactos/include/psdk/mlang.idl index 96e96facef3..0e371ec0c36 100644 --- a/reactos/include/psdk/mlang.idl +++ b/reactos/include/psdk/mlang.idl @@ -32,19 +32,19 @@ cpp_quote("#endif") ] interface IMLangCodePages : IUnknown { - HRESULT GetCharCodePages( + HRESULT GetCharCodePages( [in] WCHAR chSrc, DWORD *pdwCodePages); - HRESULT GetStrCodePages( + HRESULT GetStrCodePages( [in, size_is(cchSrc)] const WCHAR *pszSrc, [in] long cchSrc, [in] DWORD dwPriorityCodePages, [out] DWORD *pdwCodePages, [out] long *pcchCodePages); - HRESULT CodePageToCodePages( + HRESULT CodePageToCodePages( [in] UINT uCodePage, [out] DWORD *pdwCodePages); - HRESULT CodePagesToCodePage( + HRESULT CodePagesToCodePage( [in] DWORD dwCodePages, [in] UINT uDefaultCodePage, [out] UINT *puCodePage); @@ -62,13 +62,13 @@ interface IMLangFontLink : IMLangCodePages [in] HFONT hFont, [out] DWORD *pdwCodePages ); - HRESULT MapFont( + HRESULT MapFont( [in] HDC hDC, [in] DWORD dwCodePages, [in] HFONT hSrcFont, [out] HFONT *phDestFont); - HRESULT ReleaseFont( + HRESULT ReleaseFont( [in] HFONT hFont); HRESULT ResetFontMapping(); @@ -158,17 +158,17 @@ interface IEnumScript : IUnknown WCHAR wszProportionalFont[MAX_MIMEFACE_NAME]; } SCRIPTINFO, *PSCRIPTINFO; - HRESULT Clone( + HRESULT Clone( [out] IEnumScript **ppEnum); - HRESULT Next( + HRESULT Next( [in] ULONG celt, [out] PSCRIPTINFO rgelt, [out] ULONG *pceltFetched); HRESULT Reset(); - HRESULT Skip( + HRESULT Skip( [in] ULONG celt); } @@ -219,17 +219,17 @@ interface IEnumCodePage : IUnknown WCHAR wszCharset[MAX_MIMECSET_NAME]; } MIMECSETINFO, *PMIMECSETINFO; - HRESULT Clone( + HRESULT Clone( [out] IEnumCodePage **ppEnum); - HRESULT Next( + HRESULT Next( [in] ULONG celt, [out] PMIMECPINFO rgelt, [out] ULONG *pceltFetched); HRESULT Reset(); - HRESULT Skip( + HRESULT Skip( [in] ULONG celt); } @@ -240,33 +240,33 @@ interface IEnumCodePage : IUnknown ] interface IMLangConvertCharset : IUnknown { - HRESULT Initialize( + HRESULT Initialize( [in] UINT uiSrcCodePage, [in] UINT uiDstCodePage, [in] DWORD dwProperty); - HRESULT GetSourceCodePage( + HRESULT GetSourceCodePage( [out] UINT *puiSrcCodePage); - HRESULT GetDestinationCodePage( + HRESULT GetDestinationCodePage( [out] UINT *puiDstCodePage); - HRESULT GetProperty( + HRESULT GetProperty( [out] DWORD *pdwProperty); - HRESULT DoConversion( + HRESULT DoConversion( [in] BYTE *pSrcStr, [in,out] UINT *pcSrcSize, [in] BYTE *pDstStr, [in,out] UINT *pcDstSize); - HRESULT DoConversionToUnicode( + HRESULT DoConversionToUnicode( [in] CHAR *pSrcStr, [in,out] UINT *pcSrcSize, [in] WCHAR *pDstStr, [in,out] UINT *pcDstSize); - HRESULT DoConversionFromUnicode( + HRESULT DoConversionFromUnicode( [in] WCHAR *pSrcStr, [in,out] UINT *pcSrcSize, [in] CHAR *pDstStr, @@ -298,17 +298,17 @@ interface IEnumRfc1766 : IUnknown WCHAR wszLocaleName[MAX_LOCALE_NAME]; } RFC1766INFO, *PRFC1766INFO; - HRESULT Clone( + HRESULT Clone( [out] IEnumRfc1766 **ppEnum); - HRESULT Next( + HRESULT Next( [in] ULONG celt, [out] PRFC1766INFO rgelt, [out] ULONG *pceltFetched); HRESULT Reset(); - HRESULT Skip( + HRESULT Skip( [in] ULONG celt); } @@ -319,30 +319,30 @@ interface IEnumRfc1766 : IUnknown ] interface IMultiLanguage : IUnknown { - HRESULT GetNumberOfCodePageInfo( + HRESULT GetNumberOfCodePageInfo( [out] UINT *pcCodePage); - HRESULT GetCodePageInfo( + HRESULT GetCodePageInfo( [in] UINT uiCodePage, [out] PMIMECPINFO pCodePageInfo); - HRESULT GetFamilyCodePage( + HRESULT GetFamilyCodePage( [in] UINT uiCodePage, [out] UINT *puiFamilyCodePage); - HRESULT EnumCodePages( + HRESULT EnumCodePages( [in] DWORD grfFlags, [out] IEnumCodePage **ppEnumCodePage); - HRESULT GetCharsetInfo( + HRESULT GetCharsetInfo( [in] BSTR Charset, [in] PMIMECSETINFO pCharsetInfo); - HRESULT IsConvertible( + HRESULT IsConvertible( [in] DWORD dwSrcEncoding, [in] DWORD dwDstEncoding); - HRESULT ConvertString( + HRESULT ConvertString( [in,out] DWORD *pdwMode, [in] DWORD dwSrcEncoding, [in] DWORD dwDstEncoding, @@ -351,7 +351,7 @@ interface IMultiLanguage : IUnknown [in] BYTE *pDstStr, [in,out] UINT *pcDstSize); - HRESULT ConvertStringToUnicode( + HRESULT ConvertStringToUnicode( [in,out] DWORD *pdwMode, [in] DWORD dwEncoding, [in] CHAR *pSrcStr, @@ -359,7 +359,7 @@ interface IMultiLanguage : IUnknown [in] WCHAR *pDstStr, [in,out] UINT *pcDstSize); - HRESULT ConvertStringFromUnicode( + HRESULT ConvertStringFromUnicode( [in,out] DWORD *pdwMode, [in] DWORD dwEncoding, [in] WCHAR *pSrcStr, @@ -369,22 +369,22 @@ interface IMultiLanguage : IUnknown HRESULT ConvertStringReset(); - HRESULT GetRfc1766FromLcid( + HRESULT GetRfc1766FromLcid( [in] LCID Locale, [out] BSTR *pbstrRfc1766); - HRESULT GetLcidFromRfc1766( + HRESULT GetLcidFromRfc1766( [out] LCID *pLocale, [in] BSTR bstrRfc1766); - HRESULT EnumRfc1766( + HRESULT EnumRfc1766( [out] IEnumRfc1766 **ppEnumRfc1766); - HRESULT GetRfc1766Info( + HRESULT GetRfc1766Info( [in] LCID Locale, [out] PRFC1766INFO pRfc1766Info); - HRESULT CreateConvertCharset( + HRESULT CreateConvertCharset( [in] UINT uiSrcCodePage, [in] UINT uiDstCodePage, [in] DWORD dwProperty, @@ -407,32 +407,32 @@ interface IMultiLanguage2 : IUnknown INT nConfidence; } DetectEncodingInfo, *pDetectEncodingInfo; - HRESULT GetNumberOfCodePageInfo( + HRESULT GetNumberOfCodePageInfo( [out] UINT *pcCodePage); - HRESULT GetCodePageInfo( + HRESULT GetCodePageInfo( [in] UINT uiCodePage, [in] LANGID LangId, [out] PMIMECPINFO pCodePageInfo); - HRESULT GetFamilyCodePage( + HRESULT GetFamilyCodePage( [in] UINT uiCodePage, [out] UINT *puiFamilyCodePage); - HRESULT EnumCodePages( + HRESULT EnumCodePages( [in] DWORD grfFlags, [in] LANGID LangId, [out] IEnumCodePage **ppEnumCodePage); - HRESULT GetCharsetInfo( + HRESULT GetCharsetInfo( [in] BSTR Charset, [in] PMIMECSETINFO pCharsetInfo); - HRESULT IsConvertible( + HRESULT IsConvertible( [in] DWORD dwSrcEncoding, [in] DWORD dwDstEncoding); - HRESULT ConvertString( + HRESULT ConvertString( [in,out] DWORD *pdwMode, [in] DWORD dwSrcEncoding, [in] DWORD dwDstEncoding, @@ -441,7 +441,7 @@ interface IMultiLanguage2 : IUnknown [in] BYTE *pDstStr, [in,out] UINT *pcDstSize); - HRESULT ConvertStringToUnicode( + HRESULT ConvertStringToUnicode( [in,out] DWORD *pdwMode, [in] DWORD dwEncoding, [in] CHAR *pSrcStr, @@ -449,7 +449,7 @@ interface IMultiLanguage2 : IUnknown [in] WCHAR *pDstStr, [in,out] UINT *pcDstSize); - HRESULT ConvertStringFromUnicode( + HRESULT ConvertStringFromUnicode( [in,out] DWORD *pdwMode, [in] DWORD dwEncoding, [in] WCHAR *pSrcStr, @@ -459,30 +459,30 @@ interface IMultiLanguage2 : IUnknown HRESULT ConvertStringReset(); - HRESULT GetRfc1766FromLcid( + HRESULT GetRfc1766FromLcid( [in] LCID Locale, [out] BSTR *pbstrRfc1766); - HRESULT GetLcidFromRfc1766( + HRESULT GetLcidFromRfc1766( [out] LCID *pLocale, [in] BSTR bstrRfc1766); - HRESULT EnumRfc1766( + HRESULT EnumRfc1766( [in] LANGID LangId, [out] IEnumRfc1766 **ppEnumRfc1766); - HRESULT GetRfc1766Info( + HRESULT GetRfc1766Info( [in] LCID Locale, [in] LANGID LangId, [out] PRFC1766INFO pRfc1766Info); - HRESULT CreateConvertCharset( + HRESULT CreateConvertCharset( [in] UINT uiSrcCodePage, [in] UINT uiDstCodePage, [in] DWORD dwProperty, [out] IMLangConvertCharset **ppMLangConvertCharset); - HRESULT ConvertStringInIStream( + HRESULT ConvertStringInIStream( [in,out] DWORD *pdwMode, [in] DWORD dwFlag, [in] WCHAR *lpFallBack, @@ -491,7 +491,7 @@ interface IMultiLanguage2 : IUnknown [in] IStream *pstmIn, [in] IStream *pstmOut); - HRESULT ConvertStringToUnicodeEx( + HRESULT ConvertStringToUnicodeEx( [in,out] DWORD *pdwMode, [in] DWORD dwEncoding, [in] CHAR *pSrcStr, @@ -511,14 +511,14 @@ interface IMultiLanguage2 : IUnknown [in] DWORD dwFlag, [in] WCHAR *lpFallBack); - HRESULT DetectCodepageInIStream( + HRESULT DetectCodepageInIStream( [in] DWORD dwFlag, [in] DWORD dwPrefWinCodePage, [in] IStream *pstmIn, [in,out] DetectEncodingInfo *lpEncoding, [in,out] INT *pnScores); - HRESULT DetectInputCodepage( + HRESULT DetectInputCodepage( [in] DWORD dwFlag, [in] DWORD dwPrefWinCodePage, [in] CHAR *pSrcStr, @@ -530,7 +530,7 @@ interface IMultiLanguage2 : IUnknown [in] UINT uiCodePage, [in] HWND hwnd); - HRESULT GetCodePageDescription( + HRESULT GetCodePageDescription( [in] UINT uiCodePage, [in] LCID lcid, [in,out] LPWSTR lpWideCharStr, @@ -539,13 +539,13 @@ interface IMultiLanguage2 : IUnknown HRESULT IsCodePageInstallable( [in] UINT uiCodePage); - HRESULT SetMimeDBSource( + HRESULT SetMimeDBSource( [in] MIMECONTF dwSource); - HRESULT GetNumberOfScripts( + HRESULT GetNumberOfScripts( [out] UINT *pnScripts); - HRESULT EnumScripts( + HRESULT EnumScripts( [in] DWORD dwFlags, [in] LANGID LangId, [out] IEnumScript **ppEnumScript); diff --git a/reactos/include/psdk/mshtmhst.idl b/reactos/include/psdk/mshtmhst.idl index 344a88f2d10..5b24d63cc07 100644 --- a/reactos/include/psdk/mshtmhst.idl +++ b/reactos/include/psdk/mshtmhst.idl @@ -157,9 +157,9 @@ interface IDocHostUIHandler : IUnknown } DOCHOSTUIINFO; HRESULT ShowContextMenu( - [in] DWORD dwID, - [in] POINT *ppt, - [in] IUnknown *pcmdtReserved, + [in] DWORD dwID, + [in] POINT *ppt, + [in] IUnknown *pcmdtReserved, [in] IDispatch *pdispReserved); HRESULT GetHostInfo([in, out] DOCHOSTUIINFO *pInfo); @@ -188,7 +188,7 @@ interface IDocHostUIHandler : IUnknown HRESULT TranslateAccelerator( [in] LPMSG lpMsg, - [in] const GUID *pguidCmdGroup, + [in] const GUID *pguidCmdGroup, [in] DWORD nCmdID); HRESULT GetOptionKeyPath( @@ -196,7 +196,7 @@ interface IDocHostUIHandler : IUnknown [in] DWORD dw); HRESULT GetDropTarget( - [in] IDropTarget *pDropTarget, + [in] IDropTarget *pDropTarget, [out] IDropTarget **ppDropTarget); HRESULT GetExternal([out] IDispatch **ppDispatch); diff --git a/reactos/include/psdk/mshtml.idl b/reactos/include/psdk/mshtml.idl index 97316f9a94a..c74acd575ba 100644 --- a/reactos/include/psdk/mshtml.idl +++ b/reactos/include/psdk/mshtml.idl @@ -1763,7 +1763,7 @@ interface IHTMLElement : IDispatch [propput, id(DISPID_IHTMLELEMENT_ONKEYUP)] HRESULT onkeyup([in] VARIANT v); - + [propget, id(DISPID_IHTMLELEMENT_ONKEYUP)] HRESULT onkeyup([retval, out] VARIANT *p); @@ -4881,7 +4881,7 @@ interface IHTMLDocument3 : IDispatch [propget, id(DISPID_IHTMLDOCUMENT3_UNIQUEID), hidden] HRESULT uniqueID([retval, out] BSTR *p); - + [id(DISPID_IHTMLDOCUMENT3_ATTACHEVENT)] HRESULT attachEvent( [in] BSTR event, diff --git a/reactos/include/psdk/msxml.idl b/reactos/include/psdk/msxml.idl index 2d4ecc972c8..ec1f6458c5e 100644 --- a/reactos/include/psdk/msxml.idl +++ b/reactos/include/psdk/msxml.idl @@ -208,7 +208,7 @@ interface IXMLElement2 : IDispatch HRESULT removeChild([in]IXMLElement2 *pChildElem); [propget, id(DISPID_XMLELEMENT_ATTRIBUTES)] - HRESULT attributes([retval, out] IXMLElementCollection **pp); + HRESULT attributes([retval, out] IXMLElementCollection **pp); } [ @@ -238,7 +238,7 @@ interface IXMLDocument2 : IDispatch [propget, id(DISPID_XMLDOCUMENT_MIMETYPE)] HRESULT mimeType([retval, out] BSTR *p); - + [propget, id(DISPID_XMLDOCUMENT_READYSTATE)] HRESULT readyState([retval, out]long *pl); @@ -259,8 +259,8 @@ interface IXMLDocument2 : IDispatch [id(DISPID_XMLDOCUMENT_CREATEELEMENT)] HRESULT createElement( - [in] VARIANT vType, - [optional, in] VARIANT var, + [in] VARIANT vType, + [optional, in] VARIANT var, [retval, out] IXMLElement2 **ppElem); [propget, id(DISPID_XMLDOCUMENT_ASYNC)] @@ -322,8 +322,8 @@ interface IXMLError : IUnknown ] interface IXMLElementNotificationSink : IDispatch { - [id(DISPID_XMLNOTIFSINK_CHILDADDED)] - HRESULT ChildAdded([in]IDispatch *pChildElem); + [id(DISPID_XMLNOTIFSINK_CHILDADDED)] + HRESULT ChildAdded([in]IDispatch *pChildElem); } [ diff --git a/reactos/include/psdk/msxml2.idl b/reactos/include/psdk/msxml2.idl index fb32a79cff9..b2cf4030c69 100644 --- a/reactos/include/psdk/msxml2.idl +++ b/reactos/include/psdk/msxml2.idl @@ -51,8 +51,8 @@ cpp_quote("#define DOMDocument DOMDocument2") cpp_quote("#define CLSID_DOMDocument CLSID_DOMDocument2") cpp_quote("#ifndef __WIDL_XMLDOM_H") -typedef enum tagDOMNodeType -{ +typedef enum tagDOMNodeType +{ NODE_INVALID = 0, NODE_ELEMENT = 1, NODE_ATTRIBUTE = 2, @@ -272,13 +272,13 @@ interface IXMLDOMDocument : IXMLDOMNode [id(DISPID_XMLDOM_DOCUMENT_CREATENODE)] HRESULT createNode( - [in] VARIANT var, - [in] BSTR name, + [in] VARIANT var, + [in] BSTR name, [in] BSTR uri, [retval, out] IXMLDOMNode **node); [id(DISPID_XMLDOM_DOCUMENT_NODEFROMID)] - HRESULT nodeFromID( + HRESULT nodeFromID( [in] BSTR id, [retval, out] IXMLDOMNode **node); @@ -306,12 +306,12 @@ interface IXMLDOMDocument : IXMLDOMNode HRESULT abort(); [id(DISPID_XMLDOM_DOCUMENT_LOADXML)] - HRESULT loadXML( + HRESULT loadXML( [in] BSTR p, [out, retval] VARIANT_BOOL *pbool); [id(DISPID_XMLDOM_DOCUMENT_SAVE)] - HRESULT save( + HRESULT save( [in] VARIANT var1); [propget, id(DISPID_XMLDOM_DOCUMENT_VALIDATE)] @@ -461,7 +461,7 @@ interface IXMLDOMSelection : IXMLDOMNodeList [in] IXMLDOMNode *pNode, [retval, out] IXMLDOMNode **ppNode); - [id(DISPID_XMLDOM_SELECTION_REMOVENEXT)] + [id(DISPID_XMLDOM_SELECTION_REMOVENEXT)] HRESULT removeNext( [retval, out] IXMLDOMNode **ppNode); @@ -533,13 +533,13 @@ interface IXMLDOMNamedNodeMap : IDispatch [propget, id(DISPID_NEWENUM)] HRESULT _newEnum([retval, out] IUnknown **ppUnk); } - + [ local, object, uuid (3efaa413-272f-11d2-836f-0000f87a7782) ] -interface IXMLDOMDocumentFragment : IXMLDOMNode +interface IXMLDOMDocumentFragment : IXMLDOMNode { } @@ -548,7 +548,7 @@ local, object, uuid (2933BF84-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMCharacterData : IXMLDOMNode +interface IXMLDOMCharacterData : IXMLDOMNode { [propget, id(DISPID_DOM_DATA_DATA)] HRESULT data([retval, out] BSTR *p); @@ -591,7 +591,7 @@ local, object, uuid (2933BF85-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMAttribute : IXMLDOMNode +interface IXMLDOMAttribute : IXMLDOMNode { [propget, id(DISPID_DOM_ATTRIBUTE_GETNAME)] HRESULT name([retval, out] BSTR *p); @@ -608,7 +608,7 @@ local, object, uuid (2933BF86-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMElement : IXMLDOMNode +interface IXMLDOMElement : IXMLDOMNode { [propget, id(DISPID_DOM_ELEMENT_GETTAGNAME)] HRESULT tagName([retval, out] BSTR *p); @@ -656,7 +656,7 @@ local, object, uuid (2933BF87-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMText : IXMLDOMCharacterData +interface IXMLDOMText : IXMLDOMCharacterData { [id(DISPID_DOM_TEXT_SPLITTEXT)] HRESULT splitText( @@ -669,7 +669,7 @@ local, object, uuid (2933BF88-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMComment : IXMLDOMCharacterData +interface IXMLDOMComment : IXMLDOMCharacterData { } @@ -678,7 +678,7 @@ local, object, uuid (2933BF89-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMProcessingInstruction : IXMLDOMNode +interface IXMLDOMProcessingInstruction : IXMLDOMNode { [propget, id(DISPID_DOM_PI_TARGET)] HRESULT target([retval, out] BSTR *p); @@ -695,7 +695,7 @@ local, object, uuid (2933BF8A-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMCDATASection : IXMLDOMText +interface IXMLDOMCDATASection : IXMLDOMText { } @@ -704,7 +704,7 @@ local, object, uuid (2933BF8B-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMDocumentType : IXMLDOMNode +interface IXMLDOMDocumentType : IXMLDOMNode { [propget, id(DISPID_DOM_DOCUMENTTYPE_NAME)] HRESULT name([retval, out] BSTR *p); @@ -721,7 +721,7 @@ local, object, uuid (2933BF8C-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMNotation : IXMLDOMNode +interface IXMLDOMNotation : IXMLDOMNode { [propget, id(DISPID_DOM_NOTATION_PUBLICID)] HRESULT publicId([retval, out] VARIANT *id); @@ -735,7 +735,7 @@ local, object, uuid (2933BF8D-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMEntity : IXMLDOMNode +interface IXMLDOMEntity : IXMLDOMNode { [propget, id(DISPID_DOM_ENTITY_PUBLICID)] HRESULT publicId([retval, out] VARIANT *id1); @@ -752,7 +752,7 @@ local, object, uuid (2933BF8E-7B36-11d2-B20E-00C04F983E60) ] -interface IXMLDOMEntityReference : IXMLDOMNode +interface IXMLDOMEntityReference : IXMLDOMNode { } @@ -777,55 +777,55 @@ uuid (3efaa425-272f-11d2-836f-0000f87a7782) ] interface IXTLRuntime : IXMLDOMNode { - [id(DISPID_XTLRUNTIME_UNIQUEID)] + [id(DISPID_XTLRUNTIME_UNIQUEID)] HRESULT uniqueID( - [in]IXMLDOMNode *pNode, + [in]IXMLDOMNode *pNode, [retval, out]long *pID); [id(DISPID_XTLRUNTIME_DEPTH)] HRESULT depth( - [in] IXMLDOMNode *pNode, + [in] IXMLDOMNode *pNode, [retval, out]long * pDepth); - [id(DISPID_XTLRUNTIME_CHILDNUMBER)] + [id(DISPID_XTLRUNTIME_CHILDNUMBER)] HRESULT childNumber( - [in]IXMLDOMNode *pNode, + [in]IXMLDOMNode *pNode, [retval, out] long *pNumber); [id(DISPID_XTLRUNTIME_ANCESTORCHILDNUMBER)] HRESULT ancestorChildNumber( - [in]BSTR bstr, - [in]IXMLDOMNode *pNode, + [in]BSTR bstr, + [in]IXMLDOMNode *pNode, [retval, out]long *pNumber); [id(DISPID_XTLRUNTIME_ABSOLUTECHILDNUMBER)] HRESULT absoluteChildNumber( - [in]IXMLDOMNode *pNode, + [in]IXMLDOMNode *pNode, [retval, out]long *pNumber); [id(DISPID_XTLRUNTIME_FORMATINDEX)] HRESULT formatIndex( - [in] long lIndex, - [in] BSTR bstr, + [in] long lIndex, + [in] BSTR bstr, [retval, out]BSTR *pbstr); [id(DISPID_XTLRUNTIME_FORMATNUMBER)] HRESULT formatNumber( - [in] double dblNumber, - [in] BSTR bstr, + [in] double dblNumber, + [in] BSTR bstr, [retval, out]BSTR *pbstr); [id(DISPID_XTLRUNTIME_FORMATDATE)] HRESULT formatDate( - [in] VARIANT var1, - [in] BSTR bstr, + [in] VARIANT var1, + [in] BSTR bstr, [optional, in] VARIANT var2, [retval, out]BSTR *pbstr); [id(DISPID_XTLRUNTIME_FORMATTIME)] HRESULT formatTime( - [in] VARIANT var1, - [in] BSTR bstr, + [in] VARIANT var1, + [in] BSTR bstr, [optional, in] VARIANT var2, [retval, out]BSTR *pbstr); @@ -834,14 +834,14 @@ interface IXTLRuntime : IXMLDOMNode [ uuid(3efaa427-272f-11d2-836f-0000f87a7782) ] -dispinterface XMLDOMDocumentEvents +dispinterface XMLDOMDocumentEvents { properties: methods: - [id (DISPID_XMLDOMEVENT_ONDATAAVAILABLE)] + [id (DISPID_XMLDOMEVENT_ONDATAAVAILABLE)] HRESULT ondataavailable(); - - [id (DISPID_XMLDOMEVENT_ONREADYSTATECHANGE)] + + [id (DISPID_XMLDOMEVENT_ONREADYSTATECHANGE)] HRESULT onreadystatechange(); } @@ -863,7 +863,7 @@ interface IXSLProcessor : IDispatch [id(DISPID_XMLDOM_PROCESSOR_SETSTARTMODE)] HRESULT setStartMode( - [in] BSTR p, + [in] BSTR p, [in, defaultvalue("")] BSTR uri); [propget, id(DISPID_XMLDOM_PROCESSOR_STARTMODE)] @@ -890,18 +890,18 @@ interface IXSLProcessor : IDispatch [id(DISPID_XMLDOM_PROCESSOR_ADDPARAMETER)] HRESULT addParameter( - [in] BSTR p, - [in] VARIANT var, + [in] BSTR p, + [in] VARIANT var, [in, defaultvalue("")] BSTR uri); [id(DISPID_XMLDOM_PROCESSOR_ADDOBJECT)] HRESULT addObject( - [in] IDispatch* obj, + [in] IDispatch* obj, [in] BSTR uri); [propget, id(DISPID_XMLDOM_PROCESSOR_STYLESHEET)] HRESULT stylesheet([retval, out] IXMLDOMNode **node); -} +} [ local, @@ -919,7 +919,7 @@ interface IXSLTemplate : IDispatch [id(DISPID_XMLDOM_TEMPLATE_CREATEPROCESSOR)] HRESULT createProcessor( [retval, out] IXSLProcessor **ppProcessor); -} +} [ local, diff --git a/reactos/include/psdk/ntgdi.h b/reactos/include/psdk/ntgdi.h index 4f686af8cca..28db5f7a35c 100644 --- a/reactos/include/psdk/ntgdi.h +++ b/reactos/include/psdk/ntgdi.h @@ -100,7 +100,7 @@ NtGdiSetDIBitsToDeviceInternal( W32KAPI BOOL APIENTRY -NtGdiGetFontResourceInfoInternalW( +NtGdiGetFontResourceInfoInternalW( IN LPWSTR pwszFiles, IN ULONG cwc, IN ULONG cFiles, @@ -158,7 +158,7 @@ NtGdiArcInternal( ); W32KAPI -INT +INT APIENTRY NtGdiStretchDIBitsInternal( IN HDC hdc, @@ -342,14 +342,14 @@ NtGdiGetEmbUFI( W32KAPI ULONG -APIENTRY +APIENTRY NtGdiGetEmbedFonts( VOID ); W32KAPI BOOL -APIENTRY +APIENTRY NtGdiChangeGhostFont( IN KERNEL_PVOID *pfontID, IN BOOL bLoad @@ -357,7 +357,7 @@ NtGdiChangeGhostFont( W32KAPI BOOL -APIENTRY +APIENTRY NtGdiAddEmbFontToDC( IN HDC hdc, IN VOID **pFontID @@ -383,7 +383,7 @@ NtGdiPolyPolyDraw( W32KAPI LONG -APIENTRY +APIENTRY NtGdiDoPalette( IN HGDIOBJ hObj, IN WORD iStart, @@ -1265,7 +1265,7 @@ NtGdiDeleteClientObj( W32KAPI LONG -APIENTRY +APIENTRY NtGdiGetBitmapBits( IN HBITMAP hbm, IN ULONG cjMax, @@ -1368,7 +1368,7 @@ NtGdiCreateHatchBrushInternal( W32KAPI HPEN -APIENTRY +APIENTRY NtGdiExtCreatePen( IN ULONG flPenStyle, IN ULONG ulWidth, @@ -1385,7 +1385,7 @@ NtGdiExtCreatePen( W32KAPI HRGN -APIENTRY +APIENTRY NtGdiCreateEllipticRgn( IN INT xLeft, IN INT yTop, @@ -1395,7 +1395,7 @@ NtGdiCreateEllipticRgn( W32KAPI HRGN -APIENTRY +APIENTRY NtGdiCreateRoundRectRgn( IN INT xLeft, IN INT yTop, @@ -1419,7 +1419,7 @@ NtGdiCreateServerMetaFile( W32KAPI HRGN -APIENTRY +APIENTRY NtGdiExtCreateRegion( IN OPTIONAL LPXFORM px, IN DWORD cj, @@ -1488,7 +1488,7 @@ NtGdiGetBitmapDimension( W32KAPI UINT -APIENTRY +APIENTRY NtGdiGetNearestPaletteIndex( IN HPALETTE hpal, IN COLORREF crColor @@ -1598,7 +1598,7 @@ NtGdiGetCharABCWidthsW( IN OPTIONAL PWCHAR pwch, IN FLONG fl, OUT PVOID pvBuf -); +); W32KAPI DWORD @@ -1697,7 +1697,7 @@ NtGdiFlattenPath( W32KAPI HRGN -APIENTRY +APIENTRY NtGdiPathToRegion( IN HDC hdc ); @@ -2020,7 +2020,7 @@ NtGdiEnumObjects( // But this can't be specified with current annotation language. // // typedef struct _DRIVER_INFO_2W DRIVER_INFO_2W; -// +// // :end note. W32KAPI BOOL @@ -2180,7 +2180,7 @@ NtGdiTransformPoints( W32KAPI LONG -APIENTRY +APIENTRY NtGdiConvertMetafileRect( IN HDC hdc, IN OUT PRECTL prect @@ -2243,7 +2243,7 @@ NtGdiSelectBrush( W32KAPI HPEN -APIENTRY +APIENTRY NtGdiSelectPen( IN HDC hdc, IN HPEN hpen @@ -2276,7 +2276,7 @@ NtGdiExtSelectClipRgn( W32KAPI HPEN -APIENTRY +APIENTRY NtGdiCreatePen( IN INT iPenStyle, IN INT iPenWidth, @@ -2416,7 +2416,7 @@ NtGdiIntersectClipRect( W32KAPI HRGN -APIENTRY +APIENTRY NtGdiCreateRectRgn( IN INT xLeft, IN INT yTop, @@ -2609,7 +2609,7 @@ NtGdiSetRectRgn( W32KAPI LONG -APIENTRY +APIENTRY NtGdiSetBitmapBits( IN HBITMAP hbm, IN ULONG cj, @@ -2644,7 +2644,7 @@ W32KAPI INT APIENTRY NtGdiGetRandomRgn( - IN HDC hDC, + IN HDC hDC, OUT HRGN hDest, IN INT iCode ); @@ -2693,14 +2693,14 @@ NtGdiGetNearestColor( W32KAPI UINT -APIENTRY +APIENTRY NtGdiGetSystemPaletteUse( IN HDC hdc ); W32KAPI UINT -APIENTRY +APIENTRY NtGdiSetSystemPaletteUse( IN HDC hdc, IN UINT ui @@ -2805,7 +2805,7 @@ APIENTRY NtGdiQueryFonts( OUT PUNIVERSAL_FONT_ID pufiFontList, IN ULONG nBufferSize, - OUT PLARGE_INTEGER pTimeStamp + OUT PLARGE_INTEGER pTimeStamp ); W32KAPI @@ -2830,21 +2830,21 @@ NtGdiFullscreenControl( ); W32KAPI -DWORD +DWORD NtGdiGetCharSet( IN HDC hdc ); W32KAPI BOOL -APIENTRY +APIENTRY NtGdiEnableEudc( IN BOOL ); W32KAPI BOOL -APIENTRY +APIENTRY NtGdiEudcLoadUnloadLink( IN OPTIONAL LPCWSTR pBaseFaceName, IN UINT cwcBaseFaceName, @@ -2857,7 +2857,7 @@ NtGdiEudcLoadUnloadLink( W32KAPI UINT -APIENTRY +APIENTRY NtGdiGetStringBitmapW( IN HDC hdc, IN LPWSTR pwsz, @@ -2884,7 +2884,7 @@ NtGdiQueryFontAssocInfo( #if (_WIN32_WINNT >= 0x0500) W32KAPI -DWORD +DWORD NtGdiGetFontUnicodeRanges( IN HDC hdc, OUT OPTIONAL LPGLYPHSET pgs @@ -2893,7 +2893,7 @@ NtGdiGetFontUnicodeRanges( #ifdef LANGPACK W32KAPI -BOOL +BOOL NtGdiGetRealizationInfo( IN HDC hdc, OUT PREALIZATION_INFO pri, @@ -2902,7 +2902,7 @@ NtGdiGetRealizationInfo( #endif W32KAPI -BOOL +BOOL NtGdiAddRemoteMMInstanceToDC( IN HDC hdc, IN DOWNLOADDESIGNVECTOR *pddv, @@ -3368,7 +3368,7 @@ NtGdiFONTOBJ_cGetAllGlyphHandles( W32KAPI PVOID -APIENTRY +APIENTRY NtGdiFONTOBJ_pvTrueTypeFontFile( IN FONTOBJ *pfo, OUT ULONG *pcjFile @@ -3462,7 +3462,7 @@ APIENTRY NtGdiPATHOBJ_bEnum( IN PATHOBJ *ppo, OUT PATHDATA *ppd -); +); W32KAPI VOID @@ -3556,13 +3556,13 @@ NtGdiMirrorWindowOrg( W32KAPI LONG -APIENTRY +APIENTRY NtGdiGetDeviceWidth( IN HDC hdc ); W32KAPI -BOOL +BOOL NtGdiSetPUMPDOBJ( IN HUMPD humpd, IN BOOL bStoreID, @@ -3571,14 +3571,14 @@ NtGdiSetPUMPDOBJ( ); W32KAPI -BOOL +BOOL NtGdiBRUSHOBJ_DeleteRbrush( IN BRUSHOBJ *pbo, IN BRUSHOBJ *pboB ); W32KAPI -BOOL +BOOL NtGdiUMPDEngFreeUserMem( IN KERNEL_PVOID *ppv ); @@ -3648,8 +3648,8 @@ NtGdiInitSpool(); W32KAPI INT APIENTRY -NtGdiGetSpoolMessage( DWORD u1, - DWORD u2, - DWORD u3, +NtGdiGetSpoolMessage( DWORD u1, + DWORD u2, + DWORD u3, DWORD u4); #endif diff --git a/reactos/include/psdk/oaidl.idl b/reactos/include/psdk/oaidl.idl index 7f2f7011177..3c03525511c 100644 --- a/reactos/include/psdk/oaidl.idl +++ b/reactos/include/psdk/oaidl.idl @@ -1162,7 +1162,7 @@ interface ITypeChangeEvents : IUnknown [in] ITypeInfo *pTInfoBefore, [in] LPOLESTR pStrName, [out] INT *pfCancel); - + HRESULT AfterTypeChange( [in] CHANGEKIND changeKind, [in] ITypeInfo *pTInfoAfter, @@ -1472,25 +1472,25 @@ interface ICreateTypeInfo2 : ICreateTypeInfo [in] REFGUID guid, [in] VARIANT *pVarVal); - HRESULT SetFuncCustData( - [in] UINT index, - [in] REFGUID guid, - [in] VARIANT *pVarVal); - - HRESULT SetParamCustData( - [in] UINT indexFunc, - [in] UINT indexParam, - [in] REFGUID guid, + HRESULT SetFuncCustData( + [in] UINT index, + [in] REFGUID guid, [in] VARIANT *pVarVal); - HRESULT SetVarCustData( - [in] UINT index, - [in] REFGUID guid, + HRESULT SetParamCustData( + [in] UINT indexFunc, + [in] UINT indexParam, + [in] REFGUID guid, [in] VARIANT *pVarVal); - HRESULT SetImplTypeCustData( - [in] UINT index, - [in] REFGUID guid, + HRESULT SetVarCustData( + [in] UINT index, + [in] REFGUID guid, + [in] VARIANT *pVarVal); + + HRESULT SetImplTypeCustData( + [in] UINT index, + [in] REFGUID guid, [in] VARIANT *pVarVal); HRESULT SetHelpStringContext( diff --git a/reactos/include/psdk/objidl.idl b/reactos/include/psdk/objidl.idl index f7a5b12ae94..4982878fde0 100644 --- a/reactos/include/psdk/objidl.idl +++ b/reactos/include/psdk/objidl.idl @@ -2192,7 +2192,7 @@ interface IRpcOptions : IUnknown enum { COMBND_RPCTIMEOUT = 1, COMBND_SERVER_LOCALITY = 2 -}; +}; enum { SERVER_LOCALITY_PROCESS_LOCAL = 0, diff --git a/reactos/include/psdk/ocidl.idl b/reactos/include/psdk/ocidl.idl index 9fe9517e66e..47ace767e5d 100644 --- a/reactos/include/psdk/ocidl.idl +++ b/reactos/include/psdk/ocidl.idl @@ -583,10 +583,10 @@ interface IProvideMultipleClassInfo : IProvideClassInfo2 typedef IProvideMultipleClassInfo *LPPROVIDEMULTIPLECLASSINFO; - HRESULT GetMultiTypeInfoCount( + HRESULT GetMultiTypeInfoCount( [out] ULONG *pcti); - HRESULT GetInfoOfIndex( + HRESULT GetInfoOfIndex( [in] ULONG iti, [in] DWORD dwFlags, [out] ITypeInfo **pptiCoClass, @@ -1156,7 +1156,7 @@ interface IObjectWithSite : IUnknown [in] IUnknown * pUnkSite); HRESULT GetSite( - [in] REFIID riid, + [in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite); } @@ -1285,7 +1285,7 @@ interface IQuickActivate : IUnknown } QACONTAINERFLAGS; typedef DWORD OLE_COLOR; - + typedef struct tagQACONTAINER { ULONG cbSize; diff --git a/reactos/include/psdk/pstore.idl b/reactos/include/psdk/pstore.idl index 06f5132a5c5..07fb2d6322c 100644 --- a/reactos/include/psdk/pstore.idl +++ b/reactos/include/psdk/pstore.idl @@ -245,9 +245,9 @@ interface IPStore : IUnknown [in] PPST_PROMPTIFO pProomptInfo, [in] DWORD dwFlags ); - HRESULT CloseItem( - [in] PST_KEY Key, - [in] const GUID* pItemType, + HRESULT CloseItem( + [in] PST_KEY Key, + [in] const GUID* pItemType, [in] const GUID* pItemSubtype, [in] LPCWSTR* szItemName, [in] DWORD dwFlags ); diff --git a/reactos/include/psdk/richedit.h b/reactos/include/psdk/richedit.h index b58a3145a10..c722f2168fc 100644 --- a/reactos/include/psdk/richedit.h +++ b/reactos/include/psdk/richedit.h @@ -675,7 +675,7 @@ typedef struct _settextex { } SETTEXTEX; /* Flags of the EM_SETTEXTEX message */ -#define ST_DEFAULT 0x00000000 +#define ST_DEFAULT 0x00000000 #define ST_KEEPUNDO 0x00000001 #define ST_SELECTION 0x00000002 diff --git a/reactos/include/psdk/rpc.h b/reactos/include/psdk/rpc.h index 1b1c00d0d7e..27e1c6273d4 100644 --- a/reactos/include/psdk/rpc.h +++ b/reactos/include/psdk/rpc.h @@ -27,7 +27,7 @@ extern "C" { #define __RPC_WIN32__ #include -#else +#else #if defined(_M_IA64) || defined(_M_AMD64) || defined(_WIN64) #define __RPC_WIN64__ #else @@ -78,17 +78,17 @@ typedef long RPC_STATUS; #if !defined(_RPCRT4_) #define RPCRTAPI DECLSPEC_IMPORT #else - #define RPCRTAPI + #define RPCRTAPI #endif #if !defined(_RPCNS4_) #define RPCNSAPI DECLSPEC_IMPORT #else - #define RPCNSAPI + #define RPCNSAPI #endif #else - #define RPCRTAPI - #define RPCNSAPI + #define RPCRTAPI + #define RPCNSAPI #endif diff --git a/reactos/include/psdk/rpcdce.h b/reactos/include/psdk/rpcdce.h index 344edbf9fbc..4b13b10eb19 100644 --- a/reactos/include/psdk/rpcdce.h +++ b/reactos/include/psdk/rpcdce.h @@ -290,7 +290,7 @@ RPC_STATUS RPC_ENTRY DceErrorInqTextW(RPC_STATUS e, RPC_WSTR buffer); RPCRTAPI void RPC_ENTRY RpcRaiseException( RPC_STATUS exception ); - + RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingCopy( RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE* DestinationBinding ); @@ -508,7 +508,7 @@ RPCRTAPI int RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY RpcImpersonateClient (IN RPC_BINDING_HANDLE BindingHandle OPTIONAL); -RPCRTAPI RPC_STATUS RPC_ENTRY +RPCRTAPI RPC_STATUS RPC_ENTRY RpcRevertToSelf (); #ifdef __cplusplus diff --git a/reactos/include/psdk/shldisp.idl b/reactos/include/psdk/shldisp.idl index ee722611304..483cef62854 100644 --- a/reactos/include/psdk/shldisp.idl +++ b/reactos/include/psdk/shldisp.idl @@ -41,7 +41,7 @@ interface IAutoComplete : IUnknown [in] IUnknown *punkACL, [in] LPCOLESTR pwszRegKeyPath, [in] LPCOLESTR pwszQuickComplete); - + HRESULT Enable( [in] BOOL fEnable ); } diff --git a/reactos/include/psdk/shlobj.h b/reactos/include/psdk/shlobj.h index 3e383ffc66a..afef125c0d1 100644 --- a/reactos/include/psdk/shlobj.h +++ b/reactos/include/psdk/shlobj.h @@ -1376,7 +1376,7 @@ HRESULT WINAPI ILSaveToStream(LPSTREAM,LPCITEMIDLIST); * SHCreateDefaultContextMenu API */ -typedef struct +typedef struct { HWND hwnd; IContextMenuCB *pcmcb; diff --git a/reactos/include/psdk/shlwapi.h b/reactos/include/psdk/shlwapi.h index 21b1e99ddd7..0aaaf787e53 100644 --- a/reactos/include/psdk/shlwapi.h +++ b/reactos/include/psdk/shlwapi.h @@ -1045,7 +1045,7 @@ BOOL WINAPI IsOS(DWORD); #define TPS_EXECUTEIO 0x00000001 #define TPS_LONGEXECTIME 0x00000008 -#include +#include #ifdef __cplusplus } /* extern "C" */ diff --git a/reactos/include/psdk/shobjidl.idl b/reactos/include/psdk/shobjidl.idl index 2218f8c427c..c5c53d7a2d0 100644 --- a/reactos/include/psdk/shobjidl.idl +++ b/reactos/include/psdk/shobjidl.idl @@ -1262,7 +1262,7 @@ interface INewShortcutHookA : IUnknown HRESULT GetExtension( [out] LPSTR pszExtension, [in] int cchExtension); -} +} /***************************************************************************** @@ -1292,7 +1292,7 @@ interface INewShortcutHookW : IUnknown HRESULT GetExtension( [out] LPWSTR pszExtension, [in] int cchExtension); -} +} /***************************************************************************** @@ -1338,7 +1338,7 @@ interface IFileSystemBindData : IUnknown ] interface IContextMenuCB : IUnknown { - HRESULT CallBack( + HRESULT CallBack( [in] IShellFolder *psf, [in] HWND hwndOwner, [in] IDataObject *pdtobj, diff --git a/reactos/include/psdk/stdole2.idl b/reactos/include/psdk/stdole2.idl index 187982cdf56..9e22c70c37c 100644 --- a/reactos/include/psdk/stdole2.idl +++ b/reactos/include/psdk/stdole2.idl @@ -35,7 +35,7 @@ library stdole typedef unsigned long HRESULT; typedef void *VARIANT; typedef unsigned long SCODE; - + typedef struct GUID { unsigned long Data1; unsigned short Data2; @@ -251,7 +251,7 @@ library stdole [propput] HRESULT Charset([in] short pcharset); [propget] HRESULT hFont([out, retval] OLE_HANDLE *phfont); - + HRESULT Clone([out] IFont **ppfont); HRESULT IsEqual([in] IFont *pfontOther); @@ -304,7 +304,7 @@ library stdole [propget] HRESULT Handle([out, retval] OLE_HANDLE *phandle); [propget] HRESULT hPal([out, retval] OLE_HANDLE *phpal); - + [propget] HRESULT Type([out, retval] short *ptype); [propget] HRESULT Width([out, retval] OLE_XSIZE_HIMETRIC *pwidth); @@ -329,7 +329,7 @@ library stdole HRESULT SelectPicture([in] int hdcIn, [out] int *phdcOut, [out] OLE_HANDLE *phbmpOut); - + [propget] HRESULT KeepOriginalFormat([out, retval] VARIANT_BOOL *pfkeep); [propput] HRESULT KeepOriginalFormat([in] VARIANT_BOOL pfkeep); @@ -351,7 +351,7 @@ library stdole properties: [id(0x0), readonly] OLE_HANDLE Handle; [id(0x2)] OLE_HANDLE hPal; - [id(0x3), readonly] short Type; + [id(0x3), readonly] short Type; [id(0x4), readonly] OLE_XSIZE_HIMETRIC Width; [id(0x5), readonly] OLE_XSIZE_HIMETRIC Height; methods: @@ -366,7 +366,7 @@ library stdole OLE_YSIZE_HIMETRIC cySrc, void *prcWBounds); }; - + typedef [public] Picture IPictureDisp; [ diff --git a/reactos/include/psdk/tchar.h b/reactos/include/psdk/tchar.h index fe0c94b8770..d0dd45f9ba0 100644 --- a/reactos/include/psdk/tchar.h +++ b/reactos/include/psdk/tchar.h @@ -7,7 +7,7 @@ #ifdef _UNICODE #define __T(q) L##q - + #ifndef _TCHAR_DEFINED #ifndef RC_INVOKED typedef wchar_t TCHAR; @@ -15,15 +15,15 @@ #endif /* Not RC_INVOKED */ #define _TCHAR_DEFINED #endif - + #define _TINT wint_t #define _TSCHAR wchar_t #define _TUCHAR wchar_t #define _TXCHAR wchar_t #define _TEOF WEOF - #define _tenviron _wenviron - #define _tfinddata_t _wfinddata_t - + #define _tenviron _wenviron + #define _tfinddata_t _wfinddata_t + /* dirent structures and functions */ #define _tdirent _wdirent #define _TDIR _WDIR @@ -33,7 +33,7 @@ #define _trewinddir _wrewinddir #define _ttelldir _wtelldir #define _tseekdir _wseekdir - + #define _ttoi64 _wtoi64 #define _i64tot _i64tow #define _ui64tot _ui64tow @@ -43,168 +43,168 @@ #define _tfindfirsti64 _wfindfirsti64 #define _tfindnexti64 _wfindnexti64 #define _tfinddatai64_t _wfinddatai64_t - + #define _tunlink _wunlink #define _tgetdcwd _wgetdcwd - #define _fgettc fgetwc - #define _fgettchar _fgetwchar - #define _fgetts fgetws - #define _fputtc fputwc - #define _fputtchar _fputwchar - #define _fputts fputws - #define _ftprintf fwprintf - #define _ftscanf fwscanf - #define _gettc getwc - #define _gettchar getwchar - #define _getts getws - #define _istalnum iswalnum - #define _istalpha iswalpha - #define _istascii iswascii - #define _istcntrl iswcntrl - #define _istdigit iswdigit - #define _istgraph iswgraph + #define _fgettc fgetwc + #define _fgettchar _fgetwchar + #define _fgetts fgetws + #define _fputtc fputwc + #define _fputtchar _fputwchar + #define _fputts fputws + #define _ftprintf fwprintf + #define _ftscanf fwscanf + #define _gettc getwc + #define _gettchar getwchar + #define _getts getws + #define _istalnum iswalnum + #define _istalpha iswalpha + #define _istascii iswascii + #define _istcntrl iswcntrl + #define _istdigit iswdigit + #define _istgraph iswgraph #define _istlead(c) 0 #define _istleadbyte(c) 0 #define _istlegal(c) 1 - #define _istlower iswlower - #define _istprint iswprint - #define _istpunct iswpunct - #define _istspace iswspace - #define _istupper iswupper - #define _istxdigit iswxdigit - #define _itot _itow - #define _ltot _ltow - #define _puttc putwc - #define _puttchar putwchar - #define _putts putws - #define _tmain wmain - #define _sntprintf _snwprintf - #define _stprintf swprintf - #define _stscanf swscanf - #define _taccess _waccess - #define _tasctime _wasctime + #define _istlower iswlower + #define _istprint iswprint + #define _istpunct iswpunct + #define _istspace iswspace + #define _istupper iswupper + #define _istxdigit iswxdigit + #define _itot _itow + #define _ltot _ltow + #define _puttc putwc + #define _puttchar putwchar + #define _putts putws + #define _tmain wmain + #define _sntprintf _snwprintf + #define _stprintf swprintf + #define _stscanf swscanf + #define _taccess _waccess + #define _tasctime _wasctime #define _tccpy(d,s) (*(d)=*(s)) - #define _tchdir _wchdir + #define _tchdir _wchdir #define _tclen(c) 2 - #define _tchmod _wchmod - #define _tcreat _wcreat - #define _tcscat wcscat - #define _tcschr wcschr - #define _tcsclen wcslen - #define _tcscmp wcscmp - #define _tcscoll wcscoll - #define _tcscpy wcscpy - #define _tcscspn wcscspn - #define _tcsdec _wcsdec - #define _tcsdup _wcsdup - #define _tcsftime wcsftime - #define _tcsicmp _wcsicmp - #define _tcsicoll _wcsicoll - #define _tcsinc _wcsinc - #define _tcslen wcslen - #define _tcslwr _wcslwr - #define _tcsnbcnt _wcnscnt - #define _tcsncat wcsncat - #define _tcsnccat wcsncat - #define _tcsncmp wcsncmp - #define _tcsnccmp wcsncmp - #define _tcsnccnt _wcsncnt - #define _tcsnccpy wcsncpy - #define _tcsncicmp _wcsnicmp - #define _tcsncpy wcsncpy - #define _tcsncset _wcsnset - #define _tcsnextc _wcsnextc - #define _tcsnicmp _wcsnicmp - #define _tcsnicoll _wcsnicoll - #define _tcsninc _wcsninc - #define _tcsnccnt _wcsncnt - #define _tcsnset _wcsnset - #define _tcspbrk wcspbrk - #define _tcsspnp _wcsspnp - #define _tcsrchr wcsrchr - #define _tcsrev _wcsrev - #define _tcsset _wcsset - #define _tcsspn wcsspn - #define _tcsstr wcsstr - #define _tcstod wcstod - #define _tcstok wcstok - #define _tcstol wcstol - #define _tcstoul wcstoul - #define _tcsupr _wcsupr - #define _tcsxfrm wcsxfrm - #define _tctime _wctime - #define _texecl _wexecl - #define _texecle _wexecle - #define _texeclp _wexeclp - #define _texeclpe _wexeclpe - #define _texecv _wexecv - #define _texecve _wexecve - #define _texecvp _wexecvp - #define _texecvpe _wexecvpe - #define _tfdopen _wfdopen - #define _tfindfirst _wfindfirst - #define _tfindnext _wfindnext - #define _tfopen _wfopen - #define _tfreopen _wfreopen - #define _tfsopen _wfsopen - #define _tfullpath _wfullpath - #define _tgetcwd _wgetcwd - #define _tgetenv _wgetenv - #define _tmain wmain - #define _tmakepath _wmakepath - #define _tmkdir _wmkdir - #define _tmktemp _wmktemp - #define _tperror _wperror - #define _topen _wopen - #define _totlower towlower - #define _totupper towupper - #define _tpopen _wpopen - #define _tprintf wprintf - #define _tremove _wremove - #define _trename _wrename - #define _trmdir _wrmdir - #define _tsearchenv _wsearchenv - #define _tscanf wscanf - #define _tsetlocale _wsetlocale - #define _tsopen _wsopen - #define _tspawnl _wspawnl - #define _tspawnle _wspawnle - #define _tspawnlp _wspawnlp - #define _tspawnlpe _wspawnlpe - #define _tspawnv _wspawnv - #define _tspawnve _wspawnve + #define _tchmod _wchmod + #define _tcreat _wcreat + #define _tcscat wcscat + #define _tcschr wcschr + #define _tcsclen wcslen + #define _tcscmp wcscmp + #define _tcscoll wcscoll + #define _tcscpy wcscpy + #define _tcscspn wcscspn + #define _tcsdec _wcsdec + #define _tcsdup _wcsdup + #define _tcsftime wcsftime + #define _tcsicmp _wcsicmp + #define _tcsicoll _wcsicoll + #define _tcsinc _wcsinc + #define _tcslen wcslen + #define _tcslwr _wcslwr + #define _tcsnbcnt _wcnscnt + #define _tcsncat wcsncat + #define _tcsnccat wcsncat + #define _tcsncmp wcsncmp + #define _tcsnccmp wcsncmp + #define _tcsnccnt _wcsncnt + #define _tcsnccpy wcsncpy + #define _tcsncicmp _wcsnicmp + #define _tcsncpy wcsncpy + #define _tcsncset _wcsnset + #define _tcsnextc _wcsnextc + #define _tcsnicmp _wcsnicmp + #define _tcsnicoll _wcsnicoll + #define _tcsninc _wcsninc + #define _tcsnccnt _wcsncnt + #define _tcsnset _wcsnset + #define _tcspbrk wcspbrk + #define _tcsspnp _wcsspnp + #define _tcsrchr wcsrchr + #define _tcsrev _wcsrev + #define _tcsset _wcsset + #define _tcsspn wcsspn + #define _tcsstr wcsstr + #define _tcstod wcstod + #define _tcstok wcstok + #define _tcstol wcstol + #define _tcstoul wcstoul + #define _tcsupr _wcsupr + #define _tcsxfrm wcsxfrm + #define _tctime _wctime + #define _texecl _wexecl + #define _texecle _wexecle + #define _texeclp _wexeclp + #define _texeclpe _wexeclpe + #define _texecv _wexecv + #define _texecve _wexecve + #define _texecvp _wexecvp + #define _texecvpe _wexecvpe + #define _tfdopen _wfdopen + #define _tfindfirst _wfindfirst + #define _tfindnext _wfindnext + #define _tfopen _wfopen + #define _tfreopen _wfreopen + #define _tfsopen _wfsopen + #define _tfullpath _wfullpath + #define _tgetcwd _wgetcwd + #define _tgetenv _wgetenv + #define _tmain wmain + #define _tmakepath _wmakepath + #define _tmkdir _wmkdir + #define _tmktemp _wmktemp + #define _tperror _wperror + #define _topen _wopen + #define _totlower towlower + #define _totupper towupper + #define _tpopen _wpopen + #define _tprintf wprintf + #define _tremove _wremove + #define _trename _wrename + #define _trmdir _wrmdir + #define _tsearchenv _wsearchenv + #define _tscanf wscanf + #define _tsetlocale _wsetlocale + #define _tsopen _wsopen + #define _tspawnl _wspawnl + #define _tspawnle _wspawnle + #define _tspawnlp _wspawnlp + #define _tspawnlpe _wspawnlpe + #define _tspawnv _wspawnv + #define _tspawnve _wspawnve #define _tspawnvp _wspawnvp - #define _tspawnvpe _wspawnvpe - #define _tsplitpath _wsplitpath - #define _tstat _wstat - #define _tstrdate _wstrdate - #define _tstrtime _wstrtime - #define _tsystem _wsystem - #define _ttempnam _wtempnam - #define _ttmpnam _wtmpnam - #define _ttoi _wtoi - #define _ttol _wtol - #define _tutime _wutime - #define _tWinMain wWinMain - #define _ultot _ultow - #define _ungettc ungetwc - #define _vftprintf vfwprintf - #define _vsntprintf _vsnwprintf - #define _vstprintf vswprintf - #define _vtprintf vwprintf - + #define _tspawnvpe _wspawnvpe + #define _tsplitpath _wsplitpath + #define _tstat _wstat + #define _tstrdate _wstrdate + #define _tstrtime _wstrtime + #define _tsystem _wsystem + #define _ttempnam _wtempnam + #define _ttmpnam _wtmpnam + #define _ttoi _wtoi + #define _ttol _wtol + #define _tutime _wutime + #define _tWinMain wWinMain + #define _ultot _ultow + #define _ungettc ungetwc + #define _vftprintf vfwprintf + #define _vsntprintf _vsnwprintf + #define _vstprintf vswprintf + #define _vtprintf vwprintf + #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1) #define _wcsinc(_wcs) ((_wcs)+1) #define _wcsnextc(_wcs) ((unsigned int) *(_wcs)) #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc))) #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs)) #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL) - + #else #define __T(q) q - + #ifndef _TCHAR_DEFINED #ifndef RC_INVOKED typedef char TCHAR; @@ -218,10 +218,10 @@ #define _TUCHAR unsigned char #define _TXCHAR char #define _TEOF EOF - #define _tenviron _environ - #define _tfinddata_t _finddata_t - - /* dirent structures and functions */ + #define _tenviron _environ + #define _tfinddata_t _finddata_t + + /* dirent structures and functions */ #define _tdirent dirent #define _TDIR DIR #define _topendir opendir @@ -240,7 +240,7 @@ #define _tfindfirsti64 _findfirsti64 #define _tfindnexti64 _findnexti64 #define _tfinddatai64_t _finddatai64_t - + #define _tunlink _unlink #define _tgetdcwd _getdcwd @@ -264,143 +264,143 @@ #define _istlead(c) 0 #define _istleadbyte(c) 0 #define _istlegal(c) 1 - #define _istlower islower - #define _istprint isprint - #define _istpunct ispunct - #define _istspace isspace - #define _istupper isupper - #define _istxdigit isxdigit - #define _itot _itoa - #define _ltot _ltoa - #define _puttc putc + #define _istlower islower + #define _istprint isprint + #define _istpunct ispunct + #define _istspace isspace + #define _istupper isupper + #define _istxdigit isxdigit + #define _itot _itoa + #define _ltot _ltoa + #define _puttc putc #define _puttchar putchar - #define _putts puts - #define _tmain main - #define _sntprintf _snprintf - #define _stprintf sprintf - #define _stscanf sscanf - #define _taccess _access - #define _tasctime asctime + #define _putts puts + #define _tmain main + #define _sntprintf _snprintf + #define _stprintf sprintf + #define _stscanf sscanf + #define _taccess _access + #define _tasctime asctime #define _tccpy(d,s) (*(d)=*(s)) - #define _tchdir _chdir + #define _tchdir _chdir #define _tclen(c) 1 - #define _tchmod _chmod - #define _tcreat _creat - #define _tcscat strcat - #define _tcschr strchr - #define _tcsclen strlen - #define _tcscmp strcmp - #define _tcscoll strcoll + #define _tchmod _chmod + #define _tcreat _creat + #define _tcscat strcat + #define _tcschr strchr + #define _tcsclen strlen + #define _tcscmp strcmp + #define _tcscoll strcoll #define _tcscpy strcpy - #define _tcscspn strcspn - #define _tcsdec _strdec - #define _tcsdup _strdup - #define _tcsftime strftime - #define _tcsicmp _stricmp - #define _tcsicoll _stricoll + #define _tcscspn strcspn + #define _tcsdec _strdec + #define _tcsdup _strdup + #define _tcsftime strftime + #define _tcsicmp _stricmp + #define _tcsicoll _stricoll #define _tcsinc _strinc #define _tcslen strlen - #define _tcslwr _strlwr - #define _tcsnbcnt _strncnt - #define _tcsncat strncat - #define _tcsnccat strncat - #define _tcsncmp strncmp - #define _tcsnccmp strncmp - #define _tcsnccnt _strncnt - #define _tcsnccpy strncpy - #define _tcsncicmp _strnicmp - #define _tcsncpy strncpy - #define _tcsncset _strnset - #define _tcsnextc _strnextc - #define _tcsnicmp _strnicmp - #define _tcsnicoll _strnicoll - #define _tcsninc _strninc - #define _tcsnccnt _strncnt - #define _tcsnset _strnset - #define _tcspbrk strpbrk - #define _tcsspnp _strspnp - #define _tcsrchr strrchr - #define _tcsrev _strrev - #define _tcsset _strset - #define _tcsspn strspn - #define _tcsstr strstr - #define _tcstod strtod - #define _tcstok strtok - #define _tcstol strtol - #define _tcstoul strtoul - #define _tcsupr _strupr - #define _tcsxfrm strxfrm - #define _tctime ctime - #define _texecl _execl - #define _texecle _execle - #define _texeclp _execlp - #define _texeclpe _execlpe - #define _texecv _execv - #define _texecve _execve - #define _texecvp _execvp - #define _texecvpe _execvpe - #define _tfdopen _fdopen - #define _tfindfirst _findfirst - #define _tfindnext _findnext - #define _tfopen fopen - #define _tfreopen freopen - #define _tfsopen _fsopen - #define _tfullpath _fullpath - #define _tgetcwd _getcwd - #define _tgetenv getenv - #define _tmain main - #define _tmakepath _makepath - #define _tmkdir _mkdir - #define _tmktemp _mktemp - #define _tperror perror - #define _topen _open - #define _totlower tolower - #define _totupper toupper - #define _tpopen _popen - #define _tprintf printf - #define _tremove remove - #define _trename rename - #define _trmdir _rmdir - #define _tsearchenv _searchenv - #define _tscanf scanf - #define _tsetlocale setlocale - #define _tsopen _sopen - #define _tspawnl _spawnl - #define _tspawnle _spawnle - #define _tspawnlp _spawnlp - #define _tspawnlpe _spawnlpe - #define _tspawnv _spawnv - #define _tspawnve _spawnve - #define _tspawnvp _spawnvp - #define _tspawnvpe _spawnvpe - #define _tsplitpath _splitpath - #define _tstat _stat - #define _tstrdate _strdate - #define _tstrtime _strtime + #define _tcslwr _strlwr + #define _tcsnbcnt _strncnt + #define _tcsncat strncat + #define _tcsnccat strncat + #define _tcsncmp strncmp + #define _tcsnccmp strncmp + #define _tcsnccnt _strncnt + #define _tcsnccpy strncpy + #define _tcsncicmp _strnicmp + #define _tcsncpy strncpy + #define _tcsncset _strnset + #define _tcsnextc _strnextc + #define _tcsnicmp _strnicmp + #define _tcsnicoll _strnicoll + #define _tcsninc _strninc + #define _tcsnccnt _strncnt + #define _tcsnset _strnset + #define _tcspbrk strpbrk + #define _tcsspnp _strspnp + #define _tcsrchr strrchr + #define _tcsrev _strrev + #define _tcsset _strset + #define _tcsspn strspn + #define _tcsstr strstr + #define _tcstod strtod + #define _tcstok strtok + #define _tcstol strtol + #define _tcstoul strtoul + #define _tcsupr _strupr + #define _tcsxfrm strxfrm + #define _tctime ctime + #define _texecl _execl + #define _texecle _execle + #define _texeclp _execlp + #define _texeclpe _execlpe + #define _texecv _execv + #define _texecve _execve + #define _texecvp _execvp + #define _texecvpe _execvpe + #define _tfdopen _fdopen + #define _tfindfirst _findfirst + #define _tfindnext _findnext + #define _tfopen fopen + #define _tfreopen freopen + #define _tfsopen _fsopen + #define _tfullpath _fullpath + #define _tgetcwd _getcwd + #define _tgetenv getenv + #define _tmain main + #define _tmakepath _makepath + #define _tmkdir _mkdir + #define _tmktemp _mktemp + #define _tperror perror + #define _topen _open + #define _totlower tolower + #define _totupper toupper + #define _tpopen _popen + #define _tprintf printf + #define _tremove remove + #define _trename rename + #define _trmdir _rmdir + #define _tsearchenv _searchenv + #define _tscanf scanf + #define _tsetlocale setlocale + #define _tsopen _sopen + #define _tspawnl _spawnl + #define _tspawnle _spawnle + #define _tspawnlp _spawnlp + #define _tspawnlpe _spawnlpe + #define _tspawnv _spawnv + #define _tspawnve _spawnve + #define _tspawnvp _spawnvp + #define _tspawnvpe _spawnvpe + #define _tsplitpath _splitpath + #define _tstat _stat + #define _tstrdate _strdate + #define _tstrtime _strtime #define _tsystem system - #define _ttempnam _tempnam + #define _ttempnam _tempnam #define _ttmpnam tmpnam - #define _ttoi atoi - #define _ttol atol - #define _tutime _utime - #define _tWinMain WinMain - #define _ultot _ultoa - #define _ungettc ungetc - #define _vftprintf vfprintf - #define _vsntprintf _vsnprintf - #define _vstprintf vsprintf + #define _ttoi atoi + #define _ttol atol + #define _tutime _utime + #define _tWinMain WinMain + #define _ultot _ultoa + #define _ungettc ungetc + #define _vftprintf vfprintf + #define _vsntprintf _vsnprintf + #define _vstprintf vsprintf #define _vtprintf vprintf - + #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1) #define _strinc(_str) ((_str)+1) #define _strnextc(_str) ((unsigned int) *(_str)) #define _strninc(_str, _inc) (((_str)+(_inc))) #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str)) #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL) - + #endif - - + + #define _TEXT(x) __T(x) diff --git a/reactos/include/psdk/tcpioctl.h b/reactos/include/psdk/tcpioctl.h index d04411ff707..033ec11309d 100644 --- a/reactos/include/psdk/tcpioctl.h +++ b/reactos/include/psdk/tcpioctl.h @@ -4,7 +4,7 @@ * Set and query ioctl constants for tcpip.sys * * Contributors: - * Created by Art Yerkes (ayerkes@speakeasy.net) from + * Created by Art Yerkes (ayerkes@speakeasy.net) from * drivers/net/tcpip/include/ticonsts.h * * THIS SOFTWARE IS NOT COPYRIGHTED diff --git a/reactos/include/psdk/urlhist.idl b/reactos/include/psdk/urlhist.idl index 0dde4829aa0..7d5843e9fbf 100644 --- a/reactos/include/psdk/urlhist.idl +++ b/reactos/include/psdk/urlhist.idl @@ -41,7 +41,7 @@ typedef enum _ADDURL_FLAG interface IEnumSTATURL : IUnknown { typedef [unique] IEnumSTATURL *LPENUMSTATURL; - + typedef struct _STATURL { DWORD cbSize; @@ -78,7 +78,7 @@ interface IEnumSTATURL : IUnknown interface IUrlHistoryStg : IUnknown { typedef [unique] IUrlHistoryStg *LPURLHISTORYSTG; - + HRESULT AddUrl( [in] LPCOLESTR pocsUrl, [in, unique] LPCOLESTR pocsTitle, @@ -92,14 +92,14 @@ interface IUrlHistoryStg : IUnknown [in] LPCOLESTR pocsUrl, [in] DWORD dwFlags, [in, out, unique] LPSTATURL lpSTATURL); - + HRESULT BindToObject( [in] LPCOLESTR pocsUrl, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut); HRESULT EnumUrls( - [out] IEnumSTATURL **ppEnum); + [out] IEnumSTATURL **ppEnum); } /***************************************************************************** diff --git a/reactos/include/psdk/usp10.h b/reactos/include/psdk/usp10.h index 6dc7584d7f3..e101b6c696d 100644 --- a/reactos/include/psdk/usp10.h +++ b/reactos/include/psdk/usp10.h @@ -49,8 +49,8 @@ extern "C" { #define SSA_LPKANSIFALLBACK 0x08000000 #define SSA_PIDX 0x10000000 #define SSA_LAYOUTRTL 0x20000000 -#define SSA_DONTGLYPH 0x40000000 -#define SSA_NOKASHIDA 0x80000000 +#define SSA_DONTGLYPH 0x40000000 +#define SSA_NOKASHIDA 0x80000000 /** StringIsComplex */ #define SIC_COMPLEX 1 @@ -105,8 +105,8 @@ typedef struct tag_SCRIPT_CONTROL { typedef struct { DWORD langid :16; DWORD fNumeric :1; - DWORD fComplex :1; - DWORD fNeedsWordBreaking :1; + DWORD fComplex :1; + DWORD fNeedsWordBreaking :1; DWORD fNeedsCaretInfo :1; DWORD bCharSet :8; DWORD fControl :1; @@ -192,7 +192,7 @@ typedef struct tag_SCRIPT_LOGATTR { } SCRIPT_LOGATTR; typedef void *SCRIPT_CACHE; -typedef void *SCRIPT_STRING_ANALYSIS; +typedef void *SCRIPT_STRING_ANALYSIS; #ifndef LSDEFS_DEFINED typedef struct tagGOFFSET { @@ -203,14 +203,14 @@ typedef struct tagGOFFSET { /* Function Declarations */ -HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE* psds, +HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE* psds, SCRIPT_CONTROL* psc, SCRIPT_STATE* pss); HRESULT WINAPI ScriptApplyLogicalWidth(const int *piDx, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance, const SCRIPT_ANALYSIS *psa, ABC *pABC, int *piJustify); HRESULT WINAPI ScriptRecordDigitSubstitution(LCID Locale, SCRIPT_DIGITSUBSTITUTE *psds); -HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems, - const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, +HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems, + const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState, SCRIPT_ITEM *pItems, int *pcItems); HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars, int cChars, DWORD dwFlags, WORD *pwOutGlyphs); @@ -220,9 +220,9 @@ HRESULT WINAPI ScriptGetLogicalWidths(const SCRIPT_ANALYSIS *psa, int cChars, in const int *piGlyphWidth, const WORD *pwLogClust, const SCRIPT_VISATTR *psva, int *piDx); HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***ppSp, int *piNumScripts); -HRESULT WINAPI ScriptStringAnalyse(HDC hdc, - const void *pString, - int cString, +HRESULT WINAPI ScriptStringAnalyse(HDC hdc, + const void *pString, + int cString, int cGlyphs, int iCharset, DWORD dwFlags, diff --git a/reactos/include/psdk/wincrypt.h b/reactos/include/psdk/wincrypt.h index 5d1e12190c5..ebfcf315f58 100644 --- a/reactos/include/psdk/wincrypt.h +++ b/reactos/include/psdk/wincrypt.h @@ -75,7 +75,7 @@ typedef struct _HMAC_INFO { BYTE* pbOuterString; DWORD cbOuterString; } HMAC_INFO, *PHMAC_INFO; - + typedef struct _CRYPTOAPI_BLOB { DWORD cbData; BYTE* pbData; @@ -1669,7 +1669,7 @@ static const WCHAR MS_SCARD_PROV_W[] = { 'M','i','c','r','o','s','o',' #define CRYPT_MODE_OFB 3 #define CRYPT_MODE_CFB 4 -#define CRYPT_ENCRYPT 0x0001 +#define CRYPT_ENCRYPT 0x0001 #define CRYPT_DECRYPT 0x0002 #define CRYPT_EXPORT 0x0004 #define CRYPT_READ 0x0008 @@ -1821,10 +1821,10 @@ static const WCHAR MS_SCARD_PROV_W[] = { 'M','i','c','r','o','s','o',' #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH \ L"Software\\Policies\\Microsoft\\SystemCertificates" #else -static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[] = +static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',0 }; -static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[] = +static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[] = {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\', 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r', 't','i','f','i','c','a','t','e','s',0 }; @@ -2077,7 +2077,7 @@ static const WCHAR CRYPT_OID_REG_FLAGS_VALUE_NAME[] = # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \ L".AuthRoot" #else -static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME[] = +static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME[] = {'.','D','e','f','a','u','l','t','0'}; static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME[] = {'.','G','r','o','u','p','P','o','l','i','c','y',0}; diff --git a/reactos/include/psdk/wingdi.h b/reactos/include/psdk/wingdi.h index 555fa62a745..250400ab89c 100644 --- a/reactos/include/psdk/wingdi.h +++ b/reactos/include/psdk/wingdi.h @@ -1812,7 +1812,7 @@ typedef struct tagEMRSETCOLORSPACE { EMR emr; DWORD ihCS; -} EMRSETCOLORSPACE, *PEMRSETCOLORSPACE, EMRSELECTCOLORSPACE, *PEMRSELECTCOLORSPACE, +} EMRSETCOLORSPACE, *PEMRSETCOLORSPACE, EMRSELECTCOLORSPACE, *PEMRSELECTCOLORSPACE, EMRDELETECOLORSPACE, *PEMRDELETECOLORSPACE; typedef struct tagEMRFRAMERGN { @@ -2082,12 +2082,12 @@ typedef struct tagABORTPATH { typedef struct tagEMRSELECTCLIPPATH { EMR emr; DWORD iMode; -} EMRSELECTCLIPPATH,*PEMRSELECTCLIPPATH, EMRSETBKMODE,*PEMRSETBKMODE, EMRSETMAPMODE, *PEMRSETMAPMODE, - EMRSETPOLYFILLMODE, *PEMRSETPOLYFILLMODE, EMRSETROP2, *PEMRSETROP2, EMRSETSTRETCHBLTMODE, *PEMRSETSTRETCHBLTMODE, - EMRSETICMMODE, *PEMRSETICMMODE, EMRSETTEXTALIGN, +} EMRSELECTCLIPPATH,*PEMRSELECTCLIPPATH, EMRSETBKMODE,*PEMRSETBKMODE, EMRSETMAPMODE, *PEMRSETMAPMODE, + EMRSETPOLYFILLMODE, *PEMRSETPOLYFILLMODE, EMRSETROP2, *PEMRSETROP2, EMRSETSTRETCHBLTMODE, *PEMRSETSTRETCHBLTMODE, + EMRSETICMMODE, *PEMRSETICMMODE, EMRSETTEXTALIGN, #if(WINVER >= 0x0500) EMRSETLAYOUT, *PEMRSETLAYOUT, -#endif +#endif *PEMRSETTEXTALIGN; #include "pshpack2.h" diff --git a/reactos/include/psdk/winsock2.h b/reactos/include/psdk/winsock2.h index 4e0a102575b..5ccc222776b 100644 --- a/reactos/include/psdk/winsock2.h +++ b/reactos/include/psdk/winsock2.h @@ -567,7 +567,7 @@ u_long PASCAL htonl(u_long); u_long PASCAL ntohl(u_long); u_short PASCAL htons(u_short); u_short PASCAL ntohs(u_short); -#ifndef _SYS_SELECT_H /* Work around for Linux Compilers */ +#ifndef _SYS_SELECT_H /* Work around for Linux Compilers */ #define _SYS_SELECT_H int PASCAL select(int nfds,fd_set*,fd_set*,fd_set*,const struct timeval*); #endif diff --git a/reactos/include/psdk/winternl.h b/reactos/include/psdk/winternl.h index 351bdbce681..7ac00284a9d 100644 --- a/reactos/include/psdk/winternl.h +++ b/reactos/include/psdk/winternl.h @@ -988,7 +988,7 @@ typedef struct _SYSTEM_CPU_INFORMATION { #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */ #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */ #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/ -#define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */ +#define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */ #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */ #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */ #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */ @@ -998,7 +998,7 @@ typedef struct _SYSTEM_CPU_INFORMATION { #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */ #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */ #define CPU_FEATURE_SSE 0x00002000 /* SSE extenstions (ext. MMX) */ -#define CPU_FEATURE_3DNOW 0x00008000 /* 3DNOW instructions available +#define CPU_FEATURE_3DNOW 0x00008000 /* 3DNOW instructions available (FIXME: needs to be confirmed) */ #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */ #define CPU_FEATURE_DS 0x00020000 /* Debug Store */ @@ -1652,7 +1652,7 @@ typedef enum _SYSDBG_COMMAND { SysDbgClearSpecialCalls, SysDbgQuerySpecialCalls } SYSDBG_COMMAND, *PSYSDBG_COMMAND; - + /*********************************************************************** * Function declarations */ @@ -1698,7 +1698,7 @@ NTSTATUS WINAPI NtClose(HANDLE); NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN); NTSTATUS WINAPI NtCompleteConnectPort(HANDLE); NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG); -NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN); +NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN); NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN); NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); @@ -1724,12 +1724,12 @@ NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES); NTSTATUS WINAPI NtDeleteKey(HANDLE); NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *); NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG); -NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING); +NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING); NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG); NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE); NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *); NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG); -NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER); +NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER); NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*); NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*); NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T); @@ -1751,7 +1751,7 @@ NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *); NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *); NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN); NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); -NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE); +NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE); NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG); NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN); NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); @@ -1784,7 +1784,7 @@ NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*); NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN); NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,POBJDIR_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG); NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN); -NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG); +NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*); NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,RTL_ATOM_TABLE,ULONG,ULONG*); NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS); @@ -1797,12 +1797,12 @@ NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG); NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *); NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG); -NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG); +NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG); NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG); NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER); NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG); -NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG); +NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG); NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG); @@ -1819,7 +1819,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT,ULONG,PLARGE_INTEGER,PULONG); NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*); -NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE); +NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE); NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG); NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG); NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG,PULONG,PIO_STATUS_BLOCK,PLARGE_INTEGER); @@ -1836,13 +1836,13 @@ NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG); NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE); NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG); NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*); -NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE); +NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE); NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID); NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID); NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG); NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG); -NTSTATUS WINAPI NtSetHighEventPair(HANDLE); -NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE); +NTSTATUS WINAPI NtSetHighEventPair(HANDLE); +NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE); NTSTATUS WINAPI NtSetHighWaitLowThread(VOID); NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS); NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG); @@ -1853,38 +1853,38 @@ NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULON NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE); NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG); NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY); -NTSTATUS WINAPI NtSetLowEventPair(HANDLE); -NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE); -NTSTATUS WINAPI NtSetLowWaitHighThread(VOID); +NTSTATUS WINAPI NtSetLowEventPair(HANDLE); +NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE); +NTSTATUS WINAPI NtSetLowWaitHighThread(VOID); NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING); NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG); NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG); NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*); NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*); -NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG); +NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG); NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG); NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS); NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*); -NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION); -NTSTATUS WINAPI NtStartProfile(HANDLE); -NTSTATUS WINAPI NtStopProfile(HANDLE); +NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION); +NTSTATUS WINAPI NtStartProfile(HANDLE); +NTSTATUS WINAPI NtStopProfile(HANDLE); NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG); NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG); NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG); NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG); -NTSTATUS WINAPI NtTestAlert(VOID); +NTSTATUS WINAPI NtTestAlert(VOID); NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *); NTSTATUS WINAPI NtUnloadKey(HANDLE); NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE); NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG); NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID); -NTSTATUS WINAPI NtVdmControl(ULONG,PVOID); +NTSTATUS WINAPI NtVdmControl(ULONG,PVOID); NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*); NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); -NTSTATUS WINAPI NtWaitHighEventPair(HANDLE); -NTSTATUS WINAPI NtWaitLowEventPair(HANDLE); +NTSTATUS WINAPI NtWaitHighEventPair(HANDLE); +NTSTATUS WINAPI NtWaitLowEventPair(HANDLE); NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG); NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT,ULONG,PLARGE_INTEGER,PULONG); NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG); @@ -1900,7 +1900,7 @@ NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID); NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID); NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*); -NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL); +NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL); PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER); NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN); NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *); diff --git a/reactos/include/psdk/winuser.h b/reactos/include/psdk/winuser.h index db3774d1b58..2665892871e 100644 --- a/reactos/include/psdk/winuser.h +++ b/reactos/include/psdk/winuser.h @@ -74,11 +74,11 @@ extern "C" { #if(WINVER >= 0x0400) #define CF_HDROP 15 #define CF_LOCALE 16 -#endif +#endif #if(WINVER >= 0x0500) #define CF_DIBV5 17 -#endif +#endif #if(WINVER >= 0x0500) #define CF_MAX 18 diff --git a/reactos/include/psdk/wtsapi32.h b/reactos/include/psdk/wtsapi32.h index 55309bc245a..e777e834597 100644 --- a/reactos/include/psdk/wtsapi32.h +++ b/reactos/include/psdk/wtsapi32.h @@ -140,7 +140,7 @@ BOOL WINAPI WTSEnumerateServersW( LPWSTR, DWORD, DWORD, PWTS_SERVER_INFOW*, DWOR BOOL WINAPI WTSEnumerateSessionsA(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOA *, DWORD *); BOOL WINAPI WTSEnumerateSessionsW(HANDLE, DWORD, DWORD, PWTS_SESSION_INFOW *, DWORD *); #define WTSEnumerateSessions WINELIB_NAME_AW(WTSEnumerateSessions) -void WINAPI WTSFreeMemory(PVOID); +void WINAPI WTSFreeMemory(PVOID); HANDLE WINAPI WTSOpenServerA(LPSTR); HANDLE WINAPI WTSOpenServerW(LPWSTR); #define WTSOpenServer WINELIB_NAME_AW(WTSOpenServer) diff --git a/reactos/include/psdk/wtypes.idl b/reactos/include/psdk/wtypes.idl index 8d8b8e3ba08..844fda74c09 100644 --- a/reactos/include/psdk/wtypes.idl +++ b/reactos/include/psdk/wtypes.idl @@ -775,7 +775,7 @@ typedef struct tagQUERYCONTEXT DWORD dwVersionLo; } QUERYCONTEXT; -typedef [v1_enum] enum tagTYSPEC +typedef [v1_enum] enum tagTYSPEC { TYSPEC_CLSID, TYSPEC_FILEEXT, diff --git a/reactos/include/psdk/xmldso.idl b/reactos/include/psdk/xmldso.idl index 14f66a1377e..2dfff096533 100644 --- a/reactos/include/psdk/xmldso.idl +++ b/reactos/include/psdk/xmldso.idl @@ -35,19 +35,19 @@ pointer_default(unique) ] interface IXMLDSOControl : IDispatch { - [propget,id(DISPID_XMLDSO_DOCUMENT)] + [propget,id(DISPID_XMLDSO_DOCUMENT)] HRESULT XMLDocument([out, retval] IXMLDOMDocument** ppDoc); - [propput,id(DISPID_XMLDSO_DOCUMENT)] + [propput,id(DISPID_XMLDSO_DOCUMENT)] HRESULT XMLDocument([in] IXMLDOMDocument* ppDoc); - [propget,id(DISPID_XMLDSO_JAVADSOCOMPATIBLE)] + [propget,id(DISPID_XMLDSO_JAVADSOCOMPATIBLE)] HRESULT JavaDSOCompatible([out, retval] BOOL* fJavaDSOCompatible); - [propput,id(DISPID_XMLDSO_JAVADSOCOMPATIBLE)] + [propput,id(DISPID_XMLDSO_JAVADSOCOMPATIBLE)] HRESULT JavaDSOCompatible([in] BOOL fJavaDSOCompatible); - [propget, id(DISPID_READYSTATE)] + [propget, id(DISPID_READYSTATE)] HRESULT readyState([out, retval] long *state); } diff --git a/reactos/include/psdk/xprtdefs.h b/reactos/include/psdk/xprtdefs.h index ed85b53c334..d2122860912 100644 --- a/reactos/include/psdk/xprtdefs.h +++ b/reactos/include/psdk/xprtdefs.h @@ -27,7 +27,7 @@ #define ED_AUDIO_22 0x0200000L #define ED_AUDIO_23 0x0400000L #define ED_AUDIO_24 0x0800000L -#define ED_AUDIO_ALL 0x10000000 +#define ED_AUDIO_ALL 0x10000000 #define ED_VIDEO 0x2000000L #define ED_TOP 0x0001 @@ -51,7 +51,7 @@ #define ED_BASE 0x1000L #define ED_DEVCAP_CAN_RECORD ED_BASE+1 -#define ED_DEVCAP_CAN_RECORD_STROBE ED_BASE+2 +#define ED_DEVCAP_CAN_RECORD_STROBE ED_BASE+2 #define ED_DEVCAP_HAS_AUDIO ED_BASE+3 #define ED_DEVCAP_HAS_VIDEO ED_BASE+4 #define ED_DEVCAP_USES_FILES ED_BASE+5 @@ -84,7 +84,7 @@ #define ED_SYNCACC_PRECISE ED_BASE+32 #define ED_SYNCACC_FRAME ED_BASE+33 #define ED_SYNCACC_ROUGH ED_BASE+34 -#define ED_DEVCAP_NORMAL_RATE ED_BASE+35 +#define ED_DEVCAP_NORMAL_RATE ED_BASE+35 #define ED_RATE_24 ED_BASE+36 #define ED_RATE_25 ED_BASE+37 #define ED_RATE_2997 ED_BASE+38 @@ -116,7 +116,7 @@ #define ED_TRANSCAP_CAN_DELAY_VIDEO_OUT ED_BASE+106 #define ED_TRANSCAP_CAN_DELAY_AUDIO_IN ED_BASE+107 #define ED_TRANSCAP_CAN_DELAY_AUDIO_OUT ED_BASE+108 -#define ED_TRANSCAP_FWD_VARIABLE_MAX ED_BASE+109 +#define ED_TRANSCAP_FWD_VARIABLE_MAX ED_BASE+109 #define ED_TRANSCAP_REV_VARIABLE_MAX ED_BASE+110 #define ED_TRANSCAP_NUM_AUDIO_TRACKS ED_BASE+111 @@ -336,7 +336,7 @@ #define ED_EDIT_REHEARSE_MODE ED_BASE+672 #define ED_EDIT_BVB ED_BASE+673 - + #define ED_EDIT_VBV ED_BASE+674 #define ED_EDIT_VVV ED_BASE+675 #define ED_EDIT_PERFORM ED_BASE+676 @@ -411,4 +411,4 @@ #define ED_DEV_REMOVED_HEVENT_GET ED_BASE+960 #define ED_DEV_REMOVED_HEVENT_RELEASE ED_BASE+961 -#endif +#endif diff --git a/reactos/include/reactos/config.h b/reactos/include/reactos/config.h index 9de7b3c6ad5..e11266e8ca5 100644 --- a/reactos/include/reactos/config.h +++ b/reactos/include/reactos/config.h @@ -1,5 +1,5 @@ #ifndef _INC_REACTOS_CONFIG_H -#define _INC_REACTOS_CONFIG_H +#define _INC_REACTOS_CONFIG_H /* $Id$ */ /* ReactOS global configuration options */ diff --git a/reactos/include/reactos/debug.h b/reactos/include/reactos/debug.h index 637527b6420..4aef375157f 100644 --- a/reactos/include/reactos/debug.h +++ b/reactos/include/reactos/debug.h @@ -4,7 +4,7 @@ * FILE: include/internal/debug.h * PURPOSE: Useful debugging macros * PROGRAMMER: David Welch (welch@mcmail.com) - * UPDATE HISTORY: + * UPDATE HISTORY: * 28/05/98: Created */ @@ -72,17 +72,17 @@ RtlAssert( /* Print stuff only on Debug Builds*/ #ifdef DBG - + /* These are always printed */ #define DPRINT1 DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint #define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); /* These are printed only if NDEBUG is NOT defined */ #ifndef NDEBUG - + #define DPRINT DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); - + #else #ifdef _MSC_VER static __inline void DPRINT ( const char* fmt, ... ) diff --git a/reactos/include/reactos/dll/directx/d3d8thk.h b/reactos/include/reactos/dll/directx/d3d8thk.h index dafc3d97bae..ee6a566d41b 100644 --- a/reactos/include/reactos/dll/directx/d3d8thk.h +++ b/reactos/include/reactos/dll/directx/d3d8thk.h @@ -18,7 +18,7 @@ BOOL STDCALL OsThunkD3dContextCreate( ); -DWORD STDCALL OsThunkD3dContextDestroy( +DWORD STDCALL OsThunkD3dContextDestroy( PD3DNTHAL_CONTEXTDESTROYDATA pContextDestroyData ); @@ -29,7 +29,7 @@ DWORD STDCALL DWORD STDCALL OsThunkD3dContextDestroyAll(LPVOID); /* FIXME PD3DNTHAL_DRAWPRIMITIVES2DATA, PD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA missing -DWORD STDCALL OsThunkD3dDrawPrimitives2( +DWORD STDCALL OsThunkD3dDrawPrimitives2( HANDLE hCmdBuf, HANDLE hVBuf, PD3DNTHAL_DRAWPRIMITIVES2DATA pded, @@ -39,12 +39,12 @@ DWORD STDCALL OsThunkD3dDrawPrimitives2( DWORD *pdwSizeVtx ); -DWORD STDCALL OsThunkD3dValidateTextureStageState( +DWORD STDCALL OsThunkD3dValidateTextureStageState( PD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA pData ); */ -DWORD STDCALL OsThunkDdAddAttachedSurface( +DWORD STDCALL OsThunkDdAddAttachedSurface( HANDLE hSurface, HANDLE hSurfaceAttached, PDD_ADDATTACHEDSURFACEDATA puAddAttachedSurfaceData @@ -57,33 +57,33 @@ BOOL STDCALL OsThunkDdAttachSurface( HANDLE hSurfaceTo ); -DWORD STDCALL OsThunkDdBeginMoCompFrame( +DWORD STDCALL OsThunkDdBeginMoCompFrame( HANDLE hMoComp, PDD_BEGINMOCOMPFRAMEDATA puBeginFrameData ); -DWORD STDCALL OsThunkDdBlt( +DWORD STDCALL OsThunkDdBlt( HANDLE hSurfaceDest, HANDLE hSurfaceSrc, PDD_BLTDATA puBltData ); -DWORD STDCALL OsThunkDdCanCreateD3DBuffer( +DWORD STDCALL OsThunkDdCanCreateD3DBuffer( HANDLE hDirectDraw, PDD_CANCREATESURFACEDATA puCanCreateSurfaceData ); -DWORD STDCALL OsThunkDdCanCreateSurface( +DWORD STDCALL OsThunkDdCanCreateSurface( HANDLE hDirectDraw, PDD_CANCREATESURFACEDATA puCanCreateSurfaceData ); -DWORD STDCALL OsThunkDdColorControl( +DWORD STDCALL OsThunkDdColorControl( HANDLE hSurface, PDD_COLORCONTROLDATA puColorControlData ); -DWORD STDCALL OsThunkDdCreateD3DBuffer( +DWORD STDCALL OsThunkDdCreateD3DBuffer( HANDLE hDirectDraw, HANDLE *hSurface, DDSURFACEDESC *puSurfaceDescription, @@ -96,12 +96,12 @@ DWORD STDCALL OsThunkDdCreateD3DBuffer( HANDLE STDCALL OsThunkDdCreateDirectDrawObject(HDC hdc); -HANDLE STDCALL OsThunkDdCreateMoComp( +HANDLE STDCALL OsThunkDdCreateMoComp( HANDLE hDirectDraw, PDD_CREATEMOCOMPDATA puCreateMoCompData ); -DWORD STDCALL OsThunkDdCreateSurface( +DWORD STDCALL OsThunkDdCreateSurface( HANDLE hDirectDraw, HANDLE *hSurface, DDSURFACEDESC *puSurfaceDescription, @@ -112,13 +112,13 @@ DWORD STDCALL OsThunkDdCreateSurface( HANDLE *puhSurface ); -DWORD STDCALL OsThunkDdCreateSurfaceEx( +DWORD STDCALL OsThunkDdCreateSurfaceEx( HANDLE hDirectDraw, HANDLE hSurface, DWORD dwSurfaceHandle ); -HANDLE STDCALL OsThunkDdCreateSurfaceObject( +HANDLE STDCALL OsThunkDdCreateSurfaceObject( HANDLE hDirectDrawLocal, HANDLE hSurface, PDD_SURFACE_LOCAL puSurfaceLocal, @@ -127,34 +127,34 @@ HANDLE STDCALL OsThunkDdCreateSurfaceObject( BOOL bComplete ); -BOOL STDCALL OsThunkDdDeleteDirectDrawObject( +BOOL STDCALL OsThunkDdDeleteDirectDrawObject( HANDLE hDirectDrawLocal ); -BOOL STDCALL OsThunkDdDeleteSurfaceObject( +BOOL STDCALL OsThunkDdDeleteSurfaceObject( HANDLE hSurface ); -DWORD STDCALL OsThunkDdDestroyD3DBuffer( +DWORD STDCALL OsThunkDdDestroyD3DBuffer( HANDLE hSurface ); -DWORD STDCALL OsThunkDdDestroyMoComp( +DWORD STDCALL OsThunkDdDestroyMoComp( HANDLE hMoComp, PDD_DESTROYMOCOMPDATA puBeginFrameData ); -DWORD STDCALL OsThunkDdDestroySurface( +DWORD STDCALL OsThunkDdDestroySurface( HANDLE hSurface, BOOL bRealDestroy ); -DWORD STDCALL OsThunkDdEndMoCompFrame( +DWORD STDCALL OsThunkDdEndMoCompFrame( HANDLE hMoComp, PDD_ENDMOCOMPFRAMEDATA puEndFrameData ); -DWORD STDCALL OsThunkDdFlip( +DWORD STDCALL OsThunkDdFlip( HANDLE hSurfaceCurrent, HANDLE hSurfaceTarget, HANDLE hSurfaceCurrentLeft, @@ -162,78 +162,78 @@ DWORD STDCALL OsThunkDdFlip( PDD_FLIPDATA puFlipData ); -DWORD STDCALL OsThunkDdFlipToGDISurface( +DWORD STDCALL OsThunkDdFlipToGDISurface( HANDLE hDirectDraw, PDD_FLIPTOGDISURFACEDATA puFlipToGDISurfaceData ); -DWORD STDCALL OsThunkDdGetAvailDriverMemory( +DWORD STDCALL OsThunkDdGetAvailDriverMemory( HANDLE hDirectDraw, PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData ); -DWORD STDCALL OsThunkDdGetBltStatus( +DWORD STDCALL OsThunkDdGetBltStatus( HANDLE hSurface, PDD_GETBLTSTATUSDATA puGetBltStatusData ); -HDC STDCALL OsThunkDdGetDC( +HDC STDCALL OsThunkDdGetDC( HANDLE hSurface, PALETTEENTRY *puColorTable ); -DWORD STDCALL OsThunkDdGetDriverInfo( +DWORD STDCALL OsThunkDdGetDriverInfo( HANDLE hDirectDraw, PDD_GETDRIVERINFODATA puGetDriverInfoData ); -DWORD STDCALL OsThunkDdGetDriverState( +DWORD STDCALL OsThunkDdGetDriverState( PDD_GETDRIVERSTATEDATA pdata ); -DWORD STDCALL OsThunkDdGetDxHandle( +DWORD STDCALL OsThunkDdGetDxHandle( HANDLE hDirectDraw, HANDLE hSurface, BOOL bRelease ); -DWORD STDCALL OsThunkDdGetFlipStatus( +DWORD STDCALL OsThunkDdGetFlipStatus( HANDLE hSurface, PDD_GETFLIPSTATUSDATA puGetFlipStatusData ); -DWORD STDCALL OsThunkDdGetInternalMoCompInfo( +DWORD STDCALL OsThunkDdGetInternalMoCompInfo( HANDLE hDirectDraw, PDD_GETINTERNALMOCOMPDATA puGetInternalData ); -DWORD STDCALL OsThunkDdGetMoCompBuffInfo( +DWORD STDCALL OsThunkDdGetMoCompBuffInfo( HANDLE hDirectDraw, PDD_GETMOCOMPCOMPBUFFDATA puGetBuffData ); -DWORD STDCALL OsThunkDdGetMoCompFormats( +DWORD STDCALL OsThunkDdGetMoCompFormats( HANDLE hDirectDraw, PDD_GETMOCOMPFORMATSDATA puGetMoCompFormatsData ); -DWORD STDCALL OsThunkDdGetMoCompGuids( +DWORD STDCALL OsThunkDdGetMoCompGuids( HANDLE hDirectDraw, PDD_GETMOCOMPGUIDSDATA puGetMoCompGuidsData ); -DWORD STDCALL OsThunkDdGetScanLine( +DWORD STDCALL OsThunkDdGetScanLine( HANDLE hDirectDraw, PDD_GETSCANLINEDATA puGetScanLineData ); -DWORD STDCALL OsThunkDdLock( +DWORD STDCALL OsThunkDdLock( HANDLE hSurface, PDD_LOCKDATA puLockData, HDC hdcClip ); -DWORD STDCALL OsThunkDdLockD3D( +DWORD STDCALL OsThunkDdLockD3D( HANDLE hSurface, PDD_LOCKDATA puLockData ); @@ -254,74 +254,74 @@ BOOL STDCALL OsThunkDdQueryDirectDrawObject( ); -DWORD STDCALL OsThunkDdQueryMoCompStatus( +DWORD STDCALL OsThunkDdQueryMoCompStatus( HANDLE hMoComp, PDD_QUERYMOCOMPSTATUSDATA puQueryMoCompStatusData ); -BOOL STDCALL OsThunkDdReenableDirectDrawObject( +BOOL STDCALL OsThunkDdReenableDirectDrawObject( HANDLE hDirectDrawLocal, BOOL *pubNewMode ); -BOOL STDCALL OsThunkDdReleaseDC( +BOOL STDCALL OsThunkDdReleaseDC( HANDLE hSurface ); -DWORD STDCALL OsThunkDdRenderMoComp( +DWORD STDCALL OsThunkDdRenderMoComp( HANDLE hMoComp, PDD_RENDERMOCOMPDATA puRenderMoCompData ); -BOOL STDCALL OsThunkDdResetVisrgn( +BOOL STDCALL OsThunkDdResetVisrgn( HANDLE hSurface, HWND hwnd ); -DWORD STDCALL OsThunkDdSetColorKey( +DWORD STDCALL OsThunkDdSetColorKey( HANDLE hSurface, PDD_SETCOLORKEYDATA puSetColorKeyData ); -DWORD STDCALL OsThunkDdSetExclusiveMode( +DWORD STDCALL OsThunkDdSetExclusiveMode( HANDLE hDirectDraw, PDD_SETEXCLUSIVEMODEDATA puSetExclusiveModeData ); -BOOL STDCALL OsThunkDdSetGammaRamp( +BOOL STDCALL OsThunkDdSetGammaRamp( HANDLE hDirectDraw, HDC hdc, LPVOID lpGammaRamp ); -DWORD STDCALL OsThunkDdSetOverlayPosition( +DWORD STDCALL OsThunkDdSetOverlayPosition( HANDLE hSurfaceSource, HANDLE hSurfaceDestination, PDD_SETOVERLAYPOSITIONDATA puSetOverlayPositionData ); -VOID STDCALL OsThunkDdUnattachSurface( +VOID STDCALL OsThunkDdUnattachSurface( HANDLE hSurface, HANDLE hSurfaceAttached ); -DWORD STDCALL OsThunkDdUnlock( +DWORD STDCALL OsThunkDdUnlock( HANDLE hSurface, PDD_UNLOCKDATA puUnlockData ); -DWORD STDCALL OsThunkDdUnlockD3D( +DWORD STDCALL OsThunkDdUnlockD3D( HANDLE hSurface, PDD_UNLOCKDATA puUnlockData ); -DWORD STDCALL OsThunkDdUpdateOverlay( +DWORD STDCALL OsThunkDdUpdateOverlay( HANDLE hSurfaceDestination, HANDLE hSurfaceSource, PDD_UPDATEOVERLAYDATA puUpdateOverlayData ); -DWORD STDCALL OsThunkDdWaitForVerticalBlank( +DWORD STDCALL OsThunkDdWaitForVerticalBlank( HANDLE hDirectDraw, PDD_WAITFORVERTICALBLANKDATA puWaitForVerticalBlankData ); diff --git a/reactos/include/reactos/drivers/bootvid/bootvid.h b/reactos/include/reactos/drivers/bootvid/bootvid.h index bd10426b290..c9110f46d93 100644 --- a/reactos/include/reactos/drivers/bootvid/bootvid.h +++ b/reactos/include/reactos/drivers/bootvid/bootvid.h @@ -26,7 +26,7 @@ VidSetScrollRegion(ULONG x1, ULONG y1, ULONG x2, ULONG y2); - + VOID NTAPI diff --git a/reactos/include/reactos/elf/common.h b/reactos/include/reactos/elf/common.h index 1eb66ed6c27..4ec6c5a492d 100644 --- a/reactos/include/reactos/elf/common.h +++ b/reactos/include/reactos/elf/common.h @@ -48,7 +48,7 @@ typedef struct { UINT32 n_type; /* Type of this note. */ } Elf_Note; -/* Indexes into the e_ident array. Keep synced with +/* Indexes into the e_ident array. Keep synced with http://www.sco.com/developer/gabi/ch4.eheader.html */ #define EI_MAG0 0 /* Magic number, byte 0. */ #define EI_MAG1 1 /* Magic number, byte 1. */ @@ -249,12 +249,12 @@ typedef struct { #define SHT_STRTAB 3 /* string table section */ #define SHT_RELA 4 /* relocation section with addends */ #define SHT_HASH 5 /* symbol hash table section */ -#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_DYNAMIC 6 /* dynamic section */ #define SHT_NOTE 7 /* note section */ #define SHT_NOBITS 8 /* no space section */ #define SHT_REL 9 /* relocation section - no addends */ #define SHT_SHLIB 10 /* reserved - purpose unknown */ -#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ #define SHT_NUM 12 /* number of section types */ #define SHT_LOOS 0x60000000 /* First of OS specific semantics */ #define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ diff --git a/reactos/include/reactos/elf/reactos.h b/reactos/include/reactos/elf/reactos.h index 00743db9fa1..d0d7f7ba807 100644 --- a/reactos/include/reactos/elf/reactos.h +++ b/reactos/include/reactos/elf/reactos.h @@ -1,7 +1,7 @@ -#ifndef _SYS_ELF_REACTOS_H_ -#define _SYS_ELF_REACTOS_H_ 1 - -#define TYPE_PEHEADER (SHT_LOOS+1) -#define ADDR24_MASK 0x03fffffc - -#endif/*_SYS_ELF_REACTOS_H_*/ +#ifndef _SYS_ELF_REACTOS_H_ +#define _SYS_ELF_REACTOS_H_ 1 + +#define TYPE_PEHEADER (SHT_LOOS+1) +#define ADDR24_MASK 0x03fffffc + +#endif/*_SYS_ELF_REACTOS_H_*/ diff --git a/reactos/include/reactos/helper.h b/reactos/include/reactos/helper.h index 07a18e75139..f3fdd7f9be4 100644 --- a/reactos/include/reactos/helper.h +++ b/reactos/include/reactos/helper.h @@ -36,15 +36,15 @@ #define KEBUGCHECK(a) DbgPrint("KeBugCheck at %s:%i\n",__FILE__,__LINE__), KeBugCheck(a) #endif -/* iterate through the list using a list entry. +/* iterate through the list using a list entry. * elem is set to NULL if the list is run thru without breaking out or if list is empty. */ #define LIST_FOR_EACH(elem, list, type, field) \ for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \ &(elem)->field != (list) || (elem == NULL); \ (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field)) - -/* iterate through the list using a list entry, with safety against removal + +/* iterate through the list using a list entry, with safety against removal * elem is set to NULL if the list is run thru without breaking out or if list is empty. */ #define LIST_FOR_EACH_SAFE(cursor, cursor2, list, type, field) \ @@ -53,7 +53,7 @@ &(cursor)->field != (list) || (cursor == NULL); \ (cursor) = (cursor2), \ (cursor2) = CONTAINING_RECORD((cursor)->field.Flink, type, field)) - + #define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a + \ ((PIMAGE_DOS_HEADER)a)->e_lfanew + \ sizeof (IMAGE_NT_SIGNATURE) + \ diff --git a/reactos/include/reactos/idl/eventlogrpc.idl b/reactos/include/reactos/idl/eventlogrpc.idl index 6cf8cbd9055..618dadc2073 100644 --- a/reactos/include/reactos/idl/eventlogrpc.idl +++ b/reactos/include/reactos/idl/eventlogrpc.idl @@ -1,4 +1,4 @@ -/* +/* * Copyright 2005 Saveliy Tretiakov * * This program is free software; you can redistribute it and/or modify @@ -122,8 +122,8 @@ interface eventlog handle_t BindingHandle, #endif [in, unique] LPWSTR ServerName, - [in] PUNICODE_STRING FileName, - [in] PUNICODE_STRING NullStr, + [in] PUNICODE_STRING FileName, + [in] PUNICODE_STRING NullStr, [in] long MajorVer, [in] long MinorVer, [out] PLOGHANDLE Handle ); @@ -134,8 +134,8 @@ interface eventlog handle_t BindingHandle, #endif [in, unique] LPWSTR ServerName, - [in] PUNICODE_STRING LogName, - [in] PUNICODE_STRING NullStr, + [in] PUNICODE_STRING LogName, + [in] PUNICODE_STRING NullStr, [in] long MajorVer, [in] long MinorVer, [out] PLOGHANDLE Handle); @@ -146,7 +146,7 @@ interface eventlog handle_t BindingHandle, #endif [in, unique] LPWSTR ServerName, - [in] PUNICODE_STRING BackupName, + [in] PUNICODE_STRING BackupName, [in] long MajorVer, [in] long MinorVer, [out] PLOGHANDLE Handle); @@ -210,8 +210,8 @@ interface eventlog handle_t BindingHandle, #endif [in, unique] LPSTR ServerName, - [in] PANSI_STRING LogName, - [in] PANSI_STRING NullStr, + [in] PANSI_STRING LogName, + [in] PANSI_STRING NullStr, [in] long MajorVer, [in] long MinorVer, [out] PLOGHANDLE Handle); @@ -222,7 +222,7 @@ interface eventlog handle_t BindingHandle, #endif [in, unique] LPSTR ServerName, - [in] PANSI_STRING LogName, + [in] PANSI_STRING LogName, [in] PANSI_STRING NullStr, [in] long MajorVer, [in] long MinorVer, @@ -234,7 +234,7 @@ interface eventlog handle_t BindingHandle, #endif [in, unique] LPSTR ServerName, - [in] PANSI_STRING BakckupName, + [in] PANSI_STRING BakckupName, [in] long MajorVer, [in] long MinorVer, [out] PLOGHANDLE Handle); @@ -295,12 +295,12 @@ interface eventlog [out, size_is(BufSize)] unsigned char *Buffer, [in] long BufSize, [out] long *BytesNeeded); - + /* Function 0x17 */ NTSTATUS ElfrFlushEL( #ifndef __midl handle_t BindingHandle, #endif - [in] LOGHANDLE Handle); + [in] LOGHANDLE Handle); } diff --git a/reactos/include/reactos/libs/audiosrv/audiosrv.h b/reactos/include/reactos/libs/audiosrv/audiosrv.h index 5d14ba96646..7abb85a3b81 100644 --- a/reactos/include/reactos/libs/audiosrv/audiosrv.h +++ b/reactos/include/reactos/libs/audiosrv/audiosrv.h @@ -1,60 +1,60 @@ -/* - * PROJECT: ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: include/reactos/libs/audiosrv/audiosrv.h - * PURPOSE: Audio Service Plug and Play list - * COPYRIGHT: Copyright 2007 Andrew Greenwood - */ - -#include - -#ifndef AUDIOSRV_H -#define AUDIOSRV_H - -/* This is currently set to avoid conflicting service names in Windows! */ -#define SERVICE_NAME L"RosAudioSrv" - -/* A named mutex is used for synchronizing access to the device list. - If this mutex doesn't exist, it means the audio service isn't running. */ -#define AUDIO_LIST_LOCK_NAME L"Global\\AudioDeviceListLock" - -/* ...and this is where the device list will be available */ -#define AUDIO_LIST_NAME L"Global\\AudioDeviceList" - -/* Amount of shared memory to allocate */ -#define AUDIO_LIST_MAX_SIZE 65536 - -typedef struct -{ - DWORD enabled; - WCHAR path[]; /* The device object path (excluded from sizeof) */ -} PnP_AudioDevice; - -typedef struct -{ - DWORD size; /* Size of the shared mem */ - DWORD max_size; /* Amount of mem available */ - DWORD device_count; /* Number of devices */ - PnP_AudioDevice first_device[]; -} PnP_AudioHeader; - - -/* Calculate amount of memory consumed by a wide string - this includes the - terminating NULL. */ - -#define WideStringSize(str) \ - ( (lstrlenW(str) + 1) * sizeof(WCHAR) ) - -BOOL -InitializeAudioDeviceListLock(); - -VOID -KillAudioDeviceListLock(); - -VOID -LockAudioDeviceList(); - -VOID -UnlockAudioDeviceList(); - -#endif +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/reactos/libs/audiosrv/audiosrv.h + * PURPOSE: Audio Service Plug and Play list + * COPYRIGHT: Copyright 2007 Andrew Greenwood + */ + +#include + +#ifndef AUDIOSRV_H +#define AUDIOSRV_H + +/* This is currently set to avoid conflicting service names in Windows! */ +#define SERVICE_NAME L"RosAudioSrv" + +/* A named mutex is used for synchronizing access to the device list. + If this mutex doesn't exist, it means the audio service isn't running. */ +#define AUDIO_LIST_LOCK_NAME L"Global\\AudioDeviceListLock" + +/* ...and this is where the device list will be available */ +#define AUDIO_LIST_NAME L"Global\\AudioDeviceList" + +/* Amount of shared memory to allocate */ +#define AUDIO_LIST_MAX_SIZE 65536 + +typedef struct +{ + DWORD enabled; + WCHAR path[]; /* The device object path (excluded from sizeof) */ +} PnP_AudioDevice; + +typedef struct +{ + DWORD size; /* Size of the shared mem */ + DWORD max_size; /* Amount of mem available */ + DWORD device_count; /* Number of devices */ + PnP_AudioDevice first_device[]; +} PnP_AudioHeader; + + +/* Calculate amount of memory consumed by a wide string - this includes the + terminating NULL. */ + +#define WideStringSize(str) \ + ( (lstrlenW(str) + 1) * sizeof(WCHAR) ) + +BOOL +InitializeAudioDeviceListLock(); + +VOID +KillAudioDeviceListLock(); + +VOID +LockAudioDeviceList(); + +VOID +UnlockAudioDeviceList(); + +#endif diff --git a/reactos/include/reactos/libs/expat/expat.h b/reactos/include/reactos/libs/expat/expat.h index cf113eeaf24..00ddbcee4ad 100644 --- a/reactos/include/reactos/libs/expat/expat.h +++ b/reactos/include/reactos/libs/expat/expat.h @@ -765,20 +765,20 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal); (resumable = 0) an already suspended parser. Some call-backs may still follow because they would otherwise get lost. Examples: - endElementHandler() for empty elements when stopped in - startElementHandler(), - - endNameSpaceDeclHandler() when stopped in endElementHandler(), + startElementHandler(), + - endNameSpaceDeclHandler() when stopped in endElementHandler(), and possibly others. Can be called from most handlers, including DTD related call-backs, except when parsing an external parameter entity and resumable != 0. Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise. - Possible error codes: + Possible error codes: - XML_ERROR_SUSPENDED: when suspending an already suspended parser. - XML_ERROR_FINISHED: when the parser has already finished. - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE. - When resumable != 0 (true) then parsing is suspended, that is, - XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. + When resumable != 0 (true) then parsing is suspended, that is, + XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer() return XML_STATUS_ERROR with error code XML_ERROR_ABORTED. @@ -789,7 +789,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal); the externalEntityRefHandler() to call XML_StopParser() on the parent parser (recursively), if one wants to stop parsing altogether. - When suspended, parsing can be resumed by calling XML_ResumeParser(). + When suspended, parsing can be resumed by calling XML_ResumeParser(). */ XMLPARSEAPI(enum XML_Status) XML_StopParser(XML_Parser parser, XML_Bool resumable); @@ -797,7 +797,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable); /* Resumes parsing after it has been suspended with XML_StopParser(). Must not be called from within a handler call-back. Returns same status codes as XML_Parse() or XML_ParseBuffer(). - Additional error code XML_ERROR_NOT_SUSPENDED possible. + Additional error code XML_ERROR_NOT_SUSPENDED possible. *Note*: This must be called on the most deeply nested child parser instance @@ -898,7 +898,7 @@ XML_GetErrorCode(XML_Parser parser); be within the relevant markup. When called outside of the callback functions, the position indicated will be just past the last parse event (regardless of whether there was an associated callback). - + They may also be called after returning from a call to XML_Parse or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then the location is the location of the character at which the error diff --git a/reactos/include/reactos/libs/expat/expat_external.h b/reactos/include/reactos/libs/expat/expat_external.h index 8a2d708f146..99c5b922cbf 100644 --- a/reactos/include/reactos/libs/expat/expat_external.h +++ b/reactos/include/reactos/libs/expat/expat_external.h @@ -97,7 +97,7 @@ typedef char XML_LChar; #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 -typedef __int64 XML_Index; +typedef __int64 XML_Index; typedef unsigned __int64 XML_Size; #else typedef long long XML_Index; diff --git a/reactos/include/reactos/resource.h b/reactos/include/reactos/resource.h index 039d477bbf9..059248d56b7 100644 --- a/reactos/include/reactos/resource.h +++ b/reactos/include/reactos/resource.h @@ -28,7 +28,7 @@ #define RES_STR_BUILD_DATE KERNEL_VERSION_BUILD_RC /* FILE_VERSION defaults to PRODUCT_VERSION */ -#define RES_STR_FILE_VERSION KERNEL_RELEASE_RC +#define RES_STR_FILE_VERSION KERNEL_RELEASE_RC /* ReactOS default Application Registry Root Path */ #define RES_STR_ROSAPP_REGISTRY_ROOT "Software\\ReactWare" diff --git a/reactos/include/reactos/rossym.h b/reactos/include/reactos/rossym.h index 7219bce77c1..41212f45bca 100644 --- a/reactos/include/reactos/rossym.h +++ b/reactos/include/reactos/rossym.h @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: include/reactos/rossym.h * PURPOSE: Handling of rossym symbol info - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/include/reactos/subsys/csr/server.h b/reactos/include/reactos/subsys/csr/server.h index 2cf2dff9e1a..eeb7cf6d2a7 100644 --- a/reactos/include/reactos/subsys/csr/server.h +++ b/reactos/include/reactos/subsys/csr/server.h @@ -43,7 +43,7 @@ typedef struct _CSR_PROCESS ULONG ShutdownLevel; ULONG ShutdownFlags; PVOID ServerData[]; -} CSR_PROCESS, *PCSR_PROCESS; +} CSR_PROCESS, *PCSR_PROCESS; typedef struct _CSR_THREAD { @@ -57,7 +57,7 @@ typedef struct _CSR_THREAD ULONG Flags; ULONG ReferenceCount; ULONG ImpersonationCount; -} CSR_THREAD, *PCSR_THREAD; +} CSR_THREAD, *PCSR_THREAD; /* ENUMERATIONS **************************************************************/ #define CSR_SRV_SERVER 0 @@ -171,7 +171,7 @@ typedef struct _CSR_API_MESSAGE { PVOID CsrCaptureData; CSR_API_NUMBER Opcode; - ULONG Status; + ULONG Status; ULONG Reserved; union { diff --git a/reactos/include/reactos/subsys/csrss/csrss.h b/reactos/include/reactos/subsys/csrss/csrss.h index 7269c77d0da..e845479c2ea 100644 --- a/reactos/include/reactos/subsys/csrss/csrss.h +++ b/reactos/include/reactos/subsys/csrss/csrss.h @@ -598,7 +598,7 @@ typedef struct _CSR_API_MESSAGE2 { PVOID CsrCaptureData; CSR_API_NUMBER Opcode; - ULONG Status; + ULONG Status; ULONG Reserved; union { diff --git a/reactos/include/reactos/subsys/lsass/lsass.h b/reactos/include/reactos/subsys/lsass/lsass.h index 1d698c2426c..4727272c9d6 100644 --- a/reactos/include/reactos/subsys/lsass/lsass.h +++ b/reactos/include/reactos/subsys/lsass/lsass.h @@ -106,7 +106,7 @@ typedef union _LSASS_REQUEST { LSASS_REGISTER_LOGON_PROCESS_REQUEST RegisterLogonProcessRequest; LSASS_LOGON_USER_REQUEST LogonUserRequest; - LSASS_CALL_AUTHENTICATION_PACKAGE_REQUEST + LSASS_CALL_AUTHENTICATION_PACKAGE_REQUEST CallAuthenticationPackageRequest; LSASS_DEREGISTER_LOGON_PROCESS_REPLY DeregisterLogonProcessRequest; LSASS_LOOKUP_AUTHENTICATION_PACKAGE_REQUEST @@ -125,7 +125,7 @@ typedef struct _LSASS_REPLY LSASS_LOGON_USER_REPLY LogonUserReply; LSASS_CALL_AUTHENTICATION_PACKAGE_REPLY CallAuthenticationPackageReply; LSASS_DEREGISTER_LOGON_PROCESS_REPLY DeregisterLogonProcessReply; - LSASS_LOOKUP_AUTHENTICATION_PACKAGE_REPLY + LSASS_LOOKUP_AUTHENTICATION_PACKAGE_REPLY LookupAuthenticationPackageReply; } d; } LSASS_REPLY, *PLSASS_REPLY; diff --git a/reactos/include/reactos/win32k/ntgdibad.h b/reactos/include/reactos/win32k/ntgdibad.h index 9c4cf685491..bc31f42f0ea 100644 --- a/reactos/include/reactos/win32k/ntgdibad.h +++ b/reactos/include/reactos/win32k/ntgdibad.h @@ -85,7 +85,7 @@ NtGdiGetTextExtentPoint32( HDC hDC, LPCWSTR String, int Count, - LPSIZE + LPSIZE ); BOOL @@ -114,7 +114,7 @@ NtGdiCloseEnhMetaFile ( BOOL STDCALL NtGdiColorMatchToTarget(HDC hDC, - HDC hDCTarget, + HDC hDCTarget, DWORD Action); /* Metafiles are user mode */ @@ -326,7 +326,7 @@ NtGdiGetEnhMetaFilePaletteEntries ( UINT STDCALL NtGdiGetEnhMetaFilePixelFormat(HENHMETAFILE hEMF, - DWORD BufSize, + DWORD BufSize, CONST PPIXELFORMATDESCRIPTOR pfd); /* Should be done in user-mode. */ @@ -342,7 +342,7 @@ NtGdiGetGraphicsMode ( HDC hDC ); /* Should be done in user-mode. */ BOOL STDCALL -NtGdiGetICMProfile(HDC hDC, +NtGdiGetICMProfile(HDC hDC, LPDWORD NameSize, LPWSTR Filename); @@ -589,8 +589,8 @@ NtGdiStretchDIBits ( /* Needs to be done in user-mode. */ BOOL STDCALL -NtGdiUpdateICMRegKey(DWORD Reserved, - LPWSTR CMID, +NtGdiUpdateICMRegKey(DWORD Reserved, + LPWSTR CMID, LPWSTR Filename, UINT Command); @@ -621,17 +621,17 @@ NtUserCallTwoParam( #endif /* WIN32K_NTGDI_BAD_INCLUDED */ -/* Follow thing need be rewriten +/* Follow thing need be rewriten * * Opengl icd are complete hacked in reactos and are using own way, this need be rewriten and be setup with the correct syscall * and the opengl32 shall using correct syscall to optain then driver interface or using the correct version in gdi32. * it mean whole icd are hacked in frist place and need be rewtiten from scrash. and it need enum the opengl correct way and * export the driver correct * - * DirectX aka ReactX alot api that have been implement in reactos win32k for ReactX shall move to a file call dxg.sys - * there from it will really doing the stuff. And we should setup loading of dxg.sys + * DirectX aka ReactX alot api that have been implement in reactos win32k for ReactX shall move to a file call dxg.sys + * there from it will really doing the stuff. And we should setup loading of dxg.sys * - * The Init of Gdi subsystem shall move into NtGdiInit() + * The Init of Gdi subsystem shall move into NtGdiInit() * * The Init of spooler are done in NtGdiInitSpool() * diff --git a/reactos/include/reactos/win32k/ntgdihdl.h b/reactos/include/reactos/win32k/ntgdihdl.h index 76e502fb63d..cb19536af0c 100644 --- a/reactos/include/reactos/win32k/ntgdihdl.h +++ b/reactos/include/reactos/win32k/ntgdihdl.h @@ -145,22 +145,22 @@ #define DC_FLAG_SHAREACCESS 0x4000 /* DC_ATTR Dirty Flags */ -#define DIRTY_FILL 0x00000001 -#define DIRTY_LINE 0x00000002 -#define DIRTY_TEXT 0x00000004 -#define DIRTY_BACKGROUND 0x00000008 -#define DIRTY_CHARSET 0x00000010 -#define SLOW_WIDTHS 0x00000020 -#define DC_CACHED_TM_VALID 0x00000040 -#define DISPLAY_DC 0x00000080 -#define DIRTY_PTLCURRENT 0x00000100 -#define DIRTY_PTFXCURRENT 0x00000200 -#define DIRTY_STYLESTATE 0x00000400 -#define DC_PLAYMETAFILE 0x00000800 -#define DC_BRUSH_DIRTY 0x00001000 -#define DC_PEN_DIRTY 0x00002000 -#define DC_DIBSECTION 0x00004000 -#define DC_LAST_CLIPRGN_VALID 0x00008000 +#define DIRTY_FILL 0x00000001 +#define DIRTY_LINE 0x00000002 +#define DIRTY_TEXT 0x00000004 +#define DIRTY_BACKGROUND 0x00000008 +#define DIRTY_CHARSET 0x00000010 +#define SLOW_WIDTHS 0x00000020 +#define DC_CACHED_TM_VALID 0x00000040 +#define DISPLAY_DC 0x00000080 +#define DIRTY_PTLCURRENT 0x00000100 +#define DIRTY_PTFXCURRENT 0x00000200 +#define DIRTY_STYLESTATE 0x00000400 +#define DC_PLAYMETAFILE 0x00000800 +#define DC_BRUSH_DIRTY 0x00001000 +#define DC_PEN_DIRTY 0x00002000 +#define DC_DIBSECTION 0x00004000 +#define DC_LAST_CLIPRGN_VALID 0x00008000 #define DC_PRIMARY_DISPLAY 0x00010000 #define DC_MODE_DIRTY 0x00200000 #define DC_FONTTEXT_DIRTY 0x00400000 @@ -201,11 +201,11 @@ typedef struct _GDI_TABLE_ENTRY PVOID UserData; /* Points to the user mode structure, usually NULL though */ } GDI_TABLE_ENTRY, *PGDI_TABLE_ENTRY; -typedef struct _RGNATTR -{ - ULONG AttrFlags; - ULONG Flags; - RECTL Rect; +typedef struct _RGNATTR +{ + ULONG AttrFlags; + ULONG Flags; + RECTL Rect; } RGNATTR,*PRGNATTR; // Local DC structure (_DC_ATTR) PVOID pvLDC; @@ -223,63 +223,63 @@ typedef struct _LDC typedef struct _DC_ATTR { - PVOID pvLDC; - ULONG ulDirty_; - HANDLE hbrush; - HANDLE hpen; - COLORREF crBackgroundClr; - ULONG ulBackgroundClr; - COLORREF crForegroundClr; - ULONG ulForegroundClr; - COLORREF crBrushClr; - ULONG ulBrushClr; - COLORREF crPenClr; - ULONG ulPenClr; - DWORD iCS_CP; - INT iGraphicsMode; - BYTE jROP2; - BYTE jBkMode; - BYTE jFillMode; - BYTE jStretchBltMode; - POINTL ptlCurrent; - POINTL ptfxCurrent; - LONG lBkMode; - LONG lFillMode; - LONG lStretchBltMode; - FLONG flFontMapper; - LONG lIcmMode; - HANDLE hcmXform; - HCOLORSPACE hColorSpace; + PVOID pvLDC; + ULONG ulDirty_; + HANDLE hbrush; + HANDLE hpen; + COLORREF crBackgroundClr; + ULONG ulBackgroundClr; + COLORREF crForegroundClr; + ULONG ulForegroundClr; + COLORREF crBrushClr; + ULONG ulBrushClr; + COLORREF crPenClr; + ULONG ulPenClr; + DWORD iCS_CP; + INT iGraphicsMode; + BYTE jROP2; + BYTE jBkMode; + BYTE jFillMode; + BYTE jStretchBltMode; + POINTL ptlCurrent; + POINTL ptfxCurrent; + LONG lBkMode; + LONG lFillMode; + LONG lStretchBltMode; + FLONG flFontMapper; + LONG lIcmMode; + HANDLE hcmXform; + HCOLORSPACE hColorSpace; FLONG flIcmFlags; - INT IcmBrushColor; + INT IcmBrushColor; INT IcmPenColor; - PVOID pvLIcm; - FLONG flTextAlign; - LONG lTextAlign; - LONG lTextExtra; - LONG lRelAbs; - LONG lBreakExtra; - LONG cBreak; - HANDLE hlfntNew; - MATRIX_S mxWorldToDevice; - MATRIX_S mxDevicetoWorld; - MATRIX_S mxWorldToPage; + PVOID pvLIcm; + FLONG flTextAlign; + LONG lTextAlign; + LONG lTextExtra; + LONG lRelAbs; + LONG lBreakExtra; + LONG cBreak; + HANDLE hlfntNew; + MATRIX_S mxWorldToDevice; + MATRIX_S mxDevicetoWorld; + MATRIX_S mxWorldToPage; EFLOAT_S efM11PtoD; EFLOAT_S efM22PtoD; EFLOAT_S efDxPtoD; EFLOAT_S efDyPtoD; - INT iMapMode; - DWORD dwLayout; - LONG lWindowOrgx; - POINTL ptlWindowOrg; - SIZEL szlWindowExt; - POINTL ptlViewportOrg; - SIZEL szlViewportExt; - FLONG flXform; - SIZEL szlVirtualDevicePixel; + INT iMapMode; + DWORD dwLayout; + LONG lWindowOrgx; + POINTL ptlWindowOrg; + SIZEL szlWindowExt; + POINTL ptlViewportOrg; + SIZEL szlViewportExt; + FLONG flXform; + SIZEL szlVirtualDevicePixel; SIZEL szlVirtualDeviceMm; - SIZEL szlVirtualDeviceSize; - POINTL ptlBrushOrigin; + SIZEL szlVirtualDeviceSize; + POINTL ptlBrushOrigin; RGNATTR VisRectRegion; } DC_ATTR, *PDC_ATTR; diff --git a/reactos/include/reactos/win32k/ntgdityp.h b/reactos/include/reactos/win32k/ntgdityp.h index 59c177309d2..33a07046828 100644 --- a/reactos/include/reactos/win32k/ntgdityp.h +++ b/reactos/include/reactos/win32k/ntgdityp.h @@ -157,11 +157,11 @@ typedef struct _MATRIX_S } MATRIX_S; /* Gdi XForm storage union */ -typedef union -{ - FLOAT f; - ULONG l; -} gxf_long; - +typedef union +{ + FLOAT f; + ULONG l; +} gxf_long; + #endif diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index 3fa7a0c89e9..2c1b342a2a0 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -458,7 +458,7 @@ NTAPI NtUserCallMsgFilter( LPMSG msg, INT code); - + LRESULT NTAPI NtUserCallNextHookEx( @@ -1111,7 +1111,7 @@ NtUserGetInternalWindowPos( DWORD Unknown2); HKL -NTAPI +NTAPI NtUserGetKeyboardLayout( DWORD dwThreadid); @@ -1139,7 +1139,7 @@ NtUserGetKeyboardType( DWORD NTAPI NtUserGetKeyNameText( LONG lParam, LPWSTR lpString, int nSize ); - + DWORD NTAPI NtUserGetKeyState( @@ -1256,15 +1256,15 @@ NtUserGetRegisteredRawInputDevices( BOOL NTAPI NtUserGetScrollBarInfo( - HWND hWnd, - LONG idObject, + HWND hWnd, + LONG idObject, PSCROLLBARINFO psbi); BOOL NTAPI NtUserGetScrollInfo( - HWND hwnd, - int fnBar, + HWND hwnd, + int fnBar, LPSCROLLINFO lpsi); HDESK @@ -1403,7 +1403,7 @@ NtUserKillTimer HKL STDCALL -NtUserLoadKeyboardLayoutEx( +NtUserLoadKeyboardLayoutEx( IN HANDLE Handle, IN DWORD offTable, IN PUNICODE_STRING puszKeyboardName, @@ -1495,7 +1495,7 @@ NtUserMonitorFromWindow( BOOL NTAPI -NtUserMoveWindow( +NtUserMoveWindow( HWND hWnd, int X, int Y, @@ -1719,7 +1719,7 @@ NtUserRegisterClassEx( WNDPROC wpExtra, DWORD Flags, HMENU hMenu); - + UINT NTAPI NtUserRegisterClipboardFormat( @@ -2039,9 +2039,9 @@ NtUserSetRipFlags( DWORD NTAPI NtUserSetScrollInfo( - HWND hwnd, - int fnBar, - LPCSCROLLINFO lpsi, + HWND hwnd, + int fnBar, + LPCSCROLLINFO lpsi, BOOL bRedraw); BOOL @@ -2125,8 +2125,8 @@ NtUserSetWindowPlacement( HWND hWnd, WINDOWPLACEMENT *lpwndpl); -BOOL -NTAPI NtUserSetWindowPos( +BOOL +NTAPI NtUserSetWindowPos( HWND hWnd, HWND hWndInsertAfter, int X, @@ -2417,7 +2417,7 @@ typedef struct _WNDPROC_INFO WNDPROC WindowProc; BOOL IsUnicode; } WNDPROC_INFO, *PWNDPROC_INFO; - + BOOL NTAPI NtUserDereferenceWndProcHandle(IN HANDLE wpHandle, OUT PWNDPROC_INFO wpInfo); @@ -2438,7 +2438,7 @@ NtUserManualGuiCheck(LONG Check); typedef struct _SETSCROLLBARINFO { - int nTrackPos; + int nTrackPos; int reserved; DWORD rgstate[CCHILDREN_SCROLLBAR+1]; } SETSCROLLBARINFO, *PSETSCROLLBARINFO; @@ -2456,7 +2456,7 @@ typedef struct tagKMDDEEXECUTEDATA HWND Sender; HGLOBAL ClientMem; /* BYTE Data[DataSize] */ -} KMDDEEXECUTEDATA, *PKMDDEEXECUTEDATA; +} KMDDEEXECUTEDATA, *PKMDDEEXECUTEDATA; typedef struct tagKMDDELPARAM { diff --git a/reactos/include/reactos/wine/itss.idl b/reactos/include/reactos/wine/itss.idl index 9d09cb65f1a..bbc55e3571f 100644 --- a/reactos/include/reactos/wine/itss.idl +++ b/reactos/include/reactos/wine/itss.idl @@ -1,95 +1,95 @@ -/* - * Copyright (C) 2004 Mike McCormack - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; - -typedef struct _ITS_Control_Data -{ - UINT cdwControlData; - UINT adwControlData[1]; - -} ITS_Control_Data, *PITS_Control_Data; - -typedef enum ECompactionLev { - COMPACT_DATA = 0, - COMPACT_DATA_AND_PATH -} ECompactionLev; - -[ - object, - uuid(88cc31de-27ab-11d0-9df9-00a0c922e6ec), - pointer_default(unique) -] -interface IITStorage : IUnknown -{ - HRESULT StgCreateDocfile( - [in] const WCHAR * pwcsName, - [in] DWORD grfMode, - [in] DWORD reserved, - [out] IStorage ** ppstgOpen); - - HRESULT StgCreateDocfileOnILockBytes( - [in] ILockBytes * plkbyt, - [in] DWORD grfMode, - [in] DWORD reserved, - [out] IStorage ** ppstgOpen); - - - HRESULT StgIsStorageFile( - [in] const WCHAR * pwcsName); - - HRESULT StgIsStorageILockBytes( - [in] ILockBytes * plkbyt); - - HRESULT StgOpenStorage( - [in] const WCHAR * pwcsName, - [in] IStorage * pstgPriority, - [in] DWORD grfMode, - [in] SNB snbExclude, - [in] DWORD reserved, - [out] IStorage ** ppstgOpen); - - HRESULT StgOpenStorageOnILockBytes( - [in] ILockBytes * plkbyt, - [in] IStorage * pStgPriority, - [in] DWORD grfMode, - [in] SNB snbExclude, - [in] DWORD reserved, - [out] IStorage ** ppstgOpen); - - HRESULT StgSetTimes( - [in] WCHAR const * lpszName, - [in] FILETIME const * pctime, - [in] FILETIME const * patime, - [in] FILETIME const * pmtime); - - HRESULT SetControlData( - [in] PITS_Control_Data pControlData); - - HRESULT DefaultControlData( - [out] PITS_Control_Data * ppControlData); - - HRESULT Compact( - [in] const WCHAR * pwcsName, - [in] ECompactionLev iLev); -} - -cpp_quote("DEFINE_GUID(CLSID_ITStorage,0x5d02926a,0x212e,0x11d0,0x9d,0xf9,0x00,0xa0,0xc9,0x22,0xe6,0xec);") -cpp_quote("DEFINE_GUID(CLSID_MSFSStore,0xd54eee56,0xaaab,0x11d0,0x9e,0x1d,0x00,0xa0,0xc9,0x22,0xe6,0xec);") -cpp_quote("DEFINE_GUID(CLSID_MSITStore,0x9d148290,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);") -cpp_quote("DEFINE_GUID(CLSID_ITSProtocol,0x9d148291,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);") +/* + * Copyright (C) 2004 Mike McCormack + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "oaidl.idl"; + +typedef struct _ITS_Control_Data +{ + UINT cdwControlData; + UINT adwControlData[1]; + +} ITS_Control_Data, *PITS_Control_Data; + +typedef enum ECompactionLev { + COMPACT_DATA = 0, + COMPACT_DATA_AND_PATH +} ECompactionLev; + +[ + object, + uuid(88cc31de-27ab-11d0-9df9-00a0c922e6ec), + pointer_default(unique) +] +interface IITStorage : IUnknown +{ + HRESULT StgCreateDocfile( + [in] const WCHAR * pwcsName, + [in] DWORD grfMode, + [in] DWORD reserved, + [out] IStorage ** ppstgOpen); + + HRESULT StgCreateDocfileOnILockBytes( + [in] ILockBytes * plkbyt, + [in] DWORD grfMode, + [in] DWORD reserved, + [out] IStorage ** ppstgOpen); + + + HRESULT StgIsStorageFile( + [in] const WCHAR * pwcsName); + + HRESULT StgIsStorageILockBytes( + [in] ILockBytes * plkbyt); + + HRESULT StgOpenStorage( + [in] const WCHAR * pwcsName, + [in] IStorage * pstgPriority, + [in] DWORD grfMode, + [in] SNB snbExclude, + [in] DWORD reserved, + [out] IStorage ** ppstgOpen); + + HRESULT StgOpenStorageOnILockBytes( + [in] ILockBytes * plkbyt, + [in] IStorage * pStgPriority, + [in] DWORD grfMode, + [in] SNB snbExclude, + [in] DWORD reserved, + [out] IStorage ** ppstgOpen); + + HRESULT StgSetTimes( + [in] WCHAR const * lpszName, + [in] FILETIME const * pctime, + [in] FILETIME const * patime, + [in] FILETIME const * pmtime); + + HRESULT SetControlData( + [in] PITS_Control_Data pControlData); + + HRESULT DefaultControlData( + [out] PITS_Control_Data * ppControlData); + + HRESULT Compact( + [in] const WCHAR * pwcsName, + [in] ECompactionLev iLev); +} + +cpp_quote("DEFINE_GUID(CLSID_ITStorage,0x5d02926a,0x212e,0x11d0,0x9d,0xf9,0x00,0xa0,0xc9,0x22,0xe6,0xec);") +cpp_quote("DEFINE_GUID(CLSID_MSFSStore,0xd54eee56,0xaaab,0x11d0,0x9e,0x1d,0x00,0xa0,0xc9,0x22,0xe6,0xec);") +cpp_quote("DEFINE_GUID(CLSID_MSITStore,0x9d148290,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);") +cpp_quote("DEFINE_GUID(CLSID_ITSProtocol,0x9d148291,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);") diff --git a/reactos/include/reactos/wine/list.h b/reactos/include/reactos/wine/list.h index 5c16450faf4..6188cda95d8 100644 --- a/reactos/include/reactos/wine/list.h +++ b/reactos/include/reactos/wine/list.h @@ -175,7 +175,7 @@ __inline static unsigned int list_count( const struct list *list ) #define LIST_FOR_EACH_ENTRY_REV(elem, list, type, field) \ for ((elem) = LIST_ENTRY((list)->prev, type, field); \ &(elem)->field != (list); \ - (elem) = LIST_ENTRY((elem)->field.prev, type, field)) + (elem) = LIST_ENTRY((elem)->field.prev, type, field)) /* macros for statically initialized lists */ #define LIST_INIT(list) { &(list), &(list) } diff --git a/reactos/include/reactos/wine/rpcss_shared.h b/reactos/include/reactos/wine/rpcss_shared.h index 6992f04a959..b7824c1f076 100644 --- a/reactos/include/reactos/wine/rpcss_shared.h +++ b/reactos/include/reactos/wine/rpcss_shared.h @@ -46,7 +46,7 @@ ("RPCSSMasterMutex" STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION) /* payloads above 1K are fragmented into multiple messages */ -#define VARDATA_PAYLOAD_BYTES 1024 +#define VARDATA_PAYLOAD_BYTES 1024 /* ick -- maybe we should pass a handle to a mailslot or something? */ #define MAX_RPCSS_NP_REPLY_STRING_LEN 512 @@ -63,7 +63,7 @@ typedef struct _RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG { char payload[VARDATA_PAYLOAD_BYTES]; } RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG; -/* RANMSG: +/* RANMSG: * Simply tells the server that another rpcss instance ran. * The server should respond by resetting its timeout to the * full lazy timeout. @@ -125,8 +125,8 @@ typedef union { /* vardata_payload_size specifies the number of bytes * to be transferred over the pipe in VARDATAPAYLOAD - * messages (divide by VARDATA_PAYLOAD_BYTES to - * get the # of payloads) + * messages (divide by VARDATA_PAYLOAD_BYTES to + * get the # of payloads) */ typedef struct _RPCSS_NP_MESSAGE { UINT32 message_type; diff --git a/reactos/include/reactos/wine/wined3d_gl.h b/reactos/include/reactos/wine/wined3d_gl.h index 7348b835ba1..132fe432d5e 100644 --- a/reactos/include/reactos/wine/wined3d_gl.h +++ b/reactos/include/reactos/wine/wined3d_gl.h @@ -2709,7 +2709,7 @@ typedef void (WINE_GLAPI * PGLFNGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #endif /** - * Point sprites + * Point sprites */ /* GL_ARB_point_sprite */ #ifndef GL_ARB_point_sprite @@ -2718,11 +2718,11 @@ typedef void (WINE_GLAPI * PGLFNGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #define GL_COORD_REPLACE_ARB 0x8862 #endif /** - * @TODO: GL_NV_point_sprite + * @TODO: GL_NV_point_sprite */ /** - * Occlusion Queries + * Occlusion Queries */ /* GL_ARB_occlusion_query */ #ifndef GL_ARB_occlusion_query @@ -3018,8 +3018,8 @@ typedef void (WINE_GLAPI * PGLFNVERTEXATTRIBPOINTERPROC) (GLuint index, GLint si /**************************************************** - * OpenGL Official Version - * defines + * OpenGL Official Version + * defines ****************************************************/ /* GL_VERSION_1_3 */ #if !defined(GL_DOT3_RGBA) @@ -3187,7 +3187,7 @@ typedef enum _GL_SupportedExt { /**************************************************** - * #Defines + * #Defines ****************************************************/ #define GL_EXT_FUNCS_GEN \ /** ARB Extensions **/ \ @@ -3657,7 +3657,7 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, /**************************************************** - * Structures + * Structures ****************************************************/ typedef struct { @@ -3675,7 +3675,7 @@ typedef struct _WineD3D_GL_Info { DWORD gl_driver_version; CHAR gl_renderer[255]; /** - * CAPS Constants + * CAPS Constants */ UINT max_buffers; UINT max_lights; diff --git a/reactos/include/reactos/wine/wined3d_interface.h b/reactos/include/reactos/wine/wined3d_interface.h index 35430b97ef6..d58ca958548 100644 --- a/reactos/include/reactos/wine/wined3d_interface.h +++ b/reactos/include/reactos/wine/wined3d_interface.h @@ -36,7 +36,7 @@ struct IWineD3DSurface; #include "wined3d_types.h" /***************************************************************** - * THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES + * THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES * PLEASE USE wine/wined3d_gl.h INSTEAD */ @@ -109,14 +109,14 @@ struct IWineD3DClipper; /* {108F9C44-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3D, +DEFINE_GUID(IID_IWineD3D, 0x108f9c44, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); DEFINE_GUID(IID_IWineD3DBase, 0x46799311, 0x8e0e, 0x40ce, 0xb2, 0xec, 0xdd, 0xb9, 0x9f, 0x18, 0xfc, 0xb4); /* {108F9C44-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DDevice, +DEFINE_GUID(IID_IWineD3DDevice, 0x108f9c44, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {f756720c-32b9-4439-b5a3-1d6c97037d9e} */ @@ -124,49 +124,49 @@ DEFINE_GUID(IID_IWineD3DPalette, 0xf756720c, 0x32b9, 0x4439, 0xb5, 0xa3, 0x1d, 0x6c, 0x97, 0x03, 0x7d, 0x9e); /* {1F3BFB34-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DResource, +DEFINE_GUID(IID_IWineD3DResource, 0x1f3bfb34, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {217F671E-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DVertexBuffer, +DEFINE_GUID(IID_IWineD3DVertexBuffer, 0x217f671e, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {24769ED8-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DVolume, +DEFINE_GUID(IID_IWineD3DVolume, 0x24769ed8, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {34D01B10-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DSwapChain, +DEFINE_GUID(IID_IWineD3DSwapChain, 0x34d01b10, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {37CD5526-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DSurface, +DEFINE_GUID(IID_IWineD3DSurface, 0x37cd5526, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {3A02A54E-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DIndexBuffer, +DEFINE_GUID(IID_IWineD3DIndexBuffer, 0x3a02a54e, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {3C2AEBF6-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DBaseTexture, +DEFINE_GUID(IID_IWineD3DBaseTexture, 0x3c2aebf6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {3E72CC1C-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DTexture, +DEFINE_GUID(IID_IWineD3DTexture, 0x3e72cc1c, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {41752900-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DCubeTexture, +DEFINE_GUID(IID_IWineD3DCubeTexture, 0x41752900, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {7B39470C-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DVolumeTexture, +DEFINE_GUID(IID_IWineD3DVolumeTexture, 0x7b39470c, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {7CD55BE6-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DVertexDeclaration, +DEFINE_GUID(IID_IWineD3DVertexDeclaration, 0x7cd55be6, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {EAC93065-A4DF-446F-86A1-9EF2BCA40A3C} */ @@ -174,19 +174,19 @@ DEFINE_GUID(IID_IWineD3DBaseShader, 0xeac93065, 0xa4df, 0x446f, 0x86, 0xa1, 0x9e, 0xf2, 0xbc, 0xa4, 0x0a, 0x3c); /* {7F7A2B60-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DVertexShader, +DEFINE_GUID(IID_IWineD3DVertexShader, 0x7f7a2b60, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {818503DA-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DPixelShader, +DEFINE_GUID(IID_IWineD3DPixelShader, 0x818503da, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {83B073CE-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DStateBlock, +DEFINE_GUID(IID_IWineD3DStateBlock, 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {905DDBAC-6F30-11d9-C687-00046142C14F} */ -DEFINE_GUID(IID_IWineD3DQuery, +DEFINE_GUID(IID_IWineD3DQuery, 0x905ddbac, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); /* {8f2bceb1-d338-488c-ab7f-0ec980bf5d2d} */ @@ -201,9 +201,9 @@ typedef HRESULT WINAPI (*D3DCB_CREATERENDERTARGETFN) (IUnknown *pDevice, UINT Width, UINT Height, WINED3DFORMAT Format, - WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, - BOOL Lockable, + WINED3DMULTISAMPLE_TYPE MultiSample, + DWORD MultisampleQuality, + BOOL Lockable, struct IWineD3DSurface **ppSurface, HANDLE *pSharedHandle); @@ -213,7 +213,7 @@ typedef HRESULT WINAPI (*D3DCB_CREATESURFACEFN) (IUnknown *pDevice, UINT Height, WINED3DFORMAT Format, DWORD Usage, - WINED3DPOOL Pool, + WINED3DPOOL Pool, UINT Level, WINED3DCUBEMAP_FACES Face, struct IWineD3DSurface **ppSurface, @@ -224,9 +224,9 @@ typedef HRESULT WINAPI (*D3DCB_CREATEDEPTHSTENCILSURFACEFN) (IUnknown *pDevice, UINT Width, UINT Height, WINED3DFORMAT Format, - WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, - BOOL Discard, + WINED3DMULTISAMPLE_TYPE MultiSample, + DWORD MultisampleQuality, + BOOL Discard, struct IWineD3DSurface **ppSurface, HANDLE *pSharedHandle); @@ -236,7 +236,7 @@ typedef HRESULT WINAPI (*D3DCB_CREATEVOLUMEFN) (IUnknown *pDevice, UINT Width, UINT Height, UINT Depth, - WINED3DFORMAT Format, + WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage, struct IWineD3DVolume **ppVolume, @@ -282,7 +282,7 @@ DECLARE_INTERFACE_(IWineD3DBase, IUnknown) #endif /***************************************************************************** - * IWineD3D interface + * IWineD3D interface */ #define INTERFACE IWineD3D @@ -341,11 +341,11 @@ DECLARE_INTERFACE_(IWineD3D, IWineD3DBase) IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion, IUnknown *parent); /***************************************************************************** - * IWineD3DDevice interface + * IWineD3DDevice interface */ #define INTERFACE IWineD3DDevice -DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) -{ +DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) +{ /*** IUnknown methods ***/ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; @@ -356,7 +356,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,WINED3DPOOL Pool,struct IWineD3DVertexBuffer **ppVertexBuffer, HANDLE *sharedHandle, IUnknown *parent) PURE; STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DIndexBuffer** ppIndexBuffer, HANDLE* pSharedHandle, IUnknown *parent) PURE; STDMETHOD(CreateStateBlock)(THIS_ WINED3DSTATEBLOCKTYPE Type, struct IWineD3DStateBlock **ppStateBlock, IUnknown *parent) PURE; - STDMETHOD(CreateSurface)(THIS_ UINT Width, UINT Height, WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, struct IWineD3DSurface** ppSurface, WINED3DRESOURCETYPE Type, DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample ,DWORD MultisampleQuality, HANDLE* pSharedHandle, WINED3DSURFTYPE Impl, IUnknown *parent) PURE; + STDMETHOD(CreateSurface)(THIS_ UINT Width, UINT Height, WINED3DFORMAT Format, BOOL Lockable, BOOL Discard, UINT Level, struct IWineD3DSurface** ppSurface, WINED3DRESOURCETYPE Type, DWORD Usage, WINED3DPOOL Pool, WINED3DMULTISAMPLE_TYPE MultiSample ,DWORD MultisampleQuality, HANDLE* pSharedHandle, WINED3DSURFTYPE Impl, IUnknown *parent) PURE; STDMETHOD(CreateTexture)(THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DTexture** ppTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATESURFACEFN pFn) PURE; STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DVolumeTexture** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATEVOLUMEFN pFn) PURE; STDMETHOD(CreateVolume)(THIS_ UINT Width, UINT Height, UINT Depth, DWORD Usage, WINED3DFORMAT Format, WINED3DPOOL Pool, struct IWineD3DVolume** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent) PURE; @@ -624,7 +624,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) #endif /***************************************************************************** - * WineD3DResource interface + * WineD3DResource interface */ #define INTERFACE IWineD3DResource DECLARE_INTERFACE_(IWineD3DResource,IWineD3DBase) @@ -666,7 +666,7 @@ DECLARE_INTERFACE_(IWineD3DResource,IWineD3DBase) #endif /***************************************************************************** - * WineD3DVertexBuffer interface + * WineD3DVertexBuffer interface */ #define INTERFACE IWineD3DVertexBuffer DECLARE_INTERFACE_(IWineD3DVertexBuffer,IWineD3DResource) @@ -716,7 +716,7 @@ DECLARE_INTERFACE_(IWineD3DVertexBuffer,IWineD3DResource) #endif /***************************************************************************** - * WineD3DIndexBuffer interface + * WineD3DIndexBuffer interface */ #define INTERFACE IWineD3DIndexBuffer DECLARE_INTERFACE_(IWineD3DIndexBuffer,IWineD3DResource) @@ -1210,7 +1210,7 @@ DECLARE_INTERFACE_(IWineD3DVolume,IWineD3DResource) STDMETHOD_(ULONG,Release)(THIS) PURE; /*** IWineD3DBase methods ***/ STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE; - /*** IWineD3DResource methods ***/ + /*** IWineD3DResource methods ***/ STDMETHOD(GetDevice)(THIS_ IWineD3DDevice ** ppDevice) PURE; STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void * pData, DWORD SizeOfData, DWORD Flags) PURE; STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void * pData, DWORD * pSizeOfData) PURE; @@ -1218,8 +1218,8 @@ DECLARE_INTERFACE_(IWineD3DVolume,IWineD3DResource) STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD PriorityNew) PURE; STDMETHOD_(DWORD,GetPriority)(THIS) PURE; STDMETHOD_(void,PreLoad)(THIS) PURE; - STDMETHOD_(WINED3DRESOURCETYPE, GetType)(THIS) PURE; - /*** IWineD3DVolume methods ***/ + STDMETHOD_(WINED3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IWineD3DVolume methods ***/ STDMETHOD(GetContainer)(THIS_ REFIID riid, void ** ppContainer) PURE; STDMETHOD(GetDesc)(THIS_ WINED3DVOLUME_DESC * pDesc) PURE; STDMETHOD(LockBox)(THIS_ WINED3DLOCKED_BOX* pLockedVolume, CONST WINED3DBOX* pBox, DWORD Flags) PURE; @@ -1291,7 +1291,7 @@ DECLARE_INTERFACE_(IWineD3DVertexDeclaration,IWineD3DBase) #endif /***************************************************************************** - * IWineD3DStateBlock interface + * IWineD3DStateBlock interface */ #define INTERFACE IWineD3DStateBlock DECLARE_INTERFACE_(IWineD3DStateBlock,IWineD3DBase) @@ -1325,7 +1325,7 @@ DECLARE_INTERFACE_(IWineD3DStateBlock,IWineD3DBase) #endif /***************************************************************************** - * WineD3DQuery interface + * WineD3DQuery interface */ #define INTERFACE IWineD3DQuery DECLARE_INTERFACE_(IWineD3DQuery,IWineD3DBase) @@ -1342,7 +1342,7 @@ DECLARE_INTERFACE_(IWineD3DQuery,IWineD3DBase) STDMETHOD_(DWORD,GetDataSize)(THIS) PURE; STDMETHOD_(WINED3DQUERYTYPE, GetType)(THIS) PURE; STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE; - + }; #undef INTERFACE @@ -1441,7 +1441,7 @@ DECLARE_INTERFACE_(IWineD3DBaseShader,IWineD3DBase) #endif /***************************************************************************** - * IWineD3DVertexShader interface + * IWineD3DVertexShader interface */ #define INTERFACE IWineD3DVertexShader DECLARE_INTERFACE_(IWineD3DVertexShader,IWineD3DBaseShader) diff --git a/reactos/include/reactos/wine/wined3d_types.h b/reactos/include/reactos/wine/wined3d_types.h index b7dc333fa6b..6cf6fcfe1bd 100644 --- a/reactos/include/reactos/wine/wined3d_types.h +++ b/reactos/include/reactos/wine/wined3d_types.h @@ -219,7 +219,7 @@ typedef enum _WINED3DDEGREETYPE { WINED3DDEGREE_QUADRATIC = 2, WINED3DDEGREE_CUBIC = 3, WINED3DDEGREE_QUINTIC = 5, - + WINED3DDEGREE_FORCE_DWORD = 0x7fffffff } WINED3DDEGREETYPE; @@ -247,7 +247,7 @@ typedef enum _WINED3DFORMAT { WINED3DFMT_G16R16 = 34, WINED3DFMT_A2R10G10B10 = 35, WINED3DFMT_A16B16G16R16 = 36, - + WINED3DFMT_A8P8 = 40, WINED3DFMT_P8 = 41, @@ -294,12 +294,12 @@ typedef enum _WINED3DFORMAT { WINED3DFMT_R16F = 111, WINED3DFMT_G16R16F = 112, WINED3DFMT_A16B16G16R16F = 113, - + /* IEEE formats */ WINED3DFMT_R32F = 114, WINED3DFMT_G32R32F = 115, WINED3DFMT_A32B32G32R32F = 116, - + WINED3DFMT_CxV8U8 = 117, @@ -422,7 +422,7 @@ typedef enum _WINED3DRENDERSTATETYPE { WINED3DRS_AMBIENTMATERIALSOURCE = 147, WINED3DRS_EMISSIVEMATERIALSOURCE = 148, WINED3DRS_VERTEXBLEND = 151, - WINED3DRS_CLIPPLANEENABLE = 152, + WINED3DRS_CLIPPLANEENABLE = 152, WINED3DRS_SOFTWAREVERTEXPROCESSING = 153, /* d3d8 */ WINED3DRS_POINTSIZE = 154, WINED3DRS_POINTSIZE_MIN = 155, @@ -857,7 +857,7 @@ typedef struct _WINED3DADAPTER_IDENTIFIER { char *Driver; char *Description; char *DeviceName; - LARGE_INTEGER *DriverVersion; + LARGE_INTEGER *DriverVersion; DWORD *VendorId; DWORD *DeviceId; DWORD *SubSysId; @@ -1064,13 +1064,13 @@ typedef struct _WINED3DBOX { /*Vertex cache optimization hints.*/ typedef struct WINED3DDEVINFO_VCACHE { /*Must be a 4 char code FOURCC (e.g. CACH)*/ - DWORD Pattern; + DWORD Pattern; /*0 to get the longest strips, 1 vertex cache*/ - DWORD OptMethod; + DWORD OptMethod; /*Cache size to use (only valid if OptMethod==1) */ DWORD CacheSize; /*internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1)*/ - DWORD MagicNumber; + DWORD MagicNumber; } WINED3DDEVINFO_VCACHE; typedef struct _WINED3DVERTEXBUFFER_DESC { @@ -1196,7 +1196,7 @@ typedef struct _WINED3DCAPS { DWORD *VertexTextureFilterCaps; DWORD *MaxVShaderInstructionsExecuted; DWORD *MaxPShaderInstructionsExecuted; - DWORD *MaxVertexShader30InstructionSlots; + DWORD *MaxVertexShader30InstructionSlots; DWORD *MaxPixelShader30InstructionSlots; DWORD *Reserved2;/* Not in the microsoft headers but documented */ DWORD *Reserved3; @@ -1323,7 +1323,7 @@ typedef enum { #define WINED3DUSAGE_RTPATCHES 0x00000080L #define WINED3DUSAGE_NPATCHES 0x00000100L #define WINED3DUSAGE_DYNAMIC 0x00000200L -#define WINED3DUSAGE_AUTOGENMIPMAP 0x00000400L +#define WINED3DUSAGE_AUTOGENMIPMAP 0x00000400L #define WINED3DUSAGE_DMAP 0x00004000L #define WINED3DUSAGE_MASK 0x00004FFFL #define WINED3DUSAGE_OVERLAY 0x00010000L @@ -1378,7 +1378,7 @@ typedef enum _WINED3DSURFTYPE { #define WINED3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L #define WINED3DPRASTERCAPS_SCISSORTEST 0x01000000L #define WINED3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L -#define WINED3DPRASTERCAPS_DEPTHBIAS 0x04000000L +#define WINED3DPRASTERCAPS_DEPTHBIAS 0x04000000L #define WINED3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000L #define WINED3DPSHADECAPS_COLORFLATMONO 0x000001 diff --git a/reactos/include/reactos/wine/winsock16.h b/reactos/include/reactos/wine/winsock16.h index c803666a385..91efbb6cbab 100644 --- a/reactos/include/reactos/wine/winsock16.h +++ b/reactos/include/reactos/wine/winsock16.h @@ -1,110 +1,110 @@ -/* - * Copyright (C) the Wine project - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_WINE_WINSOCK16_H -#define __WINE_WINE_WINSOCK16_H - -#include -#include -#include -#include - -typedef UINT16 SOCKET16; - -typedef struct -{ - UINT16 fd_count; /* how many are SET? */ - SOCKET16 fd_array[WS_FD_SETSIZE]; /* an array of SOCKETs */ -} ws_fd_set16; - -/* ws_hostent16, ws_protoent16, ws_servent16, ws_netent16 - * are 1-byte aligned here ! */ -typedef struct ws_hostent16 -{ - SEGPTR h_name; /* official name of host */ - SEGPTR h_aliases; /* alias list */ - INT16 h_addrtype; /* host address type */ - INT16 h_length; /* length of address */ - SEGPTR h_addr_list; /* list of addresses from name server */ -} _ws_hostent16; - -typedef struct ws_protoent16 -{ - SEGPTR p_name; /* official protocol name */ - SEGPTR p_aliases; /* alias list */ - INT16 p_proto; /* protocol # */ -} _ws_protoent16; - -typedef struct ws_servent16 -{ - SEGPTR s_name; /* official service name */ - SEGPTR s_aliases; /* alias list */ - INT16 s_port; /* port # */ - SEGPTR s_proto; /* protocol to use */ -} _ws_servent16; - -typedef struct ws_netent16 -{ - SEGPTR n_name; /* official name of net */ - SEGPTR n_aliases; /* alias list */ - INT16 n_addrtype; /* net address type */ - INT n_net; /* network # */ -} _ws_netent16; - -typedef struct WSAData16 -{ - WORD wVersion; - WORD wHighVersion; - char szDescription[WSADESCRIPTION_LEN+1]; - char szSystemStatus[WSASYS_STATUS_LEN+1]; - WORD iMaxSockets; - WORD iMaxUdpDg; - SEGPTR lpVendorInfo; -} WSADATA16, *LPWSADATA16; - -#include - -#define WS_FD_CLR16(fd, set) __WS_FD_CLR((fd),(set), ws_fd_set16) -#define WS_FD_SET16(fd, set) __WS_FD_SET1((fd),(set), ws_fd_set16) -#define WS_FD_ZERO16(set) (((ws_fd_set16*)(set))->fd_count=0) -#define WS_FD_ISSET16(fd, set) __WSAFDIsSet16((SOCKET16)(fd), (ws_fd_set16*)(set)) - -#define INVALID_SOCKET16 ((SOCKET16)(~0)) - -INT16 WINAPI __WSAFDIsSet16( SOCKET16, ws_fd_set16 * ); -INT16 WINAPI WSAStartup16(UINT16 wVersionRequired, LPWSADATA16 lpWSAData); -void WINAPI WSASetLastError16(INT16 iError); -INT16 WINAPI WSAUnhookBlockingHook16(void); -FARPROC16 WINAPI WSASetBlockingHook16(FARPROC16 lpBlockFunc); -HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 wMsg, LPCSTR name, LPCSTR proto, - SEGPTR buf, INT16 buflen); -HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 wMsg, INT16 port, - LPCSTR proto, SEGPTR buf, INT16 buflen); -HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 wMsg, - LPCSTR name, SEGPTR buf, INT16 buflen); -HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd, UINT16 wMsg, - INT16 number, SEGPTR buf, INT16 buflen); -HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 wMsg, - LPCSTR name, SEGPTR buf, INT16 buflen); -HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 wMsg, LPCSTR addr, - INT16 len, INT16 type, SEGPTR buf, INT16 buflen); -INT16 WINAPI WSACancelAsyncRequest16(HANDLE16 hAsyncTaskHandle); -INT16 WINAPI WSAAsyncSelect16(SOCKET16 s, HWND16 hWnd, UINT16 wMsg, LONG lEvent); -INT16 WINAPI WSARecvEx16(SOCKET16 s, char *buf, INT16 len, INT16 *flags); - -#endif /* __WINE_WINE_WINSOCK16_H */ +/* + * Copyright (C) the Wine project + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_WINE_WINSOCK16_H +#define __WINE_WINE_WINSOCK16_H + +#include +#include +#include +#include + +typedef UINT16 SOCKET16; + +typedef struct +{ + UINT16 fd_count; /* how many are SET? */ + SOCKET16 fd_array[WS_FD_SETSIZE]; /* an array of SOCKETs */ +} ws_fd_set16; + +/* ws_hostent16, ws_protoent16, ws_servent16, ws_netent16 + * are 1-byte aligned here ! */ +typedef struct ws_hostent16 +{ + SEGPTR h_name; /* official name of host */ + SEGPTR h_aliases; /* alias list */ + INT16 h_addrtype; /* host address type */ + INT16 h_length; /* length of address */ + SEGPTR h_addr_list; /* list of addresses from name server */ +} _ws_hostent16; + +typedef struct ws_protoent16 +{ + SEGPTR p_name; /* official protocol name */ + SEGPTR p_aliases; /* alias list */ + INT16 p_proto; /* protocol # */ +} _ws_protoent16; + +typedef struct ws_servent16 +{ + SEGPTR s_name; /* official service name */ + SEGPTR s_aliases; /* alias list */ + INT16 s_port; /* port # */ + SEGPTR s_proto; /* protocol to use */ +} _ws_servent16; + +typedef struct ws_netent16 +{ + SEGPTR n_name; /* official name of net */ + SEGPTR n_aliases; /* alias list */ + INT16 n_addrtype; /* net address type */ + INT n_net; /* network # */ +} _ws_netent16; + +typedef struct WSAData16 +{ + WORD wVersion; + WORD wHighVersion; + char szDescription[WSADESCRIPTION_LEN+1]; + char szSystemStatus[WSASYS_STATUS_LEN+1]; + WORD iMaxSockets; + WORD iMaxUdpDg; + SEGPTR lpVendorInfo; +} WSADATA16, *LPWSADATA16; + +#include + +#define WS_FD_CLR16(fd, set) __WS_FD_CLR((fd),(set), ws_fd_set16) +#define WS_FD_SET16(fd, set) __WS_FD_SET1((fd),(set), ws_fd_set16) +#define WS_FD_ZERO16(set) (((ws_fd_set16*)(set))->fd_count=0) +#define WS_FD_ISSET16(fd, set) __WSAFDIsSet16((SOCKET16)(fd), (ws_fd_set16*)(set)) + +#define INVALID_SOCKET16 ((SOCKET16)(~0)) + +INT16 WINAPI __WSAFDIsSet16( SOCKET16, ws_fd_set16 * ); +INT16 WINAPI WSAStartup16(UINT16 wVersionRequired, LPWSADATA16 lpWSAData); +void WINAPI WSASetLastError16(INT16 iError); +INT16 WINAPI WSAUnhookBlockingHook16(void); +FARPROC16 WINAPI WSASetBlockingHook16(FARPROC16 lpBlockFunc); +HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 wMsg, LPCSTR name, LPCSTR proto, + SEGPTR buf, INT16 buflen); +HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 wMsg, INT16 port, + LPCSTR proto, SEGPTR buf, INT16 buflen); +HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 wMsg, + LPCSTR name, SEGPTR buf, INT16 buflen); +HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd, UINT16 wMsg, + INT16 number, SEGPTR buf, INT16 buflen); +HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 wMsg, + LPCSTR name, SEGPTR buf, INT16 buflen); +HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 wMsg, LPCSTR addr, + INT16 len, INT16 type, SEGPTR buf, INT16 buflen); +INT16 WINAPI WSACancelAsyncRequest16(HANDLE16 hAsyncTaskHandle); +INT16 WINAPI WSAAsyncSelect16(SOCKET16 s, HWND16 hWnd, UINT16 wMsg, LONG lEvent); +INT16 WINAPI WSARecvEx16(SOCKET16 s, char *buf, INT16 len, INT16 *flags); + +#endif /* __WINE_WINE_WINSOCK16_H */ diff --git a/reactos/lib/3rdparty/adns/acconfig.h b/reactos/lib/3rdparty/adns/acconfig.h index 96f0889d932..b8a0c739d8f 100644 --- a/reactos/lib/3rdparty/adns/acconfig.h +++ b/reactos/lib/3rdparty/adns/acconfig.h @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Define if inline functions a la GCC are available. */ diff --git a/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c b/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c index 1851abfdd24..e093ae78847 100644 --- a/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c +++ b/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c @@ -10,20 +10,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999 Tony Finch -* +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -31,21 +31,21 @@ int adns_writev(SOCKET FileDescriptor, const struct iovec * iov, int iovCount) { - int total_len = 0; + int total_len = 0; int i = 0, r = 0; char *buf = NULL, *p = NULL; - + for(; i < iovCount; i++) total_len += iov[i].iov_len; - + p = buf = (char *)alloca( (size_t) total_len); - + for(; i < iovCount; i++) { memcpy(p, iov[i].iov_base, (size_t) iov[i].iov_len); p += iov[i].iov_len; } - + ADNS_CLEAR_ERRNO r = send(FileDescriptor, buf, total_len, 0); ADNS_CAPTURE_ERRNO; @@ -69,23 +69,23 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) { static __int64 Adjustment; __int64 Now = 0; - - + + if (!Adjustment) { SYSTEMTIME st = {1970,1,3,0,0,0,0}; - + SystemTimeToFileTime(&st, ((LPFILETIME)(VOID *)&Adjustment)); } - + if (tz) { return -1; } - + GetSystemTimeAsFileTime(((LPFILETIME)(VOID *)&Now)); Now -= Adjustment; - + /* 100 ns .1 us 10 * 1000000 */ diff --git a/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h b/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h index 81e621c66b8..ca957296b38 100644 --- a/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h +++ b/reactos/lib/3rdparty/adns/adns_win32/adns_win32.h @@ -6,30 +6,30 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * + * * For the benefit of certain LGPL'd `omnibus' software which provides * a uniform interface to various things including adns, I make the * following additional licence. I do this because the GPL would * otherwise force either the omnibus software to be GPL'd or for the * adns-using part to be distributed separately. - * + * * So, you may also redistribute and/or modify adns.h (but only the * public header file adns.h and not any other part of adns) under the * terms of the GNU Library General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at * your option) any later version. - * + * * Note that adns itself is GPL'd. Authors of adns-using applications * with GPL-incompatible licences, and people who distribute adns with * applications where the whole distribution is not GPL'd, are still @@ -93,40 +93,40 @@ extern "C" #define adns_socket_read(sck, data, len) recv(sck, (char *)data, len, 0) #define adns_socket_write(sck, data, len) send(sck, (char *)data, len, 0) -/* Win32 does not set errno on Winsock errors(!) +/* Win32 does not set errno on Winsock errors(!) * We have to map the winsock errors to errno manually * in order to support the original UNIX error hadnlig */ #define ADNS_CAPTURE_ERRNO {errno = WSAGetLastError(); WSASetLastError(errno);} #define ADNS_CLEAR_ERRNO {WSASetLastError(errno = 0);} -#define ENOBUFS WSAENOBUFS +#define ENOBUFS WSAENOBUFS #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define EMSGSIZE WSAEMSGSIZE #define ENOPROTOOPT WSAENOPROTOOPT //#define NONRETURNING -//#define NONRETURNPRINTFFORMAT(si,tc) +//#define NONRETURNPRINTFFORMAT(si,tc) /* * UNIX system API for Win32 * The following is a quick and dirty implementation of - * some UNIX API calls in Win32. + * some UNIX API calls in Win32. * They are used in the dll, but if your project have * it's own implementation of these system calls, simply * undefine ADNS_MAP_UNIXAPI. */ -struct iovec +struct iovec { char *iov_base; - int iov_len; + int iov_len; }; struct timezone; /* XXX arty */ -/* - * Undef ADNS_MAP_UNIXAPI in the calling code to use natve calls +/* + * Undef ADNS_MAP_UNIXAPI in the calling code to use natve calls */ ADNS_API int adns_gettimeofday(struct timeval *tv, struct timezone *tz); ADNS_API int adns_writev (SOCKET FileDescriptor, const struct iovec * iov, int iovCount); @@ -151,7 +151,7 @@ ADNS_API int adns_getpid(void); #endif /* ---------------- END OF C HEADER -------------- */ -#ifdef __cplusplus +#ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/reactos/lib/3rdparty/adns/adns_win32/getopt.c b/reactos/lib/3rdparty/adns/adns_win32/getopt.c index 9408b7cec7b..4a83484e2dc 100644 --- a/reactos/lib/3rdparty/adns/adns_win32/getopt.c +++ b/reactos/lib/3rdparty/adns/adns_win32/getopt.c @@ -1,11 +1,11 @@ -/* jgaa oct 9th 2000: Found this on www. - * No copyright information given. +/* jgaa oct 9th 2000: Found this on www. + * No copyright information given. * Slightly modidied. * * Origin: http://www.winsite.com/info/pc/win3/winsock/sossntr4.zip/SOSSNT/SRC/GETOPT.C.html */ - + /* got this off net.sources */ #include @@ -32,16 +32,16 @@ int getopt(int argc, char * const *argv, const char *optstring) { static char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ - + if(!*place) { /* update scanning pointer */ - if(optind >= argc || *(place = argv[optind]) != '-' || !*++place) + if(optind >= argc || *(place = argv[optind]) != '-' || !*++place) return(EOF); if (*place == '-') { /* found "--" */ ++optind; return(EOF); } } /* option letter okay? */ - if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(optstring,optopt))) + if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(optstring,optopt))) { if(!*place) ++optind; tell(": illegal option -- "); diff --git a/reactos/lib/3rdparty/adns/client/adh-main.c b/reactos/lib/3rdparty/adns/client/adh-main.c index a0ac2a591dd..5eeb6af6ea7 100644 --- a/reactos/lib/3rdparty/adns/client/adh-main.c +++ b/reactos/lib/3rdparty/adns/client/adh-main.c @@ -10,20 +10,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -74,7 +74,7 @@ void *xmalloc(size_t sz) { char *xstrsave(const char *str) { char *p; - + p= xmalloc(strlen(str)+1); strcpy(p,str); return p; @@ -96,12 +96,12 @@ void of_type(const struct optioninfo *oi, const char *arg, const char *arg2) { { adns_r_mx, "mx" }, { adns_r_rp, "rp" }, { adns_r_addr, "addr" }, - + /* types with only one version */ { adns_r_cname, "cname" }, { adns_r_hinfo, "hinfo" }, { adns_r_txt, "txt" }, - + /* raw versions */ { adns_r_a, "a" }, { adns_r_ns_raw, "ns-" }, @@ -182,7 +182,7 @@ static void process_optarg(const char *arg, query_do(arg); } } - + static void read_stdin(void) { int anydone, r; char *newline, *space; @@ -230,8 +230,8 @@ int main(int argc, const char *const *argv) { fd_set readfds, writefds, exceptfds; const char *arg; - ensure_adns_init(); - + ensure_adns_init(); + while ((arg= *++argv)) process_optarg(arg,&argv,0); if (!ov_pipe && !ads) usageerr("no domains given, and -f/--pipe not used; try --help"); diff --git a/reactos/lib/3rdparty/adns/client/adh-opts.c b/reactos/lib/3rdparty/adns/client/adh-opts.c index 091baf796bf..c19ae31ef4d 100644 --- a/reactos/lib/3rdparty/adns/client/adh-opts.c +++ b/reactos/lib/3rdparty/adns/client/adh-opts.c @@ -10,20 +10,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -48,7 +48,7 @@ static const struct optioninfo global_options[]= { "f", "pipe", &ov_pipe, 1 }, { ot_flag, "Allow answers to be reordered", "a", "asynch", &ov_asynch, 1 }, - + { ot_desconly, "answer/error output format and destination (see below):" }, { ot_value, "Answers to stdout, errors as messages to stderr (default)", "Fs", "fmt-simple", &ov_format, fmt_simple }, @@ -56,7 +56,7 @@ static const struct optioninfo global_options[]= { "Fi", "fmt-inline", &ov_format, fmt_inline }, { ot_value, "Fully-parseable output format (default for --asynch)", "Fa", "fmt-asynch", &ov_format, fmt_asynch }, - + { ot_desconly, "global verbosity level:" }, { ot_value, "Do not print anything to stderr", "Vq", "quiet", &ov_verbose, adns_if_noerrprint }, @@ -64,7 +64,7 @@ static const struct optioninfo global_options[]= { "Vn", "no-quiet", &ov_verbose, 0 }, { ot_value, "Debugging mode", "Vd", "debug", &ov_verbose, adns_if_debug }, - + { ot_desconly, "other global options:" }, { ot_funcarg, "Configuration to use instead of /etc/resolv.conf", 0, "config", 0,0, of_config, "" }, @@ -102,7 +102,7 @@ static const struct optioninfo perquery_options[]= { "Dt", "show-type", &ov_pqfr.show_type, 0 }, { ot_flag, "Do not display CNAME target in output", "Dc", "show-cname", &ov_pqfr.show_cname, 0 }, - + { ot_desconly, "per-query TTL mode (NB TTL is minimum across all info in reply):" }, { ot_value, "Show the TTL as a TTL", "Tt", "ttl-ttl", &ov_pqfr.ttl, tm_rel }, @@ -110,7 +110,7 @@ static const struct optioninfo perquery_options[]= { "Ta", "ttl-abs", &ov_pqfr.ttl, tm_abs }, { ot_value, "Do not show the TTL (default)", "Tn", "no-ttl", &ov_pqfr.ttl, tm_none }, - + { ot_desconly, "per-query CNAME handling mode:" }, { ot_value, "Call it an error if a CNAME is found", "Cf", "cname-reject", &ov_cname, adns_qf_cname_forbid }, @@ -118,7 +118,7 @@ static const struct optioninfo perquery_options[]= { "Cl", "cname-loose", &ov_cname, adns_qf_cname_loose }, { ot_value, "CNAME ok for query domain, but not in RRs (default)", "Cs", "cname-ok", &ov_cname, 0 }, - + { ot_desconly, "asynchronous/pipe mode options:" }, { ot_funcarg, "Set , default is decimal sequence starting 0", 0, "asynch-id", 0,0, &of_asynch_id, "id" }, @@ -137,7 +137,7 @@ static void printusage(void) { int maxsopt, maxlopt, l; maxsopt= maxlopt= 0; - + for (oiap=all_optiontables; *oiap; oiap++) { for (oip=*oiap; oip->type != ot_end; oip++) { if (oip->type == ot_funcarg) continue; @@ -149,7 +149,7 @@ static void printusage(void) { } } } - + fputs("usage: adnshost [global-opts] [query-opts] query-domain\n" " [[query-opts] query-domain ...]\n" " adnshost [global-opts] [query-opts] -f|--pipe\n", @@ -223,7 +223,7 @@ static void printusage(void) { printf("\nEscaping domains which might start with `-':\n" " - %-*s Next argument is a domain, but more options may follow\n", maxlopt+maxsopt+3, ""); - + fputs("\n" "Query domains should always be quoted according to master file format.\n" "\n" diff --git a/reactos/lib/3rdparty/adns/client/adh-query.c b/reactos/lib/3rdparty/adns/client/adh-query.c index 61a4f6ebee4..e7ebde68492 100644 --- a/reactos/lib/3rdparty/adns/client/adh-query.c +++ b/reactos/lib/3rdparty/adns/client/adh-query.c @@ -10,20 +10,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -40,7 +40,7 @@ static unsigned long idcounter; void ensure_adns_init(void) { adns_initflags initflags; int r; - + if (ads) return; #ifdef SIGPIPE @@ -64,10 +64,10 @@ void ensure_adns_init(void) { static void prep_query(struct query_node **qun_r, int *quflags_r) { struct query_node *qun; char idbuf[20]; - + if (ov_pipe && !ads) usageerr("-f/--pipe not consistent with domains on command line"); ensure_adns_init(); - + qun= malloc(sizeof(*qun)); qun->pqfr= ov_pqfr; if (ov_id) { @@ -86,10 +86,10 @@ static void prep_query(struct query_node **qun_r, int *quflags_r) { (ov_qc_anshost ? adns_qf_quoteok_anshost : 0) | (ov_qc_cname ? 0 : adns_qf_quoteok_cname) | ov_cname, - + *qun_r= qun; } - + void of_ptr(const struct optioninfo *oi, const char *arg, const char *arg2) { struct query_node *qun; int quflags, r; @@ -165,7 +165,7 @@ static void print_withspace(const char *str) { static void print_ttl(struct query_node *qun, adns_answer *answer) { unsigned long ttl; time_t now; - + switch (qun->pqfr.ttl) { case tm_none: return; @@ -228,7 +228,7 @@ static void print_dnsfail(adns_status st, struct query_node *qun, adns_answer *a int r; const char *typename, *statusstring; adns_status ist; - + if (ov_format == fmt_inline) { if (fputs("; failed ",stdout) == EOF) outerr(); print_status(st,qun,answer); @@ -249,7 +249,7 @@ static void print_dnsfail(adns_status st, struct query_node *qun, adns_answer *a } if (r == EOF) sysfail("write error message to stderr",errno); } - + void query_done(struct query_node *qun, adns_answer *answer) { adns_status st, ist; int rrn, nrrs; diff --git a/reactos/lib/3rdparty/adns/client/adnshost.h b/reactos/lib/3rdparty/adns/client/adnshost.h index b5021e53d90..5adf9f30662 100644 --- a/reactos/lib/3rdparty/adns/client/adnshost.h +++ b/reactos/lib/3rdparty/adns/client/adnshost.h @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ADNSHOST_H_INCLUDED diff --git a/reactos/lib/3rdparty/adns/client/adnslogres.c b/reactos/lib/3rdparty/adns/client/adnslogres.c index 0a96fc16014..eeb9d4da01c 100644 --- a/reactos/lib/3rdparty/adns/client/adnslogres.c +++ b/reactos/lib/3rdparty/adns/client/adnslogres.c @@ -10,17 +10,17 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -170,7 +170,7 @@ static logline *readline(FILE *inf, adns_state adns, int opts) { aargh("fgets"); return NULL; } - + static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) { int eof, err, len; adns_state adns; diff --git a/reactos/lib/3rdparty/adns/client/adnsresfilter.c b/reactos/lib/3rdparty/adns/client/adnsresfilter.c index 1e1a1b35214..4f329671859 100644 --- a/reactos/lib/3rdparty/adns/client/adnsresfilter.c +++ b/reactos/lib/3rdparty/adns/client/adnsresfilter.c @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include @@ -86,7 +86,7 @@ static void *treeroot; static int nonblock(int fd, int isnonblock) { int r; - r= fcntl(fd,F_GETFL); + r= fcntl(fd,F_GETFL); if (r==-1) return -1; r= fcntl(fd,F_SETFL, isnonblock ? r|O_NONBLOCK : r&~O_NONBLOCK); if (r==-1) return -1; @@ -215,10 +215,10 @@ static void parseargs(const char *const *argv) { static void queueoutchar(int c) { struct outqueuenode *entry; - + entry= outqueue.tail; if (!entry || entry->addr || entry->textlen >= peroutqueuenode) { - peroutqueuenode= !peroutqueuenode || !entry || entry->addr ? 128 : + peroutqueuenode= !peroutqueuenode || !entry || entry->addr ? 128 : peroutqueuenode >= 1024 ? 4096 : peroutqueuenode<<2; entry= xmalloc(sizeof(*entry)); entry->buffer= xmalloc(peroutqueuenode); @@ -310,7 +310,7 @@ static void procaddr(void) { void **searchfound; struct outqueuenode *entry; int r; - + if (!newthing) { newthing= xmalloc(sizeof(struct treething)); newthing->qu= 0; @@ -427,7 +427,7 @@ int main(int argc, const char *const *argv) { continue; } if (entry->addr->ans) { - if (entry->addr->ans->nrrs) + if (entry->addr->ans->nrrs) replacetextwithname(entry); entry->addr= 0; continue; @@ -450,7 +450,7 @@ int main(int argc, const char *const *argv) { } if (outblocked) FD_SET(1,&writefds); if (!inputeof && outqueuelen<1024) FD_SET(0,&readfds); - + ADNS_CLEAR_ERRNO; r= select(maxfd,&readfds,&writefds,&exceptfds,tv); ADNS_CAPTURE_ERRNO; diff --git a/reactos/lib/3rdparty/adns/client/adnstest.c b/reactos/lib/3rdparty/adns/client/adnstest.c index e43471f951d..ac04e5af70b 100644 --- a/reactos/lib/3rdparty/adns/client/adnstest.c +++ b/reactos/lib/3rdparty/adns/client/adnstest.c @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -49,7 +49,7 @@ struct myctx { int doneyet, found; const char *fdom; }; - + static struct myctx *mcs; static adns_state ads; static adns_rrtype *types_a; @@ -59,7 +59,7 @@ static void quitnow(int rc) { free(mcs); free(types_a); if (ads) adns_finish(ads); - + exit(rc); } @@ -116,12 +116,12 @@ static const adns_rrtype defaulttypes[]= { adns_r_mx_raw, adns_r_txt, adns_r_rp_raw, - + adns_r_addr, adns_r_ns, adns_r_ptr, adns_r_mx, - + adns_r_soa, adns_r_rp, @@ -195,7 +195,7 @@ int main(int argc, char *const *argv) { } else { usageerr("bad [,]"); } - + if (argv[0] && argv[1] && argv[1][0] == ':') { for (cp= argv[1]+1, tc=1; (ch= *cp); cp++) if (ch==',') tc++; @@ -215,7 +215,7 @@ int main(int argc, char *const *argv) { types_a= 0; types= defaulttypes; } - + if (!(argv[0] && argv[1])) usageerr("no query domains supplied"); fdomlist= (const char *const*)argv+1; @@ -225,7 +225,7 @@ int main(int argc, char *const *argv) { if (!mcs) { perror("malloc mcs"); quitnow(3); } setvbuf(stdout,0,_IOLBF,0); - + if (initstring) { r= adns_init_strcfg(&ads, (adns_if_debug|adns_if_noautosys|adns_if_checkc_freq) @@ -300,22 +300,22 @@ int main(int argc, char *const *argv) { #ifdef HAVE_POLL if (strchr(owninitflags,'p')) { r= adns_wait_poll(ads,&qu,&ans,&mcr); - } else + } else #endif { r= adns_wait(ads,&qu,&ans,&mcr); } if (r) failure_errno("wait/check",r); - + if (mc) assert(mcr==mc); else mc= mcr; assert(qu==mc->qu); assert(!mc->doneyet); - + fdom_split(mc->fdom,&domain,&qflags,ownflags,sizeof(ownflags)); if (gettimeofday(&now,0)) { perror("gettimeofday"); quitnow(3); } - + ri= adns_rr_info(ans->type, &rrtn,&fmtn,&len, 0,0); fprintf(stdout, "%s flags %d type ",domain,qflags); dumptype(ri,rrtn,fmtn); diff --git a/reactos/lib/3rdparty/adns/client/client.h b/reactos/lib/3rdparty/adns/client/client.h index 2e74b125cfb..4a5bbcf50d6 100644 --- a/reactos/lib/3rdparty/adns/client/client.h +++ b/reactos/lib/3rdparty/adns/client/client.h @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef CLIENT_H_INCLUDED diff --git a/reactos/lib/3rdparty/adns/client/fanftest.c b/reactos/lib/3rdparty/adns/client/fanftest.c index 61249f144c9..63127f5c864 100644 --- a/reactos/lib/3rdparty/adns/client/fanftest.c +++ b/reactos/lib/3rdparty/adns/client/fanftest.c @@ -10,17 +10,17 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/reactos/lib/3rdparty/adns/src/adns.h b/reactos/lib/3rdparty/adns/src/adns.h index ca3eefc42d6..09bc4df0ce6 100644 --- a/reactos/lib/3rdparty/adns/src/adns.h +++ b/reactos/lib/3rdparty/adns/src/adns.h @@ -10,30 +10,30 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * + * * For the benefit of certain LGPL'd `omnibus' software which * provides a uniform interface to various things including adns, I * make the following additional licence. I do this because the GPL * would otherwise force either the omnibus software to be GPL'd or * the adns-using part to be distributed separately. - * + * * So: you may also redistribute and/or modify adns.h (but only the * public header file adns.h and not any other part of adns) under the * terms of the GNU Library General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at * your option) any later version. - * + * * Note that adns itself is GPL'd. Authors of adns-using applications * with GPL-incompatible licences, and people who distribute adns with * applications where the whole distribution is not GPL'd, are still @@ -116,34 +116,34 @@ typedef enum { adns__rrt_typemask= 0x0ffff, adns__qtf_deref= 0x10000, /* dereference domains and perhaps produce extra data */ adns__qtf_mail822= 0x20000, /* make mailboxes be in RFC822 rcpt field format */ - + adns_r_none= 0, - + adns_r_a= 1, - + adns_r_ns_raw= 2, adns_r_ns= adns_r_ns_raw|adns__qtf_deref, - + adns_r_cname= 5, - + adns_r_soa_raw= 6, - adns_r_soa= adns_r_soa_raw|adns__qtf_mail822, - + adns_r_soa= adns_r_soa_raw|adns__qtf_mail822, + adns_r_ptr_raw= 12, adns_r_ptr= adns_r_ptr_raw|adns__qtf_deref, - - adns_r_hinfo= 13, - + + adns_r_hinfo= 13, + adns_r_mx_raw= 15, adns_r_mx= adns_r_mx_raw|adns__qtf_deref, - + adns_r_txt= 16, - + adns_r_rp_raw= 17, adns_r_rp= adns_r_rp_raw|adns__qtf_mail822, adns_r_addr= adns_r_a|adns__qtf_deref - + } adns_rrtype; /* @@ -151,7 +151,7 @@ typedef enum { * legal syntax, or you get adns_s_querydomainvalid (if the query * domain contains bad characters) or adns_s_answerdomaininvalid (if * the answer contains bad characters). - * + * * In queries _with_ qf_quoteok_*, domains in the query or response * may contain any characters, quoted according to RFC1035 5.1. On * input to adns, the char* is a pointer to the interior of a " @@ -223,7 +223,7 @@ typedef enum { adns_s_systemfail, adns_s_max_localfail= 29, - + /* remotely induced errors, detected locally */ adns_s_timeout, adns_s_allservfail, @@ -232,7 +232,7 @@ typedef enum { adns_s_unknownformat, adns_s_max_remotefail= 59, - + /* remotely induced errors, reported by remote server to us */ adns_s_rcodeservfail, adns_s_rcodeformaterror, @@ -248,14 +248,14 @@ typedef enum { adns_s_answerdomaininvalid, adns_s_answerdomaintoolong, adns_s_invaliddata, - + adns_s_max_misconfig= 199, /* permanent problems with the query */ adns_s_querydomainwrong, adns_s_querydomaininvalid, adns_s_querydomaintoolong, - + adns_s_max_misquery= 299, /* permanent errors */ @@ -263,7 +263,7 @@ typedef enum { adns_s_nodata, adns_s_max_permfail= 499 - + } adns_status; typedef struct { @@ -349,7 +349,7 @@ typedef struct { * For _init, _init_strcfg, _submit and _synchronous, system errors * (eg, failure to create sockets, malloc failure, etc.) return errno * values. - * + * * For _wait and _check failures are reported in the answer * structure, and only 0, ESRCH or (for _check) EAGAIN is * returned: if no (appropriate) requests are done adns_check returns @@ -383,7 +383,7 @@ ADNS_API int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags, * is set later overrides any that is set earlier. * * Standard directives understood in resolv[-adns].conf: - * + * * nameserver
* Must be followed by the IP address of a nameserver. Several * nameservers may be specified, and they will be tried in the order @@ -447,7 +447,7 @@ ADNS_API int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags, * Changes the consistency checking frequency; this overrides the * setting of adns_if_check_entex, adns_if_check_freq, or neither, * in the flags passed to adns_init. - * + * * There are a number of environment variables which can modify the * behaviour of adns. They take effect only if adns_init is used, and * the caller of adns_init can disable them using adns_if_noenv. In @@ -643,7 +643,7 @@ ADNS_API void adns_firsttimeout(adns_state ads, struct timeval now); /* Asks adns when it would first like the opportunity to time * something out. now must be the current time, from gettimeofday. - * + * * If tv_mod points to 0 then tv_buf must be non-null, and * _firsttimeout will fill in *tv_buf with the time until the first * timeout, and make *tv_mod point to tv_buf. If adns doesn't have @@ -731,7 +731,7 @@ ADNS_API int adns_beforepoll(adns_state ads, struct pollfd *fds, int *nfds_io, i /* Finds out which fd's adns is interested in, and when it would like * to be able to time things out. This is in a form suitable for use * with poll(2). - * + * * On entry, usually fds should point to at least *nfds_io structs. * adns will fill up to that many structs will information for poll, * and record in *nfds_io how many structs it filled. If it wants to diff --git a/reactos/lib/3rdparty/adns/src/check.c b/reactos/lib/3rdparty/adns/src/check.c index 74703cab103..36586fe54ce 100644 --- a/reactos/lib/3rdparty/adns/src/check.c +++ b/reactos/lib/3rdparty/adns/src/check.c @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "internal.h" @@ -101,14 +101,14 @@ static void checkc_notcpbuf(adns_state ads) { static void checkc_global(adns_state ads) { int i; - + assert(ads->udpsocket != INVALID_SOCKET); for (i=0; insortlist; i++) assert(!(ads->sortlist[i].base.s_addr & ~ads->sortlist[i].mask.s_addr)); assert(ads->tcpserver >= 0 && ads->tcpserver < ads->nservers); - + switch (ads->tcpstate) { case server_connecting: assert(ads->tcpsocket != INVALID_SOCKET); @@ -132,7 +132,7 @@ static void checkc_global(adns_state ads) { static void checkc_queue_udpw(adns_state ads) { adns_query qu; - + DLIST_CHECK1(ads->udpw, qu, { assert(qu->state==query_tosend); assert(qu->retries <= UDPMAXRETRIES); @@ -145,7 +145,7 @@ static void checkc_queue_udpw(adns_state ads) { static void checkc_queue_tcpw(adns_state ads) { adns_query qu; - + DLIST_CHECK1(ads->tcpw, qu, { assert(qu->state==query_tcpw); assert(!qu->children.head && !qu->children.tail); @@ -172,7 +172,7 @@ static void checkc_queue_childw(adns_state ads) { static void checkc_queue_output(adns_state ads) { adns_query qu; - + DLIST_CHECK1(ads->output, qu, { assert(qu->state == query_done); assert(!qu->children.head && !qu->children.tail); @@ -184,7 +184,7 @@ static void checkc_queue_output(adns_state ads) { void adns__consistency(adns_state ads, adns_query qu, consistency_checks cc) { adns_query search; - + switch (cc) { case cc_user: break; diff --git a/reactos/lib/3rdparty/adns/src/dlist.h b/reactos/lib/3rdparty/adns/src/dlist.h index 44bf55608e2..e0dc034df64 100644 --- a/reactos/lib/3rdparty/adns/src/dlist.h +++ b/reactos/lib/3rdparty/adns/src/dlist.h @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ADNS_DLIST_H_INCLUDED diff --git a/reactos/lib/3rdparty/adns/src/event.c b/reactos/lib/3rdparty/adns/src/event.c index cd34ff9ceab..b7395299a2f 100644 --- a/reactos/lib/3rdparty/adns/src/event.c +++ b/reactos/lib/3rdparty/adns/src/event.c @@ -11,20 +11,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, adns_socket_write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include @@ -49,7 +49,7 @@ static void tcp_close(adns_state ads) { int serv; - + serv= ads->tcpserver; adns_socket_close(ads->tcpsocket); ads->tcpsocket= INVALID_SOCKET; @@ -59,7 +59,7 @@ static void tcp_close(adns_state ads) { void adns__tcp_broken(adns_state ads, const char *what, const char *why) { int serv; adns_query qu; - + assert(ads->tcpstate == server_connecting || ads->tcpstate == server_ok); serv= ads->tcpserver; if (what) adns__warn(ads,serv,0,"TCP connection failed: %s: %s",what,why); @@ -77,7 +77,7 @@ void adns__tcp_broken(adns_state ads, const char *what, const char *why) { static void tcp_connected(adns_state ads, struct timeval now) { adns_query qu, nqu; - + adns__debug(ads,ads->tcpserver,0,"TCP connected"); ads->tcpstate= server_ok; for (qu= ads->tcpw.head; qu && ads->tcpstate == server_ok; qu= nqu) { @@ -104,7 +104,7 @@ void adns__tcp_tryconnect(adns_state ads, struct timeval now) { default: abort(); } - + assert(!ads->tcpsend.used); assert(!ads->tcprecv.used); assert(!ads->tcprecv_skip); @@ -167,7 +167,7 @@ static void inter_immed(struct timeval **tv_io, struct timeval *tvbuf) { timerclear(rbuf); } - + static void inter_maxto(struct timeval **tv_io, struct timeval *tvbuf, struct timeval maxto) { struct timeval *rbuf; @@ -204,7 +204,7 @@ static void timeouts_queue(adns_state ads, int act, struct timeval **tv_io, struct timeval *tvbuf, struct timeval now, struct query_queue *queue) { adns_query qu, nqu; - + for (qu= queue->head; qu; qu= nqu) { nqu= qu->next; if (!timercmp(&now,&qu->timeout,>)) { @@ -226,7 +226,7 @@ static void tcp_events(adns_state ads, int act, struct timeval **tv_io, struct timeval *tvbuf, struct timeval now) { adns_query qu, nqu; - + for (;;) { switch (ads->tcpstate) { case server_broken: @@ -337,7 +337,7 @@ int adns_processreadable(adns_state ads, ADNS_SOCKET fd, const struct timeval *n int want, dgramlen, r, udpaddrlen, serv, old_skip; byte udpbuf[DNS_MAXUDP]; struct sockaddr_in udpaddr; - + adns__consistency(ads,0,cc_entex); switch (ads->tcpstate) { @@ -440,7 +440,7 @@ xit: int adns_processwriteable(adns_state ads, ADNS_SOCKET fd, const struct timeval *now) { int r; - + adns__consistency(ads,0,cc_entex); switch (ads->tcpstate) { @@ -498,7 +498,7 @@ xit: adns__consistency(ads,0,cc_entex); return r; } - + int adns_processexceptional(adns_state ads, ADNS_SOCKET fd, const struct timeval *now) { adns__consistency(ads,0,cc_entex); switch (ads->tcpstate) { @@ -523,7 +523,7 @@ static void fd_event(adns_state ads, ADNS_SOCKET fd, int (*func)(adns_state, ADNS_SOCKET fd, const struct timeval *now), struct timeval now, int *r_r) { int r; - + if (!(revent & pollflag)) return; if (fds && !((int)fdtv_sec || (*tv_mod)->tv_usec)) { @@ -619,7 +619,7 @@ void adns_globalsystemfailure(adns_state ads) { while (ads->udpw.head) adns__query_fail(ads->udpw.head, adns_s_systemfail); while (ads->tcpw.head) adns__query_fail(ads->tcpw.head, adns_s_systemfail); - + switch (ads->tcpstate) { case server_connecting: case server_ok: @@ -698,7 +698,7 @@ int adns_wait(adns_state ads, int r, maxfd, rsel; fd_set readfds, writefds, exceptfds; struct timeval tvbuf, *tvp; - + adns__consistency(ads,*query_io,cc_entex); for (;;) { r= adns__internal_check(ads,query_io,answer_r,context_r); @@ -732,7 +732,7 @@ int adns_check(adns_state ads, void **context_r) { struct timeval now; int r; - + adns__consistency(ads,*query_io,cc_entex); r= gettimeofday(&now,0); if (!r) adns__autosys(ads,now); diff --git a/reactos/lib/3rdparty/adns/src/general.c b/reactos/lib/3rdparty/adns/src/general.c index 1b61686d79f..10f70d7a372 100644 --- a/reactos/lib/3rdparty/adns/src/general.c +++ b/reactos/lib/3rdparty/adns/src/general.c @@ -10,20 +10,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include @@ -46,7 +46,7 @@ void adns__vdiag(adns_state ads, const char *pfx, adns_initflags prevent, int serv, adns_query qu, const char *fmt, va_list al) { const char *bef, *aft; vbuf vb; - + if (!ads->diagfile || (!(ads->iflags & adns_if_debug) && (!prevent || (ads->iflags & prevent)))) return; @@ -74,7 +74,7 @@ void adns__vdiag(adns_state ads, const char *pfx, adns_initflags prevent, bef=", "; aft=")\n"; adns__vbuf_free(&vb); } - + if (serv>=0) { fprintf(ads->diagfile,"%sNS=%s",bef,inet_ntoa(ads->servers[serv].addr)); bef=", "; aft=")\n"; @@ -115,14 +115,14 @@ void adns__vbuf_init(vbuf *vb) { int adns__vbuf_ensure(vbuf *vb, int want) { void *nb; - + if (vb->avail >= want) return 1; nb= realloc(vb->buf, (size_t) want); if (!nb) return 0; vb->buf= nb; vb->avail= want; return 1; } - + void adns__vbuf_appendq(vbuf *vb, const byte *data, int len) { memcpy(vb->buf+vb->used,data, (size_t) len); vb->used+= len; @@ -199,7 +199,7 @@ adns_status adns_rr_info(adns_rrtype type, if (len_r) *len_r= typei->rrsz; if (!datap) return adns_s_ok; - + adns__vbuf_init(&vb); st= typei->convstring(&vb,datap); if (st) goto x_freevb; @@ -239,7 +239,7 @@ static const struct sinfo { SINFO( rcodenotimplemented, "Query not implemented by nameserver" ), SINFO( rcoderefused, "Query refused by nameserver" ), SINFO( rcodeunknown, "Nameserver sent unknown response code" ), - + SINFO( inconsistent, "Inconsistent resource records in DNS" ), SINFO( prohibitedcname, "DNS alias found where canonical name wanted" ), SINFO( answerdomaininvalid, "Found syntactically invalid domain name" ), @@ -304,7 +304,7 @@ static int __cdecl sti_compar(const void *key, const void *elem) { here= *st; min= (sti==stinfos) ? 0 : sti[-1].stmax+1; max= sti->stmax; - + return here < min ? -1 : here > max ? 1 : 0; } @@ -351,7 +351,7 @@ void adns__sigpipe_protect(adns_state ads) { sa.sa_handler= SIG_IGN; sigfillset(&sa.sa_mask); sa.sa_flags= 0; - + r= sigprocmask(SIG_SETMASK,&toblock,&ads->stdsigmask); assert(!r); r= sigaction(SIGPIPE,&sa,&ads->stdsigpipe); assert(!r); #endif diff --git a/reactos/lib/3rdparty/adns/src/parse.c b/reactos/lib/3rdparty/adns/src/parse.c index 3d54638753b..c9c1dee22c3 100644 --- a/reactos/lib/3rdparty/adns/src/parse.c +++ b/reactos/lib/3rdparty/adns/src/parse.c @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -34,7 +34,7 @@ int vbuf__append_quoted1035(vbuf *vb, const byte *buf, int len) { char qbuf[10]; int i, ch; - + while (len) { qbuf[0]= 0; for (i=0; iads,fls->serv,fls->qu,"label in domain runs beyond end of domain"); return adns_s_invalidresponse; } @@ -118,7 +118,7 @@ adns_status adns__parse_domain(adns_state ads, int serv, adns_query qu, vbuf *vb, parsedomain_flags flags, const byte *dgram, int dglen, int *cbyte_io, int max) { findlabel_state fls; - + adns__findlabel_start(&fls,ads, serv,qu, dgram,dglen,max, *cbyte_io,cbyte_io); vb->used= 0; return adns__parse_domain_more(&fls,ads,qu, vb,flags,dgram); @@ -159,7 +159,7 @@ adns_status adns__parse_domain_more(findlabel_state *fls, adns_state ads, if (!adns__vbuf_append(vb,(byte*)"",1)) return adns_s_nomemory; return adns_s_ok; } - + adns_status adns__findrr_anychk(adns_query qu, int serv, const byte *dgram, int dglen, int *cbyte_io, int *type_r, int *class_r, unsigned long *ttl_r, @@ -168,7 +168,7 @@ adns_status adns__findrr_anychk(adns_query qu, int serv, int *eo_matched_r) { findlabel_state fls, eo_fls; int cbyte; - + int tmp, rdlen, mismatch; unsigned long ttl; int lablen, labstart, ch; @@ -184,7 +184,7 @@ adns_status adns__findrr_anychk(adns_query qu, int serv, } else { mismatch= 1; } - + for (;;) { st= adns__findlabel_next(&fls,&lablen,&labstart); if (st) return st; @@ -203,7 +203,7 @@ adns_status adns__findrr_anychk(adns_query qu, int serv, if (!lablen) break; } if (eo_matched_r) *eo_matched_r= !mismatch; - + if (cbyte+10>dglen) goto x_truncated; GET_W(cbyte,tmp); *type_r= tmp; GET_W(cbyte,tmp); *class_r= tmp; @@ -211,7 +211,7 @@ adns_status adns__findrr_anychk(adns_query qu, int serv, GET_L(cbyte,ttl); if (ttl > MAXTTLBELIEVE) ttl= MAXTTLBELIEVE; *ttl_r= ttl; - + GET_W(cbyte,rdlen); if (rdlen_r) *rdlen_r= rdlen; if (rdstart_r) *rdstart_r= cbyte; cbyte+= rdlen; diff --git a/reactos/lib/3rdparty/adns/src/poll.c b/reactos/lib/3rdparty/adns/src/poll.c index 63de4313942..6d1fe4a79f1 100644 --- a/reactos/lib/3rdparty/adns/src/poll.c +++ b/reactos/lib/3rdparty/adns/src/poll.c @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include @@ -65,7 +65,7 @@ int adns_beforepoll(adns_state ads, struct pollfd *fds, int *nfds_io, int *timeo } *timeout_io= timeout_ms; } - + space= *nfds_io; if (space >= MAX_POLLFDS) { found= adns__pollfds(ads,fds); @@ -101,7 +101,7 @@ int adns_wait_poll(adns_state ads, void **context_r) { int r, nfds, to; struct pollfd fds[MAX_POLLFDS]; - + adns__consistency(ads,0,cc_entex); for (;;) { diff --git a/reactos/lib/3rdparty/adns/src/query.c b/reactos/lib/3rdparty/adns/src/query.c index 005fe4697f1..cf01f440102 100644 --- a/reactos/lib/3rdparty/adns/src/query.c +++ b/reactos/lib/3rdparty/adns/src/query.c @@ -11,20 +11,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -42,10 +42,10 @@ static adns_query query_alloc(adns_state ads, const typeinfo *typei, adns_queryflags flags, struct timeval now) { /* Allocate a virgin query and return it. */ adns_query qu; - + qu= malloc(sizeof(*qu)); if (!qu) return 0; qu->answer= malloc(sizeof(*qu->answer)); if (!qu->answer) { free(qu); return 0; } - + qu->ads= ads; qu->state= query_tosend; qu->back= qu->next= qu->parent= 0; @@ -100,11 +100,11 @@ static void query_submit(adns_state ads, adns_query qu, qu->query_dgram= malloc( (size_t) qu->vb.used); if (!qu->query_dgram) { adns__query_fail(qu,adns_s_nomemory); return; } - + qu->id= id; qu->query_dglen= qu->vb.used; memcpy(qu->query_dgram,qu->vb.buf,(size_t) qu->vb.used); - + adns__query_send(qu,now); } @@ -120,7 +120,7 @@ adns_status adns__internal_submit(adns_state ads, adns_query *query_r, memcpy(&qu->ctx,ctx,(size_t) sizeof(qu->ctx)); query_submit(ads,qu, typei,qumsg_vb,id,flags,now); - + return adns_s_ok; } @@ -151,7 +151,7 @@ static void query_simple(adns_state ads, adns_query qu, void adns__search_next(adns_state ads, adns_query qu, struct timeval now) { const char *nextentry; adns_status stat; - + if (qu->search_doneabs<0) { nextentry= 0; qu->search_doneabs= 1; @@ -182,7 +182,7 @@ void adns__search_next(adns_state ads, adns_query qu, struct timeval now) { query_simple(ads,qu, (char*)qu->search_vb.buf, qu->search_vb.used, qu->typei, qu->flags, now); return; - + x_fail: adns__query_fail(qu,stat); } @@ -221,7 +221,7 @@ int adns_submit(adns_state ads, r= gettimeofday(&now,0); if (r) goto x_errno; qu= query_alloc(ads,typei,flags,now); if (!qu) goto x_errno; - + qu->ctx.ext= context; qu->ctx.callback= 0; memset(&qu->ctx.info,0,sizeof(qu->ctx.info)); @@ -231,7 +231,7 @@ int adns_submit(adns_state ads, ol= strlen(owner); if (!ol) { stat= adns_s_querydomaininvalid; goto x_adnsfail; } if (ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto x_adnsfail; } - + if (ol>=1 && owner[ol-1]=='.' && (ol<2 || owner[ol-2]!='\\')) { flags &= ~adns_qf_search; qu->flags= flags; @@ -318,7 +318,7 @@ int adns_synchronous(adns_state ads, adns_answer **answer_r) { adns_query qu; int r; - + r= adns_submit(ads,owner,type,flags,0,&qu); if (r) return r; @@ -341,7 +341,7 @@ static void *alloc_common(adns_query qu, size_t sz) { void *adns__alloc_interim(adns_query qu, size_t sz) { void *rv; - + sz= MEM_ROUND(sz); rv= alloc_common(qu,sz); if (!rv) return 0; @@ -351,7 +351,7 @@ void *adns__alloc_interim(adns_query qu, size_t sz) { void *adns__alloc_preserved(adns_query qu, size_t sz) { void *rv; - + sz= MEM_ROUND(sz); rv= adns__alloc_interim(qu,sz); if (!rv) return 0; @@ -371,7 +371,7 @@ void adns__transfer_interim(adns_query from, adns_query to, void *block, size_t assert(!to->final_allocspace); assert(!from->final_allocspace); - + LIST_UNLINK(from->allocations,an); LIST_LINK_TAIL(to->allocations,an); @@ -479,17 +479,17 @@ static void makefinal_query(adns_query qu) { qu->final_allocspace= (byte*)ans + MEM_ROUND(sizeof(*ans)); adns__makefinal_str(qu,&ans->cname); adns__makefinal_str(qu,&ans->owner); - + if (ans->nrrs) { adns__makefinal_block(qu, &ans->rrs.untyped, (size_t) ans->nrrs*ans->rrsz); for (rrn=0; rrnnrrs; rrn++) qu->typei->makefinal(qu, ans->rrs.bytes + rrn*ans->rrsz); } - + free_query_allocs(qu); return; - + x_nomem: qu->preserved_allocd= 0; qu->answer->cname= 0; @@ -559,7 +559,7 @@ void adns__makefinal_str(adns_query qu, char **strp) { l= strlen(before)+1; after= adns__alloc_final(qu, (size_t) l); memcpy(after,before,(size_t) l); - *strp= after; + *strp= after; } void adns__makefinal_block(adns_query qu, void **blpp, size_t sz) { diff --git a/reactos/lib/3rdparty/adns/src/reply.c b/reactos/lib/3rdparty/adns/src/reply.c index a2833ef5129..cde86deb928 100644 --- a/reactos/lib/3rdparty/adns/src/reply.c +++ b/reactos/lib/3rdparty/adns/src/reply.c @@ -9,20 +9,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -32,7 +32,7 @@ #include #include "internal.h" - + void adns__procdgram(adns_state ads, const byte *dgram, int dglen, int serv, int viatcp, struct timeval now) { int cbyte, rrstart, wantedrrs, rri, foundsoa, foundns, cname_here; @@ -49,7 +49,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, vbuf tempvb; byte *newquery, *rrsdata; parseinfo pai; - + if (dglentcpw.head : ads->udpw.head; qu; qu= nqu) { @@ -108,7 +108,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, else LIST_UNLINK(ads->udpw,qu); } } - + /* If we're going to ignore the packet, we return as soon as we have * failed the query (if any) and printed the warning message (if * any). @@ -155,7 +155,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, } /* We're definitely going to do something with this packet and this query now. */ - + anstart= qu->query_dglen; arstart= -1; @@ -233,7 +233,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, * which we could use. */ if (flg_tc) goto x_truncated; - + nsstart= cbyte; if (!wantedrrs) { @@ -256,7 +256,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, if (rrtype == adns_r_soa_raw) { foundsoa= 1; soattl= ttl; break; } else if (rrtype == adns_r_ns_raw) { foundns= 1; } } - + if (rcode == rcode_nxdomain) { /* We still wanted to look for the SOA so we could find the TTL. */ adns__update_expires(qu,soattl,now); @@ -344,29 +344,29 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, return; x_truncated: - + if (!flg_tc) { adns__diag(ads,serv,qu,"server sent datagram which points outside itself"); adns__query_fail(qu,adns_s_invalidresponse); return; } qu->flags |= adns_qf_usevc; - + x_restartquery: if (qu->cname_dgram) { st= adns__mkquery_frdgram(qu->ads,&qu->vb,&qu->id, qu->cname_dgram, qu->cname_dglen, qu->cname_begin, qu->typei->type, qu->flags); if (st) { adns__query_fail(qu,st); return; } - + newquery= realloc(qu->query_dgram, (size_t) qu->vb.used); if (!newquery) { adns__query_fail(qu,adns_s_nomemory); return; } - + qu->query_dgram= newquery; qu->query_dglen= qu->vb.used; memcpy(newquery,qu->vb.buf, (size_t) qu->vb.used); } - + if (qu->state == query_tcpw) qu->state= query_tosend; qu->retries= 0; adns__reset_preserved(qu); diff --git a/reactos/lib/3rdparty/adns/src/setup.c b/reactos/lib/3rdparty/adns/src/setup.c index 3995d3cba00..6dca0e274ee 100644 --- a/reactos/lib/3rdparty/adns/src/setup.c +++ b/reactos/lib/3rdparty/adns/src/setup.c @@ -10,20 +10,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -48,14 +48,14 @@ static void readconfig(adns_state ads, const char *filename, int warnmissing); static void addserver(adns_state ads, struct in_addr addr) { int i; struct server *ss; - + for (i=0; inservers; i++) { if (ads->servers[i].addr.s_addr == addr.s_addr) { adns__debug(ads,-1,0,"duplicate nameserver %s ignored",inet_ntoa(addr)); return; } } - + if (ads->nservers>=MAXSERVERS) { adns__diag(ads,-1,0,"too many nameservers, ignoring %s",inet_ntoa(addr)); return; @@ -109,7 +109,7 @@ static int nextword(const char **bufp_io, const char **word_r, int *l_r) { static void ccf_nameserver(adns_state ads, const char *fn, int lno, const char *buf) { struct in_addr ia; - + if (!inet_aton(buf,&ia)) { configparseerr(ads,fn,lno,"invalid nameserver address `%s'",buf); return; @@ -155,7 +155,7 @@ static void ccf_sortlist(adns_state ads, const char *fn, int lno, const char *bu unsigned long initial, baselocal; if (!buf) return; - + ads->nsortlist= 0; while (nextword(&buf,&word,&l)) { if (ads->nsortlist >= MAXSORTLIST) { @@ -167,11 +167,11 @@ static void ccf_sortlist(adns_state ads, const char *fn, int lno, const char *bu configparseerr(ads,fn,lno,"sortlist entry `%.*s' too long",l,word); continue; } - + memcpy(tbuf,word, (size_t) l); tbuf[l]= 0; slash= strchr(tbuf,'/'); if (slash) *slash++= 0; - + if (!inet_aton(tbuf,&base)) { configparseerr(ads,fn,lno,"invalid address `%s' in sortlist",tbuf); continue; @@ -299,7 +299,7 @@ static int gl_file(adns_state ads, getline_ctx *src_io, const char *filename, p= buf; buflen--; i= 0; - + for (;;) { /* loop over chars */ if (i == buflen) { adns__diag(ads,-1,0,"%s:%d: line too long, ignored",filename,lno); @@ -350,7 +350,7 @@ static int gl_text(adns_state ads, getline_ctx *src_io, const char *filename, saveerr(ads,EINVAL); return -2; } - + memcpy(buf,cp, (size_t) l); buf[l]= 0; return l; @@ -405,7 +405,7 @@ static const char *instrum_getenv(adns_state ads, const char *envvar) { static void readconfig(adns_state ads, const char *filename, int warnmissing) { getline_ctx gl_ctx; - + gl_ctx.file= fopen(filename,"r"); if (!gl_ctx.file) { if (errno == ENOENT) { @@ -420,17 +420,17 @@ static void readconfig(adns_state ads, const char *filename, int warnmissing) { } readconfiggeneric(ads,filename,gl_file,gl_ctx); - + fclose(gl_ctx.file); } static void readconfigtext(adns_state ads, const char *text, const char *showname) { getline_ctx gl_ctx; - + gl_ctx.text= text; readconfiggeneric(ads,showname,gl_text,gl_ctx); } - + static void readconfigenv(adns_state ads, const char *envvar) { const char *filename; @@ -460,7 +460,7 @@ int adns__setnonblock(adns_state ads, ADNS_SOCKET fd) { return (ioctlsocket (fd, (long) FIONBIO, &Val) == 0) ? 0 : -1; #else int r; - + r= fcntl(fd,F_GETFL,0); if (r<0) return errno; r |= O_NONBLOCK; r= fcntl(fd,F_SETFL,r); if (r<0) return errno; @@ -471,12 +471,12 @@ int adns__setnonblock(adns_state ads, ADNS_SOCKET fd) { static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { adns_state ads; -#ifdef ADNS_JGAA_WIN32 +#ifdef ADNS_JGAA_WIN32 WORD wVersionRequested = MAKEWORD( 2, 0 ); WSADATA wsaData; int err; #endif - + ads= malloc(sizeof(*ads)); if (!ads) return errno; ads->iflags= flags; @@ -498,7 +498,7 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { timerclear(&ads->tcptimeout); ads->searchlist= 0; - #ifdef ADNS_JGAA_WIN32 + #ifdef ADNS_JGAA_WIN32 err= WSAStartup( wVersionRequested, &wsaData ); if ( err != 0 ) { if (ads->diagfile && ads->iflags & adns_if_debug) @@ -508,10 +508,10 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { HIBYTE( wsaData.wVersion ) != 0 ) { if (ads->diagfile && ads->iflags & adns_if_debug) fprintf(ads->diagfile,"adns: Need Winsock 2.0 or better!\n"); - + WSACleanup(); return -1;} - + /* The WinSock DLL is acceptable. Proceed. */ #endif @@ -524,7 +524,7 @@ static int init_finish(adns_state ads) { struct in_addr ia; struct protoent *proto; int r; - + if (!ads->nservers && !(ads->iflags & adns_if_noserver)) { if (ads->diagfile && ads->iflags & adns_if_debug) fprintf(ads->diagfile,"adns: no nameservers, using localhost\n"); @@ -579,10 +579,10 @@ int adns_init(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { PIP_ADDR_STRING pip; const char *network_err_str = ""; #endif - + r= init_begin(&ads, flags, diagfile ? diagfile : stderr); if (r) return r; - + res_options= instrum_getenv(ads,"RES_OPTIONS"); adns_res_options= instrum_getenv(ads,"ADNS_RES_OPTIONS"); ccf_options(ads,"RES_OPTIONS",-1,res_options); @@ -616,7 +616,7 @@ int adns_init(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { for(pip = &(network_info->DnsServerList); pip; pip = pip->Next) { addr.s_addr = inet_addr(pip->IpAddress.String); if ((addr.s_addr != INADDR_ANY) && (addr.s_addr != INADDR_NONE)) - addserver(ads, addr); + addserver(ads, addr); } } } @@ -701,7 +701,7 @@ void adns_forallqueries_begin(adns_state ads) { ads->childw.head ? ads->childw.head : ads->output.head; } - + adns_query adns_forallqueries_next(adns_state ads, void **context_r) { adns_query qu, nqu; diff --git a/reactos/lib/3rdparty/adns/src/transmit.c b/reactos/lib/3rdparty/adns/src/transmit.c index 6b25adb054e..ca270a0e7ce 100644 --- a/reactos/lib/3rdparty/adns/src/transmit.c +++ b/reactos/lib/3rdparty/adns/src/transmit.c @@ -10,20 +10,20 @@ * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include @@ -46,12 +46,12 @@ static adns_status mkquery_header(adns_state ads, vbuf *vb, int *id_r, int qdlen) { int id; byte *rqp; - + if (!adns__vbuf_ensure(vb,DNS_HDRSIZE+qdlen+4)) return adns_s_nomemory; vb->used= 0; MKQUERY_START(vb); - + *id_r= id= (ads->nextid++) & 0x0ffff; MKQUERY_ADDW(id); MKQUERY_ADDB(0x01); /* QR=Q(0), OPCODE=QUERY(0000), !AA, !TC, RD */ @@ -62,7 +62,7 @@ static adns_status mkquery_header(adns_state ads, vbuf *vb, int *id_r, int qdlen MKQUERY_ADDW(0); /* ARCOUNT=0 */ MKQUERY_STOP(vb); - + return adns_s_ok; } @@ -74,7 +74,7 @@ static adns_status mkquery_footer(vbuf *vb, adns_rrtype type) { MKQUERY_ADDW(DNS_CLASS_IN); /* QCLASS=IN */ MKQUERY_STOP(vb); assert(vb->used <= vb->avail); - + return adns_s_ok; } @@ -87,7 +87,7 @@ adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r, adns_status st; st= mkquery_header(ads,vb,id_r,ol+2); if (st) return st; - + MKQUERY_START(vb); p= owner; pe= owner+ol; @@ -129,9 +129,9 @@ adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r, MKQUERY_ADDB(0); MKQUERY_STOP(vb); - + st= mkquery_footer(vb,typei->type); - + return adns_s_ok; } @@ -159,9 +159,9 @@ adns_status adns__mkquery_frdgram(adns_state ads, vbuf *vb, int *id_r, MKQUERY_ADDB(0); MKQUERY_STOP(vb); - + st= mkquery_footer(vb,type); - + return adns_s_ok; } @@ -249,14 +249,14 @@ void adns__query_send(adns_query qu, struct timeval now) { servaddr.sin_family= AF_INET; servaddr.sin_addr= ads->servers[serv].addr; servaddr.sin_port= htons(DNS_PORT); - + ADNS_CLEAR_ERRNO; r= sendto(ads->udpsocket,(char*)qu->query_dgram,qu->query_dglen,0, (const struct sockaddr*)&servaddr,sizeof(servaddr)); ADNS_CAPTURE_ERRNO; if (r<0 && errno == EMSGSIZE) { qu->retries= 0; query_usetcp(qu,now); return; } if (r<0 && errno != EAGAIN) adns__warn(ads,serv,0,"sendto failed: %s (%d)",strerror(errno), errno); - + qu->timeout= now; timevaladd(&qu->timeout,UDPRETRYMS); qu->udpsent |= (1< * Copyright (C) 1999-2000 Tony Finch - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ADNS_JGAA_WIN32 @@ -95,17 +95,17 @@ static adns_status pap_qstring(const parseinfo *pai, int *cbyte_io, int max, if (cbyte >= max) return adns_s_invaliddata; GET_B(cbyte,l); if (cbyte+l > max) return adns_s_invaliddata; - + str= adns__alloc_interim(pai->qu, (size_t)l+1); if (!str) R_NOMEM; - + str[l]= 0; memcpy(str,dgram+cbyte,(size_t)l); *len_r= l; *str_r= str; *cbyte_io= cbyte+l; - + return adns_s_ok; } @@ -129,7 +129,7 @@ static adns_status csp_qstring(vbuf *vb, const char *dp, int len) { } } CSP_ADDSTR("\""); - + return adns_s_ok; } @@ -202,7 +202,7 @@ static adns_status pa_txt(const parseinfo *pai, int cbyte, int max, void *datap) te->i= -1; te->str= 0; - + *rrp= table; return adns_s_ok; } @@ -240,7 +240,7 @@ static adns_status cs_hinfo(vbuf *vb, const void *datap) { static adns_status pa_inaddr(const parseinfo *pai, int cbyte, int max, void *datap) { struct in_addr *storeto= datap; - + if (max-cbyte != 4) return adns_s_invaliddata; memcpy(storeto, pai->dgram + cbyte, 4); return adns_s_ok; @@ -249,7 +249,7 @@ static adns_status pa_inaddr(const parseinfo *pai, int cbyte, int max, void *dat static int search_sortlist(adns_state ads, struct in_addr ad) { const struct sortlist *slp; int i; - + for (i=0, slp=ads->sortlist; insortlist && !((ad.s_addr & slp->mask.s_addr) == slp->base.s_addr); i++, slp++); @@ -258,7 +258,7 @@ static int search_sortlist(adns_state ads, struct in_addr ad) { static int dip_inaddr(adns_state ads, struct in_addr a, struct in_addr b) { int ai, bi; - + if (!ads->nsortlist) return 0; ai= search_sortlist(ads,a); @@ -308,7 +308,7 @@ static int div_addr(void *context, const void *datap_a, const void *datap_b) { const adns_state ads= context; return di_addr(ads, datap_a, datap_b); -} +} static adns_status csp_addr(vbuf *vb, const adns_rr_addr *rrp) { const char *ia; @@ -343,7 +343,7 @@ static adns_status pap_domain(const parseinfo *pai, int *cbyte_io, int max, char **domain_r, parsedomain_flags flags) { adns_status st; char *dm; - + st= adns__parse_domain(pai->qu->ads, pai->serv, pai->qu, &pai->qu->vb, flags, pai->dgram,pai->dglen, cbyte_io, max); if (st) return st; @@ -354,7 +354,7 @@ static adns_status pap_domain(const parseinfo *pai, int *cbyte_io, int max, dm[pai->qu->vb.used]= 0; memcpy(dm,pai->qu->vb.buf, (size_t) pai->qu->vb.used); - + *domain_r= dm; return adns_s_ok; } @@ -376,7 +376,7 @@ static adns_status pa_dom_raw(const parseinfo *pai, int cbyte, int max, void *da st= pap_domain(pai, &cbyte, max, rrp, pdf_quoteok); if (st) return st; - + if (cbyte != max) return adns_s_invaliddata; return adns_s_ok; } @@ -392,7 +392,7 @@ static adns_status pa_host_raw(const parseinfo *pai, int cbyte, int max, void *d st= pap_domain(pai, &cbyte, max, rrp, pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0); if (st) return st; - + if (cbyte != max) return adns_s_invaliddata; return adns_s_ok; } @@ -407,7 +407,7 @@ static adns_status pap_findaddrs(const parseinfo *pai, adns_rr_hostaddr *ha, int type, class, rdlen, rdstart, ownermatched; unsigned long ttl; adns_status st; - + for (rri=0, naddrs=-1; rriqu, pai->serv, pai->dgram, pai->dglen, cbyte_io, &type, &class, &ttl, &rdlen, &rdstart, @@ -495,10 +495,10 @@ static adns_status pap_hostaddr(const parseinfo *pai, int *cbyte_io, ctx.ext= 0; ctx.callback= icb_hostaddr; ctx.info.hostaddr= rrp; - + nflags= adns_qf_quoteok_query; if (!(pai->qu->flags & adns_qf_cname_loose)) nflags |= adns_qf_cname_forbid; - + st= adns__internal_submit(pai->ads, &nqu, adns__findtype(adns_r_addr), &pai->qu->vb, id, nflags, pai->now, &ctx); if (st) return st; @@ -571,7 +571,7 @@ static adns_status csp_hostaddr(vbuf *vb, const adns_rr_hostaddr *rrp) { errstr= adns_strerror(rrp->astatus); st= csp_qstring(vb,errstr,(int)strlen(errstr)); if (st) return st; - + if (rrp->naddrs >= 0) { CSP_ADDSTR(" ("); for (i=0; inaddrs; i++) { @@ -607,7 +607,7 @@ static adns_status pa_mx_raw(const parseinfo *pai, int cbyte, int max, void *dat st= pap_domain(pai, &cbyte, max, &rrp->str, pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0); if (st) return st; - + if (cbyte != max) return adns_s_invaliddata; return adns_s_ok; } @@ -635,7 +635,7 @@ static adns_status pa_mx(const parseinfo *pai, int cbyte, int max, void *datap) rrp->i= pref; st= pap_hostaddr(pai, &cbyte, max, &rrp->ha); if (st) return st; - + if (cbyte != max) return adns_s_invaliddata; return adns_s_ok; } @@ -718,7 +718,7 @@ static void icb_ptr(adns_query parent, adns_query child) { static adns_status pa_ptr(const parseinfo *pai, int dmstart, int max, void *datap) { static const char *(expectdomain[])= { DNS_INADDR_ARPA }; - + char **rrp= datap; adns_status st; adns_rr_addr *ap; @@ -757,7 +757,7 @@ static adns_status pa_ptr(const parseinfo *pai, int dmstart, int max, void *data } st= adns__findlabel_next(&fls,&lablen,0); assert(!st); if (lablen) return adns_s_querydomainwrong; - + ap->len= sizeof(struct sockaddr_in); memset(&ap->addr,0,sizeof(ap->addr.inet)); ap->addr.inet.sin_family= AF_INET; @@ -820,7 +820,7 @@ static adns_status pa_hinfo(const parseinfo *pai, int cbyte, int max, void *data } if (cbyte != max) return adns_s_invaliddata; - + return adns_s_ok; } @@ -924,7 +924,7 @@ static adns_status cs_rp(vbuf *vb, const void *datap) { st= csp_domain(vb,rrp->array[1]); if (st) return st; return adns_s_ok; -} +} /* * _soa (pa,mf,cs) @@ -944,7 +944,7 @@ static adns_status pa_soa(const parseinfo *pai, int cbyte, int max, void *datap) if (st) return st; if (cbyte+20 != max) return adns_s_invaliddata; - + for (i=0; i<5; i++) { GET_W(cbyte,msw); GET_W(cbyte,lsw); @@ -966,7 +966,7 @@ static adns_status cs_soa(vbuf *vb, const void *datap) { char buf[20]; int i; adns_status st; - + st= csp_domain(vb,rrp->mname); if (st) return st; CSP_ADDSTR(" "); st= csp_mailbox(vb,rrp->rname); if (st) return st; @@ -1002,7 +1002,7 @@ static void mf_flat(adns_query qu, void *data) { } static const typeinfo typeinfos[] = { /* Must be in ascending order of rrtype ! */ /* mem-mgmt code rrt fmt member parser comparer printer */ - + FLAT_TYPE(a, "A", 0, inaddr, pa_inaddr, di_inaddr, cs_inaddr ), DEEP_TYPE(ns_raw, "NS", "raw", str, pa_host_raw,0, cs_domain ), DEEP_TYPE(cname, "CNAME", 0, str, pa_dom_raw, 0, cs_domain ), @@ -1012,12 +1012,12 @@ DEEP_TYPE(hinfo, "HINFO", 0, intstrpair, pa_hinfo, 0, cs_hinfo DEEP_TYPE(mx_raw, "MX", "raw", intstr, pa_mx_raw, di_mx_raw, cs_inthost ), DEEP_TYPE(txt, "TXT", 0, manyistr, pa_txt, 0, cs_txt ), DEEP_TYPE(rp_raw, "RP", "raw", strpair, pa_rp, 0, cs_rp ), - + FLAT_TYPE(addr, "A", "addr", addr, pa_addr, di_addr, cs_addr ), DEEP_TYPE(ns, "NS", "+addr", hostaddr, pa_hostaddr,di_hostaddr,cs_hostaddr ), DEEP_TYPE(ptr, "PTR","checked",str, pa_ptr, 0, cs_domain ), DEEP_TYPE(mx, "MX", "+addr", inthostaddr,pa_mx, di_mx, cs_inthostaddr), - + DEEP_TYPE(soa, "SOA","822", soa, pa_soa, 0, cs_soa ), DEEP_TYPE(rp, "RP", "822", strpair, pa_rp, 0, cs_rp ), }; diff --git a/reactos/lib/3rdparty/expat/lib/xmlparse.c b/reactos/lib/3rdparty/expat/lib/xmlparse.c index 04f8b91438d..ed427ca5fb5 100644 --- a/reactos/lib/3rdparty/expat/lib/xmlparse.c +++ b/reactos/lib/3rdparty/expat/lib/xmlparse.c @@ -323,15 +323,15 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity, static enum XML_Error initializeEncoding(XML_Parser parser); static enum XML_Error -doProlog(XML_Parser parser, const ENCODING *enc, const char *s, - const char *end, int tok, const char *next, const char **nextPtr, +doProlog(XML_Parser parser, const ENCODING *enc, const char *s, + const char *end, int tok, const char *next, const char **nextPtr, XML_Bool haveMore); static enum XML_Error -processInternalEntity(XML_Parser parser, ENTITY *entity, +processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl); static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, - const char *start, const char *end, const char **endPtr, + const char *start, const char *end, const char **endPtr, XML_Bool haveMore); static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, @@ -349,7 +349,7 @@ static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); static int -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser); static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, @@ -1453,7 +1453,7 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); positionPtr = bufferPtr; return XML_STATUS_SUSPENDED; - case XML_INITIALIZED: + case XML_INITIALIZED: case XML_PARSING: ps_parsing = XML_FINISHED; /* fall through */ @@ -1576,7 +1576,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) case XML_SUSPENDED: result = XML_STATUS_SUSPENDED; break; - case XML_INITIALIZED: + case XML_INITIALIZED: case XML_PARSING: if (isFinal) { ps_parsing = XML_FINISHED; @@ -1723,7 +1723,7 @@ XML_ResumeParser(XML_Parser parser) case XML_SUSPENDED: result = XML_STATUS_SUSPENDED; break; - case XML_INITIALIZED: + case XML_INITIALIZED: case XML_PARSING: if (ps_finalBuffer) { ps_parsing = XML_FINISHED; @@ -2010,7 +2010,7 @@ contentProcessor(XML_Parser parser, const char *end, const char **endPtr) { - enum XML_Error result = doContent(parser, 0, encoding, start, end, + enum XML_Error result = doContent(parser, 0, encoding, start, end, endPtr, (XML_Bool)!ps_finalBuffer); if (result == XML_ERROR_NONE) { if (!storeRawNames(parser)) @@ -2092,7 +2092,7 @@ externalEntityInitProcessor3(XML_Parser parser, if (result != XML_ERROR_NONE) return result; switch (ps_parsing) { - case XML_SUSPENDED: + case XML_SUSPENDED: *endPtr = next; return XML_ERROR_NONE; case XML_FINISHED: @@ -2126,7 +2126,7 @@ externalEntityContentProcessor(XML_Parser parser, const char *end, const char **endPtr) { - enum XML_Error result = doContent(parser, 1, encoding, start, end, + enum XML_Error result = doContent(parser, 1, encoding, start, end, endPtr, (XML_Bool)!ps_finalBuffer); if (result == XML_ERROR_NONE) { if (!storeRawNames(parser)) @@ -2145,7 +2145,7 @@ doContent(XML_Parser parser, XML_Bool haveMore) { /* save one level of indirection */ - DTD * const dtd = _dtd; + DTD * const dtd = _dtd; const char **eventPP; const char **eventEndPP; @@ -2176,8 +2176,8 @@ doContent(XML_Parser parser, } else if (defaultHandler) reportDefault(parser, enc, s, end); - /* We are at the end of the final buffer, should we check for - XML_SUSPENDED, XML_FINISHED? + /* We are at the end of the final buffer, should we check for + XML_SUSPENDED, XML_FINISHED? */ if (startTagLevel == 0) return XML_ERROR_NO_ELEMENTS; @@ -2528,8 +2528,8 @@ doContent(XML_Parser parser, } else if (defaultHandler) reportDefault(parser, enc, s, end); - /* We are at the end of the final buffer, should we check for - XML_SUSPENDED, XML_FINISHED? + /* We are at the end of the final buffer, should we check for + XML_SUSPENDED, XML_FINISHED? */ if (startTagLevel == 0) { *eventPP = end; @@ -2578,7 +2578,7 @@ doContent(XML_Parser parser, } *eventPP = s = next; switch (ps_parsing) { - case XML_SUSPENDED: + case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: @@ -2940,20 +2940,20 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, 'X', 'M', 'L', '/', '1', '9', '9', '8', '/', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0' }; - static const int xmlLen = + static const int xmlLen = (int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1; static const XML_Char xmlnsNamespace[] = { 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/', '2', '0', '0', '0', '/', 'x', 'm', 'l', 'n', 's', '/', '\0' }; - static const int xmlnsLen = + static const int xmlnsLen = (int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1; XML_Bool mustBeXML = XML_FALSE; XML_Bool isXML = XML_TRUE; XML_Bool isXMLNS = XML_TRUE; - + BINDING *b; int len; @@ -2980,7 +2980,7 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len])) isXML = XML_FALSE; - if (!mustBeXML && isXMLNS + if (!mustBeXML && isXMLNS && (len > xmlnsLen || uri[len] != xmlnsNamespace[len])) isXMLNS = XML_FALSE; } @@ -3188,7 +3188,7 @@ ignoreSectionProcessor(XML_Parser parser, const char *end, const char **endPtr) { - enum XML_Error result = doIgnoreSection(parser, encoding, &start, end, + enum XML_Error result = doIgnoreSection(parser, encoding, &start, end, endPtr, (XML_Bool)!ps_finalBuffer); if (result != XML_ERROR_NONE) return result; @@ -3470,7 +3470,7 @@ entityValueInitProcessor(XML_Parser parser, const char *next = start; eventPtr = start; - for (;;) { + for (;;) { tok = XmlPrologTok(encoding, start, end, &next); eventEndPtr = next; if (tok <= 0) { @@ -3498,7 +3498,7 @@ entityValueInitProcessor(XML_Parser parser, if (result != XML_ERROR_NONE) return result; switch (ps_parsing) { - case XML_SUSPENDED: + case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: @@ -3563,7 +3563,7 @@ externalParEntProcessor(XML_Parser parser, } processor = prologProcessor; - return doProlog(parser, encoding, s, end, tok, next, + return doProlog(parser, encoding, s, end, tok, next, nextPtr, (XML_Bool)!ps_finalBuffer); } @@ -3613,7 +3613,7 @@ prologProcessor(XML_Parser parser, { const char *next = s; int tok = XmlPrologTok(encoding, s, end, &next); - return doProlog(parser, encoding, s, end, tok, next, + return doProlog(parser, encoding, s, end, tok, next, nextPtr, (XML_Bool)!ps_finalBuffer); } @@ -3647,7 +3647,7 @@ doProlog(XML_Parser parser, static const XML_Char enumValueStart[] = { '(', '\0' }; /* save one level of indirection */ - DTD * const dtd = _dtd; + DTD * const dtd = _dtd; const char **eventPP; const char **eventEndPP; @@ -3821,8 +3821,8 @@ doProlog(XML_Parser parser, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead) { - if (!dtd->standalone && - notStandaloneHandler && + if (!dtd->standalone && + notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; } @@ -4260,7 +4260,7 @@ doProlog(XML_Parser parser, switch (tok) { case XML_TOK_PARAM_ENTITY_REF: /* PE references in internal subset are - not allowed within declarations. */ + not allowed within declarations. */ return XML_ERROR_PARAM_ENTITY_REF; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; @@ -4381,7 +4381,7 @@ doProlog(XML_Parser parser, return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; - XML_Bool betweenDecl = + XML_Bool betweenDecl = (role == XML_ROLE_PARAM_ENTITY_REF ? XML_TRUE : XML_FALSE); result = processInternalEntity(parser, entity, betweenDecl); if (result != XML_ERROR_NONE) @@ -4576,7 +4576,7 @@ doProlog(XML_Parser parser, reportDefault(parser, enc, s, next); switch (ps_parsing) { - case XML_SUSPENDED: + case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: @@ -4646,7 +4646,7 @@ epilogProcessor(XML_Parser parser, } eventPtr = s = next; switch (ps_parsing) { - case XML_SUSPENDED: + case XML_SUSPENDED: *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: @@ -4689,12 +4689,12 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next); - result = doProlog(parser, internalEncoding, textStart, textEnd, tok, + result = doProlog(parser, internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } - else + else #endif /* XML_DTD */ - result = doContent(parser, tagLevel, internalEncoding, textStart, + result = doContent(parser, tagLevel, internalEncoding, textStart, textEnd, &next, XML_FALSE); if (result == XML_ERROR_NONE) { @@ -4734,13 +4734,13 @@ internalEntityProcessor(XML_Parser parser, #ifdef XML_DTD if (entity->is_param) { int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next); - result = doProlog(parser, internalEncoding, textStart, textEnd, tok, + result = doProlog(parser, internalEncoding, textStart, textEnd, tok, next, &next, XML_FALSE); } else #endif /* XML_DTD */ - result = doContent(parser, openEntity->startTagLevel, internalEncoding, - textStart, textEnd, &next, XML_FALSE); + result = doContent(parser, openEntity->startTagLevel, internalEncoding, + textStart, textEnd, &next, XML_FALSE); if (result != XML_ERROR_NONE) return result; @@ -4761,7 +4761,7 @@ internalEntityProcessor(XML_Parser parser, int tok; processor = prologProcessor; tok = XmlPrologTok(encoding, s, end, &next); - return doProlog(parser, encoding, s, end, tok, next, nextPtr, + return doProlog(parser, encoding, s, end, tok, next, nextPtr, (XML_Bool)!ps_finalBuffer); } else @@ -4770,8 +4770,8 @@ internalEntityProcessor(XML_Parser parser, processor = contentProcessor; /* see externalEntityContentProcessor vs contentProcessor */ return doContent(parser, parentParser ? 1 : 0, encoding, s, end, - nextPtr, (XML_Bool)!ps_finalBuffer); - } + nextPtr, (XML_Bool)!ps_finalBuffer); + } } static enum XML_Error PTRCALL diff --git a/reactos/lib/3rdparty/expat/lib/xmltok.c b/reactos/lib/3rdparty/expat/lib/xmltok.c index 26cee4d4e55..33a038c87a9 100644 --- a/reactos/lib/3rdparty/expat/lib/xmltok.c +++ b/reactos/lib/3rdparty/expat/lib/xmltok.c @@ -1337,7 +1337,7 @@ unknown_toUtf16(const ENCODING *enc, ENCODING * XmlInitUnknownEncoding(void *mem, int *table, - CONVERTER convert, + CONVERTER convert, void *userData) { int i; @@ -1627,7 +1627,7 @@ initScan(const ENCODING * const *encodingTable, ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, - CONVERTER convert, + CONVERTER convert, void *userData) { ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData); diff --git a/reactos/lib/3rdparty/libxml2/DOCBparser.c b/reactos/lib/3rdparty/libxml2/DOCBparser.c index 3573743352c..f12511b9e8a 100644 --- a/reactos/lib/3rdparty/libxml2/DOCBparser.c +++ b/reactos/lib/3rdparty/libxml2/DOCBparser.c @@ -53,7 +53,7 @@ docbEncodeEntities(unsigned char *out ATTRIBUTE_UNUSED, /** * docbParseDocument: * @ctxt: an SGML parser context - * + * * parse an SGML document (and build a tree if using the standard SAX * interface). * @@ -163,12 +163,12 @@ docbCreatePushParserCtxt(docbSAXHandlerPtr sax ATTRIBUTE_UNUSED, * @cur: a pointer to an array of xmlChar * @encoding: a free form C string describing the SGML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * parse an SGML in-memory document and build a tree. * It use the given SAX function block to handle the parsing callback. * If sax is NULL, fallback to the default DOM tree building routines. - * + * * Returns the resulting document tree */ @@ -196,7 +196,7 @@ docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, * @encoding: a free form C string describing the SGML document encoding, or NULL * * parse an SGML in-memory document and build a tree. - * + * * Returns the resulting document tree */ @@ -221,7 +221,7 @@ docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, * @filename: the filename * @encoding: the SGML document encoding, or NULL * - * Create a parser context for a file content. + * Create a parser context for a file content. * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * @@ -247,7 +247,7 @@ docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED, * @filename: the filename * @encoding: a free form C string describing the SGML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * parse an SGML file and build a tree. Automatic support for ZLIB/Compress * compressed document is provided by default if found at compile-time. diff --git a/reactos/lib/3rdparty/libxml2/HTMLparser.c b/reactos/lib/3rdparty/libxml2/HTMLparser.c index c6115d03159..4c38b6af0e8 100644 --- a/reactos/lib/3rdparty/libxml2/HTMLparser.c +++ b/reactos/lib/3rdparty/libxml2/HTMLparser.c @@ -273,7 +273,7 @@ htmlnamePop(htmlParserCtxtPtr ctxt) } else ctxt->input->col++; \ ctxt->token = 0; ctxt->input->cur += l; ctxt->nbChars++; \ } while (0) - + /************ \ if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); \ @@ -309,7 +309,7 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) { if (ctxt->token != 0) { *len = 0; return(ctxt->token); - } + } if (ctxt->charset == XML_CHAR_ENCODING_UTF8) { /* * We are supposed to handle UTF8, check it's valid @@ -318,7 +318,7 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) { * UCS-4 range (hex.) UTF-8 octet sequence (binary) * 0000 0000-0000 007F 0xxxxxxx * 0000 0080-0000 07FF 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx * * Check for the 0x110000 limit too */ @@ -366,7 +366,7 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) { if (!IS_CHAR(val)) { htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR, "Char 0x%X out of allowed range\n", val); - } + } return(val); } else { /* 1-byte code */ @@ -409,7 +409,7 @@ encoding_error: BAD_CAST buffer, NULL); } - ctxt->charset = XML_CHAR_ENCODING_8859_1; + ctxt->charset = XML_CHAR_ENCODING_8859_1; *len = 1; return((int) *ctxt->input->cur); } @@ -940,7 +940,7 @@ static const char *htmlStartClose[] = { "table", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "listing", "xmp", "a", NULL, "th", "th", "td", "p", "span", "font", "a", "b", "i", "u", NULL, -"td", "th", "td", "p", "span", "font", "a", "b", "i", "u", NULL, +"td", "th", "td", "p", "span", "font", "a", "b", "i", "u", NULL, "tr", "th", "td", "tr", "caption", "col", "colgroup", "p", NULL, "thead", "caption", "col", "colgroup", NULL, "tfoot", "th", "td", "tr", "caption", "col", "colgroup", "thead", @@ -1000,7 +1000,7 @@ static const char *htmlScriptAttributes[] = { * elements the parser can decide how to handle extra endtags. * Endtags are only allowed to close elements with lower or equal * priority. - */ + */ typedef struct { const char *name; @@ -1077,7 +1077,7 @@ htmlTagLookup(const xmlChar *tag) { /** * htmlGetEndPriority: * @name: The name of the element to look up the priority for. - * + * * Return value: The "endtag" priority. **/ static int @@ -1156,7 +1156,7 @@ htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag) * A missplaced endtag can only close elements with lower * or equal priority, so if we find an element with higher * priority before we find an element with - * matching name, we just ignore this endtag + * matching name, we just ignore this endtag */ if (htmlGetEndPriority(ctxt->nameTab[i]) > priority) return; @@ -1207,7 +1207,7 @@ htmlAutoCloseOnEnd(htmlParserCtxtPtr ctxt) * called when a new tag has been detected and generates the * appropriates closes if possible/needed. * If newtag is NULL this mean we are at the end of the resource - * and we should check + * and we should check */ static void htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag) @@ -1306,14 +1306,14 @@ htmlCheckImplied(htmlParserCtxtPtr ctxt, const xmlChar *newtag) { } if ((xmlStrEqual(newtag, BAD_CAST"body")) || (xmlStrEqual(newtag, BAD_CAST"head"))) return; - if ((ctxt->nameNr <= 1) && + if ((ctxt->nameNr <= 1) && ((xmlStrEqual(newtag, BAD_CAST"script")) || (xmlStrEqual(newtag, BAD_CAST"style")) || (xmlStrEqual(newtag, BAD_CAST"meta")) || (xmlStrEqual(newtag, BAD_CAST"link")) || (xmlStrEqual(newtag, BAD_CAST"title")) || (xmlStrEqual(newtag, BAD_CAST"base")))) { - /* + /* * dropped OBJECT ... i you put it first BODY will be * assumed ! */ @@ -1332,7 +1332,7 @@ htmlCheckImplied(htmlParserCtxtPtr ctxt, const xmlChar *newtag) { return; } } - + htmlnamePush(ctxt, BAD_CAST"body"); if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL)) ctxt->sax->startElement(ctxt->userData, BAD_CAST"body", NULL); @@ -1825,7 +1825,7 @@ UTF8ToHtml(unsigned char* out, int *outlen, if (inend - in < trailing) { break; - } + } for ( ; trailing; trailing--) { if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) @@ -2013,7 +2013,7 @@ htmlNewInputStream(htmlParserCtxtPtr ctxt) { * * ************************************************************************/ /* - * all tags allowing pc data from the html 4.01 loose dtd + * all tags allowing pc data from the html 4.01 loose dtd * NOTE: it might be more apropriate to integrate this information * into the html40ElementTable array but I don't want to risk any * binary incomptibility @@ -2063,7 +2063,7 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) { if (lastChild == NULL) { if ((ctxt->node->type != XML_ELEMENT_NODE) && (ctxt->node->content != NULL)) return(0); - /* keep ws in constructs like ... ... + /* keep ws in constructs like ... ... for all tags "b" allowing PCDATA */ for ( i = 0; i < sizeof(allowPCData)/sizeof(allowPCData[0]); i++ ) { if ( xmlStrEqual(ctxt->name, BAD_CAST allowPCData[i]) ) { @@ -2073,7 +2073,7 @@ static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) { } else if (xmlNodeIsText(lastChild)) { return(0); } else { - /* keep ws in constructs like

xy z

+ /* keep ws in constructs like

xy z

for all tags "p" allowing PCDATA */ for ( i = 0; i < sizeof(allowPCData)/sizeof(allowPCData[0]); i++ ) { if ( xmlStrEqual(lastChild->name, BAD_CAST allowPCData[i]) ) { @@ -2113,7 +2113,7 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) { cur->intSubset = NULL; cur->doc = cur; cur->name = NULL; - cur->children = NULL; + cur->children = NULL; cur->extSubset = NULL; cur->oldNs = NULL; cur->encoding = NULL; @@ -2188,10 +2188,10 @@ htmlParseHTMLName(htmlParserCtxtPtr ctxt) { if ((CUR >= 'A') && (CUR <= 'Z')) loc[i] = CUR + 0x20; else loc[i] = CUR; i++; - + NEXT; } - + return(xmlDictLookup(ctxt->dict, loc, i)); } @@ -2258,7 +2258,7 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) { while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */ ((IS_LETTER(c)) || (IS_DIGIT(c)) || (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c)))) { if (count++ > 100) { @@ -2277,7 +2277,7 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) { * htmlParseHTMLAttribute: * @ctxt: an HTML parser context * @stop: a char stop value - * + * * parse an HTML attribute value till the stop (quote), if * stop is 0 then it stops at the first space * @@ -2322,13 +2322,13 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) { { *out++ =((c >> 6) & 0x1F) | 0xC0; bits= 0; } else if (c < 0x10000) { *out++ =((c >> 12) & 0x0F) | 0xE0; bits= 6; } - else + else { *out++ =((c >> 18) & 0x07) | 0xF0; bits= 12; } - + for ( ; bits >= 0; bits-= 6) { *out++ = ((c >> bits) & 0x3F) | 0x80; } - + if (out - buffer > buffer_size - 100) { int indx = out - buffer; @@ -2374,9 +2374,9 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) { { *out++ =((c >> 6) & 0x1F) | 0xC0; bits= 0; } else if (c < 0x10000) { *out++ =((c >> 12) & 0x0F) | 0xE0; bits= 6; } - else + else { *out++ =((c >> 18) & 0x07) | 0xF0; bits= 12; } - + for ( ; bits >= 0; bits-= 6) { *out++ = ((c >> bits) & 0x3F) | 0x80; } @@ -2399,9 +2399,9 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) { { *out++ =((c >> 6) & 0x1F) | 0xC0; bits= 0; } else if (c < 0x10000) { *out++ =((c >> 12) & 0x0F) | 0xE0; bits= 6; } - else + else { *out++ =((c >> 18) & 0x07) | 0xF0; bits= 12; } - + for ( ; bits >= 0; bits-= 6) { *out++ = ((c >> bits) & 0x3F) | 0x80; } @@ -2469,7 +2469,7 @@ htmlParseEntityRef(htmlParserCtxtPtr ctxt, const xmlChar **str) { * parse a value for an attribute * Note: the parser won't do substitution of entities here, this * will be handled later in xmlStringGetNodeList, unless it was - * asked for ctxt->replaceEntities != 0 + * asked for ctxt->replaceEntities != 0 * * Returns the AttValue parsed or NULL. */ @@ -2510,7 +2510,7 @@ htmlParseAttValue(htmlParserCtxtPtr ctxt) { /** * htmlParseSystemLiteral: * @ctxt: an HTML parser context - * + * * parse an HTML Literal * * [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") @@ -2551,7 +2551,7 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) { htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, " or ' expected\n", NULL, NULL); } - + return(ret); } @@ -2600,7 +2600,7 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) { htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, "PubidLiteral \" or ' expected\n", NULL, NULL); } - + return(ret); } @@ -2714,7 +2714,7 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { SHRINK; cur = CUR_CHAR(l); while (((cur != '<') || (ctxt->token == '<')) && - ((cur != '&') || (ctxt->token == '&')) && + ((cur != '&') || (ctxt->token == '&')) && (IS_CHAR(cur))) { COPY_BUF(l,buf,nbchar,cur); if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) { @@ -2927,7 +2927,7 @@ htmlParsePI(htmlParserCtxtPtr ctxt) { } xmlFree(buf); } else { - htmlParseErr(ctxt, XML_ERR_PI_NOT_STARTED, + htmlParseErr(ctxt, XML_ERR_PI_NOT_STARTED, "PI is not started correctly", NULL, NULL); } ctxt->instate = state; @@ -3043,7 +3043,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) { ((NXT(2) == 'x') || NXT(2) == 'X')) { SKIP(3); while (CUR != ';') { - if ((CUR >= '0') && (CUR <= '9')) + if ((CUR >= '0') && (CUR <= '9')) val = val * 16 + (CUR - '0'); else if ((CUR >= 'a') && (CUR <= 'f')) val = val * 16 + (CUR - 'a') + 10; @@ -3062,7 +3062,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) { } else if ((CUR == '&') && (NXT(1) == '#')) { SKIP(2); while (CUR != ';') { - if ((CUR >= '0') && (CUR <= '9')) + if ((CUR >= '0') && (CUR <= '9')) val = val * 10 + (CUR - '0'); else { htmlParseErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, @@ -3098,7 +3098,7 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) { * * parse a DOCTYPE declaration * - * [28] doctypedecl ::= '' */ @@ -3231,7 +3231,7 @@ htmlCheckEncoding(htmlParserCtxtPtr ctxt, const xmlChar *attvalue) { if ((ctxt == NULL) || (attvalue == NULL)) return; - /* do not change encoding */ + /* do not change encoding */ if (ctxt->input->encoding != NULL) return; @@ -3335,7 +3335,7 @@ htmlCheckMeta(htmlParserCtxtPtr ctxt, const xmlChar **atts) { /** * htmlParseStartTag: * @ctxt: an HTML parser context - * + * * parse a start of tag either for rule element or * EmptyElement. In both case we don't parse the tag closing chars. * @@ -3405,7 +3405,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) { name, NULL); return 0; } - if ((ctxt->nameNr != 1) && + if ((ctxt->nameNr != 1) && (xmlStrEqual(name, BAD_CAST"head"))) { htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR, "htmlParseStartTag: misplaced tag\n", @@ -3433,7 +3433,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) { */ SKIP_BLANKS; while ((IS_CHAR_CH(CUR)) && - (CUR != '>') && + (CUR != '>') && ((CUR != '/') || (NXT(1) != '>'))) { long cons = ctxt->nbChars; @@ -3635,7 +3635,7 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt) /** * htmlParseReference: * @ctxt: an HTML parser context - * + * * parse and handle entity references in content, * this will end-up in a call to character() since this is either a * CharRef, or a predefined entity. @@ -3659,7 +3659,7 @@ htmlParseReference(htmlParserCtxtPtr ctxt) { else if (c < 0x800) { out[i++]=((c >> 6) & 0x1F) | 0xC0; bits= 0; } else if (c < 0x10000) { out[i++]=((c >> 12) & 0x0F) | 0xE0; bits= 6; } else { out[i++]=((c >> 18) & 0x07) | 0xF0; bits= 12; } - + for ( ; bits >= 0; bits-= 6) { out[i++]= ((c >> bits) & 0x3F) | 0x80; } @@ -3694,9 +3694,9 @@ htmlParseReference(htmlParserCtxtPtr ctxt) { { out[i++]=((c >> 6) & 0x1F) | 0xC0; bits= 0; } else if (c < 0x10000) { out[i++]=((c >> 12) & 0x0F) | 0xE0; bits= 6; } - else + else { out[i++]=((c >> 18) & 0x07) | 0xF0; bits= 12; } - + for ( ; bits >= 0; bits-= 6) { out[i++]= ((c >> bits) & 0x3F) | 0x80; } @@ -3798,7 +3798,7 @@ htmlParseContent(htmlParserCtxtPtr ctxt) { /* * Fourth case : a reference. If if has not been resolved, - * parsing returns it's Name, create the node + * parsing returns it's Name, create the node */ else if (CUR == '&') { htmlParseReference(ctxt); @@ -3903,10 +3903,10 @@ htmlParseElement(htmlParserCtxtPtr ctxt) { /* * end of parsing of this node. */ - if (xmlStrEqual(name, ctxt->name)) { + if (xmlStrEqual(name, ctxt->name)) { nodePop(ctxt); htmlnamePop(ctxt); - } + } /* * Capture end position and add node @@ -3940,8 +3940,8 @@ htmlParseElement(htmlParserCtxtPtr ctxt) { oldptr = ctxt->input->cur; htmlParseContent(ctxt); if (oldptr==ctxt->input->cur) break; - if (ctxt->nameNr < depth) break; - } + if (ctxt->nameNr < depth) break; + } /* * Capture end position and add node @@ -3964,7 +3964,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) { /** * htmlParseDocument: * @ctxt: an HTML parser context - * + * * parse an HTML document (and build a tree if using the standard SAX * interface). * @@ -3998,7 +3998,7 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { */ SKIP_BLANKS; if (CUR == 0) { - htmlParseErr(ctxt, XML_ERR_DOCUMENT_EMPTY, + htmlParseErr(ctxt, XML_ERR_DOCUMENT_EMPTY, "Document is empty\n", NULL, NULL); } @@ -4012,10 +4012,10 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { while (((CUR == '<') && (NXT(1) == '!') && (NXT(2) == '-') && (NXT(3) == '-')) || ((CUR == '<') && (NXT(1) == '?'))) { - htmlParseComment(ctxt); - htmlParsePI(ctxt); + htmlParseComment(ctxt); + htmlParsePI(ctxt); SKIP_BLANKS; - } + } /* @@ -4037,10 +4037,10 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { while (((CUR == '<') && (NXT(1) == '!') && (NXT(2) == '-') && (NXT(3) == '-')) || ((CUR == '<') && (NXT(1) == '?'))) { - htmlParseComment(ctxt); - htmlParsePI(ctxt); + htmlParseComment(ctxt); + htmlParsePI(ctxt); SKIP_BLANKS; - } + } /* * Time to start parsing the tree itself @@ -4063,8 +4063,8 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { if (ctxt->myDoc != NULL) { dtd = xmlGetIntSubset(ctxt->myDoc); if (dtd == NULL) - ctxt->myDoc->intSubset = - xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html", + ctxt->myDoc->intSubset = + xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html", BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN", BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd"); } @@ -4110,7 +4110,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt) memset(sax, 0, sizeof(htmlSAXHandler)); /* Allocate the Input stack */ - ctxt->inputTab = (htmlParserInputPtr *) + ctxt->inputTab = (htmlParserInputPtr *) xmlMalloc(5 * sizeof(htmlParserInputPtr)); if (ctxt->inputTab == NULL) { htmlErrMemory(NULL, "htmlInitParserCtxt: out of memory\n"); @@ -4306,7 +4306,7 @@ htmlCreateDocParserCtxt(xmlChar *cur, const char *encoding ATTRIBUTE_UNUSED) { xmlSwitchEncoding(ctxt, enc); if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) { htmlParseErr(ctxt, XML_ERR_UNSUPPORTED_ENCODING, - "Unsupported encoding %s\n", + "Unsupported encoding %s\n", (const xmlChar *) encoding, NULL); } } else { @@ -4411,7 +4411,7 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first, xmlGenericError(xmlGenericErrorContext, "HPP: lookup '%c%c' found at %d\n", first, next, base); - else + else xmlGenericError(xmlGenericErrorContext, "HPP: lookup '%c%c%c' found at %d\n", first, next, third, base); @@ -4427,7 +4427,7 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first, else if (third == 0) xmlGenericError(xmlGenericErrorContext, "HPP: lookup '%c%c' failed\n", first, next); - else + else xmlGenericError(xmlGenericErrorContext, "HPP: lookup '%c%c%c' failed\n", first, next, third); #endif @@ -4513,7 +4513,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { avail = in->buf->buffer->use - (in->cur - in->base); if ((avail == 0) && (terminate)) { htmlAutoCloseOnEnd(ctxt); - if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { + if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { /* * SAX: end of the document processing. */ @@ -4649,7 +4649,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { avail = in->length - (in->cur - in->base); else avail = in->buf->buffer->use - (in->cur - in->base); - if (avail < 2) + if (avail < 2) goto done; cur = in->cur[0]; next = in->cur[1]; @@ -4810,10 +4810,10 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { /* * end of parsing of this node. */ - if (xmlStrEqual(name, ctxt->name)) { + if (xmlStrEqual(name, ctxt->name)) { nodePop(ctxt); oldname = htmlnamePop(ctxt); - } + } ctxt->instate = XML_PARSER_CONTENT; #ifdef DEBUG_PUSH @@ -5124,10 +5124,10 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { } } -done: +done: if ((avail == 0) && (terminate)) { htmlAutoCloseOnEnd(ctxt); - if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { + if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { /* * SAX: end of the document processing. */ @@ -5142,8 +5142,8 @@ done: xmlDtdPtr dtd; dtd = xmlGetIntSubset(ctxt->myDoc); if (dtd == NULL) - ctxt->myDoc->intSubset = - xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html", + ctxt->myDoc->intSubset = + xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html", BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN", BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd"); } @@ -5176,8 +5176,8 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, (ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) { int base = ctxt->input->base - ctxt->input->buf->buffer->content; int cur = ctxt->input->cur - ctxt->input->base; - - xmlParserInputBufferPush(ctxt->input->buf, size, chunk); + + xmlParserInputBufferPush(ctxt->input->buf, size, chunk); ctxt->input->base = ctxt->input->buf->buffer->content + base; ctxt->input->cur = ctxt->input->base + cur; #ifdef DEBUG_PUSH @@ -5194,7 +5194,7 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, if ((in->encoder != NULL) && (in->buffer != NULL) && (in->raw != NULL)) { int nbchars; - + nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, @@ -5211,14 +5211,14 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, (ctxt->instate != XML_PARSER_MISC)) { ctxt->errNo = XML_ERR_DOCUMENT_END; ctxt->wellFormed = 0; - } + } if (ctxt->instate != XML_PARSER_EOF) { if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) ctxt->sax->endDocument(ctxt->userData); } ctxt->instate = XML_PARSER_EOF; } - return((xmlParserErrors) ctxt->errNo); + return((xmlParserErrors) ctxt->errNo); } /************************************************************************ @@ -5243,7 +5243,7 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, * Returns the new parser context or NULL */ htmlParserCtxtPtr -htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, +htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename, xmlCharEncoding enc) { htmlParserCtxtPtr ctxt; @@ -5274,7 +5274,7 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, memcpy(ctxt->sax, sax, sizeof(htmlSAXHandler)); if (user_data != NULL) ctxt->userData = user_data; - } + } if (filename == NULL) { ctxt->directory = NULL; } else { @@ -5296,17 +5296,17 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, inputStream->buf = buf; inputStream->base = inputStream->buf->buffer->content; inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = + inputStream->end = &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; inputPush(ctxt, inputStream); if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && - (ctxt->input->buf != NULL)) { + (ctxt->input->buf != NULL)) { int base = ctxt->input->base - ctxt->input->buf->buffer->content; int cur = ctxt->input->cur - ctxt->input->base; - xmlParserInputBufferPush(ctxt->input->buf, size, chunk); + xmlParserInputBufferPush(ctxt->input->buf, size, chunk); ctxt->input->base = ctxt->input->buf->buffer->content + base; ctxt->input->cur = ctxt->input->base + cur; @@ -5326,12 +5326,12 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, * @cur: a pointer to an array of xmlChar * @encoding: a free form C string describing the HTML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * Parse an HTML in-memory document. If sax is not NULL, use the SAX callbacks * to handle parse events. If sax is NULL, fallback to the default DOM * behavior and return a tree. - * + * * Returns the resulting document tree unless SAX is NULL or the document is * not well formed. */ @@ -5348,7 +5348,7 @@ htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void ctxt = htmlCreateDocParserCtxt(cur, encoding); if (ctxt == NULL) return(NULL); - if (sax != NULL) { + if (sax != NULL) { if (ctxt->sax != NULL) xmlFree (ctxt->sax); ctxt->sax = sax; ctxt->userData = userData; @@ -5361,7 +5361,7 @@ htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void ctxt->userData = NULL; } htmlFreeParserCtxt(ctxt); - + return(ret); } @@ -5371,7 +5371,7 @@ htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void * @encoding: a free form C string describing the HTML document encoding, or NULL * * parse an HTML in-memory document and build a tree. - * + * * Returns the resulting document tree */ @@ -5386,7 +5386,7 @@ htmlParseDoc(xmlChar *cur, const char *encoding) { * @filename: the filename * @encoding: a free form C string describing the HTML document encoding, or NULL * - * Create a parser context for a file content. + * Create a parser context for a file content. * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * @@ -5418,7 +5418,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding) xmlFreeParserCtxt(ctxt); return(NULL); } - + inputStream = xmlLoadExternalEntity(canonicFilename, NULL, ctxt); xmlFree(canonicFilename); if (inputStream == NULL) { @@ -5431,14 +5431,14 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding) /* set encoding */ if (encoding) { content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1); - if (content) { + if (content) { strcpy ((char *)content, (char *)content_line); strcat ((char *)content, (char *)encoding); htmlCheckEncoding (ctxt, content); xmlFree (content); } } - + return(ctxt); } @@ -5447,7 +5447,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding) * @filename: the filename * @encoding: a free form C string describing the HTML document encoding, or NULL * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. + * @userData: if using SAX, this pointer will be provided on callbacks. * * parse an HTML file and build a tree. Automatic support for ZLIB/Compress * compressed document is provided by default if found at compile-time. @@ -5459,7 +5459,7 @@ htmlCreateFileParserCtxt(const char *filename, const char *encoding) */ htmlDocPtr -htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr sax, +htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr sax, void *userData) { htmlDocPtr ret; htmlParserCtxtPtr ctxt; @@ -5483,7 +5483,7 @@ htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr s ctxt->userData = NULL; } htmlFreeParserCtxt(ctxt); - + return(ret); } @@ -5505,7 +5505,7 @@ htmlParseFile(const char *filename, const char *encoding) { /** * htmlHandleOmittedElem: - * @val: int 0 or 1 + * @val: int 0 or 1 * * Set and return the previous value for handling HTML omitted tags. * @@ -5660,7 +5660,7 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt) { xmlParserInputPtr input; xmlDictPtr dict; - + if (ctxt == NULL) return; @@ -5790,7 +5790,7 @@ htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options) * @reuse: keep the context for reuse * * Common front-end for the htmlRead functions - * + * * Returns the resulting document tree or NULL */ static htmlDocPtr @@ -5798,7 +5798,7 @@ htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding, int options, int reuse) { htmlDocPtr ret; - + htmlCtxtUseOptions(ctxt, options); ctxt->html = 1; if (encoding != NULL) { @@ -5832,7 +5832,7 @@ htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding, * @options: a combination of htmlParserOption(s) * * parse an XML in-memory document and build a tree. - * + * * Returns the resulting document tree */ htmlDocPtr @@ -5856,7 +5856,7 @@ htmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int opti * @options: a combination of htmlParserOption(s) * * parse an XML file from the filesystem or the network. - * + * * Returns the resulting document tree */ htmlDocPtr @@ -5879,7 +5879,7 @@ htmlReadFile(const char *filename, const char *encoding, int options) * @options: a combination of htmlParserOption(s) * * parse an XML in-memory document and build a tree. - * + * * Returns the resulting document tree */ htmlDocPtr @@ -5903,7 +5903,7 @@ htmlReadMemory(const char *buffer, int size, const char *URL, const char *encodi * @options: a combination of htmlParserOption(s) * * parse an XML from a file descriptor and build a tree. - * + * * Returns the resulting document tree */ htmlDocPtr @@ -5944,7 +5944,7 @@ htmlReadFd(int fd, const char *URL, const char *encoding, int options) * @options: a combination of htmlParserOption(s) * * parse an HTML document from I/O functions and source and build a tree. - * + * * Returns the resulting document tree */ htmlDocPtr @@ -5987,7 +5987,7 @@ htmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, * * parse an XML in-memory document and build a tree. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ htmlDocPtr @@ -6020,7 +6020,7 @@ htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur, * * parse an XML file from the filesystem or the network. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ htmlDocPtr @@ -6055,7 +6055,7 @@ htmlCtxtReadFile(htmlParserCtxtPtr ctxt, const char *filename, * * parse an XML in-memory document and build a tree. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ htmlDocPtr @@ -6097,7 +6097,7 @@ htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size, * * parse an XML from a file descriptor and build a tree. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ htmlDocPtr @@ -6139,7 +6139,7 @@ htmlCtxtReadFd(htmlParserCtxtPtr ctxt, int fd, * * parse an HTML document from I/O functions and source and build a tree. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ htmlDocPtr diff --git a/reactos/lib/3rdparty/libxml2/HTMLtree.c b/reactos/lib/3rdparty/libxml2/HTMLtree.c index de086db4618..ab3888a8af0 100644 --- a/reactos/lib/3rdparty/libxml2/HTMLtree.c +++ b/reactos/lib/3rdparty/libxml2/HTMLtree.c @@ -39,7 +39,7 @@ /** * htmlGetMetaEncoding: * @doc: the document - * + * * Encoding definition lookup in the Meta tags * * Returns the current encoding as flagged in the HTML source @@ -126,17 +126,17 @@ found_meta: found_content: encoding = xmlStrstr(content, BAD_CAST"charset="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"Charset="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"CHARSET="); if (encoding != NULL) { encoding += 8; } else { encoding = xmlStrstr(content, BAD_CAST"charset ="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"Charset ="); - if (encoding == NULL) + if (encoding == NULL) encoding = xmlStrstr(content, BAD_CAST"CHARSET ="); if (encoding != NULL) encoding += 9; @@ -151,7 +151,7 @@ found_content: * htmlSetMetaEncoding: * @doc: the document * @encoding: the encoding string - * + * * Sets the current encoding in the Meta tags * NOTE: this will not change the document content encoding, just * the META flag associated. @@ -253,9 +253,9 @@ found_meta: if ((!xmlStrcasecmp(attr->name, BAD_CAST"http-equiv")) && (!xmlStrcasecmp(value, BAD_CAST"Content-Type"))) http = 1; - else + else { - if ((value != NULL) && + if ((value != NULL) && (!xmlStrcasecmp(attr->name, BAD_CAST"content"))) content = value; } @@ -299,7 +299,7 @@ static const char* htmlBooleanAttrs[] = { * @name: the name of the attribute to check * * Determine if a given attribute is a boolean attribute. - * + * * returns: false if the attribute is not boolean, true otherwise. */ int @@ -479,7 +479,7 @@ htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc, if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFile(out, handler); @@ -596,7 +596,7 @@ void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur); * @buf: the HTML buffer output * @doc: the document * @encoding: the encoding string - * + * * TODO: check whether encoding is needed * * Dump the HTML document DTD, if any. @@ -618,7 +618,7 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, if (cur->SystemID != NULL) { xmlOutputBufferWriteString(buf, " "); xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); - } + } } else if (cur->SystemID != NULL) { xmlOutputBufferWriteString(buf, " SYSTEM "); xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); @@ -1063,7 +1063,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { if ((cur == NULL) || (filename == NULL)) return(-1); - + xmlInitParser(); encoding = (const char *) htmlGetMetaEncoding(cur); @@ -1094,7 +1094,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); @@ -1114,7 +1114,7 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) { * @encoding: the document encoding * * Dump an HTML document to a file using a given encoding. - * + * * returns: the number of byte written or -1 in case of failure. */ int @@ -1126,7 +1126,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, if ((cur == NULL) || (filename == NULL)) return(-1); - + xmlInitParser(); if (encoding != NULL) { @@ -1158,7 +1158,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, if (handler == NULL) handler = xmlFindCharEncodingHandler("ascii"); - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, 0); @@ -1178,7 +1178,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur, * * Dump an HTML document to a file using a given encoding * and formatting returns/spaces are added. - * + * * returns: the number of byte written or -1 in case of failure. */ int diff --git a/reactos/lib/3rdparty/libxml2/SAX.c b/reactos/lib/3rdparty/libxml2/SAX.c index 8e5d460cb96..292af57e97b 100644 --- a/reactos/lib/3rdparty/libxml2/SAX.c +++ b/reactos/lib/3rdparty/libxml2/SAX.c @@ -41,7 +41,7 @@ void initxmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr, int warning) { - + if(hdlr->initialized == 1) return; diff --git a/reactos/lib/3rdparty/libxml2/SAX2.c b/reactos/lib/3rdparty/libxml2/SAX2.c index 16e361f9137..0f1e5b52e6f 100644 --- a/reactos/lib/3rdparty/libxml2/SAX2.c +++ b/reactos/lib/3rdparty/libxml2/SAX2.c @@ -114,7 +114,7 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, if (ctxt != NULL) ctxt->errNo = error; __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, - XML_ERR_FATAL, NULL, 0, + XML_ERR_FATAL, NULL, 0, (const char *) str1, (const char *) str2, NULL, 0, 0, msg, str1, str2); if (ctxt != NULL) { @@ -145,7 +145,7 @@ xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, if (ctxt != NULL) ctxt->errNo = error; __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, - XML_ERR_WARNING, NULL, 0, + XML_ERR_WARNING, NULL, 0, (const char *) str1, NULL, NULL, 0, 0, msg, str1); } @@ -170,7 +170,7 @@ xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, if (ctxt != NULL) ctxt->errNo = error; __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, - XML_ERR_ERROR, NULL, 0, + XML_ERR_ERROR, NULL, 0, (const char *) str1, (const char *) str2, NULL, 0, 0, msg, str1, str2); } @@ -194,7 +194,7 @@ xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, if (ctxt != NULL) ctxt->errNo = error; __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, - XML_ERR_WARNING, NULL, 0, + XML_ERR_WARNING, NULL, 0, (const char *) str1, (const char *) str2, NULL, 0, 0, msg, str1, str2); } @@ -228,7 +228,7 @@ xmlSAX2GetSystemId(void *ctx) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; if ((ctx == NULL) || (ctxt->input == NULL)) return(0); - return((const xmlChar *) ctxt->input->filename); + return((const xmlChar *) ctxt->input->filename); } /** @@ -343,7 +343,7 @@ xmlSAX2InternalSubset(void *ctx, const xmlChar *name, xmlFreeDtd(dtd); ctxt->myDoc->intSubset = NULL; } - ctxt->myDoc->intSubset = + ctxt->myDoc->intSubset = xmlCreateIntSubset(ctxt->myDoc, name, ExternalID, SystemID); if (ctxt->myDoc->intSubset == NULL) xmlSAX2ErrMemory(ctxt, "xmlSAX2InternalSubset"); @@ -607,8 +607,8 @@ xmlSAX2GetParameterEntity(void *ctx, const xmlChar *name) /** * xmlSAX2EntityDecl: * @ctx: the user data (XML parser context) - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -643,7 +643,7 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, base = ctxt->input->filename; if (base == NULL) base = ctxt->directory; - + URI = xmlBuildURI(systemId, (const xmlChar *) base); ent->URI = URI; } @@ -652,7 +652,7 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, systemId, content); if ((ent == NULL) && (ctxt->pedantic) && (ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, + ctxt->sax->warning(ctxt->userData, "Entity(%s) already defined in the external subset\n", name); if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) { xmlChar *URI; @@ -662,7 +662,7 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, base = ctxt->input->filename; if (base == NULL) base = ctxt->directory; - + URI = xmlBuildURI(systemId, (const xmlChar *) base); ent->URI = URI; } @@ -677,8 +677,8 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type, * xmlSAX2AttributeDecl: * @ctx: the user data (XML parser context) * @elem: the name of the element - * @fullname: the attribute name - * @type: the attribute type + * @fullname: the attribute name + * @type: the attribute type * @def: the type of default value * @defaultValue: the attribute default value * @tree: the tree of enumerated value set @@ -719,7 +719,7 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, (xmlAttributeDefault) def, defaultValue, tree); else if (ctxt->inSubset == 2) attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem, - name, prefix, (xmlAttributeType) type, + name, prefix, (xmlAttributeType) type, (xmlAttributeDefault) def, defaultValue, tree); else { xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR, @@ -745,8 +745,8 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, /** * xmlSAX2ElementDecl: * @ctx: the user data (XML parser context) - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value tree * * An element definition has been parsed @@ -863,7 +863,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, publicId, systemId, notationName); if ((ent == NULL) && (ctxt->pedantic) && (ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, + ctxt->sax->warning(ctxt->userData, "Entity(%s) already defined in the internal subset\n", name); if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) { xmlChar *URI; @@ -873,7 +873,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, base = ctxt->input->filename; if (base == NULL) base = ctxt->directory; - + URI = xmlBuildURI(systemId, (const xmlChar *) base); ent->URI = URI; } @@ -883,7 +883,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, publicId, systemId, notationName); if ((ent == NULL) && (ctxt->pedantic) && (ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, + ctxt->sax->warning(ctxt->userData, "Entity(%s) already defined in the external subset\n", name); if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) { xmlChar *URI; @@ -893,7 +893,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name, base = ctxt->input->filename; if (base == NULL) base = ctxt->directory; - + URI = xmlBuildURI(systemId, (const xmlChar *) base); ent->URI = URI; } @@ -1116,12 +1116,12 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, uri = xmlParseURI((const char *)val); if (uri == NULL) { if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, + ctxt->sax->warning(ctxt->userData, "xmlns: %s not a valid URI\n", val); } else { if (uri->scheme == NULL) { if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, + ctxt->sax->warning(ctxt->userData, "xmlns: URI %s is not absolute\n", val); } xmlFreeURI(uri); @@ -1141,7 +1141,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc, ctxt->node, prefix, nsret, val); #endif /* LIBXML_VALID_ENABLED */ - if (name != NULL) + if (name != NULL) xmlFree(name); if (nval != NULL) xmlFree(nval); @@ -1163,7 +1163,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, if (val == NULL) { xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElement"); xmlFree(ns); - if (name != NULL) + if (name != NULL) xmlFree(name); return; } @@ -1204,7 +1204,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc, ctxt->node, prefix, nsret, value); #endif /* LIBXML_VALID_ENABLED */ - if (name != NULL) + if (name != NULL) xmlFree(name); if (nval != NULL) xmlFree(nval); @@ -1268,7 +1268,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, #ifdef LIBXML_VALID_ENABLED if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed && ctxt->myDoc && ctxt->myDoc->intSubset) { - + /* * If we don't substitute entities, the validation should be * done on a value with replaced entities anyway. @@ -1280,7 +1280,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, val = xmlStringDecodeEntities(ctxt, value, XML_SUBSTITUTE_REF, 0,0,0); ctxt->depth--; - + if (val == NULL) ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc, ctxt->node, ret, value); @@ -1338,7 +1338,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, error: if (nval != NULL) xmlFree(nval); - if (ns != NULL) + if (ns != NULL) xmlFree(ns); } @@ -1432,7 +1432,7 @@ process_external_subset: * - this is a namespace prefix * - the user required for completion in the tree * like XSLT - * - there isn't already an attribute definition + * - there isn't already an attribute definition * in the internal subset overriding it. */ if (((attr->prefix != NULL) && @@ -1521,17 +1521,17 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) /* * First check on validity: */ - if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) && + if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) && ((ctxt->myDoc->intSubset == NULL) || - ((ctxt->myDoc->intSubset->notations == NULL) && + ((ctxt->myDoc->intSubset->notations == NULL) && (ctxt->myDoc->intSubset->elements == NULL) && - (ctxt->myDoc->intSubset->attributes == NULL) && + (ctxt->myDoc->intSubset->attributes == NULL) && (ctxt->myDoc->intSubset->entities == NULL)))) { xmlErrValid(ctxt, XML_ERR_NO_DTD, "Validation failed: no DTD found !", NULL, NULL); ctxt->validate = 0; } - + /* * Split the full name into a namespace prefix and the tag name @@ -1635,7 +1635,7 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) if ((prefix != NULL) && (ns == NULL)) { ns = xmlNewNs(ret, NULL, prefix); if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, + ctxt->sax->warning(ctxt->userData, "Namespace prefix %s is not defined\n", prefix); } @@ -1720,7 +1720,7 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) else xmlGenericError(xmlGenericErrorContext, "SAX.xmlSAX2EndElement(%s)\n", name); #endif - + /* Capture end position and add node */ if (cur != NULL && ctxt->record_info) { node_info.end_pos = ctxt->input->cur - ctxt->input->base; @@ -1737,7 +1737,7 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) cur); #endif /* LIBXML_VALID_ENABLED */ - + /* * end of parsing of this node. */ @@ -1753,7 +1753,7 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) * @ctxt: the parser context * @str: the input string * @len: the string length - * + * * Remove the entities from an attribute value * * Returns the newly allocated string or NULL if not needed or error @@ -1823,7 +1823,7 @@ skip: * @ctxt: the parser context * @str: the input string * @len: the string length - * + * * Remove the entities from an attribute value * * Returns the newly allocated string or NULL if not needed or error @@ -1889,7 +1889,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, memset(ret, 0, sizeof(xmlAttr)); ret->type = XML_ATTRIBUTE_NODE; - ret->parent = ctxt->node; + ret->parent = ctxt->node; ret->doc = ctxt->myDoc; ret->ns = namespace; @@ -1913,7 +1913,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, xmlRegisterNodeDefaultValue((xmlNodePtr)ret); } else { if (ctxt->dictNames) - ret = xmlNewNsPropEatName(ctxt->node, namespace, + ret = xmlNewNsPropEatName(ctxt->node, namespace, (xmlChar *) localname, NULL); else ret = xmlNewNsProp(ctxt->node, namespace, localname, NULL); @@ -1999,7 +1999,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt, xmlChar *nvalnorm; xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(localname, prefix, fn, 50); if (fullname != NULL) { ctxt->vctxt.valid = 1; @@ -2113,11 +2113,11 @@ xmlSAX2StartElementNs(void *ctx, /* * First check on validity: */ - if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) && + if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) && ((ctxt->myDoc->intSubset == NULL) || - ((ctxt->myDoc->intSubset->notations == NULL) && + ((ctxt->myDoc->intSubset->notations == NULL) && (ctxt->myDoc->intSubset->elements == NULL) && - (ctxt->myDoc->intSubset->attributes == NULL) && + (ctxt->myDoc->intSubset->attributes == NULL) && (ctxt->myDoc->intSubset->entities == NULL)))) { xmlErrValid(ctxt, XML_ERR_NO_DTD, "Validation failed: no DTD found !", NULL, NULL); @@ -2147,7 +2147,7 @@ xmlSAX2StartElementNs(void *ctx, xmlRegisterNodeDefaultValue(ret); } else { if (ctxt->dictNames) - ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, + ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, (xmlChar *) localname, NULL); else ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL); @@ -2234,7 +2234,7 @@ xmlSAX2StartElementNs(void *ctx, return; } if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) - ctxt->sax->warning(ctxt->userData, + ctxt->sax->warning(ctxt->userData, "Namespace prefix %s was not found\n", prefix); } } @@ -2316,7 +2316,7 @@ xmlSAX2EndElementNs(void *ctx, * @ctx: the user data (XML parser context) * @name: The entity name * - * called when an entity xmlSAX2Reference is detected. + * called when an entity xmlSAX2Reference is detected. */ void xmlSAX2Reference(void *ctx, const xmlChar *name) diff --git a/reactos/lib/3rdparty/libxml2/c14n.c b/reactos/lib/3rdparty/libxml2/c14n.c index 32c70045ba3..73498b9d8f2 100644 --- a/reactos/lib/3rdparty/libxml2/c14n.c +++ b/reactos/lib/3rdparty/libxml2/c14n.c @@ -1,12 +1,12 @@ /* - * "Canonical XML" implementation + * "Canonical XML" implementation * http://www.w3.org/TR/xml-c14n - * + * * "Exclusive XML Canonicalization" implementation * http://www.w3.org/TR/xml-exc-c14n * * See Copyright for the status of this software. - * + * * Author: Aleksey Sanin */ #define IN_LIBXML @@ -44,7 +44,7 @@ typedef struct _xmlC14NVisibleNsStack { int nsPrevStart; /* the begginning of the stack for previous visible node */ int nsPrevEnd; /* the end of the stack for previous visible node */ int nsMax; /* size of the array as allocated */ - xmlNsPtr *nsTab; /* array of ns in no particular order */ + xmlNsPtr *nsTab; /* array of ns in no particular order */ xmlNodePtr *nodeTab; /* array of nodes in no particular order */ } xmlC14NVisibleNsStack, *xmlC14NVisibleNsStackPtr; @@ -52,7 +52,7 @@ typedef struct _xmlC14NCtx { /* input parameters */ xmlDocPtr doc; xmlC14NIsVisibleCallback is_visible_callback; - void* user_data; + void* user_data; int with_comments; xmlOutputBufferPtr buf; @@ -71,7 +71,7 @@ typedef struct _xmlC14NCtx { static xmlC14NVisibleNsStackPtr xmlC14NVisibleNsStackCreate (void); static void xmlC14NVisibleNsStackDestroy (xmlC14NVisibleNsStackPtr cur); -static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node); static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur, @@ -79,9 +79,9 @@ static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur, static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state); static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur); -static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, +static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns); -static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, +static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx); @@ -244,25 +244,25 @@ xmlC14NErr(xmlC14NCtxPtr ctxt, xmlNodePtr node, int error, ************************************************************************/ #define XML_NAMESPACES_DEFAULT 16 -static int +static int xmlC14NIsNodeInNodeset(xmlNodeSetPtr nodes, xmlNodePtr node, xmlNodePtr parent) { if((nodes != NULL) && (node != NULL)) { if(node->type != XML_NAMESPACE_DECL) { return(xmlXPathNodeSetContains(nodes, node)); } else { xmlNs ns; - - memcpy(&ns, node, sizeof(ns)); - + + memcpy(&ns, node, sizeof(ns)); + /* this is a libxml hack! check xpath.c for details */ if((parent != NULL) && (parent->type == XML_ATTRIBUTE_NODE)) { ns.next = (xmlNsPtr)parent->parent; } else { - ns.next = (xmlNsPtr)parent; + ns.next = (xmlNsPtr)parent; } - /* - * If the input is an XPath node-set, then the node-set must explicitly + /* + * If the input is an XPath node-set, then the node-set must explicitly * contain every node to be rendered to the canonical form. */ return(xmlXPathNodeSetContains(nodes, (xmlNodePtr)&ns)); @@ -300,12 +300,12 @@ xmlC14NVisibleNsStackDestroy(xmlC14NVisibleNsStackPtr cur) { } memset(cur, 0, sizeof(xmlC14NVisibleNsStack)); xmlFree(cur); - + } -static void +static void xmlC14NVisibleNsStackAdd(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node) { - if((cur == NULL) || + if((cur == NULL) || ((cur->nsTab == NULL) && (cur->nodeTab != NULL)) || ((cur->nsTab != NULL) && (cur->nodeTab == NULL))) { xmlC14NErrParam("adding namespace to stack"); @@ -323,9 +323,9 @@ xmlC14NVisibleNsStackAdd(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr n memset(cur->nodeTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr)); cur->nsMax = XML_NAMESPACES_DEFAULT; } else if(cur->nsMax == cur->nsCurEnd) { - void *tmp; + void *tmp; int tmpSize; - + tmpSize = 2 * cur->nsMax; tmp = xmlRealloc(cur->nsTab, tmpSize * sizeof(xmlNsPtr)); if (tmp == NULL) { @@ -355,7 +355,7 @@ xmlC14NVisibleNsStackSave(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr xmlC14NErrParam("saving namespaces stack"); return; } - + state->nsCurEnd = cur->nsCurEnd; state->nsPrevStart = cur->nsPrevStart; state->nsPrevEnd = cur->nsPrevEnd; @@ -372,7 +372,7 @@ xmlC14NVisibleNsStackRestore(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStack cur->nsPrevEnd = state->nsPrevEnd; } -static void +static void xmlC14NVisibleNsStackShift(xmlC14NVisibleNsStackPtr cur) { if(cur == NULL) { xmlC14NErrParam("shifting namespaces stack"); @@ -395,7 +395,7 @@ xmlC14NStrEqual(const xmlChar *str1, const xmlChar *str2) { /** * xmlC14NVisibleNsStackFind: - * @ctx: the C14N context + * @ctx: the C14N context * @ns: the namespace to check * * Checks whether the given namespace was already rendered or not @@ -409,14 +409,14 @@ xmlC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns) const xmlChar *prefix; const xmlChar *href; int has_empty_ns; - + if(cur == NULL) { xmlC14NErrParam("searching namespaces stack (c14n)"); return (0); } /* - * if the default namespace xmlns="" is not defined yet then + * if the default namespace xmlns="" is not defined yet then * we do not want to print it out */ prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix; @@ -427,7 +427,7 @@ xmlC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns) int start = (has_empty_ns) ? 0 : cur->nsPrevStart; for (i = cur->nsCurEnd - 1; i >= start; --i) { xmlNsPtr ns1 = cur->nsTab[i]; - + if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) { return(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)); } @@ -436,20 +436,20 @@ xmlC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns) return(has_empty_ns); } -static int +static int xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx) { int i; const xmlChar *prefix; const xmlChar *href; int has_empty_ns; - + if(cur == NULL) { xmlC14NErrParam("searching namespaces stack (exc c14n)"); return (0); } /* - * if the default namespace xmlns="" is not defined yet then + * if the default namespace xmlns="" is not defined yet then * we do not want to print it out */ prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix; @@ -460,7 +460,7 @@ xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NC int start = 0; for (i = cur->nsCurEnd - 1; i >= start; --i) { xmlNsPtr ns1 = cur->nsTab[i]; - + if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) { if(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)) { return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i])); @@ -479,7 +479,7 @@ xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NC /** * xmlC14NIsXmlNs: * @ns: the namespace to check - * + * * Checks whether the given namespace is a default "xml:" namespace * with href="http://www.w3.org/XML/1998/namespace" * @@ -559,35 +559,35 @@ xmlC14NPrintNamespaces(const xmlNsPtr ns, xmlC14NCtxPtr ctx) * @node: the current node * * Prints out canonical namespace axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * * Namespace Axis - * Consider a list L containing only namespace nodes in the - * axis and in the node-set in lexicographic order (ascending). To begin - * processing L, if the first node is not the default namespace node (a node - * with no namespace URI and no local name), then generate a space followed + * Consider a list L containing only namespace nodes in the + * axis and in the node-set in lexicographic order (ascending). To begin + * processing L, if the first node is not the default namespace node (a node + * with no namespace URI and no local name), then generate a space followed * by xmlns="" if and only if the following conditions are met: * - the element E that owns the axis is in the node-set - * - The nearest ancestor element of E in the node-set has a default - * namespace node in the node-set (default namespace nodes always + * - The nearest ancestor element of E in the node-set has a default + * namespace node in the node-set (default namespace nodes always * have non-empty values in XPath) - * The latter condition eliminates unnecessary occurrences of xmlns="" in - * the canonical form since an element only receives an xmlns="" if its - * default namespace is empty and if it has an immediate parent in the - * canonical form that has a non-empty default namespace. To finish - * processing L, simply process every namespace node in L, except omit - * namespace node with local name xml, which defines the xml prefix, + * The latter condition eliminates unnecessary occurrences of xmlns="" in + * the canonical form since an element only receives an xmlns="" if its + * default namespace is empty and if it has an immediate parent in the + * canonical form that has a non-empty default namespace. To finish + * processing L, simply process every namespace node in L, except omit + * namespace node with local name xml, which defines the xml prefix, * if its string value is http://www.w3.org/XML/1998/namespace. * * Exclusive XML Canonicalization v 1.0 (http://www.w3.org/TR/xml-exc-c14n) - * Canonical XML applied to a document subset requires the search of the - * ancestor nodes of each orphan element node for attributes in the xml - * namespace, such as xml:lang and xml:space. These are copied into the - * element node except if a declaration of the same attribute is already - * in the attribute axis of the element (whether or not it is included in - * the document subset). This search and copying are omitted from the + * Canonical XML applied to a document subset requires the search of the + * ancestor nodes of each orphan element node for attributes in the xml + * namespace, such as xml:lang and xml:space. These are copied into the + * element node except if a declaration of the same attribute is already + * in the attribute axis of the element (whether or not it is included in + * the document subset). This search and copying are omitted from the * Exclusive XML Canonicalization method. * * Returns 0 on success or -1 on fail. @@ -600,7 +600,7 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) xmlListPtr list; int already_rendered; int has_empty_ns = 0; - + if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { xmlC14NErrParam("processing namespaces axis (c14n)"); return (-1); @@ -619,14 +619,14 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) for(n = cur; n != NULL; n = n->parent) { for(ns = n->nsDef; ns != NULL; ns = ns->next) { tmp = xmlSearchNs(cur->doc, cur, ns->prefix); - + if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); if(visible) { xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(!already_rendered) { - xmlListInsert(list, ns); + xmlListInsert(list, ns); } if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; @@ -634,14 +634,14 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) } } } - + /** - * if the first node is not the default namespace node (a node with no - * namespace URI and no local name), then generate a space followed by + * if the first node is not the default namespace node (a node with no + * namespace URI and no local name), then generate a space followed by * xmlns="" if and only if the following conditions are met: * - the element E that owns the axis is in the node-set - * - the nearest ancestor element of E in the node-set has a default - * namespace node in the node-set (default namespace nodes always + * - the nearest ancestor element of E in the node-set has a default + * namespace node in the node-set (default namespace nodes always * have non-empty values in XPath) */ if(visible && !has_empty_ns) { @@ -652,14 +652,14 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) xmlC14NPrintNamespaces(&ns_default, ctx); } } - - - /* - * print out all elements from list + + + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintNamespaces, (const void *) ctx); - /* + /* * Cleanup */ xmlListDelete(list); @@ -673,24 +673,24 @@ xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) * @node: the current node * * Prints out exclusive canonical namespace axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Exclusive XML Canonicalization * http://www.w3.org/TR/xml-exc-c14n * - * If the element node is in the XPath subset then output the node in - * accordance with Canonical XML except for namespace nodes which are + * If the element node is in the XPath subset then output the node in + * accordance with Canonical XML except for namespace nodes which are * rendered as follows: * * 1. Render each namespace node iff: - * * it is visibly utilized by the immediate parent element or one of + * * it is visibly utilized by the immediate parent element or one of * its attributes, or is present in InclusiveNamespaces PrefixList, and - * * its prefix and value do not appear in ns_rendered. ns_rendered is - * obtained by popping the state stack in order to obtain a list of - * prefixes and their values which have already been rendered by + * * its prefix and value do not appear in ns_rendered. ns_rendered is + * obtained by popping the state stack in order to obtain a list of + * prefixes and their values which have already been rendered by * an output ancestor of the namespace node's parent element. - * 2. Append the rendered namespace node to the list ns_rendered of namespace - * nodes rendered by output ancestors. Push ns_rendered on state stack and + * 2. Append the rendered namespace node to the list ns_rendered of namespace + * nodes rendered by output ancestors. Push ns_rendered on state stack and * recurse. * 3. After the recursion returns, pop thestate stack. * @@ -707,7 +707,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) int has_empty_ns = 0; int has_visibly_utilized_empty_ns = 0; int has_empty_ns_in_inclusive_list = 0; - + if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { xmlC14NErrParam("processing namespaces axis (exc c14n)"); return (-1); @@ -728,15 +728,15 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) return (-1); } - /* + /* * process inclusive namespaces: - * All namespace nodes appearing on inclusive ns list are + * All namespace nodes appearing on inclusive ns list are * handled as provided in Canonical XML */ if(ctx->inclusive_ns_prefixes != NULL) { - xmlChar *prefix; + xmlChar *prefix; int i; - + for (i = 0; ctx->inclusive_ns_prefixes[i] != NULL; ++i) { prefix = ctx->inclusive_ns_prefixes[i]; /* @@ -747,15 +747,15 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) prefix = NULL; has_empty_ns_in_inclusive_list = 1; } - - ns = xmlSearchNs(cur->doc, cur, prefix); + + ns = xmlSearchNs(cur->doc, cur, prefix); if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); if(visible) { xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(!already_rendered) { - xmlListInsert(list, ns); + xmlListInsert(list, ns); } if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; @@ -763,7 +763,7 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) } } } - + /* add node namespace */ if(cur->ns != NULL) { ns = cur->ns; @@ -772,32 +772,32 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) has_visibly_utilized_empty_ns = 1; } if((ns != NULL) && !xmlC14NIsXmlNs(ns)) { - if(visible && xmlC14NIsVisible(ctx, ns, cur)) { + if(visible && xmlC14NIsVisible(ctx, ns, cur)) { if(!xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, ns, ctx)) { xmlListInsert(list, ns); } } if(visible) { - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; } } - - + + /* add attributes */ for(attr = cur->properties; attr != NULL; attr = attr->next) { - /* + /* * we need to check that attribute is visible and has non - * default namespace (XML Namespaces: "default namespaces - * do not apply directly to attributes") + * default namespace (XML Namespaces: "default namespaces + * do not apply directly to attributes") */ if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) { already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, attr->ns, ctx); - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur); if(!already_rendered && visible) { - xmlListInsert(list, attr->ns); + xmlListInsert(list, attr->ns); } if(xmlStrlen(attr->ns->prefix) == 0) { has_empty_ns = 1; @@ -810,12 +810,12 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) /* * Process xmlns="" */ - if(visible && has_visibly_utilized_empty_ns && + if(visible && has_visibly_utilized_empty_ns && !has_empty_ns && !has_empty_ns_in_inclusive_list) { static xmlNs ns_default; memset(&ns_default, 0, sizeof(ns_default)); - + already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default, ctx); if(!already_rendered) { xmlC14NPrintNamespaces(&ns_default, ctx); @@ -829,14 +829,14 @@ xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) } } - - /* - * print out all elements from list + + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintNamespaces, (const void *) ctx); - /* + /* * Cleanup */ xmlListDelete(list); @@ -871,7 +871,7 @@ xmlC14NAttrsCompare(xmlAttrPtr attr1, xmlAttrPtr attr2) return (xmlStrcmp(attr1->name, attr2->name)); } - /* + /* * Attributes in the default namespace are first * because the default namespace is not applied to * unqualified attributes @@ -899,7 +899,7 @@ xmlC14NAttrsCompare(xmlAttrPtr attr1, xmlAttrPtr attr2) * @ctx: the C14N context * * Prints out canonical attribute urrent node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * @@ -949,27 +949,27 @@ xmlC14NPrintAttrs(const xmlAttrPtr attr, xmlC14NCtxPtr ctx) * @parent_visible: the visibility of parent node * * Prints out canonical attribute axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * - * Attribute Axis - * In lexicographic order (ascending), process each node that + * Attribute Axis + * In lexicographic order (ascending), process each node that * is in the element's attribute axis and in the node-set. - * - * The processing of an element node E MUST be modified slightly - * when an XPath node-set is given as input and the element's + * + * The processing of an element node E MUST be modified slightly + * when an XPath node-set is given as input and the element's * parent is omitted from the node-set. * * * Exclusive XML Canonicalization v 1.0 (http://www.w3.org/TR/xml-exc-c14n) * - * Canonical XML applied to a document subset requires the search of the - * ancestor nodes of each orphan element node for attributes in the xml - * namespace, such as xml:lang and xml:space. These are copied into the - * element node except if a declaration of the same attribute is already - * in the attribute axis of the element (whether or not it is included in - * the document subset). This search and copying are omitted from the + * Canonical XML applied to a document subset requires the search of the + * ancestor nodes of each orphan element node for attributes in the xml + * namespace, such as xml:lang and xml:space. These are copied into the + * element node except if a declaration of the same attribute is already + * in the attribute axis of the element (whether or not it is included in + * the document subset). This search and copying are omitted from the * Exclusive XML Canonicalization method. * * Returns 0 on success or -1 on fail. @@ -994,8 +994,8 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) return (-1); } - /* - * Add all visible attributes from current node. + /* + * Add all visible attributes from current node. */ attr = cur->properties; while (attr != NULL) { @@ -1006,14 +1006,14 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) attr = attr->next; } - /* + /* * include attributes in "xml" namespace defined in ancestors * (only for non-exclusive XML Canonicalization) */ if (parent_visible && (!ctx->exclusive) && (cur->parent != NULL) && (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) { /* - * If XPath node-set is not specified then the parent is always + * If XPath node-set is not specified then the parent is always * visible! */ cur = cur->parent; @@ -1032,19 +1032,19 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) } } - /* - * print out all elements from list + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintAttrs, (const void *) ctx); - /* + /* * Cleanup */ xmlListDelete(list); return (0); } -/** +/** * xmlC14NCheckForRelativeNamespaces: * @ctx: the C14N context * @cur: the current element node @@ -1096,19 +1096,19 @@ xmlC14NCheckForRelativeNamespaces(xmlC14NCtxPtr ctx, xmlNodePtr cur) * xmlC14NProcessElementNode: * @ctx: the pointer to C14N context object * @cur: the node to process - * + * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * * Element Nodes - * If the element is not in the node-set, then the result is obtained - * by processing the namespace axis, then the attribute axis, then - * processing the child nodes of the element that are in the node-set - * (in document order). If the element is in the node-set, then the result - * is an open angle bracket (<), the element QName, the result of - * processing the namespace axis, the result of processing the attribute - * axis, a close angle bracket (>), the result of processing the child - * nodes of the element that are in the node-set (in document order), an - * open angle bracket, a forward slash (/), the element QName, and a close + * If the element is not in the node-set, then the result is obtained + * by processing the namespace axis, then the attribute axis, then + * processing the child nodes of the element that are in the node-set + * (in document order). If the element is in the node-set, then the result + * is an open angle bracket (<), the element QName, the result of + * processing the namespace axis, the result of processing the attribute + * axis, a close angle bracket (>), the result of processing the child + * nodes of the element that are in the node-set (in document order), an + * open angle bracket, a forward slash (/), the element QName, and a close * angle bracket. * * Returns non-negative value on success or negative value on fail @@ -1125,7 +1125,7 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) return (-1); } - /* + /* * Check relative relative namespaces: * implementations of XML canonicalization MUST report an operation * failure on documents containing relative namespace URIs. @@ -1136,12 +1136,12 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) } - /* + /* * Save ns_rendered stack position */ xmlC14NVisibleNsStackSave(ctx->ns_rendered, &state); - if (visible) { + if (visible) { if (ctx->parent_is_doc) { /* save this flag into the stack */ parent_is_doc = ctx->parent_is_doc; @@ -1171,14 +1171,14 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) if(visible) { xmlC14NVisibleNsStackShift(ctx->ns_rendered); } - + ret = xmlC14NProcessAttrsAxis(ctx, cur, visible); if (ret < 0) { xmlC14NErrInternal("processing attributes axis"); return (-1); } - if (visible) { + if (visible) { xmlOutputBufferWriteString(ctx->buf, ">"); } if (cur->children != NULL) { @@ -1204,7 +1204,7 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) } } - /* + /* * Restore ns_rendered stack position */ xmlC14NVisibleNsStackRestore(ctx->ns_rendered, &state); @@ -1215,7 +1215,7 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) * xmlC14NProcessNode: * @ctx: the pointer to C14N context object * @cur: the node to process - * + * * Processes the given node * * Returns non-negative value on success or negative value on fail @@ -1240,9 +1240,9 @@ xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur) case XML_TEXT_NODE: /* * Text Nodes - * the string value, except all ampersands are replaced - * by &, all open angle brackets (<) are replaced by <, all closing - * angle brackets (>) are replaced by >, and all #xD characters are + * the string value, except all ampersands are replaced + * by &, all open angle brackets (<) are replaced by <, all closing + * angle brackets (>) are replaced by >, and all #xD characters are * replaced by . */ /* cdata sections are processed as text nodes */ @@ -1262,16 +1262,16 @@ xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur) } break; case XML_PI_NODE: - /* - * Processing Instruction (PI) Nodes- - * The opening PI symbol (). If the string value is empty, - * then the leading space is not added. Also, a trailing #xA is - * rendered after the closing PI symbol for PI children of the - * root node with a lesser document order than the document - * element, and a leading #xA is rendered before the opening PI - * symbol of PI children of the root node with a greater document + /* + * Processing Instruction (PI) Nodes- + * The opening PI symbol (). If the string value is empty, + * then the leading space is not added. Also, a trailing #xA is + * rendered after the closing PI symbol for PI children of the + * root node with a lesser document order than the document + * element, and a leading #xA is rendered before the opening PI + * symbol of PI children of the root node with a greater document * order than the document element. */ if (visible) { @@ -1310,17 +1310,17 @@ xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur) case XML_COMMENT_NODE: /* * Comment Nodes - * Nothing if generating canonical XML without comments. For - * canonical XML with comments, generate the opening comment - * symbol (). Also, a trailing #xA is rendered - * after the closing comment symbol for comment children of the - * root node with a lesser document order than the document - * element, and a leading #xA is rendered before the opening - * comment symbol of comment children of the root node with a - * greater document order than the document element. (Comment - * children of the root node represent comments outside of the - * top-level document element and outside of the document type + * Nothing if generating canonical XML without comments. For + * canonical XML with comments, generate the opening comment + * symbol (). Also, a trailing #xA is rendered + * after the closing comment symbol for comment children of the + * root node with a lesser document order than the document + * element, and a leading #xA is rendered before the opening + * comment symbol of comment children of the root node with a + * greater document order than the document element. (Comment + * children of the root node represent comments outside of the + * top-level document element and outside of the document type * declaration). */ if (visible && ctx->with_comments) { @@ -1390,8 +1390,8 @@ xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur) case XML_XINCLUDE_START: case XML_XINCLUDE_END: #endif - /* - * should be ignored according to "W3C Canonical XML" + /* + * should be ignored according to "W3C Canonical XML" */ break; default: @@ -1406,7 +1406,7 @@ xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur) * xmlC14NProcessNodeList: * @ctx: the pointer to C14N context object * @cur: the node to start from - * + * * Processes all nodes in the row starting from cur. * * Returns non-negative value on success or negative value on fail @@ -1431,7 +1431,7 @@ xmlC14NProcessNodeList(xmlC14NCtxPtr ctx, xmlNodePtr cur) /** * xmlC14NFreeCtx: * @ctx: the pointer to C14N context object - * + * * Cleanups the C14N context object. */ @@ -1452,25 +1452,25 @@ xmlC14NFreeCtx(xmlC14NCtxPtr ctx) /** * xmlC14NNewCtx: * @doc: the XML document for canonization - * @is_visible_callback:the function to use to determine is node visible + * @is_visible_callback:the function to use to determine is node visible * or not * @user_data: the first parameter for @is_visible_callback function * (in most cases, it is nodes set) - * @inclusive_ns_prefixe the list of inclusive namespace prefixes + * @inclusive_ns_prefixe the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization) * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Creates new C14N context object to store C14N parameters. * * Returns pointer to newly created object (success) or NULL (fail) */ static xmlC14NCtxPtr -xmlC14NNewCtx(xmlDocPtr doc, +xmlC14NNewCtx(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, void* user_data, int exclusive, xmlChar ** inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) @@ -1543,28 +1543,28 @@ xmlC14NNewCtx(xmlDocPtr doc, /** * xmlC14NExecute: * @doc: the XML document for canonization - * @is_visible_callback:the function to use to determine is node visible + * @is_visible_callback:the function to use to determine is node visible * or not * @user_data: the first parameter for @is_visible_callback function * (in most cases, it is nodes set) * @exclusive: the exclusive flag (0 - non-exclusive canonicalization; * otherwise - exclusive canonicalization) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Dumps the canonized image of given XML document into the provided buffer. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns non-negative value on success or a negative value on fail + * Returns non-negative value on success or a negative value on fail */ -int +int xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, void* user_data, int exclusive, xmlChar **inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) { @@ -1586,7 +1586,7 @@ xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, return (-1); } - ctx = xmlC14NNewCtx(doc, is_visible_callback, user_data, + ctx = xmlC14NNewCtx(doc, is_visible_callback, user_data, exclusive, inclusive_ns_prefixes, with_comments, buf); if (ctx == NULL) { @@ -1597,12 +1597,12 @@ xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, - /* + /* * Root Node - * The root node is the parent of the top-level document element. The - * result of processing each of its child nodes that is in the node-set - * in document order. The root node does not generate a byte order mark, - * XML declaration, nor anything from within the document type + * The root node is the parent of the top-level document element. The + * result of processing each of its child nodes that is in the node-set + * in document order. The root node does not generate a byte order mark, + * XML declaration, nor anything from within the document type * declaration. */ if (doc->children != NULL) { @@ -1624,7 +1624,7 @@ xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, return (-1); } - /* + /* * Cleanup */ xmlC14NFreeCtx(ctx); @@ -1638,26 +1638,26 @@ xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, * or NULL if all document nodes should be included * @exclusive: the exclusive flag (0 - non-exclusive canonicalization; * otherwise - exclusive canonicalization) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Dumps the canonized image of given XML document into the provided buffer. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns non-negative value on success or a negative value on fail + * Returns non-negative value on success or a negative value on fail */ int xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes, int exclusive, xmlChar ** inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) { - return(xmlC14NExecute(doc, + return(xmlC14NExecute(doc, (xmlC14NIsVisibleCallback)xmlC14NIsNodeInNodeset, nodes, exclusive, @@ -1674,20 +1674,20 @@ xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes, * or NULL if all document nodes should be included * @exclusive: the exclusive flag (0 - non-exclusive canonicalization; * otherwise - exclusive canonicalization) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) * @with_comments: include comments in the result (!=0) or not (==0) * @doc_txt_ptr: the memory pointer for allocated canonical XML text; * the caller of this functions is responsible for calling - * xmlFree() to free allocated memory - * + * xmlFree() to free allocated memory + * * Dumps the canonized image of given XML document into memory. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns the number of bytes written on success or a negative value on fail + * Returns the number of bytes written on success or a negative value on fail */ int xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes, @@ -1705,7 +1705,7 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes, *doc_txt_ptr = NULL; /* - * create memory buffer with UTF8 (default) encoding + * create memory buffer with UTF8 (default) encoding */ buf = xmlAllocOutputBuffer(NULL); if (buf == NULL) { @@ -1744,22 +1744,22 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes, * or NULL if all document nodes should be included * @exclusive: the exclusive flag (0 - non-exclusive canonicalization; * otherwise - exclusive canonicalization) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) * @with_comments: include comments in the result (!=0) or not (==0) * @filename: the filename to store canonical XML image - * @compression: the compression level (zlib requred): + * @compression: the compression level (zlib requred): * -1 - libxml default, - * 0 - uncompressed, + * 0 - uncompressed, * >0 - compression level - * + * * Dumps the canonized image of given XML document into the file. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns the number of bytes written success or a negative value on fail + * Returns the number of bytes written success or a negative value on fail */ int xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, @@ -1778,7 +1778,7 @@ xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, compression = xmlGetCompressMode(); #endif - /* + /* * save the content to a temp buffer, use default UTF8 encoding. */ buf = xmlOutputBufferCreateFilename(filename, NULL, compression); @@ -1798,8 +1798,8 @@ xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, return (-1); } - /* - * get the numbers of bytes written + /* + * get the numbers of bytes written */ ret = xmlOutputBufferClose(buf); return (ret); @@ -1820,7 +1820,7 @@ xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, } \ } -/** +/** * xmlC11NNormalizeString: * @input: the input string * @mode: the normalization mode (attribute, comment, PI or text) diff --git a/reactos/lib/3rdparty/libxml2/catalog.c b/reactos/lib/3rdparty/libxml2/catalog.c index 202c288fce8..5c5091262a4 100644 --- a/reactos/lib/3rdparty/libxml2/catalog.c +++ b/reactos/lib/3rdparty/libxml2/catalog.c @@ -1,5 +1,5 @@ /** - * catalog.c: set of generic Catalog related routines + * catalog.c: set of generic Catalog related routines * * Reference: SGML Open Technical Resolution TR9401:1997. * http://www.jclark.com/sp/catalog.htm @@ -247,9 +247,9 @@ xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error, * @name: name of the entry * @value: value of the entry * @prefer: the PUBLIC vs. SYSTEM current preference value - * @group: for members of a group, the group entry + * @group: for members of a group, the group entry * - * create a new Catalog entry, this type is shared both by XML and + * create a new Catalog entry, this type is shared both by XML and * SGML catalogs, but the acceptable types values differs. * * Returns the xmlCatalogEntryPtr or NULL in case of error @@ -387,7 +387,7 @@ xmlFreeCatalogHashEntryList(xmlCatalogEntryPtr catal) { * @type: type of catalog * @prefer: the PUBLIC vs. SYSTEM current preference value * - * create a new Catalog, this type is shared both by XML and + * create a new Catalog, this type is shared both by XML and * SGML catalogs, but the acceptable types values differs. * * Returns the xmlCatalogPtr or NULL in case of error @@ -673,7 +673,7 @@ BAD_CAST "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"); xmlAddChild((xmlNodePtr) doc, catalog); xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL); - + /* * reserialize it */ @@ -810,7 +810,7 @@ xmlCatalogUnWrapURN(const xmlChar *urn) { if (xmlStrncmp(urn, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) return(NULL); urn += sizeof(XML_URN_PUBID) - 1; - + while (*urn != 0) { if (i > sizeof(result) - 4) break; @@ -902,7 +902,7 @@ xmlParseCatalogFile(const char *filename) { inputStream->buf = buf; inputStream->base = inputStream->buf->buffer->content; inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = + inputStream->end = &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; inputPush(ctxt, inputStream); @@ -926,7 +926,7 @@ xmlParseCatalogFile(const char *filename) { ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -1325,7 +1325,7 @@ xmlParseXMLCatalogNodeList(xmlNodePtr cur, xmlCatalogPrefer prefer, * * Parses the catalog file to extract the XML tree and then analyze the * tree to build a list of Catalog entries corresponding to this catalog - * + * * Returns the resulting Catalog entries list */ static xmlCatalogEntryPtr @@ -1393,14 +1393,14 @@ xmlParseXMLCatalogFile(xmlCatalogPrefer prefer, const xmlChar *filename) { * @catal: an existing but incomplete catalog entry * * Fetch and parse the subcatalog referenced by an entry - * + * * Returns 0 in case of success, -1 otherwise */ static int xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) { xmlCatalogEntryPtr doc; - if (catal == NULL) + if (catal == NULL) return(-1); if (catal->URL == NULL) return(-1); @@ -1494,7 +1494,7 @@ xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *type, xmlCatalogEntryType typ; int doregister = 0; - if ((catal == NULL) || + if ((catal == NULL) || ((catal->type != XML_CATA_CATALOG) && (catal->type != XML_CATA_BROKEN_CATALOG))) return(-1); @@ -1569,7 +1569,7 @@ xmlDelXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *value) { xmlCatalogEntryPtr cur; int ret = 0; - if ((catal == NULL) || + if ((catal == NULL) || ((catal->type != XML_CATA_CATALOG) && (catal->type != XML_CATA_BROKEN_CATALOG))) return(-1); @@ -1783,7 +1783,7 @@ xmlCatalogXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID, } if (nbList < MAX_DELEGATE) delegates[nbList++] = cur->URL; - + if (cur->children == NULL) { xmlFetchXMLCatalogFile(cur); } @@ -1987,7 +1987,7 @@ xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID, xmlChar *ret = NULL; xmlChar *urnID = NULL; xmlChar *normid; - + if (catal == NULL) return(NULL); if ((pubID == NULL) && (sysID == NULL)) @@ -1996,7 +1996,7 @@ xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID, normid = xmlCatalogNormalizePublic(pubID); if (normid != NULL) pubID = (*normid != 0 ? normid : NULL); - + if (!xmlStrncmp(pubID, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) { urnID = xmlCatalogUnWrapURN(pubID); if (xmlDebugCatalogs) { @@ -2074,7 +2074,7 @@ static xmlChar * xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { xmlChar *ret = NULL; xmlChar *urnID = NULL; - + if (catal == NULL) return(NULL); if (URI == NULL) @@ -2134,7 +2134,7 @@ xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { */ static const xmlChar * xmlParseSGMLCatalogComment(const xmlChar *cur) { - if ((cur[0] != '-') || (cur[1] != '-')) + if ((cur[0] != '-') || (cur[1] != '-')) return(cur); SKIP(2); while ((cur[0] != 0) && ((cur[0] != '-') || ((cur[1] != '-')))) @@ -2667,7 +2667,7 @@ xmlLoadACatalog(const char *filename) first = content; - + while ((*first != 0) && (*first != '-') && (*first != '<') && (!(((*first >= 'A') && (*first <= 'Z')) || ((*first >= 'a') && (*first <= 'z'))))) @@ -2762,7 +2762,7 @@ xmlACatalogResolveSystem(xmlCatalogPtr catal, const xmlChar *sysID) { if ((sysID == NULL) || (catal == NULL)) return(NULL); - + if (xmlDebugCatalogs) xmlGenericError(xmlGenericErrorContext, "Resolve sysID %s\n", sysID); @@ -2797,7 +2797,7 @@ xmlACatalogResolvePublic(xmlCatalogPtr catal, const xmlChar *pubID) { if ((pubID == NULL) || (catal == NULL)) return(NULL); - + if (xmlDebugCatalogs) xmlGenericError(xmlGenericErrorContext, "Resolve pubID %s\n", pubID); @@ -2916,7 +2916,7 @@ xmlACatalogDump(xmlCatalogPtr catal, FILE *out) { } else { xmlHashScan(catal->sgml, (xmlHashScanner) xmlCatalogDumpEntry, out); - } + } } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -2924,7 +2924,7 @@ xmlACatalogDump(xmlCatalogPtr catal, FILE *out) { * xmlACatalogAdd: * @catal: a Catalog * @type: the type of record to add to the catalog - * @orig: the system, public or prefix to match + * @orig: the system, public or prefix to match * @replace: the replacement value for the match * * Add an entry in the catalog, it may overwrite existing but @@ -2983,7 +2983,7 @@ xmlACatalogRemove(xmlCatalogPtr catal, const xmlChar *value) { (xmlHashDeallocator) xmlFreeCatalogEntry); if (res == 0) res = 1; - } + } return(res); } @@ -3042,7 +3042,7 @@ xmlCatalogIsEmpty(xmlCatalogPtr catal) { return(1); if (res < 0) return(-1); - } + } return(0); } @@ -3065,7 +3065,7 @@ xmlInitializeCatalogData(void) { if (xmlCatalogInitialized != 0) return; - if (getenv("XML_DEBUG_CATALOG")) + if (getenv("XML_DEBUG_CATALOG")) xmlDebugCatalogs = 1; xmlCatalogMutex = xmlNewRMutex(); @@ -3086,7 +3086,7 @@ xmlInitializeCatalog(void) { xmlInitializeCatalogData(); xmlRMutexLock(xmlCatalogMutex); - if (getenv("XML_DEBUG_CATALOG")) + if (getenv("XML_DEBUG_CATALOG")) xmlDebugCatalogs = 1; if (xmlDefaultCatalog == NULL) { @@ -3109,7 +3109,7 @@ xmlInitializeCatalog(void) { unsigned long len = GetModuleFileNameA(hmodule, buf, 255); if (len != 0) { char* p = &(buf[len]); - while (*p != '\\' && p > buf) + while (*p != '\\' && p > buf) p--; if (p != buf) { xmlChar* uri; @@ -3128,15 +3128,15 @@ xmlInitializeCatalog(void) { catalogs = XML_XML_DEFAULT_CATALOG; #endif - catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, + catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, xmlCatalogDefaultPrefer); if (catal != NULL) { - /* the XML_CATALOG_FILES envvar is allowed to contain a + /* the XML_CATALOG_FILES envvar is allowed to contain a space-separated list of entries. */ cur = catalogs; nextent = &catal->xml; while (*cur != '\0') { - while (xmlIsBlank_ch(*cur)) + while (xmlIsBlank_ch(*cur)) cur++; if (*cur != 0) { paths = cur; @@ -3250,7 +3250,7 @@ xmlCatalogCleanup(void) { xmlGenericError(xmlGenericErrorContext, "Catalogs cleanup\n"); if (xmlCatalogXMLFiles != NULL) - xmlHashFree(xmlCatalogXMLFiles, + xmlHashFree(xmlCatalogXMLFiles, (xmlHashDeallocator)xmlFreeCatalogHashEntryList); xmlCatalogXMLFiles = NULL; if (xmlDefaultCatalog != NULL) @@ -3365,7 +3365,7 @@ xmlCatalogDump(FILE *out) { /** * xmlCatalogAdd: * @type: the type of record to add to the catalog - * @orig: the system, public or prefix to match + * @orig: the system, public or prefix to match * @replace: the replacement value for the match * * Add an entry in the catalog, it may overwrite existing but @@ -3396,7 +3396,7 @@ xmlCatalogAdd(const xmlChar *type, const xmlChar *orig, const xmlChar *replace) xmlRMutexUnlock(xmlCatalogMutex); return(0); - } + } res = xmlACatalogAdd(xmlDefaultCatalog, type, orig, replace); xmlRMutexUnlock(xmlCatalogMutex); @@ -3584,7 +3584,7 @@ xmlCatalogFreeLocal(void *catalogs) { * * Returns the updated list */ -void * +void * xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) { xmlCatalogEntryPtr catal, add; @@ -3604,7 +3604,7 @@ xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) { return(catalogs); catal = (xmlCatalogEntryPtr) catalogs; - if (catal == NULL) + if (catal == NULL) return((void *) add); while (catal->next != NULL) @@ -3619,7 +3619,7 @@ xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) { * @pubID: the public ID string * @sysID: the system ID string * - * Do a complete resolution lookup of an External Identifier using a + * Do a complete resolution lookup of an External Identifier using a * document's private catalog list * * Returns the URI of the resource or NULL if not found, it must be freed @@ -3664,7 +3664,7 @@ xmlCatalogLocalResolve(void *catalogs, const xmlChar *pubID, * @catalogs: a document's list of catalogs * @URI: the URI * - * Do a complete resolution lookup of an URI using a + * Do a complete resolution lookup of an URI using a * document's private catalog list * * Returns the URI of the resource or NULL if not found, it must be freed @@ -3725,7 +3725,7 @@ xmlCatalogGetSystem(const xmlChar *sysID) { if (sysID == NULL) return(NULL); - + /* * Check first the XML catalogs */ @@ -3769,7 +3769,7 @@ xmlCatalogGetPublic(const xmlChar *pubID) { if (pubID == NULL) return(NULL); - + /* * Check first the XML catalogs */ diff --git a/reactos/lib/3rdparty/libxml2/chvalid.c b/reactos/lib/3rdparty/libxml2/chvalid.c index 227aeba17de..3dbefb7da0c 100644 --- a/reactos/lib/3rdparty/libxml2/chvalid.c +++ b/reactos/lib/3rdparty/libxml2/chvalid.c @@ -46,55 +46,55 @@ unsigned char xmlIsPubidChar_tab[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, {0x134, 0x13e}, - {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, {0x1cd, 0x1f0}, - {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, {0x2bb, 0x2c1}, - {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, {0x38e, 0x3a1}, - {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, {0x3dc, 0x3dc}, - {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, {0x401, 0x40c}, - {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, {0x490, 0x4c4}, - {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, {0x4ee, 0x4f5}, - {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, {0x561, 0x586}, - {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a}, - {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, {0x6d0, 0x6d3}, - {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, {0x93d, 0x93d}, - {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8}, - {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9dc, 0x9dd}, - {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, - {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, - {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, - {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, - {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd}, - {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, - {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, {0xb3d, 0xb3d}, - {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, {0xb8e, 0xb90}, - {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, {0xb9e, 0xb9f}, - {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, {0xbb7, 0xbb9}, - {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc33}, - {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, {0xc8e, 0xc90}, - {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xcde, 0xcde}, - {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28}, - {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, {0xe30, 0xe30}, - {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, {0xe84, 0xe84}, - {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97}, - {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7}, - {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, {0xeb2, 0xeb3}, - {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, {0xf49, 0xf69}, - {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, {0x1102, 0x1103}, - {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, {0x110e, 0x1112}, - {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, {0x114c, 0x114c}, - {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, {0x1159, 0x1159}, - {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, {0x1167, 0x1167}, - {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, {0x1175, 0x1175}, - {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, {0x11ae, 0x11af}, - {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, {0x11eb, 0x11eb}, - {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9}, - {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, - {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, - {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe}, - {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb}, - {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2126, 0x2126}, - {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, {0x3041, 0x3094}, +static xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, {0x134, 0x13e}, + {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, {0x1cd, 0x1f0}, + {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, {0x2bb, 0x2c1}, + {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, {0x38e, 0x3a1}, + {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, {0x3dc, 0x3dc}, + {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, {0x401, 0x40c}, + {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, {0x490, 0x4c4}, + {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, {0x4ee, 0x4f5}, + {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, {0x561, 0x586}, + {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a}, + {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, {0x6d0, 0x6d3}, + {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, {0x93d, 0x93d}, + {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8}, + {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9dc, 0x9dd}, + {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, + {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, + {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, + {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, + {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd}, + {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, + {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, {0xb3d, 0xb3d}, + {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, {0xb8e, 0xb90}, + {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, {0xb9e, 0xb9f}, + {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, {0xbb7, 0xbb9}, + {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc33}, + {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, {0xc8e, 0xc90}, + {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xcde, 0xcde}, + {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28}, + {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, {0xe30, 0xe30}, + {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, {0xe84, 0xe84}, + {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97}, + {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7}, + {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, {0xeb2, 0xeb3}, + {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, {0xf49, 0xf69}, + {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, {0x1102, 0x1103}, + {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, {0x110e, 0x1112}, + {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, {0x114c, 0x114c}, + {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, {0x1159, 0x1159}, + {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, {0x1167, 0x1167}, + {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, {0x1175, 0x1175}, + {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, {0x11ae, 0x11af}, + {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, {0x11eb, 0x11eb}, + {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9}, + {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, + {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, + {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe}, + {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb}, + {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2126, 0x2126}, + {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, {0x3041, 0x3094}, {0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}}; xmlChRangeGroup xmlIsBaseCharGroup = {197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0}; @@ -104,48 +104,48 @@ static xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}}; xmlChRangeGroup xmlIsCharGroup = {2, 1, xmlIsChar_srng, xmlIsChar_lrng}; -static xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345}, - {0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, - {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, - {0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df}, - {0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903}, - {0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954}, - {0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be}, - {0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, - {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c}, - {0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48}, - {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc}, - {0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03}, - {0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, - {0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, - {0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, - {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, - {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, - {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, - {0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e}, - {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd}, - {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39}, - {0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b}, - {0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7}, - {0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f}, +static xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345}, + {0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, + {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, + {0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df}, + {0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903}, + {0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954}, + {0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be}, + {0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, + {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c}, + {0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48}, + {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc}, + {0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03}, + {0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, + {0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, + {0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, + {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, + {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, + {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, + {0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e}, + {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd}, + {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39}, + {0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b}, + {0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7}, + {0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f}, {0x3099, 0x3099}, {0x309a, 0x309a}}; xmlChRangeGroup xmlIsCombiningGroup = {95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0}; -static xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, {0x6f0, 0x6f9}, - {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, {0xae6, 0xaef}, - {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, {0xce6, 0xcef}, +static xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, {0x6f0, 0x6f9}, + {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, {0xae6, 0xaef}, + {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, {0xf20, 0xf29}}; xmlChRangeGroup xmlIsDigitGroup = {14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0}; -static xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, {0x2d1, 0x2d1}, - {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, {0xec6, 0xec6}, +static xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, {0x2d1, 0x2d1}, + {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, {0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, {0x30fc, 0x30fe}}; xmlChRangeGroup xmlIsExtenderGroup = {10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0}; -static xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007}, +static xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007}, {0x3021, 0x3029}, {0x4e00, 0x9fa5}}; xmlChRangeGroup xmlIsIdeographicGroup = {3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0}; diff --git a/reactos/lib/3rdparty/libxml2/config.h b/reactos/lib/3rdparty/libxml2/config.h index 09a62b97839..868436604ca 100644 --- a/reactos/lib/3rdparty/libxml2/config.h +++ b/reactos/lib/3rdparty/libxml2/config.h @@ -5,7 +5,7 @@ /* #undef HAVE_LIBZ */ /* #undef HAVE_LIBM */ /* #undef HAVE_ISINF */ -#define HAVE_ISNAN +#define HAVE_ISNAN /* #undef HAVE_LIBHISTORY */ /* #undef HAVE_LIBREADLINE */ /* #undef HAVE_LIBPTHREAD */ @@ -90,7 +90,7 @@ /* #undef HAVE_ISINF */ /* Define if isnan is there */ -#define HAVE_ISNAN +#define HAVE_ISNAN /* Define to 1 if you have the `isnand' function. */ /* #undef HAVE_ISNAND */ diff --git a/reactos/lib/3rdparty/libxml2/debugXML.c b/reactos/lib/3rdparty/libxml2/debugXML.c index 3cb2848be83..4b2930f2efc 100644 --- a/reactos/lib/3rdparty/libxml2/debugXML.c +++ b/reactos/lib/3rdparty/libxml2/debugXML.c @@ -81,7 +81,7 @@ xmlCtxtDumpCleanCtxt(xmlDebugCtxtPtr ctxt ATTRIBUTE_UNUSED) * * Check that a given namespace is in scope on a node. * - * Returns 1 if in scope, -1 in case of argument error, + * Returns 1 if in scope, -1 in case of argument error, * -2 if the namespace is not in scope, and -3 if not on * an ancestor node. */ @@ -305,7 +305,7 @@ xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) { (node != (xmlNodePtr) node->parent->properties)) xmlDebugErr(ctxt, XML_CHECK_NO_PREV, "Attr has no prev and not first of attr list\n"); - + } else if ((node->parent != NULL) && (node->parent->children != node)) xmlDebugErr(ctxt, XML_CHECK_NO_PREV, "Node has no prev and not first of parent list\n"); @@ -1583,7 +1583,7 @@ int xmlLsCountNode(xmlNodePtr node) { int ret = 0; xmlNodePtr list = NULL; - + if (node == NULL) return(0); @@ -1624,7 +1624,7 @@ xmlLsCountNode(xmlNodePtr node) { ret = 1; break; } - for (;list != NULL;ret++) + for (;list != NULL;ret++) list = list->next; return(ret); } @@ -1692,11 +1692,11 @@ xmlLsOneNode(FILE *output, xmlNodePtr node) { if (node->type != XML_NAMESPACE_DECL) { if (node->properties != NULL) fprintf(output, "a"); - else + else fprintf(output, "-"); - if (node->nsDef != NULL) + if (node->nsDef != NULL) fprintf(output, "n"); - else + else fprintf(output, "-"); } @@ -1763,7 +1763,7 @@ xmlLsOneNode(FILE *output, xmlNodePtr node) { * xmlBoolToText: * @boolval: a bool to turn into text * - * Convenient way to turn bool into text + * Convenient way to turn bool into text * * Returns a pointer to either "True" or "False" */ @@ -2030,7 +2030,7 @@ xmlShellBase(xmlShellCtxtPtr ctxt, if (node == NULL) { fprintf(ctxt->output, "NULL\n"); return (0); - } + } base = xmlNodeGetBase(node->doc, node); @@ -2257,7 +2257,7 @@ xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, if (node == NULL) { fprintf(ctxt->output, "NULL\n"); return (0); - } + } if ((node->type == XML_DOCUMENT_NODE) || (node->type == XML_HTML_DOCUMENT_NODE)) { xmlDebugDumpDocumentHead(ctxt->output, (xmlDocPtr) node); @@ -2392,7 +2392,7 @@ xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED, if (node == NULL) { fprintf(ctxt->output, "NULL\n"); return (0); - } + } if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) { #ifdef LIBXML_HTML_ENABLED if (node->type == XML_HTML_DOCUMENT_NODE) @@ -2728,7 +2728,7 @@ xmlShellDu(xmlShellCtxtPtr ctxt, * xmlShellPwd: * @ctxt: the shell context * @buffer: the output buffer - * @node: a node + * @node: a node * @node2: unused * * Implements the XML shell function "pwd" @@ -2773,7 +2773,7 @@ xmlShellPwd(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer, * @input: the line reading function * @output: the output FILE*, defaults to stdout if NULL * - * Implements the XML shell + * Implements the XML shell * This allow to load, validate, view, modify and save a document * using a environment similar to a UNIX commandline. */ diff --git a/reactos/lib/3rdparty/libxml2/dict.c b/reactos/lib/3rdparty/libxml2/dict.c index 3b4054f2380..202eb4743f9 100644 --- a/reactos/lib/3rdparty/libxml2/dict.c +++ b/reactos/lib/3rdparty/libxml2/dict.c @@ -143,7 +143,7 @@ xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) { if (pool == NULL) { if (size == 0) size = 1000; else size *= 4; /* exponential growth */ - if (size < 4 * namelen) + if (size < 4 * namelen) size = 4 * namelen; /* just in case ! */ pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size); if (pool == NULL) @@ -199,7 +199,7 @@ xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, if (pool == NULL) { if (size == 0) size = 1000; else size *= 4; /* exponential growth */ - if (size < 4 * namelen) + if (size < 4 * namelen) size = 4 * namelen; /* just in case ! */ pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size); if (pool == NULL) @@ -230,7 +230,7 @@ found_pool: static unsigned long xmlDictComputeKey(const xmlChar *name, int namelen) { unsigned long value = 0L; - + if (name == NULL) return(0); value = *name; value <<= 5; @@ -262,7 +262,7 @@ xmlDictComputeQKey(const xmlChar *prefix, const xmlChar *name, int len) { unsigned long value = 0L; int plen; - + if (prefix == NULL) return(xmlDictComputeKey(name, len)); @@ -271,7 +271,7 @@ xmlDictComputeQKey(const xmlChar *prefix, const xmlChar *name, int len) value += 30 * (unsigned long) ':'; else value += 30 * (*prefix); - + if (len > 10) { value += name[len - (plen + 1 + 1)]; len = 10; @@ -326,7 +326,7 @@ xmlDictCreate(void) { if (!xmlDictInitialized) if (!xmlInitializeDict()) return(NULL); - + dict = xmlMalloc(sizeof(xmlDict)); if (dict) { dict->ref_counter = 1; @@ -362,7 +362,7 @@ xmlDictCreate(void) { xmlDictPtr xmlDictCreateSub(xmlDictPtr sub) { xmlDictPtr dict = xmlDictCreate(); - + if ((dict != NULL) && (sub != NULL)) { dict->subdict = sub; xmlDictReference(dict->subdict); @@ -409,7 +409,7 @@ xmlDictGrow(xmlDictPtr dict, int size) { #ifdef DEBUG_GROW unsigned long nbElem = 0; #endif - + if (dict == NULL) return(-1); if (size < 8) @@ -421,7 +421,7 @@ xmlDictGrow(xmlDictPtr dict, int size) { olddict = dict->dict; if (olddict == NULL) return(-1); - + dict->dict = xmlMalloc(size * sizeof(xmlDictEntry)); if (dict->dict == NULL) { dict->dict = olddict; @@ -431,13 +431,13 @@ xmlDictGrow(xmlDictPtr dict, int size) { dict->size = size; /* If the two loops are merged, there would be situations where - a new entry needs to allocated and data copied into it from + a new entry needs to allocated and data copied into it from the main dict. So instead, we run through the array twice, first copying all the elements in the main array (where we can't get conflicts) and then the rest, so we only free (and don't allocate) */ for (i = 0; i < oldsize; i++) { - if (olddict[i].valid == 0) + if (olddict[i].valid == 0) continue; key = xmlDictComputeKey(olddict[i].name, olddict[i].len) % dict->size; memcpy(&(dict->dict[key]), &(olddict[i]), sizeof(xmlDictEntry)); @@ -655,7 +655,7 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) { entry->valid = 1; - if (insert != NULL) + if (insert != NULL) insert->next = entry; dict->nbElems++; @@ -763,7 +763,7 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) { /** * xmlDictQLookup: * @dict: the dictionnary - * @prefix: the prefix + * @prefix: the prefix * @name: the name * * Add the QName @prefix:@name to the hash @dict if not present. @@ -838,7 +838,7 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) { entry->next = NULL; entry->valid = 1; - if (insert != NULL) + if (insert != NULL) insert->next = entry; dict->nbElems++; diff --git a/reactos/lib/3rdparty/libxml2/encoding.c b/reactos/lib/3rdparty/libxml2/encoding.c index 66e63b518aa..b226bab9f49 100644 --- a/reactos/lib/3rdparty/libxml2/encoding.c +++ b/reactos/lib/3rdparty/libxml2/encoding.c @@ -1,7 +1,7 @@ /* * encoding.c : implements the encoding conversion functions needed for XML * - * Related specs: + * Related specs: * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies * rfc2781 UTF-16, an encoding of ISO 10646, P. Hoffman, F. Yergeau * [ISO-10646] UTF-8 and UTF-16 in Annexes @@ -110,12 +110,12 @@ asciiToUTF8(unsigned char* out, int *outlen, if (out >= outend) break; if (c < 0x80) { *out++= c; bits= -6; } - else { + else { *outlen = out - outstart; *inlen = processed - base; return(-1); } - + for ( ; bits >= 0; bits-= 6) { if (out >= outend) break; @@ -186,7 +186,7 @@ UTF8Toascii(unsigned char* out, int *outlen, if (inend - in < trailing) { break; - } + } for ( ; trailing; trailing--) { if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) @@ -243,18 +243,18 @@ isolat1ToUTF8(unsigned char* out, int *outlen, outend = out + *outlen; inend = in + (*inlen); instop = inend; - + while (in < inend && out < outend - 1) { if (*in >= 0x80) { *out++ = (((*in) >> 6) & 0x1F) | 0xC0; *out++ = ((*in) & 0x3F) | 0x80; ++in; } - if (instop - in > outend - out) instop = in + (outend - out); + if (instop - in > outend - out) instop = in + (outend - out); while (in < instop && *in < 0x80) { *out++ = *in++; } - } + } if (in < inend && out < outend && *in < 0x80) { *out++ = *in++; } @@ -359,7 +359,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen, if (inend - in < trailing) { break; - } + } for ( ; trailing; trailing--) { if (in >= inend) @@ -467,7 +467,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen, else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; } else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; } else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; } - + for ( ; bits >= 0; bits-= 6) { if (out >= outend) break; @@ -492,7 +492,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen, * block of chars out. * * Returns the number of bytes written, or -1 if lack of space, or -2 - * if the transcoding failed. + * if the transcoding failed. */ static int UTF8ToUTF16LE(unsigned char* outb, int *outlen, @@ -537,7 +537,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen, if (inend - in < trailing) { break; - } + } for ( ; trailing; trailing--) { if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) @@ -600,7 +600,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen, * block of chars out. * * Returns the number of bytes written, or -1 if lack of space, or -2 - * if the transcoding failed. + * if the transcoding failed. */ static int UTF8ToUTF16(unsigned char* outb, int *outlen, @@ -672,7 +672,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen, in++; } else { c= *in++; - } + } if ((c & 0xFC00) == 0xD800) { /* surrogates */ if (in >= inend) { /* (in > inend) shouldn't happens */ *outlen = out - outstart; @@ -702,15 +702,15 @@ UTF16BEToUTF8(unsigned char* out, int *outlen, } /* assertion: c is a single UTF-4 value */ - if (out >= outend) + if (out >= outend) break; if (c < 0x80) { *out++= c; bits= -6; } else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; } else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; } else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; } - + for ( ; bits >= 0; bits-= 6) { - if (out >= outend) + if (out >= outend) break; *out++= ((c >> bits) & 0x3F) | 0x80; } @@ -733,7 +733,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen, * block of chars out. * * Returns the number of byte written, or -1 by lack of space, or -2 - * if the transcoding failed. + * if the transcoding failed. */ static int UTF8ToUTF16BE(unsigned char* outb, int *outlen, @@ -778,7 +778,7 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen, if (inend - in < trailing) { break; - } + } for ( ; trailing; trailing--) { if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) break; @@ -842,13 +842,13 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen, * * Guess the encoding of the entity using the first bytes of the entity content * according to the non-normative appendix F of the XML-1.0 recommendation. - * + * * Returns one of the XML_CHAR_ENCODING_... values. */ xmlCharEncoding xmlDetectCharEncoding(const unsigned char* in, int len) { - if (in == NULL) + if (in == NULL) return(XML_CHAR_ENCODING_NONE); if (len >= 4) { if ((in[0] == 0x00) && (in[1] == 0x00) && @@ -929,7 +929,7 @@ xmlCleanupEncodingAliases(void) { * @alias: the alias name as parsed, in UTF-8 format (ASCII actually) * * Lookup an encoding name for the given alias. - * + * * Returns NULL if not found, otherwise the original name */ const char * @@ -967,7 +967,7 @@ xmlGetEncodingAlias(const char *alias) { * * Registers an alias @alias for an encoding named @name. Existing alias * will be overwritten. - * + * * Returns 0 in case of success, -1 in case of error */ int @@ -987,13 +987,13 @@ xmlAddEncodingAlias(const char *name, const char *alias) { if (xmlCharEncodingAliases == NULL) { xmlCharEncodingAliasesNb = 0; xmlCharEncodingAliasesMax = 20; - xmlCharEncodingAliases = (xmlCharEncodingAliasPtr) + xmlCharEncodingAliases = (xmlCharEncodingAliasPtr) xmlMalloc(xmlCharEncodingAliasesMax * sizeof(xmlCharEncodingAlias)); if (xmlCharEncodingAliases == NULL) return(-1); } else if (xmlCharEncodingAliasesNb >= xmlCharEncodingAliasesMax) { xmlCharEncodingAliasesMax *= 2; - xmlCharEncodingAliases = (xmlCharEncodingAliasPtr) + xmlCharEncodingAliases = (xmlCharEncodingAliasPtr) xmlRealloc(xmlCharEncodingAliases, xmlCharEncodingAliasesMax * sizeof(xmlCharEncodingAlias)); } @@ -1024,7 +1024,7 @@ xmlAddEncodingAlias(const char *name, const char *alias) { * @alias: the alias name as parsed, in UTF-8 format (ASCII actually) * * Unregisters an encoding alias @alias - * + * * Returns 0 in case of success, -1 in case of error */ int @@ -1059,7 +1059,7 @@ xmlDelEncodingAlias(const char *alias) { * Compare the string to the encoding schemes already known. Note * that the comparison is case insensitive accordingly to the section * [XML] 4.3.3 Character Encoding in Entities. - * + * * Returns one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE * if not recognized. */ @@ -1096,7 +1096,7 @@ xmlParseCharEncoding(const char* name) */ if (!strcmp(upper, "UTF-16")) return(XML_CHAR_ENCODING_UTF16LE); if (!strcmp(upper, "UTF16")) return(XML_CHAR_ENCODING_UTF16LE); - + if (!strcmp(upper, "ISO-10646-UCS-2")) return(XML_CHAR_ENCODING_UCS2); if (!strcmp(upper, "UCS-2")) return(XML_CHAR_ENCODING_UCS2); if (!strcmp(upper, "UCS2")) return(XML_CHAR_ENCODING_UCS2); @@ -1109,7 +1109,7 @@ xmlParseCharEncoding(const char* name) if (!strcmp(upper, "UCS-4")) return(XML_CHAR_ENCODING_UCS4LE); if (!strcmp(upper, "UCS4")) return(XML_CHAR_ENCODING_UCS4LE); - + if (!strcmp(upper, "ISO-8859-1")) return(XML_CHAR_ENCODING_8859_1); if (!strcmp(upper, "ISO-LATIN-1")) return(XML_CHAR_ENCODING_8859_1); if (!strcmp(upper, "ISO LATIN 1")) return(XML_CHAR_ENCODING_8859_1); @@ -1232,7 +1232,7 @@ static xmlCharEncodingHandlerPtr xmlDefaultCharEncodingHandler = NULL; * Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error). */ xmlCharEncodingHandlerPtr -xmlNewCharEncodingHandler(const char *name, +xmlNewCharEncodingHandler(const char *name, xmlCharEncodingInputFunc input, xmlCharEncodingOutputFunc output) { xmlCharEncodingHandlerPtr handler; @@ -1310,7 +1310,7 @@ xmlNewCharEncodingHandler(const char *name, void xmlInitCharEncodingHandlers(void) { unsigned short int tst = 0x1234; - unsigned char *ptr = (unsigned char *) &tst; + unsigned char *ptr = (unsigned char *) &tst; if (handlers != NULL) return; @@ -1329,9 +1329,9 @@ xmlInitCharEncodingHandlers(void) { } xmlNewCharEncodingHandler("UTF-8", UTF8ToUTF8, UTF8ToUTF8); #ifdef LIBXML_OUTPUT_ENABLED - xmlUTF16LEHandler = + xmlUTF16LEHandler = xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE); - xmlUTF16BEHandler = + xmlUTF16BEHandler = xmlNewCharEncodingHandler("UTF-16BE", UTF16BEToUTF8, UTF8ToUTF16BE); xmlNewCharEncodingHandler("UTF-16", UTF16LEToUTF8, UTF8ToUTF16); xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, UTF8Toisolat1); @@ -1341,9 +1341,9 @@ xmlInitCharEncodingHandlers(void) { xmlNewCharEncodingHandler("HTML", NULL, UTF8ToHtml); #endif #else - xmlUTF16LEHandler = + xmlUTF16LEHandler = xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, NULL); - xmlUTF16BEHandler = + xmlUTF16BEHandler = xmlNewCharEncodingHandler("UTF-16BE", UTF16BEToUTF8, NULL); xmlNewCharEncodingHandler("UTF-16", UTF16LEToUTF8, NULL); xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, NULL); @@ -1400,7 +1400,7 @@ xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) { } if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "xmlRegisterCharEncodingHandler: Too many handler registered\n"); xmlGenericError(xmlGenericErrorContext, "\tincrease MAX_ENCODING_HANDLERS : %s\n", __FILE__); @@ -1528,10 +1528,10 @@ xmlGetCharEncodingHandler(xmlCharEncoding enc) { handler = xmlFindCharEncodingHandler("EUC-JP"); if (handler != NULL) return(handler); break; - default: + default: break; } - + #ifdef DEBUG_ENCODING xmlGenericError(xmlGenericErrorContext, "No handler found for encoding %d\n", enc); @@ -1653,12 +1653,12 @@ xmlFindCharEncodingHandler(const char *name) { * @in: a pointer to an array of ISO Latin 1 chars * @inlen: the length of @in * - * Returns 0 if success, or + * Returns 0 if success, or * -1 by lack of space, or * -2 if the transcoding fails (for *in is not valid utf8 string or * the result of transformation can't fit into the encoding we want), or * -3 if there the last byte can't form a single output char. - * + * * The value of @inlen after return is the number of octets consumed * as the return value is positive, else unpredictable. * The value of @outlen after return is the number of ocetes consumed. @@ -1720,11 +1720,11 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen, * @handler: char enconding transformation data structure * @out: an xmlBuffer for the output. * @in: an xmlBuffer for the input - * + * * Front-end for the encoding handler input function, but handle only * the very first line, i.e. limit itself to 45 chars. - * - * Returns the number of byte written if success, or + * + * Returns the number of byte written if success, or * -1 general error * -2 if the transcoding fails (for *in is not valid utf8 string or * the result of transformation can't fit into the encoding we want), or @@ -1807,10 +1807,10 @@ xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out, * @handler: char encoding transformation data structure * @out: an xmlBuffer for the output. * @in: an xmlBuffer for the input - * + * * Generic front-end for the encoding handler input function - * - * Returns the number of byte written if success, or + * + * Returns the number of byte written if success, or * -1 general error * -2 if the transcoding fails (for *in is not valid utf8 string or * the result of transformation can't fit into the encoding we want), or @@ -1899,15 +1899,15 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out, * @handler: char enconding transformation data structure * @out: an xmlBuffer for the output. * @in: an xmlBuffer for the input - * + * * Generic front-end for the encoding handler output function - * a first call with @in == NULL has to be made firs to initiate the + * a first call with @in == NULL has to be made firs to initiate the * output in case of non-stateless encoding needing to initiate their * state or the output (like the BOM in UTF16). * In case of UTF8 sequence conversion errors for the given encoder, * the content will be automatically remapped to a CharRef sequence. - * - * Returns the number of byte written if success, or + * + * Returns the number of byte written if success, or * -1 general error * -2 if the transcoding fails (for *in is not valid utf8 string or * the result of transformation can't fit into the encoding we want), or @@ -1925,7 +1925,7 @@ xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out, if (out == NULL) return(-1); retry: - + written = out->size - out->use; if (written > 0) @@ -2072,7 +2072,7 @@ retry: /** * xmlCharEncCloseFunc: * @handler: char enconding transformation data structure - * + * * Generic front-end for encoding handler close function * * Returns 0 if success, or -1 in case of error @@ -2133,7 +2133,7 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { long xmlByteConsumed(xmlParserCtxtPtr ctxt) { xmlParserInputPtr in; - + if (ctxt == NULL) return(-1); in = ctxt->input; if (in == NULL) return(-1); @@ -2233,7 +2233,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen, while (in < inend) { unsigned char d = *in++; if (d < 0x80) { - *out++ = d; + *out++ = d; } else if (d < 0xC0) { /* trailing byte in leading position */ *outlen = out - outstart; @@ -2254,7 +2254,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen, *inlen = in - instart - 2; return(-2); } - c = c & 0x3F; + c = c & 0x3F; d = d & 0x1F; d = xlattable [48 + c + xlattable [d] * 64]; if (d == 0) { @@ -2263,7 +2263,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen, *inlen = in - instart - 2; return(-2); } - *out++ = d; + *out++ = d; } else if (d < 0xF0) { unsigned char c1; unsigned char c2; @@ -2287,10 +2287,10 @@ UTF8ToISO8859x(unsigned char* out, int *outlen, *inlen = in - instart - 2; return(-2); } - c1 = c1 & 0x3F; - c2 = c2 & 0x3F; + c1 = c1 & 0x3F; + c2 = c2 & 0x3F; d = d & 0x0F; - d = xlattable [48 + c2 + xlattable [48 + c1 + + d = xlattable [48 + c2 + xlattable [48 + c1 + xlattable [32 + d] * 64] * 64]; if (d == 0) { /* not in character set */ @@ -2298,7 +2298,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen, *inlen = in - instart - 3; return(-2); } - *out++ = d; + *out++ = d; } else { /* cannot transcode >= U+010000 */ *outlen = out - outstart; @@ -2350,7 +2350,7 @@ ISO8859xToUTF8(unsigned char* out, int *outlen, *outlen = out - outstart; *inlen = in - instart; return (-1); - } + } if (c < 0x800) { *out++ = ((c >> 6) & 0x1F) | 0xC0; *out++ = (c & 0x3F) | 0x80; @@ -2358,17 +2358,17 @@ ISO8859xToUTF8(unsigned char* out, int *outlen, *out++ = ((c >> 12) & 0x0F) | 0xE0; *out++ = ((c >> 6) & 0x3F) | 0x80; *out++ = (c & 0x3F) | 0x80; - } + } ++in; c = *in; } - if (instop - in > outend - out) instop = in + (outend - out); + if (instop - in > outend - out) instop = in + (outend - out); while (c < 0x80 && in < instop) { *out++ = c; ++in; c = *in; } - } + } if (in < inend && out < outend && c < 0x80) { *out++ = c; ++in; @@ -2378,28 +2378,28 @@ ISO8859xToUTF8(unsigned char* out, int *outlen, return (*outlen); } - + /************************************************************************ * Lookup tables for ISO-8859-2..ISO-8859-16 transcoding * ************************************************************************/ static unsigned short const xmlunicodetable_ISO8859_2 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, - 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, - 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, - 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, - 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, - 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, - 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, - 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, - 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, - 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, + 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, + 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, + 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, + 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, + 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, + 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, + 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, + 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, + 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, + 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, + 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9, }; static unsigned char const xmltranscodetable_ISO8859_2 [48 + 6 * 64] = { @@ -2433,22 +2433,22 @@ static unsigned char const xmltranscodetable_ISO8859_2 [48 + 6 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_3 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7, - 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b, - 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, - 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c, - 0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, - 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, - 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7, + 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b, + 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, + 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c, + 0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7, + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, + 0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, + 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, + 0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, + 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9, }; static unsigned char const xmltranscodetable_ISO8859_3 [48 + 7 * 64] = { @@ -2486,22 +2486,22 @@ static unsigned char const xmltranscodetable_ISO8859_3 [48 + 7 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_4 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, - 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, - 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, - 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, - 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, - 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, - 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, - 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, + 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, + 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, + 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, + 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, + 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, + 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, + 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, + 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, + 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, + 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, + 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9, }; static unsigned char const xmltranscodetable_ISO8859_4 [48 + 6 * 64] = { @@ -2535,22 +2535,22 @@ static unsigned char const xmltranscodetable_ISO8859_4 [48 + 6 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_5 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, - 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, + 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, + 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f, }; static unsigned char const xmltranscodetable_ISO8859_5 [48 + 6 * 64] = { @@ -2584,22 +2584,22 @@ static unsigned char const xmltranscodetable_ISO8859_5 [48 + 6 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_6 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f, - 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, - 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, - 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, - 0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, - 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, - 0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f, + 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, + 0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, + 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, + 0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; static unsigned char const xmltranscodetable_ISO8859_6 [48 + 5 * 64] = { @@ -2629,22 +2629,22 @@ static unsigned char const xmltranscodetable_ISO8859_6 [48 + 5 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_7 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x2018, 0x2019, 0x00a3, 0x0000, 0x0000, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x0000, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, - 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, - 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, - 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, - 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, - 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, - 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, - 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, - 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x2018, 0x2019, 0x00a3, 0x0000, 0x0000, 0x00a6, 0x00a7, + 0x00a8, 0x00a9, 0x0000, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, + 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, + 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, + 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, + 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, + 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, + 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, + 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000, }; static unsigned char const xmltranscodetable_ISO8859_7 [48 + 7 * 64] = { @@ -2682,22 +2682,22 @@ static unsigned char const xmltranscodetable_ISO8859_7 [48 + 7 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_8 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, - 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, - 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, - 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, - 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f, 0x0000, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, + 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, + 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, + 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, + 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, + 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, + 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f, 0x0000, }; static unsigned char const xmltranscodetable_ISO8859_8 [48 + 7 * 64] = { @@ -2735,22 +2735,22 @@ static unsigned char const xmltranscodetable_ISO8859_8 [48 + 7 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_9 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, + 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, + 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, + 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, + 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff, }; static unsigned char const xmltranscodetable_ISO8859_9 [48 + 5 * 64] = { @@ -2780,22 +2780,22 @@ static unsigned char const xmltranscodetable_ISO8859_9 [48 + 5 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_10 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, - 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, - 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, - 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b, - 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168, - 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169, - 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, + 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, + 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, + 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b, + 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, + 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf, + 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168, + 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, + 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, + 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169, + 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138, }; static unsigned char const xmltranscodetable_ISO8859_10 [48 + 7 * 64] = { @@ -2833,22 +2833,22 @@ static unsigned char const xmltranscodetable_ISO8859_10 [48 + 7 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_11 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, - 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, - 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, - 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, - 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, - 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, - 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, - 0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f, - 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, - 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, - 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, - 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, + 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, + 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, + 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, + 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, + 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, + 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, + 0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f, + 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, + 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, + 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000, }; static unsigned char const xmltranscodetable_ISO8859_11 [48 + 6 * 64] = { @@ -2882,22 +2882,22 @@ static unsigned char const xmltranscodetable_ISO8859_11 [48 + 6 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_13 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, - 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, - 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, - 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, - 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, - 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, - 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, - 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, - 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, - 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, - 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, + 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, + 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, + 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, + 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, + 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, + 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, + 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, + 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, + 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, + 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019, }; static unsigned char const xmltranscodetable_ISO8859_13 [48 + 7 * 64] = { @@ -2935,22 +2935,22 @@ static unsigned char const xmltranscodetable_ISO8859_13 [48 + 7 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_14 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, - 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, - 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, - 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, + 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, + 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, + 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, + 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, + 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff, }; static unsigned char const xmltranscodetable_ISO8859_14 [48 + 10 * 64] = { @@ -3000,22 +3000,22 @@ static unsigned char const xmltranscodetable_ISO8859_14 [48 + 10 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_15 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, - 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, - 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, + 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, + 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf, + 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, + 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, }; static unsigned char const xmltranscodetable_ISO8859_15 [48 + 6 * 64] = { @@ -3049,22 +3049,22 @@ static unsigned char const xmltranscodetable_ISO8859_15 [48 + 6 * 64] = { }; static unsigned short const xmlunicodetable_ISO8859_16 [128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, - 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, - 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, - 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, - 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7, - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, - 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a, - 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df, - 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7, - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, - 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b, - 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, + 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, + 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, + 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, + 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7, + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, + 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a, + 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df, + 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b, + 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff, }; static unsigned char const xmltranscodetable_ISO8859_16 [48 + 9 * 64] = { diff --git a/reactos/lib/3rdparty/libxml2/entities.c b/reactos/lib/3rdparty/libxml2/entities.c index 08034c3559d..21a64c79cc2 100644 --- a/reactos/lib/3rdparty/libxml2/entities.c +++ b/reactos/lib/3rdparty/libxml2/entities.c @@ -28,35 +28,35 @@ static xmlEntity xmlEntityLt = { NULL, XML_ENTITY_DECL, BAD_CAST "lt", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "<", BAD_CAST "<", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0 }; static xmlEntity xmlEntityGt = { NULL, XML_ENTITY_DECL, BAD_CAST "gt", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST ">", BAD_CAST ">", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0 }; static xmlEntity xmlEntityAmp = { NULL, XML_ENTITY_DECL, BAD_CAST "amp", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "&", BAD_CAST "&", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0 }; static xmlEntity xmlEntityQuot = { NULL, XML_ENTITY_DECL, BAD_CAST "quot", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "\"", BAD_CAST "\"", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0 }; static xmlEntity xmlEntityApos = { NULL, XML_ENTITY_DECL, BAD_CAST "apos", - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, BAD_CAST "'", BAD_CAST "'", 1, XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, NULL, NULL, 0 @@ -369,7 +369,7 @@ xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type, * * Do an entity lookup in the table. * returns the corresponding parameter entity, if found. - * + * * Returns A pointer to the entity structure or NULL if not found. */ static xmlEntityPtr @@ -384,7 +384,7 @@ xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) { * * Do an entity lookup in the internal and external subsets and * returns the corresponding parameter entity, if found. - * + * * Returns A pointer to the entity structure or NULL if not found. */ xmlEntityPtr @@ -415,7 +415,7 @@ xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name) { * Do an entity lookup in the DTD entity hash table and * returns the corresponding entity, if found. * Note: the first argument is the document node, not the DTD node. - * + * * Returns A pointer to the entity structure or NULL if not found. */ xmlEntityPtr @@ -439,7 +439,7 @@ xmlGetDtdEntity(xmlDocPtr doc, const xmlChar *name) { * Do an entity lookup in the document entity hash table and * returns the corresponding entity, otherwise a lookup is done * in the predefined entities too. - * + * * Returns A pointer to the entity structure or NULL if not found. */ xmlEntityPtr @@ -766,7 +766,7 @@ xmlFreeEntitiesTable(xmlEntitiesTablePtr table) { * @ent: An entity * * Build a copy of an entity - * + * * Returns the new xmlEntitiesPtr or NULL in case of error. */ static xmlEntityPtr @@ -802,7 +802,7 @@ xmlCopyEntity(xmlEntityPtr ent) { * @table: An entity table * * Build a copy of an entity table. - * + * * Returns the new xmlEntitiesTablePtr or NULL in case of error. */ xmlEntitiesTablePtr @@ -951,7 +951,7 @@ static void xmlDumpEntityDeclScan(xmlEntityPtr ent, xmlBufferPtr buf) { xmlDumpEntityDecl(buf, ent); } - + /** * xmlDumpEntitiesTable: * @buf: An XML buffer. diff --git a/reactos/lib/3rdparty/libxml2/error.c b/reactos/lib/3rdparty/libxml2/error.c index 17ced9221b9..d8b6f4ba659 100644 --- a/reactos/lib/3rdparty/libxml2/error.c +++ b/reactos/lib/3rdparty/libxml2/error.c @@ -59,7 +59,7 @@ void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, * @ctx: an error context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Default handler for out of context error messages. */ void @@ -77,7 +77,7 @@ xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { /** * initGenericErrorDefaultFunc: * @handler: the handler - * + * * Set or reset (if NULL) the default handler for generic errors * to the builtin error function. */ @@ -140,7 +140,7 @@ xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) { /** * xmlParserPrintFileInfo: * @input: an xmlParserInputPtr input - * + * * Displays the associated file and line informations for the current input */ @@ -160,12 +160,12 @@ xmlParserPrintFileInfo(xmlParserInputPtr input) { /** * xmlParserPrintFileContext: * @input: an xmlParserInputPtr input - * + * * Displays current context within the input content for error tracking */ static void -xmlParserPrintFileContextInternal(xmlParserInputPtr input , +xmlParserPrintFileContextInternal(xmlParserInputPtr input , xmlGenericErrorFunc channel, void *data ) { const xmlChar *cur, *base; unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ @@ -181,7 +181,7 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input , } n = 0; /* search backwards for beginning-of-line (to max buff size) */ - while ((n++ < (sizeof(content)-1)) && (cur > base) && + while ((n++ < (sizeof(content)-1)) && (cur > base) && (*(cur) != '\n') && (*(cur) != '\r')) cur--; if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; @@ -191,7 +191,7 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input , n = 0; ctnt = content; /* copy selected text to our buffer */ - while ((*cur != 0) && (*(cur) != '\n') && + while ((*cur != 0) && (*(cur) != '\n') && (*(cur) != '\r') && (n < sizeof(content)-1)) { *ctnt++ = *cur++; n++; @@ -216,7 +216,7 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input , /** * xmlParserPrintFileContext: * @input: an xmlParserInputPtr input - * + * * Displays current context within the input content for error tracking */ void @@ -429,7 +429,7 @@ xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str, * @str2: extra string info * @str3: extra string info * @int1: extra int info - * @col: column number of the error or 0 if N/A + * @col: column number of the error or 0 if N/A * @msg: the message to display/transmit * @...: extra parameters for the message display * @@ -651,7 +651,7 @@ __xmlSimpleError(int domain, int code, xmlNodePtr node, * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an error messages, gives file, line, position and * extra parameters. */ @@ -694,7 +694,7 @@ xmlParserError(void *ctx, const char *msg, ...) * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a warning messages, gives file, line, position and * extra parameters. */ @@ -715,7 +715,7 @@ xmlParserWarning(void *ctx, const char *msg, ...) } xmlParserPrintFileInfo(input); } - + xmlGenericError(xmlGenericErrorContext, "warning: "); XML_GET_VAR_STR(msg, str); xmlGenericError(xmlGenericErrorContext, "%s", str); @@ -743,7 +743,7 @@ xmlParserWarning(void *ctx, const char *msg, ...) * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an validity error messages, gives file, * line, position and extra parameters. */ @@ -761,7 +761,7 @@ xmlParserValidityError(void *ctx, const char *msg, ...) input = ctxt->input; if ((input->filename == NULL) && (ctxt->inputNr > 1)) input = ctxt->inputTab[ctxt->inputNr - 2]; - + if (had_info == 0) { xmlParserPrintFileInfo(input); } @@ -787,7 +787,7 @@ xmlParserValidityError(void *ctx, const char *msg, ...) * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a validity warning messages, gives file, line, * position and extra parameters. */ @@ -806,7 +806,7 @@ xmlParserValidityWarning(void *ctx, const char *msg, ...) xmlParserPrintFileInfo(input); } - + xmlGenericError(xmlGenericErrorContext, "validity warning: "); XML_GET_VAR_STR(msg, str); xmlGenericError(xmlGenericErrorContext, "%s", str); diff --git a/reactos/lib/3rdparty/libxml2/globals.c b/reactos/lib/3rdparty/libxml2/globals.c index e4e4e4e24c7..41ee583983e 100644 --- a/reactos/lib/3rdparty/libxml2/globals.c +++ b/reactos/lib/3rdparty/libxml2/globals.c @@ -243,7 +243,7 @@ static int xmlPedanticParserDefaultValueThrDef = 0; * xmlLineNumbersDefaultValue: * * Global setting, indicate that the parser should store the line number - * in the content field of elements in the DOM tree. + * in the content field of elements in the DOM tree. * Disabled by default since this may not be safe for old classes of * applicaton. */ @@ -513,7 +513,7 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs) gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId; gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber; gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber; - gs->xmlDoValidityCheckingDefaultValue = + gs->xmlDoValidityCheckingDefaultValue = xmlDoValidityCheckingDefaultValueThrDef; #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) gs->xmlFree = (xmlFreeFunc) xmlMemFree; @@ -538,7 +538,7 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs) gs->xmlParserVersion = LIBXML_VERSION_STRING; gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; - gs->xmlSubstituteEntitiesDefaultValue = + gs->xmlSubstituteEntitiesDefaultValue = xmlSubstituteEntitiesDefaultValueThrDef; gs->xmlGenericError = xmlGenericErrorThrDef; @@ -589,7 +589,7 @@ xmlRegisterNodeFunc xmlRegisterNodeDefault(xmlRegisterNodeFunc func) { xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue; - + __xmlRegisterCallbacks = 1; xmlRegisterNodeDefaultValue = func; return(old); @@ -599,10 +599,10 @@ xmlRegisterNodeFunc xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func) { xmlRegisterNodeFunc old; - + xmlMutexLock(xmlThrDefMutex); old = xmlRegisterNodeDefaultValueThrDef; - + __xmlRegisterCallbacks = 1; xmlRegisterNodeDefaultValueThrDef = func; xmlMutexUnlock(xmlThrDefMutex); @@ -622,7 +622,7 @@ xmlDeregisterNodeFunc xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func) { xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue; - + __xmlRegisterCallbacks = 1; xmlDeregisterNodeDefaultValue = func; return(old); @@ -635,7 +635,7 @@ xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func) xmlMutexLock(xmlThrDefMutex); old = xmlDeregisterNodeDefaultValueThrDef; - + __xmlRegisterCallbacks = 1; xmlDeregisterNodeDefaultValueThrDef = func; xmlMutexUnlock(xmlThrDefMutex); @@ -647,7 +647,7 @@ xmlParserInputBufferCreateFilenameFunc xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func) { xmlParserInputBufferCreateFilenameFunc old; - + xmlMutexLock(xmlThrDefMutex); old = xmlParserInputBufferCreateFilenameValueThrDef; if (old == NULL) { @@ -664,7 +664,7 @@ xmlOutputBufferCreateFilenameFunc xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func) { xmlOutputBufferCreateFilenameFunc old; - + xmlMutexLock(xmlThrDefMutex); old = xmlOutputBufferCreateFilenameValueThrDef; #ifdef LIBXML_OUTPUT_ENABLED diff --git a/reactos/lib/3rdparty/libxml2/hash.c b/reactos/lib/3rdparty/libxml2/hash.c index e92a5a040b2..7983fb411e6 100644 --- a/reactos/lib/3rdparty/libxml2/hash.c +++ b/reactos/lib/3rdparty/libxml2/hash.c @@ -64,7 +64,7 @@ xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3) { unsigned long value = 0L; char ch; - + if (name != NULL) { value += 30 * (*name); while ((ch = *name++) != 0) { @@ -91,7 +91,7 @@ xmlHashComputeQKey(xmlHashTablePtr table, const xmlChar *prefix3, const xmlChar *name3) { unsigned long value = 0L; char ch; - + if (prefix != NULL) value += 30 * (*prefix); else @@ -144,10 +144,10 @@ xmlHashComputeQKey(xmlHashTablePtr table, xmlHashTablePtr xmlHashCreate(int size) { xmlHashTablePtr table; - + if (size <= 0) size = 256; - + table = xmlMalloc(sizeof(xmlHashTable)); if (table) { table->dict = NULL; @@ -202,7 +202,7 @@ xmlHashGrow(xmlHashTablePtr table, int size) { #ifdef DEBUG_GROW unsigned long nbElem = 0; #endif - + if (table == NULL) return(-1); if (size < 8) @@ -214,7 +214,7 @@ xmlHashGrow(xmlHashTablePtr table, int size) { oldtable = table->table; if (oldtable == NULL) return(-1); - + table->table = xmlMalloc(size * sizeof(xmlHashEntry)); if (table->table == NULL) { table->table = oldtable; @@ -224,13 +224,13 @@ xmlHashGrow(xmlHashTablePtr table, int size) { table->size = size; /* If the two loops are merged, there would be situations where - a new entry needs to allocated and data copied into it from + a new entry needs to allocated and data copied into it from the main table. So instead, we run through the array twice, first copying all the elements in the main array (where we can't get conflicts) and then the rest, so we only free (and don't allocate) */ for (i = 0; i < oldsize; i++) { - if (oldtable[i].valid == 0) + if (oldtable[i].valid == 0) continue; key = xmlHashComputeKey(table, oldtable[i].name, oldtable[i].name2, oldtable[i].name3); @@ -572,7 +572,7 @@ xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, entry->valid = 1; - if (insert != NULL) + if (insert != NULL) insert->next = entry; table->nbElems++; @@ -721,7 +721,7 @@ xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, * Returns the a pointer to the userdata */ void * -xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, +xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3) { unsigned long key; xmlHashEntryPtr entry; @@ -794,14 +794,14 @@ typedef struct { void *data; } stubData; -static void -stubHashScannerFull (void *payload, void *data, const xmlChar *name, +static void +stubHashScannerFull (void *payload, void *data, const xmlChar *name, const xmlChar *name2 ATTRIBUTE_UNUSED, const xmlChar *name3 ATTRIBUTE_UNUSED) { stubData *stubdata = (stubData *) data; stubdata->hashscanner (payload, stubdata->data, (xmlChar *) name); -} - +} + /** * xmlHashScan: * @table: the hash table @@ -814,7 +814,7 @@ void xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) { stubData stubdata; stubdata.data = data; - stubdata.hashscanner = f; + stubdata.hashscanner = f; xmlHashScanFull (table, stubHashScannerFull, &stubdata); } @@ -839,7 +839,7 @@ xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data) { if (table->table) { for(i = 0; i < table->size; i++) { - if (table->table[i].valid == 0) + if (table->table[i].valid == 0) continue; iter = &(table->table[i]); while (iter) { @@ -867,7 +867,7 @@ xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data) { * the comparison is considered to match. */ void -xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, +xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data) { xmlHashScanFull3 (table, name, name2, name3, @@ -888,7 +888,7 @@ xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, * the comparison is considered to match. */ void -xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, +xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScannerFull f, void *data) { int i; diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/DOCBparser.h b/reactos/lib/3rdparty/libxml2/include/libxml/DOCBparser.h index 461d4ee802d..9394fa71bdd 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/DOCBparser.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/DOCBparser.h @@ -47,44 +47,44 @@ XMLPUBFUN int XMLCALL const unsigned char *in, int *inlen, int quoteChar); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbSAXParseDoc (xmlChar *cur, const char *encoding, docbSAXHandlerPtr sax, void *userData); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbParseDoc (xmlChar *cur, const char *encoding); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbSAXParseFile (const char *filename, const char *encoding, docbSAXHandlerPtr sax, void *userData); -XMLPUBFUN docbDocPtr XMLCALL +XMLPUBFUN docbDocPtr XMLCALL docbParseFile (const char *filename, const char *encoding); /** * Interfaces for the Push mode. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL docbFreeParserCtxt (docbParserCtxtPtr ctxt); -XMLPUBFUN docbParserCtxtPtr XMLCALL +XMLPUBFUN docbParserCtxtPtr XMLCALL docbCreatePushParserCtxt(docbSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL docbParseChunk (docbParserCtxtPtr ctxt, const char *chunk, int size, int terminate); -XMLPUBFUN docbParserCtxtPtr XMLCALL +XMLPUBFUN docbParserCtxtPtr XMLCALL docbCreateFileParserCtxt(const char *filename, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL docbParseDocument (docbParserCtxtPtr ctxt); #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/HTMLparser.h b/reactos/lib/3rdparty/libxml2/include/libxml/HTMLparser.h index 2604d860047..c3d3c3e236a 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/HTMLparser.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/HTMLparser.h @@ -83,84 +83,84 @@ struct _htmlEntityDesc { /* * There is only few public functions. */ -XMLPUBFUN const htmlElemDesc * XMLCALL +XMLPUBFUN const htmlElemDesc * XMLCALL htmlTagLookup (const xmlChar *tag); -XMLPUBFUN const htmlEntityDesc * XMLCALL +XMLPUBFUN const htmlEntityDesc * XMLCALL htmlEntityLookup(const xmlChar *name); -XMLPUBFUN const htmlEntityDesc * XMLCALL +XMLPUBFUN const htmlEntityDesc * XMLCALL htmlEntityValueLookup(unsigned int value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlIsAutoClosed(htmlDocPtr doc, htmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlAutoCloseTag(htmlDocPtr doc, const xmlChar *name, htmlNodePtr elem); -XMLPUBFUN const htmlEntityDesc * XMLCALL +XMLPUBFUN const htmlEntityDesc * XMLCALL htmlParseEntityRef(htmlParserCtxtPtr ctxt, const xmlChar **str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlParseCharRef(htmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlParseElement(htmlParserCtxtPtr ctxt); -XMLPUBFUN htmlParserCtxtPtr XMLCALL +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateMemoryParserCtxt(const char *buffer, int size); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlParseDocument(htmlParserCtxtPtr ctxt); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlSAXParseDoc (xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void *userData); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlParseDoc (xmlChar *cur, const char *encoding); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr sax, void *userData); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlParseFile (const char *filename, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL UTF8ToHtml (unsigned char *out, int *outlen, const unsigned char *in, int *inlen); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlEncodeEntities(unsigned char *out, int *outlen, const unsigned char *in, int *inlen, int quoteChar); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlIsScriptAttribute(const xmlChar *name); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlHandleOmittedElem(int val); #ifdef LIBXML_PUSH_ENABLED /** * Interfaces for the Push mode. */ -XMLPUBFUN htmlParserCtxtPtr XMLCALL +XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlParseChunk (htmlParserCtxtPtr ctxt, const char *chunk, int size, int terminate); #endif /* LIBXML_PUSH_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlFreeParserCtxt (htmlParserCtxtPtr ctxt); /* diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/HTMLtree.h b/reactos/lib/3rdparty/libxml2/include/libxml/HTMLtree.h index 50b85442e53..ae8bac83fa3 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/HTMLtree.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/HTMLtree.h @@ -62,73 +62,73 @@ extern "C" { XMLPUBFUN htmlDocPtr XMLCALL htmlNewDoc (const xmlChar *URI, const xmlChar *ExternalID); -XMLPUBFUN htmlDocPtr XMLCALL +XMLPUBFUN htmlDocPtr XMLCALL htmlNewDocNoDtD (const xmlChar *URI, const xmlChar *ExternalID); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL htmlGetMetaEncoding (htmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSetMetaEncoding (htmlDocPtr doc, const xmlChar *encoding); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDocDumpMemory (xmlDocPtr cur, xmlChar **mem, int *size); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlDocDump (FILE *f, xmlDocPtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSaveFile (const char *filename, xmlDocPtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlNodeDump (xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlNodeDumpFile (FILE *out, xmlDocPtr doc, xmlNodePtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlNodeDumpFileFormat (FILE *out, xmlDocPtr doc, xmlNodePtr cur, const char *encoding, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSaveFileEnc (const char *filename, xmlDocPtr cur, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlSaveFileFormat (const char *filename, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL - htmlNodeDumpOutput (xmlOutputBufferPtr buf, +XMLPUBFUN void XMLCALL + htmlNodeDumpOutput (xmlOutputBufferPtr buf, xmlDocPtr doc, - xmlNodePtr cur, + xmlNodePtr cur, const char *encoding); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL htmlIsBooleanAttr (const xmlChar *name); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/SAX.h b/reactos/lib/3rdparty/libxml2/include/libxml/SAX.h index 0ca161b6089..20093ceb685 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/SAX.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/SAX.h @@ -25,53 +25,53 @@ extern "C" { #endif XMLPUBFUN const xmlChar * XMLCALL getPublicId (void *ctx); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL getSystemId (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL setDocumentLocator (void *ctx, xmlSAXLocatorPtr loc); - -XMLPUBFUN int XMLCALL + +XMLPUBFUN int XMLCALL getLineNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL getColumnNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL isStandalone (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL hasInternalSubset (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL hasExternalSubset (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL internalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL externalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL getEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL getParameterEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL resolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL entityDecl (void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL attributeDecl (void *ctx, const xmlChar *elem, const xmlChar *fullname, @@ -79,87 +79,87 @@ XMLPUBFUN void XMLCALL int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL elementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL notationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL unparsedEntityDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL startDocument (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL endDocument (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL attribute (void *ctx, const xmlChar *fullname, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL startElement (void *ctx, const xmlChar *fullname, const xmlChar **atts); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL endElement (void *ctx, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL reference (void *ctx, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL characters (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL ignorableWhitespace (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL processingInstruction (void *ctx, const xmlChar *target, const xmlChar *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL globalNamespace (void *ctx, const xmlChar *href, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL setNamespace (void *ctx, const xmlChar *name); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL getNamespace (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL checkNamespace (void *ctx, xmlChar *nameSpace); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL namespaceDecl (void *ctx, const xmlChar *href, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL comment (void *ctx, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL cdataBlock (void *ctx, const xmlChar *value, int len); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, int warning); #ifdef LIBXML_HTML_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); #endif #ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); #endif #endif /* LIBXML_SAX1_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/SAX2.h b/reactos/lib/3rdparty/libxml2/include/libxml/SAX2.h index 6626564571b..bc892015f0e 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/SAX2.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/SAX2.h @@ -23,53 +23,53 @@ extern "C" { #endif XMLPUBFUN const xmlChar * XMLCALL xmlSAX2GetPublicId (void *ctx); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlSAX2GetSystemId (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2SetDocumentLocator (void *ctx, xmlSAXLocatorPtr loc); - -XMLPUBFUN int XMLCALL + +XMLPUBFUN int XMLCALL xmlSAX2GetLineNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2GetColumnNumber (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2IsStandalone (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2HasInternalSubset (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAX2HasExternalSubset (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2ExternalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlSAX2GetParameterEntity (void *ctx, const xmlChar *name); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlSAX2ResolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2EntityDecl (void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2AttributeDecl (void *ctx, const xmlChar *elem, const xmlChar *fullname, @@ -77,33 +77,33 @@ XMLPUBFUN void XMLCALL int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2ElementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2NotationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2UnparsedEntityDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2StartDocument (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2EndDocument (void *ctx); #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2StartElement (void *ctx, const xmlChar *fullname, const xmlChar **atts); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2EndElement (void *ctx, const xmlChar *name); #endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */ @@ -122,25 +122,25 @@ XMLPUBFUN void XMLCALL const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2Reference (void *ctx, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2Characters (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2IgnorableWhitespace (void *ctx, const xmlChar *ch, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2ProcessingInstruction (void *ctx, const xmlChar *target, const xmlChar *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2Comment (void *ctx, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2CDataBlock (void *ctx, const xmlChar *value, int len); @@ -153,22 +153,22 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlSAXVersion (xmlSAXHandler *hdlr, int version); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr, int warning); #ifdef LIBXML_HTML_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL htmlDefaultSAXHandlerInit (void); #endif #ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL docbDefaultSAXHandlerInit (void); #endif -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDefaultSAXHandlerInit (void); #ifdef __cplusplus } diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/c14n.h b/reactos/lib/3rdparty/libxml2/include/libxml/c14n.h index 9f4c6c019bf..c96ec397b49 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/c14n.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/c14n.h @@ -2,30 +2,30 @@ * Summary: Provide Canonical XML and Exclusive XML Canonicalization * Description: the c14n modules provides a * - * "Canonical XML" implementation + * "Canonical XML" implementation * http://www.w3.org/TR/xml-c14n - * + * * and an * * "Exclusive XML Canonicalization" implementation * http://www.w3.org/TR/xml-exc-c14n - + * Copy: See Copyright for the status of this software. - * + * * Author: Aleksey Sanin */ #ifndef __XML_C14N_H__ -#define __XML_C14N_H__ +#define __XML_C14N_H__ #ifdef LIBXML_C14N_ENABLED #ifdef LIBXML_OUTPUT_ENABLED #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #include #include -#include +#include /* * XML Canonicazation @@ -37,28 +37,28 @@ extern "C" { * Canonical form of an XML document could be created if and only if * a) default attributes (if any) are added to all nodes * b) all character and parsed entity references are resolved - * In order to achive this in libxml2 the document MUST be loaded with + * In order to achive this in libxml2 the document MUST be loaded with * following global setings: - * + * * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; * xmlSubstituteEntitiesDefault(1); * * or corresponding parser context setting: * xmlParserCtxtPtr ctxt; - * - * ... + * + * ... * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS; * ctxt->replaceEntities = 1; * ... */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlC14NDocSaveTo (xmlDocPtr doc, xmlNodeSetPtr nodes, int exclusive, xmlChar **inclusive_ns_prefixes, - int with_comments, + int with_comments, xmlOutputBufferPtr buf); XMLPUBFUN int XMLCALL @@ -66,7 +66,7 @@ XMLPUBFUN int XMLCALL xmlNodeSetPtr nodes, int exclusive, xmlChar **inclusive_ns_prefixes, - int with_comments, + int with_comments, xmlChar **doc_txt_ptr); XMLPUBFUN int XMLCALL @@ -74,7 +74,7 @@ XMLPUBFUN int XMLCALL xmlNodeSetPtr nodes, int exclusive, xmlChar **inclusive_ns_prefixes, - int with_comments, + int with_comments, const char* filename, int compression); @@ -82,17 +82,17 @@ XMLPUBFUN int XMLCALL /** * This is the core C14N function */ -typedef int (*xmlC14NIsVisibleCallback) (void* user_data, +typedef int (*xmlC14NIsVisibleCallback) (void* user_data, xmlNodePtr node, xmlNodePtr parent); XMLPUBFUN int XMLCALL xmlC14NExecute (xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, - void* user_data, + void* user_data, int exclusive, xmlChar **inclusive_ns_prefixes, - int with_comments, + int with_comments, xmlOutputBufferPtr buf); #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/catalog.h b/reactos/lib/3rdparty/libxml2/include/libxml/catalog.h index b4441370fcf..5a13f51b6c6 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/catalog.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/catalog.h @@ -68,111 +68,111 @@ typedef xmlCatalog *xmlCatalogPtr; */ XMLPUBFUN xmlCatalogPtr XMLCALL xmlNewCatalog (int sgml); -XMLPUBFUN xmlCatalogPtr XMLCALL +XMLPUBFUN xmlCatalogPtr XMLCALL xmlLoadACatalog (const char *filename); -XMLPUBFUN xmlCatalogPtr XMLCALL +XMLPUBFUN xmlCatalogPtr XMLCALL xmlLoadSGMLSuperCatalog (const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlConvertSGMLCatalog (xmlCatalogPtr catal); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlACatalogAdd (xmlCatalogPtr catal, const xmlChar *type, const xmlChar *orig, const xmlChar *replace); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlACatalogRemove (xmlCatalogPtr catal, const xmlChar *value); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolve (xmlCatalogPtr catal, const xmlChar *pubID, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolveSystem(xmlCatalogPtr catal, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolvePublic(xmlCatalogPtr catal, const xmlChar *pubID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlACatalogResolveURI (xmlCatalogPtr catal, const xmlChar *URI); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlACatalogDump (xmlCatalogPtr catal, FILE *out); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeCatalog (xmlCatalogPtr catal); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogIsEmpty (xmlCatalogPtr catal); /* * Global operations. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitializeCatalog (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlLoadCatalog (const char *filename); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlLoadCatalogs (const char *paths); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogCleanup (void); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogDump (FILE *out); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolve (const xmlChar *pubID, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolveSystem (const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolvePublic (const xmlChar *pubID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogResolveURI (const xmlChar *URI); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogAdd (const xmlChar *type, const xmlChar *orig, const xmlChar *replace); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogRemove (const xmlChar *value); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseCatalogFile (const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogConvert (void); /* * Strictly minimal interfaces for per-document catalogs used * by the parser. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogFreeLocal (void *catalogs); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlCatalogAddLocal (void *catalogs, const xmlChar *URL); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogLocalResolve (void *catalogs, const xmlChar *pubID, const xmlChar *sysID); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlCatalogLocalResolveURI(void *catalogs, const xmlChar *URI); /* * Preference settings. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCatalogSetDebug (int level); -XMLPUBFUN xmlCatalogPrefer XMLCALL +XMLPUBFUN xmlCatalogPrefer XMLCALL xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCatalogSetDefaults (xmlCatalogAllow allow); -XMLPUBFUN xmlCatalogAllow XMLCALL +XMLPUBFUN xmlCatalogAllow XMLCALL xmlCatalogGetDefaults (void); /* DEPRECATED interfaces */ -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlCatalogGetSystem (const xmlChar *sysID); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlCatalogGetPublic (const xmlChar *pubID); #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/debugXML.h b/reactos/lib/3rdparty/libxml2/include/libxml/debugXML.h index 5a9d20bcf5e..2377447bb73 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/debugXML.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/debugXML.h @@ -25,18 +25,18 @@ extern "C" { /* * The standard Dump routines. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpString (FILE *output, const xmlChar *str); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpAttr (FILE *output, xmlAttrPtr attr, int depth); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpAttrList (FILE *output, xmlAttrPtr attr, int depth); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpOneNode (FILE *output, xmlNodePtr node, int depth); @@ -54,10 +54,10 @@ XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL xmlDebugDumpDocument (FILE *output, xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpDTD (FILE *output, xmlDtdPtr dtd); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDebugDumpEntities (FILE *output, xmlDocPtr doc); @@ -77,12 +77,12 @@ XMLPUBFUN int XMLCALL * * ****************************************************************/ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlLsOneNode (FILE *output, xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlLsCountNode (xmlNodePtr node); -XMLPUBFUN const char * XMLCALL +XMLPUBFUN const char * XMLCALL xmlBoolToText (int boolval); /**************************************************************** @@ -136,63 +136,63 @@ typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShellPrintXPathError (int errorType, const char *arg); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShellPrintXPathResult(xmlXPathObjectPtr list); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellList (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellBase (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellDir (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellLoad (xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node, xmlNodePtr node2); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShellPrintNode (xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellCat (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellWrite (xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellSave (xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node, xmlNodePtr node2); #endif /* LIBXML_OUTPUT_ENABLED */ #ifdef LIBXML_VALID_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellValidate (xmlShellCtxtPtr ctxt, char *dtd, xmlNodePtr node, xmlNodePtr node2); #endif /* LIBXML_VALID_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellDu (xmlShellCtxtPtr ctxt, char *arg, xmlNodePtr tree, xmlNodePtr node2); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlShellPwd (xmlShellCtxtPtr ctxt, char *buffer, xmlNodePtr node, @@ -201,12 +201,12 @@ XMLPUBFUN int XMLCALL /* * The Shell interface. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlShell (xmlDocPtr doc, char *filename, xmlShellReadlineFunc input, FILE *output); - + #endif /* LIBXML_XPATH_ENABLED */ #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/dict.h b/reactos/lib/3rdparty/libxml2/include/libxml/dict.h index abb8339cb89..492d65a4b54 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/dict.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/dict.h @@ -33,28 +33,28 @@ XMLPUBFUN xmlDictPtr XMLCALL xmlDictCreateSub(xmlDictPtr sub); XMLPUBFUN int XMLCALL xmlDictReference(xmlDictPtr dict); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDictFree (xmlDictPtr dict); /* * Lookup of entry in the dictionnary. */ -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlDictLookup (xmlDictPtr dict, const xmlChar *name, int len); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlDictExists (xmlDictPtr dict, const xmlChar *name, int len); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlDictQLookup (xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name); XMLPUBFUN int XMLCALL xmlDictOwns (xmlDictPtr dict, const xmlChar *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDictSize (xmlDictPtr dict); /* diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/encoding.h b/reactos/lib/3rdparty/libxml2/include/libxml/encoding.h index 7f4251bbe4c..7a9c113a889 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/encoding.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/encoding.h @@ -150,32 +150,32 @@ extern "C" { /* * Interfaces for encoding handlers. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitCharEncodingHandlers (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupCharEncodingHandlers (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler); XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlGetCharEncodingHandler (xmlCharEncoding enc); XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlFindCharEncodingHandler (const char *name); XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL - xmlNewCharEncodingHandler (const char *name, + xmlNewCharEncodingHandler (const char *name, xmlCharEncodingInputFunc input, xmlCharEncodingOutputFunc output); /* * Interfaces for encoding names and aliases. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAddEncodingAlias (const char *name, const char *alias); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDelEncodingAlias (const char *alias); XMLPUBFUN const char * XMLCALL xmlGetEncodingAlias (const char *alias); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupEncodingAliases (void); XMLPUBFUN xmlCharEncoding XMLCALL xmlParseCharEncoding (const char *name); @@ -189,12 +189,12 @@ XMLPUBFUN xmlCharEncoding XMLCALL xmlDetectCharEncoding (const unsigned char *in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCharEncOutFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCharEncInFunc (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in); @@ -202,20 +202,20 @@ XMLPUBFUN int XMLCALL xmlCharEncFirstLine (xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCharEncCloseFunc (xmlCharEncodingHandler *handler); /* * Export a few useful functions */ #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL UTF8Toisolat1 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL isolat1ToUTF8 (unsigned char *out, int *outlen, const unsigned char *in, diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/entities.h b/reactos/lib/3rdparty/libxml2/include/libxml/entities.h index 0bb28a0bdc3..e43498bfd45 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/entities.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/entities.h @@ -71,7 +71,7 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr; */ #ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitializePredefinedEntities (void); #endif /* LIBXML_LEGACY_ENABLED */ XMLPUBFUN xmlEntityPtr XMLCALL @@ -81,53 +81,53 @@ XMLPUBFUN xmlEntityPtr XMLCALL const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlAddDtdEntity (xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlGetPredefinedEntity (const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlGetDocEntity (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlGetDtdEntity (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlGetParameterEntity (xmlDocPtr doc, const xmlChar *name); #ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlEncodeEntities (xmlDocPtr doc, const xmlChar *input); #endif /* LIBXML_LEGACY_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlEncodeSpecialChars (xmlDocPtr doc, const xmlChar *input); -XMLPUBFUN xmlEntitiesTablePtr XMLCALL +XMLPUBFUN xmlEntitiesTablePtr XMLCALL xmlCreateEntitiesTable (void); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlEntitiesTablePtr XMLCALL +XMLPUBFUN xmlEntitiesTablePtr XMLCALL xmlCopyEntitiesTable (xmlEntitiesTablePtr table); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeEntitiesTable (xmlEntitiesTablePtr table); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpEntitiesTable (xmlBufferPtr buf, xmlEntitiesTablePtr table); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpEntityDecl (xmlBufferPtr buf, xmlEntityPtr ent); #endif /* LIBXML_OUTPUT_ENABLED */ #ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupPredefinedEntities(void); #endif /* LIBXML_LEGACY_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/globals.h b/reactos/lib/3rdparty/libxml2/include/libxml/globals.h index 1173a8f1cc7..36b4f78f1c8 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/globals.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/globals.h @@ -78,7 +78,7 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node); typedef struct _xmlGlobalState xmlGlobalState; typedef xmlGlobalState *xmlGlobalStatePtr; -struct _xmlGlobalState +struct _xmlGlobalState { const char *xmlParserVersion; @@ -143,9 +143,9 @@ XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNo XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func); XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func); -XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL +XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func); -XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func); /** DOC_DISABLE */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/hash.h b/reactos/lib/3rdparty/libxml2/include/libxml/hash.h index 7fe4be754c3..02c11e42fa1 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/hash.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/hash.h @@ -1,6 +1,6 @@ /* * Summary: Chained hash tables - * Description: This module implements the hash table support used in + * Description: This module implements the hash table support used in * various places in the library. * * Copy: See Copyright for the status of this software. @@ -108,40 +108,40 @@ XMLPUBFUN xmlHashTablePtr XMLCALL XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreateDict(int size, xmlDictPtr dict); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashFree (xmlHashTablePtr table, xmlHashDeallocator f); /* * Add a new entry to the hash table. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashAddEntry (xmlHashTablePtr table, const xmlChar *name, void *userdata); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashUpdateEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashUpdateEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, @@ -152,13 +152,13 @@ XMLPUBFUN int XMLCALL /* * Remove an entry from the hash table. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, xmlHashDeallocator f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f); @@ -166,29 +166,29 @@ XMLPUBFUN int XMLCALL /* * Retrieve the userdata. */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashLookup (xmlHashTablePtr table, const xmlChar *name); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashLookup2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashLookup3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashQLookup (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashQLookup2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, const xmlChar *name2, const xmlChar *prefix2); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlHashQLookup3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, @@ -200,27 +200,27 @@ XMLPUBFUN void * XMLCALL /* * Helpers. */ -XMLPUBFUN xmlHashTablePtr XMLCALL +XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCopy (xmlHashTablePtr table, xmlHashCopier f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlHashSize (xmlHashTablePtr table); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScan (xmlHashTablePtr table, xmlHashScanner f, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScan3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScanFull (xmlHashTablePtr table, xmlHashScannerFull f, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/list.h b/reactos/lib/3rdparty/libxml2/include/libxml/list.h index 1d83482430f..0504e0cff4a 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/list.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/list.h @@ -1,6 +1,6 @@ /* * Summary: lists interfaces - * Description: this module implement the list support used in + * Description: this module implement the list support used in * various place in the library. * * Copy: See Copyright for the status of this software. @@ -55,76 +55,76 @@ typedef int (*xmlListWalker) (const void *data, const void *user); XMLPUBFUN xmlListPtr XMLCALL xmlListCreate (xmlListDeallocator deallocator, xmlListDataCompare compare); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListDelete (xmlListPtr l); /* Basic Operators */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlListSearch (xmlListPtr l, void *data); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlListReverseSearch (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListInsert (xmlListPtr l, void *data) ; -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListAppend (xmlListPtr l, void *data) ; -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListRemoveFirst (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListRemoveLast (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListRemoveAll (xmlListPtr l, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListClear (xmlListPtr l); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListEmpty (xmlListPtr l); -XMLPUBFUN xmlLinkPtr XMLCALL +XMLPUBFUN xmlLinkPtr XMLCALL xmlListFront (xmlListPtr l); -XMLPUBFUN xmlLinkPtr XMLCALL +XMLPUBFUN xmlLinkPtr XMLCALL xmlListEnd (xmlListPtr l); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListSize (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListPopFront (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListPopBack (xmlListPtr l); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListPushFront (xmlListPtr l, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListPushBack (xmlListPtr l, void *data); /* Advanced Operators */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListReverse (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListSort (xmlListPtr l); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListWalk (xmlListPtr l, xmlListWalker walker, const void *user); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListReverseWalk (xmlListPtr l, xmlListWalker walker, const void *user); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlListMerge (xmlListPtr l1, xmlListPtr l2); -XMLPUBFUN xmlListPtr XMLCALL +XMLPUBFUN xmlListPtr XMLCALL xmlListDup (const xmlListPtr old); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlListCopy (xmlListPtr cur, const xmlListPtr old); /* Link operators */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlLinkGetData (xmlLinkPtr lk); /* xmlListUnique() */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/nanoftp.h b/reactos/lib/3rdparty/libxml2/include/libxml/nanoftp.h index e3c28a01424..63580376bd4 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/nanoftp.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/nanoftp.h @@ -7,7 +7,7 @@ * * Author: Daniel Veillard */ - + #ifndef __NANO_FTP_H__ #define __NANO_FTP_H__ @@ -20,7 +20,7 @@ extern "C" { #endif /** - * ftpListCallback: + * ftpListCallback: * @userData: user provided data for the callback * @filename: the file name (including "->" when links are shown) * @attrib: the attribute string @@ -44,7 +44,7 @@ typedef void (*ftpListCallback) (void *userData, const char *month, int day, int hour, int minute); /** - * ftpDataCallback: + * ftpDataCallback: * @userData: the user provided context * @data: the data received * @len: its size in bytes @@ -60,78 +60,78 @@ typedef void (*ftpDataCallback) (void *userData, */ XMLPUBFUN void XMLCALL xmlNanoFTPInit (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoFTPCleanup (void); /* * Creating/freeing contexts. */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoFTPNewCtxt (const char *URL); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoFTPFreeCtxt (void * ctx); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoFTPConnectTo (const char *server, int port); /* * Opening/closing session connections. */ -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoFTPOpen (const char *URL); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPConnect (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPClose (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPQuit (void *ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoFTPScanProxy (const char *URL); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoFTPProxy (const char *host, int port, const char *user, const char *passwd, int type); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPUpdateURL (void *ctx, const char *URL); /* * Rather internal commands. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPGetResponse (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPCheckResponse (void *ctx); /* * CD/DIR/GET handlers. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPCwd (void *ctx, const char *directory); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPDele (void *ctx, const char *file); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPGetConnection (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPCloseConnection(void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPList (void *ctx, ftpListCallback callback, void *userData, const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPGetSocket (void *ctx, const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPGet (void *ctx, ftpDataCallback callback, void *userData, const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoFTPRead (void *ctx, void *dest, int len); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/nanohttp.h b/reactos/lib/3rdparty/libxml2/include/libxml/nanohttp.h index 1d8ac24b2af..22b8fb43381 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/nanohttp.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/nanohttp.h @@ -7,7 +7,7 @@ * * Author: Daniel Veillard */ - + #ifndef __NANO_HTTP_H__ #define __NANO_HTTP_H__ @@ -20,22 +20,22 @@ extern "C" { #endif XMLPUBFUN void XMLCALL xmlNanoHTTPInit (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoHTTPCleanup (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoHTTPScanProxy (const char *URL); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPFetch (const char *URL, const char *filename, char **contentType); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPMethod (const char *URL, const char *method, const char *input, char **contentType, const char *headers, int ilen); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPMethodRedir (const char *URL, const char *method, const char *input, @@ -43,16 +43,16 @@ XMLPUBFUN void * XMLCALL char **redir, const char *headers, int ilen); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPOpen (const char *URL, char **contentType); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlNanoHTTPOpenRedir (const char *URL, char **contentType, char **redir); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPReturnCode (void *ctx); -XMLPUBFUN const char * XMLCALL +XMLPUBFUN const char * XMLCALL xmlNanoHTTPAuthHeader (void *ctx); XMLPUBFUN const char * XMLCALL xmlNanoHTTPRedir (void *ctx); @@ -62,16 +62,16 @@ XMLPUBFUN const char * XMLCALL xmlNanoHTTPEncoding (void *ctx); XMLPUBFUN const char * XMLCALL xmlNanoHTTPMimeType (void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPRead (void *ctx, void *dest, int len); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNanoHTTPSave (void *ctxt, const char *filename); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNanoHTTPClose (void *ctx); #ifdef __cplusplus } diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/parser.h b/reactos/lib/3rdparty/libxml2/include/libxml/parser.h index 7203ca3c908..a1b0c2f4eb3 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/parser.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/parser.h @@ -80,7 +80,7 @@ struct _xmlParserInput { * xmlParserNodeInfo: * * The parser can be asked to collect Node informations, i.e. at what - * place in the file they were detected. + * place in the file they were detected. * NOTE: This is off by default and not very well tested. */ typedef struct _xmlParserNodeInfo xmlParserNodeInfo; @@ -218,7 +218,7 @@ struct _xmlParserCtxt { xmlValidCtxt vctxt; /* The validity context */ xmlParserInputState instate; /* current type of input */ - int token; /* next char look-ahead */ + int token; /* next char look-ahead */ char *directory; /* the data directory */ @@ -387,8 +387,8 @@ typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx, /** * entityDeclSAXFunc: * @ctx: the user data (XML parser context) - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -418,8 +418,8 @@ typedef void (*notationDeclSAXFunc)(void *ctx, * attributeDeclSAXFunc: * @ctx: the user data (XML parser context) * @elem: the name of the element - * @fullname: the attribute name - * @type: the attribute type + * @fullname: the attribute name + * @type: the attribute type * @def: the type of default value * @defaultValue: the attribute default value * @tree: the tree of enumerated value set @@ -436,8 +436,8 @@ typedef void (*attributeDeclSAXFunc)(void *ctx, /** * elementDeclSAXFunc: * @ctx: the user data (XML parser context) - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value tree * * An element definition has been parsed. @@ -524,7 +524,7 @@ typedef void (*attributeSAXFunc) (void *ctx, * @ctx: the user data (XML parser context) * @name: The entity name * - * Called when an entity reference is detected. + * Called when an entity reference is detected. */ typedef void (*referenceSAXFunc) (void *ctx, const xmlChar *name); @@ -588,7 +588,7 @@ typedef void (*cdataBlockSAXFunc) ( * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a warning messages, callback. */ typedef void (*warningSAXFunc) (void *ctx, @@ -598,7 +598,7 @@ typedef void (*warningSAXFunc) (void *ctx, * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an error messages, callback. */ typedef void (*errorSAXFunc) (void *ctx, @@ -608,7 +608,7 @@ typedef void (*errorSAXFunc) (void *ctx, * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format fatal error messages, callback. * Note: so far fatalError() SAX callbacks are not used, error() * get all the callbacks for errors. @@ -684,7 +684,7 @@ typedef void (*startElementNsSAX2Func) (void *ctx, int nb_attributes, int nb_defaulted, const xmlChar **attributes); - + /** * endElementNsSAX2Func: * @ctx: the user data (XML parser context) @@ -779,7 +779,7 @@ struct _xmlSAXHandlerV1 { * xmlExternalEntityLoader: * @URL: The System ID of the resource requested * @ID: The Public ID of the resource requested - * @context: the XML parser context + * @context: the XML parser context * * External entity loaders types. * @@ -805,18 +805,18 @@ extern "C" { /* * Init/Cleanup */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitParser (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupParser (void); /* * Input functions */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputRead (xmlParserInputPtr in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputGrow (xmlParserInputPtr in, int len); @@ -824,101 +824,101 @@ XMLPUBFUN int XMLCALL * Basic parsing Interfaces */ #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseDoc (const xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseFile (const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseMemory (const char *buffer, int size); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSubstituteEntitiesDefault(int val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlKeepBlanksDefault (int val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlStopParser (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlPedanticParserDefault(int val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlLineNumbersDefault (int val); #ifdef LIBXML_SAX1_ENABLED /* - * Recovery mode + * Recovery mode */ -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlRecoverDoc (xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlRecoverMemory (const char *buffer, int size); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlRecoverFile (const char *filename); #endif /* LIBXML_SAX1_ENABLED */ /* * Less common routines and SAX interfaces */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseDocument (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAXUserParseFile (xmlSAXHandlerPtr sax, void *user_data, const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, void *user_data, const char *buffer, int size); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseDoc (xmlSAXHandlerPtr sax, const xmlChar *cur, int recovery); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseMemory (xmlSAXHandlerPtr sax, const char *buffer, int size, int recovery); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, const char *buffer, int size, int recovery, void *data); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseFile (xmlSAXHandlerPtr sax, const char *filename, int recovery); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, const char *filename, int recovery, void *data); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlSAXParseEntity (xmlSAXHandlerPtr sax, const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlParseEntity (const char *filename); #endif /* LIBXML_SAX1_ENABLED */ #ifdef LIBXML_VALID_ENABLED -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlSAXParseDTD (xmlSAXHandlerPtr sax, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlParseDTD (const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlIOParseDTD (xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, xmlCharEncoding enc); #endif /* LIBXML_VALID_ENABLE */ #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseBalancedChunkMemory(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, @@ -933,7 +933,7 @@ XMLPUBFUN xmlParserErrors XMLCALL int options, xmlNodePtr *lst); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, @@ -941,7 +941,7 @@ XMLPUBFUN int XMLCALL const xmlChar *string, xmlNodePtr *lst, int recover); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseExternalEntity (xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, @@ -950,7 +950,7 @@ XMLPUBFUN int XMLCALL const xmlChar *ID, xmlNodePtr *lst); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, const xmlChar *ID, @@ -959,35 +959,35 @@ XMLPUBFUN int XMLCALL /* * Parser contexts handling. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlNewParserCtxt (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlInitParserCtxt (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlClearParserCtxt (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, const xmlChar* buffer, const char *filename); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateDocParserCtxt (const xmlChar *cur); #ifdef LIBXML_LEGACY_ENABLED /* * Reading/setting optional parsing features. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetFeaturesList (int *len, const char **result); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetFeature (xmlParserCtxtPtr ctxt, const char *name, void *result); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSetFeature (xmlParserCtxtPtr ctxt, const char *name, void *value); @@ -997,13 +997,13 @@ XMLPUBFUN int XMLCALL /* * Interfaces for the Push mode. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseChunk (xmlParserCtxtPtr ctxt, const char *chunk, int size, @@ -1014,7 +1014,7 @@ XMLPUBFUN int XMLCALL * Special I/O mode. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, void *user_data, xmlInputReadCallback ioread, @@ -1022,7 +1022,7 @@ XMLPUBFUN xmlParserCtxtPtr XMLCALL void *ioctx, xmlCharEncoding enc); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewIOInputStream (xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc); @@ -1033,14 +1033,14 @@ XMLPUBFUN xmlParserInputPtr XMLCALL XMLPUBFUN const xmlParserNodeInfo* XMLCALL xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, const xmlNodePtr node); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); -XMLPUBFUN unsigned long XMLCALL +XMLPUBFUN unsigned long XMLCALL xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq, const xmlNodePtr node); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, const xmlParserNodeInfoPtr info); @@ -1048,7 +1048,7 @@ XMLPUBFUN void XMLCALL * External entities handling actually implemented in xmlIO. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetExternalEntityLoader(xmlExternalEntityLoader f); XMLPUBFUN xmlExternalEntityLoader XMLCALL xmlGetExternalEntityLoader(void); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/parserInternals.h b/reactos/lib/3rdparty/libxml2/include/libxml/parserInternals.h index 7ac0ce6eb77..e57d13ce380 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/parserInternals.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/parserInternals.h @@ -24,8 +24,8 @@ extern "C" { /** * xmlParserMaxDepth: * - * arbitrary depth limit for the XML documents that we allow to - * process. This is not a limitation of the parser but a safety + * arbitrary depth limit for the XML documents that we allow to + * process. This is not a limitation of the parser but a safety * boundary feature. */ XMLPUBVAR unsigned int xmlParserMaxDepth; @@ -144,7 +144,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth; * * Always false (all combining chars > 0xff) */ -#define IS_COMBINING_CH(c) 0 +#define IS_COMBINING_CH(c) 0 /** * IS_EXTENDER: @@ -185,7 +185,7 @@ XMLPUBVAR unsigned int xmlParserMaxDepth; * Macro to check the following production in the XML spec: * * - * [84] Letter ::= BaseChar | Ideographic + * [84] Letter ::= BaseChar | Ideographic */ #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) @@ -279,25 +279,25 @@ XMLPUBFUN int XMLCALL xmlIsLetter (int c); /** * Parser context. */ -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateFileParserCtxt (const char *filename); -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateURLParserCtxt (const char *filename, int options); -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateMemoryParserCtxt(const char *buffer, int size); -XMLPUBFUN xmlParserCtxtPtr XMLCALL +XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, const xmlChar *base); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSwitchEncoding (xmlParserCtxtPtr ctxt, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler); @@ -315,29 +315,29 @@ XMLPUBFUN void XMLCALL /** * Input Streams. */ -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewStringInputStream (xmlParserCtxtPtr ctxt, const xmlChar *buffer); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, xmlEntityPtr entity); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlPushInput (xmlParserCtxtPtr ctxt, xmlParserInputPtr input); -XMLPUBFUN xmlChar XMLCALL +XMLPUBFUN xmlChar XMLCALL xmlPopInput (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeInputStream (xmlParserInputPtr input); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputFromFile (xmlParserCtxtPtr ctxt, const char *filename); -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputStream (xmlParserCtxtPtr ctxt); /** * Namespaces. */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlSplitQName (xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix); @@ -345,112 +345,112 @@ XMLPUBFUN xmlChar * XMLCALL /** * Generic production rules. */ -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseName (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseNmtoken (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseEntityValue (xmlParserCtxtPtr ctxt, xmlChar **orig); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseAttValue (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseSystemLiteral (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParsePubidLiteral (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseCharData (xmlParserCtxtPtr ctxt, int cdata); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseExternalID (xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseComment (xmlParserCtxtPtr ctxt); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParsePITarget (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParsePI (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseNotationDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseEntityDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, xmlChar **value); -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseNotationType (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseEnumerationType (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseAttributeType (xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementMixedContentDecl (xmlParserCtxtPtr ctxt, int inputchk); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseElementDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseMarkupDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseCharRef (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlEntityPtr XMLCALL +XMLPUBFUN xmlEntityPtr XMLCALL xmlParseEntityRef (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseReference (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParsePEReference (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); #ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseAttribute (xmlParserCtxtPtr ctxt, xmlChar **value); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseStartTag (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseEndTag (xmlParserCtxtPtr ctxt); #endif /* LIBXML_SAX1_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseCDSect (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseContent (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseElement (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseVersionNum (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseVersionInfo (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseEncName (xmlParserCtxtPtr ctxt); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlParseEncodingDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseSDDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseXMLDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseTextDecl (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseMisc (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParseExternalSubset (xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, - const xmlChar *SystemID); + const xmlChar *SystemID); /** * XML_SUBSTITUTE_NONE: * @@ -554,21 +554,21 @@ XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filenam typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, xmlNodePtr firstNode, xmlNodePtr lastNode); - + XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlParseQuotedString (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL xmlParseNamespace (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlScanName (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, xmlChar **prefix); /** @@ -581,7 +581,7 @@ XMLPUBFUN xmlChar * XMLCALL xmlChar end, xmlChar end2, xmlChar end3); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlHandleEntity (xmlParserCtxtPtr ctxt, xmlEntityPtr entity); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/relaxng.h b/reactos/lib/3rdparty/libxml2/include/libxml/relaxng.h index ca3c13ba41f..a17385c2a1c 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/relaxng.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/relaxng.h @@ -97,27 +97,27 @@ typedef enum { XMLPUBFUN int XMLCALL xmlRelaxNGInitTypes (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRelaxNGCleanupTypes (void); /* * Interfaces for parsing. */ -XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL xmlRelaxNGNewParserCtxt (const char *URL); -XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL xmlRelaxNGNewMemParserCtxt (const char *buffer, int size); -XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL +XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc); XMLPUBFUN int XMLCALL xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt, int flag); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt, xmlRelaxNGValidityErrorFunc err, xmlRelaxNGValidityWarningFunc warn, @@ -127,12 +127,12 @@ XMLPUBFUN int XMLCALL xmlRelaxNGValidityErrorFunc *err, xmlRelaxNGValidityWarningFunc *warn, void **ctx); -XMLPUBFUN xmlRelaxNGPtr XMLCALL +XMLPUBFUN xmlRelaxNGPtr XMLCALL xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRelaxNGFree (xmlRelaxNGPtr schema); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRelaxNGDump (FILE *output, xmlRelaxNGPtr schema); XMLPUBFUN void XMLCALL @@ -142,39 +142,39 @@ XMLPUBFUN void XMLCALL /* * Interfaces for validating */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, xmlRelaxNGValidityErrorFunc err, xmlRelaxNGValidityWarningFunc warn, void *ctx); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt, xmlRelaxNGValidityErrorFunc *err, xmlRelaxNGValidityWarningFunc *warn, void **ctx); -XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL +XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt, xmlDocPtr doc); /* * Interfaces for progressive validation when possible */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt, const xmlChar *data, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/schemasInternals.h b/reactos/lib/3rdparty/libxml2/include/libxml/schemasInternals.h index eb1f426f756..987a9a42882 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/schemasInternals.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/schemasInternals.h @@ -102,7 +102,7 @@ typedef enum { XML_SCHEMA_TYPE_IDC_UNIQUE, XML_SCHEMA_TYPE_IDC_KEY, XML_SCHEMA_TYPE_IDC_KEYREF, - XML_SCHEMA_TYPE_PARTICLE = 25, + XML_SCHEMA_TYPE_PARTICLE = 25, XML_SCHEMA_FACET_MININCLUSIVE = 1000, XML_SCHEMA_FACET_MINEXCLUSIVE, XML_SCHEMA_FACET_MAXINCLUSIVE, @@ -891,7 +891,7 @@ struct _xmlSchema { int preserve; /* whether to free the document */ int counter; /* used to give ononymous components unique names */ xmlHashTablePtr idcDef; - void *volatiles; /* Misc. helper items (e.g. reference items) */ + void *volatiles; /* Misc. helper items (e.g. reference items) */ }; XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/threads.h b/reactos/lib/3rdparty/libxml2/include/libxml/threads.h index fb6b7048856..d0bdada0d2e 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/threads.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/threads.h @@ -37,40 +37,40 @@ typedef xmlRMutex *xmlRMutexPtr; extern "C" { #endif -XMLPUBFUN xmlMutexPtr XMLCALL +XMLPUBFUN xmlMutexPtr XMLCALL xmlNewMutex (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlMutexLock (xmlMutexPtr tok); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlMutexUnlock (xmlMutexPtr tok); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeMutex (xmlMutexPtr tok); -XMLPUBFUN xmlRMutexPtr XMLCALL +XMLPUBFUN xmlRMutexPtr XMLCALL xmlNewRMutex (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRMutexLock (xmlRMutexPtr tok); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRMutexUnlock (xmlRMutexPtr tok); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeRMutex (xmlRMutexPtr tok); /* * Library wide APIs. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlInitThreads (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlLockLibrary (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlUnlockLibrary(void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetThreadId (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsMainThread (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupThreads(void); -XMLPUBFUN xmlGlobalStatePtr XMLCALL +XMLPUBFUN xmlGlobalStatePtr XMLCALL xmlGetGlobalState(void); #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/tree.h b/reactos/lib/3rdparty/libxml2/include/libxml/tree.h index d995e5cd786..fe85a0d995f 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/tree.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/tree.h @@ -467,7 +467,7 @@ struct _xmlNode { /** * XML_GET_LINE: * - * Macro to extract the line number of an element node. + * Macro to extract the line number of an element node. */ #define XML_GET_LINE(n) \ (xmlGetLineNo(n)) @@ -527,7 +527,7 @@ struct _xmlDOMWrapCtxt { /** * xmlRootNode: * - * Macro for compatibility naming layer with libxml1. Maps + * Macro for compatibility naming layer with libxml1. Maps * to "children". */ #ifndef xmlRootNode @@ -548,26 +548,26 @@ XMLPUBFUN int XMLCALL #endif #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateQName (const xmlChar *value, int space); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateName (const xmlChar *value, int space); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNMToken (const xmlChar *value, int space); #endif -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlBuildQName (const xmlChar *ncname, const xmlChar *prefix, xmlChar *memory, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlSplitQName2 (const xmlChar *name, xmlChar **prefix); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlSplitQName3 (const xmlChar *name, int *len); @@ -575,402 +575,402 @@ XMLPUBFUN const xmlChar * XMLCALL * Handling Buffers. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme); -XMLPUBFUN xmlBufferAllocationScheme XMLCALL +XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlGetBufferAllocationScheme(void); -XMLPUBFUN xmlBufferPtr XMLCALL +XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreate (void); -XMLPUBFUN xmlBufferPtr XMLCALL +XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreateSize (size_t size); -XMLPUBFUN xmlBufferPtr XMLCALL +XMLPUBFUN xmlBufferPtr XMLCALL xmlBufferCreateStatic (void *mem, size_t size); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferResize (xmlBufferPtr buf, unsigned int size); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferFree (xmlBufferPtr buf); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferDump (FILE *file, xmlBufferPtr buf); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferAdd (xmlBufferPtr buf, const xmlChar *str, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferAddHead (xmlBufferPtr buf, const xmlChar *str, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferCat (xmlBufferPtr buf, const xmlChar *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferCCat (xmlBufferPtr buf, const char *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferShrink (xmlBufferPtr buf, unsigned int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferGrow (xmlBufferPtr buf, unsigned int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferEmpty (xmlBufferPtr buf); -XMLPUBFUN const xmlChar* XMLCALL +XMLPUBFUN const xmlChar* XMLCALL xmlBufferContent (const xmlBufferPtr buf); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferSetAllocationScheme(xmlBufferPtr buf, xmlBufferAllocationScheme scheme); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlBufferLength (const xmlBufferPtr buf); /* * Creating/freeing new structures. */ -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlCreateIntSubset (xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlNewDtd (xmlDocPtr doc, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlGetIntSubset (xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeDtd (xmlDtdPtr cur); #ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlNewGlobalNs (xmlDocPtr doc, const xmlChar *href, const xmlChar *prefix); #endif /* LIBXML_LEGACY_ENABLED */ -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs (xmlNodePtr node, const xmlChar *href, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNs (xmlNsPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNsList (xmlNsPtr cur); -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlNewDoc (const xmlChar *version); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeDoc (xmlDocPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewDocProp (xmlDocPtr doc, const xmlChar *name, const xmlChar *value); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewProp (xmlNodePtr node, const xmlChar *name, const xmlChar *value); #endif -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewNsProp (xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlNewNsPropEatName (xmlNodePtr node, xmlNsPtr ns, xmlChar *name, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreePropList (xmlAttrPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeProp (xmlAttrPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlCopyProp (xmlNodePtr target, xmlAttrPtr cur); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlCopyPropList (xmlNodePtr target, xmlAttrPtr cur); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlDtdPtr XMLCALL +XMLPUBFUN xmlDtdPtr XMLCALL xmlCopyDtd (xmlDtdPtr dtd); #endif /* LIBXML_TREE_ENABLED */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlCopyDoc (xmlDocPtr doc, int recursive); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ /* * Creating new nodes. */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNode (xmlDocPtr doc, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocNodeEatName (xmlDocPtr doc, xmlNsPtr ns, xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewNode (xmlNsPtr ns, const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewNodeEatName (xmlNsPtr ns, xmlChar *name); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewChild (xmlNodePtr parent, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); #endif -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocText (xmlDocPtr doc, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewText (const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocPI (xmlDocPtr doc, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewPI (const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocTextLen (xmlDocPtr doc, const xmlChar *content, int len); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewTextLen (const xmlChar *content, int len); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocComment (xmlDocPtr doc, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewComment (const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewCDataBlock (xmlDocPtr doc, const xmlChar *content, int len); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewCharRef (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewReference (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlCopyNode (const xmlNodePtr node, int recursive); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocCopyNode (const xmlNodePtr node, xmlDocPtr doc, int recursive); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocCopyNodeList (xmlDocPtr doc, const xmlNodePtr node); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlCopyNodeList (const xmlNodePtr node); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewTextChild (xmlNodePtr parent, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocRawNode (xmlDocPtr doc, xmlNsPtr ns, const xmlChar *name, const xmlChar *content); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlNewDocFragment (xmlDocPtr doc); #endif /* LIBXML_TREE_ENABLED */ /* * Navigating. */ -XMLPUBFUN long XMLCALL +XMLPUBFUN long XMLCALL xmlGetLineNo (xmlNodePtr node); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetNodePath (xmlNodePtr node); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocGetRootElement (xmlDocPtr doc); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlGetLastChild (xmlNodePtr parent); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNodeIsText (xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsBlankNode (xmlNodePtr node); /* * Changing the structure. */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlDocSetRootElement (xmlDocPtr doc, xmlNodePtr root); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetName (xmlNodePtr cur, const xmlChar *name); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddChild (xmlNodePtr parent, xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddChildList (xmlNodePtr parent, xmlNodePtr cur); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlReplaceNode (xmlNodePtr old, xmlNodePtr cur); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddPrevSibling (xmlNodePtr cur, xmlNodePtr elem); #endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */ -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddSibling (xmlNodePtr cur, xmlNodePtr elem); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlAddNextSibling (xmlNodePtr cur, xmlNodePtr elem); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlUnlinkNode (xmlNodePtr cur); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlTextMerge (xmlNodePtr first, xmlNodePtr second); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextConcat (xmlNodePtr node, const xmlChar *content, int len); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNodeList (xmlNodePtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNode (xmlNodePtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetTreeDoc (xmlNodePtr tree, xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetListDoc (xmlNodePtr list, xmlDocPtr doc); /* * Namespaces. */ -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs (xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNsByHref (xmlDocPtr doc, xmlNodePtr node, const xmlChar *href); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) -XMLPUBFUN xmlNsPtr * XMLCALL +XMLPUBFUN xmlNsPtr * XMLCALL xmlGetNsList (xmlDocPtr doc, xmlNodePtr node); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetNs (xmlNodePtr node, xmlNsPtr ns); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlCopyNamespace (xmlNsPtr cur); -XMLPUBFUN xmlNsPtr XMLCALL +XMLPUBFUN xmlNsPtr XMLCALL xmlCopyNamespaceList (xmlNsPtr cur); /* * Changing the content. */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlSetProp (xmlNodePtr node, const xmlChar *name, const xmlChar *value); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlSetNsProp (xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetNoNsProp (xmlNodePtr node, const xmlChar *name); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetProp (xmlNodePtr node, const xmlChar *name); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlHasProp (xmlNodePtr node, const xmlChar *name); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlHasNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlGetNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlStringGetNodeList (xmlDocPtr doc, const xmlChar *value); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlStringLenGetNodeList (xmlDocPtr doc, const xmlChar *value, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeListGetString (xmlDocPtr doc, xmlNodePtr list, int inLine); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeListGetRawString (xmlDocPtr doc, xmlNodePtr list, int inLine); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetContent (xmlNodePtr cur, const xmlChar *content); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetContentLen (xmlNodePtr cur, const xmlChar *content, int len); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeAddContent (xmlNodePtr cur, const xmlChar *content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeAddContentLen (xmlNodePtr cur, const xmlChar *content, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeGetContent (xmlNodePtr cur); XMLPUBFUN int XMLCALL xmlNodeBufGetContent (xmlBufferPtr buffer, xmlNodePtr cur); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeGetLang (xmlNodePtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNodeGetSpacePreserve (xmlNodePtr cur); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetLang (xmlNodePtr cur, const xmlChar *lang); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetSpacePreserve (xmlNodePtr cur, int val); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNodeGetBase (xmlDocPtr doc, xmlNodePtr cur); #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeSetBase (xmlNodePtr cur, const xmlChar *uri); #endif @@ -979,15 +979,15 @@ XMLPUBFUN void XMLCALL * Removing content. */ #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRemoveProp (xmlAttrPtr cur); #endif /* LIBXML_TREE_ENABLED */ #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlUnsetNsProp (xmlNodePtr node, xmlNsPtr ns, const xmlChar *name); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlUnsetProp (xmlNodePtr node, const xmlChar *name); #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ @@ -995,13 +995,13 @@ XMLPUBFUN int XMLCALL /* * Internal, don't use. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferWriteCHAR (xmlBufferPtr buf, const xmlChar *string); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferWriteChar (xmlBufferPtr buf, const char *string); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlBufferWriteQuotedString(xmlBufferPtr buf, const xmlChar *string); @@ -1016,7 +1016,7 @@ XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf, /* * Namespace handling. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlReconciliateNs (xmlDocPtr doc, xmlNodePtr tree); #endif @@ -1025,61 +1025,61 @@ XMLPUBFUN int XMLCALL /* * Saving. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpFormatMemory (xmlDocPtr cur, xmlChar **mem, int *size, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpMemory (xmlDocPtr cur, xmlChar **mem, int *size); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpMemoryEnc (xmlDocPtr out_doc, xmlChar **doc_txt_ptr, int * doc_txt_len, const char *txt_encoding); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr, int * doc_txt_len, const char *txt_encoding, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDocFormatDump (FILE *f, xmlDocPtr cur, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlDocDump (FILE *f, xmlDocPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlElemDump (FILE *f, xmlDocPtr doc, xmlNodePtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFile (const char *filename, xmlDocPtr cur); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFormatFile (const char *filename, xmlDocPtr cur, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNodeDump (xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFileTo (xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFormatFileTo (xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlNodeDumpOutput (xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, @@ -1087,13 +1087,13 @@ XMLPUBFUN void XMLCALL int format, const char *encoding); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFormatFileEnc (const char *filename, xmlDocPtr cur, const char *encoding, int format); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSaveFileEnc (const char *filename, xmlDocPtr cur, const char *encoding); @@ -1102,21 +1102,21 @@ XMLPUBFUN int XMLCALL /* * XHTML */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsXHTML (const xmlChar *systemID, const xmlChar *publicID); /* * Compression. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetDocCompressMode (xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetDocCompressMode (xmlDocPtr doc, int mode); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGetCompressMode (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetCompressMode (int mode); /* @@ -1134,7 +1134,7 @@ XMLPUBFUN int XMLCALL xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt, xmlDocPtr sourceDoc, xmlNodePtr node, - xmlDocPtr destDoc, + xmlDocPtr destDoc, xmlNodePtr destParent, int options); XMLPUBFUN int XMLCALL diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/uri.h b/reactos/lib/3rdparty/libxml2/include/libxml/uri.h index 90ed06ec4f3..6d825340180 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/uri.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/uri.h @@ -44,38 +44,38 @@ struct _xmlURI { * xmlChar * xmlNodeGetBase (xmlDocPtr doc, * xmlNodePtr cur); */ -XMLPUBFUN xmlURIPtr XMLCALL +XMLPUBFUN xmlURIPtr XMLCALL xmlCreateURI (void); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlBuildURI (const xmlChar *URI, const xmlChar *base); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlBuildRelativeURI (const xmlChar *URI, const xmlChar *base); -XMLPUBFUN xmlURIPtr XMLCALL +XMLPUBFUN xmlURIPtr XMLCALL xmlParseURI (const char *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParseURIReference (xmlURIPtr uri, const char *str); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlSaveUri (xmlURIPtr uri); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlPrintURI (FILE *stream, xmlURIPtr uri); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlURIEscapeStr (const xmlChar *str, const xmlChar *list); -XMLPUBFUN char * XMLCALL +XMLPUBFUN char * XMLCALL xmlURIUnescapeString (const char *str, int len, char *target); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlNormalizeURIPath (char *path); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlURIEscape (const xmlChar *str); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeURI (xmlURIPtr uri); -XMLPUBFUN xmlChar* XMLCALL +XMLPUBFUN xmlChar* XMLCALL xmlCanonicPath (const xmlChar *path); #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/valid.h b/reactos/lib/3rdparty/libxml2/include/libxml/valid.h index 86e3fce44bb..cee4184c3a8 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/valid.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/valid.h @@ -150,55 +150,55 @@ typedef struct _xmlHashTable xmlRefTable; typedef xmlRefTable *xmlRefTablePtr; /* Notation */ -XMLPUBFUN xmlNotationPtr XMLCALL +XMLPUBFUN xmlNotationPtr XMLCALL xmlAddNotationDecl (xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, const xmlChar *PublicID, const xmlChar *SystemID); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlNotationTablePtr XMLCALL +XMLPUBFUN xmlNotationTablePtr XMLCALL xmlCopyNotationTable (xmlNotationTablePtr table); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeNotationTable (xmlNotationTablePtr table); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpNotationDecl (xmlBufferPtr buf, xmlNotationPtr nota); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpNotationTable (xmlBufferPtr buf, xmlNotationTablePtr table); #endif /* LIBXML_OUTPUT_ENABLED */ /* Element Content */ /* the non Doc version are being deprecated */ -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlNewElementContent (const xmlChar *name, xmlElementContentType type); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlCopyElementContent (xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeElementContent (xmlElementContentPtr cur); /* the new versions with doc argument */ -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlNewDocElementContent (xmlDocPtr doc, const xmlChar *name, xmlElementContentType type); -XMLPUBFUN xmlElementContentPtr XMLCALL +XMLPUBFUN xmlElementContentPtr XMLCALL xmlCopyDocElementContent(xmlDocPtr doc, xmlElementContentPtr content); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSnprintfElementContent(char *buf, int size, xmlElementContentPtr content, int englob); #ifdef LIBXML_OUTPUT_ENABLED /* DEPRECATED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSprintfElementContent(char *buf, xmlElementContentPtr content, int englob); @@ -206,39 +206,39 @@ XMLPUBFUN void XMLCALL /* DEPRECATED */ /* Element */ -XMLPUBFUN xmlElementPtr XMLCALL +XMLPUBFUN xmlElementPtr XMLCALL xmlAddElementDecl (xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, xmlElementTypeVal type, xmlElementContentPtr content); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlElementTablePtr XMLCALL +XMLPUBFUN xmlElementTablePtr XMLCALL xmlCopyElementTable (xmlElementTablePtr table); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeElementTable (xmlElementTablePtr table); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpElementTable (xmlBufferPtr buf, xmlElementTablePtr table); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpElementDecl (xmlBufferPtr buf, xmlElementPtr elem); #endif /* LIBXML_OUTPUT_ENABLED */ /* Enumeration */ -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlCreateEnumeration (const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeEnumeration (xmlEnumerationPtr cur); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlEnumerationPtr XMLCALL +XMLPUBFUN xmlEnumerationPtr XMLCALL xmlCopyEnumeration (xmlEnumerationPtr cur); #endif /* LIBXML_TREE_ENABLED */ /* Attribute */ -XMLPUBFUN xmlAttributePtr XMLCALL +XMLPUBFUN xmlAttributePtr XMLCALL xmlAddAttributeDecl (xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem, @@ -249,55 +249,55 @@ XMLPUBFUN xmlAttributePtr XMLCALL const xmlChar *defaultValue, xmlEnumerationPtr tree); #ifdef LIBXML_TREE_ENABLED -XMLPUBFUN xmlAttributeTablePtr XMLCALL +XMLPUBFUN xmlAttributeTablePtr XMLCALL xmlCopyAttributeTable (xmlAttributeTablePtr table); #endif /* LIBXML_TREE_ENABLED */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeAttributeTable (xmlAttributeTablePtr table); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpAttributeTable (xmlBufferPtr buf, xmlAttributeTablePtr table); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlDumpAttributeDecl (xmlBufferPtr buf, xmlAttributePtr attr); #endif /* LIBXML_OUTPUT_ENABLED */ /* IDs */ -XMLPUBFUN xmlIDPtr XMLCALL +XMLPUBFUN xmlIDPtr XMLCALL xmlAddID (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeIDTable (xmlIDTablePtr table); -XMLPUBFUN xmlAttrPtr XMLCALL +XMLPUBFUN xmlAttrPtr XMLCALL xmlGetID (xmlDocPtr doc, const xmlChar *ID); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsID (xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr); -XMLPUBFUN int XMLCALL - xmlRemoveID (xmlDocPtr doc, +XMLPUBFUN int XMLCALL + xmlRemoveID (xmlDocPtr doc, xmlAttrPtr attr); /* IDREFs */ -XMLPUBFUN xmlRefPtr XMLCALL +XMLPUBFUN xmlRefPtr XMLCALL xmlAddRef (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeRefTable (xmlRefTablePtr table); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsRef (xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr); -XMLPUBFUN int XMLCALL - xmlRemoveRef (xmlDocPtr doc, +XMLPUBFUN int XMLCALL + xmlRemoveRef (xmlDocPtr doc, xmlAttrPtr attr); -XMLPUBFUN xmlListPtr XMLCALL +XMLPUBFUN xmlListPtr XMLCALL xmlGetRefs (xmlDocPtr doc, const xmlChar *ID); @@ -306,146 +306,146 @@ XMLPUBFUN xmlListPtr XMLCALL */ #ifdef LIBXML_VALID_ENABLED /* Allocate/Release Validation Contexts */ -XMLPUBFUN xmlValidCtxtPtr XMLCALL +XMLPUBFUN xmlValidCtxtPtr XMLCALL xmlNewValidCtxt(void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeValidCtxt(xmlValidCtxtPtr); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateRoot (xmlValidCtxtPtr ctxt, xmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateElementDecl (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlElementPtr elem); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *name, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlAttributePtr attr); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateAttributeValue(xmlAttributeType type, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNotationDecl (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNotationPtr nota); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDtd (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDtdFinal (xmlValidCtxtPtr ctxt, xmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDocument (xmlValidCtxtPtr ctxt, xmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateOneElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateOneAttribute (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateOneNamespace (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc); #endif /* LIBXML_VALID_ENABLED */ #if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNotationUse (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *notationName); #endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIsMixedElement (xmlDocPtr doc, const xmlChar *name); -XMLPUBFUN xmlAttributePtr XMLCALL +XMLPUBFUN xmlAttributePtr XMLCALL xmlGetDtdAttrDesc (xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name); -XMLPUBFUN xmlAttributePtr XMLCALL +XMLPUBFUN xmlAttributePtr XMLCALL xmlGetDtdQAttrDesc (xmlDtdPtr dtd, const xmlChar *elem, const xmlChar *name, const xmlChar *prefix); -XMLPUBFUN xmlNotationPtr XMLCALL +XMLPUBFUN xmlNotationPtr XMLCALL xmlGetDtdNotationDesc (xmlDtdPtr dtd, const xmlChar *name); -XMLPUBFUN xmlElementPtr XMLCALL +XMLPUBFUN xmlElementPtr XMLCALL xmlGetDtdQElementDesc (xmlDtdPtr dtd, const xmlChar *name, const xmlChar *prefix); -XMLPUBFUN xmlElementPtr XMLCALL +XMLPUBFUN xmlElementPtr XMLCALL xmlGetDtdElementDesc (xmlDtdPtr dtd, const xmlChar *name); #ifdef LIBXML_VALID_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidGetPotentialChildren(xmlElementContent *ctree, const xmlChar **list, int *len, int max); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, int max); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNameValue (const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNamesValue (const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNmtokenValue (const xmlChar *value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidateNmtokensValue(const xmlChar *value); #ifdef LIBXML_REGEXP_ENABLED /* * Validation based on the regexp support */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidatePushElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, const xmlChar *qname); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidatePushCData (xmlValidCtxtPtr ctxt, const xmlChar *data, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlValidatePopElement (xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem, diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xinclude.h b/reactos/lib/3rdparty/libxml2/include/libxml/xinclude.h index 4bb0aab2194..e0ed364181c 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xinclude.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xinclude.h @@ -89,14 +89,14 @@ typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr; /* * standalone processing */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXIncludeProcess (xmlDocPtr doc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXIncludeProcessFlags (xmlDocPtr doc, int flags); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXIncludeProcessTree (xmlNodePtr tree); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXIncludeProcessTreeFlags(xmlNodePtr tree, int flags); /* diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xlink.h b/reactos/lib/3rdparty/libxml2/include/libxml/xlink.h index 083c7eda406..a209a9976d8 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xlink.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xlink.h @@ -57,7 +57,7 @@ typedef enum { * xlinkNodeDetectFunc: * @ctx: user data pointer * @node: the node to check - * + * * This is the prototype for the link detection routine. * It calls the default link detection callbacks upon link detection. */ @@ -157,26 +157,26 @@ struct _xlinkHandler { /* * The default detection routine, can be overridden, they call the default - * detection callbacks. + * detection callbacks. */ -XMLPUBFUN xlinkNodeDetectFunc XMLCALL +XMLPUBFUN xlinkNodeDetectFunc XMLCALL xlinkGetDefaultDetect (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xlinkSetDefaultDetect (xlinkNodeDetectFunc func); /* * Routines to set/get the default handlers. */ -XMLPUBFUN xlinkHandlerPtr XMLCALL +XMLPUBFUN xlinkHandlerPtr XMLCALL xlinkGetDefaultHandler (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xlinkSetDefaultHandler (xlinkHandlerPtr handler); /* * Link detection module itself. */ -XMLPUBFUN xlinkType XMLCALL +XMLPUBFUN xlinkType XMLCALL xlinkIsLink (xmlDocPtr doc, xmlNodePtr node); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlIO.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlIO.h index 0f7b8a8c857..e43e6c303cf 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlIO.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlIO.h @@ -26,7 +26,7 @@ extern "C" { * xmlInputMatchCallback: * @filename: the filename or URI * - * Callback used in the I/O Input API to detect if the current handler + * Callback used in the I/O Input API to detect if the current handler * can provide input fonctionnalities for this resource. * * Returns 1 if yes and 0 if another Input module should be used @@ -72,7 +72,7 @@ typedef int (*xmlInputCloseCallback) (void * context); * xmlOutputMatchCallback: * @filename: the filename or URI * - * Callback used in the I/O Output API to detect if the current handler + * Callback used in the I/O Output API to detect if the current handler * can provide output fonctionnalities for this resource. * * Returns 1 if yes and 0 if another Output module should be used @@ -126,9 +126,9 @@ struct _xmlParserInputBuffer { void* context; xmlInputReadCallback readcallback; xmlInputCloseCallback closecallback; - + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ - + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */ xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */ int compressed; /* -1=unknown, 0=not compressed, 1=compressed */ @@ -142,9 +142,9 @@ struct _xmlOutputBuffer { void* context; xmlOutputWriteCallback writecallback; xmlOutputCloseCallback closecallback; - + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */ - + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */ xmlBufferPtr conv; /* if encoder != NULL buffer for output */ int written; /* total number of byte written */ @@ -155,13 +155,13 @@ struct _xmlOutputBuffer { /* * Interfaces for input */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupInputCallbacks (void); XMLPUBFUN int XMLCALL xmlPopInputCallbacks (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterDefaultInputCallbacks (void); XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlAllocParserInputBuffer (xmlCharEncoding enc); @@ -186,22 +186,22 @@ XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputBufferRead (xmlParserInputBufferPtr in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputBufferGrow (xmlParserInputBufferPtr in, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlParserInputBufferPush (xmlParserInputBufferPtr in, int len, const char *buf); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeParserInputBuffer (xmlParserInputBufferPtr in); -XMLPUBFUN char * XMLCALL +XMLPUBFUN char * XMLCALL xmlParserGetDirectory (const char *filename); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc, xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc, @@ -215,9 +215,9 @@ xmlParserInputBufferPtr /* * Interfaces for output */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupOutputCallbacks (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterDefaultOutputCallbacks(void); XMLPUBFUN xmlOutputBufferPtr XMLCALL xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder); @@ -241,24 +241,24 @@ XMLPUBFUN xmlOutputBufferPtr XMLCALL void *ioctx, xmlCharEncodingHandlerPtr encoder); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferWrite (xmlOutputBufferPtr out, int len, const char *buf); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferWriteString (xmlOutputBufferPtr out, const char *str); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferWriteEscape (xmlOutputBufferPtr out, const xmlChar *str, xmlCharEncodingOutputFunc escaping); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferFlush (xmlOutputBufferPtr out); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlOutputBufferClose (xmlOutputBufferPtr out); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc, xmlOutputOpenCallback openFunc, xmlOutputWriteCallback writeFunc, @@ -271,10 +271,10 @@ xmlOutputBufferPtr #ifdef LIBXML_HTTP_ENABLED /* This function only exists if HTTP support built into the library */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegisterHTTPPostCallbacks (void ); #endif /* LIBXML_HTTP_ENABLED */ - + #endif /* LIBXML_OUTPUT_ENABLED */ XMLPUBFUN xmlParserInputPtr XMLCALL @@ -284,68 +284,68 @@ XMLPUBFUN xmlParserInputPtr XMLCALL /* * A predefined entity loader disabling network accesses */ -XMLPUBFUN xmlParserInputPtr XMLCALL +XMLPUBFUN xmlParserInputPtr XMLCALL xmlNoNetExternalEntityLoader (const char *URL, const char *ID, xmlParserCtxtPtr ctxt); -/* - * xmlNormalizeWindowsPath is obsolete, don't use it. +/* + * xmlNormalizeWindowsPath is obsolete, don't use it. * Check xmlCanonicPath in uri.h for a better alternative. */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlNormalizeWindowsPath (const xmlChar *path); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlCheckFilename (const char *path); /** - * Default 'file://' protocol callbacks + * Default 'file://' protocol callbacks */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlFileMatch (const char *filename); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlFileOpen (const char *filename); -XMLPUBFUN int XMLCALL - xmlFileRead (void * context, - char * buffer, +XMLPUBFUN int XMLCALL + xmlFileRead (void * context, + char * buffer, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlFileClose (void * context); /** - * Default 'http://' protocol callbacks + * Default 'http://' protocol callbacks */ #ifdef LIBXML_HTTP_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIOHTTPMatch (const char *filename); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlIOHTTPOpen (const char *filename); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlIOHTTPOpenW (const char * post_uri, int compression ); #endif /* LIBXML_OUTPUT_ENABLED */ -XMLPUBFUN int XMLCALL - xmlIOHTTPRead (void * context, - char * buffer, +XMLPUBFUN int XMLCALL + xmlIOHTTPRead (void * context, + char * buffer, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIOHTTPClose (void * context); #endif /* LIBXML_HTTP_ENABLED */ /** - * Default 'ftp://' protocol callbacks + * Default 'ftp://' protocol callbacks */ -#ifdef LIBXML_FTP_ENABLED -XMLPUBFUN int XMLCALL +#ifdef LIBXML_FTP_ENABLED +XMLPUBFUN int XMLCALL xmlIOFTPMatch (const char *filename); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlIOFTPOpen (const char *filename); -XMLPUBFUN int XMLCALL - xmlIOFTPRead (void * context, - char * buffer, +XMLPUBFUN int XMLCALL + xmlIOFTPRead (void * context, + char * buffer, int len); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlIOFTPClose (void * context); #endif /* LIBXML_FTP_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlautomata.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlautomata.h index d29ddcfcc9e..81ff9615ddd 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlautomata.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlautomata.h @@ -40,32 +40,32 @@ typedef xmlAutomataState *xmlAutomataStatePtr; /* * Building API */ -XMLPUBFUN xmlAutomataPtr XMLCALL +XMLPUBFUN xmlAutomataPtr XMLCALL xmlNewAutomata (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeAutomata (xmlAutomataPtr am); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataGetInitState (xmlAutomataPtr am); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAutomataSetFinalState (xmlAutomataPtr am, xmlAutomataStatePtr state); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewState (xmlAutomataPtr am); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewTransition (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, const xmlChar *token, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewTransition2 (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, const xmlChar *token, const xmlChar *token2, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCountTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, @@ -73,7 +73,7 @@ XMLPUBFUN xmlAutomataStatePtr XMLCALL int min, int max, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCountTrans2 (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, @@ -82,7 +82,7 @@ XMLPUBFUN xmlAutomataStatePtr XMLCALL int min, int max, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewOnceTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, @@ -91,46 +91,46 @@ XMLPUBFUN xmlAutomataStatePtr XMLCALL int max, void *data); XMLPUBFUN xmlAutomataStatePtr XMLCALL - xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, + xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, xmlAutomataStatePtr from, - xmlAutomataStatePtr to, + xmlAutomataStatePtr to, const xmlChar *token, const xmlChar *token2, - int min, - int max, + int min, + int max, void *data); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewAllTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, int lax); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewEpsilon (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCountedTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, int counter); -XMLPUBFUN xmlAutomataStatePtr XMLCALL +XMLPUBFUN xmlAutomataStatePtr XMLCALL xmlAutomataNewCounterTrans (xmlAutomataPtr am, xmlAutomataStatePtr from, xmlAutomataStatePtr to, int counter); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAutomataNewCounter (xmlAutomataPtr am, int min, int max); -XMLPUBFUN xmlRegexpPtr XMLCALL +XMLPUBFUN xmlRegexpPtr XMLCALL xmlAutomataCompile (xmlAutomataPtr am); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlAutomataIsDeterminist (xmlAutomataPtr am); #ifdef __cplusplus } -#endif +#endif #endif /* LIBXML_AUTOMATA_ENABLED */ #endif /* LIBXML_REGEXP_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlerror.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlerror.h index 04da1a6024c..1c7de056251 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlerror.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlerror.h @@ -638,7 +638,7 @@ typedef enum { XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */ XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */ XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */ - XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */ + XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */ XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */ XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */ XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */ @@ -662,7 +662,7 @@ typedef enum { XML_SCHEMAV_CVC_TYPE_2, /* 1876 */ XML_SCHEMAV_CVC_IDC, /* 1877 */ XML_SCHEMAV_CVC_WILDCARD, /* 1878 */ - XML_XPTR_UNKNOWN_SCHEME = 1900, + XML_XPTR_UNKNOWN_SCHEME = 1900, XML_XPTR_CHILDSEQ_START, /* 1901 */ XML_XPTR_EVAL_FAILED, /* 1902 */ XML_XPTR_EXTRA_OBJECTS, /* 1903 */ @@ -683,15 +683,15 @@ typedef enum { XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */ XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */ XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */ - XML_SCHEMAP_SRC_RESOLVE, /* 3004 */ + XML_SCHEMAP_SRC_RESOLVE, /* 3004 */ XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */ XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */ XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */ XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */ XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */ - XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */ + XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */ XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */ - XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */ + XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */ XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */ XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */ XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */ @@ -710,7 +710,7 @@ typedef enum { XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */ XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */ XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */ - XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */ + XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */ XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */ XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */ XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */ @@ -729,14 +729,14 @@ typedef enum { XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */ XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */ XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */ - XML_SCHEMAP_SRC_INCLUDE, /* 3050 */ + XML_SCHEMAP_SRC_INCLUDE, /* 3050 */ XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */ XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */ XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */ XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */ XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */ XML_SCHEMAP_NO_XMLNS, /* 3056 */ - XML_SCHEMAP_NO_XSI, /* 3057 */ + XML_SCHEMAP_NO_XSI, /* 3057 */ XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */ XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */ XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */ @@ -832,38 +832,38 @@ typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); * Use the following function to reset the two global variables * xmlGenericError and xmlGenericErrorContext. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetGenericErrorFunc (void *ctx, xmlGenericErrorFunc handler); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSetStructuredErrorFunc (void *ctx, xmlStructuredErrorFunc handler); /* * Default message routines used by SAX and Valid context for error * and warning reporting. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserError (void *ctx, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserWarning (void *ctx, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserValidityError (void *ctx, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserValidityWarning (void *ctx, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserPrintFileInfo (xmlParserInputPtr input); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlParserPrintFileContext (xmlParserInputPtr input); /* @@ -887,7 +887,7 @@ XMLPUBFUN int XMLCALL /* * Internal callback reporting routine */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL __xmlRaiseError (xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel, void *data, @@ -905,7 +905,7 @@ XMLPUBFUN void XMLCALL int col, const char *msg, ...); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL __xmlSimpleError (int domain, int code, xmlNodePtr node, diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlmemory.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlmemory.h index 235721ceacb..f20fe729aad 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlmemory.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlmemory.h @@ -20,7 +20,7 @@ * * DEBUG_MEMORY replaces the allocator with a collect and debug * shell to the libc allocator. - * DEBUG_MEMORY should only be activated when debugging + * DEBUG_MEMORY should only be activated when debugging * libxml i.e. if libxml has been configured with --with-debug-mem too. */ /* #define DEBUG_MEMORY_FREED */ @@ -35,7 +35,7 @@ /** * DEBUG_MEMORY_LOCATION: * - * DEBUG_MEMORY_LOCATION should be activated only when debugging + * DEBUG_MEMORY_LOCATION should be activated only when debugging * libxml i.e. if libxml has been configured with --with-debug-mem too. */ #ifdef DEBUG_MEMORY_LOCATION @@ -105,18 +105,18 @@ XMLPUBFUN int XMLCALL xmlMallocFunc mallocFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlMemGet (xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc, xmlReallocFunc *reallocFunc, xmlStrdupFunc *strdupFunc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGcMemSetup (xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, xmlMallocFunc mallocAtomicFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlGcMemGet (xmlFreeFunc *freeFunc, xmlMallocFunc *mallocFunc, xmlMallocFunc *mallocAtomicFunc, @@ -126,42 +126,42 @@ XMLPUBFUN int XMLCALL /* * Initialization of the memory layer. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlInitMemory (void); -/* +/* * Cleanup of the memory layer. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlCleanupMemory (void); /* * These are specific to the XML debug memory wrapper. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlMemUsed (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlMemBlocks (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlMemDisplay (FILE *fp); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlMemShow (FILE *fp, int nr); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlMemoryDump (void); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlMemMalloc (size_t size); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlMemRealloc (void *ptr,size_t size); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlMemFree (void *ptr); -XMLPUBFUN char * XMLCALL +XMLPUBFUN char * XMLCALL xmlMemoryStrdup (const char *str); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlMallocLoc (size_t size, const char *file, int line); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlReallocLoc (void *ptr, size_t size, const char *file, int line); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlMallocAtomicLoc (size_t size, const char *file, int line); -XMLPUBFUN char * XMLCALL +XMLPUBFUN char * XMLCALL xmlMemStrdupLoc (const char *str, const char *file, int line); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlmodule.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlmodule.h index 8f4a56035b8..9667820070a 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlmodule.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlmodule.h @@ -50,7 +50,7 @@ XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module); #ifdef __cplusplus } -#endif +#endif #endif /* LIBXML_MODULES_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlreader.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlreader.h index f01654662b8..7921fd3baea 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlreader.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlreader.h @@ -42,7 +42,7 @@ typedef enum { * xmlParserProperties: * * Some common options to use with xmlTextReaderSetParserProp, but it - * is better to use xmlParserOption and the xmlReaderNewxxx and + * is better to use xmlParserOption and the xmlReaderNewxxx and * xmlReaderForxxx APIs now. */ typedef enum { @@ -111,123 +111,123 @@ typedef xmlTextReader *xmlTextReaderPtr; XMLPUBFUN xmlTextReaderPtr XMLCALL xmlNewTextReader (xmlParserInputBufferPtr input, const char *URI); -XMLPUBFUN xmlTextReaderPtr XMLCALL +XMLPUBFUN xmlTextReaderPtr XMLCALL xmlNewTextReaderFilename(const char *URI); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlFreeTextReader (xmlTextReaderPtr reader); /* * Iterators */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderRead (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderReadInnerXml (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderReadOuterXml (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderReadString (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader); /* * Attributes of the node */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderAttributeCount(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderDepth (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderHasAttributes(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderHasValue(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderIsDefault (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderNodeType (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderQuoteChar (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderReadState (xmlTextReaderPtr reader); XMLPUBFUN int XMLCALL xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstBaseUri (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstLocalName (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstName (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstPrefix (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstXmlLang (xmlTextReaderPtr reader); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstString (xmlTextReaderPtr reader, const xmlChar *str); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstValue (xmlTextReaderPtr reader); /* * use the Const version of the routine for * better performance and simpler code */ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderBaseUri (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderLocalName (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderName (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderNamespaceUri(xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderPrefix (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderXmlLang (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderValue (xmlTextReaderPtr reader); /* * Methods of the XmlTextReader */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderClose (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader, int no); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderGetAttribute (xmlTextReaderPtr reader, const xmlChar *name); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader, const xmlChar *localName, const xmlChar *namespaceURI); -XMLPUBFUN xmlParserInputBufferPtr XMLCALL +XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlTextReaderGetRemainder (xmlTextReaderPtr reader); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderLookupNamespace(xmlTextReaderPtr reader, const xmlChar *prefix); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader, int no); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader, const xmlChar *name); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader, const xmlChar *localName, const xmlChar *namespaceURI); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderMoveToElement (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderNormalization (xmlTextReaderPtr reader); XMLPUBFUN const xmlChar * XMLCALL xmlTextReaderConstEncoding (xmlTextReaderPtr reader); @@ -235,14 +235,14 @@ XMLPUBFUN const xmlChar * XMLCALL /* * Extensions */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderSetParserProp (xmlTextReaderPtr reader, int prop, int value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderGetParserProp (xmlTextReaderPtr reader, int prop); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlTextReaderCurrentNode (xmlTextReaderPtr reader); XMLPUBFUN int XMLCALL @@ -251,35 +251,35 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlTextReaderPreserve (xmlTextReaderPtr reader); #ifdef LIBXML_PATTERN_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderPreservePattern(xmlTextReaderPtr reader, const xmlChar *pattern, const xmlChar **namespaces); #endif /* LIBXML_PATTERN_ENABLED */ -XMLPUBFUN xmlDocPtr XMLCALL +XMLPUBFUN xmlDocPtr XMLCALL xmlTextReaderCurrentDoc (xmlTextReaderPtr reader); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlTextReaderExpand (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderNext (xmlTextReaderPtr reader); XMLPUBFUN int XMLCALL xmlTextReaderNextSibling (xmlTextReaderPtr reader); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderIsValid (xmlTextReaderPtr reader); #ifdef LIBXML_SCHEMAS_ENABLED -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, const char *rng); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, xmlRelaxNGPtr schema); XMLPUBFUN int XMLCALL xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, const char *xsd); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderSetSchema (xmlTextReaderPtr reader, xmlSchemaPtr schema); #endif @@ -367,26 +367,26 @@ XMLPUBFUN int XMLCALL * Error handling extensions */ typedef void * xmlTextReaderLocatorPtr; -typedef void (XMLCALL *xmlTextReaderErrorFunc) (void *arg, +typedef void (XMLCALL *xmlTextReaderErrorFunc) (void *arg, const char *msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator); /*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/ -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator); -XMLPUBFUN void XMLCALL - xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc f, +XMLPUBFUN void XMLCALL + xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc f, void *arg); XMLPUBFUN void XMLCALL xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, xmlStructuredErrorFunc f, void *arg); -XMLPUBFUN void XMLCALL - xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc *f, +XMLPUBFUN void XMLCALL + xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc *f, void **arg); #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlregexp.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlregexp.h index a7b3b2931fc..f09f9de0088 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlregexp.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlregexp.h @@ -38,7 +38,7 @@ typedef xmlRegExecCtxt *xmlRegExecCtxtPtr; #ifdef __cplusplus } -#endif +#endif #include #ifdef __cplusplus extern "C" { @@ -50,13 +50,13 @@ extern "C" { XMLPUBFUN xmlRegexpPtr XMLCALL xmlRegexpCompile (const xmlChar *regexp); XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegexpExec (xmlRegexpPtr comp, const xmlChar *value); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegexpPrint (FILE *output, xmlRegexpPtr regexp); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegexpIsDeterminist(xmlRegexpPtr comp); /* @@ -70,17 +70,17 @@ typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec, /* * The progressive API */ -XMLPUBFUN xmlRegExecCtxtPtr XMLCALL +XMLPUBFUN xmlRegExecCtxtPtr XMLCALL xmlRegNewExecCtxt (xmlRegexpPtr comp, xmlRegExecCallbacks callback, void *data); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar *value, void *data); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlRegExecPushString2(xmlRegExecCtxtPtr exec, const xmlChar *value, const xmlChar *value2, @@ -101,7 +101,7 @@ XMLPUBFUN int XMLCALL int *terminal); #ifdef __cplusplus } -#endif +#endif #endif /* LIBXML_REGEXP_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemas.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemas.h index 6cecffdcd88..0379fdaf1b2 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemas.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemas.h @@ -56,7 +56,7 @@ typedef enum { /* * ATTENTION: Change xmlSchemaSetValidOptions's check -* for invalid values, if adding to the validation +* for invalid values, if adding to the validation * options below. */ /** @@ -99,16 +99,16 @@ typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr; /* * Interfaces for parsing. */ -XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL xmlSchemaNewParserCtxt (const char *URL); -XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL +XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL xmlSchemaNewMemParserCtxt (const char *buffer, int size); XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL xmlSchemaNewDocParserCtxt (xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt, xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, @@ -121,19 +121,19 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt); -XMLPUBFUN xmlSchemaPtr XMLCALL +XMLPUBFUN xmlSchemaPtr XMLCALL xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaFree (xmlSchemaPtr schema); #ifdef LIBXML_OUTPUT_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaDump (FILE *output, xmlSchemaPtr schema); #endif /* LIBXML_OUTPUT_ENABLED */ /* * Interfaces for validating */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt, xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, @@ -149,11 +149,11 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt); -XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL +XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL xmlSchemaNewValidCtxt (xmlSchemaPtr schema); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt, xmlDocPtr instance); XMLPUBFUN int XMLCALL diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemastypes.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemastypes.h index 9a3a7a175e5..96017b5a6c4 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemastypes.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlschemastypes.h @@ -30,23 +30,23 @@ typedef enum { XML_SCHEMA_WHITESPACE_COLLAPSE = 3 } xmlSchemaWhitespaceValueType; -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaInitTypes (void); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaCleanupTypes (void); -XMLPUBFUN xmlSchemaTypePtr XMLCALL +XMLPUBFUN xmlSchemaTypePtr XMLCALL xmlSchemaGetPredefinedType (const xmlChar *name, const xmlChar *ns); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type, const xmlChar *value, xmlSchemaValPtr *val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type, const xmlChar *value, xmlSchemaValPtr *val, xmlNodePtr node); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaValidateFacet (xmlSchemaTypePtr base, xmlSchemaFacetPtr facet, const xmlChar *value, @@ -54,25 +54,25 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet, xmlSchemaWhitespaceValueType fws, - xmlSchemaValType valType, + xmlSchemaValType valType, const xmlChar *value, xmlSchemaValPtr val, xmlSchemaWhitespaceValueType ws); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaFreeValue (xmlSchemaValPtr val); -XMLPUBFUN xmlSchemaFacetPtr XMLCALL +XMLPUBFUN xmlSchemaFacetPtr XMLCALL xmlSchemaNewFacet (void); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaCheckFacet (xmlSchemaFacetPtr facet, xmlSchemaTypePtr typeDecl, xmlSchemaParserCtxtPtr ctxt, const xmlChar *name); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlSchemaFreeFacet (xmlSchemaFacetPtr facet); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlSchemaCompareValues (xmlSchemaValPtr x, xmlSchemaValPtr y); -XMLPUBFUN xmlSchemaTypePtr XMLCALL +XMLPUBFUN xmlSchemaTypePtr XMLCALL xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type); XMLPUBFUN int XMLCALL xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet, @@ -82,7 +82,7 @@ XMLPUBFUN int XMLCALL XMLPUBFUN xmlSchemaTypePtr XMLCALL xmlSchemaGetBuiltInType (xmlSchemaValType type); XMLPUBFUN int XMLCALL - xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, + xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type, int facetType); XMLPUBFUN xmlChar * XMLCALL xmlSchemaCollapseString (const xmlChar *value); @@ -91,7 +91,7 @@ XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN unsigned long XMLCALL xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet); XMLPUBFUN int XMLCALL - xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, + xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type, xmlSchemaFacetPtr facet, const xmlChar *value, xmlSchemaValPtr val, @@ -100,19 +100,19 @@ XMLPUBFUN int XMLCALL xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet, xmlSchemaValType valType, const xmlChar *value, - xmlSchemaValPtr val, + xmlSchemaValPtr val, unsigned long *length, xmlSchemaWhitespaceValueType ws); XMLPUBFUN int XMLCALL - xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, + xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, const xmlChar *value, - xmlSchemaValPtr *val, + xmlSchemaValPtr *val, xmlNodePtr node); XMLPUBFUN int XMLCALL xmlSchemaGetCanonValue (xmlSchemaValPtr val, const xmlChar **retValue); XMLPUBFUN int XMLCALL - xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, + xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val, const xmlChar **retValue, xmlSchemaWhitespaceValueType ws); XMLPUBFUN int XMLCALL diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlstring.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlstring.h index 39f846e219c..91e00cec02a 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlstring.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlstring.h @@ -114,16 +114,16 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlUTF8Strsize (const xmlChar *utf, int len); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlUTF8Strndup (const xmlChar *utf, int len); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlUTF8Strpos (const xmlChar *utf, int pos); XMLPUBFUN int XMLCALL xmlUTF8Strloc (const xmlChar *utf, const xmlChar *utfchar); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlUTF8Strsub (const xmlChar *utf, int start, int len); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xmlversion.h b/reactos/lib/3rdparty/libxml2/include/libxml/xmlversion.h index d6d6149995f..02e96638f18 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xmlversion.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xmlversion.h @@ -346,7 +346,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); */ #if 1 #define LIBXML_MODULES_ENABLED -#define LIBXML_MODULE_EXTENSION ".so" +#define LIBXML_MODULE_EXTENSION ".so" #endif /** diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xpath.h b/reactos/lib/3rdparty/libxml2/include/libxml/xpath.h index eee263056cc..c8cac7535c9 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xpath.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xpath.h @@ -33,7 +33,7 @@ extern "C" { #endif #endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */ - + #ifdef LIBXML_XPATH_ENABLED typedef struct _xmlXPathContext xmlXPathContext; typedef xmlXPathContext *xmlXPathContextPtr; @@ -253,11 +253,11 @@ typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt, * * Expression evaluation occurs with respect to a context. * he context consists of: - * - a node (the context node) - * - a node list (the context node list) - * - a set of variable bindings - * - a function library - * - the set of namespace declarations in scope for the expression + * - a node (the context node) + * - a node list (the context node list) + * - a set of variable bindings + * - a function library + * - the set of namespace declarations in scope for the expression * Following the switch to hash tables, this need to be trimmed up at * the next binary incompatible release. */ @@ -407,98 +407,98 @@ XMLPUBVAR double xmlXPathNINF; (((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL)) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeObject (xmlXPathObjectPtr obj); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeSetCreate (xmlNodePtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeNodeSet (xmlNodeSetPtr obj); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathObjectCopy (xmlXPathObjectPtr val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCmpNodes (xmlNodePtr node1, xmlNodePtr node2); /** * Conversion functions to basic types. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastNumberToBoolean (double val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastStringToBoolean (const xmlChar * val); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathCastToBoolean (xmlXPathObjectPtr val); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastBooleanToNumber (int val); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastStringToNumber (const xmlChar * val); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastNodeToNumber (xmlNodePtr node); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathCastToNumber (xmlXPathObjectPtr val); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastBooleanToString (int val); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastNumberToString (double val); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastNodeToString (xmlNodePtr node); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastNodeSetToString (xmlNodeSetPtr ns); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathCastToString (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathConvertBoolean (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathConvertNumber (xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathConvertString (xmlXPathObjectPtr val); /** * Context handling. */ -XMLPUBFUN xmlXPathContextPtr XMLCALL +XMLPUBFUN xmlXPathContextPtr XMLCALL xmlXPathNewContext (xmlDocPtr doc); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeContext (xmlXPathContextPtr ctxt); /** * Evaluation functions. */ -XMLPUBFUN long XMLCALL +XMLPUBFUN long XMLCALL xmlXPathOrderDocElems (xmlDocPtr doc); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathEval (const xmlChar *str, xmlXPathContextPtr ctx); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathEvalExpression (const xmlChar *str, xmlXPathContextPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathEvalPredicate (xmlXPathContextPtr ctxt, xmlXPathObjectPtr res); /** * Separate compilation/evaluation entry points. */ -XMLPUBFUN xmlXPathCompExprPtr XMLCALL +XMLPUBFUN xmlXPathCompExprPtr XMLCALL xmlXPathCompile (const xmlChar *str); -XMLPUBFUN xmlXPathCompExprPtr XMLCALL +XMLPUBFUN xmlXPathCompExprPtr XMLCALL xmlXPathCtxtCompile (xmlXPathContextPtr ctxt, const xmlChar *str); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathCompiledEval (xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp); #endif /* LIBXML_XPATH_ENABLED */ #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathInit (void); XMLPUBFUN int XMLCALL xmlXPathIsNaN (double val); diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xpathInternals.h b/reactos/lib/3rdparty/libxml2/include/libxml/xpathInternals.h index dcd524343e3..8532757a9fe 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xpathInternals.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xpathInternals.h @@ -100,15 +100,15 @@ extern "C" { */ #define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node) -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt); -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathPopNumber (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathPopString (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt); -XMLPUBFUN void * XMLCALL +XMLPUBFUN void * XMLCALL xmlXPathPopExternal (xmlXPathParserContextPtr ctxt); /** @@ -329,7 +329,7 @@ XMLPUBFUN void * XMLCALL * Variable Lookup forwarding. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt, xmlXPathVariableLookupFunc f, void *data); @@ -338,7 +338,7 @@ XMLPUBFUN void XMLCALL * Function Lookup forwarding. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt, xmlXPathFuncLookupFunc f, void *funcCtxt); @@ -346,7 +346,7 @@ XMLPUBFUN void XMLCALL /* * Error reporting. */ -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPatherror (xmlXPathParserContextPtr ctxt, const char *file, int line, @@ -357,11 +357,11 @@ XMLPUBFUN void XMLCALL int error); #ifdef LIBXML_DEBUG_ENABLED -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathDebugDumpObject (FILE *output, xmlXPathObjectPtr cur, int depth); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathDebugDumpCompExpr(FILE *output, xmlXPathCompExprPtr comp, int depth); @@ -369,48 +369,48 @@ XMLPUBFUN void XMLCALL /** * NodeSet handling. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathNodeSetContains (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathDifference (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathIntersection (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathDistinctSorted (xmlNodeSetPtr nodes); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathDistinct (xmlNodeSetPtr nodes); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathHasSameNodes (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathLeadingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeLeading (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathLeading (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathTrailingSorted (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathNodeTrailing (xmlNodeSetPtr nodes, xmlNodePtr node); -XMLPUBFUN xmlNodeSetPtr XMLCALL +XMLPUBFUN xmlNodeSetPtr XMLCALL xmlXPathTrailing (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2); @@ -419,51 +419,51 @@ XMLPUBFUN xmlNodeSetPtr XMLCALL * Extending a context. */ -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterNs (xmlXPathContextPtr ctxt, const xmlChar *prefix, const xmlChar *ns_uri); -XMLPUBFUN const xmlChar * XMLCALL +XMLPUBFUN const xmlChar * XMLCALL xmlXPathNsLookup (xmlXPathContextPtr ctxt, const xmlChar *prefix); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterFunc (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathFunction f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathFunction f); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterVariable (xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathObjectPtr value); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathObjectPtr value); -XMLPUBFUN xmlXPathFunction XMLCALL +XMLPUBFUN xmlXPathFunction XMLCALL xmlXPathFunctionLookup (xmlXPathContextPtr ctxt, const xmlChar *name); -XMLPUBFUN xmlXPathFunction XMLCALL +XMLPUBFUN xmlXPathFunction XMLCALL xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathVariableLookup (xmlXPathContextPtr ctxt, const xmlChar *name); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt); /** @@ -472,78 +472,78 @@ XMLPUBFUN void XMLCALL XMLPUBFUN xmlXPathParserContextPtr XMLCALL xmlXPathNewParserContext (const xmlChar *str, xmlXPathContextPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); /* TODO: remap to xmlXPathValuePop and Push. */ -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL valuePop (xmlXPathParserContextPtr ctxt); -XMLPUBFUN int XMLCALL +XMLPUBFUN int XMLCALL valuePush (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewString (const xmlChar *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewCString (const char *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapString (xmlChar *val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapCString (char * val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewFloat (double val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewBoolean (int val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewNodeSet (xmlNodePtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewValueTree (xmlNodePtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathNodeSetAdd (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, - xmlNodePtr node, +XMLPUBFUN void XMLCALL + xmlXPathNodeSetAddNs (xmlNodeSetPtr cur, + xmlNodePtr node, xmlNsPtr ns); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathNodeSetSort (xmlNodeSetPtr set); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRoot (xmlXPathParserContextPtr ctxt); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathParseName (xmlXPathParserContextPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL +XMLPUBFUN xmlChar * XMLCALL xmlXPathParseNCName (xmlXPathParserContextPtr ctxt); /* * Existing functions. */ -XMLPUBFUN double XMLCALL +XMLPUBFUN double XMLCALL xmlXPathStringEvalNumber (const xmlChar *str); -XMLPUBFUN int XMLCALL - xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, +XMLPUBFUN int XMLCALL + xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr res); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt); -XMLPUBFUN xmlNodeSetPtr XMLCALL - xmlXPathNodeSetMerge (xmlNodeSetPtr val1, +XMLPUBFUN xmlNodeSetPtr XMLCALL + xmlXPathNodeSetMerge (xmlNodeSetPtr val1, xmlNodeSetPtr val2); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetDel (xmlNodeSetPtr cur, +XMLPUBFUN void XMLCALL + xmlXPathNodeSetDel (xmlNodeSetPtr cur, xmlNodePtr val); -XMLPUBFUN void XMLCALL - xmlXPathNodeSetRemove (xmlNodeSetPtr cur, +XMLPUBFUN void XMLCALL + xmlXPathNodeSetRemove (xmlNodeSetPtr cur, int val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathNewNodeSetList (xmlNodeSetPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapNodeSet (xmlNodeSetPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathWrapExternal (void *val); XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt); @@ -621,7 +621,7 @@ XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, in * Really internal functions */ XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns); - + #ifdef __cplusplus } #endif diff --git a/reactos/lib/3rdparty/libxml2/include/libxml/xpointer.h b/reactos/lib/3rdparty/libxml2/include/libxml/xpointer.h index dde1dfb3d16..32b11b0a1f3 100644 --- a/reactos/lib/3rdparty/libxml2/include/libxml/xpointer.h +++ b/reactos/lib/3rdparty/libxml2/include/libxml/xpointer.h @@ -7,7 +7,7 @@ * * Added support for the element() scheme described in: * W3C Proposed Recommendation 13 November 2002 - * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ + * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ * * Copy: See Copyright for the status of this software. * @@ -43,68 +43,68 @@ struct _xmlLocationSet { * Handling of location sets. */ -XMLPUBFUN xmlLocationSetPtr XMLCALL +XMLPUBFUN xmlLocationSetPtr XMLCALL xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); -XMLPUBFUN xmlLocationSetPtr XMLCALL +XMLPUBFUN xmlLocationSetPtr XMLCALL xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, xmlLocationSetPtr val2); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRange (xmlNodePtr start, int startindex, xmlNodePtr end, int endindex); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangePoints (xmlXPathObjectPtr start, xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodePoint (xmlNodePtr start, xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodes (xmlNodePtr start, xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewLocationSetNodes (xmlNodePtr start, xmlNodePtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodeObject (xmlNodePtr start, xmlXPathObjectPtr end); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewCollapsedRange (xmlNodePtr start); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, xmlXPathObjectPtr val); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrWrapLocationSet (xmlLocationSetPtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrLocationSetDel (xmlLocationSetPtr cur, xmlXPathObjectPtr val); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, int val); /* * Functions. */ -XMLPUBFUN xmlXPathContextPtr XMLCALL +XMLPUBFUN xmlXPathContextPtr XMLCALL xmlXPtrNewContext (xmlDocPtr doc, xmlNodePtr here, xmlNodePtr origin); -XMLPUBFUN xmlXPathObjectPtr XMLCALL +XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrEval (const xmlChar *str, xmlXPathContextPtr ctx); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, int nargs); -XMLPUBFUN xmlNodePtr XMLCALL +XMLPUBFUN xmlNodePtr XMLCALL xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); -XMLPUBFUN void XMLCALL +XMLPUBFUN void XMLCALL xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); #ifdef __cplusplus } diff --git a/reactos/lib/3rdparty/libxml2/include/win32config.h b/reactos/lib/3rdparty/libxml2/include/win32config.h index 9c75afd7e46..1d05bb75ca3 100644 --- a/reactos/lib/3rdparty/libxml2/include/win32config.h +++ b/reactos/lib/3rdparty/libxml2/include/win32config.h @@ -32,9 +32,9 @@ #include #if defined(_MSC_VER) || defined(__BORLANDC__) /* MS C-runtime has functions which can be used in order to determine if - a given floating-point variable contains NaN, (+-)INF. These are + a given floating-point variable contains NaN, (+-)INF. These are preferred, because floating-point technology is considered propriatary - by MS and we can assume that their functions know more about their + by MS and we can assume that their functions know more about their oddities than we do. */ #include /* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass diff --git a/reactos/lib/3rdparty/libxml2/include/wsockcompat.h b/reactos/lib/3rdparty/libxml2/include/wsockcompat.h index 690048cedee..79bce37504a 100644 --- a/reactos/lib/3rdparty/libxml2/include/wsockcompat.h +++ b/reactos/lib/3rdparty/libxml2/include/wsockcompat.h @@ -51,8 +51,8 @@ #define EDQUOT WSAEDQUOT #define ESTALE WSAESTALE #define EREMOTE WSAEREMOTE -/* These cause conflicts with the codes from errno.h. Since they are - not used in the relevant code (nanoftp, nanohttp), we can leave +/* These cause conflicts with the codes from errno.h. Since they are + not used in the relevant code (nanoftp, nanohttp), we can leave them disabled. #define ENAMETOOLONG WSAENAMETOOLONG #define ENOTEMPTY WSAENOTEMPTY diff --git a/reactos/lib/3rdparty/libxml2/legacy.c b/reactos/lib/3rdparty/libxml2/legacy.c index bbbd2c98eb1..3ce55382ff4 100644 --- a/reactos/lib/3rdparty/libxml2/legacy.c +++ b/reactos/lib/3rdparty/libxml2/legacy.c @@ -393,7 +393,7 @@ xmlSetFeature(xmlParserCtxtPtr ctxt, const char *name, void *value) * @end: an end marker xmlChar, 0 if none * @end2: an end marker xmlChar, 0 if none * @end3: an end marker xmlChar, 0 if none - * + * * This function is deprecated, we now always process entities content * through xmlStringDecodeEntities * @@ -456,7 +456,7 @@ xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) /** * xmlNamespaceParseQName: * @ctxt: an XML parser context - * @prefix: a xmlChar ** + * @prefix: a xmlChar ** * * TODO: this seems not in use anymore, the namespace handling is done on * top of the SAX interfaces, i.e. not on raw input. @@ -603,7 +603,7 @@ xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) /** * xmlParserHandleReference: * @ctxt: the parser context - * + * * TODO: Remove, now deprecated ... the test is done directly in the * content parsing * routines. @@ -615,7 +615,7 @@ xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) * [ WFC: Entity Declared ] * the Name given in the entity reference must match that in an entity * declaration, except that well-formed documents need not declare any - * of the following entities: amp, lt, gt, apos, quot. + * of the following entities: amp, lt, gt, apos, quot. * * [ WFC: Parsed Entity ] * An entity reference must not contain the name of an unparsed entity @@ -624,7 +624,7 @@ xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) * '&#x' [0-9a-fA-F]+ ';' * * A PEReference may have been detected in the current input stream - * the handling is done accordingly to + * the handling is done accordingly to * http://www.w3.org/TR/REC-xml#entproc */ void @@ -694,7 +694,7 @@ xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED, /** * xmlUpgradeOldNs: * @doc: a document pointer - * + * * Upgrade old style Namespaces (PI) and move them to the root of the document. * DEPRECATED */ @@ -720,7 +720,7 @@ xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED) * * People must migrate their code to xmlEncodeEntitiesReentrant ! * This routine will issue a warning when encountered. - * + * * Returns NULL */ const xmlChar * @@ -962,8 +962,8 @@ getParameterEntity(void *ctx, const xmlChar * name) /** * entityDecl: * @ctx: the user data (XML parser context) - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -984,8 +984,8 @@ entityDecl(void *ctx, const xmlChar * name, int type, * attributeDecl: * @ctx: the user data (XML parser context) * @elem: the name of the element - * @fullname: the attribute name - * @type: the attribute type + * @fullname: the attribute name + * @type: the attribute type * @def: the type of default value * @defaultValue: the attribute default value * @tree: the tree of enumerated value set @@ -1006,8 +1006,8 @@ attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname, /** * elementDecl: * @ctx: the user data (XML parser context) - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value tree * * An element definition has been parsed @@ -1160,7 +1160,7 @@ endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED) * @ctx: the user data (XML parser context) * @name: The entity name * - * called when an entity reference is detected. + * called when an entity reference is detected. * DEPRECATED: use xmlSAX2Reference() */ void diff --git a/reactos/lib/3rdparty/libxml2/list.c b/reactos/lib/3rdparty/libxml2/list.c index 2dc6d96f509..9f68897a20b 100644 --- a/reactos/lib/3rdparty/libxml2/list.c +++ b/reactos/lib/3rdparty/libxml2/list.c @@ -94,15 +94,15 @@ xmlLinkCompare(const void *data0, const void *data1) * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListLowerSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListLowerSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) return(NULL); for(lk = l->sentinel->next;lk != l->sentinel && l->linkCompare(lk->data, data) <0 ;lk = lk->next); - return lk; + return lk; } /** @@ -114,15 +114,15 @@ xmlListLowerSearch(xmlListPtr l, void *data) * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListHigherSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListHigherSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) return(NULL); for(lk = l->sentinel->prev;lk != l->sentinel && l->linkCompare(lk->data, data) >0 ;lk = lk->prev); - return lk; + return lk; } /** @@ -134,8 +134,8 @@ xmlListHigherSearch(xmlListPtr l, void *data) * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListLinkSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListLinkSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -159,8 +159,8 @@ xmlListLinkSearch(xmlListPtr l, void *data) * * Returns the link containing the data or NULL */ -static xmlLinkPtr -xmlListLinkReverseSearch(xmlListPtr l, void *data) +static xmlLinkPtr +xmlListLinkReverseSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -189,16 +189,16 @@ xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare) { xmlListPtr l; if (NULL == (l = (xmlListPtr )xmlMalloc( sizeof(xmlList)))) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for list"); return (NULL); } /* Initialize the list to NULL */ memset(l, 0, sizeof(xmlList)); - + /* Add the sentinel */ if (NULL ==(l->sentinel = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for sentinel"); xmlFree(l); return (NULL); @@ -206,7 +206,7 @@ xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare) l->sentinel->next = l->sentinel; l->sentinel->prev = l->sentinel; l->sentinel->data = NULL; - + /* If there is a link deallocator, use it */ if (deallocator != NULL) l->linkDeallocator = deallocator; @@ -217,7 +217,7 @@ xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare) l->linkCompare = xmlLinkCompare; return l; } - + /** * xmlListSearch: * @l: a list @@ -228,7 +228,7 @@ xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare) * Returns the value associated to @data or NULL in case of error */ void * -xmlListSearch(xmlListPtr l, void *data) +xmlListSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -249,7 +249,7 @@ xmlListSearch(xmlListPtr l, void *data) * Returns the value associated to @data or NULL in case of error */ void * -xmlListReverseSearch(xmlListPtr l, void *data) +xmlListReverseSearch(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) @@ -270,7 +270,7 @@ xmlListReverseSearch(xmlListPtr l, void *data) * Returns 0 in case of success, 1 in case of failure */ int -xmlListInsert(xmlListPtr l, void *data) +xmlListInsert(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -280,7 +280,7 @@ xmlListInsert(xmlListPtr l, void *data) /* Add the new link */ lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink)); if (lkNew == NULL) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (1); } @@ -302,7 +302,7 @@ xmlListInsert(xmlListPtr l, void *data) * * Returns 0 in case of success, 1 in case of failure */ -int xmlListAppend(xmlListPtr l, void *data) +int xmlListAppend(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -312,7 +312,7 @@ int xmlListAppend(xmlListPtr l, void *data) /* Add the new link */ lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink)); if (lkNew == NULL) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (0); } @@ -353,7 +353,7 @@ int xmlListRemoveFirst(xmlListPtr l, void *data) { xmlLinkPtr lk; - + if (l == NULL) return(0); /*Find the first instance of this data */ @@ -378,7 +378,7 @@ int xmlListRemoveLast(xmlListPtr l, void *data) { xmlLinkPtr lk; - + if (l == NULL) return(0); /*Find the last instance of this data */ @@ -403,7 +403,7 @@ int xmlListRemoveAll(xmlListPtr l, void *data) { int count=0; - + if (l == NULL) return(0); @@ -422,7 +422,7 @@ void xmlListClear(xmlListPtr l) { xmlLinkPtr lk; - + if (l == NULL) return; lk = l->sentinel->next; @@ -458,14 +458,14 @@ xmlListEmpty(xmlListPtr l) * * Returns the first element in the list, or NULL */ -xmlLinkPtr +xmlLinkPtr xmlListFront(xmlListPtr l) { if (l == NULL) return(NULL); return (l->sentinel->next); } - + /** * xmlListEnd: * @l: a list @@ -474,14 +474,14 @@ xmlListFront(xmlListPtr l) * * Returns the last element in the list, or NULL */ -xmlLinkPtr +xmlLinkPtr xmlListEnd(xmlListPtr l) { if (l == NULL) return(NULL); return (l->sentinel->prev); } - + /** * xmlListSize: * @l: a list @@ -539,7 +539,7 @@ xmlListPopBack(xmlListPtr l) * Returns 1 if successful, 0 otherwise */ int -xmlListPushFront(xmlListPtr l, void *data) +xmlListPushFront(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -549,7 +549,7 @@ xmlListPushFront(xmlListPtr l, void *data) /* Add the new link */ lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink)); if (lkNew == NULL) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (0); } @@ -571,7 +571,7 @@ xmlListPushFront(xmlListPtr l, void *data) * Returns 1 if successful, 0 otherwise */ int -xmlListPushBack(xmlListPtr l, void *data) +xmlListPushBack(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; @@ -580,7 +580,7 @@ xmlListPushBack(xmlListPtr l, void *data) lkPlace = l->sentinel->prev; /* Add the new link */ if (NULL ==(lkNew = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Cannot initialize memory for new link"); return (0); } @@ -643,7 +643,7 @@ void xmlListSort(xmlListPtr l) { xmlListPtr lTemp; - + if (l == NULL) return; if(xmlListEmpty(l)) @@ -725,10 +725,10 @@ xmlListMerge(xmlListPtr l1, xmlListPtr l2) * @old: the list * * Duplicate the list - * + * * Returns a new copy of the list or NULL in case of error */ -xmlListPtr +xmlListPtr xmlListDup(const xmlListPtr old) { xmlListPtr cur; @@ -754,7 +754,7 @@ xmlListDup(const xmlListPtr old) * @old: the old list * * Move all the element from the old list in the new list - * + * * Returns 0 in case of success 1 in case of error */ int @@ -771,7 +771,7 @@ xmlListCopy(xmlListPtr cur, const xmlListPtr old) return (1); } } - return (0); + return (0); } /* xmlListUnique() */ /* xmlListSwap */ diff --git a/reactos/lib/3rdparty/libxml2/parser.c b/reactos/lib/3rdparty/libxml2/parser.c index 009dcd36ef7..f772fa5643f 100644 --- a/reactos/lib/3rdparty/libxml2/parser.c +++ b/reactos/lib/3rdparty/libxml2/parser.c @@ -17,7 +17,7 @@ * parserInternals.c to reduce this file size. * As much as possible the functions are associated with their relative * production in the XML specification. A few productions defining the - * different ranges of character are actually implanted either in + * different ranges of character are actually implanted either in * parserInternals.h or parserInternals.c * The DOM tree build is realized from the default SAX callbacks in * the module SAX.c. @@ -83,8 +83,8 @@ /** * xmlParserMaxDepth: * - * arbitrary depth limit for the XML documents that we allow to - * process. This is not a limitation of the parser but a safety + * arbitrary depth limit for the XML documents that we allow to + * process. This is not a limitation of the parser but a safety * boundary feature. */ unsigned int xmlParserMaxDepth = 1024; @@ -406,7 +406,7 @@ xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { xmlStructuredErrorFunc schannel = NULL; - + if ((ctxt != NULL) && (ctxt->disableSAX != 0) && (ctxt->instate == XML_PARSER_EOF)) return; @@ -489,7 +489,7 @@ xmlFatalErrMsgInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, */ static void xmlFatalErrMsgStrIntStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, - const char *msg, const xmlChar *str1, int val, + const char *msg, const xmlChar *str1, int val, const xmlChar *str2) { if ((ctxt != NULL) && (ctxt->disableSAX != 0) && @@ -607,7 +607,7 @@ xmlDetectSAX2(xmlParserCtxtPtr ctxt) { ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3); ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5); ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36); - if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) || + if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) || (ctxt->str_xml_ns == NULL)) { xmlErrMemory(ctxt, NULL); } @@ -896,7 +896,7 @@ nsPop(xmlParserCtxtPtr ctxt, int nr) } if (ctxt->nsNr <= 0) return (0); - + for (i = 0;i < nr;i++) { ctxt->nsNr--; ctxt->nsTab[ctxt->nsNr] = NULL; @@ -1236,7 +1236,7 @@ static int spacePop(xmlParserCtxtPtr ctxt) { * to compare on ASCII based substring. * SKIP(n) Skip n xmlChar, and must also be used only to skip ASCII defined * strings without newlines within the parser. - * NEXT1(l) Skip 1 xmlChar, and must also be used only to skip 1 non-newline ASCII + * NEXT1(l) Skip 1 xmlChar, and must also be used only to skip 1 non-newline ASCII * defined char within the parser. * Clean macros, not dependent of an ASCII context, expect UTF-8 encoding * @@ -1470,7 +1470,7 @@ xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) { * * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. * * Returns the value parsed (as an int), 0 in case of error */ @@ -1492,7 +1492,7 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) { count = 0; GROW; } - if ((RAW >= '0') && (RAW <= '9')) + if ((RAW >= '0') && (RAW <= '9')) val = val * 16 + (CUR - '0'); else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20)) val = val * 16 + (CUR - 'a') + 10; @@ -1523,7 +1523,7 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) { count = 0; GROW; } - if ((RAW >= '0') && (RAW <= '9')) + if ((RAW >= '0') && (RAW <= '9')) val = val * 10 + (CUR - '0'); else { xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL); @@ -1549,7 +1549,7 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) { /* * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. */ if ((IS_CHAR(val) && (outofrange == 0))) { return(val); @@ -1574,7 +1574,7 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) { * * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. * * Returns the value parsed (as an int), 0 in case of error, str will be * updated to the current value of the index @@ -1593,7 +1593,7 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { ptr += 3; cur = *ptr; while (cur != ';') { /* Non input consuming loop */ - if ((cur >= '0') && (cur <= '9')) + if ((cur >= '0') && (cur <= '9')) val = val * 16 + (cur - '0'); else if ((cur >= 'a') && (cur <= 'f')) val = val * 16 + (cur - 'a') + 10; @@ -1616,7 +1616,7 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { ptr += 2; cur = *ptr; while (cur != ';') { /* Non input consuming loops */ - if ((cur >= '0') && (cur <= '9')) + if ((cur >= '0') && (cur <= '9')) val = val * 10 + (cur - '0'); else { xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL); @@ -1640,7 +1640,7 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { /* * [ WFC: Legal Character ] * Characters referred to using character references must match the - * production for Char. + * production for Char. */ if ((IS_CHAR(val) && (outofrange == 0))) { return(val); @@ -1662,9 +1662,9 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) { * * Returns the new input stream or NULL */ - + static void deallocblankswrapper (xmlChar *str) {xmlFree(str);} - + static xmlParserInputPtr xmlNewBlanksWrapperInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) { xmlParserInputPtr input; @@ -1705,12 +1705,12 @@ xmlNewBlanksWrapperInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) { /** * xmlParserHandlePEReference: * @ctxt: the parser context - * + * * [69] PEReference ::= '%' Name ';' * * [ WFC: No Recursion ] * A parsed entity must not contain a recursive - * reference to itself, either directly or indirectly. + * reference to itself, either directly or indirectly. * * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an internal DTD @@ -1728,9 +1728,9 @@ xmlNewBlanksWrapperInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) { * NOTE: misleading but this is handled. * * A PEReference may have been detected in the current input stream - * the handling is done accordingly to + * the handling is done accordingly to * http://www.w3.org/TR/REC-xml#entproc - * i.e. + * i.e. * - Included in literal in entity values * - Included as Parameter Entity reference within DTDs */ @@ -1808,7 +1808,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL)) entity = ctxt->sax->getParameterEntity(ctxt->userData, name); if (entity == NULL) { - + /* * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an @@ -1834,7 +1834,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name); - } else + } else xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); @@ -1857,7 +1857,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { input = xmlNewEntityInputStream(ctxt, entity); xmlPushInput(ctxt, input); - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines. @@ -1916,7 +1916,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { * @end: an end marker xmlChar, 0 if none * @end2: an end marker xmlChar, 0 if none * @end3: an end marker xmlChar, 0 if none - * + * * Takes a entity string content and process to do the adequate substitutions. * * [67] Reference ::= EntityRef | CharRef @@ -2067,7 +2067,7 @@ mem_error: * @end: an end marker xmlChar, 0 if none * @end2: an end marker xmlChar, 0 if none * @end3: an end marker xmlChar, 0 if none - * + * * Takes a entity string content and process to do the adequate substitutions. * * [67] Reference ::= EntityRef | CharRef @@ -2169,7 +2169,7 @@ static int areBlanks(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, * xmlSplitQName: * @ctxt: an XML parser context * @name: an XML parser context - * @prefix: a xmlChar ** + * @prefix: a xmlChar ** * * parse an UTF8 encoded XML qualified name string * @@ -2220,7 +2220,7 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) { * for the processing speed. */ max = len * 2; - + buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar)); if (buffer == NULL) { xmlErrMemory(ctxt, NULL); @@ -2246,7 +2246,7 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) { } buffer[len] = 0; } - + /* nasty but well=formed if ((c == ':') && (*cur == 0)) { return(xmlStrdup(name)); @@ -2297,7 +2297,7 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) { * for the processing speed. */ max = len * 2; - + buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar)); if (buffer == NULL) { xmlErrMemory(ctxt, NULL); @@ -2323,7 +2323,7 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) { } buffer[len] = 0; } - + if (buffer == NULL) ret = xmlStrndup(buf, len); else { @@ -2415,7 +2415,7 @@ xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) { const xmlChar *ret; GROW; - + in = ctxt->input->cur; while (*in != 0 && *in == *cmp) { ++in; @@ -2456,7 +2456,7 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) { while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */ ((IS_LETTER(c)) || (IS_DIGIT(c)) || (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c)))) { if (count++ > 100) { @@ -2484,7 +2484,7 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) { * * [6] Names ::= Name (#x20 Name)* * - * Returns the Name parsed or NULL. The @str pointer + * Returns the Name parsed or NULL. The @str pointer * is updated to the current location in the string. */ @@ -2503,7 +2503,7 @@ xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) { while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigentname.xml */ (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c))) { COPY_BUF(l,buf,len,c); @@ -2516,7 +2516,7 @@ xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) { */ xmlChar *buffer; int max = len * 2; - + buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar)); if (buffer == NULL) { xmlErrMemory(ctxt, NULL); @@ -2526,7 +2526,7 @@ xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) { while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigentname.xml */ (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c))) { if (len + 10 > max) { @@ -2557,7 +2557,7 @@ xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) { /** * xmlParseNmtoken: * @ctxt: an XML parser context - * + * * parse an XML Nmtoken. * * [7] Nmtoken ::= (NameChar)+ @@ -2579,7 +2579,7 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) { while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigtoken.xml */ (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c))) { if (count++ > 100) { @@ -2596,7 +2596,7 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) { */ xmlChar *buffer; int max = len * 2; - + buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar)); if (buffer == NULL) { xmlErrMemory(ctxt, NULL); @@ -2605,7 +2605,7 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) { memcpy(buffer, buf, len); while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigtoken.xml */ (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c))) { if (count++ > 100) { @@ -2688,7 +2688,7 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { * When a parameter entity reference appears in a literal entity * value, ... a single or double quote character in the replacement * text is always treated as a normal data character and will not - * terminate the literal. + * terminate the literal. * In practice it means we stop the loop only when back at parsing * the initial entity and the quote is found */ @@ -2769,12 +2769,12 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { */ ret = xmlStringDecodeEntities(ctxt, buf, XML_SUBSTITUTE_PEREF, 0, 0, 0); - if (orig != NULL) + if (orig != NULL) *orig = buf; else xmlFree(buf); } - + return(ret); } @@ -2812,7 +2812,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL); return(NULL); } - + /* * allocate a translation buffer. */ @@ -2875,7 +2875,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { } else { buf[len++] = ent->content[0]; } - } else if ((ent != NULL) && + } else if ((ent != NULL) && (ctxt->replaceEntities != 0)) { xmlChar *rep; @@ -2984,20 +2984,20 @@ mem_error: * * 3.3.3 Attribute-Value Normalization: * Before the value of an attribute is passed to the application or - * checked for validity, the XML processor must normalize it as follows: + * checked for validity, the XML processor must normalize it as follows: * - a character reference is processed by appending the referenced * character to the attribute value * - an entity reference is processed by recursively processing the - * replacement text of the entity + * replacement text of the entity * - a whitespace character (#x20, #xD, #xA, #x9) is processed by * appending #x20 to the normalized value, except that only a single * #x20 is appended for a "#xD#xA" sequence that is part of an external - * parsed entity or the literal entity value of an internal parsed entity - * - other characters are processed by appending them to the normalized value + * parsed entity or the literal entity value of an internal parsed entity + * - other characters are processed by appending them to the normalized value * If the declared value is not CDATA, then the XML processor must further * process the normalized attribute value by discarding any leading and * trailing space (#x20) characters, and by replacing sequences of space - * (#x20) characters by a single space (#x20) character. + * (#x20) characters by a single space (#x20) character. * All attributes for which no declaration has been read should be treated * by a non-validating parser as if declared CDATA. * @@ -3014,7 +3014,7 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) { /** * xmlParseSystemLiteral: * @ctxt: an XML parser context - * + * * parse an XML Literal * * [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") @@ -3043,7 +3043,7 @@ xmlParseSystemLiteral(xmlParserCtxtPtr ctxt) { xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL); return(NULL); } - + buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); if (buf == NULL) { xmlErrMemory(ctxt, NULL); @@ -3177,7 +3177,7 @@ void xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata); * The right angle bracket (>) may be represented using the string ">", * and must, for compatibility, be escaped using ">" or a character * reference when it appears in the string "]]>" in content, when that - * string is not marking the end of a CDATA section. + * string is not marking the end of a CDATA section. * * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) */ @@ -3339,7 +3339,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) { GROW; cur = CUR_CHAR(l); while ((cur != '<') && /* checked */ - (cur != '&') && + (cur != '&') && (IS_CHAR(cur))) /* test also done in xmlCurrentChar() */ { if ((cur == ']') && (NXT(1) == ']') && (NXT(2) == '>')) { @@ -3453,7 +3453,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) { } } else { /* - * We handle [83] so we return immediately, if + * We handle [83] so we return immediately, if * "S SystemLiteral" is not detected. From a purely parsing * point of view that's a nice mess. */ @@ -3462,7 +3462,7 @@ xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) { ptr = CUR_PTR; if (!IS_BLANK_CH(*ptr)) return(NULL); - + while (IS_BLANK_CH(*ptr)) ptr++; /* TODO: dangerous, fix ! */ if ((*ptr != '\'') && (*ptr != '"')) return(NULL); } @@ -3677,7 +3677,7 @@ get_more: } ctxt->input->cur = in; if (*in == 0xA) - + if (*in == 0xD) { in++; if (*in == 0xA) { @@ -3731,7 +3731,7 @@ get_more: /** * xmlParsePITarget: * @ctxt: an XML parser context - * + * * parse the name of a PI * * [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) @@ -3775,7 +3775,7 @@ xmlParsePITarget(xmlParserCtxtPtr ctxt) { * xmlParseCatalogPI: * @ctxt: an XML parser context * @catalog: the PI value string - * + * * parse an XML Catalog Processing Instruction. * * @@ -3835,7 +3835,7 @@ error: /** * xmlParsePI: * @ctxt: an XML parser context - * + * * parse an XML Processing Instruction. * * [16] PI ::= '' Char*)))? '?>' @@ -3988,7 +3988,7 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) { const xmlChar *name; xmlChar *Pubid; xmlChar *Systemid; - + if (CMP10(CUR_PTR, '<', '!', 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) { xmlParserInputPtr input = ctxt->input; SHRINK; @@ -4066,7 +4066,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { int isParameter = 0; xmlChar *orig = NULL; int skipped; - + /* GROW; done in the caller */ if (CMP8(CUR_PTR, '<', '!', 'E', 'N', 'T', 'I', 'T', 'Y')) { xmlParserInputPtr input = ctxt->input; @@ -4308,13 +4308,13 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { * * [ VC: Fixed Attribute Default ] * if an attribute has a default value declared with the #FIXED - * keyword, instances of that attribute must match the default value. + * keyword, instances of that attribute must match the default value. * * [ WFC: No < in Attribute Values ] * handled in xmlParseAttValue() * * returns: XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED - * or XML_ATTRIBUTE_FIXED. + * or XML_ATTRIBUTE_FIXED. */ int @@ -4363,7 +4363,7 @@ xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, xmlChar **value) { * * [ VC: Notation Attributes ] * Values of this type must match one of the notation names included - * in the declaration; all notation names in the declaration must be declared. + * in the declaration; all notation names in the declaration must be declared. * * Returns: the notation attribute tree built while parsing */ @@ -4528,15 +4528,15 @@ xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) { * [ VC: Entity Name ] * Values of type ENTITY must match the Name production, values * of type ENTITIES must match Names; each Entity Name must match the - * name of an unparsed entity declared in the DTD. + * name of an unparsed entity declared in the DTD. * * [ VC: Name Token ] * Values of type NMTOKEN must match the Nmtoken production; values - * of type NMTOKENS must match Nmtokens. + * of type NMTOKENS must match Nmtokens. * * Returns the attribute type */ -int +int xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) { SHRINK; if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) { @@ -4683,7 +4683,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { xmlFreeEnumeration(tree); if ((ctxt->sax2) && (defaultValue != NULL) && - (def != XML_ATTRIBUTE_IMPLIED) && + (def != XML_ATTRIBUTE_IMPLIED) && (def != XML_ATTRIBUTE_REQUIRED)) { xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue); } @@ -4711,7 +4711,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { * * parse the declaration for a Mixed Element content * The leading '(' and spaces have been skipped in xmlParseElementContentDecl - * + * * [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | * '(' S? '#PCDATA' S? ')' * @@ -4719,7 +4719,7 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) { * * [ VC: No Duplicate Types ] * The same name must not appear more than once in a single - * mixed-content declaration. + * mixed-content declaration. * * returns: the list of the xmlElementContentPtr describing the element choices */ @@ -4815,7 +4815,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) { * * parse the declaration for a Mixed Element content * The leading '(' and spaces have been skipped in xmlParseElementContentDecl - * + * * * [47] children ::= (choice | seq) ('?' | '*' | '+')? * @@ -4836,7 +4836,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) { * be empty, and neither the first nor last non-blank character of * the replacement text should be a connector (| or ,). * - * Returns the tree of xmlElementContentPtr describing the element + * Returns the tree of xmlElementContentPtr describing the element * hierarchy. */ xmlElementContentPtr @@ -5096,7 +5096,7 @@ xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk) { * * parse the declaration for an Element content either Mixed or Children, * the cases EMPTY and ANY are handled directly in xmlParseElementDecl - * + * * [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children * * returns: the type of element content XML_ELEMENT_TYPE_xxx @@ -5222,7 +5222,7 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) { xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY, "Element declaration doesn't start and stop in the same entity\n"); } - + NEXT; if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && (ctxt->sax->elementDecl != NULL)) { @@ -5234,7 +5234,7 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) { /* * this is a trick: if xmlAddElementDecl is called, * instead of copying the full tree it is plugged directly - * if called from the parser. Avoid duplicating the + * if called from the parser. Avoid duplicating the * interfaces or change the API/ABI */ xmlFreeDocElementContent(ctxt->myDoc, content); @@ -5251,8 +5251,8 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) { * xmlParseConditionalSections * @ctxt: an XML parser context * - * [61] conditionalSect ::= includeSect | ignoreSect - * [62] includeSect ::= '' + * [61] conditionalSect ::= includeSect | ignoreSect + * [62] includeSect ::= '' * [63] ignoreSect ::= '' * [64] ignoreSectContents ::= Ignore ('' Ignore)* * [65] Ignore ::= Char* - (Char* ('') Char*) @@ -5386,7 +5386,7 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) { /** * xmlParseMarkupDecl: * @ctxt: an XML parser context - * + * * parse Markup declarations * * [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | @@ -5403,7 +5403,7 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) { * In the internal DTD subset, parameter-entity references can occur * only where markup declarations can occur, not within markup declarations. * (This does not apply to references that occur in external parameter - * entities or to the external subset.) + * entities or to the external subset.) */ void xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) { @@ -5457,7 +5457,7 @@ xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) { /** * xmlParseTextDecl: * @ctxt: an XML parser context - * + * * parse an XML declaration header for external entities * * [77] TextDecl ::= '' @@ -5534,7 +5534,7 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) { * @ctxt: an XML parser context * @ExternalID: the external identifier * @SystemID: the system identifier (or URL) - * + * * parse Markup declarations from an external subset * * [30] extSubset ::= textDecl? extSubsetDecl @@ -5591,7 +5591,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, break; } } - + if (RAW != 0) { xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL); } @@ -5601,7 +5601,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, /** * xmlParseReference: * @ctxt: an XML parser context - * + * * parse and handle entity references in content, depending on the SAX * interface, this may end-up in a call to character() if this is a * CharRef, a predefined entity, if there is no reference() callback. @@ -5620,7 +5620,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { xmlChar out[10]; int hex = NXT(2); int value = xmlParseCharRef(ctxt); - + if (ctxt->charset != XML_CHAR_ENCODING_UTF8) { /* * So we are using non-UTF-8 buffers @@ -5657,7 +5657,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { if (ent == NULL) return; if (!ctxt->wellFormed) return; - if ((ent->name != NULL) && + if ((ent->name != NULL) && (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) { xmlNodePtr list = NULL; xmlParserErrors ret = XML_ERR_OK; @@ -5681,16 +5681,16 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { /* * DONE: get definite answer on this !!! * Lots of entity decls are used to declare a single - * char + * char * * Which seems to be valid since * 2.4: The ampersand character (&) and the left angle * bracket (<) may appear in their literal form only * when used ... They are also legal within the literal * entity value of an internal entity declaration;i - * see "4.3.2 Well-Formed Parsed Entities". + * see "4.3.2 Well-Formed Parsed Entities". * IMHO 2.4 and 4.3.2 are directly in contradiction. - * Looking at the OASIS test suite and James Clark + * Looking at the OASIS test suite and James Clark * tests, this is broken. However the XML REC uses * it. Is the XML REC not well-formed ???? * This is a hack to avoid this problem @@ -5871,7 +5871,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { cur = cur->next; } #ifdef LIBXML_LEGACY_ENABLED - if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) + if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) xmlAddEntityReference(ent, firstChild, nw); #endif /* LIBXML_LEGACY_ENABLED */ } else if (list == NULL) { @@ -5907,7 +5907,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { } ent->owner = 1; #ifdef LIBXML_LEGACY_ENABLED - if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) + if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) xmlAddEntityReference(ent, firstChild, nw); #endif /* LIBXML_LEGACY_ENABLED */ } else { @@ -6009,7 +6009,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { xmlEntityPtr ent = NULL; GROW; - + if (RAW == '&') { NEXT; name = xmlParseName(ctxt); @@ -6052,7 +6052,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { * is not obligated to read and process their declarations; * for such documents, the rule that an entity must be * declared is a well-formedness constraint only if - * standalone='yes'. + * standalone='yes'. */ if (ent == NULL) { if ((ctxt->standalone == 1) || @@ -6091,7 +6091,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { * [ WFC: No < in Attribute Values ] * The replacement text of any entity referred to directly or * indirectly in an attribute value (other than "<") must - * not contain a <. + * not contain a <. */ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && (ent != NULL) && @@ -6121,7 +6121,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { /* * [ WFC: No Recursion ] * A parsed entity must not contain a recursive reference - * to itself, either directly or indirectly. + * to itself, either directly or indirectly. * Done somewhere else */ @@ -6217,7 +6217,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { * is not obligated to read and process their declarations; * for such documents, the rule that an entity must be * declared is a well-formedness constraint only if - * standalone='yes'. + * standalone='yes'. */ if (ent == NULL) { if ((ctxt->standalone == 1) || @@ -6257,7 +6257,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { * [ WFC: No < in Attribute Values ] * The replacement text of any entity referred to directly or * indirectly in an attribute value (other than "<") must - * not contain a <. + * not contain a <. */ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && (ent != NULL) && @@ -6288,7 +6288,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { /* * [ WFC: No Recursion ] * A parsed entity must not contain a recursive reference - * to itself, either directly or indirectly. + * to itself, either directly or indirectly. * Done somewhere else */ @@ -6314,7 +6314,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { * * [ WFC: No Recursion ] * A parsed entity must not contain a recursive - * reference to itself, either directly or indirectly. + * reference to itself, either directly or indirectly. * * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an internal DTD @@ -6435,7 +6435,7 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) * * [ WFC: No Recursion ] * A parsed entity must not contain a recursive - * reference to itself, either directly or indirectly. + * reference to itself, either directly or indirectly. * * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an internal DTD @@ -6536,12 +6536,12 @@ xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) { * * parse a DOCTYPE declaration * - * [28] doctypedecl ::= '' * * [ VC: Root Element Type ] * The Name in the document type declaration must match the element - * type of the root element. + * type of the root element. */ void @@ -6623,7 +6623,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { ctxt->instate = XML_PARSER_DTD; NEXT; /* - * Parse the succession of Markup declarations and + * Parse the succession of Markup declarations and * PEReferences. * Subsequence (markupdecl | PEReference | S)* */ @@ -6647,7 +6647,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { break; } } - if (RAW == ']') { + if (RAW == ']') { NEXT; SKIP_BLANKS; } @@ -6678,8 +6678,8 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { * * [ WFC: No < in Attribute Values ] * The replacement text of any entity referred to directly or indirectly in - * an attribute value (other than "<") must not contain a <. - * + * an attribute value (other than "<") must not contain a <. + * * [ VC: Attribute Value Type ] * The attribute must have been declared; the value must be of the type * declared for it. @@ -6760,7 +6760,7 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, xmlChar **value) { /** * xmlParseStartTag: * @ctxt: an XML parser context - * + * * parse a start of tag either for rule element or * EmptyElement. In both case we don't parse the tag closing chars. * @@ -6768,13 +6768,13 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, xmlChar **value) { * * [ WFC: Unique Att Spec ] * No attribute name may appear more than once in the same start-tag or - * empty-element tag. + * empty-element tag. * * [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' * * [ WFC: Unique Att Spec ] * No attribute name may appear more than once in the same start-tag or - * empty-element tag. + * empty-element tag. * * With namespace: * @@ -6813,7 +6813,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) { SKIP_BLANKS; GROW; - while ((RAW != '>') && + while ((RAW != '>') && ((RAW != '/') || (NXT(1) != '>')) && (IS_BYTE_CHAR(RAW))) { const xmlChar *q = CUR_PTR; @@ -6824,7 +6824,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) { /* * [ WFC: Unique Att Spec ] * No attribute name may appear more than once in the same - * start-tag or empty-element tag. + * start-tag or empty-element tag. */ for (i = 0; i < nbatts;i += 2) { if (xmlStrEqual(atts[i], attname)) { @@ -6873,7 +6873,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) { xmlFree(attvalue); } -failed: +failed: GROW if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>')))) @@ -6955,7 +6955,7 @@ xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) { /* * [ WFC: Element Type Match ] * The Name in an element's end-tag must match the element type in the - * start-tag. + * start-tag. * */ if (name != (xmlChar*)1) { @@ -7133,7 +7133,7 @@ xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) { if (CUR == ':') { l = xmlParseName(ctxt); if (l != NULL) { - xmlNsErr(ctxt, XML_NS_ERR_QNAME, + xmlNsErr(ctxt, XML_NS_ERR_QNAME, "Failed to parse QName '%s'\n", l, NULL, NULL); *prefix = NULL; return(l); @@ -7207,7 +7207,7 @@ xmlParseQNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *name, GROW; in = ctxt->input->cur; - + cmp = prefix; while (*in != 0 && *in == *cmp) { ++in; @@ -7248,20 +7248,20 @@ xmlParseQNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *name, * * 3.3.3 Attribute-Value Normalization: * Before the value of an attribute is passed to the application or - * checked for validity, the XML processor must normalize it as follows: + * checked for validity, the XML processor must normalize it as follows: * - a character reference is processed by appending the referenced * character to the attribute value * - an entity reference is processed by recursively processing the - * replacement text of the entity + * replacement text of the entity * - a whitespace character (#x20, #xD, #xA, #x9) is processed by * appending #x20 to the normalized value, except that only a single * #x20 is appended for a "#xD#xA" sequence that is part of an external - * parsed entity or the literal entity value of an internal parsed entity - * - other characters are processed by appending them to the normalized value + * parsed entity or the literal entity value of an internal parsed entity + * - other characters are processed by appending them to the normalized value * If the declared value is not CDATA, then the XML processor must further * process the normalized attribute value by discarding any leading and * trailing space (#x20) characters, and by replacing sequences of space - * (#x20) characters by a single space (#x20) character. + * (#x20) characters by a single space (#x20) character. * All attributes for which no declaration has been read should be treated * by a non-validating parser as if declared CDATA. * @@ -7307,7 +7307,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, /* * Skip any leading spaces */ - while ((in < end) && (*in != limit) && + while ((in < end) && (*in != limit) && ((*in == 0x20) || (*in == 0x9) || (*in == 0xA) || (*in == 0xD))) { in++; @@ -7342,7 +7342,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, * skip the trailing blanks */ while ((last[-1] == 0x20) && (last > start)) last--; - while ((in < end) && (*in != limit) && + while ((in < end) && (*in != limit) && ((*in == 0x20) || (*in == 0x9) || (*in == 0xA) || (*in == 0xD))) { in++; @@ -7494,7 +7494,7 @@ xmlParseAttribute2(xmlParserCtxtPtr ctxt, /** * xmlParseStartTag2: * @ctxt: an XML parser context - * + * * parse a start of tag either for rule element or * EmptyElement. In both case we don't parse the tag closing chars. * This routine is called when running SAX2 parsing @@ -7503,13 +7503,13 @@ xmlParseAttribute2(xmlParserCtxtPtr ctxt, * * [ WFC: Unique Att Spec ] * No attribute name may appear more than once in the same start-tag or - * empty-element tag. + * empty-element tag. * * [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' * * [ WFC: Unique Att Spec ] * No attribute name may appear more than once in the same start-tag or - * empty-element tag. + * empty-element tag. * * With namespace: * @@ -7576,7 +7576,7 @@ reparse: GROW; if (ctxt->input->base != base) goto base_changed; - while ((RAW != '>') && + while ((RAW != '>') && ((RAW != '/') || (NXT(1) != '>')) && (IS_BYTE_CHAR(RAW))) { const xmlChar *q = CUR_PTR; @@ -7695,7 +7695,7 @@ reparse: xmlFree(attvalue); } -failed: +failed: GROW if (ctxt->input->base != base) goto base_changed; @@ -7813,7 +7813,7 @@ failed: /* * [ WFC: Unique Att Spec ] * No attribute name may appear more than once in the same - * start-tag or empty-element tag. + * start-tag or empty-element tag. * As extended by the Namespace in XML REC. */ for (j = 0; j < i;j += 5) { @@ -7936,7 +7936,7 @@ xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix, /* * [ WFC: Element Type Match ] * The Name in an element's end-tag must match the element type in the - * start-tag. + * start-tag. * */ if (name != (xmlChar*)1) { @@ -7963,7 +7963,7 @@ done: /** * xmlParseCDSect: * @ctxt: an XML parser context - * + * * Parse escaped pure raw content. * * [18] CDSect ::= CDStart CData CDEnd @@ -8111,7 +8111,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) { /* * Fifth case : a reference. If if has not been resolved, - * parsing returns it's Name, create the node + * parsing returns it's Name, create the node */ else if (*cur == '&') { @@ -8152,7 +8152,7 @@ xmlParseContent(xmlParserCtxtPtr ctxt) { * * [ WFC: Element Type Match ] * The Name in an element's end-tag must match the element type in the - * start-tag. + * start-tag. * */ @@ -8198,7 +8198,7 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { /* * [ VC: Root Element Type ] * The Name in the document type declaration must match the element - * type of the root element. + * type of the root element. */ if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc && ctxt->node && (ctxt->node == ctxt->myDoc->children)) @@ -8357,11 +8357,11 @@ xmlParseVersionNum(xmlParserCtxtPtr ctxt) { /** * xmlParseVersionInfo: * @ctxt: an XML parser context - * + * * parse the XML version. * * [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ") - * + * * [25] Eq ::= S? '=' S? * * Returns the version string, e.g. "1.0" @@ -8426,7 +8426,7 @@ xmlParseEncName(xmlParserCtxtPtr ctxt) { xmlErrMemory(ctxt, NULL); return(NULL); } - + buf[len++] = cur; NEXT; cur = CUR; @@ -8466,7 +8466,7 @@ xmlParseEncName(xmlParserCtxtPtr ctxt) { /** * xmlParseEncodingDecl: * @ctxt: an XML parser context - * + * * parse the XML encoding declaration * * [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'") @@ -8555,7 +8555,7 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { * parse the XML standalone declaration * * [32] SDDecl ::= S 'standalone' Eq - * (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"')) + * (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"')) * * [ VC: Standalone Document Declaration ] * TODO The standalone document declaration must have the value "no" @@ -8630,7 +8630,7 @@ xmlParseSDDecl(xmlParserCtxtPtr ctxt) { /** * xmlParseXMLDecl: * @ctxt: an XML parser context - * + * * parse an XML declaration header * * [23] XMLDecl ::= '' @@ -8719,7 +8719,7 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) { /** * xmlParseMisc: * @ctxt: an XML parser context - * + * * parse an XML Misc* optional field. * * [27] Misc ::= Comment | PI | S @@ -8742,7 +8742,7 @@ xmlParseMisc(xmlParserCtxtPtr ctxt) { /** * xmlParseDocument: * @ctxt: an XML parser context - * + * * parse an XML document (and build a tree if using the standard SAX * interface). * @@ -8779,7 +8779,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) && ((ctxt->input->end - ctxt->input->cur) >= 4)) { - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines. @@ -8907,7 +8907,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { /** * xmlParseExtParsedEnt: * @ctxt: an XML parser context - * + * * parse a general parsed entity * An external general parsed entity is well-formed if it matches the * production labeled extParsedEnt. @@ -8938,7 +8938,7 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) { if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines. @@ -8991,7 +8991,7 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) { ctxt->depth = 0; xmlParseContent(ctxt); - + if ((RAW == '<') && (NXT(1) == '/')) { xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL); } else if (RAW != 0) { @@ -9072,7 +9072,7 @@ xmlParseLookupSequence(xmlParserCtxtPtr ctxt, xmlChar first, xmlGenericError(xmlGenericErrorContext, "PP: lookup '%c%c' found at %d\n", first, next, base); - else + else xmlGenericError(xmlGenericErrorContext, "PP: lookup '%c%c%c' found at %d\n", first, next, third, base); @@ -9088,7 +9088,7 @@ xmlParseLookupSequence(xmlParserCtxtPtr ctxt, xmlChar first, else if (third == 0) xmlGenericError(xmlGenericErrorContext, "PP: lookup '%c%c' failed\n", first, next); - else + else xmlGenericError(xmlGenericErrorContext, "PP: lookup '%c%c%c' failed\n", first, next, third); #endif @@ -9170,7 +9170,7 @@ xmlCheckCdataPush(const xmlChar *utf, int len) { if ((utf == NULL) || (len <= 0)) return(0); - + for (ix = 0; ix < len;) { /* string is 0-terminated */ c = utf[ix]; if ((c & 0x80) == 0x00) { /* 1-byte code, starts with 10 */ @@ -9302,7 +9302,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1)) return(0); - + /* * Pop-up of finished entities. */ @@ -9354,7 +9354,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { if (avail < 4) goto done; - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines, @@ -9505,7 +9505,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { /* * [ VC: Root Element Type ] * The Name in the document type declaration must match - * the element type of the root element. + * the element type of the root element. */ if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc && ctxt->node && (ctxt->node == ctxt->myDoc->children)) @@ -9682,7 +9682,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { break; case XML_PARSER_CDATA_SECTION: { /* - * The Push mode need to have the SAX callback for + * The Push mode need to have the SAX callback for * cdataBlock merge back contiguous callbacks. */ int base; @@ -9692,7 +9692,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { if (avail >= XML_PARSER_BIG_BUFFER_SIZE + 2) { int tmp; - tmp = xmlCheckCdataPush(ctxt->input->cur, + tmp = xmlCheckCdataPush(ctxt->input->cur, XML_PARSER_BIG_BUFFER_SIZE); if (tmp < 0) { tmp = -tmp; @@ -9831,7 +9831,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { avail = ctxt->input->length - (ctxt->input->cur - ctxt->input->base); else avail = ctxt->input->buf->buffer->use - (ctxt->input->cur - ctxt->input->base); - if (avail < 2) + if (avail < 2) goto done; cur = ctxt->input->cur[0]; next = ctxt->input->cur[1]; @@ -9940,7 +9940,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { if (quote != 0) { if (buf[base] == quote) quote = 0; - continue; + continue; } if ((quote == 0) && (buf[base] == '<')) { int found = 0; @@ -10010,7 +10010,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { fprintf(stderr, "end of stream\n"); #endif break; - + } not_end_of_int_subset: continue; /* for */ @@ -10115,7 +10115,7 @@ found_end_int_subset: break; } } -done: +done: #ifdef DEBUG_PUSH xmlGenericError(xmlGenericErrorContext, "PP: done %d\n", ret); #endif @@ -10159,7 +10159,7 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size, int base = ctxt->input->base - ctxt->input->buf->buffer->content; int cur = ctxt->input->cur - ctxt->input->base; int res; - + res =xmlParserInputBufferPush(ctxt->input->buf, size, chunk); if (res < 0) { ctxt->errNo = XML_PARSER_EOF; @@ -10180,7 +10180,7 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size, if ((in->encoder != NULL) && (in->buffer != NULL) && (in->raw != NULL)) { int nbchars; - + nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw); if (nbchars < 0) { /* TODO 2.6.0 */ @@ -10208,11 +10208,11 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size, avail = ctxt->input->buf->buffer->use - (ctxt->input->cur - ctxt->input->base); } - + if ((ctxt->instate != XML_PARSER_EOF) && (ctxt->instate != XML_PARSER_EPILOG)) { xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL); - } + } if ((ctxt->instate == XML_PARSER_EPILOG) && (avail > 0)) { xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL); } @@ -10222,7 +10222,7 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size, } ctxt->instate = XML_PARSER_EOF; } - return((xmlParserErrors) ctxt->errNo); + return((xmlParserErrors) ctxt->errNo); } /************************************************************************ @@ -10251,7 +10251,7 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size, */ xmlParserCtxtPtr -xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, +xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename) { xmlParserCtxtPtr ctxt; xmlParserInputPtr inputStream; @@ -10300,7 +10300,7 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1)); if (user_data != NULL) ctxt->userData = user_data; - } + } if (filename == NULL) { ctxt->directory = NULL; } else { @@ -10328,7 +10328,7 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, inputStream->buf = buf; inputStream->base = inputStream->buf->buffer->content; inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = + inputStream->end = &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; inputPush(ctxt, inputStream); @@ -10344,7 +10344,7 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, int base = ctxt->input->base - ctxt->input->buf->buffer->content; int cur = ctxt->input->cur - ctxt->input->base; - xmlParserInputBufferPush(ctxt->input->buf, size, chunk); + xmlParserInputBufferPush(ctxt->input->buf, size, chunk); ctxt->input->base = ctxt->input->buf->buffer->content + base; ctxt->input->cur = ctxt->input->base + cur; @@ -10369,7 +10369,7 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, * * Blocks further parser processing */ -void +void xmlStopParser(xmlParserCtxtPtr ctxt) { if (ctxt == NULL) return; @@ -10402,7 +10402,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, xmlParserCtxtPtr ctxt; xmlParserInputPtr inputStream; xmlParserInputBufferPtr buf; - + if (ioread == NULL) return(NULL); buf = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, enc); @@ -10431,7 +10431,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1)); if (user_data != NULL) ctxt->userData = user_data; - } + } inputStream = xmlNewIOInputStream(ctxt, buf, enc); if (inputStream == NULL) { @@ -10457,7 +10457,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, * @enc: the charset encoding if known * * Load and parse a DTD - * + * * Returns the resulting xmlDtdPtr or NULL in case of error. * @input will be freed at parsing end. */ @@ -10481,7 +10481,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, /* * Set-up the SAX context */ - if (sax != NULL) { + if (sax != NULL) { if (ctxt->sax != NULL) xmlFree(ctxt->sax); ctxt->sax = sax; @@ -10525,7 +10525,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, if ((enc == XML_CHAR_ENCODING_NONE) && ((ctxt->input->end - ctxt->input->cur) >= 4)) { - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines. @@ -10564,7 +10564,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, } if (sax != NULL) ctxt->sax = NULL; xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -10575,7 +10575,7 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, * @SystemID: a NAME* containing the URL to the DTD * * Load and parse an external subset. - * + * * Returns the resulting xmlDtdPtr or NULL in case of error. */ @@ -10598,13 +10598,13 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID, /* * Set-up the SAX context */ - if (sax != NULL) { + if (sax != NULL) { if (ctxt->sax != NULL) xmlFree(ctxt->sax); ctxt->sax = sax; ctxt->userData = ctxt; } - + /* * Canonicalise the system ID */ @@ -10678,7 +10678,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID, } if (sax != NULL) ctxt->sax = NULL; xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -10689,7 +10689,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID, * @SystemID: a NAME* containing the URL to the DTD * * Load and parse an external subset. - * + * * Returns the resulting xmlDtdPtr or NULL in case of error. */ @@ -10788,7 +10788,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, newDoc->children->doc = ctx->myDoc; } - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines. @@ -10843,7 +10843,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, ctxt->linenumbers = ctx->linenumbers; xmlParseContent(ctxt); - + ctx->validate = ctxt->validate; ctx->valid = ctxt->valid; if ((RAW == '<') && (NXT(1) == '/')) { @@ -10886,7 +10886,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, newDoc->intSubset = NULL; newDoc->extSubset = NULL; xmlFreeDoc(newDoc); - + return(ret); } @@ -11005,7 +11005,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt, newRoot->doc = doc; } - /* + /* * Get the 4 first bytes and decode the charset * if enc != XML_CHAR_ENCODING_NONE * plug some encoding conversion routines. @@ -11033,7 +11033,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt, ctxt->depth = depth; xmlParseContent(ctxt); - + if ((RAW == '<') && (NXT(1) == '/')) { xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL); } else if (RAW != 0) { @@ -11066,7 +11066,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt, } ret = XML_ERR_OK; } - if (sax != NULL) + if (sax != NULL) ctxt->sax = oldsax; oldctxt->node_seq.maximum = ctxt->node_seq.maximum; oldctxt->node_seq.length = ctxt->node_seq.length; @@ -11078,7 +11078,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt, newDoc->intSubset = NULL; newDoc->extSubset = NULL; xmlFreeDoc(newDoc); - + return(ret); } @@ -11155,9 +11155,9 @@ xmlParseBalancedChunkMemory(xmlDocPtr doc, xmlSAXHandlerPtr sax, * * Returns XML_ERR_OK if the chunk is well balanced, and the parser * error code otherwise - * + * * In case recover is set to 1, the nodelist will not be empty even if - * the parsed chunk is not well balanced. + * the parsed chunk is not well balanced. */ static xmlParserErrors xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt, @@ -11200,7 +11200,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt, xmlDetectSAX2(ctxt); ctxt->replaceEntities = oldctxt->replaceEntities; ctxt->options = oldctxt->options; - + ctxt->_private = oldctxt->_private; if (oldctxt->myDoc == NULL) { newDoc = xmlNewDoc(BAD_CAST "1.0"); @@ -11265,7 +11265,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt, } else { ret = XML_ERR_OK; } - + if ((lst != NULL) && (ret == XML_ERR_OK)) { xmlNodePtr cur; @@ -11293,7 +11293,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt, ctxt->myDoc->children = content; ctxt->myDoc->last = last; } - + ctxt->sax = oldsax; ctxt->dict = NULL; ctxt->attsDefault = NULL; @@ -11302,7 +11302,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt, if (newDoc != NULL) { xmlFreeDoc(newDoc); } - + return(ret); } @@ -11391,7 +11391,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, } xmlAddChild(node, fake); - /* + /* * Use input doc's dict if present, else assure XML_PARSE_NODICT is set. * We need a dictionary for xmlDetectSAX2, so if there's no doc dict * we must wait until the last moment to free the original one. @@ -11435,7 +11435,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, cur = cur->parent; } ctxt->instate = XML_PARSER_CONTENT; - } + } if ((ctxt->validate) || (ctxt->replaceEntities != 0)) { /* @@ -11464,12 +11464,12 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, } else { ret = XML_ERR_OK; } - + /* * Return the newly created nodeset after unlinking it from * the pseudo sibling. */ - + cur = fake->next; fake->next = NULL; node->last = fake; @@ -11497,7 +11497,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, if (doc->dict != NULL) ctxt->dict = NULL; xmlFreeParserCtxt(ctxt); - + return(ret); #else /* !SAX2 */ return(XML_ERR_INTERNAL_ERROR); @@ -11525,13 +11525,13 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, * * Returns 0 if the chunk is well balanced, -1 in case of args problem and * the parser error code otherwise - * + * * In case recover is set to 1, the nodelist will not be empty even if - * the parsed chunk is not well balanced. + * the parsed chunk is not well balanced. */ int xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, - void *user_data, int depth, const xmlChar *string, xmlNodePtr *lst, + void *user_data, int depth, const xmlChar *string, xmlNodePtr *lst, int recover) { xmlParserCtxtPtr ctxt; xmlDocPtr newDoc; @@ -11635,7 +11635,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, } else { ret = 0; } - + if ((lst != NULL) && ((ret == 0) || (recover == 1))) { xmlNodePtr cur; @@ -11652,14 +11652,14 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, } newDoc->children->children = NULL; } - - if (sax != NULL) + + if (sax != NULL) ctxt->sax = oldsax; xmlFreeParserCtxt(ctxt); newDoc->intSubset = NULL; newDoc->extSubset = NULL; xmlFreeDoc(newDoc); - + return(ret); } @@ -11707,7 +11707,7 @@ xmlSAXParseEntity(xmlSAXHandlerPtr sax, const char *filename) { if (sax != NULL) ctxt->sax = NULL; xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -11749,7 +11749,7 @@ xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, xmlParserInputPtr inputStream; char *directory = NULL; xmlChar *uri; - + ctxt = xmlNewParserCtxt(); if (ctxt == NULL) { return(NULL); @@ -11800,7 +11800,7 @@ xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, * @filename: the filename or URL * @options: a combination of xmlParserOption * - * Create a parser context for a file or URL content. + * Create a parser context for a file or URL content. * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time and for file accesses * @@ -11822,7 +11822,7 @@ xmlCreateURLParserCtxt(const char *filename, int options) if (options) xmlCtxtUseOptions(ctxt, options); ctxt->linenumbers = 1; - + inputStream = xmlLoadExternalEntity(filename, NULL, ctxt); if (inputStream == NULL) { xmlFreeParserCtxt(ctxt); @@ -11842,7 +11842,7 @@ xmlCreateURLParserCtxt(const char *filename, int options) * xmlCreateFileParserCtxt: * @filename: the filename * - * Create a parser context for a file content. + * Create a parser context for a file content. * Automatic support for ZLIB/Compress compressed document is provided * by default if found at compile-time. * @@ -11923,7 +11923,7 @@ xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename, if (sax != NULL) ctxt->sax = NULL; xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -11954,7 +11954,7 @@ xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename, * * parse an XML in-memory document and build a tree. * In the case the document is not Well Formed, a tree is built anyway - * + * * Returns the resulting document tree */ @@ -12021,7 +12021,7 @@ xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const xmlChar* buffer, xmlClearParserCtxt(ctxt); return; } - + xmlClearParserCtxt(ctxt); if (filename != NULL) input->filename = (char *) xmlCanonicPath((const xmlChar *)filename); @@ -12039,7 +12039,7 @@ xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const xmlChar* buffer, * * parse an XML file and call the given SAX handler routines. * Automatic support for ZLIB/Compress compressed document is provided - * + * * Returns 0 in case of success or a error number otherwise */ int @@ -12047,7 +12047,7 @@ xmlSAXUserParseFile(xmlSAXHandlerPtr sax, void *user_data, const char *filename) { int ret = 0; xmlParserCtxtPtr ctxt; - + ctxt = xmlCreateFileParserCtxt(filename); if (ctxt == NULL) return -1; #ifdef LIBXML_SAX1_ENABLED @@ -12059,9 +12059,9 @@ xmlSAXUserParseFile(xmlSAXHandlerPtr sax, void *user_data, if (user_data != NULL) ctxt->userData = user_data; - + xmlParseDocument(ctxt); - + if (ctxt->wellFormed) ret = 0; else { @@ -12077,7 +12077,7 @@ xmlSAXUserParseFile(xmlSAXHandlerPtr sax, void *user_data, ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); - + return ret; } #endif /* LIBXML_SAX1_ENABLED */ @@ -12184,10 +12184,10 @@ xmlSAXParseMemoryWithData(xmlSAXHandlerPtr sax, const char *buffer, xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL; } - if (sax != NULL) + if (sax != NULL) ctxt->sax = NULL; xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -12202,7 +12202,7 @@ xmlSAXParseMemoryWithData(xmlSAXHandlerPtr sax, const char *buffer, * parse an XML in-memory block and use the given SAX function block * to handle the parsing callback. If sax is NULL, fallback to the default * DOM tree building routines. - * + * * Returns the resulting document tree */ xmlDocPtr @@ -12217,7 +12217,7 @@ xmlSAXParseMemory(xmlSAXHandlerPtr sax, const char *buffer, * @size: the size of the array * * parse an XML in-memory block and build a tree. - * + * * Returns the resulting document tree */ @@ -12232,7 +12232,7 @@ xmlDocPtr xmlParseMemory(const char *buffer, int size) { * * parse an XML in-memory block and build a tree. * In the case the document is not Well Formed, a tree is built anyway - * + * * Returns the resulting document tree */ @@ -12249,7 +12249,7 @@ xmlDocPtr xmlRecoverMemory(const char *buffer, int size) { * * A better SAX parsing routine. * parse an XML in-memory buffer and call the given SAX handler routines. - * + * * Returns 0 in case of success or a error number otherwise */ int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data, @@ -12257,7 +12257,7 @@ int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data, int ret = 0; xmlParserCtxtPtr ctxt; xmlSAXHandlerPtr oldsax = NULL; - + if (sax == NULL) return -1; ctxt = xmlCreateMemoryParserCtxt(buffer, size); if (ctxt == NULL) return -1; @@ -12266,9 +12266,9 @@ int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data, xmlDetectSAX2(ctxt); if (user_data != NULL) ctxt->userData = user_data; - + xmlParseDocument(ctxt); - + if (ctxt->wellFormed) ret = 0; else { @@ -12283,7 +12283,7 @@ int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data, ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); - + return ret; } #endif /* LIBXML_SAX1_ENABLED */ @@ -12317,7 +12317,7 @@ xmlCreateDocParserCtxt(const xmlChar *cur) { * parse an XML in-memory document and build a tree. * It use the given SAX function block to handle the parsing callback. * If sax is NULL, fallback to the default DOM tree building routines. - * + * * Returns the resulting document tree */ @@ -12332,7 +12332,7 @@ xmlSAXParseDoc(xmlSAXHandlerPtr sax, const xmlChar *cur, int recovery) { ctxt = xmlCreateDocParserCtxt(cur); if (ctxt == NULL) return(NULL); - if (sax != NULL) { + if (sax != NULL) { oldsax = ctxt->sax; ctxt->sax = sax; ctxt->userData = NULL; @@ -12349,7 +12349,7 @@ xmlSAXParseDoc(xmlSAXHandlerPtr sax, const xmlChar *cur, int recovery) { if (sax != NULL) ctxt->sax = oldsax; xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -12358,7 +12358,7 @@ xmlSAXParseDoc(xmlSAXHandlerPtr sax, const xmlChar *cur, int recovery) { * @cur: a pointer to an array of xmlChar * * parse an XML in-memory document and build a tree. - * + * * Returns the resulting document tree */ @@ -12382,7 +12382,7 @@ static xmlEntityReferenceFunc xmlEntityRefFunc = NULL; * xmlAddEntityReference: * @ent : A valid entity * @firstNode : A valid first node for children of entity - * @lastNode : A valid last node of children entity + * @lastNode : A valid last node of children entity * * Notify of a reference to an entity of type XML_EXTERNAL_GENERAL_PARSED_ENTITY */ @@ -12522,7 +12522,7 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt) { xmlParserInputPtr input; xmlDictPtr dict; - + if (ctxt == NULL) return; @@ -12814,7 +12814,7 @@ xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options) * @reuse: keep the context for reuse * * Common front-end for the xmlRead functions - * + * * Returns the resulting document tree or NULL */ static xmlDocPtr @@ -12822,7 +12822,7 @@ xmlDoRead(xmlParserCtxtPtr ctxt, const char *URL, const char *encoding, int options, int reuse) { xmlDocPtr ret; - + xmlCtxtUseOptions(ctxt, options); if (encoding != NULL) { xmlCharEncodingHandlerPtr hdlr; @@ -12859,7 +12859,7 @@ xmlDoRead(xmlParserCtxtPtr ctxt, const char *URL, const char *encoding, * @options: a combination of xmlParserOption * * parse an XML in-memory document and build a tree. - * + * * Returns the resulting document tree */ xmlDocPtr @@ -12883,7 +12883,7 @@ xmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int optio * @options: a combination of xmlParserOption * * parse an XML file from the filesystem or the network. - * + * * Returns the resulting document tree */ xmlDocPtr @@ -12906,7 +12906,7 @@ xmlReadFile(const char *filename, const char *encoding, int options) * @options: a combination of xmlParserOption * * parse an XML in-memory document and build a tree. - * + * * Returns the resulting document tree */ xmlDocPtr @@ -12930,7 +12930,7 @@ xmlReadMemory(const char *buffer, int size, const char *URL, const char *encodin * parse an XML from a file descriptor and build a tree. * NOTE that the file descriptor will not be closed when the * reader is closed or reset. - * + * * Returns the resulting document tree */ xmlDocPtr @@ -12972,7 +12972,7 @@ xmlReadFd(int fd, const char *URL, const char *encoding, int options) * @options: a combination of xmlParserOption * * parse an XML document from I/O functions and source and build a tree. - * + * * Returns the resulting document tree */ xmlDocPtr @@ -13015,7 +13015,7 @@ xmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, * * parse an XML in-memory document and build a tree. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ xmlDocPtr @@ -13048,7 +13048,7 @@ xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur, * * parse an XML file from the filesystem or the network. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ xmlDocPtr @@ -13083,7 +13083,7 @@ xmlCtxtReadFile(xmlParserCtxtPtr ctxt, const char *filename, * * parse an XML in-memory document and build a tree. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ xmlDocPtr @@ -13127,7 +13127,7 @@ xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size, * This reuses the existing @ctxt parser context * NOTE that the file descriptor will not be closed when the * reader is closed or reset. - * + * * Returns the resulting document tree */ xmlDocPtr @@ -13170,7 +13170,7 @@ xmlCtxtReadFd(xmlParserCtxtPtr ctxt, int fd, * * parse an XML document from I/O functions and source and build a tree. * This reuses the existing @ctxt parser context - * + * * Returns the resulting document tree */ xmlDocPtr diff --git a/reactos/lib/3rdparty/libxml2/parserInternals.c b/reactos/lib/3rdparty/libxml2/parserInternals.c index b5e302e1182..898c810332c 100644 --- a/reactos/lib/3rdparty/libxml2/parserInternals.c +++ b/reactos/lib/3rdparty/libxml2/parserInternals.c @@ -73,15 +73,15 @@ xmlCheckVersion(int version) { xmlInitParser(); if ((myversion / 10000) != (version / 10000)) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Fatal: program compiled against libxml %d using libxml %d\n", (version / 10000), (myversion / 10000)); - fprintf(stderr, + fprintf(stderr, "Fatal: program compiled against libxml %d using libxml %d\n", (version / 10000), (myversion / 10000)); } if ((myversion / 100) < (version / 100)) { - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "Warning: program compiled against libxml %d using older %d\n", (version / 100), (myversion / 100)); } @@ -260,7 +260,7 @@ void check_buffer(xmlParserInputPtr in) { } #else -#define CHECK_BUFFER(in) +#define CHECK_BUFFER(in) #endif @@ -351,7 +351,7 @@ xmlParserInputGrow(xmlParserInputPtr in, int len) { } if (in->buf->readcallback != NULL) ret = xmlParserInputBufferGrow(in->buf, len); - else + else return(0); /* @@ -484,7 +484,7 @@ xmlNextChar(xmlParserCtxtPtr ctxt) * UCS-4 range (hex.) UTF-8 octet sequence (binary) * 0000 0000-0000 007F 0xxxxxxx * 0000 0080-0000 07FF 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx * * Check for the 0x110000 limit too */ @@ -628,7 +628,7 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) { * UCS-4 range (hex.) UTF-8 octet sequence (binary) * 0000 0000-0000 007F 0xxxxxxx * 0000 0080-0000 07FF 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx * * Check for the 0x110000 limit too */ @@ -678,7 +678,7 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) { if (!IS_CHAR(val)) { xmlErrEncodingInt(ctxt, XML_ERR_INVALID_CHAR, "Char 0x%X out of allowed range\n", val); - } + } return(val); } else { /* 1-byte code */ @@ -735,7 +735,7 @@ encoding_error: "Input is not proper UTF-8, indicate encoding !\n%s", BAD_CAST buffer, NULL); } - ctxt->charset = XML_CHAR_ENCODING_8859_1; + ctxt->charset = XML_CHAR_ENCODING_8859_1; *len = 1; return((int) *ctxt->input->cur); } @@ -764,7 +764,7 @@ xmlStringCurrentChar(xmlParserCtxtPtr ctxt, const xmlChar * cur, int *len) * UCS-4 range (hex.) UTF-8 octet sequence (binary) * 0000 0000-0000 007F 0xxxxxxx * 0000 0080-0000 07FF 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx * * Check for the 0x110000 limit too */ @@ -857,7 +857,7 @@ encoding_error: * @out: pointer to an array of xmlChar * @val: the char value * - * append the char value in the array + * append the char value in the array * * Returns the number of xmlChar written */ @@ -871,7 +871,7 @@ xmlCopyCharMultiByte(xmlChar *out, int val) { * UCS-4 range (hex.) UTF-8 octet sequence (binary) * 0000 0000-0000 007F 0xxxxxxx * 0000 0080-0000 07FF 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx */ if (val >= 0x80) { xmlChar *savedout = out; @@ -899,7 +899,7 @@ xmlCopyCharMultiByte(xmlChar *out, int val) { * @out: pointer to an array of xmlChar * @val: the char value * - * append the char value in the array + * append the char value in the array * * Returns the number of xmlChar written */ @@ -1139,7 +1139,7 @@ xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, unsigned int use; /* - * Specific handling of the Byte Order Mark for + * Specific handling of the Byte Order Mark for * UTF-16 */ if ((handler->name != NULL) && @@ -1265,7 +1265,7 @@ xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, * Returns 0 in case of success, -1 otherwise */ int -xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler) +xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler) { int ret = 0; @@ -1281,7 +1281,7 @@ xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler) * The parsing is now done in UTF8 natively */ ctxt->charset = XML_CHAR_ENCODING_UTF8; - } else + } else return(-1); return(ret); } @@ -1308,7 +1308,7 @@ xmlFreeInputStream(xmlParserInputPtr input) { if (input->version != NULL) xmlFree((char *) input->version); if ((input->free != NULL) && (input->base != NULL)) input->free((xmlChar *) input->base); - if (input->buf != NULL) + if (input->buf != NULL) xmlFreeParserInputBuffer(input->buf); xmlFree(input); } @@ -1507,7 +1507,7 @@ xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) { inputStream = xmlCheckHTTPInput(ctxt, inputStream); if (inputStream == NULL) return(NULL); - + if (inputStream->filename == NULL) URI = xmlStrdup((xmlChar *) filename); else @@ -1740,7 +1740,7 @@ xmlFreeParserCtxt(xmlParserCtxtPtr ctxt) if (ctxt->nsTab != NULL) xmlFree((char *) ctxt->nsTab); if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab); if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs); - if (ctxt->attsDefault != NULL) + if (ctxt->attsDefault != NULL) xmlHashFree(ctxt->attsDefault, (xmlHashDeallocator) xmlFree); if (ctxt->attsSpecial != NULL) xmlHashFree(ctxt->attsSpecial, NULL); @@ -1840,7 +1840,7 @@ xmlClearParserCtxt(xmlParserCtxtPtr ctxt) * @node: an XML node within the tree * * Find the parser node info struct for a given node - * + * * Returns an xmlParserNodeInfo block pointer or NULL */ const xmlParserNodeInfo * @@ -1898,7 +1898,7 @@ xmlClearNodeInfoSeq(xmlParserNodeInfoSeqPtr seq) * @seq: a node info sequence pointer * @node: an XML node pointer * - * + * * xmlParserFindNodeInfoIndex : Find the index that the info record for * the given node is or should be at in a sorted sequence * @@ -2006,7 +2006,7 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, ************************************************************************/ /** * xmlPedanticParserDefault: - * @val: int 0 or 1 + * @val: int 0 or 1 * * Set and return the previous value for enabling pedantic warnings. * @@ -2023,7 +2023,7 @@ xmlPedanticParserDefault(int val) { /** * xmlLineNumbersDefault: - * @val: int 0 or 1 + * @val: int 0 or 1 * * Set and return the previous value for enabling line numbers in elements * contents. This may break on old application and is turned off by default. @@ -2041,7 +2041,7 @@ xmlLineNumbersDefault(int val) { /** * xmlSubstituteEntitiesDefault: - * @val: int 0 or 1 + * @val: int 0 or 1 * * Set and return the previous value for default entity support. * Initially the parser always keep entity references instead of substituting @@ -2063,7 +2063,7 @@ xmlSubstituteEntitiesDefault(int val) { /** * xmlKeepBlanksDefault: - * @val: int 0 or 1 + * @val: int 0 or 1 * * Set and return the previous value for default blanks text nodes support. * The 1.x version of the parser used an heuristic to try to detect @@ -2074,7 +2074,7 @@ xmlSubstituteEntitiesDefault(int val) { * ignorableWhitespace() are only generated when running the parser in * validating mode and when the current element doesn't allow CDATA or * mixed content. - * This function is provided as a way to force the standard behavior + * This function is provided as a way to force the standard behavior * on 1.X libs and to switch back to the old mode for compatibility when * running 1.X client code on 2.X . Upgrade of 1.X code should be done * by using xmlIsBlankNode() commodity function to detect the "empty" diff --git a/reactos/lib/3rdparty/libxml2/pattern.c b/reactos/lib/3rdparty/libxml2/pattern.c index 125e37c5345..a5fc841b9d9 100644 --- a/reactos/lib/3rdparty/libxml2/pattern.c +++ b/reactos/lib/3rdparty/libxml2/pattern.c @@ -3,7 +3,7 @@ * * Reference: * http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/ - * to some extent + * to some extent * http://www.w3.org/TR/1999/REC-xml-19991116 * * See Copyright for the status of this software. @@ -154,7 +154,7 @@ struct _xmlPatParserContext { int error; /* error code */ xmlDictPtr dict; /* the dictionary if any */ xmlPatternPtr comp; /* the result */ - xmlNodePtr elem; /* the current node if any */ + xmlNodePtr elem; /* the current node if any */ const xmlChar **namespaces; /* the namespaces definitions */ int nb_namespaces; /* the number of namespaces */ }; @@ -775,7 +775,7 @@ xmlPatScanLiteral(xmlPatParserContextPtr ctxt) { * xmlPatScanName: * @ctxt: the XPath Parser context * - * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | + * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | * CombiningChar | Extender * * [5] Name ::= (Letter | '_' | ':') (NameChar)* @@ -800,7 +800,7 @@ xmlPatScanName(xmlPatParserContextPtr ctxt) { while ((IS_LETTER(val)) || (IS_DIGIT(val)) || (val == '.') || (val == '-') || - (val == '_') || + (val == '_') || (IS_COMBINING(val)) || (IS_EXTENDER(val))) { cur += len; @@ -883,7 +883,7 @@ xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) { xmlChar *token = NULL; xmlChar *name = NULL; xmlChar *URL = NULL; - + name = xmlPatScanNCName(ctxt); if (name == NULL) { if (CUR == '*') { @@ -899,7 +899,7 @@ xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) { if (CUR == ':') { int i; xmlChar *prefix = name; - + NEXT; /* * This is a namespace match @@ -915,10 +915,10 @@ xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) { ERROR5(NULL, NULL, NULL, "xmlCompileAttributeTest : no namespace bound to prefix %s\n", prefix); - ctxt->error = 1; + ctxt->error = 1; goto error; } - + xmlFree(prefix); if (token == NULL) { if (CUR == '*') { @@ -929,7 +929,7 @@ xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) { "xmlCompileAttributeTest : Name expected\n"); ctxt->error = 1; goto error; - } + } } else { PUSH(XML_OP_ATTR, token, URL); } @@ -953,7 +953,7 @@ error: * form suitable for fast matching. * * [3] Step ::= '.' | NameTest - * [4] NameTest ::= QName | '*' | NCName ':' '*' + * [4] NameTest ::= QName | '*' | NCName ':' '*' */ static void @@ -977,7 +977,7 @@ xmlCompileStepPattern(xmlPatParserContextPtr ctxt) { } else if (CUR == '@') { NEXT; xmlCompileAttributeTest(ctxt); - if (ctxt->error != 0) + if (ctxt->error != 0) goto error; return; } else { @@ -1045,7 +1045,7 @@ xmlCompileStepPattern(xmlPatParserContextPtr ctxt) { if (CUR == ':') { xmlChar *prefix = name; int i; - + NEXT; /* * This is a namespace match @@ -1127,7 +1127,7 @@ error: * Compile the Path Pattern and generates a precompiled * form suitable for fast matching. * - * [5] Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) + * [5] Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) */ static void xmlCompilePathPattern(xmlPatParserContextPtr ctxt) { @@ -1137,7 +1137,7 @@ xmlCompilePathPattern(xmlPatParserContextPtr ctxt) { } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) { ctxt->comp->flags |= PAT_FROM_CUR; } - + if ((CUR == '/') && (NXT(1) == '/')) { PUSH(XML_OP_ANCESTOR, NULL, NULL); NEXT; @@ -1338,7 +1338,7 @@ xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name, /** * xmlStreamCompile: * @comp: the precompiled pattern - * + * * Tries to stream compile a pattern * * Returns -1 in case of failure and 0 in case of success. @@ -1398,7 +1398,7 @@ xmlStreamCompile(xmlPatternPtr comp) { flags = 0; if (s < 0) goto error; - break; + break; case XML_OP_ATTR: flags |= XML_STREAM_STEP_ATTR; s = xmlStreamCompAddStep(stream, comp->steps[i].value, @@ -1421,7 +1421,7 @@ xmlStreamCompile(xmlPatternPtr comp) { flags = 0; if (s < 0) goto error; - break; + break; case XML_OP_ALL: s = xmlStreamCompAddStep(stream, NULL, NULL, flags); flags = 0; @@ -1446,7 +1446,7 @@ xmlStreamCompile(xmlPatternPtr comp) { stream->flags |= XML_STREAM_DESC; break; } - } + } if ((! root) && (comp->flags & XML_PATTERN_NOTPATTERN) == 0) { /* * If this should behave like a real pattern, we will mark @@ -1458,7 +1458,7 @@ xmlStreamCompile(xmlPatternPtr comp) { if (stream->nbStep > 0) { if ((stream->steps[0].flags & XML_STREAM_STEP_DESC) == 0) - stream->steps[0].flags |= XML_STREAM_STEP_DESC; + stream->steps[0].flags |= XML_STREAM_STEP_DESC; } } stream->steps[s].flags |= XML_STREAM_STEP_FINAL; @@ -1622,7 +1622,7 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, if ((nodeType == XML_ELEMENT_NODE) && (((stream->flags & XML_PATTERN_NOTPATTERN) == 0) || (stream->level == 0))) { - ret = 1; + ret = 1; } stream->level++; goto stream_next; @@ -1661,7 +1661,7 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, * If there are "//", then we need to process every "//" * occuring in the states, plus any other state for this * level. - */ + */ step = stream->states[2 * i]; /* TODO: should not happen anymore: dead states */ @@ -1679,10 +1679,10 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, if ((tmp < stream->level) && (!desc)) goto next_state; } - /* + /* * Check for correct node-type. */ - if ((nodeType == XML_ATTRIBUTE_NODE) && + if ((nodeType == XML_ATTRIBUTE_NODE) && ((comp->steps[step].flags & XML_STREAM_STEP_ATTR) == 0)) goto next_state; /* @@ -1710,7 +1710,7 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, (xmlStrEqual(comp->steps[step].ns, ns))); } } - if (match) { + if (match) { final = comp->steps[step].flags & XML_STREAM_STEP_FINAL; if (desc) { if (final) { @@ -1756,7 +1756,7 @@ next_state: * Re/enter the expression if it is a "descendant" one, * or if we are at the 1st level of evaluation. */ - + if (stream->level == 1) { if (XML_STREAM_XS_IDC(stream)) { /* @@ -1766,7 +1766,7 @@ next_state: goto stream_next; } else goto compare; - } + } /* * A "//" is always reentrant. */ @@ -1776,19 +1776,19 @@ next_state: /* * XS-IDC: Process the 2nd level, since the missing * "self::node()" is responsible for the 2nd level being - * the real start level. - */ + * the real start level. + */ if ((stream->level == 2) && XML_STREAM_XS_IDC(stream)) goto compare; goto stream_next; } - + compare: /* * Check expected node-type. */ - if ((nodeType == XML_ATTRIBUTE_NODE) && + if ((nodeType == XML_ATTRIBUTE_NODE) && ((comp->steps[0].flags & XML_STREAM_STEP_ATTR) == 0)) goto stream_next; /* @@ -1827,11 +1827,11 @@ compare: */ stream->blockLevel = stream->level; } - + stream_next: stream = stream->next; } /* while stream != NULL */ - + if (err > 0) ret = -1; #ifdef DEBUG_STREAMING @@ -1907,10 +1907,10 @@ xmlStreamPop(xmlStreamCtxtPtr stream) { stream->level--; if (stream->level < 0) - ret = -1; + ret = -1; /* * Check evolution of existing states - */ + */ for (i = stream->nbState -1; i >= 0; i--) { /* discard obsoleted states */ lev = stream->states[(2 * i) + 1]; diff --git a/reactos/lib/3rdparty/libxml2/regressions.rbuild b/reactos/lib/3rdparty/libxml2/regressions.rbuild index 39b054d5bed..73f593b934c 100644 --- a/reactos/lib/3rdparty/libxml2/regressions.rbuild +++ b/reactos/lib/3rdparty/libxml2/regressions.rbuild @@ -4,14 +4,14 @@ Element Name Description testname Plain text name of test execpath pathname for test program(s) - testprog program to run for the test + testprog program to run for the test flag flags for program (may have several) file filename of input file (several, or glob ok) exclfile filename to be excuded (several, or glob ok) srcdir global source directory for input file(s) srcsub subdirectory for input resdir directory for results file(s) - ressub subdirectory for results + ressub subdirectory for results resext extension for expected result reserrext extension for error result ('None' => no chk) extarg additional argument for command diff --git a/reactos/lib/3rdparty/libxml2/relaxng.c b/reactos/lib/3rdparty/libxml2/relaxng.c index b1d4a771faa..20dd200e0ff 100644 --- a/reactos/lib/3rdparty/libxml2/relaxng.c +++ b/reactos/lib/3rdparty/libxml2/relaxng.c @@ -7645,7 +7645,7 @@ xmlRelaxNGDumpDefine(FILE * output, xmlRelaxNGDefinePtr define) * xmlRelaxNGDumpGrammar: * @output: the file output * @grammar: a grammar structure - * @top: is this a top grammar + * @top: is this a top grammar * * Dump a RelaxNG structure back */ diff --git a/reactos/lib/3rdparty/libxml2/runsuite.c b/reactos/lib/3rdparty/libxml2/runsuite.c index b7e52c67ef3..bee79546138 100644 --- a/reactos/lib/3rdparty/libxml2/runsuite.c +++ b/reactos/lib/3rdparty/libxml2/runsuite.c @@ -1,5 +1,5 @@ /* - * runsuite.c: C program to run libxml2 againts published testsuites + * runsuite.c: C program to run libxml2 againts published testsuites * * See Copyright for the status of this software. * @@ -126,7 +126,7 @@ static int addEntity(char *name, char *content) { * which is shared to the current running test. We also don't want to have * network downloads modifying tests. */ -static xmlParserInputPtr +static xmlParserInputPtr testExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { xmlParserInputPtr ret; @@ -155,7 +155,7 @@ testExternalEntityLoader(const char *URL, const char *ID, fprintf(stderr, "Failed to find resource %s\n", URL); } #endif - + return(ret); } @@ -289,7 +289,7 @@ getString(xmlNodePtr cur, const char *xpath) { * * ************************************************************************/ -static int +static int xsdIncorectTestCase(xmlNodePtr cur) { xmlNodePtr test; xmlBufferPtr buf; @@ -301,7 +301,7 @@ xsdIncorectTestCase(xmlNodePtr cur) { if (cur == NULL) { return(0); } - + test = getNext(cur, "./*"); if (test == NULL) { test_log("Failed to find test in correct line %ld\n", @@ -409,7 +409,7 @@ installDirs(xmlNodePtr tst, const xmlChar *base) { xmlFree(res); } -static int +static int xsdTestCase(xmlNodePtr tst) { xmlNodePtr test, tmp, cur; xmlBufferPtr buf; @@ -436,7 +436,7 @@ xsdTestCase(xmlNodePtr tst) { if (cur == NULL) { return(xsdIncorectTestCase(tst)); } - + test = getNext(cur, "./*"); if (test == NULL) { fprintf(stderr, "Failed to find test in correct line %ld\n", @@ -482,7 +482,7 @@ xsdTestCase(xmlNodePtr tst) { if (test == NULL) { fprintf(stderr, "Failed to find test in line %ld\n", xmlGetLineNo(tmp)); - + } else { xmlBufferEmpty(buf); if (dtd != NULL) @@ -541,7 +541,7 @@ xsdTestCase(xmlNodePtr tst) { if (test == NULL) { fprintf(stderr, "Failed to find test in line %ld\n", xmlGetLineNo(tmp)); - + } else { xmlBufferEmpty(buf); xmlNodeDump(buf, test->doc, test, 0, 0); @@ -602,7 +602,7 @@ done: return(ret); } -static int +static int xsdTestSuite(xmlNodePtr cur) { if (verbose) { xmlChar *doc = getString(cur, "string(documentation)"); @@ -617,11 +617,11 @@ xsdTestSuite(xmlNodePtr cur) { xsdTestCase(cur); cur = getNext(cur, "following-sibling::testCase[1]"); } - + return(0); } -static int +static int xsdTest(void) { xmlDocPtr doc; xmlNodePtr cur; @@ -659,7 +659,7 @@ done: return(ret); } -static int +static int rngTestSuite(xmlNodePtr cur) { if (verbose) { xmlChar *doc = getString(cur, "string(documentation)"); @@ -680,11 +680,11 @@ rngTestSuite(xmlNodePtr cur) { xsdTestSuite(cur); cur = getNext(cur, "following-sibling::testSuite[1]"); } - + return(0); } -static int +static int rngTest1(void) { xmlDocPtr doc; xmlNodePtr cur; @@ -722,7 +722,7 @@ done: return(ret); } -static int +static int rngTest2(void) { xmlDocPtr doc; xmlNodePtr cur; diff --git a/reactos/lib/3rdparty/libxml2/runtest.c b/reactos/lib/3rdparty/libxml2/runtest.c index 1923dc1ca07..d6ad581bf76 100644 --- a/reactos/lib/3rdparty/libxml2/runtest.c +++ b/reactos/lib/3rdparty/libxml2/runtest.c @@ -124,7 +124,7 @@ static int glob(const char *pattern, int flags, int len; if ((pattern == NULL) || (pglob == NULL)) return(-1); - + strncpy(directory, pattern, 499); for (len = strlen(directory);len >= 0;len--) { if (directory[len] == '/') { @@ -136,12 +136,12 @@ static int glob(const char *pattern, int flags, if (len <= 0) len = 0; - + ret = pglob; memset(ret, 0, sizeof(glob_t)); - + hFind = FindFirstFileA(pattern, &FindFileData); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE) return(0); nb_paths = 20; ret->gl_pathv = (char **) malloc(nb_paths * sizeof(char *)); @@ -176,14 +176,14 @@ done: FindClose(hFind); return(0); } - + static void globfree(glob_t *pglob) { unsigned int i; if (pglob == NULL) return; - + for (i = 0;i < pglob->gl_pathc;i++) { if (pglob->gl_pathv[i] != NULL) free(pglob->gl_pathv[i]); @@ -218,7 +218,7 @@ fatalError(void) { * which is shared to the current running test. We also don't want to have * network downloads modifying tests. */ -static xmlParserInputPtr +static xmlParserInputPtr testExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { xmlParserInputPtr ret; @@ -230,7 +230,7 @@ testExternalEntityLoader(const char *URL, const char *ID, ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); extraMemoryFromResolver += xmlMemUsed() - memused; } - + return(ret); } @@ -288,12 +288,12 @@ channel(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { /** * xmlParserPrintFileContext: * @input: an xmlParserInputPtr input - * + * * Displays current context within the input content for error tracking */ static void -xmlParserPrintFileContextInternal(xmlParserInputPtr input , +xmlParserPrintFileContextInternal(xmlParserInputPtr input , xmlGenericErrorFunc chanl, void *data ) { const xmlChar *cur, *base; unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ @@ -309,7 +309,7 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input , } n = 0; /* search backwards for beginning-of-line (to max buff size) */ - while ((n++ < (sizeof(content)-1)) && (cur > base) && + while ((n++ < (sizeof(content)-1)) && (cur > base) && (*(cur) != '\n') && (*(cur) != '\r')) cur--; if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; @@ -319,7 +319,7 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input , n = 0; ctnt = content; /* copy selected text to our buffer */ - while ((*cur != 0) && (*(cur) != '\n') && + while ((*cur != 0) && (*(cur) != '\n') && (*(cur) != '\r') && (n < sizeof(content)-1)) { *ctnt++ = *cur++; n++; @@ -569,7 +569,7 @@ static char *resultFilename(const char *filename, const char *out, (filename[4] == '/')) filename = &filename[5]; *************/ - + base = baseFilename(filename); if (suffix == NULL) suffix = ".tmp"; @@ -639,7 +639,7 @@ static int compareFileMem(const char *filename, const char *mem, int size) { int idx = 0; struct stat info; - if (stat(filename, &info) < 0) + if (stat(filename, &info) < 0) return(-1); if (info.st_size != size) return(-1); @@ -650,7 +650,7 @@ static int compareFileMem(const char *filename, const char *mem, int size) { res = read(fd, bytes, 4096); if (res <= 0) break; - if (res + idx > size) + if (res + idx > size) break; if (memcmp(bytes, &mem[idx], res) != 0) { int ix; @@ -672,7 +672,7 @@ static int loadMem(const char *filename, const char **mem, int *size) { struct stat info; char *base; int siz = 0; - if (stat(filename, &info) < 0) + if (stat(filename, &info) < 0) return(-1); base = malloc(info.st_size + 1); if (base == NULL) @@ -882,7 +882,7 @@ resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xm return(NULL); /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - + fprintf(SAXdebug, "SAX.resolveEntity("); if (publicId != NULL) fprintf(SAXdebug, "%s", (char *)publicId); @@ -942,8 +942,8 @@ getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) /** * entityDeclDebug: * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -972,8 +972,8 @@ const xmlChar *nullstr = BAD_CAST "(null)"; /** * attributeDeclDebug: * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type + * @name: the attribute name + * @type: the attribute type * * An attribute definition has been parsed */ @@ -997,8 +997,8 @@ attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem, /** * elementDeclDebug: * @ctxt: An XML parser context - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value (without processing). * * An element definition has been parsed @@ -1184,7 +1184,7 @@ charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) * @ctxt: An XML parser context * @name: The entity name * - * called when an entity reference is detected. + * called when an entity reference is detected. */ static void referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) @@ -1420,7 +1420,7 @@ startElementNsDebug(void *ctx ATTRIBUTE_UNUSED, else fprintf(SAXdebug, ", '%s'", (char *) URI); fprintf(SAXdebug, ", %d", nb_namespaces); - + if (namespaces != NULL) { for (i = 0;i < nb_namespaces * 2;i++) { fprintf(SAXdebug, ", xmlns"); @@ -1696,7 +1696,7 @@ saxParseTest(const char *filename, const char *result, } else unlink(temp); free(temp); - + /* switch back to structured error handling */ xmlSetGenericErrorFunc(NULL, NULL); xmlSetStructuredErrorFunc(NULL, testStructuredErrorHandler); @@ -1803,7 +1803,7 @@ pushParseTest(const char *filename, const char *result, fprintf(stderr, "Failed to load %s\n", filename); return(-1); } - + #ifdef LIBXML_HTML_ENABLED if (options & XML_PARSE_HTML) ctxt = htmlCreatePushParserCtxt(NULL, NULL, base + cur, 4, filename, @@ -1900,7 +1900,7 @@ memParseTest(const char *filename, const char *result, fprintf(stderr, "Failed to load %s\n", filename); return(-1); } - + doc = xmlReadMemory(base, size, filename, NULL, 0); unloadMem(base); if (doc == NULL) { @@ -2065,8 +2065,8 @@ static void processNode(FILE *out, xmlTextReaderPtr reader) { value = xmlTextReaderConstValue(reader); - - fprintf(out, "%d %d %s %d %d", + + fprintf(out, "%d %d %s %d %d", xmlTextReaderDepth(reader), type, name, @@ -2254,7 +2254,7 @@ static void testXPath(const char *str, int xptr, int expr) { xmlXPathObjectPtr res; xmlXPathContextPtr ctxt; - + nb_tests++; #if defined(LIBXML_XPTR_ENABLED) if (xptr) { @@ -2325,10 +2325,10 @@ xpathCommonTest(const char *filename, const char *result, while (fgets(expression, 4500, input) != NULL) { len = strlen(expression); len--; - while ((len >= 0) && + while ((len >= 0) && ((expression[len] == '\n') || (expression[len] == '\t') || (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; + expression[len + 1] = 0; if (len >= 0) { fprintf(xpathOutput, "\n========================\nExpression: %s\n", @@ -3036,7 +3036,7 @@ rngTest(const char *filename, * @result: the file with expected result * @err: the file with error messages * - * Parse a set of files with streaming, applying an RNG schemas + * Parse a set of files with streaming, applying an RNG schemas * * Returns 0 in case of success, an error code otherwise */ @@ -3076,7 +3076,7 @@ rngStreamTest(const char *filename, * hack is also done in the Makefile */ if ((!strcmp(prefix, "tutor10_1")) || (!strcmp(prefix, "tutor10_2")) || - (!strcmp(prefix, "tutor3_2"))) + (!strcmp(prefix, "tutor3_2"))) disable_err = 1; snprintf(pattern, 499, "./test/relaxng/%s_?.xml", prefix); @@ -3140,7 +3140,7 @@ static void patternNode(FILE *out, xmlTextReaderPtr reader, type = xmlTextReaderNodeType(reader); empty = xmlTextReaderIsEmptyElement(reader); - + if (type == XML_READER_TYPE_ELEMENT) { /* do the check only on element start */ match = xmlPatternMatch(patternc, xmlTextReaderCurrentNode(reader)); @@ -3172,9 +3172,9 @@ static void patternNode(FILE *out, xmlTextReaderPtr reader, " pattern %s node %s\n", pattern, path); } - - } + + } if ((type == XML_READER_TYPE_END_ELEMENT) || ((type == XML_READER_TYPE_ELEMENT) && (empty))) { ret = xmlStreamPop(patstream); @@ -3195,7 +3195,7 @@ static void patternNode(FILE *out, xmlTextReaderPtr reader, * @result: the file with expected result * @err: the file with error messages * - * Parse a set of files with streaming, applying an RNG schemas + * Parse a set of files with streaming, applying an RNG schemas * * Returns 0 in case of success, an error code otherwise */ @@ -3344,13 +3344,13 @@ patternTest(const char *filename, ************************************************************************/ static xmlXPathObjectPtr load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { - xmlXPathObjectPtr xpath; + xmlXPathObjectPtr xpath; xmlDocPtr doc; xmlChar *expr; - xmlXPathContextPtr ctx; + xmlXPathContextPtr ctx; xmlNodePtr node; xmlNsPtr ns; - + /* * load XPath expr as a file */ @@ -3362,10 +3362,10 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { fprintf(stderr, "Error: unable to parse file \"%s\"\n", filename); return(NULL); } - + /* * Check the document is of the right kind - */ + */ if(xmlDocGetRootElement(doc) == NULL) { fprintf(stderr,"Error: empty document for file \"%s\"\n", filename); xmlFreeDoc(doc); @@ -3376,8 +3376,8 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { while(node != NULL && !xmlStrEqual(node->name, (const xmlChar *)"XPath")) { node = node->next; } - - if(node == NULL) { + + if(node == NULL) { fprintf(stderr,"Error: XPath element expected in the file \"%s\"\n", filename); xmlFreeDoc(doc); return(NULL); @@ -3393,8 +3393,8 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { ctx = xmlXPathNewContext(parent_doc); if(ctx == NULL) { fprintf(stderr,"Error: unable to create new context\n"); - xmlFree(expr); - xmlFreeDoc(doc); + xmlFree(expr); + xmlFreeDoc(doc); return(NULL); } @@ -3405,31 +3405,31 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { while(ns != NULL) { if(xmlXPathRegisterNs(ctx, ns->prefix, ns->href) != 0) { fprintf(stderr,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", ns->prefix, ns->href); - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); + xmlFree(expr); + xmlXPathFreeContext(ctx); + xmlFreeDoc(doc); return(NULL); } ns = ns->next; } - /* + /* * Evaluate xpath */ xpath = xmlXPathEvalExpression(expr, ctx); if(xpath == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); + xmlFree(expr); + xmlXPathFreeContext(ctx); + xmlFreeDoc(doc); return(NULL); } /* print_xpath_nodes(xpath->nodesetval); */ - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); + xmlFree(expr); + xmlXPathFreeContext(ctx); + xmlFreeDoc(doc); return(xpath); } @@ -3473,7 +3473,7 @@ parse_list(xmlChar *str) { return(NULL); } out = buffer; - + while(*str != '\0') { if (out - buffer > buffer_size - 10) { int indx = out - buffer; @@ -3489,12 +3489,12 @@ parse_list(xmlChar *str) { return buffer; } -static int +static int c14nRunTest(const char* xml_filename, int with_comments, int exclusive, const char* xpath_filename, const char *ns_filename, const char* result_file) { xmlDocPtr doc; - xmlXPathObjectPtr xpath = NULL; + xmlXPathObjectPtr xpath = NULL; xmlChar *result = NULL; int ret; xmlChar **inclusive_namespaces = NULL; @@ -3514,24 +3514,24 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive, fprintf(stderr, "Error: unable to parse file \"%s\"\n", xml_filename); return(-1); } - + /* * Check the document is of the right kind - */ + */ if(xmlDocGetRootElement(doc) == NULL) { fprintf(stderr,"Error: empty document for file \"%s\"\n", xml_filename); xmlFreeDoc(doc); return(-1); } - /* - * load xpath file if specified + /* + * load xpath file if specified */ if(xpath_filename) { xpath = load_xpath_expr(doc, xpath_filename); if(xpath == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - xmlFreeDoc(doc); + xmlFreeDoc(doc); return(-1); } } @@ -3540,7 +3540,7 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive, if (loadMem(ns_filename, &nslist, &nssize)) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); if(xpath != NULL) xmlXPathFreeObject(xpath); - xmlFreeDoc(doc); + xmlFreeDoc(doc); return(-1); } inclusive_namespaces = parse_list((xmlChar *) nslist); @@ -3548,10 +3548,10 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive, /* * Canonical form - */ + */ /* fprintf(stderr,"File \"%s\" loaded: start canonization\n", xml_filename); */ - ret = xmlC14NDocDumpMemory(doc, - (xpath) ? xpath->nodesetval : NULL, + ret = xmlC14NDocDumpMemory(doc, + (xpath) ? xpath->nodesetval : NULL, exclusive, inclusive_namespaces, with_comments, &result); if (ret >= 0) { @@ -3565,15 +3565,15 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive, fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret); ret = -1; } - + /* * Cleanup - */ + */ if (result != NULL) xmlFree(result); if(xpath != NULL) xmlXPathFreeObject(xpath); if (inclusive_namespaces != NULL) xmlFree(inclusive_namespaces); if (nslist != NULL) free((char *) nslist); - xmlFreeDoc(doc); + xmlFreeDoc(doc); return(ret); } @@ -3736,7 +3736,7 @@ testThread(void) void *results[MAX_ARGC]; int ret; int res = 0; - + xmlInitParser(); for (repeat = 0; repeat < 500; repeat++) { @@ -3812,7 +3812,7 @@ testThread(void) DWORD useless; tid[i] = CreateThread(NULL, 0, - win32_thread_specific_data, + win32_thread_specific_data, (void *) testfiles[i], 0, &useless); if (tid[i] == NULL) { @@ -3910,7 +3910,7 @@ testThread(void) return (-1); } #endif -static int +static int threadsTest(const char *filename ATTRIBUTE_UNUSED, const char *resul ATTRIBUTE_UNUSED, const char *err ATTRIBUTE_UNUSED, diff --git a/reactos/lib/3rdparty/libxml2/testAutomata.c b/reactos/lib/3rdparty/libxml2/testAutomata.c index a168a4b0c74..3290c860cf7 100644 --- a/reactos/lib/3rdparty/libxml2/testAutomata.c +++ b/reactos/lib/3rdparty/libxml2/testAutomata.c @@ -68,10 +68,10 @@ testRegexpFile(const char *filename) { continue; len = strlen(expr); len--; - while ((len >= 0) && + while ((len >= 0) && ((expr[len] == '\n') || (expr[len] == '\t') || (expr[len] == '\r') || (expr[len] == ' '))) len--; - expr[len + 1] = 0; + expr[len + 1] = 0; if (len >= 0) { if ((am != NULL) && (expr[0] == 't') && (expr[1] == ' ')) { char *ptr = &expr[2]; diff --git a/reactos/lib/3rdparty/libxml2/testC14N.c b/reactos/lib/3rdparty/libxml2/testC14N.c index 6a36a6841ae..15b528e29af 100644 --- a/reactos/lib/3rdparty/libxml2/testC14N.c +++ b/reactos/lib/3rdparty/libxml2/testC14N.c @@ -3,7 +3,7 @@ * (http://www.w3.org/TR/2001/REC-xml-c14n-20010315) * * See Copyright for the status of this software. - * + * * Author: Aleksey Sanin */ #include "libxml.h" @@ -48,11 +48,11 @@ static xmlChar **parse_list(xmlChar *str); /* static void print_xpath_nodes(xmlNodeSetPtr nodes); */ -static int +static int test_c14n(const char* xml_filename, int with_comments, int exclusive, const char* xpath_filename, xmlChar **inclusive_namespaces) { xmlDocPtr doc; - xmlXPathObjectPtr xpath = NULL; + xmlXPathObjectPtr xpath = NULL; xmlChar *result = NULL; int ret; @@ -68,63 +68,63 @@ test_c14n(const char* xml_filename, int with_comments, int exclusive, fprintf(stderr, "Error: unable to parse file \"%s\"\n", xml_filename); return(-1); } - + /* * Check the document is of the right kind - */ + */ if(xmlDocGetRootElement(doc) == NULL) { fprintf(stderr,"Error: empty document for file \"%s\"\n", xml_filename); xmlFreeDoc(doc); return(-1); } - /* - * load xpath file if specified + /* + * load xpath file if specified */ if(xpath_filename) { xpath = load_xpath_expr(doc, xpath_filename); if(xpath == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - xmlFreeDoc(doc); + xmlFreeDoc(doc); return(-1); } } /* * Canonical form - */ + */ /* fprintf(stderr,"File \"%s\" loaded: start canonization\n", xml_filename); */ - ret = xmlC14NDocDumpMemory(doc, - (xpath) ? xpath->nodesetval : NULL, + ret = xmlC14NDocDumpMemory(doc, + (xpath) ? xpath->nodesetval : NULL, exclusive, inclusive_namespaces, with_comments, &result); if(ret >= 0) { if(result != NULL) { write(1, result, ret); - xmlFree(result); + xmlFree(result); } } else { fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret); if(result != NULL) xmlFree(result); - xmlFreeDoc(doc); + xmlFreeDoc(doc); return(-1); } - + /* * Cleanup - */ + */ if(xpath != NULL) xmlXPathFreeObject(xpath); - xmlFreeDoc(doc); + xmlFreeDoc(doc); return(ret); } int main(int argc, char **argv) { int ret = -1; - + /* * Init libxml - */ + */ xmlInitParser(); LIBXML_TEST_VERSION @@ -140,14 +140,14 @@ int main(int argc, char **argv) { ret = test_c14n(argv[2], 0, 0, (argc > 3) ? argv[3] : NULL, NULL); } else if(strcmp(argv[1], "--exc-with-comments") == 0) { xmlChar **list; - + /* load exclusive namespace from command line */ list = (argc > 4) ? parse_list((xmlChar *)argv[4]) : NULL; ret = test_c14n(argv[2], 1, 1, (argc > 3) ? argv[3] : NULL, list); if(list != NULL) xmlFree(list); } else if(strcmp(argv[1], "--exc-without-comments") == 0) { xmlChar **list; - + /* load exclusive namespace from command line */ list = (argc > 4) ? parse_list((xmlChar *)argv[4]) : NULL; ret = test_c14n(argv[2], 0, 1, (argc > 3) ? argv[3] : NULL, list); @@ -157,12 +157,12 @@ int main(int argc, char **argv) { usage(argv[0]); } - /* + /* * Shutdown libxml */ xmlCleanupParser(); xmlMemoryDump(); - + return((ret >= 0) ? 0 : 1); } @@ -206,7 +206,7 @@ parse_list(xmlChar *str) { return(NULL); } out = buffer; - + while(*str != '\0') { if (out - buffer > buffer_size - 10) { int indx = out - buffer; @@ -224,13 +224,13 @@ parse_list(xmlChar *str) { static xmlXPathObjectPtr load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { - xmlXPathObjectPtr xpath; + xmlXPathObjectPtr xpath; xmlDocPtr doc; xmlChar *expr; - xmlXPathContextPtr ctx; + xmlXPathContextPtr ctx; xmlNodePtr node; xmlNsPtr ns; - + /* * load XPath expr as a file */ @@ -242,10 +242,10 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { fprintf(stderr, "Error: unable to parse file \"%s\"\n", filename); return(NULL); } - + /* * Check the document is of the right kind - */ + */ if(xmlDocGetRootElement(doc) == NULL) { fprintf(stderr,"Error: empty document for file \"%s\"\n", filename); xmlFreeDoc(doc); @@ -256,8 +256,8 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { while(node != NULL && !xmlStrEqual(node->name, (const xmlChar *)"XPath")) { node = node->next; } - - if(node == NULL) { + + if(node == NULL) { fprintf(stderr,"Error: XPath element expected in the file \"%s\"\n", filename); xmlFreeDoc(doc); return(NULL); @@ -273,8 +273,8 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { ctx = xmlXPathNewContext(parent_doc); if(ctx == NULL) { fprintf(stderr,"Error: unable to create new context\n"); - xmlFree(expr); - xmlFreeDoc(doc); + xmlFree(expr); + xmlFreeDoc(doc); return(NULL); } @@ -285,31 +285,31 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { while(ns != NULL) { if(xmlXPathRegisterNs(ctx, ns->prefix, ns->href) != 0) { fprintf(stderr,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", ns->prefix, ns->href); - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); + xmlFree(expr); + xmlXPathFreeContext(ctx); + xmlFreeDoc(doc); return(NULL); } ns = ns->next; } - /* + /* * Evaluate xpath */ xpath = xmlXPathEvalExpression(expr, ctx); if(xpath == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); + xmlFree(expr); + xmlXPathFreeContext(ctx); + xmlFreeDoc(doc); return(NULL); } /* print_xpath_nodes(xpath->nodesetval); */ - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); + xmlFree(expr); + xmlXPathFreeContext(ctx); + xmlFreeDoc(doc); return(xpath); } @@ -318,28 +318,28 @@ static void print_xpath_nodes(xmlNodeSetPtr nodes) { xmlNodePtr cur; int i; - - if(nodes == NULL ){ + + if(nodes == NULL ){ fprintf(stderr, "Error: no nodes set defined\n"); return; } - + fprintf(stderr, "Nodes Set:\n-----\n"); for(i = 0; i < nodes->nodeNr; ++i) { if(nodes->nodeTab[i]->type == XML_NAMESPACE_DECL) { xmlNsPtr ns; - + ns = (xmlNsPtr)nodes->nodeTab[i]; cur = (xmlNodePtr)ns->next; - fprintf(stderr, "namespace \"%s\"=\"%s\" for node %s:%s\n", + fprintf(stderr, "namespace \"%s\"=\"%s\" for node %s:%s\n", ns->prefix, ns->href, (cur->ns) ? cur->ns->prefix : BAD_CAST "", cur->name); } else if(nodes->nodeTab[i]->type == XML_ELEMENT_NODE) { - cur = nodes->nodeTab[i]; - fprintf(stderr, "element node \"%s:%s\"\n", + cur = nodes->nodeTab[i]; + fprintf(stderr, "element node \"%s:%s\"\n", (cur->ns) ? cur->ns->prefix : BAD_CAST "", cur->name); } else { - cur = nodes->nodeTab[i]; + cur = nodes->nodeTab[i]; fprintf(stderr, "node \"%s\": type %d\n", cur->name, cur->type); } } diff --git a/reactos/lib/3rdparty/libxml2/testHTML.c b/reactos/lib/3rdparty/libxml2/testHTML.c index c5da07eee59..a3250521029 100644 --- a/reactos/lib/3rdparty/libxml2/testHTML.c +++ b/reactos/lib/3rdparty/libxml2/testHTML.c @@ -179,7 +179,7 @@ resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xm { /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - + fprintf(stdout, "SAX.resolveEntity("); if (publicId != NULL) fprintf(stdout, "%s", (char *)publicId); @@ -233,8 +233,8 @@ getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) /** * entityDeclDebug: * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -252,8 +252,8 @@ entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type, /** * attributeDeclDebug: * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type + * @name: the attribute name + * @type: the attribute type * * An attribute definition has been parsed */ @@ -269,8 +269,8 @@ attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem, const xmlCha /** * elementDeclDebug: * @ctxt: An XML parser context - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value (without processing). * * An element definition has been parsed @@ -453,7 +453,7 @@ cdataDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) * @ctxt: An XML parser context * @name: The entity name * - * called when an entity reference is detected. + * called when an entity reference is detected. */ static void referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) @@ -687,7 +687,7 @@ parseSAXFile(char *filename) { fclose(f); } } - } else { + } else { #endif /* LIBXML_PUSH_ENABLED */ doc = htmlSAXParseFile(filename, NULL, emptySAXHandler, NULL); if (doc != NULL) { @@ -746,7 +746,7 @@ parseAndPrintFile(char *filename) { } fclose(f); } - } else { + } else { doc = htmlReadFile(filename, NULL, options); } #else @@ -774,7 +774,7 @@ parseAndPrintFile(char *filename) { /* * print it. */ - if (!noout) { + if (!noout) { #ifdef LIBXML_DEBUG_ENABLED if (!debug) { if (encoding) @@ -789,7 +789,7 @@ parseAndPrintFile(char *filename) { else htmlDocDump(stdout, doc); #endif - } + } #endif /* LIBXML_OUTPUT_ENABLED */ /* @@ -838,13 +838,13 @@ int main(int argc, char **argv) { for (count = 0;count < 100 * repeat;count++) { if (sax) parseSAXFile(argv[i]); - else + else parseAndPrintFile(argv[i]); - } + } } else { if (sax) parseSAXFile(argv[i]); - else + else parseAndPrintFile(argv[i]); } files ++; diff --git a/reactos/lib/3rdparty/libxml2/testModule.c b/reactos/lib/3rdparty/libxml2/testModule.c index fecc8523737..9a21a2e241a 100644 --- a/reactos/lib/3rdparty/libxml2/testModule.c +++ b/reactos/lib/3rdparty/libxml2/testModule.c @@ -30,7 +30,7 @@ #endif typedef int (*hello_world_t)(void); - + int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { xmlChar filename[PATH_MAX]; xmlModulePtr module = NULL; @@ -53,7 +53,7 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { fprintf(stderr, "Lookup returned NULL\n"); return(1); } - + (*hello_world)(); xmlModuleClose(module); diff --git a/reactos/lib/3rdparty/libxml2/testRegexp.c b/reactos/lib/3rdparty/libxml2/testRegexp.c index 7f344148d90..f0c64735804 100644 --- a/reactos/lib/3rdparty/libxml2/testRegexp.c +++ b/reactos/lib/3rdparty/libxml2/testRegexp.c @@ -48,10 +48,10 @@ testRegexpFile(const char *filename) { while (fgets(expression, 4500, input) != NULL) { len = strlen(expression); len--; - while ((len >= 0) && + while ((len >= 0) && ((expression[len] == '\n') || (expression[len] == '\t') || (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; + expression[len + 1] = 0; if (len >= 0) { if (expression[0] == '#') continue; diff --git a/reactos/lib/3rdparty/libxml2/testRelax.c b/reactos/lib/3rdparty/libxml2/testRelax.c index e18b3c2f36a..c8d7924e0d2 100644 --- a/reactos/lib/3rdparty/libxml2/testRelax.c +++ b/reactos/lib/3rdparty/libxml2/testRelax.c @@ -89,7 +89,7 @@ int main(int argc, char **argv) { int fd; struct stat info; const char *base; - if (stat(argv[i], &info) < 0) + if (stat(argv[i], &info) < 0) break; if ((fd = open(argv[i], O_RDONLY)) < 0) break; diff --git a/reactos/lib/3rdparty/libxml2/testSAX.c b/reactos/lib/3rdparty/libxml2/testSAX.c index 36fb12d9848..8503a8accd3 100644 --- a/reactos/lib/3rdparty/libxml2/testSAX.c +++ b/reactos/lib/3rdparty/libxml2/testSAX.c @@ -71,7 +71,7 @@ static int timing = 0; * function calls */ -#ifndef HAVE_GETTIMEOFDAY +#ifndef HAVE_GETTIMEOFDAY #ifdef HAVE_SYS_TIMEB_H #ifdef HAVE_SYS_TIME_H #ifdef HAVE_FTIME @@ -368,7 +368,7 @@ resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xm return(NULL); /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - + fprintf(stdout, "SAX.resolveEntity("); if (publicId != NULL) fprintf(stdout, "%s", (char *)publicId); @@ -428,8 +428,8 @@ getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) /** * entityDeclDebug: * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -458,8 +458,8 @@ const xmlChar *nullstr = BAD_CAST "(null)"; /** * attributeDeclDebug: * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type + * @name: the attribute name + * @type: the attribute type * * An attribute definition has been parsed */ @@ -483,8 +483,8 @@ attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem, /** * elementDeclDebug: * @ctxt: An XML parser context - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value (without processing). * * An element definition has been parsed @@ -670,7 +670,7 @@ charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) * @ctxt: An XML parser context * @name: The entity name * - * called when an entity reference is detected. + * called when an entity reference is detected. */ static void referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) @@ -906,7 +906,7 @@ startElementNsDebug(void *ctx ATTRIBUTE_UNUSED, else fprintf(stdout, ", '%s'", (char *) URI); fprintf(stdout, ", %d", nb_namespaces); - + if (namespaces != NULL) { for (i = 0;i < nb_namespaces * 2;i++) { fprintf(stdout, ", xmlns"); @@ -1131,7 +1131,7 @@ int main(int argc, char **argv) { int files = 0; LIBXML_TEST_VERSION /* be safe, plus calls xmlInitParser */ - + for (i = 1; i < argc ; i++) { if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) debug++; diff --git a/reactos/lib/3rdparty/libxml2/testSchemas.c b/reactos/lib/3rdparty/libxml2/testSchemas.c index 47f8b39a6ff..4d3ffc2b7fe 100644 --- a/reactos/lib/3rdparty/libxml2/testSchemas.c +++ b/reactos/lib/3rdparty/libxml2/testSchemas.c @@ -85,7 +85,7 @@ int main(int argc, char **argv) { int fd; struct stat info; const char *base; - if (stat(argv[i], &info) < 0) + if (stat(argv[i], &info) < 0) break; if ((fd = open(argv[i], O_RDONLY)) < 0) break; diff --git a/reactos/lib/3rdparty/libxml2/testThreadsWin32.c b/reactos/lib/3rdparty/libxml2/testThreadsWin32.c index 24f000644ee..ab08a8327c0 100644 --- a/reactos/lib/3rdparty/libxml2/testThreadsWin32.c +++ b/reactos/lib/3rdparty/libxml2/testThreadsWin32.c @@ -104,7 +104,7 @@ main() for (i = 0; i < num_threads; i++) { DWORD useless; - tid[i] = CreateThread(NULL, 0, + tid[i] = CreateThread(NULL, 0, thread_specific_data, testfiles[i], 0, &useless); if (tid[i] == NULL) { @@ -113,7 +113,7 @@ main() } } - if (WaitForMultipleObjects (num_threads, tid, TRUE, INFINITE) == WAIT_FAILED) + if (WaitForMultipleObjects (num_threads, tid, TRUE, INFINITE) == WAIT_FAILED) perror ("WaitForMultipleObjects failed"); for (i = 0; i < num_threads; i++) @@ -129,7 +129,7 @@ main() xmlCatalogCleanup(); for (i = 0; i < num_threads; i++) { - if (results[i] != (DWORD) Okay) + if (results[i] != (DWORD) Okay) printf("Thread %d handling %s failed\n", i, testfiles[i]); } } diff --git a/reactos/lib/3rdparty/libxml2/testXPath.c b/reactos/lib/3rdparty/libxml2/testXPath.c index 8086a81027c..a2359886c75 100644 --- a/reactos/lib/3rdparty/libxml2/testXPath.c +++ b/reactos/lib/3rdparty/libxml2/testXPath.c @@ -51,7 +51,7 @@ static xmlDocPtr document = NULL; /* * Default document */ -static xmlChar buffer[] = +static xmlChar buffer[] = "\n\ \n\ \n\ @@ -79,7 +79,7 @@ static void testXPath(const char *str) { xmlXPathObjectPtr res; xmlXPathContextPtr ctxt; - + #if defined(LIBXML_XPTR_ENABLED) if (xptr) { ctxt = xmlXPtrNewContext(document, NULL, NULL); @@ -96,7 +96,7 @@ testXPath(const char *str) { comp = xmlXPathCompile(BAD_CAST str); if (comp != NULL) { - if (tree) + if (tree) xmlXPathDebugDumpCompExpr(stdout, comp, 0); res = xmlXPathCompiledEval(comp, ctxt); @@ -127,10 +127,10 @@ testXPathFile(const char *filename) { while (fgets(expression, 4500, input) != NULL) { len = strlen(expression); len--; - while ((len >= 0) && + while ((len >= 0) && ((expression[len] == '\n') || (expression[len] == '\t') || (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; + expression[len + 1] = 0; if (len >= 0) { printf("\n========================\nExpression: %s\n", expression) ; testXPath(expression); @@ -150,7 +150,7 @@ int main(int argc, char **argv) { #if defined(LIBXML_XPTR_ENABLED) if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr"))) xptr++; - else + else #endif if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) debug++; @@ -211,7 +211,7 @@ int main(int argc, char **argv) { printf("\t--file : or\n"); printf("\t-f : read queries from files, args\n"); } - if (document != NULL) + if (document != NULL) xmlFreeDoc(document); xmlCleanupParser(); xmlMemoryDump(); diff --git a/reactos/lib/3rdparty/libxml2/testapi.c b/reactos/lib/3rdparty/libxml2/testapi.c index 9e7969bbb70..dc76157d295 100644 --- a/reactos/lib/3rdparty/libxml2/testapi.c +++ b/reactos/lib/3rdparty/libxml2/testapi.c @@ -97,7 +97,7 @@ get_api_attr(void) { if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) { get_api_root(); } - if (api_root == NULL) + if (api_root == NULL) return(NULL); if (api_root->properties != NULL) { api_attr = api_root->properties; @@ -187,7 +187,7 @@ int main(int argc, char **argv) { #include #include -/* +/* We manually define xmlErrMemory because it's normal declaration is "hidden" by #ifdef IN_LIBXML */ @@ -528,7 +528,7 @@ static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) { #define gen_nb_xmlDtdPtr 3 static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) + if (no == 0) return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar")); if (no == 1) return(get_api_dtd()); return(NULL); @@ -689,7 +689,7 @@ static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATT } #define gen_nb_xmlHashDeallocator 2 -static void +static void test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) { } @@ -13343,7 +13343,7 @@ test_xmlParseBalancedChunkMemory(void) { depth = gen_int(n_depth, 3); string = gen_const_xmlChar_ptr(n_string, 4); lst = gen_xmlNodePtr_ptr(n_lst, 5); - + #ifdef LIBXML_SAX1_ENABLED if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; #endif @@ -13423,7 +13423,7 @@ test_xmlParseBalancedChunkMemoryRecover(void) { string = gen_const_xmlChar_ptr(n_string, 4); lst = gen_xmlNodePtr_ptr(n_lst, 5); recover = gen_int(n_recover, 6); - + #ifdef LIBXML_SAX1_ENABLED if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; #endif @@ -14902,7 +14902,7 @@ test_xmlSAXUserParseFile(void) { sax = gen_xmlSAXHandlerPtr(n_sax, 0); user_data = gen_userdata(n_user_data, 1); filename = gen_filepath(n_filename, 2); - + #ifdef LIBXML_SAX1_ENABLED if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; #endif @@ -14961,7 +14961,7 @@ test_xmlSAXUserParseMemory(void) { user_data = gen_userdata(n_user_data, 1); buffer = gen_const_char_ptr(n_buffer, 2); size = gen_int(n_size, 3); - + #ifdef LIBXML_SAX1_ENABLED if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; #endif diff --git a/reactos/lib/3rdparty/libxml2/threads.c b/reactos/lib/3rdparty/libxml2/threads.c index 8b42345828f..a0958e108d0 100644 --- a/reactos/lib/3rdparty/libxml2/threads.c +++ b/reactos/lib/3rdparty/libxml2/threads.c @@ -1,5 +1,5 @@ /** - * threads.c: set of generic threading related routines + * threads.c: set of generic threading related routines * * See Copyright for the status of this software. * @@ -388,7 +388,7 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED) #ifdef HAVE_PTHREAD_H if (libxml_is_threaded == 0) return; - + pthread_mutex_lock(&tok->lock); tok->held--; if (tok->held == 0) { @@ -398,7 +398,7 @@ xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED) } pthread_mutex_unlock(&tok->lock); #elif defined HAVE_WIN32_THREADS - if (!--tok->count) + if (!--tok->count) LeaveCriticalSection(&tok->cs); #elif defined HAVE_BEOS_THREADS if (tok->lock->tid == find_thread(NULL)) { @@ -451,7 +451,7 @@ static xmlGlobalStatePtr xmlNewGlobalState(void) { xmlGlobalState *gs; - + gs = malloc(sizeof(xmlGlobalState)); if (gs == NULL) return(NULL); @@ -561,12 +561,12 @@ xmlGetGlobalState(void) p = (xmlGlobalStateCleanupHelperParams *) malloc(sizeof(xmlGlobalStateCleanupHelperParams)); p->memory = tsd; #if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL) - DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), + DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &p->thread, 0, TRUE, DUPLICATE_SAME_ACCESS); TlsSetValue(globalkey, tsd); _beginthread(xmlGlobalStateCleanupHelper, 0, p); #else - EnterCriticalSection(&cleanup_helpers_cs); + EnterCriticalSection(&cleanup_helpers_cs); if (cleanup_helpers_head != NULL) { cleanup_helpers_head->prev = p; } @@ -574,7 +574,7 @@ xmlGetGlobalState(void) p->prev = NULL; cleanup_helpers_head = p; TlsSetValue(globalkey, p); - LeaveCriticalSection(&cleanup_helpers_cs); + LeaveCriticalSection(&cleanup_helpers_cs); #endif return (tsd); @@ -646,11 +646,11 @@ xmlIsMainThread(void) return(1); pthread_once(&once_control, xmlOnceInit); #elif defined HAVE_WIN32_THREADS - xmlOnceInit (); + xmlOnceInit (); #elif defined HAVE_BEOS_THREADS xmlOnceInit(); #endif - + #ifdef DEBUG_THREADS xmlGenericError(xmlGenericErrorContext, "xmlIsMainThread()\n"); #endif @@ -827,9 +827,9 @@ xmlOnceInit(void) { */ #if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) #if defined(LIBXML_STATIC_FOR_DLL) -BOOL WINAPI xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +BOOL WINAPI xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) #else -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) #endif { switch(fdwReason) { diff --git a/reactos/lib/3rdparty/libxml2/tree.c b/reactos/lib/3rdparty/libxml2/tree.c index 4d127462a74..def961a1ae7 100644 --- a/reactos/lib/3rdparty/libxml2/tree.c +++ b/reactos/lib/3rdparty/libxml2/tree.c @@ -129,7 +129,7 @@ static int xmlCheckDTD = 1; * * ************************************************************************/ #include - + #ifdef LIBXML_TREE_ENABLED /** * xmlGetEntityFromDtd: @@ -138,13 +138,13 @@ static int xmlCheckDTD = 1; * * Do an entity lookup in the DTD entity hash table and * return the corresponding entity, if found. - * + * * Returns A pointer to the entity structure or NULL if not found. */ static xmlEntityPtr xmlGetEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) { xmlEntitiesTablePtr table; - + if((dtd != NULL) && (dtd->entities != NULL)) { table = (xmlEntitiesTablePtr) dtd->entities; return((xmlEntityPtr) xmlHashLookup(table, name)); @@ -156,7 +156,7 @@ xmlGetEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) { * xmlGetParameterEntityFromDtd: * @dtd: A pointer to the DTD to search * @name: The entity name - * + * * Do an entity lookup in the DTD pararmeter entity hash table and * return the corresponding entity, if found. * @@ -165,7 +165,7 @@ xmlGetEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) { static xmlEntityPtr xmlGetParameterEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) { xmlEntitiesTablePtr table; - + if ((dtd != NULL) && (dtd->pentities != NULL)) { table = (xmlEntitiesTablePtr) dtd->pentities; return((xmlEntityPtr) xmlHashLookup(table, name)); @@ -226,7 +226,7 @@ xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, /** * xmlSplitQName2: * @name: the full QName - * @prefix: a xmlChar ** + * @prefix: a xmlChar ** * * parse an XML qualified name string * @@ -264,9 +264,9 @@ xmlSplitQName2(const xmlChar *name, xmlChar **prefix) { * we are not trying to validate but just to cut, and yes it will * work even if this is as set of UTF-8 encoded chars */ - while ((name[len] != 0) && (name[len] != ':')) + while ((name[len] != 0) && (name[len] != ':')) len++; - + if (name[len] == 0) return(NULL); @@ -314,9 +314,9 @@ xmlSplitQName3(const xmlChar *name, int *len) { * we are not trying to validate but just to cut, and yes it will * work even if this is as set of UTF-8 encoded chars */ - while ((name[l] != 0) && (name[l] != ':')) + while ((name[l] != 0) && (name[l] != ':')) l++; - + if (name[l] == 0) return(NULL); @@ -330,7 +330,7 @@ xmlSplitQName3(const xmlChar *name, int *len) { * Check Name, NCName and QName strings * * * ************************************************************************/ - + #define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) @@ -653,14 +653,14 @@ try_complex: * Allocation and deallocation of basic structures * * * ************************************************************************/ - + /** * xmlSetBufferAllocationScheme: * @scheme: allocation method to use - * + * * Set the buffer allocation method. Types are * XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down - * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, + * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, * improves performance */ void @@ -673,9 +673,9 @@ xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme) { * * Types are * XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down - * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, + * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, * improves performance - * + * * Returns the current allocation scheme */ xmlBufferAllocationScheme @@ -718,9 +718,9 @@ xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) { cur->type = XML_LOCAL_NAMESPACE; if (href != NULL) - cur->href = xmlStrdup(href); + cur->href = xmlStrdup(href); if (prefix != NULL) - cur->prefix = xmlStrdup(prefix); + cur->prefix = xmlStrdup(prefix); /* * Add it at the end to preserve parsing order ... @@ -736,14 +736,14 @@ xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) { (xmlStrEqual(prev->prefix, cur->prefix))) { xmlFreeNs(cur); return(NULL); - } + } while (prev->next != NULL) { prev = prev->next; if (((prev->prefix == NULL) && (cur->prefix == NULL)) || (xmlStrEqual(prev->prefix, cur->prefix))) { xmlFreeNs(cur); return(NULL); - } + } } prev->next = cur; } @@ -852,11 +852,11 @@ xmlNewDtd(xmlDocPtr doc, const xmlChar *name, cur->type = XML_DTD_NODE; if (name != NULL) - cur->name = xmlStrdup(name); + cur->name = xmlStrdup(name); if (ExternalID != NULL) - cur->ExternalID = xmlStrdup(ExternalID); + cur->ExternalID = xmlStrdup(ExternalID); if (SystemID != NULL) - cur->SystemID = xmlStrdup(SystemID); + cur->SystemID = xmlStrdup(SystemID); if (doc != NULL) doc->extSubset = cur; cur->doc = doc; @@ -934,7 +934,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, } } if (ExternalID != NULL) { - cur->ExternalID = xmlStrdup(ExternalID); + cur->ExternalID = xmlStrdup(ExternalID); if (cur->ExternalID == NULL) { xmlTreeErrMemory("building internal subset"); if (cur->name != NULL) @@ -944,7 +944,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name, } } if (SystemID != NULL) { - cur->SystemID = xmlStrdup(SystemID); + cur->SystemID = xmlStrdup(SystemID); if (cur->SystemID == NULL) { xmlTreeErrMemory("building internal subset"); if (cur->name != NULL) @@ -1054,7 +1054,7 @@ xmlFreeDtd(xmlDtdPtr cur) { /* TODO !!! */ if (cur->notations != NULL) xmlFreeNotationTable((xmlNotationTablePtr) cur->notations); - + if (cur->elements != NULL) xmlFreeElementTable((xmlElementTablePtr) cur->elements); if (cur->attributes != NULL) @@ -1093,7 +1093,7 @@ xmlNewDoc(const xmlChar *version) { memset(cur, 0, sizeof(xmlDoc)); cur->type = XML_DOCUMENT_NODE; - cur->version = xmlStrdup(version); + cur->version = xmlStrdup(version); if (cur->version == NULL) { xmlTreeErrMemory("building doc"); xmlFree(cur); @@ -1227,7 +1227,7 @@ xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar *value, int len) { else tmp = 0; while (tmp != ';') { /* Non input consuming loop */ - if ((tmp >= '0') && (tmp <= '9')) + if ((tmp >= '0') && (tmp <= '9')) charval = charval * 16 + (tmp - '0'); else if ((tmp >= 'a') && (tmp <= 'f')) charval = charval * 16 + (tmp - 'a') + 10; @@ -1255,7 +1255,7 @@ xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar *value, int len) { else tmp = 0; while (tmp != ';') { /* Non input consuming loops */ - if ((tmp >= '0') && (tmp <= '9')) + if ((tmp >= '0') && (tmp <= '9')) charval = charval * 10 + (tmp - '0'); else { xmlTreeErr(XML_TREE_INVALID_DEC, (xmlNodePtr) doc, @@ -1300,7 +1300,7 @@ xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar *value, int len) { last = xmlAddNextSibling(last, node); } else xmlNodeAddContent(last, ent->content); - + } else { /* * Create a new REFERENCE_REF node @@ -1421,7 +1421,7 @@ xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) { cur += 3; tmp = *cur; while (tmp != ';') { /* Non input consuming loop */ - if ((tmp >= '0') && (tmp <= '9')) + if ((tmp >= '0') && (tmp <= '9')) charval = charval * 16 + (tmp - '0'); else if ((tmp >= 'a') && (tmp <= 'f')) charval = charval * 16 + (tmp - 'a') + 10; @@ -1443,7 +1443,7 @@ xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) { cur += 2; tmp = *cur; while (tmp != ';') { /* Non input consuming loops */ - if ((tmp >= '0') && (tmp <= '9')) + if ((tmp >= '0') && (tmp <= '9')) charval = charval * 10 + (tmp - '0'); else { xmlTreeErr(XML_TREE_INVALID_DEC, (xmlNodePtr) doc, @@ -1485,7 +1485,7 @@ xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) { last = xmlAddNextSibling(last, node); } else xmlNodeAddContent(last, ent->content); - + } else { /* * Create a new REFERENCE_REF node @@ -1721,7 +1721,7 @@ xmlNodeListGetRawString(xmlDocPtr doc, xmlNodePtr list, int inLine) } #endif /* LIBXML_TREE_ENABLED */ -static xmlAttrPtr xmlNewPropInternal(xmlNodePtr node, xmlNsPtr ns, +static xmlAttrPtr xmlNewPropInternal(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value, int eatname) { xmlAttrPtr cur; xmlDocPtr doc = NULL; @@ -1745,7 +1745,7 @@ static xmlAttrPtr xmlNewPropInternal(xmlNodePtr node, xmlNsPtr ns, memset(cur, 0, sizeof(xmlAttr)); cur->type = XML_ATTRIBUTE_NODE; - cur->parent = node; + cur->parent = node; if (node != NULL) { doc = node->doc; cur->doc = doc; @@ -1775,7 +1775,7 @@ static xmlAttrPtr xmlNewPropInternal(xmlNodePtr node, xmlNsPtr ns, tmp = tmp->next; } xmlFree(buffer); - } + } /* * Add it at the end to preserve parsing order ... @@ -1909,7 +1909,7 @@ xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value) { cur->name = xmlDictLookup(doc->dict, name, -1); else cur->name = xmlStrdup(name); - cur->doc = doc; + cur->doc = doc; if (value != NULL) { xmlNodePtr tmp; @@ -2116,7 +2116,7 @@ xmlNewNode(xmlNsPtr ns, const xmlChar *name) { } memset(cur, 0, sizeof(xmlNode)); cur->type = XML_ELEMENT_NODE; - + cur->name = xmlStrdup(name); cur->ns = ns; @@ -2159,7 +2159,7 @@ xmlNewNodeEatName(xmlNsPtr ns, xmlChar *name) { } memset(cur, 0, sizeof(xmlNode)); cur->type = XML_ELEMENT_NODE; - + cur->name = name; cur->ns = ns; @@ -2342,9 +2342,9 @@ xmlNewText(const xmlChar *content) { * a child TEXT node will be created containing the string @content. * NOTE: Use xmlNewChild() if @content will contain entities that need to be * preserved. Use this function, xmlNewTextChild(), if you need to ensure that - * reserved XML chars that might appear in @content, such as the ampersand, - * greater-than or less-than signs, are automatically replaced by their XML - * escaped entity representations. + * reserved XML chars that might appear in @content, such as the ampersand, + * greater-than or less-than signs, are automatically replaced by their XML + * escaped entity representations. * * Returns a pointer to the new node object. */ @@ -2800,7 +2800,7 @@ xmlNewChild(xmlNodePtr parent, xmlNsPtr ns, * first unlinked from its existing context. * As a result of text merging @elem may be freed. * If the new node is ATTRIBUTE, it is added into properties instead of children. - * If there is an attribute with equal name, it is first destroyed. + * If there is an attribute with equal name, it is first destroyed. * * Returns the new node or NULL in case of error. */ @@ -2880,7 +2880,7 @@ xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) { * If the new node was already inserted in a document it is * first unlinked from its existing context. * If the new node is ATTRIBUTE, it is added into properties instead of children. - * If there is an attribute with equal name, it is first destroyed. + * If there is an attribute with equal name, it is first destroyed. * * Returns the new node or NULL in case of error. */ @@ -2994,7 +2994,7 @@ xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem) { * Constant time is we can rely on the ->parent->last to find * the last sibling. */ - if ((cur->parent != NULL) && + if ((cur->parent != NULL) && (cur->parent->children != NULL) && (cur->parent->last != NULL) && (cur->parent->last->next == NULL)) { @@ -3074,7 +3074,7 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { /* * If cur and parent->last both are TEXT nodes, then merge them. */ - if ((cur->type == XML_TEXT_NODE) && + if ((cur->type == XML_TEXT_NODE) && (parent->last->type == XML_TEXT_NODE) && (cur->name == parent->last->name)) { xmlNodeAddContent(parent->last, cur->content); @@ -3115,7 +3115,7 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) { * Add a new node to @parent, at the end of the child (or property) list * merging adjacent TEXT nodes (in which case @cur is freed) * If the new node is ATTRIBUTE, it is added into properties instead of children. - * If there is an attribute with equal name, it is first destroyed. + * If there is an attribute with equal name, it is first destroyed. * * Returns the child or NULL in case of error. */ @@ -3507,7 +3507,7 @@ xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) { * Copy operations * * * ************************************************************************/ - + /** * xmlCopyNamespace: * @cur: the namespace @@ -3630,7 +3630,7 @@ xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur) { ret->ns = xmlNewReconciliedNs(target->doc, target, cur->ns); } } - + } else ret->ns = NULL; @@ -3737,7 +3737,7 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent, return((xmlNodePtr) xmlCopyProp(parent, (xmlAttrPtr) node)); case XML_NAMESPACE_DECL: return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node)); - + case XML_DOCUMENT_NODE: case XML_HTML_DOCUMENT_NODE: #ifdef LIBXML_DOCB_ENABLED @@ -3767,7 +3767,7 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent, ret->type = node->type; ret->doc = doc; - ret->parent = parent; + ret->parent = parent; if (node->name == xmlStringText) ret->name = xmlStringText; else if (node->name == xmlStringTextNoenc) @@ -3806,7 +3806,7 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent, if (tmp != ret) return(tmp); } - + if (!extended) goto out; if (node->nsDef != NULL) @@ -4002,7 +4002,7 @@ xmlCopyDtd(xmlDtdPtr dtd) { if (dtd->pentities != NULL) ret->pentities = (void *) xmlCopyEntitiesTable( (xmlEntitiesTablePtr) dtd->pentities); - + cur = dtd->children; while (cur != NULL) { q = NULL; @@ -4017,7 +4017,7 @@ xmlCopyDtd(xmlDtdPtr dtd) { break; case XML_INTERNAL_PARAMETER_ENTITY: case XML_EXTERNAL_PARAMETER_ENTITY: - q = (xmlNodePtr) + q = (xmlNodePtr) xmlGetParameterEntityFromDtd(ret, tmp->name); break; case XML_INTERNAL_PREDEFINED_ENTITY: @@ -4029,22 +4029,22 @@ xmlCopyDtd(xmlDtdPtr dtd) { xmlGetDtdQElementDesc(ret, tmp->name, tmp->prefix); } else if (cur->type == XML_ATTRIBUTE_DECL) { xmlAttributePtr tmp = (xmlAttributePtr) cur; - q = (xmlNodePtr) + q = (xmlNodePtr) xmlGetDtdQAttrDesc(ret, tmp->elem, tmp->name, tmp->prefix); } else if (cur->type == XML_COMMENT_NODE) { q = xmlCopyNode(cur, 0); } - + if (q == NULL) { cur = cur->next; continue; } - + if (p == NULL) ret->children = q; else p->next = q; - + q->prev = p; q->parent = (xmlNodePtr) ret; q->next = NULL; @@ -4099,7 +4099,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) { ret->oldNs = xmlCopyNamespaceList(doc->oldNs); if (doc->children != NULL) { xmlNodePtr tmp; - + ret->children = xmlStaticCopyNodeList(doc->children, ret, (xmlNodePtr)ret); ret->last = NULL; @@ -4119,7 +4119,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) { * Content access functions * * * ************************************************************************/ - + /** * xmlGetLineNo: * @node: valid node @@ -4396,7 +4396,7 @@ xmlDocGetRootElement(xmlDocPtr doc) { } return(ret); } - + #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) /** * xmlDocSetRootElement: @@ -4437,7 +4437,7 @@ xmlDocSetRootElement(xmlDocPtr doc, xmlNodePtr root) { return(old); } #endif - + #if defined(LIBXML_TREE_ENABLED) /** * xmlNodeSetLang: @@ -4485,7 +4485,7 @@ xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) { xmlSetNsProp(cur, ns, BAD_CAST "lang", lang); } #endif /* LIBXML_TREE_ENABLED */ - + /** * xmlNodeGetLang: * @cur: the node being checked @@ -4508,7 +4508,7 @@ xmlNodeGetLang(xmlNodePtr cur) { } return(NULL); } - + #ifdef LIBXML_TREE_ENABLED /** @@ -4596,7 +4596,7 @@ xmlNodeGetSpacePreserve(xmlNodePtr cur) { } return(-1); } - + #ifdef LIBXML_TREE_ENABLED /** * xmlNodeSetName: @@ -4654,7 +4654,7 @@ xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) { } } #endif - + #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) /** * xmlNodeSetBase: @@ -4706,7 +4706,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) { return; } } - + ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE); if (ns == NULL) return; @@ -4736,9 +4736,9 @@ xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) { xmlChar *oldbase = NULL; xmlChar *base, *newbase; - if ((cur == NULL) && (doc == NULL)) + if ((cur == NULL) && (doc == NULL)) return(NULL); - if (doc == NULL) doc = cur->doc; + if (doc == NULL) doc = cur->doc; if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) { cur = doc->children; while ((cur != NULL) && (cur->name != NULL)) { @@ -4800,7 +4800,7 @@ xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) { } return(oldbase); } - + /** * xmlNodeBufGetContent: * @buffer: a buffer @@ -4811,7 +4811,7 @@ xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) { * of the values carried by this node child's (TEXT and ENTITY_REF). * Entity references are substituted. * Fills up the buffer @buffer with this value - * + * * Returns 0 in case of success and -1 in case of error. */ int @@ -5094,12 +5094,12 @@ xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content) { if (!((cur->doc != NULL) && (cur->doc->dict != NULL) && (xmlDictOwns(cur->doc->dict, cur->content)))) xmlFree(cur->content); - } + } if (cur->children != NULL) xmlFreeNodeList(cur->children); cur->last = cur->children = NULL; if (content != NULL) { cur->content = xmlStrdup(content); - } else + } else cur->content = NULL; break; case XML_DOCUMENT_NODE: @@ -5164,12 +5164,12 @@ xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) { case XML_NOTATION_NODE: if (cur->content != NULL) { xmlFree(cur->content); - } + } if (cur->children != NULL) xmlFreeNodeList(cur->children); cur->children = cur->last = NULL; if (content != NULL) { cur->content = xmlStrndup(content, len); - } else + } else cur->content = NULL; break; case XML_DOCUMENT_NODE: @@ -5201,7 +5201,7 @@ xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) { * @cur: the node being modified * @content: extra content * @len: the size of @content - * + * * Append the extra substring to the node content. */ void @@ -5271,7 +5271,7 @@ xmlNodeAddContentLen(xmlNodePtr cur, const xmlChar *content, int len) { * xmlNodeAddContent: * @cur: the node being modified * @content: extra content - * + * * Append the extra substring to the node content. */ void @@ -5294,7 +5294,7 @@ xmlNodeAddContent(xmlNodePtr cur, const xmlChar *content) { * xmlTextMerge: * @first: the first text node * @second: the second text node being merged - * + * * Merge two text nodes into one * Returns the first text node augmented */ @@ -5394,7 +5394,7 @@ xmlGetNsList(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node) */ xmlNsPtr xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) { - + xmlNsPtr cur; xmlNodePtr orig = node; @@ -5414,8 +5414,8 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) { } memset(cur, 0, sizeof(xmlNs)); cur->type = XML_LOCAL_NAMESPACE; - cur->href = xmlStrdup(XML_XML_NAMESPACE); - cur->prefix = xmlStrdup((const xmlChar *)"xml"); + cur->href = xmlStrdup(XML_XML_NAMESPACE); + cur->prefix = xmlStrdup((const xmlChar *)"xml"); cur->next = node->nsDef; node->nsDef = cur; return(cur); @@ -5432,8 +5432,8 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) { memset(doc->oldNs, 0, sizeof(xmlNs)); doc->oldNs->type = XML_LOCAL_NAMESPACE; - doc->oldNs->href = xmlStrdup(XML_XML_NAMESPACE); - doc->oldNs->prefix = xmlStrdup((const xmlChar *)"xml"); + doc->oldNs->href = xmlStrdup(XML_XML_NAMESPACE); + doc->oldNs->prefix = xmlStrdup((const xmlChar *)"xml"); } return(doc->oldNs); } @@ -5454,7 +5454,7 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) { return(cur); cur = cur->next; } - if (orig != node) { + if (orig != node) { cur = node->ns; if (cur != NULL) { if ((cur->prefix == NULL) && (nameSpace == NULL) && @@ -5465,7 +5465,7 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) { (xmlStrEqual(cur->prefix, nameSpace))) return(cur); } - } + } } node = node->parent; } @@ -5481,7 +5481,7 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) { * * Verify that the given namespace held on @ancestor is still in scope * on node. - * + * * Returns 1 if true, 0 if false and -1 in case of error. */ static int @@ -5514,7 +5514,7 @@ xmlNsInScope(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node, return (-1); return (1); } - + /** * xmlSearchNsByHref: * @doc: the document @@ -5601,7 +5601,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href) return (cur); } } - } + } } node = node->parent; } @@ -5857,7 +5857,7 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) { } } /* exit condition */ - if (node == tree) + if (node == tree) node = NULL; } else break; @@ -5879,7 +5879,7 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) { * This function also looks in DTD attribute declaration for #FIXED or * default declaration values unless DTD use has been turned off. * - * Returns the attribute or the attribute declaration or NULL if + * Returns the attribute or the attribute declaration or NULL if * neither was found. */ xmlAttrPtr @@ -6193,7 +6193,7 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) { attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name); if ((attrDecl == NULL) && (doc->extSubset != NULL)) attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name); - + if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) { /* * The DTD declaration only allows a prefix search @@ -6314,7 +6314,7 @@ xmlSetProp(xmlNodePtr node, const xmlChar *name, const xmlChar *value) { } xmlFree(buffer); } - if (oldprop != NULL) + if (oldprop != NULL) xmlFreeNodeList(oldprop); return(prop); } @@ -6340,7 +6340,7 @@ xmlAttrPtr xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, const xmlChar *value) { xmlAttrPtr prop; - + if ((node == NULL) || (name == NULL) || (node->type != XML_ELEMENT_NODE)) return(NULL); @@ -6358,7 +6358,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, */ if ((xmlStrEqual(prop->name, name)) && (prop->ns != NULL) && (xmlStrEqual(prop->ns->href, ns->href))) { - if (prop->children != NULL) + if (prop->children != NULL) xmlFreeNodeList(prop->children); prop->children = NULL; prop->last = NULL; @@ -6378,7 +6378,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, tmp = tmp->next; } xmlFree(buffer); - } + } return(prop); } prop = prop->next; @@ -6392,7 +6392,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, /** * xmlNodeIsText: * @node: the node - * + * * Is this node a Text node ? * Returns 1 yes, 0 no */ @@ -6407,7 +6407,7 @@ xmlNodeIsText(xmlNodePtr node) { /** * xmlIsBlankNode: * @node: the node - * + * * Checks whether this node is an empty or whitespace only * (and possibly ignorable) text-node. * @@ -6436,7 +6436,7 @@ xmlIsBlankNode(xmlNodePtr node) { * @node: the node * @content: the content * @len: @content length - * + * * Concat the given string at the end of the existing node content * * Returns -1 in case of error, 0 otherwise @@ -6570,7 +6570,7 @@ xmlBufferCreateStatic(void *mem, size_t size) { * Sets the allocation scheme for this buffer */ void -xmlBufferSetAllocationScheme(xmlBufferPtr buf, +xmlBufferSetAllocationScheme(xmlBufferPtr buf, xmlBufferAllocationScheme scheme) { if (buf == NULL) { #ifdef DEBUG_BUFFER @@ -6745,7 +6745,7 @@ xmlBufferContent(const xmlBufferPtr buf) /** * xmlBufferLength: - * @buf: the buffer + * @buf: the buffer * * Function to get the length of a buffer * @@ -6803,7 +6803,7 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size) if (buf->content == NULL) rebuf = (xmlChar *) xmlMallocAtomic(newSize * sizeof(xmlChar)); else if (buf->size - buf->use < 100) { - rebuf = (xmlChar *) xmlRealloc(buf->content, + rebuf = (xmlChar *) xmlRealloc(buf->content, newSize * sizeof(xmlChar)); } else { /* @@ -7132,7 +7132,7 @@ xmlSetCompressMode(int mode) { * * Allocates and initializes a new DOM-wrapper context. * -* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal errror. +* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal errror. */ xmlDOMWrapCtxtPtr xmlDOMWrapNewCtxt(void) @@ -7192,7 +7192,7 @@ struct xmlNsMapItem { * @oldNs: the old ns-struct * @newNs: the new ns-struct * @depth: depth and ns-kind information -* +* * Frees the ns-map */ static xmlNsMapItemPtr @@ -7203,7 +7203,7 @@ xmlDOMWrapNSNormAddNsMapItem(xmlNsMapItemPtr *map, int depth) { xmlNsMapItemPtr ret; - + if ((cur != NULL) && (*cur != NULL) && ((*cur)->next != NULL)) { /* * Reuse. @@ -7254,12 +7254,12 @@ xmlDOMWrapNSNormAddNsMapItem(xmlNsMapItemPtr *map, /* * xmlTreeFreeNsMap: * @map: the ns-map -* +* * Frees the ns-map */ static void xmlDOMWrapNSNormFreeNsMap(xmlNsMapItemPtr map) -{ +{ xmlNsMapItemPtr mi = map, miprev; while (mi != NULL) { @@ -7272,9 +7272,9 @@ xmlDOMWrapNSNormFreeNsMap(xmlNsMapItemPtr map) /* * xmlTreeEnsureXMLDecl: * @doc: the doc -* +* * Ensures that there is an XML namespace declaration on the doc. -* +* * Returns the XML ns-struct or NULL on API and internal errors. */ static xmlNsPtr @@ -7294,7 +7294,7 @@ xmlTreeEnsureXMLDecl(xmlDocPtr doc) } memset(ns, 0, sizeof(xmlNs)); ns->type = XML_LOCAL_NAMESPACE; - ns->href = xmlStrdup(XML_XML_NAMESPACE); + ns->href = xmlStrdup(XML_XML_NAMESPACE); ns->prefix = xmlStrdup((const xmlChar *)"xml"); doc->oldNs = ns; return (ns); @@ -7306,10 +7306,10 @@ xmlTreeEnsureXMLDecl(xmlDocPtr doc) * @doc: the doc * @nsName: the namespace name * @prefix: the prefix -* +* * Creates or reuses an xmlNs struct on doc->oldNs with * the given prefix and namespace name. -* +* * Returns the aquired ns struct or NULL in case of an API * or internal error. */ @@ -7348,9 +7348,9 @@ xmlDOMWrapStoreNs(xmlDocPtr doc, * xmlTreeLookupNsListByPrefix: * @nsList: a list of ns-structs * @prefix: the searched prefix -* +* * Searches for a ns-decl with the given prefix in @nsList. -* +* * Returns the ns-decl if found, NULL if not found and on * API errors. */ @@ -7378,9 +7378,9 @@ xmlTreeNSListLookupByPrefix(xmlNsPtr nsList, const xmlChar *prefix) * xmlTreeGetInScopeNamespaces: * @map: the namespace map * @node: the node to start with -* +* * Puts in-scope namespaces into the ns-map. -* +* * Returns 0 on success, -1 on API or internal errors. */ static int @@ -7472,7 +7472,7 @@ xmlDOMWrapNSNormGatherInScopeNs(xmlNsMapItemPtr *map, * * For internal use. Adds a ns-decl mapping. * -* Returns 0 on success, -1 on internal errors. +* Returns 0 on success, -1 on internal errors. */ static int xmlDOMWrapNSNormAddNsMapItem2(xmlNsPtr **list, int *size, int *number, @@ -7515,7 +7515,7 @@ xmlDOMWrapNSNormAddNsMapItem2(xmlNsPtr **list, int *size, int *number, * WARNING: This function is in a experimental state. * * Returns 0 on success, 1 if the node is not supported, -* -1 on API and internal errors. +* -1 on API and internal errors. */ int xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc, @@ -7532,7 +7532,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc, if (node->parent == NULL) return (0); - switch (node->type) { + switch (node->type) { case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_ENTITY_REF_NODE: @@ -7540,7 +7540,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc, case XML_COMMENT_NODE: xmlUnlinkNode(node); return (0); - case XML_ELEMENT_NODE: + case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: break; default: @@ -7564,7 +7564,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc, } /* No break on purpose. */ case XML_ATTRIBUTE_NODE: - if (node->ns != NULL) { + if (node->ns != NULL) { /* * Find a mapping. */ @@ -7608,14 +7608,14 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc, break; default: goto next_sibling; - } -next_node: + } +next_node: if ((node->type == XML_ELEMENT_NODE) && (node->children != NULL)) { node = node->children; continue; } -next_sibling: +next_sibling: if (node == NULL) break; if (node->next != NULL) @@ -7707,7 +7707,7 @@ xmlSearchNsByHrefStrict(xmlDocPtr doc, xmlNodePtr node, const xmlChar* nsName, */ if (out) { int ret; - + ret = xmlNsInScope(doc, node, prev, ns->prefix); if (ret < 0) return (-1); @@ -7840,7 +7840,7 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc, int ancestorsOnly, int prefixed) { - xmlNsMapItemPtr mi; + xmlNsMapItemPtr mi; if ((doc == NULL) || (ns == NULL) || (retNs == NULL) || (nsMap == NULL) || (topmi == NULL)) @@ -7869,14 +7869,14 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc, */ if ((! (ancestorsOnly && (elem == NULL))) && (*nsMap != NULL)) { - + /* * Try to find an equal ns-name in in-scope ns-decls. */ for (mi = *nsMap; mi != (*topmi)->next; mi = mi->next) { - - if ((mi->depth >= XML_TREE_NSMAP_PARENT) && - /* + + if ((mi->depth >= XML_TREE_NSMAP_PARENT) && + /* * This should be turned on to gain speed, if one knows * that the branch itself was already ns-wellformed and no * stale references existed. I.e. it searches in the ancestor @@ -7884,10 +7884,10 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc, */ ((! ancestorsOnly) || (mi->depth == XML_TREE_NSMAP_PARENT)) && /* Skip shadowed prefixes. */ - (mi->shadowDepth == -1) && + (mi->shadowDepth == -1) && /* Skip xmlns="" or xmlns:foo="". */ ((mi->newNs->href != NULL) && - (mi->newNs->href[0] != 0)) && + (mi->newNs->href[0] != 0)) && /* Ensure a prefix if wanted. */ ((! prefixed) || (mi->newNs->prefix != NULL)) && /* Equal ns name */ @@ -7914,7 +7914,7 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc, return (-1); /* * Insert mapping. - */ + */ if (xmlDOMWrapNSNormAddNsMapItem(nsMap, NULL, ns, tmpns, XML_TREE_NSMAP_DOC) == NULL) { xmlFreeNs(tmpns); @@ -7932,7 +7932,7 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc, if (*nsMap != NULL) { /* * Does it shadow ancestor ns-decls? - */ + */ for (mi = *nsMap; mi != (*topmi)->next; mi = mi->next) { if ((mi->depth < depth) && (mi->shadowDepth == -1) && @@ -8020,7 +8020,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED, * ns-decl is declared on the same element. */ if ((cur->ns != NULL) && adoptns && (cur->ns == ns)) - adoptns = 0; + adoptns = 0; /* * Does it shadow any ns-decl? */ @@ -8030,7 +8030,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED, (mi->shadowDepth == -1) && ((ns->prefix == mi->newNs->prefix) || xmlStrEqual(ns->prefix, mi->newNs->prefix))) { - + mi->shadowDepth = depth; } } @@ -8097,7 +8097,7 @@ ns_end: cur = (xmlNodePtr) cur->properties; continue; } - break; + break; default: goto next_sibling; } @@ -8109,7 +8109,7 @@ ns_end: cur = cur->children; continue; } -next_sibling: +next_sibling: if (cur == elem) break; if (cur->type == XML_ELEMENT_NODE) { @@ -8141,7 +8141,7 @@ next_sibling: return (0); internal_error: if (nsMap != NULL) - xmlDOMWrapNSNormFreeNsMap(nsMap); + xmlDOMWrapNSNormFreeNsMap(nsMap); return (-1); } @@ -8182,7 +8182,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, int parnsdone = 0; /* @ancestorsOnly should be set per option. */ int ancestorsOnly = 0; - + /* * Optimize string adoption for equal or none dicts. */ @@ -8215,13 +8215,13 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, } cur->doc = destDoc; switch (cur->type) { - case XML_XINCLUDE_START: + case XML_XINCLUDE_START: case XML_XINCLUDE_END: /* * TODO */ return (-1); - case XML_ELEMENT_NODE: + case XML_ELEMENT_NODE: curElem = cur; depth++; /* @@ -8246,10 +8246,10 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, * ns->prefix and ns->href seem not to be in the dict. * XML_TREE_ADOPT_STR(ns->prefix) * XML_TREE_ADOPT_STR(ns->href) - */ + */ /* * Does it shadow any ns-decl? - */ + */ if (nsMap) { for (mi = nsMap; mi != topmi->next; mi = mi->next) { @@ -8258,7 +8258,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, ((ns->prefix == mi->newNs->prefix) || xmlStrEqual(ns->prefix, mi->newNs->prefix))) { - + mi->shadowDepth = depth; } } @@ -8271,9 +8271,9 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, goto internal_error; } } - /* No break on purpose. */ + /* No break on purpose. */ case XML_ATTRIBUTE_NODE: - + if (cur->ns == NULL) goto ns_end; if (! parnsdone) { @@ -8304,14 +8304,14 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, } /* * Start searching for an in-scope ns-decl. - */ + */ if (ctxt != NULL) { /* * User-defined behaviour. */ #if 0 ctxt->aquireNsDecl(ctxt, cur->ns, &ns); -#endif +#endif /* * Insert mapping if ns is available; it's the users fault * if not. @@ -8325,7 +8325,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt, * Aquire a normalized ns-decl and add it to the map. */ if (xmlDOMWrapNSNormAquireNormalizedNs(destDoc, - /* ns-decls on curElem or on destDoc->oldNs */ + /* ns-decls on curElem or on destDoc->oldNs */ destParent ? curElem : NULL, cur->ns, &ns, &nsMap, &topmi, depth, @@ -8367,13 +8367,13 @@ ns_end: } break; case XML_TEXT_NODE: - case XML_CDATA_SECTION_NODE: + case XML_CDATA_SECTION_NODE: /* * This puts the content in the dest dict, only if * it was previously in the source dict. */ - XML_TREE_ADOPT_STR_2(cur->content) - goto leave_node; + XML_TREE_ADOPT_STR_2(cur->content) + goto leave_node; case XML_ENTITY_REF_NODE: /* * Remove reference to the entitity-node. @@ -8398,7 +8398,7 @@ ns_end: XML_TREE_ADOPT_STR(cur->name) XML_TREE_ADOPT_STR_2(cur->content) break; - case XML_COMMENT_NODE: + case XML_COMMENT_NODE: break; default: goto internal_error; @@ -8483,7 +8483,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt, if ((attr == NULL) || (destDoc == NULL)) return (-1); - + attr->doc = destDoc; if (attr->ns != NULL) { xmlNsPtr ns = NULL; @@ -8511,13 +8511,13 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt, ns = xmlDOMWrapNSNormDeclareNsForced(destDoc, destParent, attr->ns->href, attr->ns->prefix, 1); } - } + } if (ns == NULL) goto internal_error; attr->ns = ns; - } - - XML_TREE_ADOPT_STR(attr->name); + } + + XML_TREE_ADOPT_STR(attr->name); attr->atype = 0; attr->psvi = NULL; /* @@ -8532,7 +8532,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt, case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: XML_TREE_ADOPT_STR_2(cur->content) - break; + break; case XML_ENTITY_REF_NODE: /* * Remove reference to the entitity-node. @@ -8550,7 +8550,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt, cur->content = ent->content; cur->children = (xmlNodePtr) ent; cur->last = (xmlNodePtr) ent; - } + } } break; default: @@ -8600,16 +8600,16 @@ int xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr sourceDoc, xmlNodePtr node, - xmlDocPtr destDoc, + xmlDocPtr destDoc, xmlNodePtr destParent, int options) -{ +{ if ((node == NULL) || (destDoc == NULL) || ((destParent != NULL) && (destParent->doc != destDoc))) return(-1); /* * Check node->doc sanity. - */ + */ if ((node->doc != NULL) && (sourceDoc != NULL) && (node->doc != sourceDoc)) { /* @@ -8622,7 +8622,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt, if (sourceDoc == destDoc) return (-1); switch (node->type) { - case XML_ELEMENT_NODE: + case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: @@ -8647,7 +8647,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt, } else if (node->type == XML_ATTRIBUTE_NODE) { return (xmlDOMWrapAdoptAttr(ctxt, sourceDoc, (xmlAttrPtr) node, destDoc, destParent, options)); - } else { + } else { xmlNodePtr cur = node; int adoptStr = 1; @@ -8659,7 +8659,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt, (sourceDoc->dict == destDoc->dict)) adoptStr = 0; switch (node->type) { - case XML_TEXT_NODE: + case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: XML_TREE_ADOPT_STR_2(node->content) break; @@ -8692,7 +8692,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt, default: break; } - } + } return (0); } diff --git a/reactos/lib/3rdparty/libxml2/trio.c b/reactos/lib/3rdparty/libxml2/trio.c index 2dd8478f10d..13462587eab 100644 --- a/reactos/lib/3rdparty/libxml2/trio.c +++ b/reactos/lib/3rdparty/libxml2/trio.c @@ -362,7 +362,7 @@ enum { /* Maximal string lengths for user-defined specifiers */ MAX_USER_NAME = 64, MAX_USER_DATA = 256, - + /* Maximal length of locale separator strings */ MAX_LOCALE_SEPARATOR_LENGTH = MB_LEN_MAX, /* Maximal number of integers in grouping */ @@ -1006,23 +1006,23 @@ TRIO_ARGS2((name, prev), trio_userdef_t **prev) { trio_userdef_t *def; - + if (internalEnterCriticalRegion) (void)internalEnterCriticalRegion(NULL); - + for (def = internalUserDef; def; def = def->next) { /* Case-sensitive string comparison */ if (trio_equal_case(def->name, name)) break; - + if (prev) *prev = def; } - + if (internalLeaveCriticalRegion) (void)internalLeaveCriticalRegion(NULL); - + return def; } #endif @@ -1186,7 +1186,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), /* One and only one of arglist and argarray must be used */ assert((arglist != NULL) ^ (argarray != NULL)); - + /* * The 'parameters' array is not initialized, but we need to * know which entries we have used. @@ -1199,7 +1199,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + while (format[index]) { #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) @@ -1277,7 +1277,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), /* Skip if no precision */ if (QUALIFIER_DOT == format[index]) break; - + /* After the first dot we have the precision */ flags |= FLAGS_PRECISION; if ((QUALIFIER_STAR == format[index]) @@ -1322,7 +1322,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), else if (dots == 1) /* Base */ { dots++; - + /* After the second dot we have the base */ flags |= FLAGS_BASE; if ((QUALIFIER_STAR == format[index]) @@ -1521,7 +1521,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), } else return TRIO_ERROR_RETURN(TRIO_EINVAL, index); - + flags |= FLAGS_FIXED_SIZE; break; #endif @@ -1549,7 +1549,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), gotSticky = TRUE; break; #endif - + #if defined(QUALIFIER_VARSIZE) case QUALIFIER_VARSIZE: flags |= FLAGS_VARSIZE_PARAMETER; @@ -1614,9 +1614,9 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), indices[varsize] = pos; varsize = pos++; } - + indices[currentParam] = pos; - + switch (format[index++]) { #if defined(SPECIFIER_CHAR_UPPER) @@ -1675,11 +1675,11 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), } } break; - + case SPECIFIER_INTEGER: parameters[pos].type = FORMAT_INT; break; - + case SPECIFIER_UNSIGNED: flags |= FLAGS_UNSIGNED; parameters[pos].type = FORMAT_INT; @@ -1779,11 +1779,11 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), { unsigned int max; int without_namespace = TRUE; - + parameters[pos].type = FORMAT_USER_DEFINED; parameters[pos].user_name[0] = NIL; tmpformat = (char *)&format[index]; - + while ((ch = format[index])) { index++; @@ -1831,7 +1831,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), } break; #endif /* defined(SPECIFIER_USER_DEFINED_BEGIN) */ - + default: /* Bail out completely to make the error more obvious */ return TRIO_ERROR_RETURN(TRIO_EINVAL, index); @@ -1839,7 +1839,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), /* Count the number of times this entry has been used */ usedEntries[currentParam] += 1; - + /* Find last sticky parameters */ if (gotSticky && !(flags & FLAGS_STICKY)) { @@ -1862,7 +1862,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), } } } - + parameters[pos].indexAfterSpecifier = index; parameters[pos].flags = flags; parameters[pos].width = width; @@ -1870,12 +1870,12 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), parameters[pos].base = (base == NO_BASE) ? BASE_DECIMAL : base; parameters[pos].varsize = varsize; pos++; - + if (! positional) parameterPosition++; - + } /* if identifier */ - + } /* while format characters left */ for (num = 0; num <= maxParam; num++) @@ -1887,7 +1887,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), else /* double references detected */ return TRIO_ERROR_RETURN(TRIO_EDBLREF, num); } - + i = indices[num]; /* @@ -1955,7 +1955,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), if (TYPE_SCAN == type) { if (argarray == NULL) - parameters[i].data.pointer = + parameters[i].data.pointer = (trio_pointer_t)va_arg(*arglist, trio_pointer_t); else { @@ -1995,7 +1995,7 @@ TRIO_ARGS5((type, format, parameters, arglist, argarray), varsize = parameters[i].varsize; } parameters[i].flags &= ~FLAGS_ALL_VARSIZES; - + if (varsize <= (int)sizeof(int)) ; else if (varsize <= (int)sizeof(long)) @@ -2199,7 +2199,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), number &= (unsigned long)-1; else number &= (unsigned int)-1; - + /* Build number */ pointer = bufferend = &buffer[sizeof(buffer) - 1]; *pointer-- = NIL; @@ -2246,7 +2246,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), count = (! ((flags & FLAGS_LEFTADJUST) || (precision == NO_PRECISION))) ? precision : 0; - + /* Adjust width further */ if (isNegative || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE)) width--; @@ -2481,7 +2481,7 @@ TRIO_ARGS4((self, wch, flags, width), if (width == NO_WIDTH) width = sizeof(buffer); - + size = wctomb(buffer, wch); if ((size <= 0) || (size > width) || (buffer[0] == NIL)) return 0; @@ -2523,13 +2523,13 @@ TRIO_ARGS5((self, wstring, flags, width, precision), #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + if (wstring == NULL) { TrioWriteString(self, NULL, flags, width, precision); return; } - + if (NO_PRECISION == precision) { length = INT_MAX; @@ -2624,7 +2624,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), BOOLEAN_T keepTrailingZeroes; BOOLEAN_T keepDecimalPoint; trio_long_double_t epsilon; - + assert(VALID(self)); assert(VALID(self->OutStream)); assert(((base >= MIN_BASE) && (base <= MAX_BASE)) || (base == NO_BASE)); @@ -2639,7 +2639,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), : NAN_LOWER, flags, width, precision); return; - + case TRIO_FP_INFINITE: if (isNegative) { @@ -2666,7 +2666,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), /* Finitude */ break; } - + /* Normal numbers */ if (flags & FLAGS_LONGDOUBLE) { @@ -2714,13 +2714,13 @@ TRIO_ARGS6((self, number, flags, width, precision, base), precision = FLT_DIG; } } - + if (isNegative) number = -number; if (isHex) flags |= FLAGS_FLOAT_E; - + if (flags & FLAGS_FLOAT_G) { if (precision == 0) @@ -2773,7 +2773,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), integerNumber = floorl(number); fractionNumber = number - integerNumber; - + /* * Truncated number. * @@ -2788,7 +2788,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), : zeroes + precision; dblFractionBase = TrioPower(base, fractionDigits); - + workNumber = number + 0.5 / dblFractionBase; if (floorl(number) != floorl(workNumber)) { @@ -2841,7 +2841,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), integerThreshold = INT_MAX; fractionThreshold = INT_MAX; } - + /* * Calculate expected width. * sign + integer part + thousands separators + decimal point @@ -2877,7 +2877,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), ((requireTwoDigitExponent ? sizeof("E+0") : sizeof("E+")) - 1); if (isHex) expectedWidth += sizeof("0X") - 1; - + /* Output prefixing */ if (flags & FLAGS_NILPADDING) { @@ -2923,7 +2923,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x'); } } - + /* Output the integer part and thousand separators */ dblIntegerBase = 1.0 / TrioPower(base, integerDigits - 1); for (i = 0; i < integerDigits; i++) @@ -2939,7 +2939,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), self->OutStream(self, digits[(int)fmodl(workNumber, dblBase)]); } dblIntegerBase *= dblBase; - + if (((flags & (FLAGS_FLOAT_E | FLAGS_QUOTE)) == FLAGS_QUOTE) && TrioFollowedBySeparator(integerDigits - i)) { @@ -2951,7 +2951,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), } } } - + /* Insert decimal point and build the fraction part */ trailingZeroes = 0; @@ -3000,7 +3000,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), } } } - + if (keepTrailingZeroes) { while (trailingZeroes > 0) @@ -3009,7 +3009,7 @@ TRIO_ARGS6((self, number, flags, width, precision, base), trailingZeroes--; } } - + /* Output exponent */ if (exponentDigits > 0) { @@ -3066,13 +3066,13 @@ TRIO_ARGS3((data, format, parameters), int precision; int base; int index; - + index = 0; i = 0; #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + while (format[index]) { #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) @@ -3106,7 +3106,7 @@ TRIO_ARGS3((data, format, parameters), /* Skip the parameter entries */ while (parameters[i].type == FORMAT_PARAMETER) i++; - + flags = parameters[i].flags; /* Find width */ @@ -3126,7 +3126,7 @@ TRIO_ARGS3((data, format, parameters), width = -width; } } - + /* Find precision */ if (flags & FLAGS_PRECISION) { @@ -3157,7 +3157,7 @@ TRIO_ARGS3((data, format, parameters), /* Get base from parameter list */ base = (int)parameters[base].data.number.as_signed; } - + switch (parameters[i].type) { case FORMAT_CHAR: @@ -3237,7 +3237,7 @@ TRIO_ARGS3((data, format, parameters), case FORMAT_POINTER: { trio_reference_t reference; - + reference.data = data; reference.parameter = ¶meters[i]; trio_print_pointer(&reference, parameters[i].data.pointer); @@ -3340,7 +3340,7 @@ TRIO_ARGS3((data, format, parameters), } break; #endif /* defined(FORMAT_USER_DEFINED) */ - + default: break; } /* switch parameter type */ @@ -3550,7 +3550,7 @@ TRIO_ARGS2((self, output), assert(VALID(self)); assert(VALID(self->location)); - + buffer = (char **)self->location; if (self->processed < self->max) @@ -3618,7 +3618,7 @@ TRIO_VARGS2((format, va_alist), va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(stdout, 0, TrioOutStreamFile, format, &args, NULL); TRIO_VA_END(args); @@ -3685,7 +3685,7 @@ TRIO_VARGS3((file, format, va_alist), assert(VALID(file)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(file, 0, TrioOutStreamFile, format, &args, NULL); TRIO_VA_END(args); @@ -3709,7 +3709,7 @@ TRIO_ARGS3((file, format, args), { assert(VALID(file)); assert(VALID(format)); - + return TrioFormat(file, 0, TrioOutStreamFile, format, &args, NULL); } @@ -3730,7 +3730,7 @@ TRIO_ARGS3((file, format, args), { assert(VALID(file)); assert(VALID(format)); - + return TrioFormat(file, 0, TrioOutStreamFile, format, NULL, args); } @@ -3757,7 +3757,7 @@ TRIO_VARGS3((fd, format, va_alist), va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args, NULL); TRIO_VA_END(args); @@ -3780,7 +3780,7 @@ TRIO_ARGS3((fd, format, args), va_list args) { assert(VALID(format)); - + return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args, NULL); } @@ -3800,7 +3800,7 @@ TRIO_ARGS3((fd, format, args), trio_pointer_t *args) { assert(VALID(format)); - + return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, NULL, args); } @@ -3890,7 +3890,7 @@ TRIO_VARGS3((buffer, format, va_alist), assert(VALID(buffer)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioFormat(&buffer, 0, TrioOutStreamString, format, &args, NULL); *buffer = NIL; /* Terminate with NIL character */ @@ -4084,7 +4084,7 @@ TRIO_ARGS4((buffer, max, format, args), { int status; size_t buf_len; - + assert(VALID(buffer)); assert(VALID(format)); @@ -4112,7 +4112,7 @@ TRIO_VARGS2((format, va_alist), char *result = NULL; assert(VALID(format)); - + info = trio_xstring_duplicate(""); if (info) { @@ -4137,9 +4137,9 @@ TRIO_ARGS2((format, args), { trio_string_t *info; char *result = NULL; - + assert(VALID(format)); - + info = trio_xstring_duplicate(""); if (info) { @@ -4166,7 +4166,7 @@ TRIO_VARGS3((result, format, va_alist), assert(VALID(format)); *result = NULL; - + info = trio_xstring_duplicate(""); if (info == NULL) { @@ -4197,11 +4197,11 @@ TRIO_ARGS3((result, format, args), { int status; trio_string_t *info; - + assert(VALID(format)); *result = NULL; - + info = trio_xstring_duplicate(""); if (info == NULL) { @@ -4250,7 +4250,7 @@ TRIO_ARGS3((result, format, args), @param name @return Handle. */ -TRIO_PUBLIC trio_pointer_t +TRIO_PUBLIC trio_pointer_t trio_register TRIO_ARGS2((callback, name), trio_callback_t callback, @@ -4277,23 +4277,23 @@ TRIO_ARGS2((callback, name), } return NULL; } - + /* Bail out if namespace is too long */ if (trio_length(name) >= MAX_USER_NAME) return NULL; - + /* Bail out if namespace already is registered */ def = TrioFindNamespace(name, &prev); if (def) return NULL; } - + def = (trio_userdef_t *)TRIO_MALLOC(sizeof(trio_userdef_t)); if (def) { if (internalEnterCriticalRegion) (void)internalEnterCriticalRegion(NULL); - + if (name) { /* Link into internal list */ @@ -4338,12 +4338,12 @@ TRIO_ARGS1((handle), { if (internalEnterCriticalRegion) (void)internalEnterCriticalRegion(NULL); - + if (prev == NULL) internalUserDef = NULL; else prev->next = def->next; - + if (internalLeaveCriticalRegion) (void)internalLeaveCriticalRegion(NULL); } @@ -4363,14 +4363,14 @@ TRIO_ARGS1((ref), #if defined(FORMAT_USER_DEFINED) assert(((trio_reference_t *)ref)->parameter->type == FORMAT_USER_DEFINED); #endif - + return (((trio_reference_t *)ref)->parameter->user_data); } /************************************************************************* * trio_get_argument [public] */ -trio_pointer_t +trio_pointer_t trio_get_argument TRIO_ARGS1((ref), trio_pointer_t ref) @@ -4378,7 +4378,7 @@ TRIO_ARGS1((ref), #if defined(FORMAT_USER_DEFINED) assert(((trio_reference_t *)ref)->parameter->type == FORMAT_USER_DEFINED); #endif - + return ((trio_reference_t *)ref)->parameter->data.pointer; } @@ -4910,7 +4910,7 @@ TRIO_VARGS3((ref, format, va_alist), va_list arglist; assert(VALID(format)); - + TRIO_VA_START(arglist, format); status = TrioFormatRef((trio_reference_t *)ref, format, &arglist, NULL); TRIO_VA_END(arglist); @@ -4928,7 +4928,7 @@ TRIO_ARGS3((ref, format, arglist), va_list arglist) { assert(VALID(format)); - + return TrioFormatRef((trio_reference_t *)ref, format, &arglist, NULL); } @@ -4943,7 +4943,7 @@ TRIO_ARGS3((ref, format, argarray), trio_pointer_t *argarray) { assert(VALID(format)); - + return TrioFormatRef((trio_reference_t *)ref, format, NULL, argarray); } @@ -5192,7 +5192,7 @@ TRIO_ARGS4((format, indexPointer, flagsPointer, characterclass), switch (ch) { case QUALIFIER_MINUS: /* Scanlist ranges */ - + /* * Both C99 and UNIX98 describes ranges as implementation- * defined. @@ -5219,17 +5219,17 @@ TRIO_ARGS4((format, indexPointer, flagsPointer, characterclass), return TRIO_ERROR_RETURN(TRIO_EINVAL, index); if (range_begin > range_end) return TRIO_ERROR_RETURN(TRIO_ERANGE, index); - + for (i = (int)range_begin; i <= (int)range_end; i++) characterclass[i]++; - + ch = range_end; break; - + #if TRIO_EXTENSION case SPECIFIER_GROUP: - + switch (format[index + 1]) { case QUALIFIER_DOT: /* Collating symbol */ @@ -5248,15 +5248,15 @@ TRIO_ARGS4((format, indexPointer, flagsPointer, characterclass), } if (format[++i] != SPECIFIER_UNGROUP) return -1; - + index = i; break; - + case QUALIFIER_EQUAL: /* Equivalence class expressions */ { unsigned int j; unsigned int k; - + if (internalCollationUnconverted) { /* Lazy evaluation of collation array */ @@ -5280,13 +5280,13 @@ TRIO_ARGS4((format, indexPointer, flagsPointer, characterclass), } if (format[++i] != SPECIFIER_UNGROUP) return -1; - + index = i; } break; - + case QUALIFIER_COLON: /* Character class expressions */ - + if (trio_equal_max(CLASS_ALNUM, sizeof(CLASS_ALNUM) - 1, &format[index])) { @@ -5386,9 +5386,9 @@ TRIO_ARGS4((format, indexPointer, flagsPointer, characterclass), break; } break; - + #endif /* TRIO_EXTENSION */ - + default: characterclass[(int)ch]++; break; @@ -5434,9 +5434,9 @@ TRIO_ARGS5((self, target, flags, width, base), } internalDigitsUnconverted = FALSE; } - + TrioSkipWhitespaces(self); - + if (!(flags & FLAGS_UNSIGNED)) { /* Leading sign */ @@ -5450,9 +5450,9 @@ TRIO_ARGS5((self, target, flags, width, base), isNegative = TRUE; } } - + count = self->processed; - + if (flags & FLAGS_ALTERNATIVE) { switch (base) @@ -5513,7 +5513,7 @@ TRIO_ARGS5((self, target, flags, width, base), } else break; - + number *= base; number += digit; gotNumber = TRUE; /* we need at least one digit */ @@ -5524,7 +5524,7 @@ TRIO_ARGS5((self, target, flags, width, base), /* Was anything read at all? */ if (!gotNumber) return FALSE; - + if (target) *target = (isNegative) ? -((trio_intmax_t)number) : number; return TRUE; @@ -5544,7 +5544,7 @@ TRIO_ARGS4((self, target, flags, width), int i; char ch; trio_uintmax_t number; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5589,7 +5589,7 @@ TRIO_ARGS4((self, target, flags, width), break; } } - + if (target) target[i] = ch; } @@ -5608,12 +5608,12 @@ TRIO_ARGS4((self, target, flags, width), int width) { int i; - + assert(VALID(self)); assert(VALID(self->InStream)); TrioSkipWhitespaces(self); - + /* * Continue until end of string is reached, a whitespace is encountered, * or width is exceeded @@ -5649,7 +5649,7 @@ TRIO_ARGS4((self, target, flags, width), int amount = 0; trio_wchar_t wch; char buffer[MB_LEN_MAX + 1]; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5706,7 +5706,7 @@ TRIO_ARGS4((self, target, flags, width), { int i; int size; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5715,7 +5715,7 @@ TRIO_ARGS4((self, target, flags, width), #if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE) (void)mblen(NULL, 0); #endif - + /* * Continue until end of string is reached, a whitespace is encountered, * or width is exceeded @@ -5753,7 +5753,7 @@ TRIO_ARGS5((self, target, characterclass, flags, width), { int ch; int i; - + assert(VALID(self)); assert(VALID(self->InStream)); @@ -5768,7 +5768,7 @@ TRIO_ARGS5((self, target, characterclass, flags, width), target[i] = (char)ch; self->InStream(self, &ch); } - + if (target) target[i] = NIL; return TRUE; @@ -5797,12 +5797,12 @@ TRIO_ARGS4((self, target, flags, width), BOOLEAN_T isHex = FALSE; doubleString[0] = 0; - + if ((width == NO_WIDTH) || (width > (int)sizeof(doubleString) - 1)) width = sizeof(doubleString) - 1; - + TrioSkipWhitespaces(self); - + /* * Read entire double number from stream. trio_to_double requires * a string as input, but InStream can be anything, so we have to @@ -5888,11 +5888,11 @@ TRIO_ARGS4((self, target, flags, width), self->InStream(self, &ch); } break; - + default: break; } - + while ((ch != EOF) && (index - start < width)) { /* Integer part */ @@ -5952,7 +5952,7 @@ TRIO_ARGS4((self, target, flags, width), return FALSE; doubleString[index] = 0; - + if (flags & FLAGS_LONGDOUBLE) { *((trio_long_double_t *)target) = trio_to_long_double(doubleString, NULL); @@ -5978,7 +5978,7 @@ TRIO_ARGS3((self, target, flags), char buffer[sizeof(internalNullString)]; flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE | FLAGS_NILPADDING); - + if (TrioReadNumber(self, &number, flags, @@ -5999,7 +5999,7 @@ TRIO_ARGS3((self, target, flags), : buffer, 0, sizeof(internalNullString) - 1)) - { + { if (trio_equal_case(buffer, internalNullString)) { if (target) @@ -6063,12 +6063,12 @@ TRIO_ARGS3((data, format, parameters), } } #endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */ - + if ((EOF == ch) && (parameters[i].type != FORMAT_COUNT)) { return (assignment > 0) ? assignment : EOF; } - + if (CHAR_IDENTIFIER == format[index]) { if (CHAR_IDENTIFIER == format[index + 1]) @@ -6087,7 +6087,7 @@ TRIO_ARGS3((data, format, parameters), /* Skip the parameter entries */ while (parameters[i].type == FORMAT_PARAMETER) i++; - + flags = parameters[i].flags; /* Find width */ width = parameters[i].width; @@ -6103,7 +6103,7 @@ TRIO_ARGS3((data, format, parameters), /* Get base from parameter list */ base = (int)parameters[base].data.number.as_signed; } - + switch (parameters[i].type) { case FORMAT_INT: @@ -6151,7 +6151,7 @@ TRIO_ARGS3((data, format, parameters), } } break; /* FORMAT_INT */ - + case FORMAT_STRING: #if TRIO_WIDECHAR if (flags & FLAGS_WIDECHAR) @@ -6215,7 +6215,7 @@ TRIO_ARGS3((data, format, parameters), } /* Skip over group specifier */ index++; - + memset(characterclass, 0, sizeof(characterclass)); rc = TrioGetCharacterClass(format, &index, @@ -6277,7 +6277,7 @@ TRIO_ARGS3((data, format, parameters), } } break; /* FORMAT_COUNT */ - + case FORMAT_CHAR: #if TRIO_WIDECHAR if (flags & FLAGS_WIDECHAR) @@ -6339,7 +6339,7 @@ TRIO_ARGS3((data, format, parameters), } else return assignment; - + index++; } } @@ -6378,7 +6378,7 @@ TRIO_ARGS6((source, sourceSize, InStream, format, arglist, argarray), TrioSetLocale(); } #endif - + status = TrioParse(TYPE_SCAN, format, parameters, arglist, argarray); if (status < 0) return status; @@ -6417,7 +6417,7 @@ TRIO_ARGS2((self, intPointer), self->processed++; self->committed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6454,7 +6454,7 @@ TRIO_ARGS2((self, intPointer), self->committed++; self->processed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6471,7 +6471,7 @@ TRIO_ARGS2((self, intPointer), int *intPointer) { trio_custom_t *data; - + assert(VALID(self)); assert(VALID(self->location)); @@ -6480,7 +6480,7 @@ TRIO_ARGS2((self, intPointer), self->current = (data->stream.in == NULL) ? NIL : (data->stream.in)(data->closure); - + if (self->current == NIL) { self->current = EOF; @@ -6490,7 +6490,7 @@ TRIO_ARGS2((self, intPointer), self->processed++; self->committed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6523,7 +6523,7 @@ TRIO_ARGS2((self, intPointer), self->processed++; self->committed++; } - + if (VALID(intPointer)) { *intPointer = self->current; @@ -6564,7 +6564,7 @@ TRIO_VARGS2((format, va_alist), va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, @@ -6580,7 +6580,7 @@ TRIO_ARGS2((format, args), va_list args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, format, &args, NULL); @@ -6593,7 +6593,7 @@ TRIO_ARGS2((format, args), trio_pointer_t *args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)stdin, 0, TrioInStreamFile, format, NULL, args); @@ -6614,7 +6614,7 @@ TRIO_VARGS3((file, format, va_alist), assert(VALID(file)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, @@ -6632,7 +6632,7 @@ TRIO_ARGS3((file, format, args), { assert(VALID(file)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, format, &args, NULL); @@ -6647,7 +6647,7 @@ TRIO_ARGS3((file, format, args), { assert(VALID(file)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)file, 0, TrioInStreamFile, format, NULL, args); @@ -6667,7 +6667,7 @@ TRIO_VARGS3((fd, format, va_alist), va_list args; assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, @@ -6684,7 +6684,7 @@ TRIO_ARGS3((fd, format, args), va_list args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, format, &args, NULL); @@ -6698,7 +6698,7 @@ TRIO_ARGS3((fd, format, args), trio_pointer_t *args) { assert(VALID(format)); - + return TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, format, NULL, args); @@ -6721,7 +6721,7 @@ TRIO_VARGS4((stream, closure, format, va_alist), assert(VALID(stream)); assert(VALID(format)); - + TRIO_VA_START(args, format); data.stream.in = stream; data.closure = closure; @@ -6739,7 +6739,7 @@ TRIO_ARGS4((stream, closure, format, args), va_list args) { trio_custom_t data; - + assert(VALID(stream)); assert(VALID(format)); @@ -6757,7 +6757,7 @@ TRIO_ARGS4((stream, closure, format, args), trio_pointer_t *args) { trio_custom_t data; - + assert(VALID(stream)); assert(VALID(format)); @@ -6781,7 +6781,7 @@ TRIO_VARGS3((buffer, format, va_alist), assert(VALID(buffer)); assert(VALID(format)); - + TRIO_VA_START(args, format); status = TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, @@ -6799,7 +6799,7 @@ TRIO_ARGS3((buffer, format, args), { assert(VALID(buffer)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, format, &args, NULL); @@ -6814,7 +6814,7 @@ TRIO_ARGS3((buffer, format, args), { assert(VALID(buffer)); assert(VALID(format)); - + return TrioScan((trio_pointer_t)&buffer, 0, TrioInStreamString, format, NULL, args); diff --git a/reactos/lib/3rdparty/libxml2/trionan.c b/reactos/lib/3rdparty/libxml2/trionan.c index 5248eaf6446..3ec0fa2d907 100644 --- a/reactos/lib/3rdparty/libxml2/trionan.c +++ b/reactos/lib/3rdparty/libxml2/trionan.c @@ -257,7 +257,7 @@ trio_pinf(TRIO_NOARGS) static double result = 0.0; if (result == 0.0) { - + #if defined(INFINITY) && defined(__STDC_IEC_559__) result = (double)INFINITY; @@ -279,7 +279,7 @@ trio_pinf(TRIO_NOARGS) /* Force overflow */ result += HUGE_VAL; } - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif @@ -322,13 +322,13 @@ trio_nan(TRIO_NOARGS) static double result = 0.0; if (result == 0.0) { - + #if defined(TRIO_COMPILER_SUPPORTS_C99) result = nan(""); #elif defined(NAN) && defined(__STDC_IEC_559__) result = (double)NAN; - + #elif defined(USE_IEEE_754) result = trio_make_double(ieee_754_qnan_array); @@ -345,13 +345,13 @@ trio_nan(TRIO_NOARGS) # if defined(TRIO_PLATFORM_UNIX) void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); # endif - + result = trio_pinf() / trio_pinf(); - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + #endif } return result; @@ -377,7 +377,7 @@ TRIO_ARGS1((number), * the conservative approach and only use it for UNIX95. */ return isnan(number); - + #elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder have an _isnan() @@ -394,20 +394,20 @@ TRIO_ARGS1((number), int is_special_quantity; is_special_quantity = trio_is_special_quantity(number, &has_mantissa); - + return (is_special_quantity && has_mantissa); - + #else /* * Fallback solution */ int status; double integral, fraction; - + # if defined(TRIO_PLATFORM_UNIX) void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); # endif - + status = (/* * NaN is the only number which does not compare to itself */ @@ -418,13 +418,13 @@ TRIO_ARGS1((number), ((number != 0.0) && (fraction = modf(number, &integral), integral == fraction))); - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + return status; - + #endif } @@ -455,7 +455,7 @@ TRIO_ARGS1((number), return isinf(number) ? ((number > 0.0) ? 1 : -1) : 0; - + #elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder have an _fpclass() @@ -474,7 +474,7 @@ TRIO_ARGS1((number), int is_special_quantity; is_special_quantity = trio_is_special_quantity(number, &has_mantissa); - + return (is_special_quantity && !has_mantissa) ? ((number < 0.0) ? -1 : 1) : 0; @@ -484,23 +484,23 @@ TRIO_ARGS1((number), * Fallback solution. */ int status; - + # if defined(TRIO_PLATFORM_UNIX) void (*signal_handler)(int) = signal(SIGFPE, SIG_IGN); # endif - + double infinity = trio_pinf(); - + status = ((number == infinity) ? 1 : ((number == -infinity) ? -1 : 0)); - + # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + return status; - + #endif } @@ -522,7 +522,7 @@ TRIO_ARGS1((number), * C99 defines isfinite() as a macro. */ return isfinite(number); - + #elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder use _finite(). @@ -543,7 +543,7 @@ TRIO_ARGS1((number), * Fallback solution. */ return ((trio_isinf(number) == 0) && (trio_isnan(number) == 0)); - + #endif } @@ -592,7 +592,7 @@ TRIO_ARGS2((number, is_negative), # define TRIO_NEGATIVE_ZERO FP_NEG_ZERO # define TRIO_POSITIVE_NORMAL FP_POS_NORM # define TRIO_NEGATIVE_NORMAL FP_NEG_NORM - + # elif defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB) /* * Microsoft Visual C++ and Borland C++ Builder have an _fpclass() @@ -609,7 +609,7 @@ TRIO_ARGS2((number, is_negative), # define TRIO_NEGATIVE_ZERO _FPCLASS_NZ # define TRIO_POSITIVE_NORMAL _FPCLASS_PN # define TRIO_NEGATIVE_NORMAL _FPCLASS_NN - + # elif defined(FP_PLUS_NORM) /* * HP-UX 9.x and 10.x have an fpclassify() function, that is different @@ -674,13 +674,13 @@ TRIO_ARGS2((number, is_negative), *is_negative = (number < 0.0); return TRIO_FP_NORMAL; } - + # else /* * Fallback solution. */ int rc; - + if (number == 0.0) { /* * In IEEE 754 the sign of zero is ignored in comparisons, so we @@ -712,7 +712,7 @@ TRIO_ARGS2((number, is_negative), } *is_negative = (number < 0.0); return TRIO_FP_NORMAL; - + # endif #endif } @@ -730,7 +730,7 @@ TRIO_ARGS1((number), double number) { int is_negative; - + (void)trio_fpclassify_and_signbit(number, &is_negative); return is_negative; } @@ -749,7 +749,7 @@ TRIO_ARGS1((number), double number) { int dummy; - + return trio_fpclassify_and_signbit(number, &dummy); } @@ -824,7 +824,7 @@ int main(TRIO_NOARGS) print_class("NNorm", -1.0); print_class("PSub", 1.01e-307 - 1.00e-307); print_class("NSub", 1.00e-307 - 1.01e-307); - + printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n", my_nan, ((unsigned char *)&my_nan)[0], @@ -858,11 +858,11 @@ int main(TRIO_NOARGS) ((unsigned char *)&my_ninf)[6], ((unsigned char *)&my_ninf)[7], trio_isnan(my_ninf), trio_isinf(my_ninf)); - + # if defined(TRIO_PLATFORM_UNIX) signal_handler = signal(SIGFPE, SIG_IGN); # endif - + my_pinf = DBL_MAX + DBL_MAX; my_ninf = -my_pinf; my_nan = my_pinf / my_pinf; @@ -870,7 +870,7 @@ int main(TRIO_NOARGS) # if defined(TRIO_PLATFORM_UNIX) signal(SIGFPE, signal_handler); # endif - + printf("NaN : %4g 0x%02x%02x%02x%02x%02x%02x%02x%02x (%2d, %2d)\n", my_nan, ((unsigned char *)&my_nan)[0], @@ -904,7 +904,7 @@ int main(TRIO_NOARGS) ((unsigned char *)&my_ninf)[6], ((unsigned char *)&my_ninf)[7], trio_isnan(my_ninf), trio_isinf(my_ninf)); - + return 0; } #endif diff --git a/reactos/lib/3rdparty/libxml2/trionan.h b/reactos/lib/3rdparty/libxml2/trionan.h index 4847a00a1aa..4c20b3b9f60 100644 --- a/reactos/lib/3rdparty/libxml2/trionan.h +++ b/reactos/lib/3rdparty/libxml2/trionan.h @@ -46,7 +46,7 @@ TRIO_PUBLIC double trio_pinf TRIO_PROTO((void)); * Return negative infinity. */ TRIO_PUBLIC double trio_ninf TRIO_PROTO((void)); - + /* * Return negative zero. */ diff --git a/reactos/lib/3rdparty/libxml2/triostr.c b/reactos/lib/3rdparty/libxml2/triostr.c index 0ecd6724eb2..73ddfe09fa6 100644 --- a/reactos/lib/3rdparty/libxml2/triostr.c +++ b/reactos/lib/3rdparty/libxml2/triostr.c @@ -161,11 +161,11 @@ TRIO_ARGS1((string), #if !defined(TRIO_MINIMAL) /** Append @p source at the end of @p target. - + @param target Target string. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p target string and @p source string. @pre No boundary checking is performed, so insufficient memory will @@ -180,7 +180,7 @@ TRIO_ARGS2((target, source), { assert(target); assert(source); - + return (strcat(target, source) != NULL); } #endif /* !defined(TRIO_MINIMAL) */ @@ -188,12 +188,12 @@ TRIO_ARGS2((target, source), #if !defined(TRIO_MINIMAL) /** Append at most @p max characters from @p source to @p target. - + @param target Target string. @param max Maximum number of characters to append. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chuck with sufficient room to contain the @p target string and the @p source string (at most @p max characters). @@ -209,12 +209,12 @@ TRIO_ARGS3((target, max, source), TRIO_CONST char *source) { size_t length; - + assert(target); assert(source); length = trio_length(target); - + if (max > length) { strncat(target, source, max - length - 1); @@ -240,7 +240,7 @@ TRIO_ARGS2((string, substring), { assert(string); assert(substring); - + return (0 != strstr(string, substring)); } #endif /* !defined(TRIO_MINIMAL) */ @@ -249,11 +249,11 @@ TRIO_ARGS2((string, substring), #if !defined(TRIO_MINIMAL) /** Copy @p source to @p target. - + @param target Target string. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p source string. @pre No boundary checking is performed, so insufficient memory will @@ -268,7 +268,7 @@ TRIO_ARGS2((target, source), { assert(target); assert(source); - + (void)strcpy(target, source); return TRUE; } @@ -277,12 +277,12 @@ TRIO_ARGS2((target, source), /** Copy at most @p max characters from @p source to @p target. - + @param target Target string. @param max Maximum number of characters to append. @param source Source string. @return Boolean value indicating success or failure. - + @pre @p target must point to a memory chunk with sufficient room to contain the @p source string (at most @p max characters). @pre No boundary checking is performed, so insufficient memory will @@ -332,10 +332,10 @@ TRIO_ARGS2((source, size), /** Duplicate @p source. - + @param source Source string. @return A copy of the @p source string. - + @post @p target will be zero terminated. */ TRIO_STRING_PUBLIC char * @@ -350,11 +350,11 @@ TRIO_ARGS1((source), #if !defined(TRIO_MINIMAL) /** Duplicate at most @p max characters of @p source. - + @param source Source string. @param max Maximum number of characters to duplicate. @return A copy of the @p source string. - + @post @p target will be zero terminated. */ TRIO_STRING_PUBLIC char * @@ -379,11 +379,11 @@ trio_duplicate_max TRIO_ARGS2((source, max), /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-insensitive comparison. */ TRIO_STRING_PUBLIC int @@ -418,11 +418,11 @@ TRIO_ARGS2((first, second), /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-sensitive comparison. */ TRIO_STRING_PUBLIC int @@ -445,12 +445,12 @@ TRIO_ARGS2((first, second), #if !defined(TRIO_MINIMAL) /** Compare if two strings up until the first @p max characters are equal. - + @param first First string. @param max Maximum number of characters to compare. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-sensitive comparison. */ TRIO_STRING_PUBLIC int @@ -474,7 +474,7 @@ TRIO_ARGS3((first, max, second), /** Compare if two strings are equal. - + @param first First string. @param second Second string. @return Boolean indicating whether the two strings are equal or not. @@ -500,12 +500,12 @@ TRIO_ARGS2((first, second), /** Compare if two strings up until the first @p max characters are equal. - + @param first First string. @param max Maximum number of characters to compare. @param second Second string. @return Boolean indicating whether the two strings are equal or not. - + Case-insensitive comparison. */ TRIO_STRING_PUBLIC int @@ -554,7 +554,7 @@ TRIO_ARGS1((error_number), int error_number) { #if defined(USE_STRERROR) - + return strerror(error_number); #elif defined(USE_SYS_ERRLIST) @@ -565,11 +565,11 @@ TRIO_ARGS1((error_number), return ((error_number < 0) || (error_number >= sys_nerr)) ? "unknown" : sys_errlist[error_number]; - + #else - + return "unknown"; - + #endif } @@ -599,7 +599,7 @@ TRIO_ARGS4((target, max, format, datetime), assert(format); assert(datetime); assert(max > 0); - + return strftime(target, max, format, datetime); } #endif /* !defined(TRIO_MINIMAL) */ @@ -626,7 +626,7 @@ TRIO_ARGS2((string, type), char ch; assert(string); - + switch (type) { case TRIO_HASH_PLAIN: @@ -715,7 +715,7 @@ TRIO_ARGS1((target), @return Boolean value indicating success or failure. Case-insensitive comparison. - + The following wildcards can be used @li @c * Match any number of characters. @li @c ? Match a single character. @@ -728,7 +728,7 @@ TRIO_ARGS2((string, pattern), { assert(string); assert(pattern); - + for (; ('*' != *pattern); ++pattern, ++string) { if (NIL == *string) @@ -753,7 +753,7 @@ TRIO_ARGS2((string, pattern), } } while (*string++); - + return FALSE; } #endif /* !defined(TRIO_MINIMAL) */ @@ -768,7 +768,7 @@ TRIO_ARGS2((string, pattern), @return Boolean value indicating success or failure. Case-sensitive comparison. - + The following wildcards can be used @li @c * Match any number of characters. @li @c ? Match a single character. @@ -781,7 +781,7 @@ TRIO_ARGS2((string, pattern), { assert(string); assert(pattern); - + for (; ('*' != *pattern); ++pattern, ++string) { if (NIL == *string) @@ -806,7 +806,7 @@ TRIO_ARGS2((string, pattern), } } while (*string++); - + return FALSE; } #endif /* !defined(TRIO_MINIMAL) */ @@ -833,7 +833,7 @@ TRIO_ARGS3((target, source, Function), assert(target); assert(source); assert(Function); - + while (*source != NIL) { *target++ = Function(*source++); @@ -890,7 +890,7 @@ TRIO_ARGS3((string, max, substring), assert(string); assert(substring); - + size = trio_length(substring); if (size <= max) { @@ -925,7 +925,7 @@ TRIO_ARGS2((string, delimiters), TRIO_CONST char *delimiters) { assert(delimiters); - + return strtok(string, delimiters); } #endif /* !defined(TRIO_MINIMAL) */ @@ -1060,7 +1060,7 @@ TRIO_ARGS2((source, endp), } } } - + value = integer + fraction; if (exponent != 0) { @@ -1142,7 +1142,7 @@ TRIO_ARGS3((string, endp, base), { assert(string); assert((base >= 2) && (base <= 36)); - + return strtol(string, endp, base); } @@ -1160,16 +1160,16 @@ TRIO_ARGS1((source), int source) { #if defined(USE_TOLOWER) - + return tolower(source); - + #else /* Does not handle locales or non-contiguous alphabetic characters */ return ((source >= (int)'A') && (source <= (int)'Z')) ? source - 'A' + 'a' : source; - + #endif } #endif /* !defined(TRIO_MINIMAL) */ @@ -1191,7 +1191,7 @@ TRIO_ARGS3((string, endp, base), { assert(string); assert((base >= 2) && (base <= 36)); - + return strtoul(string, endp, base); } #endif /* !defined(TRIO_MINIMAL) */ @@ -1209,16 +1209,16 @@ TRIO_ARGS1((source), int source) { #if defined(USE_TOUPPER) - + return toupper(source); - + #else /* Does not handle locales or non-contiguous alphabetic characters */ return ((source >= (int)'a') && (source <= (int)'z')) ? source - 'a' + 'A' : source; - + #endif } @@ -1262,7 +1262,7 @@ TRIO_STRING_PRIVATE trio_string_t * TrioStringAlloc(TRIO_NOARGS) { trio_string_t *self; - + self = (trio_string_t *)TRIO_MALLOC(sizeof(trio_string_t)); if (self) { @@ -1293,7 +1293,7 @@ TRIO_ARGS2((self, delta), new_size = (delta == 0) ? ( (self->allocated == 0) ? 1 : self->allocated * 2 ) : self->allocated + delta; - + new_content = (char *)TRIO_REALLOC(self->content, new_size); if (new_content) { @@ -1330,7 +1330,7 @@ TRIO_ARGS2((self, length), #if !defined(TRIO_MINIMAL) /** Create a new dynamic string. - + @param initial_size Initial size of the buffer. @return Newly allocated dynamic string, or NULL if memory allocation failed. */ @@ -1363,7 +1363,7 @@ TRIO_ARGS1((initial_size), /** Deallocate the dynamic string and its contents. - + @param self Dynamic string */ TRIO_STRING_PUBLIC void @@ -1372,7 +1372,7 @@ TRIO_ARGS1((self), trio_string_t *self) { assert(self); - + if (self) { trio_destroy(self->content); @@ -1384,11 +1384,11 @@ TRIO_ARGS1((self), #if !defined(TRIO_MINIMAL) /** Get a pointer to the content. - + @param self Dynamic string. @param offset Offset into content. @return Pointer to the content. - + @p Offset can be zero, positive, or negative. If @p offset is zero, then the start of the content will be returned. If @p offset is positive, then a pointer to @p offset number of characters from the beginning of the @@ -1403,7 +1403,7 @@ TRIO_ARGS2((self, offset), int offset) { char *result = NULL; - + assert(self); if (self->content != NULL) @@ -1436,10 +1436,10 @@ TRIO_ARGS2((self, offset), /** Extract the content. - + @param self Dynamic String @return Content of dynamic string. - + The content is removed from the dynamic string. This enables destruction of the dynamic string without deallocation of the content. */ @@ -1449,7 +1449,7 @@ TRIO_ARGS1((self), trio_string_t *self) { char *result; - + assert(self); result = self->content; @@ -1463,13 +1463,13 @@ TRIO_ARGS1((self), #if !defined(TRIO_MINIMAL) /** Set the content of the dynamic string. - + @param self Dynamic String @param buffer The new content. - + Sets the content of the dynamic string to a copy @p buffer. An existing content will be deallocated first, if necessary. - + @remark This function will make a copy of @p buffer. You are responsible for deallocating @p buffer yourself. @@ -1517,7 +1517,7 @@ TRIO_ARGS1((self), #if !defined(TRIO_MINIMAL) /** Append the second string to the first. - + @param self Dynamic string to be modified. @param other Dynamic string to copy from. @return Boolean value indicating success or failure. @@ -1529,7 +1529,7 @@ TRIO_ARGS2((self, other), trio_string_t *other) { size_t length; - + assert(self); assert(other); @@ -1539,7 +1539,7 @@ TRIO_ARGS2((self, other), trio_copy(&self->content[self->length], other->content); self->length = length; return TRUE; - + error: return FALSE; } @@ -1557,7 +1557,7 @@ TRIO_ARGS2((self, other), TRIO_CONST char *other) { size_t length; - + assert(self); assert(other); @@ -1567,7 +1567,7 @@ TRIO_ARGS2((self, other), trio_copy(&self->content[self->length], other); self->length = length; return TRUE; - + error: return FALSE; } @@ -1593,7 +1593,7 @@ TRIO_ARGS2((self, character), self->content[self->length] = character; self->length++; return TRUE; - + error: return FALSE; } @@ -1602,7 +1602,7 @@ TRIO_ARGS2((self, character), #if !defined(TRIO_MINIMAL) /** Search for the first occurrence of second parameter in the first. - + @param self Dynamic string to be modified. @param other Dynamic string to copy from. @return Boolean value indicating success or failure. @@ -1687,7 +1687,7 @@ TRIO_ARGS1((other), trio_string_t *other) { trio_string_t *self; - + assert(other); self = TrioStringAlloc(); @@ -1718,7 +1718,7 @@ TRIO_ARGS1((other), TRIO_CONST char *other) { trio_string_t *self; - + assert(other); self = TrioStringAlloc(); diff --git a/reactos/lib/3rdparty/libxml2/uri.c b/reactos/lib/3rdparty/libxml2/uri.c index d2fa5216f52..5f2c0f981ce 100644 --- a/reactos/lib/3rdparty/libxml2/uri.c +++ b/reactos/lib/3rdparty/libxml2/uri.c @@ -1,5 +1,5 @@ /** - * uri.c: set of generic URI related routines + * uri.c: set of generic URI related routines * * Reference: RFCs 2396, 2732 and 2373 * @@ -160,14 +160,14 @@ #define IS_URIC(p) ((IS_UNRESERVED(*(p))) || (IS_ESCAPED(p)) || \ (IS_RESERVED(*(p)))) -/* +/* * unwise = "{" | "}" | "|" | "\" | "^" | "`" -*/ +*/ #define IS_UNWISE(p) \ (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) || \ ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) || \ - ((*(p) == ']')) || ((*(p) == '`'))) + ((*(p) == ']')) || ((*(p) == '`'))) /* * Skip to next pointer char, handle escaped sequences @@ -468,7 +468,7 @@ xmlSaveUri(xmlURIPtr uri) { return(NULL); } } - if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) + if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) ret[len++] = *p++; else { int val = *(unsigned char *)p++; @@ -504,7 +504,7 @@ xmlSaveUri(xmlURIPtr uri) { return(NULL); } } - if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) + if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p)))) ret[len++] = *p++; else { int val = *(unsigned char *)p++; @@ -832,14 +832,14 @@ xmlURIUnescapeString(const char *str, int len, char *target) { while(len > 0) { if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) { in++; - if ((*in >= '0') && (*in <= '9')) + if ((*in >= '0') && (*in <= '9')) *out = (*in - '0'); else if ((*in >= 'a') && (*in <= 'f')) *out = (*in - 'a') + 10; else if ((*in >= 'A') && (*in <= 'F')) *out = (*in - 'A') + 10; in++; - if ((*in >= '0') && (*in <= '9')) + if ((*in >= '0') && (*in <= '9')) *out = *out * 16 + (*in - '0'); else if ((*in >= 'a') && (*in <= 'f')) *out = *out * 16 + (*in - 'a') + 10; @@ -994,7 +994,7 @@ xmlURIEscape(const xmlChar * str) if (uri->user) { segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,"); NULLCHK(segment) - ret = xmlStrcat(ret,BAD_CAST "//"); + ret = xmlStrcat(ret,BAD_CAST "//"); ret = xmlStrcat(ret, segment); ret = xmlStrcat(ret, BAD_CAST "@"); xmlFree(segment); @@ -1068,7 +1068,7 @@ xmlURIEscape(const xmlChar * str) * * Parse an URI fragment string and fills in the appropriate fields * of the @uri structure. - * + * * fragment = *uric * * Returns 0 or the error code @@ -1098,7 +1098,7 @@ xmlParseURIFragment(xmlURIPtr uri, const char **str) * @str: pointer to the string to analyze * * Parse the query part of an URI - * + * * query = *uric * * Returns 0 or the error code @@ -1128,7 +1128,7 @@ xmlParseURIQuery(xmlURIPtr uri, const char **str) * @str: pointer to the string to analyze * * Parse an URI scheme - * + * * scheme = alpha *( alpha | digit | "+" | "-" | "." ) * * Returns 0 or the error code @@ -1139,7 +1139,7 @@ xmlParseURIScheme(xmlURIPtr uri, const char **str) { if (str == NULL) return(-1); - + cur = *str; if (!IS_ALPHA(*cur)) return(2); @@ -1160,7 +1160,7 @@ xmlParseURIScheme(xmlURIPtr uri, const char **str) { * @str: pointer to the string to analyze * * Parse an URI opaque part - * + * * opaque_part = uric_no_slash *uric * * Returns 0 or the error code @@ -1196,7 +1196,7 @@ xmlParseURIOpaquePart(xmlURIPtr uri, const char **str) * * Parse a server subpart of an URI, it's a finer grain analysis * of the authority part. - * + * * server = [ [ userinfo "@" ] hostport ] * userinfo = *( unreserved | escaped | * ";" | ":" | "&" | "=" | "+" | "$" | "," ) @@ -1225,7 +1225,7 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) { if (str == NULL) return(-1); - + cur = *str; /* @@ -1302,7 +1302,7 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) { * Not IPV6, maybe IPV4 */ for (oct = 0; oct < IPV4max; ++oct) { - if (*cur == '.') + if (*cur == '.') return(3); /* e.g. http://.xml/ or http://18.29..30/ */ while(IS_DIGIT(*cur)) cur++; if (oct == (IPV4max-1)) @@ -1369,7 +1369,7 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) { } *str = cur; return(0); -} +} /** * xmlParseURIRelSegment: @@ -1377,7 +1377,7 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) { * @str: pointer to the string to analyze * * Parse an URI relative segment - * + * * rel_segment = 1*( unreserved | escaped | ";" | "@" | "&" | "=" | * "+" | "$" | "," ) * @@ -1414,7 +1414,7 @@ xmlParseURIRelSegment(xmlURIPtr uri, const char **str) * @slash: should we add a leading slash * * Parse an URI set of path segments - * + * * path_segments = segment *( "/" segment ) * segment = *pchar *( ";" param ) * param = *pchar @@ -1488,7 +1488,7 @@ xmlParseURIPathSegments(xmlURIPtr uri, const char **str, int slash) * @str: pointer to the string to analyze * * Parse the authority part of an URI. - * + * * authority = server | reg_name * server = [ [ userinfo "@" ] hostport ] * reg_name = 1*( unreserved | escaped | "$" | "," | ";" | ":" | @@ -1512,7 +1512,7 @@ xmlParseURIAuthority(xmlURIPtr uri, const char **str) { if (str == NULL) return(-1); - + cur = *str; /* @@ -1550,7 +1550,7 @@ xmlParseURIAuthority(xmlURIPtr uri, const char **str) { * @str: pointer to the string to analyze * * Parse an URI hierarchical part - * + * * hier_part = ( net_path | abs_path ) [ "?" query ] * abs_path = "/" path_segments * net_path = "//" authority [ abs_path ] @@ -1564,7 +1564,7 @@ xmlParseURIHierPart(xmlURIPtr uri, const char **str) { if (str == NULL) return(-1); - + cur = *str; if ((cur[0] == '/') && (cur[1] == '/')) { @@ -1601,7 +1601,7 @@ xmlParseURIHierPart(xmlURIPtr uri, const char **str) { * * Parse an URI reference string and fills in the appropriate fields * of the @uri structure - * + * * absoluteURI = scheme ":" ( hier_part | opaque_part ) * * Returns 0 or the error code @@ -1613,7 +1613,7 @@ xmlParseAbsoluteURI(xmlURIPtr uri, const char **str) { if (str == NULL) return(-1); - + cur = *str; ret = xmlParseURIScheme(uri, str); @@ -1635,7 +1635,7 @@ xmlParseAbsoluteURI(xmlURIPtr uri, const char **str) { * * Parse an relative URI string and fills in the appropriate fields * of the @uri structure - * + * * relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ] * abs_path = "/" path_segments * net_path = "//" authority [ abs_path ] @@ -1650,7 +1650,7 @@ xmlParseRelativeURI(xmlURIPtr uri, const char **str) { if (str == NULL) return(-1); - + cur = *str; if ((cur[0] == '/') && (cur[1] == '/')) { cur += 2; @@ -1692,7 +1692,7 @@ xmlParseRelativeURI(xmlURIPtr uri, const char **str) { * * Parse an URI reference string and fills in the appropriate fields * of the @uri structure - * + * * URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ] * * Returns 0 or the error code @@ -1737,8 +1737,8 @@ xmlParseURIReference(xmlURIPtr uri, const char *str) { * xmlParseURI: * @str: the URI string to analyze * - * Parse an URI - * + * Parse an URI + * * URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ] * * Returns a newly built xmlURIPtr or NULL in case of error @@ -1774,7 +1774,7 @@ xmlParseURI(const char *str) { * * Computes he final URI of the reference done by checking that * the given URI is valid, and building the final URI using the - * base URI. This is processed according to section 5.2 of the + * base URI. This is processed according to section 5.2 of the * RFC 2396 * * 5.2. Resolving Relative References to Absolute Form @@ -1798,7 +1798,7 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { * as a reference to "." rather than as a synonym for the current * URI. Should we do that here? */ - if (URI == NULL) + if (URI == NULL) ret = -1; else { if (*URI) { @@ -1869,7 +1869,7 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { res->server = xmlMemStrdup(bas->server); if (bas->user != NULL) res->user = xmlMemStrdup(bas->user); - res->port = bas->port; + res->port = bas->port; } if (bas->path != NULL) res->path = xmlMemStrdup(bas->path); @@ -1894,7 +1894,7 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { } if (bas->scheme != NULL) res->scheme = xmlMemStrdup(bas->scheme); - + if (ref->query != NULL) res->query = xmlMemStrdup(ref->query); if (ref->fragment != NULL) @@ -1914,7 +1914,7 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { res->server = xmlMemStrdup(ref->server); if (ref->user != NULL) res->user = xmlMemStrdup(ref->user); - res->port = ref->port; + res->port = ref->port; } if (ref->path != NULL) res->path = xmlMemStrdup(ref->path); @@ -1926,7 +1926,7 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) { res->server = xmlMemStrdup(bas->server); if (bas->user != NULL) res->user = xmlMemStrdup(bas->user); - res->port = bas->port; + res->port = bas->port; } /* @@ -2210,11 +2210,11 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) * xmlCanonicPath: * @path: the resource locator in a filesystem notation * - * Constructs a canonic path from the specified path. + * Constructs a canonic path from the specified path. * - * Returns a new canonic path, or a duplicate of the path parameter if the + * Returns a new canonic path, or a duplicate of the path parameter if the * construction fails. The caller is responsible for freeing the memory occupied - * by the returned string. If there is insufficient memory available, or the + * by the returned string. If there is insufficient memory available, or the * argument is NULL, the function returns NULL. */ #define IS_WINDOWS_PATH(p) \ @@ -2225,7 +2225,7 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base) xmlChar* xmlCanonicPath(const xmlChar *path) { -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) int len = 0; int i = 0; xmlChar *p = NULL; @@ -2245,7 +2245,7 @@ xmlCanonicPath(const xmlChar *path) return(NULL); } -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) len = xmlStrlen(path); if ((len > 2) && IS_WINDOWS_PATH(path)) { uri->scheme = xmlStrdup(BAD_CAST "file"); diff --git a/reactos/lib/3rdparty/libxml2/valid.c b/reactos/lib/3rdparty/libxml2/valid.c index ed89c6caa5f..ef0d220e395 100644 --- a/reactos/lib/3rdparty/libxml2/valid.c +++ b/reactos/lib/3rdparty/libxml2/valid.c @@ -286,7 +286,7 @@ vstateVPush(xmlValidCtxtPtr ctxt, xmlElementPtr elemDecl, xmlNodePtr node) { if (elemDecl->contModel == NULL) xmlValidBuildContentModel(ctxt, elemDecl); if (elemDecl->contModel != NULL) { - ctxt->vstateTab[ctxt->vstateNr].exec = + ctxt->vstateTab[ctxt->vstateNr].exec = xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL); } else { ctxt->vstateTab[ctxt->vstateNr].exec = NULL; @@ -608,7 +608,7 @@ xmlValidStateDebug(xmlValidCtxtPtr ctxt) { #define DEBUG_VALID_STATE(n,c) xmlValidStateDebug(ctxt); #define DEBUG_VALID_MSG(m) \ xmlGenericError(xmlGenericErrorContext, "%s\n", m); - + #else #define DEBUG_VALID_STATE(n,c) #define DEBUG_VALID_MSG(m) @@ -663,7 +663,7 @@ xmlValidBuildAContentModel(xmlElementContentPtr content, xmlAutomataStatePtr oldstate = ctxt->state; xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(content->name, content->prefix, fn, 50); if (fullname == NULL) { xmlVErrMemory(ctxt, "Building content model"); @@ -739,7 +739,7 @@ xmlValidBuildAContentModel(xmlElementContentPtr content, xmlElementContentOccur ocur; ocur = content->ocur; - if ((ocur == XML_ELEMENT_CONTENT_PLUS) || + if ((ocur == XML_ELEMENT_CONTENT_PLUS) || (ocur == XML_ELEMENT_CONTENT_MULT)) { ctxt->state = xmlAutomataNewEpsilon(ctxt->am, ctxt->state, NULL); @@ -931,7 +931,7 @@ xmlNewDocElementContent(xmlDocPtr doc, const xmlChar *name, } break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT content corrupted invalid type\n", NULL); return(NULL); @@ -988,7 +988,7 @@ xmlNewElementContent(const xmlChar *name, xmlElementContentType type) { * @cur: An element content pointer. * * Build a copy of an element content description. - * + * * Returns the new xmlElementContentPtr or NULL in case of error. */ xmlElementContentPtr @@ -1015,7 +1015,7 @@ xmlCopyDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur) { else ret->name = xmlStrdup(cur->name); } - + if (cur->prefix != NULL) { if (dict) ret->prefix = xmlDictLookup(dict, cur->prefix, -1); @@ -1045,7 +1045,7 @@ xmlCopyDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur) { else tmp->name = xmlStrdup(cur->name); } - + if (cur->prefix != NULL) { if (dict) tmp->prefix = xmlDictLookup(dict, cur->prefix, -1); @@ -1069,7 +1069,7 @@ xmlCopyDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur) { * * Build a copy of an element content description. * Deprecated, use xmlCopyDocElementContent instead - * + * * Returns the new xmlElementContentPtr or NULL in case of error. */ xmlElementContentPtr @@ -1101,7 +1101,7 @@ xmlFreeDocElementContent(xmlDocPtr doc, xmlElementContentPtr cur) { case XML_ELEMENT_CONTENT_OR: break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT content corrupted invalid type\n", NULL); return; @@ -1187,7 +1187,7 @@ xmlDumpElementContent(xmlBufferPtr buf, xmlElementContentPtr content, int glob) xmlDumpElementContent(buf, content->c2, 0); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT content corrupted invalid type\n", NULL); } @@ -1384,7 +1384,7 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, switch (type) { case XML_ELEMENT_TYPE_EMPTY: if (content != NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content != NULL for EMPTY\n", NULL); return(NULL); @@ -1392,7 +1392,7 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, break; case XML_ELEMENT_TYPE_ANY: if (content != NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content != NULL for ANY\n", NULL); return(NULL); @@ -1400,7 +1400,7 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, break; case XML_ELEMENT_TYPE_MIXED: if (content == NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content == NULL for MIXED\n", NULL); return(NULL); @@ -1408,14 +1408,14 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, break; case XML_ELEMENT_TYPE_ELEMENT: if (content == NULL) { - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "xmlAddElementDecl: content == NULL for ELEMENT\n", NULL); return(NULL); } break; default: - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT decl corrupted invalid type\n", NULL); return(NULL); @@ -1595,7 +1595,7 @@ xmlFreeElementTable(xmlElementTablePtr table) { * @elem: An element * * Build a copy of an element. - * + * * Returns the new xmlElementPtr or NULL in case of error. */ static xmlElementPtr @@ -1629,7 +1629,7 @@ xmlCopyElement(xmlElementPtr elem) { * @table: An element table * * Build a copy of an element table. - * + * * Returns the new xmlElementTablePtr or NULL in case of error. */ xmlElementTablePtr @@ -1694,7 +1694,7 @@ xmlDumpElementDecl(xmlBufferPtr buf, xmlElementPtr elem) { xmlBufferWriteChar(buf, ">\n"); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ELEMENT struct corrupted invalid type\n", NULL); } @@ -1805,7 +1805,7 @@ static void xmlDumpEnumeration(xmlBufferPtr buf, xmlEnumerationPtr cur) { if ((buf == NULL) || (cur == NULL)) return; - + xmlBufferWriteCHAR(buf, cur->name); if (cur->next == NULL) xmlBufferWriteChar(buf, ")"); @@ -1855,7 +1855,7 @@ xmlScanAttributeDecl(xmlDtdPtr dtd, const xmlChar *elem) { return(NULL); } table = (xmlAttributeTablePtr) dtd->attributes; - if (table == NULL) + if (table == NULL) return(NULL); /* WRONG !!! */ @@ -2007,13 +2007,13 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, case XML_ATTRIBUTE_NOTATION: break; default: - xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, + xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR, "Internal: ATTRIBUTE struct corrupted invalid type\n", NULL); xmlFreeEnumeration(tree); return(NULL); } - if ((defaultValue != NULL) && + if ((defaultValue != NULL) && (!xmlValidateAttributeValue(type, defaultValue))) { xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ATTRIBUTE_DEFAULT, "Attribute %s of %s: invalid default value\n", @@ -2183,7 +2183,7 @@ xmlFreeAttributeTable(xmlAttributeTablePtr table) { * @attr: An attribute * * Build a copy of an attribute. - * + * * Returns the new xmlAttributePtr or NULL in case of error. */ static xmlAttributePtr @@ -2216,7 +2216,7 @@ xmlCopyAttribute(xmlAttributePtr attr) { * @table: An attribute table * * Build a copy of an attribute table. - * + * * Returns the new xmlAttributeTablePtr or NULL in case of error. */ xmlAttributeTablePtr @@ -2281,7 +2281,7 @@ xmlDumpAttributeDecl(xmlBufferPtr buf, xmlAttributePtr attr) { xmlDumpEnumeration(buf, attr->tree); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ATTRIBUTE struct corrupted invalid type\n", NULL); } @@ -2298,7 +2298,7 @@ xmlDumpAttributeDecl(xmlBufferPtr buf, xmlAttributePtr attr) { xmlBufferWriteChar(buf, " #FIXED"); break; default: - xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, + xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR, "Internal: ATTRIBUTE struct corrupted invalid def\n", NULL); } @@ -2428,7 +2428,7 @@ xmlAddNotationDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, */ if (xmlHashAddEntry(table, name, ret)) { #ifdef LIBXML_VALID_ENABLED - xmlErrValid(NULL, XML_DTD_NOTATION_REDEFINED, + xmlErrValid(NULL, XML_DTD_NOTATION_REDEFINED, "xmlAddNotationDecl: %s already defined\n", (const char *) name); #endif /* LIBXML_VALID_ENABLED */ @@ -2455,7 +2455,7 @@ xmlFreeNotationTable(xmlNotationTablePtr table) { * @nota: A notation * * Build a copy of a notation. - * + * * Returns the new xmlNotationPtr or NULL in case of error. */ static xmlNotationPtr @@ -2487,7 +2487,7 @@ xmlCopyNotation(xmlNotationPtr nota) { * @table: A notation table * * Build a copy of a notation table. - * + * * Returns the new xmlNotationTablePtr or NULL in case of error. */ xmlNotationTablePtr @@ -2603,7 +2603,7 @@ xmlFreeID(xmlIDPtr id) { * * Returns NULL if not, otherwise the new xmlIDPtr */ -xmlIDPtr +xmlIDPtr xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr) { xmlIDPtr ret; @@ -2712,7 +2712,7 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) { (xmlStrEqual(BAD_CAST "name", attr->name))) && ((elem != NULL) && (!xmlStrEqual(elem->name, BAD_CAST "input")))) return(1); - return(0); + return(0); } else { xmlAttributePtr attrDecl; @@ -2720,7 +2720,7 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) { if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(0); @@ -2763,7 +2763,7 @@ xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) { if (doc == NULL) return(-1); if (attr == NULL) return(-1); table = (xmlIDTablePtr) doc->ids; - if (table == NULL) + if (table == NULL) return(-1); if (attr == NULL) @@ -2791,7 +2791,7 @@ xmlRemoveID(xmlDocPtr doc, xmlAttrPtr attr) { * * Returns NULL if not found, otherwise the xmlAttrPtr defining the ID */ -xmlAttrPtr +xmlAttrPtr xmlGetID(xmlDocPtr doc, const xmlChar *ID) { xmlIDTablePtr table; xmlIDPtr id; @@ -2805,7 +2805,7 @@ xmlGetID(xmlDocPtr doc, const xmlChar *ID) { } table = (xmlIDTablePtr) doc->ids; - if (table == NULL) + if (table == NULL) return(NULL); id = xmlHashLookup(table, ID); @@ -2826,7 +2826,7 @@ xmlGetID(xmlDocPtr doc, const xmlChar *ID) { * Refs * * * ************************************************************************/ -typedef struct xmlRemoveMemo_t +typedef struct xmlRemoveMemo_t { xmlListPtr l; xmlAttrPtr ap; @@ -2834,7 +2834,7 @@ typedef struct xmlRemoveMemo_t typedef xmlRemoveMemo *xmlRemoveMemoPtr; -typedef struct xmlValidateMemo_t +typedef struct xmlValidateMemo_t { xmlValidCtxtPtr ctxt; const xmlChar *name; @@ -2917,7 +2917,7 @@ xmlDummyCompare(const void *data0 ATTRIBUTE_UNUSED, * * Returns NULL if not, otherwise the new xmlRefPtr */ -xmlRefPtr +xmlRefPtr xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr) { xmlRefPtr ret; @@ -3032,7 +3032,7 @@ xmlIsRef(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) { return(0); } else if (doc->type == XML_HTML_DOCUMENT_NODE) { /* TODO @@@ */ - return(0); + return(0); } else { xmlAttributePtr attrDecl; @@ -3069,7 +3069,7 @@ xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) { if (doc == NULL) return(-1); if (attr == NULL) return(-1); table = (xmlRefTablePtr) doc->refs; - if (table == NULL) + if (table == NULL) return(-1); if (attr == NULL) @@ -3095,7 +3095,7 @@ xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) { */ target.l = ref_list; target.ap = attr; - + /* Remove the supplied attr from our list */ xmlListWalk(ref_list, xmlWalkRemoveRef, &target); @@ -3112,11 +3112,11 @@ xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) { * @doc: pointer to the document * @ID: the ID value * - * Find the set of references for the supplied ID. + * Find the set of references for the supplied ID. * * Returns NULL if not found, otherwise node set for the ID. */ -xmlListPtr +xmlListPtr xmlGetRefs(xmlDocPtr doc, const xmlChar *ID) { xmlRefTablePtr table; @@ -3129,7 +3129,7 @@ xmlGetRefs(xmlDocPtr doc, const xmlChar *ID) { } table = (xmlRefTablePtr) doc->refs; - if (table == NULL) + if (table == NULL) return(NULL); return (xmlHashLookup(table, ID)); @@ -3194,7 +3194,7 @@ xmlGetDtdElementDesc2(xmlDtdPtr dtd, const xmlChar *name, int create) { if (dtd->doc != NULL) dict = dtd->doc->dict; - if (!create) + if (!create) return(NULL); /* * Create the Element table if needed. @@ -3442,7 +3442,7 @@ xmlValidateNameValue(const xmlChar *value) { cur += len; while ((IS_LETTER(val)) || (IS_DIGIT(val)) || (val == '.') || (val == '-') || - (val == '_') || (val == ':') || + (val == '_') || (val == ':') || (IS_COMBINING(val)) || (IS_EXTENDER(val))) { val = xmlStringCurrentChar(NULL, cur, &len); @@ -3472,7 +3472,7 @@ xmlValidateNamesValue(const xmlChar *value) { cur = value; val = xmlStringCurrentChar(NULL, cur, &len); cur += len; - + if (!IS_LETTER(val) && (val != '_') && (val != ':')) { return(0); @@ -3482,7 +3482,7 @@ xmlValidateNamesValue(const xmlChar *value) { cur += len; while ((IS_LETTER(val)) || (IS_DIGIT(val)) || (val == '.') || (val == '-') || - (val == '_') || (val == ':') || + (val == '_') || (val == ':') || (IS_COMBINING(val)) || (IS_EXTENDER(val))) { val = xmlStringCurrentChar(NULL, cur, &len); @@ -3505,7 +3505,7 @@ xmlValidateNamesValue(const xmlChar *value) { while ((IS_LETTER(val)) || (IS_DIGIT(val)) || (val == '.') || (val == '-') || - (val == '_') || (val == ':') || + (val == '_') || (val == ':') || (IS_COMBINING(val)) || (IS_EXTENDER(val))) { val = xmlStringCurrentChar(NULL, cur, &len); @@ -3525,7 +3525,7 @@ xmlValidateNamesValue(const xmlChar *value) { * Validate that the given value match Nmtoken production * * [ VC: Name Token ] - * + * * returns 1 if valid or 0 otherwise */ @@ -3538,17 +3538,17 @@ xmlValidateNmtokenValue(const xmlChar *value) { cur = value; val = xmlStringCurrentChar(NULL, cur, &len); cur += len; - + if (!IS_LETTER(val) && !IS_DIGIT(val) && (val != '.') && (val != '-') && - (val != '_') && (val != ':') && + (val != '_') && (val != ':') && (!IS_COMBINING(val)) && (!IS_EXTENDER(val))) return(0); while ((IS_LETTER(val)) || (IS_DIGIT(val)) || (val == '.') || (val == '-') || - (val == '_') || (val == ':') || + (val == '_') || (val == ':') || (IS_COMBINING(val)) || (IS_EXTENDER(val))) { val = xmlStringCurrentChar(NULL, cur, &len); @@ -3567,7 +3567,7 @@ xmlValidateNmtokenValue(const xmlChar *value) { * Validate that the given value match Nmtokens production * * [ VC: Name Token ] - * + * * returns 1 if valid or 0 otherwise */ @@ -3580,7 +3580,7 @@ xmlValidateNmtokensValue(const xmlChar *value) { cur = value; val = xmlStringCurrentChar(NULL, cur, &len); cur += len; - + while (IS_BLANK(val)) { val = xmlStringCurrentChar(NULL, cur, &len); cur += len; @@ -3588,14 +3588,14 @@ xmlValidateNmtokensValue(const xmlChar *value) { if (!IS_LETTER(val) && !IS_DIGIT(val) && (val != '.') && (val != '-') && - (val != '_') && (val != ':') && + (val != '_') && (val != ':') && (!IS_COMBINING(val)) && (!IS_EXTENDER(val))) return(0); while ((IS_LETTER(val)) || (IS_DIGIT(val)) || (val == '.') || (val == '-') || - (val == '_') || (val == ':') || + (val == '_') || (val == ':') || (IS_COMBINING(val)) || (IS_EXTENDER(val))) { val = xmlStringCurrentChar(NULL, cur, &len); @@ -3612,14 +3612,14 @@ xmlValidateNmtokensValue(const xmlChar *value) { if (!IS_LETTER(val) && !IS_DIGIT(val) && (val != '.') && (val != '-') && - (val != '_') && (val != ':') && + (val != '_') && (val != ':') && (!IS_COMBINING(val)) && (!IS_EXTENDER(val))) return(0); while ((IS_LETTER(val)) || (IS_DIGIT(val)) || (val == '.') || (val == '-') || - (val == '_') || (val == ':') || + (val == '_') || (val == ':') || (IS_COMBINING(val)) || (IS_EXTENDER(val))) { val = xmlStringCurrentChar(NULL, cur, &len); @@ -3675,7 +3675,7 @@ xmlValidateNotationDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDocPtr doc ATT * * [ VC: Name Token ] * Values of type NMTOKEN must match the Nmtoken production; values - * of type NMTOKENS must match Nmtokens. + * of type NMTOKENS must match Nmtokens. * * returns 1 if valid or 0 otherwise */ @@ -3752,7 +3752,7 @@ xmlValidateAttributeValue2(xmlValidCtxtPtr ctxt, xmlDocPtr doc, if ((ent == NULL) && (doc->standalone == 1)) { doc->standalone = 0; ent = xmlGetDocEntity(doc, value); - } + } if (ent == NULL) { xmlErrValidNode(ctxt, (xmlNodePtr) doc, XML_DTD_UNKNOWN_ENTITY, @@ -3863,7 +3863,7 @@ xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt, xmlDocPtr doc, if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(0); @@ -3948,7 +3948,7 @@ xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem, if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(0); @@ -4017,7 +4017,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, int val; CHECK_DTD; if(attr == NULL) return(1); - + /* Attribute Default Legal */ /* Enumeration */ if (attr->defaultValue != NULL) { @@ -4062,7 +4062,7 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlValidateAttributeIdCallback, &nbId); } if (nbId > 1) { - + xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET, "Element %s has %d ID attribute defined in the internal subset : %s\n", attr->elem, nbId, attr->name); @@ -4125,7 +4125,7 @@ xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlElementPtr tst; CHECK_DTD; - + if (elem == NULL) return(1); #if 0 @@ -4242,7 +4242,7 @@ xmlValidateElementDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, int xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc, - xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value) + xmlNodePtr elem, xmlAttrPtr attr, const xmlChar *value) { xmlAttributePtr attrDecl = NULL; int val; @@ -4255,7 +4255,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc, if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50); if (fullname == NULL) return(0); @@ -4339,7 +4339,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc, nota = xmlGetDtdNotationDesc(doc->intSubset, value); if (nota == NULL) nota = xmlGetDtdNotationDesc(doc->extSubset, value); - + if (nota == NULL) { xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION, "Value \"%s\" for attribute %s of %s is not a declared Notation\n", @@ -4432,7 +4432,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) { if (prefix != NULL) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(elem->name, prefix, fn, 50); if (fullname == NULL) { xmlVErrMemory(ctxt, "Validating namespace"); @@ -4536,7 +4536,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) { nota = xmlGetDtdNotationDesc(doc->intSubset, value); if (nota == NULL) nota = xmlGetDtdNotationDesc(doc->extSubset, value); - + if (nota == NULL) { if (ns->prefix != NULL) { xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION, @@ -4672,7 +4672,7 @@ xmlValidateElementType(xmlValidCtxtPtr ctxt) { NODE = xmlValidateSkipIgnorable(NODE); if ((NODE == NULL) && (CONT == NULL)) return(1); - if ((NODE == NULL) && + if ((NODE == NULL) && ((CONT->ocur == XML_ELEMENT_CONTENT_MULT) || (CONT->ocur == XML_ELEMENT_CONTENT_OPT))) { return(1); @@ -5181,7 +5181,7 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child, if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(cur->name, cur->ns->prefix, fn, 50); if (fullname == NULL) { @@ -5295,7 +5295,7 @@ fail: last = tmp; } if (cur->type == XML_CDATA_SECTION_NODE) { - /* + /* * E59 spaces in CDATA does not match the * nonterminal S */ @@ -5493,7 +5493,7 @@ xmlValidateCheckMixed(xmlValidCtxtPtr ctxt, } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ - xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, + xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -5517,7 +5517,7 @@ xmlValidateCheckMixed(xmlValidCtxtPtr ctxt, } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ - xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, + xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -5546,7 +5546,7 @@ xmlValidGetElemDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlElementPtr elemDecl = NULL; const xmlChar *prefix = NULL; - if ((ctxt == NULL) || (doc == NULL) || + if ((ctxt == NULL) || (doc == NULL) || (elem == NULL) || (elem->name == NULL)) return(NULL); if (extsubset != NULL) @@ -5924,7 +5924,7 @@ xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, return(0); /* - * If vstateNr is not zero that means continuous validation is + * If vstateNr is not zero that means continuous validation is * activated, do not try to check the content model at that level. */ if (ctxt->vstateNr == 0) { @@ -5967,7 +5967,7 @@ xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, if ((child->ns != NULL) && (child->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(child->name, child->ns->prefix, fn, 50); if (fullname == NULL) @@ -5985,7 +5985,7 @@ xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){ - xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, + xmlErrValid(NULL, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -6008,7 +6008,7 @@ xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, } else if ((cont->type != XML_ELEMENT_CONTENT_OR) || (cont->c1 == NULL) || (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) { - xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, + xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT, "Internal: MIXED struct corrupted\n", NULL); break; @@ -6088,7 +6088,7 @@ child_ok: } } else { xmlAttrPtr attrib; - + attrib = elem->properties; while (attrib != NULL) { if (xmlStrEqual(attrib->name, attr->name)) { @@ -6103,18 +6103,18 @@ child_ok: * allow to define the URI instead of the prefix :-( */ if (nameSpace == NULL) { - if (qualified < 0) + if (qualified < 0) qualified = 0; } else if (!xmlStrEqual(nameSpace->prefix, attr->prefix)) { - if (qualified < 1) + if (qualified < 1) qualified = 1; } else goto found; } else { /* * We should allow applications to define namespaces - * for their application even if the DTD doesn't + * for their application even if the DTD doesn't * carry one, otherwise, basically we would always * break. */ @@ -6187,7 +6187,7 @@ child_ok: } } } -found: +found: attr = attr->nexth; } return(ret); @@ -6234,7 +6234,7 @@ xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { if ((root->ns != NULL) && (root->ns->prefix != NULL)) { xmlChar fn[50]; xmlChar *fullname; - + fullname = xmlBuildQName(root->name, root->ns->prefix, fn, 50); if (fullname == NULL) { xmlVErrMemory(ctxt, NULL); @@ -6245,7 +6245,7 @@ xmlValidateRoot(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { xmlFree(fullname); if (ret == 1) goto name_ok; - } + } if ((xmlStrEqual(doc->intSubset->name, BAD_CAST "HTML")) && (xmlStrEqual(root->name, BAD_CAST "html"))) goto name_ok; @@ -6266,7 +6266,7 @@ name_ok: * @doc: a document instance * @elem: an element instance * - * Try to validate the subtree under an element + * Try to validate the subtree under an element * * returns 1 if valid or 0 otherwise */ @@ -6443,7 +6443,7 @@ xmlValidateCheckRefCallback(xmlListPtr ref_list, xmlValidCtxtPtr ctxt, memo.name = name; xmlListWalk(ref_list, xmlWalkValidateList, &memo); - + } /** @@ -6455,7 +6455,7 @@ xmlValidateCheckRefCallback(xmlListPtr ref_list, xmlValidCtxtPtr ctxt, * incremental validation steps have been completed * * basically it does the following checks described by the XML Rec - * + * * Check all the IDREF/IDREFS attributes definition for validity * * returns 1 if valid or 0 otherwise @@ -6468,7 +6468,7 @@ xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { if (ctxt == NULL) return(0); if (doc == NULL) { - xmlErrValid(ctxt, XML_DTD_NO_DOC, + xmlErrValid(ctxt, XML_DTD_NO_DOC, "xmlValidateDocumentFinal: doc == NULL\n", NULL); return(0); } @@ -6580,7 +6580,7 @@ xmlValidateAttributeCallback(xmlAttributePtr cur, xmlValidCtxtPtr ctxt, case XML_ATTRIBUTE_ENTITIES: case XML_ATTRIBUTE_NOTATION: if (cur->defaultValue != NULL) { - + ret = xmlValidateAttributeValue2(ctxt, ctxt->doc, cur->name, cur->atype, cur->defaultValue); if ((ret == 0) && (ctxt->valid == 1)) @@ -6637,9 +6637,9 @@ xmlValidateAttributeCallback(xmlAttributePtr cur, xmlValidCtxtPtr ctxt, * subsets have been parsed * * basically it does the following checks described by the XML Rec - * - check that ENTITY and ENTITIES type attributes default or + * - check that ENTITY and ENTITIES type attributes default or * possible values matches one of the defined entities. - * - check that NOTATION type attributes default or + * - check that NOTATION type attributes default or * possible values matches one of the defined notations. * * returns 1 if valid or 0 if invalid and -1 if not well-formed @@ -6782,17 +6782,17 @@ xmlValidGetPotentialChildren(xmlElementContent *ctree, const xmlChar **list, if (*len >= max) return(*len); switch (ctree->type) { - case XML_ELEMENT_CONTENT_PCDATA: + case XML_ELEMENT_CONTENT_PCDATA: for (i = 0; i < *len;i++) if (xmlStrEqual(BAD_CAST "#PCDATA", list[i])) return(*len); list[(*len)++] = BAD_CAST "#PCDATA"; break; - case XML_ELEMENT_CONTENT_ELEMENT: + case XML_ELEMENT_CONTENT_ELEMENT: for (i = 0; i < *len;i++) if (xmlStrEqual(ctree->name, list[i])) return(*len); list[(*len)++] = ctree->name; break; - case XML_ELEMENT_CONTENT_SEQ: + case XML_ELEMENT_CONTENT_SEQ: xmlValidGetPotentialChildren(ctree->c1, list, len, max); xmlValidGetPotentialChildren(ctree->c2, list, len, max); break; @@ -6801,7 +6801,7 @@ xmlValidGetPotentialChildren(xmlElementContent *ctree, const xmlChar **list, xmlValidGetPotentialChildren(ctree->c2, list, len, max); break; } - + return(*len); } @@ -6846,16 +6846,16 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, const xmlChar *elements[256]; int nb_elements = 0, i; const xmlChar *name; - + xmlNode *ref_node; xmlNode *parent; xmlNode *test_node; - + xmlNode *prev_next; xmlNode *next_prev; xmlNode *parent_childs; xmlNode *parent_last; - + xmlElement *element_desc; if (prev == NULL && next == NULL) @@ -6880,7 +6880,7 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, element_desc = xmlGetDtdElementDesc(parent->doc->extSubset, parent->name); if (element_desc == NULL) return(-1); - + /* * Do a backup of the current tree structure */ @@ -6891,16 +6891,16 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, /* * Creates a dummy node and insert it into the tree - */ + */ test_node = xmlNewDocNode (ref_node->doc, NULL, BAD_CAST "", NULL); test_node->parent = parent; test_node->prev = prev; test_node->next = next; name = test_node->name; - + if (prev) prev->next = test_node; else parent->children = test_node; - + if (next) next->prev = test_node; else parent->last = test_node; @@ -6910,7 +6910,7 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, */ nb_elements = xmlValidGetPotentialChildren(element_desc->content, elements, &nb_elements, 256); - + for (i = 0;i < nb_elements;i++) { test_node->name = elements[i]; if (xmlValidateOneElement(&vctxt, parent->doc, parent)) { diff --git a/reactos/lib/3rdparty/libxml2/xinclude.c b/reactos/lib/3rdparty/libxml2/xinclude.c index ab6409688d0..a0a19cfc056 100644 --- a/reactos/lib/3rdparty/libxml2/xinclude.c +++ b/reactos/lib/3rdparty/libxml2/xinclude.c @@ -408,7 +408,7 @@ xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) { * xmlXIncludeParseFile: * @ctxt: the XInclude context * @URL: the URL or file path - * + * * parse a document for XInclude */ static xmlDocPtr @@ -437,7 +437,7 @@ xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { } xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD); - + inputStream = xmlLoadExternalEntity(URL, NULL, pctxt); if (inputStream == NULL) { xmlFreeParserCtxt(pctxt); @@ -465,7 +465,7 @@ xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { pctxt->myDoc = NULL; } xmlFreeParserCtxt(pctxt); - + return(ret); } @@ -473,7 +473,7 @@ xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) { * xmlXIncludeAddNode: * @ctxt: the XInclude context * @cur: the new node - * + * * Add a new node to process to an XInclude context */ static int @@ -504,7 +504,7 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); if (href == NULL) { href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */ - if (href == NULL) + if (href == NULL) return(-1); local = 1; } @@ -636,7 +636,7 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { * @ctxt: the XInclude context * @doc: the new document * @url: the associated URL - * + * * The XInclude recursive nature is handled at this point. */ static void @@ -726,7 +726,7 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, * @ctxt: the XInclude context * @txt: the new text node * @url: the associated URL - * + * * Add a new txtument to the list */ static void @@ -781,7 +781,7 @@ xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) { * @target: the document target * @source: the document source * @elem: the element - * + * * Make a copy of the node while preserving the XInclude semantic * of the Infoset copy */ @@ -805,7 +805,7 @@ xmlXIncludeCopyNode(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, * @target: the document target * @source: the document source * @elem: the element list - * + * * Make a copy of the node list while preserving the XInclude semantic * of the Infoset copy */ @@ -844,11 +844,11 @@ xmlXIncludeCopyNodeList(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, static xmlNodePtr xmlXIncludeGetNthChild(xmlNodePtr cur, int no) { int i; - if (cur == NULL) + if (cur == NULL) return(cur); cur = cur->children; for (i = 0;i <= no;cur = cur->next) { - if (cur == NULL) + if (cur == NULL) return(cur); if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_DOCUMENT_NODE) || @@ -956,7 +956,7 @@ xmlXIncludeCopyRange(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target, /* prune and return full set */ if (level == lastLevel) xmlAddNextSibling(last, tmp); - else + else xmlAddChild(last, tmp); return(list); } else { /* ending node not a text node */ @@ -1260,7 +1260,7 @@ xmlXIncludeMergeEntity(xmlEntityPtr ent, xmlXIncludeMergeDataPtr data, if (prev != NULL) { if (ent->etype != prev->etype) goto error; - + if ((ent->SystemID != NULL) && (prev->SystemID != NULL)) { if (!xmlStrEqual(ent->SystemID, prev->SystemID)) goto error; @@ -1360,7 +1360,7 @@ xmlXIncludeMergeEntities(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, * @ctxt: the XInclude context * @url: the associated URL * @nr: the xinclude node number - * + * * Load the document, and store the result in the XInclude context * * Returns 0 in case of success, -1 in case of failure @@ -1384,7 +1384,7 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { */ uri = xmlParseURI((const char *)url); if (uri == NULL) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "invalid value URI %s\n", url); return(-1); @@ -1401,7 +1401,7 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { URL = xmlSaveUri(uri); xmlFreeURI(uri); if (URL == NULL) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "invalid value URI %s\n", url); if (fragment != NULL) @@ -1516,7 +1516,7 @@ loaded: ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc, doc, doc->children); } - } + } #ifdef LIBXML_XPTR_ENABLED else { /* @@ -1534,7 +1534,7 @@ loaded: xptrctxt = xmlXPtrNewContext(doc, NULL, NULL); } if (xptrctxt == NULL) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_FAILED, "could not create XPointer context\n", NULL); xmlFree(URL); @@ -1560,7 +1560,7 @@ loaded: case XPATH_POINT: case XPATH_USERS: case XPATH_XSLT_TREE: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer is not a range: #%s\n", fragment); @@ -1613,14 +1613,14 @@ loaded: } case XML_ATTRIBUTE_NODE: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer selects an attribute: #%s\n", fragment); set->nodeTab[i] = NULL; continue; case XML_NAMESPACE_DECL: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer selects a namespace: #%s\n", fragment); @@ -1635,7 +1635,7 @@ loaded: case XML_ENTITY_DECL: case XML_XINCLUDE_START: case XML_XINCLUDE_END: - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_XPTR_RESULT, "XPointer selects unexpected nodes: #%s\n", fragment); @@ -1679,7 +1679,7 @@ loaded: */ curBase = xmlBuildRelativeURI(URL, ctxt->base); if (curBase == NULL) { /* Error return */ - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "trying to build relative URI from %s\n", URL); } else { @@ -1720,7 +1720,7 @@ loaded: xmlChar *relBase; relBase = xmlBuildURI(xmlBase, base); if (relBase == NULL) { /* error */ - xmlXIncludeErr(ctxt, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "trying to rebuild base from %s\n", @@ -1757,7 +1757,7 @@ loaded: * @ctxt: the XInclude context * @url: the associated URL * @nr: the xinclude node number - * + * * Load the content, and store the result in the XInclude context * * Returns 0 in case of success, -1 in case of failure @@ -1801,7 +1801,7 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) { * directly through ctxt->doc. */ if (URL[0] == 0) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_TEXT_DOCUMENT, "text serialization of document not available\n", NULL); xmlFree(URL); @@ -1894,7 +1894,7 @@ loaded: * @ctxt: the XInclude context * @fallback: the fallback node * @nr: the xinclude node number - * + * * Load the content of the fallback node, and store the result * in the XInclude context * @@ -1904,7 +1904,7 @@ static int xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { xmlXIncludeCtxtPtr newctxt; int ret = 0; - + if ((fallback == NULL) || (ctxt == NULL)) return(-1); if (fallback->children != NULL) { @@ -1989,7 +1989,7 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF); if (href == NULL) { href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */ - if (href == NULL) + if (href == NULL) return(-1); } parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); @@ -2034,7 +2034,7 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { xmlFree(eschref); } if (URI == NULL) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_HREF_URI, "failed build URL\n", NULL); if (parse != NULL) xmlFree(parse); @@ -2067,7 +2067,7 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { * Restore the original base before checking for fallback */ ctxt->base = oldBase; - + if (ret < 0) { xmlNodePtr children; @@ -2085,14 +2085,14 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) { ((xmlStrEqual(children->ns->href, XINCLUDE_NS)) || (xmlStrEqual(children->ns->href, XINCLUDE_OLD_NS)))) { ret = xmlXIncludeLoadFallback(ctxt, children, nr); - if (ret == 0) + if (ret == 0) break; } children = children->next; } } if (ret < 0) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_NO_FALLBACK, "could not load %s, and no fallback was found\n", URI); @@ -2161,7 +2161,7 @@ xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) { tmp = tmp->next; } if (nb_elem > 1) { - xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, + xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref, XML_XINCLUDE_MULTIPLE_ROOT, "XInclude error: would result in multiple root nodes\n", NULL); @@ -2208,7 +2208,7 @@ xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) { } } - + return(0); } @@ -2399,7 +2399,7 @@ xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) { ctxt->parseFlags = flags; return(0); } - + /** * xmlXIncludeProcessFlags: * @doc: an XML document diff --git a/reactos/lib/3rdparty/libxml2/xlink.c b/reactos/lib/3rdparty/libxml2/xlink.c index 0d9be738cd2..3566e06fafd 100644 --- a/reactos/lib/3rdparty/libxml2/xlink.c +++ b/reactos/lib/3rdparty/libxml2/xlink.c @@ -47,7 +47,7 @@ * Default setting and related functions * * * ****************************************************************/ - + static xlinkHandlerPtr xlinkDefaultHandler = NULL; static xlinkNodeDetectFunc xlinkDefaultDetect = NULL; @@ -93,7 +93,7 @@ xlinkGetDefaultDetect (void) { * * Set the default xlink detection routine */ -void +void xlinkSetDefaultDetect (xlinkNodeDetectFunc func) { xlinkDefaultDetect = func; } @@ -104,7 +104,7 @@ xlinkSetDefaultDetect (xlinkNodeDetectFunc func) { * * ****************************************************************/ - + /** * xlinkIsLink: * @doc: the document containing the node @@ -119,7 +119,7 @@ xlinkSetDefaultDetect (xlinkNodeDetectFunc func) { * Returns the xlinkType of the node (XLINK_TYPE_NONE if there is no * link detected. */ -xlinkType +xlinkType xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) { xmlChar *type = NULL, *role = NULL; xlinkType ret = XLINK_TYPE_NONE; @@ -157,7 +157,7 @@ xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) { xlink = xmlSearchNs(doc, node, XLINK_NAMESPACE); if (xlink == NULL) { /* Humm, fallback method */ - if (xmlStrEqual(role, BAD_CAST"xlink:external-linkset")) + if (xmlStrEqual(role, BAD_CAST"xlink:external-linkset")) ret = XLINK_TYPE_EXTENDED_SET; } else { xmlChar buf[200]; diff --git a/reactos/lib/3rdparty/libxml2/xmlIO.c b/reactos/lib/3rdparty/libxml2/xmlIO.c index a000e8c9b42..8c39d12fef9 100644 --- a/reactos/lib/3rdparty/libxml2/xmlIO.c +++ b/reactos/lib/3rdparty/libxml2/xmlIO.c @@ -376,7 +376,7 @@ __xmlIOErr(int domain, int code, const char *extra) idx = 0; if (code >= XML_IO_UNKNOWN) idx = code - XML_IO_UNKNOWN; if (idx >= (sizeof(IOerr) / sizeof(IOerr[0]))) idx = 0; - + __xmlSimpleError(domain, code, NULL, IOerr[idx], extra); } @@ -428,7 +428,7 @@ __xmlLoaderErr(void *ctx, const char *msg, const char *filename) XML_IO_LOAD_ERROR, level, NULL, 0, filename, NULL, NULL, 0, 0, msg, filename); - + } /************************************************************************ @@ -455,7 +455,7 @@ xmlNormalizeWindowsPath(const xmlChar *path) * xmlCleanupInputCallbacks: * * clears the entire input callback table. this includes the - * compiled-in I/O. + * compiled-in I/O. */ void xmlCleanupInputCallbacks(void) @@ -480,7 +480,7 @@ xmlCleanupInputCallbacks(void) * xmlPopInputCallbacks: * * Clear the top input callback from the input stack. this includes the - * compiled-in I/O. + * compiled-in I/O. * * Returns the number of input callback registered or -1 in case of error. */ @@ -492,7 +492,7 @@ xmlPopInputCallbacks(void) if (xmlInputCallbackNr <= 0) return(-1); - + xmlInputCallbackNr--; xmlInputCallbackTable[xmlInputCallbackNr].matchcallback = NULL; xmlInputCallbackTable[xmlInputCallbackNr].opencallback = NULL; @@ -507,7 +507,7 @@ xmlPopInputCallbacks(void) * xmlCleanupOutputCallbacks: * * clears the entire output callback table. this includes the - * compiled-in I/O callbacks. + * compiled-in I/O callbacks. */ void xmlCleanupOutputCallbacks(void) @@ -681,7 +681,7 @@ xmlFileOpen_real (const char *filename) { #else path = &filename[7]; #endif - } else + } else path = filename; if (path == NULL) @@ -754,7 +754,7 @@ xmlFileOpenW (const char *filename) { #else path = &filename[7]; #endif - } else + } else path = filename; if (path == NULL) @@ -779,7 +779,7 @@ xmlFileOpenW (const char *filename) { int xmlFileRead (void * context, char * buffer, int len) { int ret; - if ((context == NULL) || (buffer == NULL)) + if ((context == NULL) || (buffer == NULL)) return(-1); ret = fread(&buffer[0], 1, len, (FILE *) context); if (ret < 0) xmlIOErr(0, "fread()"); @@ -801,7 +801,7 @@ static int xmlFileWrite (void * context, const char * buffer, int len) { int items; - if ((context == NULL) || (buffer == NULL)) + if ((context == NULL) || (buffer == NULL)) return(-1); items = fwrite(&buffer[0], len, 1, (FILE *) context); if ((items == 0) && (ferror((FILE *) context))) { @@ -910,7 +910,7 @@ xmlGzfileOpen_real (const char *filename) { #else path = &filename[7]; #endif - } else + } else path = filename; if (path == NULL) @@ -980,7 +980,7 @@ xmlGzfileOpenW (const char *filename, int compression) { #else path = &filename[7]; #endif - } else + } else path = filename; if (path == NULL) @@ -1108,7 +1108,7 @@ append_reverse_ulong( xmlZMemBuff * buff, unsigned long data ) { /* ** This is plagiarized from putLong in gzio.c (zlib source) where - ** the number "4" is hardcoded. If zlib is ever patched to + ** the number "4" is hardcoded. If zlib is ever patched to ** support 64 bit file sizes, this code would need to be patched ** as well. */ @@ -1160,7 +1160,7 @@ xmlFreeZMemBuff( xmlZMemBuffPtr buff ) { * * Create a memory buffer to hold the compressed XML document. The * compressed document in memory will end up being identical to what - * would be created if gzopen/gzwrite/gzclose were being used to + * would be created if gzopen/gzwrite/gzclose were being used to * write the document to disk. The code for the header/trailer data to * the compression is plagiarized from the zlib source files. */ @@ -1209,7 +1209,7 @@ xmlCreateZMemBuff( int compression ) { buff->crc = crc32( 0L, Z_NULL, 0 ); hdr_lgth = snprintf( (char *)buff->zbuff, buff->size, "%c%c%c%c%c%c%c%c%c%c", - GZ_MAGIC1, GZ_MAGIC2, Z_DEFLATED, + GZ_MAGIC1, GZ_MAGIC2, Z_DEFLATED, 0, 0, 0, 0, 0, 0, LXML_ZLIB_OS_CODE ); buff->zctrl.next_out = buff->zbuff + hdr_lgth; buff->zctrl.avail_out = buff->size - hdr_lgth; @@ -1247,11 +1247,11 @@ xmlZMemBuffExtend( xmlZMemBuffPtr buff, size_t ext_amt ) { new_size = buff->size + ext_amt; #ifdef DEBUG_HTTP - if ( cur_used > new_size ) + if ( cur_used > new_size ) xmlGenericError( xmlGenericErrorContext, "xmlZMemBuffExtend: %s\n%s %d bytes.\n", "Buffer overwrite detected during compressed memory", - "buffer extension. Overflowed by", + "buffer extension. Overflowed by", (cur_used - new_size ) ); #endif @@ -1389,7 +1389,7 @@ xmlZMemBuffGetContent( xmlZMemBuffPtr buff, char ** data_ref ) { "Error flushing zlib buffers. Error code", z_err ); xmlIOErr(XML_IO_WRITE, (const char *) msg); } - + return ( zlgth ); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -1520,7 +1520,7 @@ xmlIOHTTPOpenW(const char *post_uri, int compression) return (ctxt); } #endif /* LIBXML_OUTPUT_ENABLED */ - + #ifdef LIBXML_OUTPUT_ENABLED /** * xmlIOHTTPDfltOpenW @@ -1548,7 +1548,7 @@ xmlIOHTTPDfltOpenW( const char * post_uri ) { * * Returns the number of bytes written */ -int +int xmlIOHTTPRead(void * context, char * buffer, int len) { if ((buffer == NULL) || (len < 0)) return(-1); return(xmlNanoHTTPRead(context, &buffer[0], len)); @@ -1568,7 +1568,7 @@ xmlIOHTTPRead(void * context, char * buffer, int len) { */ static int -xmlIOHTTPWrite( void * context, const char * buffer, int len ) { +xmlIOHTTPWrite( void * context, const char * buffer, int len ) { xmlIOHTTPWriteCtxtPtr ctxt = context; @@ -1580,7 +1580,7 @@ xmlIOHTTPWrite( void * context, const char * buffer, int len ) { /* Use gzwrite or fwrite as previously setup in the open call */ #ifdef HAVE_ZLIB_H - if ( ctxt->compression > 0 ) + if ( ctxt->compression > 0 ) len = xmlZMemBuffAppend( ctxt->doc_buff, buffer, len ); else @@ -1671,7 +1671,7 @@ xmlIOHTTPCloseWrite( void * context, const char * http_mthd ) { else { http_ctxt = xmlNanoHTTPMethod( ctxt->uri, http_mthd, http_content, - &content_type, content_encoding, + &content_type, content_encoding, content_lgth ); if ( http_ctxt != NULL ) { @@ -1690,7 +1690,7 @@ xmlIOHTTPCloseWrite( void * context, const char * http_mthd ) { /* ** Since either content or reply may be gzipped, - ** dump them to separate files instead of the + ** dump them to separate files instead of the ** standard error context. */ @@ -1827,7 +1827,7 @@ xmlIOFTPOpen (const char *filename) { * * Returns the number of bytes written */ -int +int xmlIOFTPRead(void * context, char * buffer, int len) { if ((buffer == NULL) || (len < 0)) return(-1); return(xmlNanoFTPRead(context, &buffer[0], len)); @@ -2064,7 +2064,7 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) { /* * This call is designed to initiate the encoder state */ - xmlCharEncOutFunc(encoder, ret->conv, NULL); + xmlCharEncOutFunc(encoder, ret->conv, NULL); } else ret->conv = NULL; ret->writecallback = NULL; @@ -2380,7 +2380,7 @@ xmlOutputBufferCreateFilename(const char *URI, /** * xmlParserInputBufferCreateFile: - * @file: a FILE* + * @file: a FILE* * @enc: the charset encoding if known * * Create a buffered parser input for the progressive parsing of a FILE * @@ -2410,7 +2410,7 @@ xmlParserInputBufferCreateFile(FILE *file, xmlCharEncoding enc) { #ifdef LIBXML_OUTPUT_ENABLED /** * xmlOutputBufferCreateFile: - * @file: a FILE* + * @file: a FILE* * @encoder: the encoding converter or NULL * * Create a buffered output for the progressive saving to a FILE * @@ -2549,7 +2549,7 @@ xmlParserInputBufferCreateStatic(const char *mem, int size, * @fd: a file descriptor number * @encoder: the encoding converter or NULL * - * Create a buffered output for the progressive saving + * Create a buffered output for the progressive saving * to a file descriptor * * Returns the new parser output or NULL @@ -2941,12 +2941,12 @@ xmlOutputBufferWrite(xmlOutputBufferPtr out, int len, const char *buf) { * second write the stuff to the I/O channel */ if (out->encoder != NULL) { - ret = out->writecallback(out->context, + ret = out->writecallback(out->context, (const char *)out->conv->content, nbchars); if (ret >= 0) xmlBufferShrink(out->conv, ret); } else { - ret = out->writecallback(out->context, + ret = out->writecallback(out->context, (const char *)out->buffer->content, nbchars); if (ret >= 0) xmlBufferShrink(out->buffer, ret); @@ -2991,7 +2991,7 @@ xmlEscapeContent(unsigned char* out, int *outlen, const unsigned char* inend; inend = in + (*inlen); - + while ((in < inend) && (out < outend)) { if (*in == '<') { if (outend - out < 4) break; @@ -3023,7 +3023,7 @@ xmlEscapeContent(unsigned char* out, int *outlen, *out++ = (unsigned char) *in; } ++in; - } + } *outlen = out - outstart; *inlen = in - base; return(0); @@ -3122,12 +3122,12 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str, * second write the stuff to the I/O channel */ if (out->encoder != NULL) { - ret = out->writecallback(out->context, + ret = out->writecallback(out->context, (const char *)out->conv->content, nbchars); if (ret >= 0) xmlBufferShrink(out->conv, ret); } else { - ret = out->writecallback(out->context, + ret = out->writecallback(out->context, (const char *)out->buffer->content, nbchars); if (ret >= 0) xmlBufferShrink(out->buffer, ret); @@ -3168,7 +3168,7 @@ done: int xmlOutputBufferWriteString(xmlOutputBufferPtr out, const char *str) { int len; - + if ((out == NULL) || (out->error)) return(-1); if (str == NULL) return(-1); @@ -3385,7 +3385,7 @@ static int xmlSysIDExists(const char *URL) { #else path = &URL[7]; #endif - } else + } else path = URL; ret = stat(path, &info); if (ret == 0) diff --git a/reactos/lib/3rdparty/libxml2/xmlcatalog.c b/reactos/lib/3rdparty/libxml2/xmlcatalog.c index 0597e888b83..f06e31985f4 100644 --- a/reactos/lib/3rdparty/libxml2/xmlcatalog.c +++ b/reactos/lib/3rdparty/libxml2/xmlcatalog.c @@ -56,7 +56,7 @@ static char *filename = NULL; * @prompt: the prompt value * * Read a string - * + * * Returns a pointer to it or NULL on EOF the caller is expected to * free the returned string. */ @@ -135,7 +135,7 @@ static void usershell(void) { arg[i++] = *cur++; } arg[i] = 0; - if (i != 0) + if (i != 0) nbargs++; /* @@ -157,7 +157,7 @@ static void usershell(void) { i++; cur++; } - } else if (*cur == '"') { + } else if (*cur == '"') { cur++; argv[i] = cur; while ((*cur != 0) && (*cur != '"')) cur++; @@ -296,7 +296,7 @@ static void usershell(void) { printf("\tdebug: increase the verbosity level\n"); printf("\tquiet: decrease the verbosity level\n"); printf("\texit: quit the shell\n"); - } + } free(cmdline); /* not xmlFree here ! */ } } @@ -507,7 +507,7 @@ int main(int argc, char **argv) { exit_value = 2; noout = 0; } else { - + xmlACatalogDump(super, out); fclose(out); } @@ -544,14 +544,14 @@ int main(int argc, char **argv) { } } } - + } else if (shell) { usershell(); } else { for (i++; i < argc; i++) { xmlURIPtr uri; xmlChar *ans; - + uri = xmlParseURI(argv[i]); if (uri == NULL) { ans = xmlCatalogResolvePublic((const xmlChar *) argv[i]); diff --git a/reactos/lib/3rdparty/libxml2/xmllint.c b/reactos/lib/3rdparty/libxml2/xmllint.c index 0cbc3d19744..6ed8c49b369 100644 --- a/reactos/lib/3rdparty/libxml2/xmllint.c +++ b/reactos/lib/3rdparty/libxml2/xmllint.c @@ -230,7 +230,7 @@ void parsePath(const xmlChar *path) { xmlExternalEntityLoader defaultEntityLoader = NULL; -static xmlParserInputPtr +static xmlParserInputPtr xmllintExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt) { xmlParserInputPtr ret; @@ -371,7 +371,7 @@ myStrdupFunc(const char *str) * * ************************************************************************/ -#ifndef HAVE_GETTIMEOFDAY +#ifndef HAVE_GETTIMEOFDAY #ifdef HAVE_SYS_TIMEB_H #ifdef HAVE_SYS_TIME_H #ifdef HAVE_FTIME @@ -518,7 +518,7 @@ xmlHTMLEncodeSend(void) { /** * xmlHTMLPrintFileInfo: * @input: an xmlParserInputPtr input - * + * * Displays the associated file and line informations for the current input */ @@ -542,7 +542,7 @@ xmlHTMLPrintFileInfo(xmlParserInputPtr input) { /** * xmlHTMLPrintFileContext: * @input: an xmlParserInputPtr input - * + * * Displays current context within the input content for error tracking */ @@ -567,7 +567,7 @@ xmlHTMLPrintFileContext(xmlParserInputPtr input) { n = 0; while ((*cur != 0) && (*cur != '\n') && (*cur != '\r') && (n < 79)) { len = strlen(buffer); - snprintf(&buffer[len], sizeof(buffer) - len, "%c", + snprintf(&buffer[len], sizeof(buffer) - len, "%c", (unsigned char) *cur++); n++; } @@ -593,7 +593,7 @@ xmlHTMLPrintFileContext(xmlParserInputPtr input) { * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an error messages, gives file, line, position and * extra parameters. */ @@ -610,7 +610,7 @@ xmlHTMLError(void *ctx, const char *msg, ...) if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) { input = ctxt->inputTab[ctxt->inputNr - 2]; } - + xmlHTMLPrintFileInfo(input); xmlGenericError(xmlGenericErrorContext, "error: "); @@ -630,7 +630,7 @@ xmlHTMLError(void *ctx, const char *msg, ...) * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a warning messages, gives file, line, position and * extra parameters. */ @@ -647,13 +647,13 @@ xmlHTMLWarning(void *ctx, const char *msg, ...) if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) { input = ctxt->inputTab[ctxt->inputNr - 2]; } - + xmlHTMLPrintFileInfo(input); - + xmlGenericError(xmlGenericErrorContext, "warning: "); va_start(args, msg); - len = strlen(buffer); + len = strlen(buffer); vsnprintf(&buffer[len], sizeof(buffer) - len, msg, args); va_end(args); xmlHTMLEncodeSend(); @@ -668,7 +668,7 @@ xmlHTMLWarning(void *ctx, const char *msg, ...) * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format an validity error messages, gives file, * line, position and extra parameters. */ @@ -684,7 +684,7 @@ xmlHTMLValidityError(void *ctx, const char *msg, ...) input = ctxt->input; if ((input->filename == NULL) && (ctxt->inputNr > 1)) input = ctxt->inputTab[ctxt->inputNr - 2]; - + xmlHTMLPrintFileInfo(input); xmlGenericError(xmlGenericErrorContext, "validity error: "); @@ -705,7 +705,7 @@ xmlHTMLValidityError(void *ctx, const char *msg, ...) * @ctx: an XML parser context * @msg: the message to display/transmit * @...: extra parameters for the message display - * + * * Display and format a validity warning messages, gives file, line, * position and extra parameters. */ @@ -723,10 +723,10 @@ xmlHTMLValidityWarning(void *ctx, const char *msg, ...) input = ctxt->inputTab[ctxt->inputNr - 2]; xmlHTMLPrintFileInfo(input); - + xmlGenericError(xmlGenericErrorContext, "validity warning: "); va_start(args, msg); - len = strlen(buffer); + len = strlen(buffer); vsnprintf(&buffer[len], sizeof(buffer) - len, msg, args); va_end(args); xmlHTMLEncodeSend(); @@ -748,7 +748,7 @@ xmlHTMLValidityWarning(void *ctx, const char *msg, ...) * @prompt: the prompt value * * Read a string - * + * * Returns a pointer to it or NULL on EOF the caller is expected to * free the returned string. */ @@ -973,7 +973,7 @@ resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xm return(NULL); /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - + fprintf(stdout, "SAX.resolveEntity("); if (publicId != NULL) fprintf(stdout, "%s", (char *)publicId); @@ -1028,8 +1028,8 @@ getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) /** * entityDeclDebug: * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type + * @name: the entity name + * @type: the entity type * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). @@ -1058,8 +1058,8 @@ const xmlChar *nullstr = BAD_CAST "(null)"; /** * attributeDeclDebug: * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type + * @name: the attribute name + * @type: the attribute type * * An attribute definition has been parsed */ @@ -1083,8 +1083,8 @@ attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem, /** * elementDeclDebug: * @ctxt: An XML parser context - * @name: the element name - * @type: the element type + * @name: the element name + * @type: the element type * @content: the element value (without processing). * * An element definition has been parsed @@ -1270,7 +1270,7 @@ charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) * @ctxt: An XML parser context * @name: The entity name * - * called when an entity reference is detected. + * called when an entity reference is detected. */ static void referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) @@ -1506,7 +1506,7 @@ startElementNsDebug(void *ctx ATTRIBUTE_UNUSED, else fprintf(stdout, ", '%s'", (char *) URI); fprintf(stdout, ", %d", nb_namespaces); - + if (namespaces != NULL) { for (i = 0;i < nb_namespaces * 2;i++) { fprintf(stdout, ", xmlns"); @@ -1669,7 +1669,7 @@ testSAX(const char *filename) { goto error; } inputPush(ctxt, inputStream); - + /* do the parsing */ xmlParseDocument(ctxt); @@ -1707,8 +1707,8 @@ static void processNode(xmlTextReaderPtr reader) { value = xmlTextReaderConstValue(reader); - - printf("%d %d %s %d %d", + + printf("%d %d %s %d %d", xmlTextReaderDepth(reader), type, name, @@ -1724,7 +1724,7 @@ static void processNode(xmlTextReaderPtr reader) { if (patternc) { xmlChar *path = NULL; int match = -1; - + if (type == XML_READER_TYPE_ELEMENT) { /* do the check only on element start */ match = xmlPatternMatch(patternc, xmlTextReaderCurrentNode(reader)); @@ -1756,9 +1756,9 @@ static void processNode(xmlTextReaderPtr reader) { " pattern %s node %s\n", pattern, path); } - - } + + } if ((type == XML_READER_TYPE_END_ELEMENT) || ((type == XML_READER_TYPE_ELEMENT) && (empty))) { ret = xmlStreamPop(patstream); @@ -1785,7 +1785,7 @@ static void streamFile(char *filename) { xmlParserInputBufferPtr input = NULL; if (memory) { - if (stat(filename, &info) < 0) + if (stat(filename, &info) < 0) return; if ((fd = open(filename, O_RDONLY)) < 0) return; @@ -2027,7 +2027,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if ((timing) && (!repeat)) startTimer(); - + #ifdef LIBXML_TREE_ENABLED if (filename == NULL) { @@ -2153,7 +2153,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { ctxt = xmlNewParserCtxt(); else ctxt = rectxt; - if (ctxt == NULL) { + if (ctxt == NULL) { doc = NULL; } else { ctxt->sax->error = xmlHTMLError; @@ -2171,7 +2171,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { int fd; struct stat info; const char *base; - if (stat(filename, &info) < 0) + if (stat(filename, &info) < 0) return; if ((fd = open(filename, O_RDONLY)) < 0) return; @@ -2185,7 +2185,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { else doc = xmlCtxtReadMemory(rectxt, (char *) base, info.st_size, filename, NULL, options); - + munmap((char *) base, info.st_size); #endif #ifdef LIBXML_VALID_ENABLED @@ -2196,7 +2196,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { ctxt = xmlNewParserCtxt(); else ctxt = rectxt; - if (ctxt == NULL) { + if (ctxt == NULL) { doc = NULL; } else { doc = xmlCtxtReadFile(ctxt, filename, NULL, options); @@ -2264,7 +2264,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { /* * shell interaction */ - if (shell) + if (shell) xmlShell(doc, filename, xmlShellReadline, stdout); #endif #endif @@ -2315,7 +2315,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } } } - } + } }else #endif /* LIBXML_VALID_ENABLED */ #ifdef LIBXML_READER_ENABLED @@ -2411,7 +2411,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if (encoding != NULL) { if ( format ) { xmlDocDumpFormatMemoryEnc(doc, &result, &len, encoding, 1); - } else { + } else { xmlDocDumpMemoryEnc(doc, &result, &len, encoding); } } else { @@ -2508,9 +2508,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { startTimer(); } if (dtdvalid != NULL) - dtd = xmlParseDTD(NULL, (const xmlChar *)dtdvalid); + dtd = xmlParseDTD(NULL, (const xmlChar *)dtdvalid); else - dtd = xmlParseDTD((const xmlChar *)dtdvalidfpi, NULL); + dtd = xmlParseDTD((const xmlChar *)dtdvalidfpi, NULL); if ((timing) && (!repeat)) { endTimer("Parsing DTD"); } @@ -2840,7 +2840,7 @@ main(int argc, char **argv) { int files = 0; int version = 0; const char* indent; - + if (argc <= 1) { usage(argv[0]); return(1); @@ -2860,7 +2860,7 @@ main(int argc, char **argv) { (!strcmp(argv[i], "--shell"))) { shell++; noout = 1; - } else + } else #endif #ifdef LIBXML_TREE_ENABLED if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy"))) @@ -3020,19 +3020,19 @@ main(int argc, char **argv) { (!strcmp(argv[i], "--debugent"))) { debugent++; xmlParserDebugEntities = 1; - } + } #endif #ifdef LIBXML_C14N_ENABLED else if ((!strcmp(argv[i], "-c14n")) || (!strcmp(argv[i], "--c14n"))) { canonical++; options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD; - } + } else if ((!strcmp(argv[i], "-exc-c14n")) || (!strcmp(argv[i], "--exc-c14n"))) { exc_canonical++; options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD; - } + } #endif #ifdef LIBXML_CATALOG_ENABLED else if ((!strcmp(argv[i], "-catalogs")) || @@ -3041,7 +3041,7 @@ main(int argc, char **argv) { } else if ((!strcmp(argv[i], "-nocatalogs")) || (!strcmp(argv[i], "--nocatalogs"))) { nocatalogs++; - } + } #endif else if ((!strcmp(argv[i], "-encode")) || (!strcmp(argv[i], "--encode"))) { @@ -3161,12 +3161,12 @@ main(int argc, char **argv) { xmlRegisterNodeDefault(registerNode); xmlDeregisterNodeDefault(deregisterNode); } - + indent = getenv("XMLLINT_INDENT"); if(indent != NULL) { xmlTreeIndentString = indent; } - + defaultEntityLoader = xmlGetExternalEntityLoader(); xmlSetExternalEntityLoader(xmllintExternalEntityLoader); @@ -3188,7 +3188,7 @@ main(int argc, char **argv) { xmlGenericError(xmlGenericErrorContext, "%s output\n", argv[0]); - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "

%s output

\n", argv[0]); } @@ -3202,7 +3202,7 @@ main(int argc, char **argv) { xmlRelaxNGParserCtxtPtr ctxt; /* forces loading the DTDs */ - xmlLoadExtDtdDefaultValue |= 1; + xmlLoadExtDtdDefaultValue |= 1; options |= XML_PARSE_DTDLOAD; if (timing) { startTimer(); @@ -3282,7 +3282,7 @@ main(int argc, char **argv) { (!strcmp(argv[i], "--dtdvalid"))) { i++; continue; - } + } if ((!strcmp(argv[i], "-path")) || (!strcmp(argv[i], "--path"))) { i++; @@ -3367,7 +3367,7 @@ main(int argc, char **argv) { } } } - if (generate) + if (generate) parseAndPrintFile(NULL, NULL); if ((htmlout) && (!nowrap)) { xmlGenericError(xmlGenericErrorContext, "\n"); diff --git a/reactos/lib/3rdparty/libxml2/xmlmemory.c b/reactos/lib/3rdparty/libxml2/xmlmemory.c index 18e0ff1454e..fa05198e2f6 100644 --- a/reactos/lib/3rdparty/libxml2/xmlmemory.c +++ b/reactos/lib/3rdparty/libxml2/xmlmemory.c @@ -34,7 +34,7 @@ /** * MEM_LIST: * - * keep track of all allocated blocks for error reporting + * keep track of all allocated blocks for error reporting * Always build the memory list ! */ #ifdef DEBUG_MEMORY_LOCATION @@ -162,7 +162,7 @@ xmlMallocLoc(size_t size, const char * file, int line) { MEMHDR *p; void *ret; - + if (!xmlMemInitialized) xmlInitMemory(); #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, @@ -170,7 +170,7 @@ xmlMallocLoc(size_t size, const char * file, int line) #endif TEST_POINT - + p = (MEMHDR *) malloc(RESERVE_SIZE+size); if (!p) { @@ -178,7 +178,7 @@ xmlMallocLoc(size_t size, const char * file, int line) "xmlMallocLoc : Out of free space\n"); xmlMemoryDump(); return(NULL); - } + } p->mh_tag = MEMTAG; p->mh_size = size; p->mh_type = MALLOC_TYPE; @@ -193,12 +193,12 @@ xmlMallocLoc(size_t size, const char * file, int line) debugmem_list_add(p); #endif xmlMutexUnlock(xmlMemMutex); - + #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "Malloc(%d) Ok\n",size); #endif - + if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint(); ret = HDR_2_CLIENT(p); @@ -230,7 +230,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line) { MEMHDR *p; void *ret; - + if (!xmlMemInitialized) xmlInitMemory(); #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, @@ -238,7 +238,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line) #endif TEST_POINT - + p = (MEMHDR *) malloc(RESERVE_SIZE+size); if (!p) { @@ -246,7 +246,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line) "xmlMallocLoc : Out of free space\n"); xmlMemoryDump(); return(NULL); - } + } p->mh_tag = MEMTAG; p->mh_size = size; p->mh_type = MALLOC_ATOMIC_TYPE; @@ -266,7 +266,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line) xmlGenericError(xmlGenericErrorContext, "Malloc(%d) Ok\n",size); #endif - + if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint(); ret = HDR_2_CLIENT(p); @@ -341,7 +341,7 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line) debugmem_list_delete(p); #endif xmlMutexUnlock(xmlMemMutex); - + p = (MEMHDR *) realloc(p,RESERVE_SIZE+size); if (!p) { goto error; @@ -374,8 +374,8 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line) "Realloced(%d to %d) Ok\n", oldsize, size); #endif return(HDR_2_CLIENT(p)); - -error: + +error: return(NULL); } @@ -452,10 +452,10 @@ xmlMemFree(void *ptr) xmlGenericError(xmlGenericErrorContext, "Freed(%d) Ok\n", size); #endif - + return; - -error: + +error: xmlGenericError(xmlGenericErrorContext, "xmlMemFree(%lX) error\n", (unsigned long) ptr); xmlMallocBreakpoint(); @@ -501,16 +501,16 @@ xmlMemStrdupLoc(const char *str, const char *file, int line) debugmem_list_add(p); #endif xmlMutexUnlock(xmlMemMutex); - + s = (char *) HDR_2_CLIENT(p); - + if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint(); if (s != NULL) strcpy(s,str); else goto error; - + TEST_POINT if (xmlMemTraceBlockAt == s) { @@ -612,7 +612,7 @@ xmlMemContentShow(FILE *fp, MEMHDR *p) } else if ((i == 0) && (buf[i] == 0)) { fprintf(fp," null"); } else { - if (buf[i] == 0) fprintf(fp," \"%.25s\"", buf); + if (buf[i] == 0) fprintf(fp," \"%.25s\"", buf); else { fprintf(fp," ["); for (j = 0;j < i;j++) @@ -660,7 +660,7 @@ xmlMemDisplay(FILE *fp) fprintf(fp," %s\n\n", buf); #endif - + fprintf(fp," MEMORY ALLOCATED : %lu, MAX was %lu\n", debugMemSize, debugMaxMemSize); fprintf(fp,"BLOCK NUMBER SIZE TYPE\n"); @@ -737,7 +737,7 @@ static void debugmem_list_delete(MEMHDR *p) * * internal error function. */ - + static void debugmem_tag_error(void *p) { xmlGenericError(xmlGenericErrorContext, @@ -797,7 +797,7 @@ xmlMemShow(FILE *fp, int nr ATTRIBUTE_UNUSED) } } xmlMutexUnlock(xmlMemMutex); -#endif /* MEM_LIST */ +#endif /* MEM_LIST */ } /** @@ -844,11 +844,11 @@ xmlInitMemory(void) { #ifdef HAVE_STDLIB_H char *breakpoint; -#endif +#endif #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlInitMemory()\n"); -#endif +#endif /* This is really not good code (see Bug 130419). Suggestions for improvement will be welcome! @@ -862,18 +862,18 @@ xmlInitMemory(void) if (breakpoint != NULL) { sscanf(breakpoint, "%ud", &xmlMemStopAtBlock); } -#endif +#endif #ifdef HAVE_STDLIB_H breakpoint = getenv("XML_MEM_TRACE"); if (breakpoint != NULL) { sscanf(breakpoint, "%p", &xmlMemTraceBlockAt); } -#endif - +#endif + #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlInitMemory() Ok\n"); -#endif +#endif return(0); } @@ -888,7 +888,7 @@ xmlCleanupMemory(void) { #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlCleanupMemory()\n"); -#endif +#endif if (xmlMemInitialized == 0) return; @@ -898,7 +898,7 @@ xmlCleanupMemory(void) { #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlCleanupMemory() Ok\n"); -#endif +#endif } /** @@ -922,7 +922,7 @@ xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlMemSetup()\n"); -#endif +#endif if (freeFunc == NULL) return(-1); if (mallocFunc == NULL) @@ -939,7 +939,7 @@ xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlMemSetup() Ok\n"); -#endif +#endif return(0); } @@ -989,7 +989,7 @@ xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlGcMemSetup()\n"); -#endif +#endif if (freeFunc == NULL) return(-1); if (mallocFunc == NULL) @@ -1008,7 +1008,7 @@ xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, #ifdef DEBUG_MEMORY xmlGenericError(xmlGenericErrorContext, "xmlGcMemSetup() Ok\n"); -#endif +#endif return(0); } diff --git a/reactos/lib/3rdparty/libxml2/xmlmodule.c b/reactos/lib/3rdparty/libxml2/xmlmodule.c index 8b0fab97931..36d0a152410 100644 --- a/reactos/lib/3rdparty/libxml2/xmlmodule.c +++ b/reactos/lib/3rdparty/libxml2/xmlmodule.c @@ -106,7 +106,7 @@ int xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol) { int rc = -1; - + if ((NULL == module) || (symbol == NULL)) { __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, diff --git a/reactos/lib/3rdparty/libxml2/xmlreader.c b/reactos/lib/3rdparty/libxml2/xmlreader.c index 14843eb8abd..4ca63fe1489 100644 --- a/reactos/lib/3rdparty/libxml2/xmlreader.c +++ b/reactos/lib/3rdparty/libxml2/xmlreader.c @@ -1,7 +1,7 @@ /* * xmlreader.c: implements the xmlTextReader streaming node API * - * NOTE: + * NOTE: * XmlTextReader.Normalization Property won't be supported, since * it makes the parser non compliant to the XML recommendation * @@ -230,7 +230,7 @@ xmlTextReaderRemoveID(xmlDocPtr doc, xmlAttrPtr attr) { if (doc == NULL) return(-1); if (attr == NULL) return(-1); table = (xmlIDTablePtr) doc->ids; - if (table == NULL) + if (table == NULL) return(-1); if (attr == NULL) @@ -820,7 +820,7 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) { break; } - } else + } else break; } /* @@ -869,7 +869,7 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) { if (reader->mode != XML_TEXTREADER_DONE) { s = inbuf->use - reader->cur; val = xmlParseChunk(reader->ctxt, - (const char *) &inbuf->content[reader->cur], + (const char *) &inbuf->content[reader->cur], s, 1); reader->cur = inbuf->use; reader->mode = XML_TEXTREADER_DONE; @@ -1009,7 +1009,7 @@ xmlTextReaderValidatePop(xmlTextReaderPtr reader) { int ret; if (reader->rngFullNode != NULL) { - if (node == reader->rngFullNode) + if (node == reader->rngFullNode) reader->rngFullNode = NULL; return; } @@ -1044,7 +1044,7 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) { */ if ((node->children == NULL) && (ctxt->sax != NULL) && (ctxt->sax->getEntity != NULL)) { - node->children = (xmlNodePtr) + node->children = (xmlNodePtr) ctxt->sax->getEntity(ctxt, node->name); } @@ -1226,7 +1226,7 @@ xmlTextReaderRead(xmlTextReaderPtr reader) { xmlTextReaderState oldstate = XML_TEXTREADER_START; xmlNodePtr oldnode = NULL; - + if (reader == NULL) return(-1); reader->curnode = NULL; @@ -1450,7 +1450,7 @@ node_found: (xmlStrEqual(reader->node->ns->href, XINCLUDE_OLD_NS)))) { if (reader->xincctxt == NULL) { reader->xincctxt = xmlXIncludeNewContext(reader->ctxt->myDoc); - xmlXIncludeSetFlags(reader->xincctxt, + xmlXIncludeSetFlags(reader->xincctxt, reader->parserFlags & (~XML_PARSE_NOXINCNODE)); } /* @@ -1463,7 +1463,7 @@ node_found: if (reader->node->type == XML_XINCLUDE_START) { reader->in_xinclude++; goto get_next_node; - } + } if (reader->node->type == XML_XINCLUDE_END) { reader->in_xinclude--; goto get_next_node; @@ -1481,7 +1481,7 @@ node_found: */ if ((reader->node->children == NULL) && (reader->ctxt->sax != NULL) && (reader->ctxt->sax->getEntity != NULL)) { - reader->node->children = (xmlNodePtr) + reader->node->children = (xmlNodePtr) reader->ctxt->sax->getEntity(reader->ctxt, reader->node->name); } @@ -1509,7 +1509,7 @@ node_found: if ((reader->validate) && (reader->node != NULL)) { xmlNodePtr node = reader->node; - if ((node->type == XML_ELEMENT_NODE) && + if ((node->type == XML_ELEMENT_NODE) && ((reader->state != XML_TEXTREADER_END) && (reader->state != XML_TEXTREADER_BACKTRACK))) { xmlTextReaderValidatePush(reader); @@ -1534,7 +1534,7 @@ node_found: #endif /* LIBXML_PATTERN_ENABLED */ #ifdef LIBXML_SCHEMAS_ENABLED if ((reader->validate == XML_TEXTREADER_VALIDATE_XSD) && - (reader->xsdValidErrors == 0) && + (reader->xsdValidErrors == 0) && (reader->xsdValidCtxt != NULL)) { reader->xsdValidErrors = !xmlSchemaIsValid(reader->xsdValidCtxt); } @@ -1624,7 +1624,7 @@ xmlTextReaderNext(xmlTextReaderPtr reader) { * Reads the contents of the current node, including child nodes and markup. * * Returns a string containing the XML content, or NULL if the current node - * is neither an element nor attribute, or has no child nodes. The + * is neither an element nor attribute, or has no child nodes. The * string must be deallocated by the caller. */ xmlChar * @@ -1665,7 +1665,7 @@ xmlTextReaderReadInnerXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED) * Reads the contents of the current node, including child nodes and markup. * * Returns a string containing the XML content, or NULL if the current node - * is neither an element nor attribute, or has no child nodes. The + * is neither an element nor attribute, or has no child nodes. The * string must be deallocated by the caller. */ xmlChar * @@ -2054,7 +2054,7 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) { ret->base = 0; ret->cur = 0; } - + if (ret->ctxt == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlNewTextReader : malloc failed\n"); @@ -2255,7 +2255,7 @@ xmlTextReaderGetAttributeNo(xmlTextReaderPtr reader, int no) { if (reader->curnode != NULL) return(NULL); /* TODO: handle the xmlDecl */ - if (reader->node->type != XML_ELEMENT_NODE) + if (reader->node->type != XML_ELEMENT_NODE) return(NULL); ns = reader->node->nsDef; @@ -2311,7 +2311,7 @@ xmlTextReaderGetAttribute(xmlTextReaderPtr reader, const xmlChar *name) { localname = xmlSplitQName2(name, &prefix); if (localname == NULL) return(xmlGetProp(reader->node, name)); - + ns = xmlSearchNs(reader->node->doc, reader->node, prefix); if (ns != NULL) ret = xmlGetNsProp(reader->node, localname, ns->href); @@ -2452,7 +2452,7 @@ xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader, int no) { if (reader->node == NULL) return(-1); /* TODO: handle the xmlDecl */ - if (reader->node->type != XML_ELEMENT_NODE) + if (reader->node->type != XML_ELEMENT_NODE) return(-1); reader->curnode = NULL; @@ -2539,7 +2539,7 @@ xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader, const xmlChar *name) { } return(0); } - + /* * Namespace default decl */ @@ -2748,7 +2748,7 @@ xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader) { xmlNsPtr ns = (xmlNsPtr) reader->curnode; if (reader->faketext == NULL) { - reader->faketext = xmlNewDocText(reader->node->doc, + reader->faketext = xmlNewDocText(reader->node->doc, ns->href); } else { if (reader->faketext->content != NULL) @@ -2784,7 +2784,7 @@ xmlTextReaderConstEncoding(xmlTextReaderPtr reader) { doc = reader->ctxt->myDoc; if (doc == NULL) return(NULL); - + if (doc->encoding == NULL) return(NULL); else @@ -2816,7 +2816,7 @@ xmlTextReaderAttributeCount(xmlTextReaderPtr reader) { return(-1); if (reader->node == NULL) return(0); - + if (reader->curnode != NULL) node = reader->curnode; else @@ -2854,7 +2854,7 @@ xmlTextReaderAttributeCount(xmlTextReaderPtr reader) { int xmlTextReaderNodeType(xmlTextReaderPtr reader) { xmlNodePtr node; - + if (reader == NULL) return(-1); if (reader->node == NULL) @@ -3030,7 +3030,7 @@ xmlTextReaderName(xmlTextReaderPtr reader) { if ((node->ns == NULL) || (node->ns->prefix == NULL)) return(xmlStrdup(node->name)); - + ret = xmlStrdup(node->ns->prefix); ret = xmlStrcat(ret, BAD_CAST ":"); ret = xmlStrcat(ret, node->name); @@ -3755,7 +3755,7 @@ xmlNodePtr xmlTextReaderCurrentNode(xmlTextReaderPtr reader) { if (reader == NULL) return(NULL); - + if (reader->curnode != NULL) return(reader->curnode); return(reader->node); @@ -3777,7 +3777,7 @@ xmlTextReaderPreserve(xmlTextReaderPtr reader) { if (reader == NULL) return(NULL); - + if (reader->curnode != NULL) cur = reader->curnode; else @@ -3790,7 +3790,7 @@ xmlTextReaderPreserve(xmlTextReaderPtr reader) { cur->extra |= NODE_IS_SPRESERVED; } reader->preserves++; - + parent = cur->parent;; while (parent != NULL) { if (parent->type == XML_ELEMENT_NODE) @@ -3806,7 +3806,7 @@ xmlTextReaderPreserve(xmlTextReaderPtr reader) { * @reader: the xmlTextReaderPtr used * @pattern: an XPath subset pattern * @namespaces: the prefix definitions, array of [URI, prefix] or NULL - * + * * This tells the XML Reader to preserve all nodes matched by the * pattern. The caller must also use xmlTextReaderCurrentDoc() to * keep an handle on the resulting document once parsing has finished @@ -3821,7 +3821,7 @@ xmlTextReaderPreservePattern(xmlTextReaderPtr reader, const xmlChar *pattern, if ((reader == NULL) || (pattern == NULL)) return(-1); - + comp = xmlPatterncompile(pattern, reader->dict, 0, namespaces); if (comp == NULL) return(-1); @@ -3858,7 +3858,7 @@ xmlTextReaderPreservePattern(xmlTextReaderPtr reader, const xmlChar *pattern, * @reader: the xmlTextReaderPtr used * * Hacking interface allowing to get the xmlDocPtr correponding to the - * current document being accessed by the xmlTextReader. + * current document being accessed by the xmlTextReader. * NOTE: as a result of this call, the reader will not destroy the * associated XML document and calling xmlFreeDoc() on the result * is needed once the reader parsing has finished. @@ -3874,7 +3874,7 @@ xmlTextReaderCurrentDoc(xmlTextReaderPtr reader) { if ((reader == NULL) || (reader->ctxt == NULL) || (reader->ctxt->myDoc == NULL)) return(NULL); - + reader->preserve = 1; return(reader->ctxt->myDoc); } @@ -4026,7 +4026,7 @@ xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, const char *rng) { if (reader == NULL) return(-1); - + if (rng == NULL) { if (reader->rngValidCtxt != NULL) { xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); @@ -4095,7 +4095,7 @@ xmlTextReaderSchemaValidate(xmlTextReaderPtr reader, const char *xsd) { if (reader == NULL) return(-1); - + if (xsd == NULL) { if (reader->xsdPlug != NULL) { xmlSchemaSAXUnplug(reader->xsdPlug); @@ -4187,7 +4187,7 @@ xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader) { node = reader->curnode; else node = reader->node; - + if (XML_NAMESPACE_DECL == node->type) return(1); else @@ -4211,10 +4211,10 @@ xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader) { if (reader->doc != NULL) doc = reader->doc; else if (reader->ctxt != NULL) - doc = reader->ctxt->myDoc; + doc = reader->ctxt->myDoc; if (doc == NULL) return(NULL); - + if (doc->version == NULL) return(NULL); else @@ -4314,7 +4314,7 @@ xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator) { input = ctx->inputTab[ctx->inputNr - 2]; if (input != NULL) { ret = input->line; - } + } else { ret = -1; } @@ -4350,7 +4350,7 @@ xmlTextReaderLocatorBaseURI(xmlTextReaderLocatorPtr locator) { input = ctx->inputTab[ctx->inputNr - 2]; if (input != NULL) { ret = xmlStrdup(BAD_CAST input->filename); - } + } else { ret = NULL; } @@ -4374,7 +4374,7 @@ xmlTextReaderGenericError(void *ctxt, xmlParserSeverities severity, char *str) { } } -static void +static void xmlTextReaderStructuredError(void *ctxt, xmlErrorPtr error) { xmlParserCtxtPtr ctx = (xmlParserCtxtPtr) ctxt; xmlTextReaderPtr reader = (xmlTextReaderPtr) ctx->_private; @@ -4385,7 +4385,7 @@ xmlTextReaderStructuredError(void *ctxt, xmlErrorPtr error) { } } -static void +static void xmlTextReaderError(void *ctxt, const char *msg, ...) { va_list ap; @@ -4397,7 +4397,7 @@ xmlTextReaderError(void *ctxt, const char *msg, ...) { } -static void +static void xmlTextReaderWarning(void *ctxt, const char *msg, ...) { va_list ap; @@ -4408,15 +4408,15 @@ xmlTextReaderWarning(void *ctxt, const char *msg, ...) { va_end(ap); } -static void +static void xmlTextReaderValidityError(void *ctxt, const char *msg, ...) { va_list ap; int len = xmlStrlen((const xmlChar *) msg); if ((len > 1) && (msg[len - 2] != ':')) { - /* - * some callbacks only report locator information: - * skip them (mimicking behaviour in error.c) + /* + * some callbacks only report locator information: + * skip them (mimicking behaviour in error.c) */ va_start(ap,msg); xmlTextReaderGenericError(ctxt, @@ -4426,15 +4426,15 @@ xmlTextReaderValidityError(void *ctxt, const char *msg, ...) { } } -static void +static void xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...) { va_list ap; int len = xmlStrlen((const xmlChar *) msg); if ((len != 0) && (msg[len - 1] != ':')) { - /* - * some callbacks only report locator information: - * skip them (mimicking behaviour in error.c) + /* + * some callbacks only report locator information: + * skip them (mimicking behaviour in error.c) */ va_start(ap,msg); xmlTextReaderGenericError(ctxt, @@ -4455,8 +4455,8 @@ xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...) { * If @f is NULL, the default error and warning handlers are restored. */ void -xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc f, +xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc f, void *arg) { if (f != NULL) { reader->ctxt->sax->error = xmlTextReaderError; @@ -4491,8 +4491,8 @@ xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, * If @f is NULL, the default error and warning handlers are restored. */ void -xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, - xmlStructuredErrorFunc f, +xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader, + xmlStructuredErrorFunc f, void *arg) { if (f != NULL) { reader->ctxt->sax->error = NULL; @@ -4548,8 +4548,8 @@ xmlTextReaderIsValid(xmlTextReaderPtr reader) { * Retrieve the error callback function and user argument. */ void -xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, - xmlTextReaderErrorFunc *f, +xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, + xmlTextReaderErrorFunc *f, void **arg) { if (f != NULL) *f = reader->errorFunc; if (arg != NULL) *arg = reader->errorFuncArg; @@ -4571,7 +4571,7 @@ xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader, * @reuse: keep the context for reuse * * Setup an XML reader with new options - * + * * Returns 0 in case of success and -1 in case of error. */ static int @@ -4675,7 +4675,7 @@ xmlTextReaderSetup(xmlTextReaderPtr reader, inputStream->buf = buf; inputStream->base = inputStream->buf->buffer->content; inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = + inputStream->end = &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; inputPush(reader->ctxt, inputStream); @@ -4777,14 +4777,14 @@ xmlTextReaderByteConsumed(xmlTextReaderPtr reader) { return(-1); return(xmlByteConsumed(reader->ctxt)); } - + /** * xmlReaderWalker: * @doc: a preparsed document * * Create an xmltextReader for a preparsed document. - * + * * Returns the new reader or NULL in case of error. */ xmlTextReaderPtr @@ -4825,7 +4825,7 @@ xmlReaderWalker(xmlDocPtr doc) * * Create an xmltextReader for an XML in-memory document. * The parsing flags @options are a combination of xmlParserOption. - * + * * Returns the new reader or NULL in case of error. */ xmlTextReaderPtr @@ -4850,7 +4850,7 @@ xmlReaderForDoc(const xmlChar * cur, const char *URL, const char *encoding, * * parse an XML file from the filesystem or the network. * The parsing flags @options are a combination of xmlParserOption. - * + * * Returns the new reader or NULL in case of error. */ xmlTextReaderPtr @@ -4875,7 +4875,7 @@ xmlReaderForFile(const char *filename, const char *encoding, int options) * * Create an xmltextReader for an XML in-memory document. * The parsing flags @options are a combination of xmlParserOption. - * + * * Returns the new reader or NULL in case of error. */ xmlTextReaderPtr @@ -4911,7 +4911,7 @@ xmlReaderForMemory(const char *buffer, int size, const char *URL, * The parsing flags @options are a combination of xmlParserOption. * NOTE that the file descriptor will not be closed when the * reader is closed or reset. - * + * * Returns the new reader or NULL in case of error. */ xmlTextReaderPtr @@ -4948,7 +4948,7 @@ xmlReaderForFd(int fd, const char *URL, const char *encoding, int options) * * Create an xmltextReader for an XML document from I/O functions and source. * The parsing flags @options are a combination of xmlParserOption. - * + * * Returns the new reader or NULL in case of error. */ xmlTextReaderPtr @@ -4983,7 +4983,7 @@ xmlReaderForIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, * * Setup an xmltextReader to parse a preparsed XML document. * This reuses the existing @reader xmlTextReader. - * + * * Returns 0 in case of success and -1 in case of error */ int @@ -5031,7 +5031,7 @@ xmlReaderNewWalker(xmlTextReaderPtr reader, xmlDocPtr doc) * Setup an xmltextReader to parse an XML in-memory document. * The parsing flags @options are a combination of xmlParserOption. * This reuses the existing @reader xmlTextReader. - * + * * Returns 0 in case of success and -1 in case of error */ int @@ -5061,7 +5061,7 @@ xmlReaderNewDoc(xmlTextReaderPtr reader, const xmlChar * cur, * parse an XML file from the filesystem or the network. * The parsing flags @options are a combination of xmlParserOption. * This reuses the existing @reader xmlTextReader. - * + * * Returns 0 in case of success and -1 in case of error */ int @@ -5095,7 +5095,7 @@ xmlReaderNewFile(xmlTextReaderPtr reader, const char *filename, * Setup an xmltextReader to parse an XML in-memory document. * The parsing flags @options are a combination of xmlParserOption. * This reuses the existing @reader xmlTextReader. - * + * * Returns 0 in case of success and -1 in case of error */ int @@ -5130,7 +5130,7 @@ xmlReaderNewMemory(xmlTextReaderPtr reader, const char *buffer, int size, * reader is closed or reset. * The parsing flags @options are a combination of xmlParserOption. * This reuses the existing @reader xmlTextReader. - * + * * Returns 0 in case of success and -1 in case of error */ int @@ -5165,7 +5165,7 @@ xmlReaderNewFd(xmlTextReaderPtr reader, int fd, * and source. * The parsing flags @options are a combination of xmlParserOption. * This reuses the existing @reader xmlTextReader. - * + * * Returns 0 in case of success and -1 in case of error */ int @@ -5324,7 +5324,7 @@ int main(int argc, char **argv) { output[outlen] = 0; printf("ret: %d, inlen: %ld , outlen: %ld, output: '%s'\n", ret, inlen, outlen, output); - + /* * output chunking */ diff --git a/reactos/lib/3rdparty/libxml2/xmlregexp.c b/reactos/lib/3rdparty/libxml2/xmlregexp.c index ee635f1e106..3581c08e797 100644 --- a/reactos/lib/3rdparty/libxml2/xmlregexp.c +++ b/reactos/lib/3rdparty/libxml2/xmlregexp.c @@ -1,7 +1,7 @@ /* * regexp.c: generic and extensible Regular Expression engine * - * Basically designed with the purpose of compiling regexps for + * Basically designed with the purpose of compiling regexps for * the variety of validation/shemas mechanisms now available in * XML related specifications these include: * - XML-1.0 DTD validation @@ -38,7 +38,7 @@ #endif /* #define DEBUG_REGEXP_GRAPH */ -/* #define DEBUG_REGEXP_EXEC */ +/* #define DEBUG_REGEXP_EXEC */ /* #define DEBUG_PUSH */ /* #define DEBUG_COMPACTION */ @@ -1018,7 +1018,7 @@ xmlRegPrintTrans(FILE *output, xmlRegTransPtr trans) { fprintf(output, "char %c ", trans->atom->codepoint); fprintf(output, "atom %d, to %d\n", trans->atom->no, trans->to); } - + static void xmlRegPrintState(FILE *output, xmlRegStatePtr state) { int i; @@ -1032,7 +1032,7 @@ xmlRegPrintState(FILE *output, xmlRegStatePtr state) { fprintf(output, "START "); if (state->type == XML_REGEXP_FINAL_STATE) fprintf(output, "FINAL "); - + fprintf(output, "%d, %d transitions:\n", state->no, state->nbTrans); for (i = 0;i < state->nbTrans; i++) { xmlRegPrintTrans(output, &(state->trans[i])); @@ -1087,7 +1087,7 @@ xmlRegPrintCtxt(FILE *output, xmlRegParserCtxtPtr ctxt) { * * ************************************************************************/ -static void +static void xmlRegAtomAddRange(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom, int neg, xmlRegAtomType type, int start, int end, xmlChar *blockName) { @@ -1127,7 +1127,7 @@ xmlRegAtomAddRange(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom, return; range->blockName = blockName; atom->ranges[atom->nbRanges++] = range; - + } static int @@ -1158,7 +1158,7 @@ xmlRegGetCounter(xmlRegParserCtxtPtr ctxt) { return(ctxt->nbCounters++); } -static int +static int xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) { if (atom == NULL) { ERROR("atom push: atom is NULL"); @@ -1190,7 +1190,7 @@ xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) { return(0); } -static void +static void xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, xmlRegAtomPtr atom, xmlRegStatePtr target, int counter, int count) { @@ -1255,7 +1255,7 @@ xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state, printf("counted %d\n", counter); else if (atom == NULL) printf("epsilon transition\n"); - else if (atom != NULL) + else if (atom != NULL) xmlRegPrintAtom(stdout, atom); #endif @@ -1506,7 +1506,7 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from, * xmlFAReduceEpsilonTransitions: * @ctxt: a regexp parser context * @fromnr: the from state - * @tonr: the to state + * @tonr: the to state * @counter: should that transition be associated to a counted * */ @@ -1548,7 +1548,7 @@ xmlFAReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int fromnr, int newto = to->trans[transnr].to; xmlRegStateAddTrans(ctxt, from, NULL, - ctxt->states[newto], + ctxt->states[newto], -1, to->trans[transnr].count); } else { #ifdef DEBUG_REGEXP_GRAPH @@ -1570,11 +1570,11 @@ xmlFAReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int fromnr, int newto = to->trans[transnr].to; if (to->trans[transnr].counter >= 0) { - xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, - ctxt->states[newto], + xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, + ctxt->states[newto], to->trans[transnr].counter, -1); } else { - xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, + xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom, ctxt->states[newto], counter, -1); } } @@ -1894,7 +1894,7 @@ xmlRegCheckCharacterRange(xmlRegAtomType type, int codepoint, int neg, case XML_REGEXP_NOTINITNAME: neg = !neg; case XML_REGEXP_INITNAME: - ret = (IS_LETTER(codepoint) || + ret = (IS_LETTER(codepoint) || (codepoint == '_') || (codepoint == ':')); break; case XML_REGEXP_NOTNAMECHAR: @@ -2583,7 +2583,7 @@ xmlFARegExecSaveInputString(xmlRegExecCtxtPtr exec, const xmlChar *value, #endif if (exec->inputStackMax == 0) { exec->inputStackMax = 4; - exec->inputStack = (xmlRegInputTokenPtr) + exec->inputStack = (xmlRegInputTokenPtr) xmlMalloc(exec->inputStackMax * sizeof(xmlRegInputToken)); if (exec->inputStack == NULL) { xmlRegexpErrMemory(NULL, "pushing input string"); @@ -2612,11 +2612,11 @@ xmlFARegExecSaveInputString(xmlRegExecCtxtPtr exec, const xmlChar *value, /** * xmlRegStrEqualWildcard: - * @expStr: the string to be evaluated + * @expStr: the string to be evaluated * @valStr: the validation string * * Checks if both strings are equal or have the same content. "*" - * can be used as a wildcard in @valStr; "|" is used as a seperator of + * can be used as a wildcard in @valStr; "|" is used as a seperator of * substrings in both @expStr and @valStr. * * Returns 1 if the comparison is satisfied and the number of substrings @@ -2674,7 +2674,7 @@ xmlRegCompactPushString(xmlRegExecCtxtPtr exec, if ((comp == NULL) || (comp->compact == NULL) || (comp->stringMap == NULL)) return(-1); - + if (value == NULL) { /* * are we at a final state ? @@ -2695,9 +2695,9 @@ xmlRegCompactPushString(xmlRegExecCtxtPtr exec, for (i = 0;i < comp->nbstrings;i++) { target = comp->compact[state * (comp->nbstrings + 1) + i + 1]; if ((target > 0) && (target <= comp->nbstates)) { - target--; /* to avoid 0 */ + target--; /* to avoid 0 */ if (xmlRegStrEqualWildcard(comp->stringMap[i], value)) { - exec->index = target; + exec->index = target; if ((exec->callback != NULL) && (comp->transdata != NULL)) { exec->callback(exec->data, value, comp->transdata[state * comp->nbstrings + i], data); @@ -2830,7 +2830,7 @@ xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar *value, continue; counter = &exec->comp->counters[t->counter]; count = exec->counts[t->counter]; - if ((count < counter->max) && + if ((count < counter->max) && (t->atom != NULL) && (xmlStrEqual(value, t->atom->valuep))) { ret = 0; @@ -3157,7 +3157,7 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err, int maxval; int nb = 0; - if ((exec == NULL) || (nbval == NULL) || (nbneg == NULL) || + if ((exec == NULL) || (nbval == NULL) || (nbneg == NULL) || (values == NULL) || (*nbval <= 0)) return(-1); @@ -3256,7 +3256,7 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err, values[nb++] = (xmlChar *) atom->valuep; (*nbval)++; } - } + } } for (transno = 0; (transno < state->nbTrans) && (nb < maxval); @@ -3280,7 +3280,7 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err, values[nb++] = (xmlChar *) atom->valuep; (*nbneg)++; } - } + } } } return(0); @@ -3534,7 +3534,7 @@ xmlFAIsChar(xmlRegParserCtxtPtr ctxt) { * * [27] charProp ::= IsCategory | IsBlock * [28] IsCategory ::= Letters | Marks | Numbers | Punctuation | - * Separators | Symbols | Others + * Separators | Symbols | Others * [29] Letters ::= 'L' [ultmo]? * [30] Marks ::= 'M' [nce]? * [31] Numbers ::= 'N' [dlo]? @@ -3549,7 +3549,7 @@ xmlFAParseCharProp(xmlRegParserCtxtPtr ctxt) { int cur; xmlRegAtomType type = (xmlRegAtomType) 0; xmlChar *blockName = NULL; - + cur = CUR; if (cur == 'L') { NEXT; @@ -3721,15 +3721,15 @@ xmlFAParseCharProp(xmlRegParserCtxtPtr ctxt) { NEXT; start = ctxt->cur; cur = CUR; - if (((cur >= 'a') && (cur <= 'z')) || - ((cur >= 'A') && (cur <= 'Z')) || - ((cur >= '0') && (cur <= '9')) || + if (((cur >= 'a') && (cur <= 'z')) || + ((cur >= 'A') && (cur <= 'Z')) || + ((cur >= '0') && (cur <= '9')) || (cur == 0x2D)) { NEXT; cur = CUR; - while (((cur >= 'a') && (cur <= 'z')) || - ((cur >= 'A') && (cur <= 'Z')) || - ((cur >= '0') && (cur <= '9')) || + while (((cur >= 'a') && (cur <= 'z')) || + ((cur >= 'A') && (cur <= 'Z')) || + ((cur >= '0') && (cur <= '9')) || (cur == 0x2D)) { NEXT; cur = CUR; @@ -3755,7 +3755,7 @@ xmlFAParseCharProp(xmlRegParserCtxtPtr ctxt) { * xmlFAParseCharClassEsc: * @ctxt: a regexp parser context * - * [23] charClassEsc ::= ( SingleCharEsc | MultiCharEsc | catEsc | complEsc ) + * [23] charClassEsc ::= ( SingleCharEsc | MultiCharEsc | catEsc | complEsc ) * [24] SingleCharEsc ::= '\' [nrt\|.?*+(){}#x2D#x5B#x5D#x5E] * [25] catEsc ::= '\p{' charProp '}' * [26] complEsc ::= '\P{' charProp '}' @@ -3828,34 +3828,34 @@ xmlFAParseCharClassEsc(xmlRegParserCtxtPtr ctxt) { xmlRegAtomType type = XML_REGEXP_ANYSPACE; switch (cur) { - case 's': + case 's': type = XML_REGEXP_ANYSPACE; break; - case 'S': + case 'S': type = XML_REGEXP_NOTSPACE; break; - case 'i': + case 'i': type = XML_REGEXP_INITNAME; break; - case 'I': + case 'I': type = XML_REGEXP_NOTINITNAME; break; - case 'c': + case 'c': type = XML_REGEXP_NAMECHAR; break; - case 'C': + case 'C': type = XML_REGEXP_NOTNAMECHAR; break; - case 'd': + case 'd': type = XML_REGEXP_DECIMAL; break; - case 'D': + case 'D': type = XML_REGEXP_NOTDECIMAL; break; - case 'w': + case 'w': type = XML_REGEXP_REALCHAR; break; - case 'W': + case 'W': type = XML_REGEXP_NOTREALCHAR; break; } @@ -3930,7 +3930,7 @@ xmlFAParseCharRef(xmlRegParserCtxtPtr ctxt) { * xmlFAParseCharRange: * @ctxt: a regexp parser context * - * [17] charRange ::= seRange | XmlCharRef | XmlCharIncDash + * [17] charRange ::= seRange | XmlCharRef | XmlCharIncDash * [18] seRange ::= charOrEsc '-' charOrEsc * [20] charOrEsc ::= XmlChar | SingleCharEsc * [21] XmlChar ::= [^\#x2D#x5B#x5D] @@ -4041,7 +4041,7 @@ xmlFAParsePosCharGroup(xmlRegParserCtxtPtr ctxt) { * * [13] charGroup ::= posCharGroup | negCharGroup | charClassSub * [15] negCharGroup ::= '^' posCharGroup - * [16] charClassSub ::= ( posCharGroup | negCharGroup ) '-' charClassExpr + * [16] charClassSub ::= ( posCharGroup | negCharGroup ) '-' charClassExpr * [12] charClassExpr ::= '[' charGroup ']' */ static void @@ -4718,7 +4718,7 @@ xmlAutomataNewTransition2(xmlAutomataPtr am, xmlAutomataStatePtr from, * * If @to is NULL, this creates first a new target state in the automata * and then adds a transition from the @from state to the target state - * activated by a succession of input of value @token and @token2 and + * activated by a succession of input of value @token and @token2 and * whose number is between @min and @max * * Returns the target state or NULL in case of error @@ -4872,8 +4872,8 @@ xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, * * If @to is NULL, this creates first a new target state in the automata * and then adds a transition from the @from state to the target state - * activated by a succession of input of value @token and @token2 and whose - * number is between @min and @max, moreover that transition can only be + * activated by a succession of input of value @token and @token2 and whose + * number is between @min and @max, moreover that transition can only be * crossed once. * * Returns the target state or NULL in case of error @@ -4915,7 +4915,7 @@ xmlAutomataNewOnceTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from, str[lenn + lenp + 1] = 0; atom->valuep = str; - } + } atom->data = data; atom->quant = XML_REGEXP_QUANT_ONCEONLY; if (min == 0) @@ -4941,7 +4941,7 @@ xmlAutomataNewOnceTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from, return(to); } - + /** * xmlAutomataNewOnceTrans: @@ -5013,7 +5013,7 @@ xmlAutomataNewOnceTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, */ xmlAutomataStatePtr xmlAutomataNewState(xmlAutomataPtr am) { - xmlAutomataStatePtr to; + xmlAutomataStatePtr to; if (am == NULL) return(NULL); @@ -5080,7 +5080,7 @@ xmlAutomataNewAllTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, * * Returns the counter number or -1 in case of error */ -int +int xmlAutomataNewCounter(xmlAutomataPtr am, int min, int max) { int ret; @@ -5152,7 +5152,7 @@ xmlAutomataNewCounterTrans(xmlAutomataPtr am, xmlAutomataStatePtr from, * * Returns the compiled regexp or NULL in case of error */ -xmlRegexpPtr +xmlRegexpPtr xmlAutomataCompile(xmlAutomataPtr am) { xmlRegexpPtr ret; @@ -5172,7 +5172,7 @@ xmlAutomataCompile(xmlAutomataPtr am) { * * Returns 1 if true, 0 if not, and -1 in case of error */ -int +int xmlAutomataIsDeterminist(xmlAutomataPtr am) { int ret; diff --git a/reactos/lib/3rdparty/libxml2/xmlsave.c b/reactos/lib/3rdparty/libxml2/xmlsave.c index d6e3e65aa5a..a5d08cf31b7 100644 --- a/reactos/lib/3rdparty/libxml2/xmlsave.c +++ b/reactos/lib/3rdparty/libxml2/xmlsave.c @@ -210,7 +210,7 @@ xmlEscapeEntities(unsigned char* out, int *outlen, int val; inend = in + (*inlen); - + while ((in < inend) && (out < outend)) { if (*in == '<') { if (outend - out < 4) break; @@ -502,7 +502,7 @@ xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur) { * xmlDtdDumpOutput: * @buf: the XML buffer output * @dtd: the pointer to the DTD - * + * * Dump the XML document DTD, if any. */ static void @@ -615,7 +615,7 @@ xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { if ((ctxt->format) && (xmlIndentTreeOutput) && (cur->type == XML_ELEMENT_NODE)) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); xmlNodeDumpOutputInternal(ctxt, cur); @@ -789,7 +789,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { if (ctxt->level > 0) ctxt->level--; if ((xmlIndentTreeOutput) && (ctxt->format)) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); } @@ -827,7 +827,7 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { buf = ctxt->buf; xmlOutputBufferWrite(buf, 14, "version != NULL) + if (cur->version != NULL) xmlBufferWriteQuotedString(buf->buffer, cur->version); else xmlOutputBufferWrite(buf, 5, "\"1.0\""); @@ -989,7 +989,7 @@ xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) { if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) && (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml"))) xml_lang = cur; - else if ((cur->ns == NULL) && + else if ((cur->ns == NULL) && ((cur->children == NULL) || (cur->children->content == NULL) || (cur->children->content[0] == 0)) && @@ -1029,7 +1029,7 @@ xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) { xmlOutputBufferWrite(buf, 11, " xml:lang=\""); xmlAttrSerializeContent(buf, lang); xmlOutputBufferWrite(buf, 1, "\""); - } else + } else if ((xml_lang != NULL) && (lang == NULL)) { xmlOutputBufferWrite(buf, 7, " lang=\""); xmlAttrSerializeContent(buf, xml_lang); @@ -1060,7 +1060,7 @@ xhtmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { if ((ctxt->format) && (xmlIndentTreeOutput) && (cur->type == XML_ELEMENT_NODE)) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); xhtmlNodeDumpOutput(ctxt, cur); @@ -1180,7 +1180,7 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { if (format == 1) { tmp = cur->children; while (tmp != NULL) { - if ((tmp->type == XML_TEXT_NODE) || + if ((tmp->type == XML_TEXT_NODE) || (tmp->type == XML_ENTITY_REF_NODE)) { format = 0; break; @@ -1299,7 +1299,7 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { } } else if (cur->children != NULL) { int indent = ctxt->format; - + if (format) xmlOutputBufferWrite(buf, 1, "\n"); if (ctxt->level >= 0) ctxt->level++; ctxt->format = format; @@ -1308,7 +1308,7 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { ctxt->format = indent; if ((xmlIndentTreeOutput) && (format)) xmlOutputBufferWrite(buf, ctxt->indent_size * - (ctxt->level > ctxt->indent_nr ? + (ctxt->level > ctxt->indent_nr ? ctxt->indent_nr : ctxt->level), ctxt->indent); } @@ -1656,7 +1656,7 @@ xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr doc, xmlSaveErr(XML_SAVE_CHAR_INVALID, (xmlNodePtr) attr, NULL); if (doc != NULL) doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1"); - + xmlSerializeHexCharRef(tmp, *cur); xmlBufferAdd(buf, (xmlChar *) tmp, -1); cur++; @@ -2164,7 +2164,7 @@ xmlSaveFormatFileEnc( const char * filename, xmlDocPtr cur, #ifdef HAVE_ZLIB_H if (cur->compression < 0) cur->compression = xmlGetCompressMode(); #endif - /* + /* * save the content to a temp buffer. */ buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); diff --git a/reactos/lib/3rdparty/libxml2/xmlschemas.c b/reactos/lib/3rdparty/libxml2/xmlschemas.c index afa70105418..2bd3804b6a0 100644 --- a/reactos/lib/3rdparty/libxml2/xmlschemas.c +++ b/reactos/lib/3rdparty/libxml2/xmlschemas.c @@ -946,7 +946,7 @@ xmlSchemaFormatQName(xmlChar **buf, return ((const xmlChar *) *buf); } -static const xmlChar* +static const xmlChar* xmlSchemaFormatQNameNs(xmlChar **buf, xmlNsPtr ns, const xmlChar *localName) { if (ns != NULL) @@ -1065,16 +1065,16 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val, int list; xmlSchemaValType valType; const xmlChar *value, *value2 = NULL; - + if ((retValue == NULL) || (val == NULL)) return (-1); list = xmlSchemaValueGetNext(val) ? 1 : 0; *retValue = NULL; do { - value = NULL; - valType = xmlSchemaGetValType(val); - switch (valType) { + value = NULL; + valType = xmlSchemaGetValType(val); + switch (valType) { case XML_SCHEMAS_STRING: case XML_SCHEMAS_NORMSTRING: case XML_SCHEMAS_ANYSIMPLETYPE: @@ -1087,7 +1087,7 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val, if (value2 != NULL) value = value2; } - break; + break; default: if (xmlSchemaGetCanonValue(val, &value2) == -1) { if (value2 != NULL) @@ -1125,29 +1125,29 @@ internal_error: * @buf: the string buffer * @itemDes: the designation of the item * @itemName: the name of the item - * @item: the item as an object + * @item: the item as an object * @itemNode: the node of the item * @local: the local name * @parsing: if the function is used during the parse * * Returns a representation of the given item used - * for error reports. + * for error reports. * - * The following order is used to build the resulting + * The following order is used to build the resulting * designation if the arguments are not NULL: * 1a. If itemDes not NULL -> itemDes * 1b. If (itemDes not NULL) and (itemName not NULL) * -> itemDes + itemName * 2. If the preceding was NULL and (item not NULL) -> item * 3. If the preceding was NULL and (itemNode not NULL) -> itemNode - * + * * If the itemNode is an attribute node, the name of the attribute * will be appended to the result. * * Returns the formatted string and sets @buf to the resulting value. - */ -static xmlChar* -xmlSchemaFormatItemForReport(xmlChar **buf, + */ +static xmlChar* +xmlSchemaFormatItemForReport(xmlChar **buf, const xmlChar *itemDes, xmlSchemaTypePtr item, xmlNodePtr itemNode) @@ -1159,9 +1159,9 @@ xmlSchemaFormatItemForReport(xmlChar **buf, xmlFree(*buf); *buf = NULL; } - + if (itemDes != NULL) { - *buf = xmlStrdup(itemDes); + *buf = xmlStrdup(itemDes); } else if (item != NULL) { switch (item->type) { case XML_SCHEMA_TYPE_BASIC: @@ -1210,8 +1210,8 @@ xmlSchemaFormatItemForReport(xmlChar **buf, break; case XML_SCHEMA_TYPE_ATTRIBUTE: { xmlSchemaAttributePtr attr; - - attr = (xmlSchemaAttributePtr) item; + + attr = (xmlSchemaAttributePtr) item; if ((attr->flags & XML_SCHEMAS_ATTR_GLOBAL) || (attr->ref == NULL)) { *buf = xmlStrdup(xmlSchemaElemDesAttrDecl); @@ -1227,14 +1227,14 @@ xmlSchemaFormatItemForReport(xmlChar **buf, attr->refNs, attr->ref)); FREE_AND_NULL(str) *buf = xmlStrcat(*buf, BAD_CAST "'"); - } + } } break; case XML_SCHEMA_TYPE_ELEMENT: { xmlSchemaElementPtr elem; - elem = (xmlSchemaElementPtr) item; - if ((elem->flags & XML_SCHEMAS_ELEM_GLOBAL) || + elem = (xmlSchemaElementPtr) item; + if ((elem->flags & XML_SCHEMAS_ELEM_GLOBAL) || (elem->ref == NULL)) { *buf = xmlStrdup(xmlSchemaElemDesElemDecl); *buf = xmlStrcat(*buf, BAD_CAST " '"); @@ -1246,7 +1246,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf, break; case XML_SCHEMA_TYPE_IDC_UNIQUE: case XML_SCHEMA_TYPE_IDC_KEY: - case XML_SCHEMA_TYPE_IDC_KEYREF: + case XML_SCHEMA_TYPE_IDC_KEYREF: if (item->type == XML_SCHEMA_TYPE_IDC_UNIQUE) *buf = xmlStrdup(BAD_CAST "unique '"); else if (item->type == XML_SCHEMA_TYPE_IDC_KEY) @@ -1296,11 +1296,11 @@ xmlSchemaFormatItemForReport(xmlChar **buf, case XML_SCHEMA_TYPE_ALL: case XML_SCHEMA_TYPE_PARTICLE: *buf = xmlStrdup(xmlSchemaCompTypeToString(item->type)); - break; + break; default: named = 0; } - } else + } else named = 0; if ((named == 0) && (itemNode != NULL)) { @@ -1308,7 +1308,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf, if (itemNode->type == XML_ATTRIBUTE_NODE) elem = itemNode->parent; - else + else elem = itemNode; *buf = xmlStrdup(BAD_CAST "Element '"); if (elem->ns != NULL) { @@ -1318,7 +1318,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf, } else *buf = xmlStrcat(*buf, elem->name); *buf = xmlStrcat(*buf, BAD_CAST "'"); - + } if ((itemNode != NULL) && (itemNode->type == XML_ATTRIBUTE_NODE)) { *buf = xmlStrcat(*buf, BAD_CAST ", attribute '"); @@ -1331,7 +1331,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf, *buf = xmlStrcat(*buf, BAD_CAST "'"); } FREE_AND_NULL(str) - + return (*buf); } @@ -1354,13 +1354,13 @@ xmlSchemaFormatFacetEnumSet(xmlSchemaAbstractCtxtPtr actxt, int res; if (*buf != NULL) - xmlFree(*buf); + xmlFree(*buf); *buf = NULL; do { /* * Use the whitespace type of the base type. - */ + */ ws = xmlSchemaGetWhiteSpaceFacetValue(type->baseType); for (facet = type->facets; facet != NULL; facet = facet->next) { if (facet->type != XML_SCHEMA_FACET_ENUMERATION) @@ -1433,7 +1433,7 @@ xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt, * @msg: the error message * @str1: extra data * @str2: extra data - * + * * Handle a parser error */ static void @@ -1465,7 +1465,7 @@ xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, * @msg: the error message * @str1: extra data * @str2: extra data - * + * * Handle a parser error */ static void @@ -1484,7 +1484,7 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, * xmlSchemaPErrExt: * @ctxt: the parsing context * @node: the context node - * @error: the error code + * @error: the error code * @strData1: extra data * @strData2: extra data * @strData3: extra data @@ -1494,13 +1494,13 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, * @str3: extra parameter for the message display * @str4: extra parameter for the message display * @str5: extra parameter for the message display - * + * * Handle a parser error */ static void xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, - const xmlChar * strData1, const xmlChar * strData2, - const xmlChar * strData3, const char *msg, const xmlChar * str1, + const xmlChar * strData1, const xmlChar * strData2, + const xmlChar * strData3, const char *msg, const xmlChar * str1, const xmlChar * str2, const xmlChar * str3, const xmlChar * str4, const xmlChar * str5) { @@ -1517,8 +1517,8 @@ xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error, } __xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP, error, XML_ERR_ERROR, NULL, 0, - (const char *) strData1, (const char *) strData2, - (const char *) strData3, 0, 0, msg, str1, str2, + (const char *) strData1, (const char *) strData2, + (const char *) strData3, 0, 0, msg, str1, str2, str3, str4, str5); } @@ -1556,18 +1556,18 @@ xmlSchemaVErrMemory(xmlSchemaValidCtxtPtr ctxt, * @str1: extra data * @str2: extra data * @str3: extra data - * + * * Handle a validation error */ static void -xmlSchemaErr3(xmlSchemaAbstractCtxtPtr ctxt, +xmlSchemaErr3(xmlSchemaAbstractCtxtPtr ctxt, int error, xmlNodePtr node, const char *msg, const xmlChar *str1, const xmlChar *str2, const xmlChar *str3) { xmlStructuredErrorFunc schannel = NULL; xmlGenericErrorFunc channel = NULL; void *data = NULL; - + if (ctxt != NULL) { if (ctxt->type == XML_SCHEMA_CTXT_VALIDATOR) { xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt; @@ -1610,7 +1610,7 @@ xmlSchemaErr3(xmlSchemaAbstractCtxtPtr ctxt, } else { TODO } - } + } } static void @@ -1634,7 +1634,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, */ if (node->type == XML_ATTRIBUTE_NODE) { xmlNodePtr elem = node->parent; - + *msg = xmlStrdup(BAD_CAST "Element '"); if (elem->ns != NULL) *msg = xmlStrcat(*msg, xmlSchemaFormatQName(&str, @@ -1644,7 +1644,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, NULL, elem->name)); FREE_AND_NULL(str); *msg = xmlStrcat(*msg, BAD_CAST "', "); - *msg = xmlStrcat(*msg, BAD_CAST "attribute '"); + *msg = xmlStrcat(*msg, BAD_CAST "attribute '"); } else { *msg = xmlStrdup(BAD_CAST "Element '"); } @@ -1660,7 +1660,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) actxt; /* * Work on node infos. - */ + */ if (vctxt->inode->nodeType == XML_ATTRIBUTE_NODE) { xmlSchemaNodeInfoPtr ielem = vctxt->elemInfos[vctxt->depth]; @@ -1670,7 +1670,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, ielem->nsName, ielem->localName)); FREE_AND_NULL(str); *msg = xmlStrcat(*msg, BAD_CAST "', "); - *msg = xmlStrcat(*msg, BAD_CAST "attribute '"); + *msg = xmlStrcat(*msg, BAD_CAST "attribute '"); } else { *msg = xmlStrdup(BAD_CAST "Element '"); } @@ -1686,7 +1686,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg, * VAL TODO: The output of the given schema component is currently * disabled. */ -#if 0 +#if 0 if ((type != NULL) && (xmlSchemaIsGlobalItem(type))) { *msg = xmlStrcat(*msg, BAD_CAST " ["); *msg = xmlStrcat(*msg, xmlSchemaFormatItemForReport(&str, @@ -1707,7 +1707,7 @@ xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt, msg = xmlStrdup(BAD_CAST "Internal error: "); msg = xmlStrcat(msg, BAD_CAST funcName); - msg = xmlStrcat(msg, BAD_CAST ", "); + msg = xmlStrcat(msg, BAD_CAST ", "); msg = xmlStrcat(msg, BAD_CAST message); msg = xmlStrcat(msg, BAD_CAST ".\n"); @@ -1735,7 +1735,7 @@ xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt, xmlSchemaFormatNodeForError(&msg, actxt, node); msg = xmlStrcat(msg, (const xmlChar *) message); - msg = xmlStrcat(msg, BAD_CAST ".\n"); + msg = xmlStrcat(msg, BAD_CAST ".\n"); xmlSchemaErr(actxt, error, node, (const char *) msg, str1, str2); FREE_AND_NULL(msg) @@ -1818,7 +1818,7 @@ xmlSchemaSimpleTypeErr(xmlSchemaAbstractCtxtPtr actxt, if (type->builtInType != 0) { msg = xmlStrcat(msg, BAD_CAST "xs:"); msg = xmlStrcat(msg, type->name); - } else + } else msg = xmlStrcat(msg, xmlSchemaFormatQName(&str, type->targetNamespace, type->name)); @@ -1856,12 +1856,12 @@ xmlSchemaIllegalAttrErr(xmlSchemaAbstractCtxtPtr actxt, xmlNodePtr node) { xmlChar *msg = NULL, *str = NULL; - + xmlSchemaFormatNodeForError(&msg, actxt, node); msg = xmlStrcat(msg, BAD_CAST "The attribute '%s' is not allowed.\n"); xmlSchemaErr(actxt, error, node, (const char *) msg, xmlSchemaFormatErrorNodeQName(&str, (xmlSchemaNodeInfoPtr) ni, node), - NULL); + NULL); FREE_AND_NULL(str) FREE_AND_NULL(msg) } @@ -1880,7 +1880,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, xmlChar *localName, *nsName; const xmlChar *cur, *end; int i; - + xmlSchemaFormatNodeForError(&msg, actxt, node); msg = xmlStrcat(msg, (const xmlChar *) message); msg = xmlStrcat(msg, BAD_CAST "."); @@ -1895,14 +1895,14 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, } else str = xmlStrdup(BAD_CAST " Expected is ( "); nsName = NULL; - + for (i = 0; i < nbval + nbneg; i++) { cur = values[i]; /* * Get the local name. */ localName = NULL; - + end = cur; if (*end == '*') { localName = xmlStrdup(BAD_CAST "*"); @@ -1911,8 +1911,8 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, while ((*end != 0) && (*end != '|')) end++; localName = xmlStrncat(localName, BAD_CAST cur, end - cur); - } - if (*end != 0) { + } + if (*end != 0) { end++; /* * Skip "*|*" if they come with negated expressions, since @@ -1928,12 +1928,12 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, } else { while (*end != 0) end++; - + if (i >= nbval) nsName = xmlStrdup(BAD_CAST "{##other:"); else nsName = xmlStrdup(BAD_CAST "{"); - + nsName = xmlStrncat(nsName, BAD_CAST cur, end - cur); nsName = xmlStrcat(nsName, BAD_CAST "}"); } @@ -1943,13 +1943,13 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt, FREE_AND_NULL(localName); continue; } - } + } str = xmlStrcat(str, BAD_CAST localName); FREE_AND_NULL(localName); - + if (i < nbval + nbneg -1) str = xmlStrcat(str, BAD_CAST ", "); - } + } str = xmlStrcat(str, BAD_CAST " ).\n"); msg = xmlStrcat(msg, BAD_CAST str); FREE_AND_NULL(str) @@ -1981,8 +1981,8 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, /* * If enumerations are validated, one must not expect the * facet to be given. - */ - } else + */ + } else facetType = facet->type; msg = xmlStrcat(msg, BAD_CAST "["); msg = xmlStrcat(msg, BAD_CAST "facet '"); @@ -2010,31 +2010,31 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, snprintf(actLen, 24, "%lu", length); if (facetType == XML_SCHEMA_FACET_LENGTH) - msg = xmlStrcat(msg, - BAD_CAST "this differs from the allowed length of '%s'.\n"); + msg = xmlStrcat(msg, + BAD_CAST "this differs from the allowed length of '%s'.\n"); else if (facetType == XML_SCHEMA_FACET_MAXLENGTH) - msg = xmlStrcat(msg, + msg = xmlStrcat(msg, BAD_CAST "this exceeds the allowed maximum length of '%s'.\n"); else if (facetType == XML_SCHEMA_FACET_MINLENGTH) - msg = xmlStrcat(msg, + msg = xmlStrcat(msg, BAD_CAST "this underruns the allowed minimum length of '%s'.\n"); - + if (nodeType == XML_ATTRIBUTE_NODE) xmlSchemaErr3(actxt, error, node, (const char *) msg, value, (const xmlChar *) actLen, (const xmlChar *) len); - else + else xmlSchemaErr(actxt, error, node, (const char *) msg, (const xmlChar *) actLen, (const xmlChar *) len); - + } else if (facetType == XML_SCHEMA_FACET_ENUMERATION) { msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not an element " "of the set {%s}.\n"); - xmlSchemaErr(actxt, error, node, (const char *) msg, value, + xmlSchemaErr(actxt, error, node, (const char *) msg, value, xmlSchemaFormatFacetEnumSet(actxt, &str, type)); } else if (facetType == XML_SCHEMA_FACET_PATTERN) { msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not accepted " "by the pattern '%s'.\n"); - xmlSchemaErr(actxt, error, node, (const char *) msg, value, + xmlSchemaErr(actxt, error, node, (const char *) msg, value, facet->value); } else if (facetType == XML_SCHEMA_FACET_MININCLUSIVE) { msg = xmlStrcat(msg, BAD_CAST "The value '%s' is less than the " @@ -2066,10 +2066,10 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, "digits than are allowed ('%s').\n"); xmlSchemaErr(actxt, error, node, (const char*) msg, value, facet->value); - } else if (nodeType == XML_ATTRIBUTE_NODE) { + } else if (nodeType == XML_ATTRIBUTE_NODE) { msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not facet-valid.\n"); - xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL); - } else { + xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL); + } else { msg = xmlStrcat(msg, BAD_CAST "The value is not facet-valid.\n"); xmlSchemaErr(actxt, error, node, (const char *) msg, NULL, NULL); } @@ -2077,7 +2077,7 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt, msg = xmlStrcat(msg, (const xmlChar *) message); msg = xmlStrcat(msg, BAD_CAST ".\n"); xmlSchemaErr(actxt, error, node, (const char *) msg, str1, str2); - } + } FREE_AND_NULL(str) xmlFree(msg); } @@ -2462,7 +2462,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt, * @error: the error code * @type: the type specifier * @ownerDes: the designation of the owner - * @ownerItem: the schema object if existent + * @ownerItem: the schema object if existent * @node: the validated node * @value: the validated value * @@ -2470,7 +2470,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt, * TODO: Should this report the value of an element as well? */ static void -xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, +xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, xmlParserErrors error, xmlSchemaTypePtr ownerItem ATTRIBUTE_UNUSED, xmlNodePtr node, @@ -2482,37 +2482,37 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, const xmlChar *str2) { xmlChar *msg = NULL; - + xmlSchemaFormatNodeForError(&msg, (xmlSchemaAbstractCtxtPtr) ctxt, node); if (message == NULL) { /* * Use default messages. - */ + */ if (type != NULL) { if (node->type == XML_ATTRIBUTE_NODE) msg = xmlStrcat(msg, BAD_CAST "'%s' is not a valid value of "); else msg = xmlStrcat(msg, BAD_CAST "The character content is not a " - "valid value of "); + "valid value of "); if (! xmlSchemaIsGlobalItem(type)) msg = xmlStrcat(msg, BAD_CAST "the local "); else msg = xmlStrcat(msg, BAD_CAST "the "); - + if (VARIETY_ATOMIC(type)) msg = xmlStrcat(msg, BAD_CAST "atomic type"); else if (VARIETY_LIST(type)) msg = xmlStrcat(msg, BAD_CAST "list type"); else if (VARIETY_UNION(type)) msg = xmlStrcat(msg, BAD_CAST "union type"); - + if (xmlSchemaIsGlobalItem(type)) { xmlChar *str = NULL; msg = xmlStrcat(msg, BAD_CAST " '"); if (type->builtInType != 0) { msg = xmlStrcat(msg, BAD_CAST "xs:"); msg = xmlStrcat(msg, type->name); - } else + } else msg = xmlStrcat(msg, xmlSchemaFormatQName(&str, type->targetNamespace, type->name)); @@ -2525,7 +2525,7 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, else msg = xmlStrcat(msg, BAD_CAST "The character content is not " "valid."); - } + } if (expected) { msg = xmlStrcat(msg, BAD_CAST " Expected is '"); msg = xmlStrcat(msg, BAD_CAST expected); @@ -2540,7 +2540,7 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPErrExt(ctxt, node, error, NULL, NULL, NULL, "%s%s.\n", msg, BAD_CAST message, str1, str2, NULL); } - /* Cleanup. */ + /* Cleanup. */ FREE_AND_NULL(msg) } @@ -4218,7 +4218,7 @@ xmlSchemaIsBlank(xmlChar * str, int len) str++; len--; } - + return (1); } @@ -5473,7 +5473,7 @@ xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt, ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; else ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; - xmlSchemaPSimpleTypeErr(pctxt, + xmlSchemaPSimpleTypeErr(pctxt, ret, ownerItem, (xmlNodePtr) attr, type, NULL, value, NULL, NULL, NULL); } @@ -8783,7 +8783,7 @@ xmlSchemaNewParserCtxtUseDict(const char *URL, xmlDictPtr dict) } memset(ret, 0, sizeof(xmlSchemaParserCtxt)); ret->dict = dict; - xmlDictReference(dict); + xmlDictReference(dict); if (URL != NULL) ret->URL = xmlDictLookup(dict, (const xmlChar *) URL, -1); ret->includes = 0; @@ -8804,7 +8804,7 @@ xmlSchemaCreatePCtxtOnVCtxt(xmlSchemaValidCtxtPtr vctxt) return (-1); } /* TODO: Pass user data. */ - xmlSchemaSetParserErrors(vctxt->pctxt, vctxt->error, vctxt->warning, NULL); + xmlSchemaSetParserErrors(vctxt->pctxt, vctxt->error, vctxt->warning, NULL); } return (0); } @@ -10435,7 +10435,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, type, (xmlNodePtr) attr, NULL, "(#all | List of (extension | restriction))", attrValue, NULL, NULL, NULL); - } else + } else final = 1; } else if (xmlStrEqual(attr->name, BAD_CAST "block")) { /* @@ -10453,7 +10453,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema, type, (xmlNodePtr) attr, NULL, "(#all | List of (extension | restriction)) ", attrValue, NULL, NULL, NULL); - } else + } else block = 1; } else { xmlSchemaPIllegalAttrErr(ctxt, @@ -12512,7 +12512,7 @@ xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, } } } - attrs = type->attributes; + attrs = type->attributes; /* * Handle attribute wildcards. */ @@ -12686,7 +12686,7 @@ xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, xmlSchemaGetAttrTargetNsURI(base->attr))) { found = 1; - + if ((cur->attr->occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) && (base->attr->occurs == @@ -12726,7 +12726,7 @@ xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, FREE_AND_NULL(str) } else if (xmlSchemaCheckCOSSTDerivedOK( cur->attr->subtypes, base->attr->subtypes, 0) != 0) { - + /* * SPEC (2.1.2) "R's {attribute declaration}'s * {type definition} must be validly derived from @@ -12739,7 +12739,7 @@ xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, "The attribute declaration's type " "definition is not validly derived from " "the corresponding definition in the " - "base type", NULL); + "base type", NULL); } else { /* * 2.1.3 [Definition:] Let the effective value @@ -12758,7 +12758,7 @@ xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, if ((bEffValue != NULL) && (effFixed == 1)) { const xmlChar *rEffValue = NULL; - + xmlSchemaGetEffectiveValueConstraint(base->attr, &effFixed, &rEffValue, 0); /* @@ -12781,7 +12781,7 @@ xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, */ base->attr = cur->attr; } - } else + } else base->attr = cur->attr; } @@ -12825,7 +12825,7 @@ xmlSchemaBuildAttributeValidation(xmlSchemaParserCtxtPtr pctxt, } else lastBaseUse->next = tmp; lastBaseUse = tmp; - + continue; } } @@ -14564,7 +14564,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt, /* * SPEC (5.4.1.1) "The {content type} of the complex type definition * itself must be element-only" - */ + */ if (HAS_MIXED_CONTENT(type) && (! HAS_MIXED_CONTENT(base))) { /* * SPEC (5.4.1.2) "The {content type} of the complex type @@ -14723,11 +14723,11 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt, if (! xmlSchemaIsParticleEmptiable( (xmlSchemaParticlePtr) base->subtypes)) { ret = XML_SCHEMAP_SRC_CT_1; - } else + } else /* * Attention: at this point the child is in * ->contentTypeDef (put there during parsing). - */ + */ if (type->contentTypeDef == NULL) { xmlChar *str = NULL; /* @@ -15819,7 +15819,7 @@ xmlSchemaFinishMemberTypeDefinitionsProperty(xmlSchemaParserCtxtPtr pctxt, static void xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) -{ +{ int has = 0, needVal = 0, normVal = 0; has = (type->baseType->flags & XML_SCHEMAS_TYPE_HAS_FACETS) ? 1 : 0; @@ -15831,7 +15831,7 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) } if (type->facets != NULL) { xmlSchemaFacetPtr fac; - + for (fac = type->facets; fac != NULL; fac = fac->next) { switch (fac->type) { case XML_SCHEMA_FACET_WHITESPACE: @@ -15849,7 +15849,7 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) has = 1; break; } - } + } } if (normVal) type->flags |= XML_SCHEMAS_TYPE_NORMVALUENEEDED; @@ -15866,24 +15866,24 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type) if ((prim->builtInType != XML_SCHEMAS_ANYSIMPLETYPE) && (prim->builtInType != XML_SCHEMAS_STRING)) { type->flags |= XML_SCHEMAS_TYPE_FACETSNEEDVALUE; - } - } + } + } } static int xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type) { - - + + /* * Evaluate the whitespace-facet value. - */ + */ if (VARIETY_LIST(type)) { type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE; return (0); } else if (VARIETY_UNION(type)) return (0); - + if (type->facetSet != NULL) { xmlSchemaFacetLinkPtr lin; @@ -15907,23 +15907,23 @@ xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type) } } /* - * For all ·atomic· datatypes other than string (and types ·derived· - * by ·restriction· from it) the value of whiteSpace is fixed to + * For all ·atomic· datatypes other than string (and types ·derived· + * by ·restriction· from it) the value of whiteSpace is fixed to * collapse */ { xmlSchemaTypePtr anc; - for (anc = type->baseType; anc != NULL && + for (anc = type->baseType; anc != NULL && anc->builtInType != XML_SCHEMAS_ANYTYPE; anc = anc->baseType) { if (anc->type == XML_SCHEMA_TYPE_BASIC) { - if (anc->builtInType == XML_SCHEMAS_NORMSTRING) { + if (anc->builtInType == XML_SCHEMAS_NORMSTRING) { type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_REPLACE; } else if ((anc->builtInType == XML_SCHEMAS_STRING) || - (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) { + (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) { type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE; } else @@ -15981,7 +15981,7 @@ xmlSchemaTypeFixup(xmlSchemaTypePtr type, * TODO: Generate a warning! */ return; - } + } /* * This basically checks if the base type can be derived. */ @@ -16032,7 +16032,7 @@ xmlSchemaTypeFixup(xmlSchemaTypePtr type, * * Create the anonymous simple type, which will be the content * type of the complex type. - */ + */ snprintf(buf, 29, "#scST%d", ++(pctxt->counter)); tmpname = xmlDictLookup(pctxt->dict, BAD_CAST buf, -1); content = xmlSchemaAddType(pctxt, @@ -16499,11 +16499,11 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, } } else base = typeDecl; - + if (! ctxtGiven) { /* * A context is needed if called from RelaxNG. - */ + */ pctxt = xmlSchemaNewParserCtxt("*"); if (pctxt == NULL) return (-1); @@ -16514,17 +16514,17 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet, * facet->node is just the node holding the facet * definition, *not* the attribute holding the *value* * of the facet. - */ + */ ret = xmlSchemaVCheckCVCSimpleType( (xmlSchemaAbstractCtxtPtr) pctxt, facet->node, base, facet->value, &(facet->val), 1, 1, 0); if (ret != 0) { if (ret < 0) { /* No error message for RelaxNG. */ - if (ctxtGiven) { + if (ctxtGiven) { xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) pctxt, XML_SCHEMAP_INTERNAL, facet->node, NULL, - "Internal error: xmlSchemaCheckFacet, " + "Internal error: xmlSchemaCheckFacet, " "failed to validate the value '%s' of the " "facet '%s' against the base type", facet->value, xmlSchemaFacetTypeToString(facet->type)); @@ -16791,7 +16791,7 @@ xmlSchemaCheckGroupDefCircular(xmlSchemaModelGroupDefPtr item, * Assigns the model group of model group definitions to the "term" * of the referencing particle. * In xmlSchemaMiscRefFixup the model group definitions was assigned - * to the "term", since needed for the circularity check. + * to the "term", since needed for the circularity check. */ static void xmlSchemaGroupDefTermFixup(xmlSchemaParticlePtr item, @@ -17411,9 +17411,9 @@ xmlSchemaMiscRefFixup(xmlSchemaTreeItemPtr item, static int xmlSchemaAreValuesEqual(xmlSchemaValPtr x, - xmlSchemaValPtr y) -{ - xmlSchemaTypePtr tx, ty, ptx, pty; + xmlSchemaValPtr y) +{ + xmlSchemaTypePtr tx, ty, ptx, pty; int ret; while (x != NULL) { @@ -17459,7 +17459,7 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x, if (x != NULL) { y = xmlSchemaValueGetNext(y); if (y == NULL) - return (0); + return (0); } else if (xmlSchemaValueGetNext(y) != NULL) return (0); else @@ -17608,7 +17608,7 @@ xmlSchemaResolveIDCKeyRef(xmlSchemaIDCPtr idc, ((xmlSchemaIDCPtr) idc->ref->item)->nbFields) { xmlChar *str = NULL; xmlSchemaIDCPtr refer; - + refer = (xmlSchemaIDCPtr) idc->ref->item; /* * SPEC c-props-correct(2) @@ -17622,7 +17622,7 @@ xmlSchemaResolveIDCKeyRef(xmlSchemaIDCPtr idc, "The cardinality of the keyref differs from the " "cardinality of the referenced key '%s'", xmlSchemaFormatQName(&str, refer->targetNamespace, - refer->name) + refer->name) ); FREE_AND_NULL(str) } @@ -18263,7 +18263,7 @@ finally: } static xmlSchemaAttrInfoPtr -xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt, +xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt, int metaType) { if (vctxt->nbAttrInfos == 0) @@ -18364,7 +18364,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, if (vctxt->sax != NULL) { int i, j; xmlSchemaNodeInfoPtr inode; - + for (i = vctxt->depth; i >= 0; i--) { if (vctxt->elemInfos[i]->nbNsBindings != 0) { inode = vctxt->elemInfos[i]; @@ -18378,7 +18378,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, * Note that the namespace bindings are already * in a string dict. */ - return (inode->nsBindings[j+1]); + return (inode->nsBindings[j+1]); } } } @@ -18387,7 +18387,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, #ifdef LIBXML_WRITER_ENABLED } else if (vctxt->reader != NULL) { xmlChar *nsName; - + nsName = xmlTextReaderLookupNamespace(vctxt->reader, prefix); if (nsName != NULL) { const xmlChar *ret; @@ -18420,7 +18420,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt, * This one works on the schema of the validation context. */ static int -xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt, +xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt, xmlSchemaPtr schema, xmlNodePtr node, const xmlChar *value, @@ -18445,7 +18445,7 @@ xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt, if (prefix != NULL) { const xmlChar *nsName = NULL; - if (vctxt != NULL) + if (vctxt != NULL) nsName = xmlSchemaLookupNamespace(vctxt, BAD_CAST prefix); else if (node != NULL) { xmlNsPtr ns = xmlSearchNs(node->doc, node, prefix); @@ -18828,7 +18828,7 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt, sto = vctxt->xpathStatePool; vctxt->xpathStatePool = sto->next; sto->next = NULL; - } else { + } else { /* * Create a new state object. */ @@ -18839,10 +18839,10 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt, return (-1); } memset(sto, 0, sizeof(xmlSchemaIDCStateObj)); - } + } /* - * Add to global list. - */ + * Add to global list. + */ if (vctxt->xpathStates != NULL) sto->next = vctxt->xpathStates; vctxt->xpathStates = sto; @@ -18862,13 +18862,13 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt, VERROR_INT("xmlSchemaIDCAddStateObject", "failed to create an XPath validation context"); return (-1); - } + } sto->type = type; sto->depth = vctxt->depth; sto->matcher = matcher; sto->sel = sel; sto->nbHistory = 0; - + #if DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: STO push '%s'\n", sto->sel->xpath); @@ -18892,7 +18892,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, { xmlSchemaIDCStateObjPtr sto, head = NULL, first; int res, resolved = 0, depth = vctxt->depth; - + if (vctxt->xpathStates == NULL) return (0); @@ -18901,8 +18901,8 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, #if DEBUG_IDC { xmlChar *str = NULL; - xmlGenericError(xmlGenericErrorContext, - "IDC: EVAL on %s, depth %d, type %d\n", + xmlGenericError(xmlGenericErrorContext, + "IDC: EVAL on %s, depth %d, type %d\n", xmlSchemaFormatQName(&str, vctxt->inode->nsName, vctxt->inode->localName), depth, nodeType); FREE_AND_NULL(str) @@ -18916,10 +18916,10 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, while (sto != head) { #if DEBUG_IDC if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) - xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] selector '%s'\n", + xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] selector '%s'\n", sto->matcher->aidc->def->name, sto->sel->xpath); else - xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] field '%s'\n", + xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] field '%s'\n", sto->matcher->aidc->def->name, sto->sel->xpath); #endif if (nodeType == XML_ELEMENT_NODE) @@ -18949,7 +18949,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, if (sto->history == NULL) { sto->history = (int *) xmlMalloc(5 * sizeof(int)); if (sto->history == NULL) { - xmlSchemaVErrMemory(NULL, + xmlSchemaVErrMemory(NULL, "allocating the state object history", NULL); return(-1); } @@ -18959,11 +18959,11 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt, sto->history = (int *) xmlRealloc(sto->history, sto->sizeHistory * sizeof(int)); if (sto->history == NULL) { - xmlSchemaVErrMemory(NULL, + xmlSchemaVErrMemory(NULL, "re-allocating the state object history", NULL); return(-1); } - } + } sto->history[sto->nbHistory++] = depth; #ifdef DEBUG_IDC @@ -19063,7 +19063,7 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt, * * Processes and pops the history items of the IDC state objects. * IDC key-sequences are validated/created on IDC bindings. - * + * * Returns 0 on success and -1 on internal errors. */ static int @@ -19082,13 +19082,13 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, #if DEBUG_IDC { xmlChar *str = NULL; - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "IDC: BACK on %s, depth %d\n", xmlSchemaFormatQName(&str, vctxt->inode->nsName, vctxt->inode->localName), vctxt->depth); FREE_AND_NULL(str) } -#endif +#endif /* * Evaluate the state objects. */ @@ -19114,19 +19114,19 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, if (matchDepth != depth) { sto = sto->next; continue; - } + } if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_FIELD) { if (! IS_SIMPLE_TYPE(type)) { /* * Not qualified if the field resolves to a node of non * simple type. - */ + */ xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, - XML_SCHEMAV_CVC_IDC, NULL, + XML_SCHEMAV_CVC_IDC, NULL, (xmlSchemaTypePtr) sto->matcher->aidc->def, "The field '%s' does evaluate to a node of " "non-simple type", sto->sel->xpath, NULL); - + sto->nbHistory--; goto deregister_check; } @@ -19145,28 +19145,28 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, xmlSchemaIDCMatcherPtr matcher = sto->matcher; xmlSchemaPSVIIDCKeyPtr *keySeq; int pos, idx; - + /* * The key will be anchored on the matcher's list of * key-sequences. The position in this list is determined * by the target node's depth relative to the matcher's * depth of creation (i.e. the depth of the scope element). - */ + */ pos = sto->depth - matcher->depth; idx = sto->sel->index; - + /* * Create/grow the array of key-sequences. */ if (matcher->keySeqs == NULL) { - if (pos > 9) + if (pos > 9) matcher->sizeKeySeqs = pos * 2; else matcher->sizeKeySeqs = 10; - matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **) + matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **) xmlMalloc(matcher->sizeKeySeqs * - sizeof(xmlSchemaPSVIIDCKeyPtr *)); - if (matcher->keySeqs == NULL) { + sizeof(xmlSchemaPSVIIDCKeyPtr *)); + if (matcher->keySeqs == NULL) { xmlSchemaVErrMemory(NULL, "allocating an array of key-sequences", NULL); @@ -19175,9 +19175,9 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, memset(matcher->keySeqs, 0, matcher->sizeKeySeqs * sizeof(xmlSchemaPSVIIDCKeyPtr *)); - } else if (pos >= matcher->sizeKeySeqs) { + } else if (pos >= matcher->sizeKeySeqs) { int i = matcher->sizeKeySeqs; - + matcher->sizeKeySeqs *= 2; matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **) xmlRealloc(matcher->keySeqs, @@ -19193,15 +19193,15 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, * The array needs to be NULLed. * TODO: Use memset? */ - for (; i < matcher->sizeKeySeqs; i++) - matcher->keySeqs[i] = NULL; + for (; i < matcher->sizeKeySeqs; i++) + matcher->keySeqs[i] = NULL; } - + /* * Get/create the key-sequence. */ - keySeq = matcher->keySeqs[pos]; - if (keySeq == NULL) { + keySeq = matcher->keySeqs[pos]; + if (keySeq == NULL) { goto create_sequence; } else { if (keySeq[idx] != NULL) { @@ -19212,10 +19212,10 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, * node, evaluate to either an empty node-set or * a node-set with exactly one member, which must * have a simple type. - * + * * The key was already set; report an error. */ - xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, + xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, XML_SCHEMAV_CVC_IDC, NULL, (xmlSchemaTypePtr) matcher->aidc->def, "The field '%s' evaluates to a node-set " @@ -19227,26 +19227,26 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, goto create_key; } } - + create_sequence: /* * Create a key-sequence. */ keySeq = (xmlSchemaPSVIIDCKeyPtr *) xmlMalloc( - matcher->aidc->def->nbFields * + matcher->aidc->def->nbFields * sizeof(xmlSchemaPSVIIDCKeyPtr)); if (keySeq == NULL) { - xmlSchemaVErrMemory(NULL, + xmlSchemaVErrMemory(NULL, "allocating an IDC key-sequence", NULL); - return(-1); - } - memset(keySeq, 0, matcher->aidc->def->nbFields * + return(-1); + } + memset(keySeq, 0, matcher->aidc->def->nbFields * sizeof(xmlSchemaPSVIIDCKeyPtr)); matcher->keySeqs[pos] = keySeq; create_key: /* * Created a key once per node only. - */ + */ if (key == NULL) { key = (xmlSchemaPSVIIDCKeyPtr) xmlMalloc( sizeof(xmlSchemaPSVIIDCKey)); @@ -19255,7 +19255,7 @@ create_key: "allocating a IDC key", NULL); xmlFree(keySeq); matcher->keySeqs[pos] = NULL; - return(-1); + return(-1); } /* * Consume the compiled value. @@ -19271,10 +19271,10 @@ create_key: return (-1); } } - keySeq[idx] = key; + keySeq[idx] = key; } } else if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) { - + xmlSchemaPSVIIDCKeyPtr **keySeq = NULL; xmlSchemaPSVIIDCBindingPtr bind; xmlSchemaPSVIIDCNodePtr ntItem; @@ -19284,22 +19284,22 @@ create_key: /* * Here we have the following scenario: * An IDC 'selector' state object resolved to a target node, - * during the time this target node was in the - * ancestor-or-self axis, the 'field' state object(s) looked - * out for matching nodes to create a key-sequence for this + * during the time this target node was in the + * ancestor-or-self axis, the 'field' state object(s) looked + * out for matching nodes to create a key-sequence for this * target node. Now we are back to this target node and need - * to put the key-sequence, together with the target node - * itself, into the node-table of the corresponding IDC + * to put the key-sequence, together with the target node + * itself, into the node-table of the corresponding IDC * binding. */ matcher = sto->matcher; idc = matcher->aidc->def; nbKeys = idc->nbFields; - pos = depth - matcher->depth; + pos = depth - matcher->depth; /* * Check if the matcher has any key-sequences at all, plus * if it has a key-sequence for the current target node. - */ + */ if ((matcher->keySeqs == NULL) || (matcher->sizeKeySeqs <= pos)) { if (idc->type == XML_SCHEMA_TYPE_IDC_KEY) @@ -19307,15 +19307,15 @@ create_key: else goto selector_leave; } - - keySeq = &(matcher->keySeqs[pos]); + + keySeq = &(matcher->keySeqs[pos]); if (*keySeq == NULL) { if (idc->type == XML_SCHEMA_TYPE_IDC_KEY) goto selector_key_error; else goto selector_leave; } - + for (i = 0; i < nbKeys; i++) { if ((*keySeq)[i] == NULL) { /* @@ -19326,14 +19326,14 @@ create_key: * All fields of a "key" IDC must resolve. */ goto selector_key_error; - } + } goto selector_leave; } } /* * All fields did resolve. */ - + /* * 4.1 If the {identity-constraint category} is unique(/key), * then no two members of the ·qualified node set· have @@ -19344,20 +19344,20 @@ create_key: * duplicate key-sequences. */ bind = xmlSchemaIDCAquireBinding(vctxt, matcher); - if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) && + if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) && (bind->nbNodes != 0)) { xmlSchemaPSVIIDCKeyPtr ckey, bkey, *bkeySeq; - + i = 0; res = 0; /* * Compare the key-sequences, key by key. */ do { - bkeySeq = bind->nodeTable[i]->keys; + bkeySeq = bind->nodeTable[i]->keys; for (j = 0; j < nbKeys; j++) { ckey = (*keySeq)[j]; - bkey = bkeySeq[j]; + bkey = bkeySeq[j]; res = xmlSchemaAreValuesEqual(ckey->val, bkey->val); if (res == -1) { return (-1); @@ -19374,10 +19374,10 @@ create_key: } while (i < bind->nbNodes); if (i != bind->nbNodes) { xmlChar *str = NULL; - /* + /* * TODO: Try to report the key-sequence. */ - xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, + xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, XML_SCHEMAV_CVC_IDC, NULL, (xmlSchemaTypePtr) idc, "Duplicate key-sequence %s", @@ -19393,15 +19393,15 @@ create_key: ntItem = (xmlSchemaPSVIIDCNodePtr) xmlMalloc( sizeof(xmlSchemaPSVIIDCNode)); if (ntItem == NULL) { - xmlSchemaVErrMemory(NULL, + xmlSchemaVErrMemory(NULL, "allocating an IDC node-table item", NULL); xmlFree(*keySeq); *keySeq = NULL; return(-1); - } - memset(ntItem, 0, sizeof(xmlSchemaPSVIIDCNode)); - - /* + } + memset(ntItem, 0, sizeof(xmlSchemaPSVIIDCNode)); + + /* * Store the node-table item on global list. */ if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) { @@ -19418,9 +19418,9 @@ create_key: ntItem->node = vctxt->node; ntItem->keys = *keySeq; *keySeq = NULL; - if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1) { + if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1) { if (idc->type == XML_SCHEMA_TYPE_IDC_KEYREF) { - /* + /* * Free the item, since keyref items won't be * put on a global list. */ @@ -19429,12 +19429,12 @@ create_key: } return (-1); } - + goto selector_leave; selector_key_error: /* - * 4.2.1 (KEY) The ·target node set· and the - * ·qualified node set· are equal, that is, every + * 4.2.1 (KEY) The ·target node set· and the + * ·qualified node set· are equal, that is, every * member of the ·target node set· is also a member * of the ·qualified node set· and vice versa. */ @@ -19449,7 +19449,7 @@ selector_leave: *keySeq = NULL; } } /* if selector */ - + sto->nbHistory--; deregister_check: @@ -19475,7 +19475,7 @@ deregister_check: /* * Link it to the pool of reusable state objects. */ - vctxt->xpathStatePool = sto; + vctxt->xpathStatePool = sto; sto = nextsto; } else sto = sto->next; @@ -19500,15 +19500,15 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, xmlSchemaIDCMatcherPtr matcher, last = NULL; xmlSchemaIDCPtr idc, refIdc; xmlSchemaIDCAugPtr aidc; - + idc = (xmlSchemaIDCPtr) elemDecl->idcs; if (idc == NULL) return (0); - + #if DEBUG_IDC { xmlChar *str = NULL; - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "IDC: REGISTER on %s, depth %d\n", (char *) xmlSchemaFormatQName(&str, vctxt->inode->nsName, vctxt->inode->localName), vctxt->depth); @@ -19545,7 +19545,7 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, "Could not find an augmented IDC item for an IDC " "definition"); return (-1); - } + } if ((aidc->bubbleDepth == -1) || (vctxt->depth < aidc->bubbleDepth)) aidc->bubbleDepth = vctxt->depth; @@ -19568,10 +19568,10 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, /* * Create an IDC matcher for every IDC definition. */ - matcher = (xmlSchemaIDCMatcherPtr) + matcher = (xmlSchemaIDCMatcherPtr) xmlMalloc(sizeof(xmlSchemaIDCMatcher)); if (matcher == NULL) { - xmlSchemaVErrMemory(vctxt, + xmlSchemaVErrMemory(vctxt, "allocating an IDC matcher", NULL); return (-1); } @@ -19583,15 +19583,15 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, last = matcher; matcher->type = IDC_MATCHER; - matcher->depth = vctxt->depth; + matcher->depth = vctxt->depth; matcher->aidc = aidc; -#if DEBUG_IDC +#if DEBUG_IDC xmlGenericError(xmlGenericErrorContext, "IDC: register matcher\n"); -#endif +#endif /* - * Init the automaton state object. + * Init the automaton state object. */ - if (xmlSchemaIDCAddStateObject(vctxt, matcher, + if (xmlSchemaIDCAddStateObject(vctxt, matcher, idc->selector, XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) == -1) return (-1); @@ -19601,12 +19601,12 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt, } /** - * xmlSchemaBubbleIDCNodeTables: + * xmlSchemaBubbleIDCNodeTables: * @depth: the current tree depth * - * Merges IDC bindings of an element at @depth into the corresponding IDC - * bindings of its parent element. If a duplicate note-table entry is found, - * both, the parent node-table entry and child entry are discarded from the + * Merges IDC bindings of an element at @depth into the corresponding IDC + * bindings of its parent element. If a duplicate note-table entry is found, + * both, the parent node-table entry and child entry are discarded from the * node-table of the parent. * * Returns 0 if OK and -1 on internal errors. @@ -19626,21 +19626,21 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt) * The node table has the following sections: * * O --> old node-table entries (first) - * O + * O * + --> new node-table entries - * + - * % --> new duplicate node-table entries - * % - * # --> old duplicate node-table entries + * + + * % --> new duplicate node-table entries + * % + * # --> old duplicate node-table entries * # (last) * */ - bind = vctxt->inode->idcTable; + bind = vctxt->inode->idcTable; if (bind == NULL) { /* Fine, no table, no bubbles. */ return (0); } - + parTable = &(vctxt->elemInfos[vctxt->depth -1]->idcTable); /* * Walk all bindings; create new or add to existing bindings. @@ -19661,7 +19661,7 @@ start_binding: aidc = vctxt->aidcs; do { if (aidc->def == bind->definition) { - if ((aidc->bubbleDepth == -1) || + if ((aidc->bubbleDepth == -1) || (aidc->bubbleDepth >= vctxt->depth)) { bind = bind->next; goto start_binding; @@ -19681,7 +19681,7 @@ start_binding: if (parBind->definition == bind->definition) { /* - * Compare every node-table entry of the child node, + * Compare every node-table entry of the child node, * i.e. the key-sequence within, ... */ oldNum = parBind->nbNodes; /* Skip newly added items. */ @@ -19697,7 +19697,7 @@ start_binding: * evaluated to be a duplicate key-sequence. */ if (parBind->nbDupls != 0) { - j = bind->nbNodes + newDupls; + j = bind->nbNodes + newDupls; while (j < duplTop) { parNode = parBind->nodeTable[j]; for (k = 0; k < bind->definition->nbFields; k++) { @@ -19721,19 +19721,19 @@ start_binding: /* Duplicate found. */ continue; } - } + } /* * ... and with every key-sequence of the parent node. - */ + */ j = 0; while (j < oldNum) { parNode = parBind->nodeTable[j]; /* - * Compare key by key. + * Compare key by key. */ for (k = 0; k < parBind->definition->nbFields; k++) { key = node->keys[k]; - parKey = parNode->keys[k]; + parKey = parNode->keys[k]; ret = xmlSchemaAreValuesEqual(key->val, parKey->val); @@ -19760,48 +19760,48 @@ start_binding: /* * Move last old item to pos of duplicate. */ - parBind->nodeTable[j] = + parBind->nodeTable[j] = parBind->nodeTable[oldNum]; - + if (parBind->nbNodes != oldNum) { /* - * If new items exist, move last new item to + * If new items exist, move last new item to * last of old items. */ - parBind->nodeTable[oldNum] = + parBind->nodeTable[oldNum] = parBind->nodeTable[parBind->nbNodes]; } /* * Move duplicate to last pos of new/old items. */ - parBind->nodeTable[parBind->nbNodes] = parNode; - + parBind->nodeTable[parBind->nbNodes] = parNode; + } else { /* - * Add the node-table entry (node and key-sequence) of + * Add the node-table entry (node and key-sequence) of * the child node to the node table of the parent node. */ - if (parBind->nodeTable == NULL) { - parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) + if (parBind->nodeTable == NULL) { + parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) xmlMalloc(10 * sizeof(xmlSchemaPSVIIDCNodePtr)); if (parBind->nodeTable == NULL) { - xmlSchemaVErrMemory(NULL, + xmlSchemaVErrMemory(NULL, "allocating IDC list of node-table items", NULL); return(-1); } parBind->sizeNodes = 1; } else if (duplTop >= parBind->sizeNodes) { parBind->sizeNodes *= 2; - parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) - xmlRealloc(parBind->nodeTable, parBind->sizeNodes * + parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) + xmlRealloc(parBind->nodeTable, parBind->sizeNodes * sizeof(xmlSchemaPSVIIDCNodePtr)); if (parBind->nodeTable == NULL) { - xmlSchemaVErrMemory(NULL, + xmlSchemaVErrMemory(NULL, "re-allocating IDC list of node-table items", NULL); return(-1); } } - + /* * Move first old duplicate to last position * of old duplicates +1. @@ -19843,10 +19843,10 @@ start_binding: if (parBind == NULL) return(-1); - parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) + parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *) xmlMalloc(bind->nbNodes * sizeof(xmlSchemaPSVIIDCNodePtr)); if (parBind->nodeTable == NULL) { - xmlSchemaVErrMemory(NULL, + xmlSchemaVErrMemory(NULL, "allocating an array of IDC node-table items", NULL); xmlSchemaIDCFreeBinding(parBind); return(-1); @@ -19861,7 +19861,7 @@ start_binding: lastParBind->next = parBind; } bind = bind->next; - } + } return (0); } @@ -19892,7 +19892,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt) */ bind = vctxt->inode->idcTable; do { - if ((xmlSchemaIDCPtr) refbind->definition->ref->item == + if ((xmlSchemaIDCPtr) refbind->definition->ref->item == bind->definition) break; bind = bind->next; @@ -19903,7 +19903,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt) */ for (i = 0; i < refbind->nbNodes; i++) { res = 0; - if (bind != NULL) { + if (bind != NULL) { refKeys = refbind->nodeTable[i]->keys; for (j = 0; j < bind->nbNodes; j++) { keys = bind->nodeTable[j]->keys; @@ -20037,7 +20037,7 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt, if (nsName != NULL) { if (xmlStrEqual(localName, BAD_CAST "nil")) { if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) { - attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL; + attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL; } } else if (xmlStrEqual(localName, BAD_CAST "type")) { if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) { @@ -20236,7 +20236,7 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt, valType = valType; else valType = xmlSchemaGetValType(val); - + ret = 0; for (facetLink = type->facetSet; facetLink != NULL; facetLink = facetLink->next) { @@ -20285,11 +20285,11 @@ variety_list: ret = 0; for (facetLink = type->facetSet; facetLink != NULL; facetLink = facetLink->next) { - + switch (facetLink->facet->type) { case XML_SCHEMA_FACET_LENGTH: case XML_SCHEMA_FACET_MINLENGTH: - case XML_SCHEMA_FACET_MAXLENGTH: + case XML_SCHEMA_FACET_MAXLENGTH: ret = xmlSchemaValidateListSimpleTypeFacet(facetLink->facet, value, length, NULL); break; @@ -20301,7 +20301,7 @@ variety_list: "validating against a list type facet"); return (-1); } else if (ret > 0) { - if (fireErrors) + if (fireErrors) xmlSchemaFacetErr(actxt, ret, node, value, length, type, facetLink->facet, NULL, NULL, NULL); else @@ -20370,7 +20370,7 @@ pattern_and_enum: if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN) continue; found = 1; - /* + /* * NOTE that for patterns, @value needs to be the * normalized vaule. */ @@ -20382,7 +20382,7 @@ pattern_and_enum: "validating against a pattern facet"); return (-1); } else { - /* + /* * Save the last non-validating facet. */ facet = facetLink->facet; @@ -20405,12 +20405,12 @@ pattern_and_enum: return (error); } - + static xmlChar * xmlSchemaNormalizeValue(xmlSchemaTypePtr type, const xmlChar *value) { - switch (xmlSchemaGetWhiteSpaceFacetValue(type)) { + switch (xmlSchemaGetWhiteSpaceFacetValue(type)) { case XML_SCHEMA_WHITESPACE_COLLAPSE: return (xmlSchemaCollapseString(value)); case XML_SCHEMA_WHITESPACE_REPLACE: @@ -20429,7 +20429,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt, int ret; const xmlChar *nsName; xmlChar *local, *prefix = NULL; - + ret = xmlValidateQName(value, 1); if (ret != 0) { if (ret == -1) { @@ -20452,7 +20452,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt, * - is there a default namespace? */ nsName = xmlSchemaLookupNamespace(vctxt, prefix); - + if (prefix != NULL) { xmlFree(prefix); /* @@ -20509,7 +20509,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, value = normValue; \ isNormalized = 1; \ } - + if ((retVal != NULL) && (*retVal != NULL)) { xmlSchemaFreeValue(*retVal); *retVal = NULL; @@ -20570,9 +20570,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, * NOTATIONs need to be processed here, since they need * to lookup in the hashtable of NOTATION declarations of the schema. */ - if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) { - switch (biType->builtInType) { - case XML_SCHEMAS_NOTATION: + if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) { + switch (biType->builtInType) { + case XML_SCHEMAS_NOTATION: ret = xmlSchemaValidateNotation( (xmlSchemaValidCtxtPtr) actxt, ((xmlSchemaValidCtxtPtr) actxt)->schema, @@ -20592,8 +20592,8 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, value, NULL, NULL); break; } - } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) { - switch (biType->builtInType) { + } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) { + switch (biType->builtInType) { case XML_SCHEMAS_NOTATION: ret = xmlSchemaValidateNotation(NULL, ((xmlSchemaParserCtxtPtr) actxt)->schema, node, @@ -20608,7 +20608,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, ret = xmlSchemaValPredefTypeNodeNoNorm(biType, value, NULL, node); break; - } + } } else { /* * Validation via a public API is not implemented yet. @@ -20625,7 +20625,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, if (VARIETY_LIST(type)) ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; else - ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; + ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; } if ((ret == 0) && (type->flags & XML_SCHEMAS_TYPE_HAS_FACETS)) { /* @@ -20640,10 +20640,10 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, "validating facets of atomic simple type"); goto internal_error; } - if (VARIETY_LIST(type)) + if (VARIETY_LIST(type)) ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; else - ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; + ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1; } } if (fireErrors && (ret > 0)) @@ -20668,7 +20668,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, * VAL TODO: Optimize validation of empty values. * VAL TODO: We do not have computed values for lists. */ - itemType = GET_LIST_ITEM_TYPE(type); + itemType = GET_LIST_ITEM_TYPE(type); cur = value; do { while (IS_BLANK_CH(*cur)) @@ -20707,7 +20707,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, } ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2; break; - } + } cur = end; } while (*cur != 0); FREE_AND_NULL(tmpValue); @@ -20728,7 +20728,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, } } if (fireErrors && (ret > 0)) { - /* + /* * Report the normalized value. */ normalize = 1; @@ -20758,7 +20758,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, AERROR_INT("xmlSchemaVCheckCVCSimpleType", "union simple type has no member types"); goto internal_error; - } + } /* * Always normalize union type values, since we currently * cannot store the whitespace information with the value @@ -20766,7 +20766,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, * not possible. */ while (memberLink != NULL) { - if (valNeeded) + if (valNeeded) ret = xmlSchemaVCheckCVCSimpleType(actxt, node, memberLink->type, value, &val, 0, 1, 0); else @@ -20803,7 +20803,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt, "validating facets of union simple type"); goto internal_error; } - ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3; + ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3; } } if (fireErrors && (ret > 0)) @@ -21227,7 +21227,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) * noNamespaceSchemaLocation, the appropriate case among the following * must be true: * - */ + */ nbAttrs = vctxt->nbAttrInfos; for (attrUseLink = type->attributeUses; attrUseLink != NULL; attrUseLink = attrUseLink->next) { @@ -21304,7 +21304,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) } tmpAttr->state = XML_SCHEMAS_ATTR_ERR_MISSING; tmpAttr->use = attrUse; - tmpAttr->decl = attrDecl; + tmpAttr->decl = attrDecl; } else if ((attrUse->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) && ((attrUse->defValue != NULL) || (attrDecl->defValue != NULL))) { @@ -21608,7 +21608,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) /* * SPEC (cvc-attribute) * (3) "The item's ·normalized value· must be locally ·valid· - * with respect to that {type definition} as per + * with respect to that {type definition} as per * String Valid (§3.14.4)." * * VAL TODO: Do we already have the @@ -21629,7 +21629,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt) attr->node, attr->typeDef, attr->value, NULL, 1, 0, 0); } - + if (res != 0) { if (res == -1) { VERROR_INT("xmlSchemaVAttributesComplex", @@ -21751,8 +21751,8 @@ eval_idcs: xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, XML_SCHEMAV_CVC_AU, NULL, NULL, "The value '%s' does not match the fixed " - "value constraint '%s'", - attr->value, attr->vcValue); + "value constraint '%s'", + attr->value, attr->vcValue); break; case XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL: VERROR(XML_SCHEMAV_CVC_WILDCARD, NULL, @@ -21908,16 +21908,16 @@ static int xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, const xmlChar *value, xmlSchemaValPtr *val) -{ +{ int ret = 0; xmlSchemaNodeInfoPtr inode = vctxt->inode; /* * cos-valid-default: * Schema Component Constraint: Element Default Valid (Immediate) - * For a string to be a valid default with respect to a type + * For a string to be a valid default with respect to a type * definition the appropriate case among the following must be true: - */ + */ if IS_COMPLEX_TYPE(inode->typeDef) { /* * Complex type. @@ -21925,7 +21925,7 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, * SPEC (2.1) "its {content type} must be a simple type definition * or mixed." * SPEC (2.2.2) "If the {content type} is mixed, then the {content - * type}'s particle must be ·emptiable· as defined by + * type}'s particle must be ·emptiable· as defined by * Particle Emptiable (§3.9.6)." */ if ((! HAS_SIMPLE_CONTENT(inode->typeDef)) && @@ -21939,18 +21939,18 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, "or mixed content and a particle emptiable"); return(ret); } - } + } /* - * 1 If the type definition is a simple type definition, then the string - * must be ·valid· with respect to that definition as defined by String + * 1 If the type definition is a simple type definition, then the string + * must be ·valid· with respect to that definition as defined by String * Valid (§3.14.4). * * AND * - * 2.2.1 If the {content type} is a simple type definition, then the - * string must be ·valid· with respect to that simple type definition + * 2.2.1 If the {content type} is a simple type definition, then the + * string must be ·valid· with respect to that simple type definition * as defined by String Valid (§3.14.4). - */ + */ if (IS_SIMPLE_TYPE(inode->typeDef)) { ret = xmlSchemaVCheckCVCSimpleType((xmlSchemaAbstractCtxtPtr) vctxt, @@ -21964,7 +21964,7 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt, if (ret < 0) { VERROR_INT("xmlSchemaCheckCOSValidDefault", "calling xmlSchemaVCheckCVCSimpleType()"); - } + } return (ret); } @@ -21998,13 +21998,13 @@ xmlSchemaVContentModelCallback(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED, static int xmlSchemaValidatorPushElem(xmlSchemaValidCtxtPtr vctxt) -{ +{ vctxt->inode = xmlSchemaGetFreshElemInfo(vctxt); if (vctxt->inode == NULL) { VERROR_INT("xmlSchemaValidatorPushElem", "calling xmlSchemaGetFreshElemInfo()"); return (-1); - } + } vctxt->nbAttrInfos = 0; return (0); } @@ -22027,7 +22027,7 @@ xmlSchemaVCheckINodeDataType(xmlSchemaValidCtxtPtr vctxt, -/* +/* * Process END of element. */ static int @@ -22046,7 +22046,7 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) */ vctxt->skipDepth = vctxt->depth -1; goto end_elem; - } + } if ((inode->typeDef == NULL) || (inode->flags & XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE)) { /* @@ -22066,8 +22066,8 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) * Workaround for "anyType". */ if (inode->typeDef->builtInType == XML_SCHEMAS_ANYTYPE) - goto character_content; - + goto character_content; + if ((inode->flags & XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT) == 0) { xmlChar *values[10]; int terminal, nbval = 10, nbneg; @@ -22088,16 +22088,16 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) #ifdef DEBUG_AUTOMATA xmlGenericError(xmlGenericErrorContext, "AUTOMATON create on '%s'\n", inode->localName); -#endif +#endif } /* * Get hold of the still expected content, since a further * call to xmlRegExecPushString() will loose this information. - */ + */ xmlRegExecNextValues(inode->regexCtxt, &nbval, &nbneg, &values[0], &terminal); ret = xmlRegExecPushString(inode->regexCtxt, NULL, NULL); - if (ret <= 0) { + if (ret <= 0) { /* * Still missing something. */ @@ -22143,14 +22143,14 @@ character_content: /* * Speedup if no declaration exists. */ - if (IS_SIMPLE_TYPE(inode->typeDef)) { + if (IS_SIMPLE_TYPE(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef, inode->value); } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef->contentTypeDef, inode->value); - } + } if (ret < 0) { VERROR_INT("xmlSchemaValidatorPopElem", "calling xmlSchemaVCheckCVCSimpleType()"); @@ -22159,26 +22159,26 @@ character_content: goto end_elem; } /* - * cvc-elt (3.3.4) : 5 + * cvc-elt (3.3.4) : 5 * The appropriate case among the following must be true: */ /* - * cvc-elt (3.3.4) : 5.1 - * If the declaration has a {value constraint}, - * the item has neither element nor character [children] and + * cvc-elt (3.3.4) : 5.1 + * If the declaration has a {value constraint}, + * the item has neither element nor character [children] and * clause 3.2 has not applied, then all of the following must be true: */ if ((inode->decl->value != NULL) && - (inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) && + (inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) && (! INODE_NILLED(inode))) { /* - * cvc-elt (3.3.4) : 5.1.1 + * cvc-elt (3.3.4) : 5.1.1 * If the ·actual type definition· is a ·local type definition· * then the canonical lexical representation of the {value constraint} - * value must be a valid default for the ·actual type definition· as - * defined in Element Default Valid (Immediate) (§3.3.6). + * value must be a valid default for the ·actual type definition· as + * defined in Element Default Valid (Immediate) (§3.3.6). */ - /* + /* * NOTE: 'local' above means types aquired by xsi:type. * NOTE: Although the *canonical* value is stated, it is not * relevant if canonical or not. Additionally XML Schema 1.1 @@ -22201,22 +22201,22 @@ character_content: * (see following). */ goto default_psvi; - } + } /* - * cvc-elt (3.3.4) : 5.1.2 - * The element information item with the canonical lexical - * representation of the {value constraint} value used as its - * ·normalized value· must be ·valid· with respect to the + * cvc-elt (3.3.4) : 5.1.2 + * The element information item with the canonical lexical + * representation of the {value constraint} value used as its + * ·normalized value· must be ·valid· with respect to the * ·actual type definition· as defined by Element Locally Valid (Type) * (§3.3.4). - */ + */ if (IS_SIMPLE_TYPE(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef, inode->decl->value); } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef->contentTypeDef, - inode->decl->value); + inode->decl->value); } if (ret != 0) { if (ret < 0) { @@ -22237,7 +22237,7 @@ default_psvi: xmlChar *normValue; /* * VAL TODO: Normalize the value. - */ + */ normValue = xmlSchemaNormalizeValue(inode->typeDef, inode->decl->value); if (normValue != NULL) { @@ -22250,15 +22250,15 @@ default_psvi: "calling xmlNewText()"); goto internal_error; } else - xmlAddChild(inode->node, textChild); + xmlAddChild(inode->node, textChild); } - - } else if (! INODE_NILLED(inode)) { + + } else if (! INODE_NILLED(inode)) { /* - * 5.2.1 The element information item must be ·valid· with respect - * to the ·actual type definition· as defined by Element Locally + * 5.2.1 The element information item must be ·valid· with respect + * to the ·actual type definition· as defined by Element Locally * Valid (Type) (§3.3.4). - */ + */ if (IS_SIMPLE_TYPE(inode->typeDef)) { /* * SPEC (cvc-type) (3.1) @@ -22267,7 +22267,7 @@ default_psvi: * (Element) (§3.3.4) did not apply, then the ·normalized value· * must be ·valid· with respect to the type definition as defined * by String Valid (§3.14.4). - */ + */ ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef, inode->value); } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { @@ -22278,14 +22278,14 @@ default_psvi: * Element Locally Valid (Complex Type) (§3.4.4);" * * SPEC (cvc-complex-type) (2.2) - * "If the {content type} is a simple type definition, ... + * "If the {content type} is a simple type definition, ... * the ·normalized value· of the element information item is * ·valid· with respect to that simple type definition as * defined by String Valid (§3.14.4)." */ ret = xmlSchemaVCheckINodeDataType(vctxt, inode, inode->typeDef->contentTypeDef, inode->value); - } + } if (ret != 0) { if (ret < 0) { VERROR_INT("xmlSchemaValidatorPopElem", @@ -22295,7 +22295,7 @@ default_psvi: goto end_elem; } /* - * 5.2.2 If there is a fixed {value constraint} and clause 3.2 has + * 5.2.2 If there is a fixed {value constraint} and clause 3.2 has * not applied, all of the following must be true: */ if ((inode->decl->value != NULL) && @@ -22306,7 +22306,7 @@ default_psvi: * done on computed values. */ /* - * 5.2.2.1 The element information item must have no element + * 5.2.2.1 The element information item must have no element * information item [children]. */ if (inode->flags & @@ -22318,28 +22318,28 @@ default_psvi: goto end_elem; } else { /* - * 5.2.2.2 The appropriate case among the following must + * 5.2.2.2 The appropriate case among the following must * be true: - */ + */ if (HAS_MIXED_CONTENT(inode->typeDef)) { /* - * 5.2.2.2.1 If the {content type} of the ·actual type - * definition· is mixed, then the *initial value* of the - * item must match the canonical lexical representation + * 5.2.2.2.1 If the {content type} of the ·actual type + * definition· is mixed, then the *initial value* of the + * item must match the canonical lexical representation * of the {value constraint} value. * - * ... the *initial value* of an element information - * item is the string composed of, in order, the - * [character code] of each character information item in + * ... the *initial value* of an element information + * item is the string composed of, in order, the + * [character code] of each character information item in * the [children] of that element information item. - */ + */ if (! xmlStrEqual(inode->value, inode->decl->value)){ - /* + /* * VAL TODO: Report invalid & expected values as well. * VAL TODO: Implement the canonical stuff. */ ret = XML_SCHEMAV_CVC_ELT_5_2_2_2_1; - xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, + xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, ret, NULL, NULL, "The initial value '%s' does not match the fixed " "value constraint '%s'", @@ -22348,9 +22348,9 @@ default_psvi: } } else if (HAS_SIMPLE_CONTENT(inode->typeDef)) { /* - * 5.2.2.2.2 If the {content type} of the ·actual type - * definition· is a simple type definition, then the - * *actual value* of the item must match the canonical + * 5.2.2.2.2 If the {content type} of the ·actual type + * definition· is a simple type definition, then the + * *actual value* of the item must match the canonical * lexical representation of the {value constraint} value. */ /* @@ -22365,16 +22365,16 @@ default_psvi: xmlSchemaCustomErr((xmlSchemaAbstractCtxtPtr) vctxt, ret, NULL, NULL, "The actual value '%s' does not match the fixed " - "value constraint '%s'", + "value constraint '%s'", inode->value, inode->decl->value); goto end_elem; - } + } } - } + } } } - + end_elem: if (vctxt->depth < 0) { /* TODO: raise error? */ @@ -22384,12 +22384,12 @@ end_elem: vctxt->skipDepth = -1; /* * Evaluate the history of XPath state objects. - */ + */ if (xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1) goto internal_error; /* - * TODO: 6 The element information item must be ·valid· with respect to each of - * the {identity-constraint definitions} as per Identity-constraint + * TODO: 6 The element information item must be ·valid· with respect to each of + * the {identity-constraint definitions} as per Identity-constraint * Satisfied (§3.11.4). */ /* @@ -22413,7 +22413,7 @@ end_elem: */ if (xmlSchemaBubbleIDCNodeTables(vctxt) == -1) goto internal_error; - } + } } /* * Clear the current ielem. @@ -22446,10 +22446,10 @@ end_elem: aidc = aidc->next; } while (aidc != NULL); } - vctxt->depth--; + vctxt->depth--; vctxt->inode = vctxt->elemInfos[vctxt->depth]; /* - * VAL TODO: 7 If the element information item is the ·validation root·, it must be + * VAL TODO: 7 If the element information item is the ·validation root·, it must be * ·valid· per Validation Root Valid (ID/IDREF) (§3.3.4). */ return (ret); @@ -22706,7 +22706,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, if (consumed != NULL) *consumed = 0; if (INODE_NILLED(vctxt->inode)) { - /* + /* * SPEC cvc-elt (3.3.4 - 3.2.1) * "The element information item must have no character or * element information item [children]." @@ -22722,7 +22722,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, * information item [children]." */ if (vctxt->inode->typeDef->contentType == - XML_SCHEMA_CONTENT_EMPTY) { + XML_SCHEMA_CONTENT_EMPTY) { VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, NULL, "Character content is not allowed, " "because the content type is empty"); @@ -22733,12 +22733,12 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, XML_SCHEMA_CONTENT_ELEMENTS) { if ((nodeType != XML_TEXT_NODE) || (! xmlSchemaIsBlank((xmlChar *) value, len))) { - /* - * SPEC cvc-complex-type (2.3) - * "If the {content type} is element-only, then the - * element information item has no character information - * item [children] other than those whose [character - * code] is defined as a white space in [XML 1.0 (Second + /* + * SPEC cvc-complex-type (2.3) + * "If the {content type} is element-only, then the + * element information item has no character information + * item [children] other than those whose [character + * code] is defined as a white space in [XML 1.0 (Second * Edition)]." */ VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, NULL, @@ -22748,7 +22748,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, } return (0); } - + if ((value == NULL) || (value[0] == 0)) return (0); /* @@ -22760,7 +22760,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, ((vctxt->inode->decl == NULL) || (vctxt->inode->decl->value == NULL))) return (0); - + if (vctxt->inode->value == NULL) { /* * Set the value. @@ -22798,10 +22798,10 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, default: break; } - } else { + } else { /* * Concat the value. - */ + */ if (vctxt->inode->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES) { vctxt->inode->value = BAD_CAST xmlStrncat( (xmlChar *) vctxt->inode->value, value, len); @@ -22810,7 +22810,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt, BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len); vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES; } - } + } return (0); } @@ -22925,12 +22925,12 @@ type_validation: VERROR(ret, NULL, "The type definition is absent"); goto exit; - } + } if (vctxt->inode->typeDef->flags & XML_SCHEMAS_TYPE_ABSTRACT) { vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE; ret = XML_SCHEMAV_CVC_TYPE_2; VERROR(ret, NULL, - "The type definition is abstract"); + "The type definition is abstract"); goto exit; } /* @@ -23008,7 +23008,7 @@ root_found: nodeType = xmlTextReaderNodeType(vctxt->reader); if (nodeType == XML_ELEMENT_NODE) { - + vctxt->depth++; if (xmlSchemaValidatorPushElem(vctxt) == -1) { VERROR_INT("xmlSchemaVReaderWalk", @@ -23184,8 +23184,8 @@ internal_error: * Process text content. */ static void -xmlSchemaSAXHandleText(void *ctx, - const xmlChar * ch, +xmlSchemaSAXHandleText(void *ctx, + const xmlChar * ch, int len) { xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx; @@ -23209,10 +23209,10 @@ xmlSchemaSAXHandleText(void *ctx, * Process CDATA content. */ static void -xmlSchemaSAXHandleCDataSection(void *ctx, - const xmlChar * ch, +xmlSchemaSAXHandleCDataSection(void *ctx, + const xmlChar * ch, int len) -{ +{ xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx; if (vctxt->depth < 0) @@ -23246,20 +23246,20 @@ xmlSchemaSAXHandleReference(void *ctx ATTRIBUTE_UNUSED, static void xmlSchemaSAXHandleStartElementNs(void *ctx, - const xmlChar * localname, - const xmlChar * prefix ATTRIBUTE_UNUSED, - const xmlChar * URI, - int nb_namespaces, - const xmlChar ** namespaces, - int nb_attributes, - int nb_defaulted ATTRIBUTE_UNUSED, + const xmlChar * localname, + const xmlChar * prefix ATTRIBUTE_UNUSED, + const xmlChar * URI, + int nb_namespaces, + const xmlChar ** namespaces, + int nb_attributes, + int nb_defaulted ATTRIBUTE_UNUSED, const xmlChar ** attributes) -{ +{ xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx; int ret; xmlSchemaNodeInfoPtr ielem; int i, j; - + /* * SAX VAL TODO: What to do with nb_defaulted? */ @@ -23283,16 +23283,16 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, ielem->flags |= XML_SCHEMA_ELEM_INFO_EMPTY; /* * Register namespaces on the elem info. - */ + */ if (nb_namespaces != 0) { /* * Although the parser builds its own namespace list, * we have no access to it, so we'll use an own one. */ - for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) { + for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) { /* * Store prefix and namespace name. - */ + */ if (ielem->nsBindings == NULL) { ielem->nsBindings = (const xmlChar **) xmlMalloc(10 * @@ -23328,7 +23328,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, } else ielem->nsBindings[ielem->nbNsBindings * 2 + 1] = namespaces[j+1]; - ielem->nbNsBindings++; + ielem->nbNsBindings++; } } /* @@ -23342,7 +23342,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, for (j = 0, i = 0; i < nb_attributes; i++, j += 5) { /* * Duplicate the value. - */ + */ value = xmlStrndup(attributes[j+3], attributes[j+4] - attributes[j+3]); ret = xmlSchemaValidatorPushAttribute(vctxt, @@ -23366,7 +23366,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx, goto internal_error; } goto exit; - } + } exit: return; @@ -23612,7 +23612,7 @@ xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt) * @ctxt: the schema validation context * * Check if any error was detected during validation. - * + * * Returns 1 if valid so far, 0 if errors were detected, and -1 in case * of internal error. */ @@ -24325,10 +24325,10 @@ referenceSplit(void *ctx, const xmlChar *name) } static void -startElementNsSplit(void *ctx, const xmlChar * localname, - const xmlChar * prefix, const xmlChar * URI, - int nb_namespaces, const xmlChar ** namespaces, - int nb_attributes, int nb_defaulted, +startElementNsSplit(void *ctx, const xmlChar * localname, + const xmlChar * prefix, const xmlChar * URI, + int nb_namespaces, const xmlChar ** namespaces, + int nb_attributes, int nb_defaulted, const xmlChar ** attributes) { xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx; if (ctxt == NULL) @@ -24347,7 +24347,7 @@ startElementNsSplit(void *ctx, const xmlChar * localname, } static void -endElementNsSplit(void *ctx, const xmlChar * localname, +endElementNsSplit(void *ctx, const xmlChar * localname, const xmlChar * prefix, const xmlChar * URI) { xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx; if (ctxt == NULL) @@ -24388,7 +24388,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt, old_sax = *sax; if ((old_sax != NULL) && (old_sax->initialized != XML_SAX2_MAGIC)) return(NULL); - if ((old_sax != NULL) && + if ((old_sax != NULL) && (old_sax->startElementNs == NULL) && (old_sax->endElementNs == NULL) && ((old_sax->startElement != NULL) || (old_sax->endElement != NULL))) return(NULL); @@ -24406,7 +24406,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt, ret->ctxt = ctxt; ret->user_sax_ptr = sax; ret->user_sax = old_sax; - if (old_sax == NULL) { + if (old_sax == NULL) { /* * go direct, no need for the split block and functions. */ @@ -24427,7 +24427,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt, } else { /* * for each callback unused by Schemas initialize it to the Split - * routine only if non NULL in the user block, this can speed up + * routine only if non NULL in the user block, this can speed up * things at the SAX level. */ if (old_sax->internalSubset != NULL) @@ -24580,7 +24580,7 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt, if (options) xmlCtxtUseOptions(pctxt, options); #endif - pctxt->linenumbers = 1; + pctxt->linenumbers = 1; inputStream = xmlNewIOInputStream(pctxt, input, enc);; if (inputStream == NULL) { @@ -24609,7 +24609,7 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt, ret = ctxt->parserCtxt->errNo; if (ret == 0) ret = 1; - } + } done: ctxt->parserCtxt = NULL; @@ -24649,13 +24649,13 @@ xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt, if ((ctxt == NULL) || (filename == NULL)) return (-1); - + input = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE); if (input == NULL) return (-1); ret = xmlSchemaValidateStream(ctxt, input, XML_CHAR_ENCODING_NONE, - NULL, NULL); + NULL, NULL); return (ret); #else return (-1); diff --git a/reactos/lib/3rdparty/libxml2/xmlschemastypes.c b/reactos/lib/3rdparty/libxml2/xmlschemastypes.c index d8f1fad2514..7ea870a09c5 100644 --- a/reactos/lib/3rdparty/libxml2/xmlschemastypes.c +++ b/reactos/lib/3rdparty/libxml2/xmlschemastypes.c @@ -251,7 +251,7 @@ xmlSchemaNewMinLengthFacet(int value) * Initialize one primitive built-in type */ static xmlSchemaTypePtr -xmlSchemaInitBasicType(const char *name, xmlSchemaValType type, +xmlSchemaInitBasicType(const char *name, xmlSchemaValType type, xmlSchemaTypePtr baseType) { xmlSchemaTypePtr ret; @@ -264,31 +264,31 @@ xmlSchemaInitBasicType(const char *name, xmlSchemaValType type, ret->name = (const xmlChar *)name; ret->targetNamespace = XML_SCHEMAS_NAMESPACE_NAME; ret->type = XML_SCHEMA_TYPE_BASIC; - ret->baseType = baseType; + ret->baseType = baseType; ret->contentType = XML_SCHEMA_CONTENT_BASIC; /* * Primitive types. */ - switch (type) { - case XML_SCHEMAS_STRING: - case XML_SCHEMAS_DECIMAL: - case XML_SCHEMAS_DATE: - case XML_SCHEMAS_DATETIME: - case XML_SCHEMAS_TIME: - case XML_SCHEMAS_GYEAR: - case XML_SCHEMAS_GYEARMONTH: - case XML_SCHEMAS_GMONTH: - case XML_SCHEMAS_GMONTHDAY: - case XML_SCHEMAS_GDAY: - case XML_SCHEMAS_DURATION: - case XML_SCHEMAS_FLOAT: - case XML_SCHEMAS_DOUBLE: - case XML_SCHEMAS_BOOLEAN: - case XML_SCHEMAS_ANYURI: - case XML_SCHEMAS_HEXBINARY: - case XML_SCHEMAS_BASE64BINARY: - case XML_SCHEMAS_QNAME: - case XML_SCHEMAS_NOTATION: + switch (type) { + case XML_SCHEMAS_STRING: + case XML_SCHEMAS_DECIMAL: + case XML_SCHEMAS_DATE: + case XML_SCHEMAS_DATETIME: + case XML_SCHEMAS_TIME: + case XML_SCHEMAS_GYEAR: + case XML_SCHEMAS_GYEARMONTH: + case XML_SCHEMAS_GMONTH: + case XML_SCHEMAS_GMONTHDAY: + case XML_SCHEMAS_GDAY: + case XML_SCHEMAS_DURATION: + case XML_SCHEMAS_FLOAT: + case XML_SCHEMAS_DOUBLE: + case XML_SCHEMAS_BOOLEAN: + case XML_SCHEMAS_ANYURI: + case XML_SCHEMAS_HEXBINARY: + case XML_SCHEMAS_BASE64BINARY: + case XML_SCHEMAS_QNAME: + case XML_SCHEMAS_NOTATION: ret->flags |= XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE; break; default: @@ -306,7 +306,7 @@ xmlSchemaInitBasicType(const char *name, xmlSchemaValType type, case XML_SCHEMAS_ENTITIES: ret->flags |= XML_SCHEMAS_TYPE_VARIETY_LIST; ret->facets = xmlSchemaNewMinLengthFacet(1); - ret->flags |= XML_SCHEMAS_TYPE_HAS_FACETS; + ret->flags |= XML_SCHEMAS_TYPE_HAS_FACETS; break; default: ret->flags |= XML_SCHEMAS_TYPE_VARIETY_ATOMIC; @@ -330,12 +330,12 @@ xmlSchemaInitTypes(void) return; xmlSchemaTypesBank = xmlHashCreate(40); - + /* * 3.4.7 Built-in Complex Type Definition */ xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType", - XML_SCHEMAS_ANYTYPE, + XML_SCHEMAS_ANYTYPE, NULL); xmlSchemaTypeAnyTypeDef->baseType = xmlSchemaTypeAnyTypeDef; xmlSchemaTypeAnyTypeDef->contentType = XML_SCHEMA_CONTENT_MIXED; @@ -354,7 +354,7 @@ xmlSchemaInitTypes(void) wild->maxOccurs = 1; xmlSchemaTypeAnyTypeDef->attributeWildcard = wild; } - xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType", + xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType", XML_SCHEMAS_ANYSIMPLETYPE, xmlSchemaTypeAnyTypeDef); /* @@ -413,7 +413,7 @@ xmlSchemaInitTypes(void) xmlSchemaTypeAnySimpleTypeDef); xmlSchemaTypeNotationDef = xmlSchemaInitBasicType("NOTATION", XML_SCHEMAS_NOTATION, - xmlSchemaTypeAnySimpleTypeDef); + xmlSchemaTypeAnySimpleTypeDef); xmlSchemaTypeQNameDef = xmlSchemaInitBasicType("QName", XML_SCHEMAS_QNAME, xmlSchemaTypeAnySimpleTypeDef); @@ -483,7 +483,7 @@ xmlSchemaInitTypes(void) xmlSchemaTypeNCNameDef); xmlSchemaTypeIdrefDef = xmlSchemaInitBasicType("IDREF", XML_SCHEMAS_IDREF, - xmlSchemaTypeNCNameDef); + xmlSchemaTypeNCNameDef); xmlSchemaTypeEntityDef = xmlSchemaInitBasicType("ENTITY", XML_SCHEMAS_ENTITY, xmlSchemaTypeNCNameDef); @@ -515,7 +515,7 @@ xmlSchemaInitTypes(void) * * Cleanup the default XML Schemas type library */ -void +void xmlSchemaCleanupTypes(void) { if (xmlSchemaTypesInitialized == 0) return; @@ -548,12 +548,12 @@ xmlSchemaIsBuiltInTypeFacet(xmlSchemaTypePtr type, int facetType) (facetType == XML_SCHEMA_FACET_WHITESPACE)) return (1); else - return (0); + return (0); case XML_SCHEMAS_STRING: case XML_SCHEMAS_NOTATION: case XML_SCHEMAS_QNAME: - case XML_SCHEMAS_ANYURI: - case XML_SCHEMAS_BASE64BINARY: + case XML_SCHEMAS_ANYURI: + case XML_SCHEMAS_BASE64BINARY: case XML_SCHEMAS_HEXBINARY: if ((facetType == XML_SCHEMA_FACET_LENGTH) || (facetType == XML_SCHEMA_FACET_MINLENGTH) || @@ -576,12 +576,12 @@ xmlSchemaIsBuiltInTypeFacet(xmlSchemaTypePtr type, int facetType) (facetType == XML_SCHEMA_FACET_MINEXCLUSIVE)) return (1); else - return (0); + return (0); case XML_SCHEMAS_TIME: - case XML_SCHEMAS_GDAY: + case XML_SCHEMAS_GDAY: case XML_SCHEMAS_GMONTH: - case XML_SCHEMAS_GMONTHDAY: - case XML_SCHEMAS_GYEAR: + case XML_SCHEMAS_GMONTHDAY: + case XML_SCHEMAS_GYEAR: case XML_SCHEMAS_GYEARMONTH: case XML_SCHEMAS_DATE: case XML_SCHEMAS_DATETIME: @@ -597,7 +597,7 @@ xmlSchemaIsBuiltInTypeFacet(xmlSchemaTypePtr type, int facetType) (facetType == XML_SCHEMA_FACET_MINEXCLUSIVE)) return (1); else - return (0); + return (0); default: break; } @@ -619,7 +619,7 @@ xmlSchemaGetBuiltInType(xmlSchemaValType type) if (xmlSchemaTypesInitialized == 0) xmlSchemaInitTypes(); switch (type) { - + case XML_SCHEMAS_ANYSIMPLETYPE: return (xmlSchemaTypeAnySimpleTypeDef); case XML_SCHEMAS_STRING: @@ -711,7 +711,7 @@ xmlSchemaGetBuiltInType(xmlSchemaValType type) case XML_SCHEMAS_BASE64BINARY: return (xmlSchemaTypeBase64BinaryDef); case XML_SCHEMAS_ANYTYPE: - return (xmlSchemaTypeAnyTypeDef); + return (xmlSchemaTypeAnyTypeDef); default: return (NULL); } @@ -763,7 +763,7 @@ xmlSchemaValueGetNext(xmlSchemaValPtr cur) { */ const xmlChar * xmlSchemaValueGetAsString(xmlSchemaValPtr val) -{ +{ if (val == NULL) return (NULL); switch (val->type) { @@ -796,7 +796,7 @@ xmlSchemaValueGetAsString(xmlSchemaValPtr val) */ int xmlSchemaValueGetAsBoolean(xmlSchemaValPtr val) -{ +{ if ((val == NULL) || (val->type != XML_SCHEMAS_BOOLEAN)) return (0); return (val->value.b); @@ -807,8 +807,8 @@ xmlSchemaValueGetAsBoolean(xmlSchemaValPtr val) * @type: the value type * @value: the value * - * Allocate a new simple type value. The type can be - * of XML_SCHEMAS_STRING. + * Allocate a new simple type value. The type can be + * of XML_SCHEMAS_STRING. * WARNING: This one is intended to be expanded for other * string based types. We need this for anySimpleType as well. * The given value is consumed and freed with the struct. @@ -890,11 +890,11 @@ xmlSchemaNewQNameValue(const xmlChar *namespaceName, * * Cleanup the default XML Schemas type library */ -void +void xmlSchemaFreeValue(xmlSchemaValPtr value) { xmlSchemaValPtr prev; - while (value != NULL) { + while (value != NULL) { switch (value->type) { case XML_SCHEMAS_STRING: case XML_SCHEMAS_NORMSTRING: @@ -908,7 +908,7 @@ xmlSchemaFreeValue(xmlSchemaValPtr value) { case XML_SCHEMAS_IDREF: case XML_SCHEMAS_IDREFS: case XML_SCHEMAS_ENTITY: - case XML_SCHEMAS_ENTITIES: + case XML_SCHEMAS_ENTITIES: case XML_SCHEMAS_ANYURI: case XML_SCHEMAS_ANYSIMPLETYPE: if (value->value.str != NULL) @@ -935,7 +935,7 @@ xmlSchemaFreeValue(xmlSchemaValPtr value) { prev = value; value = value->next; xmlFree(prev); - } + } } /** @@ -971,9 +971,9 @@ xmlSchemaGetBuiltInListSimpleTypeItemType(xmlSchemaTypePtr type) if ((type == NULL) || (type->type != XML_SCHEMA_TYPE_BASIC)) return (NULL); switch (type->builtInType) { - case XML_SCHEMAS_NMTOKENS: + case XML_SCHEMAS_NMTOKENS: return (xmlSchemaTypeNmtokenDef ); - case XML_SCHEMAS_IDREFS: + case XML_SCHEMAS_IDREFS: return (xmlSchemaTypeIdrefDef); case XML_SCHEMAS_ENTITIES: return (xmlSchemaTypeEntityDef); @@ -1225,13 +1225,13 @@ _xmlSchemaParseGDay (xmlSchemaValDatePtr dt, const xmlChar **str) { */ static int _xmlSchemaParseTime (xmlSchemaValDatePtr dt, const xmlChar **str) { - const xmlChar *cur = *str; + const xmlChar *cur = *str; int ret = 0; int value = 0; PARSE_2_DIGITS(value, cur, ret); if (ret != 0) - return ret; + return ret; if (*cur != ':') return 1; if (!VALID_HOUR(value)) @@ -1734,7 +1734,7 @@ xmlSchemaValidateDuration (xmlSchemaTypePtr type ATTRIBUTE_UNUSED, } cur++; if (collapse) - while IS_WSP_BLANK_CH(*cur) cur++; + while IS_WSP_BLANK_CH(*cur) cur++; } if (isneg) { @@ -1790,13 +1790,13 @@ xmlSchemaStrip(const xmlChar *value) { */ xmlChar * xmlSchemaWhiteSpaceReplace(const xmlChar *value) { - const xmlChar *cur = value; - xmlChar *ret = NULL, *mcur; + const xmlChar *cur = value; + xmlChar *ret = NULL, *mcur; - if (value == NULL) + if (value == NULL) return(NULL); - - while ((*cur != 0) && + + while ((*cur != 0) && (((*cur) != 0xd) && ((*cur) != 0x9) && ((*cur) != 0xa))) { cur++; } @@ -1809,7 +1809,7 @@ xmlSchemaWhiteSpaceReplace(const xmlChar *value) { if ( ((*mcur) == 0xd) || ((*mcur) == 0x9) || ((*mcur) == 0xa) ) *mcur = ' '; mcur++; - } while (*mcur != 0); + } while (*mcur != 0); return(ret); } @@ -2027,7 +2027,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, if ((flags == 0) && (value != NULL)) { if ((type->builtInType != XML_SCHEMAS_STRING) && - (type->builtInType != XML_SCHEMAS_ANYTYPE) && + (type->builtInType != XML_SCHEMAS_ANYTYPE) && (type->builtInType != XML_SCHEMAS_ANYSIMPLETYPE)) { if (type->builtInType == XML_SCHEMAS_NORMSTRING) norm = xmlSchemaWhiteSpaceReplace(value); @@ -2039,7 +2039,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, } switch (type->builtInType) { - case XML_SCHEMAS_UNKNOWN: + case XML_SCHEMAS_UNKNOWN: goto error; case XML_SCHEMAS_ANYTYPE: case XML_SCHEMAS_ANYSIMPLETYPE: @@ -2050,10 +2050,10 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, *val = v; } else { goto error; - } + } } goto return0; - case XML_SCHEMAS_STRING: + case XML_SCHEMAS_STRING: if (! normOnTheFly) { const xmlChar *cur = value; @@ -2171,7 +2171,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, cur++; if ((*cur == 0) && (cur -1 == value)) goto return1; - + dec = len; while ((len < 24) && (*cur >= '0') && (*cur <= '9')) { @@ -2205,7 +2205,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, /* * Now evaluate the significant digits of the number */ - if (*cptr != 0) + if (*cptr != 0) xmlSchemaParseUInt((const xmlChar **)&cptr, &v->value.decimal.lo, &v->value.decimal.mi, @@ -2454,8 +2454,8 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, } else { cur++; } - } - } + } + } if (val != NULL) { v = xmlSchemaNewValue(XML_SCHEMAS_TOKEN); if (v != NULL) { @@ -2468,7 +2468,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, goto return0; } case XML_SCHEMAS_LANGUAGE: - if (normOnTheFly) { + if (normOnTheFly) { norm = xmlSchemaCollapseString(value); if (norm != NULL) value = norm; @@ -2753,10 +2753,10 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, } goto done; } - case XML_SCHEMAS_ANYURI:{ + case XML_SCHEMAS_ANYURI:{ if (*value != 0) { xmlURIPtr uri; - if (normOnTheFly) { + if (normOnTheFly) { norm = xmlSchemaCollapseString(value); if (norm != NULL) value = norm; @@ -2835,12 +2835,12 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value, } case XML_SCHEMAS_BASE64BINARY:{ /* ISSUE: - * + * * Ignore all stray characters? (yes, currently) * Worry about long lines? (no, currently) - * + * * rfc2045.txt: - * + * * "The encoded output stream must be represented in lines of * no more than 76 characters each. All line breaks or other * characters not found in Table 1 must be ignored by decoding @@ -3251,7 +3251,7 @@ xmlSchemaCompareDecimals(xmlSchemaValPtr x, xmlSchemaValPtr y) /* * First test: If x is -ve and not zero */ - if ((x->value.decimal.sign) && + if ((x->value.decimal.sign) && ((x->value.decimal.lo != 0) || (x->value.decimal.mi != 0) || (x->value.decimal.hi != 0))) { @@ -3460,7 +3460,7 @@ xmlSchemaDupVal (xmlSchemaValPtr v) xmlSchemaValPtr ret = xmlSchemaNewValue(v->type); if (ret == NULL) return NULL; - + memcpy(ret, v, sizeof(xmlSchemaVal)); ret->next = NULL; return ret; @@ -3506,7 +3506,7 @@ xmlSchemaCopyValue(xmlSchemaValPtr val) if (val->value.str != NULL) cur->value.str = xmlStrdup(BAD_CAST val->value.str); break; - case XML_SCHEMAS_QNAME: + case XML_SCHEMAS_QNAME: case XML_SCHEMAS_NOTATION: cur = xmlSchemaDupVal(val); if (val->value.qname.name != NULL) @@ -3665,7 +3665,7 @@ _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur) r->year++; } } - + r->day = tempdays; /* @@ -3730,7 +3730,7 @@ xmlSchemaDateNormalize (xmlSchemaValPtr dt, double offset) * _xmlSchemaDateCastYMToDays: * @dt: an #xmlSchemaValPtr * - * Convert mon and year of @dt to total number of days. Take the + * Convert mon and year of @dt to total number of days. Take the * number of years since (or before) 1 AD and add the number of leap * years. This is a function because negative * years must be handled a little differently and there is no zero year. @@ -3910,7 +3910,7 @@ xmlSchemaCompareDates (xmlSchemaValPtr x, xmlSchemaValPtr y) ret = -1; else if (sec > 0.0) ret = 1; - + } xmlSchemaFreeValue(p1); xmlSchemaFreeValue(q1); @@ -4051,7 +4051,7 @@ xmlSchemaComparePreserveReplaceStrings(const xmlChar *x, int invert) { int tmp; - + while ((*x != 0) && (*y != 0)) { if (IS_WSP_REPLACE_CH(*y)) { if (! IS_WSP_SPACE_CH(*x)) { @@ -4066,7 +4066,7 @@ xmlSchemaComparePreserveReplaceStrings(const xmlChar *x, else return(1); } - } + } } else { tmp = *x - *y; if (tmp < 0) { @@ -4120,7 +4120,7 @@ xmlSchemaComparePreserveCollapseStrings(const xmlChar *x, { int tmp; - /* + /* * Skip leading blank chars of the collapsed string. */ while IS_WSP_BLANK_CH(*y) @@ -4209,12 +4209,12 @@ xmlSchemaCompareReplaceCollapseStrings(const xmlChar *x, { int tmp; - /* + /* * Skip leading blank chars of the collapsed string. */ while IS_WSP_BLANK_CH(*y) y++; - + while ((*x != 0) && (*y != 0)) { if IS_WSP_BLANK_CH(*y) { if (! IS_WSP_BLANK_CH(*x)) { @@ -4234,8 +4234,8 @@ xmlSchemaCompareReplaceCollapseStrings(const xmlChar *x, } } x++; - y++; - /* + y++; + /* * Skip contiguous blank chars of the collapsed string. */ while IS_WSP_BLANK_CH(*y) @@ -4269,7 +4269,7 @@ xmlSchemaCompareReplaceCollapseStrings(const xmlChar *x, return(-1); else return(1); - } + } if (*y != 0) { /* * Skip trailing blank chars of the collapsed string. @@ -4302,7 +4302,7 @@ xmlSchemaCompareReplacedStrings(const xmlChar *x, const xmlChar *y) { int tmp; - + while ((*x != 0) && (*y != 0)) { if IS_WSP_BLANK_CH(*y) { if (! IS_WSP_BLANK_CH(*x)) { @@ -4310,7 +4310,7 @@ xmlSchemaCompareReplacedStrings(const xmlChar *x, return(-1); else return(1); - } + } } else { if IS_WSP_BLANK_CH(*x) { if ((0x20 - *y) < 0) @@ -4348,7 +4348,7 @@ static int xmlSchemaCompareNormStrings(const xmlChar *x, const xmlChar *y) { int tmp; - + while (IS_BLANK_CH(*x)) x++; while (IS_BLANK_CH(*y)) y++; while ((*x != 0) && (*y != 0)) { @@ -4541,13 +4541,13 @@ xmlSchemaCompareValuesInternal(xmlSchemaValType xtype, (ytype == XML_SCHEMAS_GYEARMONTH)) return (xmlSchemaCompareDates(x, y)); return (-2); - /* + /* * Note that we will support comparison of string types against * anySimpleType as well. */ case XML_SCHEMAS_ANYSIMPLETYPE: case XML_SCHEMAS_STRING: - case XML_SCHEMAS_NORMSTRING: + case XML_SCHEMAS_NORMSTRING: case XML_SCHEMAS_TOKEN: case XML_SCHEMAS_LANGUAGE: case XML_SCHEMAS_NMTOKEN: @@ -4571,10 +4571,10 @@ xmlSchemaCompareValuesInternal(xmlSchemaValType xtype, /* * TODO: Compare those against QName. */ - if (ytype == XML_SCHEMAS_QNAME) { + if (ytype == XML_SCHEMAS_QNAME) { TODO if (y == NULL) - return(-2); + return(-2); return (-2); } if ((ytype == XML_SCHEMAS_ANYSIMPLETYPE) || @@ -4596,7 +4596,7 @@ xmlSchemaCompareValuesInternal(xmlSchemaValType xtype, /* TODO: What about x < y or x > y. */ if (xmlStrEqual(xv, yv)) return (0); - else + else return (2); } else if (yws == XML_SCHEMA_WHITESPACE_REPLACE) return (xmlSchemaComparePreserveReplaceStrings(xv, yv, 0)); @@ -4622,7 +4622,7 @@ xmlSchemaCompareValuesInternal(xmlSchemaValType xtype, return (xmlSchemaCompareNormStrings(xv, yv)); } else return (-2); - + } return (-2); } @@ -4691,7 +4691,7 @@ xmlSchemaCompareValuesInternal(xmlSchemaValType xtype, else return(-1); } - return (-2); + return (-2); case XML_SCHEMAS_IDREFS: case XML_SCHEMAS_ENTITIES: case XML_SCHEMAS_NMTOKENS: @@ -4879,7 +4879,7 @@ xmlSchemaValidateListSimpleTypeFacet(xmlSchemaFacetPtr facet, if (expectedLen != NULL) *expectedLen = facet->val->value.decimal.lo; return (XML_SCHEMAV_CVC_LENGTH_VALID); - } + } } else if (facet->type == XML_SCHEMA_FACET_MINLENGTH) { if (actualLen < facet->val->value.decimal.lo) { if (expectedLen != NULL) @@ -4893,12 +4893,12 @@ xmlSchemaValidateListSimpleTypeFacet(xmlSchemaFacetPtr facet, return (XML_SCHEMAV_CVC_MAXLENGTH_VALID); } } else - /* - * NOTE: That we can pass NULL as xmlSchemaValPtr to + /* + * NOTE: That we can pass NULL as xmlSchemaValPtr to * xmlSchemaValidateFacet, since the remaining facet types - * are: XML_SCHEMA_FACET_PATTERN, XML_SCHEMA_FACET_ENUMERATION. + * are: XML_SCHEMA_FACET_PATTERN, XML_SCHEMA_FACET_ENUMERATION. */ - return(xmlSchemaValidateFacet(NULL, facet, value, NULL)); + return(xmlSchemaValidateFacet(NULL, facet, value, NULL)); return (0); } @@ -4911,7 +4911,7 @@ xmlSchemaValidateListSimpleTypeFacet(xmlSchemaFacetPtr facet, * @ws: the whitespace type of the value * @length: the actual length of the value * - * Checka a value against a "length", "minLength" and "maxLength" + * Checka a value against a "length", "minLength" and "maxLength" * facet; sets @length to the computed length of @value. * * Returns 0 if the value is valid, a positive error code @@ -4921,9 +4921,9 @@ static int xmlSchemaValidateLengthFacetInternal(xmlSchemaFacetPtr facet, xmlSchemaTypeType valType, const xmlChar *value, - xmlSchemaValPtr val, + xmlSchemaValPtr val, unsigned long *length, - xmlSchemaWhitespaceValueType ws) + xmlSchemaWhitespaceValueType ws) { unsigned int len = 0; @@ -4934,7 +4934,7 @@ xmlSchemaValidateLengthFacetInternal(xmlSchemaFacetPtr facet, (facet->type != XML_SCHEMA_FACET_MAXLENGTH) && (facet->type != XML_SCHEMA_FACET_MINLENGTH)) return (-1); - + /* * TODO: length, maxLength and minLength must be of type * nonNegativeInteger only. Check if decimal is used somehow. @@ -4968,7 +4968,7 @@ xmlSchemaValidateLengthFacetInternal(xmlSchemaFacetPtr facet, if (ws == XML_SCHEMA_WHITESPACE_COLLAPSE) len = xmlSchemaNormLen(value); else - /* + /* * Should be OK for "preserve" as well. */ len = xmlUTF8Strlen(value); @@ -4980,7 +4980,7 @@ xmlSchemaValidateLengthFacetInternal(xmlSchemaFacetPtr facet, case XML_SCHEMAS_NMTOKEN: case XML_SCHEMAS_NAME: case XML_SCHEMAS_NCNAME: - case XML_SCHEMAS_ID: + case XML_SCHEMAS_ID: /* * FIXME: What exactly to do with anyURI? */ @@ -5013,7 +5013,7 @@ xmlSchemaValidateLengthFacetInternal(xmlSchemaFacetPtr facet, if (len > facet->val->value.decimal.lo) return(XML_SCHEMAV_CVC_MAXLENGTH_VALID); } - + return (0); } @@ -5025,18 +5025,18 @@ xmlSchemaValidateLengthFacetInternal(xmlSchemaFacetPtr facet, * @val: the precomputed value * @length: the actual length of the value * - * Checka a value against a "length", "minLength" and "maxLength" + * Checka a value against a "length", "minLength" and "maxLength" * facet; sets @length to the computed length of @value. * * Returns 0 if the value is valid, a positive error code * otherwise and -1 in case of an internal or API error. */ int -xmlSchemaValidateLengthFacet(xmlSchemaTypePtr type, +xmlSchemaValidateLengthFacet(xmlSchemaTypePtr type, xmlSchemaFacetPtr facet, const xmlChar *value, xmlSchemaValPtr val, - unsigned long *length) + unsigned long *length) { if (type == NULL) return(-1); @@ -5046,7 +5046,7 @@ xmlSchemaValidateLengthFacet(xmlSchemaTypePtr type, } /** - * xmlSchemaValidateLengthFacetWhtsp: + * xmlSchemaValidateLengthFacetWhtsp: * @facet: the facet to check * @valType: the built-in type * @value: the lexical repr. of the value to be validated @@ -5054,7 +5054,7 @@ xmlSchemaValidateLengthFacet(xmlSchemaTypePtr type, * @ws: the whitespace type of the value * @length: the actual length of the value * - * Checka a value against a "length", "minLength" and "maxLength" + * Checka a value against a "length", "minLength" and "maxLength" * facet; sets @length to the computed length of @value. * * Returns 0 if the value is valid, a positive error code @@ -5089,7 +5089,7 @@ xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet, static int xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, xmlSchemaWhitespaceValueType fws, - xmlSchemaValType valType, + xmlSchemaValType valType, const xmlChar *value, xmlSchemaValPtr val, xmlSchemaWhitespaceValueType ws) @@ -5101,7 +5101,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, switch (facet->type) { case XML_SCHEMA_FACET_PATTERN: - /* + /* * NOTE that for patterns, the @value needs to be the normalized * value, *not* the lexical initial value or the canonical value. */ @@ -5202,7 +5202,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, else { switch (valType) { case XML_SCHEMAS_STRING: - case XML_SCHEMAS_NORMSTRING: + case XML_SCHEMAS_NORMSTRING: if (ws == XML_SCHEMA_WHITESPACE_UNKNOWN) { /* * This is to ensure API compatibility with the old @@ -5218,13 +5218,13 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, if (ws == XML_SCHEMA_WHITESPACE_COLLAPSE) len = xmlSchemaNormLen(value); else - /* + /* * Should be OK for "preserve" as well. */ len = xmlUTF8Strlen(value); } break; - case XML_SCHEMAS_IDREF: + case XML_SCHEMAS_IDREF: case XML_SCHEMAS_TOKEN: case XML_SCHEMAS_LANGUAGE: case XML_SCHEMAS_NMTOKEN: @@ -5234,7 +5234,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet, case XML_SCHEMAS_ANYURI: if (value != NULL) len = xmlSchemaNormLen(value); - break; + break; default: TODO } @@ -5347,7 +5347,7 @@ xmlSchemaValidateFacet(xmlSchemaTypePtr base, int xmlSchemaValidateFacetWhtsp(xmlSchemaFacetPtr facet, xmlSchemaWhitespaceValueType fws, - xmlSchemaValType valType, + xmlSchemaValType valType, const xmlChar *value, xmlSchemaValPtr val, xmlSchemaWhitespaceValueType ws) @@ -5408,13 +5408,13 @@ xmlSchemaFormatFloat(double number, char buffer[], int buffersize) /* * Result is in work, and after_fraction points * just past the fractional part. - * Use scientific notation + * Use scientific notation */ integer_place = DBL_DIG + EXPONENT_DIGITS + 1; fraction_place = DBL_DIG - 1; snprintf(work, sizeof(work),"%*.*e", integer_place, fraction_place, number); - after_fraction = strchr(work + DBL_DIG, 'e'); + after_fraction = strchr(work + DBL_DIG, 'e'); /* Remove fractional trailing zeroes */ ptr = after_fraction; while (*(--ptr) == '0') @@ -5446,7 +5446,7 @@ xmlSchemaFormatFloat(double number, char buffer[], int buffersize) * * WARNING: Some value types are not supported yet, resulting * in a @retValue of "???". - * + * * TODO: XML Schema 1.0 does not define canonical representations * for: duration, gYearMonth, gYear, gMonthDay, gMonth, gDay, * anyURI, QName, NOTATION. This will be fixed in XML Schema 1.1. @@ -5466,7 +5466,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) if (val->value.str == NULL) *retValue = BAD_CAST xmlStrdup(BAD_CAST ""); else - *retValue = + *retValue = BAD_CAST xmlStrdup((const xmlChar *) val->value.str); break; case XML_SCHEMAS_NORMSTRING: @@ -5483,7 +5483,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) case XML_SCHEMAS_TOKEN: case XML_SCHEMAS_LANGUAGE: case XML_SCHEMAS_NMTOKEN: - case XML_SCHEMAS_NAME: + case XML_SCHEMAS_NAME: case XML_SCHEMAS_NCNAME: case XML_SCHEMAS_ID: case XML_SCHEMAS_IDREF: @@ -5492,10 +5492,10 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) case XML_SCHEMAS_ANYURI: /* Unclear */ if (val->value.str == NULL) return (-1); - *retValue = + *retValue = BAD_CAST xmlSchemaCollapseString(BAD_CAST val->value.str); if (*retValue == NULL) - *retValue = + *retValue = BAD_CAST xmlStrdup((const xmlChar *) val->value.str); break; case XML_SCHEMAS_QNAME: @@ -5517,7 +5517,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) /* * TODO: Lookout for a more simple implementation. */ - if ((val->value.decimal.total == 1) && + if ((val->value.decimal.total == 1) && (val->value.decimal.lo == 0)) { *retValue = xmlStrdup(BAD_CAST "0.0"); } else { @@ -5549,7 +5549,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) else snprintf(offs, bufsize - (offs - buf), "%lu", dec.lo); - + if (dec.frac != 0) { if (dec.frac != dec.total) { int diff = dec.total - dec.frac; @@ -5562,7 +5562,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) unsigned int i = 0; /* * Insert missing zeroes behind the decimal point. - */ + */ while (*(offs + i) != 0) i++; if (i < dec.total) { @@ -5693,7 +5693,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) snprintf((char *) *retValue, 6, "---%02u", val->value.date.day); } - break; + break; case XML_SCHEMAS_GMONTHDAY: { /* TODO: Unclear in XML Schema 1.0 */ /* TODO: What to do with the timezone? */ @@ -5708,14 +5708,14 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) /* TODO: What to do with the timezone? */ if (val->value.date.year < 0) snprintf(buf, 35, "-%04ld-%02u", - labs(val->value.date.year), + labs(val->value.date.year), val->value.date.mon); else snprintf(buf, 35, "%04ld-%02u", val->value.date.year, val->value.date.mon); *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); } - break; + break; case XML_SCHEMAS_TIME: { char buf[30]; @@ -5726,8 +5726,8 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) norm = xmlSchemaDateNormalize(val, 0); if (norm == NULL) return (-1); - /* - * TODO: Check if "%.14g" is portable. + /* + * TODO: Check if "%.14g" is portable. */ snprintf(buf, 30, "%02u:%02u:%02.14gZ", @@ -5743,7 +5743,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) val->value.date.sec); } *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); - } + } break; case XML_SCHEMAS_DATE: { @@ -5771,7 +5771,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) val->value.date.day); } *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); - } + } break; case XML_SCHEMAS_DATETIME: { @@ -5815,8 +5815,8 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) *retValue = BAD_CAST xmlStrdup(BAD_CAST val->value.base64.str); break; case XML_SCHEMAS_FLOAT: { - char buf[30]; - /* + char buf[30]; + /* * |m| < 16777216, -149 <= e <= 104. * TODO: Handle, NaN, INF, -INF. The format is not * yet conformant. The c type float does not cover @@ -5837,7 +5837,7 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue) snprintf(buf, 40, "%01.14e", val->value.d); *retValue = BAD_CAST xmlStrdup(BAD_CAST buf); } - break; + break; default: *retValue = BAD_CAST xmlStrdup(BAD_CAST "???"); return (1); @@ -5894,7 +5894,7 @@ xmlSchemaGetCanonValueWhtsp(xmlSchemaValPtr val, break; default: return (xmlSchemaGetCanonValue(val, retValue)); - } + } return (0); } diff --git a/reactos/lib/3rdparty/libxml2/xmlstring.c b/reactos/lib/3rdparty/libxml2/xmlstring.c index d73c49cadbc..175bf829f8b 100644 --- a/reactos/lib/3rdparty/libxml2/xmlstring.c +++ b/reactos/lib/3rdparty/libxml2/xmlstring.c @@ -3,7 +3,7 @@ * * This module provides various utility functions for manipulating * the xmlChar* type. All functions named xmlStr* have been moved here - * from the parser.c file (their original home). + * from the parser.c file (their original home). * * See Copyright for the status of this software. * @@ -40,7 +40,7 @@ xmlChar * xmlStrndup(const xmlChar *cur, int len) { xmlChar *ret; - + if ((cur == NULL) || (len < 0)) return(NULL); ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); if (ret == NULL) { @@ -85,7 +85,7 @@ xmlChar * xmlCharStrndup(const char *cur, int len) { int i; xmlChar *ret; - + if ((cur == NULL) || (len < 0)) return(NULL); ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); if (ret == NULL) { @@ -170,7 +170,7 @@ xmlStrEqual(const xmlChar *str1, const xmlChar *str2) { * @name: the localname of the QName * @str: the second xmlChar * * - * Check if a QName is Equal to a given string + * Check if a QName is Equal to a given string * * Returns 1 if they are equal, 0 if they are different */ @@ -340,7 +340,7 @@ xmlStrchr(const xmlChar *str, xmlChar val) { const xmlChar * xmlStrstr(const xmlChar *str, const xmlChar *val) { int n; - + if (str == NULL) return(NULL); if (val == NULL) return(NULL); n = xmlStrlen(val); @@ -368,7 +368,7 @@ xmlStrstr(const xmlChar *str, const xmlChar *val) { const xmlChar * xmlStrcasestr(const xmlChar *str, xmlChar *val) { int n; - + if (str == NULL) return(NULL); if (val == NULL) return(NULL); n = xmlStrlen(val); @@ -396,7 +396,7 @@ xmlStrcasestr(const xmlChar *str, xmlChar *val) { xmlChar * xmlStrsub(const xmlChar *str, int start, int len) { int i; - + if (str == NULL) return(NULL); if (start < 0) return(NULL); if (len < 0) return(NULL); @@ -515,7 +515,7 @@ xmlStrcat(xmlChar *cur, const xmlChar *add) { const xmlChar *p = add; if (add == NULL) return(cur); - if (cur == NULL) + if (cur == NULL) return(xmlStrdup(add)); while (*p != 0) p++; /* non input consuming */ @@ -533,20 +533,20 @@ xmlStrcat(xmlChar *cur, const xmlChar *add) { * * Returns the number of characters written to @buf or -1 if an error occurs. */ -int +int xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) { va_list args; int ret; - + if((buf == NULL) || (msg == NULL)) { return(-1); } - + va_start(args, msg); ret = vsnprintf((char *) buf, len, (const char *) msg, args); va_end(args); buf[len - 1] = 0; /* be safe ! */ - + return(ret); } @@ -561,17 +561,17 @@ xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) { * * Returns the number of characters written to @buf or -1 if an error occurs. */ -int +int xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) { int ret; - + if((buf == NULL) || (msg == NULL)) { return(-1); } - + ret = vsnprintf((char *) buf, len, (const char *) msg, ap); buf[len - 1] = 0; /* be safe ! */ - + return(ret); } @@ -854,7 +854,7 @@ xmlChar * xmlUTF8Strndup(const xmlChar *utf, int len) { xmlChar *ret; int i; - + if ((utf == NULL) || (len < 0)) return(NULL); i = xmlUTF8Strsize(utf, len); ret = (xmlChar *) xmlMallocAtomic((i + 1) * sizeof(xmlChar)); diff --git a/reactos/lib/3rdparty/libxml2/xmlunicode.c b/reactos/lib/3rdparty/libxml2/xmlunicode.c index af91f479c47..76f68d88a29 100644 --- a/reactos/lib/3rdparty/libxml2/xmlunicode.c +++ b/reactos/lib/3rdparty/libxml2/xmlunicode.c @@ -204,725 +204,725 @@ static xmlUnicodeRange xmlUnicodeCats[] = { {"Zp", xmlUCSIsCatZp}, {"Zs", xmlUCSIsCatZs}}; -static xmlChSRange xmlCS[] = {{0x0, 0x1f}, {0x7f, 0x9f}, {0xad, 0xad}, - {0x600, 0x603}, {0x6dd, 0x6dd}, {0x70f, 0x70f}, {0x17b4, 0x17b5}, - {0x200c, 0x200f}, {0x202a, 0x202e}, {0x2060, 0x2063}, {0x206a, 0x206f}, - {0xd800, 0xd800}, {0xdb7f, 0xdb80}, {0xdbff, 0xdc00}, {0xdfff, 0xe000}, +static xmlChSRange xmlCS[] = {{0x0, 0x1f}, {0x7f, 0x9f}, {0xad, 0xad}, + {0x600, 0x603}, {0x6dd, 0x6dd}, {0x70f, 0x70f}, {0x17b4, 0x17b5}, + {0x200c, 0x200f}, {0x202a, 0x202e}, {0x2060, 0x2063}, {0x206a, 0x206f}, + {0xd800, 0xd800}, {0xdb7f, 0xdb80}, {0xdbff, 0xdc00}, {0xdfff, 0xe000}, {0xf8ff, 0xf8ff}, {0xfeff, 0xfeff}, {0xfff9, 0xfffb} }; -static xmlChLRange xmlCL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, - {0xe0020, 0xe007f}, {0xf0000, 0xf0000}, {0xffffd, 0xffffd}, +static xmlChLRange xmlCL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, + {0xe0020, 0xe007f}, {0xf0000, 0xf0000}, {0xffffd, 0xffffd}, {0x100000, 0x100000}, {0x10fffd, 0x10fffd} }; static xmlChRangeGroup xmlCG = {18,7,xmlCS,xmlCL}; -static xmlChSRange xmlCfS[] = {{0xad, 0xad}, {0x600, 0x603}, - {0x6dd, 0x6dd}, {0x70f, 0x70f}, {0x17b4, 0x17b5}, {0x200c, 0x200f}, - {0x202a, 0x202e}, {0x2060, 0x2063}, {0x206a, 0x206f}, {0xfeff, 0xfeff}, +static xmlChSRange xmlCfS[] = {{0xad, 0xad}, {0x600, 0x603}, + {0x6dd, 0x6dd}, {0x70f, 0x70f}, {0x17b4, 0x17b5}, {0x200c, 0x200f}, + {0x202a, 0x202e}, {0x2060, 0x2063}, {0x206a, 0x206f}, {0xfeff, 0xfeff}, {0xfff9, 0xfffb} }; -static xmlChLRange xmlCfL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, +static xmlChLRange xmlCfL[] = {{0x1d173, 0x1d17a}, {0xe0001, 0xe0001}, {0xe0020, 0xe007f} }; static xmlChRangeGroup xmlCfG = {11,3,xmlCfS,xmlCfL}; -static xmlChSRange xmlLS[] = {{0x41, 0x5a}, {0x61, 0x7a}, {0xaa, 0xaa}, - {0xb5, 0xb5}, {0xba, 0xba}, {0xc0, 0xd6}, {0xd8, 0xf6}, {0xf8, 0x236}, - {0x250, 0x2c1}, {0x2c6, 0x2d1}, {0x2e0, 0x2e4}, {0x2ee, 0x2ee}, - {0x37a, 0x37a}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, - {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3f5}, {0x3f7, 0x3fb}, - {0x400, 0x481}, {0x48a, 0x4ce}, {0x4d0, 0x4f5}, {0x4f8, 0x4f9}, - {0x500, 0x50f}, {0x531, 0x556}, {0x559, 0x559}, {0x561, 0x587}, - {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x640, 0x64a}, - {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, - {0x6ee, 0x6ef}, {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, {0x710, 0x710}, - {0x712, 0x72f}, {0x74d, 0x74f}, {0x780, 0x7a5}, {0x7b1, 0x7b1}, - {0x904, 0x939}, {0x93d, 0x93d}, {0x950, 0x950}, {0x958, 0x961}, - {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8}, {0x9aa, 0x9b0}, - {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, {0x9dc, 0x9dd}, - {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, - {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, - {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, - {0xa85, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, - {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd}, {0xad0, 0xad0}, - {0xae0, 0xae1}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, - {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb35, 0xb39}, {0xb3d, 0xb3d}, - {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb71, 0xb71}, {0xb83, 0xb83}, - {0xb85, 0xb8a}, {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, - {0xb9c, 0xb9c}, {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, - {0xbae, 0xbb5}, {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, - {0xc12, 0xc28}, {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, - {0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, - {0xcb5, 0xcb9}, {0xcbd, 0xcbd}, {0xcde, 0xcde}, {0xce0, 0xce1}, - {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28}, {0xd2a, 0xd39}, - {0xd60, 0xd61}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, - {0xdbd, 0xdbd}, {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe32, 0xe33}, - {0xe40, 0xe46}, {0xe81, 0xe82}, {0xe84, 0xe84}, {0xe87, 0xe88}, - {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97}, {0xe99, 0xe9f}, - {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7}, {0xeaa, 0xeab}, - {0xead, 0xeb0}, {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, - {0xec6, 0xec6}, {0xedc, 0xedd}, {0xf00, 0xf00}, {0xf40, 0xf47}, - {0xf49, 0xf6a}, {0xf88, 0xf8b}, {0x1000, 0x1021}, {0x1023, 0x1027}, - {0x1029, 0x102a}, {0x1050, 0x1055}, {0x10a0, 0x10c5}, {0x10d0, 0x10f8}, - {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, {0x1200, 0x1206}, - {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, {0x1250, 0x1256}, - {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, {0x1288, 0x1288}, - {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, {0x12b2, 0x12b5}, - {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, {0x12c8, 0x12ce}, - {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, {0x1310, 0x1310}, - {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, {0x1348, 0x135a}, - {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, {0x1681, 0x169a}, - {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, {0x1720, 0x1731}, - {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, {0x1780, 0x17b3}, - {0x17d7, 0x17d7}, {0x17dc, 0x17dc}, {0x1820, 0x1877}, {0x1880, 0x18a8}, - {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, {0x1d00, 0x1d6b}, - {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, - {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, - {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, - {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, - {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, - {0x1ff6, 0x1ffc}, {0x2071, 0x2071}, {0x207f, 0x207f}, {0x2102, 0x2102}, - {0x2107, 0x2107}, {0x210a, 0x2113}, {0x2115, 0x2115}, {0x2119, 0x211d}, - {0x2124, 0x2124}, {0x2126, 0x2126}, {0x2128, 0x2128}, {0x212a, 0x212d}, - {0x212f, 0x2131}, {0x2133, 0x2139}, {0x213d, 0x213f}, {0x2145, 0x2149}, - {0x3005, 0x3006}, {0x3031, 0x3035}, {0x303b, 0x303c}, {0x3041, 0x3096}, - {0x309d, 0x309f}, {0x30a1, 0x30fa}, {0x30fc, 0x30ff}, {0x3105, 0x312c}, - {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, {0x3400, 0x3400}, - {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, {0xa000, 0xa48c}, - {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, {0xfa30, 0xfa6a}, - {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1d, 0xfb1d}, {0xfb1f, 0xfb28}, - {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb3e, 0xfb3e}, {0xfb40, 0xfb41}, - {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d}, {0xfd50, 0xfd8f}, - {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe74}, {0xfe76, 0xfefc}, - {0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe}, {0xffc2, 0xffc7}, +static xmlChSRange xmlLS[] = {{0x41, 0x5a}, {0x61, 0x7a}, {0xaa, 0xaa}, + {0xb5, 0xb5}, {0xba, 0xba}, {0xc0, 0xd6}, {0xd8, 0xf6}, {0xf8, 0x236}, + {0x250, 0x2c1}, {0x2c6, 0x2d1}, {0x2e0, 0x2e4}, {0x2ee, 0x2ee}, + {0x37a, 0x37a}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, + {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3f5}, {0x3f7, 0x3fb}, + {0x400, 0x481}, {0x48a, 0x4ce}, {0x4d0, 0x4f5}, {0x4f8, 0x4f9}, + {0x500, 0x50f}, {0x531, 0x556}, {0x559, 0x559}, {0x561, 0x587}, + {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x640, 0x64a}, + {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, + {0x6ee, 0x6ef}, {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, {0x710, 0x710}, + {0x712, 0x72f}, {0x74d, 0x74f}, {0x780, 0x7a5}, {0x7b1, 0x7b1}, + {0x904, 0x939}, {0x93d, 0x93d}, {0x950, 0x950}, {0x958, 0x961}, + {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8}, {0x9aa, 0x9b0}, + {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, {0x9dc, 0x9dd}, + {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, + {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, + {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, + {0xa85, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, + {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd}, {0xad0, 0xad0}, + {0xae0, 0xae1}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, + {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb35, 0xb39}, {0xb3d, 0xb3d}, + {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb71, 0xb71}, {0xb83, 0xb83}, + {0xb85, 0xb8a}, {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, + {0xb9c, 0xb9c}, {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, + {0xbae, 0xbb5}, {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, + {0xc12, 0xc28}, {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, + {0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, + {0xcb5, 0xcb9}, {0xcbd, 0xcbd}, {0xcde, 0xcde}, {0xce0, 0xce1}, + {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28}, {0xd2a, 0xd39}, + {0xd60, 0xd61}, {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, + {0xdbd, 0xdbd}, {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe32, 0xe33}, + {0xe40, 0xe46}, {0xe81, 0xe82}, {0xe84, 0xe84}, {0xe87, 0xe88}, + {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97}, {0xe99, 0xe9f}, + {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7}, {0xeaa, 0xeab}, + {0xead, 0xeb0}, {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, + {0xec6, 0xec6}, {0xedc, 0xedd}, {0xf00, 0xf00}, {0xf40, 0xf47}, + {0xf49, 0xf6a}, {0xf88, 0xf8b}, {0x1000, 0x1021}, {0x1023, 0x1027}, + {0x1029, 0x102a}, {0x1050, 0x1055}, {0x10a0, 0x10c5}, {0x10d0, 0x10f8}, + {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, {0x1200, 0x1206}, + {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, {0x1250, 0x1256}, + {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, {0x1288, 0x1288}, + {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, {0x12b2, 0x12b5}, + {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, {0x12c8, 0x12ce}, + {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, {0x1310, 0x1310}, + {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, {0x1348, 0x135a}, + {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, {0x1681, 0x169a}, + {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, {0x1720, 0x1731}, + {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, {0x1780, 0x17b3}, + {0x17d7, 0x17d7}, {0x17dc, 0x17dc}, {0x1820, 0x1877}, {0x1880, 0x18a8}, + {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, {0x1d00, 0x1d6b}, + {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, + {0x1f20, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, + {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, + {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, + {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, + {0x1ff6, 0x1ffc}, {0x2071, 0x2071}, {0x207f, 0x207f}, {0x2102, 0x2102}, + {0x2107, 0x2107}, {0x210a, 0x2113}, {0x2115, 0x2115}, {0x2119, 0x211d}, + {0x2124, 0x2124}, {0x2126, 0x2126}, {0x2128, 0x2128}, {0x212a, 0x212d}, + {0x212f, 0x2131}, {0x2133, 0x2139}, {0x213d, 0x213f}, {0x2145, 0x2149}, + {0x3005, 0x3006}, {0x3031, 0x3035}, {0x303b, 0x303c}, {0x3041, 0x3096}, + {0x309d, 0x309f}, {0x30a1, 0x30fa}, {0x30fc, 0x30ff}, {0x3105, 0x312c}, + {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, {0x3400, 0x3400}, + {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, {0xa000, 0xa48c}, + {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, {0xfa30, 0xfa6a}, + {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1d, 0xfb1d}, {0xfb1f, 0xfb28}, + {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb3e, 0xfb3e}, {0xfb40, 0xfb41}, + {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d}, {0xfd50, 0xfd8f}, + {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe74}, {0xfe76, 0xfefc}, + {0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc} }; -static xmlChLRange xmlLL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, - {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, - {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, - {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10400, 0x1049d}, - {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, - {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, - {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d49e, 0x1d49f}, - {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, {0x1d4a9, 0x1d4ac}, - {0x1d4ae, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, - {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, - {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, - {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, - {0x1d552, 0x1d6a3}, {0x1d6a8, 0x1d6c0}, {0x1d6c2, 0x1d6da}, - {0x1d6dc, 0x1d6fa}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d734}, - {0x1d736, 0x1d74e}, {0x1d750, 0x1d76e}, {0x1d770, 0x1d788}, - {0x1d78a, 0x1d7a8}, {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9}, +static xmlChLRange xmlLL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, + {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, + {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, + {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10400, 0x1049d}, + {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, + {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, + {0x1d400, 0x1d454}, {0x1d456, 0x1d49c}, {0x1d49e, 0x1d49f}, + {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, {0x1d4a9, 0x1d4ac}, + {0x1d4ae, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, + {0x1d4c5, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, + {0x1d516, 0x1d51c}, {0x1d51e, 0x1d539}, {0x1d53b, 0x1d53e}, + {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, + {0x1d552, 0x1d6a3}, {0x1d6a8, 0x1d6c0}, {0x1d6c2, 0x1d6da}, + {0x1d6dc, 0x1d6fa}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d734}, + {0x1d736, 0x1d74e}, {0x1d750, 0x1d76e}, {0x1d770, 0x1d788}, + {0x1d78a, 0x1d7a8}, {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9}, {0x20000, 0x20000}, {0x2a6d6, 0x2a6d6}, {0x2f800, 0x2fa1d} }; static xmlChRangeGroup xmlLG = {279,50,xmlLS,xmlLL}; -static xmlChSRange xmlLlS[] = {{0x61, 0x7a}, {0xaa, 0xaa}, {0xb5, 0xb5}, - {0xba, 0xba}, {0xdf, 0xf6}, {0xf8, 0xff}, {0x101, 0x101}, - {0x103, 0x103}, {0x105, 0x105}, {0x107, 0x107}, {0x109, 0x109}, - {0x10b, 0x10b}, {0x10d, 0x10d}, {0x10f, 0x10f}, {0x111, 0x111}, - {0x113, 0x113}, {0x115, 0x115}, {0x117, 0x117}, {0x119, 0x119}, - {0x11b, 0x11b}, {0x11d, 0x11d}, {0x11f, 0x11f}, {0x121, 0x121}, - {0x123, 0x123}, {0x125, 0x125}, {0x127, 0x127}, {0x129, 0x129}, - {0x12b, 0x12b}, {0x12d, 0x12d}, {0x12f, 0x12f}, {0x131, 0x131}, - {0x133, 0x133}, {0x135, 0x135}, {0x137, 0x138}, {0x13a, 0x13a}, - {0x13c, 0x13c}, {0x13e, 0x13e}, {0x140, 0x140}, {0x142, 0x142}, - {0x144, 0x144}, {0x146, 0x146}, {0x148, 0x149}, {0x14b, 0x14b}, - {0x14d, 0x14d}, {0x14f, 0x14f}, {0x151, 0x151}, {0x153, 0x153}, - {0x155, 0x155}, {0x157, 0x157}, {0x159, 0x159}, {0x15b, 0x15b}, - {0x15d, 0x15d}, {0x15f, 0x15f}, {0x161, 0x161}, {0x163, 0x163}, - {0x165, 0x165}, {0x167, 0x167}, {0x169, 0x169}, {0x16b, 0x16b}, - {0x16d, 0x16d}, {0x16f, 0x16f}, {0x171, 0x171}, {0x173, 0x173}, - {0x175, 0x175}, {0x177, 0x177}, {0x17a, 0x17a}, {0x17c, 0x17c}, - {0x17e, 0x180}, {0x183, 0x183}, {0x185, 0x185}, {0x188, 0x188}, - {0x18c, 0x18d}, {0x192, 0x192}, {0x195, 0x195}, {0x199, 0x19b}, - {0x19e, 0x19e}, {0x1a1, 0x1a1}, {0x1a3, 0x1a3}, {0x1a5, 0x1a5}, - {0x1a8, 0x1a8}, {0x1aa, 0x1ab}, {0x1ad, 0x1ad}, {0x1b0, 0x1b0}, - {0x1b4, 0x1b4}, {0x1b6, 0x1b6}, {0x1b9, 0x1ba}, {0x1bd, 0x1bf}, - {0x1c6, 0x1c6}, {0x1c9, 0x1c9}, {0x1cc, 0x1cc}, {0x1ce, 0x1ce}, - {0x1d0, 0x1d0}, {0x1d2, 0x1d2}, {0x1d4, 0x1d4}, {0x1d6, 0x1d6}, - {0x1d8, 0x1d8}, {0x1da, 0x1da}, {0x1dc, 0x1dd}, {0x1df, 0x1df}, - {0x1e1, 0x1e1}, {0x1e3, 0x1e3}, {0x1e5, 0x1e5}, {0x1e7, 0x1e7}, - {0x1e9, 0x1e9}, {0x1eb, 0x1eb}, {0x1ed, 0x1ed}, {0x1ef, 0x1f0}, - {0x1f3, 0x1f3}, {0x1f5, 0x1f5}, {0x1f9, 0x1f9}, {0x1fb, 0x1fb}, - {0x1fd, 0x1fd}, {0x1ff, 0x1ff}, {0x201, 0x201}, {0x203, 0x203}, - {0x205, 0x205}, {0x207, 0x207}, {0x209, 0x209}, {0x20b, 0x20b}, - {0x20d, 0x20d}, {0x20f, 0x20f}, {0x211, 0x211}, {0x213, 0x213}, - {0x215, 0x215}, {0x217, 0x217}, {0x219, 0x219}, {0x21b, 0x21b}, - {0x21d, 0x21d}, {0x21f, 0x21f}, {0x221, 0x221}, {0x223, 0x223}, - {0x225, 0x225}, {0x227, 0x227}, {0x229, 0x229}, {0x22b, 0x22b}, - {0x22d, 0x22d}, {0x22f, 0x22f}, {0x231, 0x231}, {0x233, 0x236}, - {0x250, 0x2af}, {0x390, 0x390}, {0x3ac, 0x3ce}, {0x3d0, 0x3d1}, - {0x3d5, 0x3d7}, {0x3d9, 0x3d9}, {0x3db, 0x3db}, {0x3dd, 0x3dd}, - {0x3df, 0x3df}, {0x3e1, 0x3e1}, {0x3e3, 0x3e3}, {0x3e5, 0x3e5}, - {0x3e7, 0x3e7}, {0x3e9, 0x3e9}, {0x3eb, 0x3eb}, {0x3ed, 0x3ed}, - {0x3ef, 0x3f3}, {0x3f5, 0x3f5}, {0x3f8, 0x3f8}, {0x3fb, 0x3fb}, - {0x430, 0x45f}, {0x461, 0x461}, {0x463, 0x463}, {0x465, 0x465}, - {0x467, 0x467}, {0x469, 0x469}, {0x46b, 0x46b}, {0x46d, 0x46d}, - {0x46f, 0x46f}, {0x471, 0x471}, {0x473, 0x473}, {0x475, 0x475}, - {0x477, 0x477}, {0x479, 0x479}, {0x47b, 0x47b}, {0x47d, 0x47d}, - {0x47f, 0x47f}, {0x481, 0x481}, {0x48b, 0x48b}, {0x48d, 0x48d}, - {0x48f, 0x48f}, {0x491, 0x491}, {0x493, 0x493}, {0x495, 0x495}, - {0x497, 0x497}, {0x499, 0x499}, {0x49b, 0x49b}, {0x49d, 0x49d}, - {0x49f, 0x49f}, {0x4a1, 0x4a1}, {0x4a3, 0x4a3}, {0x4a5, 0x4a5}, - {0x4a7, 0x4a7}, {0x4a9, 0x4a9}, {0x4ab, 0x4ab}, {0x4ad, 0x4ad}, - {0x4af, 0x4af}, {0x4b1, 0x4b1}, {0x4b3, 0x4b3}, {0x4b5, 0x4b5}, - {0x4b7, 0x4b7}, {0x4b9, 0x4b9}, {0x4bb, 0x4bb}, {0x4bd, 0x4bd}, - {0x4bf, 0x4bf}, {0x4c2, 0x4c2}, {0x4c4, 0x4c4}, {0x4c6, 0x4c6}, - {0x4c8, 0x4c8}, {0x4ca, 0x4ca}, {0x4cc, 0x4cc}, {0x4ce, 0x4ce}, - {0x4d1, 0x4d1}, {0x4d3, 0x4d3}, {0x4d5, 0x4d5}, {0x4d7, 0x4d7}, - {0x4d9, 0x4d9}, {0x4db, 0x4db}, {0x4dd, 0x4dd}, {0x4df, 0x4df}, - {0x4e1, 0x4e1}, {0x4e3, 0x4e3}, {0x4e5, 0x4e5}, {0x4e7, 0x4e7}, - {0x4e9, 0x4e9}, {0x4eb, 0x4eb}, {0x4ed, 0x4ed}, {0x4ef, 0x4ef}, - {0x4f1, 0x4f1}, {0x4f3, 0x4f3}, {0x4f5, 0x4f5}, {0x4f9, 0x4f9}, - {0x501, 0x501}, {0x503, 0x503}, {0x505, 0x505}, {0x507, 0x507}, - {0x509, 0x509}, {0x50b, 0x50b}, {0x50d, 0x50d}, {0x50f, 0x50f}, - {0x561, 0x587}, {0x1d00, 0x1d2b}, {0x1d62, 0x1d6b}, {0x1e01, 0x1e01}, - {0x1e03, 0x1e03}, {0x1e05, 0x1e05}, {0x1e07, 0x1e07}, {0x1e09, 0x1e09}, - {0x1e0b, 0x1e0b}, {0x1e0d, 0x1e0d}, {0x1e0f, 0x1e0f}, {0x1e11, 0x1e11}, - {0x1e13, 0x1e13}, {0x1e15, 0x1e15}, {0x1e17, 0x1e17}, {0x1e19, 0x1e19}, - {0x1e1b, 0x1e1b}, {0x1e1d, 0x1e1d}, {0x1e1f, 0x1e1f}, {0x1e21, 0x1e21}, - {0x1e23, 0x1e23}, {0x1e25, 0x1e25}, {0x1e27, 0x1e27}, {0x1e29, 0x1e29}, - {0x1e2b, 0x1e2b}, {0x1e2d, 0x1e2d}, {0x1e2f, 0x1e2f}, {0x1e31, 0x1e31}, - {0x1e33, 0x1e33}, {0x1e35, 0x1e35}, {0x1e37, 0x1e37}, {0x1e39, 0x1e39}, - {0x1e3b, 0x1e3b}, {0x1e3d, 0x1e3d}, {0x1e3f, 0x1e3f}, {0x1e41, 0x1e41}, - {0x1e43, 0x1e43}, {0x1e45, 0x1e45}, {0x1e47, 0x1e47}, {0x1e49, 0x1e49}, - {0x1e4b, 0x1e4b}, {0x1e4d, 0x1e4d}, {0x1e4f, 0x1e4f}, {0x1e51, 0x1e51}, - {0x1e53, 0x1e53}, {0x1e55, 0x1e55}, {0x1e57, 0x1e57}, {0x1e59, 0x1e59}, - {0x1e5b, 0x1e5b}, {0x1e5d, 0x1e5d}, {0x1e5f, 0x1e5f}, {0x1e61, 0x1e61}, - {0x1e63, 0x1e63}, {0x1e65, 0x1e65}, {0x1e67, 0x1e67}, {0x1e69, 0x1e69}, - {0x1e6b, 0x1e6b}, {0x1e6d, 0x1e6d}, {0x1e6f, 0x1e6f}, {0x1e71, 0x1e71}, - {0x1e73, 0x1e73}, {0x1e75, 0x1e75}, {0x1e77, 0x1e77}, {0x1e79, 0x1e79}, - {0x1e7b, 0x1e7b}, {0x1e7d, 0x1e7d}, {0x1e7f, 0x1e7f}, {0x1e81, 0x1e81}, - {0x1e83, 0x1e83}, {0x1e85, 0x1e85}, {0x1e87, 0x1e87}, {0x1e89, 0x1e89}, - {0x1e8b, 0x1e8b}, {0x1e8d, 0x1e8d}, {0x1e8f, 0x1e8f}, {0x1e91, 0x1e91}, - {0x1e93, 0x1e93}, {0x1e95, 0x1e9b}, {0x1ea1, 0x1ea1}, {0x1ea3, 0x1ea3}, - {0x1ea5, 0x1ea5}, {0x1ea7, 0x1ea7}, {0x1ea9, 0x1ea9}, {0x1eab, 0x1eab}, - {0x1ead, 0x1ead}, {0x1eaf, 0x1eaf}, {0x1eb1, 0x1eb1}, {0x1eb3, 0x1eb3}, - {0x1eb5, 0x1eb5}, {0x1eb7, 0x1eb7}, {0x1eb9, 0x1eb9}, {0x1ebb, 0x1ebb}, - {0x1ebd, 0x1ebd}, {0x1ebf, 0x1ebf}, {0x1ec1, 0x1ec1}, {0x1ec3, 0x1ec3}, - {0x1ec5, 0x1ec5}, {0x1ec7, 0x1ec7}, {0x1ec9, 0x1ec9}, {0x1ecb, 0x1ecb}, - {0x1ecd, 0x1ecd}, {0x1ecf, 0x1ecf}, {0x1ed1, 0x1ed1}, {0x1ed3, 0x1ed3}, - {0x1ed5, 0x1ed5}, {0x1ed7, 0x1ed7}, {0x1ed9, 0x1ed9}, {0x1edb, 0x1edb}, - {0x1edd, 0x1edd}, {0x1edf, 0x1edf}, {0x1ee1, 0x1ee1}, {0x1ee3, 0x1ee3}, - {0x1ee5, 0x1ee5}, {0x1ee7, 0x1ee7}, {0x1ee9, 0x1ee9}, {0x1eeb, 0x1eeb}, - {0x1eed, 0x1eed}, {0x1eef, 0x1eef}, {0x1ef1, 0x1ef1}, {0x1ef3, 0x1ef3}, - {0x1ef5, 0x1ef5}, {0x1ef7, 0x1ef7}, {0x1ef9, 0x1ef9}, {0x1f00, 0x1f07}, - {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37}, {0x1f40, 0x1f45}, - {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d}, {0x1f80, 0x1f87}, - {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, {0x1fb6, 0x1fb7}, - {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fc7}, {0x1fd0, 0x1fd3}, - {0x1fd6, 0x1fd7}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ff7}, - {0x2071, 0x2071}, {0x207f, 0x207f}, {0x210a, 0x210a}, {0x210e, 0x210f}, - {0x2113, 0x2113}, {0x212f, 0x212f}, {0x2134, 0x2134}, {0x2139, 0x2139}, - {0x213d, 0x213d}, {0x2146, 0x2149}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, +static xmlChSRange xmlLlS[] = {{0x61, 0x7a}, {0xaa, 0xaa}, {0xb5, 0xb5}, + {0xba, 0xba}, {0xdf, 0xf6}, {0xf8, 0xff}, {0x101, 0x101}, + {0x103, 0x103}, {0x105, 0x105}, {0x107, 0x107}, {0x109, 0x109}, + {0x10b, 0x10b}, {0x10d, 0x10d}, {0x10f, 0x10f}, {0x111, 0x111}, + {0x113, 0x113}, {0x115, 0x115}, {0x117, 0x117}, {0x119, 0x119}, + {0x11b, 0x11b}, {0x11d, 0x11d}, {0x11f, 0x11f}, {0x121, 0x121}, + {0x123, 0x123}, {0x125, 0x125}, {0x127, 0x127}, {0x129, 0x129}, + {0x12b, 0x12b}, {0x12d, 0x12d}, {0x12f, 0x12f}, {0x131, 0x131}, + {0x133, 0x133}, {0x135, 0x135}, {0x137, 0x138}, {0x13a, 0x13a}, + {0x13c, 0x13c}, {0x13e, 0x13e}, {0x140, 0x140}, {0x142, 0x142}, + {0x144, 0x144}, {0x146, 0x146}, {0x148, 0x149}, {0x14b, 0x14b}, + {0x14d, 0x14d}, {0x14f, 0x14f}, {0x151, 0x151}, {0x153, 0x153}, + {0x155, 0x155}, {0x157, 0x157}, {0x159, 0x159}, {0x15b, 0x15b}, + {0x15d, 0x15d}, {0x15f, 0x15f}, {0x161, 0x161}, {0x163, 0x163}, + {0x165, 0x165}, {0x167, 0x167}, {0x169, 0x169}, {0x16b, 0x16b}, + {0x16d, 0x16d}, {0x16f, 0x16f}, {0x171, 0x171}, {0x173, 0x173}, + {0x175, 0x175}, {0x177, 0x177}, {0x17a, 0x17a}, {0x17c, 0x17c}, + {0x17e, 0x180}, {0x183, 0x183}, {0x185, 0x185}, {0x188, 0x188}, + {0x18c, 0x18d}, {0x192, 0x192}, {0x195, 0x195}, {0x199, 0x19b}, + {0x19e, 0x19e}, {0x1a1, 0x1a1}, {0x1a3, 0x1a3}, {0x1a5, 0x1a5}, + {0x1a8, 0x1a8}, {0x1aa, 0x1ab}, {0x1ad, 0x1ad}, {0x1b0, 0x1b0}, + {0x1b4, 0x1b4}, {0x1b6, 0x1b6}, {0x1b9, 0x1ba}, {0x1bd, 0x1bf}, + {0x1c6, 0x1c6}, {0x1c9, 0x1c9}, {0x1cc, 0x1cc}, {0x1ce, 0x1ce}, + {0x1d0, 0x1d0}, {0x1d2, 0x1d2}, {0x1d4, 0x1d4}, {0x1d6, 0x1d6}, + {0x1d8, 0x1d8}, {0x1da, 0x1da}, {0x1dc, 0x1dd}, {0x1df, 0x1df}, + {0x1e1, 0x1e1}, {0x1e3, 0x1e3}, {0x1e5, 0x1e5}, {0x1e7, 0x1e7}, + {0x1e9, 0x1e9}, {0x1eb, 0x1eb}, {0x1ed, 0x1ed}, {0x1ef, 0x1f0}, + {0x1f3, 0x1f3}, {0x1f5, 0x1f5}, {0x1f9, 0x1f9}, {0x1fb, 0x1fb}, + {0x1fd, 0x1fd}, {0x1ff, 0x1ff}, {0x201, 0x201}, {0x203, 0x203}, + {0x205, 0x205}, {0x207, 0x207}, {0x209, 0x209}, {0x20b, 0x20b}, + {0x20d, 0x20d}, {0x20f, 0x20f}, {0x211, 0x211}, {0x213, 0x213}, + {0x215, 0x215}, {0x217, 0x217}, {0x219, 0x219}, {0x21b, 0x21b}, + {0x21d, 0x21d}, {0x21f, 0x21f}, {0x221, 0x221}, {0x223, 0x223}, + {0x225, 0x225}, {0x227, 0x227}, {0x229, 0x229}, {0x22b, 0x22b}, + {0x22d, 0x22d}, {0x22f, 0x22f}, {0x231, 0x231}, {0x233, 0x236}, + {0x250, 0x2af}, {0x390, 0x390}, {0x3ac, 0x3ce}, {0x3d0, 0x3d1}, + {0x3d5, 0x3d7}, {0x3d9, 0x3d9}, {0x3db, 0x3db}, {0x3dd, 0x3dd}, + {0x3df, 0x3df}, {0x3e1, 0x3e1}, {0x3e3, 0x3e3}, {0x3e5, 0x3e5}, + {0x3e7, 0x3e7}, {0x3e9, 0x3e9}, {0x3eb, 0x3eb}, {0x3ed, 0x3ed}, + {0x3ef, 0x3f3}, {0x3f5, 0x3f5}, {0x3f8, 0x3f8}, {0x3fb, 0x3fb}, + {0x430, 0x45f}, {0x461, 0x461}, {0x463, 0x463}, {0x465, 0x465}, + {0x467, 0x467}, {0x469, 0x469}, {0x46b, 0x46b}, {0x46d, 0x46d}, + {0x46f, 0x46f}, {0x471, 0x471}, {0x473, 0x473}, {0x475, 0x475}, + {0x477, 0x477}, {0x479, 0x479}, {0x47b, 0x47b}, {0x47d, 0x47d}, + {0x47f, 0x47f}, {0x481, 0x481}, {0x48b, 0x48b}, {0x48d, 0x48d}, + {0x48f, 0x48f}, {0x491, 0x491}, {0x493, 0x493}, {0x495, 0x495}, + {0x497, 0x497}, {0x499, 0x499}, {0x49b, 0x49b}, {0x49d, 0x49d}, + {0x49f, 0x49f}, {0x4a1, 0x4a1}, {0x4a3, 0x4a3}, {0x4a5, 0x4a5}, + {0x4a7, 0x4a7}, {0x4a9, 0x4a9}, {0x4ab, 0x4ab}, {0x4ad, 0x4ad}, + {0x4af, 0x4af}, {0x4b1, 0x4b1}, {0x4b3, 0x4b3}, {0x4b5, 0x4b5}, + {0x4b7, 0x4b7}, {0x4b9, 0x4b9}, {0x4bb, 0x4bb}, {0x4bd, 0x4bd}, + {0x4bf, 0x4bf}, {0x4c2, 0x4c2}, {0x4c4, 0x4c4}, {0x4c6, 0x4c6}, + {0x4c8, 0x4c8}, {0x4ca, 0x4ca}, {0x4cc, 0x4cc}, {0x4ce, 0x4ce}, + {0x4d1, 0x4d1}, {0x4d3, 0x4d3}, {0x4d5, 0x4d5}, {0x4d7, 0x4d7}, + {0x4d9, 0x4d9}, {0x4db, 0x4db}, {0x4dd, 0x4dd}, {0x4df, 0x4df}, + {0x4e1, 0x4e1}, {0x4e3, 0x4e3}, {0x4e5, 0x4e5}, {0x4e7, 0x4e7}, + {0x4e9, 0x4e9}, {0x4eb, 0x4eb}, {0x4ed, 0x4ed}, {0x4ef, 0x4ef}, + {0x4f1, 0x4f1}, {0x4f3, 0x4f3}, {0x4f5, 0x4f5}, {0x4f9, 0x4f9}, + {0x501, 0x501}, {0x503, 0x503}, {0x505, 0x505}, {0x507, 0x507}, + {0x509, 0x509}, {0x50b, 0x50b}, {0x50d, 0x50d}, {0x50f, 0x50f}, + {0x561, 0x587}, {0x1d00, 0x1d2b}, {0x1d62, 0x1d6b}, {0x1e01, 0x1e01}, + {0x1e03, 0x1e03}, {0x1e05, 0x1e05}, {0x1e07, 0x1e07}, {0x1e09, 0x1e09}, + {0x1e0b, 0x1e0b}, {0x1e0d, 0x1e0d}, {0x1e0f, 0x1e0f}, {0x1e11, 0x1e11}, + {0x1e13, 0x1e13}, {0x1e15, 0x1e15}, {0x1e17, 0x1e17}, {0x1e19, 0x1e19}, + {0x1e1b, 0x1e1b}, {0x1e1d, 0x1e1d}, {0x1e1f, 0x1e1f}, {0x1e21, 0x1e21}, + {0x1e23, 0x1e23}, {0x1e25, 0x1e25}, {0x1e27, 0x1e27}, {0x1e29, 0x1e29}, + {0x1e2b, 0x1e2b}, {0x1e2d, 0x1e2d}, {0x1e2f, 0x1e2f}, {0x1e31, 0x1e31}, + {0x1e33, 0x1e33}, {0x1e35, 0x1e35}, {0x1e37, 0x1e37}, {0x1e39, 0x1e39}, + {0x1e3b, 0x1e3b}, {0x1e3d, 0x1e3d}, {0x1e3f, 0x1e3f}, {0x1e41, 0x1e41}, + {0x1e43, 0x1e43}, {0x1e45, 0x1e45}, {0x1e47, 0x1e47}, {0x1e49, 0x1e49}, + {0x1e4b, 0x1e4b}, {0x1e4d, 0x1e4d}, {0x1e4f, 0x1e4f}, {0x1e51, 0x1e51}, + {0x1e53, 0x1e53}, {0x1e55, 0x1e55}, {0x1e57, 0x1e57}, {0x1e59, 0x1e59}, + {0x1e5b, 0x1e5b}, {0x1e5d, 0x1e5d}, {0x1e5f, 0x1e5f}, {0x1e61, 0x1e61}, + {0x1e63, 0x1e63}, {0x1e65, 0x1e65}, {0x1e67, 0x1e67}, {0x1e69, 0x1e69}, + {0x1e6b, 0x1e6b}, {0x1e6d, 0x1e6d}, {0x1e6f, 0x1e6f}, {0x1e71, 0x1e71}, + {0x1e73, 0x1e73}, {0x1e75, 0x1e75}, {0x1e77, 0x1e77}, {0x1e79, 0x1e79}, + {0x1e7b, 0x1e7b}, {0x1e7d, 0x1e7d}, {0x1e7f, 0x1e7f}, {0x1e81, 0x1e81}, + {0x1e83, 0x1e83}, {0x1e85, 0x1e85}, {0x1e87, 0x1e87}, {0x1e89, 0x1e89}, + {0x1e8b, 0x1e8b}, {0x1e8d, 0x1e8d}, {0x1e8f, 0x1e8f}, {0x1e91, 0x1e91}, + {0x1e93, 0x1e93}, {0x1e95, 0x1e9b}, {0x1ea1, 0x1ea1}, {0x1ea3, 0x1ea3}, + {0x1ea5, 0x1ea5}, {0x1ea7, 0x1ea7}, {0x1ea9, 0x1ea9}, {0x1eab, 0x1eab}, + {0x1ead, 0x1ead}, {0x1eaf, 0x1eaf}, {0x1eb1, 0x1eb1}, {0x1eb3, 0x1eb3}, + {0x1eb5, 0x1eb5}, {0x1eb7, 0x1eb7}, {0x1eb9, 0x1eb9}, {0x1ebb, 0x1ebb}, + {0x1ebd, 0x1ebd}, {0x1ebf, 0x1ebf}, {0x1ec1, 0x1ec1}, {0x1ec3, 0x1ec3}, + {0x1ec5, 0x1ec5}, {0x1ec7, 0x1ec7}, {0x1ec9, 0x1ec9}, {0x1ecb, 0x1ecb}, + {0x1ecd, 0x1ecd}, {0x1ecf, 0x1ecf}, {0x1ed1, 0x1ed1}, {0x1ed3, 0x1ed3}, + {0x1ed5, 0x1ed5}, {0x1ed7, 0x1ed7}, {0x1ed9, 0x1ed9}, {0x1edb, 0x1edb}, + {0x1edd, 0x1edd}, {0x1edf, 0x1edf}, {0x1ee1, 0x1ee1}, {0x1ee3, 0x1ee3}, + {0x1ee5, 0x1ee5}, {0x1ee7, 0x1ee7}, {0x1ee9, 0x1ee9}, {0x1eeb, 0x1eeb}, + {0x1eed, 0x1eed}, {0x1eef, 0x1eef}, {0x1ef1, 0x1ef1}, {0x1ef3, 0x1ef3}, + {0x1ef5, 0x1ef5}, {0x1ef7, 0x1ef7}, {0x1ef9, 0x1ef9}, {0x1f00, 0x1f07}, + {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37}, {0x1f40, 0x1f45}, + {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d}, {0x1f80, 0x1f87}, + {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, {0x1fb6, 0x1fb7}, + {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fc7}, {0x1fd0, 0x1fd3}, + {0x1fd6, 0x1fd7}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ff7}, + {0x2071, 0x2071}, {0x207f, 0x207f}, {0x210a, 0x210a}, {0x210e, 0x210f}, + {0x2113, 0x2113}, {0x212f, 0x212f}, {0x2134, 0x2134}, {0x2139, 0x2139}, + {0x213d, 0x213d}, {0x2146, 0x2149}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xff41, 0xff5a} }; -static xmlChLRange xmlLlL[] = {{0x10428, 0x1044f}, {0x1d41a, 0x1d433}, - {0x1d44e, 0x1d454}, {0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, - {0x1d4b6, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, - {0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, {0x1d51e, 0x1d537}, - {0x1d552, 0x1d56b}, {0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, - {0x1d5ee, 0x1d607}, {0x1d622, 0x1d63b}, {0x1d656, 0x1d66f}, - {0x1d68a, 0x1d6a3}, {0x1d6c2, 0x1d6da}, {0x1d6dc, 0x1d6e1}, - {0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, {0x1d736, 0x1d74e}, - {0x1d750, 0x1d755}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, +static xmlChLRange xmlLlL[] = {{0x10428, 0x1044f}, {0x1d41a, 0x1d433}, + {0x1d44e, 0x1d454}, {0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, + {0x1d4b6, 0x1d4b9}, {0x1d4bb, 0x1d4bb}, {0x1d4bd, 0x1d4c3}, + {0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, {0x1d51e, 0x1d537}, + {0x1d552, 0x1d56b}, {0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, + {0x1d5ee, 0x1d607}, {0x1d622, 0x1d63b}, {0x1d656, 0x1d66f}, + {0x1d68a, 0x1d6a3}, {0x1d6c2, 0x1d6da}, {0x1d6dc, 0x1d6e1}, + {0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, {0x1d736, 0x1d74e}, + {0x1d750, 0x1d755}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9} }; static xmlChRangeGroup xmlLlG = {396,28,xmlLlS,xmlLlL}; -static xmlChSRange xmlLmS[] = {{0x2b0, 0x2c1}, {0x2c6, 0x2d1}, - {0x2e0, 0x2e4}, {0x2ee, 0x2ee}, {0x37a, 0x37a}, {0x559, 0x559}, - {0x640, 0x640}, {0x6e5, 0x6e6}, {0xe46, 0xe46}, {0xec6, 0xec6}, - {0x17d7, 0x17d7}, {0x1843, 0x1843}, {0x1d2c, 0x1d61}, {0x3005, 0x3005}, - {0x3031, 0x3035}, {0x303b, 0x303b}, {0x309d, 0x309e}, {0x30fc, 0x30fe}, +static xmlChSRange xmlLmS[] = {{0x2b0, 0x2c1}, {0x2c6, 0x2d1}, + {0x2e0, 0x2e4}, {0x2ee, 0x2ee}, {0x37a, 0x37a}, {0x559, 0x559}, + {0x640, 0x640}, {0x6e5, 0x6e6}, {0xe46, 0xe46}, {0xec6, 0xec6}, + {0x17d7, 0x17d7}, {0x1843, 0x1843}, {0x1d2c, 0x1d61}, {0x3005, 0x3005}, + {0x3031, 0x3035}, {0x303b, 0x303b}, {0x309d, 0x309e}, {0x30fc, 0x30fe}, {0xff70, 0xff70}, {0xff9e, 0xff9f} }; static xmlChRangeGroup xmlLmG = {20,0,xmlLmS,NULL}; -static xmlChSRange xmlLoS[] = {{0x1bb, 0x1bb}, {0x1c0, 0x1c3}, - {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a}, - {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, {0x6ee, 0x6ef}, - {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, {0x710, 0x710}, {0x712, 0x72f}, - {0x74d, 0x74f}, {0x780, 0x7a5}, {0x7b1, 0x7b1}, {0x904, 0x939}, - {0x93d, 0x93d}, {0x950, 0x950}, {0x958, 0x961}, {0x985, 0x98c}, - {0x98f, 0x990}, {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, - {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, {0x9dc, 0x9dd}, {0x9df, 0x9e1}, - {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, {0xa13, 0xa28}, - {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, {0xa38, 0xa39}, - {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, {0xa85, 0xa8d}, - {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, - {0xab5, 0xab9}, {0xabd, 0xabd}, {0xad0, 0xad0}, {0xae0, 0xae1}, - {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, {0xb2a, 0xb30}, - {0xb32, 0xb33}, {0xb35, 0xb39}, {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, - {0xb5f, 0xb61}, {0xb71, 0xb71}, {0xb83, 0xb83}, {0xb85, 0xb8a}, - {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, - {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, - {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, - {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, - {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, - {0xcbd, 0xcbd}, {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, - {0xd0e, 0xd10}, {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, - {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdbd, 0xdbd}, - {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, - {0xe81, 0xe82}, {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, - {0xe8d, 0xe8d}, {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, - {0xea5, 0xea5}, {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeb0}, - {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xedc, 0xedd}, - {0xf00, 0xf00}, {0xf40, 0xf47}, {0xf49, 0xf6a}, {0xf88, 0xf8b}, - {0x1000, 0x1021}, {0x1023, 0x1027}, {0x1029, 0x102a}, {0x1050, 0x1055}, - {0x10d0, 0x10f8}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, - {0x1200, 0x1206}, {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, - {0x1250, 0x1256}, {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, - {0x1288, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, - {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, - {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, - {0x1310, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, - {0x1348, 0x135a}, {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, - {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, - {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, - {0x1780, 0x17b3}, {0x17dc, 0x17dc}, {0x1820, 0x1842}, {0x1844, 0x1877}, - {0x1880, 0x18a8}, {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, - {0x2135, 0x2138}, {0x3006, 0x3006}, {0x303c, 0x303c}, {0x3041, 0x3096}, - {0x309f, 0x309f}, {0x30a1, 0x30fa}, {0x30ff, 0x30ff}, {0x3105, 0x312c}, - {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, {0x3400, 0x3400}, - {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, {0xa000, 0xa48c}, - {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, {0xfa30, 0xfa6a}, - {0xfb1d, 0xfb1d}, {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, - {0xfb3e, 0xfb3e}, {0xfb40, 0xfb41}, {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, - {0xfbd3, 0xfd3d}, {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, - {0xfe70, 0xfe74}, {0xfe76, 0xfefc}, {0xff66, 0xff6f}, {0xff71, 0xff9d}, - {0xffa0, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, +static xmlChSRange xmlLoS[] = {{0x1bb, 0x1bb}, {0x1c0, 0x1c3}, + {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a}, + {0x66e, 0x66f}, {0x671, 0x6d3}, {0x6d5, 0x6d5}, {0x6ee, 0x6ef}, + {0x6fa, 0x6fc}, {0x6ff, 0x6ff}, {0x710, 0x710}, {0x712, 0x72f}, + {0x74d, 0x74f}, {0x780, 0x7a5}, {0x7b1, 0x7b1}, {0x904, 0x939}, + {0x93d, 0x93d}, {0x950, 0x950}, {0x958, 0x961}, {0x985, 0x98c}, + {0x98f, 0x990}, {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, + {0x9b6, 0x9b9}, {0x9bd, 0x9bd}, {0x9dc, 0x9dd}, {0x9df, 0x9e1}, + {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10}, {0xa13, 0xa28}, + {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36}, {0xa38, 0xa39}, + {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74}, {0xa85, 0xa8d}, + {0xa8f, 0xa91}, {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, + {0xab5, 0xab9}, {0xabd, 0xabd}, {0xad0, 0xad0}, {0xae0, 0xae1}, + {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28}, {0xb2a, 0xb30}, + {0xb32, 0xb33}, {0xb35, 0xb39}, {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, + {0xb5f, 0xb61}, {0xb71, 0xb71}, {0xb83, 0xb83}, {0xb85, 0xb8a}, + {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, + {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, + {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, + {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, + {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, + {0xcbd, 0xcbd}, {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, + {0xd0e, 0xd10}, {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, + {0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdbd, 0xdbd}, + {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, + {0xe81, 0xe82}, {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, + {0xe8d, 0xe8d}, {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, + {0xea5, 0xea5}, {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeb0}, + {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xedc, 0xedd}, + {0xf00, 0xf00}, {0xf40, 0xf47}, {0xf49, 0xf6a}, {0xf88, 0xf8b}, + {0x1000, 0x1021}, {0x1023, 0x1027}, {0x1029, 0x102a}, {0x1050, 0x1055}, + {0x10d0, 0x10f8}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, + {0x1200, 0x1206}, {0x1208, 0x1246}, {0x1248, 0x1248}, {0x124a, 0x124d}, + {0x1250, 0x1256}, {0x1258, 0x1258}, {0x125a, 0x125d}, {0x1260, 0x1286}, + {0x1288, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b0, 0x12b0}, + {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c0, 0x12c0}, {0x12c2, 0x12c5}, + {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, + {0x1310, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x131e}, {0x1320, 0x1346}, + {0x1348, 0x135a}, {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x1676}, + {0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x1700, 0x170c}, {0x170e, 0x1711}, + {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770}, + {0x1780, 0x17b3}, {0x17dc, 0x17dc}, {0x1820, 0x1842}, {0x1844, 0x1877}, + {0x1880, 0x18a8}, {0x1900, 0x191c}, {0x1950, 0x196d}, {0x1970, 0x1974}, + {0x2135, 0x2138}, {0x3006, 0x3006}, {0x303c, 0x303c}, {0x3041, 0x3096}, + {0x309f, 0x309f}, {0x30a1, 0x30fa}, {0x30ff, 0x30ff}, {0x3105, 0x312c}, + {0x3131, 0x318e}, {0x31a0, 0x31b7}, {0x31f0, 0x31ff}, {0x3400, 0x3400}, + {0x4db5, 0x4db5}, {0x4e00, 0x4e00}, {0x9fa5, 0x9fa5}, {0xa000, 0xa48c}, + {0xac00, 0xac00}, {0xd7a3, 0xd7a3}, {0xf900, 0xfa2d}, {0xfa30, 0xfa6a}, + {0xfb1d, 0xfb1d}, {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, + {0xfb3e, 0xfb3e}, {0xfb40, 0xfb41}, {0xfb43, 0xfb44}, {0xfb46, 0xfbb1}, + {0xfbd3, 0xfd3d}, {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, + {0xfe70, 0xfe74}, {0xfe76, 0xfefc}, {0xff66, 0xff6f}, {0xff71, 0xff9d}, + {0xffa0, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc} }; -static xmlChLRange xmlLoL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, - {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, - {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, - {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10450, 0x1049d}, - {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, - {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, +static xmlChLRange xmlLoL[] = {{0x10000, 0x1000b}, {0x1000d, 0x10026}, + {0x10028, 0x1003a}, {0x1003c, 0x1003d}, {0x1003f, 0x1004d}, + {0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10300, 0x1031e}, + {0x10330, 0x10349}, {0x10380, 0x1039d}, {0x10450, 0x1049d}, + {0x10800, 0x10805}, {0x10808, 0x10808}, {0x1080a, 0x10835}, + {0x10837, 0x10838}, {0x1083c, 0x1083c}, {0x1083f, 0x1083f}, {0x20000, 0x20000}, {0x2a6d6, 0x2a6d6}, {0x2f800, 0x2fa1d} }; static xmlChRangeGroup xmlLoG = {211,20,xmlLoS,xmlLoL}; -static xmlChSRange xmlLtS[] = {{0x1c5, 0x1c5}, {0x1c8, 0x1c8}, - {0x1cb, 0x1cb}, {0x1f2, 0x1f2}, {0x1f88, 0x1f8f}, {0x1f98, 0x1f9f}, +static xmlChSRange xmlLtS[] = {{0x1c5, 0x1c5}, {0x1c8, 0x1c8}, + {0x1cb, 0x1cb}, {0x1f2, 0x1f2}, {0x1f88, 0x1f8f}, {0x1f98, 0x1f9f}, {0x1fa8, 0x1faf}, {0x1fbc, 0x1fbc}, {0x1fcc, 0x1fcc}, {0x1ffc, 0x1ffc} }; static xmlChRangeGroup xmlLtG = {10,0,xmlLtS,NULL}; -static xmlChSRange xmlLuS[] = {{0x41, 0x5a}, {0xc0, 0xd6}, {0xd8, 0xde}, - {0x100, 0x100}, {0x102, 0x102}, {0x104, 0x104}, {0x106, 0x106}, - {0x108, 0x108}, {0x10a, 0x10a}, {0x10c, 0x10c}, {0x10e, 0x10e}, - {0x110, 0x110}, {0x112, 0x112}, {0x114, 0x114}, {0x116, 0x116}, - {0x118, 0x118}, {0x11a, 0x11a}, {0x11c, 0x11c}, {0x11e, 0x11e}, - {0x120, 0x120}, {0x122, 0x122}, {0x124, 0x124}, {0x126, 0x126}, - {0x128, 0x128}, {0x12a, 0x12a}, {0x12c, 0x12c}, {0x12e, 0x12e}, - {0x130, 0x130}, {0x132, 0x132}, {0x134, 0x134}, {0x136, 0x136}, - {0x139, 0x139}, {0x13b, 0x13b}, {0x13d, 0x13d}, {0x13f, 0x13f}, - {0x141, 0x141}, {0x143, 0x143}, {0x145, 0x145}, {0x147, 0x147}, - {0x14a, 0x14a}, {0x14c, 0x14c}, {0x14e, 0x14e}, {0x150, 0x150}, - {0x152, 0x152}, {0x154, 0x154}, {0x156, 0x156}, {0x158, 0x158}, - {0x15a, 0x15a}, {0x15c, 0x15c}, {0x15e, 0x15e}, {0x160, 0x160}, - {0x162, 0x162}, {0x164, 0x164}, {0x166, 0x166}, {0x168, 0x168}, - {0x16a, 0x16a}, {0x16c, 0x16c}, {0x16e, 0x16e}, {0x170, 0x170}, - {0x172, 0x172}, {0x174, 0x174}, {0x176, 0x176}, {0x178, 0x179}, - {0x17b, 0x17b}, {0x17d, 0x17d}, {0x181, 0x182}, {0x184, 0x184}, - {0x186, 0x187}, {0x189, 0x18b}, {0x18e, 0x191}, {0x193, 0x194}, - {0x196, 0x198}, {0x19c, 0x19d}, {0x19f, 0x1a0}, {0x1a2, 0x1a2}, - {0x1a4, 0x1a4}, {0x1a6, 0x1a7}, {0x1a9, 0x1a9}, {0x1ac, 0x1ac}, - {0x1ae, 0x1af}, {0x1b1, 0x1b3}, {0x1b5, 0x1b5}, {0x1b7, 0x1b8}, - {0x1bc, 0x1bc}, {0x1c4, 0x1c4}, {0x1c7, 0x1c7}, {0x1ca, 0x1ca}, - {0x1cd, 0x1cd}, {0x1cf, 0x1cf}, {0x1d1, 0x1d1}, {0x1d3, 0x1d3}, - {0x1d5, 0x1d5}, {0x1d7, 0x1d7}, {0x1d9, 0x1d9}, {0x1db, 0x1db}, - {0x1de, 0x1de}, {0x1e0, 0x1e0}, {0x1e2, 0x1e2}, {0x1e4, 0x1e4}, - {0x1e6, 0x1e6}, {0x1e8, 0x1e8}, {0x1ea, 0x1ea}, {0x1ec, 0x1ec}, - {0x1ee, 0x1ee}, {0x1f1, 0x1f1}, {0x1f4, 0x1f4}, {0x1f6, 0x1f8}, - {0x1fa, 0x1fa}, {0x1fc, 0x1fc}, {0x1fe, 0x1fe}, {0x200, 0x200}, - {0x202, 0x202}, {0x204, 0x204}, {0x206, 0x206}, {0x208, 0x208}, - {0x20a, 0x20a}, {0x20c, 0x20c}, {0x20e, 0x20e}, {0x210, 0x210}, - {0x212, 0x212}, {0x214, 0x214}, {0x216, 0x216}, {0x218, 0x218}, - {0x21a, 0x21a}, {0x21c, 0x21c}, {0x21e, 0x21e}, {0x220, 0x220}, - {0x222, 0x222}, {0x224, 0x224}, {0x226, 0x226}, {0x228, 0x228}, - {0x22a, 0x22a}, {0x22c, 0x22c}, {0x22e, 0x22e}, {0x230, 0x230}, - {0x232, 0x232}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, - {0x38e, 0x38f}, {0x391, 0x3a1}, {0x3a3, 0x3ab}, {0x3d2, 0x3d4}, - {0x3d8, 0x3d8}, {0x3da, 0x3da}, {0x3dc, 0x3dc}, {0x3de, 0x3de}, - {0x3e0, 0x3e0}, {0x3e2, 0x3e2}, {0x3e4, 0x3e4}, {0x3e6, 0x3e6}, - {0x3e8, 0x3e8}, {0x3ea, 0x3ea}, {0x3ec, 0x3ec}, {0x3ee, 0x3ee}, - {0x3f4, 0x3f4}, {0x3f7, 0x3f7}, {0x3f9, 0x3fa}, {0x400, 0x42f}, - {0x460, 0x460}, {0x462, 0x462}, {0x464, 0x464}, {0x466, 0x466}, - {0x468, 0x468}, {0x46a, 0x46a}, {0x46c, 0x46c}, {0x46e, 0x46e}, - {0x470, 0x470}, {0x472, 0x472}, {0x474, 0x474}, {0x476, 0x476}, - {0x478, 0x478}, {0x47a, 0x47a}, {0x47c, 0x47c}, {0x47e, 0x47e}, - {0x480, 0x480}, {0x48a, 0x48a}, {0x48c, 0x48c}, {0x48e, 0x48e}, - {0x490, 0x490}, {0x492, 0x492}, {0x494, 0x494}, {0x496, 0x496}, - {0x498, 0x498}, {0x49a, 0x49a}, {0x49c, 0x49c}, {0x49e, 0x49e}, - {0x4a0, 0x4a0}, {0x4a2, 0x4a2}, {0x4a4, 0x4a4}, {0x4a6, 0x4a6}, - {0x4a8, 0x4a8}, {0x4aa, 0x4aa}, {0x4ac, 0x4ac}, {0x4ae, 0x4ae}, - {0x4b0, 0x4b0}, {0x4b2, 0x4b2}, {0x4b4, 0x4b4}, {0x4b6, 0x4b6}, - {0x4b8, 0x4b8}, {0x4ba, 0x4ba}, {0x4bc, 0x4bc}, {0x4be, 0x4be}, - {0x4c0, 0x4c1}, {0x4c3, 0x4c3}, {0x4c5, 0x4c5}, {0x4c7, 0x4c7}, - {0x4c9, 0x4c9}, {0x4cb, 0x4cb}, {0x4cd, 0x4cd}, {0x4d0, 0x4d0}, - {0x4d2, 0x4d2}, {0x4d4, 0x4d4}, {0x4d6, 0x4d6}, {0x4d8, 0x4d8}, - {0x4da, 0x4da}, {0x4dc, 0x4dc}, {0x4de, 0x4de}, {0x4e0, 0x4e0}, - {0x4e2, 0x4e2}, {0x4e4, 0x4e4}, {0x4e6, 0x4e6}, {0x4e8, 0x4e8}, - {0x4ea, 0x4ea}, {0x4ec, 0x4ec}, {0x4ee, 0x4ee}, {0x4f0, 0x4f0}, - {0x4f2, 0x4f2}, {0x4f4, 0x4f4}, {0x4f8, 0x4f8}, {0x500, 0x500}, - {0x502, 0x502}, {0x504, 0x504}, {0x506, 0x506}, {0x508, 0x508}, - {0x50a, 0x50a}, {0x50c, 0x50c}, {0x50e, 0x50e}, {0x531, 0x556}, - {0x10a0, 0x10c5}, {0x1e00, 0x1e00}, {0x1e02, 0x1e02}, {0x1e04, 0x1e04}, - {0x1e06, 0x1e06}, {0x1e08, 0x1e08}, {0x1e0a, 0x1e0a}, {0x1e0c, 0x1e0c}, - {0x1e0e, 0x1e0e}, {0x1e10, 0x1e10}, {0x1e12, 0x1e12}, {0x1e14, 0x1e14}, - {0x1e16, 0x1e16}, {0x1e18, 0x1e18}, {0x1e1a, 0x1e1a}, {0x1e1c, 0x1e1c}, - {0x1e1e, 0x1e1e}, {0x1e20, 0x1e20}, {0x1e22, 0x1e22}, {0x1e24, 0x1e24}, - {0x1e26, 0x1e26}, {0x1e28, 0x1e28}, {0x1e2a, 0x1e2a}, {0x1e2c, 0x1e2c}, - {0x1e2e, 0x1e2e}, {0x1e30, 0x1e30}, {0x1e32, 0x1e32}, {0x1e34, 0x1e34}, - {0x1e36, 0x1e36}, {0x1e38, 0x1e38}, {0x1e3a, 0x1e3a}, {0x1e3c, 0x1e3c}, - {0x1e3e, 0x1e3e}, {0x1e40, 0x1e40}, {0x1e42, 0x1e42}, {0x1e44, 0x1e44}, - {0x1e46, 0x1e46}, {0x1e48, 0x1e48}, {0x1e4a, 0x1e4a}, {0x1e4c, 0x1e4c}, - {0x1e4e, 0x1e4e}, {0x1e50, 0x1e50}, {0x1e52, 0x1e52}, {0x1e54, 0x1e54}, - {0x1e56, 0x1e56}, {0x1e58, 0x1e58}, {0x1e5a, 0x1e5a}, {0x1e5c, 0x1e5c}, - {0x1e5e, 0x1e5e}, {0x1e60, 0x1e60}, {0x1e62, 0x1e62}, {0x1e64, 0x1e64}, - {0x1e66, 0x1e66}, {0x1e68, 0x1e68}, {0x1e6a, 0x1e6a}, {0x1e6c, 0x1e6c}, - {0x1e6e, 0x1e6e}, {0x1e70, 0x1e70}, {0x1e72, 0x1e72}, {0x1e74, 0x1e74}, - {0x1e76, 0x1e76}, {0x1e78, 0x1e78}, {0x1e7a, 0x1e7a}, {0x1e7c, 0x1e7c}, - {0x1e7e, 0x1e7e}, {0x1e80, 0x1e80}, {0x1e82, 0x1e82}, {0x1e84, 0x1e84}, - {0x1e86, 0x1e86}, {0x1e88, 0x1e88}, {0x1e8a, 0x1e8a}, {0x1e8c, 0x1e8c}, - {0x1e8e, 0x1e8e}, {0x1e90, 0x1e90}, {0x1e92, 0x1e92}, {0x1e94, 0x1e94}, - {0x1ea0, 0x1ea0}, {0x1ea2, 0x1ea2}, {0x1ea4, 0x1ea4}, {0x1ea6, 0x1ea6}, - {0x1ea8, 0x1ea8}, {0x1eaa, 0x1eaa}, {0x1eac, 0x1eac}, {0x1eae, 0x1eae}, - {0x1eb0, 0x1eb0}, {0x1eb2, 0x1eb2}, {0x1eb4, 0x1eb4}, {0x1eb6, 0x1eb6}, - {0x1eb8, 0x1eb8}, {0x1eba, 0x1eba}, {0x1ebc, 0x1ebc}, {0x1ebe, 0x1ebe}, - {0x1ec0, 0x1ec0}, {0x1ec2, 0x1ec2}, {0x1ec4, 0x1ec4}, {0x1ec6, 0x1ec6}, - {0x1ec8, 0x1ec8}, {0x1eca, 0x1eca}, {0x1ecc, 0x1ecc}, {0x1ece, 0x1ece}, - {0x1ed0, 0x1ed0}, {0x1ed2, 0x1ed2}, {0x1ed4, 0x1ed4}, {0x1ed6, 0x1ed6}, - {0x1ed8, 0x1ed8}, {0x1eda, 0x1eda}, {0x1edc, 0x1edc}, {0x1ede, 0x1ede}, - {0x1ee0, 0x1ee0}, {0x1ee2, 0x1ee2}, {0x1ee4, 0x1ee4}, {0x1ee6, 0x1ee6}, - {0x1ee8, 0x1ee8}, {0x1eea, 0x1eea}, {0x1eec, 0x1eec}, {0x1eee, 0x1eee}, - {0x1ef0, 0x1ef0}, {0x1ef2, 0x1ef2}, {0x1ef4, 0x1ef4}, {0x1ef6, 0x1ef6}, - {0x1ef8, 0x1ef8}, {0x1f08, 0x1f0f}, {0x1f18, 0x1f1d}, {0x1f28, 0x1f2f}, - {0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, - {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f5f}, {0x1f68, 0x1f6f}, {0x1fb8, 0x1fbb}, - {0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb}, - {0x2102, 0x2102}, {0x2107, 0x2107}, {0x210b, 0x210d}, {0x2110, 0x2112}, - {0x2115, 0x2115}, {0x2119, 0x211d}, {0x2124, 0x2124}, {0x2126, 0x2126}, - {0x2128, 0x2128}, {0x212a, 0x212d}, {0x2130, 0x2131}, {0x2133, 0x2133}, +static xmlChSRange xmlLuS[] = {{0x41, 0x5a}, {0xc0, 0xd6}, {0xd8, 0xde}, + {0x100, 0x100}, {0x102, 0x102}, {0x104, 0x104}, {0x106, 0x106}, + {0x108, 0x108}, {0x10a, 0x10a}, {0x10c, 0x10c}, {0x10e, 0x10e}, + {0x110, 0x110}, {0x112, 0x112}, {0x114, 0x114}, {0x116, 0x116}, + {0x118, 0x118}, {0x11a, 0x11a}, {0x11c, 0x11c}, {0x11e, 0x11e}, + {0x120, 0x120}, {0x122, 0x122}, {0x124, 0x124}, {0x126, 0x126}, + {0x128, 0x128}, {0x12a, 0x12a}, {0x12c, 0x12c}, {0x12e, 0x12e}, + {0x130, 0x130}, {0x132, 0x132}, {0x134, 0x134}, {0x136, 0x136}, + {0x139, 0x139}, {0x13b, 0x13b}, {0x13d, 0x13d}, {0x13f, 0x13f}, + {0x141, 0x141}, {0x143, 0x143}, {0x145, 0x145}, {0x147, 0x147}, + {0x14a, 0x14a}, {0x14c, 0x14c}, {0x14e, 0x14e}, {0x150, 0x150}, + {0x152, 0x152}, {0x154, 0x154}, {0x156, 0x156}, {0x158, 0x158}, + {0x15a, 0x15a}, {0x15c, 0x15c}, {0x15e, 0x15e}, {0x160, 0x160}, + {0x162, 0x162}, {0x164, 0x164}, {0x166, 0x166}, {0x168, 0x168}, + {0x16a, 0x16a}, {0x16c, 0x16c}, {0x16e, 0x16e}, {0x170, 0x170}, + {0x172, 0x172}, {0x174, 0x174}, {0x176, 0x176}, {0x178, 0x179}, + {0x17b, 0x17b}, {0x17d, 0x17d}, {0x181, 0x182}, {0x184, 0x184}, + {0x186, 0x187}, {0x189, 0x18b}, {0x18e, 0x191}, {0x193, 0x194}, + {0x196, 0x198}, {0x19c, 0x19d}, {0x19f, 0x1a0}, {0x1a2, 0x1a2}, + {0x1a4, 0x1a4}, {0x1a6, 0x1a7}, {0x1a9, 0x1a9}, {0x1ac, 0x1ac}, + {0x1ae, 0x1af}, {0x1b1, 0x1b3}, {0x1b5, 0x1b5}, {0x1b7, 0x1b8}, + {0x1bc, 0x1bc}, {0x1c4, 0x1c4}, {0x1c7, 0x1c7}, {0x1ca, 0x1ca}, + {0x1cd, 0x1cd}, {0x1cf, 0x1cf}, {0x1d1, 0x1d1}, {0x1d3, 0x1d3}, + {0x1d5, 0x1d5}, {0x1d7, 0x1d7}, {0x1d9, 0x1d9}, {0x1db, 0x1db}, + {0x1de, 0x1de}, {0x1e0, 0x1e0}, {0x1e2, 0x1e2}, {0x1e4, 0x1e4}, + {0x1e6, 0x1e6}, {0x1e8, 0x1e8}, {0x1ea, 0x1ea}, {0x1ec, 0x1ec}, + {0x1ee, 0x1ee}, {0x1f1, 0x1f1}, {0x1f4, 0x1f4}, {0x1f6, 0x1f8}, + {0x1fa, 0x1fa}, {0x1fc, 0x1fc}, {0x1fe, 0x1fe}, {0x200, 0x200}, + {0x202, 0x202}, {0x204, 0x204}, {0x206, 0x206}, {0x208, 0x208}, + {0x20a, 0x20a}, {0x20c, 0x20c}, {0x20e, 0x20e}, {0x210, 0x210}, + {0x212, 0x212}, {0x214, 0x214}, {0x216, 0x216}, {0x218, 0x218}, + {0x21a, 0x21a}, {0x21c, 0x21c}, {0x21e, 0x21e}, {0x220, 0x220}, + {0x222, 0x222}, {0x224, 0x224}, {0x226, 0x226}, {0x228, 0x228}, + {0x22a, 0x22a}, {0x22c, 0x22c}, {0x22e, 0x22e}, {0x230, 0x230}, + {0x232, 0x232}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, + {0x38e, 0x38f}, {0x391, 0x3a1}, {0x3a3, 0x3ab}, {0x3d2, 0x3d4}, + {0x3d8, 0x3d8}, {0x3da, 0x3da}, {0x3dc, 0x3dc}, {0x3de, 0x3de}, + {0x3e0, 0x3e0}, {0x3e2, 0x3e2}, {0x3e4, 0x3e4}, {0x3e6, 0x3e6}, + {0x3e8, 0x3e8}, {0x3ea, 0x3ea}, {0x3ec, 0x3ec}, {0x3ee, 0x3ee}, + {0x3f4, 0x3f4}, {0x3f7, 0x3f7}, {0x3f9, 0x3fa}, {0x400, 0x42f}, + {0x460, 0x460}, {0x462, 0x462}, {0x464, 0x464}, {0x466, 0x466}, + {0x468, 0x468}, {0x46a, 0x46a}, {0x46c, 0x46c}, {0x46e, 0x46e}, + {0x470, 0x470}, {0x472, 0x472}, {0x474, 0x474}, {0x476, 0x476}, + {0x478, 0x478}, {0x47a, 0x47a}, {0x47c, 0x47c}, {0x47e, 0x47e}, + {0x480, 0x480}, {0x48a, 0x48a}, {0x48c, 0x48c}, {0x48e, 0x48e}, + {0x490, 0x490}, {0x492, 0x492}, {0x494, 0x494}, {0x496, 0x496}, + {0x498, 0x498}, {0x49a, 0x49a}, {0x49c, 0x49c}, {0x49e, 0x49e}, + {0x4a0, 0x4a0}, {0x4a2, 0x4a2}, {0x4a4, 0x4a4}, {0x4a6, 0x4a6}, + {0x4a8, 0x4a8}, {0x4aa, 0x4aa}, {0x4ac, 0x4ac}, {0x4ae, 0x4ae}, + {0x4b0, 0x4b0}, {0x4b2, 0x4b2}, {0x4b4, 0x4b4}, {0x4b6, 0x4b6}, + {0x4b8, 0x4b8}, {0x4ba, 0x4ba}, {0x4bc, 0x4bc}, {0x4be, 0x4be}, + {0x4c0, 0x4c1}, {0x4c3, 0x4c3}, {0x4c5, 0x4c5}, {0x4c7, 0x4c7}, + {0x4c9, 0x4c9}, {0x4cb, 0x4cb}, {0x4cd, 0x4cd}, {0x4d0, 0x4d0}, + {0x4d2, 0x4d2}, {0x4d4, 0x4d4}, {0x4d6, 0x4d6}, {0x4d8, 0x4d8}, + {0x4da, 0x4da}, {0x4dc, 0x4dc}, {0x4de, 0x4de}, {0x4e0, 0x4e0}, + {0x4e2, 0x4e2}, {0x4e4, 0x4e4}, {0x4e6, 0x4e6}, {0x4e8, 0x4e8}, + {0x4ea, 0x4ea}, {0x4ec, 0x4ec}, {0x4ee, 0x4ee}, {0x4f0, 0x4f0}, + {0x4f2, 0x4f2}, {0x4f4, 0x4f4}, {0x4f8, 0x4f8}, {0x500, 0x500}, + {0x502, 0x502}, {0x504, 0x504}, {0x506, 0x506}, {0x508, 0x508}, + {0x50a, 0x50a}, {0x50c, 0x50c}, {0x50e, 0x50e}, {0x531, 0x556}, + {0x10a0, 0x10c5}, {0x1e00, 0x1e00}, {0x1e02, 0x1e02}, {0x1e04, 0x1e04}, + {0x1e06, 0x1e06}, {0x1e08, 0x1e08}, {0x1e0a, 0x1e0a}, {0x1e0c, 0x1e0c}, + {0x1e0e, 0x1e0e}, {0x1e10, 0x1e10}, {0x1e12, 0x1e12}, {0x1e14, 0x1e14}, + {0x1e16, 0x1e16}, {0x1e18, 0x1e18}, {0x1e1a, 0x1e1a}, {0x1e1c, 0x1e1c}, + {0x1e1e, 0x1e1e}, {0x1e20, 0x1e20}, {0x1e22, 0x1e22}, {0x1e24, 0x1e24}, + {0x1e26, 0x1e26}, {0x1e28, 0x1e28}, {0x1e2a, 0x1e2a}, {0x1e2c, 0x1e2c}, + {0x1e2e, 0x1e2e}, {0x1e30, 0x1e30}, {0x1e32, 0x1e32}, {0x1e34, 0x1e34}, + {0x1e36, 0x1e36}, {0x1e38, 0x1e38}, {0x1e3a, 0x1e3a}, {0x1e3c, 0x1e3c}, + {0x1e3e, 0x1e3e}, {0x1e40, 0x1e40}, {0x1e42, 0x1e42}, {0x1e44, 0x1e44}, + {0x1e46, 0x1e46}, {0x1e48, 0x1e48}, {0x1e4a, 0x1e4a}, {0x1e4c, 0x1e4c}, + {0x1e4e, 0x1e4e}, {0x1e50, 0x1e50}, {0x1e52, 0x1e52}, {0x1e54, 0x1e54}, + {0x1e56, 0x1e56}, {0x1e58, 0x1e58}, {0x1e5a, 0x1e5a}, {0x1e5c, 0x1e5c}, + {0x1e5e, 0x1e5e}, {0x1e60, 0x1e60}, {0x1e62, 0x1e62}, {0x1e64, 0x1e64}, + {0x1e66, 0x1e66}, {0x1e68, 0x1e68}, {0x1e6a, 0x1e6a}, {0x1e6c, 0x1e6c}, + {0x1e6e, 0x1e6e}, {0x1e70, 0x1e70}, {0x1e72, 0x1e72}, {0x1e74, 0x1e74}, + {0x1e76, 0x1e76}, {0x1e78, 0x1e78}, {0x1e7a, 0x1e7a}, {0x1e7c, 0x1e7c}, + {0x1e7e, 0x1e7e}, {0x1e80, 0x1e80}, {0x1e82, 0x1e82}, {0x1e84, 0x1e84}, + {0x1e86, 0x1e86}, {0x1e88, 0x1e88}, {0x1e8a, 0x1e8a}, {0x1e8c, 0x1e8c}, + {0x1e8e, 0x1e8e}, {0x1e90, 0x1e90}, {0x1e92, 0x1e92}, {0x1e94, 0x1e94}, + {0x1ea0, 0x1ea0}, {0x1ea2, 0x1ea2}, {0x1ea4, 0x1ea4}, {0x1ea6, 0x1ea6}, + {0x1ea8, 0x1ea8}, {0x1eaa, 0x1eaa}, {0x1eac, 0x1eac}, {0x1eae, 0x1eae}, + {0x1eb0, 0x1eb0}, {0x1eb2, 0x1eb2}, {0x1eb4, 0x1eb4}, {0x1eb6, 0x1eb6}, + {0x1eb8, 0x1eb8}, {0x1eba, 0x1eba}, {0x1ebc, 0x1ebc}, {0x1ebe, 0x1ebe}, + {0x1ec0, 0x1ec0}, {0x1ec2, 0x1ec2}, {0x1ec4, 0x1ec4}, {0x1ec6, 0x1ec6}, + {0x1ec8, 0x1ec8}, {0x1eca, 0x1eca}, {0x1ecc, 0x1ecc}, {0x1ece, 0x1ece}, + {0x1ed0, 0x1ed0}, {0x1ed2, 0x1ed2}, {0x1ed4, 0x1ed4}, {0x1ed6, 0x1ed6}, + {0x1ed8, 0x1ed8}, {0x1eda, 0x1eda}, {0x1edc, 0x1edc}, {0x1ede, 0x1ede}, + {0x1ee0, 0x1ee0}, {0x1ee2, 0x1ee2}, {0x1ee4, 0x1ee4}, {0x1ee6, 0x1ee6}, + {0x1ee8, 0x1ee8}, {0x1eea, 0x1eea}, {0x1eec, 0x1eec}, {0x1eee, 0x1eee}, + {0x1ef0, 0x1ef0}, {0x1ef2, 0x1ef2}, {0x1ef4, 0x1ef4}, {0x1ef6, 0x1ef6}, + {0x1ef8, 0x1ef8}, {0x1f08, 0x1f0f}, {0x1f18, 0x1f1d}, {0x1f28, 0x1f2f}, + {0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, + {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f5f}, {0x1f68, 0x1f6f}, {0x1fb8, 0x1fbb}, + {0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb}, + {0x2102, 0x2102}, {0x2107, 0x2107}, {0x210b, 0x210d}, {0x2110, 0x2112}, + {0x2115, 0x2115}, {0x2119, 0x211d}, {0x2124, 0x2124}, {0x2126, 0x2126}, + {0x2128, 0x2128}, {0x212a, 0x212d}, {0x2130, 0x2131}, {0x2133, 0x2133}, {0x213e, 0x213f}, {0x2145, 0x2145}, {0xff21, 0xff3a} }; -static xmlChLRange xmlLuL[] = {{0x10400, 0x10427}, {0x1d400, 0x1d419}, - {0x1d434, 0x1d44d}, {0x1d468, 0x1d481}, {0x1d49c, 0x1d49c}, - {0x1d49e, 0x1d49f}, {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, - {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b5}, {0x1d4d0, 0x1d4e9}, - {0x1d504, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, - {0x1d516, 0x1d51c}, {0x1d538, 0x1d539}, {0x1d53b, 0x1d53e}, - {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, - {0x1d56c, 0x1d585}, {0x1d5a0, 0x1d5b9}, {0x1d5d4, 0x1d5ed}, - {0x1d608, 0x1d621}, {0x1d63c, 0x1d655}, {0x1d670, 0x1d689}, - {0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, {0x1d71c, 0x1d734}, +static xmlChLRange xmlLuL[] = {{0x10400, 0x10427}, {0x1d400, 0x1d419}, + {0x1d434, 0x1d44d}, {0x1d468, 0x1d481}, {0x1d49c, 0x1d49c}, + {0x1d49e, 0x1d49f}, {0x1d4a2, 0x1d4a2}, {0x1d4a5, 0x1d4a6}, + {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b5}, {0x1d4d0, 0x1d4e9}, + {0x1d504, 0x1d505}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, + {0x1d516, 0x1d51c}, {0x1d538, 0x1d539}, {0x1d53b, 0x1d53e}, + {0x1d540, 0x1d544}, {0x1d546, 0x1d546}, {0x1d54a, 0x1d550}, + {0x1d56c, 0x1d585}, {0x1d5a0, 0x1d5b9}, {0x1d5d4, 0x1d5ed}, + {0x1d608, 0x1d621}, {0x1d63c, 0x1d655}, {0x1d670, 0x1d689}, + {0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, {0x1d71c, 0x1d734}, {0x1d756, 0x1d76e}, {0x1d790, 0x1d7a8} }; static xmlChRangeGroup xmlLuG = {390,31,xmlLuS,xmlLuL}; -static xmlChSRange xmlMS[] = {{0x300, 0x357}, {0x35d, 0x36f}, - {0x483, 0x486}, {0x488, 0x489}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, - {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, - {0x610, 0x615}, {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, - {0x6de, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, - {0x730, 0x74a}, {0x7a6, 0x7b0}, {0x901, 0x903}, {0x93c, 0x93c}, - {0x93e, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x983}, - {0x9bc, 0x9bc}, {0x9be, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, - {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa01, 0xa03}, {0xa3c, 0xa3c}, - {0xa3e, 0xa42}, {0xa47, 0xa48}, {0xa4b, 0xa4d}, {0xa70, 0xa71}, - {0xa81, 0xa83}, {0xabc, 0xabc}, {0xabe, 0xac5}, {0xac7, 0xac9}, - {0xacb, 0xacd}, {0xae2, 0xae3}, {0xb01, 0xb03}, {0xb3c, 0xb3c}, - {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, {0xb56, 0xb57}, - {0xb82, 0xb82}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, {0xbca, 0xbcd}, - {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, {0xc46, 0xc48}, - {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, {0xcbc, 0xcbc}, - {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, - {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, - {0xd57, 0xd57}, {0xd82, 0xd83}, {0xdca, 0xdca}, {0xdcf, 0xdd4}, - {0xdd6, 0xdd6}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, {0xe31, 0xe31}, - {0xe34, 0xe3a}, {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, - {0xebb, 0xebc}, {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, - {0xf37, 0xf37}, {0xf39, 0xf39}, {0xf3e, 0xf3f}, {0xf71, 0xf84}, - {0xf86, 0xf87}, {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, - {0x102c, 0x1032}, {0x1036, 0x1039}, {0x1056, 0x1059}, {0x1712, 0x1714}, - {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, {0x17b6, 0x17d3}, - {0x17dd, 0x17dd}, {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x192b}, - {0x1930, 0x193b}, {0x20d0, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, +static xmlChSRange xmlMS[] = {{0x300, 0x357}, {0x35d, 0x36f}, + {0x483, 0x486}, {0x488, 0x489}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, + {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, + {0x610, 0x615}, {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, + {0x6de, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, + {0x730, 0x74a}, {0x7a6, 0x7b0}, {0x901, 0x903}, {0x93c, 0x93c}, + {0x93e, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x983}, + {0x9bc, 0x9bc}, {0x9be, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, + {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa01, 0xa03}, {0xa3c, 0xa3c}, + {0xa3e, 0xa42}, {0xa47, 0xa48}, {0xa4b, 0xa4d}, {0xa70, 0xa71}, + {0xa81, 0xa83}, {0xabc, 0xabc}, {0xabe, 0xac5}, {0xac7, 0xac9}, + {0xacb, 0xacd}, {0xae2, 0xae3}, {0xb01, 0xb03}, {0xb3c, 0xb3c}, + {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, {0xb56, 0xb57}, + {0xb82, 0xb82}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, {0xbca, 0xbcd}, + {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, {0xc46, 0xc48}, + {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, {0xcbc, 0xcbc}, + {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, + {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, + {0xd57, 0xd57}, {0xd82, 0xd83}, {0xdca, 0xdca}, {0xdcf, 0xdd4}, + {0xdd6, 0xdd6}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, {0xe31, 0xe31}, + {0xe34, 0xe3a}, {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, + {0xebb, 0xebc}, {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, + {0xf37, 0xf37}, {0xf39, 0xf39}, {0xf3e, 0xf3f}, {0xf71, 0xf84}, + {0xf86, 0xf87}, {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, + {0x102c, 0x1032}, {0x1036, 0x1039}, {0x1056, 0x1059}, {0x1712, 0x1714}, + {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, {0x17b6, 0x17d3}, + {0x17dd, 0x17dd}, {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x192b}, + {0x1930, 0x193b}, {0x20d0, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, {0xfe00, 0xfe0f}, {0xfe20, 0xfe23} }; -static xmlChLRange xmlML[] = {{0x1d165, 0x1d169}, {0x1d16d, 0x1d172}, - {0x1d17b, 0x1d182}, {0x1d185, 0x1d18b}, {0x1d1aa, 0x1d1ad}, +static xmlChLRange xmlML[] = {{0x1d165, 0x1d169}, {0x1d16d, 0x1d172}, + {0x1d17b, 0x1d182}, {0x1d185, 0x1d18b}, {0x1d1aa, 0x1d1ad}, {0xe0100, 0xe01ef} }; static xmlChRangeGroup xmlMG = {113,6,xmlMS,xmlML}; -static xmlChSRange xmlMcS[] = {{0x903, 0x903}, {0x93e, 0x940}, - {0x949, 0x94c}, {0x982, 0x983}, {0x9be, 0x9c0}, {0x9c7, 0x9c8}, - {0x9cb, 0x9cc}, {0x9d7, 0x9d7}, {0xa03, 0xa03}, {0xa3e, 0xa40}, - {0xa83, 0xa83}, {0xabe, 0xac0}, {0xac9, 0xac9}, {0xacb, 0xacc}, - {0xb02, 0xb03}, {0xb3e, 0xb3e}, {0xb40, 0xb40}, {0xb47, 0xb48}, - {0xb4b, 0xb4c}, {0xb57, 0xb57}, {0xbbe, 0xbbf}, {0xbc1, 0xbc2}, - {0xbc6, 0xbc8}, {0xbca, 0xbcc}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, - {0xc41, 0xc44}, {0xc82, 0xc83}, {0xcbe, 0xcbe}, {0xcc0, 0xcc4}, - {0xcc7, 0xcc8}, {0xcca, 0xccb}, {0xcd5, 0xcd6}, {0xd02, 0xd03}, - {0xd3e, 0xd40}, {0xd46, 0xd48}, {0xd4a, 0xd4c}, {0xd57, 0xd57}, - {0xd82, 0xd83}, {0xdcf, 0xdd1}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, - {0xf3e, 0xf3f}, {0xf7f, 0xf7f}, {0x102c, 0x102c}, {0x1031, 0x1031}, - {0x1038, 0x1038}, {0x1056, 0x1057}, {0x17b6, 0x17b6}, {0x17be, 0x17c5}, - {0x17c7, 0x17c8}, {0x1923, 0x1926}, {0x1929, 0x192b}, {0x1930, 0x1931}, +static xmlChSRange xmlMcS[] = {{0x903, 0x903}, {0x93e, 0x940}, + {0x949, 0x94c}, {0x982, 0x983}, {0x9be, 0x9c0}, {0x9c7, 0x9c8}, + {0x9cb, 0x9cc}, {0x9d7, 0x9d7}, {0xa03, 0xa03}, {0xa3e, 0xa40}, + {0xa83, 0xa83}, {0xabe, 0xac0}, {0xac9, 0xac9}, {0xacb, 0xacc}, + {0xb02, 0xb03}, {0xb3e, 0xb3e}, {0xb40, 0xb40}, {0xb47, 0xb48}, + {0xb4b, 0xb4c}, {0xb57, 0xb57}, {0xbbe, 0xbbf}, {0xbc1, 0xbc2}, + {0xbc6, 0xbc8}, {0xbca, 0xbcc}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, + {0xc41, 0xc44}, {0xc82, 0xc83}, {0xcbe, 0xcbe}, {0xcc0, 0xcc4}, + {0xcc7, 0xcc8}, {0xcca, 0xccb}, {0xcd5, 0xcd6}, {0xd02, 0xd03}, + {0xd3e, 0xd40}, {0xd46, 0xd48}, {0xd4a, 0xd4c}, {0xd57, 0xd57}, + {0xd82, 0xd83}, {0xdcf, 0xdd1}, {0xdd8, 0xddf}, {0xdf2, 0xdf3}, + {0xf3e, 0xf3f}, {0xf7f, 0xf7f}, {0x102c, 0x102c}, {0x1031, 0x1031}, + {0x1038, 0x1038}, {0x1056, 0x1057}, {0x17b6, 0x17b6}, {0x17be, 0x17c5}, + {0x17c7, 0x17c8}, {0x1923, 0x1926}, {0x1929, 0x192b}, {0x1930, 0x1931}, {0x1933, 0x1938} }; static xmlChLRange xmlMcL[] = {{0x1d165, 0x1d166}, {0x1d16d, 0x1d172} }; static xmlChRangeGroup xmlMcG = {55,2,xmlMcS,xmlMcL}; -static xmlChSRange xmlMnS[] = {{0x300, 0x357}, {0x35d, 0x36f}, - {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, {0x5bb, 0x5bd}, - {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, {0x610, 0x615}, - {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6df, 0x6e4}, - {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, {0x730, 0x74a}, - {0x7a6, 0x7b0}, {0x901, 0x902}, {0x93c, 0x93c}, {0x941, 0x948}, - {0x94d, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x981}, - {0x9bc, 0x9bc}, {0x9c1, 0x9c4}, {0x9cd, 0x9cd}, {0x9e2, 0x9e3}, - {0xa01, 0xa02}, {0xa3c, 0xa3c}, {0xa41, 0xa42}, {0xa47, 0xa48}, - {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa82}, {0xabc, 0xabc}, - {0xac1, 0xac5}, {0xac7, 0xac8}, {0xacd, 0xacd}, {0xae2, 0xae3}, - {0xb01, 0xb01}, {0xb3c, 0xb3c}, {0xb3f, 0xb3f}, {0xb41, 0xb43}, - {0xb4d, 0xb4d}, {0xb56, 0xb56}, {0xb82, 0xb82}, {0xbc0, 0xbc0}, - {0xbcd, 0xbcd}, {0xc3e, 0xc40}, {0xc46, 0xc48}, {0xc4a, 0xc4d}, - {0xc55, 0xc56}, {0xcbc, 0xcbc}, {0xcbf, 0xcbf}, {0xcc6, 0xcc6}, - {0xccc, 0xccd}, {0xd41, 0xd43}, {0xd4d, 0xd4d}, {0xdca, 0xdca}, - {0xdd2, 0xdd4}, {0xdd6, 0xdd6}, {0xe31, 0xe31}, {0xe34, 0xe3a}, - {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, - {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, - {0xf39, 0xf39}, {0xf71, 0xf7e}, {0xf80, 0xf84}, {0xf86, 0xf87}, - {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, {0x102d, 0x1030}, - {0x1032, 0x1032}, {0x1036, 0x1037}, {0x1039, 0x1039}, {0x1058, 0x1059}, - {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, - {0x17b7, 0x17bd}, {0x17c6, 0x17c6}, {0x17c9, 0x17d3}, {0x17dd, 0x17dd}, - {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x1922}, {0x1927, 0x1928}, - {0x1932, 0x1932}, {0x1939, 0x193b}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, - {0x20e5, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, +static xmlChSRange xmlMnS[] = {{0x300, 0x357}, {0x35d, 0x36f}, + {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, {0x5bb, 0x5bd}, + {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, {0x610, 0x615}, + {0x64b, 0x658}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6df, 0x6e4}, + {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x711, 0x711}, {0x730, 0x74a}, + {0x7a6, 0x7b0}, {0x901, 0x902}, {0x93c, 0x93c}, {0x941, 0x948}, + {0x94d, 0x94d}, {0x951, 0x954}, {0x962, 0x963}, {0x981, 0x981}, + {0x9bc, 0x9bc}, {0x9c1, 0x9c4}, {0x9cd, 0x9cd}, {0x9e2, 0x9e3}, + {0xa01, 0xa02}, {0xa3c, 0xa3c}, {0xa41, 0xa42}, {0xa47, 0xa48}, + {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa82}, {0xabc, 0xabc}, + {0xac1, 0xac5}, {0xac7, 0xac8}, {0xacd, 0xacd}, {0xae2, 0xae3}, + {0xb01, 0xb01}, {0xb3c, 0xb3c}, {0xb3f, 0xb3f}, {0xb41, 0xb43}, + {0xb4d, 0xb4d}, {0xb56, 0xb56}, {0xb82, 0xb82}, {0xbc0, 0xbc0}, + {0xbcd, 0xbcd}, {0xc3e, 0xc40}, {0xc46, 0xc48}, {0xc4a, 0xc4d}, + {0xc55, 0xc56}, {0xcbc, 0xcbc}, {0xcbf, 0xcbf}, {0xcc6, 0xcc6}, + {0xccc, 0xccd}, {0xd41, 0xd43}, {0xd4d, 0xd4d}, {0xdca, 0xdca}, + {0xdd2, 0xdd4}, {0xdd6, 0xdd6}, {0xe31, 0xe31}, {0xe34, 0xe3a}, + {0xe47, 0xe4e}, {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, + {0xec8, 0xecd}, {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, + {0xf39, 0xf39}, {0xf71, 0xf7e}, {0xf80, 0xf84}, {0xf86, 0xf87}, + {0xf90, 0xf97}, {0xf99, 0xfbc}, {0xfc6, 0xfc6}, {0x102d, 0x1030}, + {0x1032, 0x1032}, {0x1036, 0x1037}, {0x1039, 0x1039}, {0x1058, 0x1059}, + {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753}, {0x1772, 0x1773}, + {0x17b7, 0x17bd}, {0x17c6, 0x17c6}, {0x17c9, 0x17d3}, {0x17dd, 0x17dd}, + {0x180b, 0x180d}, {0x18a9, 0x18a9}, {0x1920, 0x1922}, {0x1927, 0x1928}, + {0x1932, 0x1932}, {0x1939, 0x193b}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, + {0x20e5, 0x20ea}, {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, {0xfe00, 0xfe0f}, {0xfe20, 0xfe23} }; -static xmlChLRange xmlMnL[] = {{0x1d167, 0x1d169}, {0x1d17b, 0x1d182}, +static xmlChLRange xmlMnL[] = {{0x1d167, 0x1d169}, {0x1d17b, 0x1d182}, {0x1d185, 0x1d18b}, {0x1d1aa, 0x1d1ad}, {0xe0100, 0xe01ef} }; static xmlChRangeGroup xmlMnG = {108,5,xmlMnS,xmlMnL}; -static xmlChSRange xmlNS[] = {{0x30, 0x39}, {0xb2, 0xb3}, {0xb9, 0xb9}, - {0xbc, 0xbe}, {0x660, 0x669}, {0x6f0, 0x6f9}, {0x966, 0x96f}, - {0x9e6, 0x9ef}, {0x9f4, 0x9f9}, {0xa66, 0xa6f}, {0xae6, 0xaef}, - {0xb66, 0xb6f}, {0xbe7, 0xbf2}, {0xc66, 0xc6f}, {0xce6, 0xcef}, - {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, {0xf20, 0xf33}, - {0x1040, 0x1049}, {0x1369, 0x137c}, {0x16ee, 0x16f0}, {0x17e0, 0x17e9}, - {0x17f0, 0x17f9}, {0x1810, 0x1819}, {0x1946, 0x194f}, {0x2070, 0x2070}, - {0x2074, 0x2079}, {0x2080, 0x2089}, {0x2153, 0x2183}, {0x2460, 0x249b}, - {0x24ea, 0x24ff}, {0x2776, 0x2793}, {0x3007, 0x3007}, {0x3021, 0x3029}, - {0x3038, 0x303a}, {0x3192, 0x3195}, {0x3220, 0x3229}, {0x3251, 0x325f}, +static xmlChSRange xmlNS[] = {{0x30, 0x39}, {0xb2, 0xb3}, {0xb9, 0xb9}, + {0xbc, 0xbe}, {0x660, 0x669}, {0x6f0, 0x6f9}, {0x966, 0x96f}, + {0x9e6, 0x9ef}, {0x9f4, 0x9f9}, {0xa66, 0xa6f}, {0xae6, 0xaef}, + {0xb66, 0xb6f}, {0xbe7, 0xbf2}, {0xc66, 0xc6f}, {0xce6, 0xcef}, + {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, {0xf20, 0xf33}, + {0x1040, 0x1049}, {0x1369, 0x137c}, {0x16ee, 0x16f0}, {0x17e0, 0x17e9}, + {0x17f0, 0x17f9}, {0x1810, 0x1819}, {0x1946, 0x194f}, {0x2070, 0x2070}, + {0x2074, 0x2079}, {0x2080, 0x2089}, {0x2153, 0x2183}, {0x2460, 0x249b}, + {0x24ea, 0x24ff}, {0x2776, 0x2793}, {0x3007, 0x3007}, {0x3021, 0x3029}, + {0x3038, 0x303a}, {0x3192, 0x3195}, {0x3220, 0x3229}, {0x3251, 0x325f}, {0x3280, 0x3289}, {0x32b1, 0x32bf}, {0xff10, 0xff19} }; -static xmlChLRange xmlNL[] = {{0x10107, 0x10133}, {0x10320, 0x10323}, +static xmlChLRange xmlNL[] = {{0x10107, 0x10133}, {0x10320, 0x10323}, {0x1034a, 0x1034a}, {0x104a0, 0x104a9}, {0x1d7ce, 0x1d7ff} }; static xmlChRangeGroup xmlNG = {42,5,xmlNS,xmlNL}; -static xmlChSRange xmlNdS[] = {{0x30, 0x39}, {0x660, 0x669}, - {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, - {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, - {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, - {0xf20, 0xf29}, {0x1040, 0x1049}, {0x1369, 0x1371}, {0x17e0, 0x17e9}, +static xmlChSRange xmlNdS[] = {{0x30, 0x39}, {0x660, 0x669}, + {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, + {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, + {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, + {0xf20, 0xf29}, {0x1040, 0x1049}, {0x1369, 0x1371}, {0x17e0, 0x17e9}, {0x1810, 0x1819}, {0x1946, 0x194f}, {0xff10, 0xff19} }; static xmlChLRange xmlNdL[] = {{0x104a0, 0x104a9}, {0x1d7ce, 0x1d7ff} }; static xmlChRangeGroup xmlNdG = {21,2,xmlNdS,xmlNdL}; -static xmlChSRange xmlNoS[] = {{0xb2, 0xb3}, {0xb9, 0xb9}, {0xbc, 0xbe}, - {0x9f4, 0x9f9}, {0xbf0, 0xbf2}, {0xf2a, 0xf33}, {0x1372, 0x137c}, - {0x17f0, 0x17f9}, {0x2070, 0x2070}, {0x2074, 0x2079}, {0x2080, 0x2089}, - {0x2153, 0x215f}, {0x2460, 0x249b}, {0x24ea, 0x24ff}, {0x2776, 0x2793}, - {0x3192, 0x3195}, {0x3220, 0x3229}, {0x3251, 0x325f}, {0x3280, 0x3289}, +static xmlChSRange xmlNoS[] = {{0xb2, 0xb3}, {0xb9, 0xb9}, {0xbc, 0xbe}, + {0x9f4, 0x9f9}, {0xbf0, 0xbf2}, {0xf2a, 0xf33}, {0x1372, 0x137c}, + {0x17f0, 0x17f9}, {0x2070, 0x2070}, {0x2074, 0x2079}, {0x2080, 0x2089}, + {0x2153, 0x215f}, {0x2460, 0x249b}, {0x24ea, 0x24ff}, {0x2776, 0x2793}, + {0x3192, 0x3195}, {0x3220, 0x3229}, {0x3251, 0x325f}, {0x3280, 0x3289}, {0x32b1, 0x32bf} }; static xmlChLRange xmlNoL[] = {{0x10107, 0x10133}, {0x10320, 0x10323} }; static xmlChRangeGroup xmlNoG = {20,2,xmlNoS,xmlNoL}; -static xmlChSRange xmlPS[] = {{0x21, 0x23}, {0x25, 0x2a}, {0x2c, 0x2f}, - {0x3a, 0x3b}, {0x3f, 0x40}, {0x5b, 0x5d}, {0x5f, 0x5f}, {0x7b, 0x7b}, - {0x7d, 0x7d}, {0xa1, 0xa1}, {0xab, 0xab}, {0xb7, 0xb7}, {0xbb, 0xbb}, - {0xbf, 0xbf}, {0x37e, 0x37e}, {0x387, 0x387}, {0x55a, 0x55f}, - {0x589, 0x58a}, {0x5be, 0x5be}, {0x5c0, 0x5c0}, {0x5c3, 0x5c3}, - {0x5f3, 0x5f4}, {0x60c, 0x60d}, {0x61b, 0x61b}, {0x61f, 0x61f}, - {0x66a, 0x66d}, {0x6d4, 0x6d4}, {0x700, 0x70d}, {0x964, 0x965}, - {0x970, 0x970}, {0xdf4, 0xdf4}, {0xe4f, 0xe4f}, {0xe5a, 0xe5b}, - {0xf04, 0xf12}, {0xf3a, 0xf3d}, {0xf85, 0xf85}, {0x104a, 0x104f}, - {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, {0x169b, 0x169c}, - {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, {0x17d8, 0x17da}, - {0x1800, 0x180a}, {0x1944, 0x1945}, {0x2010, 0x2027}, {0x2030, 0x2043}, - {0x2045, 0x2051}, {0x2053, 0x2054}, {0x2057, 0x2057}, {0x207d, 0x207e}, - {0x208d, 0x208e}, {0x2329, 0x232a}, {0x23b4, 0x23b6}, {0x2768, 0x2775}, - {0x27e6, 0x27eb}, {0x2983, 0x2998}, {0x29d8, 0x29db}, {0x29fc, 0x29fd}, - {0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, {0x3030, 0x3030}, - {0x303d, 0x303d}, {0x30a0, 0x30a0}, {0x30fb, 0x30fb}, {0xfd3e, 0xfd3f}, - {0xfe30, 0xfe52}, {0xfe54, 0xfe61}, {0xfe63, 0xfe63}, {0xfe68, 0xfe68}, - {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff0a}, {0xff0c, 0xff0f}, - {0xff1a, 0xff1b}, {0xff1f, 0xff20}, {0xff3b, 0xff3d}, {0xff3f, 0xff3f}, +static xmlChSRange xmlPS[] = {{0x21, 0x23}, {0x25, 0x2a}, {0x2c, 0x2f}, + {0x3a, 0x3b}, {0x3f, 0x40}, {0x5b, 0x5d}, {0x5f, 0x5f}, {0x7b, 0x7b}, + {0x7d, 0x7d}, {0xa1, 0xa1}, {0xab, 0xab}, {0xb7, 0xb7}, {0xbb, 0xbb}, + {0xbf, 0xbf}, {0x37e, 0x37e}, {0x387, 0x387}, {0x55a, 0x55f}, + {0x589, 0x58a}, {0x5be, 0x5be}, {0x5c0, 0x5c0}, {0x5c3, 0x5c3}, + {0x5f3, 0x5f4}, {0x60c, 0x60d}, {0x61b, 0x61b}, {0x61f, 0x61f}, + {0x66a, 0x66d}, {0x6d4, 0x6d4}, {0x700, 0x70d}, {0x964, 0x965}, + {0x970, 0x970}, {0xdf4, 0xdf4}, {0xe4f, 0xe4f}, {0xe5a, 0xe5b}, + {0xf04, 0xf12}, {0xf3a, 0xf3d}, {0xf85, 0xf85}, {0x104a, 0x104f}, + {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, {0x169b, 0x169c}, + {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, {0x17d8, 0x17da}, + {0x1800, 0x180a}, {0x1944, 0x1945}, {0x2010, 0x2027}, {0x2030, 0x2043}, + {0x2045, 0x2051}, {0x2053, 0x2054}, {0x2057, 0x2057}, {0x207d, 0x207e}, + {0x208d, 0x208e}, {0x2329, 0x232a}, {0x23b4, 0x23b6}, {0x2768, 0x2775}, + {0x27e6, 0x27eb}, {0x2983, 0x2998}, {0x29d8, 0x29db}, {0x29fc, 0x29fd}, + {0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, {0x3030, 0x3030}, + {0x303d, 0x303d}, {0x30a0, 0x30a0}, {0x30fb, 0x30fb}, {0xfd3e, 0xfd3f}, + {0xfe30, 0xfe52}, {0xfe54, 0xfe61}, {0xfe63, 0xfe63}, {0xfe68, 0xfe68}, + {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff0a}, {0xff0c, 0xff0f}, + {0xff1a, 0xff1b}, {0xff1f, 0xff20}, {0xff3b, 0xff3d}, {0xff3f, 0xff3f}, {0xff5b, 0xff5b}, {0xff5d, 0xff5d}, {0xff5f, 0xff65} }; static xmlChLRange xmlPL[] = {{0x10100, 0x10101}, {0x1039f, 0x1039f} }; static xmlChRangeGroup xmlPG = {84,2,xmlPS,xmlPL}; -static xmlChSRange xmlPdS[] = {{0x2d, 0x2d}, {0x58a, 0x58a}, - {0x1806, 0x1806}, {0x2010, 0x2015}, {0x301c, 0x301c}, {0x3030, 0x3030}, - {0x30a0, 0x30a0}, {0xfe31, 0xfe32}, {0xfe58, 0xfe58}, {0xfe63, 0xfe63}, +static xmlChSRange xmlPdS[] = {{0x2d, 0x2d}, {0x58a, 0x58a}, + {0x1806, 0x1806}, {0x2010, 0x2015}, {0x301c, 0x301c}, {0x3030, 0x3030}, + {0x30a0, 0x30a0}, {0xfe31, 0xfe32}, {0xfe58, 0xfe58}, {0xfe63, 0xfe63}, {0xff0d, 0xff0d} }; static xmlChRangeGroup xmlPdG = {11,0,xmlPdS,NULL}; -static xmlChSRange xmlPeS[] = {{0x29, 0x29}, {0x5d, 0x5d}, {0x7d, 0x7d}, - {0xf3b, 0xf3b}, {0xf3d, 0xf3d}, {0x169c, 0x169c}, {0x2046, 0x2046}, - {0x207e, 0x207e}, {0x208e, 0x208e}, {0x232a, 0x232a}, {0x23b5, 0x23b5}, - {0x2769, 0x2769}, {0x276b, 0x276b}, {0x276d, 0x276d}, {0x276f, 0x276f}, - {0x2771, 0x2771}, {0x2773, 0x2773}, {0x2775, 0x2775}, {0x27e7, 0x27e7}, - {0x27e9, 0x27e9}, {0x27eb, 0x27eb}, {0x2984, 0x2984}, {0x2986, 0x2986}, - {0x2988, 0x2988}, {0x298a, 0x298a}, {0x298c, 0x298c}, {0x298e, 0x298e}, - {0x2990, 0x2990}, {0x2992, 0x2992}, {0x2994, 0x2994}, {0x2996, 0x2996}, - {0x2998, 0x2998}, {0x29d9, 0x29d9}, {0x29db, 0x29db}, {0x29fd, 0x29fd}, - {0x3009, 0x3009}, {0x300b, 0x300b}, {0x300d, 0x300d}, {0x300f, 0x300f}, - {0x3011, 0x3011}, {0x3015, 0x3015}, {0x3017, 0x3017}, {0x3019, 0x3019}, - {0x301b, 0x301b}, {0x301e, 0x301f}, {0xfd3f, 0xfd3f}, {0xfe36, 0xfe36}, - {0xfe38, 0xfe38}, {0xfe3a, 0xfe3a}, {0xfe3c, 0xfe3c}, {0xfe3e, 0xfe3e}, - {0xfe40, 0xfe40}, {0xfe42, 0xfe42}, {0xfe44, 0xfe44}, {0xfe48, 0xfe48}, - {0xfe5a, 0xfe5a}, {0xfe5c, 0xfe5c}, {0xfe5e, 0xfe5e}, {0xff09, 0xff09}, +static xmlChSRange xmlPeS[] = {{0x29, 0x29}, {0x5d, 0x5d}, {0x7d, 0x7d}, + {0xf3b, 0xf3b}, {0xf3d, 0xf3d}, {0x169c, 0x169c}, {0x2046, 0x2046}, + {0x207e, 0x207e}, {0x208e, 0x208e}, {0x232a, 0x232a}, {0x23b5, 0x23b5}, + {0x2769, 0x2769}, {0x276b, 0x276b}, {0x276d, 0x276d}, {0x276f, 0x276f}, + {0x2771, 0x2771}, {0x2773, 0x2773}, {0x2775, 0x2775}, {0x27e7, 0x27e7}, + {0x27e9, 0x27e9}, {0x27eb, 0x27eb}, {0x2984, 0x2984}, {0x2986, 0x2986}, + {0x2988, 0x2988}, {0x298a, 0x298a}, {0x298c, 0x298c}, {0x298e, 0x298e}, + {0x2990, 0x2990}, {0x2992, 0x2992}, {0x2994, 0x2994}, {0x2996, 0x2996}, + {0x2998, 0x2998}, {0x29d9, 0x29d9}, {0x29db, 0x29db}, {0x29fd, 0x29fd}, + {0x3009, 0x3009}, {0x300b, 0x300b}, {0x300d, 0x300d}, {0x300f, 0x300f}, + {0x3011, 0x3011}, {0x3015, 0x3015}, {0x3017, 0x3017}, {0x3019, 0x3019}, + {0x301b, 0x301b}, {0x301e, 0x301f}, {0xfd3f, 0xfd3f}, {0xfe36, 0xfe36}, + {0xfe38, 0xfe38}, {0xfe3a, 0xfe3a}, {0xfe3c, 0xfe3c}, {0xfe3e, 0xfe3e}, + {0xfe40, 0xfe40}, {0xfe42, 0xfe42}, {0xfe44, 0xfe44}, {0xfe48, 0xfe48}, + {0xfe5a, 0xfe5a}, {0xfe5c, 0xfe5c}, {0xfe5e, 0xfe5e}, {0xff09, 0xff09}, {0xff3d, 0xff3d}, {0xff5d, 0xff5d}, {0xff60, 0xff60}, {0xff63, 0xff63} }; static xmlChRangeGroup xmlPeG = {63,0,xmlPeS,NULL}; -static xmlChSRange xmlPoS[] = {{0x21, 0x23}, {0x25, 0x27}, {0x2a, 0x2a}, - {0x2c, 0x2c}, {0x2e, 0x2f}, {0x3a, 0x3b}, {0x3f, 0x40}, {0x5c, 0x5c}, - {0xa1, 0xa1}, {0xb7, 0xb7}, {0xbf, 0xbf}, {0x37e, 0x37e}, - {0x387, 0x387}, {0x55a, 0x55f}, {0x589, 0x589}, {0x5be, 0x5be}, - {0x5c0, 0x5c0}, {0x5c3, 0x5c3}, {0x5f3, 0x5f4}, {0x60c, 0x60d}, - {0x61b, 0x61b}, {0x61f, 0x61f}, {0x66a, 0x66d}, {0x6d4, 0x6d4}, - {0x700, 0x70d}, {0x964, 0x965}, {0x970, 0x970}, {0xdf4, 0xdf4}, - {0xe4f, 0xe4f}, {0xe5a, 0xe5b}, {0xf04, 0xf12}, {0xf85, 0xf85}, - {0x104a, 0x104f}, {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, - {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, {0x17d8, 0x17da}, - {0x1800, 0x1805}, {0x1807, 0x180a}, {0x1944, 0x1945}, {0x2016, 0x2017}, - {0x2020, 0x2027}, {0x2030, 0x2038}, {0x203b, 0x203e}, {0x2041, 0x2043}, - {0x2047, 0x2051}, {0x2053, 0x2053}, {0x2057, 0x2057}, {0x23b6, 0x23b6}, - {0x3001, 0x3003}, {0x303d, 0x303d}, {0xfe30, 0xfe30}, {0xfe45, 0xfe46}, - {0xfe49, 0xfe4c}, {0xfe50, 0xfe52}, {0xfe54, 0xfe57}, {0xfe5f, 0xfe61}, - {0xfe68, 0xfe68}, {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff07}, - {0xff0a, 0xff0a}, {0xff0c, 0xff0c}, {0xff0e, 0xff0f}, {0xff1a, 0xff1b}, +static xmlChSRange xmlPoS[] = {{0x21, 0x23}, {0x25, 0x27}, {0x2a, 0x2a}, + {0x2c, 0x2c}, {0x2e, 0x2f}, {0x3a, 0x3b}, {0x3f, 0x40}, {0x5c, 0x5c}, + {0xa1, 0xa1}, {0xb7, 0xb7}, {0xbf, 0xbf}, {0x37e, 0x37e}, + {0x387, 0x387}, {0x55a, 0x55f}, {0x589, 0x589}, {0x5be, 0x5be}, + {0x5c0, 0x5c0}, {0x5c3, 0x5c3}, {0x5f3, 0x5f4}, {0x60c, 0x60d}, + {0x61b, 0x61b}, {0x61f, 0x61f}, {0x66a, 0x66d}, {0x6d4, 0x6d4}, + {0x700, 0x70d}, {0x964, 0x965}, {0x970, 0x970}, {0xdf4, 0xdf4}, + {0xe4f, 0xe4f}, {0xe5a, 0xe5b}, {0xf04, 0xf12}, {0xf85, 0xf85}, + {0x104a, 0x104f}, {0x10fb, 0x10fb}, {0x1361, 0x1368}, {0x166d, 0x166e}, + {0x16eb, 0x16ed}, {0x1735, 0x1736}, {0x17d4, 0x17d6}, {0x17d8, 0x17da}, + {0x1800, 0x1805}, {0x1807, 0x180a}, {0x1944, 0x1945}, {0x2016, 0x2017}, + {0x2020, 0x2027}, {0x2030, 0x2038}, {0x203b, 0x203e}, {0x2041, 0x2043}, + {0x2047, 0x2051}, {0x2053, 0x2053}, {0x2057, 0x2057}, {0x23b6, 0x23b6}, + {0x3001, 0x3003}, {0x303d, 0x303d}, {0xfe30, 0xfe30}, {0xfe45, 0xfe46}, + {0xfe49, 0xfe4c}, {0xfe50, 0xfe52}, {0xfe54, 0xfe57}, {0xfe5f, 0xfe61}, + {0xfe68, 0xfe68}, {0xfe6a, 0xfe6b}, {0xff01, 0xff03}, {0xff05, 0xff07}, + {0xff0a, 0xff0a}, {0xff0c, 0xff0c}, {0xff0e, 0xff0f}, {0xff1a, 0xff1b}, {0xff1f, 0xff20}, {0xff3c, 0xff3c}, {0xff61, 0xff61}, {0xff64, 0xff64} }; static xmlChLRange xmlPoL[] = {{0x10100, 0x10101}, {0x1039f, 0x1039f} }; static xmlChRangeGroup xmlPoG = {72,2,xmlPoS,xmlPoL}; -static xmlChSRange xmlPsS[] = {{0x28, 0x28}, {0x5b, 0x5b}, {0x7b, 0x7b}, - {0xf3a, 0xf3a}, {0xf3c, 0xf3c}, {0x169b, 0x169b}, {0x201a, 0x201a}, - {0x201e, 0x201e}, {0x2045, 0x2045}, {0x207d, 0x207d}, {0x208d, 0x208d}, - {0x2329, 0x2329}, {0x23b4, 0x23b4}, {0x2768, 0x2768}, {0x276a, 0x276a}, - {0x276c, 0x276c}, {0x276e, 0x276e}, {0x2770, 0x2770}, {0x2772, 0x2772}, - {0x2774, 0x2774}, {0x27e6, 0x27e6}, {0x27e8, 0x27e8}, {0x27ea, 0x27ea}, - {0x2983, 0x2983}, {0x2985, 0x2985}, {0x2987, 0x2987}, {0x2989, 0x2989}, - {0x298b, 0x298b}, {0x298d, 0x298d}, {0x298f, 0x298f}, {0x2991, 0x2991}, - {0x2993, 0x2993}, {0x2995, 0x2995}, {0x2997, 0x2997}, {0x29d8, 0x29d8}, - {0x29da, 0x29da}, {0x29fc, 0x29fc}, {0x3008, 0x3008}, {0x300a, 0x300a}, - {0x300c, 0x300c}, {0x300e, 0x300e}, {0x3010, 0x3010}, {0x3014, 0x3014}, - {0x3016, 0x3016}, {0x3018, 0x3018}, {0x301a, 0x301a}, {0x301d, 0x301d}, - {0xfd3e, 0xfd3e}, {0xfe35, 0xfe35}, {0xfe37, 0xfe37}, {0xfe39, 0xfe39}, - {0xfe3b, 0xfe3b}, {0xfe3d, 0xfe3d}, {0xfe3f, 0xfe3f}, {0xfe41, 0xfe41}, - {0xfe43, 0xfe43}, {0xfe47, 0xfe47}, {0xfe59, 0xfe59}, {0xfe5b, 0xfe5b}, - {0xfe5d, 0xfe5d}, {0xff08, 0xff08}, {0xff3b, 0xff3b}, {0xff5b, 0xff5b}, +static xmlChSRange xmlPsS[] = {{0x28, 0x28}, {0x5b, 0x5b}, {0x7b, 0x7b}, + {0xf3a, 0xf3a}, {0xf3c, 0xf3c}, {0x169b, 0x169b}, {0x201a, 0x201a}, + {0x201e, 0x201e}, {0x2045, 0x2045}, {0x207d, 0x207d}, {0x208d, 0x208d}, + {0x2329, 0x2329}, {0x23b4, 0x23b4}, {0x2768, 0x2768}, {0x276a, 0x276a}, + {0x276c, 0x276c}, {0x276e, 0x276e}, {0x2770, 0x2770}, {0x2772, 0x2772}, + {0x2774, 0x2774}, {0x27e6, 0x27e6}, {0x27e8, 0x27e8}, {0x27ea, 0x27ea}, + {0x2983, 0x2983}, {0x2985, 0x2985}, {0x2987, 0x2987}, {0x2989, 0x2989}, + {0x298b, 0x298b}, {0x298d, 0x298d}, {0x298f, 0x298f}, {0x2991, 0x2991}, + {0x2993, 0x2993}, {0x2995, 0x2995}, {0x2997, 0x2997}, {0x29d8, 0x29d8}, + {0x29da, 0x29da}, {0x29fc, 0x29fc}, {0x3008, 0x3008}, {0x300a, 0x300a}, + {0x300c, 0x300c}, {0x300e, 0x300e}, {0x3010, 0x3010}, {0x3014, 0x3014}, + {0x3016, 0x3016}, {0x3018, 0x3018}, {0x301a, 0x301a}, {0x301d, 0x301d}, + {0xfd3e, 0xfd3e}, {0xfe35, 0xfe35}, {0xfe37, 0xfe37}, {0xfe39, 0xfe39}, + {0xfe3b, 0xfe3b}, {0xfe3d, 0xfe3d}, {0xfe3f, 0xfe3f}, {0xfe41, 0xfe41}, + {0xfe43, 0xfe43}, {0xfe47, 0xfe47}, {0xfe59, 0xfe59}, {0xfe5b, 0xfe5b}, + {0xfe5d, 0xfe5d}, {0xff08, 0xff08}, {0xff3b, 0xff3b}, {0xff5b, 0xff5b}, {0xff5f, 0xff5f}, {0xff62, 0xff62} }; static xmlChRangeGroup xmlPsG = {65,0,xmlPsS,NULL}; -static xmlChSRange xmlSS[] = {{0x24, 0x24}, {0x2b, 0x2b}, {0x3c, 0x3e}, - {0x5e, 0x5e}, {0x60, 0x60}, {0x7c, 0x7c}, {0x7e, 0x7e}, {0xa2, 0xa9}, - {0xac, 0xac}, {0xae, 0xb1}, {0xb4, 0xb4}, {0xb6, 0xb6}, {0xb8, 0xb8}, - {0xd7, 0xd7}, {0xf7, 0xf7}, {0x2c2, 0x2c5}, {0x2d2, 0x2df}, - {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, {0x384, 0x385}, - {0x3f6, 0x3f6}, {0x482, 0x482}, {0x60e, 0x60f}, {0x6e9, 0x6e9}, - {0x6fd, 0x6fe}, {0x9f2, 0x9f3}, {0x9fa, 0x9fa}, {0xaf1, 0xaf1}, - {0xb70, 0xb70}, {0xbf3, 0xbfa}, {0xe3f, 0xe3f}, {0xf01, 0xf03}, - {0xf13, 0xf17}, {0xf1a, 0xf1f}, {0xf34, 0xf34}, {0xf36, 0xf36}, - {0xf38, 0xf38}, {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, {0xfcf, 0xfcf}, - {0x17db, 0x17db}, {0x1940, 0x1940}, {0x19e0, 0x19ff}, {0x1fbd, 0x1fbd}, - {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, {0x1fdd, 0x1fdf}, {0x1fed, 0x1fef}, - {0x1ffd, 0x1ffe}, {0x2044, 0x2044}, {0x2052, 0x2052}, {0x207a, 0x207c}, - {0x208a, 0x208c}, {0x20a0, 0x20b1}, {0x2100, 0x2101}, {0x2103, 0x2106}, - {0x2108, 0x2109}, {0x2114, 0x2114}, {0x2116, 0x2118}, {0x211e, 0x2123}, - {0x2125, 0x2125}, {0x2127, 0x2127}, {0x2129, 0x2129}, {0x212e, 0x212e}, - {0x2132, 0x2132}, {0x213a, 0x213b}, {0x2140, 0x2144}, {0x214a, 0x214b}, - {0x2190, 0x2328}, {0x232b, 0x23b3}, {0x23b7, 0x23d0}, {0x2400, 0x2426}, - {0x2440, 0x244a}, {0x249c, 0x24e9}, {0x2500, 0x2617}, {0x2619, 0x267d}, - {0x2680, 0x2691}, {0x26a0, 0x26a1}, {0x2701, 0x2704}, {0x2706, 0x2709}, - {0x270c, 0x2727}, {0x2729, 0x274b}, {0x274d, 0x274d}, {0x274f, 0x2752}, - {0x2756, 0x2756}, {0x2758, 0x275e}, {0x2761, 0x2767}, {0x2794, 0x2794}, - {0x2798, 0x27af}, {0x27b1, 0x27be}, {0x27d0, 0x27e5}, {0x27f0, 0x2982}, - {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2b0d}, {0x2e80, 0x2e99}, - {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, {0x3004, 0x3004}, - {0x3012, 0x3013}, {0x3020, 0x3020}, {0x3036, 0x3037}, {0x303e, 0x303f}, - {0x309b, 0x309c}, {0x3190, 0x3191}, {0x3196, 0x319f}, {0x3200, 0x321e}, - {0x322a, 0x3243}, {0x3250, 0x3250}, {0x3260, 0x327d}, {0x327f, 0x327f}, - {0x328a, 0x32b0}, {0x32c0, 0x32fe}, {0x3300, 0x33ff}, {0x4dc0, 0x4dff}, - {0xa490, 0xa4c6}, {0xfb29, 0xfb29}, {0xfdfc, 0xfdfd}, {0xfe62, 0xfe62}, - {0xfe64, 0xfe66}, {0xfe69, 0xfe69}, {0xff04, 0xff04}, {0xff0b, 0xff0b}, - {0xff1c, 0xff1e}, {0xff3e, 0xff3e}, {0xff40, 0xff40}, {0xff5c, 0xff5c}, +static xmlChSRange xmlSS[] = {{0x24, 0x24}, {0x2b, 0x2b}, {0x3c, 0x3e}, + {0x5e, 0x5e}, {0x60, 0x60}, {0x7c, 0x7c}, {0x7e, 0x7e}, {0xa2, 0xa9}, + {0xac, 0xac}, {0xae, 0xb1}, {0xb4, 0xb4}, {0xb6, 0xb6}, {0xb8, 0xb8}, + {0xd7, 0xd7}, {0xf7, 0xf7}, {0x2c2, 0x2c5}, {0x2d2, 0x2df}, + {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, {0x384, 0x385}, + {0x3f6, 0x3f6}, {0x482, 0x482}, {0x60e, 0x60f}, {0x6e9, 0x6e9}, + {0x6fd, 0x6fe}, {0x9f2, 0x9f3}, {0x9fa, 0x9fa}, {0xaf1, 0xaf1}, + {0xb70, 0xb70}, {0xbf3, 0xbfa}, {0xe3f, 0xe3f}, {0xf01, 0xf03}, + {0xf13, 0xf17}, {0xf1a, 0xf1f}, {0xf34, 0xf34}, {0xf36, 0xf36}, + {0xf38, 0xf38}, {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, {0xfcf, 0xfcf}, + {0x17db, 0x17db}, {0x1940, 0x1940}, {0x19e0, 0x19ff}, {0x1fbd, 0x1fbd}, + {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, {0x1fdd, 0x1fdf}, {0x1fed, 0x1fef}, + {0x1ffd, 0x1ffe}, {0x2044, 0x2044}, {0x2052, 0x2052}, {0x207a, 0x207c}, + {0x208a, 0x208c}, {0x20a0, 0x20b1}, {0x2100, 0x2101}, {0x2103, 0x2106}, + {0x2108, 0x2109}, {0x2114, 0x2114}, {0x2116, 0x2118}, {0x211e, 0x2123}, + {0x2125, 0x2125}, {0x2127, 0x2127}, {0x2129, 0x2129}, {0x212e, 0x212e}, + {0x2132, 0x2132}, {0x213a, 0x213b}, {0x2140, 0x2144}, {0x214a, 0x214b}, + {0x2190, 0x2328}, {0x232b, 0x23b3}, {0x23b7, 0x23d0}, {0x2400, 0x2426}, + {0x2440, 0x244a}, {0x249c, 0x24e9}, {0x2500, 0x2617}, {0x2619, 0x267d}, + {0x2680, 0x2691}, {0x26a0, 0x26a1}, {0x2701, 0x2704}, {0x2706, 0x2709}, + {0x270c, 0x2727}, {0x2729, 0x274b}, {0x274d, 0x274d}, {0x274f, 0x2752}, + {0x2756, 0x2756}, {0x2758, 0x275e}, {0x2761, 0x2767}, {0x2794, 0x2794}, + {0x2798, 0x27af}, {0x27b1, 0x27be}, {0x27d0, 0x27e5}, {0x27f0, 0x2982}, + {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2b0d}, {0x2e80, 0x2e99}, + {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, {0x3004, 0x3004}, + {0x3012, 0x3013}, {0x3020, 0x3020}, {0x3036, 0x3037}, {0x303e, 0x303f}, + {0x309b, 0x309c}, {0x3190, 0x3191}, {0x3196, 0x319f}, {0x3200, 0x321e}, + {0x322a, 0x3243}, {0x3250, 0x3250}, {0x3260, 0x327d}, {0x327f, 0x327f}, + {0x328a, 0x32b0}, {0x32c0, 0x32fe}, {0x3300, 0x33ff}, {0x4dc0, 0x4dff}, + {0xa490, 0xa4c6}, {0xfb29, 0xfb29}, {0xfdfc, 0xfdfd}, {0xfe62, 0xfe62}, + {0xfe64, 0xfe66}, {0xfe69, 0xfe69}, {0xff04, 0xff04}, {0xff0b, 0xff0b}, + {0xff1c, 0xff1e}, {0xff3e, 0xff3e}, {0xff40, 0xff40}, {0xff5c, 0xff5c}, {0xff5e, 0xff5e}, {0xffe0, 0xffe6}, {0xffe8, 0xffee}, {0xfffc, 0xfffd} }; -static xmlChLRange xmlSL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, - {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, - {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, - {0x1d1ae, 0x1d1dd}, {0x1d300, 0x1d356}, {0x1d6c1, 0x1d6c1}, - {0x1d6db, 0x1d6db}, {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, - {0x1d735, 0x1d735}, {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, +static xmlChLRange xmlSL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, + {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, + {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, + {0x1d1ae, 0x1d1dd}, {0x1d300, 0x1d356}, {0x1d6c1, 0x1d6c1}, + {0x1d6db, 0x1d6db}, {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, + {0x1d735, 0x1d735}, {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, {0x1d789, 0x1d789}, {0x1d7a9, 0x1d7a9}, {0x1d7c3, 0x1d7c3} }; static xmlChRangeGroup xmlSG = {133,20,xmlSS,xmlSL}; -static xmlChSRange xmlScS[] = {{0x24, 0x24}, {0xa2, 0xa5}, {0x9f2, 0x9f3}, - {0xaf1, 0xaf1}, {0xbf9, 0xbf9}, {0xe3f, 0xe3f}, {0x17db, 0x17db}, - {0x20a0, 0x20b1}, {0xfdfc, 0xfdfc}, {0xfe69, 0xfe69}, {0xff04, 0xff04}, +static xmlChSRange xmlScS[] = {{0x24, 0x24}, {0xa2, 0xa5}, {0x9f2, 0x9f3}, + {0xaf1, 0xaf1}, {0xbf9, 0xbf9}, {0xe3f, 0xe3f}, {0x17db, 0x17db}, + {0x20a0, 0x20b1}, {0xfdfc, 0xfdfc}, {0xfe69, 0xfe69}, {0xff04, 0xff04}, {0xffe0, 0xffe1}, {0xffe5, 0xffe6} }; static xmlChRangeGroup xmlScG = {13,0,xmlScS,NULL}; -static xmlChSRange xmlSkS[] = {{0x5e, 0x5e}, {0x60, 0x60}, {0xa8, 0xa8}, - {0xaf, 0xaf}, {0xb4, 0xb4}, {0xb8, 0xb8}, {0x2c2, 0x2c5}, - {0x2d2, 0x2df}, {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, - {0x384, 0x385}, {0x1fbd, 0x1fbd}, {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, - {0x1fdd, 0x1fdf}, {0x1fed, 0x1fef}, {0x1ffd, 0x1ffe}, {0x309b, 0x309c}, +static xmlChSRange xmlSkS[] = {{0x5e, 0x5e}, {0x60, 0x60}, {0xa8, 0xa8}, + {0xaf, 0xaf}, {0xb4, 0xb4}, {0xb8, 0xb8}, {0x2c2, 0x2c5}, + {0x2d2, 0x2df}, {0x2e5, 0x2ed}, {0x2ef, 0x2ff}, {0x374, 0x375}, + {0x384, 0x385}, {0x1fbd, 0x1fbd}, {0x1fbf, 0x1fc1}, {0x1fcd, 0x1fcf}, + {0x1fdd, 0x1fdf}, {0x1fed, 0x1fef}, {0x1ffd, 0x1ffe}, {0x309b, 0x309c}, {0xff3e, 0xff3e}, {0xff40, 0xff40}, {0xffe3, 0xffe3} }; static xmlChRangeGroup xmlSkG = {22,0,xmlSkS,NULL}; -static xmlChSRange xmlSmS[] = {{0x2b, 0x2b}, {0x3c, 0x3e}, {0x7c, 0x7c}, - {0x7e, 0x7e}, {0xac, 0xac}, {0xb1, 0xb1}, {0xd7, 0xd7}, {0xf7, 0xf7}, - {0x3f6, 0x3f6}, {0x2044, 0x2044}, {0x2052, 0x2052}, {0x207a, 0x207c}, - {0x208a, 0x208c}, {0x2140, 0x2144}, {0x214b, 0x214b}, {0x2190, 0x2194}, - {0x219a, 0x219b}, {0x21a0, 0x21a0}, {0x21a3, 0x21a3}, {0x21a6, 0x21a6}, - {0x21ae, 0x21ae}, {0x21ce, 0x21cf}, {0x21d2, 0x21d2}, {0x21d4, 0x21d4}, - {0x21f4, 0x22ff}, {0x2308, 0x230b}, {0x2320, 0x2321}, {0x237c, 0x237c}, - {0x239b, 0x23b3}, {0x25b7, 0x25b7}, {0x25c1, 0x25c1}, {0x25f8, 0x25ff}, - {0x266f, 0x266f}, {0x27d0, 0x27e5}, {0x27f0, 0x27ff}, {0x2900, 0x2982}, - {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2aff}, {0xfb29, 0xfb29}, - {0xfe62, 0xfe62}, {0xfe64, 0xfe66}, {0xff0b, 0xff0b}, {0xff1c, 0xff1e}, +static xmlChSRange xmlSmS[] = {{0x2b, 0x2b}, {0x3c, 0x3e}, {0x7c, 0x7c}, + {0x7e, 0x7e}, {0xac, 0xac}, {0xb1, 0xb1}, {0xd7, 0xd7}, {0xf7, 0xf7}, + {0x3f6, 0x3f6}, {0x2044, 0x2044}, {0x2052, 0x2052}, {0x207a, 0x207c}, + {0x208a, 0x208c}, {0x2140, 0x2144}, {0x214b, 0x214b}, {0x2190, 0x2194}, + {0x219a, 0x219b}, {0x21a0, 0x21a0}, {0x21a3, 0x21a3}, {0x21a6, 0x21a6}, + {0x21ae, 0x21ae}, {0x21ce, 0x21cf}, {0x21d2, 0x21d2}, {0x21d4, 0x21d4}, + {0x21f4, 0x22ff}, {0x2308, 0x230b}, {0x2320, 0x2321}, {0x237c, 0x237c}, + {0x239b, 0x23b3}, {0x25b7, 0x25b7}, {0x25c1, 0x25c1}, {0x25f8, 0x25ff}, + {0x266f, 0x266f}, {0x27d0, 0x27e5}, {0x27f0, 0x27ff}, {0x2900, 0x2982}, + {0x2999, 0x29d7}, {0x29dc, 0x29fb}, {0x29fe, 0x2aff}, {0xfb29, 0xfb29}, + {0xfe62, 0xfe62}, {0xfe64, 0xfe66}, {0xff0b, 0xff0b}, {0xff1c, 0xff1e}, {0xff5c, 0xff5c}, {0xff5e, 0xff5e}, {0xffe2, 0xffe2}, {0xffe9, 0xffec} }; -static xmlChLRange xmlSmL[] = {{0x1d6c1, 0x1d6c1}, {0x1d6db, 0x1d6db}, - {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, {0x1d735, 0x1d735}, - {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, {0x1d789, 0x1d789}, +static xmlChLRange xmlSmL[] = {{0x1d6c1, 0x1d6c1}, {0x1d6db, 0x1d6db}, + {0x1d6fb, 0x1d6fb}, {0x1d715, 0x1d715}, {0x1d735, 0x1d735}, + {0x1d74f, 0x1d74f}, {0x1d76f, 0x1d76f}, {0x1d789, 0x1d789}, {0x1d7a9, 0x1d7a9}, {0x1d7c3, 0x1d7c3} }; static xmlChRangeGroup xmlSmG = {48,10,xmlSmS,xmlSmL}; -static xmlChSRange xmlSoS[] = {{0xa6, 0xa7}, {0xa9, 0xa9}, {0xae, 0xae}, - {0xb0, 0xb0}, {0xb6, 0xb6}, {0x482, 0x482}, {0x60e, 0x60f}, - {0x6e9, 0x6e9}, {0x6fd, 0x6fe}, {0x9fa, 0x9fa}, {0xb70, 0xb70}, - {0xbf3, 0xbf8}, {0xbfa, 0xbfa}, {0xf01, 0xf03}, {0xf13, 0xf17}, - {0xf1a, 0xf1f}, {0xf34, 0xf34}, {0xf36, 0xf36}, {0xf38, 0xf38}, - {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, {0xfcf, 0xfcf}, {0x1940, 0x1940}, - {0x19e0, 0x19ff}, {0x2100, 0x2101}, {0x2103, 0x2106}, {0x2108, 0x2109}, - {0x2114, 0x2114}, {0x2116, 0x2118}, {0x211e, 0x2123}, {0x2125, 0x2125}, - {0x2127, 0x2127}, {0x2129, 0x2129}, {0x212e, 0x212e}, {0x2132, 0x2132}, - {0x213a, 0x213b}, {0x214a, 0x214a}, {0x2195, 0x2199}, {0x219c, 0x219f}, - {0x21a1, 0x21a2}, {0x21a4, 0x21a5}, {0x21a7, 0x21ad}, {0x21af, 0x21cd}, - {0x21d0, 0x21d1}, {0x21d3, 0x21d3}, {0x21d5, 0x21f3}, {0x2300, 0x2307}, - {0x230c, 0x231f}, {0x2322, 0x2328}, {0x232b, 0x237b}, {0x237d, 0x239a}, - {0x23b7, 0x23d0}, {0x2400, 0x2426}, {0x2440, 0x244a}, {0x249c, 0x24e9}, - {0x2500, 0x25b6}, {0x25b8, 0x25c0}, {0x25c2, 0x25f7}, {0x2600, 0x2617}, - {0x2619, 0x266e}, {0x2670, 0x267d}, {0x2680, 0x2691}, {0x26a0, 0x26a1}, - {0x2701, 0x2704}, {0x2706, 0x2709}, {0x270c, 0x2727}, {0x2729, 0x274b}, - {0x274d, 0x274d}, {0x274f, 0x2752}, {0x2756, 0x2756}, {0x2758, 0x275e}, - {0x2761, 0x2767}, {0x2794, 0x2794}, {0x2798, 0x27af}, {0x27b1, 0x27be}, - {0x2800, 0x28ff}, {0x2b00, 0x2b0d}, {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, - {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, {0x3004, 0x3004}, {0x3012, 0x3013}, - {0x3020, 0x3020}, {0x3036, 0x3037}, {0x303e, 0x303f}, {0x3190, 0x3191}, - {0x3196, 0x319f}, {0x3200, 0x321e}, {0x322a, 0x3243}, {0x3250, 0x3250}, - {0x3260, 0x327d}, {0x327f, 0x327f}, {0x328a, 0x32b0}, {0x32c0, 0x32fe}, - {0x3300, 0x33ff}, {0x4dc0, 0x4dff}, {0xa490, 0xa4c6}, {0xfdfd, 0xfdfd}, +static xmlChSRange xmlSoS[] = {{0xa6, 0xa7}, {0xa9, 0xa9}, {0xae, 0xae}, + {0xb0, 0xb0}, {0xb6, 0xb6}, {0x482, 0x482}, {0x60e, 0x60f}, + {0x6e9, 0x6e9}, {0x6fd, 0x6fe}, {0x9fa, 0x9fa}, {0xb70, 0xb70}, + {0xbf3, 0xbf8}, {0xbfa, 0xbfa}, {0xf01, 0xf03}, {0xf13, 0xf17}, + {0xf1a, 0xf1f}, {0xf34, 0xf34}, {0xf36, 0xf36}, {0xf38, 0xf38}, + {0xfbe, 0xfc5}, {0xfc7, 0xfcc}, {0xfcf, 0xfcf}, {0x1940, 0x1940}, + {0x19e0, 0x19ff}, {0x2100, 0x2101}, {0x2103, 0x2106}, {0x2108, 0x2109}, + {0x2114, 0x2114}, {0x2116, 0x2118}, {0x211e, 0x2123}, {0x2125, 0x2125}, + {0x2127, 0x2127}, {0x2129, 0x2129}, {0x212e, 0x212e}, {0x2132, 0x2132}, + {0x213a, 0x213b}, {0x214a, 0x214a}, {0x2195, 0x2199}, {0x219c, 0x219f}, + {0x21a1, 0x21a2}, {0x21a4, 0x21a5}, {0x21a7, 0x21ad}, {0x21af, 0x21cd}, + {0x21d0, 0x21d1}, {0x21d3, 0x21d3}, {0x21d5, 0x21f3}, {0x2300, 0x2307}, + {0x230c, 0x231f}, {0x2322, 0x2328}, {0x232b, 0x237b}, {0x237d, 0x239a}, + {0x23b7, 0x23d0}, {0x2400, 0x2426}, {0x2440, 0x244a}, {0x249c, 0x24e9}, + {0x2500, 0x25b6}, {0x25b8, 0x25c0}, {0x25c2, 0x25f7}, {0x2600, 0x2617}, + {0x2619, 0x266e}, {0x2670, 0x267d}, {0x2680, 0x2691}, {0x26a0, 0x26a1}, + {0x2701, 0x2704}, {0x2706, 0x2709}, {0x270c, 0x2727}, {0x2729, 0x274b}, + {0x274d, 0x274d}, {0x274f, 0x2752}, {0x2756, 0x2756}, {0x2758, 0x275e}, + {0x2761, 0x2767}, {0x2794, 0x2794}, {0x2798, 0x27af}, {0x27b1, 0x27be}, + {0x2800, 0x28ff}, {0x2b00, 0x2b0d}, {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, + {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb}, {0x3004, 0x3004}, {0x3012, 0x3013}, + {0x3020, 0x3020}, {0x3036, 0x3037}, {0x303e, 0x303f}, {0x3190, 0x3191}, + {0x3196, 0x319f}, {0x3200, 0x321e}, {0x322a, 0x3243}, {0x3250, 0x3250}, + {0x3260, 0x327d}, {0x327f, 0x327f}, {0x328a, 0x32b0}, {0x32c0, 0x32fe}, + {0x3300, 0x33ff}, {0x4dc0, 0x4dff}, {0xa490, 0xa4c6}, {0xfdfd, 0xfdfd}, {0xffe4, 0xffe4}, {0xffe8, 0xffe8}, {0xffed, 0xffee}, {0xfffc, 0xfffd} }; -static xmlChLRange xmlSoL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, - {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, - {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, +static xmlChLRange xmlSoL[] = {{0x10102, 0x10102}, {0x10137, 0x1013f}, + {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d12a, 0x1d164}, + {0x1d16a, 0x1d16c}, {0x1d183, 0x1d184}, {0x1d18c, 0x1d1a9}, {0x1d1ae, 0x1d1dd}, {0x1d300, 0x1d356} }; static xmlChRangeGroup xmlSoG = {103,10,xmlSoS,xmlSoL}; -static xmlChSRange xmlZS[] = {{0x20, 0x20}, {0xa0, 0xa0}, {0x1680, 0x1680}, - {0x180e, 0x180e}, {0x2000, 0x200b}, {0x2028, 0x2029}, {0x202f, 0x202f}, +static xmlChSRange xmlZS[] = {{0x20, 0x20}, {0xa0, 0xa0}, {0x1680, 0x1680}, + {0x180e, 0x180e}, {0x2000, 0x200b}, {0x2028, 0x2029}, {0x202f, 0x202f}, {0x205f, 0x205f}, {0x3000, 0x3000} }; static xmlChRangeGroup xmlZG = {9,0,xmlZS,NULL}; @@ -957,7 +957,7 @@ static xmlIntFunc else low = mid + 1; } - return (NULL); + return (NULL); } /** diff --git a/reactos/lib/3rdparty/libxml2/xmlwriter.c b/reactos/lib/3rdparty/libxml2/xmlwriter.c index 5e537ea7f5a..77b89ff7b80 100644 --- a/reactos/lib/3rdparty/libxml2/xmlwriter.c +++ b/reactos/lib/3rdparty/libxml2/xmlwriter.c @@ -1573,7 +1573,7 @@ xmlTextWriterWriteBase64(xmlTextWriterPtr writer, const char *data, * Write hqx encoded data to an xmlOutputBuffer. * ::todo * - * Returns the bytes written (may be 0 because of buffering) + * Returns the bytes written (may be 0 because of buffering) * or -1 in case of error */ static int @@ -1582,7 +1582,7 @@ xmlOutputBufferWriteBinHex(xmlOutputBufferPtr out, { int count; int sum; - static char hex[16] = + static char hex[16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; int i; diff --git a/reactos/lib/3rdparty/libxml2/xpath.c b/reactos/lib/3rdparty/libxml2/xpath.c index cd4f82f0d37..47f50a082e7 100644 --- a/reactos/lib/3rdparty/libxml2/xpath.c +++ b/reactos/lib/3rdparty/libxml2/xpath.c @@ -70,7 +70,7 @@ * data. These should be enhanced for full UTF8 support (see particularly * any use of the macros IS_ASCII_CHARACTER and IS_ASCII_DIGIT) */ - + #if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) /************************************************************************ * * @@ -116,7 +116,7 @@ xmlXPathInit(void) { * Provides a portable isnan() function to detect whether a double * is a NotaNumber. Based on trio code * http://sourceforge.net/projects/ctrio/ - * + * * Returns 1 if the value is a NaN, 0 otherwise */ int @@ -131,7 +131,7 @@ xmlXPathIsNaN(double val) { * Provides a portable isinf() function to detect whether a double * is a +Infinite or -Infinite. Based on trio code * http://sourceforge.net/projects/ctrio/ - * + * * Returns 1 vi the value is +Infinite, -1 if -Infinite, 0 otherwise */ int @@ -148,7 +148,7 @@ xmlXPathIsInf(double val) { * Provides a portable function to detect the sign of a double * Modified from trio code * http://sourceforge.net/projects/ctrio/ - * + * * Returns 1 if the value is Negative, 0 if positive */ static int @@ -176,7 +176,7 @@ static xmlNs xmlXPathXMLNamespaceStruct = { }; static xmlNsPtr xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct; #ifndef LIBXML_THREAD_ENABLED -/* +/* * Optimizer is disabled only when threaded apps are detected while * the library ain't compiled for thread safety. */ @@ -674,7 +674,7 @@ xmlXPathDebugDumpNode(FILE *output, xmlNodePtr cur, int depth) { fprintf(output, shift); fprintf(output, "Node is NULL !\n"); return; - + } if ((cur->type == XML_DOCUMENT_NODE) || @@ -699,7 +699,7 @@ xmlXPathDebugDumpNodeList(FILE *output, xmlNodePtr cur, int depth) { fprintf(output, shift); fprintf(output, "Node is NULL !\n"); return; - + } while (cur != NULL) { @@ -722,7 +722,7 @@ xmlXPathDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur, int depth) { fprintf(output, shift); fprintf(output, "NodeSet is NULL !\n"); return; - + } if (cur != NULL) { @@ -748,7 +748,7 @@ xmlXPathDebugDumpValueTree(FILE *output, xmlNodeSetPtr cur, int depth) { fprintf(output, shift); fprintf(output, "Value Tree is NULL !\n"); return; - + } fprintf(output, shift); @@ -769,7 +769,7 @@ xmlXPathDebugDumpLocationSet(FILE *output, xmlLocationSetPtr cur, int depth) { fprintf(output, shift); fprintf(output, "LocationSet is NULL !\n"); return; - + } for (i = 0;i < cur->locNr;i++) { @@ -1745,9 +1745,9 @@ xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) { memset(cur, 0, sizeof(xmlNs)); cur->type = XML_NAMESPACE_DECL; if (ns->href != NULL) - cur->href = xmlStrdup(ns->href); + cur->href = xmlStrdup(ns->href); if (ns->prefix != NULL) - cur->prefix = xmlStrdup(ns->prefix); + cur->prefix = xmlStrdup(ns->prefix); cur->next = (xmlNsPtr) node; return((xmlNodePtr) cur); } @@ -1863,7 +1863,7 @@ void xmlXPathNodeSetAddNs(xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns) { int i; - + if ((cur == NULL) || (ns == NULL) || (node == NULL) || (ns->type != XML_NAMESPACE_DECL) || (node->type != XML_ELEMENT_NODE)) @@ -1962,7 +1962,7 @@ xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) { if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; - cur->nodeTab[cur->nodeNr++] = + cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else cur->nodeTab[cur->nodeNr++] = val; @@ -2014,7 +2014,7 @@ xmlXPathNodeSetAddUnique(xmlNodeSetPtr cur, xmlNodePtr val) { if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; - cur->nodeTab[cur->nodeNr++] = + cur->nodeTab[cur->nodeNr++] = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); } else cur->nodeTab[cur->nodeNr++] = val; @@ -2184,7 +2184,7 @@ xmlXPathNodeSetDel(xmlNodeSetPtr cur, xmlNodePtr val) { if (i >= cur->nodeNr) { /* not found */ #ifdef DEBUG - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "xmlXPathNodeSetDel: Node %s wasn't found in NodeList\n", val->name); #endif @@ -2498,7 +2498,7 @@ xmlXPathIntersection (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2) { * * Implements the EXSLT - Sets distinct() function: * node-set set:distinct (node-set) - * + * * Returns a subset of the nodes contained in @nodes, or @nodes if * it is empty */ @@ -2800,7 +2800,7 @@ xmlXPathTrailing (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2) { * * Returns 0 in case of success, -1 in case of error */ -int +int xmlXPathRegisterFunc(xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathFunction f) { return(xmlXPathRegisterFuncNS(ctxt, name, NULL, f)); @@ -2894,7 +2894,7 @@ xmlXPathFunction xmlXPathFunctionLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri) { xmlXPathFunction ret; - + if (ctxt == NULL) return(NULL); if (name == NULL) @@ -2948,7 +2948,7 @@ xmlXPathRegisteredFuncsCleanup(xmlXPathContextPtr ctxt) { * * Returns 0 in case of success, -1 in case of error */ -int +int xmlXPathRegisterVariable(xmlXPathContextPtr ctxt, const xmlChar *name, xmlXPathObjectPtr value) { return(xmlXPathRegisterVariableNS(ctxt, name, NULL, value)); @@ -2980,7 +2980,7 @@ xmlXPathRegisterVariableNS(xmlXPathContextPtr ctxt, const xmlChar *name, if (ctxt->varHash == NULL) return(-1); if (value == NULL) - return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri, + return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri, (xmlHashDeallocator)xmlXPathFreeObject)); return(xmlHashUpdateEntry2(ctxt->varHash, name, ns_uri, (void *) value, @@ -3036,7 +3036,7 @@ xmlXPathVariableLookup(xmlXPathContextPtr ctxt, const xmlChar *name) { * @ns_uri: the variable namespace URI * * Search in the Variable array of the context for the given - * variable value. + * variable value. * * Returns the a copy of the value or NULL if not found */ @@ -3398,7 +3398,7 @@ xmlXPathObjectCopy(xmlXPathObjectPtr val) { #endif case XPATH_USERS: ret->user = val->user; - break; + break; case XPATH_UNDEFINED: xmlGenericError(xmlGenericErrorContext, "xmlXPathObjectCopy: unsupported type %d\n", @@ -3925,7 +3925,7 @@ xmlXPathNewContext(xmlDocPtr doc) { ret->proximityPosition = -1; xmlXPathRegisterAllFunctions(ret); - + return(ret); } @@ -4029,7 +4029,7 @@ xmlXPathCompParserContext(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctxt) { memset(ret, 0 , (size_t) sizeof(xmlXPathParserContext)); /* Allocate the value stack */ - ret->valueTab = (xmlXPathObjectPtr *) + ret->valueTab = (xmlXPathObjectPtr *) xmlMalloc(10 * sizeof(xmlXPathObjectPtr)); if (ret->valueTab == NULL) { xmlFree(ret); @@ -4176,7 +4176,7 @@ xmlXPathNodeValHash(xmlNodePtr node) { tmp = tmp->next; continue; } - + do { tmp = tmp->parent; if (tmp == NULL) @@ -4335,7 +4335,7 @@ xmlXPathCompareNodeSetString(xmlXPathParserContextPtr ctxt, int inf, int strict, * If both objects to be compared are node-sets, then the comparison * will be true if and only if there is a node in the first node-set * and a node in the second node-set such that the result of performing - * the comparison on the string-values of the two nodes is true. + * the comparison on the string-values of the two nodes is true. * .... * When neither object to be compared is a node-set and the operator * is <=, <, >= or >, then the objects are compared by converting both @@ -4349,7 +4349,7 @@ xmlXPathCompareNodeSetString(xmlXPathParserContextPtr ctxt, int inf, int strict, * represented by the string; any other string is converted to NaN * * Conclusion all nodes need to be converted first to their string value - * and then the comparison must be done when possible + * and then the comparison must be done when possible */ static int xmlXPathCompareNodeSets(int inf, int strict, @@ -4404,7 +4404,7 @@ xmlXPathCompareNodeSets(int inf, int strict, } if (xmlXPathIsNaN(values2[j])) continue; - if (inf && strict) + if (inf && strict) ret = (val1 < values2[j]); else if (inf && !strict) ret = (val1 <= values2[j]); @@ -4741,7 +4741,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt, case XPATH_STRING: if ((arg2->stringval == NULL) || (arg2->stringval[0] == 0)) ret = 0; - else + else ret = 1; ret = (arg1->boolval == ret); break; @@ -4824,7 +4824,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt, case XPATH_BOOLEAN: if ((arg1->stringval == NULL) || (arg1->stringval[0] == 0)) ret = 0; - else + else ret = 1; ret = (arg2->boolval == ret); break; @@ -4903,7 +4903,7 @@ xmlXPathEqualValues(xmlXPathParserContextPtr ctxt) { int ret = 0; if ((ctxt == NULL) || (ctxt->context == NULL)) return(0); - arg2 = valuePop(ctxt); + arg2 = valuePop(ctxt); arg1 = valuePop(ctxt); if ((arg1 == NULL) || (arg2 == NULL)) { if (arg1 != NULL) @@ -4949,7 +4949,7 @@ xmlXPathEqualValues(xmlXPathParserContextPtr ctxt) { case XPATH_BOOLEAN: if ((arg1->nodesetval == NULL) || (arg1->nodesetval->nodeNr == 0)) ret = 0; - else + else ret = 1; ret = (ret == arg2->boolval); break; @@ -4988,7 +4988,7 @@ xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt) { int ret = 0; if ((ctxt == NULL) || (ctxt->context == NULL)) return(0); - arg2 = valuePop(ctxt); + arg2 = valuePop(ctxt); arg1 = valuePop(ctxt); if ((arg1 == NULL) || (arg2 == NULL)) { if (arg1 != NULL) @@ -5034,7 +5034,7 @@ xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt) { case XPATH_BOOLEAN: if ((arg1->nodesetval == NULL) || (arg1->nodesetval->nodeNr == 0)) ret = 0; - else + else ret = 1; ret = (ret != arg2->boolval); break; @@ -5065,7 +5065,7 @@ xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt) { * @inf: less than (1) or greater than (0) * @strict: is the comparison strict * - * Implement the compare operation on XPath objects: + * Implement the compare operation on XPath objects: * @arg1 < @arg2 (1, 1, ... * @arg1 <= @arg2 (1, 0, ... * @arg1 > @arg2 (0, 1, ... @@ -5089,7 +5089,7 @@ xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict) { xmlXPathObjectPtr arg1, arg2; if ((ctxt == NULL) || (ctxt->context == NULL)) return(0); - arg2 = valuePop(ctxt); + arg2 = valuePop(ctxt); arg1 = valuePop(ctxt); if ((arg1 == NULL) || (arg2 == NULL)) { if (arg1 != NULL) @@ -5334,7 +5334,7 @@ xmlXPathDivValues(xmlXPathParserContextPtr ctxt) { ctxt->value->floatval = xmlXPathPINF; else if (ctxt->value->floatval < 0) ctxt->value->floatval = xmlXPathNINF; - } else + } else ctxt->value->floatval /= val; } @@ -5498,7 +5498,7 @@ xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { (cur->type != XML_DTD_NODE)) return(cur); } - + do { cur = cur->parent; if (cur == NULL) return(NULL); @@ -5597,7 +5597,7 @@ xmlXPathNextParent(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { return(NULL); case XML_NAMESPACE_DECL: { xmlNsPtr ns = (xmlNsPtr) ctxt->context->node; - + if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) return((xmlNodePtr) ns->next); @@ -5670,7 +5670,7 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { return(NULL); case XML_NAMESPACE_DECL: { xmlNsPtr ns = (xmlNsPtr) ctxt->context->node; - + if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) return((xmlNodePtr) ns->next); @@ -5714,7 +5714,7 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { } case XML_NAMESPACE_DECL: { xmlNsPtr ns = (xmlNsPtr) ctxt->context->node; - + if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) return((xmlNodePtr) ns->next); @@ -5911,7 +5911,7 @@ xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) * node that are before the context node in document order, excluding any * ancestors and excluding attribute nodes and namespace nodes; the nodes are * ordered in reverse document order - * This is a faster implementation but internal only since it requires a + * This is a faster implementation but internal only since it requires a * state kept in the parser context: ctxt->ancestor. * * Returns the next element following that axis @@ -5968,7 +5968,7 @@ xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if (ctxt->context->tmpNsList == NULL && cur != (xmlNodePtr) xmlXPathXMLNamespace) { if (ctxt->context->tmpNsList != NULL) xmlFree(ctxt->context->tmpNsList); - ctxt->context->tmpNsList = + ctxt->context->tmpNsList = xmlGetNsList(ctxt->context->doc, ctxt->context->node); ctxt->context->tmpNsNr = 0; if (ctxt->context->tmpNsList != NULL) { @@ -6111,7 +6111,7 @@ xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlXPathObjectPtr cur; CHECK_ARITY(1); - if ((ctxt->value == NULL) || + if ((ctxt->value == NULL) || ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); @@ -6281,7 +6281,7 @@ xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs) { } CHECK_ARITY(1); - if ((ctxt->value == NULL) || + if ((ctxt->value == NULL) || ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); @@ -6337,7 +6337,7 @@ xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs) { nargs = 1; } CHECK_ARITY(1); - if ((ctxt->value == NULL) || + if ((ctxt->value == NULL) || ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); @@ -6419,7 +6419,7 @@ xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs) } else { xmlChar *fullname; - + fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name, cur->nodesetval->nodeTab[i]->ns->prefix, NULL, 0); @@ -6453,11 +6453,11 @@ xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs) * the node in the node-set that is first in document order. * If the node-set is empty, an empty string is returned. * - A number is converted to a string as follows - * + NaN is converted to the string NaN - * + positive zero is converted to the string 0 - * + negative zero is converted to the string 0 - * + positive infinity is converted to the string Infinity - * + negative infinity is converted to the string -Infinity + * + NaN is converted to the string NaN + * + positive zero is converted to the string 0 + * + negative zero is converted to the string 0 + * + positive infinity is converted to the string Infinity + * + negative infinity is converted to the string -Infinity * + if the number is an integer, the number is represented in * decimal form as a Number with no decimal point and no leading * zeros, preceded by a minus sign (-) if the number is negative @@ -6668,12 +6668,12 @@ xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs) { * or equal to the second argument and, if the third argument is specified, * less than the sum of the second and third arguments; the comparisons * and addition used for the above follow the standard IEEE 754 rules. Thus: - * - substring("12345", 1.5, 2.6) returns "234" - * - substring("12345", 0, 3) returns "12" - * - substring("12345", 0 div 0, 3) returns "" - * - substring("12345", 1, 0 div 0) returns "" - * - substring("12345", -42, 1 div 0) returns "12345" - * - substring("12345", -1 div 0, 1 div 0) returns "" + * - substring("12345", 1.5, 2.6) returns "234" + * - substring("12345", 0, 3) returns "12" + * - substring("12345", 0 div 0, 3) returns "" + * - substring("12345", 1, 0 div 0) returns "" + * - substring("12345", -42, 1 div 0) returns "12345" + * - substring("12345", -1 div 0, 1 div 0) returns "" */ void xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs) { @@ -6714,18 +6714,18 @@ xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs) { */ if (nargs != 3) { le = (double)m; - if (in < 1.0) + if (in < 1.0) in = 1.0; } - /* Need to check for the special cases where either + /* Need to check for the special cases where either * the index is NaN, the length is NaN, or both * arguments are infinity (relying on Inf + -Inf = NaN) */ if (!xmlXPathIsNaN(in + le) && !xmlXPathIsInf(in)) { /* * To meet the requirements of the spec, the arguments - * must be converted to integer format before + * must be converted to integer format before * initial index calculations are done * * First we go to integer form, rounding up @@ -6793,13 +6793,13 @@ xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlBufferPtr target; const xmlChar *point; int offset; - + CHECK_ARITY(2); CAST_TO_STRING; find = valuePop(ctxt); CAST_TO_STRING; str = valuePop(ctxt); - + target = xmlBufferCreate(); if (target) { point = xmlStrstr(str->stringval, find->stringval); @@ -6810,7 +6810,7 @@ xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs) { valuePush(ctxt, xmlXPathNewString(xmlBufferContent(target))); xmlBufferFree(target); } - + xmlXPathFreeObject(str); xmlXPathFreeObject(find); } @@ -6836,13 +6836,13 @@ xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlBufferPtr target; const xmlChar *point; int offset; - + CHECK_ARITY(2); CAST_TO_STRING; find = valuePop(ctxt); CAST_TO_STRING; str = valuePop(ctxt); - + target = xmlBufferCreate(); if (target) { point = xmlStrstr(str->stringval, find->stringval); @@ -6854,7 +6854,7 @@ xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs) { valuePush(ctxt, xmlXPathNewString(xmlBufferContent(target))); xmlBufferFree(target); } - + xmlXPathFreeObject(str); xmlXPathFreeObject(find); } @@ -6879,7 +6879,7 @@ xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlChar *source = NULL; xmlBufferPtr target; xmlChar blank; - + if (ctxt == NULL) return; if (nargs == 0) { /* Use current context node */ @@ -6897,11 +6897,11 @@ xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs) { target = xmlBufferCreate(); if (target && source) { - + /* Skip leading whitespaces */ while (IS_BLANK_CH(*source)) source++; - + /* Collapse intermediate whitespaces, and skip trailing whitespaces */ blank = 0; while (*source) { @@ -6916,7 +6916,7 @@ xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs) { } source++; } - + valuePush(ctxt, xmlXPathNewString(xmlBufferContent(target))); xmlBufferFree(target); } @@ -7175,7 +7175,7 @@ xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs) { double res = 0.0; CHECK_ARITY(1); - if ((ctxt->value == NULL) || + if ((ctxt->value == NULL) || ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); @@ -7294,14 +7294,14 @@ xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs) { if (ctxt->value->floatval < 0) { if (ctxt->value->floatval < f - 0.5) ctxt->value->floatval = f - 1; - else + else ctxt->value->floatval = f; if (ctxt->value->floatval == 0) ctxt->value->floatval = xmlXPathNZERO; } else { if (ctxt->value->floatval < f + 0.5) ctxt->value->floatval = f; - else + else ctxt->value->floatval = f + 1; } } @@ -7352,7 +7352,7 @@ xmlXPathCurrentChar(xmlXPathParserContextPtr ctxt, int *len) { * UCS-4 range (hex.) UTF-8 octet sequence (binary) * 0000 0000-0000 007F 0xxxxxxx * 0000 0080-0000 07FF 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx * * Check for the 0x110000 limit too */ @@ -7389,7 +7389,7 @@ xmlXPathCurrentChar(xmlXPathParserContextPtr ctxt, int *len) { } if (!IS_CHAR(val)) { XP_ERROR0(XPATH_INVALID_CHAR_ERROR); - } + } return(val); } else { /* 1-byte code */ @@ -7461,7 +7461,7 @@ xmlXPathParseNCName(xmlXPathParserContextPtr ctxt) { /** * xmlXPathParseQName: * @ctxt: the XPath Parser context - * @prefix: a xmlChar ** + * @prefix: a xmlChar ** * * parse an XML qualified name * @@ -7555,7 +7555,7 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) { while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */ ((IS_LETTER(c)) || (IS_DIGIT(c)) || (c == '.') || (c == '-') || - (c == '_') || ((qualified) && (c == ':')) || + (c == '_') || ((qualified) && (c == ':')) || (IS_COMBINING(c)) || (IS_EXTENDER(c)))) { COPY_BUF(l,buf,len,c); @@ -7568,7 +7568,7 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) { */ xmlChar *buffer; int max = len * 2; - + buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar)); if (buffer == NULL) { XP_ERROR0(XPATH_MEMORY_ERROR); @@ -7576,7 +7576,7 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) { memcpy(buffer, buf, len); while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigname.xml */ (c == '.') || (c == '-') || - (c == '_') || ((qualified) && (c == ':')) || + (c == '_') || ((qualified) && (c == ':')) || (IS_COMBINING(c)) || (IS_EXTENDER(c))) { if (len + 10 > max) { @@ -7623,7 +7623,7 @@ static double my_pow10[MAX_FRAC+1] = { * [30a] Float ::= Number ('e' Digits?)? * * [30] Number ::= Digits ('.' Digits?)? - * | '.' Digits + * | '.' Digits * [31] Digits ::= [0-9]+ * * Compile a Number in the string @@ -7722,7 +7722,7 @@ xmlXPathStringEvalNumber(const xmlChar *str) { * @ctxt: the XPath Parser context * * [30] Number ::= Digits ('.' Digits?)? - * | '.' Digits + * | '.' Digits * [31] Digits ::= [0-9]+ * * Compile a Number, then push it on the stack @@ -7902,9 +7902,9 @@ xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) { * * Early evaluation is possible since: * The variable bindings [...] used to evaluate a subexpression are - * always the same as those used to evaluate the containing expression. + * always the same as those used to evaluate the containing expression. * - * [36] VariableReference ::= '$' QName + * [36] VariableReference ::= '$' QName */ static void xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) { @@ -7960,7 +7960,7 @@ xmlXPathIsNodeType(const xmlChar *name) { * @ctxt: the XPath Parser context * * [16] FunctionCall ::= FunctionName '(' ( Argument ( ',' Argument)*)? ')' - * [17] Argument ::= Expr + * [17] Argument ::= Expr * * Compile a function call, the evaluation of all arguments are * pushed on the stack @@ -8018,11 +8018,11 @@ xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) { * xmlXPathCompPrimaryExpr: * @ctxt: the XPath Parser context * - * [15] PrimaryExpr ::= VariableReference + * [15] PrimaryExpr ::= VariableReference * | '(' Expr ')' - * | Literal - * | Number - * | FunctionCall + * | Literal + * | Number + * | FunctionCall * * Compile a primary expression. */ @@ -8054,8 +8054,8 @@ xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompFilterExpr: * @ctxt: the XPath Parser context * - * [20] FilterExpr ::= PrimaryExpr - * | FilterExpr Predicate + * [20] FilterExpr ::= PrimaryExpr + * | FilterExpr Predicate * * Compile a filter expression. * Square brackets are used to filter expressions in the same way that @@ -8070,13 +8070,13 @@ xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) { xmlXPathCompPrimaryExpr(ctxt); CHECK_ERROR; SKIP_BLANKS; - + while (CUR == '[') { xmlXPathCompPredicate(ctxt, 1); SKIP_BLANKS; } - + } /** @@ -8115,7 +8115,7 @@ xmlXPathScanName(xmlXPathParserContextPtr ctxt) { while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */ ((IS_LETTER(c)) || (IS_DIGIT(c)) || (c == '.') || (c == '-') || - (c == '_') || (c == ':') || + (c == '_') || (c == ':') || (IS_COMBINING(c)) || (IS_EXTENDER(c)))) { len += l; @@ -8131,10 +8131,10 @@ xmlXPathScanName(xmlXPathParserContextPtr ctxt) { * xmlXPathCompPathExpr: * @ctxt: the XPath Parser context * - * [19] PathExpr ::= LocationPath - * | FilterExpr - * | FilterExpr '/' RelativeLocationPath - * | FilterExpr '//' RelativeLocationPath + * [19] PathExpr ::= LocationPath + * | FilterExpr + * | FilterExpr '/' RelativeLocationPath + * | FilterExpr '//' RelativeLocationPath * * Compile a path expression. * The / operator and // operators combine an arbitrary expression @@ -8151,7 +8151,7 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) { xmlChar *name = NULL; /* we may have to preparse a name to find out */ SKIP_BLANKS; - if ((CUR == '$') || (CUR == '(') || + if ((CUR == '$') || (CUR == '(') || (IS_ASCII_DIGIT(CUR)) || (CUR == '\'') || (CUR == '"') || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) { @@ -8192,7 +8192,7 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) { } else if (name != NULL) { int len =xmlStrlen(name); - + while (NXT(len) != 0) { if (NXT(len) == '/') { /* element name */ @@ -8259,7 +8259,7 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) { /* make sure all cases are covered explicitly */ XP_ERROR(XPATH_EXPR_ERROR); } - } + } if (lc) { if (CUR == '/') { @@ -8291,8 +8291,8 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompUnionExpr: * @ctxt: the XPath Parser context * - * [18] UnionExpr ::= PathExpr - * | UnionExpr '|' PathExpr + * [18] UnionExpr ::= PathExpr + * | UnionExpr '|' PathExpr * * Compile an union expression. */ @@ -8320,8 +8320,8 @@ xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompUnaryExpr: * @ctxt: the XPath Parser context * - * [27] UnaryExpr ::= UnionExpr - * | '-' UnaryExpr + * [27] UnaryExpr ::= UnionExpr + * | '-' UnaryExpr * * Compile an unary expression. */ @@ -8353,10 +8353,10 @@ xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompMultiplicativeExpr: * @ctxt: the XPath Parser context * - * [26] MultiplicativeExpr ::= UnaryExpr - * | MultiplicativeExpr MultiplyOperator UnaryExpr - * | MultiplicativeExpr 'div' UnaryExpr - * | MultiplicativeExpr 'mod' UnaryExpr + * [26] MultiplicativeExpr ::= UnaryExpr + * | MultiplicativeExpr MultiplyOperator UnaryExpr + * | MultiplicativeExpr 'div' UnaryExpr + * | MultiplicativeExpr 'mod' UnaryExpr * [34] MultiplyOperator ::= '*' * * Compile an Additive expression. @@ -8367,7 +8367,7 @@ xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) { xmlXPathCompUnaryExpr(ctxt); CHECK_ERROR; SKIP_BLANKS; - while ((CUR == '*') || + while ((CUR == '*') || ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) || ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) { int op = -1; @@ -8395,9 +8395,9 @@ xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompAdditiveExpr: * @ctxt: the XPath Parser context * - * [25] AdditiveExpr ::= MultiplicativeExpr - * | AdditiveExpr '+' MultiplicativeExpr - * | AdditiveExpr '-' MultiplicativeExpr + * [25] AdditiveExpr ::= MultiplicativeExpr + * | AdditiveExpr '+' MultiplicativeExpr + * | AdditiveExpr '-' MultiplicativeExpr * * Compile an Additive expression. */ @@ -8427,11 +8427,11 @@ xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompRelationalExpr: * @ctxt: the XPath Parser context * - * [24] RelationalExpr ::= AdditiveExpr - * | RelationalExpr '<' AdditiveExpr - * | RelationalExpr '>' AdditiveExpr - * | RelationalExpr '<=' AdditiveExpr - * | RelationalExpr '>=' AdditiveExpr + * [24] RelationalExpr ::= AdditiveExpr + * | RelationalExpr '<' AdditiveExpr + * | RelationalExpr '>' AdditiveExpr + * | RelationalExpr '<=' AdditiveExpr + * | RelationalExpr '>=' AdditiveExpr * * A <= B > C is allowed ? Answer from James, yes with * (AdditiveExpr <= AdditiveExpr) > AdditiveExpr @@ -8471,9 +8471,9 @@ xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompEqualityExpr: * @ctxt: the XPath Parser context * - * [23] EqualityExpr ::= RelationalExpr - * | EqualityExpr '=' RelationalExpr - * | EqualityExpr '!=' RelationalExpr + * [23] EqualityExpr ::= RelationalExpr + * | EqualityExpr '=' RelationalExpr + * | EqualityExpr '!=' RelationalExpr * * A != B != C is allowed ? Answer from James, yes with * (RelationalExpr = RelationalExpr) = RelationalExpr @@ -8508,8 +8508,8 @@ xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompAndExpr: * @ctxt: the XPath Parser context * - * [22] AndExpr ::= EqualityExpr - * | AndExpr 'and' EqualityExpr + * [22] AndExpr ::= EqualityExpr + * | AndExpr 'and' EqualityExpr * * Compile an AND expression. * @@ -8534,9 +8534,9 @@ xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) { * xmlXPathCompileExpr: * @ctxt: the XPath Parser context * - * [14] Expr ::= OrExpr - * [21] OrExpr ::= AndExpr - * | OrExpr 'or' AndExpr + * [14] Expr ::= OrExpr + * [21] OrExpr ::= AndExpr + * | OrExpr 'or' AndExpr * * Parse and compile an expression */ @@ -8567,7 +8567,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt) { * @filter: act as a filter * * [8] Predicate ::= '[' PredicateExpr ']' - * [9] PredicateExpr ::= Expr + * [9] PredicateExpr ::= Expr * * Compile a predicate expression */ @@ -8672,7 +8672,7 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test, } *test = NODE_TEST_TYPE; - + SKIP_BLANKS; if (*type == NODE_TYPE_PI) { /* @@ -8808,7 +8808,7 @@ xmlXPathIsAxisName(const xmlChar *name) { * @ctxt: the XPath Parser context * * [4] Step ::= AxisSpecifier NodeTest Predicate* - * | AbbreviatedStep + * | AbbreviatedStep * * [12] AbbreviatedStep ::= '.' | '..' * @@ -8974,10 +8974,10 @@ eval_predicates: * xmlXPathCompRelativeLocationPath: * @ctxt: the XPath Parser context * - * [3] RelativeLocationPath ::= Step - * | RelativeLocationPath '/' Step - * | AbbreviatedRelativeLocationPath - * [11] AbbreviatedRelativeLocationPath ::= RelativeLocationPath '//' Step + * [3] RelativeLocationPath ::= Step + * | RelativeLocationPath '/' Step + * | AbbreviatedRelativeLocationPath + * [11] AbbreviatedRelativeLocationPath ::= RelativeLocationPath '//' Step * * Compile a relative location path. */ @@ -9016,12 +9016,12 @@ xmlXPathCompRelativeLocationPath * xmlXPathCompLocationPath: * @ctxt: the XPath Parser context * - * [1] LocationPath ::= RelativeLocationPath - * | AbsoluteLocationPath + * [1] LocationPath ::= RelativeLocationPath + * | AbsoluteLocationPath * [2] AbsoluteLocationPath ::= '/' RelativeLocationPath? - * | AbbreviatedAbsoluteLocationPath - * [10] AbbreviatedAbsoluteLocationPath ::= - * '//' RelativeLocationPath + * | AbbreviatedAbsoluteLocationPath + * [10] AbbreviatedAbsoluteLocationPath ::= + * '//' RelativeLocationPath * * Compile a location path * @@ -9275,9 +9275,9 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, #endif /* * 2.3 Node Tests - * - For the attribute axis, the principal node type is attribute. - * - For the namespace axis, the principal node type is namespace. - * - For other axes, the principal node type is element. + * - For the attribute axis, the principal node type is attribute. + * - For the namespace axis, the principal node type is namespace. + * - For other axes, the principal node type is element. * * A node test * is true for any node of the * principal node type. For example, child::* will @@ -9358,7 +9358,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, #ifdef DEBUG_STEP n++; #endif - xmlXPathNodeSetAddNs(list, ctxt->context->node, + xmlXPathNodeSetAddNs(list, ctxt->context->node, (xmlNsPtr) cur); } } else { @@ -9711,9 +9711,9 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, #endif /* * 2.3 Node Tests - * - For the attribute axis, the principal node type is attribute. - * - For the namespace axis, the principal node type is namespace. - * - For other axes, the principal node type is element. + * - For the attribute axis, the principal node type is attribute. + * - For the namespace axis, the principal node type is namespace. + * - For other axes, the principal node type is element. * * A node test * is true for any node of the * principal node type. For example, child::* will @@ -9785,7 +9785,7 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt, if (cur->type == XML_NAMESPACE_DECL) { n++; if (n == indx) - xmlXPathNodeSetAddNs(list, ctxt->context->node, + xmlXPathNodeSetAddNs(list, ctxt->context->node, (xmlNsPtr) cur); } } else { @@ -10875,7 +10875,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) res = valuePop(ctxt); if (res->type == XPATH_LOCATIONSET) { - xmlLocationSetPtr rloc = + xmlLocationSetPtr rloc = (xmlLocationSetPtr)res->user; for (j=0; jlocNr; j++) { range = xmlXPtrNewRange( @@ -11009,7 +11009,7 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp) { retval = xmlXPathNewNodeSet(NULL); if (retval == NULL) return(NULL); - + if ((from_root) && (max_depth == 0)) { xmlXPathNodeSetAddUnique(retval->nodesetval, (xmlNodePtr) ctxt->doc); return(retval); @@ -11088,7 +11088,7 @@ next_node: } } } - + scan_children: if ((cur->children != NULL) && (depth < max_depth)) { /* @@ -11114,7 +11114,7 @@ scan_children: (cur->type != XML_DTD_NODE)) goto next_node; } - + do { cur = cur->parent; depth--; @@ -11154,7 +11154,7 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt) { if (ctxt->valueTab == NULL) { /* Allocate the value stack */ - ctxt->valueTab = (xmlXPathObjectPtr *) + ctxt->valueTab = (xmlXPathObjectPtr *) xmlMalloc(10 * sizeof(xmlXPathObjectPtr)); if (ctxt->valueTab == NULL) { xmlXPathPErrMemory(ctxt, "creating evaluation context\n"); @@ -11201,7 +11201,7 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt) { * context node in the context node list (as returned by the position * function) and will be converted to false otherwise; if the result * is not a number, then the result will be converted as if by a call - * to the boolean function. + * to the boolean function. * * Returns 1 if predicate is true, 0 otherwise */ @@ -11239,12 +11239,12 @@ xmlXPathEvalPredicate(xmlXPathContextPtr ctxt, xmlXPathObjectPtr res) { * context node in the context node list (as returned by the position * function) and will be converted to false otherwise; if the result * is not a number, then the result will be converted as if by a call - * to the boolean function. + * to the boolean function. * * Returns 1 if predicate is true, 0 otherwise */ int -xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt, +xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr res) { if ((ctxt == NULL) || (res == NULL)) return(0); switch (res->type) { @@ -11385,7 +11385,7 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) { } if (*pctxt->cur != 0) { - /* + /* * aleksey: in some cases this line prints *second* error message * (see bug #78858) and probably this should be fixed. * However, we are not sure that all error messages are printed @@ -11471,12 +11471,12 @@ xmlXPathCompiledEval(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx) { res = valuePop(ctxt); } - + do { tmp = valuePop(ctxt); if (tmp != NULL) { if (tmp != init) - stack++; + stack++; xmlXPathFreeObject(tmp); } } while (tmp != NULL); @@ -11489,7 +11489,7 @@ xmlXPathCompiledEval(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctx) { xmlXPathFreeObject(res); res = NULL; } - + ctxt->comp = NULL; xmlXPathFreeParserContext(ctxt); @@ -11513,7 +11513,7 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) { #endif if (ctxt == NULL) return; - + #ifdef XPATH_STREAMING comp = xmlXPathTryStreamCompile(ctxt->context, ctxt->base); if (comp != NULL) { @@ -11558,7 +11558,7 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) { xmlGenericError(xmlGenericErrorContext, "xmlXPathEval: evaluation failed\n"); res = NULL; - } else if ((*ctxt->cur != 0) && (ctxt->comp != NULL) + } else if ((*ctxt->cur != 0) && (ctxt->comp != NULL) #ifdef XPATH_STREAMING && (ctxt->comp->stream == NULL) #endif @@ -11573,7 +11573,7 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) { tmp = valuePop(ctxt); if (tmp != NULL) { if (tmp != init) - stack++; + stack++; xmlXPathFreeObject(tmp); } } while (tmp != NULL); @@ -11669,21 +11669,21 @@ xmlXPathEvalExpression(const xmlChar *str, xmlXPathContextPtr ctxt) { * If $escape-reserved is false, the behavior differs in that characters * referred to in [RFC 2396] as reserved characters are not escaped. These * characters are ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ",". - * + * * [RFC 2396] does not define whether escaped URIs should use lower case or * upper case for hexadecimal digits. To ensure that escaped URIs can be * compared using string comparison functions, this function must always use * the upper-case letters A-F. - * + * * Generally, $escape-reserved should be set to true when escaping a string * that is to form a single part of a URI, and to false when escaping an * entire URI or URI reference. - * - * In the case of non-ascii characters, the string is encoded according to + * + * In the case of non-ascii characters, the string is encoded according to * utf-8 and then converted according to RFC 2396. * * Examples - * xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), true()) + * xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), true()) * returns "gopher%3A%2F%2Fspinaltap.micro.umn.edu%2F00%2FWeather%2FCalifornia%2FLos%20Angeles%23ocean" * xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), false()) * returns "gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles%23ocean" @@ -11696,28 +11696,28 @@ xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlBufferPtr target; xmlChar *cptr; xmlChar escape[4]; - + CHECK_ARITY(2); - + escape_reserved = xmlXPathPopBoolean(ctxt); - + CAST_TO_STRING; str = valuePop(ctxt); - + target = xmlBufferCreate(); - + escape[0] = '%'; escape[3] = 0; - + if (target) { for (cptr = str->stringval; *cptr; cptr++) { if ((*cptr >= 'A' && *cptr <= 'Z') || (*cptr >= 'a' && *cptr <= 'z') || (*cptr >= '0' && *cptr <= '9') || - *cptr == '-' || *cptr == '_' || *cptr == '.' || + *cptr == '-' || *cptr == '_' || *cptr == '.' || *cptr == '!' || *cptr == '~' || *cptr == '*' || *cptr == '\''|| *cptr == '(' || *cptr == ')' || - (*cptr == '%' && + (*cptr == '%' && ((cptr[1] >= 'A' && cptr[1] <= 'F') || (cptr[1] >= 'a' && cptr[1] <= 'f') || (cptr[1] >= '0' && cptr[1] <= '9')) && @@ -11739,7 +11739,7 @@ xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) { escape[2] = '0' + (*cptr & 0xF); else escape[2] = 'A' - 10 + (*cptr & 0xF); - + xmlBufferAdd(target, &escape[0], 3); } } diff --git a/reactos/lib/3rdparty/libxml2/xpointer.c b/reactos/lib/3rdparty/libxml2/xpointer.c index 84c80c3a60b..fc003a4224b 100644 --- a/reactos/lib/3rdparty/libxml2/xpointer.c +++ b/reactos/lib/3rdparty/libxml2/xpointer.c @@ -7,7 +7,7 @@ * * Added support for the element() scheme described in: * W3C Proposed Recommendation 13 November 2002 - * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ + * http://www.w3.org/TR/2002/PR-xptr-element-20021113/ * * See Copyright for the status of this software. * @@ -134,7 +134,7 @@ xmlNodePtr xmlXPtrAdvanceNode(xmlNodePtr cur, int *level); static int xmlXPtrGetArity(xmlNodePtr cur) { int i; - if (cur == NULL) + if (cur == NULL) return(-1); cur = cur->children; for (i = 0;cur != NULL;cur = cur->next) { @@ -157,7 +157,7 @@ xmlXPtrGetArity(xmlNodePtr cur) { static int xmlXPtrGetIndex(xmlNodePtr cur) { int i; - if (cur == NULL) + if (cur == NULL) return(-1); for (i = 1;cur != NULL;cur = cur->prev) { if ((cur->type == XML_ELEMENT_NODE) || @@ -179,11 +179,11 @@ xmlXPtrGetIndex(xmlNodePtr cur) { static xmlNodePtr xmlXPtrGetNthChild(xmlNodePtr cur, int no) { int i; - if (cur == NULL) + if (cur == NULL) return(cur); cur = cur->children; for (i = 0;i <= no;cur = cur->next) { - if (cur == NULL) + if (cur == NULL) return(cur); if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_DOCUMENT_NODE) || @@ -553,7 +553,7 @@ xmlXPtrNewRangeNodeObject(xmlNodePtr start, xmlXPathObjectPtr end) { break; case XPATH_NODESET: /* - * Empty set ... + * Empty set ... */ if (end->nodesetval->nodeNr <= 0) return(NULL); @@ -731,7 +731,7 @@ xmlXPtrLocationSetDel(xmlLocationSetPtr cur, xmlXPathObjectPtr val) { if (i >= cur->locNr) { #ifdef DEBUG - xmlGenericError(xmlGenericErrorContext, + xmlGenericError(xmlGenericErrorContext, "xmlXPtrLocationSetDel: Range wasn't found in RangeList\n"); #endif return; @@ -945,7 +945,7 @@ xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) { * xmlXPtrEvalXPtrPart: * @ctxt: the XPointer Parser context * @name: the preparsed Scheme for the XPtrPart - * + * * XPtrPart ::= 'xpointer' '(' XPtrExpr ')' * | Scheme '(' SchemeSpecificExpr ')' * @@ -953,7 +953,7 @@ xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) { * * SchemeSpecificExpr ::= StringWithBalancedParens * - * StringWithBalancedParens ::= + * StringWithBalancedParens ::= * [^()]* ('(' StringWithBalancedParens ')' [^()]*)* * [VC: Parenthesis escaping] * @@ -971,7 +971,7 @@ xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) { * * Parse and evaluate an XPtrPart. Basically it generates the unescaped * string and if the scheme is 'xpointer' it will call the XPath interpreter. - * + * * TODO: there is no new scheme registration mechanism */ @@ -1104,7 +1104,7 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) { xmlFree(name); XP_ERROR(XPATH_MEMORY_ERROR); } - + xmlXPathRegisterNs(ctxt->context, prefix, URI); CUR_PTR = left; xmlFree(URI); @@ -1234,7 +1234,7 @@ xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) { while (CUR == '/') { int child = 0; NEXT; - + while ((CUR >= '0') && (CUR <= '9')) { child = child * 10 + (CUR - '0'); NEXT; @@ -1258,7 +1258,7 @@ static void xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) { if (ctxt->valueTab == NULL) { /* Allocate the value stack */ - ctxt->valueTab = (xmlXPathObjectPtr *) + ctxt->valueTab = (xmlXPathObjectPtr *) xmlMalloc(10 * sizeof(xmlXPathObjectPtr)); if (ctxt->valueTab == NULL) { xmlXPtrErrMemory("allocating evaluation context"); @@ -1393,13 +1393,13 @@ xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) { /* * Evaluation may push a root nodeset which is unused */ - xmlNodeSetPtr set; + xmlNodeSetPtr set; set = tmp->nodesetval; if ((set->nodeNr != 1) || (set->nodeTab[0] != (xmlNodePtr) ctx->doc)) stack++; } else - stack++; + stack++; } xmlXPathFreeObject(tmp); } @@ -1413,7 +1413,7 @@ xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) { xmlXPathFreeObject(res); res = NULL; } - + xmlXPathFreeParserContext(ctxt); return(res); } @@ -1475,7 +1475,7 @@ xmlXPtrBuildRangeNodeList(xmlXPathObjectPtr range) { /* prune and return full set */ if (last != NULL) xmlAddNextSibling(last, tmp); - else + else xmlAddChild(parent, tmp); return(list); } else { @@ -1729,7 +1729,7 @@ xmlXPtrNbLocChildren(xmlNodePtr node) { * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing here() operation + * Function implementing here() operation * as described in 5.4.3 */ void @@ -1738,7 +1738,7 @@ xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs) { if (ctxt->context->here == NULL) XP_ERROR(XPTR_SYNTAX_ERROR); - + valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->here, NULL)); } @@ -1747,7 +1747,7 @@ xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs) { * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing origin() operation + * Function implementing origin() operation * as described in 5.4.3 */ void @@ -1756,7 +1756,7 @@ xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs) { if (ctxt->context->origin == NULL) XP_ERROR(XPTR_SYNTAX_ERROR); - + valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->origin, NULL)); } @@ -1765,7 +1765,7 @@ xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs) { * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing start-point() operation + * Function implementing start-point() operation * as described in 5.4.3 * ---------------- * location-set start-point(location-set) @@ -1857,7 +1857,7 @@ xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs) { * @ctxt: the XPointer Parser context * @nargs: the number of args * - * Function implementing end-point() operation + * Function implementing end-point() operation * as described in 5.4.3 * ---------------------------- * location-set end-point(location-set) @@ -1993,7 +1993,7 @@ xmlXPtrCoveringRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) { case XML_NOTATION_NODE: case XML_HTML_DOCUMENT_NODE: { int indx = xmlXPtrGetIndex(node); - + node = node->parent; return(xmlXPtrNewRange(node, indx - 1, node, indx + 1)); @@ -2240,7 +2240,7 @@ xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt, int nargs) { cur = ctxt->cur; newset = xmlXPtrLocationSetCreate(NULL); - + for (i = 0; i < oldset->nodeNr; i++) { ctxt->cur = cur; @@ -2274,7 +2274,7 @@ xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt, int nargs) { res = valuePop(ctxt); xmlXPathFreeObject(res); } - + ctxt->context->node = NULL; } @@ -2294,7 +2294,7 @@ xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt, int nargs) { * @level: incremented/decremented to show level in tree * * Advance to the next element or text node in document order - * TODO: add a stack for entering/exiting entities + * TODO: add a stack for entering/exiting entities * * Returns -1 in case of failure, 0 otherwise */ @@ -2397,7 +2397,7 @@ xmlXPtrAdvanceChar(xmlNodePtr *node, int *indx, int bytes) { return(0); } /* - * We should have a text (or cdata) node ... + * We should have a text (or cdata) node ... */ len = 0; if ((cur->type != XML_ELEMENT_NODE) && @@ -2574,7 +2574,7 @@ xmlXPtrSearchString(const xmlChar *string, xmlNodePtr *start, int *startindex, /* * An empty string is considered to match before each * character of the string-value and after the final - * character. + * character. */ #ifdef DEBUG_RANGES xmlGenericError(xmlGenericErrorContext, @@ -2622,7 +2622,7 @@ xmlXPtrGetLastChar(xmlNodePtr *node, int *indx) { if (cur == NULL) return(-1); - + if ((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_DOCUMENT_NODE) || (cur->type == XML_HTML_DOCUMENT_NODE)) { @@ -2727,7 +2727,7 @@ xmlXPtrGetEndPoint(xmlXPathObjectPtr obj, xmlNodePtr *node, int *indx) { * @nargs: the number of args * * Function implementing the string-range() function - * range as described in 5.4.2 + * range as described in 5.4.2 * * ------------------------------ * [Definition: For each location in the location-set argument, @@ -2891,7 +2891,7 @@ error: * @ctxt: the XPointer Parser context * * [8] Predicate ::= '[' PredicateExpr ']' - * [9] PredicateExpr ::= Expr + * [9] PredicateExpr ::= Expr * * Evaluate a predicate as in xmlXPathEvalPredicate() but for * a Location Set instead of a node set @@ -2940,7 +2940,7 @@ xmlXPtrEvalRangePredicate(xmlXPathParserContextPtr ctxt) { */ cur = ctxt->cur; newset = xmlXPtrLocationSetCreate(NULL); - + for (i = 0; i < oldset->locNr; i++) { ctxt->cur = cur; @@ -2976,7 +2976,7 @@ xmlXPtrEvalRangePredicate(xmlXPathParserContextPtr ctxt) { res = valuePop(ctxt); xmlXPathFreeObject(res); } - + ctxt->context->node = NULL; } diff --git a/reactos/lib/3rdparty/mingw/CRTfmode.c b/reactos/lib/3rdparty/mingw/CRTfmode.c index bf750d94e1c..31c1f63bf21 100644 --- a/reactos/lib/3rdparty/mingw/CRTfmode.c +++ b/reactos/lib/3rdparty/mingw/CRTfmode.c @@ -4,8 +4,8 @@ * This file is a part of the mingw-runtime package. * No warranty is given; refer to the file DISCLAIMER within the package. * - * Include this object to set _CRT_fmode to a state that will cause - * _mingw32_init_fmode to leave all file modes in their default state + * Include this object to set _CRT_fmode to a state that will cause + * _mingw32_init_fmode to leave all file modes in their default state * (basically text mode). * * To use this object include the object file in your link command: diff --git a/reactos/lib/3rdparty/mingw/CRTinit.c b/reactos/lib/3rdparty/mingw/CRTinit.c index bb2304d1dd7..d0a472dbb18 100644 --- a/reactos/lib/3rdparty/mingw/CRTinit.c +++ b/reactos/lib/3rdparty/mingw/CRTinit.c @@ -12,7 +12,7 @@ * * This object file is included as a standard in the link process as provided * by the appropriate GCC frontend. - * + * * To use this object include the object file in your link command: * gcc -o foo.exe foo.o CRTinit.o * diff --git a/reactos/lib/3rdparty/mingw/binmode.c b/reactos/lib/3rdparty/mingw/binmode.c index 1cc3dedbfc8..747bf44551b 100644 --- a/reactos/lib/3rdparty/mingw/binmode.c +++ b/reactos/lib/3rdparty/mingw/binmode.c @@ -2,4 +2,4 @@ /* Set default file mode to binary */ -int _fmode = _O_BINARY; +int _fmode = _O_BINARY; diff --git a/reactos/lib/3rdparty/mingw/cpu_features.c b/reactos/lib/3rdparty/mingw/cpu_features.c index b730cc11a9a..cc901d77f50 100644 --- a/reactos/lib/3rdparty/mingw/cpu_features.c +++ b/reactos/lib/3rdparty/mingw/cpu_features.c @@ -7,7 +7,7 @@ #define EDX_MMX (1 << 23) #define EDX_FXSR (1 << 24) /* FXSAVE and FXRSTOR */ #define EDX_SSE (1 << 25) -#define EDX_SSE2 (1 << 26) +#define EDX_SSE2 (1 << 26) /* level 1 ecx bits */ #define ECX_SSE3 (1 << 0) @@ -23,7 +23,7 @@ : "=a" (a), "=b" (b), "=c" (c), "=d" (d)\ : "0" (level)) -/* Combine the different cpuid flags into a single bitmap. */ +/* Combine the different cpuid flags into a single bitmap. */ unsigned int __cpu_features = 0; @@ -56,7 +56,7 @@ void __cpu_features_init (void) if (edx & EDX_MMX) __cpu_features |= _CRT_MMX; if (edx & EDX_FXSR) - __cpu_features |= _CRT_FXSR; + __cpu_features |= _CRT_FXSR; if (edx & EDX_SSE) __cpu_features |= _CRT_SSE; if (edx & EDX_SSE2) @@ -73,9 +73,9 @@ void __cpu_features_init (void) return; __cpuid (0x80000001, eax, ebx, ecx, edx); if (edx & EDX_3DNOW); - __cpu_features |= _CRT_3DNOW; + __cpu_features |= _CRT_3DNOW; if (edx & EDX_3DNOWP) - __cpu_features |= _CRT_3DNOWP; + __cpu_features |= _CRT_3DNOWP; #endif } diff --git a/reactos/lib/3rdparty/mingw/crt1.c b/reactos/lib/3rdparty/mingw/crt1.c index a26cd0cb58b..a4fb015d1e4 100644 --- a/reactos/lib/3rdparty/mingw/crt1.c +++ b/reactos/lib/3rdparty/mingw/crt1.c @@ -11,7 +11,7 @@ /* Hide the declaration of _fmode with dllimport attribute in stdlib.h to avoid problems with older GCC. */ -#define __IN_MINGW_RUNTIME +#define __IN_MINGW_RUNTIME #include #include #include @@ -34,7 +34,7 @@ extern void _pei386_runtime_relocator (void); extern int main (int, char **, char **); /* - * Must have the correct app type for MSVCRT. + * Must have the correct app type for MSVCRT. */ #ifdef __MSVCRT__ @@ -50,8 +50,8 @@ void __set_app_type(int); /* Global _fmode for this .exe, not the one in msvcrt.dll, The default is set in txtmode.o in libmingw32.a */ /* Override the dllimport'd declarations in stdlib.h */ -#undef _fmode -extern int _fmode; +#undef _fmode +extern int _fmode; #ifdef __MSVCRT__ extern int* __p__fmode(void); /* To access the dll _fmode */ #endif @@ -93,7 +93,7 @@ _mingw32_init_fmode (void) /* Now sync the dll _fmode to the one for this .exe. */ #ifdef __MSVCRT__ - *__p__fmode() = _fmode; + *__p__fmode() = _fmode; #else *_imp___fmode_dll = _fmode; #endif @@ -192,7 +192,7 @@ __mingw_CRTStartup (void) * Set up the top-level exception handler so that signal handling * works as expected. The mapping between ANSI/POSIX signals and * Win32 SE is not 1-to-1, so caveat emptore. - * + * */ SetUnhandledExceptionFilter (_gnu_exception_handler); @@ -214,7 +214,7 @@ __mingw_CRTStartup (void) * NOTE: DLLs don't do this because that would be rude! */ _mingw32_init_fmode (); - + /* Adust references to dllimported data that have non-zero offsets. */ #if defined(__i386__) _pei386_runtime_relocator (); diff --git a/reactos/lib/3rdparty/mingw/dllcrt1.c b/reactos/lib/3rdparty/mingw/dllcrt1.c index 8101f7133c2..cff2c29a5f0 100644 --- a/reactos/lib/3rdparty/mingw/dllcrt1.c +++ b/reactos/lib/3rdparty/mingw/dllcrt1.c @@ -63,7 +63,7 @@ DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) next_atexit = first_atexit; /* Adust references to dllimported data (from other DLL's) - that have non-zero offsets. */ + that have non-zero offsets. */ _pei386_runtime_relocator (); #ifdef __GNUC__ @@ -72,7 +72,7 @@ DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) as the first entry of the private atexit table we have just initialised */ __main (); - + #endif } @@ -85,7 +85,7 @@ DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) */ bRet = DllMain (hDll, dwReason, lpReserved); - /* Handle case where DllMain returns FALSE on attachment attempt. */ + /* Handle case where DllMain returns FALSE on attachment attempt. */ if ( (dwReason == DLL_PROCESS_ATTACH) && !bRet) { @@ -126,7 +126,7 @@ __dll_exit(void) { p_atexit_fn* __last = next_atexit - 1; while ( __last >= first_atexit ) - { + { if ( *__last != NULL ) { #ifdef DEBUG @@ -141,7 +141,7 @@ __dll_exit(void) first_atexit = NULL ; } /* - Make sure output buffers opened by DllMain or + Make sure output buffers opened by DllMain or atexit-registered functions are flushed before detaching, otherwise we can have problems with redirected output. */ @@ -153,7 +153,7 @@ __dll_exit(void) * Here, we override the exported version of atexit with one that passes the * private table initialised in DllMainCRTStartup to __dllonexit. * That means we have to hide the mscvrt.dll atexit because the - * atexit defined here gets __dllonexit from the same lib. + * atexit defined here gets __dllonexit from the same lib. */ #if 0 @@ -170,7 +170,7 @@ atexit (p_atexit_fn pfn ) /* * Likewise for non-ANSI function _onexit that may be called by - * code in the dll. + * code in the dll. */ _onexit_t diff --git a/reactos/lib/3rdparty/mingw/gccmain.c b/reactos/lib/3rdparty/mingw/gccmain.c index 601d15a1f5e..81c5fdd0891 100644 --- a/reactos/lib/3rdparty/mingw/gccmain.c +++ b/reactos/lib/3rdparty/mingw/gccmain.c @@ -51,7 +51,7 @@ __do_global_ctors (void) ; } - /* + /* * Go through the list backwards calling constructors. */ for (i = nptrs; i >= 1; i--) diff --git a/reactos/lib/3rdparty/mingw/getopt.c b/reactos/lib/3rdparty/mingw/getopt.c index 9c51c8bab70..3b0bfedfec4 100644 --- a/reactos/lib/3rdparty/mingw/getopt.c +++ b/reactos/lib/3rdparty/mingw/getopt.c @@ -129,7 +129,7 @@ int _tgetopt(int argc, _TCHAR * const argv[], const _TCHAR * optstring) else _toptarg = argv[_toptind] + s_nArgChar; } - + /* success */ return _toptopt; } diff --git a/reactos/lib/3rdparty/mingw/init.c b/reactos/lib/3rdparty/mingw/init.c index a30c035f25e..b7af07c8b6a 100644 --- a/reactos/lib/3rdparty/mingw/init.c +++ b/reactos/lib/3rdparty/mingw/init.c @@ -57,7 +57,7 @@ _mingw32_init_mainargs () * Microsoft's runtime provides a function for doing just that. */ #ifdef __MSVCRT__ - (void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob, + (void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob, &start_info); #else /* CRTDLL version */ diff --git a/reactos/lib/3rdparty/mingw/main.c b/reactos/lib/3rdparty/mingw/main.c index 5eeb57044bb..f53ef06a606 100644 --- a/reactos/lib/3rdparty/mingw/main.c +++ b/reactos/lib/3rdparty/mingw/main.c @@ -16,7 +16,7 @@ #define ISSPACE(a) (a == ' ' || a == '\t') -extern int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, +extern int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR szCmdLine, int nShow); int diff --git a/reactos/lib/3rdparty/mingw/tgetopt.h b/reactos/lib/3rdparty/mingw/tgetopt.h index 7f9790955c1..01e0b1ee489 100644 --- a/reactos/lib/3rdparty/mingw/tgetopt.h +++ b/reactos/lib/3rdparty/mingw/tgetopt.h @@ -66,7 +66,7 @@ extern int getopt_long (int argc, char *const *argv, const char *shortopts, extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); -extern int _wgetopt (int argc, wchar_t *const *argv, const wchar_t *shortopts); +extern int _wgetopt (int argc, wchar_t *const *argv, const wchar_t *shortopts); extern int _wgetopt_long (int argc, wchar_t *const *argv, const wchar_t *shortopts, const struct _woption *longopts, int *longind); extern int _wgetopt_long_only (int argc, wchar_t *const *argv, diff --git a/reactos/lib/3rdparty/mingw/wbinmode.c b/reactos/lib/3rdparty/mingw/wbinmode.c index 1cc3dedbfc8..747bf44551b 100644 --- a/reactos/lib/3rdparty/mingw/wbinmode.c +++ b/reactos/lib/3rdparty/mingw/wbinmode.c @@ -2,4 +2,4 @@ /* Set default file mode to binary */ -int _fmode = _O_BINARY; +int _fmode = _O_BINARY; diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c index f2b04ffff3c..df1cec8e3b2 100644 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ b/reactos/lib/3rdparty/mingw/wcrt1.c @@ -11,7 +11,7 @@ /* Hide the declaration of _fmode with dllimport attribute in stdlib.h to avoid problems with older GCC. */ -#define __IN_MINGW_RUNTIME +#define __IN_MINGW_RUNTIME #include #include #include @@ -35,7 +35,7 @@ extern void _pei386_runtime_relocator (void); extern int wmain (int, wchar_t **, wchar_t **); /* - * Must have the correct app type for MSVCRT. + * Must have the correct app type for MSVCRT. */ #ifdef __MSVCRT__ @@ -48,8 +48,8 @@ __MINGW_IMPORT void __set_app_type(int); /* Global _fmode for this .exe, not the one in msvcrt.dll, The default is set in txtmode.o in libmingw32.a */ /* Override the dllimport'd declarations in stdlib.h */ -#undef _fmode -extern int _fmode; +#undef _fmode +extern int _fmode; #ifdef __MSVCRT__ extern int* __p__fmode(void); /* To access the dll _fmode */ #endif @@ -91,7 +91,7 @@ _mingw32_init_fmode (void) /* Now sync the dll _fmode to the one for this .exe. */ #ifdef __MSVCRT__ - *__p__fmode() = _fmode; + *__p__fmode() = _fmode; #else *_imp___fmode_dll = _fmode; #endif @@ -190,7 +190,7 @@ __mingw_wCRTStartup (void) * Set up the top-level exception handler so that signal handling * works as expected. The mapping between ANSI/POSIX signals and * Win32 SE is not 1-to-1, so caveat emptore. - * + * */ SetUnhandledExceptionFilter (_gnu_exception_handler); @@ -212,7 +212,7 @@ __mingw_wCRTStartup (void) * NOTE: DLLs don't do this because that would be rude! */ _mingw32_init_fmode (); - + /* Adust references to dllimported data that have non-zero offsets. */ #if defined(__i386__) _pei386_runtime_relocator (); diff --git a/reactos/lib/3rdparty/mingw/winit.c b/reactos/lib/3rdparty/mingw/winit.c index 4a5917ebeb8..ebe7ea3d15f 100644 --- a/reactos/lib/3rdparty/mingw/winit.c +++ b/reactos/lib/3rdparty/mingw/winit.c @@ -57,7 +57,7 @@ _mingw32_init_wmainargs () * Microsoft's runtime provides a function for doing just that. */ #ifdef __MSVCRT__ - (void) __wgetmainargs (&_argc, &_wargv, &dummy_environ, _CRT_glob, + (void) __wgetmainargs (&_argc, &_wargv, &dummy_environ, _CRT_glob, &start_info); #else #error Cannot build unicode version against crtdll diff --git a/reactos/lib/3rdparty/mingw/wmain.c b/reactos/lib/3rdparty/mingw/wmain.c index f3846b12765..6ae8f54a897 100644 --- a/reactos/lib/3rdparty/mingw/wmain.c +++ b/reactos/lib/3rdparty/mingw/wmain.c @@ -16,7 +16,7 @@ #define ISSPACE(a) (a == ' ' || a == '\t') -extern int PASCAL wWinMain (HINSTANCE hInst, HINSTANCE hPrevInst, +extern int PASCAL wWinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR szCmdLine, int nShow); int diff --git a/reactos/lib/3rdparty/zlib/crc32.h b/reactos/lib/3rdparty/zlib/crc32.h index 8053b6117c0..5de49bc9786 100644 --- a/reactos/lib/3rdparty/zlib/crc32.h +++ b/reactos/lib/3rdparty/zlib/crc32.h @@ -1,441 +1,441 @@ -/* crc32.h -- tables for rapid CRC calculation - * Generated automatically by crc32.c - */ - -local const unsigned long FAR crc_table[TBLS][256] = -{ - { - 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, - 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, - 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, - 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, - 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, - 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, - 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, - 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, - 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, - 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, - 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, - 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, - 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, - 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, - 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, - 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, - 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, - 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, - 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, - 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, - 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, - 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, - 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, - 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, - 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, - 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, - 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, - 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, - 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, - 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, - 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, - 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, - 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, - 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, - 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, - 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, - 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, - 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, - 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, - 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, - 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, - 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, - 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, - 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, - 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, - 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, - 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, - 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, - 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, - 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, - 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, - 0x2d02ef8dUL -#ifdef BYFOUR - }, - { - 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, - 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, - 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, - 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, - 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, - 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, - 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, - 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, - 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, - 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, - 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, - 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, - 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, - 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, - 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, - 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, - 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, - 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, - 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, - 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, - 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, - 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, - 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, - 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, - 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, - 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, - 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, - 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, - 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, - 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, - 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, - 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, - 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, - 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, - 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, - 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, - 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, - 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, - 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, - 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, - 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, - 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, - 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, - 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, - 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, - 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, - 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, - 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, - 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, - 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, - 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, - 0x9324fd72UL - }, - { - 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, - 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, - 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, - 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, - 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, - 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, - 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, - 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, - 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, - 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, - 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, - 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, - 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, - 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, - 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, - 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, - 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, - 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, - 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, - 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, - 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, - 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, - 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, - 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, - 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, - 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, - 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, - 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, - 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, - 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, - 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, - 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, - 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, - 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, - 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, - 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, - 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, - 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, - 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, - 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, - 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, - 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, - 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, - 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, - 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, - 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, - 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, - 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, - 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, - 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, - 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, - 0xbe9834edUL - }, - { - 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, - 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, - 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, - 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, - 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, - 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, - 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, - 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, - 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, - 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, - 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, - 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, - 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, - 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, - 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, - 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, - 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, - 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, - 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, - 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, - 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, - 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, - 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, - 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, - 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, - 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, - 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, - 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, - 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, - 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, - 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, - 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, - 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, - 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, - 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, - 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, - 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, - 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, - 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, - 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, - 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, - 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, - 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, - 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, - 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, - 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, - 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, - 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, - 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, - 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, - 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, - 0xde0506f1UL - }, - { - 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, - 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, - 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, - 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, - 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, - 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, - 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, - 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, - 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, - 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, - 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, - 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, - 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, - 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, - 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, - 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, - 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, - 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, - 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, - 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, - 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, - 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, - 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, - 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, - 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, - 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, - 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, - 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, - 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, - 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, - 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, - 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, - 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, - 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, - 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, - 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, - 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, - 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, - 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, - 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, - 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, - 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, - 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, - 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, - 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, - 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, - 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, - 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, - 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, - 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, - 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, - 0x8def022dUL - }, - { - 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, - 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, - 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, - 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, - 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, - 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, - 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, - 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, - 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, - 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, - 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, - 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, - 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, - 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, - 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, - 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, - 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, - 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, - 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, - 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, - 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, - 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, - 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, - 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, - 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, - 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, - 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, - 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, - 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, - 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, - 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, - 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, - 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, - 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, - 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, - 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, - 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, - 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, - 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, - 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, - 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, - 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, - 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, - 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, - 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, - 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, - 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, - 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, - 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, - 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, - 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, - 0x72fd2493UL - }, - { - 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, - 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, - 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, - 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, - 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, - 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, - 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, - 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, - 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, - 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, - 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, - 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, - 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, - 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, - 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, - 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, - 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, - 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, - 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, - 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, - 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, - 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, - 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, - 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, - 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, - 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, - 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, - 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, - 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, - 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, - 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, - 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, - 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, - 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, - 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, - 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, - 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, - 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, - 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, - 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, - 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, - 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, - 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, - 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, - 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, - 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, - 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, - 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, - 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, - 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, - 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, - 0xed3498beUL - }, - { - 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, - 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, - 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, - 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, - 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, - 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, - 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, - 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, - 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, - 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, - 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, - 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, - 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, - 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, - 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, - 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, - 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, - 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, - 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, - 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, - 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, - 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, - 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, - 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, - 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, - 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, - 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, - 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, - 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, - 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, - 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, - 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, - 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, - 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, - 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, - 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, - 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, - 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, - 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, - 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, - 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, - 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, - 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, - 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, - 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, - 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, - 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, - 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, - 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, - 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, - 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, - 0xf10605deUL -#endif - } -}; +/* crc32.h -- tables for rapid CRC calculation + * Generated automatically by crc32.c + */ + +local const unsigned long FAR crc_table[TBLS][256] = +{ + { + 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, + 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, + 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, + 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, + 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, + 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, + 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, + 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, + 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, + 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, + 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, + 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, + 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, + 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, + 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, + 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, + 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, + 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, + 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, + 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, + 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, + 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, + 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, + 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, + 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, + 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, + 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, + 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, + 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, + 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, + 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, + 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, + 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, + 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, + 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, + 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, + 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, + 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, + 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, + 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, + 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, + 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, + 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, + 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, + 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, + 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, + 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, + 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, + 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, + 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, + 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, + 0x2d02ef8dUL +#ifdef BYFOUR + }, + { + 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, + 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, + 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, + 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, + 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, + 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, + 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, + 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, + 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, + 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, + 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, + 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, + 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, + 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, + 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, + 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, + 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, + 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, + 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, + 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, + 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, + 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, + 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, + 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, + 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, + 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, + 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, + 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, + 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, + 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, + 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, + 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, + 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, + 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, + 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, + 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, + 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, + 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, + 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, + 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, + 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, + 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, + 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, + 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, + 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, + 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, + 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, + 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, + 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, + 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, + 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, + 0x9324fd72UL + }, + { + 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, + 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, + 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, + 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, + 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, + 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, + 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, + 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, + 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, + 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, + 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, + 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, + 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, + 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, + 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, + 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, + 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, + 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, + 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, + 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, + 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, + 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, + 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, + 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, + 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, + 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, + 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, + 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, + 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, + 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, + 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, + 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, + 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, + 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, + 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, + 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, + 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, + 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, + 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, + 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, + 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, + 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, + 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, + 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, + 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, + 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, + 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, + 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, + 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, + 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, + 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, + 0xbe9834edUL + }, + { + 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, + 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, + 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, + 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, + 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, + 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, + 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, + 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, + 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, + 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, + 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, + 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, + 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, + 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, + 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, + 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, + 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, + 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, + 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, + 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, + 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, + 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, + 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, + 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, + 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, + 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, + 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, + 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, + 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, + 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, + 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, + 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, + 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, + 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, + 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, + 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, + 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, + 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, + 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, + 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, + 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, + 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, + 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, + 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, + 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, + 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, + 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, + 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, + 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, + 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, + 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, + 0xde0506f1UL + }, + { + 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, + 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, + 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, + 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, + 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, + 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, + 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, + 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, + 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, + 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, + 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, + 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, + 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, + 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, + 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, + 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, + 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, + 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, + 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, + 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, + 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, + 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, + 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, + 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, + 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, + 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, + 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, + 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, + 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, + 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, + 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, + 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, + 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, + 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, + 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, + 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, + 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, + 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, + 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, + 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, + 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, + 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, + 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, + 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, + 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, + 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, + 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, + 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, + 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, + 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, + 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, + 0x8def022dUL + }, + { + 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, + 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, + 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, + 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, + 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, + 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, + 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, + 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, + 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, + 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, + 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, + 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, + 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, + 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, + 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, + 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, + 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, + 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, + 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, + 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, + 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, + 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, + 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, + 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, + 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, + 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, + 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, + 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, + 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, + 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, + 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, + 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, + 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, + 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, + 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, + 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, + 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, + 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, + 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, + 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, + 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, + 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, + 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, + 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, + 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, + 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, + 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, + 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, + 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, + 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, + 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, + 0x72fd2493UL + }, + { + 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, + 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, + 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, + 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, + 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, + 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, + 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, + 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, + 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, + 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, + 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, + 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, + 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, + 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, + 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, + 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, + 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, + 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, + 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, + 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, + 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, + 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, + 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, + 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, + 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, + 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, + 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, + 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, + 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, + 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, + 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, + 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, + 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, + 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, + 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, + 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, + 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, + 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, + 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, + 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, + 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, + 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, + 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, + 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, + 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, + 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, + 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, + 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, + 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, + 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, + 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, + 0xed3498beUL + }, + { + 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, + 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, + 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, + 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, + 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, + 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, + 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, + 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, + 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, + 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, + 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, + 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, + 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, + 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, + 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, + 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, + 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, + 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, + 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, + 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, + 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, + 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, + 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, + 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, + 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, + 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, + 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, + 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, + 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, + 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, + 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, + 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, + 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, + 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, + 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, + 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, + 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, + 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, + 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, + 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, + 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, + 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, + 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, + 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, + 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, + 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, + 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, + 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, + 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, + 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, + 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, + 0xf10605deUL +#endif + } +}; diff --git a/reactos/lib/3rdparty/zlib/infback.c b/reactos/lib/3rdparty/zlib/infback.c index 455dbc9ee84..1e03e1bab0f 100644 --- a/reactos/lib/3rdparty/zlib/infback.c +++ b/reactos/lib/3rdparty/zlib/infback.c @@ -1,623 +1,623 @@ -/* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - This code is largely copied from inflate.c. Normally either infback.o or - inflate.o would be linked into an application--not both. The interface - with inffast.c is retained so that optimized assembler-coded versions of - inflate_fast() can be used with either inflate.c or infback.c. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); - -/* - strm provides memory allocation functions in zalloc and zfree, or - Z_NULL to use the library memory allocation functions. - - windowBits is in the range 8..15, and window is a user-supplied - window and output buffer that is 2**windowBits bytes. - */ -int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_streamp strm; -int windowBits; -unsigned char FAR *window; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL || window == Z_NULL || - windowBits < 8 || windowBits > 15) - return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *)ZALLOC(strm, 1, - sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - state->dmax = 32768U; - state->wbits = windowBits; - state->wsize = 1U << windowBits; - state->window = window; - state->write = 0; - state->whave = 0; - return Z_OK; -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -/* Macros for inflateBack(): */ - -/* Load returned state from inflate_fast() */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Set state from registers for inflate_fast() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Assure that some input is available. If input is requested, but denied, - then return a Z_BUF_ERROR from inflateBack(). */ -#define PULL() \ - do { \ - if (have == 0) { \ - have = in(in_desc, &next); \ - if (have == 0) { \ - next = Z_NULL; \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflateBack() - with an error if there is no input available. */ -#define PULLBYTE() \ - do { \ - PULL(); \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflateBack() with - an error. */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Assure that some output space is available, by writing out the window - if it's full. If the write fails, return from inflateBack() with a - Z_BUF_ERROR. */ -#define ROOM() \ - do { \ - if (left == 0) { \ - put = state->window; \ - left = state->wsize; \ - state->whave = left; \ - if (out(out_desc, put, left)) { \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* - strm provides the memory allocation functions and window buffer on input, - and provides information on the unused input on return. For Z_DATA_ERROR - returns, strm will also provide an error message. - - in() and out() are the call-back input and output functions. When - inflateBack() needs more input, it calls in(). When inflateBack() has - filled the window with output, or when it completes with data in the - window, it calls out() to write out the data. The application must not - change the provided input until in() is called again or inflateBack() - returns. The application must not change the window/output buffer until - inflateBack() returns. - - in() and out() are called with a descriptor parameter provided in the - inflateBack() call. This parameter can be a structure that provides the - information required to do the read or write, as well as accumulated - information on the input and output such as totals and check values. - - in() should return zero on failure. out() should return non-zero on - failure. If either in() or out() fails, than inflateBack() returns a - Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it - was in() or out() that caused in the error. Otherwise, inflateBack() - returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format - error, or Z_MEM_ERROR if it could not allocate memory for the state. - inflateBack() can also return Z_STREAM_ERROR if the input parameters - are not correct, i.e. strm is Z_NULL or the state was not initialized. - */ -int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_streamp strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - /* Check that the strm exists and that the state was initialized */ - if (strm == Z_NULL || strm->state == Z_NULL) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - - /* Reset the state */ - strm->msg = Z_NULL; - state->mode = TYPE; - state->last = 0; - state->whave = 0; - next = strm->next_in; - have = next != Z_NULL ? strm->avail_in : 0; - hold = 0; - bits = 0; - put = state->window; - left = state->wsize; - - /* Inflate until end of block marked as last */ - for (;;) - switch (state->mode) { - case TYPE: - /* determine and dispatch block type */ - if (state->last) { - BYTEBITS(); - state->mode = DONE; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - - case STORED: - /* get and verify stored block length */ - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - - /* copy stored block from input to output */ - while (state->length != 0) { - copy = state->length; - PULL(); - ROOM(); - if (copy > have) copy = have; - if (copy > left) copy = left; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - - case TABLE: - /* get dynamic table entries descriptor */ - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - - /* get code length code lengths (not a typo) */ - state->have = 0; - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - - /* get length and distance code code lengths */ - state->have = 0; - while (state->have < state->nlen + state->ndist) { - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = (unsigned)(state->lens[state->have - 1]); - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - - case LEN: - /* use inflate_fast() if we have enough input and output */ - if (have >= 6 && left >= 258) { - RESTORE(); - if (state->whave < state->wsize) - state->whave = state->wsize - left; - inflate_fast(strm, state->wsize); - LOAD(); - break; - } - - /* get a literal, length, or end-of-block code */ - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - - /* process literal */ - if (this.op == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - ROOM(); - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - } - - /* process end of block */ - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - - /* invalid code */ - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - - /* length code -- get extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - - /* get distance code */ - for (;;) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - - /* get distance extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } - if (state->offset > state->wsize - (state->whave < state->wsize ? - left : 0)) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - - /* copy match from window to output */ - do { - ROOM(); - copy = state->wsize - state->offset; - if (copy < left) { - from = put + copy; - copy = left - copy; - } - else { - from = put - state->offset; - copy = left; - } - if (copy > state->length) copy = state->length; - state->length -= copy; - left -= copy; - do { - *put++ = *from++; - } while (--copy); - } while (state->length != 0); - break; - - case DONE: - /* inflate stream terminated properly -- write leftover output */ - ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } - goto inf_leave; - - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - - default: /* can't happen, but makes compilers happy */ - ret = Z_STREAM_ERROR; - goto inf_leave; - } - - /* Return unused input */ - inf_leave: - strm->next_in = next; - strm->avail_in = have; - return ret; -} - -int ZEXPORT inflateBackEnd(strm) -z_streamp strm; -{ - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} +/* infback.c -- inflate using a call-back interface + * Copyright (C) 1995-2005 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + This code is largely copied from inflate.c. Normally either infback.o or + inflate.o would be linked into an application--not both. The interface + with inffast.c is retained so that optimized assembler-coded versions of + inflate_fast() can be used with either inflate.c or infback.c. + */ + +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +/* function prototypes */ +local void fixedtables OF((struct inflate_state FAR *state)); + +/* + strm provides memory allocation functions in zalloc and zfree, or + Z_NULL to use the library memory allocation functions. + + windowBits is in the range 8..15, and window is a user-supplied + window and output buffer that is 2**windowBits bytes. + */ +int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) +z_streamp strm; +int windowBits; +unsigned char FAR *window; +const char *version; +int stream_size; +{ + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL || window == Z_NULL || + windowBits < 8 || windowBits > 15) + return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == (free_func)0) strm->zfree = zcfree; + state = (struct inflate_state FAR *)ZALLOC(strm, 1, + sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (struct internal_state FAR *)state; + state->dmax = 32768U; + state->wbits = windowBits; + state->wsize = 1U << windowBits; + state->window = window; + state->write = 0; + state->whave = 0; + return Z_OK; +} + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +local void fixedtables(state) +struct inflate_state FAR *state; +{ +#ifdef BUILDFIXED + static int virgin = 1; + static code *lenfix, *distfix; + static code fixed[544]; + + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + unsigned sym, bits; + static code *next; + + /* literal/length table */ + sym = 0; + while (sym < 144) state->lens[sym++] = 8; + while (sym < 256) state->lens[sym++] = 9; + while (sym < 280) state->lens[sym++] = 7; + while (sym < 288) state->lens[sym++] = 8; + next = fixed; + lenfix = next; + bits = 9; + inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); + + /* distance table */ + sym = 0; + while (sym < 32) state->lens[sym++] = 5; + distfix = next; + bits = 5; + inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); + + /* do this just once */ + virgin = 0; + } +#else /* !BUILDFIXED */ +# include "inffixed.h" +#endif /* BUILDFIXED */ + state->lencode = lenfix; + state->lenbits = 9; + state->distcode = distfix; + state->distbits = 5; +} + +/* Macros for inflateBack(): */ + +/* Load returned state from inflate_fast() */ +#define LOAD() \ + do { \ + put = strm->next_out; \ + left = strm->avail_out; \ + next = strm->next_in; \ + have = strm->avail_in; \ + hold = state->hold; \ + bits = state->bits; \ + } while (0) + +/* Set state from registers for inflate_fast() */ +#define RESTORE() \ + do { \ + strm->next_out = put; \ + strm->avail_out = left; \ + strm->next_in = next; \ + strm->avail_in = have; \ + state->hold = hold; \ + state->bits = bits; \ + } while (0) + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Assure that some input is available. If input is requested, but denied, + then return a Z_BUF_ERROR from inflateBack(). */ +#define PULL() \ + do { \ + if (have == 0) { \ + have = in(in_desc, &next); \ + if (have == 0) { \ + next = Z_NULL; \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflateBack() + with an error if there is no input available. */ +#define PULLBYTE() \ + do { \ + PULL(); \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflateBack() with + an error. */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n < 16) */ +#define BITS(n) \ + ((unsigned)hold & ((1U << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* Assure that some output space is available, by writing out the window + if it's full. If the write fails, return from inflateBack() with a + Z_BUF_ERROR. */ +#define ROOM() \ + do { \ + if (left == 0) { \ + put = state->window; \ + left = state->wsize; \ + state->whave = left; \ + if (out(out_desc, put, left)) { \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* + strm provides the memory allocation functions and window buffer on input, + and provides information on the unused input on return. For Z_DATA_ERROR + returns, strm will also provide an error message. + + in() and out() are the call-back input and output functions. When + inflateBack() needs more input, it calls in(). When inflateBack() has + filled the window with output, or when it completes with data in the + window, it calls out() to write out the data. The application must not + change the provided input until in() is called again or inflateBack() + returns. The application must not change the window/output buffer until + inflateBack() returns. + + in() and out() are called with a descriptor parameter provided in the + inflateBack() call. This parameter can be a structure that provides the + information required to do the read or write, as well as accumulated + information on the input and output such as totals and check values. + + in() should return zero on failure. out() should return non-zero on + failure. If either in() or out() fails, than inflateBack() returns a + Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it + was in() or out() that caused in the error. Otherwise, inflateBack() + returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format + error, or Z_MEM_ERROR if it could not allocate memory for the state. + inflateBack() can also return Z_STREAM_ERROR if the input parameters + are not correct, i.e. strm is Z_NULL or the state was not initialized. + */ +int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) +z_streamp strm; +in_func in; +void FAR *in_desc; +out_func out; +void FAR *out_desc; +{ + struct inflate_state FAR *state; + unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have, left; /* available input and output */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code this; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + /* Check that the strm exists and that the state was initialized */ + if (strm == Z_NULL || strm->state == Z_NULL) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* Reset the state */ + strm->msg = Z_NULL; + state->mode = TYPE; + state->last = 0; + state->whave = 0; + next = strm->next_in; + have = next != Z_NULL ? strm->avail_in : 0; + hold = 0; + bits = 0; + put = state->window; + left = state->wsize; + + /* Inflate until end of block marked as last */ + for (;;) + switch (state->mode) { + case TYPE: + /* determine and dispatch block type */ + if (state->last) { + BYTEBITS(); + state->mode = DONE; + break; + } + NEEDBITS(3); + state->last = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + state->last ? " (last)" : "")); + state->mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + Tracev((stderr, "inflate: fixed codes block%s\n", + state->last ? " (last)" : "")); + state->mode = LEN; /* decode codes */ + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + state->last ? " (last)" : "")); + state->mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + state->mode = BAD; + } + DROPBITS(2); + break; + + case STORED: + /* get and verify stored block length */ + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + state->mode = BAD; + break; + } + state->length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %u\n", + state->length)); + INITBITS(); + + /* copy stored block from input to output */ + while (state->length != 0) { + copy = state->length; + PULL(); + ROOM(); + if (copy > have) copy = have; + if (copy > left) copy = left; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + state->length -= copy; + } + Tracev((stderr, "inflate: stored end\n")); + state->mode = TYPE; + break; + + case TABLE: + /* get dynamic table entries descriptor */ + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); +#ifndef PKZIP_BUG_WORKAROUND + if (state->nlen > 286 || state->ndist > 30) { + strm->msg = (char *)"too many length or distance symbols"; + state->mode = BAD; + break; + } +#endif + Tracev((stderr, "inflate: table sizes ok\n")); + + /* get code length code lengths (not a typo) */ + state->have = 0; + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 7; + ret = inflate_table(CODES, state->lens, 19, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + + /* get length and distance code code lengths */ + state->have = 0; + while (state->have < state->nlen + state->ndist) { + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.val < 16) { + NEEDBITS(this.bits); + DROPBITS(this.bits); + state->lens[state->have++] = this.val; + } + else { + if (this.val == 16) { + NEEDBITS(this.bits + 2); + DROPBITS(this.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + len = (unsigned)(state->lens[state->have - 1]); + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (this.val == 17) { + NEEDBITS(this.bits + 3); + DROPBITS(this.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(this.bits + 7); + DROPBITS(this.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (state->mode == BAD) break; + + /* build code tables */ + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 9; + ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + state->mode = BAD; + break; + } + state->distcode = (code const FAR *)(state->next); + state->distbits = 6; + ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, + &(state->next), &(state->distbits), state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + state->mode = LEN; + + case LEN: + /* use inflate_fast() if we have enough input and output */ + if (have >= 6 && left >= 258) { + RESTORE(); + if (state->whave < state->wsize) + state->whave = state->wsize - left; + inflate_fast(strm, state->wsize); + LOAD(); + break; + } + + /* get a literal, length, or end-of-block code */ + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.op && (this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + state->length = (unsigned)this.val; + + /* process literal */ + if (this.op == 0) { + Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", this.val)); + ROOM(); + *put++ = (unsigned char)(state->length); + left--; + state->mode = LEN; + break; + } + + /* process end of block */ + if (this.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + + /* invalid code */ + if (this.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + + /* length code -- get extra bits, if any */ + state->extra = (unsigned)(this.op) & 15; + if (state->extra != 0) { + NEEDBITS(state->extra); + state->length += BITS(state->extra); + DROPBITS(state->extra); + } + Tracevv((stderr, "inflate: length %u\n", state->length)); + + /* get distance code */ + for (;;) { + this = state->distcode[BITS(state->distbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if ((this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + if (this.op & 64) { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + state->offset = (unsigned)this.val; + + /* get distance extra bits, if any */ + state->extra = (unsigned)(this.op) & 15; + if (state->extra != 0) { + NEEDBITS(state->extra); + state->offset += BITS(state->extra); + DROPBITS(state->extra); + } + if (state->offset > state->wsize - (state->whave < state->wsize ? + left : 0)) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + Tracevv((stderr, "inflate: distance %u\n", state->offset)); + + /* copy match from window to output */ + do { + ROOM(); + copy = state->wsize - state->offset; + if (copy < left) { + from = put + copy; + copy = left - copy; + } + else { + from = put - state->offset; + copy = left; + } + if (copy > state->length) copy = state->length; + state->length -= copy; + left -= copy; + do { + *put++ = *from++; + } while (--copy); + } while (state->length != 0); + break; + + case DONE: + /* inflate stream terminated properly -- write leftover output */ + ret = Z_STREAM_END; + if (left < state->wsize) { + if (out(out_desc, state->window, state->wsize - left)) + ret = Z_BUF_ERROR; + } + goto inf_leave; + + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + + default: /* can't happen, but makes compilers happy */ + ret = Z_STREAM_ERROR; + goto inf_leave; + } + + /* Return unused input */ + inf_leave: + strm->next_in = next; + strm->avail_in = have; + return ret; +} + +int ZEXPORT inflateBackEnd(strm) +z_streamp strm; +{ + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} diff --git a/reactos/lib/3rdparty/zlib/inflate.h b/reactos/lib/3rdparty/zlib/inflate.h index 07bd3e78a7c..fbbc8714321 100644 --- a/reactos/lib/3rdparty/zlib/inflate.h +++ b/reactos/lib/3rdparty/zlib/inflate.h @@ -1,115 +1,115 @@ -/* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer decoding by inflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip decoding - should be left enabled. */ -#ifndef NO_GZIP -# define GUNZIP -#endif - -/* Possible inflate modes between inflate() calls */ -typedef enum { - HEAD, /* i: waiting for magic header */ - FLAGS, /* i: waiting for method and flags (gzip) */ - TIME, /* i: waiting for modification time (gzip) */ - OS, /* i: waiting for extra flags and operating system (gzip) */ - EXLEN, /* i: waiting for extra length (gzip) */ - EXTRA, /* i: waiting for extra bytes (gzip) */ - NAME, /* i: waiting for end of file name (gzip) */ - COMMENT, /* i: waiting for end of comment (gzip) */ - HCRC, /* i: waiting for header crc (gzip) */ - DICTID, /* i: waiting for dictionary check value */ - DICT, /* waiting for inflateSetDictionary() call */ - TYPE, /* i: waiting for type bits, including last-flag bit */ - TYPEDO, /* i: same, but skip check to exit inflate on new block */ - STORED, /* i: waiting for stored size (length and complement) */ - COPY, /* i/o: waiting for input or output to copy stored block */ - TABLE, /* i: waiting for dynamic block table lengths */ - LENLENS, /* i: waiting for code length code lengths */ - CODELENS, /* i: waiting for length/lit and distance code lengths */ - LEN, /* i: waiting for length/lit code */ - LENEXT, /* i: waiting for length extra bits */ - DIST, /* i: waiting for distance code */ - DISTEXT, /* i: waiting for distance extra bits */ - MATCH, /* o: waiting for output space to copy string */ - LIT, /* o: waiting for output space to write literal */ - CHECK, /* i: waiting for 32-bit check value */ - LENGTH, /* i: waiting for 32-bit length (gzip) */ - DONE, /* finished check, done -- remain here until reset */ - BAD, /* got a data error -- remain here until reset */ - MEM, /* got an inflate() memory error -- remain here until reset */ - SYNC /* looking for synchronization bytes to restart inflate() */ -} inflate_mode; - -/* - State transitions between above modes - - - (most modes can go to the BAD or MEM mode -- not shown for clarity) - - Process header: - HEAD -> (gzip) or (zlib) - (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME - NAME -> COMMENT -> HCRC -> TYPE - (zlib) -> DICTID or TYPE - DICTID -> DICT -> TYPE - Read deflate blocks: - TYPE -> STORED or TABLE or LEN or CHECK - STORED -> COPY -> TYPE - TABLE -> LENLENS -> CODELENS -> LEN - Read deflate codes: - LEN -> LENEXT or LIT or TYPE - LENEXT -> DIST -> DISTEXT -> MATCH -> LEN - LIT -> LEN - Process trailer: - CHECK -> LENGTH -> DONE - */ - -/* state maintained between inflate() calls. Approximately 7K bytes. */ -struct inflate_state { - inflate_mode mode; /* current inflate mode */ - int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - int havedict; /* true if dictionary provided */ - int flags; /* gzip header method and flags (0 if zlib) */ - unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ - unsigned long check; /* protected copy of check value */ - unsigned long total; /* protected copy of output count */ - gz_headerp head; /* where to save gzip header information */ - /* sliding window */ - unsigned wbits; /* log base 2 of requested window size */ - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ - /* bit accumulator */ - unsigned long hold; /* input bit accumulator */ - unsigned bits; /* number of bits in "in" */ - /* for string and stored block copying */ - unsigned length; /* literal or length of data to copy */ - unsigned offset; /* distance back to copy string from */ - /* for table and code decoding */ - unsigned extra; /* extra bits needed */ - /* fixed and dynamic code tables */ - code const FAR *lencode; /* starting table for length/literal codes */ - code const FAR *distcode; /* starting table for distance codes */ - unsigned lenbits; /* index bits for lencode */ - unsigned distbits; /* index bits for distcode */ - /* dynamic table building */ - unsigned ncode; /* number of code length code lengths */ - unsigned nlen; /* number of length code lengths */ - unsigned ndist; /* number of distance code lengths */ - unsigned have; /* number of code lengths in lens[] */ - code FAR *next; /* next available space in codes[] */ - unsigned short lens[320]; /* temporary storage for code lengths */ - unsigned short work[288]; /* work area for code table building */ - code codes[ENOUGH]; /* space for code tables */ -}; +/* inflate.h -- internal inflate state definition + * Copyright (C) 1995-2004 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* define NO_GZIP when compiling if you want to disable gzip header and + trailer decoding by inflate(). NO_GZIP would be used to avoid linking in + the crc code when it is not needed. For shared libraries, gzip decoding + should be left enabled. */ +#ifndef NO_GZIP +# define GUNZIP +#endif + +/* Possible inflate modes between inflate() calls */ +typedef enum { + HEAD, /* i: waiting for magic header */ + FLAGS, /* i: waiting for method and flags (gzip) */ + TIME, /* i: waiting for modification time (gzip) */ + OS, /* i: waiting for extra flags and operating system (gzip) */ + EXLEN, /* i: waiting for extra length (gzip) */ + EXTRA, /* i: waiting for extra bytes (gzip) */ + NAME, /* i: waiting for end of file name (gzip) */ + COMMENT, /* i: waiting for end of comment (gzip) */ + HCRC, /* i: waiting for header crc (gzip) */ + DICTID, /* i: waiting for dictionary check value */ + DICT, /* waiting for inflateSetDictionary() call */ + TYPE, /* i: waiting for type bits, including last-flag bit */ + TYPEDO, /* i: same, but skip check to exit inflate on new block */ + STORED, /* i: waiting for stored size (length and complement) */ + COPY, /* i/o: waiting for input or output to copy stored block */ + TABLE, /* i: waiting for dynamic block table lengths */ + LENLENS, /* i: waiting for code length code lengths */ + CODELENS, /* i: waiting for length/lit and distance code lengths */ + LEN, /* i: waiting for length/lit code */ + LENEXT, /* i: waiting for length extra bits */ + DIST, /* i: waiting for distance code */ + DISTEXT, /* i: waiting for distance extra bits */ + MATCH, /* o: waiting for output space to copy string */ + LIT, /* o: waiting for output space to write literal */ + CHECK, /* i: waiting for 32-bit check value */ + LENGTH, /* i: waiting for 32-bit length (gzip) */ + DONE, /* finished check, done -- remain here until reset */ + BAD, /* got a data error -- remain here until reset */ + MEM, /* got an inflate() memory error -- remain here until reset */ + SYNC /* looking for synchronization bytes to restart inflate() */ +} inflate_mode; + +/* + State transitions between above modes - + + (most modes can go to the BAD or MEM mode -- not shown for clarity) + + Process header: + HEAD -> (gzip) or (zlib) + (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME + NAME -> COMMENT -> HCRC -> TYPE + (zlib) -> DICTID or TYPE + DICTID -> DICT -> TYPE + Read deflate blocks: + TYPE -> STORED or TABLE or LEN or CHECK + STORED -> COPY -> TYPE + TABLE -> LENLENS -> CODELENS -> LEN + Read deflate codes: + LEN -> LENEXT or LIT or TYPE + LENEXT -> DIST -> DISTEXT -> MATCH -> LEN + LIT -> LEN + Process trailer: + CHECK -> LENGTH -> DONE + */ + +/* state maintained between inflate() calls. Approximately 7K bytes. */ +struct inflate_state { + inflate_mode mode; /* current inflate mode */ + int last; /* true if processing last block */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + int havedict; /* true if dictionary provided */ + int flags; /* gzip header method and flags (0 if zlib) */ + unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ + unsigned long check; /* protected copy of check value */ + unsigned long total; /* protected copy of output count */ + gz_headerp head; /* where to save gzip header information */ + /* sliding window */ + unsigned wbits; /* log base 2 of requested window size */ + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + /* bit accumulator */ + unsigned long hold; /* input bit accumulator */ + unsigned bits; /* number of bits in "in" */ + /* for string and stored block copying */ + unsigned length; /* literal or length of data to copy */ + unsigned offset; /* distance back to copy string from */ + /* for table and code decoding */ + unsigned extra; /* extra bits needed */ + /* fixed and dynamic code tables */ + code const FAR *lencode; /* starting table for length/literal codes */ + code const FAR *distcode; /* starting table for distance codes */ + unsigned lenbits; /* index bits for lencode */ + unsigned distbits; /* index bits for distcode */ + /* dynamic table building */ + unsigned ncode; /* number of code length code lengths */ + unsigned nlen; /* number of length code lengths */ + unsigned ndist; /* number of distance code lengths */ + unsigned have; /* number of code lengths in lens[] */ + code FAR *next; /* next available space in codes[] */ + unsigned short lens[320]; /* temporary storage for code lengths */ + unsigned short work[288]; /* work area for code table building */ + code codes[ENOUGH]; /* space for code tables */ +}; diff --git a/reactos/lib/3rdparty/zlib/zconf.in.h b/reactos/lib/3rdparty/zlib/zconf.in.h index 03a9431c8be..e3b0c962e3c 100644 --- a/reactos/lib/3rdparty/zlib/zconf.in.h +++ b/reactos/lib/3rdparty/zlib/zconf.in.h @@ -1,332 +1,332 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2005 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define deflateBound z_deflateBound +# define deflatePrime z_deflatePrime +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateCopy z_inflateCopy +# define inflateReset z_inflateReset +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table +# define zError z_zError + +# define alloc_func z_alloc_func +# define free_func z_free_func +# define in_func z_in_func +# define out_func z_out_func +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# ifdef VMS +# include /* for off_t */ +# endif +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +#if defined(__OS400__) +# define NO_vsnprintf +#endif + +#if defined(__MVS__) +# define NO_vsnprintf +# ifdef FAR +# undef FAR +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(deflateBound,"DEBND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(compressBound,"CMBND") +# pragma map(inflate_table,"INTABL") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/reactos/lib/cmlib/cminit.c b/reactos/lib/cmlib/cminit.c index c4013960508..ae28684ece7 100644 --- a/reactos/lib/cmlib/cminit.c +++ b/reactos/lib/cmlib/cminit.c @@ -36,7 +36,7 @@ CmCreateRootNode( KeyCell->ValueList.Count = 0; KeyCell->ValueList.List = HCELL_NULL; KeyCell->SecurityKeyOffset = HCELL_NULL; - KeyCell->ClassNameOffset = HCELL_NULL; + KeyCell->ClassNameOffset = HCELL_NULL; KeyCell->NameSize = (USHORT)NameSize; KeyCell->ClassSize = 0; memcpy(KeyCell->Name, Name, NameSize); @@ -74,7 +74,7 @@ CmpPrepareKey( VOID CMAPI CmPrepareHive( PHHIVE RegistryHive) -{ +{ PCM_KEY_NODE RootCell; RootCell = HvGetCell(RegistryHive, RegistryHive->HiveHeader->RootCell); diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index be49f553b29..7f81164ca3e 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -214,7 +214,7 @@ HvInitialize( IN const /*CONST*/ UNICODE_STRING* FileName); /* NOTE: Can not use CONST here, as this file is used from user-mode too */ -VOID CMAPI +VOID CMAPI HvFree( PHHIVE RegistryHive); diff --git a/reactos/lib/cmlib/hivebin.c b/reactos/lib/cmlib/hivebin.c index 64f524abf51..5563c81ae47 100644 --- a/reactos/lib/cmlib/hivebin.c +++ b/reactos/lib/cmlib/hivebin.c @@ -55,7 +55,7 @@ HvpAddBin( RegistryHive->Storage[Storage].BlockList = BlockList; RegistryHive->Storage[Storage].Length += BlockCount; - + for (i = 0; i < BlockCount; i++) { RegistryHive->Storage[Storage].BlockList[OldBlockListSize + i].Block = diff --git a/reactos/lib/cmlib/hivecell.c b/reactos/lib/cmlib/hivecell.c index b96a793f142..6fcbbb2a505 100644 --- a/reactos/lib/cmlib/hivecell.c +++ b/reactos/lib/cmlib/hivecell.c @@ -391,7 +391,7 @@ HvReallocateCell( NewCell = HvGetCell(RegistryHive, NewCellIndex); RtlCopyMemory(NewCell, OldCell, (SIZE_T)OldCellSize); - + HvFreeCell(RegistryHive, CellIndex); return NewCellIndex; @@ -412,11 +412,11 @@ HvFreeCell( ULONG CellBlock; ASSERT(RegistryHive->ReadOnly == FALSE); - + Free = HvpGetCellHeader(RegistryHive, CellIndex); - ASSERT(Free->Size < 0); - + ASSERT(Free->Size < 0); + Free->Size = -Free->Size; CellType = (CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT; diff --git a/reactos/lib/cmlib/hivedata.h b/reactos/lib/cmlib/hivedata.h index dcc6d836bfc..e0bc947ea02 100644 --- a/reactos/lib/cmlib/hivedata.h +++ b/reactos/lib/cmlib/hivedata.h @@ -65,7 +65,7 @@ typedef struct _HBASE_BLOCK /* Update counter */ ULONG Sequence2; - + /* When this hive file was last modified */ LARGE_INTEGER TimeStamp; diff --git a/reactos/lib/cmlib/hiveinit.c b/reactos/lib/cmlib/hiveinit.c index afb1171ebf0..15f50679759 100644 --- a/reactos/lib/cmlib/hiveinit.c +++ b/reactos/lib/cmlib/hiveinit.c @@ -54,7 +54,7 @@ HvpVerifyHiveHeader( VOID CMAPI HvpFreeHiveBins( PHHIVE Hive) -{ +{ ULONG i; PHBIN Bin; ULONG Storage; @@ -172,7 +172,7 @@ HvpInitializeMemoryHive( * Build a block list from the in-memory chunk and copy the data as * we go. */ - + Hive->Storage[HvStable].Length = (ULONG)(ChunkSize / HV_BLOCK_SIZE) - 1; Hive->Storage[HvStable].BlockList = Hive->Allocate(Hive->Storage[HvStable].Length * @@ -422,7 +422,7 @@ HvLoadHive(IN PHHIVE Hive, * STATUS_NO_MEMORY - A memory allocation failed. * STATUS_REGISTRY_CORRUPT - Registry corruption was detected. * STATUS_SUCCESS - * + * * @see HvFree */ @@ -511,7 +511,7 @@ HvInitialize( * Free all stroage and handles associated with hive descriptor. */ -VOID CMAPI +VOID CMAPI HvFree( PHHIVE RegistryHive) { diff --git a/reactos/lib/cmlib/hivewrt.c b/reactos/lib/cmlib/hivewrt.c index 9262c1d34c1..309c4ba9161 100644 --- a/reactos/lib/cmlib/hivewrt.c +++ b/reactos/lib/cmlib/hivewrt.c @@ -148,7 +148,7 @@ HvpWriteHive( BOOLEAN Success; ASSERT(RegistryHive->ReadOnly == FALSE); - + DPRINT("HvpWriteHive called\n"); if (RegistryHive->HiveHeader->Sequence1 != diff --git a/reactos/lib/drivers/ip/network/memtrack.c b/reactos/lib/drivers/ip/network/memtrack.c index 638174b1062..9fbd823f764 100644 --- a/reactos/lib/drivers/ip/network/memtrack.c +++ b/reactos/lib/drivers/ip/network/memtrack.c @@ -123,7 +123,7 @@ VOID UntrackFL( PCHAR File, DWORD Line, PVOID Thing ) { ExFreeToNPagedLookasideList( &AllocatedObjectsLookasideList, ThingInList ); - + TcpipReleaseSpinLock( &AllocatedObjectsLock, OldIrql ); /* TrackDumpFL( File, Line ); */ return; diff --git a/reactos/lib/drivers/ip/transport/tcp/tcp.c b/reactos/lib/drivers/ip/transport/tcp/tcp.c index ad572cd2ae7..30465bfe1d7 100644 --- a/reactos/lib/drivers/ip/transport/tcp/tcp.c +++ b/reactos/lib/drivers/ip/transport/tcp/tcp.c @@ -832,7 +832,7 @@ VOID TCPRemoveIRP( PCONNECTION_ENDPOINT Endpoint, PIRP Irp ) { Entry != ListHead[i]; Entry = Entry->Flink ) { Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry ); - + if( Bucket->Request.RequestContext == Irp ) { RemoveEntryList( &Bucket->Entry ); break; diff --git a/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h b/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h index 9286fc946b2..f3bad2a3e2e 100644 --- a/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h +++ b/reactos/lib/drivers/oskittcp/include/oskitfreebsd.h @@ -10,7 +10,7 @@ extern void oskittcp_die(const char *file, int line); #define printf DbgPrint -#define vprintf DbgVPrint +#define vprintf DbgVPrint #define ovbcopy(x,y,z) bcopy(x,y,z) #define bzero(x,y) memset(x,0,y) #define bcopy(src,dst,n) memcpy(dst,src,n) diff --git a/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c b/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c index 05997ff3a64..685d590dea3 100644 --- a/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c +++ b/reactos/lib/drivers/oskittcp/oskittcp/uipc_socket.c @@ -839,7 +839,7 @@ soshutdown(so, how) (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0)); return (0); } - + register struct protosw *pr = so->so_proto; how++; diff --git a/reactos/lib/epsapi/enum/drivers.c b/reactos/lib/epsapi/enum/drivers.c index 40aaf685dc3..179b698f15d 100644 --- a/reactos/lib/epsapi/enum/drivers.c +++ b/reactos/lib/epsapi/enum/drivers.c @@ -40,7 +40,7 @@ PsaEnumerateSystemModules(IN PSYSMOD_ENUM_ROUTINE Callback, #endif /* capture the system modules */ Status = PsaCaptureSystemModules(&psmModules); - + if(!NT_SUCCESS(Status)) { break; @@ -60,7 +60,7 @@ PsaEnumerateSystemModules(IN PSYSMOD_ENUM_ROUTINE Callback, #if 0 } #endif - + return Status; } @@ -102,7 +102,7 @@ PsaCaptureSystemModules(OUT PRTL_PROCESS_MODULES *SystemModules) do { PVOID pTmp; - + /* free the buffer, and reallocate it to the new size. RATIONALE: since we ignore the buffer's content at this point, there's no point in a realloc, that could end up copying a large chunk of data we'd discard anyway */ @@ -169,7 +169,7 @@ PsaWalkSystemModules(IN PRTL_PROCESS_MODULES SystemModules, { /* return current module to the callback */ Status = Callback(&(SystemModules->Modules[i]), CallbackContext); - + if(!NT_SUCCESS(Status)) { return Status; @@ -181,7 +181,7 @@ PsaWalkSystemModules(IN PRTL_PROCESS_MODULES SystemModules, PRTL_PROCESS_MODULE_INFORMATION FASTCALL PsaWalkFirstSystemModule(IN PRTL_PROCESS_MODULES SystemModules) -{ +{ return &(SystemModules->Modules[0]); } diff --git a/reactos/lib/epsapi/enum/processes.c b/reactos/lib/epsapi/enum/processes.c index b624979d38a..45ebb595b1e 100644 --- a/reactos/lib/epsapi/enum/processes.c +++ b/reactos/lib/epsapi/enum/processes.c @@ -22,7 +22,7 @@ * - PsaWalkFirstProcess * - PsaWalkNextProcess * - PsaWalkFirstThread - * - PsaWalkNextThread + * - PsaWalkNextThread * - PsaEnumerateProcessesAndThreads * - PsaEnumerateProcesses * - PsaEnumerateThreads @@ -66,16 +66,16 @@ PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESS_INFORMATION *ProcessesAndThrea that could end up copying a large chunk of data we'd discard anyway */ PsaiFree(pInfoBuffer); pTmp = PsaiMalloc(nSize); - + if(pTmp == NULL) { DPRINT(FAILED_WITH_STATUS, "PsaiMalloc", STATUS_NO_MEMORY); Status = STATUS_NO_MEMORY; break; } - + pInfoBuffer = pTmp; - + /* query the information */ Status = NtQuerySystemInformation(SystemProcessInformation, pInfoBuffer, @@ -85,7 +85,7 @@ PsaCaptureProcessesAndThreads(OUT PSYSTEM_PROCESS_INFORMATION *ProcessesAndThrea /* double the buffer size */ nSize *= 2; } while(Status == STATUS_INFO_LENGTH_MISMATCH); - + if(!NT_SUCCESS(Status)) { DPRINT(FAILED_WITH_STATUS, "NtQuerySystemInformation", Status); @@ -109,7 +109,7 @@ PsaWalkProcessesAndThreads(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads, { return STATUS_INVALID_PARAMETER; } - + Status = STATUS_SUCCESS; ProcessesAndThreads = PsaWalkFirstProcess(ProcessesAndThreads); @@ -120,7 +120,7 @@ PsaWalkProcessesAndThreads(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads, if(ProcessCallback) { Status = ProcessCallback(ProcessesAndThreads, ProcessCallbackContext); - + if(!NT_SUCCESS(Status)) { break; @@ -139,7 +139,7 @@ PsaWalkProcessesAndThreads(IN PSYSTEM_PROCESS_INFORMATION ProcessesAndThreads, i++, pCurThread = PsaWalkNextThread(pCurThread)) { Status = ThreadCallback(pCurThread, ThreadCallbackContext); - + if(!NT_SUCCESS(Status)) { goto Bail; @@ -186,7 +186,7 @@ PsaEnumerateProcessesAndThreads(IN PPROC_ENUM_ROUTINE ProcessCallback, Bail: PsaFreeCapture(pInfoBuffer); - + return Status; } diff --git a/reactos/lib/ppcmmu/gdblib.c b/reactos/lib/ppcmmu/gdblib.c index 5cb92c3a20a..d573315ac03 100644 --- a/reactos/lib/ppcmmu/gdblib.c +++ b/reactos/lib/ppcmmu/gdblib.c @@ -120,9 +120,9 @@ extern void setup(char *serport, int baud); char *serport = (char *)0x800003f8; -int isxdigit(int ch) -{ - return +int isxdigit(int ch) +{ + return (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f') || (ch >= '0' && ch <= '9'); @@ -136,7 +136,7 @@ inline void sync() { inline void send(char *serport, char c) { /* Wait for Clear to Send */ while( !(serport[LSR] & 0x20) ) sync(); - + serport[THR] = c; sync(); } @@ -157,7 +157,7 @@ inline char recv(char *serport) { char c; while( !chr(serport) ) sync(); - + c = serport[RCV]; sync(); @@ -248,7 +248,7 @@ void PacketFinish() int i, ch, count = 0; PacketSent = 0; - + SerialWrite('$'); for (i = 0; i < DataOutAddr; i++) { @@ -307,7 +307,7 @@ void marker() { } void GotPacket() { int i, memaddr, memsize; - + Continue = 0; switch (DataInBuffer[DataInAddr++]) { @@ -400,11 +400,11 @@ int SerialInterrupt(int signal, ppc_trap_frame_t *tf) Signal = signal; RegisterSaveArea = tf; - - do + + do { ch = SerialRead(); - + if (ch == 3) /* Break in - tehe */ { Continue = 0; diff --git a/reactos/lib/ppcmmu/ppcmmu.rbuild b/reactos/lib/ppcmmu/ppcmmu.rbuild index 5a3977c5e92..fb70876d083 100644 --- a/reactos/lib/ppcmmu/ppcmmu.rbuild +++ b/reactos/lib/ppcmmu/ppcmmu.rbuild @@ -1,10 +1,10 @@ - - - - . - - - mmuutil.c - - dummy.c - + + + + . + + + mmuutil.c + + dummy.c + diff --git a/reactos/lib/rossym/delete.c b/reactos/lib/rossym/delete.c index cb69cb15267..c97e40c7799 100644 --- a/reactos/lib/rossym/delete.c +++ b/reactos/lib/rossym/delete.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/delete.c * PURPOSE: Free rossym info - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/find.c b/reactos/lib/rossym/find.c index ad913564896..c311e3eed0a 100644 --- a/reactos/lib/rossym/find.c +++ b/reactos/lib/rossym/find.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/find.c * PURPOSE: Find symbol info for an address - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ /* diff --git a/reactos/lib/rossym/fromfile.c b/reactos/lib/rossym/fromfile.c index 1de21055958..b67efbd7aed 100644 --- a/reactos/lib/rossym/fromfile.c +++ b/reactos/lib/rossym/fromfile.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/fromfile.c * PURPOSE: Creating rossym info from a file - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/frommem.c b/reactos/lib/rossym/frommem.c index e7858ac1979..fc5709c7ac9 100644 --- a/reactos/lib/rossym/frommem.c +++ b/reactos/lib/rossym/frommem.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/frommem.c * PURPOSE: Creating rossym info from an in-memory image - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/fromraw.c b/reactos/lib/rossym/fromraw.c index 695191fbf4d..ae484252424 100644 --- a/reactos/lib/rossym/fromraw.c +++ b/reactos/lib/rossym/fromraw.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/frommem.c * PURPOSE: Creating rossym info from an in-memory image - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/getraw.c b/reactos/lib/rossym/getraw.c index c848f2b4461..1f11057a38e 100644 --- a/reactos/lib/rossym/getraw.c +++ b/reactos/lib/rossym/getraw.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/getraw.c * PURPOSE: Convert rossym info to raw external format - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/init.c b/reactos/lib/rossym/init.c index 354b74b2b49..80be79a1ee0 100644 --- a/reactos/lib/rossym/init.c +++ b/reactos/lib/rossym/init.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/data.c * PURPOSE: Definition of external variables - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/initkm.c b/reactos/lib/rossym/initkm.c index 0021537f3b9..db323a57666 100644 --- a/reactos/lib/rossym/initkm.c +++ b/reactos/lib/rossym/initkm.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/initkm.c * PURPOSE: Initialize library for use in kernel mode - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/initum.c b/reactos/lib/rossym/initum.c index 3c67da659e4..c00a13a1e09 100644 --- a/reactos/lib/rossym/initum.c +++ b/reactos/lib/rossym/initum.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/initum.c * PURPOSE: Initialize library for use in user mode - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/rossympriv.h b/reactos/lib/rossym/rossympriv.h index b0b739ac5e9..abccd297128 100644 --- a/reactos/lib/rossym/rossympriv.h +++ b/reactos/lib/rossym/rossympriv.h @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/rossympriv.h * PURPOSE: Private header for rossym - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rossym/zwfile.c b/reactos/lib/rossym/zwfile.c index a208cad06c1..dc89c3e3157 100644 --- a/reactos/lib/rossym/zwfile.c +++ b/reactos/lib/rossym/zwfile.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS kernel * FILE: lib/rossym/zwfile.c * PURPOSE: File I/O using native functions - * + * * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ diff --git a/reactos/lib/rtl/acl.c b/reactos/lib/rtl/acl.c index e1b4a8c3ff6..e8f7fc122d6 100644 --- a/reactos/lib/rtl/acl.c +++ b/reactos/lib/rtl/acl.c @@ -32,7 +32,7 @@ RtlFirstFreeAce(PACL Acl, *Ace = Current; return(TRUE); } - + i = 0; AclEnd = (ULONG_PTR)Acl + Acl->AclSize; do @@ -77,7 +77,7 @@ RtlGetAce(PACL Acl, { return(STATUS_INVALID_PARAMETER); } - + *Ace = (PVOID)((PACE)(Acl + 1)); for (i = 0; i < AceIndex; i++) diff --git a/reactos/lib/rtl/atom.c b/reactos/lib/rtl/atom.c index 7b2412aa199..74e7879185d 100644 --- a/reactos/lib/rtl/atom.c +++ b/reactos/lib/rtl/atom.c @@ -191,7 +191,7 @@ RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable) { PRTL_ATOM_TABLE_ENTRY *CurrentBucket, *LastBucket; PRTL_ATOM_TABLE_ENTRY CurrentEntry, NextEntry; - + DPRINT("RtlDestroyAtomTable (AtomTable %p)\n", AtomTable); if (!RtlpLockAtomTable(AtomTable)) @@ -350,7 +350,7 @@ RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable, if (HashLink != NULL) { ULONG AtomNameLen = wcslen(AtomName); - + if (AtomNameLen > RTL_MAXIMUM_ATOM_LENGTH) { Status = STATUS_INVALID_PARAMETER; @@ -545,7 +545,7 @@ RtlPinAtomInAtomTable(IN PRTL_ATOM_TABLE AtomTable, if (Atom >= 0xC000) { PRTL_ATOM_TABLE_ENTRY Entry; - + RtlpLockAtomTable(AtomTable); Entry = RtlpGetAtomEntry(AtomTable, @@ -597,7 +597,7 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable, { ULONG Length; BOOL Unlock = FALSE; - + union { /* A RTL_ATOM_TABLE_ENTRY has a "WCHAR Name[1]" entry at the end. @@ -631,7 +631,7 @@ RtlQueryAtomInAtomTable(PRTL_ATOM_TABLE AtomTable, if (Entry != NULL && Entry->Atom == (USHORT)Atom) { DPRINT("Atom name: %wZ\n", &Entry->Name); - + if (RefCount != NULL) { *RefCount = Entry->ReferenceCount; @@ -702,9 +702,9 @@ RtlQueryAtomListInAtomTable(IN PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY CurrentEntry; ULONG Atoms = 0; NTSTATUS Status = STATUS_SUCCESS; - + RtlpLockAtomTable(AtomTable); - + LastBucket = AtomTable->Buckets + AtomTable->NumberOfBuckets; for (CurrentBucket = AtomTable->Buckets; CurrentBucket != LastBucket; @@ -730,9 +730,9 @@ RtlQueryAtomListInAtomTable(IN PRTL_ATOM_TABLE AtomTable, CurrentEntry = CurrentEntry->HashLink; } } - + *AtomCount = Atoms; - + RtlpUnlockAtomTable(AtomTable); return Status; diff --git a/reactos/lib/rtl/austin/avl.c b/reactos/lib/rtl/austin/avl.c index 2ac44c7c9b1..d2e10e56776 100644 --- a/reactos/lib/rtl/austin/avl.c +++ b/reactos/lib/rtl/austin/avl.c @@ -68,7 +68,7 @@ void print_tree(udict_t *ud) void avl_init(udict_t *ud) { - ud->BalancedRoot.left = ud->BalancedRoot.right = + ud->BalancedRoot.left = ud->BalancedRoot.right = ud->BalancedRoot.parent = (udict_node_t*) ud->AllocateRoutine(ud, sizeof(udict_node_t)); ud->BalancedRoot.parent->left = ud->BalancedRoot.parent->right = @@ -205,7 +205,7 @@ static int Insert(udict_t *ud, udict_node_t *what, udict_node_t **where, udict_n return 1; /* higher than before */ }/*if*/ else { - result = ud->compare(ud, key(what), key(here)); + result = ud->compare(ud, key(what), key(here)); assert (result != GenericEqual); @@ -357,7 +357,7 @@ int avl_search(udict_t *ud, void *_key, udict_node_t *here, udict_node_t **where if (avl_is_nil(ud, here)) return TableInsertAsLeft; - result = ud->compare(ud, _key, key(here)); + result = ud->compare(ud, _key, key(here)); if (result == EQUAL) { *where = here; @@ -382,7 +382,7 @@ int avl_search(udict_t *ud, void *_key, udict_node_t *here, udict_node_t **where int avl_is_nil(udict_t *ud, udict_node_t *node) { - return tree_null_priv(ud) == node || + return tree_null_priv(ud) == node || &ud->BalancedRoot == node; } @@ -399,7 +399,7 @@ udict_node_t *avl_last(udict_t *ud) udict_node_t *avl_next(udict_t *ud, udict_node_t *prev) { udict_node_t *node = udict_tree_next(ud, prev); - if( node == tree_null_priv(ud) || node == &ud->BalancedRoot ) + if( node == tree_null_priv(ud) || node == &ud->BalancedRoot ) return NULL; else return node; diff --git a/reactos/lib/rtl/austin/avl.h b/reactos/lib/rtl/austin/avl.h index 43f2d9ec48b..9a020635c11 100644 --- a/reactos/lib/rtl/austin/avl.h +++ b/reactos/lib/rtl/austin/avl.h @@ -21,9 +21,9 @@ PRTL_BALANCED_LINKS avl_last(PRTL_AVL_TABLE table); PRTL_BALANCED_LINKS avl_next(PRTL_AVL_TABLE table, PRTL_BALANCED_LINKS node); int avl_search -(PRTL_AVL_TABLE table, - PVOID _key, - PRTL_BALANCED_LINKS node, +(PRTL_AVL_TABLE table, + PVOID _key, + PRTL_BALANCED_LINKS node, PRTL_BALANCED_LINKS *where); diff --git a/reactos/lib/rtl/austin/tree.c b/reactos/lib/rtl/austin/tree.c index 80de160168b..57cc5b44f21 100644 --- a/reactos/lib/rtl/austin/tree.c +++ b/reactos/lib/rtl/austin/tree.c @@ -82,10 +82,10 @@ void udict_tree_delete(udict_t *ud, udict_node_t *node, udict_node_t **pswap, ud assert (node->left == nil || node->right == nil); child = (node->left != nil) ? node->left : node->right; - child->parent = delparent = node->parent; + child->parent = delparent = node->parent; if (node == delparent->left) { - delparent->left = child; + delparent->left = child; } else { assert (node == delparent->right); delparent->right = child; @@ -140,9 +140,9 @@ udict_node_t *udict_tree_lower_bound(udict_t *ud, const void *_key) root = root->left; } else { return root; - } + } } - + return tentative; } @@ -162,9 +162,9 @@ udict_node_t *udict_tree_upper_bound(udict_t *ud, const void *_key) root = root->right; } else { return root; - } + } } - + return tentative; } diff --git a/reactos/lib/rtl/austin/udict.h b/reactos/lib/rtl/austin/udict.h index 033413e1d14..b80e9083ae8 100644 --- a/reactos/lib/rtl/austin/udict.h +++ b/reactos/lib/rtl/austin/udict.h @@ -63,8 +63,8 @@ typedef enum { typedef union { int udict_dummy; - udict_rb_color_t udict_rb_color; - udict_avl_balance_t udict_avl_balance; + udict_rb_color_t udict_rb_color; + udict_avl_balance_t udict_avl_balance; } udict_algdata_t; typedef struct _RTL_BALANCED_LINKS udict_node_t; @@ -82,7 +82,7 @@ typedef struct udict_operations { udict_node_t *(*udict_lookup)(udict_t *, const void *); udict_node_t *(*udict_lower_bound)(udict_t *, const void *); udict_node_t *(*udict_upper_bound)(udict_t *, const void *); - udict_node_t *(*udict_first)(udict_t *); + udict_node_t *(*udict_first)(udict_t *); udict_node_t *(*udict_last)(udict_t *); udict_node_t *(*udict_next)(udict_t *, udict_node_t *); udict_node_t *(*udict_prev)(udict_t *, udict_node_t *); diff --git a/reactos/lib/rtl/bootdata.c b/reactos/lib/rtl/bootdata.c index 2fb992c1156..bfbdff9006e 100644 --- a/reactos/lib/rtl/bootdata.c +++ b/reactos/lib/rtl/bootdata.c @@ -2,7 +2,7 @@ * PROJECT: ReactOS system libraries * PURPOSE: Boot Data implementation * FILE: lib/rtl/bootdata.c - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES *****************************************************************/ @@ -573,7 +573,7 @@ RtlCreateSystemVolumeInformationFolder( AddSep = TRUE; PathLen += sizeof(WCHAR); } - + /* allocate the new string */ NewPath.MaximumLength = (USHORT)PathLen + sizeof(WCHAR); NewPath.Buffer = RtlpAllocateStringMemory(NewPath.MaximumLength, diff --git a/reactos/lib/rtl/generictable.c b/reactos/lib/rtl/generictable.c index 0c4c7a9a33a..508eea3f8f8 100644 --- a/reactos/lib/rtl/generictable.c +++ b/reactos/lib/rtl/generictable.c @@ -531,7 +531,7 @@ RtlLookupElementGenericTableFullAvl(IN PRTL_AVL_TABLE Table, } OurSearchResult = avl_search - (Table, Buffer, + (Table, Buffer, Table->BalancedRoot.LeftChild, &OurNodeOrParent); if(SearchResult) *SearchResult = OurSearchResult; @@ -553,7 +553,7 @@ RtlLookupElementGenericTableAvl(IN PRTL_AVL_TABLE Table, { PRTL_BALANCED_LINKS OurNodeOrParent; TABLE_SEARCH_RESULT OurSearchResult; - return RtlLookupElementGenericTableFullAvl + return RtlLookupElementGenericTableFullAvl (Table, Buffer, (PVOID *)&OurNodeOrParent, &OurSearchResult); } @@ -571,11 +571,11 @@ RtlDeleteElementGenericTableAvl(IN PRTL_AVL_TABLE Table, RtlLookupElementGenericTableFullAvl ( Table, Buffer, (PVOID *)&Node, &Result ); - if( Result == TableFoundNode ) + if( Result == TableFoundNode ) { avl_delete_node(Table, Node); Table->FreeRoutine(Table, Node); - if( Table->NumberGenericTableElements == 0 ) + if( Table->NumberGenericTableElements == 0 ) avl_deinit(Table); return TRUE; } @@ -683,24 +683,24 @@ RtlInsertElementGenericTableFullAvl(IN PRTL_AVL_TABLE Table, *NewElement = FALSE; OurSearchResult = avl_search - (Table, Buffer, + (Table, Buffer, Table->BalancedRoot.LeftChild, &OurNodeOrParent); if(NodeOrParent) *NodeOrParent = OurNodeOrParent; if(SearchResult) *SearchResult = OurSearchResult; - if(OurSearchResult == TableFoundNode) + if(OurSearchResult == TableFoundNode) { RtlDeleteElementGenericTableAvl(Table, Buffer); return RtlInsertElementGenericTableFullAvl - (Table, Buffer, BufferSize, + (Table, Buffer, BufferSize, NewElement, NodeOrParent, SearchResult); } else { - PRTL_BALANCED_LINKS NewNode = + PRTL_BALANCED_LINKS NewNode = Table->AllocateRoutine - (Table, + (Table, BufferSize + sizeof(RTL_BALANCED_LINKS) + BufferSize); if( !NewNode ) return NULL; diff --git a/reactos/lib/rtl/handle.c b/reactos/lib/rtl/handle.c index c6825cea4a8..bbcdcde69b7 100644 --- a/reactos/lib/rtl/handle.c +++ b/reactos/lib/rtl/handle.c @@ -73,7 +73,7 @@ RtlAllocateHandle(PRTL_HANDLE_TABLE HandleTable, /* allocate handle array */ ArraySize = HandleTable->SizeOfHandleTableEntry * HandleTable->MaximumNumberOfHandles; ArrayPointer = NULL; - + /* FIXME - only reserve handles here! */ Status = NtAllocateVirtualMemory(NtCurrentProcess(), (PVOID*)&ArrayPointer, diff --git a/reactos/lib/rtl/largeint.c b/reactos/lib/rtl/largeint.c index ce515e6ff1a..cc7475241ac 100644 --- a/reactos/lib/rtl/largeint.c +++ b/reactos/lib/rtl/largeint.c @@ -2,7 +2,7 @@ * PROJECT: ReactOS system libraries * FILE: lib/rtl/largeint.c * PURPOSE: Large integer operations - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/path.c b/reactos/lib/rtl/path.c index 5bf176fecad..82d33b97cdb 100644 --- a/reactos/lib/rtl/path.c +++ b/reactos/lib/rtl/path.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * FILE: lib/rtl/path.c * PURPOSE: Path and current directory functions - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/powerpc/debug.c b/reactos/lib/rtl/powerpc/debug.c index 984f33785a7..7fcb94f4b1e 100644 --- a/reactos/lib/rtl/powerpc/debug.c +++ b/reactos/lib/rtl/powerpc/debug.c @@ -1,42 +1,42 @@ -#include -#include - -NTKERNELAPI -VOID -DbgBreakPoint() { __asm__("ti 31,0,0"); } - -NTKERNELAPI -VOID -DbgBreakPointWithStatus(ULONG Status) { __asm__("ti 31,0,0"); } - -NTSTATUS -NTAPI -DebugService -(ULONG Service, const void *Buffer, ULONG Length, PVOID Arg1, PVOID Arg2) -{ - NTSTATUS Result; - __asm__("mr 3,%2\n\t" - "mr 4,%3\n\t" - "mr 5,%4\n\t" - "mr 6,%5\n\t" - "mr 7,%6\n\t" - "mr 8,%1\n\t" - "sc\n\t" - "mr %0,3\n\t" : - "=r" (Result) : - "r" (0x10000), - "r" (Service), - "r" (Buffer), - "r" (Length), - "r" (Arg1), - "r" (Arg2) ); - return Result; -} - -NTSTATUS -NTAPI -DebugService2 -(PVOID Arg1, PVOID Arg2, ULONG Service) -{ - return STATUS_SUCCESS; -} +#include +#include + +NTKERNELAPI +VOID +DbgBreakPoint() { __asm__("ti 31,0,0"); } + +NTKERNELAPI +VOID +DbgBreakPointWithStatus(ULONG Status) { __asm__("ti 31,0,0"); } + +NTSTATUS +NTAPI +DebugService +(ULONG Service, const void *Buffer, ULONG Length, PVOID Arg1, PVOID Arg2) +{ + NTSTATUS Result; + __asm__("mr 3,%2\n\t" + "mr 4,%3\n\t" + "mr 5,%4\n\t" + "mr 6,%5\n\t" + "mr 7,%6\n\t" + "mr 8,%1\n\t" + "sc\n\t" + "mr %0,3\n\t" : + "=r" (Result) : + "r" (0x10000), + "r" (Service), + "r" (Buffer), + "r" (Length), + "r" (Arg1), + "r" (Arg2) ); + return Result; +} + +NTSTATUS +NTAPI +DebugService2 +(PVOID Arg1, PVOID Arg2, ULONG Service) +{ + return STATUS_SUCCESS; +} diff --git a/reactos/lib/rtl/powerpc/interlocked.c b/reactos/lib/rtl/powerpc/interlocked.c index b681b2e3e4d..305ccc6e1f4 100644 --- a/reactos/lib/rtl/powerpc/interlocked.c +++ b/reactos/lib/rtl/powerpc/interlocked.c @@ -21,8 +21,8 @@ InterlockedExchangeAdd(LONG volatile *Target, LONG Value) } NTKERNELAPI -LONG -WINAPI +LONG +WINAPI InterlockedCompareExchange (LONG volatile *Destination, LONG Exchange, LONG Comparand) { @@ -53,7 +53,7 @@ PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead) KIRQL OldIrql; static BOOLEAN GLLInit = FALSE; static KSPIN_LOCK GlobalListLock; - + if(!GLLInit) { KeInitializeSpinLock(&GlobalListLock); @@ -86,7 +86,7 @@ InterlockedPushEntrySList } while (InterlockedCompareExchangePointer - (&ListHead->Next.Next, + (&ListHead->Next.Next, ListEntry, PrevValue) != PrevValue); @@ -117,7 +117,7 @@ ExInterlockedCompareExchange64( KeAcquireSpinLock(Lock, &OldIrql); Result = *Destination; - if(*Destination == Result) + if(*Destination == Result) *Destination = *Exchange; KeReleaseSpinLock(Lock, OldIrql); return Result; diff --git a/reactos/lib/rtl/process.c b/reactos/lib/rtl/process.c index c48b1b78a4d..25d68e91f68 100644 --- a/reactos/lib/rtl/process.c +++ b/reactos/lib/rtl/process.c @@ -213,11 +213,11 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName, /* Use us as parent if none other specified */ if (!ParentProcess) ParentProcess = NtCurrentProcess(); - + /* Initialize the Object Attributes */ - InitializeObjectAttributes(&ObjectAttributes, - NULL, - 0, + InitializeObjectAttributes(&ObjectAttributes, + NULL, + 0, NULL, ProcessSecurityDescriptor); diff --git a/reactos/lib/rtl/propvar.c b/reactos/lib/rtl/propvar.c index 2066ef339fc..78c75c438b4 100644 --- a/reactos/lib/rtl/propvar.c +++ b/reactos/lib/rtl/propvar.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * FILE: lib/rtl/propvar.c * PURPOSE: Native properties and variants API - * PROGRAMMER: + * PROGRAMMER: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/qsort.c b/reactos/lib/rtl/qsort.c index c9d7e8379fd..e312250db2c 100644 --- a/reactos/lib/rtl/qsort.c +++ b/reactos/lib/rtl/qsort.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT: + * COPYRIGHT: *- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +35,7 @@ * PROJECT: ReactOS system libraries * PURPOSE: Unicode Conversion Routines * FILE: lib/rtl/qsort.c - * PROGRAMMER: Adapted from CygWin newlib 2000-03-12. + * PROGRAMMER: Adapted from CygWin newlib 2000-03-12. */ #include @@ -68,7 +68,7 @@ swapfunc ( int swaptype ) { - if(swaptype <= 1) + if(swaptype <= 1) swapcode(long, a, b, n) else swapcode(char, a, b, n) @@ -187,7 +187,7 @@ loop: SWAPINIT(a, es); ) { for ( pl = pm; - pl > (char *) a && cmp(pl - es, pl) > 0; + pl > (char *) a && cmp(pl - es, pl) > 0; pl -= es ) { @@ -207,7 +207,7 @@ loop: SWAPINIT(a, es); qsort(a, r / es, es, cmp); } if ((r = pd - pc) > es) - { + { /* Iterate rather than recurse to save stack space */ a = pn - r; n = r / es; diff --git a/reactos/lib/rtl/random.c b/reactos/lib/rtl/random.c index e02a6aacf72..d3a5ed9aa45 100644 --- a/reactos/lib/rtl/random.c +++ b/reactos/lib/rtl/random.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * PURPOSE: Random number generator functions * FILE: lib/rtl/random.c - * PROGRAMMER: + * PROGRAMMER: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/res.c b/reactos/lib/rtl/res.c index 9c51341ff70..900e1efecd0 100644 --- a/reactos/lib/rtl/res.c +++ b/reactos/lib/rtl/res.c @@ -215,7 +215,7 @@ LdrFindResource_U(PVOID BaseAddress, _SEH_TRY { - if (ResourceInfo) + if (ResourceInfo) { DPRINT( "module %p type %ws name %ws lang %04lx level %ld\n", BaseAddress, (LPCWSTR)ResourceInfo->Type, diff --git a/reactos/lib/rtl/sd.c b/reactos/lib/rtl/sd.c index a24ca474234..565c1d043a0 100644 --- a/reactos/lib/rtl/sd.c +++ b/reactos/lib/rtl/sd.c @@ -456,7 +456,7 @@ RtlMakeSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSD, ULONG_PTR Current; PISECURITY_DESCRIPTOR pAbsSD = (PISECURITY_DESCRIPTOR)AbsoluteSD; PISECURITY_DESCRIPTOR_RELATIVE pRelSD = (PISECURITY_DESCRIPTOR_RELATIVE)SelfRelativeSD; - + PAGED_CODE_RTL(); RtlpQuerySecurityDescriptor(pAbsSD, diff --git a/reactos/lib/rtl/sid.c b/reactos/lib/rtl/sid.c index 7f2a49c5afc..700a66b03b4 100644 --- a/reactos/lib/rtl/sid.c +++ b/reactos/lib/rtl/sid.c @@ -116,7 +116,7 @@ RtlEqualSid(IN PSID Sid1_, { return(FALSE); } - + SidLen = RtlLengthSid(Sid1); return RtlCompareMemory(Sid1, Sid2, SidLen) == SidLen; } @@ -394,7 +394,7 @@ RtlConvertSidToUnicodeString(PUNICODE_STRING String, if (Length < String->MaximumLength) String->Buffer[Length / sizeof(WCHAR)] = 0; } - + return STATUS_SUCCESS; } diff --git a/reactos/lib/rtl/splaytree.c b/reactos/lib/rtl/splaytree.c index 817cfb8767b..7b5041f9f13 100644 --- a/reactos/lib/rtl/splaytree.c +++ b/reactos/lib/rtl/splaytree.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * PURPOSE: Splay-Tree implementation * FILE: lib/rtl/splaytree.c - * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) */ /* INCLUDES *****************************************************************/ @@ -204,7 +204,7 @@ RtlSplay(PRTL_SPLAY_LINKS Links) * P becomes N's left child, and G becomes N's right child. * * Finally, if N doesn't have a grandparent node, we simply perform a - * left or right rotation to move it to the root. + * left or right rotation to move it to the root. * * By performing a splay on the node of interest after every operation, * we keep recently accessed nodes near the root and keep the tree @@ -236,7 +236,7 @@ RtlSplay(PRTL_SPLAY_LINKS Links) RtlLeftChild(G) = RtlRightChild(P); /* - * If they exist, update their parent pointers too, + * If they exist, update their parent pointers too, * since they've changed trees. */ if (RtlLeftChild(P)) RtlParent(RtlLeftChild(P)) = P; @@ -297,7 +297,7 @@ RtlSplay(PRTL_SPLAY_LINKS Links) RtlLeftChild(P) = RtlRightChild(N); /* - * If they exist, update their parent pointers too, + * If they exist, update their parent pointers too, * since they've changed trees. */ if (RtlRightChild(G)) RtlParent(RtlRightChild(G)) = G; @@ -378,7 +378,7 @@ RtlSplay(PRTL_SPLAY_LINKS Links) RtlRightChild(P) = RtlLeftChild(N); /* - * If they exist, update their parent pointers too, + * If they exist, update their parent pointers too, * since they've changed trees. */ if (RtlRightChild(G)) RtlParent(RtlRightChild(G)) = G; @@ -439,7 +439,7 @@ RtlSplay(PRTL_SPLAY_LINKS Links) RtlLeftChild(G) = RtlRightChild(N); /* - * If they exist, update their parent pointers too, + * If they exist, update their parent pointers too, * since they've changed trees. */ if (RtlRightChild(P)) RtlParent(RtlRightChild(P)) = P; diff --git a/reactos/lib/rtl/sprintf.c b/reactos/lib/rtl/sprintf.c index 5129dfb4386..c5db46f5333 100644 --- a/reactos/lib/rtl/sprintf.c +++ b/reactos/lib/rtl/sprintf.c @@ -34,9 +34,9 @@ typedef struct { unsigned int sign:1; } double_t; -static +static __inline -int +int _isinf(double __x) { union @@ -49,9 +49,9 @@ _isinf(double __x) return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); } -static +static __inline -int +int _isnan(double __x) { union @@ -115,12 +115,12 @@ number(char * buf, char * end, long long num, int base, int size, int precision, size--; } } - + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { if (base == 16) size -= 2; - - } + + } i = 0; if ((num == 0) && (precision !=0)) tmp[i++] = '0'; @@ -141,7 +141,7 @@ number(char * buf, char * end, long long num, int base, int size, int precision, *buf = sign; ++buf; } - + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { if (base==16) { if (buf <= end) @@ -152,7 +152,7 @@ number(char * buf, char * end, long long num, int base, int size, int precision, ++buf; } } - + if (!(type & LEFT)) { while (size-- > 0) { if (buf <= end) @@ -175,7 +175,7 @@ number(char * buf, char * end, long long num, int base, int size, int precision, *buf = ' '; ++buf; } - + return buf; } @@ -189,10 +189,10 @@ numberf(char * buf, char * end, double num, int base, int size, int precision, i int i; long long x; - /* FIXME - the float version of number is direcly copy of number + /* FIXME + the float version of number is direcly copy of number */ - + digits = (type & LARGE) ? large_digits : small_digits; if (type & LEFT) type &= ~ZEROPAD; @@ -287,7 +287,7 @@ string(char* buf, char* end, const char* s, int len, int field_width, int precis { int i; char c; - + c = (flags & ZEROPAD) ? '0' : ' '; if (s == NULL) @@ -336,9 +336,9 @@ stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int p { int i; char c; - + c = (flags & ZEROPAD) ? '0' : ' '; - + if (sw == NULL) { sw = L""; @@ -388,7 +388,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) int len; unsigned long long num; double _double; - + int base; char *str, *end; const char *s; @@ -401,8 +401,8 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) number of chars for from string */ int qualifier; /* 'h', 'l', 'L', 'I' or 'w' for integer fields */ - /* clear the string buffer with zero so we do not need NULL terment it at end */ - + /* clear the string buffer with zero so we do not need NULL terment it at end */ + str = buf; end = buf + cnt - 1; if (end < buf - 1) { @@ -468,7 +468,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) qualifier = *fmt; fmt += 3; } else if (*fmt == 'I' && *(fmt+1) == '3' && *(fmt+2) == '2') { - qualifier = 'l'; + qualifier = 'l'; fmt += 3; } else if (*fmt == 'F' && *(fmt+1) == 'p') { fmt += 1; @@ -480,7 +480,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) switch (*fmt) { case 'c': /* finished */ - if (qualifier == 'l' || qualifier == 'w') { + if (qualifier == 'l' || qualifier == 'w') { wchar_t sw1[2]; /* print unicode string */ sw1[0] = (wchar_t) va_arg(args, int); @@ -570,8 +570,8 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) case 'p': if ((flags & LARGE) == 0) - flags |= LARGE; - + flags |= LARGE; + if (field_width == -1) { field_width = 2 * sizeof(void *); flags |= ZEROPAD; @@ -591,14 +591,14 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) *ip = (str - buf); } continue; - + /* float number formats - set up the flags and "break" */ case 'e': case 'E': case 'f': case 'g': case 'G': - _double = (double)va_arg(args, double); + _double = (double)va_arg(args, double); if ( _isnan(_double) ) { s = "Nan"; len = 3; @@ -628,10 +628,10 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) } } else { if ( precision == -1 ) - precision = 6; - str = numberf(str, end, (int)_double, base, field_width, precision, flags); + precision = 6; + str = numberf(str, end, (int)_double, base, field_width, precision, flags); } - + continue; @@ -694,7 +694,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) { /* don't write out a null byte if the buf size is zero */ //*end = '\0'; - if (str-buf >cnt ) + if (str-buf >cnt ) { *end = '\0'; } @@ -703,7 +703,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) end++; *end = '\0'; } - + } return str-buf; } diff --git a/reactos/lib/rtl/srw.c b/reactos/lib/rtl/srw.c index 4adaca51b2c..b9283bd3307 100644 --- a/reactos/lib/rtl/srw.c +++ b/reactos/lib/rtl/srw.c @@ -301,7 +301,7 @@ RtlpAcquireSRWLockExclusiveWait(IN OUT PRTL_SRWLOCK SRWLock, } else { - /* The last wait block was removed and/or we're + /* The last wait block was removed and/or we're finally a simple exclusive lock. This means we don't need to wait anymore, we acquired the lock! */ break; @@ -350,7 +350,7 @@ RtlpAcquireSRWLockSharedWait(IN OUT PRTL_SRWLOCK SRWLock, } else { - /* The last wait block was removed and/or we're + /* The last wait block was removed and/or we're finally a simple shared lock. This means we don't need to wait anymore, we acquired the lock! */ break; diff --git a/reactos/lib/rtl/swprintf.c b/reactos/lib/rtl/swprintf.c index f81e1eee1d2..064de5535f4 100644 --- a/reactos/lib/rtl/swprintf.c +++ b/reactos/lib/rtl/swprintf.c @@ -34,9 +34,9 @@ typedef struct { unsigned int sign:1; } double_t; -static +static __inline -int +int _isinf(double __x) { union @@ -49,9 +49,9 @@ _isinf(double __x) return ( x.x->exponent == 0x7ff && ( x.x->mantissah == 0 && x.x->mantissal == 0 )); } -static +static __inline -int +int _isnan(double __x) { union @@ -115,11 +115,11 @@ number(wchar_t * buf, wchar_t * end, long long num, int base, int size, int prec size--; } } - + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { if (base == 16) size -= 2; - } + } i = 0; if ((num == 0) && (precision !=0)) tmp[i++] = L'0'; @@ -140,7 +140,7 @@ number(wchar_t * buf, wchar_t * end, long long num, int base, int size, int prec *buf = sign; ++buf; } - + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { if (base==16) { if (buf <= end) @@ -173,7 +173,7 @@ number(wchar_t * buf, wchar_t * end, long long num, int base, int size, int prec *buf = L' '; ++buf; } - + return buf; } @@ -188,11 +188,11 @@ numberf(wchar_t * buf, wchar_t * end, double num, int base, int size, int precis int i; long long x; - /* FIXME - the float version of number is direcly copy of number + /* FIXME + the float version of number is direcly copy of number */ - - + + digits = (type & LARGE) ? large_digits : small_digits; if (type & LEFT) type &= ~ZEROPAD; @@ -287,7 +287,7 @@ string(wchar_t* buf, wchar_t* end, const char* s, int len, int field_width, int { int i; wchar_t c; - + c = (flags & ZEROPAD) ? L'0' : L' '; if (s == NULL) @@ -336,9 +336,9 @@ stringw(wchar_t* buf, wchar_t* end, const wchar_t* sw, int len, int field_width, { int i; wchar_t c; - + c = (flags & ZEROPAD) ? L'0' : L' '; - + if (sw == NULL) { sw = L""; @@ -466,7 +466,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar qualifier = *fmt; fmt += 3; } else if (*fmt == L'I' && *(fmt+1) == L'3' && *(fmt+2) == L'2') { - qualifier = L'l'; + qualifier = L'l'; fmt += 3; } else if (*fmt == L'F' && *(fmt+1) == L'p') { fmt += 1; @@ -478,7 +478,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar switch (*fmt) { case L'c': - if (qualifier == 'h' || qualifier == 'w') { + if (qualifier == 'h' || qualifier == 'w') { wchar_t sw1[2]; /* print unicode string */ sw1[0] = (wchar_t) va_arg(args, int); @@ -491,7 +491,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar s1[1] = 0; str = string(str, end, (char *)&s1, -1, field_width, precision, flags); } - + continue; case L'C': @@ -569,7 +569,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar case L'p': if ((flags & LARGE) == 0) - flags |= LARGE; + flags |= LARGE; if (field_width == -1) { field_width = 2*sizeof(void *); flags |= ZEROPAD; @@ -596,7 +596,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar case 'g': case 'G': _double = (double)va_arg(args, double); - + if ( _isnan(_double) ) { ss = L"Nan"; len = 3; @@ -626,10 +626,10 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar } } else { if ( precision == -1 ) - precision = 6; - str = numberf(str, end, _double, base, field_width, precision, flags); + precision = 6; + str = numberf(str, end, _double, base, field_width, precision, flags); } - + continue; @@ -655,7 +655,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar case L'u': break; - default: + default: if (*fmt) { if (str <= end) *str = *fmt; @@ -693,7 +693,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar { /* don't write out a null byte if the buf size is zero */ //*end = '\0'; - if (str-buf >cnt ) + if (str-buf >cnt ) { *end = L'\0'; } @@ -702,7 +702,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar end++; *end = L'\0'; } - + } return str-buf; } diff --git a/reactos/lib/rtl/timerqueue.c b/reactos/lib/rtl/timerqueue.c index 7cfb7d66b83..788447ed730 100644 --- a/reactos/lib/rtl/timerqueue.c +++ b/reactos/lib/rtl/timerqueue.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * PURPOSE: Timer Queue implementation * FILE: lib/rtl/timerqueue.c - * PROGRAMMER: + * PROGRAMMER: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index ba393d5958b..90d12a669ab 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -2110,8 +2110,8 @@ RtlDuplicateUnicodeString( } - if ((SourceString->Length == 0) && - (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | + if ((SourceString->Length == 0) && + (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) { DestinationString->Length = 0; diff --git a/reactos/lib/rtl/unicodeprefix.c b/reactos/lib/rtl/unicodeprefix.c index a6424ca7064..92a7ec6a45c 100644 --- a/reactos/lib/rtl/unicodeprefix.c +++ b/reactos/lib/rtl/unicodeprefix.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * PURPOSE: Unicode Prefix implementation * FILE: lib/rtl/unicodeprefix.c - * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) */ /* INCLUDES *****************************************************************/ @@ -133,7 +133,7 @@ CompareUnicodeStrings(IN PUNICODE_STRING Prefix, /* It's not a prefix, and it's shorter, so it's a less */ return GenericLessThan; } - + /* Check if the prefix is longer */ if (PrefixLength > StringLength) return GenericGreaterThan; @@ -202,7 +202,7 @@ RtlFindUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable, */ if (!CaseInsensitiveIndex) { - /* + /* * Check if this entry was a child. We need to return the root, * so if this entry was a child, we'll splay the tree and get * the root, and set the current entry as a child. @@ -257,7 +257,7 @@ RtlFindUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable, /* * If we got here, then we found a non-case-sensitive match, but - * we need to find a case-sensitive match, so we'll just keep + * we need to find a case-sensitive match, so we'll just keep * searching the next tree (NOTE: we need to break out for this). */ break; @@ -367,7 +367,7 @@ RtlInsertUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable, */ PrefixTableEntry->NodeTypeCode = PFX_NTC_CASE_MATCH; PrefixTableEntry->NextPrefixTree = NULL; - + /* Insert it into the circular list */ PrefixTableEntry->CaseMatch = Entry->CaseMatch; Entry->CaseMatch = PrefixTableEntry; diff --git a/reactos/lib/rtl/workitem.c b/reactos/lib/rtl/workitem.c index 5bd05705f8e..1d262933219 100644 --- a/reactos/lib/rtl/workitem.c +++ b/reactos/lib/rtl/workitem.c @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * PURPOSE: Work Item implementation * FILE: lib/rtl/workitem.c - * PROGRAMMER: + * PROGRAMMER: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/sdk/crt/conio/cprintf.c b/reactos/lib/sdk/crt/conio/cprintf.c index bfee8e02de4..b32485db7f6 100644 --- a/reactos/lib/sdk/crt/conio/cprintf.c +++ b/reactos/lib/sdk/crt/conio/cprintf.c @@ -1,9 +1,9 @@ /* - * COPYRIGHT: Winehq + * COPYRIGHT: Winehq * PROJECT: wine * FILE: msvcrt/conio/cprintf.c * PURPOSE: C Runtime - * PROGRAMMER: Magnus Olsen (Imported from wine cvs 2006-05-23) + * PROGRAMMER: Magnus Olsen (Imported from wine cvs 2006-05-23) */ #include @@ -17,7 +17,7 @@ _cprintf(const char *fmt, ...) char buf[2048], *mem = buf; int written, resize = sizeof(buf), retval; va_list valist; - + while ((written = _vsnprintf( mem, resize, fmt, valist )) == -1 || written > resize) { @@ -31,6 +31,6 @@ _cprintf(const char *fmt, ...) va_end(valist); retval = _cputs( mem ); if (mem != buf) - free (mem); + free (mem); return retval; } diff --git a/reactos/lib/sdk/crt/math/s_modf.c b/reactos/lib/sdk/crt/math/s_modf.c index 12decacec7b..72d4f368d36 100644 --- a/reactos/lib/sdk/crt/math/s_modf.c +++ b/reactos/lib/sdk/crt/math/s_modf.c @@ -7,7 +7,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -45,7 +45,7 @@ DESCRIPTION is, if . <[realpart]> = modf(<[val]>, &<[intpart]>); then `<<<[realpart]>+<[intpart]>>>' is the same as <[val]>. <> is identical, save that it takes and returns - <> rather than <> values. + <> rather than <> values. RETURNS The fractional part is returned. Each result has the same @@ -55,13 +55,13 @@ PORTABILITY <> is ANSI C. <> is an extension. QUICKREF - modf ansi pure + modf ansi pure modff - pure */ /* - * modf(double x, double *iptr) + * modf(double x, double *iptr) * return fraction part of x, and return x's integral part in *iptr. * Method: * Bit twiddling. @@ -79,9 +79,9 @@ static const double one = 1.0; #ifdef __IEEE_BIG_ENDIAN -typedef union +typedef union { - struct + struct { __uint32_t msw; __uint32_t lsw; @@ -93,9 +93,9 @@ typedef union #ifdef __IEEE_LITTLE_ENDIAN -typedef union +typedef union { - struct + struct { __uint32_t lsw; __uint32_t msw; diff --git a/reactos/lib/sdk/crt/stdio/fread.c b/reactos/lib/sdk/crt/stdio/fread.c index 0bc11ca8ebf..1142698a4ce 100644 --- a/reactos/lib/sdk/crt/stdio/fread.c +++ b/reactos/lib/sdk/crt/stdio/fread.c @@ -81,8 +81,8 @@ size_t fread(void *vptr, size_t size, size_t count, FILE *iop) } } } - // return count - (to_read/size) - /* FIXME is this formual right ?, I copy the formula from djgpp + // return count - (to_read/size) + /* FIXME is this formual right ?, I copy the formula from djgpp in our to_read or copy ? */ return size != 0 ? count - ((to_read + size - 1) / size) : 0; } diff --git a/reactos/lib/sdk/crt/stdio/ungetc.c b/reactos/lib/sdk/crt/stdio/ungetc.c index ac6c681e170..c3018b904b4 100644 --- a/reactos/lib/sdk/crt/stdio/ungetc.c +++ b/reactos/lib/sdk/crt/stdio/ungetc.c @@ -18,18 +18,18 @@ _TINT _ungettc(_TINT c, FILE *f) if (c == _TEOF) return _TEOF; - + if (f->_ptr == f->_base) { - if (!f->_cnt == 0) + if (!f->_cnt == 0) return _TEOF; } - + fseek(f, -sizeof(_TCHAR), SEEK_CUR); - + if(*(_TCHAR*)f->_ptr != c) *((_TCHAR*)(f->_ptr)) = c; - + return c; } diff --git a/reactos/lib/sdk/crt/stdlib/fcvtbuf.c b/reactos/lib/sdk/crt/stdlib/fcvtbuf.c index 312fc45abaa..9d145be717d 100644 --- a/reactos/lib/sdk/crt/stdlib/fcvtbuf.c +++ b/reactos/lib/sdk/crt/stdlib/fcvtbuf.c @@ -6,7 +6,7 @@ #include // #include -// replace fjgpp fcvtbuf from project http://www.jbox.dk/sanos/source/lib/fcvt.c.html +// replace fjgpp fcvtbuf from project http://www.jbox.dk/sanos/source/lib/fcvt.c.html // with small modification's to match ReactOS arch // Floating point to string conversion routines @@ -16,16 +16,16 @@ // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. +// documentation and/or other materials provided with the distribution. // 3. Neither the name of the project nor the names of its contributors // may be used to endorse or promote products derived from this software -// without specific prior written permission. -// +// without specific prior written permission. +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -35,9 +35,9 @@ // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. -// +// //#include @@ -61,20 +61,20 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int arg = modf(arg, &fi); p1 = &buf[CVTBUFSIZE]; - if (fi != 0) + if (fi != 0) { p1 = &buf[CVTBUFSIZE]; - while (fi != 0) + while (fi != 0) { fj = modf(fi / 10, &fi); *--p1 = (int)((fj + .03) * 10) + '0'; r2++; } while (p1 < &buf[CVTBUFSIZE]) *p++ = *p1++; - } + } else if (arg > 0) { - while ((fj = arg * 10) < 1) + while ((fj = arg * 10) < 1) { arg = fj; r2--; @@ -83,7 +83,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int p1 = &buf[ndigits]; if (eflag == 0) p1 += r2; *decpt = r2; - if (p1 < &buf[0]) + if (p1 < &buf[0]) { buf[0] = '\0'; return buf; @@ -94,23 +94,23 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int arg = modf(arg, &fj); *p++ = (int) fj + '0'; } - if (p1 >= &buf[CVTBUFSIZE]) + if (p1 >= &buf[CVTBUFSIZE]) { buf[CVTBUFSIZE - 1] = '\0'; return buf; } p = p1; *p1 += 5; - while (*p1 > '9') + while (*p1 > '9') { *p1 = '0'; if (p1 > buf) ++*--p1; - else + else { *p1 = '1'; (*decpt)++; - if (eflag == 0) + if (eflag == 0) { if (p > buf) *p = '0'; p++; diff --git a/reactos/lib/sdk/crt/stdlib/itoa.c b/reactos/lib/sdk/crt/stdlib/itoa.c index 3f93f5efe60..d1840aab29d 100644 --- a/reactos/lib/sdk/crt/stdlib/itoa.c +++ b/reactos/lib/sdk/crt/stdlib/itoa.c @@ -111,15 +111,15 @@ char* ultoa(unsigned long value, char* string, int radix) char buffer[33]; char *pos; int digit; - + pos = &buffer[32]; *pos = '\0'; if (string == NULL) { - return NULL; + return NULL; } - + do { digit = value % radix; value = value / radix; diff --git a/reactos/lib/sdk/crt/stdlib/malloc.c b/reactos/lib/sdk/crt/stdlib/malloc.c index 9498f330df4..3c5d98eebf5 100644 --- a/reactos/lib/sdk/crt/stdlib/malloc.c +++ b/reactos/lib/sdk/crt/stdlib/malloc.c @@ -37,10 +37,10 @@ extern HANDLE hHeap; void* malloc(size_t _size) { size_t nSize = ROUND_SIZE(_size); - - if (nSize<_size) - return NULL; - + + if (nSize<_size) + return NULL; + return HeapAlloc(hHeap, 0, nSize); } @@ -56,13 +56,13 @@ void free(void* _ptr) * @implemented */ void* calloc(size_t _nmemb, size_t _size) -{ +{ size_t nSize = _nmemb * _size; size_t cSize = ROUND_SIZE(nSize); - - if ( (_nmemb > ((size_t)-1 / _size)) || (cSize ((size_t)-1 / _size)) || (cSize 1) { diff --git a/reactos/lib/sdk/crt/string/i386/tcscat.h b/reactos/lib/sdk/crt/string/i386/tcscat.h index b13c70e28c6..e50676528d8 100644 --- a/reactos/lib/sdk/crt/string/i386/tcscat.h +++ b/reactos/lib/sdk/crt/string/i386/tcscat.h @@ -18,7 +18,7 @@ _tcscat: repne _tscas _tdec(%edi) -.L1: +.L1: _tlods _tstos test %_treg(a), %_treg(a) diff --git a/reactos/lib/sdk/crt/string/i386/tcscmp.h b/reactos/lib/sdk/crt/string/i386/tcscmp.h index 3e505efa69b..6830a0ba0dc 100644 --- a/reactos/lib/sdk/crt/string/i386/tcscmp.h +++ b/reactos/lib/sdk/crt/string/i386/tcscmp.h @@ -24,7 +24,7 @@ _tcscmp: .L2: sbb %eax, %eax - or $1, %al + or $1, %al .L3: pop %edi diff --git a/reactos/lib/sdk/crt/string/i386/tcscpy.h b/reactos/lib/sdk/crt/string/i386/tcscpy.h index 7b7a0a9c6ee..cb89a43a4a8 100644 --- a/reactos/lib/sdk/crt/string/i386/tcscpy.h +++ b/reactos/lib/sdk/crt/string/i386/tcscpy.h @@ -12,7 +12,7 @@ _tcscpy: mov 0x10(%esp), %esi cld -.L1: +.L1: _tlods _tstos test %_treg(a), %_treg(a) diff --git a/reactos/lib/sdk/crt/string/i386/tcsncat.h b/reactos/lib/sdk/crt/string/i386/tcsncat.h index e551f16b0bd..f7a3b616396 100644 --- a/reactos/lib/sdk/crt/string/i386/tcsncat.h +++ b/reactos/lib/sdk/crt/string/i386/tcsncat.h @@ -19,7 +19,7 @@ _tcsncat: mov 0x14(%esp),%ecx -.L1: +.L1: dec %ecx js .L2 _tlods @@ -32,7 +32,7 @@ _tcsncat: xor %eax, %eax _tstos -.L3: +.L3: mov 0x0C(%esp), %eax pop %edi pop %esi diff --git a/reactos/lib/sdk/crt/string/i386/tcsncmp.h b/reactos/lib/sdk/crt/string/i386/tcsncmp.h index 2d5979e7b09..58a30859e73 100644 --- a/reactos/lib/sdk/crt/string/i386/tcsncmp.h +++ b/reactos/lib/sdk/crt/string/i386/tcsncmp.h @@ -24,13 +24,13 @@ _tcsncmp: test %eax, %eax jne .L1 -.L2: +.L2: xor %eax, %eax jmp .L4 .L3: sbb %eax, %eax - or $1, %al + or $1, %al .L4: pop %edi diff --git a/reactos/lib/sdk/crt/string/i386/tcsncpy.h b/reactos/lib/sdk/crt/string/i386/tcsncpy.h index 3b412984bd2..ed15334d036 100644 --- a/reactos/lib/sdk/crt/string/i386/tcsncpy.h +++ b/reactos/lib/sdk/crt/string/i386/tcsncpy.h @@ -15,7 +15,7 @@ _tcsncpy: xor %eax, %eax cld -.L1: +.L1: dec %ecx js .L2 _tlods diff --git a/reactos/lib/sdk/crt/string/i386/tcsrchr.h b/reactos/lib/sdk/crt/string/i386/tcsrchr.h index cc31893890b..61d3a4dd863 100644 --- a/reactos/lib/sdk/crt/string/i386/tcsrchr.h +++ b/reactos/lib/sdk/crt/string/i386/tcsrchr.h @@ -13,13 +13,13 @@ _tcsrchr: cld mov _tsize, %ecx -.L1: +.L1: _tlods cmp %_treg(a), %_treg(d) jne .L2 mov %esi, %ecx -.L2: +.L2: test %_treg(a), %_treg(a) jnz .L1 diff --git a/reactos/lib/sdk/crt/sys_stat/systime.c b/reactos/lib/sdk/crt/sys_stat/systime.c index 834607bb0b0..fbf938cd135 100644 --- a/reactos/lib/sdk/crt/sys_stat/systime.c +++ b/reactos/lib/sdk/crt/sys_stat/systime.c @@ -22,13 +22,13 @@ unsigned int _getsystime(struct tm* tp) GetLocalTime(&Time); - tp->tm_year = Time.wYear - 1900; - tp->tm_mon = Time.wMonth - 1; - tp->tm_wday = Time.wDayOfWeek; - tp->tm_mday = Time.wDay; - tp->tm_hour = Time.wHour; - tp->tm_min = Time.wMinute; - tp->tm_sec = Time.wSecond; + tp->tm_year = Time.wYear - 1900; + tp->tm_mon = Time.wMonth - 1; + tp->tm_wday = Time.wDayOfWeek; + tp->tm_mday = Time.wDay; + tp->tm_hour = Time.wHour; + tp->tm_min = Time.wMinute; + tp->tm_sec = Time.wSecond; tp->tm_isdst = -1; @@ -50,7 +50,7 @@ unsigned int _getsystime(struct tm* tp) for (i = 0; i <= tp->tm_mon; i++) tp->tm_yday += month[i]; - + return Time.wMilliseconds; } @@ -62,13 +62,13 @@ unsigned int _setsystime(struct tm* tp, unsigned int ms) { SYSTEMTIME Time; - Time.wYear = tp->tm_year + 1900; - Time.wMonth = tp->tm_mon + 1; - Time.wDayOfWeek = tp->tm_wday; - Time.wDay = tp->tm_mday; - Time.wHour = tp->tm_hour; - Time.wMinute = tp->tm_min; - Time.wSecond = tp->tm_sec; + Time.wYear = tp->tm_year + 1900; + Time.wMonth = tp->tm_mon + 1; + Time.wDayOfWeek = tp->tm_wday; + Time.wDay = tp->tm_mday; + Time.wHour = tp->tm_hour; + Time.wMinute = tp->tm_min; + Time.wSecond = tp->tm_sec; Time.wMilliseconds = ms; if (!SetLocalTime(&Time)) diff --git a/reactos/lib/sdk/crt/wine/scanf.c b/reactos/lib/sdk/crt/wine/scanf.c index ad71b074d28..00fa8eb5f95 100644 --- a/reactos/lib/sdk/crt/wine/scanf.c +++ b/reactos/lib/sdk/crt/wine/scanf.c @@ -22,7 +22,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 diff --git a/reactos/lib/sdk/crt/wine/scanf.h b/reactos/lib/sdk/crt/wine/scanf.h index e73719a437c..eb2213884cb 100644 --- a/reactos/lib/sdk/crt/wine/scanf.h +++ b/reactos/lib/sdk/crt/wine/scanf.h @@ -426,9 +426,9 @@ _FUNCTION_ { if (!suppress) { int*n = va_arg(ap, int*); - /* + /* *n = consumed - (nch!=_EOF_); - + FIXME: The above is the Wine version and it doesnt work in ros when %n is at end of input string (return one too many). But does it fail in Wine too?? If so wine also needs fixin. @@ -481,7 +481,7 @@ _FUNCTION_ { if ((*(format - 1)) < *(format + 1)) RtlSetBits(&bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1)); else - RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1)); + RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1)); format++; } else RtlSetBits(&bitMask, *format, 1); diff --git a/reactos/lib/sdk/crt/wine/undname.c b/reactos/lib/sdk/crt/wine/undname.c index bcdb85720cd..fa2a8f88d45 100755 --- a/reactos/lib/sdk/crt/wine/undname.c +++ b/reactos/lib/sdk/crt/wine/undname.c @@ -67,7 +67,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); #define UNDNAME_NO_COMPLEX_TYPE (0x8000) /* How data types modifiers are stored: - * M (in the following definitions) is defined for + * M (in the following definitions) is defined for * 'A', 'B', 'C' and 'D' as follows * {
}: "" * {}: "const " @@ -81,7 +81,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); * in data fields: * same as for arguments and also the following * ?x {}x - * + * */ #define MAX_ARRAY_ELTS 32 @@ -140,7 +140,7 @@ static void* und_alloc(struct parsed_symbol* sym, size_t len) sym->avail_in_first = 0; ptr = (char*)sym->alloc_list + sizeof(void*); } - else + else { if (len > sym->avail_in_first) { @@ -191,7 +191,7 @@ static void str_array_init(struct array* a) * str_array_push * Adding a new string to an array */ -static void str_array_push(struct parsed_symbol* sym, const char* ptr, size_t len, +static void str_array_push(struct parsed_symbol* sym, const char* ptr, size_t len, struct array* a) { assert(ptr); @@ -201,7 +201,7 @@ static void str_array_push(struct parsed_symbol* sym, const char* ptr, size_t le a->elts[a->num] = und_alloc(sym, len + 1); assert(a->elts[a->num]); memcpy(a->elts[a->num], ptr, len); - a->elts[a->num][len] = '\0'; + a->elts[a->num][len] = '\0'; if (++a->num >= a->max) a->max = a->num; { int i; @@ -227,18 +227,18 @@ static char* str_array_get_ref(struct array* cref, unsigned idx) assert(cref); if (cref->start + idx >= cref->max) { - WARN("Out of bounds: %p %d + %d >= %d\n", + WARN("Out of bounds: %p %d + %d >= %d\n", cref, cref->start, idx, cref->max); return NULL; } - TRACE("Returning %p[%d] => %s\n", + TRACE("Returning %p[%d] => %s\n", cref, idx, cref->elts[cref->start + idx]); return cref->elts[cref->start + idx]; } /****************************************************************** * str_printf - * Helper for printf type of command (only %s and %c are implemented) + * Helper for printf type of command (only %s and %c are implemented) * while dynamically allocating the buffer */ static char* str_printf(struct parsed_symbol* sym, const char* format, ...) @@ -305,7 +305,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, * Parses a list of function/method arguments, creates a string corresponding * to the arguments' list. */ -static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_term, +static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_term, char open_char, char close_char) { @@ -333,7 +333,7 @@ static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_t if (!z_term && *sym->current == '@') sym->current++; break; } - str_array_push(sym, str_printf(sym, "%s%s", ct.left, ct.right), -1, + str_array_push(sym, str_printf(sym, "%s%s", ct.left, ct.right), -1, &arg_collect); if (!strcmp(ct.left, "...")) break; } @@ -342,8 +342,8 @@ static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_t */ if (z_term && *sym->current++ != 'Z') return NULL; - if (arg_collect.num == 0 || - (arg_collect.num == 1 && !strcmp(arg_collect.elts[0], "void"))) + if (arg_collect.num == 0 || + (arg_collect.num == 1 && !strcmp(arg_collect.elts[0], "void"))) return str_printf(sym, "%cvoid%c", open_char, close_char); for (i = 1; i < arg_collect.num; i++) { @@ -351,12 +351,12 @@ static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_t } if (close_char == '>' && args_str && args_str[strlen(args_str) - 1] == '>') - args_str = str_printf(sym, "%c%s%s %c", + args_str = str_printf(sym, "%c%s%s %c", open_char, arg_collect.elts[0], args_str, close_char); else - args_str = str_printf(sym, "%c%s%s%c", + args_str = str_printf(sym, "%c%s%s%c", open_char, arg_collect.elts[0], args_str, close_char); - + return args_str; } @@ -400,8 +400,8 @@ static const char* get_modified_type(struct parsed_symbol* sym, char modif) /* Recurse to get the referred-to type */ if (!demangle_datatype(sym, &sub_ct, NULL, FALSE)) return NULL; - ret = str_printf(sym, "%s%s%s%s%s", - sub_ct.left, sub_ct.left && modifier ? " " : NULL, + ret = str_printf(sym, "%s%s%s%s%s", + sub_ct.left, sub_ct.left && modifier ? " " : NULL, modifier, sub_ct.right, str_modif); sym->stack.num = mark; } @@ -433,7 +433,7 @@ static BOOL get_class(struct parsed_symbol* sym) str_array_push(sym, ptr, -1, &sym->stack); break; case '?': - if (*++sym->current == '$') + if (*++sym->current == '$') { const char* name = ++sym->current; char* full = NULL; @@ -469,7 +469,7 @@ static BOOL get_class(struct parsed_symbol* sym) /****************************************************************** * get_class_string - * From an array collected by get_class, constructs the corresponding (allocated) + * From an array collected by get_class, constructs the corresponding (allocated) * string */ static char* get_class_string(struct parsed_symbol* sym, /*const struct array* a, */int start) @@ -504,7 +504,7 @@ static char* get_class_string(struct parsed_symbol* sym, /*const struct array* a * Returns a static string corresponding to the calling convention described * by char 'ch'. Sets export to TRUE iff the calling convention is exported. */ -static BOOL get_calling_convention(struct parsed_symbol* sym, char ch, +static BOOL get_calling_convention(struct parsed_symbol* sym, char ch, const char** call_conv, const char** exported, unsigned flags) { @@ -551,7 +551,7 @@ static BOOL get_calling_convention(struct parsed_symbol* sym, char ch, static const char* get_simple_type(struct parsed_symbol* sym, char c) { const char* type_string; - + switch (c) { case 'C': type_string = "signed char"; break; @@ -579,7 +579,7 @@ static const char* get_simple_type(struct parsed_symbol* sym, char c) static const char* get_extended_type(struct parsed_symbol* sym, char c) { const char* type_string; - + switch (c) { case 'D': type_string = "__int8"; break; @@ -614,7 +614,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, assert(ct); ct->left = ct->right = NULL; - + switch (dt = *sym->current++) { case '_': @@ -640,7 +640,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, if (!get_class(sym) || !(struct_name = get_class_string(sym, mark))) goto done; sym->stack.num = mark; - if (!(sym->flags & UNDNAME_NO_COMPLEX_TYPE)) + if (!(sym->flags & UNDNAME_NO_COMPLEX_TYPE)) { switch (dt) { @@ -674,8 +674,8 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, struct datatype_t sub_ct; unsigned mark = sym->stack.num; - if (!get_calling_convention(sym, *sym->current++, - &call_conv, &exported, + if (!get_calling_convention(sym, *sym->current++, + &call_conv, &exported, sym->flags & ~UNDNAME_NO_ALLOCATION_LANGUAGE) || !demangle_datatype(sym, &sub_ct, pmt_ref, FALSE)) goto done; @@ -684,7 +684,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, if (!args) goto done; sym->stack.num = mark; - ct->left = str_printf(sym, "%s%s (%s*", + ct->left = str_printf(sym, "%s%s (%s*", sub_ct.left, sub_ct.right, call_conv); ct->right = str_printf(sym, ")%s", args); } @@ -752,10 +752,10 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, break; } if (add_pmt && pmt_ref && in_args) - str_array_push(sym, str_printf(sym, "%s%s", ct->left, ct->right), + str_array_push(sym, str_printf(sym, "%s%s", ct->left, ct->right), -1, pmt_ref); done: - + return ct->left != NULL; } @@ -792,7 +792,7 @@ static BOOL handle_data(struct parsed_symbol* sym) case '0': access = "private: "; break; case '1': access = "protected: "; break; case '2': access = "public: "; break; - } + } } if (!(sym->flags & UNDNAME_NO_MEMBER_TYPE)) @@ -833,8 +833,8 @@ static BOOL handle_data(struct parsed_symbol* sym) } if (sym->flags & UNDNAME_NAME_ONLY) ct.left = ct.right = modifier = NULL; sym->result = str_printf(sym, "%s%s%s%s%s%s%s%s", access, - member_type, ct.left, - modifier && ct.left ? " " : NULL, modifier, + member_type, ct.left, + modifier && ct.left ? " " : NULL, modifier, modifier || ct.left ? " " : NULL, name, ct.right); ret = TRUE; done: @@ -924,8 +924,8 @@ static BOOL handle_method(struct parsed_symbol* sym, BOOL cast_op) sym->current++; name = get_class_string(sym, 0); - - if (!get_calling_convention(sym, *sym->current++, + + if (!get_calling_convention(sym, *sym->current++, &call_conv, &exported, sym->flags)) goto done; @@ -960,10 +960,10 @@ static BOOL handle_method(struct parsed_symbol* sym, BOOL cast_op) * Yet!!! FIXME */ sym->result = str_printf(sym, "%s%s%s%s%s%s%s%s%s%s%s%s", - access, member_type, ct_ret.left, + access, member_type, ct_ret.left, (ct_ret.left && !ct_ret.right) ? " " : NULL, call_conv, call_conv ? " " : NULL, exported, - name, args_str, modifier, + name, args_str, modifier, modifier ? " " : NULL, ct_ret.right); ret = TRUE; done: @@ -981,7 +981,7 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) /* MS mangled names always begin with '?' */ if (*sym->current != '?') return FALSE; - + /* FIXME seems wrong as name, as it demangles a simple data type */ if (sym->flags & UNDNAME_NO_ARGUMENTS) { @@ -1137,7 +1137,7 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) ret = handle_method(sym, do_after == 3); else ret = FALSE; done: - if (ret) + if (ret) assert(sym->result); if (!ret) ERR("Failed at %s\n", sym->current); @@ -1171,7 +1171,7 @@ char* __unDNameEx(char* buffer, const char* mangled, int buflen, TRACE("(%p,%s,%d,%p,%p,%p,%x) stub!\n", buffer, mangled, buflen, memget, memfree, unknown, flags); - + /* The flags details is not documented by MS. However, it looks exactly * like the UNDNAME_ manifest constants from imagehlp.h and dbghelp.h * So, we copied those (on top of the file) diff --git a/reactos/lib/sdk/dxguid/dxguid-mingw.c b/reactos/lib/sdk/dxguid/dxguid-mingw.c index 2a1ca95a7be..07a1a95b434 100644 --- a/reactos/lib/sdk/dxguid/dxguid-mingw.c +++ b/reactos/lib/sdk/dxguid/dxguid-mingw.c @@ -20,7 +20,7 @@ DEFINE_GUID(IID_IDsDriver, 0x8C4233C0l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, DEFINE_GUID(IID_IDsDriverNotify, 0x00363EF44, 0x3B57, 0x11D3, 0xAC, 0x79, 0x00, 0x10, 0x5A, 0x01, 0x7f, 0xe1); DEFINE_GUID(IID_IDsDriverPropertySet, 0x0F6F2E8E0, 0xD842, 0x11D0, 0x8F, 0x75, 0x00, 0xC0, 0x4F, 0xC2, 0x8A, 0xCA); DEFINE_GUID(IID_IDsDriverBuffer, 0x8C4233C1l, 0xB4CC, 0x11CE, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); -// +// // ok diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcscat.h b/reactos/lib/sdk/libcntpr/string/i386/tcscat.h index b13c70e28c6..e50676528d8 100644 --- a/reactos/lib/sdk/libcntpr/string/i386/tcscat.h +++ b/reactos/lib/sdk/libcntpr/string/i386/tcscat.h @@ -18,7 +18,7 @@ _tcscat: repne _tscas _tdec(%edi) -.L1: +.L1: _tlods _tstos test %_treg(a), %_treg(a) diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcscmp.h b/reactos/lib/sdk/libcntpr/string/i386/tcscmp.h index 3e505efa69b..6830a0ba0dc 100644 --- a/reactos/lib/sdk/libcntpr/string/i386/tcscmp.h +++ b/reactos/lib/sdk/libcntpr/string/i386/tcscmp.h @@ -24,7 +24,7 @@ _tcscmp: .L2: sbb %eax, %eax - or $1, %al + or $1, %al .L3: pop %edi diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcscpy.h b/reactos/lib/sdk/libcntpr/string/i386/tcscpy.h index 7b7a0a9c6ee..cb89a43a4a8 100644 --- a/reactos/lib/sdk/libcntpr/string/i386/tcscpy.h +++ b/reactos/lib/sdk/libcntpr/string/i386/tcscpy.h @@ -12,7 +12,7 @@ _tcscpy: mov 0x10(%esp), %esi cld -.L1: +.L1: _tlods _tstos test %_treg(a), %_treg(a) diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsncat.h b/reactos/lib/sdk/libcntpr/string/i386/tcsncat.h index e551f16b0bd..f7a3b616396 100644 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsncat.h +++ b/reactos/lib/sdk/libcntpr/string/i386/tcsncat.h @@ -19,7 +19,7 @@ _tcsncat: mov 0x14(%esp),%ecx -.L1: +.L1: dec %ecx js .L2 _tlods @@ -32,7 +32,7 @@ _tcsncat: xor %eax, %eax _tstos -.L3: +.L3: mov 0x0C(%esp), %eax pop %edi pop %esi diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsncmp.h b/reactos/lib/sdk/libcntpr/string/i386/tcsncmp.h index 2d5979e7b09..58a30859e73 100644 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsncmp.h +++ b/reactos/lib/sdk/libcntpr/string/i386/tcsncmp.h @@ -24,13 +24,13 @@ _tcsncmp: test %eax, %eax jne .L1 -.L2: +.L2: xor %eax, %eax jmp .L4 .L3: sbb %eax, %eax - or $1, %al + or $1, %al .L4: pop %edi diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsncpy.h b/reactos/lib/sdk/libcntpr/string/i386/tcsncpy.h index 3b412984bd2..ed15334d036 100644 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsncpy.h +++ b/reactos/lib/sdk/libcntpr/string/i386/tcsncpy.h @@ -15,7 +15,7 @@ _tcsncpy: xor %eax, %eax cld -.L1: +.L1: dec %ecx js .L2 _tlods diff --git a/reactos/lib/sdk/libcntpr/string/i386/tcsrchr.h b/reactos/lib/sdk/libcntpr/string/i386/tcsrchr.h index cc31893890b..61d3a4dd863 100644 --- a/reactos/lib/sdk/libcntpr/string/i386/tcsrchr.h +++ b/reactos/lib/sdk/libcntpr/string/i386/tcsrchr.h @@ -13,13 +13,13 @@ _tcsrchr: cld mov _tsize, %ecx -.L1: +.L1: _tlods cmp %_treg(a), %_treg(d) jne .L2 mov %esi, %ecx -.L2: +.L2: test %_treg(a), %_treg(a) jnz .L1 diff --git a/reactos/lib/sdk/libcntpr/string/itoa.c b/reactos/lib/sdk/libcntpr/string/itoa.c index 391965c8272..cf35ac8a602 100644 --- a/reactos/lib/sdk/libcntpr/string/itoa.c +++ b/reactos/lib/sdk/libcntpr/string/itoa.c @@ -127,7 +127,7 @@ _ltoa(long value, char *string, int radix) /* - * @implemented + * @implemented * copy it from wine 0.9.0 with small modifcations do check for NULL */ char * @@ -136,15 +136,15 @@ _ultoa(unsigned long value, char *string, int radix) char buffer[33]; char *pos; int digit; - + pos = &buffer[32]; *pos = '\0'; if (string == NULL) { - return NULL; + return NULL; } - + do { digit = value % radix; value = value / radix; @@ -156,6 +156,6 @@ _ultoa(unsigned long value, char *string, int radix) } while (value != 0L); memcpy(string, pos, &buffer[32] - pos + 1); - + return string; } diff --git a/reactos/lib/sdk/libcntpr/string/scanf.h b/reactos/lib/sdk/libcntpr/string/scanf.h index c6d06ee069e..25180db20b9 100644 --- a/reactos/lib/sdk/libcntpr/string/scanf.h +++ b/reactos/lib/sdk/libcntpr/string/scanf.h @@ -414,9 +414,9 @@ _FUNCTION_ { if (!suppress) { int*n = va_arg(ap, int*); - /* + /* *n = consumed - (nch!=_EOF_); - + FIXME: The above is the Wine version and it doesnt work in ros when %n is at end of input string (return one too many). But does it fail in Wine too?? If so wine also needs fixin. @@ -469,7 +469,7 @@ _FUNCTION_ { if ((*(format - 1)) < *(format + 1)) RtlSetBits(&bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1)); else - RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1)); + RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1)); format++; } else RtlSetBits(&bitMask, *format, 1); diff --git a/reactos/lib/smlib/compses.c b/reactos/lib/smlib/compses.c index 9a93177ccb1..4897da8bada 100644 --- a/reactos/lib/smlib/compses.c +++ b/reactos/lib/smlib/compses.c @@ -35,7 +35,7 @@ SmCompleteSession (IN HANDLE hSmApiPort, { NTSTATUS Status; SM_PORT_MESSAGE SmReqMsg; - + DPRINT("SMLIB: %s called\n", __FUNCTION__); /* Marshal Ses in the LPC message */ diff --git a/reactos/lib/smlib/connect.c b/reactos/lib/smlib/connect.c index 9f25fcab872..375bf74659b 100644 --- a/reactos/lib/smlib/connect.c +++ b/reactos/lib/smlib/connect.c @@ -34,7 +34,7 @@ * with full parameters (the function checks them); * b) regular SM clients, will set to 0 the 1st, the 2nd, * and the 3rd parameter. - * + * * RETURN VALUE * If all three optional values are omitted, an LPC status. * STATUS_INVALID_PARAMETER_MIX if PortName is defined and diff --git a/reactos/lib/smlib/execpgm.c b/reactos/lib/smlib/execpgm.c index b32c210ec56..3030d4c572c 100644 --- a/reactos/lib/smlib/execpgm.c +++ b/reactos/lib/smlib/execpgm.c @@ -24,7 +24,7 @@ * lookup the image name from the registry). * Valid names are: DEBUG, WINDOWS, POSIX, OS2, * and VMS. - * + * * RETURN VALUE * Success status as handed by the SM reply; otherwise a failure * status code. @@ -51,7 +51,7 @@ SmExecuteProgram (IN HANDLE hSmApiPort, RtlCopyMemory (SmReqMsg.Request.ExecPgm.Name, Pgm->Buffer, Pgm->Length); - + /* SM API to invoke */ SmReqMsg.SmHeader.ApiIndex = SM_API_EXECUTE_PROGRAMME; diff --git a/reactos/lib/smlib/lookupss.c b/reactos/lib/smlib/lookupss.c index d1d994c89c4..9b19886dfcd 100644 --- a/reactos/lib/smlib/lookupss.c +++ b/reactos/lib/smlib/lookupss.c @@ -125,10 +125,10 @@ SmLookupSubsystem (IN PWSTR Name, if(NT_SUCCESS(Status)) { *DataLength = min(*DataLength, Destination.Length); - RtlCopyMemory (Data, Destination.Buffer, *DataLength); + RtlCopyMemory (Data, Destination.Buffer, *DataLength); } RtlFreeHeap (RtlGetProcessHeap(), 0, DestinationBuffer); - } + } }else{ DPRINT("SM: %s: value won't be expanded\n", __FUNCTION__); *DataLength = min(*DataLength, kvpi->DataLength); diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index 20319ed5273..ea9bf07a897 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -5,7 +5,7 @@ * FILE: ntoskrnl/cc/copy.c * PURPOSE: Implements cache managers copy interface * - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ diff --git a/reactos/ntoskrnl/cc/pin.c b/reactos/ntoskrnl/cc/pin.c index 0829f2b7ab5..ec1b93b9ceb 100644 --- a/reactos/ntoskrnl/cc/pin.c +++ b/reactos/ntoskrnl/cc/pin.c @@ -5,7 +5,7 @@ * FILE: ntoskrnl/cc/pin.c * PURPOSE: Implements cache managers pinning interface * - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 0227bad7da6..838a46cec16 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -248,7 +248,7 @@ CcRosFlushDirtyPages(ULONG Target, PULONG Count) current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, DirtySegmentListEntry); current_entry = current_entry->Flink; - + // Locked = current->Bcb->Callbacks.AcquireForLazyWrite(current->Bcb->Context, FALSE); Locked = ExTryToAcquireResourceExclusiveLite(((FSRTL_COMMON_FCB_HEADER*)(current->Bcb->FileObject->FsContext))->Resource); if (!Locked) diff --git a/reactos/ntoskrnl/cm/ntfunc.c b/reactos/ntoskrnl/cm/ntfunc.c index 5c7e05d3d73..7b611237ce4 100644 --- a/reactos/ntoskrnl/cm/ntfunc.c +++ b/reactos/ntoskrnl/cm/ntfunc.c @@ -526,7 +526,7 @@ NtOpenKey(OUT PHANDLE KeyHandle, return Status; } - if (ObjectName.Buffer && + if (ObjectName.Buffer && ObjectName.Buffer[(ObjectName.Length / sizeof(WCHAR)) - 1] == '\\') { ObjectName.Buffer[(ObjectName.Length / sizeof(WCHAR)) - 1] = UNICODE_NULL; diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index 7dfaa851e3e..9804069c44f 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -384,7 +384,7 @@ CmiConnectHive(IN POBJECT_ATTRIBUTES KeyObjectAttributes, VERIFY_KEY_OBJECT(NewKey); - /* We're holding a pointer to the parent key .. We must keep it + /* We're holding a pointer to the parent key .. We must keep it * referenced */ /* Note: Do not dereference NewKey here! */ diff --git a/reactos/ntoskrnl/config/cmse.c b/reactos/ntoskrnl/config/cmse.c index c97b5138823..17eae5d4012 100644 --- a/reactos/ntoskrnl/config/cmse.c +++ b/reactos/ntoskrnl/config/cmse.c @@ -108,7 +108,7 @@ CmpHiveRootSecurityDescriptor(VOID) /* Phase 6: Allocate the security descriptor and make space for the ACL */ SecurityDescriptor = ExAllocatePoolWithTag(PagedPool, - sizeof(SECURITY_DESCRIPTOR) + + sizeof(SECURITY_DESCRIPTOR) + AclLength, TAG_CM); if (!SecurityDescriptor) KEBUGCHECKEX(REGISTRY_ERROR, 11, 6, 0, 0); diff --git a/reactos/ntoskrnl/config/i386/cmhardwr.c b/reactos/ntoskrnl/config/i386/cmhardwr.c index d99deb4bb31..482566debaf 100644 --- a/reactos/ntoskrnl/config/i386/cmhardwr.c +++ b/reactos/ntoskrnl/config/i386/cmhardwr.c @@ -250,7 +250,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc PCHAR CurrentVersion; extern UNICODE_STRING KeRosProcessorName, KeRosBiosDate, KeRosBiosVersion; extern UNICODE_STRING KeRosVideoBiosDate, KeRosVideoBiosVersion; - + /* Open the SMSS Memory Management key */ RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\" @@ -475,7 +475,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosProcessorName, Data.Buffer); - + /* Free the temporary buffer */ RtlFreeUnicodeString(&Data); } @@ -495,7 +495,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_SZ, Data.Buffer, Data.Length + sizeof(UNICODE_NULL)); - + /* Free the temporary buffer */ RtlFreeUnicodeString(&Data); } @@ -652,7 +652,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_SZ, Data.Buffer, Data.Length + sizeof(UNICODE_NULL)); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosBiosDate, Data.Buffer); @@ -712,7 +712,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_MULTI_SZ, BiosVersion, TotalLength); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosBiosVersion, (PWCH)BiosVersion); } @@ -756,7 +756,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_SZ, Data.Buffer, Data.Length + sizeof(UNICODE_NULL)); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosVideoBiosDate, Data.Buffer); @@ -811,7 +811,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_MULTI_SZ, BiosVersion, TotalLength); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosVideoBiosVersion, (PWCH)BiosVersion); } diff --git a/reactos/ntoskrnl/config/powerpc/cmhardwr.c b/reactos/ntoskrnl/config/powerpc/cmhardwr.c index 78d15a02d50..5fa25fff937 100644 --- a/reactos/ntoskrnl/config/powerpc/cmhardwr.c +++ b/reactos/ntoskrnl/config/powerpc/cmhardwr.c @@ -250,7 +250,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc PCHAR CurrentVersion; extern UNICODE_STRING KeRosProcessorName, KeRosBiosDate, KeRosBiosVersion; extern UNICODE_STRING KeRosVideoBiosDate, KeRosVideoBiosVersion; - + /* Open the SMSS Memory Management key */ RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\" @@ -475,7 +475,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosProcessorName, Data.Buffer); - + /* Free the temporary buffer */ RtlFreeUnicodeString(&Data); } @@ -495,7 +495,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_SZ, Data.Buffer, Data.Length + sizeof(UNICODE_NULL)); - + /* Free the temporary buffer */ RtlFreeUnicodeString(&Data); } @@ -652,7 +652,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_SZ, Data.Buffer, Data.Length + sizeof(UNICODE_NULL)); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosBiosDate, Data.Buffer); @@ -712,7 +712,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_MULTI_SZ, BiosVersion, TotalLength); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosBiosVersion, (PWCH)BiosVersion); } @@ -756,7 +756,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_SZ, Data.Buffer, Data.Length + sizeof(UNICODE_NULL)); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosVideoBiosDate, Data.Buffer); @@ -811,7 +811,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc REG_MULTI_SZ, BiosVersion, TotalLength); - + /* ROS: Save a copy for bugzilla reporting */ RtlCreateUnicodeString(&KeRosVideoBiosVersion, (PWCH)BiosVersion); } diff --git a/reactos/ntoskrnl/ex/atom.c b/reactos/ntoskrnl/ex/atom.c index 172b867405f..27f605fda58 100644 --- a/reactos/ntoskrnl/ex/atom.c +++ b/reactos/ntoskrnl/ex/atom.c @@ -17,7 +17,7 @@ /* GLOBALS ****************************************************************/ -/* +/* * FIXME: this is WRONG! The global atom table should live in the WinSta struct * and accessed through a win32k callout (received in PsEstablishWin32Callouts) * NOTE: There is a session/win32k global atom table also, but its private to diff --git a/reactos/ntoskrnl/ex/harderr.c b/reactos/ntoskrnl/ex/harderr.c index 33c2131ab1b..722cc0ba758 100644 --- a/reactos/ntoskrnl/ex/harderr.c +++ b/reactos/ntoskrnl/ex/harderr.c @@ -645,7 +645,7 @@ NtRaiseHardError(IN NTSTATUS ErrorStatus, SafeParams = Parameters; /* - * Call the Executive Function. It will probe and copy pointers to + * Call the Executive Function. It will probe and copy pointers to * user-mode */ ExRaiseHardError(ErrorStatus, diff --git a/reactos/ntoskrnl/ex/lookas.c b/reactos/ntoskrnl/ex/lookas.c index 9fbd88b11c0..b733840ddae 100644 --- a/reactos/ntoskrnl/ex/lookas.c +++ b/reactos/ntoskrnl/ex/lookas.c @@ -135,7 +135,7 @@ ExiAllocateFromPagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside) Lookaside->L.TotalAllocates++; Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); - if (!Entry) + if (!Entry) { Lookaside->L.AllocateMisses++; Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, @@ -154,7 +154,7 @@ ExiFreeToPagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PVOID Entry) { Lookaside->L.TotalFrees++; - if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) + if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { Lookaside->L.FreeMisses++; (Lookaside->L.Free)(Entry); @@ -258,7 +258,7 @@ ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, { Lookaside->L.Free = ExFreePool; } - + /* Insert it into the list */ ExInterlockedInsertTailList(&ExpNonPagedLookasideListHead, &Lookaside->L.ListEntry, diff --git a/reactos/ntoskrnl/ex/powerpc/fastinterlck.c b/reactos/ntoskrnl/ex/powerpc/fastinterlck.c index 4f8fccb8f4c..40133181408 100644 --- a/reactos/ntoskrnl/ex/powerpc/fastinterlck.c +++ b/reactos/ntoskrnl/ex/powerpc/fastinterlck.c @@ -1,262 +1,262 @@ -/* - * PROJECT: ReactOS Kernel - * COPYRIGHT: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ex/powerpc/fastinterlck.c - * PURPOSE: Executive Atom Functions - * PROGRAMMERS: Art Yerkes - */ - -/* INCLUDES *****************************************************************/ - -#include -#include - -NTKERNELAPI -PSINGLE_LIST_ENTRY -FASTCALL -ExInterlockedFlushSList(IN PSLIST_HEADER ListHead) -{ - PSLIST_ENTRY NewHead = NULL; - _InterlockedExchangePointer((PVOID *)&ListHead->Next.Next, &NewHead); - return NewHead; -} - -#undef ExInterlockedPushEntrySList -NTKERNELAPI -PSLIST_ENTRY -FASTCALL -ExInterlockedPushEntrySList -(IN PSLIST_HEADER ListHead, - IN PSLIST_ENTRY ListEntry) -{ - return InterlockedPushEntrySList(ListHead, ListEntry); -} - -#undef ExInterlockedPopEntrySList -NTKERNELAPI -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPopEntrySList( - IN PSLIST_HEADER ListHead, - IN PKSPIN_LOCK Lock) -{ - return InterlockedPopEntrySList(ListHead); -} - -#undef ExInterlockedAddULong -NTKERNELAPI -ULONG -NTAPI -ExfInterlockedAddUlong( - IN PULONG Addend, - IN ULONG Increment, - PKSPIN_LOCK Lock) -{ - KIRQL OldIrql; - KeAcquireSpinLock(Lock, &OldIrql); - *Addend += Increment; - KeReleaseSpinLock(Lock, OldIrql); - return *Addend; -} - -NTKERNELAPI -LONGLONG -FASTCALL -ExfInterlockedCompareExchange64( - IN OUT LONGLONG volatile *Destination, - IN PLONGLONG Exchange, - IN PLONGLONG Comperand) -{ - return 0ll; -} - -NTKERNELAPI -PLIST_ENTRY -FASTCALL -ExfInterlockedInsertHeadList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PLIST_ENTRY -FASTCALL -ExfInterlockedInsertTailList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PSINGLE_LIST_ENTRY -FASTCALL -ExfInterlockedPopEntryList( - IN PSINGLE_LIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PSINGLE_LIST_ENTRY -FASTCALL -ExfInterlockedPushEntryList( - IN PSINGLE_LIST_ENTRY ListHead, - IN PSINGLE_LIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PLIST_ENTRY -FASTCALL -ExfInterlockedRemoveHeadList( - IN PLIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - return ExInterlockedRemoveHeadList(ListHead, Lock); -} - -NTKERNELAPI -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedIncrementLong( - IN PLONG Addend) -{ - return 0; -} - -NTKERNELAPI -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedDecrementLong( - IN PLONG Addend) -{ - return 0; -} - -NTKERNELAPI -ULONG -FASTCALL -Exfi386InterlockedExchangeUlong( - IN PULONG Target, - IN ULONG Value) -{ - return 0; -} - -NTKERNELAPI -LARGE_INTEGER -NTAPI -ExInterlockedAddLargeInteger( - IN PLARGE_INTEGER Addend, - IN LARGE_INTEGER Increment, - IN PKSPIN_LOCK Lock) -{ - LARGE_INTEGER Result; - Result.QuadPart = 0; - return Result; -} - -NTKERNELAPI -ULONG -NTAPI -ExInterlockedAddUlong( - IN PULONG Addend, - IN ULONG Increment, - PKSPIN_LOCK Lock) -{ - return 0; -} - -#undef ExInterlockedIncrementLong -NTKERNELAPI -INTERLOCKED_RESULT -NTAPI -ExInterlockedIncrementLong( - IN PLONG Addend, - IN PKSPIN_LOCK Lock) -{ - return 0; -} - -#undef ExInterlockedDecrementLong -NTKERNELAPI -INTERLOCKED_RESULT -NTAPI -ExInterlockedDecrementLong( - IN PLONG Addend, - IN PKSPIN_LOCK Lock) -{ - return 0; -} - -NTKERNELAPI -ULONG -NTAPI -ExInterlockedExchangeUlong( - IN PULONG Target, - IN ULONG Value, - IN PKSPIN_LOCK Lock) -{ - return 0; -} - -NTKERNELAPI -PLIST_ENTRY -NTAPI -ExInterlockedInsertHeadList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PLIST_ENTRY -NTAPI -ExInterlockedInsertTailList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPopEntryList( - IN PSINGLE_LIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PSINGLE_LIST_ENTRY -NTAPI -ExInterlockedPushEntryList( - IN PSINGLE_LIST_ENTRY ListHead, - IN PSINGLE_LIST_ENTRY ListEntry, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} - -NTKERNELAPI -PLIST_ENTRY -NTAPI -ExInterlockedRemoveHeadList( - IN PLIST_ENTRY ListHead, - IN PKSPIN_LOCK Lock) -{ - return NULL; -} +/* + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ex/powerpc/fastinterlck.c + * PURPOSE: Executive Atom Functions + * PROGRAMMERS: Art Yerkes + */ + +/* INCLUDES *****************************************************************/ + +#include +#include + +NTKERNELAPI +PSINGLE_LIST_ENTRY +FASTCALL +ExInterlockedFlushSList(IN PSLIST_HEADER ListHead) +{ + PSLIST_ENTRY NewHead = NULL; + _InterlockedExchangePointer((PVOID *)&ListHead->Next.Next, &NewHead); + return NewHead; +} + +#undef ExInterlockedPushEntrySList +NTKERNELAPI +PSLIST_ENTRY +FASTCALL +ExInterlockedPushEntrySList +(IN PSLIST_HEADER ListHead, + IN PSLIST_ENTRY ListEntry) +{ + return InterlockedPushEntrySList(ListHead, ListEntry); +} + +#undef ExInterlockedPopEntrySList +NTKERNELAPI +PSINGLE_LIST_ENTRY +NTAPI +ExInterlockedPopEntrySList( + IN PSLIST_HEADER ListHead, + IN PKSPIN_LOCK Lock) +{ + return InterlockedPopEntrySList(ListHead); +} + +#undef ExInterlockedAddULong +NTKERNELAPI +ULONG +NTAPI +ExfInterlockedAddUlong( + IN PULONG Addend, + IN ULONG Increment, + PKSPIN_LOCK Lock) +{ + KIRQL OldIrql; + KeAcquireSpinLock(Lock, &OldIrql); + *Addend += Increment; + KeReleaseSpinLock(Lock, OldIrql); + return *Addend; +} + +NTKERNELAPI +LONGLONG +FASTCALL +ExfInterlockedCompareExchange64( + IN OUT LONGLONG volatile *Destination, + IN PLONGLONG Exchange, + IN PLONGLONG Comperand) +{ + return 0ll; +} + +NTKERNELAPI +PLIST_ENTRY +FASTCALL +ExfInterlockedInsertHeadList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PLIST_ENTRY +FASTCALL +ExfInterlockedInsertTailList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PSINGLE_LIST_ENTRY +FASTCALL +ExfInterlockedPopEntryList( + IN PSINGLE_LIST_ENTRY ListHead, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PSINGLE_LIST_ENTRY +FASTCALL +ExfInterlockedPushEntryList( + IN PSINGLE_LIST_ENTRY ListHead, + IN PSINGLE_LIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PLIST_ENTRY +FASTCALL +ExfInterlockedRemoveHeadList( + IN PLIST_ENTRY ListHead, + IN PKSPIN_LOCK Lock) +{ + return ExInterlockedRemoveHeadList(ListHead, Lock); +} + +NTKERNELAPI +INTERLOCKED_RESULT +FASTCALL +Exfi386InterlockedIncrementLong( + IN PLONG Addend) +{ + return 0; +} + +NTKERNELAPI +INTERLOCKED_RESULT +FASTCALL +Exfi386InterlockedDecrementLong( + IN PLONG Addend) +{ + return 0; +} + +NTKERNELAPI +ULONG +FASTCALL +Exfi386InterlockedExchangeUlong( + IN PULONG Target, + IN ULONG Value) +{ + return 0; +} + +NTKERNELAPI +LARGE_INTEGER +NTAPI +ExInterlockedAddLargeInteger( + IN PLARGE_INTEGER Addend, + IN LARGE_INTEGER Increment, + IN PKSPIN_LOCK Lock) +{ + LARGE_INTEGER Result; + Result.QuadPart = 0; + return Result; +} + +NTKERNELAPI +ULONG +NTAPI +ExInterlockedAddUlong( + IN PULONG Addend, + IN ULONG Increment, + PKSPIN_LOCK Lock) +{ + return 0; +} + +#undef ExInterlockedIncrementLong +NTKERNELAPI +INTERLOCKED_RESULT +NTAPI +ExInterlockedIncrementLong( + IN PLONG Addend, + IN PKSPIN_LOCK Lock) +{ + return 0; +} + +#undef ExInterlockedDecrementLong +NTKERNELAPI +INTERLOCKED_RESULT +NTAPI +ExInterlockedDecrementLong( + IN PLONG Addend, + IN PKSPIN_LOCK Lock) +{ + return 0; +} + +NTKERNELAPI +ULONG +NTAPI +ExInterlockedExchangeUlong( + IN PULONG Target, + IN ULONG Value, + IN PKSPIN_LOCK Lock) +{ + return 0; +} + +NTKERNELAPI +PLIST_ENTRY +NTAPI +ExInterlockedInsertHeadList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PLIST_ENTRY +NTAPI +ExInterlockedInsertTailList( + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PSINGLE_LIST_ENTRY +NTAPI +ExInterlockedPopEntryList( + IN PSINGLE_LIST_ENTRY ListHead, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PSINGLE_LIST_ENTRY +NTAPI +ExInterlockedPushEntryList( + IN PSINGLE_LIST_ENTRY ListHead, + IN PSINGLE_LIST_ENTRY ListEntry, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} + +NTKERNELAPI +PLIST_ENTRY +NTAPI +ExInterlockedRemoveHeadList( + IN PLIST_ENTRY ListHead, + IN PKSPIN_LOCK Lock) +{ + return NULL; +} diff --git a/reactos/ntoskrnl/ex/win32k.c b/reactos/ntoskrnl/ex/win32k.c index 137f073d98d..6180de75dd2 100644 --- a/reactos/ntoskrnl/ex/win32k.c +++ b/reactos/ntoskrnl/ex/win32k.c @@ -19,7 +19,7 @@ POBJECT_TYPE ExWindowStationObjectType = NULL; POBJECT_TYPE ExDesktopObjectType = NULL; -GENERIC_MAPPING ExpWindowStationMapping = +GENERIC_MAPPING ExpWindowStationMapping = { STANDARD_RIGHTS_READ, STANDARD_RIGHTS_WRITE, diff --git a/reactos/ntoskrnl/ex/zone.c b/reactos/ntoskrnl/ex/zone.c index 8d12a42500a..ed2b860ff41 100644 --- a/reactos/ntoskrnl/ex/zone.c +++ b/reactos/ntoskrnl/ex/zone.c @@ -27,7 +27,7 @@ ExExtendZone(PZONE_HEADER Zone, ULONG_PTR Entry; ULONG i; - /* + /* * BlockSize and Segment must be 8-byte aligned. * Blocksize cannot exceed Segment Size. */ @@ -110,7 +110,7 @@ ExInitializeZone(PZONE_HEADER Zone, ULONG i; ULONG_PTR Entry; - /* + /* * BlockSize and Segment must be 8-byte aligned. * Blocksize cannot exceed Segment Size. */ diff --git a/reactos/ntoskrnl/fsrtl/fastio.c b/reactos/ntoskrnl/fsrtl/fastio.c index cc8bb6a9adb..99acb807da7 100644 --- a/reactos/ntoskrnl/fsrtl/fastio.c +++ b/reactos/ntoskrnl/fsrtl/fastio.c @@ -27,7 +27,7 @@ FsRtlIncrementCcFastReadResourceMiss(VOID) /* * @implemented */ -VOID +VOID NTAPI FsRtlIncrementCcFastReadNotPossible(VOID) { @@ -57,15 +57,15 @@ FsRtlIncrementCcFastReadNoWait(VOID) _SEH_FILTER(FsRtlCcCopyFilter) { LONG ExceptionDisposition; - + /* Check if this was an expected exception */ ExceptionDisposition = FsRtlIsNtstatusExpected(_SEH_GetExceptionCode() ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH); - + /* Continue execution if we expected it, otherwise fail the call */ return ExceptionDisposition; -} +} /* @@ -102,7 +102,7 @@ FsRtlCopyRead(IN PFILE_OBJECT FileObject, IoStatus->Information = 0; return TRUE; } - + if (MAXLONGLONG < (LONGLONG) FileOffset->QuadPart + Length) { IoStatus->Status = STATUS_INVALID_PARAMETER; IoStatus->Information = 0; @@ -113,7 +113,7 @@ FsRtlCopyRead(IN PFILE_OBJECT FileObject, Offset.QuadPart = FileOffset->QuadPart + Length; FcbHeader = (PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext; - + if (Wait) { /* Use a Resource Acquire */ FsRtlEnterFileSystem(); @@ -184,14 +184,14 @@ FsRtlCopyRead(IN PFILE_OBJECT FileObject, Length = (ULONG)(FcbHeader->FileSize.QuadPart - FileOffset->QuadPart); } - /* Set this as top-level IRP */ + /* Set this as top-level IRP */ PsGetCurrentThread()->TopLevelIrp = FSRTL_FAST_IO_TOP_LEVEL_IRP; - _SEH_TRY + _SEH_TRY { /* Make sure the IO and file size is below 4GB */ if (Wait && !(Offset.HighPart | FcbHeader->FileSize.HighPart )) { - + /* Call the cache controller */ CcFastCopyRead (FileObject,FileOffset->LowPart,Length,PageCount,Buffer,IoStatus); /* File was accessed */ @@ -199,15 +199,15 @@ FsRtlCopyRead(IN PFILE_OBJECT FileObject, if (IoStatus->Status != STATUS_END_OF_FILE) { ASSERT(( FcbHeader->FileSize.QuadPart) >= (FileOffset->QuadPart + IoStatus->Information)); } - + } else { - + /* Call the cache controller */ Result = CcCopyRead(FileObject, FileOffset, Length, Wait,Buffer, IoStatus); /* File was accessed */ FileObject->Flags |= FO_FILE_FAST_IO_READ; if (Result == TRUE) { - ASSERT( (IoStatus->Status == STATUS_END_OF_FILE) || + ASSERT( (IoStatus->Status == STATUS_END_OF_FILE) || ((LONGLONG)(FileOffset->QuadPart + IoStatus->Information) <= FcbHeader->FileSize.QuadPart) ); } @@ -218,13 +218,13 @@ FsRtlCopyRead(IN PFILE_OBJECT FileObject, FileObject->CurrentByteOffset.QuadPart += IoStatus->Information; } } - _SEH_EXCEPT(FsRtlCcCopyFilter) + _SEH_EXCEPT(FsRtlCcCopyFilter) { Result = FALSE; } _SEH_END; - + PsGetCurrentThread()->TopLevelIrp = 0; - + /* Return to caller */ Cleanup: @@ -236,7 +236,7 @@ Cleanup: } return Result; - + } @@ -272,7 +272,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, LARGE_INTEGER NewSize; LARGE_INTEGER Offset; - + PAGED_CODE(); ASSERT(FileObject); @@ -303,7 +303,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, FsRtlEnterFileSystem(); /* Nagar p.544/545 -- The CcFastCopyWrite doesn't deal with filesize beyond 4GB*/ - if (Wait && (FcbHeader->AllocationSize.HighPart == 0)) + if (Wait && (FcbHeader->AllocationSize.HighPart == 0)) { /* If the file offset is not past the file size, then we can acquire the lock shared */ if ((FileOffsetAppend == FALSE) && (Offset.LowPart <= FcbHeader->ValidDataLength.LowPart)){ @@ -318,9 +318,9 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, Offset.LowPart = FcbHeader->FileSize.LowPart; NewSize.LowPart = FcbHeader->FileSize.LowPart + Length; b_4GB = (NewSize.LowPart < FcbHeader->FileSize.LowPart); - + } else { - Offset.LowPart = FileOffset->LowPart; + Offset.LowPart = FileOffset->LowPart; NewSize.LowPart = FileOffset->LowPart + Length; b_4GB = ((NewSize.LowPart < FileOffset->LowPart) || (FileOffset->HighPart != 0)); } @@ -330,7 +330,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, That fast are allowed for this file stream. That we are not extending past the allocated size That we are not creating a hole bigger than 8k - That we are not crossing the 4GB boundary + That we are not crossing the 4GB boundary */ if ( (FileObject->PrivateCacheMap != NULL) && (FcbHeader->IsFastIoPossible != FastIoIsNotPossible) && @@ -343,30 +343,30 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, exclusively, because we are going to need to update the FcbHeader */ if (ResourceAquiredShared && (NewSize.LowPart > (FcbHeader->ValidDataLength.LowPart + 0x2000))) { /* Then we need to acquire the resource exclusive */ - ExReleaseResourceLite(FcbHeader->Resource); + ExReleaseResourceLite(FcbHeader->Resource); ExAcquireResourceExclusiveLite(FcbHeader->Resource,TRUE); if (FileOffsetAppend == TRUE) { Offset.LowPart = FcbHeader->FileSize.LowPart; // ?? NewSize.LowPart = FcbHeader->FileSize.LowPart + Length; /* Make sure we don't cross the 4GB boundary */ b_4GB = (NewSize.LowPart < Offset.LowPart); - } - + } + /* Recheck some of the conditions since we let the lock go */ if ( (FileObject->PrivateCacheMap != NULL) && (FcbHeader->IsFastIoPossible != FastIoIsNotPossible) && (FcbHeader->AllocationSize.LowPart >= NewSize.LowPart) && (FcbHeader->AllocationSize.HighPart == 0) && !b_4GB - ) + ) { - } else + } else { goto FailAndCleanup; } } - - }else + + }else { goto FailAndCleanup; } @@ -375,7 +375,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, if (FcbHeader->IsFastIoPossible == FastIoIsQuestionable) { IO_STATUS_BLOCK FastIoCheckIfPossibleStatus; - + /* Sanity check */ ASSERT(!KeIsExecutingDpc()); @@ -401,7 +401,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, goto FailAndCleanup; } } - + /* If we are going to extend the file then save the old file size in case the operation fails */ @@ -411,11 +411,11 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, OldValidDataLength.LowPart = FcbHeader->ValidDataLength.LowPart; FcbHeader->FileSize.LowPart = NewSize.LowPart; } - - /* Set this as top-level IRP */ + + /* Set this as top-level IRP */ PsGetCurrentThread()->TopLevelIrp = FSRTL_FAST_IO_TOP_LEVEL_IRP; - _SEH_TRY + _SEH_TRY { if (Offset.LowPart > FcbHeader->ValidDataLength.LowPart) { LARGE_INTEGER OffsetVar; @@ -426,12 +426,12 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, /* Call the cache manager */ CcFastCopyWrite(FileObject,Offset.LowPart,Length,Buffer); - } - _SEH_EXCEPT(FsRtlCcCopyFilter) + } + _SEH_EXCEPT(FsRtlCcCopyFilter) { Result = FALSE; } _SEH_END; - + /* Remove ourselves at the top level component after the IO is done */ PsGetCurrentThread()->TopLevelIrp = 0; @@ -453,9 +453,9 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, /* Update the file object current file offset */ FileObject->CurrentByteOffset.QuadPart = NewSize.LowPart; - + } else { - + /* Result == FALSE if we get here. */ if (FileSizeModified) { /* If the file size was modified then restore the old file size */ @@ -473,18 +473,18 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, } else { } } - + goto Cleanup; - + } else { - + LARGE_INTEGER OldFileSize; /* Sanity check */ ASSERT(!KeIsExecutingDpc()); - - // Nagar P.544 - /* Check if we need to acquire the resource exclusive */ + + // Nagar P.544 + /* Check if we need to acquire the resource exclusive */ if ( (FileOffsetAppend == FALSE) && ( (FileOffset->QuadPart + Length) <= FcbHeader->ValidDataLength.QuadPart ) ) @@ -521,12 +521,12 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, ((FcbHeader->ValidDataLength.QuadPart + 0x2000) > Offset.QuadPart) && (MAXLONGLONG > (Offset.QuadPart + Length)) && (FcbHeader->AllocationSize.QuadPart >= NewSize.QuadPart) - ) + ) { /* Check if we can keep the lock shared */ if (ResourceAquiredShared && (NewSize.QuadPart > FcbHeader->ValidDataLength.QuadPart) ) { ExReleaseResourceLite(FcbHeader->Resource); - if(!ExAcquireResourceExclusiveLite(FcbHeader->Resource,Wait)) + if(!ExAcquireResourceExclusiveLite(FcbHeader->Resource,Wait)) { goto LeaveCriticalAndFail; } @@ -541,7 +541,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, if ( (FileObject->PrivateCacheMap != NULL) && (FcbHeader->IsFastIoPossible != FastIoIsNotPossible) && (FcbHeader->AllocationSize.QuadPart > NewSize.QuadPart) - ) + ) { /* Do nothing */ } else { @@ -553,7 +553,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, if (FcbHeader->IsFastIoPossible == FastIoIsQuestionable) { IO_STATUS_BLOCK FastIoCheckIfPossibleStatus; - + /* Sanity check */ ASSERT(!KeIsExecutingDpc()); @@ -581,7 +581,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, } - /* If we are going to modify the filesize, save the old fs in case the operation fails */ + /* If we are going to modify the filesize, save the old fs in case the operation fails */ if (NewSize.QuadPart > FcbHeader->FileSize.QuadPart) { FileSizeModified = TRUE; OldFileSize.QuadPart = FcbHeader->FileSize.QuadPart; @@ -600,7 +600,7 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, /* Nagar p.544 */ /* Set ourselves as top component */ PsGetCurrentThread()->TopLevelIrp = FSRTL_FAST_IO_TOP_LEVEL_IRP; - _SEH_TRY + _SEH_TRY { BOOLEAN CallCc = TRUE; /* Check if there is a gap between the end of the file and the offset @@ -613,18 +613,18 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, normally */ CallCc = FALSE; - } + } } /* Unless the CcZeroData failed, call the cache manager */ if (CallCc) { Result = CcCopyWrite(FileObject,&Offset,Length, Wait, Buffer); } - }_SEH_EXCEPT(FsRtlCcCopyFilter) + }_SEH_EXCEPT(FsRtlCcCopyFilter) { Result = FALSE; } _SEH_END; - + /* Reset the top component */ PsGetCurrentThread()->TopLevelIrp = FSRTL_FAST_IO_TOP_LEVEL_IRP; @@ -640,8 +640,8 @@ FsRtlCopyWrite(IN PFILE_OBJECT FileObject, FcbHeader->ValidDataLength.QuadPart = NewSize.QuadPart; } } - - /* Flag the file as modified */ + + /* Flag the file as modified */ FileObject->Flags |= FO_FILE_MODIFIED; /* Check if the filesize has changed */ if (FileSizeModified) { @@ -693,7 +693,7 @@ Cleanup: ExReleaseResourceLite(FcbHeader->Resource); FsRtlExitFileSystem(); return Result; -} +} /* * @implemented @@ -713,7 +713,7 @@ FsRtlGetFileSize(IN PFILE_OBJECT FileObject, PIRP Irp; BOOLEAN OldHardError; - + PAGED_CODE(); /* Get Device Object and Fast Calls */ @@ -732,7 +732,7 @@ FsRtlGetFileSize(IN PFILE_OBJECT FileObject, KeInitializeEvent(&Event,NotificationEvent,FALSE); /* Allocate the IRP */ Irp = IoAllocateIrp(DeviceObject->StackSize,FALSE); - if (Irp == NULL) + if (Irp == NULL) { return STATUS_INSUFFICIENT_RESOURCES; } @@ -763,25 +763,25 @@ FsRtlGetFileSize(IN PFILE_OBJECT FileObject, Status = IofCallDriver(DeviceObject,Irp); /* Standard DDK IRP result processing */ - if (Status == STATUS_PENDING) + if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event,Executive,KernelMode,FALSE,NULL); } /* If there was a synchronous error, signal it */ - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { IoStatus.Status = Status; } - + IoSetThreadHardErrorMode(OldHardError); } /* Check the sync/async IO result */ - if (NT_SUCCESS(IoStatus.Status)) + if (NT_SUCCESS(IoStatus.Status)) { /* Was the request for a directory ? */ - if (Info.Directory) + if (Info.Directory) { IoStatus.Status = STATUS_FILE_IS_A_DIRECTORY; } @@ -793,7 +793,7 @@ FsRtlGetFileSize(IN PFILE_OBJECT FileObject, return IoStatus.Status; } - + /* * @implemented @@ -877,7 +877,7 @@ FsRtlMdlReadComplete(IN PFILE_OBJECT FileObject, FastDispatch = BaseDeviceObject->DriverObject->FastIoDispatch; /* If the Base Device Object has its own FastDispatch Routine, fail */ - if ((BaseDeviceObject != DeviceObject) && FastDispatch + if ((BaseDeviceObject != DeviceObject) && FastDispatch && FastDispatch->MdlReadComplete) { return FALSE; @@ -1003,17 +1003,17 @@ FsRtlMdlReadDev(IN PFILE_OBJECT FileObject, /* Set this as top-level IRP */ PsGetCurrentThread()->TopLevelIrp = FSRTL_FAST_IO_TOP_LEVEL_IRP; - _SEH_TRY - { + _SEH_TRY + { /* Attempt a read */ CcMdlRead(FileObject, FileOffset, Length, MdlChain, IoStatus); FileObject->Flags |= FO_FILE_FAST_IO_READ; } - _SEH_EXCEPT(FsRtlCcCopyFilter) + _SEH_EXCEPT(FsRtlCcCopyFilter) { Result = FALSE; } _SEH_END; - + /* Remove the top-level IRP flag */ PsGetCurrentThread()->TopLevelIrp = 0; @@ -1160,12 +1160,12 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, PFAST_IO_DISPATCH FastIoDispatch; PDEVICE_OBJECT Device; PFSRTL_COMMON_FCB_HEADER FcbHeader; - + LARGE_INTEGER OldFileSize; LARGE_INTEGER OldValidDataLength; LARGE_INTEGER NewSize; LARGE_INTEGER Offset; - + /* WDK doc. Offset=0xffffffffffffffff indicates append to the end of file */ BOOLEAN FileOffsetAppend = ((FileOffset->HighPart == 0xffffffff) && (FileOffset->LowPart == 0xffffffff)); BOOLEAN FileSizeModified = FALSE; @@ -1176,7 +1176,7 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, OldValidDataLength.QuadPart = 0; PAGED_CODE(); - + Offset.QuadPart = FileOffset->QuadPart + Length; /* Nagar p.544 -- Check with Cc if we can write */ @@ -1187,7 +1187,7 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, } IoStatus->Status = STATUS_SUCCESS; - + /* No actual read */ if (!Length) { @@ -1205,17 +1205,17 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, /* Acquire the resource shared */ ExAcquireResourceSharedLite(FcbHeader->Resource,TRUE); ResourceAquiredShared =TRUE; - } else + } else { /* Acquire the resource exclusive */ ExAcquireResourceExclusiveLite(FcbHeader->Resource,TRUE); } - + /* Check if we are appending */ if (FileOffsetAppend == TRUE) { Offset.QuadPart = FcbHeader->FileSize.QuadPart; NewSize.QuadPart = FcbHeader->FileSize.QuadPart + Length; - } else + } else { Offset.QuadPart = FileOffset->QuadPart; NewSize.QuadPart = FileOffset->QuadPart + Length; @@ -1241,7 +1241,7 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, if ( (FileObject->PrivateCacheMap != NULL) && (FcbHeader->IsFastIoPossible != FastIoIsNotPossible) && (FcbHeader->AllocationSize.QuadPart > NewSize.QuadPart) - ) + ) { /* Do nothing */ } else { @@ -1278,15 +1278,15 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, } } - /* If we are going to modify the filesize, save the old fs in case the operation fails */ - if (NewSize.QuadPart > FcbHeader->FileSize.QuadPart) + /* If we are going to modify the filesize, save the old fs in case the operation fails */ + if (NewSize.QuadPart > FcbHeader->FileSize.QuadPart) { FileSizeModified = TRUE; OldFileSize.QuadPart = FcbHeader->FileSize.QuadPart; OldValidDataLength.QuadPart = FcbHeader->ValidDataLength.QuadPart; /* If the high part of the filesize is going to change, grab the Paging IoResouce */ - if (NewSize.HighPart != FcbHeader->FileSize.HighPart && FcbHeader->PagingIoResource) + if (NewSize.HighPart != FcbHeader->FileSize.HighPart && FcbHeader->PagingIoResource) { ExAcquireResourceExclusiveLite(FcbHeader->PagingIoResource, TRUE); FcbHeader->FileSize.QuadPart = NewSize.QuadPart; @@ -1295,34 +1295,34 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, FcbHeader->FileSize.QuadPart = NewSize.QuadPart; } } - + /* Nagar p.544 */ /* Set ourselves as top component */ PsGetCurrentThread()->TopLevelIrp = FSRTL_FAST_IO_TOP_LEVEL_IRP; - _SEH_TRY + _SEH_TRY { /* Check if there is a gap between the end of the file and the offset If yes, then we have to zero the data */ if (Offset.QuadPart > FcbHeader->ValidDataLength.QuadPart) { Result = CcZeroData(FileObject,&FcbHeader->ValidDataLength,&Offset,TRUE); - if (Result) + if (Result) { CcPrepareMdlWrite(FileObject,&Offset,Length,MdlChain,IoStatus); } } else { CcPrepareMdlWrite(FileObject,&Offset,Length,MdlChain,IoStatus); } - - }_SEH_EXCEPT(FsRtlCcCopyFilter) + + }_SEH_EXCEPT(FsRtlCcCopyFilter) { Result = FALSE; } _SEH_END; - + /* Reset the top component */ PsGetCurrentThread()->TopLevelIrp = 0; - + /* Did the operation suceeded */ if (Result) { /* Check if we need to update the filesize */ @@ -1335,8 +1335,8 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, FcbHeader->ValidDataLength.QuadPart = NewSize.QuadPart; } } - - /* Flag the file as modified */ + + /* Flag the file as modified */ FileObject->Flags |= FO_FILE_MODIFIED; /* Check if the filesize has changed */ if (FileSizeModified) { @@ -1365,7 +1365,7 @@ FsRtlPrepareMdlWriteDev(IN PFILE_OBJECT FileObject, } goto Cleanup; - + } else { diff --git a/reactos/ntoskrnl/fstub/disksup.c b/reactos/ntoskrnl/fstub/disksup.c index d1c0f869efe..0ba6e2241f0 100644 --- a/reactos/ntoskrnl/fstub/disksup.c +++ b/reactos/ntoskrnl/fstub/disksup.c @@ -109,7 +109,7 @@ HalpAssignDrive(IN PUNICODE_STRING PartitionName, PartitionName); if (hKey && - DriveType == DOSDEVICE_DRIVE_FIXED && + DriveType == DOSDEVICE_DRIVE_FIXED && Signature) { DiskMountInfo.Signature = Signature; @@ -190,7 +190,7 @@ xHalpGetRDiskCount(VOID) DPRINT("Count %x\n", Count); DirectoryInfo[Count].Name.Buffer[DirectoryInfo[Count].Name.Length / sizeof(WCHAR)] = 0; ArcNameBuffer = DirectoryInfo[Count].Name.Buffer; - if (DirectoryInfo[Count].Name.Length >= sizeof(L"multi(0)disk(0)rdisk(0)") - sizeof(WCHAR) && + if (DirectoryInfo[Count].Name.Length >= sizeof(L"multi(0)disk(0)rdisk(0)") - sizeof(WCHAR) && !_wcsnicmp(ArcNameBuffer, L"multi(0)disk(0)rdisk(", (sizeof(L"multi(0)disk(0)rdisk(") - sizeof(WCHAR)) / sizeof(WCHAR))) { DPRINT("%S\n", ArcNameBuffer); @@ -448,9 +448,9 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, Status = ZwOpenKey(&hKey, KEY_ALL_ACCESS, &ObjectAttributes); - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { - Status = ZwCreateKey(&hKey, + Status = ZwCreateKey(&hKey, KEY_ALL_ACCESS, &ObjectAttributes, 0, @@ -527,7 +527,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, LayoutArray[i] = NULL; continue; } - /* We don't use the RewritePartition value while mounting the disks. + /* We don't use the RewritePartition value while mounting the disks. * We use this value for marking pre-assigned (registry) partitions. */ for (j = 0; j < LayoutArray[i]->PartitionCount; j++) @@ -575,11 +575,11 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock, PartialInformation, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(REG_DISK_MOUNT_INFO), &Length); - if (NT_SUCCESS(Status) && + if (NT_SUCCESS(Status) && PartialInformation->Type == REG_BINARY && PartialInformation->DataLength == sizeof(REG_DISK_MOUNT_INFO)) { - DPRINT("%wZ => %08x:%08x%08x\n", &UnicodeString1, DiskMountInfo->Signature, + DPRINT("%wZ => %08x:%08x%08x\n", &UnicodeString1, DiskMountInfo->Signature, DiskMountInfo->StartingOffset.u.HighPart, DiskMountInfo->StartingOffset.u.LowPart); { BOOLEAN Found = FALSE; @@ -1475,12 +1475,12 @@ IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, PartitionType = PartitionDescriptor->PartitionType; /* Print debug messages */ - DPRINT("Partition Entry %d,%d: type %#x %s\n", + DPRINT("Partition Entry %d,%d: type %#x %s\n", j, Entry, PartitionType, (PartitionDescriptor->ActiveFlag) ? "Active" : ""); - DPRINT("\tOffset %#08lx for %#08lx Sectors\n", + DPRINT("\tOffset %#08lx for %#08lx Sectors\n", GET_STARTING_SECTOR(PartitionDescriptor), GET_PARTITION_LENGTH(PartitionDescriptor)); diff --git a/reactos/ntoskrnl/include/config.h b/reactos/ntoskrnl/include/config.h index 724352f5069..4d32bb1e8ff 100644 --- a/reactos/ntoskrnl/include/config.h +++ b/reactos/ntoskrnl/include/config.h @@ -22,13 +22,13 @@ /* Enable tracking of statistics about the tagged blocks in the pool */ #undef TAG_STATISTICS_TRACKING - + /* Enable Memory Debugging Features/Helpers */ #undef POOL_DEBUG_APIS - + /* Enable Redzone */ #define R_RZ 0 - + /* Enable Allocator Stack */ #define R_STACK 0 diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index 3f4acf4ec7b..9f64e70b1da 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -103,7 +103,7 @@ typedef struct } WaitBlockBuffer; \ PEX_PUSH_LOCK_WAIT_BLOCK x = (PEX_PUSH_LOCK_WAIT_BLOCK) \ ((ULONG_PTR)&WaitBlockBuffer.UnalignedBlock &~ 0xF); - + #else // @@ -114,7 +114,7 @@ typedef struct #define DEFINE_WAIT_BLOCK(x) \ EX_PUSH_LOCK_WAIT_BLOCK WaitBlockBuffer; \ PEX_PUSH_LOCK_WAIT_BLOCK x = &WaitBlockBuffer; - + #endif /* INITIALIZATION FUNCTIONS *************************************************/ @@ -816,7 +816,7 @@ ExConvertPushLockSharedToExclusive(IN PEX_PUSH_LOCK PushLock) VOID FORCEINLINE ExWaitOnPushLock(PEX_PUSH_LOCK PushLock) -{ +{ /* Check if we're locked */ if (PushLock->Locked) { @@ -840,7 +840,7 @@ ExWaitOnPushLock(PEX_PUSH_LOCK PushLock) * * @return None. * - * @remarks The function attempts the quickest route to release the lock, which is + * @remarks The function attempts the quickest route to release the lock, which is * to simply decrease the share count and remove the lock bit. * However, if the pushlock is being waited on then the long path is taken. * @@ -927,7 +927,7 @@ ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock) * * @return None. * - * @remarks The function attempts the quickest route to release the lock, which is + * @remarks The function attempts the quickest route to release the lock, which is * to simply clear all the fields and decrease the share count if required. * However, if the pushlock is being waited on then the long path is taken. * diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index 3016f062dd0..ead731f618b 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -538,7 +538,7 @@ IoDestroyDriverList( VOID ); -NTSTATUS +NTSTATUS INIT_FUNCTION IopInitPlugPlayEvents(VOID); @@ -610,7 +610,7 @@ IopMountVolume( OUT PVPB *Vpb ); -PVOID +PVOID IoOpenSymlink( IN PVOID SymbolicLink ); @@ -849,7 +849,7 @@ IopLoadUnloadDriver( IN OUT PLOAD_UNLOAD_PARAMS LoadParams ); -NTSTATUS +NTSTATUS FASTCALL IopInitializeDriverModule( IN PDEVICE_NODE DeviceNode, diff --git a/reactos/ntoskrnl/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h index cf13c326101..0a6ac154d0d 100644 --- a/reactos/ntoskrnl/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -333,7 +333,7 @@ KeFindNextRightSetAffinity( IN ULONG Set ); -VOID +VOID NTAPI DbgBreakPointNoBugCheck(VOID); diff --git a/reactos/ntoskrnl/include/internal/ke_x.h b/reactos/ntoskrnl/include/internal/ke_x.h index 46714d395a7..6e4828dc76f 100644 --- a/reactos/ntoskrnl/include/internal/ke_x.h +++ b/reactos/ntoskrnl/include/internal/ke_x.h @@ -7,7 +7,7 @@ */ // -// Thread Dispatcher Header DebugActive Mask +// Thread Dispatcher Header DebugActive Mask // #define DR_MASK(x) 1 << x #define DR_ACTIVE_MASK 0x10 diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 2a395e1b9b7..b355289d7d3 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -64,7 +64,7 @@ typedef ULONG PFN_TYPE, *PPFN_TYPE; /* Although Microsoft says this isn't hardcoded anymore, they won't be able to change it. Stuff depends on it */ -#define MM_VIRTMEM_GRANULARITY (64 * 1024) +#define MM_VIRTMEM_GRANULARITY (64 * 1024) #define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001) @@ -165,7 +165,7 @@ typedef struct typedef struct _MM_SECTION_SEGMENT { - LONG FileOffset; /* start offset into the file for image sections */ + LONG FileOffset; /* start offset into the file for image sections */ ULONG_PTR VirtualAddress; /* dtart offset into the address range for image sections */ ULONG RawLength; /* length of the segment which is part of the mapped file */ ULONG Length; /* absolute length of the segment */ @@ -335,7 +335,7 @@ typedef VOID /* aspace.c ******************************************************************/ -VOID +VOID NTAPI MmLockAddressSpace(PMADDRESS_SPACE AddressSpace); @@ -490,11 +490,11 @@ VOID NTAPI ExFreeNonPagedPool(PVOID block); -VOID +VOID NTAPI ExFreePagedPool(IN PVOID Block); -VOID +VOID NTAPI MmInitializePagedPool(VOID); @@ -821,14 +821,14 @@ MmInitializeMemoryConsumer( NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed) ); -VOID +VOID NTAPI MmInitializeBalancer( ULONG NrAvailablePages, ULONG NrSystemPages ); -NTSTATUS +NTSTATUS NTAPI MmReleasePageMemoryConsumer( ULONG Consumer, @@ -1326,7 +1326,7 @@ MmGetFileNameForSection( OUT POBJECT_NAME_INFORMATION *ModuleName ); -PVOID +PVOID NTAPI MmAllocateSection( IN ULONG Length, diff --git a/reactos/ntoskrnl/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h index 236d3bf124d..a6608cf8dab 100644 --- a/reactos/ntoskrnl/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -11,8 +11,8 @@ #define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo") #else #define INIT_FUNCTION -#define PAGE_LOCKED_FUNCTION -#define PAGE_UNLOCKED_FUNCTION +#define PAGE_LOCKED_FUNCTION +#define PAGE_UNLOCKED_FUNCTION #endif #ifdef _NTOSKRNL_ diff --git a/reactos/ntoskrnl/include/internal/powerpc/ke.h b/reactos/ntoskrnl/include/internal/powerpc/ke.h index 1ba8c5a6c0d..d05ce0263b8 100644 --- a/reactos/ntoskrnl/include/internal/powerpc/ke.h +++ b/reactos/ntoskrnl/include/internal/powerpc/ke.h @@ -127,7 +127,7 @@ __asm__ __volatile__("mfmsr 0\n\t" \ "or 0,8,0\n\t" \ "mtmsr 0\n\t") -#define KePPCHaltProcessor() +#define KePPCHaltProcessor() #define KeArchEraseFlags() #define KeArchDisableInterrupts() KePPCDisableInterrupts() @@ -159,7 +159,7 @@ STDCALL KeCreateApplicationProcessorIdleThread( ULONG Id); -static VOID KePPCFnInit() +static VOID KePPCFnInit() { __asm__("mfmsr 0\n\tori 0,0,0x2000\n\tmtmsr 0"); } @@ -173,8 +173,8 @@ KiThreadStartup(PKSYSTEM_ROUTINE SystemRoutine, BOOLEAN UserThread, KTRAP_FRAME TrapFrame); #endif -VOID -NTAPI +VOID +NTAPI KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState); #endif /* __ASM__ */ diff --git a/reactos/ntoskrnl/include/internal/se.h b/reactos/ntoskrnl/include/internal/se.h index 5157bf40daa..fa36a79577f 100644 --- a/reactos/ntoskrnl/include/internal/se.h +++ b/reactos/ntoskrnl/include/internal/se.h @@ -112,7 +112,7 @@ BOOLEAN NTAPI SepInitSDs(VOID); -VOID +VOID NTAPI SeDeassignPrimaryToken(struct _EPROCESS *Process); diff --git a/reactos/ntoskrnl/io/iomgr/arcname.c b/reactos/ntoskrnl/io/iomgr/arcname.c index 7c082a11504..c18a31c3d62 100644 --- a/reactos/ntoskrnl/io/iomgr/arcname.c +++ b/reactos/ntoskrnl/io/iomgr/arcname.c @@ -104,7 +104,7 @@ IopApplyRosCdromArcHack(IN ULONG i) } } } - + /* OK, how many disks are there? */ DeviceNumber += ConfigInfo->DiskCount; @@ -113,7 +113,7 @@ IopApplyRosCdromArcHack(IN ULONG i) { /* Hack until IoAssignDriveLetters is fixed */ swprintf(SharedUserData->NtSystemRoot, L"%c:\\reactos", 'C' + DeviceNumber); - return TRUE; + return TRUE; } /* Failed */ diff --git a/reactos/ntoskrnl/io/iomgr/drvrlist.c b/reactos/ntoskrnl/io/iomgr/drvrlist.c index c47681a753b..c0670603e7d 100644 --- a/reactos/ntoskrnl/io/iomgr/drvrlist.c +++ b/reactos/ntoskrnl/io/iomgr/drvrlist.c @@ -43,7 +43,7 @@ LIST_ENTRY GroupListHead = {NULL, NULL}; LIST_ENTRY ServiceListHead = {NULL, NULL}; extern BOOLEAN NoGuiBoot; -VOID +VOID FASTCALL INIT_FUNCTION IopDisplayLoadingMessage(PVOID ServiceName, diff --git a/reactos/ntoskrnl/io/iomgr/file.c b/reactos/ntoskrnl/io/iomgr/file.c index d9577345d15..7f3e07231ab 100644 --- a/reactos/ntoskrnl/io/iomgr/file.c +++ b/reactos/ntoskrnl/io/iomgr/file.c @@ -522,7 +522,7 @@ IopParseDevice(IN PVOID ParseObject, /* Set the named pipe MJ and set the parameters */ StackLoc->MajorFunction = IRP_MJ_CREATE_NAMED_PIPE; - StackLoc->Parameters.CreatePipe.Parameters = + StackLoc->Parameters.CreatePipe.Parameters = OpenPacket->MailslotOrPipeParameters; break; @@ -1939,7 +1939,7 @@ IoCreateStreamFileObjectEx(IN PFILE_OBJECT FileObject OPTIONAL, /* Set File Object Data */ RtlZeroMemory(CreatedFileObject, sizeof(FILE_OBJECT)); - CreatedFileObject->DeviceObject = DeviceObject; + CreatedFileObject->DeviceObject = DeviceObject; CreatedFileObject->Type = IO_TYPE_FILE; CreatedFileObject->Size = sizeof(FILE_OBJECT); CreatedFileObject->Flags = FO_STREAM_FILE; @@ -2036,7 +2036,7 @@ IoCreateStreamFileObjectLite(IN PFILE_OBJECT FileObject OPTIONAL, /* Set File Object Data */ RtlZeroMemory(CreatedFileObject, sizeof(FILE_OBJECT)); - CreatedFileObject->DeviceObject = DeviceObject; + CreatedFileObject->DeviceObject = DeviceObject; CreatedFileObject->Type = IO_TYPE_FILE; CreatedFileObject->Size = sizeof(FILE_OBJECT); CreatedFileObject->Flags = FO_STREAM_FILE; @@ -2824,7 +2824,7 @@ NtCancelIoFile(IN HANDLE FileHandle, } _SEH_HANDLE { - + } _SEH_END; diff --git a/reactos/ntoskrnl/io/iomgr/iofunc.c b/reactos/ntoskrnl/io/iomgr/iofunc.c index 40adab67d26..eb7e39e0bca 100644 --- a/reactos/ntoskrnl/io/iomgr/iofunc.c +++ b/reactos/ntoskrnl/io/iomgr/iofunc.c @@ -893,7 +893,7 @@ IoSetInformation(IN PFILE_OBJECT FileObject, /* * @implemented */ -NTSTATUS +NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, @@ -1530,7 +1530,7 @@ NtQueryDirectoryFile(IN HANDLE FileHandle, _SEH_TRY { /* Allocate a buffer */ - Irp->AssociatedIrp.SystemBuffer = + Irp->AssociatedIrp.SystemBuffer = ExAllocatePoolWithTag(NonPagedPool, Length, TAG_SYSB); diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c index 95290a16b6b..4e22696fb01 100644 --- a/reactos/ntoskrnl/io/iomgr/irp.c +++ b/reactos/ntoskrnl/io/iomgr/irp.c @@ -272,7 +272,7 @@ IopCompleteRequest(IN PKAPC Apc, if (Irp->Flags & IRP_BUFFERED_IO) { /* Check if we have an input buffer and if we succeeded */ - if ((Irp->Flags & IRP_INPUT_OPERATION) && + if ((Irp->Flags & IRP_INPUT_OPERATION) && (Irp->IoStatus.Status != STATUS_VERIFY_REQUIRED) && !(NT_ERROR(Irp->IoStatus.Status))) { diff --git a/reactos/ntoskrnl/io/iomgr/irq.c b/reactos/ntoskrnl/io/iomgr/irq.c index 7af72f685f5..91cd1597d83 100644 --- a/reactos/ntoskrnl/io/iomgr/irq.c +++ b/reactos/ntoskrnl/io/iomgr/irq.c @@ -135,7 +135,7 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, /* * @implemented */ -VOID +VOID NTAPI IoDisconnectInterrupt(PKINTERRUPT InterruptObject) { diff --git a/reactos/ntoskrnl/io/iomgr/util.c b/reactos/ntoskrnl/io/iomgr/util.c index 6f151e82cc5..d9bbd860866 100644 --- a/reactos/ntoskrnl/io/iomgr/util.c +++ b/reactos/ntoskrnl/io/iomgr/util.c @@ -59,7 +59,7 @@ IoGetStackLimits(OUT PULONG LowLimit, /* Save our stack address so we always know it's valid */ StackAddress = (ULONG_PTR)(&StackAddress); - + /* Get stack values */ RtlpGetStackLimits(LowLimit, HighLimit); @@ -201,7 +201,7 @@ IoCheckEaBufferValidity(IN PFILE_FULL_EA_INFORMATION EaBuffer, } } else - { + { /* From the MSDN http://msdn2.microsoft.com/en-us/library/ms795740.aspx For all entries except the last, the value of diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index e8e1f1caa59..87ac29df1ea 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -332,7 +332,7 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, /* Complete, untested */ case DevicePropertyBusTypeGuid: /* Sanity check */ - if ((DeviceNode->ChildBusTypeIndex != 0xFFFF) && + if ((DeviceNode->ChildBusTypeIndex != 0xFFFF) && (DeviceNode->ChildBusTypeIndex < IopBusTypeGuidList->GuidCount)) { /* Return the GUID */ @@ -345,7 +345,7 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, } /* Copy the GUID */ - RtlCopyMemory(PropertyBuffer, + RtlCopyMemory(PropertyBuffer, &(IopBusTypeGuidList->Guids[DeviceNode->ChildBusTypeIndex]), sizeof(GUID)); return STATUS_SUCCESS; @@ -749,7 +749,7 @@ IopGetBusTypeGuidIndex(LPGUID BusTypeGuid) USHORT i = 0, FoundIndex = 0xFFFF; ULONG NewSize; PVOID NewList; - + /* Acquire the lock */ ExAcquireFastMutex(&IopBusTypeGuidList->Lock); diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c index b1ac6d1771f..3055309cf2b 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c @@ -48,7 +48,7 @@ IoReportDetectedDevice( UNICODE_STRING ServiceName; ServiceName.Buffer = DriverObject->DriverName.Buffer + sizeof(DRIVER_ROOT_NAME) / sizeof(WCHAR) - 1; ServiceName.Length = ServiceName.MaximumLength = DriverObject->DriverName.Length - sizeof(DRIVER_ROOT_NAME) + sizeof(WCHAR); - + /* create a new PDO and return it in *DeviceObject */ Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode); if (!NT_SUCCESS(Status)) diff --git a/reactos/ntoskrnl/kd/kdinit.c b/reactos/ntoskrnl/kd/kdinit.c index 048bff02c4f..927a89bd735 100644 --- a/reactos/ntoskrnl/kd/kdinit.c +++ b/reactos/ntoskrnl/kd/kdinit.c @@ -138,7 +138,7 @@ KdpCallInitRoutine(ULONG BootPhase) { PLIST_ENTRY CurrentEntry; PKD_DISPATCH_TABLE CurrentTable; - + /* Call the registered handlers */ CurrentEntry = KdProviders.Flink; while (CurrentEntry != &KdProviders) diff --git a/reactos/ntoskrnl/kd/kdio.c b/reactos/ntoskrnl/kd/kdio.c index 3e48a801ffa..45a68db079f 100644 --- a/reactos/ntoskrnl/kd/kdio.c +++ b/reactos/ntoskrnl/kd/kdio.c @@ -70,8 +70,8 @@ KdpPrintToLog(PCH String, /* Make sure we are initialized and can queue */ if (!KdpLogInitialized || (ItemQueued)) return; - /* - * Queue the work item + /* + * Queue the work item * Note that we don't want to queue if we are > DISPATCH_LEVEL... * The message is in the buffer and will simply be taken care of at * the next time we are at <= DISPATCH, so it won't be lost. diff --git a/reactos/ntoskrnl/kd/wrappers/gdbstub.c b/reactos/ntoskrnl/kd/wrappers/gdbstub.c index e2c7137500e..1e23ef939d0 100644 --- a/reactos/ntoskrnl/kd/wrappers/gdbstub.c +++ b/reactos/ntoskrnl/kd/wrappers/gdbstub.c @@ -1347,7 +1347,7 @@ KdpGdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, if (gdb_attached_yet) { LONG Esp; - + stop_reply: /* reply to host that an exception has occurred */ SigVal = GspComputeSignal(ExceptionRecord->ExceptionCode); @@ -1360,16 +1360,16 @@ KdpGdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, *ptr++ = HexChars[ESP]; *ptr++ = ':'; - + Esp = GspGetEspFromTrapFrame(TrapFrame); /* SP */ ptr = GspMem2Hex((PCHAR) &Esp, ptr, 4, 0); *ptr++ = ';'; - + *ptr++ = HexChars[EBP]; *ptr++ = ':'; ptr = GspMem2Hex((PCHAR) &TrapFrame->Ebp, ptr, 4, 0); /* FP */ *ptr++ = ';'; - + *ptr++ = HexChars[PC]; *ptr++ = ':'; ptr = GspMem2Hex((PCHAR) &TrapFrame->Eip, ptr, 4, 0); /* PC */ @@ -1383,7 +1383,7 @@ KdpGdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, { gdb_attached_yet = 1; } - + Stepping = FALSE; while (TRUE) diff --git a/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c b/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c index 902f858de17..043333b249f 100644 --- a/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c +++ b/reactos/ntoskrnl/kd/wrappers/gdbstub_powerpc.c @@ -1,1714 +1,1714 @@ -/**************************************************************************** - - THIS SOFTWARE IS NOT COPYRIGHTED - - HP offers the following for use in the public domain. HP makes no - warranty with regard to the software or it's performance and the - user accepts the software "AS IS" with all faults. - - HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD - TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -****************************************************************************/ - -/**************************************************************************** - * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ - * - * Module name: remcom.c $ - * Revision: 1.34 $ - * Date: 91/03/09 12:29:49 $ - * Contributor: Lake Stevens Instrument Division$ - * - * Description: low level support for gdb debugger. $ - * - * Considerations: only works on target hardware $ - * - * Written by: Glenn Engel $ - * ModuleState: Experimental $ - * - * NOTES: See Below $ - * - * Modified for 386 by Jim Kingdon, Cygnus Support. - * Modified for ReactOS by Casper S. Hornstrup - * - * To enable debugger support, two things need to happen. One, setting - * up a routine so that it is in the exception path, is necessary in order - * to allow any breakpoints or error conditions to be properly intercepted - * and reported to gdb. - * Two, a breakpoint needs to be generated to begin communication. - * - * Because gdb will sometimes write to the stack area to execute function - * calls, this program cannot rely on using the supervisor stack so it - * uses it's own stack area. - * - ************* - * - * The following gdb commands are supported: - * - * command function Return value - * - * g return the value of the CPU Registers hex data or ENN - * G set the value of the CPU Registers OK or ENN - * - * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN - * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN - * - * c Resume at current address SNN ( signal NN) - * cAA..AA Continue at address AA..AA SNN - * - * s Step one instruction SNN - * sAA..AA Step one instruction from AA..AA SNN - * - * k kill - * - * ? What was the last sigval ? SNN (signal NN) - * - * All commands and responses are sent with a packet which includes a - * Checksum. A packet consists of - * - * $#. - * - * where - * :: - * :: < two hex digits computed as modulo 256 sum of > - * - * When a packet is received, it is first acknowledged with either '+' or '-'. - * '+' indicates a successful transfer. '-' indicates a failed transfer. - * - * Example: - * - * Host: Reply: - * $m0,10#2a +$00010203040506070809101112131415#42 - * - ****************************************************************************/ - -#include -#define NDEBUG -#include - -/************************************************************************/ -/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ -/* at least NUMREGBYTES*2 are needed for register packets */ -#define BUFMAX 1000 - -static BOOLEAN GspInitialized; - -static BOOLEAN GspRemoteDebug; - -static CONST CHAR HexChars[]="0123456789abcdef"; - -static PETHREAD GspRunThread; /* NULL means run all threads */ -static PETHREAD GspDbgThread; -static PETHREAD GspEnumThread; - -static FAST_MUTEX GspLock; - -extern LIST_ENTRY PsActiveProcessHead; -KD_PORT_INFORMATION GdbPortInfo = { 2, 115200, 0 }; /* FIXME hardcoded for COM2, 115200 baud */ - -/* Number of Registers. */ -#define NUMREGS 16 - -enum REGISTER_NAMES -{ - EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI, - PC /* also known as eip */, - PS /* also known as eflags */, - CS, SS, DS, ES, FS, GS -}; - -typedef struct _CPU_REGISTER -{ - ULONG Size; - ULONG OffsetInTF; - ULONG OffsetInContext; - BOOLEAN SetInContext; -} CPU_REGISTER, *PCPU_REGISTER; - -static CPU_REGISTER GspRegisters[NUMREGS] = -{ -}; - -static PCHAR GspThreadStates[DeferredReady+1] = -{ - "Initialized", - "Ready", - "Running", - "Standby", - "Terminated", - "Waiting", - "Transition", - "DeferredReady" -}; - - -LONG -HexValue(CHAR ch) -{ - if ((ch >= '0') && (ch <= '9')) - { - return (ch - '0'); - } - if ((ch >= 'a') && (ch <= 'f')) - { - return (ch - 'a' + 10); - } - if ((ch >= 'A') && (ch <= 'F')) - { - return (ch - 'A' + 10); - } - - return -1; -} - -static CHAR GspInBuffer[BUFMAX]; -static CHAR GspOutBuffer[BUFMAX]; - -VOID -GdbPutChar(UCHAR Value) -{ - KdPortPutByteEx(&GdbPortInfo, Value); -} - -UCHAR -GdbGetChar(VOID) -{ - UCHAR Value; - - while (!KdPortGetByteEx(&GdbPortInfo, &Value)) - ; - - return Value; -} - -/* scan for the sequence $# */ - -PCHAR -GspGetPacket() -{ - PCHAR Buffer = &GspInBuffer[0]; - CHAR Checksum; - CHAR XmitChecksum; - ULONG Count; - CHAR ch; - - while (TRUE) - { - /* wait around for the start character, ignore all other characters */ - while ((ch = GdbGetChar ()) != '$') - ; - - retry: - Checksum = 0; - XmitChecksum = -1; - Count = 0; - - /* now, read until a # or end of Buffer is found */ - while (Count < BUFMAX) - { - ch = GdbGetChar(); - if (ch == '$') - { - goto retry; - } - if (ch == '#') - { - break; - } - Checksum = Checksum + ch; - Buffer[Count] = ch; - Count = Count + 1; - } - Buffer[Count] = 0; - - if (ch == '#') - { - ch = GdbGetChar(); - XmitChecksum = (CHAR)(HexValue(ch) << 4); - ch = GdbGetChar(); - XmitChecksum += (CHAR)(HexValue(ch)); - - if (Checksum != XmitChecksum) - { - GdbPutChar('-'); /* failed checksum */ - } - else - { - GdbPutChar('+'); /* successful transfer */ - - return &Buffer[0]; - } - } - } -} - -/* send the packet in Buffer. */ - -VOID -GspPutPacket(PCHAR Buffer) -{ - CHAR Checksum; - LONG Count; - CHAR ch; - - /* $#. */ - do - { - GdbPutChar('$'); - Checksum = 0; - Count = 0; - - while ((ch = Buffer[Count])) - { - GdbPutChar(ch); - Checksum += ch; - Count += 1; - } - - GdbPutChar('#'); - GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); - GdbPutChar(HexChars[Checksum & 0xf]); - } - while (GdbGetChar() != '+'); -} - - -VOID -GspPutPacketNoWait(PCHAR Buffer) -{ - CHAR Checksum; - LONG Count; - CHAR ch; - - /* $#. */ - GdbPutChar('$'); - Checksum = 0; - Count = 0; - - while ((ch = Buffer[Count])) - { - GdbPutChar(ch); - Checksum += ch; - Count += 1; - } - - GdbPutChar('#'); - GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); - GdbPutChar(HexChars[Checksum & 0xf]); -} - -/* Indicate to caller of GspMem2Hex or GspHex2Mem that there has been an - error. */ -static volatile BOOLEAN GspMemoryError = FALSE; -static volatile void *GspAccessLocation = NULL; - -static CHAR -GspReadMemSafe(PCHAR Address) -{ - CHAR ch; - - if (NULL == Address) - { - GspMemoryError = TRUE; - return '\0'; - } - - GspAccessLocation = Address; - ch = *Address; - GspAccessLocation = NULL; - - return ch; -} - -/* Convert the memory pointed to by Address into hex, placing result in Buffer */ -/* Return a pointer to the last char put in Buffer (null) */ -/* If MayFault is TRUE, then we should set GspMemoryError in response to - a fault; if FALSE treat a fault like any other fault in the stub. */ -static PCHAR -GspMem2Hex(PCHAR Address, - PCHAR Buffer, - LONG Count, - BOOLEAN MayFault) -{ - ULONG i; - CHAR ch; - - for (i = 0; i < (ULONG) Count; i++) - { - if (MayFault) - { - ch = GspReadMemSafe(Address); - if (GspMemoryError) - { - return Buffer; - } - } - else - { - ch = *Address; - } - *Buffer++ = HexChars[(ch >> 4) & 0xf]; - *Buffer++ = HexChars[ch & 0xf]; - Address++; - } - - *Buffer = 0; - return Buffer; -} - -static ULONG -GspWriteMem(PCHAR Address, - ULONG Count, - BOOLEAN MayFault, - CHAR (*GetContent)(PVOID Context, ULONG Offset), - PVOID Context) -{ - PCHAR Current; - PCHAR Page; - ULONG CountInPage; - ULONG i; - CHAR ch; - ULONG OldProt = 0; - - Current = Address; - while (Current < Address + Count) - { - Page = (PCHAR)PAGE_ROUND_DOWN(Current); - if (Address + Count <= Page + PAGE_SIZE) - { - /* Fits in this page */ - CountInPage = Count; - } - else - { - /* Flows into next page, handle only current page in this iteration */ - CountInPage = PAGE_SIZE - (Address - Page); - } - if (MayFault) - { - OldProt = MmGetPageProtect(NULL, Address); - MmSetPageProtect(NULL, Address, PAGE_EXECUTE_READWRITE); - } - - for (i = 0; i < CountInPage && ! GspMemoryError; i++) - { - ch = (*GetContent)(Context, Current - Address); - - if (MayFault) - { - GspAccessLocation = Current; - } - *Current = ch; - if (MayFault) - { - GspAccessLocation = NULL; - } - Current++; - } - if (MayFault) - { - MmSetPageProtect(NULL, Page, OldProt); - if (GspMemoryError) - { - return Current - Address; - } - } - } - - return Current - Address; -} - -static CHAR -GspHex2MemGetContent(PVOID Context, ULONG Offset) -{ - return (CHAR)((HexValue(*((PCHAR) Context + 2 * Offset)) << 4) + - HexValue(*((PCHAR) Context + 2 * Offset + 1))); -} - -/* Convert the hex array pointed to by Buffer into binary to be placed at Address */ -/* Return a pointer to the character AFTER the last byte read from Buffer */ -static PCHAR -GspHex2Mem(PCHAR Buffer, - PCHAR Address, - ULONG Count, - BOOLEAN MayFault) -{ - Count = GspWriteMem(Address, Count, MayFault, GspHex2MemGetContent, Buffer); - - return Buffer + 2 * Count; -} - -static CHAR -GspWriteMemSafeGetContent(PVOID Context, ULONG Offset) -{ - ASSERT(0 == Offset); - - return *((PCHAR) Context); -} - -static void -GspWriteMemSafe(PCHAR Address, - CHAR Ch) -{ - GspWriteMem(Address, 1, TRUE, GspWriteMemSafeGetContent, &Ch); -} - - -/* This function takes the 386 exception vector and attempts to - translate this number into a unix compatible signal value */ -ULONG -GspComputeSignal(NTSTATUS ExceptionCode) -{ - ULONG SigVal; - - switch (ExceptionCode) - { - case STATUS_INTEGER_DIVIDE_BY_ZERO: - SigVal = 8; /* divide by zero */ - break; - case STATUS_SINGLE_STEP: - case STATUS_BREAKPOINT: - SigVal = 5; /* breakpoint */ - break; - case STATUS_INTEGER_OVERFLOW: - case STATUS_ARRAY_BOUNDS_EXCEEDED: - SigVal = 16; /* bound instruction */ - break; - case STATUS_ILLEGAL_INSTRUCTION: - SigVal = 4; /* Invalid opcode */ - break; - case STATUS_STACK_OVERFLOW: - case STATUS_DATATYPE_MISALIGNMENT: - case STATUS_ACCESS_VIOLATION: - SigVal = 11; /* access violation */ - break; - default: - SigVal = 7; /* "software generated" */ - } - return SigVal; -} - - -/**********************************************/ -/* WHILE WE FIND NICE HEX CHARS, BUILD A LONG */ -/* RETURN NUMBER OF CHARS PROCESSED */ -/**********************************************/ -LONG -GspHex2Long(PCHAR *Address, - PLONG Value) -{ - LONG NumChars = 0; - LONG Hex; - - *Value = 0; - - while (**Address) - { - Hex = HexValue(**Address); - if (Hex >= 0) - { - *Value = (*Value << 4) | Hex; - NumChars++; - } - else - { - break; - } - - (*Address)++; - } - - return NumChars; -} - - -VOID -GspLong2Hex(PCHAR *Address, - LONG Value) -{ - LONG Save; - - Save = (((Value >> 0) & 0xff) << 24) | - (((Value >> 8) & 0xff) << 16) | - (((Value >> 16) & 0xff) << 8) | - (((Value >> 24) & 0xff) << 0); - *Address = GspMem2Hex((PCHAR) &Save, *Address, 4, FALSE); -} - - -/* - * When coming from kernel mode, Esp is not stored in the trap frame. - * Instead, it was pointing to the location of the TrapFrame Esp member - * when the exception occured. When coming from user mode, Esp is just - * stored in the TrapFrame Esp member. - */ -static LONG -GspGetEspFromTrapFrame(PKTRAP_FRAME TrapFrame) -{ - return KeGetPreviousMode() == KernelMode - ? (LONG) &TrapFrame->Gpr1 : (LONG)TrapFrame->Gpr1; -} - - -static VOID -GspGetRegisters(PCHAR Address, - PKTRAP_FRAME TrapFrame) -{ - ULONG_PTR Value; - PULONG p; - ULONG i; - PETHREAD Thread; - ULONG_PTR *KernelStack; - - if (NULL == GspDbgThread) - { - Thread = PsGetCurrentThread(); - } - else - { - TrapFrame = GspDbgThread->Tcb.TrapFrame; - Thread = GspDbgThread; - } - - if (Waiting == Thread->Tcb.State) - { - KernelStack = Thread->Tcb.KernelStack; - for (i = 0; i < sizeof(GspRegisters) / sizeof(GspRegisters[0]); i++) - { - switch(i) - { - } - Address = GspMem2Hex((PCHAR) &Value, Address, GspRegisters[i].Size, - FALSE); - } - } - else - { - for (i = 0; i < sizeof(GspRegisters) / sizeof(GspRegisters[0]); i++) - { - if (TrapFrame) - { - if (ESP == i) - { - Value = GspGetEspFromTrapFrame(TrapFrame); - } - else - { - p = (PULONG)((ULONG_PTR) TrapFrame + - GspRegisters[i].OffsetInTF); - Value = *p; - } - } - else if (i == PC) - { - /* - * This thread has not been sheduled yet so assume it - * is still in PsBeginThreadWithContextInternal(). - */ - Value = (ULONG)KiThreadStartup; - } - else - { - Value = 0; - } - Address = GspMem2Hex((PCHAR) &Value, Address, - GspRegisters[i].Size, FALSE); - } - } -} - - -VOID -GspSetRegistersInTrapFrame(PCHAR Address, - PCONTEXT Context, - PKTRAP_FRAME TrapFrame) -{ - ULONG Value; - PCHAR Buffer; - PULONG p; - ULONG i; - - if (!TrapFrame) - { - return; - } - - Buffer = Address; - for (i = 0; i < NUMREGS; i++) - { - if (GspRegisters[i].SetInContext) - { - p = (PULONG) ((ULONG_PTR) Context + GspRegisters[i].OffsetInContext); - } - else - { - p = (PULONG) ((ULONG_PTR) TrapFrame + GspRegisters[i].OffsetInTF); - } - Value = 0; - Buffer = GspHex2Mem(Buffer, (PCHAR) &Value, GspRegisters[i].Size, FALSE); - *p = Value; - } -} - - -VOID -GspSetSingleRegisterInTrapFrame(PCHAR Address, - LONG Number, - PCONTEXT Context, - PKTRAP_FRAME TrapFrame) -{ - ULONG Value; - PULONG p; - - if (!TrapFrame) - { - return; - } - - if (GspRegisters[Number].SetInContext) - { - p = (PULONG) ((ULONG_PTR) Context + GspRegisters[Number].OffsetInContext); - } - else - { - p = (PULONG) ((ULONG_PTR) TrapFrame + GspRegisters[Number].OffsetInTF); - } - Value = 0; - GspHex2Mem(Address, (PCHAR) &Value, GspRegisters[Number].Size, FALSE); - *p = Value; -} - - -BOOLEAN -GspFindThread(PCHAR Data, - PETHREAD *Thread) -{ - PETHREAD ThreadInfo = NULL; - - if (strcmp (Data, "-1") == 0) - { - /* All threads */ - ThreadInfo = NULL; - } - else - { - ULONG uThreadId; - HANDLE ThreadId; - PCHAR ptr = &Data[0]; - - GspHex2Long(&ptr, (PLONG) &uThreadId); - ThreadId = (HANDLE)uThreadId; - - if (!NT_SUCCESS(PsLookupThreadByThreadId(ThreadId, &ThreadInfo))) - { - *Thread = NULL; - return FALSE; - } - } - *Thread = ThreadInfo; - return TRUE; -} - - -VOID -GspSetThread(PCHAR Request) -{ - PETHREAD ThreadInfo; - PCHAR ptr = &Request[1]; - - switch (Request[0]) - { - case 'c': /* Run thread */ - if (GspFindThread(ptr, &ThreadInfo)) - { - GspOutBuffer[0] = 'O'; - GspOutBuffer[1] = 'K'; - - if (NULL != GspRunThread) - { - ObDereferenceObject(GspRunThread); - } - GspRunThread = ThreadInfo; - if (NULL != GspRunThread) - { - ObReferenceObject(GspRunThread); - } - } - else - { - GspOutBuffer[0] = 'E'; - } - break; - case 'g': /* Debug thread */ - if (GspFindThread(ptr, &ThreadInfo)) - { - GspOutBuffer[0] = 'O'; - GspOutBuffer[1] = 'K'; - - if (NULL != GspDbgThread) - { - ObDereferenceObject(GspDbgThread); - } - - if (ThreadInfo == PsGetCurrentThread()) - { - GspDbgThread = NULL; - ObDereferenceObject(ThreadInfo); - } - else - { - GspDbgThread = ThreadInfo; - } - } - else - { - GspOutBuffer[0] = 'E'; - } - break; - default: - break; - } -} - - -VOID -GspQuery(PCHAR Request) -{ - ULONG Value; - - if (strncmp(Request, "C", 1) == 0) - { - PCHAR ptr = &GspOutBuffer[2]; - - /* Get current thread id */ - GspOutBuffer[0] = 'Q'; - GspOutBuffer[1] = 'C'; - if (NULL != GspDbgThread) - { - Value = (ULONG) GspDbgThread->Cid.UniqueThread; - } - else - { - Value = (ULONG) PsGetCurrentThread()->Cid.UniqueThread; - } - GspLong2Hex(&ptr, Value); - } - else if (strncmp(Request, "fThreadInfo", 11) == 0) - { - PEPROCESS Process; - PLIST_ENTRY AThread, AProcess; - PCHAR ptr = &GspOutBuffer[1]; - - /* Get first thread id */ - GspEnumThread = NULL; - AProcess = PsActiveProcessHead.Flink; - while(AProcess != &PsActiveProcessHead) - { - Process = CONTAINING_RECORD(AProcess, EPROCESS, ActiveProcessLinks); - AThread = Process->ThreadListHead.Flink; - if (AThread != &Process->ThreadListHead) - { - GspEnumThread = CONTAINING_RECORD(Process->ThreadListHead.Flink, - ETHREAD, ThreadListEntry); - break; - } - AProcess = AProcess->Flink; - } - if(GspEnumThread != NULL) - { - GspOutBuffer[0] = 'm'; - Value = (ULONG) GspEnumThread->Cid.UniqueThread; - GspLong2Hex(&ptr, Value); - } - else - { - /* FIXME - what to do here? This case should never happen though, there - should always be at least one thread on the system... */ - /* GspOutBuffer[0] = 'l'; */ - } - } - else if (strncmp(Request, "sThreadInfo", 11) == 0) - { - PEPROCESS Process; - PLIST_ENTRY AThread, AProcess; - PCHAR ptr = &GspOutBuffer[1]; - - /* Get next thread id */ - if (GspEnumThread != NULL) - { - /* find the next thread */ - Process = GspEnumThread->ThreadsProcess; - if(GspEnumThread->ThreadListEntry.Flink != &Process->ThreadListHead) - { - GspEnumThread = CONTAINING_RECORD(GspEnumThread->ThreadListEntry.Flink, - ETHREAD, ThreadListEntry); - } - else - { - PETHREAD Thread = NULL; - AProcess = Process->ActiveProcessLinks.Flink; - while(AProcess != &PsActiveProcessHead) - { - Process = CONTAINING_RECORD(AProcess, EPROCESS, ActiveProcessLinks); - AThread = Process->ThreadListHead.Flink; - if (AThread != &Process->ThreadListHead) - { - Thread = CONTAINING_RECORD(Process->ThreadListHead.Flink, - ETHREAD, ThreadListEntry); - break; - } - AProcess = AProcess->Flink; - } - GspEnumThread = Thread; - } - - if (GspEnumThread != NULL) - { - /* return the ID */ - GspOutBuffer[0] = 'm'; - Value = (ULONG) GspEnumThread->Cid.UniqueThread; - GspLong2Hex(&ptr, Value); - } - else - { - GspOutBuffer[0] = 'l'; - } - } - else - { - GspOutBuffer[0] = 'l'; - } - } - else if (strncmp(Request, "ThreadExtraInfo", 15) == 0) - { - PETHREAD ThreadInfo; - - /* Get thread information */ - if (GspFindThread(Request + 16, &ThreadInfo)) - { - char Buffer[64]; - PEPROCESS Proc; - - Proc = (PEPROCESS) ThreadInfo->ThreadsProcess; - - Buffer[0] = '\0'; - if (NULL != Proc ) - { - sprintf(Buffer, "%s [%d:0x%x], ", Proc->ImageFileName, - (int) Proc->UniqueProcessId, - (int) ThreadInfo->Cid.UniqueThread); - } - strcpy(Buffer + strlen(Buffer), - GspThreadStates[ThreadInfo->Tcb.State]); - - ObDereferenceObject(ThreadInfo); - - GspMem2Hex(Buffer, &GspOutBuffer[0], strlen(Buffer), FALSE); - } - } -} - -VOID -GspQueryThreadStatus(PCHAR Request) -{ - PETHREAD ThreadInfo; - PCHAR ptr = &Request[0]; - - if (GspFindThread(ptr, &ThreadInfo)) - { - ObDereferenceObject(ThreadInfo); - - GspOutBuffer[0] = 'O'; - GspOutBuffer[1] = 'K'; - GspOutBuffer[2] = '\0'; - } - else - { - GspOutBuffer[0] = 'E'; - GspOutBuffer[1] = '\0'; - } -} - -#define DR7_L0 0x00000001 /* Local breakpoint 0 enable */ -#define DR7_G0 0x00000002 /* Global breakpoint 0 enable */ -#define DR7_L1 0x00000004 /* Local breakpoint 1 enable */ -#define DR7_G1 0x00000008 /* Global breakpoint 1 enable */ -#define DR7_L2 0x00000010 /* Local breakpoint 2 enable */ -#define DR7_G2 0x00000020 /* Global breakpoint 2 enable */ -#define DR7_L3 0x00000040 /* Local breakpoint 3 enable */ -#define DR7_G3 0x00000080 /* Global breakpoint 3 enable */ -#define DR7_LE 0x00000100 /* Local exact breakpoint enable (old) */ -#define DR7_GE 0x00000200 /* Global exact breakpoint enable (old) */ -#define DR7_GD 0x00002000 /* General detect enable */ -#define DR7_TYPE0_MASK 0x00030000 /* Breakpoint 0 condition */ -#define DR7_LEN0_MASK 0x000c0000 /* Breakpoint 0 length */ -#define DR7_TYPE1_MASK 0x00300000 /* Breakpoint 1 condition */ -#define DR7_LEN1_MASK 0x00c00000 /* Breakpoint 1 length */ -#define DR7_TYPE2_MASK 0x03000000 /* Breakpoint 2 condition */ -#define DR7_LEN2_MASK 0x0c000000 /* Breakpoint 2 length */ -#define DR7_TYPE3_MASK 0x30000000 /* Breakpoint 3 condition */ -#define DR7_LEN3_MASK 0xc0000000 /* Breakpoint 3 length */ -#define DR7_GLOBAL_ENABLE(Bp) (2 << (2 * (Bp))) -#define DR7_TYPE(Bp, Type) ((Type) << (16 + 4 * (Bp))) -#define DR7_LEN(Bp, Len) ((Len) << (18 + 4 * (Bp))) - -#define I386_BP_TYPE_EXECUTE 0 -#define I386_BP_TYPE_DATA_WRITE 1 -#define I386_BP_TYPE_DATA_READWRITE 3 - -#define I386_OPCODE_INT3 0xcc - -#define GDB_ZTYPE_MEMORY_BREAKPOINT 0 -#define GDB_ZTYPE_HARDWARE_BREAKPOINT 1 -#define GDB_ZTYPE_WRITE_WATCHPOINT 2 -#define GDB_ZTYPE_READ_WATCHPOINT 3 -#define GDB_ZTYPE_ACCESS_WATCHPOINT 4 - -typedef struct _GSPHWBREAKPOINT -{ - ULONG Type; - ULONG_PTR Address; - ULONG Length; -} GSPHWBREAKPOINT; - -#define MAX_HW_BREAKPOINTS 4 -static unsigned GspHwBreakpointCount = 0; -static GSPHWBREAKPOINT GspHwBreakpoints[MAX_HW_BREAKPOINTS]; - -typedef struct _GSPSWBREAKPOINT -{ - ULONG_PTR Address; - CHAR PrevContent; - BOOLEAN Active; -} GSPSWBREAKPOINT; - -#define MAX_SW_BREAKPOINTS 64 -static unsigned GspSwBreakpointCount = 0; -static GSPSWBREAKPOINT GspSwBreakpoints[MAX_SW_BREAKPOINTS]; - -static void -GspSetHwBreakpoint(ULONG Type, ULONG_PTR Address, ULONG Length) -{ - DPRINT("GspSetHwBreakpoint(%lu, 0x%p, %lu)\n", Type, Address, Length); - - if (GDB_ZTYPE_READ_WATCHPOINT == Type) - { - DPRINT1("Read watchpoint not supported\n"); - strcpy(GspOutBuffer, "E22"); - } - else if (GDB_ZTYPE_HARDWARE_BREAKPOINT == Type && 1 != Length) - { - DPRINT1("Invalid length %lu for hardware breakpoint\n", Length); - strcpy(GspOutBuffer, "E22"); - } - else if (1 != Length && 2 != Length && 4 != Length) - { - DPRINT1("Invalid length %lu for GDB Z type %lu\n", Length, Type); - strcpy(GspOutBuffer, "E22"); - } - else if (0 != (Address & (Length - 1))) - { - DPRINT1("Invalid alignment for address 0x%p and length %d\n", - Address, Length); - strcpy(GspOutBuffer, "E22"); - } - else if (MAX_HW_BREAKPOINTS == GspHwBreakpointCount) - { - DPRINT1("Trying to set too many hardware breakpoints\n"); - strcpy(GspOutBuffer, "E22"); - } - else - { - DPRINT("Stored at index %u\n", GspHwBreakpointCount); - GspHwBreakpoints[GspHwBreakpointCount].Type = Type; - GspHwBreakpoints[GspHwBreakpointCount].Address = Address; - GspHwBreakpoints[GspHwBreakpointCount].Length = Length; - GspHwBreakpointCount++; - strcpy(GspOutBuffer, "OK"); - } -} - -static void -GspRemoveHwBreakpoint(ULONG Type, ULONG_PTR Address, ULONG Length) -{ - unsigned Index; - - DPRINT("GspRemoveHwBreakpoint(%lu, 0x%p, %lu)\n", Type, Address, Length); - for (Index = 0; Index < GspHwBreakpointCount; Index++) - { - if (GspHwBreakpoints[Index].Type == Type && - GspHwBreakpoints[Index].Address == Address && - GspHwBreakpoints[Index].Length == Length) - { - DPRINT("Found match at index %u\n", Index); - if (Index + 1 < GspHwBreakpointCount) - { - memmove(GspHwBreakpoints + Index, - GspHwBreakpoints + (Index + 1), - (GspHwBreakpointCount - Index - 1) * - sizeof(GSPHWBREAKPOINT)); - } - GspHwBreakpointCount--; - strcpy(GspOutBuffer, "OK"); - return; - } - } - - DPRINT1("Not found\n"); - strcpy(GspOutBuffer, "E22"); -} - -static void -GspSetSwBreakpoint(ULONG_PTR Address) -{ - DPRINT("GspSetSwBreakpoint(0x%p)\n", Address); - - if (MAX_SW_BREAKPOINTS == GspSwBreakpointCount) - { - DPRINT1("Trying to set too many software breakpoints\n"); - strcpy(GspOutBuffer, "E22"); - } - else - { - DPRINT("Stored at index %u\n", GspSwBreakpointCount); - GspSwBreakpoints[GspSwBreakpointCount].Address = Address; - GspSwBreakpoints[GspSwBreakpointCount].Active = FALSE; - GspSwBreakpointCount++; - strcpy(GspOutBuffer, "OK"); - } -} - -static void -GspRemoveSwBreakpoint(ULONG_PTR Address) -{ - unsigned Index; - - DPRINT("GspRemoveSwBreakpoint(0x%p)\n", Address); - for (Index = 0; Index < GspSwBreakpointCount; Index++) - { - if (GspSwBreakpoints[Index].Address == Address) - { - DPRINT("Found match at index %u\n", Index); - ASSERT(! GspSwBreakpoints[Index].Active); - if (Index + 1 < GspSwBreakpointCount) - { - memmove(GspSwBreakpoints + Index, - GspSwBreakpoints + (Index + 1), - (GspSwBreakpointCount - Index - 1) * - sizeof(GSPSWBREAKPOINT)); - } - GspSwBreakpointCount--; - strcpy(GspOutBuffer, "OK"); - return; - } - } - - DPRINT1("Not found\n"); - strcpy(GspOutBuffer, "E22"); -} - -static void -GspLoadHwBreakpoint(PKTRAP_FRAME TrapFrame, - unsigned BpIndex, - ULONG_PTR Address, - ULONG Length, - ULONG Type) -{ - DPRINT("GspLoadHwBreakpoint(0x%p, %d, 0x%p, %d)\n", TrapFrame, BpIndex, - Address, Type); - - /* Set the DR7_Gx bit to globally enable the breakpoint */ - TrapFrame->Dr7 |= DR7_GLOBAL_ENABLE(BpIndex) | - DR7_LEN(BpIndex, Length) | - DR7_TYPE(BpIndex, Type); - - switch (BpIndex) - { - case 0: - DPRINT("Setting DR0 to 0x%p\n", Address); - TrapFrame->Dr0 = Address; - break; - - case 1: - DPRINT("Setting DR1 to 0x%p\n", Address); - TrapFrame->Dr1 = Address; - break; - - case 2: - DPRINT("Setting DR2 to 0x%p\n", Address); - TrapFrame->Dr2 = Address; - break; - - case 3: - DPRINT("Setting DR3 to 0x%p\n", Address); - TrapFrame->Dr3 = Address; - break; - } -} - -static void -GspLoadBreakpoints(PKTRAP_FRAME TrapFrame) -{ - unsigned Index; - ULONG i386Type; - - DPRINT("GspLoadBreakpoints\n"); - DPRINT("DR7 on entry: 0x%08x\n", TrapFrame->Dr7); - /* Remove all breakpoints */ - TrapFrame->Dr7 &= ~(DR7_L0 | DR7_L1 | DR7_L2 | DR7_L3 | - DR7_G0 | DR7_G1 | DR7_G2 | DR7_G3 | - DR7_TYPE0_MASK | DR7_LEN0_MASK | - DR7_TYPE1_MASK | DR7_LEN1_MASK | - DR7_TYPE2_MASK | DR7_LEN2_MASK | - DR7_TYPE3_MASK | DR7_LEN3_MASK); - - for (Index = 0; Index < GspHwBreakpointCount; Index++) - { - switch(GspHwBreakpoints[Index].Type) - { - case GDB_ZTYPE_HARDWARE_BREAKPOINT: - i386Type = I386_BP_TYPE_EXECUTE; - break; - case GDB_ZTYPE_WRITE_WATCHPOINT: - i386Type = I386_BP_TYPE_DATA_WRITE; - break; - case GDB_ZTYPE_ACCESS_WATCHPOINT: - i386Type = I386_BP_TYPE_DATA_READWRITE; - break; - default: - ASSERT(FALSE); - i386Type = I386_BP_TYPE_EXECUTE; - break; - } - - GspLoadHwBreakpoint(TrapFrame, Index, GspHwBreakpoints[Index].Address, - GspHwBreakpoints[Index].Length - 1, i386Type); - } - - for (Index = 0; Index < GspSwBreakpointCount; Index++) - { - if (GspHwBreakpointCount + Index < MAX_HW_BREAKPOINTS) - { - DPRINT("Implementing software interrupt using hardware register\n"); - GspLoadHwBreakpoint(TrapFrame, GspHwBreakpointCount + Index, - GspSwBreakpoints[Index].Address, 0, - I386_BP_TYPE_EXECUTE); - GspSwBreakpoints[Index].Active = FALSE; - } - else - { - DPRINT("Using real software breakpoint\n"); - GspMemoryError = FALSE; - GspSwBreakpoints[Index].PrevContent = GspReadMemSafe((PCHAR) GspSwBreakpoints[Index].Address); - if (! GspMemoryError) - { - GspWriteMemSafe((PCHAR) GspSwBreakpoints[Index].Address, I386_OPCODE_INT3); - } - GspSwBreakpoints[Index].Active = ! GspMemoryError; - if (GspMemoryError) - { - DPRINT1("Failed to set software breakpoint at 0x%p\n", - GspSwBreakpoints[Index].Address); - } - else - { - DPRINT("Successfully set software breakpoint at 0x%p\n", - GspSwBreakpoints[Index].Address); - DPRINT1("Successfully set software breakpoint at 0x%p\n", GspSwBreakpoints[Index].Address); - } - } - } - - DPRINT("Final DR7 value 0x%08x\n", TrapFrame->Dr7); -} - -static void -GspUnloadBreakpoints(PKTRAP_FRAME TrapFrame) -{ - unsigned Index; - - DPRINT("GspUnloadHwBreakpoints\n"); - - for (Index = 0; Index < GspSwBreakpointCount; Index++) - { - if (GspSwBreakpoints[Index].Active) - { - GspMemoryError = FALSE; - GspWriteMemSafe((PCHAR) GspSwBreakpoints[Index].Address, - GspSwBreakpoints[Index].PrevContent); - GspSwBreakpoints[Index].Active = FALSE; - if (GspMemoryError) - { - DPRINT1("Failed to remove software breakpoint from 0x%p\n", - GspSwBreakpoints[Index].Address); - } - else - { - DPRINT("Successfully removed software breakpoint from 0x%p\n", - GspSwBreakpoints[Index].Address); - } - } - } -} - -static BOOLEAN gdb_attached_yet = FALSE; -/* - * This function does all command procesing for interfacing to gdb. - */ -KD_CONTINUE_TYPE -STDCALL -KdpGdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, - PCONTEXT Context, - PKTRAP_FRAME TrapFrame) -{ - BOOLEAN Stepping; - LONG Address; - LONG Length; - LONG SigVal = 0; - //LONG NewPC; - PCHAR ptr; - - /* FIXME: Stop on other CPUs too */ - - if (STATUS_ACCESS_VIOLATION == (NTSTATUS) ExceptionRecord->ExceptionCode && - NULL != GspAccessLocation && - (ULONG_PTR) GspAccessLocation == - (ULONG_PTR) ExceptionRecord->ExceptionInformation[1]) - { - GspAccessLocation = NULL; - GspMemoryError = TRUE; - //Context->Eip += 3; - } - else - { - DPRINT("Thread %p entering stub\n", PsGetCurrentThread()); - /* Can only debug 1 thread at a time... */ - ExAcquireFastMutex(&GspLock); - DPRINT("Thread %p acquired mutex\n", PsGetCurrentThread()); - - /* Disable hardware debugging while we are inside the stub */ - //Ke386SetDr7(0); - GspUnloadBreakpoints(TrapFrame); - - /* Make sure we're debugging the current thread. */ - if (NULL != GspDbgThread) - { - DPRINT1("Internal error: entering stub with non-NULL GspDbgThread\n"); - ObDereferenceObject(GspDbgThread); - GspDbgThread = NULL; - } - - /* ugly hack to avoid attempting to send status at the very - * beginning, right when GDB is trying to query the stub */ - if (gdb_attached_yet) - { - LONG Esp; - - stop_reply: - /* reply to host that an exception has occurred */ - SigVal = GspComputeSignal(ExceptionRecord->ExceptionCode); - - ptr = GspOutBuffer; - - *ptr++ = 'T'; /* notify gdb with signo, PC, FP and SP */ - *ptr++ = HexChars[(SigVal >> 4) & 0xf]; - *ptr++ = HexChars[SigVal & 0xf]; - - *ptr++ = HexChars[ESP]; - *ptr++ = ':'; - - Esp = GspGetEspFromTrapFrame(TrapFrame); /* SP */ - ptr = GspMem2Hex((PCHAR) &Esp, ptr, 4, 0); - *ptr++ = ';'; - - *ptr++ = HexChars[EBP]; - *ptr++ = ':'; - //ptr = GspMem2Hex((PCHAR) &TrapFrame->Ebp, ptr, 4, 0); /* FP */ - *ptr++ = ';'; - - *ptr++ = HexChars[PC]; - *ptr++ = ':'; - //ptr = GspMem2Hex((PCHAR) &TrapFrame->Eip, ptr, 4, 0); /* PC */ - *ptr++ = ';'; - - *ptr = '\0'; - - GspPutPacket(&GspOutBuffer[0]); - } - else - { - gdb_attached_yet = 1; - } - - Stepping = FALSE; - - while (TRUE) - { - /* Zero the buffer now so we don't have to worry about the terminating zero character */ - memset(GspOutBuffer, 0, sizeof(GspInBuffer)); - ptr = GspGetPacket(); - - switch(*ptr++) - { - case '?': - /* a little hack to send more complete status information */ - goto stop_reply; - GspOutBuffer[0] = 'S'; - GspOutBuffer[1] = HexChars[SigVal >> 4]; - GspOutBuffer[2] = HexChars[SigVal % 16]; - GspOutBuffer[3] = 0; - break; - case 'd': - GspRemoteDebug = !GspRemoteDebug; /* toggle debug flag */ - break; - case 'g': /* return the value of the CPU Registers */ - GspGetRegisters(GspOutBuffer, TrapFrame); - break; - case 'G': /* set the value of the CPU Registers - return OK */ - if (NULL != GspDbgThread) - { - GspSetRegistersInTrapFrame(ptr, Context, GspDbgThread->Tcb.TrapFrame); - } - else - { - GspSetRegistersInTrapFrame(ptr, Context, TrapFrame); - } - strcpy(GspOutBuffer, "OK"); - break; - case 'P': /* set the value of a single CPU register - return OK */ - { - LONG Register; - - if ((GspHex2Long(&ptr, &Register)) && (*ptr++ == '=')) - { - if ((Register >= 0) && (Register < NUMREGS)) - { - if (GspDbgThread) - { - GspSetSingleRegisterInTrapFrame(ptr, Register, - Context, - GspDbgThread->Tcb.TrapFrame); - } - else - { - GspSetSingleRegisterInTrapFrame(ptr, Register, - Context, TrapFrame); - } - strcpy(GspOutBuffer, "OK"); - break; - } - } - - strcpy(GspOutBuffer, "E01"); - break; - } - - /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ - case 'm': - /* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */ - if (GspHex2Long(&ptr, &Address) && - *(ptr++) == ',' && - GspHex2Long(&ptr, &Length)) - { - PEPROCESS DbgProcess = NULL; - - ptr = NULL; - if (NULL != GspDbgThread && - PsGetCurrentProcess() != GspDbgThread->ThreadsProcess) - { - DbgProcess = GspDbgThread->ThreadsProcess; - KeAttachProcess(&DbgProcess->Pcb); - } - GspMemoryError = FALSE; - GspMem2Hex((PCHAR) Address, GspOutBuffer, Length, 1); - if (NULL != DbgProcess) - { - KeDetachProcess(); - } - if (GspMemoryError) - { - strcpy(GspOutBuffer, "E03"); - DPRINT("Fault during memory read\n"); - } - } - - if (NULL != ptr) - { - strcpy(GspOutBuffer, "E01"); - } - break; - - /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ - case 'M': - /* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */ - if (GspHex2Long(&ptr, &Address)) - { - if (*(ptr++) == ',' && - GspHex2Long(&ptr, &Length) && - *(ptr++) == ':') - { - PEPROCESS DbgProcess = NULL; - - if (NULL != GspDbgThread && - PsGetCurrentProcess() != GspDbgThread->ThreadsProcess) - { - DbgProcess = GspDbgThread->ThreadsProcess; - KeAttachProcess(&DbgProcess->Pcb); - } - GspMemoryError = FALSE; - GspHex2Mem(ptr, (PCHAR) Address, Length, TRUE); - if (NULL != DbgProcess) - { - KeDetachProcess(); - } - if (GspMemoryError) - { - strcpy(GspOutBuffer, "E03"); - DPRINT("Fault during memory write\n"); - } - else - { - strcpy(GspOutBuffer, "OK"); - } - ptr = NULL; - } - } - - if (NULL != ptr) - { - strcpy(GspOutBuffer, "E02"); - } - break; - - /* cAA..AA Continue at address AA..AA(optional) */ - /* sAA..AA Step one instruction from AA..AA(optional) */ - case 's': - Stepping = TRUE; - case 'c': - { - ULONG BreakpointNumber; - ULONG dr6_ = 0; - - /* try to read optional parameter, pc unchanged if no parm */ - if (GspHex2Long (&ptr, &Address)) - { - //Context->Eip = Address; - } - - //NewPC = Context->Eip; - - /* clear the trace bit */ - //Context->EFlags &= 0xfffffeff; - - /* set the trace bit if we're Stepping */ - if (Stepping) - { - //Context->EFlags |= 0x100; - } - - // XXX arty load dr6 - if (!(dr6_ & 0x4000)) - { - for (BreakpointNumber = 0; BreakpointNumber < 4; ++BreakpointNumber) - { - if (dr6_ & (1 << BreakpointNumber)) - { - if (GspHwBreakpoints[BreakpointNumber].Type == 0) - { - /* Set restore flag */ - //Context->EFlags |= 0x10000; - break; - } - } - } - } - GspLoadBreakpoints(TrapFrame); - // XXX load dr6 - if (NULL != GspDbgThread) - { - ObDereferenceObject(GspDbgThread); - GspDbgThread = NULL; - } - - DPRINT("Thread %p releasing mutex\n", PsGetCurrentThread()); - ExReleaseFastMutex(&GspLock); - DPRINT("Thread %p leaving stub\n", PsGetCurrentThread()); - return kdContinue; - break; - } - - case 'k': /* kill the program */ - strcpy(GspOutBuffer, "OK"); - break; - /* kill the program */ - - case 'H': /* Set thread */ - GspSetThread(ptr); - break; - - case 'q': /* Query */ - GspQuery(ptr); - break; - - case 'T': /* Query thread status */ - GspQueryThreadStatus(ptr); - break; - - case 'Z': - { - LONG Type; - LONG Address; - LONG Length; - - GspHex2Long(&ptr, &Type); - ptr++; - GspHex2Long(&ptr, &Address); - ptr++; - GspHex2Long(&ptr, &Length); - if (0 == Type) - { - GspSetSwBreakpoint((ULONG_PTR) Address); - } - else - { - GspSetHwBreakpoint(Type, (ULONG_PTR) Address, Length); - } - break; - } - - case 'z': - { - LONG Type; - LONG Address; - LONG Length; - - GspHex2Long(&ptr, &Type); - ptr++; - GspHex2Long(&ptr, &Address); - ptr++; - GspHex2Long(&ptr, &Length); - if (0 == Type) - { - GspRemoveSwBreakpoint((ULONG_PTR) Address); - } - else - { - GspRemoveHwBreakpoint(Type, (ULONG_PTR) Address, Length); - } - break; - } - - default: - break; - } - - /* reply to the request */ - GspPutPacket(GspOutBuffer); - } - - /* not reached */ - ASSERT(0); - } - - if (NULL != GspDbgThread) - { - ObDereferenceObject(GspDbgThread); - GspDbgThread = NULL; - } - - return kdContinue; -} - - -BOOLEAN -STDCALL -GspBreakIn(PKINTERRUPT Interrupt, - PVOID ServiceContext) -{ - PKTRAP_FRAME TrapFrame; - BOOLEAN DoBreakIn; - CONTEXT Context; - KIRQL OldIrql; - UCHAR Value; - - DPRINT("Break In\n"); - - DoBreakIn = FALSE; - while (KdPortGetByteEx(&GdbPortInfo, &Value)) - { - if (Value == 0x03) - { - DoBreakIn = TRUE; - } - } - - if (!DoBreakIn) - { - return TRUE; - } - - KeRaiseIrql(HIGH_LEVEL, &OldIrql); - - TrapFrame = PsGetCurrentThread()->Tcb.TrapFrame; - - KeTrapFrameToContext(TrapFrame, NULL, &Context); - - KdpGdbEnterDebuggerException(NULL, &Context, TrapFrame); - - KeContextToTrapFrame(&Context, NULL, TrapFrame, Context.ContextFlags, KernelMode); - - KeLowerIrql(OldIrql); - - return TRUE; -} - -VOID -STDCALL -KdpGdbDebugPrint(PCH Message, ULONG Length) -{ -} - -/* Initialize the GDB stub */ -VOID -STDCALL -KdpGdbStubInit(PKD_DISPATCH_TABLE WrapperTable, - ULONG BootPhase) -{ - if (!KdDebuggerEnabled || !KdpDebugMode.Gdb) - { - return; - } - - if (BootPhase == 0) - { - ExInitializeFastMutex(&GspLock); - - /* Write out the functions that we support for now */ - WrapperTable->KdpInitRoutine = KdpGdbStubInit; - WrapperTable->KdpPrintRoutine = KdpGdbDebugPrint; - WrapperTable->KdpExceptionRoutine = KdpGdbEnterDebuggerException; - - /* Initialize the Port */ - KdPortInitializeEx(&GdbPortInfo, 0, 0); - - KdpPort = GdbPortInfo.ComPort; - } - else if (BootPhase == 1) - { - GspInitialized = TRUE; - - GspRunThread = NULL; - GspDbgThread = NULL; - GspEnumThread = NULL; - - HalDisplayString("Waiting for GDB to attach\n"); - DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); - } - else if (BootPhase == 2) - { - HalDisplayString("\n GDB debugging enabled\n\n"); - } -} - -/* EOF */ +/**************************************************************************** + + THIS SOFTWARE IS NOT COPYRIGHTED + + HP offers the following for use in the public domain. HP makes no + warranty with regard to the software or it's performance and the + user accepts the software "AS IS" with all faults. + + HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD + TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +****************************************************************************/ + +/**************************************************************************** + * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ + * + * Module name: remcom.c $ + * Revision: 1.34 $ + * Date: 91/03/09 12:29:49 $ + * Contributor: Lake Stevens Instrument Division$ + * + * Description: low level support for gdb debugger. $ + * + * Considerations: only works on target hardware $ + * + * Written by: Glenn Engel $ + * ModuleState: Experimental $ + * + * NOTES: See Below $ + * + * Modified for 386 by Jim Kingdon, Cygnus Support. + * Modified for ReactOS by Casper S. Hornstrup + * + * To enable debugger support, two things need to happen. One, setting + * up a routine so that it is in the exception path, is necessary in order + * to allow any breakpoints or error conditions to be properly intercepted + * and reported to gdb. + * Two, a breakpoint needs to be generated to begin communication. + * + * Because gdb will sometimes write to the stack area to execute function + * calls, this program cannot rely on using the supervisor stack so it + * uses it's own stack area. + * + ************* + * + * The following gdb commands are supported: + * + * command function Return value + * + * g return the value of the CPU Registers hex data or ENN + * G set the value of the CPU Registers OK or ENN + * + * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN + * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN + * + * c Resume at current address SNN ( signal NN) + * cAA..AA Continue at address AA..AA SNN + * + * s Step one instruction SNN + * sAA..AA Step one instruction from AA..AA SNN + * + * k kill + * + * ? What was the last sigval ? SNN (signal NN) + * + * All commands and responses are sent with a packet which includes a + * Checksum. A packet consists of + * + * $#. + * + * where + * :: + * :: < two hex digits computed as modulo 256 sum of > + * + * When a packet is received, it is first acknowledged with either '+' or '-'. + * '+' indicates a successful transfer. '-' indicates a failed transfer. + * + * Example: + * + * Host: Reply: + * $m0,10#2a +$00010203040506070809101112131415#42 + * + ****************************************************************************/ + +#include +#define NDEBUG +#include + +/************************************************************************/ +/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ +/* at least NUMREGBYTES*2 are needed for register packets */ +#define BUFMAX 1000 + +static BOOLEAN GspInitialized; + +static BOOLEAN GspRemoteDebug; + +static CONST CHAR HexChars[]="0123456789abcdef"; + +static PETHREAD GspRunThread; /* NULL means run all threads */ +static PETHREAD GspDbgThread; +static PETHREAD GspEnumThread; + +static FAST_MUTEX GspLock; + +extern LIST_ENTRY PsActiveProcessHead; +KD_PORT_INFORMATION GdbPortInfo = { 2, 115200, 0 }; /* FIXME hardcoded for COM2, 115200 baud */ + +/* Number of Registers. */ +#define NUMREGS 16 + +enum REGISTER_NAMES +{ + EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI, + PC /* also known as eip */, + PS /* also known as eflags */, + CS, SS, DS, ES, FS, GS +}; + +typedef struct _CPU_REGISTER +{ + ULONG Size; + ULONG OffsetInTF; + ULONG OffsetInContext; + BOOLEAN SetInContext; +} CPU_REGISTER, *PCPU_REGISTER; + +static CPU_REGISTER GspRegisters[NUMREGS] = +{ +}; + +static PCHAR GspThreadStates[DeferredReady+1] = +{ + "Initialized", + "Ready", + "Running", + "Standby", + "Terminated", + "Waiting", + "Transition", + "DeferredReady" +}; + + +LONG +HexValue(CHAR ch) +{ + if ((ch >= '0') && (ch <= '9')) + { + return (ch - '0'); + } + if ((ch >= 'a') && (ch <= 'f')) + { + return (ch - 'a' + 10); + } + if ((ch >= 'A') && (ch <= 'F')) + { + return (ch - 'A' + 10); + } + + return -1; +} + +static CHAR GspInBuffer[BUFMAX]; +static CHAR GspOutBuffer[BUFMAX]; + +VOID +GdbPutChar(UCHAR Value) +{ + KdPortPutByteEx(&GdbPortInfo, Value); +} + +UCHAR +GdbGetChar(VOID) +{ + UCHAR Value; + + while (!KdPortGetByteEx(&GdbPortInfo, &Value)) + ; + + return Value; +} + +/* scan for the sequence $# */ + +PCHAR +GspGetPacket() +{ + PCHAR Buffer = &GspInBuffer[0]; + CHAR Checksum; + CHAR XmitChecksum; + ULONG Count; + CHAR ch; + + while (TRUE) + { + /* wait around for the start character, ignore all other characters */ + while ((ch = GdbGetChar ()) != '$') + ; + + retry: + Checksum = 0; + XmitChecksum = -1; + Count = 0; + + /* now, read until a # or end of Buffer is found */ + while (Count < BUFMAX) + { + ch = GdbGetChar(); + if (ch == '$') + { + goto retry; + } + if (ch == '#') + { + break; + } + Checksum = Checksum + ch; + Buffer[Count] = ch; + Count = Count + 1; + } + Buffer[Count] = 0; + + if (ch == '#') + { + ch = GdbGetChar(); + XmitChecksum = (CHAR)(HexValue(ch) << 4); + ch = GdbGetChar(); + XmitChecksum += (CHAR)(HexValue(ch)); + + if (Checksum != XmitChecksum) + { + GdbPutChar('-'); /* failed checksum */ + } + else + { + GdbPutChar('+'); /* successful transfer */ + + return &Buffer[0]; + } + } + } +} + +/* send the packet in Buffer. */ + +VOID +GspPutPacket(PCHAR Buffer) +{ + CHAR Checksum; + LONG Count; + CHAR ch; + + /* $#. */ + do + { + GdbPutChar('$'); + Checksum = 0; + Count = 0; + + while ((ch = Buffer[Count])) + { + GdbPutChar(ch); + Checksum += ch; + Count += 1; + } + + GdbPutChar('#'); + GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); + GdbPutChar(HexChars[Checksum & 0xf]); + } + while (GdbGetChar() != '+'); +} + + +VOID +GspPutPacketNoWait(PCHAR Buffer) +{ + CHAR Checksum; + LONG Count; + CHAR ch; + + /* $#. */ + GdbPutChar('$'); + Checksum = 0; + Count = 0; + + while ((ch = Buffer[Count])) + { + GdbPutChar(ch); + Checksum += ch; + Count += 1; + } + + GdbPutChar('#'); + GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); + GdbPutChar(HexChars[Checksum & 0xf]); +} + +/* Indicate to caller of GspMem2Hex or GspHex2Mem that there has been an + error. */ +static volatile BOOLEAN GspMemoryError = FALSE; +static volatile void *GspAccessLocation = NULL; + +static CHAR +GspReadMemSafe(PCHAR Address) +{ + CHAR ch; + + if (NULL == Address) + { + GspMemoryError = TRUE; + return '\0'; + } + + GspAccessLocation = Address; + ch = *Address; + GspAccessLocation = NULL; + + return ch; +} + +/* Convert the memory pointed to by Address into hex, placing result in Buffer */ +/* Return a pointer to the last char put in Buffer (null) */ +/* If MayFault is TRUE, then we should set GspMemoryError in response to + a fault; if FALSE treat a fault like any other fault in the stub. */ +static PCHAR +GspMem2Hex(PCHAR Address, + PCHAR Buffer, + LONG Count, + BOOLEAN MayFault) +{ + ULONG i; + CHAR ch; + + for (i = 0; i < (ULONG) Count; i++) + { + if (MayFault) + { + ch = GspReadMemSafe(Address); + if (GspMemoryError) + { + return Buffer; + } + } + else + { + ch = *Address; + } + *Buffer++ = HexChars[(ch >> 4) & 0xf]; + *Buffer++ = HexChars[ch & 0xf]; + Address++; + } + + *Buffer = 0; + return Buffer; +} + +static ULONG +GspWriteMem(PCHAR Address, + ULONG Count, + BOOLEAN MayFault, + CHAR (*GetContent)(PVOID Context, ULONG Offset), + PVOID Context) +{ + PCHAR Current; + PCHAR Page; + ULONG CountInPage; + ULONG i; + CHAR ch; + ULONG OldProt = 0; + + Current = Address; + while (Current < Address + Count) + { + Page = (PCHAR)PAGE_ROUND_DOWN(Current); + if (Address + Count <= Page + PAGE_SIZE) + { + /* Fits in this page */ + CountInPage = Count; + } + else + { + /* Flows into next page, handle only current page in this iteration */ + CountInPage = PAGE_SIZE - (Address - Page); + } + if (MayFault) + { + OldProt = MmGetPageProtect(NULL, Address); + MmSetPageProtect(NULL, Address, PAGE_EXECUTE_READWRITE); + } + + for (i = 0; i < CountInPage && ! GspMemoryError; i++) + { + ch = (*GetContent)(Context, Current - Address); + + if (MayFault) + { + GspAccessLocation = Current; + } + *Current = ch; + if (MayFault) + { + GspAccessLocation = NULL; + } + Current++; + } + if (MayFault) + { + MmSetPageProtect(NULL, Page, OldProt); + if (GspMemoryError) + { + return Current - Address; + } + } + } + + return Current - Address; +} + +static CHAR +GspHex2MemGetContent(PVOID Context, ULONG Offset) +{ + return (CHAR)((HexValue(*((PCHAR) Context + 2 * Offset)) << 4) + + HexValue(*((PCHAR) Context + 2 * Offset + 1))); +} + +/* Convert the hex array pointed to by Buffer into binary to be placed at Address */ +/* Return a pointer to the character AFTER the last byte read from Buffer */ +static PCHAR +GspHex2Mem(PCHAR Buffer, + PCHAR Address, + ULONG Count, + BOOLEAN MayFault) +{ + Count = GspWriteMem(Address, Count, MayFault, GspHex2MemGetContent, Buffer); + + return Buffer + 2 * Count; +} + +static CHAR +GspWriteMemSafeGetContent(PVOID Context, ULONG Offset) +{ + ASSERT(0 == Offset); + + return *((PCHAR) Context); +} + +static void +GspWriteMemSafe(PCHAR Address, + CHAR Ch) +{ + GspWriteMem(Address, 1, TRUE, GspWriteMemSafeGetContent, &Ch); +} + + +/* This function takes the 386 exception vector and attempts to + translate this number into a unix compatible signal value */ +ULONG +GspComputeSignal(NTSTATUS ExceptionCode) +{ + ULONG SigVal; + + switch (ExceptionCode) + { + case STATUS_INTEGER_DIVIDE_BY_ZERO: + SigVal = 8; /* divide by zero */ + break; + case STATUS_SINGLE_STEP: + case STATUS_BREAKPOINT: + SigVal = 5; /* breakpoint */ + break; + case STATUS_INTEGER_OVERFLOW: + case STATUS_ARRAY_BOUNDS_EXCEEDED: + SigVal = 16; /* bound instruction */ + break; + case STATUS_ILLEGAL_INSTRUCTION: + SigVal = 4; /* Invalid opcode */ + break; + case STATUS_STACK_OVERFLOW: + case STATUS_DATATYPE_MISALIGNMENT: + case STATUS_ACCESS_VIOLATION: + SigVal = 11; /* access violation */ + break; + default: + SigVal = 7; /* "software generated" */ + } + return SigVal; +} + + +/**********************************************/ +/* WHILE WE FIND NICE HEX CHARS, BUILD A LONG */ +/* RETURN NUMBER OF CHARS PROCESSED */ +/**********************************************/ +LONG +GspHex2Long(PCHAR *Address, + PLONG Value) +{ + LONG NumChars = 0; + LONG Hex; + + *Value = 0; + + while (**Address) + { + Hex = HexValue(**Address); + if (Hex >= 0) + { + *Value = (*Value << 4) | Hex; + NumChars++; + } + else + { + break; + } + + (*Address)++; + } + + return NumChars; +} + + +VOID +GspLong2Hex(PCHAR *Address, + LONG Value) +{ + LONG Save; + + Save = (((Value >> 0) & 0xff) << 24) | + (((Value >> 8) & 0xff) << 16) | + (((Value >> 16) & 0xff) << 8) | + (((Value >> 24) & 0xff) << 0); + *Address = GspMem2Hex((PCHAR) &Save, *Address, 4, FALSE); +} + + +/* + * When coming from kernel mode, Esp is not stored in the trap frame. + * Instead, it was pointing to the location of the TrapFrame Esp member + * when the exception occured. When coming from user mode, Esp is just + * stored in the TrapFrame Esp member. + */ +static LONG +GspGetEspFromTrapFrame(PKTRAP_FRAME TrapFrame) +{ + return KeGetPreviousMode() == KernelMode + ? (LONG) &TrapFrame->Gpr1 : (LONG)TrapFrame->Gpr1; +} + + +static VOID +GspGetRegisters(PCHAR Address, + PKTRAP_FRAME TrapFrame) +{ + ULONG_PTR Value; + PULONG p; + ULONG i; + PETHREAD Thread; + ULONG_PTR *KernelStack; + + if (NULL == GspDbgThread) + { + Thread = PsGetCurrentThread(); + } + else + { + TrapFrame = GspDbgThread->Tcb.TrapFrame; + Thread = GspDbgThread; + } + + if (Waiting == Thread->Tcb.State) + { + KernelStack = Thread->Tcb.KernelStack; + for (i = 0; i < sizeof(GspRegisters) / sizeof(GspRegisters[0]); i++) + { + switch(i) + { + } + Address = GspMem2Hex((PCHAR) &Value, Address, GspRegisters[i].Size, + FALSE); + } + } + else + { + for (i = 0; i < sizeof(GspRegisters) / sizeof(GspRegisters[0]); i++) + { + if (TrapFrame) + { + if (ESP == i) + { + Value = GspGetEspFromTrapFrame(TrapFrame); + } + else + { + p = (PULONG)((ULONG_PTR) TrapFrame + + GspRegisters[i].OffsetInTF); + Value = *p; + } + } + else if (i == PC) + { + /* + * This thread has not been sheduled yet so assume it + * is still in PsBeginThreadWithContextInternal(). + */ + Value = (ULONG)KiThreadStartup; + } + else + { + Value = 0; + } + Address = GspMem2Hex((PCHAR) &Value, Address, + GspRegisters[i].Size, FALSE); + } + } +} + + +VOID +GspSetRegistersInTrapFrame(PCHAR Address, + PCONTEXT Context, + PKTRAP_FRAME TrapFrame) +{ + ULONG Value; + PCHAR Buffer; + PULONG p; + ULONG i; + + if (!TrapFrame) + { + return; + } + + Buffer = Address; + for (i = 0; i < NUMREGS; i++) + { + if (GspRegisters[i].SetInContext) + { + p = (PULONG) ((ULONG_PTR) Context + GspRegisters[i].OffsetInContext); + } + else + { + p = (PULONG) ((ULONG_PTR) TrapFrame + GspRegisters[i].OffsetInTF); + } + Value = 0; + Buffer = GspHex2Mem(Buffer, (PCHAR) &Value, GspRegisters[i].Size, FALSE); + *p = Value; + } +} + + +VOID +GspSetSingleRegisterInTrapFrame(PCHAR Address, + LONG Number, + PCONTEXT Context, + PKTRAP_FRAME TrapFrame) +{ + ULONG Value; + PULONG p; + + if (!TrapFrame) + { + return; + } + + if (GspRegisters[Number].SetInContext) + { + p = (PULONG) ((ULONG_PTR) Context + GspRegisters[Number].OffsetInContext); + } + else + { + p = (PULONG) ((ULONG_PTR) TrapFrame + GspRegisters[Number].OffsetInTF); + } + Value = 0; + GspHex2Mem(Address, (PCHAR) &Value, GspRegisters[Number].Size, FALSE); + *p = Value; +} + + +BOOLEAN +GspFindThread(PCHAR Data, + PETHREAD *Thread) +{ + PETHREAD ThreadInfo = NULL; + + if (strcmp (Data, "-1") == 0) + { + /* All threads */ + ThreadInfo = NULL; + } + else + { + ULONG uThreadId; + HANDLE ThreadId; + PCHAR ptr = &Data[0]; + + GspHex2Long(&ptr, (PLONG) &uThreadId); + ThreadId = (HANDLE)uThreadId; + + if (!NT_SUCCESS(PsLookupThreadByThreadId(ThreadId, &ThreadInfo))) + { + *Thread = NULL; + return FALSE; + } + } + *Thread = ThreadInfo; + return TRUE; +} + + +VOID +GspSetThread(PCHAR Request) +{ + PETHREAD ThreadInfo; + PCHAR ptr = &Request[1]; + + switch (Request[0]) + { + case 'c': /* Run thread */ + if (GspFindThread(ptr, &ThreadInfo)) + { + GspOutBuffer[0] = 'O'; + GspOutBuffer[1] = 'K'; + + if (NULL != GspRunThread) + { + ObDereferenceObject(GspRunThread); + } + GspRunThread = ThreadInfo; + if (NULL != GspRunThread) + { + ObReferenceObject(GspRunThread); + } + } + else + { + GspOutBuffer[0] = 'E'; + } + break; + case 'g': /* Debug thread */ + if (GspFindThread(ptr, &ThreadInfo)) + { + GspOutBuffer[0] = 'O'; + GspOutBuffer[1] = 'K'; + + if (NULL != GspDbgThread) + { + ObDereferenceObject(GspDbgThread); + } + + if (ThreadInfo == PsGetCurrentThread()) + { + GspDbgThread = NULL; + ObDereferenceObject(ThreadInfo); + } + else + { + GspDbgThread = ThreadInfo; + } + } + else + { + GspOutBuffer[0] = 'E'; + } + break; + default: + break; + } +} + + +VOID +GspQuery(PCHAR Request) +{ + ULONG Value; + + if (strncmp(Request, "C", 1) == 0) + { + PCHAR ptr = &GspOutBuffer[2]; + + /* Get current thread id */ + GspOutBuffer[0] = 'Q'; + GspOutBuffer[1] = 'C'; + if (NULL != GspDbgThread) + { + Value = (ULONG) GspDbgThread->Cid.UniqueThread; + } + else + { + Value = (ULONG) PsGetCurrentThread()->Cid.UniqueThread; + } + GspLong2Hex(&ptr, Value); + } + else if (strncmp(Request, "fThreadInfo", 11) == 0) + { + PEPROCESS Process; + PLIST_ENTRY AThread, AProcess; + PCHAR ptr = &GspOutBuffer[1]; + + /* Get first thread id */ + GspEnumThread = NULL; + AProcess = PsActiveProcessHead.Flink; + while(AProcess != &PsActiveProcessHead) + { + Process = CONTAINING_RECORD(AProcess, EPROCESS, ActiveProcessLinks); + AThread = Process->ThreadListHead.Flink; + if (AThread != &Process->ThreadListHead) + { + GspEnumThread = CONTAINING_RECORD(Process->ThreadListHead.Flink, + ETHREAD, ThreadListEntry); + break; + } + AProcess = AProcess->Flink; + } + if(GspEnumThread != NULL) + { + GspOutBuffer[0] = 'm'; + Value = (ULONG) GspEnumThread->Cid.UniqueThread; + GspLong2Hex(&ptr, Value); + } + else + { + /* FIXME - what to do here? This case should never happen though, there + should always be at least one thread on the system... */ + /* GspOutBuffer[0] = 'l'; */ + } + } + else if (strncmp(Request, "sThreadInfo", 11) == 0) + { + PEPROCESS Process; + PLIST_ENTRY AThread, AProcess; + PCHAR ptr = &GspOutBuffer[1]; + + /* Get next thread id */ + if (GspEnumThread != NULL) + { + /* find the next thread */ + Process = GspEnumThread->ThreadsProcess; + if(GspEnumThread->ThreadListEntry.Flink != &Process->ThreadListHead) + { + GspEnumThread = CONTAINING_RECORD(GspEnumThread->ThreadListEntry.Flink, + ETHREAD, ThreadListEntry); + } + else + { + PETHREAD Thread = NULL; + AProcess = Process->ActiveProcessLinks.Flink; + while(AProcess != &PsActiveProcessHead) + { + Process = CONTAINING_RECORD(AProcess, EPROCESS, ActiveProcessLinks); + AThread = Process->ThreadListHead.Flink; + if (AThread != &Process->ThreadListHead) + { + Thread = CONTAINING_RECORD(Process->ThreadListHead.Flink, + ETHREAD, ThreadListEntry); + break; + } + AProcess = AProcess->Flink; + } + GspEnumThread = Thread; + } + + if (GspEnumThread != NULL) + { + /* return the ID */ + GspOutBuffer[0] = 'm'; + Value = (ULONG) GspEnumThread->Cid.UniqueThread; + GspLong2Hex(&ptr, Value); + } + else + { + GspOutBuffer[0] = 'l'; + } + } + else + { + GspOutBuffer[0] = 'l'; + } + } + else if (strncmp(Request, "ThreadExtraInfo", 15) == 0) + { + PETHREAD ThreadInfo; + + /* Get thread information */ + if (GspFindThread(Request + 16, &ThreadInfo)) + { + char Buffer[64]; + PEPROCESS Proc; + + Proc = (PEPROCESS) ThreadInfo->ThreadsProcess; + + Buffer[0] = '\0'; + if (NULL != Proc ) + { + sprintf(Buffer, "%s [%d:0x%x], ", Proc->ImageFileName, + (int) Proc->UniqueProcessId, + (int) ThreadInfo->Cid.UniqueThread); + } + strcpy(Buffer + strlen(Buffer), + GspThreadStates[ThreadInfo->Tcb.State]); + + ObDereferenceObject(ThreadInfo); + + GspMem2Hex(Buffer, &GspOutBuffer[0], strlen(Buffer), FALSE); + } + } +} + +VOID +GspQueryThreadStatus(PCHAR Request) +{ + PETHREAD ThreadInfo; + PCHAR ptr = &Request[0]; + + if (GspFindThread(ptr, &ThreadInfo)) + { + ObDereferenceObject(ThreadInfo); + + GspOutBuffer[0] = 'O'; + GspOutBuffer[1] = 'K'; + GspOutBuffer[2] = '\0'; + } + else + { + GspOutBuffer[0] = 'E'; + GspOutBuffer[1] = '\0'; + } +} + +#define DR7_L0 0x00000001 /* Local breakpoint 0 enable */ +#define DR7_G0 0x00000002 /* Global breakpoint 0 enable */ +#define DR7_L1 0x00000004 /* Local breakpoint 1 enable */ +#define DR7_G1 0x00000008 /* Global breakpoint 1 enable */ +#define DR7_L2 0x00000010 /* Local breakpoint 2 enable */ +#define DR7_G2 0x00000020 /* Global breakpoint 2 enable */ +#define DR7_L3 0x00000040 /* Local breakpoint 3 enable */ +#define DR7_G3 0x00000080 /* Global breakpoint 3 enable */ +#define DR7_LE 0x00000100 /* Local exact breakpoint enable (old) */ +#define DR7_GE 0x00000200 /* Global exact breakpoint enable (old) */ +#define DR7_GD 0x00002000 /* General detect enable */ +#define DR7_TYPE0_MASK 0x00030000 /* Breakpoint 0 condition */ +#define DR7_LEN0_MASK 0x000c0000 /* Breakpoint 0 length */ +#define DR7_TYPE1_MASK 0x00300000 /* Breakpoint 1 condition */ +#define DR7_LEN1_MASK 0x00c00000 /* Breakpoint 1 length */ +#define DR7_TYPE2_MASK 0x03000000 /* Breakpoint 2 condition */ +#define DR7_LEN2_MASK 0x0c000000 /* Breakpoint 2 length */ +#define DR7_TYPE3_MASK 0x30000000 /* Breakpoint 3 condition */ +#define DR7_LEN3_MASK 0xc0000000 /* Breakpoint 3 length */ +#define DR7_GLOBAL_ENABLE(Bp) (2 << (2 * (Bp))) +#define DR7_TYPE(Bp, Type) ((Type) << (16 + 4 * (Bp))) +#define DR7_LEN(Bp, Len) ((Len) << (18 + 4 * (Bp))) + +#define I386_BP_TYPE_EXECUTE 0 +#define I386_BP_TYPE_DATA_WRITE 1 +#define I386_BP_TYPE_DATA_READWRITE 3 + +#define I386_OPCODE_INT3 0xcc + +#define GDB_ZTYPE_MEMORY_BREAKPOINT 0 +#define GDB_ZTYPE_HARDWARE_BREAKPOINT 1 +#define GDB_ZTYPE_WRITE_WATCHPOINT 2 +#define GDB_ZTYPE_READ_WATCHPOINT 3 +#define GDB_ZTYPE_ACCESS_WATCHPOINT 4 + +typedef struct _GSPHWBREAKPOINT +{ + ULONG Type; + ULONG_PTR Address; + ULONG Length; +} GSPHWBREAKPOINT; + +#define MAX_HW_BREAKPOINTS 4 +static unsigned GspHwBreakpointCount = 0; +static GSPHWBREAKPOINT GspHwBreakpoints[MAX_HW_BREAKPOINTS]; + +typedef struct _GSPSWBREAKPOINT +{ + ULONG_PTR Address; + CHAR PrevContent; + BOOLEAN Active; +} GSPSWBREAKPOINT; + +#define MAX_SW_BREAKPOINTS 64 +static unsigned GspSwBreakpointCount = 0; +static GSPSWBREAKPOINT GspSwBreakpoints[MAX_SW_BREAKPOINTS]; + +static void +GspSetHwBreakpoint(ULONG Type, ULONG_PTR Address, ULONG Length) +{ + DPRINT("GspSetHwBreakpoint(%lu, 0x%p, %lu)\n", Type, Address, Length); + + if (GDB_ZTYPE_READ_WATCHPOINT == Type) + { + DPRINT1("Read watchpoint not supported\n"); + strcpy(GspOutBuffer, "E22"); + } + else if (GDB_ZTYPE_HARDWARE_BREAKPOINT == Type && 1 != Length) + { + DPRINT1("Invalid length %lu for hardware breakpoint\n", Length); + strcpy(GspOutBuffer, "E22"); + } + else if (1 != Length && 2 != Length && 4 != Length) + { + DPRINT1("Invalid length %lu for GDB Z type %lu\n", Length, Type); + strcpy(GspOutBuffer, "E22"); + } + else if (0 != (Address & (Length - 1))) + { + DPRINT1("Invalid alignment for address 0x%p and length %d\n", + Address, Length); + strcpy(GspOutBuffer, "E22"); + } + else if (MAX_HW_BREAKPOINTS == GspHwBreakpointCount) + { + DPRINT1("Trying to set too many hardware breakpoints\n"); + strcpy(GspOutBuffer, "E22"); + } + else + { + DPRINT("Stored at index %u\n", GspHwBreakpointCount); + GspHwBreakpoints[GspHwBreakpointCount].Type = Type; + GspHwBreakpoints[GspHwBreakpointCount].Address = Address; + GspHwBreakpoints[GspHwBreakpointCount].Length = Length; + GspHwBreakpointCount++; + strcpy(GspOutBuffer, "OK"); + } +} + +static void +GspRemoveHwBreakpoint(ULONG Type, ULONG_PTR Address, ULONG Length) +{ + unsigned Index; + + DPRINT("GspRemoveHwBreakpoint(%lu, 0x%p, %lu)\n", Type, Address, Length); + for (Index = 0; Index < GspHwBreakpointCount; Index++) + { + if (GspHwBreakpoints[Index].Type == Type && + GspHwBreakpoints[Index].Address == Address && + GspHwBreakpoints[Index].Length == Length) + { + DPRINT("Found match at index %u\n", Index); + if (Index + 1 < GspHwBreakpointCount) + { + memmove(GspHwBreakpoints + Index, + GspHwBreakpoints + (Index + 1), + (GspHwBreakpointCount - Index - 1) * + sizeof(GSPHWBREAKPOINT)); + } + GspHwBreakpointCount--; + strcpy(GspOutBuffer, "OK"); + return; + } + } + + DPRINT1("Not found\n"); + strcpy(GspOutBuffer, "E22"); +} + +static void +GspSetSwBreakpoint(ULONG_PTR Address) +{ + DPRINT("GspSetSwBreakpoint(0x%p)\n", Address); + + if (MAX_SW_BREAKPOINTS == GspSwBreakpointCount) + { + DPRINT1("Trying to set too many software breakpoints\n"); + strcpy(GspOutBuffer, "E22"); + } + else + { + DPRINT("Stored at index %u\n", GspSwBreakpointCount); + GspSwBreakpoints[GspSwBreakpointCount].Address = Address; + GspSwBreakpoints[GspSwBreakpointCount].Active = FALSE; + GspSwBreakpointCount++; + strcpy(GspOutBuffer, "OK"); + } +} + +static void +GspRemoveSwBreakpoint(ULONG_PTR Address) +{ + unsigned Index; + + DPRINT("GspRemoveSwBreakpoint(0x%p)\n", Address); + for (Index = 0; Index < GspSwBreakpointCount; Index++) + { + if (GspSwBreakpoints[Index].Address == Address) + { + DPRINT("Found match at index %u\n", Index); + ASSERT(! GspSwBreakpoints[Index].Active); + if (Index + 1 < GspSwBreakpointCount) + { + memmove(GspSwBreakpoints + Index, + GspSwBreakpoints + (Index + 1), + (GspSwBreakpointCount - Index - 1) * + sizeof(GSPSWBREAKPOINT)); + } + GspSwBreakpointCount--; + strcpy(GspOutBuffer, "OK"); + return; + } + } + + DPRINT1("Not found\n"); + strcpy(GspOutBuffer, "E22"); +} + +static void +GspLoadHwBreakpoint(PKTRAP_FRAME TrapFrame, + unsigned BpIndex, + ULONG_PTR Address, + ULONG Length, + ULONG Type) +{ + DPRINT("GspLoadHwBreakpoint(0x%p, %d, 0x%p, %d)\n", TrapFrame, BpIndex, + Address, Type); + + /* Set the DR7_Gx bit to globally enable the breakpoint */ + TrapFrame->Dr7 |= DR7_GLOBAL_ENABLE(BpIndex) | + DR7_LEN(BpIndex, Length) | + DR7_TYPE(BpIndex, Type); + + switch (BpIndex) + { + case 0: + DPRINT("Setting DR0 to 0x%p\n", Address); + TrapFrame->Dr0 = Address; + break; + + case 1: + DPRINT("Setting DR1 to 0x%p\n", Address); + TrapFrame->Dr1 = Address; + break; + + case 2: + DPRINT("Setting DR2 to 0x%p\n", Address); + TrapFrame->Dr2 = Address; + break; + + case 3: + DPRINT("Setting DR3 to 0x%p\n", Address); + TrapFrame->Dr3 = Address; + break; + } +} + +static void +GspLoadBreakpoints(PKTRAP_FRAME TrapFrame) +{ + unsigned Index; + ULONG i386Type; + + DPRINT("GspLoadBreakpoints\n"); + DPRINT("DR7 on entry: 0x%08x\n", TrapFrame->Dr7); + /* Remove all breakpoints */ + TrapFrame->Dr7 &= ~(DR7_L0 | DR7_L1 | DR7_L2 | DR7_L3 | + DR7_G0 | DR7_G1 | DR7_G2 | DR7_G3 | + DR7_TYPE0_MASK | DR7_LEN0_MASK | + DR7_TYPE1_MASK | DR7_LEN1_MASK | + DR7_TYPE2_MASK | DR7_LEN2_MASK | + DR7_TYPE3_MASK | DR7_LEN3_MASK); + + for (Index = 0; Index < GspHwBreakpointCount; Index++) + { + switch(GspHwBreakpoints[Index].Type) + { + case GDB_ZTYPE_HARDWARE_BREAKPOINT: + i386Type = I386_BP_TYPE_EXECUTE; + break; + case GDB_ZTYPE_WRITE_WATCHPOINT: + i386Type = I386_BP_TYPE_DATA_WRITE; + break; + case GDB_ZTYPE_ACCESS_WATCHPOINT: + i386Type = I386_BP_TYPE_DATA_READWRITE; + break; + default: + ASSERT(FALSE); + i386Type = I386_BP_TYPE_EXECUTE; + break; + } + + GspLoadHwBreakpoint(TrapFrame, Index, GspHwBreakpoints[Index].Address, + GspHwBreakpoints[Index].Length - 1, i386Type); + } + + for (Index = 0; Index < GspSwBreakpointCount; Index++) + { + if (GspHwBreakpointCount + Index < MAX_HW_BREAKPOINTS) + { + DPRINT("Implementing software interrupt using hardware register\n"); + GspLoadHwBreakpoint(TrapFrame, GspHwBreakpointCount + Index, + GspSwBreakpoints[Index].Address, 0, + I386_BP_TYPE_EXECUTE); + GspSwBreakpoints[Index].Active = FALSE; + } + else + { + DPRINT("Using real software breakpoint\n"); + GspMemoryError = FALSE; + GspSwBreakpoints[Index].PrevContent = GspReadMemSafe((PCHAR) GspSwBreakpoints[Index].Address); + if (! GspMemoryError) + { + GspWriteMemSafe((PCHAR) GspSwBreakpoints[Index].Address, I386_OPCODE_INT3); + } + GspSwBreakpoints[Index].Active = ! GspMemoryError; + if (GspMemoryError) + { + DPRINT1("Failed to set software breakpoint at 0x%p\n", + GspSwBreakpoints[Index].Address); + } + else + { + DPRINT("Successfully set software breakpoint at 0x%p\n", + GspSwBreakpoints[Index].Address); + DPRINT1("Successfully set software breakpoint at 0x%p\n", GspSwBreakpoints[Index].Address); + } + } + } + + DPRINT("Final DR7 value 0x%08x\n", TrapFrame->Dr7); +} + +static void +GspUnloadBreakpoints(PKTRAP_FRAME TrapFrame) +{ + unsigned Index; + + DPRINT("GspUnloadHwBreakpoints\n"); + + for (Index = 0; Index < GspSwBreakpointCount; Index++) + { + if (GspSwBreakpoints[Index].Active) + { + GspMemoryError = FALSE; + GspWriteMemSafe((PCHAR) GspSwBreakpoints[Index].Address, + GspSwBreakpoints[Index].PrevContent); + GspSwBreakpoints[Index].Active = FALSE; + if (GspMemoryError) + { + DPRINT1("Failed to remove software breakpoint from 0x%p\n", + GspSwBreakpoints[Index].Address); + } + else + { + DPRINT("Successfully removed software breakpoint from 0x%p\n", + GspSwBreakpoints[Index].Address); + } + } + } +} + +static BOOLEAN gdb_attached_yet = FALSE; +/* + * This function does all command procesing for interfacing to gdb. + */ +KD_CONTINUE_TYPE +STDCALL +KdpGdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, + PCONTEXT Context, + PKTRAP_FRAME TrapFrame) +{ + BOOLEAN Stepping; + LONG Address; + LONG Length; + LONG SigVal = 0; + //LONG NewPC; + PCHAR ptr; + + /* FIXME: Stop on other CPUs too */ + + if (STATUS_ACCESS_VIOLATION == (NTSTATUS) ExceptionRecord->ExceptionCode && + NULL != GspAccessLocation && + (ULONG_PTR) GspAccessLocation == + (ULONG_PTR) ExceptionRecord->ExceptionInformation[1]) + { + GspAccessLocation = NULL; + GspMemoryError = TRUE; + //Context->Eip += 3; + } + else + { + DPRINT("Thread %p entering stub\n", PsGetCurrentThread()); + /* Can only debug 1 thread at a time... */ + ExAcquireFastMutex(&GspLock); + DPRINT("Thread %p acquired mutex\n", PsGetCurrentThread()); + + /* Disable hardware debugging while we are inside the stub */ + //Ke386SetDr7(0); + GspUnloadBreakpoints(TrapFrame); + + /* Make sure we're debugging the current thread. */ + if (NULL != GspDbgThread) + { + DPRINT1("Internal error: entering stub with non-NULL GspDbgThread\n"); + ObDereferenceObject(GspDbgThread); + GspDbgThread = NULL; + } + + /* ugly hack to avoid attempting to send status at the very + * beginning, right when GDB is trying to query the stub */ + if (gdb_attached_yet) + { + LONG Esp; + + stop_reply: + /* reply to host that an exception has occurred */ + SigVal = GspComputeSignal(ExceptionRecord->ExceptionCode); + + ptr = GspOutBuffer; + + *ptr++ = 'T'; /* notify gdb with signo, PC, FP and SP */ + *ptr++ = HexChars[(SigVal >> 4) & 0xf]; + *ptr++ = HexChars[SigVal & 0xf]; + + *ptr++ = HexChars[ESP]; + *ptr++ = ':'; + + Esp = GspGetEspFromTrapFrame(TrapFrame); /* SP */ + ptr = GspMem2Hex((PCHAR) &Esp, ptr, 4, 0); + *ptr++ = ';'; + + *ptr++ = HexChars[EBP]; + *ptr++ = ':'; + //ptr = GspMem2Hex((PCHAR) &TrapFrame->Ebp, ptr, 4, 0); /* FP */ + *ptr++ = ';'; + + *ptr++ = HexChars[PC]; + *ptr++ = ':'; + //ptr = GspMem2Hex((PCHAR) &TrapFrame->Eip, ptr, 4, 0); /* PC */ + *ptr++ = ';'; + + *ptr = '\0'; + + GspPutPacket(&GspOutBuffer[0]); + } + else + { + gdb_attached_yet = 1; + } + + Stepping = FALSE; + + while (TRUE) + { + /* Zero the buffer now so we don't have to worry about the terminating zero character */ + memset(GspOutBuffer, 0, sizeof(GspInBuffer)); + ptr = GspGetPacket(); + + switch(*ptr++) + { + case '?': + /* a little hack to send more complete status information */ + goto stop_reply; + GspOutBuffer[0] = 'S'; + GspOutBuffer[1] = HexChars[SigVal >> 4]; + GspOutBuffer[2] = HexChars[SigVal % 16]; + GspOutBuffer[3] = 0; + break; + case 'd': + GspRemoteDebug = !GspRemoteDebug; /* toggle debug flag */ + break; + case 'g': /* return the value of the CPU Registers */ + GspGetRegisters(GspOutBuffer, TrapFrame); + break; + case 'G': /* set the value of the CPU Registers - return OK */ + if (NULL != GspDbgThread) + { + GspSetRegistersInTrapFrame(ptr, Context, GspDbgThread->Tcb.TrapFrame); + } + else + { + GspSetRegistersInTrapFrame(ptr, Context, TrapFrame); + } + strcpy(GspOutBuffer, "OK"); + break; + case 'P': /* set the value of a single CPU register - return OK */ + { + LONG Register; + + if ((GspHex2Long(&ptr, &Register)) && (*ptr++ == '=')) + { + if ((Register >= 0) && (Register < NUMREGS)) + { + if (GspDbgThread) + { + GspSetSingleRegisterInTrapFrame(ptr, Register, + Context, + GspDbgThread->Tcb.TrapFrame); + } + else + { + GspSetSingleRegisterInTrapFrame(ptr, Register, + Context, TrapFrame); + } + strcpy(GspOutBuffer, "OK"); + break; + } + } + + strcpy(GspOutBuffer, "E01"); + break; + } + + /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */ + case 'm': + /* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */ + if (GspHex2Long(&ptr, &Address) && + *(ptr++) == ',' && + GspHex2Long(&ptr, &Length)) + { + PEPROCESS DbgProcess = NULL; + + ptr = NULL; + if (NULL != GspDbgThread && + PsGetCurrentProcess() != GspDbgThread->ThreadsProcess) + { + DbgProcess = GspDbgThread->ThreadsProcess; + KeAttachProcess(&DbgProcess->Pcb); + } + GspMemoryError = FALSE; + GspMem2Hex((PCHAR) Address, GspOutBuffer, Length, 1); + if (NULL != DbgProcess) + { + KeDetachProcess(); + } + if (GspMemoryError) + { + strcpy(GspOutBuffer, "E03"); + DPRINT("Fault during memory read\n"); + } + } + + if (NULL != ptr) + { + strcpy(GspOutBuffer, "E01"); + } + break; + + /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */ + case 'M': + /* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */ + if (GspHex2Long(&ptr, &Address)) + { + if (*(ptr++) == ',' && + GspHex2Long(&ptr, &Length) && + *(ptr++) == ':') + { + PEPROCESS DbgProcess = NULL; + + if (NULL != GspDbgThread && + PsGetCurrentProcess() != GspDbgThread->ThreadsProcess) + { + DbgProcess = GspDbgThread->ThreadsProcess; + KeAttachProcess(&DbgProcess->Pcb); + } + GspMemoryError = FALSE; + GspHex2Mem(ptr, (PCHAR) Address, Length, TRUE); + if (NULL != DbgProcess) + { + KeDetachProcess(); + } + if (GspMemoryError) + { + strcpy(GspOutBuffer, "E03"); + DPRINT("Fault during memory write\n"); + } + else + { + strcpy(GspOutBuffer, "OK"); + } + ptr = NULL; + } + } + + if (NULL != ptr) + { + strcpy(GspOutBuffer, "E02"); + } + break; + + /* cAA..AA Continue at address AA..AA(optional) */ + /* sAA..AA Step one instruction from AA..AA(optional) */ + case 's': + Stepping = TRUE; + case 'c': + { + ULONG BreakpointNumber; + ULONG dr6_ = 0; + + /* try to read optional parameter, pc unchanged if no parm */ + if (GspHex2Long (&ptr, &Address)) + { + //Context->Eip = Address; + } + + //NewPC = Context->Eip; + + /* clear the trace bit */ + //Context->EFlags &= 0xfffffeff; + + /* set the trace bit if we're Stepping */ + if (Stepping) + { + //Context->EFlags |= 0x100; + } + + // XXX arty load dr6 + if (!(dr6_ & 0x4000)) + { + for (BreakpointNumber = 0; BreakpointNumber < 4; ++BreakpointNumber) + { + if (dr6_ & (1 << BreakpointNumber)) + { + if (GspHwBreakpoints[BreakpointNumber].Type == 0) + { + /* Set restore flag */ + //Context->EFlags |= 0x10000; + break; + } + } + } + } + GspLoadBreakpoints(TrapFrame); + // XXX load dr6 + if (NULL != GspDbgThread) + { + ObDereferenceObject(GspDbgThread); + GspDbgThread = NULL; + } + + DPRINT("Thread %p releasing mutex\n", PsGetCurrentThread()); + ExReleaseFastMutex(&GspLock); + DPRINT("Thread %p leaving stub\n", PsGetCurrentThread()); + return kdContinue; + break; + } + + case 'k': /* kill the program */ + strcpy(GspOutBuffer, "OK"); + break; + /* kill the program */ + + case 'H': /* Set thread */ + GspSetThread(ptr); + break; + + case 'q': /* Query */ + GspQuery(ptr); + break; + + case 'T': /* Query thread status */ + GspQueryThreadStatus(ptr); + break; + + case 'Z': + { + LONG Type; + LONG Address; + LONG Length; + + GspHex2Long(&ptr, &Type); + ptr++; + GspHex2Long(&ptr, &Address); + ptr++; + GspHex2Long(&ptr, &Length); + if (0 == Type) + { + GspSetSwBreakpoint((ULONG_PTR) Address); + } + else + { + GspSetHwBreakpoint(Type, (ULONG_PTR) Address, Length); + } + break; + } + + case 'z': + { + LONG Type; + LONG Address; + LONG Length; + + GspHex2Long(&ptr, &Type); + ptr++; + GspHex2Long(&ptr, &Address); + ptr++; + GspHex2Long(&ptr, &Length); + if (0 == Type) + { + GspRemoveSwBreakpoint((ULONG_PTR) Address); + } + else + { + GspRemoveHwBreakpoint(Type, (ULONG_PTR) Address, Length); + } + break; + } + + default: + break; + } + + /* reply to the request */ + GspPutPacket(GspOutBuffer); + } + + /* not reached */ + ASSERT(0); + } + + if (NULL != GspDbgThread) + { + ObDereferenceObject(GspDbgThread); + GspDbgThread = NULL; + } + + return kdContinue; +} + + +BOOLEAN +STDCALL +GspBreakIn(PKINTERRUPT Interrupt, + PVOID ServiceContext) +{ + PKTRAP_FRAME TrapFrame; + BOOLEAN DoBreakIn; + CONTEXT Context; + KIRQL OldIrql; + UCHAR Value; + + DPRINT("Break In\n"); + + DoBreakIn = FALSE; + while (KdPortGetByteEx(&GdbPortInfo, &Value)) + { + if (Value == 0x03) + { + DoBreakIn = TRUE; + } + } + + if (!DoBreakIn) + { + return TRUE; + } + + KeRaiseIrql(HIGH_LEVEL, &OldIrql); + + TrapFrame = PsGetCurrentThread()->Tcb.TrapFrame; + + KeTrapFrameToContext(TrapFrame, NULL, &Context); + + KdpGdbEnterDebuggerException(NULL, &Context, TrapFrame); + + KeContextToTrapFrame(&Context, NULL, TrapFrame, Context.ContextFlags, KernelMode); + + KeLowerIrql(OldIrql); + + return TRUE; +} + +VOID +STDCALL +KdpGdbDebugPrint(PCH Message, ULONG Length) +{ +} + +/* Initialize the GDB stub */ +VOID +STDCALL +KdpGdbStubInit(PKD_DISPATCH_TABLE WrapperTable, + ULONG BootPhase) +{ + if (!KdDebuggerEnabled || !KdpDebugMode.Gdb) + { + return; + } + + if (BootPhase == 0) + { + ExInitializeFastMutex(&GspLock); + + /* Write out the functions that we support for now */ + WrapperTable->KdpInitRoutine = KdpGdbStubInit; + WrapperTable->KdpPrintRoutine = KdpGdbDebugPrint; + WrapperTable->KdpExceptionRoutine = KdpGdbEnterDebuggerException; + + /* Initialize the Port */ + KdPortInitializeEx(&GdbPortInfo, 0, 0); + + KdpPort = GdbPortInfo.ComPort; + } + else if (BootPhase == 1) + { + GspInitialized = TRUE; + + GspRunThread = NULL; + GspDbgThread = NULL; + GspEnumThread = NULL; + + HalDisplayString("Waiting for GDB to attach\n"); + DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); + } + else if (BootPhase == 2) + { + HalDisplayString("\n GDB debugging enabled\n\n"); + } +} + +/* EOF */ diff --git a/reactos/ntoskrnl/kdbg/kdb.c b/reactos/ntoskrnl/kdbg/kdb.c index 830e61d8e7c..36292914a02 100644 --- a/reactos/ntoskrnl/kdbg/kdb.c +++ b/reactos/ntoskrnl/kdbg/kdb.c @@ -6,7 +6,7 @@ * * PROGRAMMERS: Gregor Anich */ - + /* INCLUDES ******************************************************************/ #include @@ -159,12 +159,12 @@ KdbpKdbTrapFrameToTrapFrame(PKDB_KTRAP_FRAME KdbTrapFrame, PKTRAP_FRAME TrapFram { /* Copy the TrapFrame only up to Eflags and zero the rest*/ RtlCopyMemory(TrapFrame, &KdbTrapFrame->Tf, FIELD_OFFSET(KTRAP_FRAME, HardwareEsp)); - + /* FIXME: write cr0, cr2, cr3 and cr4 (not needed atm) */ - + KiSsToTrapFrame(TrapFrame, KdbTrapFrame->Tf.HardwareSegSs); KiEspToTrapFrame(TrapFrame, KdbTrapFrame->Tf.HardwareEsp); - + /* FIXME: copy v86 registers if TrapFrame is a V86 trapframe */ } diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 03654bc85ce..010e380daaa 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -144,7 +144,7 @@ KiRosPcToUserFileHeader(IN PVOID Eip, PVOID ImageBase, EipBase = NULL; PLDR_DATA_TABLE_ENTRY Entry; PLIST_ENTRY ListHead, NextEntry; - + /* * We know this is valid because we should only be called after a * succesfull address from RtlWalkFrameChain for UserMode, which @@ -152,7 +152,7 @@ KiRosPcToUserFileHeader(IN PVOID Eip, */ ListHead = &KeGetCurrentThread()-> Teb->ProcessEnvironmentBlock->Ldr->InLoadOrderModuleList; - + /* Set list pointers and make sure it's valid */ NextEntry = ListHead->Flink; if (NextEntry) @@ -164,11 +164,11 @@ KiRosPcToUserFileHeader(IN PVOID Eip, Entry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); - + /* Move to the next entry */ NextEntry = NextEntry->Flink; ImageBase = Entry->DllBase; - + /* Check if this is the right one */ if (((ULONG_PTR)Eip >= (ULONG_PTR)Entry->DllBase) && ((ULONG_PTR)Eip < ((ULONG_PTR)Entry->DllBase + Entry->SizeOfImage))) @@ -180,7 +180,7 @@ KiRosPcToUserFileHeader(IN PVOID Eip, } } } - + /* Return the base address */ return EipBase; } @@ -195,33 +195,33 @@ KeRosCaptureUserStackBackTrace(IN ULONG FramesToSkip, PVOID Frames[2 * 64]; ULONG FrameCount; ULONG Hash = 0, i; - + /* Skip a frame for the caller */ FramesToSkip++; - + /* Don't go past the limit */ if ((FramesToCapture + FramesToSkip) >= 128) return 0; - + /* Do the back trace */ FrameCount = RtlWalkFrameChain(Frames, FramesToCapture + FramesToSkip, 1); - + /* Make sure we're not skipping all of them */ if (FrameCount <= FramesToSkip) return 0; - + /* Loop all the frames */ for (i = 0; i < FramesToCapture; i++) { /* Don't go past the limit */ if ((FramesToSkip + i) >= FrameCount) break; - + /* Save this entry and hash it */ BackTrace[i] = Frames[FramesToSkip + i]; Hash += PtrToUlong(BackTrace[i]); } - + /* Write the hash */ if (BackTraceHash) *BackTraceHash = Hash; - + /* Clear the other entries and return count */ RtlFillMemoryUlong(Frames, 128, 0); return (USHORT)i; @@ -276,16 +276,16 @@ KeRosDumpStackFrames(IN PULONG Frame OPTIONAL, /* Go to the next frame */ DbgPrint("\n"); } - + /* Get the current frames */ FrameCount = KeRosCaptureUserStackBackTrace(-1, 32, (PVOID*)Frames, NULL); - + /* Now loop them */ for (i = 0; i < FrameCount; i++) { /* Get the EIP */ Addr = Frames[i]; - + /* Get the base for this file */ if (KiRosPcToUserFileHeader((PVOID)Addr, &LdrEntry)) { @@ -298,7 +298,7 @@ KeRosDumpStackFrames(IN PULONG Frame OPTIONAL, /* Print only the address */ DbgPrint("<%x>", Addr); } - + /* Go to the next frame */ DbgPrint("\n"); } @@ -1096,13 +1096,13 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, * We'll manually dump the stack for the user. */ KeRosDumpStackFrames(NULL, 0); - + /* ROS HACK 2: Generate something useful for Bugzilla */ KeRosDumpTriageForBugZillaReport(); } } - /* Raise IRQL to HIGH_LEVEL */ + /* Raise IRQL to HIGH_LEVEL */ _disable(); KfRaiseIrql(HIGH_LEVEL); diff --git a/reactos/ntoskrnl/ke/freeldr.c b/reactos/ntoskrnl/ke/freeldr.c index bcdbe54c8f0..c8c742e4aa8 100644 --- a/reactos/ntoskrnl/ke/freeldr.c +++ b/reactos/ntoskrnl/ke/freeldr.c @@ -226,7 +226,7 @@ KiRosAllocateArcDescriptor(IN ULONG PageBegin, /* Cut down the current free descriptor */ MDArray[i].PageCount = PageBegin - MDArray[i].BasePage; - + /* Allocate a new memory descriptor for our memory range */ MDArray[NumberDescriptors].BasePage = PageBegin; MDArray[NumberDescriptors].PageCount = PageEnd - PageBegin; diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index ac958ce532e..7d9ae71fa09 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -309,9 +309,9 @@ USHORT NTAPI KiTagWordFnsaveToFxsave(USHORT TagWord) { - INT FxTagWord = ~TagWord; + INT FxTagWord = ~TagWord; - /* + /* * Empty is now 00, any 2 bits containing 1 mean valid * Now convert the rest (11->0 and the rest to 1) */ @@ -802,17 +802,17 @@ KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame, BOOLEAN FASTCALL KeInvalidAccessAllowed(IN PVOID TrapInformation OPTIONAL) -{ +{ ULONG Eip; PKTRAP_FRAME TrapFrame = TrapInformation; VOID NTAPI ExpInterlockedPopEntrySListFault(VOID); - + /* Don't do anything if we didn't get a trap frame */ if (!TrapInformation) return FALSE; /* Check where we came from */ switch (TrapFrame->SegCs) - { + { /* Kernel mode */ case KGDT_R0_CODE: @@ -827,7 +827,7 @@ KeInvalidAccessAllowed(IN PVOID TrapInformation OPTIONAL) //Eip = (ULONG)KeUserPopEntrySListFault; Eip = 0; break; - + default: /* Anything else gets a bugcheck */ diff --git a/reactos/ntoskrnl/ke/i386/ldt.c b/reactos/ntoskrnl/ke/i386/ldt.c index 8cb135bb81f..2d3f5480448 100644 --- a/reactos/ntoskrnl/ke/i386/ldt.c +++ b/reactos/ntoskrnl/ke/i386/ldt.c @@ -126,7 +126,7 @@ BOOLEAN PspIsDescriptorValid(PLDT_ENTRY ldt_entry) that wrap the address space. Windows NT does not allow user-created selectors to reach into kernel memory. However, there is no security risk in allowing it; the page table will prevent access anyway. - */ + */ return (/*(Base + SegLimit > (ULONG_PTR) MmHighestUserAddress) || (Base > Base+SegLimit) ? FALSE : TRUE*/ TRUE); } diff --git a/reactos/ntoskrnl/ke/powerpc/exp.c b/reactos/ntoskrnl/ke/powerpc/exp.c index 148f8efea9b..627958405ae 100644 --- a/reactos/ntoskrnl/ke/powerpc/exp.c +++ b/reactos/ntoskrnl/ke/powerpc/exp.c @@ -1,114 +1,114 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ke/i386/exp.c - * PURPOSE: Exception Dispatching and Context<->Trap Frame Conversion - * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) - * Gregor Anich - * Skywing (skywing@valhallalegends.com) - */ - -/* INCLUDES ******************************************************************/ - -#include -#define NDEBUG -#include - -/* FUNCTIONS *****************************************************************/ - -_SEH_DEFINE_LOCALS(KiCopyInfo) -{ - volatile EXCEPTION_RECORD SehExceptRecord; -}; - -_SEH_FILTER(KiCopyInformation) -{ - _SEH_ACCESS_LOCALS(KiCopyInfo); - - /* Copy the exception records and return to the handler */ - RtlMoveMemory((PVOID)&_SEH_VAR(SehExceptRecord), - _SEH_GetExceptionPointers()->ExceptionRecord, - sizeof(EXCEPTION_RECORD)); - return EXCEPTION_EXECUTE_HANDLER; -} - -VOID -INIT_FUNCTION -NTAPI -KeInitExceptions(VOID) -{ -} - -ULONG -NTAPI -KiEspFromTrapFrame(IN PKTRAP_FRAME TrapFrame) -{ - return 0; -} - -VOID -NTAPI -KiEspToTrapFrame(IN PKTRAP_FRAME TrapFrame, - IN ULONG Esp) -{ -} - -ULONG -NTAPI -KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame) -{ - return 0; -} - -VOID -NTAPI -KiSsToTrapFrame(IN PKTRAP_FRAME TrapFrame, - IN ULONG Ss) -{ -} - -USHORT -NTAPI -KiTagWordFnsaveToFxsave(USHORT TagWord) -{ - return 0; -} - -VOID -NTAPI -KeContextToTrapFrame(IN PCONTEXT Context, - IN OUT PKEXCEPTION_FRAME ExceptionFrame, - IN OUT PKTRAP_FRAME TrapFrame, - IN ULONG ContextFlags, - IN KPROCESSOR_MODE PreviousMode) -{ -} - -VOID -NTAPI -KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame, - IN PKEXCEPTION_FRAME ExceptionFrame, - IN OUT PCONTEXT Context) -{ -} - -VOID -NTAPI -KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, - IN PKEXCEPTION_FRAME ExceptionFrame, - IN PKTRAP_FRAME TrapFrame, - IN KPROCESSOR_MODE PreviousMode, - IN BOOLEAN FirstChance) -{ -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -KeRaiseUserException(IN NTSTATUS ExceptionCode) -{ - return STATUS_SUCCESS; -} - +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/i386/exp.c + * PURPOSE: Exception Dispatching and Context<->Trap Frame Conversion + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + * Gregor Anich + * Skywing (skywing@valhallalegends.com) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +/* FUNCTIONS *****************************************************************/ + +_SEH_DEFINE_LOCALS(KiCopyInfo) +{ + volatile EXCEPTION_RECORD SehExceptRecord; +}; + +_SEH_FILTER(KiCopyInformation) +{ + _SEH_ACCESS_LOCALS(KiCopyInfo); + + /* Copy the exception records and return to the handler */ + RtlMoveMemory((PVOID)&_SEH_VAR(SehExceptRecord), + _SEH_GetExceptionPointers()->ExceptionRecord, + sizeof(EXCEPTION_RECORD)); + return EXCEPTION_EXECUTE_HANDLER; +} + +VOID +INIT_FUNCTION +NTAPI +KeInitExceptions(VOID) +{ +} + +ULONG +NTAPI +KiEspFromTrapFrame(IN PKTRAP_FRAME TrapFrame) +{ + return 0; +} + +VOID +NTAPI +KiEspToTrapFrame(IN PKTRAP_FRAME TrapFrame, + IN ULONG Esp) +{ +} + +ULONG +NTAPI +KiSsFromTrapFrame(IN PKTRAP_FRAME TrapFrame) +{ + return 0; +} + +VOID +NTAPI +KiSsToTrapFrame(IN PKTRAP_FRAME TrapFrame, + IN ULONG Ss) +{ +} + +USHORT +NTAPI +KiTagWordFnsaveToFxsave(USHORT TagWord) +{ + return 0; +} + +VOID +NTAPI +KeContextToTrapFrame(IN PCONTEXT Context, + IN OUT PKEXCEPTION_FRAME ExceptionFrame, + IN OUT PKTRAP_FRAME TrapFrame, + IN ULONG ContextFlags, + IN KPROCESSOR_MODE PreviousMode) +{ +} + +VOID +NTAPI +KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame, + IN PKEXCEPTION_FRAME ExceptionFrame, + IN OUT PCONTEXT Context) +{ +} + +VOID +NTAPI +KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, + IN PKEXCEPTION_FRAME ExceptionFrame, + IN PKTRAP_FRAME TrapFrame, + IN KPROCESSOR_MODE PreviousMode, + IN BOOLEAN FirstChance) +{ +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +KeRaiseUserException(IN NTSTATUS ExceptionCode) +{ + return STATUS_SUCCESS; +} + diff --git a/reactos/ntoskrnl/ke/powerpc/kiinit.c b/reactos/ntoskrnl/ke/powerpc/kiinit.c index bd7cfd25b44..49976a95cc1 100644 --- a/reactos/ntoskrnl/ke/powerpc/kiinit.c +++ b/reactos/ntoskrnl/ke/powerpc/kiinit.c @@ -1,323 +1,323 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ke/powerpc/kiinit.c - * PURPOSE: Kernel Initialization for x86 CPUs - * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) - * Art Yerkes (ayerkes@speakeasy.net) - */ - -/* INCLUDES *****************************************************************/ - -#include -#include - -#define NDEBUG -#include -#include -#include "ppcmmu/mmu.h" - -/* GLOBALS *******************************************************************/ - -/* Ku bit should be set, so that we get the best options for page protection */ -#define PPC_SEG_Ku 0x40000000 -#define PPC_SEG_Ks 0x20000000 - -extern LOADER_MODULE KeLoaderModules[64]; -extern ULONG KeLoaderModuleCount; -extern ULONG_PTR MmFreeLdrLastKernelAddress; -KPRCB PrcbData[MAXIMUM_PROCESSORS]; - -/* FUNCTIONS *****************************************************************/ - -/* - * Trap frame: - * r0 .. r32 - * lr, ctr, srr0, srr1, dsisr - */ -__asm__(".text\n\t" - ".globl syscall_start\n\t" - ".globl syscall_end\n\t" - ".globl KiSystemService\n\t" - "syscall_start:\n\t" - "mr 2,1\n\t" - "lis 1,KiSystemService1@ha\n\t" - "addi 1,1,KiSystemService1@l\n\t" - "mfsrr0 0\n\t" - "mtsrr0 1\n\t" - "lis 1,_kernel_trap_stack@ha\n\t" - "addi 1,1,_kernel_trap_stack@l\n\t" - "subi 1,1,0x100\n\t" - "rfi\n\t" - "syscall_end:\n\t" - ".space 4"); - -extern int syscall_start[], syscall_end; - -VOID -NTAPI -KiSetupSyscallHandler() -{ - paddr_t handler_target; - int *source; - for(source = syscall_start, handler_target = 0xc00; - source < &syscall_end; - source++, handler_target += sizeof(int)) - SetPhys(handler_target, *source); -} - -VOID -NTAPI -KiInitializePcr(IN ULONG ProcessorNumber, - IN PKIPCR Pcr, - IN PKTHREAD IdleThread, - IN PVOID DpcStack) -{ - Pcr->MajorVersion = PCR_MAJOR_VERSION; - Pcr->MinorVersion = PCR_MINOR_VERSION; - Pcr->CurrentIrql = PASSIVE_LEVEL; - Pcr->PrcbData = &PrcbData[ProcessorNumber]; - Pcr->PrcbData->MajorVersion = PRCB_MAJOR_VERSION; - Pcr->PrcbData->MinorVersion = 0; - Pcr->PrcbData->Number = 0; /* UP for now */ - Pcr->PrcbData->SetMember = 1; -#if DBG - Pcr->PrcbData->BuildType = PRCB_BUILD_DEBUG; -#else - Pcr->PrcbData->BuildType = 0; -#endif - Pcr->PrcbData->DpcStack = DpcStack; - KiProcessorBlock[ProcessorNumber] = Pcr->PrcbData; -} - -extern ULONG KiGetFeatureBits(); -extern VOID KiSetProcessorType(); -extern VOID KiGetCacheInformation(); - -VOID -NTAPI -KiInitializeKernel(IN PKPROCESS InitProcess, - IN PKTHREAD InitThread, - IN PVOID IdleStack, - IN PKPRCB Prcb, - IN CCHAR Number, - IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock) -{ - ULONG FeatureBits; - LARGE_INTEGER PageDirectory; - PVOID DpcStack; - - /* Detect and set the CPU Type */ - KiSetProcessorType(); - - /* Initialize the Power Management Support for this PRCB */ - PoInitializePrcb(Prcb); - - /* Get the processor features for the CPU */ - FeatureBits = KiGetFeatureBits(); - - /* Save feature bits */ - Prcb->FeatureBits = FeatureBits; - - /* Get cache line information for this CPU */ - KiGetCacheInformation(); - - /* Initialize spinlocks and DPC data */ - KiInitSpinLocks(Prcb, Number); - - /* Check if this is the Boot CPU */ - if (!Number) - { - /* Set Node Data */ - KeNodeBlock[0] = &KiNode0; - Prcb->ParentNode = KeNodeBlock[0]; - KeNodeBlock[0]->ProcessorMask = Prcb->SetMember; - - /* Set boot-level flags */ - KeProcessorArchitecture = 0; - KeProcessorLevel = (USHORT)Prcb->CpuType; - KeFeatureBits = FeatureBits; - - /* Set the current MP Master KPRCB to the Boot PRCB */ - Prcb->MultiThreadSetMaster = Prcb; - - /* Initialize portable parts of the OS */ - KiInitSystem(); - - /* Initialize the Idle Process and the Process Listhead */ - InitializeListHead(&KiProcessListHead); - PageDirectory.QuadPart = 0; - KeInitializeProcess(InitProcess, - 0, - 0xFFFFFFFF, - &PageDirectory, - TRUE); - InitProcess->QuantumReset = MAXCHAR; - } - else - { - /* FIXME */ - DPRINT1("SMP Boot support not yet present\n"); - } - - /* Setup the Idle Thread */ - KeInitializeThread(InitProcess, - InitThread, - NULL, - NULL, - NULL, - NULL, - NULL, - IdleStack); - InitThread->NextProcessor = Number; - InitThread->Priority = HIGH_PRIORITY; - InitThread->State = Running; - InitThread->Affinity = 1 << Number; - InitThread->WaitIrql = DISPATCH_LEVEL; - InitProcess->ActiveProcessors = 1 << Number; - - /* Set up the thread-related fields in the PRCB */ - //Prcb->CurrentThread = InitThread; - Prcb->NextThread = NULL; - //Prcb->IdleThread = InitThread; - - /* Initialize the Kernel Executive */ - ExpInitializeExecutive(0, (PLOADER_PARAMETER_BLOCK)LoaderBlock); - - /* Only do this on the boot CPU */ - if (!Number) - { - /* Calculate the time reciprocal */ - KiTimeIncrementReciprocal = - KiComputeReciprocal(KeMaximumIncrement, - &KiTimeIncrementShiftCount); - - /* Update DPC Values in case they got updated by the executive */ - Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth; - Prcb->MinimumDpcRate = KiMinimumDpcRate; - Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold; - - /* Allocate the DPC Stack */ - DpcStack = MmCreateKernelStack(FALSE, 0); - if (!DpcStack) KeBugCheckEx(NO_PAGES_AVAILABLE, 1, 0, 0, 0); - Prcb->DpcStack = DpcStack; - } - - /* Free Initial Memory */ - // MiFreeInitMemory(); - - while (1) - { - LARGE_INTEGER Timeout; - Timeout.QuadPart = 0x7fffffffffffffffLL; - KeDelayExecutionThread(KernelMode, FALSE, &Timeout); - } - - /* Bug Check and loop forever if anything failed */ - KEBUGCHECK(0); - for(;;); -} - -extern int KiPageFaultHandler(int trap, ppc_trap_frame_t *frame); - -/* Use this for early boot additions to the page table */ -VOID -NTAPI -KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - ULONG Cpu; - ppc_map_info_t info[3]; - PKIPCR Pcr = (PKIPCR)KPCR_BASE; - PKPRCB Prcb; - - __asm__("mr 13,%0" : : "r" (KPCR_BASE)); - - /* Set the page fault handler to the kernel */ - MmuSetTrapHandler(3,KiPageFaultHandler); - MmuSetTrapHandler(4,KiPageFaultHandler); - - // Make 0xf... special - MmuAllocVsid(2, 0x8000); - MmuSetVsid(15,16,2); - - /* Get the current CPU */ - Cpu = KeNumberProcessors; - if (!Cpu) - { - /* We'll allocate a page from the end of the kernel area for KPCR. This code will probably - * change when we get SMP support. - */ - info[0].phys = 0; - info[0].proc = 2; - info[0].addr = (vaddr_t)Pcr; - info[0].flags = MMU_KRW_UR; - info[1].phys = 0; - info[1].proc = 2; - info[1].addr = ((vaddr_t)Pcr) + (1 << PAGE_SHIFT); - info[1].flags = MMU_KRW_UR; - info[2].phys = 0; - info[2].proc = 2; - info[2].addr = (vaddr_t)KI_USER_SHARED_DATA; - info[2].flags = MMU_KRW_UR; - MmuMapPage(info, 3); - } - - /* Skip initial setup if this isn't the Boot CPU */ - if (Cpu) goto AppCpuInit; - - /* Initialize the PCR */ - RtlZeroMemory(Pcr, PAGE_SIZE); - KiInitializePcr(Cpu, - Pcr, - &KiInitialThread.Tcb, - KiDoubleFaultStack); - - /* Set us as the current process */ - KiInitialThread.Tcb.ApcState.Process = &KiInitialProcess.Pcb; - - /* Setup CPU-related fields */ -AppCpuInit: - Pcr->Number = Cpu; - Pcr->SetMember = 1 << Cpu; - Prcb = KeGetCurrentPrcb(); - Prcb->SetMember = 1 << Cpu; - - /* Initialize the Processor with HAL */ - HalInitializeProcessor(Cpu, LoaderBlock); - - /* Set active processors */ - KeActiveProcessors |= Pcr->SetMember; - KeNumberProcessors++; - - /* Initialize the Debugger for the Boot CPU */ - if (!Cpu) KdInitSystem (0, LoaderBlock); - - /* Check for break-in */ - if (KdPollBreakIn()) - { - DbgBreakPointWithStatus(1); - } - - /* Raise to HIGH_LEVEL */ - KfRaiseIrql(HIGH_LEVEL); - - /* Call main kernel intialization */ - KiInitializeKernel(&KiInitialProcess.Pcb, - &KiInitialThread.Tcb, - P0BootStack, - Prcb, - Cpu, - (PVOID)LoaderBlock); -} - -VOID -NTAPI -KiInitMachineDependent(VOID) -{ -} - -void abort() -{ - KeBugCheck(0); - while(1); -} +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/powerpc/kiinit.c + * PURPOSE: Kernel Initialization for x86 CPUs + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + * Art Yerkes (ayerkes@speakeasy.net) + */ + +/* INCLUDES *****************************************************************/ + +#include +#include + +#define NDEBUG +#include +#include +#include "ppcmmu/mmu.h" + +/* GLOBALS *******************************************************************/ + +/* Ku bit should be set, so that we get the best options for page protection */ +#define PPC_SEG_Ku 0x40000000 +#define PPC_SEG_Ks 0x20000000 + +extern LOADER_MODULE KeLoaderModules[64]; +extern ULONG KeLoaderModuleCount; +extern ULONG_PTR MmFreeLdrLastKernelAddress; +KPRCB PrcbData[MAXIMUM_PROCESSORS]; + +/* FUNCTIONS *****************************************************************/ + +/* + * Trap frame: + * r0 .. r32 + * lr, ctr, srr0, srr1, dsisr + */ +__asm__(".text\n\t" + ".globl syscall_start\n\t" + ".globl syscall_end\n\t" + ".globl KiSystemService\n\t" + "syscall_start:\n\t" + "mr 2,1\n\t" + "lis 1,KiSystemService1@ha\n\t" + "addi 1,1,KiSystemService1@l\n\t" + "mfsrr0 0\n\t" + "mtsrr0 1\n\t" + "lis 1,_kernel_trap_stack@ha\n\t" + "addi 1,1,_kernel_trap_stack@l\n\t" + "subi 1,1,0x100\n\t" + "rfi\n\t" + "syscall_end:\n\t" + ".space 4"); + +extern int syscall_start[], syscall_end; + +VOID +NTAPI +KiSetupSyscallHandler() +{ + paddr_t handler_target; + int *source; + for(source = syscall_start, handler_target = 0xc00; + source < &syscall_end; + source++, handler_target += sizeof(int)) + SetPhys(handler_target, *source); +} + +VOID +NTAPI +KiInitializePcr(IN ULONG ProcessorNumber, + IN PKIPCR Pcr, + IN PKTHREAD IdleThread, + IN PVOID DpcStack) +{ + Pcr->MajorVersion = PCR_MAJOR_VERSION; + Pcr->MinorVersion = PCR_MINOR_VERSION; + Pcr->CurrentIrql = PASSIVE_LEVEL; + Pcr->PrcbData = &PrcbData[ProcessorNumber]; + Pcr->PrcbData->MajorVersion = PRCB_MAJOR_VERSION; + Pcr->PrcbData->MinorVersion = 0; + Pcr->PrcbData->Number = 0; /* UP for now */ + Pcr->PrcbData->SetMember = 1; +#if DBG + Pcr->PrcbData->BuildType = PRCB_BUILD_DEBUG; +#else + Pcr->PrcbData->BuildType = 0; +#endif + Pcr->PrcbData->DpcStack = DpcStack; + KiProcessorBlock[ProcessorNumber] = Pcr->PrcbData; +} + +extern ULONG KiGetFeatureBits(); +extern VOID KiSetProcessorType(); +extern VOID KiGetCacheInformation(); + +VOID +NTAPI +KiInitializeKernel(IN PKPROCESS InitProcess, + IN PKTHREAD InitThread, + IN PVOID IdleStack, + IN PKPRCB Prcb, + IN CCHAR Number, + IN PROS_LOADER_PARAMETER_BLOCK LoaderBlock) +{ + ULONG FeatureBits; + LARGE_INTEGER PageDirectory; + PVOID DpcStack; + + /* Detect and set the CPU Type */ + KiSetProcessorType(); + + /* Initialize the Power Management Support for this PRCB */ + PoInitializePrcb(Prcb); + + /* Get the processor features for the CPU */ + FeatureBits = KiGetFeatureBits(); + + /* Save feature bits */ + Prcb->FeatureBits = FeatureBits; + + /* Get cache line information for this CPU */ + KiGetCacheInformation(); + + /* Initialize spinlocks and DPC data */ + KiInitSpinLocks(Prcb, Number); + + /* Check if this is the Boot CPU */ + if (!Number) + { + /* Set Node Data */ + KeNodeBlock[0] = &KiNode0; + Prcb->ParentNode = KeNodeBlock[0]; + KeNodeBlock[0]->ProcessorMask = Prcb->SetMember; + + /* Set boot-level flags */ + KeProcessorArchitecture = 0; + KeProcessorLevel = (USHORT)Prcb->CpuType; + KeFeatureBits = FeatureBits; + + /* Set the current MP Master KPRCB to the Boot PRCB */ + Prcb->MultiThreadSetMaster = Prcb; + + /* Initialize portable parts of the OS */ + KiInitSystem(); + + /* Initialize the Idle Process and the Process Listhead */ + InitializeListHead(&KiProcessListHead); + PageDirectory.QuadPart = 0; + KeInitializeProcess(InitProcess, + 0, + 0xFFFFFFFF, + &PageDirectory, + TRUE); + InitProcess->QuantumReset = MAXCHAR; + } + else + { + /* FIXME */ + DPRINT1("SMP Boot support not yet present\n"); + } + + /* Setup the Idle Thread */ + KeInitializeThread(InitProcess, + InitThread, + NULL, + NULL, + NULL, + NULL, + NULL, + IdleStack); + InitThread->NextProcessor = Number; + InitThread->Priority = HIGH_PRIORITY; + InitThread->State = Running; + InitThread->Affinity = 1 << Number; + InitThread->WaitIrql = DISPATCH_LEVEL; + InitProcess->ActiveProcessors = 1 << Number; + + /* Set up the thread-related fields in the PRCB */ + //Prcb->CurrentThread = InitThread; + Prcb->NextThread = NULL; + //Prcb->IdleThread = InitThread; + + /* Initialize the Kernel Executive */ + ExpInitializeExecutive(0, (PLOADER_PARAMETER_BLOCK)LoaderBlock); + + /* Only do this on the boot CPU */ + if (!Number) + { + /* Calculate the time reciprocal */ + KiTimeIncrementReciprocal = + KiComputeReciprocal(KeMaximumIncrement, + &KiTimeIncrementShiftCount); + + /* Update DPC Values in case they got updated by the executive */ + Prcb->MaximumDpcQueueDepth = KiMaximumDpcQueueDepth; + Prcb->MinimumDpcRate = KiMinimumDpcRate; + Prcb->AdjustDpcThreshold = KiAdjustDpcThreshold; + + /* Allocate the DPC Stack */ + DpcStack = MmCreateKernelStack(FALSE, 0); + if (!DpcStack) KeBugCheckEx(NO_PAGES_AVAILABLE, 1, 0, 0, 0); + Prcb->DpcStack = DpcStack; + } + + /* Free Initial Memory */ + // MiFreeInitMemory(); + + while (1) + { + LARGE_INTEGER Timeout; + Timeout.QuadPart = 0x7fffffffffffffffLL; + KeDelayExecutionThread(KernelMode, FALSE, &Timeout); + } + + /* Bug Check and loop forever if anything failed */ + KEBUGCHECK(0); + for(;;); +} + +extern int KiPageFaultHandler(int trap, ppc_trap_frame_t *frame); + +/* Use this for early boot additions to the page table */ +VOID +NTAPI +KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) +{ + ULONG Cpu; + ppc_map_info_t info[3]; + PKIPCR Pcr = (PKIPCR)KPCR_BASE; + PKPRCB Prcb; + + __asm__("mr 13,%0" : : "r" (KPCR_BASE)); + + /* Set the page fault handler to the kernel */ + MmuSetTrapHandler(3,KiPageFaultHandler); + MmuSetTrapHandler(4,KiPageFaultHandler); + + // Make 0xf... special + MmuAllocVsid(2, 0x8000); + MmuSetVsid(15,16,2); + + /* Get the current CPU */ + Cpu = KeNumberProcessors; + if (!Cpu) + { + /* We'll allocate a page from the end of the kernel area for KPCR. This code will probably + * change when we get SMP support. + */ + info[0].phys = 0; + info[0].proc = 2; + info[0].addr = (vaddr_t)Pcr; + info[0].flags = MMU_KRW_UR; + info[1].phys = 0; + info[1].proc = 2; + info[1].addr = ((vaddr_t)Pcr) + (1 << PAGE_SHIFT); + info[1].flags = MMU_KRW_UR; + info[2].phys = 0; + info[2].proc = 2; + info[2].addr = (vaddr_t)KI_USER_SHARED_DATA; + info[2].flags = MMU_KRW_UR; + MmuMapPage(info, 3); + } + + /* Skip initial setup if this isn't the Boot CPU */ + if (Cpu) goto AppCpuInit; + + /* Initialize the PCR */ + RtlZeroMemory(Pcr, PAGE_SIZE); + KiInitializePcr(Cpu, + Pcr, + &KiInitialThread.Tcb, + KiDoubleFaultStack); + + /* Set us as the current process */ + KiInitialThread.Tcb.ApcState.Process = &KiInitialProcess.Pcb; + + /* Setup CPU-related fields */ +AppCpuInit: + Pcr->Number = Cpu; + Pcr->SetMember = 1 << Cpu; + Prcb = KeGetCurrentPrcb(); + Prcb->SetMember = 1 << Cpu; + + /* Initialize the Processor with HAL */ + HalInitializeProcessor(Cpu, LoaderBlock); + + /* Set active processors */ + KeActiveProcessors |= Pcr->SetMember; + KeNumberProcessors++; + + /* Initialize the Debugger for the Boot CPU */ + if (!Cpu) KdInitSystem (0, LoaderBlock); + + /* Check for break-in */ + if (KdPollBreakIn()) + { + DbgBreakPointWithStatus(1); + } + + /* Raise to HIGH_LEVEL */ + KfRaiseIrql(HIGH_LEVEL); + + /* Call main kernel intialization */ + KiInitializeKernel(&KiInitialProcess.Pcb, + &KiInitialThread.Tcb, + P0BootStack, + Prcb, + Cpu, + (PVOID)LoaderBlock); +} + +VOID +NTAPI +KiInitMachineDependent(VOID) +{ +} + +void abort() +{ + KeBugCheck(0); + while(1); +} diff --git a/reactos/ntoskrnl/ke/powerpc/ppc_irq.c b/reactos/ntoskrnl/ke/powerpc/ppc_irq.c index 6555d8323bb..47c53bef2c8 100644 --- a/reactos/ntoskrnl/ke/powerpc/ppc_irq.c +++ b/reactos/ntoskrnl/ke/powerpc/ppc_irq.c @@ -98,7 +98,7 @@ void trap_handler_13(void); void trap_handler_14(void); void trap_handler_15(void); -static unsigned int trap_handler[NR_TRAPS] __attribute__((unused)) = +static unsigned int trap_handler[NR_TRAPS] __attribute__((unused)) = { (int)&trap_handler_0, (int)&trap_handler_1, @@ -542,7 +542,7 @@ KeDumpIrqList(VOID) /* * @implemented */ -BOOLEAN +BOOLEAN STDCALL KeConnectInterrupt(PKINTERRUPT InterruptObject) { @@ -617,7 +617,7 @@ KeConnectInterrupt(PKINTERRUPT InterruptObject) * ARGUMENTS: * InterruptObject = isr to release */ -BOOLEAN +BOOLEAN STDCALL KeDisconnectInterrupt(PKINTERRUPT InterruptObject) { @@ -652,10 +652,10 @@ KeDisconnectInterrupt(PKINTERRUPT InterruptObject) /* Completely Disable the Interrupt */ HalDisableSystemInterrupt(InterruptObject->Vector, InterruptObject->Irql); } - + /* Disconnect it */ InterruptObject->Connected = FALSE; - + /* Release the interrupt lock */ KeReleaseInterruptSpinLock(InterruptObject, synch_oldlvl); } @@ -665,7 +665,7 @@ KeDisconnectInterrupt(PKINTERRUPT InterruptObject) /* Go back to default affinity */ KeRevertToUserAffinityThread(); - + /* Return Old Interrupt State */ return State; } @@ -690,7 +690,7 @@ KeInitializeInterrupt(PKINTERRUPT Interrupt, /* Set the Interrupt Header */ Interrupt->Type = InterruptObject; Interrupt->Size = sizeof(KINTERRUPT); - + /* Check if we got a spinlock */ if (SpinLock) { @@ -702,7 +702,7 @@ KeInitializeInterrupt(PKINTERRUPT Interrupt, KeInitializeSpinLock(&Interrupt->SpinLock); Interrupt->ActualLock = &Interrupt->SpinLock; } - + /* Set the other settings */ Interrupt->ServiceRoutine = ServiceRoutine; Interrupt->ServiceContext = ServiceContext; @@ -713,7 +713,7 @@ KeInitializeInterrupt(PKINTERRUPT Interrupt, Interrupt->ShareVector = ShareVector; Interrupt->Number = ProcessorNumber; Interrupt->FloatingSave = FloatingSave; - + /* Disconnect it at first */ Interrupt->Connected = FALSE; } @@ -818,7 +818,7 @@ __asm__(".globl KiSystemService\n\t" "mtsrr1 0\n\t" "lwz 1,4(1)\n" /* Stack */ "rfi\n"); - + VOID NTAPI KiSystemService(ppc_trap_frame_t *trap_frame) @@ -831,7 +831,7 @@ KiSystemService(ppc_trap_frame_t *trap_frame) SetPhysByte(0x800003f8, ((PCHAR)trap_frame->gpr[4])[i]); trap_frame->gpr[3] = KdpServiceDispatcher - (trap_frame->gpr[3], + (trap_frame->gpr[3], (PCHAR)trap_frame->gpr[4], trap_frame->gpr[5]); break; diff --git a/reactos/ntoskrnl/ke/powerpc/stubs.c b/reactos/ntoskrnl/ke/powerpc/stubs.c index 3bbcdba26a7..a8b154d9686 100644 --- a/reactos/ntoskrnl/ke/powerpc/stubs.c +++ b/reactos/ntoskrnl/ke/powerpc/stubs.c @@ -1,234 +1,234 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/vdm/vdmmain.c - * PURPOSE: VDM Support Services - * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) - */ - -/* INCLUDES ******************************************************************/ - -#include -#define NDEBUG -#include - -NTSTATUS -NTAPI -NtVdmControl(IN ULONG ControlCode, - IN PVOID ControlData) -{ - return STATUS_UNSUCCESSFUL; -} - -NTSTATUS -NTAPI -Ke386CallBios(IN ULONG Int, - OUT PCONTEXT Context) -{ - return STATUS_UNSUCCESSFUL; -} - -VOID -NTAPI -KiUnexpectedInterrupt() -{ -} - -LONG NTAPI Exi386InterlockedDecrementLong(PLONG Addend) -{ - return _InterlockedDecrement(Addend); -} - -LONG NTAPI Exi386InterlockedIncrementLong(PLONG Addend) -{ - return _InterlockedIncrement(Addend); -} - -LONG NTAPI Exi386InterlockedExchangeUlong(PLONG Target, LONG Exch, LONG Compare) -{ - return _InterlockedCompareExchange(Target, Exch, Compare); -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -KeI386FlatToGdtSelector(IN ULONG Base, - IN USHORT Length, - IN USHORT Selector) -{ - UNIMPLEMENTED; - return 0; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -KeI386ReleaseGdtSelectors(OUT PULONG SelArray, - IN ULONG NumOfSelectors) -{ - UNIMPLEMENTED; - return 0; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -KeI386AllocateGdtSelectors(OUT PULONG SelArray, - IN ULONG NumOfSelectors) -{ - UNIMPLEMENTED; - return 0; -} - -VOID -NTAPI -KeDumpStackFrames(PULONG Frame) -{ -} - -LONG -NTAPI -Kei386EoiHelper() { return 0; } - -NTSTATUS -NTAPI -KeUserModeCallback(IN ULONG RoutineIndex, - IN PVOID Argument, - IN ULONG ArgumentLength, - OUT PVOID *Result, - OUT PULONG ResultLength) -{ - return STATUS_UNSUCCESSFUL; -} - -VOID -NTAPI -KiCoprocessorError() { } - -VOID -NTAPI -KiDispatchInterrupt() { } - -VOID -NTAPI -KiInitializeUserApc(IN PKEXCEPTION_FRAME ExceptionFrame, - IN PKTRAP_FRAME TrapFrame, - IN PKNORMAL_ROUTINE NormalRoutine, - IN PVOID NormalContext, - IN PVOID SystemArgument1, - IN PVOID SystemArgument2) -{ -} - -PVOID -NTAPI -KeSwitchKernelStack(PVOID StackBase, PVOID StackLimit) -{ - return NULL; -} - -VOID -NTAPI -KiSwapProcess(struct _KPROCESS *NewProcess, struct _KPROCESS *OldProcess) -{ -} - -BOOLEAN -NTAPI -KiSwapContext(PKTHREAD CurrentThread, PKTHREAD NewThread) -{ - return FALSE; -} - -NTSTATUS -NTAPI -Mmi386ReleaseMmInfo(PEPROCESS Process) -{ - return STATUS_UNSUCCESSFUL; -} - -VOID -NTAPI -KeI386VdmInitialize(VOID) -{ -} - -NTSYSAPI -NTSTATUS -NTAPI -NtCallbackReturn -( IN PVOID Result OPTIONAL, IN ULONG ResultLength, IN NTSTATUS Status ) -{ - return STATUS_UNSUCCESSFUL; -} - -NTSYSAPI -NTSTATUS -NTAPI -NtContinue -(IN PCONTEXT ThreadContext, IN BOOLEAN RaiseAlert) -{ - return STATUS_UNSUCCESSFUL; -} - -NTSYSAPI -ULONG -NTAPI -NtGetTickCount() { return __rdtsc(); } - -NTSTATUS -STDCALL -NtSetLdtEntries -(ULONG Selector1, LDT_ENTRY LdtEntry1, ULONG Selector2, LDT_ENTRY LdtEntry2) -{ - return STATUS_UNSUCCESSFUL; -} - -NTSYSAPI -NTSTATUS -NTAPI -NtRaiseException -(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ThreadContext, IN BOOLEAN HandleException ) -{ - return STATUS_UNSUCCESSFUL; -} - -VOID -STDCALL -KiThreadStartup(PKSYSTEM_ROUTINE SystemRoutine, - PKSTART_ROUTINE StartRoutine, - PVOID StartContext, - BOOLEAN UserThread, - KTRAP_FRAME TrapFrame) -{ -} - -void _alldiv() { } - -void _alldvrm() { } - -void _allmul() { } - -void _alloca_probe() { } - -void _allrem() { } - -void _allshl() { } - -void _allshr() { } - -void _aulldiv() { } - -void _aulldvrm() { } - -void _aullrem() { } - -void _aullshr() { } - -void _abnormal_termination() { } +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/vdm/vdmmain.c + * PURPOSE: VDM Support Services + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#include +#define NDEBUG +#include + +NTSTATUS +NTAPI +NtVdmControl(IN ULONG ControlCode, + IN PVOID ControlData) +{ + return STATUS_UNSUCCESSFUL; +} + +NTSTATUS +NTAPI +Ke386CallBios(IN ULONG Int, + OUT PCONTEXT Context) +{ + return STATUS_UNSUCCESSFUL; +} + +VOID +NTAPI +KiUnexpectedInterrupt() +{ +} + +LONG NTAPI Exi386InterlockedDecrementLong(PLONG Addend) +{ + return _InterlockedDecrement(Addend); +} + +LONG NTAPI Exi386InterlockedIncrementLong(PLONG Addend) +{ + return _InterlockedIncrement(Addend); +} + +LONG NTAPI Exi386InterlockedExchangeUlong(PLONG Target, LONG Exch, LONG Compare) +{ + return _InterlockedCompareExchange(Target, Exch, Compare); +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +KeI386FlatToGdtSelector(IN ULONG Base, + IN USHORT Length, + IN USHORT Selector) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +KeI386ReleaseGdtSelectors(OUT PULONG SelArray, + IN ULONG NumOfSelectors) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +KeI386AllocateGdtSelectors(OUT PULONG SelArray, + IN ULONG NumOfSelectors) +{ + UNIMPLEMENTED; + return 0; +} + +VOID +NTAPI +KeDumpStackFrames(PULONG Frame) +{ +} + +LONG +NTAPI +Kei386EoiHelper() { return 0; } + +NTSTATUS +NTAPI +KeUserModeCallback(IN ULONG RoutineIndex, + IN PVOID Argument, + IN ULONG ArgumentLength, + OUT PVOID *Result, + OUT PULONG ResultLength) +{ + return STATUS_UNSUCCESSFUL; +} + +VOID +NTAPI +KiCoprocessorError() { } + +VOID +NTAPI +KiDispatchInterrupt() { } + +VOID +NTAPI +KiInitializeUserApc(IN PKEXCEPTION_FRAME ExceptionFrame, + IN PKTRAP_FRAME TrapFrame, + IN PKNORMAL_ROUTINE NormalRoutine, + IN PVOID NormalContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2) +{ +} + +PVOID +NTAPI +KeSwitchKernelStack(PVOID StackBase, PVOID StackLimit) +{ + return NULL; +} + +VOID +NTAPI +KiSwapProcess(struct _KPROCESS *NewProcess, struct _KPROCESS *OldProcess) +{ +} + +BOOLEAN +NTAPI +KiSwapContext(PKTHREAD CurrentThread, PKTHREAD NewThread) +{ + return FALSE; +} + +NTSTATUS +NTAPI +Mmi386ReleaseMmInfo(PEPROCESS Process) +{ + return STATUS_UNSUCCESSFUL; +} + +VOID +NTAPI +KeI386VdmInitialize(VOID) +{ +} + +NTSYSAPI +NTSTATUS +NTAPI +NtCallbackReturn +( IN PVOID Result OPTIONAL, IN ULONG ResultLength, IN NTSTATUS Status ) +{ + return STATUS_UNSUCCESSFUL; +} + +NTSYSAPI +NTSTATUS +NTAPI +NtContinue +(IN PCONTEXT ThreadContext, IN BOOLEAN RaiseAlert) +{ + return STATUS_UNSUCCESSFUL; +} + +NTSYSAPI +ULONG +NTAPI +NtGetTickCount() { return __rdtsc(); } + +NTSTATUS +STDCALL +NtSetLdtEntries +(ULONG Selector1, LDT_ENTRY LdtEntry1, ULONG Selector2, LDT_ENTRY LdtEntry2) +{ + return STATUS_UNSUCCESSFUL; +} + +NTSYSAPI +NTSTATUS +NTAPI +NtRaiseException +(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ThreadContext, IN BOOLEAN HandleException ) +{ + return STATUS_UNSUCCESSFUL; +} + +VOID +STDCALL +KiThreadStartup(PKSYSTEM_ROUTINE SystemRoutine, + PKSTART_ROUTINE StartRoutine, + PVOID StartContext, + BOOLEAN UserThread, + KTRAP_FRAME TrapFrame) +{ +} + +void _alldiv() { } + +void _alldvrm() { } + +void _allmul() { } + +void _alloca_probe() { } + +void _allrem() { } + +void _allshl() { } + +void _allshr() { } + +void _aulldiv() { } + +void _aulldvrm() { } + +void _aullrem() { } + +void _aullshr() { } + +void _abnormal_termination() { } diff --git a/reactos/ntoskrnl/ke/powerpc/systimer.c b/reactos/ntoskrnl/ke/powerpc/systimer.c index 3a85f7c40c3..51d51df10db 100644 --- a/reactos/ntoskrnl/ke/powerpc/systimer.c +++ b/reactos/ntoskrnl/ke/powerpc/systimer.c @@ -1,21 +1,21 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ke/powerpc/kiinit.c - * PURPOSE: Kernel Initialization for x86 CPUs - * PROGRAMMERS: Art Yerkes (ayerkes@speakeasy.net) - */ - -/* INCLUDES *****************************************************************/ - -#include -#define NDEBUG -#include -#include - -ULONG -NTAPI -KiComputeTimerTableIndex(LONGLONG Timer) -{ - return 0; // XXX arty fixme -} +/* + * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/ke/powerpc/kiinit.c + * PURPOSE: Kernel Initialization for x86 CPUs + * PROGRAMMERS: Art Yerkes (ayerkes@speakeasy.net) + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include +#include + +ULONG +NTAPI +KiComputeTimerTableIndex(LONGLONG Timer) +{ + return 0; // XXX arty fixme +} diff --git a/reactos/ntoskrnl/ke/profobj.c b/reactos/ntoskrnl/ke/profobj.c index 479524a43eb..274da416035 100644 --- a/reactos/ntoskrnl/ke/profobj.c +++ b/reactos/ntoskrnl/ke/profobj.c @@ -141,12 +141,12 @@ KeStopProfile(PKPROFILE Profile) Profile->Started = FALSE; /* Find the Source Object */ - LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry) + LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry) { if (CurrentSource->Source == Profile->Source) { /* Remove it */ RemoveEntryList(&CurrentSource->ListEntry); - break; + break; } } @@ -245,7 +245,7 @@ KiParseProfileList(IN PKTRAP_FRAME TrapFrame, BucketValue = (PULONG)((((ULONG_PTR)Profile->Buffer + (TrapFrame->Eip - (ULONG_PTR)Profile->RangeBase)) >> Profile->BucketShift) &~ 0x3); -#elif defined(_M_PPC) +#elif defined(_M_PPC) // XXX arty #endif diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index 93b831c8b34..28dbfd08ece 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -27,14 +27,14 @@ * Ge van Geldorp * Eric Kohl * Royce Mitchell III - * Aleksey Bragin + * Aleksey Bragin * Jason Filby * Art Yerkes * Gunnar Andre' Dalsnes * Filip Navara * Thomas Weidenmueller * Alex Ionescu - * Trevor McCort + * Trevor McCort * Steven Edwards */ @@ -599,7 +599,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, DPRINT1("No memory allocation base type\n"); return STATUS_INVALID_PARAMETER_5; } - + /* MEM_RESET is an exclusive flag, make sure that is valid too */ if ((AllocationType & MEM_RESET) && (AllocationType != MEM_RESET)) { @@ -659,7 +659,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, RegionSize = PAGE_ROUND_UP((ULONG_PTR)PBaseAddress + PRegionSize) - PAGE_ROUND_DOWN(PBaseAddress); - /* + /* * We've captured and calculated the data, now do more checks * Yes, MmCreateMemoryArea does similar checks, but they don't return * the right status codes that a caller of this routine would expect. @@ -680,11 +680,11 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle, return STATUS_INVALID_PARAMETER_4; } - /* + /* * Copy on Write is reserved for system use. This case is a certain failure * but there may be other cases...needs more testing */ - if ((!BaseAddress || (AllocationType & MEM_RESERVE)) && + if ((!BaseAddress || (AllocationType & MEM_RESERVE)) && (Protect & (PAGE_WRITECOPY | PAGE_EXECUTE_WRITECOPY))) { DPRINT1("Copy on write is not supported by VirtualAlloc\n"); diff --git a/reactos/ntoskrnl/mm/cont.c b/reactos/ntoskrnl/mm/cont.c index 8fc409eb206..5790ee718ca 100644 --- a/reactos/ntoskrnl/mm/cont.c +++ b/reactos/ntoskrnl/mm/cont.c @@ -16,7 +16,7 @@ /* FUNCTIONS *****************************************************************/ -static VOID +static VOID MmFreeContinuousPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, PFN_TYPE Page, SWAPENTRY SwapEntry, BOOLEAN Dirty) diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index 3625da4b25a..281e8563819 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -190,9 +190,9 @@ MmGetContinuousPages(ULONG NumberOfBytes, { start = -1; length = 0; - /* First try to allocate the pages above the 16MB area. This may fail - * because there are not enough continuous pages or we cannot allocate - * pages above the 16MB area because the caller has specify an upper limit. + /* First try to allocate the pages above the 16MB area. This may fail + * because there are not enough continuous pages or we cannot allocate + * pages above the 16MB area because the caller has specify an upper limit. * The second try uses the specified lower limit. */ for (i = j == 0 ? 0x100000 / PAGE_SIZE : LowestAcceptableAddress.LowPart / PAGE_SIZE; i <= last; ) diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index cad4fe89283..d88b840c479 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -29,7 +29,7 @@ * Eric Kohl * Ge van Geldorp * Royce Mitchell III - * Aleksey Bragin + * Aleksey Bragin * Jason Filby * Thomas Weidenmueller * Gunnar Andre' Dalsnes diff --git a/reactos/ntoskrnl/mm/mdlsup.c b/reactos/ntoskrnl/mm/mdlsup.c index ba1485498d2..9eddcfa2933 100644 --- a/reactos/ntoskrnl/mm/mdlsup.c +++ b/reactos/ntoskrnl/mm/mdlsup.c @@ -90,7 +90,7 @@ MmInitializeMdlImplementation(VOID) } MmUnlockAddressSpace(MmGetKernelAddressSpace()); - Buffer = ExAllocatePoolWithTag(NonPagedPool, + Buffer = ExAllocatePoolWithTag(NonPagedPool, MI_MDL_MAPPING_REGION_SIZE / (PAGE_SIZE * 8), TAG_MDL); diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index ca18c8fac3e..6429c219331 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -102,7 +102,7 @@ MmInitVirtualMemory(ULONG_PTR LastKernelAddress, MmPagedPoolBase = (PVOID)ROUND_UP((ULONG_PTR)MiNonPagedPoolStart + MiNonPagedPoolLength + PAGE_SIZE, 0x400000); MmPagedPoolSize = MM_PAGED_POOL_SIZE; - DPRINT("NonPagedPool %x - %x, PagedPool %x - %x\n", MiNonPagedPoolStart, (ULONG_PTR)MiNonPagedPoolStart + MiNonPagedPoolLength - 1, + DPRINT("NonPagedPool %x - %x, PagedPool %x - %x\n", MiNonPagedPoolStart, (ULONG_PTR)MiNonPagedPoolStart + MiNonPagedPoolLength - 1, MmPagedPoolBase, (ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize - 1); MiInitializeNonPagedPool(); diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index 505497cffc8..5aaecefaf9a 100644 --- a/reactos/ntoskrnl/mm/npool.c +++ b/reactos/ntoskrnl/mm/npool.c @@ -83,7 +83,7 @@ typedef struct _HDR_USED LIST_ENTRY TagListEntry; #if defined(NPOOL_REDZONE_CHECK) || defined(NPOOL_REDZONE_CHECK_FULL) ULONG UserSize; -#endif +#endif BOOLEAN Dumped; } HDR_USED, *PHDR_USED; @@ -911,7 +911,7 @@ MiDebugDumpNonPagedPool(BOOLEAN NewOnly) } DbgPrint("***************** Dump Complete ***************\n"); KeReleaseSpinLock(&MmNpoolLock, oldIrql); -#endif +#endif } #ifdef ENABLE_VALIDATE_POOL @@ -1327,7 +1327,7 @@ static HDR_USED* get_block(unsigned int size, unsigned long alignment) break; } } - + if (best) { if (size < PAGE_SIZE) @@ -1346,7 +1346,7 @@ static HDR_USED* get_block(unsigned int size, unsigned long alignment) } } p = avl_get_next(FreeBlockListRoot, p); - } + } /* * We didn't find anything suitable at all. */ @@ -1487,7 +1487,7 @@ void check_redzone_header(HDR_USED* hdr) HiOK = FALSE; } } - + if (!HiOK || !LoOK) { c[0] = (CHAR)((hdr->Tag >> 24) & 0xFF); @@ -1514,7 +1514,7 @@ void check_redzone_header(HDR_USED* hdr) KEBUGCHECK(0); } } -#endif +#endif #ifdef NPOOL_REDZONE_CHECK_FULL void check_redzone_list(void) diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c index 07bb850fe3d..d3a69058856 100644 --- a/reactos/ntoskrnl/mm/pageop.c +++ b/reactos/ntoskrnl/mm/pageop.c @@ -17,7 +17,7 @@ #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitializePageOp) #endif - + /* GLOBALS *******************************************************************/ diff --git a/reactos/ntoskrnl/mm/pe.c b/reactos/ntoskrnl/mm/pe.c index 41502117a5c..2b1c7b8f5af 100644 --- a/reactos/ntoskrnl/mm/pe.c +++ b/reactos/ntoskrnl/mm/pe.c @@ -431,7 +431,7 @@ l_ReadHeaderFromFile: if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, AddressOfEntryPoint)) { - ImageSectionObject->EntryPoint = piohOptHeader->ImageBase + + ImageSectionObject->EntryPoint = piohOptHeader->ImageBase + piohOptHeader->AddressOfEntryPoint; } @@ -598,9 +598,9 @@ l_ReadHeaderFromFile: if(pishSectionHeaders[i].SizeOfRawData != 0) { /* validate the alignment */ -#if 0 +#if 0 /* Yes, this should be a multiple of FileAlignment, but there's - * stuff out there that isn't. We can cope with that + * stuff out there that isn't. We can cope with that */ if(!IsAligned(pishSectionHeaders[i].SizeOfRawData, nFileAlignment)) DIE(("SizeOfRawData[%u] is not aligned\n", i)); diff --git a/reactos/ntoskrnl/mm/powerpc/page.c b/reactos/ntoskrnl/mm/powerpc/page.c index d1e5e90ea8a..d1ef507deea 100644 --- a/reactos/ntoskrnl/mm/powerpc/page.c +++ b/reactos/ntoskrnl/mm/powerpc/page.c @@ -1,630 +1,630 @@ -/* $Id: page.c 23907 2006-09-04 05:52:23Z arty $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/i386/page.c - * PURPOSE: Low level memory managment manipulation - * - * PROGRAMMERS: David Welch (welch@cwcom.net) - * Revised for PowerPC by arty - */ - -/* INCLUDES ***************************************************************/ - -#include -#include -#define NDEBUG -#include - -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) -#pragma alloc_text(INIT, MiInitPageDirectoryMap) -#endif - -/* GLOBALS *****************************************************************/ - -#define HYPERSPACE_PAGEDIR_PTR ((PVOID)0xc0000000) - -#define PA_PRESENT (1ll<<63) -#define PA_USER (1ll<<62) -#define PA_ACCESSED 0x200 -#define PA_DIRTY 0x100 -#define PA_WT 0x20 -#define PA_CD 0x10 -#define PA_READWRITE 3 - -#define HYPERSPACE (0xc0400000) -#define IS_HYPERSPACE(v) (((ULONG)(v) >= HYPERSPACE && (ULONG)(v) < HYPERSPACE + 0x400000)) - -#define PTE_TO_PFN(X) ((X) >> PAGE_SHIFT) -#define PFN_TO_PTE(X) ((X) << PAGE_SHIFT) - -#if defined(__GNUC__) -#define PTE_TO_PAGE(X) ((LARGE_INTEGER)(LONGLONG)(PAGE_MASK(X))) -#else -__inline LARGE_INTEGER PTE_TO_PAGE(ULONG npage) -{ - LARGE_INTEGER dummy; - dummy.QuadPart = (LONGLONG)(PAGE_MASK(npage)); - return dummy; -} -#endif - -/* FUNCTIONS ***************************************************************/ - -VOID -STDCALL -MiFlushTlbIpiRoutine(PVOID Address) -{ - if (Address == (PVOID)0xffffffff) - { - __asm__("tlbsync"); - } - else if (Address == (PVOID)0xfffffffe) - { - __asm__("tlbsync"); - } - else - { - __asm__("tlbi %0" : "=r" (Address)); - } -} - -VOID -MiFlushTlb(PULONG Pt, PVOID Address) -{ - __asm__("tlbi %0" : "=r" (Address)); -} - - - -PULONG -MmGetPageDirectory(VOID) -{ - unsigned int page_dir=0; - return((PULONG)page_dir); -} - -static ULONG -ProtectToFlags(ULONG flProtect) -{ - return MMU_ALL_RW; // XXX hack -} - -NTSTATUS -STDCALL -MmCopyMmInfo(PEPROCESS Src, - PEPROCESS Dest, - PPHYSICAL_ADDRESS DirectoryTableBase) -{ - DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", Src, Dest); - - KeBugCheck(0); - - return(STATUS_SUCCESS); -} - -NTSTATUS -NTAPI -MmInitializeHandBuiltProcess(IN PEPROCESS Process, - IN PLARGE_INTEGER DirectoryTableBase) -{ - /* Share the directory base with the idle process */ - *DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase; - - /* Initialize the Addresss Space */ - MmInitializeAddressSpace(Process, (PMADDRESS_SPACE)&Process->VadRoot); - - /* The process now has an address space */ - Process->HasAddressSpace = TRUE; - return STATUS_SUCCESS; -} - -BOOLEAN -STDCALL -MmCreateProcessAddressSpace(IN ULONG MinWs, - IN PEPROCESS Process, - IN PLARGE_INTEGER DirectoryTableBase) -{ - KeBugCheck(0); - return TRUE; -} - -VOID -NTAPI -MmDeletePageTable(PEPROCESS Process, PVOID Address) -{ - PEPROCESS CurrentProcess = PsGetCurrentProcess(); - - if(!CurrentProcess) return; - - MmuRevokeVsid((paddr_t)Process->UniqueProcessId, -1); -} - -VOID -NTAPI -MmFreePageTable(PEPROCESS Process, PVOID Address) -{ - MmDeletePageTable(Process, Address); -} - -PVOID -NTAPI -MmGetPhysicalAddressProcess(PEPROCESS Process, PVOID Addr) -{ - ppc_map_info_t info = { 0 }; - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Addr; - MmuInqPage(&info, 1); - return (PVOID)info.phys; -} - -/* - * @implemented - */ -PHYSICAL_ADDRESS STDCALL -MmGetPhysicalAddress(PVOID vaddr) -/* - * FUNCTION: Returns the physical address corresponding to a virtual address - */ -{ - PHYSICAL_ADDRESS Addr; - Addr.QuadPart = (ULONG)MmGetPhysicalAddressProcess(PsGetCurrentProcess()->UniqueProcessId, vaddr); - return Addr; -} - -PFN_TYPE -NTAPI -MmGetPfnForProcess(PEPROCESS Process, - PVOID Address) -{ - return((PFN_TYPE)MmGetPhysicalAddressProcess(Process, Address) >> PAGE_SHIFT); -} - -VOID -NTAPI -MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) -/* - * FUNCTION: Delete a virtual mapping - */ -{ - ppc_map_info_t info = { 0 }; - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Address; - MmuUnmapPage(&info, 1); -} - -VOID -NTAPI -MmRawDeleteVirtualMapping(PVOID Address) -{ -} - -VOID -NTAPI -MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, - BOOLEAN* WasDirty, PPFN_TYPE Page) -/* - * FUNCTION: Delete a virtual mapping - */ -{ - ppc_map_info_t info = { 0 }; - - DPRINT("MmDeleteVirtualMapping(%x, %x, %d, %x, %x)\n", - Process, Address, FreePage, WasDirty, Page); - - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Address; - MmuInqPage(&info, 1); - - if (FreePage && info.phys) - { - MmReleasePageMemoryConsumer(MC_NPPOOL, info.phys >> PAGE_SHIFT); - } - - /* - * Return some information to the caller - */ - if (WasDirty != NULL) - { - *WasDirty = !!(info.flags & MMU_PAGE_DIRTY); - } - if (Page != NULL) - { - *Page = info.phys >> PAGE_SHIFT; - } -} - -VOID -NTAPI -MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, - SWAPENTRY* SwapEntry) -/* - * FUNCTION: Delete a virtual mapping - */ -{ - ppc_map_info_t info = { 0 }; - /* - * Decrement the reference count for this page table. - */ - if (Process != NULL && - ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL && - Address < MmSystemRangeStart) - { - PUSHORT Ptrc; - - Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable; - MmFreePageTable(Process, Address); - } - - /* - * Return some information to the caller - */ - MmuInqPage(&info, 1); - *SwapEntry = info.phys; -} - -BOOLEAN -NTAPI -MmIsDirtyPage(PEPROCESS Process, PVOID Address) -{ - ppc_map_info_t info = { 0 }; - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Address; - MmuInqPage(&info, 1); - return !!(info.flags & MMU_PAGE_DIRTY); -} - -BOOLEAN -NTAPI -MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) -{ - ppc_map_info_t info = { 0 }; - - if (Address < MmSystemRangeStart && Process == NULL) - { - DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - KEBUGCHECK(0); - } - - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Address; - MmuInqPage(&info, 1); - return !!(info.flags /*& MMU_PAGE_ACCESS*/); -} - -VOID -NTAPI -MmSetCleanPage(PEPROCESS Process, PVOID Address) -{ -} - -VOID -NTAPI -MmSetDirtyPage(PEPROCESS Process, PVOID Address) -{ -} - -VOID -NTAPI -MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) -{ -} - -BOOLEAN -NTAPI -MmIsPagePresent(PEPROCESS Process, PVOID Address) -{ - ppc_map_info_t info = { 0 }; - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Address; - MmuInqPage(&info, 1); - return !!info.phys; -} - -ULONGLONG MmGetPageEntryForProcess(PEPROCESS Process, PVOID Address) -{ - return 0; // XXX arty -} - -BOOLEAN -NTAPI -MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) -{ - ULONG Entry; - Entry = MmGetPageEntryForProcess(Process, Address); - return !(Entry & PA_PRESENT) && Entry != 0 ? TRUE : FALSE; -} - -NTSTATUS -NTAPI -MmCreateVirtualMappingForKernel(PVOID Address, - ULONG flProtect, - PPFN_TYPE Pages, - ULONG PageCount) -{ - ULONG i; - PVOID Addr; - - DPRINT("MmCreateVirtualMappingForKernel(%x, %x, %x, %d)\n", - Address, flProtect, Pages, PageCount); - - if (Address < MmSystemRangeStart) - { - DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); - } - - Addr = Address; - - for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) - { -#if 0 - if (!(Attributes & PA_PRESENT) && Pages[i] != 0) - { - DPRINT1("Setting physical address but not allowing access at address " - "0x%.8X with attributes %x/%x.\n", - Addr, Attributes, flProtect); - KEBUGCHECK(0); - } - (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); -#endif - } - - return(STATUS_SUCCESS); -} - -NTSTATUS -NTAPI -MmCreatePageFileMapping(PEPROCESS Process, - PVOID Address, - SWAPENTRY SwapEntry) -{ - if (Process == NULL && Address < MmSystemRangeStart) - { - DPRINT1("No process\n"); - KEBUGCHECK(0); - } - if (Process != NULL && Address >= MmSystemRangeStart) - { - DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); - } - if (SwapEntry & (1 << 31)) - { - KEBUGCHECK(0); - } - - // XXX arty - - return(STATUS_SUCCESS); -} - - -NTSTATUS -NTAPI -MmCreateVirtualMappingUnsafe(PEPROCESS Process, - PVOID Address, - ULONG flProtect, - PPFN_TYPE Pages, - ULONG PageCount) -{ - ULONG Attributes; - PVOID Addr; - ULONG i; - ppc_map_info_t info; - - DPRINT("MmCreateVirtualMappingUnsafe(%x, %x, %x, %x (%x), %d)\n", - Process, Address, flProtect, Pages, *Pages, PageCount); - - if (Process == NULL) - { - if (Address < MmSystemRangeStart) - { - DPRINT1("No process\n"); - KEBUGCHECK(0); - } - if (PageCount > 0x10000 || - (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) - { - DPRINT1("Page count to large\n"); - KEBUGCHECK(0); - } - } - else - { - if (Address >= MmSystemRangeStart) - { - DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); - } - if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || - (ULONG_PTR) Address / PAGE_SIZE + PageCount > - (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) - { - DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); - } - } - - Attributes = ProtectToFlags(flProtect); - Addr = Address; - - for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) - { - Process = PsGetCurrentProcess(); - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Addr; - info.flags = Attributes; - MmuMapPage(&info, 1); - //(void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); - if (Address < MmSystemRangeStart && - ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL && - Attributes & PA_PRESENT) - { -#if 0 - PUSHORT Ptrc; - - Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable; - - Ptrc[ADDR_TO_PAGE_TABLE(Addr)]++; -#endif - } - } - return(STATUS_SUCCESS); -} - -NTSTATUS -NTAPI -MmCreateVirtualMapping(PEPROCESS Process, - PVOID Address, - ULONG flProtect, - PPFN_TYPE Pages, - ULONG PageCount) -{ - ULONG i; - - for (i = 0; i < PageCount; i++) - { - if (!MmIsUsablePage(Pages[i])) - { - DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); - } - } - - return(MmCreateVirtualMappingUnsafe(Process, - Address, - flProtect, - Pages, - PageCount)); -} - -ULONG -NTAPI -MmGetPageProtect(PEPROCESS Process, PVOID Address) -{ - ULONG Protect = 0; - ppc_map_info_t info = { 0 }; - - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Address; - MmuInqPage(&info, 1); - - if (!info.phys) { return PAGE_NOACCESS; } - if (!(info.flags & MMU_KMASK)) - { - Protect |= PAGE_SYSTEM; - if ((info.flags & MMU_KR) && (info.flags & MMU_KW)) - Protect = PAGE_READWRITE; - else if (info.flags & MMU_KR) - Protect = PAGE_EXECUTE_READ; - } - else - { - if ((info.flags & MMU_UR) && (info.flags & MMU_UW)) - Protect = PAGE_READWRITE; - else - Protect = PAGE_EXECUTE_READ; - } - return(Protect); -} - -VOID -NTAPI -MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) -{ - //ULONG Attributes = 0; - - DPRINT("MmSetPageProtect(Process %x Address %x flProtect %x)\n", - Process, Address, flProtect); - -#if 0 - Attributes = ProtectToPTE(flProtect); - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - KEBUGCHECK(0); - } - InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); - MiFlushTlb(Pt, Address); -#endif -} - -PVOID -NTAPI -MmCreateHyperspaceMapping(PFN_TYPE Page) -{ - PVOID Address; - ppc_map_info_t info = { 0 }; - - Address = (PVOID)((ULONG_PTR)HYPERSPACE * PAGE_SIZE); - info.proc = 0; - info.addr = (vaddr_t)Address; - info.flags = MMU_KRW; - MmuMapPage(&info, 1); - - return Address; -} - -PFN_TYPE -NTAPI -MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) -{ - PFN_TYPE OldPage; - ppc_map_info_t info = { 0 }; - - info.proc = 0; - info.addr = (vaddr_t)Address; - MmuUnmapPage(&info, 1); - OldPage = info.phys; - info.phys = (paddr_t)NewPage; - MmuMapPage(&info, 1); - - return NewPage; -} - -PFN_TYPE -NTAPI -MmDeleteHyperspaceMapping(PVOID Address) -{ - ppc_map_info_t info = { 0 }; - ASSERT (IS_HYPERSPACE(Address)); - - info.proc = 0; - info.addr = (vaddr_t)Address; - - MmuUnmapPage(&info, 1); - - return (PFN_TYPE)info.phys; -} - -VOID -INIT_FUNCTION -NTAPI -MmInitGlobalKernelPageDirectory(VOID) -{ -} - -VOID -INIT_FUNCTION -NTAPI -MiInitPageDirectoryMap(VOID) -{ -} - -ULONG -NTAPI -MiGetUserPageDirectoryCount(VOID) -{ - return 0; -} - -VOID -NTAPI -MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) -{ -} - -/* EOF */ +/* $Id: page.c 23907 2006-09-04 05:52:23Z arty $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/mm/i386/page.c + * PURPOSE: Low level memory managment manipulation + * + * PROGRAMMERS: David Welch (welch@cwcom.net) + * Revised for PowerPC by arty + */ + +/* INCLUDES ***************************************************************/ + +#include +#include +#define NDEBUG +#include + +#if defined (ALLOC_PRAGMA) +#pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) +#pragma alloc_text(INIT, MiInitPageDirectoryMap) +#endif + +/* GLOBALS *****************************************************************/ + +#define HYPERSPACE_PAGEDIR_PTR ((PVOID)0xc0000000) + +#define PA_PRESENT (1ll<<63) +#define PA_USER (1ll<<62) +#define PA_ACCESSED 0x200 +#define PA_DIRTY 0x100 +#define PA_WT 0x20 +#define PA_CD 0x10 +#define PA_READWRITE 3 + +#define HYPERSPACE (0xc0400000) +#define IS_HYPERSPACE(v) (((ULONG)(v) >= HYPERSPACE && (ULONG)(v) < HYPERSPACE + 0x400000)) + +#define PTE_TO_PFN(X) ((X) >> PAGE_SHIFT) +#define PFN_TO_PTE(X) ((X) << PAGE_SHIFT) + +#if defined(__GNUC__) +#define PTE_TO_PAGE(X) ((LARGE_INTEGER)(LONGLONG)(PAGE_MASK(X))) +#else +__inline LARGE_INTEGER PTE_TO_PAGE(ULONG npage) +{ + LARGE_INTEGER dummy; + dummy.QuadPart = (LONGLONG)(PAGE_MASK(npage)); + return dummy; +} +#endif + +/* FUNCTIONS ***************************************************************/ + +VOID +STDCALL +MiFlushTlbIpiRoutine(PVOID Address) +{ + if (Address == (PVOID)0xffffffff) + { + __asm__("tlbsync"); + } + else if (Address == (PVOID)0xfffffffe) + { + __asm__("tlbsync"); + } + else + { + __asm__("tlbi %0" : "=r" (Address)); + } +} + +VOID +MiFlushTlb(PULONG Pt, PVOID Address) +{ + __asm__("tlbi %0" : "=r" (Address)); +} + + + +PULONG +MmGetPageDirectory(VOID) +{ + unsigned int page_dir=0; + return((PULONG)page_dir); +} + +static ULONG +ProtectToFlags(ULONG flProtect) +{ + return MMU_ALL_RW; // XXX hack +} + +NTSTATUS +STDCALL +MmCopyMmInfo(PEPROCESS Src, + PEPROCESS Dest, + PPHYSICAL_ADDRESS DirectoryTableBase) +{ + DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", Src, Dest); + + KeBugCheck(0); + + return(STATUS_SUCCESS); +} + +NTSTATUS +NTAPI +MmInitializeHandBuiltProcess(IN PEPROCESS Process, + IN PLARGE_INTEGER DirectoryTableBase) +{ + /* Share the directory base with the idle process */ + *DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase; + + /* Initialize the Addresss Space */ + MmInitializeAddressSpace(Process, (PMADDRESS_SPACE)&Process->VadRoot); + + /* The process now has an address space */ + Process->HasAddressSpace = TRUE; + return STATUS_SUCCESS; +} + +BOOLEAN +STDCALL +MmCreateProcessAddressSpace(IN ULONG MinWs, + IN PEPROCESS Process, + IN PLARGE_INTEGER DirectoryTableBase) +{ + KeBugCheck(0); + return TRUE; +} + +VOID +NTAPI +MmDeletePageTable(PEPROCESS Process, PVOID Address) +{ + PEPROCESS CurrentProcess = PsGetCurrentProcess(); + + if(!CurrentProcess) return; + + MmuRevokeVsid((paddr_t)Process->UniqueProcessId, -1); +} + +VOID +NTAPI +MmFreePageTable(PEPROCESS Process, PVOID Address) +{ + MmDeletePageTable(Process, Address); +} + +PVOID +NTAPI +MmGetPhysicalAddressProcess(PEPROCESS Process, PVOID Addr) +{ + ppc_map_info_t info = { 0 }; + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Addr; + MmuInqPage(&info, 1); + return (PVOID)info.phys; +} + +/* + * @implemented + */ +PHYSICAL_ADDRESS STDCALL +MmGetPhysicalAddress(PVOID vaddr) +/* + * FUNCTION: Returns the physical address corresponding to a virtual address + */ +{ + PHYSICAL_ADDRESS Addr; + Addr.QuadPart = (ULONG)MmGetPhysicalAddressProcess(PsGetCurrentProcess()->UniqueProcessId, vaddr); + return Addr; +} + +PFN_TYPE +NTAPI +MmGetPfnForProcess(PEPROCESS Process, + PVOID Address) +{ + return((PFN_TYPE)MmGetPhysicalAddressProcess(Process, Address) >> PAGE_SHIFT); +} + +VOID +NTAPI +MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_TYPE Page) +/* + * FUNCTION: Delete a virtual mapping + */ +{ + ppc_map_info_t info = { 0 }; + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Address; + MmuUnmapPage(&info, 1); +} + +VOID +NTAPI +MmRawDeleteVirtualMapping(PVOID Address) +{ +} + +VOID +NTAPI +MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage, + BOOLEAN* WasDirty, PPFN_TYPE Page) +/* + * FUNCTION: Delete a virtual mapping + */ +{ + ppc_map_info_t info = { 0 }; + + DPRINT("MmDeleteVirtualMapping(%x, %x, %d, %x, %x)\n", + Process, Address, FreePage, WasDirty, Page); + + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Address; + MmuInqPage(&info, 1); + + if (FreePage && info.phys) + { + MmReleasePageMemoryConsumer(MC_NPPOOL, info.phys >> PAGE_SHIFT); + } + + /* + * Return some information to the caller + */ + if (WasDirty != NULL) + { + *WasDirty = !!(info.flags & MMU_PAGE_DIRTY); + } + if (Page != NULL) + { + *Page = info.phys >> PAGE_SHIFT; + } +} + +VOID +NTAPI +MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, + SWAPENTRY* SwapEntry) +/* + * FUNCTION: Delete a virtual mapping + */ +{ + ppc_map_info_t info = { 0 }; + /* + * Decrement the reference count for this page table. + */ + if (Process != NULL && + ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL && + Address < MmSystemRangeStart) + { + PUSHORT Ptrc; + + Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable; + MmFreePageTable(Process, Address); + } + + /* + * Return some information to the caller + */ + MmuInqPage(&info, 1); + *SwapEntry = info.phys; +} + +BOOLEAN +NTAPI +MmIsDirtyPage(PEPROCESS Process, PVOID Address) +{ + ppc_map_info_t info = { 0 }; + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Address; + MmuInqPage(&info, 1); + return !!(info.flags & MMU_PAGE_DIRTY); +} + +BOOLEAN +NTAPI +MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) +{ + ppc_map_info_t info = { 0 }; + + if (Address < MmSystemRangeStart && Process == NULL) + { + DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); + KEBUGCHECK(0); + } + + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Address; + MmuInqPage(&info, 1); + return !!(info.flags /*& MMU_PAGE_ACCESS*/); +} + +VOID +NTAPI +MmSetCleanPage(PEPROCESS Process, PVOID Address) +{ +} + +VOID +NTAPI +MmSetDirtyPage(PEPROCESS Process, PVOID Address) +{ +} + +VOID +NTAPI +MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) +{ +} + +BOOLEAN +NTAPI +MmIsPagePresent(PEPROCESS Process, PVOID Address) +{ + ppc_map_info_t info = { 0 }; + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Address; + MmuInqPage(&info, 1); + return !!info.phys; +} + +ULONGLONG MmGetPageEntryForProcess(PEPROCESS Process, PVOID Address) +{ + return 0; // XXX arty +} + +BOOLEAN +NTAPI +MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) +{ + ULONG Entry; + Entry = MmGetPageEntryForProcess(Process, Address); + return !(Entry & PA_PRESENT) && Entry != 0 ? TRUE : FALSE; +} + +NTSTATUS +NTAPI +MmCreateVirtualMappingForKernel(PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount) +{ + ULONG i; + PVOID Addr; + + DPRINT("MmCreateVirtualMappingForKernel(%x, %x, %x, %d)\n", + Address, flProtect, Pages, PageCount); + + if (Address < MmSystemRangeStart) + { + DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); + KEBUGCHECK(0); + } + + Addr = Address; + + for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) + { +#if 0 + if (!(Attributes & PA_PRESENT) && Pages[i] != 0) + { + DPRINT1("Setting physical address but not allowing access at address " + "0x%.8X with attributes %x/%x.\n", + Addr, Attributes, flProtect); + KEBUGCHECK(0); + } + (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); +#endif + } + + return(STATUS_SUCCESS); +} + +NTSTATUS +NTAPI +MmCreatePageFileMapping(PEPROCESS Process, + PVOID Address, + SWAPENTRY SwapEntry) +{ + if (Process == NULL && Address < MmSystemRangeStart) + { + DPRINT1("No process\n"); + KEBUGCHECK(0); + } + if (Process != NULL && Address >= MmSystemRangeStart) + { + DPRINT1("Setting kernel address with process context\n"); + KEBUGCHECK(0); + } + if (SwapEntry & (1 << 31)) + { + KEBUGCHECK(0); + } + + // XXX arty + + return(STATUS_SUCCESS); +} + + +NTSTATUS +NTAPI +MmCreateVirtualMappingUnsafe(PEPROCESS Process, + PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount) +{ + ULONG Attributes; + PVOID Addr; + ULONG i; + ppc_map_info_t info; + + DPRINT("MmCreateVirtualMappingUnsafe(%x, %x, %x, %x (%x), %d)\n", + Process, Address, flProtect, Pages, *Pages, PageCount); + + if (Process == NULL) + { + if (Address < MmSystemRangeStart) + { + DPRINT1("No process\n"); + KEBUGCHECK(0); + } + if (PageCount > 0x10000 || + (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) + { + DPRINT1("Page count to large\n"); + KEBUGCHECK(0); + } + } + else + { + if (Address >= MmSystemRangeStart) + { + DPRINT1("Setting kernel address with process context\n"); + KEBUGCHECK(0); + } + if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || + (ULONG_PTR) Address / PAGE_SIZE + PageCount > + (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) + { + DPRINT1("Page Count to large\n"); + KEBUGCHECK(0); + } + } + + Attributes = ProtectToFlags(flProtect); + Addr = Address; + + for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) + { + Process = PsGetCurrentProcess(); + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Addr; + info.flags = Attributes; + MmuMapPage(&info, 1); + //(void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); + if (Address < MmSystemRangeStart && + ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable != NULL && + Attributes & PA_PRESENT) + { +#if 0 + PUSHORT Ptrc; + + Ptrc = ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable; + + Ptrc[ADDR_TO_PAGE_TABLE(Addr)]++; +#endif + } + } + return(STATUS_SUCCESS); +} + +NTSTATUS +NTAPI +MmCreateVirtualMapping(PEPROCESS Process, + PVOID Address, + ULONG flProtect, + PPFN_TYPE Pages, + ULONG PageCount) +{ + ULONG i; + + for (i = 0; i < PageCount; i++) + { + if (!MmIsUsablePage(Pages[i])) + { + DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i])); + KEBUGCHECK(0); + } + } + + return(MmCreateVirtualMappingUnsafe(Process, + Address, + flProtect, + Pages, + PageCount)); +} + +ULONG +NTAPI +MmGetPageProtect(PEPROCESS Process, PVOID Address) +{ + ULONG Protect = 0; + ppc_map_info_t info = { 0 }; + + info.proc = Process ? (int)Process->UniqueProcessId : 0; + info.addr = (vaddr_t)Address; + MmuInqPage(&info, 1); + + if (!info.phys) { return PAGE_NOACCESS; } + if (!(info.flags & MMU_KMASK)) + { + Protect |= PAGE_SYSTEM; + if ((info.flags & MMU_KR) && (info.flags & MMU_KW)) + Protect = PAGE_READWRITE; + else if (info.flags & MMU_KR) + Protect = PAGE_EXECUTE_READ; + } + else + { + if ((info.flags & MMU_UR) && (info.flags & MMU_UW)) + Protect = PAGE_READWRITE; + else + Protect = PAGE_EXECUTE_READ; + } + return(Protect); +} + +VOID +NTAPI +MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) +{ + //ULONG Attributes = 0; + + DPRINT("MmSetPageProtect(Process %x Address %x flProtect %x)\n", + Process, Address, flProtect); + +#if 0 + Attributes = ProtectToPTE(flProtect); + + Pt = MmGetPageTableForProcess(Process, Address, FALSE); + if (Pt == NULL) + { + KEBUGCHECK(0); + } + InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); + MiFlushTlb(Pt, Address); +#endif +} + +PVOID +NTAPI +MmCreateHyperspaceMapping(PFN_TYPE Page) +{ + PVOID Address; + ppc_map_info_t info = { 0 }; + + Address = (PVOID)((ULONG_PTR)HYPERSPACE * PAGE_SIZE); + info.proc = 0; + info.addr = (vaddr_t)Address; + info.flags = MMU_KRW; + MmuMapPage(&info, 1); + + return Address; +} + +PFN_TYPE +NTAPI +MmChangeHyperspaceMapping(PVOID Address, PFN_TYPE NewPage) +{ + PFN_TYPE OldPage; + ppc_map_info_t info = { 0 }; + + info.proc = 0; + info.addr = (vaddr_t)Address; + MmuUnmapPage(&info, 1); + OldPage = info.phys; + info.phys = (paddr_t)NewPage; + MmuMapPage(&info, 1); + + return NewPage; +} + +PFN_TYPE +NTAPI +MmDeleteHyperspaceMapping(PVOID Address) +{ + ppc_map_info_t info = { 0 }; + ASSERT (IS_HYPERSPACE(Address)); + + info.proc = 0; + info.addr = (vaddr_t)Address; + + MmuUnmapPage(&info, 1); + + return (PFN_TYPE)info.phys; +} + +VOID +INIT_FUNCTION +NTAPI +MmInitGlobalKernelPageDirectory(VOID) +{ +} + +VOID +INIT_FUNCTION +NTAPI +MiInitPageDirectoryMap(VOID) +{ +} + +ULONG +NTAPI +MiGetUserPageDirectoryCount(VOID) +{ + return 0; +} + +VOID +NTAPI +MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) +{ +} + +/* EOF */ diff --git a/reactos/ntoskrnl/mm/powerpc/pfault.c b/reactos/ntoskrnl/mm/powerpc/pfault.c index c118edcfc91..c01d1dc988b 100644 --- a/reactos/ntoskrnl/mm/powerpc/pfault.c +++ b/reactos/ntoskrnl/mm/powerpc/pfault.c @@ -1,96 +1,96 @@ -/* $Id: pfault.c 24443 2006-10-08 10:01:27Z arty $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/powerpc/pfault.c - * PURPOSE: Paging file functions - * - * PROGRAMMERS: David Welch (welch@mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include -#define NDEBUG -#include -#include - -/* EXTERNS *******************************************************************/ - -extern ULONG KiKernelTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2); - -/* FUNCTIONS *****************************************************************/ - -VOID MmpPpcTrapFrameToTrapFrame(ppc_trap_frame_t *frame, PKTRAP_FRAME Tf) -{ - RtlCopyMemory(&Tf->Gpr0, frame->gpr, 12 * sizeof(ULONG)); - Tf->Lr = frame->lr; - Tf->Cr = frame->cr; - Tf->Ctr = frame->ctr; - Tf->Xer = frame->xer; - Tf->Msr = frame->srr1 & 0xffff; - Tf->Dr0 = frame->srr0; - Tf->Dr1 = frame->srr1; - Tf->Dr2 = frame->dar; - Tf->Dr3 = frame->dsisr; -} - -int KiPageFaultHandler(int trap, ppc_trap_frame_t *frame) -{ - NTSTATUS Status = STATUS_SUCCESS; - KPROCESSOR_MODE Mode; - EXCEPTION_RECORD Er; - KTRAP_FRAME Tf; - BOOLEAN AccessFault = !!(frame->dsisr & (1<<28)); - vaddr_t VirtualAddr; - PVOID TrapInfo = NULL; - - /* get the faulting address */ - if (trap == 4) /* Instruction miss */ - VirtualAddr = frame->srr0; - else /* Data miss */ - VirtualAddr = frame->dar; - - /* MSR_PR */ - Mode = frame->srr1 & 0x4000 ? KernelMode : UserMode; - - /* handle the fault */ - if (AccessFault) - { - Status = MmAccessFault(Mode, (PVOID)VirtualAddr, FALSE, TrapInfo); - } - else - { - KeBugCheck(0); - //Status = MmNotPresentFault(Mode, (PVOID)VirtualAddr, FALSE, TrapInfo); - } - - if (NT_SUCCESS(Status)) - return 1; - - if (KeGetCurrentThread()->ApcState.UserApcPending) - { - KIRQL oldIrql; - - KeRaiseIrql(APC_LEVEL, &oldIrql); - KiDeliverApc(UserMode, NULL, NULL); - KeLowerIrql(oldIrql); - } - - MmpPpcTrapFrameToTrapFrame(frame, &Tf); - - Er.ExceptionCode = STATUS_ACCESS_VIOLATION; - Er.ExceptionFlags = 0; - Er.ExceptionRecord = NULL; - Er.ExceptionAddress = (PVOID)frame->srr0; - Er.NumberParameters = 2; - Er.ExceptionInformation[0] = AccessFault; - Er.ExceptionInformation[1] = VirtualAddr; - - /* FIXME: Which exceptions are noncontinuable? */ - Er.ExceptionFlags = 0; - - KiDispatchException(&Er, 0, &Tf, Mode, TRUE); - return 1; -} - +/* $Id: pfault.c 24443 2006-10-08 10:01:27Z arty $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/mm/powerpc/pfault.c + * PURPOSE: Paging file functions + * + * PROGRAMMERS: David Welch (welch@mcmail.com) + */ + +/* INCLUDES *****************************************************************/ + +#include +#define NDEBUG +#include +#include + +/* EXTERNS *******************************************************************/ + +extern ULONG KiKernelTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2); + +/* FUNCTIONS *****************************************************************/ + +VOID MmpPpcTrapFrameToTrapFrame(ppc_trap_frame_t *frame, PKTRAP_FRAME Tf) +{ + RtlCopyMemory(&Tf->Gpr0, frame->gpr, 12 * sizeof(ULONG)); + Tf->Lr = frame->lr; + Tf->Cr = frame->cr; + Tf->Ctr = frame->ctr; + Tf->Xer = frame->xer; + Tf->Msr = frame->srr1 & 0xffff; + Tf->Dr0 = frame->srr0; + Tf->Dr1 = frame->srr1; + Tf->Dr2 = frame->dar; + Tf->Dr3 = frame->dsisr; +} + +int KiPageFaultHandler(int trap, ppc_trap_frame_t *frame) +{ + NTSTATUS Status = STATUS_SUCCESS; + KPROCESSOR_MODE Mode; + EXCEPTION_RECORD Er; + KTRAP_FRAME Tf; + BOOLEAN AccessFault = !!(frame->dsisr & (1<<28)); + vaddr_t VirtualAddr; + PVOID TrapInfo = NULL; + + /* get the faulting address */ + if (trap == 4) /* Instruction miss */ + VirtualAddr = frame->srr0; + else /* Data miss */ + VirtualAddr = frame->dar; + + /* MSR_PR */ + Mode = frame->srr1 & 0x4000 ? KernelMode : UserMode; + + /* handle the fault */ + if (AccessFault) + { + Status = MmAccessFault(Mode, (PVOID)VirtualAddr, FALSE, TrapInfo); + } + else + { + KeBugCheck(0); + //Status = MmNotPresentFault(Mode, (PVOID)VirtualAddr, FALSE, TrapInfo); + } + + if (NT_SUCCESS(Status)) + return 1; + + if (KeGetCurrentThread()->ApcState.UserApcPending) + { + KIRQL oldIrql; + + KeRaiseIrql(APC_LEVEL, &oldIrql); + KiDeliverApc(UserMode, NULL, NULL); + KeLowerIrql(oldIrql); + } + + MmpPpcTrapFrameToTrapFrame(frame, &Tf); + + Er.ExceptionCode = STATUS_ACCESS_VIOLATION; + Er.ExceptionFlags = 0; + Er.ExceptionRecord = NULL; + Er.ExceptionAddress = (PVOID)frame->srr0; + Er.NumberParameters = 2; + Er.ExceptionInformation[0] = AccessFault; + Er.ExceptionInformation[1] = VirtualAddr; + + /* FIXME: Which exceptions are noncontinuable? */ + Er.ExceptionFlags = 0; + + KiDispatchException(&Er, 0, &Tf, Mode, TRUE); + return 1; +} + diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index 00766789fa1..5b8fe20777a 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -166,7 +166,7 @@ MmDeleteTeb(PEPROCESS Process, /* Lock the Address Space */ MmLockAddressSpace(ProcessAddressSpace); - + MemoryArea = MmLocateMemoryAreaByAddress(ProcessAddressSpace, (PVOID)Teb); if (MemoryArea) { @@ -260,7 +260,7 @@ MmGrowKernelStack(PVOID StackPointer) ASSERT(((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit) <= (KERNEL_LARGE_STACK_SIZE + PAGE_SIZE)); - /* + /* * We'll give you three more pages. * NOTE: See note in MmCreateKernelStack. These pages are already being reserved. * It would be more efficient to only grow them (commit them) here. @@ -485,7 +485,7 @@ MmInitializeHandBuiltProcess2(IN PEPROCESS Process) PHYSICAL_ADDRESS BoundaryAddressMultiple; NTSTATUS Status; PMADDRESS_SPACE ProcessAddressSpace = (PMADDRESS_SPACE)&Process->VadRoot; - + /* Create the shared data page */ BaseAddress = (PVOID)USER_SHARED_DATA; Status = MmCreateMemoryArea(ProcessAddressSpace, @@ -666,7 +666,7 @@ MmCleanProcessAddressSpace(IN PEPROCESS Process) /* FIXME: Add part of MmDeleteProcessAddressSpace here */ } -NTSTATUS +NTSTATUS NTAPI MmDeleteProcessAddressSpace(PEPROCESS Process) { diff --git a/reactos/ntoskrnl/mm/rmap.c b/reactos/ntoskrnl/mm/rmap.c index 86bf0a35890..416e9117c2a 100644 --- a/reactos/ntoskrnl/mm/rmap.c +++ b/reactos/ntoskrnl/mm/rmap.c @@ -120,7 +120,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page) Type = MemoryArea->Type; if (Type == MEMORY_AREA_SECTION_VIEW) { - Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset; /* * Get or create a pageop @@ -245,7 +245,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) Type = MemoryArea->Type; if (Type == MEMORY_AREA_SECTION_VIEW) { - Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset;; /* @@ -411,7 +411,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, #else new_entry->Caller = _ReturnAddress(); #endif -#endif +#endif if (MmGetPfnForProcess(Process, Address) != Page) { @@ -430,7 +430,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, { if (current_entry->Address == new_entry->Address && current_entry->Process == new_entry->Process) { - DbgPrint("MmInsertRmap tries to add a second rmap entry for address %p\n current caller ", + DbgPrint("MmInsertRmap tries to add a second rmap entry for address %p\n current caller ", current_entry->Address); DbgPrint("%p", new_entry->Caller); DbgPrint("\n previous caller "); diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index a39b988f1ea..0e8419c65ed 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -32,7 +32,7 @@ * Ge van Geldorp * Royce Mitchell III * Filip Navara - * Aleksey Bragin + * Aleksey Bragin * Jason Filby * Thomas Weidenmueller * Gunnar Andre' Dalsnes @@ -154,7 +154,7 @@ MmGetFileNameForAddress(IN PVOID Address, /* * FIXME: TODO. * Filip says to get the MADDRESS_SPACE from EPROCESS, - * then use the MmMarea routines to locate the Marea that + * then use the MmMarea routines to locate the Marea that * corresponds to the address. Then make sure it's a section * view type (MEMORY_AREA_SECTION_VIEW) and use the marea's * per-type union to get the .u.SectionView.Section pointer to @@ -741,7 +741,7 @@ MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, } PAddress = MM_ROUND_DOWN(Address, PAGE_SIZE); - Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress + Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset; Segment = MemoryArea->Data.SectionData.Segment; @@ -1259,7 +1259,7 @@ MmAccessFaultSectionView(PMADDRESS_SPACE AddressSpace, * Find the offset of the page */ PAddress = MM_ROUND_DOWN(Address, PAGE_SIZE); - Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress + Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset; Segment = MemoryArea->Data.SectionData.Segment; @@ -1437,7 +1437,7 @@ MmPageOutDeleteMapping(PVOID Context, PEPROCESS Process, PVOID Address) { MmUnlockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot); } - + if (PageOutContext->Private) { MmReleasePageMemoryConsumer(MC_USER, Page); @@ -1472,7 +1472,7 @@ MmPageOutSectionView(PMADDRESS_SPACE AddressSpace, Context.Segment = MemoryArea->Data.SectionData.Segment; Context.Section = MemoryArea->Data.SectionData.Section; - Context.Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + Context.Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset; FileOffset = Context.Offset + Context.Segment->FileOffset; @@ -1821,7 +1821,7 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace, Address = (PVOID)PAGE_ROUND_DOWN(Address); - Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset; /* @@ -1986,7 +1986,7 @@ MmAlterViewAttributes(PMADDRESS_SPACE AddressSpace, ULONG Entry; PFN_TYPE Page; - Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + MemoryArea->Data.SectionData.ViewOffset; Entry = MmGetPageEntrySectionSegment(Segment, Offset); Page = MmGetPfnForProcess(AddressSpace->Process, Address); @@ -2266,7 +2266,7 @@ MmInitSectionImplementation(VOID) UNICODE_STRING Name; DPRINT("Creating Section Object Type\n"); - + /* Initialize the Section object type */ RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer)); RtlInitUnicodeString(&Name, L"Section"); @@ -3342,7 +3342,7 @@ MmCreateImageSection(PROS_SECTION_OBJECT *SectionObject, ObDereferenceObject(Section); return(STATUS_NO_MEMORY); } - + RtlZeroMemory(ImageSectionObject, sizeof(MM_IMAGE_SECTION_OBJECT)); StatusExeFmt = ExeFmtpCreateImageSection(FileHandle, ImageSectionObject); @@ -4001,7 +4001,7 @@ MmUnmapViewOfSection(PEPROCESS Process, ASSERT(Process); AddressSpace = (PMADDRESS_SPACE)&(Process)->VadRoot; - + MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress); diff --git a/reactos/ntoskrnl/mm/verifier.c b/reactos/ntoskrnl/mm/verifier.c index 6ad0456d73a..0b30939b49c 100644 --- a/reactos/ntoskrnl/mm/verifier.c +++ b/reactos/ntoskrnl/mm/verifier.c @@ -33,7 +33,7 @@ MiLookupDataTableEntry(IN PVOID Address) /* Loop entries */ NextEntry = PsLoadedModuleList.Flink; - do + do { /* Get the loader entry */ LdrEntry = CONTAINING_RECORD(NextEntry, diff --git a/reactos/ntoskrnl/mm/virtual.c b/reactos/ntoskrnl/mm/virtual.c index a83f5e678cc..dcb2c824078 100644 --- a/reactos/ntoskrnl/mm/virtual.c +++ b/reactos/ntoskrnl/mm/virtual.c @@ -299,7 +299,7 @@ NtQueryVirtualMemory (IN HANDLE ProcessHandle, Length,ResultLength); PreviousMode = ExGetPreviousMode(); - + if (PreviousMode != KernelMode && UnsafeResultLength != NULL) { _SEH_TRY @@ -311,7 +311,7 @@ NtQueryVirtualMemory (IN HANDLE ProcessHandle, Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { return Status; @@ -450,9 +450,9 @@ NtProtectVirtualMemory(IN HANDLE ProcessHandle, ULONG NumberOfBytesToProtect = 0; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; - + PreviousMode = ExGetPreviousMode(); - + if (PreviousMode != KernelMode) { _SEH_TRY @@ -469,7 +469,7 @@ NtProtectVirtualMemory(IN HANDLE ProcessHandle, Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { return Status; @@ -787,7 +787,7 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle, } PreviousMode = ExGetPreviousMode(); - + if (PreviousMode != KernelMode) { if ((ULONG_PTR)Buffer + NumberOfBytesToWrite - 1 < (ULONG_PTR)Buffer || @@ -807,7 +807,7 @@ NtWriteVirtualMemory(IN HANDLE ProcessHandle, Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { return Status; diff --git a/reactos/ntoskrnl/ob/obhandle.c b/reactos/ntoskrnl/ob/obhandle.c index 4cb5edafd5a..bdc2284da7f 100644 --- a/reactos/ntoskrnl/ob/obhandle.c +++ b/reactos/ntoskrnl/ob/obhandle.c @@ -73,7 +73,7 @@ ObpReferenceProcessObjectByHandle(IN HANDLE Handle, /* Assume failure */ *Object = NULL; - + /* Check if this is a special handle */ if (HandleToLong(Handle) < 0) { @@ -83,40 +83,40 @@ ObpReferenceProcessObjectByHandle(IN HANDLE Handle, /* Return handle info */ HandleInformation->HandleAttributes = 0; HandleInformation->GrantedAccess = Process->GrantedAccess; - + /* No audit mask */ *AuditMask = 0; - + /* Reference ourselves */ ObjectHeader = OBJECT_TO_OBJECT_HEADER(Process); InterlockedIncrement(&ObjectHeader->PointerCount); - + /* Return the pointer */ *Object = Process; ASSERT(*Object != NULL); return STATUS_SUCCESS; } - + /* Check if the caller wants the current thread */ if (Handle == NtCurrentThread()) { /* Return handle information */ HandleInformation->HandleAttributes = 0; HandleInformation->GrantedAccess = Thread->GrantedAccess; - + /* Reference ourselves */ ObjectHeader = OBJECT_TO_OBJECT_HEADER(Thread); InterlockedExchangeAdd(&ObjectHeader->PointerCount, 1); - + /* No audit mask */ *AuditMask = 0; - + /* Return the pointer */ *Object = Thread; ASSERT(*Object != NULL); return STATUS_SUCCESS; } - + /* This is a kernel handle... do we have access? */ if (AccessMode == KernelMode) { @@ -130,7 +130,7 @@ ObpReferenceProcessObjectByHandle(IN HANDLE Handle, return STATUS_INVALID_HANDLE; } } - + /* Enter a critical region while we touch the handle table */ ASSERT(HandleTable != NULL); KeEnterCriticalRegion(); @@ -1969,14 +1969,14 @@ ObInitProcess(IN PEPROCESS Parent OPTIONAL, IN PEPROCESS Process) { PHANDLE_TABLE ParentTable, ObjectTable; - + /* Check for a parent */ if (Parent) { /* Reference the parent's table */ ParentTable = ObReferenceProcessHandleTable(Parent); if (!ParentTable) return STATUS_PROCESS_IS_TERMINATING; - + /* Duplicate it */ ObjectTable = ExDupHandleTable(Process, ParentTable, @@ -1989,23 +1989,23 @@ ObInitProcess(IN PEPROCESS Parent OPTIONAL, ParentTable = NULL; ObjectTable = ExCreateHandleTable(Process); } - + /* Make sure we have a table */ if (ObjectTable) { - /* Associate it */ + /* Associate it */ Process->ObjectTable = ObjectTable; - + /* Check for auditing */ if (SeDetailedAuditingWithToken(NULL)) { /* FIXME: TODO */ DPRINT1("Need auditing!\n"); } - + /* Get rid of the old table now */ if (ParentTable) ObDereferenceProcessHandleTable(Parent); - + /* We are done */ return STATUS_SUCCESS; } diff --git a/reactos/ntoskrnl/ob/oblife.c b/reactos/ntoskrnl/ob/oblife.c index 1dd00b4314e..3a2caeb8614 100644 --- a/reactos/ntoskrnl/ob/oblife.c +++ b/reactos/ntoskrnl/ob/oblife.c @@ -1135,7 +1135,7 @@ ObCreateObjectType(IN PUNICODE_STRING TypeName, /* Calculate how much space our header'll take up */ HeaderSize = sizeof(OBJECT_HEADER) + sizeof(OBJECT_HEADER_NAME_INFO) + - (ObjectTypeInitializer->MaintainHandleCount ? + (ObjectTypeInitializer->MaintainHandleCount ? sizeof(OBJECT_HEADER_HANDLE_INFO) : 0); /* Check the pool type */ diff --git a/reactos/ntoskrnl/ob/oblink.c b/reactos/ntoskrnl/ob/oblink.c index 4107998a8f8..134906d799a 100644 --- a/reactos/ntoskrnl/ob/oblink.c +++ b/reactos/ntoskrnl/ob/oblink.c @@ -309,7 +309,7 @@ NtCreateSymbolicLinkObject(OUT PHANDLE LinkHandle, SymbolicLink->LinkTarget.Length = CapturedLinkTarget.Length; SymbolicLink->LinkTarget.MaximumLength = CapturedLinkTarget.Length + sizeof(WCHAR); - SymbolicLink->LinkTarget.Buffer = + SymbolicLink->LinkTarget.Buffer = ExAllocatePoolWithTag(PagedPool, CapturedLinkTarget.MaximumLength, TAG_SYMLINK_TARGET); diff --git a/reactos/ntoskrnl/ob/obref.c b/reactos/ntoskrnl/ob/obref.c index b4e354aa7d0..da20c254944 100644 --- a/reactos/ntoskrnl/ob/obref.c +++ b/reactos/ntoskrnl/ob/obref.c @@ -492,14 +492,14 @@ ObReferenceObjectByHandle(IN HANDLE Handle, /* Get the current process and granted access */ CurrentProcess = PsGetCurrentProcess(); GrantedAccess = CurrentProcess->GrantedAccess; - + /* Validate access */ /* ~GrantedAccess = RefusedAccess.*/ /* ~GrantedAccess & DesiredAccess = list of refused bits. */ /* !(~GrantedAccess & DesiredAccess) == TRUE means ALL requested rights are granted */ if ((AccessMode == KernelMode) || !(~GrantedAccess & DesiredAccess)) - { + { /* Check if the caller wanted handle information */ if (HandleInformation) { @@ -507,11 +507,11 @@ ObReferenceObjectByHandle(IN HANDLE Handle, HandleInformation->HandleAttributes = 0; HandleInformation->GrantedAccess = GrantedAccess; } - + /* Reference ourselves */ ObjectHeader = OBJECT_TO_OBJECT_HEADER(CurrentProcess); InterlockedExchangeAdd(&ObjectHeader->PointerCount, 1); - + /* Return the pointer */ *Object = CurrentProcess; ASSERT(*Object != NULL); @@ -528,7 +528,7 @@ ObReferenceObjectByHandle(IN HANDLE Handle, /* The caller used this special handle value with a non-process type */ Status = STATUS_OBJECT_TYPE_MISMATCH; } - + /* Return the status */ return Status; } @@ -540,14 +540,14 @@ ObReferenceObjectByHandle(IN HANDLE Handle, /* Get the current process and granted access */ CurrentThread = PsGetCurrentThread(); GrantedAccess = CurrentThread->GrantedAccess; - + /* Validate access */ /* ~GrantedAccess = RefusedAccess.*/ /* ~GrantedAccess & DesiredAccess = list of refused bits. */ /* !(~GrantedAccess & DesiredAccess) == TRUE means ALL requested rights are granted */ if ((AccessMode == KernelMode) || !(~GrantedAccess & DesiredAccess)) - { + { /* Check if the caller wanted handle information */ if (HandleInformation) { @@ -555,11 +555,11 @@ ObReferenceObjectByHandle(IN HANDLE Handle, HandleInformation->HandleAttributes = 0; HandleInformation->GrantedAccess = GrantedAccess; } - + /* Reference ourselves */ ObjectHeader = OBJECT_TO_OBJECT_HEADER(CurrentThread); InterlockedExchangeAdd(&ObjectHeader->PointerCount, 1); - + /* Return the pointer */ *Object = CurrentThread; ASSERT(*Object != NULL); @@ -576,7 +576,7 @@ ObReferenceObjectByHandle(IN HANDLE Handle, /* The caller used this special handle value with a non-process type */ Status = STATUS_OBJECT_TYPE_MISMATCH; } - + /* Return the status */ return Status; } @@ -612,7 +612,7 @@ ObReferenceObjectByHandle(IN HANDLE Handle, { /* Get the granted access and validate it */ GrantedAccess = HandleEntry->GrantedAccess; - + /* Validate access */ /* ~GrantedAccess = RefusedAccess.*/ /* ~GrantedAccess & DesiredAccess = list of refused bits. */ diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index c935ed08b21..ed964a4ab7a 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -602,12 +602,12 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, { /* Check our priority class */ if (Parent->PriorityClass == PROCESS_PRIORITY_CLASS_IDLE || - Parent->PriorityClass == PROCESS_PRIORITY_CLASS_BELOW_NORMAL) + Parent->PriorityClass == PROCESS_PRIORITY_CLASS_BELOW_NORMAL) { /* Normalize it */ Process->PriorityClass = Parent->PriorityClass; } - + /* Initialize object manager for the process */ Status = ObInitProcess(Flags & PS_INHERIT_HANDLES ? Parent : NULL, Process); @@ -619,7 +619,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, Status = MmInitializeHandBuiltProcess2(Process); if (!NT_SUCCESS(Status)) goto CleanupWithRef; } - + /* Set success for now */ Status = STATUS_SUCCESS; @@ -634,7 +634,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, &Process-> SeAuditProcessCreationInfo. ImageFileName); - if (!NT_SUCCESS(Status)) goto CleanupWithRef; + if (!NT_SUCCESS(Status)) goto CleanupWithRef; } else if (Parent) { @@ -654,7 +654,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, &Flags, NULL); if (!NT_SUCCESS(Status)) goto CleanupWithRef; - + /* Create a dummy image file name */ Process->SeAuditProcessCreationInfo.ImageFileName = ExAllocatePoolWithTag(PagedPool, @@ -666,7 +666,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, Status = STATUS_INSUFFICIENT_RESOURCES; goto CleanupWithRef; } - + /* Zero it out */ RtlZeroMemory(Process->SeAuditProcessCreationInfo.ImageFileName, sizeof(OBJECT_NAME_INFORMATION)); @@ -823,7 +823,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, _SEH_END; CleanupWithRef: - /* + /* * Dereference the process. For failures, kills the process and does * cleanup present in PspDeleteProcess. For success, kills the extra * reference added by ObInsertObject. diff --git a/reactos/ntoskrnl/ps/state.c b/reactos/ntoskrnl/ps/state.c index 964b9f62aed..562153b8520 100644 --- a/reactos/ntoskrnl/ps/state.c +++ b/reactos/ntoskrnl/ps/state.c @@ -477,7 +477,7 @@ NtTestAlert(VOID) * @param NormalContext * Pointer to the context to send to the Normal Routine. * - * @param SystemArgument[1-2] + * @param SystemArgument[1-2] * Pointer to a set of two parameters that contain untyped data. * * @return STATUS_SUCCESS or failure cute from associated calls. diff --git a/reactos/ntoskrnl/rtl/libsupp.c b/reactos/ntoskrnl/rtl/libsupp.c index 9247ed5838e..f35ad504264 100644 --- a/reactos/ntoskrnl/rtl/libsupp.c +++ b/reactos/ntoskrnl/rtl/libsupp.c @@ -220,11 +220,11 @@ RtlpCaptureStackLimits(IN ULONG_PTR Ebp, /* Don't even try at ISR level or later */ if (KeGetCurrentIrql() > DISPATCH_LEVEL) return FALSE; - + /* Start with defaults */ *StackBegin = Thread->StackLimit; *StackEnd = (ULONG_PTR)Thread->StackBase; - + /* Check if EBP is inside the stack */ if ((*StackBegin <= Ebp) && (Ebp <= *StackEnd)) { @@ -236,7 +236,7 @@ RtlpCaptureStackLimits(IN ULONG_PTR Ebp, /* Now we're going to assume we're on the DPC stack */ *StackEnd = (ULONG_PTR)(KeGetPcr()->Prcb->DpcStack); *StackBegin = *StackEnd - KERNEL_STACK_SIZE; - + /* Check if we seem to be on the DPC stack */ if ((*StackEnd) && (*StackBegin < Ebp) && (Ebp <= *StackEnd)) { @@ -271,7 +271,7 @@ RtlWalkFrameChain(OUT PVOID *Callers, PKTHREAD Thread = KeGetCurrentThread(); PTEB Teb; PKTRAP_FRAME TrapFrame; - + /* Get current EBP */ #if defined(_M_IX86) #if defined __GNUC__ @@ -286,10 +286,10 @@ RtlWalkFrameChain(OUT PVOID *Callers, #else #error Unknown architecture #endif - + /* Set it as the stack begin limit as well */ StackBegin = (ULONG_PTR)Stack; - + /* Check if we're called for non-logging mode */ if (!Flags) { @@ -299,23 +299,23 @@ RtlWalkFrameChain(OUT PVOID *Callers, &StackEnd); if (!Result) return 0; } - + /* Use a SEH block for maximum protection */ _SEH_TRY { /* Check if we want the user-mode stack frame */ if (Flags == 1) { - /* Get the trap frame and TEB */ + /* Get the trap frame and TEB */ TrapFrame = Thread->TrapFrame; Teb = Thread->Teb; - + /* Make sure we can trust the TEB and trap frame */ - if (!(Teb) || - !((PVOID)((ULONG_PTR)TrapFrame & 0x80000000)) || + if (!(Teb) || + !((PVOID)((ULONG_PTR)TrapFrame & 0x80000000)) || ((PVOID)TrapFrame <= (PVOID)Thread->StackLimit) || ((PVOID)TrapFrame >= (PVOID)Thread->StackBase) || - (KeIsAttachedProcess()) || + (KeIsAttachedProcess()) || (KeGetCurrentIrql() >= DISPATCH_LEVEL)) { /* Invalid or unsafe attempt to get the stack */ @@ -337,7 +337,7 @@ RtlWalkFrameChain(OUT PVOID *Callers, StackEnd - StackBegin, sizeof(CHAR)); } - + /* Loop the frames */ for (i = 0; i < Count; i++) { @@ -353,27 +353,27 @@ RtlWalkFrameChain(OUT PVOID *Callers, /* We're done or hit a bad address */ break; } - + /* Get new stack and EIP */ NewStack = *(PULONG_PTR)Stack; Eip = *(PULONG_PTR)(Stack + sizeof(ULONG_PTR)); - + /* Check if the new pointer is above the oldone and past the end */ if (!((Stack < NewStack) && (NewStack < StackEnd))) { /* Stop searching after this entry */ StopSearch = TRUE; } - + /* Also make sure that the EIP isn't a stack address */ if ((StackBegin < Eip) && (Eip < StackEnd)) break; - + /* Check if we reached a user-mode address */ if (!(Flags) && !(Eip & 0x80000000)) break; - + /* Save this frame */ Callers[i] = (PVOID)Eip; - + /* Check if we should continue */ if (StopSearch) { @@ -381,7 +381,7 @@ RtlWalkFrameChain(OUT PVOID *Callers, i++; break; } - + /* Move to the next stack */ Stack = NewStack; } @@ -392,9 +392,9 @@ RtlWalkFrameChain(OUT PVOID *Callers, i = 0; } _SEH_END; - + /* Return frames parsed */ - return i; + return i; } /* RTL Atom Tables ************************************************************/ @@ -457,7 +457,7 @@ RtlpAllocAtomTable(ULONG Size) RtlZeroMemory(Table, Size); } - + return Table; } @@ -501,10 +501,10 @@ RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) HANDLE_TABLE_ENTRY ExEntry; HANDLE Handle; USHORT HandleIndex; - + ExEntry.Object = Entry; ExEntry.GrantedAccess = 0x1; /* FIXME - valid handle */ - + Handle = ExCreateHandle(AtomTable->ExHandleTable, &ExEntry); if (Handle != NULL) @@ -515,7 +515,7 @@ RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) { Entry->HandleIndex = HandleIndex; Entry->Atom = 0xC000 + HandleIndex; - + return TRUE; } else @@ -523,7 +523,7 @@ RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) Handle, NULL); } - + return FALSE; } @@ -532,21 +532,21 @@ RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index) { PHANDLE_TABLE_ENTRY ExEntry; PRTL_ATOM_TABLE_ENTRY Entry = NULL; - + /* NOTE: There's no need to explicitly enter a critical region because it's guaranteed that we're in a critical region right now (as we hold the atom table lock) */ - + ExEntry = ExMapHandleToPointer(AtomTable->ExHandleTable, (HANDLE)((ULONG_PTR)Index << 2)); if (ExEntry != NULL) { Entry = ExEntry->Object; - + ExUnlockHandleTableEntry(AtomTable->ExHandleTable, ExEntry); } - + return Entry; } diff --git a/reactos/ntoskrnl/rtl/misc.c b/reactos/ntoskrnl/rtl/misc.c index 8075b48db66..dc6f3ea720b 100644 --- a/reactos/ntoskrnl/rtl/misc.c +++ b/reactos/ntoskrnl/rtl/misc.c @@ -5,7 +5,7 @@ * FILE: ntoskrnl/rtl/misc.c * PURPOSE: Various functions * - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/ntoskrnl/tests/TestTimer.c b/reactos/ntoskrnl/tests/TestTimer.c index a2a74e18fbf..4d2258c9937 100644 --- a/reactos/ntoskrnl/tests/TestTimer.c +++ b/reactos/ntoskrnl/tests/TestTimer.c @@ -12,7 +12,7 @@ void main ( int argc, char** argv, char** environ ) printf ( "HIGH RESOLUTION PERFOMANCE COUNTER Frequency = %I64d CLOCKS IN SECOND\n", liFrequency.QuadPart ); - + if (liFrequency.QuadPart == 0) { printf("Your computer does not support High Resolution Performance counter\n"); diff --git a/reactos/ntoskrnl/tests/fsrtl.c b/reactos/ntoskrnl/tests/fsrtl.c index fa39d71b01a..aaf73d6a379 100644 --- a/reactos/ntoskrnl/tests/fsrtl.c +++ b/reactos/ntoskrnl/tests/fsrtl.c @@ -5,14 +5,14 @@ #include "fastio.h" #include "fsrtl.h" -/* +/* This is the main test function. It is called from DriverEntry. There is a DbgBreakPoint() call at the beginning of DriverEntry. In order to run the test again, simply type net stop fsrtl net start fsrtl - + Author: Dom Cote */ @@ -22,8 +22,8 @@ BOOLEAN FsRtlTest_StartTest() { HANDLE DirFh = NULL; PFILE_OBJECT DirPfo = NULL; - - + + IO_STATUS_BLOCK IoStatus; BOOLEAN Return; NTSTATUS Status = STATUS_SUCCESS; @@ -43,10 +43,10 @@ BOOLEAN FsRtlTest_StartTest() { PLARGE_INTEGER FileSize; PDEVICE_OBJECT pRelatedDo = NULL; - + /* Allocate a 100KB buffer to do IOs */ Buffer = ExAllocatePool(PagedPool,100*_1KB); - + /* ------------------------------------------------------------------------ TESTING: BOOLEAN @@ -65,13 +65,13 @@ BOOLEAN FsRtlTest_StartTest() { ------------------------------------------------------------------------ */ FsRtlTest_OpenTestFile(&Fh, &Pfo); FSRTL_TEST("Opening Test File.",((Pfo != NULL) && (Fh != NULL))); - + /* Extract the test variable from the FCB struct */ FcbHeader = (PFSRTL_COMMON_FCB_HEADER)Pfo->FsContext; AllocationSize = &FcbHeader->AllocationSize; ValidDataLength = &FcbHeader->ValidDataLength; FileSize = &FcbHeader->FileSize; - + /* Try to cache without caching having been initialized. This should fail.*/ Length = 10*_1KB; FSRTL_TEST("FsRtlCopyWrite() - No cache map test.",!FsRtlCopyWrite(Pfo,AllocationSize,Length,TRUE,0,Buffer,&IoStatus,NULL)); @@ -90,7 +90,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRltTest_WritefileZw(Fh,NULL,Length, Buffer, &IoStatus); FSRTL_TEST("FsRtlCopyWrite() - Extending by 1/2 sector.",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); Return = TRUE; - + /* Append to the file past the allocation size*/ Offset.LowPart = 0xFFFFFFFF; Offset.HighPart = 0xFFFFFFFF; @@ -99,7 +99,7 @@ BOOLEAN FsRtlTest_StartTest() { FSRTL_TEST("FsRtlCopyWrite() - Testing extending past allocation size",!FsRtlCopyWrite(Pfo,&Offset,Length+1,TRUE,0,Buffer,&IoStatus,NULL)); FSRTL_TEST("FsRtlCopyWrite() - Testing extending not past allocation size",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL)); FSRTL_TEST("FsRtlCopyWrite() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length))); - + /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */ Offset.QuadPart = 0; Length = 65*_1KB; @@ -115,7 +115,7 @@ BOOLEAN FsRtlTest_StartTest() { FcbHeader->IsFastIoPossible = FastIoIsQuestionable; FSRTL_TEST("FastIo is questionable flag",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL)) */ - + /* Test the fast Io not possible flag */ FcbHeader->IsFastIoPossible = FastIoIsNotPossible; FSRTL_TEST("FsRtlCopyWrite() - FastIo is not possible flag",!FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL)) @@ -123,7 +123,7 @@ BOOLEAN FsRtlTest_StartTest() { FcbHeader->IsFastIoPossible = FastIoIsPossible; FSRTL_TEST("FsRtlCopyWrite() - FastIo is possbile flag",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL)) - if (Pfo) + if (Pfo) { ObDereferenceObject(Pfo); Pfo = NULL; @@ -134,7 +134,7 @@ BOOLEAN FsRtlTest_StartTest() { ZwClose(Fh); Fh = NULL; } - + /* ------------------------------------------------------------------------ TESTING: BOOLEAN @@ -160,7 +160,7 @@ BOOLEAN FsRtlTest_StartTest() { AllocationSize = &FcbHeader->AllocationSize; ValidDataLength = &FcbHeader->ValidDataLength; FileSize = &FcbHeader->FileSize; - + /* Try to cache without caching having been initialized. This should fail.*/ Length = 10*_1KB; FSRTL_TEST("FsRtlCopyWrite() - No cache map test. Wait = FALSE",!FsRtlCopyWrite(Pfo,AllocationSize,Length,FALSE,0,Buffer,&IoStatus,NULL)); @@ -179,7 +179,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRltTest_WritefileZw(Fh,NULL,Length, Buffer, &IoStatus); FSRTL_TEST("FsRtlCopyWrite() - Extending by 1/2 sector. Wait = FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); Return = TRUE; - + /* Append to the file past the allocation size*/ Offset.LowPart = 0xFFFFFFFF; Offset.HighPart = 0xFFFFFFFF; @@ -188,7 +188,7 @@ BOOLEAN FsRtlTest_StartTest() { FSRTL_TEST("FsRtlCopyWrite() - Testing extending past allocation size Wait = FALSE",!FsRtlCopyWrite(Pfo,&Offset,Length+1,FALSE,0,Buffer,&IoStatus,NULL)); FSRTL_TEST("FsRtlCopyWrite() - Testing extending not past allocation size. Wait = FALSE",FsRtlCopyWrite(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL)); FSRTL_TEST("FsRtlCopyWrite() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length))); - + /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */ Offset.QuadPart = 0; Length = 65*_1KB; @@ -204,7 +204,7 @@ BOOLEAN FsRtlTest_StartTest() { FcbHeader->IsFastIoPossible = FastIoIsQuestionable; FSRTL_TEST("FastIo is questionable flag",FsRtlCopyWrite(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL)) */ - + /* Test the fast Io not possible flag */ FcbHeader->IsFastIoPossible = FastIoIsNotPossible; FSRTL_TEST("FsRtlCopyWrite() - FastIo is not possible flag. Wait = FALSE",!FsRtlCopyWrite(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL)) @@ -215,7 +215,7 @@ BOOLEAN FsRtlTest_StartTest() { /* ------------------------------------------------------------------------------------------ TESTING: - + BOOLEAN NTAPI FsRtlCopyRead(IN PFILE_OBJECT FileObject, @@ -237,7 +237,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRtlCopyRead(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL); FSRTL_TEST("FsRtlCopyRead() - Testing 64k IO Wait=TRUE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); Return = TRUE; - + /* Testing a 64KB read with Wait = FALSE */ Return = FsRtlCopyRead(Pfo,&Offset,Length,FALSE,0,Buffer,&IoStatus,NULL); FSRTL_TEST("FsRtlCopyRead() - Testing 64k IO Wait=FALSE",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); @@ -248,12 +248,12 @@ BOOLEAN FsRtlTest_StartTest() { Length = 10 * _1KB; Return = FsRtlCopyRead(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL); FSRTL_TEST("FsRtlCopyRead() - Testing reading past end of file but starting before EOF",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status) && IoStatus.Information == (FileSize->QuadPart-Offset.QuadPart))); - + Offset.QuadPart = FileSize->QuadPart + 1; Length = 10 * _1KB; Return = FsRtlCopyRead(Pfo,&Offset,Length,TRUE,0,Buffer,&IoStatus,NULL); FSRTL_TEST("FsRtlCopyRead() - Testing reading past end of file but starting after EOF",(NT_SUCCESS(Return) && (IoStatus.Status == STATUS_END_OF_FILE) && IoStatus.Information == 0)); - + /* Testing a 64KB read with Wait = TRUE */ Offset.LowPart = 0x0; @@ -265,7 +265,7 @@ BOOLEAN FsRtlTest_StartTest() { FcbHeader->IsFastIoPossible = FastIoIsPossible; Return = TRUE; - if (Pfo) + if (Pfo) { ObDereferenceObject(Pfo); Pfo = NULL; @@ -299,12 +299,12 @@ BOOLEAN FsRtlTest_StartTest() { AllocationSize = &FcbHeader->AllocationSize; ValidDataLength = &FcbHeader->ValidDataLength; FileSize = &FcbHeader->FileSize; - + /* Try to cache without caching having been initialized. This should fail.*/ Length = 10*_1KB; FSRTL_TEST("FsRtlPrepareMdlWriteDev() - No cache map test. Wait = FALSE", !FsRtlPrepareMdlWriteDev(Pfo,AllocationSize,Length,0,MdlChain,&IoStatus,NULL)); - + /* We are going to build a 100k file */ /* This will inititate caching and build some size */ Offset.QuadPart = 0; @@ -323,21 +323,21 @@ BOOLEAN FsRtlTest_StartTest() { pRelatedDo = IoGetRelatedDeviceObject(Pfo); FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Did we get related DO ?",pRelatedDo); - - + + /* Append to the file past the allocation size*/ Offset.QuadPart = FileSize->QuadPart; OldSize.QuadPart = FileSize->QuadPart; Length = (ULONG) (AllocationSize->QuadPart -ValidDataLength->QuadPart); FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Testing extending past allocation size.", !FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length+1,0,&MdlChain,&IoStatus,pRelatedDo)); - + FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Testing extending not past allocation size.", FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,pRelatedDo)); FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length))); FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Release the MDL.",FsRtlMdlWriteCompleteDev(Pfo,&Offset,MdlChain,pRelatedDo)); - - + + /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */ Offset.QuadPart = 0; MdlChain = NULL; @@ -345,20 +345,20 @@ BOOLEAN FsRtlTest_StartTest() { FSRTL_TEST("FsRtlPrepareMdlWriteDev() - 65KB IO Test.", FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,pRelatedDo)); FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Release the MDL.",FsRtlMdlWriteCompleteDev(Pfo,&Offset,MdlChain,pRelatedDo)); - + /* Try do write a 64kb IO. Maximum IO size for thus function is 64KB */ Length = 64*_1KB; MdlChain = NULL; FSRTL_TEST("FsRtlPrepareMdlWriteDev() - 64KB IO Test.", FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL)) FSRTL_TEST("FsRtlPrepareMdlWriteDev() - Release the MDL.",FsRtlMdlWriteCompleteDev(Pfo,&Offset,MdlChain,NULL)); - + /* Test the fast Io not possible flag */ FcbHeader->IsFastIoPossible = FastIoIsNotPossible; FSRTL_TEST("FsRtlPrepareMdlWriteDev() - FastIo is not possible flag.", !FsRtlPrepareMdlWriteDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL)) - - if (Pfo) + + if (Pfo) { ObDereferenceObject(Pfo); Pfo = NULL; @@ -392,12 +392,12 @@ BOOLEAN FsRtlTest_StartTest() { AllocationSize = &FcbHeader->AllocationSize; ValidDataLength = &FcbHeader->ValidDataLength; FileSize = &FcbHeader->FileSize; - + /* Try to cache without caching having been initialized. This should fail.*/ Length = 10*_1KB; FSRTL_TEST("FsRtlPrepareMdlWrite() - No cache map test. Wait = FALSE", !FsRtlPrepareMdlWrite(Pfo,AllocationSize,Length,0,MdlChain,&IoStatus)); - + /* We are going to build a 100k file */ /* This will inititate caching and build some size */ Offset.QuadPart = 0; @@ -421,13 +421,13 @@ BOOLEAN FsRtlTest_StartTest() { Length = (ULONG) (AllocationSize->QuadPart -ValidDataLength->QuadPart); FSRTL_TEST("FsRtlPrepareMdlWrite() - Testing extending past allocation size.", !FsRtlPrepareMdlWrite(Pfo,&Offset,Length+1,0,&MdlChain,&IoStatus)); - + FSRTL_TEST("FsRtlPrepareMdlWrite() - Testing extending not past allocation size.", FsRtlPrepareMdlWrite(Pfo,&Offset,Length,0,&MdlChain,&IoStatus)); FSRTL_TEST("FsRtlPrepareMdlWrite() - Check filesize",(FileSize->QuadPart = (OldSize.QuadPart+Length))); FSRTL_TEST("FsRtlPrepareMdlWrite() - Release the MDL.",FsRtlMdlWriteComplete(Pfo,&Offset,MdlChain)); - - + + /* Try do write a 65kb IO and check that if fails. Maximum IO size for thus function is 64KB */ Offset.QuadPart = 0; MdlChain = NULL; @@ -435,20 +435,20 @@ BOOLEAN FsRtlTest_StartTest() { FSRTL_TEST("FsRtlPrepareMdlWrite() - 65KB IO Test.", !FsRtlPrepareMdlWrite(Pfo,&Offset,Length,0,&MdlChain,&IoStatus)); //FSRTL_TEST("FsRtlPrepareMdlWrite() - Release the MDL.",FsRtlMdlWriteComplete(Pfo,&Offset,MdlChain)); - + /* Try do write a 64kb IO. Maximum IO size for thus function is 64KB */ Length = 64*_1KB; MdlChain = NULL; FSRTL_TEST("FsRtlPrepareMdlWrite() - 64KB IO Test.", FsRtlPrepareMdlWrite(Pfo,&Offset,Length,0,&MdlChain,&IoStatus)) FSRTL_TEST("FsRtlPrepareMdlWrite() - Release the MDL.",FsRtlMdlWriteComplete(Pfo,&Offset,MdlChain)); - + /* Test the fast Io not possible flag */ FcbHeader->IsFastIoPossible = FastIoIsNotPossible; FSRTL_TEST("FsRtlPrepareMdlWrite() - FastIo is not possible flag.", !FsRtlPrepareMdlWrite(Pfo,&Offset,Length,0,&MdlChain,&IoStatus)) - - if (Pfo) + + if (Pfo) { ObDereferenceObject(Pfo); Pfo = NULL; @@ -459,10 +459,10 @@ BOOLEAN FsRtlTest_StartTest() { ZwClose(Fh); Fh = NULL; } - + /* ------------------------------------------------------------------------------------------ TESTING: - + FsRtlMdlReadDev(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -474,7 +474,7 @@ BOOLEAN FsRtlTest_StartTest() { FsRtlMdlReadCompleteDev(IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList, IN PDEVICE_OBJECT DeviceObject) - + ------------------------------------------------------------------------------------------ */ @@ -485,7 +485,7 @@ BOOLEAN FsRtlTest_StartTest() { AllocationSize = &FcbHeader->AllocationSize; ValidDataLength = &FcbHeader->ValidDataLength; FileSize = &FcbHeader->FileSize; - + /* We are going to build a 100k file */ /* This will inititate caching and build some size */ @@ -494,7 +494,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRltTest_WritefileZw(Fh,&Offset,Length, Buffer, &IoStatus); FSRTL_TEST("FsRtlMdlReadDev() - Building 100k filesize.",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); Return = TRUE; - + Offset.LowPart = 0x0; Offset.HighPart = 0x0; @@ -505,7 +505,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRtlMdlReadDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL); FSRTL_TEST("FsRtlMdlReadDev() - Testing 64k IO",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); FSRTL_TEST("FsRtlMdlReadDev() - Releasing the MDL",FsRtlMdlReadCompleteDev(Pfo,MdlChain,NULL)); - + /* Testing read past the end of the file */ Offset.QuadPart = FileSize->QuadPart - (5 * _1KB); @@ -514,13 +514,13 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRtlMdlReadDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL); FSRTL_TEST("FsRtlMdlReadDev() - Testing reading past end of file but starting before EOF",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status) && IoStatus.Information == (FileSize->QuadPart-Offset.QuadPart))); FSRTL_TEST("FsRtlMdlReadDev() - Releasing the MDL",FsRtlMdlReadCompleteDev(Pfo,MdlChain,NULL)); - + Offset.QuadPart = FileSize->QuadPart + 1; Length = 10 * _1KB; MdlChain = NULL; Return = FsRtlMdlReadDev(Pfo,&Offset,Length,0,&MdlChain,&IoStatus,NULL); FSRTL_TEST("FsRtlMdlReadDev() - Testing reading past end of file but starting after EOF",(NT_SUCCESS(Return) && (IoStatus.Status == STATUS_END_OF_FILE) && IoStatus.Information == 0)); - + /* Testing FastIoIsNotPossible */ Offset.LowPart = 0x0; Offset.HighPart = 0x0; @@ -531,7 +531,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = TRUE; - if (Pfo) + if (Pfo) { ObDereferenceObject(Pfo); Pfo = NULL; @@ -545,7 +545,7 @@ BOOLEAN FsRtlTest_StartTest() { /* ------------------------------------------------------------------------------------------ TESTING: - + FsRtlMdlRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -555,7 +555,7 @@ BOOLEAN FsRtlTest_StartTest() { FsRtlMdlReadComplete(IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList) - + ------------------------------------------------------------------------------------------ */ @@ -566,7 +566,7 @@ BOOLEAN FsRtlTest_StartTest() { AllocationSize = &FcbHeader->AllocationSize; ValidDataLength = &FcbHeader->ValidDataLength; FileSize = &FcbHeader->FileSize; - + /* We are going to build a 100k file */ /* This will inititate caching and build some size */ @@ -575,7 +575,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRltTest_WritefileZw(Fh,&Offset,Length, Buffer, &IoStatus); FSRTL_TEST("FsRtlMdlRead() - Building 100k filesize.",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); Return = TRUE; - + Offset.LowPart = 0x0; Offset.HighPart = 0x0; @@ -586,7 +586,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRtlMdlRead(Pfo,&Offset,Length,0,&MdlChain,&IoStatus); FSRTL_TEST("FsRtlMdlRead() - Testing 64k IO",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status ) && IoStatus.Information == Length)); FSRTL_TEST("FsRtlMdlRead() - Releasing the MDL",FsRtlMdlReadComplete(Pfo,MdlChain)); - + /* Testing read past the end of the file */ Offset.QuadPart = FileSize->QuadPart - (5 * _1KB); @@ -595,13 +595,13 @@ BOOLEAN FsRtlTest_StartTest() { Return = FsRtlMdlRead(Pfo,&Offset,Length,0,&MdlChain,&IoStatus); FSRTL_TEST("FsRtlMdlRead() - Testing reading past end of file but starting before EOF",(NT_SUCCESS(Return) && NT_SUCCESS(IoStatus.Status) && IoStatus.Information == (FileSize->QuadPart-Offset.QuadPart))); FSRTL_TEST("FsRtlMdlRead() - Releasing the MDL",FsRtlMdlReadComplete(Pfo,MdlChain)); - + Offset.QuadPart = FileSize->QuadPart + 1; Length = 10 * _1KB; MdlChain = NULL; Return = FsRtlMdlRead(Pfo,&Offset,Length,0,&MdlChain,&IoStatus); FSRTL_TEST("FsRtlMdlRead() - Testing reading past end of file but starting after EOF",(NT_SUCCESS(Return) && (IoStatus.Status == STATUS_END_OF_FILE) && IoStatus.Information == 0)); - + /* Testing FastIoIsNotPossible */ Offset.LowPart = 0x0; Offset.HighPart = 0x0; @@ -612,7 +612,7 @@ BOOLEAN FsRtlTest_StartTest() { Return = TRUE; - if (Pfo) + if (Pfo) { ObDereferenceObject(Pfo); Pfo = NULL; @@ -623,35 +623,35 @@ BOOLEAN FsRtlTest_StartTest() { ZwClose(Fh); Fh = NULL; } - + /* ------------------------------------------------------------------------------------------ TESTING: - + FsRtlGetFileSize(IN PFILE_OBJECT FileObject, IN OUT PLARGE_INTEGER FileSize) - + ------------------------------------------------------------------------------------------ */ FsRtlTest_OpenTestFile(&Fh, &Pfo); FSRTL_TEST("FsRtlGetFileSize() - Opening Test File.",((Pfo != NULL) && (Fh != NULL))); - + FsRtlTest_OpenTestDirectory(&DirFh, &DirPfo); FSRTL_TEST("FsRtlGetFileSize() - Opening Test Directory.",((DirPfo != NULL) && (DirFh != NULL))); Status = FsRtlGetFileSize(Pfo,&OldSize); FSRTL_TEST("FsRtlGetFileSize() - Get the size of a real file",NT_SUCCESS(Status)); - + Status = FsRtlGetFileSize(DirPfo,&OldSize); FSRTL_TEST("FsRtlGetFileSize() - Get the size of a directory file",(Status == STATUS_FILE_IS_A_DIRECTORY)); - - - /* The test if over. Do clean up */ + + + /* The test if over. Do clean up */ Cleanup: - if (DirPfo) + if (DirPfo) { ObDereferenceObject(DirPfo); DirPfo = NULL; @@ -662,7 +662,7 @@ Cleanup: ZwClose(DirFh); DirFh = NULL; } - if (Pfo) + if (Pfo) { ObDereferenceObject(Pfo); Pfo = NULL; @@ -673,7 +673,7 @@ Cleanup: ZwClose(Fh); Fh = NULL; } - + if (Buffer != NULL) { ExFreePool(Buffer); Buffer = NULL; @@ -706,11 +706,11 @@ NTSTATUS FsRltTest_WritefileZw(HANDLE fh, PLARGE_INTEGER Offset, ULONG Length, P void FsRtlTest_FillBuffer(LARGE_INTEGER Start, ULONG Length, PVOID Buffer) { ULONG i = 0; PULONGLONG Index = (PULONGLONG) Buffer; - + for (i=0; iHandleTableSize) { diff --git a/reactos/subsystems/win32/csrss/api/wapi.c b/reactos/subsystems/win32/csrss/api/wapi.c index 13b7a2ac572..69dd48c556e 100644 --- a/reactos/subsystems/win32/csrss/api/wapi.c +++ b/reactos/subsystems/win32/csrss/api/wapi.c @@ -65,7 +65,7 @@ CsrApiRegisterDefinitions(PCSRSS_API_DEFINITION NewDefinitions) return STATUS_SUCCESS; } -VOID +VOID FASTCALL CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData, PCSR_API_MESSAGE Request) @@ -73,7 +73,7 @@ CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData, BOOL Found = FALSE; unsigned DefIndex; ULONG Type; - + DPRINT("CSR: Calling handler for type: %x.\n", Request->Type); Type = Request->Type & 0xFFFF; /* FIXME: USE MACRO */ DPRINT("CSR: API Number: %x ServerID: %x\n",Type, Request->Type >> 16); @@ -202,11 +202,11 @@ ClientConnectionThread(HANDLE ServerPort) PCSR_API_MESSAGE Request = (PCSR_API_MESSAGE)RawRequest; PCSR_API_MESSAGE Reply; PCSRSS_PROCESS_DATA ProcessData; - + DPRINT("CSR: %s called\n", __FUNCTION__); /* Reply must be NULL at the first call to NtReplyWaitReceivePort */ - Reply = NULL; + Reply = NULL; /* Loop and reply/wait for a new message */ for (;;) @@ -259,7 +259,7 @@ ClientConnectionThread(HANDLE ServerPort) continue; } - DPRINT("CSR: Got CSR API: %x [Message Origin: %x]\n", + DPRINT("CSR: Got CSR API: %x [Message Origin: %x]\n", Request->Type, Request->Header.ClientId.UniqueThread); diff --git a/reactos/subsystems/win32/csrss/csrss.c b/reactos/subsystems/win32/csrss/csrss.c index 82d84804f14..7ca52fcaf0d 100644 --- a/reactos/subsystems/win32/csrss/csrss.c +++ b/reactos/subsystems/win32/csrss/csrss.c @@ -35,7 +35,7 @@ int _cdecl _main(int argc, int DebugFlag) { NTSTATUS Status = STATUS_SUCCESS; - + //PrintString("ReactOS Client/Server Run-Time (Build %s)\n", //KERNEL_VERSION_BUILD_STR); diff --git a/reactos/subsystems/win32/csrss/init.c b/reactos/subsystems/win32/csrss/init.c index 010574536a9..97731755273 100644 --- a/reactos/subsystems/win32/csrss/init.c +++ b/reactos/subsystems/win32/csrss/init.c @@ -343,7 +343,7 @@ CsrpCreateListenPort (IN LPWSTR Name, * CsrpCreateBNODirectory/3 * * These used to be part of kernel32 startup, but that clearly wasn't a good - * idea, as races were definately possible. These are moved (as in the + * idea, as races were definately possible. These are moved (as in the * previous fixmes). */ static NTSTATUS @@ -372,7 +372,7 @@ CsrpCreateBNODirectory (int argc, char ** argv, char ** envp) DPRINT1("NtCreateDirectoryObject() failed %08x\n", Status); } - /* Create the "local" Symbolic Link. + /* Create the "local" Symbolic Link. * FIXME: CSR should do this -- Fixed */ InitializeObjectAttributes(&ObjectAttributes, &SymName, @@ -387,7 +387,7 @@ CsrpCreateBNODirectory (int argc, char ** argv, char ** envp) { DPRINT1("NtCreateDirectoryObject() failed %08x\n", Status); } - + /* Create the "global" Symbolic Link. */ InitializeObjectAttributes(&ObjectAttributes, &SymName2, @@ -512,20 +512,20 @@ EnvpToUnicodeString (char ** envp, PUNICODE_STRING UnicodeEnv) ANSI_STRING AnsiEnv; UnicodeEnv->Buffer = NULL; - + for (Index=0; NULL != envp[Index]; Index++) { CharCount += strlen (envp[Index]); ++ CharCount; } ++ CharCount; - + AnsiEnv.Buffer = RtlAllocateHeap (RtlGetProcessHeap(), 0, CharCount); if (NULL != AnsiEnv.Buffer) { PCHAR WritePos = AnsiEnv.Buffer; - + for (Index=0; NULL != envp[Index]; Index++) { strcpy (WritePos, envp[Index]); @@ -537,7 +537,7 @@ EnvpToUnicodeString (char ** envp, PUNICODE_STRING UnicodeEnv) AnsiEnv.Buffer [CharCount-1] = '\0'; AnsiEnv.Length = CharCount; AnsiEnv.MaximumLength = CharCount; - + RtlAnsiStringToUnicodeString (UnicodeEnv, & AnsiEnv, TRUE); RtlFreeHeap (RtlGetProcessHeap(), 0, AnsiEnv.Buffer); } @@ -559,7 +559,7 @@ CsrpLoadKernelModeDriver (int argc, char ** argv, char ** envp) DPRINT("SM: %s called\n", __FUNCTION__); - EnvpToUnicodeString (envp, & Environment); + EnvpToUnicodeString (envp, & Environment); Status = SmLookupSubsystem (L"Kmode", Data, & DataLength, diff --git a/reactos/subsystems/win32/csrss/win32csr/conio.c b/reactos/subsystems/win32/csrss/win32csr/conio.c index 7650fd1b6cf..bf2c741a2af 100644 --- a/reactos/subsystems/win32/csrss/win32csr/conio.c +++ b/reactos/subsystems/win32/csrss/win32csr/conio.c @@ -612,9 +612,9 @@ CSR_API(CsrReadConsole) { /* * backspace handling - if we are in charge of echoing it then we handle it here - * otherwise we treat it like a normal char. + * otherwise we treat it like a normal char. */ - if ('\b' == Input->InputEvent.Event.KeyEvent.uChar.AsciiChar && 0 + if ('\b' == Input->InputEvent.Event.KeyEvent.uChar.AsciiChar && 0 != (Console->Mode & ENABLE_ECHO_INPUT)) { /* echo if it has not already been done, and either we or the client has chars to be deleted */ @@ -636,7 +636,7 @@ CSR_API(CsrReadConsole) Request->Data.ReadConsoleRequest.NrCharactersRead = 0; Request->Status = STATUS_NOTIFY_CLEANUP; return STATUS_NOTIFY_CLEANUP; - + } Request->Data.ReadConsoleRequest.nCharsCanBeDeleted--; Input->Echoed = TRUE; /* mark as echoed so we don't echo it below */ diff --git a/reactos/subsystems/win32/csrss/win32csr/guiconsole.c b/reactos/subsystems/win32/csrss/win32csr/guiconsole.c index 3b8486fb626..d576aa22524 100644 --- a/reactos/subsystems/win32/csrss/win32csr/guiconsole.c +++ b/reactos/subsystems/win32/csrss/win32csr/guiconsole.c @@ -198,13 +198,13 @@ GuiConsoleOpenUserRegistryPathPerProcessId(DWORD ProcessId, PHANDLE hProcHandle, { HANDLE hProcessToken = NULL; HANDLE hProcess; - + BYTE Buffer[256]; DWORD Length = 0; UNICODE_STRING SidName; LONG res; PTOKEN_USER TokUser; - + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | READ_CONTROL, FALSE, ProcessId); if (!hProcess) { @@ -226,14 +226,14 @@ GuiConsoleOpenUserRegistryPathPerProcessId(DWORD ProcessId, PHANDLE hProcHandle, CloseHandle(hProcessToken); return FALSE; } - + TokUser = ((PTOKEN_USER)Buffer)->User.Sid; if (!NT_SUCCESS(RtlConvertSidToUnicodeString(&SidName, TokUser, TRUE))) { DPRINT("Error: RtlConvertSidToUnicodeString failed(0x%x)\n", GetLastError()); return FALSE; } - + res = RegOpenKeyExW(HKEY_USERS, SidName.Buffer, 0, samDesired, hResult); RtlFreeUnicodeString(&SidName); @@ -264,9 +264,9 @@ GuiConsoleOpenUserSettings(PGUI_CONSOLE_DATA GuiData, DWORD ProcessId, PHKEY hSu /* * console properties are stored under * HKCU\Console\* - * + * * There are 3 ways to store console properties - * + * * 1. use console title as subkey name * i.e. cmd.exe * @@ -275,12 +275,12 @@ GuiConsoleOpenUserSettings(PGUI_CONSOLE_DATA GuiData, DWORD ProcessId, PHKEY hSu * 3. use unexpanded path to console application. * i.e. %SystemRoot%_system32_cmd.exe */ - + DPRINT("GuiConsoleOpenUserSettings entered\n"); if (!GuiConsoleOpenUserRegistryPathPerProcessId(ProcessId, &hProcess, &hKey, samDesired)) { - DPRINT("GuiConsoleOpenUserRegistryPathPerProcessId failed\n"); + DPRINT("GuiConsoleOpenUserRegistryPathPerProcessId failed\n"); return FALSE; } @@ -298,7 +298,7 @@ GuiConsoleOpenUserSettings(PGUI_CONSOLE_DATA GuiData, DWORD ProcessId, PHKEY hSu /* * try the process name as path */ - + ptr = wcsrchr(szProcessName, L'\\'); wcscpy(GuiData->szProcessName, ptr); @@ -376,7 +376,7 @@ GuiConsoleOpenUserSettings(PGUI_CONSOLE_DATA GuiData, DWORD ProcessId, PHKEY hSu /* replace slashes by underscores */ while((ptr = wcschr(szProcessName, L'\\'))) ptr[0] = L'_'; - + swprintf(szBuffer, L"Console\\\%SystemRoot\%%S", &szProcessName[wLength]); DPRINT("#3 Path : %S\n", szBuffer); if (RegOpenKeyExW(hKey, szBuffer, 0, samDesired, hSubKey) == ERROR_SUCCESS) @@ -614,9 +614,9 @@ GuiConsoleUseDefaults(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PCSRSS_ GuiData->HistoryBufferSize = 50; GuiData->NumberOfHistoryBuffers = 5; GuiData->ScreenText = RGB(192, 192, 192); - GuiData->ScreenBackground = RGB(0, 0, 0); - GuiData->PopupText = RGB(128, 0, 128); - GuiData->PopupBackground = RGB(255, 255, 255); + GuiData->ScreenBackground = RGB(0, 0, 0); + GuiData->PopupText = RGB(128, 0, 128); + GuiData->PopupBackground = RGB(255, 255, 255); GuiData->WindowPosition = UINT_MAX; GuiData->ScreenBufferSize = MAKELONG(80, 300); //FIXME GuiData->UseRasterFonts = TRUE; @@ -639,7 +639,7 @@ FASTCALL GuiConsoleInitScrollbar(PCSRSS_CONSOLE Console, HWND hwnd) { SCROLLINFO sInfo; - + /* set scrollbar sizes */ sInfo.cbSize = sizeof(SCROLLINFO); sInfo.fMask = SIF_RANGE | SIF_POS; @@ -697,16 +697,16 @@ GuiConsoleHandleNcCreate(HWND hWnd, CREATESTRUCTW *Create) InitializeCriticalSection(&GuiData->Lock); - GuiData->LineBuffer = (PWCHAR)HeapAlloc(Win32CsrApiHeap, HEAP_ZERO_MEMORY, + GuiData->LineBuffer = (PWCHAR)HeapAlloc(Win32CsrApiHeap, HEAP_ZERO_MEMORY, Console->Size.X * sizeof(WCHAR)); - GuiData->Font = CreateFontW(LOWORD(GuiData->FontSize), - 0, //HIWORD(GuiData->FontSize), - 0, - TA_BASELINE, + GuiData->Font = CreateFontW(LOWORD(GuiData->FontSize), + 0, //HIWORD(GuiData->FontSize), + 0, + TA_BASELINE, GuiData->FontWeight, FALSE, - FALSE, + FALSE, FALSE, OEM_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, @@ -1473,7 +1473,7 @@ GuiConsoleShowConsoleProperties(HWND hWnd, BOOL Defaults, PGUI_CONSOLE_DATA GuiD if (GuiData->ConsoleLibrary == NULL) { - DPRINT1("failed to load console.dll"); + DPRINT1("failed to load console.dll"); return; } } @@ -1489,10 +1489,10 @@ GuiConsoleShowConsoleProperties(HWND hWnd, BOOL Defaults, PGUI_CONSOLE_DATA GuiD SharedInfo.InsertMode = GuiData->InsertMode; SharedInfo.HistoryBufferSize = GuiData->HistoryBufferSize; SharedInfo.NumberOfHistoryBuffers = GuiData->NumberOfHistoryBuffers; - SharedInfo.ScreenText = GuiData->ScreenText; - SharedInfo.ScreenBackground = GuiData->ScreenBackground; - SharedInfo.PopupText = GuiData->PopupText; - SharedInfo.PopupBackground = GuiData->PopupBackground; + SharedInfo.ScreenText = GuiData->ScreenText; + SharedInfo.ScreenBackground = GuiData->ScreenBackground; + SharedInfo.PopupText = GuiData->PopupText; + SharedInfo.PopupBackground = GuiData->PopupBackground; SharedInfo.WindowSize = (DWORD)MAKELONG(Console->Size.X, Console->Size.Y); SharedInfo.WindowPosition = GuiData->WindowPosition; SharedInfo.ScreenBuffer = GuiData->ScreenBufferSize; @@ -1504,7 +1504,7 @@ GuiConsoleShowConsoleProperties(HWND hWnd, BOOL Defaults, PGUI_CONSOLE_DATA GuiD SharedInfo.FullScreen = GuiData->FullScreen; SharedInfo.QuickEdit = GuiData->QuickEdit; memcpy(&SharedInfo.Colors[0], GuiData->Colors, sizeof(s_Colors)); - + if (!CPLFunc(hWnd, CPL_INIT, 0, 0)) { DPRINT("Error: failed to initialize console.dll\n"); @@ -1583,7 +1583,7 @@ GuiConsoleHandleScrollbarMenu() //InsertItem(hMenu, MFT_SEPARATOR, MIIM_FTYPE, 0, NULL, -1); //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLUP); //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLDOWN); - + } static VOID FASTCALL @@ -1593,7 +1593,7 @@ GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsole RECT rect; PCSRSS_SCREEN_BUFFER ActiveBuffer; PCSRSS_PROCESS_DATA ProcessData = NULL; - + if (Console->ProcessList.Flink != &Console->ProcessList) { ProcessData = CONTAINING_RECORD(Console->ProcessList.Flink, CSRSS_PROCESS_DATA, ProcessEntry); @@ -1623,7 +1623,7 @@ GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsole USHORT value; DWORD diff; DWORD i; - + value = MAKEWORD(' ', ActiveBuffer->DefaultAttrib); DPRINT("MaxX %d MaxY %d windx %d windy %d value %04x DefaultAttrib %d\n",ActiveBuffer->MaxX, ActiveBuffer->MaxY, windx, windy, value, ActiveBuffer->DefaultAttrib); @@ -1643,7 +1643,7 @@ GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsole /* enlarge size */ RtlCopyMemory(&Buffer[Offset], &OldBuffer[BufferOffset], ActiveBuffer->MaxX * 2); Offset += (ActiveBuffer->MaxX * 2); - + diff = windx - ActiveBuffer->MaxX; /* zero new part of it */ #if HAVE_WMEMSET @@ -1659,7 +1659,7 @@ GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsole BufferOffset += (Console->ActiveBuffer->MaxX * 2); } } - + if (windy > Console->ActiveBuffer->MaxY) { diff = windy - Console->ActiveBuffer->MaxX; @@ -1743,7 +1743,7 @@ GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsole InvalidateRect(pConInfo->hConsoleWindow, NULL, TRUE); } -static +static LRESULT GuiConsoleHandleScroll(HWND hwnd, UINT uMsg, WPARAM wParam, PGUI_CONSOLE_DATA GuiData) { @@ -1776,7 +1776,7 @@ GuiConsoleHandleScroll(HWND hwnd, UINT uMsg, WPARAM wParam, PGUI_CONSOLE_DATA Gu case SB_PAGELEFT: sInfo.nPos -= sInfo.nPage; break; - + case SB_PAGERIGHT: sInfo.nPos += sInfo.nPage; break; @@ -1793,7 +1793,7 @@ GuiConsoleHandleScroll(HWND hwnd, UINT uMsg, WPARAM wParam, PGUI_CONSOLE_DATA Gu sInfo.nPos = sInfo.nMax; break; - default: + default: break; } @@ -1808,7 +1808,7 @@ GuiConsoleHandleScroll(HWND hwnd, UINT uMsg, WPARAM wParam, PGUI_CONSOLE_DATA Gu sInfo.cbSize = sizeof(SCROLLINFO); sInfo.fMask = SIF_POS; - if (!GetScrollInfo(hwnd, + if (!GetScrollInfo(hwnd, (uMsg == WM_HSCROLL ? SB_HORZ : SB_VERT), &sInfo)) { @@ -1820,10 +1820,10 @@ GuiConsoleHandleScroll(HWND hwnd, UINT uMsg, WPARAM wParam, PGUI_CONSOLE_DATA Gu /// /// fixme scroll window /// - + ScrollWindowEx(hwnd, 0, - GuiData->CharHeight * (old_pos - sInfo.nPos), + GuiData->CharHeight * (old_pos - sInfo.nPos), NULL, NULL, NULL, diff --git a/reactos/subsystems/win32/csrss/win32csr/lang/it-IT.rc b/reactos/subsystems/win32/csrss/win32csr/lang/it-IT.rc index f4f8e127dc6..0b31afe3b98 100644 --- a/reactos/subsystems/win32/csrss/win32csr/lang/it-IT.rc +++ b/reactos/subsystems/win32/csrss/win32csr/lang/it-IT.rc @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: subsystems/win32/csrss/win32csr/lang/it-IT.rc * PURPOSE: Italian Translation of subsystems/win32/csrss/win32csr/lang/en-US.rc -* PROGRAMMERS: +* PROGRAMMERS: * Copyright (C) 2007 Daniele Forsi (dforsi at gmail.com) Italian Translation */ diff --git a/reactos/subsystems/win32/csrss/win32csr/lang/pl-PL.rc b/reactos/subsystems/win32/csrss/win32csr/lang/pl-PL.rc index 7556c5c2b03..23be4eb03fb 100644 --- a/reactos/subsystems/win32/csrss/win32csr/lang/pl-PL.rc +++ b/reactos/subsystems/win32/csrss/win32csr/lang/pl-PL.rc @@ -1,8 +1,8 @@ -/* +/* * translated by xrogers (http://rogers.cyberdusk.pl/) -* xxrogers@users.sourceforge.net -* https://sourceforge.net/projects/reactospl -*/ +* xxrogers@users.sourceforge.net +* https://sourceforge.net/projects/reactospl +*/ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_END_NOW DIALOG DISCARDABLE 0, 0, 200, 95 diff --git a/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c b/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c index f4d2cfead90..0de0a0c8184 100644 --- a/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c +++ b/reactos/subsystems/win32/csrss/win32csr/tuiconsole.c @@ -69,7 +69,7 @@ TuiInit(VOID) DPRINT1("Failed to register console wndproc\n"); return FALSE; } - + return TRUE; } @@ -223,7 +223,7 @@ static VOID STDCALL TuiCleanupConsole(PCSRSS_CONSOLE Console) { DestroyWindow(Console->hWindow); - + EnterCriticalSection(&ActiveConsoleLock); /* Switch to next console */ diff --git a/reactos/subsystems/win32/win32k/dib/dib.h b/reactos/subsystems/win32/win32k/dib/dib.h index a0d1023c3f2..e6a711eda37 100644 --- a/reactos/subsystems/win32/win32k/dib/dib.h +++ b/reactos/subsystems/win32/win32k/dib/dib.h @@ -6,20 +6,20 @@ #endif #define ROP4_BLACKNESS ((((0x00000042) >> 8) & 0xff00) | (((0x00000042) >> 16) & 0x00ff)) -#define ROP4_NOTSRCERASE ((((0x001100A6) >> 8) & 0xff00) | (((0x001100A6) >> 16) & 0x00ff)) -#define ROP4_NOTSRCCOPY ((((0x00330008) >> 8) & 0xff00) | (((0x00330008) >> 16) & 0x00ff)) -#define ROP4_SRCERASE ((((0x00440328) >> 8) & 0xff00) | (((0x00440328) >> 16) & 0x00ff)) -#define ROP4_DSTINVERT ((((0x00550009) >> 8) & 0xff00) | (((0x00550009) >> 16) & 0x00ff)) -#define ROP4_PATINVERT ((((0x005A0049) >> 8) & 0xff00) | (((0x005A0049) >> 16) & 0x00ff)) -#define ROP4_SRCINVERT ((((0x00660046) >> 8) & 0xff00) | (((0x00660046) >> 16) & 0x00ff)) -#define ROP4_SRCAND ((((0x008800C6) >> 8) & 0xff00) | (((0x008800C6) >> 16) & 0x00ff)) -#define ROP4_MERGEPAINT ((((0x00BB0226) >> 8) & 0xff00) | (((0x00BB0226) >> 16) & 0x00ff)) -#define ROP4_MERGECOPY ((((0x00C000CA) >> 8) & 0xff00) | (((0x00C000CA) >> 16) & 0x00ff)) -#define ROP4_SRCCOPY ((((0x00CC0020) >> 8) & 0xff00) | (((0x00CC0020) >> 16) & 0x00ff)) -#define ROP4_SRCPAINT ((((0x00EE0086) >> 8) & 0xff00) | (((0x00EE0086) >> 16) & 0x00ff)) -#define ROP4_PATCOPY ((((0x00F00021) >> 8) & 0xff00) | (((0x00F00021) >> 16) & 0x00ff)) -#define ROP4_PATPAINT ((((0x00FB0A09) >> 8) & 0xff00) | (((0x00FB0A09) >> 16) & 0x00ff)) -#define ROP4_WHITENESS ((((0x00FF0062) >> 8) & 0xff00) | (((0x00FF0062) >> 16) & 0x00ff)) +#define ROP4_NOTSRCERASE ((((0x001100A6) >> 8) & 0xff00) | (((0x001100A6) >> 16) & 0x00ff)) +#define ROP4_NOTSRCCOPY ((((0x00330008) >> 8) & 0xff00) | (((0x00330008) >> 16) & 0x00ff)) +#define ROP4_SRCERASE ((((0x00440328) >> 8) & 0xff00) | (((0x00440328) >> 16) & 0x00ff)) +#define ROP4_DSTINVERT ((((0x00550009) >> 8) & 0xff00) | (((0x00550009) >> 16) & 0x00ff)) +#define ROP4_PATINVERT ((((0x005A0049) >> 8) & 0xff00) | (((0x005A0049) >> 16) & 0x00ff)) +#define ROP4_SRCINVERT ((((0x00660046) >> 8) & 0xff00) | (((0x00660046) >> 16) & 0x00ff)) +#define ROP4_SRCAND ((((0x008800C6) >> 8) & 0xff00) | (((0x008800C6) >> 16) & 0x00ff)) +#define ROP4_MERGEPAINT ((((0x00BB0226) >> 8) & 0xff00) | (((0x00BB0226) >> 16) & 0x00ff)) +#define ROP4_MERGECOPY ((((0x00C000CA) >> 8) & 0xff00) | (((0x00C000CA) >> 16) & 0x00ff)) +#define ROP4_SRCCOPY ((((0x00CC0020) >> 8) & 0xff00) | (((0x00CC0020) >> 16) & 0x00ff)) +#define ROP4_SRCPAINT ((((0x00EE0086) >> 8) & 0xff00) | (((0x00EE0086) >> 16) & 0x00ff)) +#define ROP4_PATCOPY ((((0x00F00021) >> 8) & 0xff00) | (((0x00F00021) >> 16) & 0x00ff)) +#define ROP4_PATPAINT ((((0x00FB0A09) >> 8) & 0xff00) | (((0x00FB0A09) >> 16) & 0x00ff)) +#define ROP4_WHITENESS ((((0x00FF0062) >> 8) & 0xff00) | (((0x00FF0062) >> 16) & 0x00ff)) typedef struct _BLTINFO diff --git a/reactos/subsystems/win32/win32k/dib/dib16bpp.c b/reactos/subsystems/win32/win32k/dib/dib16bpp.c index 66cfadccbad..c0a19c54182 100644 --- a/reactos/subsystems/win32/win32k/dib/dib16bpp.c +++ b/reactos/subsystems/win32/win32k/dib/dib16bpp.c @@ -165,7 +165,7 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) { if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0) { - DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j, + DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0)); } else @@ -195,7 +195,7 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1))); DIB_16BPP_PutPixel(BltInfo->DestSurface, i, j, xColor); - if(f1 == 1) + if(f1 == 1) { SourceLine_4BPP++; f1 = 0; @@ -235,7 +235,7 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) break; case BMF_16BPP: - if (NULL == BltInfo->XlateSourceToDest || 0 != + if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL)) { if (BltInfo->DestRect.top < BltInfo->SourcePoint.y) @@ -247,8 +247,8 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++) { - RtlMoveMemory(DestBits, SourceBits, - 2 * (BltInfo->DestRect.right - + RtlMoveMemory(DestBits, SourceBits, + 2 * (BltInfo->DestRect.right - BltInfo->DestRect.left)); SourceBits += BltInfo->SourceSurface->lDelta; @@ -294,11 +294,11 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) { SourceBits = SourceLine; DestBits = DestLine; - for (i = BltInfo->DestRect.left; i < + for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++) { *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate( - BltInfo->XlateSourceToDest, + BltInfo->XlateSourceToDest, *((WORD *)SourceBits)); SourceBits += 2; DestBits += 2; @@ -311,8 +311,8 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) { SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + - BltInfo->DestRect.bottom - - BltInfo->DestRect.top - 1) * + BltInfo->DestRect.bottom - + BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x; @@ -326,11 +326,11 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) { SourceBits = SourceLine; DestBits = DestLine; - for (i = BltInfo->DestRect.left; i < + for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++) { *((WORD *)DestBits) = (WORD)XLATEOBJ_iXlate( - BltInfo->XlateSourceToDest, + BltInfo->XlateSourceToDest, *((WORD *)SourceBits)); SourceBits += 2; DestBits += 2; @@ -344,7 +344,7 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) case BMF_24BPP: SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + - (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x; DestLine = DestBits; @@ -371,7 +371,7 @@ DIB_16BPP_BitBltSrcCopy(PBLTINFO BltInfo) break; case BMF_32BPP: - SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + + SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x; @@ -412,7 +412,7 @@ DIB_16BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) ULONG DestY; #if defined(_M_IX86) && !defined(_MSC_VER) - /* This is about 10% faster than the generic C code below */ + /* This is about 10% faster than the generic C code below */ ULONG delta = DestSurface->lDelta; ULONG width = (DestRect->right - DestRect->left) ; PULONG pos = (PULONG) ((PBYTE)DestSurface->pvScan0 + DestRect->top * delta + (DestRect->left<<1)); @@ -423,8 +423,8 @@ DIB_16BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) { __asm__ __volatile__ ( " cld\n" - " mov %1,%%ebx\n" - " mov %2,%%edi\n" + " mov %1,%%ebx\n" + " mov %2,%%edi\n" " test $0x03, %%edi\n" /* Align to fullword boundary */ " jz .FL1\n" " stosw\n" @@ -441,7 +441,7 @@ DIB_16BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) : : "a" (color), "r" (width), "m" (pos) : "%ecx", "%ebx", "%edi"); - pos =(PULONG)((ULONG_PTR)pos + delta); + pos =(PULONG)((ULONG_PTR)pos + delta); } #else /* _M_IX86 */ @@ -545,7 +545,7 @@ FinalCopy16(PIXEL *Target, PIXEL *Source, PSPAN ClipSpans, UINT ClipSpansCount, LONG Left, Right; while ( ClipSpans[*SpanIndex].Y < DestY || - (ClipSpans[*SpanIndex].Y == DestY && + (ClipSpans[*SpanIndex].Y == DestY && ClipSpans[*SpanIndex].X + ClipSpans[*SpanIndex].Width < DestRect->left)) { (*SpanIndex)++; @@ -592,7 +592,7 @@ BOOLEAN ScaleRectAvg16(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, int IntPart = (((SourceRect->bottom - SourceRect->top) / (DestRect->bottom - DestRect->top)) * SourceSurf->lDelta) >> 1; - int FractPart = (SourceRect->bottom - SourceRect->top) % + int FractPart = (SourceRect->bottom - SourceRect->top) % (DestRect->bottom - DestRect->top); int Mid = (DestRect->bottom - DestRect->top) >> 1; @@ -632,7 +632,7 @@ BOOLEAN ScaleRectAvg16(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL)); - ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right - + ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL)); DestY = DestRect->top; @@ -664,8 +664,8 @@ BOOLEAN ScaleRectAvg16(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, { int x; - ScaleLineAvg16(ScanLineAhead, (PIXEL *)((BYTE *)Source + - SourceSurf->lDelta), SourceRect->right - + ScaleLineAvg16(ScanLineAhead, (PIXEL *)((BYTE *)Source + + SourceSurf->lDelta), SourceRect->right - SourceRect->left, DestRect->right - DestRect->left); for (x = 0; x < DestRect->right - DestRect->left; x++) @@ -764,7 +764,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, /* Calc the Zoom Width of Source */ SrcSizeX = SourceRect->right - SourceRect->left; - + /* Calc the Zoom height of Destions */ DesSizeY = DestRect->bottom - DestRect->top; @@ -790,7 +790,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, switch(SourceSurf->iBitmapFormat) { - + case BMF_1BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ @@ -802,7 +802,7 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, for (DesX=0; DesXpvScan0 + (DestRect->left << 1) + DestRect->top * DestSurf->lDelta); - DifflDelta = DestSurf->lDelta - (DesSizeX << 1); + DifflDelta = DestSurf->lDelta - (DesSizeX << 1); for (DesY=0; DesY> 2); - SrcPixel.col.green = (DstPixel.col.green << 2) | + SrcPixel.col.green = (DstPixel.col.green << 2) | (DstPixel.col.green >> 4); SrcPixel.col.blue = (DstPixel.col.blue << 3) | (DstPixel.col.blue >> 2); @@ -1159,10 +1159,10 @@ DIB_16BPP_AlphaBlend(SURFOBJ* Dest, SURFOBJ* Source, RECTL* DestRect, { SrcPixel.ul = DIB_GetSourceIndex(Source, SrcX++, SrcY); } - SrcPixel.col.red = SrcPixel.col.red * + SrcPixel.col.red = SrcPixel.col.red * BlendFunc.SourceConstantAlpha / 255; - SrcPixel.col.green = SrcPixel.col.green * + SrcPixel.col.green = SrcPixel.col.green * BlendFunc.SourceConstantAlpha / 255; SrcPixel.col.blue = SrcPixel.col.blue * @@ -1177,7 +1177,7 @@ DIB_16BPP_AlphaBlend(SURFOBJ* Dest, SURFOBJ* Source, RECTL* DestRect, SrcPixel.col.alpha : BlendFunc.SourceConstantAlpha; DstPixel.us = *Dst; - DstPixel.col.red = Clamp5(DstPixel.col.red * (255 - Alpha) / 255 + + DstPixel.col.red = Clamp5(DstPixel.col.red * (255 - Alpha) / 255 + (SrcPixel.col.red >> 3)); DstPixel.col.green = Clamp6(DstPixel.col.green * (255 - Alpha) / 255 + diff --git a/reactos/subsystems/win32/win32k/dib/dib1bpp.c b/reactos/subsystems/win32/win32k/dib/dib1bpp.c index 29eab73868d..6529b7be53e 100644 --- a/reactos/subsystems/win32/win32k/dib/dib1bpp.c +++ b/reactos/subsystems/win32/win32k/dib/dib1bpp.c @@ -483,14 +483,14 @@ DIB_1BPP_BitBlt(PBLTINFO BltInfo) } /* BitBlt Optimize */ -BOOLEAN +BOOLEAN DIB_1BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) { - ULONG DestY; + ULONG DestY; for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) - { - DIB_1BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); + { + DIB_1BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); } return TRUE; @@ -507,16 +507,16 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, LONG SrcSizeY; LONG SrcSizeX; LONG DesSizeY; - LONG DesSizeX; + LONG DesSizeX; LONG sx; LONG sy; LONG DesX; LONG DesY; LONG color; - + SrcSizeY = SourceRect->bottom - SourceRect->top; SrcSizeX = SourceRect->right - SourceRect->left; - + DesSizeY = DestRect->bottom - DestRect->top; DesSizeX = DestRect->right - DestRect->left; @@ -525,112 +525,112 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, case BMF_1BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { + { sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - + color = DIB_1BPP_GetPixel(SourceSurf, sx, sy); - DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_4BPP: + case BMF_4BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_4BPP_GetPixel(SourceSurf, sx, sy); DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_8BPP: + case BMF_8BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_8BPP_GetPixel(SourceSurf, sx, sy); DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_16BPP: + case BMF_16BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_16BPP_GetPixel(SourceSurf, sx, sy); DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_24BPP: + case BMF_24BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_24BPP_GetPixel(SourceSurf, sx, sy); DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_32BPP: + case BMF_32BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_32BPP_GetPixel(SourceSurf, sx, sy); DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; default: //DPRINT1("DIB_1BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); return FALSE; } - + return TRUE; } diff --git a/reactos/subsystems/win32/win32k/dib/dib24bpp.c b/reactos/subsystems/win32/win32k/dib/dib24bpp.c index 2dc80ab1a6e..9cd846f7f49 100644 --- a/reactos/subsystems/win32/win32k/dib/dib24bpp.c +++ b/reactos/subsystems/win32/win32k/dib/dib24bpp.c @@ -185,7 +185,7 @@ DIB_24BPP_BitBltSrcCopy(PBLTINFO BltInfo) } } else - { + { sx = BltInfo->SourcePoint.x; sy = BltInfo->SourcePoint.y; @@ -194,8 +194,8 @@ DIB_24BPP_BitBltSrcCopy(PBLTINFO BltInfo) sx = BltInfo->SourcePoint.x; for (i=BltInfo->DestRect.left; iDestRect.right; i++) { - DWORD pixel = DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy); - DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, pixel)); + DWORD pixel = DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy); + DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, pixel)); sx++; } sy++; @@ -304,10 +304,10 @@ DIB_24BPP_BitBlt(PBLTINFO BltInfo) } /* BitBlt Optimize */ -BOOLEAN +BOOLEAN DIB_24BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) { - ULONG DestY; + ULONG DestY; #if defined(_M_IX86) && !defined(_MSC_VER) PBYTE xaddr = (PBYTE)DestSurface->pvScan0 + DestRect->top * DestSurface->lDelta + (DestRect->left << 1) + DestRect->left; @@ -318,7 +318,7 @@ DIB_24BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) { Count = xCount; - addr = xaddr; + addr = xaddr; xaddr = (PBYTE)((ULONG_PTR)addr + DestSurface->lDelta); if (Count < 8) @@ -396,8 +396,8 @@ DIB_24BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) #else for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) - { - DIB_24BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); + { + DIB_24BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); } #endif return TRUE; @@ -413,16 +413,16 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, LONG SrcSizeY; LONG SrcSizeX; LONG DesSizeY; - LONG DesSizeX; + LONG DesSizeX; LONG sx; LONG sy; LONG DesX; LONG DesY; LONG color; - + SrcSizeY = SourceRect->bottom - SourceRect->top; SrcSizeX = SourceRect->right - SourceRect->left; - + DesSizeY = DestRect->bottom - DestRect->top; DesSizeX = DestRect->right - DestRect->left; @@ -431,118 +431,118 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, case BMF_1BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { + { sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - + if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) { DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0)); - } - else + } + else { DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1)); } } - } + } break; - case BMF_4BPP: + case BMF_4BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_4BPP_GetPixel(SourceSurf, sx, sy); DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_8BPP: + case BMF_8BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_8BPP_GetPixel(SourceSurf, sx, sy); DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_16BPP: + case BMF_16BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_16BPP_GetPixel(SourceSurf, sx, sy); DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_24BPP: + case BMF_24BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_24BPP_GetPixel(SourceSurf, sx, sy); DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_32BPP: + case BMF_32BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_32BPP_GetPixel(SourceSurf, sx, sy); DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; default: //DPRINT1("DIB_24BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); return FALSE; } - + return TRUE; } diff --git a/reactos/subsystems/win32/win32k/dib/dib32bpp.c b/reactos/subsystems/win32/win32k/dib/dib32bpp.c index a5b16aa0dbd..6c413e2a026 100644 --- a/reactos/subsystems/win32/win32k/dib/dib32bpp.c +++ b/reactos/subsystems/win32/win32k/dib/dib32bpp.c @@ -46,18 +46,18 @@ VOID DIB_32BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c) { - + PBYTE byteaddr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta; PDWORD addr = (PDWORD)byteaddr + x; - LONG lDelta = SurfObj->lDelta >> 2; // >> 2 == / sizeof(DWORD) + LONG lDelta = SurfObj->lDelta >> 2; // >> 2 == / sizeof(DWORD) byteaddr = (PBYTE)addr; - while(y1++ < y2) + while(y1++ < y2) { *addr = (DWORD)c; addr += lDelta; - } - + } + } BOOLEAN @@ -73,7 +73,7 @@ DIB_32BPP_BitBltSrcCopy(PBLTINFO BltInfo) switch(BltInfo->SourceSurface->iBitmapFormat) { case BMF_1BPP: - + sx = BltInfo->SourcePoint.x; sy = BltInfo->SourcePoint.y; @@ -498,9 +498,9 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, LONG sx_dec = 0; LONG sx_max; - + DPRINT("DIB_32BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", - BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, + BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); /* Calc the Zoom height of Source */ @@ -508,7 +508,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, /* Calc the Zoom Width of Source */ SrcSizeX = SourceRect->right - SourceRect->left; - + /* Calc the Zoom height of Destions */ DesSizeY = DestRect->bottom - DestRect->top; @@ -530,7 +530,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DestBits = (PULONG)((PBYTE)DestSurf->pvScan0 + (DestRect->left << 2) + DestRect->top * DestSurf->lDelta); - DifflDelta = DestSurf->lDelta - (DesSizeX << 2); + DifflDelta = DestSurf->lDelta - (DesSizeX << 2); switch(SourceSurf->iBitmapFormat) { @@ -543,7 +543,7 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, sx_dec = 0; for (DesX=0; DesXleft; sx_dec = 0; for (DesX=0; DesXleft; sx_dec = 0; for (DesX=0; DesXleft; sx_dec = 0; for (DesX=0; DesXleft; sx_dec = 0; for (DesX=0; DesXtop; DestY< DestRect->bottom; DestY++) - { - DIB_4BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); + { + DIB_4BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); } return TRUE; @@ -384,16 +384,16 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, LONG SrcSizeY; LONG SrcSizeX; LONG DesSizeY; - LONG DesSizeX; + LONG DesSizeX; LONG sx; LONG sy; LONG DesX; LONG DesY; LONG color; - + SrcSizeY = SourceRect->bottom - SourceRect->top; SrcSizeX = SourceRect->right - SourceRect->left; - + DesSizeY = DestRect->bottom - DestRect->top; DesSizeX = DestRect->right - DestRect->left; @@ -402,118 +402,118 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, case BMF_1BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { + { sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - + if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) { DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0)); - } - else + } + else { DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1)); } } - } + } break; - case BMF_4BPP: + case BMF_4BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_4BPP_GetPixel(SourceSurf, sx, sy); DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_8BPP: + case BMF_8BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_8BPP_GetPixel(SourceSurf, sx, sy); DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_16BPP: + case BMF_16BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_16BPP_GetPixel(SourceSurf, sx, sy); DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_24BPP: + case BMF_24BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_24BPP_GetPixel(SourceSurf, sx, sy); DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; - case BMF_32BPP: + case BMF_32BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - + for (DesY=DestRect->top; DesYbottom; DesY++) - { + { sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; - + for (DesX=DestRect->left; DesXright; DesX++) - { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; + { + sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; color = DIB_32BPP_GetPixel(SourceSurf, sx, sy); DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); } - } + } break; default: //DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); return FALSE; } - + return TRUE; } diff --git a/reactos/subsystems/win32/win32k/dib/dib8bpp.c b/reactos/subsystems/win32/win32k/dib/dib8bpp.c index e38e856e5ea..8d22d178c18 100644 --- a/reactos/subsystems/win32/win32k/dib/dib8bpp.c +++ b/reactos/subsystems/win32/win32k/dib/dib8bpp.c @@ -253,15 +253,15 @@ DIB_8BPP_BitBltSrcCopy(PBLTINFO BltInfo) } /* BitBlt Optimize */ -BOOLEAN +BOOLEAN DIB_8BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) -{ - ULONG DestY; +{ + ULONG DestY; for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) { DIB_8BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); } - + return TRUE; } /* @@ -491,7 +491,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, /* Calc the Zoom Width of Source */ SrcSizeX = SourceRect->right - SourceRect->left; - + /* Calc the Zoom height of Destions */ DesSizeY = DestRect->bottom - DestRect->top; @@ -516,7 +516,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, DifflDelta = DestSurf->lDelta - DesSizeX ; switch(SourceSurf->iBitmapFormat) - { + { case BMF_1BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ @@ -526,7 +526,7 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, sx_dec = 0; for (DesX=0; DesXListEntry); IntEngUnLockProcessDriverObjs(PsGetCurrentProcessWin32Process()); EngFreeMem(DrvObjInt); - + return TRUE; } @@ -147,7 +147,7 @@ EngLockDriverObj( IN HDRVOBJ hdo ) { PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo; PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER); - + if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock)) { return NULL; diff --git a/reactos/subsystems/win32/win32k/eng/engmisc.c b/reactos/subsystems/win32/win32k/eng/engmisc.c index 77cac7cd912..3552f633409 100644 --- a/reactos/subsystems/win32/win32k/eng/engmisc.c +++ b/reactos/subsystems/win32/win32k/eng/engmisc.c @@ -68,13 +68,13 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, EnterLeave->OutputBitmap = EngCreateBitmap(BitmapSize, Width, DestObj->iBitmapFormat, BMF_TOPDOWN | BMF_NOZEROINIT, NULL); - + if (!EnterLeave->OutputBitmap) { DPRINT1("EngCreateBitmap() failed\n"); return FALSE; } - + *OutputObj = EngLockSurface((HSURF)EnterLeave->OutputBitmap); EnterLeave->DestRect.left = 0; diff --git a/reactos/subsystems/win32/win32k/eng/engwindow.c b/reactos/subsystems/win32/win32k/eng/engwindow.c index 48686218156..c8f1aa258fb 100644 --- a/reactos/subsystems/win32/win32k/eng/engwindow.c +++ b/reactos/subsystems/win32/win32k/eng/engwindow.c @@ -28,7 +28,7 @@ */ /* TODO: Check how the WNDOBJ implementation should behave with a driver on windows. */ - + #include #define NDEBUG @@ -44,12 +44,12 @@ IntEngWndCallChangeProc( IN FLONG flChanged) { WNDGDI *WndObjInt = ObjToGDI(pwo, WND); - + if (WndObjInt->ChangeProc == NULL) { return; } - + /* check flags of the WNDOBJ */ flChanged &= WndObjInt->Flags; if (flChanged == 0) @@ -125,7 +125,7 @@ IntEngWndUpdateClipObj( ClipObj = IntEngCreateClipRegion(1, (PRECTL)&Window->ClientRect, (PRECTL)&Window->ClientRect); } - + if (ClipObj == NULL) { DPRINT1("Warning: IntEngCreateClipRegion() failed!\n"); @@ -137,7 +137,7 @@ IntEngWndUpdateClipObj( OldClipObj = InterlockedExchangePointer(&WndObjInt->ClientClipObj, ClipObj); if (OldClipObj != NULL) IntEngDeleteClipRegion(OldClipObj); - + return TRUE; } @@ -159,7 +159,7 @@ IntEngWindowChanged( while (CurrentEntry != &Window->WndObjListHead) { Current = CONTAINING_RECORD(CurrentEntry, WNDGDI, ListEntry); - + if (Current->WndObj.pvConsumer != NULL) { /* Update the WNDOBJ */ @@ -169,7 +169,7 @@ IntEngWindowChanged( /* Update the clipobj and client rect of the WNDOBJ */ IntEngWndUpdateClipObj(Current, Window); break; - + case WOC_DELETE: /* FIXME: Should the WNDOBJs be deleted by win32k or by the driver? */ break; @@ -177,7 +177,7 @@ IntEngWindowChanged( /* Call the change proc */ IntEngWndCallChangeProc(&Current->WndObj, flChanged); - + /* HACK: Send WOC_CHANGED after WOC_RGN_CLIENT */ if (flChanged == WOC_RGN_CLIENT) { @@ -254,9 +254,9 @@ EngCreateWnd( InsertTailList(&Window->WndObjListHead, &WndObjInt->ListEntry); DPRINT("EngCreateWnd: SUCCESS!\n"); - + RETURN( WndObjUser); - + CLEANUP: if (!calledFromUser){ @@ -277,7 +277,7 @@ EngDeleteWnd( { WNDGDI *WndObjInt = ObjToGDI(pwo, WND); PWINDOW_OBJECT Window; - BOOL calledFromUser; + BOOL calledFromUser; DPRINT("EngDeleteWnd: pwo = 0x%x\n", pwo); @@ -321,10 +321,10 @@ WNDOBJ_bEnum( { WNDGDI *WndObjInt = ObjToGDI(pwo, WND); BOOL Ret; - + DPRINT("WNDOBJ_bEnum: pwo = 0x%x, cj = %d, pul = 0x%x\n", pwo, cj, pul); Ret = CLIPOBJ_bEnum(WndObjInt->ClientClipObj, cj, pul); - + DPRINT("WNDOBJ_bEnum: Returning %s\n", Ret ? "True" : "False"); return Ret; } @@ -367,7 +367,7 @@ WNDOBJ_vSetConsumer( BOOL Hack; DPRINT("WNDOBJ_vSetConsumer: pwo = 0x%x, pvConsumer = 0x%x\n", pwo, pvConsumer); - + Hack = (pwo->pvConsumer == NULL); pwo->pvConsumer = pvConsumer; diff --git a/reactos/subsystems/win32/win32k/eng/float.c b/reactos/subsystems/win32/win32k/eng/float.c index d6c50acdafe..94e58df27ba 100644 --- a/reactos/subsystems/win32/win32k/eng/float.c +++ b/reactos/subsystems/win32/win32k/eng/float.c @@ -56,7 +56,7 @@ #define EXP(fp) (((fp) >> 23L) & 0xFF) #define MANT(fp) ((fp) & 0x7FFFFFL) #define PACK(s,e,m) ((s) | ((e) << 23L) | (m)) - + /* FUNCTIONS *****************************************************************/ BOOL @@ -144,14 +144,14 @@ FtoEF( EFLOAT_S * efp, FLOATL f) #endif Exp = EXP(worker.l); - Mant = MANT(worker.l); + Mant = MANT(worker.l); if (SIGN(worker.l)) Sign = -1; //// M$ storage emulation Mant = ((Mant << 7) | 0x40000000); - Mant ^= Sign; + Mant ^= Sign; Mant -= Sign; Exp -= (EXCESS-1); -//// +//// efp->lMant = Mant; efp->lExp = Exp; } @@ -175,7 +175,7 @@ FLOATOBJ_Add ( FtoEF( efp, f.l ); #else FtoEF( efp, f.f ); -#endif +#endif } VOID @@ -278,7 +278,7 @@ FLOATOBJ_Div( FtoEF( efp, f.l ); #else FtoEF( efp, f.f ); -#endif +#endif } VOID @@ -339,7 +339,7 @@ FLOATOBJ_Equal( gxf_long f1; f.l = EFtoF(efp); f1.l = EFtoF(efp1); - if (f.f == f1.f) return TRUE; + if (f.f == f1.f) return TRUE; return FALSE; } @@ -354,7 +354,7 @@ FLOATOBJ_EqualLong( EFLOAT_S * efp = (EFLOAT_S *)pf; gxf_long f; f.l = EFtoF(efp); - if (f.f == l) return TRUE; + if (f.f == l) return TRUE; return FALSE; } @@ -375,10 +375,10 @@ FLOATOBJ_GetLong ( IN PFLOATOBJ pf ) EFLOAT_S * efp = (EFLOAT_S *)pf; gxf_long f; long l; - + f.l = EFtoF( efp ); FLOAT_TO_INT(f.f, l); // Let FPP handle it the fasty haxy way. - + return l; } @@ -396,7 +396,7 @@ FLOATOBJ_GreaterThan( gxf_long f1; f.l = EFtoF(efp); f1.l = EFtoF(efp1); - if(f.f > f1.f) return TRUE; + if(f.f > f1.f) return TRUE; return FALSE; } @@ -411,7 +411,7 @@ FLOATOBJ_GreaterThanLong( EFLOAT_S * efp = (EFLOAT_S *)pf; gxf_long f; f.l = EFtoF(efp); - if (f.f > l) return TRUE; + if (f.f > l) return TRUE; return FALSE; } @@ -429,7 +429,7 @@ FLOATOBJ_LessThan( gxf_long f1; f.l = EFtoF(efp); f1.l = EFtoF(efp1); - if(f.f < f1.f) return TRUE; + if(f.f < f1.f) return TRUE; return FALSE; } @@ -444,7 +444,7 @@ FLOATOBJ_LessThanLong( EFLOAT_S * efp = (EFLOAT_S *)pf; gxf_long f; f.l = EFtoF(efp); - if (f.f < l) return TRUE; + if (f.f < l) return TRUE; return FALSE; } @@ -467,7 +467,7 @@ FLOATOBJ_Mul( FtoEF( efp, f.l ); #else FtoEF( efp, f.f ); -#endif +#endif } VOID @@ -550,7 +550,7 @@ FLOATOBJ_SetLong( FtoEF( efp, f.l ); #else FtoEF( efp, f.f ); -#endif +#endif } VOID @@ -572,7 +572,7 @@ FLOATOBJ_Sub( FtoEF( efp, f.l ); #else FtoEF( efp, f.f ); -#endif +#endif } VOID diff --git a/reactos/subsystems/win32/win32k/eng/mouse.c b/reactos/subsystems/win32/win32k/eng/mouse.c index 9a896162e65..67cd688167a 100644 --- a/reactos/subsystems/win32/win32k/eng/mouse.c +++ b/reactos/subsystems/win32/win32k/eng/mouse.c @@ -153,25 +153,25 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface) return; } - + pgp->Enabled = FALSE; - + /* - * The mouse is hide from ShowCours and it is frist ?? + * The mouse is hide from ShowCours and it is frist ?? */ if (pgp->ShowPointer < 0) { return ; } - + /* * Hide the cours */ pt.x = pgp->Pos.x - pgp->HotSpot.x; pt.y = pgp->Pos.y - pgp->HotSpot.y; - + if (pgp->SaveSurface != NULL) { @@ -222,17 +222,17 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface) { return; } - + pgp->Enabled = TRUE; - + /* - * Do not blt the mouse if it in hide + * Do not blt the mouse if it in hide */ if (pgp->ShowPointer < 0) { return ; } - + pt.x = pgp->Pos.x - pgp->HotSpot.x; pt.y = pgp->Pos.y - pgp->HotSpot.y; @@ -265,7 +265,7 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface) } - /* + /* * Blit the cursor on the screen. */ @@ -304,14 +304,14 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface) } } else - { + { IntEngBitBltEx(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject, &DestRect, &SrcPoint, NULL, NULL, NULL, ROP3_TO_ROP4(SRCAND), FALSE); SrcPoint.y += pgp->Size.cy; IntEngBitBltEx(DestSurface, MaskSurf, NULL, NULL, pgp->XlateObject, &DestRect, &SrcPoint, NULL, NULL, NULL, - ROP3_TO_ROP4(SRCINVERT), FALSE); + ROP3_TO_ROP4(SRCINVERT), FALSE); } EngUnlockSurface(MaskSurf); } @@ -418,7 +418,7 @@ EngSetPointerShape( { return SPS_ERROR; } - + memcpy(Bits, psoColor->pvBits, psoColor->cjBits); pgp->ColorSurface = (HSURF)EngCreateBitmap(pgp->Size, @@ -441,7 +441,7 @@ EngSetPointerShape( { return SPS_ERROR; } - + memcpy(Bits, psoMask->pvBits, psoMask->cjBits); pgp->MaskSurface = (HSURF)EngCreateBitmap(Size, diff --git a/reactos/subsystems/win32/win32k/eng/surface.c b/reactos/subsystems/win32/win32k/eng/surface.c index 9a0a55689ff..4691fa9670d 100644 --- a/reactos/subsystems/win32/win32k/eng/surface.c +++ b/reactos/subsystems/win32/win32k/eng/surface.c @@ -122,12 +122,12 @@ EngCreateDeviceBitmap(IN DHSURF dhsurf, SURFOBJ *SurfObj; NewBitmap = EngCreateBitmap(Size, DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(Format)), Format, 0, NULL); - if(!NewBitmap) + if(!NewBitmap) { DPRINT1("EngCreateBitmap failed\n"); return 0; } - + SurfObj = EngLockSurface((HSURF)NewBitmap); SurfObj->dhsurf = dhsurf; EngUnlockSurface(SurfObj); diff --git a/reactos/subsystems/win32/win32k/eng/xlate.c b/reactos/subsystems/win32/win32k/eng/xlate.c index eef2457da3d..3e8bdf62071 100644 --- a/reactos/subsystems/win32/win32k/eng/xlate.c +++ b/reactos/subsystems/win32/win32k/eng/xlate.c @@ -282,11 +282,11 @@ end: if (PaletteDest != PaletteSource) if (DestPalGDI != NULL) PALETTE_UnlockPalette(DestPalGDI); - - + + if (PaletteSource != NULL) PALETTE_UnlockPalette(SourcePalGDI); - + return XlateObj; } @@ -500,7 +500,7 @@ XLATEOBJ_iXlate(XLATEOBJ *XlateObj, ULONG Color) if (XlateObj->flXlate & XO_TRIVIAL) return Color; - + if (XlateObj->flXlate & XO_TABLE) { if (Color >= XlateObj->cEntries) diff --git a/reactos/subsystems/win32/win32k/include/brush.h b/reactos/subsystems/win32/win32k/include/brush.h index d948ea64d75..015c614ebb3 100644 --- a/reactos/subsystems/win32/win32k/include/brush.h +++ b/reactos/subsystems/win32/win32k/include/brush.h @@ -65,13 +65,13 @@ typedef struct #define GDIBRUSH_IS_SOLID 0x0010 /* Solid brush */ #define GDIBRUSH_IS_HATCH 0x0020 /* Hatch brush */ #define GDIBRUSH_IS_BITMAP 0x0040 /* DDB pattern brush */ -#define GDIBRUSH_IS_DIB 0x0080 /* DIB pattern brush */ +#define GDIBRUSH_IS_DIB 0x0080 /* DIB pattern brush */ #define GDIBRUSH_IS_NULL 0x0100 /* Null/hollow brush */ #define GDIBRUSH_IS_GLOBAL 0x0200 /* Stock objects */ #define GDIBRUSH_IS_PEN 0x0400 /* Pen */ #define GDIBRUSH_IS_OLDSTYLEPEN 0x0800 /* Geometric pen */ #define GDIBRUSH_IS_MASKING 0x8000 /* Pattern bitmap is used as transparent mask (?) */ -#define GDIBRUSH_CACHED_IS_SOLID 0x80000000 +#define GDIBRUSH_CACHED_IS_SOLID 0x80000000 #define BRUSHOBJ_AllocBrush() ((HBRUSH) GDIOBJ_AllocObj (GdiHandleTable, GDI_OBJECT_TYPE_BRUSH)) #define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) diff --git a/reactos/subsystems/win32/win32k/include/clipboard.h b/reactos/subsystems/win32/win32k/include/clipboard.h index 4d2f18670a1..caa25faafcf 100644 --- a/reactos/subsystems/win32/win32k/include/clipboard.h +++ b/reactos/subsystems/win32/win32k/include/clipboard.h @@ -14,8 +14,8 @@ typedef struct _ClipboardChainElement typedef struct _ClipboardElement { UINT format; - HANDLE hData; - DWORD size; // data may be delayed o synth render + HANDLE hData; + DWORD size; // data may be delayed o synth render struct _ClipboardElement *next; } CLIPBOARDELEMENT, *PCLIPBOARDELEMENT; @@ -31,16 +31,16 @@ typedef struct _CLIPBOARDSYSTEM BOOL delayedRender; UINT lastEnumClipboardFormats; DWORD ClipboardSequenceNumber; - + PCLIPBOARDCHAINELEMENT WindowsChain; PCLIPBOARDELEMENT ClipboardData; - + PCHAR synthesizedData; DWORD synthesizedDataSize; - + } CLIPBOARDSYSTEM, *PCLIPBOARDSYSTEM; -VOID FASTCALL +VOID FASTCALL IntClipboardFreeWindow(PWINDOW_OBJECT window); /* diff --git a/reactos/subsystems/win32/win32k/include/cursoricon.h b/reactos/subsystems/win32/win32k/include/cursoricon.h index ec5126867cc..34ae5c9c0b4 100644 --- a/reactos/subsystems/win32/win32k/include/cursoricon.h +++ b/reactos/subsystems/win32/win32k/include/cursoricon.h @@ -56,8 +56,8 @@ typedef struct _SYSTEM_CURSORINFO UINT MouseHoverWidth; UINT MouseHoverHeight; - UINT MouseSpeed; - CURSORACCELERATION_INFO CursorAccelerationInfo; + UINT MouseSpeed; + CURSORACCELERATION_INFO CursorAccelerationInfo; DWORD LastBtnDown; LONG LastBtnDownX; @@ -73,7 +73,7 @@ VOID FASTCALL IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Pro BOOL FASTCALL IntGetCursorLocation(PWINSTATION_OBJECT WinStaObject, POINT *loc); -BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth, +BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth, INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags); PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon); diff --git a/reactos/subsystems/win32/win32k/include/dc.h b/reactos/subsystems/win32/win32k/include/dc.h index cd4c7442b1e..daff361ba40 100644 --- a/reactos/subsystems/win32/win32k/include/dc.h +++ b/reactos/subsystems/win32/win32k/include/dc.h @@ -92,8 +92,8 @@ typedef struct _DC HPALETTE PalIndexed; WIN_DC_INFO w; - - HANDLE hFile; + + HANDLE hFile; LPENHMETAHEADER emh; } DC, *PDC; @@ -109,7 +109,7 @@ typedef struct _GDIPOINTER /* should stay private to ENG */ HSURF MaskSurface; HSURF SaveSurface; int ShowPointer; /* counter negtive do not show the mouse postive show the mouse */ - + /* public pointer information */ RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */ PGD_MOVEPOINTER MovePointer; diff --git a/reactos/subsystems/win32/win32k/include/dce.h b/reactos/subsystems/win32/win32k/include/dce.h index 7257797e239..d94e94ff56a 100644 --- a/reactos/subsystems/win32/win32k/include/dce.h +++ b/reactos/subsystems/win32/win32k/include/dce.h @@ -44,7 +44,7 @@ typedef struct tagDCE #define DCX_KEEPCLIPRGN 0x00040000 #define DCX_NOCLIPCHILDREN 0x00080000 #define DCX_NORECOMPUTE 0x00100000 - + BOOL FASTCALL DCE_Cleanup(PDCE pDce); PDCE FASTCALL DceAllocDCE(PWINDOW_OBJECT Window, DCE_TYPE Type); PDCE FASTCALL DCE_FreeDCE(PDCE dce); diff --git a/reactos/subsystems/win32/win32k/include/desktop.h b/reactos/subsystems/win32/win32k/include/desktop.h index 7a877b025a8..05a7a60de4d 100644 --- a/reactos/subsystems/win32/win32k/include/desktop.h +++ b/reactos/subsystems/win32/win32k/include/desktop.h @@ -45,7 +45,7 @@ InitDesktopImpl(VOID); NTSTATUS FASTCALL CleanupDesktopImpl(VOID); - + NTSTATUS STDCALL IntDesktopObjectParse(IN PVOID ParseObject, @@ -74,7 +74,7 @@ IntGetScreenDC(VOID); HWND FASTCALL IntGetDesktopWindow (VOID); -PWINDOW_OBJECT FASTCALL +PWINDOW_OBJECT FASTCALL UserGetDesktopWindow(VOID); HWND FASTCALL diff --git a/reactos/subsystems/win32/win32k/include/driver.h b/reactos/subsystems/win32/win32k/include/driver.h index 0a3e64332f1..3b976755095 100644 --- a/reactos/subsystems/win32/win32k/include/driver.h +++ b/reactos/subsystems/win32/win32k/include/driver.h @@ -17,34 +17,34 @@ typedef DHPDEV (NTAPI *PGD_ENABLEPDEV)(DEVMODEW *, LPWSTR, HANDLE); typedef VOID (NTAPI *PGD_COMPLETEPDEV)(DHPDEV, HDEV); -typedef VOID (NTAPI *PGD_DISABLEPDEV)(DHPDEV); +typedef VOID (NTAPI *PGD_DISABLEPDEV)(DHPDEV); typedef HSURF (NTAPI *PGD_ENABLESURFACE)(DHPDEV); typedef VOID (NTAPI *PGD_DISABLESURFACE)(DHPDEV); typedef BOOL (NTAPI *PGD_ASSERTMODE)(DHPDEV, BOOL); typedef BOOL (NTAPI *PGD_OFFSET)(SURFOBJ*, LONG, LONG, FLONG); typedef BOOL (NTAPI *PGD_RESETPDEV)(DHPDEV, DHPDEV); typedef VOID (NTAPI *PGD_DISABLEDRIVER)(VOID); -typedef HBITMAP (NTAPI *PGD_CREATEDEVICEBITMAP)(DHPDEV, SIZEL, ULONG); -typedef VOID (NTAPI *PGD_DELETEDEVICEBITMAP)(DHSURF); +typedef HBITMAP (NTAPI *PGD_CREATEDEVICEBITMAP)(DHPDEV, SIZEL, ULONG); +typedef VOID (NTAPI *PGD_DELETEDEVICEBITMAP)(DHSURF); typedef BOOL (NTAPI *PGD_ALPHABLEND)(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, RECTL*, BLENDOBJ*); typedef BOOL (NTAPI *PGD_REALIZEBRUSH)(BRUSHOBJ*, SURFOBJ*, SURFOBJ*, SURFOBJ*, - XLATEOBJ*, ULONG); -typedef ULONG (NTAPI *PGD_DITHERCOLOR)(DHPDEV, ULONG, ULONG, PULONG); + XLATEOBJ*, ULONG); +typedef ULONG (NTAPI *PGD_DITHERCOLOR)(DHPDEV, ULONG, ULONG, PULONG); typedef BOOL (NTAPI *PGD_STROKEPATH)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, - BRUSHOBJ*, POINTL*, PLINEATTRS, MIX); + BRUSHOBJ*, POINTL*, PLINEATTRS, MIX); typedef BOOL (NTAPI *PGD_FILLPATH)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, BRUSHOBJ*, - POINTL*, MIX, ULONG); + POINTL*, MIX, ULONG); typedef BOOL (NTAPI *PGD_STROKEANDFILLPATH)(SURFOBJ*, PATHOBJ*, CLIPOBJ*, XFORMOBJ*, BRUSHOBJ*, PLINEATTRS, - BRUSHOBJ*, POINTL*, MIX, ULONG); -typedef BOOL (NTAPI *PGD_PAINT)(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*, MIX); + BRUSHOBJ*, POINTL*, MIX, ULONG); +typedef BOOL (NTAPI *PGD_PAINT)(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, POINTL*, MIX); typedef BOOL (NTAPI *PGD_BITBLT)(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, POINTL*, POINTL*, BRUSHOBJ*, - POINTL*, ROP4); + POINTL*, ROP4); typedef BOOL (NTAPI *PGD_TRANSPARENTBLT)(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, RECTL*, RECTL*, ULONG, ULONG); typedef BOOL (NTAPI *PGD_COPYBITS)(SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, - RECTL*, POINTL*); + RECTL*, POINTL*); typedef BOOL (NTAPI *PGD_STRETCHBLT)(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, COLORADJUSTMENT*, POINTL*, RECTL*, RECTL*, POINTL*, ULONG); @@ -52,19 +52,19 @@ typedef BOOL (NTAPI *PGD_STRETCHBLTROP)(SURFOBJ*, SURFOBJ*, SURFOBJ*, CLIPOBJ*, XLATEOBJ*, COLORADJUSTMENT*, POINTL*, RECTL*, RECTL*, POINTL*, ULONG, BRUSHOBJ*, DWORD); -typedef BOOL (NTAPI *PGD_SETPALETTE)(DHPDEV, PALOBJ*, ULONG, ULONG, ULONG); +typedef BOOL (NTAPI *PGD_SETPALETTE)(DHPDEV, PALOBJ*, ULONG, ULONG, ULONG); typedef BOOL (NTAPI *PGD_TEXTOUT)(SURFOBJ*, STROBJ*, FONTOBJ*, CLIPOBJ*, RECTL*, - RECTL*, BRUSHOBJ*, BRUSHOBJ*, POINTL*, MIX); -typedef ULONG (NTAPI *PGD_ESCAPE)(SURFOBJ*, ULONG, ULONG, PVOID *, ULONG, PVOID *); -typedef ULONG (NTAPI *PGD_DRAWESCAPE)(SURFOBJ*, ULONG, CLIPOBJ*, RECTL*, ULONG, - PVOID *); -typedef PIFIMETRICS (NTAPI *PGD_QUERYFONT)(DHPDEV, ULONG, ULONG, PULONG); -typedef PVOID (NTAPI *PGD_QUERYFONTTREE)(DHPDEV, ULONG, ULONG, ULONG, PULONG); + RECTL*, BRUSHOBJ*, BRUSHOBJ*, POINTL*, MIX); +typedef ULONG (NTAPI *PGD_ESCAPE)(SURFOBJ*, ULONG, ULONG, PVOID *, ULONG, PVOID *); +typedef ULONG (NTAPI *PGD_DRAWESCAPE)(SURFOBJ*, ULONG, CLIPOBJ*, RECTL*, ULONG, + PVOID *); +typedef PIFIMETRICS (NTAPI *PGD_QUERYFONT)(DHPDEV, ULONG, ULONG, PULONG); +typedef PVOID (NTAPI *PGD_QUERYFONTTREE)(DHPDEV, ULONG, ULONG, ULONG, PULONG); typedef LONG (NTAPI *PGD_QUERYFONTDATA)(DHPDEV, FONTOBJ*, ULONG, HGLYPH, GLYPHDATA*, - PVOID, ULONG); + PVOID, ULONG); typedef ULONG (NTAPI *PGD_SETPOINTERSHAPE)(SURFOBJ*, SURFOBJ*, SURFOBJ*, XLATEOBJ*, - LONG, LONG, LONG, LONG, RECTL*, ULONG); -typedef VOID (NTAPI *PGD_MOVEPOINTER)(SURFOBJ*, LONG, LONG, RECTL*); + LONG, LONG, LONG, LONG, RECTL*, ULONG); +typedef VOID (NTAPI *PGD_MOVEPOINTER)(SURFOBJ*, LONG, LONG, RECTL*); typedef BOOL (NTAPI *PGD_LINETO)(SURFOBJ*, CLIPOBJ*, BRUSHOBJ*, LONG, LONG, LONG, LONG, RECTL*, MIX); typedef BOOL (NTAPI *PGD_SENDPAGE)(SURFOBJ*); @@ -179,7 +179,7 @@ BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver); PGD_ENABLEDRIVER DRIVER_FindExistingDDIDriver(LPCWSTR Name); PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name); PFILE_OBJECT DRIVER_FindMPDriver(ULONG DisplayNumber); -BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA DED, +BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA DED, PDRIVER_FUNCTIONS DF); BOOL DRIVER_UnregisterDriver(LPCWSTR Name); INT DRIVER_ReferenceDriver (LPCWSTR Name); diff --git a/reactos/subsystems/win32/win32k/include/gdiobj.h b/reactos/subsystems/win32/win32k/include/gdiobj.h index 5e2d4ad1e8a..925ef2bbeda 100644 --- a/reactos/subsystems/win32/win32k/include/gdiobj.h +++ b/reactos/subsystems/win32/win32k/include/gdiobj.h @@ -44,7 +44,7 @@ typedef struct _GDIOBJHDR } GDIOBJHDR, *PGDIOBJHDR; // -// Every GDI Object must have this standard type of header. +// Every GDI Object must have this standard type of header. // It's for thread locking. // This header is standalone, used only in gdiobj.c. // diff --git a/reactos/subsystems/win32/win32k/include/input.h b/reactos/subsystems/win32/win32k/include/input.h index c03bc0250d3..790e0ec87be 100644 --- a/reactos/subsystems/win32/win32k/include/input.h +++ b/reactos/subsystems/win32/win32k/include/input.h @@ -6,7 +6,7 @@ typedef struct _KBL { LIST_ENTRY List; - DWORD Flags; + DWORD Flags; WCHAR Name[KL_NAMELENGTH]; // used w GetKeyboardLayoutName same as wszKLID. struct _KBDTABLES* KBTables; // KBDTABLES in ntoskrnl/include/internal/kbd.h HANDLE hModule; diff --git a/reactos/subsystems/win32/win32k/include/intddraw.h b/reactos/subsystems/win32/win32k/include/intddraw.h index 18cc29af105..82ce0d6acf4 100644 --- a/reactos/subsystems/win32/win32k/include/intddraw.h +++ b/reactos/subsystems/win32/win32k/include/intddraw.h @@ -72,21 +72,21 @@ typedef struct DD_MISCELLANEOUSCALLBACKS Misc; /* NT-based Callback */ - PDD_FLIPTOGDISURFACE DdFlipToGDISurface; - PDD_FREEDRIVERMEMORY DdFreeDriverMemory; - PDD_SETEXCLUSIVEMODE DdSetExclusiveMode; + PDD_FLIPTOGDISURFACE DdFlipToGDISurface; + PDD_FREEDRIVERMEMORY DdFreeDriverMemory; + PDD_SETEXCLUSIVEMODE DdSetExclusiveMode; /*.Motion Compensation .*/ - PDD_MOCOMPCB_BEGINFRAME DdMoCompBeginFrame; - PDD_MOCOMPCB_CREATE DdMoCompCreate; - PDD_MOCOMPCB_DESTROY DdMoCompDestroy; + PDD_MOCOMPCB_BEGINFRAME DdMoCompBeginFrame; + PDD_MOCOMPCB_CREATE DdMoCompCreate; + PDD_MOCOMPCB_DESTROY DdMoCompDestroy; PDD_MOCOMPCB_ENDFRAME DdMoCompEndFrame; - PDD_MOCOMPCB_GETCOMPBUFFINFO DdMoCompGetBuffInfo; + PDD_MOCOMPCB_GETCOMPBUFFINFO DdMoCompGetBuffInfo; PDD_MOCOMPCB_GETFORMATS DdMoCompGetFormats; - PDD_MOCOMPCB_GETGUIDS DdMoCompGetGuids; - PDD_MOCOMPCB_GETINTERNALINFO DdMoCompGetInternalInfo; - PDD_MOCOMPCB_QUERYSTATUS DdMoCompQueryStatus; - PDD_MOCOMPCB_RENDER DdMoCompRender; + PDD_MOCOMPCB_GETGUIDS DdMoCompGetGuids; + PDD_MOCOMPCB_GETINTERNALINFO DdMoCompGetInternalInfo; + PDD_MOCOMPCB_QUERYSTATUS DdMoCompQueryStatus; + PDD_MOCOMPCB_RENDER DdMoCompRender; /* Video Port Callback */ PDD_VPORTCB_CANCREATEVIDEOPORT DdVideoPortCanCreate; @@ -113,7 +113,7 @@ typedef struct DWORD dwNumFourCC; LPDWORD pdwFourCC; - + } DD_DIRECTDRAW, *PDD_DIRECTDRAW; diff --git a/reactos/subsystems/win32/win32k/include/intgdi.h b/reactos/subsystems/win32/win32k/include/intgdi.h index 3b3b61ad9eb..6bb6942a134 100644 --- a/reactos/subsystems/win32/win32k/include/intgdi.h +++ b/reactos/subsystems/win32/win32k/include/intgdi.h @@ -122,8 +122,8 @@ IntGdiPolyPolygon(DC *dc, int Count); BOOL FASTCALL IntGdiGradientFill(DC *dc, - PTRIVERTEX pVertex, - ULONG uVertex, + PTRIVERTEX pVertex, + ULONG uVertex, PVOID pMesh, ULONG uMesh, ULONG ulMode); /* Rgn functions */ @@ -285,7 +285,7 @@ IntGetPaletteEntries(HPALETTE hpal, UINT Entries, LPPALETTEENTRY pe); -UINT STDCALL +UINT STDCALL IntSetPaletteEntries(HPALETTE hpal, UINT Start, UINT Entries, diff --git a/reactos/subsystems/win32/win32k/include/object.h b/reactos/subsystems/win32/win32k/include/object.h index 615ae97d895..17346a2f3fb 100644 --- a/reactos/subsystems/win32/win32k/include/object.h +++ b/reactos/subsystems/win32/win32k/include/object.h @@ -47,7 +47,7 @@ typedef enum _USER_OBJECT_TYPE otCallProc = 7, otAccel, otMonitor = 12 - + } USER_OBJECT_TYPE; diff --git a/reactos/subsystems/win32/win32k/include/tags.h b/reactos/subsystems/win32/win32k/include/tags.h index 708e5fa2209..3d05b1cbbaa 100644 --- a/reactos/subsystems/win32/win32k/include/tags.h +++ b/reactos/subsystems/win32/win32k/include/tags.h @@ -25,7 +25,7 @@ #define TAG_CALLBACK TAG('C', 'B', 'C', 'K') /* callback memory */ #define TAG_WINSTA TAG('W', 'S', 'T', 'A') /* window station */ #define TAG_PDCE TAG('U', 's', 'd', 'c') /* dce */ - + /* objects */ #define TAG_BEZIER TAG('B', 'E', 'Z', 'R') /* bezier */ #define TAG_BITMAP TAG('B', 'T', 'M', 'P') /* bitmap */ diff --git a/reactos/subsystems/win32/win32k/include/userfuncs.h b/reactos/subsystems/win32/win32k/include/userfuncs.h index 7b38941d05b..ce8598c181d 100644 --- a/reactos/subsystems/win32/win32k/include/userfuncs.h +++ b/reactos/subsystems/win32/win32k/include/userfuncs.h @@ -66,7 +66,7 @@ PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd); PVOID FASTCALL ObmCreateObject(PUSER_HANDLE_TABLE ht, HANDLE* h,USER_OBJECT_TYPE type , ULONG size); -BOOL FASTCALL +BOOL FASTCALL ObmDeleteObject(HANDLE h, USER_OBJECT_TYPE type ); #define UserRefObject(o) ObmReferenceObject(o) @@ -141,14 +141,14 @@ UserSystemParametersInfo( UINT uiParam, PVOID pvParam, UINT fWinIni); - + /*************** MESSAGE.C ***************/ - + BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, - LPARAM lParam); + LPARAM lParam); @@ -191,14 +191,14 @@ BOOL FASTCALL UserDestroyMenu(HMENU hMenu); - - + + /*************** SCROLLBAR.C ***************/ - + DWORD FASTCALL co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow); - + #endif /* _WIN32K_USERFUNCS_H */ /* EOF */ diff --git a/reactos/subsystems/win32/win32k/include/winsta.h b/reactos/subsystems/win32/win32k/include/winsta.h index d6a2d2e98d5..64ab8610d5a 100644 --- a/reactos/subsystems/win32/win32k/include/winsta.h +++ b/reactos/subsystems/win32/win32k/include/winsta.h @@ -33,7 +33,7 @@ typedef struct _WINSTATION_OBJECT UINT CaretBlinkRate; HANDLE ShellWindow; HANDLE ShellListView; - + BOOL FlatMenu; /* ScreenSaver */ BOOL ScreenSaverRunning; @@ -51,7 +51,7 @@ typedef struct _WINSTATION_OBJECT PCLIPBOARDSYSTEM Clipboard; DWORD ClipboardSequenceNumber; - + } WINSTATION_OBJECT, *PWINSTATION_OBJECT; extern WINSTATION_OBJECT *InputWindowStation; diff --git a/reactos/subsystems/win32/win32k/ldr/loader.c b/reactos/subsystems/win32/win32k/ldr/loader.c index 429b0c97ce0..18880e82879 100644 --- a/reactos/subsystems/win32/win32k/ldr/loader.c +++ b/reactos/subsystems/win32/win32k/ldr/loader.c @@ -213,7 +213,7 @@ EngLoadModule(LPWSTR ModuleName) // FIXME: should load as readonly RtlInitUnicodeString (&GdiDriverInfo.DriverName, ModuleName); - Status = ZwSetSystemInformation (SystemLoadGdiDriverInformation, + Status = ZwSetSystemInformation (SystemLoadGdiDriverInformation, &GdiDriverInfo, sizeof(SYSTEM_GDI_DRIVER_INFORMATION)); if (!NT_SUCCESS(Status)) return NULL; @@ -225,16 +225,16 @@ STDCALL EngUnloadImage ( IN HANDLE hModule ) { NTSTATUS Status; - + DPRINT1("hModule=%x\n", hModule); - Status = ZwSetSystemInformation(SystemUnloadGdiDriverInformation, + Status = ZwSetSystemInformation(SystemUnloadGdiDriverInformation, &hModule, sizeof(HANDLE)); - + if(!NT_SUCCESS(Status)) { - DPRINT1("%s: ZwSetSystemInformation failed with status %x.", + DPRINT1("%s: ZwSetSystemInformation failed with status %x.", __FUNCTION__, Status); - } + } } /* EOF */ diff --git a/reactos/subsystems/win32/win32k/main/dllmain.c b/reactos/subsystems/win32/win32k/main/dllmain.c index 3940ad90156..5f0901a791b 100644 --- a/reactos/subsystems/win32/win32k/main/dllmain.c +++ b/reactos/subsystems/win32/win32k/main/dllmain.c @@ -40,20 +40,20 @@ extern ULONG_PTR Win32kSSDT[]; extern UCHAR Win32kSSPT[]; extern ULONG Win32kNumberOfSysCalls; -NTSTATUS +NTSTATUS STDCALL Win32kProcessCallback(struct _EPROCESS *Process, BOOLEAN Create) { PW32PROCESS Win32Process; DECLARE_RETURN(NTSTATUS); - + DPRINT("Enter Win32kProcessCallback\n"); UserEnterExclusive(); - + /* Get the Win32 Process */ Win32Process = PsGetProcessWin32Process(Process); - + /* Allocate one if needed */ if (!Win32Process) { @@ -65,7 +65,7 @@ Win32kProcessCallback(struct _EPROCESS *Process, if (Win32Process == NULL) RETURN( STATUS_NO_MEMORY); RtlZeroMemory(Win32Process, sizeof(W32PROCESS)); - + PsSetProcessWin32Process(Process, Win32Process); /* FIXME - unlock the process */ } @@ -129,7 +129,7 @@ Win32kProcessCallback(struct _EPROCESS *Process, IntCleanupCurIcons(Process, Win32Process); IntEngCleanupDriverObjs(Process, Win32Process); CleanupMonitorImpl(); - + /* no process windows should exist at this point, or the function will assert! */ DestroyProcessClasses(Win32Process); @@ -153,7 +153,7 @@ Win32kProcessCallback(struct _EPROCESS *Process, } RETURN( STATUS_SUCCESS); - + CLEANUP: UserLeave(); DPRINT("Leave Win32kProcessCallback, ret=%i\n",_ret_); @@ -161,7 +161,7 @@ CLEANUP: } -NTSTATUS +NTSTATUS STDCALL Win32kThreadCallback(struct _ETHREAD *Thread, PSW32THREADCALLOUTTYPE Type) @@ -169,15 +169,15 @@ Win32kThreadCallback(struct _ETHREAD *Thread, struct _EPROCESS *Process; PW32THREAD Win32Thread; DECLARE_RETURN(NTSTATUS); - + DPRINT("Enter Win32kThreadCallback\n"); UserEnterExclusive(); Process = Thread->ThreadsProcess; - + /* Get the Win32 Thread */ Win32Thread = PsGetThreadWin32Thread(Thread); - + /* Allocate one if needed */ if (!Win32Thread) { @@ -189,7 +189,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, if (Win32Thread == NULL) RETURN( STATUS_NO_MEMORY); RtlZeroMemory(Win32Thread, sizeof(W32THREAD)); - + PsSetThreadWin32Thread(Thread, Win32Thread); /* FIXME - unlock the process */ } @@ -268,7 +268,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, else { PSINGLE_LIST_ENTRY e; - + DPRINT("Destroying W32 thread TID:%d at IRQ level: %lu\n", Thread->Cid.UniqueThread, KeGetCurrentIrql()); Win32Thread->IsExiting = TRUE; @@ -287,7 +287,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, PUSER_REFERENCE_ENTRY ref = CONTAINING_RECORD(e, USER_REFERENCE_ENTRY, Entry); DPRINT("thread clean: remove reference obj 0x%x\n",ref->obj); ObmDereferenceObject(ref->obj); - + e = PopEntryList(&Win32Thread->ReferencesList); } @@ -304,7 +304,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, } RETURN( STATUS_SUCCESS); - + CLEANUP: UserLeave(); DPRINT("Leave Win32kThreadCallback, ret=%i\n",_ret_); @@ -385,7 +385,7 @@ DriverEntry ( CalloutData.DesktopDeleteProcedure = IntDesktopObjectDelete; CalloutData.ProcessCallout = Win32kProcessCallback; CalloutData.ThreadCallout = Win32kThreadCallback; - CalloutData.BatchFlushRoutine = NtGdiFlushUserBatch; + CalloutData.BatchFlushRoutine = NtGdiFlushUserBatch; /* * Register our per-process and per-thread structures. diff --git a/reactos/subsystems/win32/win32k/misc/copy.c b/reactos/subsystems/win32/win32k/misc/copy.c index bfa2568db4d..30dc19206df 100644 --- a/reactos/subsystems/win32/win32k/misc/copy.c +++ b/reactos/subsystems/win32/win32k/misc/copy.c @@ -2,7 +2,7 @@ NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) { NTSTATUS Status = STATUS_SUCCESS; - + _SEH_TRY { //ProbeForRead(Source,Bytes,1); RtlCopyMemory(Target,Source,Bytes); @@ -15,7 +15,7 @@ NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) { NTSTATUS _MmCopyToCaller( PVOID Target, PVOID Source, UINT Bytes ) { NTSTATUS Status = STATUS_SUCCESS; - + _SEH_TRY { //ProbeForWrite(Target,Bytes,1); RtlCopyMemory(Target,Source,Bytes); diff --git a/reactos/subsystems/win32/win32k/misc/driver.c b/reactos/subsystems/win32/win32k/misc/driver.c index c11366b4e2a..6e987b2d8cd 100644 --- a/reactos/subsystems/win32/win32k/misc/driver.c +++ b/reactos/subsystems/win32/win32k/misc/driver.c @@ -54,13 +54,13 @@ BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver) Driver->Name = ExAllocatePoolWithTag(PagedPool, (wcslen(Name) + 1) * sizeof(WCHAR), TAG_DRIVER); - if (Driver->Name == NULL) + if (Driver->Name == NULL) { DPRINT1("Out of memory\n"); ExFreePool(Driver); return FALSE; } - + wcscpy(Driver->Name, Name); Driver->Next = DriverList; DriverList = Driver; diff --git a/reactos/subsystems/win32/win32k/ntddraw/dd.c b/reactos/subsystems/win32/win32k/ntddraw/dd.c index 135f6724b67..b8b8112c044 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/dd.c +++ b/reactos/subsystems/win32/win32k/ntddraw/dd.c @@ -15,7 +15,7 @@ #define DdHandleTable GdiHandleTable -/* +/* DdMapMemory, DdDestroyDriver are not exported as NtGdi calls This file is complete for DD_CALLBACKS setup @@ -267,7 +267,7 @@ DWORD STDCALL NtGdiDdCreateSurface( pLocal->lpAttachList; pLocal->lpAttachListFrom; */ - + /* FIXME: a countup to next pLocal, pMore, pGlobal */ } @@ -412,7 +412,7 @@ DWORD STDCALL NtGdiDdWaitForVerticalBlank( { pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); - if (pDirectDraw != NULL) + if (pDirectDraw != NULL) { if (pDirectDraw->DD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK) { @@ -451,10 +451,10 @@ DWORD STDCALL NtGdiDdCanCreateSurface( ) { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; - - if ((puCanCreateSurfaceData) && + + if ((puCanCreateSurfaceData) && (hDirectDrawLocal)) { DDSURFACEDESC desc; @@ -488,11 +488,11 @@ DWORD STDCALL NtGdiDdCanCreateSurface( } _SEH_END; - if ((NT_SUCCESS(Status)) && + if ((NT_SUCCESS(Status)) && (desc.dwSize != 0)) { pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); - if ((pDirectDraw) && + if ((pDirectDraw) && (pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE)) { CanCreateSurfaceData.ddRVal = DDERR_GENERIC; @@ -528,7 +528,7 @@ DWORD STDCALL NtGdiDdCanCreateSurface( /* status : This func is now documented in MSDN, and now it's compatible*/ /* with Windows 2000 implementation */ /************************************************************************/ -DWORD STDCALL +DWORD STDCALL NtGdiDdGetScanLine( HANDLE hDirectDrawLocal, PDD_GETSCANLINEDATA puGetScanLineData) { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; diff --git a/reactos/subsystems/win32/win32k/ntddraw/ddraw.c b/reactos/subsystems/win32/win32k/ntddraw/ddraw.c index 7bbef10e399..eb28e18ed14 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/ddraw.c +++ b/reactos/subsystems/win32/win32k/ntddraw/ddraw.c @@ -73,14 +73,14 @@ intEnableDriver(PDD_DIRECTDRAW pDirectDraw) pDirectDraw->pdwFourCC = NULL; pDirectDraw->pvmList = NULL; - /* Get DirectDraw infomations form the driver - * DDK say pvmList, pdwFourCC is always NULL in frist call here - * but we get back how many pvmList it whant we should alloc, same + /* Get DirectDraw infomations form the driver + * DDK say pvmList, pdwFourCC is always NULL in frist call here + * but we get back how many pvmList it whant we should alloc, same * with pdwFourCC. */ if (pDirectDraw->DrvGetDirectDrawInfo) { - success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev, + success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev, &HalInfo, &pDirectDraw->dwNumHeaps, NULL, @@ -123,7 +123,7 @@ intEnableDriver(PDD_DIRECTDRAW pDirectDraw) return FALSE; } } - success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev, + success = pDirectDraw->DrvGetDirectDrawInfo( pDirectDraw->Global.dhpdev, &HalInfo, &pDirectDraw->dwNumHeaps, pDirectDraw->pvmList, @@ -137,13 +137,13 @@ intEnableDriver(PDD_DIRECTDRAW pDirectDraw) } - /* We need now convert the DD_HALINFO we got, it can be NT4 driver we + /* We need now convert the DD_HALINFO we got, it can be NT4 driver we * loading ReactOS supporting NT4 and higher to be loading.so we make - * the HALInfo compatible here so we can easy pass it to gdi32.dll - * without converting it later + * the HALInfo compatible here so we can easy pass it to gdi32.dll + * without converting it later */ - if ((HalInfo.dwSize != sizeof(DD_HALINFO)) && + if ((HalInfo.dwSize != sizeof(DD_HALINFO)) && (HalInfo.dwSize != sizeof(DD_HALINFO_V4))) { DPRINT1(" Fail not vaild driver DD_HALINFO struct found\n"); @@ -176,9 +176,9 @@ intEnableDriver(PDD_DIRECTDRAW pDirectDraw) DPRINT1("Trying EnableDirectDraw the driver\n"); - success = pDirectDraw->EnableDirectDraw( pDirectDraw->Global.dhpdev, - &pDirectDraw->DD, - &pDirectDraw->Surf, + success = pDirectDraw->EnableDirectDraw( pDirectDraw->Global.dhpdev, + &pDirectDraw->DD, + &pDirectDraw->Surf, &pDirectDraw->Pal); if (!success) @@ -194,11 +194,11 @@ intEnableDriver(PDD_DIRECTDRAW pDirectDraw) /* NtGdiDdCreateDirectDrawObject is finish and works as it should * it maybe have some memory leack or handler leack in this code - * if you found any case you maybe think it leacks the handler + * if you found any case you maybe think it leacks the handler * or memory please tell me, before you start fixing the code * Magnus Olsen */ -HANDLE STDCALL +HANDLE STDCALL NtGdiDdCreateDirectDrawObject(HDC hdc) { DC *pDC; @@ -210,7 +210,7 @@ NtGdiDdCreateDirectDrawObject(HDC hdc) { return NULL; } - + /* Look the hdc to gain the internal struct */ pDC = DC_LockDc(hdc); if (!pDC) @@ -266,12 +266,12 @@ NtGdiDdCreateDirectDrawObject(HDC hdc) /* NtGdiDdCreateDirectDrawObject is finish and works as it should * it maybe have some memory leack or handler leack in this code - * if you found any case you maybe think it leacks the handler + * if you found any case you maybe think it leacks the handler * or memory please tell me, before you start fixing the code * Magnus Olsen */ -BOOL STDCALL +BOOL STDCALL NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal, DD_HALINFO *pHalInfo, @@ -304,7 +304,7 @@ NtGdiDdQueryDirectDrawObject( } /* - * Get pHalInfo + * Get pHalInfo */ if (pHalInfo != NULL) { @@ -364,7 +364,7 @@ NtGdiDdQueryDirectDrawObject( /* * Get puD3dCallbacks */ - if ((puD3dCallbacks) && + if ((puD3dCallbacks) && (pDirectDraw->Hal.lpD3DHALCallbacks)) { _SEH_TRY @@ -393,7 +393,7 @@ NtGdiDdQueryDirectDrawObject( /* * Get lpD3DGlobalDriverData */ - if ((puD3dDriverData) && + if ((puD3dDriverData) && (pDirectDraw->Hal.lpD3DGlobalDriverData != NULL)) { /* Get D3dDriverData */ @@ -416,8 +416,8 @@ NtGdiDdQueryDirectDrawObject( /* Get TextureFormats */ pD3dDriverData =pDirectDraw->Hal.lpD3DGlobalDriverData; - if ((puD3dTextureFormats) && - (pD3dDriverData->dwNumTextureFormats>0) && + if ((puD3dTextureFormats) && + (pD3dDriverData->dwNumTextureFormats>0) && (pD3dDriverData->lpTextureFormats)) { DWORD Size = sizeof(DDSURFACEDESC) * pD3dDriverData->dwNumTextureFormats; @@ -447,7 +447,7 @@ NtGdiDdQueryDirectDrawObject( } /*Get D3dBufferCallbacks */ - if ( (puD3dBufferCallbacks) && + if ( (puD3dBufferCallbacks) && (pDirectDraw->Hal.lpD3DBufCallbacks)) { _SEH_TRY @@ -479,7 +479,7 @@ NtGdiDdQueryDirectDrawObject( ProbeForWrite(puNumFourCC, sizeof(DWORD), 1); *puNumFourCC = pDirectDraw->dwNumFourCC; - if ((pDirectDraw->pdwFourCC) && + if ((pDirectDraw->pdwFourCC) && (puFourCC)) { ProbeForWrite(puFourCC, sizeof(DWORD) * pDirectDraw->dwNumFourCC, 1); @@ -505,7 +505,7 @@ NtGdiDdQueryDirectDrawObject( } -BOOL STDCALL +BOOL STDCALL NtGdiDdDeleteDirectDrawObject( HANDLE hDirectDrawLocal) { DPRINT1("NtGdiDdDeleteDirectDrawObject\n"); @@ -540,7 +540,7 @@ BOOL STDCALL NtGdiDdReenableDirectDrawObject( return Ret; } - /* + /* * FIXME detect mode change thic code maybe are not correct * if we call on intEnableDriver it will cause some memory leak * we need free the alloc memory before we call on it @@ -552,7 +552,7 @@ BOOL STDCALL NtGdiDdReenableDirectDrawObject( ProbeForWrite(pubNewMode, sizeof(BOOL), 1); *pubNewMode = Ret; } - _SEH_HANDLE + _SEH_HANDLE { Status = _SEH_GetExceptionCode(); } @@ -582,7 +582,7 @@ DWORD STDCALL NtGdiDdGetDriverInfo( DPRINT1("NtGdiDdGetDriverInfo\n"); - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) { return DDHAL_DRIVER_NOTHANDLED; } @@ -597,7 +597,7 @@ DWORD STDCALL NtGdiDdGetDriverInfo( /* Now we are doing the call to drv DrvGetDriverInfo */ if (ddRVal == 2) { - DPRINT1("NtGdiDdGetDriverInfo DDHAL_DRIVER_NOTHANDLED"); + DPRINT1("NtGdiDdGetDriverInfo DDHAL_DRIVER_NOTHANDLED"); ddRVal = DDHAL_DRIVER_NOTHANDLED; } else @@ -625,7 +625,7 @@ DWORD STDCALL NtGdiDdUnlock( #ifdef DX_DEBUG DPRINT1("NtGdiDdUnlock\n"); #endif - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; /* backup the orignal PDev and info */ @@ -643,7 +643,7 @@ DWORD STDCALL NtGdiDdUnlock( /* But back the orignal PDev */ puUnlockData->lpDD = lgpl; - GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); return ddRVal; } @@ -661,7 +661,7 @@ DWORD STDCALL NtGdiDdSetColorKey( #ifdef DX_DEBUG DPRINT1("NtGdiDdSetColorKey\n"); #endif - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; /* backup the orignal PDev and info */ @@ -680,7 +680,7 @@ DWORD STDCALL NtGdiDdSetColorKey( puSetColorKeyData->lpDD = lgpl; GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); - return ddRVal; + return ddRVal; } @@ -697,7 +697,7 @@ DWORD STDCALL NtGdiDdAddAttachedSurface( #ifdef DX_DEBUG DPRINT1("NtGdiDdAddAttachedSurface\n"); #endif - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; /* backup the orignal PDev and info */ @@ -716,7 +716,7 @@ DWORD STDCALL NtGdiDdAddAttachedSurface( puAddAttachedSurfaceData->lpDD = lgpl; GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); - return ddRVal; + return ddRVal; } DWORD STDCALL NtGdiDdGetBltStatus( @@ -731,7 +731,7 @@ DWORD STDCALL NtGdiDdGetBltStatus( #ifdef DX_DEBUG DPRINT1("NtGdiDdGetBltStatus\n"); #endif - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; /* backup the orignal PDev and info */ @@ -750,7 +750,7 @@ DWORD STDCALL NtGdiDdGetBltStatus( puGetBltStatusData->lpDD = lgpl; GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); - return ddRVal; + return ddRVal; } DWORD STDCALL NtGdiDdGetFlipStatus( @@ -765,7 +765,7 @@ DWORD STDCALL NtGdiDdGetFlipStatus( #ifdef DX_DEBUG DPRINT1("NtGdiDdGetFlipStatus\n"); #endif - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; /* backup the orignal PDev and info */ @@ -784,7 +784,7 @@ DWORD STDCALL NtGdiDdGetFlipStatus( puGetFlipStatusData->lpDD = lgpl; GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); - return ddRVal; + return ddRVal; } DWORD STDCALL NtGdiDdUpdateOverlay( @@ -800,7 +800,7 @@ DWORD STDCALL NtGdiDdUpdateOverlay( #ifdef DX_DEBUG DPRINT1("NtGdiDdUpdateOverlay\n"); #endif - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; /* backup the orignal PDev and info */ @@ -835,7 +835,7 @@ DWORD STDCALL NtGdiDdSetOverlayPosition( #ifdef DX_DEBUG DPRINT1("NtGdiDdSetOverlayPosition\n"); #endif - if (pDirectDraw == NULL) + if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; /* backup the orignal PDev and info */ @@ -865,7 +865,7 @@ DWORD STDCALL NtGdiDdSetOverlayPosition( BOOL INTERNAL_CALL DDSURF_Cleanup(PVOID pDDSurf) { - /* FIXME: implement + /* FIXME: implement * PDD_SURFACE pDDSurf = PVOID pDDSurf */ #ifdef DX_DEBUG @@ -895,7 +895,7 @@ HANDLE STDCALL NtGdiDdCreateSurfaceObject( hSurface = GDIOBJ_AllocObj(DdHandleTable, GDI_OBJECT_TYPE_DD_SURFACE); pSurface = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DD_SURFACE); - + if (!pSurface) { GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); @@ -928,11 +928,11 @@ BOOL STDCALL NtGdiDdDeleteSurfaceObject( #ifdef DX_DEBUG DPRINT1("NtGdiDdDeleteSurfaceObject\n"); #endif - /* FIXME add right GDI_OBJECT_TYPE_ for everthing for now + /* FIXME add right GDI_OBJECT_TYPE_ for everthing for now we are using same type */ /* return GDIOBJ_FreeObj(hSurface, GDI_OBJECT_TYPE_DD_SURFACE); */ return GDIOBJ_FreeObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DD_SURFACE); - + } @@ -989,8 +989,8 @@ DWORD STDCALL NtGdiDdGetAvailDriverMemory( puGetAvailDriverMemoryData->lpDD = &pDirectDraw->Global; /* make the call */ - // ddRVal = pDirectDraw->DdGetAvailDriverMemory(puGetAvailDriverMemoryData); - + // ddRVal = pDirectDraw->DdGetAvailDriverMemory(puGetAvailDriverMemoryData); + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); @@ -1030,8 +1030,8 @@ DWORD STDCALL NtGdiDdSetExclusiveMode( /* But back the orignal PDev */ puSetExclusiveModeData->lpDD = lgpl; - - return ddRVal; + + return ddRVal; } diff --git a/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c b/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c index 76cb2ab998f..42186d4f325 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c +++ b/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c @@ -131,34 +131,34 @@ DWORD STDCALL NtGdiDdDestroySurface( HANDLE hSurface, BOOL bRealDestroy ) -{ +{ DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; PDD_SURFACE pSurface; - PDD_DIRECTDRAW pDirectDraw; - DD_DESTROYSURFACEDATA DestroySurf; - + PDD_DIRECTDRAW pDirectDraw; + DD_DESTROYSURFACEDATA DestroySurf; + DPRINT1("NtGdiDdDestroySurface\n"); - + pSurface = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DD_SURFACE); - if (pSurface != NULL) - { + if (pSurface != NULL) + { pDirectDraw = GDIOBJ_LockObj(DdHandleTable, pSurface->hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw != NULL) - { - if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_DESTROYSURFACE) - { + { + if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_DESTROYSURFACE) + { //DestroySurf.lpDD = pSurface->Global; - DestroySurf.lpDDSurface = hSurface; - + DestroySurf.lpDDSurface = hSurface; + /* FIXME - in parma bRealDestroy - Specifies how to destroy the surface. Can be one of the following values. + in parma bRealDestroy + Specifies how to destroy the surface. Can be one of the following values. TRUE = Destroy the surface and free video memory. FALSE = Free the video memory but leave the surface in an uninitialized state */ - DestroySurf.DestroySurface = pDirectDraw->Surf.DestroySurface; - ddRVal = pDirectDraw->Surf.DestroySurface(&DestroySurf); + DestroySurf.DestroySurface = pDirectDraw->Surf.DestroySurface; + ddRVal = pDirectDraw->Surf.DestroySurface(&DestroySurf); } GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); @@ -167,7 +167,7 @@ DWORD STDCALL NtGdiDdDestroySurface( GDIOBJ_UnlockObjByPtr(DdHandleTable, pSurface); } - return ddRVal; + return ddRVal; } @@ -187,21 +187,21 @@ DWORD STDCALL NtGdiDdFlip( { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; PDD_SURFACE pSurface; - PDD_DIRECTDRAW pDirectDraw; + PDD_DIRECTDRAW pDirectDraw; DPRINT1("NtGdiDdFlip\n"); - + /* DO we need looking all surface or is okay for one */ pSurface = GDIOBJ_LockObj(DdHandleTable, hSurfaceCurrent, GDI_OBJECT_TYPE_DD_SURFACE); - if (pSurface != NULL) - { + if (pSurface != NULL) + { pDirectDraw = GDIOBJ_LockObj(DdHandleTable, pSurface->hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw != NULL) - { - if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_FLIP) - { - /* FIXME is lpDD typecasted tp driver PEV ?? */ - ddRVal = pDirectDraw->Surf.Flip(puFlipData); + { + if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_FLIP) + { + /* FIXME is lpDD typecasted tp driver PEV ?? */ + ddRVal = pDirectDraw->Surf.Flip(puFlipData); } GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); @@ -210,7 +210,7 @@ DWORD STDCALL NtGdiDdFlip( GDIOBJ_UnlockObjByPtr(DdHandleTable, pSurface); } - return ddRVal; + return ddRVal; } @@ -228,22 +228,22 @@ DWORD STDCALL NtGdiDdLock( { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; PDD_SURFACE pSurface; - PDD_DIRECTDRAW pDirectDraw; - + PDD_DIRECTDRAW pDirectDraw; + DPRINT1("NtGdiDdLock\n"); - + pSurface = GDIOBJ_LockObj(DdHandleTable, hSurface, GDI_OBJECT_TYPE_DD_SURFACE); - if (pSurface != NULL) - { + if (pSurface != NULL) + { pDirectDraw = GDIOBJ_LockObj(DdHandleTable, pSurface->hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw != NULL) - { + { /* Do we need lock hdc from hdcClip ?? */ if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_LOCK) - { - /* FIXME is lpDD typecasted tp driver PEV ?? */ - ddRVal = pDirectDraw->Surf.Lock(puLockData); + { + /* FIXME is lpDD typecasted tp driver PEV ?? */ + ddRVal = pDirectDraw->Surf.Lock(puLockData); } GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); @@ -252,7 +252,7 @@ DWORD STDCALL NtGdiDdLock( GDIOBJ_UnlockObjByPtr(DdHandleTable, pSurface); } - return ddRVal; + return ddRVal; } /* diff --git a/reactos/subsystems/win32/win32k/ntddraw/stubs.c b/reactos/subsystems/win32/win32k/ntddraw/stubs.c index bae83615e83..3937ca2aefa 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/stubs.c +++ b/reactos/subsystems/win32/win32k/ntddraw/stubs.c @@ -332,10 +332,10 @@ BOOL STDCALL NtGdiDdResetVisrgn( DPRINT1("UNIMPLEMENTED NtGdiDdResetVisrgn \n"); /* see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/lowlevelclientsupport/graphics/ddresetvisrgn.asp for more info, I pasted some part of it here - Clipping can change asynchronously from the point of view of user-mode threads. - The kernel-mode parts of DirectDraw and Microsoft Windows Graphics Device Interface (GDI) - maintain a counter that is incremented whenever the clipping list for the entire desktop - changes. A call to this function records this counter with every existing DirectDraw + Clipping can change asynchronously from the point of view of user-mode threads. + The kernel-mode parts of DirectDraw and Microsoft Windows Graphics Device Interface (GDI) + maintain a counter that is incremented whenever the clipping list for the entire desktop + changes. A call to this function records this counter with every existing DirectDraw primary surface on the system. */ diff --git a/reactos/subsystems/win32/win32k/ntuser/accelerator.c b/reactos/subsystems/win32/win32k/ntuser/accelerator.c index 3aec0418fa5..48ef9bd3444 100644 --- a/reactos/subsystems/win32/win32k/ntuser/accelerator.c +++ b/reactos/subsystems/win32/win32k/ntuser/accelerator.c @@ -72,20 +72,20 @@ CleanupAcceleratorImpl(VOID) PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hAccel) { PACCELERATOR_TABLE Accel; - + if (!hAccel) { SetLastWin32Error(ERROR_INVALID_ACCEL_HANDLE); return NULL; } - + Accel= UserGetObject(gHandleTable, hAccel, otAccel); if (!Accel) { SetLastWin32Error(ERROR_INVALID_ACCEL_HANDLE); return NULL; } - + ASSERT(USER_BODY_TO_HEADER(Accel)->RefCount >= 0); return Accel; diff --git a/reactos/subsystems/win32/win32k/ntuser/class.c b/reactos/subsystems/win32/win32k/ntuser/class.c index 3484b8f76e4..a4f4dda3207 100644 --- a/reactos/subsystems/win32/win32k/ntuser/class.c +++ b/reactos/subsystems/win32/win32k/ntuser/class.c @@ -218,7 +218,7 @@ IntGetClassWndProc(IN PWINDOWCLASS Class, IN BOOL UseCallProc2) { ASSERT(UserIsEnteredExclusive() == TRUE); - + if (Class->System) { return (Ansi ? Class->WndProcExtra : Class->WndProc); diff --git a/reactos/subsystems/win32/win32k/ntuser/clipboard.c b/reactos/subsystems/win32/win32k/ntuser/clipboard.c index a4e4ccfe37a..0a3f3eeeba7 100644 --- a/reactos/subsystems/win32/win32k/ntuser/clipboard.c +++ b/reactos/subsystems/win32/win32k/ntuser/clipboard.c @@ -526,7 +526,7 @@ NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext) { // only send message to the first window in the chain, // then they do the chain - + /* WindowsChain->window may be NULL */ LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->hSelf; DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->hSelf); @@ -988,7 +988,7 @@ NtUserSetClipboardData(UINT uFormat, HANDLE hMem, DWORD size) hdc = UserGetDCEx(NULL, NULL, DCX_USESTYLE); - + BitmapObj = BITMAPOBJ_LockBitmap(hMem); BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (LPSTR)&bm); if(BitmapObj) diff --git a/reactos/subsystems/win32/win32k/ntuser/cursoricon.c b/reactos/subsystems/win32/win32k/ntuser/cursoricon.c index b824d75f3ec..868a3f88d73 100644 --- a/reactos/subsystems/win32/win32k/ntuser/cursoricon.c +++ b/reactos/subsystems/win32/win32k/ntuser/cursoricon.c @@ -75,13 +75,13 @@ IntGetCursorLocation(PWINSTATION_OBJECT WinSta, POINT *loc) PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon) { PCURICON_OBJECT CurIcon; - + if (!hCurIcon) { SetLastWin32Error(ERROR_INVALID_CURSOR_HANDLE); return NULL; } - + CurIcon = (PCURICON_OBJECT)UserGetObject(gHandleTable, hCurIcon, otCursorIcon); if (!CurIcon) { @@ -458,7 +458,7 @@ IntDestroyCurIconObject(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT CurIcon, BOOL break; } } - + ExFreeToPagedLookasideList(&gProcessLookasideList, Current); /* If there are still processes referencing this object we can't destroy it yet */ @@ -567,7 +567,7 @@ NtUserCreateCursorIconHandle(PICONINFO IconInfo OPTIONAL, BOOL Indirect) ObDereferenceObject(WinSta); RETURN( (HANDLE)0); } - + Ret = CurIcon->Self; if(IconInfo) @@ -652,7 +652,7 @@ NtUserGetIconInfo( ObDereferenceObject(WinSta); RETURN( FALSE); } - + RtlCopyMemory(&ii, &CurIcon->IconInfo, sizeof(ICONINFO)); /* Copy bitmaps */ @@ -708,7 +708,7 @@ NtUserGetCursorIconSize( ObDereferenceObject(WinSta); RETURN(FALSE); } - + /* Copy fields */ Status = MmCopyToCaller(fIcon, &CurIcon->IconInfo.fIcon, sizeof(BOOL)); if(!NT_SUCCESS(Status)) @@ -1076,17 +1076,17 @@ NtUserSetCursor( { RETURN(NULL); } - + if(!(CurIcon = UserGetCurIconObject(hCursor))) { ObDereferenceObject(WinSta); RETURN(NULL); } - + OldCursor = IntSetCursor(WinSta, CurIcon, FALSE); ObDereferenceObject(WinSta); - + RETURN(OldCursor); CLEANUP: @@ -1124,7 +1124,7 @@ NtUserSetCursorContents( if (!(CurIcon = UserGetCurIconObject(hCurIcon))) { ObDereferenceObject(WinSta); - RETURN(FALSE); + RETURN(FALSE); } /* Copy fields */ @@ -1345,7 +1345,7 @@ DoStretchBlt(HDC DcDest, int XDest, int YDest, int WidthDest, int HeightDest, (Rop3), 0) #endif /* STRETCH_CAN_SRCCOPY_ONLY */ -BOOL +BOOL UserDrawIconEx( HDC hDc, INT xLeft, @@ -1364,7 +1364,7 @@ UserDrawIconEx( BOOL DoFlickerFree; INT nStretchMode; SIZE IconSize; - + HDC hdcOff; HGDIOBJ hOldOffBrush = 0; HGDIOBJ hOldOffBmp = 0; @@ -1372,7 +1372,7 @@ UserDrawIconEx( HDC hdcMem = 0; HGDIOBJ hOldMem; BOOL bAlpha = FALSE; - + hbmMask = pIcon->IconInfo.hbmMask; hbmColor = pIcon->IconInfo.hbmColor; @@ -1388,7 +1388,7 @@ UserDrawIconEx( { return FALSE; } - + if (hbmColor) { IconSize.cx = bmpColor.bmWidth; @@ -1409,14 +1409,14 @@ UserDrawIconEx( diFlags = DI_NORMAL; if (!cxWidth) - cxWidth = ((diFlags & DI_DEFAULTSIZE) ? + cxWidth = ((diFlags & DI_DEFAULTSIZE) ? UserGetSystemMetrics(SM_CXICON) : IconSize.cx); if (!cyHeight) - cyHeight = ((diFlags & DI_DEFAULTSIZE) ? + cyHeight = ((diFlags & DI_DEFAULTSIZE) ? UserGetSystemMetrics(SM_CYICON) : IconSize.cy); - DoFlickerFree = (hbrFlickerFreeDraw && + DoFlickerFree = (hbrFlickerFreeDraw && (GDI_HANDLE_GET_TYPE(hbrFlickerFreeDraw) == GDI_OBJECT_TYPE_BRUSH)); if (DoFlickerFree || bAlpha) @@ -1487,7 +1487,7 @@ UserDrawIconEx( 0, 0, IconSize.cx, IconSize.cy, ((diFlags & DI_IMAGE) ? SRCAND : SRCCOPY), FALSE); - if (!hbmColor && (bmpMask.bmHeight == 2 * bmpMask.bmWidth) + if (!hbmColor && (bmpMask.bmHeight == 2 * bmpMask.bmWidth) && (diFlags & DI_IMAGE)) { DoStretchBlt(hdcOff, (DoFlickerFree ? 0 : xLeft), @@ -1497,7 +1497,7 @@ UserDrawIconEx( diFlags &= ~DI_IMAGE; } - + NtGdiSelectObject(hdcMem, hOldMem); } @@ -1580,12 +1580,12 @@ UserDrawIconEx( BlendFunc.SourceConstantAlpha = 255; BlendFunc.AlphaFormat = AC_SRC_ALPHA; - NtGdiAlphaBlend(hDc, xLeft, yTop, cxWidth, cyHeight, + NtGdiAlphaBlend(hDc, xLeft, yTop, cxWidth, cyHeight, hdcOff, 0, 0, cxWidth, cyHeight, BlendFunc, 0); } else if (DoFlickerFree) { - NtGdiBitBlt(hDc, xLeft, yTop, cxWidth, + NtGdiBitBlt(hDc, xLeft, yTop, cxWidth, cyHeight, hdcOff, 0, 0, SRCCOPY, 0, 0); } @@ -1603,7 +1603,7 @@ cleanup: if(hbmOff) NtGdiDeleteObject(hbmOff); if(hdcOff) NtGdiDeleteObjectApp(hdcOff); } - + if(hdcMem) NtGdiDeleteObjectApp(hdcMem); return Ret; } @@ -1631,14 +1631,14 @@ NtUserDrawIconEx( DPRINT("Enter NtUserDrawIconEx\n"); UserEnterExclusive(); - + if(!(pIcon = UserGetCurIconObject(hIcon))) { DPRINT1("UserGetCurIconObject() failed!\n"); UserLeave(); return FALSE; } - + Ret = UserDrawIconEx(hdc, xLeft, yTop, diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index f625774e48b..a3c7bab7fc0 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -675,7 +675,7 @@ UserBuildShellHookHwndList(PDESKTOP_OBJECT Desktop) ULONG entries=0; PSHELL_HOOK_WINDOW Current; HWND* list; - + /* fixme: if we save nb elements in desktop, we dont have to loop to find nb entries */ LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry) entries++; @@ -686,10 +686,10 @@ UserBuildShellHookHwndList(PDESKTOP_OBJECT Desktop) if (list) { HWND* cursor = list; - + LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry) *cursor++ = Current->hWnd; - + *cursor = NULL; /* nullterm list */ } @@ -735,7 +735,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam) if (HwndList) { HWND* cursor = HwndList; - + for (; *cursor; cursor++) { DPRINT("Sending notify\n"); @@ -747,7 +747,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam) ExFreePool(HwndList); } - + } /* @@ -871,7 +871,7 @@ NtUserCreateDesktop( UNICODE_STRING SafeDesktopName; ULONG DummyContext; DECLARE_RETURN(HDESK); - + DPRINT("Enter NtUserCreateDesktop: %wZ\n", lpszDesktopName); UserEnterExclusive(); @@ -1234,11 +1234,11 @@ NtUserOpenInputDesktop( SetLastNtError(Status); RETURN((HDESK)0); - + CLEANUP: DPRINT("Leave NtUserOpenInputDesktop, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } /* @@ -1303,7 +1303,7 @@ NtUserCloseDesktop(HDESK hDesktop) CLEANUP: DPRINT("Leave NtUserCloseDesktop, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } @@ -1346,7 +1346,7 @@ NtUserPaintDesktop(HDC hDC) IntGdiGetClipBox(hDC, &Rect); hWndDesktop = IntGetDesktopWindow(); - + WndDesktop = UserGetWindowObject(hWndDesktop); if (!WndDesktop) { @@ -1365,7 +1365,7 @@ NtUserPaintDesktop(HDC hDC) PWINDOW_OBJECT DeskWin; DeskWin = UserGetWindowObject(hWndDesktop); - + if (DeskWin) { SIZE sz; @@ -1374,7 +1374,7 @@ NtUserPaintDesktop(HDC hDC) sz.cx = DeskWin->WindowRect.right - DeskWin->WindowRect.left; sz.cy = DeskWin->WindowRect.bottom - DeskWin->WindowRect.top; - + if (WinSta->WallpaperMode == wmStretch || WinSta->WallpaperMode == wmTile) { @@ -1387,28 +1387,28 @@ NtUserPaintDesktop(HDC hDC) x = (sz.cx / 2) - (WinSta->cxWallpaper / 2); y = (sz.cy / 2) - (WinSta->cyWallpaper / 2); } - + hWallpaperDC = NtGdiCreateCompatibleDC(hDC); if(hWallpaperDC != NULL) { HBITMAP hOldBitmap; - + /* fill in the area that the bitmap is not going to cover */ if (x > 0 || y > 0) { - /* FIXME - clip out the bitmap + /* FIXME - clip out the bitmap can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);" once we support DSTINVERT */ PreviousBrush = NtGdiSelectObject(hDC, DesktopBrush); NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY); NtGdiSelectObject(hDC, PreviousBrush); } - + /*Do not fill the background after it is painted no matter the size of the picture */ doPatBlt = FALSE; - + hOldBitmap = NtGdiSelectObject(hWallpaperDC, WinSta->hbmWallpaper); - + if (WinSta->WallpaperMode == wmStretch) { if(Rect.right && Rect.bottom) @@ -1420,11 +1420,11 @@ NtUserPaintDesktop(HDC hDC) hWallpaperDC, 0, 0, - WinSta->cxWallpaper, - WinSta->cyWallpaper, + WinSta->cxWallpaper, + WinSta->cyWallpaper, SRCCOPY, 0); - + } else if (WinSta->WallpaperMode == wmTile) { @@ -1433,14 +1433,14 @@ NtUserPaintDesktop(HDC hDC) { for(x = 0; x < Rect.right; x += WinSta->cxWallpaper) { - NtGdiBitBlt(hDC, - x, - y, - WinSta->cxWallpaper, - WinSta->cyWallpaper, - hWallpaperDC, - 0, - 0, + NtGdiBitBlt(hDC, + x, + y, + WinSta->cxWallpaper, + WinSta->cyWallpaper, + hWallpaperDC, + 0, + 0, SRCCOPY, 0, 0); @@ -1449,19 +1449,19 @@ NtUserPaintDesktop(HDC hDC) } else { - NtGdiBitBlt(hDC, - x, - y, - WinSta->cxWallpaper, - WinSta->cyWallpaper, - hWallpaperDC, - 0, - 0, + NtGdiBitBlt(hDC, + x, + y, + WinSta->cxWallpaper, + WinSta->cyWallpaper, + hWallpaperDC, + 0, + 0, SRCCOPY, 0, 0); - } - NtGdiSelectObject(hWallpaperDC, hOldBitmap); + } + NtGdiSelectObject(hWallpaperDC, hOldBitmap); NtGdiDeleteObjectApp(hWallpaperDC); } } @@ -1514,11 +1514,11 @@ NtUserPaintDesktop(HDC hDC) } RETURN(TRUE); - + CLEANUP: DPRINT("Leave NtUserPaintDesktop, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } @@ -1544,7 +1544,7 @@ NtUserSwitchDesktop(HDESK hDesktop) PDESKTOP_OBJECT DesktopObject; NTSTATUS Status; DECLARE_RETURN(BOOL); - + UserEnterExclusive(); DPRINT("Enter NtUserSwitchDesktop\n"); @@ -1590,11 +1590,11 @@ NtUserSwitchDesktop(HDESK hDesktop) ObDereferenceObject(DesktopObject); RETURN(TRUE); - + CLEANUP: DPRINT("Leave NtUserSwitchDesktop, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } /* @@ -1627,7 +1627,7 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1) HDESK Ret, hThreadDesktop; OBJECT_HANDLE_INFORMATION HandleInformation; DECLARE_RETURN(HDESK); - + UserEnterExclusive(); DPRINT("Enter NtUserGetThreadDesktop\n"); @@ -1690,7 +1690,7 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1) ObDereferenceObject(DesktopObject); ObDereferenceObject(Thread); RETURN(Ret); - + CLEANUP: DPRINT("Leave NtUserGetThreadDesktop, ret=%i\n",_ret_); UserLeave(); @@ -1916,10 +1916,10 @@ NtUserSetThreadDesktop(HDESK hDesktop) PDESKTOP_OBJECT DesktopObject; NTSTATUS Status; DECLARE_RETURN(BOOL); - + UserEnterExclusive(); DPRINT("Enter NtUserSetThreadDesktop\n"); - + /* Validate the new desktop. */ Status = IntValidateDesktopHandle( hDesktop, @@ -1942,7 +1942,7 @@ NtUserSetThreadDesktop(HDESK hDesktop) } RETURN(TRUE); - + CLEANUP: DPRINT("Leave NtUserSetThreadDesktop, ret=%i\n",_ret_); UserLeave(); diff --git a/reactos/subsystems/win32/win32k/ntuser/focus.c b/reactos/subsystems/win32/win32k/ntuser/focus.c index 3f764aa2570..09f4e13c863 100644 --- a/reactos/subsystems/win32/win32k/ntuser/focus.c +++ b/reactos/subsystems/win32/win32k/ntuser/focus.c @@ -63,12 +63,12 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) { USER_REFERENCE_ENTRY Ref; PWINDOW_OBJECT Window; - + if ((Window = UserGetWindowObject(hWnd))) { - + UserRefObjectCo(Window, &Ref); - + /* Send palette messages */ if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) { @@ -239,7 +239,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window) UserRefObjectCo(TopWnd, &Ref); Ret = co_IntMouseActivateWindow(TopWnd); UserDerefObjectCo(TopWnd); - + return Ret; } } @@ -252,9 +252,9 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window) /* TMN: Check return valud from this function? */ UserRefObjectCo(TopWindow, &Ref); - + co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE); - + UserDerefObjectCo(TopWindow); return TRUE; @@ -332,7 +332,7 @@ co_IntSetFocusWindow(PWINDOW_OBJECT Window OPTIONAL) else { ThreadQueue->FocusWindow = 0; - + co_IntSendKillFocusMessages(hWndPrev, 0); } return hWndPrev; @@ -582,7 +582,7 @@ NtUserSetFocus(HWND hWnd) UserRefObjectCo(Window, &Ref); ret = co_UserSetFocus(Window); UserDerefObjectCo(Window); - + RETURN(ret); } else diff --git a/reactos/subsystems/win32/win32k/ntuser/hook.c b/reactos/subsystems/win32/win32k/ntuser/hook.c index 592fb212e98..e0c13171aef 100644 --- a/reactos/subsystems/win32/win32k/ntuser/hook.c +++ b/reactos/subsystems/win32/win32k/ntuser/hook.c @@ -62,13 +62,13 @@ IntAllocHookTable(void) PHOOK FASTCALL IntGetHookObject(HHOOK hHook) { PHOOK Hook; - + if (!hHook) { SetLastWin32Error(ERROR_INVALID_HOOK_HANDLE); return NULL; } - + Hook = (PHOOK)UserGetObject(gHandleTable, hHook, otHook); if (!Hook) { diff --git a/reactos/subsystems/win32/win32k/ntuser/hotkey.c b/reactos/subsystems/win32/win32k/ntuser/hotkey.c index 915c5def0cb..0379b81993f 100644 --- a/reactos/subsystems/win32/win32k/ntuser/hotkey.c +++ b/reactos/subsystems/win32/win32k/ntuser/hotkey.c @@ -106,7 +106,7 @@ VOID FASTCALL UnregisterWindowHotKeys(PWINDOW_OBJECT Window) { PHOT_KEY_ITEM HotKeyItem, tmp; - + LIST_FOR_EACH_SAFE(HotKeyItem, tmp, &gHotkeyList, HOT_KEY_ITEM, ListEntry) { if (HotKeyItem->hWnd == Window->hSelf) @@ -124,7 +124,7 @@ UnregisterThreadHotKeys(struct _ETHREAD *Thread) { PHOT_KEY_ITEM HotKeyItem, tmp; - LIST_FOR_EACH_SAFE(HotKeyItem, tmp, &gHotkeyList, HOT_KEY_ITEM, ListEntry) + LIST_FOR_EACH_SAFE(HotKeyItem, tmp, &gHotkeyList, HOT_KEY_ITEM, ListEntry) { if (HotKeyItem->Thread == Thread) { @@ -136,7 +136,7 @@ UnregisterThreadHotKeys(struct _ETHREAD *Thread) } -static +static BOOL FASTCALL IsHotKey (UINT fsModifiers, UINT vk) { diff --git a/reactos/subsystems/win32/win32k/ntuser/input.c b/reactos/subsystems/win32/win32k/ntuser/input.c index 60dea5b3a36..cfec7fd627f 100644 --- a/reactos/subsystems/win32/win32k/ntuser/input.c +++ b/reactos/subsystems/win32/win32k/ntuser/input.c @@ -85,20 +85,20 @@ STDCALL NtUserGetLastInputInfo(PLASTINPUTINFO plii) { BOOL ret = TRUE; - + UserEnterShared(); - + _SEH_TRY { if (ProbeForReadUint(&plii->cbSize) != sizeof(LASTINPUTINFO)) { SetLastWin32Error(ERROR_INVALID_PARAMETER); ret = FALSE; - _SEH_LEAVE; + _SEH_LEAVE; } ProbeForWrite(plii, sizeof(LASTINPUTINFO), sizeof(DWORD)); - + plii->dwTime = IntLastInputTick(FALSE); } _SEH_HANDLE @@ -107,9 +107,9 @@ NtUserGetLastInputInfo(PLASTINPUTINFO plii) ret = FALSE; } _SEH_END; - - UserLeave(); - + + UserLeave(); + return ret; } @@ -274,7 +274,7 @@ MouseThreadMain(PVOID StartContext) DPRINT1("Win32K: Failed to read from mouse.\n"); return; //(Status); } - DPRINT("MouseEvent\n"); + DPRINT("MouseEvent\n"); IntLastInputTick(TRUE); UserEnterExclusive(); diff --git a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c index d1fe34a4823..fedab0dd388 100644 --- a/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c +++ b/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c @@ -5,9 +5,9 @@ * FILE: subsystems/win32/win32k/ntuser/kbdlayout.c * PURPOSE: Keyboard layout management * COPYRIGHT: Copyright 2007 Saveliy Tretiakov - * + * */ - + /* INCLUDES ******************************************************************/ @@ -25,9 +25,9 @@ NTSTATUS STDCALL LdrGetProcedureAddress(PVOID module, PVOID *func_addr); - + /* PRIVATE FUNCTIONS ******************************************************/ - + /* * Utility function to read a value from the registry more easily. @@ -50,7 +50,7 @@ static NTSTATUS NTAPI ReadRegistryValue( PUNICODE_STRING KeyName, ULONG Length = 0; ULONG ResLength = 0; PWCHAR ReturnBuffer; - + InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE, NULL, NULL); Status = ZwOpenKey(&KeyHandle, KEY_ALL_ACCESS, &KeyAttributes); @@ -81,7 +81,7 @@ static NTSTATUS NTAPI ReadRegistryValue( PUNICODE_STRING KeyName, return STATUS_NO_MEMORY; } - Status = ZwQueryValueKey(KeyHandle, + Status = ZwQueryValueKey(KeyHandle, ValueName, KeyValuePartialInformation, (PVOID)KeyValuePartialInfo, @@ -96,19 +96,19 @@ static NTSTATUS NTAPI ReadRegistryValue( PUNICODE_STRING KeyName, } /* At this point, KeyValuePartialInfo->Data contains the key data */ - ReturnBuffer = ExAllocatePoolWithTag(PagedPool, - KeyValuePartialInfo->DataLength, + ReturnBuffer = ExAllocatePoolWithTag(PagedPool, + KeyValuePartialInfo->DataLength, TAG_STRING); - + if(!ReturnBuffer) { NtClose(KeyHandle); ExFreePool(KeyValuePartialInfo); return STATUS_NO_MEMORY; } - - RtlCopyMemory(ReturnBuffer, - KeyValuePartialInfo->Data, + + RtlCopyMemory(ReturnBuffer, + KeyValuePartialInfo->Data, KeyValuePartialInfo->DataLength); RtlInitUnicodeString(ReturnedValue, ReturnBuffer); @@ -118,8 +118,8 @@ static NTSTATUS NTAPI ReadRegistryValue( PUNICODE_STRING KeyName, return Status; } -static BOOL UserLoadKbdDll(WCHAR *wsKLID, - HANDLE *phModule, +static BOOL UserLoadKbdDll(WCHAR *wsKLID, + HANDLE *phModule, PKBDTABLES *pKbdTables) { NTSTATUS Status; @@ -133,21 +133,21 @@ static BOOL UserLoadKbdDll(WCHAR *wsKLID, WCHAR LayoutPathBuffer[MAX_PATH] = L"\\SystemRoot\\System32\\"; WCHAR KeyNameBuffer[MAX_PATH] = L"\\REGISTRY\\Machine\\SYSTEM\\" L"CurrentControlSet\\Control\\KeyboardLayouts\\"; - + RtlInitUnicodeString(&klid, wsKLID); - RtlInitUnicodeString(&LayoutValueName,L"Layout File"); + RtlInitUnicodeString(&LayoutValueName,L"Layout File"); RtlInitUnicodeString(&LayoutKeyName, KeyNameBuffer); LayoutKeyName.MaximumLength = sizeof(KeyNameBuffer); - + RtlAppendUnicodeStringToString(&LayoutKeyName, &klid); Status = ReadRegistryValue(&LayoutKeyName, &LayoutValueName, &LayoutFile); - + if(!NT_SUCCESS(Status)) { DPRINT("Can't get layout filename for %wZ. (%08lx)\n", klid, Status); return FALSE; } - + DPRINT("Read registry and got %wZ\n", &LayoutFile); RtlInitUnicodeString(&FullLayoutPath, LayoutPathBuffer); FullLayoutPath.MaximumLength = sizeof(LayoutPathBuffer); @@ -157,16 +157,16 @@ static BOOL UserLoadKbdDll(WCHAR *wsKLID, *phModule = EngLoadImage(FullLayoutPath.Buffer); - if(*phModule) + if(*phModule) { DPRINT("Loaded %wZ\n", &FullLayoutPath); - + RtlInitAnsiString( &kbdProcedureName, "KbdLayerDescriptor" ); LdrGetProcedureAddress((PVOID)*phModule, &kbdProcedureName, 0, (PVOID*)&layerDescGetFn); - + if(layerDescGetFn) { *pKbdTables = layerDescGetFn(); @@ -181,14 +181,14 @@ static BOOL UserLoadKbdDll(WCHAR *wsKLID, DPRINT1("Failed to load the keyboard layout.\n"); EngUnloadImage(*phModule); return FALSE; - } + } } else { DPRINT1("Failed to load dll %wZ\n", &FullLayoutPath); return FALSE; } - + return TRUE; } @@ -197,24 +197,24 @@ static PKBL UserLoadDllAndCreateKbl(DWORD LocaleId) PKBL NewKbl; ULONG hKl; LANGID langid; - + NewKbl = ExAllocatePool(PagedPool, sizeof(KBL)); - + if(!NewKbl) - { + { DPRINT1("%s: Can't allocate memory!\n", __FUNCTION__); return NULL; } - + swprintf(NewKbl->Name, L"%08lx", LocaleId); - + if(!UserLoadKbdDll(NewKbl->Name, &NewKbl->hModule, &NewKbl->KBTables)) { DPRINT("%s: failed to load %x dll!\n", __FUNCTION__, LocaleId); ExFreePool(NewKbl); return NULL; } - + /* Microsoft Office expects this value to be something specific * for Japanese and Korean Windows with an IME the value is 0xe001 * We should probably check to see if an IME exists and if so then @@ -222,16 +222,16 @@ static PKBL UserLoadDllAndCreateKbl(DWORD LocaleId) */ langid = PRIMARYLANGID(LANGIDFROMLCID(LocaleId)); hKl = LocaleId; - + if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) hKl |= 0xe001 << 16; /* FIXME */ else hKl |= hKl << 16; - + NewKbl->hkl = (HKL) hKl; NewKbl->klid = LocaleId; NewKbl->Flags = 0; NewKbl->RefCount = 0; - + return NewKbl; } @@ -245,7 +245,7 @@ BOOL UserInitDefaultKeyboardLayout() { DPRINT1("Could not get default locale (%08lx).\n", Status); } - else + else { DPRINT("DefaultLocale = %08lx\n", LocaleId); } @@ -261,9 +261,9 @@ BOOL UserInitDefaultKeyboardLayout() return FALSE; } } - + KBLList->Flags |= KBL_PRELOAD; - + InitializeListHead(&KBLList->List); return TRUE; } @@ -283,7 +283,7 @@ PKBL W32kGetDefaultKeyLayout(VOID) DPRINT1("Assuming default locale = 0x409 (US).\n"); LocaleId = 0x409; } - + pKbl = KBLList; do { @@ -291,19 +291,19 @@ PKBL W32kGetDefaultKeyLayout(VOID) { return pKbl; } - + pKbl = (PKBL) pKbl->List.Flink; } while(pKbl != KBLList); - + DPRINT("Loading new default keyboard layout.\n"); pKbl = UserLoadDllAndCreateKbl(LocaleId); - + if(!pKbl) { DPRINT("Failed to load %x!!! Returning any availableKL.\n", LocaleId); return KBLList; } - + InsertTailList(&KBLList->List, &pKbl->List); return pKbl; } @@ -316,7 +316,7 @@ static PKBL UserHklToKbl(HKL hKl) if(pKbl->hkl == hKl) return pKbl; pKbl = (PKBL) pKbl->List.Flink; } while(pKbl != KBLList); - + return NULL; } @@ -324,13 +324,13 @@ BOOL UserUnloadKbl(PKBL pKbl) { /* According to msdn, UnloadKeyboardLayout can fail if the keyboard layout identifier was preloaded. */ - + if(pKbl->Flags & KBL_PRELOAD) { DPRINT1("Attempted to unload preloaded keyboard layout.\n"); return FALSE; } - + if(pKbl->RefCount > 0) { /* Layout is used by other threads. @@ -344,36 +344,36 @@ BOOL UserUnloadKbl(PKBL pKbl) RemoveEntryList(&pKbl->List); ExFreePool(pKbl); } - + return TRUE; } static PKBL co_UserActivateKbl(PW32THREAD w32Thread, PKBL pKbl, UINT Flags) { PKBL Prev; - + Prev = w32Thread->KeyboardLayout; Prev->RefCount--; w32Thread->KeyboardLayout = pKbl; pKbl->RefCount++; - + if(Flags & KLF_SETFORPROCESS) { //FIXME - + } - + if(Prev->Flags & KBL_UNLOAD && Prev->RefCount == 0) { UserUnloadKbl(Prev); } - + // Send WM_INPUTLANGCHANGE to thread's focus window - co_IntSendMessage(w32Thread->MessageQueue->FocusWindow, - WM_INPUTLANGCHANGE, + co_IntSendMessage(w32Thread->MessageQueue->FocusWindow, + WM_INPUTLANGCHANGE, 0, // FIXME: put charset here (what is this?) (LPARAM)pKbl->hkl); //klid - + return Prev; } @@ -400,8 +400,8 @@ UserGetKeyboardLayout( SetLastWin32Error(ERROR_INVALID_PARAMETER); return NULL; } - - W32Thread = PsGetThreadWin32Thread(Thread); + + W32Thread = PsGetThreadWin32Thread(Thread); Ret = W32Thread->KeyboardLayout->hkl; ObDereferenceObject(Thread); return Ret; @@ -415,10 +415,10 @@ NtUserGetKeyboardLayoutList( { UINT Ret = 0; PKBL pKbl; - + UserEnterShared(); pKbl = KBLList; - + if(nItems == 0) { do @@ -427,12 +427,12 @@ NtUserGetKeyboardLayoutList( pKbl = (PKBL) pKbl->List.Flink; } while(pKbl != KBLList); } - else + else { _SEH_TRY { - ProbeForWrite(pHklBuff, nItems*sizeof(HKL), 4); - + ProbeForWrite(pHklBuff, nItems*sizeof(HKL), 4); + while(Ret < nItems) { if(!(pKbl->Flags & KBL_UNLOAD)) @@ -443,7 +443,7 @@ NtUserGetKeyboardLayoutList( if(pKbl == KBLList) break; } } - + } _SEH_HANDLE { @@ -452,7 +452,7 @@ NtUserGetKeyboardLayoutList( } _SEH_END; } - + UserLeave(); return Ret; } @@ -469,7 +469,7 @@ NtUserGetKeyboardLayoutName( _SEH_TRY { - ProbeForWrite(lpszName, KL_NAMELENGTH*sizeof(WCHAR), 1); + ProbeForWrite(lpszName, KL_NAMELENGTH*sizeof(WCHAR), 1); pKbl = PsGetCurrentThreadWin32Thread()->KeyboardLayout; RtlCopyMemory(lpszName, pKbl->Name, KL_NAMELENGTH*sizeof(WCHAR)); ret = TRUE; @@ -480,7 +480,7 @@ NtUserGetKeyboardLayoutName( ret = FALSE; } _SEH_END; - + UserLeave(); return ret; } @@ -488,7 +488,7 @@ NtUserGetKeyboardLayoutName( HKL STDCALL -NtUserLoadKeyboardLayoutEx( +NtUserLoadKeyboardLayoutEx( IN HANDLE Handle, IN DWORD offTable, IN PUNICODE_STRING puszKeyboardName, @@ -499,9 +499,9 @@ NtUserLoadKeyboardLayoutEx( { HKL Ret = NULL; PKBL pKbl = NULL, Cur; - + UserEnterExclusive(); - + //Let's see if layout was already loaded. Cur = KBLList; do @@ -512,36 +512,36 @@ NtUserLoadKeyboardLayoutEx( pKbl->Flags &= ~KBL_UNLOAD; break; } - + Cur = (PKBL) Cur->List.Flink; } while(Cur != KBLList); - + //It wasn't, so load it. - if(!pKbl) + if(!pKbl) { pKbl = UserLoadDllAndCreateKbl(dwKLID); - + if(!pKbl) { goto the_end; } - + InsertTailList(&KBLList->List, &pKbl->List); } - + if(Flags & KLF_REORDER) KBLList = pKbl; - - if(Flags & KLF_ACTIVATE) + + if(Flags & KLF_ACTIVATE) { co_UserActivateKbl(PsGetCurrentThreadWin32Thread(), pKbl, Flags); } Ret = pKbl->hkl; - + //FIXME: KLF_NOTELLSHELL // KLF_REPLACELANG - // KLF_SUBSTITUTE_OK - + // KLF_SUBSTITUTE_OK + the_end: UserLeave(); return Ret; @@ -556,17 +556,17 @@ NtUserActivateKeyboardLayout( PKBL pKbl; HKL Ret = NULL; PW32THREAD pWThread; - + UserEnterExclusive(); - + pWThread = PsGetCurrentThreadWin32Thread(); - + if(pWThread->KeyboardLayout->hkl == hKl) { Ret = hKl; goto the_end; } - + if(hKl == (HKL)HKL_NEXT) { pKbl = (PKBL)pWThread->KeyboardLayout->List.Flink; @@ -576,14 +576,14 @@ NtUserActivateKeyboardLayout( pKbl = (PKBL)pWThread->KeyboardLayout->List.Blink; } else pKbl = UserHklToKbl(hKl); - + //FIXME: KLF_RESET, KLF_SHIFTLOCK - + if(pKbl) { if(Flags & KLF_REORDER) KBLList = pKbl; - + if(pKbl == pWThread->KeyboardLayout) { Ret = pKbl->hkl; @@ -598,7 +598,7 @@ NtUserActivateKeyboardLayout( { DPRINT1("%s: Invalid HKL %x!\n", __FUNCTION__, hKl); } - + the_end: UserLeave(); return Ret; @@ -611,18 +611,18 @@ NtUserUnloadKeyboardLayout( { PKBL pKbl; BOOL Ret = FALSE; - + UserEnterExclusive(); - + if((pKbl = UserHklToKbl(hKl))) { Ret = UserUnloadKbl(pKbl); } - else + else { - DPRINT1("%s: Invalid HKL %x!\n", __FUNCTION__, hKl); + DPRINT1("%s: Invalid HKL %x!\n", __FUNCTION__, hKl); } - + UserLeave(); return Ret; } diff --git a/reactos/subsystems/win32/win32k/ntuser/keyboard.c b/reactos/subsystems/win32/win32k/ntuser/keyboard.c index eda53efea78..657f52433d5 100644 --- a/reactos/subsystems/win32/win32k/ntuser/keyboard.c +++ b/reactos/subsystems/win32/win32k/ntuser/keyboard.c @@ -546,10 +546,10 @@ NtUserGetKeyboardState( { BOOL Result = TRUE; DECLARE_RETURN(DWORD); - + DPRINT("Enter NtUserGetKeyboardState\n"); UserEnterShared(); - + if (lpKeyState) { if(!NT_SUCCESS(MmCopyToCaller(lpKeyState, gQueueKeyStateTable, 256))) @@ -557,7 +557,7 @@ NtUserGetKeyboardState( } RETURN(Result); - + CLEANUP: DPRINT("Leave NtUserGetKeyboardState, ret=%i\n",_ret_); UserLeave(); @@ -570,7 +570,7 @@ NtUserSetKeyboardState(LPBYTE lpKeyState) { BOOL Result = TRUE; DECLARE_RETURN(DWORD); - + DPRINT("Enter NtUserSetKeyboardState\n"); UserEnterExclusive(); @@ -579,7 +579,7 @@ NtUserSetKeyboardState(LPBYTE lpKeyState) if(! NT_SUCCESS(MmCopyFromCaller(gQueueKeyStateTable, lpKeyState, 256))) Result = FALSE; } - + RETURN(Result); CLEANUP: @@ -704,21 +704,21 @@ NtUserMapVirtualKeyEx( UINT Code, UINT Type, DWORD keyboardId, HKL dwhkl ) { PKBDTABLES keyLayout; DECLARE_RETURN(UINT); - + DPRINT("Enter NtUserMapVirtualKeyEx\n"); UserEnterExclusive(); - + keyLayout = PsGetCurrentThreadWin32Thread() ? PsGetCurrentThreadWin32Thread()->KeyboardLayout->KBTables : 0; if( !keyLayout ) RETURN(0); RETURN(IntMapVirtualKeyEx( Code, Type, keyLayout )); - + CLEANUP: DPRINT("Leave NtUserMapVirtualKeyEx, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } @@ -737,7 +737,7 @@ NtUserToUnicodeEx( PWCHAR OutPwszBuff = 0; int ret = 0; DECLARE_RETURN(int); - + DPRINT("Enter NtUserSetKeyboardState\n"); UserEnterShared();//faxme: this syscall doesnt seem to need any locking... @@ -769,11 +769,11 @@ NtUserToUnicodeEx( ExFreePool(OutPwszBuff); RETURN(ret); - + CLEANUP: DPRINT("Leave NtUserSetKeyboardState, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } static int W32kSimpleToupper( int ch ) @@ -796,10 +796,10 @@ NtUserGetKeyNameText( LONG lParam, LPWSTR lpString, int nSize ) PKBDTABLES keyLayout; VSC_LPWSTR *KeyNames; DECLARE_RETURN(DWORD); - + DPRINT("Enter NtUserGetKeyNameText\n"); UserEnterShared(); - + keyLayout = PsGetCurrentThreadWin32Thread() ? PsGetCurrentThreadWin32Thread()->KeyboardLayout->KBTables : 0; @@ -864,7 +864,7 @@ NtUserGetKeyNameText( LONG lParam, LPWSTR lpString, int nSize ) } RETURN(ret); - + CLEANUP: DPRINT("Leave NtUserGetKeyNameText, ret=%i\n",_ret_); UserLeave(); @@ -898,7 +898,7 @@ W32kKeyProcessMessage(LPMSG Msg, { VK_UP, VK_NUMPAD8 }, { VK_PRIOR, VK_NUMPAD9 }, { 0,0 } }; - PVSC_VK VscVkTable = NULL; + PVSC_VK VscVkTable = NULL; if( !KeyboardLayout || !Msg || (Msg->message != WM_KEYDOWN && Msg->message != WM_SYSKEYDOWN && diff --git a/reactos/subsystems/win32/win32k/ntuser/menu.c b/reactos/subsystems/win32/win32k/ntuser/menu.c index d82ceea4442..e99168ee81b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/menu.c +++ b/reactos/subsystems/win32/win32k/ntuser/menu.c @@ -120,13 +120,13 @@ CleanupMenuImpl(VOID) PMENU_OBJECT FASTCALL UserGetMenuObject(HMENU hMenu) { PMENU_OBJECT Menu; - + if (!hMenu) { SetLastWin32Error(ERROR_INVALID_MENU_HANDLE); return NULL; } - + Menu = (PMENU_OBJECT)UserGetObject(gHandleTable, hMenu, otMenu); if (!Menu) { @@ -1519,12 +1519,12 @@ CLEANUP: BOOL FASTCALL UserDestroyMenu(HMENU hMenu) { PMENU_OBJECT Menu; - + if(!(Menu = UserGetMenuObject(hMenu))) { return FALSE; } - + if(Menu->Process != PsGetCurrentProcess()) { SetLastWin32Error(ERROR_ACCESS_DENIED); @@ -1551,7 +1551,7 @@ NtUserDestroyMenu( { RETURN( FALSE); } - + if(Menu->Process != PsGetCurrentProcess()) { SetLastWin32Error(ERROR_ACCESS_DENIED); @@ -1716,10 +1716,10 @@ NtUserGetMenuBarInfo( RECT Rect; MENUBARINFO kmbi; DECLARE_RETURN(BOOL); - + DPRINT("Enter NtUserGetMenuBarInfo\n"); UserEnterShared(); - + if (!(WindowObject = UserGetWindowObject(hwnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); @@ -1744,7 +1744,7 @@ NtUserGetMenuBarInfo( kmbi.fBarFocused = FALSE; kmbi.fFocused = FALSE; kmbi.hwndMenu = NULL; - + switch (idObject) { case OBJID_MENU: @@ -1762,7 +1762,7 @@ NtUserGetMenuBarInfo( } } else - { + { /* If items is zero we assume info for the menu itself. */ if (!(IntGetClientOrigin(WindowObject, &Offset))) { @@ -1909,7 +1909,7 @@ NtUserGetMenuBarInfo( CLEANUP: DPRINT("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } @@ -1957,9 +1957,9 @@ NtUserGetMenuItemRect( Rect = MenuItem->Rect; else RETURN(FALSE); - + referenceHwnd = hWnd; - + if(!hWnd) { if(!UserMenuInfo(Menu, &mi, FALSE)) @@ -2008,12 +2008,12 @@ NtUserHiliteMenuItem( { RETURN(FALSE); } - + if(!(Menu = UserGetMenuObject(hMenu))) { RETURN(FALSE); } - + if(Window->IDMenu == (UINT)hMenu) { RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite)); diff --git a/reactos/subsystems/win32/win32k/ntuser/message.c b/reactos/subsystems/win32/win32k/ntuser/message.c index 134bd2db08c..9012defca33 100644 --- a/reactos/subsystems/win32/win32k/ntuser/message.c +++ b/reactos/subsystems/win32/win32k/ntuser/message.c @@ -115,7 +115,7 @@ MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam) PUNICODE_STRING ClassName; UINT Size = 0; - _SEH_TRY + _SEH_TRY { if (MMS_SIZE_WPARAM == MsgMemoryEntry->Size) { @@ -167,12 +167,12 @@ MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam) { Size = MsgMemoryEntry->Size; } - } - _SEH_HANDLE + } + _SEH_HANDLE { DPRINT1("Exception caught in MsgMemorySize()! Status: 0x%x\n", _SEH_GetExceptionCode()); Size = 0; - } + } _SEH_END; return Size; } @@ -356,7 +356,7 @@ NtUserDispatchMessage(PNTUSERDISPATCHMESSAGEINFO UnsafeMsgInfo) else { PWINDOW_OBJECT Window; - + /* Get the window object. */ Window = UserGetWindowObject(MsgInfo.Msg.hwnd); if (NULL == Window) @@ -564,9 +564,9 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT * if((DesktopWindow = UserGetWindowObject(hDesktop))) { PWINDOW_OBJECT Wnd; - + UserRefObjectCo(DesktopWindow, &DesktopRef); - + co_WinPosWindowFromPoint(DesktopWindow, Window->MessageQueue, &Msg->pt, &Wnd); if(Wnd) { @@ -790,7 +790,7 @@ MessageFound: goto CheckMessages; } } - + UserDerefObjectCo(MsgWindow); } else @@ -976,9 +976,9 @@ NtUserGetMessage(PNTUSERGETMESSAGEINFO UnsafeInfo, { RETURN(-1); } - + // if (Window) UserRefObjectCo(Window, &Ref); - + if (MsgFilterMax < MsgFilterMin) { MsgFilterMin = 0; @@ -1186,7 +1186,7 @@ UserPostMessage(HWND Wnd, DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); List = IntWinListChildren(DesktopWindow); - + if (List != NULL) { for (i = 0; List[i]; i++) @@ -1197,7 +1197,7 @@ UserPostMessage(HWND Wnd, else { PWINDOW_OBJECT Window; - + Window = UserGetWindowObject(Wnd); if (NULL == Window) { @@ -1334,7 +1334,7 @@ co_IntSendMessage(HWND hWnd, return 0; } -static +static LRESULT FASTCALL co_IntSendMessageTimeoutSingle(HWND hWnd, UINT Msg, @@ -1359,7 +1359,7 @@ co_IntSendMessageTimeoutSingle(HWND hWnd, { RETURN( FALSE); } - + UserRefObjectCo(Window, &Ref); Win32Thread = PsGetCurrentThreadWin32Thread(); @@ -1437,7 +1437,7 @@ co_IntSendMessageTimeoutSingle(HWND hWnd, } RETURN( TRUE); - + CLEANUP: if (Window) UserDerefObjectCo(Window); END_CLEANUP; @@ -1717,7 +1717,7 @@ UserSendNotifyMessage(HWND hWnd, DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); List = IntWinListChildren(DesktopWindow); - + if (List != NULL) { for (i = 0; List[i]; i++) diff --git a/reactos/subsystems/win32/win32k/ntuser/misc.c b/reactos/subsystems/win32/win32k/ntuser/misc.c index f8333bb25ad..362160b8bbc 100644 --- a/reactos/subsystems/win32/win32k/ntuser/misc.c +++ b/reactos/subsystems/win32/win32k/ntuser/misc.c @@ -154,77 +154,77 @@ NtUserCallOneParam( { PWINSTATION_OBJECT WinSta = PsGetCurrentThreadWin32Thread()->Desktop->WindowStation; PSYSTEM_CURSORINFO CurInfo; - + HDC Screen; HBITMAP dcbmp; - SURFOBJ *SurfObj; + SURFOBJ *SurfObj; BITMAPOBJ *BitmapObj; GDIDEVICE *ppdev; GDIPOINTER *pgp; int showpointer=0; - + if(!(Screen = IntGetScreenDC())) { return showpointer; /* No mouse */ } - + dc = DC_LockDc(Screen); if (!dc) { return showpointer; /* No mouse */ } - + dcbmp = dc->w.hBitmap; DC_UnlockDc(dc); BitmapObj = BITMAPOBJ_LockBitmap(dcbmp); if ( !BitmapObj ) { - BITMAPOBJ_UnlockBitmap(BitmapObj); + BITMAPOBJ_UnlockBitmap(BitmapObj); return showpointer; /* No Mouse */ } - + SurfObj = &BitmapObj->SurfObj; if (SurfObj == NULL) { - BITMAPOBJ_UnlockBitmap(BitmapObj); + BITMAPOBJ_UnlockBitmap(BitmapObj); return showpointer; /* No mouse */ } - + ppdev = GDIDEV(SurfObj); - + if(ppdev == NULL) { - BITMAPOBJ_UnlockBitmap(BitmapObj); + BITMAPOBJ_UnlockBitmap(BitmapObj); return showpointer; /* No mouse */ } - + pgp = &ppdev->Pointer; - + CurInfo = IntGetSysCursorInfo(WinSta); - + if (Param == FALSE) { - pgp->ShowPointer--; + pgp->ShowPointer--; showpointer = pgp->ShowPointer; - + if (showpointer >= 0) - { + { //ppdev->SafetyRemoveCount = 1; //ppdev->SafetyRemoveLevel = 1; - EngMovePointer(SurfObj,-1,-1,NULL); - CurInfo->ShowingCursor = 0; + EngMovePointer(SurfObj,-1,-1,NULL); + CurInfo->ShowingCursor = 0; } - + } else { pgp->ShowPointer++; showpointer = pgp->ShowPointer; - - /* Show Cursor */ - if (showpointer < 0) + + /* Show Cursor */ + if (showpointer < 0) { //ppdev->SafetyRemoveCount = 0; //ppdev->SafetyRemoveLevel = 0; @@ -232,16 +232,16 @@ NtUserCallOneParam( CurInfo->ShowingCursor = CURSOR_SHOWING; } } - - BITMAPOBJ_UnlockBitmap(BitmapObj); - return showpointer; + + BITMAPOBJ_UnlockBitmap(BitmapObj); + return showpointer; } - - + + UserEnterExclusive(); switch(Routine) - { + { case ONEPARAM_ROUTINE_GETMENU: { PWINDOW_OBJECT Window; @@ -487,7 +487,7 @@ NtUserCallTwoParam( RECT rcRect; Window = UserGetWindowObject((HWND)Param1); if (!Window) RETURN(ERROR); - + Ret = (DWORD)IntGetWindowRgnBox(Window, &rcRect); Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT)); if(!NT_SUCCESS(Status)) @@ -561,7 +561,7 @@ NtUserCallTwoParam( { Window = UserGetWindowObject((HWND)Param1); if (!Window) RETURN(0); - + RETURN( (DWORD)IntShowOwnedPopups(Window, (BOOL) Param2)); } @@ -569,12 +569,12 @@ NtUserCallTwoParam( { #define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000040) DPRINT1("ROS_SHOWWINDOW\n"); - + if (!(Window = UserGetWindowObject((HWND)Param1))) { RETURN( 1 ); } - + if (Param2) { if (!(Window->Flags & WIN_NEEDS_SHOW_OWNEDPOPUP)) @@ -595,7 +595,7 @@ NtUserCallTwoParam( RETURN( 0); case TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID: - + if(!(Window = UserGetWindowObject((HWND)Param1))) { RETURN( (DWORD)FALSE); @@ -799,16 +799,16 @@ NtUserCallHwndLock( Ret = FALSE; if (!((Window->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD)) break; - + if(!(Menu = UserGetMenuObject((HMENU) Window->IDMenu))) break; - + Menu->MenuInfo.WndOwner = hWnd; Menu->MenuInfo.Height = 0; co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); - + Ret = TRUE; break; } @@ -986,7 +986,7 @@ IntSystemParametersInfo( switch(uiAction) { case SPI_GETDRAGFULLWINDOWS: - /* FIXME: Implement this, don't just return constant */ + /* FIXME: Implement this, don't just return constant */ *(PBOOL)pvParam = FALSE; break; @@ -997,7 +997,7 @@ IntSystemParametersInfo( case SPI_SETDOUBLECLKHEIGHT: case SPI_SETDOUBLECLICKTIME: case SPI_SETDESKWALLPAPER: - case SPI_SETSCREENSAVERRUNNING: + case SPI_SETSCREENSAVERRUNNING: case SPI_SETSCREENSAVETIMEOUT: case SPI_SETFLATMENU: case SPI_SETMOUSEHOVERTIME: @@ -1075,7 +1075,7 @@ IntSystemParametersInfo( ASSERT(pvParam); CurInfo = IntGetSysCursorInfo(WinStaObject); *((UINT*)pvParam) = CurInfo->WheelScroChars; - // FIXME add this value to scroll list as scroll value ?? + // FIXME add this value to scroll list as scroll value ?? break; case SPI_SETDOUBLECLKWIDTH: CurInfo = IntGetSysCursorInfo(WinStaObject); @@ -1097,7 +1097,7 @@ IntSystemParametersInfo( *((UINT*)pvParam) = CurInfo->MouseHoverTime; break; case SPI_SETMOUSEHOVERTIME: - /* see http://msdn2.microsoft.com/en-us/library/ms724947.aspx + /* see http://msdn2.microsoft.com/en-us/library/ms724947.aspx * copy text from it, if some agument why xp and 2003 behovir diffent * only if they do not have SP install * " Windows Server 2003 and Windows XP: The operating system does not @@ -1106,16 +1106,16 @@ IntSystemParametersInfo( */ CurInfo = IntGetSysCursorInfo(WinStaObject); CurInfo->MouseHoverTime = uiParam; - if(CurInfo->MouseHoverTime < USER_TIMER_MINIMUM) + if(CurInfo->MouseHoverTime < USER_TIMER_MINIMUM) { CurInfo->MouseHoverTime = USER_TIMER_MINIMUM; } - if(CurInfo->MouseHoverTime > USER_TIMER_MAXIMUM) + if(CurInfo->MouseHoverTime > USER_TIMER_MAXIMUM) { CurInfo->MouseHoverTime = USER_TIMER_MAXIMUM; } - break; + break; case SPI_GETMOUSEHOVERWIDTH: CurInfo = IntGetSysCursorInfo(WinStaObject); *(PUINT)pvParam = CurInfo->MouseHoverWidth; @@ -1127,27 +1127,27 @@ IntSystemParametersInfo( case SPI_SETMOUSEHOVERWIDTH: CurInfo = IntGetSysCursorInfo(WinStaObject); CurInfo->MouseHoverWidth = uiParam; - break; + break; case SPI_SETMOUSEHOVERHEIGHT: CurInfo = IntGetSysCursorInfo(WinStaObject); CurInfo->MouseHoverHeight = uiParam; - break; + break; case SPI_SETMOUSEBUTTONSWAP: CurInfo = IntGetSysCursorInfo(WinStaObject); CurInfo->SwapButtons = uiParam; - break; + break; case SPI_SETMOUSE: CurInfo = IntGetSysCursorInfo(WinStaObject); CurInfo->CursorAccelerationInfo = *(PCURSORACCELERATION_INFO)pvParam; - break; + break; case SPI_GETMOUSE: CurInfo = IntGetSysCursorInfo(WinStaObject); *(PCURSORACCELERATION_INFO)pvParam = CurInfo->CursorAccelerationInfo; - break; + break; case SPI_SETMOUSESPEED: CurInfo = IntGetSysCursorInfo(WinStaObject); CurInfo->MouseSpeed = (UINT)pvParam; - /* Limit value to 1...20 range */ + /* Limit value to 1...20 range */ if(CurInfo->MouseSpeed < 1) { CurInfo->MouseSpeed = 1; @@ -1160,7 +1160,7 @@ IntSystemParametersInfo( case SPI_GETMOUSESPEED: CurInfo = IntGetSysCursorInfo(WinStaObject); *(PUINT)pvParam = CurInfo->MouseSpeed; - break; + break; case SPI_SETDESKWALLPAPER: { /* This function expects different parameters than the user mode version! @@ -1169,8 +1169,8 @@ IntSystemParametersInfo( the bitmap. We'll change it's ownership to system and replace it with the current wallpaper bitmap */ HBITMAP hOldBitmap, hNewBitmap; - UNICODE_STRING Key = RTL_CONSTANT_STRING(L"Control Panel\\Desktop"); - UNICODE_STRING Tile = RTL_CONSTANT_STRING(L"TileWallpaper"); + UNICODE_STRING Key = RTL_CONSTANT_STRING(L"Control Panel\\Desktop"); + UNICODE_STRING Tile = RTL_CONSTANT_STRING(L"TileWallpaper"); UNICODE_STRING Style = RTL_CONSTANT_STRING(L"WallpaperStyle"); UNICODE_STRING KeyPath; OBJECT_ATTRIBUTES KeyAttributes; @@ -1225,7 +1225,7 @@ IntSystemParametersInfo( CurrentUserKey, NULL); ZwOpenKey(&KeyHandle, KEY_READ, &KeyAttributes); ZwClose(CurrentUserKey); - + /* read the tile value in the registry */ Status = ZwQueryValueKey(KeyHandle, &Tile, KeyValuePartialInformation, 0, 0, &ResLength); @@ -1263,7 +1263,7 @@ IntSystemParametersInfo( Tile.Length = KeyValuePartialInfo->DataLength; Tile.MaximumLength = KeyValuePartialInfo->DataLength; Tile.Buffer = (PWSTR)KeyValuePartialInfo->Data; - + Status = RtlUnicodeStringToInteger(&Tile, 0, &TileNum); if(!NT_SUCCESS(Status)) { @@ -1298,7 +1298,7 @@ IntSystemParametersInfo( Style.Length = KeyValuePartialInfo->DataLength; Style.MaximumLength = KeyValuePartialInfo->DataLength; Style.Buffer = (PWSTR)KeyValuePartialInfo->Data; - + Status = RtlUnicodeStringToInteger(&Style, 0, &StyleNum); if(!NT_SUCCESS(Status)) { @@ -1315,7 +1315,7 @@ IntSystemParametersInfo( { WinStaObject->WallpaperMode = wmStretch; } - + ZwClose(KeyHandle); break; } @@ -1493,7 +1493,7 @@ IntSystemParametersInfo( return TRUE; } -static BOOL +static BOOL UserSystemParametersInfo_StructSet( UINT uiAction, UINT uiParam, @@ -1531,7 +1531,7 @@ UserSystemParametersInfo_StructSet( return IntSystemParametersInfo(uiAction, uiParam, pBuffer, fWinIni); } -static BOOL +static BOOL UserSystemParametersInfo_StructGet( UINT uiAction, UINT uiParam, @@ -1609,7 +1609,7 @@ UserSystemParametersInfo( case SPI_SETLOWPOWERTIMEOUT: case SPI_SETPOWEROFFACTIVE: case SPI_SETPOWEROFFTIMEOUT: -#endif +#endif case SPI_SETICONS: case SPI_SETSCREENSAVETIMEOUT: case SPI_SETSCREENSAVEACTIVE: @@ -1814,7 +1814,7 @@ UserSystemParametersInfo( } case SPI_SETNONCLIENTMETRICS: { - NONCLIENTMETRICSW Buffer; + NONCLIENTMETRICSW Buffer; return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_GETANIMATION: @@ -1829,44 +1829,44 @@ UserSystemParametersInfo( } case SPI_GETACCESSTIMEOUT: { - ACCESSTIMEOUT Buffer; + ACCESSTIMEOUT Buffer; return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_SETACCESSTIMEOUT: { - ACCESSTIMEOUT Buffer; + ACCESSTIMEOUT Buffer; return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_GETFILTERKEYS: { - FILTERKEYS Buffer; + FILTERKEYS Buffer; return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_SETFILTERKEYS: { - FILTERKEYS Buffer; + FILTERKEYS Buffer; return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_GETSTICKYKEYS: { - STICKYKEYS Buffer; + STICKYKEYS Buffer; return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_SETSTICKYKEYS: { - STICKYKEYS Buffer; + STICKYKEYS Buffer; return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_GETTOGGLEKEYS: { - TOGGLEKEYS Buffer; + TOGGLEKEYS Buffer; return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_SETTOGGLEKEYS: { - TOGGLEKEYS Buffer; + TOGGLEKEYS Buffer; return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni, &Buffer,sizeof(Buffer)); } case SPI_SETWORKAREA: diff --git a/reactos/subsystems/win32/win32k/ntuser/monitor.c b/reactos/subsystems/win32/win32k/ntuser/monitor.c index 9c2bbc5c2ea..ee79a9cef4c 100644 --- a/reactos/subsystems/win32/win32k/ntuser/monitor.c +++ b/reactos/subsystems/win32/win32k/ntuser/monitor.c @@ -124,14 +124,14 @@ PMONITOR_OBJECT FASTCALL UserGetMonitorObject(IN HMONITOR hMonitor) { PMONITOR_OBJECT Monitor; - + if (!hMonitor) { SetLastWin32Error(ERROR_INVALID_MONITOR_HANDLE); return NULL; } - - + + Monitor = (PMONITOR_OBJECT)UserGetObject(gHandleTable, hMonitor, otMonitor); if (!Monitor) { @@ -618,10 +618,10 @@ NtUserGetMonitorInfo( MONITORINFOEXW MonitorInfo; NTSTATUS Status; DECLARE_RETURN(BOOL); - + DPRINT("Enter NtUserGetMonitorInfo\n"); UserEnterShared(); - + /* get monitor object */ if (!(Monitor = UserGetMonitorObject(hMonitor))) { @@ -684,7 +684,7 @@ NtUserGetMonitorInfo( DPRINT("GetMonitorInfo: success\n"); RETURN(TRUE); - + CLEANUP: DPRINT("Leave NtUserGetMonitorInfo, ret=%i\n",_ret_); UserLeave(); @@ -777,7 +777,7 @@ NtUserMonitorFromRect( HMONITOR hMonitor = NULL; RECT rect; NTSTATUS status; - + /* get rect */ status = MmCopyFromCaller(&rect, pRect, sizeof (RECT)); if (!NT_SUCCESS(status)) @@ -870,10 +870,10 @@ NtUserMonitorFromWindow( HMONITOR hMonitor = NULL; RECT Rect; DECLARE_RETURN(HMONITOR); - + DPRINT("Enter NtUserMonitorFromWindow\n"); UserEnterShared(); - + if (!(Window = UserGetWindowObject(hWnd))) { RETURN(NULL); @@ -885,9 +885,9 @@ NtUserMonitorFromWindow( IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags); RETURN(hMonitor); - + CLEANUP: DPRINT("Leave NtUserMonitorFromWindow, ret=%i\n",_ret_); UserLeave(); - END_CLEANUP; + END_CLEANUP; } diff --git a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c index e5969588ca7..afb0aada373 100644 --- a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c @@ -164,7 +164,7 @@ MsqInsertSystemMessage(MSG* Msg) KeQueryTickCount(&LargeTickCount); Msg->time = MsqCalculateMessageTime(&LargeTickCount); - + /* * If we got WM_MOUSEMOVE and there are already messages in the * system message queue, check if the last message is mouse move @@ -267,7 +267,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, UINT Fi USHORT Msg = Message->Msg.message; PWINDOW_OBJECT Window = NULL; HWND hCaptureWin; - + ASSERT_REFS_CO(ScopeWin); /* @@ -275,7 +275,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, UINT Fi that window has a ref that we need to deref. Thats why we add "dummy" refs in all other cases. */ - + hCaptureWin = IntGetCaptureWindow(); if (hCaptureWin == NULL) { @@ -478,7 +478,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, NTSTATUS WaitStatus; DECLARE_RETURN(BOOL); USER_REFERENCE_ENTRY Ref; - + WaitObjects[1] = MessageQueue->NewMessages; WaitObjects[0] = &HardwareMessageQueueLock; do @@ -498,9 +498,9 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, while (NT_SUCCESS(WaitStatus) && STATUS_WAIT_0 != WaitStatus); DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); - + if (DesktopWindow) UserRefObjectCo(DesktopWindow, &Ref);//can DesktopWindow be NULL? - + /* Process messages in the message queue itself. */ IntLockHardwareMessageQueue(MessageQueue); CurrentEntry = MessageQueue->HardwareMessagesListHead.Flink; @@ -512,9 +512,9 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, if (Current->Msg.message >= WM_MOUSEFIRST && Current->Msg.message <= WM_MOUSELAST) { - - - + + + Accept = co_MsqTranslateMouseMessage(MessageQueue, hWnd, FilterLow, FilterHigh, Current, Remove, &Freed, DesktopWindow, &ScreenPoint, FALSE); @@ -527,7 +527,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, IntUnLockHardwareMessageQueue(MessageQueue); IntUnLockSystemHardwareMessageQueueLock(FALSE); *Message = Current; - + RETURN(TRUE); } @@ -671,9 +671,9 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, RETURN(FALSE); -CLEANUP: +CLEANUP: if (DesktopWindow) UserDerefObjectCo(DesktopWindow); - + END_CLEANUP; } diff --git a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c index f117c53e5a8..26097583c44 100644 --- a/reactos/subsystems/win32/win32k/ntuser/ntstubs.c +++ b/reactos/subsystems/win32/win32k/ntuser/ntstubs.c @@ -359,19 +359,19 @@ NtUserGetMouseMovePointsEx( SetLastWin32Error(GMMP_ERR_POINT_NOT_FOUND); return GMMP_ERR_POINT_NOT_FOUND; } - + if (!lppt) { SetLastWin32Error(GMMP_ERR_POINT_NOT_FOUND); return GMMP_ERR_POINT_NOT_FOUND; } - + if (!lpptBuf) { SetLastWin32Error(GMMP_ERR_POINT_NOT_FOUND); return GMMP_ERR_POINT_NOT_FOUND; } - + switch(resolution) { case GMMP_USE_DISPLAY_POINTS: @@ -381,7 +381,7 @@ NtUserGetMouseMovePointsEx( SetLastWin32Error(GMMP_ERR_POINT_NOT_FOUND); return GMMP_ERR_POINT_NOT_FOUND; } - */ + */ UNIMPLEMENTED return 0; @@ -780,7 +780,7 @@ NtUserGetAtomName( } /* for hints how the prototype might be, see - http://forum.grafika.cz/read.php?23,1816012,1816139,quote=1 + http://forum.grafika.cz/read.php?23,1816012,1816139,quote=1 http://www.cyber-ta.org/releases/malware-analysis/public/SOURCES/b47155634ccb2c30630da7e3666d3d07/b47155634ccb2c30630da7e3666d3d07.trace.html#NtUserGetIconSize */ BOOL NTAPI diff --git a/reactos/subsystems/win32/win32k/ntuser/ntuser.c b/reactos/subsystems/win32/win32k/ntuser/ntuser.c index 7f5e95b194a..5071283e22d 100644 --- a/reactos/subsystems/win32/win32k/ntuser/ntuser.c +++ b/reactos/subsystems/win32/win32k/ntuser/ntuser.c @@ -66,7 +66,7 @@ RETURN */ BOOL FASTCALL UserIsEntered() { - return ExIsResourceAcquiredExclusiveLite(&UserLock) + return ExIsResourceAcquiredExclusiveLite(&UserLock) || ExIsResourceAcquiredSharedLite(&UserLock); } diff --git a/reactos/subsystems/win32/win32k/ntuser/painting.c b/reactos/subsystems/win32/win32k/ntuser/painting.c index 508b0c6bbe8..9c34d0b178b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/painting.c +++ b/reactos/subsystems/win32/win32k/ntuser/painting.c @@ -89,7 +89,7 @@ IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse) while (ParentWindow) { if (ParentWindow->Style & WS_CLIPCHILDREN) - break; + break; if (ParentWindow->UpdateRegion != 0) { @@ -158,7 +158,7 @@ IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate) HRGN hRgnNonClient; HRGN hRgnWindow; UINT RgnType; - + if (Window->UpdateRegion != NULL && Window->UpdateRegion != (HRGN)1) { @@ -763,7 +763,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs) } UserRefObjectCo(Window, &Ref); - + co_UserHideCaret(Window); if (Window->Flags & WINDOWOBJECT_NEED_NCPAINT) @@ -817,7 +817,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs) { if (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) MsqDecPaintCountQueue(Window->MessageQueue); - + IntGetClientRect(Window, &Ps.rcPaint); } @@ -855,7 +855,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs) CLEANUP: if (Window) UserDerefObjectCo(Window); - + DPRINT("Leave NtUserBeginPaint, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; @@ -1169,7 +1169,7 @@ UserScrollDC(HDC hDC, INT dx, INT dy, const RECT *prcScroll, return ERROR; } - /* Calculate the region that was invalidated by moving or + /* Calculate the region that was invalidated by moving or could not be copied, because it was not visible */ if (hrgnUpdate || prcUpdate) { @@ -1267,7 +1267,7 @@ NtUserScrollDC(HDC hDC, INT dx, INT dy, const RECT *prcUnsafeScroll, RETURN(FALSE); } - if (UserScrollDC(hDC, dx, dy, + if (UserScrollDC(hDC, dx, dy, prcUnsafeScroll? &rcScroll : 0, prcUnsafeClip? &rcClip : 0, hrgnUpdate, prcUnsafeUpdate? &rcUpdate : NULL) == ERROR) @@ -1490,33 +1490,33 @@ CLEANUP: BOOL UserDrawSysMenuButton( - PWINDOW_OBJECT pWnd, - HDC hDc, - LPRECT lpRc, + PWINDOW_OBJECT pWnd, + HDC hDc, + LPRECT lpRc, BOOL Down) { HICON hIcon; PCURICON_OBJECT pIcon; - + ASSERT(pWnd && lpRc); - + /* Get the icon to draw. We don't care about WM_GETICON here. */ - + hIcon = pWnd->Class->hIconSm; - + if(!hIcon) { DPRINT("Wnd class has no small icon.\n"); hIcon = pWnd->Class->hIcon; } - + if(!hIcon) { DPRINT("Wnd class hasn't any icon.\n"); - //FIXME: Draw "winlogo" icon. + //FIXME: Draw "winlogo" icon. return FALSE; } - + if(!(pIcon = UserGetCurIconObject(hIcon))) { DPRINT1("UserGetCurIconObject() failed!\n"); @@ -1524,7 +1524,7 @@ UserDrawSysMenuButton( } return UserDrawIconEx(hDc, lpRc->left, lpRc->top, pIcon, - UserGetSystemMetrics(SM_CXSMICON), + UserGetSystemMetrics(SM_CXSMICON), UserGetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL); } @@ -1546,10 +1546,10 @@ UserDrawCaptionText(HDC hDc, DbgPrint("%C", Text->Buffer[i]); DbgPrint(", %d\n", Text->Length/sizeof(WCHAR)); #endif - + nclm.cbSize = sizeof(nclm); if(!IntSystemParametersInfo(SPI_GETNONCLIENTMETRICS, - sizeof(NONCLIENTMETRICS), &nclm, 0)) + sizeof(NONCLIENTMETRICS), &nclm, 0)) { DPRINT1("%s: IntSystemParametersInfo() failed!\n", __FUNCTION__); return FALSE; @@ -1561,7 +1561,7 @@ UserDrawCaptionText(HDC hDc, Status = TextIntCreateFontIndirect(&nclm.lfSmCaptionFont, &hFont); else Status = TextIntCreateFontIndirect(&nclm.lfCaptionFont, &hFont); - if(!NT_SUCCESS(Status)) + if(!NT_SUCCESS(Status)) { DPRINT1("%s: TextIntCreateFontIndirect() failed! Status: 0x%x\n", __FUNCTION__, Status); @@ -1569,7 +1569,7 @@ UserDrawCaptionText(HDC hDc, } hOldFont = NtGdiSelectObject(hDc, hFont); - if(!hOldFont) + if(!hOldFont) { DPRINT1("%s: SelectObject() failed!\n", __FUNCTION__); NtGdiDeleteObject(hFont); @@ -1580,17 +1580,17 @@ UserDrawCaptionText(HDC hDc, OldTextColor = NtGdiSetTextColor(hDc, IntGetSysColor(COLOR_BTNTEXT)); else OldTextColor = NtGdiSetTextColor(hDc, IntGetSysColor(uFlags & DC_ACTIVE ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT)); - + //FIXME: If string doesn't fit to rc, truncate it and add ellipsis. - - NtGdiExtTextOut(hDc, lpRc->left, - lpRc->top, 0, NULL, Text->Buffer, + + NtGdiExtTextOut(hDc, lpRc->left, + lpRc->top, 0, NULL, Text->Buffer, Text->Length/sizeof(WCHAR), NULL); - + NtGdiSetTextColor(hDc, OldTextColor); NtGdiSelectObject(hDc, hOldFont); NtGdiDeleteObject(hFont); - + return TRUE; } @@ -1612,11 +1612,11 @@ BOOL UserDrawCaption( RECT r = *lpRc; LONG ButtonWidth, IconWidth; BOOL HasIcon; - + //ASSERT(pWnd != NULL); - hMemBmp = NtGdiCreateCompatibleBitmap(hDc, - lpRc->right - lpRc->left, + hMemBmp = NtGdiCreateCompatibleBitmap(hDc, + lpRc->right - lpRc->left, lpRc->bottom - lpRc->top); if(!hMemBmp) @@ -1645,11 +1645,11 @@ BOOL UserDrawCaption( if ((!hIcon) && (pWnd != NULL)) { - HasIcon = (uFlags & DC_ICON) && (pWnd->Style & WS_SYSMENU) - && !(uFlags & DC_SMALLCAP) && !(pWnd->ExStyle & WS_EX_DLGMODALFRAME) + HasIcon = (uFlags & DC_ICON) && (pWnd->Style & WS_SYSMENU) + && !(uFlags & DC_SMALLCAP) && !(pWnd->ExStyle & WS_EX_DLGMODALFRAME) && !(pWnd->ExStyle & WS_EX_TOOLWINDOW); } - else + else HasIcon = (BOOL) hIcon; IconWidth = UserGetSystemMetrics(SM_CXSIZE) + Padding; @@ -1662,7 +1662,7 @@ BOOL UserDrawCaption( // Draw the caption background if(uFlags & DC_INBUTTON) { - hOldBrush = NtGdiSelectObject(hMemDc, + hOldBrush = NtGdiSelectObject(hMemDc, IntGetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_BTNFACE : COLOR_BTNSHADOW)); @@ -1675,25 +1675,25 @@ BOOL UserDrawCaption( if(!NtGdiPatBlt(hMemDc, 0, 0, lpRc->right - lpRc->left, lpRc->bottom - lpRc->top, - PATCOPY)) + PATCOPY)) { DPRINT1("%s: NtGdiPatBlt() failed!\n", __FUNCTION__); goto cleanup; } - + if(HasIcon) r.left+=IconWidth; } - else + else { r.right = (lpRc->right - lpRc->left); if(uFlags & DC_SMALLCAP) ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2; else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2; - - hOldBrush = NtGdiSelectObject(hMemDc, - IntGetSysColorBrush(uFlags & DC_ACTIVE ? + + hOldBrush = NtGdiSelectObject(hMemDc, + IntGetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION)); - + if(!hOldBrush) { DPRINT1("%s: NtGdiSelectObject() failed!\n", __FUNCTION__); @@ -1702,20 +1702,20 @@ BOOL UserDrawCaption( if(HasIcon && (uFlags & DC_GRADIENT)) { - NtGdiPatBlt(hMemDc, 0, 0, - IconWidth+1, - lpRc->bottom - lpRc->top, + NtGdiPatBlt(hMemDc, 0, 0, + IconWidth+1, + lpRc->bottom - lpRc->top, PATCOPY); r.left+=IconWidth; } - else + else { - NtGdiPatBlt(hMemDc, 0, 0, - lpRc->right - lpRc->left, - lpRc->bottom - lpRc->top, + NtGdiPatBlt(hMemDc, 0, 0, + lpRc->right - lpRc->left, + lpRc->bottom - lpRc->top, PATCOPY); } - + if(uFlags & DC_GRADIENT) { static GRADIENT_RECT gcap = {0, 1}; @@ -1735,29 +1735,29 @@ BOOL UserDrawCaption( else r.right -= 2; r.right -= 2; } - + //Draw buttons background - if(!NtGdiSelectObject(hMemDc, - IntGetSysColorBrush(uFlags & DC_ACTIVE ? + if(!NtGdiSelectObject(hMemDc, + IntGetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_GRADIENTACTIVECAPTION:COLOR_GRADIENTINACTIVECAPTION))) { DPRINT1("%s: NtGdiSelectObject() failed!\n", __FUNCTION__); goto cleanup; } - NtGdiPatBlt(hMemDc, - r.right, - 0, - lpRc->right - lpRc->left - r.right, - lpRc->bottom - lpRc->top, + NtGdiPatBlt(hMemDc, + r.right, + 0, + lpRc->right - lpRc->left - r.right, + lpRc->bottom - lpRc->top, PATCOPY); } } - Colors[0] = IntGetSysColor((uFlags & DC_ACTIVE) ? + Colors[0] = IntGetSysColor((uFlags & DC_ACTIVE) ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION); - Colors[1] = IntGetSysColor((uFlags & DC_ACTIVE) ? + Colors[1] = IntGetSysColor((uFlags & DC_ACTIVE) ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION); vert[0].x = r.left; @@ -1773,7 +1773,7 @@ BOOL UserDrawCaption( vert[1].Green = (WORD)Colors[1] & 0xFF00; vert[1].Blue = (WORD)(Colors[1]>>8) & 0xFF00; vert[1].Alpha = 0; - + pMemDc = DC_LockDc(hMemDc); if(!pMemDc) { @@ -1781,7 +1781,7 @@ BOOL UserDrawCaption( goto cleanup; } - if(!IntGdiGradientFill(pMemDc, vert, 2, &gcap, + if(!IntGdiGradientFill(pMemDc, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H)) { DPRINT1("%s: IntGdiGradientFill() failed!\n", __FUNCTION__); @@ -1790,7 +1790,7 @@ BOOL UserDrawCaption( DC_UnlockDc(pMemDc); } //if(uFlags & DC_GRADIENT) } - + if(HasIcon) { r.top ++; @@ -1813,7 +1813,7 @@ BOOL UserDrawCaption( { r.right = (lpRc->right - lpRc->left); - if(uFlags & DC_SMALLCAP) + if(uFlags & DC_SMALLCAP) ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2; else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2; @@ -1835,11 +1835,11 @@ BOOL UserDrawCaption( UserDrawCaptionText(hMemDc, str, &r, uFlags); else if (pWnd != NULL) UserDrawCaptionText(hMemDc, &pWnd->WindowName, &r, uFlags); - } + } - if(!NtGdiBitBlt(hDc, lpRc->left, lpRc->top, + if(!NtGdiBitBlt(hDc, lpRc->left, lpRc->top, lpRc->right - lpRc->left, lpRc->bottom - lpRc->top, - hMemDc, 0, 0, SRCCOPY, 0, 0)) + hMemDc, 0, 0, SRCCOPY, 0, 0)) { DPRINT1("%s: NtGdiBitBlt() failed!\n", __FUNCTION__); goto cleanup; @@ -1872,9 +1872,9 @@ NtUserDrawCaptionTemp( RECT SafeRect; UNICODE_STRING SafeStr = {0}; BOOL Ret = FALSE; - + UserEnterExclusive(); - + if (hWnd != NULL) { if(!(pWnd = UserGetWindowObject(hWnd))) @@ -1907,13 +1907,13 @@ NtUserDrawCaptionTemp( SetLastNtError(_SEH_GetExceptionCode()); } _SEH_END; - + UserLeave(); return Ret; } -BOOL -STDCALL +BOOL +STDCALL NtUserDrawCaption(HWND hWnd, HDC hDC, LPCRECT lpRc, diff --git a/reactos/subsystems/win32/win32k/ntuser/timer.c b/reactos/subsystems/win32/win32k/ntuser/timer.c index 8675f946157..6f6357f587b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/timer.c +++ b/reactos/subsystems/win32/win32k/ntuser/timer.c @@ -181,13 +181,13 @@ InitTimerImpl(VOID) ExInitializeFastMutex(&Mutex); - BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8; + BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8; WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(PagedPool, BitmapBytes, TAG_TIMERBMP); if (WindowLessTimersBitMapBuffer == NULL) { return STATUS_UNSUCCESSFUL; - } - + } + RtlInitializeBitMap(&WindowLessTimersBitMap, WindowLessTimersBitMapBuffer, BitmapBytes * 8); diff --git a/reactos/subsystems/win32/win32k/ntuser/useratom.c b/reactos/subsystems/win32/win32k/ntuser/useratom.c index 32ca21c0657..0cfbecb29f3 100644 --- a/reactos/subsystems/win32/win32k/ntuser/useratom.c +++ b/reactos/subsystems/win32/win32k/ntuser/useratom.c @@ -40,7 +40,7 @@ IntAddAtom(LPWSTR AtomName) SetLastNtError(Status); return (RTL_ATOM)0; } - + Status = RtlAddAtomToAtomTable(gAtomTable, AtomName, &Atom); if (!NT_SUCCESS(Status)) diff --git a/reactos/subsystems/win32/win32k/ntuser/windc.c b/reactos/subsystems/win32/win32k/ntuser/windc.c index 5273bb9404b..b02637fdc9e 100644 --- a/reactos/subsystems/win32/win32k/ntuser/windc.c +++ b/reactos/subsystems/win32/win32k/ntuser/windc.c @@ -115,38 +115,38 @@ PDCE FASTCALL DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type) { PDCE pDce; - + pDce = ExAllocatePoolWithTag(PagedPool, sizeof(DCE), TAG_PDCE); if(!pDce) return NULL; - + pDce->hDC = DceCreateDisplayDC(); if(!pDce->hDC) { ExFreePoolWithTag(pDce, TAG_PDCE); - return NULL; + return NULL; } // -// If NULL, first time through! Build the default window dc! +// If NULL, first time through! Build the default window dc! // if (NULL == defaultDCstate) // Ultra HAX! Dedicated to GvG! - { // This is a cheesy way to do this. + { // This is a cheesy way to do this. PDC dc = DC_LockDc ( pDce->hDC ); defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC); RtlZeroMemory(defaultDCstate, sizeof(DC)); IntGdiCopyToSaveState(dc, defaultDCstate); DC_UnlockDc( dc ); } - + pDce->hwndCurrent = (Window ? Window->hSelf : NULL); pDce->hClipRgn = NULL; pDce->pProcess = NULL; - KeEnterCriticalRegion(); + KeEnterCriticalRegion(); pDce->next = FirstDce; FirstDce = pDce; KeLeaveCriticalRegion(); - + if (Type == DCE_WINDOW_DC) //Window DCE have ownership. { // Process should already own it. pDce->pProcess = PsGetCurrentProcess(); @@ -157,11 +157,11 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type) DC_FreeDcAttr(pDce->hDC); // Free the dcattr! DC_SetOwnership(pDce->hDC, NULL); // This hDC is inaccessible! } - + if (Type != DCE_CACHE_DC) { pDce->DCXFlags = DCX_DCEBUSY; - + if (Window) { if (Window->Style & WS_CLIPCHILDREN) @@ -178,7 +178,7 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type) { pDce->DCXFlags = DCX_CACHE | DCX_DCEEMPTY; } - + return(pDce); } @@ -667,33 +667,33 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force) { return NULL; } - + ret = pdce->next; - + #if 0 /* FIXME */ - + SetDCHook(pdce->hDC, NULL, 0L); #endif - + if(Force && !GDIOBJ_OwnedByCurrentProcess(GdiHandleTable, pdce->hDC)) { DPRINT1("Change ownership for DCE!\n"); DC_SetOwnership( pdce->hDC, PsGetCurrentProcess()); } - + NtGdiDeleteObjectApp(pdce->hDC); if (pdce->hClipRgn && ! (pdce->DCXFlags & DCX_KEEPCLIPRGN)) { NtGdiDeleteObject(pdce->hClipRgn); } - + DCE_Cleanup(pdce); ExFreePoolWithTag(pdce, TAG_PDCE); if (FirstDce == NULL) { ExFreePoolWithTag(defaultDCstate, TAG_DC); - defaultDCstate = NULL; + defaultDCstate = NULL; } return ret; } diff --git a/reactos/subsystems/win32/win32k/ntuser/winpos.c b/reactos/subsystems/win32/win32k/ntuser/winpos.c index 877bf0f229a..76d5ec9ad07 100644 --- a/reactos/subsystems/win32/win32k/ntuser/winpos.c +++ b/reactos/subsystems/win32/win32k/ntuser/winpos.c @@ -132,14 +132,14 @@ CLEANUP: * * Check if we can activate the specified window. */ -static +static BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL) { LONG style; if (!Wnd) return FALSE; style = Wnd->Style; - if (!(style & WS_VISIBLE) && + if (!(style & WS_VISIBLE) && Wnd->OwnerThread->ThreadsProcess != CsrProcess) return FALSE; if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE; return !(style & WS_DISABLED); @@ -848,9 +848,9 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window) && HWND_BOTTOM != WinPos->hwndInsertAfter) { PWINDOW_OBJECT InsAfterWnd, Parent = Window->Parent; - + InsAfterWnd = UserGetWindowObject(WinPos->hwndInsertAfter); - + if (InsAfterWnd && UserGetAncestor(InsAfterWnd, GA_PARENT) != Parent) { return FALSE; @@ -975,7 +975,7 @@ co_WinPosSetWindowPos( } WvrFlags = co_WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect, &NewClientRect); - + //DPRINT1("co_WinPosDoNCCALCSize"); /* Relink windows. (also take into account shell window in hwndShellWindow) */ @@ -1315,7 +1315,7 @@ co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientR LRESULT Result; ASSERT_REFS_CO(Window); - + *ClientRect = *WindowRect; Result = co_IntSendMessage(Window->hSelf, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect); @@ -1428,7 +1428,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) } ShowFlag = (Cmd != SW_HIDE); - + if (ShowFlag != WasVisible) { co_IntSendMessage(Window->hSelf, WM_SHOWWINDOW, ShowFlag, 0); @@ -1448,7 +1448,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) if (Cmd == SW_HIDE) { PWINDOW_OBJECT ThreadFocusWindow; - + /* FIXME: This will cause the window to be activated irrespective * of whether it is owned by the same thread. Has to be done * asynchronously. @@ -1462,7 +1462,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) //temphack ThreadFocusWindow = UserGetWindowObject(IntGetThreadFocusWindow()); - + /* Revert focus to parent */ if (ThreadFocusWindow && (Window == ThreadFocusWindow || IntIsChildWindow(Window, ThreadFocusWindow))) @@ -1498,7 +1498,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) MAKELONG(Window->ClientRect.left, Window->ClientRect.top)); IntEngWindowChanged(Window, WOC_RGN_CLIENT); - + } /* Activate the window if activation is not requested and the window is not minimized */ @@ -1538,24 +1538,24 @@ PWINDOW_OBJECT child_window_from_point(PWINDOW_OBJECT parent, int x, int y ) } #endif -/* wine server: child_window_from_point +/* wine server: child_window_from_point Caller must dereference the "returned" Window */ static VOID FASTCALL co_WinPosSearchChildren( - PWINDOW_OBJECT ScopeWin, - PUSER_MESSAGE_QUEUE OnlyHitTests, + PWINDOW_OBJECT ScopeWin, + PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *Point, - PWINDOW_OBJECT* Window, + PWINDOW_OBJECT* Window, USHORT *HitTest ) { PWINDOW_OBJECT Current; HWND *List, *phWnd; USER_REFERENCE_ENTRY Ref; - + ASSERT_REFS_CO(ScopeWin); if ((List = IntWinListChildren(ScopeWin))) @@ -1576,15 +1576,15 @@ co_WinPosSearchChildren( continue; } - if (!IntPtInWindow(Current, Point->x, Point->y)) + if (!IntPtInWindow(Current, Point->x, Point->y)) { continue; } - + if (*Window) UserDerefObject(*Window); *Window = Current; UserRefObject(*Window); - + if (Current->Style & WS_MINIMIZE) { *HitTest = HTCAPTION; @@ -1598,7 +1598,7 @@ co_WinPosSearchChildren( } UserRefObjectCo(Current, &Ref); - + if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests)) { *HitTest = co_IntSendMessage(Current->hSelf, WM_NCHITTEST, 0, @@ -1619,13 +1619,13 @@ co_WinPosSearchChildren( { co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest); } - + UserDerefObjectCo(Current); break; } ExFreePool(List); - } + } } /* wine: WINPOS_WindowFromPoint */ diff --git a/reactos/subsystems/win32/win32k/ntuser/winsta.c b/reactos/subsystems/win32/win32k/ntuser/winsta.c index ea964873217..478432788af 100644 --- a/reactos/subsystems/win32/win32k/ntuser/winsta.c +++ b/reactos/subsystems/win32/win32k/ntuser/winsta.c @@ -501,7 +501,7 @@ NtUserCreateWindowStation( */ WindowStationObject->ScreenSaverRunning = FALSE; - + WindowStationObject->FlatMenu = FALSE; if(!(CurInfo = ExAllocatePool(PagedPool, sizeof(SYSTEM_CURSORINFO)))) @@ -518,9 +518,9 @@ NtUserCreateWindowStation( CurInfo->CursorClipInfo.IsClipped = FALSE; CurInfo->LastBtnDown = 0; CurInfo->CurrentCursorObject = NULL; - CurInfo->ShowingCursor = 0; + CurInfo->ShowingCursor = 0; - /* FIXME: Obtain the following information from the registry */ + /* FIXME: Obtain the following information from the registry */ CurInfo->WheelScroLines = 3; CurInfo->WheelScroChars = 3; @@ -547,8 +547,8 @@ NtUserCreateWindowStation( if (!IntSetupClipboard(WindowStationObject)) { DPRINT1("WindowStation: Error Setting up the clipboard!!!\n"); - } - + } + if (!IntSetupCurIconHandles(WindowStationObject)) { DPRINT1("Setting up the Cursor/Icon Handle table failed!\n"); diff --git a/reactos/subsystems/win32/win32k/objects/arc.c b/reactos/subsystems/win32/win32k/objects/arc.c index dedbbdf3536..157bace3754 100644 --- a/reactos/subsystems/win32/win32k/objects/arc.c +++ b/reactos/subsystems/win32/win32k/objects/arc.c @@ -1,132 +1,132 @@ - -#include - -#define NDEBUG -#include - -static BOOL FASTCALL -IntArc( DC *dc, int LeftRect, int TopRect, int RightRect, int BottomRect, - int XStartArc, int YStartArc, int XEndArc, int YEndArc, ARCTYPE arctype) -{ - return TRUE; -} - -BOOL FASTCALL -IntGdiArcInternal( - ARCTYPE arctype, - DC *dc, - int LeftRect, - int TopRect, - int RightRect, - int BottomRect, - int XStartArc, - int YStartArc, - int XEndArc, - int YEndArc) -{ - INT rx, ry; - RECT rc, rc1; - - if(PATH_IsPathOpen(dc->w.path)) - { - INT type = arctype; - if (arctype == GdiTypeArcTo) type = GdiTypeArc; - return PATH_Arc(dc, LeftRect, TopRect, RightRect, BottomRect, - XStartArc, YStartArc, XEndArc, YEndArc, type); - } - - IntGdiSetRect(&rc, LeftRect, TopRect, RightRect, BottomRect); - IntGdiSetRect(&rc1, XStartArc, YStartArc, XEndArc, YEndArc); - - if (dc->w.flags & DCX_WINDOW) //window rectangle instead of client rectangle - { - HWND hWnd; - PWINDOW_OBJECT Window; - - hWnd = IntWindowFromDC(dc->hSelf); - Window = UserGetWindowObject(hWnd); - if(!Window) return FALSE; - - rc.left += Window->ClientRect.left; - rc.top += Window->ClientRect.top; - rc.right += Window->ClientRect.left; - rc.bottom += Window->ClientRect.top; - - rc1.left += Window->ClientRect.left; - rc1.top += Window->ClientRect.top; - rc1.right += Window->ClientRect.left; - rc1.bottom += Window->ClientRect.top; - } - - rx = (rc.right - rc.left)/2 - 1; - ry = (rc.bottom - rc.top)/2 -1; - rc.left += rx; - rc.top += ry; - - return IntArc( dc, rc.left, rc.top, rx, ry, - rc1.left, rc1.top, rc1.right, rc1.bottom, arctype); -} - -BOOL -STDCALL -NtGdiArcInternal( - ARCTYPE arctype, - HDC hDC, - int LeftRect, - int TopRect, - int RightRect, - int BottomRect, - int XStartArc, - int YStartArc, - int XEndArc, - int YEndArc) -{ - DC *dc; - BOOL Ret; - - dc = DC_LockDc (hDC); - if(!dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - if (dc->IsIC) - { - DC_UnlockDc(dc); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - if (arctype == GdiTypeArcTo) - { - // Line from current position to starting point of arc - if ( !IntGdiLineTo(dc, XStartArc, YStartArc) ) - { - DC_UnlockDc(dc); - return FALSE; - } - } - - Ret = IntGdiArcInternal( - arctype, - dc, - LeftRect, - TopRect, - RightRect, - BottomRect, - XStartArc, - YStartArc, - XEndArc, - YEndArc); - - if (arctype == GdiTypeArcTo) - { - // If no error occured, the current position is moved to the ending point of the arc. - if(Ret) - IntGdiMoveToEx(dc, XEndArc, YEndArc, NULL); - } - - DC_UnlockDc( dc ); - return Ret; -} - + +#include + +#define NDEBUG +#include + +static BOOL FASTCALL +IntArc( DC *dc, int LeftRect, int TopRect, int RightRect, int BottomRect, + int XStartArc, int YStartArc, int XEndArc, int YEndArc, ARCTYPE arctype) +{ + return TRUE; +} + +BOOL FASTCALL +IntGdiArcInternal( + ARCTYPE arctype, + DC *dc, + int LeftRect, + int TopRect, + int RightRect, + int BottomRect, + int XStartArc, + int YStartArc, + int XEndArc, + int YEndArc) +{ + INT rx, ry; + RECT rc, rc1; + + if(PATH_IsPathOpen(dc->w.path)) + { + INT type = arctype; + if (arctype == GdiTypeArcTo) type = GdiTypeArc; + return PATH_Arc(dc, LeftRect, TopRect, RightRect, BottomRect, + XStartArc, YStartArc, XEndArc, YEndArc, type); + } + + IntGdiSetRect(&rc, LeftRect, TopRect, RightRect, BottomRect); + IntGdiSetRect(&rc1, XStartArc, YStartArc, XEndArc, YEndArc); + + if (dc->w.flags & DCX_WINDOW) //window rectangle instead of client rectangle + { + HWND hWnd; + PWINDOW_OBJECT Window; + + hWnd = IntWindowFromDC(dc->hSelf); + Window = UserGetWindowObject(hWnd); + if(!Window) return FALSE; + + rc.left += Window->ClientRect.left; + rc.top += Window->ClientRect.top; + rc.right += Window->ClientRect.left; + rc.bottom += Window->ClientRect.top; + + rc1.left += Window->ClientRect.left; + rc1.top += Window->ClientRect.top; + rc1.right += Window->ClientRect.left; + rc1.bottom += Window->ClientRect.top; + } + + rx = (rc.right - rc.left)/2 - 1; + ry = (rc.bottom - rc.top)/2 -1; + rc.left += rx; + rc.top += ry; + + return IntArc( dc, rc.left, rc.top, rx, ry, + rc1.left, rc1.top, rc1.right, rc1.bottom, arctype); +} + +BOOL +STDCALL +NtGdiArcInternal( + ARCTYPE arctype, + HDC hDC, + int LeftRect, + int TopRect, + int RightRect, + int BottomRect, + int XStartArc, + int YStartArc, + int XEndArc, + int YEndArc) +{ + DC *dc; + BOOL Ret; + + dc = DC_LockDc (hDC); + if(!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + if (dc->IsIC) + { + DC_UnlockDc(dc); + /* Yes, Windows really returns TRUE in this case */ + return TRUE; + } + + if (arctype == GdiTypeArcTo) + { + // Line from current position to starting point of arc + if ( !IntGdiLineTo(dc, XStartArc, YStartArc) ) + { + DC_UnlockDc(dc); + return FALSE; + } + } + + Ret = IntGdiArcInternal( + arctype, + dc, + LeftRect, + TopRect, + RightRect, + BottomRect, + XStartArc, + YStartArc, + XEndArc, + YEndArc); + + if (arctype == GdiTypeArcTo) + { + // If no error occured, the current position is moved to the ending point of the arc. + if(Ret) + IntGdiMoveToEx(dc, XEndArc, YEndArc, NULL); + } + + DC_UnlockDc( dc ); + return Ret; +} + diff --git a/reactos/subsystems/win32/win32k/objects/bitmaps.c b/reactos/subsystems/win32/win32k/objects/bitmaps.c index e05702dfff2..3bdd286a3b0 100644 --- a/reactos/subsystems/win32/win32k/objects/bitmaps.c +++ b/reactos/subsystems/win32/win32k/objects/bitmaps.c @@ -80,7 +80,7 @@ IntGdiCreateBitmap( /* FIXME should we free the hBitmap or return it ?? */ return 0; } - + bmp->flFlags = BITMAPOBJ_IS_APIBITMAP; if (NULL != pBits) @@ -140,7 +140,7 @@ BITMAP_Cleanup(PVOID ObjectBody) EngFreeUserMem(pBmp->SurfObj.pvBits); } if (pBmp->hDIBPalette != NULL) - { + { NtGdiDeleteObject(pBmp->hDIBPalette); } } diff --git a/reactos/subsystems/win32/win32k/objects/brush.c b/reactos/subsystems/win32/win32k/objects/brush.c index da9b73afdff..e2d8454d582 100644 --- a/reactos/subsystems/win32/win32k/objects/brush.c +++ b/reactos/subsystems/win32/win32k/objects/brush.c @@ -96,10 +96,10 @@ BRUSH_GetObject (PGDIBRUSHOBJ BrushObject, INT Count, LPLOGBRUSH Buffer) } else if ((BrushObject->flAttrs & GDIBRUSH_IS_DIB)!=0) { - Buffer->lbStyle = BS_DIBPATTERN; + Buffer->lbStyle = BS_DIBPATTERN; } - /* FIXME + /* FIXME else if ((BrushObject->flAttrs & )!=0) { Buffer->lbStyle = BS_INDEXED; @@ -534,7 +534,7 @@ NtGdiCreateDIBBrush( Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { EngFreeMem(SafeBitmapInfoAndData); diff --git a/reactos/subsystems/win32/win32k/objects/cliprgn.c b/reactos/subsystems/win32/win32k/objects/cliprgn.c index 29c4e8fb33f..d8aaff4f5e3 100644 --- a/reactos/subsystems/win32/win32k/objects/cliprgn.c +++ b/reactos/subsystems/win32/win32k/objects/cliprgn.c @@ -96,8 +96,8 @@ IntGdiSelectVisRgn(HDC hdc, HRGN hrgn) } -int STDCALL IntGdiExtSelectClipRgn(PDC dc, - HRGN hrgn, +int STDCALL IntGdiExtSelectClipRgn(PDC dc, + HRGN hrgn, int fnMode) { int retval; @@ -360,7 +360,7 @@ int STDCALL NtGdiOffsetClipRgn(HDC hDC, { Result = NULLREGION; } - + DC_UnlockDc(dc); return Result; } diff --git a/reactos/subsystems/win32/win32k/objects/color.c b/reactos/subsystems/win32/win32k/objects/color.c index 1498f84b73c..66ec69d431a 100644 --- a/reactos/subsystems/win32/win32k/objects/color.c +++ b/reactos/subsystems/win32/win32k/objects/color.c @@ -87,13 +87,13 @@ IntAnimatePalette(HPALETTE hPal, PPALGDI palPtr; UINT pal_entries; HDC hDC; - PDC dc; + PDC dc; PWINDOW_OBJECT Wnd; const PALETTEENTRY *pptr = PaletteColors; - + palPtr = (PPALGDI)PALETTE_LockPalette(hPal); if (!palPtr) return FALSE; - + pal_entries = palPtr->NumColors; if (StartIndex >= pal_entries) { @@ -101,7 +101,7 @@ IntAnimatePalette(HPALETTE hPal, return FALSE; } if (StartIndex+NumEntries > pal_entries) NumEntries = pal_entries - StartIndex; - + for (NumEntries += StartIndex; StartIndex < NumEntries; StartIndex++, pptr++) { /* According to MSDN, only animate PC_RESERVED colours */ @@ -113,10 +113,10 @@ IntAnimatePalette(HPALETTE hPal, PALETTE_ValidateFlags(&palPtr->IndexedColors[StartIndex], 1); } } - + PALETTE_UnlockPalette(palPtr); - - /* Immediately apply the new palette if current window uses it */ + + /* Immediately apply the new palette if current window uses it */ Wnd = UserGetDesktopWindow(); hDC = (HDC)UserGetWindowDC(Wnd); dc = DC_LockDc(hDC); @@ -129,7 +129,7 @@ IntAnimatePalette(HPALETTE hPal, } else DC_UnlockDc(dc); - } + } UserReleaseDC(Wnd,hDC, FALSE); } return ret; @@ -243,7 +243,7 @@ HPALETTE STDCALL NtGdiCreateHalftonePalette(HDC hDC) /* * @implemented */ -HPALETTE STDCALL +HPALETTE STDCALL NtGdiCreatePaletteInternal ( IN LPLOGPALETTE pLogPal, IN UINT cEntries ) { PPALGDI PalGDI; @@ -465,7 +465,7 @@ IntGetSystemPaletteEntries(HDC hDC, } UINT STDCALL NtGdiGetSystemPaletteUse(HDC hDC) -{ +{ return SystemPaletteUse; } @@ -491,7 +491,7 @@ UINT STDCALL NtGdiRealizePalette(HDC hDC) * of bugd in it (calling SetPalette for high/true-color modes, * using DEFAULT_PALETTE instead of the device palette, ...). */ - + PALOBJ *palPtr, *sysPtr; PPALGDI palGDI, sysGDI; int realized = 0; @@ -510,20 +510,20 @@ UINT STDCALL NtGdiRealizePalette(HDC hDC) if (palGDI == NULL) { - /* FIXME - Handle palGDI == NULL!!!! + /* FIXME - Handle palGDI == NULL!!!! we should not unlock dc and return 0 ?? shall we create the pallete ?? - */ + */ DC_UnlockDc(dc); return 0; } sysGDI = PALETTE_LockPalette(systemPalette); sysPtr = (PALOBJ*) sysGDI; - + if (sysGDI == NULL) { - /* FIXME - Handle sysGDI == NULL!!!!! + /* FIXME - Handle sysGDI == NULL!!!!! we should not unlock dc and return 0 ?? shall we create the pallete ?? */ @@ -532,7 +532,7 @@ UINT STDCALL NtGdiRealizePalette(HDC hDC) return 0; } - + // Step 1: Create mapping of system palette\DC palette #ifndef NO_MAPPING realized = PALETTE_SetMapping(palPtr, 0, palGDI->NumColors, @@ -542,7 +542,7 @@ UINT STDCALL NtGdiRealizePalette(HDC hDC) realized = 0; #endif - + // Step 2: // The RealizePalette function modifies the palette for the device associated with the specified device context. If the @@ -550,7 +550,7 @@ UINT STDCALL NtGdiRealizePalette(HDC hDC) // context is a display DC, the physical palette for that device is modified. if(dc->w.flags == DC_MEMORY) { - // Memory managed DC + // Memory managed DC ASSERT(sysGDI->NumColors <= 256); success = ((GDIDEVICE *)dc->GDIDevice)->DriverFunctions.SetPalette( dc->PDev, sysPtr, 0, 0, sysGDI->NumColors); @@ -633,7 +633,7 @@ BOOL STDCALL NtGdiSetColorAdjustment(HDC hDC, return FALSE; } -UINT STDCALL +UINT STDCALL IntSetPaletteEntries(HPALETTE hpal, UINT Start, UINT Entries, @@ -679,12 +679,12 @@ NtGdiSetSystemPaletteUse(HDC hDC, UINT Usage) return SYSPAL_ERROR; } - switch (Usage) + switch (Usage) { case SYSPAL_NOSTATIC: - case SYSPAL_NOSTATIC256: + case SYSPAL_NOSTATIC256: case SYSPAL_STATIC: - SystemPaletteUse = Usage; + SystemPaletteUse = Usage; break; default: @@ -713,7 +713,7 @@ NtGdiUnrealizeObject(HGDIOBJ hgdiobj) /* From Wine: UnrealizeObject does not SetLastError() on a null object */ if(!hgdiobj) return Ret; - + ptr = GDIOBJ_LockObj(GdiHandleTable, hgdiobj, GDI_OBJECT_TYPE_DONTCARE); if (ptr == 0) { @@ -752,7 +752,7 @@ NtGdiUpdateColors(HDC hDC) USER_REFERENCE_ENTRY Ref; calledFromUser = UserIsEntered(); - + if (!calledFromUser){ UserEnterExclusive(); } @@ -765,18 +765,18 @@ NtGdiUpdateColors(HDC hDC) if (!calledFromUser){ UserLeave(); } - + return FALSE; } - + UserRefObjectCo(Wnd, &Ref); ret = co_UserRedrawWindow(Wnd, NULL, 0, RDW_INVALIDATE); UserDerefObjectCo(Wnd); - + if (!calledFromUser){ UserLeave(); } - + return ret; } @@ -835,7 +835,7 @@ int STDCALL COLOR_PaletteLookupExactIndex( PALETTEENTRY* palPalEntry, int size, W32KAPI LONG -APIENTRY +APIENTRY NtGdiDoPalette( IN HGDIOBJ hObj, IN WORD iStart, diff --git a/reactos/subsystems/win32/win32k/objects/coord.c b/reactos/subsystems/win32/win32k/objects/coord.c index b4af285a01a..d5cb5ce4d4c 100644 --- a/reactos/subsystems/win32/win32k/objects/coord.c +++ b/reactos/subsystems/win32/win32k/objects/coord.c @@ -431,7 +431,7 @@ NtGdiModifyWorldTransform(HDC hDC, SetLastWin32Error(ERROR_INVALID_PARAMETER); return FALSE; } - + dc = DC_LockDc(hDC); if (!dc) { @@ -523,7 +523,7 @@ NtGdiOffsetWindowOrgEx(HDC hDC, if (Point) { NTSTATUS Status = STATUS_SUCCESS; - + _SEH_TRY { ProbeForWrite(Point, @@ -748,7 +748,7 @@ NtGdiSetViewportExtEx(HDC hDC, } } - + DC_UpdateXforms(dc); DC_UnlockDc(dc); @@ -774,7 +774,7 @@ NtGdiSetViewportOrgEx(HDC hDC, if (Point) { NTSTATUS Status = STATUS_SUCCESS; - + _SEH_TRY { ProbeForWrite(Point, @@ -837,7 +837,7 @@ NtGdiSetWindowExtEx(HDC hDC, if (Size) { NTSTATUS Status = STATUS_SUCCESS; - + _SEH_TRY { ProbeForWrite(Size, @@ -888,7 +888,7 @@ NtGdiSetWindowOrgEx(HDC hDC, if (Point) { NTSTATUS Status = STATUS_SUCCESS; - + _SEH_TRY { ProbeForWrite(Point, diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index 833adeb8e07..14c7d420f42 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -167,7 +167,7 @@ NtGdiCreateCompatibleDC(HDC hDC) HRGN hVisRgn; UNICODE_STRING DriverName; INT DC_Type = DC_TYPE_DIRECT; - + DisplayDC = NULL; if (hDC == NULL) { @@ -208,7 +208,7 @@ NtGdiCreateCompatibleDC(HDC hDC) NewDC->hSelf = hNewDC; NewDC->IsIC = FALSE; NewDC->DC_Type = DC_Type; - + NewDC->PDev = OrigDC->PDev; memcpy(NewDC->FillPatternSurfaces, OrigDC->FillPatternSurfaces, @@ -942,10 +942,10 @@ IntGdiCreateDC(PUNICODE_STRING Driver, { /* From MSDN2: The CreateIC function creates an information context for the specified device. - The information context provides a fast way to get information about the + The information context provides a fast way to get information about the device without creating a device context (DC). However, GDI drawing functions cannot accept a handle to an information context. - */ + */ NewDC->DC_Type = DC_TYPE_INFO; DC_UnlockDc( NewDC ); } @@ -1015,7 +1015,7 @@ NtGdiOpenDCW( PUNICODE_STRING Device, (BOOL) iType); // FALSE 0 DCW, TRUE 1 ICW if (pUMdhpdev) pUMdhpdev = Dhpdev; - + return Ret; } @@ -1151,7 +1151,7 @@ NtGdiGetDCObject(HDC hDC, INT ObjectType) switch(ObjectType) { case GDI_OBJECT_TYPE_EXTPEN: - case GDI_OBJECT_TYPE_PEN: + case GDI_OBJECT_TYPE_PEN: SelObject = dc->Dc_Attr.hpen; break; case GDI_OBJECT_TYPE_BRUSH: @@ -1366,7 +1366,7 @@ IntGdiCopyToSaveState(PDC dc, PDC newdc) VOID FASTCALL IntGdiCopyFromSaveState(PDC dc, PDC dcs, HDC hDC) -{ +{ dc->w.flags = dcs->w.flags & ~DC_SAVED; dc->w.hFirstBitmap = dcs->w.hFirstBitmap; @@ -1447,7 +1447,7 @@ IntGdiCopyFromSaveState(PDC dc, PDC dcs, HDC hDC) DC_UnlockDc ( dc ); #endif if(!hDC) return; // Not a MemoryDC or SaveLevel DC, return. - + NtGdiSelectObject( hDC, dcs->w.hBitmap ); NtGdiSelectObject( hDC, dcs->Dc_Attr.hbrush ); NtGdiSelectObject( hDC, dcs->Dc_Attr.hlfntNew ); @@ -1898,7 +1898,7 @@ NtGdiRestoreDC(HDC hDC, INT SaveLevel) DC_UnlockDc(dc); return FALSE; } - + success=TRUE; while (dc->saveLevel >= SaveLevel) { @@ -1942,7 +1942,7 @@ NtGdiRestoreDC(HDC hDC, INT SaveLevel) DC_UnlockDc( dc ); return success; } - + INT STDCALL NtGdiSaveDC(HDC hDC) @@ -2270,7 +2270,7 @@ NtGdiGetDCDword( DC_UnlockDc(dc); return Ret; } - + BOOL STDCALL NtGdiGetAndSetDCDword( @@ -2327,7 +2327,7 @@ NtGdiGetAndSetDCDword( { SetLastWin32Error(ERROR_INVALID_PARAMETER); Ret = FALSE; - } + } SafeResult = dc->w.ArcDirection; dc->w.ArcDirection = dwIn; break; @@ -2378,7 +2378,7 @@ DC_AllocDC(PUNICODE_STRING Driver) PDC NewDC; HDC hDC; PWSTR Buf = NULL; - + if (Driver != NULL) { Buf = ExAllocatePoolWithTag(PagedPool, Driver->MaximumLength, TAG_DC); @@ -2445,7 +2445,7 @@ DC_AllocDC(PUNICODE_STRING Driver) NewDC->Dc_Attr.hlfntNew = NtGdiGetStockObject(SYSTEM_FONT); TextIntRealizeFont(NewDC->Dc_Attr.hlfntNew); - + NewDC->w.hPalette = NtGdiGetStockObject(DEFAULT_PALETTE); DC_UnlockDc(NewDC); @@ -2502,7 +2502,7 @@ DC_AllocateDcAttr(HDC hDC) if (NT_SUCCESS(Status)) { RtlZeroMemory(NewMem, MemSize); - Entry->UserData = NewMem; + Entry->UserData = NewMem; DPRINT("DC_ATTR allocated! 0x%x\n",NewMem); } else @@ -3232,19 +3232,19 @@ IntChangeDisplaySettings( /* Check if pDeviceName is NULL, we need to retrieve it */ if (pDeviceName == NULL) - { + { WCHAR szBuffer[MAX_DRIVER_NAME]; PDC DC; PWINDOW_OBJECT Wnd=NULL; - HWND hWnd; + HWND hWnd; HDC hDC; - + hWnd = IntGetDesktopWindow(); if (!(Wnd = UserGetWindowObject(hWnd))) { return FALSE; } - + hDC = (HDC)UserGetWindowDC(Wnd); DC = DC_LockDc(hDC); diff --git a/reactos/subsystems/win32/win32k/objects/dcutil.c b/reactos/subsystems/win32/win32k/objects/dcutil.c index 37849dd00c0..d8e3cdf5b5e 100644 --- a/reactos/subsystems/win32/win32k/objects/dcutil.c +++ b/reactos/subsystems/win32/win32k/objects/dcutil.c @@ -121,7 +121,7 @@ ReadWriteVMDcAttr(PDC dc, FLONG Dirty, BOOL Write) Ret = FALSE; } } - } + } KeLeaveCriticalRegion(); return Ret; } diff --git a/reactos/subsystems/win32/win32k/objects/dibobj.c b/reactos/subsystems/win32/win32k/objects/dibobj.c index b4881a3ad8b..cabc9d144bf 100644 --- a/reactos/subsystems/win32/win32k/objects/dibobj.c +++ b/reactos/subsystems/win32/win32k/objects/dibobj.c @@ -797,20 +797,20 @@ IntCreateDIBitmap(PDC Dc, const BITMAPINFOHEADER *header, UINT coloruse) { HBITMAP handle; - + LONG width; LONG height; - WORD planes; + WORD planes; WORD bpp; LONG compr; - LONG dibsize; + LONG dibsize; BOOL fColor; SIZEL size; - if (DIB_GetBitmapInfo( header, &width, &height, &planes, &bpp, &compr, &dibsize ) == -1) return 0; + if (DIB_GetBitmapInfo( header, &width, &height, &planes, &bpp, &compr, &dibsize ) == -1) return 0; + - // Check if we should create a monochrome or color bitmap. We create a monochrome bitmap only if it has exactly 2 // colors, which are black followed by white, nothing else. In all other cases, we create a color bitmap. @@ -889,7 +889,7 @@ HBITMAP STDCALL NtGdiCreateDIBitmap(HDC hDc, const BITMAPINFOHEADER *Header, { PDC Dc; HBITMAP Bmp; - + if (Header == NULL) { return NULL; @@ -901,34 +901,34 @@ HBITMAP STDCALL NtGdiCreateDIBitmap(HDC hDc, const BITMAPINFOHEADER *Header, } if (NULL == hDc) - { + { BITMAPINFOHEADER *change_Header = (BITMAPINFOHEADER *)Header; hDc = IntGdiCreateDC(NULL, NULL, NULL, NULL,FALSE); if (hDc == NULL) - { + { SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } Dc = DC_LockDc(hDc); if (Dc == NULL) - { - NtGdiDeleteObjectApp(hDc); + { + NtGdiDeleteObjectApp(hDc); SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } - + change_Header->biBitCount = 1; change_Header->biPlanes = 1; - Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse); + Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse); DC_UnlockDc(Dc); - NtGdiDeleteObjectApp(hDc); + NtGdiDeleteObjectApp(hDc); } else { Dc = DC_LockDc(hDc); if (Dc == NULL) - { + { SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } @@ -936,7 +936,7 @@ HBITMAP STDCALL NtGdiCreateDIBitmap(HDC hDc, const BITMAPINFOHEADER *Header, DC_UnlockDc(Dc); } - + return Bmp; } @@ -1213,20 +1213,20 @@ INT FASTCALL DIB_BitmapInfoSize (const BITMAPINFO * info, WORD coloruse) } /* - * DIB_GetBitmapInfo is complete copy of wine cvs 2/9-2006 + * DIB_GetBitmapInfo is complete copy of wine cvs 2/9-2006 * from file dib.c from gdi32.dll or orginal version - * did not calc the info right for some headers. + * did not calc the info right for some headers. */ -INT STDCALL -DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, - PLONG width, - PLONG height, - PWORD planes, - PWORD bpp, - PLONG compr, +INT STDCALL +DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, + PLONG width, + PLONG height, + PWORD planes, + PWORD bpp, + PLONG compr, PLONG size ) -{ +{ if (header->biSize == sizeof(BITMAPCOREHEADER)) { @@ -1342,9 +1342,9 @@ DIB_MapPaletteColors(PDC dc, CONST BITMAPINFO* lpbmi) if (lpRGB == NULL) { PALETTE_UnlockPalette(palGDI); - return NULL; + return NULL; } - + lpIndex = (USHORT *)&lpbmi->bmiColors[0]; for (i = 0; i < nNumColors; i++) diff --git a/reactos/subsystems/win32/win32k/objects/fillshap.c b/reactos/subsystems/win32/win32k/objects/fillshap.c index f44d44651d2..736484bbc20 100644 --- a/reactos/subsystems/win32/win32k/objects/fillshap.c +++ b/reactos/subsystems/win32/win32k/objects/fillshap.c @@ -95,7 +95,7 @@ IntGdiPolygon(PDC dc, if (FillBrushObj && !(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)) { IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush); - ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, ROP2_TO_MIX(dc->Dc_Attr.jROP2), UnsafePoints, Count, DestRect ); + ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, ROP2_TO_MIX(dc->Dc_Attr.jROP2), UnsafePoints, Count, DestRect ); } BRUSHOBJ_UnlockBrush(FillBrushObj); @@ -112,7 +112,7 @@ IntGdiPolygon(PDC dc, // DPRINT1("Polygon Making line from (%d,%d) to (%d,%d)\n", // UnsafePoints[0].x, UnsafePoints[0].y, // UnsafePoints[1].x, UnsafePoints[1].y ); - + ret = IntEngLineTo(&BitmapObj->SurfObj, dc->CombinedClip, &PenBrushInst.BrushObject, @@ -820,7 +820,7 @@ NtGdiPolyPolyDraw( IN HDC hDC, NTSTATUS Status = STATUS_SUCCESS; BOOL Ret = TRUE; INT nPoints, nEmpty, nInvalid, i; - + if (iFunc == GdiPolyPolyRgn) { return (ULONG_PTR) GdiCreatePolyPolygonRgn((CONST PPOINT) Points, @@ -864,7 +864,7 @@ NtGdiPolyPolyDraw( IN HDC hDC, SetLastNtError(Status); return FALSE; } - + SafePolyPoints = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), TAG_SHAPE); if(!SafePolyPoints) { @@ -1592,7 +1592,7 @@ NtGdiGradientFill( SetLastWin32Error(ERROR_INVALID_PARAMETER); return FALSE; } - + _SEH_TRY { ProbeForRead(pVertex, @@ -1607,7 +1607,7 @@ NtGdiGradientFill( Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { DC_UnlockDc(dc); @@ -1621,7 +1621,7 @@ NtGdiGradientFill( SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } - + SafeMesh = (PTRIVERTEX)(SafeVertex + uVertex); _SEH_TRY @@ -1639,7 +1639,7 @@ NtGdiGradientFill( Status = _SEH_GetExceptionCode(); } _SEH_END; - + if(!NT_SUCCESS(Status)) { DC_UnlockDc(dc); diff --git a/reactos/subsystems/win32/win32k/objects/gdiobj.c b/reactos/subsystems/win32/win32k/objects/gdiobj.c index 3b2bee308d9..5e784da862c 100644 --- a/reactos/subsystems/win32/win32k/objects/gdiobj.c +++ b/reactos/subsystems/win32/win32k/objects/gdiobj.c @@ -781,13 +781,13 @@ GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType) ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1); HandleProcessId = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~1); - + /* Check for invalid owner. */ if (ProcessId != HandleProcessId && HandleProcessId != NULL) { return NULL; } - + /* * Prevent the thread from being terminated during the locking process. * It would result in undesired effects and inconsistency of the global @@ -800,12 +800,12 @@ GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType) * Loop until we either successfully lock the handle entry & object or * fail some of the check. */ - + for (;;) { /* Lock the handle table entry. */ LockedProcessId = (HANDLE)((ULONG_PTR)HandleProcessId | 0x1); - PrevProcId = InterlockedCompareExchangePointer(&Entry->ProcessId, + PrevProcId = InterlockedCompareExchangePointer(&Entry->ProcessId, LockedProcessId, HandleProcessId); @@ -929,13 +929,13 @@ GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD Expected ProcessId = (HANDLE)((ULONG_PTR)PsGetCurrentProcessId() & ~1); HandleProcessId = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~1); - + /* Check for invalid owner. */ if (ProcessId != HandleProcessId && HandleProcessId != NULL) { return NULL; } - + /* * Prevent the thread from being terminated during the locking process. * It would result in undesired effects and inconsistency of the global @@ -948,12 +948,12 @@ GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD Expected * Loop until we either successfully lock the handle entry & object or * fail some of the check. */ - + for (;;) { /* Lock the handle table entry. */ LockedProcessId = (HANDLE)((ULONG_PTR)HandleProcessId | 0x1); - PrevProcId = InterlockedCompareExchangePointer(&Entry->ProcessId, + PrevProcId = InterlockedCompareExchangePointer(&Entry->ProcessId, LockedProcessId, HandleProcessId); diff --git a/reactos/subsystems/win32/win32k/objects/line.c b/reactos/subsystems/win32/win32k/objects/line.c index ea6ba0d4f12..af16ac45cf8 100644 --- a/reactos/subsystems/win32/win32k/objects/line.c +++ b/reactos/subsystems/win32/win32k/objects/line.c @@ -418,14 +418,14 @@ NtGdiPolyDraw( POINT lastmove; unsigned int i; - dc = DC_LockDc(hdc); + dc = DC_LockDc(hdc); if(!dc) return FALSE; _SEH_TRY { ProbeArrayForRead(lppt, sizeof(POINT), cCount, sizeof(LONG)); ProbeArrayForRead(lpbTypes, sizeof(BYTE), cCount, sizeof(BYTE)); - + /* check for each bezierto if there are two more points */ for( i = 0; i < cCount; i++ ) if( lpbTypes[i] != PT_MOVETO && @@ -434,11 +434,11 @@ NtGdiPolyDraw( if( cCount < i+3 ) _SEH_LEAVE; else i += 2; } - + /* if no moveto occurs, we will close the figure here */ lastmove.x = dc->Dc_Attr.ptlCurrent.x; lastmove.y = dc->Dc_Attr.ptlCurrent.y; - + /* now let's draw */ for( i = 0; i < cCount; i++ ) { @@ -460,14 +460,14 @@ NtGdiPolyDraw( i += 2; } else _SEH_LEAVE; - + if( lpbTypes[i] & PT_CLOSEFIGURE ) { if( PATH_IsPathOpen( dc->w.path ) ) IntGdiCloseFigure( dc ); else IntGdiLineTo( dc, lastmove.x, lastmove.y ); } } - + result = TRUE; } _SEH_HANDLE @@ -475,7 +475,7 @@ NtGdiPolyDraw( SetLastNtError(_SEH_GetExceptionCode()); } _SEH_END; - + DC_UnlockDc(dc); return result; diff --git a/reactos/subsystems/win32/win32k/objects/metafile.c b/reactos/subsystems/win32/win32k/objects/metafile.c index a2b61f45658..1d2c7c7995b 100644 --- a/reactos/subsystems/win32/win32k/objects/metafile.c +++ b/reactos/subsystems/win32/win32k/objects/metafile.c @@ -32,17 +32,17 @@ NtGdiCloseEnhMetaFile(HDC hDC) PDD_ENHMETAFILEOBJ phmf; HANDLE hMapping = 0; EMREOF emr; - PDC Dc; + PDC Dc; + + IO_STATUS_BLOCK Iosb; + NTSTATUS Status; + - IO_STATUS_BLOCK Iosb; - NTSTATUS Status; - - Dc = DC_LockDc(hDC); if (Dc == NULL) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); + { + SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } @@ -51,10 +51,10 @@ NtGdiCloseEnhMetaFile(HDC hDC) emr.nPalEntries = 0; emr.offPalEntries = 0; emr.nSizeLast = emr.emr.nSize; - - if(Dc->hFile) - { - Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&emr, emr.emr.nSize, NULL, NULL); + + if(Dc->hFile) + { + Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&emr, emr.emr.nSize, NULL, NULL); if (Status == STATUS_PENDING) { Status = NtWaitForSingleObject(Dc->hFile,FALSE,NULL); @@ -65,8 +65,8 @@ NtGdiCloseEnhMetaFile(HDC hDC) } if (NT_SUCCESS(Status)) - { - DWORD len = Dc->emh->nBytes + emr.emr.nSize; + { + DWORD len = Dc->emh->nBytes + emr.emr.nSize; /* always resize the buffer */ emh = EngAllocMem(FL_ZERO_MEMORY, len, 0); if (emh != NULL) @@ -87,14 +87,14 @@ NtGdiCloseEnhMetaFile(HDC hDC) else { Dc->hFile = NULL; - DPRINT1("Write to EnhMetaFile fail\n"); - } + DPRINT1("Write to EnhMetaFile fail\n"); + } } - + Dc->emh->nBytes += emr.emr.nSize; Dc->emh->nRecords++; - if(Dc->emh->rclFrame.left > Dc->emh->rclFrame.right) + if(Dc->emh->rclFrame.left > Dc->emh->rclFrame.right) { Dc->emh->rclFrame.left = Dc->emh->rclBounds.left * Dc->emh->szlMillimeters.cx * 100 / Dc->emh->szlDevice.cx; Dc->emh->rclFrame.top = Dc->emh->rclBounds.top * Dc->emh->szlMillimeters.cy * 100 / Dc->emh->szlDevice.cy; @@ -104,7 +104,7 @@ NtGdiCloseEnhMetaFile(HDC hDC) if (Dc->hFile) /* disk based metafile */ { - FILE_POSITION_INFORMATION FilePosition; + FILE_POSITION_INFORMATION FilePosition; LARGE_INTEGER Distance ; IO_STATUS_BLOCK IoStatusBlock; @@ -122,37 +122,37 @@ NtGdiCloseEnhMetaFile(HDC hDC) Distance.u.HighPart = 0; FilePosition.CurrentByteOffset.QuadPart = Distance.QuadPart; - DPRINT1("Trying write to metafile and map it\n"); + DPRINT1("Trying write to metafile and map it\n"); - Status = NtSetInformationFile(Dc->hFile, &IoStatusBlock, &FilePosition, + Status = NtSetInformationFile(Dc->hFile, &IoStatusBlock, &FilePosition, sizeof(FILE_POSITION_INFORMATION), FilePositionInformation); if (!NT_SUCCESS(Status)) { // SetLastErrorByStatus(Status); - SetLastWin32Error(ERROR_INVALID_HANDLE); + SetLastWin32Error(ERROR_INVALID_HANDLE); NtClose( Dc->hFile ); DC_UnlockDc(Dc); - NtGdiDeleteObjectApp(hDC); + NtGdiDeleteObjectApp(hDC); - DPRINT1("NtSetInformationFile fail\n"); + DPRINT1("NtSetInformationFile fail\n"); return hmf; } if (FilePosition.CurrentByteOffset.u.LowPart != 0) { // SetLastErrorByStatus(Status); - SetLastWin32Error(ERROR_INVALID_HANDLE); + SetLastWin32Error(ERROR_INVALID_HANDLE); NtClose( Dc->hFile ); DC_UnlockDc(Dc); - NtGdiDeleteObjectApp(hDC); - DPRINT1("FilePosition.CurrentByteOffset.u.LowPart is not 0\n"); + NtGdiDeleteObjectApp(hDC); + DPRINT1("FilePosition.CurrentByteOffset.u.LowPart is not 0\n"); return hmf; } - Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&Dc->emh, sizeof(*Dc->emh), NULL, NULL); + Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&Dc->emh, sizeof(*Dc->emh), NULL, NULL); if (Status == STATUS_PENDING) { Status = NtWaitForSingleObject(Dc->hFile,FALSE,NULL); @@ -162,43 +162,43 @@ NtGdiCloseEnhMetaFile(HDC hDC) } } - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { - NtClose( Dc->hFile ); + NtClose( Dc->hFile ); DC_UnlockDc(Dc); - NtGdiDeleteObjectApp(hDC); - DPRINT1("fail to write 0\n"); + NtGdiDeleteObjectApp(hDC); + DPRINT1("fail to write 0\n"); return hmf; } - + EngFreeMem(Dc->emh); - /* create maping */ - DesiredAccess = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ; + /* create maping */ + DesiredAccess = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ; Attributes = (PAGE_READONLY & (SEC_FILE | SEC_IMAGE | SEC_RESERVE | SEC_NOCACHE | SEC_COMMIT)); - flProtect = PAGE_READONLY ^ (PAGE_READONLY & (SEC_FILE | SEC_IMAGE | SEC_RESERVE | SEC_NOCACHE | SEC_COMMIT)); + flProtect = PAGE_READONLY ^ (PAGE_READONLY & (SEC_FILE | SEC_IMAGE | SEC_RESERVE | SEC_NOCACHE | SEC_COMMIT)); + + if (!Attributes) Attributes = SEC_COMMIT; - if (!Attributes) Attributes = SEC_COMMIT; - if (Dc->hFile == INVALID_HANDLE_VALUE) - { + { Dc->hFile = NULL; if (!SectionSize) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); - hMapping = NULL; - DPRINT1("fail !SectionSize \n"); + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + hMapping = NULL; + DPRINT1("fail !SectionSize \n"); } } else { Status = NtCreateSection(&hMapping, DesiredAccess, ObjectAttributes, SectionSize, flProtect, Attributes, Dc->hFile); if (!NT_SUCCESS(Status)) - { + { //SetLastErrorByStatus(Status); - SetLastWin32Error(ERROR_INVALID_HANDLE); + SetLastWin32Error(ERROR_INVALID_HANDLE); hMapping = NULL; - DPRINT1("fail NtCreateSection \n"); + DPRINT1("fail NtCreateSection \n"); } } @@ -207,17 +207,17 @@ NtGdiCloseEnhMetaFile(HDC hDC) SectionOffset.HighPart = 0; ViewBase = NULL; ViewSize = 0; - + Protect = PAGE_READONLY; - - Status = ZwMapViewOfSection(&hMapping, NtCurrentProcess(), &ViewBase, 0, + + Status = ZwMapViewOfSection(&hMapping, NtCurrentProcess(), &ViewBase, 0, 0, &SectionOffset, &ViewSize, ViewShare, 0, Protect); if (!NT_SUCCESS(Status)) - { + { //SetLastErrorByStatus(Status); - SetLastWin32Error(ERROR_INVALID_HANDLE); + SetLastWin32Error(ERROR_INVALID_HANDLE); Dc->emh = NULL; - DPRINT1("fail ZwMapViewOfSection \n"); + DPRINT1("fail ZwMapViewOfSection \n"); } else { @@ -229,7 +229,7 @@ NtGdiCloseEnhMetaFile(HDC hDC) if (Dc->hFile != NULL) NtClose( Dc->hFile ); } - + hmf = GDIOBJ_AllocObj(GdiHandleTable, GDI_OBJECT_TYPE_ENHMETAFILE); if (hmf != NULL) { @@ -239,19 +239,19 @@ NtGdiCloseEnhMetaFile(HDC hDC) if (Dc->hFile != NULL) { phmf->on_disk = TRUE; - } + } else { phmf->on_disk = FALSE; } GDIOBJ_UnlockObjByPtr(GdiHandleTable, phmf); phmf->emh = Dc->emh; - } - } + } + } Dc->emh = NULL; /* So it won't be deleted */ DC_UnlockDc(Dc); - NtGdiDeleteObjectApp(hDC); + NtGdiDeleteObjectApp(hDC); return hmf; } @@ -276,18 +276,18 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, CONST LPRECT Rect, LPCWSTR Description) { - PDC Dc; + PDC Dc; HDC ret = NULL; DWORD length = 0; HDC tempHDC; DWORD MemSize; DWORD dwDesiredAccess; - + tempHDC = hDCRef; if (hDCRef == NULL) { /* FIXME ?? - * Shall we create hdc NtGdiHdcCompatible hdc ?? + * Shall we create hdc NtGdiHdcCompatible hdc ?? */ UNICODE_STRING DriverName; RtlInitUnicodeString(&DriverName, L"DISPLAY"); @@ -303,54 +303,54 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, GDIOBJ_SetOwnership(GdiHandleTable, tempHDC, PsGetCurrentProcess()); DC_SetOwnership(tempHDC, PsGetCurrentProcess()); - + Dc = DC_LockDc(tempHDC); if (Dc == NULL) - { + { if (hDCRef == NULL) { - NtGdiDeleteObjectApp(tempHDC); + NtGdiDeleteObjectApp(tempHDC); } - SetLastWin32Error(ERROR_INVALID_HANDLE); + SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } - - if(Description) - { + + if(Description) + { length = wcslen(Description); length += wcslen(Description + length + 1); length += 3; length *= 2; } - + MemSize = sizeof(ENHMETAHEADER) + (length + 3) / 4 * 4; - - if (!(Dc->emh = EngAllocMem(FL_ZERO_MEMORY, MemSize, 0))) + + if (!(Dc->emh = EngAllocMem(FL_ZERO_MEMORY, MemSize, 0))) { DC_UnlockDc(Dc); if (hDCRef == NULL) { - NtGdiDeleteObjectApp(tempHDC); - } + NtGdiDeleteObjectApp(tempHDC); + } SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } - + Dc->emh->iType = EMR_HEADER; Dc->emh->nSize = MemSize; Dc->emh->rclBounds.left = Dc->emh->rclBounds.top = 0; Dc->emh->rclBounds.right = Dc->emh->rclBounds.bottom = -1; - if(Rect) + if(Rect) { Dc->emh->rclFrame.left = Rect->left; Dc->emh->rclFrame.top = Rect->top; Dc->emh->rclFrame.right = Rect->right; Dc->emh->rclFrame.bottom = Rect->bottom; - } - else - { + } + else + { /* Set this to {0,0 - -1,-1} and update it at the end */ Dc->emh->rclFrame.left = Dc->emh->rclFrame.top = 0; Dc->emh->rclFrame.right = Dc->emh->rclFrame.bottom = -1; @@ -371,7 +371,7 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, /* Size in pixels */ Dc->emh->szlDevice.cx = NtGdiGetDeviceCaps(tempHDC, HORZRES); - Dc->emh->szlDevice.cy = NtGdiGetDeviceCaps(tempHDC, VERTRES); + Dc->emh->szlDevice.cy = NtGdiGetDeviceCaps(tempHDC, VERTRES); /* Size in millimeters */ Dc->emh->szlMillimeters.cx = NtGdiGetDeviceCaps(tempHDC, HORZSIZE); @@ -386,12 +386,12 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, memcpy((char *)Dc->emh + sizeof(ENHMETAHEADER), Description, length); } - ret = tempHDC; - if (File) + ret = tempHDC; + if (File) { DPRINT1("Trying Create EnhMetaFile\n"); - /* disk based metafile */ + /* disk based metafile */ dwDesiredAccess = GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE | FILE_READ_ATTRIBUTES; OBJECT_ATTRIBUTES ObjectAttributes; IO_STATUS_BLOCK IoStatusBlock; @@ -413,13 +413,13 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, } InitializeObjectAttributes(&ObjectAttributes, &NtPathU, 0, NULL, NULL); - + Status = NtCreateFile (&Dc->hFile, dwDesiredAccess, &ObjectAttributes, &IoStatusBlock, NULL, FileAttributes, 0, FILE_OVERWRITE_IF, FILE_NON_DIRECTORY_FILE, NULL, 0); RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathU.Buffer); - + if (!NT_SUCCESS(Status)) { Dc->hFile = NULL; @@ -427,7 +427,7 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, if (hDCRef == NULL) { NtGdiDeleteObjectApp(tempHDC); - } + } DPRINT1("Create EnhMetaFile fail\n"); SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; @@ -435,7 +435,7 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, SetLastWin32Error(IoStatusBlock.Information == FILE_OVERWRITTEN ? ERROR_ALREADY_EXISTS : 0); - Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&Dc->emh, Dc->emh->nSize, NULL, NULL); + Status = NtWriteFile(Dc->hFile, NULL, NULL, NULL, &Iosb, (PVOID)&Dc->emh, Dc->emh->nSize, NULL, NULL); if (Status == STATUS_PENDING) { Status = NtWaitForSingleObject(Dc->hFile,FALSE,NULL); @@ -457,7 +457,7 @@ NtGdiCreateEnhMetaFile(HDC hDCRef, SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); ret = NULL; DC_UnlockDc(Dc); - if (hDCRef == NULL) + if (hDCRef == NULL) { NtGdiDeleteObjectApp(tempHDC); } diff --git a/reactos/subsystems/win32/win32k/objects/palobj.c b/reactos/subsystems/win32/win32k/objects/palobj.c index fd24256aa24..b353a20cd1f 100644 --- a/reactos/subsystems/win32/win32k/objects/palobj.c +++ b/reactos/subsystems/win32/win32k/objects/palobj.c @@ -329,7 +329,7 @@ INT STDCALL PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapO } if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++; - if (palPtr->mapping != NULL) + if (palPtr->mapping != NULL) { palPtr->mapping[uStart] = index; } diff --git a/reactos/subsystems/win32/win32k/objects/path.c b/reactos/subsystems/win32/win32k/objects/path.c index 70803301544..b9ba4374f26 100644 --- a/reactos/subsystems/win32/win32k/objects/path.c +++ b/reactos/subsystems/win32/win32k/objects/path.c @@ -67,7 +67,7 @@ NtGdiBeginPath( HDC hDC ) PDC dc = DC_LockDc ( hDC ); if( !dc ) return FALSE; - + /* If path is already open, do nothing */ if ( dc->w.path.state != PATH_Open ) { @@ -105,12 +105,12 @@ NtGdiCloseFigure(HDC hDC) { BOOL Ret = FALSE; // default to failure PDC pDc; - + DPRINT("Enter %s\n", __FUNCTION__); - + pDc = DC_LockDc(hDC); if(!pDc) return FALSE; - + if(pDc->w.path.state==PATH_Open) { IntGdiCloseFigure(pDc); @@ -121,7 +121,7 @@ NtGdiCloseFigure(HDC hDC) // FIXME: check if lasterror is set correctly SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); } - + DC_UnlockDc(pDc); return Ret; @@ -156,9 +156,9 @@ NtGdiFillPath(HDC hDC) PDC dc = DC_LockDc ( hDC ); if ( !dc ) return FALSE; - + ret = PATH_FillPath( dc, &dc->w.path ); - if( ret ) + if( ret ) { /* FIXME: Should the path be emptied even if conversion failed? */ @@ -175,9 +175,9 @@ NtGdiFlattenPath(HDC hDC) { BOOL Ret = FALSE; DC *pDc; - + DPRINT("Enter %s\n", __FUNCTION__); - + pDc = DC_LockDc(hDC); if(!pDc) return FALSE; @@ -224,7 +224,7 @@ NtGdiGetPath( SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); goto done; } - + if(nSize==0) { ret = pPath->numEntriesUsed; @@ -240,10 +240,10 @@ NtGdiGetPath( { memcpy(Points, pPath->pPoints, sizeof(POINT)*pPath->numEntriesUsed); memcpy(Types, pPath->pFlags, sizeof(BYTE)*pPath->numEntriesUsed); - + /* Convert the points to logical coordinates */ IntDPtoLP(dc, Points, pPath->numEntriesUsed); - + ret = pPath->numEntriesUsed; } _SEH_HANDLE @@ -252,8 +252,8 @@ NtGdiGetPath( } _SEH_END } - -done: + +done: DC_UnlockDc(dc); return ret; } @@ -265,15 +265,15 @@ NtGdiPathToRegion(HDC hDC) GdiPath *pPath; HRGN hrgnRval = 0; DC *pDc; - + DPRINT("Enter %s\n", __FUNCTION__); - + pDc = DC_LockDc(hDC); if(!pDc) return NULL; pPath = &pDc->w.path; - if(pPath->state!=PATH_Closed) + if(pPath->state!=PATH_Closed) { //FIXME: check that setlasterror is being called correctly SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); @@ -284,7 +284,7 @@ NtGdiPathToRegion(HDC hDC) if(PATH_PathToRegion(pPath, pDc->Dc_Attr.jFillMode, &hrgnRval)) PATH_EmptyPath(pPath); } - + DC_UnlockDc(pDc); return hrgnRval; } @@ -304,17 +304,17 @@ BOOL STDCALL NtGdiStrokeAndFillPath(HDC hDC) { - DC *pDc; + DC *pDc; BOOL bRet = FALSE; DPRINT("Enter %s\n", __FUNCTION__); - + if(!(pDc = DC_LockDc(hDC))) return FALSE; bRet = PATH_FillPath(pDc, &pDc->w.path); if(bRet) bRet = PATH_StrokePath(pDc, &pDc->w.path); if(bRet) PATH_EmptyPath(&pDc->w.path); - + DC_UnlockDc(pDc); return bRet; } @@ -327,12 +327,12 @@ NtGdiStrokePath(HDC hDC) BOOL bRet = FALSE; DPRINT("Enter %s\n", __FUNCTION__); - + if(!(pDc = DC_LockDc(hDC))) return FALSE; bRet = PATH_StrokePath(pDc, &pDc->w.path); PATH_EmptyPath(&pDc->w.path); - + DC_UnlockDc(pDc); return bRet; } @@ -382,11 +382,11 @@ BOOL STDCALL NtGdiSelectClipPath(HDC hDC, /* PATH_FillPath - * - * + * + * */ BOOL -FASTCALL +FASTCALL PATH_FillPath( PDC dc, GdiPath *pPath ) { INT mapMode, graphicsMode; @@ -400,7 +400,7 @@ PATH_FillPath( PDC dc, GdiPath *pPath ) SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); return FALSE; } - + if( PATH_PathToRegion( pPath, dc->Dc_Attr.jFillMode, &hrgn )) { /* Since PaintRgn interprets the region as being in logical coordinates @@ -425,7 +425,7 @@ PATH_FillPath( PDC dc, GdiPath *pPath ) * not reset the world transform. */ xform = dc->w.xformWorld2Wnd; - + /* Set MM_TEXT */ IntGdiSetMapMode( dc, MM_TEXT ); dc->Dc_Attr.ptlViewportOrg.x = 0; @@ -643,7 +643,7 @@ PATH_Rectangle ( PDC dc, INT x1, INT y1, INT x2, INT y2 ) /* Close the rectangle figure */ IntGdiCloseFigure(dc) ; - + return TRUE; } @@ -1473,10 +1473,10 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, GdiPath *pPath) XFORM xform; DPRINT("Enter %s\n", __FUNCTION__); - + if(pPath->state != PATH_Closed) return FALSE; - + /* Save the mapping mode info */ mapMode=dc->Dc_Attr.iMapMode; IntGetViewportExtEx(dc, &szViewportExt); @@ -1497,33 +1497,33 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, GdiPath *pPath) dc->Dc_Attr.iGraphicsMode = graphicsMode; /* Allocate enough memory for the worst case without beziers (one PT_MOVETO - * and the rest PT_LINETO with PT_CLOSEFIGURE at the end) plus some buffer + * and the rest PT_LINETO with PT_CLOSEFIGURE at the end) plus some buffer * space in case we get one to keep the number of reallocations small. */ - nAlloc = pPath->numEntriesUsed + 1 + 300; + nAlloc = pPath->numEntriesUsed + 1 + 300; pLinePts = ExAllocatePoolWithTag(PagedPool, nAlloc * sizeof(POINT), TAG_PATH); if(!pLinePts) { DPRINT1("Can't allocate pool!\n"); SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); goto end; - } + } nLinePts = 0; - for(i = 0; i < pPath->numEntriesUsed; i++) + for(i = 0; i < pPath->numEntriesUsed; i++) { - if((i == 0 || (pPath->pFlags[i-1] & PT_CLOSEFIGURE)) - && (pPath->pFlags[i] != PT_MOVETO)) + if((i == 0 || (pPath->pFlags[i-1] & PT_CLOSEFIGURE)) + && (pPath->pFlags[i] != PT_MOVETO)) { - DPRINT1("Expected PT_MOVETO %s, got path flag %d\n", + DPRINT1("Expected PT_MOVETO %s, got path flag %d\n", i == 0 ? "as first point" : "after PT_CLOSEFIGURE", (INT)pPath->pFlags[i]); goto end; } - - switch(pPath->pFlags[i]) + + switch(pPath->pFlags[i]) { case PT_MOVETO: - DPRINT("Got PT_MOVETO (%ld, %ld)\n", + DPRINT("Got PT_MOVETO (%ld, %ld)\n", pPath->pPoints[i].x, pPath->pPoints[i].y); if(nLinePts >= 2) IntGdiPolyline(dc, pLinePts, nLinePts); nLinePts = 0; @@ -1543,32 +1543,32 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, GdiPath *pPath) DPRINT1("Path didn't contain 3 successive PT_BEZIERTOs\n"); ret = FALSE; goto end; - } - else + } + else { INT nBzrPts, nMinAlloc; POINT *pBzrPts = GDI_Bezier(&pPath->pPoints[i-1], 4, &nBzrPts); - /* Make sure we have allocated enough memory for the lines of + /* Make sure we have allocated enough memory for the lines of * this bezier and the rest of the path, assuming we won't get * another one (since we won't reallocate again then). */ nMinAlloc = nLinePts + (pPath->numEntriesUsed - i) + nBzrPts; if(nAlloc < nMinAlloc) { // Reallocate memory - + POINT *Realloc = NULL; nAlloc = nMinAlloc * 2; - - Realloc = ExAllocatePoolWithTag(PagedPool, - nAlloc * sizeof(POINT), + + Realloc = ExAllocatePoolWithTag(PagedPool, + nAlloc * sizeof(POINT), TAG_PATH); - + if(!Realloc) { DPRINT1("Can't allocate pool!\n"); goto end; } - + memcpy(Realloc, pLinePts, nLinePts*sizeof(POINT)); ExFreePool(pLinePts); pLinePts = Realloc; @@ -1583,16 +1583,16 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, GdiPath *pPath) DPRINT1("Got path flag %d (not supported)\n", (INT)pPath->pFlags[i]); goto end; } - + if(pPath->pFlags[i] & PT_CLOSEFIGURE) { pLinePts[nLinePts++] = pLinePts[0]; } }//for - + if(nLinePts >= 2) IntGdiPolyline(dc, pLinePts, nLinePts); - + ret = TRUE; end: @@ -1604,7 +1604,7 @@ end: dc->Dc_Attr.szlWindowExt.cy = szWindowExt.cy; dc->Dc_Attr.ptlWindowOrg.x = ptWindowOrg.x; dc->Dc_Attr.ptlWindowOrg.y = ptWindowOrg.y; - + dc->Dc_Attr.szlViewportExt.cx = szViewportExt.cx; dc->Dc_Attr.szlViewportExt.cy = szViewportExt.cy; dc->Dc_Attr.ptlViewportOrg.x = ptViewportOrg.x; @@ -1619,7 +1619,7 @@ end: dc->CurPosX|Y so that their values are in the correct mapping mode. */ - if(i > 0) + if(i > 0) { POINT pt; IntGetCurrentPositionEx(dc, &pt); diff --git a/reactos/subsystems/win32/win32k/objects/polyfill.c b/reactos/subsystems/win32/win32k/objects/polyfill.c index 87c056f53bb..e0b65e9462e 100644 --- a/reactos/subsystems/win32/win32k/objects/polyfill.c +++ b/reactos/subsystems/win32/win32k/objects/polyfill.c @@ -272,7 +272,7 @@ POLYGONFILL_MakeEdgeList(PPOINT Points, int Count) for ( CurPt = 1; CurPt < Count; ++CurPt ) { e = POLYGONFILL_MakeEdge ( Points[CurPt-1], Points[CurPt] ); - if ( !e ) + if ( !e ) goto fail; // if a straight horizontal line - who cares? @@ -284,7 +284,7 @@ POLYGONFILL_MakeEdgeList(PPOINT Points, int Count) e = POLYGONFILL_MakeEdge ( Points[CurPt-1], Points[0] ); if ( !e ) goto fail; - + if ( !e->absdy ) EngFreeMem ( e ); else @@ -292,7 +292,7 @@ POLYGONFILL_MakeEdgeList(PPOINT Points, int Count) return list; fail: - + DPRINT1("Out Of MEMORY!!\n"); POLYGONFILL_DestroyEdgeList ( list ); return 0; diff --git a/reactos/subsystems/win32/win32k/objects/print.c b/reactos/subsystems/win32/win32k/objects/print.c index 05617c1d7dc..084da7faf9d 100644 --- a/reactos/subsystems/win32/win32k/objects/print.c +++ b/reactos/subsystems/win32/win32k/objects/print.c @@ -192,14 +192,14 @@ NtGdiExtEscape( Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { DC_UnlockDc(pDC); SetLastNtError(Status); return -1; } - + SafeInData = ExAllocatePoolWithTag ( PagedPool, InSize, TAG_PRINT ); if ( !SafeInData ) { @@ -207,7 +207,7 @@ NtGdiExtEscape( SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); return -1; } - + _SEH_TRY { /* pointers were already probed! */ @@ -249,7 +249,7 @@ NtGdiExtEscape( SetLastNtError(Status); goto freeout; } - + SafeOutData = ExAllocatePoolWithTag ( PagedPool, OutSize, TAG_PRINT ); if ( !SafeOutData ) { diff --git a/reactos/subsystems/win32/win32k/objects/region.c b/reactos/subsystems/win32/win32k/objects/region.c index 7f5172d6ec2..4a1d202f66f 100644 --- a/reactos/subsystems/win32/win32k/objects/region.c +++ b/reactos/subsystems/win32/win32k/objects/region.c @@ -2528,7 +2528,7 @@ FASTCALL IntGdiPaintRgn(PDC dc, HRGN hRgn) { //RECT box; - HRGN tmpVisRgn; //, prevVisRgn; + HRGN tmpVisRgn; //, prevVisRgn; PROSRGNDATA visrgn; CLIPOBJ* ClipRegion; BOOL bRet = FALSE; @@ -2673,7 +2673,7 @@ NtGdiRectInRegion(HRGN hRgn, Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { RGNDATA_UnlockRgn(Rgn); @@ -2735,7 +2735,7 @@ NtGdiUnionRectWithRgn(HRGN hDest, CONST PRECT UnsafeRect) SetLastWin32Error(ERROR_INVALID_HANDLE); return NULL; } - + _SEH_TRY { ProbeForRead(UnsafeRect, @@ -2789,7 +2789,7 @@ DWORD STDCALL NtGdiGetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata) else /* user requested buffer size with rgndata NULL */ return size + sizeof(RGNDATAHEADER); } - + _SEH_TRY { ProbeForWrite(rgndata, @@ -2807,7 +2807,7 @@ DWORD STDCALL NtGdiGetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata) Status = _SEH_GetExceptionCode(); } _SEH_END; - + if(!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -3427,7 +3427,7 @@ GdiCreatePolyPolygonRgn(CONST PPOINT pt, /* Windows doesn't set a last error here */ return (HRGN)0; } - + _SEH_TRY { ProbeForRead(PolyCounts, @@ -3443,7 +3443,7 @@ GdiCreatePolyPolygonRgn(CONST PPOINT pt, Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -3468,7 +3468,7 @@ GdiCreatePolyPolygonRgn(CONST PPOINT pt, Status = _SEH_GetExceptionCode(); } _SEH_END; - + if (!NT_SUCCESS(Status)) { ExFreePool(SafePolyCounts); diff --git a/reactos/subsystems/win32/win32k/objects/stockobj.c b/reactos/subsystems/win32/win32k/objects/stockobj.c index a9125bbbc7e..92da7ff3d85 100644 --- a/reactos/subsystems/win32/win32k/objects/stockobj.c +++ b/reactos/subsystems/win32/win32k/objects/stockobj.c @@ -101,7 +101,7 @@ static LOGFONTW DeviceDefaultFont = static LOGFONTW SystemFixedFont = { 11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, L"Courier New" }; //Bitstream Vera Sans Mono - + /* FIXME: Is this correct? */ static LOGFONTW DefaultGuiFont = { 11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index 69a58021fd9..3d7d5512d15 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -365,7 +365,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) #if 1 /* This (Wine) code doesn't seem to work correctly for us */ FontGDI->TextMetric.tmAscent = (FT_MulFix(Face->ascender, YScale) + 32) >> 6; FontGDI->TextMetric.tmDescent = (FT_MulFix(Face->descender, YScale) + 32) >> 6; - FontGDI->TextMetric.tmHeight = (FT_MulFix(Face->ascender, YScale) - + FontGDI->TextMetric.tmHeight = (FT_MulFix(Face->ascender, YScale) - FT_MulFix(Face->descender, YScale)) >> 6; #else FontGDI->TextMetric.tmAscent = (Face->size->metrics.ascender + 32) >> 6; /* units above baseline */ @@ -498,7 +498,7 @@ TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont) if (lf->lfEscapement != lf->lfOrientation) { /* this should really depend on whether GM_ADVANCED is set */ - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation = + TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation = TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement; } TEXTOBJ_UnlockText(TextObj); @@ -531,7 +531,7 @@ NtGdiHfontCreate( HFONT NewFont; PTEXTOBJ TextObj; NTSTATUS Status = STATUS_SUCCESS; - + if (NULL != pelfw) { Status = MmCopyFromCaller(&SafeLogfont, pelfw, sizeof(ENUMLOGFONTEXDVW)); @@ -541,18 +541,18 @@ NtGdiHfontCreate( if (NULL != NewFont) { TextObj = TEXTOBJ_LockText(NewFont); - + if (NULL != TextObj) { - RtlCopyMemory ( &TextObj->logfont, + RtlCopyMemory ( &TextObj->logfont, &SafeLogfont, sizeof(ENUMLOGFONTEXDVW)); - if (SafeLogfont.elfEnumLogfontEx.elfLogFont.lfEscapement != + if (SafeLogfont.elfEnumLogfontEx.elfLogFont.lfEscapement != SafeLogfont.elfEnumLogfontEx.elfLogFont.lfOrientation) { /* this should really depend on whether GM_ADVANCED is set */ - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation = + TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation = TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement; } TEXTOBJ_UnlockText(TextObj); @@ -570,10 +570,10 @@ NtGdiHfontCreate( { Status = STATUS_INVALID_PARAMETER; } - + return NT_SUCCESS(Status) ? NewFont : NULL; -} +} BOOL @@ -1503,18 +1503,18 @@ NtGdiGlyphCacheSet( INT error; PFONT_CACHE_ENTRY NewEntry; -// DbgPrint("CacheSet.\n"); +// DbgPrint("CacheSet.\n"); error = FT_Get_Glyph(GlyphSlot, &GlyphCopy); if (error) { - DbgPrint("Failure caching glyph.\n"); + DbgPrint("Failure caching glyph.\n"); return NULL; }; error = FT_Glyph_To_Bitmap(&GlyphCopy, RenderMode, 0, 1); if (error) { - DbgPrint("Failure rendering glyph.\n"); + DbgPrint("Failure rendering glyph.\n"); return NULL; }; @@ -1873,14 +1873,14 @@ NtGdiExtTextOut( } glyph = face->glyph; - realglyph = NtGdiGlyphCacheSet(face, glyph_index, + realglyph = NtGdiGlyphCacheSet(face, glyph_index, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight, glyph, RenderMode); if (!realglyph) { DPRINT1("Failed to render glyph! [index: %u]\n", glyph_index); IntUnLockFreeType; goto fail; - } + } } /* retrieve kerning distance */ @@ -1924,7 +1924,7 @@ NtGdiExtTextOut( else glyph_index = FT_Get_Char_Index(face, *String); - if (!(realglyph = NtGdiGlyphCacheGet(face, glyph_index, + if (!(realglyph = NtGdiGlyphCacheGet(face, glyph_index, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight))) { error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); @@ -1935,17 +1935,17 @@ NtGdiExtTextOut( goto fail; } glyph = face->glyph; - realglyph = NtGdiGlyphCacheSet(face, - glyph_index, - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight, - glyph, + realglyph = NtGdiGlyphCacheSet(face, + glyph_index, + TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight, + glyph, RenderMode); if (!realglyph) { DPRINT1("Failed to render glyph! [index: %u]\n", glyph_index); IntUnLockFreeType; goto fail; - } + } } // DbgPrint("realglyph: %x\n", realglyph); // DbgPrint("TextLeft: %d\n", TextLeft); @@ -2239,7 +2239,7 @@ NtGdiGetCharABCWidths(HDC hDC, for (i = FirstChar; i <= LastChar; i++) { int adv, lsb, bbx, left, right; - + glyph_index = FT_Get_Char_Index(face, i); FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); @@ -2413,8 +2413,8 @@ NtGdiGetFontLanguageInfo(HDC hDC) return 0; } -static -void +static +void FTVectorToPOINTFX(FT_Vector *vec, POINTFX *pt) { pt->x.value = vec->x >> 6; @@ -2426,7 +2426,7 @@ FTVectorToPOINTFX(FT_Vector *vec, POINTFX *pt) return; } -/* +/* This function builds an FT_Fixed from a float. It puts the integer part in the highest 16 bits and the decimal part in the lowest 16 bits of the FT_Fixed. It fails if the integer part of the float number is greater than SHORT_MAX. @@ -2438,8 +2438,8 @@ static inline FT_Fixed FT_FixedFromFloat(float f) return (FT_Fixed)((long)value << 16 | (unsigned long)fract); } -/* - This function builds an FT_Fixed from a FIXED. It simply put f.value +/* + This function builds an FT_Fixed from a FIXED. It simply put f.value in the highest 16 bits and f.fract in the lowest 16 bits of the FT_Fixed. */ static inline FT_Fixed FT_FixedFromFIXED(FIXED f) @@ -2533,7 +2533,7 @@ NtGdiGetGlyphOutline( DPRINT("This font face has %d charmaps\n", ft_face->num_charmaps); - + for (n = 0; n < ft_face->num_charmaps; n++) { charmap = ft_face->charmaps[n]; @@ -2585,12 +2585,12 @@ NtGdiGetGlyphOutline( if (aveWidth && potm) { - widthRatio = (FLOAT)aveWidth * eM11 / + widthRatio = (FLOAT)aveWidth * eM11 / (FLOAT) potm->otmTextMetrics.tmAveCharWidth; } left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64; - right = (INT)((ft_face->glyph->metrics.horiBearingX + + right = (INT)((ft_face->glyph->metrics.horiBearingX + ft_face->glyph->metrics.width) * widthRatio + 63) & -64; adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6; @@ -2600,7 +2600,7 @@ NtGdiGetGlyphOutline( DPRINT("Advance = %d, lsb = %d, bbx = %d\n",adv, lsb, bbx); IntLockFreeType; - + /* Scaling transform */ if (aveWidth) { @@ -2667,7 +2667,7 @@ NtGdiGetGlyphOutline( gm.gmCellIncX = adv; gm.gmCellIncY = 0; } - else + else { INT xc, yc; FT_Vector vec; @@ -2718,7 +2718,7 @@ NtGdiGetGlyphOutline( gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.y); IntUnLockFreeType; - + if (pgm) { Status = MmCopyToCaller(pgm, &gm, sizeof(GLYPHMETRICS)); @@ -2731,7 +2731,7 @@ NtGdiGetGlyphOutline( } if (iFormat == GGO_METRICS) - { + { DPRINT("GGO_METRICS Exit!\n"); return 1; /* FIXME */ } @@ -2752,7 +2752,7 @@ NtGdiGetGlyphOutline( } RtlZeroMemory(pvBuf, cjBuf); } - + switch(iFormat) { @@ -2835,14 +2835,14 @@ NtGdiGetGlyphOutline( RtlZeroMemory(ft_bitmap.buffer, cjBuf); FT_Outline_Get_Bitmap(library, &ft_face->glyph->outline, &ft_bitmap); IntUnLockFreeType; - + if(iFormat == GGO_GRAY2_BITMAP) mult = 4; else if(iFormat == GGO_GRAY4_BITMAP) mult = 16; else if(iFormat == GGO_GRAY8_BITMAP) - mult = 64; - else + mult = 64; + else { ASSERT(0); break; @@ -2910,7 +2910,7 @@ NtGdiGetGlyphOutline( if(pvBuf) FTVectorToPOINTFX(&outline->points[first_pt], &ppc->apfx[cpfx]); cpfx++; - } + } else if(point <= outline->contours[contour] && outline->tags[point] & FT_Curve_Tag_On) { @@ -3039,7 +3039,7 @@ NtGdiGetGlyphOutline( cpfx += 3; point++; } - } + } while(point <= outline->contours[contour] && (outline->tags[point] & FT_Curve_Tag_On) == (outline->tags[point-1] & FT_Curve_Tag_On)); @@ -3116,7 +3116,7 @@ NtGdiGetOutlineTextMetricsInternalW (HDC hDC, ULONG Size; OUTLINETEXTMETRICW *potm; NTSTATUS Status; - + dc = DC_LockDc(hDC); if (dc == NULL) { @@ -3195,7 +3195,7 @@ NtGdiGetTextCharsetInfo( TT_OS2 *pOS2; FT_Face Face; NTSTATUS Status; - + Dc = DC_LockDc(hdc); if (!Dc) { @@ -3226,7 +3226,7 @@ NtGdiGetTextCharsetInfo( fs.fsUsb[2] = pOS2->ulUnicodeRange3; fs.fsUsb[3] = pOS2->ulUnicodeRange4; fs_fsCsb0 = pOS2->ulCodePageRange1; - if (pOS2->version == 0) + if (pOS2->version == 0) { FT_UInt dummy; @@ -4134,19 +4134,19 @@ FontGetObject(PTEXTOBJ TFont, INT Count, PVOID Buffer) { case sizeof(ENUMLOGFONTEXDVW): - RtlCopyMemory( (LPENUMLOGFONTEXDVW) Buffer, + RtlCopyMemory( (LPENUMLOGFONTEXDVW) Buffer, &TFont->logfont, sizeof(ENUMLOGFONTEXDVW)); break; case sizeof(ENUMLOGFONTEXW): - RtlCopyMemory( (LPENUMLOGFONTEXW) Buffer, + RtlCopyMemory( (LPENUMLOGFONTEXW) Buffer, &TFont->logfont.elfEnumLogfontEx, sizeof(ENUMLOGFONTEXW)); - break; + break; case sizeof(EXTLOGFONTW): case sizeof(ENUMLOGFONTW): - RtlCopyMemory((LPENUMLOGFONTW) Buffer, + RtlCopyMemory((LPENUMLOGFONTW) Buffer, &TFont->logfont.elfEnumLogfontEx.elfLogFont, sizeof(ENUMLOGFONTW)); break; @@ -4159,7 +4159,7 @@ FontGetObject(PTEXTOBJ TFont, INT Count, PVOID Buffer) default: SetLastWin32Error(ERROR_BUFFER_OVERFLOW); - return 0; + return 0; } return Count; } @@ -4176,7 +4176,7 @@ IntGetFullFileName( HANDLE hFile; IO_STATUS_BLOCK IoStatusBlock; ULONG Desired; - + InitializeObjectAttributes(&ObjectAttributes, FileName, OBJ_CASE_INSENSITIVE, @@ -4278,7 +4278,7 @@ IntGdiGetFontResourceInfo( if (!bFound && dwType != 5) { - /* Font could not be found in system table + /* Font could not be found in system table dwType == 5 will still handle this */ return FALSE; } @@ -4343,7 +4343,7 @@ NtGdiGetFontResourceInfoInternalW( /* FIXME: handle cFiles > 0 */ - /* Check for valid dwType values + /* Check for valid dwType values dwType == 4 seems to be handled by gdi32 only */ if (dwType == 4 || dwType > 5) { diff --git a/reactos/subsystems/win32/win32k/stubs/stubs.c b/reactos/subsystems/win32/win32k/stubs/stubs.c index 90462c7272c..9107ddadc64 100644 --- a/reactos/subsystems/win32/win32k/stubs/stubs.c +++ b/reactos/subsystems/win32/win32k/stubs/stubs.c @@ -1305,7 +1305,7 @@ NtGdiCLIPOBJ_ppoGetPath(CLIPOBJ *ClipObj) /* * @unimplemented */ -BOOL +BOOL STDCALL NtGdiEnableEudc(BOOL enable) { @@ -1446,7 +1446,7 @@ NtGdiEngTransparentBlt(IN SURFOBJ *Dest, /* * @unimplemented */ -BOOL STDCALL +BOOL STDCALL NtGdiEngTextOut(SURFOBJ *pso, STROBJ *pstro, FONTOBJ *pfo, @@ -1492,7 +1492,7 @@ NtGdiEngDeletePalette(IN HPALETTE Palette) /* * @unimplemented */ -BOOL STDCALL +BOOL STDCALL NtGdiEngStrokeAndFillPath(SURFOBJ *pso, PATHOBJ *ppo, CLIPOBJ *pco, @@ -1564,7 +1564,7 @@ NtGdiEngFillPath(SURFOBJ *pso, return FALSE; } -BOOL STDCALL +BOOL STDCALL NtGdiEngGradientFill(SURFOBJ *psoDest, CLIPOBJ *pco, XLATEOBJ *pxlo, @@ -1599,7 +1599,7 @@ NtGdiEngLineTo(SURFOBJ *Surface, /* * @unimplemented */ -BOOL STDCALL +BOOL STDCALL NtGdiEngMarkBandingSurface(HSURF hsurf) { UNIMPLEMENTED; @@ -1624,7 +1624,7 @@ NtGdiEngPaint(IN SURFOBJ *Surface, /* * @unimplemented */ -BOOL STDCALL +BOOL STDCALL NtGdiEngPlgBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMsk, @@ -1644,7 +1644,7 @@ NtGdiEngPlgBlt(SURFOBJ *psoTrg, /* * @unimplemented */ -BOOL STDCALL +BOOL STDCALL NtGdiEngStretchBltROP(SURFOBJ *psoDest, SURFOBJ *psoSrc, SURFOBJ *psoMask, @@ -1936,7 +1936,7 @@ NtGdiFONTOBJ_pfdg(IN FONTOBJ *pfo) * @unimplemented */ PVOID -STDCALL +STDCALL NtGdiFONTOBJ_pvTrueTypeFontFile( IN FONTOBJ *pfo, OUT ULONG *pcjFile @@ -2397,7 +2397,7 @@ NtGdiEnumFontOpen( * @unimplemented */ BOOL -STDCALL +STDCALL NtGdiEudcLoadUnloadLink( IN OPTIONAL LPCWSTR pBaseFaceName, IN UINT cwcBaseFaceName, @@ -2648,9 +2648,9 @@ NtGdiQueryFonts( OUT PUNIVERSAL_FONT_ID pufiFontList, */ INT STDCALL -NtGdiGetSpoolMessage( DWORD u1, - DWORD u2, - DWORD u3, +NtGdiGetSpoolMessage( DWORD u1, + DWORD u2, + DWORD u3, DWORD u4) { /* FIXME the prototypes */ @@ -2737,7 +2737,7 @@ NtGdiGetMonitorID( /* * @unimplemented */ -BOOL +BOOL NtGdiGetRealizationInfo( IN HDC hdc, OUT PREALIZATION_INFO pri, @@ -2856,7 +2856,7 @@ NtGdiQueryFontAssocInfo( /* * @unimplemented */ -DWORD +DWORD NtGdiGetFontUnicodeRanges( IN HDC hdc, OUT OPTIONAL LPGLYPHSET pgs) @@ -2869,7 +2869,7 @@ NtGdiGetFontUnicodeRanges( * @unimplemented */ UINT -STDCALL +STDCALL NtGdiGetStringBitmapW( IN HDC hdc, IN LPWSTR pwsz, @@ -3274,7 +3274,7 @@ NtGdiGetUFIPathname( * @unimplemented */ ULONG -STDCALL +STDCALL NtGdiGetEmbedFonts( VOID) { @@ -3286,7 +3286,7 @@ NtGdiGetEmbedFonts( * @unimplemented */ BOOL -STDCALL +STDCALL NtGdiChangeGhostFont( IN KERNEL_PVOID *pfontID, IN BOOL bLoad) @@ -3299,7 +3299,7 @@ NtGdiChangeGhostFont( * @unimplemented */ BOOL -STDCALL +STDCALL NtGdiAddEmbFontToDC( IN HDC hdc, IN VOID **pFontID) @@ -3456,7 +3456,7 @@ NtGdiSelectFont( * @unimplemented */ HPEN -STDCALL +STDCALL NtGdiSelectPen( IN HDC hdc, IN HPEN hpen) @@ -3536,7 +3536,7 @@ NtGdiSetMagicColors( * @unimplemented */ LONG -STDCALL +STDCALL NtGdiGetDeviceWidth( IN HDC hdc) { diff --git a/reactos/tools/bin2res/bin2res.c b/reactos/tools/bin2res/bin2res.c index 33ad1403b74..38ba8ed48e7 100644 --- a/reactos/tools/bin2res/bin2res.c +++ b/reactos/tools/bin2res/bin2res.c @@ -47,7 +47,7 @@ extern int mkstemps(char *template, int suffix_len); -int process_resources(const char* input_file_name, const char* specific_file_name, +int process_resources(const char* input_file_name, const char* specific_file_name, const char* relative_path, const char* output_path, int inserting, int force_processing, int verbose); @@ -59,7 +59,7 @@ static const char* help = " -o extract the named file from the file\n" " -b assume resources are relative to this base path\n" " -f force processing of older resources\n" - " -v causes the command to be verbous during processing\n" + " -v causes the command to be verbous during processing\n" " -h print this help screen and exit\n" "\n" "This tool allows the insertion/extractions of embedded binary\n" @@ -171,7 +171,7 @@ char* get_filename_with_full_path(char* output, const char* filename, const char return output; } -void process_includes(const char* input_file_name, const char* specific_file_name, +void process_includes(const char* input_file_name, const char* specific_file_name, const char* relative_path, const char* output_path, int inserting, int force_processing, int verbose) { @@ -193,7 +193,7 @@ void process_includes(const char* input_file_name, const char* specific_file_nam fclose(fin); } -int process_resources(const char* input_file_name, const char* specific_file_name, +int process_resources(const char* input_file_name, const char* specific_file_name, const char* relative_path, const char* output_path, int inserting, int force_processing, int verbose) { diff --git a/reactos/tools/buildno/buildno.cpp b/reactos/tools/buildno/buildno.cpp index df5f1274b5c..7576f7e3fa3 100644 --- a/reactos/tools/buildno/buildno.cpp +++ b/reactos/tools/buildno/buildno.cpp @@ -59,7 +59,7 @@ tm_dump (const char *tag, struct tm * t) int count_wide_string( wchar_t *str ) { int i; - + for( i = 0; str[i]; i++ ); return i; @@ -170,12 +170,12 @@ write_h (int build, char *buildstr) int dllversion = KERNEL_VERSION_MAJOR + 42; s1 = s = (char *) malloc(256 * 1024); - + s = s + sprintf (s, "/* Do not edit - Machine generated */\n"); - + s = s + sprintf (s, "#ifndef _INC_REACTOS_BUILDNO\n" ); s = s + sprintf (s, "#define _INC_REACTOS_BUILDNO\n" ); - + s = s + sprintf (s, "#define KERNEL_VERSION_BUILD\t%d\n", build); s = s + sprintf (s, "#define KERNEL_VERSION_BUILD_HEX\t0x%x\n", atoi(GetRev())); s = s + sprintf (s, "#define KERNEL_VERSION_BUILD_STR\t\"%s\"\n", buildstr); @@ -203,7 +203,7 @@ write_h (int build, char *buildstr) s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type); - s = s + sprintf (s, "#define KERNEL_VERSION_STR\t\"%d.%d", + s = s + sprintf (s, "#define KERNEL_VERSION_STR\t\"%d.%d", KERNEL_VERSION_MAJOR, KERNEL_VERSION_MINOR); if (0 != KERNEL_VERSION_PATCH_LEVEL) @@ -235,7 +235,7 @@ write_h (int build, char *buildstr) s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type); - s = s + sprintf (s, "#define REACTOS_DLL_VERSION_STR\t\"%d.%d", + s = s + sprintf (s, "#define REACTOS_DLL_VERSION_STR\t\"%d.%d", dllversion, KERNEL_VERSION_MINOR); if (0 != KERNEL_VERSION_PATCH_LEVEL) @@ -253,7 +253,7 @@ write_h (int build, char *buildstr) if (length == strlen(s1)) { char* orig; - + orig = (char *) malloc(length); fseek(h, 0, SEEK_SET); fread(orig, 1, length, h); @@ -268,7 +268,7 @@ write_h (int build, char *buildstr) } h = fopen (filename, "wb"); - if (!h) + if (!h) { fprintf (stderr, "%s: can not create file \"%s\"!\n", @@ -307,7 +307,7 @@ main (int argc, char * argv []) struct tm * t1_tm = NULL; argv0 = argv[0]; - + switch (argc) { case 1: @@ -361,7 +361,7 @@ main (int argc, char * argv []) kernel_version_build_type[i] = KERNEL_VERSION_BUILD_TYPE[i]; } kernel_version_build_type[i] = 0; - + time (& t1); /* current build time */ t1_tm = gmtime (& t1); @@ -374,7 +374,7 @@ main (int argc, char * argv []) #endif if (! quiet) { - printf ( + printf ( "Current date: %4d-%02d-%02d\n\n", t1_tm->tm_year, (t1_tm->tm_mon + 1), diff --git a/reactos/tools/buildno/pch.h b/reactos/tools/buildno/pch.h index caa13f20456..16177f82a27 100644 --- a/reactos/tools/buildno/pch.h +++ b/reactos/tools/buildno/pch.h @@ -40,7 +40,7 @@ inline char * strlwr(char *x) #define _finite __finite #define _isnan __isnan #define stricmp strcasecmp -#define MAX_PATH PATH_MAX +#define MAX_PATH PATH_MAX #define _MAX_PATH PATH_MAX #endif diff --git a/reactos/tools/cdmake/cdmake.c b/reactos/tools/cdmake/cdmake.c index f2485d9caa2..b36c25ae47a 100644 --- a/reactos/tools/cdmake/cdmake.c +++ b/reactos/tools/cdmake/cdmake.c @@ -19,7 +19,7 @@ * - No Joliet file name validations * - Very bad ISO file name generation * - * + * * convert long filename to iso9660 file name by Magnus Olsen * magnus@greatlord.com * @@ -557,8 +557,8 @@ void parse_filename_into_dirrecord ( const char* filename, PDIR_RECORD d, BOOL d const char *s = filename; char *t = d->name_on_cd; char *n = d->name; - int joliet_length; - int filename_counter; + int joliet_length; + int filename_counter; filename_counter = 1; while (*s != 0) { @@ -567,7 +567,7 @@ void parse_filename_into_dirrecord ( const char* filename, PDIR_RECORD d, BOOL d s++; break; } - + if ( (t-d->name_on_cd) < sizeof(d->name_on_cd)-1 ) *t++ = check_for_punctuation(*s, filename); else if (!joliet) @@ -611,21 +611,21 @@ void parse_filename_into_dirrecord ( const char* filename, PDIR_RECORD d, BOOL d filename_counter = 1; while ( cdname_exists ( d ) ) { - - // the file name must be least 8 char long - if (strlen(d->name_on_cd)<8) - error_exit ( "'%s' is a duplicate file name, aborting...", filename ); - if ((d->name_on_cd[8] == '.') && (strlen(d->name_on_cd) < 13)) - error_exit ( "'%s' is a duplicate file name, aborting...", filename ); - - // max 255 times for equal short filename - if (filename_counter>255) error_exit ( "'%s' is a duplicate file name, aborting...", filename ); + // the file name must be least 8 char long + if (strlen(d->name_on_cd)<8) + error_exit ( "'%s' is a duplicate file name, aborting...", filename ); + + if ((d->name_on_cd[8] == '.') && (strlen(d->name_on_cd) < 13)) + error_exit ( "'%s' is a duplicate file name, aborting...", filename ); + + // max 255 times for equal short filename + if (filename_counter>255) error_exit ( "'%s' is a duplicate file name, aborting...", filename ); d->name_on_cd[8] = '~'; - memset(&d->name_on_cd[9],0,5); - sprintf(&d->name_on_cd[9],"%d",filename_counter); - filename_counter++; - + memset(&d->name_on_cd[9],0,5); + sprintf(&d->name_on_cd[9],"%d",filename_counter); + filename_counter++; + } if ( joliet ) @@ -1075,12 +1075,12 @@ static void get_file_specifications(PDIR_RECORD d) { if (d != &root) { - get_file_specifications(d->parent); + get_file_specifications(d->parent); if (d->joliet_name == NULL) append_string_to_source(d->name); else append_string_to_source(d->joliet_name); - + if (((d->flags & DIRECTORY_FLAG) == 0 || joliet) && d->extension[0] != 0) { if (d->joliet_name == NULL) @@ -1173,7 +1173,7 @@ static void pass(void) { write_string("\2CD001\1"); write_byte(0); - + write_word_block(16, L' '); // system identifier t = volume_label; diff --git a/reactos/tools/create_nls/create_nls.c b/reactos/tools/create_nls/create_nls.c index e3da0fe157b..4e21ce31b0f 100644 --- a/reactos/tools/create_nls/create_nls.c +++ b/reactos/tools/create_nls/create_nls.c @@ -218,7 +218,7 @@ static BOOL create_nls_file(char *name, CPINFOEXA *cpi, WCHAR *table, WCHAR *oem * 1. (256 * sizeof(WORD)) primary CP to Unicode table + * 2. (WORD) optional OEM glyph table size in words + * 3. OEM glyph table size in words * sizeof(WORD) + - * 4. (WORD) Number of DBCS LeadByte ranges + + * 4. (WORD) Number of DBCS LeadByte ranges + * 5. if (Number of DBCS LeadByte ranges != 0) 256 * sizeof(WORD) offsets of lead byte sub tables * 6. (Number of DBCS LeadByte sub tables * 256 * sizeof(WORD)) LeadByte sub tables + * 7. (WORD) Unknown flag @@ -298,7 +298,7 @@ static WCHAR *Load_CP2Unicode_Table(char *table_name, UINT cp, CPINFOEXA *cpi) int lb_ranges, lb_range_started, line; printf("Loading translation table \"%s\"\n", table_name); - + /* Init to default values */ memset(cpi, 0, sizeof(CPINFOEXA)); cpi->CodePage = cp; @@ -409,7 +409,7 @@ static WCHAR *Load_OEM2Unicode_Table(char *table_name, WCHAR *def_table, UINT cp int line; printf("Loading oem glyph table \"%s\"\n", table_name); - + table = (WCHAR *)malloc(sizeof(WCHAR) * 65536); if(!table) { printf("Not enough memory for Codepage to Unicode table\n"); diff --git a/reactos/tools/depends.c b/reactos/tools/depends.c index 4d8cbaab869..447bc825629 100644 --- a/reactos/tools/depends.c +++ b/reactos/tools/depends.c @@ -20,7 +20,7 @@ int main(int argc, char* argv[]) } prefix = strdup(argv[1]); - + out = fopen(argv[2], "wb"); if (out == NULL) { @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) i++; } buf[i] = 0; - + if (i == 0) { return(0); @@ -97,7 +97,7 @@ int main(int argc, char* argv[]) { *dot = 0; } - fprintf(out, "%s/.%s.TAG %s/.%s.d %s/%s.%s:%s ", prefix, buf, prefix, buf, + fprintf(out, "%s/.%s.TAG %s/.%s.d %s/%s.%s:%s ", prefix, buf, prefix, buf, prefix,buf,ext ? ext : "o" , buf2); while ((ch = fgetc(stdin)) != EOF) diff --git a/reactos/tools/gendib/gendib.c b/reactos/tools/gendib/gendib.c index ef2cc782d35..acc097d9c8a 100644 --- a/reactos/tools/gendib/gendib.c +++ b/reactos/tools/gendib/gendib.c @@ -572,7 +572,7 @@ CreateBitCase(FILE *Out, unsigned Bpp, PROPINFO RopInfo, int Flags, { Output(Out, "PatternX = BasePatternX;\n"); } - + if (ROPCODE_SRCCOPY == RopInfo->RopCode && 0 != (Flags & FLAG_TRIVIALXLATE) && Bpp == SourceBpp) { @@ -850,7 +850,7 @@ CreatePrimitive(FILE *Out, unsigned Bpp, PROPINFO RopInfo) MARK(Out); } Output(Out, "LineCount = BltInfo->DestRect.bottom - BltInfo->DestRect.top;\n"); - + Output(Out, "\n"); if (RopInfo->UsesPattern) { @@ -955,7 +955,7 @@ CreateTable(FILE *Out, unsigned Bpp) static void CreateBitBlt(FILE *Out, unsigned Bpp) -{ +{ MARK(Out); Output(Out, "\n"); Output(Out, "BOOLEAN\n"); diff --git a/reactos/tools/mkflpimg.c b/reactos/tools/mkflpimg.c index 5f5defea5af..544c6a41f84 100644 --- a/reactos/tools/mkflpimg.c +++ b/reactos/tools/mkflpimg.c @@ -123,7 +123,7 @@ disk_sector_t *new_image(char *bsfname) root = (root_entry_t *)img[N_RESERVED + N_FATS * SECTORS_PER_FAT]; strncpy(root->name, "REACTOS ", 11); root->attribute = ATTR_VOLUME; - + return img; } @@ -253,7 +253,7 @@ int copy_files(disk_sector_t *img, char *filenames[], int n_files) } printf(" %s\n", filenames[i]); - + size = 0; while ((n = fread(img[k], 1, SECTOR_SIZE, f)) > 0) { @@ -339,7 +339,7 @@ int main(int argc, char *argv[]) { return 1; } - + printf("Finished.\n"); return 0; diff --git a/reactos/tools/mkhive/cmi.c b/reactos/tools/mkhive/cmi.c index 6175becd8c8..3eabb64dedc 100644 --- a/reactos/tools/mkhive/cmi.c +++ b/reactos/tools/mkhive/cmi.c @@ -160,13 +160,13 @@ CmiAddKeyToHashTable( if (HashCell->Table[i].HashValue > HashValue) break; } - + if (i < KeyCell->SubKeyCounts[StorageType]) { RtlMoveMemory(HashCell->Table + i + 1, HashCell->Table + i, (HashCell->HashTableSize - 1 - i) * - sizeof(HashCell->Table[0])); + sizeof(HashCell->Table[0])); } HashCell->Table[i].KeyOffset = NKBOffset; diff --git a/reactos/tools/mkhive/registry.h b/reactos/tools/mkhive/registry.h index 7810ecd3fae..e867caaa3bb 100644 --- a/reactos/tools/mkhive/registry.h +++ b/reactos/tools/mkhive/registry.h @@ -167,7 +167,7 @@ extern EREGISTRY_HIVE SystemHive; /* \Registry\Machine\SYSTEM */ } /* - * PURPOSE: Returns the base address structure if the caller knows the + * PURPOSE: Returns the base address structure if the caller knows the * address of a field within the structure * ARGUMENTS: * Address = address of the field diff --git a/reactos/tools/ofw_interface/ofw_interface.cpp b/reactos/tools/ofw_interface/ofw_interface.cpp index 35bb0a61fee..5946c7b3e08 100644 --- a/reactos/tools/ofw_interface/ofw_interface.cpp +++ b/reactos/tools/ofw_interface/ofw_interface.cpp @@ -26,7 +26,7 @@ public: else lit_value = typestr.substr(amp+1); } if( col != std::string::npos ) { - if( amp > col && amp != std::string::npos ) + if( amp > col && amp != std::string::npos ) len = typestr.substr(col+1,amp-col+1); else len = typestr.substr(col+1); } @@ -36,7 +36,7 @@ public: c_type = typestr.substr(0,col); } - vartype( const vartype &other ) + vartype( const vartype &other ) : c_type(other.c_type), len(other.len), lit_value(other.lit_value) { @@ -66,7 +66,7 @@ std::string clip_eol( std::string in, const std::string &eol_marks ) { size_t found; for( size_t i = 0; i < eol_marks.size(); i++ ) { found = in.find( eol_marks[i] ); - if( found != std::string::npos ) + if( found != std::string::npos ) in = in.substr( 0, found ); } return in; @@ -112,7 +112,7 @@ void populate_definition( ofw_wrappers &wrapper, const std::string &line ) { for( i = 1; i < (int)name.size(); i++ ) if( name[i] == '-' ) name[i] = '_'; - if( nametext == "call-method" ) + if( nametext == "call-method" ) wrapper.method_ctindex = wrapper.ctindex; for( i = 0; i < args; i++ ) { @@ -151,7 +151,7 @@ void populate_definition( ofw_wrappers &wrapper, const std::string &line ) { for( int i = 0; i < args; i++ ) function << "\tstw %r" << (i+3) << "," << (4 * (i + 3)) << "(%r1)\n"; - + function << "\t/* Load up the call address */\n" << "\tlis %r10,ofw_call_addr@ha\n" << "\tlwz %r9,ofw_call_addr@l(%r10)\n" @@ -188,18 +188,18 @@ void populate_definition( ofw_wrappers &wrapper, const std::string &line ) { of_call << le_stub.str() << ";\n"; le_stub << " {\n"; - if( rettype != "void" ) + if( rettype != "void" ) le_stub << "\t" << rettype << " ret;\n"; if( method_call ) { - le_stub << "\tchar arg0[" - << round_up(nametext.size()+1,8) + le_stub << "\tchar arg0[" + << round_up(nametext.size()+1,8) << "] = \"" << nametext << "\";\n"; } for( i = 0; i < args; i++ ) { if( argtypes[i].lit_value.size() ) { - le_stub << "\t" << argtypes[i].c_type << " arg" << i << " = " + le_stub << "\t" << argtypes[i].c_type << " arg" << i << " = " << argtypes[i].lit_value << ";\n"; } } @@ -207,7 +207,7 @@ void populate_definition( ofw_wrappers &wrapper, const std::string &line ) { le_stub << "\t"; if( rettype != "void" ) le_stub << "ret = (" << rettype << ")"; - le_stub << "ofproxy(" << + le_stub << "ofproxy(" << (method_call ? (wrapper.method_ctindex * 4) : (wrapper.ctindex * 4)); for( i = 0; i < 6; i++ ) { @@ -217,7 +217,7 @@ void populate_definition( ofw_wrappers &wrapper, const std::string &line ) { le_stub << ");\n"; - if( rettype != "void" ) + if( rettype != "void" ) le_stub << "\treturn ret;\n"; le_stub << "}\n"; @@ -302,7 +302,7 @@ int main( int argc, char **argv ) { << "\n/* End */\n"; outcsource << "/* AUTOMATICALLY GENERATED BY ofw_interface */\n" - << "#include \"of.h\"\n" + << "#include \"of.h\"\n" << wrappers.le_stubs; outcheader << "/* AUTOMATICALLY GENERATE BY ofw_interface */\n" diff --git a/reactos/tools/pefixup.c b/reactos/tools/pefixup.c index 43d99aaf489..12c5b51cd46 100644 --- a/reactos/tools/pefixup.c +++ b/reactos/tools/pefixup.c @@ -318,7 +318,7 @@ int main(int argc, char **argv) dos_header = (PIMAGE_DOS_HEADER)buffer; nt_header = (PIMAGE_NT_HEADERS)(buffer + dtohl(dos_header->e_lfanew)); - + if (dtohs(dos_header->e_magic) != IMAGE_DOS_SIGNATURE || dtohl(nt_header->Signature) != IMAGE_NT_SIGNATURE) { diff --git a/reactos/tools/pipetools/pipespy.cpp b/reactos/tools/pipetools/pipespy.cpp index f91c1c85503..653c7f1def4 100644 --- a/reactos/tools/pipetools/pipespy.cpp +++ b/reactos/tools/pipetools/pipespy.cpp @@ -36,13 +36,13 @@ void dumphex(const char *buf, int len, int pos) for(i = 0; i < 16; i++) { if(i + j < len) printf("%02x%c", (unsigned char)buf[i + j], j + i + 1 == pos ? '*' : ' '); - else + else printf(" "); } for(i = 0; i < 16; i++) { if(i + j < len) printf("%c", buf[i + j] >= ' ' ? buf[i + j] : '.'); - else + else printf(" "); } printf("\n"); diff --git a/reactos/tools/pipetools/pipetunnel.cpp b/reactos/tools/pipetools/pipetunnel.cpp index f7ac369db2c..23643ff5776 100644 --- a/reactos/tools/pipetools/pipetunnel.cpp +++ b/reactos/tools/pipetools/pipetunnel.cpp @@ -213,7 +213,7 @@ LONG read_pipe(HANDLE hPipe, SOCKET sock) if (error == ERROR_PIPE_LISTENING) Sleep(1000); - else + else return error; } diff --git a/reactos/tools/rbuild/automaticdependency.cpp b/reactos/tools/rbuild/automaticdependency.cpp index 29d088cba81..402e8e3154b 100644 --- a/reactos/tools/rbuild/automaticdependency.cpp +++ b/reactos/tools/rbuild/automaticdependency.cpp @@ -18,7 +18,7 @@ */ #include "pch.h" #include -#include +#include #include "rbuild.h" @@ -117,7 +117,7 @@ SourceFile::ReadInclude ( string& filename, includeNext = true; include = true; } - + if ( include ) { SkipWhitespace (); @@ -396,7 +396,7 @@ AutomaticDependency::LocateIncludedFile ( SourceFile* sourceFile, if ( LocateIncludedFile ( *include.directory, includedFilename ) ) { - if ( includeNext && + if ( includeNext && include.directory->directory == sourceFile->file.file.directory && include.directory->relative_path == sourceFile->file.file.relative_path ) { diff --git a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp index a52e47f9342..108f21d535e 100644 --- a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp +++ b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp @@ -48,7 +48,7 @@ static class CBFactory : public Backend::Factory { return new CBBackend(project, configuration); } - + } factory; @@ -75,7 +75,7 @@ void CBBackend::Process() filename_wrkspace += "_auto.workspace"; printf ( "Creating Code::Blocks workspace: %s\n", filename_wrkspace.c_str() ); - + ProcessModules(); m_wrkspaceFile = fopen ( filename_wrkspace.c_str(), "wb" ); @@ -150,7 +150,7 @@ void CBBackend::ProcessFile(string &filepath) folder = filepath; folder.erase(pos, folder.length() - pos); } - + FileUnit fileUnit; fileUnit.filename = filepath; fileUnit.folder = folder; @@ -179,9 +179,9 @@ void CBBackend::AddFolders(string &folder) // Check if this folder was already added. true if it was, false otherwise. if(CheckFolderAdded(folder)) return; - + m_folders.push_back(folder); - + size_t pos = folder.rfind(string("/"), folder.length() - 1); if(pos == string::npos) @@ -230,7 +230,7 @@ CBBackend::DependFileName ( const Module& module ) const ); } -void +void CBBackend::_get_object_files ( const Module& module, vector& out) const { string basepath = module.output->relative_path; @@ -286,7 +286,7 @@ CBBackend::_clean_project_files ( void ) Module& module = *ProjectNode.modules[i]; vector out; printf("Cleaning project %s %s\n", module.name.c_str (), module.output->relative_path.c_str () ); - + string basepath = module.output->relative_path; remove ( CbpFileName ( module ).c_str () ); remove ( DependFileName ( module ).c_str () ); @@ -315,14 +315,14 @@ CBBackend::_generate_workspace ( FILE* OUT ) { Module& module = *ProjectNode.modules[i]; - if ((module.type != Iso) && + if ((module.type != Iso) && (module.type != LiveIso) && (module.type != IsoRegTest) && (module.type != LiveIsoRegTest)) { std::string Cbp_file = CbpFileName ( module ); fprintf ( OUT, "\t\t\r\n", Cbp_file.c_str()); - + /* dependencies */ vector ifs_list; ifs_list.push_back ( &module.project.non_if_data ); @@ -336,7 +336,7 @@ CBBackend::_generate_workspace ( FILE* OUT ) fprintf ( OUT, "\t\t\t\r\n", libs[j]->importedModule->output->relative_path.c_str(), libs[j]->name.c_str() ); } fprintf ( OUT, "\t\t\r\n" ); - } + } } fprintf ( OUT, "\t\r\n" ); fprintf ( OUT, "\r\n" ); @@ -556,7 +556,7 @@ CBBackend::_generate_cbproj ( const Module& module ) fprintf ( OUT, "\t\t\t\t